@syncfusion/ej2-react-form-renderer 0.1.2-beta → 34.2.3

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 (181) hide show
  1. package/README.md +88 -105
  2. package/diConfig.json +85 -0
  3. package/dist/ej2-react-form-renderer.min.js +10 -0
  4. package/dist/ej2-react-form-renderer.umd.min.js +11 -0
  5. package/dist/ej2-react-form-renderer.umd.min.js.map +1 -0
  6. package/dist/es6/ej2-react-form-renderer.es2015.js +37 -0
  7. package/dist/es6/ej2-react-form-renderer.es2015.js.map +1 -0
  8. package/form-renderer.d.ts +4 -0
  9. package/form-renderer.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 -38
  14. package/src/form-renderer/formrenderer.component.d.ts +34 -0
  15. package/src/form-renderer/formrenderer.component.js +49 -0
  16. package/src/form-renderer/index.d.ts +1 -0
  17. package/src/form-renderer/index.js +1 -0
  18. package/src/global.js +1 -0
  19. package/src/index.d.ts +2 -6
  20. package/src/index.js +2 -6
  21. package/styles/bds-lite.css +1 -0
  22. package/styles/bds-lite.scss +1 -0
  23. package/styles/bds.css +1 -0
  24. package/styles/bds.scss +1 -0
  25. package/styles/bootstrap-dark-lite.css +1 -0
  26. package/styles/bootstrap-dark-lite.scss +1 -0
  27. package/styles/bootstrap-dark.css +1 -26
  28. package/styles/bootstrap-dark.scss +1 -0
  29. package/styles/bootstrap-lite.css +1 -0
  30. package/styles/bootstrap-lite.scss +1 -0
  31. package/styles/bootstrap.css +1 -26
  32. package/styles/bootstrap.scss +1 -0
  33. package/styles/bootstrap4-lite.css +1 -0
  34. package/styles/bootstrap4-lite.scss +1 -0
  35. package/styles/bootstrap4.css +1 -26
  36. package/styles/bootstrap4.scss +1 -0
  37. package/styles/bootstrap5-dark-lite.css +1 -0
  38. package/styles/bootstrap5-dark-lite.scss +1 -0
  39. package/styles/bootstrap5-dark.css +1 -26
  40. package/styles/bootstrap5-dark.scss +1 -0
  41. package/styles/bootstrap5-lite.css +1 -0
  42. package/styles/bootstrap5-lite.scss +1 -0
  43. package/styles/bootstrap5.3-lite.css +1 -0
  44. package/styles/bootstrap5.3-lite.scss +1 -0
  45. package/styles/bootstrap5.3.css +1 -26
  46. package/styles/bootstrap5.3.scss +1 -0
  47. package/styles/bootstrap5.css +1 -26
  48. package/styles/bootstrap5.scss +1 -0
  49. package/styles/fabric-dark-lite.css +1 -0
  50. package/styles/fabric-dark-lite.scss +1 -0
  51. package/styles/fabric-dark.css +1 -0
  52. package/styles/fabric-dark.scss +1 -0
  53. package/styles/fabric-lite.css +1 -0
  54. package/styles/fabric-lite.scss +1 -0
  55. package/styles/fabric.css +1 -0
  56. package/styles/fabric.scss +1 -0
  57. package/styles/fluent-dark-lite.css +1 -0
  58. package/styles/fluent-dark-lite.scss +1 -0
  59. package/styles/fluent-dark.css +1 -26
  60. package/styles/fluent-dark.scss +1 -0
  61. package/styles/fluent-lite.css +1 -0
  62. package/styles/fluent-lite.scss +1 -0
  63. package/styles/fluent.css +1 -26
  64. package/styles/fluent.scss +1 -0
  65. package/styles/fluent2-lite.css +1 -0
  66. package/styles/fluent2-lite.scss +1 -0
  67. package/styles/fluent2.css +1 -26
  68. package/styles/fluent2.scss +1 -0
  69. package/styles/form-renderer/bds.css +1 -0
  70. package/styles/form-renderer/bds.scss +1 -0
  71. package/styles/form-renderer/bootstrap-dark.css +1 -0
  72. package/styles/form-renderer/bootstrap-dark.scss +1 -0
  73. package/styles/form-renderer/bootstrap.css +1 -0
  74. package/styles/form-renderer/bootstrap.scss +1 -0
  75. package/styles/form-renderer/bootstrap4.css +1 -0
  76. package/styles/form-renderer/bootstrap4.scss +1 -0
  77. package/styles/form-renderer/bootstrap5-dark.css +1 -0
  78. package/styles/form-renderer/bootstrap5-dark.scss +1 -0
  79. package/styles/form-renderer/bootstrap5.3.css +1 -0
  80. package/styles/form-renderer/bootstrap5.3.scss +1 -0
  81. package/styles/form-renderer/bootstrap5.css +1 -0
  82. package/styles/form-renderer/bootstrap5.scss +1 -0
  83. package/styles/form-renderer/fabric-dark.css +1 -0
  84. package/styles/form-renderer/fabric-dark.scss +1 -0
  85. package/styles/form-renderer/fabric.css +1 -0
  86. package/styles/form-renderer/fabric.scss +1 -0
  87. package/styles/form-renderer/fluent-dark.css +1 -0
  88. package/styles/form-renderer/fluent-dark.scss +1 -0
  89. package/styles/form-renderer/fluent.css +1 -0
  90. package/styles/form-renderer/fluent.scss +1 -0
  91. package/styles/form-renderer/fluent2.css +1 -0
  92. package/styles/form-renderer/fluent2.scss +1 -0
  93. package/styles/form-renderer/highcontrast-light.css +1 -0
  94. package/styles/form-renderer/highcontrast-light.scss +1 -0
  95. package/styles/form-renderer/highcontrast.css +1 -0
  96. package/styles/form-renderer/highcontrast.scss +1 -0
  97. package/styles/form-renderer/material-dark.css +1 -0
  98. package/styles/form-renderer/material-dark.scss +1 -0
  99. package/styles/form-renderer/material.css +1 -0
  100. package/styles/form-renderer/material.scss +1 -0
  101. package/styles/form-renderer/material3-dark.css +1 -0
  102. package/styles/form-renderer/material3-dark.scss +1 -0
  103. package/styles/form-renderer/material3.css +1 -0
  104. package/styles/form-renderer/material3.scss +1 -0
  105. package/styles/form-renderer/tailwind-dark.css +1 -0
  106. package/styles/form-renderer/tailwind-dark.scss +1 -0
  107. package/styles/form-renderer/tailwind.css +1 -0
  108. package/styles/form-renderer/tailwind.scss +1 -0
  109. package/styles/form-renderer/tailwind3.css +1 -0
  110. package/styles/form-renderer/tailwind3.scss +1 -0
  111. package/styles/highcontrast-light-lite.css +1 -0
  112. package/styles/highcontrast-light-lite.scss +1 -0
  113. package/styles/highcontrast-light.css +1 -0
  114. package/styles/highcontrast-light.scss +1 -0
  115. package/styles/highcontrast-lite.css +1 -0
  116. package/styles/highcontrast-lite.scss +1 -0
  117. package/styles/highcontrast.css +1 -0
  118. package/styles/highcontrast.scss +1 -0
  119. package/styles/material-dark-lite.css +1 -0
  120. package/styles/material-dark-lite.scss +1 -0
  121. package/styles/material-dark.css +1 -26
  122. package/styles/material-dark.scss +1 -0
  123. package/styles/material-lite.css +1 -0
  124. package/styles/material-lite.scss +1 -0
  125. package/styles/material.css +1 -26
  126. package/styles/material.scss +1 -0
  127. package/styles/material3-dark-lite.css +1 -0
  128. package/styles/material3-dark-lite.scss +1 -0
  129. package/styles/material3-dark.css +1 -26
  130. package/styles/material3-dark.scss +1 -0
  131. package/styles/material3-lite.css +1 -0
  132. package/styles/material3-lite.scss +1 -0
  133. package/styles/material3.css +1 -26
  134. package/styles/material3.scss +1 -0
  135. package/styles/tailwind-dark-lite.css +1 -0
  136. package/styles/tailwind-dark-lite.scss +1 -0
  137. package/styles/tailwind-dark.css +1 -26
  138. package/styles/tailwind-dark.scss +1 -0
  139. package/styles/tailwind-lite.css +1 -0
  140. package/styles/tailwind-lite.scss +1 -0
  141. package/styles/tailwind.css +1 -26
  142. package/styles/tailwind.scss +1 -0
  143. package/styles/tailwind3-lite.css +1 -0
  144. package/styles/tailwind3-lite.scss +1 -0
  145. package/styles/tailwind3.css +1 -26
  146. package/styles/tailwind3.scss +1 -0
  147. package/src/CheckboxGroup.d.ts +0 -12
  148. package/src/CheckboxGroup.js +0 -49
  149. package/src/ConditionalRuleEngine.d.ts +0 -295
  150. package/src/ConditionalRuleEngine.js +0 -566
  151. package/src/CustomTabComponent.d.ts +0 -13
  152. package/src/CustomTabComponent.js +0 -35
  153. package/src/DataGridComponent.d.ts +0 -28
  154. package/src/DataGridComponent.js +0 -147
  155. package/src/FormRenderer.d.ts +0 -84
  156. package/src/FormRenderer.js +0 -707
  157. package/src/FormValidator.d.ts +0 -479
  158. package/src/FormValidator.js +0 -579
  159. package/src/MinMaxRuleEngine.d.ts +0 -95
  160. package/src/MinMaxRuleEngine.js +0 -361
  161. package/src/StaticHtmlRenderer.d.ts +0 -8
  162. package/src/StaticHtmlRenderer.js +0 -21
  163. package/src/expressions/DependencyTracker.d.ts +0 -30
  164. package/src/expressions/DependencyTracker.js +0 -128
  165. package/src/expressions/ExpressionEngine.d.ts +0 -81
  166. package/src/expressions/ExpressionEngine.js +0 -503
  167. package/src/expressions/ExpressionParser.d.ts +0 -39
  168. package/src/expressions/ExpressionParser.js +0 -270
  169. package/src/json-converter.d.ts +0 -171
  170. package/src/json-converter.js +0 -1209
  171. package/src/parser.d.ts +0 -99
  172. package/src/parser.js +0 -753
  173. package/src/renderFormField.d.ts +0 -21
  174. package/src/renderFormField.js +0 -226
  175. package/src/types/FormSchema.d.ts +0 -211
  176. package/src/types/FormSchema.js +0 -1
  177. package/src/utils.js +0 -408
  178. package/styles/bootstrap5.3-dark.css +0 -26
  179. package/styles/fluent2-dark.css +0 -26
  180. package/styles/form-renderer.base.css +0 -499
  181. package/styles/tailwind3-dark.css +0 -10
@@ -1,49 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CheckBoxComponent } from '@syncfusion/ej2-react-buttons';
3
- const resolveAttributes = (attributes) => {
4
- if (!attributes)
5
- return {};
6
- if (Array.isArray(attributes)) {
7
- return attributes.reduce((acc, item) => {
8
- if (item && item.key && item.value !== undefined) {
9
- acc[item.key] = item.value;
10
- }
11
- return acc;
12
- }, {});
13
- }
14
- return attributes;
15
- };
16
- const CheckboxGroup = ({ component, formState, value, onChange, optionRef }) => {
17
- const resolvedValue = (formState ? formState.values[component.id] : (value ?? component.defaultValue));
18
- const selectedItems = Array.isArray(resolvedValue) ? resolvedValue : [];
19
- const handleCheckboxChange = (option, checked) => {
20
- const newValue = checked ? [...selectedItems, option] : selectedItems.filter(i => i !== option);
21
- if (formState) {
22
- formState.onChange(component.id, { value: newValue });
23
- }
24
- else {
25
- onChange?.(newValue);
26
- }
27
- };
28
- const groupLabel = component.label && component.required ? `${component.label} *` : component.label;
29
- const containerStyle = {
30
- display: 'flex',
31
- flexDirection: component.layoutDirection === 'row' ? 'row' : 'column',
32
- gap: component.gap || '8px',
33
- alignItems: 'flex-start'
34
- };
35
- const itemsStyle = {
36
- display: 'flex',
37
- flexDirection: component.layoutDirection === 'row' ? 'row' : 'column',
38
- gap: component.gap || '2px',
39
- width: '100%'
40
- };
41
- const htmlAttrs = resolveAttributes(component.htmlAttributes);
42
- const options = Array.isArray(component.options) ? component.options : ['Option 1'];
43
- return (_jsx("div", { className: `checkbox-group ${component.cssClass || ''}`, style: containerStyle, ...htmlAttrs, role: "group", "aria-label": groupLabel, title: component.tooltip, children: _jsx("div", { className: "checkbox-group-items", style: itemsStyle, children: (options).map((option, idx) => {
44
- const optionValue = typeof option === 'string' ? option : (option.value ?? option.label ?? option.key);
45
- const optionLabel = typeof option === 'string' ? option : (option.label ?? option.value ?? String(optionValue));
46
- return (_jsx(CheckBoxComponent, { id: `${component.id}_${idx}`, label: optionLabel, checked: selectedItems.includes(optionValue), disabled: component.disabled, labelPosition: component.checkboxLabelPosition || 'After', change: (e) => handleCheckboxChange(optionValue, e.checked), cssClass: `${component.cssClass}${component.size === 'Small' ? ' e-small' : component.size === 'Bigger' ? ' e-bigger' : ''}`, htmlAttributes: htmlAttrs, ref: optionRef ? (el) => optionRef(el, idx) : undefined }, `${component.id}-${idx}`));
47
- }) }) }, `form-checkboxgroup-${component.id}`));
48
- };
49
- export default CheckboxGroup;
@@ -1,295 +0,0 @@
1
- /**
2
- * ConditionalRuleEngine - Core rule evaluation engine for conditional behaviors
3
- *
4
- * Evaluates declarative condition rules (from QueryBuilder or manual JSON) against
5
- * form state to determine field visibility, read-only state, disabled state, and
6
- * which validators should apply.
7
- *
8
- * @spec CONDITIONAL-VALIDATION.md
9
- * @requirement Tasks 3.1-3.12: ConditionalRuleEngine implementation
10
- *
11
- * Features:
12
- * - Simple rule evaluation (field operator value)
13
- * - Composite rules (AND/OR combinations with nesting)
14
- * - Conditional validators (apply validator only when condition met)
15
- * - Relationship validators (cross-field validation with safe expression eval)
16
- * - Behavioral flags (visibility, readOnly, disabled)
17
- * - Error handling with safe defaults
18
- *
19
- * Security:
20
- * - Uses expr-eval for safe expression evaluation (no eval())
21
- * - Defaults to safe behavior on errors (visible, not disabled, not read-only)
22
- *
23
- * @example
24
- * ```typescript
25
- * const isVisible = ConditionalRuleEngine.isFieldVisible(
26
- * component.conditions,
27
- * { country: 'US', age: 25 }
28
- * );
29
- *
30
- * const behaviors = ConditionalRuleEngine.applyConditionalBehaviors(
31
- * component.conditions,
32
- * formValues
33
- * );
34
- * ```
35
- */
36
- import React from 'react';
37
- import type { ConditionType, FormComponentConditions, ConditionalDataRule, ChoiceBasedFieldRule } from '../FormBuilder/types/FormSchema';
38
- /**
39
- * Form field value type (aligned with FormValidator)
40
- */
41
- export type FormValueType = string | number | boolean | Date | bigint | symbol | File | FileList | string[] | number[] | React.ReactNode | null | undefined | any;
42
- /**
43
- * ConditionalRuleEngine class
44
- *
45
- * @spec CONDITIONAL-VALIDATION.md - Core rule evaluation engine
46
- * @requirement Phase 1: Conditional visibility, readOnly, disabled behaviors
47
- */
48
- export declare class ConditionalRuleEngine {
49
- /**
50
- * Evaluate a conditional rule against form values
51
- *
52
- * Handles both simple rules (field operator value) and composite rules (AND/OR).
53
- * Returns false for malformed rules.
54
- *
55
- * @spec CONDITIONAL-VALIDATION.md - evaluateCondition method
56
- * @requirement Task 3.2: Implement evaluateCondition with simple and composite handling
57
- *
58
- * @param rule - ConditionalRule or CompositeConditionalRule
59
- * @param formValues - Current form field values (key = field name, value = field value)
60
- * @returns true if condition met, false otherwise
61
- *
62
- * @example
63
- * ```typescript
64
- * const rule = { field: 'age', operator: 'greaterThan', value: 18 };
65
- * const isAdult = ConditionalRuleEngine.evaluateCondition(rule, { age: 25 });
66
- * // isAdult = true
67
- * ```
68
- */
69
- static evaluateCondition(rule: ConditionType, formValues: Record<string, FormValueType>): boolean;
70
- /**
71
- * Evaluate simple field comparison rule
72
- *
73
- * Supports operators: equal, notEqual, greaterThan, lessThan, greaterThanOrEqual,
74
- * lessThanOrEqual, in, notIn, contains, notContains.
75
- *
76
- * Handles both camelCase (greaterThan) and lowercase (greaterthan) operator formats
77
- * for compatibility with QueryBuilder output.
78
- *
79
- * @spec CONDITIONAL-VALIDATION.md - evaluateSimpleRule method
80
- * @requirement Task 3.3: Implement evaluateSimpleRule supporting all operators
81
- *
82
- * @param rule - Simple conditional rule with field, operator, value
83
- * @param formValues - Current form field values
84
- * @returns true if comparison is true, false otherwise
85
- *
86
- * @example
87
- * ```typescript
88
- * const rule = { field: 'email', operator: 'contains', value: '@' };
89
- * const hasAt = evaluateSimpleRule(rule, { email: 'test@example.com' });
90
- * // hasAt = true
91
- * ```
92
- */
93
- private static evaluateSimpleRule;
94
- /**
95
- * Evaluate composite rule with AND/OR logic
96
- *
97
- * Recursively evaluates nested rules with AND (all must be true) or OR
98
- * (at least one must be true) logic.
99
- *
100
- * @spec CONDITIONAL-VALIDATION.md - evaluateCompositeRule method
101
- * @requirement Task 3.4: Implement evaluateCompositeRule for AND/OR logic
102
- *
103
- * @param rule - Composite rule with condition ('and'|'or') and rules array
104
- * @param formValues - Current form field values
105
- * @returns true if composite condition met, false otherwise
106
- *
107
- * @example
108
- * ```typescript
109
- * const rule = {
110
- * condition: 'and',
111
- * rules: [
112
- * { field: 'age', operator: 'greaterThan', value: 18 },
113
- * { field: 'country', operator: 'equal', value: 'US' }
114
- * ]
115
- * };
116
- * const isEligible = evaluateCompositeRule(rule, { age: 25, country: 'US' });
117
- * // isEligible = true
118
- * ```
119
- */
120
- private static evaluateCompositeRule;
121
- /**
122
- * Check if field should be visible
123
- *
124
- * Evaluates visibleWhen condition. Defaults to true (visible) if no condition
125
- * is defined or on error.
126
- *
127
- * @spec CONDITIONAL-VALIDATION.md - isFieldVisible method
128
- * @requirement Task 3.8: Implement isFieldVisible (defaults to true if no condition)
129
- *
130
- * @param conditions - FormComponentConditions containing visibleWhen rule
131
- * @param formValues - Current form field values
132
- * @returns true if field should be visible, false if hidden
133
- *
134
- * @example
135
- * ```typescript
136
- * const conditions = {
137
- * visibleWhen: { field: 'showEmail', operator: 'equal', value: true }
138
- * };
139
- * const visible = isFieldVisible(conditions, { showEmail: true });
140
- * // visible = true
141
- * ```
142
- */
143
- static isFieldVisible(conditions: FormComponentConditions | undefined, formValues: Record<string, FormValueType>): boolean;
144
- /**
145
- * Check if field should be read-only
146
- *
147
- * Evaluates readOnlyWhen condition. Defaults to false (editable) if no
148
- * condition is defined or on error.
149
- *
150
- * @spec CONDITIONAL-VALIDATION.md - isFieldReadOnly method
151
- * @requirement Task 3.9: Implement isFieldReadOnly (defaults to false if no condition)
152
- *
153
- * @param conditions - FormComponentConditions containing readOnlyWhen rule
154
- * @param formValues - Current form field values
155
- * @returns true if field should be read-only, false if editable
156
- *
157
- * @example
158
- * ```typescript
159
- * const conditions = {
160
- * readOnlyWhen: { field: 'isVerified', operator: 'equal', value: true }
161
- * };
162
- * const readOnly = isFieldReadOnly(conditions, { isVerified: true });
163
- * // readOnly = true
164
- * ```
165
- */
166
- static isFieldReadOnly(conditions: FormComponentConditions | undefined, formValues: Record<string, FormValueType>): boolean;
167
- /**
168
- * Check if field should be disabled
169
- *
170
- * Evaluates disabledWhen condition. Defaults to false (enabled) if no
171
- * condition is defined or on error.
172
- *
173
- * @spec CONDITIONAL-VALIDATION.md - isFieldDisabled method
174
- * @requirement Task 3.10: Implement isFieldDisabled (defaults to false if no condition)
175
- *
176
- * @param conditions - FormComponentConditions containing disabledWhen rule
177
- * @param formValues - Current form field values
178
- * @returns true if field should be disabled, false if enabled
179
- *
180
- * @example
181
- * ```typescript
182
- * const conditions = {
183
- * disabledWhen: { field: 'orderStatus', operator: 'equal', value: 'completed' }
184
- * };
185
- * const disabled = isFieldDisabled(conditions, { orderStatus: 'completed' });
186
- * // disabled = true
187
- * ```
188
- */
189
- static isFieldDisabled(conditions: FormComponentConditions | undefined, formValues: Record<string, FormValueType>): boolean;
190
- /**
191
- * Check if field should be hidden
192
- *
193
- * Evaluates hideWhen condition. Defaults to false (visible) if no condition
194
- * is defined or on error.
195
- *
196
- * @param conditions - FormComponentConditions containing hideWhen rule
197
- * @param formValues - Current form field values
198
- * @returns true if field should be hidden, false if visible
199
- *
200
- * @example
201
- * ```typescript
202
- * const conditions = {
203
- * hideWhen: { field: 'hideEmail', operator: 'equal', value: true }
204
- * };
205
- * const hidden = isFieldHidden(conditions, { hideEmail: true });
206
- * // hidden = true
207
- * ```
208
- */
209
- static isFieldHidden(conditions: FormComponentConditions | undefined, formValues: Record<string, FormValueType>): boolean;
210
- /**
211
- * Check if field should be required
212
- *
213
- * Evaluates requiredWhen condition. Defaults to false (not required) if no condition
214
- * is defined or on error.
215
- *
216
- * @param conditions - FormComponentConditions containing requiredWhen rule
217
- * @param formValues - Current form field values
218
- * @returns true if field should be required, false if optional
219
- *
220
- * @example
221
- * ```typescript
222
- * const conditions = {
223
- * requiredWhen: { field: 'requireDetails', operator: 'equal', value: true }
224
- * };
225
- * const required = isFieldRequired(conditions, { requireDetails: true });
226
- * // required = true
227
- * ```
228
- */
229
- static isFieldRequired(conditions: FormComponentConditions | undefined, formValues: Record<string, FormValueType>): boolean;
230
- /**
231
- * Get value to set for field if condition is met
232
- *
233
- * Evaluates setValueWhen condition and returns the value to assign if true.
234
- * Returns undefined if no condition is defined, condition not met, or on error.
235
- *
236
- * @param conditions - FormComponentConditions containing setValueWhen rule
237
- * @param formValues - Current form field values
238
- * @returns The value to set if condition met, undefined otherwise
239
- *
240
- * @example
241
- * ```typescript
242
- * const conditions = {
243
- * setValueWhen: {
244
- * condition: { field: 'country', operator: 'equal', value: 'US' },
245
- * value: 'United States'
246
- * }
247
- * };
248
- * const value = getConditionalValue(conditions, { country: 'US' });
249
- * // value = 'United States'
250
- * ```
251
- */
252
- static getConditionalValue(conditions: FormComponentConditions | undefined, formValues: Record<string, FormValueType>): any;
253
- /**
254
- * Evaluate conditional data availability
255
- * Returns true if any conditional data rule's condition is met
256
- *
257
- * @param conditionalDataRules - Array of ConditionalDataRule objects
258
- * @param formValues - Current form field values
259
- * @returns Index of first matching rule, or -1 if none match
260
- */
261
- static evaluateConditionalDataRules(conditionalDataRules: ConditionalDataRule[] | undefined, formValues: Record<string, FormValueType>): number;
262
- /**
263
- * Get filtered options for a dependent dropdown based on choice-based field rule
264
- *
265
- * If choiceBasedField rule exists and primary field has a value,
266
- * return only the mapped dependent options for that primary value.
267
- * Otherwise return all options.
268
- *
269
- * @param rule - ChoiceBasedFieldRule configuration
270
- * @param allDependentOptions - Complete list of dependent field options
271
- * @param formValues - Current form values
272
- * @param primaryFieldId - ID of primary field
273
- * @returns Filtered options array
274
- *
275
- * @example
276
- * ```typescript
277
- * const rule = {
278
- * primaryFieldId: 'dept-id',
279
- * choiceMapping: {
280
- * 'Marketing': ['Markers', 'Sticky Notes'],
281
- * 'Finance': ['Calculator']
282
- * }
283
- * };
284
- *
285
- * const filtered = ConditionalRuleEngine.getChoiceBasedOptions(
286
- * rule,
287
- * ['Markers', 'Sticky Notes', 'Calculator'],
288
- * { 'dept-id': 'Marketing' },
289
- * 'dept-id'
290
- * );
291
- * // Returns: ['Markers', 'Sticky Notes']
292
- * ```
293
- */
294
- static getChoiceBasedOptions(rule: ChoiceBasedFieldRule, allDependentOptions: string[], formValues: Record<string, FormValueType>, primaryFieldId: string): string[];
295
- }