@farm-investimentos/front-mfe-components-vue3 0.5.2 → 0.6.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 +104 -35
- 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 +104 -35
- 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 +14 -13
- package/src/components/AlertReload/AlertReload.stories.js +2 -0
- package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +1 -1
- package/src/components/Buttons/RemoveButton/RemoveButton.stories.js +4 -4
- package/src/components/Checkbox/Checkbox.stories.js +1 -2
- package/src/components/Chip/Chip.stories.js +1 -1
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +2 -3
- package/src/components/DataTableHeader/DataTableHeader.stories.js +0 -2
- package/src/components/DataTablePaginator/DataTablePaginator.stories.js +6 -4
- package/src/components/DatePicker/DatePicker.stories.js +60 -9
- package/src/components/DatePicker/DatePicker.vue +82 -12
- package/src/components/DialogHeader/DialogHeader.stories.js +1 -1
- package/src/components/IdCaption/IdCaption.stories.js +6 -6
- package/src/components/InputDecimalFormatter/InputDecimalFormatter.stories.js +2 -10
- package/src/components/ListItem/ListItem.stories.js +0 -2
- package/src/components/Loader/Loader.stories.ts +2 -0
- package/src/components/Logger/Logger.stories.js +3 -3
- package/src/components/ManagersList/ManagersList.stories.js +3 -3
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +2 -3
- package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +2 -2
- package/src/components/ProgressBar/ProgressBar.stories.js +2 -1
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +2 -1
- package/src/components/RangeDatePicker/RangeDatePicker.stories.js +2 -2
- package/src/components/TextFieldV2/TextFieldV2.scss +6 -0
- package/src/components/TextFieldV2/TextFieldV2.stories.js +21 -7
- package/src/components/TextFieldV2/TextFieldV2.vue +8 -1
- package/src/components/Typography/Typography.stories.js +0 -1
- package/src/components/layout/Box/Box.stories.js +0 -1
- package/src/components/layout/Col/Col.stories.js +8 -9
- package/src/components/layout/DisplayBreakpoints.mdx +111 -0
- package/src/components/layout/GridSystem.stories.js +0 -2
- package/src/components/layout/{PropsValues.stories.mdx → PropsValues.mdx} +11 -4
- package/src/components/layout/Row/Row.stories.js +0 -2
- package/src/examples/Colors.stories.js +1 -1
- package/src/examples/Dialog.stories.js +20 -16
- package/src/stories/Introduction.mdx +118 -0
- package/src/components/layout/DisplayBreakpoints.stories.mdx +0 -90
- package/src/stories/Introduction.stories.mdx +0 -118
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components-vue3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"not dead"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@
|
|
33
|
+
"@storybook/test": "^8.0.0",
|
|
34
|
+
"@vuepic/vue-datepicker": "8.2.0",
|
|
34
35
|
"core-js": "3.33.1",
|
|
35
36
|
"text-mask-addons": "^3.8.0",
|
|
36
37
|
"v-mask": "2.3.0",
|
|
@@ -42,21 +43,21 @@
|
|
|
42
43
|
"@babel/core": "7.17.9",
|
|
43
44
|
"@babel/generator": "7.17.9",
|
|
44
45
|
"@farm-investimentos/front-mfe-libs-ts": "3.0.5",
|
|
45
|
-
"@storybook/addon-essentials": "
|
|
46
|
-
"@storybook/addon-interactions": "
|
|
47
|
-
"@storybook/addon-links": "
|
|
48
|
-
"@storybook/
|
|
49
|
-
"@storybook/
|
|
50
|
-
"@storybook/
|
|
51
|
-
"@storybook/theming": "^
|
|
52
|
-
"@storybook/vue3": "
|
|
53
|
-
"@storybook/vue3-vite": "
|
|
46
|
+
"@storybook/addon-essentials": "^8.0.0",
|
|
47
|
+
"@storybook/addon-interactions": "^8.0.0",
|
|
48
|
+
"@storybook/addon-links": "^8.0.0",
|
|
49
|
+
"@storybook/addon-mdx-gfm": "^8.0.0",
|
|
50
|
+
"@storybook/blocks": "^8.0.0",
|
|
51
|
+
"@storybook/manager-api": "^8.0.0",
|
|
52
|
+
"@storybook/theming": "^8.0.0",
|
|
53
|
+
"@storybook/vue3": "^8.0.0",
|
|
54
|
+
"@storybook/vue3-vite": "^8.0.0",
|
|
54
55
|
"@tsconfig/node18": "^18.2.2",
|
|
55
56
|
"@types/jest": "^29.0.0",
|
|
56
57
|
"@types/node": "^18.17.17",
|
|
57
58
|
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
|
58
59
|
"@typescript-eslint/parser": "^4.18.0",
|
|
59
|
-
"@vitejs/plugin-vue": "^4.
|
|
60
|
+
"@vitejs/plugin-vue": "^4.6.2",
|
|
60
61
|
"@vue/cli-plugin-babel": "^5.0.0",
|
|
61
62
|
"@vue/cli-plugin-eslint": "^4.5.0",
|
|
62
63
|
"@vue/cli-plugin-typescript": "^4.5.0",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"react-dom": "^18.2.0",
|
|
81
82
|
"sass": "~1.32.0",
|
|
82
83
|
"sass-loader": "10.4.1",
|
|
83
|
-
"storybook": "^
|
|
84
|
+
"storybook": "^8.0.0",
|
|
84
85
|
"style-loader": "^3.3.3",
|
|
85
86
|
"ts-jest": "^29.0.0",
|
|
86
87
|
"typescript": "~4.1.5",
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import AlertReload from './AlertReload.vue';
|
|
1
2
|
// import { withDesign } from 'storybook-addon-designs';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Feedback/AlertReload',
|
|
5
6
|
// decorators: [withDesign],
|
|
7
|
+
component: AlertReload,
|
|
6
8
|
parameters: {
|
|
7
9
|
viewMode: 'docs',
|
|
8
10
|
docs: {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import RemoveButton from './RemoveButton.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
title: 'Buttons/Remove',
|
|
5
|
+
component: RemoveButton,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
|
-
|
|
9
|
+
template: '<farm-btn-remove />',
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export const Secondary = () => ({
|
|
13
|
-
|
|
13
|
+
template: '<farm-btn-remove label="Custom label" />',
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
Primary.storyName = 'Básico';
|
|
@@ -176,13 +176,12 @@ export const ResetByMethod = () => ({
|
|
|
176
176
|
|
|
177
177
|
export const ChangeEvent = () => ({
|
|
178
178
|
setup() {
|
|
179
|
-
|
|
180
179
|
const select = () => {
|
|
181
180
|
alert('Updated model value');
|
|
182
181
|
};
|
|
183
182
|
|
|
184
183
|
return {
|
|
185
|
-
select
|
|
184
|
+
select,
|
|
186
185
|
};
|
|
187
186
|
},
|
|
188
187
|
data() {
|
|
@@ -21,10 +21,9 @@ export const Primary = () => ({
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
export const CustomTitles = () => ({
|
|
24
|
-
template:
|
|
25
|
-
'<farm-emptywrapper title="Título customizado" subtitle="Subtítulo customizado" />',
|
|
24
|
+
template: '<farm-emptywrapper title="Título customizado" subtitle="Subtítulo customizado" />',
|
|
26
25
|
});
|
|
27
26
|
|
|
28
27
|
export const NoBorder = () => ({
|
|
29
28
|
template: '<farm-emptywrapper :bordered="false" />',
|
|
30
|
-
});
|
|
29
|
+
});
|
|
@@ -24,7 +24,6 @@ export const Primary = () => ({
|
|
|
24
24
|
headers,
|
|
25
25
|
sortClick: [],
|
|
26
26
|
firstSelected: true,
|
|
27
|
-
|
|
28
27
|
};
|
|
29
28
|
},
|
|
30
29
|
template: `<farm-datatable-header
|
|
@@ -44,7 +43,6 @@ export const SetDescInititalOrder = () => ({
|
|
|
44
43
|
headers: customHeaders,
|
|
45
44
|
sortClick: [],
|
|
46
45
|
firstSelected: true,
|
|
47
|
-
|
|
48
46
|
};
|
|
49
47
|
},
|
|
50
48
|
template: `<farm-datatable-header
|
|
@@ -27,7 +27,8 @@ export const Primary = () => ({
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
export const HidePerPageOptions = () => ({
|
|
30
|
-
template:
|
|
30
|
+
template:
|
|
31
|
+
'<farm-datatable-paginator :hidePerPageOptions="true" :totalPages="190000" :page="1" />',
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
export const Disabled = () => ({
|
|
@@ -41,9 +42,10 @@ export const CustomPerPage = () => ({
|
|
|
41
42
|
|
|
42
43
|
export const OnChangeLimitPerPage = () => ({
|
|
43
44
|
methods: {
|
|
44
|
-
onChangeLimitPerPage:
|
|
45
|
+
onChangeLimitPerPage: newValue => {
|
|
45
46
|
alert(newValue);
|
|
46
|
-
}
|
|
47
|
+
},
|
|
47
48
|
},
|
|
48
|
-
template:
|
|
49
|
+
template:
|
|
50
|
+
'<farm-datatable-paginator :totalPages="19" :page="1" @onChangeLimitPerPage="onChangeLimitPerPage" />',
|
|
49
51
|
});
|
|
@@ -16,6 +16,12 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
function createDateWithNDaysAhead(nDays) {
|
|
20
|
+
let disabledDate = new Date();
|
|
21
|
+
disabledDate.setDate(disabledDate.getDate() + nDays);
|
|
22
|
+
return disabledDate;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
export const Primary = () => ({
|
|
20
26
|
data() {
|
|
21
27
|
return {
|
|
@@ -31,10 +37,13 @@ export const Primary = () => ({
|
|
|
31
37
|
export const InitValue = () => ({
|
|
32
38
|
data() {
|
|
33
39
|
return {
|
|
34
|
-
date: '2023-08-
|
|
40
|
+
date: '2023-08-15',
|
|
35
41
|
};
|
|
36
42
|
},
|
|
37
|
-
template: `<div style='max-width: 320px'
|
|
43
|
+
template: `<div style='max-width: 320px'>
|
|
44
|
+
<farm-input-datepicker inputId="input-custom-id-1" v-model="date" />
|
|
45
|
+
date: {{ date }}
|
|
46
|
+
</div>`,
|
|
38
47
|
});
|
|
39
48
|
|
|
40
49
|
export const MinMaxDates = () => ({
|
|
@@ -84,23 +93,53 @@ export const IsNull = () => ({
|
|
|
84
93
|
</div>`,
|
|
85
94
|
});
|
|
86
95
|
|
|
87
|
-
export const
|
|
96
|
+
export const AllowedDates = () => ({
|
|
88
97
|
data() {
|
|
98
|
+
const allowedDates = [
|
|
99
|
+
createDateWithNDaysAhead(-2),
|
|
100
|
+
createDateWithNDaysAhead(3),
|
|
101
|
+
createDateWithNDaysAhead(5),
|
|
102
|
+
];
|
|
89
103
|
return {
|
|
90
104
|
date: '',
|
|
91
|
-
|
|
105
|
+
allowedDates,
|
|
92
106
|
};
|
|
93
107
|
},
|
|
94
|
-
template: `<
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
template: `<farm-row>
|
|
109
|
+
<farm-col cols="4">
|
|
110
|
+
<farm-input-datepicker position="bottom" :allowed-dates="allowedDates" inputId="input-custom-id-134234" v-model="date" />
|
|
111
|
+
</farm-col>
|
|
112
|
+
<farm-col cols="12">
|
|
113
|
+
allowed dates: {{ allowedDates }}<br />
|
|
114
|
+
selected date: {{ date }}
|
|
115
|
+
<farm-col>
|
|
116
|
+
</farm-row>`,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export const DisabledDates = () => ({
|
|
120
|
+
data() {
|
|
121
|
+
const disabledDate = createDateWithNDaysAhead(1);
|
|
122
|
+
return {
|
|
123
|
+
date: '',
|
|
124
|
+
disabledDates: [disabledDate],
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
template: `<farm-row>
|
|
128
|
+
<farm-col cols="4">
|
|
129
|
+
<farm-input-datepicker position="bottom" :disabled-dates="disabledDates" inputId="input-custom-id-98231" v-model="date" />
|
|
130
|
+
</farm-col>
|
|
131
|
+
<farm-col cols="12">
|
|
132
|
+
disabled dates: {{ disabledDates }}<br />
|
|
133
|
+
selected date: {{ date }}
|
|
134
|
+
<farm-col>
|
|
135
|
+
</farm-row>`,
|
|
97
136
|
});
|
|
98
137
|
|
|
99
138
|
export const WithInitialMonth = () => ({
|
|
100
139
|
data() {
|
|
101
140
|
return {
|
|
102
141
|
date: '',
|
|
103
|
-
pickerDate: '2023-01'
|
|
142
|
+
pickerDate: '2023-01',
|
|
104
143
|
};
|
|
105
144
|
},
|
|
106
145
|
template: `<div style='max-width: 320px'>
|
|
@@ -155,4 +194,16 @@ export const InvalidMessage = () => ({
|
|
|
155
194
|
<farm-input-datepicker invalidMessage="Data inválida, use o formato DD/MM/AAAA." inputId="input-custom-id-10" v-model="date" requiredMessage="Preencha a data de forma correta." :required="true" />
|
|
156
195
|
date: {{ date }}
|
|
157
196
|
</div>`,
|
|
158
|
-
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
export const MultipleDates = () => ({
|
|
200
|
+
data() {
|
|
201
|
+
return {
|
|
202
|
+
date: [],
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
template: `<div style='max-width: 320px'>
|
|
206
|
+
<farm-input-datepicker inputId="input-custom-id-0" v-model="date" multiple />
|
|
207
|
+
dates: {{ date }}
|
|
208
|
+
</div>`,
|
|
209
|
+
});
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
v-model="dateField"
|
|
18
18
|
:min-date="minDate"
|
|
19
19
|
:max-date="maxDate"
|
|
20
|
-
:allowed-dates="
|
|
20
|
+
:allowed-dates="allowedDates"
|
|
21
|
+
:disabled-dates="disabledDates"
|
|
21
22
|
:day-names="['S', 'T', 'Q', 'Q', 'S', 'S', 'D']"
|
|
22
23
|
:start-date="internalPickerDate"
|
|
24
|
+
:multi-dates="multiple"
|
|
23
25
|
/>
|
|
24
26
|
|
|
25
27
|
<div class="picker__actions">
|
|
@@ -57,10 +59,11 @@
|
|
|
57
59
|
autocomplete="off"
|
|
58
60
|
ref="inputCalendar"
|
|
59
61
|
:readonly="readonly"
|
|
60
|
-
:
|
|
62
|
+
:ellipsed="multiple"
|
|
63
|
+
:mask="`${isReadonly ? '' : '##/##/####'}`"
|
|
61
64
|
:requiredMessage="requiredMessage"
|
|
62
65
|
:id="inputId"
|
|
63
|
-
:rules="
|
|
66
|
+
:rules="rules"
|
|
64
67
|
@keyup="keyUpInput"
|
|
65
68
|
/>
|
|
66
69
|
</template>
|
|
@@ -70,7 +73,12 @@
|
|
|
70
73
|
import { PropType } from 'vue';
|
|
71
74
|
|
|
72
75
|
import { formatDatePickerHeader } from '../../helpers';
|
|
73
|
-
import {
|
|
76
|
+
import {
|
|
77
|
+
convertDate,
|
|
78
|
+
checkDateValid,
|
|
79
|
+
revertDate,
|
|
80
|
+
defaultFormat as dateDefaultFormatter,
|
|
81
|
+
} from '../../helpers/date';
|
|
74
82
|
/**
|
|
75
83
|
* Componente de input com datepicker para data
|
|
76
84
|
*/
|
|
@@ -88,7 +96,7 @@ export default {
|
|
|
88
96
|
* v-model bind
|
|
89
97
|
*/
|
|
90
98
|
modelValue: {
|
|
91
|
-
type: String,
|
|
99
|
+
type: [String, Array],
|
|
92
100
|
default: '',
|
|
93
101
|
},
|
|
94
102
|
/**
|
|
@@ -113,9 +121,16 @@ export default {
|
|
|
113
121
|
default: 'bottom',
|
|
114
122
|
},
|
|
115
123
|
/**
|
|
116
|
-
* Allowed
|
|
124
|
+
* Allowed dates (format YYYY-MM-DD)
|
|
125
|
+
*/
|
|
126
|
+
allowedDates: {
|
|
127
|
+
type: Array,
|
|
128
|
+
default: () => null,
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* Disabled dates(format YYYY-MM-DD)
|
|
117
132
|
*/
|
|
118
|
-
|
|
133
|
+
disabledDates: {
|
|
119
134
|
type: Array,
|
|
120
135
|
default: () => null,
|
|
121
136
|
},
|
|
@@ -145,13 +160,21 @@ export default {
|
|
|
145
160
|
type: String,
|
|
146
161
|
default: 'Data inválida',
|
|
147
162
|
},
|
|
163
|
+
/**
|
|
164
|
+
* Allow multiple dates
|
|
165
|
+
*/
|
|
166
|
+
multiple: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: false,
|
|
169
|
+
},
|
|
148
170
|
},
|
|
149
171
|
data() {
|
|
172
|
+
const s = this.formatDateRange(this.modelValue);
|
|
150
173
|
return {
|
|
151
174
|
internalPickerDate: this.pickerDate,
|
|
152
175
|
menuField: false,
|
|
153
176
|
dateField: this.modelValue,
|
|
154
|
-
fieldRange: revertDate(this.modelValue),
|
|
177
|
+
fieldRange: this.multiple ? s : revertDate(this.modelValue as string),
|
|
155
178
|
checkDateValid: value => {
|
|
156
179
|
if (value.length > 0) {
|
|
157
180
|
return checkDateValid(value) ? true : this.invalidMessage;
|
|
@@ -183,15 +206,25 @@ export default {
|
|
|
183
206
|
}
|
|
184
207
|
return true;
|
|
185
208
|
},
|
|
209
|
+
checkIsInAllowedDates: value => {
|
|
210
|
+
const dateSelected = convertDate(value);
|
|
211
|
+
|
|
212
|
+
if (!this.required && value.length === 0) {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return this.allowedDates(dateSelected) || 'Data inválida';
|
|
217
|
+
},
|
|
186
218
|
};
|
|
187
219
|
},
|
|
188
220
|
watch: {
|
|
189
221
|
modelValue(newValue) {
|
|
190
222
|
this.dateField = newValue;
|
|
223
|
+
this.fieldRange = this.multiple ? this.formatDateRange(newValue) : revertDate(newValue);
|
|
191
224
|
},
|
|
192
225
|
fieldRange(newValue) {
|
|
193
226
|
if (!newValue) {
|
|
194
|
-
this.dateField = '';
|
|
227
|
+
this.dateField = this.multiple ? [] : '';
|
|
195
228
|
this.save();
|
|
196
229
|
}
|
|
197
230
|
},
|
|
@@ -205,11 +238,11 @@ export default {
|
|
|
205
238
|
save() {
|
|
206
239
|
this.inputVal = this.dateField;
|
|
207
240
|
this.menuField = false;
|
|
208
|
-
this.fieldRange = revertDate(this.dateField);
|
|
209
241
|
this.closeDatepicker();
|
|
242
|
+
|
|
210
243
|
},
|
|
211
244
|
clear() {
|
|
212
|
-
this.dateField = '';
|
|
245
|
+
this.dateField = this.multiple ? [] : '';
|
|
213
246
|
this.save();
|
|
214
247
|
this.$refs.inputCalendar.reset();
|
|
215
248
|
},
|
|
@@ -222,7 +255,8 @@ export default {
|
|
|
222
255
|
let newValue = event.target.value;
|
|
223
256
|
if (this.validation(newValue) && newValue.length === 10) {
|
|
224
257
|
const [day, month, year] = newValue.split('/');
|
|
225
|
-
|
|
258
|
+
const formattedDate = `${year}-${month}-${day}`;
|
|
259
|
+
this.dateField = this.multiple ? [formattedDate] : formattedDate;
|
|
226
260
|
this.save();
|
|
227
261
|
}
|
|
228
262
|
},
|
|
@@ -240,6 +274,20 @@ export default {
|
|
|
240
274
|
this.$refs.contextmenu.inputValue = false;
|
|
241
275
|
},
|
|
242
276
|
formatDatePickerHeader,
|
|
277
|
+
|
|
278
|
+
formatDateRange(date: string | string[]) {
|
|
279
|
+
if (!date || date.length === 0) return '';
|
|
280
|
+
|
|
281
|
+
if (this.multiple) {
|
|
282
|
+
let dateString = [...date]
|
|
283
|
+
.sort((a, b) => +new Date(a) - +new Date(b))
|
|
284
|
+
.map(dateDefaultFormatter as any)
|
|
285
|
+
.join(', ');
|
|
286
|
+
return dateString;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return dateDefaultFormatter(date);
|
|
290
|
+
},
|
|
243
291
|
},
|
|
244
292
|
computed: {
|
|
245
293
|
inputVal: {
|
|
@@ -274,6 +322,28 @@ export default {
|
|
|
274
322
|
}
|
|
275
323
|
return null;
|
|
276
324
|
},
|
|
325
|
+
isReadonly() {
|
|
326
|
+
return this.readonly || this.multiple;
|
|
327
|
+
},
|
|
328
|
+
rules() {
|
|
329
|
+
const allRules = [
|
|
330
|
+
this.checkDateValid,
|
|
331
|
+
this.checkMax,
|
|
332
|
+
this.checkMin,
|
|
333
|
+
this.checkRequire,
|
|
334
|
+
// this.checkIsInAllowedDates,
|
|
335
|
+
];
|
|
336
|
+
|
|
337
|
+
if (this.multiple) {
|
|
338
|
+
if (!this.inputVal.length && this.required) {
|
|
339
|
+
return allRules.map(rule => rule.call(this, ''));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return this.inputVal.flatMap(date => allRules.map(rule => rule.call(this, date)));
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return allRules;
|
|
346
|
+
},
|
|
277
347
|
},
|
|
278
348
|
};
|
|
279
349
|
</script>
|
|
@@ -66,4 +66,4 @@ export const VeryLongTitle = () => ({
|
|
|
66
66
|
template: `<div style="max-width: 480px; position: relative;">
|
|
67
67
|
<farm-dialog-header title="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tincidunt leo nec orci hendrerit, in sagittis magna tincidunt." />
|
|
68
68
|
</div>`,
|
|
69
|
-
});
|
|
69
|
+
});
|
|
@@ -23,11 +23,11 @@ export default {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const Primary = () => ({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
methods: {
|
|
27
|
+
onLinkClick() {
|
|
28
|
+
alert('onLinkClick');
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
31
|
template: `
|
|
32
32
|
<farm-idcaption
|
|
33
33
|
icon="account-box-outline"
|
|
@@ -221,4 +221,4 @@ export const NoHeight = () => ({
|
|
|
221
221
|
</template>
|
|
222
222
|
</farm-idcaption>
|
|
223
223
|
</farm-col>`,
|
|
224
|
-
});
|
|
224
|
+
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
import InputDecimalFormatter from './InputDecimalFormatter.vue';
|
|
3
2
|
|
|
4
|
-
|
|
5
3
|
export default {
|
|
6
4
|
title: 'Form/InputDecimalFormatter',
|
|
7
5
|
component: InputDecimalFormatter,
|
|
@@ -38,7 +36,6 @@ export const Default = () => ({
|
|
|
38
36
|
</div>`,
|
|
39
37
|
});
|
|
40
38
|
|
|
41
|
-
|
|
42
39
|
export const Prefix = () => ({
|
|
43
40
|
data() {
|
|
44
41
|
return {
|
|
@@ -54,7 +51,6 @@ export const Prefix = () => ({
|
|
|
54
51
|
</div>`,
|
|
55
52
|
});
|
|
56
53
|
|
|
57
|
-
|
|
58
54
|
export const Sufix = () => ({
|
|
59
55
|
data() {
|
|
60
56
|
return {
|
|
@@ -70,7 +66,6 @@ export const Sufix = () => ({
|
|
|
70
66
|
</div>`,
|
|
71
67
|
});
|
|
72
68
|
|
|
73
|
-
|
|
74
69
|
export const Precision = () => ({
|
|
75
70
|
data() {
|
|
76
71
|
return {
|
|
@@ -86,7 +81,6 @@ export const Precision = () => ({
|
|
|
86
81
|
</div>`,
|
|
87
82
|
});
|
|
88
83
|
|
|
89
|
-
|
|
90
84
|
export const Icon = () => ({
|
|
91
85
|
data() {
|
|
92
86
|
return {
|
|
@@ -104,12 +98,11 @@ export const Icon = () => ({
|
|
|
104
98
|
|
|
105
99
|
export const Required = () => ({
|
|
106
100
|
data() {
|
|
107
|
-
|
|
108
101
|
return {
|
|
109
102
|
v: '0,00',
|
|
110
103
|
rules: {
|
|
111
|
-
required: value => value !==
|
|
112
|
-
}
|
|
104
|
+
required: value => value !== '0,00' || 'Required field',
|
|
105
|
+
},
|
|
113
106
|
};
|
|
114
107
|
},
|
|
115
108
|
template: `<div style="width: 480px;">
|
|
@@ -120,4 +113,3 @@ export const Required = () => ({
|
|
|
120
113
|
<span>{{v}}</span>
|
|
121
114
|
</div>`,
|
|
122
115
|
});
|
|
123
|
-
|
|
@@ -31,7 +31,7 @@ export const Primary = () => ({
|
|
|
31
31
|
formattedDate: '13/06/2022 20:40',
|
|
32
32
|
status: 'error',
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
{
|
|
36
36
|
message: 'Aprovado entre as pré elegíveis',
|
|
37
37
|
userName: 'Cleyton Rasta',
|
|
@@ -174,7 +174,7 @@ export const Horizontal = () => ({
|
|
|
174
174
|
details() {
|
|
175
175
|
alert('Ver Detalhes');
|
|
176
176
|
},
|
|
177
|
-
}
|
|
177
|
+
},
|
|
178
178
|
],
|
|
179
179
|
};
|
|
180
180
|
},
|
|
@@ -220,7 +220,7 @@ export const HorizontalLeftAligned = () => ({
|
|
|
220
220
|
details() {
|
|
221
221
|
alert('Ver Detalhes');
|
|
222
222
|
},
|
|
223
|
-
}
|
|
223
|
+
},
|
|
224
224
|
],
|
|
225
225
|
};
|
|
226
226
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import ManagersList from './ManagersList.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
title: 'Display/ManagersList',
|
|
5
|
+
component: ManagersList,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
|
-
|
|
9
|
+
template: '<farm-managers-list managersString="nome1,nome2,nome3" />',
|
|
10
10
|
});
|
|
@@ -50,7 +50,6 @@ export const Error = () => ({
|
|
|
50
50
|
</div>`,
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
|
|
54
53
|
export const ButtonLabels = () => ({
|
|
55
54
|
data() {
|
|
56
55
|
return {
|
|
@@ -103,7 +102,7 @@ export const OnConfirm = () => ({
|
|
|
103
102
|
methods: {
|
|
104
103
|
onConfirm() {
|
|
105
104
|
alert('On confirm triggered');
|
|
106
|
-
}
|
|
105
|
+
},
|
|
107
106
|
},
|
|
108
107
|
template: `<div>
|
|
109
108
|
<farm-prompt-user
|
|
@@ -118,4 +117,4 @@ export const OnConfirm = () => ({
|
|
|
118
117
|
reabrir
|
|
119
118
|
</farm-btn>
|
|
120
119
|
</div>`,
|
|
121
|
-
});
|
|
120
|
+
});
|
|
@@ -65,10 +65,10 @@ export const Reset = () => ({
|
|
|
65
65
|
methods: {
|
|
66
66
|
onReset() {
|
|
67
67
|
this.$refs.picker.reset();
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
69
|
},
|
|
70
70
|
template: `<div>
|
|
71
71
|
<farm-multiple-filepicker ref="picker" />
|
|
72
72
|
<farm-btn @click="onReset" class="mt-1">reset</farm-btn>
|
|
73
73
|
</div>`,
|
|
74
|
-
});
|
|
74
|
+
});
|
|
@@ -54,5 +54,6 @@ export const IndeterminateAnimation = () => ({
|
|
|
54
54
|
val: 35,
|
|
55
55
|
};
|
|
56
56
|
},
|
|
57
|
-
template:
|
|
57
|
+
template:
|
|
58
|
+
'<farm-progressbar indeterminate :value="val" background-color="#FFFF00" value-color="#00FF00" />',
|
|
58
59
|
});
|