@farm-investimentos/front-mfe-components-vue3 0.2.0 → 0.3.1
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/dist/front-mfe-components.common.js +1649 -34
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +1653 -38
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/components/DatePicker/DatePicker.stories.js +12 -0
- package/src/components/DatePicker/DatePicker.vue +6 -1
- package/src/components/DatePicker/customDatePicker.scss +4 -0
- package/src/components/ProgressBar/ProgressBar.scss +21 -1
- package/src/components/ProgressBar/ProgressBar.stories.js +9 -0
- package/src/components/ProgressBar/ProgressBar.vue +18 -4
- package/src/components/TextFieldV2/TextFieldV2.vue +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components-vue3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@vue/eslint-config-typescript": "^7.0.0",
|
|
63
63
|
"@vue/test-utils": "^2.3.2",
|
|
64
64
|
"@vue/tsconfig": "^0.4.0",
|
|
65
|
-
"@vue/vue3-jest": "
|
|
65
|
+
"@vue/vue3-jest": "29.2.6",
|
|
66
66
|
"babel-eslint": "^10.1.0",
|
|
67
67
|
"babel-jest": "^29.5.0",
|
|
68
68
|
"babel-loader": "^8.3.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"eslint": "^6.7.2",
|
|
71
71
|
"eslint-plugin-import": "^2.29.0",
|
|
72
72
|
"eslint-plugin-vue": "^7.1.0",
|
|
73
|
-
"jest": "
|
|
73
|
+
"jest": "29.7.0",
|
|
74
74
|
"jest-environment-jsdom": "^29.0.0",
|
|
75
75
|
"npm-run-all2": "^6.0.6",
|
|
76
76
|
"react": "^18.2.0",
|
|
@@ -131,4 +131,16 @@ export const CenterPositioned = () => ({
|
|
|
131
131
|
<farm-input-datepicker inputId="input-custom-id-0" v-model="date" position="center" />
|
|
132
132
|
{{ date }}
|
|
133
133
|
</div>`,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const RequiredMessage = () => ({
|
|
137
|
+
data() {
|
|
138
|
+
return {
|
|
139
|
+
date: '',
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
template: `<div style='max-width: 320px'>
|
|
143
|
+
<farm-input-datepicker inputId="input-custom-id-10" v-model="date" requiredMessage="Preencha a data de forma correta." :required="true" />
|
|
144
|
+
date: {{ date }}
|
|
145
|
+
</div>`,
|
|
134
146
|
});
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
ref="inputCalendar"
|
|
59
59
|
:readonly="readonly"
|
|
60
60
|
:mask="`${readonly ? '' : '##/##/####'}`"
|
|
61
|
+
:requiredMessage="requiredMessage"
|
|
61
62
|
:id="inputId"
|
|
62
63
|
:rules="[checkDateValid, checkMax, checkMin, checkRequire]"
|
|
63
64
|
@keyup="keyUpInput"
|
|
@@ -136,6 +137,10 @@ export default {
|
|
|
136
137
|
type: Boolean,
|
|
137
138
|
default: false,
|
|
138
139
|
},
|
|
140
|
+
requiredMessage: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: 'Campo obrigatório'
|
|
143
|
+
}
|
|
139
144
|
},
|
|
140
145
|
data() {
|
|
141
146
|
return {
|
|
@@ -150,7 +155,7 @@ export default {
|
|
|
150
155
|
return true;
|
|
151
156
|
},
|
|
152
157
|
checkRequire: value => {
|
|
153
|
-
return this.required ? !!value || value != '' ||
|
|
158
|
+
return this.required ? !!value || value != '' || this.requiredMessage : true;
|
|
154
159
|
},
|
|
155
160
|
checkMax: value => {
|
|
156
161
|
if (!this.required && value.length === 0) {
|
|
@@ -6,8 +6,9 @@ $radius: 5px;
|
|
|
6
6
|
width: 100%;
|
|
7
7
|
height: 5px;
|
|
8
8
|
border-radius: $radius;
|
|
9
|
+
overflow: hidden;
|
|
9
10
|
|
|
10
|
-
>
|
|
11
|
+
>div {
|
|
11
12
|
border-radius: $radius;
|
|
12
13
|
height: 100%;
|
|
13
14
|
}
|
|
@@ -22,4 +23,23 @@ $radius: 5px;
|
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.farm-progressbar--infinite {
|
|
29
|
+
animation: indeterminateAnimation 1s infinite linear;
|
|
30
|
+
transform-origin: 0% 50%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes indeterminateAnimation {
|
|
34
|
+
0% {
|
|
35
|
+
transform: translateX(0) scaleX(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
40% {
|
|
39
|
+
transform: translateX(0) scaleX(0.4);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
100% {
|
|
43
|
+
transform: translateX(100%) scaleX(0.5);
|
|
44
|
+
}
|
|
25
45
|
}
|
|
@@ -47,3 +47,12 @@ export const CustomHexaColors = () => ({
|
|
|
47
47
|
},
|
|
48
48
|
template: '<farm-progressbar :value="val" background-color="#FFFF00" value-color="#00FF00" />',
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
export const IndeterminateAnimation = () => ({
|
|
52
|
+
data() {
|
|
53
|
+
return {
|
|
54
|
+
val: 35,
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
template: '<farm-progressbar indeterminate :value="val" background-color="#FFFF00" value-color="#00FF00" />',
|
|
58
|
+
});
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
:class="classes"
|
|
4
|
+
:style="containerStyle"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
:class="{ 'farm-progressbar--infinite': indeterminate }"
|
|
8
|
+
:style="valueStyle"
|
|
9
|
+
></div>
|
|
4
10
|
</div>
|
|
5
11
|
</template>
|
|
6
12
|
|
|
@@ -57,10 +63,17 @@ export default {
|
|
|
57
63
|
type: Number,
|
|
58
64
|
required: true,
|
|
59
65
|
},
|
|
66
|
+
/**
|
|
67
|
+
* Indeterminate
|
|
68
|
+
*/
|
|
69
|
+
indeterminate: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false,
|
|
72
|
+
},
|
|
60
73
|
},
|
|
61
74
|
|
|
62
75
|
setup(props) {
|
|
63
|
-
const { backgroundColor, valueColor, value } = toRefs(props);
|
|
76
|
+
const { backgroundColor, valueColor, value, indeterminate } = toRefs(props);
|
|
64
77
|
|
|
65
78
|
const classes = computed(() => {
|
|
66
79
|
const obj = {};
|
|
@@ -80,8 +93,9 @@ export default {
|
|
|
80
93
|
|
|
81
94
|
const valueStyle = computed(() => {
|
|
82
95
|
const obj = {
|
|
83
|
-
width: `${value.value}%`,
|
|
96
|
+
width: indeterminate.value ? '100%' : `${value.value}%`,
|
|
84
97
|
};
|
|
98
|
+
|
|
85
99
|
if (valueColor.value.startsWith('#')) {
|
|
86
100
|
obj['background-color'] = valueColor.value;
|
|
87
101
|
}
|