Commit 1fc00b6e by Ooh-Ao

config

parent f83d7aee
export interface WidgetConfigField {
id: string;
label: string;
type: 'text' | 'number' | 'boolean' | 'select' | 'multiselect' | 'color' | 'file' | 'range' | 'textarea';
defaultValue: any;
options?: { value: any; label: string }[];
validation?: {
required?: boolean;
min?: number;
max?: number;
pattern?: string;
custom?: string;
};
helpText?: string;
placeholder?: string;
category?: string;
}
export interface WidgetConfigGroup {
id: string;
label: string;
description?: string;
fields: WidgetConfigField[];
collapsed?: boolean;
}
export interface WidgetConfigSchema {
widgetType: string;
displayName: string;
description: string;
icon: string;
category: string;
groups: WidgetConfigGroup[];
dataFields: WidgetConfigField[];
filterFields: WidgetConfigField[];
previewData: any[];
defaultConfig: any;
}
export interface WidgetFilterConfig {
field: string;
type: 'text' | 'number' | 'date' | 'select' | 'multiselect' | 'range';
operator?: 'equals' | 'contains' | 'greater_than' | 'less_than' | 'between' | 'in' | 'not_in';
options?: { value: any; label: string }[];
defaultValue?: any;
}
export interface DataMappingConfig {
sourceField: string;
targetField: string;
transformation?: 'none' | 'uppercase' | 'lowercase' | 'capitalize' | 'format_date' | 'format_number' | 'custom';
customFunction?: string;
}
export interface WidgetStyleConfig {
backgroundColor?: string;
textColor?: string;
borderColor?: string;
borderWidth?: number;
borderRadius?: number;
padding?: number;
margin?: number;
fontSize?: number;
fontFamily?: string;
fontWeight?: 'normal' | 'bold' | 'lighter' | 'bolder';
customCSS?: string;
theme?: 'light' | 'dark' | 'auto';
}
export interface WidgetAnimationConfig {
enableAnimations?: boolean;
animationType?: 'fade' | 'slide' | 'bounce' | 'pulse' | 'none';
animationDuration?: number;
animationDelay?: number;
hoverEffects?: boolean;
}
export interface WidgetLayoutConfig {
width?: number;
height?: number;
minWidth?: number;
minHeight?: number;
maxWidth?: number;
maxHeight?: number;
aspectRatio?: string;
responsive?: boolean;
breakpoints?: {
mobile?: any;
tablet?: any;
desktop?: any;
};
}
export interface WidgetInteractionConfig {
enableTooltip?: boolean;
enableClick?: boolean;
enableHover?: boolean;
enableSelection?: boolean;
enableExport?: boolean;
enableRefresh?: boolean;
clickAction?: 'none' | 'drill_down' | 'open_modal' | 'navigate' | 'custom';
customClickHandler?: string;
}
export interface WidgetDataConfig {
dataSource?: 'static' | 'api' | 'websocket' | 'file';
apiEndpoint?: string;
refreshInterval?: number;
cacheEnabled?: boolean;
cacheDuration?: number;
dataTransform?: string;
pagination?: {
enabled: boolean;
pageSize: number;
pageSizeOptions: number[];
};
}
export interface WidgetSecurityConfig {
requireAuth?: boolean;
allowedRoles?: string[];
dataEncryption?: boolean;
auditLog?: boolean;
rateLimit?: number;
}
export interface CompleteWidgetConfig {
basic: any;
style: WidgetStyleConfig;
animation: WidgetAnimationConfig;
layout: WidgetLayoutConfig;
interaction: WidgetInteractionConfig;
data: WidgetDataConfig;
security: WidgetSecurityConfig;
filters: WidgetFilterConfig[];
dataMapping: DataMappingConfig[];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment