Skip to content

Commit

Permalink
add configurable validation for latlong fields
Browse files Browse the repository at this point in the history
  • Loading branch information
andz-bb committed Jun 16, 2023
1 parent a4db719 commit e53b37a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geolocation",
"version": "1.3.0",
"version": "1.4.0",
"description": "A form field that provides the user's current geolocation",
"author": "andz-bb",
"license": "MIT",
Expand Down
10 changes: 10 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
"label": "Disabled",
"key": "disabled",
"defaultValue": false
},
{
"type": "validation/number",
"label": "Latitude Validation",
"key": "latitudeValidation"
},
{
"type": "validation/number",
"label": "Longitude Validation",
"key": "longitudeValidation"
}
]
}
Expand Down
6 changes: 4 additions & 2 deletions src/Component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
export let latitudeField;
export let longitudeField;
export let latitudeValidation;
export let longitudeValidation;
const { styleable } = getContext("sdk");
const component = getContext("component");
Expand Down Expand Up @@ -61,7 +63,7 @@
"number",
latitude,
false,
null,
latitudeValidation,
formStep
);
Expand All @@ -77,7 +79,7 @@
"number",
longitude,
false,
null,
longitudeValidation,
formStep
);
Expand Down

0 comments on commit e53b37a

Please sign in to comment.