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