@farm-investimentos/front-mfe-components 14.1.3 → 14.1.5
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 +9780 -3741
- 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 +9780 -3741
- 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/DataTableHeader/DataTableHeader.scss +26 -3
- package/src/components/DataTableHeader/DataTableHeader.stories.js +14 -3
- package/src/components/DataTableHeader/DataTableHeader.vue +4 -3
- package/src/components/DataTableHeader/__tests__/DataTableHeader.spec.js +1 -1
- package/src/components/DatePicker/DatePicker.stories.js +10 -0
- package/src/components/DatePicker/DatePicker.vue +18 -2
- package/src/components/DatePicker/__tests__/DatePicker.spec.js +40 -0
- package/src/components/Form/Form.stories.js +8 -8
- package/src/components/Label/Label.scss +2 -1
- package/src/components/Label/Label.vue +5 -1
- package/src/components/RangeDatePicker/RangeDatePicker.vue +19 -2
- package/src/components/RangeDatePicker/__tests__/RangeDatePicker.spec.js +56 -0
- package/src/components/SelectModalOptions/SelectModalOptions.stories.js +1 -1
- package/src/components/SelectModalOptions/SelectModalOptions.vue +4 -0
- package/src/examples/Table.stories.js +33 -5
- package/src/scss/Sticky-table.scss +41 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.header-text {
|
|
2
2
|
position: relative;
|
|
3
|
-
color: var(--
|
|
4
|
-
font-size:
|
|
3
|
+
color: var(--farm-secondary-base);
|
|
4
|
+
font-size: 14px;
|
|
5
5
|
|
|
6
6
|
.farm-icon {
|
|
7
7
|
position: absolute;
|
|
@@ -32,4 +32,27 @@ th span.span-checkbox {
|
|
|
32
32
|
display: flex;
|
|
33
33
|
justify-content: flex-start;
|
|
34
34
|
padding-left: 4px;
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
thead {
|
|
38
|
+
height: 51px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
th {
|
|
42
|
+
color: var(--farm-secondary-base);
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
font-weight: 700;
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
box-shadow: 0px -1px 0px var(--farm-gray-lighten), 0px 1px 0px var(--farm-gray-lighten);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:deep(.mdi-sort-descending)::before {
|
|
50
|
+
color: var(--farm-gray-base);
|
|
51
|
+
font-size: 12px;
|
|
52
|
+
font-weight: 900;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.farm-icon--desc,
|
|
56
|
+
.farm-icon--asc {
|
|
57
|
+
margin-top: 3.5px;
|
|
58
|
+
}
|
|
@@ -26,20 +26,31 @@ export const Primary = () => ({
|
|
|
26
26
|
firstSelected: false,
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
|
-
template: `<farm-datatable-header :headers="headers" :sortClick="sortClick" :firstSelected="firstSelected" />`,
|
|
29
|
+
template: `<farm-datatable-header :headers="headers" :sortClick="sortClick" :showCheckbox="false" :firstSelected="firstSelected" />`,
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
export const CheckBox = () => ({
|
|
33
33
|
data() {
|
|
34
34
|
return {
|
|
35
|
-
headers
|
|
35
|
+
headers: [
|
|
36
|
+
{
|
|
37
|
+
text: 'check',
|
|
38
|
+
sortable: true,
|
|
39
|
+
value: 'data-table-select',
|
|
40
|
+
align: 'left',
|
|
41
|
+
},
|
|
42
|
+
...headers,
|
|
43
|
+
],
|
|
44
|
+
headerProps,
|
|
36
45
|
sortClick: [],
|
|
37
46
|
firstSelected: false,
|
|
38
47
|
};
|
|
39
48
|
},
|
|
40
|
-
template: `<farm-datatable-header :headers="headers" :sortClick="sortClick" :firstSelected="firstSelected" :showCheckbox="true" :selectedIndex="1" />`,
|
|
49
|
+
template: `<farm-datatable-header :headers="headers" :headerProps="headerProps" :sortClick="sortClick" :firstSelected="firstSelected" :showCheckbox="true" :selectedIndex="1" />`,
|
|
41
50
|
});
|
|
42
51
|
|
|
52
|
+
const headerProps = { someItems: true, everyItem: true };
|
|
53
|
+
|
|
43
54
|
const headers = [
|
|
44
55
|
{
|
|
45
56
|
text: 'Grupo',
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
v-bind:class="[
|
|
27
27
|
sortClick[$index][item.value] ? 'farm-icon--desc' : 'farm-icon--asc',
|
|
28
28
|
]"
|
|
29
|
-
|
|
29
|
+
class="ml-2"
|
|
30
|
+
size="12px"
|
|
30
31
|
color="gray"
|
|
31
32
|
>
|
|
32
33
|
sort-descending
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
|
|
36
37
|
<span v-if="isTHDataTableSelect(item) && showCheckbox" class="span-checkbox">
|
|
37
38
|
<farm-checkbox
|
|
38
|
-
size="
|
|
39
|
+
size="md"
|
|
39
40
|
v-model="inputVal"
|
|
40
41
|
:value="true"
|
|
41
42
|
:indeterminate="headerProps.someItems && !headerProps.everyItem"
|
|
@@ -151,7 +152,7 @@ export default Vue.extend({
|
|
|
151
152
|
},
|
|
152
153
|
thWidth(item) {
|
|
153
154
|
if (this.isTHDataTableSelect(item)) {
|
|
154
|
-
return '
|
|
155
|
+
return '72px';
|
|
155
156
|
}
|
|
156
157
|
return item.width ? item.width + 'px' : 'auto';
|
|
157
158
|
},
|
|
@@ -48,7 +48,7 @@ describe('DataTableHeader component', () => {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
it('Should get th width', () => {
|
|
51
|
-
expect(component.thWidth({ value: 'data-table-select' })).toEqual('
|
|
51
|
+
expect(component.thWidth({ value: 'data-table-select' })).toEqual('72px');
|
|
52
52
|
expect(component.thWidth({ width: 24 })).toEqual('24px');
|
|
53
53
|
expect(component.thWidth({})).toEqual('auto');
|
|
54
54
|
});
|
|
@@ -66,3 +66,13 @@ export const Readonly = () => ({
|
|
|
66
66
|
</div>`,
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
export const IsNull = () => ({
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
date: null,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
template: `<div style='max-width: 320px'>
|
|
76
|
+
<farm-input-datepicker inputId="input-custom-id-8" v-model="date" :required="true" />
|
|
77
|
+
</div>`,
|
|
78
|
+
});
|
|
@@ -26,7 +26,12 @@
|
|
|
26
26
|
Cancelar
|
|
27
27
|
</farm-btn>
|
|
28
28
|
|
|
29
|
-
<farm-btn
|
|
29
|
+
<farm-btn
|
|
30
|
+
class="ml-2"
|
|
31
|
+
title="Confirmar"
|
|
32
|
+
:disabled="isDateFieldDisabled"
|
|
33
|
+
@click="save()"
|
|
34
|
+
>
|
|
30
35
|
Confirmar <farm-icon>check</farm-icon>
|
|
31
36
|
</farm-btn>
|
|
32
37
|
</v-date-picker>
|
|
@@ -35,6 +40,7 @@
|
|
|
35
40
|
icon="calendar"
|
|
36
41
|
v-model="fieldRange"
|
|
37
42
|
autocomplete="off"
|
|
43
|
+
ref="inputCalendar"
|
|
38
44
|
:readonly="readonly"
|
|
39
45
|
:mask="`${readonly ? '' : '##/##/####'}`"
|
|
40
46
|
:id="inputId"
|
|
@@ -166,6 +172,7 @@ export default Vue.extend({
|
|
|
166
172
|
clear() {
|
|
167
173
|
this.dateField = '';
|
|
168
174
|
this.save();
|
|
175
|
+
this.$refs.inputCalendar.reset();
|
|
169
176
|
},
|
|
170
177
|
validation(date) {
|
|
171
178
|
const pattern =
|
|
@@ -204,7 +211,16 @@ export default Vue.extend({
|
|
|
204
211
|
},
|
|
205
212
|
},
|
|
206
213
|
isDisabled(): boolean {
|
|
207
|
-
|
|
214
|
+
if (this.value) {
|
|
215
|
+
return this.value.length === 0 ? true : false;
|
|
216
|
+
}
|
|
217
|
+
return true;
|
|
218
|
+
},
|
|
219
|
+
isDateFieldDisabled() {
|
|
220
|
+
if (this.dateField) {
|
|
221
|
+
return this.dateField.length === 0 ? true : false;
|
|
222
|
+
}
|
|
223
|
+
return true;
|
|
208
224
|
},
|
|
209
225
|
},
|
|
210
226
|
});
|
|
@@ -33,6 +33,46 @@ describe('DatePicker component', () => {
|
|
|
33
33
|
component.inputVal = 'teste';
|
|
34
34
|
expect(wrapper.emitted().input).toBeDefined();
|
|
35
35
|
});
|
|
36
|
+
it('isDisabled to be true when value is empty', async () => {
|
|
37
|
+
await wrapper.setProps({
|
|
38
|
+
value: '',
|
|
39
|
+
});
|
|
40
|
+
expect(component.isDisabled).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('isDisabled to be true when value is empty', async () => {
|
|
44
|
+
await wrapper.setProps({
|
|
45
|
+
value: null,
|
|
46
|
+
});
|
|
47
|
+
expect(component.isDisabled).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
it('isDisabled to be false when value is valid', async () => {
|
|
50
|
+
await wrapper.setProps({
|
|
51
|
+
value: '2023-02-02',
|
|
52
|
+
});
|
|
53
|
+
expect(component.isDisabled).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('isDateFieldDisabled to be true when dateField is empty', async () => {
|
|
57
|
+
await wrapper.setProps({
|
|
58
|
+
value: '',
|
|
59
|
+
});
|
|
60
|
+
expect(component.isDateFieldDisabled).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('isDateFieldDisabled to be true when dateField is empty', async () => {
|
|
64
|
+
await wrapper.setProps({
|
|
65
|
+
value: null,
|
|
66
|
+
});
|
|
67
|
+
expect(component.isDateFieldDisabled).toBe(true);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('isDateFieldDisabled to be false when dateField is valid', async () => {
|
|
71
|
+
await wrapper.setProps({
|
|
72
|
+
value: '2023-02-02',
|
|
73
|
+
});
|
|
74
|
+
expect(component.isDateFieldDisabled).toBe(false);
|
|
75
|
+
});
|
|
36
76
|
});
|
|
37
77
|
|
|
38
78
|
describe('methods', () => {
|
|
@@ -193,31 +193,31 @@ export const Grid = () => ({
|
|
|
193
193
|
<farm-row>
|
|
194
194
|
<farm-col cols="12" md="3">
|
|
195
195
|
<farm-label>Label 1</farm-label>
|
|
196
|
-
<farm-textfield />
|
|
196
|
+
<farm-textfield-v2 />
|
|
197
197
|
</farm-col>
|
|
198
198
|
<farm-col cols="12" md="3">
|
|
199
199
|
<farm-label>Label 2</farm-label>
|
|
200
|
-
<farm-textfield />
|
|
200
|
+
<farm-textfield-v2 />
|
|
201
201
|
</farm-col>
|
|
202
202
|
<farm-col cols="12" md="3">
|
|
203
203
|
<farm-label>Label 3</farm-label>
|
|
204
|
-
<farm-textfield hint="some hint text" :persistent-hint="true" />
|
|
204
|
+
<farm-textfield-v2 hint="some hint text" :persistent-hint="true" />
|
|
205
205
|
</farm-col>
|
|
206
206
|
<farm-col cols="12" md="3">
|
|
207
207
|
<farm-label>Label 4</farm-label>
|
|
208
|
-
<farm-textfield />
|
|
208
|
+
<farm-textfield-v2 />
|
|
209
209
|
</farm-col>
|
|
210
210
|
<farm-col cols="12" md="6">
|
|
211
211
|
<farm-label>Label 6</farm-label>
|
|
212
|
-
<farm-textfield />
|
|
212
|
+
<farm-textfield-v2 />
|
|
213
213
|
</farm-col>
|
|
214
214
|
<farm-col cols="12" md="2">
|
|
215
215
|
<farm-label>Label 7</farm-label>
|
|
216
|
-
<farm-textfield />
|
|
216
|
+
<farm-textfield-v2 />
|
|
217
217
|
</farm-col>
|
|
218
218
|
<farm-col cols="12" md="4">
|
|
219
219
|
<farm-label>Label 4</farm-label>
|
|
220
|
-
<farm-textfield />
|
|
220
|
+
<farm-textfield-v2 />
|
|
221
221
|
</farm-col>
|
|
222
222
|
</farm-row>
|
|
223
223
|
|
|
@@ -360,7 +360,7 @@ export const RestartValidation = () => ({
|
|
|
360
360
|
},
|
|
361
361
|
template: `
|
|
362
362
|
<farm-form v-model="validForm" :style="[styles.vForm]" ref="form">
|
|
363
|
-
{{ validForm }}
|
|
363
|
+
Is valid form: {{ validForm }}
|
|
364
364
|
|
|
365
365
|
<farm-label :required="true">Nome</farm-label>
|
|
366
366
|
<farm-textfield-v2 v-model="form.name" :rules="[rules.required]" />
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<label
|
|
2
|
+
<label
|
|
3
|
+
:class="{ 'farm-label': true, 'farm-label--required': required }"
|
|
4
|
+
v-on="$listeners"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
3
7
|
<slot></slot>
|
|
4
8
|
</label>
|
|
5
9
|
</template>
|
|
@@ -31,7 +31,12 @@
|
|
|
31
31
|
Cancelar
|
|
32
32
|
</farm-btn>
|
|
33
33
|
|
|
34
|
-
<farm-btn
|
|
34
|
+
<farm-btn
|
|
35
|
+
class="ml-2"
|
|
36
|
+
title="Confirmar"
|
|
37
|
+
:disabled="isDateFieldDisabled"
|
|
38
|
+
@click="save()"
|
|
39
|
+
>
|
|
35
40
|
Confirmar <farm-icon>check</farm-icon>
|
|
36
41
|
</farm-btn>
|
|
37
42
|
</v-date-picker>
|
|
@@ -111,6 +116,9 @@ export default Vue.extend({
|
|
|
111
116
|
},
|
|
112
117
|
watch: {
|
|
113
118
|
value(newValue) {
|
|
119
|
+
if (newValue?.length === 1) {
|
|
120
|
+
newValue.push(newValue[0]);
|
|
121
|
+
}
|
|
114
122
|
this.dateField = newValue;
|
|
115
123
|
this.fieldRange = this.formatDateRange(newValue);
|
|
116
124
|
},
|
|
@@ -160,7 +168,16 @@ export default Vue.extend({
|
|
|
160
168
|
return !this.dateField || this.dateField.length == 1;
|
|
161
169
|
},
|
|
162
170
|
isDisabled() {
|
|
163
|
-
|
|
171
|
+
if (this.value) {
|
|
172
|
+
return this.value.length === 0 ? true : false;
|
|
173
|
+
}
|
|
174
|
+
return true;
|
|
175
|
+
},
|
|
176
|
+
isDateFieldDisabled() {
|
|
177
|
+
if (this.dateField) {
|
|
178
|
+
return this.dateField.length === 0 ? true : false;
|
|
179
|
+
}
|
|
180
|
+
return true;
|
|
164
181
|
},
|
|
165
182
|
isInvertedDate() {
|
|
166
183
|
if (this.dateField.length === 2) {
|
|
@@ -25,6 +25,48 @@ describe('RangeDatePicker component', () => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
describe('computed values', () => {
|
|
28
|
+
it('isDisabled to be true when value is empty', async () => {
|
|
29
|
+
await wrapper.setProps({
|
|
30
|
+
value: [],
|
|
31
|
+
});
|
|
32
|
+
expect(component.isDisabled).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('isDisabled to be true when value is null', async () => {
|
|
36
|
+
await wrapper.setProps({
|
|
37
|
+
value: null,
|
|
38
|
+
});
|
|
39
|
+
expect(component.isDisabled).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('isDisabled to be false when value is valid', async () => {
|
|
43
|
+
await wrapper.setProps({
|
|
44
|
+
value: ['2023-02-02'],
|
|
45
|
+
});
|
|
46
|
+
expect(component.isDisabled).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('isDateFieldDisabled to be true when dateField is empty', async () => {
|
|
50
|
+
await wrapper.setProps({
|
|
51
|
+
value: [],
|
|
52
|
+
});
|
|
53
|
+
expect(component.isDateFieldDisabled).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('isDateFieldDisabled to be true when dateField is null', async () => {
|
|
57
|
+
await wrapper.setProps({
|
|
58
|
+
value: null,
|
|
59
|
+
});
|
|
60
|
+
expect(component.isDateFieldDisabled).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('isDateFieldDisabled to be false when dateField is valid', async () => {
|
|
64
|
+
await wrapper.setProps({
|
|
65
|
+
value: ['2023-02-02'],
|
|
66
|
+
});
|
|
67
|
+
expect(component.isDateFieldDisabled).toBe(false);
|
|
68
|
+
});
|
|
69
|
+
|
|
28
70
|
it('min max correctly', async () => {
|
|
29
71
|
await wrapper.setProps({
|
|
30
72
|
inputId: 'someid',
|
|
@@ -48,4 +90,18 @@ describe('RangeDatePicker component', () => {
|
|
|
48
90
|
expect(component.menuField).toBeFalsy();
|
|
49
91
|
});
|
|
50
92
|
});
|
|
93
|
+
|
|
94
|
+
describe('watchs', () => {
|
|
95
|
+
it('should show dateField and fieldRange correctly when it has one date', () => {
|
|
96
|
+
component.$options.watch.value.call(component, ['2023-02-27']);
|
|
97
|
+
expect(component.dateField).toEqual(['2023-02-27', '2023-02-27']);
|
|
98
|
+
expect(component.fieldRange).toEqual('27/02/2023 a 27/02/2023');
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('should show dateField and fieldRange correctly when it has two dates', () => {
|
|
102
|
+
component.$options.watch.value.call(component, ['2023-02-27', '2023-02-28']);
|
|
103
|
+
expect(component.dateField).toEqual(['2023-02-27', '2023-02-28']);
|
|
104
|
+
expect(component.fieldRange).toEqual('27/02/2023 a 28/02/2023');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
51
107
|
});
|
|
@@ -79,9 +79,13 @@
|
|
|
79
79
|
</template>
|
|
80
80
|
<script lang="ts">
|
|
81
81
|
import Vue from 'vue';
|
|
82
|
+
import { VDataTable } from 'vuetify/lib';
|
|
82
83
|
|
|
83
84
|
export default Vue.extend({
|
|
84
85
|
name: 'farm-select-modal-options',
|
|
86
|
+
components: {
|
|
87
|
+
'v-data-table': VDataTable,
|
|
88
|
+
},
|
|
85
89
|
props: {
|
|
86
90
|
/**
|
|
87
91
|
* Input Label
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { withDesign } from 'storybook-addon-designs';
|
|
2
|
+
import { VDataTable } from 'vuetify/lib/components';
|
|
2
3
|
import DataTableEmptyWrapper from '../components/DataTableEmptyWrapper';
|
|
3
4
|
import DataTablePaginator from '../components/DataTablePaginator';
|
|
4
5
|
|
|
5
6
|
const headers = [
|
|
6
7
|
{
|
|
7
8
|
text: 'ID',
|
|
8
|
-
sortable:
|
|
9
|
+
sortable: true,
|
|
9
10
|
value: 'id',
|
|
10
11
|
width: 80,
|
|
11
12
|
align: 'left',
|
|
@@ -37,6 +38,7 @@ export default {
|
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export const TableNoData = () => ({
|
|
41
|
+
components: { 'v-data-table': VDataTable },
|
|
40
42
|
data() {
|
|
41
43
|
return {
|
|
42
44
|
headers,
|
|
@@ -59,6 +61,7 @@ export const TableNoData = () => ({
|
|
|
59
61
|
});
|
|
60
62
|
|
|
61
63
|
export const TableSampleData = () => ({
|
|
64
|
+
components: { 'v-data-table': VDataTable },
|
|
62
65
|
data() {
|
|
63
66
|
return {
|
|
64
67
|
headers,
|
|
@@ -80,12 +83,33 @@ export const TableSampleData = () => ({
|
|
|
80
83
|
</v-data-table>
|
|
81
84
|
</div>`,
|
|
82
85
|
});
|
|
86
|
+
export const TableSampleDataWithCheckbox = () => ({
|
|
87
|
+
components: { 'v-data-table': VDataTable },
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
headers,
|
|
91
|
+
items: [
|
|
92
|
+
{ id: 1, name: 'name 1' },
|
|
93
|
+
{ id: 2, name: 'name 2' },
|
|
94
|
+
{ id: 3, name: 'name 3' },
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
template: `<div>
|
|
99
|
+
<v-data-table
|
|
100
|
+
hide-default-footer
|
|
101
|
+
id="v-data-table--default"
|
|
102
|
+
:headers="headers"
|
|
103
|
+
:items="items"
|
|
104
|
+
show-select
|
|
105
|
+
>
|
|
106
|
+
|
|
107
|
+
</v-data-table>
|
|
108
|
+
</div>`,
|
|
109
|
+
});
|
|
83
110
|
|
|
84
111
|
export const TableSampleLocalPagination = () => ({
|
|
85
|
-
components: {
|
|
86
|
-
DataTableEmptyWrapper,
|
|
87
|
-
DataTablePaginator,
|
|
88
|
-
},
|
|
112
|
+
components: { 'v-data-table': VDataTable, DataTableEmptyWrapper, DataTablePaginator },
|
|
89
113
|
data() {
|
|
90
114
|
return {
|
|
91
115
|
headers,
|
|
@@ -145,6 +169,10 @@ TableSampleData.story = {
|
|
|
145
169
|
name: 'With data',
|
|
146
170
|
};
|
|
147
171
|
|
|
172
|
+
TableSampleDataWithCheckbox.story = {
|
|
173
|
+
name: 'With data and checkbox',
|
|
174
|
+
};
|
|
175
|
+
|
|
148
176
|
TableSampleLocalPagination.story = {
|
|
149
177
|
name: 'With data and local pagination',
|
|
150
178
|
};
|
|
@@ -5,23 +5,19 @@ $defaultLefts: 0, 4rem, 4rem;
|
|
|
5
5
|
font-size: 0.75rem;
|
|
6
6
|
}
|
|
7
7
|
tbody tr:nth-of-type(odd) td {
|
|
8
|
-
background-color:
|
|
8
|
+
background-color: var(--farm-neutral-lighten);
|
|
9
9
|
}
|
|
10
10
|
tr td {
|
|
11
11
|
background-color: white;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
color: var(--v-primary-base);
|
|
15
|
-
text-transform: uppercase;
|
|
16
|
-
font-weight: bold;
|
|
17
|
-
}
|
|
13
|
+
|
|
18
14
|
tr:not(:last-child) td,
|
|
19
15
|
tr th {
|
|
20
16
|
border-bottom: none;
|
|
21
17
|
}
|
|
22
18
|
.v-data-table__wrapper {
|
|
23
|
-
border-top: 1px solid var(--
|
|
24
|
-
border-bottom: 1px solid var(--
|
|
19
|
+
border-top: 1px solid var(--farm-gray-lighten);
|
|
20
|
+
border-bottom: 1px solid var(--farm-gray-lighten);
|
|
25
21
|
}
|
|
26
22
|
tr td:first-child,
|
|
27
23
|
th:first-child {
|
|
@@ -65,5 +61,42 @@ $defaultLefts: 0, 4rem, 4rem;
|
|
|
65
61
|
cursor: default;
|
|
66
62
|
}
|
|
67
63
|
}
|
|
64
|
+
|
|
65
|
+
th[role='columnheader'] {
|
|
66
|
+
color: var(--farm-secondary-base);
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
text-transform: uppercase;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
td {
|
|
73
|
+
color: var(--farm-text-primary);
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
font-weight: 400;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
thead {
|
|
79
|
+
height: 51px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
th[role='columnheader']:has(> .v-data-table__checkbox) {
|
|
83
|
+
max-width: 71px !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.v-data-table-header tr th {
|
|
87
|
+
box-shadow: 0px 1px 0px 0px var(--farm-gray-lighten);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.v-data-table-header__icon {
|
|
91
|
+
color: var(--farm-gray-base) !important;
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
font-weight: 900;
|
|
94
|
+
margin-left: 8px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.v-data-table__checkbox .mdi {
|
|
98
|
+
margin-left: 18px;
|
|
99
|
+
font-size: 24px;
|
|
100
|
+
}
|
|
68
101
|
}
|
|
69
102
|
}
|