@farm-investimentos/front-mfe-components 3.4.1 → 3.4.4
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/README.md +2 -0
- package/dist/front-mfe-components.common.js +348 -265
- 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 +348 -265
- 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 +11 -15
- package/src/components/AlertReload/AlertReload.stories.js +1 -1
- package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +11 -1
- package/src/components/Buttons/DangerButton/DangerButton.stories.js +11 -1
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +11 -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 +21 -9
- package/src/components/ChipInviteStatus/__tests__/ChipInviteStatus.spec.js +1 -1
- 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 +40 -5
- package/src/components/DataTablePaginator/DataTablePaginator.vue +5 -3
- package/src/components/DatePicker/DatePicker.stories.js +14 -4
- package/src/components/DatePicker/DatePicker.vue +4 -2
- package/src/components/DatePicker/__tests__/DatePicker.spec.js +13 -0
- package/src/components/DefaultTextField/DefaultTextField.stories.js +1 -1
- package/src/components/DefaultTextField/DefaultTextField.vue +12 -0
- package/src/components/DialogFooter/DialogFooter.stories.js +1 -1
- package/src/components/DialogHeader/DialogHeader.stories.js +1 -1
- package/src/components/FilePicker/FilePicker.scss +5 -4
- package/src/components/FilePicker/FilePicker.stories.js +10 -4
- package/src/components/FilePicker/FilePicker.vue +95 -67
- package/src/components/FilePicker/__tests__/FilePicker.spec.js +17 -0
- 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 +23 -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 +95 -0
- package/src/examples/inputs/Password.stories.js +42 -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/Sticky-table.scss +69 -0
- package/src/scss/Table.scss +2 -0
- package/src/scss/VMenuOverrides.scss +5 -0
- package/src/scss/main.scss +4 -0
- package/src/scss/utils.scss +138 -99
- package/src/stories/Introduction.stories.mdx +1 -1
|
@@ -1,78 +1,106 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
<section ref="container" id="droparea-container">
|
|
3
|
+
<input
|
|
4
|
+
type="file"
|
|
5
|
+
name="file"
|
|
6
|
+
@change="fileChange($event.target.files)"
|
|
7
|
+
:accept="acceptedFileTypes"
|
|
8
|
+
/>
|
|
9
|
+
<div v-if="!selectedFile" class="selectfile-container">
|
|
10
|
+
<v-icon color="secondary">mdi-cloud-upload</v-icon>
|
|
11
|
+
<p>Clique para selecionar ou arraste o arquivo aqui</p>
|
|
12
|
+
</div>
|
|
13
|
+
<div v-if="selectedFile || maxSizeReach" class="reset-container">
|
|
14
|
+
<div v-if="selectedFile">
|
|
15
|
+
<v-icon>mdi-file</v-icon> Arquivo selecionado: {{ selectedFile.name }} ({{
|
|
16
|
+
Math.floor(selectedFile.size / 1024)
|
|
17
|
+
}}kB)
|
|
18
|
+
</div>
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
<p v-if="maxSizeReach" v-html="maxSizeReachMsg"></p>
|
|
21
|
+
|
|
22
|
+
<v-btn depressed outlined color="secondary" class="v-btn-responsive" @click="reset"
|
|
23
|
+
>Escolher outro</v-btn
|
|
24
|
+
>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
25
27
|
</template>
|
|
26
28
|
<script>
|
|
27
29
|
import { VBtn } from 'vuetify/lib/components/VBtn';
|
|
28
30
|
import { VIcon } from 'vuetify/lib/components/VIcon';
|
|
29
31
|
export default {
|
|
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
|
-
this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
32
|
+
props: {
|
|
33
|
+
/*
|
|
34
|
+
* Accepted file types
|
|
35
|
+
*/
|
|
36
|
+
acceptedFileTypes: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: '*',
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Max file size (in MB)
|
|
42
|
+
*/
|
|
43
|
+
maxFileSize: {
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
selectedFile: null,
|
|
50
|
+
dropArea: null,
|
|
51
|
+
maxSizeReach: false,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
maxSizeReachMsg() {
|
|
56
|
+
return `Arquivo ultrapassou o tamanho máximo de ${this.maxFileSize}MB`;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
mounted() {
|
|
60
|
+
this.dropArea = this.$refs.container;
|
|
61
|
+
this.addListeners();
|
|
62
|
+
},
|
|
63
|
+
methods: {
|
|
64
|
+
reset() {
|
|
65
|
+
this.$refs.container.querySelector('input').value = '';
|
|
66
|
+
this.$emit('onReset');
|
|
67
|
+
this.maxSizeReach = false;
|
|
68
|
+
this.selectedFile = null;
|
|
69
|
+
},
|
|
70
|
+
fileChange(fileList) {
|
|
71
|
+
this.maxSizeReach = false;
|
|
72
|
+
if (!fileList.length || fileList.length > 1) return;
|
|
73
|
+
|
|
74
|
+
if (this.maxFileSize) {
|
|
75
|
+
const sizeInMB = fileList[0].size / (1024 * 1024);
|
|
76
|
+
|
|
77
|
+
if (sizeInMB > this.maxFileSize) {
|
|
78
|
+
this.maxSizeReach = true;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.selectedFile = fileList[0];
|
|
83
|
+
this.$emit('onFileChange', this.selectedFile);
|
|
84
|
+
},
|
|
85
|
+
handlerFunctionHighlight() {
|
|
86
|
+
this.dropArea.classList.add('highlight');
|
|
87
|
+
},
|
|
88
|
+
handlerFunctionUnhighlight() {
|
|
89
|
+
this.dropArea.classList.remove('highlight');
|
|
90
|
+
},
|
|
91
|
+
addListeners() {
|
|
92
|
+
this.dropArea.addEventListener('dragenter', this.handlerFunctionHighlight, false);
|
|
93
|
+
this.dropArea.addEventListener('dragleave', this.handlerFunctionUnhighlight, false);
|
|
94
|
+
this.dropArea.addEventListener('dragover', this.handlerFunctionHighlight, false);
|
|
95
|
+
this.dropArea.addEventListener('drop', this.handlerFunctionUnhighlight, false);
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
components: {
|
|
99
|
+
VBtn,
|
|
100
|
+
VIcon,
|
|
101
|
+
},
|
|
74
102
|
};
|
|
75
103
|
</script>
|
|
76
104
|
<style scoped lang="scss">
|
|
77
105
|
@import './FilePicker.scss';
|
|
78
|
-
</style>
|
|
106
|
+
</style>
|
|
@@ -23,6 +23,14 @@ describe('FilePicker component', () => {
|
|
|
23
23
|
wrapper.vm.fileChange([]);
|
|
24
24
|
expect(wrapper.emitted().onFileChange).toBeUndefined();
|
|
25
25
|
});
|
|
26
|
+
|
|
27
|
+
it('Should handle max file size', async () => {
|
|
28
|
+
await wrapper.setProps({
|
|
29
|
+
maxFileSize: 5,
|
|
30
|
+
});
|
|
31
|
+
wrapper.vm.fileChange([{ size: 6 * 1024 * 1024 }]);
|
|
32
|
+
expect(wrapper.vm.maxSizeReach).toBeTruthy();
|
|
33
|
+
});
|
|
26
34
|
});
|
|
27
35
|
|
|
28
36
|
describe('handlerFunctionHighlight', () => {
|
|
@@ -49,4 +57,13 @@ describe('FilePicker component', () => {
|
|
|
49
57
|
});
|
|
50
58
|
});
|
|
51
59
|
});
|
|
60
|
+
|
|
61
|
+
describe('Computed properties', () => {
|
|
62
|
+
it('Should return maxSizeReachMsg', () => {
|
|
63
|
+
wrapper.setProps({
|
|
64
|
+
maxFileSize: 5,
|
|
65
|
+
});
|
|
66
|
+
expect(wrapper.vm.maxSizeReachMsg).toContain('Arquivo ultrapassou o tamanho máximo');
|
|
67
|
+
});
|
|
68
|
+
});
|
|
52
69
|
});
|
|
@@ -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,19 +1,39 @@
|
|
|
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
|
-
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
model: {},
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
template: `<div style="max-width: 320px"><PromptUserToConfirm v-model="model"/>
|
|
16
|
+
match: {{ model }}
|
|
17
|
+
</div>`,
|
|
11
18
|
});
|
|
12
19
|
|
|
13
20
|
export const CustomTitle = () => ({
|
|
14
21
|
components: { PromptUserToConfirm },
|
|
15
|
-
template: '<PromptUserToConfirm title="Custom"
|
|
22
|
+
template: '<div style="max-width: 320px"><PromptUserToConfirm title="Custom" /></div>',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const CustomMatchInput = () => ({
|
|
26
|
+
components: { PromptUserToConfirm },
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
model: {},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
template: `<div style="max-width: 320px"><PromptUserToConfirm title="Custom match input: CONFIRMAR" match="CONFIRMAR" v-model="model" />
|
|
33
|
+
match: {{ model }}
|
|
34
|
+
</div>`,
|
|
16
35
|
});
|
|
17
36
|
|
|
18
37
|
Primary.storyName = 'Básico';
|
|
19
38
|
CustomTitle.storyName = 'Título customizado';
|
|
39
|
+
CustomMatchInput.storyName = 'Match input customizado';
|
|
@@ -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
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import TableContextMenu from './TableContextMenu';
|
|
2
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
|
-
title: '
|
|
5
|
+
title: 'API/TableContextMenu',
|
|
6
|
+
decorators: [withDesign],
|
|
5
7
|
component: TableContextMenu,
|
|
6
8
|
};
|
|
7
9
|
|
|
@@ -15,5 +17,40 @@ export const Icons = () => ({
|
|
|
15
17
|
template: `<TableContextMenu :items="[{ label: 'Remover', icon: { color: 'error', type: 'delete' } }]" />`,
|
|
16
18
|
});
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
export const Multi = () => ({
|
|
21
|
+
components: { TableContextMenu },
|
|
22
|
+
template: `<TableContextMenu :items="[{ label: 'Novo', icon: { color: 'grey', type: 'open-in-new' } }, { label: 'Editar', icon: { color: 'secondary', type: 'open-in-new' } }, { label: 'Remover', icon: { color: 'error', type: 'delete' } }]" />`,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
Primary.story = {
|
|
26
|
+
name: 'Básico',
|
|
27
|
+
parameters: {
|
|
28
|
+
design: {
|
|
29
|
+
type: 'figma',
|
|
30
|
+
url:
|
|
31
|
+
'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=3516%3A11516',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
Icons.story = {
|
|
37
|
+
name: 'Ícone',
|
|
38
|
+
parameters: {
|
|
39
|
+
design: {
|
|
40
|
+
type: 'figma',
|
|
41
|
+
url:
|
|
42
|
+
'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=3516%3A11516',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
Multi.story = {
|
|
48
|
+
name: 'Múltiplos Itens',
|
|
49
|
+
parameters: {
|
|
50
|
+
design: {
|
|
51
|
+
type: 'figma',
|
|
52
|
+
url:
|
|
53
|
+
'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=3516%3A11516',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -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
|
+
};
|