@syncfusion/ej2-react-form-renderer 0.1.0-beta

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.
Files changed (48) hide show
  1. package/README.md +148 -0
  2. package/index.d.ts +6 -0
  3. package/index.js +6 -0
  4. package/license +13 -0
  5. package/package.json +49 -0
  6. package/src/CheckboxGroup.d.ts +12 -0
  7. package/src/CheckboxGroup.js +48 -0
  8. package/src/CustomTabComponent.d.ts +13 -0
  9. package/src/CustomTabComponent.js +35 -0
  10. package/src/DataGridComponent.d.ts +29 -0
  11. package/src/DataGridComponent.js +160 -0
  12. package/src/FormRenderer.d.ts +63 -0
  13. package/src/FormRenderer.js +567 -0
  14. package/src/FormValidator.d.ts +479 -0
  15. package/src/FormValidator.js +579 -0
  16. package/src/StaticHtmlRenderer.d.ts +8 -0
  17. package/src/StaticHtmlRenderer.js +21 -0
  18. package/src/index.d.ts +6 -0
  19. package/src/index.js +6 -0
  20. package/src/json-converter.d.ts +170 -0
  21. package/src/json-converter.js +1180 -0
  22. package/src/parser.d.ts +99 -0
  23. package/src/parser.js +749 -0
  24. package/src/renderFormField.d.ts +19 -0
  25. package/src/renderFormField.js +202 -0
  26. package/src/types/FormSchema.d.ts +177 -0
  27. package/src/types/FormSchema.js +1 -0
  28. package/src/utils.js +60 -0
  29. package/styles/bootstrap-dark.css +26 -0
  30. package/styles/bootstrap.css +26 -0
  31. package/styles/bootstrap4.css +26 -0
  32. package/styles/bootstrap5-dark.css +26 -0
  33. package/styles/bootstrap5.3-dark.css +26 -0
  34. package/styles/bootstrap5.3.css +26 -0
  35. package/styles/bootstrap5.css +26 -0
  36. package/styles/fluent-dark.css +26 -0
  37. package/styles/fluent.css +26 -0
  38. package/styles/fluent2-dark.css +26 -0
  39. package/styles/fluent2.css +26 -0
  40. package/styles/form-renderer.base.css +473 -0
  41. package/styles/material-dark.css +26 -0
  42. package/styles/material.css +26 -0
  43. package/styles/material3-dark.css +26 -0
  44. package/styles/material3.css +26 -0
  45. package/styles/tailwind-dark.css +26 -0
  46. package/styles/tailwind.css +26 -0
  47. package/styles/tailwind3-dark.css +10 -0
  48. package/styles/tailwind3.css +26 -0
@@ -0,0 +1,99 @@
1
+ import type { FormSchema, FormComponent } from '../FormBuilder/types/FormSchema';
2
+ /**
3
+ * Parser configuration interface
4
+ */
5
+ export interface ParserConfig {
6
+ strict: boolean;
7
+ maxInputSize: number;
8
+ defaultTextType: 'textbox' | 'textarea';
9
+ inferTypeFromValue: boolean;
10
+ generateIds: boolean;
11
+ includeMetadata: boolean;
12
+ customTypeMap?: Record<string, string>;
13
+ validateUnknownFields?: boolean;
14
+ }
15
+ /**
16
+ * Format detection result
17
+ */
18
+ export interface FormatDetectionResult {
19
+ format: 'json-schema' | 'surveyjs' | 'openapi' | 'data-inference' | 'configured-schema' | 'unknown';
20
+ confidence: 'high' | 'medium' | 'low';
21
+ hints: string[];
22
+ ambiguousFormats?: string[];
23
+ }
24
+ /**
25
+ * Parse result with metadata
26
+ */
27
+ export interface ParseResult {
28
+ success: boolean;
29
+ schema: FormSchema | null;
30
+ errors: string[];
31
+ warnings: string[];
32
+ metadata: {
33
+ detectedFormat: string;
34
+ confidence: 'high' | 'medium' | 'low';
35
+ sourceHints: string[];
36
+ };
37
+ }
38
+ /**
39
+ * Validation result interface
40
+ */
41
+ export interface ValidationResult {
42
+ valid: boolean;
43
+ errors?: string[];
44
+ warnings?: string[];
45
+ }
46
+ /**
47
+ * Parse result with components and warnings
48
+ */
49
+ export interface ParseComponentsResult {
50
+ components: FormComponent[];
51
+ warnings: string[];
52
+ }
53
+ /**
54
+ * ==================== UNIVERSAL JSON PARSER CLASS ====================
55
+ */
56
+ export declare class UniversalJsonParser {
57
+ private config;
58
+ constructor(customConfig?: Partial<ParserConfig>);
59
+ parse(input: string | any): ParseResult;
60
+ private formatError;
61
+ private detectFormat;
62
+ private hasExampleFields;
63
+ private isDataInferenceCandidate;
64
+ private inferComponentType;
65
+ private inferTypeFromValue;
66
+ private matchFieldNamePattern;
67
+ private parseJsonSchema;
68
+ private flattenNestedProperties;
69
+ private collectFlattenedFieldNames;
70
+ private parseSurveyJS;
71
+ private createComponentFromSurveyJS;
72
+ private mapSurveyJSType;
73
+ private parseOpenAPI;
74
+ private parseDataInference;
75
+ private createComponent;
76
+ private parseDateFromValue;
77
+ private formatDate;
78
+ private formatDateTimeValue;
79
+ private mapJsonSchemaType;
80
+ private generateComponentId;
81
+ private humanizeFieldName;
82
+ }
83
+ /**
84
+ * Validates JSON syntax
85
+ */
86
+ export declare const validateJSON: (jsonString: string) => ValidationResult;
87
+ /**
88
+ * Validates the structure of a FormSchema object
89
+ */
90
+ export declare const validateFormSchema: (schema: any) => ValidationResult;
91
+ /**
92
+ * Sanitizes and normalizes a form schema
93
+ * Adds default values for missing optional properties
94
+ */
95
+ export declare const sanitizeFormSchema: (schema: any) => FormSchema;
96
+ /**
97
+ * Exports a FormSchema to formatted JSON string
98
+ */
99
+ export declare const exportFormSchema: (schema: FormSchema) => string;