Skip to content

Commit

Permalink
autocomplete postal code from reference field
Browse files Browse the repository at this point in the history
  • Loading branch information
Mecrano committed Jun 25, 2024
1 parent 4e00626 commit 1ef8a30
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions react/country/ARE.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { POSTAL_CODE } from '../constants'
import { ONE_LEVEL } from '../constants'
import { firstLevelPostalCodes } from '../transforms/postalCodes'
import { getOneLevel } from '../transforms/addressFieldsOptions'
import type { PostalCodeRules } from '../types/rules'

const countryData = {
'Emiratos Árabes Unidos': '0',
}

const rules: PostalCodeRules = {
country: 'ARE',
abbr: 'AE',
postalCodeFrom: POSTAL_CODE,
postalCodeFrom: ONE_LEVEL,
postalCodeLevels: ['reference'],
firstLevelPostalCodes: firstLevelPostalCodes(countryData),
fields: [
{
hidden: true,
Expand Down Expand Up @@ -43,11 +51,13 @@ const rules: PostalCodeRules = {
size: 'xlarge',
},
{
hidden: true,
// hidden: true,
name: 'reference',
maxLength: 750,
label: 'reference',
label: 'postalCode',
size: 'xlarge',
level: 1,
options: getOneLevel(countryData),
},
{
hidden: true,
Expand Down

0 comments on commit 1ef8a30

Please sign in to comment.