feat: add conditional logic types (ConditionOperator, ConditionRule, FieldConditions)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Luca Oelfke 2026-02-13 20:33:54 +01:00
parent ad9a2cfbb0
commit e334ad7aab

View file

@ -17,6 +17,31 @@ export type FieldType =
| 'color'
| 'time';
// ---------------------------------------------------------------------------
// Conditional Logic
// ---------------------------------------------------------------------------
export type ConditionOperator =
| 'equals'
| 'not_equals'
| 'contains'
| 'not_contains'
| 'is_empty'
| 'is_not_empty'
| 'greater_than'
| 'less_than';
export interface ConditionRule {
fieldId: string;
operator: ConditionOperator;
value?: unknown;
}
export interface FieldConditions {
logic: 'and' | 'or';
rules: ConditionRule[];
}
export interface FormField {
id: string;
label: string;
@ -34,6 +59,8 @@ export interface FormField {
max?: number;
/** For slider: step increment. */
step?: number;
/** Conditional visibility rules. If undefined, field is always visible. */
conditions?: FieldConditions;
}
// ---------------------------------------------------------------------------