@empathyco/x-components 3.0.0-alpha.73 → 3.0.0-alpha.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
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.74](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.73...@empathyco/x-components@3.0.0-alpha.74) (2022-03-31)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **base-currency:** format preference goes prop to be injected by default
11
+ ([29d5e8d](https://github.com/empathyco/x/commit/29d5e8d576019504ef642af6119c764292f44c51)),
12
+ closes [EX-5649](https://searchbroker.atlassian.net/browse/EX-5649)
13
+
14
+ # Change Log
15
+
16
+ All notable changes to this project will be documented in this file. See
17
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
18
+
6
19
  ## [3.0.0-alpha.73](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.72...@empathyco/x-components@3.0.0-alpha.73) (2022-03-24)
7
20
 
8
21
  ### Features
@@ -4,12 +4,12 @@
4
4
 
5
5
  ## BaseResultPreviousPrice.format property
6
6
 
7
- 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'.
7
+ 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.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
11
11
  ```typescript
12
- protected format: string;
12
+ protected format?: string;
13
13
  ```
14
14
 
15
15
  ## Remarks
@@ -17,6 +17,6 @@ export default class BaseResultPreviousPrice extends Vue
17
17
 
18
18
  | Property | Modifiers | Type | Description |
19
19
  | --- | --- | --- | --- |
20
- | [format](./x-components.baseresultpreviousprice.format.md) | | string | 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'. |
20
+ | [format?](./x-components.baseresultpreviousprice.format.md) | | string | <i>(Optional)</i> 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
21
  | [result](./x-components.baseresultpreviousprice.result.md) | | Result | (Required) The [result](./x-types.result.md) information. |
22
22
 
@@ -50,32 +50,271 @@ HTML element.
50
50
  ### Basic usage
51
51
 
52
52
  ```vue
53
- <BaseCurrency :value="12345678.87654321" format="i.iii,ddd? €" />
54
- <!-- output: '12.345.678,876 €' -->
55
- <BaseCurrency :value="12345678" format="i.iii,ddd? €" />
56
- <!-- output: '12.345.678 €' -->
57
- <BaseCurrency :value="12345678.87654321" format="$ i.iii,dd" />
58
- <!-- output: '$ 12.345.678,87' -->
59
- <BaseCurrency :value="12345678.87654321" format="$i.iii,dd" />
60
- <!-- output: '$12.345.678,87' -->
61
- <BaseCurrency :value="12345678.87654321" format="i.iii,dd €" />
62
- <!-- output: '12.345.678,87 €' -->
63
- <BaseCurrency :value="12345678.87654321" format="i.iii,dd€" />
64
- <!-- output: '12.345.678,87€' -->
65
- <BaseCurrency :value="12345678.87654321" format="i,iii.dd €" />
66
- <!-- output: '12,345,678.87 €' -->
67
- <BaseCurrency :value="12345678.87654321" format="i iii.dd €" />
68
- <!-- output: '12 345 678.87 €' -->
69
- <BaseCurrency :value="12345678.87654321" format="i iii - dd €" />
70
- <!-- output: '12 345 678 - 87 €' -->
71
- <BaseCurrency :value="12345678.87654321" format="i.iii,dddddd €" />
72
- <!-- output: '12.345.678,876543' -->
73
- <BaseCurrency :value="12345678.87" format="i.iii,dddddd" />
74
- <!-- output: '12.345.678,870000 €' -->
75
- <BaseCurrency :value="12345678" format="i.iii,dddddd €" />
76
- <!-- output: '12.345.678,000000 €' -->
77
- <BaseCurrency :value="12345678.87654321" format="i.iii,dd " />
78
- <!-- output: '12.345.678,87 €' -->
79
- <BaseCurrency :value="12345678.87654321" format="i.iii €" />
80
- <!-- output: '12.345.678 €' -->
53
+ <template>
54
+ <BaseCurrency :value="12345678.87654321" />
55
+ <!-- output: '12.345.678,87' -->
56
+ </template>
57
+
58
+ <script>
59
+ import { BaseCurrency } from "@empathyco/x-components";
60
+
61
+ export default {
62
+ name: "BaseCurrencyDemo",
63
+ components: {
64
+ BaseCurrency
65
+ }
66
+ };
67
+ </script>
68
+ ```
69
+
70
+ ```vue
71
+ <template>
72
+ <BaseCurrency :value="12345678.87654321" format="i.iii,ddd?" />
73
+ <!-- output: '12.345.678,876' -->
74
+ </template>
75
+
76
+ <script>
77
+ import { BaseCurrency } from "@empathyco/x-components";
78
+
79
+ export default {
80
+ name: "BaseCurrencyDemo",
81
+ components: {
82
+ BaseCurrency
83
+ }
84
+ };
85
+ </script>
86
+ ```
87
+
88
+ ```vue
89
+ <template>
90
+ <BaseCurrency :value="12345678" format="i.iii,ddd? €" />
91
+ <!-- output: '12.345.678 €' -->
92
+ </template>
93
+
94
+ <script>
95
+ import { BaseCurrency } from "@empathyco/x-components";
96
+
97
+ export default {
98
+ name: "BaseCurrencyDemo",
99
+ components: {
100
+ BaseCurrency
101
+ }
102
+ };
103
+ </script>
104
+ ```
105
+
106
+ ```vue
107
+ <template>
108
+ <BaseCurrency :value="12345678.87654321" format="$ i.iii,dd" />
109
+ <!-- output: '$ 12.345.678,87' -->
110
+ </template>
111
+
112
+ <script>
113
+ import { BaseCurrency } from "@empathyco/x-components";
114
+
115
+ export default {
116
+ name: "BaseCurrencyDemo",
117
+ components: {
118
+ BaseCurrency
119
+ }
120
+ };
121
+ </script>
122
+ ```
123
+
124
+ ```vue
125
+ <template>
126
+ <BaseCurrency :value="12345678.87654321" format="$i.iii,dd" />
127
+ <!-- output: '$12.345.678,87' -->
128
+ </template>
129
+
130
+ <script>
131
+ import { BaseCurrency } from "@empathyco/x-components";
132
+
133
+ export default {
134
+ name: "BaseCurrencyDemo",
135
+ components: {
136
+ BaseCurrency
137
+ }
138
+ };
139
+ </script>
140
+ ```
141
+
142
+ ```vue
143
+ <template>
144
+ <BaseCurrency :value="12345678.87654321" format="i.iii,dd €" />
145
+ <!-- output: '12.345.678,87 €' -->
146
+ </template>
147
+
148
+ <script>
149
+ import { BaseCurrency } from "@empathyco/x-components";
150
+
151
+ export default {
152
+ name: "BaseCurrencyDemo",
153
+ components: {
154
+ BaseCurrency
155
+ }
156
+ };
157
+ </script>
158
+ ```
159
+
160
+ ```vue
161
+ <template>
162
+ <BaseCurrency :value="12345678.87654321" format="i.iii,dd€" />
163
+ <!-- output: '12.345.678,87€' -->
164
+ </template>
165
+
166
+ <script>
167
+ import { BaseCurrency } from "@empathyco/x-components";
168
+
169
+ export default {
170
+ name: "BaseCurrencyDemo",
171
+ components: {
172
+ BaseCurrency
173
+ }
174
+ };
175
+ </script>
176
+ ```
177
+
178
+ ```vue
179
+ <template>
180
+ <BaseCurrency :value="12345678.87654321" format="i,iii.dd €" />
181
+ <!-- output: '12,345,678.87 €' -->
182
+ </template>
183
+
184
+ <script>
185
+ import { BaseCurrency } from "@empathyco/x-components";
186
+
187
+ export default {
188
+ name: "BaseCurrencyDemo",
189
+ components: {
190
+ BaseCurrency
191
+ }
192
+ };
193
+ </script>
194
+ ```
195
+
196
+ ```vue
197
+ <template>
198
+ <BaseCurrency :value="12345678.87654321" format="i iii.dd €" />
199
+ <!-- output: '12 345 678.87 €' -->
200
+ </template>
201
+
202
+ <script>
203
+ import { BaseCurrency } from "@empathyco/x-components";
204
+
205
+ export default {
206
+ name: "BaseCurrencyDemo",
207
+ components: {
208
+ BaseCurrency
209
+ }
210
+ };
211
+ </script>
212
+ ```
213
+
214
+ ```vue
215
+ <template>
216
+ <BaseCurrency :value="12345678.87654321" format="i iii - dd €" />
217
+ <!-- output: '12 345 678 - 87 €' -->
218
+ </template>
219
+
220
+ <script>
221
+ import { BaseCurrency } from "@empathyco/x-components";
222
+
223
+ export default {
224
+ name: "BaseCurrencyDemo",
225
+ components: {
226
+ BaseCurrency
227
+ }
228
+ };
229
+ </script>
230
+ ```
231
+
232
+ ```vue
233
+ <template>
234
+ <BaseCurrency :value="12345678.87654321" format="i.iii,dddddd €" />
235
+ <!-- output: '12.345.678,876543 €' -->
236
+ </template>
237
+
238
+ <script>
239
+ import { BaseCurrency } from "@empathyco/x-components";
240
+
241
+ export default {
242
+ name: "BaseCurrencyDemo",
243
+ components: {
244
+ BaseCurrency
245
+ }
246
+ };
247
+ </script>
248
+ ```
249
+
250
+ ```vue
251
+ <template>
252
+ <BaseCurrency :value="12345678.87" format="i.iii,dddddd €" />
253
+ <!-- output: '12.345.678,870000 €' -->
254
+ </template>
255
+
256
+ <script>
257
+ import { BaseCurrency } from "@empathyco/x-components";
258
+
259
+ export default {
260
+ name: "BaseCurrencyDemo",
261
+ components: {
262
+ BaseCurrency
263
+ }
264
+ };
265
+ </script>
266
+ ```
267
+
268
+ ```vue
269
+ <template>
270
+ <BaseCurrency :value="12345678" format="i.iii,dddddd €" />
271
+ <!-- output: '12.345.678,000000 €' -->
272
+ </template>
273
+
274
+ <script>
275
+ import { BaseCurrency } from "@empathyco/x-components";
276
+
277
+ export default {
278
+ name: "BaseCurrencyDemo",
279
+ components: {
280
+ BaseCurrency
281
+ }
282
+ };
283
+ </script>
284
+ ```
285
+
286
+ ```vue
287
+ <template>
288
+ <BaseCurrency :value="12345678.87654321" format="i.iii,dd €" />
289
+ <!-- output: '12.345.678,87 €' -->
290
+ </template>
291
+
292
+ <script>
293
+ import { BaseCurrency } from "@empathyco/x-components";
294
+
295
+ export default {
296
+ name: "BaseCurrencyDemo",
297
+ components: {
298
+ BaseCurrency
299
+ }
300
+ };
301
+ </script>
302
+ ```
303
+
304
+ ```vue
305
+ <template>
306
+ <BaseCurrency :value="12345678.87654321" format="i.iii €" />
307
+ <!-- output: '12.345.678 €' -->
308
+ </template>
309
+
310
+ <script>
311
+ import { BaseCurrency } from "@empathyco/x-components";
312
+
313
+ export default {
314
+ name: "BaseCurrencyDemo",
315
+ components: {
316
+ BaseCurrency
317
+ }
318
+ };
319
+ </script>
81
320
  ```
@@ -10,10 +10,10 @@ Component that renders the {@link @empathyco/x-types#Result | result} previous p
10
10
 
11
11
  ## Props
12
12
 
13
- | Name | Description | Type | Default |
14
- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ----------------------- |
15
- | <code>result</code> | (Required) The {@link @empathyco/x-types#Result \| result} information. | <code>Result</code> | <code></code> |
16
- | <code>format</code> | Format or mask to be defined as string.<br />- Use 'i' to define integer numbers.<br />- Use 'd' to define decimal numbers. You can define the length of the decimal part. If the<br />doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.<br />- Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.<br />- Decimal separator must be defined between the last 'i' and the first 'd'. It can be more<br />than one character.<br />- Set whatever you need around the integers and decimals marks.<br />- Default mask: 'i.iii,dd' which returns '1.345,67'. | <code>string</code> | <code>'i.iii,dd'</code> |
13
+ | Name | Description | Type | Default |
14
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------------- |
15
+ | <code>result</code> | (Required) The {@link @empathyco/x-types#Result \| result} information. | <code>Result</code> | <code></code> |
16
+ | <code>format</code> | Format or mask to be defined as string.<br />- Use 'i' to define integer numbers.<br />- Use 'd' to define decimal numbers. You can define the length of the decimal part. If the<br />doesn't include decimals, it is filled with zeros until reach the length defined with 'd's.<br />- Integer separator must be defined between the 3rd and the 4th integer 'i' of a group.<br />- Decimal separator must be defined between the last 'i' and the first 'd'. It can be more<br />than one character.<br />- Set whatever you need around the integers and decimals marks. | <code>string</code> | <code></code> |
17
17
 
18
18
  ## Slots
19
19
 
@@ -29,13 +29,41 @@ This component shows the previous price formatted if it has discount. The compon
29
29
  props. `format` to select the currency format to be applied.
30
30
 
31
31
  ```vue
32
- <BaseResultPreviousPrice :value="result" :format="'i.iii,ddd €'" />
32
+ <template>
33
+ <BaseResultPreviousPrice :result="result" :format="'i.iii,ddd €'" />
34
+ </template>
35
+
36
+ <script>
37
+ import { BaseResultPreviousPrice } from "@empathyco/x-components";
38
+
39
+ export default {
40
+ name: "BaseResultPreviousPriceDemo",
41
+ components: {
42
+ BaseResultPreviousPrice
43
+ }
44
+ };
45
+ </script>
33
46
  ```
34
47
 
35
48
  ### Overriding default slot
36
49
 
37
50
  ```vue
38
- <BaseResultPreviousPrice :result="result">
39
- <span class="custom-base-result-previous-price">{{ result.price.originalValue }}</span>
40
- </BaseResultPreviousPrice>
51
+ <template>
52
+ <BaseResultPreviousPrice :result="result">
53
+ <span class="custom-base-result-previous-price">{{
54
+ result.price.originalValue
55
+ }}</span>
56
+ </BaseResultPreviousPrice>
57
+ </template>
58
+
59
+ <script>
60
+ import { BaseResultPreviousPrice } from "@empathyco/x-components";
61
+
62
+ export default {
63
+ name: "BaseResultPreviousPriceDemo",
64
+ components: {
65
+ BaseResultPreviousPrice
66
+ }
67
+ };
68
+ </script>
41
69
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"base-currency.vue.js","sources":["../../../../src/components/currency/base-currency.vue"],"sourcesContent":["<template>\n <span v-if=\"value !== undefined\" class=\"x-currency\">{{ currency }}</span>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { currencyFormatter } from '../../utils/currency-formatter';\n import { XInject } from '../decorators/injection.decorators';\n\n /**\n * Renders the value received as a property which always must be a JavaScript number, with the\n * proper format provided as a string property or by injection. The rendered tag is a span in\n * order to render a default inline HTML element.\n *\n * Regarding the 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 * format doesn't include decimals, it is filled with zeros until reach the length defined with\n * '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 * - If you want to hide the decimal part if it's zero, you can add the `?` symbol after the\n * decimal characters (e.g. 'i.iii,dd?', for `1234` you would get `1.234` instead of `1.234,00`).\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 matches with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, it deletes significant digits.\n *\n * @example\n * Basic example:\n *\n * ```vue\n * <BaseCurrency\n * :value=\"123456.789\"\n * format=\"i.iiii,dddd €\"\n * />\n * ```\n *\n * It will render: `123.456,7890 €`.\n *\n * See docs below for more examples.\n *\n * @public\n */\n @Component\n export default class BaseCurrency extends Vue {\n /**\n * Numeric value to be formatted.\n *\n * @remarks Pass the value with 'v-bind:value' (or ':value' shortcut) instead of plain string.\n * @remarks Be careful using numbers under Number.MAX_SAFE_INTEGER to avoid unexpected errors.\n *\n * @public\n */\n @Prop({ required: true })\n protected value!: number;\n\n /**\n * The format as string.\n *\n * @public\n */\n @Prop()\n protected format?: string;\n\n /**\n * The injected format as string.\n *\n * @public\n */\n @XInject('currencyFormat')\n public injectedFormat!: string;\n\n /**\n * A format which can be passed through prop or injected.\n *\n * @returns A format as string.\n *\n * @internal\n */\n protected get renderedFormat(): string {\n return (\n this.format ??\n this.injectedFormat ??\n //TODO: add here logger\n //eslint-disable-next-line no-console\n console.warn('It is necessary to pass a prop or inject the format')\n );\n }\n\n /**\n * Returns the formatted result as string.\n *\n * @returns Formatted number.\n *\n * @internal\n */\n protected get currency(): string {\n return currencyFormatter(this.value, this.renderedFormat);\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nRenders the value received as a property, which always must be a JavaScript number, with the proper\nformat provided as string property. The rendered tag is a span in order to render a default inline\nHTML element.\n\n### Basic usage\n\n```vue\n<BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,ddd? €\" />\n<!-- output: '12.345.678,876 €' -->\n<BaseCurrency :value=\"12345678\" format=\"i.iii,ddd? €\" />\n<!-- output: '12.345.678 €' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"$ i.iii,dd\" />\n<!-- output: '$ 12.345.678,87' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"$i.iii,dd\" />\n<!-- output: '$12.345.678,87' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dd €\" />\n<!-- output: '12.345.678,87 €' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dd€\" />\n<!-- output: '12.345.678,87€' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i,iii.dd €\" />\n<!-- output: '12,345,678.87 €' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i iii.dd €\" />\n<!-- output: '12 345 678.87 €' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i iii - dd €\" />\n<!-- output: '12 345 678 - 87 €' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dddddd €\" />\n<!-- output: '12.345.678,876543 €' -->\n<BaseCurrency :value=\"12345678.87\" format=\"i.iii,dddddd €\" />\n<!-- output: '12.345.678,870000 €' -->\n<BaseCurrency :value=\"12345678\" format=\"i.iii,dddddd €\" />\n<!-- output: '12.345.678,000000 €' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dd €\" />\n<!-- output: '12.345.678,87 €' -->\n<BaseCurrency :value=\"12345678.87654321\" format=\"i.iii €\" />\n<!-- output: '12.345.678 €' -->\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-currency.vue.js","sources":["../../../../src/components/currency/base-currency.vue"],"sourcesContent":["<template>\n <span v-if=\"value !== undefined\" class=\"x-currency\">{{ currency }}</span>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { currencyFormatter } from '../../utils/currency-formatter';\n import { XInject } from '../decorators/injection.decorators';\n\n /**\n * Renders the value received as a property which always must be a JavaScript number, with the\n * proper format provided as a string property or by injection. The rendered tag is a span in\n * order to render a default inline HTML element.\n *\n * Regarding the 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 * format doesn't include decimals, it is filled with zeros until reach the length defined with\n * '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 * - If you want to hide the decimal part if it's zero, you can add the `?` symbol after the\n * decimal characters (e.g. 'i.iii,dd?', for `1234` you would get `1.234` instead of `1.234,00`).\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 matches with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, it deletes significant digits.\n *\n * @example\n * Basic example:\n *\n * ```vue\n * <BaseCurrency\n * :value=\"123456.789\"\n * format=\"i.iiii,dddd €\"\n * />\n * ```\n *\n * It will render: `123.456,7890 €`.\n *\n * See docs below for more examples.\n *\n * @public\n */\n @Component\n export default class BaseCurrency extends Vue {\n /**\n * Numeric value to be formatted.\n *\n * @remarks Pass the value with 'v-bind:value' (or ':value' shortcut) instead of plain string.\n * @remarks Be careful using numbers under Number.MAX_SAFE_INTEGER to avoid unexpected errors.\n *\n * @public\n */\n @Prop({ required: true })\n protected value!: number;\n\n /**\n * The format as string.\n *\n * @public\n */\n @Prop()\n protected format?: string;\n\n /**\n * The injected format as string.\n *\n * @public\n */\n @XInject('currencyFormat')\n public injectedFormat!: string;\n\n /**\n * A format which can be passed through prop or injected.\n *\n * @returns A format as string.\n *\n * @internal\n */\n protected get renderedFormat(): string {\n return this.format ?? this.injectedFormat ?? 'i.iii,dd';\n }\n\n /**\n * Returns the formatted result as string.\n *\n * @returns Formatted number.\n *\n * @internal\n */\n protected get currency(): string {\n return currencyFormatter(this.value, this.renderedFormat);\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nRenders the value received as a property, which always must be a JavaScript number, with the proper\nformat provided as string property. The rendered tag is a span in order to render a default inline\nHTML element.\n\n### Basic usage\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" />\n <!-- output: '12.345.678,87' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,ddd? €\" />\n <!-- output: '12.345.678,876 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678\" format=\"i.iii,ddd? €\" />\n <!-- output: '12.345.678 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"$ i.iii,dd\" />\n <!-- output: '$ 12.345.678,87' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"$i.iii,dd\" />\n <!-- output: '$12.345.678,87' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dd €\" />\n <!-- output: '12.345.678,87 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dd€\" />\n <!-- output: '12.345.678,87€' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i,iii.dd €\" />\n <!-- output: '12,345,678.87 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i iii.dd €\" />\n <!-- output: '12 345 678.87 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i iii - dd €\" />\n <!-- output: '12 345 678 - 87 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dddddd €\" />\n <!-- output: '12.345.678,876543 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87\" format=\"i.iii,dddddd €\" />\n <!-- output: '12.345.678,870000 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678\" format=\"i.iii,dddddd €\" />\n <!-- output: '12.345.678,000000 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i.iii,dd €\" />\n <!-- output: '12.345.678,87 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n\n```vue\n<template>\n <BaseCurrency :value=\"12345678.87654321\" format=\"i.iii €\" />\n <!-- output: '12.345.678 €' -->\n</template>\n\n<script>\n import { BaseCurrency } from '@empathyco/x-components';\n\n export default {\n name: 'BaseCurrencyDemo',\n components: {\n BaseCurrency\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -51,11 +51,7 @@ let BaseCurrency = class BaseCurrency extends Vue {
51
51
  * @internal
52
52
  */
53
53
  get renderedFormat() {
54
- return (this.format ??
55
- this.injectedFormat ??
56
- //TODO: add here logger
57
- //eslint-disable-next-line no-console
58
- console.warn('It is necessary to pass a prop or inject the format'));
54
+ return this.format ?? this.injectedFormat ?? 'i.iii,dd';
59
55
  }
60
56
  /**
61
57
  * Returns the formatted result as string.
@@ -1 +1 @@
1
- {"version":3,"file":"base-currency.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/currency/base-currency.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { currencyFormatter } from '../../utils/currency-formatter';\nimport { XInject } from '../decorators/injection.decorators';\n\n/**\n * Renders the value received as a property which always must be a JavaScript number, with the\n * proper format provided as a string property or by injection. The rendered tag is a span in\n * order to render a default inline HTML element.\n *\n * Regarding the 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 * format doesn't include decimals, it is filled with zeros until reach the length defined with\n * '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 * - If you want to hide the decimal part if it's zero, you can add the `?` symbol after the\n * decimal characters (e.g. 'i.iii,dd?', for `1234` you would get `1.234` instead of `1.234,00`).\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 matches with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, it deletes significant digits.\n *\n * @example\n * Basic example:\n *\n * ```vue\n * <BaseCurrency\n * :value=\"123456.789\"\n * format=\"i.iiii,dddd €\"\n * />\n * ```\n *\n * It will render: `123.456,7890 €`.\n *\n * See docs below for more examples.\n *\n * @public\n */\n@Component\nexport default class BaseCurrency extends Vue {\n /**\n * Numeric value to be formatted.\n *\n * @remarks Pass the value with 'v-bind:value' (or ':value' shortcut) instead of plain string.\n * @remarks Be careful using numbers under Number.MAX_SAFE_INTEGER to avoid unexpected errors.\n *\n * @public\n */\n @Prop({ required: true })\n protected value!: number;\n\n /**\n * The format as string.\n *\n * @public\n */\n @Prop()\n protected format?: string;\n\n /**\n * The injected format as string.\n *\n * @public\n */\n @XInject('currencyFormat')\n public injectedFormat!: string;\n\n /**\n * A format which can be passed through prop or injected.\n *\n * @returns A format as string.\n *\n * @internal\n */\n protected get renderedFormat(): string {\n return (\n this.format ??\n this.injectedFormat ??\n //TODO: add here logger\n //eslint-disable-next-line no-console\n console.warn('It is necessary to pass a prop or inject the format')\n );\n }\n\n /**\n * Returns the formatted result as string.\n *\n * @returns Formatted number.\n *\n * @internal\n */\n protected get currency(): string {\n return currencyFormatter(this.value, this.renderedFormat);\n }\n}\n"],"names":[],"mappings":";;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAqB,YAAY,GAAjC,MAAqB,YAAa,SAAQ,GAAG;;;;;;;;IAmC3C,IAAc,cAAc;QAC1B,QACE,IAAI,CAAC,MAAM;YACX,IAAI,CAAC,cAAc;;;YAGnB,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC,EACnE;KACH;;;;;;;;IASD,IAAc,QAAQ;QACpB,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;KAC3D;CACF,CAAA;AA7CC;IADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;2CACA;AAQzB;IADC,IAAI,EAAE;4CACmB;AAQ1B;IADC,OAAO,CAAC,gBAAgB,CAAC;oDACK;AA1BZ,YAAY;IADhC,SAAS;GACW,YAAY,CAuDhC;aAvDoB,YAAY;;;;"}
1
+ {"version":3,"file":"base-currency.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/currency/base-currency.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { currencyFormatter } from '../../utils/currency-formatter';\nimport { XInject } from '../decorators/injection.decorators';\n\n/**\n * Renders the value received as a property which always must be a JavaScript number, with the\n * proper format provided as a string property or by injection. The rendered tag is a span in\n * order to render a default inline HTML element.\n *\n * Regarding the 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 * format doesn't include decimals, it is filled with zeros until reach the length defined with\n * '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 * - If you want to hide the decimal part if it's zero, you can add the `?` symbol after the\n * decimal characters (e.g. 'i.iii,dd?', for `1234` you would get `1.234` instead of `1.234,00`).\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 matches with the length\n * of decimals provided from the adapter. Otherwise, when the component truncate the decimal\n * part, it deletes significant digits.\n *\n * @example\n * Basic example:\n *\n * ```vue\n * <BaseCurrency\n * :value=\"123456.789\"\n * format=\"i.iiii,dddd €\"\n * />\n * ```\n *\n * It will render: `123.456,7890 €`.\n *\n * See docs below for more examples.\n *\n * @public\n */\n@Component\nexport default class BaseCurrency extends Vue {\n /**\n * Numeric value to be formatted.\n *\n * @remarks Pass the value with 'v-bind:value' (or ':value' shortcut) instead of plain string.\n * @remarks Be careful using numbers under Number.MAX_SAFE_INTEGER to avoid unexpected errors.\n *\n * @public\n */\n @Prop({ required: true })\n protected value!: number;\n\n /**\n * The format as string.\n *\n * @public\n */\n @Prop()\n protected format?: string;\n\n /**\n * The injected format as string.\n *\n * @public\n */\n @XInject('currencyFormat')\n public injectedFormat!: string;\n\n /**\n * A format which can be passed through prop or injected.\n *\n * @returns A format as string.\n *\n * @internal\n */\n protected get renderedFormat(): string {\n return this.format ?? this.injectedFormat ?? 'i.iii,dd';\n }\n\n /**\n * Returns the formatted result as string.\n *\n * @returns Formatted number.\n *\n * @internal\n */\n protected get currency(): string {\n return currencyFormatter(this.value, this.renderedFormat);\n }\n}\n"],"names":[],"mappings":";;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAqB,YAAY,GAAjC,MAAqB,YAAa,SAAQ,GAAG;;;;;;;;IAmC3C,IAAc,cAAc;QAC1B,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,cAAc,IAAI,UAAU,CAAC;KACzD;;;;;;;;IASD,IAAc,QAAQ;QACpB,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;KAC3D;CACF,CAAA;AAvCC;IADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;2CACA;AAQzB;IADC,IAAI,EAAE;4CACmB;AAQ1B;IADC,OAAO,CAAC,gBAAgB,CAAC;oDACK;AA1BZ,YAAY;IADhC,SAAS;GACW,YAAY,CAiDhC;aAjDoB,YAAY;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-previous-price.vue.js","sources":["../../../../src/components/result/base-result-previous-price.vue"],"sourcesContent":["<template>\n <div\n v-if=\"result.price.hasDiscount\"\n class=\"x-result-previous-price\"\n data-test=\"result-previous-price\"\n >\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency :value=\"result.price.originalValue\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { Component, Prop } from 'vue-property-decorator';\n import Vue from 'vue';\n import BaseCurrency from '../currency/base-currency.vue';\n\n /**\n * Component that renders the {@link @empathyco/x-types#Result | result} previous price.\n *\n * @public\n */\n @Component({\n components: { BaseCurrency }\n })\n export default class BaseResultPreviousPrice 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({ default: 'i.iii,dd' })\n protected format!: string;\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the previous price formatted if it has discount. The component has two optional\nprops. `format` to select the currency format to be applied.\n\n```vue\n<BaseResultPreviousPrice :value=\"result\" :format=\"'i.iii,ddd €'\" />\n```\n\n### Overriding default slot\n\n```vue\n<BaseResultPreviousPrice :result=\"result\">\n <span class=\"custom-base-result-previous-price\">{{ result.price.originalValue }}</span>\n</BaseResultPreviousPrice>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-result-previous-price.vue.js","sources":["../../../../src/components/result/base-result-previous-price.vue"],"sourcesContent":["<template>\n <div\n v-if=\"result.price.hasDiscount\"\n class=\"x-result-previous-price\"\n data-test=\"result-previous-price\"\n >\n <!--\n @slot Base currency item\n @binding {result} result - Result data\n -->\n <slot :result=\"result\">\n <BaseCurrency :value=\"result.price.originalValue\" :format=\"format\" />\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { Component, Prop } from 'vue-property-decorator';\n import Vue from 'vue';\n import BaseCurrency from '../currency/base-currency.vue';\n\n /**\n * Component that renders the {@link @empathyco/x-types#Result | result} previous price.\n *\n * @public\n */\n @Component({\n components: { BaseCurrency }\n })\n export default class BaseResultPreviousPrice 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 *\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</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component shows the previous price formatted if it has discount. The component has two optional\nprops. `format` to select the currency format to be applied.\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\" :format=\"'i.iii,ddd €'\" />\n</template>\n\n<script>\n import { BaseResultPreviousPrice } from '@empathyco/x-components';\n\n export default {\n name: 'BaseResultPreviousPriceDemo',\n components: {\n BaseResultPreviousPrice\n }\n };\n</script>\n```\n\n### Overriding default slot\n\n```vue\n<template>\n <BaseResultPreviousPrice :result=\"result\">\n <span class=\"custom-base-result-previous-price\">{{ result.price.originalValue }}</span>\n </BaseResultPreviousPrice>\n</template>\n\n<script>\n import { BaseResultPreviousPrice } from '@empathyco/x-components';\n\n export default {\n name: 'BaseResultPreviousPriceDemo',\n components: {\n BaseResultPreviousPrice\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -14,7 +14,7 @@ __decorate([
14
14
  Prop({ required: true })
15
15
  ], BaseResultPreviousPrice.prototype, "result", void 0);
16
16
  __decorate([
17
- Prop({ default: 'i.iii,dd' })
17
+ Prop()
18
18
  ], BaseResultPreviousPrice.prototype, "format", void 0);
19
19
  BaseResultPreviousPrice = __decorate([
20
20
  Component({
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-previous-price.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-previous-price.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Result } from '@empathyco/x-types';\nimport { Component, Prop } from 'vue-property-decorator';\nimport Vue from 'vue';\nimport BaseCurrency from '../currency/base-currency.vue';\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result | result} previous price.\n *\n * @public\n */\n@Component({\n components: { BaseCurrency }\n})\nexport default class BaseResultPreviousPrice 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({ default: 'i.iii,dd' })\n protected format!: string;\n}\n"],"names":["BaseCurrency"],"mappings":";;;;;AAsBA;;;;;AAQA,IAAqB,uBAAuB,GAA5C,MAAqB,uBAAwB,SAAQ,GAAG;CA4BvD,CAAA;AArBC;IADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;uDACC;AAoB1B;IADC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;uDACJ;AA3BP,uBAAuB;IAH3C,SAAS,CAAC;QACT,UAAU,EAAE,gBAAEA,iBAAY,EAAE;KAC7B,CAAC;GACmB,uBAAuB,CA4B3C;aA5BoB,uBAAuB;;;;"}
1
+ {"version":3,"file":"base-result-previous-price.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../src/components/result/base-result-previous-price.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Result } from '@empathyco/x-types';\nimport { Component, Prop } from 'vue-property-decorator';\nimport Vue from 'vue';\nimport BaseCurrency from '../currency/base-currency.vue';\n\n/**\n * Component that renders the {@link @empathyco/x-types#Result | result} previous price.\n *\n * @public\n */\n@Component({\n components: { BaseCurrency }\n})\nexport default class BaseResultPreviousPrice 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 *\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"],"names":["BaseCurrency"],"mappings":";;;;;AAsBA;;;;;AAQA,IAAqB,uBAAuB,GAA5C,MAAqB,uBAAwB,SAAQ,GAAG;CA2BvD,CAAA;AApBC;IADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;uDACC;AAmB1B;IADC,IAAI,EAAE;uDACmB;AA1BP,uBAAuB;IAH3C,SAAS,CAAC;QACT,UAAU,EAAE,gBAAEA,iBAAY,EAAE;KAC7B,CAAC;GACmB,uBAAuB,CA2B3C;aA3BoB,uBAAuB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "3.0.0-alpha.73",
3
+ "version": "3.0.0-alpha.74",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -127,5 +127,5 @@
127
127
  "access": "public",
128
128
  "directory": "dist"
129
129
  },
130
- "gitHead": "8cbf15643ea6eddeadd6c2e150b57bb26f4c7f08"
130
+ "gitHead": "027caee1e9eede9df9a213bc567c7b5e213391d0"
131
131
  }
@@ -5638,11 +5638,11 @@
5638
5638
  {
5639
5639
  "kind": "Property",
5640
5640
  "canonicalReference": "@empathyco/x-components!BaseResultPreviousPrice#format:member",
5641
- "docComment": "/**\n * 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'.\n *\n * @remarks\n *\n * The number of 'd', which is the maximum decimal length, MUST match with the length of decimals provided from the adapter. Otherwise, when the component truncate the decimal part, delete significant digits.\n *\n * @public\n */\n",
5641
+ "docComment": "/**\n * 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.\n *\n * @remarks\n *\n * The number of 'd', which is the maximum decimal length, MUST match with the length of decimals provided from the adapter. Otherwise, when the component truncate the decimal part, delete significant digits.\n *\n * @public\n */\n",
5642
5642
  "excerptTokens": [
5643
5643
  {
5644
5644
  "kind": "Content",
5645
- "text": "protected format: "
5645
+ "text": "protected format?: "
5646
5646
  },
5647
5647
  {
5648
5648
  "kind": "Content",
@@ -5653,7 +5653,7 @@
5653
5653
  "text": ";"
5654
5654
  }
5655
5655
  ],
5656
- "isOptional": false,
5656
+ "isOptional": true,
5657
5657
  "releaseTag": "Public",
5658
5658
  "name": "format",
5659
5659
  "propertyTypeTokenRange": {
@@ -544,7 +544,7 @@ export class BaseResultLink extends Vue_2 {
544
544
 
545
545
  // @public
546
546
  export class BaseResultPreviousPrice extends Vue_2 {
547
- protected format: string;
547
+ protected format?: string;
548
548
  protected result: Result;
549
549
  }
550
550
 
@@ -1 +1 @@
1
- {"version":3,"file":"base-currency.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/base-currency.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAKA,OAAO,GAAG,MAAM,KAAK,CAAC;AAKtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,GAAG;IAC3C;;;;;;;OAOG;IAEH,SAAS,CAAC,KAAK,EAAG,MAAM,CAAC;IAEzB;;;;OAIG;IAEH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IAEI,cAAc,EAAG,MAAM,CAAC;IAE/B;;;;;;OAMG;IACH,SAAS,KAAK,cAAc,IAAI,MAAM,CAQrC;IAED;;;;;;OAMG;IACH,SAAS,KAAK,QAAQ,IAAI,MAAM,CAE/B;CACF"}
1
+ {"version":3,"file":"base-currency.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/base-currency.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAKA,OAAO,GAAG,MAAM,KAAK,CAAC;AAKtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,GAAG;IAC3C;;;;;;;OAOG;IAEH,SAAS,CAAC,KAAK,EAAG,MAAM,CAAC;IAEzB;;;;OAIG;IAEH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IAEI,cAAc,EAAG,MAAM,CAAC;IAE/B;;;;;;OAMG;IACH,SAAS,KAAK,cAAc,IAAI,MAAM,CAErC;IAED;;;;;;OAMG;IACH,SAAS,KAAK,QAAQ,IAAI,MAAM,CAE/B;CACF"}
@@ -21,7 +21,6 @@ export default class BaseResultPreviousPrice extends Vue {
21
21
  * - Decimal separator must be defined between the last 'i' and the first 'd'. It can be more
22
22
  * than one character.
23
23
  * - Set whatever you need around the integers and decimals marks.
24
- * - Default mask: 'i.iii,dd' which returns '1.345,67'.
25
24
  *
26
25
  * @remarks The number of 'd', which is the maximum decimal length, MUST match with the length
27
26
  * of decimals provided from the adapter. Otherwise, when the component truncate the decimal
@@ -29,6 +28,6 @@ export default class BaseResultPreviousPrice extends Vue {
29
28
  *
30
29
  * @public
31
30
  */
32
- protected format: string;
31
+ protected format?: string;
33
32
  }
34
33
  //# sourceMappingURL=base-result-previous-price.vue?rollup-plugin-vue=script.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-previous-price.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../src/components/result/base-result-previous-price.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,GAAG,MAAM,KAAK,CAAC;AAGtB;;;;GAIG;AAIH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,GAAG;IACtD;;;;OAIG;IAEH,SAAS,CAAC,MAAM,EAAG,MAAM,CAAC;IAE1B;;;;;;;;;;;;;;;;OAgBG;IAEH,SAAS,CAAC,MAAM,EAAG,MAAM,CAAC;CAC3B"}
1
+ {"version":3,"file":"base-result-previous-price.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../src/components/result/base-result-previous-price.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,GAAG,MAAM,KAAK,CAAC;AAGtB;;;;GAIG;AAIH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,GAAG;IACtD;;;;OAIG;IAEH,SAAS,CAAC,MAAM,EAAG,MAAM,CAAC;IAE1B;;;;;;;;;;;;;;;OAeG;IAEH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC3B"}