ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
199 lines • 7.34 kB
TypeScript
import * as i0 from "@angular/core";
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
import { Subject } from "rxjs";
declare namespace resize_handle_component_d_exports {
export { NzCursorType, NzResizeDirection, NzResizeHandleComponent, NzResizeHandleMouseDownEvent };
}
export type NzCursorType = 'window' | 'grid';
export type NzResizeDirection = 'top' | 'right' | 'bottom' | 'left' | 'topRight' | 'bottomRight' | 'bottomLeft' | 'topLeft';
export declare class NzResizeHandleMouseDownEvent {
direction: NzResizeDirection;
mouseEvent: MouseEvent | TouchEvent;
constructor(direction: NzResizeDirection, mouseEvent: MouseEvent | TouchEvent);
}
export declare class NzResizeHandleComponent implements OnInit {
private readonly nzResizableService;
private readonly renderer;
private readonly el;
private readonly destroyRef;
nzDirection: NzResizeDirection;
nzCursorType: NzCursorType;
readonly nzMouseDown: EventEmitter<NzResizeHandleMouseDownEvent>;
ngOnInit(): void;
onPointerDown(event: PointerEvent): void;
onPointerUp(event: PointerEvent): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzResizeHandleComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzResizeHandleComponent, "nz-resize-handle, [nz-resize-handle]", ["nzResizeHandle"], {
"nzDirection": {
"alias": "nzDirection";
"required": false;
};
"nzCursorType": {
"alias": "nzCursorType";
"required": false;
};
}, {
"nzMouseDown": "nzMouseDown";
}, never, ["*"], true, never>;
}
declare namespace resizable_directive_d_exports {
export { NzResizableDirective, NzResizeEvent };
}
export interface NzResizeEvent {
width?: number;
height?: number;
col?: number;
mouseEvent?: MouseEvent | TouchEvent;
direction?: NzResizeDirection;
}
export declare class NzResizableDirective implements AfterViewInit, OnDestroy {
private readonly elementRef;
private readonly renderer;
private readonly nzResizableService;
private readonly platform;
private readonly ngZone;
private readonly destroyRef;
nzBounds: 'window' | 'parent' | ElementRef<HTMLElement>;
nzMaxHeight?: number;
nzMaxWidth?: number;
nzMinHeight: number;
nzMinWidth: number;
nzGridColumnCount: number;
nzMaxColumn: number;
nzMinColumn: number;
nzLockAspectRatio: boolean;
nzPreview: boolean;
nzDisabled: boolean;
readonly nzResize: EventEmitter<NzResizeEvent>;
readonly nzResizeEnd: EventEmitter<NzResizeEvent>;
readonly nzResizeStart: EventEmitter<NzResizeEvent>;
resizing: boolean;
private elRect;
private currentHandleEvent;
private ghostElement;
private el;
private sizeCache;
constructor();
setPosition(): void;
calcSize(width: number, height: number, ratio: number): NzResizeEvent;
resize(event: MouseEvent | TouchEvent): void;
endResize(event: MouseEvent | TouchEvent): void;
previewResize({ width, height }: NzResizeEvent): void;
createGhostElement(): void;
removeGhostElement(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzResizableDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<NzResizableDirective, "[nz-resizable]", ["nzResizable"], {
"nzBounds": {
"alias": "nzBounds";
"required": false;
};
"nzMaxHeight": {
"alias": "nzMaxHeight";
"required": false;
};
"nzMaxWidth": {
"alias": "nzMaxWidth";
"required": false;
};
"nzMinHeight": {
"alias": "nzMinHeight";
"required": false;
};
"nzMinWidth": {
"alias": "nzMinWidth";
"required": false;
};
"nzGridColumnCount": {
"alias": "nzGridColumnCount";
"required": false;
};
"nzMaxColumn": {
"alias": "nzMaxColumn";
"required": false;
};
"nzMinColumn": {
"alias": "nzMinColumn";
"required": false;
};
"nzLockAspectRatio": {
"alias": "nzLockAspectRatio";
"required": false;
};
"nzPreview": {
"alias": "nzPreview";
"required": false;
};
"nzDisabled": {
"alias": "nzDisabled";
"required": false;
};
}, {
"nzResize": "nzResize";
"nzResizeEnd": "nzResizeEnd";
"nzResizeStart": "nzResizeStart";
}, never, never, true, never>;
static ngAcceptInputType_nzMinHeight: unknown;
static ngAcceptInputType_nzMinWidth: unknown;
static ngAcceptInputType_nzGridColumnCount: unknown;
static ngAcceptInputType_nzMaxColumn: unknown;
static ngAcceptInputType_nzMinColumn: unknown;
static ngAcceptInputType_nzLockAspectRatio: unknown;
static ngAcceptInputType_nzPreview: unknown;
static ngAcceptInputType_nzDisabled: unknown;
}
declare namespace resize_handles_component_d_exports {
export { DEFAULT_RESIZE_DIRECTION, NzResizeHandleOption, NzResizeHandlesComponent };
}
export declare const DEFAULT_RESIZE_DIRECTION: NzResizeDirection[];
export interface NzResizeHandleOption {
direction: NzResizeDirection;
cursorType: NzCursorType;
}
export declare class NzResizeHandlesComponent implements OnChanges {
nzDirections: Array<NzResizeDirection | NzResizeHandleOption>;
resizeHandleOptions: NzResizeHandleOption[];
ngOnChanges(changes: SimpleChanges): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzResizeHandlesComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzResizeHandlesComponent, "nz-resize-handles", ["nzResizeHandles"], {
"nzDirections": {
"alias": "nzDirections";
"required": false;
};
}, {}, never, never, true, never>;
}
export declare class NzResizableModule {
static ɵfac: i0.ɵɵFactoryDeclaration<NzResizableModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NzResizableModule, never, [typeof NzResizableDirective, typeof NzResizeHandleComponent, typeof NzResizeHandlesComponent], [typeof NzResizableDirective, typeof NzResizeHandleComponent, typeof NzResizeHandlesComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<NzResizableModule>;
}
export declare class NzResizableService implements OnDestroy {
private readonly document;
private readonly ngZone;
private listeners;
/**
* The `OutsideAngular` prefix means that the subject will emit events outside of the Angular zone,
* so that becomes a bit more descriptive for those who'll maintain the code in the future:
* ```ts
* nzResizableService.handleMouseDownOutsideAngular$.subscribe(event => {
* console.log(Zone.current); // <root>
* console.log(NgZone.isInAngularZone()); // false
* });
* ```
*/
handleMouseDownOutsideAngular$: Subject<NzResizeHandleMouseDownEvent>;
documentMouseUpOutsideAngular$: Subject<MouseEvent | TouchEvent | null>;
documentMouseMoveOutsideAngular$: Subject<MouseEvent | TouchEvent>;
mouseEnteredOutsideAngular$: Subject<boolean>;
startResizing(event: MouseEvent | TouchEvent): void;
private clearListeners;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzResizableService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
}
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
export declare function getEventWithPoint(event: MouseEvent | TouchEvent): MouseEvent | Touch;