@farm-investimentos/front-mfe-components 11.11.2 → 11.11.4
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 +139 -128
- 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 +139 -128
- 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 +4 -1
- package/src/components/DataTablePaginator/__tests__/DataTablePaginator.spec.js +5 -1
- package/src/components/Radio/Radio.scss +17 -4
- package/src/components/Radio/Radio.stories.js +16 -1
- package/src/components/Radio/Radio.vue +9 -1
- package/src/components/Radio/__tests__/Radio.spec.js +11 -1
- package/src/components/RadioGroup/__tests__/RadioGroup.spec.js +5 -1
package/package.json
CHANGED
|
@@ -86,6 +86,9 @@ export default Vue.extend({
|
|
|
86
86
|
window.addEventListener('resize', resizeWindowHandler);
|
|
87
87
|
calculatePosition();
|
|
88
88
|
} else {
|
|
89
|
+
styles.top = 0;
|
|
90
|
+
styles.left = 0;
|
|
91
|
+
styles.zIndex = 0;
|
|
89
92
|
window.removeEventListener('click', outClick);
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -113,7 +116,7 @@ export default Vue.extend({
|
|
|
113
116
|
? parseInt(activatorBoundingClientRect.width)
|
|
114
117
|
: 96) + 'px';
|
|
115
118
|
|
|
116
|
-
if(activatorBoundingClientRect.width < 96) {
|
|
119
|
+
if (activatorBoundingClientRect.width < 96) {
|
|
117
120
|
const w = popupClientRect.width < 96 ? 96 : popupClientRect.width;
|
|
118
121
|
offsetLeft =
|
|
119
122
|
activatorBoundingClientRect.left +
|
|
@@ -6,7 +6,11 @@ describe('DataTablePaginator component', () => {
|
|
|
6
6
|
let component;
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
9
|
-
wrapper = shallowMount(DataTablePaginator
|
|
9
|
+
wrapper = shallowMount(DataTablePaginator, {
|
|
10
|
+
propsData: {
|
|
11
|
+
title: '',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
10
14
|
component = wrapper.vm;
|
|
11
15
|
});
|
|
12
16
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../../configurations/variables';
|
|
2
|
+
|
|
1
3
|
input[type="radio"] {
|
|
2
4
|
-webkit-appearance: none;
|
|
3
5
|
appearance: none;
|
|
@@ -5,8 +7,6 @@ input[type="radio"] {
|
|
|
5
7
|
margin: 0;
|
|
6
8
|
font: inherit;
|
|
7
9
|
color: rgba(0, 0, 0, .6);
|
|
8
|
-
width: 24px;
|
|
9
|
-
height: 24px;
|
|
10
10
|
border: 1.5px solid rgba(0, 0, 0, .6);
|
|
11
11
|
border-radius: 50%;
|
|
12
12
|
display: grid;
|
|
@@ -15,8 +15,6 @@ input[type="radio"] {
|
|
|
15
15
|
|
|
16
16
|
&::before {
|
|
17
17
|
content: "";
|
|
18
|
-
width: 10px;
|
|
19
|
-
height: 10px;
|
|
20
18
|
border-radius: 50%;
|
|
21
19
|
transform: scale(0);
|
|
22
20
|
transition: 120ms transform ease-in-out;
|
|
@@ -47,4 +45,19 @@ input[type="radio"] {
|
|
|
47
45
|
&:active {
|
|
48
46
|
animation: pulse 0.2s 1 ease-out;
|
|
49
47
|
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@each $size,
|
|
52
|
+
$value in $sizes {
|
|
53
|
+
#{'input[type="radio"][size=' + $size +']'} {
|
|
54
|
+
width: $value;
|
|
55
|
+
height: $value;
|
|
56
|
+
|
|
57
|
+
&::before {
|
|
58
|
+
content: "";
|
|
59
|
+
width: $value / 2;
|
|
60
|
+
height: $value / 2;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
50
63
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { withDesign } from 'storybook-addon-designs';
|
|
2
2
|
import Radio from './Radio.vue';
|
|
3
|
+
import sizes from '../../configurations/sizes';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Form/Radio',
|
|
@@ -10,7 +11,7 @@ export default {
|
|
|
10
11
|
description: {
|
|
11
12
|
component: `Radio<br />
|
|
12
13
|
selector: <em>farm-radio</em><br />
|
|
13
|
-
<span style="color: var(--farm-
|
|
14
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
14
15
|
`,
|
|
15
16
|
},
|
|
16
17
|
design: {
|
|
@@ -81,3 +82,17 @@ export const Checked = () => ({
|
|
|
81
82
|
v-model: {{ v }}
|
|
82
83
|
</div>`,
|
|
83
84
|
});
|
|
85
|
+
|
|
86
|
+
export const Sizes = () => ({
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
sizes,
|
|
90
|
+
v: 1,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
template: `<div style="width: 480px">
|
|
94
|
+
<div v-for="size in sizes" :key="size" class="d-flex flex-row align-center mb-3">
|
|
95
|
+
<farm-radio v-model="v" :value="size" :size="size" /> {{ size }}
|
|
96
|
+
</div>
|
|
97
|
+
</div>`,
|
|
98
|
+
});
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
'farm-radio--checked': isChecked,
|
|
6
6
|
}"
|
|
7
7
|
type="radio"
|
|
8
|
+
:size="$props.size"
|
|
8
9
|
:checked="isChecked"
|
|
9
10
|
:value="value"
|
|
10
11
|
@click="onClick"
|
|
11
12
|
/>
|
|
12
13
|
</template>
|
|
13
14
|
<script lang="ts">
|
|
14
|
-
import Vue from 'vue';
|
|
15
|
+
import Vue, { PropType } from 'vue';
|
|
15
16
|
|
|
16
17
|
export default Vue.extend({
|
|
17
18
|
name: 'farm-radio',
|
|
@@ -27,6 +28,13 @@ export default Vue.extend({
|
|
|
27
28
|
* Value to be set to v-model
|
|
28
29
|
*/
|
|
29
30
|
value: { type: [String, Number, Boolean], required: true },
|
|
31
|
+
/**
|
|
32
|
+
* Size
|
|
33
|
+
*/
|
|
34
|
+
size: {
|
|
35
|
+
type: String as PropType<'xs' | 'sm' | 'md' | 'lg' | 'xl'>,
|
|
36
|
+
default: 'md',
|
|
37
|
+
},
|
|
30
38
|
},
|
|
31
39
|
computed: {
|
|
32
40
|
isChecked() {
|
|
@@ -4,14 +4,24 @@ import Radio from '../Radio.vue';
|
|
|
4
4
|
|
|
5
5
|
describe('Radio component', () => {
|
|
6
6
|
let wrapper;
|
|
7
|
+
let component;
|
|
7
8
|
|
|
8
9
|
beforeEach(() => {
|
|
9
10
|
wrapper = shallowMount(Radio, {
|
|
10
|
-
propsData: {
|
|
11
|
+
propsData: {
|
|
12
|
+
value: 1,
|
|
13
|
+
},
|
|
11
14
|
});
|
|
15
|
+
component = wrapper.vm;
|
|
12
16
|
});
|
|
13
17
|
|
|
14
18
|
test('Radio created', () => {
|
|
15
19
|
expect(wrapper).toBeDefined();
|
|
16
20
|
});
|
|
21
|
+
|
|
22
|
+
describe('computed properties', () => {
|
|
23
|
+
it('get isRound false', () => {
|
|
24
|
+
expect(component.isChecked).toBeFalsy();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
17
27
|
});
|