@farm-investimentos/front-mfe-components 3.4.0 → 3.4.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 +111 -75
- 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 +111 -75
- 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 +2 -2
- package/src/components/AlertReload/AlertReload.stories.js +1 -1
- package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +1 -1
- package/src/components/Buttons/DangerButton/DangerButton.stories.js +1 -1
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +1 -1
- package/src/components/Buttons/ExportButton/ExportButton.stories.js +1 -1
- package/src/components/Buttons/ImportButton/ImportButton.stories.js +1 -1
- package/src/components/Buttons/MultiImportButton/MultiImportButton.stories.js +1 -1
- package/src/components/Buttons/RemoveButton/RemoveButton.stories.js +1 -1
- package/src/components/Buttons/ToggleButton/ToggleButton.stories.js +1 -1
- package/src/components/CardContext/CardContext.stories.js +1 -1
- package/src/components/ChipInviteStatus/ChipInviteStatus.stories.js +8 -6
- package/src/components/ChipInviteStatus/ChipInviteStatus.vue +24 -10
- package/src/components/ChipInviteStatus/__tests__/ChipInviteStatus.spec.js +36 -0
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +1 -1
- package/src/components/DataTableHeader/DataTableHeader.stories.js +1 -1
- package/src/components/DataTablePaginator/DataTablePaginator.stories.js +25 -5
- package/src/components/DatePicker/DatePicker.stories.js +1 -1
- package/src/components/DefaultTextField/DefaultTextField.stories.js +1 -1
- package/src/components/DialogFooter/DialogFooter.stories.js +1 -1
- package/src/components/DialogHeader/DialogHeader.stories.js +1 -1
- package/src/components/FilePicker/FilePicker.stories.js +1 -1
- package/src/components/IconBox/IconBox.stories.js +1 -1
- package/src/components/Loader/Loader.stories.js +1 -1
- package/src/components/Logos/OriginatorLogo/OriginatorLogo.stories.js +1 -1
- package/src/components/Logos/ProductLogo/ProductLogo.stories.js +1 -1
- package/src/components/MainFilter/MainFilter.stories.js +1 -1
- package/src/components/ManagersList/ManagersList.stories.js +1 -1
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +47 -4
- package/src/components/ModalPromptUser/__tests__/ModalPromptUser.spec.js +27 -0
- package/src/components/MultipleSelectShortener/MultipleSelectShortener.stories.js +1 -1
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +3 -3
- package/src/components/PromptUserToConfirm/__tests__/PromptUserToConfirm.spec.js +24 -0
- package/src/components/RangeDatePicker/RangeDatePicker.stories.js +23 -4
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.stories.js +1 -1
- package/src/components/SelectModalOptions/SelectModalOptions.stories.js +1 -1
- package/src/components/TableContextMenu/TableContextMenu.scss +3 -0
- package/src/components/TableContextMenu/TableContextMenu.stories.js +40 -3
- package/src/components/TableContextMenu/TableContextMenu.vue +3 -0
- package/src/components/Tabs/Tabs.stories.js +1 -1
- package/src/examples/Modal.stories.js +47 -0
- package/src/examples/Table.stories.js +84 -0
- package/src/scss/ButtonOverrides.scss +7 -1
- package/src/scss/DefaultModal.scss +66 -64
- package/src/scss/DialogOverrides.scss +86 -0
- package/src/scss/FormOverrides.scss +46 -6
- package/src/scss/VMenuOverrides.scss +5 -0
- package/src/scss/utils.scss +138 -99
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
4
4
|
"author": "farm investimentos",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/front-mfe-components.common.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint": "^6.7.2",
|
|
46
46
|
"eslint-plugin-vue": "^6.2.2",
|
|
47
47
|
"jest": "^25.5.4",
|
|
48
|
-
"
|
|
48
|
+
"storybook-addon-designs": "^6.2.1",
|
|
49
49
|
"vue-template-compiler": "^2.6.11",
|
|
50
50
|
"webpack-cli": "^4.9.0"
|
|
51
51
|
},
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import ChipInviteStatus from './ChipInviteStatus.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
4
|
+
title: 'API/Onboarding/ChipInviteStatus',
|
|
5
5
|
component: ChipInviteStatus,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
9
|
components: { ChipInviteStatus },
|
|
10
10
|
template: `<div style="width: 120px;">
|
|
11
|
-
<ChipInviteStatus status="
|
|
12
|
-
<ChipInviteStatus status="
|
|
13
|
-
<ChipInviteStatus status="
|
|
14
|
-
<ChipInviteStatus status="
|
|
15
|
-
<ChipInviteStatus status="
|
|
11
|
+
<ChipInviteStatus :status="10" />
|
|
12
|
+
<ChipInviteStatus :status="11" />
|
|
13
|
+
<ChipInviteStatus :status="12" />
|
|
14
|
+
<ChipInviteStatus :status="13" />
|
|
15
|
+
<ChipInviteStatus :status="14" />
|
|
16
|
+
<ChipInviteStatus :status="15" />
|
|
17
|
+
<ChipInviteStatus :status="16" />
|
|
16
18
|
</div>`,
|
|
17
19
|
});
|
|
18
20
|
|
|
@@ -14,26 +14,40 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
<script>
|
|
16
16
|
import Vue from 'vue';
|
|
17
|
+
const StatusLabel = {
|
|
18
|
+
10: 'CONVIDAR',
|
|
19
|
+
11: 'CONVIDADO',
|
|
20
|
+
12: 'INCOMPLETO',
|
|
21
|
+
13: 'CONCLUÍDO',
|
|
22
|
+
14: 'FALHA/ERRO',
|
|
23
|
+
15: 'EM ANÁLISE',
|
|
24
|
+
16: 'EM ANDAMENTO',
|
|
25
|
+
};
|
|
26
|
+
|
|
17
27
|
const StatusColor = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
10: 'secondary',
|
|
29
|
+
11: 'yellow',
|
|
30
|
+
12: 'yellow',
|
|
31
|
+
13: 'success',
|
|
32
|
+
14: 'error',
|
|
33
|
+
15: 'accent',
|
|
34
|
+
16: 'primary',
|
|
23
35
|
};
|
|
24
36
|
|
|
25
37
|
import VChip from 'vuetify/lib/components/VChip/';
|
|
26
38
|
|
|
27
39
|
export default Vue.extend({
|
|
28
40
|
name: 'farm-chip-invite',
|
|
29
|
-
components:
|
|
41
|
+
components: {
|
|
42
|
+
VChip,
|
|
43
|
+
},
|
|
30
44
|
props: {
|
|
31
45
|
/**
|
|
32
46
|
* Invite status
|
|
33
47
|
*/
|
|
34
48
|
status: {
|
|
35
|
-
type:
|
|
36
|
-
default:
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 10,
|
|
37
51
|
},
|
|
38
52
|
/**
|
|
39
53
|
* Full width (from parent)
|
|
@@ -45,13 +59,13 @@ export default Vue.extend({
|
|
|
45
59
|
},
|
|
46
60
|
computed: {
|
|
47
61
|
textColor() {
|
|
48
|
-
return this.status ===
|
|
62
|
+
return this.status === 10 || this.status === 16 ? '' : StatusColor[this.status];
|
|
49
63
|
},
|
|
50
64
|
color() {
|
|
51
65
|
return !this.status ? '' : StatusColor[this.status];
|
|
52
66
|
},
|
|
53
67
|
label() {
|
|
54
|
-
return this.status;
|
|
68
|
+
return StatusLabel[this.status];
|
|
55
69
|
},
|
|
56
70
|
},
|
|
57
71
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import ChipInviteStatus from '../ChipInviteStatus.vue';
|
|
3
|
+
describe('ChipInviteStatus component', () => {
|
|
4
|
+
let wrapper;
|
|
5
|
+
let component;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(ChipInviteStatus, {
|
|
9
|
+
propsData: {
|
|
10
|
+
status: 10,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
component = wrapper.vm;
|
|
14
|
+
});
|
|
15
|
+
test('ChipInviteStatus created', () => {
|
|
16
|
+
expect(wrapper).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('mount component', () => {
|
|
20
|
+
it('renders correctly', () => {
|
|
21
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('Computed properties', () => {
|
|
26
|
+
it('Should have text color', () => {
|
|
27
|
+
expect(component.textColor).toBeDefined();
|
|
28
|
+
});
|
|
29
|
+
it('Should have color', () => {
|
|
30
|
+
expect(component.color).toBeDefined();
|
|
31
|
+
});
|
|
32
|
+
it('Should have label', () => {
|
|
33
|
+
expect(component.label).toBeDefined();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import DataTablePaginator from './DataTablePaginator.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
4
|
+
title: 'API/Table/DataTablePaginator',
|
|
5
5
|
component: DataTablePaginator,
|
|
6
6
|
};
|
|
7
7
|
|
|
@@ -26,7 +26,27 @@ export const CustomPerPage = () => ({
|
|
|
26
26
|
'<DataTablePaginator :perPageOptions="[1, 2, 4, 12, 27]" :totalPages="19" :page="1" />',
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const parameters = {
|
|
30
|
+
design: {
|
|
31
|
+
type: 'figma',
|
|
32
|
+
url:
|
|
33
|
+
'https://www.figma.com/file/1f84J4m1IBghWhozQvdyyt/%E2%9C%8D---Design-System?node-id=1503%3A921',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
Primary.story = {
|
|
38
|
+
name: 'Básico',
|
|
39
|
+
parameters,
|
|
40
|
+
};
|
|
41
|
+
Secondary.story = {
|
|
42
|
+
name: 'Sem limite por páginas',
|
|
43
|
+
parameters,
|
|
44
|
+
};
|
|
45
|
+
Disabled.story = {
|
|
46
|
+
name: 'Desabilitado',
|
|
47
|
+
parameters,
|
|
48
|
+
};
|
|
49
|
+
CustomPerPage.story = {
|
|
50
|
+
name: 'Lista de registros por página customizada',
|
|
51
|
+
parameters,
|
|
52
|
+
};
|
|
@@ -1,14 +1,57 @@
|
|
|
1
1
|
import ModalPromptUser from './ModalPromptUser.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
4
|
+
title: 'API/ModalPromptUser',
|
|
5
5
|
component: ModalPromptUser,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
9
|
components: { ModalPromptUser },
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
showPrompt: true,
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
template: `<div>
|
|
16
|
+
<ModalPromptUser match="CONFIRMAR" title="Título" subtitle="Digite CONFIRMAR para habilitar" v-model="showPrompt" />
|
|
17
|
+
<v-btn color="secondary" @click="showPrompt = true;">
|
|
18
|
+
reabrir
|
|
19
|
+
</v-btn>
|
|
20
|
+
</div>`,
|
|
21
|
+
});
|
|
22
|
+
export const Error = () => ({
|
|
23
|
+
components: { ModalPromptUser },
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
showPrompt: true,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
template: `<div>
|
|
30
|
+
<ModalPromptUser match="REMOVER" title="Título" subtitle="Digite REMOVER para habilitar" v-model="showPrompt" confirmColor="error" confirmLabel="Remover" />
|
|
31
|
+
<v-btn color="secondary" @click="showPrompt = true;">
|
|
32
|
+
reabrir
|
|
33
|
+
</v-btn>
|
|
34
|
+
</div>`,
|
|
12
35
|
});
|
|
13
36
|
|
|
14
|
-
Primary.
|
|
37
|
+
Primary.story = {
|
|
38
|
+
name: 'Básico',
|
|
39
|
+
parameters: {
|
|
40
|
+
design: {
|
|
41
|
+
type: 'figma',
|
|
42
|
+
url:
|
|
43
|
+
'https://www.figma.com/file/1f84J4m1IBghWhozQvdyyt/%E2%9C%8D---Design-System?node-id=1%3A7',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
Error.story = {
|
|
49
|
+
name: 'Error',
|
|
50
|
+
parameters: {
|
|
51
|
+
design: {
|
|
52
|
+
type: 'figma',
|
|
53
|
+
url:
|
|
54
|
+
'https://www.figma.com/file/1f84J4m1IBghWhozQvdyyt/%E2%9C%8D---Design-System?node-id=1%3A7',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import ModalPromptUser from '../ModalPromptUser';
|
|
3
|
+
|
|
4
|
+
describe('ModalPromptUser component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(ModalPromptUser, {
|
|
9
|
+
propsData: {
|
|
10
|
+
value: false,
|
|
11
|
+
title: '',
|
|
12
|
+
subtitle: '',
|
|
13
|
+
match: 'CONFIRMAR',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('Created hook', () => {
|
|
19
|
+
expect(wrapper).toBeDefined();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('mount component', () => {
|
|
23
|
+
it('renders correctly', () => {
|
|
24
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import PromptUserToConfirm from './PromptUserToConfirm';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
4
|
+
title: 'API/PromptUserToConfirm',
|
|
5
5
|
component: PromptUserToConfirm,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
9
|
components: { PromptUserToConfirm },
|
|
10
|
-
template: '<PromptUserToConfirm
|
|
10
|
+
template: '<div style="max-width: 320px"><PromptUserToConfirm /></div>',
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export const CustomTitle = () => ({
|
|
14
14
|
components: { PromptUserToConfirm },
|
|
15
|
-
template: '<PromptUserToConfirm title="Custom"
|
|
15
|
+
template: '<div style="max-width: 320px"><PromptUserToConfirm title="Custom" /></div>',
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
Primary.storyName = 'Básico';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import PromptUserToConfirm from '../PromptUserToConfirm';
|
|
3
|
+
|
|
4
|
+
describe('PromptUserToConfirm component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(PromptUserToConfirm, {
|
|
9
|
+
propsData: {
|
|
10
|
+
value: false,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('Created hook', () => {
|
|
16
|
+
expect(wrapper).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('mount component', () => {
|
|
20
|
+
it('renders correctly', () => {
|
|
21
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
1
2
|
import RangeDatePicker from './RangeDatePicker';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
|
-
title: '
|
|
5
|
+
title: 'API/Form/RangeDatePicker',
|
|
5
6
|
component: RangeDatePicker,
|
|
7
|
+
decorators: [withDesign],
|
|
6
8
|
};
|
|
7
9
|
|
|
8
10
|
export const Primary = () => ({
|
|
@@ -20,6 +22,23 @@ export const MinMax = () => ({
|
|
|
20
22
|
template: `<RangeDatePicker inputId="input-custom-id" min="2022-01-17" max="2022-02-15" />`,
|
|
21
23
|
});
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const parameters = {
|
|
26
|
+
design: {
|
|
27
|
+
type: 'figma',
|
|
28
|
+
url:
|
|
29
|
+
'https://www.figma.com/file/1f84J4m1IBghWhozQvdyyt/%E2%9C%8D---Design-System?node-id=1503%3A810',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
Primary.story = {
|
|
34
|
+
name: 'Básico',
|
|
35
|
+
parameters
|
|
36
|
+
};
|
|
37
|
+
Secondary.story = {
|
|
38
|
+
name: 'Data Inicial',
|
|
39
|
+
parameters
|
|
40
|
+
};
|
|
41
|
+
MinMax.story = {
|
|
42
|
+
name: 'Data Mínima e Máxima',
|
|
43
|
+
parameters
|
|
44
|
+
};
|