src/lib/window-config.ts
Properties |
|
| actions |
actions:
|
Type : WindowActions<D>
|
| Optional |
| data |
data:
|
Type : D
|
| Optional |
| draggable |
draggable:
|
Type : boolean
|
| Optional |
| height |
height:
|
Type : string
|
| Optional |
| icon |
icon:
|
Type : IconConfig
|
| Optional |
| id |
id:
|
Type : string
|
| Optional |
| maxHeight |
maxHeight:
|
Type : string
|
| Optional |
| maxWidth |
maxWidth:
|
Type : string
|
| Optional |
| minHeight |
minHeight:
|
Type : string
|
| Optional |
| minimizable |
minimizable:
|
Type : boolean
|
| Optional |
| minWidth |
minWidth:
|
Type : string
|
| Optional |
| panelClass |
panelClass:
|
Type : string
|
| Optional |
| resizeable |
resizeable:
|
Type : boolean
|
| Optional |
| title |
title:
|
Type : string
|
| Optional |
| width |
width:
|
Type : string
|
| Optional |
import { ComponentType } from '@angular/cdk/portal';
import {
ComponentFactoryResolver,
Injector,
TemplateRef,
ViewContainerRef,
} from '@angular/core';
import { ButtonDefinition } from '@rxap/rxjs';
import { IconConfig } from '@rxap/utilities';
export interface WindowActions<A> {
position?: 'start' | 'end';
definitions: ButtonDefinition<[ A ]>[];
}
export interface WindowSettings<D = any> {
id?: string;
title?: string;
icon?: IconConfig;
width?: string;
height?: string;
minWidth?: string;
minHeight?: string;
maxWidth?: string;
maxHeight?: string;
resizeable?: boolean;
minimizable?: boolean;
draggable?: boolean;
panelClass?: string;
data?: D;
actions?: WindowActions<D>;
}
export interface WindowConfig<D = any, T = any> extends WindowSettings<D> {
windowComponent?: ComponentType<T>;
component?: ComponentType<T>;
template?: TemplateRef<T>;
injector?: Injector | null;
injectorName?: string;
componentFactoryResolver?: ComponentFactoryResolver | null;
viewContainerRef?: ViewContainerRef | null;
}
export const DEFAULT_WINDOW_CONFIG: WindowConfig<any, any> = {
resizeable: true,
draggable: true,
injector: null,
componentFactoryResolver: null,
minWidth: '384px',
minHeight: '192px',
maxWidth: '100vw',
maxHeight: '100vh',
minimizable: false,
};