@focuson/form_components
Version:
Components that can be used by @focuson/forms
91 lines (90 loc) • 2.35 kB
TypeScript
import { LensState } from "@focuson/state";
import { NameAnd, PageMode } from "@focuson/utils";
import { InputChangeCommands } from "@focuson/rest";
export interface CommonComponentProps {
id: string;
name?: string;
ariaLabel?: string;
mode?: PageMode;
required?: boolean;
}
export interface CommonStateProps<S, T, Context> extends CommonComponentProps {
state: LensState<S, T, Context>;
}
export interface InputEnabledProps {
enabledBy?: string[][];
}
export interface DropDownOnChangeProps<S, Context> extends InputOnChangeProps<S, Context> {
parentState?: LensState<S, any, Context>;
specificOnChange?: NameAnd<InputChangeCommands | InputChangeCommands[]>;
}
export interface InputOnChangeProps<S, Context> {
parentState?: LensState<S, any, Context>;
onChange?: InputChangeCommands | InputChangeCommands[];
regexForChange?: string;
}
export declare enum ContactTitle {
X = "",
MR = "Mr",
MRS = "Mrs",
MISS = "Miss",
MS = "Ms",
DR = "Dr",
REV = "Rev",
PROF = "Prof",
SIR = "Sir",
CAPTAIN = "Captain",
LADY = "Lady",
MAJOR = "Major",
MASTER = "Master",
LORD = "Lord",
COLONEL = "Colonel",
BARON = "Baron",
VISCOUNT = "Viscount",
BRIGADIER = "Brigadier",
LIEUT_COL = "Lieut Col",
FRAU = "Frau",
HERR = "Herr",
FATHER = "Father",
MESSRS = "Messrs",
MADAM = "Madam"
}
export declare const CustomerStatus: {
X: string;
E: string;
S: string;
C: string;
R: string;
T: string;
U: string;
H: string;
};
export declare const YesNo: {
X: string;
N: string;
Y: string;
};
export declare const EmploymentType: {
0: string;
1: string;
2: string;
3: string;
};
export declare const HowOften: {
0: string;
1: string;
2: string;
3: string;
4: string;
5: string;
6: string;
};
export interface CustomButtonType {
buttonType?: 'primary' | 'secondary' | 'default';
}
export declare const getButtonClassName: (buttonType: string | undefined) => "primary-btn" | "secondary-btn" | "button";
export interface LabelAlignment {
labelPosition?: 'Horizontal' | 'Vertical';
}
export declare function lastIndexOf<T>(ts: T[], fn: (t: T) => boolean): number;
export declare function trimDownText(s: string, trimDownToSize: number): string;