Files
ox_lib/web/src/interfaces/dialog.ts

113 lines
2.2 KiB
TypeScript
Raw Normal View History

2022-08-27 15:58:36 +02:00
import { IconProp } from '@fortawesome/fontawesome-svg-core';
export interface IInput {
2022-08-27 15:58:36 +02:00
type: 'input';
label: string;
placeholder?: string;
default?: string;
password?: boolean;
icon?: IconProp;
disabled?: boolean;
description?: string;
2023-01-08 11:35:30 +01:00
required?: boolean;
}
export interface ICheckbox {
2022-08-27 15:58:36 +02:00
type: 'checkbox';
label: string;
checked?: boolean;
disabled?: boolean;
description?: string;
2023-01-08 11:35:30 +01:00
required?: boolean;
}
export type OptionValue = { value: string; label?: string };
export interface ISelect {
2023-01-15 11:54:15 +01:00
type: 'select' | 'multi-select';
label: string;
2023-01-15 11:54:15 +01:00
default?: string | string[];
options: Array<OptionValue>;
disabled?: boolean;
description?: string;
2023-01-08 11:35:30 +01:00
required?: boolean;
clearable?: boolean;
2023-01-09 14:39:49 +01:00
icon?: IconProp;
}
export interface INumber {
2022-08-27 15:58:36 +02:00
type: 'number';
label: string;
placeholder?: string;
default?: number;
icon?: IconProp;
2022-08-27 15:58:36 +02:00
min?: number;
max?: number;
disabled?: boolean;
description?: string;
2023-01-08 11:35:30 +01:00
required?: boolean;
}
export interface ISlider {
2022-08-27 15:58:36 +02:00
type: 'slider';
label: string;
default?: number;
min?: number;
max?: number;
step?: number;
disabled?: boolean;
description?: string;
}
2023-01-08 11:23:50 +01:00
export interface IColorInput {
type: 'color';
label: string;
default?: string;
disabled?: boolean;
description?: string;
format?: 'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla';
2023-01-08 11:35:30 +01:00
required?: boolean;
icon?: IconProp;
2023-01-08 11:23:50 +01:00
}
2023-01-13 19:09:07 +01:00
export interface IDateInput {
type: 'date' | 'date-range';
2023-01-13 19:09:07 +01:00
label: string;
2023-01-14 14:15:38 +01:00
default?: string | [string, string] | true;
2023-01-13 19:09:07 +01:00
disabled?: boolean;
description?: string;
format?: '12' | '24' | undefined;
2023-01-13 19:09:07 +01:00
required?: boolean;
placeholder?: string;
2023-01-14 13:36:30 +01:00
clearable?: boolean;
min?: string;
max?: string;
icon?: IconProp;
2023-01-13 19:09:07 +01:00
}
2023-01-15 11:44:14 +01:00
export interface ITimeInput {
type: 'time';
label: string;
default?: string;
disabled?: boolean;
description?: string;
format?: '12' | '24';
required?: boolean;
clearable?: boolean;
placeholder?: string;
icon?: IconProp;
}
2023-01-15 11:44:14 +01:00
export interface ITextarea {
type: 'textarea';
label: string;
default?: string;
disabled?: boolean;
description?: string;
required?: boolean;
placeholder?: string;
icon?: IconProp;
autosize?: boolean;
min?: number;
max?: number;
}