UNPKG

@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.44 kB
import type { Fn } from '../../../@aileron/declare'; import type { StringSchema, StringValue } from '../../../types'; import { AbstractNode } from '../AbstractNode'; import { type SchemaNodeConstructorProps, type UnionSetValueOption } from '../type'; /** * Node class for handling string schemas. * Manages and parses string values. */ export declare class StringNode extends AbstractNode<StringSchema, StringValue> { #private; /** * Gets the value of the string node. * @returns String value or undefined */ get value(): StringValue | undefined; /** * Sets the value of the string node. * @param input - The string value to set */ set value(input: StringValue | undefined); /** * Applies the input value to the string node. * @param input - The string value to set * @param option - Set value options */ protected applyValue(this: StringNode, input: StringValue | undefined, option: UnionSetValueOption): void; protected onChange: Fn<[input: StringValue | undefined]>; constructor({ key, name, jsonSchema, defaultValue, onChange, parentNode, validationMode, validatorFactory, required, }: SchemaNodeConstructorProps<StringSchema>); /** * Reflects value changes excluding empty values. * @param input - The value to set * @internal Internal implementation method. Do not call directly. */ private onChangeWithOmitEmpty; }