@farm-investimentos/front-mfe-components 5.2.0 → 5.2.3
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 +90 -80
- 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 +90 -80
- 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 +6 -6
- package/src/components/Logger/Logger.scss +1 -3
- package/src/components/Logger/Logger.stories.js +5 -0
- package/src/components/Logger/LoggerItem/LoggerItem.scss +5 -12
- package/src/components/Logger/LoggerItem/LoggerItem.stories.js +4 -0
- package/src/components/Stepper/StepperHeader/StepperHeader.scss +41 -48
- package/src/components/Stepper/StepperHeader/StepperHeader.stories.js +6 -0
- package/src/components/Stepper/StepperHeader/StepperHeader.vue +39 -32
- package/src/components/Stepper/StepperHeader/__tests__/StepperHeader.spec.js +7 -0
- package/src/examples/Modal.stories.js +53 -1
- package/src/examples/Stepper/StepperHeader.stories.js +21 -1
- package/src/scss/DefaultModal.scss +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"author": "farm investimentos",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/front-mfe-components.common.js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"vuetify-dialog": "^2.0.17"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@socheatsok78/storybook-addon-vuetify": "^0.1.
|
|
31
|
-
"@storybook/addon-actions": "^6.
|
|
32
|
-
"@storybook/addon-essentials": "^6.
|
|
33
|
-
"@storybook/addon-links": "^6.
|
|
34
|
-
"@storybook/vue": "^6.
|
|
30
|
+
"@socheatsok78/storybook-addon-vuetify": "^0.1.9",
|
|
31
|
+
"@storybook/addon-actions": "^6.5.8",
|
|
32
|
+
"@storybook/addon-essentials": "^6.5.8",
|
|
33
|
+
"@storybook/addon-links": "^6.5.8",
|
|
34
|
+
"@storybook/vue": "^6.5.8",
|
|
35
35
|
"@types/jest": "^24.9.1",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
|
37
37
|
"@typescript-eslint/parser": "^4.18.0",
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
$line-color : #D6D6D6;
|
|
2
|
-
$fore-color: #858585;
|
|
3
|
-
$current-color: #5089DE;
|
|
4
|
-
$success-color: #00B493;
|
|
5
|
-
$error-color: #EA5455;
|
|
6
|
-
|
|
7
1
|
@mixin loggerMessage($color) {
|
|
8
2
|
>i.mdi {
|
|
9
3
|
border-color: $color;
|
|
@@ -28,19 +22,18 @@ $error-color: #EA5455;
|
|
|
28
22
|
}
|
|
29
23
|
|
|
30
24
|
&.logger__item--error {
|
|
31
|
-
@include loggerMessage(
|
|
25
|
+
@include loggerMessage(var(--v-error-base));
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
&.logger__item--success {
|
|
35
|
-
@include loggerMessage(
|
|
29
|
+
@include loggerMessage(var(--v-secondary-base));
|
|
36
30
|
|
|
37
31
|
}
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
|
|
41
|
-
|
|
42
35
|
.logger__item>i.mdi {
|
|
43
|
-
border: 1px solid
|
|
36
|
+
border: 1px solid var(--v-gray-lighten2);
|
|
44
37
|
border-radius: 50%;
|
|
45
38
|
width: 32px;
|
|
46
39
|
height: 32px;
|
|
@@ -50,8 +43,8 @@ $error-color: #EA5455;
|
|
|
50
43
|
align-items: center;
|
|
51
44
|
justify-content: center;
|
|
52
45
|
|
|
53
|
-
border-color:
|
|
54
|
-
background-color:
|
|
46
|
+
border-color: var(--v-gray-lighten1);
|
|
47
|
+
background-color: var(--v-gray-lighten1);
|
|
55
48
|
|
|
56
49
|
&:before {
|
|
57
50
|
font-size: 16px;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
$step-height: 64px;
|
|
2
|
-
|
|
3
|
-
$
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
|
|
3
|
+
@mixin stepperHeaderStepColor($color) {
|
|
4
|
+
i.mdi {
|
|
5
|
+
background-color: $color;
|
|
6
|
+
border-color: $color;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
i.mdi:before {
|
|
10
|
+
color: white;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.horizontal-step-size .stepper__header--vertical {
|
|
15
|
+
width: 160px;
|
|
16
|
+
}
|
|
8
17
|
|
|
9
18
|
.stepper__header {
|
|
10
19
|
display: flex;
|
|
@@ -17,43 +26,25 @@ $vertical-step-width: 160px;
|
|
|
17
26
|
flex-direction: column;
|
|
18
27
|
align-items: center;
|
|
19
28
|
justify-items: center;
|
|
20
|
-
color:
|
|
29
|
+
color: var(--v-gray-lighten1);
|
|
21
30
|
font-size: 14px;
|
|
22
31
|
font-weight: 700;
|
|
23
32
|
|
|
24
33
|
&.stepper__header-step--previous {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
i.mdi {
|
|
28
|
-
border-color: $previous-color;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
i.mdi:before {
|
|
32
|
-
color: $previous-color;
|
|
33
|
-
}
|
|
34
|
+
@include stepperHeaderStepColor(var(--v-secondary-base));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
&.stepper__header-step--current {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
i.mdi {
|
|
40
|
-
border-color: $current-color;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
i.mdi:before {
|
|
44
|
-
color: $current-color;
|
|
45
|
-
}
|
|
38
|
+
@include stepperHeaderStepColor(var(--v-accent-base));
|
|
46
39
|
}
|
|
47
40
|
|
|
48
41
|
&.stepper__header-step--error {
|
|
49
|
-
|
|
42
|
+
@include stepperHeaderStepColor(var(--v-error-base));
|
|
43
|
+
}
|
|
50
44
|
|
|
45
|
+
&.stepper__header-step--next {
|
|
51
46
|
i.mdi {
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
i.mdi:before {
|
|
56
|
-
color: $error-color;
|
|
47
|
+
color: var(--v-gray-lighten1);
|
|
57
48
|
}
|
|
58
49
|
}
|
|
59
50
|
|
|
@@ -63,8 +54,6 @@ $vertical-step-width: 160px;
|
|
|
63
54
|
}
|
|
64
55
|
}
|
|
65
56
|
|
|
66
|
-
|
|
67
|
-
|
|
68
57
|
.stepper__divider--horizontal {
|
|
69
58
|
display: block;
|
|
70
59
|
flex: 1 1 0px;
|
|
@@ -73,25 +62,23 @@ $vertical-step-width: 160px;
|
|
|
73
62
|
|
|
74
63
|
border: none;
|
|
75
64
|
margin: 16px -16px 0;
|
|
76
|
-
background:
|
|
65
|
+
background: var(--v-gray-lighten2);
|
|
77
66
|
|
|
78
67
|
&.stepper__divider--previous {
|
|
79
|
-
background:
|
|
68
|
+
background: var(--v-secondary-base);
|
|
80
69
|
}
|
|
81
70
|
|
|
82
71
|
&.stepper__divider--previous-to-current {
|
|
83
|
-
background: linear-gradient(to right,
|
|
72
|
+
background: linear-gradient(to right, var(--v-secondary-base), var(--v-accent-base));
|
|
84
73
|
}
|
|
85
74
|
|
|
86
75
|
&.stepper__divider--previous-to-error {
|
|
87
|
-
background: linear-gradient(to right,
|
|
76
|
+
background: linear-gradient(to right, var(--v-secondary-base), var(--v-error-base));
|
|
88
77
|
}
|
|
89
78
|
}
|
|
90
79
|
|
|
91
80
|
&.stepper__header--vertical {
|
|
92
81
|
display: block;
|
|
93
|
-
width: $vertical-step-width;
|
|
94
|
-
|
|
95
82
|
|
|
96
83
|
div.stepper__header-step {
|
|
97
84
|
width: 100%;
|
|
@@ -104,8 +91,10 @@ $vertical-step-width: 160px;
|
|
|
104
91
|
}
|
|
105
92
|
|
|
106
93
|
span {
|
|
107
|
-
display:
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
108
96
|
width: calc(100% - 40px);
|
|
97
|
+
height: 32px;
|
|
109
98
|
clear: none;
|
|
110
99
|
float: left;
|
|
111
100
|
margin-top: 0;
|
|
@@ -120,37 +109,41 @@ $vertical-step-width: 160px;
|
|
|
120
109
|
height: 32px;
|
|
121
110
|
margin: -24px 0 8px 16px;
|
|
122
111
|
width: 1px;
|
|
123
|
-
background-color:
|
|
112
|
+
background-color: var(--v-gray-lighten2);
|
|
124
113
|
|
|
125
114
|
&.stepper__divider--previous {
|
|
126
|
-
background-color:
|
|
115
|
+
background-color: var(--v-secondary-base);
|
|
127
116
|
}
|
|
128
117
|
|
|
129
118
|
&.stepper__divider--previous-to-current {
|
|
130
|
-
background: linear-gradient(to bottom,
|
|
119
|
+
background: linear-gradient(to bottom,
|
|
120
|
+
var(--v-secondary-base),
|
|
121
|
+
var(--v-accent-base));
|
|
131
122
|
}
|
|
132
123
|
|
|
133
124
|
&.stepper__divider--previous-to-error {
|
|
134
|
-
background: linear-gradient(to bottom,
|
|
125
|
+
background: linear-gradient(to bottom,
|
|
126
|
+
var(--v-secondary-base),
|
|
127
|
+
var(--v-error-base));
|
|
135
128
|
}
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
131
|
}
|
|
139
132
|
|
|
140
133
|
i.mdi {
|
|
141
|
-
border: 1px solid
|
|
134
|
+
border: 1px solid var(--v-gray-lighten2);
|
|
142
135
|
border-radius: 50%;
|
|
143
136
|
width: 32px;
|
|
144
137
|
height: 32px;
|
|
145
|
-
display: block;
|
|
146
138
|
|
|
147
139
|
display: flex;
|
|
148
140
|
align-items: center;
|
|
149
141
|
justify-content: center;
|
|
150
|
-
|
|
142
|
+
color: white;
|
|
143
|
+
font-style: normal;
|
|
151
144
|
|
|
152
145
|
&:before {
|
|
153
146
|
font-size: 16px;
|
|
154
|
-
color:
|
|
147
|
+
color: var(--v-gray-lighten1);
|
|
155
148
|
}
|
|
156
149
|
}
|
|
@@ -11,6 +11,10 @@ export default {
|
|
|
11
11
|
`,
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
|
+
design: {
|
|
15
|
+
type: 'figma',
|
|
16
|
+
url: 'https://www.figma.com/file/XDwOALFs1s9uXPFVE7BP9B/%E2%9C%8D---Cr%C3%A9dito?node-id=4029%3A28672',
|
|
17
|
+
},
|
|
14
18
|
viewMode: 'docs',
|
|
15
19
|
},
|
|
16
20
|
};
|
|
@@ -32,3 +36,5 @@ export const Primary = () => ({
|
|
|
32
36
|
});
|
|
33
37
|
|
|
34
38
|
Primary.storyName = 'Básico';
|
|
39
|
+
|
|
40
|
+
//
|
|
@@ -1,39 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
'stepper__header-step': true,
|
|
7
|
-
'stepper__header-step--current': isStepCurrent(index),
|
|
8
|
-
'stepper__header-step--previous': isStepPrevious(index),
|
|
9
|
-
'stepper__header-step--error': isStepError(index),
|
|
10
|
-
}"
|
|
11
|
-
:key="step.label"
|
|
12
|
-
>
|
|
13
|
-
<i
|
|
2
|
+
<div class="horizontal-step-size">
|
|
3
|
+
<section :class="{ stepper__header: true, 'stepper__header--vertical': vertical }">
|
|
4
|
+
<template v-for="(step, index) in steps">
|
|
5
|
+
<div
|
|
14
6
|
:class="{
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
'stepper__header-step': true,
|
|
8
|
+
'stepper__header-step--current': isStepCurrent(index),
|
|
9
|
+
'stepper__header-step--previous': isStepPrevious(index),
|
|
10
|
+
'stepper__header-step--error': isStepError(index),
|
|
11
|
+
'stepper__header-step--next': isStepNext(index),
|
|
17
12
|
}"
|
|
18
|
-
|
|
13
|
+
:key="step.label"
|
|
14
|
+
>
|
|
15
|
+
<i
|
|
16
|
+
:class="{
|
|
17
|
+
mdi: true,
|
|
18
|
+
['mdi-' + step.icon]: true,
|
|
19
|
+
}"
|
|
20
|
+
>
|
|
21
|
+
{{ step.icon ? '' : index + 1 }}
|
|
22
|
+
</i>
|
|
23
|
+
<span>
|
|
24
|
+
{{ step.label }}
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div
|
|
28
|
+
:class="{
|
|
29
|
+
'stepper__divider--horizontal': !vertical,
|
|
30
|
+
'stepper__divider--vertical': vertical,
|
|
31
|
+
'stepper__divider--previous': isStepPrevious(index),
|
|
32
|
+
'stepper__divider--previous-to-current': isStepPreviousToCurrent(index),
|
|
33
|
+
'stepper__divider--previous-to-error': isStepPreviousToError(index),
|
|
34
|
+
}"
|
|
35
|
+
v-if="hasDivider(index)"
|
|
36
|
+
:key="'divider_' + step.label"
|
|
19
37
|
/>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</div>
|
|
24
|
-
<div
|
|
25
|
-
:class="{
|
|
26
|
-
'stepper__divider--horizontal': !vertical,
|
|
27
|
-
'stepper__divider--vertical': vertical,
|
|
28
|
-
'stepper__divider--previous': isStepPrevious(index),
|
|
29
|
-
'stepper__divider--previous-to-current': isStepPreviousToCurrent(index),
|
|
30
|
-
'stepper__divider--previous-to-error': isStepPreviousToError(index),
|
|
31
|
-
}"
|
|
32
|
-
v-if="hasDivider(index)"
|
|
33
|
-
:key="'divider_' + step.label"
|
|
34
|
-
/>
|
|
35
|
-
</template>
|
|
36
|
-
</section>
|
|
38
|
+
</template>
|
|
39
|
+
</section>
|
|
40
|
+
</div>
|
|
37
41
|
</template>
|
|
38
42
|
<script lang="ts">
|
|
39
43
|
import Vue, { PropType } from 'vue';
|
|
@@ -87,6 +91,9 @@ export default Vue.extend({
|
|
|
87
91
|
this.isStepError(index + 1)
|
|
88
92
|
);
|
|
89
93
|
},
|
|
94
|
+
isStepNext(index: number): boolean {
|
|
95
|
+
return index + 1 > this.currentStep;
|
|
96
|
+
},
|
|
90
97
|
},
|
|
91
98
|
});
|
|
92
99
|
</script>
|
|
@@ -43,5 +43,12 @@ describe('StepperHeader component', () => {
|
|
|
43
43
|
expect(component.hasDivider(4)).toBeFalsy();
|
|
44
44
|
expect(component.hasDivider(1)).toBeTruthy();
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
it('Should check if step is next', () => {
|
|
48
|
+
expect(component.isStepNext(4)).toBeTruthy();
|
|
49
|
+
expect(component.isStepNext(1)).toBeFalsy();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
|
|
46
53
|
});
|
|
47
54
|
});
|
|
@@ -58,6 +58,54 @@ export const ModalSmall = () => ({
|
|
|
58
58
|
</div>`,
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
+
export const ModalExtremeSmall = () => ({
|
|
62
|
+
components: {
|
|
63
|
+
DialogHeader,
|
|
64
|
+
DialogFooter,
|
|
65
|
+
},
|
|
66
|
+
data() {
|
|
67
|
+
return {
|
|
68
|
+
showModalSmall: false,
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
template: `<div>
|
|
72
|
+
<v-dialog content-class="modal-default modal-default-x-small" v-model="showModalSmall">
|
|
73
|
+
<DialogHeader title="Exemplo" @onClose="showModalSmall = false;" />
|
|
74
|
+
<v-main class="pa-6 pt-12">
|
|
75
|
+
Place dialog content here!
|
|
76
|
+
</v-main>
|
|
77
|
+
<DialogFooter :hasConfirm="false" @onClose="showModalSmall = false;" />
|
|
78
|
+
</v-dialog>
|
|
79
|
+
<v-btn @click="showModalSmall = true;" color="secondary">
|
|
80
|
+
Clique para abrir
|
|
81
|
+
</v-btn>
|
|
82
|
+
</div>`,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const ModalMedium = () => ({
|
|
86
|
+
components: {
|
|
87
|
+
DialogHeader,
|
|
88
|
+
DialogFooter,
|
|
89
|
+
},
|
|
90
|
+
data() {
|
|
91
|
+
return {
|
|
92
|
+
showModalSmall: false,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
template: `<div>
|
|
96
|
+
<v-dialog content-class="modal-default modal-default-md" v-model="showModalSmall">
|
|
97
|
+
<DialogHeader title="Exemplo" @onClose="showModalSmall = false;" />
|
|
98
|
+
<v-main class="pa-6 pt-12">
|
|
99
|
+
Place dialog content here!
|
|
100
|
+
</v-main>
|
|
101
|
+
<DialogFooter :hasConfirm="false" @onClose="showModalSmall = false;" />
|
|
102
|
+
</v-dialog>
|
|
103
|
+
<v-btn @click="showModalSmall = true;" color="secondary">
|
|
104
|
+
Clique para abrir
|
|
105
|
+
</v-btn>
|
|
106
|
+
</div>`,
|
|
107
|
+
});
|
|
108
|
+
|
|
61
109
|
export const ModalScrollVertical = () => ({
|
|
62
110
|
components: {
|
|
63
111
|
DialogHeader,
|
|
@@ -181,4 +229,8 @@ ModalSmall.story = {
|
|
|
181
229
|
|
|
182
230
|
ModalScrollVertical.storyName = 'Rolagem vertical';
|
|
183
231
|
|
|
184
|
-
ModalScrollHorizontal.storyName = 'Rolagem horizontal';
|
|
232
|
+
ModalScrollHorizontal.storyName = 'Rolagem horizontal';
|
|
233
|
+
|
|
234
|
+
ModalExtremeSmall.storyName = 'Extra pequeno';
|
|
235
|
+
|
|
236
|
+
ModalMedium.storyName = 'Médio';
|
|
@@ -62,7 +62,24 @@ export const VerticalError = () => ({
|
|
|
62
62
|
currentStep: 3,
|
|
63
63
|
};
|
|
64
64
|
},
|
|
65
|
-
template:
|
|
65
|
+
template:
|
|
66
|
+
'<StepperHeader :steps="steps" :currentStep="currentStep" vertical :errorCurrentStepStatus="true" />',
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const Numbers = () => ({
|
|
70
|
+
components: { StepperHeader },
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
steps: [
|
|
74
|
+
{ label: 'Solicitação de limite' },
|
|
75
|
+
{ label: 'Lista impeditiva' },
|
|
76
|
+
{ label: 'Lista pré-elegíveis' },
|
|
77
|
+
{ label: 'Fila de compliance' },
|
|
78
|
+
],
|
|
79
|
+
currentStep: 2,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
template: '<StepperHeader :steps="steps" :currentStep="currentStep" />',
|
|
66
83
|
});
|
|
67
84
|
|
|
68
85
|
Primary.story = {
|
|
@@ -77,3 +94,6 @@ Error.story = {
|
|
|
77
94
|
VerticalError.story = {
|
|
78
95
|
name: 'Vertical Error',
|
|
79
96
|
};
|
|
97
|
+
Numbers.story = {
|
|
98
|
+
name: 'Numbers',
|
|
99
|
+
};
|
|
@@ -72,7 +72,16 @@
|
|
|
72
72
|
max-width: calc(392px - 2rem);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
.v-dialog.modal-default.modal-default-md {
|
|
77
|
+
max-width: calc(600px - 2rem);
|
|
78
|
+
|
|
79
|
+
header {
|
|
80
|
+
max-width: calc(600px - 2rem);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
75
83
|
}
|
|
84
|
+
|
|
76
85
|
@media screen and (max-width: 960px) {
|
|
77
86
|
.v-dialog.modal-default header {
|
|
78
87
|
max-width: calc(100% - 3rem);
|