@ng-forge/dynamic-form-mcp 0.5.1 → 0.6.0

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.
@@ -6,9 +6,9 @@
6
6
  "columns": ["hidden", "disabled", "required", "readonly", "derivation"],
7
7
  "fields": {
8
8
  "page": ["Y", "N", "N", "N", "N"],
9
- "group": ["N", "N", "N", "N", "N"],
10
- "row": ["N", "N", "N", "N", "N"],
11
- "array": ["N", "N", "N", "N", "N"],
9
+ "group": ["Y", "N", "N", "N", "N"],
10
+ "row": ["Y", "N", "N", "N", "N"],
11
+ "array": ["Y", "N", "N", "N", "N"],
12
12
  "input": ["Y", "Y", "Y", "Y", "Y"],
13
13
  "select": ["Y", "Y", "Y", "Y", "Y"],
14
14
  "checkbox": ["Y", "Y", "Y", "Y", "Y"],
@@ -56,7 +56,8 @@
56
56
  },
57
57
  "group": {
58
58
  "hasLabel": false,
59
- "supportsLogic": false,
59
+ "supportsLogic": true,
60
+ "logicTypes": ["hidden"],
60
61
  "allowedChildren": [
61
62
  "row",
62
63
  "input",
@@ -78,7 +79,8 @@
78
79
  },
79
80
  "row": {
80
81
  "hasLabel": false,
81
- "supportsLogic": false,
82
+ "supportsLogic": true,
83
+ "logicTypes": ["hidden"],
82
84
  "allowedChildren": [
83
85
  "group",
84
86
  "array",
@@ -100,7 +102,8 @@
100
102
  },
101
103
  "array": {
102
104
  "hasLabel": false,
103
- "supportsLogic": false,
105
+ "supportsLogic": true,
106
+ "logicTypes": ["hidden"],
104
107
  "allowedChildren": [
105
108
  "row",
106
109
  "group",
@@ -116,7 +119,7 @@
116
119
  "text"
117
120
  ],
118
121
  "notAllowedChildren": ["page", "array", "hidden"],
119
- "notes": "Use 'fields' (NOT 'template'). No minItems/maxItems properties."
122
+ "notes": "Use 'fields' (NOT 'template'). Supports minLength/maxLength for array size validation."
120
123
  }
121
124
  },
122
125
  "fieldReference": {
@@ -141,7 +144,10 @@
141
144
  "col",
142
145
  "logic",
143
146
  "validators",
144
- "validationMessages"
147
+ "validationMessages",
148
+ "excludeValueIfHidden",
149
+ "excludeValueIfDisabled",
150
+ "excludeValueIfReadonly"
145
151
  ],
146
152
  "propsObject": ["type", "placeholder", "appearance", "hint"],
147
153
  "copyPaste": "{ type: 'input', key: 'name', label: 'Name', value: '' }",
@@ -164,7 +170,10 @@
164
170
  "col",
165
171
  "logic",
166
172
  "validators",
167
- "validationMessages"
173
+ "validationMessages",
174
+ "excludeValueIfHidden",
175
+ "excludeValueIfDisabled",
176
+ "excludeValueIfReadonly"
168
177
  ],
169
178
  "propsObject": ["multiple", "placeholder", "appearance"],
170
179
  "copyPaste": "{ type: 'select', key: 'country', label: 'Country', options: [{ value: 'us', label: 'USA' }], value: 'us' }",
@@ -186,7 +195,10 @@
186
195
  "col",
187
196
  "logic",
188
197
  "validators",
189
- "validationMessages"
198
+ "validationMessages",
199
+ "excludeValueIfHidden",
200
+ "excludeValueIfDisabled",
201
+ "excludeValueIfReadonly"
190
202
  ],
191
203
  "propsObject": [],
192
204
  "copyPaste": "{ type: 'radio', key: 'gender', label: 'Gender', options: [{ value: 'm', label: 'Male' }, { value: 'f', label: 'Female' }] }",
@@ -207,7 +219,10 @@
207
219
  "col",
208
220
  "logic",
209
221
  "validators",
210
- "validationMessages"
222
+ "validationMessages",
223
+ "excludeValueIfHidden",
224
+ "excludeValueIfDisabled",
225
+ "excludeValueIfReadonly"
211
226
  ],
212
227
  "propsObject": ["color"],
213
228
  "copyPaste": "{ type: 'checkbox', key: 'accept', label: 'Accept terms', value: false }"
@@ -228,7 +243,10 @@
228
243
  "col",
229
244
  "logic",
230
245
  "validators",
231
- "validationMessages"
246
+ "validationMessages",
247
+ "excludeValueIfHidden",
248
+ "excludeValueIfDisabled",
249
+ "excludeValueIfReadonly"
232
250
  ],
233
251
  "propsObject": [],
234
252
  "copyPaste": "{ type: 'multi-checkbox', key: 'tags', label: 'Tags', options: [{ value: 'a', label: 'A' }], value: [] }",
@@ -251,7 +269,10 @@
251
269
  "col",
252
270
  "logic",
253
271
  "validators",
254
- "validationMessages"
272
+ "validationMessages",
273
+ "excludeValueIfHidden",
274
+ "excludeValueIfDisabled",
275
+ "excludeValueIfReadonly"
255
276
  ],
256
277
  "propsObject": ["rows", "placeholder", "appearance"],
257
278
  "copyPaste": "{ type: 'textarea', key: 'bio', label: 'Bio', props: { rows: 4 } }"
@@ -271,7 +292,10 @@
271
292
  "col",
272
293
  "logic",
273
294
  "validators",
274
- "validationMessages"
295
+ "validationMessages",
296
+ "excludeValueIfHidden",
297
+ "excludeValueIfDisabled",
298
+ "excludeValueIfReadonly"
275
299
  ],
276
300
  "propsObject": ["minDate", "maxDate", "startView", "appearance"],
277
301
  "copyPaste": "{ type: 'datepicker', key: 'dob', label: 'Date of Birth', value: undefined }"
@@ -291,7 +315,10 @@
291
315
  "col",
292
316
  "logic",
293
317
  "validators",
294
- "validationMessages"
318
+ "validationMessages",
319
+ "excludeValueIfHidden",
320
+ "excludeValueIfDisabled",
321
+ "excludeValueIfReadonly"
295
322
  ],
296
323
  "propsObject": ["color"],
297
324
  "copyPaste": "{ type: 'toggle', key: 'notify', label: 'Enable notifications', value: false }"
@@ -314,7 +341,10 @@
314
341
  "col",
315
342
  "logic",
316
343
  "validators",
317
- "validationMessages"
344
+ "validationMessages",
345
+ "excludeValueIfHidden",
346
+ "excludeValueIfDisabled",
347
+ "excludeValueIfReadonly"
318
348
  ],
319
349
  "propsObject": ["thumbLabel", "tickInterval", "color"],
320
350
  "copyPaste": "{ type: 'slider', key: 'rating', label: 'Rating', minValue: 1, maxValue: 10, step: 1, value: 5 }",
@@ -339,26 +369,29 @@
339
369
  "group": {
340
370
  "category": "container",
341
371
  "valueType": "object",
342
- "fieldLevelProps": ["key", "type", "fields"],
372
+ "fieldLevelProps": ["key", "type", "fields", "logic"],
343
373
  "propsObject": [],
344
374
  "copyPaste": "{ type: 'group', key: 'address', fields: [{ type: 'input', key: 'city', label: 'City' }] }",
345
- "doesNotSupport": ["label", "logic"]
375
+ "doesNotSupport": ["label"],
376
+ "notes": "Only supports 'hidden' logic type for conditional visibility."
346
377
  },
347
378
  "row": {
348
379
  "category": "container",
349
380
  "valueType": null,
350
- "fieldLevelProps": ["key", "type", "fields"],
381
+ "fieldLevelProps": ["key", "type", "fields", "logic"],
351
382
  "propsObject": [],
352
383
  "copyPaste": "{ type: 'row', key: 'nameRow', fields: [{ type: 'input', key: 'first', label: 'First', col: 6 }, { type: 'input', key: 'last', label: 'Last', col: 6 }] }",
353
- "doesNotSupport": ["label", "logic"]
384
+ "doesNotSupport": ["label"],
385
+ "notes": "Only supports 'hidden' logic type for conditional visibility."
354
386
  },
355
387
  "array": {
356
388
  "category": "container",
357
389
  "valueType": "T[]",
358
- "fieldLevelProps": ["key", "type", "fields"],
390
+ "fieldLevelProps": ["key", "type", "fields", "logic", "minLength", "maxLength"],
359
391
  "propsObject": [],
360
392
  "copyPaste": "{ type: 'array', key: 'contacts', fields: [{ type: 'group', key: 'item', fields: [{ type: 'input', key: 'name', label: 'Name' }] }] }",
361
- "doesNotSupport": ["label", "logic", "minItems", "maxItems", "template"]
393
+ "doesNotSupport": ["label", "minItems", "maxItems", "template"],
394
+ "notes": "Only supports 'hidden' logic type for conditional visibility. Supports minLength/maxLength for array size validation."
362
395
  },
363
396
  "page": {
364
397
  "category": "container",
@@ -417,8 +450,10 @@
417
450
  "maxLength": "{ type: 'maxLength', value: 50 }",
418
451
  "pattern": "{ type: 'pattern', value: '^[A-Z]+$' }",
419
452
  "custom": "{ type: 'custom', expression: 'fieldValue !== formValue.other', kind: 'errorKind' }",
420
- "customAsync": "{ type: 'customAsync', functionName: 'checkAvailability' }",
421
- "customHttp": "{ type: 'customHttp', functionName: 'validateOnServer' }"
453
+ "async": "{ type: 'async', functionName: 'checkAvailability' }",
454
+ "customAsync": "DEPRECATED — use type: 'async'. { type: 'customAsync', functionName: 'checkAvailability' }",
455
+ "http (function-based)": "{ type: 'http', functionName: 'validateOnServer' }",
456
+ "customHttp": "DEPRECATED — use type: 'http' with functionName. { type: 'customHttp', functionName: 'validateOnServer' }"
422
457
  }
423
458
  },
424
459
  "errorMessages": {
@@ -433,6 +468,9 @@
433
468
  "javascript": "{ type: 'javascript', expression: 'formValue.age >= 18' }",
434
469
  "and": "{ type: 'and', conditions: [...] }",
435
470
  "or": "{ type: 'or', conditions: [...] }",
471
+ "http": "{ type: 'http', http: { url: '/api/check', queryParams: { field: 'formValue.x' } }, responseExpression: 'response.allowed', pendingValue: false, cacheDurationMs: 30000, debounceMs: 300 }",
472
+ "async": "{ type: 'async', asyncFunctionName: 'myAsyncCheck', pendingValue: false, debounceMs: 300 }",
473
+ "custom": "{ type: 'custom', functionName: 'myConditionFn' }",
436
474
  "true": "{ type: 'true' }",
437
475
  "false": "{ type: 'false' }"
438
476
  },
@@ -452,6 +490,19 @@
452
490
  ],
453
491
  "buttonConditions": ["formInvalid", "formSubmitting", "pageInvalid"],
454
492
  "derivationExample": "{ key: 'fullName', derivation: 'formValue.first + \" \" + formValue.last' }",
493
+ "httpDerivationExample": "{ key: 'rate', logic: [{ type: 'derivation', source: 'http', http: { url: '/api/rate', queryParams: { from: 'formValue.currency' } }, responseExpression: 'response.rate', dependsOn: ['currency'] }] }",
494
+ "httpDerivationRules": {
495
+ "source": "REQUIRED - use source: 'http' to select HTTP derivation mode",
496
+ "dependsOn": "REQUIRED - prevents wildcard triggering on every keystroke",
497
+ "responseExpression": "REQUIRED - extracts value from HTTP response body",
498
+ "noArrays": "Array fields (items.$.rate) are NOT supported for HTTP derivations"
499
+ },
500
+ "asyncFunctionDerivationExample": "{ key: 'price', logic: [{ type: 'derivation', source: 'asyncFunction', asyncFunctionName: 'fetchSuggestedPrice', dependsOn: ['productId', 'quantity'] }] }",
501
+ "asyncFunctionDerivationRules": {
502
+ "source": "REQUIRED - use source: 'asyncFunction' to select async derivation mode",
503
+ "dependsOn": "REQUIRED - prevents wildcard triggering on every form change",
504
+ "noWildcard": "Wildcards ('*') are NOT allowed in dependsOn for async derivations"
505
+ },
455
506
  "expressionVariables": {
456
507
  "formValue": "Complete form value object",
457
508
  "fieldValue": "Current field's value"
@@ -500,7 +551,7 @@
500
551
  }
501
552
  },
502
553
  "commonPitfalls": [
503
- "Container fields (group, row, array) do NOT support logic - apply to children instead",
554
+ "Container fields (group, row, array) only support 'hidden' logic type - for other logic types (disabled, required, readonly, derivation), apply to children instead",
504
555
  "options/minValue/maxValue/arrayKey go at FIELD level, NOT in props",
505
556
  "Validators use ctx.value() and ctx.valueOf(), NOT formValue",
506
557
  "Type annotation (: FormConfig) loses inference - use 'as const satisfies'",