@farm-investimentos/front-mfe-components 14.2.1 → 15.0.0
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 +4146 -5381
- 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 +4146 -5381
- 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/AlertBox/AlertBox.scss +3 -2
- package/src/components/AlertBox/AlertBox.vue +2 -0
- package/src/components/Buttons/DefaultButton/DefaultButton.scss +57 -18
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +49 -16
- package/src/components/Buttons/DefaultButton/DefaultButton.vue +3 -1
- package/src/components/Buttons/ExportButton/ExportButton.vue +2 -1
- package/src/components/Card/Card.scss +1 -1
- package/src/components/Card/CardComposition.stories.ts +8 -2
- package/src/components/Card/CardContent/CardContent.scss +11 -0
- package/src/components/Card/CardContent/CardContent.stories.js +11 -0
- package/src/components/Card/CardContent/CardContent.vue +9 -1
- package/src/components/CardContext/__tests__/CardContext.spec.js +5 -2
- package/src/components/Checkbox/Checkbox.scss +2 -2
- package/src/components/Checkbox/Checkbox.vue +2 -1
- package/src/components/Chip/Chip.scss +15 -15
- package/src/components/Chip/Chip.stories.js +13 -13
- package/src/components/Chip/Chip.stories.scss +1 -16
- package/src/components/Chip/Chip.vue +25 -3
- package/src/components/Collapsible/Collapsible.scss +8 -3
- package/src/components/Collapsible/Collapsible.stories.js +68 -1
- package/src/components/Collapsible/Collapsible.vue +68 -8
- package/src/components/ContextMenu/ContextMenu.scss +1 -1
- package/src/components/ContextMenu/ContextMenu.stories.js +42 -29
- package/src/components/ContextMenu/ContextMenu.vue +20 -1
- package/src/components/CopyToClipboard/CopyToClipboard.stories.js +7 -1
- package/src/components/CopyToClipboard/CopyToClipboard.vue +15 -3
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.scss +6 -9
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +4 -0
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.vue +21 -5
- package/src/components/{TextField/__tests__/TextField.spec.js → DataTableEmptyWrapper/__tests__/DataTableEmptyWrapper.spec.js} +3 -3
- package/src/components/DataTableHeader/DataTableHeader.scss +10 -12
- package/src/components/DataTableHeader/DataTableHeader.vue +5 -4
- package/src/components/DataTablePaginator/DataTablePaginator.scss +71 -69
- package/src/components/DatePicker/DatePicker.scss +5 -5
- package/src/components/DatePicker/DatePicker.vue +2 -3
- package/src/components/DatePicker/__tests__/DatePicker.spec.js +1 -1
- package/src/components/DatePicker/vDatePicker.scss +214 -0
- package/src/components/DialogFooter/DialogFooter.scss +1 -1
- package/src/components/DialogFooter/DialogFooter.stories.js +2 -2
- package/src/components/DialogFooter/DialogFooter.vue +1 -1
- package/src/components/DialogHeader/DialogHeader.scss +2 -3
- package/src/components/DialogHeader/DialogHeader.vue +4 -4
- package/src/components/Form/Form.stories.js +1 -1
- package/src/components/Icon/Icon.scss +6 -0
- package/src/components/Icon/Icon.stories.js +19 -1
- package/src/components/Icon/Icon.vue +8 -2
- package/src/components/IconBox/IconBox.stories.js +16 -0
- package/src/components/IconBox/IconBox.vue +17 -7
- package/src/components/IdCaption/IdCaption.vue +27 -13
- package/src/components/Label/Label.scss +17 -5
- package/src/components/Label/Label.stories.js +0 -1
- package/src/components/ListItem/ListItem.scss +5 -3
- package/src/components/ListItem/ListItem.vue +2 -0
- package/src/components/Logger/LoggerItem/LoggerItem.scss +9 -1
- package/src/components/Logger/LoggerItem/LoggerItem.vue +25 -8
- package/src/components/Logger/LoggerItem/__tests__/LoggerItem.spec.js +1 -1
- package/src/components/MainFilter/MainFilter.stories.js +4 -4
- package/src/components/Modal/Modal.scss +3 -3
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +26 -0
- package/src/components/ModalPromptUser/ModalPromptUser.vue +10 -0
- package/src/components/MultipleFilePicker/MultipleFilePicker.scss +19 -12
- package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +12 -0
- package/src/components/MultipleFilePicker/MultipleFilePicker.vue +18 -11
- package/src/components/MultipleFilePicker/__tests__/MultipleFilePicker.spec.js +9 -0
- package/src/components/ProgressBar/ProgressBar.vue +4 -0
- package/src/components/Radio/Radio.scss +18 -4
- package/src/components/Radio/Radio.stories.js +2 -1
- package/src/components/Radio/Radio.vue +3 -1
- package/src/components/RangeDatePicker/RangeDatePicker.vue +0 -2
- package/src/components/ResourceMetaInfo/ResourceMetaInfo.vue +8 -8
- package/src/components/Select/Select.scss +4 -0
- package/src/components/Select/Select.vue +9 -1
- package/src/components/Stepper/StepperHeader/StepperHeader.scss +7 -7
- package/src/components/Stepper/StepperHeader/StepperHeader.vue +35 -36
- package/src/components/Switcher/Switcher.scss +24 -8
- package/src/components/Switcher/Switcher.stories.js +33 -0
- package/src/components/Switcher/Switcher.vue +24 -3
- package/src/components/TableContextMenu/TableContextMenu.scss +4 -9
- package/src/components/TableContextMenu/TableContextMenu.stories.js +2 -0
- package/src/components/TableContextMenu/TableContextMenu.vue +5 -4
- package/src/components/Tabs/Tabs.scss +69 -0
- package/src/components/Tabs/Tabs.stories.js +51 -4
- package/src/components/Tabs/Tabs.vue +59 -32
- package/src/components/Tabs/__tests__/Tabs.spec.js +54 -54
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/TextArea/TextArea.scss +7 -3
- package/src/components/TextArea/TextArea.vue +1 -0
- package/src/components/TextFieldV2/TextFieldV2.scss +8 -4
- package/src/components/TextFieldV2/TextFieldV2.vue +1 -0
- package/src/components/Tooltip/Tooltip.scss +8 -10
- package/src/components/Tooltip/Tooltip.vue +4 -2
- package/src/components/Typography/BodyText/BodyText.scss +7 -7
- package/src/components/Typography/Caption/Caption.scss +7 -7
- package/src/components/Typography/Caption/Caption.stories.js +1 -1
- package/src/components/Typography/Caption/Caption.vue +4 -1
- package/src/components/Typography/Caption/configurations.ts +3 -2
- package/src/components/Typography/Heading/Heading.scss +19 -19
- package/src/components/Typography/Heading/configurations.ts +5 -5
- package/src/components/Typography/Small/Small.scss +3 -0
- package/src/components/Typography/Small/Small.stories.js +34 -0
- package/src/components/Typography/Small/Small.vue +47 -0
- package/src/components/Typography/Small/__tests__/Small.spec.js +31 -0
- package/src/components/Typography/Small/configurations.ts +7 -0
- package/src/components/Typography/Subtitle/Subtitle.scss +7 -7
- package/src/components/Typography/Typography.scss +10 -0
- package/src/components/Typography/Typography.stories.js +15 -2
- package/src/components/Typography/Typography.vue +6 -2
- package/src/components/Typography/index.ts +2 -1
- package/src/components/ValueCaption/ValueCaption.vue +2 -0
- package/src/components/layout/Line/Line.scss +15 -0
- package/src/components/layout/Line/Line.stories.js +28 -5
- package/src/components/layout/Line/Line.vue +37 -3
- package/src/configurations/_mixins.scss +1 -1
- package/src/configurations/_theme-colors-background.scss +10 -0
- package/src/configurations/_theme-colors-bw.scss +10 -0
- package/src/configurations/_theme-colors.scss +79 -48
- package/src/configurations/_variables.scss +2 -0
- package/src/examples/Colors.stories.js +39 -1
- package/src/examples/Colors.stories.scss +1 -1
- package/src/helpers/index.ts +2 -1
- package/src/helpers/isChildOfFixedElement.js +16 -0
- package/src/main.ts +1 -5
- package/src/scss/Sticky-table.scss +13 -7
- package/src/scss/VuejsDialog.scss +58 -51
- package/src/scss/cssVariablesGenerator.scss +17 -14
- package/src/scss/utils.scss +17 -251
- package/src/components/FilePicker/FilePicker.scss +0 -53
- package/src/components/FilePicker/FilePicker.stories.js +0 -14
- package/src/components/FilePicker/FilePicker.vue +0 -109
- package/src/components/FilePicker/__tests__/FilePicker.spec.js +0 -77
- package/src/components/FilePicker/index.ts +0 -3
- package/src/components/TextField/TextField.scss +0 -43
- package/src/components/TextField/TextField.stories.js +0 -104
- package/src/components/TextField/TextField.vue +0 -18
- package/src/components/TextField/index.ts +0 -4
- package/src/scss/ButtonOverrides.scss +0 -73
- package/src/scss/DefaultModal.scss +0 -89
- package/src/scss/DialogOverrides.scss +0 -94
- package/src/scss/FormOverrides.scss +0 -264
- package/src/scss/Status-Chip.scss +0 -34
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span
|
|
3
|
+
v-bind="$props"
|
|
4
|
+
v-on="$listeners"
|
|
3
5
|
:class="{
|
|
4
6
|
'farm-chip': true,
|
|
5
7
|
'farm-chip--dense': dense,
|
|
6
8
|
'farm-chip--outlined': outlined,
|
|
9
|
+
'farm-chip--base': variation === 'base' || !variation,
|
|
7
10
|
'farm-chip--lighten': variation === 'lighten',
|
|
8
11
|
'farm-chip--darken': variation === 'darken',
|
|
9
12
|
}"
|
|
10
13
|
>
|
|
11
|
-
<farm-
|
|
14
|
+
<farm-caption tag="span" color="white" ellipsis> <slot></slot> </farm-caption>
|
|
12
15
|
</span>
|
|
13
16
|
</template>
|
|
14
17
|
<script lang="ts">
|
|
15
|
-
import Vue from 'vue';
|
|
18
|
+
import Vue, { PropType } from 'vue';
|
|
16
19
|
|
|
17
20
|
export default Vue.extend({
|
|
18
21
|
name: 'farm-chip',
|
|
19
22
|
inheritAttrs: true,
|
|
20
23
|
props: {
|
|
24
|
+
/**
|
|
25
|
+
* Color
|
|
26
|
+
*/
|
|
27
|
+
color: {
|
|
28
|
+
type: String as PropType<
|
|
29
|
+
| 'primary'
|
|
30
|
+
| 'secondary'
|
|
31
|
+
| 'secondary-green'
|
|
32
|
+
| 'secondary-golden'
|
|
33
|
+
| 'neutral'
|
|
34
|
+
| 'info'
|
|
35
|
+
| 'success'
|
|
36
|
+
| 'error'
|
|
37
|
+
| 'warning'
|
|
38
|
+
| 'extra-1'
|
|
39
|
+
| 'extra-2'
|
|
40
|
+
>,
|
|
41
|
+
default: 'primary',
|
|
42
|
+
},
|
|
21
43
|
/**
|
|
22
44
|
* Is dense (not 100% width)?
|
|
23
45
|
*/
|
|
@@ -34,7 +56,7 @@ export default Vue.extend({
|
|
|
34
56
|
},
|
|
35
57
|
variation: {
|
|
36
58
|
type: String,
|
|
37
|
-
default: '',
|
|
59
|
+
default: 'base',
|
|
38
60
|
},
|
|
39
61
|
},
|
|
40
62
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.collapsible {
|
|
2
2
|
width: 100%;
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
&__header {
|
|
5
5
|
width: 100%;
|
|
6
6
|
display: flex;
|
|
@@ -15,8 +15,13 @@
|
|
|
15
15
|
justify-content: flex-start;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
&
|
|
18
|
+
&__content-right {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
}
|
|
19
23
|
|
|
24
|
+
&__icon {
|
|
20
25
|
&--main {
|
|
21
26
|
margin-right: 0.5rem;
|
|
22
27
|
}
|
|
@@ -40,4 +45,4 @@
|
|
|
40
45
|
.fade-enter,
|
|
41
46
|
.fade-leave-to {
|
|
42
47
|
opacity: 0;
|
|
43
|
-
}
|
|
48
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import Collapsible from './Collapsible';
|
|
2
|
+
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
3
|
+
const colors = Object.keys(baseThemeColors);
|
|
4
|
+
const variations = ['', 'darken', 'lighten'];
|
|
2
5
|
|
|
3
6
|
export default {
|
|
4
7
|
title: 'Surfaces/Collapsible',
|
|
@@ -22,7 +25,8 @@ export const Title = () => ({
|
|
|
22
25
|
});
|
|
23
26
|
|
|
24
27
|
export const Icon = () => ({
|
|
25
|
-
template:
|
|
28
|
+
template:
|
|
29
|
+
'<farm-collapsible icon="plus" title="With Icon">collapsible content</farm-collapsible>',
|
|
26
30
|
});
|
|
27
31
|
|
|
28
32
|
export const Opened = () => ({
|
|
@@ -43,7 +47,70 @@ export const Opened = () => ({
|
|
|
43
47
|
</div>`,
|
|
44
48
|
});
|
|
45
49
|
|
|
50
|
+
export const ColorsChips = () => ({
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
colors,
|
|
54
|
+
variations,
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
template: `
|
|
58
|
+
<farm-row>
|
|
59
|
+
<farm-col cols="12" md="4" v-for="color in colors" :key="'color_' + color">
|
|
60
|
+
<h4 style="margin:15px">{{ color }}</h4>
|
|
61
|
+
<farm-collapsible
|
|
62
|
+
style="margin-top:15px"
|
|
63
|
+
v-for="variation in variations"
|
|
64
|
+
icon="plus"
|
|
65
|
+
textChip="chip"
|
|
66
|
+
title="color chip"
|
|
67
|
+
:key="color + '_' + variation"
|
|
68
|
+
:showChip="true"
|
|
69
|
+
:colorChip="color"
|
|
70
|
+
:variation="variation"
|
|
71
|
+
>
|
|
72
|
+
</farm-collapsible>
|
|
73
|
+
</farm-col>
|
|
74
|
+
</farm-row>`,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const ColorsOutlinedChips = () => ({
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
colors,
|
|
81
|
+
variations,
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
template: `
|
|
85
|
+
<farm-row>
|
|
86
|
+
<farm-col cols="12" md="4" v-for="color in colors" :key="'color_' + color">
|
|
87
|
+
<h4 style="margin:15px">{{ color }}</h4>
|
|
88
|
+
<farm-collapsible
|
|
89
|
+
style="margin-top:15px"
|
|
90
|
+
v-for="variation in variations"
|
|
91
|
+
icon="plus"
|
|
92
|
+
textChip="chip"
|
|
93
|
+
title="color chip"
|
|
94
|
+
:key="color + '_' + variation"
|
|
95
|
+
:showChip="true"
|
|
96
|
+
:outlined="true"
|
|
97
|
+
:colorChip="color"
|
|
98
|
+
:variation="variation"
|
|
99
|
+
>
|
|
100
|
+
</farm-collapsible>
|
|
101
|
+
</farm-col>
|
|
102
|
+
</farm-row>`,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export const Dense = () => ({
|
|
106
|
+
template:
|
|
107
|
+
'<farm-collapsible icon="plus" title="With Icon" textChip="chip" dense showChip>collapsible content</farm-collapsible>',
|
|
108
|
+
});
|
|
109
|
+
|
|
46
110
|
Primary.storyName = 'Basic';
|
|
47
111
|
Title.storyName = 'Title';
|
|
48
112
|
Icon.storyName = 'Icon';
|
|
49
113
|
Opened.storyName = 'Opened';
|
|
114
|
+
ColorsChips.storyName = 'Colors';
|
|
115
|
+
ColorsOutlinedChips.storyName = 'Outlined';
|
|
116
|
+
Dense.storyName = 'Dense';
|
|
@@ -4,18 +4,30 @@
|
|
|
4
4
|
<div class="collapsible__header" @click="onToggleCollapsible(status)">
|
|
5
5
|
<div class="collapsible__content-title">
|
|
6
6
|
<div class="collapsible__icon collapsible__icon--main" v-if="icon !== ''">
|
|
7
|
-
<farm-icon size="md">
|
|
7
|
+
<farm-icon size="md" color="secondary-green">
|
|
8
8
|
{{ icon }}
|
|
9
9
|
</farm-icon>
|
|
10
10
|
</div>
|
|
11
|
-
<farm-
|
|
11
|
+
<farm-heading type="6" color="black">
|
|
12
12
|
{{ title }}
|
|
13
|
-
</farm-
|
|
13
|
+
</farm-heading>
|
|
14
14
|
</div>
|
|
15
|
-
<div class="
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
<div class="collapsible__content-right">
|
|
16
|
+
<div class="collapsible__icon" v-if="showChip">
|
|
17
|
+
<farm-chip
|
|
18
|
+
:color="colorChip"
|
|
19
|
+
:dense="dense"
|
|
20
|
+
:variation="variation"
|
|
21
|
+
:outlined="outlined"
|
|
22
|
+
>
|
|
23
|
+
{{ textChip }}
|
|
24
|
+
</farm-chip>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="collapsible__icon collapsible__icon--arrow">
|
|
27
|
+
<farm-icon size="md" color="primary">
|
|
28
|
+
{{ arrowIcon }}
|
|
29
|
+
</farm-icon>
|
|
30
|
+
</div>
|
|
19
31
|
</div>
|
|
20
32
|
</div>
|
|
21
33
|
<transition name="fade">
|
|
@@ -28,7 +40,7 @@
|
|
|
28
40
|
</template>
|
|
29
41
|
|
|
30
42
|
<script lang="ts">
|
|
31
|
-
import Vue from 'vue';
|
|
43
|
+
import Vue, { PropType } from 'vue';
|
|
32
44
|
|
|
33
45
|
export default Vue.extend({
|
|
34
46
|
name: 'farm-collapsible',
|
|
@@ -56,6 +68,54 @@ export default Vue.extend({
|
|
|
56
68
|
type: Boolean,
|
|
57
69
|
default: false,
|
|
58
70
|
},
|
|
71
|
+
/**
|
|
72
|
+
* show Chip
|
|
73
|
+
*/
|
|
74
|
+
showChip: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: false,
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* text of Chip
|
|
80
|
+
*/
|
|
81
|
+
textChip: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: '',
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* color of Chip
|
|
87
|
+
*/
|
|
88
|
+
colorChip: {
|
|
89
|
+
type: String as PropType<
|
|
90
|
+
| 'primary'
|
|
91
|
+
| 'secondary'
|
|
92
|
+
| 'secondary-green'
|
|
93
|
+
| 'secondary-golden'
|
|
94
|
+
| 'neutral'
|
|
95
|
+
| 'info'
|
|
96
|
+
| 'success'
|
|
97
|
+
| 'error'
|
|
98
|
+
| 'warning'
|
|
99
|
+
| 'extra-1'
|
|
100
|
+
| 'extra-2'
|
|
101
|
+
>,
|
|
102
|
+
default: 'primary',
|
|
103
|
+
},
|
|
104
|
+
dense: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false,
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Is outlined
|
|
110
|
+
*/
|
|
111
|
+
outlined: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: false,
|
|
114
|
+
},
|
|
115
|
+
variation: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: 'base',
|
|
118
|
+
},
|
|
59
119
|
},
|
|
60
120
|
|
|
61
121
|
data() {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
overflow-y: auto;
|
|
15
15
|
overflow-x: hidden;
|
|
16
16
|
contain: content;
|
|
17
|
-
font-family: '
|
|
17
|
+
font-family: 'Manrope', sans-serif !important;
|
|
18
18
|
|
|
19
19
|
transform-origin: left top;
|
|
20
20
|
transition: visibility 0.1s linear, opacity 0.1s linear;
|
|
@@ -20,9 +20,9 @@ export default {
|
|
|
20
20
|
|
|
21
21
|
export const Primary = () => ({
|
|
22
22
|
template: `<div style="padding-left: 120px; padding-top: 80px; display: flex;">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
<farm-contextmenu>
|
|
24
|
+
some text
|
|
25
|
+
<template v-slot:activator="{ on, attrs }">
|
|
26
26
|
<farm-btn
|
|
27
27
|
v-bind="attrs"
|
|
28
28
|
v-on="on"
|
|
@@ -67,27 +67,6 @@ export const IconActivator = () => ({
|
|
|
67
67
|
</div>`,
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
export const VModel = () => ({
|
|
71
|
-
data() {
|
|
72
|
-
return {
|
|
73
|
-
value: false,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
methods: {
|
|
77
|
-
toggleValue() {
|
|
78
|
-
this.value = !this.value;
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
template: `<div style="padding-left: 120px; padding-top: 80px; display: flex;">
|
|
82
|
-
<farm-contextmenu v-model="value">
|
|
83
|
-
some text
|
|
84
|
-
<template v-slot:activator="{ on, attrs }">
|
|
85
|
-
<farm-btn @click="toggleValue">toggle</farm-btn>
|
|
86
|
-
</template>
|
|
87
|
-
</farm-contextmenu>
|
|
88
|
-
</div>`,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
70
|
export const LongContent = () => ({
|
|
92
71
|
data() {
|
|
93
72
|
return {
|
|
@@ -95,8 +74,9 @@ export const LongContent = () => ({
|
|
|
95
74
|
};
|
|
96
75
|
},
|
|
97
76
|
methods: {
|
|
98
|
-
toggleValue() {
|
|
77
|
+
toggleValue(event) {
|
|
99
78
|
this.value = !this.value;
|
|
79
|
+
event.stopPropagation();
|
|
100
80
|
},
|
|
101
81
|
},
|
|
102
82
|
template: `<div style="padding-left: 120px; padding-top: 80px;">
|
|
@@ -117,8 +97,9 @@ export const Bottom = () => ({
|
|
|
117
97
|
};
|
|
118
98
|
},
|
|
119
99
|
methods: {
|
|
120
|
-
toggleValue() {
|
|
100
|
+
toggleValue(event) {
|
|
121
101
|
this.value = !this.value;
|
|
102
|
+
event.stopPropagation();
|
|
122
103
|
},
|
|
123
104
|
},
|
|
124
105
|
template: `<div style="padding-left: 120px; padding-top: 80px; display: flex;">
|
|
@@ -138,8 +119,9 @@ export const ComplexContent = () => ({
|
|
|
138
119
|
};
|
|
139
120
|
},
|
|
140
121
|
methods: {
|
|
141
|
-
toggleValue() {
|
|
122
|
+
toggleValue(event) {
|
|
142
123
|
this.value = !this.value;
|
|
124
|
+
event.stopPropagation();
|
|
143
125
|
},
|
|
144
126
|
},
|
|
145
127
|
template: `<div style="padding-left: 120px; padding-top: 80px; display: flex;">
|
|
@@ -159,8 +141,9 @@ export const OverflowContent = () => ({
|
|
|
159
141
|
};
|
|
160
142
|
},
|
|
161
143
|
methods: {
|
|
162
|
-
toggleValue() {
|
|
144
|
+
toggleValue(event) {
|
|
163
145
|
this.value = !this.value;
|
|
146
|
+
event.stopPropagation();
|
|
164
147
|
},
|
|
165
148
|
},
|
|
166
149
|
template: `<div style="padding-left: 120px; padding-top: 80px; display: flex; flex-direction: column">
|
|
@@ -190,8 +173,9 @@ export const MaxHeight = () => ({
|
|
|
190
173
|
};
|
|
191
174
|
},
|
|
192
175
|
methods: {
|
|
193
|
-
toggleValue() {
|
|
176
|
+
toggleValue(event) {
|
|
194
177
|
this.value = !this.value;
|
|
178
|
+
event.stopPropagation();
|
|
195
179
|
},
|
|
196
180
|
},
|
|
197
181
|
template: `<div style="padding-left: 120px; padding-top: 80px; display: flex; flex-direction: column;">
|
|
@@ -210,3 +194,32 @@ export const MaxHeight = () => ({
|
|
|
210
194
|
</farm-contextmenu>
|
|
211
195
|
</div>`,
|
|
212
196
|
});
|
|
197
|
+
|
|
198
|
+
export const VModel = () => ({
|
|
199
|
+
data() {
|
|
200
|
+
return {
|
|
201
|
+
value: false,
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
methods: {
|
|
205
|
+
toggleValue(event) {
|
|
206
|
+
this.value = true;
|
|
207
|
+
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
this.value = false;
|
|
210
|
+
}, 2000);
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
event.stopPropagation();
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
template: `<div style="padding-left: 120px; padding-top: 80px; display: flex;">
|
|
216
|
+
<farm-contextmenu bottom v-model="value">
|
|
217
|
+
some text
|
|
218
|
+
<template v-slot:activator="{ on, attrs }">
|
|
219
|
+
<farm-btn :disabled="value" @click="toggleValue">
|
|
220
|
+
{{ !value ? 'Open' : 'Will close in 2s' }}
|
|
221
|
+
</farm-btn>
|
|
222
|
+
</template>
|
|
223
|
+
</farm-contextmenu>
|
|
224
|
+
</div>`,
|
|
225
|
+
});
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
<script lang="ts">
|
|
20
20
|
import Vue, { ref, watch, reactive, onBeforeUnmount, toRefs } from 'vue';
|
|
21
|
-
import { calculateMainZindex } from '../../helpers';
|
|
21
|
+
import { calculateMainZindex, isChildOfFixedElement } from '../../helpers';
|
|
22
22
|
|
|
23
23
|
export default Vue.extend({
|
|
24
24
|
name: 'farm-contextmenu',
|
|
@@ -97,6 +97,13 @@ export default Vue.extend({
|
|
|
97
97
|
calculatePosition();
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
+
watch(
|
|
101
|
+
() => props.value,
|
|
102
|
+
newValue => {
|
|
103
|
+
inputValue.value = newValue;
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
|
|
100
107
|
watch(
|
|
101
108
|
() => inputValue.value,
|
|
102
109
|
newValue => {
|
|
@@ -123,6 +130,8 @@ export default Vue.extend({
|
|
|
123
130
|
if (!parent.value || !activator.value.children[0]) {
|
|
124
131
|
return;
|
|
125
132
|
}
|
|
133
|
+
const activatorChildOfFixedElement = isChildOfFixedElement(activator.value);
|
|
134
|
+
|
|
126
135
|
const parentBoundingClientRect = parent.value.getBoundingClientRect();
|
|
127
136
|
const activatorBoundingClientRect = activator.value.children[0].getBoundingClientRect();
|
|
128
137
|
const popupClientRect = popup.value.getBoundingClientRect();
|
|
@@ -166,8 +175,18 @@ export default Vue.extend({
|
|
|
166
175
|
offsetTop -= bottomEdge - window.scrollY - clientHeight + 12;
|
|
167
176
|
}
|
|
168
177
|
|
|
178
|
+
if (activatorChildOfFixedElement) {
|
|
179
|
+
styles.position = 'fixed';
|
|
180
|
+
offsetTop =
|
|
181
|
+
parentBoundingClientRect.top +
|
|
182
|
+
(!bottom.value ? 0 : activatorBoundingClientRect.height);
|
|
183
|
+
} else {
|
|
184
|
+
styles.position = 'absolute';
|
|
185
|
+
}
|
|
186
|
+
|
|
169
187
|
styles.top = `${offsetTop}px`;
|
|
170
188
|
styles.left = `${offsetLeft}px`;
|
|
189
|
+
|
|
171
190
|
styles.zIndex = calculateMainZindex();
|
|
172
191
|
};
|
|
173
192
|
|
|
@@ -24,6 +24,12 @@ export const Primary = () => ({
|
|
|
24
24
|
</div>`,
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
export const SizeIcon = () => ({
|
|
28
|
+
template: `<div style="max-width: 480px; padding-top: 80px; padding-left: 80px;">
|
|
29
|
+
<farm-copytoclipboard toCopy="To be copied" sizeIcon="20px" />
|
|
30
|
+
</div>`,
|
|
31
|
+
});
|
|
32
|
+
|
|
27
33
|
export const NoIcon = () => ({
|
|
28
34
|
template: `<div style="max-width: 480px; padding-top: 80px; padding-left: 80px;">
|
|
29
35
|
<farm-copytoclipboard toCopy="To be copied" :isIcon="false" />
|
|
@@ -62,4 +68,4 @@ export const SuccessTimeout = () => ({
|
|
|
62
68
|
template: `<div style="max-width: 480px; padding-top: 80px; padding-left: 80px;">
|
|
63
69
|
<farm-copytoclipboard toCopy="To be copied" success-timeout="5000" />
|
|
64
70
|
</div>`,
|
|
65
|
-
});
|
|
71
|
+
});
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
{{ feedbackMessage }}
|
|
4
4
|
<template v-slot:activator="{}">
|
|
5
5
|
<farm-btn v-if="isIcon" title="Copiar" icon :disabled="disabled" @click="onClick">
|
|
6
|
-
<farm-icon size="
|
|
6
|
+
<farm-icon :size="sizeIcon">content-copy</farm-icon>
|
|
7
7
|
</farm-btn>
|
|
8
8
|
<farm-btn v-else outlined title="Copiar" :disabled="disabled" @click="onClick">
|
|
9
|
-
<farm-icon>content-copy</farm-icon>
|
|
9
|
+
<farm-icon :size="sizeIcon">content-copy</farm-icon>
|
|
10
10
|
Copiar
|
|
11
11
|
</farm-btn>
|
|
12
12
|
</template>
|
|
@@ -28,6 +28,15 @@ export default Vue.extend({
|
|
|
28
28
|
* Is button with icon?
|
|
29
29
|
*/
|
|
30
30
|
isIcon: { type: Boolean, default: true },
|
|
31
|
+
/**
|
|
32
|
+
* sizeIcon: icon size setting
|
|
33
|
+
*/
|
|
34
|
+
sizeIcon: {
|
|
35
|
+
type: String as PropType<
|
|
36
|
+
'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'other (examples: 12px, 3rem)'
|
|
37
|
+
>,
|
|
38
|
+
default: 'xs',
|
|
39
|
+
},
|
|
31
40
|
/**
|
|
32
41
|
* Success message content after copy
|
|
33
42
|
*/
|
|
@@ -42,12 +51,13 @@ export default Vue.extend({
|
|
|
42
51
|
type: String as PropType<
|
|
43
52
|
| 'primary'
|
|
44
53
|
| 'secondary'
|
|
54
|
+
| 'secondary-green'
|
|
55
|
+
| 'secondary-golden'
|
|
45
56
|
| 'neutral'
|
|
46
57
|
| 'info'
|
|
47
58
|
| 'success'
|
|
48
59
|
| 'error'
|
|
49
60
|
| 'warning'
|
|
50
|
-
| 'success'
|
|
51
61
|
| 'extra-1'
|
|
52
62
|
| 'extra-2'
|
|
53
63
|
>,
|
|
@@ -65,6 +75,7 @@ export default Vue.extend({
|
|
|
65
75
|
const show = ref(false);
|
|
66
76
|
const feedbackMessage = ref('');
|
|
67
77
|
const disabled = ref(false);
|
|
78
|
+
const sizeIcon = ref(props.sizeIcon);
|
|
68
79
|
const { toCopy, isIcon, successMessage, successTimeout } = toRefs(props);
|
|
69
80
|
|
|
70
81
|
const onClick = async () => {
|
|
@@ -86,6 +97,7 @@ export default Vue.extend({
|
|
|
86
97
|
return {
|
|
87
98
|
show,
|
|
88
99
|
isIcon,
|
|
100
|
+
sizeIcon,
|
|
89
101
|
feedbackMessage,
|
|
90
102
|
disabled,
|
|
91
103
|
onClick,
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
div {
|
|
2
|
-
border-top: 1px solid var(--farm-stroke-divider);
|
|
3
2
|
padding: 64px 24px 32px;
|
|
4
3
|
display: flex;
|
|
5
4
|
flex-direction: column;
|
|
6
5
|
justify-content: center;
|
|
7
6
|
text-align: center;
|
|
8
7
|
|
|
9
|
-
p
|
|
10
|
-
|
|
8
|
+
p {
|
|
9
|
+
&:first-of-type {
|
|
10
|
+
margin: 24px auto;
|
|
11
|
+
}
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.farm-icon.farm-icon--primary {
|
|
18
|
-
color: var(--farm-text-disabled);
|
|
14
|
+
&.farm-emptywrapper--bordered {
|
|
15
|
+
border-top: 1px solid var(--farm-stroke-divider);
|
|
19
16
|
}
|
|
20
17
|
}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div
|
|
3
|
+
:class="{
|
|
4
|
+
'farm-emptywrapper': true,
|
|
5
|
+
'farm-emptywrapper--bordered': bordered,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
8
|
+
<farm-icon size="xl" color="gray">magnify</farm-icon>
|
|
9
|
+
<farm-bodytext type="2" variation="bold" color="black" color-variation="40">
|
|
10
|
+
{{ title }}
|
|
11
|
+
</farm-bodytext>
|
|
12
|
+
<farm-caption v-if="subtitle" variation="regular" color-variation="30">
|
|
13
|
+
{{ subtitle }}
|
|
14
|
+
</farm-caption>
|
|
6
15
|
</div>
|
|
7
16
|
</template>
|
|
8
17
|
<script lang="ts">
|
|
@@ -24,7 +33,14 @@ export default Vue.extend({
|
|
|
24
33
|
subtitle: {
|
|
25
34
|
type: String,
|
|
26
35
|
default:
|
|
27
|
-
'Tente filtrar novamente sua pesquisa
|
|
36
|
+
'Tente filtrar novamente sua pesquisa.',
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Has border?
|
|
40
|
+
*/
|
|
41
|
+
bordered: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true,
|
|
28
44
|
},
|
|
29
45
|
},
|
|
30
46
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import
|
|
2
|
+
import DataTableEmptyWrapper from '../DataTableEmptyWrapper';
|
|
3
3
|
|
|
4
|
-
describe('
|
|
4
|
+
describe('DataTableEmptyWrapper component', () => {
|
|
5
5
|
let wrapper;
|
|
6
6
|
|
|
7
7
|
beforeEach(() => {
|
|
8
|
-
wrapper = shallowMount(
|
|
8
|
+
wrapper = shallowMount(DataTableEmptyWrapper, {});
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('Created hook', () => {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
.header-text {
|
|
2
2
|
position: relative;
|
|
3
|
-
color: var(--farm-secondary-
|
|
3
|
+
color: var(--farm-secondary-green-darken);
|
|
4
4
|
font-size: 14px;
|
|
5
|
+
font-weight: 700;
|
|
5
6
|
|
|
6
7
|
.farm-icon {
|
|
7
8
|
position: absolute;
|
|
8
9
|
right: -20px;
|
|
9
10
|
top: -1px;
|
|
10
|
-
|
|
11
|
+
transition: transform 0.8s ease-in-out;
|
|
11
12
|
|
|
12
|
-
.farm-icon {
|
|
13
|
-
transition: transform .8s ease-in-out;
|
|
14
13
|
&.farm-icon--asc {
|
|
15
14
|
transform: rotateX(180deg);
|
|
16
15
|
}
|
|
@@ -22,7 +21,7 @@ th.sortable {
|
|
|
22
21
|
&:not(.active) {
|
|
23
22
|
&:hover {
|
|
24
23
|
.farm-icon::before {
|
|
25
|
-
color: var(--farm-
|
|
24
|
+
color: var(--farm-bw-black-30) !important;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -30,7 +29,6 @@ th.sortable {
|
|
|
30
29
|
.header-text {
|
|
31
30
|
transition: color 0.5s ease;
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
th span.span-checkbox {
|
|
@@ -55,13 +53,13 @@ th {
|
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
|
|
58
|
-
:deep(.mdi-sort-
|
|
59
|
-
color: var(--farm-
|
|
60
|
-
font-size:
|
|
61
|
-
font-weight:
|
|
56
|
+
:deep(.mdi-sort-reverse-variant)::before {
|
|
57
|
+
color: var(--farm-bw-black-30);
|
|
58
|
+
font-size: 16px;
|
|
59
|
+
font-weight: 400;
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
.farm-icon--desc,
|
|
65
63
|
.farm-icon--asc {
|
|
66
|
-
margin-top:
|
|
67
|
-
}
|
|
64
|
+
margin-top: 3px;
|
|
65
|
+
}
|