@farm-investimentos/front-mfe-components 11.8.1 → 11.8.3
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 +308 -187
- 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 +308 -187
- 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/DefaultButton/DefaultButton.scss +224 -230
- package/src/components/IdCaption/IdCaption.vue +1 -1
- package/src/components/MainFilter/MainFilter.vue +2 -3
- package/src/components/Radio/Radio.scss +51 -0
- package/src/components/Radio/Radio.stories.js +79 -0
- package/src/components/Radio/Radio.vue +50 -0
- package/src/components/Radio/__tests__/Radio.spec.js +17 -0
- package/src/components/Radio/index.ts +4 -0
- package/src/components/Select/Select.stories.js +20 -4
- package/src/components/Select/Select.vue +3 -2
- package/src/components/TextFieldV2/TextFieldV2.scss +5 -0
- package/src/components/TextFieldV2/TextFieldV2.vue +4 -1
- package/src/main.ts +1 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<input
|
|
3
|
+
:class="{
|
|
4
|
+
'farm-radio': true,
|
|
5
|
+
'farm-radio--checked': isChecked,
|
|
6
|
+
}"
|
|
7
|
+
type="radio"
|
|
8
|
+
:checked="isChecked"
|
|
9
|
+
:value="value"
|
|
10
|
+
@click="onClick"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import Vue from 'vue';
|
|
15
|
+
|
|
16
|
+
export default Vue.extend({
|
|
17
|
+
name: 'farm-radio',
|
|
18
|
+
model: {
|
|
19
|
+
prop: 'modelValue',
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
/**
|
|
23
|
+
* v-model binding
|
|
24
|
+
*/
|
|
25
|
+
modelValue: { default: '' },
|
|
26
|
+
/**
|
|
27
|
+
* Value to be set to v-model
|
|
28
|
+
*/
|
|
29
|
+
value: { type: String, default: undefined },
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
isChecked() {
|
|
33
|
+
return this.modelValue == this.value;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
onClick(event) {
|
|
38
|
+
this.$emit('change', event.target.value);
|
|
39
|
+
this.$emit('input', event.target.value);
|
|
40
|
+
},
|
|
41
|
+
validate() {},
|
|
42
|
+
reset() {
|
|
43
|
+
this.$emit('input', null);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
<style lang="scss" scoped>
|
|
49
|
+
@import 'Radio';
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import Radio from '../Radio.vue';
|
|
4
|
+
|
|
5
|
+
describe('Radio component', () => {
|
|
6
|
+
let wrapper;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(Radio, {
|
|
10
|
+
propsData: {},
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('Radio created', () => {
|
|
15
|
+
expect(wrapper).toBeDefined();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -33,7 +33,7 @@ export const Primary = () => ({
|
|
|
33
33
|
],
|
|
34
34
|
};
|
|
35
35
|
},
|
|
36
|
-
template: `<div style="width:
|
|
36
|
+
template: `<div style="width: 120px">
|
|
37
37
|
<farm-select v-model="v" :items="items" />
|
|
38
38
|
v-model: {{ v }}
|
|
39
39
|
</div>`,
|
|
@@ -112,7 +112,6 @@ export const Validate = () => ({
|
|
|
112
112
|
</div>`,
|
|
113
113
|
});
|
|
114
114
|
|
|
115
|
-
|
|
116
115
|
export const Reset = () => ({
|
|
117
116
|
data() {
|
|
118
117
|
return {
|
|
@@ -130,7 +129,7 @@ export const Reset = () => ({
|
|
|
130
129
|
methods: {
|
|
131
130
|
click() {
|
|
132
131
|
this.$refs.select.reset();
|
|
133
|
-
}
|
|
132
|
+
},
|
|
134
133
|
},
|
|
135
134
|
template: `<div style="width: 480px">
|
|
136
135
|
<farm-select v-model="v" :items="items" ref="select" :rules="[rules.required]" />
|
|
@@ -139,4 +138,21 @@ export const Reset = () => ({
|
|
|
139
138
|
reset
|
|
140
139
|
</farm-btn>
|
|
141
140
|
</div>`,
|
|
142
|
-
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
export const CustomKeys = () => ({
|
|
144
|
+
data() {
|
|
145
|
+
return {
|
|
146
|
+
v: 1,
|
|
147
|
+
items: [
|
|
148
|
+
{ id: 1, label: ' value 1' },
|
|
149
|
+
{ id: 2, label: ' value 2' },
|
|
150
|
+
{ id: 3, label: ' value 3' },
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
template: `<div style="width: 480px">
|
|
155
|
+
<farm-select v-model="v" :items="items" item-text="label" item-value="id" />
|
|
156
|
+
v-model: {{ v }}
|
|
157
|
+
</div>`,
|
|
158
|
+
});
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
clickable
|
|
19
19
|
hoverColorVariation="lighten"
|
|
20
20
|
hover-color="primary"
|
|
21
|
-
:key="'contextmenu_item_' + item
|
|
21
|
+
:key="'contextmenu_item_' + item[itemText]"
|
|
22
22
|
:class="{ 'farm-listitem--selected': item[itemValue] === innerValue }"
|
|
23
23
|
@click="selectItem(item)"
|
|
24
24
|
>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</farm-listitem>
|
|
27
27
|
</farm-list>
|
|
28
28
|
<template v-slot:activator="{}">
|
|
29
|
-
<div class="farm-textfield--input">
|
|
29
|
+
<div class="farm-textfield--input farm-textfield--input--iconed">
|
|
30
30
|
<input
|
|
31
31
|
v-model="selectedText"
|
|
32
32
|
:disabled="disabled"
|
|
@@ -165,6 +165,7 @@ export default Vue.extend({
|
|
|
165
165
|
|
|
166
166
|
onBeforeMount(() => {
|
|
167
167
|
validate(innerValue.value);
|
|
168
|
+
|
|
168
169
|
const selectedItem = items.value.find(
|
|
169
170
|
item => item[itemValue.value] === innerValue.value
|
|
170
171
|
);
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
'farm-textfield--disabled': disabled,
|
|
11
11
|
}"
|
|
12
12
|
>
|
|
13
|
-
<div class="
|
|
13
|
+
<div :class="{
|
|
14
|
+
'farm-textfield--input': true,
|
|
15
|
+
'farm-textfield--input--iconed': icon
|
|
16
|
+
}">
|
|
14
17
|
<button
|
|
15
18
|
type="button"
|
|
16
19
|
v-if="icon && iconPosition === 'left'"
|
package/src/main.ts
CHANGED
|
@@ -82,6 +82,7 @@ export * from './components/Logger/LoggerItem';
|
|
|
82
82
|
export * from './components/Icon';
|
|
83
83
|
export * from './components/Modal';
|
|
84
84
|
export * from './components/ProgressBar';
|
|
85
|
+
export * from './components/Radio';
|
|
85
86
|
export * from './components/RadioGroup';
|
|
86
87
|
export * from './components/Select';
|
|
87
88
|
export * from './components/Stepper';
|