@farm-investimentos/front-mfe-components 15.4.3 → 15.4.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 +167 -131
- 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 +167 -131
- 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/Logger/Logger.scss +40 -4
- package/src/components/Logger/Logger.stories.js +92 -0
- package/src/components/Logger/Logger.vue +20 -2
- package/src/components/Logger/LoggerItem/LoggerItem.scss +57 -20
- package/src/components/Logger/LoggerItem/LoggerItem.vue +6 -1
package/package.json
CHANGED
|
@@ -1,9 +1,41 @@
|
|
|
1
|
+
$colorsList: success, error, info;
|
|
2
|
+
|
|
1
3
|
.logger {
|
|
2
4
|
display: flex;
|
|
3
5
|
flex-direction: column;
|
|
4
|
-
}
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
&--horizontal {
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
gap: 48px;
|
|
10
|
+
|
|
11
|
+
.logger__divider {
|
|
12
|
+
width: auto;
|
|
13
|
+
min-width: 192px;
|
|
14
|
+
height: 1px;
|
|
15
|
+
margin: 16px -96px 0 -96px;
|
|
16
|
+
|
|
17
|
+
@each $fromColor in $colorsList {
|
|
18
|
+
@each $toColor in $colorsList {
|
|
19
|
+
&.logger__divider--#{$fromColor}-to-#{$toColor} {
|
|
20
|
+
background: linear-gradient(
|
|
21
|
+
to right,
|
|
22
|
+
var(--farm-#{$fromColor}-base),
|
|
23
|
+
var(--farm-#{$toColor}-base)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--left-aligned {
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
|
|
34
|
+
.logger__divider {
|
|
35
|
+
margin: 16px -32px 0 -160px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
7
39
|
|
|
8
40
|
.logger__divider {
|
|
9
41
|
height: 40px;
|
|
@@ -13,8 +45,12 @@ $colorsList: success, error, info;
|
|
|
13
45
|
@each $fromColor in $colorsList {
|
|
14
46
|
@each $toColor in $colorsList {
|
|
15
47
|
&.logger__divider--#{$fromColor}-to-#{$toColor} {
|
|
16
|
-
background: linear-gradient(
|
|
48
|
+
background: linear-gradient(
|
|
49
|
+
to bottom,
|
|
50
|
+
var(--farm-#{$fromColor}-base),
|
|
51
|
+
var(--farm-#{$toColor}-base)
|
|
52
|
+
);
|
|
17
53
|
}
|
|
18
54
|
}
|
|
19
55
|
}
|
|
20
|
-
}
|
|
56
|
+
}
|
|
@@ -134,3 +134,95 @@ export const Details = () => ({
|
|
|
134
134
|
},
|
|
135
135
|
template: `<farm-logger :items="items" />`,
|
|
136
136
|
});
|
|
137
|
+
|
|
138
|
+
export const Horizontal = () => ({
|
|
139
|
+
data() {
|
|
140
|
+
return {
|
|
141
|
+
items: [
|
|
142
|
+
{
|
|
143
|
+
message: 'Recusado entre as pré elegíveis',
|
|
144
|
+
userName: 'Cleyton Rasta',
|
|
145
|
+
formattedDate: '13/06/2022 20:40',
|
|
146
|
+
status: 'error',
|
|
147
|
+
details() {
|
|
148
|
+
alert('Ver Detalhes');
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
message: 'Aprovado entre as pré elegíveis',
|
|
153
|
+
userName: 'Cleyton Rasta',
|
|
154
|
+
formattedDate: '13/06/2022 20:40',
|
|
155
|
+
status: 'success',
|
|
156
|
+
details() {
|
|
157
|
+
alert('Ver Detalhes');
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
message: 'Aprovado entre as pré elegíveis',
|
|
162
|
+
userName: 'Cleyton Rasta',
|
|
163
|
+
formattedDate: '13/06/2022 20:40',
|
|
164
|
+
status: 'success',
|
|
165
|
+
details() {
|
|
166
|
+
alert('Ver Detalhes');
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
message: 'Recusado entre as pré elegíveis',
|
|
171
|
+
userName: 'Cleyton Rasta',
|
|
172
|
+
formattedDate: '13/06/2022 20:40',
|
|
173
|
+
status: 'error',
|
|
174
|
+
details() {
|
|
175
|
+
alert('Ver Detalhes');
|
|
176
|
+
},
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
template: `<farm-logger :items="items" :vertical="false" />`,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
export const HorizontalLeftAligned = () => ({
|
|
185
|
+
data() {
|
|
186
|
+
return {
|
|
187
|
+
items: [
|
|
188
|
+
{
|
|
189
|
+
message: 'Recusado entre as pré elegíveis',
|
|
190
|
+
userName: 'Cleyton Rasta',
|
|
191
|
+
formattedDate: '13/06/2022 20:40',
|
|
192
|
+
status: 'error',
|
|
193
|
+
details() {
|
|
194
|
+
alert('Ver Detalhes');
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
message: 'Aprovado entre as pré elegíveis',
|
|
199
|
+
userName: 'Cleyton Rasta',
|
|
200
|
+
formattedDate: '13/06/2022 20:40',
|
|
201
|
+
status: 'success',
|
|
202
|
+
details() {
|
|
203
|
+
alert('Ver Detalhes');
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
message: 'Aprovado entre as pré elegíveis',
|
|
208
|
+
userName: 'Cleyton Rasta',
|
|
209
|
+
formattedDate: '13/06/2022 20:40',
|
|
210
|
+
status: 'success',
|
|
211
|
+
details() {
|
|
212
|
+
alert('Ver Detalhes');
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
message: 'Recusado entre as pré elegíveis',
|
|
217
|
+
userName: 'Cleyton Rasta',
|
|
218
|
+
formattedDate: '13/06/2022 20:40',
|
|
219
|
+
status: 'error',
|
|
220
|
+
details() {
|
|
221
|
+
alert('Ver Detalhes');
|
|
222
|
+
},
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
template: `<farm-logger :items="items" :vertical="false" align="left" />`,
|
|
228
|
+
});
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section
|
|
2
|
+
<section
|
|
3
|
+
class="logger"
|
|
4
|
+
:class="{ 'logger--horizontal': !vertical, 'logger--left-aligned': align === 'left' }"
|
|
5
|
+
>
|
|
3
6
|
<template v-for="(item, index) in items">
|
|
4
|
-
<farm-logger-item
|
|
7
|
+
<farm-logger-item
|
|
8
|
+
:item="item"
|
|
9
|
+
:key="`logger_item_${index}`"
|
|
10
|
+
:class="{
|
|
11
|
+
'logger__item--horizontal': !vertical,
|
|
12
|
+
'logger__item--left-aligned': align === 'left',
|
|
13
|
+
}"
|
|
14
|
+
/>
|
|
5
15
|
<div
|
|
6
16
|
v-if="hasDivider(index)"
|
|
7
17
|
:class="{
|
|
@@ -24,6 +34,14 @@ export default defineComponent({
|
|
|
24
34
|
* List of logger items
|
|
25
35
|
*/
|
|
26
36
|
items: { required: true, type: Array as PropType<Array<ILoggerItem>> },
|
|
37
|
+
/**
|
|
38
|
+
* Vertical or horizontal
|
|
39
|
+
*/
|
|
40
|
+
vertical: { type: Boolean, default: true },
|
|
41
|
+
/**
|
|
42
|
+
* Items alignment
|
|
43
|
+
*/
|
|
44
|
+
align: { type: String as PropType<'center' | 'left'>, default: 'center' },
|
|
27
45
|
},
|
|
28
46
|
methods: {
|
|
29
47
|
hasDivider(index: number): boolean {
|
|
@@ -19,6 +19,35 @@
|
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
21
|
padding-left: 8px;
|
|
22
|
+
|
|
23
|
+
.logger__item--spacing-bottom {
|
|
24
|
+
margin-bottom: 8px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
> .farm-icon {
|
|
29
|
+
border: 1px solid var(--farm-stroke-base);
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
min-width: 32px;
|
|
32
|
+
min-height: 32px;
|
|
33
|
+
width: 32px;
|
|
34
|
+
height: 32px;
|
|
35
|
+
display: block;
|
|
36
|
+
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
|
|
41
|
+
border-color: var(--farm-neutral-base);
|
|
42
|
+
background-color: var(--farm-neutral-base);
|
|
43
|
+
|
|
44
|
+
&:before {
|
|
45
|
+
color: white;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
> .farm-btn.logger__item--button {
|
|
50
|
+
margin-left: 8px;
|
|
22
51
|
}
|
|
23
52
|
|
|
24
53
|
&.logger__item--error {
|
|
@@ -32,31 +61,39 @@
|
|
|
32
61
|
&.logger__item--info {
|
|
33
62
|
@include loggerMessage(var(--farm-info-base));
|
|
34
63
|
}
|
|
35
|
-
}
|
|
36
64
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
height: 32px;
|
|
42
|
-
display: block;
|
|
65
|
+
&--horizontal {
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
height: auto;
|
|
68
|
+
width: 158px;
|
|
43
69
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
70
|
+
> div {
|
|
71
|
+
align-items: center;
|
|
72
|
+
text-align: center;
|
|
73
|
+
gap: 8px;
|
|
74
|
+
margin-bottom: 8px;
|
|
75
|
+
padding-left: 0;
|
|
47
76
|
|
|
48
|
-
|
|
49
|
-
|
|
77
|
+
.logger__item--spacing-bottom {
|
|
78
|
+
margin-bottom: 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
50
81
|
|
|
51
|
-
|
|
52
|
-
|
|
82
|
+
> .farm-icon {
|
|
83
|
+
margin-bottom: 8px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
> .farm-btn.logger__item--button {
|
|
87
|
+
margin-left: 0;
|
|
88
|
+
}
|
|
53
89
|
}
|
|
54
|
-
}
|
|
55
90
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
91
|
+
&--left-aligned {
|
|
92
|
+
align-items: flex-start;
|
|
59
93
|
|
|
60
|
-
|
|
61
|
-
|
|
94
|
+
> div {
|
|
95
|
+
align-items: flex-start;
|
|
96
|
+
text-align: left;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
62
99
|
}
|
|
@@ -28,12 +28,13 @@
|
|
|
28
28
|
variation="regular"
|
|
29
29
|
color="black"
|
|
30
30
|
colorVariation="50"
|
|
31
|
+
class="logger__item--user"
|
|
31
32
|
v-if="item.userName"
|
|
32
33
|
>
|
|
33
34
|
<farm-icon color="black" variation="50" size="xs">account-circle</farm-icon>
|
|
34
35
|
{{ item.userName }}
|
|
35
36
|
</farm-bodysmall>
|
|
36
|
-
<farm-caption variation="regular">
|
|
37
|
+
<farm-caption variation="regular" v-if="item.extraMessage">
|
|
37
38
|
{{ item.extraMessage }}
|
|
38
39
|
</farm-caption>
|
|
39
40
|
</div>
|
|
@@ -61,6 +62,10 @@ export default defineComponent({
|
|
|
61
62
|
* Logger item
|
|
62
63
|
*/
|
|
63
64
|
item: { required: true, type: Object as PropType<ILoggerItem> },
|
|
65
|
+
/**
|
|
66
|
+
* Vertical or horizontal
|
|
67
|
+
*/
|
|
68
|
+
vertical: { type: Boolean, default: true },
|
|
64
69
|
customIcon: { type: String, required: false },
|
|
65
70
|
},
|
|
66
71
|
methods: {
|