@farm-investimentos/front-mfe-components 2.3.0 → 2.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 +346 -53
- 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 +346 -53
- 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 +76 -76
- package/src/components/AlertReload/AlertReload.vue +34 -32
- package/src/components/AlertReload/__tests__/AlertReload.spec.js +18 -0
- package/src/components/Buttons/ExportButton/__tests__/ExportButton.spec.js +16 -0
- package/src/components/Buttons/ImportButton/__tests__/ImportButton.spec.js +16 -0
- package/src/components/Buttons/RemoveButton/__tests__/RemoveButton.spec.js +16 -0
- package/src/components/Buttons/ToggleButton/__tests__/ToggleButton.spec.js +14 -0
- package/src/components/CardContext/CardContext.scss +46 -0
- package/src/components/CardContext/CardContext.stories.js +47 -0
- package/src/components/CardContext/CardContext.vue +96 -0
- package/src/components/CardContext/__tests__/CardContext.spec.js +20 -0
- package/src/components/CardContext/index.js +3 -0
- package/src/components/IconBox/IconBox.scss +14 -0
- package/src/components/IconBox/IconBox.stories.js +13 -0
- package/src/components/IconBox/IconBox.vue +29 -0
- package/src/components/IconBox/__tests__/IconBox.spec.js +20 -0
- package/src/components/IconBox/index.js +3 -0
- package/src/components/MainFilter/__tests__/MainFilter.spec.js +23 -0
- package/src/components/ManagersList/__tests__/ManagersList.spec.js +27 -0
- package/src/components/Tabs/{Tabs.spec.js → __tests__/Tabs.spec.js} +1 -1
- package/src/main.js +5 -0
- package/src/components/MainFilter/MainFilter.spec.js +0 -43
package/package.json
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
2
|
+
"name": "@farm-investimentos/front-mfe-components",
|
|
3
|
+
"version": "2.4.0",
|
|
4
|
+
"author": "farm investimentos",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "./dist/front-mfe-components.common.js",
|
|
7
|
+
"unpkg": "dist/front-mfe-components.umd.min.js",
|
|
8
|
+
"jsdelivr": "dist/front-mfe-components.umd.min.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"serve": "vue-cli-service serve",
|
|
11
|
+
"build": "npm run build:components",
|
|
12
|
+
"build:components": "vue-cli-service build --target lib --name front-mfe-components src/main.js",
|
|
13
|
+
"lint": "vue-cli-service lint",
|
|
14
|
+
"storybook": "start-storybook -p 6006",
|
|
15
|
+
"build-storybook": "build-storybook",
|
|
16
|
+
"test:unit": "jest --updateSnapshot",
|
|
17
|
+
"test:coverage": "jest --updateSnapshot --coverage"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/*",
|
|
21
|
+
"src/*"
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@socheatsok78/storybook-addon-vuetify": "^0.1.8",
|
|
25
|
+
"@vue/cli-service-global": "^4.5.13",
|
|
26
|
+
"@vue/test-utils": "^1.3.0",
|
|
27
|
+
"core-js": "^3.6.5",
|
|
28
|
+
"sass": "~1.32.0",
|
|
29
|
+
"sass-loader": "^10.2.0",
|
|
30
|
+
"vue": "^2.6.11",
|
|
31
|
+
"vuetify": "^2.5.7"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@babel/core": "^7.14.8",
|
|
35
|
+
"@storybook/addon-actions": "^6.3.6",
|
|
36
|
+
"@storybook/addon-essentials": "^6.3.6",
|
|
37
|
+
"@storybook/addon-links": "^6.3.6",
|
|
38
|
+
"@storybook/vue": "^6.3.6",
|
|
39
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
|
40
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
41
|
+
"@vue/cli-plugin-unit-jest": "^4.5.15",
|
|
42
|
+
"@vue/cli-service": "~4.5.0",
|
|
43
|
+
"babel-eslint": "^10.1.0",
|
|
44
|
+
"babel-loader": "^8.2.2",
|
|
45
|
+
"eslint": "^6.7.2",
|
|
46
|
+
"eslint-plugin-vue": "^6.2.2",
|
|
47
|
+
"jest": "^25.5.4",
|
|
48
|
+
"jsdoc": "^3.6.7",
|
|
49
|
+
"vue-template-compiler": "^2.6.11",
|
|
50
|
+
"webpack-cli": "^4.9.0"
|
|
51
|
+
},
|
|
52
|
+
"eslintConfig": {
|
|
53
|
+
"root": true,
|
|
54
|
+
"env": {
|
|
55
|
+
"node": true
|
|
56
|
+
},
|
|
57
|
+
"extends": [
|
|
58
|
+
"plugin:vue/essential",
|
|
59
|
+
"eslint:recommended"
|
|
60
|
+
],
|
|
61
|
+
"parserOptions": {
|
|
62
|
+
"parser": "babel-eslint"
|
|
63
|
+
},
|
|
64
|
+
"rules": {}
|
|
65
|
+
},
|
|
66
|
+
"browserslist": [
|
|
67
|
+
"> 1%",
|
|
68
|
+
"last 2 versions",
|
|
69
|
+
"not dead"
|
|
70
|
+
],
|
|
71
|
+
"repository": {
|
|
72
|
+
"type": "git",
|
|
73
|
+
"url": "git://github.com/Farm-Investimentos/front-mfe-components.git"
|
|
74
|
+
},
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"@farm-investimentos:registry": "https://registry.npmjs.org"
|
|
77
|
+
}
|
|
78
78
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
<v-alert dense outlined type="error" class="farm-alert-reload">
|
|
3
|
+
<v-row align="center">
|
|
4
|
+
<v-col class="grow">
|
|
5
|
+
{{ label }}
|
|
6
|
+
</v-col>
|
|
7
|
+
<v-col class="shrink">
|
|
8
|
+
<v-btn color="secondary" class="ml-3" alt="Recarregar" @click="$emit('onClick')">
|
|
9
|
+
<v-icon class="v-icon__refresh">mdi-refresh</v-icon>
|
|
10
|
+
Recarregar</v-btn
|
|
11
|
+
>
|
|
12
|
+
</v-col>
|
|
13
|
+
</v-row>
|
|
14
|
+
</v-alert>
|
|
15
15
|
</template>
|
|
16
16
|
<script>
|
|
17
17
|
import VBtn from 'vuetify/lib/components/VBtn';
|
|
@@ -20,28 +20,30 @@ import VAlert from 'vuetify/lib/components/VAlert';
|
|
|
20
20
|
import { VRow, VCol } from 'vuetify/lib/components/VGrid';
|
|
21
21
|
|
|
22
22
|
export default {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
name: 'farm-alert-reload',
|
|
24
|
+
components: {
|
|
25
|
+
VBtn,
|
|
26
|
+
VIcon,
|
|
27
|
+
VAlert,
|
|
28
|
+
VRow,
|
|
29
|
+
VCol,
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
/**
|
|
33
|
+
* Label
|
|
34
|
+
*/
|
|
35
|
+
label: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: '',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
38
40
|
};
|
|
39
41
|
</script>
|
|
40
42
|
|
|
41
|
-
<style lang="scss">
|
|
43
|
+
<style lang="scss" scoped>
|
|
42
44
|
.v-btn {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
.v-icon.v-icon__refresh {
|
|
46
|
+
margin-right: 1rem;
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
49
|
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import AlertReload from '../AlertReload';
|
|
3
|
+
|
|
4
|
+
describe('AlertReload component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(AlertReload, {
|
|
9
|
+
propsData: {
|
|
10
|
+
managersString: 'a,b,c',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('Created hook', () => {
|
|
16
|
+
expect(wrapper).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import ExportButton from '../ExportButton';
|
|
3
|
+
|
|
4
|
+
describe('ExportButton component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(ExportButton);
|
|
10
|
+
component = wrapper.vm;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Created hook', () => {
|
|
14
|
+
expect(wrapper).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import ImportButton from '../ImportButton';
|
|
3
|
+
|
|
4
|
+
describe('ImportButton component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(ImportButton);
|
|
10
|
+
component = wrapper.vm;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Created hook', () => {
|
|
14
|
+
expect(wrapper).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import RemoveButton from '../RemoveButton';
|
|
3
|
+
|
|
4
|
+
describe('RemoveButton component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(RemoveButton);
|
|
10
|
+
component = wrapper.vm;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Created hook', () => {
|
|
14
|
+
expect(wrapper).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import ToggleButton from '../ToggleButton';
|
|
3
|
+
|
|
4
|
+
describe('ToggleButton component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(ToggleButton);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('Created hook', () => {
|
|
12
|
+
expect(wrapper).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.card-context {
|
|
2
|
+
width: 100%;
|
|
3
|
+
padding: 1.5rem;
|
|
4
|
+
background: #ffffff;
|
|
5
|
+
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16);
|
|
6
|
+
border-radius: 5px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.card-context-header {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 40px;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.card-context-content {
|
|
18
|
+
width: calc(100% - 56px);
|
|
19
|
+
height: 40px;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.card-context-title {
|
|
25
|
+
color: #5c5c5c;
|
|
26
|
+
margin: 0;
|
|
27
|
+
font-size: 0.75rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.card-context-title.bold {
|
|
31
|
+
font-size: 0.875rem;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
color: #1c1c1c;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.card-context-body {
|
|
37
|
+
width: 100%;
|
|
38
|
+
padding-top: 1rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.card-context-loding-or-error {
|
|
42
|
+
width: 100%;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import CardContext from './CardContext.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/CardContext',
|
|
5
|
+
component: CardContext,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Primary = () => ({
|
|
9
|
+
components: { CardContext },
|
|
10
|
+
template: `
|
|
11
|
+
<CardContext icon="mdi-currency-usd" title="Titulo do Card">
|
|
12
|
+
<p>Conteúdo do Card</p>
|
|
13
|
+
</CardContext>
|
|
14
|
+
`,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const Secondary = () => ({
|
|
18
|
+
components: { CardContext },
|
|
19
|
+
template: `
|
|
20
|
+
<CardContext icon="mdi-currency-usd" title="Titulo do Card" bold>
|
|
21
|
+
<p>Conteúdo do Card</p>
|
|
22
|
+
</CardContext>
|
|
23
|
+
`,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const WithLoading = () => ({
|
|
27
|
+
components: { CardContext },
|
|
28
|
+
template: `
|
|
29
|
+
<CardContext icon="mdi-currency-usd" title="Titulo do Card" isLoading>
|
|
30
|
+
<p>Conteúdo do Card</p>
|
|
31
|
+
</CardContext>
|
|
32
|
+
`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const WithError = () => ({
|
|
36
|
+
components: { CardContext },
|
|
37
|
+
template: `
|
|
38
|
+
<CardContext icon="mdi-currency-usd" title="Titulo do Card" isError>
|
|
39
|
+
<p>Conteúdo do Card</p>
|
|
40
|
+
</CardContext>
|
|
41
|
+
`,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
Primary.storyName = 'Básico';
|
|
45
|
+
Secondary.storyName = 'Título em Bold';
|
|
46
|
+
WithLoading.storyName = 'Com Loading';
|
|
47
|
+
WithError.storyName = 'Com Erro';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="card-context">
|
|
3
|
+
<div class="card-context-header" v-if="isSuccess">
|
|
4
|
+
<IconBox :icon="icon" />
|
|
5
|
+
<div class="card-context-content">
|
|
6
|
+
<p :class="isBold">
|
|
7
|
+
{{ title }}
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="card-context-body" v-if="isSuccess">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="card-context-loding-or-error" v-if="isLoading">
|
|
15
|
+
<Loader size="small" />
|
|
16
|
+
</div>
|
|
17
|
+
<div class="card-context-loding-or-error" v-if="isError">
|
|
18
|
+
<AlertReload :label="errorLabel" @onClick="$emit('onLoad')" />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import Vue from 'vue';
|
|
25
|
+
import { Loader, AlertReload, IconBox } from '../../main.js';
|
|
26
|
+
|
|
27
|
+
export default Vue.extend({
|
|
28
|
+
name: 'farm-card-context',
|
|
29
|
+
components: {
|
|
30
|
+
IconBox,
|
|
31
|
+
AlertReload,
|
|
32
|
+
Loader,
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
/**
|
|
36
|
+
* Title
|
|
37
|
+
*/
|
|
38
|
+
title: {
|
|
39
|
+
type: String,
|
|
40
|
+
require: true,
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Set bold text
|
|
44
|
+
*/
|
|
45
|
+
bold: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Icon (from Material Icons)
|
|
51
|
+
* Example: mdi-chart-bar
|
|
52
|
+
*/
|
|
53
|
+
icon: {
|
|
54
|
+
type: String,
|
|
55
|
+
require: true,
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Show loader
|
|
59
|
+
*/
|
|
60
|
+
isLoading: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Show error alert
|
|
66
|
+
*/
|
|
67
|
+
isError: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* Label to be shown in error alert
|
|
73
|
+
*/
|
|
74
|
+
errorLabel: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'Ocorreu um erro',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
computed: {
|
|
81
|
+
isBold() {
|
|
82
|
+
if (this.bold) {
|
|
83
|
+
return 'card-context-title bold';
|
|
84
|
+
}
|
|
85
|
+
return 'card-context-title';
|
|
86
|
+
},
|
|
87
|
+
isSuccess() {
|
|
88
|
+
return !this.isLoading && !this.isError;
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style lang="sass" scoped>
|
|
95
|
+
@import './CardContext.scss'
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import CardContext from '../CardContext';
|
|
3
|
+
|
|
4
|
+
describe('CardContext component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(CardContext);
|
|
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
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.icon-box {
|
|
2
|
+
width: 40px;
|
|
3
|
+
height: 40px;
|
|
4
|
+
padding: 6px;
|
|
5
|
+
background: linear-gradient(0deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), #00b493;
|
|
6
|
+
border-radius: 5px;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.icon i {
|
|
13
|
+
font-size: 1.875em;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import IconBox from './IconBox.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/IconBox',
|
|
5
|
+
component: IconBox,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Primary = () => ({
|
|
9
|
+
components: { IconBox },
|
|
10
|
+
template: '<IconBox icon="mdi-currency-usd" />',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
Primary.storyName = 'Básico';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="icon-box">
|
|
3
|
+
<div class="icon">
|
|
4
|
+
<v-icon color="secondary">{{ icon }}</v-icon>
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import Vue from 'vue';
|
|
11
|
+
import VIcon from 'vuetify/lib/components/VIcon';
|
|
12
|
+
|
|
13
|
+
export default Vue.extend({
|
|
14
|
+
name: 'farm-icon-box',
|
|
15
|
+
components: {
|
|
16
|
+
VIcon,
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
icon: {
|
|
20
|
+
type: String,
|
|
21
|
+
require: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="sass" scoped>
|
|
28
|
+
@import './IconBox.scss'
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import IconBox from '../IconBox';
|
|
3
|
+
|
|
4
|
+
describe('IconBox component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(IconBox);
|
|
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
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import MainFilter from '../MainFilter';
|
|
3
|
+
|
|
4
|
+
describe('MainFilter component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(MainFilter);
|
|
10
|
+
component = wrapper.vm;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Created hook', () => {
|
|
14
|
+
expect(wrapper).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('methods', () => {
|
|
18
|
+
it('Should emit event', () => {
|
|
19
|
+
component.onFilterClick();
|
|
20
|
+
expect(wrapper.emitted().onClick).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import ManagersList from '../ManagersList';
|
|
3
|
+
|
|
4
|
+
describe('ManagersList component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(ManagersList, {
|
|
10
|
+
propsData: {
|
|
11
|
+
managersString: 'a,b,c',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
component = wrapper.vm;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('Created hook', () => {
|
|
18
|
+
expect(wrapper).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('Computed properties', () => {
|
|
22
|
+
it('Should have managers array', () => {
|
|
23
|
+
expect(component.managers).toBeInstanceOf(Array);
|
|
24
|
+
expect(component.managers.length).toEqual(3);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|