Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add currency component #50

Merged
merged 7 commits into from
Nov 9, 2023
Merged

Conversation

Viicos
Copy link
Contributor

@Viicos Viicos commented Nov 6, 2023

No description provided.

src/registry/currency/edit.tsx Outdated Show resolved Hide resolved
const defaultValueSchema = singleValueSchema.or(multipleValueSchema);

const currencySpecific = z.object({
decimalLimit: z.number().int().positive().optional(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the types restrict this to the values 0-9 (maybe 10), so perhaps we should do the same here?

z.union([z.literal(0), z.literal(1), z.literal(2)]) etc. (you can write a nice Array(9).map for this probably).

Copy link
Contributor Author

@Viicos Viicos Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, had to cast as any because it doesn't typecheck somehow

src/registry/currency/edit.tsx Outdated Show resolved Hide resolved
src/registry/currency/edit.tsx Outdated Show resolved Hide resolved
src/registry/currency/edit.tsx Outdated Show resolved Hide resolved
src/registry/currency/edit.tsx Show resolved Hide resolved
src/components/formio/number.tsx Outdated Show resolved Hide resolved
@sergei-maertens sergei-maertens merged commit 5700d1c into main Nov 9, 2023
8 checks passed
@sergei-maertens sergei-maertens deleted the feature/currency-component branch November 22, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants