@empathyco/x-components 6.2.3 → 6.3.0

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 CHANGED
@@ -3,6 +3,13 @@
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.3.0](https://github.com/empathyco/x/compare/@empathyco/x-components@6.2.3...@empathyco/x-components@6.3.0) (2026-05-21)
7
+
8
+ ### Features
9
+
10
+ * allow empty prices (#2108)
11
+
12
+
6
13
  ## [6.2.3](https://github.com/empathyco/x/compare/@empathyco/x-components@6.2.2...@empathyco/x-components@6.2.3) (2026-05-20)
7
14
 
8
15
  ### Code Refactoring
@@ -8,7 +8,7 @@
8
8
 
9
9
  ```typescript
10
10
  __prices: {
11
- current: {
11
+ current?: {
12
12
  value: number;
13
13
  };
14
14
  previous?: {
@@ -113,7 +113,7 @@ string
113
113
 
114
114
  </td><td>
115
115
 
116
- { current: { value: number; }; previous?: { value: number; }; future?: { value: number; }; }
116
+ { current?: { value: number; }; previous?: { value: number; }; future?: { value: number; }; }
117
117
 
118
118
 
119
119
  </td><td>
@@ -56,7 +56,7 @@ Whether this result has a discount.
56
56
  </td></tr>
57
57
  <tr><td>
58
58
 
59
- [originalValue](./x-types.resultprice.originalvalue.md)
59
+ [originalValue?](./x-types.resultprice.originalvalue.md)
60
60
 
61
61
 
62
62
  </td><td>
@@ -64,18 +64,18 @@ Whether this result has a discount.
64
64
 
65
65
  </td><td>
66
66
 
67
- number
67
+ number \| undefined
68
68
 
69
69
 
70
70
  </td><td>
71
71
 
72
- The old value.
72
+ _(Optional)_ The old value.
73
73
 
74
74
 
75
75
  </td></tr>
76
76
  <tr><td>
77
77
 
78
- [value](./x-types.resultprice.value.md)
78
+ [value?](./x-types.resultprice.value.md)
79
79
 
80
80
 
81
81
  </td><td>
@@ -83,12 +83,12 @@ The old value.
83
83
 
84
84
  </td><td>
85
85
 
86
- number
86
+ number \| undefined
87
87
 
88
88
 
89
89
  </td><td>
90
90
 
91
- The current value.
91
+ _(Optional)_ The current value.
92
92
 
93
93
 
94
94
  </td></tr>
@@ -9,5 +9,5 @@ The old value.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- originalValue: number;
12
+ originalValue?: number | undefined;
13
13
  ```
@@ -9,5 +9,5 @@ The current value.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- value: number;
12
+ value?: number | undefined;
13
13
  ```
@@ -12,7 +12,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
12
12
  },
13
13
  [
14
14
  renderSlot(_ctx.$slots, "default", { result: _ctx.result }, () => [
15
- _ctx.result.price ? (openBlock(), createBlock(_component_BaseCurrency, {
15
+ _ctx.result.price?.value ? (openBlock(), createBlock(_component_BaseCurrency, {
16
16
  key: 0,
17
17
  value: _ctx.result.price.value,
18
18
  format: _ctx.format
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-current-price.vue.js","sources":["../../../../src/components/result/base-result-current-price.vue"],"sourcesContent":["<template>\n <div :class=\"dynamicClasses\" class=\"x-result-current-price\" data-test=\"result-current-price\">\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency v-if=\"result.price\" :value=\"result.price.value\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../utils/types'\nimport { computed, defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} current price\n * that may or may not be on sale.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n * - Default mask: 'i.iii,dd' which returns '1.345,67'.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n setup(props) {\n /**\n * Dynamic CSS classes to add to the root element of this component.\n *\n * @returns A booleans dictionary where each key is the class name to add,\n * and the boolean value tells if it should be added or not.\n * @internal\n */\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-result-current-price--on-sale': props.result.price?.hasDiscount ?? false,\n }))\n\n return {\n dynamicClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the current price formatted. You can provide the `format` by property or let\nthe `BaseCurrency` component use an injected one.\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\">\n <span class=\"custom-base-result-current-price\">{{ result.price.value }}</span>\n </BaseResultCurrentPrice>\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createBlock","_createCommentVNode"],"mappings":";;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IAQM,KAAA;AAAA,IAAA;AAAA,MARA,KAAA,EAAKC,cAAA,CAAA,CAAE,IAAA,CAAA,cAAA,EAAsB,wBAAwB,CAAA,CAAA;AAAA,MAAC,WAAA,EAAU;AAAA,KAAA;;AAKpE,MAAAC,UAAA,CAEO,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAFA,MAAA,EAAQ,IAAA,CAAA,MAAA,EAAM,EAArB,MAEO;AAAA,QADe,IAAA,CAAA,MAAA,CAAO,sBAA3BC,WAAA,CAAiF,uBAAA,EAAA;AAAA,UAAA,GAAA,EAAA,CAAA;AAA9C,UAAA,KAAA,EAAO,YAAO,KAAA,CAAM,KAAA;AAAA,UAAQ,MAAA,EAAQ,IAAA,CAAA;AAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,OAAA,EAAA,QAAA,CAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-result-current-price.vue.js","sources":["../../../../src/components/result/base-result-current-price.vue"],"sourcesContent":["<template>\n <div :class=\"dynamicClasses\" class=\"x-result-current-price\" data-test=\"result-current-price\">\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency v-if=\"result.price?.value\" :value=\"result.price.value\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../utils/types'\nimport { computed, defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} current price\n * that may or may not be on sale.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n * - Default mask: 'i.iii,dd' which returns '1.345,67'.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n setup(props) {\n /**\n * Dynamic CSS classes to add to the root element of this component.\n *\n * @returns A booleans dictionary where each key is the class name to add,\n * and the boolean value tells if it should be added or not.\n * @internal\n */\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-result-current-price--on-sale': props.result.price?.hasDiscount ?? false,\n }))\n\n return {\n dynamicClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the current price formatted. You can provide the `format` by property or let\nthe `BaseCurrency` component use an injected one.\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\">\n <span class=\"custom-base-result-current-price\">{{ result.price.value }}</span>\n </BaseResultCurrentPrice>\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createBlock","_createCommentVNode"],"mappings":";;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IAQM,KAAA;AAAA,IAAA;AAAA,MARA,KAAA,EAAKC,cAAA,CAAA,CAAE,IAAA,CAAA,cAAA,EAAsB,wBAAwB,CAAA,CAAA;AAAA,MAAC,WAAA,EAAU;AAAA,KAAA;;AAKpE,MAAAC,UAAA,CAEO,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAFA,MAAA,EAAQ,IAAA,CAAA,MAAA,EAAM,EAArB,MAEO;AAAA,QADe,IAAA,CAAA,MAAA,CAAO,KAAA,EAAO,KAAA,IAAAH,SAAA,EAAA,EAAlCI,WAAA,CAAwF,uBAAA,EAAA;AAAA,UAAA,GAAA,EAAA,CAAA;AAA9C,UAAA,KAAA,EAAO,YAAO,KAAA,CAAM,KAAA;AAAA,UAAQ,MAAA,EAAQ,IAAA,CAAA;AAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,OAAA,EAAA,QAAA,CAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-current-price.vue2.js","sources":["../../../../src/components/result/base-result-current-price.vue"],"sourcesContent":["<template>\n <div :class=\"dynamicClasses\" class=\"x-result-current-price\" data-test=\"result-current-price\">\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency v-if=\"result.price\" :value=\"result.price.value\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../utils/types'\nimport { computed, defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} current price\n * that may or may not be on sale.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n * - Default mask: 'i.iii,dd' which returns '1.345,67'.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n setup(props) {\n /**\n * Dynamic CSS classes to add to the root element of this component.\n *\n * @returns A booleans dictionary where each key is the class name to add,\n * and the boolean value tells if it should be added or not.\n * @internal\n */\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-result-current-price--on-sale': props.result.price?.hasDiscount ?? false,\n }))\n\n return {\n dynamicClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the current price formatted. You can provide the `format` by property or let\nthe `BaseCurrency` component use an injected one.\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\">\n <span class=\"custom-base-result-current-price\">{{ result.price.value }}</span>\n </BaseResultCurrentPrice>\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AAmBA;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,EAAE,YAAW,EAAG;AAC5B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;;;;;;;;;;;;;AAgBE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;AAME;AACF,QAAA,MAAM,cAAa,GAAI,QAAQ,CAAgB,OAAO;YACpD,iCAAiC,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,WAAU,IAAK,KAAK;AAC5E,SAAA,CAAC,CAAA;QAEF,OAAO;YACL,cAAc;SAChB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"base-result-current-price.vue2.js","sources":["../../../../src/components/result/base-result-current-price.vue"],"sourcesContent":["<template>\n <div :class=\"dynamicClasses\" class=\"x-result-current-price\" data-test=\"result-current-price\">\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency v-if=\"result.price?.value\" :value=\"result.price.value\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../utils/types'\nimport { computed, defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} current price\n * that may or may not be on sale.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n * - Default mask: 'i.iii,dd' which returns '1.345,67'.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n setup(props) {\n /**\n * Dynamic CSS classes to add to the root element of this component.\n *\n * @returns A booleans dictionary where each key is the class name to add,\n * and the boolean value tells if it should be added or not.\n * @internal\n */\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-result-current-price--on-sale': props.result.price?.hasDiscount ?? false,\n }))\n\n return {\n dynamicClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the current price formatted. You can provide the `format` by property or let\nthe `BaseCurrency` component use an injected one.\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultCurrentPrice :result=\"result\">\n <span class=\"custom-base-result-current-price\">{{ result.price.value }}</span>\n </BaseResultCurrentPrice>\n</template>\n\n<script setup>\nimport { BaseResultCurrentPrice } from '@empathyco/x-components'\nconst result = {\n price: { value: 123.45, hasDiscount: false },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AAmBA;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,EAAE,YAAW,EAAG;AAC5B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;;;;;;;;;;;;;AAgBE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;AAME;AACF,QAAA,MAAM,cAAa,GAAI,QAAQ,CAAgB,OAAO;YACpD,iCAAiC,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,WAAU,IAAK,KAAK;AAC5E,SAAA,CAAC,CAAA;QAEF,OAAO;YACL,cAAc;SAChB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from './base-result-previous-price.vue2.js';
2
- import { resolveComponent, openBlock, createElementBlock, renderSlot, createVNode, createCommentVNode } from 'vue';
2
+ import { resolveComponent, openBlock, createElementBlock, renderSlot, createBlock, createCommentVNode } from 'vue';
3
3
  import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
4
4
 
5
5
  const _hoisted_1 = {
@@ -11,10 +11,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11
11
  const _component_BaseCurrency = resolveComponent("BaseCurrency");
12
12
  return _ctx.result.price?.hasDiscount ? (openBlock(), createElementBlock("div", _hoisted_1, [
13
13
  renderSlot(_ctx.$slots, "default", { result: _ctx.result }, () => [
14
- createVNode(_component_BaseCurrency, {
14
+ _ctx.result.price?.originalValue ? (openBlock(), createBlock(_component_BaseCurrency, {
15
+ key: 0,
15
16
  value: _ctx.result.price.originalValue,
16
17
  format: _ctx.format
17
- }, null, 8, ["value", "format"])
18
+ }, null, 8, ["value", "format"])) : createCommentVNode("v-if", true)
18
19
  ])
19
20
  ])) : createCommentVNode("v-if", true);
20
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-previous-price.vue.js","sources":["../../../../src/components/result/base-result-previous-price.vue"],"sourcesContent":["<template>\n <div\n v-if=\"result.price?.hasDiscount\"\n class=\"x-result-previous-price\"\n data-test=\"result-previous-price\"\n >\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency :value=\"result.price.originalValue\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} previous price.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the previous price formatted if it has discount. The component has an optional\n`format` prop to select the currency format to be applied.\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\">\n <span class=\"custom-base-result-previous-price\">{{ result.price.originalValue }}</span>\n </BaseResultPreviousPrice>\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_createVNode"],"mappings":";;;;;;EAGI,KAAA,EAAM,yBAAA;AAAA,EACN,WAAA,EAAU;;;;AAFJ,EAAA,OAAA,IAAA,CAAA,MAAA,CAAO,KAAA,EAAO,WAAA,IAAAA,SAAA,EAAA,EADtBC,kBAAA,CAYM,KAAA,EAZN,UAAA,EAYM;AAAA,IAHJC,UAAA,CAEO,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAFA,MAAA,EAAQ,IAAA,CAAA,MAAA,IAAf,MAEO;AAAA,MADLC,WAAA,CAAqE,uBAAA,EAAA;AAAA,QAAtD,KAAA,EAAO,YAAO,KAAA,CAAM,aAAA;AAAA,QAAgB,MAAA,EAAQ,IAAA,CAAA;AAAA,OAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,OAAA,EAAA,QAAA,CAAA;;;;;;;;"}
1
+ {"version":3,"file":"base-result-previous-price.vue.js","sources":["../../../../src/components/result/base-result-previous-price.vue"],"sourcesContent":["<template>\n <div\n v-if=\"result.price?.hasDiscount\"\n class=\"x-result-previous-price\"\n data-test=\"result-previous-price\"\n >\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency\n v-if=\"result.price?.originalValue\"\n :value=\"result.price.originalValue\"\n :format=\"format\"\n />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} previous price.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the previous price formatted if it has discount. The component has an optional\n`format` prop to select the currency format to be applied.\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\">\n <span class=\"custom-base-result-previous-price\">{{ result.price.originalValue }}</span>\n </BaseResultPreviousPrice>\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_createBlock","_createCommentVNode"],"mappings":";;;;;;EAGI,KAAA,EAAM,yBAAA;AAAA,EACN,WAAA,EAAU;;;;AAFJ,EAAA,OAAA,IAAA,CAAA,MAAA,CAAO,KAAA,EAAO,WAAA,IAAAA,SAAA,EAAA,EADtBC,kBAAA,CAgBM,KAAA,EAhBN,UAAA,EAgBM;AAAA,IAPJC,UAAA,CAMO,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EANA,MAAA,EAAQ,IAAA,CAAA,MAAA,IAAf,MAMO;AAAA,MAJG,IAAA,CAAA,MAAA,CAAO,KAAA,EAAO,aAAA,IAAAF,SAAA,EAAA,EADtBG,WAAA,CAIE,uBAAA,EAAA;AAAA,QAAA,GAAA,EAAA,CAAA;AAFC,QAAA,KAAA,EAAO,YAAO,KAAA,CAAM,aAAA;AAAA,QACpB,MAAA,EAAQ,IAAA,CAAA;AAAA,OAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,OAAA,EAAA,QAAA,CAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-previous-price.vue2.js","sources":["../../../../src/components/result/base-result-previous-price.vue"],"sourcesContent":["<template>\n <div\n v-if=\"result.price?.hasDiscount\"\n class=\"x-result-previous-price\"\n data-test=\"result-previous-price\"\n >\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency :value=\"result.price.originalValue\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} previous price.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the previous price formatted if it has discount. The component has an optional\n`format` prop to select the currency format to be applied.\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\">\n <span class=\"custom-base-result-previous-price\">{{ result.price.originalValue }}</span>\n </BaseResultPreviousPrice>\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AAsBA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,EAAE,YAAW,EAAG;AAC5B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;;;;;;;;;;;;AAeE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACF,KAAA;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"base-result-previous-price.vue2.js","sources":["../../../../src/components/result/base-result-previous-price.vue"],"sourcesContent":["<template>\n <div\n v-if=\"result.price?.hasDiscount\"\n class=\"x-result-previous-price\"\n data-test=\"result-previous-price\"\n >\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency\n v-if=\"result.price?.originalValue\"\n :value=\"result.price.originalValue\"\n :format=\"format\"\n />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent } from 'vue'\nimport BaseCurrency from '../currency/base-currency.vue'\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result} previous price.\n *\n * @public\n */\nexport default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true,\n },\n /**\n * Format or mask to be defined as string.\n * - Use 'i' to define integer numbers.\n * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the\n * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.\n * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.\n * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more\n * than one character.\n * - Set whatever you need around the integers and decimals marks.\n *\n * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, delete significant digits.\n *\n * @public\n */\n format: {\n type: String,\n },\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the previous price formatted if it has discount. The component has an optional\n`format` prop to select the currency format to be applied.\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\">\n <span class=\"custom-base-result-previous-price\">{{ result.price.originalValue }}</span>\n </BaseResultPreviousPrice>\n</template>\n\n<script setup>\nimport { BaseResultPreviousPrice } from '@empathyco/x-components'\nconst result = {\n price: { originalValue: 199.99, hasDiscount: true },\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AA0BA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,EAAE,YAAW,EAAG;AAC5B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;;;;;;;;;;;;AAeE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACF,KAAA;AACF,CAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "6.2.3",
3
+ "version": "6.3.0",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -68,8 +68,8 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@empathyco/x-adapter": "8.1.6",
71
- "@empathyco/x-adapter-platform": "1.3.0",
72
- "@empathyco/x-types": "10.2.2",
71
+ "@empathyco/x-adapter-platform": "1.4.0",
72
+ "@empathyco/x-types": "10.3.0",
73
73
  "@empathyco/x-utils": "1.0.7",
74
74
  "@vue/devtools-api": "~6.6.4",
75
75
  "@vueuse/core": "~12.8.2",
@@ -117,5 +117,5 @@
117
117
  "access": "public",
118
118
  "directory": "dist"
119
119
  },
120
- "gitHead": "af88135eb04f0769bce8975638ee469496cef5a6"
120
+ "gitHead": "0707a73f5c7a80d3110d78bab73704f66bdb15d9"
121
121
  }
@@ -6829,7 +6829,7 @@
6829
6829
  },
6830
6830
  {
6831
6831
  "kind": "Content",
6832
- "text": "{\n current: {\n value: number;\n };\n previous?: {\n value: number;\n };\n future?: {\n value: number;\n };\n }"
6832
+ "text": "{\n current?: {\n value: number;\n };\n previous?: {\n value: number;\n };\n future?: {\n value: number;\n };\n }"
6833
6833
  },
6834
6834
  {
6835
6835
  "kind": "Content",
@@ -7111,11 +7111,11 @@
7111
7111
  "excerptTokens": [
7112
7112
  {
7113
7113
  "kind": "Content",
7114
- "text": "originalValue: "
7114
+ "text": "originalValue?: "
7115
7115
  },
7116
7116
  {
7117
7117
  "kind": "Content",
7118
- "text": "number"
7118
+ "text": "number | undefined"
7119
7119
  },
7120
7120
  {
7121
7121
  "kind": "Content",
@@ -7123,7 +7123,7 @@
7123
7123
  }
7124
7124
  ],
7125
7125
  "isReadonly": false,
7126
- "isOptional": false,
7126
+ "isOptional": true,
7127
7127
  "releaseTag": "Public",
7128
7128
  "name": "originalValue",
7129
7129
  "propertyTypeTokenRange": {
@@ -7138,11 +7138,11 @@
7138
7138
  "excerptTokens": [
7139
7139
  {
7140
7140
  "kind": "Content",
7141
- "text": "value: "
7141
+ "text": "value?: "
7142
7142
  },
7143
7143
  {
7144
7144
  "kind": "Content",
7145
- "text": "number"
7145
+ "text": "number | undefined"
7146
7146
  },
7147
7147
  {
7148
7148
  "kind": "Content",
@@ -7150,7 +7150,7 @@
7150
7150
  }
7151
7151
  ],
7152
7152
  "isReadonly": false,
7153
- "isOptional": false,
7153
+ "isOptional": true,
7154
7154
  "releaseTag": "Public",
7155
7155
  "name": "value",
7156
7156
  "propertyTypeTokenRange": {