@farm-investimentos/front-mfe-components-vue3 0.4.0 → 0.4.1
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 +14 -10
- 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 +14 -10
- 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/DatePicker/DatePicker.stories.js +12 -0
- package/src/components/DatePicker/DatePicker.vue +7 -3
package/package.json
CHANGED
|
@@ -143,4 +143,16 @@ export const RequiredMessage = () => ({
|
|
|
143
143
|
<farm-input-datepicker inputId="input-custom-id-10" v-model="date" requiredMessage="Preencha a data de forma correta." :required="true" />
|
|
144
144
|
date: {{ date }}
|
|
145
145
|
</div>`,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
export const InvalidMessage = () => ({
|
|
149
|
+
data() {
|
|
150
|
+
return {
|
|
151
|
+
date: '',
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
template: `<div style='max-width: 320px'>
|
|
155
|
+
<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
|
+
date: {{ date }}
|
|
157
|
+
</div>`,
|
|
146
158
|
});
|
|
@@ -139,8 +139,12 @@ export default {
|
|
|
139
139
|
},
|
|
140
140
|
requiredMessage: {
|
|
141
141
|
type: String,
|
|
142
|
-
default: 'Campo obrigatório'
|
|
143
|
-
}
|
|
142
|
+
default: 'Campo obrigatório',
|
|
143
|
+
},
|
|
144
|
+
invalidMessage: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: 'Data inválida',
|
|
147
|
+
},
|
|
144
148
|
},
|
|
145
149
|
data() {
|
|
146
150
|
return {
|
|
@@ -150,7 +154,7 @@ export default {
|
|
|
150
154
|
fieldRange: revertDate(this.modelValue),
|
|
151
155
|
checkDateValid: value => {
|
|
152
156
|
if (value.length > 0) {
|
|
153
|
-
return checkDateValid(value) ? true :
|
|
157
|
+
return checkDateValid(value) ? true : this.invalidMessage;
|
|
154
158
|
}
|
|
155
159
|
return true;
|
|
156
160
|
},
|