| 484 | } |
| 485 | |
| 486 | private newChild(key: string, trackingId: TrackingKey | undefined, isArray: boolean): FieldNode { |
| 487 | // Determine the logic for the field that we're defining. |
| 488 | let childPath: FieldPathNode | undefined; |
| 489 | let childLogic: LogicNode; |
| 490 | if (isArray) { |
| 491 | // Fields for array elements have their logic defined by the `element` mechanism. |
| 492 | // TODO: other dynamic data |
| 493 | childPath = this.pathNode.getChild(DYNAMIC); |
| 494 | childLogic = this.structure.logic.getChild(DYNAMIC); |
| 495 | } else { |
| 496 | // Fields for plain properties exist in our logic node's child map. |
| 497 | childPath = this.pathNode.getChild(key); |
| 498 | childLogic = this.structure.logic.getChild(key); |
| 499 | } |
| 500 | |
| 501 | return this.fieldAdapter.newChild({ |
| 502 | kind: 'child', |
| 503 | parent: this as ParentFieldNode, |
| 504 | pathNode: childPath, |
| 505 | logic: childLogic, |
| 506 | initialKeyInParent: key, |
| 507 | identityInParent: trackingId, |
| 508 | fieldAdapter: this.fieldAdapter, |
| 509 | }); |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | const EMPTY = computed(() => []); |