@farm-investimentos/front-mfe-components 11.11.4 → 11.12.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 +208 -184
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +2 -2
- package/dist/front-mfe-components.umd.js +208 -184
- 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/ContextMenu/ContextMenu.vue +2 -2
- package/src/components/MainFilter/MainFilter.scss +10 -23
- package/src/components/MainFilter/MainFilter.stories.js +31 -14
- package/src/components/MainFilter/MainFilter.vue +6 -5
- package/src/components/Modal/Modal.vue +19 -3
- package/src/components/RadioGroup/RadioGroup.stories.js +2 -3
- package/src/components/Select/Select.stories.js +1 -0
- package/src/components/Select/Select.vue +1 -1
- package/src/components/ValueCaption/ValueCaption.stories.js +25 -0
package/package.json
CHANGED
|
@@ -78,6 +78,7 @@ export default Vue.extend({
|
|
|
78
78
|
() => inputValue.value,
|
|
79
79
|
newValue => {
|
|
80
80
|
if (newValue) {
|
|
81
|
+
styles.display = 'block';
|
|
81
82
|
if (!hasBeenBoostrapped) {
|
|
82
83
|
document.querySelector('body').appendChild(popup.value);
|
|
83
84
|
hasBeenBoostrapped = true;
|
|
@@ -86,6 +87,7 @@ export default Vue.extend({
|
|
|
86
87
|
window.addEventListener('resize', resizeWindowHandler);
|
|
87
88
|
calculatePosition();
|
|
88
89
|
} else {
|
|
90
|
+
styles.display = 'none';
|
|
89
91
|
styles.top = 0;
|
|
90
92
|
styles.left = 0;
|
|
91
93
|
styles.zIndex = 0;
|
|
@@ -107,8 +109,6 @@ export default Vue.extend({
|
|
|
107
109
|
window.scrollY +
|
|
108
110
|
(!bottom.value ? 0 : activatorBoundingClientRect.height);
|
|
109
111
|
|
|
110
|
-
//
|
|
111
|
-
|
|
112
112
|
let offsetLeft = activatorBoundingClientRect.left;
|
|
113
113
|
|
|
114
114
|
styles.minWidth =
|
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.farm-btn {
|
|
6
|
-
margin-left: 16px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
fieldset {
|
|
10
|
-
border: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.farm-tooltip {
|
|
14
|
-
margin-left: 4px;
|
|
15
|
-
}
|
|
1
|
+
.farm-tooltip {
|
|
2
|
+
margin-left: 4px;
|
|
3
|
+
}
|
|
16
4
|
|
|
5
|
+
.farm-btn.farm-btn__cta {
|
|
6
|
+
margin-left: 12px;
|
|
7
|
+
margin-top: 32px;
|
|
17
8
|
}
|
|
18
9
|
|
|
19
10
|
@media screen and (max-width: 600px) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
margin-
|
|
23
|
-
|
|
24
|
-
.farm-btn {
|
|
25
|
-
margin-left: 0;
|
|
26
|
-
margin-top: 0 !important;
|
|
27
|
-
}
|
|
11
|
+
.farm-btn.farm-btn__cta {
|
|
12
|
+
width: calc(100% - 24px);
|
|
13
|
+
margin-left: 12px;
|
|
14
|
+
margin-top: 0 !important;
|
|
28
15
|
}
|
|
29
16
|
}
|
|
@@ -32,29 +32,46 @@ export const WithSlot = () => ({
|
|
|
32
32
|
template: '<farm-form-mainfilter>With Slot</farm-form-mainfilter>',
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
export const
|
|
35
|
+
export const Tooltip = () => ({
|
|
36
36
|
data() {
|
|
37
37
|
return {
|
|
38
|
-
|
|
39
|
-
items: [1, 2, 3, 4, 5],
|
|
38
|
+
text: 'Some long tooltip text to be placed here!',
|
|
40
39
|
};
|
|
41
40
|
},
|
|
42
|
-
template:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<v-select :items="items" />
|
|
46
|
-
</section>
|
|
41
|
+
template: `
|
|
42
|
+
<div style="max-width: 480px; padding-top: 32px; margin-left: 32px;">
|
|
43
|
+
<farm-form-mainfilter label="Label" :tooltip="text" />
|
|
47
44
|
</div>`,
|
|
48
45
|
});
|
|
49
46
|
|
|
50
|
-
export const
|
|
47
|
+
export const Application = () => ({
|
|
51
48
|
data() {
|
|
52
49
|
return {
|
|
53
|
-
|
|
50
|
+
showFilters: true,
|
|
54
51
|
};
|
|
55
52
|
},
|
|
56
|
-
template:
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
template: `<div>
|
|
54
|
+
<farm-row>
|
|
55
|
+
<farm-col md="6">
|
|
56
|
+
<farm-form-mainfilter @onClick="showFilters = !showFilters" :showFilters="showFilters" />
|
|
57
|
+
</farm-col>
|
|
58
|
+
</farm-row>
|
|
59
|
+
<farm-row v-if="showFilters">
|
|
60
|
+
<farm-col cols="12">
|
|
61
|
+
Extra filters
|
|
62
|
+
</farm-col>
|
|
63
|
+
<farm-col cols="12" md="3">
|
|
64
|
+
<farm-textfield />
|
|
65
|
+
</farm-col>
|
|
66
|
+
<farm-col cols="12" md="3">
|
|
67
|
+
<farm-textfield />
|
|
68
|
+
</farm-col>
|
|
69
|
+
<farm-col cols="12" md="3">
|
|
70
|
+
<farm-textfield />
|
|
71
|
+
</farm-col>
|
|
72
|
+
<farm-col cols="12" md="3">
|
|
73
|
+
<farm-textfield />
|
|
74
|
+
</farm-col>
|
|
75
|
+
</farm-row>
|
|
59
76
|
</div>`,
|
|
60
|
-
});
|
|
77
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
2
|
+
<farm-row :class="{ 'justify-end': justifyEnd === true }">
|
|
3
|
+
<farm-col v-if="hasInitialInput" md="6">
|
|
4
4
|
<farm-label :for="elementId">
|
|
5
5
|
{{ !hasSlotData ? label : '' }}
|
|
6
6
|
<slot v-if="hasSlotData"></slot>
|
|
@@ -14,16 +14,17 @@
|
|
|
14
14
|
</farm-tooltip>
|
|
15
15
|
</farm-label>
|
|
16
16
|
<farm-textfield-v2 v-model="inputValue" :id="elementId" @keyup="onKeyUp" />
|
|
17
|
-
</
|
|
17
|
+
</farm-col>
|
|
18
18
|
<farm-btn
|
|
19
19
|
v-if="hasExtraFilters"
|
|
20
|
-
class="farm-
|
|
20
|
+
class="farm-btn__cta"
|
|
21
|
+
:title="extraFiltersBtnLabel"
|
|
21
22
|
@click="onFilterClick"
|
|
22
23
|
>
|
|
23
24
|
<farm-icon class="mr-2">{{ extraFiltersBtnIcon }}</farm-icon>
|
|
24
25
|
{{ extraFiltersBtnLabel }}
|
|
25
26
|
</farm-btn>
|
|
26
|
-
</
|
|
27
|
+
</farm-row>
|
|
27
28
|
</template>
|
|
28
29
|
|
|
29
30
|
<script lang="ts">
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<script lang="ts">
|
|
30
|
-
import Vue, { PropType, reactive, ref, toRefs, watch } from 'vue';
|
|
30
|
+
import Vue, { onBeforeUnmount, onMounted, PropType, reactive, ref, toRefs, watch } from 'vue';
|
|
31
31
|
import { calculateMainZindex } from '../../helpers';
|
|
32
32
|
|
|
33
33
|
export default Vue.extend({
|
|
@@ -61,6 +61,7 @@ export default Vue.extend({
|
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
setup(props, { emit }) {
|
|
64
|
+
let hasBeenBoostrapped = false;
|
|
64
65
|
const { offsetTop, offsetBottom, persistent, size } = toRefs(props);
|
|
65
66
|
const inputValue = ref(props.value);
|
|
66
67
|
const styleObject = reactive({ zIndex: 1 });
|
|
@@ -84,18 +85,33 @@ export default Vue.extend({
|
|
|
84
85
|
newValue => {
|
|
85
86
|
inputValue.value = newValue;
|
|
86
87
|
if (newValue) {
|
|
87
|
-
(
|
|
88
|
-
window.addEventListener('keyup', escHandler);
|
|
88
|
+
bootstrap();
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
|
|
93
|
+
onMounted(() => {
|
|
94
|
+
bootstrap();
|
|
95
|
+
});
|
|
96
|
+
|
|
93
97
|
const escHandler = event => {
|
|
94
98
|
if (event.key === 'Escape') {
|
|
95
99
|
close();
|
|
96
100
|
}
|
|
97
101
|
};
|
|
98
102
|
|
|
103
|
+
const bootstrap = () => {
|
|
104
|
+
styleObject.zIndex = calculateMainZindex();
|
|
105
|
+
window.addEventListener('keyup', escHandler);
|
|
106
|
+
hasBeenBoostrapped = true;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
onBeforeUnmount(() => {
|
|
110
|
+
if (hasBeenBoostrapped) {
|
|
111
|
+
window.removeEventListener('resize', escHandler);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
99
115
|
return {
|
|
100
116
|
inputValue,
|
|
101
117
|
styles,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import RadioGroup from './RadioGroup';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const colors = Object.keys(baseThemeColors);
|
|
2
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
5
3
|
|
|
6
4
|
export default {
|
|
7
5
|
title: 'Form/RadioGroup',
|
|
8
6
|
component: RadioGroup,
|
|
7
|
+
decorators: [withDesign],
|
|
9
8
|
parameters: {
|
|
10
9
|
docs: {
|
|
11
10
|
description: {
|
|
@@ -223,7 +223,7 @@ export default Vue.extend({
|
|
|
223
223
|
};
|
|
224
224
|
|
|
225
225
|
const updateSelectedTextValue = () => {
|
|
226
|
-
if (!items.value || items.value.length === 0 ||
|
|
226
|
+
if (!items.value || items.value.length === 0 || innerValue.value === null) {
|
|
227
227
|
selectedText.value = '';
|
|
228
228
|
return;
|
|
229
229
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { withDesign } from 'storybook-addon-designs';
|
|
2
2
|
import ValueCaption from '.';
|
|
3
|
+
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
4
|
+
const colors = Object.keys(baseThemeColors);
|
|
3
5
|
|
|
4
6
|
export default {
|
|
5
7
|
title: 'Display/ValueCaption',
|
|
@@ -31,3 +33,26 @@ export const Primary = () => ({
|
|
|
31
33
|
</farm-valuecaption>
|
|
32
34
|
`,
|
|
33
35
|
});
|
|
36
|
+
|
|
37
|
+
export const Colors = () => ({
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
colors: [...colors],
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
template: `<div class="d-flex flex-column">
|
|
44
|
+
<farm-valuecaption
|
|
45
|
+
icon="account-box-outline"
|
|
46
|
+
v-for="color of colors":key="color"
|
|
47
|
+
:iconBoxColor="color"
|
|
48
|
+
class="mb-3"
|
|
49
|
+
>
|
|
50
|
+
<template v-slot:title>
|
|
51
|
+
color: {{ color }}
|
|
52
|
+
</template>
|
|
53
|
+
<template v-slot:subtitle>
|
|
54
|
+
R$ 1.000,00
|
|
55
|
+
</template>
|
|
56
|
+
</farm-valuecaption>
|
|
57
|
+
</div>`,
|
|
58
|
+
});
|