drawer.component.d.ts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';
  6. import { Direction, Directionality } from '@angular/cdk/bidi';
  7. import { Overlay, OverlayKeyboardDispatcher, OverlayRef } from '@angular/cdk/overlay';
  8. import { CdkPortalOutlet, TemplatePortal } from '@angular/cdk/portal';
  9. import { AfterViewInit, ChangeDetectorRef, ComponentRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges, TemplateRef, Type, ViewContainerRef } from '@angular/core';
  10. import { Observable, Subject } from 'rxjs';
  11. import { NzConfigKey, NzConfigService } from 'ng-zorro-antd/core/config';
  12. import { NgStyleInterface, NzSafeAny } from 'ng-zorro-antd/core/types';
  13. import { isTemplateRef } from 'ng-zorro-antd/core/util';
  14. import { NzDrawerOptionsOfComponent, NzDrawerPlacement, NzDrawerSize } from './drawer-options';
  15. import { NzDrawerRef } from './drawer-ref';
  16. import * as i0 from "@angular/core";
  17. export declare const DRAWER_ANIMATE_DURATION = 300;
  18. export declare class NzDrawerComponent<T extends {} = NzSafeAny, R = NzSafeAny, D extends Partial<T> = NzSafeAny> extends NzDrawerRef<T, R> implements OnInit, OnDestroy, AfterViewInit, OnChanges, NzDrawerOptionsOfComponent {
  19. private cdr;
  20. nzConfigService: NzConfigService;
  21. private renderer;
  22. private overlay;
  23. private injector;
  24. private changeDetectorRef;
  25. private focusTrapFactory;
  26. private viewContainerRef;
  27. private overlayKeyboardDispatcher;
  28. private directionality;
  29. readonly _nzModuleName: NzConfigKey;
  30. nzContent: TemplateRef<{
  31. $implicit: D;
  32. drawerRef: NzDrawerRef<R>;
  33. }> | Type<T>;
  34. nzCloseIcon: string | TemplateRef<void>;
  35. nzClosable: boolean;
  36. nzMaskClosable: boolean;
  37. nzMask: boolean;
  38. nzCloseOnNavigation: boolean;
  39. nzNoAnimation: boolean;
  40. nzKeyboard: boolean;
  41. nzTitle?: string | TemplateRef<{}>;
  42. nzExtra?: string | TemplateRef<{}>;
  43. nzFooter?: string | TemplateRef<{}>;
  44. nzPlacement: NzDrawerPlacement;
  45. nzSize: NzDrawerSize;
  46. nzMaskStyle: NgStyleInterface;
  47. nzBodyStyle: NgStyleInterface;
  48. nzWrapClassName?: string;
  49. nzWidth?: number | string;
  50. nzHeight?: number | string;
  51. nzZIndex: number;
  52. nzOffsetX: number;
  53. nzOffsetY: number;
  54. private componentInstance;
  55. private componentRef;
  56. set nzVisible(value: boolean);
  57. get nzVisible(): boolean;
  58. readonly nzOnViewInit: EventEmitter<void>;
  59. readonly nzOnClose: EventEmitter<MouseEvent>;
  60. readonly nzVisibleChange: EventEmitter<boolean>;
  61. drawerTemplate: TemplateRef<void>;
  62. bodyPortalOutlet?: CdkPortalOutlet;
  63. contentFromContentChild?: TemplateRef<NzSafeAny>;
  64. private destroy$;
  65. previouslyFocusedElement?: HTMLElement;
  66. placementChanging: boolean;
  67. placementChangeTimeoutId?: ReturnType<typeof setTimeout>;
  68. nzContentParams?: NzSafeAny;
  69. nzData?: D;
  70. overlayRef?: OverlayRef | null;
  71. portal?: TemplatePortal;
  72. focusTrap?: FocusTrap;
  73. isOpen: boolean;
  74. inAnimation: boolean;
  75. templateContext: {
  76. $implicit: D | undefined;
  77. drawerRef: NzDrawerRef<R>;
  78. };
  79. protected isTemplateRef: typeof isTemplateRef;
  80. get offsetTransform(): string | null;
  81. get transform(): string | null;
  82. get width(): string | null;
  83. get height(): string | null;
  84. get isLeftOrRight(): boolean;
  85. nzAfterOpen: Subject<void>;
  86. nzAfterClose: Subject<R | undefined>;
  87. get afterOpen(): Observable<void>;
  88. get afterClose(): Observable<R | undefined>;
  89. get isNzContentTemplateRef(): boolean;
  90. nzDirection?: Direction;
  91. dir: Direction;
  92. private document;
  93. constructor(cdr: ChangeDetectorRef, nzConfigService: NzConfigService, renderer: Renderer2, overlay: Overlay, injector: Injector, changeDetectorRef: ChangeDetectorRef, focusTrapFactory: FocusTrapFactory, viewContainerRef: ViewContainerRef, overlayKeyboardDispatcher: OverlayKeyboardDispatcher, directionality: Directionality);
  94. ngOnInit(): void;
  95. ngAfterViewInit(): void;
  96. ngOnChanges(changes: SimpleChanges): void;
  97. ngOnDestroy(): void;
  98. private getAnimationDuration;
  99. private triggerPlacementChangeCycleOnce;
  100. close(result?: R): void;
  101. open(): void;
  102. getContentComponent(): T | null;
  103. getContentComponentRef(): ComponentRef<T> | null;
  104. closeClick(): void;
  105. maskClick(): void;
  106. private attachBodyContent;
  107. private attachOverlay;
  108. private disposeOverlay;
  109. private getOverlayConfig;
  110. private updateOverlayStyle;
  111. private updateBodyOverflow;
  112. savePreviouslyFocusedElement(): void;
  113. private trapFocus;
  114. private restoreFocus;
  115. static ɵfac: i0.ɵɵFactoryDeclaration<NzDrawerComponent<any, any, any>, never>;
  116. static ɵcmp: i0.ɵɵComponentDeclaration<NzDrawerComponent<any, any, any>, "nz-drawer", ["nzDrawer"], { "nzContent": { "alias": "nzContent"; "required": false; }; "nzCloseIcon": { "alias": "nzCloseIcon"; "required": false; }; "nzClosable": { "alias": "nzClosable"; "required": false; }; "nzMaskClosable": { "alias": "nzMaskClosable"; "required": false; }; "nzMask": { "alias": "nzMask"; "required": false; }; "nzCloseOnNavigation": { "alias": "nzCloseOnNavigation"; "required": false; }; "nzNoAnimation": { "alias": "nzNoAnimation"; "required": false; }; "nzKeyboard": { "alias": "nzKeyboard"; "required": false; }; "nzTitle": { "alias": "nzTitle"; "required": false; }; "nzExtra": { "alias": "nzExtra"; "required": false; }; "nzFooter": { "alias": "nzFooter"; "required": false; }; "nzPlacement": { "alias": "nzPlacement"; "required": false; }; "nzSize": { "alias": "nzSize"; "required": false; }; "nzMaskStyle": { "alias": "nzMaskStyle"; "required": false; }; "nzBodyStyle": { "alias": "nzBodyStyle"; "required": false; }; "nzWrapClassName": { "alias": "nzWrapClassName"; "required": false; }; "nzWidth": { "alias": "nzWidth"; "required": false; }; "nzHeight": { "alias": "nzHeight"; "required": false; }; "nzZIndex": { "alias": "nzZIndex"; "required": false; }; "nzOffsetX": { "alias": "nzOffsetX"; "required": false; }; "nzOffsetY": { "alias": "nzOffsetY"; "required": false; }; "nzVisible": { "alias": "nzVisible"; "required": false; }; }, { "nzOnViewInit": "nzOnViewInit"; "nzOnClose": "nzOnClose"; "nzVisibleChange": "nzVisibleChange"; }, ["contentFromContentChild"], never, true, never>;
  117. static ngAcceptInputType_nzClosable: unknown;
  118. static ngAcceptInputType_nzMaskClosable: unknown;
  119. static ngAcceptInputType_nzMask: unknown;
  120. static ngAcceptInputType_nzCloseOnNavigation: unknown;
  121. static ngAcceptInputType_nzNoAnimation: unknown;
  122. static ngAcceptInputType_nzKeyboard: unknown;
  123. static ngAcceptInputType_nzVisible: unknown;
  124. }