|
|
@ -27,6 +27,11 @@ export interface FormPropGroup { |
|
|
className?: string; |
|
|
className?: string; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export interface FormPropTooltip { |
|
|
|
|
|
text: string; |
|
|
|
|
|
placement?: 'top' | 'end' | 'bottom' | 'start'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
export class GroupedFormPropList<R = any> { |
|
|
export class GroupedFormPropList<R = any> { |
|
|
public readonly items: GroupedFormPropItem[] = []; |
|
|
public readonly items: GroupedFormPropItem[] = []; |
|
|
addItem(item: FormProp<R>) { |
|
|
addItem(item: FormProp<R>) { |
|
|
@ -72,6 +77,7 @@ export class FormProp<R = any> extends Prop<R> { |
|
|
readonly group?: FormPropGroup | undefined; |
|
|
readonly group?: FormPropGroup | undefined; |
|
|
readonly displayTextResolver?: PropDisplayTextResolver<R>; |
|
|
readonly displayTextResolver?: PropDisplayTextResolver<R>; |
|
|
readonly formText?: string; |
|
|
readonly formText?: string; |
|
|
|
|
|
readonly tooltip?: FormPropTooltip; |
|
|
|
|
|
|
|
|
constructor(options: FormPropOptions<R>) { |
|
|
constructor(options: FormPropOptions<R>) { |
|
|
super( |
|
|
super( |
|
|
@ -84,10 +90,12 @@ export class FormProp<R = any> extends Prop<R> { |
|
|
options.template, |
|
|
options.template, |
|
|
options.className, |
|
|
options.className, |
|
|
options.formText, |
|
|
options.formText, |
|
|
|
|
|
options.tooltip, |
|
|
); |
|
|
); |
|
|
this.group = options.group; |
|
|
this.group = options.group; |
|
|
this.className = options.className; |
|
|
this.className = options.className; |
|
|
this.formText = options.formText; |
|
|
this.formText = options.formText; |
|
|
|
|
|
this.tooltip = options.tooltip; |
|
|
this.asyncValidators = options.asyncValidators || (_ => []); |
|
|
this.asyncValidators = options.asyncValidators || (_ => []); |
|
|
this.validators = options.validators || (_ => []); |
|
|
this.validators = options.validators || (_ => []); |
|
|
this.disabled = options.disabled || (_ => false); |
|
|
this.disabled = options.disabled || (_ => false); |
|
|
@ -135,6 +143,7 @@ export type FormPropOptions<R = any> = O.Optional< |
|
|
| 'id' |
|
|
| 'id' |
|
|
| 'displayTextResolver' |
|
|
| 'displayTextResolver' |
|
|
| 'formText' |
|
|
| 'formText' |
|
|
|
|
|
| 'tooltip' |
|
|
>; |
|
|
>; |
|
|
|
|
|
|
|
|
export type CreateFormPropDefaults<R = any> = Record<string, FormProp<R>[]>; |
|
|
export type CreateFormPropDefaults<R = any> = Record<string, FormProp<R>[]>; |
|
|
|