@syncfusion/ej2-form-renderer 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 +60 -0
- package/common.d.ts +4 -0
- package/common.js +4 -0
- package/dist/ej2-form-renderer.umd.min.js +11 -0
- package/dist/ej2-form-renderer.umd.min.js.map +1 -0
- package/dist/es6/ej2-form-renderer.es2015.js +6787 -0
- package/dist/es6/ej2-form-renderer.es2015.js.map +1 -0
- package/dist/es6/ej2-form-renderer.es5.js +7055 -0
- package/dist/es6/ej2-form-renderer.es5.js.map +1 -0
- package/dist/global/ej2-form-renderer.min.js +11 -0
- package/dist/global/ej2-form-renderer.min.js.map +1 -0
- package/dist/global/index.d.ts +14 -0
- package/form-renderer.d.ts +4 -0
- package/form-renderer.js +4 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/package.json +41 -0
- package/src/common/checkbox-group.d.ts +55 -0
- package/src/common/checkbox-group.js +241 -0
- package/src/common/conditional-rule-engine.d.ts +241 -0
- package/src/common/conditional-rule-engine.js +505 -0
- package/src/common/custom-validation-engine.d.ts +57 -0
- package/src/common/custom-validation-engine.js +152 -0
- package/src/common/datagrid-component.d.ts +156 -0
- package/src/common/datagrid-component.js +410 -0
- package/src/common/expressions/dependency-tracker.d.ts +29 -0
- package/src/common/expressions/dependency-tracker.js +137 -0
- package/src/common/expressions/expression-engine.d.ts +94 -0
- package/src/common/expressions/expression-engine.js +514 -0
- package/src/common/expressions/expression-parser.d.ts +40 -0
- package/src/common/expressions/expression-parser.js +270 -0
- package/src/common/expressions/grid-expressions.d.ts +24 -0
- package/src/common/expressions/grid-expressions.js +92 -0
- package/src/common/expressions/index.d.ts +4 -0
- package/src/common/expressions/index.js +4 -0
- package/src/common/index.d.ts +10 -0
- package/src/common/index.js +10 -0
- package/src/common/json-converter.d.ts +945 -0
- package/src/common/json-converter.js +1110 -0
- package/src/common/minmax-rule-engine.d.ts +105 -0
- package/src/common/minmax-rule-engine.js +380 -0
- package/src/common/option-fetcher.d.ts +30 -0
- package/src/common/option-fetcher.js +139 -0
- package/src/common/parser.d.ts +98 -0
- package/src/common/parser.js +788 -0
- package/src/common/static-html-renderer.d.ts +45 -0
- package/src/common/static-html-renderer.js +77 -0
- package/src/common/utils.d.ts +116 -0
- package/src/common/utils.js +484 -0
- package/src/form-renderer/form-renderer-model.d.ts +65 -0
- package/src/form-renderer/form-renderer.d.ts +425 -0
- package/src/form-renderer/form-renderer.js +2277 -0
- package/src/form-renderer/index.d.ts +6 -0
- package/src/form-renderer/index.js +5 -0
- package/src/form-renderer/render-form-field.d.ts +31 -0
- package/src/form-renderer/render-form-field.js +816 -0
- package/src/form-renderer/types/form-schema.d.ts +452 -0
- package/src/form-renderer/types/form-schema.js +32 -0
- package/src/global.js +1 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +4 -0
- package/styles/bds-lite.css +599 -0
- package/styles/bds-lite.scss +2 -0
- package/styles/bds.css +599 -0
- package/styles/bds.scss +2 -0
- package/styles/bootstrap-dark-lite.css +608 -0
- package/styles/bootstrap-dark-lite.scss +2 -0
- package/styles/bootstrap-dark.css +608 -0
- package/styles/bootstrap-dark.scss +2 -0
- package/styles/bootstrap-lite.css +595 -0
- package/styles/bootstrap-lite.scss +2 -0
- package/styles/bootstrap.css +595 -0
- package/styles/bootstrap.scss +2 -0
- package/styles/bootstrap4-lite.css +595 -0
- package/styles/bootstrap4-lite.scss +2 -0
- package/styles/bootstrap4.css +595 -0
- package/styles/bootstrap4.scss +2 -0
- package/styles/bootstrap5-dark-lite.css +595 -0
- package/styles/bootstrap5-dark-lite.scss +2 -0
- package/styles/bootstrap5-dark.css +595 -0
- package/styles/bootstrap5-dark.scss +2 -0
- package/styles/bootstrap5-lite.css +595 -0
- package/styles/bootstrap5-lite.scss +2 -0
- package/styles/bootstrap5.3-lite.css +679 -0
- package/styles/bootstrap5.3-lite.scss +2 -0
- package/styles/bootstrap5.3.css +679 -0
- package/styles/bootstrap5.3.scss +2 -0
- package/styles/bootstrap5.css +595 -0
- package/styles/bootstrap5.scss +2 -0
- package/styles/fabric-dark-lite.css +608 -0
- package/styles/fabric-dark-lite.scss +2 -0
- package/styles/fabric-dark.css +608 -0
- package/styles/fabric-dark.scss +2 -0
- package/styles/fabric-lite.css +595 -0
- package/styles/fabric-lite.scss +2 -0
- package/styles/fabric.css +595 -0
- package/styles/fabric.scss +2 -0
- package/styles/fluent-dark-lite.css +595 -0
- package/styles/fluent-dark-lite.scss +2 -0
- package/styles/fluent-dark.css +595 -0
- package/styles/fluent-dark.scss +2 -0
- package/styles/fluent-lite.css +595 -0
- package/styles/fluent-lite.scss +2 -0
- package/styles/fluent.css +595 -0
- package/styles/fluent.scss +2 -0
- package/styles/fluent2-lite.css +681 -0
- package/styles/fluent2-lite.scss +2 -0
- package/styles/fluent2.css +681 -0
- package/styles/fluent2.scss +2 -0
- package/styles/form-renderer/_all.scss +2 -0
- package/styles/form-renderer/_bds-definition.scss +8 -0
- package/styles/form-renderer/_bootstrap-dark-definition.scss +8 -0
- package/styles/form-renderer/_bootstrap-definition.scss +8 -0
- package/styles/form-renderer/_bootstrap4-definition.scss +8 -0
- package/styles/form-renderer/_bootstrap5-dark-definition.scss +8 -0
- package/styles/form-renderer/_bootstrap5-definition.scss +8 -0
- package/styles/form-renderer/_bootstrap5.3-definition.scss +8 -0
- package/styles/form-renderer/_fabric-dark-definition.scss +8 -0
- package/styles/form-renderer/_fabric-definition.scss +8 -0
- package/styles/form-renderer/_fluent-dark-definition.scss +8 -0
- package/styles/form-renderer/_fluent-definition.scss +8 -0
- package/styles/form-renderer/_fluent2-definition.scss +8 -0
- package/styles/form-renderer/_highcontrast-definition.scss +8 -0
- package/styles/form-renderer/_highcontrast-light-definition.scss +8 -0
- package/styles/form-renderer/_layout.scss +480 -0
- package/styles/form-renderer/_material-dark-definition.scss +8 -0
- package/styles/form-renderer/_material-definition.scss +8 -0
- package/styles/form-renderer/_material3-dark-definition.scss +8 -0
- package/styles/form-renderer/_material3-definition.scss +8 -0
- package/styles/form-renderer/_mixin.scss +26 -0
- package/styles/form-renderer/_tailwind-dark-definition.scss +8 -0
- package/styles/form-renderer/_tailwind-definition.scss +8 -0
- package/styles/form-renderer/_tailwind3-definition.scss +8 -0
- package/styles/form-renderer/_theme.scss +69 -0
- package/styles/form-renderer/_variables.scss +2 -0
- package/styles/form-renderer/bds.css +599 -0
- package/styles/form-renderer/bds.scss +2 -0
- package/styles/form-renderer/bootstrap-dark.css +608 -0
- package/styles/form-renderer/bootstrap-dark.scss +2 -0
- package/styles/form-renderer/bootstrap.css +595 -0
- package/styles/form-renderer/bootstrap.scss +2 -0
- package/styles/form-renderer/bootstrap4.css +595 -0
- package/styles/form-renderer/bootstrap4.scss +2 -0
- package/styles/form-renderer/bootstrap5-dark.css +595 -0
- package/styles/form-renderer/bootstrap5-dark.scss +2 -0
- package/styles/form-renderer/bootstrap5.3.css +679 -0
- package/styles/form-renderer/bootstrap5.3.scss +2 -0
- package/styles/form-renderer/bootstrap5.css +595 -0
- package/styles/form-renderer/bootstrap5.scss +2 -0
- package/styles/form-renderer/fabric-dark.css +608 -0
- package/styles/form-renderer/fabric-dark.scss +2 -0
- package/styles/form-renderer/fabric.css +595 -0
- package/styles/form-renderer/fabric.scss +2 -0
- package/styles/form-renderer/fluent-dark.css +595 -0
- package/styles/form-renderer/fluent-dark.scss +2 -0
- package/styles/form-renderer/fluent.css +595 -0
- package/styles/form-renderer/fluent.scss +2 -0
- package/styles/form-renderer/fluent2.css +681 -0
- package/styles/form-renderer/fluent2.scss +2 -0
- package/styles/form-renderer/highcontrast-light.css +595 -0
- package/styles/form-renderer/highcontrast-light.scss +2 -0
- package/styles/form-renderer/highcontrast.css +608 -0
- package/styles/form-renderer/highcontrast.scss +2 -0
- package/styles/form-renderer/material-dark.css +608 -0
- package/styles/form-renderer/material-dark.scss +2 -0
- package/styles/form-renderer/material.css +595 -0
- package/styles/form-renderer/material.scss +2 -0
- package/styles/form-renderer/material3-dark.css +677 -0
- package/styles/form-renderer/material3-dark.scss +2 -0
- package/styles/form-renderer/material3.css +679 -0
- package/styles/form-renderer/material3.scss +2 -0
- package/styles/form-renderer/tailwind-dark.css +595 -0
- package/styles/form-renderer/tailwind-dark.scss +2 -0
- package/styles/form-renderer/tailwind.css +595 -0
- package/styles/form-renderer/tailwind.scss +2 -0
- package/styles/form-renderer/tailwind3.css +669 -0
- package/styles/form-renderer/tailwind3.scss +2 -0
- package/styles/highcontrast-light-lite.css +595 -0
- package/styles/highcontrast-light-lite.scss +2 -0
- package/styles/highcontrast-light.css +595 -0
- package/styles/highcontrast-light.scss +2 -0
- package/styles/highcontrast-lite.css +608 -0
- package/styles/highcontrast-lite.scss +2 -0
- package/styles/highcontrast.css +608 -0
- package/styles/highcontrast.scss +2 -0
- package/styles/material-dark-lite.css +608 -0
- package/styles/material-dark-lite.scss +2 -0
- package/styles/material-dark.css +608 -0
- package/styles/material-dark.scss +2 -0
- package/styles/material-lite.css +595 -0
- package/styles/material-lite.scss +2 -0
- package/styles/material.css +595 -0
- package/styles/material.scss +2 -0
- package/styles/material3-dark-lite.css +677 -0
- package/styles/material3-dark-lite.scss +2 -0
- package/styles/material3-dark.css +677 -0
- package/styles/material3-dark.scss +2 -0
- package/styles/material3-lite.css +679 -0
- package/styles/material3-lite.scss +2 -0
- package/styles/material3.css +679 -0
- package/styles/material3.scss +2 -0
- package/styles/tailwind-dark-lite.css +595 -0
- package/styles/tailwind-dark-lite.scss +2 -0
- package/styles/tailwind-dark.css +595 -0
- package/styles/tailwind-dark.scss +2 -0
- package/styles/tailwind-lite.css +595 -0
- package/styles/tailwind-lite.scss +2 -0
- package/styles/tailwind.css +595 -0
- package/styles/tailwind.scss +2 -0
- package/styles/tailwind3-lite.css +669 -0
- package/styles/tailwind3-lite.scss +2 -0
- package/styles/tailwind3.css +669 -0
- package/styles/tailwind3.scss +2 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import { ClickEventArgs } from '@syncfusion/ej2-buttons';
|
|
2
|
+
import { MinMaxRangeItem } from '../../common/minmax-rule-engine';
|
|
3
|
+
import { LayoutNode, FieldProperties } from '../../common/json-converter';
|
|
4
|
+
import { GridColumn } from '@syncfusion/ej2-grids';
|
|
5
|
+
import { FieldDataType } from '../form-renderer';
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export interface RuleModel {
|
|
10
|
+
condition?: 'And' | 'Or' | 'and' | 'or';
|
|
11
|
+
rules?: RuleModel[] | QueryRule[];
|
|
12
|
+
field?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
operator?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
value?: string | number | boolean | Date | (string | number | boolean | Date)[];
|
|
17
|
+
isGroup?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
export interface QueryRule {
|
|
23
|
+
field: string;
|
|
24
|
+
operator: string;
|
|
25
|
+
value: string | number | boolean | Date | (string | number | boolean | Date)[];
|
|
26
|
+
label?: string;
|
|
27
|
+
type?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Provides the visual modes of the dropdown component.
|
|
31
|
+
*/
|
|
32
|
+
export declare type visualMode = 'Default' | 'Delimiters' | 'Box' | 'CheckBox';
|
|
33
|
+
/**
|
|
34
|
+
* Represents the JSON schema format used for data exchange and storage.
|
|
35
|
+
* Contains a flat key-value map of properties, a layout tree, and optional global settings.
|
|
36
|
+
*/
|
|
37
|
+
export interface Schema {
|
|
38
|
+
/** Specifies the version of the schema (e.g., '0.1.0') */
|
|
39
|
+
version: string;
|
|
40
|
+
/** Specifies the key-value map of all field definitions in the form */
|
|
41
|
+
properties: Record<string, FieldProperties>;
|
|
42
|
+
/** Specifies the hierarchical layout nodes mapping properties to UI positions */
|
|
43
|
+
layout: LayoutNode[];
|
|
44
|
+
/** Specifies the optional global form settings (form name, size, floatLabelType, etc.) */
|
|
45
|
+
settings?: FormSettings;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
export interface HeaderPair {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
export interface SearchConfig {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
fields: string[];
|
|
60
|
+
key?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
export interface SortConfig {
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
field: string;
|
|
68
|
+
direction: 'ascending' | 'descending';
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
export interface FilterConfig {
|
|
74
|
+
field: string;
|
|
75
|
+
operator: string;
|
|
76
|
+
value: any;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
export interface DataSourceCollectorProps {
|
|
82
|
+
value: string[] | {
|
|
83
|
+
type: 'url' | 'raw' | 'options';
|
|
84
|
+
url?: string;
|
|
85
|
+
headers?: HeaderPair[];
|
|
86
|
+
data?: string[];
|
|
87
|
+
search?: SearchConfig;
|
|
88
|
+
sort?: SortConfig;
|
|
89
|
+
filters?: FilterConfig[];
|
|
90
|
+
adaptorType?: string;
|
|
91
|
+
take?: number;
|
|
92
|
+
skip?: number;
|
|
93
|
+
dataPath?: string;
|
|
94
|
+
formName?: any;
|
|
95
|
+
};
|
|
96
|
+
onChange: (data: string[] | any) => void;
|
|
97
|
+
type?: string;
|
|
98
|
+
datakey?: string;
|
|
99
|
+
isAccordion?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @private
|
|
103
|
+
*/
|
|
104
|
+
export interface ConditionalDataRule {
|
|
105
|
+
condition: ConditionType;
|
|
106
|
+
dataSource: DataSourceCollectorProps['value'];
|
|
107
|
+
columns?: GridColumn[];
|
|
108
|
+
includeColumns?: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Defines the operators that can be used to define a condition.
|
|
112
|
+
*/
|
|
113
|
+
export declare type ConditionalOperator = 'equal' | 'notEqual' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'in' | 'notIn' | 'contains' | 'notContains' | 'isempty' | 'isnotempty';
|
|
114
|
+
/**
|
|
115
|
+
* Specifies the rule for the condition by defining the operator, value and labels.
|
|
116
|
+
*/
|
|
117
|
+
export interface ConditionalRule {
|
|
118
|
+
label?: string;
|
|
119
|
+
field: string;
|
|
120
|
+
operator: ConditionalOperator;
|
|
121
|
+
type?: string;
|
|
122
|
+
value: object | string | number | boolean | null;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* This class is used to define the condition and rules.
|
|
126
|
+
*/
|
|
127
|
+
export interface CompositeConditionalRule {
|
|
128
|
+
condition: 'and' | 'or';
|
|
129
|
+
rules: (ConditionalRule | CompositeConditionalRule)[];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Defines the types for the conditions such as rules and composite condtional rule.
|
|
133
|
+
*/
|
|
134
|
+
export declare type ConditionType = ConditionalRule | CompositeConditionalRule;
|
|
135
|
+
/**
|
|
136
|
+
* @private
|
|
137
|
+
*/
|
|
138
|
+
export interface LookupConfig {
|
|
139
|
+
formName: string;
|
|
140
|
+
field: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @private
|
|
144
|
+
*/
|
|
145
|
+
export interface ChoiceBasedFieldRule {
|
|
146
|
+
primaryFieldId: string;
|
|
147
|
+
choiceMapping: Record<string, string[]>;
|
|
148
|
+
showAllWhenNotMapped?: boolean;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
153
|
+
export interface CustomValidationRule {
|
|
154
|
+
condition?: RuleModel;
|
|
155
|
+
expression: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Specifies the rules configurations for the condtions.
|
|
159
|
+
*/
|
|
160
|
+
export interface ConditionRule {
|
|
161
|
+
/**
|
|
162
|
+
* When this is set, the form field can be visible based on a condition.
|
|
163
|
+
*/
|
|
164
|
+
visibleWhen?: ConditionType;
|
|
165
|
+
/**
|
|
166
|
+
* When this is set, the form field can be made hidden based on a condition.
|
|
167
|
+
*/
|
|
168
|
+
hideWhen?: ConditionType;
|
|
169
|
+
/**
|
|
170
|
+
* When this is set, the form field can be read only based on a condition.
|
|
171
|
+
*/
|
|
172
|
+
readOnlyWhen?: ConditionType;
|
|
173
|
+
/**
|
|
174
|
+
* When this is set, the form field can be disabled based on a condition.
|
|
175
|
+
*/
|
|
176
|
+
disabledWhen?: ConditionType;
|
|
177
|
+
/**
|
|
178
|
+
* When this is set, the form field can be required based on a condition.
|
|
179
|
+
*/
|
|
180
|
+
requiredWhen?: ConditionType;
|
|
181
|
+
/**
|
|
182
|
+
* When this is set, the form field's value can be set based on a condition.
|
|
183
|
+
*/
|
|
184
|
+
setValueWhen?: {
|
|
185
|
+
condition: ConditionType;
|
|
186
|
+
value: unknown;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* This property is used to handle the dependent dropdowns.
|
|
190
|
+
*/
|
|
191
|
+
choiceBasedField?: ChoiceBasedFieldRule;
|
|
192
|
+
/**
|
|
193
|
+
* This property is used to handle data source of Grid based on a condition.
|
|
194
|
+
*/
|
|
195
|
+
conditionalData?: ConditionalDataRule[];
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* @private
|
|
199
|
+
*/
|
|
200
|
+
export interface FormSchema {
|
|
201
|
+
version: string;
|
|
202
|
+
components: FormNode[];
|
|
203
|
+
settings?: {
|
|
204
|
+
[key: string]: any;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* These enum values define the layouts available to render forms.
|
|
209
|
+
*/
|
|
210
|
+
export declare enum FormLayout {
|
|
211
|
+
/**
|
|
212
|
+
* SingleColumn - Represents the single column layout and renders forms in a vertical layout.
|
|
213
|
+
*/
|
|
214
|
+
SingleColumn = "SingleColumn",
|
|
215
|
+
/**
|
|
216
|
+
* TwoColumn - Represents the two column layout and renders forms in a two column grid layout.
|
|
217
|
+
*/
|
|
218
|
+
TwoColumn = "TwoColumn",
|
|
219
|
+
/**
|
|
220
|
+
* ThreeColumn - Represents the three column layout which renders forms in a three column grid layout.
|
|
221
|
+
*/
|
|
222
|
+
ThreeColumn = "ThreeColumn",
|
|
223
|
+
/**
|
|
224
|
+
* FourColumn - Represents the four column layout which renders forms in a four column grid layout.
|
|
225
|
+
*/
|
|
226
|
+
FourColumn = "FourColumn"
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Specifies the component types supported in the Form Renderer.
|
|
230
|
+
*/
|
|
231
|
+
export declare const FORM_COMPONENT_TYPES: ReadonlyArray<'textbox' | 'textarea' | 'number' | 'checkbox' | 'checkboxGroup' | 'radio' | 'dropdown' | 'multiselect' | 'button' | 'date' | 'dateTime' | 'time' | 'dateRange' | 'switch' | 'signature' | 'rating' | 'imageEditor' | 'fileUpload' | 'rangeSlider' | 'colorPicker' | 'inputMask' | 'message' | 'panel' | 'table' | 'tabs' | 'dataGrid' | 'staticHtml' | 'card' | 'splitButton' | 'richTextEditor'>;
|
|
232
|
+
/**
|
|
233
|
+
* @private
|
|
234
|
+
*/
|
|
235
|
+
export declare type FormComponentType = 'textbox' | 'textarea' | 'number' | 'checkbox' | 'checkboxGroup' | 'radio' | 'dropdown' | 'multiselect' | 'button' | 'date' | 'dateTime' | 'time' | 'dateRange' | 'switch' | 'signature' | 'rating' | 'imageEditor' | 'fileUpload' | 'rangeSlider' | 'colorPicker' | 'inputMask' | 'message' | 'panel' | 'table' | 'tabs' | 'dataGrid' | 'staticHtml' | 'card' | 'splitButton' | 'richTextEditor';
|
|
236
|
+
/**
|
|
237
|
+
* @private
|
|
238
|
+
*/
|
|
239
|
+
export interface FormNode {
|
|
240
|
+
id: string;
|
|
241
|
+
type: FormComponentType;
|
|
242
|
+
textboxType?: 'text' | 'password' | 'email' | 'number' | 'url';
|
|
243
|
+
label: string;
|
|
244
|
+
name: string;
|
|
245
|
+
description?: string | undefined;
|
|
246
|
+
prefix?: string | undefined;
|
|
247
|
+
suffix?: string | undefined;
|
|
248
|
+
placeholder?: string;
|
|
249
|
+
defaultValue?: FieldDataType;
|
|
250
|
+
disabled?: boolean;
|
|
251
|
+
visible?: boolean;
|
|
252
|
+
tooltip?: string;
|
|
253
|
+
hideBorders?: boolean;
|
|
254
|
+
hideLabel?: boolean;
|
|
255
|
+
cssClass?: string;
|
|
256
|
+
multiline?: boolean;
|
|
257
|
+
showClearButton?: boolean;
|
|
258
|
+
showCloseIcon?: boolean;
|
|
259
|
+
showIcon?: boolean;
|
|
260
|
+
variant?: 'standard' | 'filled' | 'outlined';
|
|
261
|
+
severity?: 'information' | 'success' | 'warning' | 'error';
|
|
262
|
+
content?: string;
|
|
263
|
+
showTodayButton?: boolean;
|
|
264
|
+
htmlAttributes?: Record<string, any>;
|
|
265
|
+
labelPosition?: 'Top' | 'Bottom' | 'Left' | 'Right';
|
|
266
|
+
position?: 'center' | 'left' | 'right';
|
|
267
|
+
fieldLabelPosition?: 'After' | 'Before';
|
|
268
|
+
labelWidth?: string;
|
|
269
|
+
floatLabelType?: 'Never' | 'Always' | 'Auto';
|
|
270
|
+
readOnly?: boolean;
|
|
271
|
+
autocomplete?: boolean;
|
|
272
|
+
cols?: number;
|
|
273
|
+
textareaRows?: number;
|
|
274
|
+
checked?: boolean;
|
|
275
|
+
indeterminate?: boolean;
|
|
276
|
+
offLabel?: string;
|
|
277
|
+
onLabel?: string;
|
|
278
|
+
buttonType?: 'button' | 'submit' | 'reset';
|
|
279
|
+
iconCss?: string;
|
|
280
|
+
iconPosition?: 'Left' | 'Right';
|
|
281
|
+
style?: 'primary' | 'flat' | 'information' | 'error' | 'success' | 'warning';
|
|
282
|
+
buttonsGroups?: ButtonDefinition[];
|
|
283
|
+
gap?: string;
|
|
284
|
+
onClick?: (event: ClickEventArgs) => void;
|
|
285
|
+
decimals?: number;
|
|
286
|
+
currency?: string;
|
|
287
|
+
format?: string;
|
|
288
|
+
numberFormat?: string;
|
|
289
|
+
allowReset?: boolean;
|
|
290
|
+
itemsCount?: number;
|
|
291
|
+
precision?: number | string;
|
|
292
|
+
showRatingTooltip?: boolean;
|
|
293
|
+
showRatingLabel?: boolean;
|
|
294
|
+
ratingLabelPosition?: 'Top' | 'Bottom' | 'Left' | 'Right';
|
|
295
|
+
height?: number | null;
|
|
296
|
+
width?: number | null;
|
|
297
|
+
backgroundColor?: string;
|
|
298
|
+
strokeColor?: string;
|
|
299
|
+
maximumStrokeWidth?: number;
|
|
300
|
+
minimumStrokeWidth?: number;
|
|
301
|
+
velocity?: number;
|
|
302
|
+
enableOpacity?: boolean;
|
|
303
|
+
showNoColor?: boolean;
|
|
304
|
+
showButtons?: boolean;
|
|
305
|
+
showRecentColors?: boolean;
|
|
306
|
+
orientation?: 'Horizontal' | 'Vertical';
|
|
307
|
+
allowExtensions?: string;
|
|
308
|
+
saveUrl?: string;
|
|
309
|
+
removeUrl?: string;
|
|
310
|
+
buttons?: object;
|
|
311
|
+
dataSource?: [];
|
|
312
|
+
minMaxRange?: MinMaxRangeItem[];
|
|
313
|
+
minMaxTimeRange?: MinMaxRangeItem[];
|
|
314
|
+
allowMultiple?: boolean;
|
|
315
|
+
showFileList?: boolean;
|
|
316
|
+
calendarMode?: 'gregorian' | 'islamic';
|
|
317
|
+
dayHeaderFormat?: 'short' | 'narrow' | 'abbreviated' | 'wide';
|
|
318
|
+
depth?: 'month' | 'year' | 'decade';
|
|
319
|
+
firstDayOfWeek?: number;
|
|
320
|
+
start?: 'month' | 'year' | 'decade';
|
|
321
|
+
allowEdit?: boolean;
|
|
322
|
+
enabled?: boolean;
|
|
323
|
+
timeFormat?: string;
|
|
324
|
+
step?: number;
|
|
325
|
+
startDate?: string;
|
|
326
|
+
endDate?: string;
|
|
327
|
+
separator?: string;
|
|
328
|
+
mask?: string;
|
|
329
|
+
customCharacters?: Record<string, string>;
|
|
330
|
+
promptChar?: string;
|
|
331
|
+
allowCustomValue?: boolean;
|
|
332
|
+
addTagOnBlur?: boolean;
|
|
333
|
+
delimiterChar?: string;
|
|
334
|
+
visualMode?: visualMode;
|
|
335
|
+
showSelectAll?: boolean;
|
|
336
|
+
selectAllText?: string;
|
|
337
|
+
unSelectAllText?: string;
|
|
338
|
+
showDropDownIcon?: boolean;
|
|
339
|
+
validateOn?: 'Change' | 'Blur';
|
|
340
|
+
pageSize?: number;
|
|
341
|
+
size?: string;
|
|
342
|
+
allowPaging?: boolean;
|
|
343
|
+
allowAdding?: boolean;
|
|
344
|
+
allowEditing?: boolean;
|
|
345
|
+
allowDeleting?: boolean;
|
|
346
|
+
required?: boolean;
|
|
347
|
+
minLength?: number | null;
|
|
348
|
+
maxLength?: number | null;
|
|
349
|
+
min?: number | null;
|
|
350
|
+
minimum?: number | null;
|
|
351
|
+
max?: number | null;
|
|
352
|
+
minDate?: string;
|
|
353
|
+
maxDate?: string;
|
|
354
|
+
minValue?: number | null;
|
|
355
|
+
maxValue?: number | null;
|
|
356
|
+
minTime?: string;
|
|
357
|
+
maxTime?: string;
|
|
358
|
+
regex?: string;
|
|
359
|
+
validationMessage?: string;
|
|
360
|
+
options?: string[];
|
|
361
|
+
checkboxLabelPosition?: 'Before' | 'After';
|
|
362
|
+
layoutDirection?: 'row' | 'column';
|
|
363
|
+
enableHtmlSanitizer?: boolean;
|
|
364
|
+
fields?: Record<string, any>;
|
|
365
|
+
enableVirtualization?: boolean;
|
|
366
|
+
popupHeight?: string;
|
|
367
|
+
popupWidth?: string;
|
|
368
|
+
children?: FormNode[];
|
|
369
|
+
rows?: number;
|
|
370
|
+
columns?: number;
|
|
371
|
+
messageType?: 'info' | 'success' | 'warning' | 'error';
|
|
372
|
+
messageContent?: string;
|
|
373
|
+
legend?: string;
|
|
374
|
+
cardTitle?: string;
|
|
375
|
+
cardSubtitle?: string;
|
|
376
|
+
columnWidths?: {
|
|
377
|
+
columns: number;
|
|
378
|
+
widths: number[];
|
|
379
|
+
};
|
|
380
|
+
tabItems?: Array<{
|
|
381
|
+
header: string;
|
|
382
|
+
content?: FormNode[];
|
|
383
|
+
}>;
|
|
384
|
+
tableCells?: FormNode[][][];
|
|
385
|
+
tabOptions?: string[];
|
|
386
|
+
lookUpConfig?: LookupConfig;
|
|
387
|
+
enableImportFromWord?: {
|
|
388
|
+
enabled: boolean;
|
|
389
|
+
serviceUrl: string;
|
|
390
|
+
};
|
|
391
|
+
enableExportToWord?: {
|
|
392
|
+
enabled: boolean;
|
|
393
|
+
serviceUrl: string;
|
|
394
|
+
};
|
|
395
|
+
enableExportToPdf?: {
|
|
396
|
+
enabled: boolean;
|
|
397
|
+
serviceUrl: string;
|
|
398
|
+
};
|
|
399
|
+
parentPath?: string;
|
|
400
|
+
properties?: Record<string, any>;
|
|
401
|
+
expressionValue?: string;
|
|
402
|
+
conditions?: ConditionRule;
|
|
403
|
+
customValidation?: CustomValidationRule[];
|
|
404
|
+
_configured?: boolean;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* @private
|
|
408
|
+
*/
|
|
409
|
+
export interface ValidationRules {
|
|
410
|
+
[fieldName: string]: {
|
|
411
|
+
required?: [boolean, string];
|
|
412
|
+
minLength?: [number, string];
|
|
413
|
+
maxLength?: [number, string];
|
|
414
|
+
min?: [number, string];
|
|
415
|
+
max?: [number, string];
|
|
416
|
+
regex?: [string, string];
|
|
417
|
+
date?: [string, string];
|
|
418
|
+
[key: string]: any | undefined;
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Specifies the optional global settings that control form rendering behavior.
|
|
423
|
+
*/
|
|
424
|
+
export interface FormSettings {
|
|
425
|
+
/** Specifies the title or name of the form. */
|
|
426
|
+
name?: string;
|
|
427
|
+
/** Specifies the width of the form container, such as '100%' or '600px'. */
|
|
428
|
+
width?: string;
|
|
429
|
+
/** Specifies whether labels are hidden for form fields. */
|
|
430
|
+
hideLabel?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Specifies the overall UI size variant for form controls.
|
|
433
|
+
* Takes values such as `Small`, `Medium`, or `Large`.
|
|
434
|
+
*/
|
|
435
|
+
size?: string;
|
|
436
|
+
/**
|
|
437
|
+
* Specifies the float label display mode for input fields.
|
|
438
|
+
* Takes values such as `Never`, `Always`, or `Auto`.
|
|
439
|
+
*/
|
|
440
|
+
floatLabelType?: string;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @private
|
|
444
|
+
*/
|
|
445
|
+
export interface ButtonDefinition {
|
|
446
|
+
label: string;
|
|
447
|
+
type?: 'submit' | 'reset' | 'button';
|
|
448
|
+
style?: 'primary' | 'flat' | 'information' | 'error' | 'success' | 'warning';
|
|
449
|
+
iconCss?: string;
|
|
450
|
+
iconPosition?: 'Left' | 'Right';
|
|
451
|
+
disabled?: boolean;
|
|
452
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These enum values define the layouts available to render forms.
|
|
3
|
+
*/
|
|
4
|
+
export var FormLayout;
|
|
5
|
+
(function (FormLayout) {
|
|
6
|
+
/**
|
|
7
|
+
* SingleColumn - Represents the single column layout and renders forms in a vertical layout.
|
|
8
|
+
*/
|
|
9
|
+
FormLayout["SingleColumn"] = "SingleColumn";
|
|
10
|
+
/**
|
|
11
|
+
* TwoColumn - Represents the two column layout and renders forms in a two column grid layout.
|
|
12
|
+
*/
|
|
13
|
+
FormLayout["TwoColumn"] = "TwoColumn";
|
|
14
|
+
/**
|
|
15
|
+
* ThreeColumn - Represents the three column layout which renders forms in a three column grid layout.
|
|
16
|
+
*/
|
|
17
|
+
FormLayout["ThreeColumn"] = "ThreeColumn";
|
|
18
|
+
/**
|
|
19
|
+
* FourColumn - Represents the four column layout which renders forms in a four column grid layout.
|
|
20
|
+
*/
|
|
21
|
+
FormLayout["FourColumn"] = "FourColumn";
|
|
22
|
+
})(FormLayout || (FormLayout = {}));
|
|
23
|
+
/**
|
|
24
|
+
* Specifies the component types supported in the Form Renderer.
|
|
25
|
+
*/
|
|
26
|
+
export var FORM_COMPONENT_TYPES = [
|
|
27
|
+
'textbox', 'textarea', 'number', 'checkbox', 'checkboxGroup', 'radio',
|
|
28
|
+
'dropdown', 'multiselect', 'button', 'date', 'dateTime', 'time', 'dateRange',
|
|
29
|
+
'switch', 'signature', 'rating', 'imageEditor', 'fileUpload', 'rangeSlider',
|
|
30
|
+
'colorPicker', 'inputMask', 'message', 'panel', 'table', 'tabs', 'dataGrid',
|
|
31
|
+
'staticHtml', 'card', 'splitButton', 'richTextEditor'
|
|
32
|
+
];
|
package/src/global.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index';
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED