extended-dynamic-forms 0.1.17 → 0.1.18
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/LICENSE +21 -0
- package/README.md +835 -393
- package/dist/extended-dynamic-forms.standalone.js +882 -0
- package/dist/style.css +1 -1
- package/examples/conditional-v2-example.tsx +64 -0
- package/examples/dynamic-array-items-example.tsx +211 -0
- package/examples/form-devtools-example.tsx +386 -0
- package/examples/global-ui-rules-example.tsx +356 -0
- package/examples/vanilla-js/README.md +212 -0
- package/examples/vanilla-js/basic-form.html +142 -0
- package/examples/vanilla-js/conditional-form.html +159 -0
- package/examples/vanilla-js/wizard-form.html +185 -0
- package/package.json +40 -47
- package/dist/ExtendedForm.d.ts +0 -4
- package/dist/WizardForm.d.ts +0 -26
- package/dist/components/arrays/ArrayFieldItemTemplate.d.ts +0 -3
- package/dist/components/arrays/ArrayFieldTemplate.d.ts +0 -3
- package/dist/components/arrays/index.d.ts +0 -2
- package/dist/components/fields/AddressField.d.ts +0 -3
- package/dist/components/fields/CurrencyField.d.ts +0 -4
- package/dist/components/fields/PhoneField.d.ts +0 -4
- package/dist/components/index.d.ts +0 -24
- package/dist/components/templates/FieldTemplate.d.ts +0 -4
- package/dist/components/templates/SubmitButton.d.ts +0 -4
- package/dist/components/templates/index.d.ts +0 -2
- package/dist/conditionals/ConditionalActions.d.ts +0 -13
- package/dist/conditionals/ConditionalContext.d.ts +0 -32
- package/dist/conditionals/DynamicArrayConditionalEngine.d.ts +0 -77
- package/dist/conditionals/SimpleConditionalEngine.d.ts +0 -41
- package/dist/conditionals/SmartJsonRulesTransformer.d.ts +0 -10
- package/dist/conditionals/index.d.ts +0 -7
- package/dist/events/FormEventContext.d.ts +0 -20
- package/dist/events/FormEventHub.d.ts +0 -27
- package/dist/events/FormEventManager.d.ts +0 -10
- package/dist/events/index.d.ts +0 -4
- package/dist/index.d.ts +0 -14
- package/dist/index.es.js +0 -44459
- package/dist/index.umd.js +0 -399
- package/dist/layouts/index.d.ts +0 -2
- package/dist/layouts/wizard/ProgressIndicator.d.ts +0 -10
- package/dist/layouts/wizard/StepNavigation.d.ts +0 -11
- package/dist/layouts/wizard/WizardLayout.d.ts +0 -31
- package/dist/layouts/wizard/WizardNavigation.d.ts +0 -16
- package/dist/layouts/wizard/WizardObjectFieldTemplate.d.ts +0 -4
- package/dist/layouts/wizard/WizardSectionTemplate.d.ts +0 -11
- package/dist/layouts/wizard/index.d.ts +0 -7
- package/dist/types/index.d.ts +0 -88
- package/dist/utils/formDataUtils.d.ts +0 -22
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/schemaUtils.d.ts +0 -24
- package/dist/utils/validationUtils.d.ts +0 -26
- package/dist/vanilla-wrapper.d.ts +0 -33
- package/dist/widgets/date/DateWidget.d.ts +0 -4
- package/dist/widgets/enhanced/EnhancedWidgets.d.ts +0 -36
- package/dist/widgets/file/FileWidget.d.ts +0 -4
- package/dist/widgets/index.d.ts +0 -33
- package/dist/widgets/input/ColorWidget.d.ts +0 -4
- package/dist/widgets/input/RangeWidget.d.ts +0 -4
- package/dist/widgets/input/RatingWidget.d.ts +0 -4
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Conditional Form - Vanilla JS</title>
|
|
7
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/antd@5.24.0/dist/reset.css">
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial;
|
|
11
|
+
padding: 20px;
|
|
12
|
+
max-width: 800px;
|
|
13
|
+
margin: 0 auto;
|
|
14
|
+
background: #f0f2f5;
|
|
15
|
+
}
|
|
16
|
+
.form-container {
|
|
17
|
+
background: #fff;
|
|
18
|
+
padding: 24px;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
21
|
+
margin-bottom: 20px;
|
|
22
|
+
}
|
|
23
|
+
.info-box {
|
|
24
|
+
background: #e6f7ff;
|
|
25
|
+
border: 1px solid #91d5ff;
|
|
26
|
+
padding: 12px;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
margin-bottom: 20px;
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
<h1>Conditional Form Example</h1>
|
|
34
|
+
|
|
35
|
+
<div class="info-box">
|
|
36
|
+
This example demonstrates conditional logic where fields appear/disappear based on user selections.
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="form-container">
|
|
40
|
+
<div id="conditional-form"></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<script src="../../dist/extended-dynamic-forms.standalone.js"></script>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
window.addEventListener('DOMContentLoaded', function() {
|
|
47
|
+
const schema = {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
userType: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
title: 'User Type',
|
|
53
|
+
enum: ['individual', 'business'],
|
|
54
|
+
enumNames: ['Individual', 'Business']
|
|
55
|
+
},
|
|
56
|
+
firstName: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
title: 'First Name'
|
|
59
|
+
},
|
|
60
|
+
lastName: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
title: 'Last Name'
|
|
63
|
+
},
|
|
64
|
+
businessName: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
title: 'Business Name'
|
|
67
|
+
},
|
|
68
|
+
taxId: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
title: 'Tax ID / EIN'
|
|
71
|
+
},
|
|
72
|
+
hasInternationalOperations: {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
title: 'International Operations'
|
|
75
|
+
},
|
|
76
|
+
countries: {
|
|
77
|
+
type: 'array',
|
|
78
|
+
title: 'Countries of Operation',
|
|
79
|
+
items: {
|
|
80
|
+
type: 'string'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
required: ['userType']
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const uiSchema = {
|
|
88
|
+
userType: {
|
|
89
|
+
'ui:widget': 'radio'
|
|
90
|
+
},
|
|
91
|
+
countries: {
|
|
92
|
+
'ui:widget': 'checkboxes',
|
|
93
|
+
'ui:options': {
|
|
94
|
+
inline: true
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// Define conditional rules
|
|
100
|
+
const conditionals = {
|
|
101
|
+
rules: [
|
|
102
|
+
// Show individual fields
|
|
103
|
+
{
|
|
104
|
+
conditions: { userType: 'individual' },
|
|
105
|
+
event: {
|
|
106
|
+
type: 'remove',
|
|
107
|
+
params: { field: ['businessName', 'taxId', 'hasInternationalOperations', 'countries'] }
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
// Show business fields
|
|
111
|
+
{
|
|
112
|
+
conditions: { userType: 'business' },
|
|
113
|
+
event: {
|
|
114
|
+
type: 'remove',
|
|
115
|
+
params: { field: ['firstName', 'lastName'] }
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
// Show countries when international
|
|
119
|
+
{
|
|
120
|
+
conditions: {
|
|
121
|
+
userType: 'business',
|
|
122
|
+
hasInternationalOperations: { not: true }
|
|
123
|
+
},
|
|
124
|
+
event: {
|
|
125
|
+
type: 'remove',
|
|
126
|
+
params: { field: 'countries' }
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
// Make business fields required
|
|
130
|
+
{
|
|
131
|
+
conditions: { userType: 'business' },
|
|
132
|
+
event: {
|
|
133
|
+
type: 'require',
|
|
134
|
+
params: { field: ['businessName', 'taxId'] }
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// Create the form with conditionals
|
|
141
|
+
ExtendedDynamicForms.createForm({
|
|
142
|
+
container: '#conditional-form',
|
|
143
|
+
schema: schema,
|
|
144
|
+
uiSchema: uiSchema,
|
|
145
|
+
conditionals: conditionals,
|
|
146
|
+
formData: {
|
|
147
|
+
userType: 'individual'
|
|
148
|
+
},
|
|
149
|
+
onChange: function(formData) {
|
|
150
|
+
console.log('Form data:', formData);
|
|
151
|
+
},
|
|
152
|
+
onSubmit: function(formData) {
|
|
153
|
+
alert('Submitted: ' + JSON.stringify(formData, null, 2));
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
</script>
|
|
158
|
+
</body>
|
|
159
|
+
</html>
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Wizard Form - Vanilla JS</title>
|
|
7
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/antd@5.24.0/dist/reset.css">
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial;
|
|
11
|
+
padding: 20px;
|
|
12
|
+
max-width: 900px;
|
|
13
|
+
margin: 0 auto;
|
|
14
|
+
background: #f0f2f5;
|
|
15
|
+
}
|
|
16
|
+
.wizard-container {
|
|
17
|
+
background: #fff;
|
|
18
|
+
padding: 24px;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
21
|
+
min-height: 500px;
|
|
22
|
+
}
|
|
23
|
+
h1 {
|
|
24
|
+
text-align: center;
|
|
25
|
+
color: #1890ff;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<h1>Multi-Step Wizard Form</h1>
|
|
31
|
+
|
|
32
|
+
<div class="wizard-container">
|
|
33
|
+
<div id="wizard-form"></div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<script src="../../dist/extended-dynamic-forms.standalone.js"></script>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
window.addEventListener('DOMContentLoaded', function() {
|
|
40
|
+
// Define wizard steps
|
|
41
|
+
const steps = [
|
|
42
|
+
{
|
|
43
|
+
id: 'personal',
|
|
44
|
+
title: 'Personal Information',
|
|
45
|
+
schema: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
firstName: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
title: 'First Name',
|
|
51
|
+
minLength: 2
|
|
52
|
+
},
|
|
53
|
+
lastName: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
title: 'Last Name',
|
|
56
|
+
minLength: 2
|
|
57
|
+
},
|
|
58
|
+
dateOfBirth: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
format: 'date',
|
|
61
|
+
title: 'Date of Birth'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
required: ['firstName', 'lastName', 'dateOfBirth']
|
|
65
|
+
},
|
|
66
|
+
uiSchema: {
|
|
67
|
+
dateOfBirth: {
|
|
68
|
+
'ui:widget': 'date'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'contact',
|
|
74
|
+
title: 'Contact Details',
|
|
75
|
+
schema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
email: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
format: 'email',
|
|
81
|
+
title: 'Email Address'
|
|
82
|
+
},
|
|
83
|
+
phone: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
title: 'Phone Number',
|
|
86
|
+
pattern: '^[0-9-+()\\s]+$'
|
|
87
|
+
},
|
|
88
|
+
preferredContact: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
title: 'Preferred Contact Method',
|
|
91
|
+
enum: ['email', 'phone', 'both'],
|
|
92
|
+
enumNames: ['Email', 'Phone', 'Both']
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
required: ['email', 'phone', 'preferredContact']
|
|
96
|
+
},
|
|
97
|
+
uiSchema: {
|
|
98
|
+
email: {
|
|
99
|
+
'ui:widget': 'email'
|
|
100
|
+
},
|
|
101
|
+
preferredContact: {
|
|
102
|
+
'ui:widget': 'radio'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'address',
|
|
108
|
+
title: 'Address Information',
|
|
109
|
+
schema: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
street: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
title: 'Street Address'
|
|
115
|
+
},
|
|
116
|
+
city: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
title: 'City'
|
|
119
|
+
},
|
|
120
|
+
state: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
title: 'State/Province'
|
|
123
|
+
},
|
|
124
|
+
postalCode: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
title: 'Postal Code'
|
|
127
|
+
},
|
|
128
|
+
country: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
title: 'Country',
|
|
131
|
+
enum: ['US', 'CA', 'UK', 'AU'],
|
|
132
|
+
enumNames: ['United States', 'Canada', 'United Kingdom', 'Australia']
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
required: ['street', 'city', 'country']
|
|
136
|
+
},
|
|
137
|
+
uiSchema: {
|
|
138
|
+
street: {
|
|
139
|
+
'ui:widget': 'textarea',
|
|
140
|
+
'ui:options': {
|
|
141
|
+
rows: 2
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
country: {
|
|
145
|
+
'ui:widget': 'select'
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'review',
|
|
151
|
+
title: 'Review & Submit',
|
|
152
|
+
schema: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: {
|
|
155
|
+
agreeToTerms: {
|
|
156
|
+
type: 'boolean',
|
|
157
|
+
title: 'I agree to the terms and conditions'
|
|
158
|
+
},
|
|
159
|
+
newsletter: {
|
|
160
|
+
type: 'boolean',
|
|
161
|
+
title: 'Subscribe to newsletter',
|
|
162
|
+
default: true
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
required: ['agreeToTerms']
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
];
|
|
169
|
+
|
|
170
|
+
// Create the wizard form
|
|
171
|
+
ExtendedDynamicForms.createWizardForm({
|
|
172
|
+
container: '#wizard-form',
|
|
173
|
+
steps: steps,
|
|
174
|
+
initialData: {},
|
|
175
|
+
onStepChange: function(step, formData) {
|
|
176
|
+
console.log('Step ' + step + ' data:', formData);
|
|
177
|
+
},
|
|
178
|
+
onComplete: function(formData) {
|
|
179
|
+
alert('Wizard completed!\n\nFinal data:\n' + JSON.stringify(formData, null, 2));
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
</script>
|
|
184
|
+
</body>
|
|
185
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extended-dynamic-forms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
9
|
+
"dist",
|
|
10
|
+
"examples",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"README.md"
|
|
10
13
|
],
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"**/*.css"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.es.js",
|
|
20
|
+
"require": "./dist/index.umd.js",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./dist/style.css": "./dist/style.css"
|
|
24
|
+
},
|
|
11
25
|
"scripts": {
|
|
12
26
|
"dev": "vite",
|
|
13
27
|
"build": "tsc && vite build",
|
|
14
|
-
"build:vanilla": "vite build --config vite.vanilla.
|
|
28
|
+
"build:vanilla": "vite build --config vite.config.vanilla.ts",
|
|
15
29
|
"build:all": "npm run build && npm run build:vanilla",
|
|
16
30
|
"preview": "vite preview",
|
|
17
31
|
"test": "vitest",
|
|
@@ -19,10 +33,10 @@
|
|
|
19
33
|
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 10",
|
|
20
34
|
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
21
35
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
22
|
-
"prepublishOnly": "npm run build",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
36
|
+
"prepublishOnly": "npm run build:all",
|
|
37
|
+
"playground": "cd playground && npm install && npm run dev",
|
|
38
|
+
"playground:build": "cd playground && npm run build",
|
|
39
|
+
"serve:examples": "npx http-server examples/vanilla-js -p 8080 -o"
|
|
26
40
|
},
|
|
27
41
|
"keywords": [
|
|
28
42
|
"react",
|
|
@@ -34,46 +48,46 @@
|
|
|
34
48
|
],
|
|
35
49
|
"author": "",
|
|
36
50
|
"license": "MIT",
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/user/extended-dynamic-forms.git"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/user/extended-dynamic-forms#readme",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/user/extended-dynamic-forms/issues"
|
|
58
|
+
},
|
|
37
59
|
"peerDependencies": {
|
|
38
|
-
"
|
|
39
|
-
"@rjsf/utils": "^6.0.0-beta.10",
|
|
40
|
-
"@rjsf/validator-ajv8": "^6.0.0-beta.10",
|
|
60
|
+
"antd": "^5.24.0",
|
|
41
61
|
"react": "^18.0.0",
|
|
42
62
|
"react-dom": "^18.0.0"
|
|
43
63
|
},
|
|
44
64
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@rjsf/utils": "^6.0.0-beta.10",
|
|
51
|
-
"@rjsf/validator-ajv8": "^6.0.0-beta.10",
|
|
65
|
+
"@rjsf/antd": "file:../react-jsonschema-form/packages/antd",
|
|
66
|
+
"@rjsf/core": "file:../react-jsonschema-form/packages/core",
|
|
67
|
+
"@rjsf/utils": "file:../react-jsonschema-form/packages/utils",
|
|
68
|
+
"@rjsf/validator-ajv8": "file:../react-jsonschema-form/packages/validator-ajv8",
|
|
69
|
+
"@testing-library/dom": "^10.4.0",
|
|
52
70
|
"@testing-library/jest-dom": "^6.6.3",
|
|
53
71
|
"@testing-library/react": "^16.3.0",
|
|
54
72
|
"@testing-library/user-event": "^14.6.1",
|
|
73
|
+
"@types/node": "^24.0.1",
|
|
55
74
|
"@types/react": "^18.2.43",
|
|
56
75
|
"@types/react-dom": "^18.2.17",
|
|
57
76
|
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
58
77
|
"@typescript-eslint/parser": "^6.14.0",
|
|
59
78
|
"@vitejs/plugin-react": "^4.2.1",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
79
|
+
"antd": "^5.26.0",
|
|
80
|
+
"clsx": "^2.1.1",
|
|
81
|
+
"dotenv": "^16.3.1",
|
|
63
82
|
"eslint": "^8.55.0",
|
|
64
83
|
"eslint-config-prettier": "^10.1.5",
|
|
65
84
|
"eslint-plugin-prettier": "^5.4.1",
|
|
66
85
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
86
|
"eslint-plugin-react-refresh": "^0.4.5",
|
|
68
87
|
"jsdom": "^26.1.0",
|
|
69
|
-
"lucide-react": "^0.303.0",
|
|
70
|
-
"postcss": "^8.4.32",
|
|
71
88
|
"prettier": "^3.5.3",
|
|
72
89
|
"react": "^18.2.0",
|
|
73
90
|
"react-dom": "^18.2.0",
|
|
74
|
-
"tailwind-merge": "^2.2.0",
|
|
75
|
-
"tailwindcss": "^3.4.0",
|
|
76
|
-
"tailwindcss-animate": "^1.0.7",
|
|
77
91
|
"terser": "^5.40.0",
|
|
78
92
|
"typescript": "^5.2.2",
|
|
79
93
|
"vite": "^5.0.8",
|
|
@@ -81,30 +95,9 @@
|
|
|
81
95
|
"vitest": "^1.0.0"
|
|
82
96
|
},
|
|
83
97
|
"dependencies": {
|
|
84
|
-
"@anthropic-ai/sdk": "^0.39.0",
|
|
85
|
-
"@rjsf/antd": "^5.24.11",
|
|
86
|
-
"antd": "^5.21.7",
|
|
87
|
-
"boxen": "^8.0.1",
|
|
88
|
-
"chalk": "^4.1.2",
|
|
89
|
-
"cli-table3": "^0.6.5",
|
|
90
|
-
"clsx": "^2.1.0",
|
|
91
|
-
"commander": "^11.1.0",
|
|
92
|
-
"cors": "^2.8.5",
|
|
93
98
|
"date-fns": "^4.1.0",
|
|
94
99
|
"dayjs": "^1.11.13",
|
|
95
|
-
"
|
|
96
|
-
"express": "^4.21.2",
|
|
97
|
-
"fastmcp": "^1.20.5",
|
|
98
|
-
"figlet": "^1.8.0",
|
|
99
|
-
"fuse.js": "^7.0.0",
|
|
100
|
-
"gradient-string": "^3.0.0",
|
|
101
|
-
"helmet": "^8.1.0",
|
|
102
|
-
"inquirer": "^12.5.0",
|
|
103
|
-
"json-rules-engine-simplified": "^0.2.0",
|
|
104
|
-
"jsonwebtoken": "^9.0.2",
|
|
105
|
-
"lru-cache": "^10.2.0",
|
|
106
|
-
"openai": "^4.89.0",
|
|
107
|
-
"ora": "^8.2.0"
|
|
100
|
+
"json-rules-engine-simplified": "^0.2.0"
|
|
108
101
|
},
|
|
109
102
|
"type": "module"
|
|
110
103
|
}
|
package/dist/ExtendedForm.d.ts
DELETED
package/dist/WizardForm.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { WebhookConfig } from './types';
|
|
2
|
-
|
|
3
|
-
export interface WizardStep {
|
|
4
|
-
id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface WizardFormProps {
|
|
9
|
-
schema: any;
|
|
10
|
-
uiSchema: any;
|
|
11
|
-
conditions?: any[];
|
|
12
|
-
webhooks?: WebhookConfig[];
|
|
13
|
-
formData?: any;
|
|
14
|
-
onSubmit?: (data: any) => void;
|
|
15
|
-
onStepChange?: (step: number, data: any) => void;
|
|
16
|
-
onFieldFocus?: (event: any) => void;
|
|
17
|
-
onFieldBlur?: (event: any) => void;
|
|
18
|
-
onFieldChange?: (event: any) => void;
|
|
19
|
-
showProgressBar?: boolean;
|
|
20
|
-
showStepDescription?: boolean;
|
|
21
|
-
submitButtonText?: string;
|
|
22
|
-
liveValidate?: boolean;
|
|
23
|
-
showErrorList?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare function WizardForm({ schema, uiSchema, conditions, // JSON Rules Engine format conditions
|
|
26
|
-
webhooks, formData: initialFormData, onSubmit, onStepChange, onFieldFocus, onFieldBlur, onFieldChange, showProgressBar, showStepDescription, submitButtonText, liveValidate, showErrorList, }: WizardFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AddressField } from './fields/AddressField';
|
|
2
|
-
import { PhoneField } from './fields/PhoneField';
|
|
3
|
-
import { CurrencyField } from './fields/CurrencyField';
|
|
4
|
-
import { ArrayFieldTemplate, ArrayFieldItemTemplate } from './arrays';
|
|
5
|
-
import { WizardObjectFieldTemplate, WizardSectionTemplate } from '../layouts/wizard';
|
|
6
|
-
import { SubmitButton } from './templates/SubmitButton';
|
|
7
|
-
import { FieldTemplate } from './templates/FieldTemplate';
|
|
8
|
-
|
|
9
|
-
export declare const customFields: {
|
|
10
|
-
address: import('react').FC<import('@rjsf/utils').FieldProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
11
|
-
phone: import('react').FC<import('@rjsf/utils').FieldProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
12
|
-
currency: import('react').FC<import('@rjsf/utils').FieldProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
13
|
-
};
|
|
14
|
-
export declare const customTemplates: {
|
|
15
|
-
FieldTemplate: import('react').FC<import('@rjsf/utils').FieldTemplateProps>;
|
|
16
|
-
ArrayFieldTemplate: (props: import('@rjsf/utils').ArrayFieldTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
ArrayFieldItemTemplate: (props: import('@rjsf/utils').ArrayFieldItemTemplateType) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
WizardObjectFieldTemplate: import('react').FC<import('@rjsf/utils').ObjectFieldTemplateProps>;
|
|
19
|
-
WizardSectionTemplate: import('react').FC<import('../layouts/wizard/WizardSectionTemplate').WizardSectionTemplateProps>;
|
|
20
|
-
ButtonTemplates: {
|
|
21
|
-
SubmitButton: import('react').FC<import('@rjsf/utils').SubmitButtonProps>;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export { AddressField, PhoneField, CurrencyField, FieldTemplate, ArrayFieldTemplate, ArrayFieldItemTemplate, WizardObjectFieldTemplate, WizardSectionTemplate, SubmitButton, };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ConditionalAction, ConditionalActions } from '../types';
|
|
2
|
-
|
|
3
|
-
declare const remove: ConditionalAction;
|
|
4
|
-
declare const require: ConditionalAction;
|
|
5
|
-
declare const uiAppend: ConditionalAction;
|
|
6
|
-
declare const uiOverride: ConditionalAction;
|
|
7
|
-
declare const uiReplace: ConditionalAction;
|
|
8
|
-
declare const enable: ConditionalAction;
|
|
9
|
-
declare const disable: ConditionalAction;
|
|
10
|
-
declare const optional: ConditionalAction;
|
|
11
|
-
declare const show: ConditionalAction;
|
|
12
|
-
export declare const defaultActions: ConditionalActions;
|
|
13
|
-
export { remove, require, uiAppend, uiOverride, uiReplace, enable, disable, optional, show, };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
-
import { ConditionalRule, ConditionalConfig, ConditionalState } from '../types';
|
|
4
|
-
import { DynamicArrayConditionalEngine } from './DynamicArrayConditionalEngine';
|
|
5
|
-
|
|
6
|
-
interface ConditionalContextType {
|
|
7
|
-
state: ConditionalState;
|
|
8
|
-
processor: DynamicArrayConditionalEngine | null;
|
|
9
|
-
processConditionals: (formData: any) => Promise<void>;
|
|
10
|
-
updateRules: (rules: ConditionalRule[]) => void;
|
|
11
|
-
addAction: (actionType: string, actionFunction: any) => void;
|
|
12
|
-
removeAction: (actionType: string) => void;
|
|
13
|
-
getAvailableActions: () => string[];
|
|
14
|
-
}
|
|
15
|
-
export interface ConditionalProviderProps {
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
schema: RJSFSchema;
|
|
18
|
-
uiSchema?: UiSchema;
|
|
19
|
-
config?: ConditionalConfig;
|
|
20
|
-
onSchemaChange?: (schemas: {
|
|
21
|
-
schema: RJSFSchema;
|
|
22
|
-
uiSchema: UiSchema;
|
|
23
|
-
}) => void;
|
|
24
|
-
}
|
|
25
|
-
export declare const ConditionalProvider: React.FC<ConditionalProviderProps>;
|
|
26
|
-
export declare const useConditionals: () => ConditionalContextType;
|
|
27
|
-
export declare const useConditionalSchema: () => {
|
|
28
|
-
schema: RJSFSchema;
|
|
29
|
-
uiSchema: UiSchema;
|
|
30
|
-
isProcessing: boolean;
|
|
31
|
-
};
|
|
32
|
-
export {};
|