@farm-investimentos/front-mfe-components 13.0.2 → 13.0.4
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 +239 -170
- 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 +239 -170
- 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 +5 -3
- package/src/components/AlertBox/AlertBox.vue +11 -3
- package/src/components/Logger/Logger.scss +1 -1
- package/src/components/Logger/Logger.stories.js +1 -1
- package/src/components/Select/Select.stories.js +28 -2
- package/src/components/Select/Select.vue +36 -1
- package/src/components/TextFieldV2/TextFieldV2.scss +10 -7
- package/src/components/TextFieldV2/TextFieldV2.stories.js +14 -0
- package/src/components/TextFieldV2/TextFieldV2.vue +12 -0
- package/src/components/Typography/Typography.vue +12 -1
- package/src/components/Typography/__tests__/Typography.spec.js +1 -1
- package/src/configurations/typographyHtmlTags.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.4",
|
|
4
4
|
"author": "farm investimentos",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/front-mfe-components.common.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"storybook": "start-storybook -p 6006",
|
|
15
15
|
"build-storybook": "build-storybook",
|
|
16
16
|
"test:unit": "jest --updateSnapshot",
|
|
17
|
-
"test:coverage": "jest --updateSnapshot --coverage"
|
|
17
|
+
"test:coverage": "jest --updateSnapshot --coverage",
|
|
18
|
+
"prepare": "husky install"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
21
|
"dist/*",
|
|
@@ -52,7 +53,8 @@
|
|
|
52
53
|
"text-mask-addons": "^3.8.0",
|
|
53
54
|
"typescript": "~4.1.5",
|
|
54
55
|
"v-mask": "2.3.0",
|
|
55
|
-
"vue-template-compiler": "2.7.10"
|
|
56
|
+
"vue-template-compiler": "2.7.10",
|
|
57
|
+
"husky": "^8.0.0"
|
|
56
58
|
},
|
|
57
59
|
"browserslist": [
|
|
58
60
|
"> 1%",
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
variation="darken"
|
|
12
12
|
size="md"
|
|
13
13
|
:color="color"
|
|
14
|
-
>{{ icon }}</farm-icon
|
|
15
14
|
>
|
|
15
|
+
{{ icon }}
|
|
16
|
+
</farm-icon>
|
|
16
17
|
<div
|
|
17
18
|
:class="{
|
|
18
19
|
'farm-alert-box__content': true,
|
|
@@ -22,9 +23,11 @@
|
|
|
22
23
|
<farm-bodytext
|
|
23
24
|
variation="regular"
|
|
24
25
|
color-variation="darken"
|
|
26
|
+
:tag="tag"
|
|
25
27
|
:type="1"
|
|
26
28
|
:color="color"
|
|
27
29
|
>
|
|
30
|
+
<!-- @slot default -->
|
|
28
31
|
<slot></slot>
|
|
29
32
|
</farm-bodytext>
|
|
30
33
|
</div>
|
|
@@ -92,6 +95,13 @@ export default Vue.extend({
|
|
|
92
95
|
type: Boolean,
|
|
93
96
|
default: true,
|
|
94
97
|
},
|
|
98
|
+
/**
|
|
99
|
+
* Html tag (will be forwarded to farm-typography)
|
|
100
|
+
*/
|
|
101
|
+
tag: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: 'p',
|
|
104
|
+
},
|
|
95
105
|
},
|
|
96
106
|
setup(props, { emit }) {
|
|
97
107
|
const visible = ref(true);
|
|
@@ -109,8 +119,6 @@ export default Vue.extend({
|
|
|
109
119
|
};
|
|
110
120
|
},
|
|
111
121
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
122
|
</script>
|
|
115
123
|
<style lang="scss" scoped>
|
|
116
124
|
@import './AlertBox';
|
|
@@ -2,7 +2,7 @@ import { withDesign } from 'storybook-addon-designs';
|
|
|
2
2
|
import Select from './Select.vue';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title: 'Form/
|
|
5
|
+
title: 'Form/Select',
|
|
6
6
|
component: Select,
|
|
7
7
|
decorators: [withDesign],
|
|
8
8
|
parameters: {
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
description: {
|
|
11
11
|
component: `Select<br />
|
|
12
12
|
selector: <em>farm-select</em><br />
|
|
13
|
-
<span style="color: var(--farm-
|
|
13
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
14
14
|
`,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
@@ -250,3 +250,29 @@ export const MultipleInitValue = () => ({
|
|
|
250
250
|
</farm-btn>
|
|
251
251
|
</div>`,
|
|
252
252
|
});
|
|
253
|
+
|
|
254
|
+
export const ChangeEvennt = () => ({
|
|
255
|
+
data() {
|
|
256
|
+
return {
|
|
257
|
+
v: null,
|
|
258
|
+
items: [
|
|
259
|
+
{ value: 0, text: 'value 0' },
|
|
260
|
+
{ value: 1, text: 'value 1' },
|
|
261
|
+
{ value: 2, text: 'value 2' },
|
|
262
|
+
{ value: 3, text: 'value 3' },
|
|
263
|
+
],
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
methods: {
|
|
267
|
+
onChange(value) {
|
|
268
|
+
alert('Selected value: ' + value);
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
template: `<div style="width: 120px;">
|
|
272
|
+
<farm-label for="select_id">
|
|
273
|
+
label
|
|
274
|
+
</farm-label>
|
|
275
|
+
<farm-select id="select_id" v-model="v" :items="items" @change="onChange" />
|
|
276
|
+
|
|
277
|
+
</div>`,
|
|
278
|
+
});
|
|
@@ -160,6 +160,42 @@ export default Vue.extend({
|
|
|
160
160
|
type: String,
|
|
161
161
|
default: '',
|
|
162
162
|
},
|
|
163
|
+
/**
|
|
164
|
+
* The updated bound model<br />
|
|
165
|
+
* _event_
|
|
166
|
+
*/
|
|
167
|
+
input: {
|
|
168
|
+
type: Function,
|
|
169
|
+
// eslint-disable-next-line
|
|
170
|
+
default: (value: [String, Number, Array<any>]) => {},
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* Emitted when the select is changed by user interaction<br />
|
|
174
|
+
* _event_
|
|
175
|
+
*/
|
|
176
|
+
change: {
|
|
177
|
+
type: Function,
|
|
178
|
+
// eslint-disable-next-line
|
|
179
|
+
default: (value: [String, Number, Array<any>]) => {},
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* Emitted when any key is pressed<br />
|
|
183
|
+
* _event_
|
|
184
|
+
*/
|
|
185
|
+
keyup: {
|
|
186
|
+
type: Function,
|
|
187
|
+
// eslint-disable-next-line
|
|
188
|
+
default: (event: Event) => {},
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* Emitted when the select is blurred<br />
|
|
192
|
+
* _event_
|
|
193
|
+
*/
|
|
194
|
+
blur: {
|
|
195
|
+
type: Function,
|
|
196
|
+
// eslint-disable-next-line
|
|
197
|
+
default: (event: Event) => {},
|
|
198
|
+
},
|
|
163
199
|
},
|
|
164
200
|
setup(props, { emit }) {
|
|
165
201
|
const { rules, items, itemText, itemValue, disabled, multiple } = toRefs(props);
|
|
@@ -193,7 +229,6 @@ export default Vue.extend({
|
|
|
193
229
|
validate(newValue);
|
|
194
230
|
updateSelectedTextValue();
|
|
195
231
|
emit('input', newValue);
|
|
196
|
-
emit('change', newValue);
|
|
197
232
|
}
|
|
198
233
|
);
|
|
199
234
|
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
margin-bottom: 4px;
|
|
18
18
|
background-color: white;
|
|
19
19
|
|
|
20
|
-
>button {
|
|
20
|
+
> button {
|
|
21
21
|
display: flex;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
& > input {
|
|
25
25
|
flex: 1;
|
|
26
26
|
outline: none;
|
|
27
27
|
color: var(--farm-text-primary);
|
|
@@ -30,12 +30,11 @@
|
|
|
30
30
|
max-width: 100%;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
&--iconed>input {
|
|
33
|
+
&--iconed > input {
|
|
34
34
|
max-width: calc(100% - 32px);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
width: 100%;
|
|
38
|
-
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
&--disabled {
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
&--input {
|
|
60
59
|
border-color: var(--farm-error-base);
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
& > input {
|
|
63
62
|
color: var(--farm-neutral-darken);
|
|
64
63
|
}
|
|
65
64
|
|
|
@@ -75,7 +74,7 @@
|
|
|
75
74
|
.farm-textfield--input {
|
|
76
75
|
border-color: var(--farm-primary-base);
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
& > input {
|
|
79
78
|
color: var(--farm-neutral-darken);
|
|
80
79
|
}
|
|
81
80
|
|
|
@@ -83,4 +82,8 @@
|
|
|
83
82
|
color: var(--farm-primary-base);
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
|
-
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.farm-textfield--uppercase input {
|
|
88
|
+
text-transform: uppercase;
|
|
89
|
+
}
|
|
@@ -233,3 +233,17 @@ export const ToggleVisibility = () => ({
|
|
|
233
233
|
<farm-textfield-v2 v-model="v" :type="visible ? 'text' : 'password'" :icon="visible ? 'eye-off' : 'eye'" @onClickIcon="toggle" />
|
|
234
234
|
</div>`,
|
|
235
235
|
});
|
|
236
|
+
|
|
237
|
+
export const Uppercase = () => ({
|
|
238
|
+
data() {
|
|
239
|
+
return {
|
|
240
|
+
v: 'value',
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
template: `<div style="width: 480px;">
|
|
244
|
+
<farm-label for="select_label">
|
|
245
|
+
label
|
|
246
|
+
</farm-label>
|
|
247
|
+
<farm-textfield-v2 id="select_label" v-model="v" uppercase/>
|
|
248
|
+
</div>`,
|
|
249
|
+
});
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
'farm-textfield--error': hasError,
|
|
10
10
|
'farm-textfield--disabled': disabled,
|
|
11
11
|
'farm-textfield--hiddendetails': hideDetails,
|
|
12
|
+
'farm-textfield--uppercase': isUppercase,
|
|
12
13
|
}"
|
|
13
14
|
:id="customId"
|
|
14
15
|
>
|
|
@@ -135,12 +136,22 @@ export default Vue.extend({
|
|
|
135
136
|
type: String,
|
|
136
137
|
default: '',
|
|
137
138
|
},
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* uppercase
|
|
142
|
+
* leaves only the text in the input in uppercase does not affect the value of the v-model
|
|
143
|
+
*/
|
|
144
|
+
uppercase: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: false,
|
|
147
|
+
},
|
|
138
148
|
},
|
|
139
149
|
setup(props, { emit }) {
|
|
140
150
|
const { rules } = toRefs(props);
|
|
141
151
|
const innerValue = ref(props.value);
|
|
142
152
|
const isTouched = ref(false);
|
|
143
153
|
const isBlured = ref(false);
|
|
154
|
+
const isUppercase = ref(props.uppercase);
|
|
144
155
|
|
|
145
156
|
const { errorBucket, valid, validatable } = validateFormStateBuilder();
|
|
146
157
|
|
|
@@ -215,6 +226,7 @@ export default Vue.extend({
|
|
|
215
226
|
customId,
|
|
216
227
|
isTouched,
|
|
217
228
|
isBlured,
|
|
229
|
+
isUppercase,
|
|
218
230
|
showErrorText,
|
|
219
231
|
validate,
|
|
220
232
|
onKeyUp,
|
|
@@ -29,7 +29,18 @@ export default Vue.extend({
|
|
|
29
29
|
*/
|
|
30
30
|
tag: {
|
|
31
31
|
type: String as PropType<
|
|
32
|
-
|
|
32
|
+
| 'p'
|
|
33
|
+
| 'span'
|
|
34
|
+
| 'h1'
|
|
35
|
+
| 'h2'
|
|
36
|
+
| 'h3'
|
|
37
|
+
| 'h4'
|
|
38
|
+
| 'h5'
|
|
39
|
+
| 'h6'
|
|
40
|
+
| 'legend'
|
|
41
|
+
| 'label'
|
|
42
|
+
| 'li'
|
|
43
|
+
| 'div'
|
|
33
44
|
>,
|
|
34
45
|
default: 'p',
|
|
35
46
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default ['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend', 'label', 'li'];
|
|
1
|
+
export default ['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend', 'label', 'li', 'div'];
|