@farm-investimentos/front-mfe-components 11.3.2 → 11.4.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 +208 -124
- 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 +208 -124
- 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 +3 -3
- package/src/components/AlertBox/AlertBox.scss +0 -0
- package/src/components/AlertBox/AlertBox.stories.js +21 -0
- package/src/components/AlertBox/AlertBox.vue +16 -0
- package/src/components/AlertBox/__tests__/AlertBox.spec.js +20 -0
- package/src/components/AlertBox/index.ts +4 -0
- package/src/components/layout/Basic.stories.js +17 -9
- package/src/components/layout/Col/Col.scss +10 -2
- package/src/components/layout/Col/Col.stories.js +15 -1
- package/src/components/layout/Col/Col.vue +8 -0
- package/src/components/layout/Row/Row.scss +11 -5
- package/src/components/layout/Row/Row.stories.js +8 -8
- package/src/components/layout/Row/Row.vue +10 -2
- package/src/configurations/_variables.scss +4 -4
- package/src/configurations/flexVariables.ts +3 -2
- package/src/main.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.0",
|
|
4
4
|
"author": "farm investimentos",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/front-mfe-components.common.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"core-js": "^3.8.3",
|
|
25
|
-
"vue": "
|
|
25
|
+
"vue": "2.7.10",
|
|
26
26
|
"vuetify": "^2.4.5",
|
|
27
27
|
"vuetify-dialog": "^2.0.17"
|
|
28
28
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"storybook-addon-designs": "^6.2.1",
|
|
52
52
|
"typescript": "~4.1.5",
|
|
53
53
|
"v-mask": "^2.3.0",
|
|
54
|
-
"vue-template-compiler": "
|
|
54
|
+
"vue-template-compiler": "2.7.10"
|
|
55
55
|
},
|
|
56
56
|
"browserslist": [
|
|
57
57
|
"> 1%",
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import AlertBox from './AlertBox.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Feedback/AlertBox',
|
|
5
|
+
component: AlertBox,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Alert Box<br />
|
|
10
|
+
selector: <em>farm-alertbox</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-alertbox>alert box</farm-alertbox>',
|
|
21
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>alertbox</div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import Vue from 'vue';
|
|
7
|
+
|
|
8
|
+
export default Vue.extend({
|
|
9
|
+
name: 'farm-alertbox',
|
|
10
|
+
props: {},
|
|
11
|
+
setup() {},
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
<style lang="scss" scoped>
|
|
15
|
+
@import './AlertBox';
|
|
16
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import AlertBox from '../AlertBox';
|
|
3
|
+
|
|
4
|
+
describe('AlertBox component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(AlertBox, {});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('Created hook', () => {
|
|
12
|
+
expect(wrapper).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('mount component', () => {
|
|
16
|
+
it('renders correctly', () => {
|
|
17
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -17,6 +17,14 @@ export const Primary = () => ({
|
|
|
17
17
|
export const Structure = () => ({
|
|
18
18
|
template: `
|
|
19
19
|
<farm-container>
|
|
20
|
+
<farm-row>
|
|
21
|
+
<farm-col md="6" xs="12">
|
|
22
|
+
Main Filter
|
|
23
|
+
</farm-col>
|
|
24
|
+
<farm-col md="6" xs="12">
|
|
25
|
+
Botoes laterais
|
|
26
|
+
</farm-col>
|
|
27
|
+
</farm-row>
|
|
20
28
|
<farm-box>
|
|
21
29
|
Content<br />
|
|
22
30
|
Content<br />
|
|
@@ -25,20 +33,20 @@ export const Structure = () => ({
|
|
|
25
33
|
Content<br />
|
|
26
34
|
</farm-box>
|
|
27
35
|
<farm-row>
|
|
28
|
-
<
|
|
36
|
+
<farm-col md="6" lg="3">
|
|
29
37
|
coluna 1
|
|
30
|
-
</
|
|
31
|
-
<
|
|
38
|
+
</farm-col>
|
|
39
|
+
<farm-col md="6" lg="3">
|
|
32
40
|
coluna 2
|
|
33
|
-
</
|
|
34
|
-
<
|
|
41
|
+
</farm-col>
|
|
42
|
+
<farm-col md="6" lg="3">
|
|
35
43
|
coluna 3
|
|
36
|
-
</
|
|
37
|
-
<
|
|
44
|
+
</farm-col>
|
|
45
|
+
<farm-col md="6" lg="3">
|
|
38
46
|
coluna 4
|
|
39
|
-
</
|
|
47
|
+
</farm-col>
|
|
40
48
|
</farm-row>
|
|
41
|
-
<farm-row>
|
|
49
|
+
<farm-row extra-decrease="true">
|
|
42
50
|
<farm-container-footer>
|
|
43
51
|
Footer content
|
|
44
52
|
</farm-container-footer>
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
@import '../../../configurations/mixins.scss';
|
|
2
|
+
@import '../../../configurations/functions.scss';
|
|
2
3
|
|
|
3
4
|
.farm-col {
|
|
4
|
-
|
|
5
|
+
padding: 0 gutter('vuetify');
|
|
6
|
+
flex-basis: 0;
|
|
7
|
+
flex-grow: 1;
|
|
5
8
|
max-width: 100%;
|
|
6
|
-
padding: 0 24px;
|
|
7
9
|
|
|
8
10
|
&--no-gutters {
|
|
9
11
|
padding: 0;
|
|
10
12
|
}
|
|
13
|
+
|
|
14
|
+
@each $k in $aligns {
|
|
15
|
+
&#{'--align-' + $k} {
|
|
16
|
+
align-self: $k!important;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
11
19
|
}
|
|
12
20
|
|
|
13
21
|
@for $i from 1 through 12 {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Col from './Col.vue';
|
|
2
|
+
import { aligns } from '../../../configurations/flexVariables';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Layout/Col',
|
|
@@ -8,7 +9,7 @@ export default {
|
|
|
8
9
|
description: {
|
|
9
10
|
component: `Col<br />
|
|
10
11
|
selector: <em>farm-col</em><br />
|
|
11
|
-
<span style="color: var(--farm-
|
|
12
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
12
13
|
`,
|
|
13
14
|
},
|
|
14
15
|
},
|
|
@@ -142,3 +143,16 @@ export const NoGutters = () => ({
|
|
|
142
143
|
},
|
|
143
144
|
template: '<farm-col :no-gutters="true" :style="style">col</farm-col>',
|
|
144
145
|
});
|
|
146
|
+
|
|
147
|
+
export const AlignSelf = () => ({
|
|
148
|
+
data() {
|
|
149
|
+
return {
|
|
150
|
+
style,
|
|
151
|
+
aligns,
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
template: `
|
|
155
|
+
<farm-row style="height: 150px">
|
|
156
|
+
<farm-col :style="style" v-for="align in aligns" :key="align" :align-self="align">{{ align }}</farm-col>
|
|
157
|
+
</farm-row>`,
|
|
158
|
+
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
:is="tag"
|
|
4
4
|
:class="{
|
|
5
5
|
'farm-col': true,
|
|
6
|
+
[`farm-col--align-${alignSelf}`]: alignSelf,
|
|
6
7
|
[`farm-col--xl-${xl}`]: xl,
|
|
7
8
|
[`farm-col--lg-${lg}`]: lg,
|
|
8
9
|
[`farm-col--md-${md}`]: md,
|
|
@@ -66,6 +67,13 @@ export default Vue.extend({
|
|
|
66
67
|
type: Boolean,
|
|
67
68
|
default: false,
|
|
68
69
|
},
|
|
70
|
+
/**
|
|
71
|
+
* Applies the align-items css property.
|
|
72
|
+
*/
|
|
73
|
+
alignSelf: {
|
|
74
|
+
type: String as PropType<'start' | 'center' | 'end' | 'auto' | 'baseline' | 'stretch'>,
|
|
75
|
+
default: '',
|
|
76
|
+
},
|
|
69
77
|
},
|
|
70
78
|
inheritAttrs: true,
|
|
71
79
|
});
|
|
@@ -6,27 +6,33 @@
|
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-wrap: wrap;
|
|
8
8
|
flex: 1 1 auto;
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
margin: 0 -#{gutter('vuetify')};
|
|
10
11
|
|
|
11
12
|
@each $k in $aligns {
|
|
12
13
|
&#{'--align-' + $k} {
|
|
13
|
-
align-items: $k
|
|
14
|
+
align-items: $k!important;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
@each $k in $align-contents {
|
|
18
19
|
&#{'--align-content-' + $k} {
|
|
19
|
-
align-content: $k
|
|
20
|
+
align-content: $k!important;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
@each $k in $justifications {
|
|
24
25
|
&#{'--justify-' + $k} {
|
|
25
|
-
justify-content: $k
|
|
26
|
+
justify-content: $k!important;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
&--no-gutters {
|
|
30
|
+
&--no-default-gutters {
|
|
30
31
|
margin: 0;
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
&--extra-decrease {
|
|
35
|
+
margin: 0 -#{2 * gutter('vuetify')};
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
}
|
|
@@ -29,10 +29,10 @@ export const Align = () => ({
|
|
|
29
29
|
},
|
|
30
30
|
template: `<div>
|
|
31
31
|
<farm-row :align="align" v-for="align in aligns" :key="'align_' + align">
|
|
32
|
-
<
|
|
32
|
+
<farm-col md="6">
|
|
33
33
|
row align
|
|
34
34
|
{{ align }}
|
|
35
|
-
</
|
|
35
|
+
</farm-col>
|
|
36
36
|
</farm-row>
|
|
37
37
|
</div>`,
|
|
38
38
|
});
|
|
@@ -45,10 +45,10 @@ export const AlignContent = () => ({
|
|
|
45
45
|
},
|
|
46
46
|
template: `<div>
|
|
47
47
|
<farm-row :align-content="align" v-for="align in aligns" :key="'align-content-_' + align">
|
|
48
|
-
<
|
|
48
|
+
<farm-col md="6">
|
|
49
49
|
row align-content
|
|
50
50
|
{{ align }}
|
|
51
|
-
</
|
|
51
|
+
</farm-col>
|
|
52
52
|
</farm-row>
|
|
53
53
|
</div>`,
|
|
54
54
|
});
|
|
@@ -61,13 +61,13 @@ export const Justify = () => ({
|
|
|
61
61
|
},
|
|
62
62
|
template: `<div>
|
|
63
63
|
<farm-row :justify="k" v-for="k in justifications" :key="'justify-_' + k">
|
|
64
|
-
<
|
|
64
|
+
<farm-col md="6">
|
|
65
65
|
row justify {{ k }}
|
|
66
|
-
</
|
|
66
|
+
</farm-col>
|
|
67
67
|
</farm-row>
|
|
68
68
|
</div>`,
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
export const
|
|
72
|
-
template: '<farm-row :no-gutters="true">no gutters</farm-row>',
|
|
71
|
+
export const NoDefaultGutters = () => ({
|
|
72
|
+
template: '<farm-row :no-default-gutters="true">no gutters</farm-row>',
|
|
73
73
|
});
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
[`farm-row--align-${align}`]: align,
|
|
7
7
|
[`farm-row--align-content-${alignContent}`]: alignContent,
|
|
8
8
|
[`farm-row--justify-${justify}`]: justify,
|
|
9
|
-
'farm-row--no-gutters':
|
|
9
|
+
'farm-row--no-default-gutters': noDefaultGutters,
|
|
10
|
+
'farm-row--extra-decrease': extraDecrease,
|
|
10
11
|
}"
|
|
11
12
|
>
|
|
12
13
|
<slot></slot>
|
|
@@ -48,7 +49,14 @@ export default Vue.extend({
|
|
|
48
49
|
/**
|
|
49
50
|
* Remove default gutters
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
+
noDefaultGutters: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Extra decrease margin
|
|
58
|
+
*/
|
|
59
|
+
extraDecrease: {
|
|
52
60
|
type: Boolean,
|
|
53
61
|
default: false,
|
|
54
62
|
},
|
|
@@ -28,7 +28,7 @@ $fontSizes: (
|
|
|
28
28
|
|
|
29
29
|
$fontWeights: 100, 200, 300, 400, 500, 600, 700;
|
|
30
30
|
|
|
31
|
-
$aligns: start,
|
|
32
|
-
$align-contents: start,
|
|
33
|
-
$justifications: start,
|
|
34
|
-
$directions: row,
|
|
31
|
+
$aligns: start,center,end,auto,baseline,stretch;
|
|
32
|
+
$align-contents: start,center,end,space-between,space-around,stretch;
|
|
33
|
+
$justifications: start,center,end,space-between,space-around;
|
|
34
|
+
$directions: row,row-reverse,column,column-reverse;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const directions = ['row', 'row-reverse', 'column', 'column-reverse'];
|
|
2
|
-
const justifications = ['start', 'center', 'end', 'space-between', 'space-around'];
|
|
2
|
+
const justifications = ['start', 'center', 'end', 'auto', 'space-between', 'space-around'];
|
|
3
|
+
const aligns = ['start', 'center', 'end', 'auto', 'baseline', 'stretch'];
|
|
3
4
|
|
|
4
|
-
export { directions, justifications };
|
|
5
|
+
export { aligns, directions, justifications };
|