feat: migrate NumberField with form integration and docs
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
NumberField,
|
||||
type NumberFieldProps,
|
||||
numberFieldVariants,
|
||||
} from "../../packages/vue/src";
|
||||
const valid: NumberFieldProps = {
|
||||
modelValue: null,
|
||||
defaultValue: 2,
|
||||
minValue: 0,
|
||||
maxValue: 10,
|
||||
step: 0.1,
|
||||
locale: "de-DE",
|
||||
variant: "secondary",
|
||||
validationBehavior: "aria",
|
||||
validate: (value) => (value === null ? "Required" : true),
|
||||
};
|
||||
// @ts-expect-error public value is numeric, not a localized display string
|
||||
const invalidValue: NumberFieldProps = { modelValue: "1.234,5" };
|
||||
// @ts-expect-error unsupported variant
|
||||
const invalidVariant: NumberFieldProps = { variant: "ghost" };
|
||||
// @ts-expect-error no async validation protocol
|
||||
const invalidValidator: NumberFieldProps = { validate: async () => true };
|
||||
void [
|
||||
NumberField,
|
||||
valid,
|
||||
invalidValue,
|
||||
invalidVariant,
|
||||
invalidValidator,
|
||||
numberFieldVariants,
|
||||
];
|
||||
Reference in New Issue
Block a user