@angular/cdk-experimental 19.1.0-next.2 → 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.
- package/column-resize/index.d.ts +4 -0
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +88 -67
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +10 -10
- package/fesm2022/popover-edit.mjs +66 -52
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +7 -7
- package/fesm2022/selection.mjs +19 -19
- package/fesm2022/table-scroll-container.mjs +7 -7
- package/package.json +2 -2
- package/popover-edit/index.d.ts +2 -0
package/column-resize/index.d.ts
CHANGED
|
@@ -138,6 +138,8 @@ export declare const COLUMN_RESIZE_OPTIONS: InjectionToken<ColumnResizeOptions>;
|
|
|
138
138
|
* provide common events and services for column resizing.
|
|
139
139
|
*/
|
|
140
140
|
export declare abstract class ColumnResize implements AfterViewInit, OnDestroy {
|
|
141
|
+
private _renderer;
|
|
142
|
+
private _eventCleanups;
|
|
141
143
|
protected readonly destroyed: Subject<void>;
|
|
142
144
|
abstract readonly columnResizeNotifier: ColumnResizeNotifier;
|
|
143
145
|
abstract readonly elementRef: ElementRef<HTMLElement>;
|
|
@@ -353,6 +355,7 @@ export declare abstract class Resizable<HandleComponent extends ResizeOverlayHan
|
|
|
353
355
|
* for handling column resize mouse events and displaying any visible UI on the column edge.
|
|
354
356
|
*/
|
|
355
357
|
export declare abstract class ResizeOverlayHandle implements AfterViewInit, OnDestroy {
|
|
358
|
+
private _renderer;
|
|
356
359
|
protected readonly destroyed: Subject<void>;
|
|
357
360
|
protected abstract readonly columnDef: CdkColumnDef;
|
|
358
361
|
protected abstract readonly document: Document;
|
|
@@ -376,6 +379,7 @@ export declare abstract class ResizeOverlayHandle implements AfterViewInit, OnDe
|
|
|
376
379
|
private _updateOverlayOffset;
|
|
377
380
|
private _isLtr;
|
|
378
381
|
private _notifyResizeEnded;
|
|
382
|
+
private _observableFromEvent;
|
|
379
383
|
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeOverlayHandle, never>;
|
|
380
384
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ResizeOverlayHandle, never, never, {}, {}, never, never, true, never>;
|
|
381
385
|
}
|
|
@@ -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.
|
|
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
|
+
{"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;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Directive, Input, Injectable, NgZone, CSP_NONCE, ElementRef, NgModule, Injector } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Renderer2, Directive, Input, Injectable, NgZone, CSP_NONCE, ElementRef, NgModule, Injector } from '@angular/core';
|
|
3
3
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
4
|
-
import { Subject,
|
|
5
|
-
import {
|
|
4
|
+
import { Subject, merge, combineLatest, Observable } from 'rxjs';
|
|
5
|
+
import { mapTo, take, takeUntil, startWith, pairwise, distinctUntilChanged, share, map, skip, filter } from 'rxjs/operators';
|
|
6
6
|
import { _closest } from '@angular/cdk-experimental/popover-edit';
|
|
7
7
|
import { _COALESCED_STYLE_SCHEDULER, CdkTable } from '@angular/cdk/table';
|
|
8
8
|
import { DOCUMENT } from '@angular/common';
|
|
@@ -24,6 +24,8 @@ const COLUMN_RESIZE_OPTIONS = new InjectionToken('CdkColumnResizeOptions');
|
|
|
24
24
|
* provide common events and services for column resizing.
|
|
25
25
|
*/
|
|
26
26
|
class ColumnResize {
|
|
27
|
+
_renderer = inject(Renderer2);
|
|
28
|
+
_eventCleanups;
|
|
27
29
|
destroyed = new Subject();
|
|
28
30
|
/** Unique ID for this table instance. */
|
|
29
31
|
selectorId = inject(_IdGenerator).getId('cdk-column-resize-');
|
|
@@ -41,6 +43,7 @@ class ColumnResize {
|
|
|
41
43
|
this._listenForHoverActivity();
|
|
42
44
|
}
|
|
43
45
|
ngOnDestroy() {
|
|
46
|
+
this._eventCleanups?.forEach(cleanup => cleanup());
|
|
44
47
|
this.destroyed.next();
|
|
45
48
|
this.destroyed.complete();
|
|
46
49
|
}
|
|
@@ -59,13 +62,17 @@ class ColumnResize {
|
|
|
59
62
|
_listenForRowHoverEvents() {
|
|
60
63
|
this.ngZone.runOutsideAngular(() => {
|
|
61
64
|
const element = this.elementRef.nativeElement;
|
|
62
|
-
|
|
63
|
-
.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
this._eventCleanups = [
|
|
66
|
+
this._renderer.listen(element, 'mouseover', (event) => {
|
|
67
|
+
this.eventDispatcher.headerCellHovered.next(_closest(event.target, HEADER_CELL_SELECTOR));
|
|
68
|
+
}),
|
|
69
|
+
this._renderer.listen(element, 'mouseleave', (event) => {
|
|
70
|
+
if (event.relatedTarget &&
|
|
71
|
+
!event.relatedTarget.matches(RESIZE_OVERLAY_SELECTOR)) {
|
|
72
|
+
this.eventDispatcher.headerCellHovered.next(null);
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
];
|
|
69
76
|
});
|
|
70
77
|
}
|
|
71
78
|
_listenForResizeActivity() {
|
|
@@ -87,10 +94,10 @@ class ColumnResize {
|
|
|
87
94
|
}
|
|
88
95
|
});
|
|
89
96
|
}
|
|
90
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
91
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
97
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResize, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
98
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.3", type: ColumnResize, isStandalone: true, inputs: { liveResizeUpdates: "liveResizeUpdates" }, ngImport: i0 });
|
|
92
99
|
}
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResize, decorators: [{
|
|
94
101
|
type: Directive
|
|
95
102
|
}], propDecorators: { liveResizeUpdates: [{
|
|
96
103
|
type: Input
|
|
@@ -107,10 +114,10 @@ class ColumnResizeNotifierSource {
|
|
|
107
114
|
resizeCompleted = new Subject();
|
|
108
115
|
/** Triggers a resize action. */
|
|
109
116
|
triggerResize = new Subject();
|
|
110
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
111
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
117
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResizeNotifierSource, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
118
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResizeNotifierSource });
|
|
112
119
|
}
|
|
113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResizeNotifierSource, decorators: [{
|
|
114
121
|
type: Injectable
|
|
115
122
|
}] });
|
|
116
123
|
/** Service for triggering column resizes imperatively or being notified of them. */
|
|
@@ -127,10 +134,10 @@ class ColumnResizeNotifier {
|
|
|
127
134
|
isStickyColumn: true,
|
|
128
135
|
});
|
|
129
136
|
}
|
|
130
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
131
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResizeNotifier, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
138
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResizeNotifier });
|
|
132
139
|
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnResizeNotifier, decorators: [{
|
|
134
141
|
type: Injectable
|
|
135
142
|
}] });
|
|
136
143
|
|
|
@@ -182,10 +189,10 @@ class HeaderRowEventDispatcher {
|
|
|
182
189
|
complete: () => observer.complete(),
|
|
183
190
|
}));
|
|
184
191
|
}
|
|
185
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
186
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: HeaderRowEventDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
193
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: HeaderRowEventDispatcher });
|
|
187
194
|
}
|
|
188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: HeaderRowEventDispatcher, decorators: [{
|
|
189
196
|
type: Injectable
|
|
190
197
|
}] });
|
|
191
198
|
|
|
@@ -210,10 +217,10 @@ class ResizeStrategy {
|
|
|
210
217
|
}
|
|
211
218
|
this._pendingResizeDelta = (this._pendingResizeDelta ?? 0) + delta;
|
|
212
219
|
}
|
|
213
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
214
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ResizeStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
221
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ResizeStrategy });
|
|
215
222
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ResizeStrategy, decorators: [{
|
|
217
224
|
type: Injectable
|
|
218
225
|
}] });
|
|
219
226
|
/**
|
|
@@ -247,10 +254,10 @@ class TableLayoutFixedResizeStrategy extends ResizeStrategy {
|
|
|
247
254
|
const newWidth = Math.min(currentWidth, sizeInPx);
|
|
248
255
|
this.applyColumnSize(_, columnHeader, newWidth, currentWidth);
|
|
249
256
|
}
|
|
250
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
251
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
257
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: TableLayoutFixedResizeStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
258
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: TableLayoutFixedResizeStrategy });
|
|
252
259
|
}
|
|
253
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: TableLayoutFixedResizeStrategy, decorators: [{
|
|
254
261
|
type: Injectable
|
|
255
262
|
}] });
|
|
256
263
|
/**
|
|
@@ -360,10 +367,10 @@ class CdkFlexTableResizeStrategy extends ResizeStrategy {
|
|
|
360
367
|
const body = propertyKeys.map(key => `${key}:${properties.get(key)}`).join(';');
|
|
361
368
|
this._getStyleSheet().insertRule(`${selector} {${body}}`, index);
|
|
362
369
|
}
|
|
363
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
364
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
370
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkFlexTableResizeStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
371
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkFlexTableResizeStrategy });
|
|
365
372
|
}
|
|
366
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkFlexTableResizeStrategy, decorators: [{
|
|
367
374
|
type: Injectable
|
|
368
375
|
}] });
|
|
369
376
|
/** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
|
|
@@ -414,10 +421,10 @@ class CdkColumnResize extends ColumnResize {
|
|
|
414
421
|
ngZone = inject(NgZone);
|
|
415
422
|
notifier = inject(ColumnResizeNotifierSource);
|
|
416
423
|
table = inject(CdkTable);
|
|
417
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
418
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
424
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResize, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
425
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.3", type: CdkColumnResize, isStandalone: true, selector: "table[cdk-table][columnResize]", providers: [...TABLE_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResize }], usesInheritance: true, ngImport: i0 });
|
|
419
426
|
}
|
|
420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
427
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResize, decorators: [{
|
|
421
428
|
type: Directive,
|
|
422
429
|
args: [{
|
|
423
430
|
selector: 'table[cdk-table][columnResize]',
|
|
@@ -436,10 +443,10 @@ class CdkColumnResizeFlex extends ColumnResize {
|
|
|
436
443
|
ngZone = inject(NgZone);
|
|
437
444
|
notifier = inject(ColumnResizeNotifierSource);
|
|
438
445
|
table = inject(CdkTable);
|
|
439
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
440
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
446
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeFlex, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
447
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.3", type: CdkColumnResizeFlex, isStandalone: true, selector: "cdk-table[columnResize]", providers: [...FLEX_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResizeFlex }], usesInheritance: true, ngImport: i0 });
|
|
441
448
|
}
|
|
442
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeFlex, decorators: [{
|
|
443
450
|
type: Directive,
|
|
444
451
|
args: [{
|
|
445
452
|
selector: 'cdk-table[columnResize]',
|
|
@@ -458,13 +465,13 @@ class CdkDefaultEnabledColumnResize extends ColumnResize {
|
|
|
458
465
|
ngZone = inject(NgZone);
|
|
459
466
|
notifier = inject(ColumnResizeNotifierSource);
|
|
460
467
|
table = inject(CdkTable);
|
|
461
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
462
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
468
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkDefaultEnabledColumnResize, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
469
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.3", type: CdkDefaultEnabledColumnResize, isStandalone: true, selector: "table[cdk-table]", providers: [
|
|
463
470
|
...TABLE_PROVIDERS,
|
|
464
471
|
{ provide: ColumnResize, useExisting: CdkDefaultEnabledColumnResize },
|
|
465
472
|
], usesInheritance: true, ngImport: i0 });
|
|
466
473
|
}
|
|
467
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkDefaultEnabledColumnResize, decorators: [{
|
|
468
475
|
type: Directive,
|
|
469
476
|
args: [{
|
|
470
477
|
selector: 'table[cdk-table]',
|
|
@@ -486,13 +493,13 @@ class CdkDefaultEnabledColumnResizeFlex extends ColumnResize {
|
|
|
486
493
|
ngZone = inject(NgZone);
|
|
487
494
|
notifier = inject(ColumnResizeNotifierSource);
|
|
488
495
|
table = inject(CdkTable);
|
|
489
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
490
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
496
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkDefaultEnabledColumnResizeFlex, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
497
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.3", type: CdkDefaultEnabledColumnResizeFlex, isStandalone: true, selector: "cdk-table", providers: [
|
|
491
498
|
...FLEX_PROVIDERS,
|
|
492
499
|
{ provide: ColumnResize, useExisting: CdkDefaultEnabledColumnResizeFlex },
|
|
493
500
|
], usesInheritance: true, ngImport: i0 });
|
|
494
501
|
}
|
|
495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkDefaultEnabledColumnResizeFlex, decorators: [{
|
|
496
503
|
type: Directive,
|
|
497
504
|
args: [{
|
|
498
505
|
selector: 'cdk-table',
|
|
@@ -508,11 +515,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.2",
|
|
|
508
515
|
* When using this module, columns are resizable by default.
|
|
509
516
|
*/
|
|
510
517
|
class CdkColumnResizeDefaultEnabledModule {
|
|
511
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
512
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
513
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
518
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeDefaultEnabledModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
519
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeDefaultEnabledModule, imports: [CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex], exports: [CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex] });
|
|
520
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeDefaultEnabledModule });
|
|
514
521
|
}
|
|
515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeDefaultEnabledModule, decorators: [{
|
|
516
523
|
type: NgModule,
|
|
517
524
|
args: [{
|
|
518
525
|
imports: [CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex],
|
|
@@ -524,11 +531,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.2",
|
|
|
524
531
|
* When using this module, columns are not resizable by default.
|
|
525
532
|
*/
|
|
526
533
|
class CdkColumnResizeModule {
|
|
527
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
528
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
529
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
534
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
535
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeModule, imports: [CdkColumnResize, CdkColumnResizeFlex], exports: [CdkColumnResize, CdkColumnResizeFlex] });
|
|
536
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeModule });
|
|
530
537
|
}
|
|
531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
538
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: CdkColumnResizeModule, decorators: [{
|
|
532
539
|
type: NgModule,
|
|
533
540
|
args: [{
|
|
534
541
|
imports: [CdkColumnResize, CdkColumnResizeFlex],
|
|
@@ -540,10 +547,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.2",
|
|
|
540
547
|
* Can be provided by the host application to enable persistence of column resize state.
|
|
541
548
|
*/
|
|
542
549
|
class ColumnSizeStore {
|
|
543
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
544
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
550
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnSizeStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
551
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnSizeStore });
|
|
545
552
|
}
|
|
546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ColumnSizeStore, decorators: [{
|
|
547
554
|
type: Injectable
|
|
548
555
|
}] });
|
|
549
556
|
|
|
@@ -755,10 +762,10 @@ class Resizable {
|
|
|
755
762
|
this.elementRef.nativeElement.appendChild(this.inlineHandle);
|
|
756
763
|
});
|
|
757
764
|
}
|
|
758
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
759
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.
|
|
765
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: Resizable, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
766
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.3", type: Resizable, isStandalone: true, ngImport: i0 });
|
|
760
767
|
}
|
|
761
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
768
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: Resizable, decorators: [{
|
|
762
769
|
type: Directive
|
|
763
770
|
}] });
|
|
764
771
|
|
|
@@ -769,6 +776,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.2",
|
|
|
769
776
|
* for handling column resize mouse events and displaying any visible UI on the column edge.
|
|
770
777
|
*/
|
|
771
778
|
class ResizeOverlayHandle {
|
|
779
|
+
_renderer = inject(Renderer2);
|
|
772
780
|
destroyed = new Subject();
|
|
773
781
|
_cumulativeDeltaX = 0;
|
|
774
782
|
ngAfterViewInit() {
|
|
@@ -780,13 +788,13 @@ class ResizeOverlayHandle {
|
|
|
780
788
|
}
|
|
781
789
|
_listenForMouseEvents() {
|
|
782
790
|
this.ngZone.runOutsideAngular(() => {
|
|
783
|
-
|
|
791
|
+
this._observableFromEvent(this.elementRef.nativeElement, 'mouseenter')
|
|
784
792
|
.pipe(mapTo(this.resizeRef.origin.nativeElement), takeUntil(this.destroyed))
|
|
785
793
|
.subscribe(cell => this.eventDispatcher.headerCellHovered.next(cell));
|
|
786
|
-
|
|
794
|
+
this._observableFromEvent(this.elementRef.nativeElement, 'mouseleave')
|
|
787
795
|
.pipe(map(event => event.relatedTarget && _closest(event.relatedTarget, HEADER_CELL_SELECTOR)), takeUntil(this.destroyed))
|
|
788
796
|
.subscribe(cell => this.eventDispatcher.headerCellHovered.next(cell));
|
|
789
|
-
|
|
797
|
+
this._observableFromEvent(this.elementRef.nativeElement, 'mousedown')
|
|
790
798
|
.pipe(takeUntil(this.destroyed))
|
|
791
799
|
.subscribe(mousedownEvent => {
|
|
792
800
|
this._dragStarted(mousedownEvent);
|
|
@@ -798,9 +806,9 @@ class ResizeOverlayHandle {
|
|
|
798
806
|
if (mousedownEvent.button !== 0) {
|
|
799
807
|
return;
|
|
800
808
|
}
|
|
801
|
-
const mouseup =
|
|
802
|
-
const mousemove =
|
|
803
|
-
const escape =
|
|
809
|
+
const mouseup = this._observableFromEvent(this.document, 'mouseup');
|
|
810
|
+
const mousemove = this._observableFromEvent(this.document, 'mousemove');
|
|
811
|
+
const escape = this._observableFromEvent(this.document, 'keyup').pipe(filter(event => event.keyCode === ESCAPE));
|
|
804
812
|
const startX = mousedownEvent.screenX;
|
|
805
813
|
const initialSize = this._getOriginWidth();
|
|
806
814
|
let overlayOffset = 0;
|
|
@@ -889,7 +897,10 @@ class ResizeOverlayHandle {
|
|
|
889
897
|
_notifyResizeEnded(size, completedSuccessfully = false) {
|
|
890
898
|
this.updateResizeActive(false);
|
|
891
899
|
this.ngZone.run(() => {
|
|
892
|
-
const sizeMessage = {
|
|
900
|
+
const sizeMessage = {
|
|
901
|
+
columnId: this.columnDef.name,
|
|
902
|
+
size: this._computeNewSize(size, this._cumulativeDeltaX),
|
|
903
|
+
};
|
|
893
904
|
if (completedSuccessfully) {
|
|
894
905
|
if (!this.resizeRef.liveUpdates) {
|
|
895
906
|
this._triggerResize(size, this._cumulativeDeltaX);
|
|
@@ -901,10 +912,20 @@ class ResizeOverlayHandle {
|
|
|
901
912
|
}
|
|
902
913
|
});
|
|
903
914
|
}
|
|
904
|
-
|
|
905
|
-
|
|
915
|
+
_observableFromEvent(element, name) {
|
|
916
|
+
return new Observable(subscriber => {
|
|
917
|
+
const handler = (event) => subscriber.next(event);
|
|
918
|
+
const cleanup = this._renderer.listen(element, name, handler);
|
|
919
|
+
return () => {
|
|
920
|
+
cleanup();
|
|
921
|
+
subscriber.complete();
|
|
922
|
+
};
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ResizeOverlayHandle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
926
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-next.3", type: ResizeOverlayHandle, isStandalone: true, ngImport: i0 });
|
|
906
927
|
}
|
|
907
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.
|
|
928
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3", ngImport: i0, type: ResizeOverlayHandle, decorators: [{
|
|
908
929
|
type: Directive
|
|
909
930
|
}] });
|
|
910
931
|
|