@ng-matero/extensions 19.4.1 → 20.0.1

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.
Files changed (283) hide show
  1. package/_index.scss +1 -1
  2. package/alert/_alert-theme.scss +26 -31
  3. package/alert/_m2-alert.scss +59 -0
  4. package/alert/_m3-alert.scss +41 -0
  5. package/alert/alert.scss +27 -31
  6. package/alert/index.d.ts +30 -5
  7. package/button/index.d.ts +31 -5
  8. package/checkbox-group/index.d.ts +117 -5
  9. package/colorpicker/_colorpicker-theme.scss +31 -36
  10. package/{core/tokens/m2/mtx/_colorpicker.scss → colorpicker/_m2-colorpicker.scss} +6 -10
  11. package/colorpicker/_m3-colorpicker.scss +23 -0
  12. package/colorpicker/colorpicker-toggle.scss +4 -9
  13. package/colorpicker/index.d.ts +285 -3
  14. package/column-resize/index.d.ts +456 -3
  15. package/core/index.d.ts +147 -5
  16. package/core/theming/_color-api-backwards-compatibility.scss +8 -15
  17. package/core/theming/_definition.scss +81 -75
  18. package/core/theming/_palettes.scss +1036 -0
  19. package/core/tokens/{m2/_index.scss → _m2-tokens.scss} +22 -22
  20. package/core/tokens/_m2-utils.scss +108 -0
  21. package/core/tokens/_m3-system.scss +128 -106
  22. package/core/tokens/_m3-tokens.scss +36 -282
  23. package/core/tokens/_m3-utils.scss +48 -0
  24. package/core/tokens/_token-utils.scss +67 -239
  25. package/core/tokens/m3/_index.scss +7 -0
  26. package/core/tokens/m3/_md-sys-color.scss +156 -0
  27. package/core/tokens/m3/_md-sys-elevation.scss +15 -0
  28. package/core/tokens/m3/_md-sys-motion.scss +35 -0
  29. package/core/tokens/m3/_md-sys-shape.scss +21 -0
  30. package/core/tokens/m3/_md-sys-state.scss +13 -0
  31. package/core/tokens/m3/_md-sys-typescale.scss +128 -0
  32. package/core/tokens/m3/_theme.scss +47 -0
  33. package/datetimepicker/_datetimepicker-theme.scss +29 -39
  34. package/datetimepicker/_m2-datetimepicker.scss +149 -0
  35. package/datetimepicker/_m3-datetimepicker.scss +81 -0
  36. package/datetimepicker/calendar-body.scss +31 -56
  37. package/datetimepicker/calendar.scss +43 -79
  38. package/datetimepicker/clock.scss +28 -47
  39. package/datetimepicker/datetimepicker-content.scss +9 -15
  40. package/datetimepicker/datetimepicker-toggle.scss +4 -9
  41. package/datetimepicker/index.d.ts +1208 -3
  42. package/datetimepicker/time-view.scss +26 -32
  43. package/dialog/index.d.ts +54 -5
  44. package/drawer/_drawer-theme.scss +25 -30
  45. package/{core/tokens/m2/mtx/_drawer.scss → drawer/_m2-drawer.scss} +9 -12
  46. package/drawer/_m3-drawer.scss +24 -0
  47. package/drawer/drawer-container.scss +13 -24
  48. package/drawer/index.d.ts +221 -3
  49. package/fesm2022/mtxAlert.mjs +7 -7
  50. package/fesm2022/mtxAlert.mjs.map +1 -1
  51. package/fesm2022/mtxButton.mjs +11 -11
  52. package/fesm2022/mtxButton.mjs.map +1 -1
  53. package/fesm2022/mtxCheckboxGroup.mjs +7 -7
  54. package/fesm2022/mtxColorpicker.mjs +21 -21
  55. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  56. package/fesm2022/mtxColumnResize.mjs +232 -103
  57. package/fesm2022/mtxColumnResize.mjs.map +1 -1
  58. package/fesm2022/mtxCore.mjs +21 -21
  59. package/fesm2022/mtxDatetimepicker.mjs +63 -67
  60. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  61. package/fesm2022/mtxDialog.mjs +10 -10
  62. package/fesm2022/mtxDialog.mjs.map +1 -1
  63. package/fesm2022/mtxDrawer.mjs +10 -10
  64. package/fesm2022/mtxGrid.mjs +78 -77
  65. package/fesm2022/mtxGrid.mjs.map +1 -1
  66. package/fesm2022/mtxLoader.mjs +7 -7
  67. package/fesm2022/mtxPhotoviewer.mjs +7 -7
  68. package/fesm2022/mtxPopover.mjs +24 -25
  69. package/fesm2022/mtxPopover.mjs.map +1 -1
  70. package/fesm2022/mtxProgress.mjs +7 -7
  71. package/fesm2022/mtxSelect.mjs +54 -54
  72. package/fesm2022/mtxSelect.mjs.map +1 -1
  73. package/fesm2022/mtxSplit.mjs +10 -10
  74. package/fesm2022/mtxTooltip.mjs +13 -13
  75. package/fesm2022/mtxTooltip.mjs.map +1 -1
  76. package/grid/_grid-theme.scss +24 -34
  77. package/grid/_m2-grid.scss +66 -0
  78. package/grid/_m3-grid.scss +35 -0
  79. package/grid/column-menu.scss +6 -23
  80. package/grid/column-resize/_column-resize.scss +35 -30
  81. package/grid/grid.scss +41 -74
  82. package/grid/index.d.ts +799 -3
  83. package/index.d.ts +2 -5
  84. package/loader/_loader-theme.scss +26 -31
  85. package/{core/tokens/m2/mtx/_loader.scss → loader/_m2-loader.scss} +5 -10
  86. package/loader/_m3-loader.scss +20 -0
  87. package/loader/index.d.ts +43 -5
  88. package/loader/loader.scss +4 -5
  89. package/package.json +28 -28
  90. package/photoviewer/index.d.ts +26 -5
  91. package/{core/tokens/m2/mtx/_popover.scss → popover/_m2-popover.scss} +9 -12
  92. package/popover/_m3-popover.scss +26 -0
  93. package/popover/_popover-theme.scss +26 -31
  94. package/popover/index.d.ts +399 -3
  95. package/popover/popover.scss +23 -29
  96. package/prebuilt-themes/azure-blue.css +1 -1
  97. package/prebuilt-themes/cyan-orange.css +1 -1
  98. package/prebuilt-themes/deeppurple-amber.css +1 -1
  99. package/prebuilt-themes/indigo-pink.css +1 -1
  100. package/prebuilt-themes/magenta-violet.css +1 -1
  101. package/prebuilt-themes/pink-bluegrey.css +1 -1
  102. package/prebuilt-themes/purple-green.css +1 -1
  103. package/prebuilt-themes/rose-red.css +1 -1
  104. package/progress/_m2-progress.scss +53 -0
  105. package/progress/_m3-progress.scss +33 -0
  106. package/progress/_progress-theme.scss +22 -34
  107. package/progress/index.d.ts +35 -5
  108. package/progress/progress.scss +28 -43
  109. package/select/_m2-select.scss +79 -0
  110. package/select/_m3-select.scss +46 -0
  111. package/select/_select-theme.scss +27 -37
  112. package/select/index.d.ts +381 -3
  113. package/select/select.scss +189 -205
  114. package/{core/tokens/m2/mtx/_split.scss → split/_m2-split.scss} +6 -9
  115. package/split/_m3-split.scss +23 -0
  116. package/split/_split-theme.scss +31 -34
  117. package/split/index.d.ts +255 -3
  118. package/split/split.scss +8 -11
  119. package/tooltip/_m2-tooltip.scss +50 -0
  120. package/tooltip/_m3-tooltip.scss +28 -0
  121. package/tooltip/_tooltip-theme.scss +23 -47
  122. package/tooltip/index.d.ts +345 -3
  123. package/tooltip/tooltip.scss +11 -15
  124. package/alert/alert-module.d.ts +0 -8
  125. package/alert/alert.d.ts +0 -19
  126. package/alert/public-api.d.ts +0 -2
  127. package/button/button-loading.d.ts +0 -19
  128. package/button/button-module.d.ts +0 -10
  129. package/button/public-api.d.ts +0 -2
  130. package/checkbox-group/checkbox-group-module.d.ts +0 -11
  131. package/checkbox-group/checkbox-group.d.ts +0 -86
  132. package/checkbox-group/interfaces.d.ts +0 -17
  133. package/checkbox-group/public-api.d.ts +0 -3
  134. package/colorpicker/colorpicker-animations.d.ts +0 -9
  135. package/colorpicker/colorpicker-input.d.ts +0 -88
  136. package/colorpicker/colorpicker-module.d.ts +0 -15
  137. package/colorpicker/colorpicker-toggle.d.ts +0 -39
  138. package/colorpicker/colorpicker.d.ts +0 -140
  139. package/colorpicker/public-api.d.ts +0 -5
  140. package/column-resize/column-resize-directives/column-resize-flex.d.ts +0 -29
  141. package/column-resize/column-resize-directives/column-resize.d.ts +0 -29
  142. package/column-resize/column-resize-directives/constants.d.ts +0 -10
  143. package/column-resize/column-resize-module.d.ts +0 -12
  144. package/column-resize/column-resize-notifier.d.ts +0 -48
  145. package/column-resize/column-resize.d.ts +0 -39
  146. package/column-resize/column-size-store.d.ts +0 -12
  147. package/column-resize/event-dispatcher.d.ts +0 -35
  148. package/column-resize/overlay-handle.d.ts +0 -43
  149. package/column-resize/polyfill.d.ts +0 -9
  150. package/column-resize/public-api.d.ts +0 -12
  151. package/column-resize/resizable.d.ts +0 -63
  152. package/column-resize/resize-ref.d.ts +0 -17
  153. package/column-resize/resize-strategy.d.ts +0 -84
  154. package/column-resize/selectors.d.ts +0 -10
  155. package/core/datetime/datetime-adapter.d.ts +0 -45
  156. package/core/datetime/datetime-formats.d.ts +0 -22
  157. package/core/datetime/datetime.module.d.ts +0 -15
  158. package/core/datetime/index.d.ts +0 -5
  159. package/core/datetime/native-datetime-adapter.d.ts +0 -40
  160. package/core/datetime/native-datetime-formats.d.ts +0 -2
  161. package/core/pipes/index.d.ts +0 -3
  162. package/core/pipes/is-template-ref.pipe.d.ts +0 -7
  163. package/core/pipes/pipes.module.d.ts +0 -9
  164. package/core/pipes/to-observable.pipe.d.ts +0 -8
  165. package/core/public-api.d.ts +0 -2
  166. package/core/theming/_inspection.scss +0 -38
  167. package/core/theming/_validation.scss +0 -5
  168. package/core/tokens/_density.scss +0 -49
  169. package/core/tokens/_format-tokens.scss +0 -5
  170. package/core/tokens/_token-definition.scss +0 -271
  171. package/core/tokens/m2/mdc/_plain-tooltip.scss +0 -63
  172. package/core/tokens/m2/mtx/_alert.scss +0 -62
  173. package/core/tokens/m2/mtx/_datetimepicker.scss +0 -152
  174. package/core/tokens/m2/mtx/_grid.scss +0 -69
  175. package/core/tokens/m2/mtx/_progress.scss +0 -56
  176. package/core/tokens/m2/mtx/_select.scss +0 -82
  177. package/core/tokens/m3/definitions/_index.scss +0 -9
  178. package/core/tokens/m3/definitions/_md-comp-plain-tooltip.scss +0 -51
  179. package/core/tokens/m3/definitions/_md-ref-palette.scss +0 -100
  180. package/core/tokens/m3/definitions/_md-ref-typeface.scss +0 -14
  181. package/core/tokens/m3/definitions/_md-sys-color.scss +0 -126
  182. package/core/tokens/m3/definitions/_md-sys-elevation.scss +0 -15
  183. package/core/tokens/m3/definitions/_md-sys-motion.scss +0 -46
  184. package/core/tokens/m3/definitions/_md-sys-shape.scss +0 -24
  185. package/core/tokens/m3/definitions/_md-sys-state.scss +0 -13
  186. package/core/tokens/m3/definitions/_md-sys-typescale.scss +0 -308
  187. package/core/tokens/m3/index.scss +0 -47
  188. package/core/tokens/m3/mdc/_plain-tooltip.scss +0 -15
  189. package/core/tokens/m3/mtx/_alert.scss +0 -41
  190. package/core/tokens/m3/mtx/_colorpicker.scss +0 -19
  191. package/core/tokens/m3/mtx/_datetimepicker.scss +0 -140
  192. package/core/tokens/m3/mtx/_drawer.scss +0 -22
  193. package/core/tokens/m3/mtx/_grid.scss +0 -32
  194. package/core/tokens/m3/mtx/_loader.scss +0 -22
  195. package/core/tokens/m3/mtx/_popover.scss +0 -25
  196. package/core/tokens/m3/mtx/_progress.scss +0 -32
  197. package/core/tokens/m3/mtx/_select.scss +0 -76
  198. package/core/tokens/m3/mtx/_split.scss +0 -30
  199. package/datetimepicker/calendar-body.d.ts +0 -66
  200. package/datetimepicker/calendar.d.ts +0 -157
  201. package/datetimepicker/clock.d.ts +0 -101
  202. package/datetimepicker/datetimepicker-actions.d.ts +0 -36
  203. package/datetimepicker/datetimepicker-animations.d.ts +0 -11
  204. package/datetimepicker/datetimepicker-errors.d.ts +0 -2
  205. package/datetimepicker/datetimepicker-filtertype.d.ts +0 -5
  206. package/datetimepicker/datetimepicker-input.d.ts +0 -105
  207. package/datetimepicker/datetimepicker-intl.d.ts +0 -53
  208. package/datetimepicker/datetimepicker-module.d.ts +0 -22
  209. package/datetimepicker/datetimepicker-toggle.d.ts +0 -42
  210. package/datetimepicker/datetimepicker-types.d.ts +0 -6
  211. package/datetimepicker/datetimepicker.d.ts +0 -274
  212. package/datetimepicker/month-view.d.ts +0 -80
  213. package/datetimepicker/multi-year-view.d.ts +0 -86
  214. package/datetimepicker/public-api.d.ts +0 -16
  215. package/datetimepicker/time-view.d.ts +0 -147
  216. package/datetimepicker/year-view.d.ts +0 -68
  217. package/dialog/dialog-config.d.ts +0 -17
  218. package/dialog/dialog-container.d.ts +0 -11
  219. package/dialog/dialog-module.d.ts +0 -12
  220. package/dialog/dialog.d.ts +0 -15
  221. package/dialog/public-api.d.ts +0 -4
  222. package/drawer/drawer-animations.d.ts +0 -8
  223. package/drawer/drawer-config.d.ts +0 -63
  224. package/drawer/drawer-container.d.ts +0 -35
  225. package/drawer/drawer-module.d.ts +0 -10
  226. package/drawer/drawer-ref.d.ts +0 -53
  227. package/drawer/drawer.d.ts +0 -59
  228. package/drawer/public-api.d.ts +0 -6
  229. package/grid/cell.d.ts +0 -32
  230. package/grid/column-menu.d.ts +0 -39
  231. package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +0 -24
  232. package/grid/column-resize/column-resize-directives/column-resize.d.ts +0 -24
  233. package/grid/column-resize/column-resize-directives/common.d.ts +0 -13
  234. package/grid/column-resize/column-resize-module.d.ts +0 -17
  235. package/grid/column-resize/index.d.ts +0 -7
  236. package/grid/column-resize/overlay-handle.d.ts +0 -32
  237. package/grid/column-resize/resizable-directives/common.d.ts +0 -19
  238. package/grid/column-resize/resizable-directives/resizable.d.ts +0 -32
  239. package/grid/column-resize/resize-strategy.d.ts +0 -20
  240. package/grid/expansion-toggle.d.ts +0 -17
  241. package/grid/grid-module.d.ts +0 -31
  242. package/grid/grid-pipes.d.ts +0 -39
  243. package/grid/grid-utils.d.ts +0 -33
  244. package/grid/grid.d.ts +0 -268
  245. package/grid/interfaces.d.ts +0 -180
  246. package/grid/public-api.d.ts +0 -17
  247. package/grid/selectable-cell.d.ts +0 -16
  248. package/loader/loader-module.d.ts +0 -10
  249. package/loader/loader.d.ts +0 -30
  250. package/loader/public-api.d.ts +0 -2
  251. package/photoviewer/photoviewer-module.d.ts +0 -7
  252. package/photoviewer/photoviewer.d.ts +0 -17
  253. package/photoviewer/public-api.d.ts +0 -2
  254. package/popover/popover-animations.d.ts +0 -11
  255. package/popover/popover-content.d.ts +0 -43
  256. package/popover/popover-errors.d.ts +0 -14
  257. package/popover/popover-interfaces.d.ts +0 -50
  258. package/popover/popover-module.d.ts +0 -13
  259. package/popover/popover-target.d.ts +0 -7
  260. package/popover/popover-trigger.d.ts +0 -132
  261. package/popover/popover-types.d.ts +0 -10
  262. package/popover/popover.d.ts +0 -147
  263. package/popover/public-api.d.ts +0 -8
  264. package/progress/progress-module.d.ts +0 -8
  265. package/progress/progress.d.ts +0 -24
  266. package/progress/public-api.d.ts +0 -2
  267. package/public-api.d.ts +0 -2
  268. package/select/option.d.ts +0 -21
  269. package/select/public-api.d.ts +0 -5
  270. package/select/select-intl.d.ts +0 -18
  271. package/select/select-module.d.ts +0 -12
  272. package/select/select.d.ts +0 -270
  273. package/select/templates.d.ts +0 -67
  274. package/split/interfaces.d.ts +0 -52
  275. package/split/public-api.d.ts +0 -5
  276. package/split/split-module.d.ts +0 -9
  277. package/split/split-pane.d.ts +0 -53
  278. package/split/split.d.ts +0 -133
  279. package/split/utils.d.ts +0 -13
  280. package/tooltip/public-api.d.ts +0 -3
  281. package/tooltip/tooltip-animations.d.ts +0 -9
  282. package/tooltip/tooltip-module.d.ts +0 -13
  283. package/tooltip/tooltip.d.ts +0 -321
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Injectable, inject, NgZone, CSP_NONCE, ElementRef, NgModule, Injector } from '@angular/core';
3
- import { Subject, fromEvent, merge, combineLatest, Observable } from 'rxjs';
4
- import { map, takeUntil, filter, mapTo, take, startWith, pairwise, distinctUntilChanged, share, skip } from 'rxjs/operators';
5
- import { _COALESCED_STYLE_SCHEDULER, CdkTable } from '@angular/cdk/table';
6
- import { DOCUMENT } from '@angular/common';
2
+ import { InjectionToken, inject, Renderer2, Directive, Input, Injectable, NgZone, CSP_NONCE, DOCUMENT, ElementRef, NgModule, Injector } from '@angular/core';
3
+ import { _IdGenerator } from '@angular/cdk/a11y';
4
+ import { Subject, merge, combineLatest, Observable } from 'rxjs';
5
+ import { mapTo, take, takeUntil, startWith, pairwise, distinctUntilChanged, share, map, skip, filter } from 'rxjs/operators';
6
+ import { CdkTable } from '@angular/cdk/table';
7
7
  import { coerceCssPixelValue } from '@angular/cdk/coercion';
8
8
  import { ComponentPortal } from '@angular/cdk/portal';
9
9
  import { ESCAPE } from '@angular/cdk/keycodes';
@@ -13,7 +13,7 @@ import { ESCAPE } from '@angular/cdk/keycodes';
13
13
  * Copyright Google LLC All Rights Reserved.
14
14
  *
15
15
  * Use of this source code is governed by an MIT-style license that can be
16
- * found in the LICENSE file at https://angular.io/license
16
+ * found in the LICENSE file at https://angular.dev/license
17
17
  */
18
18
  // TODO: Figure out how to remove `mat-` classes from the CDK part of the
19
19
  // column resize implementation.
@@ -26,7 +26,7 @@ const RESIZE_OVERLAY_SELECTOR = '.mat-column-resize-overlay-thumb';
26
26
  * Copyright Google LLC All Rights Reserved.
27
27
  *
28
28
  * Use of this source code is governed by an MIT-style license that can be
29
- * found in the LICENSE file at https://angular.io/license
29
+ * found in the LICENSE file at https://angular.dev/license
30
30
  */
31
31
  /** closest implementation that is able to start from non-Element Nodes. */
32
32
  function closest(element, selector) {
@@ -45,20 +45,28 @@ function closest(element, selector) {
45
45
  * Copyright Google LLC All Rights Reserved.
46
46
  *
47
47
  * Use of this source code is governed by an MIT-style license that can be
48
- * found in the LICENSE file at https://angular.io/license
48
+ * found in the LICENSE file at https://angular.dev/license
49
49
  */
50
50
  const HOVER_OR_ACTIVE_CLASS = 'cdk-column-resize-hover-or-active';
51
51
  const WITH_RESIZED_COLUMN_CLASS = 'cdk-column-resize-with-resized-column';
52
- let nextId = 0;
52
+ const COLUMN_RESIZE_OPTIONS = new InjectionToken('CdkColumnResizeOptions');
53
53
  /**
54
54
  * Base class for ColumnResize directives which attach to mat-table elements to
55
55
  * provide common events and services for column resizing.
56
56
  */
57
57
  class ColumnResize {
58
58
  constructor() {
59
+ this._renderer = inject(Renderer2);
59
60
  this.destroyed = new Subject();
60
61
  /** Unique ID for this table instance. */
61
- this.selectorId = `${++nextId}`;
62
+ this.selectorId = inject(_IdGenerator).getId('cdk-column-resize-');
63
+ /** @docs-private Whether a call to updateStickyColumnStyles is pending after a resize. */
64
+ this._flushPending = false;
65
+ /**
66
+ * Whether to update the column's width continuously as the mouse position
67
+ * changes, or to wait until mouseup to apply the new size.
68
+ */
69
+ this.liveResizeUpdates = inject(COLUMN_RESIZE_OPTIONS, { optional: true })?.liveResizeUpdates ?? true;
62
70
  }
63
71
  ngAfterViewInit() {
64
72
  this.elementRef.nativeElement.classList.add(this.getUniqueCssClass());
@@ -67,12 +75,17 @@ class ColumnResize {
67
75
  this._listenForHoverActivity();
68
76
  }
69
77
  ngOnDestroy() {
78
+ this._eventCleanups?.forEach(cleanup => cleanup());
70
79
  this.destroyed.next();
71
80
  this.destroyed.complete();
72
81
  }
73
82
  /** Gets the unique CSS class name for this table instance. */
74
83
  getUniqueCssClass() {
75
- return `cdk-column-resize-${this.selectorId}`;
84
+ return this.selectorId;
85
+ }
86
+ /** Gets the ID for this table used for column size persistance. */
87
+ getTableId() {
88
+ return String(this.elementRef.nativeElement.id);
76
89
  }
77
90
  /** Called when a column in the table is resized. Applies a css class to the table element. */
78
91
  setResized() {
@@ -81,13 +94,17 @@ class ColumnResize {
81
94
  _listenForRowHoverEvents() {
82
95
  this.ngZone.runOutsideAngular(() => {
83
96
  const element = this.elementRef.nativeElement;
84
- fromEvent(element, 'mouseover')
85
- .pipe(map(event => closest(event.target, HEADER_CELL_SELECTOR)), takeUntil(this.destroyed))
86
- .subscribe(this.eventDispatcher.headerCellHovered);
87
- fromEvent(element, 'mouseleave')
88
- .pipe(filter(event => !!event.relatedTarget &&
89
- !event.relatedTarget.matches(RESIZE_OVERLAY_SELECTOR)), mapTo(null), takeUntil(this.destroyed))
90
- .subscribe(this.eventDispatcher.headerCellHovered);
97
+ this._eventCleanups = [
98
+ this._renderer.listen(element, 'mouseover', (event) => {
99
+ this.eventDispatcher.headerCellHovered.next(closest(event.target, HEADER_CELL_SELECTOR));
100
+ }),
101
+ this._renderer.listen(element, 'mouseleave', (event) => {
102
+ if (event.relatedTarget &&
103
+ !event.relatedTarget.matches(RESIZE_OVERLAY_SELECTOR)) {
104
+ this.eventDispatcher.headerCellHovered.next(null);
105
+ }
106
+ }),
107
+ ];
91
108
  });
92
109
  }
93
110
  _listenForResizeActivity() {
@@ -109,19 +126,21 @@ class ColumnResize {
109
126
  }
110
127
  });
111
128
  }
112
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
113
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: ColumnResize, isStandalone: true, ngImport: i0 }); }
129
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
130
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.1", type: ColumnResize, isStandalone: true, inputs: { liveResizeUpdates: "liveResizeUpdates" }, ngImport: i0 }); }
114
131
  }
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResize, decorators: [{
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResize, decorators: [{
116
133
  type: Directive
117
- }] });
134
+ }], propDecorators: { liveResizeUpdates: [{
135
+ type: Input
136
+ }] } });
118
137
 
119
138
  /**
120
139
  * @license
121
140
  * Copyright Google LLC All Rights Reserved.
122
141
  *
123
142
  * Use of this source code is governed by an MIT-style license that can be
124
- * found in the LICENSE file at https://angular.io/license
143
+ * found in the LICENSE file at https://angular.dev/license
125
144
  */
126
145
  /**
127
146
  * Originating source of column resize events within a table.
@@ -136,10 +155,10 @@ class ColumnResizeNotifierSource {
136
155
  /** Triggers a resize action. */
137
156
  this.triggerResize = new Subject();
138
157
  }
139
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResizeNotifierSource, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
140
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResizeNotifierSource }); }
158
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResizeNotifierSource, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
159
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResizeNotifierSource }); }
141
160
  }
142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResizeNotifierSource, decorators: [{
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResizeNotifierSource, decorators: [{
143
162
  type: Injectable
144
163
  }] });
145
164
  /** Service for triggering column resizes imperatively or being notified of them. */
@@ -158,10 +177,10 @@ class ColumnResizeNotifier {
158
177
  isStickyColumn: true,
159
178
  });
160
179
  }
161
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResizeNotifier, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
162
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResizeNotifier }); }
180
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResizeNotifier, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
181
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResizeNotifier }); }
163
182
  }
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnResizeNotifier, decorators: [{
183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnResizeNotifier, decorators: [{
165
184
  type: Injectable
166
185
  }] });
167
186
 
@@ -170,7 +189,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
170
189
  * Copyright Google LLC All Rights Reserved.
171
190
  *
172
191
  * Use of this source code is governed by an MIT-style license that can be
173
- * found in the LICENSE file at https://angular.io/license
192
+ * found in the LICENSE file at https://angular.dev/license
174
193
  */
175
194
  /** Coordinates events between the column resize directives. */
176
195
  class HeaderRowEventDispatcher {
@@ -222,10 +241,10 @@ class HeaderRowEventDispatcher {
222
241
  complete: () => observer.complete(),
223
242
  }));
224
243
  }
225
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: HeaderRowEventDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
226
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: HeaderRowEventDispatcher }); }
244
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: HeaderRowEventDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
245
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: HeaderRowEventDispatcher }); }
227
246
  }
228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: HeaderRowEventDispatcher, decorators: [{
247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: HeaderRowEventDispatcher, decorators: [{
229
248
  type: Injectable
230
249
  }] });
231
250
 
@@ -234,7 +253,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
234
253
  * Copyright Google LLC All Rights Reserved.
235
254
  *
236
255
  * Use of this source code is governed by an MIT-style license that can be
237
- * found in the LICENSE file at https://angular.io/license
256
+ * found in the LICENSE file at https://angular.dev/license
257
+ */
258
+ /**
259
+ * @docs-private
260
+ */
261
+ class _Schedule {
262
+ constructor() {
263
+ this.tasks = [];
264
+ this.endTasks = [];
265
+ }
266
+ }
267
+ /** Injection token used to provide a coalesced style scheduler. */
268
+ const _COALESCED_STYLE_SCHEDULER = new InjectionToken('_COALESCED_STYLE_SCHEDULER');
269
+ /**
270
+ * Allows grouping up CSSDom mutations after the current execution context.
271
+ * This can significantly improve performance when separate consecutive functions are
272
+ * reading from the CSSDom and then mutating it.
273
+ *
274
+ * @docs-private
275
+ */
276
+ class _CoalescedStyleScheduler {
277
+ constructor() {
278
+ this._currentSchedule = null;
279
+ this._ngZone = inject(NgZone);
280
+ }
281
+ /**
282
+ * Schedules the specified task to run at the end of the current VM turn.
283
+ */
284
+ schedule(task) {
285
+ this._createScheduleIfNeeded();
286
+ this._currentSchedule.tasks.push(task);
287
+ }
288
+ /**
289
+ * Schedules the specified task to run after other scheduled tasks at the end of the current
290
+ * VM turn.
291
+ */
292
+ scheduleEnd(task) {
293
+ this._createScheduleIfNeeded();
294
+ this._currentSchedule.endTasks.push(task);
295
+ }
296
+ _createScheduleIfNeeded() {
297
+ if (this._currentSchedule) {
298
+ return;
299
+ }
300
+ this._currentSchedule = new _Schedule();
301
+ this._ngZone.runOutsideAngular(() =>
302
+ // TODO(mmalerba): Scheduling this using something that runs less frequently
303
+ // (e.g. requestAnimationFrame, setTimeout, etc.) causes noticeable jank with the column
304
+ // resizer. We should audit the usages of schedule / scheduleEnd in that component and see
305
+ // if we can refactor it so that we don't need to flush the tasks quite so frequently.
306
+ queueMicrotask(() => {
307
+ while (this._currentSchedule.tasks.length || this._currentSchedule.endTasks.length) {
308
+ const schedule = this._currentSchedule;
309
+ // Capture new tasks scheduled by the current set of tasks.
310
+ this._currentSchedule = new _Schedule();
311
+ for (const task of schedule.tasks) {
312
+ task();
313
+ }
314
+ for (const task of schedule.endTasks) {
315
+ task();
316
+ }
317
+ }
318
+ this._currentSchedule = null;
319
+ }));
320
+ }
321
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: _CoalescedStyleScheduler, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
322
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: _CoalescedStyleScheduler }); }
323
+ }
324
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: _CoalescedStyleScheduler, decorators: [{
325
+ type: Injectable
326
+ }], ctorParameters: () => [] });
327
+
328
+ /**
329
+ * @license
330
+ * Copyright Google LLC All Rights Reserved.
331
+ *
332
+ * Use of this source code is governed by an MIT-style license that can be
333
+ * found in the LICENSE file at https://angular.dev/license
238
334
  */
239
335
  /**
240
336
  * Provides an implementation for resizing a column.
@@ -248,7 +344,7 @@ class ResizeStrategy {
248
344
  updateTableWidthAndStickyColumns(delta) {
249
345
  if (this._pendingResizeDelta === null) {
250
346
  const tableElement = this.columnResize.elementRef.nativeElement;
251
- const tableWidth = getElementWidth(tableElement);
347
+ const tableWidth = this.getElementWidth(tableElement);
252
348
  this.styleScheduler.schedule(() => {
253
349
  tableElement.style.width = coerceCssPixelValue(tableWidth + this._pendingResizeDelta);
254
350
  this._pendingResizeDelta = null;
@@ -259,10 +355,16 @@ class ResizeStrategy {
259
355
  }
260
356
  this._pendingResizeDelta = (this._pendingResizeDelta ?? 0) + delta;
261
357
  }
262
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ResizeStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
263
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ResizeStrategy }); }
358
+ /** Gets the style.width pixels on the specified element if present, otherwise its offsetWidth. */
359
+ getElementWidth(element) {
360
+ // Optimization: Check style.width first as we probably set it already before reading
361
+ // offsetWidth which triggers layout.
362
+ return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
363
+ }
364
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ResizeStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
365
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ResizeStrategy }); }
264
366
  }
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ResizeStrategy, decorators: [{
367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ResizeStrategy, decorators: [{
266
368
  type: Injectable
267
369
  }] });
268
370
  /**
@@ -274,13 +376,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
274
376
  */
275
377
  class TableLayoutFixedResizeStrategy extends ResizeStrategy {
276
378
  constructor() {
277
- super();
379
+ super(...arguments);
278
380
  this.columnResize = inject(ColumnResize);
279
381
  this.styleScheduler = inject(_COALESCED_STYLE_SCHEDULER);
280
382
  this.table = inject(CdkTable);
281
383
  }
282
384
  applyColumnSize(_, columnHeader, sizeInPx, previousSizeInPx) {
283
- const delta = sizeInPx - (previousSizeInPx ?? getElementWidth(columnHeader));
385
+ const delta = sizeInPx - (previousSizeInPx ?? this.getElementWidth(columnHeader));
284
386
  if (delta === 0) {
285
387
  return;
286
388
  }
@@ -290,21 +392,21 @@ class TableLayoutFixedResizeStrategy extends ResizeStrategy {
290
392
  this.updateTableWidthAndStickyColumns(delta);
291
393
  }
292
394
  applyMinColumnSize(_, columnHeader, sizeInPx) {
293
- const currentWidth = getElementWidth(columnHeader);
395
+ const currentWidth = this.getElementWidth(columnHeader);
294
396
  const newWidth = Math.max(currentWidth, sizeInPx);
295
397
  this.applyColumnSize(_, columnHeader, newWidth, currentWidth);
296
398
  }
297
399
  applyMaxColumnSize(_, columnHeader, sizeInPx) {
298
- const currentWidth = getElementWidth(columnHeader);
400
+ const currentWidth = this.getElementWidth(columnHeader);
299
401
  const newWidth = Math.min(currentWidth, sizeInPx);
300
402
  this.applyColumnSize(_, columnHeader, newWidth, currentWidth);
301
403
  }
302
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: TableLayoutFixedResizeStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
303
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: TableLayoutFixedResizeStrategy }); }
404
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: TableLayoutFixedResizeStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
405
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: TableLayoutFixedResizeStrategy }); }
304
406
  }
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: TableLayoutFixedResizeStrategy, decorators: [{
407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: TableLayoutFixedResizeStrategy, decorators: [{
306
408
  type: Injectable
307
- }], ctorParameters: () => [] });
409
+ }] });
308
410
  /**
309
411
  * The optimally performing resize strategy for flex mat-tables.
310
412
  * Tested against and outperformed:
@@ -378,7 +480,7 @@ class CdkFlexTableResizeStrategy extends ResizeStrategy {
378
480
  if (!this._styleElement) {
379
481
  this._styleElement = this._document.createElement('style');
380
482
  if (this._nonce) {
381
- this._styleElement.nonce = this._nonce;
483
+ this._styleElement.setAttribute('nonce', this._nonce);
382
484
  }
383
485
  this._styleElement.appendChild(this._document.createTextNode(''));
384
486
  this._document.head.appendChild(this._styleElement);
@@ -414,22 +516,16 @@ class CdkFlexTableResizeStrategy extends ResizeStrategy {
414
516
  const body = propertyKeys.map(key => `${key}:${properties.get(key)}`).join(';');
415
517
  this._getStyleSheet().insertRule(`${selector} {${body}}`, index);
416
518
  }
417
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkFlexTableResizeStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
418
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkFlexTableResizeStrategy }); }
519
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkFlexTableResizeStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
520
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkFlexTableResizeStrategy }); }
419
521
  }
420
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkFlexTableResizeStrategy, decorators: [{
522
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkFlexTableResizeStrategy, decorators: [{
421
523
  type: Injectable
422
524
  }] });
423
525
  /** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
424
526
  function coercePixelsFromCssValue(cssValue) {
425
527
  return Number(cssValue.match(/(\d+)px/)?.[1]);
426
528
  }
427
- /** Gets the style.width pixels on the specified element if present, otherwise its offsetWidth. */
428
- function getElementWidth(element) {
429
- // Optimization: Check style.width first as we probably set it already before reading
430
- // offsetWidth which triggers layout.
431
- return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
432
- }
433
529
  /**
434
530
  * Converts CSS flex values as set in CdkFlexTableResizeStrategy to numbers,
435
531
  * eg "0 0.01 123px" to 123.
@@ -451,12 +547,13 @@ const FLEX_RESIZE_STRATEGY_PROVIDER = {
451
547
  * Copyright Google LLC All Rights Reserved.
452
548
  *
453
549
  * Use of this source code is governed by an MIT-style license that can be
454
- * found in the LICENSE file at https://angular.io/license
550
+ * found in the LICENSE file at https://angular.dev/license
455
551
  */
456
552
  const PROVIDERS = [
457
553
  ColumnResizeNotifier,
458
554
  HeaderRowEventDispatcher,
459
555
  ColumnResizeNotifierSource,
556
+ { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
460
557
  ];
461
558
  const TABLE_PROVIDERS = [
462
559
  ...PROVIDERS,
@@ -469,7 +566,7 @@ const FLEX_PROVIDERS = [...PROVIDERS, FLEX_RESIZE_STRATEGY_PROVIDER];
469
566
  * Copyright Google LLC All Rights Reserved.
470
567
  *
471
568
  * Use of this source code is governed by an MIT-style license that can be
472
- * found in the LICENSE file at https://angular.io/license
569
+ * found in the LICENSE file at https://angular.dev/license
473
570
  */
474
571
  /**
475
572
  * Explicitly enables column resizing for a table-based cdk-table.
@@ -477,7 +574,7 @@ const FLEX_PROVIDERS = [...PROVIDERS, FLEX_RESIZE_STRATEGY_PROVIDER];
477
574
  */
478
575
  class CdkColumnResize extends ColumnResize {
479
576
  constructor() {
480
- super();
577
+ super(...arguments);
481
578
  this.columnResizeNotifier = inject(ColumnResizeNotifier);
482
579
  this.elementRef = inject(ElementRef);
483
580
  this.eventDispatcher = inject(HeaderRowEventDispatcher);
@@ -485,23 +582,23 @@ class CdkColumnResize extends ColumnResize {
485
582
  this.notifier = inject(ColumnResizeNotifierSource);
486
583
  this.table = inject(CdkTable);
487
584
  }
488
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
489
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: CdkColumnResize, isStandalone: true, selector: "table[cdk-table][columnResize]", providers: [...TABLE_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResize }], usesInheritance: true, ngImport: i0 }); }
585
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResize, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
586
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.1", type: CdkColumnResize, isStandalone: true, selector: "table[cdk-table][columnResize]", providers: [...TABLE_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResize }], usesInheritance: true, ngImport: i0 }); }
490
587
  }
491
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResize, decorators: [{
588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResize, decorators: [{
492
589
  type: Directive,
493
590
  args: [{
494
591
  selector: 'table[cdk-table][columnResize]',
495
592
  providers: [...TABLE_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResize }],
496
593
  }]
497
- }], ctorParameters: () => [] });
594
+ }] });
498
595
 
499
596
  /**
500
597
  * @license
501
598
  * Copyright Google LLC All Rights Reserved.
502
599
  *
503
600
  * Use of this source code is governed by an MIT-style license that can be
504
- * found in the LICENSE file at https://angular.io/license
601
+ * found in the LICENSE file at https://angular.dev/license
505
602
  */
506
603
  /**
507
604
  * Explicitly enables column resizing for a flexbox-based cdk-table.
@@ -509,7 +606,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
509
606
  */
510
607
  class CdkColumnResizeFlex extends ColumnResize {
511
608
  constructor() {
512
- super();
609
+ super(...arguments);
513
610
  this.columnResizeNotifier = inject(ColumnResizeNotifier);
514
611
  this.elementRef = inject(ElementRef);
515
612
  this.eventDispatcher = inject(HeaderRowEventDispatcher);
@@ -517,34 +614,34 @@ class CdkColumnResizeFlex extends ColumnResize {
517
614
  this.notifier = inject(ColumnResizeNotifierSource);
518
615
  this.table = inject(CdkTable);
519
616
  }
520
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResizeFlex, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
521
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: CdkColumnResizeFlex, isStandalone: true, selector: "cdk-table[columnResize]", providers: [...FLEX_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResizeFlex }], usesInheritance: true, ngImport: i0 }); }
617
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResizeFlex, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
618
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.1", type: CdkColumnResizeFlex, isStandalone: true, selector: "cdk-table[columnResize]", providers: [...FLEX_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResizeFlex }], usesInheritance: true, ngImport: i0 }); }
522
619
  }
523
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResizeFlex, decorators: [{
620
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResizeFlex, decorators: [{
524
621
  type: Directive,
525
622
  args: [{
526
623
  selector: 'cdk-table[columnResize]',
527
624
  providers: [...FLEX_PROVIDERS, { provide: ColumnResize, useExisting: CdkColumnResizeFlex }],
528
625
  }]
529
- }], ctorParameters: () => [] });
626
+ }] });
530
627
 
531
628
  /**
532
629
  * @license
533
630
  * Copyright Google LLC All Rights Reserved.
534
631
  *
535
632
  * Use of this source code is governed by an MIT-style license that can be
536
- * found in the LICENSE file at https://angular.io/license
633
+ * found in the LICENSE file at https://angular.dev/license
537
634
  */
538
635
  /**
539
636
  * One of two NgModules for use with CdkColumnResize.
540
637
  * When using this module, columns are not resizable by default.
541
638
  */
542
639
  class CdkColumnResizeModule {
543
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResizeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
544
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResizeModule, imports: [CdkColumnResize, CdkColumnResizeFlex], exports: [CdkColumnResize, CdkColumnResizeFlex] }); }
545
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResizeModule }); }
640
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResizeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
641
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResizeModule, imports: [CdkColumnResize, CdkColumnResizeFlex], exports: [CdkColumnResize, CdkColumnResizeFlex] }); }
642
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResizeModule }); }
546
643
  }
547
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: CdkColumnResizeModule, decorators: [{
644
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: CdkColumnResizeModule, decorators: [{
548
645
  type: NgModule,
549
646
  args: [{
550
647
  imports: [CdkColumnResize, CdkColumnResizeFlex],
@@ -557,16 +654,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
557
654
  * Copyright Google LLC All Rights Reserved.
558
655
  *
559
656
  * Use of this source code is governed by an MIT-style license that can be
560
- * found in the LICENSE file at https://angular.io/license
657
+ * found in the LICENSE file at https://angular.dev/license
561
658
  */
562
659
  /**
563
660
  * Can be provided by the host application to enable persistence of column resize state.
564
661
  */
565
662
  class ColumnSizeStore {
566
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnSizeStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
567
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnSizeStore }); }
663
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnSizeStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
664
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnSizeStore }); }
568
665
  }
569
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ColumnSizeStore, decorators: [{
666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ColumnSizeStore, decorators: [{
570
667
  type: Injectable
571
668
  }] });
572
669
 
@@ -575,15 +672,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
575
672
  * Copyright Google LLC All Rights Reserved.
576
673
  *
577
674
  * Use of this source code is governed by an MIT-style license that can be
578
- * found in the LICENSE file at https://angular.io/license
675
+ * found in the LICENSE file at https://angular.dev/license
579
676
  */
580
677
  /** Tracks state of resize events in progress. */
581
678
  class ResizeRef {
582
- constructor(origin, overlayRef, minWidthPx, maxWidthPx) {
679
+ constructor(origin, overlayRef, minWidthPx, maxWidthPx, liveUpdates = true) {
583
680
  this.origin = origin;
584
681
  this.overlayRef = overlayRef;
585
682
  this.minWidthPx = minWidthPx;
586
683
  this.maxWidthPx = maxWidthPx;
684
+ this.liveUpdates = liveUpdates;
587
685
  }
588
686
  }
589
687
 
@@ -771,10 +869,10 @@ class Resizable {
771
869
  this.elementRef.nativeElement.appendChild(this.inlineHandle);
772
870
  });
773
871
  }
774
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: Resizable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
775
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: Resizable, isStandalone: true, ngImport: i0 }); }
872
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: Resizable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
873
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.1", type: Resizable, isStandalone: true, ngImport: i0 }); }
776
874
  }
777
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: Resizable, decorators: [{
875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: Resizable, decorators: [{
778
876
  type: Directive
779
877
  }] });
780
878
 
@@ -783,7 +881,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
783
881
  * Copyright Google LLC All Rights Reserved.
784
882
  *
785
883
  * Use of this source code is governed by an MIT-style license that can be
786
- * found in the LICENSE file at https://angular.io/license
884
+ * found in the LICENSE file at https://angular.dev/license
787
885
  */
788
886
  // TODO: Take another look at using cdk drag drop. IIRC I ran into a couple
789
887
  // good reasons for not using it but I don't remember what they were at this point.
@@ -793,7 +891,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
793
891
  */
794
892
  class ResizeOverlayHandle {
795
893
  constructor() {
894
+ this._renderer = inject(Renderer2);
796
895
  this.destroyed = new Subject();
896
+ this._cumulativeDeltaX = 0;
797
897
  }
798
898
  ngAfterViewInit() {
799
899
  this._listenForMouseEvents();
@@ -804,13 +904,13 @@ class ResizeOverlayHandle {
804
904
  }
805
905
  _listenForMouseEvents() {
806
906
  this.ngZone.runOutsideAngular(() => {
807
- fromEvent(this.elementRef.nativeElement, 'mouseenter')
907
+ this._observableFromEvent(this.elementRef.nativeElement, 'mouseenter')
808
908
  .pipe(mapTo(this.resizeRef.origin.nativeElement), takeUntil(this.destroyed))
809
909
  .subscribe(cell => this.eventDispatcher.headerCellHovered.next(cell));
810
- fromEvent(this.elementRef.nativeElement, 'mouseleave')
910
+ this._observableFromEvent(this.elementRef.nativeElement, 'mouseleave')
811
911
  .pipe(map(event => event.relatedTarget && closest(event.relatedTarget, HEADER_CELL_SELECTOR)), takeUntil(this.destroyed))
812
912
  .subscribe(cell => this.eventDispatcher.headerCellHovered.next(cell));
813
- fromEvent(this.elementRef.nativeElement, 'mousedown')
913
+ this._observableFromEvent(this.elementRef.nativeElement, 'mousedown')
814
914
  .pipe(takeUntil(this.destroyed))
815
915
  .subscribe(mousedownEvent => {
816
916
  this._dragStarted(mousedownEvent);
@@ -822,15 +922,16 @@ class ResizeOverlayHandle {
822
922
  if (mousedownEvent.button !== 0) {
823
923
  return;
824
924
  }
825
- const mouseup = fromEvent(this.document, 'mouseup');
826
- const mousemove = fromEvent(this.document, 'mousemove');
827
- const escape = fromEvent(this.document, 'keyup').pipe(filter(event => event.keyCode === ESCAPE));
925
+ const mouseup = this._observableFromEvent(this.document, 'mouseup');
926
+ const mousemove = this._observableFromEvent(this.document, 'mousemove');
927
+ const escape = this._observableFromEvent(this.document, 'keyup').pipe(filter(event => event.keyCode === ESCAPE));
828
928
  const startX = mousedownEvent.screenX;
829
929
  const initialSize = this._getOriginWidth();
830
930
  let overlayOffset = 0;
831
931
  let originOffset = this._getOriginOffset();
832
932
  let size = initialSize;
833
933
  let overshot = 0;
934
+ this._cumulativeDeltaX = 0;
834
935
  this.updateResizeActive(true);
835
936
  mouseup.pipe(takeUntil(merge(escape, this.destroyed))).subscribe(({ screenX }) => {
836
937
  this.styleScheduler.scheduleEnd(() => {
@@ -844,6 +945,12 @@ class ResizeOverlayHandle {
844
945
  .pipe(map(({ screenX }) => screenX), startWith(startX), distinctUntilChanged(), pairwise(), takeUntil(merge(mouseup, escape, this.destroyed)))
845
946
  .subscribe(([prevX, currX]) => {
846
947
  let deltaX = currX - prevX;
948
+ if (!this.resizeRef.liveUpdates) {
949
+ this._cumulativeDeltaX += deltaX;
950
+ const sizeDelta = this._computeNewSize(size, this._cumulativeDeltaX) - size;
951
+ this._updateOverlayOffset(sizeDelta);
952
+ return;
953
+ }
847
954
  // If the mouse moved further than the resize was able to match, limit the
848
955
  // movement of the overlay to match the actual size and position of the origin.
849
956
  if (overshot !== 0) {
@@ -861,14 +968,7 @@ class ResizeOverlayHandle {
861
968
  }
862
969
  }
863
970
  }
864
- let computedNewSize = size + (this._isLtr() ? deltaX : -deltaX);
865
- computedNewSize = Math.min(Math.max(computedNewSize, this.resizeRef.minWidthPx, 0), this.resizeRef.maxWidthPx);
866
- this.resizeNotifier.triggerResize.next({
867
- columnId: this.columnDef.name,
868
- size: computedNewSize,
869
- previousSize: size,
870
- isStickyColumn: this.columnDef.sticky || this.columnDef.stickyEnd,
871
- });
971
+ this._triggerResize(size, deltaX);
872
972
  this.styleScheduler.scheduleEnd(() => {
873
973
  const originNewSize = this._getOriginWidth();
874
974
  const originNewOffset = this._getOriginOffset();
@@ -885,6 +985,19 @@ class ResizeOverlayHandle {
885
985
  updateResizeActive(active) {
886
986
  this.eventDispatcher.overlayHandleActiveForCell.next(active ? this.resizeRef.origin.nativeElement : null);
887
987
  }
988
+ _triggerResize(startSize, deltaX) {
989
+ this.resizeNotifier.triggerResize.next({
990
+ columnId: this.columnDef.name,
991
+ size: this._computeNewSize(startSize, deltaX),
992
+ previousSize: startSize,
993
+ isStickyColumn: this.columnDef.sticky || this.columnDef.stickyEnd,
994
+ });
995
+ }
996
+ _computeNewSize(startSize, deltaX) {
997
+ let computedNewSize = startSize + (this._isLtr() ? deltaX : -deltaX);
998
+ computedNewSize = Math.min(Math.max(computedNewSize, this.resizeRef.minWidthPx, 0), this.resizeRef.maxWidthPx);
999
+ return computedNewSize;
1000
+ }
888
1001
  _getOriginWidth() {
889
1002
  return this.resizeRef.origin.nativeElement.offsetWidth;
890
1003
  }
@@ -900,8 +1013,14 @@ class ResizeOverlayHandle {
900
1013
  _notifyResizeEnded(size, completedSuccessfully = false) {
901
1014
  this.updateResizeActive(false);
902
1015
  this.ngZone.run(() => {
903
- const sizeMessage = { columnId: this.columnDef.name, size };
1016
+ const sizeMessage = {
1017
+ columnId: this.columnDef.name,
1018
+ size: this._computeNewSize(size, this._cumulativeDeltaX),
1019
+ };
904
1020
  if (completedSuccessfully) {
1021
+ if (!this.resizeRef.liveUpdates) {
1022
+ this._triggerResize(size, this._cumulativeDeltaX);
1023
+ }
905
1024
  this.resizeNotifier.resizeCompleted.next(sizeMessage);
906
1025
  }
907
1026
  else {
@@ -909,10 +1028,20 @@ class ResizeOverlayHandle {
909
1028
  }
910
1029
  });
911
1030
  }
912
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ResizeOverlayHandle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
913
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: ResizeOverlayHandle, isStandalone: true, ngImport: i0 }); }
1031
+ _observableFromEvent(element, name) {
1032
+ return new Observable(subscriber => {
1033
+ const handler = (event) => subscriber.next(event);
1034
+ const cleanup = this._renderer.listen(element, name, handler);
1035
+ return () => {
1036
+ cleanup();
1037
+ subscriber.complete();
1038
+ };
1039
+ });
1040
+ }
1041
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ResizeOverlayHandle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1042
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.1", type: ResizeOverlayHandle, isStandalone: true, ngImport: i0 }); }
914
1043
  }
915
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ResizeOverlayHandle, decorators: [{
1044
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: ResizeOverlayHandle, decorators: [{
916
1045
  type: Directive
917
1046
  }] });
918
1047
 
@@ -920,5 +1049,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
920
1049
  * Generated bundle index. Do not edit.
921
1050
  */
922
1051
 
923
- export { CdkColumnResize, CdkColumnResizeFlex, CdkColumnResizeModule, CdkFlexTableResizeStrategy, ColumnResize, ColumnResizeNotifier, ColumnResizeNotifierSource, ColumnSizeStore, FLEX_PROVIDERS, FLEX_RESIZE_STRATEGY_PROVIDER, HeaderRowEventDispatcher, Resizable, ResizeOverlayHandle, ResizeRef, ResizeStrategy, TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER, TABLE_PROVIDERS, TableLayoutFixedResizeStrategy };
1052
+ export { COLUMN_RESIZE_OPTIONS, CdkColumnResize, CdkColumnResizeFlex, CdkColumnResizeModule, CdkFlexTableResizeStrategy, ColumnResize, ColumnResizeNotifier, ColumnResizeNotifierSource, ColumnSizeStore, FLEX_PROVIDERS, FLEX_RESIZE_STRATEGY_PROVIDER, HeaderRowEventDispatcher, Resizable, ResizeOverlayHandle, ResizeRef, ResizeStrategy, TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER, TABLE_PROVIDERS, TableLayoutFixedResizeStrategy, _COALESCED_STYLE_SCHEDULER, _CoalescedStyleScheduler, _Schedule };
924
1053
  //# sourceMappingURL=mtxColumnResize.mjs.map