@canard/schema-form
Version:
React-based component library that renders forms based on JSON Schema with plugin system support for validators and UI components
36 lines (35 loc) • 1.48 kB
TypeScript
import type { Fn } from '../../../@aileron/declare';
import type { NumberSchema, NumberValue } from '../../../types';
import { AbstractNode } from '../AbstractNode';
import { type SchemaNodeConstructorProps, type UnionSetValueOption } from '../type';
/**
* Node class for handling number schemas.
* Manages and parses numeric values (integers or floating-point numbers).
*/
export declare class NumberNode extends AbstractNode<NumberSchema, NumberValue> {
#private;
/**
* Gets the value of the number node.
* @returns Number value or undefined
*/
get value(): NumberValue | undefined;
/**
* Sets the value of the number node.
* @param input - The number value to set
*/
set value(input: NumberValue | undefined);
/**
* Applies the input value to the number node.
* @param input - The number value to set
* @param option - Set value options
*/
protected applyValue(this: NumberNode, input: NumberValue | undefined, option: UnionSetValueOption): void;
protected onChange: Fn<[input: NumberValue | undefined]>;
constructor({ key, name, jsonSchema, defaultValue, onChange, parentNode, validationMode, validatorFactory, required, }: SchemaNodeConstructorProps<NumberSchema>);
/**
* Reflects value changes excluding empty values.
* @param input - The value to set
* @internal Internal implementation method. Do not call directly.
*/
private onChangeWithOmitEmpty;
}