@empathyco/x-components 3.0.0-alpha.365 → 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.
- package/CHANGELOG.md +12 -0
- package/docs/API-reference/api/x-components.baseaddtocart.md +14 -11
- package/docs/API-reference/api/x-components.baseresultcurrentprice.md +20 -11
- package/docs/API-reference/api/x-components.baseresultimage.md +50 -13
- package/docs/API-reference/api/x-components.baseresultlink.md +15 -10
- package/docs/API-reference/api/x-components.baseresultpreviousprice.md +18 -11
- package/docs/API-reference/api/x-components.baseresultrating.md +20 -11
- package/docs/API-reference/api/x-components.md +6 -6
- package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
- package/js/components/result/base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js +29 -23
- package/js/components/result/base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/components/result/base-result-current-price.vue.js.map +1 -1
- package/js/components/result/base-result-current-price.vue_rollup-plugin-vue_script.vue.js +47 -26
- package/js/components/result/base-result-current-price.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue.js +1 -1
- package/js/components/result/base-result-image.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue_rollup-plugin-vue_script.vue.js +125 -96
- package/js/components/result/base-result-image.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
- package/js/components/result/base-result-link.vue.js +2 -1
- package/js/components/result/base-result-link.vue.js.map +1 -1
- package/js/components/result/base-result-link.vue_rollup-plugin-vue_script.vue.js +46 -27
- package/js/components/result/base-result-link.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/components/result/base-result-link.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
- package/js/components/result/base-result-previous-price.vue.js.map +1 -1
- package/js/components/result/base-result-previous-price.vue_rollup-plugin-vue_script.vue.js +34 -17
- package/js/components/result/base-result-previous-price.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/components/result/base-result-rating.vue.js +2 -1
- package/js/components/result/base-result-rating.vue.js.map +1 -1
- package/js/components/result/base-result-rating.vue_rollup-plugin-vue_script.vue.js +44 -27
- package/js/components/result/base-result-rating.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/components/result/base-result-rating.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
- package/js/utils/options-api.js +4 -0
- package/js/utils/options-api.js.map +1 -0
- package/package.json +2 -2
- package/report/x-components.api.json +1556 -526
- package/report/x-components.api.md +130 -57
- package/types/components/result/base-result-add-to-cart.vue.d.ts +16 -8
- package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
- package/types/components/result/base-result-current-price.vue.d.ts +40 -10
- package/types/components/result/base-result-current-price.vue.d.ts.map +1 -1
- package/types/components/result/base-result-image.vue.d.ts +60 -70
- package/types/components/result/base-result-image.vue.d.ts.map +1 -1
- package/types/components/result/base-result-link.vue.d.ts +18 -23
- package/types/components/result/base-result-link.vue.d.ts.map +1 -1
- package/types/components/result/base-result-previous-price.vue.d.ts +40 -5
- package/types/components/result/base-result-previous-price.vue.d.ts.map +1 -1
- package/types/components/result/base-result-rating.vue.d.ts +28 -9
- package/types/components/result/base-result-rating.vue.d.ts.map +1 -1
- package/types/utils/options-api.d.ts +3 -0
- package/types/utils/options-api.d.ts.map +1 -0
- package/docs/API-reference/api/x-components.baseaddtocart.events.md +0 -13
- package/docs/API-reference/api/x-components.baseaddtocart.result.md +0 -13
- package/docs/API-reference/api/x-components.baseresultcurrentprice.format.md +0 -18
- package/docs/API-reference/api/x-components.baseresultcurrentprice.result.md +0 -13
- package/docs/API-reference/api/x-components.baseresultimage.hoveranimation.md +0 -13
- package/docs/API-reference/api/x-components.baseresultimage.loadanimation.md +0 -13
- package/docs/API-reference/api/x-components.baseresultimage.result.md +0 -13
- package/docs/API-reference/api/x-components.baseresultimage.shownextimageonhover.md +0 -13
- package/docs/API-reference/api/x-components.baseresultlink.result.md +0 -13
- package/docs/API-reference/api/x-components.baseresultpreviousprice.format.md +0 -18
- package/docs/API-reference/api/x-components.baseresultpreviousprice.result.md +0 -13
- package/docs/API-reference/api/x-components.baseresultrating.link.md +0 -13
- package/docs/API-reference/api/x-components.baseresultrating.result.md +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.0-alpha.366](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.365...@empathyco/x-components@3.0.0-alpha.366) (2023-05-04)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- migrate results to vue 3 syntax (#1145)
|
|
11
|
+
([820622a](https://github.com/empathyco/x/commit/820622ab6a37d03de1e4843df2bdbb9daea57e58))
|
|
12
|
+
|
|
13
|
+
# Change Log
|
|
14
|
+
|
|
15
|
+
All notable changes to this project will be documented in this file. See
|
|
16
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
17
|
+
|
|
6
18
|
## [3.0.0-alpha.365](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.364...@empathyco/x-components@3.0.0-alpha.365) (2023-05-03)
|
|
7
19
|
|
|
8
20
|
### Features
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseAddToCart](./x-components.baseaddtocart.md)
|
|
4
4
|
|
|
5
|
-
## BaseAddToCart
|
|
5
|
+
## BaseAddToCart variable
|
|
6
6
|
|
|
7
7
|
Renders a button with a default slot. It receives the result with the data and emits [XEventsTypes.UserClickedResultAddToCart](./x-components.xeventstypes.userclickedresultaddtocart.md) to the bus on click mouse event.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
result: {
|
|
14
|
+
type: PropType<Result>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}, {
|
|
18
|
+
events: import("vue").ComputedRef<Partial<XEventsTypes>>;
|
|
19
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
result: {
|
|
21
|
+
type: PropType<Result>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>>, {}>
|
|
13
25
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [events](./x-components.baseaddtocart.events.md) | <p><code>protected</code></p><p><code>readonly</code></p> | Partial<[XEventsTypes](./x-components.xeventstypes.md)<!-- -->> | The events to be emitted by the button. |
|
|
21
|
-
| [result](./x-components.baseaddtocart.result.md) | <code>protected</code> | Result | (Required) The [result](./x-types.result.md) information. |
|
|
22
|
-
|
|
@@ -2,21 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseResultCurrentPrice](./x-components.baseresultcurrentprice.md)
|
|
4
4
|
|
|
5
|
-
## BaseResultCurrentPrice
|
|
5
|
+
## BaseResultCurrentPrice variable
|
|
6
6
|
|
|
7
7
|
Component that renders the [result](./x-types.result.md) current price that may or may not be on sale.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
result: {
|
|
14
|
+
type: PropType<Result>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
format: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
dynamicClasses: import("vue").ComputedRef<VueCSSClasses>;
|
|
22
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
result: {
|
|
24
|
+
type: PropType<Result>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
format: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
};
|
|
30
|
+
}>>, {}>
|
|
13
31
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [format?](./x-components.baseresultcurrentprice.format.md) | <code>protected</code> | string | _(Optional)_ Format or mask to be defined as string. - Use 'i' to define integer numbers. - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the doesn't include decimals, it is filled with zeros until reach the length defined with 'd's. - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group. - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more than one character. - Set whatever you need around the integers and decimals marks. - Default mask: 'i.iii,dd' which returns '1.345,67'. |
|
|
21
|
-
| [result](./x-components.baseresultcurrentprice.result.md) | <code>protected</code> | Result | (Required) The [result](./x-types.result.md) information. |
|
|
22
|
-
|
|
@@ -2,23 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseResultImage](./x-components.baseresultimage.md)
|
|
4
4
|
|
|
5
|
-
## BaseResultImage
|
|
5
|
+
## BaseResultImage variable
|
|
6
6
|
|
|
7
7
|
Component to be reused that renders an `<img>`<!-- -->.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: DefineComponent<{
|
|
13
|
+
result: {
|
|
14
|
+
type: PropType<Result>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
loadAnimation: {
|
|
18
|
+
type: PropType<string | DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
19
|
+
default: () => import("vue/types/vue").ExtendedVue<import("vue").default<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => import("vue").default<Record<string, any>, Record<string, any>, never, never, any>>, unknown, unknown, unknown, Record<never, any>, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin>;
|
|
20
|
+
};
|
|
21
|
+
hoverAnimation: {
|
|
22
|
+
type: PropType<string | DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
23
|
+
};
|
|
24
|
+
showNextImageOnHover: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
29
|
+
pendingImages: Ref<string[]>;
|
|
30
|
+
loadedImages: Ref<string[]>;
|
|
31
|
+
isHovering: Ref<boolean>;
|
|
32
|
+
userHasHoveredImage: Ref<boolean>;
|
|
33
|
+
loaderStyles: Partial<CSSStyleDeclaration>;
|
|
34
|
+
animation: import("vue").ComputedRef<string | DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
35
|
+
imageSrc: import("vue").ComputedRef<string>;
|
|
36
|
+
shouldLoadNextImage: import("vue").ComputedRef<boolean>;
|
|
37
|
+
flagImageAsFailed: () => void;
|
|
38
|
+
flagImageLoaded: () => void;
|
|
39
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
result: {
|
|
41
|
+
type: PropType<Result>;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
loadAnimation: {
|
|
45
|
+
type: PropType<string | DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
46
|
+
default: () => import("vue/types/vue").ExtendedVue<import("vue").default<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => import("vue").default<Record<string, any>, Record<string, any>, never, never, any>>, unknown, unknown, unknown, Record<never, any>, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin>;
|
|
47
|
+
};
|
|
48
|
+
hoverAnimation: {
|
|
49
|
+
type: PropType<string | DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
50
|
+
};
|
|
51
|
+
showNextImageOnHover: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
}>>, {
|
|
56
|
+
loadAnimation: string | DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}> | (import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{}, Readonly<import("vue").ExtractPropTypes<{}>>, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue").ExtractPropTypes<{}>>> & import("vue").ShallowUnwrapRef<{}> & import("vue/types/v3-component-options").ExtractComputedReturns<import("vue").ComponentComputedOptions> & import("vue").ComponentMethodOptions & import("vue").ComponentCustomProperties & Readonly<import("vue").ExtractPropTypes<{}>>, any, any, any, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, {}> & {
|
|
57
|
+
props: {};
|
|
58
|
+
});
|
|
59
|
+
showNextImageOnHover: boolean;
|
|
60
|
+
}>
|
|
13
61
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [hoverAnimation](./x-components.baseresultimage.hoveranimation.md) | | string \| typeof Vue \| undefined | Animation to use when switching between the loaded image and the hover image. |
|
|
21
|
-
| [loadAnimation](./x-components.baseresultimage.loadanimation.md) | | string \| typeof Vue | Animation to use when switching between the placeholder, the loaded image, or the failed image fallback. |
|
|
22
|
-
| [result](./x-components.baseresultimage.result.md) | <code>protected</code> | Result | (Required) The [result](./x-types.result.md) information. |
|
|
23
|
-
| [showNextImageOnHover](./x-components.baseresultimage.shownextimageonhover.md) | | boolean | Indicates if the next valid image should be displayed on hover. |
|
|
24
|
-
|
|
@@ -2,24 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseResultLink](./x-components.baseresultlink.md)
|
|
4
4
|
|
|
5
|
-
## BaseResultLink
|
|
5
|
+
## BaseResultLink variable
|
|
6
6
|
|
|
7
7
|
Component to be reused that renders an `<a>` wrapping the result contents.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
result: {
|
|
14
|
+
type: PropType<Result>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}, {
|
|
18
|
+
emitUserClickedAResult: () => void;
|
|
19
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
result: {
|
|
21
|
+
type: PropType<Result>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>>, {}>
|
|
13
25
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
26
|
|
|
16
27
|
## Remarks
|
|
17
28
|
|
|
18
|
-
It has the logic to emit [XEventsTypes.UserClickedAResult](./x-components.xeventstypes.userclickedaresult.md) to the bus on click mouse events. Additionally, this component may be injected other events to be emitted on click event, so, depending where it's used its father component may provide this events.
|
|
19
|
-
|
|
20
|
-
## Properties
|
|
21
|
-
|
|
22
|
-
| Property | Modifiers | Type | Description |
|
|
23
|
-
| --- | --- | --- | --- |
|
|
24
|
-
| [result](./x-components.baseresultlink.result.md) | <code>protected</code> | Result | (Required) The [result](./x-types.result.md) information. |
|
|
29
|
+
It has the logic to emit [XEventsTypes.UserClickedAResult](./x-components.xeventstypes.userclickedaresult.md) to the bus on click mouse events. Additionally, this component may be injected other events to be emitted on click event, so, depending on where it's used its father component may provide this events.
|
|
25
30
|
|
|
@@ -2,21 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseResultPreviousPrice](./x-components.baseresultpreviousprice.md)
|
|
4
4
|
|
|
5
|
-
## BaseResultPreviousPrice
|
|
5
|
+
## BaseResultPreviousPrice variable
|
|
6
6
|
|
|
7
7
|
Component that renders the [result](./x-types.result.md) previous price.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
result: {
|
|
14
|
+
type: PropType<Result>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
format: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
result: {
|
|
22
|
+
type: PropType<Result>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
format: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
28
|
+
}>>, {}>
|
|
13
29
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [format?](./x-components.baseresultpreviousprice.format.md) | <code>protected</code> | string | _(Optional)_ Format or mask to be defined as string. - Use 'i' to define integer numbers. - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the doesn't include decimals, it is filled with zeros until reach the length defined with 'd's. - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group. - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more than one character. - Set whatever you need around the integers and decimals marks. |
|
|
21
|
-
| [result](./x-components.baseresultpreviousprice.result.md) | <code>protected</code> | Result | (Required) The [result](./x-types.result.md) information. |
|
|
22
|
-
|
|
@@ -2,21 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseResultRating](./x-components.baseresultrating.md)
|
|
4
4
|
|
|
5
|
-
## BaseResultRating
|
|
5
|
+
## BaseResultRating variable
|
|
6
6
|
|
|
7
7
|
This component renders a [BaseRating](./x-components.baserating.md) for a result passed as prop.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
result: {
|
|
14
|
+
type: PropType<Result>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
link: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
emitClickedEvent: () => void;
|
|
22
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
result: {
|
|
24
|
+
type: PropType<Result>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
link: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
};
|
|
30
|
+
}>>, {}>
|
|
13
31
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [link](./x-components.baseresultrating.link.md) | <code>protected</code> | string | A link to redirect when rating is clicked. |
|
|
21
|
-
| [result](./x-components.baseresultrating.result.md) | <code>protected</code> | Result | The [Result](./x-types.result.md) to render its rating. |
|
|
22
|
-
|
|
@@ -15,7 +15,6 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
15
15
|
| [AnimateWidth](./x-components.animatewidth.md) | Renders a transition wrapping an element passed in the default slot and animating its width. |
|
|
16
16
|
| [Banner](./x-components.banner.md) | <p>. A banner result is just an item that has been inserted into the search results to advertise something. Usually it is the first item in the grid or it can be placed in the middle of them and fill the whole row where appears. The banner may be clickable or non-clickable depending on whether it has an associated URL or not. It contains an image and, optionally, a title. In case the image does not load due to an error the banner will not be rendered.</p><p>Additionally, this component exposes the following props to modify the classes of the elements: <code>titleClass</code>.</p> |
|
|
17
17
|
| [BannersList](./x-components.bannerslist.md) | <p>It renders a [ItemsList](./x-components.itemslist.md) list of banners from [SearchState.banners](./x-components.searchstate.banners.md) by default using the <code>ItemsInjectionMixin</code>.</p><p>The component provides a default slot which wraps the whole component with the <code>banners</code> plus the <code>searchInjectedItems</code> which also contains the injected list items from the ancestor.</p><p>It also provides the parent slots to customize the items.</p> |
|
|
18
|
-
| [BaseAddToCart](./x-components.baseaddtocart.md) | Renders a button with a default slot. It receives the result with the data and emits [XEventsTypes.UserClickedResultAddToCart](./x-components.xeventstypes.userclickedresultaddtocart.md) to the bus on click mouse event. |
|
|
19
18
|
| [BaseColumnPickerDropdown](./x-components.basecolumnpickerdropdown.md) | <p>Column picker dropdown component renders [dropdown](./x-components.basedropdown.md) component which options are the different columns you can set for a grid.</p><p>It emits [UserClickedColumnPicker](./x-components.xeventstypes.userclickedcolumnpicker.md) on dropdown input.</p> |
|
|
20
19
|
| [BaseColumnPickerList](./x-components.basecolumnpickerlist.md) | <p>Column picker list component renders a list of buttons to choose the columns number.</p><p>Additionally, this component exposes the following props to modify the classes of the elements: <code>buttonClass</code>.</p> |
|
|
21
20
|
| [BaseCurrency](./x-components.basecurrency.md) | <p>Renders the value received as a property which always must be a JavaScript number, with the proper format provided as a string property or by injection. The rendered tag is a span in order to render a default inline HTML element.</p><p>Regarding the format or mask to be defined as string: - Use 'i' to define integer numbers. - Use 'd' to define decimal numbers. You can define the length of the decimal part. If the format doesn't include decimals, it is filled with zeros until reach the length defined with 'd's. - Integer separator must be defined between the 3rd and the 4th integer 'i' of a group. - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more than one character. - If you want to hide the decimal part if it's zero, you can add the <code>?</code> symbol after the decimal characters (e.g. 'i.iii,dd?', for <code>1234</code> you would get <code>1.234</code> instead of <code>1.234,00</code>). - Set whatever you need around the integers and decimals marks. - Default mask: 'i.iii,dd' which returns '1.345,67'.</p> |
|
|
@@ -30,11 +29,6 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
30
29
|
| [BaseKeyboardNavigation](./x-components.basekeyboardnavigation.md) | Base component to handle keyboard navigation for elements inside it. It has a required slot to include the navigable elements. |
|
|
31
30
|
| [BaseModal](./x-components.basemodal.md) | Base component with no XPlugin dependencies that serves as a utility for constructing more complex modals. |
|
|
32
31
|
| [BaseRating](./x-components.baserating.md) | Rating component. This component renders a set of elements filled based on the value passed as prop. |
|
|
33
|
-
| [BaseResultCurrentPrice](./x-components.baseresultcurrentprice.md) | Component that renders the [result](./x-types.result.md) current price that may or may not be on sale. |
|
|
34
|
-
| [BaseResultImage](./x-components.baseresultimage.md) | Component to be reused that renders an <code><img></code>. |
|
|
35
|
-
| [BaseResultLink](./x-components.baseresultlink.md) | Component to be reused that renders an <code><a></code> wrapping the result contents. |
|
|
36
|
-
| [BaseResultPreviousPrice](./x-components.baseresultpreviousprice.md) | Component that renders the [result](./x-types.result.md) previous price. |
|
|
37
|
-
| [BaseResultRating](./x-components.baseresultrating.md) | This component renders a [BaseRating](./x-components.baserating.md) for a result passed as prop. |
|
|
38
32
|
| [BaseScroll](./x-components.basescroll.md) | Base scroll component that depending on the user interactivity emits different events for knowing when the user scrolls, the direction of scroll and if user reaches the start or end. |
|
|
39
33
|
| [BaseSuggestion](./x-components.basesuggestion.md) | <p>Renders a button with a default slot. It receives a query, which should be the query of the module using this component, a suggestion, the [XEvents](./x-components.xevent.md) that will be emitted on click with a given feature.</p><p>The default slot receives the suggestion and the matched query has props.</p> |
|
|
40
34
|
| [BaseSuggestions](./x-components.basesuggestions.md) | Paints a list of suggestions passed in by prop. Requires a component for a single suggestion in the default slot for working. |
|
|
@@ -385,6 +379,7 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
385
379
|
| [BagIcon](./x-components.bagicon.md) | |
|
|
386
380
|
| [BarCodeIcon](./x-components.barcodeicon.md) | |
|
|
387
381
|
| [BarcodeTinyIcon](./x-components.barcodetinyicon.md) | |
|
|
382
|
+
| [BaseAddToCart](./x-components.baseaddtocart.md) | Renders a button with a default slot. It receives the result with the data and emits [XEventsTypes.UserClickedResultAddToCart](./x-components.xeventstypes.userclickedresultaddtocart.md) to the bus on click mouse event. |
|
|
388
383
|
| [BaseEventsModalClose](./x-components.baseeventsmodalclose.md) | Component contains an event button that emits [XEventsTypes.UserClickedCloseEventsModal](./x-components.xeventstypes.userclickedcloseeventsmodal.md) when clicked. It has a default slot to customize its contents. |
|
|
389
384
|
| [BaseEventsModalOpen](./x-components.baseeventsmodalopen.md) | Component contains an event button that emits [XEventsTypes.UserClickedOpenEventsModal](./x-components.xeventstypes.userclickedopeneventsmodal.md) when clicked. It has a default slot to customize its contents. |
|
|
390
385
|
| [BaseFallbackImage](./x-components.basefallbackimage.md) | |
|
|
@@ -393,6 +388,11 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
393
388
|
| [BasePlaceholderImage](./x-components.baseplaceholderimage.md) | |
|
|
394
389
|
| [BasePriceFilterLabel](./x-components.basepricefilterlabel.md) | Renders a label for a price filter, allowing to select different messages depending on the value of the filter. |
|
|
395
390
|
| [BaseRatingFilterLabel](./x-components.baseratingfilterlabel.md) | Renders a label for a rating filter, allowing to override the elements used to paint the rating. |
|
|
391
|
+
| [BaseResultCurrentPrice](./x-components.baseresultcurrentprice.md) | Component that renders the [result](./x-types.result.md) current price that may or may not be on sale. |
|
|
392
|
+
| [BaseResultImage](./x-components.baseresultimage.md) | Component to be reused that renders an <code><img></code>. |
|
|
393
|
+
| [BaseResultLink](./x-components.baseresultlink.md) | Component to be reused that renders an <code><a></code> wrapping the result contents. |
|
|
394
|
+
| [BaseResultPreviousPrice](./x-components.baseresultpreviousprice.md) | Component that renders the [result](./x-types.result.md) previous price. |
|
|
395
|
+
| [BaseResultRating](./x-components.baseresultrating.md) | This component renders a [BaseRating](./x-components.baserating.md) for a result passed as prop. |
|
|
396
396
|
| [BaseTogglePanel](./x-components.basetogglepanel.md) | Simple panel that receives its open state via prop, which is responsible of rendering default slot inside a configurable transition. |
|
|
397
397
|
| [bus](./x-components.bus.md) | Default implementation. |
|
|
398
398
|
| [cancelFetchAndSaveIdentifierResults](./x-components.cancelfetchandsaveidentifierresults.md) | Default implementation for [IdentifierResultsActions.cancelFetchAndSaveIdentifierResults()](./x-components.identifierresultsactions.cancelfetchandsaveidentifierresults.md) action. |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-result-add-to-cart.vue.js","sources":["../../../../src/components/result/base-result-add-to-cart.vue"],"sourcesContent":["<template>\n <BaseEventButton\n v-on=\"$listeners\"\n :events=\"events\"\n class=\"x-result-add-to-cart x-button\"\n data-test=\"result-add-to-cart\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import
|
|
1
|
+
{"version":3,"file":"base-result-add-to-cart.vue.js","sources":["../../../../src/components/result/base-result-add-to-cart.vue"],"sourcesContent":["<template>\n <BaseEventButton\n v-on=\"$listeners\"\n :events=\"events\"\n class=\"x-result-add-to-cart x-button\"\n data-test=\"result-add-to-cart\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\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</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nRenders a button with a default slot. It receives the result with the data and emits an event\n`UserClickedResultAddToCart` to the bus on click mouse event.\n\n### Basic example\n\nThis component is a button to emit `UserClickedResultAddToCart` whe clicked by the user\n\n```vue\n<BaseResultAddToCart :result=\"result\">\n <img src=\"./add-to-cart.svg\" />\n <span>Add to cart</span>\n</BaseResultAddToCart>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserClickedResultAddToCart`: the event is emitted after the user clicks the button. The event\n payload is the result data.\n</docs>\n"],"names":[],"mappings":";;;;AAEA,MAAc,cAAA,GAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
package/js/components/result/base-result-add-to-cart.vue_rollup-plugin-vue_script.vue.js.map
CHANGED
|
@@ -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
|
|
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 {
|
|
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 {
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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
|
package/js/components/result/base-result-current-price.vue_rollup-plugin-vue_script.vue.js.map
CHANGED
|
@@ -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 {
|
|
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-
|
|
78
|
+
const __vue_scope_id__ = "data-v-1ae01006";
|
|
79
79
|
/* module identifier */
|
|
80
80
|
const __vue_module_identifier__ = undefined;
|
|
81
81
|
/* functional template */
|