@weni/unnnic-system 2.0.18 → 2.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -253,7 +253,7 @@ export default {
253
253
  type: Array,
254
254
  default: () => [],
255
255
  validator(months) {
256
- return months.length === 12;
256
+ return [0, 12].includes(months.length);
257
257
  },
258
258
  },
259
259
 
@@ -261,7 +261,7 @@ export default {
261
261
  type: Array,
262
262
  default: () => [],
263
263
  validator(days) {
264
- return days.length === 7;
264
+ return [0, 7].includes(days.length);
265
265
  },
266
266
  },
267
267
 
@@ -307,17 +307,21 @@ export default {
307
307
  };
308
308
  },
309
309
 
310
+ i18nLocale() {
311
+ return this.$i18n.locale.toLowerCase();
312
+ },
313
+
310
314
  monthsLocale() {
311
315
  const { months } = this;
312
- return months.length ? months : translationMonths[this.$i18n.locale];
316
+ return months.length ? months : translationMonths[this.i18nLocale];
313
317
  },
314
318
  daysLocale() {
315
319
  const { days } = this;
316
- return days.length ? days : translationDays[this.$i18n.locale];
320
+ return days.length ? days : translationDays[this.i18nLocale];
317
321
  },
318
322
  periodsLocale() {
319
323
  const { options } = this;
320
- return options.length ? options : translationPeriods[this.$i18n.locale];
324
+ return options.length ? options : translationPeriods[this.i18nLocale];
321
325
  },
322
326
 
323
327
  clearText() {
@@ -1,3 +1,29 @@
1
+ const englishMonths = [
2
+ 'January',
3
+ 'February',
4
+ 'March',
5
+ 'April',
6
+ 'May',
7
+ 'June',
8
+ 'July',
9
+ 'August',
10
+ 'September',
11
+ 'October',
12
+ 'November',
13
+ 'December',
14
+ ];
15
+
16
+ const englishDays = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
17
+
18
+ const englishPeriods = [
19
+ { name: 'Last 7 days', id: 'last-7-days' },
20
+ { name: 'Last 14 days', id: 'last-14-days' },
21
+ { name: 'Last 30 days', id: 'last-30-days' },
22
+ { name: 'Last 12 months', id: 'last-12-months' },
23
+ { name: 'Current month', id: 'current-month' },
24
+ { name: 'Custom', id: 'custom' },
25
+ ];
26
+
1
27
  export const months = {
2
28
  'pt-br': [
3
29
  'Janeiro',
@@ -13,20 +39,8 @@ export const months = {
13
39
  'Novembro',
14
40
  'Dezembro',
15
41
  ],
16
- en: [
17
- 'January',
18
- 'February',
19
- 'March',
20
- 'April',
21
- 'May',
22
- 'June',
23
- 'July',
24
- 'August',
25
- 'September',
26
- 'October',
27
- 'November',
28
- 'December',
29
- ],
42
+ en: englishMonths,
43
+ 'en-us': englishMonths,
30
44
  es: [
31
45
  'Enero',
32
46
  'Febrero',
@@ -45,7 +59,8 @@ export const months = {
45
59
 
46
60
  export const days = {
47
61
  'pt-br': ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
48
- en: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
62
+ en: englishDays,
63
+ 'en-us': englishDays,
49
64
  es: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
50
65
  };
51
66
 
@@ -76,32 +91,8 @@ export const periods = {
76
91
  id: 'custom',
77
92
  },
78
93
  ],
79
- en: [
80
- {
81
- name: 'Last 7 days',
82
- id: 'last-7-days',
83
- },
84
- {
85
- name: 'Last 14 days',
86
- id: 'last-14-days',
87
- },
88
- {
89
- name: 'Last 30 days',
90
- id: 'last-30-days',
91
- },
92
- {
93
- name: 'Last 12 months',
94
- id: 'last-12-months',
95
- },
96
- {
97
- name: 'Current month',
98
- id: 'current-month',
99
- },
100
- {
101
- name: 'Custom',
102
- id: 'custom',
103
- },
104
- ],
94
+ en: englishPeriods,
95
+ 'en-us': englishPeriods,
105
96
  es: [
106
97
  {
107
98
  name: 'Últimos 7 días',