@apexcura/ui-builder
Version:
A low-code UI builder library for dynamic form generation and reusable components built with React, Redux, Tailwind, and Ant Design.
327 lines (326 loc) • 9.18 kB
TypeScript
import { InputRef, UploadFile } from 'antd';
import { SizeType } from 'antd/es/config-provider/SizeContext';
import { RadioGroupButtonStyle } from 'antd/es/radio';
import { TabsPosition } from 'antd/es/tabs';
import { TooltipPlacement } from 'antd/es/tooltip';
import React, { CSSProperties, JSXElementConstructor, LegacyRef, ReactElement, ReactNode } from 'react';
type PaginationType = {
name?: string;
page?: number;
pageSize?: number;
};
type DateRangeSegmentType = {
values?: string[];
segmentedValue?: string;
};
interface ScheduleType {
from: string | null;
to: string | null;
}
interface WeekSchedule {
Sunday: ScheduleType;
Monday: ScheduleType;
Tuesday: ScheduleType;
Wednesday: ScheduleType;
Thursday: ScheduleType;
Friday: ScheduleType;
Saturday: ScheduleType;
}
type dropDownValueProps = {
firstValue: {
key?: string | undefined;
label?: string | undefined;
value?: string | undefined;
} | undefined;
secondValue: {
key?: string | undefined;
label?: string | undefined;
value?: string | undefined;
} | undefined;
};
type radioValueProps = {
value: {
key?: string | undefined;
label?: string | undefined;
value?: string | undefined;
} | undefined;
};
type autoCompleteProps = {
value?: {
key?: string;
value?: string;
};
};
interface ChildRecordType {
_id?: string;
id?: string;
name?: string;
label?: string;
element?: string;
type?: string;
value?: boolean;
children?: ChildRecordType[];
}
export type ElementType = {
src?: string;
disabledColor?: string;
tooltip?: {
title: string;
placement: 'top' | 'bottom' | 'left' | 'right';
};
varient?: 'solid' | 'outlined' | 'light';
color?: string;
buttonStyle?: RadioGroupButtonStyle;
tableHeight?: string;
buttonVariant?: string;
optionRender?: (option: {
key?: string | number | bigint;
label?: string | ReactNode;
value?: string | number;
color?: string;
}) => React.ReactNode;
active?: number;
visitedClassName?: string;
accept?: string | undefined;
max_count?: number | undefined;
multiple?: boolean | undefined;
activeClassName?: string;
fileList?: UploadFile[];
radioGroupClassName?: string | undefined;
selectedStyle?: boolean;
style?: CSSProperties;
firstValue?: string;
secondValue?: string;
className?: string | undefined;
placeholder?: string;
addonBefore?: React.ReactNode;
format?: string;
indexWidth?: number;
tabPosition?: TabsPosition;
defaultValue?: string | {
label: string;
value: string;
search?: string;
};
limit?: number;
ref?: LegacyRef<InputRef> | undefined;
disabled?: boolean;
prefix?: React.ReactNode;
type?: string;
searchable?: boolean;
expandIcon?: boolean;
params?: any;
rootState?: string;
bordered?: boolean;
size?: SizeType | number;
colWidth?: string;
errorText?: string;
errorClassName?: string;
expandIconStyles?: boolean;
enableRowSelection?: boolean;
showSelectionControls?: boolean;
isIconOnly?: boolean;
value?: string | number | boolean | null | object | undefined | string[] | UploadFile[] | PaginationType | DateRangeSegmentType | dropDownValueProps | radioValueProps | WeekSchedule | autoCompleteProps;
status?: string | undefined;
styles?: React.CSSProperties;
variant?: 'outlined' | 'borderless' | 'filled';
enable_all?: boolean;
label?: string;
name?: string;
suffix?: React.ReactNode;
rowClickExpandable?: boolean;
expandable?: boolean;
maxLength?: number;
sortable?: boolean;
indexClickable?: boolean;
splitButton?: {
value: string;
icon: string;
label: string;
isSVGStylesOverride: boolean;
tooltip: string;
}[];
options?: {
key?: string;
label?: string;
value?: string;
icon?: string;
tooltip?: string;
color?: string;
}[];
firstOptions?: {
key?: string;
label: string;
value: string;
}[];
secondOptions?: {
key?: string;
label?: string;
value?: string;
}[];
firstPlaceholder?: string;
secondPlaceholder?: string;
view?: boolean;
enabled_dates?: string;
onChange?: (value: string | number | boolean | object | object[] | undefined) => void;
onClick?: (value: string | number | boolean | object | object[] | undefined) => void;
dropDownOptions?: (number | string | boolean | object | null | undefined | (() => void))[];
id?: number | string;
fullHeight?: boolean;
thead?: {
width?: number;
_id?: string;
name?: string;
label?: string;
visible?: boolean;
required?: boolean;
key?: string;
render?: (text: string) => React.JSX.Element;
renderCell?: (value: number, record: string, index: number) => React.ReactNode;
ellipsis?: boolean;
sortable?: boolean;
filtered?: boolean;
filters?: {
text: string;
value: string;
}[];
fixed?: string | boolean | undefined;
disabled?: boolean;
clickable?: boolean;
}[];
childHead?: {
_id?: string;
name?: string;
label?: string;
visible?: boolean;
required?: boolean;
key?: string;
render?: (text: string) => React.JSX.Element;
ellipsis?: boolean;
sortable?: boolean;
filtered?: boolean;
filters?: {
text: string;
value: string;
}[];
}[];
tbody?: ChildRecordType[];
optionType?: string;
selectedClassName?: string;
action?: React.MouseEventHandler<HTMLElement> | string;
listClassName?: string;
listItemClassName?: string;
img?: string;
video?: string;
height?: number;
width?: number;
imgExpand?: string;
segmentedValue?: string;
useSegments?: string;
imgCollapse?: string;
items?: {
id?: number;
key?: number | string;
element?: string;
icon?: string;
label?: string;
active?: number;
text?: string;
time?: string;
name?: string;
data?: any;
y?: number;
color?: string;
isCount?: boolean;
count?: number;
isNewMenuItem?: boolean;
progress?: number;
className?: string;
contact?: string;
status?: string;
assignedTo?: string;
user?: string;
dot?: React.ReactNode;
children?: string;
}[];
primaryText?: string;
secondaryText?: string;
count?: number;
icon?: string;
placement?: TooltipPlacement;
profileImage?: string;
buttonClassName?: string;
profileImageClassName?: string;
profileSubClassName?: string;
subContainerClassName?: string;
element?: string;
secondTextClassName?: string;
iconClassName?: string;
iconsClassName?: string;
labelClassName?: string;
containerClassName?: string;
isSVGStylesOverride?: boolean;
rowSelection?: string;
length?: number;
imgClassName?: string;
loading?: boolean;
fillText1?: string;
fillText2?: string;
pagination?: boolean;
antdButton?: boolean;
required?: boolean;
is_detail?: boolean;
checkedChildren?: string;
unCheckedChildren?: string;
dateTime?: string;
isDateTime?: boolean;
minRows?: number;
maxRows?: number;
isSearch?: boolean;
mode?: 'multiple' | 'tags' | undefined;
picker?: 'date' | 'week' | 'month' | 'quarter' | 'year';
weekrange?: boolean;
rangePresets?: boolean;
message?: string;
isStatus?: boolean;
isDelete?: boolean;
description?: string;
notificationType?: 'success' | 'info' | 'warning' | 'error';
showProgress?: boolean;
isLoading?: boolean;
isNotChatbot?: boolean;
allowClear?: boolean;
isBack?: boolean;
showCount?: boolean;
avatarClassName?: string;
segmentedOptions?: string[] | {
tooltip: string;
label: string;
value: string;
}[];
manageRadioButton?: boolean;
cardClassname?: string;
autoFocus?: boolean;
titleClassName?: string;
fileType?: string[];
fileSize?: number;
allowOne?: boolean;
showSerialNumber?: boolean;
isTextSelect?: boolean;
autoSize?: boolean;
rowClick?: boolean;
dropdownRender?: (menu: ReactElement<string | JSXElementConstructor<string>>) => ReactElement<string | JSXElementConstructor<string>>;
isopen?: boolean;
clickedVal?: string;
customColor?: boolean;
};
export type Colors = 'blue-green' | 'danger' | 'facebook' | 'instagram' | 'primary' | 'secondary' | 'success' | 'turquoise' | 'warning' | 'yellow';
export interface HandlerDefinition {
args: any;
action: string;
name: string;
type: string;
code: string;
params?: string[];
}
export {};