Skip to content

Commit

Permalink
🐛 Adds isValid and required fields to HdInputPhone (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroinacio authored Mar 4, 2024
1 parent bfb7b2c commit 38e1dd3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/form/HdInputPhone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
:custom-rules="[isValidNumber, isMobileNumber, canBeInternationallyDialled]"
:formatter="phoneFormatter"
@input="handleInputEvent"
:required="required"
/>
</div>
</template>

<script>
/* eslint-disable import/no-extraneous-dependencies */
import HdInputFormatter from 'homeday-blocks/src/components/form/HdInputFormatter.vue';
import HdIcon from 'homeday-blocks/src/components/HdIcon.vue';
import { getMessages } from 'homeday-blocks/src/lang';
Expand Down Expand Up @@ -115,6 +115,11 @@ export default {
required: false,
default: false,
},
required: {
type: Boolean,
required: false,
default: false,
},
lang: {
type: String,
default: 'de',
Expand Down Expand Up @@ -195,6 +200,9 @@ export default {
errorMessage: this.t.FORM.VALIDATION.NOT_MOBILE_NUMBER,
};
},
isValid() {
return this.$refs.input.$refs.input.isValid;
},
canBeInternationallyDialled() {
return {
validate: (value) => {
Expand Down

0 comments on commit 38e1dd3

Please sign in to comment.