MCPcopy Create free account
hub / github.com/angular/angular / BasicFieldAdapter

Class BasicFieldAdapter

packages/forms/signals/src/field/field_adapter.ts:68–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 * Basic adapter supporting standard form behavior.
67 */
68export class BasicFieldAdapter implements FieldAdapter {
69 /**
70 * Creates a new Root field node.
71 * @param fieldManager
72 * @param value
73 * @param pathNode
74 * @param adapter
75 */
76 newRoot<TValue>(
77 fieldManager: FormFieldManager,
78 value: WritableSignal<TValue>,
79 pathNode: FieldPathNode,
80 adapter: FieldAdapter,
81 ): FieldNode {
82 return new FieldNode({
83 kind: 'root',
84 fieldManager,
85 value,
86 pathNode,
87 logic: pathNode.builder.build(),
88 fieldAdapter: adapter,
89 });
90 }
91
92 /**
93 * Creates a new child field node.
94 * @param options
95 */
96 newChild(options: ChildFieldNodeOptions): FieldNode {
97 return new FieldNode(options);
98 }
99
100 /**
101 * Creates a node state.
102 * @param node
103 */
104 createNodeState(node: FieldNode): FieldNodeState {
105 return new FieldNodeState(node);
106 }
107
108 /**
109 * Creates a validation state.
110 * @param node
111 */
112 createValidationState(node: FieldNode): ValidationState {
113 return new FieldValidationState(node);
114 }
115
116 /**
117 * Creates a node structure.
118 * @param node
119 * @param options
120 */
121 createStructure(node: FieldNode, options: FieldNodeOptions): FieldNodeStructure {
122 return node.createStructure(options);
123 }
124}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected