@farm-investimentos/front-mfe-components-vue3 1.0.3 → 1.1.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 +4 -4
- 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 +4 -4
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +13 -13
- package/src/components/ButtonToggle/__tests__/{ButtonToggle.spec.js → ButtonToggle.spec.ts} +1 -1
- package/src/components/Buttons/ConfirmButton/__tests__/{ConfirmButton.spec.js → ConfirmButton.spec.ts} +1 -1
- package/src/components/Buttons/DangerButton/__tests__/{DangerButton.spec.js → DangerButton.spec.ts} +1 -1
- package/src/components/Buttons/DefaultButton/__tests__/DefaultButton.spec.ts +40 -0
- package/src/components/Buttons/ExportButton/__tests__/{ExportButton.spec.js → ExportButton.spec.ts} +11 -1
- package/src/components/Buttons/ImportButton/__tests__/{ImportButton.spec.js → ImportButton.spec.ts} +1 -1
- package/src/components/Buttons/MultiImportButton/MultiImportButton.vue +3 -3
- package/src/components/Buttons/MultiImportButton/__tests__/MultiImportButton.spec.ts +26 -0
- package/src/components/Buttons/RemoveButton/__tests__/{RemoveButton.spec.js → RemoveButton.spec.ts} +1 -1
- package/src/components/Buttons/ToggleButton/__tests__/ToggleButton.spec.ts +37 -0
- package/src/examples/Colors.stories.js +1 -1
- package/src/components/Buttons/DefaultButton/__tests__/DefaultButton.spec.js +0 -37
- package/src/components/Buttons/MultiImportButton/__tests__/MultiImportButton.spec.js +0 -15
- package/src/components/Buttons/ToggleButton/__tests__/ToggleButton.spec.js +0 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components-vue3",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"not dead"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@storybook/test": "^8.
|
|
35
|
+
"@storybook/test": "^8.2.9",
|
|
36
36
|
"@vuepic/vue-datepicker": "8.2.0",
|
|
37
37
|
"core-js": "3.33.1",
|
|
38
38
|
"text-mask-addons": "^3.8.0",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"@babel/core": "7.17.9",
|
|
46
46
|
"@babel/generator": "7.17.9",
|
|
47
47
|
"@farm-investimentos/front-mfe-libs-ts": "3.0.5",
|
|
48
|
-
"@storybook/addon-essentials": "^8.
|
|
49
|
-
"@storybook/addon-interactions": "^8.
|
|
50
|
-
"@storybook/addon-links": "^8.
|
|
51
|
-
"@storybook/addon-mdx-gfm": "^8.
|
|
52
|
-
"@storybook/blocks": "^8.
|
|
53
|
-
"@storybook/manager-api": "^8.
|
|
54
|
-
"@storybook/theming": "^8.
|
|
55
|
-
"@storybook/vue3": "^8.
|
|
56
|
-
"@storybook/vue3-vite": "^8.
|
|
48
|
+
"@storybook/addon-essentials": "^8.2.9",
|
|
49
|
+
"@storybook/addon-interactions": "^8.2.9",
|
|
50
|
+
"@storybook/addon-links": "^8.2.9",
|
|
51
|
+
"@storybook/addon-mdx-gfm": "^8.2.9",
|
|
52
|
+
"@storybook/blocks": "^8.2.9",
|
|
53
|
+
"@storybook/manager-api": "^8.2.9",
|
|
54
|
+
"@storybook/theming": "^8.2.9",
|
|
55
|
+
"@storybook/vue3": "^8.2.9",
|
|
56
|
+
"@storybook/vue3-vite": "^8.2.9",
|
|
57
57
|
"@tsconfig/node18": "^18.2.2",
|
|
58
58
|
"@types/jest": "^29.5.12",
|
|
59
59
|
"@types/node": "^18.17.17",
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"react-dom": "^18.2.0",
|
|
85
85
|
"sass": "~1.32.0",
|
|
86
86
|
"sass-loader": "10.4.1",
|
|
87
|
-
"storybook": "^8.
|
|
87
|
+
"storybook": "^8.2.9",
|
|
88
88
|
"style-loader": "^3.3.3",
|
|
89
89
|
"ts-jest": "^29.0.0",
|
|
90
90
|
"typescript": "~4.1.5",
|
|
91
91
|
"vite": "^4.4.9",
|
|
92
|
-
"vue": "3.4.
|
|
92
|
+
"vue": "3.4.37",
|
|
93
93
|
"vue-loader": "^16.8.3",
|
|
94
94
|
"vue-tsc": "^1.8.11",
|
|
95
95
|
"webpack-cli": "^5.1.4"
|
|
@@ -20,7 +20,7 @@ describe('ButtonToggle component', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
test('Default buttons value', () => {
|
|
23
|
-
const wrapper1 = shallowMount(ButtonToggle, {});
|
|
23
|
+
const wrapper1: any = shallowMount(ButtonToggle, {});
|
|
24
24
|
expect(wrapper1.vm.buttons.length).toEqual(0);
|
|
25
25
|
});
|
|
26
26
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import DefaultButton from '../DefaultButton.vue';
|
|
4
|
+
|
|
5
|
+
describe('DefaultButton component', () => {
|
|
6
|
+
let wrapper;
|
|
7
|
+
let component;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
wrapper = shallowMount(DefaultButton);
|
|
11
|
+
component = wrapper.vm;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('Created hook', () => {
|
|
15
|
+
expect(wrapper).toBeDefined();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe('computed properties', () => {
|
|
19
|
+
describe('isRound', () => {
|
|
20
|
+
it('get false', () => {
|
|
21
|
+
expect(component.isRound).toBeFalsy();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('get truthy', async () => {
|
|
25
|
+
await wrapper.setProps({ icon: true });
|
|
26
|
+
expect(component.isRound).toBeTruthy();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
describe('classes', () => {
|
|
30
|
+
it('get ', () => {
|
|
31
|
+
expect(component.classes).toBeDefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('get with props set', async () => {
|
|
35
|
+
await wrapper.setProps({ outlined: true, plain: true, disabled: true });
|
|
36
|
+
expect(component.classes['farm-btn--outlined']).toBeTruthy();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
package/src/components/Buttons/ExportButton/__tests__/{ExportButton.spec.js → ExportButton.spec.ts}
RENAMED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
|
-
import ExportButton from '../ExportButton';
|
|
3
|
+
import ExportButton from '../ExportButton.vue';
|
|
4
4
|
|
|
5
5
|
describe('ExportButton component', () => {
|
|
6
6
|
let wrapper;
|
|
7
|
+
let component;
|
|
7
8
|
|
|
8
9
|
beforeEach(() => {
|
|
9
10
|
wrapper = shallowMount(ExportButton);
|
|
11
|
+
component = wrapper.vm;
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
test('Created hook', () => {
|
|
13
15
|
expect(wrapper).toBeDefined();
|
|
14
16
|
});
|
|
17
|
+
|
|
18
|
+
describe('Methods', () => {
|
|
19
|
+
it('Should emit event', () => {
|
|
20
|
+
component.onClick();
|
|
21
|
+
expect(wrapper.emitted().onClick).toBeDefined();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
15
25
|
});
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
import { PropType } from 'vue';
|
|
26
26
|
|
|
27
27
|
export interface IImportOption {
|
|
28
|
-
title:
|
|
29
|
-
listenerKey:
|
|
28
|
+
title: string;
|
|
29
|
+
listenerKey: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export default {
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
};
|
|
47
47
|
},
|
|
48
48
|
methods: {
|
|
49
|
-
onClick(key) {
|
|
49
|
+
onClick(key: string) {
|
|
50
50
|
this.$emit('onClick', key);
|
|
51
51
|
},
|
|
52
52
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import MultiImportButton from '../MultiImportButton.vue';
|
|
4
|
+
|
|
5
|
+
describe('MultiImportButton component', () => {
|
|
6
|
+
let wrapper;
|
|
7
|
+
let component;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
wrapper = shallowMount(MultiImportButton);
|
|
11
|
+
component = wrapper.vm;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('Created hook', () => {
|
|
15
|
+
expect(wrapper).toBeDefined();
|
|
16
|
+
component = wrapper.vm;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('Methods', () => {
|
|
20
|
+
it('Should emit event', () => {
|
|
21
|
+
component.onClick();
|
|
22
|
+
expect(wrapper.emitted().onClick).toBeDefined();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import ToggleButton from '../ToggleButton.vue';
|
|
4
|
+
|
|
5
|
+
describe('ToggleButton component', () => {
|
|
6
|
+
let wrapper;
|
|
7
|
+
let component;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
wrapper = shallowMount(ToggleButton);
|
|
11
|
+
component = wrapper.vm;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('Created hook', () => {
|
|
15
|
+
expect(wrapper).toBeDefined();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe('Methods', () => {
|
|
19
|
+
it('Should handle click', () => {
|
|
20
|
+
component.onClick();
|
|
21
|
+
expect(component.open).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('computed properties', () => {
|
|
26
|
+
describe('prepend', () => {
|
|
27
|
+
it('get truthy', () => {
|
|
28
|
+
expect(component.prepend).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('get false', async () => {
|
|
32
|
+
await wrapper.setProps({ position: 'right' });
|
|
33
|
+
expect(component.isRound).toBeFalsy();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -87,7 +87,7 @@ export const CssVariables = () => ({
|
|
|
87
87
|
<farm-heading :type="5">{{ key }}</farm-heading>
|
|
88
88
|
<span :style="{ backgroundColor: baseThemeColors[key] }">Base <span>--farm-{{ key }}-base</span></span>
|
|
89
89
|
<span :style="{ backgroundColor: variationThemeColors[key + '-lighten'] }">Lighten<span>--farm-{{ key }}-lighten</span></span>
|
|
90
|
-
<span :style="{ backgroundColor: variationThemeColors[key + '-darken'], color: 'white' }">Darken
|
|
90
|
+
<span :style="{ backgroundColor: variationThemeColors[key + '-darken'], color: 'white' }">Darken <span>--farm-{{ key }}-darken</span></span>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
93
|
<div>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
|
|
3
|
-
import DefaultButton from '../DefaultButton.vue';
|
|
4
|
-
|
|
5
|
-
describe('DefaultButton component', () => {
|
|
6
|
-
let wrapper;
|
|
7
|
-
let component;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
wrapper = shallowMount(DefaultButton);
|
|
11
|
-
component = wrapper.vm;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('Created hook', () => {
|
|
15
|
-
expect(wrapper).toBeDefined();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe('computed properties', () => {
|
|
19
|
-
it('get isRound false', () => {
|
|
20
|
-
expect(component.isRound).toBeFalsy();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('get isRound truthy', async () => {
|
|
24
|
-
await wrapper.setProps({ icon: true });
|
|
25
|
-
expect(component.isRound).toBeTruthy();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('get classes', () => {
|
|
29
|
-
expect(component.classes).toBeDefined();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('get classes with props set', async () => {
|
|
33
|
-
await wrapper.setProps({ outlined: true, plain: true, disabled: true });
|
|
34
|
-
expect(component.classes['farm-btn--outlined']).toBeTruthy();
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
|
|
3
|
-
import MultiImportButton from '../MultiImportButton';
|
|
4
|
-
|
|
5
|
-
describe('MultiImportButton component', () => {
|
|
6
|
-
let wrapper;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
wrapper = shallowMount(MultiImportButton);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('Created hook', () => {
|
|
13
|
-
expect(wrapper).toBeDefined();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
|
|
3
|
-
import ToggleButton from '../ToggleButton';
|
|
4
|
-
|
|
5
|
-
describe('ToggleButton component', () => {
|
|
6
|
-
let wrapper;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
wrapper = shallowMount(ToggleButton);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('Created hook', () => {
|
|
13
|
-
expect(wrapper).toBeDefined();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
describe('Methods', () => {
|
|
17
|
-
it('Should handle click', () => {
|
|
18
|
-
wrapper.vm.onClick();
|
|
19
|
-
expect(wrapper.vm.open).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|