@ng-forge/dynamic-form-mcp 0.8.0-next.3 → 0.8.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ng-forge-mcp.js +112 -15
- package/package.json +6 -6
- package/src/index.js +112 -15
- package/src/registry/field-types.d.ts.map +1 -1
- package/src/tools/data/lookup-topics.d.ts.map +1 -1
package/bin/ng-forge-mcp.js
CHANGED
|
@@ -333,17 +333,20 @@ var FIELD_TYPES = [
|
|
|
333
333
|
fields: {
|
|
334
334
|
name: "fields",
|
|
335
335
|
type: "RowAllowedChildren[]",
|
|
336
|
-
description: "Child fields to render horizontally. Allowed: groups, arrays,
|
|
336
|
+
description: "Child fields to render horizontally. Allowed: groups, arrays, containers, nested rows, hidden fields, and value fields (input, select, etc). NOT ALLOWED: pages",
|
|
337
337
|
required: true
|
|
338
338
|
}
|
|
339
339
|
},
|
|
340
340
|
validationSupported: false,
|
|
341
341
|
source: "core",
|
|
342
|
-
allowedIn: ["top-level", "page", "group", "array"],
|
|
343
|
-
notAllowedIn: [
|
|
342
|
+
allowedIn: ["top-level", "page", "group", "array", "row", "container"],
|
|
343
|
+
notAllowedIn: [],
|
|
344
344
|
canContain: [
|
|
345
345
|
"group",
|
|
346
346
|
"array",
|
|
347
|
+
"container",
|
|
348
|
+
"row",
|
|
349
|
+
"hidden",
|
|
347
350
|
"input",
|
|
348
351
|
"textarea",
|
|
349
352
|
"select",
|
|
@@ -359,7 +362,7 @@ var FIELD_TYPES = [
|
|
|
359
362
|
"next",
|
|
360
363
|
"previous"
|
|
361
364
|
],
|
|
362
|
-
cannotContain: ["page"
|
|
365
|
+
cannotContain: ["page"],
|
|
363
366
|
example: `{
|
|
364
367
|
key: 'nameRow',
|
|
365
368
|
type: 'row',
|
|
@@ -371,9 +374,7 @@ var FIELD_TYPES = [
|
|
|
371
374
|
]
|
|
372
375
|
}
|
|
373
376
|
// NOT ALLOWED in rows:
|
|
374
|
-
// - type: '
|
|
375
|
-
// - type: 'page' (pages are top-level only)
|
|
376
|
-
// - type: 'row' (no nested rows)`,
|
|
377
|
+
// - type: 'page' (pages are top-level only)`,
|
|
377
378
|
minimalExample: `{ key: 'row1', type: 'row', fields: [...] }`
|
|
378
379
|
},
|
|
379
380
|
{
|
|
@@ -6933,10 +6934,8 @@ Included in form value but not rendered.
|
|
|
6933
6934
|
|
|
6934
6935
|
Use \`col\` (1-12) on child fields for grid width. Row is purely for layout. Supports only \`hidden\` logic type for conditional visibility.
|
|
6935
6936
|
|
|
6936
|
-
**Allowed children:** groups, arrays, value fields (input, select, checkbox, etc.)
|
|
6937
|
-
**NOT allowed:** \`
|
|
6938
|
-
|
|
6939
|
-
\u26A0\uFE0F **Common mistake:** Putting hidden fields inside rows - hidden fields should be at page or form level, not in rows.`
|
|
6937
|
+
**Allowed children:** groups, arrays, containers, nested rows, hidden fields, value fields (input, select, checkbox, etc.)
|
|
6938
|
+
**NOT allowed:** \`page\` containers`
|
|
6940
6939
|
},
|
|
6941
6940
|
array: {
|
|
6942
6941
|
brief: `**Two APIs available:**
|
|
@@ -7352,8 +7351,15 @@ logic: [{ type: 'derivation', expression: '...', stopOnUserOverride: true, reEng
|
|
|
7352
7351
|
|
|
7353
7352
|
// HTTP derivation (server-driven values)
|
|
7354
7353
|
logic: [{ type: 'derivation', source: 'http', http: { url: '/api/rate', queryParams: { from: 'formValue.currency' } }, responseExpression: 'response.rate', dependsOn: ['currency'] }]
|
|
7354
|
+
|
|
7355
|
+
// Self-dependency token: $self resolves to the field's own absolute path at collection time
|
|
7356
|
+
logic: [{ type: 'derivation', functionName: 'uppercase', dependsOn: ['$self'] }]
|
|
7357
|
+
|
|
7358
|
+
// Parent-container token: $group resolves to the field's nearest parent group/array path
|
|
7359
|
+
logic: [{ type: 'derivation', functionName: 'computeFromGroup', dependsOn: ['$group'] }]
|
|
7355
7360
|
\`\`\`
|
|
7356
7361
|
Derivation is always defined ON the field that receives the computed value (self-targeting).
|
|
7362
|
+
\`dependsOn\` paths are absolute from the form root (e.g. \`'address.state'\`). Use \`'$self'\` for the field's own absolute path and \`'$group'\` for its nearest parent group/array \u2014 both useful in factory-built fields where ancestor keys aren't known at config time.
|
|
7357
7363
|
**Variables:** \`formValue\`, \`fieldValue\`, \`fieldState\`, \`formFieldState\`, \`externalData\` (see topic: expression-variables)
|
|
7358
7364
|
**For deriving component properties** (minDate, options, label): use \`targetProperty\` (see topic \`property-derivation\`)`,
|
|
7359
7365
|
full: `# Value Derivation (Computed Fields)
|
|
@@ -7417,6 +7423,98 @@ Derivations are always defined ON the field that receives the computed value (se
|
|
|
7417
7423
|
}
|
|
7418
7424
|
\`\`\`
|
|
7419
7425
|
|
|
7426
|
+
## \`dependsOn\` Path Resolution
|
|
7427
|
+
|
|
7428
|
+
\`dependsOn\` paths are **absolute from the form root**, dotted notation. A field nested under a group has the group's key in its path:
|
|
7429
|
+
|
|
7430
|
+
\`\`\`typescript
|
|
7431
|
+
{
|
|
7432
|
+
type: 'group', key: 'address',
|
|
7433
|
+
fields: [
|
|
7434
|
+
{ key: 'state', type: 'input', logic: [{
|
|
7435
|
+
type: 'derivation',
|
|
7436
|
+
functionName: 'uppercaseState',
|
|
7437
|
+
dependsOn: ['address.state'] // absolute path from root
|
|
7438
|
+
}]}
|
|
7439
|
+
]
|
|
7440
|
+
}
|
|
7441
|
+
\`\`\`
|
|
7442
|
+
|
|
7443
|
+
Layout containers (\`page\`, \`row\`, \`container\`) do **not** contribute to the path \u2014 only \`group\` fields do. Array fields use the \`'arrayKey.$.fieldKey'\` placeholder convention.
|
|
7444
|
+
|
|
7445
|
+
### \`$self\` token
|
|
7446
|
+
|
|
7447
|
+
Use \`'$self'\` in \`dependsOn\` to refer to the field's own absolute path. Useful for self-derivations on fields built by factory helpers, where the ancestor group keys aren't known at config-authoring time:
|
|
7448
|
+
|
|
7449
|
+
\`\`\`typescript
|
|
7450
|
+
{
|
|
7451
|
+
type: 'group', key: 'address',
|
|
7452
|
+
fields: [
|
|
7453
|
+
{ key: 'state', type: 'input', logic: [{
|
|
7454
|
+
type: 'derivation',
|
|
7455
|
+
functionName: 'uppercaseState',
|
|
7456
|
+
dependsOn: ['$self'] // resolves to 'address.state' at collection time
|
|
7457
|
+
}]}
|
|
7458
|
+
]
|
|
7459
|
+
}
|
|
7460
|
+
\`\`\`
|
|
7461
|
+
|
|
7462
|
+
\`$self\` works alongside other absolute deps and inside arrays (resolves to the array placeholder form, e.g. \`'items.$.name'\`).
|
|
7463
|
+
|
|
7464
|
+
### \`$group\` token
|
|
7465
|
+
|
|
7466
|
+
Use \`'$group'\` in \`dependsOn\` to refer to the field's **nearest parent container** (group or array). The derivation fires whenever any sibling under the same parent changes \u2014 handy when you don't want to enumerate each sibling explicitly:
|
|
7467
|
+
|
|
7468
|
+
\`\`\`typescript
|
|
7469
|
+
{
|
|
7470
|
+
type: 'group', key: 'address',
|
|
7471
|
+
fields: [
|
|
7472
|
+
{ key: 'country', type: 'input' },
|
|
7473
|
+
{ key: 'state', type: 'input', logic: [{
|
|
7474
|
+
type: 'derivation',
|
|
7475
|
+
functionName: 'pickStateFromCountry',
|
|
7476
|
+
dependsOn: ['$group'] // resolves to 'address' at collection time
|
|
7477
|
+
}]}
|
|
7478
|
+
]
|
|
7479
|
+
}
|
|
7480
|
+
\`\`\`
|
|
7481
|
+
|
|
7482
|
+
Resolution rules:
|
|
7483
|
+
- Inside group(s) only \u2192 the dotted ancestor group path (\`'address'\` or \`'org.address'\`).
|
|
7484
|
+
- Directly inside an array \u2192 the array key (\`'items'\`). Fires on any item change.
|
|
7485
|
+
- Inside group(s) inside an array \u2192 \`'items.$.address'\` form.
|
|
7486
|
+
- At form root \u2192 throws \`DynamicFormError\` (no parent container exists).
|
|
7487
|
+
|
|
7488
|
+
### Token prefix substitution
|
|
7489
|
+
|
|
7490
|
+
Both \`$self\` and \`$group\` accept a dotted suffix that is appended to the resolved path:
|
|
7491
|
+
|
|
7492
|
+
\`\`\`typescript
|
|
7493
|
+
dependsOn: ['$group.country'] // resolves to 'address.country' inside group 'address'
|
|
7494
|
+
dependsOn: ['$group.contact.email'] // multi-segment suffix supported
|
|
7495
|
+
dependsOn: ['$self.flag'] // resolves to '<fieldKey>.flag' (object-valued fields)
|
|
7496
|
+
\`\`\`
|
|
7497
|
+
|
|
7498
|
+
Use this to target a specific sibling without naming the parent group key \u2014 handy in factory-built field shapes.
|
|
7499
|
+
|
|
7500
|
+
### \`groupValue\` in evaluation context
|
|
7501
|
+
|
|
7502
|
+
Custom derivation functions and expressions receive a \`groupValue\` on the \`EvaluationContext\` that mirrors the \`$group\` token at evaluation time:
|
|
7503
|
+
|
|
7504
|
+
\`\`\`typescript
|
|
7505
|
+
deriveStateFromCountry: (ctx) => {
|
|
7506
|
+
const country = ctx.groupValue?.country; // no need to know the parent key
|
|
7507
|
+
return country === 'usa' ? 'NY' : '';
|
|
7508
|
+
}
|
|
7509
|
+
\`\`\`
|
|
7510
|
+
|
|
7511
|
+
Population rules:
|
|
7512
|
+
- Inside a group: the parent group's value object.
|
|
7513
|
+
- Inside nested groups: the innermost parent group's value.
|
|
7514
|
+
- Directly inside an array item (no inner group): the array item itself (same as \`formValue\` in array context).
|
|
7515
|
+
- Inside a group inside an array item: the inner group's value within the item.
|
|
7516
|
+
- Field at form root: \`undefined\`.
|
|
7517
|
+
|
|
7420
7518
|
## HTTP Derivation (Server-Driven Values)
|
|
7421
7519
|
|
|
7422
7520
|
Fetch derived values from an HTTP endpoint. Requires \`dependsOn\` (explicit) and \`responseExpression\`.
|
|
@@ -8221,7 +8319,7 @@ provideDynamicForm({
|
|
|
8221
8319
|
| page | NO | hidden only | Nav buttons INSIDE |
|
|
8222
8320
|
| group | NO | hidden only | Creates nested object |
|
|
8223
8321
|
| array | NO | hidden only | Two APIs: \`template\`+\`value\` (simplified) or \`fields\` (full) |
|
|
8224
|
-
| row | NO | hidden only | Layout only
|
|
8322
|
+
| row | NO | hidden only | Layout only |`,
|
|
8225
8323
|
full: `# Container Rules
|
|
8226
8324
|
|
|
8227
8325
|
| Container | Label? | Logic? | Allowed Children | Notes |
|
|
@@ -8229,17 +8327,16 @@ provideDynamicForm({
|
|
|
8229
8327
|
| page | NO | YES (hidden only) | rows, groups, arrays, leaf fields, buttons | Nav buttons go INSIDE |
|
|
8230
8328
|
| group | NO | YES (hidden only) | rows, leaf fields (NOT pages, groups) | Creates nested object |
|
|
8231
8329
|
| array | NO | YES (hidden only) | rows, groups, leaf fields (NOT pages, arrays) | Two APIs: \`template\`+\`value\` (simplified) or \`fields\` (full) |
|
|
8232
|
-
| row | NO | YES (hidden only) | groups, arrays, leaf fields (NOT
|
|
8330
|
+
| row | NO | YES (hidden only) | groups, arrays, containers, nested rows, hidden fields, leaf fields (NOT pages) | Layout only |
|
|
8233
8331
|
|
|
8234
8332
|
**CRITICAL:**
|
|
8235
8333
|
- All containers (page, group, row, array) support only the \`hidden\` logic type for conditional visibility.
|
|
8236
8334
|
- For other logic types (disabled, required, readonly, derivation), apply them to child fields instead.
|
|
8237
|
-
- Hidden fields cannot be inside rows - place them at page/form level.
|
|
8238
8335
|
- Pages cannot be nested - ALL top-level fields must be pages if using multi-page mode.`
|
|
8239
8336
|
},
|
|
8240
8337
|
"field-placement": {
|
|
8241
8338
|
brief: `**Multi-page:** ALL root fields must be pages. Hidden fields go INSIDE first page.
|
|
8242
|
-
**Rows:** NO
|
|
8339
|
+
**Rows:** NO pages
|
|
8243
8340
|
**Groups:** NO nested groups, NO pages`,
|
|
8244
8341
|
full: `# Field Placement Rules
|
|
8245
8342
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-forge/dynamic-form-mcp",
|
|
3
|
-
"version": "0.8.0-next.
|
|
3
|
+
"version": "0.8.0-next.5",
|
|
4
4
|
"description": "MCP server for ng-forge dynamic forms - AI-assisted form schema generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"zod": "^3.25.76"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@ng-forge/dynamic-forms": "^0.8.0-next.
|
|
55
|
-
"@ng-forge/dynamic-forms-bootstrap": "^0.8.0-next.
|
|
56
|
-
"@ng-forge/dynamic-forms-ionic": "^0.8.0-next.
|
|
57
|
-
"@ng-forge/dynamic-forms-material": "^0.8.0-next.
|
|
58
|
-
"@ng-forge/dynamic-forms-primeng": "^0.8.0-next.
|
|
54
|
+
"@ng-forge/dynamic-forms": "^0.8.0-next.5",
|
|
55
|
+
"@ng-forge/dynamic-forms-bootstrap": "^0.8.0-next.5",
|
|
56
|
+
"@ng-forge/dynamic-forms-ionic": "^0.8.0-next.5",
|
|
57
|
+
"@ng-forge/dynamic-forms-material": "^0.8.0-next.5",
|
|
58
|
+
"@ng-forge/dynamic-forms-primeng": "^0.8.0-next.5",
|
|
59
59
|
"tsx": "^4.19.0"
|
|
60
60
|
}
|
|
61
61
|
}
|
package/src/index.js
CHANGED
|
@@ -331,17 +331,20 @@ var FIELD_TYPES = [
|
|
|
331
331
|
fields: {
|
|
332
332
|
name: "fields",
|
|
333
333
|
type: "RowAllowedChildren[]",
|
|
334
|
-
description: "Child fields to render horizontally. Allowed: groups, arrays,
|
|
334
|
+
description: "Child fields to render horizontally. Allowed: groups, arrays, containers, nested rows, hidden fields, and value fields (input, select, etc). NOT ALLOWED: pages",
|
|
335
335
|
required: true
|
|
336
336
|
}
|
|
337
337
|
},
|
|
338
338
|
validationSupported: false,
|
|
339
339
|
source: "core",
|
|
340
|
-
allowedIn: ["top-level", "page", "group", "array"],
|
|
341
|
-
notAllowedIn: [
|
|
340
|
+
allowedIn: ["top-level", "page", "group", "array", "row", "container"],
|
|
341
|
+
notAllowedIn: [],
|
|
342
342
|
canContain: [
|
|
343
343
|
"group",
|
|
344
344
|
"array",
|
|
345
|
+
"container",
|
|
346
|
+
"row",
|
|
347
|
+
"hidden",
|
|
345
348
|
"input",
|
|
346
349
|
"textarea",
|
|
347
350
|
"select",
|
|
@@ -357,7 +360,7 @@ var FIELD_TYPES = [
|
|
|
357
360
|
"next",
|
|
358
361
|
"previous"
|
|
359
362
|
],
|
|
360
|
-
cannotContain: ["page"
|
|
363
|
+
cannotContain: ["page"],
|
|
361
364
|
example: `{
|
|
362
365
|
key: 'nameRow',
|
|
363
366
|
type: 'row',
|
|
@@ -369,9 +372,7 @@ var FIELD_TYPES = [
|
|
|
369
372
|
]
|
|
370
373
|
}
|
|
371
374
|
// NOT ALLOWED in rows:
|
|
372
|
-
// - type: '
|
|
373
|
-
// - type: 'page' (pages are top-level only)
|
|
374
|
-
// - type: 'row' (no nested rows)`,
|
|
375
|
+
// - type: 'page' (pages are top-level only)`,
|
|
375
376
|
minimalExample: `{ key: 'row1', type: 'row', fields: [...] }`
|
|
376
377
|
},
|
|
377
378
|
{
|
|
@@ -6982,10 +6983,8 @@ Included in form value but not rendered.
|
|
|
6982
6983
|
|
|
6983
6984
|
Use \`col\` (1-12) on child fields for grid width. Row is purely for layout. Supports only \`hidden\` logic type for conditional visibility.
|
|
6984
6985
|
|
|
6985
|
-
**Allowed children:** groups, arrays, value fields (input, select, checkbox, etc.)
|
|
6986
|
-
**NOT allowed:** \`
|
|
6987
|
-
|
|
6988
|
-
\u26A0\uFE0F **Common mistake:** Putting hidden fields inside rows - hidden fields should be at page or form level, not in rows.`
|
|
6986
|
+
**Allowed children:** groups, arrays, containers, nested rows, hidden fields, value fields (input, select, checkbox, etc.)
|
|
6987
|
+
**NOT allowed:** \`page\` containers`
|
|
6989
6988
|
},
|
|
6990
6989
|
array: {
|
|
6991
6990
|
brief: `**Two APIs available:**
|
|
@@ -7401,8 +7400,15 @@ logic: [{ type: 'derivation', expression: '...', stopOnUserOverride: true, reEng
|
|
|
7401
7400
|
|
|
7402
7401
|
// HTTP derivation (server-driven values)
|
|
7403
7402
|
logic: [{ type: 'derivation', source: 'http', http: { url: '/api/rate', queryParams: { from: 'formValue.currency' } }, responseExpression: 'response.rate', dependsOn: ['currency'] }]
|
|
7403
|
+
|
|
7404
|
+
// Self-dependency token: $self resolves to the field's own absolute path at collection time
|
|
7405
|
+
logic: [{ type: 'derivation', functionName: 'uppercase', dependsOn: ['$self'] }]
|
|
7406
|
+
|
|
7407
|
+
// Parent-container token: $group resolves to the field's nearest parent group/array path
|
|
7408
|
+
logic: [{ type: 'derivation', functionName: 'computeFromGroup', dependsOn: ['$group'] }]
|
|
7404
7409
|
\`\`\`
|
|
7405
7410
|
Derivation is always defined ON the field that receives the computed value (self-targeting).
|
|
7411
|
+
\`dependsOn\` paths are absolute from the form root (e.g. \`'address.state'\`). Use \`'$self'\` for the field's own absolute path and \`'$group'\` for its nearest parent group/array \u2014 both useful in factory-built fields where ancestor keys aren't known at config time.
|
|
7406
7412
|
**Variables:** \`formValue\`, \`fieldValue\`, \`fieldState\`, \`formFieldState\`, \`externalData\` (see topic: expression-variables)
|
|
7407
7413
|
**For deriving component properties** (minDate, options, label): use \`targetProperty\` (see topic \`property-derivation\`)`,
|
|
7408
7414
|
full: `# Value Derivation (Computed Fields)
|
|
@@ -7466,6 +7472,98 @@ Derivations are always defined ON the field that receives the computed value (se
|
|
|
7466
7472
|
}
|
|
7467
7473
|
\`\`\`
|
|
7468
7474
|
|
|
7475
|
+
## \`dependsOn\` Path Resolution
|
|
7476
|
+
|
|
7477
|
+
\`dependsOn\` paths are **absolute from the form root**, dotted notation. A field nested under a group has the group's key in its path:
|
|
7478
|
+
|
|
7479
|
+
\`\`\`typescript
|
|
7480
|
+
{
|
|
7481
|
+
type: 'group', key: 'address',
|
|
7482
|
+
fields: [
|
|
7483
|
+
{ key: 'state', type: 'input', logic: [{
|
|
7484
|
+
type: 'derivation',
|
|
7485
|
+
functionName: 'uppercaseState',
|
|
7486
|
+
dependsOn: ['address.state'] // absolute path from root
|
|
7487
|
+
}]}
|
|
7488
|
+
]
|
|
7489
|
+
}
|
|
7490
|
+
\`\`\`
|
|
7491
|
+
|
|
7492
|
+
Layout containers (\`page\`, \`row\`, \`container\`) do **not** contribute to the path \u2014 only \`group\` fields do. Array fields use the \`'arrayKey.$.fieldKey'\` placeholder convention.
|
|
7493
|
+
|
|
7494
|
+
### \`$self\` token
|
|
7495
|
+
|
|
7496
|
+
Use \`'$self'\` in \`dependsOn\` to refer to the field's own absolute path. Useful for self-derivations on fields built by factory helpers, where the ancestor group keys aren't known at config-authoring time:
|
|
7497
|
+
|
|
7498
|
+
\`\`\`typescript
|
|
7499
|
+
{
|
|
7500
|
+
type: 'group', key: 'address',
|
|
7501
|
+
fields: [
|
|
7502
|
+
{ key: 'state', type: 'input', logic: [{
|
|
7503
|
+
type: 'derivation',
|
|
7504
|
+
functionName: 'uppercaseState',
|
|
7505
|
+
dependsOn: ['$self'] // resolves to 'address.state' at collection time
|
|
7506
|
+
}]}
|
|
7507
|
+
]
|
|
7508
|
+
}
|
|
7509
|
+
\`\`\`
|
|
7510
|
+
|
|
7511
|
+
\`$self\` works alongside other absolute deps and inside arrays (resolves to the array placeholder form, e.g. \`'items.$.name'\`).
|
|
7512
|
+
|
|
7513
|
+
### \`$group\` token
|
|
7514
|
+
|
|
7515
|
+
Use \`'$group'\` in \`dependsOn\` to refer to the field's **nearest parent container** (group or array). The derivation fires whenever any sibling under the same parent changes \u2014 handy when you don't want to enumerate each sibling explicitly:
|
|
7516
|
+
|
|
7517
|
+
\`\`\`typescript
|
|
7518
|
+
{
|
|
7519
|
+
type: 'group', key: 'address',
|
|
7520
|
+
fields: [
|
|
7521
|
+
{ key: 'country', type: 'input' },
|
|
7522
|
+
{ key: 'state', type: 'input', logic: [{
|
|
7523
|
+
type: 'derivation',
|
|
7524
|
+
functionName: 'pickStateFromCountry',
|
|
7525
|
+
dependsOn: ['$group'] // resolves to 'address' at collection time
|
|
7526
|
+
}]}
|
|
7527
|
+
]
|
|
7528
|
+
}
|
|
7529
|
+
\`\`\`
|
|
7530
|
+
|
|
7531
|
+
Resolution rules:
|
|
7532
|
+
- Inside group(s) only \u2192 the dotted ancestor group path (\`'address'\` or \`'org.address'\`).
|
|
7533
|
+
- Directly inside an array \u2192 the array key (\`'items'\`). Fires on any item change.
|
|
7534
|
+
- Inside group(s) inside an array \u2192 \`'items.$.address'\` form.
|
|
7535
|
+
- At form root \u2192 throws \`DynamicFormError\` (no parent container exists).
|
|
7536
|
+
|
|
7537
|
+
### Token prefix substitution
|
|
7538
|
+
|
|
7539
|
+
Both \`$self\` and \`$group\` accept a dotted suffix that is appended to the resolved path:
|
|
7540
|
+
|
|
7541
|
+
\`\`\`typescript
|
|
7542
|
+
dependsOn: ['$group.country'] // resolves to 'address.country' inside group 'address'
|
|
7543
|
+
dependsOn: ['$group.contact.email'] // multi-segment suffix supported
|
|
7544
|
+
dependsOn: ['$self.flag'] // resolves to '<fieldKey>.flag' (object-valued fields)
|
|
7545
|
+
\`\`\`
|
|
7546
|
+
|
|
7547
|
+
Use this to target a specific sibling without naming the parent group key \u2014 handy in factory-built field shapes.
|
|
7548
|
+
|
|
7549
|
+
### \`groupValue\` in evaluation context
|
|
7550
|
+
|
|
7551
|
+
Custom derivation functions and expressions receive a \`groupValue\` on the \`EvaluationContext\` that mirrors the \`$group\` token at evaluation time:
|
|
7552
|
+
|
|
7553
|
+
\`\`\`typescript
|
|
7554
|
+
deriveStateFromCountry: (ctx) => {
|
|
7555
|
+
const country = ctx.groupValue?.country; // no need to know the parent key
|
|
7556
|
+
return country === 'usa' ? 'NY' : '';
|
|
7557
|
+
}
|
|
7558
|
+
\`\`\`
|
|
7559
|
+
|
|
7560
|
+
Population rules:
|
|
7561
|
+
- Inside a group: the parent group's value object.
|
|
7562
|
+
- Inside nested groups: the innermost parent group's value.
|
|
7563
|
+
- Directly inside an array item (no inner group): the array item itself (same as \`formValue\` in array context).
|
|
7564
|
+
- Inside a group inside an array item: the inner group's value within the item.
|
|
7565
|
+
- Field at form root: \`undefined\`.
|
|
7566
|
+
|
|
7469
7567
|
## HTTP Derivation (Server-Driven Values)
|
|
7470
7568
|
|
|
7471
7569
|
Fetch derived values from an HTTP endpoint. Requires \`dependsOn\` (explicit) and \`responseExpression\`.
|
|
@@ -8270,7 +8368,7 @@ provideDynamicForm({
|
|
|
8270
8368
|
| page | NO | hidden only | Nav buttons INSIDE |
|
|
8271
8369
|
| group | NO | hidden only | Creates nested object |
|
|
8272
8370
|
| array | NO | hidden only | Two APIs: \`template\`+\`value\` (simplified) or \`fields\` (full) |
|
|
8273
|
-
| row | NO | hidden only | Layout only
|
|
8371
|
+
| row | NO | hidden only | Layout only |`,
|
|
8274
8372
|
full: `# Container Rules
|
|
8275
8373
|
|
|
8276
8374
|
| Container | Label? | Logic? | Allowed Children | Notes |
|
|
@@ -8278,17 +8376,16 @@ provideDynamicForm({
|
|
|
8278
8376
|
| page | NO | YES (hidden only) | rows, groups, arrays, leaf fields, buttons | Nav buttons go INSIDE |
|
|
8279
8377
|
| group | NO | YES (hidden only) | rows, leaf fields (NOT pages, groups) | Creates nested object |
|
|
8280
8378
|
| array | NO | YES (hidden only) | rows, groups, leaf fields (NOT pages, arrays) | Two APIs: \`template\`+\`value\` (simplified) or \`fields\` (full) |
|
|
8281
|
-
| row | NO | YES (hidden only) | groups, arrays, leaf fields (NOT
|
|
8379
|
+
| row | NO | YES (hidden only) | groups, arrays, containers, nested rows, hidden fields, leaf fields (NOT pages) | Layout only |
|
|
8282
8380
|
|
|
8283
8381
|
**CRITICAL:**
|
|
8284
8382
|
- All containers (page, group, row, array) support only the \`hidden\` logic type for conditional visibility.
|
|
8285
8383
|
- For other logic types (disabled, required, readonly, derivation), apply them to child fields instead.
|
|
8286
|
-
- Hidden fields cannot be inside rows - place them at page/form level.
|
|
8287
8384
|
- Pages cannot be nested - ALL top-level fields must be pages if using multi-page mode.`
|
|
8288
8385
|
},
|
|
8289
8386
|
"field-placement": {
|
|
8290
8387
|
brief: `**Multi-page:** ALL root fields must be pages. Hidden fields go INSIDE first page.
|
|
8291
|
-
**Rows:** NO
|
|
8388
|
+
**Rows:** NO pages
|
|
8292
8389
|
**Groups:** NO nested groups, NO pages`,
|
|
8293
8390
|
full: `# Field Placement Rules
|
|
8294
8391
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-types.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/field-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"field-types.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/field-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,aAAa,EAsqBtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-topics.d.ts","sourceRoot":"","sources":["../../../../../../packages/dynamic-form-mcp/src/tools/data/lookup-topics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"lookup-topics.d.ts","sourceRoot":"","sources":["../../../../../../packages/dynamic-form-mcp/src/tools/data/lookup-topics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAq/ElE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiDrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA4IhD,CAAC"}
|