@angular/cdk 10.1.1 → 10.2.0

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 (223) hide show
  1. package/a11y/index.metadata.json +1 -1
  2. package/a11y/key-manager/list-key-manager.d.ts +4 -3
  3. package/bundles/cdk-a11y.umd.js +440 -384
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +34 -10
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-accordion.umd.js +40 -40
  8. package/bundles/cdk-accordion.umd.js.map +1 -1
  9. package/bundles/cdk-accordion.umd.min.js +10 -2
  10. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  11. package/bundles/cdk-bidi.umd.js +25 -25
  12. package/bundles/cdk-bidi.umd.js.map +1 -1
  13. package/bundles/cdk-bidi.umd.min.js +5 -4
  14. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  15. package/bundles/cdk-clipboard.umd.js +37 -36
  16. package/bundles/cdk-clipboard.umd.js.map +1 -1
  17. package/bundles/cdk-clipboard.umd.min.js +10 -2
  18. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  19. package/bundles/cdk-coercion.umd.js.map +1 -1
  20. package/bundles/cdk-collections.umd.js +498 -238
  21. package/bundles/cdk-collections.umd.js.map +1 -1
  22. package/bundles/cdk-collections.umd.min.js +6 -4
  23. package/bundles/cdk-collections.umd.min.js.map +1 -1
  24. package/bundles/cdk-drag-drop.umd.js +508 -448
  25. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  26. package/bundles/cdk-drag-drop.umd.min.js +64 -8
  27. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  28. package/bundles/cdk-keycodes.umd.js.map +1 -1
  29. package/bundles/cdk-layout.umd.js +30 -26
  30. package/bundles/cdk-layout.umd.js.map +1 -1
  31. package/bundles/cdk-layout.umd.min.js +7 -6
  32. package/bundles/cdk-layout.umd.min.js.map +1 -1
  33. package/bundles/cdk-observers.umd.js +34 -34
  34. package/bundles/cdk-observers.umd.js.map +1 -1
  35. package/bundles/cdk-observers.umd.min.js +2 -2
  36. package/bundles/cdk-observers.umd.min.js.map +1 -1
  37. package/bundles/cdk-overlay.umd.js +492 -435
  38. package/bundles/cdk-overlay.umd.js.map +1 -1
  39. package/bundles/cdk-overlay.umd.min.js +51 -11
  40. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  41. package/bundles/cdk-platform.umd.js +38 -11
  42. package/bundles/cdk-platform.umd.js.map +1 -1
  43. package/bundles/cdk-platform.umd.min.js +5 -12
  44. package/bundles/cdk-platform.umd.min.js.map +1 -1
  45. package/bundles/cdk-portal.umd.js +385 -322
  46. package/bundles/cdk-portal.umd.js.map +1 -1
  47. package/bundles/cdk-portal.umd.min.js +3 -12
  48. package/bundles/cdk-portal.umd.min.js.map +1 -1
  49. package/bundles/cdk-scrolling.umd.js +503 -490
  50. package/bundles/cdk-scrolling.umd.js.map +1 -1
  51. package/bundles/cdk-scrolling.umd.min.js +20 -34
  52. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  53. package/bundles/cdk-stepper.umd.js +135 -136
  54. package/bundles/cdk-stepper.umd.js.map +1 -1
  55. package/bundles/cdk-stepper.umd.min.js +11 -2
  56. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  57. package/bundles/cdk-table.umd.js +923 -653
  58. package/bundles/cdk-table.umd.js.map +1 -1
  59. package/bundles/cdk-table.umd.min.js +7 -22
  60. package/bundles/cdk-table.umd.min.js.map +1 -1
  61. package/bundles/cdk-testing-protractor.umd.js +310 -245
  62. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  63. package/bundles/cdk-testing-protractor.umd.min.js +2 -9
  64. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  65. package/bundles/cdk-testing-testbed.umd.js +341 -292
  66. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  67. package/bundles/cdk-testing-testbed.umd.min.js +6 -29
  68. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  69. package/bundles/cdk-testing.umd.js +342 -270
  70. package/bundles/cdk-testing.umd.js.map +1 -1
  71. package/bundles/cdk-testing.umd.min.js +3 -17
  72. package/bundles/cdk-testing.umd.min.js.map +1 -1
  73. package/bundles/cdk-text-field.umd.js +53 -53
  74. package/bundles/cdk-text-field.umd.js.map +1 -1
  75. package/bundles/cdk-text-field.umd.min.js +10 -2
  76. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  77. package/bundles/cdk-tree.umd.js +481 -417
  78. package/bundles/cdk-tree.umd.js.map +1 -1
  79. package/bundles/cdk-tree.umd.min.js +28 -3
  80. package/bundles/cdk-tree.umd.min.js.map +1 -1
  81. package/bundles/cdk.umd.js +1 -1
  82. package/bundles/cdk.umd.js.map +1 -1
  83. package/bundles/cdk.umd.min.js +1 -1
  84. package/bundles/cdk.umd.min.js.map +1 -1
  85. package/collections/dispose-view-repeater-strategy.d.ts +22 -0
  86. package/collections/index.metadata.json +1 -1
  87. package/collections/public-api.d.ts +3 -0
  88. package/collections/recycle-view-repeater-strategy.d.ts +56 -0
  89. package/collections/view-repeater.d.ts +94 -0
  90. package/drag-drop/index.d.ts +1 -2
  91. package/drag-drop/index.metadata.json +1 -1
  92. package/drag-drop/public-api.d.ts +2 -1
  93. package/esm2015/a11y/aria-describer/aria-describer.js +3 -3
  94. package/esm2015/a11y/focus-monitor/focus-monitor.js +3 -3
  95. package/esm2015/a11y/focus-trap/focus-trap.js +5 -4
  96. package/esm2015/a11y/key-manager/list-key-manager.js +8 -6
  97. package/esm2015/clipboard/pending-copy.js +7 -6
  98. package/esm2015/collections/collection-viewer.js +1 -0
  99. package/esm2015/collections/dispose-view-repeater-strategy.js +48 -0
  100. package/esm2015/collections/public-api.js +4 -1
  101. package/esm2015/collections/recycle-view-repeater-strategy.js +128 -0
  102. package/esm2015/collections/selection-model.js +2 -2
  103. package/esm2015/collections/tree-adapter.js +1 -0
  104. package/esm2015/collections/view-repeater.js +16 -0
  105. package/esm2015/drag-drop/clone-node.js +9 -1
  106. package/esm2015/drag-drop/directives/drag-handle.js +1 -3
  107. package/esm2015/drag-drop/directives/drag.js +7 -5
  108. package/esm2015/drag-drop/directives/drop-list.js +3 -3
  109. package/esm2015/drag-drop/drag-events.js +1 -0
  110. package/esm2015/drag-drop/drag-ref.js +2 -2
  111. package/esm2015/drag-drop/index.js +1 -3
  112. package/esm2015/drag-drop/public-api.js +3 -2
  113. package/esm2015/layout/breakpoints-observer.js +9 -9
  114. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +11 -9
  115. package/esm2015/overlay/overlay-config.js +1 -5
  116. package/esm2015/overlay/overlay-directives.js +18 -2
  117. package/esm2015/overlay/overlay-ref.js +6 -8
  118. package/esm2015/overlay/overlay-reference.js +1 -0
  119. package/esm2015/overlay/overlay.js +4 -4
  120. package/esm2015/overlay/position/connected-position-strategy.js +2 -9
  121. package/esm2015/overlay/position/flexible-connected-position-strategy.js +19 -16
  122. package/esm2015/overlay/position/position-strategy.js +1 -0
  123. package/esm2015/overlay/scroll/close-scroll-strategy.js +2 -2
  124. package/esm2015/overlay/scroll/reposition-scroll-strategy.js +2 -2
  125. package/esm2015/platform/features/scrolling.js +29 -2
  126. package/esm2015/portal/dom-portal-outlet.js +7 -4
  127. package/esm2015/portal/portal-directives.js +3 -3
  128. package/esm2015/portal/portal-injector.js +3 -1
  129. package/esm2015/portal/portal.js +25 -19
  130. package/esm2015/scrolling/fixed-size-virtual-scroll.js +2 -2
  131. package/esm2015/scrolling/scrolling-module.js +4 -1
  132. package/esm2015/scrolling/virtual-for-of.js +67 -92
  133. package/esm2015/scrolling/virtual-scroll-repeater.js +1 -0
  134. package/esm2015/scrolling/virtual-scroll-viewport.js +5 -5
  135. package/esm2015/stepper/stepper.js +19 -17
  136. package/esm2015/table/cell.js +34 -14
  137. package/esm2015/table/coalesced-style-scheduler.js +87 -0
  138. package/esm2015/table/public-api.js +2 -1
  139. package/esm2015/table/sticky-styler.js +79 -45
  140. package/esm2015/table/table-module.js +4 -2
  141. package/esm2015/table/table.js +70 -44
  142. package/esm2015/table/text-column.js +9 -5
  143. package/esm2015/testing/element-dimensions.js +1 -0
  144. package/esm2015/testing/protractor/protractor-element.js +6 -3
  145. package/esm2015/testing/public-api.js +2 -1
  146. package/esm2015/testing/test-element.js +1 -1
  147. package/esm2015/testing/testbed/task-state-zone-interceptor.js +2 -2
  148. package/esm2015/testing/testbed/unit-test-element.js +26 -21
  149. package/esm2015/testing/text-filtering.js +23 -0
  150. package/esm2015/text-field/autofill.js +3 -3
  151. package/esm2015/tree/control/tree-control.js +1 -0
  152. package/esm2015/tree/nested-node.js +2 -2
  153. package/esm2015/tree/padding.js +34 -20
  154. package/esm2015/tree/tree.js +14 -27
  155. package/esm2015/version.js +1 -1
  156. package/fesm2015/a11y.js +15 -12
  157. package/fesm2015/a11y.js.map +1 -1
  158. package/fesm2015/cdk.js +1 -1
  159. package/fesm2015/cdk.js.map +1 -1
  160. package/fesm2015/clipboard.js +6 -5
  161. package/fesm2015/clipboard.js.map +1 -1
  162. package/fesm2015/collections.js +194 -3
  163. package/fesm2015/collections.js.map +1 -1
  164. package/fesm2015/drag-drop.js +32 -23
  165. package/fesm2015/drag-drop.js.map +1 -1
  166. package/fesm2015/layout.js +8 -8
  167. package/fesm2015/layout.js.map +1 -1
  168. package/fesm2015/overlay.js +55 -48
  169. package/fesm2015/overlay.js.map +1 -1
  170. package/fesm2015/platform.js +28 -1
  171. package/fesm2015/platform.js.map +1 -1
  172. package/fesm2015/portal.js +34 -23
  173. package/fesm2015/portal.js.map +1 -1
  174. package/fesm2015/scrolling.js +72 -95
  175. package/fesm2015/scrolling.js.map +1 -1
  176. package/fesm2015/stepper.js +19 -17
  177. package/fesm2015/stepper.js.map +1 -1
  178. package/fesm2015/table.js +274 -105
  179. package/fesm2015/table.js.map +1 -1
  180. package/fesm2015/testing/protractor.js +5 -2
  181. package/fesm2015/testing/protractor.js.map +1 -1
  182. package/fesm2015/testing/testbed.js +26 -21
  183. package/fesm2015/testing/testbed.js.map +1 -1
  184. package/fesm2015/testing.js +24 -1
  185. package/fesm2015/testing.js.map +1 -1
  186. package/fesm2015/text-field.js +2 -2
  187. package/fesm2015/text-field.js.map +1 -1
  188. package/fesm2015/tree.js +46 -45
  189. package/fesm2015/tree.js.map +1 -1
  190. package/layout/breakpoints-observer.d.ts +3 -3
  191. package/overlay/index.metadata.json +1 -1
  192. package/overlay/overlay-config.d.ts +0 -4
  193. package/overlay/overlay-directives.d.ts +1 -0
  194. package/overlay/position/connected-position-strategy.d.ts +1 -3
  195. package/package.json +1 -1
  196. package/platform/index.metadata.json +1 -1
  197. package/portal/index.metadata.json +1 -1
  198. package/portal/portal-injector.d.ts +2 -0
  199. package/schematics/index.js +1 -1
  200. package/schematics/ng-add/index.js +1 -1
  201. package/schematics/ng-update/data/index.js +1 -1
  202. package/schematics/ng-update/public-api.js +1 -1
  203. package/schematics/update-tool/public-api.js +1 -1
  204. package/schematics/utils/index.js +1 -1
  205. package/scrolling/index.metadata.json +1 -1
  206. package/scrolling/scrolling-module.d.ts +3 -0
  207. package/scrolling/virtual-for-of.d.ts +11 -19
  208. package/stepper/index.metadata.json +1 -1
  209. package/stepper/stepper.d.ts +7 -10
  210. package/table/cell.d.ts +21 -1
  211. package/table/coalesced-style-scheduler.d.ts +41 -0
  212. package/table/index.metadata.json +1 -1
  213. package/table/public-api.d.ts +1 -0
  214. package/table/sticky-styler.d.ts +7 -1
  215. package/table/table.d.ts +14 -8
  216. package/testing/protractor/protractor-element.d.ts +2 -2
  217. package/testing/public-api.d.ts +1 -0
  218. package/testing/test-element.d.ts +9 -2
  219. package/testing/testbed/unit-test-element.d.ts +9 -2
  220. package/testing/text-filtering.d.ts +13 -0
  221. package/tree/index.metadata.json +1 -1
  222. package/tree/padding.d.ts +14 -0
  223. package/tree/tree.d.ts +2 -4
@@ -1,244 +1,310 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/bidi'), require('@angular/cdk/coercion'), require('@angular/cdk/collections'), require('@angular/cdk/platform'), require('@angular/common'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@angular/cdk/table', ['exports', '@angular/cdk/bidi', '@angular/cdk/coercion', '@angular/cdk/collections', '@angular/cdk/platform', '@angular/common', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.table = {}), global.ng.cdk.bidi, global.ng.cdk.coercion, global.ng.cdk.collections, global.ng.cdk.platform, global.ng.common, global.ng.core, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, bidi, coercion, collections, platform, common, core, rxjs, operators) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/bidi'), require('@angular/cdk/coercion'), require('@angular/cdk/collections'), require('@angular/cdk/platform'), require('@angular/common'), require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/scrolling')) :
3
+ typeof define === 'function' && define.amd ? define('@angular/cdk/table', ['exports', '@angular/cdk/bidi', '@angular/cdk/coercion', '@angular/cdk/collections', '@angular/cdk/platform', '@angular/common', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/cdk/scrolling'], factory) :
4
+ (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.table = {}), global.ng.cdk.bidi, global.ng.cdk.coercion, global.ng.cdk.collections, global.ng.cdk.platform, global.ng.common, global.ng.core, global.rxjs, global.rxjs.operators, global.ng.cdk.scrolling));
5
+ }(this, (function (exports, bidi, coercion, collections, platform, common, core, rxjs, operators, scrolling) { 'use strict';
6
6
 
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
- function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
- function verb(n) { return function (v) { return step([n, v]); }; }
88
- function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
- }
110
- }
111
-
112
- var __createBinding = Object.create ? (function(o, m, k, k2) {
113
- if (k2 === undefined) k2 = k;
114
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
115
- }) : (function(o, m, k, k2) {
116
- if (k2 === undefined) k2 = k;
117
- o[k2] = m[k];
118
- });
119
-
120
- function __exportStar(m, exports) {
121
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
122
- }
123
-
124
- function __values(o) {
125
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
126
- if (m) return m.call(o);
127
- if (o && typeof o.length === "number") return {
128
- next: function () {
129
- if (o && i >= o.length) o = void 0;
130
- return { value: o && o[i++], done: !o };
131
- }
132
- };
133
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
134
- }
135
-
136
- function __read(o, n) {
137
- var m = typeof Symbol === "function" && o[Symbol.iterator];
138
- if (!m) return o;
139
- var i = m.call(o), r, ar = [], e;
140
- try {
141
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
142
- }
143
- catch (error) { e = { error: error }; }
144
- finally {
145
- try {
146
- if (r && !r.done && (m = i["return"])) m.call(i);
147
- }
148
- finally { if (e) throw e.error; }
149
- }
150
- return ar;
151
- }
152
-
153
- function __spread() {
154
- for (var ar = [], i = 0; i < arguments.length; i++)
155
- ar = ar.concat(__read(arguments[i]));
156
- return ar;
157
- }
158
-
159
- function __spreadArrays() {
160
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
161
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
162
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
163
- r[k] = a[j];
164
- return r;
165
- };
166
-
167
- function __await(v) {
168
- return this instanceof __await ? (this.v = v, this) : new __await(v);
169
- }
170
-
171
- function __asyncGenerator(thisArg, _arguments, generator) {
172
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
173
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
174
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
175
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
176
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
177
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
178
- function fulfill(value) { resume("next", value); }
179
- function reject(value) { resume("throw", value); }
180
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
181
- }
182
-
183
- function __asyncDelegator(o) {
184
- var i, p;
185
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
186
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
187
- }
188
-
189
- function __asyncValues(o) {
190
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
191
- var m = o[Symbol.asyncIterator], i;
192
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
193
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
194
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
195
- }
196
-
197
- function __makeTemplateObject(cooked, raw) {
198
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
199
- return cooked;
200
- };
201
-
202
- var __setModuleDefault = Object.create ? (function(o, v) {
203
- Object.defineProperty(o, "default", { enumerable: true, value: v });
204
- }) : function(o, v) {
205
- o["default"] = v;
206
- };
207
-
208
- function __importStar(mod) {
209
- if (mod && mod.__esModule) return mod;
210
- var result = {};
211
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
212
- __setModuleDefault(result, mod);
213
- return result;
214
- }
215
-
216
- function __importDefault(mod) {
217
- return (mod && mod.__esModule) ? mod : { default: mod };
218
- }
219
-
220
- function __classPrivateFieldGet(receiver, privateMap) {
221
- if (!privateMap.has(receiver)) {
222
- throw new TypeError("attempted to get private field on non-instance");
223
- }
224
- return privateMap.get(receiver);
225
- }
226
-
227
- function __classPrivateFieldSet(receiver, privateMap, value) {
228
- if (!privateMap.has(receiver)) {
229
- throw new TypeError("attempted to set private field on non-instance");
230
- }
231
- privateMap.set(receiver, value);
232
- return value;
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+ var extendStatics = function (d, b) {
23
+ extendStatics = Object.setPrototypeOf ||
24
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
+ function (d, b) { for (var p in b)
26
+ if (b.hasOwnProperty(p))
27
+ d[p] = b[p]; };
28
+ return extendStatics(d, b);
29
+ };
30
+ function __extends(d, b) {
31
+ extendStatics(d, b);
32
+ function __() { this.constructor = d; }
33
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
+ }
35
+ var __assign = function () {
36
+ __assign = Object.assign || function __assign(t) {
37
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
38
+ s = arguments[i];
39
+ for (var p in s)
40
+ if (Object.prototype.hasOwnProperty.call(s, p))
41
+ t[p] = s[p];
42
+ }
43
+ return t;
44
+ };
45
+ return __assign.apply(this, arguments);
46
+ };
47
+ function __rest(s, e) {
48
+ var t = {};
49
+ for (var p in s)
50
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
+ t[p] = s[p];
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
+ t[p[i]] = s[p[i]];
56
+ }
57
+ return t;
58
+ }
59
+ function __decorate(decorators, target, key, desc) {
60
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
+ r = Reflect.decorate(decorators, target, key, desc);
63
+ else
64
+ for (var i = decorators.length - 1; i >= 0; i--)
65
+ if (d = decorators[i])
66
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
68
+ }
69
+ function __param(paramIndex, decorator) {
70
+ return function (target, key) { decorator(target, key, paramIndex); };
71
+ }
72
+ function __metadata(metadataKey, metadataValue) {
73
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
+ return Reflect.metadata(metadataKey, metadataValue);
75
+ }
76
+ function __awaiter(thisArg, _arguments, P, generator) {
77
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
+ return new (P || (P = Promise))(function (resolve, reject) {
79
+ function fulfilled(value) { try {
80
+ step(generator.next(value));
81
+ }
82
+ catch (e) {
83
+ reject(e);
84
+ } }
85
+ function rejected(value) { try {
86
+ step(generator["throw"](value));
87
+ }
88
+ catch (e) {
89
+ reject(e);
90
+ } }
91
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
93
+ });
94
+ }
95
+ function __generator(thisArg, body) {
96
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
97
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
98
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
99
+ function verb(n) { return function (v) { return step([n, v]); }; }
100
+ function step(op) {
101
+ if (f)
102
+ throw new TypeError("Generator is already executing.");
103
+ while (_)
104
+ try {
105
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
106
+ return t;
107
+ if (y = 0, t)
108
+ op = [op[0] & 2, t.value];
109
+ switch (op[0]) {
110
+ case 0:
111
+ case 1:
112
+ t = op;
113
+ break;
114
+ case 4:
115
+ _.label++;
116
+ return { value: op[1], done: false };
117
+ case 5:
118
+ _.label++;
119
+ y = op[1];
120
+ op = [0];
121
+ continue;
122
+ case 7:
123
+ op = _.ops.pop();
124
+ _.trys.pop();
125
+ continue;
126
+ default:
127
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
128
+ _ = 0;
129
+ continue;
130
+ }
131
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
132
+ _.label = op[1];
133
+ break;
134
+ }
135
+ if (op[0] === 6 && _.label < t[1]) {
136
+ _.label = t[1];
137
+ t = op;
138
+ break;
139
+ }
140
+ if (t && _.label < t[2]) {
141
+ _.label = t[2];
142
+ _.ops.push(op);
143
+ break;
144
+ }
145
+ if (t[2])
146
+ _.ops.pop();
147
+ _.trys.pop();
148
+ continue;
149
+ }
150
+ op = body.call(thisArg, _);
151
+ }
152
+ catch (e) {
153
+ op = [6, e];
154
+ y = 0;
155
+ }
156
+ finally {
157
+ f = t = 0;
158
+ }
159
+ if (op[0] & 5)
160
+ throw op[1];
161
+ return { value: op[0] ? op[1] : void 0, done: true };
162
+ }
163
+ }
164
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
165
+ if (k2 === undefined)
166
+ k2 = k;
167
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
168
+ }) : (function (o, m, k, k2) {
169
+ if (k2 === undefined)
170
+ k2 = k;
171
+ o[k2] = m[k];
172
+ });
173
+ function __exportStar(m, exports) {
174
+ for (var p in m)
175
+ if (p !== "default" && !exports.hasOwnProperty(p))
176
+ __createBinding(exports, m, p);
177
+ }
178
+ function __values(o) {
179
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
180
+ if (m)
181
+ return m.call(o);
182
+ if (o && typeof o.length === "number")
183
+ return {
184
+ next: function () {
185
+ if (o && i >= o.length)
186
+ o = void 0;
187
+ return { value: o && o[i++], done: !o };
188
+ }
189
+ };
190
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
191
+ }
192
+ function __read(o, n) {
193
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
194
+ if (!m)
195
+ return o;
196
+ var i = m.call(o), r, ar = [], e;
197
+ try {
198
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
199
+ ar.push(r.value);
200
+ }
201
+ catch (error) {
202
+ e = { error: error };
203
+ }
204
+ finally {
205
+ try {
206
+ if (r && !r.done && (m = i["return"]))
207
+ m.call(i);
208
+ }
209
+ finally {
210
+ if (e)
211
+ throw e.error;
212
+ }
213
+ }
214
+ return ar;
215
+ }
216
+ function __spread() {
217
+ for (var ar = [], i = 0; i < arguments.length; i++)
218
+ ar = ar.concat(__read(arguments[i]));
219
+ return ar;
220
+ }
221
+ function __spreadArrays() {
222
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
+ s += arguments[i].length;
224
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
225
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
226
+ r[k] = a[j];
227
+ return r;
228
+ }
229
+ ;
230
+ function __await(v) {
231
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
232
+ }
233
+ function __asyncGenerator(thisArg, _arguments, generator) {
234
+ if (!Symbol.asyncIterator)
235
+ throw new TypeError("Symbol.asyncIterator is not defined.");
236
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
237
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
238
+ function verb(n) { if (g[n])
239
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
240
+ function resume(n, v) { try {
241
+ step(g[n](v));
242
+ }
243
+ catch (e) {
244
+ settle(q[0][3], e);
245
+ } }
246
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
247
+ function fulfill(value) { resume("next", value); }
248
+ function reject(value) { resume("throw", value); }
249
+ function settle(f, v) { if (f(v), q.shift(), q.length)
250
+ resume(q[0][0], q[0][1]); }
251
+ }
252
+ function __asyncDelegator(o) {
253
+ var i, p;
254
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
255
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
256
+ }
257
+ function __asyncValues(o) {
258
+ if (!Symbol.asyncIterator)
259
+ throw new TypeError("Symbol.asyncIterator is not defined.");
260
+ var m = o[Symbol.asyncIterator], i;
261
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
262
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
263
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
264
+ }
265
+ function __makeTemplateObject(cooked, raw) {
266
+ if (Object.defineProperty) {
267
+ Object.defineProperty(cooked, "raw", { value: raw });
268
+ }
269
+ else {
270
+ cooked.raw = raw;
271
+ }
272
+ return cooked;
273
+ }
274
+ ;
275
+ var __setModuleDefault = Object.create ? (function (o, v) {
276
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
277
+ }) : function (o, v) {
278
+ o["default"] = v;
279
+ };
280
+ function __importStar(mod) {
281
+ if (mod && mod.__esModule)
282
+ return mod;
283
+ var result = {};
284
+ if (mod != null)
285
+ for (var k in mod)
286
+ if (Object.hasOwnProperty.call(mod, k))
287
+ __createBinding(result, mod, k);
288
+ __setModuleDefault(result, mod);
289
+ return result;
290
+ }
291
+ function __importDefault(mod) {
292
+ return (mod && mod.__esModule) ? mod : { default: mod };
293
+ }
294
+ function __classPrivateFieldGet(receiver, privateMap) {
295
+ if (!privateMap.has(receiver)) {
296
+ throw new TypeError("attempted to get private field on non-instance");
297
+ }
298
+ return privateMap.get(receiver);
299
+ }
300
+ function __classPrivateFieldSet(receiver, privateMap, value) {
301
+ if (!privateMap.has(receiver)) {
302
+ throw new TypeError("attempted to set private field on non-instance");
303
+ }
304
+ privateMap.set(receiver, value);
305
+ return value;
233
306
  }
234
307
 
235
- /**
236
- * @license
237
- * Copyright Google LLC All Rights Reserved.
238
- *
239
- * Use of this source code is governed by an MIT-style license that can be
240
- * found in the LICENSE file at https://angular.io/license
241
- */
242
308
  /**
243
309
  * Mixin to provide a directive with a function that checks if the sticky input has been
244
310
  * changed since the last time the function was called. Essentially adds a dirty-check to the
@@ -299,13 +365,6 @@
299
365
  /** Injection token that can be used to specify the text column options. */
300
366
  var TEXT_COLUMN_OPTIONS = new core.InjectionToken('text-column-options');
301
367
 
302
- /**
303
- * @license
304
- * Copyright Google LLC All Rights Reserved.
305
- *
306
- * Use of this source code is governed by an MIT-style license that can be
307
- * found in the LICENSE file at https://angular.io/license
308
- */
309
368
  /**
310
369
  * Cell definition for a CDK table.
311
370
  * Captures the template of a column's data row cell as well as cell-specific properties.
@@ -314,14 +373,14 @@
314
373
  function CdkCellDef(/** @docs-private */ template) {
315
374
  this.template = template;
316
375
  }
317
- CdkCellDef.decorators = [
318
- { type: core.Directive, args: [{ selector: '[cdkCellDef]' },] }
319
- ];
320
- CdkCellDef.ctorParameters = function () { return [
321
- { type: core.TemplateRef }
322
- ]; };
323
376
  return CdkCellDef;
324
377
  }());
378
+ CdkCellDef.decorators = [
379
+ { type: core.Directive, args: [{ selector: '[cdkCellDef]' },] }
380
+ ];
381
+ CdkCellDef.ctorParameters = function () { return [
382
+ { type: core.TemplateRef }
383
+ ]; };
325
384
  /**
326
385
  * Header cell definition for a CDK table.
327
386
  * Captures the template of a column's header cell and as well as cell-specific properties.
@@ -330,14 +389,14 @@
330
389
  function CdkHeaderCellDef(/** @docs-private */ template) {
331
390
  this.template = template;
332
391
  }
333
- CdkHeaderCellDef.decorators = [
334
- { type: core.Directive, args: [{ selector: '[cdkHeaderCellDef]' },] }
335
- ];
336
- CdkHeaderCellDef.ctorParameters = function () { return [
337
- { type: core.TemplateRef }
338
- ]; };
339
392
  return CdkHeaderCellDef;
340
393
  }());
394
+ CdkHeaderCellDef.decorators = [
395
+ { type: core.Directive, args: [{ selector: '[cdkHeaderCellDef]' },] }
396
+ ];
397
+ CdkHeaderCellDef.ctorParameters = function () { return [
398
+ { type: core.TemplateRef }
399
+ ]; };
341
400
  /**
342
401
  * Footer cell definition for a CDK table.
343
402
  * Captures the template of a column's footer cell and as well as cell-specific properties.
@@ -346,14 +405,14 @@
346
405
  function CdkFooterCellDef(/** @docs-private */ template) {
347
406
  this.template = template;
348
407
  }
349
- CdkFooterCellDef.decorators = [
350
- { type: core.Directive, args: [{ selector: '[cdkFooterCellDef]' },] }
351
- ];
352
- CdkFooterCellDef.ctorParameters = function () { return [
353
- { type: core.TemplateRef }
354
- ]; };
355
408
  return CdkFooterCellDef;
356
409
  }());
410
+ CdkFooterCellDef.decorators = [
411
+ { type: core.Directive, args: [{ selector: '[cdkFooterCellDef]' },] }
412
+ ];
413
+ CdkFooterCellDef.ctorParameters = function () { return [
414
+ { type: core.TemplateRef }
415
+ ]; };
357
416
  // Boilerplate for applying mixins to CdkColumnDef.
358
417
  /** @docs-private */
359
418
  var CdkColumnDefBase = /** @class */ (function () {
@@ -376,17 +435,8 @@
376
435
  }
377
436
  Object.defineProperty(CdkColumnDef.prototype, "name", {
378
437
  /** Unique name for this column. */
379
- get: function () {
380
- return this._name;
381
- },
382
- set: function (name) {
383
- // If the directive is set without a name (updated programatically), then this setter will
384
- // trigger with an empty string and should not overwrite the programatically set value.
385
- if (name) {
386
- this._name = name;
387
- this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-');
388
- }
389
- },
438
+ get: function () { return this._name; },
439
+ set: function (name) { this._setNameInput(name); },
390
440
  enumerable: false,
391
441
  configurable: true
392
442
  });
@@ -407,30 +457,70 @@
407
457
  enumerable: false,
408
458
  configurable: true
409
459
  });
410
- CdkColumnDef.decorators = [
411
- { type: core.Directive, args: [{
412
- selector: '[cdkColumnDef]',
413
- inputs: ['sticky'],
414
- providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }],
415
- },] }
416
- ];
417
- CdkColumnDef.ctorParameters = function () { return [
418
- { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
419
- ]; };
420
- CdkColumnDef.propDecorators = {
421
- name: [{ type: core.Input, args: ['cdkColumnDef',] }],
422
- stickyEnd: [{ type: core.Input, args: ['stickyEnd',] }],
423
- cell: [{ type: core.ContentChild, args: [CdkCellDef,] }],
424
- headerCell: [{ type: core.ContentChild, args: [CdkHeaderCellDef,] }],
425
- footerCell: [{ type: core.ContentChild, args: [CdkFooterCellDef,] }]
460
+ /**
461
+ * Overridable method that sets the css classes that will be added to every cell in this
462
+ * column.
463
+ * In the future, columnCssClassName will change from type string[] to string and this
464
+ * will set a single string value.
465
+ * @docs-private
466
+ */
467
+ CdkColumnDef.prototype._updateColumnCssClassName = function () {
468
+ this._columnCssClassName = ["cdk-column-" + this.cssClassFriendlyName];
469
+ };
470
+ /**
471
+ * This has been extracted to a util because of TS 4 and VE.
472
+ * View Engine doesn't support property rename inheritance.
473
+ * TS 4.0 doesn't allow properties to override accessors or vice-versa.
474
+ * @docs-private
475
+ */
476
+ CdkColumnDef.prototype._setNameInput = function (value) {
477
+ // If the directive is set without a name (updated programatically), then this setter will
478
+ // trigger with an empty string and should not overwrite the programatically set value.
479
+ if (value) {
480
+ this._name = value;
481
+ this.cssClassFriendlyName = value.replace(/[^a-z0-9_-]/ig, '-');
482
+ this._updateColumnCssClassName();
483
+ }
426
484
  };
427
485
  return CdkColumnDef;
428
486
  }(_CdkColumnDefBase));
487
+ CdkColumnDef.decorators = [
488
+ { type: core.Directive, args: [{
489
+ selector: '[cdkColumnDef]',
490
+ inputs: ['sticky'],
491
+ providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }],
492
+ },] }
493
+ ];
494
+ CdkColumnDef.ctorParameters = function () { return [
495
+ { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
496
+ ]; };
497
+ CdkColumnDef.propDecorators = {
498
+ name: [{ type: core.Input, args: ['cdkColumnDef',] }],
499
+ stickyEnd: [{ type: core.Input, args: ['stickyEnd',] }],
500
+ cell: [{ type: core.ContentChild, args: [CdkCellDef,] }],
501
+ headerCell: [{ type: core.ContentChild, args: [CdkHeaderCellDef,] }],
502
+ footerCell: [{ type: core.ContentChild, args: [CdkFooterCellDef,] }]
503
+ };
429
504
  /** Base class for the cells. Adds a CSS classname that identifies the column it renders in. */
430
505
  var BaseCdkCell = /** @class */ (function () {
431
506
  function BaseCdkCell(columnDef, elementRef) {
432
- var columnClassName = "cdk-column-" + columnDef.cssClassFriendlyName;
433
- elementRef.nativeElement.classList.add(columnClassName);
507
+ var e_1, _a;
508
+ // If IE 11 is dropped before we switch to setting a single class name, change to multi param
509
+ // with destructuring.
510
+ var classList = elementRef.nativeElement.classList;
511
+ try {
512
+ for (var _b = __values(columnDef._columnCssClassName), _c = _b.next(); !_c.done; _c = _b.next()) {
513
+ var className = _c.value;
514
+ classList.add(className);
515
+ }
516
+ }
517
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
518
+ finally {
519
+ try {
520
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
521
+ }
522
+ finally { if (e_1) throw e_1.error; }
523
+ }
434
524
  }
435
525
  return BaseCdkCell;
436
526
  }());
@@ -440,71 +530,165 @@
440
530
  function CdkHeaderCell(columnDef, elementRef) {
441
531
  return _super.call(this, columnDef, elementRef) || this;
442
532
  }
443
- CdkHeaderCell.decorators = [
444
- { type: core.Directive, args: [{
445
- selector: 'cdk-header-cell, th[cdk-header-cell]',
446
- host: {
447
- 'class': 'cdk-header-cell',
448
- 'role': 'columnheader',
449
- },
450
- },] }
451
- ];
452
- CdkHeaderCell.ctorParameters = function () { return [
453
- { type: CdkColumnDef },
454
- { type: core.ElementRef }
455
- ]; };
456
533
  return CdkHeaderCell;
457
534
  }(BaseCdkCell));
535
+ CdkHeaderCell.decorators = [
536
+ { type: core.Directive, args: [{
537
+ selector: 'cdk-header-cell, th[cdk-header-cell]',
538
+ host: {
539
+ 'class': 'cdk-header-cell',
540
+ 'role': 'columnheader',
541
+ },
542
+ },] }
543
+ ];
544
+ CdkHeaderCell.ctorParameters = function () { return [
545
+ { type: CdkColumnDef },
546
+ { type: core.ElementRef }
547
+ ]; };
458
548
  /** Footer cell template container that adds the right classes and role. */
459
549
  var CdkFooterCell = /** @class */ (function (_super) {
460
550
  __extends(CdkFooterCell, _super);
461
551
  function CdkFooterCell(columnDef, elementRef) {
462
552
  return _super.call(this, columnDef, elementRef) || this;
463
553
  }
464
- CdkFooterCell.decorators = [
465
- { type: core.Directive, args: [{
466
- selector: 'cdk-footer-cell, td[cdk-footer-cell]',
467
- host: {
468
- 'class': 'cdk-footer-cell',
469
- 'role': 'gridcell',
470
- },
471
- },] }
472
- ];
473
- CdkFooterCell.ctorParameters = function () { return [
474
- { type: CdkColumnDef },
475
- { type: core.ElementRef }
476
- ]; };
477
554
  return CdkFooterCell;
478
555
  }(BaseCdkCell));
556
+ CdkFooterCell.decorators = [
557
+ { type: core.Directive, args: [{
558
+ selector: 'cdk-footer-cell, td[cdk-footer-cell]',
559
+ host: {
560
+ 'class': 'cdk-footer-cell',
561
+ 'role': 'gridcell',
562
+ },
563
+ },] }
564
+ ];
565
+ CdkFooterCell.ctorParameters = function () { return [
566
+ { type: CdkColumnDef },
567
+ { type: core.ElementRef }
568
+ ]; };
479
569
  /** Cell template container that adds the right classes and role. */
480
570
  var CdkCell = /** @class */ (function (_super) {
481
571
  __extends(CdkCell, _super);
482
572
  function CdkCell(columnDef, elementRef) {
483
573
  return _super.call(this, columnDef, elementRef) || this;
484
574
  }
485
- CdkCell.decorators = [
486
- { type: core.Directive, args: [{
487
- selector: 'cdk-cell, td[cdk-cell]',
488
- host: {
489
- 'class': 'cdk-cell',
490
- 'role': 'gridcell',
491
- },
492
- },] }
493
- ];
494
- CdkCell.ctorParameters = function () { return [
495
- { type: CdkColumnDef },
496
- { type: core.ElementRef }
497
- ]; };
498
575
  return CdkCell;
499
576
  }(BaseCdkCell));
577
+ CdkCell.decorators = [
578
+ { type: core.Directive, args: [{
579
+ selector: 'cdk-cell, td[cdk-cell]',
580
+ host: {
581
+ 'class': 'cdk-cell',
582
+ 'role': 'gridcell',
583
+ },
584
+ },] }
585
+ ];
586
+ CdkCell.ctorParameters = function () { return [
587
+ { type: CdkColumnDef },
588
+ { type: core.ElementRef }
589
+ ]; };
500
590
 
501
591
  /**
502
- * @license
503
- * Copyright Google LLC All Rights Reserved.
592
+ * @docs-private
593
+ */
594
+ var _Schedule = /** @class */ (function () {
595
+ function _Schedule() {
596
+ this.tasks = [];
597
+ this.endTasks = [];
598
+ }
599
+ return _Schedule;
600
+ }());
601
+ /**
602
+ * Allows grouping up CSSDom mutations after the current execution context.
603
+ * This can significantly improve performance when separate consecutive functions are
604
+ * reading from the CSSDom and then mutating it.
504
605
  *
505
- * Use of this source code is governed by an MIT-style license that can be
506
- * found in the LICENSE file at https://angular.io/license
606
+ * @docs-private
507
607
  */
608
+ var _CoalescedStyleScheduler = /** @class */ (function () {
609
+ function _CoalescedStyleScheduler(_ngZone) {
610
+ this._ngZone = _ngZone;
611
+ this._currentSchedule = null;
612
+ this._destroyed = new rxjs.Subject();
613
+ }
614
+ /**
615
+ * Schedules the specified task to run at the end of the current VM turn.
616
+ */
617
+ _CoalescedStyleScheduler.prototype.schedule = function (task) {
618
+ this._createScheduleIfNeeded();
619
+ this._currentSchedule.tasks.push(task);
620
+ };
621
+ /**
622
+ * Schedules the specified task to run after other scheduled tasks at the end of the current
623
+ * VM turn.
624
+ */
625
+ _CoalescedStyleScheduler.prototype.scheduleEnd = function (task) {
626
+ this._createScheduleIfNeeded();
627
+ this._currentSchedule.endTasks.push(task);
628
+ };
629
+ /** Prevent any further tasks from running. */
630
+ _CoalescedStyleScheduler.prototype.ngOnDestroy = function () {
631
+ this._destroyed.next();
632
+ this._destroyed.complete();
633
+ };
634
+ _CoalescedStyleScheduler.prototype._createScheduleIfNeeded = function () {
635
+ var _this = this;
636
+ if (this._currentSchedule) {
637
+ return;
638
+ }
639
+ this._currentSchedule = new _Schedule();
640
+ this._getScheduleObservable().pipe(operators.takeUntil(this._destroyed)).subscribe(function () {
641
+ var e_1, _a, e_2, _b;
642
+ while (_this._currentSchedule.tasks.length || _this._currentSchedule.endTasks.length) {
643
+ var schedule = _this._currentSchedule;
644
+ // Capture new tasks scheduled by the current set of tasks.
645
+ _this._currentSchedule = new _Schedule();
646
+ try {
647
+ for (var _c = (e_1 = void 0, __values(schedule.tasks)), _d = _c.next(); !_d.done; _d = _c.next()) {
648
+ var task = _d.value;
649
+ task();
650
+ }
651
+ }
652
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
653
+ finally {
654
+ try {
655
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
656
+ }
657
+ finally { if (e_1) throw e_1.error; }
658
+ }
659
+ try {
660
+ for (var _e = (e_2 = void 0, __values(schedule.endTasks)), _f = _e.next(); !_f.done; _f = _e.next()) {
661
+ var task = _f.value;
662
+ task();
663
+ }
664
+ }
665
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
666
+ finally {
667
+ try {
668
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
669
+ }
670
+ finally { if (e_2) throw e_2.error; }
671
+ }
672
+ }
673
+ _this._currentSchedule = null;
674
+ });
675
+ };
676
+ _CoalescedStyleScheduler.prototype._getScheduleObservable = function () {
677
+ // Use onStable when in the context of an ongoing change detection cycle so that we
678
+ // do not accidentally trigger additional cycles.
679
+ return this._ngZone.isStable ?
680
+ rxjs.from(Promise.resolve(undefined)) :
681
+ this._ngZone.onStable.pipe(operators.take(1));
682
+ };
683
+ return _CoalescedStyleScheduler;
684
+ }());
685
+ _CoalescedStyleScheduler.decorators = [
686
+ { type: core.Injectable }
687
+ ];
688
+ _CoalescedStyleScheduler.ctorParameters = function () { return [
689
+ { type: core.NgZone }
690
+ ]; };
691
+
508
692
  /**
509
693
  * The row template that can be used by the mat-table. Should not be used outside of the
510
694
  * material library.
@@ -548,15 +732,15 @@
548
732
  return column.cell.template;
549
733
  }
550
734
  };
551
- BaseRowDef.decorators = [
552
- { type: core.Directive }
553
- ];
554
- BaseRowDef.ctorParameters = function () { return [
555
- { type: core.TemplateRef },
556
- { type: core.IterableDiffers }
557
- ]; };
558
735
  return BaseRowDef;
559
736
  }());
737
+ BaseRowDef.decorators = [
738
+ { type: core.Directive }
739
+ ];
740
+ BaseRowDef.ctorParameters = function () { return [
741
+ { type: core.TemplateRef },
742
+ { type: core.IterableDiffers }
743
+ ]; };
560
744
  // Boilerplate for applying mixins to CdkHeaderRowDef.
561
745
  /** @docs-private */
562
746
  var CdkHeaderRowDefBase = /** @class */ (function (_super) {
@@ -583,19 +767,19 @@
583
767
  CdkHeaderRowDef.prototype.ngOnChanges = function (changes) {
584
768
  _super.prototype.ngOnChanges.call(this, changes);
585
769
  };
586
- CdkHeaderRowDef.decorators = [
587
- { type: core.Directive, args: [{
588
- selector: '[cdkHeaderRowDef]',
589
- inputs: ['columns: cdkHeaderRowDef', 'sticky: cdkHeaderRowDefSticky'],
590
- },] }
591
- ];
592
- CdkHeaderRowDef.ctorParameters = function () { return [
593
- { type: core.TemplateRef },
594
- { type: core.IterableDiffers },
595
- { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
596
- ]; };
597
770
  return CdkHeaderRowDef;
598
771
  }(_CdkHeaderRowDefBase));
772
+ CdkHeaderRowDef.decorators = [
773
+ { type: core.Directive, args: [{
774
+ selector: '[cdkHeaderRowDef]',
775
+ inputs: ['columns: cdkHeaderRowDef', 'sticky: cdkHeaderRowDefSticky'],
776
+ },] }
777
+ ];
778
+ CdkHeaderRowDef.ctorParameters = function () { return [
779
+ { type: core.TemplateRef },
780
+ { type: core.IterableDiffers },
781
+ { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
782
+ ]; };
599
783
  // Boilerplate for applying mixins to CdkFooterRowDef.
600
784
  /** @docs-private */
601
785
  var CdkFooterRowDefBase = /** @class */ (function (_super) {
@@ -622,19 +806,19 @@
622
806
  CdkFooterRowDef.prototype.ngOnChanges = function (changes) {
623
807
  _super.prototype.ngOnChanges.call(this, changes);
624
808
  };
625
- CdkFooterRowDef.decorators = [
626
- { type: core.Directive, args: [{
627
- selector: '[cdkFooterRowDef]',
628
- inputs: ['columns: cdkFooterRowDef', 'sticky: cdkFooterRowDefSticky'],
629
- },] }
630
- ];
631
- CdkFooterRowDef.ctorParameters = function () { return [
632
- { type: core.TemplateRef },
633
- { type: core.IterableDiffers },
634
- { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
635
- ]; };
636
809
  return CdkFooterRowDef;
637
810
  }(_CdkFooterRowDefBase));
811
+ CdkFooterRowDef.decorators = [
812
+ { type: core.Directive, args: [{
813
+ selector: '[cdkFooterRowDef]',
814
+ inputs: ['columns: cdkFooterRowDef', 'sticky: cdkFooterRowDefSticky'],
815
+ },] }
816
+ ];
817
+ CdkFooterRowDef.ctorParameters = function () { return [
818
+ { type: core.TemplateRef },
819
+ { type: core.IterableDiffers },
820
+ { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
821
+ ]; };
638
822
  /**
639
823
  * Data row definition for the CDK table.
640
824
  * Captures the header row's template and other row properties such as the columns to display and
@@ -649,19 +833,19 @@
649
833
  _this._table = _table;
650
834
  return _this;
651
835
  }
652
- CdkRowDef.decorators = [
653
- { type: core.Directive, args: [{
654
- selector: '[cdkRowDef]',
655
- inputs: ['columns: cdkRowDefColumns', 'when: cdkRowDefWhen'],
656
- },] }
657
- ];
658
- CdkRowDef.ctorParameters = function () { return [
659
- { type: core.TemplateRef },
660
- { type: core.IterableDiffers },
661
- { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
662
- ]; };
663
836
  return CdkRowDef;
664
837
  }(BaseRowDef));
838
+ CdkRowDef.decorators = [
839
+ { type: core.Directive, args: [{
840
+ selector: '[cdkRowDef]',
841
+ inputs: ['columns: cdkRowDefColumns', 'when: cdkRowDefWhen'],
842
+ },] }
843
+ ];
844
+ CdkRowDef.ctorParameters = function () { return [
845
+ { type: core.TemplateRef },
846
+ { type: core.IterableDiffers },
847
+ { type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
848
+ ]; };
665
849
  /**
666
850
  * Outlet for rendering cells inside of a row or header row.
667
851
  * @docs-private
@@ -678,97 +862,97 @@
678
862
  CdkCellOutlet.mostRecentCellOutlet = null;
679
863
  }
680
864
  };
681
- /**
682
- * Static property containing the latest constructed instance of this class.
683
- * Used by the CDK table when each CdkHeaderRow and CdkRow component is created using
684
- * createEmbeddedView. After one of these components are created, this property will provide
685
- * a handle to provide that component's cells and context. After init, the CdkCellOutlet will
686
- * construct the cells with the provided context.
687
- */
688
- CdkCellOutlet.mostRecentCellOutlet = null;
689
- CdkCellOutlet.decorators = [
690
- { type: core.Directive, args: [{ selector: '[cdkCellOutlet]' },] }
691
- ];
692
- CdkCellOutlet.ctorParameters = function () { return [
693
- { type: core.ViewContainerRef }
694
- ]; };
695
865
  return CdkCellOutlet;
696
866
  }());
867
+ /**
868
+ * Static property containing the latest constructed instance of this class.
869
+ * Used by the CDK table when each CdkHeaderRow and CdkRow component is created using
870
+ * createEmbeddedView. After one of these components are created, this property will provide
871
+ * a handle to provide that component's cells and context. After init, the CdkCellOutlet will
872
+ * construct the cells with the provided context.
873
+ */
874
+ CdkCellOutlet.mostRecentCellOutlet = null;
875
+ CdkCellOutlet.decorators = [
876
+ { type: core.Directive, args: [{ selector: '[cdkCellOutlet]' },] }
877
+ ];
878
+ CdkCellOutlet.ctorParameters = function () { return [
879
+ { type: core.ViewContainerRef }
880
+ ]; };
697
881
  /** Header template container that contains the cell outlet. Adds the right class and role. */
698
882
  var CdkHeaderRow = /** @class */ (function () {
699
883
  function CdkHeaderRow() {
700
884
  }
701
- CdkHeaderRow.decorators = [
702
- { type: core.Component, args: [{
703
- selector: 'cdk-header-row, tr[cdk-header-row]',
704
- template: CDK_ROW_TEMPLATE,
705
- host: {
706
- 'class': 'cdk-header-row',
707
- 'role': 'row',
708
- },
709
- // See note on CdkTable for explanation on why this uses the default change detection strategy.
710
- // tslint:disable-next-line:validate-decorators
711
- changeDetection: core.ChangeDetectionStrategy.Default,
712
- encapsulation: core.ViewEncapsulation.None
713
- },] }
714
- ];
715
885
  return CdkHeaderRow;
716
886
  }());
887
+ CdkHeaderRow.decorators = [
888
+ { type: core.Component, args: [{
889
+ selector: 'cdk-header-row, tr[cdk-header-row]',
890
+ template: CDK_ROW_TEMPLATE,
891
+ host: {
892
+ 'class': 'cdk-header-row',
893
+ 'role': 'row',
894
+ },
895
+ // See note on CdkTable for explanation on why this uses the default change detection strategy.
896
+ // tslint:disable-next-line:validate-decorators
897
+ changeDetection: core.ChangeDetectionStrategy.Default,
898
+ encapsulation: core.ViewEncapsulation.None
899
+ },] }
900
+ ];
717
901
  /** Footer template container that contains the cell outlet. Adds the right class and role. */
718
902
  var CdkFooterRow = /** @class */ (function () {
719
903
  function CdkFooterRow() {
720
904
  }
721
- CdkFooterRow.decorators = [
722
- { type: core.Component, args: [{
723
- selector: 'cdk-footer-row, tr[cdk-footer-row]',
724
- template: CDK_ROW_TEMPLATE,
725
- host: {
726
- 'class': 'cdk-footer-row',
727
- 'role': 'row',
728
- },
729
- // See note on CdkTable for explanation on why this uses the default change detection strategy.
730
- // tslint:disable-next-line:validate-decorators
731
- changeDetection: core.ChangeDetectionStrategy.Default,
732
- encapsulation: core.ViewEncapsulation.None
733
- },] }
734
- ];
735
905
  return CdkFooterRow;
736
906
  }());
907
+ CdkFooterRow.decorators = [
908
+ { type: core.Component, args: [{
909
+ selector: 'cdk-footer-row, tr[cdk-footer-row]',
910
+ template: CDK_ROW_TEMPLATE,
911
+ host: {
912
+ 'class': 'cdk-footer-row',
913
+ 'role': 'row',
914
+ },
915
+ // See note on CdkTable for explanation on why this uses the default change detection strategy.
916
+ // tslint:disable-next-line:validate-decorators
917
+ changeDetection: core.ChangeDetectionStrategy.Default,
918
+ encapsulation: core.ViewEncapsulation.None
919
+ },] }
920
+ ];
737
921
  /** Data row template container that contains the cell outlet. Adds the right class and role. */
738
922
  var CdkRow = /** @class */ (function () {
739
923
  function CdkRow() {
740
924
  }
741
- CdkRow.decorators = [
742
- { type: core.Component, args: [{
743
- selector: 'cdk-row, tr[cdk-row]',
744
- template: CDK_ROW_TEMPLATE,
745
- host: {
746
- 'class': 'cdk-row',
747
- 'role': 'row',
748
- },
749
- // See note on CdkTable for explanation on why this uses the default change detection strategy.
750
- // tslint:disable-next-line:validate-decorators
751
- changeDetection: core.ChangeDetectionStrategy.Default,
752
- encapsulation: core.ViewEncapsulation.None
753
- },] }
754
- ];
755
925
  return CdkRow;
756
926
  }());
927
+ CdkRow.decorators = [
928
+ { type: core.Component, args: [{
929
+ selector: 'cdk-row, tr[cdk-row]',
930
+ template: CDK_ROW_TEMPLATE,
931
+ host: {
932
+ 'class': 'cdk-row',
933
+ 'role': 'row',
934
+ },
935
+ // See note on CdkTable for explanation on why this uses the default change detection strategy.
936
+ // tslint:disable-next-line:validate-decorators
937
+ changeDetection: core.ChangeDetectionStrategy.Default,
938
+ encapsulation: core.ViewEncapsulation.None
939
+ },] }
940
+ ];
757
941
  /** Row that can be used to display a message when no data is shown in the table. */
758
942
  var CdkNoDataRow = /** @class */ (function () {
759
943
  function CdkNoDataRow(templateRef) {
760
944
  this.templateRef = templateRef;
761
945
  }
762
- CdkNoDataRow.decorators = [
763
- { type: core.Directive, args: [{
764
- selector: 'ng-template[cdkNoDataRow]'
765
- },] }
766
- ];
767
- CdkNoDataRow.ctorParameters = function () { return [
768
- { type: core.TemplateRef }
769
- ]; };
770
946
  return CdkNoDataRow;
771
947
  }());
948
+ CdkNoDataRow.decorators = [
949
+ { type: core.Directive, args: [{
950
+ selector: 'ng-template[cdkNoDataRow]'
951
+ },] }
952
+ ];
953
+ CdkNoDataRow.ctorParameters = function () { return [
954
+ { type: core.TemplateRef }
955
+ ]; };
772
956
 
773
957
  /**
774
958
  * @license
@@ -795,13 +979,19 @@
795
979
  * @param direction The directionality context of the table (ltr/rtl); affects column positioning
796
980
  * by reversing left/right positions.
797
981
  * @param _isBrowser Whether the table is currently being rendered on the server or the client.
982
+ * @param _needsPositionStickyOnElement Whether we need to specify position: sticky on cells
983
+ * using inline styles. If false, it is assumed that position: sticky is included in
984
+ * the component stylesheet for _stickCellCss.
798
985
  */
799
- function StickyStyler(_isNativeHtmlTable, _stickCellCss, direction, _isBrowser) {
986
+ function StickyStyler(_isNativeHtmlTable, _stickCellCss, direction, _coalescedStyleScheduler, _isBrowser, _needsPositionStickyOnElement) {
800
987
  if (_isBrowser === void 0) { _isBrowser = true; }
988
+ if (_needsPositionStickyOnElement === void 0) { _needsPositionStickyOnElement = true; }
801
989
  this._isNativeHtmlTable = _isNativeHtmlTable;
802
990
  this._stickCellCss = _stickCellCss;
803
991
  this.direction = direction;
992
+ this._coalescedStyleScheduler = _coalescedStyleScheduler;
804
993
  this._isBrowser = _isBrowser;
994
+ this._needsPositionStickyOnElement = _needsPositionStickyOnElement;
805
995
  }
806
996
  /**
807
997
  * Clears the sticky positioning styles from the row and its cells by resetting the `position`
@@ -811,6 +1001,8 @@
811
1001
  */
812
1002
  StickyStyler.prototype.clearStickyPositioning = function (rows, stickyDirections) {
813
1003
  var e_1, _a;
1004
+ var _this = this;
1005
+ var elementsToClear = [];
814
1006
  try {
815
1007
  for (var rows_1 = __values(rows), rows_1_1 = rows_1.next(); !rows_1_1.done; rows_1_1 = rows_1.next()) {
816
1008
  var row = rows_1_1.value;
@@ -819,10 +1011,9 @@
819
1011
  if (row.nodeType !== row.ELEMENT_NODE) {
820
1012
  continue;
821
1013
  }
822
- this._removeStickyStyle(row, stickyDirections);
1014
+ elementsToClear.push(row);
823
1015
  for (var i = 0; i < row.children.length; i++) {
824
- var cell = row.children[i];
825
- this._removeStickyStyle(cell, stickyDirections);
1016
+ elementsToClear.push(row.children[i]);
826
1017
  }
827
1018
  }
828
1019
  }
@@ -833,6 +1024,23 @@
833
1024
  }
834
1025
  finally { if (e_1) throw e_1.error; }
835
1026
  }
1027
+ // Coalesce with sticky row/column updates (and potentially other changes like column resize).
1028
+ this._coalescedStyleScheduler.schedule(function () {
1029
+ var e_2, _a;
1030
+ try {
1031
+ for (var elementsToClear_1 = __values(elementsToClear), elementsToClear_1_1 = elementsToClear_1.next(); !elementsToClear_1_1.done; elementsToClear_1_1 = elementsToClear_1.next()) {
1032
+ var element = elementsToClear_1_1.value;
1033
+ _this._removeStickyStyle(element, stickyDirections);
1034
+ }
1035
+ }
1036
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1037
+ finally {
1038
+ try {
1039
+ if (elementsToClear_1_1 && !elementsToClear_1_1.done && (_a = elementsToClear_1.return)) _a.call(elementsToClear_1);
1040
+ }
1041
+ finally { if (e_2) throw e_2.error; }
1042
+ }
1043
+ });
836
1044
  };
837
1045
  /**
838
1046
  * Applies sticky left and right positions to the cells of each row according to the sticky
@@ -844,9 +1052,9 @@
844
1052
  * in this index position should be stuck to the end of the row.
845
1053
  */
846
1054
  StickyStyler.prototype.updateStickyColumns = function (rows, stickyStartStates, stickyEndStates) {
847
- var e_2, _a;
848
- var hasStickyColumns = stickyStartStates.some(function (state) { return state; }) || stickyEndStates.some(function (state) { return state; });
849
- if (!rows.length || !hasStickyColumns || !this._isBrowser) {
1055
+ var _this = this;
1056
+ if (!rows.length || !this._isBrowser || !(stickyStartStates.some(function (state) { return state; }) ||
1057
+ stickyEndStates.some(function (state) { return state; }))) {
850
1058
  return;
851
1059
  }
852
1060
  var firstRow = rows[0];
@@ -854,28 +1062,34 @@
854
1062
  var cellWidths = this._getCellWidths(firstRow);
855
1063
  var startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates);
856
1064
  var endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates);
857
- var isRtl = this.direction === 'rtl';
858
- try {
859
- for (var rows_2 = __values(rows), rows_2_1 = rows_2.next(); !rows_2_1.done; rows_2_1 = rows_2.next()) {
860
- var row = rows_2_1.value;
861
- for (var i = 0; i < numCells; i++) {
862
- var cell = row.children[i];
863
- if (stickyStartStates[i]) {
864
- this._addStickyStyle(cell, isRtl ? 'right' : 'left', startPositions[i]);
865
- }
866
- if (stickyEndStates[i]) {
867
- this._addStickyStyle(cell, isRtl ? 'left' : 'right', endPositions[i]);
1065
+ // Coalesce with sticky row updates (and potentially other changes like column resize).
1066
+ this._coalescedStyleScheduler.schedule(function () {
1067
+ var e_3, _a;
1068
+ var isRtl = _this.direction === 'rtl';
1069
+ var start = isRtl ? 'right' : 'left';
1070
+ var end = isRtl ? 'left' : 'right';
1071
+ try {
1072
+ for (var rows_2 = __values(rows), rows_2_1 = rows_2.next(); !rows_2_1.done; rows_2_1 = rows_2.next()) {
1073
+ var row = rows_2_1.value;
1074
+ for (var i = 0; i < numCells; i++) {
1075
+ var cell = row.children[i];
1076
+ if (stickyStartStates[i]) {
1077
+ _this._addStickyStyle(cell, start, startPositions[i]);
1078
+ }
1079
+ if (stickyEndStates[i]) {
1080
+ _this._addStickyStyle(cell, end, endPositions[i]);
1081
+ }
868
1082
  }
869
1083
  }
870
1084
  }
871
- }
872
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
873
- finally {
874
- try {
875
- if (rows_2_1 && !rows_2_1.done && (_a = rows_2.return)) _a.call(rows_2);
1085
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1086
+ finally {
1087
+ try {
1088
+ if (rows_2_1 && !rows_2_1.done && (_a = rows_2.return)) _a.call(rows_2);
1089
+ }
1090
+ finally { if (e_3) throw e_3.error; }
876
1091
  }
877
- finally { if (e_2) throw e_2.error; }
878
- }
1092
+ });
879
1093
  };
880
1094
  /**
881
1095
  * Applies sticky positioning to the row's cells if using the native table layout, and to the
@@ -889,6 +1103,7 @@
889
1103
  *
890
1104
  */
891
1105
  StickyStyler.prototype.stickRows = function (rowsToStick, stickyStates, position) {
1106
+ var _this = this;
892
1107
  // Since we can't measure the rows on the server, we can't stick the rows properly.
893
1108
  if (!this._isBrowser) {
894
1109
  return;
@@ -898,29 +1113,45 @@
898
1113
  // sticky states need to be reversed as well.
899
1114
  var rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;
900
1115
  var states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;
901
- var stickyHeight = 0;
902
- for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
1116
+ // Measure row heights all at once before adding sticky styles to reduce layout thrashing.
1117
+ var stickyHeights = [];
1118
+ var elementsToStick = [];
1119
+ for (var rowIndex = 0, stickyHeight = 0; rowIndex < rows.length; rowIndex++) {
1120
+ stickyHeights[rowIndex] = stickyHeight;
903
1121
  if (!states[rowIndex]) {
904
1122
  continue;
905
1123
  }
906
1124
  var row = rows[rowIndex];
907
- if (this._isNativeHtmlTable) {
908
- for (var j = 0; j < row.children.length; j++) {
909
- var cell = row.children[j];
910
- this._addStickyStyle(cell, position, stickyHeight);
911
- }
1125
+ elementsToStick[rowIndex] = this._isNativeHtmlTable ?
1126
+ Array.from(row.children) : [row];
1127
+ if (rowIndex !== rows.length - 1) {
1128
+ stickyHeight += row.getBoundingClientRect().height;
912
1129
  }
913
- else {
914
- // Flex does not respect the stick positioning on the cells, needs to be applied to the row.
915
- // If this is applied on a native table, Safari causes the header to fly in wrong direction.
916
- this._addStickyStyle(row, position, stickyHeight);
917
- }
918
- if (rowIndex === rows.length - 1) {
919
- // prevent unnecessary reflow from getBoundingClientRect()
920
- return;
921
- }
922
- stickyHeight += row.getBoundingClientRect().height;
923
1130
  }
1131
+ // Coalesce with other sticky row updates (top/bottom), sticky columns updates
1132
+ // (and potentially other changes like column resize).
1133
+ this._coalescedStyleScheduler.schedule(function () {
1134
+ var e_4, _a;
1135
+ for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
1136
+ if (!states[rowIndex]) {
1137
+ continue;
1138
+ }
1139
+ var height = stickyHeights[rowIndex];
1140
+ try {
1141
+ for (var _b = (e_4 = void 0, __values(elementsToStick[rowIndex])), _c = _b.next(); !_c.done; _c = _b.next()) {
1142
+ var element = _c.value;
1143
+ _this._addStickyStyle(element, position, height);
1144
+ }
1145
+ }
1146
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
1147
+ finally {
1148
+ try {
1149
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1150
+ }
1151
+ finally { if (e_4) throw e_4.error; }
1152
+ }
1153
+ }
1154
+ });
924
1155
  };
925
1156
  /**
926
1157
  * When using the native table in Safari, sticky footer cells do not stick. The only way to stick
@@ -929,16 +1160,20 @@
929
1160
  * the tfoot element.
930
1161
  */
931
1162
  StickyStyler.prototype.updateStickyFooterContainer = function (tableElement, stickyStates) {
1163
+ var _this = this;
932
1164
  if (!this._isNativeHtmlTable) {
933
1165
  return;
934
1166
  }
935
1167
  var tfoot = tableElement.querySelector('tfoot');
936
- if (stickyStates.some(function (state) { return !state; })) {
937
- this._removeStickyStyle(tfoot, ['bottom']);
938
- }
939
- else {
940
- this._addStickyStyle(tfoot, 'bottom', 0);
941
- }
1168
+ // Coalesce with other sticky updates (and potentially other changes like column resize).
1169
+ this._coalescedStyleScheduler.schedule(function () {
1170
+ if (stickyStates.some(function (state) { return !state; })) {
1171
+ _this._removeStickyStyle(tfoot, ['bottom']);
1172
+ }
1173
+ else {
1174
+ _this._addStickyStyle(tfoot, 'bottom', 0);
1175
+ }
1176
+ });
942
1177
  };
943
1178
  /**
944
1179
  * Removes the sticky style on the element by removing the sticky cell CSS class, re-evaluating
@@ -946,26 +1181,34 @@
946
1181
  * sticky position if there are no more directions.
947
1182
  */
948
1183
  StickyStyler.prototype._removeStickyStyle = function (element, stickyDirections) {
949
- var e_3, _a;
1184
+ var e_5, _a;
950
1185
  try {
951
1186
  for (var stickyDirections_1 = __values(stickyDirections), stickyDirections_1_1 = stickyDirections_1.next(); !stickyDirections_1_1.done; stickyDirections_1_1 = stickyDirections_1.next()) {
952
1187
  var dir = stickyDirections_1_1.value;
953
1188
  element.style[dir] = '';
954
1189
  }
955
1190
  }
956
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
1191
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
957
1192
  finally {
958
1193
  try {
959
1194
  if (stickyDirections_1_1 && !stickyDirections_1_1.done && (_a = stickyDirections_1.return)) _a.call(stickyDirections_1);
960
1195
  }
961
- finally { if (e_3) throw e_3.error; }
1196
+ finally { if (e_5) throw e_5.error; }
962
1197
  }
963
- element.style.zIndex = this._getCalculatedZIndex(element);
964
1198
  // If the element no longer has any more sticky directions, remove sticky positioning and
965
1199
  // the sticky CSS class.
966
- var hasDirection = STICKY_DIRECTIONS.some(function (dir) { return !!element.style[dir]; });
967
- if (!hasDirection) {
968
- element.style.position = '';
1200
+ // Short-circuit checking element.style[dir] for stickyDirections as they
1201
+ // were already removed above.
1202
+ var hasDirection = STICKY_DIRECTIONS.some(function (dir) { return stickyDirections.indexOf(dir) === -1 && element.style[dir]; });
1203
+ if (hasDirection) {
1204
+ element.style.zIndex = this._getCalculatedZIndex(element);
1205
+ }
1206
+ else {
1207
+ // When not hasDirection, _getCalculatedZIndex will always return ''.
1208
+ element.style.zIndex = '';
1209
+ if (this._needsPositionStickyOnElement) {
1210
+ element.style.position = '';
1211
+ }
969
1212
  element.classList.remove(this._stickCellCss);
970
1213
  }
971
1214
  };
@@ -977,8 +1220,10 @@
977
1220
  StickyStyler.prototype._addStickyStyle = function (element, dir, dirValue) {
978
1221
  element.classList.add(this._stickCellCss);
979
1222
  element.style[dir] = dirValue + "px";
980
- element.style.cssText += 'position: -webkit-sticky; position: sticky; ';
981
1223
  element.style.zIndex = this._getCalculatedZIndex(element);
1224
+ if (this._needsPositionStickyOnElement) {
1225
+ element.style.cssText += 'position: -webkit-sticky; position: sticky; ';
1226
+ }
982
1227
  };
983
1228
  /**
984
1229
  * Calculate what the z-index should be for the element, depending on what directions (top,
@@ -992,7 +1237,7 @@
992
1237
  * elements.
993
1238
  */
994
1239
  StickyStyler.prototype._getCalculatedZIndex = function (element) {
995
- var e_4, _a;
1240
+ var e_6, _a;
996
1241
  var zIndexIncrements = {
997
1242
  top: 100,
998
1243
  bottom: 10,
@@ -1004,19 +1249,19 @@
1004
1249
  // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,
1005
1250
  // loses the array generic type in the `for of`. But we *also* have to use `Array` because
1006
1251
  // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration`
1007
- for (var _b = __values(STICKY_DIRECTIONS), _c = _b.next(); !_c.done; _c = _b.next()) {
1008
- var dir = _c.value;
1252
+ for (var STICKY_DIRECTIONS_1 = __values(STICKY_DIRECTIONS), STICKY_DIRECTIONS_1_1 = STICKY_DIRECTIONS_1.next(); !STICKY_DIRECTIONS_1_1.done; STICKY_DIRECTIONS_1_1 = STICKY_DIRECTIONS_1.next()) {
1253
+ var dir = STICKY_DIRECTIONS_1_1.value;
1009
1254
  if (element.style[dir]) {
1010
1255
  zIndex += zIndexIncrements[dir];
1011
1256
  }
1012
1257
  }
1013
1258
  }
1014
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
1259
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
1015
1260
  finally {
1016
1261
  try {
1017
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1262
+ if (STICKY_DIRECTIONS_1_1 && !STICKY_DIRECTIONS_1_1.done && (_a = STICKY_DIRECTIONS_1.return)) _a.call(STICKY_DIRECTIONS_1);
1018
1263
  }
1019
- finally { if (e_4) throw e_4.error; }
1264
+ finally { if (e_6) throw e_6.error; }
1020
1265
  }
1021
1266
  return zIndex ? "" + zIndex : '';
1022
1267
  };
@@ -1132,13 +1377,6 @@
1132
1377
  return Error("Table text column must have a name.");
1133
1378
  }
1134
1379
 
1135
- /**
1136
- * @license
1137
- * Copyright Google LLC All Rights Reserved.
1138
- *
1139
- * Use of this source code is governed by an MIT-style license that can be
1140
- * found in the LICENSE file at https://angular.io/license
1141
- */
1142
1380
  /**
1143
1381
  * Provides a handle for the table to grab the view container's ng-container to insert data rows.
1144
1382
  * @docs-private
@@ -1148,15 +1386,15 @@
1148
1386
  this.viewContainer = viewContainer;
1149
1387
  this.elementRef = elementRef;
1150
1388
  }
1151
- DataRowOutlet.decorators = [
1152
- { type: core.Directive, args: [{ selector: '[rowOutlet]' },] }
1153
- ];
1154
- DataRowOutlet.ctorParameters = function () { return [
1155
- { type: core.ViewContainerRef },
1156
- { type: core.ElementRef }
1157
- ]; };
1158
1389
  return DataRowOutlet;
1159
1390
  }());
1391
+ DataRowOutlet.decorators = [
1392
+ { type: core.Directive, args: [{ selector: '[rowOutlet]' },] }
1393
+ ];
1394
+ DataRowOutlet.ctorParameters = function () { return [
1395
+ { type: core.ViewContainerRef },
1396
+ { type: core.ElementRef }
1397
+ ]; };
1160
1398
  /**
1161
1399
  * Provides a handle for the table to grab the view container's ng-container to insert the header.
1162
1400
  * @docs-private
@@ -1166,15 +1404,15 @@
1166
1404
  this.viewContainer = viewContainer;
1167
1405
  this.elementRef = elementRef;
1168
1406
  }
1169
- HeaderRowOutlet.decorators = [
1170
- { type: core.Directive, args: [{ selector: '[headerRowOutlet]' },] }
1171
- ];
1172
- HeaderRowOutlet.ctorParameters = function () { return [
1173
- { type: core.ViewContainerRef },
1174
- { type: core.ElementRef }
1175
- ]; };
1176
1407
  return HeaderRowOutlet;
1177
1408
  }());
1409
+ HeaderRowOutlet.decorators = [
1410
+ { type: core.Directive, args: [{ selector: '[headerRowOutlet]' },] }
1411
+ ];
1412
+ HeaderRowOutlet.ctorParameters = function () { return [
1413
+ { type: core.ViewContainerRef },
1414
+ { type: core.ElementRef }
1415
+ ]; };
1178
1416
  /**
1179
1417
  * Provides a handle for the table to grab the view container's ng-container to insert the footer.
1180
1418
  * @docs-private
@@ -1184,15 +1422,15 @@
1184
1422
  this.viewContainer = viewContainer;
1185
1423
  this.elementRef = elementRef;
1186
1424
  }
1187
- FooterRowOutlet.decorators = [
1188
- { type: core.Directive, args: [{ selector: '[footerRowOutlet]' },] }
1189
- ];
1190
- FooterRowOutlet.ctorParameters = function () { return [
1191
- { type: core.ViewContainerRef },
1192
- { type: core.ElementRef }
1193
- ]; };
1194
1425
  return FooterRowOutlet;
1195
1426
  }());
1427
+ FooterRowOutlet.decorators = [
1428
+ { type: core.Directive, args: [{ selector: '[footerRowOutlet]' },] }
1429
+ ];
1430
+ FooterRowOutlet.ctorParameters = function () { return [
1431
+ { type: core.ViewContainerRef },
1432
+ { type: core.ElementRef }
1433
+ ]; };
1196
1434
  /**
1197
1435
  * Provides a handle for the table to grab the view
1198
1436
  * container's ng-container to insert the no data row.
@@ -1203,15 +1441,15 @@
1203
1441
  this.viewContainer = viewContainer;
1204
1442
  this.elementRef = elementRef;
1205
1443
  }
1206
- NoDataRowOutlet.decorators = [
1207
- { type: core.Directive, args: [{ selector: '[noDataRowOutlet]' },] }
1208
- ];
1209
- NoDataRowOutlet.ctorParameters = function () { return [
1210
- { type: core.ViewContainerRef },
1211
- { type: core.ElementRef }
1212
- ]; };
1213
1444
  return NoDataRowOutlet;
1214
1445
  }());
1446
+ NoDataRowOutlet.decorators = [
1447
+ { type: core.Directive, args: [{ selector: '[noDataRowOutlet]' },] }
1448
+ ];
1449
+ NoDataRowOutlet.ctorParameters = function () { return [
1450
+ { type: core.ViewContainerRef },
1451
+ { type: core.ElementRef }
1452
+ ]; };
1215
1453
  /**
1216
1454
  * The table template that can be used by the mat-table. Should not be used outside of the
1217
1455
  * material library.
@@ -1239,12 +1477,17 @@
1239
1477
  * connect function that will return an Observable stream that emits the data array to render.
1240
1478
  */
1241
1479
  var CdkTable = /** @class */ (function () {
1242
- function CdkTable(_differs, _changeDetectorRef, _elementRef, role, _dir, _document, _platform) {
1480
+ function CdkTable(_differs, _changeDetectorRef, _coalescedStyleScheduler, _elementRef, role, _dir, _document, _platform,
1481
+ // Optional for backwards compatibility, but a view repeater strategy will always
1482
+ // be provided.
1483
+ _viewRepeater) {
1243
1484
  this._differs = _differs;
1244
1485
  this._changeDetectorRef = _changeDetectorRef;
1486
+ this._coalescedStyleScheduler = _coalescedStyleScheduler;
1245
1487
  this._elementRef = _elementRef;
1246
1488
  this._dir = _dir;
1247
1489
  this._platform = _platform;
1490
+ this._viewRepeater = _viewRepeater;
1248
1491
  /** Subject that emits when the component has been destroyed. */
1249
1492
  this._onDestroy = new rxjs.Subject();
1250
1493
  /**
@@ -1306,6 +1549,12 @@
1306
1549
  * table subclasses.
1307
1550
  */
1308
1551
  this.stickyCssClass = 'cdk-table-sticky';
1552
+ /**
1553
+ * Whether to manually add positon: sticky to all sticky cell elements. Not needed if
1554
+ * the position is set in a selector associated with the value of stickyCssClass. May be
1555
+ * overridden by table subclasses
1556
+ */
1557
+ this.needsPositionStickyOnElement = true;
1309
1558
  /** Whether the no data row is currently showing anything. */
1310
1559
  this._isShowingNoDataRow = false;
1311
1560
  this._multiTemplateDataRows = false;
@@ -1335,8 +1584,7 @@
1335
1584
  return this._trackByFn;
1336
1585
  },
1337
1586
  set: function (fn) {
1338
- if (core.isDevMode() && fn != null && typeof fn !== 'function' && console &&
1339
- console.warn) {
1587
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {
1340
1588
  console.warn("trackBy must be a function, but received " + JSON.stringify(fn) + ".");
1341
1589
  }
1342
1590
  this._trackByFn = fn;
@@ -1392,6 +1640,7 @@
1392
1640
  // this setter will be invoked before the row outlet has been defined hence the null check.
1393
1641
  if (this._rowOutlet && this._rowOutlet.viewContainer.length) {
1394
1642
  this._forceRenderDataRows();
1643
+ this.updateStickyColumnStyles();
1395
1644
  }
1396
1645
  },
1397
1646
  enumerable: false,
@@ -1415,11 +1664,13 @@
1415
1664
  this._cacheRowDefs();
1416
1665
  this._cacheColumnDefs();
1417
1666
  // Make sure that the user has at least added header, footer, or data row def.
1418
- if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length) {
1667
+ if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length &&
1668
+ (typeof ngDevMode === 'undefined' || ngDevMode)) {
1419
1669
  throw getTableMissingRowDefsError();
1420
1670
  }
1421
1671
  // Render updates if the list of columns have been changed for the header, row, or footer defs.
1422
- this._renderUpdatedColumns();
1672
+ var columnsChanged = this._renderUpdatedColumns();
1673
+ var stickyColumnStyleUpdateNeeded = columnsChanged || this._headerRowDefChanged || this._footerRowDefChanged;
1423
1674
  // If the header row definition has been changed, trigger a render to the header row.
1424
1675
  if (this._headerRowDefChanged) {
1425
1676
  this._forceRenderHeaderRows();
@@ -1435,6 +1686,11 @@
1435
1686
  if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
1436
1687
  this._observeRenderChanges();
1437
1688
  }
1689
+ else if (stickyColumnStyleUpdateNeeded) {
1690
+ // In the above case, _observeRenderChanges will result in updateStickyColumnStyles being
1691
+ // called when it row data arrives. Otherwise, we need to call it proactively.
1692
+ this.updateStickyColumnStyles();
1693
+ }
1438
1694
  this._checkStickyStates();
1439
1695
  };
1440
1696
  CdkTable.prototype.ngOnDestroy = function () {
@@ -1468,16 +1724,9 @@
1468
1724
  return;
1469
1725
  }
1470
1726
  var viewContainer = this._rowOutlet.viewContainer;
1471
- changes.forEachOperation(function (record, prevIndex, currentIndex) {
1472
- if (record.previousIndex == null) {
1473
- _this._insertRow(record.item, currentIndex);
1474
- }
1475
- else if (currentIndex == null) {
1476
- viewContainer.remove(prevIndex);
1477
- }
1478
- else {
1479
- var view = viewContainer.get(prevIndex);
1480
- viewContainer.move(view, currentIndex);
1727
+ this._viewRepeater.applyChanges(changes, viewContainer, function (record, adjustedPreviousIndex, currentIndex) { return _this._getEmbeddedViewArgs(record.item, currentIndex); }, function (record) { return record.item.data; }, function (change) {
1728
+ if (change.operation === 1 /* INSERTED */ && change.context) {
1729
+ _this._renderCellTemplateForItem(change.record.item.rowDef, change.context);
1481
1730
  }
1482
1731
  });
1483
1732
  // Update the meta context of a row's context data (index, count, first, last, ...)
@@ -1669,7 +1918,8 @@
1669
1918
  this._columnDefsByName.clear();
1670
1919
  var columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);
1671
1920
  columnDefs.forEach(function (columnDef) {
1672
- if (_this._columnDefsByName.has(columnDef.name)) {
1921
+ if (_this._columnDefsByName.has(columnDef.name) &&
1922
+ (typeof ngDevMode === 'undefined' || ngDevMode)) {
1673
1923
  throw getTableDuplicateColumnNameError(columnDef.name);
1674
1924
  }
1675
1925
  _this._columnDefsByName.set(columnDef.name, columnDef);
@@ -1682,7 +1932,8 @@
1682
1932
  this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs);
1683
1933
  // After all row definitions are determined, find the row definition to be considered default.
1684
1934
  var defaultRowDefs = this._rowDefs.filter(function (def) { return !def.when; });
1685
- if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) {
1935
+ if (!this.multiTemplateDataRows && defaultRowDefs.length > 1 &&
1936
+ (typeof ngDevMode === 'undefined' || ngDevMode)) {
1686
1937
  throw getTableMultipleDefaultRowDefsError();
1687
1938
  }
1688
1939
  this._defaultRowDef = defaultRowDefs[0];
@@ -1695,16 +1946,20 @@
1695
1946
  CdkTable.prototype._renderUpdatedColumns = function () {
1696
1947
  var columnsDiffReducer = function (acc, def) { return acc || !!def.getColumnsDiff(); };
1697
1948
  // Force re-render data rows if the list of column definitions have changed.
1698
- if (this._rowDefs.reduce(columnsDiffReducer, false)) {
1949
+ var dataColumnsChanged = this._rowDefs.reduce(columnsDiffReducer, false);
1950
+ if (dataColumnsChanged) {
1699
1951
  this._forceRenderDataRows();
1700
1952
  }
1701
- // Force re-render header/footer rows if the list of column definitions have changed..
1702
- if (this._headerRowDefs.reduce(columnsDiffReducer, false)) {
1953
+ // Force re-render header/footer rows if the list of column definitions have changed.
1954
+ var headerColumnsChanged = this._headerRowDefs.reduce(columnsDiffReducer, false);
1955
+ if (headerColumnsChanged) {
1703
1956
  this._forceRenderHeaderRows();
1704
1957
  }
1705
- if (this._footerRowDefs.reduce(columnsDiffReducer, false)) {
1958
+ var footerColumnsChanged = this._footerRowDefs.reduce(columnsDiffReducer, false);
1959
+ if (footerColumnsChanged) {
1706
1960
  this._forceRenderFooterRows();
1707
1961
  }
1962
+ return dataColumnsChanged || headerColumnsChanged || footerColumnsChanged;
1708
1963
  };
1709
1964
  /**
1710
1965
  * Switch to the provided data source by resetting the data and unsubscribing from the current
@@ -1746,10 +2001,11 @@
1746
2001
  else if (Array.isArray(this.dataSource)) {
1747
2002
  dataStream = rxjs.of(this.dataSource);
1748
2003
  }
1749
- if (dataStream === undefined) {
2004
+ if (dataStream === undefined && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1750
2005
  throw getTableUnknownDataSourceError();
1751
2006
  }
1752
- this._renderChangeSubscription = dataStream.pipe(operators.takeUntil(this._onDestroy)).subscribe(function (data) {
2007
+ this._renderChangeSubscription = dataStream.pipe(operators.takeUntil(this._onDestroy))
2008
+ .subscribe(function (data) {
1753
2009
  _this._data = data || [];
1754
2010
  _this.renderRows();
1755
2011
  });
@@ -1766,7 +2022,6 @@
1766
2022
  }
1767
2023
  this._headerRowDefs.forEach(function (def, i) { return _this._renderRow(_this._headerRowOutlet, def, i); });
1768
2024
  this.updateStickyHeaderRowStyles();
1769
- this.updateStickyColumnStyles();
1770
2025
  };
1771
2026
  /**
1772
2027
  * Clears any existing content in the footer row outlet and creates a new embedded view
@@ -1780,14 +2035,13 @@
1780
2035
  }
1781
2036
  this._footerRowDefs.forEach(function (def, i) { return _this._renderRow(_this._footerRowOutlet, def, i); });
1782
2037
  this.updateStickyFooterRowStyles();
1783
- this.updateStickyColumnStyles();
1784
2038
  };
1785
2039
  /** Adds the sticky column styles for the rows according to the columns' stick states. */
1786
2040
  CdkTable.prototype._addStickyColumnStyles = function (rows, rowDef) {
1787
2041
  var _this = this;
1788
2042
  var columnDefs = Array.from(rowDef.columns || []).map(function (columnName) {
1789
2043
  var columnDef = _this._columnDefsByName.get(columnName);
1790
- if (!columnDef) {
2044
+ if (!columnDef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1791
2045
  throw getTableUnknownColumnError(columnName);
1792
2046
  }
1793
2047
  return columnDef;
@@ -1825,19 +2079,19 @@
1825
2079
  rowDefs.push(rowDef);
1826
2080
  }
1827
2081
  }
1828
- if (!rowDefs.length) {
2082
+ if (!rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1829
2083
  throw getTableMissingMatchingRowDefError(data);
1830
2084
  }
1831
2085
  return rowDefs;
1832
2086
  };
1833
- /**
1834
- * Create the embedded view for the data row template and place it in the correct index location
1835
- * within the data row view container.
1836
- */
1837
- CdkTable.prototype._insertRow = function (renderRow, renderIndex) {
2087
+ CdkTable.prototype._getEmbeddedViewArgs = function (renderRow, index) {
1838
2088
  var rowDef = renderRow.rowDef;
1839
2089
  var context = { $implicit: renderRow.data };
1840
- this._renderRow(this._rowOutlet, rowDef, renderIndex, context);
2090
+ return {
2091
+ templateRef: rowDef.template,
2092
+ context: context,
2093
+ index: index,
2094
+ };
1841
2095
  };
1842
2096
  /**
1843
2097
  * Creates a new row template in the outlet and fills it with the set of cell templates.
@@ -1845,10 +2099,14 @@
1845
2099
  * of where to place the new row template in the outlet.
1846
2100
  */
1847
2101
  CdkTable.prototype._renderRow = function (outlet, rowDef, index, context) {
1848
- var e_1, _a;
1849
2102
  if (context === void 0) { context = {}; }
1850
2103
  // TODO(andrewseguin): enforce that one outlet was instantiated from createEmbeddedView
1851
- outlet.viewContainer.createEmbeddedView(rowDef.template, context, index);
2104
+ var view = outlet.viewContainer.createEmbeddedView(rowDef.template, context, index);
2105
+ this._renderCellTemplateForItem(rowDef, context);
2106
+ return view;
2107
+ };
2108
+ CdkTable.prototype._renderCellTemplateForItem = function (rowDef, context) {
2109
+ var e_1, _a;
1852
2110
  try {
1853
2111
  for (var _b = __values(this._getCellTemplates(rowDef)), _c = _b.next(); !_c.done; _c = _b.next()) {
1854
2112
  var cellTemplate = _c.value;
@@ -1897,7 +2155,7 @@
1897
2155
  }
1898
2156
  return Array.from(rowDef.columns, function (columnId) {
1899
2157
  var column = _this._columnDefsByName.get(columnId);
1900
- if (!column) {
2158
+ if (!column && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1901
2159
  throw getTableUnknownColumnError(columnId);
1902
2160
  }
1903
2161
  return rowDef.extractCellTemplate(column);
@@ -1952,7 +2210,6 @@
1952
2210
  this._dataDiffer.diff([]);
1953
2211
  this._rowOutlet.viewContainer.clear();
1954
2212
  this.renderRows();
1955
- this.updateStickyColumnStyles();
1956
2213
  };
1957
2214
  /**
1958
2215
  * Checks if there has been a change in sticky states since last check and applies the correct
@@ -1984,7 +2241,7 @@
1984
2241
  CdkTable.prototype._setupStickyStyler = function () {
1985
2242
  var _this = this;
1986
2243
  var direction = this._dir ? this._dir.value : 'ltr';
1987
- this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, direction, this._platform.isBrowser);
2244
+ this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, direction, this._coalescedStyleScheduler, this._platform.isBrowser, this.needsPositionStickyOnElement);
1988
2245
  (this._dir ? this._dir.change : rxjs.of())
1989
2246
  .pipe(operators.takeUntil(this._onDestroy))
1990
2247
  .subscribe(function (value) {
@@ -2008,52 +2265,58 @@
2008
2265
  }
2009
2266
  }
2010
2267
  };
2011
- CdkTable.decorators = [
2012
- { type: core.Component, args: [{
2013
- selector: 'cdk-table, table[cdk-table]',
2014
- exportAs: 'cdkTable',
2015
- template: CDK_TABLE_TEMPLATE,
2016
- host: {
2017
- 'class': 'cdk-table',
2018
- },
2019
- encapsulation: core.ViewEncapsulation.None,
2020
- // The "OnPush" status for the `MatTable` component is effectively a noop, so we are removing it.
2021
- // The view for `MatTable` consists entirely of templates declared in other views. As they are
2022
- // declared elsewhere, they are checked when their declaration points are checked.
2023
- // tslint:disable-next-line:validate-decorators
2024
- changeDetection: core.ChangeDetectionStrategy.Default,
2025
- providers: [{ provide: CDK_TABLE, useExisting: CdkTable }]
2026
- },] }
2027
- ];
2028
- CdkTable.ctorParameters = function () { return [
2029
- { type: core.IterableDiffers },
2030
- { type: core.ChangeDetectorRef },
2031
- { type: core.ElementRef },
2032
- { type: String, decorators: [{ type: core.Attribute, args: ['role',] }] },
2033
- { type: bidi.Directionality, decorators: [{ type: core.Optional }] },
2034
- { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
2035
- { type: platform.Platform }
2036
- ]; };
2037
- CdkTable.propDecorators = {
2038
- trackBy: [{ type: core.Input }],
2039
- dataSource: [{ type: core.Input }],
2040
- multiTemplateDataRows: [{ type: core.Input }],
2041
- _rowOutlet: [{ type: core.ViewChild, args: [DataRowOutlet, { static: true },] }],
2042
- _headerRowOutlet: [{ type: core.ViewChild, args: [HeaderRowOutlet, { static: true },] }],
2043
- _footerRowOutlet: [{ type: core.ViewChild, args: [FooterRowOutlet, { static: true },] }],
2044
- _noDataRowOutlet: [{ type: core.ViewChild, args: [NoDataRowOutlet, { static: true },] }],
2045
- _contentColumnDefs: [{ type: core.ContentChildren, args: [CdkColumnDef, { descendants: true },] }],
2046
- _contentRowDefs: [{ type: core.ContentChildren, args: [CdkRowDef, { descendants: true },] }],
2047
- _contentHeaderRowDefs: [{ type: core.ContentChildren, args: [CdkHeaderRowDef, {
2048
- descendants: true
2049
- },] }],
2050
- _contentFooterRowDefs: [{ type: core.ContentChildren, args: [CdkFooterRowDef, {
2051
- descendants: true
2052
- },] }],
2053
- _noDataRow: [{ type: core.ContentChild, args: [CdkNoDataRow,] }]
2054
- };
2055
2268
  return CdkTable;
2056
2269
  }());
2270
+ CdkTable.decorators = [
2271
+ { type: core.Component, args: [{
2272
+ selector: 'cdk-table, table[cdk-table]',
2273
+ exportAs: 'cdkTable',
2274
+ template: CDK_TABLE_TEMPLATE,
2275
+ host: {
2276
+ 'class': 'cdk-table',
2277
+ },
2278
+ encapsulation: core.ViewEncapsulation.None,
2279
+ // The "OnPush" status for the `MatTable` component is effectively a noop, so we are removing it.
2280
+ // The view for `MatTable` consists entirely of templates declared in other views. As they are
2281
+ // declared elsewhere, they are checked when their declaration points are checked.
2282
+ // tslint:disable-next-line:validate-decorators
2283
+ changeDetection: core.ChangeDetectionStrategy.Default,
2284
+ providers: [
2285
+ { provide: CDK_TABLE, useExisting: CdkTable },
2286
+ { provide: collections._VIEW_REPEATER_STRATEGY, useClass: collections._DisposeViewRepeaterStrategy },
2287
+ _CoalescedStyleScheduler,
2288
+ ]
2289
+ },] }
2290
+ ];
2291
+ CdkTable.ctorParameters = function () { return [
2292
+ { type: core.IterableDiffers },
2293
+ { type: core.ChangeDetectorRef },
2294
+ { type: _CoalescedStyleScheduler },
2295
+ { type: core.ElementRef },
2296
+ { type: String, decorators: [{ type: core.Attribute, args: ['role',] }] },
2297
+ { type: bidi.Directionality, decorators: [{ type: core.Optional }] },
2298
+ { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
2299
+ { type: platform.Platform },
2300
+ { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [collections._VIEW_REPEATER_STRATEGY,] }] }
2301
+ ]; };
2302
+ CdkTable.propDecorators = {
2303
+ trackBy: [{ type: core.Input }],
2304
+ dataSource: [{ type: core.Input }],
2305
+ multiTemplateDataRows: [{ type: core.Input }],
2306
+ _rowOutlet: [{ type: core.ViewChild, args: [DataRowOutlet, { static: true },] }],
2307
+ _headerRowOutlet: [{ type: core.ViewChild, args: [HeaderRowOutlet, { static: true },] }],
2308
+ _footerRowOutlet: [{ type: core.ViewChild, args: [FooterRowOutlet, { static: true },] }],
2309
+ _noDataRowOutlet: [{ type: core.ViewChild, args: [NoDataRowOutlet, { static: true },] }],
2310
+ _contentColumnDefs: [{ type: core.ContentChildren, args: [CdkColumnDef, { descendants: true },] }],
2311
+ _contentRowDefs: [{ type: core.ContentChildren, args: [CdkRowDef, { descendants: true },] }],
2312
+ _contentHeaderRowDefs: [{ type: core.ContentChildren, args: [CdkHeaderRowDef, {
2313
+ descendants: true
2314
+ },] }],
2315
+ _contentFooterRowDefs: [{ type: core.ContentChildren, args: [CdkFooterRowDef, {
2316
+ descendants: true
2317
+ },] }],
2318
+ _noDataRow: [{ type: core.ContentChild, args: [CdkNoDataRow,] }]
2319
+ };
2057
2320
  /** Utility function that gets a merged list of the entries in an array and values of a Set. */
2058
2321
  function mergeArrayAndSet(array, set) {
2059
2322
  return array.concat(Array.from(set));
@@ -2076,7 +2339,11 @@
2076
2339
  * input.
2077
2340
  */
2078
2341
  var CdkTextColumn = /** @class */ (function () {
2079
- function CdkTextColumn(_table, _options) {
2342
+ function CdkTextColumn(
2343
+ // `CdkTextColumn` is always requiring a table, but we just assert it manually
2344
+ // for better error reporting.
2345
+ // tslint:disable-next-line: lightweight-tokens
2346
+ _table, _options) {
2080
2347
  this._table = _table;
2081
2348
  this._options = _options;
2082
2349
  /** Alignment of the cell values. */
@@ -2114,7 +2381,7 @@
2114
2381
  this.columnDef.headerCell = this.headerCell;
2115
2382
  this._table.addColumnDef(this.columnDef);
2116
2383
  }
2117
- else {
2384
+ else if (typeof ngDevMode === 'undefined' || ngDevMode) {
2118
2385
  throw getTableTextColumnMissingParentTableError();
2119
2386
  }
2120
2387
  };
@@ -2129,7 +2396,7 @@
2129
2396
  */
2130
2397
  CdkTextColumn.prototype._createDefaultHeaderText = function () {
2131
2398
  var name = this.name;
2132
- if (core.isDevMode() && !name) {
2399
+ if (!name && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2133
2400
  throw getTableTextColumnMissingNameError();
2134
2401
  }
2135
2402
  if (this._options && this._options.defaultHeaderTextTransform) {
@@ -2143,35 +2410,35 @@
2143
2410
  this.columnDef.name = this.name;
2144
2411
  }
2145
2412
  };
2146
- CdkTextColumn.decorators = [
2147
- { type: core.Component, args: [{
2148
- selector: 'cdk-text-column',
2149
- template: "\n <ng-container cdkColumnDef>\n <th cdk-header-cell *cdkHeaderCellDef [style.text-align]=\"justify\">\n {{headerText}}\n </th>\n <td cdk-cell *cdkCellDef=\"let data\" [style.text-align]=\"justify\">\n {{dataAccessor(data, name)}}\n </td>\n </ng-container>\n ",
2150
- encapsulation: core.ViewEncapsulation.None,
2151
- // Change detection is intentionally not set to OnPush. This component's template will be provided
2152
- // to the table to be inserted into its view. This is problematic when change detection runs since
2153
- // the bindings in this template will be evaluated _after_ the table's view is evaluated, which
2154
- // mean's the template in the table's view will not have the updated value (and in fact will cause
2155
- // an ExpressionChangedAfterItHasBeenCheckedError).
2156
- // tslint:disable-next-line:validate-decorators
2157
- changeDetection: core.ChangeDetectionStrategy.Default
2158
- },] }
2159
- ];
2160
- CdkTextColumn.ctorParameters = function () { return [
2161
- { type: CdkTable, decorators: [{ type: core.Optional }] },
2162
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [TEXT_COLUMN_OPTIONS,] }] }
2163
- ]; };
2164
- CdkTextColumn.propDecorators = {
2165
- name: [{ type: core.Input }],
2166
- headerText: [{ type: core.Input }],
2167
- dataAccessor: [{ type: core.Input }],
2168
- justify: [{ type: core.Input }],
2169
- columnDef: [{ type: core.ViewChild, args: [CdkColumnDef, { static: true },] }],
2170
- cell: [{ type: core.ViewChild, args: [CdkCellDef, { static: true },] }],
2171
- headerCell: [{ type: core.ViewChild, args: [CdkHeaderCellDef, { static: true },] }]
2172
- };
2173
2413
  return CdkTextColumn;
2174
2414
  }());
2415
+ CdkTextColumn.decorators = [
2416
+ { type: core.Component, args: [{
2417
+ selector: 'cdk-text-column',
2418
+ template: "\n <ng-container cdkColumnDef>\n <th cdk-header-cell *cdkHeaderCellDef [style.text-align]=\"justify\">\n {{headerText}}\n </th>\n <td cdk-cell *cdkCellDef=\"let data\" [style.text-align]=\"justify\">\n {{dataAccessor(data, name)}}\n </td>\n </ng-container>\n ",
2419
+ encapsulation: core.ViewEncapsulation.None,
2420
+ // Change detection is intentionally not set to OnPush. This component's template will be provided
2421
+ // to the table to be inserted into its view. This is problematic when change detection runs since
2422
+ // the bindings in this template will be evaluated _after_ the table's view is evaluated, which
2423
+ // mean's the template in the table's view will not have the updated value (and in fact will cause
2424
+ // an ExpressionChangedAfterItHasBeenCheckedError).
2425
+ // tslint:disable-next-line:validate-decorators
2426
+ changeDetection: core.ChangeDetectionStrategy.Default
2427
+ },] }
2428
+ ];
2429
+ CdkTextColumn.ctorParameters = function () { return [
2430
+ { type: CdkTable, decorators: [{ type: core.Optional }] },
2431
+ { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [TEXT_COLUMN_OPTIONS,] }] }
2432
+ ]; };
2433
+ CdkTextColumn.propDecorators = {
2434
+ name: [{ type: core.Input }],
2435
+ headerText: [{ type: core.Input }],
2436
+ dataAccessor: [{ type: core.Input }],
2437
+ justify: [{ type: core.Input }],
2438
+ columnDef: [{ type: core.ViewChild, args: [CdkColumnDef, { static: true },] }],
2439
+ cell: [{ type: core.ViewChild, args: [CdkCellDef, { static: true },] }],
2440
+ headerCell: [{ type: core.ViewChild, args: [CdkHeaderCellDef, { static: true },] }]
2441
+ };
2175
2442
 
2176
2443
  /**
2177
2444
  * @license
@@ -2206,14 +2473,15 @@
2206
2473
  var CdkTableModule = /** @class */ (function () {
2207
2474
  function CdkTableModule() {
2208
2475
  }
2209
- CdkTableModule.decorators = [
2210
- { type: core.NgModule, args: [{
2211
- exports: EXPORTED_DECLARATIONS,
2212
- declarations: EXPORTED_DECLARATIONS
2213
- },] }
2214
- ];
2215
2476
  return CdkTableModule;
2216
2477
  }());
2478
+ CdkTableModule.decorators = [
2479
+ { type: core.NgModule, args: [{
2480
+ exports: EXPORTED_DECLARATIONS,
2481
+ declarations: EXPORTED_DECLARATIONS,
2482
+ imports: [scrolling.ScrollingModule]
2483
+ },] }
2484
+ ];
2217
2485
 
2218
2486
  /**
2219
2487
  * @license
@@ -2263,6 +2531,8 @@
2263
2531
  exports.STICKY_DIRECTIONS = STICKY_DIRECTIONS;
2264
2532
  exports.StickyStyler = StickyStyler;
2265
2533
  exports.TEXT_COLUMN_OPTIONS = TEXT_COLUMN_OPTIONS;
2534
+ exports._CoalescedStyleScheduler = _CoalescedStyleScheduler;
2535
+ exports._Schedule = _Schedule;
2266
2536
  exports.mixinHasStickyInput = mixinHasStickyInput;
2267
2537
 
2268
2538
  Object.defineProperty(exports, '__esModule', { value: true });