@ng-forge/dynamic-form-mcp 0.7.0 → 0.8.0-next.1
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/README.md +6 -0
- package/bin/ng-forge-mcp.js +1503 -594
- package/package.json +6 -6
- package/src/index.js +1503 -594
- package/src/registry/examples.json +326 -83
- package/src/registry/field-types.d.ts.map +1 -1
- package/src/registry/index.d.ts +40 -0
- package/src/registry/index.d.ts.map +1 -1
- package/src/registry/instructions.d.ts +1 -1
- package/src/registry/instructions.d.ts.map +1 -1
- package/src/registry/ui-adapters.d.ts.map +1 -1
- package/src/registry/wrappers.d.ts +26 -0
- package/src/registry/wrappers.d.ts.map +1 -0
- package/src/resources/index.d.ts.map +1 -1
- package/src/resources/wrappers.resource.d.ts +9 -0
- package/src/resources/wrappers.resource.d.ts.map +1 -0
- package/src/tools/data/lookup-topics.d.ts.map +1 -1
- package/src/tools/examples.tool.d.ts +1 -1
- package/src/tools/examples.tool.d.ts.map +1 -1
- package/src/tools/lookup.tool.d.ts.map +1 -1
- package/src/tools/search.tool.d.ts.map +1 -1
package/src/index.js
CHANGED
|
@@ -18,12 +18,6 @@ var FIELD_TYPES = [
|
|
|
18
18
|
description: "HTML input type",
|
|
19
19
|
required: false,
|
|
20
20
|
default: "text"
|
|
21
|
-
},
|
|
22
|
-
placeholder: {
|
|
23
|
-
name: "placeholder",
|
|
24
|
-
type: "DynamicText",
|
|
25
|
-
description: "Placeholder text displayed when field is empty",
|
|
26
|
-
required: false
|
|
27
21
|
}
|
|
28
22
|
},
|
|
29
23
|
validationSupported: true,
|
|
@@ -35,7 +29,8 @@ var FIELD_TYPES = [
|
|
|
35
29
|
label: 'Email Address',
|
|
36
30
|
required: true,
|
|
37
31
|
email: true,
|
|
38
|
-
|
|
32
|
+
placeholder: 'user@example.com',
|
|
33
|
+
props: { type: 'email' }
|
|
39
34
|
}`,
|
|
40
35
|
minimalExample: `{ key: 'name', type: 'input', label: 'Name' }`
|
|
41
36
|
},
|
|
@@ -52,12 +47,6 @@ var FIELD_TYPES = [
|
|
|
52
47
|
description: "Number of visible text lines",
|
|
53
48
|
required: false,
|
|
54
49
|
default: 3
|
|
55
|
-
},
|
|
56
|
-
placeholder: {
|
|
57
|
-
name: "placeholder",
|
|
58
|
-
type: "DynamicText",
|
|
59
|
-
description: "Placeholder text displayed when field is empty",
|
|
60
|
-
required: false
|
|
61
50
|
}
|
|
62
51
|
},
|
|
63
52
|
validationSupported: true,
|
|
@@ -67,7 +56,8 @@ var FIELD_TYPES = [
|
|
|
67
56
|
key: 'description',
|
|
68
57
|
type: 'textarea',
|
|
69
58
|
label: 'Description',
|
|
70
|
-
|
|
59
|
+
placeholder: 'Enter description...',
|
|
60
|
+
props: { rows: 5 }
|
|
71
61
|
}`,
|
|
72
62
|
minimalExample: `{ key: 'bio', type: 'textarea', label: 'Bio' }`
|
|
73
63
|
},
|
|
@@ -90,12 +80,6 @@ var FIELD_TYPES = [
|
|
|
90
80
|
description: "Allow multiple selections",
|
|
91
81
|
required: false,
|
|
92
82
|
default: false
|
|
93
|
-
},
|
|
94
|
-
placeholder: {
|
|
95
|
-
name: "placeholder",
|
|
96
|
-
type: "DynamicText",
|
|
97
|
-
description: "Placeholder text for empty selection",
|
|
98
|
-
required: false
|
|
99
83
|
}
|
|
100
84
|
},
|
|
101
85
|
validationSupported: true,
|
|
@@ -959,6 +943,20 @@ var UI_ADAPTERS = [
|
|
|
959
943
|
required: false,
|
|
960
944
|
default: "dynamic"
|
|
961
945
|
},
|
|
946
|
+
floatLabel: {
|
|
947
|
+
name: "floatLabel",
|
|
948
|
+
type: "'auto' | 'always' | 'never'",
|
|
949
|
+
description: "Label float behavior",
|
|
950
|
+
required: false,
|
|
951
|
+
default: "auto"
|
|
952
|
+
},
|
|
953
|
+
hideRequiredMarker: {
|
|
954
|
+
name: "hideRequiredMarker",
|
|
955
|
+
type: "boolean",
|
|
956
|
+
description: "Hide the required asterisk",
|
|
957
|
+
required: false,
|
|
958
|
+
default: false
|
|
959
|
+
},
|
|
962
960
|
hint: {
|
|
963
961
|
name: "hint",
|
|
964
962
|
type: "DynamicText",
|
|
@@ -977,6 +975,26 @@ var UI_ADAPTERS = [
|
|
|
977
975
|
description: "Material form field appearance",
|
|
978
976
|
required: false,
|
|
979
977
|
default: "outline"
|
|
978
|
+
},
|
|
979
|
+
floatLabel: {
|
|
980
|
+
name: "floatLabel",
|
|
981
|
+
type: "'auto' | 'always' | 'never'",
|
|
982
|
+
description: "Label float behavior",
|
|
983
|
+
required: false,
|
|
984
|
+
default: "auto"
|
|
985
|
+
},
|
|
986
|
+
hideRequiredMarker: {
|
|
987
|
+
name: "hideRequiredMarker",
|
|
988
|
+
type: "boolean",
|
|
989
|
+
description: "Hide the required asterisk",
|
|
990
|
+
required: false,
|
|
991
|
+
default: false
|
|
992
|
+
},
|
|
993
|
+
hint: {
|
|
994
|
+
name: "hint",
|
|
995
|
+
type: "DynamicText",
|
|
996
|
+
description: "Hint text below the field",
|
|
997
|
+
required: false
|
|
980
998
|
}
|
|
981
999
|
}
|
|
982
1000
|
},
|
|
@@ -997,12 +1015,118 @@ var UI_ADAPTERS = [
|
|
|
997
1015
|
type: "datepicker",
|
|
998
1016
|
componentName: "MatDatepickerFieldComponent",
|
|
999
1017
|
additionalProps: {
|
|
1018
|
+
appearance: {
|
|
1019
|
+
name: "appearance",
|
|
1020
|
+
type: "'fill' | 'outline'",
|
|
1021
|
+
description: "Material form field appearance",
|
|
1022
|
+
required: false,
|
|
1023
|
+
default: "outline"
|
|
1024
|
+
},
|
|
1025
|
+
subscriptSizing: {
|
|
1026
|
+
name: "subscriptSizing",
|
|
1027
|
+
type: "'fixed' | 'dynamic'",
|
|
1028
|
+
description: "Error/hint text sizing",
|
|
1029
|
+
required: false,
|
|
1030
|
+
default: "dynamic"
|
|
1031
|
+
},
|
|
1032
|
+
floatLabel: {
|
|
1033
|
+
name: "floatLabel",
|
|
1034
|
+
type: "'auto' | 'always' | 'never'",
|
|
1035
|
+
description: "Label float behavior",
|
|
1036
|
+
required: false,
|
|
1037
|
+
default: "auto"
|
|
1038
|
+
},
|
|
1039
|
+
hideRequiredMarker: {
|
|
1040
|
+
name: "hideRequiredMarker",
|
|
1041
|
+
type: "boolean",
|
|
1042
|
+
description: "Hide the required asterisk",
|
|
1043
|
+
required: false,
|
|
1044
|
+
default: false
|
|
1045
|
+
},
|
|
1000
1046
|
startView: {
|
|
1001
1047
|
name: "startView",
|
|
1002
1048
|
type: "'month' | 'year' | 'multi-year'",
|
|
1003
1049
|
description: "Initial calendar view",
|
|
1004
1050
|
required: false,
|
|
1005
1051
|
default: "month"
|
|
1052
|
+
},
|
|
1053
|
+
touchUi: {
|
|
1054
|
+
name: "touchUi",
|
|
1055
|
+
type: "boolean",
|
|
1056
|
+
description: "Use touch-friendly calendar UI",
|
|
1057
|
+
required: false,
|
|
1058
|
+
default: false
|
|
1059
|
+
},
|
|
1060
|
+
hint: {
|
|
1061
|
+
name: "hint",
|
|
1062
|
+
type: "DynamicText",
|
|
1063
|
+
description: "Hint text below the field",
|
|
1064
|
+
required: false
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
type: "textarea",
|
|
1070
|
+
componentName: "MatTextareaFieldComponent",
|
|
1071
|
+
additionalProps: {
|
|
1072
|
+
appearance: {
|
|
1073
|
+
name: "appearance",
|
|
1074
|
+
type: "'fill' | 'outline'",
|
|
1075
|
+
description: "Material form field appearance",
|
|
1076
|
+
required: false,
|
|
1077
|
+
default: "outline"
|
|
1078
|
+
},
|
|
1079
|
+
subscriptSizing: {
|
|
1080
|
+
name: "subscriptSizing",
|
|
1081
|
+
type: "'fixed' | 'dynamic'",
|
|
1082
|
+
description: "Error/hint text sizing",
|
|
1083
|
+
required: false,
|
|
1084
|
+
default: "dynamic"
|
|
1085
|
+
},
|
|
1086
|
+
floatLabel: {
|
|
1087
|
+
name: "floatLabel",
|
|
1088
|
+
type: "'auto' | 'always' | 'never'",
|
|
1089
|
+
description: "Label float behavior",
|
|
1090
|
+
required: false,
|
|
1091
|
+
default: "auto"
|
|
1092
|
+
},
|
|
1093
|
+
hideRequiredMarker: {
|
|
1094
|
+
name: "hideRequiredMarker",
|
|
1095
|
+
type: "boolean",
|
|
1096
|
+
description: "Hide the required asterisk",
|
|
1097
|
+
required: false,
|
|
1098
|
+
default: false
|
|
1099
|
+
},
|
|
1100
|
+
hint: {
|
|
1101
|
+
name: "hint",
|
|
1102
|
+
type: "DynamicText",
|
|
1103
|
+
description: "Hint text below the field",
|
|
1104
|
+
required: false
|
|
1105
|
+
},
|
|
1106
|
+
rows: {
|
|
1107
|
+
name: "rows",
|
|
1108
|
+
type: "number",
|
|
1109
|
+
description: "Visible row count",
|
|
1110
|
+
required: false
|
|
1111
|
+
},
|
|
1112
|
+
cols: {
|
|
1113
|
+
name: "cols",
|
|
1114
|
+
type: "number",
|
|
1115
|
+
description: "Visible column count",
|
|
1116
|
+
required: false
|
|
1117
|
+
},
|
|
1118
|
+
resize: {
|
|
1119
|
+
name: "resize",
|
|
1120
|
+
type: "'none' | 'both' | 'horizontal' | 'vertical'",
|
|
1121
|
+
description: "Resize handle behavior",
|
|
1122
|
+
required: false,
|
|
1123
|
+
default: "vertical"
|
|
1124
|
+
},
|
|
1125
|
+
maxLength: {
|
|
1126
|
+
name: "maxLength",
|
|
1127
|
+
type: "number",
|
|
1128
|
+
description: "Maximum character length",
|
|
1129
|
+
required: false
|
|
1006
1130
|
}
|
|
1007
1131
|
}
|
|
1008
1132
|
}
|
|
@@ -1277,6 +1401,160 @@ var DOCUMENTATION = [
|
|
|
1277
1401
|
{ id: "example-array", title: "Complete Array Form", category: "examples", url: `${BASE_URL}/examples/array-form` }
|
|
1278
1402
|
];
|
|
1279
1403
|
|
|
1404
|
+
// packages/dynamic-form-mcp/src/registry/wrappers.ts
|
|
1405
|
+
var WRAPPER_AUTHORING_CONTRACT = `All wrapper components MUST:
|
|
1406
|
+
|
|
1407
|
+
1. Implement \`FieldWrapperContract\` from \`@ng-forge/dynamic-forms\`.
|
|
1408
|
+
2. Expose \`readonly fieldComponent = viewChild.required('fieldComponent', { read: ViewContainerRef });\`
|
|
1409
|
+
\u2014 this is the slot where the inner wrapper (or the field) is rendered
|
|
1410
|
+
imperatively by the outlet.
|
|
1411
|
+
3. Place the \`#fieldComponent\` template ref UNCONDITIONALLY. It cannot
|
|
1412
|
+
live inside \`@if\`, \`@defer\`, \`@for\`, \`@switch\`, \`<ng-template>\`,
|
|
1413
|
+
or any structural directive that delays view creation. The outlet reads
|
|
1414
|
+
the \`ViewContainerRef\` immediately after creation \u2014 if the slot isn't
|
|
1415
|
+
materialised yet, \`viewChild.required\` throws \`NG0951\`
|
|
1416
|
+
(REQUIRED_QUERY_NO_VALUE), the wrapper chain is torn down, and the field
|
|
1417
|
+
renders bare.
|
|
1418
|
+
4. Declare every config key the wrapper consumes as an Angular \`input()\`.
|
|
1419
|
+
Unknown keys are silently dropped \u2014 the outlet probes
|
|
1420
|
+
\`reflectComponentType(...).inputs\` before calling \`setInput()\`.
|
|
1421
|
+
Runtime typos in config will NOT throw; rely on TypeScript (via
|
|
1422
|
+
\`FieldRegistryWrappers\` module augmentation) to catch them.
|
|
1423
|
+
5. Optionally accept \`fieldInputs: input<WrapperFieldInputs>()\` to read
|
|
1424
|
+
the wrapped field's mapper outputs and read-only form state.`;
|
|
1425
|
+
var WRAPPERS = [
|
|
1426
|
+
{
|
|
1427
|
+
type: "css",
|
|
1428
|
+
category: "core",
|
|
1429
|
+
availability: "shipping",
|
|
1430
|
+
package: "@ng-forge/dynamic-forms",
|
|
1431
|
+
description: "Invisible wrapper that applies CSS classes to the host element via a `DynamicText` input. Useful for decorating any field (or container) with styling without authoring a custom wrapper. Resolves `Signal<string>` / `Observable<string>` / `string` uniformly.",
|
|
1432
|
+
props: {
|
|
1433
|
+
cssClasses: {
|
|
1434
|
+
name: "cssClasses",
|
|
1435
|
+
type: "DynamicText",
|
|
1436
|
+
description: "Space-separated CSS class names to apply to the wrapper host element. Accepts a literal string, a Signal<string>, or an Observable<string> \u2014 the wrapper subscribes and updates the host [class] binding reactively.",
|
|
1437
|
+
required: false
|
|
1438
|
+
}
|
|
1439
|
+
},
|
|
1440
|
+
autoAppliesTo: [],
|
|
1441
|
+
componentName: "CssWrapperComponent",
|
|
1442
|
+
contract: WRAPPER_AUTHORING_CONTRACT,
|
|
1443
|
+
example: `// Field-level CSS wrapper (scoped to a single field)
|
|
1444
|
+
{
|
|
1445
|
+
key: 'email',
|
|
1446
|
+
type: 'input',
|
|
1447
|
+
label: 'Email',
|
|
1448
|
+
wrappers: [{ type: 'css', cssClasses: 'field--highlight' }]
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
// Dynamic classes via Signal<string>
|
|
1452
|
+
{
|
|
1453
|
+
key: 'amount',
|
|
1454
|
+
type: 'input',
|
|
1455
|
+
label: 'Amount',
|
|
1456
|
+
wrappers: [{ type: 'css', cssClasses: highlightClass }] // highlightClass: Signal<string>
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
// Chained with other wrappers (outer-most first)
|
|
1460
|
+
{
|
|
1461
|
+
key: 'contact',
|
|
1462
|
+
type: 'group',
|
|
1463
|
+
wrappers: [
|
|
1464
|
+
{ type: 'section', title: 'Contact' }, // outer
|
|
1465
|
+
{ type: 'css', cssClasses: 'pad-lg' } // inner
|
|
1466
|
+
],
|
|
1467
|
+
fields: [...]
|
|
1468
|
+
}`,
|
|
1469
|
+
minimalExample: `{ type: 'css', cssClasses: 'my-class' }`
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
type: "arraySection",
|
|
1473
|
+
category: "demo",
|
|
1474
|
+
availability: "demo-only",
|
|
1475
|
+
package: "@internal/examples-shared-ui",
|
|
1476
|
+
description: 'Demo wrapper used by the docs sandbox. Wraps an array field in a titled card whose header contains an "Add" button \u2014 the wrapper owns the append behaviour, dispatching `arrayEvent(key).append(itemTemplate)` on click via the `EventBus`. Lets the consumer config drop the separate `addArrayItem` button field. NOT a shipping primitive; copy the component out of `internal/examples-shared-ui/src/lib/demo-wrappers/` or author your own if you want this pattern in production.',
|
|
1477
|
+
props: {
|
|
1478
|
+
title: {
|
|
1479
|
+
name: "title",
|
|
1480
|
+
type: "string",
|
|
1481
|
+
description: "Card header text rendered above the array.",
|
|
1482
|
+
required: false
|
|
1483
|
+
},
|
|
1484
|
+
addLabel: {
|
|
1485
|
+
name: "addLabel",
|
|
1486
|
+
type: "string",
|
|
1487
|
+
description: 'Text for the Add button in the header. Defaults to "Add" when omitted.',
|
|
1488
|
+
required: false
|
|
1489
|
+
},
|
|
1490
|
+
itemTemplate: {
|
|
1491
|
+
name: "itemTemplate",
|
|
1492
|
+
type: "FieldDef<unknown> | readonly FieldDef<unknown>[]",
|
|
1493
|
+
description: "Template passed to `arrayEvent(key).append(template)` when the Add button is clicked. Should match the array's `fields` shape.",
|
|
1494
|
+
required: true
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
autoAppliesTo: [],
|
|
1498
|
+
componentName: "ArraySectionWrapperComponent",
|
|
1499
|
+
contract: WRAPPER_AUTHORING_CONTRACT,
|
|
1500
|
+
example: `// Array wrapped with arraySection \u2014 the wrapper owns the Add button
|
|
1501
|
+
import { arrayEvent } from '@ng-forge/dynamic-forms';
|
|
1502
|
+
|
|
1503
|
+
const tagItemTemplate = { key: 'tag', type: 'input', label: 'Tag' } as const satisfies FieldDef;
|
|
1504
|
+
|
|
1505
|
+
{
|
|
1506
|
+
key: 'tags',
|
|
1507
|
+
type: 'array',
|
|
1508
|
+
wrappers: [{
|
|
1509
|
+
type: 'arraySection',
|
|
1510
|
+
title: 'Tags',
|
|
1511
|
+
addLabel: 'Add tag',
|
|
1512
|
+
itemTemplate: tagItemTemplate,
|
|
1513
|
+
}],
|
|
1514
|
+
fields: [tagItemTemplate],
|
|
1515
|
+
}
|
|
1516
|
+
// Clicking the header button dispatches arrayEvent('tags').append(tagItemTemplate)`,
|
|
1517
|
+
minimalExample: `{ type: 'arraySection', title: 'Items', itemTemplate: { key: 'item', type: 'input', label: 'Item' } }`
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
type: "section",
|
|
1521
|
+
category: "demo",
|
|
1522
|
+
availability: "demo-only",
|
|
1523
|
+
package: "@internal/examples-shared-ui",
|
|
1524
|
+
description: "Demo wrapper used by the docs sandbox. Renders a titled card around the wrapped content and is registered with every sandbox adapter so the Writing-a-Wrapper docs can demonstrate an end-to-end custom wrapper. NOT a shipping primitive \u2014 use as a pattern/template, not a dependency.",
|
|
1525
|
+
props: {
|
|
1526
|
+
title: {
|
|
1527
|
+
name: "title",
|
|
1528
|
+
type: "string",
|
|
1529
|
+
description: "Card header text. Omit to render a header-less card.",
|
|
1530
|
+
required: false
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1533
|
+
autoAppliesTo: [],
|
|
1534
|
+
componentName: "SectionWrapperComponent",
|
|
1535
|
+
contract: WRAPPER_AUTHORING_CONTRACT,
|
|
1536
|
+
example: `// Section wrapper around a group
|
|
1537
|
+
{
|
|
1538
|
+
key: 'address',
|
|
1539
|
+
type: 'group',
|
|
1540
|
+
wrappers: [{ type: 'section', title: 'Shipping address' }],
|
|
1541
|
+
fields: [
|
|
1542
|
+
{ key: 'street', type: 'input', label: 'Street' },
|
|
1543
|
+
{ key: 'city', type: 'input', label: 'City' }
|
|
1544
|
+
]
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
// Header-less card (title omitted)
|
|
1548
|
+
{
|
|
1549
|
+
key: 'details',
|
|
1550
|
+
type: 'group',
|
|
1551
|
+
wrappers: [{ type: 'section' }],
|
|
1552
|
+
fields: [...]
|
|
1553
|
+
}`,
|
|
1554
|
+
minimalExample: `{ type: 'section', title: 'Section title' }`
|
|
1555
|
+
}
|
|
1556
|
+
];
|
|
1557
|
+
|
|
1280
1558
|
// packages/dynamic-form-mcp/src/registry/index.ts
|
|
1281
1559
|
function getFieldTypes() {
|
|
1282
1560
|
return FIELD_TYPES;
|
|
@@ -1306,6 +1584,15 @@ function getUIAdapterFieldType(library, fieldType) {
|
|
|
1306
1584
|
const adapter = getUIAdapter(library);
|
|
1307
1585
|
return adapter?.fieldTypes.find((ft) => ft.type === fieldType);
|
|
1308
1586
|
}
|
|
1587
|
+
function getWrappers() {
|
|
1588
|
+
return WRAPPERS;
|
|
1589
|
+
}
|
|
1590
|
+
function getWrapper(type) {
|
|
1591
|
+
return WRAPPERS.find((w) => w.type === type);
|
|
1592
|
+
}
|
|
1593
|
+
function getWrappersByCategory(category) {
|
|
1594
|
+
return WRAPPERS.filter((w) => w.category === category);
|
|
1595
|
+
}
|
|
1309
1596
|
function getDocPages() {
|
|
1310
1597
|
return DOCUMENTATION;
|
|
1311
1598
|
}
|
|
@@ -1876,13 +2163,13 @@ For fields that collect user input (\`input\`, \`textarea\`, \`select\`, \`check
|
|
|
1876
2163
|
label: 'Email Address',
|
|
1877
2164
|
required: true, // Shorthand validator
|
|
1878
2165
|
email: true, // Shorthand validator
|
|
2166
|
+
placeholder: 'user@example.com', // Field-level, not inside props
|
|
1879
2167
|
validationMessages: { // Always provide clear messages
|
|
1880
2168
|
required: 'Email is required',
|
|
1881
2169
|
email: 'Please enter a valid email'
|
|
1882
2170
|
},
|
|
1883
2171
|
props: {
|
|
1884
2172
|
type: 'email', // HTML input type
|
|
1885
|
-
placeholder: 'user@example.com',
|
|
1886
2173
|
hint: 'We will never share your email' // UI library specific
|
|
1887
2174
|
}
|
|
1888
2175
|
}
|
|
@@ -1898,11 +2185,11 @@ MUST include \`options\` array:
|
|
|
1898
2185
|
type: 'select',
|
|
1899
2186
|
label: 'Country',
|
|
1900
2187
|
required: true,
|
|
2188
|
+
placeholder: 'Select a country',
|
|
1901
2189
|
options: [
|
|
1902
2190
|
{ value: 'us', label: 'United States' },
|
|
1903
2191
|
{ value: 'uk', label: 'United Kingdom' }
|
|
1904
|
-
]
|
|
1905
|
-
props: { placeholder: 'Select a country' }
|
|
2192
|
+
]
|
|
1906
2193
|
}
|
|
1907
2194
|
\`\`\`
|
|
1908
2195
|
|
|
@@ -2016,6 +2303,27 @@ Use shorthand properties directly on field definitions:
|
|
|
2016
2303
|
|
|
2017
2304
|
Available shorthands: \`required\`, \`email\`, \`min\`, \`max\`, \`minLength\`, \`maxLength\`, \`pattern\`
|
|
2018
2305
|
|
|
2306
|
+
### Nullable Values
|
|
2307
|
+
|
|
2308
|
+
Value fields accept a \`nullable?: boolean\` flag. When \`true\`:
|
|
2309
|
+
|
|
2310
|
+
- \`value\` accepts \`null\` in addition to the field's normal value type.
|
|
2311
|
+
- An omitted \`value\` resolves to \`null\` (instead of the type-specific empty default like \`''\`, \`NaN\`, or \`[]\`).
|
|
2312
|
+
- Orthogonal to \`required\`. \`nullable\` declares that the **model** accepts \`null\`; \`required\` is a **validation** constraint. Angular's \`Validators.required\` treats \`null\` as invalid, so a field that is both \`nullable\` and \`required\` will fail required-validation when the value is \`null\` \u2014 the two flags describe different layers (data shape vs. validation), not conflicting semantics.
|
|
2313
|
+
- Map OpenAPI \`nullable: true\` (3.0) or \`type: [T, null]\` (3.1) to this flag.
|
|
2314
|
+
|
|
2315
|
+
\`\`\`typescript
|
|
2316
|
+
{
|
|
2317
|
+
key: 'middleName',
|
|
2318
|
+
type: 'input',
|
|
2319
|
+
label: 'Middle Name',
|
|
2320
|
+
nullable: true,
|
|
2321
|
+
value: null, // valid; default-resolves to null
|
|
2322
|
+
}
|
|
2323
|
+
\`\`\`
|
|
2324
|
+
|
|
2325
|
+
Read-side caveat: a user clearing a text input reads back as \`""\`, not \`null\` \u2014 this is a DOM/Web IDL contract, identical to classic Reactive Forms. \`nullable\` is a contract for accepted values, not a guarantee of emitted ones.
|
|
2326
|
+
|
|
2019
2327
|
### Validation Messages
|
|
2020
2328
|
|
|
2021
2329
|
ALWAYS provide validation messages. Use template variables:
|
|
@@ -2230,7 +2538,8 @@ Different UI libraries support different properties. Always validate against the
|
|
|
2230
2538
|
|----------|----------|-----------|---------|-------|
|
|
2231
2539
|
| \`appearance\` | \u2713 (fill, outline) | \u2717 | \u2717 | \u2713 (fill, outline) |
|
|
2232
2540
|
| \`subscriptSizing\` | \u2713 | \u2717 | \u2717 | \u2717 |
|
|
2233
|
-
| \`floatLabel\` | \u2713 | \u2717 | \
|
|
2541
|
+
| \`floatLabel\` | \u2713 (auto, always, never) | \u2717 | \u2717 | \u2717 |
|
|
2542
|
+
| \`hideRequiredMarker\` | \u2713 | \u2717 | \u2717 | \u2717 |
|
|
2234
2543
|
| \`hint\` | \u2713 | \u2713 (as \`helpText\`) | \u2713 | \u2713 |
|
|
2235
2544
|
|
|
2236
2545
|
### Container Fields
|
|
@@ -2317,7 +2626,9 @@ var examples_default = [
|
|
|
2317
2626
|
key: "title",
|
|
2318
2627
|
type: "text",
|
|
2319
2628
|
label: "Sign In",
|
|
2320
|
-
props: {
|
|
2629
|
+
props: {
|
|
2630
|
+
elementType: "h2"
|
|
2631
|
+
}
|
|
2321
2632
|
},
|
|
2322
2633
|
{
|
|
2323
2634
|
key: "email",
|
|
@@ -2325,8 +2636,13 @@ var examples_default = [
|
|
|
2325
2636
|
label: "Email Address",
|
|
2326
2637
|
required: true,
|
|
2327
2638
|
email: true,
|
|
2328
|
-
validationMessages: {
|
|
2329
|
-
|
|
2639
|
+
validationMessages: {
|
|
2640
|
+
email: "Please enter a valid email address"
|
|
2641
|
+
},
|
|
2642
|
+
props: {
|
|
2643
|
+
type: "email"
|
|
2644
|
+
},
|
|
2645
|
+
placeholder: "your@email.com"
|
|
2330
2646
|
},
|
|
2331
2647
|
{
|
|
2332
2648
|
key: "password",
|
|
@@ -2334,7 +2650,10 @@ var examples_default = [
|
|
|
2334
2650
|
label: "Password",
|
|
2335
2651
|
required: true,
|
|
2336
2652
|
minLength: 8,
|
|
2337
|
-
props: {
|
|
2653
|
+
props: {
|
|
2654
|
+
type: "password"
|
|
2655
|
+
},
|
|
2656
|
+
placeholder: "Enter your password"
|
|
2338
2657
|
},
|
|
2339
2658
|
{
|
|
2340
2659
|
key: "remember",
|
|
@@ -2345,7 +2664,9 @@ var examples_default = [
|
|
|
2345
2664
|
key: "submit",
|
|
2346
2665
|
type: "submit",
|
|
2347
2666
|
label: "Sign In",
|
|
2348
|
-
props: {
|
|
2667
|
+
props: {
|
|
2668
|
+
color: "primary"
|
|
2669
|
+
}
|
|
2349
2670
|
}
|
|
2350
2671
|
]
|
|
2351
2672
|
}
|
|
@@ -2367,7 +2688,7 @@ var examples_default = [
|
|
|
2367
2688
|
required: "First name is required",
|
|
2368
2689
|
minLength: "Must be at least {{requiredLength}} characters"
|
|
2369
2690
|
},
|
|
2370
|
-
|
|
2691
|
+
placeholder: "Enter your first name"
|
|
2371
2692
|
},
|
|
2372
2693
|
{
|
|
2373
2694
|
key: "lastName",
|
|
@@ -2379,7 +2700,7 @@ var examples_default = [
|
|
|
2379
2700
|
required: "Last name is required",
|
|
2380
2701
|
minLength: "Must be at least {{requiredLength}} characters"
|
|
2381
2702
|
},
|
|
2382
|
-
|
|
2703
|
+
placeholder: "Enter your last name"
|
|
2383
2704
|
},
|
|
2384
2705
|
{
|
|
2385
2706
|
key: "email",
|
|
@@ -2391,7 +2712,10 @@ var examples_default = [
|
|
|
2391
2712
|
required: "Email is required",
|
|
2392
2713
|
email: "Please enter a valid email address"
|
|
2393
2714
|
},
|
|
2394
|
-
props: {
|
|
2715
|
+
props: {
|
|
2716
|
+
type: "email"
|
|
2717
|
+
},
|
|
2718
|
+
placeholder: "user@example.com"
|
|
2395
2719
|
},
|
|
2396
2720
|
{
|
|
2397
2721
|
key: "age",
|
|
@@ -2405,22 +2729,42 @@ var examples_default = [
|
|
|
2405
2729
|
min: "Must be at least {{min}}",
|
|
2406
2730
|
max: "Must not exceed {{max}}"
|
|
2407
2731
|
},
|
|
2408
|
-
props: {
|
|
2732
|
+
props: {
|
|
2733
|
+
type: "number"
|
|
2734
|
+
},
|
|
2735
|
+
placeholder: "18"
|
|
2409
2736
|
},
|
|
2410
2737
|
{
|
|
2411
2738
|
key: "country",
|
|
2412
2739
|
type: "select",
|
|
2413
2740
|
label: "Country",
|
|
2414
2741
|
required: true,
|
|
2415
|
-
validationMessages: {
|
|
2742
|
+
validationMessages: {
|
|
2743
|
+
required: "Please select a country"
|
|
2744
|
+
},
|
|
2416
2745
|
options: [
|
|
2417
|
-
{
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
{
|
|
2746
|
+
{
|
|
2747
|
+
value: "us",
|
|
2748
|
+
label: "United States"
|
|
2749
|
+
},
|
|
2750
|
+
{
|
|
2751
|
+
value: "uk",
|
|
2752
|
+
label: "United Kingdom"
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
value: "ca",
|
|
2756
|
+
label: "Canada"
|
|
2757
|
+
},
|
|
2758
|
+
{
|
|
2759
|
+
value: "au",
|
|
2760
|
+
label: "Australia"
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
value: "de",
|
|
2764
|
+
label: "Germany"
|
|
2765
|
+
}
|
|
2422
2766
|
],
|
|
2423
|
-
|
|
2767
|
+
placeholder: "Select your country"
|
|
2424
2768
|
},
|
|
2425
2769
|
{
|
|
2426
2770
|
key: "newsletter",
|
|
@@ -2432,13 +2776,17 @@ var examples_default = [
|
|
|
2432
2776
|
type: "checkbox",
|
|
2433
2777
|
label: "I agree to the terms and conditions",
|
|
2434
2778
|
required: true,
|
|
2435
|
-
validationMessages: {
|
|
2779
|
+
validationMessages: {
|
|
2780
|
+
required: "You must accept the terms"
|
|
2781
|
+
}
|
|
2436
2782
|
},
|
|
2437
2783
|
{
|
|
2438
2784
|
key: "submit",
|
|
2439
2785
|
type: "submit",
|
|
2440
2786
|
label: "Create Account",
|
|
2441
|
-
props: {
|
|
2787
|
+
props: {
|
|
2788
|
+
color: "primary"
|
|
2789
|
+
}
|
|
2442
2790
|
}
|
|
2443
2791
|
]
|
|
2444
2792
|
}
|
|
@@ -2463,7 +2811,7 @@ var examples_default = [
|
|
|
2463
2811
|
label: "First Name",
|
|
2464
2812
|
required: true,
|
|
2465
2813
|
col: 6,
|
|
2466
|
-
|
|
2814
|
+
placeholder: "Your first name"
|
|
2467
2815
|
},
|
|
2468
2816
|
{
|
|
2469
2817
|
key: "lastName",
|
|
@@ -2471,7 +2819,7 @@ var examples_default = [
|
|
|
2471
2819
|
label: "Last Name",
|
|
2472
2820
|
required: true,
|
|
2473
2821
|
col: 6,
|
|
2474
|
-
|
|
2822
|
+
placeholder: "Your last name"
|
|
2475
2823
|
}
|
|
2476
2824
|
]
|
|
2477
2825
|
},
|
|
@@ -2481,8 +2829,13 @@ var examples_default = [
|
|
|
2481
2829
|
label: "Email Address",
|
|
2482
2830
|
required: true,
|
|
2483
2831
|
email: true,
|
|
2484
|
-
validationMessages: {
|
|
2485
|
-
|
|
2832
|
+
validationMessages: {
|
|
2833
|
+
email: "Please enter a valid email"
|
|
2834
|
+
},
|
|
2835
|
+
props: {
|
|
2836
|
+
type: "email"
|
|
2837
|
+
},
|
|
2838
|
+
placeholder: "email@example.com"
|
|
2486
2839
|
},
|
|
2487
2840
|
{
|
|
2488
2841
|
key: "subject",
|
|
@@ -2490,12 +2843,24 @@ var examples_default = [
|
|
|
2490
2843
|
label: "Subject",
|
|
2491
2844
|
required: true,
|
|
2492
2845
|
options: [
|
|
2493
|
-
{
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2846
|
+
{
|
|
2847
|
+
value: "general",
|
|
2848
|
+
label: "General Inquiry"
|
|
2849
|
+
},
|
|
2850
|
+
{
|
|
2851
|
+
value: "support",
|
|
2852
|
+
label: "Technical Support"
|
|
2853
|
+
},
|
|
2854
|
+
{
|
|
2855
|
+
value: "billing",
|
|
2856
|
+
label: "Billing Question"
|
|
2857
|
+
},
|
|
2858
|
+
{
|
|
2859
|
+
value: "feedback",
|
|
2860
|
+
label: "Feedback"
|
|
2861
|
+
}
|
|
2497
2862
|
],
|
|
2498
|
-
|
|
2863
|
+
placeholder: "Select a subject"
|
|
2499
2864
|
},
|
|
2500
2865
|
{
|
|
2501
2866
|
key: "message",
|
|
@@ -2508,13 +2873,18 @@ var examples_default = [
|
|
|
2508
2873
|
minLength: "Message must be at least {{requiredLength}} characters",
|
|
2509
2874
|
maxLength: "Message cannot exceed {{requiredLength}} characters"
|
|
2510
2875
|
},
|
|
2511
|
-
props: {
|
|
2876
|
+
props: {
|
|
2877
|
+
rows: 5
|
|
2878
|
+
},
|
|
2879
|
+
placeholder: "How can we help you?"
|
|
2512
2880
|
},
|
|
2513
2881
|
{
|
|
2514
2882
|
key: "submit",
|
|
2515
2883
|
type: "submit",
|
|
2516
2884
|
label: "Send Message",
|
|
2517
|
-
props: {
|
|
2885
|
+
props: {
|
|
2886
|
+
color: "primary"
|
|
2887
|
+
}
|
|
2518
2888
|
}
|
|
2519
2889
|
]
|
|
2520
2890
|
}
|
|
@@ -2541,13 +2911,17 @@ var examples_default = [
|
|
|
2541
2911
|
label: "Email",
|
|
2542
2912
|
required: true,
|
|
2543
2913
|
email: true,
|
|
2544
|
-
props: {
|
|
2914
|
+
props: {
|
|
2915
|
+
type: "email"
|
|
2916
|
+
}
|
|
2545
2917
|
},
|
|
2546
2918
|
{
|
|
2547
2919
|
key: "addressTitle",
|
|
2548
2920
|
type: "text",
|
|
2549
2921
|
label: "Shipping Address",
|
|
2550
|
-
props: {
|
|
2922
|
+
props: {
|
|
2923
|
+
elementType: "h4"
|
|
2924
|
+
}
|
|
2551
2925
|
},
|
|
2552
2926
|
{
|
|
2553
2927
|
key: "address",
|
|
@@ -2563,8 +2937,20 @@ var examples_default = [
|
|
|
2563
2937
|
key: "cityStateRow",
|
|
2564
2938
|
type: "row",
|
|
2565
2939
|
fields: [
|
|
2566
|
-
{
|
|
2567
|
-
|
|
2940
|
+
{
|
|
2941
|
+
key: "city",
|
|
2942
|
+
type: "input",
|
|
2943
|
+
label: "City",
|
|
2944
|
+
required: true,
|
|
2945
|
+
col: 6
|
|
2946
|
+
},
|
|
2947
|
+
{
|
|
2948
|
+
key: "state",
|
|
2949
|
+
type: "input",
|
|
2950
|
+
label: "State",
|
|
2951
|
+
required: true,
|
|
2952
|
+
col: 3
|
|
2953
|
+
},
|
|
2568
2954
|
{
|
|
2569
2955
|
key: "zip",
|
|
2570
2956
|
type: "input",
|
|
@@ -2572,7 +2958,9 @@ var examples_default = [
|
|
|
2572
2958
|
required: true,
|
|
2573
2959
|
col: 3,
|
|
2574
2960
|
pattern: "^\\d{5}$",
|
|
2575
|
-
validationMessages: {
|
|
2961
|
+
validationMessages: {
|
|
2962
|
+
pattern: "ZIP must be 5 digits"
|
|
2963
|
+
}
|
|
2576
2964
|
}
|
|
2577
2965
|
]
|
|
2578
2966
|
},
|
|
@@ -2582,8 +2970,14 @@ var examples_default = [
|
|
|
2582
2970
|
label: "Country",
|
|
2583
2971
|
required: true,
|
|
2584
2972
|
options: [
|
|
2585
|
-
{
|
|
2586
|
-
|
|
2973
|
+
{
|
|
2974
|
+
value: "us",
|
|
2975
|
+
label: "United States"
|
|
2976
|
+
},
|
|
2977
|
+
{
|
|
2978
|
+
value: "ca",
|
|
2979
|
+
label: "Canada"
|
|
2980
|
+
}
|
|
2587
2981
|
]
|
|
2588
2982
|
}
|
|
2589
2983
|
]
|
|
@@ -2614,12 +3008,37 @@ var examples_default = [
|
|
|
2614
3008
|
key: "stepTitle1",
|
|
2615
3009
|
type: "text",
|
|
2616
3010
|
label: "Step 1: Personal Information",
|
|
2617
|
-
props: {
|
|
3011
|
+
props: {
|
|
3012
|
+
elementType: "h3"
|
|
3013
|
+
}
|
|
2618
3014
|
},
|
|
2619
|
-
{
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
3015
|
+
{
|
|
3016
|
+
key: "firstName",
|
|
3017
|
+
type: "input",
|
|
3018
|
+
label: "First Name",
|
|
3019
|
+
required: true
|
|
3020
|
+
},
|
|
3021
|
+
{
|
|
3022
|
+
key: "lastName",
|
|
3023
|
+
type: "input",
|
|
3024
|
+
label: "Last Name",
|
|
3025
|
+
required: true
|
|
3026
|
+
},
|
|
3027
|
+
{
|
|
3028
|
+
key: "email",
|
|
3029
|
+
type: "input",
|
|
3030
|
+
label: "Email",
|
|
3031
|
+
required: true,
|
|
3032
|
+
email: true,
|
|
3033
|
+
props: {
|
|
3034
|
+
type: "email"
|
|
3035
|
+
}
|
|
3036
|
+
},
|
|
3037
|
+
{
|
|
3038
|
+
key: "next1",
|
|
3039
|
+
type: "next",
|
|
3040
|
+
label: "Continue"
|
|
3041
|
+
}
|
|
2623
3042
|
]
|
|
2624
3043
|
},
|
|
2625
3044
|
{
|
|
@@ -2630,17 +3049,44 @@ var examples_default = [
|
|
|
2630
3049
|
key: "stepTitle2",
|
|
2631
3050
|
type: "text",
|
|
2632
3051
|
label: "Step 2: Address",
|
|
2633
|
-
props: {
|
|
3052
|
+
props: {
|
|
3053
|
+
elementType: "h3"
|
|
3054
|
+
}
|
|
3055
|
+
},
|
|
3056
|
+
{
|
|
3057
|
+
key: "street",
|
|
3058
|
+
type: "input",
|
|
3059
|
+
label: "Street Address",
|
|
3060
|
+
required: true
|
|
3061
|
+
},
|
|
3062
|
+
{
|
|
3063
|
+
key: "city",
|
|
3064
|
+
type: "input",
|
|
3065
|
+
label: "City",
|
|
3066
|
+
required: true
|
|
3067
|
+
},
|
|
3068
|
+
{
|
|
3069
|
+
key: "state",
|
|
3070
|
+
type: "input",
|
|
3071
|
+
label: "State",
|
|
3072
|
+
required: true
|
|
2634
3073
|
},
|
|
2635
|
-
{ key: "street", type: "input", label: "Street Address", required: true },
|
|
2636
|
-
{ key: "city", type: "input", label: "City", required: true },
|
|
2637
|
-
{ key: "state", type: "input", label: "State", required: true },
|
|
2638
3074
|
{
|
|
2639
3075
|
key: "navRow2",
|
|
2640
3076
|
type: "row",
|
|
2641
3077
|
fields: [
|
|
2642
|
-
{
|
|
2643
|
-
|
|
3078
|
+
{
|
|
3079
|
+
key: "prev2",
|
|
3080
|
+
type: "previous",
|
|
3081
|
+
label: "Back",
|
|
3082
|
+
col: 6
|
|
3083
|
+
},
|
|
3084
|
+
{
|
|
3085
|
+
key: "next2",
|
|
3086
|
+
type: "next",
|
|
3087
|
+
label: "Continue",
|
|
3088
|
+
col: 6
|
|
3089
|
+
}
|
|
2644
3090
|
]
|
|
2645
3091
|
}
|
|
2646
3092
|
]
|
|
@@ -2653,21 +3099,35 @@ var examples_default = [
|
|
|
2653
3099
|
key: "stepTitle3",
|
|
2654
3100
|
type: "text",
|
|
2655
3101
|
label: "Step 3: Review & Submit",
|
|
2656
|
-
props: {
|
|
3102
|
+
props: {
|
|
3103
|
+
elementType: "h3"
|
|
3104
|
+
}
|
|
2657
3105
|
},
|
|
2658
3106
|
{
|
|
2659
3107
|
key: "confirm",
|
|
2660
3108
|
type: "checkbox",
|
|
2661
3109
|
label: "I confirm all information is correct",
|
|
2662
3110
|
required: true,
|
|
2663
|
-
validationMessages: {
|
|
3111
|
+
validationMessages: {
|
|
3112
|
+
required: "Please confirm before submitting"
|
|
3113
|
+
}
|
|
2664
3114
|
},
|
|
2665
3115
|
{
|
|
2666
3116
|
key: "navRow3",
|
|
2667
3117
|
type: "row",
|
|
2668
3118
|
fields: [
|
|
2669
|
-
{
|
|
2670
|
-
|
|
3119
|
+
{
|
|
3120
|
+
key: "prev3",
|
|
3121
|
+
type: "previous",
|
|
3122
|
+
label: "Back",
|
|
3123
|
+
col: 6
|
|
3124
|
+
},
|
|
3125
|
+
{
|
|
3126
|
+
key: "submit",
|
|
3127
|
+
type: "submit",
|
|
3128
|
+
label: "Submit",
|
|
3129
|
+
col: 6
|
|
3130
|
+
}
|
|
2671
3131
|
]
|
|
2672
3132
|
}
|
|
2673
3133
|
]
|
|
@@ -2688,8 +3148,14 @@ var examples_default = [
|
|
|
2688
3148
|
label: "Account Type",
|
|
2689
3149
|
required: true,
|
|
2690
3150
|
options: [
|
|
2691
|
-
{
|
|
2692
|
-
|
|
3151
|
+
{
|
|
3152
|
+
value: "personal",
|
|
3153
|
+
label: "Personal"
|
|
3154
|
+
},
|
|
3155
|
+
{
|
|
3156
|
+
value: "business",
|
|
3157
|
+
label: "Business"
|
|
3158
|
+
}
|
|
2693
3159
|
]
|
|
2694
3160
|
},
|
|
2695
3161
|
{
|
|
@@ -2716,7 +3182,9 @@ var examples_default = [
|
|
|
2716
3182
|
}
|
|
2717
3183
|
}
|
|
2718
3184
|
],
|
|
2719
|
-
validationMessages: {
|
|
3185
|
+
validationMessages: {
|
|
3186
|
+
required: "Business name is required"
|
|
3187
|
+
}
|
|
2720
3188
|
},
|
|
2721
3189
|
{
|
|
2722
3190
|
key: "taxId",
|
|
@@ -2733,7 +3201,7 @@ var examples_default = [
|
|
|
2733
3201
|
}
|
|
2734
3202
|
}
|
|
2735
3203
|
],
|
|
2736
|
-
|
|
3204
|
+
placeholder: "XX-XXXXXXX"
|
|
2737
3205
|
},
|
|
2738
3206
|
{
|
|
2739
3207
|
key: "newsletter",
|
|
@@ -2745,9 +3213,18 @@ var examples_default = [
|
|
|
2745
3213
|
type: "select",
|
|
2746
3214
|
label: "Email Frequency",
|
|
2747
3215
|
options: [
|
|
2748
|
-
{
|
|
2749
|
-
|
|
2750
|
-
|
|
3216
|
+
{
|
|
3217
|
+
value: "daily",
|
|
3218
|
+
label: "Daily"
|
|
3219
|
+
},
|
|
3220
|
+
{
|
|
3221
|
+
value: "weekly",
|
|
3222
|
+
label: "Weekly"
|
|
3223
|
+
},
|
|
3224
|
+
{
|
|
3225
|
+
value: "monthly",
|
|
3226
|
+
label: "Monthly"
|
|
3227
|
+
}
|
|
2751
3228
|
],
|
|
2752
3229
|
logic: [
|
|
2753
3230
|
{
|
|
@@ -2789,7 +3266,9 @@ var examples_default = [
|
|
|
2789
3266
|
key: "contactsTitle",
|
|
2790
3267
|
type: "text",
|
|
2791
3268
|
label: "Emergency Contacts",
|
|
2792
|
-
props: {
|
|
3269
|
+
props: {
|
|
3270
|
+
elementType: "h4"
|
|
3271
|
+
}
|
|
2793
3272
|
},
|
|
2794
3273
|
{
|
|
2795
3274
|
key: "contacts",
|
|
@@ -2804,19 +3283,49 @@ var examples_default = [
|
|
|
2804
3283
|
key: "contactRow",
|
|
2805
3284
|
type: "row",
|
|
2806
3285
|
fields: [
|
|
2807
|
-
{
|
|
2808
|
-
|
|
3286
|
+
{
|
|
3287
|
+
key: "name",
|
|
3288
|
+
type: "input",
|
|
3289
|
+
label: "Contact Name",
|
|
3290
|
+
required: true,
|
|
3291
|
+
col: 4
|
|
3292
|
+
},
|
|
3293
|
+
{
|
|
3294
|
+
key: "phone",
|
|
3295
|
+
type: "input",
|
|
3296
|
+
label: "Phone",
|
|
3297
|
+
required: true,
|
|
3298
|
+
col: 4,
|
|
3299
|
+
props: {
|
|
3300
|
+
type: "tel"
|
|
3301
|
+
}
|
|
3302
|
+
},
|
|
2809
3303
|
{
|
|
2810
3304
|
key: "relationship",
|
|
2811
3305
|
type: "select",
|
|
2812
3306
|
label: "Relationship",
|
|
2813
3307
|
col: 4,
|
|
2814
3308
|
options: [
|
|
2815
|
-
{
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
{
|
|
3309
|
+
{
|
|
3310
|
+
value: "spouse",
|
|
3311
|
+
label: "Spouse"
|
|
3312
|
+
},
|
|
3313
|
+
{
|
|
3314
|
+
value: "parent",
|
|
3315
|
+
label: "Parent"
|
|
3316
|
+
},
|
|
3317
|
+
{
|
|
3318
|
+
value: "sibling",
|
|
3319
|
+
label: "Sibling"
|
|
3320
|
+
},
|
|
3321
|
+
{
|
|
3322
|
+
value: "friend",
|
|
3323
|
+
label: "Friend"
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
value: "other",
|
|
3327
|
+
label: "Other"
|
|
3328
|
+
}
|
|
2820
3329
|
]
|
|
2821
3330
|
}
|
|
2822
3331
|
]
|
|
@@ -2844,15 +3353,23 @@ var examples_default = [
|
|
|
2844
3353
|
key: "title",
|
|
2845
3354
|
type: "text",
|
|
2846
3355
|
label: "Customer Feedback",
|
|
2847
|
-
props: {
|
|
3356
|
+
props: {
|
|
3357
|
+
elementType: "h2"
|
|
3358
|
+
}
|
|
2848
3359
|
},
|
|
2849
3360
|
{
|
|
2850
3361
|
key: "satisfaction",
|
|
2851
3362
|
type: "slider",
|
|
2852
3363
|
label: "Overall Satisfaction (1-10)",
|
|
2853
3364
|
required: true,
|
|
2854
|
-
props: {
|
|
2855
|
-
|
|
3365
|
+
props: {
|
|
3366
|
+
min: 1,
|
|
3367
|
+
max: 10,
|
|
3368
|
+
step: 1
|
|
3369
|
+
},
|
|
3370
|
+
validationMessages: {
|
|
3371
|
+
required: "Please rate your satisfaction"
|
|
3372
|
+
}
|
|
2856
3373
|
},
|
|
2857
3374
|
{
|
|
2858
3375
|
key: "recommend",
|
|
@@ -2860,30 +3377,62 @@ var examples_default = [
|
|
|
2860
3377
|
label: "Would you recommend us?",
|
|
2861
3378
|
required: true,
|
|
2862
3379
|
options: [
|
|
2863
|
-
{
|
|
2864
|
-
|
|
2865
|
-
|
|
3380
|
+
{
|
|
3381
|
+
value: "yes",
|
|
3382
|
+
label: "Yes, definitely"
|
|
3383
|
+
},
|
|
3384
|
+
{
|
|
3385
|
+
value: "maybe",
|
|
3386
|
+
label: "Maybe"
|
|
3387
|
+
},
|
|
3388
|
+
{
|
|
3389
|
+
value: "no",
|
|
3390
|
+
label: "No"
|
|
3391
|
+
}
|
|
2866
3392
|
],
|
|
2867
|
-
validationMessages: {
|
|
3393
|
+
validationMessages: {
|
|
3394
|
+
required: "Please select an option"
|
|
3395
|
+
}
|
|
2868
3396
|
},
|
|
2869
3397
|
{
|
|
2870
3398
|
key: "improvements",
|
|
2871
3399
|
type: "select",
|
|
2872
3400
|
label: "What could we improve?",
|
|
2873
|
-
props: {
|
|
3401
|
+
props: {
|
|
3402
|
+
multiple: true
|
|
3403
|
+
},
|
|
2874
3404
|
options: [
|
|
2875
|
-
{
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
{
|
|
2880
|
-
|
|
3405
|
+
{
|
|
3406
|
+
value: "speed",
|
|
3407
|
+
label: "Response Time"
|
|
3408
|
+
},
|
|
3409
|
+
{
|
|
3410
|
+
value: "quality",
|
|
3411
|
+
label: "Product Quality"
|
|
3412
|
+
},
|
|
3413
|
+
{
|
|
3414
|
+
value: "price",
|
|
3415
|
+
label: "Pricing"
|
|
3416
|
+
},
|
|
3417
|
+
{
|
|
3418
|
+
value: "support",
|
|
3419
|
+
label: "Customer Support"
|
|
3420
|
+
},
|
|
3421
|
+
{
|
|
3422
|
+
value: "ui",
|
|
3423
|
+
label: "User Interface"
|
|
3424
|
+
}
|
|
3425
|
+
],
|
|
3426
|
+
placeholder: "Select all that apply"
|
|
2881
3427
|
},
|
|
2882
3428
|
{
|
|
2883
3429
|
key: "comments",
|
|
2884
3430
|
type: "textarea",
|
|
2885
3431
|
label: "Additional Comments",
|
|
2886
|
-
props: {
|
|
3432
|
+
props: {
|
|
3433
|
+
rows: 4
|
|
3434
|
+
},
|
|
3435
|
+
placeholder: "Share any additional feedback..."
|
|
2887
3436
|
},
|
|
2888
3437
|
{
|
|
2889
3438
|
key: "followUp",
|
|
@@ -2895,7 +3444,9 @@ var examples_default = [
|
|
|
2895
3444
|
type: "input",
|
|
2896
3445
|
label: "Email Address",
|
|
2897
3446
|
email: true,
|
|
2898
|
-
props: {
|
|
3447
|
+
props: {
|
|
3448
|
+
type: "email"
|
|
3449
|
+
},
|
|
2899
3450
|
logic: [
|
|
2900
3451
|
{
|
|
2901
3452
|
type: "hidden",
|
|
@@ -2919,7 +3470,8 @@ var examples_default = [
|
|
|
2919
3470
|
validationMessages: {
|
|
2920
3471
|
required: "Email required for follow-up",
|
|
2921
3472
|
email: "Please enter a valid email"
|
|
2922
|
-
}
|
|
3473
|
+
},
|
|
3474
|
+
placeholder: "your@email.com"
|
|
2923
3475
|
},
|
|
2924
3476
|
{
|
|
2925
3477
|
key: "submit",
|
|
@@ -3371,7 +3923,7 @@ var MatButtonPropsSchema = z12.object({
|
|
|
3371
3923
|
});
|
|
3372
3924
|
|
|
3373
3925
|
// internal/dynamic-forms-zod/material/src/fields/mat-input-field.schema.ts
|
|
3374
|
-
import { z as
|
|
3926
|
+
import { z as z23 } from "zod";
|
|
3375
3927
|
|
|
3376
3928
|
// internal/dynamic-forms-zod/src/lib/schemas/field/field-def.schema.ts
|
|
3377
3929
|
import { z as z14 } from "zod";
|
|
@@ -3833,16 +4385,31 @@ var FieldWithValidationSchema = z21.object({
|
|
|
3833
4385
|
schemas: z21.array(SchemaApplicationConfigSchema).optional()
|
|
3834
4386
|
});
|
|
3835
4387
|
|
|
4388
|
+
// internal/dynamic-forms-zod/src/lib/schemas/field/nullable-value.refinement.ts
|
|
4389
|
+
import { z as z22 } from "zod";
|
|
4390
|
+
var nullableValueRefine = (data, ctx) => {
|
|
4391
|
+
if (!data || typeof data !== "object") return;
|
|
4392
|
+
const field = data;
|
|
4393
|
+
if (field.value === null && field.nullable !== true) {
|
|
4394
|
+
ctx.addIssue({
|
|
4395
|
+
code: z22.ZodIssueCode.custom,
|
|
4396
|
+
path: ["value"],
|
|
4397
|
+
message: "value: null is only allowed when nullable is true. Add `nullable: true` or remove the null value."
|
|
4398
|
+
});
|
|
4399
|
+
}
|
|
4400
|
+
};
|
|
4401
|
+
|
|
3836
4402
|
// internal/dynamic-forms-zod/material/src/fields/mat-input-field.schema.ts
|
|
3837
|
-
var
|
|
4403
|
+
var MatInputFieldSchemaObject = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
3838
4404
|
/**
|
|
3839
4405
|
* Field type discriminant.
|
|
3840
4406
|
*/
|
|
3841
|
-
type:
|
|
4407
|
+
type: z23.literal("input"),
|
|
4408
|
+
nullable: z23.boolean().optional(),
|
|
3842
4409
|
/**
|
|
3843
4410
|
* Initial value for the input.
|
|
3844
4411
|
*/
|
|
3845
|
-
value:
|
|
4412
|
+
value: z23.string().nullable().optional(),
|
|
3846
4413
|
/**
|
|
3847
4414
|
* Placeholder text (can also be in props).
|
|
3848
4415
|
*/
|
|
@@ -3852,18 +4419,20 @@ var MatInputFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema).ex
|
|
|
3852
4419
|
*/
|
|
3853
4420
|
props: MatInputPropsSchema.optional()
|
|
3854
4421
|
});
|
|
4422
|
+
var MatInputFieldSchema = MatInputFieldSchemaObject.superRefine(nullableValueRefine);
|
|
3855
4423
|
|
|
3856
4424
|
// internal/dynamic-forms-zod/material/src/fields/mat-textarea-field.schema.ts
|
|
3857
|
-
import { z as
|
|
3858
|
-
var
|
|
4425
|
+
import { z as z24 } from "zod";
|
|
4426
|
+
var MatTextareaFieldSchemaObject = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
3859
4427
|
/**
|
|
3860
4428
|
* Field type discriminant.
|
|
3861
4429
|
*/
|
|
3862
|
-
type:
|
|
4430
|
+
type: z24.literal("textarea"),
|
|
4431
|
+
nullable: z24.boolean().optional(),
|
|
3863
4432
|
/**
|
|
3864
4433
|
* Initial value for the textarea.
|
|
3865
4434
|
*/
|
|
3866
|
-
value:
|
|
4435
|
+
value: z24.string().nullable().optional(),
|
|
3867
4436
|
/**
|
|
3868
4437
|
* Placeholder text (can also be in props).
|
|
3869
4438
|
*/
|
|
@@ -3873,13 +4442,14 @@ var MatTextareaFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema)
|
|
|
3873
4442
|
*/
|
|
3874
4443
|
props: MatTextareaPropsSchema.optional()
|
|
3875
4444
|
});
|
|
4445
|
+
var MatTextareaFieldSchema = MatTextareaFieldSchemaObject.superRefine(nullableValueRefine);
|
|
3876
4446
|
|
|
3877
4447
|
// internal/dynamic-forms-zod/material/src/fields/mat-select-field.schema.ts
|
|
3878
|
-
import { z as
|
|
4448
|
+
import { z as z26 } from "zod";
|
|
3879
4449
|
|
|
3880
4450
|
// internal/dynamic-forms-zod/src/lib/schemas/common/field-option.schema.ts
|
|
3881
|
-
import { z as
|
|
3882
|
-
var FieldOptionSchema =
|
|
4451
|
+
import { z as z25 } from "zod";
|
|
4452
|
+
var FieldOptionSchema = z25.object({
|
|
3883
4453
|
/**
|
|
3884
4454
|
* Display text for the option.
|
|
3885
4455
|
*/
|
|
@@ -3888,25 +4458,26 @@ var FieldOptionSchema = z24.object({
|
|
|
3888
4458
|
* The actual value stored when this option is selected.
|
|
3889
4459
|
* Can be any JSON-serializable value.
|
|
3890
4460
|
*/
|
|
3891
|
-
value:
|
|
4461
|
+
value: z25.unknown(),
|
|
3892
4462
|
/**
|
|
3893
4463
|
* Whether this option is disabled and cannot be selected.
|
|
3894
4464
|
*/
|
|
3895
|
-
disabled:
|
|
4465
|
+
disabled: z25.boolean().optional()
|
|
3896
4466
|
}).passthrough();
|
|
3897
|
-
var FieldOptionsSchema =
|
|
4467
|
+
var FieldOptionsSchema = z25.array(FieldOptionSchema);
|
|
3898
4468
|
|
|
3899
4469
|
// internal/dynamic-forms-zod/material/src/fields/mat-select-field.schema.ts
|
|
3900
|
-
var
|
|
4470
|
+
var MatSelectFieldSchemaObject = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
3901
4471
|
/**
|
|
3902
4472
|
* Field type discriminant.
|
|
3903
4473
|
*/
|
|
3904
|
-
type:
|
|
4474
|
+
type: z26.literal("select"),
|
|
4475
|
+
nullable: z26.boolean().optional(),
|
|
3905
4476
|
/**
|
|
3906
4477
|
* Initial value for the select.
|
|
3907
4478
|
* Can be single value or array if multiple is enabled.
|
|
3908
4479
|
*/
|
|
3909
|
-
value:
|
|
4480
|
+
value: z26.unknown().nullable().optional(),
|
|
3910
4481
|
/**
|
|
3911
4482
|
* Placeholder text (can also be in props).
|
|
3912
4483
|
*/
|
|
@@ -3920,18 +4491,19 @@ var MatSelectFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema).e
|
|
|
3920
4491
|
*/
|
|
3921
4492
|
props: MatSelectPropsSchema.optional()
|
|
3922
4493
|
});
|
|
4494
|
+
var MatSelectFieldSchema = MatSelectFieldSchemaObject.superRefine(nullableValueRefine);
|
|
3923
4495
|
|
|
3924
4496
|
// internal/dynamic-forms-zod/material/src/fields/mat-checkbox-field.schema.ts
|
|
3925
|
-
import { z as
|
|
4497
|
+
import { z as z27 } from "zod";
|
|
3926
4498
|
var MatCheckboxFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
3927
4499
|
/**
|
|
3928
4500
|
* Field type discriminant.
|
|
3929
4501
|
*/
|
|
3930
|
-
type:
|
|
4502
|
+
type: z27.literal("checkbox"),
|
|
3931
4503
|
/**
|
|
3932
4504
|
* Initial checked state.
|
|
3933
4505
|
*/
|
|
3934
|
-
value:
|
|
4506
|
+
value: z27.boolean().optional(),
|
|
3935
4507
|
/**
|
|
3936
4508
|
* Placeholder/helper text.
|
|
3937
4509
|
*/
|
|
@@ -3943,16 +4515,17 @@ var MatCheckboxFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema)
|
|
|
3943
4515
|
});
|
|
3944
4516
|
|
|
3945
4517
|
// internal/dynamic-forms-zod/material/src/fields/mat-radio-field.schema.ts
|
|
3946
|
-
import { z as
|
|
3947
|
-
var
|
|
4518
|
+
import { z as z28 } from "zod";
|
|
4519
|
+
var MatRadioFieldSchemaObject = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
3948
4520
|
/**
|
|
3949
4521
|
* Field type discriminant.
|
|
3950
4522
|
*/
|
|
3951
|
-
type:
|
|
4523
|
+
type: z28.literal("radio"),
|
|
4524
|
+
nullable: z28.boolean().optional(),
|
|
3952
4525
|
/**
|
|
3953
4526
|
* Initial selected value.
|
|
3954
4527
|
*/
|
|
3955
|
-
value:
|
|
4528
|
+
value: z28.unknown().nullable().optional(),
|
|
3956
4529
|
/**
|
|
3957
4530
|
* Placeholder/helper text.
|
|
3958
4531
|
*/
|
|
@@ -3966,18 +4539,20 @@ var MatRadioFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema).ex
|
|
|
3966
4539
|
*/
|
|
3967
4540
|
props: MatRadioPropsSchema.optional()
|
|
3968
4541
|
});
|
|
4542
|
+
var MatRadioFieldSchema = MatRadioFieldSchemaObject.superRefine(nullableValueRefine);
|
|
3969
4543
|
|
|
3970
4544
|
// internal/dynamic-forms-zod/material/src/fields/mat-multi-checkbox-field.schema.ts
|
|
3971
|
-
import { z as
|
|
3972
|
-
var
|
|
4545
|
+
import { z as z29 } from "zod";
|
|
4546
|
+
var MatMultiCheckboxFieldSchemaObject = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
3973
4547
|
/**
|
|
3974
4548
|
* Field type discriminant.
|
|
3975
4549
|
*/
|
|
3976
|
-
type:
|
|
4550
|
+
type: z29.literal("multi-checkbox"),
|
|
4551
|
+
nullable: z29.boolean().optional(),
|
|
3977
4552
|
/**
|
|
3978
4553
|
* Initial selected values (array).
|
|
3979
4554
|
*/
|
|
3980
|
-
value:
|
|
4555
|
+
value: z29.array(z29.unknown()).nullable().optional(),
|
|
3981
4556
|
/**
|
|
3982
4557
|
* Placeholder/helper text.
|
|
3983
4558
|
*/
|
|
@@ -3991,18 +4566,19 @@ var MatMultiCheckboxFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSc
|
|
|
3991
4566
|
*/
|
|
3992
4567
|
props: MatMultiCheckboxPropsSchema.optional()
|
|
3993
4568
|
});
|
|
4569
|
+
var MatMultiCheckboxFieldSchema = MatMultiCheckboxFieldSchemaObject.superRefine(nullableValueRefine);
|
|
3994
4570
|
|
|
3995
4571
|
// internal/dynamic-forms-zod/material/src/fields/mat-toggle-field.schema.ts
|
|
3996
|
-
import { z as
|
|
4572
|
+
import { z as z30 } from "zod";
|
|
3997
4573
|
var MatToggleFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
3998
4574
|
/**
|
|
3999
4575
|
* Field type discriminant.
|
|
4000
4576
|
*/
|
|
4001
|
-
type:
|
|
4577
|
+
type: z30.literal("toggle"),
|
|
4002
4578
|
/**
|
|
4003
4579
|
* Initial toggle state.
|
|
4004
4580
|
*/
|
|
4005
|
-
value:
|
|
4581
|
+
value: z30.boolean().optional(),
|
|
4006
4582
|
/**
|
|
4007
4583
|
* Placeholder/helper text.
|
|
4008
4584
|
*/
|
|
@@ -4014,28 +4590,29 @@ var MatToggleFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema).e
|
|
|
4014
4590
|
});
|
|
4015
4591
|
|
|
4016
4592
|
// internal/dynamic-forms-zod/material/src/fields/mat-slider-field.schema.ts
|
|
4017
|
-
import { z as
|
|
4018
|
-
var
|
|
4593
|
+
import { z as z31 } from "zod";
|
|
4594
|
+
var MatSliderFieldSchemaObject = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
4019
4595
|
/**
|
|
4020
4596
|
* Field type discriminant.
|
|
4021
4597
|
*/
|
|
4022
|
-
type:
|
|
4598
|
+
type: z31.literal("slider"),
|
|
4599
|
+
nullable: z31.boolean().optional(),
|
|
4023
4600
|
/**
|
|
4024
4601
|
* Initial slider value.
|
|
4025
4602
|
*/
|
|
4026
|
-
value:
|
|
4603
|
+
value: z31.number().nullable().optional(),
|
|
4027
4604
|
/**
|
|
4028
4605
|
* Minimum slider value.
|
|
4029
4606
|
*/
|
|
4030
|
-
minValue:
|
|
4607
|
+
minValue: z31.number().optional(),
|
|
4031
4608
|
/**
|
|
4032
4609
|
* Maximum slider value.
|
|
4033
4610
|
*/
|
|
4034
|
-
maxValue:
|
|
4611
|
+
maxValue: z31.number().optional(),
|
|
4035
4612
|
/**
|
|
4036
4613
|
* Step increment.
|
|
4037
4614
|
*/
|
|
4038
|
-
step:
|
|
4615
|
+
step: z31.number().positive().optional(),
|
|
4039
4616
|
/**
|
|
4040
4617
|
* Placeholder/helper text.
|
|
4041
4618
|
*/
|
|
@@ -4045,19 +4622,21 @@ var MatSliderFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchema).e
|
|
|
4045
4622
|
*/
|
|
4046
4623
|
props: MatSliderPropsSchema.optional()
|
|
4047
4624
|
});
|
|
4625
|
+
var MatSliderFieldSchema = MatSliderFieldSchemaObject.superRefine(nullableValueRefine);
|
|
4048
4626
|
|
|
4049
4627
|
// internal/dynamic-forms-zod/material/src/fields/mat-datepicker-field.schema.ts
|
|
4050
|
-
import { z as
|
|
4051
|
-
var DateValueSchema =
|
|
4052
|
-
var
|
|
4628
|
+
import { z as z32 } from "zod";
|
|
4629
|
+
var DateValueSchema = z32.union([z32.string(), z32.null()]);
|
|
4630
|
+
var MatDatepickerFieldSchemaObject = BaseFieldDefSchema.merge(FieldWithValidationSchema).extend({
|
|
4053
4631
|
/**
|
|
4054
4632
|
* Field type discriminant.
|
|
4055
4633
|
*/
|
|
4056
|
-
type:
|
|
4634
|
+
type: z32.literal("datepicker"),
|
|
4635
|
+
nullable: z32.boolean().optional(),
|
|
4057
4636
|
/**
|
|
4058
4637
|
* Initial date value (ISO string in JSON configs).
|
|
4059
4638
|
*/
|
|
4060
|
-
value: DateValueSchema.optional(),
|
|
4639
|
+
value: DateValueSchema.nullable().optional(),
|
|
4061
4640
|
/**
|
|
4062
4641
|
* Minimum selectable date.
|
|
4063
4642
|
*/
|
|
@@ -4079,24 +4658,25 @@ var MatDatepickerFieldSchema = BaseFieldDefSchema.merge(FieldWithValidationSchem
|
|
|
4079
4658
|
*/
|
|
4080
4659
|
props: MatDatepickerPropsSchema.optional()
|
|
4081
4660
|
});
|
|
4661
|
+
var MatDatepickerFieldSchema = MatDatepickerFieldSchemaObject.superRefine(nullableValueRefine);
|
|
4082
4662
|
|
|
4083
4663
|
// internal/dynamic-forms-zod/material/src/fields/mat-button-field.schema.ts
|
|
4084
|
-
import { z as
|
|
4085
|
-
var EventArgSchema =
|
|
4664
|
+
import { z as z33 } from "zod";
|
|
4665
|
+
var EventArgSchema = z33.union([z33.string(), z33.number(), z33.boolean(), z33.null(), z33.undefined()]);
|
|
4086
4666
|
var MatButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4087
4667
|
/**
|
|
4088
4668
|
* Field type discriminant.
|
|
4089
4669
|
*/
|
|
4090
|
-
type:
|
|
4670
|
+
type: z33.literal("button"),
|
|
4091
4671
|
/**
|
|
4092
4672
|
* Event type name (string reference to registered event).
|
|
4093
4673
|
* Note: Full event configuration requires runtime setup.
|
|
4094
4674
|
*/
|
|
4095
|
-
event:
|
|
4675
|
+
event: z33.string().optional(),
|
|
4096
4676
|
/**
|
|
4097
4677
|
* Arguments passed to the event constructor.
|
|
4098
4678
|
*/
|
|
4099
|
-
eventArgs:
|
|
4679
|
+
eventArgs: z33.array(EventArgSchema).optional(),
|
|
4100
4680
|
/**
|
|
4101
4681
|
* Material-specific button properties.
|
|
4102
4682
|
*/
|
|
@@ -4107,45 +4687,45 @@ var MatButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
|
4107
4687
|
logic: LogicArraySchema.optional()
|
|
4108
4688
|
});
|
|
4109
4689
|
var MatSubmitButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4110
|
-
type:
|
|
4690
|
+
type: z33.literal("submit"),
|
|
4111
4691
|
props: MatButtonPropsSchema.optional(),
|
|
4112
4692
|
logic: LogicArraySchema.optional()
|
|
4113
4693
|
});
|
|
4114
4694
|
var MatNextButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4115
|
-
type:
|
|
4695
|
+
type: z33.literal("next"),
|
|
4116
4696
|
props: MatButtonPropsSchema.optional(),
|
|
4117
4697
|
logic: LogicArraySchema.optional()
|
|
4118
4698
|
});
|
|
4119
4699
|
var MatPreviousButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4120
|
-
type:
|
|
4700
|
+
type: z33.literal("previous"),
|
|
4121
4701
|
props: MatButtonPropsSchema.optional()
|
|
4122
4702
|
});
|
|
4123
4703
|
var MatAddArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4124
|
-
type:
|
|
4704
|
+
type: z33.literal("addArrayItem"),
|
|
4125
4705
|
/**
|
|
4126
4706
|
* Key of the array field to add items to.
|
|
4127
4707
|
* If omitted, uses the parent array context.
|
|
4128
4708
|
*/
|
|
4129
|
-
arrayKey:
|
|
4709
|
+
arrayKey: z33.string().optional(),
|
|
4130
4710
|
props: MatButtonPropsSchema.optional()
|
|
4131
4711
|
});
|
|
4132
4712
|
var MatRemoveArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4133
|
-
type:
|
|
4713
|
+
type: z33.literal("removeArrayItem"),
|
|
4134
4714
|
/**
|
|
4135
4715
|
* Key of the array field to remove items from.
|
|
4136
4716
|
* If omitted, uses the parent array context.
|
|
4137
4717
|
*/
|
|
4138
|
-
arrayKey:
|
|
4718
|
+
arrayKey: z33.string().optional(),
|
|
4139
4719
|
props: MatButtonPropsSchema.optional()
|
|
4140
4720
|
});
|
|
4141
4721
|
|
|
4142
4722
|
// internal/dynamic-forms-zod/material/src/mat-leaf-field.schema.ts
|
|
4143
|
-
import { z as
|
|
4723
|
+
import { z as z36 } from "zod";
|
|
4144
4724
|
|
|
4145
4725
|
// internal/dynamic-forms-zod/src/lib/schemas/leaves/text-field.schema.ts
|
|
4146
|
-
import { z as
|
|
4147
|
-
var TextElementTypeSchema =
|
|
4148
|
-
var TextPropsSchema =
|
|
4726
|
+
import { z as z34 } from "zod";
|
|
4727
|
+
var TextElementTypeSchema = z34.enum(["p", "h1", "h2", "h3", "h4", "h5", "h6", "span"]);
|
|
4728
|
+
var TextPropsSchema = z34.object({
|
|
4149
4729
|
/**
|
|
4150
4730
|
* HTML element type to render the text.
|
|
4151
4731
|
*/
|
|
@@ -4155,7 +4735,7 @@ var TextFieldSchema = BaseFieldDefSchema.extend({
|
|
|
4155
4735
|
/**
|
|
4156
4736
|
* Field type discriminant.
|
|
4157
4737
|
*/
|
|
4158
|
-
type:
|
|
4738
|
+
type: z34.literal("text"),
|
|
4159
4739
|
/**
|
|
4160
4740
|
* Text-specific properties.
|
|
4161
4741
|
*/
|
|
@@ -4167,9 +4747,9 @@ var TextFieldSchema = BaseFieldDefSchema.extend({
|
|
|
4167
4747
|
});
|
|
4168
4748
|
|
|
4169
4749
|
// internal/dynamic-forms-zod/src/lib/schemas/leaves/hidden-field.schema.ts
|
|
4170
|
-
import { z as
|
|
4171
|
-
var HiddenScalarSchema =
|
|
4172
|
-
var HiddenValueSchema =
|
|
4750
|
+
import { z as z35 } from "zod";
|
|
4751
|
+
var HiddenScalarSchema = z35.union([z35.string(), z35.number(), z35.boolean()]);
|
|
4752
|
+
var HiddenValueSchema = z35.union([HiddenScalarSchema, z35.array(HiddenScalarSchema)]);
|
|
4173
4753
|
var HiddenFieldSchema = BaseFieldDefSchema.omit({
|
|
4174
4754
|
label: true,
|
|
4175
4755
|
meta: true,
|
|
@@ -4185,7 +4765,7 @@ var HiddenFieldSchema = BaseFieldDefSchema.omit({
|
|
|
4185
4765
|
/**
|
|
4186
4766
|
* Field type discriminant.
|
|
4187
4767
|
*/
|
|
4188
|
-
type:
|
|
4768
|
+
type: z35.literal("hidden"),
|
|
4189
4769
|
/**
|
|
4190
4770
|
* The value to store. Required for hidden fields.
|
|
4191
4771
|
*/
|
|
@@ -4193,20 +4773,20 @@ var HiddenFieldSchema = BaseFieldDefSchema.omit({
|
|
|
4193
4773
|
});
|
|
4194
4774
|
|
|
4195
4775
|
// internal/dynamic-forms-zod/material/src/mat-leaf-field.schema.ts
|
|
4196
|
-
var MatLeafFieldSchema =
|
|
4776
|
+
var MatLeafFieldSchema = z36.discriminatedUnion("type", [
|
|
4197
4777
|
// Default fields
|
|
4198
4778
|
TextFieldSchema,
|
|
4199
4779
|
HiddenFieldSchema,
|
|
4200
4780
|
// Material value fields
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4781
|
+
MatInputFieldSchemaObject,
|
|
4782
|
+
MatTextareaFieldSchemaObject,
|
|
4783
|
+
MatSelectFieldSchemaObject,
|
|
4204
4784
|
MatCheckboxFieldSchema,
|
|
4205
|
-
|
|
4206
|
-
|
|
4785
|
+
MatRadioFieldSchemaObject,
|
|
4786
|
+
MatMultiCheckboxFieldSchemaObject,
|
|
4207
4787
|
MatToggleFieldSchema,
|
|
4208
|
-
|
|
4209
|
-
|
|
4788
|
+
MatSliderFieldSchemaObject,
|
|
4789
|
+
MatDatepickerFieldSchemaObject,
|
|
4210
4790
|
// Material button fields
|
|
4211
4791
|
MatButtonFieldSchema,
|
|
4212
4792
|
MatSubmitButtonFieldSchema,
|
|
@@ -4214,18 +4794,18 @@ var MatLeafFieldSchema = z35.discriminatedUnion("type", [
|
|
|
4214
4794
|
MatPreviousButtonFieldSchema,
|
|
4215
4795
|
MatAddArrayItemButtonFieldSchema,
|
|
4216
4796
|
MatRemoveArrayItemButtonFieldSchema
|
|
4217
|
-
]);
|
|
4797
|
+
]).superRefine(nullableValueRefine);
|
|
4218
4798
|
|
|
4219
4799
|
// internal/dynamic-forms-zod/src/lib/schemas/containers/factories.ts
|
|
4220
|
-
import { z as
|
|
4221
|
-
var ContainerLogicSchema =
|
|
4222
|
-
type:
|
|
4223
|
-
condition:
|
|
4800
|
+
import { z as z37 } from "zod";
|
|
4801
|
+
var ContainerLogicSchema = z37.object({
|
|
4802
|
+
type: z37.literal("hidden"),
|
|
4803
|
+
condition: z37.union([ConditionalExpressionSchema, z37.boolean()])
|
|
4224
4804
|
});
|
|
4225
4805
|
function createContainerSchemas(options) {
|
|
4226
4806
|
const { leafFieldSchema } = options;
|
|
4227
|
-
const AnyFieldSchema =
|
|
4228
|
-
() =>
|
|
4807
|
+
const AnyFieldSchema = z37.lazy(
|
|
4808
|
+
() => z37.union([
|
|
4229
4809
|
leafFieldSchema,
|
|
4230
4810
|
PageFieldSchema,
|
|
4231
4811
|
RowFieldSchema,
|
|
@@ -4239,67 +4819,67 @@ function createContainerSchemas(options) {
|
|
|
4239
4819
|
}).extend({
|
|
4240
4820
|
// Explicitly forbid label on container fields
|
|
4241
4821
|
// This makes Zod reject any value for these properties
|
|
4242
|
-
label:
|
|
4243
|
-
meta:
|
|
4822
|
+
label: z37.never().optional(),
|
|
4823
|
+
meta: z37.never().optional()
|
|
4244
4824
|
});
|
|
4245
4825
|
const PageFieldSchema = ContainerBaseSchema.extend({
|
|
4246
|
-
type:
|
|
4247
|
-
fields:
|
|
4248
|
-
logic:
|
|
4826
|
+
type: z37.literal("page"),
|
|
4827
|
+
fields: z37.array(AnyFieldSchema),
|
|
4828
|
+
logic: z37.array(ContainerLogicSchema).optional(),
|
|
4249
4829
|
// Also forbid title (common mistake)
|
|
4250
|
-
title:
|
|
4830
|
+
title: z37.never().optional()
|
|
4251
4831
|
});
|
|
4252
4832
|
const RowFieldSchema = ContainerBaseSchema.extend({
|
|
4253
|
-
type:
|
|
4254
|
-
fields:
|
|
4833
|
+
type: z37.literal("row"),
|
|
4834
|
+
fields: z37.array(AnyFieldSchema),
|
|
4255
4835
|
// Container logic - only 'hidden' type allowed (same as pages)
|
|
4256
|
-
logic:
|
|
4836
|
+
logic: z37.array(ContainerLogicSchema).optional()
|
|
4257
4837
|
});
|
|
4258
4838
|
const GroupFieldSchema = ContainerBaseSchema.extend({
|
|
4259
|
-
type:
|
|
4260
|
-
fields:
|
|
4839
|
+
type: z37.literal("group"),
|
|
4840
|
+
fields: z37.array(AnyFieldSchema),
|
|
4261
4841
|
// Container logic - only 'hidden' type allowed (same as pages)
|
|
4262
|
-
logic:
|
|
4842
|
+
logic: z37.array(ContainerLogicSchema).optional()
|
|
4263
4843
|
});
|
|
4264
|
-
const ArrayButtonConfigSchema =
|
|
4265
|
-
label:
|
|
4266
|
-
props:
|
|
4844
|
+
const ArrayButtonConfigSchema = z37.object({
|
|
4845
|
+
label: z37.string().optional(),
|
|
4846
|
+
props: z37.record(z37.unknown()).optional()
|
|
4267
4847
|
});
|
|
4268
4848
|
const FullArrayFieldSchema = ContainerBaseSchema.extend({
|
|
4269
|
-
type:
|
|
4270
|
-
fields:
|
|
4271
|
-
logic:
|
|
4849
|
+
type: z37.literal("array"),
|
|
4850
|
+
fields: z37.array(AnyFieldSchema),
|
|
4851
|
+
logic: z37.array(ContainerLogicSchema).optional(),
|
|
4272
4852
|
// Full API does not use template
|
|
4273
|
-
template:
|
|
4853
|
+
template: z37.never().optional(),
|
|
4274
4854
|
// Array length validation
|
|
4275
|
-
minLength:
|
|
4276
|
-
maxLength:
|
|
4855
|
+
minLength: z37.number().int().min(0).optional(),
|
|
4856
|
+
maxLength: z37.number().int().min(0).optional()
|
|
4277
4857
|
});
|
|
4278
|
-
const ArrayAllowedChildSchema =
|
|
4858
|
+
const ArrayAllowedChildSchema = z37.lazy(
|
|
4279
4859
|
() => AnyFieldSchema.refine((field) => field.type !== "page" && field.type !== "array", {
|
|
4280
4860
|
message: "Array templates cannot contain page or array fields. Only leaf fields, rows, and groups are allowed."
|
|
4281
4861
|
})
|
|
4282
4862
|
);
|
|
4283
4863
|
const SimplifiedArrayFieldSchema = ContainerBaseSchema.extend({
|
|
4284
|
-
type:
|
|
4864
|
+
type: z37.literal("array"),
|
|
4285
4865
|
// Template: single field (primitive array) or array of fields (object array)
|
|
4286
4866
|
// Only ArrayAllowedChildren (leaf fields, rows, groups) are valid — no pages or nested arrays.
|
|
4287
|
-
template:
|
|
4867
|
+
template: z37.union([ArrayAllowedChildSchema, z37.array(ArrayAllowedChildSchema)]),
|
|
4288
4868
|
// Initial values for the array
|
|
4289
|
-
value:
|
|
4869
|
+
value: z37.array(z37.unknown()).optional(),
|
|
4290
4870
|
// Button customization or opt-out (false to disable)
|
|
4291
|
-
addButton:
|
|
4292
|
-
removeButton:
|
|
4293
|
-
logic:
|
|
4871
|
+
addButton: z37.union([ArrayButtonConfigSchema, z37.literal(false)]).optional(),
|
|
4872
|
+
removeButton: z37.union([ArrayButtonConfigSchema, z37.literal(false)]).optional(),
|
|
4873
|
+
logic: z37.array(ContainerLogicSchema).optional(),
|
|
4294
4874
|
// Array length validation
|
|
4295
|
-
minLength:
|
|
4296
|
-
maxLength:
|
|
4875
|
+
minLength: z37.number().int().min(0).optional(),
|
|
4876
|
+
maxLength: z37.number().int().min(0).optional(),
|
|
4297
4877
|
// Simplified API does not use fields
|
|
4298
|
-
fields:
|
|
4299
|
-
minItems:
|
|
4300
|
-
maxItems:
|
|
4878
|
+
fields: z37.never().optional(),
|
|
4879
|
+
minItems: z37.never().optional(),
|
|
4880
|
+
maxItems: z37.never().optional()
|
|
4301
4881
|
});
|
|
4302
|
-
const ArrayFieldSchema =
|
|
4882
|
+
const ArrayFieldSchema = z37.union([FullArrayFieldSchema, SimplifiedArrayFieldSchema]);
|
|
4303
4883
|
const AllFieldsSchema = AnyFieldSchema;
|
|
4304
4884
|
return {
|
|
4305
4885
|
PageFieldSchema,
|
|
@@ -4321,48 +4901,48 @@ var MatArrayFieldSchema = containerSchemas.ArrayFieldSchema;
|
|
|
4321
4901
|
var MatFieldSchema = containerSchemas.AllFieldsSchema;
|
|
4322
4902
|
|
|
4323
4903
|
// internal/dynamic-forms-zod/material/src/mat-form-config.schema.ts
|
|
4324
|
-
import { z as
|
|
4904
|
+
import { z as z41 } from "zod";
|
|
4325
4905
|
|
|
4326
4906
|
// internal/dynamic-forms-zod/src/lib/schemas/form/form-config.schema.ts
|
|
4327
|
-
import { z as
|
|
4907
|
+
import { z as z40 } from "zod";
|
|
4328
4908
|
|
|
4329
4909
|
// internal/dynamic-forms-zod/src/lib/schemas/form/form-options.schema.ts
|
|
4330
|
-
import { z as
|
|
4331
|
-
var SubmitButtonOptionsSchema =
|
|
4910
|
+
import { z as z38 } from "zod";
|
|
4911
|
+
var SubmitButtonOptionsSchema = z38.object({
|
|
4332
4912
|
/**
|
|
4333
4913
|
* Whether to disable the submit button when the form is invalid.
|
|
4334
4914
|
* Defaults to true.
|
|
4335
4915
|
*/
|
|
4336
|
-
disableWhenInvalid:
|
|
4916
|
+
disableWhenInvalid: z38.boolean().optional(),
|
|
4337
4917
|
/**
|
|
4338
4918
|
* Whether to disable the submit button while the form is submitting.
|
|
4339
4919
|
* Defaults to true.
|
|
4340
4920
|
*/
|
|
4341
|
-
disableWhileSubmitting:
|
|
4921
|
+
disableWhileSubmitting: z38.boolean().optional()
|
|
4342
4922
|
});
|
|
4343
|
-
var NextButtonOptionsSchema =
|
|
4923
|
+
var NextButtonOptionsSchema = z38.object({
|
|
4344
4924
|
/**
|
|
4345
4925
|
* Whether to disable the next button when the current page is invalid.
|
|
4346
4926
|
* Defaults to true.
|
|
4347
4927
|
*/
|
|
4348
|
-
disableWhenPageInvalid:
|
|
4928
|
+
disableWhenPageInvalid: z38.boolean().optional(),
|
|
4349
4929
|
/**
|
|
4350
4930
|
* Whether to disable the next button while the form is submitting.
|
|
4351
4931
|
* Defaults to true.
|
|
4352
4932
|
*/
|
|
4353
|
-
disableWhileSubmitting:
|
|
4933
|
+
disableWhileSubmitting: z38.boolean().optional()
|
|
4354
4934
|
});
|
|
4355
|
-
var FormOptionsSchema =
|
|
4935
|
+
var FormOptionsSchema = z38.object({
|
|
4356
4936
|
/**
|
|
4357
4937
|
* Whether the entire form is disabled.
|
|
4358
4938
|
*/
|
|
4359
|
-
disabled:
|
|
4939
|
+
disabled: z38.boolean().optional(),
|
|
4360
4940
|
/**
|
|
4361
4941
|
* Maximum number of derivation iterations before stopping.
|
|
4362
4942
|
* Prevents infinite loops in circular derivations.
|
|
4363
4943
|
* Defaults to 10.
|
|
4364
4944
|
*/
|
|
4365
|
-
maxDerivationIterations:
|
|
4945
|
+
maxDerivationIterations: z38.number().positive().optional(),
|
|
4366
4946
|
/**
|
|
4367
4947
|
* Options for the submit button behavior.
|
|
4368
4948
|
*/
|
|
@@ -4375,36 +4955,36 @@ var FormOptionsSchema = z37.object({
|
|
|
4375
4955
|
* Whether to exclude values of hidden fields from submission output.
|
|
4376
4956
|
* Overrides the global withValueExclusionDefaults() setting for this form.
|
|
4377
4957
|
*/
|
|
4378
|
-
excludeValueIfHidden:
|
|
4958
|
+
excludeValueIfHidden: z38.boolean().optional(),
|
|
4379
4959
|
/**
|
|
4380
4960
|
* Whether to exclude values of disabled fields from submission output.
|
|
4381
4961
|
* Overrides the global withValueExclusionDefaults() setting for this form.
|
|
4382
4962
|
*/
|
|
4383
|
-
excludeValueIfDisabled:
|
|
4963
|
+
excludeValueIfDisabled: z38.boolean().optional(),
|
|
4384
4964
|
/**
|
|
4385
4965
|
* Whether to exclude values of readonly fields from submission output.
|
|
4386
4966
|
* Overrides the global withValueExclusionDefaults() setting for this form.
|
|
4387
4967
|
*/
|
|
4388
|
-
excludeValueIfReadonly:
|
|
4968
|
+
excludeValueIfReadonly: z38.boolean().optional()
|
|
4389
4969
|
});
|
|
4390
4970
|
|
|
4391
4971
|
// internal/dynamic-forms-zod/src/lib/schemas/form/schema-definition.schema.ts
|
|
4392
|
-
import { z as
|
|
4393
|
-
var SchemaDefinitionSchema =
|
|
4972
|
+
import { z as z39 } from "zod";
|
|
4973
|
+
var SchemaDefinitionSchema = z39.object({
|
|
4394
4974
|
/**
|
|
4395
4975
|
* Unique identifier for the schema.
|
|
4396
4976
|
* Used to reference the schema in SchemaApplicationConfig.
|
|
4397
4977
|
*/
|
|
4398
|
-
name:
|
|
4978
|
+
name: z39.string(),
|
|
4399
4979
|
/**
|
|
4400
4980
|
* Human-readable description of what this schema validates.
|
|
4401
4981
|
*/
|
|
4402
|
-
description:
|
|
4982
|
+
description: z39.string().optional(),
|
|
4403
4983
|
/**
|
|
4404
4984
|
* Field path pattern for automatic schema application.
|
|
4405
4985
|
* Supports glob-like patterns.
|
|
4406
4986
|
*/
|
|
4407
|
-
pathPattern:
|
|
4987
|
+
pathPattern: z39.string().optional(),
|
|
4408
4988
|
/**
|
|
4409
4989
|
* Validators to apply to fields using this schema.
|
|
4410
4990
|
*/
|
|
@@ -4416,17 +4996,17 @@ var SchemaDefinitionSchema = z38.object({
|
|
|
4416
4996
|
/**
|
|
4417
4997
|
* Nested schema applications for composing schemas.
|
|
4418
4998
|
*/
|
|
4419
|
-
subSchemas:
|
|
4999
|
+
subSchemas: z39.array(SchemaApplicationConfigSchema).optional()
|
|
4420
5000
|
});
|
|
4421
|
-
var SchemaDefinitionsArraySchema =
|
|
5001
|
+
var SchemaDefinitionsArraySchema = z39.array(SchemaDefinitionSchema);
|
|
4422
5002
|
|
|
4423
5003
|
// internal/dynamic-forms-zod/src/lib/schemas/form/form-config.schema.ts
|
|
4424
5004
|
function createFormConfigSchema(fieldSchema, propsSchema) {
|
|
4425
|
-
const baseSchema =
|
|
5005
|
+
const baseSchema = z40.object({
|
|
4426
5006
|
/**
|
|
4427
5007
|
* Array of field definitions that make up the form.
|
|
4428
5008
|
*/
|
|
4429
|
-
fields:
|
|
5009
|
+
fields: z40.array(fieldSchema),
|
|
4430
5010
|
/**
|
|
4431
5011
|
* Form-level options controlling behavior.
|
|
4432
5012
|
*/
|
|
@@ -4466,15 +5046,15 @@ function createFormConfigSchema(fieldSchema, propsSchema) {
|
|
|
4466
5046
|
}
|
|
4467
5047
|
return baseSchema;
|
|
4468
5048
|
}
|
|
4469
|
-
var BaseFormConfigSchema =
|
|
4470
|
-
fields:
|
|
5049
|
+
var BaseFormConfigSchema = z40.object({
|
|
5050
|
+
fields: z40.array(z40.any()),
|
|
4471
5051
|
options: FormOptionsSchema.optional(),
|
|
4472
5052
|
schemas: SchemaDefinitionsArraySchema.optional(),
|
|
4473
5053
|
defaultValidationMessages: ValidationMessagesSchema.optional()
|
|
4474
5054
|
});
|
|
4475
5055
|
|
|
4476
5056
|
// internal/dynamic-forms-zod/material/src/mat-form-config.schema.ts
|
|
4477
|
-
var MatFormDefaultPropsSchema =
|
|
5057
|
+
var MatFormDefaultPropsSchema = z41.object({
|
|
4478
5058
|
/**
|
|
4479
5059
|
* Default form field appearance for all fields.
|
|
4480
5060
|
*/
|
|
@@ -4491,15 +5071,15 @@ var MatFormDefaultPropsSchema = z40.object({
|
|
|
4491
5071
|
var MatFormConfigSchema = createFormConfigSchema(MatFieldSchema, MatFormDefaultPropsSchema);
|
|
4492
5072
|
|
|
4493
5073
|
// internal/dynamic-forms-zod/bootstrap/src/props/index.ts
|
|
4494
|
-
import { z as
|
|
5074
|
+
import { z as z43 } from "zod";
|
|
4495
5075
|
|
|
4496
5076
|
// internal/dynamic-forms-zod/bootstrap/src/props/bs-common-props.schema.ts
|
|
4497
|
-
import { z as
|
|
4498
|
-
var BsSizeSchema =
|
|
4499
|
-
var BsButtonVariantSchema =
|
|
4500
|
-
var BsFormFieldPropsSchema =
|
|
5077
|
+
import { z as z42 } from "zod";
|
|
5078
|
+
var BsSizeSchema = z42.enum(["sm", "lg"]);
|
|
5079
|
+
var BsButtonVariantSchema = z42.enum(["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "link"]);
|
|
5080
|
+
var BsFormFieldPropsSchema = z42.object({
|
|
4501
5081
|
size: BsSizeSchema.optional(),
|
|
4502
|
-
floatingLabel:
|
|
5082
|
+
floatingLabel: z42.boolean().optional(),
|
|
4503
5083
|
hint: DynamicTextSchema.optional(),
|
|
4504
5084
|
validFeedback: DynamicTextSchema.optional(),
|
|
4505
5085
|
invalidFeedback: DynamicTextSchema.optional()
|
|
@@ -4507,194 +5087,208 @@ var BsFormFieldPropsSchema = z41.object({
|
|
|
4507
5087
|
|
|
4508
5088
|
// internal/dynamic-forms-zod/bootstrap/src/props/index.ts
|
|
4509
5089
|
var BsInputPropsSchema = BsFormFieldPropsSchema.extend({
|
|
4510
|
-
type:
|
|
5090
|
+
type: z43.enum(["text", "email", "password", "number", "tel", "url"]).optional(),
|
|
4511
5091
|
placeholder: DynamicTextSchema.optional(),
|
|
4512
|
-
plaintext:
|
|
5092
|
+
plaintext: z43.boolean().optional()
|
|
4513
5093
|
});
|
|
4514
5094
|
var BsTextareaPropsSchema = BsFormFieldPropsSchema.extend({
|
|
4515
|
-
rows:
|
|
5095
|
+
rows: z43.number().positive().optional(),
|
|
4516
5096
|
placeholder: DynamicTextSchema.optional()
|
|
4517
5097
|
});
|
|
4518
5098
|
var BsSelectPropsSchema = BsFormFieldPropsSchema.extend({
|
|
4519
|
-
multiple:
|
|
4520
|
-
htmlSize:
|
|
5099
|
+
multiple: z43.boolean().optional(),
|
|
5100
|
+
htmlSize: z43.number().positive().optional(),
|
|
4521
5101
|
placeholder: DynamicTextSchema.optional()
|
|
4522
5102
|
});
|
|
4523
|
-
var BsCheckboxPropsSchema =
|
|
4524
|
-
switch:
|
|
4525
|
-
inline:
|
|
4526
|
-
reverse:
|
|
4527
|
-
indeterminate:
|
|
5103
|
+
var BsCheckboxPropsSchema = z43.object({
|
|
5104
|
+
switch: z43.boolean().optional(),
|
|
5105
|
+
inline: z43.boolean().optional(),
|
|
5106
|
+
reverse: z43.boolean().optional(),
|
|
5107
|
+
indeterminate: z43.boolean().optional(),
|
|
4528
5108
|
hint: DynamicTextSchema.optional()
|
|
4529
5109
|
});
|
|
4530
|
-
var BsRadioPropsSchema =
|
|
4531
|
-
inline:
|
|
4532
|
-
reverse:
|
|
4533
|
-
buttonGroup:
|
|
5110
|
+
var BsRadioPropsSchema = z43.object({
|
|
5111
|
+
inline: z43.boolean().optional(),
|
|
5112
|
+
reverse: z43.boolean().optional(),
|
|
5113
|
+
buttonGroup: z43.boolean().optional(),
|
|
4534
5114
|
buttonSize: BsSizeSchema.optional(),
|
|
4535
5115
|
hint: DynamicTextSchema.optional()
|
|
4536
5116
|
});
|
|
4537
|
-
var BsMultiCheckboxPropsSchema =
|
|
4538
|
-
switch:
|
|
4539
|
-
inline:
|
|
4540
|
-
reverse:
|
|
5117
|
+
var BsMultiCheckboxPropsSchema = z43.object({
|
|
5118
|
+
switch: z43.boolean().optional(),
|
|
5119
|
+
inline: z43.boolean().optional(),
|
|
5120
|
+
reverse: z43.boolean().optional(),
|
|
4541
5121
|
hint: DynamicTextSchema.optional()
|
|
4542
5122
|
});
|
|
4543
|
-
var BsTogglePropsSchema =
|
|
5123
|
+
var BsTogglePropsSchema = z43.object({
|
|
4544
5124
|
size: BsSizeSchema.optional(),
|
|
4545
|
-
reverse:
|
|
4546
|
-
inline:
|
|
5125
|
+
reverse: z43.boolean().optional(),
|
|
5126
|
+
inline: z43.boolean().optional(),
|
|
4547
5127
|
hint: DynamicTextSchema.optional()
|
|
4548
5128
|
});
|
|
4549
5129
|
var BsDatepickerPropsSchema = BsFormFieldPropsSchema.extend({
|
|
4550
|
-
useNgBootstrap:
|
|
4551
|
-
displayMonths:
|
|
4552
|
-
navigation:
|
|
4553
|
-
outsideDays:
|
|
4554
|
-
showWeekNumbers:
|
|
5130
|
+
useNgBootstrap: z43.boolean().optional(),
|
|
5131
|
+
displayMonths: z43.number().positive().optional(),
|
|
5132
|
+
navigation: z43.enum(["select", "arrows", "none"]).optional(),
|
|
5133
|
+
outsideDays: z43.enum(["visible", "collapsed", "hidden"]).optional(),
|
|
5134
|
+
showWeekNumbers: z43.boolean().optional(),
|
|
4555
5135
|
placeholder: DynamicTextSchema.optional()
|
|
4556
5136
|
});
|
|
4557
|
-
var BsSliderPropsSchema =
|
|
4558
|
-
showValue:
|
|
4559
|
-
valuePrefix:
|
|
4560
|
-
valueSuffix:
|
|
5137
|
+
var BsSliderPropsSchema = z43.object({
|
|
5138
|
+
showValue: z43.boolean().optional(),
|
|
5139
|
+
valuePrefix: z43.string().optional(),
|
|
5140
|
+
valueSuffix: z43.string().optional(),
|
|
4561
5141
|
hint: DynamicTextSchema.optional(),
|
|
4562
|
-
min:
|
|
4563
|
-
max:
|
|
4564
|
-
step:
|
|
5142
|
+
min: z43.number().optional(),
|
|
5143
|
+
max: z43.number().optional(),
|
|
5144
|
+
step: z43.number().positive().optional()
|
|
4565
5145
|
});
|
|
4566
|
-
var BsButtonPropsSchema =
|
|
5146
|
+
var BsButtonPropsSchema = z43.object({
|
|
4567
5147
|
variant: BsButtonVariantSchema.optional(),
|
|
4568
|
-
outline:
|
|
5148
|
+
outline: z43.boolean().optional(),
|
|
4569
5149
|
size: BsSizeSchema.optional(),
|
|
4570
|
-
block:
|
|
4571
|
-
active:
|
|
4572
|
-
type:
|
|
5150
|
+
block: z43.boolean().optional(),
|
|
5151
|
+
active: z43.boolean().optional(),
|
|
5152
|
+
type: z43.enum(["button", "submit", "reset"]).optional()
|
|
4573
5153
|
});
|
|
4574
5154
|
|
|
4575
5155
|
// internal/dynamic-forms-zod/bootstrap/src/fields/index.ts
|
|
4576
|
-
import { z as
|
|
5156
|
+
import { z as z44 } from "zod";
|
|
4577
5157
|
var BsValueFieldBase = BaseFieldDefSchema.merge(FieldWithValidationSchema);
|
|
4578
|
-
var
|
|
4579
|
-
type:
|
|
4580
|
-
|
|
5158
|
+
var BsInputFieldSchemaObject = BsValueFieldBase.extend({
|
|
5159
|
+
type: z44.literal("input"),
|
|
5160
|
+
nullable: z44.boolean().optional(),
|
|
5161
|
+
value: z44.string().nullable().optional(),
|
|
4581
5162
|
placeholder: DynamicTextSchema.optional(),
|
|
4582
5163
|
props: BsInputPropsSchema.optional()
|
|
4583
5164
|
});
|
|
4584
|
-
var
|
|
4585
|
-
|
|
4586
|
-
|
|
5165
|
+
var BsInputFieldSchema = BsInputFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5166
|
+
var BsTextareaFieldSchemaObject = BsValueFieldBase.extend({
|
|
5167
|
+
type: z44.literal("textarea"),
|
|
5168
|
+
nullable: z44.boolean().optional(),
|
|
5169
|
+
value: z44.string().nullable().optional(),
|
|
4587
5170
|
placeholder: DynamicTextSchema.optional(),
|
|
4588
5171
|
props: BsTextareaPropsSchema.optional()
|
|
4589
5172
|
});
|
|
4590
|
-
var
|
|
4591
|
-
|
|
4592
|
-
|
|
5173
|
+
var BsTextareaFieldSchema = BsTextareaFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5174
|
+
var BsSelectFieldSchemaObject = BsValueFieldBase.extend({
|
|
5175
|
+
type: z44.literal("select"),
|
|
5176
|
+
nullable: z44.boolean().optional(),
|
|
5177
|
+
value: z44.string().nullable().optional(),
|
|
4593
5178
|
// Bootstrap select only supports strings
|
|
4594
5179
|
placeholder: DynamicTextSchema.optional(),
|
|
4595
5180
|
options: FieldOptionsSchema,
|
|
4596
5181
|
props: BsSelectPropsSchema.optional()
|
|
4597
5182
|
});
|
|
5183
|
+
var BsSelectFieldSchema = BsSelectFieldSchemaObject.superRefine(nullableValueRefine);
|
|
4598
5184
|
var BsCheckboxFieldSchema = BsValueFieldBase.extend({
|
|
4599
|
-
type:
|
|
4600
|
-
value:
|
|
5185
|
+
type: z44.literal("checkbox"),
|
|
5186
|
+
value: z44.boolean().optional(),
|
|
4601
5187
|
placeholder: DynamicTextSchema.optional(),
|
|
4602
5188
|
props: BsCheckboxPropsSchema.optional()
|
|
4603
5189
|
});
|
|
4604
|
-
var
|
|
4605
|
-
type:
|
|
4606
|
-
|
|
5190
|
+
var BsRadioFieldSchemaObject = BsValueFieldBase.extend({
|
|
5191
|
+
type: z44.literal("radio"),
|
|
5192
|
+
nullable: z44.boolean().optional(),
|
|
5193
|
+
value: z44.unknown().nullable().optional(),
|
|
4607
5194
|
placeholder: DynamicTextSchema.optional(),
|
|
4608
5195
|
options: FieldOptionsSchema,
|
|
4609
5196
|
props: BsRadioPropsSchema.optional()
|
|
4610
5197
|
});
|
|
4611
|
-
var
|
|
4612
|
-
|
|
4613
|
-
|
|
5198
|
+
var BsRadioFieldSchema = BsRadioFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5199
|
+
var BsMultiCheckboxFieldSchemaObject = BsValueFieldBase.extend({
|
|
5200
|
+
type: z44.literal("multi-checkbox"),
|
|
5201
|
+
nullable: z44.boolean().optional(),
|
|
5202
|
+
value: z44.array(z44.unknown()).nullable().optional(),
|
|
4614
5203
|
placeholder: DynamicTextSchema.optional(),
|
|
4615
5204
|
options: FieldOptionsSchema,
|
|
4616
5205
|
props: BsMultiCheckboxPropsSchema.optional()
|
|
4617
5206
|
});
|
|
5207
|
+
var BsMultiCheckboxFieldSchema = BsMultiCheckboxFieldSchemaObject.superRefine(nullableValueRefine);
|
|
4618
5208
|
var BsToggleFieldSchema = BsValueFieldBase.extend({
|
|
4619
|
-
type:
|
|
4620
|
-
value:
|
|
5209
|
+
type: z44.literal("toggle"),
|
|
5210
|
+
value: z44.boolean().optional(),
|
|
4621
5211
|
placeholder: DynamicTextSchema.optional(),
|
|
4622
5212
|
props: BsTogglePropsSchema.optional()
|
|
4623
5213
|
});
|
|
4624
|
-
var
|
|
4625
|
-
type:
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
5214
|
+
var BsDatepickerFieldSchemaObject = BsValueFieldBase.extend({
|
|
5215
|
+
type: z44.literal("datepicker"),
|
|
5216
|
+
nullable: z44.boolean().optional(),
|
|
5217
|
+
value: z44.union([z44.string(), z44.null()]).optional(),
|
|
5218
|
+
minDate: z44.union([z44.string(), z44.null()]).optional(),
|
|
5219
|
+
maxDate: z44.union([z44.string(), z44.null()]).optional(),
|
|
5220
|
+
startAt: z44.union([z44.string(), z44.null()]).optional(),
|
|
4630
5221
|
placeholder: DynamicTextSchema.optional(),
|
|
4631
5222
|
props: BsDatepickerPropsSchema.optional()
|
|
4632
5223
|
});
|
|
4633
|
-
var
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
5224
|
+
var BsDatepickerFieldSchema = BsDatepickerFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5225
|
+
var BsSliderFieldSchemaObject = BsValueFieldBase.extend({
|
|
5226
|
+
type: z44.literal("slider"),
|
|
5227
|
+
nullable: z44.boolean().optional(),
|
|
5228
|
+
value: z44.number().nullable().optional(),
|
|
5229
|
+
minValue: z44.number().optional(),
|
|
5230
|
+
maxValue: z44.number().optional(),
|
|
5231
|
+
step: z44.number().positive().optional(),
|
|
4639
5232
|
placeholder: DynamicTextSchema.optional(),
|
|
4640
5233
|
props: BsSliderPropsSchema.optional()
|
|
4641
5234
|
});
|
|
5235
|
+
var BsSliderFieldSchema = BsSliderFieldSchemaObject.superRefine(nullableValueRefine);
|
|
4642
5236
|
var BsButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4643
|
-
type:
|
|
4644
|
-
event:
|
|
4645
|
-
eventArgs:
|
|
5237
|
+
type: z44.literal("button"),
|
|
5238
|
+
event: z44.string().optional(),
|
|
5239
|
+
eventArgs: z44.array(z44.union([z44.string(), z44.number(), z44.boolean(), z44.null(), z44.undefined()])).optional(),
|
|
4646
5240
|
props: BsButtonPropsSchema.optional(),
|
|
4647
5241
|
logic: LogicArraySchema.optional()
|
|
4648
5242
|
});
|
|
4649
5243
|
var BsSubmitButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4650
|
-
type:
|
|
5244
|
+
type: z44.literal("submit"),
|
|
4651
5245
|
props: BsButtonPropsSchema.optional(),
|
|
4652
5246
|
logic: LogicArraySchema.optional()
|
|
4653
5247
|
});
|
|
4654
5248
|
var BsNextButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4655
|
-
type:
|
|
5249
|
+
type: z44.literal("next"),
|
|
4656
5250
|
props: BsButtonPropsSchema.optional(),
|
|
4657
5251
|
logic: LogicArraySchema.optional()
|
|
4658
5252
|
});
|
|
4659
5253
|
var BsPreviousButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4660
|
-
type:
|
|
5254
|
+
type: z44.literal("previous"),
|
|
4661
5255
|
props: BsButtonPropsSchema.optional()
|
|
4662
5256
|
});
|
|
4663
5257
|
var BsAddArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4664
|
-
type:
|
|
4665
|
-
arrayKey:
|
|
5258
|
+
type: z44.literal("addArrayItem"),
|
|
5259
|
+
arrayKey: z44.string().optional(),
|
|
4666
5260
|
props: BsButtonPropsSchema.optional()
|
|
4667
5261
|
});
|
|
4668
5262
|
var BsRemoveArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4669
|
-
type:
|
|
4670
|
-
arrayKey:
|
|
5263
|
+
type: z44.literal("removeArrayItem"),
|
|
5264
|
+
arrayKey: z44.string().optional(),
|
|
4671
5265
|
props: BsButtonPropsSchema.optional()
|
|
4672
5266
|
});
|
|
4673
5267
|
|
|
4674
5268
|
// internal/dynamic-forms-zod/bootstrap/src/bs-leaf-field.schema.ts
|
|
4675
|
-
import { z as
|
|
4676
|
-
var BsLeafFieldSchema =
|
|
5269
|
+
import { z as z45 } from "zod";
|
|
5270
|
+
var BsLeafFieldSchema = z45.discriminatedUnion("type", [
|
|
4677
5271
|
TextFieldSchema,
|
|
4678
5272
|
HiddenFieldSchema,
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
5273
|
+
BsInputFieldSchemaObject,
|
|
5274
|
+
BsTextareaFieldSchemaObject,
|
|
5275
|
+
BsSelectFieldSchemaObject,
|
|
4682
5276
|
BsCheckboxFieldSchema,
|
|
4683
|
-
|
|
4684
|
-
|
|
5277
|
+
BsRadioFieldSchemaObject,
|
|
5278
|
+
BsMultiCheckboxFieldSchemaObject,
|
|
4685
5279
|
BsToggleFieldSchema,
|
|
4686
|
-
|
|
4687
|
-
|
|
5280
|
+
BsDatepickerFieldSchemaObject,
|
|
5281
|
+
BsSliderFieldSchemaObject,
|
|
4688
5282
|
BsButtonFieldSchema,
|
|
4689
5283
|
BsSubmitButtonFieldSchema,
|
|
4690
5284
|
BsNextButtonFieldSchema,
|
|
4691
5285
|
BsPreviousButtonFieldSchema,
|
|
4692
5286
|
BsAddArrayItemButtonFieldSchema,
|
|
4693
5287
|
BsRemoveArrayItemButtonFieldSchema
|
|
4694
|
-
]);
|
|
5288
|
+
]).superRefine(nullableValueRefine);
|
|
4695
5289
|
|
|
4696
5290
|
// internal/dynamic-forms-zod/bootstrap/src/bs-form-config.schema.ts
|
|
4697
|
-
import { z as
|
|
5291
|
+
import { z as z46 } from "zod";
|
|
4698
5292
|
var containerSchemas2 = createContainerSchemas({
|
|
4699
5293
|
leafFieldSchema: BsLeafFieldSchema
|
|
4700
5294
|
});
|
|
@@ -4703,186 +5297,200 @@ var BsRowFieldSchema = containerSchemas2.RowFieldSchema;
|
|
|
4703
5297
|
var BsGroupFieldSchema = containerSchemas2.GroupFieldSchema;
|
|
4704
5298
|
var BsArrayFieldSchema = containerSchemas2.ArrayFieldSchema;
|
|
4705
5299
|
var BsFieldSchema = containerSchemas2.AllFieldsSchema;
|
|
4706
|
-
var BsFormDefaultPropsSchema =
|
|
5300
|
+
var BsFormDefaultPropsSchema = z46.object({
|
|
4707
5301
|
size: BsSizeSchema.optional(),
|
|
4708
|
-
floatingLabel:
|
|
5302
|
+
floatingLabel: z46.boolean().optional()
|
|
4709
5303
|
});
|
|
4710
5304
|
var BsFormConfigSchema = createFormConfigSchema(BsFieldSchema, BsFormDefaultPropsSchema);
|
|
4711
5305
|
|
|
4712
5306
|
// internal/dynamic-forms-zod/primeng/src/props/index.ts
|
|
4713
|
-
import { z as
|
|
4714
|
-
var PrimeSeveritySchema =
|
|
4715
|
-
var PrimeCommonPropsSchema =
|
|
4716
|
-
styleClass:
|
|
5307
|
+
import { z as z47 } from "zod";
|
|
5308
|
+
var PrimeSeveritySchema = z47.enum(["primary", "secondary", "success", "info", "warn", "danger", "help", "contrast"]);
|
|
5309
|
+
var PrimeCommonPropsSchema = z47.object({
|
|
5310
|
+
styleClass: z47.string().optional(),
|
|
4717
5311
|
hint: DynamicTextSchema.optional()
|
|
4718
5312
|
});
|
|
4719
5313
|
var PrimeInputPropsSchema = PrimeCommonPropsSchema.extend({
|
|
4720
|
-
type:
|
|
5314
|
+
type: z47.enum(["text", "email", "password", "number", "tel", "url"]).optional(),
|
|
4721
5315
|
placeholder: DynamicTextSchema.optional(),
|
|
4722
|
-
size:
|
|
4723
|
-
variant:
|
|
5316
|
+
size: z47.enum(["small", "large"]).optional(),
|
|
5317
|
+
variant: z47.enum(["outlined", "filled"]).optional()
|
|
4724
5318
|
});
|
|
4725
5319
|
var PrimeCheckboxPropsSchema = PrimeCommonPropsSchema.extend({
|
|
4726
|
-
binary:
|
|
4727
|
-
trueValue:
|
|
4728
|
-
falseValue:
|
|
5320
|
+
binary: z47.boolean().optional(),
|
|
5321
|
+
trueValue: z47.unknown().optional(),
|
|
5322
|
+
falseValue: z47.unknown().optional()
|
|
4729
5323
|
});
|
|
4730
5324
|
var PrimeRadioPropsSchema = PrimeCommonPropsSchema.extend({
|
|
4731
|
-
name:
|
|
5325
|
+
name: z47.string().optional()
|
|
4732
5326
|
});
|
|
4733
5327
|
var PrimeSelectPropsSchema = PrimeCommonPropsSchema.extend({
|
|
4734
|
-
multiple:
|
|
4735
|
-
filter:
|
|
5328
|
+
multiple: z47.boolean().optional(),
|
|
5329
|
+
filter: z47.boolean().optional(),
|
|
4736
5330
|
placeholder: DynamicTextSchema.optional(),
|
|
4737
|
-
showClear:
|
|
5331
|
+
showClear: z47.boolean().optional()
|
|
4738
5332
|
});
|
|
4739
5333
|
var PrimeMultiCheckboxPropsSchema = PrimeCommonPropsSchema;
|
|
4740
5334
|
var PrimeDatepickerPropsSchema = PrimeCommonPropsSchema.extend({
|
|
4741
|
-
dateFormat:
|
|
4742
|
-
inline:
|
|
4743
|
-
showIcon:
|
|
4744
|
-
showButtonBar:
|
|
4745
|
-
selectionMode:
|
|
4746
|
-
touchUI:
|
|
4747
|
-
view:
|
|
5335
|
+
dateFormat: z47.string().optional(),
|
|
5336
|
+
inline: z47.boolean().optional(),
|
|
5337
|
+
showIcon: z47.boolean().optional(),
|
|
5338
|
+
showButtonBar: z47.boolean().optional(),
|
|
5339
|
+
selectionMode: z47.enum(["single", "multiple", "range"]).optional(),
|
|
5340
|
+
touchUI: z47.boolean().optional(),
|
|
5341
|
+
view: z47.enum(["date", "month", "year"]).optional(),
|
|
4748
5342
|
placeholder: DynamicTextSchema.optional()
|
|
4749
5343
|
});
|
|
4750
5344
|
var PrimeTextareaPropsSchema = PrimeCommonPropsSchema.extend({
|
|
4751
|
-
rows:
|
|
4752
|
-
autoResize:
|
|
4753
|
-
maxlength:
|
|
5345
|
+
rows: z47.number().positive().optional(),
|
|
5346
|
+
autoResize: z47.boolean().optional(),
|
|
5347
|
+
maxlength: z47.number().positive().optional(),
|
|
4754
5348
|
placeholder: DynamicTextSchema.optional()
|
|
4755
5349
|
});
|
|
4756
5350
|
var PrimeSliderPropsSchema = PrimeCommonPropsSchema.extend({
|
|
4757
|
-
min:
|
|
4758
|
-
max:
|
|
4759
|
-
step:
|
|
4760
|
-
range:
|
|
4761
|
-
orientation:
|
|
5351
|
+
min: z47.number().optional(),
|
|
5352
|
+
max: z47.number().optional(),
|
|
5353
|
+
step: z47.number().positive().optional(),
|
|
5354
|
+
range: z47.boolean().optional(),
|
|
5355
|
+
orientation: z47.enum(["horizontal", "vertical"]).optional()
|
|
4762
5356
|
});
|
|
4763
5357
|
var PrimeTogglePropsSchema = PrimeCommonPropsSchema;
|
|
4764
|
-
var PrimeButtonPropsSchema =
|
|
5358
|
+
var PrimeButtonPropsSchema = z47.object({
|
|
4765
5359
|
severity: PrimeSeveritySchema.optional(),
|
|
4766
|
-
text:
|
|
4767
|
-
outlined:
|
|
4768
|
-
raised:
|
|
4769
|
-
rounded:
|
|
4770
|
-
icon:
|
|
4771
|
-
iconPos:
|
|
4772
|
-
type:
|
|
5360
|
+
text: z47.boolean().optional(),
|
|
5361
|
+
outlined: z47.boolean().optional(),
|
|
5362
|
+
raised: z47.boolean().optional(),
|
|
5363
|
+
rounded: z47.boolean().optional(),
|
|
5364
|
+
icon: z47.string().optional(),
|
|
5365
|
+
iconPos: z47.enum(["left", "right", "top", "bottom"]).optional(),
|
|
5366
|
+
type: z47.enum(["button", "submit", "reset"]).optional()
|
|
4773
5367
|
});
|
|
4774
5368
|
|
|
4775
5369
|
// internal/dynamic-forms-zod/primeng/src/fields/index.ts
|
|
4776
|
-
import { z as
|
|
5370
|
+
import { z as z48 } from "zod";
|
|
4777
5371
|
var PrimeValueFieldBase = BaseFieldDefSchema.merge(FieldWithValidationSchema);
|
|
4778
|
-
var
|
|
4779
|
-
type:
|
|
4780
|
-
|
|
5372
|
+
var PrimeInputFieldSchemaObject = PrimeValueFieldBase.extend({
|
|
5373
|
+
type: z48.literal("input"),
|
|
5374
|
+
nullable: z48.boolean().optional(),
|
|
5375
|
+
value: z48.string().nullable().optional(),
|
|
4781
5376
|
placeholder: DynamicTextSchema.optional(),
|
|
4782
5377
|
props: PrimeInputPropsSchema.optional()
|
|
4783
5378
|
});
|
|
5379
|
+
var PrimeInputFieldSchema = PrimeInputFieldSchemaObject.superRefine(nullableValueRefine);
|
|
4784
5380
|
var PrimeCheckboxFieldSchema = PrimeValueFieldBase.extend({
|
|
4785
|
-
type:
|
|
4786
|
-
value:
|
|
5381
|
+
type: z48.literal("checkbox"),
|
|
5382
|
+
value: z48.boolean().optional(),
|
|
4787
5383
|
placeholder: DynamicTextSchema.optional(),
|
|
4788
5384
|
props: PrimeCheckboxPropsSchema.optional()
|
|
4789
5385
|
});
|
|
4790
|
-
var
|
|
4791
|
-
type:
|
|
4792
|
-
|
|
5386
|
+
var PrimeRadioFieldSchemaObject = PrimeValueFieldBase.extend({
|
|
5387
|
+
type: z48.literal("radio"),
|
|
5388
|
+
nullable: z48.boolean().optional(),
|
|
5389
|
+
value: z48.unknown().nullable().optional(),
|
|
4793
5390
|
placeholder: DynamicTextSchema.optional(),
|
|
4794
5391
|
options: FieldOptionsSchema,
|
|
4795
5392
|
props: PrimeRadioPropsSchema.optional()
|
|
4796
5393
|
});
|
|
4797
|
-
var
|
|
4798
|
-
|
|
4799
|
-
|
|
5394
|
+
var PrimeRadioFieldSchema = PrimeRadioFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5395
|
+
var PrimeSelectFieldSchemaObject = PrimeValueFieldBase.extend({
|
|
5396
|
+
type: z48.literal("select"),
|
|
5397
|
+
nullable: z48.boolean().optional(),
|
|
5398
|
+
value: z48.unknown().nullable().optional(),
|
|
4800
5399
|
placeholder: DynamicTextSchema.optional(),
|
|
4801
5400
|
options: FieldOptionsSchema,
|
|
4802
5401
|
props: PrimeSelectPropsSchema.optional()
|
|
4803
5402
|
});
|
|
4804
|
-
var
|
|
4805
|
-
|
|
4806
|
-
|
|
5403
|
+
var PrimeSelectFieldSchema = PrimeSelectFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5404
|
+
var PrimeMultiCheckboxFieldSchemaObject = PrimeValueFieldBase.extend({
|
|
5405
|
+
type: z48.literal("multi-checkbox"),
|
|
5406
|
+
nullable: z48.boolean().optional(),
|
|
5407
|
+
value: z48.array(z48.unknown()).nullable().optional(),
|
|
4807
5408
|
placeholder: DynamicTextSchema.optional(),
|
|
4808
5409
|
options: FieldOptionsSchema,
|
|
4809
5410
|
props: PrimeMultiCheckboxPropsSchema.optional()
|
|
4810
5411
|
});
|
|
4811
|
-
var
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
5412
|
+
var PrimeMultiCheckboxFieldSchema = PrimeMultiCheckboxFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5413
|
+
var PrimeDatepickerFieldSchemaObject = PrimeValueFieldBase.extend({
|
|
5414
|
+
type: z48.literal("datepicker"),
|
|
5415
|
+
nullable: z48.boolean().optional(),
|
|
5416
|
+
value: z48.union([z48.string(), z48.null()]).optional(),
|
|
5417
|
+
minDate: z48.union([z48.string(), z48.null()]).optional(),
|
|
5418
|
+
maxDate: z48.union([z48.string(), z48.null()]).optional(),
|
|
5419
|
+
startAt: z48.union([z48.string(), z48.null()]).optional(),
|
|
4817
5420
|
placeholder: DynamicTextSchema.optional(),
|
|
4818
5421
|
props: PrimeDatepickerPropsSchema.optional()
|
|
4819
5422
|
});
|
|
4820
|
-
var
|
|
4821
|
-
|
|
4822
|
-
|
|
5423
|
+
var PrimeDatepickerFieldSchema = PrimeDatepickerFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5424
|
+
var PrimeTextareaFieldSchemaObject = PrimeValueFieldBase.extend({
|
|
5425
|
+
type: z48.literal("textarea"),
|
|
5426
|
+
nullable: z48.boolean().optional(),
|
|
5427
|
+
value: z48.string().nullable().optional(),
|
|
4823
5428
|
placeholder: DynamicTextSchema.optional(),
|
|
4824
5429
|
props: PrimeTextareaPropsSchema.optional()
|
|
4825
5430
|
});
|
|
4826
|
-
var
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
5431
|
+
var PrimeTextareaFieldSchema = PrimeTextareaFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5432
|
+
var PrimeSliderFieldSchemaObject = PrimeValueFieldBase.extend({
|
|
5433
|
+
type: z48.literal("slider"),
|
|
5434
|
+
nullable: z48.boolean().optional(),
|
|
5435
|
+
value: z48.number().nullable().optional(),
|
|
5436
|
+
minValue: z48.number().optional(),
|
|
5437
|
+
maxValue: z48.number().optional(),
|
|
5438
|
+
step: z48.number().positive().optional(),
|
|
4832
5439
|
placeholder: DynamicTextSchema.optional(),
|
|
4833
5440
|
props: PrimeSliderPropsSchema.optional()
|
|
4834
5441
|
});
|
|
5442
|
+
var PrimeSliderFieldSchema = PrimeSliderFieldSchemaObject.superRefine(nullableValueRefine);
|
|
4835
5443
|
var PrimeToggleFieldSchema = PrimeValueFieldBase.extend({
|
|
4836
|
-
type:
|
|
4837
|
-
value:
|
|
5444
|
+
type: z48.literal("toggle"),
|
|
5445
|
+
value: z48.boolean().optional(),
|
|
4838
5446
|
placeholder: DynamicTextSchema.optional(),
|
|
4839
5447
|
props: PrimeTogglePropsSchema.optional()
|
|
4840
5448
|
});
|
|
4841
5449
|
var PrimeButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4842
|
-
type:
|
|
4843
|
-
event:
|
|
4844
|
-
eventArgs:
|
|
5450
|
+
type: z48.literal("button"),
|
|
5451
|
+
event: z48.string().optional(),
|
|
5452
|
+
eventArgs: z48.array(z48.union([z48.string(), z48.number(), z48.boolean(), z48.null(), z48.undefined()])).optional(),
|
|
4845
5453
|
props: PrimeButtonPropsSchema.optional(),
|
|
4846
5454
|
logic: LogicArraySchema.optional()
|
|
4847
5455
|
});
|
|
4848
5456
|
var PrimeSubmitButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4849
|
-
type:
|
|
5457
|
+
type: z48.literal("submit"),
|
|
4850
5458
|
props: PrimeButtonPropsSchema.optional(),
|
|
4851
5459
|
logic: LogicArraySchema.optional()
|
|
4852
5460
|
});
|
|
4853
5461
|
var PrimeNextButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4854
|
-
type:
|
|
5462
|
+
type: z48.literal("next"),
|
|
4855
5463
|
props: PrimeButtonPropsSchema.optional(),
|
|
4856
5464
|
logic: LogicArraySchema.optional()
|
|
4857
5465
|
});
|
|
4858
5466
|
var PrimePreviousButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4859
|
-
type:
|
|
5467
|
+
type: z48.literal("previous"),
|
|
4860
5468
|
props: PrimeButtonPropsSchema.optional()
|
|
4861
5469
|
});
|
|
4862
5470
|
var PrimeAddArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4863
|
-
type:
|
|
4864
|
-
arrayKey:
|
|
5471
|
+
type: z48.literal("addArrayItem"),
|
|
5472
|
+
arrayKey: z48.string().optional(),
|
|
4865
5473
|
props: PrimeButtonPropsSchema.optional()
|
|
4866
5474
|
});
|
|
4867
5475
|
var PrimeRemoveArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
4868
|
-
type:
|
|
4869
|
-
arrayKey:
|
|
5476
|
+
type: z48.literal("removeArrayItem"),
|
|
5477
|
+
arrayKey: z48.string().optional(),
|
|
4870
5478
|
props: PrimeButtonPropsSchema.optional()
|
|
4871
5479
|
});
|
|
4872
5480
|
|
|
4873
5481
|
// internal/dynamic-forms-zod/primeng/src/prime-leaf-field.schema.ts
|
|
4874
|
-
import { z as
|
|
4875
|
-
var PrimeLeafFieldSchema =
|
|
5482
|
+
import { z as z49 } from "zod";
|
|
5483
|
+
var PrimeLeafFieldSchema = z49.discriminatedUnion("type", [
|
|
4876
5484
|
TextFieldSchema,
|
|
4877
5485
|
HiddenFieldSchema,
|
|
4878
|
-
|
|
5486
|
+
PrimeInputFieldSchemaObject,
|
|
4879
5487
|
PrimeCheckboxFieldSchema,
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
5488
|
+
PrimeRadioFieldSchemaObject,
|
|
5489
|
+
PrimeSelectFieldSchemaObject,
|
|
5490
|
+
PrimeMultiCheckboxFieldSchemaObject,
|
|
5491
|
+
PrimeDatepickerFieldSchemaObject,
|
|
5492
|
+
PrimeTextareaFieldSchemaObject,
|
|
5493
|
+
PrimeSliderFieldSchemaObject,
|
|
4886
5494
|
PrimeToggleFieldSchema,
|
|
4887
5495
|
PrimeButtonFieldSchema,
|
|
4888
5496
|
PrimeSubmitButtonFieldSchema,
|
|
@@ -4890,10 +5498,10 @@ var PrimeLeafFieldSchema = z48.discriminatedUnion("type", [
|
|
|
4890
5498
|
PrimePreviousButtonFieldSchema,
|
|
4891
5499
|
PrimeAddArrayItemButtonFieldSchema,
|
|
4892
5500
|
PrimeRemoveArrayItemButtonFieldSchema
|
|
4893
|
-
]);
|
|
5501
|
+
]).superRefine(nullableValueRefine);
|
|
4894
5502
|
|
|
4895
5503
|
// internal/dynamic-forms-zod/primeng/src/prime-form-config.schema.ts
|
|
4896
|
-
import { z as
|
|
5504
|
+
import { z as z50 } from "zod";
|
|
4897
5505
|
var containerSchemas3 = createContainerSchemas({
|
|
4898
5506
|
leafFieldSchema: PrimeLeafFieldSchema
|
|
4899
5507
|
});
|
|
@@ -4902,240 +5510,254 @@ var PrimeRowFieldSchema = containerSchemas3.RowFieldSchema;
|
|
|
4902
5510
|
var PrimeGroupFieldSchema = containerSchemas3.GroupFieldSchema;
|
|
4903
5511
|
var PrimeArrayFieldSchema = containerSchemas3.ArrayFieldSchema;
|
|
4904
5512
|
var PrimeFieldSchema = containerSchemas3.AllFieldsSchema;
|
|
4905
|
-
var PrimeFormDefaultPropsSchema =
|
|
4906
|
-
styleClass:
|
|
5513
|
+
var PrimeFormDefaultPropsSchema = z50.object({
|
|
5514
|
+
styleClass: z50.string().optional()
|
|
4907
5515
|
});
|
|
4908
5516
|
var PrimeFormConfigSchema = createFormConfigSchema(PrimeFieldSchema, PrimeFormDefaultPropsSchema);
|
|
4909
5517
|
|
|
4910
5518
|
// internal/dynamic-forms-zod/ionic/src/props/index.ts
|
|
4911
|
-
import { z as
|
|
4912
|
-
var IonicColorSchema =
|
|
4913
|
-
var IonicLabelPlacementSchema =
|
|
4914
|
-
var IonicJustifySchema =
|
|
4915
|
-
var IonicFillSchema =
|
|
4916
|
-
var IonicInputPropsSchema =
|
|
4917
|
-
fill:
|
|
4918
|
-
shape:
|
|
5519
|
+
import { z as z51 } from "zod";
|
|
5520
|
+
var IonicColorSchema = z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", "dark"]);
|
|
5521
|
+
var IonicLabelPlacementSchema = z51.enum(["start", "end", "fixed", "stacked", "floating"]);
|
|
5522
|
+
var IonicJustifySchema = z51.enum(["start", "end", "space-between"]);
|
|
5523
|
+
var IonicFillSchema = z51.enum(["solid", "outline", "clear", "default"]);
|
|
5524
|
+
var IonicInputPropsSchema = z51.object({
|
|
5525
|
+
fill: z51.enum(["solid", "outline"]).optional(),
|
|
5526
|
+
shape: z51.literal("round").optional(),
|
|
4919
5527
|
labelPlacement: IonicLabelPlacementSchema.optional(),
|
|
4920
5528
|
color: IonicColorSchema.optional(),
|
|
4921
5529
|
hint: DynamicTextSchema.optional(),
|
|
4922
5530
|
errorText: DynamicTextSchema.optional(),
|
|
4923
|
-
counter:
|
|
4924
|
-
maxlength:
|
|
4925
|
-
clearInput:
|
|
4926
|
-
type:
|
|
5531
|
+
counter: z51.boolean().optional(),
|
|
5532
|
+
maxlength: z51.number().positive().optional(),
|
|
5533
|
+
clearInput: z51.boolean().optional(),
|
|
5534
|
+
type: z51.enum(["text", "email", "password", "number", "tel", "url"]).optional(),
|
|
4927
5535
|
placeholder: DynamicTextSchema.optional()
|
|
4928
5536
|
});
|
|
4929
|
-
var IonicCheckboxPropsSchema =
|
|
4930
|
-
labelPlacement:
|
|
5537
|
+
var IonicCheckboxPropsSchema = z51.object({
|
|
5538
|
+
labelPlacement: z51.enum(["start", "end", "fixed", "stacked"]).optional(),
|
|
4931
5539
|
justify: IonicJustifySchema.optional(),
|
|
4932
|
-
color:
|
|
4933
|
-
indeterminate:
|
|
5540
|
+
color: z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger"]).optional(),
|
|
5541
|
+
indeterminate: z51.boolean().optional(),
|
|
4934
5542
|
hint: DynamicTextSchema.optional()
|
|
4935
5543
|
});
|
|
4936
|
-
var IonicRadioPropsSchema =
|
|
4937
|
-
labelPlacement:
|
|
5544
|
+
var IonicRadioPropsSchema = z51.object({
|
|
5545
|
+
labelPlacement: z51.enum(["start", "end", "fixed", "stacked"]).optional(),
|
|
4938
5546
|
justify: IonicJustifySchema.optional(),
|
|
4939
|
-
color:
|
|
5547
|
+
color: z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger"]).optional(),
|
|
4940
5548
|
hint: DynamicTextSchema.optional()
|
|
4941
5549
|
});
|
|
4942
|
-
var IonicTogglePropsSchema =
|
|
4943
|
-
labelPlacement:
|
|
5550
|
+
var IonicTogglePropsSchema = z51.object({
|
|
5551
|
+
labelPlacement: z51.enum(["start", "end", "fixed", "stacked"]).optional(),
|
|
4944
5552
|
justify: IonicJustifySchema.optional(),
|
|
4945
|
-
color:
|
|
4946
|
-
enableOnOffLabels:
|
|
5553
|
+
color: z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger"]).optional(),
|
|
5554
|
+
enableOnOffLabels: z51.boolean().optional(),
|
|
4947
5555
|
hint: DynamicTextSchema.optional()
|
|
4948
5556
|
});
|
|
4949
|
-
var IonicSliderPropsSchema =
|
|
4950
|
-
min:
|
|
4951
|
-
max:
|
|
4952
|
-
step:
|
|
4953
|
-
dualKnobs:
|
|
4954
|
-
pin:
|
|
4955
|
-
ticks:
|
|
4956
|
-
snaps:
|
|
4957
|
-
color:
|
|
4958
|
-
labelPlacement:
|
|
5557
|
+
var IonicSliderPropsSchema = z51.object({
|
|
5558
|
+
min: z51.number().optional(),
|
|
5559
|
+
max: z51.number().optional(),
|
|
5560
|
+
step: z51.number().positive().optional(),
|
|
5561
|
+
dualKnobs: z51.boolean().optional(),
|
|
5562
|
+
pin: z51.boolean().optional(),
|
|
5563
|
+
ticks: z51.boolean().optional(),
|
|
5564
|
+
snaps: z51.boolean().optional(),
|
|
5565
|
+
color: z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger"]).optional(),
|
|
5566
|
+
labelPlacement: z51.enum(["start", "end", "fixed", "stacked"]).optional(),
|
|
4959
5567
|
hint: DynamicTextSchema.optional()
|
|
4960
5568
|
});
|
|
4961
|
-
var IonicDatepickerPropsSchema =
|
|
4962
|
-
presentation:
|
|
4963
|
-
multiple:
|
|
4964
|
-
preferWheel:
|
|
4965
|
-
showDefaultButtons:
|
|
4966
|
-
showDefaultTitle:
|
|
4967
|
-
showDefaultTimeLabel:
|
|
4968
|
-
showClearButton:
|
|
4969
|
-
doneText:
|
|
4970
|
-
cancelText:
|
|
4971
|
-
size:
|
|
4972
|
-
color:
|
|
5569
|
+
var IonicDatepickerPropsSchema = z51.object({
|
|
5570
|
+
presentation: z51.enum(["date", "date-time", "time", "time-date", "month", "month-year", "year"]).optional(),
|
|
5571
|
+
multiple: z51.boolean().optional(),
|
|
5572
|
+
preferWheel: z51.boolean().optional(),
|
|
5573
|
+
showDefaultButtons: z51.boolean().optional(),
|
|
5574
|
+
showDefaultTitle: z51.boolean().optional(),
|
|
5575
|
+
showDefaultTimeLabel: z51.boolean().optional(),
|
|
5576
|
+
showClearButton: z51.boolean().optional(),
|
|
5577
|
+
doneText: z51.string().optional(),
|
|
5578
|
+
cancelText: z51.string().optional(),
|
|
5579
|
+
size: z51.enum(["cover", "fixed"]).optional(),
|
|
5580
|
+
color: z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger"]).optional(),
|
|
4973
5581
|
hint: DynamicTextSchema.optional(),
|
|
4974
5582
|
placeholder: DynamicTextSchema.optional()
|
|
4975
5583
|
});
|
|
4976
|
-
var IonicSelectPropsSchema =
|
|
4977
|
-
multiple:
|
|
4978
|
-
interface:
|
|
4979
|
-
cancelText:
|
|
4980
|
-
okText:
|
|
5584
|
+
var IonicSelectPropsSchema = z51.object({
|
|
5585
|
+
multiple: z51.boolean().optional(),
|
|
5586
|
+
interface: z51.enum(["action-sheet", "popover", "alert"]).optional(),
|
|
5587
|
+
cancelText: z51.string().optional(),
|
|
5588
|
+
okText: z51.string().optional(),
|
|
4981
5589
|
placeholder: DynamicTextSchema.optional(),
|
|
4982
|
-
fill:
|
|
4983
|
-
shape:
|
|
5590
|
+
fill: z51.enum(["solid", "outline"]).optional(),
|
|
5591
|
+
shape: z51.literal("round").optional(),
|
|
4984
5592
|
labelPlacement: IonicLabelPlacementSchema.optional(),
|
|
4985
|
-
color:
|
|
5593
|
+
color: z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger"]).optional(),
|
|
4986
5594
|
hint: DynamicTextSchema.optional()
|
|
4987
5595
|
});
|
|
4988
|
-
var IonicTextareaPropsSchema =
|
|
4989
|
-
rows:
|
|
4990
|
-
autoGrow:
|
|
4991
|
-
maxlength:
|
|
4992
|
-
counter:
|
|
4993
|
-
fill:
|
|
4994
|
-
shape:
|
|
5596
|
+
var IonicTextareaPropsSchema = z51.object({
|
|
5597
|
+
rows: z51.number().positive().optional(),
|
|
5598
|
+
autoGrow: z51.boolean().optional(),
|
|
5599
|
+
maxlength: z51.number().positive().optional(),
|
|
5600
|
+
counter: z51.boolean().optional(),
|
|
5601
|
+
fill: z51.enum(["solid", "outline"]).optional(),
|
|
5602
|
+
shape: z51.literal("round").optional(),
|
|
4995
5603
|
labelPlacement: IonicLabelPlacementSchema.optional(),
|
|
4996
5604
|
hint: DynamicTextSchema.optional(),
|
|
4997
5605
|
errorText: DynamicTextSchema.optional(),
|
|
4998
5606
|
color: IonicColorSchema.optional(),
|
|
4999
5607
|
placeholder: DynamicTextSchema.optional()
|
|
5000
5608
|
});
|
|
5001
|
-
var IonicMultiCheckboxPropsSchema =
|
|
5002
|
-
labelPlacement:
|
|
5609
|
+
var IonicMultiCheckboxPropsSchema = z51.object({
|
|
5610
|
+
labelPlacement: z51.enum(["start", "end", "fixed", "stacked"]).optional(),
|
|
5003
5611
|
justify: IonicJustifySchema.optional(),
|
|
5004
|
-
color:
|
|
5612
|
+
color: z51.enum(["primary", "secondary", "tertiary", "success", "warning", "danger"]).optional(),
|
|
5005
5613
|
hint: DynamicTextSchema.optional()
|
|
5006
5614
|
});
|
|
5007
|
-
var IonicButtonPropsSchema =
|
|
5008
|
-
expand:
|
|
5615
|
+
var IonicButtonPropsSchema = z51.object({
|
|
5616
|
+
expand: z51.enum(["full", "block"]).optional(),
|
|
5009
5617
|
fill: IonicFillSchema.optional(),
|
|
5010
|
-
shape:
|
|
5011
|
-
size:
|
|
5618
|
+
shape: z51.literal("round").optional(),
|
|
5619
|
+
size: z51.enum(["small", "default", "large"]).optional(),
|
|
5012
5620
|
color: IonicColorSchema.optional(),
|
|
5013
|
-
strong:
|
|
5014
|
-
type:
|
|
5621
|
+
strong: z51.boolean().optional(),
|
|
5622
|
+
type: z51.enum(["button", "submit", "reset"]).optional()
|
|
5015
5623
|
});
|
|
5016
5624
|
|
|
5017
5625
|
// internal/dynamic-forms-zod/ionic/src/fields/index.ts
|
|
5018
|
-
import { z as
|
|
5626
|
+
import { z as z52 } from "zod";
|
|
5019
5627
|
var IonicValueFieldBase = BaseFieldDefSchema.merge(FieldWithValidationSchema);
|
|
5020
|
-
var
|
|
5021
|
-
type:
|
|
5022
|
-
|
|
5628
|
+
var IonicInputFieldSchemaObject = IonicValueFieldBase.extend({
|
|
5629
|
+
type: z52.literal("input"),
|
|
5630
|
+
nullable: z52.boolean().optional(),
|
|
5631
|
+
value: z52.string().nullable().optional(),
|
|
5023
5632
|
placeholder: DynamicTextSchema.optional(),
|
|
5024
5633
|
props: IonicInputPropsSchema.optional()
|
|
5025
5634
|
});
|
|
5635
|
+
var IonicInputFieldSchema = IonicInputFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5026
5636
|
var IonicCheckboxFieldSchema = IonicValueFieldBase.extend({
|
|
5027
|
-
type:
|
|
5028
|
-
value:
|
|
5637
|
+
type: z52.literal("checkbox"),
|
|
5638
|
+
value: z52.boolean().optional(),
|
|
5029
5639
|
placeholder: DynamicTextSchema.optional(),
|
|
5030
5640
|
props: IonicCheckboxPropsSchema.optional()
|
|
5031
5641
|
});
|
|
5032
|
-
var
|
|
5033
|
-
type:
|
|
5034
|
-
|
|
5642
|
+
var IonicRadioFieldSchemaObject = IonicValueFieldBase.extend({
|
|
5643
|
+
type: z52.literal("radio"),
|
|
5644
|
+
nullable: z52.boolean().optional(),
|
|
5645
|
+
value: z52.unknown().nullable().optional(),
|
|
5035
5646
|
placeholder: DynamicTextSchema.optional(),
|
|
5036
5647
|
options: FieldOptionsSchema,
|
|
5037
5648
|
props: IonicRadioPropsSchema.optional()
|
|
5038
5649
|
});
|
|
5650
|
+
var IonicRadioFieldSchema = IonicRadioFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5039
5651
|
var IonicToggleFieldSchema = IonicValueFieldBase.extend({
|
|
5040
|
-
type:
|
|
5041
|
-
value:
|
|
5652
|
+
type: z52.literal("toggle"),
|
|
5653
|
+
value: z52.boolean().optional(),
|
|
5042
5654
|
placeholder: DynamicTextSchema.optional(),
|
|
5043
5655
|
props: IonicTogglePropsSchema.optional()
|
|
5044
5656
|
});
|
|
5045
|
-
var
|
|
5046
|
-
type:
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5657
|
+
var IonicSliderFieldSchemaObject = IonicValueFieldBase.extend({
|
|
5658
|
+
type: z52.literal("slider"),
|
|
5659
|
+
nullable: z52.boolean().optional(),
|
|
5660
|
+
value: z52.number().nullable().optional(),
|
|
5661
|
+
minValue: z52.number().optional(),
|
|
5662
|
+
maxValue: z52.number().optional(),
|
|
5663
|
+
step: z52.number().positive().optional(),
|
|
5051
5664
|
placeholder: DynamicTextSchema.optional(),
|
|
5052
5665
|
props: IonicSliderPropsSchema.optional()
|
|
5053
5666
|
});
|
|
5054
|
-
var
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5667
|
+
var IonicSliderFieldSchema = IonicSliderFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5668
|
+
var IonicDatepickerFieldSchemaObject = IonicValueFieldBase.extend({
|
|
5669
|
+
type: z52.literal("datepicker"),
|
|
5670
|
+
nullable: z52.boolean().optional(),
|
|
5671
|
+
value: z52.union([z52.string(), z52.null()]).optional(),
|
|
5672
|
+
minDate: z52.union([z52.string(), z52.null()]).optional(),
|
|
5673
|
+
maxDate: z52.union([z52.string(), z52.null()]).optional(),
|
|
5674
|
+
startAt: z52.union([z52.string(), z52.null()]).optional(),
|
|
5060
5675
|
placeholder: DynamicTextSchema.optional(),
|
|
5061
5676
|
props: IonicDatepickerPropsSchema.optional()
|
|
5062
5677
|
});
|
|
5063
|
-
var
|
|
5064
|
-
|
|
5065
|
-
|
|
5678
|
+
var IonicDatepickerFieldSchema = IonicDatepickerFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5679
|
+
var IonicSelectFieldSchemaObject = IonicValueFieldBase.extend({
|
|
5680
|
+
type: z52.literal("select"),
|
|
5681
|
+
nullable: z52.boolean().optional(),
|
|
5682
|
+
value: z52.unknown().nullable().optional(),
|
|
5066
5683
|
placeholder: DynamicTextSchema.optional(),
|
|
5067
5684
|
options: FieldOptionsSchema,
|
|
5068
5685
|
props: IonicSelectPropsSchema.optional()
|
|
5069
5686
|
});
|
|
5070
|
-
var
|
|
5071
|
-
|
|
5072
|
-
|
|
5687
|
+
var IonicSelectFieldSchema = IonicSelectFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5688
|
+
var IonicTextareaFieldSchemaObject = IonicValueFieldBase.extend({
|
|
5689
|
+
type: z52.literal("textarea"),
|
|
5690
|
+
nullable: z52.boolean().optional(),
|
|
5691
|
+
value: z52.string().nullable().optional(),
|
|
5073
5692
|
placeholder: DynamicTextSchema.optional(),
|
|
5074
5693
|
props: IonicTextareaPropsSchema.optional()
|
|
5075
5694
|
});
|
|
5076
|
-
var
|
|
5077
|
-
|
|
5078
|
-
|
|
5695
|
+
var IonicTextareaFieldSchema = IonicTextareaFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5696
|
+
var IonicMultiCheckboxFieldSchemaObject = IonicValueFieldBase.extend({
|
|
5697
|
+
type: z52.literal("multi-checkbox"),
|
|
5698
|
+
nullable: z52.boolean().optional(),
|
|
5699
|
+
value: z52.array(z52.unknown()).nullable().optional(),
|
|
5079
5700
|
placeholder: DynamicTextSchema.optional(),
|
|
5080
5701
|
options: FieldOptionsSchema,
|
|
5081
5702
|
props: IonicMultiCheckboxPropsSchema.optional()
|
|
5082
5703
|
});
|
|
5704
|
+
var IonicMultiCheckboxFieldSchema = IonicMultiCheckboxFieldSchemaObject.superRefine(nullableValueRefine);
|
|
5083
5705
|
var IonicButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
5084
|
-
type:
|
|
5085
|
-
event:
|
|
5086
|
-
eventArgs:
|
|
5706
|
+
type: z52.literal("button"),
|
|
5707
|
+
event: z52.string().optional(),
|
|
5708
|
+
eventArgs: z52.array(z52.union([z52.string(), z52.number(), z52.boolean(), z52.null(), z52.undefined()])).optional(),
|
|
5087
5709
|
props: IonicButtonPropsSchema.optional(),
|
|
5088
5710
|
logic: LogicArraySchema.optional()
|
|
5089
5711
|
});
|
|
5090
5712
|
var IonicSubmitButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
5091
|
-
type:
|
|
5713
|
+
type: z52.literal("submit"),
|
|
5092
5714
|
props: IonicButtonPropsSchema.optional(),
|
|
5093
5715
|
logic: LogicArraySchema.optional()
|
|
5094
5716
|
});
|
|
5095
5717
|
var IonicNextButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
5096
|
-
type:
|
|
5718
|
+
type: z52.literal("next"),
|
|
5097
5719
|
props: IonicButtonPropsSchema.optional(),
|
|
5098
5720
|
logic: LogicArraySchema.optional()
|
|
5099
5721
|
});
|
|
5100
5722
|
var IonicPreviousButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
5101
|
-
type:
|
|
5723
|
+
type: z52.literal("previous"),
|
|
5102
5724
|
props: IonicButtonPropsSchema.optional()
|
|
5103
5725
|
});
|
|
5104
5726
|
var IonicAddArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
5105
|
-
type:
|
|
5106
|
-
arrayKey:
|
|
5727
|
+
type: z52.literal("addArrayItem"),
|
|
5728
|
+
arrayKey: z52.string().optional(),
|
|
5107
5729
|
props: IonicButtonPropsSchema.optional()
|
|
5108
5730
|
});
|
|
5109
5731
|
var IonicRemoveArrayItemButtonFieldSchema = BaseFieldDefSchema.extend({
|
|
5110
|
-
type:
|
|
5111
|
-
arrayKey:
|
|
5732
|
+
type: z52.literal("removeArrayItem"),
|
|
5733
|
+
arrayKey: z52.string().optional(),
|
|
5112
5734
|
props: IonicButtonPropsSchema.optional()
|
|
5113
5735
|
});
|
|
5114
5736
|
|
|
5115
5737
|
// internal/dynamic-forms-zod/ionic/src/ionic-leaf-field.schema.ts
|
|
5116
|
-
import { z as
|
|
5117
|
-
var IonicLeafFieldSchema =
|
|
5738
|
+
import { z as z53 } from "zod";
|
|
5739
|
+
var IonicLeafFieldSchema = z53.discriminatedUnion("type", [
|
|
5118
5740
|
TextFieldSchema,
|
|
5119
5741
|
HiddenFieldSchema,
|
|
5120
|
-
|
|
5742
|
+
IonicInputFieldSchemaObject,
|
|
5121
5743
|
IonicCheckboxFieldSchema,
|
|
5122
|
-
|
|
5744
|
+
IonicRadioFieldSchemaObject,
|
|
5123
5745
|
IonicToggleFieldSchema,
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5746
|
+
IonicSliderFieldSchemaObject,
|
|
5747
|
+
IonicDatepickerFieldSchemaObject,
|
|
5748
|
+
IonicSelectFieldSchemaObject,
|
|
5749
|
+
IonicTextareaFieldSchemaObject,
|
|
5750
|
+
IonicMultiCheckboxFieldSchemaObject,
|
|
5129
5751
|
IonicButtonFieldSchema,
|
|
5130
5752
|
IonicSubmitButtonFieldSchema,
|
|
5131
5753
|
IonicNextButtonFieldSchema,
|
|
5132
5754
|
IonicPreviousButtonFieldSchema,
|
|
5133
5755
|
IonicAddArrayItemButtonFieldSchema,
|
|
5134
5756
|
IonicRemoveArrayItemButtonFieldSchema
|
|
5135
|
-
]);
|
|
5757
|
+
]).superRefine(nullableValueRefine);
|
|
5136
5758
|
|
|
5137
5759
|
// internal/dynamic-forms-zod/ionic/src/ionic-form-config.schema.ts
|
|
5138
|
-
import { z as
|
|
5760
|
+
import { z as z54 } from "zod";
|
|
5139
5761
|
var containerSchemas4 = createContainerSchemas({
|
|
5140
5762
|
leafFieldSchema: IonicLeafFieldSchema
|
|
5141
5763
|
});
|
|
@@ -5144,7 +5766,7 @@ var IonicRowFieldSchema = containerSchemas4.RowFieldSchema;
|
|
|
5144
5766
|
var IonicGroupFieldSchema = containerSchemas4.GroupFieldSchema;
|
|
5145
5767
|
var IonicArrayFieldSchema = containerSchemas4.ArrayFieldSchema;
|
|
5146
5768
|
var IonicFieldSchema = containerSchemas4.AllFieldsSchema;
|
|
5147
|
-
var IonicFormDefaultPropsSchema =
|
|
5769
|
+
var IonicFormDefaultPropsSchema = z54.object({
|
|
5148
5770
|
color: IonicColorSchema.optional(),
|
|
5149
5771
|
labelPlacement: IonicLabelPlacementSchema.optional()
|
|
5150
5772
|
});
|
|
@@ -5919,6 +6541,110 @@ ${fieldTypes.map((ft) => `- ${ft}`).join("\n")}
|
|
|
5919
6541
|
});
|
|
5920
6542
|
}
|
|
5921
6543
|
|
|
6544
|
+
// packages/dynamic-form-mcp/src/resources/wrappers.resource.ts
|
|
6545
|
+
function registerWrappersResource(server) {
|
|
6546
|
+
server.resource("ng-forge Wrappers", "ng-forge://wrappers", async () => {
|
|
6547
|
+
const wrappers = getWrappers();
|
|
6548
|
+
return {
|
|
6549
|
+
contents: [
|
|
6550
|
+
{
|
|
6551
|
+
uri: "ng-forge://wrappers",
|
|
6552
|
+
mimeType: "application/json",
|
|
6553
|
+
text: JSON.stringify(
|
|
6554
|
+
{
|
|
6555
|
+
description: 'Available ng-forge field wrappers. Wrappers decorate the rendered output of a field or container without changing form data. Compose via `wrappers: [{ type: "...", ...props }]`.',
|
|
6556
|
+
categories: {
|
|
6557
|
+
core: "Ships from @ng-forge/dynamic-forms \u2014 always importable.",
|
|
6558
|
+
demo: "Ships from @internal/examples-shared-ui for the docs sandbox \u2014 NOT a library primitive.",
|
|
6559
|
+
adapter: "Ships from a UI adapter library (reserved)."
|
|
6560
|
+
},
|
|
6561
|
+
authoringContract: WRAPPER_AUTHORING_CONTRACT,
|
|
6562
|
+
wrappers: wrappers.map((w) => ({
|
|
6563
|
+
type: w.type,
|
|
6564
|
+
category: w.category,
|
|
6565
|
+
availability: w.availability,
|
|
6566
|
+
package: w.package,
|
|
6567
|
+
description: w.description,
|
|
6568
|
+
autoAppliesTo: w.autoAppliesTo
|
|
6569
|
+
}))
|
|
6570
|
+
},
|
|
6571
|
+
null,
|
|
6572
|
+
2
|
|
6573
|
+
)
|
|
6574
|
+
}
|
|
6575
|
+
]
|
|
6576
|
+
};
|
|
6577
|
+
});
|
|
6578
|
+
server.resource("Wrapper Details", "ng-forge://wrappers/{type}", async (uri) => {
|
|
6579
|
+
const match = uri.href.match(/ng-forge:\/\/wrappers\/(.+)/);
|
|
6580
|
+
const typeName = match?.[1];
|
|
6581
|
+
if (!typeName) {
|
|
6582
|
+
return {
|
|
6583
|
+
contents: [
|
|
6584
|
+
{
|
|
6585
|
+
uri: uri.href,
|
|
6586
|
+
mimeType: "text/plain",
|
|
6587
|
+
text: "Wrapper type not specified in URI"
|
|
6588
|
+
}
|
|
6589
|
+
]
|
|
6590
|
+
};
|
|
6591
|
+
}
|
|
6592
|
+
const wrapper = getWrapper(typeName);
|
|
6593
|
+
if (!wrapper) {
|
|
6594
|
+
return {
|
|
6595
|
+
contents: [
|
|
6596
|
+
{
|
|
6597
|
+
uri: uri.href,
|
|
6598
|
+
mimeType: "text/plain",
|
|
6599
|
+
text: `Wrapper type '${typeName}' not found. Available types: ${getWrappers().map((w) => w.type).join(", ")}`
|
|
6600
|
+
}
|
|
6601
|
+
]
|
|
6602
|
+
};
|
|
6603
|
+
}
|
|
6604
|
+
return {
|
|
6605
|
+
contents: [
|
|
6606
|
+
{
|
|
6607
|
+
uri: uri.href,
|
|
6608
|
+
mimeType: "application/json",
|
|
6609
|
+
text: JSON.stringify(wrapper, null, 2)
|
|
6610
|
+
}
|
|
6611
|
+
]
|
|
6612
|
+
};
|
|
6613
|
+
});
|
|
6614
|
+
server.resource("Wrappers by Category", "ng-forge://wrappers/category/{category}", async (uri) => {
|
|
6615
|
+
const match = uri.href.match(/ng-forge:\/\/wrappers\/category\/(.+)/);
|
|
6616
|
+
const category = match?.[1];
|
|
6617
|
+
if (!category || !["core", "demo", "adapter"].includes(category)) {
|
|
6618
|
+
return {
|
|
6619
|
+
contents: [
|
|
6620
|
+
{
|
|
6621
|
+
uri: uri.href,
|
|
6622
|
+
mimeType: "text/plain",
|
|
6623
|
+
text: "Valid categories: core, demo, adapter"
|
|
6624
|
+
}
|
|
6625
|
+
]
|
|
6626
|
+
};
|
|
6627
|
+
}
|
|
6628
|
+
const wrappers = getWrappersByCategory(category);
|
|
6629
|
+
return {
|
|
6630
|
+
contents: [
|
|
6631
|
+
{
|
|
6632
|
+
uri: uri.href,
|
|
6633
|
+
mimeType: "application/json",
|
|
6634
|
+
text: JSON.stringify(
|
|
6635
|
+
{
|
|
6636
|
+
category,
|
|
6637
|
+
wrappers
|
|
6638
|
+
},
|
|
6639
|
+
null,
|
|
6640
|
+
2
|
|
6641
|
+
)
|
|
6642
|
+
}
|
|
6643
|
+
]
|
|
6644
|
+
};
|
|
6645
|
+
});
|
|
6646
|
+
}
|
|
6647
|
+
|
|
5922
6648
|
// packages/dynamic-form-mcp/src/resources/index.ts
|
|
5923
6649
|
function registerResources(server) {
|
|
5924
6650
|
registerInstructionsResource(server);
|
|
@@ -5926,22 +6652,24 @@ function registerResources(server) {
|
|
|
5926
6652
|
registerFieldTypesResource(server);
|
|
5927
6653
|
registerValidatorsResource(server);
|
|
5928
6654
|
registerUIAdaptersResource(server);
|
|
6655
|
+
registerWrappersResource(server);
|
|
5929
6656
|
registerDocumentationResource(server);
|
|
5930
6657
|
registerSchemasResource(server);
|
|
5931
6658
|
}
|
|
5932
6659
|
|
|
5933
6660
|
// packages/dynamic-form-mcp/src/tools/lookup.tool.ts
|
|
5934
|
-
import { z as
|
|
6661
|
+
import { z as z55 } from "zod";
|
|
5935
6662
|
|
|
5936
6663
|
// packages/dynamic-form-mcp/src/tools/data/lookup-topics.ts
|
|
5937
6664
|
var TOPICS = {
|
|
5938
6665
|
// ========== FIELD TYPES ==========
|
|
5939
6666
|
input: {
|
|
5940
6667
|
brief: `\`\`\`typescript
|
|
5941
|
-
{ key: 'email', type: 'input', label: 'Email', required: true, email: true, props: { type: 'email'
|
|
6668
|
+
{ key: 'email', type: 'input', label: 'Email', required: true, email: true, placeholder: 'you@example.com', props: { type: 'email' } }
|
|
5942
6669
|
\`\`\`
|
|
5943
6670
|
**Shorthand:** required, email, min, max, minLength, maxLength, pattern
|
|
5944
|
-
**
|
|
6671
|
+
**Field-level:** placeholder
|
|
6672
|
+
**Props:** type (text|email|password|number|tel|url), appearance (Material)`,
|
|
5945
6673
|
full: `# Input Field
|
|
5946
6674
|
|
|
5947
6675
|
\`\`\`typescript
|
|
@@ -5951,9 +6679,9 @@ var TOPICS = {
|
|
|
5951
6679
|
label: 'Email',
|
|
5952
6680
|
required: true,
|
|
5953
6681
|
email: true,
|
|
6682
|
+
placeholder: 'you@example.com',
|
|
5954
6683
|
props: {
|
|
5955
6684
|
type: 'email', // 'text' | 'email' | 'password' | 'number' | 'tel' | 'url'
|
|
5956
|
-
placeholder: 'you@example.com',
|
|
5957
6685
|
appearance: 'outline' // Material: 'outline' | 'fill'
|
|
5958
6686
|
}
|
|
5959
6687
|
}
|
|
@@ -5961,7 +6689,8 @@ var TOPICS = {
|
|
|
5961
6689
|
|
|
5962
6690
|
**Validation shorthand:** \`required\`, \`email\`, \`min\`, \`max\`, \`minLength\`, \`maxLength\`, \`pattern\`
|
|
5963
6691
|
|
|
5964
|
-
**
|
|
6692
|
+
**Field-level:** \`placeholder\`
|
|
6693
|
+
**Props:** \`type\`, \`appearance\` (Material), \`hint\` (Material)
|
|
5965
6694
|
|
|
5966
6695
|
**Value Type:** \`string | number\`
|
|
5967
6696
|
|
|
@@ -5969,7 +6698,7 @@ var TOPICS = {
|
|
|
5969
6698
|
},
|
|
5970
6699
|
select: {
|
|
5971
6700
|
brief: `\`\`\`typescript
|
|
5972
|
-
{ key: 'country', type: 'select', label: 'Country', options: [{ label: 'USA', value: 'us' }]
|
|
6701
|
+
{ key: 'country', type: 'select', label: 'Country', placeholder: 'Choose...', options: [{ label: 'USA', value: 'us' }] }
|
|
5973
6702
|
\`\`\`
|
|
5974
6703
|
\u26A0\uFE0F **options at FIELD level, NOT in props!**`,
|
|
5975
6704
|
full: `# Select Field
|
|
@@ -5984,8 +6713,8 @@ var TOPICS = {
|
|
|
5984
6713
|
{ label: 'USA', value: 'us' },
|
|
5985
6714
|
{ label: 'Canada', value: 'ca' }
|
|
5986
6715
|
],
|
|
6716
|
+
placeholder: 'Choose...',
|
|
5987
6717
|
props: {
|
|
5988
|
-
placeholder: 'Choose...',
|
|
5989
6718
|
multiple: false // Allow multiple selection
|
|
5990
6719
|
}
|
|
5991
6720
|
}
|
|
@@ -6078,7 +6807,7 @@ For multiple selections, use **multi-checkbox** type.`,
|
|
|
6078
6807
|
},
|
|
6079
6808
|
textarea: {
|
|
6080
6809
|
brief: `\`\`\`typescript
|
|
6081
|
-
{ key: 'bio', type: 'textarea', label: 'Bio', maxLength: 500,
|
|
6810
|
+
{ key: 'bio', type: 'textarea', label: 'Bio', maxLength: 500, placeholder: 'Tell us about yourself...', props: { rows: 4 } }
|
|
6082
6811
|
\`\`\``,
|
|
6083
6812
|
full: `# Textarea Field
|
|
6084
6813
|
|
|
@@ -6088,9 +6817,9 @@ For multiple selections, use **multi-checkbox** type.`,
|
|
|
6088
6817
|
type: 'textarea',
|
|
6089
6818
|
label: 'Biography',
|
|
6090
6819
|
maxLength: 500,
|
|
6820
|
+
placeholder: 'Tell us about yourself...',
|
|
6091
6821
|
props: {
|
|
6092
6822
|
rows: 4,
|
|
6093
|
-
placeholder: 'Tell us about yourself...'
|
|
6094
6823
|
}
|
|
6095
6824
|
}
|
|
6096
6825
|
\`\`\`
|
|
@@ -8353,7 +9082,13 @@ var TOPIC_DESCRIPTIONS = {
|
|
|
8353
9082
|
conditions: "Condition operators and types for logic rules",
|
|
8354
9083
|
"common-expressions": "Frequently used derivation expressions (age, math, concatenation)",
|
|
8355
9084
|
"type-narrowing": "TypeScript type safety with as const satisfies FormConfig",
|
|
8356
|
-
workflow: "Recommended tool usage guide \u2014 start here"
|
|
9085
|
+
workflow: "Recommended tool usage guide \u2014 start here",
|
|
9086
|
+
// Wrappers
|
|
9087
|
+
wrappers: "Overview of the wrapper chain: how to apply, compose, and author wrappers",
|
|
9088
|
+
wrapper: "Overview of the wrapper chain (alias of `wrappers`)",
|
|
9089
|
+
css: "Built-in CSS wrapper \u2014 applies DynamicText class names to the host element",
|
|
9090
|
+
arraySection: "Demo wrapper \u2014 array card whose header owns the Add button (examples-shared-ui)",
|
|
9091
|
+
section: "Demo wrapper \u2014 titled card around any field or container (examples-shared-ui)"
|
|
8357
9092
|
};
|
|
8358
9093
|
var TOPIC_ALIASES = {
|
|
8359
9094
|
// Field type aliases
|
|
@@ -8480,7 +9215,21 @@ var TOPIC_ALIASES = {
|
|
|
8480
9215
|
// Workflow aliases
|
|
8481
9216
|
"how-to": "workflow",
|
|
8482
9217
|
guide: "workflow",
|
|
8483
|
-
"getting-started": "workflow"
|
|
9218
|
+
"getting-started": "workflow",
|
|
9219
|
+
// Wrapper aliases
|
|
9220
|
+
wrapper: "wrappers",
|
|
9221
|
+
"field-wrapper": "wrappers",
|
|
9222
|
+
"field-wrappers": "wrappers",
|
|
9223
|
+
decorator: "wrappers",
|
|
9224
|
+
decorators: "wrappers",
|
|
9225
|
+
"wrapper-chain": "wrappers",
|
|
9226
|
+
"css-wrapper": "css",
|
|
9227
|
+
csswrapper: "css",
|
|
9228
|
+
cssclasses: "css",
|
|
9229
|
+
"array-section": "arraySection",
|
|
9230
|
+
arraysection: "arraySection",
|
|
9231
|
+
"section-wrapper": "section",
|
|
9232
|
+
sectionwrapper: "section"
|
|
8484
9233
|
};
|
|
8485
9234
|
|
|
8486
9235
|
// packages/dynamic-form-mcp/src/services/topic-mapper.ts
|
|
@@ -8577,6 +9326,7 @@ function formatTopicItem(key) {
|
|
|
8577
9326
|
function getTopicList() {
|
|
8578
9327
|
const fieldTypes = ["input", "select", "slider", "radio", "checkbox", "textarea", "datepicker", "toggle", "text", "hidden"];
|
|
8579
9328
|
const containers = ["group", "row", "array", "simplified-array", "page"];
|
|
9329
|
+
const wrappers = ["wrappers", ...getWrappers().map((w) => w.type)];
|
|
8580
9330
|
const concepts = [
|
|
8581
9331
|
"validation",
|
|
8582
9332
|
"validation-messages",
|
|
@@ -8612,6 +9362,9 @@ ${fieldTypes.map(formatTopicItem).join("\n")}
|
|
|
8612
9362
|
## Containers
|
|
8613
9363
|
${containers.map(formatTopicItem).join("\n")}
|
|
8614
9364
|
|
|
9365
|
+
## Wrappers
|
|
9366
|
+
${wrappers.map(formatTopicItem).join("\n")}
|
|
9367
|
+
|
|
8615
9368
|
## Concepts
|
|
8616
9369
|
${concepts.map(formatTopicItem).join("\n")}
|
|
8617
9370
|
|
|
@@ -8678,7 +9431,144 @@ function formatFieldInfoFull(field, uiFieldType) {
|
|
|
8678
9431
|
lines.push("```");
|
|
8679
9432
|
return lines.join("\n");
|
|
8680
9433
|
}
|
|
9434
|
+
function formatWrapperInfo(wrapper) {
|
|
9435
|
+
const lines = [];
|
|
9436
|
+
lines.push(`# ${wrapper.type} wrapper`);
|
|
9437
|
+
lines.push("");
|
|
9438
|
+
lines.push(`**Category:** ${wrapper.category}`);
|
|
9439
|
+
lines.push(`**Availability:** ${wrapper.availability}`);
|
|
9440
|
+
lines.push(`**Package:** \`${wrapper.package}\``);
|
|
9441
|
+
lines.push(`**Component:** \`${wrapper.componentName}\``);
|
|
9442
|
+
lines.push(`**Description:** ${wrapper.description}`);
|
|
9443
|
+
if (wrapper.availability === "demo-only") {
|
|
9444
|
+
lines.push("");
|
|
9445
|
+
lines.push(
|
|
9446
|
+
"> **Note:** This is a demo wrapper that ships with the docs sandbox, not a library primitive. Use it as a pattern/template and author your own wrapper (or copy the component out of `internal/examples-shared-ui/src/lib/demo-wrappers/`) when adopting the idea in production."
|
|
9447
|
+
);
|
|
9448
|
+
}
|
|
9449
|
+
if (wrapper.autoAppliesTo.length > 0) {
|
|
9450
|
+
lines.push("");
|
|
9451
|
+
lines.push(`**Auto-applies to:** ${wrapper.autoAppliesTo.join(", ")}`);
|
|
9452
|
+
lines.push(
|
|
9453
|
+
"_(Injected automatically into these field types. Can be overridden via `FormConfig.defaultWrappers` or per-field `wrappers: [...]`; clear entirely with `wrappers: null`.)_"
|
|
9454
|
+
);
|
|
9455
|
+
} else {
|
|
9456
|
+
lines.push("");
|
|
9457
|
+
lines.push("**Auto-applies to:** _(none \u2014 opt-in via the field's `wrappers` array)_");
|
|
9458
|
+
}
|
|
9459
|
+
if (Object.keys(wrapper.props).length > 0) {
|
|
9460
|
+
lines.push("");
|
|
9461
|
+
lines.push("### Config Props");
|
|
9462
|
+
for (const prop of Object.values(wrapper.props)) {
|
|
9463
|
+
const req = prop.required ? " **(required)**" : "";
|
|
9464
|
+
const def = prop.default !== void 0 ? ` (default: ${JSON.stringify(prop.default)})` : "";
|
|
9465
|
+
lines.push(`- \`${prop.name}\`: ${prop.type}${req}${def} \u2014 ${prop.description}`);
|
|
9466
|
+
}
|
|
9467
|
+
} else {
|
|
9468
|
+
lines.push("");
|
|
9469
|
+
lines.push("### Config Props");
|
|
9470
|
+
lines.push("_(none \u2014 no configurable inputs on this wrapper)_");
|
|
9471
|
+
}
|
|
9472
|
+
if (wrapper.minimalExample) {
|
|
9473
|
+
lines.push("");
|
|
9474
|
+
lines.push("### Minimal Config");
|
|
9475
|
+
lines.push("```typescript");
|
|
9476
|
+
lines.push(wrapper.minimalExample);
|
|
9477
|
+
lines.push("```");
|
|
9478
|
+
}
|
|
9479
|
+
lines.push("");
|
|
9480
|
+
lines.push("### Full Example");
|
|
9481
|
+
lines.push("```typescript");
|
|
9482
|
+
lines.push(wrapper.example);
|
|
9483
|
+
lines.push("```");
|
|
9484
|
+
lines.push("");
|
|
9485
|
+
lines.push("### Authoring Contract");
|
|
9486
|
+
lines.push(wrapper.contract);
|
|
9487
|
+
return lines.join("\n");
|
|
9488
|
+
}
|
|
9489
|
+
function formatWrappersOverview() {
|
|
9490
|
+
const wrappers = getWrappers();
|
|
9491
|
+
const lines = [];
|
|
9492
|
+
lines.push("# Wrappers");
|
|
9493
|
+
lines.push("");
|
|
9494
|
+
lines.push(
|
|
9495
|
+
"Wrappers decorate the rendered output of a field (or container) without changing the form data structure. They are composed as a chain: each wrapper exposes a `#fieldComponent` `ViewContainerRef` slot where the next wrapper \u2014 or the field itself \u2014 is rendered."
|
|
9496
|
+
);
|
|
9497
|
+
lines.push("");
|
|
9498
|
+
lines.push("## Applying a wrapper");
|
|
9499
|
+
lines.push("");
|
|
9500
|
+
lines.push("```typescript");
|
|
9501
|
+
lines.push(`// Per-field wrapper chain (outer-most first)
|
|
9502
|
+
{
|
|
9503
|
+
key: 'email',
|
|
9504
|
+
type: 'input',
|
|
9505
|
+
label: 'Email',
|
|
9506
|
+
wrappers: [
|
|
9507
|
+
{ type: 'section', title: 'Account' }, // outer
|
|
9508
|
+
{ type: 'css', cssClasses: 'pad-lg' } // inner
|
|
9509
|
+
]
|
|
9510
|
+
}
|
|
9511
|
+
|
|
9512
|
+
// Form-level defaults applied to every field
|
|
9513
|
+
const config = {
|
|
9514
|
+
defaultWrappers: [{ type: 'css', cssClasses: 'field-default' }],
|
|
9515
|
+
fields: [...]
|
|
9516
|
+
} as const satisfies FormConfig;
|
|
9517
|
+
|
|
9518
|
+
// Clear all wrappers on a specific field (overrides defaults + auto)
|
|
9519
|
+
{ key: 'id', type: 'hidden', value: 'abc', wrappers: null }`);
|
|
9520
|
+
lines.push("```");
|
|
9521
|
+
lines.push("");
|
|
9522
|
+
lines.push("## Registered Wrappers");
|
|
9523
|
+
lines.push("");
|
|
9524
|
+
for (const w of wrappers) {
|
|
9525
|
+
const flag = w.availability === "demo-only" ? " _(demo-only)_" : "";
|
|
9526
|
+
lines.push(`- **${w.type}** (${w.category}, \`${w.package}\`)${flag} \u2014 ${w.description.split(".")[0]}.`);
|
|
9527
|
+
}
|
|
9528
|
+
lines.push("");
|
|
9529
|
+
lines.push('Use `ngforge_lookup topic="<name>"` for full details on any individual wrapper.');
|
|
9530
|
+
lines.push("");
|
|
9531
|
+
lines.push("## Authoring Contract");
|
|
9532
|
+
lines.push("");
|
|
9533
|
+
lines.push(wrappers[0]?.contract ?? "");
|
|
9534
|
+
return lines.join("\n");
|
|
9535
|
+
}
|
|
8681
9536
|
async function resolveTopicContent(resolvedTopic, depth, uiIntegration) {
|
|
9537
|
+
if (resolvedTopic === "wrappers" || resolvedTopic === "wrapper") {
|
|
9538
|
+
if (depth === "brief") {
|
|
9539
|
+
const wrappers = getWrappers();
|
|
9540
|
+
return [
|
|
9541
|
+
"**Wrappers** decorate a field's rendered output without changing form data.",
|
|
9542
|
+
"",
|
|
9543
|
+
"Registered:",
|
|
9544
|
+
...wrappers.map((w) => `- \`${w.type}\` (${w.category}${w.availability === "demo-only" ? ", demo-only" : ""})`),
|
|
9545
|
+
"",
|
|
9546
|
+
'Use `wrappers: [{ type: "css", cssClasses: "..." }]` on any field. See `ngforge_lookup topic="wrappers"` for the full overview.'
|
|
9547
|
+
].join("\n");
|
|
9548
|
+
}
|
|
9549
|
+
return formatWrappersOverview();
|
|
9550
|
+
}
|
|
9551
|
+
const wrapperInfo = getWrapper(resolvedTopic);
|
|
9552
|
+
if (wrapperInfo) {
|
|
9553
|
+
const formatted = formatWrapperInfo(wrapperInfo);
|
|
9554
|
+
if (depth === "brief") {
|
|
9555
|
+
const lines = [
|
|
9556
|
+
`# ${wrapperInfo.type} wrapper`,
|
|
9557
|
+
"",
|
|
9558
|
+
`${wrapperInfo.description.split(".")[0]}.`,
|
|
9559
|
+
"",
|
|
9560
|
+
"```typescript",
|
|
9561
|
+
wrapperInfo.minimalExample ?? `{ type: '${wrapperInfo.type}' }`,
|
|
9562
|
+
"```"
|
|
9563
|
+
];
|
|
9564
|
+
if (wrapperInfo.availability === "demo-only") {
|
|
9565
|
+
lines.push("");
|
|
9566
|
+
lines.push(`**Demo-only** \u2014 ships from \`${wrapperInfo.package}\`, not \`@ng-forge/dynamic-forms\`.`);
|
|
9567
|
+
}
|
|
9568
|
+
return lines.join("\n");
|
|
9569
|
+
}
|
|
9570
|
+
return formatted;
|
|
9571
|
+
}
|
|
8682
9572
|
if (depth === "brief") {
|
|
8683
9573
|
const topicContent2 = TOPICS[resolvedTopic];
|
|
8684
9574
|
if (topicContent2) {
|
|
@@ -8766,7 +9656,12 @@ var NEXT_STEPS = {
|
|
|
8766
9656
|
"logic-matrix": '**Next:** `ngforge_lookup topic="conditional"` for condition syntax \xB7 `ngforge_lookup topic="derivation"` for derivation syntax',
|
|
8767
9657
|
"field-placement": '**Next:** `ngforge_lookup topic="containers"` for container overview',
|
|
8768
9658
|
conditions: '**Next:** `ngforge_lookup topic="conditional"` for full conditional logic docs \xB7 `ngforge_examples pattern="minimal-conditional"` for working example',
|
|
8769
|
-
workflow: '**Next:** `ngforge_lookup topic="golden-path"` for form structure templates \xB7 `ngforge_examples pattern="complete"` for a full working example'
|
|
9659
|
+
workflow: '**Next:** `ngforge_lookup topic="golden-path"` for form structure templates \xB7 `ngforge_examples pattern="complete"` for a full working example',
|
|
9660
|
+
// Wrappers
|
|
9661
|
+
wrappers: '**Next:** `ngforge_lookup topic="css"` for the shipping CSS wrapper \xB7 `ngforge_lookup topic="section"` or `ngforge_lookup topic="arraySection"` for demo wrappers \xB7 `ngforge_examples pattern="wrapper-array-actions"` for a working array-section example',
|
|
9662
|
+
css: '**Next:** `ngforge_lookup topic="wrappers"` for the full wrapper overview \xB7 `ngforge_lookup topic="field-placement"` for where wrappers can apply',
|
|
9663
|
+
arraySection: '**Next:** `ngforge_lookup topic="wrappers"` for the wrapper overview \xB7 `ngforge_lookup topic="array"` for array field docs \xB7 `ngforge_lookup topic="array-buttons"` for the button-field alternative',
|
|
9664
|
+
section: '**Next:** `ngforge_lookup topic="wrappers"` for the wrapper overview \xB7 `ngforge_lookup topic="css"` for the shipping CSS wrapper'
|
|
8770
9665
|
};
|
|
8771
9666
|
function getNextSteps(topic) {
|
|
8772
9667
|
return NEXT_STEPS[topic];
|
|
@@ -8787,6 +9682,8 @@ Field types: input, select, slider, radio, checkbox, textarea, datepicker, toggl
|
|
|
8787
9682
|
|
|
8788
9683
|
Containers: group, row, array, simplified-array, page
|
|
8789
9684
|
|
|
9685
|
+
Wrappers: wrappers (overview), css (shipping), section, arraySection (demo-only)
|
|
9686
|
+
|
|
8790
9687
|
Concepts: validation, conditional, derivation, property-derivation, options-format, expression-variables, async-validators
|
|
8791
9688
|
|
|
8792
9689
|
Patterns: field-placement, logic-matrix, context-api, containers, multi-page-gotchas
|
|
@@ -8794,11 +9691,11 @@ Patterns: field-placement, logic-matrix, context-api, containers, multi-page-got
|
|
|
8794
9691
|
Use topic="list" to see all available topics with descriptions.
|
|
8795
9692
|
Use ngforge_search query="your question" to find topics by keyword.`,
|
|
8796
9693
|
{
|
|
8797
|
-
topic:
|
|
8798
|
-
'Topic to look up: field types (input, select, hidden, group, row, array, page), concepts (validation, conditional, derivation, property-derivation, options-format), patterns (golden-path, pitfalls, multi-page-gotchas), or "list" to see all topics'
|
|
9694
|
+
topic: z55.string().describe(
|
|
9695
|
+
'Topic to look up: field types (input, select, hidden, group, row, array, page), wrappers (wrappers, css, section, arraySection), concepts (validation, conditional, derivation, property-derivation, options-format), patterns (golden-path, pitfalls, multi-page-gotchas), or "list" to see all topics'
|
|
8799
9696
|
),
|
|
8800
|
-
depth:
|
|
8801
|
-
uiIntegration:
|
|
9697
|
+
depth: z55.enum(["brief", "full", "schema"]).default("full").describe("brief=quick syntax (~20 lines), full=complete docs with examples, schema=include JSON schema"),
|
|
9698
|
+
uiIntegration: z55.enum(UI_INTEGRATIONS2).optional().describe("Filter UI-specific info (only with depth=schema). material, bootstrap, primeng, ionic")
|
|
8802
9699
|
},
|
|
8803
9700
|
async ({ topic, depth, uiIntegration }) => {
|
|
8804
9701
|
const normalizedTopic = topic.toLowerCase().trim();
|
|
@@ -8846,7 +9743,7 @@ ${nextSteps}`;
|
|
|
8846
9743
|
}
|
|
8847
9744
|
|
|
8848
9745
|
// packages/dynamic-form-mcp/src/tools/examples.tool.ts
|
|
8849
|
-
import { z as
|
|
9746
|
+
import { z as z56 } from "zod";
|
|
8850
9747
|
var PATTERNS = {
|
|
8851
9748
|
// ========== MINIMAL PATTERNS (NEW) ==========
|
|
8852
9749
|
"minimal-multipage": {
|
|
@@ -10829,7 +11726,7 @@ const megaFormConfig = {
|
|
|
10829
11726
|
{ key: 'pageHeader', type: 'text', label: 'All Field Types Demo', props: { elementType: 'h1' } },
|
|
10830
11727
|
|
|
10831
11728
|
// TEXT INPUTS
|
|
10832
|
-
{ key: 'textInput', type: 'input', label: 'Text Input',
|
|
11729
|
+
{ key: 'textInput', type: 'input', label: 'Text Input', placeholder: 'Type here' },
|
|
10833
11730
|
{ key: 'emailInput', type: 'input', label: 'Email', email: true, props: { type: 'email' } },
|
|
10834
11731
|
{ key: 'passwordInput', type: 'input', label: 'Password', minLength: 8, props: { type: 'password' } },
|
|
10835
11732
|
{ key: 'numberInput', type: 'input', label: 'Number', min: 0, max: 100, props: { type: 'number' } },
|
|
@@ -11072,10 +11969,10 @@ Standard patterns: derivation, property-derivation, multi-page, conditional, val
|
|
|
11072
11969
|
Use pattern="list" to see all available patterns.
|
|
11073
11970
|
Use depth="minimal" for code-only output (no markdown).`,
|
|
11074
11971
|
{
|
|
11075
|
-
pattern:
|
|
11972
|
+
pattern: z56.string().optional().describe(
|
|
11076
11973
|
'Pattern to get: minimal-multipage, minimal-array, minimal-simplified-array, minimal-conditional, minimal-validation, minimal-hidden, derivation, property-derivation, multi-page, conditional, validation, complete, mega. Use "list" to see all.'
|
|
11077
11974
|
),
|
|
11078
|
-
depth:
|
|
11975
|
+
depth: z56.enum(["minimal", "brief", "full", "explained"]).default("full").describe(
|
|
11079
11976
|
"minimal=code only (~20-50 lines), brief=code+summary, full=code+comments (default), explained=code+detailed explanation"
|
|
11080
11977
|
)
|
|
11081
11978
|
},
|
|
@@ -11152,7 +12049,7 @@ function extractCode(markdown) {
|
|
|
11152
12049
|
}
|
|
11153
12050
|
|
|
11154
12051
|
// packages/dynamic-form-mcp/src/tools/validate.tool.ts
|
|
11155
|
-
import { z as
|
|
12052
|
+
import { z as z57 } from "zod";
|
|
11156
12053
|
import { readFile } from "fs/promises";
|
|
11157
12054
|
|
|
11158
12055
|
// packages/dynamic-form-mcp/src/utils/ast-extractor.ts
|
|
@@ -11766,10 +12663,10 @@ Example errors you'll see:
|
|
|
11766
12663
|
- "options MUST be at FIELD level, NOT inside props"
|
|
11767
12664
|
- "containers only support 'hidden' logic type"`,
|
|
11768
12665
|
{
|
|
11769
|
-
config:
|
|
12666
|
+
config: z57.union([z57.string(), z57.object({}).passthrough()]).describe(
|
|
11770
12667
|
"File path (.ts/.js) OR JSON string OR JSON object. Auto-detects: paths ending in .ts/.js or starting with / are treated as files."
|
|
11771
12668
|
),
|
|
11772
|
-
uiIntegration:
|
|
12669
|
+
uiIntegration: z57.enum(UI_INTEGRATIONS3).default("material").describe("UI library to validate against (material, bootstrap, primeng, ionic). Defaults to material.")
|
|
11773
12670
|
},
|
|
11774
12671
|
async ({ config, uiIntegration }) => {
|
|
11775
12672
|
try {
|
|
@@ -11875,7 +12772,7 @@ If validating JSON, ensure:
|
|
|
11875
12772
|
}
|
|
11876
12773
|
|
|
11877
12774
|
// packages/dynamic-form-mcp/src/tools/scaffold.tool.ts
|
|
11878
|
-
import { z as
|
|
12775
|
+
import { z as z58 } from "zod";
|
|
11879
12776
|
var UI_INTEGRATIONS4 = ["material", "bootstrap", "primeng", "ionic"];
|
|
11880
12777
|
function parseFieldDefs(fields) {
|
|
11881
12778
|
return fields.map((f) => {
|
|
@@ -12130,12 +13027,12 @@ Examples:
|
|
|
12130
13027
|
- With groups: pages=0 groups=["address","billing"]
|
|
12131
13028
|
- With hidden: hidden=["userId:abc123","source:web"]`,
|
|
12132
13029
|
{
|
|
12133
|
-
pages:
|
|
12134
|
-
arrays:
|
|
12135
|
-
groups:
|
|
12136
|
-
hidden:
|
|
12137
|
-
fields:
|
|
12138
|
-
uiIntegration:
|
|
13030
|
+
pages: z58.number().min(0).max(10).default(0).describe("Number of pages (0 = single-page form, 1-10 = multi-page wizard)"),
|
|
13031
|
+
arrays: z58.array(z58.string()).optional().describe('Array field names for dynamic lists, e.g., ["contacts", "addresses"]'),
|
|
13032
|
+
groups: z58.array(z58.string()).optional().describe('Group field names for nested objects, e.g., ["address", "billing"]'),
|
|
13033
|
+
hidden: z58.array(z58.string()).optional().describe('Hidden fields as "name:value" pairs, e.g., ["userId:abc", "version:1"]'),
|
|
13034
|
+
fields: z58.array(z58.string()).optional().describe('Basic fields as "name:type" pairs, e.g., ["email:input", "country:select", "age:slider"]'),
|
|
13035
|
+
uiIntegration: z58.enum(UI_INTEGRATIONS4).default("material").describe("UI library (for future UI-specific props). Defaults to material.")
|
|
12139
13036
|
},
|
|
12140
13037
|
async ({ pages, arrays = [], groups = [], hidden = [], fields = [] }) => {
|
|
12141
13038
|
const fieldDefs = parseFieldDefs(fields);
|
|
@@ -12177,7 +13074,7 @@ Examples:
|
|
|
12177
13074
|
}
|
|
12178
13075
|
|
|
12179
13076
|
// packages/dynamic-form-mcp/src/tools/search.tool.ts
|
|
12180
|
-
import { z as
|
|
13077
|
+
import { z as z59 } from "zod";
|
|
12181
13078
|
var searchIndex = null;
|
|
12182
13079
|
function getTopicSubcategory(key) {
|
|
12183
13080
|
const fieldTypes = ["input", "select", "slider", "radio", "checkbox", "textarea", "datepicker", "toggle", "text", "hidden"];
|
|
@@ -12232,6 +13129,18 @@ function buildIndex() {
|
|
|
12232
13129
|
toolCall: `ngforge_examples pattern="${key}"`
|
|
12233
13130
|
});
|
|
12234
13131
|
}
|
|
13132
|
+
for (const wrapper of getWrappers()) {
|
|
13133
|
+
const subcategory = wrapper.availability === "demo-only" ? `Wrapper (demo, ${wrapper.category})` : `Wrapper (${wrapper.category})`;
|
|
13134
|
+
entries.push({
|
|
13135
|
+
id: wrapper.type,
|
|
13136
|
+
category: "wrapper",
|
|
13137
|
+
subcategory,
|
|
13138
|
+
description: wrapper.description,
|
|
13139
|
+
aliases: [],
|
|
13140
|
+
content: `${wrapper.type} wrapper ${wrapper.description} ${wrapper.package}`.toLowerCase(),
|
|
13141
|
+
toolCall: `ngforge_lookup topic="${wrapper.type}"`
|
|
13142
|
+
});
|
|
13143
|
+
}
|
|
12235
13144
|
searchIndex = entries;
|
|
12236
13145
|
return entries;
|
|
12237
13146
|
}
|
|
@@ -12274,7 +13183,7 @@ Try broader terms or check available topics:
|
|
|
12274
13183
|
const lines = ["# Search Results", ""];
|
|
12275
13184
|
for (let i = 0; i < results.length; i++) {
|
|
12276
13185
|
const { entry } = results[i];
|
|
12277
|
-
const categoryLabel = entry.category === "topic" ? `Topic \xB7 ${entry.subcategory}` : `Example \xB7 ${entry.subcategory}`;
|
|
13186
|
+
const categoryLabel = entry.category === "topic" ? `Topic \xB7 ${entry.subcategory}` : entry.category === "wrapper" ? entry.subcategory : `Example \xB7 ${entry.subcategory}`;
|
|
12278
13187
|
lines.push(`${i + 1}. **${entry.id}** (${categoryLabel})`);
|
|
12279
13188
|
lines.push(` ${entry.description}`);
|
|
12280
13189
|
lines.push(` \u2192 \`${entry.toolCall}\``);
|
|
@@ -12301,7 +13210,7 @@ Use this when you don't know the exact topic name.
|
|
|
12301
13210
|
|
|
12302
13211
|
New to ng-forge? Start with: ngforge_lookup topic="workflow"`,
|
|
12303
13212
|
{
|
|
12304
|
-
query:
|
|
13213
|
+
query: z59.string().describe("Natural language or keywords to search for")
|
|
12305
13214
|
},
|
|
12306
13215
|
async ({ query }) => {
|
|
12307
13216
|
const index = buildIndex();
|