@covalent/core 11.0.0-beta.2 → 11.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ElementRef, ChangeDetectorRef, EventEmitter, ComponentRef, EmbeddedViewRef, OnDestroy, Injector, Type, InjectionToken, TemplateRef, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ElementRef, ChangeDetectorRef, EventEmitter, ComponentRef, EmbeddedViewRef, OnInit, OnChanges, SimpleChanges, OnDestroy, Injector, Type, InjectionToken, TemplateRef } from '@angular/core';
3
3
  import * as _angular_material_dialog_d_hlN3f_Hk from '@angular/material/dialog.d-hlN3f-Hk';
4
4
  import { AnimationEvent } from '@angular/animations';
5
- import { ConfigurableFocusTrapFactory, FocusOrigin, FocusMonitor } from '@angular/cdk/a11y';
5
+ import { ConfigurableFocusTrapFactory, FocusOrigin } from '@angular/cdk/a11y';
6
6
  import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, DomPortal, ComponentType } from '@angular/cdk/portal';
7
7
  import { MatDialogConfig, MatDialogRef, MatDialogContainer } from '@angular/material/dialog';
8
8
  import { OverlayRef, Overlay } from '@angular/cdk/overlay';
@@ -21,13 +21,12 @@ declare class CovalentSideSheetConfig<D = any> extends MatDialogConfig<D> {
21
21
  * animations as these are left to implementers of the side-sheet container.
22
22
  */
23
23
  declare abstract class _CovalentSideSheetContainerBase extends BasePortalOutlet {
24
- protected _elementRef: ElementRef;
24
+ protected _elementRef: ElementRef<any>;
25
25
  protected _focusTrapFactory: ConfigurableFocusTrapFactory;
26
26
  protected _changeDetectorRef: ChangeDetectorRef;
27
- /** The side-sheet configuration. */
28
- _config: CovalentSideSheetConfig;
29
- private _focusMonitor?;
30
- protected _document: Document;
27
+ _config: CovalentSideSheetConfig<any>;
28
+ private _focusMonitor;
29
+ protected _document: Document | null;
31
30
  /** The portal outlet inside of this container into which the side-sheet content will be loaded. */
32
31
  _portalOutlet: CdkPortalOutlet;
33
32
  /** The class that traps and manages focus within the side-sheet. */
@@ -49,9 +48,7 @@ declare abstract class _CovalentSideSheetContainerBase extends BasePortalOutlet
49
48
  _ariaLabelledBy: string | null;
50
49
  /** ID for the container DOM element. */
51
50
  _id: string;
52
- constructor(_elementRef: ElementRef, _focusTrapFactory: ConfigurableFocusTrapFactory, _changeDetectorRef: ChangeDetectorRef, _document: any,
53
- /** The side-sheet configuration. */
54
- _config: CovalentSideSheetConfig, _focusMonitor?: FocusMonitor | undefined);
51
+ constructor();
55
52
  /** Starts the side-sheet exit animation. */
56
53
  abstract _startExitAnimation(): void;
57
54
  /** Initializes the side-sheet container with the attached content. */
@@ -89,7 +86,7 @@ declare abstract class _CovalentSideSheetContainerBase extends BasePortalOutlet
89
86
  private _focusSideSheetContainer;
90
87
  /** Returns whether focus is inside the side-sheet. */
91
88
  private _containsFocus;
92
- static ɵfac: i0.ɵɵFactoryDeclaration<_CovalentSideSheetContainerBase, [null, null, null, { optional: true; }, null, null]>;
89
+ static ɵfac: i0.ɵɵFactoryDeclaration<_CovalentSideSheetContainerBase, never>;
93
90
  static ɵdir: i0.ɵɵDirectiveDeclaration<_CovalentSideSheetContainerBase, never, never, {}, {}, never, never, true, never>;
94
91
  }
95
92
  /**
@@ -129,71 +126,11 @@ declare class CovalentSideSheetRef<T, R = any> extends MatDialogRef<T, R> {
129
126
  }
130
127
  declare function _closeSideSheetVia<R>(ref: CovalentSideSheetRef<R>, interactionType: FocusOrigin, result?: R): void;
131
128
 
132
- declare class _CovalentSideSheetBase<C extends _CovalentSideSheetContainerBase> implements OnDestroy {
133
- private _overlay;
134
- private _injector;
135
- private _defaultOptions;
136
- private _parentSideSheet;
137
- private _sideSheetRefConstructor;
138
- private _sideSheetContainerType;
139
- private _sideSheetDataToken;
140
- private _openSideSheetsAtThisLevel;
141
- private readonly _afterAllClosedAtThisLevel;
142
- private readonly _afterOpenedAtThisLevel;
143
- private _animationStateSubscriptions;
144
- private defaultSidebarConfig;
145
- constructor(_overlay: Overlay, _injector: Injector, _defaultOptions: CovalentSideSheetConfig | undefined, _parentSideSheet: _CovalentSideSheetBase<C> | undefined, _sideSheetRefConstructor: Type<CovalentSideSheetRef<any>>, _sideSheetContainerType: Type<C>, _sideSheetDataToken: InjectionToken<unknown>);
146
- /** Keeps track of the currently-open side-sheets. */
147
- get openSideSheets(): CovalentSideSheetRef<unknown>[];
148
- open<T, D = unknown, R = unknown>(componentOrTemplateRef: ComponentType<T> | TemplateRef<T>, config?: CovalentSideSheetConfig<D>): CovalentSideSheetRef<T, R>;
149
- ngOnDestroy(): void;
150
- /**
151
- * Closes all of the currently-open side-sheets.
152
- */
153
- closeAll(): void;
154
- private _createOverlay;
155
- /**
156
- * Attaches a container to a side-sheets's already-created overlay.
157
- * @param overlay Reference to the side-sheet's underlying overlay.
158
- * @param config The side-sheet configuration.
159
- * @returns A promise resolving to a ComponentRef for the attached container.
160
- */
161
- private _attachSideSheetContainer;
162
- /**
163
- * Attaches the user-provided component to the already-created side sheet container.
164
- * @param componentOrTemplateRef The type of component being loaded into the side-sheet,
165
- * or a TemplateRef to instantiate as the content.
166
- * @param dialogContainer Reference to the wrapping side-sheet container.
167
- * @param overlayRef Reference to the overlay in which the side-sheet resides.
168
- * @param config The side-sheet configuration.
169
- * @returns A promise resolving to the CovalentSideSheetRef that should be returned to the user.
170
- */
171
- private _attachSideSheetContent;
172
- private _createInjector;
173
- /**
174
- * Removes a side sheet from the array of open side sheets.
175
- * @param sideSheetRef Side Sheet to be removed.
176
- */
177
- private _removeOpenSideSheet;
178
- /** Closes all of the side-sheet in an array. */
179
- private _closeSideSheets;
180
- static ɵfac: i0.ɵɵFactoryDeclaration<_CovalentSideSheetBase<any>, never>;
181
- static ɵdir: i0.ɵɵDirectiveDeclaration<_CovalentSideSheetBase<any>, never, never, {}, {}, never, never, true, never>;
182
- }
183
- /**
184
- * Service to open Covalent Design side-sheet.
185
- */
186
- declare class CovalentSideSheet extends _CovalentSideSheetBase<CovalentSideSheetContainerComponent> {
187
- constructor(overlay: Overlay, injector: Injector, defaultOptions: CovalentSideSheetConfig, parentSideSheet: CovalentSideSheet);
188
- static ɵfac: i0.ɵɵFactoryDeclaration<CovalentSideSheet, [null, null, { optional: true; }, { optional: true; skipSelf: true; }]>;
189
- static ɵprov: i0.ɵɵInjectableDeclaration<CovalentSideSheet>;
190
- }
191
-
192
129
  /**
193
130
  * Button that will close the current dialog.
194
131
  */
195
132
  declare class CovalentSideSheetCloseDirective implements OnInit, OnChanges {
196
- dialogRef: CovalentSideSheetRef<any>;
133
+ dialogRef: CovalentSideSheetRef<any, any> | null;
197
134
  private _elementRef;
198
135
  private _dialog;
199
136
  /** Screenreader label for the button. */
@@ -204,11 +141,10 @@ declare class CovalentSideSheetCloseDirective implements OnInit, OnChanges {
204
141
  dialogResult: any;
205
142
  _CovalentSideSheetClose: any;
206
143
  onClick($event: MouseEvent): void;
207
- constructor(dialogRef: CovalentSideSheetRef<any>, _elementRef: ElementRef<HTMLElement>, _dialog: CovalentSideSheet);
208
144
  ngOnInit(): void;
209
145
  ngOnChanges(changes: SimpleChanges): void;
210
146
  _onButtonClick(event: MouseEvent): void;
211
- static ɵfac: i0.ɵɵFactoryDeclaration<CovalentSideSheetCloseDirective, [{ optional: true; }, null, null]>;
147
+ static ɵfac: i0.ɵɵFactoryDeclaration<CovalentSideSheetCloseDirective, never>;
212
148
  static ɵdir: i0.ɵɵDirectiveDeclaration<CovalentSideSheetCloseDirective, "[td-side-sheet-close], [CovalentSideSheetClose]", ["CovalentSideSheetClose"], { "ariaLabel": { "alias": "aria-label"; "required": false; }; "type": { "alias": "type"; "required": false; }; "dialogResult": { "alias": "td-side-sheet-close"; "required": false; }; "_CovalentSideSheetClose": { "alias": "CovalentSideSheetClose"; "required": false; }; }, {}, never, never, true, never>;
213
149
  }
214
150
  /**
@@ -222,9 +158,8 @@ declare class CovalentSideSheetTitleDirective implements OnInit {
222
158
  id: string;
223
159
  tdSideSheetTitle: boolean;
224
160
  idAttr: string;
225
- constructor(_dialogRef: CovalentSideSheetRef<any>, _elementRef: ElementRef<HTMLElement>, _dialog: CovalentSideSheet);
226
161
  ngOnInit(): void;
227
- static ɵfac: i0.ɵɵFactoryDeclaration<CovalentSideSheetTitleDirective, [{ optional: true; }, null, null]>;
162
+ static ɵfac: i0.ɵɵFactoryDeclaration<CovalentSideSheetTitleDirective, never>;
228
163
  static ɵdir: i0.ɵɵDirectiveDeclaration<CovalentSideSheetTitleDirective, "[td-side-sheet-title], [CovalentSideSheetTitle]", ["CovalentSideSheetTitle"], { "id": { "alias": "id"; "required": false; }; }, {}, never, never, true, never>;
229
164
  }
230
165
  /**
@@ -263,4 +198,64 @@ declare class CovalentSideSheetModule {
263
198
  static ɵinj: i0.ɵɵInjectorDeclaration<CovalentSideSheetModule>;
264
199
  }
265
200
 
201
+ declare class _CovalentSideSheetBase<C extends _CovalentSideSheetContainerBase> implements OnDestroy {
202
+ private _overlay;
203
+ private _injector;
204
+ private _defaultOptions;
205
+ private _parentSideSheet;
206
+ private _sideSheetRefConstructor;
207
+ private _sideSheetContainerType;
208
+ private _sideSheetDataToken;
209
+ private _openSideSheetsAtThisLevel;
210
+ private readonly _afterAllClosedAtThisLevel;
211
+ private readonly _afterOpenedAtThisLevel;
212
+ private _animationStateSubscriptions;
213
+ private defaultSidebarConfig;
214
+ constructor(_overlay: Overlay, _injector: Injector, _defaultOptions: CovalentSideSheetConfig | undefined, _parentSideSheet: _CovalentSideSheetBase<C> | undefined, _sideSheetRefConstructor: Type<CovalentSideSheetRef<any>>, _sideSheetContainerType: Type<C>, _sideSheetDataToken: InjectionToken<unknown>);
215
+ /** Keeps track of the currently-open side-sheets. */
216
+ get openSideSheets(): CovalentSideSheetRef<unknown>[];
217
+ open<T, D = unknown, R = unknown>(componentOrTemplateRef: ComponentType<T> | TemplateRef<T>, config?: CovalentSideSheetConfig<D>): CovalentSideSheetRef<T, R>;
218
+ ngOnDestroy(): void;
219
+ /**
220
+ * Closes all of the currently-open side-sheets.
221
+ */
222
+ closeAll(): void;
223
+ private _createOverlay;
224
+ /**
225
+ * Attaches a container to a side-sheets's already-created overlay.
226
+ * @param overlay Reference to the side-sheet's underlying overlay.
227
+ * @param config The side-sheet configuration.
228
+ * @returns A promise resolving to a ComponentRef for the attached container.
229
+ */
230
+ private _attachSideSheetContainer;
231
+ /**
232
+ * Attaches the user-provided component to the already-created side sheet container.
233
+ * @param componentOrTemplateRef The type of component being loaded into the side-sheet,
234
+ * or a TemplateRef to instantiate as the content.
235
+ * @param dialogContainer Reference to the wrapping side-sheet container.
236
+ * @param overlayRef Reference to the overlay in which the side-sheet resides.
237
+ * @param config The side-sheet configuration.
238
+ * @returns A promise resolving to the CovalentSideSheetRef that should be returned to the user.
239
+ */
240
+ private _attachSideSheetContent;
241
+ private _createInjector;
242
+ /**
243
+ * Removes a side sheet from the array of open side sheets.
244
+ * @param sideSheetRef Side Sheet to be removed.
245
+ */
246
+ private _removeOpenSideSheet;
247
+ /** Closes all of the side-sheet in an array. */
248
+ private _closeSideSheets;
249
+ static ɵfac: i0.ɵɵFactoryDeclaration<_CovalentSideSheetBase<any>, never>;
250
+ static ɵdir: i0.ɵɵDirectiveDeclaration<_CovalentSideSheetBase<any>, never, never, {}, {}, never, never, true, never>;
251
+ }
252
+ /**
253
+ * Service to open Covalent Design side-sheet.
254
+ */
255
+ declare class CovalentSideSheet extends _CovalentSideSheetBase<CovalentSideSheetContainerComponent> {
256
+ constructor(overlay: Overlay, injector: Injector, defaultOptions: CovalentSideSheetConfig, parentSideSheet: CovalentSideSheet);
257
+ static ɵfac: i0.ɵɵFactoryDeclaration<CovalentSideSheet, [null, null, { optional: true; }, { optional: true; skipSelf: true; }]>;
258
+ static ɵprov: i0.ɵɵInjectableDeclaration<CovalentSideSheet>;
259
+ }
260
+
266
261
  export { CovalentSideSheet, CovalentSideSheetActionsDirective, CovalentSideSheetCloseDirective, CovalentSideSheetConfig, CovalentSideSheetContentDirective, CovalentSideSheetModule, CovalentSideSheetRef, CovalentSideSheetTitleDirective, CovalentSideSheetWrapperDirective, SubPageMode, _CovalentSideSheetBase, _closeSideSheetVia };