@farm-investimentos/front-mfe-components 13.1.1 → 14.0.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 +8500 -8673
- 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 +8500 -8673
- 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 +1 -1
- package/src/components/Select/Select.scss +7 -0
- package/src/components/Select/Select.stories.js +34 -0
- package/src/components/Select/Select.vue +30 -1
- package/src/components/TextArea/TextArea.scss +10 -5
- package/src/components/TextArea/TextArea.stories.js +12 -1
- package/src/components/TextArea/TextArea.vue +25 -1
- package/src/components/TextFieldV2/TextFieldV2.scss +6 -0
- package/src/components/TextFieldV2/TextFieldV2.stories.js +11 -0
- package/src/components/TextFieldV2/TextFieldV2.vue +20 -0
- package/src/components/Tooltip/Tooltip.stories.js +2 -2
- package/src/components/layout/Col/Col.scss +42 -2
- package/src/components/layout/Col/Col.stories.js +30 -23
- package/src/components/layout/Col/Col.vue +50 -0
- package/src/components/layout/ContainerFooter/Container.stories.js +5 -0
- package/src/components/layout/ContainerFooter/ContainerFooter.scss +10 -6
- package/src/components/layout/ContainerFooter/ContainerFooter.vue +12 -1
- package/src/configurations/_mixins.scss +68 -57
- package/src/main.ts +0 -2
- package/src/components/DefaultTextField/DefaultTextField.stories.js +0 -87
- package/src/components/DefaultTextField/DefaultTextField.vue +0 -111
- package/src/components/DefaultTextField/__tests__/DefaultTextField.spec.js +0 -54
- package/src/components/DefaultTextField/index.ts +0 -3
- package/src/examples/Form/Full.stories.js +0 -58
package/package.json
CHANGED
|
@@ -78,6 +78,40 @@ export const Readonly = () => ({
|
|
|
78
78
|
</div>`,
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
+
export const HintText = () => ({
|
|
82
|
+
data() {
|
|
83
|
+
return {
|
|
84
|
+
v: 1,
|
|
85
|
+
items: [
|
|
86
|
+
{ value: 1, text: ' value 1' },
|
|
87
|
+
{ value: 2, text: ' value 2' },
|
|
88
|
+
{ value: 3, text: ' value 3' },
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
template: `<div style="width: 480px">
|
|
93
|
+
<farm-select v-model="v" :items="items" hint="Hint Text" :persistent-hint="false" />
|
|
94
|
+
v-model: {{ v }}
|
|
95
|
+
</div>`,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export const PersistentHintText = () => ({
|
|
99
|
+
data() {
|
|
100
|
+
return {
|
|
101
|
+
v: 1,
|
|
102
|
+
items: [
|
|
103
|
+
{ value: 1, text: ' value 1' },
|
|
104
|
+
{ value: 2, text: ' value 2' },
|
|
105
|
+
{ value: 3, text: ' value 3' },
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
template: `<div style="width: 480px">
|
|
110
|
+
<farm-select v-model="v" :items="items" hint="Hint Text" />
|
|
111
|
+
v-model: {{ v }}
|
|
112
|
+
</div>`,
|
|
113
|
+
});
|
|
114
|
+
|
|
81
115
|
export const Disabled = () => ({
|
|
82
116
|
data() {
|
|
83
117
|
return {
|
|
@@ -49,9 +49,12 @@
|
|
|
49
49
|
v-bind="$attrs"
|
|
50
50
|
:id="$props.id"
|
|
51
51
|
v-model="selectedText"
|
|
52
|
+
ref="inputField"
|
|
52
53
|
@click="clickInput"
|
|
53
54
|
@keyup="onKeyUp"
|
|
54
55
|
@blur="onBlur"
|
|
56
|
+
@focusin="onFocus(true)"
|
|
57
|
+
@focusout="onFocus(false)"
|
|
55
58
|
/>
|
|
56
59
|
<farm-icon color="gray" :class="{ 'farm-icon--rotate': isVisible }">
|
|
57
60
|
menu-down
|
|
@@ -62,7 +65,15 @@
|
|
|
62
65
|
<farm-caption v-if="showErrorText" color="error" variation="regular">
|
|
63
66
|
{{ errorBucket[0] }}
|
|
64
67
|
</farm-caption>
|
|
65
|
-
<farm-caption
|
|
68
|
+
<farm-caption
|
|
69
|
+
v-if="hint && !showErrorText"
|
|
70
|
+
class="farm-select__hint-text"
|
|
71
|
+
:class="{
|
|
72
|
+
'farm-select__hint-text--show': persistentHint || isFocus,
|
|
73
|
+
}"
|
|
74
|
+
color="gray"
|
|
75
|
+
variation="regular"
|
|
76
|
+
>
|
|
66
77
|
{{ hint }}
|
|
67
78
|
</farm-caption>
|
|
68
79
|
</div>
|
|
@@ -89,6 +100,13 @@ export default Vue.extend({
|
|
|
89
100
|
type: String,
|
|
90
101
|
default: null,
|
|
91
102
|
},
|
|
103
|
+
/**
|
|
104
|
+
* Always show hint text
|
|
105
|
+
*/
|
|
106
|
+
persistentHint: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: true,
|
|
109
|
+
},
|
|
92
110
|
/**
|
|
93
111
|
* Disabled the input
|
|
94
112
|
*/
|
|
@@ -201,12 +219,14 @@ export default Vue.extend({
|
|
|
201
219
|
const { rules, items, itemText, itemValue, disabled, multiple } = toRefs(props);
|
|
202
220
|
const innerValue = ref(props.value);
|
|
203
221
|
const isTouched = ref(false);
|
|
222
|
+
const isFocus = ref(false);
|
|
204
223
|
const isBlured = ref(false);
|
|
205
224
|
const isVisible = ref(false);
|
|
206
225
|
const selectedText = ref('');
|
|
207
226
|
const multipleValues = ref(Array.isArray(props.value) ? [...props.value] : []);
|
|
208
227
|
const checked = ref('1');
|
|
209
228
|
const notChecked = ref(false);
|
|
229
|
+
const inputField = ref();
|
|
210
230
|
|
|
211
231
|
const { errorBucket, valid, validatable } = validateFormStateBuilder();
|
|
212
232
|
|
|
@@ -290,7 +310,12 @@ export default Vue.extend({
|
|
|
290
310
|
emit('blur', event);
|
|
291
311
|
};
|
|
292
312
|
|
|
313
|
+
const onFocus = (focus: boolean) => {
|
|
314
|
+
isFocus.value = focus;
|
|
315
|
+
};
|
|
316
|
+
|
|
293
317
|
const selectItem = item => {
|
|
318
|
+
inputField.value.focus();
|
|
294
319
|
if (multiple.value) {
|
|
295
320
|
const alreadyAdded = multipleValues.value.findIndex(
|
|
296
321
|
val => val === item[itemValue.value]
|
|
@@ -308,6 +333,7 @@ export default Vue.extend({
|
|
|
308
333
|
|
|
309
334
|
innerValue.value = item[itemValue.value];
|
|
310
335
|
isVisible.value = false;
|
|
336
|
+
|
|
311
337
|
setTimeout(() => {
|
|
312
338
|
emit('change', innerValue.value);
|
|
313
339
|
}, 100);
|
|
@@ -380,6 +406,7 @@ export default Vue.extend({
|
|
|
380
406
|
hasError,
|
|
381
407
|
isTouched,
|
|
382
408
|
isBlured,
|
|
409
|
+
isFocus,
|
|
383
410
|
isVisible,
|
|
384
411
|
customId,
|
|
385
412
|
showErrorText,
|
|
@@ -388,6 +415,7 @@ export default Vue.extend({
|
|
|
388
415
|
selectItem,
|
|
389
416
|
onKeyUp,
|
|
390
417
|
onBlur,
|
|
418
|
+
onFocus,
|
|
391
419
|
clickInput,
|
|
392
420
|
updateSelectedTextValue,
|
|
393
421
|
makePristine,
|
|
@@ -396,6 +424,7 @@ export default Vue.extend({
|
|
|
396
424
|
isChecked,
|
|
397
425
|
multipleValues,
|
|
398
426
|
addLabelToMultiple,
|
|
427
|
+
inputField,
|
|
399
428
|
};
|
|
400
429
|
},
|
|
401
430
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../../configurations/mixins';
|
|
2
|
+
|
|
1
3
|
.farm-textarea {
|
|
2
4
|
min-height: 64px;
|
|
3
5
|
|
|
@@ -18,8 +20,7 @@
|
|
|
18
20
|
background-color: white;
|
|
19
21
|
width: 100%;
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
&>textarea {
|
|
23
|
+
& > textarea {
|
|
23
24
|
flex: 1;
|
|
24
25
|
outline: none;
|
|
25
26
|
color: var(--farm-text-primary);
|
|
@@ -39,6 +40,10 @@
|
|
|
39
40
|
.farm-caption {
|
|
40
41
|
line-height: 12px;
|
|
41
42
|
}
|
|
43
|
+
|
|
44
|
+
&__hint-text {
|
|
45
|
+
@include hintText;
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
.farm-textarea--touched.farm-textarea--validatable {
|
|
@@ -47,7 +52,7 @@
|
|
|
47
52
|
&--textarea {
|
|
48
53
|
border-color: var(--farm-error-base);
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
& > textarea {
|
|
51
56
|
color: var(--farm-neutral-darken);
|
|
52
57
|
}
|
|
53
58
|
}
|
|
@@ -59,8 +64,8 @@
|
|
|
59
64
|
.farm-textarea--textarea {
|
|
60
65
|
border-color: var(--farm-primary-base);
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
& > textarea {
|
|
63
68
|
color: var(--farm-neutral-darken);
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
|
-
}
|
|
71
|
+
}
|
|
@@ -107,6 +107,17 @@ export const HintText = () => ({
|
|
|
107
107
|
</div>`,
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
export const PersistentHintText = () => ({
|
|
111
|
+
data() {
|
|
112
|
+
return {
|
|
113
|
+
v: 'input text',
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
template: `<div style="width: 480px; display: flex;">
|
|
117
|
+
<farm-textarea v-model="v" hint="Hint text" persistent-hint />
|
|
118
|
+
</div>`,
|
|
119
|
+
});
|
|
120
|
+
|
|
110
121
|
export const Reset = () => ({
|
|
111
122
|
data() {
|
|
112
123
|
return {
|
|
@@ -133,4 +144,4 @@ export const Reset = () => ({
|
|
|
133
144
|
<farm-btn @click="reset">reset</farm-btn>
|
|
134
145
|
|
|
135
146
|
</div>`,
|
|
136
|
-
});
|
|
147
|
+
});
|
|
@@ -26,12 +26,22 @@
|
|
|
26
26
|
@click="$emit('click')"
|
|
27
27
|
@keyup="onKeyUp"
|
|
28
28
|
@blur="onBlur"
|
|
29
|
+
@focusin="onFocus(true)"
|
|
30
|
+
@focusout="onFocus(false)"
|
|
29
31
|
/>
|
|
30
32
|
</div>
|
|
31
33
|
<farm-caption v-if="showErrorText" color="error" variation="regular">
|
|
32
34
|
{{ errorBucket[0] }}
|
|
33
35
|
</farm-caption>
|
|
34
|
-
<farm-caption
|
|
36
|
+
<farm-caption
|
|
37
|
+
v-if="hint && !showErrorText"
|
|
38
|
+
class="farm-textarea__hint-text"
|
|
39
|
+
:class="{
|
|
40
|
+
'farm-textarea__hint-text--show': persistentHint || isFocus,
|
|
41
|
+
}"
|
|
42
|
+
color="gray"
|
|
43
|
+
variation="regular"
|
|
44
|
+
>
|
|
35
45
|
{{ hint }}
|
|
36
46
|
</farm-caption>
|
|
37
47
|
</div>
|
|
@@ -60,6 +70,13 @@ export default Vue.extend({
|
|
|
60
70
|
type: String,
|
|
61
71
|
default: null,
|
|
62
72
|
},
|
|
73
|
+
/**
|
|
74
|
+
* Always show hint text
|
|
75
|
+
*/
|
|
76
|
+
persistentHint: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false,
|
|
79
|
+
},
|
|
63
80
|
/**
|
|
64
81
|
* Disabled the input
|
|
65
82
|
*/
|
|
@@ -109,6 +126,7 @@ export default Vue.extend({
|
|
|
109
126
|
const { rules } = toRefs(props);
|
|
110
127
|
const innerValue = ref(props.value);
|
|
111
128
|
const isTouched = ref(false);
|
|
129
|
+
const isFocus = ref(false);
|
|
112
130
|
const isBlured = ref(false);
|
|
113
131
|
|
|
114
132
|
const { errorBucket, valid, validatable } = validateFormStateBuilder();
|
|
@@ -164,6 +182,10 @@ export default Vue.extend({
|
|
|
164
182
|
emit('blur', event);
|
|
165
183
|
};
|
|
166
184
|
|
|
185
|
+
const onFocus = (focus: boolean) => {
|
|
186
|
+
isFocus.value = focus;
|
|
187
|
+
};
|
|
188
|
+
|
|
167
189
|
const reset = () => {
|
|
168
190
|
innerValue.value = '';
|
|
169
191
|
isTouched.value = true;
|
|
@@ -184,10 +206,12 @@ export default Vue.extend({
|
|
|
184
206
|
customId,
|
|
185
207
|
isTouched,
|
|
186
208
|
isBlured,
|
|
209
|
+
isFocus,
|
|
187
210
|
showErrorText,
|
|
188
211
|
validate,
|
|
189
212
|
onKeyUp,
|
|
190
213
|
onBlur,
|
|
214
|
+
onFocus,
|
|
191
215
|
reset,
|
|
192
216
|
makePristine,
|
|
193
217
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../../configurations/mixins';
|
|
2
|
+
|
|
1
3
|
.farm-textfield {
|
|
2
4
|
height: 64px;
|
|
3
5
|
|
|
@@ -50,6 +52,10 @@
|
|
|
50
52
|
.farm-caption {
|
|
51
53
|
line-height: 12px;
|
|
52
54
|
}
|
|
55
|
+
|
|
56
|
+
&__hint-text {
|
|
57
|
+
@include hintText;
|
|
58
|
+
}
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
.farm-textfield--touched.farm-textfield--validatable {
|
|
@@ -133,6 +133,17 @@ export const HintText = () => ({
|
|
|
133
133
|
</div>`,
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
+
export const PersistentHintText = () => ({
|
|
137
|
+
data() {
|
|
138
|
+
return {
|
|
139
|
+
v: 'input text',
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
template: `<div style="width: 480px; display: flex;">
|
|
143
|
+
<farm-textfield-v2 v-model="v" hint="Hint text" persistent-hint />
|
|
144
|
+
</div>`,
|
|
145
|
+
});
|
|
146
|
+
|
|
136
147
|
export const UpdateValue = () => ({
|
|
137
148
|
data() {
|
|
138
149
|
return {
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
@click="$emit('click')"
|
|
37
37
|
@keyup="onKeyUp"
|
|
38
38
|
@blur="onBlur"
|
|
39
|
+
@focusin="onFocus(true)"
|
|
40
|
+
@focusout="onFocus(false)"
|
|
39
41
|
/>
|
|
40
42
|
<button
|
|
41
43
|
type="button"
|
|
@@ -50,6 +52,10 @@
|
|
|
50
52
|
</farm-caption>
|
|
51
53
|
<farm-caption
|
|
52
54
|
v-if="!hideDetails && hint && !showErrorText"
|
|
55
|
+
class="farm-textfield__hint-text"
|
|
56
|
+
:class="{
|
|
57
|
+
'farm-textfield__hint-text--show': persistentHint || isFocus,
|
|
58
|
+
}"
|
|
53
59
|
color="gray"
|
|
54
60
|
variation="regular"
|
|
55
61
|
>
|
|
@@ -92,6 +98,13 @@ export default Vue.extend({
|
|
|
92
98
|
type: String,
|
|
93
99
|
default: null,
|
|
94
100
|
},
|
|
101
|
+
/**
|
|
102
|
+
* Always show hint text
|
|
103
|
+
*/
|
|
104
|
+
persistentHint: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false,
|
|
107
|
+
},
|
|
95
108
|
/**
|
|
96
109
|
* Disabled the input
|
|
97
110
|
*/
|
|
@@ -160,6 +173,7 @@ export default Vue.extend({
|
|
|
160
173
|
const innerValue = ref(props.value);
|
|
161
174
|
const isTouched = ref(false);
|
|
162
175
|
const isBlured = ref(false);
|
|
176
|
+
const isFocus = ref(false);
|
|
163
177
|
const isUppercase = ref(props.uppercase);
|
|
164
178
|
|
|
165
179
|
const { errorBucket, valid, validatable } = validateFormStateBuilder();
|
|
@@ -218,6 +232,10 @@ export default Vue.extend({
|
|
|
218
232
|
emit('blur', event);
|
|
219
233
|
};
|
|
220
234
|
|
|
235
|
+
const onFocus = (focus: boolean) => {
|
|
236
|
+
isFocus.value = focus;
|
|
237
|
+
};
|
|
238
|
+
|
|
221
239
|
const reset = () => {
|
|
222
240
|
innerValue.value = '';
|
|
223
241
|
isTouched.value = true;
|
|
@@ -239,10 +257,12 @@ export default Vue.extend({
|
|
|
239
257
|
isTouched,
|
|
240
258
|
isBlured,
|
|
241
259
|
isUppercase,
|
|
260
|
+
isFocus,
|
|
242
261
|
showErrorText,
|
|
243
262
|
validate,
|
|
244
263
|
onKeyUp,
|
|
245
264
|
onBlur,
|
|
265
|
+
onFocus,
|
|
246
266
|
reset,
|
|
247
267
|
makePristine,
|
|
248
268
|
};
|
|
@@ -78,9 +78,9 @@ export const Visibility = () => ({
|
|
|
78
78
|
some <em>sample</em> text<br />
|
|
79
79
|
some <em>sample</em> text<br />
|
|
80
80
|
<template v-slot:activator="{ on, attrs }">
|
|
81
|
-
<
|
|
81
|
+
<farm-btn @click="show = !show">
|
|
82
82
|
toggle me
|
|
83
|
-
</
|
|
83
|
+
</farm-btn>
|
|
84
84
|
</template>
|
|
85
85
|
</farm-tooltip>
|
|
86
86
|
</div>`,
|
|
@@ -24,13 +24,19 @@
|
|
|
24
24
|
flex: 0 0 (100/12 * $i)+#{"%"};
|
|
25
25
|
max-width: (100/12 * $i)+#{"%"};
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
27
|
|
|
29
|
-
@for $i from 1 through 12 {
|
|
30
28
|
.farm-col--xs-#{$i * 1} {
|
|
31
29
|
flex: 0 0 (100/12 * $i)+#{"%"};
|
|
32
30
|
max-width: (100/12 * $i)+#{"%"};
|
|
33
31
|
}
|
|
32
|
+
|
|
33
|
+
.farm-col--offset-#{$i * 1} {
|
|
34
|
+
margin-left: (100/12 * $i)+#{"%"};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.farm-col--offset-0 {
|
|
39
|
+
margin-left: 0%;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
@include fromXs {
|
|
@@ -39,6 +45,14 @@
|
|
|
39
45
|
flex: 0 0 (100/12 * $i)+#{"%"};
|
|
40
46
|
max-width: (100/12 * $i)+#{"%"};
|
|
41
47
|
}
|
|
48
|
+
|
|
49
|
+
.farm-col--offset-sm-#{$i * 1} {
|
|
50
|
+
margin-left: (100/12 * $i)+#{"%"};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.farm-col--offset-sm-0 {
|
|
55
|
+
margin-left: 0%;
|
|
42
56
|
}
|
|
43
57
|
}
|
|
44
58
|
|
|
@@ -48,7 +62,17 @@
|
|
|
48
62
|
flex: 0 0 (100/12 * $i)+#{"%"};
|
|
49
63
|
max-width: (100/12 * $i)+#{"%"};
|
|
50
64
|
}
|
|
65
|
+
|
|
66
|
+
.farm-col--offset-md-#{$i * 1} {
|
|
67
|
+
margin-left: (100/12 * $i)+#{"%"};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.farm-col--offset-md-0 {
|
|
73
|
+
margin-left: 0%;
|
|
51
74
|
}
|
|
75
|
+
|
|
52
76
|
}
|
|
53
77
|
|
|
54
78
|
@include fromMd {
|
|
@@ -57,6 +81,14 @@
|
|
|
57
81
|
flex: 0 0 (100/12 * $i)+#{"%"};
|
|
58
82
|
max-width: (100/12 * $i)+#{"%"};
|
|
59
83
|
}
|
|
84
|
+
|
|
85
|
+
.farm-col--offset-lg-#{$i * 1} {
|
|
86
|
+
margin-left: (100/12 * $i)+#{"%"};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.farm-col--offset-lg-0 {
|
|
91
|
+
margin-left: 0%;
|
|
60
92
|
}
|
|
61
93
|
}
|
|
62
94
|
|
|
@@ -66,5 +98,13 @@
|
|
|
66
98
|
flex: 0 0 (100/12 * $i)+#{"%"};
|
|
67
99
|
max-width: (100/12 * $i)+#{"%"};
|
|
68
100
|
}
|
|
101
|
+
|
|
102
|
+
.farm-col--offset-xl-#{$i * 1} {
|
|
103
|
+
margin-left: (100/12 * $i)+#{"%"};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.farm-col--offset-xl-0 {
|
|
108
|
+
margin-left: 0%;
|
|
69
109
|
}
|
|
70
110
|
}
|
|
@@ -121,29 +121,6 @@ export const TagP = () => ({
|
|
|
121
121
|
template: '<farm-col tag="p">col</farm-col>',
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
export const CompareToVCol = () => ({
|
|
125
|
-
data() {
|
|
126
|
-
return {
|
|
127
|
-
style,
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
template: `<div>
|
|
131
|
-
|
|
132
|
-
<h4>LG 3</h4>
|
|
133
|
-
<farm-col lg="3" :style="style">farm</farm-col>
|
|
134
|
-
<v-col lg="3" :style="style">v-col</v-col>
|
|
135
|
-
|
|
136
|
-
<h4>MD 3</h4>
|
|
137
|
-
<farm-col md="3" :style="style">farm</farm-col>
|
|
138
|
-
<v-col md="3" :style="style">v-col</v-col>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<h4>SM 3</h4>
|
|
142
|
-
<farm-col sm="3" :style="style">farm</farm-col>
|
|
143
|
-
<v-col sm="3" :style="style">v-col</v-col>
|
|
144
|
-
</div>`,
|
|
145
|
-
});
|
|
146
|
-
|
|
147
124
|
export const NoGutters = () => ({
|
|
148
125
|
data() {
|
|
149
126
|
return {
|
|
@@ -164,4 +141,34 @@ export const AlignSelf = () => ({
|
|
|
164
141
|
<farm-row style="height: 150px">
|
|
165
142
|
<farm-col :style="style" v-for="align in aligns" :key="align" :align-self="align">{{ align }}</farm-col>
|
|
166
143
|
</farm-row>`,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export const Offsets = () => ({
|
|
147
|
+
data() {
|
|
148
|
+
return {
|
|
149
|
+
style,
|
|
150
|
+
items
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
template: `<farm-box>
|
|
154
|
+
<farm-row>
|
|
155
|
+
<farm-col :style="style" md="1" offset-md="3">offset-md 3</farm-col>
|
|
156
|
+
<farm-col :style="style" md="1" offset-md="1">offset-md 1</farm-col>
|
|
157
|
+
</farm-row>
|
|
158
|
+
<br />
|
|
159
|
+
<farm-row>
|
|
160
|
+
<farm-col :style="style" md="1" offset-sm="1">offset-sm 1</farm-col>
|
|
161
|
+
<farm-col :style="style" md="1" offset-sm="4">offset-sm 4</farm-col>
|
|
162
|
+
<farm-col :style="style" md="1" offset-sm="2">offset-sm 2</farm-col>
|
|
163
|
+
</farm-row>
|
|
164
|
+
<br />
|
|
165
|
+
<farm-row>
|
|
166
|
+
<farm-col :style="style" md="1" offset-sm="1" offset-md="3">offset-sm 1 md 3</farm-col>
|
|
167
|
+
</farm-row>
|
|
168
|
+
<br />
|
|
169
|
+
<farm-row>
|
|
170
|
+
<farm-col :style="style" md="1" offset="1">offset 1</farm-col>
|
|
171
|
+
<farm-col :style="style" md="1" offset="1" offset-md="0">offset md 0</farm-col>
|
|
172
|
+
</farm-row>
|
|
173
|
+
</farm-box>`,
|
|
167
174
|
});
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
[`farm-col--xs-${xs}`]: xs,
|
|
12
12
|
[`farm-col--cols-${cols}`]: cols,
|
|
13
13
|
'farm-col--no-gutters': noGutters,
|
|
14
|
+
[`farm-col--offset-${offset}`]: offset,
|
|
15
|
+
[`farm-col--offset-xl-${offsetXl}`]: offsetXl,
|
|
16
|
+
[`farm-col--offset-lg-${offsetLg}`]: offsetLg,
|
|
17
|
+
[`farm-col--offset-md-${offsetMd}`]: offsetMd,
|
|
18
|
+
[`farm-col--offset-sm-${offsetSm}`]: offsetSm,
|
|
14
19
|
}"
|
|
15
20
|
>
|
|
16
21
|
<slot></slot>
|
|
@@ -82,6 +87,51 @@ export default Vue.extend({
|
|
|
82
87
|
type: String as PropType<'start' | 'center' | 'end' | 'auto' | 'baseline' | 'stretch'>,
|
|
83
88
|
default: '',
|
|
84
89
|
},
|
|
90
|
+
/**
|
|
91
|
+
* Sets the default offset for the column.
|
|
92
|
+
*/
|
|
93
|
+
offset: {
|
|
94
|
+
type: [String, Number] as PropType<
|
|
95
|
+
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
96
|
+
>,
|
|
97
|
+
default: null,
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* Changes the offset of the component on extra large and greater breakpoints.
|
|
101
|
+
*/
|
|
102
|
+
offsetXl: {
|
|
103
|
+
type: [String, Number] as PropType<
|
|
104
|
+
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
105
|
+
>,
|
|
106
|
+
default: null,
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Changes the offset of the component on large and greater breakpoints.
|
|
110
|
+
*/
|
|
111
|
+
offsetLg: {
|
|
112
|
+
type: [String, Number] as PropType<
|
|
113
|
+
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
114
|
+
>,
|
|
115
|
+
default: null,
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* Changes the offset of the component on medium and greater breakpoints.
|
|
119
|
+
*/
|
|
120
|
+
offsetMd: {
|
|
121
|
+
type: [String, Number] as PropType<
|
|
122
|
+
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
123
|
+
>,
|
|
124
|
+
default: null,
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Changes the offset of the component on small and greater breakpoints.
|
|
128
|
+
*/
|
|
129
|
+
offsetSm: {
|
|
130
|
+
type: [String, Number] as PropType<
|
|
131
|
+
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
132
|
+
>,
|
|
133
|
+
default: null,
|
|
134
|
+
},
|
|
85
135
|
},
|
|
86
136
|
inheritAttrs: true,
|
|
87
137
|
});
|
|
@@ -21,4 +21,9 @@ export const Primary = () => ({
|
|
|
21
21
|
template: '<farm-container-footer>Footer content</farm-container-footer>',
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
export const noTop = () => ({
|
|
25
|
+
components: { 'farm-container-footer': ContainerFooter },
|
|
26
|
+
template: '<farm-container-footer noTop>Footer content</farm-container-footer>',
|
|
27
|
+
});
|
|
28
|
+
|
|
24
29
|
Primary.storyName = 'Basic';
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
@import '../../../configurations/functions';
|
|
2
2
|
|
|
3
3
|
.farm-container-footer {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: gutter('lg');
|
|
6
|
+
padding-bottom: 0;
|
|
7
|
+
border-top: 1px solid var(--farm-stroke-base);
|
|
8
|
+
margin-top: gutter('lg');
|
|
9
|
+
|
|
10
|
+
&.farm-container-footer--notop {
|
|
11
|
+
margin-top: gutter('none');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<footer
|
|
2
|
+
<footer
|
|
3
|
+
:class="{
|
|
4
|
+
'farm-container-footer': true,
|
|
5
|
+
'farm-container-footer--notop': noTop,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
3
8
|
<slot></slot>
|
|
4
9
|
</footer>
|
|
5
10
|
</template>
|
|
@@ -8,6 +13,12 @@ import Vue from 'vue';
|
|
|
8
13
|
|
|
9
14
|
export default Vue.extend({
|
|
10
15
|
name: 'farm-container-footer',
|
|
16
|
+
props: {
|
|
17
|
+
noTop: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
11
22
|
inheritAttrs: true,
|
|
12
23
|
});
|
|
13
24
|
</script>
|