@syncfusion/ej2-react-form-renderer 0.1.2-beta → 34.2.2
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 +88 -105
- package/diConfig.json +85 -0
- package/dist/ej2-react-form-renderer.min.js +10 -0
- package/dist/ej2-react-form-renderer.umd.min.js +11 -0
- package/dist/ej2-react-form-renderer.umd.min.js.map +1 -0
- package/dist/es6/ej2-react-form-renderer.es2015.js +37 -0
- package/dist/es6/ej2-react-form-renderer.es2015.js.map +1 -0
- package/form-renderer.d.ts +4 -0
- package/form-renderer.js +4 -0
- package/index.d.ts +2 -4
- package/index.js +2 -4
- package/license +6 -13
- package/package.json +19 -38
- package/src/form-renderer/formrenderer.component.d.ts +34 -0
- package/src/form-renderer/formrenderer.component.js +49 -0
- package/src/form-renderer/index.d.ts +1 -0
- package/src/form-renderer/index.js +1 -0
- package/src/global.js +1 -0
- package/src/index.d.ts +2 -6
- package/src/index.js +2 -6
- package/styles/bds-lite.css +1 -0
- package/styles/bds-lite.scss +1 -0
- package/styles/bds.css +1 -0
- package/styles/bds.scss +1 -0
- package/styles/bootstrap-dark-lite.css +1 -0
- package/styles/bootstrap-dark-lite.scss +1 -0
- package/styles/bootstrap-dark.css +1 -26
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap-lite.css +1 -0
- package/styles/bootstrap-lite.scss +1 -0
- package/styles/bootstrap.css +1 -26
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4-lite.css +1 -0
- package/styles/bootstrap4-lite.scss +1 -0
- package/styles/bootstrap4.css +1 -26
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark-lite.css +1 -0
- package/styles/bootstrap5-dark-lite.scss +1 -0
- package/styles/bootstrap5-dark.css +1 -26
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5-lite.css +1 -0
- package/styles/bootstrap5-lite.scss +1 -0
- package/styles/bootstrap5.3-lite.css +1 -0
- package/styles/bootstrap5.3-lite.scss +1 -0
- package/styles/bootstrap5.3.css +1 -26
- package/styles/bootstrap5.3.scss +1 -0
- package/styles/bootstrap5.css +1 -26
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark-lite.css +1 -0
- package/styles/fabric-dark-lite.scss +1 -0
- package/styles/fabric-dark.css +1 -0
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric-lite.css +1 -0
- package/styles/fabric-lite.scss +1 -0
- package/styles/fabric.css +1 -0
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark-lite.css +1 -0
- package/styles/fluent-dark-lite.scss +1 -0
- package/styles/fluent-dark.css +1 -26
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent-lite.css +1 -0
- package/styles/fluent-lite.scss +1 -0
- package/styles/fluent.css +1 -26
- package/styles/fluent.scss +1 -0
- package/styles/fluent2-lite.css +1 -0
- package/styles/fluent2-lite.scss +1 -0
- package/styles/fluent2.css +1 -26
- package/styles/fluent2.scss +1 -0
- package/styles/form-renderer/bds.css +1 -0
- package/styles/form-renderer/bds.scss +1 -0
- package/styles/form-renderer/bootstrap-dark.css +1 -0
- package/styles/form-renderer/bootstrap-dark.scss +1 -0
- package/styles/form-renderer/bootstrap.css +1 -0
- package/styles/form-renderer/bootstrap.scss +1 -0
- package/styles/form-renderer/bootstrap4.css +1 -0
- package/styles/form-renderer/bootstrap4.scss +1 -0
- package/styles/form-renderer/bootstrap5-dark.css +1 -0
- package/styles/form-renderer/bootstrap5-dark.scss +1 -0
- package/styles/form-renderer/bootstrap5.3.css +1 -0
- package/styles/form-renderer/bootstrap5.3.scss +1 -0
- package/styles/form-renderer/bootstrap5.css +1 -0
- package/styles/form-renderer/bootstrap5.scss +1 -0
- package/styles/form-renderer/fabric-dark.css +1 -0
- package/styles/form-renderer/fabric-dark.scss +1 -0
- package/styles/form-renderer/fabric.css +1 -0
- package/styles/form-renderer/fabric.scss +1 -0
- package/styles/form-renderer/fluent-dark.css +1 -0
- package/styles/form-renderer/fluent-dark.scss +1 -0
- package/styles/form-renderer/fluent.css +1 -0
- package/styles/form-renderer/fluent.scss +1 -0
- package/styles/form-renderer/fluent2.css +1 -0
- package/styles/form-renderer/fluent2.scss +1 -0
- package/styles/form-renderer/highcontrast-light.css +1 -0
- package/styles/form-renderer/highcontrast-light.scss +1 -0
- package/styles/form-renderer/highcontrast.css +1 -0
- package/styles/form-renderer/highcontrast.scss +1 -0
- package/styles/form-renderer/material-dark.css +1 -0
- package/styles/form-renderer/material-dark.scss +1 -0
- package/styles/form-renderer/material.css +1 -0
- package/styles/form-renderer/material.scss +1 -0
- package/styles/form-renderer/material3-dark.css +1 -0
- package/styles/form-renderer/material3-dark.scss +1 -0
- package/styles/form-renderer/material3.css +1 -0
- package/styles/form-renderer/material3.scss +1 -0
- package/styles/form-renderer/tailwind-dark.css +1 -0
- package/styles/form-renderer/tailwind-dark.scss +1 -0
- package/styles/form-renderer/tailwind.css +1 -0
- package/styles/form-renderer/tailwind.scss +1 -0
- package/styles/form-renderer/tailwind3.css +1 -0
- package/styles/form-renderer/tailwind3.scss +1 -0
- package/styles/highcontrast-light-lite.css +1 -0
- package/styles/highcontrast-light-lite.scss +1 -0
- package/styles/highcontrast-light.css +1 -0
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast-lite.css +1 -0
- package/styles/highcontrast-lite.scss +1 -0
- package/styles/highcontrast.css +1 -0
- package/styles/highcontrast.scss +1 -0
- package/styles/material-dark-lite.css +1 -0
- package/styles/material-dark-lite.scss +1 -0
- package/styles/material-dark.css +1 -26
- package/styles/material-dark.scss +1 -0
- package/styles/material-lite.css +1 -0
- package/styles/material-lite.scss +1 -0
- package/styles/material.css +1 -26
- package/styles/material.scss +1 -0
- package/styles/material3-dark-lite.css +1 -0
- package/styles/material3-dark-lite.scss +1 -0
- package/styles/material3-dark.css +1 -26
- package/styles/material3-dark.scss +1 -0
- package/styles/material3-lite.css +1 -0
- package/styles/material3-lite.scss +1 -0
- package/styles/material3.css +1 -26
- package/styles/material3.scss +1 -0
- package/styles/tailwind-dark-lite.css +1 -0
- package/styles/tailwind-dark-lite.scss +1 -0
- package/styles/tailwind-dark.css +1 -26
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind-lite.css +1 -0
- package/styles/tailwind-lite.scss +1 -0
- package/styles/tailwind.css +1 -26
- package/styles/tailwind.scss +1 -0
- package/styles/tailwind3-lite.css +1 -0
- package/styles/tailwind3-lite.scss +1 -0
- package/styles/tailwind3.css +1 -26
- package/styles/tailwind3.scss +1 -0
- package/src/CheckboxGroup.d.ts +0 -12
- package/src/CheckboxGroup.js +0 -49
- package/src/ConditionalRuleEngine.d.ts +0 -295
- package/src/ConditionalRuleEngine.js +0 -566
- package/src/CustomTabComponent.d.ts +0 -13
- package/src/CustomTabComponent.js +0 -35
- package/src/DataGridComponent.d.ts +0 -28
- package/src/DataGridComponent.js +0 -147
- package/src/FormRenderer.d.ts +0 -84
- package/src/FormRenderer.js +0 -707
- package/src/FormValidator.d.ts +0 -479
- package/src/FormValidator.js +0 -579
- package/src/MinMaxRuleEngine.d.ts +0 -95
- package/src/MinMaxRuleEngine.js +0 -361
- package/src/StaticHtmlRenderer.d.ts +0 -8
- package/src/StaticHtmlRenderer.js +0 -21
- package/src/expressions/DependencyTracker.d.ts +0 -30
- package/src/expressions/DependencyTracker.js +0 -128
- package/src/expressions/ExpressionEngine.d.ts +0 -81
- package/src/expressions/ExpressionEngine.js +0 -503
- package/src/expressions/ExpressionParser.d.ts +0 -39
- package/src/expressions/ExpressionParser.js +0 -270
- package/src/json-converter.d.ts +0 -171
- package/src/json-converter.js +0 -1209
- package/src/parser.d.ts +0 -99
- package/src/parser.js +0 -753
- package/src/renderFormField.d.ts +0 -21
- package/src/renderFormField.js +0 -226
- package/src/types/FormSchema.d.ts +0 -211
- package/src/types/FormSchema.js +0 -1
- package/src/utils.js +0 -408
- package/styles/bootstrap5.3-dark.css +0 -26
- package/styles/fluent2-dark.css +0 -26
- package/styles/form-renderer.base.css +0 -499
- package/styles/tailwind3-dark.css +0 -10
package/src/renderFormField.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Standalone Form Field Renderer
|
|
3
|
-
* Renders individual form components based on FormComponent schema
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { type FormComponent } from './types/FormSchema';
|
|
7
|
-
export interface RenderFormFieldProps {
|
|
8
|
-
component: FormComponent;
|
|
9
|
-
value?: any;
|
|
10
|
-
onChange: (value: any) => void;
|
|
11
|
-
formState?: any;
|
|
12
|
-
onBlur?: () => void;
|
|
13
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
-
ref?: any;
|
|
15
|
-
hasError?: boolean;
|
|
16
|
-
locale: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Renders a single form field component
|
|
20
|
-
*/
|
|
21
|
-
export declare const RenderFormField: ({ component, value, onChange, onBlur, ref, hasError, onClick, locale, formState }: RenderFormFieldProps) => React.ReactNode;
|
package/src/renderFormField.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { TextBoxComponent, NumericTextBoxComponent, MaskedTextBoxComponent, UploaderComponent, TextAreaComponent } from '@syncfusion/ej2-react-inputs';
|
|
3
|
-
import { CheckBoxComponent, RadioButtonComponent, SwitchComponent, ButtonComponent, } from '@syncfusion/ej2-react-buttons';
|
|
4
|
-
import { SplitButtonComponent } from '@syncfusion/ej2-react-splitbuttons';
|
|
5
|
-
import { CheckBoxSelection, DropDownListComponent, MultiSelectComponent, } from '@syncfusion/ej2-react-dropdowns';
|
|
6
|
-
import { DatePickerComponent, DateTimePickerComponent, TimePickerComponent, DateRangePickerComponent, Inject, Islamic, } from '@syncfusion/ej2-react-calendars';
|
|
7
|
-
import { SliderComponent } from '@syncfusion/ej2-react-inputs';
|
|
8
|
-
import { ColorPickerComponent } from '@syncfusion/ej2-react-inputs';
|
|
9
|
-
import { RatingComponent } from '@syncfusion/ej2-react-inputs';
|
|
10
|
-
import { SignatureComponent } from '@syncfusion/ej2-react-inputs';
|
|
11
|
-
import { MessageComponent } from '@syncfusion/ej2-react-notifications';
|
|
12
|
-
import { ImageEditorComponent } from '@syncfusion/ej2-react-image-editor';
|
|
13
|
-
import { DataGridComponent } from './DataGridComponent';
|
|
14
|
-
import { RichTextEditorComponent, Toolbar, HtmlEditor, Inject as RTEInject, Link, QuickToolbar } from '@syncfusion/ej2-react-richtexteditor';
|
|
15
|
-
import { mapButtonStyleToClass, mapPositionToJustifyContent, resolveButtonType, resolveConditionalData, resolveOptions, useFetchOptions } from './utils';
|
|
16
|
-
import CheckboxGroup from './CheckboxGroup';
|
|
17
|
-
import { ConditionalRuleEngine } from './ConditionalRuleEngine';
|
|
18
|
-
/**
|
|
19
|
-
* Converts htmlAttributes from array format to object format
|
|
20
|
-
*/
|
|
21
|
-
const normalizeAttributes = (attributes) => {
|
|
22
|
-
if (!attributes)
|
|
23
|
-
return {};
|
|
24
|
-
if (Array.isArray(attributes)) {
|
|
25
|
-
return attributes.reduce((acc, item) => {
|
|
26
|
-
if (item.key && item.value !== undefined) {
|
|
27
|
-
acc[item.key] = item.value;
|
|
28
|
-
}
|
|
29
|
-
return acc;
|
|
30
|
-
}, {});
|
|
31
|
-
}
|
|
32
|
-
return attributes;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Renders a single form field component
|
|
36
|
-
*/
|
|
37
|
-
export const RenderFormField = ({ component, value, onChange, onBlur, ref, hasError = false, onClick, locale, formState }) => {
|
|
38
|
-
const commonProps = {
|
|
39
|
-
floatLabelType: (component.floatLabelType || 'Never'),
|
|
40
|
-
placeholder: component.placeholder || '',
|
|
41
|
-
enabled: !component.disabled,
|
|
42
|
-
};
|
|
43
|
-
const createValidationHandlers = (getValue) => {
|
|
44
|
-
const validateOn = component.validateOn || 'Change';
|
|
45
|
-
const handlers = {};
|
|
46
|
-
// If validateOn is 'Change' or undefined, add change and blur handlers
|
|
47
|
-
if (!validateOn || validateOn === 'Change') {
|
|
48
|
-
handlers.onChange = (args) => onChange(getValue(args));
|
|
49
|
-
handlers.onBlur = () => onBlur?.();
|
|
50
|
-
}
|
|
51
|
-
// If validateOn is 'Blur', add change and blur handlers
|
|
52
|
-
if (validateOn === 'Blur') {
|
|
53
|
-
handlers.change = (args) => onChange(getValue(args));
|
|
54
|
-
handlers.blur = () => onBlur?.();
|
|
55
|
-
}
|
|
56
|
-
return handlers;
|
|
57
|
-
};
|
|
58
|
-
const htmlAttrs = normalizeAttributes(component.htmlAttributes);
|
|
59
|
-
const errorClass = hasError ? 'e-error' : '';
|
|
60
|
-
const cssClass = `${component.cssClass || ''} ${errorClass} ${component.size === 'Small' ? ' e-small' : component.size === 'Bigger' ? ' e-bigger' : ''}`.trim();
|
|
61
|
-
switch (component.type) {
|
|
62
|
-
case 'textbox':
|
|
63
|
-
return (_jsx(TextBoxComponent, { id: component.id, type: component.multiline ? 'hidden' : component.textboxType ? component.textboxType : 'text', name: component.id, locale: locale, ...commonProps, value: value !== undefined ? value : (component.defaultValue || ''), multiline: component.multiline, showClearButton: component.showClearButton, autocomplete: component.autocomplete === false ? 'off' : 'on', readonly: component.readOnly || false, cssClass: cssClass, htmlAttributes: htmlAttrs, appendTemplate: component.suffix, prependTemplate: component.prefix, ...createValidationHandlers((args) => args.value || ''), ref: ref }, component.id));
|
|
64
|
-
case 'textarea':
|
|
65
|
-
return (_jsx(TextAreaComponent, { id: component.id, name: component.id, locale: locale, ...commonProps, value: value !== undefined ? value : (component.defaultValue || ''), cols: component.cols || 200, rows: component.textareaRows || 4, showClearButton: component.showClearButton || false, readonly: component.readOnly || false, maxLength: component?.maxLength || 255, cssClass: cssClass, htmlAttributes: htmlAttrs, appendTemplate: component.suffix, prependTemplate: component.prefix, resizeMode: 'Vertical', ...createValidationHandlers((args) => args.value || ''), ref: ref }, component.id));
|
|
66
|
-
case 'number':
|
|
67
|
-
value = value === "" ? undefined : value;
|
|
68
|
-
return (_jsx(NumericTextBoxComponent, { id: component.id, name: component.id, locale: locale, ...commonProps, value: value !== undefined || value !== "" ? value : (component.defaultValue || 0), decimals: component.decimals || 2, currency: component.currency, format: component.numberFormat || 'n2', step: component.step || 1, min: component.minValue || undefined, max: component.maxValue || undefined, readonly: component.readOnly || false, showClearButton: component.showClearButton || false, cssClass: cssClass, htmlAttributes: htmlAttrs, appendTemplate: component.suffix, prependTemplate: component.prefix, ...createValidationHandlers((args) => args.value || ''), ref: ref }, `${component.id}-${component.minValue}-${component.maxValue}`));
|
|
69
|
-
case 'checkbox':
|
|
70
|
-
const checkboxLabel = component.label && component.required
|
|
71
|
-
? `${component.label} *`
|
|
72
|
-
: component.label;
|
|
73
|
-
return (_jsx(CheckBoxComponent, { id: component.id, locale: locale, name: component.id, label: checkboxLabel, labelPosition: component.checkboxLabelPosition, checked: (component.checked ?? false) || (value ?? false), indeterminate: component.indeterminate || false, disabled: component.disabled, cssClass: cssClass, htmlAttributes: htmlAttrs, change: (args) => onChange(args.checked), ref: ref }, component.id));
|
|
74
|
-
case 'checkboxGroup':
|
|
75
|
-
const fetchedCheckboxOptions = useFetchOptions(component.options);
|
|
76
|
-
const resolvedCheckboxOptions = resolveOptions(component.options, fetchedCheckboxOptions);
|
|
77
|
-
const finalCheckboxOptions = resolvedCheckboxOptions.length > 0 ? resolvedCheckboxOptions : component.options || ['Option 1'];
|
|
78
|
-
return (_jsx(CheckboxGroup, { component: { ...component, options: finalCheckboxOptions }, value: value, onChange: (v) => onChange(v), optionRef: ref }, component.id));
|
|
79
|
-
case 'radio':
|
|
80
|
-
return (_jsx("div", { id: `${component.id}-group`, className: `e-radio-group ${errorClass}`, children: (Array.isArray(component.options) ? component.options : ['Option 1']).map((option, idx) => {
|
|
81
|
-
const optionValue = option;
|
|
82
|
-
const optionText = option;
|
|
83
|
-
return (_jsx("div", { style: { marginBottom: '8px' }, children: _jsx(RadioButtonComponent, { id: `${component.id}_${idx}_${optionValue}`, name: component.id, label: optionText, locale: locale, disabled: component.disabled, value: optionValue, htmlAttributes: htmlAttrs, labelPosition: component.fieldLabelPosition, checked: component.defaultValue === optionValue || value === optionValue, cssClass: cssClass, change: (args) => {
|
|
84
|
-
if (args.value === optionValue) {
|
|
85
|
-
onChange(optionValue);
|
|
86
|
-
}
|
|
87
|
-
}, ref: ref ? (el) => ref(el, idx) : undefined }, component.id) }, idx));
|
|
88
|
-
}) }));
|
|
89
|
-
case 'dropdown':
|
|
90
|
-
const fetchedDropdownOptions = useFetchOptions(component.options);
|
|
91
|
-
const resolvedDropdownOptions = resolveOptions(component.options, fetchedDropdownOptions);
|
|
92
|
-
let finalDropdownOptions = resolvedDropdownOptions.length > 0 ? resolvedDropdownOptions : component.options || ['Option 1'];
|
|
93
|
-
if (component.conditions?.choiceBasedField) {
|
|
94
|
-
finalDropdownOptions = ConditionalRuleEngine.getChoiceBasedOptions(component.conditions.choiceBasedField, finalDropdownOptions, formState?.values, component.conditions.choiceBasedField.primaryFieldId);
|
|
95
|
-
if (finalDropdownOptions.length > 0 && value != null && !finalDropdownOptions.includes(value)) {
|
|
96
|
-
formState.onChange(component.id, { value: null });
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return (_jsx(DropDownListComponent, { id: component.id, name: component.id, ...commonProps, locale: locale, cssClass: cssClass, dataSource: finalDropdownOptions, value: value !== undefined ? value : (component.defaultValue ?? null), showClearButton: component.showClearButton || false, readonly: component.readOnly || false, enableVirtualization: component.enableVirtualization || false, popupHeight: component.popupHeight || '300px', popupWidth: component.popupWidth || '100%', htmlAttributes: htmlAttrs, ...createValidationHandlers((args) => args.value || ''), ref: ref }, component.id));
|
|
100
|
-
case 'multiselect':
|
|
101
|
-
const fetchedMultiSelectOptions = useFetchOptions(component.options);
|
|
102
|
-
const resolvedMultiSelectOptions = resolveOptions(component.options, fetchedMultiSelectOptions);
|
|
103
|
-
const finalMultiSelectOptions = resolvedMultiSelectOptions.length > 0 ? resolvedMultiSelectOptions : component.options || ['Option 1'];
|
|
104
|
-
return (_jsx(MultiSelectComponent, { id: component.id, name: component.id, locale: locale, ...commonProps, value: value !== undefined ? value : (component.defaultValue ?? null), placeholder: component.placeholder, dataSource: finalMultiSelectOptions, fields: { text: 'text', value: 'value' }, showClearButton: component.showClearButton || false, readonly: component.readOnly || false, allowCustomValue: component.allowCustomValue || false, addTagOnBlur: component.addTagOnBlur || false, delimiterChar: component.delimiterChar || ',', showSelectAll: component.showSelectAll || false, mode: component.showSelectAll ? 'CheckBox' : undefined, selectAllText: component.selectAllText, unSelectAllText: component.unSelectAllText, showDropDownIcon: component.showDropDownIcon !== false, enableVirtualization: component.enableVirtualization || false, popupHeight: component.popupHeight || '300px', popupWidth: component.popupWidth || '100%', cssClass: cssClass, htmlAttributes: htmlAttrs, ...createValidationHandlers((args) => args.value || ''), ref: ref, children: _jsx(Inject, { services: [CheckBoxSelection] }) }, component.id));
|
|
105
|
-
case 'date':
|
|
106
|
-
return (_jsx(DatePickerComponent, { ...commonProps, id: component.id, name: component.id, locale: locale, value: value !== undefined ? value : (component.defaultValue ?? null), floatLabelType: component.floatLabelType || 'Never', format: component.format || 'MM/dd/yyyy', placeholder: component.placeholder || '', readOnly: component.readOnly || false, showClearButton: component.showClearButton !== false ? true : false, showTodayButton: component.showTodayButton !== false ? true : false, calendarMode: component.calendarMode || 'Gregorian', dayHeaderFormat: component.dayHeaderFormat || 'Short', depth: component.depth || 'Month', start: component.start || 'Month', firstDayOfWeek: component.firstDayOfWeek || 0, min: component?.minDate ? new Date(component.minDate) : undefined, max: component?.maxDate ? new Date(component.maxDate) : undefined, cssClass: cssClass, htmlAttributes: htmlAttrs, ...createValidationHandlers((args) => args.value || ''), ref: ref, children: _jsx(Inject, { services: [Islamic] }) }, `${component.id}-${component.minDate}-${component.maxDate}`));
|
|
107
|
-
case 'dateTime':
|
|
108
|
-
return (_jsx(DateTimePickerComponent, { id: `${component.id}-${component.minTime}-${component.maxTime}-${component.minDate}-${component.maxDate}`, ...commonProps, locale: locale, name: component.id, floatLabelType: component.floatLabelType || 'Never', dayHeaderFormat: component.dayHeaderFormat || 'Short', value: value !== undefined ? value : (component.defaultValue ?? null), format: component.format || 'MM/dd/yyyy hh:mm a', showClearButton: component.showClearButton !== false, showTodayButton: component.showTodayButton !== false ? true : false, depth: component.depth || 'Month', start: component.start || 'Month', step: component.step || 1, readonly: component.readOnly || false, min: component?.minDate ? new Date(component.minDate) : undefined, max: component?.maxDate ? new Date(component.maxDate) : undefined, minTime: component?.minTime ? new Date(`2000-01-01 ${component.minTime}`) : undefined, maxTime: component?.maxTime ? new Date(`2000-01-01 ${component.maxTime}`) : undefined, enableMask: false, cssClass: cssClass, htmlAttributes: htmlAttrs, ...createValidationHandlers((args) => args.value || ''), ref: ref, children: _jsx(Inject, { services: [Islamic] }) }));
|
|
109
|
-
case 'time':
|
|
110
|
-
return (_jsx(TimePickerComponent, { id: `${component.id}-${component.minTime}-${component.maxTime}`, locale: locale, name: component.id, floatLabelType: component.floatLabelType || 'Never', placeholder: component.placeholder || '', enabled: !component.disabled, value: value !== undefined ? value : (component.defaultValue ?? null), format: component.format || 'hh:mm a', showClearButton: component.showClearButton !== false, step: component.step || 30, readonly: component.readOnly || false, min: component?.minTime ? new Date(`2000-01-01 ${component.minTime}`) : undefined, max: component?.maxTime ? new Date(`2000-01-01 ${component.maxTime}`) : undefined, enableMask: false, cssClass: cssClass, htmlAttributes: htmlAttrs, ...createValidationHandlers((args) => args.value || ''), ref: ref }, component.id));
|
|
111
|
-
case 'dateRange':
|
|
112
|
-
return (_jsx(DateRangePickerComponent, { id: component.id, locale: locale, name: component.id, floatLabelType: component.floatLabelType || 'Never', dayHeaderFormat: component.dayHeaderFormat || 'Short', placeholder: component.placeholder || '', enabled: !component.disabled, value: value !== undefined ? value : (component.defaultValue ?? null), depth: component.depth || 'Month', start: component.start || 'Month', min: component?.minDate ? new Date(component.minDate) : undefined, max: component?.maxDate ? new Date(component.maxDate) : undefined, format: component.format || 'MM/dd/yyyy', separator: component.separator || ' - ', showClearButton: component.showClearButton !== false, readonly: component.readOnly || false, cssClass: cssClass, htmlAttributes: htmlAttrs, ...createValidationHandlers((args) => args.value || ''), ref: ref }, component.id));
|
|
113
|
-
case 'switch':
|
|
114
|
-
return (_jsx(SwitchComponent, { id: component.id, locale: locale, value: component.defaultValue, name: component.id, checked: (component.checked ?? false) || (value ?? false), disabled: component.disabled, onLabel: component.onLabel || '', offLabel: component.offLabel || '', cssClass: cssClass, htmlAttributes: htmlAttrs, change: (args) => onChange(args.checked), ref: ref }, component.id));
|
|
115
|
-
case 'button':
|
|
116
|
-
// If buttonsGroups is provided, render a button group in-place of a single button
|
|
117
|
-
const groupButtons = (component.buttonsGroups || component.buttons || []);
|
|
118
|
-
if (groupButtons && groupButtons.length > 0) {
|
|
119
|
-
const groupStyleObj = {
|
|
120
|
-
display: 'flex',
|
|
121
|
-
flexWrap: 'wrap',
|
|
122
|
-
alignItems: 'center',
|
|
123
|
-
gap: component.gap || '8px',
|
|
124
|
-
justifyContent: mapPositionToJustifyContent(component.position),
|
|
125
|
-
width: component.width || undefined,
|
|
126
|
-
};
|
|
127
|
-
return (_jsx("div", { id: component.id, role: "group", "aria-label": component.label || 'Button Group', className: cssClass, style: groupStyleObj, children: groupButtons.map((btn, idx) => {
|
|
128
|
-
const btnId = `${component.id}_${idx}`;
|
|
129
|
-
const btnCssClass = [
|
|
130
|
-
mapButtonStyleToClass(btn.style)
|
|
131
|
-
].filter(Boolean).join(' ');
|
|
132
|
-
return (_jsx(ButtonComponent, { id: String(btnId), name: String(btnId), locale: locale, type: resolveButtonType(btn.type), cssClass: btnCssClass, disabled: btn.disabled || false, content: btn.label || `Button ${idx + 1}`, iconCss: btn.iconCss, iconPosition: btn.iconPosition, onClick: (event) => {
|
|
133
|
-
if (onClick) {
|
|
134
|
-
onClick(event);
|
|
135
|
-
}
|
|
136
|
-
}, ref: (el) => {
|
|
137
|
-
if (ref && typeof ref === 'function') {
|
|
138
|
-
ref(el, idx);
|
|
139
|
-
}
|
|
140
|
-
} }, String(btnId)));
|
|
141
|
-
}) }, `form-${component.type}-${component.id}`));
|
|
142
|
-
}
|
|
143
|
-
// Fallback: render a single ButtonComponent when no group is configured
|
|
144
|
-
const resolvedButtonType = resolveButtonType(component.buttonType);
|
|
145
|
-
const buttonCssClassList = [
|
|
146
|
-
mapButtonStyleToClass(component.style),
|
|
147
|
-
resolvedButtonType === 'submit' ? 'submit-btn form-submit-type' : '',
|
|
148
|
-
resolvedButtonType === 'reset' ? 'form-reset-type' : '',
|
|
149
|
-
component.cssClass || 'e-primary',
|
|
150
|
-
component.size === 'Small' ? ' e-small' : component.size === 'Bigger' ? ' e-bigger' : ''
|
|
151
|
-
].filter(Boolean).join(' ') || 'e-primary';
|
|
152
|
-
const buttonContainerStyle = {
|
|
153
|
-
display: 'flex',
|
|
154
|
-
justifyContent: mapPositionToJustifyContent(component.position),
|
|
155
|
-
width: component.width || '100%',
|
|
156
|
-
};
|
|
157
|
-
return (_jsx("div", { id: `${component.id}-container`, style: buttonContainerStyle, children: _jsx(ButtonComponent, { id: component.id, type: resolvedButtonType, locale: locale, cssClass: buttonCssClassList, disabled: component.disabled, iconCss: component.iconCss, iconPosition: component.iconPosition, onClick: (event) => {
|
|
158
|
-
if (onClick) {
|
|
159
|
-
onClick(event);
|
|
160
|
-
}
|
|
161
|
-
}, ref: ref, children: component.label }, component.id) }, `form-${component.type}-${component.id}`));
|
|
162
|
-
case 'splitButton':
|
|
163
|
-
const splitButtonCssClassList = [
|
|
164
|
-
component.style === 'primary' ? 'e-primary' : '',
|
|
165
|
-
component.style === 'flat' ? '' : '',
|
|
166
|
-
component.style === 'information' ? 'e-info' : '',
|
|
167
|
-
component.style === 'error' ? 'e-danger' : '',
|
|
168
|
-
component.style === 'success' ? 'e-success' : '',
|
|
169
|
-
component.style === 'warning' ? 'e-warning' : '',
|
|
170
|
-
component.cssClass || ''
|
|
171
|
-
].filter(Boolean).join(' ') || undefined;
|
|
172
|
-
const splitButtonContainerStyle = {
|
|
173
|
-
display: 'flex',
|
|
174
|
-
justifyContent: mapPositionToJustifyContent(component.position)
|
|
175
|
-
};
|
|
176
|
-
return (_jsx("div", { id: `${component.id}-container`, "aria-label": 'Splitbutton', style: splitButtonContainerStyle, children: _jsx(SplitButtonComponent, { id: component.id, locale: locale, content: component.label || 'Split Button', items: component.options?.map((option, index) => ({
|
|
177
|
-
text: option,
|
|
178
|
-
id: `${component.id}_option_${index}`
|
|
179
|
-
})) || [{ text: 'Option 1', id: `${component.id}_option_0` }], cssClass: splitButtonCssClassList, disabled: component.disabled, iconCss: component.iconCss, iconPosition: component.iconPosition || 'Left', onClick: (event) => {
|
|
180
|
-
if (onClick) {
|
|
181
|
-
onClick({ ...event, buttonId: component.id, buttonLabel: component.label });
|
|
182
|
-
}
|
|
183
|
-
}, select: (event) => {
|
|
184
|
-
if (onClick) {
|
|
185
|
-
onClick({ ...event, selectedItem: event.item?.properties?.text, buttonId: component.id, buttonLabel: component.label });
|
|
186
|
-
}
|
|
187
|
-
}, ref: ref }, component.id) }, `form-${component.type}-${component.id}`));
|
|
188
|
-
case 'signature':
|
|
189
|
-
return (_jsx(SignatureComponent, { id: component.id, className: cssClass, locale: locale, backgroundColor: component.backgroundColor || '', strokeColor: component.strokeColor || '', maxStrokeWidth: component.maxValue, minStrokeWidth: component.minValue, velocity: component.velocity, disabled: component.disabled, change: (args) => onChange(args.value), ref: ref }, component.id));
|
|
190
|
-
case 'rating':
|
|
191
|
-
return (_jsx(RatingComponent, { id: component.id, name: component.id, locale: locale, value: value !== undefined ? value : (component.defaultValue || 0), disabled: component.disabled, cssClass: cssClass, allowReset: component.allowReset, itemsCount: component.itemsCount, min: component?.minValue, precision: component.precision, readOnly: component.readOnly, showTooltip: component.showRatingTooltip || false, showLabel: component.showRatingLabel, labelPosition: component.showRatingLabel ? component.ratingLabelPosition : undefined, valueChanged: (args) => onChange(args.value), ref: ref }, component.id));
|
|
192
|
-
case 'colorPicker':
|
|
193
|
-
return (_jsx(ColorPickerComponent, { id: component.id, locale: locale, value: value !== undefined ? value : (component.defaultValue || ''), disabled: component.disabled, enableOpacity: component.enableOpacity, showButtons: component.showButtons, showRecentColors: component.showRecentColors, noColor: component.showNoColor, cssClass: cssClass, change: (args) => onChange(args.value), ref: ref }, component.id));
|
|
194
|
-
case 'inputMask':
|
|
195
|
-
return (_jsx(MaskedTextBoxComponent, { id: component.id, name: component.id, ...commonProps, locale: locale, value: value !== undefined ? value : (component.defaultValue || ''), floatLabelType: component.floatLabelType || 'Never', placeholder: component.placeholder || '', enabled: !component.disabled, mask: component.mask || '000-000-0000', promptChar: component.promptChar || '_', customCharacters: component.customCharacters, readOnly: component.readOnly || false, showClearButton: component.showClearButton !== false, cssClass: cssClass, htmlAttributes: htmlAttrs, appendTemplate: component.suffix, prependTemplate: component.prefix, ...createValidationHandlers((args) => args.value || ''), ref: ref }, component.id));
|
|
196
|
-
case 'rangeSlider':
|
|
197
|
-
return (_jsx(SliderComponent, { id: component.id, locale: locale, value: value !== undefined ? value : (component.defaultValue ?? 0), min: component.minValue || 0, max: component.maxValue || 100, step: component.step || 1, disabled: component.disabled, cssClass: cssClass, enabled: !component.disabled, showButtons: component.showButtons, change: (args) => onChange(args.value), ref: ref }, component.id));
|
|
198
|
-
case 'fileUpload':
|
|
199
|
-
return (_jsx(UploaderComponent, { id: component.id, name: component.id, locale: locale, type: 'file', enabled: !component.disabled, allowedExtensions: component.allowExtensions, asyncSettings: { saveUrl: component.saveUrl, removeUrl: component.removeUrl }, buttons: component.buttons || {
|
|
200
|
-
"browse": "Choose File",
|
|
201
|
-
"clear": "Clear All",
|
|
202
|
-
"upload": "Upload All"
|
|
203
|
-
}, maxFileSize: component?.maxValue, minFileSize: component?.minValue, multiple: component.allowMultiple, showFileList: component.showFileList, htmlAttributes: htmlAttrs, cssClass: cssClass, change: (args) => onChange(args.filesData), ref: ref }, component.id));
|
|
204
|
-
case 'imageEditor':
|
|
205
|
-
return (_jsx(ImageEditorComponent, { id: component.id, locale: locale, disabled: component.disabled, cssClass: cssClass, height: (component.height || '350px').toString(), width: (component.width || '100%').toString(), ref: ref }, component.id));
|
|
206
|
-
case 'message':
|
|
207
|
-
return (_jsx(MessageComponent, { id: component.id, locale: locale, severity: component.severity || component.messageType || 'info', variant: component.variant, content: component.content || 'Message', showCloseIcon: component.showCloseIcon, showIcon: (component.showIcon === undefined ? false : component.showIcon) || false, disabled: component.disabled, cssClass: cssClass, ref: ref }, component.id));
|
|
208
|
-
case 'dataGrid':
|
|
209
|
-
const dg = component;
|
|
210
|
-
const conditionalData = resolveConditionalData(dg.conditions, formState?.values || {})?.dataSource;
|
|
211
|
-
const conditionalColumns = resolveConditionalData(dg.conditions, formState?.values || {})?.columns;
|
|
212
|
-
const fetchedDataSource = conditionalData ? useFetchOptions(conditionalData) : useFetchOptions(dg.dataSource);
|
|
213
|
-
const resolvedDataSource = conditionalData ? resolveOptions(conditionalData, fetchedDataSource) : resolveOptions(dg.dataSource, fetchedDataSource);
|
|
214
|
-
const finalDataSource = resolvedDataSource.length > 0 ? resolvedDataSource : (dg.dataSource ?? []);
|
|
215
|
-
const finalColumns = conditionalColumns && conditionalColumns.length > 0 ? conditionalColumns : (dg.columns ?? []);
|
|
216
|
-
return (_jsx("div", { id: dg.id, className: dg.cssClass, children: _jsx(DataGridComponent, { id: dg.id, type: 'dataGrid', locale: locale, label: dg.label || '', name: dg.name || '', columns: finalColumns, dataSource: value !== undefined ? value : finalDataSource, height: dg.height || '200px', width: dg.width || '100%', pageSize: dg.pageSize || 6, allowPaging: dg.allowPaging !== false, allowFiltering: dg.allowFiltering, allowAdding: dg.allowAdding !== false, allowEditing: dg.allowEditing !== false, allowDeleting: dg.allowDeleting !== false, onDataChange: (data) => onChange(data), cssClass: cssClass, ref: ref }) }, dg.id));
|
|
217
|
-
case 'richTextEditor':
|
|
218
|
-
const toolbarSettings = {
|
|
219
|
-
items: ['Undo', 'Redo', '|', 'Bold', 'Italic', 'Underline', 'StrikeThrough', 'InlineCode', '|', 'CreateLink', 'Blockquote', '|', 'BulletFormatList', 'NumberFormatList', '|', 'Formats', 'Alignments', '|', 'Outdent', 'Indent', '|',
|
|
220
|
-
'FontColor', 'BackgroundColor', 'FontName', 'FontSize', '|', 'LowerCase', 'UpperCase', '|', 'SourceCode']
|
|
221
|
-
};
|
|
222
|
-
return (_jsx(RichTextEditorComponent, { id: component.id, locale: locale, name: component.id, toolbarSettings: toolbarSettings, value: value !== undefined ? value : (component.defaultValue || ''), placeholder: component.placeholder || '', enabled: !component.disabled, readonly: component.readOnly || false, maxLength: component.maxLength || 1000, cssClass: cssClass || undefined, height: component.height || '300px', width: component.width || '100%', htmlAttributes: htmlAttrs, ref: ref, children: _jsx(RTEInject, { services: [Toolbar, Link, HtmlEditor, QuickToolbar] }) }, `${component.id}`));
|
|
223
|
-
default:
|
|
224
|
-
return (_jsxs("div", { className: "unsupported-component", children: ["Unsupported component type: ", component.type] }));
|
|
225
|
-
}
|
|
226
|
-
};
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Form Schema Type Definitions
|
|
3
|
-
* Copied from builder for standalone renderer
|
|
4
|
-
*/
|
|
5
|
-
import type { visualMode } from "@syncfusion/ej2-react-dropdowns";
|
|
6
|
-
export interface ButtonClickEventArgs {
|
|
7
|
-
buttonId: string;
|
|
8
|
-
buttonLabel: string;
|
|
9
|
-
event: React.MouseEvent<HTMLButtonElement>;
|
|
10
|
-
}
|
|
11
|
-
export type ConditionalOperator = 'equal' | 'notEqual' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'in' | 'notIn' | 'contains' | 'notContains';
|
|
12
|
-
export interface ConditionalRule {
|
|
13
|
-
field: string;
|
|
14
|
-
operator: ConditionalOperator;
|
|
15
|
-
value: any;
|
|
16
|
-
}
|
|
17
|
-
export interface CompositeConditionalRule {
|
|
18
|
-
condition: 'and' | 'or';
|
|
19
|
-
rules: (ConditionalRule | CompositeConditionalRule)[];
|
|
20
|
-
}
|
|
21
|
-
export type ConditionType = ConditionalRule | CompositeConditionalRule;
|
|
22
|
-
export interface ChoiceBasedFieldRule {
|
|
23
|
-
primaryFieldId: string;
|
|
24
|
-
choiceMapping: Record<string, string[]>;
|
|
25
|
-
showAllWhenNotMapped?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface FormComponentConditions {
|
|
28
|
-
visibleWhen?: ConditionType;
|
|
29
|
-
hideWhen?: ConditionType;
|
|
30
|
-
readOnlyWhen?: ConditionType;
|
|
31
|
-
disabledWhen?: ConditionType;
|
|
32
|
-
requiredWhen?: ConditionType;
|
|
33
|
-
setValueWhen?: {
|
|
34
|
-
condition: ConditionType;
|
|
35
|
-
value: any;
|
|
36
|
-
};
|
|
37
|
-
choiceBasedField?: ChoiceBasedFieldRule;
|
|
38
|
-
}
|
|
39
|
-
export interface FormSchema {
|
|
40
|
-
version: string;
|
|
41
|
-
components: FormComponent[];
|
|
42
|
-
}
|
|
43
|
-
export interface FormComponent {
|
|
44
|
-
id: string;
|
|
45
|
-
type: 'textbox' | 'textarea' | 'number' | 'email' | 'url' | 'phone' | 'password' | 'checkbox' | 'checkboxGroup' | 'radio' | 'dropdown' | 'multiselect' | 'button' | 'date' | 'dateTime' | 'time' | 'dateRange' | 'switch' | 'signature' | 'rating' | 'imageEditor' | 'fileUpload' | 'rangeSlider' | 'colorPicker' | 'inputMask' | 'message' | 'panel' | 'table' | 'tabs' | 'dataGrid' | 'card' | 'splitButton' | 'richTextEditor' | 'staticHtml';
|
|
46
|
-
textboxType?: string;
|
|
47
|
-
label: string;
|
|
48
|
-
name: string;
|
|
49
|
-
description?: string | undefined;
|
|
50
|
-
prefix?: string | undefined;
|
|
51
|
-
suffix?: string | undefined;
|
|
52
|
-
placeholder?: string;
|
|
53
|
-
defaultValue?: any;
|
|
54
|
-
disabled?: boolean;
|
|
55
|
-
visible?: boolean;
|
|
56
|
-
tooltip?: string;
|
|
57
|
-
hideBorders?: boolean;
|
|
58
|
-
hideLabel?: boolean;
|
|
59
|
-
cssClass?: string;
|
|
60
|
-
multiline?: boolean;
|
|
61
|
-
showClearButton?: boolean;
|
|
62
|
-
showCloseIcon?: boolean;
|
|
63
|
-
showIcon?: boolean;
|
|
64
|
-
variant?: string;
|
|
65
|
-
severity?: string;
|
|
66
|
-
content?: string;
|
|
67
|
-
showTodayButton?: boolean;
|
|
68
|
-
htmlAttributes?: Record<string, any>;
|
|
69
|
-
labelPosition?: 'Top' | 'Bottom' | 'Left' | 'Right';
|
|
70
|
-
position?: 'center' | 'left' | 'right';
|
|
71
|
-
fieldLabelPosition?: 'After' | 'Before';
|
|
72
|
-
labelWidth?: string;
|
|
73
|
-
floatLabelType?: 'Never' | 'Always' | 'Auto';
|
|
74
|
-
readOnly?: boolean;
|
|
75
|
-
autocomplete?: boolean;
|
|
76
|
-
cols?: number;
|
|
77
|
-
textareaRows?: number;
|
|
78
|
-
checked?: boolean;
|
|
79
|
-
indeterminate?: boolean;
|
|
80
|
-
offLabel?: string;
|
|
81
|
-
onLabel?: string;
|
|
82
|
-
buttonType?: 'button' | 'submit' | 'reset';
|
|
83
|
-
iconCss?: string;
|
|
84
|
-
iconPosition?: 'Left' | 'Right';
|
|
85
|
-
style?: string;
|
|
86
|
-
buttonsGroups?: ButtonDefinition[];
|
|
87
|
-
gap?: string;
|
|
88
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
89
|
-
decimals?: number;
|
|
90
|
-
currency?: string;
|
|
91
|
-
format?: string;
|
|
92
|
-
numberFormat?: string;
|
|
93
|
-
allowReset?: boolean;
|
|
94
|
-
itemsCount?: number;
|
|
95
|
-
precision?: number | string;
|
|
96
|
-
showRatingTooltip?: boolean;
|
|
97
|
-
showRatingLabel?: boolean;
|
|
98
|
-
ratingLabelPosition?: 'Top' | 'Bottom' | 'Left' | 'Right';
|
|
99
|
-
height?: number | null;
|
|
100
|
-
width?: number | null;
|
|
101
|
-
backgroundColor?: string;
|
|
102
|
-
strokeColor?: string;
|
|
103
|
-
maximumStrokeWidth?: number;
|
|
104
|
-
minimumStrokeWidth?: number;
|
|
105
|
-
velocity?: number;
|
|
106
|
-
enableOpacity?: boolean;
|
|
107
|
-
showNoColor?: boolean;
|
|
108
|
-
showButtons?: boolean;
|
|
109
|
-
showRecentColors?: boolean;
|
|
110
|
-
orientation?: 'Horizontal' | 'Vertical';
|
|
111
|
-
allowExtensions?: string;
|
|
112
|
-
saveUrl?: string;
|
|
113
|
-
removeUrl?: string;
|
|
114
|
-
buttons?: {};
|
|
115
|
-
allowMultiple?: boolean;
|
|
116
|
-
showFileList?: boolean;
|
|
117
|
-
calendarMode?: string;
|
|
118
|
-
dayHeaderFormat?: string;
|
|
119
|
-
depth?: string;
|
|
120
|
-
firstDayOfWeek?: number;
|
|
121
|
-
start?: string;
|
|
122
|
-
allowEdit?: boolean;
|
|
123
|
-
enabled?: boolean;
|
|
124
|
-
timeFormat?: string;
|
|
125
|
-
step?: number;
|
|
126
|
-
startDate?: string;
|
|
127
|
-
endDate?: string;
|
|
128
|
-
separator?: string;
|
|
129
|
-
mask?: string;
|
|
130
|
-
customCharacters?: Record<string, string>;
|
|
131
|
-
promptChar?: string;
|
|
132
|
-
allowCustomValue?: boolean;
|
|
133
|
-
addTagOnBlur?: boolean;
|
|
134
|
-
delimiterChar?: string;
|
|
135
|
-
visualMode?: visualMode;
|
|
136
|
-
showSelectAll?: boolean;
|
|
137
|
-
selectAllText?: string;
|
|
138
|
-
unSelectAllText?: string;
|
|
139
|
-
showDropDownIcon?: boolean;
|
|
140
|
-
validateOn?: 'Change' | 'Blur';
|
|
141
|
-
pageSize?: number;
|
|
142
|
-
size?: string;
|
|
143
|
-
allowPaging?: boolean;
|
|
144
|
-
allowAdding?: boolean;
|
|
145
|
-
allowEditing?: boolean;
|
|
146
|
-
allowDeleting?: boolean;
|
|
147
|
-
required?: boolean;
|
|
148
|
-
minLength?: number | null;
|
|
149
|
-
maxLength?: number | null;
|
|
150
|
-
min?: number | null;
|
|
151
|
-
minimum?: number | null;
|
|
152
|
-
max?: number | null;
|
|
153
|
-
minDate?: string;
|
|
154
|
-
maxDate?: string;
|
|
155
|
-
minValue?: number | null;
|
|
156
|
-
maxValue?: number | null;
|
|
157
|
-
minTime?: string;
|
|
158
|
-
maxTime?: string;
|
|
159
|
-
regex?: string;
|
|
160
|
-
validationMessage?: string;
|
|
161
|
-
options?: string[];
|
|
162
|
-
checkboxLabelPosition?: 'Before' | 'After';
|
|
163
|
-
layoutDirection?: 'row' | 'column';
|
|
164
|
-
enableHtmlSanitizer?: boolean;
|
|
165
|
-
fields?: Record<string, any>;
|
|
166
|
-
enableVirtualization?: boolean;
|
|
167
|
-
popupHeight?: string;
|
|
168
|
-
popupWidth?: string;
|
|
169
|
-
children?: FormComponent[];
|
|
170
|
-
rows?: number;
|
|
171
|
-
columns?: number;
|
|
172
|
-
messageType?: 'info' | 'success' | 'warning' | 'error';
|
|
173
|
-
messageContent?: string;
|
|
174
|
-
legend?: string;
|
|
175
|
-
cardTitle?: string;
|
|
176
|
-
cardSubtitle?: string;
|
|
177
|
-
columnWidths?: {
|
|
178
|
-
columns: number;
|
|
179
|
-
widths: number[];
|
|
180
|
-
};
|
|
181
|
-
tabItems?: Array<{
|
|
182
|
-
header: string;
|
|
183
|
-
content?: FormComponent[];
|
|
184
|
-
}>;
|
|
185
|
-
tableCells?: FormComponent[][][];
|
|
186
|
-
parentPath?: string;
|
|
187
|
-
properties?: Record<string, any>;
|
|
188
|
-
expressionValue?: string;
|
|
189
|
-
conditions?: FormComponentConditions;
|
|
190
|
-
_configured?: boolean;
|
|
191
|
-
}
|
|
192
|
-
export interface ValidationRules {
|
|
193
|
-
[fieldName: string]: {
|
|
194
|
-
required?: [boolean, string];
|
|
195
|
-
minLength?: [number, string];
|
|
196
|
-
maxLength?: [number, string];
|
|
197
|
-
min?: [number, string];
|
|
198
|
-
max?: [number, string];
|
|
199
|
-
regex?: [string, string];
|
|
200
|
-
date?: [string, string];
|
|
201
|
-
[key: string]: any;
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
export interface ButtonDefinition {
|
|
205
|
-
label: string;
|
|
206
|
-
type?: 'submit' | 'reset' | 'button';
|
|
207
|
-
style?: 'primary' | 'flat' | 'information' | 'error' | 'success' | 'warning';
|
|
208
|
-
iconCss?: string;
|
|
209
|
-
iconPosition?: 'Left' | 'Right';
|
|
210
|
-
disabled?: boolean;
|
|
211
|
-
}
|
package/src/types/FormSchema.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|