@farm-investimentos/front-mfe-components 11.4.5 → 11.4.7

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.
@@ -0,0 +1,119 @@
1
+ import { withDesign } from 'storybook-addon-designs';
2
+
3
+ export default {
4
+ title: 'Display/Dialog/Vuetify',
5
+ decorators: [withDesign],
6
+ parameters: {
7
+ viewMode: 'docs',
8
+ docs: {
9
+ description: {
10
+ component: `Dialog created by vuetify-dialog`,
11
+ },
12
+ },
13
+ },
14
+ };
15
+
16
+ export const Primary = () => ({
17
+ methods: {
18
+ openDialog() {
19
+ this.$dialog.confirm({
20
+ text: `Deseja realmente sair?`,
21
+ title: 'Sair',
22
+ actions: {
23
+ true: {
24
+ text: 'Sim',
25
+ color: 'secondary',
26
+ handle: () => {
27
+ alert('Clicked: Sim');
28
+ },
29
+ },
30
+ },
31
+ });
32
+ },
33
+ },
34
+ template: `<div style="display: flex; flex-direction: column; max-width: 160px; width: 100%;">
35
+ <farm-btn @click="openDialog">
36
+ Open
37
+ </farm-btn>
38
+ </div>`,
39
+ });
40
+
41
+ export const Default = () => ({
42
+ methods: {
43
+ openDialog() {
44
+ this.$dialog.confirm({
45
+ text: `Deseja realmente sair?`,
46
+ title: 'Sair',
47
+ actions: {
48
+ false: {
49
+ text: 'Cancelar',
50
+ color: 'secondary-outlined',
51
+ handle: () => {
52
+ alert('Clicked: Cancelar');
53
+ },
54
+ },
55
+ true: {
56
+ text: 'Sim',
57
+ color: 'secondary',
58
+ handle: () => {
59
+ alert('Clicked: Sim');
60
+ },
61
+ },
62
+ },
63
+ });
64
+ },
65
+ },
66
+ template: `<div style="display: flex; flex-direction: column; max-width: 160px; width: 100%;">
67
+ <farm-btn @click="openDialog">
68
+ Open
69
+ </farm-btn>
70
+ </div>`,
71
+ });
72
+
73
+ export const ErrorColor = () => ({
74
+ methods: {
75
+ openDialog() {
76
+ this.$dialog.confirm({
77
+ text: `Deseja realmente sair?`,
78
+ title: 'Sair',
79
+ actions: {
80
+ true: {
81
+ text: 'Sair',
82
+ color: 'error',
83
+ handle: () => {
84
+ alert('Clicked: Sair');
85
+ },
86
+ },
87
+ },
88
+ });
89
+ },
90
+ },
91
+ template: `<div style="display: flex; flex-direction: column; max-width: 160px; width: 100%;">
92
+ <farm-btn @click="openDialog">
93
+ Open
94
+ </farm-btn>
95
+ </div>`,
96
+ });
97
+
98
+
99
+ export const CustomContent = () => ({
100
+ methods: {
101
+ openDialog() {
102
+ this.$dialog.confirm({
103
+ text: `This is a text with <strong>html markup</strong> and<br />break line!`,
104
+ title: 'Sair',
105
+ actions: {
106
+ true: {
107
+ text: 'Sim',
108
+ color: 'secondary',
109
+ },
110
+ },
111
+ });
112
+ },
113
+ },
114
+ template: `<div style="display: flex; flex-direction: column; max-width: 160px; width: 100%;">
115
+ <farm-btn @click="openDialog">
116
+ Open
117
+ </farm-btn>
118
+ </div>`,
119
+ });
@@ -1,43 +0,0 @@
1
- import { withDesign } from 'storybook-addon-designs';
2
-
3
- export default {
4
- title: 'Display/Dialog/Confirm',
5
- decorators: [withDesign],
6
- parameters: {
7
- viewMode: 'docs',
8
- docs: {
9
- description: {
10
- component: `ConfirmDialog created by vuetify-dialog`,
11
- },
12
- },
13
- },
14
- };
15
-
16
- export const ConfirmDialog = () => ({
17
- methods: {
18
- openDialog() {
19
- this.$dialog.confirm({
20
- text: `Deseja realmente sair?`,
21
- title: 'Sair',
22
- actions: {
23
- false: {
24
- text: 'Cancelar',
25
- color: 'primary',
26
- },
27
- true: {
28
- text: 'Sim',
29
- color: 'secondary',
30
- handle: () => {
31
- this.$emit('onLogout');
32
- },
33
- },
34
- },
35
- });
36
- },
37
- },
38
- template: `<div style="display: flex; flex-direction: column; max-width: 160px; width: 100%;">
39
- <ConfirmButton @click="openDialog">
40
- Open
41
- </ConfirmButton>
42
- </div>`,
43
- });
@@ -1,181 +0,0 @@
1
- import { withDesign } from 'storybook-addon-designs';
2
-
3
- export default {
4
- title: 'Display/Dialog/Examples',
5
- decorators: [withDesign],
6
- component: Modal,
7
- };
8
-
9
- export const Modal = () => ({
10
- /*
11
- * How to create the default modal following FARM's Design System guideline
12
- */
13
- data() {
14
- return {
15
- inputVal: false,
16
- };
17
- },
18
- template: `<div>
19
- <v-dialog content-class="modal-default" v-model="inputVal">
20
- <DialogHeader title="Exemplo" @onClose="inputVal = false;" />
21
- <v-main class="pa-6 pt-12">
22
- Place dialog content here!
23
- </v-main>
24
- <DialogFooter :hasConfirm="false" @onClose="inputVal = false;" />
25
- </v-dialog>
26
- <v-btn @click="inputVal = true;" color="secondary">
27
- Clique para abrir
28
- </v-btn>
29
- </div>`,
30
- });
31
-
32
- export const ModalSmall = () => ({
33
- data() {
34
- return {
35
- showModalSmall: false,
36
- };
37
- },
38
- template: `<div>
39
- <v-dialog content-class="modal-default modal-default-small" v-model="showModalSmall">
40
- <DialogHeader title="Exemplo" @onClose="showModalSmall = false;" />
41
- <v-main class="pa-6 pt-12">
42
- Place dialog content here!
43
- </v-main>
44
- <DialogFooter :hasConfirm="false" @onClose="showModalSmall = false;" />
45
- </v-dialog>
46
- <v-btn @click="showModalSmall = true;" color="secondary">
47
- Clique para abrir
48
- </v-btn>
49
- </div>`,
50
- });
51
-
52
- export const ModalExtremeSmall = () => ({
53
- data() {
54
- return {
55
- showModalSmall: false,
56
- };
57
- },
58
- template: `<div>
59
- <v-dialog content-class="modal-default modal-default-x-small" v-model="showModalSmall">
60
- <DialogHeader title="Exemplo" @onClose="showModalSmall = false;" />
61
- <v-main class="pa-6 pt-12">
62
- Place dialog content here!
63
- </v-main>
64
- <DialogFooter :hasConfirm="false" @onClose="showModalSmall = false;" />
65
- </v-dialog>
66
- <v-btn @click="showModalSmall = true;" color="secondary">
67
- Clique para abrir
68
- </v-btn>
69
- </div>`,
70
- });
71
-
72
- export const ModalMedium = () => ({
73
- data() {
74
- return {
75
- showModalSmall: false,
76
- };
77
- },
78
- template: `<div>
79
- <v-dialog content-class="modal-default modal-default-md" v-model="showModalSmall">
80
- <DialogHeader title="Exemplo" @onClose="showModalSmall = false;" />
81
- <v-main class="pa-6 pt-12">
82
- Place dialog content here!
83
- </v-main>
84
- <DialogFooter :hasConfirm="false" @onClose="showModalSmall = false;" />
85
- </v-dialog>
86
- <v-btn @click="showModalSmall = true;" color="secondary">
87
- Clique para abrir
88
- </v-btn>
89
- </div>`,
90
- });
91
-
92
- export const ModalScrollVertical = () => ({
93
- data() {
94
- return {
95
- showModalSmall: false,
96
- };
97
- },
98
- template: `<div>
99
- <v-dialog content-class="modal-default modal-default-small" v-model="showModalSmall">
100
- <DialogHeader title="Exemplo" @onClose="showModalSmall = false;" />
101
- <v-main class="pa-6 pt-12">
102
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
103
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
104
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
105
- </v-main>
106
- <DialogFooter :hasConfirm="false" @onClose="showModalSmall = false;" />
107
- </v-dialog>
108
- <v-btn @click="showModalSmall = true;" color="secondary">
109
- Clique para abrir
110
- </v-btn>
111
- </div>`,
112
- });
113
-
114
- export const ModalScrollHorizontal = () => ({
115
- data() {
116
- return {
117
- open: false,
118
- };
119
- },
120
- template: `<div>
121
- <v-dialog content-class="modal-default modal-default-small" v-model="open">
122
- <DialogHeader title="Exemplo" @onClose="open = false;" />
123
- <v-main class="pa-6 pt-12" >
124
- <table>
125
- <tr>
126
- <th>Company</th>
127
- <th>Name</th>
128
- <th>Country</th>
129
- <th>Contact</th>
130
- <th>Email</th>
131
- </tr>
132
- <tr>
133
- <td>Alfreds Futterkiste</td>
134
- <td>Maria Anders</td>
135
- <td>Germany</td>
136
- <td>+55193764-8418</td>
137
- <td>najes39390@dufeed.com</td>
138
- </tr>
139
- <tr>
140
- <td>Centro comercial Moctezuma</td>
141
- <td>Francisco Chang</td>
142
- <td>Mexico</td>
143
- <td>+55193764-8418</td>
144
- <td>najes39390@dufeed.com</td>
145
- </tr>
146
- <tr>
147
- <td>Ernst Handel</td>
148
- <td>Roland Mendel</td>
149
- <td>Austria</td>
150
- <td>+55193764-8418</td>
151
- <td>najes39390@dufeed.com</td>
152
- </tr>
153
- <tr>
154
- <td>Island Trading</td>
155
- <td>Helen Bennett</td>
156
- <td>UK</td>
157
- <td>+55193764-8418</td>
158
- <td>najes39390@dufeed.com</td>
159
- </tr>
160
- <tr>
161
- <td>Laughing Bacchus Winecellars</td>
162
- <td>Yoshi Tannamuri</td>
163
- <td>Canada</td>
164
- <td>+55193764-8418</td>
165
- <td>najes39390@dufeed.com</td>
166
- </tr>
167
- <tr>
168
- <td>Magazzini Alimentari Riuniti</td>
169
- <td>Giovanni Rovelli</td>
170
- <td>Italy</td>
171
- <td>+55193764-8418</td>
172
- <td>najes39390@dufeed.com</td>
173
- </tr>
174
- </table>
175
- </v-main>
176
- </v-dialog>
177
- <v-btn @click="open = true;" color="secondary">
178
- Clique para abrir
179
- </v-btn>
180
- </div>`,
181
- });