@empathyco/x-components 3.0.0-alpha.364 → 3.0.0-alpha.366

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 (102) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/design-system/deprecated-full-theme.css +71 -71
  3. package/docs/API-reference/api/x-components.baseaddtocart.md +14 -11
  4. package/docs/API-reference/api/x-components.baseheadertogglepanel.animation.md +1 -1
  5. package/docs/API-reference/api/x-components.baseheadertogglepanel.md +1 -1
  6. package/docs/API-reference/api/x-components.basepricefilterlabel.md +46 -21
  7. package/docs/API-reference/api/x-components.baseratingfilterlabel.md +24 -11
  8. package/docs/API-reference/api/x-components.baseresultcurrentprice.md +20 -11
  9. package/docs/API-reference/api/x-components.baseresultimage.md +50 -13
  10. package/docs/API-reference/api/x-components.baseresultlink.md +15 -10
  11. package/docs/API-reference/api/x-components.baseresultpreviousprice.md +18 -11
  12. package/docs/API-reference/api/x-components.baseresultrating.md +20 -11
  13. package/docs/API-reference/api/x-components.basetogglepanel.md +24 -11
  14. package/docs/API-reference/api/x-components.md +9 -9
  15. package/js/components/filters/labels/base-price-filter-label.vue.js.map +1 -1
  16. package/js/components/filters/labels/base-price-filter-label.vue_rollup-plugin-vue_script.vue.js +79 -60
  17. package/js/components/filters/labels/base-price-filter-label.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  18. package/js/components/filters/labels/base-rating-filter-label.vue.js.map +1 -1
  19. package/js/components/filters/labels/base-rating-filter-label.vue_rollup-plugin-vue_script.vue.js +41 -29
  20. package/js/components/filters/labels/base-rating-filter-label.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  21. package/js/components/panels/base-header-toggle-panel.vue.js +1 -1
  22. package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
  23. package/js/components/panels/base-header-toggle-panel.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  24. package/js/components/panels/base-header-toggle-panel.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
  25. package/js/components/panels/base-toggle-panel.vue.js.map +1 -1
  26. package/js/components/panels/base-toggle-panel.vue_rollup-plugin-vue_script.vue.js +25 -15
  27. package/js/components/panels/base-toggle-panel.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  28. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  29. package/js/components/result/base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js +29 -23
  30. package/js/components/result/base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  31. package/js/components/result/base-result-current-price.vue.js.map +1 -1
  32. package/js/components/result/base-result-current-price.vue_rollup-plugin-vue_script.vue.js +47 -26
  33. package/js/components/result/base-result-current-price.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  34. package/js/components/result/base-result-image.vue.js +1 -1
  35. package/js/components/result/base-result-image.vue.js.map +1 -1
  36. package/js/components/result/base-result-image.vue_rollup-plugin-vue_script.vue.js +125 -96
  37. package/js/components/result/base-result-image.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  38. package/js/components/result/base-result-image.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
  39. package/js/components/result/base-result-link.vue.js +2 -1
  40. package/js/components/result/base-result-link.vue.js.map +1 -1
  41. package/js/components/result/base-result-link.vue_rollup-plugin-vue_script.vue.js +46 -27
  42. package/js/components/result/base-result-link.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  43. package/js/components/result/base-result-link.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
  44. package/js/components/result/base-result-previous-price.vue.js.map +1 -1
  45. package/js/components/result/base-result-previous-price.vue_rollup-plugin-vue_script.vue.js +34 -17
  46. package/js/components/result/base-result-previous-price.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  47. package/js/components/result/base-result-rating.vue.js +2 -1
  48. package/js/components/result/base-result-rating.vue.js.map +1 -1
  49. package/js/components/result/base-result-rating.vue_rollup-plugin-vue_script.vue.js +44 -27
  50. package/js/components/result/base-result-rating.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  51. package/js/components/result/base-result-rating.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
  52. package/js/utils/options-api.js +4 -0
  53. package/js/utils/options-api.js.map +1 -0
  54. package/package.json +6 -6
  55. package/report/x-components.api.json +3107 -1695
  56. package/report/x-components.api.md +228 -82
  57. package/types/components/filters/labels/base-price-filter-label.vue.d.ts +59 -13
  58. package/types/components/filters/labels/base-price-filter-label.vue.d.ts.map +1 -1
  59. package/types/components/filters/labels/base-rating-filter-label.vue.d.ts +33 -11
  60. package/types/components/filters/labels/base-rating-filter-label.vue.d.ts.map +1 -1
  61. package/types/components/panels/base-header-toggle-panel.vue.d.ts +2 -1
  62. package/types/components/panels/base-header-toggle-panel.vue.d.ts.map +1 -1
  63. package/types/components/panels/base-toggle-panel.vue.d.ts +35 -5
  64. package/types/components/panels/base-toggle-panel.vue.d.ts.map +1 -1
  65. package/types/components/result/base-result-add-to-cart.vue.d.ts +16 -8
  66. package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
  67. package/types/components/result/base-result-current-price.vue.d.ts +40 -10
  68. package/types/components/result/base-result-current-price.vue.d.ts.map +1 -1
  69. package/types/components/result/base-result-image.vue.d.ts +60 -70
  70. package/types/components/result/base-result-image.vue.d.ts.map +1 -1
  71. package/types/components/result/base-result-link.vue.d.ts +18 -23
  72. package/types/components/result/base-result-link.vue.d.ts.map +1 -1
  73. package/types/components/result/base-result-previous-price.vue.d.ts +40 -5
  74. package/types/components/result/base-result-previous-price.vue.d.ts.map +1 -1
  75. package/types/components/result/base-result-rating.vue.d.ts +28 -9
  76. package/types/components/result/base-result-rating.vue.d.ts.map +1 -1
  77. package/types/utils/options-api.d.ts +3 -0
  78. package/types/utils/options-api.d.ts.map +1 -0
  79. package/docs/API-reference/api/x-components.baseaddtocart.events.md +0 -13
  80. package/docs/API-reference/api/x-components.baseaddtocart.result.md +0 -13
  81. package/docs/API-reference/api/x-components.basepricefilterlabel.filter.md +0 -15
  82. package/docs/API-reference/api/x-components.basepricefilterlabel.format.md +0 -13
  83. package/docs/API-reference/api/x-components.basepricefilterlabel.from.md +0 -13
  84. package/docs/API-reference/api/x-components.basepricefilterlabel.fromto.md +0 -13
  85. package/docs/API-reference/api/x-components.basepricefilterlabel.label.md +0 -13
  86. package/docs/API-reference/api/x-components.basepricefilterlabel.lessthan.md +0 -13
  87. package/docs/API-reference/api/x-components.basepricefilterlabel.render.md +0 -22
  88. package/docs/API-reference/api/x-components.baseratingfilterlabel.filter.md +0 -13
  89. package/docs/API-reference/api/x-components.baseratingfilterlabel.max.md +0 -13
  90. package/docs/API-reference/api/x-components.baseresultcurrentprice.format.md +0 -18
  91. package/docs/API-reference/api/x-components.baseresultcurrentprice.result.md +0 -13
  92. package/docs/API-reference/api/x-components.baseresultimage.hoveranimation.md +0 -13
  93. package/docs/API-reference/api/x-components.baseresultimage.loadanimation.md +0 -13
  94. package/docs/API-reference/api/x-components.baseresultimage.result.md +0 -13
  95. package/docs/API-reference/api/x-components.baseresultimage.shownextimageonhover.md +0 -13
  96. package/docs/API-reference/api/x-components.baseresultlink.result.md +0 -13
  97. package/docs/API-reference/api/x-components.baseresultpreviousprice.format.md +0 -18
  98. package/docs/API-reference/api/x-components.baseresultpreviousprice.result.md +0 -13
  99. package/docs/API-reference/api/x-components.baseresultrating.link.md +0 -13
  100. package/docs/API-reference/api/x-components.baseresultrating.result.md +0 -13
  101. package/docs/API-reference/api/x-components.basetogglepanel.animation.md +0 -13
  102. package/docs/API-reference/api/x-components.basetogglepanel.open.md +0 -13
@@ -1,6 +1,4 @@
1
- import { __decorate } from 'tslib';
2
- import Vue from 'vue';
3
- import { Prop, Component } from 'vue-property-decorator';
1
+ import { defineComponent, computed } from 'vue';
4
2
  import __vue_component__ from '../base-event-button.vue.js';
5
3
 
6
4
  /**
@@ -9,27 +7,35 @@ import __vue_component__ from '../base-event-button.vue.js';
9
7
  *
10
8
  * @public
11
9
  */
12
- let BaseResultAddToCart = class BaseResultAddToCart extends Vue {
13
- /**
14
- * The events to be emitted by the button.
15
- *
16
- * @returns Events {@link XEventsTypes} to emit.
17
- *
18
- * @public
19
- */
20
- get events() {
21
- return { UserClickedResultAddToCart: this.result };
10
+ var script = defineComponent({
11
+ components: { BaseEventButton: __vue_component__ },
12
+ props: {
13
+ /**
14
+ * (Required) The {@link @empathyco/x-types#Result | result} information.
15
+ *
16
+ * @public
17
+ */
18
+ result: {
19
+ type: Object,
20
+ required: true
21
+ }
22
+ },
23
+ setup(props) {
24
+ /**
25
+ * The events to be emitted by the button.
26
+ *
27
+ * @returns Events {@link XEventsTypes} to emit.
28
+ *
29
+ * @public
30
+ */
31
+ const events = computed(() => ({
32
+ UserClickedResultAddToCart: props.result
33
+ }));
34
+ return {
35
+ events
36
+ };
22
37
  }
23
- };
24
- __decorate([
25
- Prop({ required: true })
26
- ], BaseResultAddToCart.prototype, "result", void 0);
27
- BaseResultAddToCart = __decorate([
28
- Component({
29
- components: { BaseEventButton: __vue_component__ }
30
- })
31
- ], BaseResultAddToCart);
32
- var script = BaseResultAddToCart;
38
+ });
33
39
 
34
40
  export { script as default };
35
41
  //# sourceMappingURL=base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-add-to-cart.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n import { Result } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { XEventsTypes } from '../../wiring/events.types';\n import BaseEventButton from '../base-event-button.vue';\n\n /**\n * Renders a button with a default slot. It receives the result with the data and emits\n * {@link XEventsTypes.UserClickedResultAddToCart} to the bus on click mouse event.\n *\n * @public\n */\n @Component({\n components: { BaseEventButton }\n })\n export default class BaseResultAddToCart extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\n\n /**\n * The events to be emitted by the button.\n *\n * @returns Events {@link XEventsTypes} to emit.\n *\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return { UserClickedResultAddToCart: this.result };\n }\n }\n"],"names":["BaseEventButton"],"mappings":";;;;;AAmBE;;;;;AAKG;AAIY,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,GAAG,CAAA;AASlD;;;;;;AAMG;AACH,IAAA,IAAc,MAAM,GAAA;AAClB,QAAA,OAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;KACpD;CACF,CAAA;AAZC,UAAA,CAAA;AADC,IAAA,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACC,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAPP,mBAAmB,GAAA,UAAA,CAAA;AAHvC,IAAA,SAAS,CAAC;QACT,UAAU,EAAE,mBAAEA,iBAAe,EAAE;KAChC,CAAC;AACmB,CAAA,EAAA,mBAAmB,CAmBvC,CAAA;aAnBoB,mBAAmB;;;;"}
1
+ {"version":3,"file":"base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-add-to-cart.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import { XEventsTypes } from '../../wiring/events.types';\n import BaseEventButton from '../base-event-button.vue';\n\n /**\n * Renders a button with a default slot. It receives the result with the data and emits\n * {@link XEventsTypes.UserClickedResultAddToCart} to the bus on click mouse event.\n *\n * @public\n */\n export default defineComponent({\n components: { BaseEventButton },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true\n }\n },\n setup(props) {\n /**\n * The events to be emitted by the button.\n *\n * @returns Events {@link XEventsTypes} to emit.\n *\n * @public\n */\n const events = computed<Partial<XEventsTypes>>(() => ({\n UserClickedResultAddToCart: props.result\n }));\n\n return {\n events\n };\n }\n });\n"],"names":["BaseEventButton"],"mappings":";;;AAkBE;;;;;AAKG;AACH,aAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,mBAAEA,iBAAe,EAAE;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIG;AACH,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;AAMG;AACH,QAAA,MAAM,MAAM,GAAG,QAAQ,CAAwB,OAAO;YACpD,0BAA0B,EAAE,KAAK,CAAC,MAAM;AACzC,SAAA,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,MAAM;SACP,CAAC;KACH;AACF,CAAA,CAAC;;;;"}
@@ -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 :value=\"result.price.value\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { Component, Prop } from 'vue-property-decorator';\n import Vue from 'vue';\n import { VueCSSClasses } from '../../utils/types';\n import BaseCurrency from '../currency/base-currency.vue';\n\n /**\n * Component that renders the {@link @empathyco/x-types#Result | result} current price\n * that may or may not be on sale.\n *\n * @public\n */\n @Component({\n components: { BaseCurrency }\n })\n export default class BaseResultCurrentPrice extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\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 @Prop()\n protected format?: string;\n\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, and the boolean value\n * tells if it should be added or not.\n * @internal\n */\n protected get dynamicClasses(): VueCSSClasses {\n return {\n 'x-result-current-price--on-sale': this.result.price?.hasDiscount ?? false\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<BaseResultCurrentPrice :value=\"result\" :format=\"'i.iii,ddd €'\" />\n```\n\n### Overriding default slot\n\n```vue\n<BaseResultCurrentPrice :result=\"result\">\n <span class=\"custom-base-result-current-price\">{{ result.price.value }}</span>\n</BaseResultCurrentPrice>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA,MAAc,cAAA,GAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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 :value=\"result.price.value\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import { VueCSSClasses } from '../../utils/types';\n import BaseCurrency from '../currency/base-currency.vue';\n\n /**\n * Component that renders the {@link @empathyco/x-types#Result | result} current price\n * that may or may not be on sale.\n *\n * @public\n */\n export default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result | 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<BaseResultCurrentPrice :value=\"result\" :format=\"'i.iii,ddd €'\" />\n```\n\n### Overriding default slot\n\n```vue\n<BaseResultCurrentPrice :result=\"result\">\n <span class=\"custom-base-result-current-price\">{{ result.price.value }}</span>\n</BaseResultCurrentPrice>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA,MAAc,cAAA,GAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,4 @@
1
- import { __decorate } from 'tslib';
2
- import { Prop, Component } from 'vue-property-decorator';
3
- import Vue from 'vue';
1
+ import { defineComponent, computed } from 'vue';
4
2
  import __vue_component__ from '../currency/base-currency.vue.js';
5
3
 
6
4
  /**
@@ -9,32 +7,55 @@ import __vue_component__ from '../currency/base-currency.vue.js';
9
7
  *
10
8
  * @public
11
9
  */
12
- let BaseResultCurrentPrice = class BaseResultCurrentPrice extends Vue {
13
- /**
14
- * Dynamic CSS classes to add to the root element of this component.
15
- *
16
- * @returns A booleans dictionary where each key is the class name to add, and the boolean value
17
- * tells if it should be added or not.
18
- * @internal
19
- */
20
- get dynamicClasses() {
10
+ var script = defineComponent({
11
+ components: { BaseCurrency: __vue_component__ },
12
+ props: {
13
+ /**
14
+ * (Required) The {@link @empathyco/x-types#Result | result} information.
15
+ *
16
+ * @public
17
+ */
18
+ result: {
19
+ type: Object,
20
+ required: true
21
+ },
22
+ /**
23
+ * Format or mask to be defined as string.
24
+ * - Use 'i' to define integer numbers.
25
+ * - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the
26
+ * doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.
27
+ * - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.
28
+ * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more
29
+ * than one character.
30
+ * - Set whatever you need around the integers and decimals marks.
31
+ * - Default mask: 'i.iii,dd' which returns '1.345,67'.
32
+ *
33
+ * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length
34
+ * of decimals provided from the adapter. Otherwise, when the component truncate the decimal
35
+ * part, delete significant digits.
36
+ *
37
+ * @public
38
+ */
39
+ format: {
40
+ type: String
41
+ }
42
+ },
43
+ setup(props) {
44
+ /**
45
+ * Dynamic CSS classes to add to the root element of this component.
46
+ *
47
+ * @returns A booleans dictionary where each key is the class name to add,
48
+ * and the boolean value tells if it should be added or not.
49
+ * @internal
50
+ */
51
+ const dynamicClasses = computed(() => ({
52
+ 'x-result-current-price--on-sale': props.result.price?.hasDiscount ?? false
53
+ }));
21
54
  return {
22
- 'x-result-current-price--on-sale': this.result.price?.hasDiscount ?? false
55
+ dynamicClasses
23
56
  };
24
57
  }
25
- };
26
- __decorate([
27
- Prop({ required: true })
28
- ], BaseResultCurrentPrice.prototype, "result", void 0);
29
- __decorate([
30
- Prop()
31
- ], BaseResultCurrentPrice.prototype, "format", void 0);
32
- BaseResultCurrentPrice = __decorate([
33
- Component({
34
- components: { BaseCurrency: __vue_component__ }
35
- })
36
- ], BaseResultCurrentPrice);
37
- var script = BaseResultCurrentPrice;
58
+ });
38
59
 
39
60
  export { script as default };
40
61
  //# sourceMappingURL=base-result-current-price.vue_rollup-plugin-vue_script.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-current-price.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-current-price.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n import { Result } from '@empathyco/x-types';\n import { Component, Prop } from 'vue-property-decorator';\n import Vue from 'vue';\n import { VueCSSClasses } from '../../utils/types';\n import BaseCurrency from '../currency/base-currency.vue';\n\n /**\n * Component that renders the {@link @empathyco/x-types#Result | result} current price\n * that may or may not be on sale.\n *\n * @public\n */\n @Component({\n components: { BaseCurrency }\n })\n export default class BaseResultCurrentPrice extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\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 @Prop()\n protected format?: string;\n\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, and the boolean value\n * tells if it should be added or not.\n * @internal\n */\n protected get dynamicClasses(): VueCSSClasses {\n return {\n 'x-result-current-price--on-sale': this.result.price?.hasDiscount ?? false\n };\n }\n }\n"],"names":["BaseCurrency"],"mappings":";;;;;AAmBE;;;;;AAKG;AAIY,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,GAAG,CAAA;AA6BrD;;;;;;AAMG;AACH,IAAA,IAAc,cAAc,GAAA;QAC1B,OAAO;YACL,iCAAiC,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,IAAI,KAAK;SAC3E,CAAC;KACH;CACF,CAAA;AAlCC,UAAA,CAAA;AADC,IAAA,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACC,CAAA,EAAA,sBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAoB1B,UAAA,CAAA;AADC,IAAA,IAAI,EAAE;AACmB,CAAA,EAAA,sBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA3BP,sBAAsB,GAAA,UAAA,CAAA;AAH1C,IAAA,SAAS,CAAC;QACT,UAAU,EAAE,gBAAEA,iBAAY,EAAE;KAC7B,CAAC;AACmB,CAAA,EAAA,sBAAsB,CAyC1C,CAAA;aAzCoB,sBAAsB;;;;"}
1
+ {"version":3,"file":"base-result-current-price.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-current-price.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import { VueCSSClasses } from '../../utils/types';\n import BaseCurrency from '../currency/base-currency.vue';\n\n /**\n * Component that renders the {@link @empathyco/x-types#Result | result} current price\n * that may or may not be on sale.\n *\n * @public\n */\n export default defineComponent({\n components: { BaseCurrency },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result | 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"],"names":["BaseCurrency"],"mappings":";;;AAkBE;;;;;AAKG;AACH,aAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,gBAAEA,iBAAY,EAAE;AAC5B,IAAA,KAAK,EAAE;AACL;;;;AAIG;AACH,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;;;;;;;;;;;;;AAgBG;AACH,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;AAMG;AACH,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAgB,OAAO;YACpD,iCAAiC,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,IAAI,KAAK;AAC5E,SAAA,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,cAAc;SACf,CAAC;KACH;AACF,CAAA,CAAC;;;;"}
@@ -75,7 +75,7 @@ __vue_render__._withStripped = true;
75
75
  /* style */
76
76
  const __vue_inject_styles__ = undefined;
77
77
  /* scoped */
78
- const __vue_scope_id__ = "data-v-034c1a25";
78
+ const __vue_scope_id__ = "data-v-1ae01006";
79
79
  /* module identifier */
80
80
  const __vue_module_identifier__ = undefined;
81
81
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-image.vue.js","sources":["../../../../src/components/result/base-result-image.vue"],"sourcesContent":["<template>\n <!-- This is a div because using a picture causes the onload event of the image to fire twice. -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events -->\n <div\n @mouseenter.once=\"userHasHoveredImage = true\"\n @mouseenter=\"isHovering = true\"\n @mouseleave=\"isHovering = false\"\n class=\"x-result-picture x-picture\"\n data-test=\"result-picture\"\n >\n <img\n v-if=\"shouldLoadNextImage\"\n @load=\"flagImageLoaded\"\n @error=\"flagImageAsFailed\"\n loading=\"lazy\"\n :src=\"pendingImages[0]\"\n :style=\"loaderStyles\"\n class=\"x-picture-image\"\n data-test=\"result-picture-loader\"\n alt=\"\"\n role=\"presentation\"\n />\n <component :is=\"animation\" class=\"x-picture-image\" :appear=\"false\">\n <!-- @slot Fallback image content. It will be rendered when all the images failed -->\n <slot v-if=\"!loadedImages.length && !pendingImages.length\" name=\"fallback\" />\n\n <!-- @slot Loading image content. It will be rendered while the real image is not loaded -->\n <slot v-else-if=\"!loadedImages.length\" name=\"placeholder\" />\n\n <img\n v-else\n :key=\"imageSrc\"\n :alt=\"result.name\"\n :src=\"imageSrc\"\n class=\"x-result-picture-image\"\n data-test=\"result-picture-image\"\n />\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop, Watch } from 'vue-property-decorator';\n import { NoElement } from '../no-element';\n\n /**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\n @Component({\n components: {\n NoElement\n }\n })\n export default class BaseResultImage extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\n\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n *\n * @public\n */\n @Prop({ default: () => NoElement })\n public loadAnimation!: string | typeof Vue;\n\n /**\n * Animation to use when switching between the loaded image and the hover image.\n *\n * @public\n */\n @Prop()\n public hoverAnimation!: string | typeof Vue | undefined;\n\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n @Prop({ type: Boolean, default: false })\n public showNextImageOnHover!: boolean;\n\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n protected pendingImages: string[] = [];\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n protected loadedImages: string[] = [];\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n protected isHovering = false;\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n protected userHasHoveredImage = false;\n\n /**.\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n protected loaderStyles: Partial<CSSStyleDeclaration> = {\n position: 'absolute !important',\n top: '0 !important',\n left: '0 !important',\n width: '100% !important',\n height: '100% !important',\n pointerEvents: 'none !important',\n visibility: 'hidden !important'\n };\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n @Watch('result.images', { immediate: true })\n resetImagesState(): void {\n this.pendingImages = [...(this.result.images ?? [])];\n this.loadedImages = this.pendingImages.filter(image => this.loadedImages.includes(image));\n }\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n protected get animation(): string | typeof Vue {\n return this.userHasHoveredImage\n ? this.hoverAnimation ?? this.loadAnimation\n : this.loadAnimation;\n }\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n protected get imageSrc(): string {\n return this.loadedImages[\n !this.showNextImageOnHover || !this.isHovering ? 0 : this.loadedImages.length - 1\n ];\n }\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n protected get shouldLoadNextImage(): boolean {\n const numImagesToLoad = this.showNextImageOnHover && this.userHasHoveredImage ? 2 : 1;\n return !!this.pendingImages.length && this.loadedImages.length < numImagesToLoad;\n }\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n protected flagImageAsFailed(): void {\n this.pendingImages.shift();\n }\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n protected flagImageLoaded(): void {\n const image = this.pendingImages.shift();\n if (image) {\n this.loadedImages.push(image);\n }\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-result-picture {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n\n &-image {\n max-width: 100%;\n max-height: 100%;\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component is for the result image. It may be part of the search result page, recommendations or\nother section which needs to include results.\n\nThe result prop is required. It will render a `<img/>` with the result image:\n\n```vue\n<BaseResultImage :result=\"result\" />\n```\n\n### Showing the next image on hover\n\nIf a result has multiple images, it can show the next one on hover.\n\n```vue\n<BaseResultImage :result=\"result\" showNextImageOnHover />\n```\n\n### Customizing slots content\n\nFallback and placeholder contents can be customized.\n\nThe fallback slot allows you to replace the content of the fallback image.\n\nThe other slot is called `placeholder`, and allows you to set the image that its going to be\ndisplayed while the real one is loaded.\n\n```vue\n<BaseResultImage :result=\"result\">\n <template #placeholder>\n <img alt=\"Placeholder image\" src=\"./placeholder-image.svg\"/>\n </template>\n <template #fallback>\n <img alt=\"Fallback image\" src=\"./fallback-image.svg\"/>\n </template>\n</BaseResultImage>\n```\n\n### Customizing the animations\n\nTwo animations can be used this component.\n\nThe `loadAnimation` is used to transition between the placeholder, the fallback and the image.\n\nThe `hoverAnimation` is used to transition between the image and the hover image, if the\n`showNextImageOnHover` prop is `true`.\n\n`hoverAnimation` will default to `loadAnimation` if it is not provided.\n\n```vue\n<template>\n <BaseResultImage\n :result=\"result\"\n :loadAnimation=\"loadAnimation\"\n :hoverAnimation=\"hoverAnimation\"\n showNextImageOnHover\n />\n</template>\n\n<script>\n import { BaseResultImage } from '@empathyco/x-components';\n import { CrossFade, CollapseHeight } from '@empathyco/x-components/animations';\n\n export default {\n name: 'BaseResultImageAnimations',\n components: {\n BaseResultImage\n },\n data() {\n return {\n loadAnimation: CrossFade,\n hoverAnimation: CollapseHeight,\n result: {\n name: 'jacket',\n images: ['https://some-image', 'https://some-image-2']\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA,MAAc,cAAA,GAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-result-image.vue.js","sources":["../../../../src/components/result/base-result-image.vue"],"sourcesContent":["<template>\n <!-- This is a div because using a picture causes the onload event of the image to fire twice. -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events -->\n <div\n @mouseenter.once=\"userHasHoveredImage = true\"\n @mouseenter=\"isHovering = true\"\n @mouseleave=\"isHovering = false\"\n class=\"x-result-picture x-picture\"\n data-test=\"result-picture\"\n >\n <img\n v-if=\"shouldLoadNextImage\"\n @load=\"flagImageLoaded\"\n @error=\"flagImageAsFailed\"\n loading=\"lazy\"\n :src=\"pendingImages[0]\"\n :style=\"loaderStyles\"\n class=\"x-picture-image\"\n data-test=\"result-picture-loader\"\n alt=\"\"\n role=\"presentation\"\n />\n <component :is=\"animation\" class=\"x-picture-image\" :appear=\"false\">\n <!-- @slot Fallback image content. It will be rendered when all the images failed -->\n <slot v-if=\"!loadedImages.length && !pendingImages.length\" name=\"fallback\" />\n\n <!-- @slot Loading image content. It will be rendered while the real image is not loaded -->\n <slot v-else-if=\"!loadedImages.length\" name=\"placeholder\" />\n\n <img\n v-else\n :key=\"imageSrc\"\n :alt=\"result.name\"\n :src=\"imageSrc\"\n class=\"x-result-picture-image\"\n data-test=\"result-picture-image\"\n />\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import {\n computed,\n DefineComponent,\n defineComponent,\n PropType,\n Ref,\n ref,\n toRef,\n watch\n } from 'vue';\n import { NoElement } from '../no-element';\n import { animationProp } from '../../utils/options-api';\n\n /**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\n export default defineComponent({\n components: {\n NoElement\n },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true\n },\n\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n *\n * @public\n */\n loadAnimation: {\n type: animationProp,\n default: () => NoElement\n },\n\n /**\n * Animation to use when switching between the loaded image and the hover image.\n *\n * @public\n */\n hoverAnimation: {\n type: animationProp\n },\n\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n showNextImageOnHover: {\n type: Boolean,\n default: false\n }\n },\n\n setup(props) {\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n const pendingImages: Ref<string[]> = ref([]);\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n const loadedImages: Ref<string[]> = ref([]);\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n const isHovering = ref(false);\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n const userHasHoveredImage = ref(false);\n\n /**.\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n const loaderStyles: Partial<CSSStyleDeclaration> = {\n position: 'absolute !important',\n top: '0 !important',\n left: '0 !important',\n width: '100% !important',\n height: '100% !important',\n pointerEvents: 'none !important',\n visibility: 'hidden !important'\n };\n\n const resultImages = toRef(props.result, 'images');\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n watch(\n resultImages,\n () => {\n pendingImages.value = [...(props.result.images ?? [])];\n loadedImages.value = pendingImages.value.filter(image =>\n loadedImages.value.includes(image)\n );\n },\n { immediate: true }\n );\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n const animation = computed<DefineComponent | string>(() => {\n return userHasHoveredImage\n ? props.hoverAnimation ?? props.loadAnimation\n : props.loadAnimation;\n });\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n const imageSrc = computed<string>(() => {\n return loadedImages.value[\n !props.showNextImageOnHover || !isHovering ? 0 : loadedImages.value.length - 1\n ];\n });\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n const shouldLoadNextImage = computed<boolean>(() => {\n const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage ? 2 : 1;\n return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad;\n });\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n const flagImageAsFailed = (): void => {\n pendingImages.value.shift();\n };\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n const flagImageLoaded = (): void => {\n const image = pendingImages.value.shift();\n if (image) {\n loadedImages.value.push(image);\n }\n };\n\n return {\n pendingImages,\n loadedImages,\n isHovering,\n userHasHoveredImage,\n loaderStyles,\n animation,\n imageSrc,\n shouldLoadNextImage,\n flagImageAsFailed,\n flagImageLoaded\n };\n }\n });\n</script>\n\n<style lang=\"scss\" scoped>\n .x-result-picture {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n\n &-image {\n max-width: 100%;\n max-height: 100%;\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component is for the result image. It may be part of the search result page, recommendations or\nother section which needs to include results.\n\nThe result prop is required. It will render a `<img/>` with the result image:\n\n```vue\n<BaseResultImage :result=\"result\" />\n```\n\n### Showing the next image on hover\n\nIf a result has multiple images, it can show the next one on hover.\n\n```vue\n<BaseResultImage :result=\"result\" showNextImageOnHover />\n```\n\n### Customizing slots content\n\nFallback and placeholder contents can be customized.\n\nThe fallback slot allows you to replace the content of the fallback image.\n\nThe other slot is called `placeholder`, and allows you to set the image that its going to be\ndisplayed while the real one is loaded.\n\n```vue\n<BaseResultImage :result=\"result\">\n <template #placeholder>\n <img alt=\"Placeholder image\" src=\"./placeholder-image.svg\"/>\n </template>\n <template #fallback>\n <img alt=\"Fallback image\" src=\"./fallback-image.svg\"/>\n </template>\n</BaseResultImage>\n```\n\n### Customizing the animations\n\nTwo animations can be used this component.\n\nThe `loadAnimation` is used to transition between the placeholder, the fallback and the image.\n\nThe `hoverAnimation` is used to transition between the image and the hover image, if the\n`showNextImageOnHover` prop is `true`.\n\n`hoverAnimation` will default to `loadAnimation` if it is not provided.\n\n```vue\n<template>\n <BaseResultImage\n :result=\"result\"\n :loadAnimation=\"loadAnimation\"\n :hoverAnimation=\"hoverAnimation\"\n showNextImageOnHover\n />\n</template>\n\n<script>\n import { BaseResultImage } from '@empathyco/x-components';\n import { CrossFade, CollapseHeight } from '@empathyco/x-components/animations';\n\n export default {\n name: 'BaseResultImageAnimations',\n components: {\n BaseResultImage\n },\n data() {\n return {\n loadAnimation: CrossFade,\n hoverAnimation: CollapseHeight,\n result: {\n name: 'jacket',\n images: ['https://some-image', 'https://some-image-2']\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA,MAAc,cAAA,GAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,16 +1,55 @@
1
- import { __decorate } from 'tslib';
2
- import Vue from 'vue';
3
- import { Prop, Watch, Component } from 'vue-property-decorator';
1
+ import { defineComponent, ref, toRef, watch, computed } from 'vue';
4
2
  import { NoElement } from '../no-element.js';
3
+ import { animationProp } from '../../utils/options-api.js';
5
4
 
6
5
  /**
7
6
  * Component to be reused that renders an `<img>`.
8
7
  *
9
8
  * @public
10
9
  */
11
- let BaseResultImage = class BaseResultImage extends Vue {
12
- constructor() {
13
- super(...arguments);
10
+ var script = defineComponent({
11
+ components: {
12
+ NoElement
13
+ },
14
+ props: {
15
+ /**
16
+ * (Required) The {@link @empathyco/x-types#Result | result} information.
17
+ *
18
+ * @public
19
+ */
20
+ result: {
21
+ type: Object,
22
+ required: true
23
+ },
24
+ /**
25
+ * Animation to use when switching between the placeholder, the loaded image, or the failed
26
+ * image fallback.
27
+ *
28
+ * @public
29
+ */
30
+ loadAnimation: {
31
+ type: animationProp,
32
+ default: () => NoElement
33
+ },
34
+ /**
35
+ * Animation to use when switching between the loaded image and the hover image.
36
+ *
37
+ * @public
38
+ */
39
+ hoverAnimation: {
40
+ type: animationProp
41
+ },
42
+ /**
43
+ * Indicates if the next valid image should be displayed on hover.
44
+ *
45
+ * @public
46
+ */
47
+ showNextImageOnHover: {
48
+ type: Boolean,
49
+ default: false
50
+ }
51
+ },
52
+ setup(props) {
14
53
  /**
15
54
  * Copy of the images of the result.
16
55
  *
@@ -19,31 +58,31 @@ let BaseResultImage = class BaseResultImage extends Vue {
19
58
  *
20
59
  * @internal
21
60
  */
22
- this.pendingImages = [];
61
+ const pendingImages = ref([]);
23
62
  /**
24
63
  * Contains the images that have been loaded successfully.
25
64
  *
26
65
  * @internal
27
66
  */
28
- this.loadedImages = [];
67
+ const loadedImages = ref([]);
29
68
  /**
30
69
  * Indicates if the user is hovering the image.
31
70
  *
32
71
  * @internal
33
72
  */
34
- this.isHovering = false;
73
+ const isHovering = ref(false);
35
74
  /**
36
75
  * Indicates if the user has hovered the image.
37
76
  *
38
77
  * @internal
39
78
  */
40
- this.userHasHoveredImage = false;
79
+ const userHasHoveredImage = ref(false);
41
80
  /**.
42
81
  * Styles to use inline in the image loader, to prevent override from CSS
43
82
  *
44
83
  * @internal
45
84
  */
46
- this.loaderStyles = {
85
+ const loaderStyles = {
47
86
  position: 'absolute !important',
48
87
  top: '0 !important',
49
88
  left: '0 !important',
@@ -52,92 +91,82 @@ let BaseResultImage = class BaseResultImage extends Vue {
52
91
  pointerEvents: 'none !important',
53
92
  visibility: 'hidden !important'
54
93
  };
94
+ const resultImages = toRef(props.result, 'images');
95
+ /**
96
+ * Initializes images state and resets when the result's images change.
97
+ *
98
+ * @internal
99
+ */
100
+ watch(resultImages, () => {
101
+ pendingImages.value = [...(props.result.images ?? [])];
102
+ loadedImages.value = pendingImages.value.filter(image => loadedImages.value.includes(image));
103
+ }, { immediate: true });
104
+ /**
105
+ * Animation to be used.
106
+ *
107
+ * @returns The animation to be used, taking into account if the user has hovered the image.
108
+ *
109
+ * @internal
110
+ */
111
+ const animation = computed(() => {
112
+ return userHasHoveredImage
113
+ ? props.hoverAnimation ?? props.loadAnimation
114
+ : props.loadAnimation;
115
+ });
116
+ /**
117
+ * Gets the src from the result image.
118
+ *
119
+ * @returns The result image src.
120
+ *
121
+ * @internal
122
+ */
123
+ const imageSrc = computed(() => {
124
+ return loadedImages.value[!props.showNextImageOnHover || !isHovering ? 0 : loadedImages.value.length - 1];
125
+ });
126
+ /**
127
+ * Indicates if the loader should try to load the next image.
128
+ *
129
+ * @returns True if it should try to load the next image.
130
+ *
131
+ * @internal
132
+ */
133
+ const shouldLoadNextImage = computed(() => {
134
+ const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage ? 2 : 1;
135
+ return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad;
136
+ });
137
+ /**
138
+ * Sets an image as failed.
139
+ *
140
+ * @internal
141
+ */
142
+ const flagImageAsFailed = () => {
143
+ pendingImages.value.shift();
144
+ };
145
+ /**
146
+ * Sets an image as loaded.
147
+ *
148
+ * @internal
149
+ */
150
+ const flagImageLoaded = () => {
151
+ const image = pendingImages.value.shift();
152
+ if (image) {
153
+ loadedImages.value.push(image);
154
+ }
155
+ };
156
+ return {
157
+ pendingImages,
158
+ loadedImages,
159
+ isHovering,
160
+ userHasHoveredImage,
161
+ loaderStyles,
162
+ animation,
163
+ imageSrc,
164
+ shouldLoadNextImage,
165
+ flagImageAsFailed,
166
+ flagImageLoaded
167
+ };
55
168
  }
56
- /**
57
- * Initializes images state and resets when the result's images change.
58
- *
59
- * @internal
60
- */
61
- resetImagesState() {
62
- this.pendingImages = [...(this.result.images ?? [])];
63
- this.loadedImages = this.pendingImages.filter(image => this.loadedImages.includes(image));
64
- }
65
- /**
66
- * Animation to be used.
67
- *
68
- * @returns The animation to be used, taking into account if the user has hovered the image.
69
- *
70
- * @internal
71
- */
72
- get animation() {
73
- return this.userHasHoveredImage
74
- ? this.hoverAnimation ?? this.loadAnimation
75
- : this.loadAnimation;
76
- }
77
- /**
78
- * Gets the src from the result image.
79
- *
80
- * @returns The result image src.
81
- *
82
- * @internal
83
- */
84
- get imageSrc() {
85
- return this.loadedImages[!this.showNextImageOnHover || !this.isHovering ? 0 : this.loadedImages.length - 1];
86
- }
87
- /**
88
- * Indicates if the loader should try to load the next image.
89
- *
90
- * @returns True if it should try to load the next image.
91
- *
92
- * @internal
93
- */
94
- get shouldLoadNextImage() {
95
- const numImagesToLoad = this.showNextImageOnHover && this.userHasHoveredImage ? 2 : 1;
96
- return !!this.pendingImages.length && this.loadedImages.length < numImagesToLoad;
97
- }
98
- /**
99
- * Sets an image as failed.
100
- *
101
- * @internal
102
- */
103
- flagImageAsFailed() {
104
- this.pendingImages.shift();
105
- }
106
- /**
107
- * Sets an image as loaded.
108
- *
109
- * @internal
110
- */
111
- flagImageLoaded() {
112
- const image = this.pendingImages.shift();
113
- if (image) {
114
- this.loadedImages.push(image);
115
- }
116
- }
117
- };
118
- __decorate([
119
- Prop({ required: true })
120
- ], BaseResultImage.prototype, "result", void 0);
121
- __decorate([
122
- Prop({ default: () => NoElement })
123
- ], BaseResultImage.prototype, "loadAnimation", void 0);
124
- __decorate([
125
- Prop()
126
- ], BaseResultImage.prototype, "hoverAnimation", void 0);
127
- __decorate([
128
- Prop({ type: Boolean, default: false })
129
- ], BaseResultImage.prototype, "showNextImageOnHover", void 0);
130
- __decorate([
131
- Watch('result.images', { immediate: true })
132
- ], BaseResultImage.prototype, "resetImagesState", null);
133
- BaseResultImage = __decorate([
134
- Component({
135
- components: {
136
- NoElement
137
- }
138
- })
139
- ], BaseResultImage);
140
- var script = BaseResultImage;
169
+ });
141
170
 
142
171
  export { script as default };
143
172
  //# sourceMappingURL=base-result-image.vue_rollup-plugin-vue_script.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-image.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-image.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n import { Result } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop, Watch } from 'vue-property-decorator';\n import { NoElement } from '../no-element';\n\n /**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\n @Component({\n components: {\n NoElement\n }\n })\n export default class BaseResultImage extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\n\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n *\n * @public\n */\n @Prop({ default: () => NoElement })\n public loadAnimation!: string | typeof Vue;\n\n /**\n * Animation to use when switching between the loaded image and the hover image.\n *\n * @public\n */\n @Prop()\n public hoverAnimation!: string | typeof Vue | undefined;\n\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n @Prop({ type: Boolean, default: false })\n public showNextImageOnHover!: boolean;\n\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n protected pendingImages: string[] = [];\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n protected loadedImages: string[] = [];\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n protected isHovering = false;\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n protected userHasHoveredImage = false;\n\n /**.\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n protected loaderStyles: Partial<CSSStyleDeclaration> = {\n position: 'absolute !important',\n top: '0 !important',\n left: '0 !important',\n width: '100% !important',\n height: '100% !important',\n pointerEvents: 'none !important',\n visibility: 'hidden !important'\n };\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n @Watch('result.images', { immediate: true })\n resetImagesState(): void {\n this.pendingImages = [...(this.result.images ?? [])];\n this.loadedImages = this.pendingImages.filter(image => this.loadedImages.includes(image));\n }\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n protected get animation(): string | typeof Vue {\n return this.userHasHoveredImage\n ? this.hoverAnimation ?? this.loadAnimation\n : this.loadAnimation;\n }\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n protected get imageSrc(): string {\n return this.loadedImages[\n !this.showNextImageOnHover || !this.isHovering ? 0 : this.loadedImages.length - 1\n ];\n }\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n protected get shouldLoadNextImage(): boolean {\n const numImagesToLoad = this.showNextImageOnHover && this.userHasHoveredImage ? 2 : 1;\n return !!this.pendingImages.length && this.loadedImages.length < numImagesToLoad;\n }\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n protected flagImageAsFailed(): void {\n this.pendingImages.shift();\n }\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n protected flagImageLoaded(): void {\n const image = this.pendingImages.shift();\n if (image) {\n this.loadedImages.push(image);\n }\n }\n }\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"base-result-image.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-image.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n import { Result } from '@empathyco/x-types';\n import {\n computed,\n DefineComponent,\n defineComponent,\n PropType,\n Ref,\n ref,\n toRef,\n watch\n } from 'vue';\n import { NoElement } from '../no-element';\n import { animationProp } from '../../utils/options-api';\n\n /**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\n export default defineComponent({\n components: {\n NoElement\n },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true\n },\n\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n *\n * @public\n */\n loadAnimation: {\n type: animationProp,\n default: () => NoElement\n },\n\n /**\n * Animation to use when switching between the loaded image and the hover image.\n *\n * @public\n */\n hoverAnimation: {\n type: animationProp\n },\n\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n showNextImageOnHover: {\n type: Boolean,\n default: false\n }\n },\n\n setup(props) {\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n const pendingImages: Ref<string[]> = ref([]);\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n const loadedImages: Ref<string[]> = ref([]);\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n const isHovering = ref(false);\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n const userHasHoveredImage = ref(false);\n\n /**.\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n const loaderStyles: Partial<CSSStyleDeclaration> = {\n position: 'absolute !important',\n top: '0 !important',\n left: '0 !important',\n width: '100% !important',\n height: '100% !important',\n pointerEvents: 'none !important',\n visibility: 'hidden !important'\n };\n\n const resultImages = toRef(props.result, 'images');\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n watch(\n resultImages,\n () => {\n pendingImages.value = [...(props.result.images ?? [])];\n loadedImages.value = pendingImages.value.filter(image =>\n loadedImages.value.includes(image)\n );\n },\n { immediate: true }\n );\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n const animation = computed<DefineComponent | string>(() => {\n return userHasHoveredImage\n ? props.hoverAnimation ?? props.loadAnimation\n : props.loadAnimation;\n });\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n const imageSrc = computed<string>(() => {\n return loadedImages.value[\n !props.showNextImageOnHover || !isHovering ? 0 : loadedImages.value.length - 1\n ];\n });\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n const shouldLoadNextImage = computed<boolean>(() => {\n const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage ? 2 : 1;\n return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad;\n });\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n const flagImageAsFailed = (): void => {\n pendingImages.value.shift();\n };\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n const flagImageLoaded = (): void => {\n const image = pendingImages.value.shift();\n if (image) {\n loadedImages.value.push(image);\n }\n };\n\n return {\n pendingImages,\n loadedImages,\n isHovering,\n userHasHoveredImage,\n loaderStyles,\n animation,\n imageSrc,\n shouldLoadNextImage,\n flagImageAsFailed,\n flagImageLoaded\n };\n }\n });\n"],"names":[],"mappings":"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"}
@@ -1,6 +1,6 @@
1
1
  import { createInjector, createInjectorSSR } from 'vue-runtime-helpers';
2
2
 
3
- var css = ".x-result-picture[data-v-034c1a25] {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n}\n.x-result-picture-image[data-v-034c1a25] {\n max-width: 100%;\n max-height: 100%;\n}";
3
+ var css = ".x-result-picture[data-v-1ae01006] {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n}\n.x-result-picture-image[data-v-1ae01006] {\n max-width: 100%;\n max-height: 100%;\n}";
4
4
  const isBrowser = /*#__PURE__*/ (function () {
5
5
  return (
6
6
  Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) !==
@@ -12,6 +12,7 @@ var __vue_render__ = function () {
12
12
  return _c(
13
13
  "a",
14
14
  {
15
+ ref: "el",
15
16
  staticClass: "x-result-link",
16
17
  attrs: { href: _vm.result.url, "data-test": "result-link" },
17
18
  on: {
@@ -37,7 +38,7 @@ __vue_render__._withStripped = true;
37
38
  /* style */
38
39
  const __vue_inject_styles__ = undefined;
39
40
  /* scoped */
40
- const __vue_scope_id__ = "data-v-2fa908e2";
41
+ const __vue_scope_id__ = "data-v-5c0bb921";
41
42
  /* module identifier */
42
43
  const __vue_module_identifier__ = undefined;
43
44
  /* functional template */