@farm-investimentos/front-mfe-components 11.2.2 → 11.3.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 +248 -291
- 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 +248 -291
- 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/Buttons/MultiImportButton/MultiImportButton.stories.js +9 -3
- package/src/components/Buttons/MultiImportButton/MultiImportButton.vue +35 -55
- package/src/components/ChipInviteStatus/ChipInviteStatus.stories.js +1 -0
- package/src/components/ChipInviteStatus/ChipInviteStatus.vue +12 -55
- package/src/components/ChipInviteStatus/__tests__/ChipInviteStatus.spec.js +0 -12
- package/src/components/ChipInviteStatus/keys.ts +11 -0
- package/src/components/ContextMenu/ContextMenu.vue +5 -2
- package/src/components/IdCaption/IdCaption.stories.js +18 -1
- package/src/components/IdCaption/IdCaption.vue +2 -2
- package/src/helpers/calculateMainZindex.js +1 -1
- package/src/components/ChipInviteStatus/ChipInviteStatus.scss +0 -31
package/package.json
CHANGED
|
@@ -10,7 +10,13 @@ export const Primary = () => ({
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export const List = () => ({
|
|
13
|
-
|
|
13
|
+
methods: {
|
|
14
|
+
listener(key) {
|
|
15
|
+
alert('Handler for item ' + key);
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
template: `<farm-btn-multipleimport
|
|
19
|
+
:optionsList="[{ listenerKey: 1, title: 'XLS teste'}, { listenerKey: 2, title: 'CSV teste novo'}]"
|
|
20
|
+
@onClick="listener"
|
|
21
|
+
/>`,
|
|
14
22
|
});
|
|
15
|
-
|
|
16
|
-
List.storyName = 'Lista';
|
|
@@ -1,77 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<template v-slot:activator="{
|
|
4
|
-
<farm-btn
|
|
5
|
-
v-bind="attrs"
|
|
6
|
-
v-on="on"
|
|
7
|
-
dense
|
|
8
|
-
class="farm-btn--responsive farm-btn--import"
|
|
9
|
-
outlined
|
|
10
|
-
color="secondary"
|
|
11
|
-
title="Importar"
|
|
12
|
-
@onClick="togglePopover = true"
|
|
13
|
-
>
|
|
2
|
+
<farm-contextmenu v-model="value" :bottom="true">
|
|
3
|
+
<template v-slot:activator="{}">
|
|
4
|
+
<farm-btn outlined title="Importar" color="secondary" @click="toggleValue">
|
|
14
5
|
Importar
|
|
15
|
-
<
|
|
16
|
-
:class="{
|
|
17
|
-
'ml-2': true,
|
|
18
|
-
'mr-0': true,
|
|
19
|
-
mdi: true,
|
|
20
|
-
'mdi-chevron-up': togglePopover,
|
|
21
|
-
'mdi-chevron-down': !togglePopover,
|
|
22
|
-
}"
|
|
23
|
-
>
|
|
24
|
-
</i>
|
|
6
|
+
<farm-icon class="ml-2"> chevron-{{ value ? 'up' : 'down' }} </farm-icon>
|
|
25
7
|
</farm-btn>
|
|
26
8
|
</template>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
:
|
|
34
|
-
|
|
9
|
+
<farm-list>
|
|
10
|
+
<farm-listitem
|
|
11
|
+
v-for="item in optionsList"
|
|
12
|
+
clickable
|
|
13
|
+
hoverColor="primary"
|
|
14
|
+
hoverColorVariation="lighten"
|
|
15
|
+
:key="'importbutton_key_' + item.title"
|
|
16
|
+
:title="item.title"
|
|
17
|
+
@click="onClick(item.listenerKey)"
|
|
35
18
|
>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</v-list>
|
|
41
|
-
</v-menu>
|
|
19
|
+
<farm-caption bold tag="span">{{ item.title }}</farm-caption>
|
|
20
|
+
</farm-listitem>
|
|
21
|
+
</farm-list>
|
|
22
|
+
</farm-contextmenu>
|
|
42
23
|
</template>
|
|
43
|
-
<script>
|
|
44
|
-
import Vue from 'vue';
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import Vue, { PropType } from 'vue';
|
|
26
|
+
|
|
27
|
+
export interface IImportOption {
|
|
28
|
+
title: String;
|
|
29
|
+
listenerKey: String;
|
|
30
|
+
}
|
|
49
31
|
|
|
50
32
|
export default Vue.extend({
|
|
51
33
|
name: 'farm-btn-multipleimport',
|
|
52
|
-
components: {
|
|
53
|
-
VList,
|
|
54
|
-
VListItem,
|
|
55
|
-
VMenu,
|
|
56
|
-
VListItemContent,
|
|
57
|
-
VListItemTitle,
|
|
58
|
-
},
|
|
59
34
|
props: {
|
|
60
35
|
/**
|
|
61
|
-
*
|
|
36
|
+
* Options list
|
|
62
37
|
*/
|
|
63
38
|
optionsList: {
|
|
64
|
-
type: Array
|
|
39
|
+
type: Array as PropType<Array<IImportOption>>,
|
|
65
40
|
default: () => [],
|
|
66
41
|
},
|
|
67
42
|
},
|
|
68
43
|
data() {
|
|
69
44
|
return {
|
|
70
|
-
|
|
45
|
+
value: false,
|
|
71
46
|
};
|
|
72
47
|
},
|
|
48
|
+
methods: {
|
|
49
|
+
onClick(key) {
|
|
50
|
+
this.$emit('onClick', key);
|
|
51
|
+
},
|
|
52
|
+
toggleValue() {
|
|
53
|
+
this.value = !this.value;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
73
56
|
});
|
|
74
57
|
</script>
|
|
75
|
-
<style scoped lang="scss">
|
|
76
|
-
@import './MultiImportButton.scss';
|
|
77
|
-
</style>
|
|
@@ -1,50 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} status-chip-${color} status-chip--onboarding`
|
|
8
|
-
"
|
|
2
|
+
<farm-chip
|
|
3
|
+
:color="obj.color"
|
|
4
|
+
:outlined="obj.outlined"
|
|
5
|
+
:variation="obj.variation"
|
|
6
|
+
:dense="!isFull"
|
|
9
7
|
>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</span>
|
|
13
|
-
</v-chip>
|
|
8
|
+
{{ obj.label }}
|
|
9
|
+
</farm-chip>
|
|
14
10
|
</template>
|
|
15
|
-
<script>
|
|
11
|
+
<script lang="ts">
|
|
16
12
|
import Vue from 'vue';
|
|
17
|
-
|
|
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
|
-
17: 'EM ESPERA',
|
|
26
|
-
18: 'DECLINADO'
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const StatusColor = {
|
|
30
|
-
10: 'secondary',
|
|
31
|
-
11: 'yellow',
|
|
32
|
-
12: 'yellow',
|
|
33
|
-
13: 'success',
|
|
34
|
-
14: 'error',
|
|
35
|
-
15: 'accent',
|
|
36
|
-
16: 'primary',
|
|
37
|
-
17: 'on-wait',
|
|
38
|
-
18: 'error',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
import VChip from 'vuetify/lib/components/VChip/';
|
|
42
|
-
|
|
13
|
+
import keys from './keys';
|
|
43
14
|
export default Vue.extend({
|
|
44
15
|
name: 'farm-chip-invite',
|
|
45
|
-
components: {
|
|
46
|
-
VChip,
|
|
47
|
-
},
|
|
48
16
|
props: {
|
|
49
17
|
/**
|
|
50
18
|
* Invite status
|
|
@@ -58,24 +26,13 @@ export default Vue.extend({
|
|
|
58
26
|
*/
|
|
59
27
|
isFull: {
|
|
60
28
|
type: Boolean,
|
|
61
|
-
default:
|
|
29
|
+
default: false,
|
|
62
30
|
},
|
|
63
31
|
},
|
|
64
32
|
computed: {
|
|
65
|
-
|
|
66
|
-
return this.status
|
|
67
|
-
? ''
|
|
68
|
-
: StatusColor[this.status];
|
|
69
|
-
},
|
|
70
|
-
color() {
|
|
71
|
-
return !this.status ? '' : StatusColor[this.status];
|
|
72
|
-
},
|
|
73
|
-
label() {
|
|
74
|
-
return StatusLabel[this.status];
|
|
33
|
+
obj() {
|
|
34
|
+
return keys[this.status];
|
|
75
35
|
},
|
|
76
36
|
},
|
|
77
37
|
});
|
|
78
38
|
</script>
|
|
79
|
-
<style lang="scss" scoped>
|
|
80
|
-
@import './ChipInviteStatus.scss';
|
|
81
|
-
</style>
|
|
@@ -21,16 +21,4 @@ describe('ChipInviteStatus component', () => {
|
|
|
21
21
|
expect(wrapper.element).toMatchSnapshot();
|
|
22
22
|
});
|
|
23
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
24
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
10: { label: 'Convidar', color: 'primary' },
|
|
3
|
+
11: { label: 'Convidado', color: 'warning', outlined: true },
|
|
4
|
+
12: { label: 'Incompleto', color: 'warning', outlined: true },
|
|
5
|
+
13: { label: 'Concluído', color: 'primary', outlined: true },
|
|
6
|
+
14: { label: 'Falha/Erro', color: 'error', outlined: true },
|
|
7
|
+
15: { label: 'Em Análise', color: 'info', outlined: true },
|
|
8
|
+
16: { label: 'Em Andamento', color: 'secondary', variation: 'darken' },
|
|
9
|
+
17: { label: 'Em Espera', color: 'secondary' },
|
|
10
|
+
18: { label: 'Declinado', color: 'error', outlined: true },
|
|
11
|
+
};
|
|
@@ -82,15 +82,18 @@ export default Vue.extend({
|
|
|
82
82
|
|
|
83
83
|
const calculatePosition = () => {
|
|
84
84
|
const parentBoundingClientRect = parent.value.getBoundingClientRect();
|
|
85
|
+
const activatorBoundingClientRect = activator.value.children[0].getBoundingClientRect();
|
|
85
86
|
const popupClientRect = popup.value.getBoundingClientRect();
|
|
86
87
|
|
|
88
|
+
console.log(activatorBoundingClientRect);
|
|
89
|
+
|
|
87
90
|
let offsetTop =
|
|
88
91
|
parentBoundingClientRect.top +
|
|
89
92
|
window.scrollY +
|
|
90
|
-
(!bottom.value ? 0 :
|
|
93
|
+
(!bottom.value ? 0 : activatorBoundingClientRect.height);
|
|
91
94
|
|
|
92
95
|
let offsetLeft = parentBoundingClientRect.left;
|
|
93
|
-
if (popupClientRect.width >
|
|
96
|
+
if (popupClientRect.width > activatorBoundingClientRect.width) {
|
|
94
97
|
offsetLeft =
|
|
95
98
|
offsetLeft + parentBoundingClientRect.width / 2 - popupClientRect.width / 2;
|
|
96
99
|
}
|
|
@@ -4,7 +4,7 @@ import IdCaption from './';
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Display/IdCaption',
|
|
6
6
|
component: IdCaption,
|
|
7
|
-
|
|
7
|
+
decorators: [withDesign],
|
|
8
8
|
parameters: {
|
|
9
9
|
docs: {
|
|
10
10
|
description: {
|
|
@@ -132,3 +132,20 @@ export const IconBoxCustomColor = () => ({
|
|
|
132
132
|
</farm-idcaption>
|
|
133
133
|
`,
|
|
134
134
|
});
|
|
135
|
+
|
|
136
|
+
export const CustomTag = () => ({
|
|
137
|
+
template: `
|
|
138
|
+
<farm-idcaption
|
|
139
|
+
icon="account-box-outline"
|
|
140
|
+
copyText="texto a copiar"
|
|
141
|
+
:link="true"
|
|
142
|
+
>
|
|
143
|
+
<template v-slot:title>
|
|
144
|
+
<b>Upper Line Text</b>
|
|
145
|
+
</template>
|
|
146
|
+
<template v-slot:subtitle>
|
|
147
|
+
<b>Lower:</b> Line Text Line Text Line Text
|
|
148
|
+
</template>
|
|
149
|
+
</farm-idcaption>
|
|
150
|
+
`,
|
|
151
|
+
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
>
|
|
7
7
|
<farm-caption variation="medium" v-if="hasTitle">
|
|
8
8
|
<span>
|
|
9
|
-
|
|
9
|
+
<slot name="title"></slot>
|
|
10
10
|
<farm-btn icon color="gray" v-if="link" @click="$emit('onLinkClick')">
|
|
11
11
|
<farm-icon size="xs">open-in-new</farm-icon>
|
|
12
12
|
</farm-btn>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<farm-caption variation="regular" color="gray" v-if="hasSubtitle">
|
|
17
17
|
<span>
|
|
18
|
-
|
|
18
|
+
<slot name="subtitle"></slot>
|
|
19
19
|
<farm-copytoclipboard v-if="copyText" :toCopy="copyText" />
|
|
20
20
|
</span>
|
|
21
21
|
</farm-caption>
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
&.status-chip.status-chip-on-wait {
|
|
27
|
-
color: white !important;
|
|
28
|
-
border: 2px solid #467d7e !important;
|
|
29
|
-
background-color: #467d7e !important;
|
|
30
|
-
}
|
|
31
|
-
}
|