@farm-investimentos/front-mfe-components-vue3 0.0.4 → 0.0.6
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 +4275 -5619
- 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 +4275 -5619
- 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 +89 -89
- package/src/components/AlertBox/AlertBox.stories.js +0 -3
- package/src/components/AlertReload/AlertReload.stories.js +0 -7
- package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +0 -4
- package/src/components/Buttons/DangerButton/DangerButton.stories.js +0 -3
- package/src/components/Checkbox/Checkbox.stories.js +1 -1
- package/src/components/Collapsible/Collapsible.stories.js +1 -1
- package/src/components/ContextMenu/ContextMenu.stories.js +1 -1
- package/src/components/DatePicker/DatePicker.stories.js +1 -1
- package/src/components/Form/Form.stories.js +117 -159
- package/src/components/Form/Form.vue +13 -21
- package/src/components/IconBox/IconBox.stories.js +1 -1
- package/src/components/Logger/Logger.vue +3 -2
- package/src/components/ManagersList/ManagersList.stories.js +1 -1
- package/src/components/MultipleSelectShortener/MultipleSelectShortener.stories.js +1 -1
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +1 -1
- package/src/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/src/components/RangeDatePicker/RangeDatePicker.stories.js +1 -1
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.stories.js +1 -1
- package/src/components/SelectModalOptions/SelectModalOptions.scss +1 -1
- package/src/components/SelectModalOptions/SelectModalOptions.stories.js +0 -3
- package/src/components/SelectModalOptions/SelectModalOptions.vue +1 -3
- package/src/components/Switcher/Switcher.stories.js +1 -1
- package/src/components/TableContextMenu/TableContextMenu.stories.js +1 -1
- package/src/components/TextFieldV2/TextFieldV2.vue +1 -1
- package/src/components/Tooltip/Tooltip.stories.js +1 -3
- package/src/components/Typography/BodyText/BodyText.stories.js +0 -3
- package/src/components/Typography/Caption/Caption.stories.js +1 -1
- package/src/components/Typography/Heading/Heading.stories.js +1 -1
- package/src/components/Typography/Small/Small.stories.js +0 -3
- package/src/components/Typography/Subtitle/Subtitle.stories.js +1 -1
- package/src/components/Typography/Typography.stories.js +1 -1
- package/src/components/ValueCaption/ValueCaption.stories.js +1 -1
- package/src/examples/Dialog.stories.js +1 -32
- package/src/examples/Table.stories.js +2 -2
- package/src/helpers/walk.ts +19 -0
- package/src/scss/Sticky-table.scss +3 -3
- package/src/scss/utils.scss +1 -1
package/package.json
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
2
|
+
"name": "@farm-investimentos/front-mfe-components-vue3",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"private": false,
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git://github.com/Farm-Investimentos/front-mfe-components-vue3.git"
|
|
8
|
+
},
|
|
9
|
+
"author": "farm investimentos",
|
|
10
|
+
"main": "./dist/front-mfe-components.common.js",
|
|
11
|
+
"jsdelivr": "dist/front-mfe-components.umd.min.js",
|
|
12
|
+
"unpkg": "dist/front-mfe-components.umd.min.js",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/*",
|
|
15
|
+
"src/*"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "npm run build:components",
|
|
19
|
+
"build-storybook": "storybook build",
|
|
20
|
+
"build:components": "vue-cli-service build --target lib --name front-mfe-components src/main.ts",
|
|
21
|
+
"lint": "vue-cli-service lint --fix",
|
|
22
|
+
"serve": "vue-cli-service serve",
|
|
23
|
+
"storybook": "storybook dev -p 6006",
|
|
24
|
+
"test:coverage": "jest --updateSnapshot --coverage",
|
|
25
|
+
"test:unit": "jest --updateSnapshot"
|
|
26
|
+
},
|
|
27
|
+
"browserslist": [
|
|
28
|
+
"> 1%",
|
|
29
|
+
"last 2 versions",
|
|
30
|
+
"not dead"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@farm-investimentos/front-mfe-libs-ts": "^2.5.0",
|
|
34
|
+
"@vuepic/vue-datepicker": "^7.2.0",
|
|
35
|
+
"core-js": "^3.6.5",
|
|
36
|
+
"text-mask-addons": "^3.8.0",
|
|
37
|
+
"v-mask": "^2.3.0",
|
|
38
|
+
"vue": "3.3.4",
|
|
39
|
+
"vuetify": "^3.3.22",
|
|
40
|
+
"webpack": "^4.39.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/core": "7.17.9",
|
|
44
|
+
"@babel/generator": "7.17.9",
|
|
45
|
+
"@storybook/addon-essentials": "^7.5.0",
|
|
46
|
+
"@storybook/addon-interactions": "^7.5.0",
|
|
47
|
+
"@storybook/addon-links": "^7.5.0",
|
|
48
|
+
"@storybook/blocks": "^7.5.0",
|
|
49
|
+
"@storybook/testing-library": "^0.2.2",
|
|
50
|
+
"@storybook/vue3": "^7.5.0",
|
|
51
|
+
"@storybook/vue3-vite": "^7.5.0",
|
|
52
|
+
"@tsconfig/node18": "^18.2.2",
|
|
53
|
+
"@types/jest": "^29.0.0",
|
|
54
|
+
"@types/node": "^18.17.17",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
|
56
|
+
"@typescript-eslint/parser": "^4.18.0",
|
|
57
|
+
"@vitejs/plugin-vue": "^4.3.4",
|
|
58
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
|
59
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
60
|
+
"@vue/cli-plugin-typescript": "~4.5.0",
|
|
61
|
+
"@vue/cli-plugin-unit-jest": "^4.5.12",
|
|
62
|
+
"@vue/cli-service": "^4.5.13",
|
|
63
|
+
"@vue/compiler-sfc": "^3.0.0",
|
|
64
|
+
"@vue/eslint-config-typescript": "^7.0.0",
|
|
65
|
+
"@vue/test-utils": "^2.3.2",
|
|
66
|
+
"@vue/tsconfig": "^0.4.0",
|
|
67
|
+
"@vue/vue3-jest": "^29.2.3",
|
|
68
|
+
"babel-eslint": "^10.1.0",
|
|
69
|
+
"babel-jest": "^29.5.0",
|
|
70
|
+
"babel-loader": "^8.3.0",
|
|
71
|
+
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
|
|
72
|
+
"eslint": "^6.7.2",
|
|
73
|
+
"eslint-plugin-vue": "^7.1.0",
|
|
74
|
+
"npm-run-all2": "^6.0.6",
|
|
75
|
+
"react": "^18.2.0",
|
|
76
|
+
"react-dom": "^18.2.0",
|
|
77
|
+
"sass": "~1.32.0",
|
|
78
|
+
"sass-loader": "^10.0.0",
|
|
79
|
+
"storybook": "^7.5.0",
|
|
80
|
+
"typescript": "~4.1.5",
|
|
81
|
+
"vite": "^4.4.9",
|
|
82
|
+
"vue-loader": "^16.8.3",
|
|
83
|
+
"vue-tsc": "^1.8.11"
|
|
84
|
+
},
|
|
85
|
+
"engines": {
|
|
86
|
+
"node": ">=18.0.0 <20.0.0"
|
|
87
|
+
},
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"@farm-investimentos:registry": "https://registry.npmjs.org"
|
|
90
|
+
}
|
|
91
91
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import AlertBox from './AlertBox.vue';
|
|
2
1
|
import baseThemeColors from '../../configurations/_theme-colors-base.module.scss';
|
|
3
2
|
const colors = Object.keys(baseThemeColors);
|
|
4
3
|
|
|
5
|
-
|
|
6
4
|
export default {
|
|
7
5
|
title: 'Feedback/AlertBox',
|
|
8
|
-
component: AlertBox,
|
|
9
6
|
parameters: {
|
|
10
7
|
docs: {
|
|
11
8
|
description: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// import { withDesign } from 'storybook-addon-designs';
|
|
2
|
-
import AlertReload from './AlertReload';
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
title: 'Feedback/AlertReload',
|
|
@@ -16,18 +15,12 @@ export default {
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
export const Primary = () => ({
|
|
19
|
-
components: {
|
|
20
|
-
'farm-alert-reload': AlertReload,
|
|
21
|
-
},
|
|
22
18
|
template: `<div style="width: 480px;">
|
|
23
19
|
<farm-alert-reload label="Text" />
|
|
24
20
|
</div>`,
|
|
25
21
|
});
|
|
26
22
|
|
|
27
23
|
export const Vertical = () => ({
|
|
28
|
-
components: {
|
|
29
|
-
'farm-alert-reload': AlertReload,
|
|
30
|
-
},
|
|
31
24
|
template: `<div style="width: 480px;">
|
|
32
25
|
<farm-alert-reload label="Text" vertical />
|
|
33
26
|
</div>`,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import ConfirmButton from './ConfirmButton.vue';
|
|
2
|
-
|
|
3
1
|
export default {
|
|
4
2
|
title: 'Buttons/Confirm',
|
|
5
|
-
component: ConfirmButton,
|
|
6
3
|
parameters: {
|
|
7
4
|
docs: {
|
|
8
5
|
description: {
|
|
@@ -40,7 +37,6 @@ export const Listener = () => ({
|
|
|
40
37
|
});
|
|
41
38
|
|
|
42
39
|
export const Iconed = () => ({
|
|
43
|
-
components: { ConfirmButton },
|
|
44
40
|
template: `<div>
|
|
45
41
|
<ConfirmButton :icon="true">default icon</ConfirmButton>
|
|
46
42
|
<ConfirmButton :icon="true" customIcon="information-outline">information-outline</ConfirmButton>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Form from './Form.vue';
|
|
2
|
+
import { getCurrentInstance, ref } from 'vue';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Form/Form',
|
|
@@ -16,16 +17,6 @@ export default {
|
|
|
16
17
|
},
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
const styles = {
|
|
20
|
-
vForm: {
|
|
21
|
-
maxWidth: '480px',
|
|
22
|
-
},
|
|
23
|
-
footer: {
|
|
24
|
-
display: 'flex',
|
|
25
|
-
justifyContent: 'end',
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
20
|
export const Primary = () => ({
|
|
30
21
|
data() {
|
|
31
22
|
return {
|
|
@@ -33,7 +24,7 @@ export const Primary = () => ({
|
|
|
33
24
|
document: 'Document',
|
|
34
25
|
name: '',
|
|
35
26
|
checkbox: '2',
|
|
36
|
-
birthDate:
|
|
27
|
+
birthDate: '1980-09-20',
|
|
37
28
|
selectId: 1,
|
|
38
29
|
rangeDate: [],
|
|
39
30
|
cityName: null,
|
|
@@ -48,49 +39,137 @@ export const Primary = () => ({
|
|
|
48
39
|
{ value: 1, text: 'label 1' },
|
|
49
40
|
{ value: 2, text: 'label 2' },
|
|
50
41
|
],
|
|
51
|
-
styles,
|
|
52
42
|
};
|
|
53
43
|
},
|
|
54
44
|
template: `
|
|
55
|
-
|
|
45
|
+
<farm-row>
|
|
46
|
+
<farm-col md="3">
|
|
47
|
+
<farm-form v-model="validForm" ref="form" autocomplete="off">
|
|
48
|
+
<div>
|
|
49
|
+
<farm-label :required="true">Documento</farm-label>
|
|
50
|
+
<farm-textfield-v2 v-model="form.document" :rules="[rules.required]" />
|
|
51
|
+
</div>
|
|
52
|
+
<farm-label :required="true">Nome</farm-label>
|
|
53
|
+
<farm-textfield-v2 v-model="form.name" :rules="[rules.required]" hint="Seu nome igual ao do RG" />
|
|
54
|
+
|
|
55
|
+
<farm-label :required="true">True/false</farm-label>
|
|
56
|
+
<farm-checkbox v-model="form.checkbox" value="1" :rules="[rules.checked]" />
|
|
57
|
+
|
|
58
|
+
<farm-label :required="true">Select</farm-label>
|
|
59
|
+
<farm-select :rules="[rules.required]" :items="items" v-model="form.selectId"/>
|
|
60
|
+
|
|
61
|
+
<farm-label :required="true">Birthdate:</farm-label>
|
|
62
|
+
<farm-input-datepicker
|
|
63
|
+
ref="birthDate"
|
|
64
|
+
inputId="form-pf-birthDate"
|
|
65
|
+
v-model="form.birthDate"
|
|
66
|
+
:readonly="true"
|
|
67
|
+
:required="true"
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<farm-label :required="true">Range date:</farm-label>
|
|
71
|
+
<farm-input-rangedatepicker
|
|
72
|
+
ref="rangeDate"
|
|
73
|
+
inputId="form-pf-rangeDate"
|
|
74
|
+
v-model="form.rangeDate"
|
|
75
|
+
:required="true"
|
|
76
|
+
/>
|
|
77
|
+
<div class="footer">
|
|
78
|
+
<farm-btn outlined @click="$refs.form.reset()" class="mr-3">Reset</farm-btn>
|
|
79
|
+
<farm-btn :disabled="!validForm">Salvar</farm-btn>
|
|
80
|
+
</div>
|
|
81
|
+
form: {{ form }}
|
|
82
|
+
</farm-form>
|
|
83
|
+
</farm-col>
|
|
84
|
+
</farm-row>`,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const CompositionAPI = () => ({
|
|
88
|
+
setup() {
|
|
89
|
+
const formValues = ref({ name: '' });
|
|
90
|
+
const validForm = ref(false);
|
|
91
|
+
const formEl = (ref < HTMLDivElement) | (null > null);
|
|
92
|
+
|
|
93
|
+
const rules = { required: value => !!value || 'Campo obrigatório' };
|
|
94
|
+
|
|
95
|
+
const internalInstance = getCurrentInstance().proxy;
|
|
96
|
+
|
|
97
|
+
const onReset = () => {
|
|
98
|
+
internalInstance.formEl.reset();
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
formEl,
|
|
103
|
+
formValues,
|
|
104
|
+
validForm,
|
|
105
|
+
rules,
|
|
106
|
+
onReset,
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
template: `<div>
|
|
110
|
+
<farm-form v-model="validForm" ref="formEl" autocomplete="off">
|
|
111
|
+
<farm-box>
|
|
112
|
+
<farm-row>
|
|
113
|
+
<farm-col md="4">
|
|
114
|
+
<farm-label :required="true">Documento</farm-label>
|
|
115
|
+
<farm-textfield-v2 v-model="formValues.name" :rules=[rules.required] />
|
|
116
|
+
</farm-col>
|
|
117
|
+
</farm-row>
|
|
118
|
+
</farm-box>
|
|
119
|
+
</farm-form>
|
|
120
|
+
<farm-btn outlined @click="onReset" class="mr-3">Reset</farm-btn>
|
|
121
|
+
form: {{ formValues }} {{ validForm }}
|
|
122
|
+
</div>
|
|
123
|
+
`,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export const RestartValidation = () => ({
|
|
127
|
+
data() {
|
|
128
|
+
return {
|
|
129
|
+
form: {
|
|
130
|
+
document: null,
|
|
131
|
+
name: null,
|
|
132
|
+
checkbox: null,
|
|
133
|
+
birthDate: '',
|
|
134
|
+
selectId: null,
|
|
135
|
+
rangeDate: [],
|
|
136
|
+
},
|
|
137
|
+
validForm: true,
|
|
138
|
+
rules: {
|
|
139
|
+
required: value => !!value || 'Campo obrigatório',
|
|
140
|
+
checked: value => !!value || 'Deve estar marcado',
|
|
141
|
+
},
|
|
142
|
+
items: [
|
|
143
|
+
{ value: null, text: '' },
|
|
144
|
+
{ value: 1, text: 'label 1' },
|
|
145
|
+
{ value: 2, text: 'label 2' },
|
|
146
|
+
],
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
template: `
|
|
150
|
+
<farm-form v-model="validForm" ref="form">
|
|
151
|
+
Is valid form: {{ validForm }}
|
|
152
|
+
|
|
153
|
+
<farm-label :required="true">Nome</farm-label>
|
|
154
|
+
<farm-textfield-v2 v-model="form.name" :rules="[rules.required]" />
|
|
155
|
+
|
|
56
156
|
<div>
|
|
57
157
|
<farm-label :required="true">Documento</farm-label>
|
|
58
158
|
<farm-textfield-v2 v-model="form.document" :rules="[rules.required]" />
|
|
59
159
|
</div>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
160
|
+
|
|
161
|
+
|
|
63
162
|
<farm-label :required="true">True/false</farm-label>
|
|
64
163
|
<farm-checkbox v-model="form.checkbox" value="1" :rules="[rules.checked]" />
|
|
65
164
|
|
|
66
165
|
<farm-label :required="true">Select</farm-label>
|
|
67
166
|
<farm-select :rules="[rules.required]" :items="items" v-model="form.selectId"/>
|
|
68
|
-
|
|
69
|
-
<farm-label :required="true">Birthdate:</farm-label>
|
|
70
|
-
<farm-input-datepicker
|
|
71
|
-
ref="birthDate"
|
|
72
|
-
inputId="form-pf-birthDate"
|
|
73
|
-
class="mt-4"
|
|
74
|
-
v-model="form.birthDate"
|
|
75
|
-
:readonly="true"
|
|
76
|
-
:required="true"
|
|
77
|
-
/>
|
|
78
|
-
|
|
79
|
-
<farm-label :required="true">Range date:</farm-label>
|
|
80
|
-
<farm-input-rangedatepicker
|
|
81
|
-
ref="rangeDate"
|
|
82
|
-
inputId="form-pf-rangeDate"
|
|
83
|
-
class="mt-4"
|
|
84
|
-
v-model="form.rangeDate"
|
|
85
|
-
:required="true"
|
|
86
|
-
/>
|
|
87
167
|
|
|
88
|
-
|
|
89
|
-
|
|
168
|
+
<div class="footer">
|
|
169
|
+
<farm-btn outlined @click="$refs.form.restartValidation()" class="mr-3">Restart Validation</farm-btn>
|
|
90
170
|
<farm-btn outlined @click="$refs.form.reset()" class="mr-3">Reset</farm-btn>
|
|
91
171
|
<farm-btn :disabled="!validForm">Salvar</farm-btn>
|
|
92
172
|
</div>
|
|
93
|
-
form: {{ form }}
|
|
94
173
|
</farm-form>
|
|
95
174
|
`,
|
|
96
175
|
});
|
|
@@ -238,77 +317,6 @@ export const Grid = () => ({
|
|
|
238
317
|
`,
|
|
239
318
|
});
|
|
240
319
|
|
|
241
|
-
export const MigrateTextVieldV2 = () => ({
|
|
242
|
-
data() {
|
|
243
|
-
return {
|
|
244
|
-
form: {
|
|
245
|
-
document: 'Document',
|
|
246
|
-
name: 'Name',
|
|
247
|
-
},
|
|
248
|
-
validForm: false,
|
|
249
|
-
rules: {
|
|
250
|
-
required: value => !!value || 'Campo obrigatório',
|
|
251
|
-
},
|
|
252
|
-
items: [
|
|
253
|
-
{ value: null, text: '' },
|
|
254
|
-
{ value: 1, text: 'label 1' },
|
|
255
|
-
{ value: 2, text: 'label 2' },
|
|
256
|
-
],
|
|
257
|
-
styles,
|
|
258
|
-
};
|
|
259
|
-
},
|
|
260
|
-
template: `
|
|
261
|
-
<farm-form v-model="validForm" :style="[styles.vForm]" ref="form">
|
|
262
|
-
<div>
|
|
263
|
-
<farm-label :required="true">Documento</farm-label>
|
|
264
|
-
<farm-textfield-v2 v-model="form.document" :rules="[rules.required]" />
|
|
265
|
-
</div>
|
|
266
|
-
<farm-label :required="true">Nome</farm-label>
|
|
267
|
-
<farm-textfield-v2 v-model="form.name" :rules="[rules.required]" />
|
|
268
|
-
|
|
269
|
-
<div class="footer" :style="[styles.footer]">
|
|
270
|
-
<farm-btn outlined @click="$refs.form.reset()" class="mr-3">Reset</farm-btn>
|
|
271
|
-
<farm-btn :disabled="!validForm">Salvar</farm-btn>
|
|
272
|
-
</div>
|
|
273
|
-
form: {{ form }}
|
|
274
|
-
</farm-form>
|
|
275
|
-
`,
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
export const MigrateSelectV2 = () => ({
|
|
279
|
-
data() {
|
|
280
|
-
return {
|
|
281
|
-
form: {
|
|
282
|
-
document: '',
|
|
283
|
-
},
|
|
284
|
-
validForm: false,
|
|
285
|
-
rules: {
|
|
286
|
-
required: value => !!value || 'Campo obrigatório',
|
|
287
|
-
},
|
|
288
|
-
items: [
|
|
289
|
-
{ value: null, text: '' },
|
|
290
|
-
{ value: 1, text: 'label 1' },
|
|
291
|
-
{ value: 2, text: 'label 2' },
|
|
292
|
-
],
|
|
293
|
-
styles,
|
|
294
|
-
};
|
|
295
|
-
},
|
|
296
|
-
template: `
|
|
297
|
-
<farm-form v-model="validForm" :style="[styles.vForm]" ref="form">
|
|
298
|
-
<div>
|
|
299
|
-
<farm-label :required="true">Documento</farm-label>
|
|
300
|
-
<farm-select v-model="form.document" :items="items" :rules="[rules.required]" />
|
|
301
|
-
</div>
|
|
302
|
-
|
|
303
|
-
<div class="footer" :style="[styles.footer]">
|
|
304
|
-
<farm-btn outlined @click="$refs.form.reset()" class="mr-3">Reset</farm-btn>
|
|
305
|
-
<farm-btn :disabled="!validForm">Salvar</farm-btn>
|
|
306
|
-
</div>
|
|
307
|
-
form: {{ form }}
|
|
308
|
-
</farm-form>
|
|
309
|
-
`,
|
|
310
|
-
});
|
|
311
|
-
|
|
312
320
|
export const ValidateRadioGroup = () => ({
|
|
313
321
|
data() {
|
|
314
322
|
return {
|
|
@@ -336,55 +344,5 @@ export const ValidateRadioGroup = () => ({
|
|
|
336
344
|
`,
|
|
337
345
|
});
|
|
338
346
|
|
|
339
|
-
export const RestartValidation = () => ({
|
|
340
|
-
data() {
|
|
341
|
-
return {
|
|
342
|
-
form: {
|
|
343
|
-
document: null,
|
|
344
|
-
name: null,
|
|
345
|
-
checkbox: null,
|
|
346
|
-
birthDate: '',
|
|
347
|
-
selectId: null,
|
|
348
|
-
rangeDate: [],
|
|
349
|
-
},
|
|
350
|
-
validForm: true,
|
|
351
|
-
rules: {
|
|
352
|
-
required: value => !!value || 'Campo obrigatório',
|
|
353
|
-
checked: value => !!value || 'Deve estar marcado',
|
|
354
|
-
},
|
|
355
|
-
items: [
|
|
356
|
-
{ value: null, text: '' },
|
|
357
|
-
{ value: 1, text: 'label 1' },
|
|
358
|
-
{ value: 2, text: 'label 2' },
|
|
359
|
-
],
|
|
360
|
-
styles,
|
|
361
|
-
};
|
|
362
|
-
},
|
|
363
|
-
template: `
|
|
364
|
-
<farm-form v-model="validForm" :style="[styles.vForm]" ref="form">
|
|
365
|
-
Is valid form: {{ validForm }}
|
|
366
347
|
|
|
367
|
-
<farm-label :required="true">Nome</farm-label>
|
|
368
|
-
<farm-textfield-v2 v-model="form.name" :rules="[rules.required]" />
|
|
369
|
-
|
|
370
|
-
<div>
|
|
371
|
-
<farm-label :required="true">Documento</farm-label>
|
|
372
|
-
<farm-textfield-v2 v-model="form.document" :rules="[rules.required]" />
|
|
373
|
-
</div>
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
<farm-label :required="true">True/false</farm-label>
|
|
377
|
-
<farm-checkbox v-model="form.checkbox" value="1" :rules="[rules.checked]" />
|
|
378
|
-
|
|
379
|
-
<farm-label :required="true">Select</farm-label>
|
|
380
|
-
<farm-select :rules="[rules.required]" :items="items" v-model="form.selectId"/>
|
|
381
|
-
|
|
382
|
-
<div class="footer" :style="[styles.footer]">
|
|
383
|
-
<farm-btn outlined @click="$refs.form.restartValidation()" class="mr-3">Restart Validation</farm-btn>
|
|
384
|
-
<farm-btn outlined @click="$refs.form.reset()" class="mr-3">Reset</farm-btn>
|
|
385
|
-
<farm-btn :disabled="!validForm">Salvar</farm-btn>
|
|
386
|
-
</div>
|
|
387
|
-
</farm-form>
|
|
388
|
-
`,
|
|
389
|
-
});
|
|
390
348
|
*/
|