@farm-investimentos/front-mfe-components-vue3 0.4.1 → 0.5.0
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 +388 -36
- 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 +388 -36
- 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 +3 -2
- package/src/components/DataTableHeader/DataTableHeader.scss +5 -6
- package/src/components/DataTableHeader/DataTableHeader.vue +5 -3
- package/src/components/InputMoney/InputMoney.scss +96 -0
- package/src/components/InputMoney/InputMoney.stories.js +123 -0
- package/src/components/InputMoney/InputMoney.vue +316 -0
- package/src/components/InputMoney/__tests__/InputMoney.spec.js +53 -0
- package/src/components/InputMoney/index.ts +4 -0
- package/src/components/TextFieldV2/TextFieldV2.stories.js +8 -7
- package/src/components/TextFieldV2/TextFieldV2.vue +17 -6
- package/src/components/Tooltip/Tooltip.scss +5 -2
- package/src/components/Tooltip/Tooltip.vue +12 -4
- package/src/examples/Table.stories.js +23 -11
- package/src/main.ts +1 -0
|
@@ -25,10 +25,14 @@
|
|
|
25
25
|
v-if="icon && iconPosition === 'left'"
|
|
26
26
|
@click="$emit('onClickIcon')"
|
|
27
27
|
>
|
|
28
|
-
<farm-icon
|
|
28
|
+
<farm-icon
|
|
29
|
+
color="gray"
|
|
30
|
+
size="20px"
|
|
31
|
+
>{{ icon }}</farm-icon
|
|
32
|
+
>
|
|
29
33
|
</button>
|
|
30
34
|
<input
|
|
31
|
-
v-bind="delete {...$attrs}.class"
|
|
35
|
+
v-bind="delete { ...$attrs }.class"
|
|
32
36
|
v-model="innerValue"
|
|
33
37
|
v-mask="mask"
|
|
34
38
|
:id="$props.id"
|
|
@@ -46,10 +50,18 @@
|
|
|
46
50
|
v-if="icon && iconPosition === 'right'"
|
|
47
51
|
@click="$emit('onClickIcon')"
|
|
48
52
|
>
|
|
49
|
-
<farm-icon
|
|
53
|
+
<farm-icon
|
|
54
|
+
color="gray"
|
|
55
|
+
size="20px"
|
|
56
|
+
>{{ icon }}</farm-icon
|
|
57
|
+
>
|
|
50
58
|
</button>
|
|
51
59
|
</div>
|
|
52
|
-
<farm-caption
|
|
60
|
+
<farm-caption
|
|
61
|
+
v-if="!hideDetails && showErrorText"
|
|
62
|
+
color="error"
|
|
63
|
+
variation="regular"
|
|
64
|
+
>
|
|
53
65
|
{{ errorBucket[0] }}
|
|
54
66
|
</farm-caption>
|
|
55
67
|
<farm-caption
|
|
@@ -67,7 +79,7 @@
|
|
|
67
79
|
</template>
|
|
68
80
|
|
|
69
81
|
<script lang="ts">
|
|
70
|
-
import {
|
|
82
|
+
import { computed, onBeforeMount, PropType, ref, toRefs, watch } from 'vue';
|
|
71
83
|
|
|
72
84
|
import deepEqual from '../../composition/deepEqual';
|
|
73
85
|
import validateFormFieldBuilder from '../../composition/validateFormFieldBuilder';
|
|
@@ -178,7 +190,6 @@ export default {
|
|
|
178
190
|
const isBlured = ref(false);
|
|
179
191
|
const isFocus = ref(false);
|
|
180
192
|
const isUppercase = ref(props.uppercase);
|
|
181
|
-
|
|
182
193
|
const { errorBucket, valid, validatable } = validateFormStateBuilder();
|
|
183
194
|
|
|
184
195
|
let fieldValidator = validateFormFieldBuilder(rules.value);
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
.farm-tooltip {
|
|
5
5
|
display: inline-block;
|
|
6
6
|
position: relative;
|
|
7
|
+
|
|
8
|
+
&__activator {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
}
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
.farm-tooltip__popup {
|
|
@@ -13,7 +17,6 @@
|
|
|
13
17
|
background-color: rgba(themeColor($color), 0.95);
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
|
-
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
.farm-tooltip__popup {
|
|
@@ -35,4 +38,4 @@
|
|
|
35
38
|
opacity: 1;
|
|
36
39
|
visibility: visible;
|
|
37
40
|
}
|
|
38
|
-
}
|
|
41
|
+
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<span
|
|
3
|
+
:class="{ 'farm-tooltip': true }"
|
|
4
|
+
ref="parent"
|
|
5
|
+
>
|
|
6
|
+
<span
|
|
7
|
+
class="farm-tooltip__activator"
|
|
8
|
+
ref="activator"
|
|
9
|
+
@mouseover="onOver"
|
|
10
|
+
@mouseout="onOut"
|
|
11
|
+
>
|
|
12
|
+
<slot name="activator" />
|
|
5
13
|
</span>
|
|
6
14
|
|
|
7
15
|
<span
|
|
@@ -15,7 +23,7 @@
|
|
|
15
23
|
:style="styles"
|
|
16
24
|
@mouseout="onOut"
|
|
17
25
|
>
|
|
18
|
-
<slot
|
|
26
|
+
<slot />
|
|
19
27
|
</span>
|
|
20
28
|
</span>
|
|
21
29
|
</template>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// import { withDesign } from 'storybook-addon-designs';
|
|
2
|
-
import { VDataTable } from 'vuetify/
|
|
2
|
+
import { VDataTable } from 'vuetify/components/VDataTable';
|
|
3
3
|
|
|
4
4
|
const headers = [
|
|
5
5
|
{
|
|
6
6
|
title: 'ID',
|
|
7
7
|
sortable: false,
|
|
8
|
-
|
|
8
|
+
key: 'id',
|
|
9
9
|
width: 80,
|
|
10
|
-
align: '
|
|
10
|
+
align: 'center',
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
title: 'Name',
|
|
14
14
|
sortable: false,
|
|
15
|
-
|
|
15
|
+
key: 'name',
|
|
16
16
|
width: 160,
|
|
17
|
-
align: '
|
|
17
|
+
align: 'end',
|
|
18
18
|
},
|
|
19
19
|
];
|
|
20
20
|
|
|
@@ -57,7 +57,7 @@ export const TableNoData = () => ({
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
export const TableSampleData = () => ({
|
|
60
|
-
|
|
60
|
+
components: { 'v-data-table': VDataTable },
|
|
61
61
|
data() {
|
|
62
62
|
return {
|
|
63
63
|
headers,
|
|
@@ -173,6 +173,7 @@ export const TableSampleDataWithFarmCheckbox = () => ({
|
|
|
173
173
|
},
|
|
174
174
|
methods: {
|
|
175
175
|
onSelect({ item }) {
|
|
176
|
+
console.log(item);
|
|
176
177
|
if (item.id === 2)
|
|
177
178
|
this.selectedItems = [...this.selectedItems].filter(
|
|
178
179
|
innerItem => innerItem.id !== 2
|
|
@@ -181,20 +182,31 @@ export const TableSampleDataWithFarmCheckbox = () => ({
|
|
|
181
182
|
isItemSelected(item) {
|
|
182
183
|
return this.selectedItems.some(innerItem => innerItem.id === item.id);
|
|
183
184
|
},
|
|
185
|
+
select(item) {
|
|
186
|
+
if (this.selectedItems.some(innerItem => innerItem.id === item.id)) {
|
|
187
|
+
this.selectedItems = this.selectedItems.filter(
|
|
188
|
+
innerItem => innerItem.id !== item.id
|
|
189
|
+
);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.selectedItems.push(item);
|
|
193
|
+
},
|
|
184
194
|
},
|
|
185
195
|
template: `<div>{{selectedItems}}
|
|
186
196
|
<v-data-table
|
|
187
|
-
|
|
197
|
+
show-select
|
|
188
198
|
id="v-data-table--default"
|
|
189
199
|
v-model="selectedItems"
|
|
190
|
-
|
|
200
|
+
|
|
191
201
|
:headers="headers"
|
|
192
202
|
:items="items"
|
|
193
203
|
@item-selected="onSelect"
|
|
194
204
|
>
|
|
195
|
-
<template v-slot:item.data-table-select="{ isSelected,
|
|
196
|
-
<farm-checkbox :value="item.id" :checked="isItemSelected(item)" @
|
|
205
|
+
<template v-slot:item.data-table-select="{ isSelected, item }">
|
|
206
|
+
<farm-checkbox :value="item.id" :checked="isItemSelected(item)" @click="select(item)"/>
|
|
207
|
+
</template>
|
|
208
|
+
<template v-slot:bottom>
|
|
197
209
|
</template>
|
|
198
210
|
</v-data-table>
|
|
199
211
|
</div>`,
|
|
200
|
-
});
|
|
212
|
+
});
|
package/src/main.ts
CHANGED
|
@@ -78,6 +78,7 @@ export * from './components/Switcher';
|
|
|
78
78
|
export * from './components/Tabs';
|
|
79
79
|
export * from './components/TextArea';
|
|
80
80
|
export * from './components/TextFieldV2';
|
|
81
|
+
export * from './components/InputMoney';
|
|
81
82
|
export * from './components/Tooltip';
|
|
82
83
|
export * from './components/Typography';
|
|
83
84
|
export * from './components/ValueCaption';
|