Untitled

 avatar
unknown
typescript
a year ago
1.1 kB
8
Indexable
export type PhoneBaseModel = {
  phone: string;
  fullPhone: string;
  isoCode: string;
  country: string;
  dialCode: string;
  formattedValue: string;
  floatValue: number;
};

schema = {
    type: 'object',
    properties: {
      phone: {
        type: 'object',
        properties: {
          phone: {
            type: 'string',
          },
          fullPhone: {
            type: 'string',
            format: 'fullPhone',
          },
          isoCode: {
            type: 'string',
          },
          country: {
            type: 'string',
          },
          dialCode: {
            type: 'string',
          },
          formattedValue: {
            type: 'string',
          },
          floatValue: {
            type: 'number',
          },
        },
        uniforms: {
          component: PhoneField,
          label: '',
          placeholder: '(___) ___ - ____',
        },
        required: ['phone', 'isoCode', 'fullPhone'],
        errorMessage: 'A valid phone is required',
      },
    },
    required: ['phone'],
  },
Editor is loading...
Leave a Comment