145 lines
7.2 KiB
TypeScript
145 lines
7.2 KiB
TypeScript
import * as i0 from '@angular/core';
|
|
import { OnInit, EventEmitter, AfterViewInit, OnDestroy, ElementRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
import { Subject } from 'rxjs';
|
|
|
|
type NzCursorType = 'window' | 'grid';
|
|
type NzResizeDirection = 'top' | 'right' | 'bottom' | 'left' | 'topRight' | 'bottomRight' | 'bottomLeft' | 'topLeft';
|
|
declare class NzResizeHandleMouseDownEvent {
|
|
direction: NzResizeDirection;
|
|
mouseEvent: MouseEvent | TouchEvent;
|
|
constructor(direction: NzResizeDirection, mouseEvent: MouseEvent | TouchEvent);
|
|
}
|
|
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>;
|
|
}
|
|
|
|
interface NzResizeEvent {
|
|
width?: number;
|
|
height?: number;
|
|
col?: number;
|
|
mouseEvent?: MouseEvent | TouchEvent;
|
|
direction?: NzResizeDirection;
|
|
}
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
|
|
declare const DEFAULT_RESIZE_DIRECTION: NzResizeDirection[];
|
|
interface NzResizeHandleOption {
|
|
direction: NzResizeDirection;
|
|
cursorType: NzCursorType;
|
|
}
|
|
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>;
|
|
}
|
|
|
|
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>;
|
|
}
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
|
|
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<NzResizableService>;
|
|
}
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
declare function getEventWithPoint(event: MouseEvent | TouchEvent): MouseEvent | Touch;
|
|
|
|
export { DEFAULT_RESIZE_DIRECTION, NzResizableDirective, NzResizableModule, NzResizableService, NzResizeHandleComponent, NzResizeHandleMouseDownEvent, NzResizeHandlesComponent, getEventWithPoint };
|
|
export type { NzCursorType, NzResizeDirection, NzResizeEvent, NzResizeHandleOption };
|