@farm-investimentos/front-mfe-components 15.2.2 → 15.3.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 +2863 -1623
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +2 -2
- package/dist/front-mfe-components.umd.js +2863 -1623
- 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 +5 -2
- package/src/components/AlertBox/AlertBox.vue +2 -2
- package/src/components/AlertReload/AlertReload.vue +2 -2
- package/src/components/ButtonToggle/ButtonToggle.vue +3 -2
- package/src/components/ButtonToggle/__tests__/ButtonToggle.spec.js +17 -0
- package/src/components/Buttons/ConfirmButton/ConfirmButton.vue +2 -2
- package/src/components/Buttons/DangerButton/DangerButton.vue +2 -2
- package/src/components/Buttons/DefaultButton/DefaultButton.vue +2 -2
- package/src/components/Buttons/ExportButton/ExportButton.vue +2 -2
- package/src/components/Buttons/ImportButton/ImportButton.vue +2 -2
- package/src/components/Buttons/MultiImportButton/MultiImportButton.vue +2 -2
- package/src/components/Buttons/RemoveButton/RemoveButton.vue +3 -3
- package/src/components/Buttons/ToggleButton/ToggleButton.vue +2 -2
- package/src/components/Card/Card.vue +2 -2
- package/src/components/Card/CardContent/CardContent.vue +2 -2
- package/src/components/Checkbox/Checkbox.vue +18 -4
- package/src/components/Chip/Chip.vue +2 -2
- package/src/components/ChipInviteStatus/ChipInviteStatus.vue +2 -2
- package/src/components/Collapsible/Collapsible.vue +2 -2
- package/src/components/ContextMenu/ContextMenu.vue +2 -2
- package/src/components/CopyToClipboard/CopyToClipboard.vue +2 -2
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.vue +2 -2
- package/src/components/DataTableHeader/DataTableHeader.vue +2 -2
- package/src/components/DataTablePaginator/DataTablePaginator.vue +2 -2
- package/src/components/DatePicker/DatePicker.vue +2 -2
- package/src/components/DialogFooter/DialogFooter.vue +2 -2
- package/src/components/DialogHeader/DialogHeader.vue +2 -2
- package/src/components/Form/Form.vue +2 -2
- package/src/components/Icon/Icon.vue +2 -2
- package/src/components/IconBox/IconBox.vue +2 -2
- package/src/components/IdCaption/IdCaption.vue +2 -2
- package/src/components/Label/Label.vue +2 -2
- package/src/components/List/List.vue +2 -2
- package/src/components/ListItem/ListItem.vue +2 -2
- package/src/components/Loader/Loader.vue +2 -2
- package/src/components/Logger/Logger.vue +2 -2
- package/src/components/Logger/LoggerItem/LoggerItem.vue +2 -2
- package/src/components/Logos/OriginatorLogo/OriginatorLogo.vue +2 -2
- package/src/components/Logos/ProductLogo/ProductLogo.vue +2 -2
- package/src/components/MainFilter/MainFilter.vue +2 -2
- package/src/components/ManagersList/ManagersList.vue +2 -2
- package/src/components/Modal/Modal.vue +11 -2
- package/src/components/ModalPromptUser/ModalPromptUser.vue +2 -2
- package/src/components/MultipleFilePicker/MultipleFilePicker.vue +6 -6
- package/src/components/MultipleSelectShortener/MultipleSelectShortener.vue +2 -2
- package/src/components/ProgressBar/ProgressBar.vue +2 -2
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.vue +2 -2
- package/src/components/Radio/Radio.vue +2 -2
- package/src/components/RadioGroup/RadioGroup.vue +2 -2
- package/src/components/RangeDatePicker/RangeDatePicker.vue +4 -3
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.stories.js +1 -1
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.vue +4 -10
- package/src/components/ResourceMetaInfo/ResourceMetaInfo.stories.js +19 -0
- package/src/components/ResourceMetaInfo/ResourceMetaInfo.vue +49 -9
- package/src/components/ResourceMetaInfo/__tests__/ResourceMetaInfo.spec.js +54 -0
- package/src/components/Select/Select.vue +2 -2
- package/src/components/SelectModalOptions/SelectModalOptions.vue +2 -2
- package/src/components/Stepper/StepperHeader/StepperHeader.vue +2 -2
- package/src/components/Switcher/Switcher.vue +2 -2
- package/src/components/TableContextMenu/TableContextMenu.vue +5 -3
- package/src/components/Tabs/Tabs.vue +3 -2
- package/src/components/TextArea/TextArea.vue +2 -2
- package/src/components/TextFieldV2/TextFieldV2.vue +2 -2
- package/src/components/Tooltip/Tooltip.vue +2 -2
- package/src/components/Typography/BodyText/BodyText.vue +2 -2
- package/src/components/Typography/Caption/Caption.vue +2 -2
- package/src/components/Typography/Heading/Heading.vue +2 -2
- package/src/components/Typography/OverlayText/OverlayText.vue +2 -2
- package/src/components/Typography/Small/Small.vue +2 -2
- package/src/components/Typography/Subtitle/Subtitle.vue +2 -2
- package/src/components/Typography/Typography.vue +2 -2
- package/src/components/ValueCaption/ValueCaption.vue +3 -2
- package/src/components/layout/Box/Box.vue +2 -2
- package/src/components/layout/Col/Col.vue +2 -2
- package/src/components/layout/Container/Container.vue +2 -2
- package/src/components/layout/ContainerFooter/ContainerFooter.vue +2 -2
- package/src/components/layout/Line/Line.vue +2 -2
- package/src/components/layout/Row/Row.vue +2 -2
- package/src/composition/__tests__/validateFormFieldBuilder.spec.js +26 -0
- package/src/composition/validateFormFieldBuilder.ts +2 -3
- package/src/examples/Table.stories.js +43 -16
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
</farm-typography>
|
|
12
12
|
</template>
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
import
|
|
14
|
+
import { defineComponent, computed, ref, watch, toRefs, PropType } from 'vue';
|
|
15
15
|
|
|
16
16
|
import { Keys } from './configurations';
|
|
17
17
|
|
|
18
|
-
export default
|
|
18
|
+
export default defineComponent({
|
|
19
19
|
inheritAttrs: true,
|
|
20
20
|
name: 'farm-bodysmall',
|
|
21
21
|
props: {
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
</farm-typography>
|
|
12
12
|
</template>
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
import
|
|
14
|
+
import { defineComponent, computed, ref, watch, toRefs, PropType } from 'vue';
|
|
15
15
|
|
|
16
16
|
import { Keys } from './configurations';
|
|
17
17
|
|
|
18
|
-
export default
|
|
18
|
+
export default defineComponent({
|
|
19
19
|
inheritAttrs: true,
|
|
20
20
|
name: 'farm-subtitle',
|
|
21
21
|
props: {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
</component>
|
|
19
19
|
</template>
|
|
20
20
|
<script lang="ts">
|
|
21
|
-
import
|
|
21
|
+
import { defineComponent, computed, PropType, ref, toRefs } from 'vue';
|
|
22
22
|
import breakPoints from '../../configurations/sizes';
|
|
23
23
|
import typographyHtmlTags from '../../configurations/typographyHtmlTags';
|
|
24
24
|
|
|
25
|
-
export default
|
|
25
|
+
export default defineComponent({
|
|
26
26
|
inheritAttrs: true,
|
|
27
27
|
name: 'farm-typography',
|
|
28
28
|
props: {
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import
|
|
18
|
-
|
|
17
|
+
import { computed, PropType, defineComponent } from 'vue';
|
|
18
|
+
|
|
19
|
+
export default defineComponent({
|
|
19
20
|
name: 'farm-valuecaption',
|
|
20
21
|
props: {
|
|
21
22
|
/**
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
</component>
|
|
13
13
|
</template>
|
|
14
14
|
<script lang="ts">
|
|
15
|
-
import
|
|
15
|
+
import { defineComponent, PropType } from 'vue';
|
|
16
16
|
|
|
17
|
-
export default
|
|
17
|
+
export default defineComponent({
|
|
18
18
|
name: 'farm-box',
|
|
19
19
|
props: {
|
|
20
20
|
/**
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
</component>
|
|
23
23
|
</template>
|
|
24
24
|
<script lang="ts">
|
|
25
|
-
import
|
|
25
|
+
import { PropType, defineComponent } from 'vue';
|
|
26
26
|
|
|
27
|
-
export default
|
|
27
|
+
export default defineComponent({
|
|
28
28
|
name: 'farm-col',
|
|
29
29
|
props: {
|
|
30
30
|
/**
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
</component>
|
|
16
16
|
</template>
|
|
17
17
|
<script lang="ts">
|
|
18
|
-
import
|
|
18
|
+
import { PropType, defineComponent } from 'vue';
|
|
19
19
|
|
|
20
|
-
export default
|
|
20
|
+
export default defineComponent({
|
|
21
21
|
name: 'farm-row',
|
|
22
22
|
props: {
|
|
23
23
|
/**
|
|
@@ -5,4 +5,30 @@ describe('validateFormFieldBuilder', () => {
|
|
|
5
5
|
const r = validateFormFieldBuilder();
|
|
6
6
|
expect(typeof r).toEqual('function');
|
|
7
7
|
});
|
|
8
|
+
|
|
9
|
+
it('Should run validations', () => {
|
|
10
|
+
const rules = [() => true, () => true];
|
|
11
|
+
const r = validateFormFieldBuilder(rules)(1);
|
|
12
|
+
expect(r.length).toEqual(0);
|
|
13
|
+
expect(r instanceof Array).toBeTruthy();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('Should run validations and have some error', () => {
|
|
17
|
+
const rules = [() => true, () => false, () => false];
|
|
18
|
+
const r = validateFormFieldBuilder(rules)(1);
|
|
19
|
+
expect(r.length).toEqual(2);
|
|
20
|
+
expect(r instanceof Array).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('Should run validations and have some error', () => {
|
|
24
|
+
const rules = [() => true, () => false, () => false];
|
|
25
|
+
const r = validateFormFieldBuilder(rules)(1);
|
|
26
|
+
expect(r.length).toEqual(2);
|
|
27
|
+
expect(r instanceof Array).toBeTruthy();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('Should throw error', () => {
|
|
31
|
+
const rules = [() => 123];
|
|
32
|
+
expect(() => validateFormFieldBuilder(rules)(1)).toThrowError();
|
|
33
|
+
});
|
|
8
34
|
});
|
|
@@ -8,9 +8,8 @@ export default function (rules) {
|
|
|
8
8
|
if (valid === false || typeof valid === 'string') {
|
|
9
9
|
innerErrorBucket.push(valid || '');
|
|
10
10
|
} else if (typeof valid !== 'boolean') {
|
|
11
|
-
|
|
12
|
-
`Rules should return a string or boolean, received '${typeof valid}' instead
|
|
13
|
-
this
|
|
11
|
+
throw new Error(
|
|
12
|
+
`Rules should return a string or boolean, received '${typeof valid}' instead`
|
|
14
13
|
);
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -83,6 +83,7 @@ export const TableSampleData = () => ({
|
|
|
83
83
|
</v-data-table>
|
|
84
84
|
</div>`,
|
|
85
85
|
});
|
|
86
|
+
|
|
86
87
|
export const TableSampleDataWithCheckbox = () => ({
|
|
87
88
|
components: { 'v-data-table': VDataTable },
|
|
88
89
|
data() {
|
|
@@ -93,6 +94,7 @@ export const TableSampleDataWithCheckbox = () => ({
|
|
|
93
94
|
{ id: 2, name: 'name 2' },
|
|
94
95
|
{ id: 3, name: 'name 3' },
|
|
95
96
|
],
|
|
97
|
+
selectedItems: [],
|
|
96
98
|
};
|
|
97
99
|
},
|
|
98
100
|
template: `<div>
|
|
@@ -102,8 +104,8 @@ export const TableSampleDataWithCheckbox = () => ({
|
|
|
102
104
|
:headers="headers"
|
|
103
105
|
:items="items"
|
|
104
106
|
show-select
|
|
107
|
+
v-model="selectedItems"
|
|
105
108
|
>
|
|
106
|
-
|
|
107
109
|
</v-data-table>
|
|
108
110
|
</div>`,
|
|
109
111
|
});
|
|
@@ -161,18 +163,43 @@ export const TableSampleLocalPagination = () => ({
|
|
|
161
163
|
</div>`,
|
|
162
164
|
});
|
|
163
165
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
166
|
+
export const TableSampleDataWithFarmCheckbox = () => ({
|
|
167
|
+
components: { 'v-data-table': VDataTable },
|
|
168
|
+
data() {
|
|
169
|
+
return {
|
|
170
|
+
headers,
|
|
171
|
+
items: [
|
|
172
|
+
{ id: 1, name: 'name 1' },
|
|
173
|
+
{ id: 2, name: 'name 2' },
|
|
174
|
+
{ id: 3, name: 'name 3' },
|
|
175
|
+
],
|
|
176
|
+
selectedItems: [],
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
methods: {
|
|
180
|
+
onSelect({ item }) {
|
|
181
|
+
if (item.id === 2)
|
|
182
|
+
this.selectedItems = [...this.selectedItems].filter(
|
|
183
|
+
innerItem => innerItem.id !== 2
|
|
184
|
+
);
|
|
185
|
+
},
|
|
186
|
+
isItemSelected(item) {
|
|
187
|
+
return this.selectedItems.some(innerItem => innerItem.id === item.id);
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
template: `<div>{{selectedItems}}
|
|
191
|
+
<v-data-table
|
|
192
|
+
hide-default-footer
|
|
193
|
+
id="v-data-table--default"
|
|
194
|
+
v-model="selectedItems"
|
|
195
|
+
show-select
|
|
196
|
+
:headers="headers"
|
|
197
|
+
:items="items"
|
|
198
|
+
@item-selected="onSelect"
|
|
199
|
+
>
|
|
200
|
+
<template v-slot:item.data-table-select="{ isSelected, select, item }">
|
|
201
|
+
<farm-checkbox :value="item.id" :checked="isItemSelected(item)" @input="select($event)"/>
|
|
202
|
+
</template>
|
|
203
|
+
</v-data-table>
|
|
204
|
+
</div>`,
|
|
205
|
+
});
|