@farm-investimentos/front-mfe-components 9.4.0 → 10.0.0
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 +3787 -3383
- 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 +3787 -3383
- 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/Card/Card.vue +1 -1
- package/src/components/Card/CardContent/CardContent.vue +1 -1
- package/src/components/Checkbox/Checkbox.vue +6 -1
- package/src/components/Chip/Chip.stories.js +11 -0
- package/src/components/CopyToClipboard/__tests__/CopyToClipboard.spec.js +5 -1
- package/src/components/DatePicker/DatePicker.vue +0 -2
- package/src/components/Form/Form.stories.js +29 -4
- package/src/components/Icon/Icon.stories.js +3 -1
- package/src/components/List/List.scss +0 -0
- package/src/components/List/List.stories.js +29 -0
- package/src/components/List/List.vue +17 -0
- package/src/components/List/__tests__/List.spec.js +20 -0
- package/src/components/List/index.ts +4 -0
- package/src/components/ListItem/ListItem.scss +37 -0
- package/src/components/ListItem/ListItem.stories.js +70 -0
- package/src/components/ListItem/ListItem.vue +82 -0
- package/src/components/ListItem/__tests__/ListItem.spec.js +20 -0
- package/src/components/ListItem/index.ts +4 -0
- package/src/components/Logger/Logger.vue +5 -7
- package/src/components/Modal/Modal.scss +1 -0
- package/src/components/Modal/Modal.stories.js +2 -2
- package/src/components/ModalPromptUser/ModalPromptUser.scss +3 -0
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +7 -6
- package/src/components/ModalPromptUser/ModalPromptUser.vue +18 -17
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.vue +2 -2
- package/src/components/RadioGroup/RadioGroup.scss +46 -20
- package/src/components/RadioGroup/RadioGroup.stories.js +69 -8
- package/src/components/RadioGroup/RadioGroup.vue +68 -46
- package/src/components/TableContextMenu/TableContextMenu.scss +5 -2
- package/src/components/TableContextMenu/TableContextMenu.stories.js +21 -4
- package/src/components/TableContextMenu/TableContextMenu.vue +6 -7
- package/src/components/TextField/__tests__/{Label.spec.js → TextField.spec.js} +0 -0
- package/src/components/layout/Col/Col.scss +5 -0
- package/src/components/layout/Col/Col.stories.js +42 -0
- package/src/components/layout/Col/Col.vue +62 -0
- package/src/components/layout/Col/__tests__/Col.spec.js +22 -0
- package/src/components/layout/Col/index.ts +4 -0
- package/src/components/layout/Container/Container.scss +7 -3
- package/src/components/layout/Container/Container.stories.js +2 -1
- package/src/components/layout/ContainerFooter/ContainerFooter.scss +6 -3
- package/src/components/layout/Row/Row.scss +25 -1
- package/src/components/layout/Row/Row.stories.js +48 -3
- package/src/components/layout/Row/Row.vue +24 -1
- package/src/configurations/_variables.scss +2 -2
- package/src/examples/Container/Basic.stories.js +20 -4
- package/src/main.ts +4 -0
|
@@ -1,35 +1,65 @@
|
|
|
1
|
+
@import '../../configurations/theme-colors';
|
|
2
|
+
|
|
1
3
|
.farm-radio-group {
|
|
2
4
|
border: none;
|
|
3
5
|
cursor: default;
|
|
4
6
|
display: flex;
|
|
5
7
|
width: 100%;
|
|
8
|
+
|
|
6
9
|
&__item {
|
|
7
10
|
font-size: 16px;
|
|
8
|
-
line-height:
|
|
11
|
+
line-height: 18px;
|
|
9
12
|
cursor: pointer;
|
|
10
13
|
display: grid;
|
|
11
14
|
grid-template-columns: 16px auto;
|
|
12
|
-
gap:
|
|
13
|
-
color: rgba(0,0,0
|
|
14
|
-
margin-
|
|
15
|
-
|
|
15
|
+
gap: 0;
|
|
16
|
+
color: rgba(0, 0, 0, .6);
|
|
17
|
+
margin-right: 32px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
label {
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
input[type="radio"].checked {
|
|
25
|
+
border: 1.5px solid black;
|
|
16
26
|
}
|
|
17
|
-
}
|
|
18
27
|
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
&--vertical {
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
.farm-radio-group__item {
|
|
31
|
+
margin-right: 24px;
|
|
32
|
+
margin-top: 16px;
|
|
33
|
+
&:first-of-type {
|
|
34
|
+
margin-top: 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@each $color in $theme-colors-list {
|
|
40
|
+
&#{'[color=' + $color + ']'} {
|
|
41
|
+
input[type="radio"]::before {
|
|
42
|
+
box-shadow: inset 16px 16px themeColor($color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
input[type="radio"].checked {
|
|
46
|
+
border-color: themeColor($color);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
21
50
|
}
|
|
22
51
|
|
|
52
|
+
|
|
23
53
|
input[type="radio"] {
|
|
24
54
|
-webkit-appearance: none;
|
|
25
55
|
appearance: none;
|
|
26
56
|
background-color: #ffffff;
|
|
27
57
|
margin: 0;
|
|
28
58
|
font: inherit;
|
|
29
|
-
color: rgba(0,0,0
|
|
59
|
+
color: rgba(0, 0, 0, .6);
|
|
30
60
|
width: 18px;
|
|
31
61
|
height: 18px;
|
|
32
|
-
border: 1.5px solid rgba(0,0,0
|
|
62
|
+
border: 1.5px solid rgba(0, 0, 0, .6);
|
|
33
63
|
border-radius: 50%;
|
|
34
64
|
transform: translate(-12px);
|
|
35
65
|
display: grid;
|
|
@@ -44,11 +74,10 @@ input[type="radio"]::before {
|
|
|
44
74
|
border-radius: 50%;
|
|
45
75
|
transform: scale(0);
|
|
46
76
|
transition: 120ms transform ease-in-out;
|
|
47
|
-
box-shadow: inset 16px 16px var(--radio-group-color);
|
|
48
77
|
background-color: CanvasText;
|
|
49
78
|
}
|
|
50
79
|
|
|
51
|
-
input[type="radio"]
|
|
80
|
+
input[type="radio"].checked::before {
|
|
52
81
|
transform: scale(1);
|
|
53
82
|
}
|
|
54
83
|
|
|
@@ -57,13 +86,9 @@ input[type="radio"]:focus {
|
|
|
57
86
|
outline-offset: none;
|
|
58
87
|
}
|
|
59
88
|
|
|
60
|
-
input[type="radio"]:checked {
|
|
61
|
-
border: 1.5px solid var(--radio-group-color);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
89
|
input[type='radio']:hover {
|
|
65
|
-
box-shadow: 0px 0px 0px 8px
|
|
66
|
-
background-color:
|
|
90
|
+
box-shadow: 0px 0px 0px 8px rgba(0, 0, 0, 0.1);
|
|
91
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
67
92
|
border-radius: 50%;
|
|
68
93
|
opacity: 1;
|
|
69
94
|
}
|
|
@@ -74,9 +99,10 @@ input[type='radio']:active {
|
|
|
74
99
|
|
|
75
100
|
@keyframes pulse {
|
|
76
101
|
from {
|
|
77
|
-
|
|
102
|
+
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 0, 0, 0.2);
|
|
78
103
|
}
|
|
104
|
+
|
|
79
105
|
to {
|
|
80
|
-
|
|
106
|
+
box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.2), 0 0 0 8px rgba(0, 0, 0, 0.2);
|
|
81
107
|
}
|
|
82
108
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import RadioGroup from './RadioGroup';
|
|
2
|
+
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
3
|
+
|
|
4
|
+
const colors = Object.keys(baseThemeColors);
|
|
2
5
|
|
|
3
6
|
export default {
|
|
4
7
|
title: 'Form/RadioGroup',
|
|
@@ -7,7 +10,9 @@ export default {
|
|
|
7
10
|
docs: {
|
|
8
11
|
description: {
|
|
9
12
|
component: `RadioGroup<br />
|
|
10
|
-
selector: <em>farm-radio-group</em
|
|
13
|
+
selector: <em>farm-radio-group</em><br />
|
|
14
|
+
<span style="color: green;">ready for use</span>
|
|
15
|
+
|
|
11
16
|
`,
|
|
12
17
|
},
|
|
13
18
|
},
|
|
@@ -19,16 +24,72 @@ export const Primary = () => ({
|
|
|
19
24
|
data() {
|
|
20
25
|
return {
|
|
21
26
|
buttons: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
checkedValue: 1
|
|
27
|
+
{ label: 'Random text', id: 1 },
|
|
28
|
+
{ label: 'In', id: 2 },
|
|
29
|
+
{ label: 'Radio Group', id: 3 },
|
|
30
|
+
],
|
|
31
|
+
checkedValue: 1,
|
|
27
32
|
};
|
|
28
33
|
},
|
|
29
34
|
template: `<div>
|
|
30
|
-
<farm-radio-group v-model="checkedValue"
|
|
35
|
+
<farm-radio-group v-model="checkedValue" :buttons="buttons" />
|
|
31
36
|
</div>`,
|
|
32
37
|
});
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
export const Reset = () => ({
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
buttons: [
|
|
43
|
+
{ label: 'Button 1', id: 1 },
|
|
44
|
+
{ label: 'Button 2', id: 2 },
|
|
45
|
+
{ label: 'Button 3', id: 3 },
|
|
46
|
+
],
|
|
47
|
+
checkedValue: 1,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
reset() {
|
|
52
|
+
this.$refs.radiogroupreset.reset();
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
template: `<div>
|
|
56
|
+
<farm-radio-group v-model="checkedValue" :buttons="buttons" ref="radiogroupreset" /><br />
|
|
57
|
+
<farm-btn @click="reset">Reset</farm-btn>
|
|
58
|
+
</div>`,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const Vertical = () => ({
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
buttons: [
|
|
65
|
+
{ label: 'Button 1', id: 1 },
|
|
66
|
+
{ label: 'Button 2', id: 2 },
|
|
67
|
+
{ label: 'Button 3', id: 3 },
|
|
68
|
+
],
|
|
69
|
+
checkedValue: 1,
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
template: `<div>
|
|
73
|
+
<farm-radio-group v-model="checkedValue" vertical :buttons="buttons" />
|
|
74
|
+
</div>`,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const Colors = () => ({
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
buttons: [
|
|
81
|
+
{ label: 'Button 1', id: 1 },
|
|
82
|
+
{ label: 'Button 2', id: 2 },
|
|
83
|
+
{ label: 'Button 3', id: 3 },
|
|
84
|
+
],
|
|
85
|
+
checkedValue: 1,
|
|
86
|
+
colors,
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
template: `<div style="display: flex; flex-direction: row; flex-wrap: wrap;">
|
|
90
|
+
<div v-for="color in colors" style="width: 33.3%; margin-bottom: 32px;">
|
|
91
|
+
<h4 style="margin-bottom: 16px">{{ color }}</h4>
|
|
92
|
+
<farm-radio-group v-model="checkedValue" vertical :color="color" :buttons="buttons" />
|
|
93
|
+
</div>
|
|
94
|
+
</div>`,
|
|
95
|
+
});
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
<div
|
|
3
|
+
:class="{
|
|
4
|
+
'farm-radio-group': true,
|
|
5
|
+
'farm-radio-group--vertical': $props.vertical,
|
|
6
|
+
}"
|
|
7
|
+
:color="color"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="farm-radio-group__item"
|
|
11
|
+
v-for="(button, index) in buttons"
|
|
12
|
+
:key="`farm-radio-group_` + index"
|
|
13
|
+
@click="clicked(button.id)"
|
|
14
|
+
>
|
|
15
|
+
<input
|
|
16
|
+
type="radio"
|
|
17
|
+
name="radio"
|
|
18
|
+
:checked="button.id === innerValue"
|
|
19
|
+
:id="`farm-radio-group_` + index"
|
|
20
|
+
:value="button.id"
|
|
21
|
+
:class="{ checked: button.id === innerValue }"
|
|
22
|
+
/>
|
|
23
|
+
<label> {{ button.label }} </label>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
25
26
|
</template>
|
|
26
27
|
<script lang="ts">
|
|
27
|
-
import Vue, { PropType } from 'vue';
|
|
28
|
+
import Vue, { PropType, ref, watch } from 'vue';
|
|
29
|
+
import validateFormStateBuilder from '../../composition/validateFormStateBuilder';
|
|
28
30
|
import IRadioGroup from './IRadioGroup';
|
|
29
31
|
export default Vue.extend({
|
|
30
32
|
name: 'farm-radio-group',
|
|
@@ -34,36 +36,56 @@ export default Vue.extend({
|
|
|
34
36
|
*/
|
|
35
37
|
buttons: {
|
|
36
38
|
type: Array as PropType<Array<IRadioGroup>>,
|
|
37
|
-
default:
|
|
39
|
+
default: [],
|
|
38
40
|
},
|
|
39
|
-
|
|
41
|
+
/**
|
|
40
42
|
* v-model
|
|
41
43
|
*/
|
|
42
44
|
value: {
|
|
43
45
|
required: true,
|
|
44
46
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Is vertical?
|
|
49
|
+
*/
|
|
50
|
+
vertical: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
color: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: 'primary',
|
|
57
|
+
},
|
|
53
58
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
computed: {
|
|
60
|
-
cssVars () {
|
|
61
|
-
return {
|
|
62
|
-
'--radio-group-color': this.color
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
59
|
+
setup(props, { emit }) {
|
|
60
|
+
const innerValue = ref(props.value);
|
|
61
|
+
const { errorBucket, valid, validatable } = validateFormStateBuilder();
|
|
66
62
|
|
|
63
|
+
const reset = () => {
|
|
64
|
+
innerValue.value = false;
|
|
65
|
+
emit('input', innerValue.value);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
watch(
|
|
69
|
+
() => props.value,
|
|
70
|
+
() => {
|
|
71
|
+
innerValue.value = props.value;
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const clicked = value => {
|
|
76
|
+
innerValue.value = value;
|
|
77
|
+
emit('input', innerValue.value);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
innerValue,
|
|
82
|
+
errorBucket,
|
|
83
|
+
valid,
|
|
84
|
+
validatable,
|
|
85
|
+
reset,
|
|
86
|
+
clicked,
|
|
87
|
+
};
|
|
88
|
+
},
|
|
67
89
|
});
|
|
68
90
|
</script>
|
|
69
91
|
<style lang="scss" scoped>
|
|
@@ -10,16 +10,31 @@ export default {
|
|
|
10
10
|
type: 'figma',
|
|
11
11
|
url: 'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=3516%3A11516',
|
|
12
12
|
},
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component: `TableContextMenu<br />
|
|
16
|
+
selector: <em>farm-context-menu</em><br />
|
|
17
|
+
<span style="color: green;">ready for use</span>
|
|
18
|
+
`,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
viewMode: 'docs',
|
|
13
22
|
},
|
|
14
23
|
};
|
|
15
24
|
|
|
16
25
|
export const Primary = () => ({
|
|
17
|
-
template: `<
|
|
26
|
+
template: `<div>
|
|
27
|
+
<farm-context-menu :items="[{ label: 'Remover', icon: { color: 'error', type: 'open-in-new' } }]" />
|
|
28
|
+
</div>`,
|
|
18
29
|
});
|
|
19
30
|
|
|
20
31
|
export const Icons = () => ({
|
|
21
|
-
template: `<
|
|
22
|
-
|
|
32
|
+
template: `<div>
|
|
33
|
+
<farm-context-menu
|
|
34
|
+
ref="icons"
|
|
35
|
+
:items="[{ label: 'Remover', icon: { color: 'error', type: 'delete' } }]"
|
|
36
|
+
/>
|
|
37
|
+
</div>`,
|
|
23
38
|
});
|
|
24
39
|
|
|
25
40
|
export const Multi = () => ({
|
|
@@ -32,5 +47,7 @@ export const Multi = () => ({
|
|
|
32
47
|
],
|
|
33
48
|
};
|
|
34
49
|
},
|
|
35
|
-
template: `<
|
|
50
|
+
template: `<div>
|
|
51
|
+
<farm-context-menu ref="multi" :items="items" />
|
|
52
|
+
</div>`,
|
|
36
53
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<v-menu>
|
|
3
3
|
<template v-slot:activator="{ on, attrs }">
|
|
4
4
|
<farm-btn icon v-bind="attrs" v-on="on" title="Abrir opções">
|
|
5
|
-
<
|
|
5
|
+
<farm-icon size="md">dots-horizontal</farm-icon>
|
|
6
6
|
</farm-btn>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
>
|
|
16
16
|
<v-list-item-content>
|
|
17
17
|
<v-list-item-title>
|
|
18
|
-
<
|
|
18
|
+
<farm-icon
|
|
19
19
|
v-if="item.icon"
|
|
20
|
+
size="md"
|
|
20
21
|
:color="item.icon.color || 'secondary'"
|
|
21
|
-
class="mb-1"
|
|
22
|
-
>mdi-{{ item.icon.type }}</v-icon
|
|
23
22
|
>
|
|
23
|
+
{{ item.icon.type }}
|
|
24
|
+
</farm-icon>
|
|
24
25
|
{{ item.label }}
|
|
25
26
|
</v-list-item-title>
|
|
26
27
|
</v-list-item-content>
|
|
@@ -28,10 +29,9 @@
|
|
|
28
29
|
</v-list>
|
|
29
30
|
</v-menu>
|
|
30
31
|
</template>
|
|
31
|
-
<script>
|
|
32
|
+
<script lang="ts">
|
|
32
33
|
import Vue from 'vue';
|
|
33
34
|
import { VMenu } from 'vuetify/lib/components/VMenu';
|
|
34
|
-
import { VIcon } from 'vuetify/lib/components/VIcon';
|
|
35
35
|
import { VList } from 'vuetify/lib/components/VList';
|
|
36
36
|
import VListItem from 'vuetify/lib/components/VList/VListItem';
|
|
37
37
|
import { VListItemContent, VListItemTitle } from 'vuetify/lib';
|
|
@@ -39,7 +39,6 @@ import { VListItemContent, VListItemTitle } from 'vuetify/lib';
|
|
|
39
39
|
export default Vue.extend({
|
|
40
40
|
name: 'farm-context-menu',
|
|
41
41
|
components: {
|
|
42
|
-
VIcon,
|
|
43
42
|
VMenu,
|
|
44
43
|
VList,
|
|
45
44
|
VListItem,
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Col from './Col.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/Col',
|
|
5
|
+
component: Col,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Col<br />
|
|
10
|
+
selector: <em>farm-col</em><br />
|
|
11
|
+
<span style="color: var(--farm-extra-1-base);">development</span>
|
|
12
|
+
`,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
viewMode: 'docs',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Primary = () => ({
|
|
20
|
+
template: '<farm-col>col</farm-col>',
|
|
21
|
+
});
|
|
22
|
+
export const Xl = () => ({
|
|
23
|
+
template: '<farm-col xl="3">xl: 3</farm-col>',
|
|
24
|
+
});
|
|
25
|
+
export const Lg = () => ({
|
|
26
|
+
template: '<farm-col lg="4">lg: 4</farm-col>',
|
|
27
|
+
});
|
|
28
|
+
export const Md = () => ({
|
|
29
|
+
template: '<farm-col md="6">md: 6</farm-col>',
|
|
30
|
+
});
|
|
31
|
+
export const Sm = () => ({
|
|
32
|
+
template: '<farm-col sm="4">sm: 4</farm-col>',
|
|
33
|
+
});
|
|
34
|
+
export const Xs = () => ({
|
|
35
|
+
template: '<farm-col xs="4">xs: 4</farm-col>',
|
|
36
|
+
});
|
|
37
|
+
export const Combination = () => ({
|
|
38
|
+
template: '<farm-col xl="3" xs="4">xl: 3 - xs: 4</farm-col>',
|
|
39
|
+
});
|
|
40
|
+
export const TagP = () => ({
|
|
41
|
+
template: '<farm-col tag="p">col</farm-col>',
|
|
42
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
:class="{
|
|
5
|
+
'farm-col': true,
|
|
6
|
+
[`farm-col--xl-${xl}`]: xl,
|
|
7
|
+
[`farm-col--lg-${lg}`]: lg,
|
|
8
|
+
[`farm-col--md-${md}`]: md,
|
|
9
|
+
[`farm-col--sm-${sm}`]: sm,
|
|
10
|
+
[`farm-col--xs-${xs}`]: xs,
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</component>
|
|
15
|
+
</template>
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import Vue, { PropType } from 'vue';
|
|
18
|
+
|
|
19
|
+
export default Vue.extend({
|
|
20
|
+
name: 'farm-col',
|
|
21
|
+
props: {
|
|
22
|
+
/**
|
|
23
|
+
* Html tag
|
|
24
|
+
*/
|
|
25
|
+
tag: { type: String, default: 'div' },
|
|
26
|
+
xl: {
|
|
27
|
+
type: [String, Number, Boolean] as PropType<
|
|
28
|
+
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
29
|
+
>,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
lg: {
|
|
33
|
+
type: [String, Number, Boolean] as PropType<
|
|
34
|
+
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
35
|
+
>,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
md: {
|
|
39
|
+
type: [String, Number, Boolean] as PropType<
|
|
40
|
+
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
41
|
+
>,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
sm: {
|
|
45
|
+
type: [String, Number, Boolean] as PropType<
|
|
46
|
+
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
47
|
+
>,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
xs: {
|
|
51
|
+
type: [String, Number, Boolean] as PropType<
|
|
52
|
+
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
53
|
+
>,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
inheritAttrs: true,
|
|
58
|
+
});
|
|
59
|
+
</script>
|
|
60
|
+
<style lang="scss" scoped>
|
|
61
|
+
@import 'Col';
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import Col from '../Col';
|
|
3
|
+
|
|
4
|
+
describe('Col component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(Col);
|
|
10
|
+
component = wrapper.vm;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Created hook', () => {
|
|
14
|
+
expect(wrapper).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('mount component', () => {
|
|
18
|
+
it('renders correctly', () => {
|
|
19
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@import '../../../configurations/functions';
|
|
2
|
+
@import '../../../configurations/_mixins';
|
|
3
|
+
|
|
1
4
|
.farm-container {
|
|
2
5
|
width: 100%;
|
|
3
6
|
padding: 12px;
|
|
@@ -8,9 +11,10 @@
|
|
|
8
11
|
>div {
|
|
9
12
|
background-color: white;
|
|
10
13
|
border-radius: 8px;
|
|
11
|
-
max-width: calc(100% -
|
|
12
|
-
margin:
|
|
13
|
-
padding:
|
|
14
|
+
max-width: calc(100% - 24px);
|
|
15
|
+
margin: gutter('lg') auto;
|
|
16
|
+
padding: gutter('lg');
|
|
17
|
+
@include addShadow;
|
|
14
18
|
|
|
15
19
|
// deprecated
|
|
16
20
|
.container-main__footer-buttons-right {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
@import '../../../configurations/functions';
|
|
2
|
+
|
|
1
3
|
.farm-container-footer {
|
|
2
4
|
width: 100%;
|
|
3
|
-
padding:
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
padding: gutter('lg');
|
|
6
|
+
padding-bottom: 0;
|
|
7
|
+
border-top: 1px solid var(--farm-stroke-base);
|
|
8
|
+
margin-top: gutter('lg');
|
|
6
9
|
}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
|
+
@import '../../../configurations/functions';
|
|
2
|
+
$aligns: start, center, end, baseline, stretch;
|
|
3
|
+
$align-contents: start, center, end, space-between, space-around, stretch;
|
|
4
|
+
$justifications: start, center, end, space-between, space-around;
|
|
5
|
+
|
|
6
|
+
|
|
1
7
|
.farm-row {
|
|
2
8
|
display: flex;
|
|
3
9
|
flex-wrap: wrap;
|
|
4
10
|
flex: 1 1 auto;
|
|
5
|
-
margin: -
|
|
11
|
+
margin: 0 calc(#{gutter('lg')} * -1);
|
|
12
|
+
|
|
13
|
+
@each $k in $aligns {
|
|
14
|
+
&#{'--align-' + $k} {
|
|
15
|
+
align-items: $k !important;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@each $k in $align-contents {
|
|
20
|
+
&#{'--align-content-' + $k} {
|
|
21
|
+
align-content: $k !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@each $k in $justifications {
|
|
26
|
+
&#{'--justify-' + $k} {
|
|
27
|
+
justify-content: $k !important;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
6
30
|
}
|