@syncfusion/ej2-react-form-builder 0.1.0-beta → 35.1.37

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 (160) hide show
  1. package/README.md +81 -36
  2. package/diConfig.json +148 -0
  3. package/dist/ej2-react-form-builder.min.js +10 -0
  4. package/dist/ej2-react-form-builder.umd.min.js +11 -0
  5. package/dist/ej2-react-form-builder.umd.min.js.map +1 -0
  6. package/dist/es6/ej2-react-form-builder.es2015.js +60 -0
  7. package/dist/es6/ej2-react-form-builder.es2015.js.map +1 -0
  8. package/form-builder.d.ts +4 -0
  9. package/form-builder.js +4 -0
  10. package/index.d.ts +2 -4
  11. package/index.js +2 -4
  12. package/license +6 -13
  13. package/package.json +19 -43
  14. package/src/form-builder/formbuilder.component.d.ts +37 -0
  15. package/src/form-builder/formbuilder.component.js +50 -0
  16. package/src/form-builder/index.d.ts +2 -0
  17. package/src/form-builder/index.js +2 -0
  18. package/src/form-builder/toolboxitems-directive.d.ts +28 -0
  19. package/src/form-builder/toolboxitems-directive.js +47 -0
  20. package/src/global.js +1 -0
  21. package/src/index.d.ts +2 -16
  22. package/src/index.js +2 -6
  23. package/Common/CheckboxGroup.d.ts +0 -13
  24. package/Common/CheckboxGroup.js +0 -50
  25. package/Common/ConditionalRuleEngine.d.ts +0 -296
  26. package/Common/ConditionalRuleEngine.js +0 -566
  27. package/Common/CustomTabComponent.d.ts +0 -17
  28. package/Common/CustomTabComponent.js +0 -30
  29. package/Common/CustomValidationEngine.d.ts +0 -58
  30. package/Common/CustomValidationEngine.js +0 -146
  31. package/Common/DataGridComponent.d.ts +0 -20
  32. package/Common/DataGridComponent.js +0 -273
  33. package/Common/FormValidator.d.ts +0 -485
  34. package/Common/FormValidator.js +0 -575
  35. package/Common/MinMaxRuleEngine.d.ts +0 -105
  36. package/Common/MinMaxRuleEngine.js +0 -365
  37. package/Common/StaticHtmlRenderer.d.ts +0 -14
  38. package/Common/StaticHtmlRenderer.js +0 -24
  39. package/Common/expressions/DependencyTracker.d.ts +0 -30
  40. package/Common/expressions/DependencyTracker.js +0 -128
  41. package/Common/expressions/ExpressionEngine.d.ts +0 -95
  42. package/Common/expressions/ExpressionEngine.js +0 -506
  43. package/Common/expressions/ExpressionParser.d.ts +0 -41
  44. package/Common/expressions/ExpressionParser.js +0 -269
  45. package/Common/expressions/useGridExpressions.d.ts +0 -12
  46. package/Common/expressions/useGridExpressions.js +0 -71
  47. package/Common/globalFormId.d.ts +0 -26
  48. package/Common/globalFormId.js +0 -45
  49. package/Common/json-converter.d.ts +0 -444
  50. package/Common/json-converter.js +0 -1184
  51. package/Common/parser.d.ts +0 -98
  52. package/Common/parser.js +0 -753
  53. package/Common/utils.d.ts +0 -130
  54. package/Common/utils.js +0 -574
  55. package/src/FormBuilder.d.ts +0 -211
  56. package/src/FormBuilder.js +0 -1299
  57. package/src/components/Database/ConnectionForm.d.ts +0 -8
  58. package/src/components/Database/ConnectionForm.js +0 -28
  59. package/src/components/TopBar.d.ts +0 -10
  60. package/src/components/TopBar.js +0 -7
  61. package/src/components/icons/ComponentIcons.d.ts +0 -44
  62. package/src/components/icons/ComponentIcons.js +0 -40
  63. package/src/components/layout/FormFieldWrapper.d.ts +0 -41
  64. package/src/components/layout/FormFieldWrapper.js +0 -112
  65. package/src/components/layout/LeftPane.d.ts +0 -23
  66. package/src/components/layout/LeftPane.js +0 -310
  67. package/src/components/layout/ListBoxPane.d.ts +0 -24
  68. package/src/components/layout/ListBoxPane.js +0 -94
  69. package/src/components/layout/MainSection.d.ts +0 -39
  70. package/src/components/layout/MainSection.js +0 -1766
  71. package/src/components/layout/Preview.d.ts +0 -12
  72. package/src/components/layout/Preview.js +0 -337
  73. package/src/components/layout/RightPane.d.ts +0 -22
  74. package/src/components/layout/RightPane.js +0 -370
  75. package/src/components/theme/ThemeSwitcher.d.ts +0 -14
  76. package/src/components/theme/ThemeSwitcher.js +0 -24
  77. package/src/components/theme/theme-constant.d.ts +0 -37
  78. package/src/components/theme/theme-constant.js +0 -23
  79. package/src/config/component-properties.json +0 -4929
  80. package/src/config/form-setting.json +0 -56
  81. package/src/config/locale.d.ts +0 -449
  82. package/src/config/locale.js +0 -449
  83. package/src/context/FormSchemaContext.d.ts +0 -32
  84. package/src/context/FormSchemaContext.js +0 -155
  85. package/src/context/LocalizationContext.d.ts +0 -27
  86. package/src/context/LocalizationContext.js +0 -43
  87. package/src/context/ThemeContext.d.ts +0 -23
  88. package/src/context/ThemeContext.js +0 -161
  89. package/src/context/contexts.d.ts +0 -6
  90. package/src/context/contexts.js +0 -6
  91. package/src/context/defaultFormSchema.d.ts +0 -6
  92. package/src/context/defaultFormSchema.js +0 -20
  93. package/src/defaultPalette.d.ts +0 -9
  94. package/src/defaultPalette.js +0 -45
  95. package/src/defaultTemplate.d.ts +0 -3
  96. package/src/defaultTemplate.js +0 -185
  97. package/src/import/schemaImportUtils.d.ts +0 -24
  98. package/src/import/schemaImportUtils.js +0 -121
  99. package/src/types/ActionButtons.d.ts +0 -44
  100. package/src/types/ActionButtons.js +0 -27
  101. package/src/types/ComponentProperties.d.ts +0 -33
  102. package/src/types/ComponentProperties.js +0 -2
  103. package/src/types/FormSchema.d.ts +0 -585
  104. package/src/types/FormSchema.js +0 -147
  105. package/src/types/connection.d.ts +0 -19
  106. package/src/types/connection.js +0 -9
  107. package/src/utils/AttributesEditor.d.ts +0 -13
  108. package/src/utils/AttributesEditor.js +0 -117
  109. package/src/utils/ButtonGroupEditor.d.ts +0 -15
  110. package/src/utils/ButtonGroupEditor.js +0 -141
  111. package/src/utils/ChoiceBasedFieldEditor.d.ts +0 -16
  112. package/src/utils/ChoiceBasedFieldEditor.js +0 -87
  113. package/src/utils/ClipboardHelper.d.ts +0 -26
  114. package/src/utils/ClipboardHelper.js +0 -83
  115. package/src/utils/ColumnBuilder.d.ts +0 -11
  116. package/src/utils/ColumnBuilder.js +0 -153
  117. package/src/utils/ColumnSpanEditor.d.ts +0 -8
  118. package/src/utils/ColumnSpanEditor.js +0 -98
  119. package/src/utils/ConditionDataEditor.d.ts +0 -29
  120. package/src/utils/ConditionDataEditor.js +0 -177
  121. package/src/utils/ConditionalEditorUtils.d.ts +0 -27
  122. package/src/utils/ConditionalEditorUtils.js +0 -310
  123. package/src/utils/ConditionsEditor.d.ts +0 -20
  124. package/src/utils/ConditionsEditor.js +0 -571
  125. package/src/utils/CustomAccordion.d.ts +0 -13
  126. package/src/utils/CustomAccordion.js +0 -38
  127. package/src/utils/CustomValidationEditor.d.ts +0 -11
  128. package/src/utils/CustomValidationEditor.js +0 -208
  129. package/src/utils/DataSourceCollector.d.ts +0 -3
  130. package/src/utils/DataSourceCollector.js +0 -252
  131. package/src/utils/ExpressionEditor.d.ts +0 -13
  132. package/src/utils/ExpressionEditor.js +0 -99
  133. package/src/utils/FormSettingsPanel.d.ts +0 -9
  134. package/src/utils/FormSettingsPanel.js +0 -60
  135. package/src/utils/LookupConfig.d.ts +0 -11
  136. package/src/utils/LookupConfig.js +0 -159
  137. package/src/utils/MinMaxValueEditor.d.ts +0 -25
  138. package/src/utils/MinMaxValueEditor.js +0 -188
  139. package/src/utils/OptionsEditor.d.ts +0 -8
  140. package/src/utils/OptionsEditor.js +0 -79
  141. package/src/utils/PropertyRenderer.d.ts +0 -22
  142. package/src/utils/PropertyRenderer.js +0 -210
  143. package/src/utils/ValueRenderer.d.ts +0 -2
  144. package/src/utils/ValueRenderer.js +0 -91
  145. package/src/utils/ej2DbAdaptor.d.ts +0 -6
  146. package/src/utils/ej2DbAdaptor.js +0 -38
  147. package/src/utils/mappingHeuristics.d.ts +0 -10
  148. package/src/utils/mappingHeuristics.js +0 -33
  149. package/src/utils/renderComponent.d.ts +0 -18
  150. package/src/utils/renderComponent.js +0 -300
  151. package/styles/tailwind3.css +0 -67
  152. package/styles/themes/action-buttons.css +0 -110
  153. package/styles/themes/datagrid.css +0 -380
  154. package/styles/themes/drag-reorder.css +0 -248
  155. package/styles/themes/import-dialog.css +0 -292
  156. package/styles/themes/index.css +0 -658
  157. package/styles/themes/left-pane.css +0 -253
  158. package/styles/themes/options-editor.css +0 -63
  159. package/styles/themes/preview.css +0 -702
  160. package/styles/themes/property-dialog.css +0 -371
@@ -1,310 +0,0 @@
1
- /**
2
- * ConditionalEditorUtils - Shared utility functions for Conditional and ConditionalData editors
3
- * Exports field type inference, column templates, and helper functions
4
- */
5
- import { getComponent, Internationalization } from '@syncfusion/ej2-base';
6
- import { DropDownList, MultiSelect } from '@syncfusion/ej2-dropdowns';
7
- import { DatePicker, TimePicker, DateTimePicker, DateRangePicker } from '@syncfusion/ej2-calendars';
8
- import { resolveOptions } from '../../Common/utils';
9
- import { useLocalization } from '../context/LocalizationContext';
10
- /**
11
- * Infer field type from component type for QueryBuilder
12
- */
13
- export function inferFieldType(component) {
14
- const type = component.type;
15
- if (type === 'number' || type === 'rangeSlider' || type === 'rating') {
16
- return 'number';
17
- }
18
- if (type === 'date') {
19
- return 'date';
20
- }
21
- if (type === 'dateTime') {
22
- return 'string';
23
- }
24
- if (type === 'time') {
25
- return 'string';
26
- }
27
- if (type === 'dateRange') {
28
- return 'string';
29
- }
30
- if (type === 'checkbox' || type === 'switch') {
31
- return 'boolean';
32
- }
33
- if (type === 'multiselect' || type === 'checkboxGroup') {
34
- return 'string';
35
- }
36
- return 'string';
37
- }
38
- /**
39
- * Check if component is an array field type
40
- */
41
- export function isArrayField(component) {
42
- return component.type === 'multiselect' || component.type === 'checkboxGroup' || component.type === 'dateRange';
43
- }
44
- /**
45
- * Check if component has selectable options
46
- */
47
- export function hasSelectableOptions(component) {
48
- const selectTypes = ['dropdown', 'radio', 'multiselect', 'checkboxGroup'];
49
- return selectTypes.includes(component.type) && !!component.options;
50
- }
51
- /**
52
- * Create column template for QueryBuilder with custom input widgets
53
- * Supports date, time, multiselect, dropdown, and other input types
54
- */
55
- export function createColumnTemplate(component, qbRef, fetchedOptions = {}) {
56
- const intl = new Internationalization();
57
- const { locale } = useLocalization();
58
- const isMultiple = component.type === 'multiselect' || component.type === 'checkboxGroup';
59
- const isDateType = component.type === 'date';
60
- const isTimeType = component.type === 'time';
61
- const isDateTimeType = component.type === 'dateTime';
62
- const isDateRangeType = component.type === 'dateRange';
63
- const urlFetchedOptions = fetchedOptions[component.id] || [];
64
- const resolvedOptions = Array.isArray(component.options)
65
- ? component.options
66
- : component.options?.type === 'url' ? resolveOptions(component.options, urlFetchedOptions) : [];
67
- const dataSource = resolvedOptions ? resolvedOptions.map(opt => {
68
- if (typeof opt === 'string') {
69
- return { text: opt, value: opt };
70
- }
71
- else if (opt && typeof opt === 'object' && 'value' in opt) {
72
- return {
73
- text: opt.label || opt.text || opt.value,
74
- value: opt.value
75
- };
76
- }
77
- return { text: String(opt), value: String(opt) };
78
- }) : [];
79
- return {
80
- create: () => {
81
- const elem = document.createElement('input');
82
- elem.setAttribute('type', 'text');
83
- return elem;
84
- },
85
- destroy: (args) => {
86
- const element = document.getElementById(args.elementId);
87
- if (!element)
88
- return;
89
- if (isMultiple) {
90
- const multiSelectObj = getComponent(element, 'multiselect');
91
- if (multiSelectObj) {
92
- multiSelectObj.destroy();
93
- }
94
- }
95
- else if (isDateType) {
96
- const datePickerObj = getComponent(element, 'datepicker');
97
- if (datePickerObj) {
98
- datePickerObj.destroy();
99
- }
100
- }
101
- else if (isTimeType) {
102
- const timePickerObj = getComponent(element, 'timepicker');
103
- if (timePickerObj) {
104
- timePickerObj.destroy();
105
- }
106
- }
107
- else if (isDateTimeType) {
108
- const dateTimePickerObj = getComponent(element, 'datetimepicker');
109
- if (dateTimePickerObj) {
110
- dateTimePickerObj.destroy();
111
- }
112
- }
113
- else if (isDateRangeType) {
114
- const dateRangePickerObj = getComponent(element, 'daterangepicker');
115
- if (dateRangePickerObj) {
116
- dateRangePickerObj.destroy();
117
- }
118
- }
119
- else {
120
- const dropDownObj = getComponent(element, 'dropdownlist');
121
- if (dropDownObj) {
122
- dropDownObj.destroy();
123
- }
124
- }
125
- },
126
- write: (args) => {
127
- if (isMultiple) {
128
- let initialValue = [];
129
- if (args.values) {
130
- if (typeof args.values === 'string') {
131
- initialValue = args.values.split(',').map((v) => v.trim()).filter((v) => v);
132
- }
133
- else if (Array.isArray(args.values)) {
134
- initialValue = args.values;
135
- }
136
- }
137
- const multiSelectObj = new MultiSelect({
138
- change: (e) => {
139
- const valueStr = e.value && e.value.length > 0 ? e.value.join(', ') : '';
140
- qbRef.current?.notifyChange(valueStr, e.element);
141
- },
142
- dataSource: dataSource,
143
- fields: { text: 'text', value: 'value' },
144
- placeholder: `Select ${component.label || component.id}`,
145
- value: initialValue,
146
- });
147
- multiSelectObj.appendTo('#' + args.elements.id);
148
- const elem = document.getElementById(args.elements.id);
149
- if (elem) {
150
- elem.setAttribute('data-component-id', component.id);
151
- }
152
- }
153
- else if (isDateType) {
154
- let initialDate = null;
155
- if (args.values) {
156
- if (typeof args.values === 'string') {
157
- initialDate = new Date(args.values);
158
- }
159
- else if (args.values instanceof Date) {
160
- initialDate = args.values;
161
- }
162
- }
163
- const datePickerObj = new DatePicker({
164
- locale: locale,
165
- change: (e) => {
166
- if (e.value) {
167
- const dFormatter = intl.getDateFormat({
168
- format: 'MM/dd/yyyy',
169
- type: 'date'
170
- });
171
- const formattedValue = dFormatter(e.value);
172
- qbRef.current?.notifyChange(formattedValue, e.element);
173
- }
174
- else {
175
- qbRef.current?.notifyChange('', e.element);
176
- }
177
- },
178
- format: 'MM/dd/yyyy',
179
- placeholder: `Select ${component.label || component.id}`,
180
- value: initialDate || undefined,
181
- });
182
- datePickerObj.appendTo('#' + args.elements.id);
183
- }
184
- else if (isTimeType) {
185
- let initialTime = null;
186
- if (args.values) {
187
- if (typeof args.values === 'string') {
188
- initialTime = new Date(`1970-01-01 ${args.values}`);
189
- }
190
- else if (args.values instanceof Date) {
191
- initialTime = args.values;
192
- }
193
- }
194
- const timePickerObj = new TimePicker({
195
- locale: locale,
196
- change: (e) => {
197
- if (e.value) {
198
- const tFormatter = intl.getDateFormat({
199
- format: 'hh:mm a',
200
- type: 'time'
201
- });
202
- const formattedValue = tFormatter(e.value);
203
- qbRef.current?.notifyChange(formattedValue, e.element);
204
- }
205
- else {
206
- qbRef.current?.notifyChange('', e.element);
207
- }
208
- },
209
- format: 'hh:mm a',
210
- placeholder: `Select ${component.label || component.id}`,
211
- value: initialTime || undefined,
212
- });
213
- timePickerObj.appendTo('#' + args.elements.id);
214
- }
215
- else if (isDateTimeType) {
216
- let initialDateTime = null;
217
- if (args.values) {
218
- if (typeof args.values === 'string') {
219
- initialDateTime = new Date(args.values);
220
- }
221
- else if (args.values instanceof Date) {
222
- initialDateTime = args.values;
223
- }
224
- }
225
- const dateTimePickerObj = new DateTimePicker({
226
- locale: locale,
227
- change: (e) => {
228
- if (e.value) {
229
- const dtFormatter = intl.getDateFormat({
230
- format: 'MM/dd/yyyy hh:mm a',
231
- type: 'dateTime'
232
- });
233
- const formattedValue = dtFormatter(e.value);
234
- const element = document.getElementById(args.elements.id);
235
- qbRef.current?.notifyChange(formattedValue, element);
236
- }
237
- else {
238
- const element = document.getElementById(args.elements.id);
239
- qbRef.current?.notifyChange('', element);
240
- }
241
- },
242
- format: 'MM/dd/yyyy hh:mm a',
243
- placeholder: `Select ${component.label || component.id}`,
244
- value: initialDateTime || undefined,
245
- });
246
- dateTimePickerObj.appendTo('#' + args.elements.id);
247
- }
248
- else if (isDateRangeType) {
249
- let initialStartDate = null;
250
- let initialEndDate = null;
251
- if (args.values) {
252
- if (typeof args.values === 'string') {
253
- const dates = args.values.split(',').map((d) => d.trim());
254
- if (dates[0])
255
- initialStartDate = new Date(dates[0]);
256
- if (dates[1])
257
- initialEndDate = new Date(dates[1]);
258
- }
259
- else if (Array.isArray(args.values)) {
260
- if (args.values[0])
261
- initialStartDate = new Date(args.values[0]);
262
- if (args.values[1])
263
- initialEndDate = new Date(args.values[1]);
264
- }
265
- }
266
- const dateRangePickerObj = new DateRangePicker({
267
- locale: locale,
268
- change: (e) => {
269
- if (e.startDate && e.endDate) {
270
- const dFormatter = intl.getDateFormat({
271
- format: 'MM/dd/yyyy',
272
- type: 'date'
273
- });
274
- const formattedStart = dFormatter(e.startDate);
275
- const formattedEnd = dFormatter(e.endDate);
276
- const formattedValue = `${formattedStart} , ${formattedEnd}`;
277
- const element = document.getElementById(args.elements.id);
278
- qbRef.current?.notifyChange(formattedValue, element);
279
- }
280
- else {
281
- const element = document.getElementById(args.elements.id);
282
- qbRef.current?.notifyChange('', element);
283
- }
284
- },
285
- format: 'MM/dd/yyyy',
286
- placeholder: `Select ${component.label || component.id}`,
287
- startDate: initialStartDate || undefined,
288
- endDate: initialEndDate || undefined,
289
- });
290
- dateRangePickerObj.appendTo('#' + args.elements.id);
291
- }
292
- else {
293
- const dropDownObj = new DropDownList({
294
- change: (e) => {
295
- qbRef.current?.notifyChange(e.itemData?.value || e.value, e.element);
296
- },
297
- dataSource: dataSource,
298
- fields: { text: 'text', value: 'value' },
299
- placeholder: `Select ${component.label || component.id}`,
300
- value: args.values || undefined
301
- });
302
- dropDownObj.appendTo('#' + args.elements.id);
303
- const elem = document.getElementById(args.elements.id);
304
- if (elem) {
305
- elem.setAttribute('data-component-id', component.id);
306
- }
307
- }
308
- }
309
- };
310
- }
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import type { FormComponent, FormComponentConditions } from '../types/FormSchema';
3
- export interface ConditionsEditorProps {
4
- /** Array of available form field names/components for condition rules */
5
- componentFields: FormComponent[];
6
- /** The component being edited (for determining value input type in setValueWhen) */
7
- componentForEdit?: FormComponent;
8
- /** ID of the component being edited - exclude this from columns to prevent self-reference */
9
- excludeFieldId?: string;
10
- /** Array of child component IDs to exclude (prevents circular dependencies with children) */
11
- excludeChildIds?: string[];
12
- /** Existing conditions to pre-populate QueryBuilders (for editing) */
13
- existingConditions?: FormComponentConditions;
14
- /** Callback when any condition changes */
15
- onChange: (conditions: FormComponentConditions) => void;
16
- /** Array of supported condition types for this component (default: all) */
17
- supportedConditions?: ('visibleWhen' | 'hideWhen' | 'readOnlyWhen' | 'disabledWhen' | 'requiredWhen' | 'setValueWhen' | 'conditionalData' | 'choiceBasedField')[];
18
- builderMode?: 'Simple' | 'Developer';
19
- }
20
- export declare const ConditionsEditor: React.FC<ConditionsEditorProps>;