@farm-investimentos/front-mfe-components-vue3 0.6.1 → 0.6.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 +224 -134
- 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 +224 -134
- 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/ChipInviteStatus/keys.ts +9 -9
- package/src/components/ContextMenu/ContextMenu.stories.js +0 -4
- package/src/components/DatePicker/DatePicker.vue +3 -1
- package/src/components/InputDecimalFormatter/__tests__/InputMoney.spec.js +6 -3
- package/src/components/ListItem/ListItem.scss +54 -8
- package/src/components/ListItem/ListItem.vue +2 -2
- package/src/components/MainFilter/MainFilter.vue +1 -0
- package/src/components/Modal/Modal.vue +6 -10
- package/src/components/Modal/__tests__/Modal.spec.js +10 -0
- package/src/components/ModalPromptUser/ModalPromptUser.vue +1 -1
- package/src/components/ModalPromptUser/__tests__/ModalPromptUser.spec.js +1 -1
- package/src/components/RadioGroup/__tests__/RadioGroup.spec.js +1 -1
- package/src/components/Select/Select.scss +5 -5
- package/src/components/Select/Select.stories.js +74 -0
- package/src/components/Select/Select.vue +166 -64
- package/src/components/Select/__tests__/Select.spec.js +62 -1
- package/src/components/Select/__tests__/selectItemHandler.spec.js +93 -0
- package/src/components/Select/composition/buildData.ts +2 -0
- package/src/components/Select/composition/index.ts +3 -1
- package/src/components/Select/composition/selectItemHandler.ts +60 -0
- package/src/components/Select/composition/watchAllChecked.ts +23 -0
- package/src/components/SelectAutoComplete/SelectAutoComplete.vue +1 -1
- package/src/components/SelectAutoComplete/__tests__/SelectAutoComplete.spec.js +1 -1
- package/src/components/TextArea/__tests__/TextArea.spec.js +5 -1
- package/src/interfaces/ISelectItem.ts +5 -0
- package/src/scss/Sticky-table.scss +13 -10
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
10: { label: 'Convidar', color: '
|
|
3
|
-
11: { label: 'Convidado', color: 'warning',
|
|
4
|
-
12: { label: 'Incompleto', color: '
|
|
5
|
-
13: { label: 'Concluído', color: '
|
|
6
|
-
14: { label: 'Falha/Erro', color: 'error',
|
|
7
|
-
15: { label: 'Em Análise', color: 'info',
|
|
8
|
-
16: { label: 'Em Andamento', color: 'secondary', variation: 'darken' },
|
|
9
|
-
17: { label: 'Em Espera', color: '
|
|
10
|
-
18: { label: 'Declinado', color: '
|
|
2
|
+
10: { label: 'Convidar', color: 'success', variation: 'base' },
|
|
3
|
+
11: { label: 'Convidado', color: 'warning', variation: 'lighten' },
|
|
4
|
+
12: { label: 'Incompleto', color: 'error', variation: 'lighten' },
|
|
5
|
+
13: { label: 'Concluído', color: 'success', variation: 'lighten' },
|
|
6
|
+
14: { label: 'Falha/Erro', color: 'error', variation: 'base' },
|
|
7
|
+
15: { label: 'Em Análise', color: 'info', variation: 'base' },
|
|
8
|
+
16: { label: 'Em Andamento', color: 'secondary-golden', variation: 'darken' },
|
|
9
|
+
17: { label: 'Em Espera', color: 'info', variation: 'lighten' },
|
|
10
|
+
18: { label: 'Declinado', color: 'neutral', variation: 'base' },
|
|
11
11
|
};
|
|
@@ -25,7 +25,6 @@ export const Primary = () => ({
|
|
|
25
25
|
<template v-slot:activator="{ on, attrs }">
|
|
26
26
|
<farm-btn
|
|
27
27
|
v-bind="attrs"
|
|
28
|
-
v-on="on"
|
|
29
28
|
>
|
|
30
29
|
open
|
|
31
30
|
</farm-btn>
|
|
@@ -41,7 +40,6 @@ export const LongActivator = () => ({
|
|
|
41
40
|
<template v-slot:activator="{ on, attrs }">
|
|
42
41
|
<farm-btn
|
|
43
42
|
v-bind="attrs"
|
|
44
|
-
v-on="on"
|
|
45
43
|
>
|
|
46
44
|
Very long Activator
|
|
47
45
|
</farm-btn>
|
|
@@ -57,7 +55,6 @@ export const IconActivator = () => ({
|
|
|
57
55
|
<template v-slot:activator="{ on, attrs }">
|
|
58
56
|
<farm-btn
|
|
59
57
|
v-bind="attrs"
|
|
60
|
-
v-on="on"
|
|
61
58
|
icon
|
|
62
59
|
>
|
|
63
60
|
<farm-icon>help-circle</farm-icon>
|
|
@@ -209,7 +206,6 @@ export const Right = () => ({
|
|
|
209
206
|
<template v-slot:activator="{ on, attrs }">
|
|
210
207
|
<farm-btn
|
|
211
208
|
v-bind="attrs"
|
|
212
|
-
v-on="on"
|
|
213
209
|
>
|
|
214
210
|
open
|
|
215
211
|
</farm-btn>
|
|
@@ -233,13 +233,15 @@ export default {
|
|
|
233
233
|
this.dateField = this.modelValue;
|
|
234
234
|
}
|
|
235
235
|
},
|
|
236
|
+
pickerDate(newValue) {
|
|
237
|
+
this.internalPickerDate = newValue;
|
|
238
|
+
},
|
|
236
239
|
},
|
|
237
240
|
methods: {
|
|
238
241
|
save() {
|
|
239
242
|
this.inputVal = this.dateField;
|
|
240
243
|
this.menuField = false;
|
|
241
244
|
this.closeDatepicker();
|
|
242
|
-
|
|
243
245
|
},
|
|
244
246
|
clear() {
|
|
245
247
|
this.dateField = this.multiple ? [] : '';
|
|
@@ -8,9 +8,12 @@ describe('InputDecimalFormatter component', () => {
|
|
|
8
8
|
|
|
9
9
|
beforeEach(() => {
|
|
10
10
|
wrapper = shallowMount(InputDecimalFormatter, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
global: {
|
|
12
|
+
directives: {
|
|
13
|
+
mask: () => { },
|
|
14
|
+
money3: () => { },
|
|
15
|
+
},
|
|
16
|
+
}
|
|
14
17
|
});
|
|
15
18
|
component = wrapper.vm;
|
|
16
19
|
});
|
|
@@ -8,10 +8,24 @@
|
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
|
|
11
|
+
.farm-icon,
|
|
12
|
+
.farm-typography {
|
|
13
|
+
color: var(--farm-neutral-darken);
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
&--clickable {
|
|
12
17
|
cursor: pointer;
|
|
13
18
|
}
|
|
14
19
|
|
|
20
|
+
&--disabled {
|
|
21
|
+
cursor: default;
|
|
22
|
+
|
|
23
|
+
.farm-icon,
|
|
24
|
+
.farm-typography {
|
|
25
|
+
color: var(--farm-stroke-disabled);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
15
29
|
> a {
|
|
16
30
|
text-decoration: none;
|
|
17
31
|
}
|
|
@@ -20,17 +34,49 @@
|
|
|
20
34
|
&:focus {
|
|
21
35
|
border-radius: 5px;
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
&:not(.farm-listitem--disabled) {
|
|
38
|
+
@each $color in $theme-colors-list {
|
|
39
|
+
&#{'.farm-listitem--' + $color + '-base'} {
|
|
40
|
+
background-color: rgba(themeColor($color), 0.27);
|
|
41
|
+
.farm-icon,
|
|
42
|
+
.farm-typography {
|
|
43
|
+
color: rgba(themeColor($color), 1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&#{'.farm-listitem--' + $color + '-lighten'} {
|
|
48
|
+
background-color: rgba(themeColor($color, 'lighten'), 0.27);
|
|
49
|
+
.farm-icon,
|
|
50
|
+
.farm-typography {
|
|
51
|
+
color: rgba(themeColor($color), 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
27
54
|
|
|
28
|
-
|
|
29
|
-
|
|
55
|
+
&#{'.farm-listitem--' + $color + '-darken'} {
|
|
56
|
+
background-color: rgba(themeColor($color, 'darken'), 0.27);
|
|
57
|
+
.farm-icon,
|
|
58
|
+
.farm-typography {
|
|
59
|
+
color: rgba(themeColor($color), 1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
30
62
|
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:active {
|
|
67
|
+
&:not(.farm-listitem--disabled) {
|
|
68
|
+
@each $color in $theme-colors-list {
|
|
69
|
+
&#{'.farm-listitem--' + $color + '-base'} {
|
|
70
|
+
background-color: rgba(themeColor($color), 0.8);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&#{'.farm-listitem--' + $color + '-lighten'} {
|
|
74
|
+
background-color: rgba(themeColor($color, 'lighten'), 0.8);
|
|
75
|
+
}
|
|
31
76
|
|
|
32
|
-
|
|
33
|
-
|
|
77
|
+
&#{'.farm-listitem--' + $color + '-darken'} {
|
|
78
|
+
background-color: rgba(themeColor($color, 'darken'), 0.8);
|
|
79
|
+
}
|
|
34
80
|
}
|
|
35
81
|
}
|
|
36
82
|
}
|
|
@@ -21,21 +21,16 @@
|
|
|
21
21
|
<slot name="footer"></slot>
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
|
-
<div
|
|
24
|
+
<div
|
|
25
|
+
class="farm-modal--overlay"
|
|
26
|
+
@click="close()"
|
|
27
|
+
></div>
|
|
25
28
|
</div>
|
|
26
29
|
</transition>
|
|
27
30
|
</template>
|
|
28
31
|
|
|
29
32
|
<script lang="ts">
|
|
30
|
-
import {
|
|
31
|
-
onBeforeUnmount,
|
|
32
|
-
onMounted,
|
|
33
|
-
PropType,
|
|
34
|
-
reactive,
|
|
35
|
-
ref,
|
|
36
|
-
toRefs,
|
|
37
|
-
watch,
|
|
38
|
-
} from 'vue';
|
|
33
|
+
import { onBeforeUnmount, onMounted, PropType, reactive, ref, toRefs, watch } from 'vue';
|
|
39
34
|
|
|
40
35
|
import { calculateMainZindex } from '../../helpers';
|
|
41
36
|
|
|
@@ -87,6 +82,7 @@ export default {
|
|
|
87
82
|
window.removeEventListener('keyup', escHandler);
|
|
88
83
|
inputValue.value = false;
|
|
89
84
|
emit('update:modelValue', false);
|
|
85
|
+
emit('onClose');
|
|
90
86
|
};
|
|
91
87
|
|
|
92
88
|
watch(
|
|
@@ -4,6 +4,7 @@ import Modal from '../index';
|
|
|
4
4
|
|
|
5
5
|
describe('Modal component', () => {
|
|
6
6
|
let wrapper;
|
|
7
|
+
let component;
|
|
7
8
|
|
|
8
9
|
beforeEach(() => {
|
|
9
10
|
wrapper = shallowMount(Modal, {
|
|
@@ -11,9 +12,18 @@ describe('Modal component', () => {
|
|
|
11
12
|
modelValue: false,
|
|
12
13
|
},
|
|
13
14
|
});
|
|
15
|
+
component = wrapper.vm;
|
|
14
16
|
});
|
|
15
17
|
|
|
16
18
|
test('Modal created', () => {
|
|
17
19
|
expect(wrapper).toBeDefined();
|
|
18
20
|
});
|
|
21
|
+
|
|
22
|
+
describe('Methods', () => {
|
|
23
|
+
it('Should emit events when call close function', () => {
|
|
24
|
+
component.close();
|
|
25
|
+
expect(wrapper.emitted()['update:modelValue']).toBeDefined();
|
|
26
|
+
expect(wrapper.emitted()['onClose']).toBeDefined();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
19
29
|
});
|
|
@@ -28,22 +28,22 @@
|
|
|
28
28
|
margin-right: 8px;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
:deep(.farm-listitem:hover .farm-typography) {
|
|
31
|
+
:deep(.farm-listitem:not(.farm-listitem--disabled):hover .farm-typography) {
|
|
32
32
|
color: var(--farm-primary-base);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
:deep(.farm-listitem:focus .farm-typography) {
|
|
35
|
+
:deep(.farm-listitem:not(.farm-listitem--disabled):focus .farm-typography) {
|
|
36
36
|
color: var(--farm-primary-base);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
:deep(.farm-listitem:hover .farm-checkbox .farm-icon) {
|
|
39
|
+
:deep(.farm-listitem:not(.farm-listitem--disabled):hover .farm-checkbox .farm-icon) {
|
|
40
40
|
color: var(--farm-primary-lighten);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
:deep(.farm-listitem:focus .farm-checkbox .farm-icon) {
|
|
43
|
+
:deep(.farm-listitem:not(.farm-listitem--disabled):focus .farm-checkbox .farm-icon) {
|
|
44
44
|
color: var(--farm-primary-lighten);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
:deep(.farm-listitem:hover .farm-checkbox.farm-checkbox--checked .farm-icon) {
|
|
48
48
|
color: white;
|
|
49
|
-
}
|
|
49
|
+
}
|
|
@@ -251,6 +251,42 @@ export const Multiple = () => ({
|
|
|
251
251
|
</div>`,
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
+
export const MultipleSelectAll = () => ({
|
|
255
|
+
data() {
|
|
256
|
+
return {
|
|
257
|
+
v: null,
|
|
258
|
+
items: [
|
|
259
|
+
{ value: 0, text: 'value 0' },
|
|
260
|
+
{ value: 1, text: 'value 1' },
|
|
261
|
+
{ value: 2, text: 'value 2' },
|
|
262
|
+
{ value: 3, text: 'value 3' },
|
|
263
|
+
],
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
template: `<div style="width: 400px">
|
|
267
|
+
<farm-select v-model="v" :items="items" multiple has-all-option />
|
|
268
|
+
v-model: {{ v }}
|
|
269
|
+
</div>`,
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
export const MultipleWithAllOptionAndDisabledItems = () => ({
|
|
273
|
+
data() {
|
|
274
|
+
return {
|
|
275
|
+
v: null,
|
|
276
|
+
items: [
|
|
277
|
+
{ value: 0, text: 'value 0' },
|
|
278
|
+
{ value: 1, text: 'value 1', disabled: true },
|
|
279
|
+
{ value: 2, text: 'value 2' },
|
|
280
|
+
{ value: 3, text: 'value 3', disabled: true },
|
|
281
|
+
],
|
|
282
|
+
};
|
|
283
|
+
},
|
|
284
|
+
template: `<div style="width: 400px">
|
|
285
|
+
<farm-select v-model="v" :items="items" multiple has-all-option />
|
|
286
|
+
v-model: {{ v }}
|
|
287
|
+
</div>`,
|
|
288
|
+
});
|
|
289
|
+
|
|
254
290
|
export const MultipleInitValue = () => ({
|
|
255
291
|
data() {
|
|
256
292
|
return {
|
|
@@ -344,3 +380,41 @@ export const ChangeEvent = () => ({
|
|
|
344
380
|
|
|
345
381
|
</div>`,
|
|
346
382
|
});
|
|
383
|
+
|
|
384
|
+
export const DisabledKeys = () => ({
|
|
385
|
+
data() {
|
|
386
|
+
return {
|
|
387
|
+
v: null,
|
|
388
|
+
items: [
|
|
389
|
+
{ value: 1, text: ' value 1', disabled: true },
|
|
390
|
+
{ value: 2, text: ' value 2', disabled: true },
|
|
391
|
+
{ value: 3, text: ' value 3' },
|
|
392
|
+
],
|
|
393
|
+
};
|
|
394
|
+
},
|
|
395
|
+
methods: {
|
|
396
|
+
allowAllOptions() {
|
|
397
|
+
this.items = [
|
|
398
|
+
{ value: 1, text: ' value 1' },
|
|
399
|
+
{ value: 2, text: ' value 2' },
|
|
400
|
+
{ value: 3, text: ' value 3' },
|
|
401
|
+
];
|
|
402
|
+
},
|
|
403
|
+
reset() {
|
|
404
|
+
this.items = [
|
|
405
|
+
{ value: 1, text: ' value 1', disabled: true },
|
|
406
|
+
{ value: 2, text: ' value 2', disabled: true },
|
|
407
|
+
{ value: 3, text: ' value 3' },
|
|
408
|
+
];
|
|
409
|
+
this.v = null;
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
template: `<farm-row>
|
|
413
|
+
<farm-col md="4">
|
|
414
|
+
<farm-select v-model="v" :items="items" />
|
|
415
|
+
v-model: {{ v }}
|
|
416
|
+
<farm-btn @click="allowAllOptions">Habilitar todos itens</farm-btn>
|
|
417
|
+
<farm-btn @click="reset">Resetar</farm-btn>
|
|
418
|
+
</farm-col>
|
|
419
|
+
</farm-row>`,
|
|
420
|
+
});
|