@farm-investimentos/front-mfe-components 9.3.0 → 9.3.2
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 +426 -89
- 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 +426 -89
- 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/Checkbox/Checkbox.scss +26 -5
- package/src/components/Checkbox/Checkbox.stories.js +31 -0
- package/src/components/Checkbox/Checkbox.vue +25 -4
- package/src/components/Chip/Chip.scss +29 -4
- package/src/components/Chip/Chip.stories.js +0 -2
- package/src/components/Form/Form.stories.js +134 -0
- package/src/components/Form/Form.vue +67 -0
- package/src/components/Form/__tests__/Form.spec.js +16 -0
- package/src/components/Form/index.ts +4 -0
- package/src/components/Modal/Modal.stories.js +0 -27
- package/src/components/RadioGroup/IRadioGroup.ts +6 -0
- package/src/components/RadioGroup/RadioGroup.scss +82 -0
- package/src/components/RadioGroup/RadioGroup.stories.js +34 -0
- package/src/components/RadioGroup/RadioGroup.vue +71 -0
- package/src/components/RadioGroup/__tests__/RadioGroup.spec.js +20 -0
- package/src/components/RadioGroup/index.ts +4 -0
- package/src/components/layout/Container/Container.stories.js +0 -1
- package/src/components/layout/Row/Row.scss +6 -0
- package/src/components/layout/Row/Row.stories.js +22 -0
- package/src/components/layout/Row/Row.vue +22 -0
- package/src/components/layout/Row/__tests__/Row.spec.js +22 -0
- package/src/components/layout/Row/index.ts +4 -0
- package/src/configurations/_theme-colors.scss +8 -8
- package/src/examples/Form/Full.stories.js +1 -1
- package/src/main.ts +3 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="{
|
|
4
|
+
'farm-radio-group': true,
|
|
5
|
+
'farm-radio-group--column': $props.column,
|
|
6
|
+
}">
|
|
7
|
+
<div class="farm-radio-group__item"
|
|
8
|
+
v-for="(button, index) in buttons"
|
|
9
|
+
:key="`farm-radio-group_` + index"
|
|
10
|
+
@click="clicked(button.id)"
|
|
11
|
+
>
|
|
12
|
+
<input
|
|
13
|
+
type="radio"
|
|
14
|
+
name="radio"
|
|
15
|
+
:checked="button.id === $props.value"
|
|
16
|
+
:id="`farm-radio-group_` + index"
|
|
17
|
+
:style="cssVars"
|
|
18
|
+
:value="button.id"
|
|
19
|
+
>
|
|
20
|
+
<label>
|
|
21
|
+
{{button.label}}
|
|
22
|
+
</label>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import Vue, { PropType } from 'vue';
|
|
28
|
+
import IRadioGroup from './IRadioGroup';
|
|
29
|
+
export default Vue.extend({
|
|
30
|
+
name: 'farm-radio-group',
|
|
31
|
+
props: {
|
|
32
|
+
/**
|
|
33
|
+
* Array of buttons
|
|
34
|
+
*/
|
|
35
|
+
buttons: {
|
|
36
|
+
type: Array as PropType<Array<IRadioGroup>>,
|
|
37
|
+
default: () => [],
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* v-model
|
|
41
|
+
*/
|
|
42
|
+
value: {
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
column: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
color: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '#00B493',
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
clicked(value) {
|
|
56
|
+
this.$emit('input', value);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
cssVars () {
|
|
61
|
+
return {
|
|
62
|
+
'--radio-group-color': this.color
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
69
|
+
<style lang="scss" scoped>
|
|
70
|
+
@import './RadioGroup.scss';
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import RadioGroup from '../RadioGroup';
|
|
3
|
+
|
|
4
|
+
describe('RadioGroup component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(RadioGroup, {});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('Created hook', () => {
|
|
12
|
+
expect(wrapper).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('mount component', () => {
|
|
16
|
+
it('renders correctly', () => {
|
|
17
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Row from './Row.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/Row',
|
|
5
|
+
component: Row,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Row<br />
|
|
10
|
+
selector: <em>farm-row</em>
|
|
11
|
+
`,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
viewMode: 'docs',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const Primary = () => ({
|
|
19
|
+
template: '<farm-row>row content</farm-row>',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
Primary.storyName = 'Basic';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component v-bind:is="tag" class="farm-row">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</component>
|
|
5
|
+
</template>
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import Vue from 'vue';
|
|
8
|
+
|
|
9
|
+
export default Vue.extend({
|
|
10
|
+
name: 'farm-row',
|
|
11
|
+
props: {
|
|
12
|
+
/**
|
|
13
|
+
* Html tag
|
|
14
|
+
*/
|
|
15
|
+
tag: { type: String, default: 'div' },
|
|
16
|
+
},
|
|
17
|
+
inheritAttrs: true,
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
<style lang="scss" scoped>
|
|
21
|
+
@import 'Row.scss';
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import Row from '../Row';
|
|
3
|
+
|
|
4
|
+
describe('Row component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(Row);
|
|
10
|
+
component = wrapper.vm;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Created hook', () => {
|
|
14
|
+
expect(wrapper).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('mount component', () => {
|
|
18
|
+
it('renders correctly', () => {
|
|
19
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
$primary: (
|
|
2
|
-
base: #
|
|
2
|
+
base: #00B493,
|
|
3
3
|
lighten: #EBFFFB,
|
|
4
|
-
darken: #
|
|
4
|
+
darken: #099A82,
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
$secondary: (
|
|
8
|
-
base: #
|
|
9
|
-
lighten: #
|
|
10
|
-
darken: #
|
|
8
|
+
base: #1A3738,
|
|
9
|
+
lighten: #467D7E,
|
|
10
|
+
darken: #0B1A1B,
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
$neutral: (
|
|
14
|
-
base: #
|
|
14
|
+
base: #E0E0E0,
|
|
15
15
|
lighten: #F5F5F5,
|
|
16
|
-
darken: #
|
|
16
|
+
darken: #5C5C5C,
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
$error: (
|
|
@@ -42,7 +42,7 @@ $success: (
|
|
|
42
42
|
|
|
43
43
|
$extra-1: (
|
|
44
44
|
base: #8E24AA,
|
|
45
|
-
lighten: #
|
|
45
|
+
lighten: #F3E5F5,
|
|
46
46
|
darken: #4A148C,
|
|
47
47
|
);
|
|
48
48
|
|
|
@@ -42,7 +42,7 @@ export const Primary = () => ({
|
|
|
42
42
|
<farm-textfield v-model="form.name" />
|
|
43
43
|
</div>
|
|
44
44
|
<div class="footer" :style="[styles.footer]">
|
|
45
|
-
<
|
|
45
|
+
<farm-btn color="secondary" :disabled="!validForm">Salvar</farm-btn>
|
|
46
46
|
</div>
|
|
47
47
|
</v-form>
|
|
48
48
|
`,
|
package/src/main.ts
CHANGED
|
@@ -69,12 +69,14 @@ export * from './components/ResetTableRowSelection';
|
|
|
69
69
|
export * from './components/MultipleSelectShortener';
|
|
70
70
|
export * from './components/SelectModalOptions';
|
|
71
71
|
export * from './components/ChipInviteStatus';
|
|
72
|
+
export * from './components/Form';
|
|
72
73
|
export * from './components/Label';
|
|
73
74
|
export * from './components/Logger';
|
|
74
75
|
export * from './components/Logger/LoggerItem';
|
|
75
76
|
export * from './components/Icon';
|
|
76
77
|
export * from './components/Modal';
|
|
77
78
|
export * from './components/ProgressBar';
|
|
79
|
+
export * from './components/RadioGroup';
|
|
78
80
|
export * from './components/Stepper';
|
|
79
81
|
export * from './components/Switcher';
|
|
80
82
|
export * from './components/TextField';
|
|
@@ -83,4 +85,5 @@ export * from './components/Typography';
|
|
|
83
85
|
|
|
84
86
|
export * from './components/layout/Container';
|
|
85
87
|
export * from './components/layout/ContainerFooter';
|
|
88
|
+
export * from './components/layout/Row';
|
|
86
89
|
export * from './components/layout/Line';
|