@farm-investimentos/front-mfe-components 3.3.0 → 3.4.2
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 +159 -32
- 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 +159 -32
- 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.scss +26 -0
- package/src/components/ChipInviteStatus/ChipInviteStatus.stories.js +21 -0
- package/src/components/ChipInviteStatus/ChipInviteStatus.vue +75 -0
- package/src/components/ChipInviteStatus/__tests__/ChipInviteStatus.spec.js +36 -0
- package/src/components/ChipInviteStatus/index.js +4 -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 +1 -1
- package/src/components/MultipleSelectShortener/MultipleSelectShortener.stories.js +1 -1
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +1 -1
- 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.stories.js +1 -1
- 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/main.js +1 -0
- package/src/scss/Status-Chip.scss +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.2",
|
|
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
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.status-chip--onboarding {
|
|
2
|
+
font-weight: bold;
|
|
3
|
+
.status-chip-yellow {
|
|
4
|
+
color: black;
|
|
5
|
+
}
|
|
6
|
+
&.status-chip.status-chip-accent {
|
|
7
|
+
color: var(--v-accent-base) !important;
|
|
8
|
+
border: 2px solid var(--v-accent-base) !important;
|
|
9
|
+
background-color: white !important;
|
|
10
|
+
}
|
|
11
|
+
&.status-chip.status-chip-yellow {
|
|
12
|
+
color: black !important;
|
|
13
|
+
border: 2px solid var(--v-yellow-lighten1) !important;
|
|
14
|
+
background-color: white !important;
|
|
15
|
+
}
|
|
16
|
+
&.status-chip.status-chip-error {
|
|
17
|
+
color: var(--v-error-base) !important;
|
|
18
|
+
border: 2px solid var(--v-error-base) !important;
|
|
19
|
+
background-color: white !important;
|
|
20
|
+
}
|
|
21
|
+
&.status-chip.status-chip-success {
|
|
22
|
+
color: var(--v-secondary-base) !important;
|
|
23
|
+
border: 2px solid var(--v-success-base) !important;
|
|
24
|
+
background-color: white !important;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ChipInviteStatus from './ChipInviteStatus.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'API/Onboarding/ChipInviteStatus',
|
|
5
|
+
component: ChipInviteStatus,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Primary = () => ({
|
|
9
|
+
components: { ChipInviteStatus },
|
|
10
|
+
template: `<div style="width: 120px;">
|
|
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" />
|
|
18
|
+
</div>`,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
Primary.storyName = 'Básico';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-chip
|
|
3
|
+
small
|
|
4
|
+
:class="
|
|
5
|
+
`status-chip ${
|
|
6
|
+
isFull ? 'status-chip--fullwidth' : ''
|
|
7
|
+
} status-chip-${color} status-chip--onboarding`
|
|
8
|
+
"
|
|
9
|
+
>
|
|
10
|
+
<span :class="`${textColor}--text`">
|
|
11
|
+
{{ label }}
|
|
12
|
+
</span>
|
|
13
|
+
</v-chip>
|
|
14
|
+
</template>
|
|
15
|
+
<script>
|
|
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
|
+
|
|
27
|
+
const StatusColor = {
|
|
28
|
+
10: 'secondary',
|
|
29
|
+
11: 'yellow',
|
|
30
|
+
12: 'yellow',
|
|
31
|
+
13: 'success',
|
|
32
|
+
14: 'error',
|
|
33
|
+
15: 'accent',
|
|
34
|
+
16: 'primary',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
import VChip from 'vuetify/lib/components/VChip/';
|
|
38
|
+
|
|
39
|
+
export default Vue.extend({
|
|
40
|
+
name: 'farm-chip-invite',
|
|
41
|
+
components: {
|
|
42
|
+
VChip,
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
/**
|
|
46
|
+
* Invite status
|
|
47
|
+
*/
|
|
48
|
+
status: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 10,
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Full width (from parent)
|
|
54
|
+
*/
|
|
55
|
+
isFull: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
textColor() {
|
|
62
|
+
return this.status === 10 || this.status === 16 ? '' : StatusColor[this.status];
|
|
63
|
+
},
|
|
64
|
+
color() {
|
|
65
|
+
return !this.status ? '' : StatusColor[this.status];
|
|
66
|
+
},
|
|
67
|
+
label() {
|
|
68
|
+
return StatusLabel[this.status];
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
</script>
|
|
73
|
+
<style lang="scss" scoped>
|
|
74
|
+
@import './ChipInviteStatus.scss';
|
|
75
|
+
</style>
|
|
@@ -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,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
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
2
|
+
import { DialogHeader, DialogFooter } from '../main';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Examples/Modal',
|
|
6
|
+
decorators: [withDesign],
|
|
7
|
+
component: Modal,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Modal = () => ({
|
|
11
|
+
/*
|
|
12
|
+
* How to create the default modal following FARM's Design System guideline
|
|
13
|
+
*/
|
|
14
|
+
components: {
|
|
15
|
+
DialogHeader,
|
|
16
|
+
DialogFooter,
|
|
17
|
+
},
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
inputVal: false,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
template: `<div>
|
|
24
|
+
<v-dialog content-class="modal-default" v-model="inputVal">
|
|
25
|
+
<DialogHeader title="Exemplo" @onClose="inputVal = false;" />
|
|
26
|
+
<v-main class="pa-6 pt-12">
|
|
27
|
+
Place dialog content here!
|
|
28
|
+
</v-main>
|
|
29
|
+
<DialogFooter :hasConfirm="false" @onClose="inputVal = false;" />
|
|
30
|
+
</v-dialog>
|
|
31
|
+
<v-btn @click="inputVal = true;" color="secondary">
|
|
32
|
+
Clique para abrir
|
|
33
|
+
</v-btn>
|
|
34
|
+
</div>`,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Modal.storyName = 'Básico';
|
|
38
|
+
Modal.story = {
|
|
39
|
+
name: 'Básico',
|
|
40
|
+
parameters: {
|
|
41
|
+
design: {
|
|
42
|
+
type: 'figma',
|
|
43
|
+
url:
|
|
44
|
+
'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=2867%3A10594',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|