summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-form-modal-field-config.ts
blob: e327be59a27a45722f8b28f85a14604273611994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { ValidatorFn } from '@angular/forms';

export class CdFormModalFieldConfig {
  // --- Generic field properties ---
  name: string;
  // 'binary' will use cdDimlessBinary directive on input element
  // 'select' will use select element
  type: 'number' | 'text' | 'binary' | 'select' | 'select-badges';
  label?: string;
  required?: boolean;
  value?: any;
  errors?: { [errorName: string]: string };
  validators: ValidatorFn[];

  // --- Specific field properties ---
  typeConfig?: {
    [prop: string]: any;
    // 'select':
    // ---------
    // placeholder?: string;
    // options?: Array<{
    //   text: string;
    //   value: any;
    // }>;
    //
    // 'select-badges':
    // ----------------
    // customBadges: boolean;
    // options: Array<SelectOption>;
    // messages: SelectMessages;
  };
}