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

40 lines (39 loc) 1.64 kB
import type { ObjectSchema, ObjectValue } from '../../../types'; import { AbstractNode } from '../AbstractNode'; import type { BranchNodeConstructorProps, SchemaNode, UnionSetValueOption } from '../type'; /** * A node class for handling object schemas. * Manages object properties and handles complex schemas like oneOf. */ export declare class ObjectNode extends AbstractNode<ObjectSchema, ObjectValue> { #private; /** * Gets the child nodes of the object node. * @returns List of child nodes */ get children(): import("../type").ChildNode[] | null; /** * Gets the value of the object node. * @returns Object value or undefined */ get value(): ObjectValue | undefined; /** * Sets the value of the object node. * @param input - Object value to set */ set value(input: ObjectValue | undefined); /** * Applies input value to the object node. * @param input - Object value to set * @param option - Setting options */ protected applyValue(this: ObjectNode, input: ObjectValue, option: UnionSetValueOption): void; /** * Activates this ObjectNode and propagates activation to all child nodes. * @param actor - The node that requested activation * @returns {boolean} Whether activation was successful * @internal Internal implementation method. Do not call directly. */ activate(this: ObjectNode, actor?: SchemaNode): boolean; constructor({ key, name, jsonSchema, defaultValue, onChange, nodeFactory, parentNode, validationMode, validatorFactory, required, }: BranchNodeConstructorProps<ObjectSchema>); }