@farm-investimentos/front-mfe-components 11.1.0 → 11.2.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 +790 -695
- 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 +790 -695
- 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/ExportButton/ExportButton.stories.js +11 -4
- package/src/components/Buttons/ExportButton/ExportButton.vue +29 -70
- package/src/components/Card/Card.scss +2 -2
- package/src/components/Card/Card.stories.js +0 -1
- package/src/components/Card/Card.vue +4 -1
- package/src/components/Card/CardComposition.stories.ts +1 -2
- package/src/components/Card/CardContent/CardContent.stories.js +13 -2
- package/src/components/Card/CardContent/CardContent.vue +6 -3
- package/src/components/Checkbox/Checkbox.scss +10 -0
- package/src/components/Checkbox/Checkbox.stories.js +15 -1
- package/src/components/Checkbox/Checkbox.vue +9 -1
- package/src/components/ContextMenu/ContextMenu.vue +18 -8
- package/src/components/DataTableHeader/DataTableHeader.scss +9 -1
- package/src/components/DataTableHeader/DataTableHeader.stories.js +48 -24
- package/src/components/DataTableHeader/DataTableHeader.vue +7 -11
- package/src/components/DataTablePaginator/DataTablePaginator.scss +24 -7
- package/src/components/DataTablePaginator/DataTablePaginator.vue +45 -11
- package/src/components/DatePicker/DatePicker.vue +6 -0
- package/src/components/DialogHeader/DialogHeader.stories.js +11 -0
- package/src/components/DialogHeader/DialogHeader.vue +8 -9
- package/src/components/Form/Form.stories.js +52 -0
- package/src/components/Form/Form.vue +2 -0
- package/src/components/IconBox/IconBox.scss +8 -0
- package/src/components/IconBox/IconBox.vue +1 -1
- package/src/components/IdCaption/IdCaption.stories.js +18 -0
- package/src/components/IdCaption/IdCaption.vue +21 -2
- package/src/components/Loader/Loader.stories.ts +1 -1
- package/src/components/Loader/Loader.vue +50 -58
- package/src/components/Modal/Modal.scss +0 -1
- package/src/components/Modal/Modal.vue +13 -4
- package/src/components/RangeDatePicker/RangeDatePicker.vue +6 -0
- package/src/components/Switcher/Switcher.scss +6 -0
- package/src/components/Switcher/Switcher.stories.js +28 -0
- package/src/components/Switcher/Switcher.vue +27 -2
- package/src/components/TableContextMenu/TableContextMenu.stories.js +15 -0
- package/src/components/Typography/Typography.scss +2 -1
- package/src/helpers/calculateMainZindex.js +10 -0
- package/src/helpers/date.js +3 -0
- package/src/helpers/index.js +1 -0
- package/src/components/Switcher/Switcher.api.stories.js +0 -20
package/package.json
CHANGED
|
@@ -3,6 +3,17 @@ import ExportButton from './ExportButton.vue';
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Buttons/Export',
|
|
5
5
|
component: ExportButton,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Export Button<br />
|
|
10
|
+
selector: <em>farm-btn-export</em><br />
|
|
11
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
12
|
+
`,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
viewMode: 'docs',
|
|
16
|
+
},
|
|
6
17
|
};
|
|
7
18
|
|
|
8
19
|
export const Primary = () => ({
|
|
@@ -16,7 +27,3 @@ export const Disabled = () => ({
|
|
|
16
27
|
export const List = () => ({
|
|
17
28
|
template: `<farm-btn-export :optionsList="[{ key: 1, label: 'XLS teste'}, { key: 2, label: 'CSV teste novo'}]" />`,
|
|
18
29
|
});
|
|
19
|
-
|
|
20
|
-
Primary.storyName = 'Básico';
|
|
21
|
-
Disabled.storyName = 'Desabilitado';
|
|
22
|
-
List.storyName = 'Lista';
|
|
@@ -12,77 +12,51 @@
|
|
|
12
12
|
<i :class="{ 'mr-2': true, 'mdi-file-export-outline': true, mdi: true }"></i>
|
|
13
13
|
Exportar
|
|
14
14
|
</farm-btn>
|
|
15
|
-
<v-
|
|
16
|
-
v-
|
|
17
|
-
|
|
18
|
-
v-model="togglePopover"
|
|
19
|
-
:offset-y="true"
|
|
20
|
-
:rounded="'b t-0'"
|
|
21
|
-
>
|
|
22
|
-
<template v-slot:activator="{ on, attrs }">
|
|
23
|
-
<farm-btn
|
|
24
|
-
v-bind="attrs"
|
|
25
|
-
v-on="on"
|
|
26
|
-
dense
|
|
27
|
-
class="farm-btn--responsive"
|
|
28
|
-
outlined
|
|
29
|
-
title="Exportar"
|
|
30
|
-
color="secondary"
|
|
31
|
-
@onClick="togglePopover = true"
|
|
32
|
-
:disabled="disabled"
|
|
33
|
-
>
|
|
15
|
+
<farm-contextmenu v-else v-model="value" :bottom="true">
|
|
16
|
+
<template v-slot:activator="{}">
|
|
17
|
+
<farm-btn outlined title="Exportar" color="secondary" @click="toggleValue">
|
|
34
18
|
Exportar
|
|
35
|
-
<
|
|
36
|
-
:class="{
|
|
37
|
-
'ml-2': true,
|
|
38
|
-
'mr-0': true,
|
|
39
|
-
mdi: true,
|
|
40
|
-
'mdi-chevron-up': togglePopover,
|
|
41
|
-
'mdi-chevron-down': !togglePopover,
|
|
42
|
-
}"
|
|
43
|
-
>
|
|
44
|
-
</i>
|
|
19
|
+
<farm-icon class="ml-2"> chevron-{{ value ? 'up' : 'down' }} </farm-icon>
|
|
45
20
|
</farm-btn>
|
|
46
21
|
</template>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<v-list-item
|
|
22
|
+
<farm-list>
|
|
23
|
+
<farm-listitem
|
|
50
24
|
v-for="item in optionsList"
|
|
51
|
-
|
|
52
|
-
|
|
25
|
+
clickable
|
|
26
|
+
hoverColor="primary"
|
|
27
|
+
hoverColorVariation="lighten"
|
|
28
|
+
:key="'exportbutton_key_' + item.label"
|
|
53
29
|
:title="item.label"
|
|
54
30
|
@click="onClick(item.key)"
|
|
55
31
|
>
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</v-list>
|
|
61
|
-
</v-menu>
|
|
32
|
+
<farm-caption bold tag="span">{{ item.label }}</farm-caption>
|
|
33
|
+
</farm-listitem>
|
|
34
|
+
</farm-list>
|
|
35
|
+
</farm-contextmenu>
|
|
62
36
|
</template>
|
|
63
|
-
<script>
|
|
64
|
-
import Vue from 'vue';
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
37
|
+
<script lang="ts">
|
|
38
|
+
import Vue, { PropType } from 'vue';
|
|
39
|
+
|
|
40
|
+
export interface IExportOption {
|
|
41
|
+
label: String;
|
|
42
|
+
key: String;
|
|
43
|
+
}
|
|
69
44
|
|
|
70
45
|
/**
|
|
71
|
-
*
|
|
46
|
+
* BExport Button: standalone or menu list
|
|
72
47
|
*/
|
|
73
48
|
export default Vue.extend({
|
|
74
49
|
name: 'farm-btn-export',
|
|
75
50
|
props: {
|
|
76
51
|
/**
|
|
77
|
-
*
|
|
78
|
-
* Se não informado, o botão emite evento no clique
|
|
52
|
+
* Options list
|
|
79
53
|
*/
|
|
80
54
|
optionsList: {
|
|
81
|
-
type: Array
|
|
55
|
+
type: Array as PropType<Array<IExportOption>>,
|
|
82
56
|
default: () => [],
|
|
83
57
|
},
|
|
84
58
|
/**
|
|
85
|
-
*
|
|
59
|
+
* Is disabled?
|
|
86
60
|
*/
|
|
87
61
|
disabled: {
|
|
88
62
|
type: Boolean,
|
|
@@ -91,31 +65,16 @@ export default Vue.extend({
|
|
|
91
65
|
},
|
|
92
66
|
data() {
|
|
93
67
|
return {
|
|
94
|
-
|
|
68
|
+
value: false,
|
|
95
69
|
};
|
|
96
70
|
},
|
|
97
|
-
components: {
|
|
98
|
-
VList,
|
|
99
|
-
VListItem,
|
|
100
|
-
VMenu,
|
|
101
|
-
VListItemContent,
|
|
102
|
-
VListItemTitle,
|
|
103
|
-
},
|
|
104
71
|
methods: {
|
|
105
72
|
onClick(key) {
|
|
106
73
|
this.$emit('onClick', key);
|
|
107
74
|
},
|
|
75
|
+
toggleValue() {
|
|
76
|
+
this.value = !this.value;
|
|
77
|
+
},
|
|
108
78
|
},
|
|
109
79
|
});
|
|
110
80
|
</script>
|
|
111
|
-
<style scoped lang="scss">
|
|
112
|
-
.v-list-item {
|
|
113
|
-
border-bottom: 1px solid var(--v-gray-lighten2);
|
|
114
|
-
&:last-child {
|
|
115
|
-
border-bottom: none;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
.v-list-item--link {
|
|
119
|
-
font-size: 0.875rem;
|
|
120
|
-
}
|
|
121
|
-
</style>
|
|
@@ -11,11 +11,14 @@ export default Vue.extend({
|
|
|
11
11
|
name: 'farm-card',
|
|
12
12
|
inheritAttrs: true,
|
|
13
13
|
props: {
|
|
14
|
+
/**
|
|
15
|
+
* Html tag
|
|
16
|
+
*/
|
|
14
17
|
tag: { type: String, default: 'div' },
|
|
15
18
|
},
|
|
16
19
|
});
|
|
17
20
|
</script>
|
|
18
21
|
|
|
19
22
|
<style lang="scss" scoped>
|
|
20
|
-
@import './Card
|
|
23
|
+
@import './Card';
|
|
21
24
|
</style>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { withDesign } from 'storybook-addon-designs';
|
|
2
|
-
import gutters from '../../configurations/gutters';
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
title: 'Surfaces/Card/Molecules',
|
|
@@ -32,7 +31,7 @@ export const MultipleContents = () => ({
|
|
|
32
31
|
|
|
33
32
|
export const Gutters = () => ({
|
|
34
33
|
data() {
|
|
35
|
-
return { gutters };
|
|
34
|
+
return { gutters: ['none', 'xs', 'sm', 'vuetify', 'md', 'lg', 'xl'] };
|
|
36
35
|
},
|
|
37
36
|
template: `<div style="width: 480px;">
|
|
38
37
|
<farm-card v-for="gutter in gutters" :key="gutter" style="margin-bottom: 16px">
|
|
@@ -7,7 +7,8 @@ export default {
|
|
|
7
7
|
docs: {
|
|
8
8
|
description: {
|
|
9
9
|
component: `Card Content<br />
|
|
10
|
-
selector: <em>farm-card-content</em
|
|
10
|
+
selector: <em>farm-card-content</em><br />
|
|
11
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
11
12
|
`,
|
|
12
13
|
},
|
|
13
14
|
},
|
|
@@ -16,10 +17,20 @@ export default {
|
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export const Primary = () => ({
|
|
19
|
-
components: { 'farm-card-content': CardContent },
|
|
20
20
|
template: `
|
|
21
21
|
<farm-card-content>
|
|
22
22
|
Conteúdo do Card Content
|
|
23
23
|
</farm-card-content>
|
|
24
24
|
`,
|
|
25
25
|
});
|
|
26
|
+
|
|
27
|
+
export const Gutters = () => ({
|
|
28
|
+
data() {
|
|
29
|
+
return { gutters: ['none', 'xs', 'sm', 'vuetify', 'md', 'lg', 'xl'] };
|
|
30
|
+
},
|
|
31
|
+
template: `<div style="width: 480px;">
|
|
32
|
+
<farm-card-content v-for="gutter in gutters" :key="gutter" style="margin-bottom: 16px" :gutter="gutter">
|
|
33
|
+
Content with {{ gutter }} gutter
|
|
34
|
+
</farm-card-content>
|
|
35
|
+
</div>`,
|
|
36
|
+
});
|
|
@@ -10,13 +10,16 @@ import Vue, { PropType } from 'vue';
|
|
|
10
10
|
export default Vue.extend({
|
|
11
11
|
name: 'farm-card-content',
|
|
12
12
|
props: {
|
|
13
|
+
/**
|
|
14
|
+
* Html tag
|
|
15
|
+
*/
|
|
13
16
|
tag: { type: String, default: 'div' },
|
|
14
17
|
/**
|
|
15
18
|
* Add gutter
|
|
16
19
|
*/
|
|
17
20
|
gutter: {
|
|
18
|
-
type: String as PropType<'none' | 'xs' | 'sm' | '
|
|
19
|
-
default: '
|
|
21
|
+
type: String as PropType<'none' | 'xs' | 'sm' | 'vuetify' | 'md' | 'lg' | 'xl'>,
|
|
22
|
+
default: 'md',
|
|
20
23
|
},
|
|
21
24
|
},
|
|
22
25
|
inheritAttrs: true,
|
|
@@ -24,5 +27,5 @@ export default Vue.extend({
|
|
|
24
27
|
</script>
|
|
25
28
|
|
|
26
29
|
<style lang="scss" scoped>
|
|
27
|
-
@import './CardContent
|
|
30
|
+
@import './CardContent';
|
|
28
31
|
</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import '../../configurations/theme-colors';
|
|
2
|
+
@import '../../configurations/variables';
|
|
2
3
|
|
|
3
4
|
.farm-checkbox__container {
|
|
4
5
|
display: flex;
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
&--disabled {
|
|
47
48
|
border-color: #dadada;
|
|
48
49
|
cursor: default;
|
|
50
|
+
opacity: 0.6;
|
|
49
51
|
|
|
50
52
|
&.farm-checkbox--checked {
|
|
51
53
|
background-color: #dadada;
|
|
@@ -56,4 +58,12 @@
|
|
|
56
58
|
color: white;
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@each $size,
|
|
64
|
+
$value in $sizes {
|
|
65
|
+
#{'.farm-checkbox[size=' + $size +']'} {
|
|
66
|
+
width: $value;
|
|
67
|
+
height: $value;
|
|
68
|
+
}
|
|
59
69
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Checkbox from './Checkbox';
|
|
2
2
|
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
3
|
-
|
|
3
|
+
import sizes from '../../configurations/sizes';
|
|
4
4
|
const colors = Object.keys(baseThemeColors);
|
|
5
5
|
const variations = ['', 'darken', 'lighten'];
|
|
6
6
|
|
|
@@ -92,3 +92,17 @@ export const Colors = () => ({
|
|
|
92
92
|
</div>
|
|
93
93
|
</div>`,
|
|
94
94
|
});
|
|
95
|
+
|
|
96
|
+
export const Sizes = () => ({
|
|
97
|
+
data() {
|
|
98
|
+
return {
|
|
99
|
+
sizes,
|
|
100
|
+
isChecked: true,
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
template: `<div style="display: flex; flex-direction: column; flex-wrap: wrap;">
|
|
104
|
+
<div v-for="size of sizes">
|
|
105
|
+
<farm-checkbox v-model="isChecked" :size="size" :label="size" /><br />
|
|
106
|
+
</div>
|
|
107
|
+
</div>`,
|
|
108
|
+
});
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
'farm-checkbox--lighten': variation === 'lighten',
|
|
9
9
|
'farm-checkbox--darken': variation === 'darken',
|
|
10
10
|
}"
|
|
11
|
+
:size="$props.size"
|
|
11
12
|
@click="toggleValue"
|
|
12
13
|
>
|
|
13
|
-
<farm-icon size="
|
|
14
|
+
<farm-icon :size="$props.size" v-if="innerValue">check</farm-icon>
|
|
14
15
|
</span>
|
|
15
16
|
<farm-label v-if="label">
|
|
16
17
|
{{ label }}
|
|
@@ -57,6 +58,13 @@ export default Vue.extend({
|
|
|
57
58
|
type: Array as PropType<Array<Function>>,
|
|
58
59
|
default: () => [],
|
|
59
60
|
},
|
|
61
|
+
/**
|
|
62
|
+
* Size
|
|
63
|
+
*/
|
|
64
|
+
size: {
|
|
65
|
+
type: String as PropType<'xs' | 'sm' | 'md' | 'lg' | 'xl'>,
|
|
66
|
+
default: 'md',
|
|
67
|
+
},
|
|
60
68
|
},
|
|
61
69
|
setup(props, { emit }) {
|
|
62
70
|
const innerValue = ref(props.value);
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
<script lang="ts">
|
|
20
|
-
import Vue, {
|
|
20
|
+
import Vue, { ref, watch, reactive, onBeforeUnmount, toRefs } from 'vue';
|
|
21
21
|
|
|
22
22
|
export default Vue.extend({
|
|
23
23
|
name: 'farm-contextmenu',
|
|
@@ -83,7 +83,7 @@ export default Vue.extend({
|
|
|
83
83
|
const parentBoundingClientRect = parent.value.getBoundingClientRect();
|
|
84
84
|
const popupClientRect = popup.value.getBoundingClientRect();
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
let offsetTop =
|
|
87
87
|
parentBoundingClientRect.top +
|
|
88
88
|
window.scrollY +
|
|
89
89
|
(!bottom.value ? 0 : parentBoundingClientRect.height);
|
|
@@ -94,17 +94,27 @@ export default Vue.extend({
|
|
|
94
94
|
offsetLeft + parentBoundingClientRect.width / 2 - popupClientRect.width / 2;
|
|
95
95
|
}
|
|
96
96
|
styles.minWidth =
|
|
97
|
-
parentBoundingClientRect.width > 96
|
|
97
|
+
(parentBoundingClientRect.width > 96
|
|
98
98
|
? parseInt(parentBoundingClientRect.width)
|
|
99
|
-
: 96 + 'px';
|
|
99
|
+
: 96) + 'px';
|
|
100
|
+
|
|
101
|
+
//Do not allow to open outside window
|
|
102
|
+
const rightEdge = offsetLeft + popupClientRect.width;
|
|
103
|
+
const clientWidth = document.documentElement.clientWidth;
|
|
104
|
+
if (rightEdge > clientWidth - 12) {
|
|
105
|
+
offsetLeft = clientWidth - 12 - popupClientRect.width;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const bottomEdge = offsetTop + popupClientRect.height;
|
|
109
|
+
const clientHeight = document.documentElement.clientHeight;
|
|
110
|
+
if (bottomEdge - window.scrollY > clientHeight) {
|
|
111
|
+
offsetTop -= bottomEdge - window.scrollY - clientHeight + 12;
|
|
112
|
+
}
|
|
113
|
+
|
|
100
114
|
styles.top = offsetTop + 'px';
|
|
101
115
|
styles.left = offsetLeft + 'px';
|
|
102
116
|
};
|
|
103
117
|
|
|
104
|
-
onMounted(() => {
|
|
105
|
-
calculatePosition();
|
|
106
|
-
});
|
|
107
|
-
|
|
108
118
|
onBeforeUnmount(() => {
|
|
109
119
|
if (hasBeenBoostrapped) {
|
|
110
120
|
window.removeEventListener('resize', resizeWindowHandler);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
color: var(--v-primary-base);
|
|
4
4
|
font-size: 12px;
|
|
5
|
+
|
|
5
6
|
.farm-icon {
|
|
6
7
|
position: absolute;
|
|
7
8
|
right: -20px;
|
|
@@ -17,11 +18,18 @@
|
|
|
17
18
|
|
|
18
19
|
th.sortable {
|
|
19
20
|
cursor: pointer;
|
|
21
|
+
|
|
20
22
|
&:not(.active) {
|
|
21
23
|
&:hover {
|
|
22
|
-
.
|
|
24
|
+
.farm-icon {
|
|
23
25
|
opacity: 0.5 !important;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
}
|
|
30
|
+
|
|
31
|
+
th span.span-checkbox {
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: flex-start;
|
|
34
|
+
padding-left: 4px;
|
|
35
|
+
}
|
|
@@ -1,40 +1,64 @@
|
|
|
1
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
1
2
|
import DataTableHeader from './DataTableHeader.vue';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Display/Table/DataTableHeader',
|
|
5
6
|
component: DataTableHeader,
|
|
7
|
+
decorators: [withDesign],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: `DataTable Header<br />
|
|
12
|
+
selector: <em>farm-datatable-header</em><br />
|
|
13
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
14
|
+
`,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
viewMode: 'docs',
|
|
18
|
+
},
|
|
6
19
|
};
|
|
7
20
|
|
|
8
21
|
export const Primary = () => ({
|
|
9
22
|
data() {
|
|
10
23
|
return {
|
|
11
|
-
headers
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
width: 320,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
text: 'Disponível',
|
|
27
|
-
sortable: false,
|
|
28
|
-
value: 'availableAmount',
|
|
29
|
-
align: 'center',
|
|
30
|
-
width: 160,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
24
|
+
headers,
|
|
25
|
+
sortClick: [],
|
|
26
|
+
firstSelected: false,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
template: `<farm-datatable-header :headers="headers" :sortClick="sortClick" :firstSelected="firstSelected" />`,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const CheckBox = () => ({
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
headers,
|
|
33
36
|
sortClick: [],
|
|
34
37
|
firstSelected: false,
|
|
35
38
|
};
|
|
36
39
|
},
|
|
37
|
-
template: `<
|
|
40
|
+
template: `<farm-datatable-header :headers="headers" :sortClick="sortClick" :firstSelected="firstSelected" :showCheckbox="true" :selectedIndex="1" />`,
|
|
38
41
|
});
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
const headers = [
|
|
44
|
+
{
|
|
45
|
+
text: 'Grupo',
|
|
46
|
+
sortable: true,
|
|
47
|
+
value: 'name',
|
|
48
|
+
align: 'left',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
text: 'Aprovado',
|
|
52
|
+
sortable: true,
|
|
53
|
+
value: 'approvedAmount',
|
|
54
|
+
align: 'center',
|
|
55
|
+
width: 320,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
text: 'Disponível',
|
|
59
|
+
sortable: false,
|
|
60
|
+
value: 'availableAmount',
|
|
61
|
+
align: 'center',
|
|
62
|
+
width: 160,
|
|
63
|
+
},
|
|
64
|
+
];
|
|
@@ -33,31 +33,26 @@
|
|
|
33
33
|
</farm-icon>
|
|
34
34
|
</span>
|
|
35
35
|
|
|
36
|
-
<span v-if="isTHDataTableSelect(item) && showCheckbox">
|
|
37
|
-
|
|
36
|
+
<span v-if="isTHDataTableSelect(item) && showCheckbox" class="span-checkbox">
|
|
37
|
+
<!--
|
|
38
38
|
:indeterminate="headerProps.someItems && !headerProps.everyItem"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
></v-simple-checkbox>
|
|
39
|
+
-->
|
|
40
|
+
<farm-checkbox size="sm" v-model="inputVal" @input="selectAll" />
|
|
42
41
|
</span>
|
|
43
42
|
</th>
|
|
44
43
|
</tr>
|
|
45
44
|
</thead>
|
|
46
45
|
</template>
|
|
47
46
|
|
|
48
|
-
<script>
|
|
47
|
+
<script lang="ts">
|
|
49
48
|
/* eslint-disable */
|
|
50
49
|
import Vue from 'vue';
|
|
51
|
-
import VSimpleCheckbox from 'vuetify/lib/components/VCheckbox/VSimpleCheckbox';
|
|
52
50
|
|
|
53
51
|
export default Vue.extend({
|
|
54
52
|
name: 'farm-datatable-header',
|
|
55
|
-
components: {
|
|
56
|
-
VSimpleCheckbox,
|
|
57
|
-
},
|
|
58
53
|
props: {
|
|
59
54
|
/**
|
|
60
|
-
*
|
|
55
|
+
* Headers
|
|
61
56
|
*/
|
|
62
57
|
headers: {
|
|
63
58
|
type: Array,
|
|
@@ -100,6 +95,7 @@ export default Vue.extend({
|
|
|
100
95
|
* Hide/show checkbox
|
|
101
96
|
*/
|
|
102
97
|
showCheckbox: {
|
|
98
|
+
type: Boolean,
|
|
103
99
|
default: true,
|
|
104
100
|
},
|
|
105
101
|
},
|
|
@@ -17,13 +17,24 @@ ul.farm-paginator {
|
|
|
17
17
|
border-right: 0;
|
|
18
18
|
height: 36px;
|
|
19
19
|
min-width: 36px;
|
|
20
|
-
padding-inline: 4px;
|
|
21
20
|
display: inline-flex;
|
|
22
21
|
justify-content: center;
|
|
23
22
|
align-items: center;
|
|
24
23
|
font-size: 12px;
|
|
25
24
|
transition: all ease 0.5s;
|
|
25
|
+
padding: 4px 12px;
|
|
26
26
|
|
|
27
|
+
p {
|
|
28
|
+
color: var(--farm-neutral-darken);
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
&:disabled {
|
|
34
|
+
.farm-icon {
|
|
35
|
+
color: var(--farm-neutral-base);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
&:first-child button {
|
|
@@ -37,16 +48,18 @@ ul.farm-paginator {
|
|
|
37
48
|
|
|
38
49
|
&.farm-paginator__item--selected {
|
|
39
50
|
button {
|
|
40
|
-
background-color: var(--
|
|
41
|
-
|
|
51
|
+
background-color: var(--farm-primary-base);
|
|
52
|
+
|
|
53
|
+
p{
|
|
54
|
+
color: #FFFFFF;
|
|
55
|
+
}
|
|
56
|
+
|
|
42
57
|
}
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
&:hover {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
button:not([disabled="disabled"]) i.farm-icon {
|
|
49
|
-
color: var(--v-secondary-base);
|
|
61
|
+
button:not([disabled="disabled"]) {
|
|
62
|
+
background-color: var(--farm-primary-lighten);
|
|
50
63
|
}
|
|
51
64
|
}
|
|
52
65
|
}
|
|
@@ -65,4 +78,8 @@ ul.farm-paginator {
|
|
|
65
78
|
|
|
66
79
|
.farm-paginator--gutter {
|
|
67
80
|
margin: 16px 24px 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.farm-typography.button {
|
|
84
|
+
font-size: 14px;
|
|
68
85
|
}
|