feat(vue): OmegaForm number fields on Vuetify 4 v-number-input - #870
Merged
Conversation
Vuetify 4 promotes VNumberInput to a first-class component; the OmegaForm
"number" type now renders it instead of v-text-field type="number"
("range" keeps its own v-slider branch, behavior unchanged).
Precision is schema-driven: S.Int fields get precision 0 (no decimal
separator), plain S.Number gets free decimals (precision null), and an
explicit :precision via attrs still wins. The int refinement already
detected in the field meta is now forwarded through inputProps.
Adds a NumberInput story covering min/max clamping, decimals, attrs
passthrough (step/control-variant) and a per-field decimal-separator.
Passing min/max as VNumberInput props makes the component withhold out-of-range values from the model (schema errors never fire) and clamp on blur. Drop the props and expose the bounds via spinbutton ARIA attrs on the native input instead, matching what input type=number offered. Also default number controls to the stacked variant (overridable per field via attrs) and update the story accordingly.
S.isBetween checks fell through to Effect's default English formatter; map them to validation.number.min/max based on which bound the value violated. The existing min/max cases passed isExclusive inverted (inclusive checks rendered as strict and vice versa); swap them and document the catalog semantics.
@effect-app/cli
effect-app
@effect-app/eslint-codegen-model
@effect-app/eslint-shared-config
@effect-app/infra
@effect-app/vue
@effect-app/vue-components
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
numberfields render Vuetify 4's first-classv-number-input(rangekeeps its ownv-sliderbranch, behavior unchanged)S.Int→ precision 0 (no decimal separator), plainS.Number→ free decimals; explicit:precisionvia attrs winsVNumberInputprop:step,control-variant,decimal-separator, ...)min/maxare deliberately NOT passed as component props (the component silently withholds out-of-range values from the model and clamps on blur, so schema errors would never show); bounds are exposed to assistive tech via spinbutton ARIA attrs on the native inputS.isBetweenfailures are now localized viavalidation.number.min/maxpicking the violated side, and the pre-existing invertedisExclusiveflags on the min/max messages are fixedNumberInputstory covering all of the above.nvmrcbump to v22.23Test plan
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.