@farm-investimentos/front-mfe-components 9.1.1 → 9.2.1
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 +303 -148
- 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 +303 -148
- 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 +1 -1
- package/src/components/ButtonToggle/ButtonToggle.scss +14 -0
- package/src/components/ButtonToggle/ButtonToggle.stories.js +49 -0
- package/src/components/ButtonToggle/ButtonToggle.vue +52 -0
- package/src/components/ButtonToggle/IButtonToggle.ts +5 -0
- package/src/components/ButtonToggle/__tests__/ButtonToggle.spec.js +18 -0
- package/src/components/ButtonToggle/index.ts +4 -0
- package/src/components/DataTableHeader/DataTableHeader.scss +5 -3
- package/src/components/DataTableHeader/DataTableHeader.vue +6 -7
- package/src/components/DataTablePaginator/DataTablePaginator.scss +5 -1
- package/src/components/DataTablePaginator/DataTablePaginator.vue +10 -3
- package/src/components/Icon/Icon.scss +1 -1
- package/src/components/Icon/Icon.stories.js +28 -14
- package/src/components/Icon/Icons.stories.scss +17 -0
- package/src/components/Icon/icons_list.ts +2566 -0
- package/src/components/Logger/Logger.stories.js +55 -0
- package/src/components/Logger/LoggerItem/ILoggerItem.ts +1 -0
- package/src/components/Logger/LoggerItem/LoggerItem.stories.js +40 -0
- package/src/components/Logger/LoggerItem/LoggerItem.vue +27 -2
- package/src/components/Logger/LoggerItem/__tests__/LoggerItem.spec.js +40 -0
- package/src/examples/Modal.stories.js +0 -1
- package/src/examples/Table.stories.js +2 -0
- package/src/main.ts +1 -0
- package/src/scss/Sticky-table.scss +1 -1
|
@@ -59,3 +59,58 @@ export const Primary = () => ({
|
|
|
59
59
|
},
|
|
60
60
|
template: `<farm-logger :items="items" />`,
|
|
61
61
|
});
|
|
62
|
+
|
|
63
|
+
export const Details = () => ({
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
items: [
|
|
67
|
+
{
|
|
68
|
+
message: 'Recusado entre as pré elegíveis',
|
|
69
|
+
userName: 'Cleyton Rasta',
|
|
70
|
+
formattedDate: '13/06/2022 20:40',
|
|
71
|
+
status: 'error',
|
|
72
|
+
details() {
|
|
73
|
+
alert('Ver Detalhes');
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
message: 'Aprovado entre as pré elegíveis',
|
|
78
|
+
userName: 'Cleyton Rasta',
|
|
79
|
+
formattedDate: '13/06/2022 20:40',
|
|
80
|
+
status: 'success',
|
|
81
|
+
details() {
|
|
82
|
+
alert('Ver Detalhes');
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
message: 'Aprovado entre as pré elegíveis',
|
|
87
|
+
userName: 'Cleyton Rasta',
|
|
88
|
+
formattedDate: '13/06/2022 20:40',
|
|
89
|
+
status: 'success',
|
|
90
|
+
details() {
|
|
91
|
+
alert('Ver Detalhes');
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
message: 'Recusado entre as pré elegíveis',
|
|
96
|
+
userName: 'Cleyton Rasta',
|
|
97
|
+
formattedDate: '13/06/2022 20:40',
|
|
98
|
+
status: 'error',
|
|
99
|
+
details() {
|
|
100
|
+
alert('Ver Detalhes');
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
message: 'Recusado entre as pré elegíveis',
|
|
105
|
+
userName: 'Cleyton Rasta',
|
|
106
|
+
formattedDate: '13/06/2022 20:40',
|
|
107
|
+
status: 'error',
|
|
108
|
+
details() {
|
|
109
|
+
alert('Ver Detalhes');
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
template: `<farm-logger :items="items" />`,
|
|
116
|
+
});
|
|
@@ -74,3 +74,43 @@ export const CustomIcon = () => ({
|
|
|
74
74
|
},
|
|
75
75
|
template: `<farm-logger-item :item="item" />`,
|
|
76
76
|
});
|
|
77
|
+
|
|
78
|
+
export const Details = () => ({
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
items: [
|
|
82
|
+
{
|
|
83
|
+
icon: 'book',
|
|
84
|
+
message: 'Aprovado entre as pré elegíveis',
|
|
85
|
+
userName: 'Cleyton Rasta',
|
|
86
|
+
formattedDate: '13/06/2022 20:40',
|
|
87
|
+
status: 'success',
|
|
88
|
+
details() {
|
|
89
|
+
alert('Ver Detalhes');
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
icon: 'book',
|
|
94
|
+
message: 'Reprovado entre as pré elegíveis',
|
|
95
|
+
userName: 'Cleyton Rasta',
|
|
96
|
+
formattedDate: '13/06/2022 20:40',
|
|
97
|
+
status: 'error',
|
|
98
|
+
details() {
|
|
99
|
+
alert('Ver Detalhes');
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
icon: 'book',
|
|
104
|
+
message: 'Reprovado entre as pré elegíveis',
|
|
105
|
+
userName: 'Cleyton Rasta',
|
|
106
|
+
formattedDate: '13/06/2022 20:40',
|
|
107
|
+
status: 'primary',
|
|
108
|
+
details() {
|
|
109
|
+
alert('Ver Detalhes');
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
template: `<div><farm-logger-item v-for="item of items" :key="item.status" :item="item" /></div>`,
|
|
116
|
+
});
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
{{ item.userName }}
|
|
20
20
|
</span>
|
|
21
21
|
</div>
|
|
22
|
+
<farm-btn
|
|
23
|
+
v-if="hasDetails"
|
|
24
|
+
:color="buttonColor"
|
|
25
|
+
plain
|
|
26
|
+
title="Ver Detalhes"
|
|
27
|
+
@click="callDetails"
|
|
28
|
+
>Ver Detalhes</farm-btn
|
|
29
|
+
>
|
|
22
30
|
</section>
|
|
23
31
|
</template>
|
|
24
32
|
<script lang="ts">
|
|
@@ -33,8 +41,13 @@ export default Vue.extend({
|
|
|
33
41
|
*/
|
|
34
42
|
item: { required: true, type: Object as PropType<ILoggerItem> },
|
|
35
43
|
},
|
|
44
|
+
methods: {
|
|
45
|
+
callDetails(): void {
|
|
46
|
+
this.item.details();
|
|
47
|
+
},
|
|
48
|
+
},
|
|
36
49
|
computed: {
|
|
37
|
-
mdiIconName() {
|
|
50
|
+
mdiIconName(): string {
|
|
38
51
|
if (this.item.icon) {
|
|
39
52
|
return `${this.item.icon}`;
|
|
40
53
|
}
|
|
@@ -43,9 +56,21 @@ export default Vue.extend({
|
|
|
43
56
|
}
|
|
44
57
|
return `${this.item.status === 'success' ? 'check' : 'close'}`;
|
|
45
58
|
},
|
|
59
|
+
buttonColor(): string {
|
|
60
|
+
if (this.item.status === 'success') {
|
|
61
|
+
return 'secondary';
|
|
62
|
+
} else if (this.item.status === 'error') {
|
|
63
|
+
return 'error';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return 'primary';
|
|
67
|
+
},
|
|
68
|
+
hasDetails(): boolean {
|
|
69
|
+
return !!this.item.details;
|
|
70
|
+
},
|
|
46
71
|
},
|
|
47
72
|
});
|
|
48
73
|
</script>
|
|
49
74
|
<style lang="scss" scoped>
|
|
50
|
-
@import './LoggerItem.scss'
|
|
75
|
+
@import './LoggerItem.scss';
|
|
51
76
|
</style>
|
|
@@ -49,5 +49,45 @@ describe('LoggerItem component', () => {
|
|
|
49
49
|
expect(component.mdiIconName).toEqual('close');
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
it('Should return success button color', async () => {
|
|
53
|
+
await wrapper.setProps({
|
|
54
|
+
item: {
|
|
55
|
+
status: 'success',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
expect(component.buttonColor).toEqual('secondary');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('Should return error button color', async () => {
|
|
62
|
+
await wrapper.setProps({
|
|
63
|
+
item: {
|
|
64
|
+
status: 'error',
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
expect(component.buttonColor).toEqual('error');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('Should return default button color', async () => {
|
|
71
|
+
await wrapper.setProps({
|
|
72
|
+
item: {
|
|
73
|
+
status: 'primary',
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
expect(component.buttonColor).toEqual('primary');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('Should not have a detail button', async () => {
|
|
80
|
+
await wrapper.setProps({
|
|
81
|
+
item: {
|
|
82
|
+
details: () => {},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
expect(component.hasDetails).toBeTruthy();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('Should not have a detail button', () => {
|
|
90
|
+
expect(component.hasDetails).toBeFalsy();
|
|
91
|
+
});
|
|
52
92
|
});
|
|
53
93
|
});
|
package/src/main.ts
CHANGED
|
@@ -50,6 +50,7 @@ export {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export * from './components/AlertReload';
|
|
53
|
+
export * from './components/ButtonToggle';
|
|
53
54
|
export * from './components/Buttons/DefaultButton';
|
|
54
55
|
export * from './components/Buttons/DangerButton';
|
|
55
56
|
export * from './components/Buttons/ConfirmButton';
|