Skip to content

Commit

Permalink
Merge pull request #57 from oneblink/ON-32825
Browse files Browse the repository at this point in the history
ON-32825 # Added `toAutoLookupElement` to `typeCastService`
  • Loading branch information
divporter authored Jun 27, 2023
2 parents c3c66a2 + 3fe14c0 commit fac7e57
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- `toAutoLookupElement` to `typeCastService.formElements`

## [3.1.0] - 2023-06-23

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/typeCastService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,25 @@ const toStorageElement = (
}
}

const toAutoLookupElement = (e: FormTypes.FormElement) => {
switch (e.type) {
case 'radio':
case 'boolean':
case 'files':
case 'location':
case 'geoscapeAddress':
case 'pointAddress':
case 'compliance':
case 'civicaStreetName':
case 'autocomplete': {
return e
}
default: {
return
}
}
}

const formElements = {
toOptionsElement,
toFormElementWithForm,
Expand All @@ -196,6 +215,7 @@ const formElements = {
toPageElement,
toRepeatableSetElement,
toStorageElement,
toAutoLookupElement,
}

const toPaymentSubmissionEvent = (
Expand Down

0 comments on commit fac7e57

Please sign in to comment.