@farm-investimentos/front-mfe-components 6.1.2 → 6.2.2
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 +518 -453
- 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 +518 -453
- 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/AlertReload/AlertReload.vue +8 -10
- package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +1 -1
- package/src/components/Buttons/ConfirmButton/ConfirmButton.vue +10 -9
- package/src/components/Buttons/DangerButton/DangerButton.vue +5 -9
- package/src/components/Buttons/DefaultButton/DefaultButton.scss +153 -0
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +4 -3
- package/src/components/Buttons/DefaultButton/DefaultButton.vue +55 -9
- package/src/components/Buttons/DefaultButton/__tests__/DefaultButton.spec.js +22 -0
- package/src/components/Buttons/ExportButton/ExportButton.vue +18 -12
- package/src/components/Buttons/ImportButton/ImportButton.vue +9 -9
- package/src/components/Buttons/MultiImportButton/MultiImportButton.scss +3 -2
- package/src/components/Buttons/MultiImportButton/MultiImportButton.vue +16 -16
- package/src/components/Buttons/RemoveButton/RemoveButton.vue +6 -5
- package/src/components/Buttons/ToggleButton/ToggleButton.vue +6 -16
- package/src/components/DatePicker/DatePicker.vue +25 -17
- package/src/components/DialogFooter/DialogFooter.vue +13 -15
- package/src/components/FilePicker/FilePicker.vue +5 -5
- package/src/components/MainFilter/MainFilter.scss +6 -3
- package/src/components/MainFilter/MainFilter.vue +5 -5
- package/src/components/RadioButton/RadioButton.stories.js +1 -1
- package/src/components/RadioButton/RadioButton.vue +1 -1
- package/src/components/RangeDatePicker/RangeDatePicker.vue +7 -7
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.vue +5 -4
- package/src/components/TableContextMenu/TableContextMenu.scss +3 -0
- package/src/components/TableContextMenu/TableContextMenu.vue +5 -5
- package/src/examples/Buttons.stories.js +65 -12
- package/src/scss/ButtonOverrides.scss +7 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<farm-btn
|
|
3
3
|
@click="onClick"
|
|
4
4
|
dense
|
|
5
5
|
class="v-btn--responsive"
|
|
@@ -13,21 +13,22 @@
|
|
|
13
13
|
>
|
|
14
14
|
<v-icon v-if="prepend">{{ `mdi-chevron-${open ? 'up' : 'down'}` }}</v-icon>
|
|
15
15
|
{{ label }}
|
|
16
|
-
<v-icon v-if="!prepend">{{ `mdi-chevron-${open ? 'up' : 'down'}` }}</v-icon>
|
|
17
|
-
</
|
|
16
|
+
<v-icon v-if="!prepend" class="ml-3 mr-0">{{ `mdi-chevron-${open ? 'up' : 'down'}` }}</v-icon>
|
|
17
|
+
</farm-btn>
|
|
18
18
|
</template>
|
|
19
19
|
<script>
|
|
20
20
|
import Vue from 'vue';
|
|
21
|
-
import VBtn from 'vuetify/lib/components/VBtn';
|
|
22
21
|
import VIcon from 'vuetify/lib/components/VIcon';
|
|
22
|
+
import DefaultButton from '../DefaultButton';
|
|
23
|
+
|
|
23
24
|
/**
|
|
24
25
|
* Botão de Toggle, emitindo e guardando status
|
|
25
26
|
*/
|
|
26
27
|
export default Vue.extend({
|
|
27
28
|
name: 'farm-btn-toggle',
|
|
28
29
|
components: {
|
|
29
|
-
VBtn,
|
|
30
30
|
VIcon,
|
|
31
|
+
'farm-btn': DefaultButton,
|
|
31
32
|
},
|
|
32
33
|
data: () => ({
|
|
33
34
|
open: false,
|
|
@@ -82,14 +83,3 @@ export default Vue.extend({
|
|
|
82
83
|
},
|
|
83
84
|
});
|
|
84
85
|
</script>
|
|
85
|
-
<style scoped lang="scss">
|
|
86
|
-
.v-btn {
|
|
87
|
-
&.v-btn_icon--apppend .v-icon {
|
|
88
|
-
margin-left: 1rem;
|
|
89
|
-
margin-right: 0;
|
|
90
|
-
}
|
|
91
|
-
&.v-btn_icon--prepend .v-icon {
|
|
92
|
-
margin-left: 0;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
</style>
|
|
@@ -30,23 +30,26 @@
|
|
|
30
30
|
v-model="dateField"
|
|
31
31
|
no-title
|
|
32
32
|
scrollable
|
|
33
|
-
:max="max"
|
|
34
|
-
:min="min"
|
|
35
33
|
color="secondary"
|
|
36
34
|
locale="pt-br"
|
|
35
|
+
:max="max"
|
|
36
|
+
:min="min"
|
|
37
37
|
>
|
|
38
|
-
<
|
|
38
|
+
<farm-btn outlined color="primary" @click="menuField = false" title="Fechar">
|
|
39
39
|
Fechar
|
|
40
|
-
</
|
|
41
|
-
<
|
|
42
|
-
|
|
40
|
+
</farm-btn>
|
|
41
|
+
<farm-btn outlined color="secondary" class="ml-2" @click="clear">
|
|
42
|
+
Limpar
|
|
43
|
+
</farm-btn>
|
|
44
|
+
<farm-btn
|
|
43
45
|
color="secondary"
|
|
46
|
+
class="ml-2"
|
|
47
|
+
title="Confirmar"
|
|
44
48
|
:disabled="!dateField.length"
|
|
45
49
|
@click="save()"
|
|
46
|
-
title="Confirmar"
|
|
47
50
|
>
|
|
48
51
|
Confirmar
|
|
49
|
-
</
|
|
52
|
+
</farm-btn>
|
|
50
53
|
</v-date-picker>
|
|
51
54
|
</v-menu>
|
|
52
55
|
</template>
|
|
@@ -54,8 +57,8 @@
|
|
|
54
57
|
import Vue from 'vue';
|
|
55
58
|
import { VTextField } from 'vuetify/lib/components/VTextField';
|
|
56
59
|
import { VMenu } from 'vuetify/lib/components/VMenu';
|
|
57
|
-
import { VBtn } from 'vuetify/lib/components/VBtn';
|
|
58
60
|
import { VDatePicker } from 'vuetify/lib/components/VDatePicker';
|
|
61
|
+
import DefaultButton from '../Buttons/DefaultButton';
|
|
59
62
|
import { defaultFormat as dateDefaultFormatter, convertDate } from '../../helpers/date';
|
|
60
63
|
/**
|
|
61
64
|
* Componente de input com datepicker para data
|
|
@@ -65,8 +68,8 @@ export default Vue.extend({
|
|
|
65
68
|
components: {
|
|
66
69
|
VTextField,
|
|
67
70
|
VMenu,
|
|
68
|
-
VBtn,
|
|
69
71
|
VDatePicker,
|
|
72
|
+
'farm-btn': DefaultButton,
|
|
70
73
|
},
|
|
71
74
|
props: {
|
|
72
75
|
/**
|
|
@@ -113,11 +116,15 @@ export default Vue.extend({
|
|
|
113
116
|
return this.required ? !!value || value != '' || 'Campo obrigatório' : true;
|
|
114
117
|
},
|
|
115
118
|
checkMax: value => {
|
|
116
|
-
return this.max && new Date(convertDate(value)) > new Date(this.max)
|
|
119
|
+
return this.max && new Date(convertDate(value)) > new Date(this.max)
|
|
120
|
+
? 'A data está fora do período permitido'
|
|
121
|
+
: true;
|
|
117
122
|
},
|
|
118
123
|
checkMin: value => {
|
|
119
|
-
return this.min && new Date(convertDate(value)) < new Date(this.min)
|
|
120
|
-
|
|
124
|
+
return this.min && new Date(convertDate(value)) < new Date(this.min)
|
|
125
|
+
? 'A data está fora do período permitido'
|
|
126
|
+
: true;
|
|
127
|
+
},
|
|
121
128
|
};
|
|
122
129
|
},
|
|
123
130
|
watch: {
|
|
@@ -139,13 +146,14 @@ export default Vue.extend({
|
|
|
139
146
|
this.dateField = '';
|
|
140
147
|
this.save();
|
|
141
148
|
},
|
|
142
|
-
validation(date){
|
|
143
|
-
const pattern =
|
|
144
|
-
|
|
149
|
+
validation(date) {
|
|
150
|
+
const pattern =
|
|
151
|
+
/^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[13-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/gm;
|
|
152
|
+
return pattern.test(date);
|
|
145
153
|
},
|
|
146
154
|
keyUpInput(event) {
|
|
147
155
|
let newValue = event.target.value;
|
|
148
|
-
if(this.validation(newValue) && newValue.length === 10) {
|
|
156
|
+
if (this.validation(newValue) && newValue.length === 10) {
|
|
149
157
|
const [day, month, year] = newValue.split('/');
|
|
150
158
|
this.dateField = `${year}-${month}-${day}`;
|
|
151
159
|
this.save();
|
|
@@ -1,44 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="v-dialog__footer d-flex flex-column flex-sm-row justify-end">
|
|
3
|
-
<
|
|
3
|
+
<farm-btn @click="$emit('onClose')" v-if="hasCancel" color="primary" outlined>
|
|
4
4
|
{{ closeLabel }}
|
|
5
|
-
</
|
|
6
|
-
<
|
|
5
|
+
</farm-btn>
|
|
6
|
+
<farm-btn
|
|
7
7
|
v-for="button in extraButtons"
|
|
8
8
|
:key="button.label"
|
|
9
|
-
@click="$emit(button.listener ? button.listener : '')"
|
|
10
9
|
:color="button.color"
|
|
11
10
|
:outlined="button.outlined"
|
|
12
11
|
:depressed="button.outlined"
|
|
13
12
|
:disabled="button.disabled"
|
|
14
13
|
class="ml-sm-3 mt-3 mt-sm-0"
|
|
14
|
+
@click="$emit(button.listener ? button.listener : '')"
|
|
15
15
|
>
|
|
16
16
|
{{ button.label }}
|
|
17
|
-
</
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
:color="confirmColor"
|
|
17
|
+
</farm-btn>
|
|
18
|
+
<farm-btn
|
|
19
|
+
class="ml-sm-3 mt-3 mt-sm-0"
|
|
21
20
|
v-if="hasConfirm"
|
|
21
|
+
:color="confirmColor"
|
|
22
22
|
:disabled="isConfirmDisabled"
|
|
23
|
-
|
|
23
|
+
@click="$emit('onConfirm')"
|
|
24
24
|
>
|
|
25
|
-
<
|
|
25
|
+
<i :class="{ mdi: true, ['mdi-' + confirmIcon]: true }" v-if="confirmIcon"></i>
|
|
26
26
|
{{ confirmLabel }}
|
|
27
|
-
</
|
|
27
|
+
</farm-btn>
|
|
28
28
|
</div>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
-
import
|
|
33
|
-
import { VIcon } from 'vuetify/lib/components/VIcon';
|
|
32
|
+
import DefaultButton from '../Buttons/DefaultButton';
|
|
34
33
|
/**
|
|
35
34
|
* Footer de dialog/modal
|
|
36
35
|
*/
|
|
37
36
|
export default {
|
|
38
37
|
name: 'DialogFooter',
|
|
39
38
|
components: {
|
|
40
|
-
|
|
41
|
-
VIcon,
|
|
39
|
+
'farm-btn': DefaultButton,
|
|
42
40
|
},
|
|
43
41
|
props: {
|
|
44
42
|
/**
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
|
|
20
20
|
<p v-if="maxSizeReach" v-html="maxSizeReachMsg"></p>
|
|
21
21
|
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
>
|
|
22
|
+
<farm-btn depressed outlined color="secondary" class="v-btn-responsive" @click="reset">
|
|
23
|
+
Escolher outro
|
|
24
|
+
</farm-btn>
|
|
25
25
|
</div>
|
|
26
26
|
</section>
|
|
27
27
|
</template>
|
|
28
28
|
<script>
|
|
29
|
-
import
|
|
29
|
+
import DefaultButton from '../Buttons/DefaultButton';
|
|
30
30
|
import { VIcon } from 'vuetify/lib/components/VIcon';
|
|
31
31
|
export default {
|
|
32
32
|
props: {
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
98
|
components: {
|
|
99
|
-
|
|
99
|
+
'farm-btn': DefaultButton,
|
|
100
100
|
VIcon,
|
|
101
101
|
},
|
|
102
102
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
section {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
.farm-btn {
|
|
5
6
|
margin-left: 1rem;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
9
|
+
|
|
8
10
|
@media screen and (max-width: 600px) {
|
|
9
11
|
section {
|
|
10
12
|
flex-direction: column;
|
|
11
13
|
margin-bottom: 1rem;
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
.farm-btn {
|
|
13
16
|
margin-left: 0;
|
|
14
17
|
margin-top: 0 !important;
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
|
-
}
|
|
20
|
+
}
|
|
@@ -14,30 +14,30 @@
|
|
|
14
14
|
@keyup="onKeyUp"
|
|
15
15
|
/>
|
|
16
16
|
</fieldset>
|
|
17
|
-
<
|
|
17
|
+
<DefaultButton
|
|
18
18
|
v-if="hasExtraFilters"
|
|
19
19
|
color="secondary"
|
|
20
20
|
class="v-btn--responsive mt-14 mt-sm-8"
|
|
21
21
|
@click="onFilterClick"
|
|
22
22
|
>
|
|
23
|
-
<v-icon color="white" class="mr-2">{{ extraFiltersBtnIcon }}</v-icon>
|
|
23
|
+
<v-icon color="white" class="mr-2" small>{{ extraFiltersBtnIcon }}</v-icon>
|
|
24
24
|
{{ extraFiltersBtnLabel }}
|
|
25
|
-
</
|
|
25
|
+
</DefaultButton>
|
|
26
26
|
</section>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<script>
|
|
30
30
|
import Vue from 'vue';
|
|
31
|
-
import { VBtn } from 'vuetify/lib/components/VBtn';
|
|
32
31
|
import { VTextField } from 'vuetify/lib/components/VTextField';
|
|
33
32
|
import { VIcon } from 'vuetify/lib/components/VIcon';
|
|
33
|
+
import DefaultButton from '../Buttons/DefaultButton';
|
|
34
34
|
|
|
35
35
|
export default Vue.extend({
|
|
36
36
|
name: 'MainFilter',
|
|
37
37
|
components: {
|
|
38
38
|
VTextField,
|
|
39
|
-
VBtn,
|
|
40
39
|
VIcon,
|
|
40
|
+
DefaultButton,
|
|
41
41
|
},
|
|
42
42
|
props: {
|
|
43
43
|
hasExtraFilters: {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
color="secondary"
|
|
34
34
|
locale="pt-br"
|
|
35
35
|
>
|
|
36
|
-
<
|
|
36
|
+
<farm-btn outlined color="primary" @click="menuField = false" tutle="Fechar">
|
|
37
37
|
Fechar
|
|
38
|
-
</
|
|
39
|
-
<
|
|
40
|
-
<
|
|
38
|
+
</farm-btn>
|
|
39
|
+
<farm-btn outlined color="secondary" class="ml-2" @click="clear()" title="Limpar"> Limpar</farm-btn>
|
|
40
|
+
<farm-btn color="secondary" class="ml-2" :disabled="canConfirm" @click="save()" title="Confirmar">
|
|
41
41
|
Confirmar
|
|
42
|
-
</
|
|
42
|
+
</farm-btn>
|
|
43
43
|
</v-date-picker>
|
|
44
44
|
</v-menu>
|
|
45
45
|
</template>
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
import Vue from 'vue';
|
|
48
48
|
import { VTextField } from 'vuetify/lib/components/VTextField';
|
|
49
49
|
import { VMenu } from 'vuetify/lib/components/VMenu';
|
|
50
|
-
import { VBtn } from 'vuetify/lib/components/VBtn';
|
|
51
50
|
import { VDatePicker } from 'vuetify/lib/components/VDatePicker';
|
|
51
|
+
import DefaultButton from '../Buttons/DefaultButton';
|
|
52
52
|
import { defaultFormat as dateDefaultFormatter } from '../../helpers/date';
|
|
53
53
|
/**
|
|
54
54
|
* Componente de input com datepicker para range de data
|
|
@@ -58,8 +58,8 @@ export default Vue.extend({
|
|
|
58
58
|
components: {
|
|
59
59
|
VTextField,
|
|
60
60
|
VMenu,
|
|
61
|
-
VBtn,
|
|
62
61
|
VDatePicker,
|
|
62
|
+
'farm-btn': DefaultButton,
|
|
63
63
|
},
|
|
64
64
|
props: {
|
|
65
65
|
/**
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ml-6 mr-3 d-flex align-center">
|
|
3
3
|
Total de linhas selecionadas: {{ length }}
|
|
4
|
-
<
|
|
4
|
+
<farm-btn color="error" @click="reset" small dense class="ml-3" v-if="length > 0">
|
|
5
5
|
<v-icon small> mdi-trash-can </v-icon>
|
|
6
6
|
Desmarcar
|
|
7
|
-
</
|
|
7
|
+
</farm-btn>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
<script>
|
|
11
11
|
import Vue from 'vue';
|
|
12
|
-
import VBtn from 'vuetify/lib/components/VBtn';
|
|
13
12
|
import VIcon from 'vuetify/lib/components/VIcon';
|
|
13
|
+
import DefaultButton from '../Buttons/DefaultButton';
|
|
14
|
+
|
|
14
15
|
export default Vue.extend({
|
|
15
16
|
name: 'farm-tablerowselection',
|
|
16
17
|
components: {
|
|
17
|
-
VBtn,
|
|
18
18
|
VIcon,
|
|
19
|
+
'farm-btn': DefaultButton,
|
|
19
20
|
},
|
|
20
21
|
props: {
|
|
21
22
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-menu>
|
|
3
3
|
<template v-slot:activator="{ on, attrs }">
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
</
|
|
4
|
+
<farm-btn icon v-bind="attrs" v-on="on" title="Abrir opções">
|
|
5
|
+
<i class="farm-btn__icon mdi mdi-dots-horizontal"></i>
|
|
6
|
+
</farm-btn>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<v-list dense class="pa-0">
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
<script>
|
|
32
32
|
import Vue from 'vue';
|
|
33
33
|
import { VMenu } from 'vuetify/lib/components/VMenu';
|
|
34
|
-
import { VBtn } from 'vuetify/lib/components/VBtn';
|
|
35
34
|
import { VIcon } from 'vuetify/lib/components/VIcon';
|
|
36
35
|
import { VList } from 'vuetify/lib/components/VList';
|
|
37
36
|
import VListItem from 'vuetify/lib/components/VList/VListItem';
|
|
38
37
|
import { VListItemContent, VListItemTitle } from 'vuetify/lib';
|
|
38
|
+
import DefaultButton from '../Buttons/DefaultButton';
|
|
39
39
|
|
|
40
40
|
export default Vue.extend({
|
|
41
41
|
name: 'farm-context-menu',
|
|
42
42
|
components: {
|
|
43
|
-
VBtn,
|
|
44
43
|
VIcon,
|
|
45
44
|
VMenu,
|
|
46
45
|
VList,
|
|
47
46
|
VListItem,
|
|
48
47
|
VListItemContent,
|
|
49
48
|
VListItemTitle,
|
|
49
|
+
'farm-btn': DefaultButton,
|
|
50
50
|
},
|
|
51
51
|
props: {
|
|
52
52
|
items: {
|
|
@@ -19,7 +19,7 @@ const colors = ['primary', 'secondary', 'error', 'gray', 'accent', 'yellow'];
|
|
|
19
19
|
|
|
20
20
|
export const ActiveButtons = () => ({
|
|
21
21
|
components: {
|
|
22
|
-
DefaultButton,
|
|
22
|
+
'farm-btn': DefaultButton,
|
|
23
23
|
},
|
|
24
24
|
data() {
|
|
25
25
|
return {
|
|
@@ -27,15 +27,15 @@ export const ActiveButtons = () => ({
|
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
29
|
template: `<div class="buttons-container">
|
|
30
|
-
<
|
|
30
|
+
<farm-btn v-for="color of colors":key="color" :color="color">
|
|
31
31
|
{{ color }}
|
|
32
|
-
</
|
|
32
|
+
</farm-btn>
|
|
33
33
|
</div>`,
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
export const OutlinedButtons = () => ({
|
|
37
37
|
components: {
|
|
38
|
-
DefaultButton,
|
|
38
|
+
'farm-btn': DefaultButton,
|
|
39
39
|
},
|
|
40
40
|
data() {
|
|
41
41
|
return {
|
|
@@ -43,15 +43,15 @@ export const OutlinedButtons = () => ({
|
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
45
|
template: `<div class="buttons-container">
|
|
46
|
-
<
|
|
46
|
+
<farm-btn v-for="color of colors":key="color" :color="color"outlined>
|
|
47
47
|
{{ color }}
|
|
48
|
-
</
|
|
48
|
+
</farm-btn>
|
|
49
49
|
</div>`,
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
export const DisabledButtons = () => ({
|
|
53
53
|
components: {
|
|
54
|
-
DefaultButton,
|
|
54
|
+
'farm-btn': DefaultButton,
|
|
55
55
|
},
|
|
56
56
|
data() {
|
|
57
57
|
return {
|
|
@@ -59,15 +59,15 @@ export const DisabledButtons = () => ({
|
|
|
59
59
|
};
|
|
60
60
|
},
|
|
61
61
|
template: `<div class="buttons-container">
|
|
62
|
-
<
|
|
62
|
+
<farm-btn v-for="color of colors":key="color" :color="color" disabled>
|
|
63
63
|
{{ color }}
|
|
64
|
-
</
|
|
64
|
+
</farm-btn>
|
|
65
65
|
</div>`,
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
export const Plain = () => ({
|
|
69
69
|
components: {
|
|
70
|
-
DefaultButton,
|
|
70
|
+
'farm-btn': DefaultButton,
|
|
71
71
|
},
|
|
72
72
|
data() {
|
|
73
73
|
return {
|
|
@@ -75,9 +75,56 @@ export const Plain = () => ({
|
|
|
75
75
|
};
|
|
76
76
|
},
|
|
77
77
|
template: `<div class="buttons-container">
|
|
78
|
-
<
|
|
78
|
+
<farm-btn v-for="color of colors":key="color" :color="color" plain>
|
|
79
79
|
{{ color }}
|
|
80
|
-
</
|
|
80
|
+
</farm-btn>
|
|
81
|
+
</div>`,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const Icons = () => ({
|
|
85
|
+
components: {
|
|
86
|
+
'farm-btn': DefaultButton,
|
|
87
|
+
},
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
colors,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
template: `<div class="buttons-container">
|
|
94
|
+
<h4>Full</h4>
|
|
95
|
+
<farm-btn v-for="color of colors":key="color" :color="color">
|
|
96
|
+
<v-icon>mdi-book</v-icon> book
|
|
97
|
+
</farm-btn>
|
|
98
|
+
|
|
99
|
+
<h4>Outlined</h4>
|
|
100
|
+
<farm-btn v-for="color of colors":key="color + 'outlined'" :color="color" outlined>
|
|
101
|
+
<v-icon>mdi-book</v-icon> book
|
|
102
|
+
</farm-btn>
|
|
103
|
+
|
|
104
|
+
<h4>Plain</h4>
|
|
105
|
+
<farm-btn v-for="color of colors":key="color + 'plain'" :color="color" plain>
|
|
106
|
+
<v-icon>mdi-book</v-icon> book
|
|
107
|
+
</farm-btn>
|
|
108
|
+
|
|
109
|
+
</div>`,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
export const Iconed = () => ({
|
|
113
|
+
components: {
|
|
114
|
+
'farm-btn': DefaultButton,
|
|
115
|
+
},
|
|
116
|
+
data() {
|
|
117
|
+
return {
|
|
118
|
+
colors,
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
template: `<div class="buttons-container">
|
|
122
|
+
<h4>Icon</h4>
|
|
123
|
+
<farm-btn icon v-for="color of colors":key="color" >
|
|
124
|
+
<v-icon :color="color">mdi-book</v-icon>
|
|
125
|
+
</farm-btn>
|
|
126
|
+
|
|
127
|
+
|
|
81
128
|
</div>`,
|
|
82
129
|
});
|
|
83
130
|
|
|
@@ -93,3 +140,9 @@ DisabledButtons.story = {
|
|
|
93
140
|
Plain.story = {
|
|
94
141
|
name: 'Plain',
|
|
95
142
|
};
|
|
143
|
+
Icons.story = {
|
|
144
|
+
name: 'Icons',
|
|
145
|
+
};
|
|
146
|
+
Iconed.story = {
|
|
147
|
+
name: 'Iconed',
|
|
148
|
+
};
|