@angular/cdk-experimental 19.1.0-next.1 → 19.1.0-next.3

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.
@@ -6,6 +6,7 @@ import { _CoalescedStyleScheduler } from '@angular/cdk/table';
6
6
  import { Directionality } from '@angular/cdk/bidi';
7
7
  import { ElementRef } from '@angular/core';
8
8
  import * as i0 from '@angular/core';
9
+ import { InjectionToken } from '@angular/core';
9
10
  import { Injector } from '@angular/core';
10
11
  import { NgZone } from '@angular/core';
11
12
  import { Observable } from 'rxjs';
@@ -130,12 +131,15 @@ export declare class CdkFlexTableResizeStrategy extends ResizeStrategy implement
130
131
  static ɵprov: i0.ɵɵInjectableDeclaration<CdkFlexTableResizeStrategy>;
131
132
  }
132
133
 
134
+ export declare const COLUMN_RESIZE_OPTIONS: InjectionToken<ColumnResizeOptions>;
135
+
133
136
  /**
134
137
  * Base class for ColumnResize directives which attach to mat-table elements to
135
138
  * provide common events and services for column resizing.
136
139
  */
137
140
  export declare abstract class ColumnResize implements AfterViewInit, OnDestroy {
138
- private _idGenerator;
141
+ private _renderer;
142
+ private _eventCleanups;
139
143
  protected readonly destroyed: Subject<void>;
140
144
  abstract readonly columnResizeNotifier: ColumnResizeNotifier;
141
145
  abstract readonly elementRef: ElementRef<HTMLElement>;
@@ -146,17 +150,24 @@ export declare abstract class ColumnResize implements AfterViewInit, OnDestroy {
146
150
  protected readonly selectorId: string;
147
151
  /** The id attribute of the table, if specified. */
148
152
  id?: string;
153
+ /**
154
+ * Whether to update the column's width continuously as the mouse position
155
+ * changes, or to wait until mouseup to apply the new size.
156
+ */
157
+ liveResizeUpdates: boolean;
149
158
  ngAfterViewInit(): void;
150
159
  ngOnDestroy(): void;
151
160
  /** Gets the unique CSS class name for this table instance. */
152
161
  getUniqueCssClass(): string;
162
+ /** Gets the ID for this table used for column size persistance. */
163
+ getTableId(): string;
153
164
  /** Called when a column in the table is resized. Applies a css class to the table element. */
154
165
  setResized(): void;
155
166
  private _listenForRowHoverEvents;
156
167
  private _listenForResizeActivity;
157
168
  private _listenForHoverActivity;
158
169
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnResize, never>;
159
- static ɵdir: i0.ɵɵDirectiveDeclaration<ColumnResize, never, never, {}, {}, never, never, true, never>;
170
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ColumnResize, never, never, { "liveResizeUpdates": { "alias": "liveResizeUpdates"; "required": false; }; }, {}, never, never, true, never>;
160
171
  }
161
172
 
162
173
  /** Service for triggering column resizes imperatively or being notified of them. */
@@ -185,6 +196,11 @@ export declare class ColumnResizeNotifierSource {
185
196
  static ɵprov: i0.ɵɵInjectableDeclaration<ColumnResizeNotifierSource>;
186
197
  }
187
198
 
199
+ /** Configurable options for column resize. */
200
+ export declare interface ColumnResizeOptions {
201
+ liveResizeUpdates?: boolean;
202
+ }
203
+
188
204
  /** Indicates the width of a column. */
189
205
  export declare interface ColumnSize {
190
206
  /** The ID/name of the column, as defined in CdkColumnDef. */
@@ -214,9 +230,9 @@ export declare interface ColumnSizeAction extends ColumnSize {
214
230
  */
215
231
  export declare abstract class ColumnSizeStore {
216
232
  /** Returns the persisted size of the specified column in the specified table. */
217
- abstract getSize(tableId: string, columnId: string): number;
233
+ abstract getSize(tableId: string, columnId: string): Observable<number | null> | null;
218
234
  /** Persists the size of the specified column in the specified table. */
219
- abstract setSize(tableId: string, columnId: string): void;
235
+ abstract setSize(tableId: string, columnId: string, sizePx: number): void;
220
236
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnSizeStore, never>;
221
237
  static ɵprov: i0.ɵɵInjectableDeclaration<ColumnSizeStore>;
222
238
  }
@@ -305,6 +321,7 @@ export declare abstract class Resizable<HandleComponent extends ResizeOverlayHan
305
321
  protected abstract readonly styleScheduler: _CoalescedStyleScheduler;
306
322
  protected abstract readonly viewContainerRef: ViewContainerRef;
307
323
  protected abstract readonly changeDetectorRef: ChangeDetectorRef;
324
+ protected readonly columnSizeStore: ColumnSizeStore | null;
308
325
  private _viewInitialized;
309
326
  private _isDestroyed;
310
327
  /** The minimum width to allow the column to be sized to. */
@@ -338,6 +355,7 @@ export declare abstract class Resizable<HandleComponent extends ResizeOverlayHan
338
355
  * for handling column resize mouse events and displaying any visible UI on the column edge.
339
356
  */
340
357
  export declare abstract class ResizeOverlayHandle implements AfterViewInit, OnDestroy {
358
+ private _renderer;
341
359
  protected readonly destroyed: Subject<void>;
342
360
  protected abstract readonly columnDef: CdkColumnDef;
343
361
  protected abstract readonly document: Document;
@@ -348,16 +366,20 @@ export declare abstract class ResizeOverlayHandle implements AfterViewInit, OnDe
348
366
  protected abstract readonly resizeNotifier: ColumnResizeNotifierSource;
349
367
  protected abstract readonly resizeRef: ResizeRef;
350
368
  protected abstract readonly styleScheduler: _CoalescedStyleScheduler;
369
+ private _cumulativeDeltaX;
351
370
  ngAfterViewInit(): void;
352
371
  ngOnDestroy(): void;
353
372
  private _listenForMouseEvents;
354
373
  private _dragStarted;
355
374
  protected updateResizeActive(active: boolean): void;
375
+ private _triggerResize;
376
+ private _computeNewSize;
356
377
  private _getOriginWidth;
357
378
  private _getOriginOffset;
358
379
  private _updateOverlayOffset;
359
380
  private _isLtr;
360
381
  private _notifyResizeEnded;
382
+ private _observableFromEvent;
361
383
  static ɵfac: i0.ɵɵFactoryDeclaration<ResizeOverlayHandle, never>;
362
384
  static ɵdir: i0.ɵɵDirectiveDeclaration<ResizeOverlayHandle, never, never, {}, {}, never, never, true, never>;
363
385
  }
@@ -368,7 +390,8 @@ export declare class ResizeRef {
368
390
  readonly overlayRef: OverlayRef;
369
391
  readonly minWidthPx: number;
370
392
  readonly maxWidthPx: number;
371
- constructor(origin: ElementRef, overlayRef: OverlayRef, minWidthPx: number, maxWidthPx: number);
393
+ readonly liveUpdates: boolean;
394
+ constructor(origin: ElementRef, overlayRef: OverlayRef, minWidthPx: number, maxWidthPx: number, liveUpdates?: boolean);
372
395
  }
373
396
 
374
397
  /**
@@ -1,7 +1,7 @@
1
1
  import { Version } from '@angular/core';
2
2
 
3
3
  /** Current version of the CDK Experimental package. */
4
- const VERSION = new Version('19.1.0-next.1');
4
+ const VERSION = new Version('19.1.0-next.3');
5
5
 
6
6
  export { VERSION };
7
7
  //# sourceMappingURL=cdk-experimental.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cdk-experimental.mjs","sources":["../../../../../../src/cdk-experimental/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the CDK Experimental package. */\nexport const VERSION = new Version('19.1.0-next.1');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
1
+ {"version":3,"file":"cdk-experimental.mjs","sources":["../../../../../../src/cdk-experimental/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the CDK Experimental package. */\nexport const VERSION = new Version('19.1.0-next.3');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}