@angular/cdk 19.2.13 → 19.2.15

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 (429) hide show
  1. package/_adev_assets/cdk_testing.json +7032 -1
  2. package/_adev_assets/cdk_testing_protractor.json +1747 -1
  3. package/_adev_assets/cdk_testing_selenium_webdriver.json +1801 -1
  4. package/_adev_assets/cdk_testing_testbed.json +1903 -1
  5. package/dialog/index.d.ts +17 -12
  6. package/fesm2022/cdk.mjs +1 -1
  7. package/fesm2022/cdk.mjs.map +1 -1
  8. package/fesm2022/dialog.mjs +21 -9
  9. package/fesm2022/dialog.mjs.map +1 -1
  10. package/fesm2022/testing.mjs +255 -52
  11. package/fesm2022/testing.mjs.map +1 -1
  12. package/{harness-environment.d-BatBdODN.d.ts → harness-environment.d-BbFzIFDE.d.ts} +362 -89
  13. package/package.json +1 -1
  14. package/schematics/ng-add/index.js +1 -1
  15. package/testing/index.d.ts +6 -2
  16. package/testing/selenium-webdriver/index.d.ts +1 -1
  17. package/testing/testbed/index.d.ts +1 -1
  18. package/npm_package/LICENSE +0 -21
  19. package/npm_package/README.md +0 -6
  20. package/npm_package/_adev_assets/cdk_testing.json +0 -1
  21. package/npm_package/_adev_assets/cdk_testing_protractor.json +0 -1
  22. package/npm_package/_adev_assets/cdk_testing_selenium_webdriver.json +0 -1
  23. package/npm_package/_adev_assets/cdk_testing_testbed.json +0 -1
  24. package/npm_package/_index.scss +0 -8
  25. package/npm_package/a11y/_index.scss +0 -60
  26. package/npm_package/a11y/index.d.ts +0 -550
  27. package/npm_package/a11y-module.d-DBHGyKoh.d.ts +0 -314
  28. package/npm_package/a11y-prebuilt.css +0 -1
  29. package/npm_package/accordion/index.d.ts +0 -90
  30. package/npm_package/activedescendant-key-manager.d-Bjic5obv.d.ts +0 -32
  31. package/npm_package/bidi/index.d.ts +0 -21
  32. package/npm_package/bidi-module.d-D-fEBKdS.d.ts +0 -54
  33. package/npm_package/clipboard/index.d.ts +0 -101
  34. package/npm_package/coercion/index.d.ts +0 -45
  35. package/npm_package/coercion/private/index.d.ts +0 -9
  36. package/npm_package/collections/index.d.ts +0 -99
  37. package/npm_package/data-source.d-Bblv7Zvh.d.ts +0 -43
  38. package/npm_package/dialog/index.d.ts +0 -426
  39. package/npm_package/drag-drop/index.d.ts +0 -1383
  40. package/npm_package/fesm2022/a11y-module-BYox5gpI.mjs +0 -952
  41. package/npm_package/fesm2022/a11y-module-BYox5gpI.mjs.map +0 -1
  42. package/npm_package/fesm2022/a11y.mjs +0 -539
  43. package/npm_package/fesm2022/a11y.mjs.map +0 -1
  44. package/npm_package/fesm2022/accordion.mjs +0 -210
  45. package/npm_package/fesm2022/accordion.mjs.map +0 -1
  46. package/npm_package/fesm2022/activedescendant-key-manager-DC3-fwQI.mjs +0 -16
  47. package/npm_package/fesm2022/activedescendant-key-manager-DC3-fwQI.mjs.map +0 -1
  48. package/npm_package/fesm2022/array-I1yfCXUO.mjs +0 -6
  49. package/npm_package/fesm2022/array-I1yfCXUO.mjs.map +0 -1
  50. package/npm_package/fesm2022/backwards-compatibility-DHR38MsD.mjs +0 -25
  51. package/npm_package/fesm2022/backwards-compatibility-DHR38MsD.mjs.map +0 -1
  52. package/npm_package/fesm2022/bidi.mjs +0 -80
  53. package/npm_package/fesm2022/bidi.mjs.map +0 -1
  54. package/npm_package/fesm2022/boolean-property-DaaVhX5A.mjs +0 -7
  55. package/npm_package/fesm2022/boolean-property-DaaVhX5A.mjs.map +0 -1
  56. package/npm_package/fesm2022/breakpoints-observer-CljOfYGy.mjs +0 -179
  57. package/npm_package/fesm2022/breakpoints-observer-CljOfYGy.mjs.map +0 -1
  58. package/npm_package/fesm2022/cdk.mjs +0 -7
  59. package/npm_package/fesm2022/cdk.mjs.map +0 -1
  60. package/npm_package/fesm2022/clipboard.mjs +0 -211
  61. package/npm_package/fesm2022/clipboard.mjs.map +0 -1
  62. package/npm_package/fesm2022/coercion/private.mjs +0 -15
  63. package/npm_package/fesm2022/coercion/private.mjs.map +0 -1
  64. package/npm_package/fesm2022/coercion.mjs +0 -39
  65. package/npm_package/fesm2022/coercion.mjs.map +0 -1
  66. package/npm_package/fesm2022/collections.mjs +0 -8
  67. package/npm_package/fesm2022/collections.mjs.map +0 -1
  68. package/npm_package/fesm2022/css-pixel-value-C_HEqLhI.mjs +0 -10
  69. package/npm_package/fesm2022/css-pixel-value-C_HEqLhI.mjs.map +0 -1
  70. package/npm_package/fesm2022/data-source-D34wiQZj.mjs +0 -15
  71. package/npm_package/fesm2022/data-source-D34wiQZj.mjs.map +0 -1
  72. package/npm_package/fesm2022/dialog.mjs +0 -870
  73. package/npm_package/fesm2022/dialog.mjs.map +0 -1
  74. package/npm_package/fesm2022/directionality-CBXD4hga.mjs +0 -72
  75. package/npm_package/fesm2022/directionality-CBXD4hga.mjs.map +0 -1
  76. package/npm_package/fesm2022/dispose-view-repeater-strategy-D_JReLI1.mjs +0 -44
  77. package/npm_package/fesm2022/dispose-view-repeater-strategy-D_JReLI1.mjs.map +0 -1
  78. package/npm_package/fesm2022/drag-drop.mjs +0 -4359
  79. package/npm_package/fesm2022/drag-drop.mjs.map +0 -1
  80. package/npm_package/fesm2022/element-x4z00URv.mjs +0 -29
  81. package/npm_package/fesm2022/element-x4z00URv.mjs.map +0 -1
  82. package/npm_package/fesm2022/fake-event-detection-DWOdFTFz.mjs +0 -24
  83. package/npm_package/fesm2022/fake-event-detection-DWOdFTFz.mjs.map +0 -1
  84. package/npm_package/fesm2022/focus-key-manager-C1rAQJ5z.mjs +0 -22
  85. package/npm_package/fesm2022/focus-key-manager-C1rAQJ5z.mjs.map +0 -1
  86. package/npm_package/fesm2022/focus-monitor-e2l_RpN3.mjs +0 -629
  87. package/npm_package/fesm2022/focus-monitor-e2l_RpN3.mjs.map +0 -1
  88. package/npm_package/fesm2022/id-generator-Dw_9dSDu.mjs +0 -37
  89. package/npm_package/fesm2022/id-generator-Dw_9dSDu.mjs.map +0 -1
  90. package/npm_package/fesm2022/keycodes-CpHkExLC.mjs +0 -122
  91. package/npm_package/fesm2022/keycodes-CpHkExLC.mjs.map +0 -1
  92. package/npm_package/fesm2022/keycodes.mjs +0 -15
  93. package/npm_package/fesm2022/keycodes.mjs.map +0 -1
  94. package/npm_package/fesm2022/layout.mjs +0 -43
  95. package/npm_package/fesm2022/layout.mjs.map +0 -1
  96. package/npm_package/fesm2022/list-key-manager-CyOIXo8P.mjs +0 -360
  97. package/npm_package/fesm2022/list-key-manager-CyOIXo8P.mjs.map +0 -1
  98. package/npm_package/fesm2022/listbox.mjs +0 -925
  99. package/npm_package/fesm2022/listbox.mjs.map +0 -1
  100. package/npm_package/fesm2022/menu.mjs +0 -1966
  101. package/npm_package/fesm2022/menu.mjs.map +0 -1
  102. package/npm_package/fesm2022/observers/private.mjs +0 -124
  103. package/npm_package/fesm2022/observers/private.mjs.map +0 -1
  104. package/npm_package/fesm2022/observers.mjs +0 -210
  105. package/npm_package/fesm2022/observers.mjs.map +0 -1
  106. package/npm_package/fesm2022/overlay-module-BUj0D19H.mjs +0 -3029
  107. package/npm_package/fesm2022/overlay-module-BUj0D19H.mjs.map +0 -1
  108. package/npm_package/fesm2022/overlay.mjs +0 -102
  109. package/npm_package/fesm2022/overlay.mjs.map +0 -1
  110. package/npm_package/fesm2022/passive-listeners-esHZRgIN.mjs +0 -31
  111. package/npm_package/fesm2022/passive-listeners-esHZRgIN.mjs.map +0 -1
  112. package/npm_package/fesm2022/platform-DmdVEw_C.mjs +0 -77
  113. package/npm_package/fesm2022/platform-DmdVEw_C.mjs.map +0 -1
  114. package/npm_package/fesm2022/platform.mjs +0 -74
  115. package/npm_package/fesm2022/platform.mjs.map +0 -1
  116. package/npm_package/fesm2022/portal-directives-Bw5woq8I.mjs +0 -653
  117. package/npm_package/fesm2022/portal-directives-Bw5woq8I.mjs.map +0 -1
  118. package/npm_package/fesm2022/portal.mjs +0 -29
  119. package/npm_package/fesm2022/portal.mjs.map +0 -1
  120. package/npm_package/fesm2022/private.mjs +0 -19
  121. package/npm_package/fesm2022/private.mjs.map +0 -1
  122. package/npm_package/fesm2022/recycle-view-repeater-strategy-DoWdPqVw.mjs +0 -156
  123. package/npm_package/fesm2022/recycle-view-repeater-strategy-DoWdPqVw.mjs.map +0 -1
  124. package/npm_package/fesm2022/scrolling-BkvA05C8.mjs +0 -99
  125. package/npm_package/fesm2022/scrolling-BkvA05C8.mjs.map +0 -1
  126. package/npm_package/fesm2022/scrolling.mjs +0 -1464
  127. package/npm_package/fesm2022/scrolling.mjs.map +0 -1
  128. package/npm_package/fesm2022/selection-model-CeeHVIcP.mjs +0 -226
  129. package/npm_package/fesm2022/selection-model-CeeHVIcP.mjs.map +0 -1
  130. package/npm_package/fesm2022/shadow-dom-B0oHn41l.mjs +0 -49
  131. package/npm_package/fesm2022/shadow-dom-B0oHn41l.mjs.map +0 -1
  132. package/npm_package/fesm2022/stepper.mjs +0 -614
  133. package/npm_package/fesm2022/stepper.mjs.map +0 -1
  134. package/npm_package/fesm2022/style-loader-Cu9AvjH9.mjs +0 -47
  135. package/npm_package/fesm2022/style-loader-Cu9AvjH9.mjs.map +0 -1
  136. package/npm_package/fesm2022/table.mjs +0 -2602
  137. package/npm_package/fesm2022/table.mjs.map +0 -1
  138. package/npm_package/fesm2022/test-environment-CT0XxPyp.mjs +0 -19
  139. package/npm_package/fesm2022/test-environment-CT0XxPyp.mjs.map +0 -1
  140. package/npm_package/fesm2022/testing/selenium-webdriver.mjs +0 -353
  141. package/npm_package/fesm2022/testing/selenium-webdriver.mjs.map +0 -1
  142. package/npm_package/fesm2022/testing/testbed.mjs +0 -782
  143. package/npm_package/fesm2022/testing/testbed.mjs.map +0 -1
  144. package/npm_package/fesm2022/testing.mjs +0 -698
  145. package/npm_package/fesm2022/testing.mjs.map +0 -1
  146. package/npm_package/fesm2022/text-field.mjs +0 -437
  147. package/npm_package/fesm2022/text-field.mjs.map +0 -1
  148. package/npm_package/fesm2022/tree-key-manager-KnCoIkIC.mjs +0 -360
  149. package/npm_package/fesm2022/tree-key-manager-KnCoIkIC.mjs.map +0 -1
  150. package/npm_package/fesm2022/tree.mjs +0 -1795
  151. package/npm_package/fesm2022/tree.mjs.map +0 -1
  152. package/npm_package/fesm2022/typeahead-9ZW4Dtsf.mjs +0 -88
  153. package/npm_package/fesm2022/typeahead-9ZW4Dtsf.mjs.map +0 -1
  154. package/npm_package/fesm2022/unique-selection-dispatcher-DtHZDqyJ.mjs +0 -49
  155. package/npm_package/fesm2022/unique-selection-dispatcher-DtHZDqyJ.mjs.map +0 -1
  156. package/npm_package/focus-key-manager.d-BIKDy8oD.d.ts +0 -34
  157. package/npm_package/focus-monitor.d-CvvJeQRc.d.ts +0 -210
  158. package/npm_package/harness-environment.d-BatBdODN.d.ts +0 -620
  159. package/npm_package/index.d.ts +0 -6
  160. package/npm_package/keycodes/index.d.ts +0 -129
  161. package/npm_package/layout/index.d.ts +0 -89
  162. package/npm_package/list-key-manager.d-BlK3jyRn.d.ts +0 -165
  163. package/npm_package/listbox/index.d.ts +0 -353
  164. package/npm_package/menu/index.d.ts +0 -821
  165. package/npm_package/number-property.d-CJVxXUcb.d.ts +0 -16
  166. package/npm_package/observers/index.d.ts +0 -84
  167. package/npm_package/observers/private/index.d.ts +0 -34
  168. package/npm_package/overlay/_index-deprecated.scss +0 -13
  169. package/npm_package/overlay/_index.scss +0 -193
  170. package/npm_package/overlay/index.d.ts +0 -42
  171. package/npm_package/overlay-module.d-B3qEQtts.d.ts +0 -791
  172. package/npm_package/overlay-prebuilt.css +0 -1
  173. package/npm_package/overlay.d-BdoMy0hX.d.ts +0 -296
  174. package/npm_package/package.json +0 -186
  175. package/npm_package/platform/index.d.ts +0 -83
  176. package/npm_package/platform.d-B3vREl3q.d.ts +0 -33
  177. package/npm_package/portal/index.d.ts +0 -86
  178. package/npm_package/portal-directives.d-BoG39gYN.d.ts +0 -232
  179. package/npm_package/private/index.d.ts +0 -13
  180. package/npm_package/schematics/collection.json +0 -18
  181. package/npm_package/schematics/index.d.ts +0 -14
  182. package/npm_package/schematics/index.js +0 -37
  183. package/npm_package/schematics/index.js.map +0 -1
  184. package/npm_package/schematics/migration.json +0 -15
  185. package/npm_package/schematics/ng-add/index.d.ts +0 -17
  186. package/npm_package/schematics/ng-add/index.js +0 -39
  187. package/npm_package/schematics/ng-add/index.js.map +0 -1
  188. package/npm_package/schematics/ng-add/package-config.d.ts +0 -12
  189. package/npm_package/schematics/ng-add/package-config.js +0 -51
  190. package/npm_package/schematics/ng-add/package-config.js.map +0 -1
  191. package/npm_package/schematics/ng-add/schema.d.ts +0 -11
  192. package/npm_package/schematics/ng-add/schema.js +0 -10
  193. package/npm_package/schematics/ng-add/schema.js.map +0 -1
  194. package/npm_package/schematics/ng-add/schema.json +0 -16
  195. package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +0 -53
  196. package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +0 -21
  197. package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +0 -25
  198. package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +0 -45
  199. package/npm_package/schematics/ng-generate/drag-drop/index.d.ts +0 -11
  200. package/npm_package/schematics/ng-generate/drag-drop/index.js +0 -42
  201. package/npm_package/schematics/ng-generate/drag-drop/index.js.map +0 -1
  202. package/npm_package/schematics/ng-generate/drag-drop/schema.d.ts +0 -10
  203. package/npm_package/schematics/ng-generate/drag-drop/schema.js +0 -10
  204. package/npm_package/schematics/ng-generate/drag-drop/schema.js.map +0 -1
  205. package/npm_package/schematics/ng-generate/drag-drop/schema.json +0 -100
  206. package/npm_package/schematics/ng-update/data/attribute-selectors.d.ts +0 -15
  207. package/npm_package/schematics/ng-update/data/attribute-selectors.js +0 -12
  208. package/npm_package/schematics/ng-update/data/attribute-selectors.js.map +0 -1
  209. package/npm_package/schematics/ng-update/data/class-names.d.ts +0 -15
  210. package/npm_package/schematics/ng-update/data/class-names.js +0 -12
  211. package/npm_package/schematics/ng-update/data/class-names.js.map +0 -1
  212. package/npm_package/schematics/ng-update/data/constructor-checks.d.ts +0 -15
  213. package/npm_package/schematics/ng-update/data/constructor-checks.js +0 -17
  214. package/npm_package/schematics/ng-update/data/constructor-checks.js.map +0 -1
  215. package/npm_package/schematics/ng-update/data/css-selectors.d.ts +0 -27
  216. package/npm_package/schematics/ng-update/data/css-selectors.js +0 -12
  217. package/npm_package/schematics/ng-update/data/css-selectors.js.map +0 -1
  218. package/npm_package/schematics/ng-update/data/css-tokens.d.ts +0 -27
  219. package/npm_package/schematics/ng-update/data/css-tokens.js +0 -12
  220. package/npm_package/schematics/ng-update/data/css-tokens.js.map +0 -1
  221. package/npm_package/schematics/ng-update/data/element-selectors.d.ts +0 -15
  222. package/npm_package/schematics/ng-update/data/element-selectors.js +0 -12
  223. package/npm_package/schematics/ng-update/data/element-selectors.js.map +0 -1
  224. package/npm_package/schematics/ng-update/data/index.d.ts +0 -18
  225. package/npm_package/schematics/ng-update/data/index.js +0 -35
  226. package/npm_package/schematics/ng-update/data/index.js.map +0 -1
  227. package/npm_package/schematics/ng-update/data/input-names.d.ts +0 -22
  228. package/npm_package/schematics/ng-update/data/input-names.js +0 -12
  229. package/npm_package/schematics/ng-update/data/input-names.js.map +0 -1
  230. package/npm_package/schematics/ng-update/data/method-call-checks.d.ts +0 -17
  231. package/npm_package/schematics/ng-update/data/method-call-checks.js +0 -12
  232. package/npm_package/schematics/ng-update/data/method-call-checks.js.map +0 -1
  233. package/npm_package/schematics/ng-update/data/output-names.d.ts +0 -22
  234. package/npm_package/schematics/ng-update/data/output-names.js +0 -12
  235. package/npm_package/schematics/ng-update/data/output-names.js.map +0 -1
  236. package/npm_package/schematics/ng-update/data/property-names.d.ts +0 -20
  237. package/npm_package/schematics/ng-update/data/property-names.js +0 -12
  238. package/npm_package/schematics/ng-update/data/property-names.js.map +0 -1
  239. package/npm_package/schematics/ng-update/data/symbol-removal.d.ts +0 -17
  240. package/npm_package/schematics/ng-update/data/symbol-removal.js +0 -12
  241. package/npm_package/schematics/ng-update/data/symbol-removal.js.map +0 -1
  242. package/npm_package/schematics/ng-update/devkit-file-system.d.ts +0 -30
  243. package/npm_package/schematics/ng-update/devkit-file-system.js +0 -83
  244. package/npm_package/schematics/ng-update/devkit-file-system.js.map +0 -1
  245. package/npm_package/schematics/ng-update/devkit-migration-rule.d.ts +0 -24
  246. package/npm_package/schematics/ng-update/devkit-migration-rule.js +0 -142
  247. package/npm_package/schematics/ng-update/devkit-migration-rule.js.map +0 -1
  248. package/npm_package/schematics/ng-update/devkit-migration.d.ts +0 -35
  249. package/npm_package/schematics/ng-update/devkit-migration.js +0 -20
  250. package/npm_package/schematics/ng-update/devkit-migration.js.map +0 -1
  251. package/npm_package/schematics/ng-update/find-stylesheets.d.ts +0 -16
  252. package/npm_package/schematics/ng-update/find-stylesheets.js +0 -41
  253. package/npm_package/schematics/ng-update/find-stylesheets.js.map +0 -1
  254. package/npm_package/schematics/ng-update/html-parsing/angular.d.ts +0 -15
  255. package/npm_package/schematics/ng-update/html-parsing/angular.js +0 -51
  256. package/npm_package/schematics/ng-update/html-parsing/angular.js.map +0 -1
  257. package/npm_package/schematics/ng-update/html-parsing/elements.d.ts +0 -24
  258. package/npm_package/schematics/ng-update/html-parsing/elements.js +0 -63
  259. package/npm_package/schematics/ng-update/html-parsing/elements.js.map +0 -1
  260. package/npm_package/schematics/ng-update/index.d.ts +0 -10
  261. package/npm_package/schematics/ng-update/index.js +0 -29
  262. package/npm_package/schematics/ng-update/index.js.map +0 -1
  263. package/npm_package/schematics/ng-update/migrations/attribute-selectors.d.ts +0 -26
  264. package/npm_package/schematics/ng-update/migrations/attribute-selectors.js +0 -71
  265. package/npm_package/schematics/ng-update/migrations/attribute-selectors.js.map +0 -1
  266. package/npm_package/schematics/ng-update/migrations/class-inheritance.d.ts +0 -26
  267. package/npm_package/schematics/ng-update/migrations/class-inheritance.js +0 -58
  268. package/npm_package/schematics/ng-update/migrations/class-inheritance.js.map +0 -1
  269. package/npm_package/schematics/ng-update/migrations/class-names.d.ts +0 -32
  270. package/npm_package/schematics/ng-update/migrations/class-names.js +0 -91
  271. package/npm_package/schematics/ng-update/migrations/class-names.js.map +0 -1
  272. package/npm_package/schematics/ng-update/migrations/constructor-signature.d.ts +0 -29
  273. package/npm_package/schematics/ng-update/migrations/constructor-signature.js +0 -139
  274. package/npm_package/schematics/ng-update/migrations/constructor-signature.js.map +0 -1
  275. package/npm_package/schematics/ng-update/migrations/css-selectors.d.ts +0 -26
  276. package/npm_package/schematics/ng-update/migrations/css-selectors.js +0 -75
  277. package/npm_package/schematics/ng-update/migrations/css-selectors.js.map +0 -1
  278. package/npm_package/schematics/ng-update/migrations/css-tokens.d.ts +0 -26
  279. package/npm_package/schematics/ng-update/migrations/css-tokens.js +0 -83
  280. package/npm_package/schematics/ng-update/migrations/css-tokens.js.map +0 -1
  281. package/npm_package/schematics/ng-update/migrations/element-selectors.d.ts +0 -26
  282. package/npm_package/schematics/ng-update/migrations/element-selectors.js +0 -66
  283. package/npm_package/schematics/ng-update/migrations/element-selectors.js.map +0 -1
  284. package/npm_package/schematics/ng-update/migrations/input-names.d.ts +0 -26
  285. package/npm_package/schematics/ng-update/migrations/input-names.js +0 -59
  286. package/npm_package/schematics/ng-update/migrations/input-names.js.map +0 -1
  287. package/npm_package/schematics/ng-update/migrations/method-call-arguments.d.ts +0 -22
  288. package/npm_package/schematics/ng-update/migrations/method-call-arguments.js +0 -62
  289. package/npm_package/schematics/ng-update/migrations/method-call-arguments.js.map +0 -1
  290. package/npm_package/schematics/ng-update/migrations/misc-template.d.ts +0 -18
  291. package/npm_package/schematics/ng-update/migrations/misc-template.js +0 -25
  292. package/npm_package/schematics/ng-update/migrations/misc-template.js.map +0 -1
  293. package/npm_package/schematics/ng-update/migrations/output-names.d.ts +0 -22
  294. package/npm_package/schematics/ng-update/migrations/output-names.js +0 -46
  295. package/npm_package/schematics/ng-update/migrations/output-names.js.map +0 -1
  296. package/npm_package/schematics/ng-update/migrations/property-names.d.ts +0 -22
  297. package/npm_package/schematics/ng-update/migrations/property-names.js +0 -60
  298. package/npm_package/schematics/ng-update/migrations/property-names.js.map +0 -1
  299. package/npm_package/schematics/ng-update/migrations/symbol-removal.d.ts +0 -18
  300. package/npm_package/schematics/ng-update/migrations/symbol-removal.js +0 -47
  301. package/npm_package/schematics/ng-update/migrations/symbol-removal.js.map +0 -1
  302. package/npm_package/schematics/ng-update/public-api.d.ts +0 -19
  303. package/npm_package/schematics/ng-update/public-api.js +0 -36
  304. package/npm_package/schematics/ng-update/public-api.js.map +0 -1
  305. package/npm_package/schematics/ng-update/typescript/base-types.d.ts +0 -10
  306. package/npm_package/schematics/ng-update/typescript/base-types.js +0 -23
  307. package/npm_package/schematics/ng-update/typescript/base-types.js.map +0 -1
  308. package/npm_package/schematics/ng-update/typescript/imports.d.ts +0 -18
  309. package/npm_package/schematics/ng-update/typescript/imports.js +0 -53
  310. package/npm_package/schematics/ng-update/typescript/imports.js.map +0 -1
  311. package/npm_package/schematics/ng-update/typescript/literal.d.ts +0 -18
  312. package/npm_package/schematics/ng-update/typescript/literal.js +0 -32
  313. package/npm_package/schematics/ng-update/typescript/literal.js.map +0 -1
  314. package/npm_package/schematics/ng-update/typescript/module-specifiers.d.ts +0 -16
  315. package/npm_package/schematics/ng-update/typescript/module-specifiers.js +0 -35
  316. package/npm_package/schematics/ng-update/typescript/module-specifiers.js.map +0 -1
  317. package/npm_package/schematics/ng-update/upgrade-data.d.ts +0 -35
  318. package/npm_package/schematics/ng-update/upgrade-data.js +0 -40
  319. package/npm_package/schematics/ng-update/upgrade-data.js.map +0 -1
  320. package/npm_package/schematics/package.json +0 -3
  321. package/npm_package/schematics/paths.d.ts +0 -11
  322. package/npm_package/schematics/paths.js +0 -16
  323. package/npm_package/schematics/paths.js.map +0 -1
  324. package/npm_package/schematics/update-tool/component-resource-collector.d.ts +0 -44
  325. package/npm_package/schematics/update-tool/component-resource-collector.js +0 -164
  326. package/npm_package/schematics/update-tool/component-resource-collector.js.map +0 -1
  327. package/npm_package/schematics/update-tool/file-system.d.ts +0 -72
  328. package/npm_package/schematics/update-tool/file-system.js +0 -18
  329. package/npm_package/schematics/update-tool/file-system.js.map +0 -1
  330. package/npm_package/schematics/update-tool/index.d.ts +0 -74
  331. package/npm_package/schematics/update-tool/index.js +0 -172
  332. package/npm_package/schematics/update-tool/index.js.map +0 -1
  333. package/npm_package/schematics/update-tool/logger.d.ts +0 -15
  334. package/npm_package/schematics/update-tool/logger.js +0 -18
  335. package/npm_package/schematics/update-tool/logger.js.map +0 -1
  336. package/npm_package/schematics/update-tool/migration.d.ts +0 -87
  337. package/npm_package/schematics/update-tool/migration.js +0 -70
  338. package/npm_package/schematics/update-tool/migration.js.map +0 -1
  339. package/npm_package/schematics/update-tool/public-api.d.ts +0 -16
  340. package/npm_package/schematics/update-tool/public-api.js +0 -33
  341. package/npm_package/schematics/update-tool/public-api.js.map +0 -1
  342. package/npm_package/schematics/update-tool/target-version.d.ts +0 -16
  343. package/npm_package/schematics/update-tool/target-version.js +0 -27
  344. package/npm_package/schematics/update-tool/target-version.js.map +0 -1
  345. package/npm_package/schematics/update-tool/update-recorder.d.ts +0 -13
  346. package/npm_package/schematics/update-tool/update-recorder.js +0 -10
  347. package/npm_package/schematics/update-tool/update-recorder.js.map +0 -1
  348. package/npm_package/schematics/update-tool/utils/decorators.d.ts +0 -22
  349. package/npm_package/schematics/update-tool/utils/decorators.js +0 -41
  350. package/npm_package/schematics/update-tool/utils/decorators.js.map +0 -1
  351. package/npm_package/schematics/update-tool/utils/diagnostics.d.ts +0 -11
  352. package/npm_package/schematics/update-tool/utils/diagnostics.js +0 -18
  353. package/npm_package/schematics/update-tool/utils/diagnostics.js.map +0 -1
  354. package/npm_package/schematics/update-tool/utils/functions.d.ts +0 -14
  355. package/npm_package/schematics/update-tool/utils/functions.js +0 -20
  356. package/npm_package/schematics/update-tool/utils/functions.js.map +0 -1
  357. package/npm_package/schematics/update-tool/utils/imports.d.ts +0 -17
  358. package/npm_package/schematics/update-tool/utils/imports.js +0 -110
  359. package/npm_package/schematics/update-tool/utils/imports.js.map +0 -1
  360. package/npm_package/schematics/update-tool/utils/line-mappings.d.ts +0 -21
  361. package/npm_package/schematics/update-tool/utils/line-mappings.js +0 -75
  362. package/npm_package/schematics/update-tool/utils/line-mappings.js.map +0 -1
  363. package/npm_package/schematics/update-tool/utils/parse-tsconfig.d.ts +0 -18
  364. package/npm_package/schematics/update-tool/utils/parse-tsconfig.js +0 -45
  365. package/npm_package/schematics/update-tool/utils/parse-tsconfig.js.map +0 -1
  366. package/npm_package/schematics/update-tool/utils/property-name.d.ts +0 -18
  367. package/npm_package/schematics/update-tool/utils/property-name.js +0 -27
  368. package/npm_package/schematics/update-tool/utils/property-name.js.map +0 -1
  369. package/npm_package/schematics/update-tool/utils/virtual-host.d.ts +0 -36
  370. package/npm_package/schematics/update-tool/utils/virtual-host.js +0 -71
  371. package/npm_package/schematics/update-tool/utils/virtual-host.js.map +0 -1
  372. package/npm_package/schematics/update-tool/version-changes.d.ts +0 -32
  373. package/npm_package/schematics/update-tool/version-changes.js +0 -38
  374. package/npm_package/schematics/update-tool/version-changes.js.map +0 -1
  375. package/npm_package/schematics/utils/ast/ng-module-imports.d.ts +0 -12
  376. package/npm_package/schematics/utils/ast/ng-module-imports.js +0 -82
  377. package/npm_package/schematics/utils/ast/ng-module-imports.js.map +0 -1
  378. package/npm_package/schematics/utils/ast.d.ts +0 -25
  379. package/npm_package/schematics/utils/ast.js +0 -79
  380. package/npm_package/schematics/utils/ast.js.map +0 -1
  381. package/npm_package/schematics/utils/build-component.d.ts +0 -20
  382. package/npm_package/schematics/utils/build-component.js +0 -188
  383. package/npm_package/schematics/utils/build-component.js.map +0 -1
  384. package/npm_package/schematics/utils/get-project.d.ts +0 -13
  385. package/npm_package/schematics/utils/get-project.js +0 -28
  386. package/npm_package/schematics/utils/get-project.js.map +0 -1
  387. package/npm_package/schematics/utils/html-manipulation.d.ts +0 -15
  388. package/npm_package/schematics/utils/html-manipulation.js +0 -91
  389. package/npm_package/schematics/utils/html-manipulation.js.map +0 -1
  390. package/npm_package/schematics/utils/index.d.ts +0 -19
  391. package/npm_package/schematics/utils/index.js +0 -36
  392. package/npm_package/schematics/utils/index.js.map +0 -1
  393. package/npm_package/schematics/utils/parse5-element.d.ts +0 -12
  394. package/npm_package/schematics/utils/parse5-element.js +0 -30
  395. package/npm_package/schematics/utils/parse5-element.js.map +0 -1
  396. package/npm_package/schematics/utils/project-index-file.d.ts +0 -10
  397. package/npm_package/schematics/utils/project-index-file.js +0 -20
  398. package/npm_package/schematics/utils/project-index-file.js.map +0 -1
  399. package/npm_package/schematics/utils/project-main-file.d.ts +0 -10
  400. package/npm_package/schematics/utils/project-main-file.js +0 -25
  401. package/npm_package/schematics/utils/project-main-file.js.map +0 -1
  402. package/npm_package/schematics/utils/project-style-file.d.ts +0 -13
  403. package/npm_package/schematics/utils/project-style-file.js +0 -42
  404. package/npm_package/schematics/utils/project-style-file.js.map +0 -1
  405. package/npm_package/schematics/utils/project-targets.d.ts +0 -14
  406. package/npm_package/schematics/utils/project-targets.js +0 -46
  407. package/npm_package/schematics/utils/project-targets.js.map +0 -1
  408. package/npm_package/schematics/utils/project-tsconfig-paths.d.ts +0 -14
  409. package/npm_package/schematics/utils/project-tsconfig-paths.js +0 -46
  410. package/npm_package/schematics/utils/project-tsconfig-paths.js.map +0 -1
  411. package/npm_package/schematics/utils/schematic-options.d.ts +0 -20
  412. package/npm_package/schematics/utils/schematic-options.js +0 -89
  413. package/npm_package/schematics/utils/schematic-options.js.map +0 -1
  414. package/npm_package/scrolling/index.d.ts +0 -62
  415. package/npm_package/scrolling-module.d-ud2XrbF8.d.ts +0 -552
  416. package/npm_package/selection-model.d-C_vvNGP-.d.ts +0 -117
  417. package/npm_package/stepper/index.d.ts +0 -228
  418. package/npm_package/style-loader.d-BXZfQZTF.d.ts +0 -21
  419. package/npm_package/table/index.d.ts +0 -1100
  420. package/npm_package/testing/index.d.ts +0 -94
  421. package/npm_package/testing/selenium-webdriver/index.d.ts +0 -150
  422. package/npm_package/testing/testbed/index.d.ts +0 -157
  423. package/npm_package/text-field/_index.scss +0 -89
  424. package/npm_package/text-field/index.d.ts +0 -156
  425. package/npm_package/text-field-prebuilt.css +0 -1
  426. package/npm_package/tree/index.d.ts +0 -720
  427. package/npm_package/tree-key-manager-strategy.d-XB6M79l-.d.ts +0 -116
  428. package/npm_package/unique-selection-dispatcher.d-DSFqf1MM.d.ts +0 -33
  429. package/npm_package/view-repeater.d-BKljR8u8.d.ts +0 -89
@@ -1,2602 +0,0 @@
1
- import { i as isDataSource } from './data-source-D34wiQZj.mjs';
2
- export { D as DataSource } from './data-source-D34wiQZj.mjs';
3
- import { DOCUMENT } from '@angular/common';
4
- import * as i0 from '@angular/core';
5
- import { InjectionToken, inject, TemplateRef, Directive, booleanAttribute, Input, ContentChild, ElementRef, NgZone, Injectable, IterableDiffers, ViewContainerRef, Component, ChangeDetectionStrategy, ViewEncapsulation, afterNextRender, ChangeDetectorRef, EventEmitter, Injector, HostAttributeToken, Output, ContentChildren, ViewChild, NgModule } from '@angular/core';
6
- import { Subject, BehaviorSubject, isObservable, of } from 'rxjs';
7
- import { takeUntil } from 'rxjs/operators';
8
- import { b as _VIEW_REPEATER_STRATEGY, _ as _RecycleViewRepeaterStrategy, a as _ViewRepeaterOperation } from './recycle-view-repeater-strategy-DoWdPqVw.mjs';
9
- import { _ as _DisposeViewRepeaterStrategy } from './dispose-view-repeater-strategy-D_JReLI1.mjs';
10
- import { D as Directionality } from './directionality-CBXD4hga.mjs';
11
- import { P as Platform } from './platform-DmdVEw_C.mjs';
12
- import { ViewportRuler, ScrollingModule } from './scrolling.mjs';
13
- import { c as coerceBooleanProperty } from './boolean-property-DaaVhX5A.mjs';
14
- import './element-x4z00URv.mjs';
15
- import './scrolling-BkvA05C8.mjs';
16
- import './bidi.mjs';
17
-
18
- /**
19
- * Used to provide a table to some of the sub-components without causing a circular dependency.
20
- * @docs-private
21
- */
22
- const CDK_TABLE = new InjectionToken('CDK_TABLE');
23
- /** Injection token that can be used to specify the text column options. */
24
- const TEXT_COLUMN_OPTIONS = new InjectionToken('text-column-options');
25
-
26
- /**
27
- * Cell definition for a CDK table.
28
- * Captures the template of a column's data row cell as well as cell-specific properties.
29
- */
30
- class CdkCellDef {
31
- /** @docs-private */
32
- template = inject(TemplateRef);
33
- constructor() { }
34
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
35
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkCellDef, isStandalone: true, selector: "[cdkCellDef]", ngImport: i0 });
36
- }
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkCellDef, decorators: [{
38
- type: Directive,
39
- args: [{
40
- selector: '[cdkCellDef]',
41
- }]
42
- }], ctorParameters: () => [] });
43
- /**
44
- * Header cell definition for a CDK table.
45
- * Captures the template of a column's header cell and as well as cell-specific properties.
46
- */
47
- class CdkHeaderCellDef {
48
- /** @docs-private */
49
- template = inject(TemplateRef);
50
- constructor() { }
51
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
52
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkHeaderCellDef, isStandalone: true, selector: "[cdkHeaderCellDef]", ngImport: i0 });
53
- }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderCellDef, decorators: [{
55
- type: Directive,
56
- args: [{
57
- selector: '[cdkHeaderCellDef]',
58
- }]
59
- }], ctorParameters: () => [] });
60
- /**
61
- * Footer cell definition for a CDK table.
62
- * Captures the template of a column's footer cell and as well as cell-specific properties.
63
- */
64
- class CdkFooterCellDef {
65
- /** @docs-private */
66
- template = inject(TemplateRef);
67
- constructor() { }
68
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
69
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkFooterCellDef, isStandalone: true, selector: "[cdkFooterCellDef]", ngImport: i0 });
70
- }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterCellDef, decorators: [{
72
- type: Directive,
73
- args: [{
74
- selector: '[cdkFooterCellDef]',
75
- }]
76
- }], ctorParameters: () => [] });
77
- /**
78
- * Column definition for the CDK table.
79
- * Defines a set of cells available for a table column.
80
- */
81
- class CdkColumnDef {
82
- _table = inject(CDK_TABLE, { optional: true });
83
- _hasStickyChanged = false;
84
- /** Unique name for this column. */
85
- get name() {
86
- return this._name;
87
- }
88
- set name(name) {
89
- this._setNameInput(name);
90
- }
91
- _name;
92
- /** Whether the cell is sticky. */
93
- get sticky() {
94
- return this._sticky;
95
- }
96
- set sticky(value) {
97
- if (value !== this._sticky) {
98
- this._sticky = value;
99
- this._hasStickyChanged = true;
100
- }
101
- }
102
- _sticky = false;
103
- /**
104
- * Whether this column should be sticky positioned on the end of the row. Should make sure
105
- * that it mimics the `CanStick` mixin such that `_hasStickyChanged` is set to true if the value
106
- * has been changed.
107
- */
108
- get stickyEnd() {
109
- return this._stickyEnd;
110
- }
111
- set stickyEnd(value) {
112
- if (value !== this._stickyEnd) {
113
- this._stickyEnd = value;
114
- this._hasStickyChanged = true;
115
- }
116
- }
117
- _stickyEnd = false;
118
- /** @docs-private */
119
- cell;
120
- /** @docs-private */
121
- headerCell;
122
- /** @docs-private */
123
- footerCell;
124
- /**
125
- * Transformed version of the column name that can be used as part of a CSS classname. Excludes
126
- * all non-alphanumeric characters and the special characters '-' and '_'. Any characters that
127
- * do not match are replaced by the '-' character.
128
- */
129
- cssClassFriendlyName;
130
- /**
131
- * Class name for cells in this column.
132
- * @docs-private
133
- */
134
- _columnCssClassName;
135
- constructor() { }
136
- /** Whether the sticky state has changed. */
137
- hasStickyChanged() {
138
- const hasStickyChanged = this._hasStickyChanged;
139
- this.resetStickyChanged();
140
- return hasStickyChanged;
141
- }
142
- /** Resets the sticky changed state. */
143
- resetStickyChanged() {
144
- this._hasStickyChanged = false;
145
- }
146
- /**
147
- * Overridable method that sets the css classes that will be added to every cell in this
148
- * column.
149
- * In the future, columnCssClassName will change from type string[] to string and this
150
- * will set a single string value.
151
- * @docs-private
152
- */
153
- _updateColumnCssClassName() {
154
- this._columnCssClassName = [`cdk-column-${this.cssClassFriendlyName}`];
155
- }
156
- /**
157
- * This has been extracted to a util because of TS 4 and VE.
158
- * View Engine doesn't support property rename inheritance.
159
- * TS 4.0 doesn't allow properties to override accessors or vice-versa.
160
- * @docs-private
161
- */
162
- _setNameInput(value) {
163
- // If the directive is set without a name (updated programmatically), then this setter will
164
- // trigger with an empty string and should not overwrite the programmatically set value.
165
- if (value) {
166
- this._name = value;
167
- this.cssClassFriendlyName = value.replace(/[^a-z0-9_-]/gi, '-');
168
- this._updateColumnCssClassName();
169
- }
170
- }
171
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkColumnDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
172
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.6", type: CdkColumnDef, isStandalone: true, selector: "[cdkColumnDef]", inputs: { name: ["cdkColumnDef", "name"], sticky: ["sticky", "sticky", booleanAttribute], stickyEnd: ["stickyEnd", "stickyEnd", booleanAttribute] }, providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }], queries: [{ propertyName: "cell", first: true, predicate: CdkCellDef, descendants: true }, { propertyName: "headerCell", first: true, predicate: CdkHeaderCellDef, descendants: true }, { propertyName: "footerCell", first: true, predicate: CdkFooterCellDef, descendants: true }], ngImport: i0 });
173
- }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkColumnDef, decorators: [{
175
- type: Directive,
176
- args: [{
177
- selector: '[cdkColumnDef]',
178
- providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }],
179
- }]
180
- }], ctorParameters: () => [], propDecorators: { name: [{
181
- type: Input,
182
- args: ['cdkColumnDef']
183
- }], sticky: [{
184
- type: Input,
185
- args: [{ transform: booleanAttribute }]
186
- }], stickyEnd: [{
187
- type: Input,
188
- args: [{ transform: booleanAttribute }]
189
- }], cell: [{
190
- type: ContentChild,
191
- args: [CdkCellDef]
192
- }], headerCell: [{
193
- type: ContentChild,
194
- args: [CdkHeaderCellDef]
195
- }], footerCell: [{
196
- type: ContentChild,
197
- args: [CdkFooterCellDef]
198
- }] } });
199
- /** Base class for the cells. Adds a CSS classname that identifies the column it renders in. */
200
- class BaseCdkCell {
201
- constructor(columnDef, elementRef) {
202
- elementRef.nativeElement.classList.add(...columnDef._columnCssClassName);
203
- }
204
- }
205
- /** Header cell template container that adds the right classes and role. */
206
- class CdkHeaderCell extends BaseCdkCell {
207
- constructor() {
208
- super(inject(CdkColumnDef), inject(ElementRef));
209
- }
210
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
211
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkHeaderCell, isStandalone: true, selector: "cdk-header-cell, th[cdk-header-cell]", host: { attributes: { "role": "columnheader" }, classAttribute: "cdk-header-cell" }, usesInheritance: true, ngImport: i0 });
212
- }
213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderCell, decorators: [{
214
- type: Directive,
215
- args: [{
216
- selector: 'cdk-header-cell, th[cdk-header-cell]',
217
- host: {
218
- 'class': 'cdk-header-cell',
219
- 'role': 'columnheader',
220
- },
221
- }]
222
- }], ctorParameters: () => [] });
223
- /** Footer cell template container that adds the right classes and role. */
224
- class CdkFooterCell extends BaseCdkCell {
225
- constructor() {
226
- const columnDef = inject(CdkColumnDef);
227
- const elementRef = inject(ElementRef);
228
- super(columnDef, elementRef);
229
- const role = columnDef._table?._getCellRole();
230
- if (role) {
231
- elementRef.nativeElement.setAttribute('role', role);
232
- }
233
- }
234
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
235
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkFooterCell, isStandalone: true, selector: "cdk-footer-cell, td[cdk-footer-cell]", host: { classAttribute: "cdk-footer-cell" }, usesInheritance: true, ngImport: i0 });
236
- }
237
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterCell, decorators: [{
238
- type: Directive,
239
- args: [{
240
- selector: 'cdk-footer-cell, td[cdk-footer-cell]',
241
- host: {
242
- 'class': 'cdk-footer-cell',
243
- },
244
- }]
245
- }], ctorParameters: () => [] });
246
- /** Cell template container that adds the right classes and role. */
247
- class CdkCell extends BaseCdkCell {
248
- constructor() {
249
- const columnDef = inject(CdkColumnDef);
250
- const elementRef = inject(ElementRef);
251
- super(columnDef, elementRef);
252
- const role = columnDef._table?._getCellRole();
253
- if (role) {
254
- elementRef.nativeElement.setAttribute('role', role);
255
- }
256
- }
257
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
258
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkCell, isStandalone: true, selector: "cdk-cell, td[cdk-cell]", host: { classAttribute: "cdk-cell" }, usesInheritance: true, ngImport: i0 });
259
- }
260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkCell, decorators: [{
261
- type: Directive,
262
- args: [{
263
- selector: 'cdk-cell, td[cdk-cell]',
264
- host: {
265
- 'class': 'cdk-cell',
266
- },
267
- }]
268
- }], ctorParameters: () => [] });
269
-
270
- /**
271
- * @docs-private
272
- */
273
- class _Schedule {
274
- tasks = [];
275
- endTasks = [];
276
- }
277
- /** Injection token used to provide a coalesced style scheduler. */
278
- const _COALESCED_STYLE_SCHEDULER = new InjectionToken('_COALESCED_STYLE_SCHEDULER');
279
- /**
280
- * Allows grouping up CSSDom mutations after the current execution context.
281
- * This can significantly improve performance when separate consecutive functions are
282
- * reading from the CSSDom and then mutating it.
283
- *
284
- * @docs-private
285
- */
286
- class _CoalescedStyleScheduler {
287
- _currentSchedule = null;
288
- _ngZone = inject(NgZone);
289
- constructor() { }
290
- /**
291
- * Schedules the specified task to run at the end of the current VM turn.
292
- */
293
- schedule(task) {
294
- this._createScheduleIfNeeded();
295
- this._currentSchedule.tasks.push(task);
296
- }
297
- /**
298
- * Schedules the specified task to run after other scheduled tasks at the end of the current
299
- * VM turn.
300
- */
301
- scheduleEnd(task) {
302
- this._createScheduleIfNeeded();
303
- this._currentSchedule.endTasks.push(task);
304
- }
305
- _createScheduleIfNeeded() {
306
- if (this._currentSchedule) {
307
- return;
308
- }
309
- this._currentSchedule = new _Schedule();
310
- this._ngZone.runOutsideAngular(() =>
311
- // TODO(mmalerba): Scheduling this using something that runs less frequently
312
- // (e.g. requestAnimationFrame, setTimeout, etc.) causes noticeable jank with the column
313
- // resizer. We should audit the usages of schedule / scheduleEnd in that component and see
314
- // if we can refactor it so that we don't need to flush the tasks quite so frequently.
315
- queueMicrotask(() => {
316
- while (this._currentSchedule.tasks.length || this._currentSchedule.endTasks.length) {
317
- const schedule = this._currentSchedule;
318
- // Capture new tasks scheduled by the current set of tasks.
319
- this._currentSchedule = new _Schedule();
320
- for (const task of schedule.tasks) {
321
- task();
322
- }
323
- for (const task of schedule.endTasks) {
324
- task();
325
- }
326
- }
327
- this._currentSchedule = null;
328
- }));
329
- }
330
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: _CoalescedStyleScheduler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
331
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: _CoalescedStyleScheduler });
332
- }
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: _CoalescedStyleScheduler, decorators: [{
334
- type: Injectable
335
- }], ctorParameters: () => [] });
336
-
337
- /**
338
- * The row template that can be used by the mat-table. Should not be used outside of the
339
- * material library.
340
- */
341
- const CDK_ROW_TEMPLATE = `<ng-container cdkCellOutlet></ng-container>`;
342
- /**
343
- * Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs
344
- * for changes and notifying the table.
345
- */
346
- class BaseRowDef {
347
- template = inject(TemplateRef);
348
- _differs = inject(IterableDiffers);
349
- /** The columns to be displayed on this row. */
350
- columns;
351
- /** Differ used to check if any changes were made to the columns. */
352
- _columnsDiffer;
353
- constructor() { }
354
- ngOnChanges(changes) {
355
- // Create a new columns differ if one does not yet exist. Initialize it based on initial value
356
- // of the columns property or an empty array if none is provided.
357
- if (!this._columnsDiffer) {
358
- const columns = (changes['columns'] && changes['columns'].currentValue) || [];
359
- this._columnsDiffer = this._differs.find(columns).create();
360
- this._columnsDiffer.diff(columns);
361
- }
362
- }
363
- /**
364
- * Returns the difference between the current columns and the columns from the last diff, or null
365
- * if there is no difference.
366
- */
367
- getColumnsDiff() {
368
- return this._columnsDiffer.diff(this.columns);
369
- }
370
- /** Gets this row def's relevant cell template from the provided column def. */
371
- extractCellTemplate(column) {
372
- if (this instanceof CdkHeaderRowDef) {
373
- return column.headerCell.template;
374
- }
375
- if (this instanceof CdkFooterRowDef) {
376
- return column.footerCell.template;
377
- }
378
- else {
379
- return column.cell.template;
380
- }
381
- }
382
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: BaseRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
383
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: BaseRowDef, isStandalone: true, usesOnChanges: true, ngImport: i0 });
384
- }
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: BaseRowDef, decorators: [{
386
- type: Directive
387
- }], ctorParameters: () => [] });
388
- /**
389
- * Header row definition for the CDK table.
390
- * Captures the header row's template and other header properties such as the columns to display.
391
- */
392
- class CdkHeaderRowDef extends BaseRowDef {
393
- _table = inject(CDK_TABLE, { optional: true });
394
- _hasStickyChanged = false;
395
- /** Whether the row is sticky. */
396
- get sticky() {
397
- return this._sticky;
398
- }
399
- set sticky(value) {
400
- if (value !== this._sticky) {
401
- this._sticky = value;
402
- this._hasStickyChanged = true;
403
- }
404
- }
405
- _sticky = false;
406
- constructor() {
407
- super(inject(TemplateRef), inject(IterableDiffers));
408
- }
409
- // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
410
- // Explicitly define it so that the method is called as part of the Angular lifecycle.
411
- ngOnChanges(changes) {
412
- super.ngOnChanges(changes);
413
- }
414
- /** Whether the sticky state has changed. */
415
- hasStickyChanged() {
416
- const hasStickyChanged = this._hasStickyChanged;
417
- this.resetStickyChanged();
418
- return hasStickyChanged;
419
- }
420
- /** Resets the sticky changed state. */
421
- resetStickyChanged() {
422
- this._hasStickyChanged = false;
423
- }
424
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
425
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.6", type: CdkHeaderRowDef, isStandalone: true, selector: "[cdkHeaderRowDef]", inputs: { columns: ["cdkHeaderRowDef", "columns"], sticky: ["cdkHeaderRowDefSticky", "sticky", booleanAttribute] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
426
- }
427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderRowDef, decorators: [{
428
- type: Directive,
429
- args: [{
430
- selector: '[cdkHeaderRowDef]',
431
- inputs: [{ name: 'columns', alias: 'cdkHeaderRowDef' }],
432
- }]
433
- }], ctorParameters: () => [], propDecorators: { sticky: [{
434
- type: Input,
435
- args: [{ alias: 'cdkHeaderRowDefSticky', transform: booleanAttribute }]
436
- }] } });
437
- /**
438
- * Footer row definition for the CDK table.
439
- * Captures the footer row's template and other footer properties such as the columns to display.
440
- */
441
- class CdkFooterRowDef extends BaseRowDef {
442
- _table = inject(CDK_TABLE, { optional: true });
443
- _hasStickyChanged = false;
444
- /** Whether the row is sticky. */
445
- get sticky() {
446
- return this._sticky;
447
- }
448
- set sticky(value) {
449
- if (value !== this._sticky) {
450
- this._sticky = value;
451
- this._hasStickyChanged = true;
452
- }
453
- }
454
- _sticky = false;
455
- constructor() {
456
- super(inject(TemplateRef), inject(IterableDiffers));
457
- }
458
- // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
459
- // Explicitly define it so that the method is called as part of the Angular lifecycle.
460
- ngOnChanges(changes) {
461
- super.ngOnChanges(changes);
462
- }
463
- /** Whether the sticky state has changed. */
464
- hasStickyChanged() {
465
- const hasStickyChanged = this._hasStickyChanged;
466
- this.resetStickyChanged();
467
- return hasStickyChanged;
468
- }
469
- /** Resets the sticky changed state. */
470
- resetStickyChanged() {
471
- this._hasStickyChanged = false;
472
- }
473
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
474
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.6", type: CdkFooterRowDef, isStandalone: true, selector: "[cdkFooterRowDef]", inputs: { columns: ["cdkFooterRowDef", "columns"], sticky: ["cdkFooterRowDefSticky", "sticky", booleanAttribute] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
475
- }
476
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterRowDef, decorators: [{
477
- type: Directive,
478
- args: [{
479
- selector: '[cdkFooterRowDef]',
480
- inputs: [{ name: 'columns', alias: 'cdkFooterRowDef' }],
481
- }]
482
- }], ctorParameters: () => [], propDecorators: { sticky: [{
483
- type: Input,
484
- args: [{ alias: 'cdkFooterRowDefSticky', transform: booleanAttribute }]
485
- }] } });
486
- /**
487
- * Data row definition for the CDK table.
488
- * Captures the header row's template and other row properties such as the columns to display and
489
- * a when predicate that describes when this row should be used.
490
- */
491
- class CdkRowDef extends BaseRowDef {
492
- _table = inject(CDK_TABLE, { optional: true });
493
- /**
494
- * Function that should return true if this row template should be used for the provided index
495
- * and row data. If left undefined, this row will be considered the default row template to use
496
- * when no other when functions return true for the data.
497
- * For every row, there must be at least one when function that passes or an undefined to default.
498
- */
499
- when;
500
- constructor() {
501
- // TODO(andrewseguin): Add an input for providing a switch function to determine
502
- // if this template should be used.
503
- super(inject(TemplateRef), inject(IterableDiffers));
504
- }
505
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
506
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkRowDef, isStandalone: true, selector: "[cdkRowDef]", inputs: { columns: ["cdkRowDefColumns", "columns"], when: ["cdkRowDefWhen", "when"] }, usesInheritance: true, ngImport: i0 });
507
- }
508
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkRowDef, decorators: [{
509
- type: Directive,
510
- args: [{
511
- selector: '[cdkRowDef]',
512
- inputs: [
513
- { name: 'columns', alias: 'cdkRowDefColumns' },
514
- { name: 'when', alias: 'cdkRowDefWhen' },
515
- ],
516
- }]
517
- }], ctorParameters: () => [] });
518
- /**
519
- * Outlet for rendering cells inside of a row or header row.
520
- * @docs-private
521
- */
522
- class CdkCellOutlet {
523
- _viewContainer = inject(ViewContainerRef);
524
- /** The ordered list of cells to render within this outlet's view container */
525
- cells;
526
- /** The data context to be provided to each cell */
527
- context;
528
- /**
529
- * Static property containing the latest constructed instance of this class.
530
- * Used by the CDK table when each CdkHeaderRow and CdkRow component is created using
531
- * createEmbeddedView. After one of these components are created, this property will provide
532
- * a handle to provide that component's cells and context. After init, the CdkCellOutlet will
533
- * construct the cells with the provided context.
534
- */
535
- static mostRecentCellOutlet = null;
536
- constructor() {
537
- CdkCellOutlet.mostRecentCellOutlet = this;
538
- }
539
- ngOnDestroy() {
540
- // If this was the last outlet being rendered in the view, remove the reference
541
- // from the static property after it has been destroyed to avoid leaking memory.
542
- if (CdkCellOutlet.mostRecentCellOutlet === this) {
543
- CdkCellOutlet.mostRecentCellOutlet = null;
544
- }
545
- }
546
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkCellOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
547
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkCellOutlet, isStandalone: true, selector: "[cdkCellOutlet]", ngImport: i0 });
548
- }
549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkCellOutlet, decorators: [{
550
- type: Directive,
551
- args: [{
552
- selector: '[cdkCellOutlet]',
553
- }]
554
- }], ctorParameters: () => [] });
555
- /** Header template container that contains the cell outlet. Adds the right class and role. */
556
- class CdkHeaderRow {
557
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
558
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: CdkHeaderRow, isStandalone: true, selector: "cdk-header-row, tr[cdk-header-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-header-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
559
- }
560
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkHeaderRow, decorators: [{
561
- type: Component,
562
- args: [{
563
- selector: 'cdk-header-row, tr[cdk-header-row]',
564
- template: CDK_ROW_TEMPLATE,
565
- host: {
566
- 'class': 'cdk-header-row',
567
- 'role': 'row',
568
- },
569
- // See note on CdkTable for explanation on why this uses the default change detection strategy.
570
- // tslint:disable-next-line:validate-decorators
571
- changeDetection: ChangeDetectionStrategy.Default,
572
- encapsulation: ViewEncapsulation.None,
573
- imports: [CdkCellOutlet],
574
- }]
575
- }] });
576
- /** Footer template container that contains the cell outlet. Adds the right class and role. */
577
- class CdkFooterRow {
578
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
579
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: CdkFooterRow, isStandalone: true, selector: "cdk-footer-row, tr[cdk-footer-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-footer-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
580
- }
581
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkFooterRow, decorators: [{
582
- type: Component,
583
- args: [{
584
- selector: 'cdk-footer-row, tr[cdk-footer-row]',
585
- template: CDK_ROW_TEMPLATE,
586
- host: {
587
- 'class': 'cdk-footer-row',
588
- 'role': 'row',
589
- },
590
- // See note on CdkTable for explanation on why this uses the default change detection strategy.
591
- // tslint:disable-next-line:validate-decorators
592
- changeDetection: ChangeDetectionStrategy.Default,
593
- encapsulation: ViewEncapsulation.None,
594
- imports: [CdkCellOutlet],
595
- }]
596
- }] });
597
- /** Data row template container that contains the cell outlet. Adds the right class and role. */
598
- class CdkRow {
599
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
600
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: CdkRow, isStandalone: true, selector: "cdk-row, tr[cdk-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
601
- }
602
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkRow, decorators: [{
603
- type: Component,
604
- args: [{
605
- selector: 'cdk-row, tr[cdk-row]',
606
- template: CDK_ROW_TEMPLATE,
607
- host: {
608
- 'class': 'cdk-row',
609
- 'role': 'row',
610
- },
611
- // See note on CdkTable for explanation on why this uses the default change detection strategy.
612
- // tslint:disable-next-line:validate-decorators
613
- changeDetection: ChangeDetectionStrategy.Default,
614
- encapsulation: ViewEncapsulation.None,
615
- imports: [CdkCellOutlet],
616
- }]
617
- }] });
618
- /** Row that can be used to display a message when no data is shown in the table. */
619
- class CdkNoDataRow {
620
- templateRef = inject(TemplateRef);
621
- _contentClassName = 'cdk-no-data-row';
622
- constructor() { }
623
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkNoDataRow, deps: [], target: i0.ɵɵFactoryTarget.Directive });
624
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkNoDataRow, isStandalone: true, selector: "ng-template[cdkNoDataRow]", ngImport: i0 });
625
- }
626
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkNoDataRow, decorators: [{
627
- type: Directive,
628
- args: [{
629
- selector: 'ng-template[cdkNoDataRow]',
630
- }]
631
- }], ctorParameters: () => [] });
632
-
633
- /**
634
- * Directions that can be used when setting sticky positioning.
635
- * @docs-private
636
- */
637
- /**
638
- * List of all possible directions that can be used for sticky positioning.
639
- * @docs-private
640
- */
641
- const STICKY_DIRECTIONS = ['top', 'bottom', 'left', 'right'];
642
- /**
643
- * Applies and removes sticky positioning styles to the `CdkTable` rows and columns cells.
644
- * @docs-private
645
- */
646
- class StickyStyler {
647
- _isNativeHtmlTable;
648
- _stickCellCss;
649
- direction;
650
- _coalescedStyleScheduler;
651
- _isBrowser;
652
- _needsPositionStickyOnElement;
653
- _positionListener;
654
- _tableInjector;
655
- _elemSizeCache = new WeakMap();
656
- _resizeObserver = globalThis?.ResizeObserver
657
- ? new globalThis.ResizeObserver(entries => this._updateCachedSizes(entries))
658
- : null;
659
- _updatedStickyColumnsParamsToReplay = [];
660
- _stickyColumnsReplayTimeout = null;
661
- _cachedCellWidths = [];
662
- _borderCellCss;
663
- _destroyed = false;
664
- /**
665
- * @param _isNativeHtmlTable Whether the sticky logic should be based on a table
666
- * that uses the native `<table>` element.
667
- * @param _stickCellCss The CSS class that will be applied to every row/cell that has
668
- * sticky positioning applied.
669
- * @param direction The directionality context of the table (ltr/rtl); affects column positioning
670
- * by reversing left/right positions.
671
- * @param _isBrowser Whether the table is currently being rendered on the server or the client.
672
- * @param _needsPositionStickyOnElement Whether we need to specify position: sticky on cells
673
- * using inline styles. If false, it is assumed that position: sticky is included in
674
- * the component stylesheet for _stickCellCss.
675
- * @param _positionListener A listener that is notified of changes to sticky rows/columns
676
- * and their dimensions.
677
- * @param _tableInjector The table's Injector.
678
- */
679
- constructor(_isNativeHtmlTable, _stickCellCss, direction, _coalescedStyleScheduler, _isBrowser = true, _needsPositionStickyOnElement = true, _positionListener, _tableInjector) {
680
- this._isNativeHtmlTable = _isNativeHtmlTable;
681
- this._stickCellCss = _stickCellCss;
682
- this.direction = direction;
683
- this._coalescedStyleScheduler = _coalescedStyleScheduler;
684
- this._isBrowser = _isBrowser;
685
- this._needsPositionStickyOnElement = _needsPositionStickyOnElement;
686
- this._positionListener = _positionListener;
687
- this._tableInjector = _tableInjector;
688
- this._borderCellCss = {
689
- 'top': `${_stickCellCss}-border-elem-top`,
690
- 'bottom': `${_stickCellCss}-border-elem-bottom`,
691
- 'left': `${_stickCellCss}-border-elem-left`,
692
- 'right': `${_stickCellCss}-border-elem-right`,
693
- };
694
- }
695
- /**
696
- * Clears the sticky positioning styles from the row and its cells by resetting the `position`
697
- * style, setting the zIndex to 0, and unsetting each provided sticky direction.
698
- * @param rows The list of rows that should be cleared from sticking in the provided directions
699
- * @param stickyDirections The directions that should no longer be set as sticky on the rows.
700
- */
701
- clearStickyPositioning(rows, stickyDirections) {
702
- if (stickyDirections.includes('left') || stickyDirections.includes('right')) {
703
- this._removeFromStickyColumnReplayQueue(rows);
704
- }
705
- const elementsToClear = [];
706
- for (const row of rows) {
707
- // If the row isn't an element (e.g. if it's an `ng-container`),
708
- // it won't have inline styles or `children` so we skip it.
709
- if (row.nodeType !== row.ELEMENT_NODE) {
710
- continue;
711
- }
712
- elementsToClear.push(row, ...Array.from(row.children));
713
- }
714
- // Coalesce with sticky row/column updates (and potentially other changes like column resize).
715
- this._afterNextRender({
716
- write: () => {
717
- for (const element of elementsToClear) {
718
- this._removeStickyStyle(element, stickyDirections);
719
- }
720
- },
721
- });
722
- }
723
- /**
724
- * Applies sticky left and right positions to the cells of each row according to the sticky
725
- * states of the rendered column definitions.
726
- * @param rows The rows that should have its set of cells stuck according to the sticky states.
727
- * @param stickyStartStates A list of boolean states where each state represents whether the cell
728
- * in this index position should be stuck to the start of the row.
729
- * @param stickyEndStates A list of boolean states where each state represents whether the cell
730
- * in this index position should be stuck to the end of the row.
731
- * @param recalculateCellWidths Whether the sticky styler should recalculate the width of each
732
- * column cell. If `false` cached widths will be used instead.
733
- * @param replay Whether to enqueue this call for replay after a ResizeObserver update.
734
- */
735
- updateStickyColumns(rows, stickyStartStates, stickyEndStates, recalculateCellWidths = true, replay = true) {
736
- // Don't cache any state if none of the columns are sticky.
737
- if (!rows.length ||
738
- !this._isBrowser ||
739
- !(stickyStartStates.some(state => state) || stickyEndStates.some(state => state))) {
740
- this._positionListener?.stickyColumnsUpdated({ sizes: [] });
741
- this._positionListener?.stickyEndColumnsUpdated({ sizes: [] });
742
- return;
743
- }
744
- // Coalesce with sticky row updates (and potentially other changes like column resize).
745
- const firstRow = rows[0];
746
- const numCells = firstRow.children.length;
747
- const isRtl = this.direction === 'rtl';
748
- const start = isRtl ? 'right' : 'left';
749
- const end = isRtl ? 'left' : 'right';
750
- const lastStickyStart = stickyStartStates.lastIndexOf(true);
751
- const firstStickyEnd = stickyEndStates.indexOf(true);
752
- let cellWidths;
753
- let startPositions;
754
- let endPositions;
755
- if (replay) {
756
- this._updateStickyColumnReplayQueue({
757
- rows: [...rows],
758
- stickyStartStates: [...stickyStartStates],
759
- stickyEndStates: [...stickyEndStates],
760
- });
761
- }
762
- this._afterNextRender({
763
- earlyRead: () => {
764
- cellWidths = this._getCellWidths(firstRow, recalculateCellWidths);
765
- startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates);
766
- endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates);
767
- },
768
- write: () => {
769
- for (const row of rows) {
770
- for (let i = 0; i < numCells; i++) {
771
- const cell = row.children[i];
772
- if (stickyStartStates[i]) {
773
- this._addStickyStyle(cell, start, startPositions[i], i === lastStickyStart);
774
- }
775
- if (stickyEndStates[i]) {
776
- this._addStickyStyle(cell, end, endPositions[i], i === firstStickyEnd);
777
- }
778
- }
779
- }
780
- if (this._positionListener && cellWidths.some(w => !!w)) {
781
- this._positionListener.stickyColumnsUpdated({
782
- sizes: lastStickyStart === -1
783
- ? []
784
- : cellWidths
785
- .slice(0, lastStickyStart + 1)
786
- .map((width, index) => (stickyStartStates[index] ? width : null)),
787
- });
788
- this._positionListener.stickyEndColumnsUpdated({
789
- sizes: firstStickyEnd === -1
790
- ? []
791
- : cellWidths
792
- .slice(firstStickyEnd)
793
- .map((width, index) => (stickyEndStates[index + firstStickyEnd] ? width : null))
794
- .reverse(),
795
- });
796
- }
797
- },
798
- });
799
- }
800
- /**
801
- * Applies sticky positioning to the row's cells if using the native table layout, and to the
802
- * row itself otherwise.
803
- * @param rowsToStick The list of rows that should be stuck according to their corresponding
804
- * sticky state and to the provided top or bottom position.
805
- * @param stickyStates A list of boolean states where each state represents whether the row
806
- * should be stuck in the particular top or bottom position.
807
- * @param position The position direction in which the row should be stuck if that row should be
808
- * sticky.
809
- *
810
- */
811
- stickRows(rowsToStick, stickyStates, position) {
812
- // Since we can't measure the rows on the server, we can't stick the rows properly.
813
- if (!this._isBrowser) {
814
- return;
815
- }
816
- // If positioning the rows to the bottom, reverse their order when evaluating the sticky
817
- // position such that the last row stuck will be "bottom: 0px" and so on. Note that the
818
- // sticky states need to be reversed as well.
819
- const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;
820
- const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;
821
- // Measure row heights all at once before adding sticky styles to reduce layout thrashing.
822
- const stickyOffsets = [];
823
- const stickyCellHeights = [];
824
- const elementsToStick = [];
825
- // Coalesce with other sticky row updates (top/bottom), sticky columns updates
826
- // (and potentially other changes like column resize).
827
- this._afterNextRender({
828
- earlyRead: () => {
829
- for (let rowIndex = 0, stickyOffset = 0; rowIndex < rows.length; rowIndex++) {
830
- if (!states[rowIndex]) {
831
- continue;
832
- }
833
- stickyOffsets[rowIndex] = stickyOffset;
834
- const row = rows[rowIndex];
835
- elementsToStick[rowIndex] = this._isNativeHtmlTable
836
- ? Array.from(row.children)
837
- : [row];
838
- const height = this._retrieveElementSize(row).height;
839
- stickyOffset += height;
840
- stickyCellHeights[rowIndex] = height;
841
- }
842
- },
843
- write: () => {
844
- const borderedRowIndex = states.lastIndexOf(true);
845
- for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
846
- if (!states[rowIndex]) {
847
- continue;
848
- }
849
- const offset = stickyOffsets[rowIndex];
850
- const isBorderedRowIndex = rowIndex === borderedRowIndex;
851
- for (const element of elementsToStick[rowIndex]) {
852
- this._addStickyStyle(element, position, offset, isBorderedRowIndex);
853
- }
854
- }
855
- if (position === 'top') {
856
- this._positionListener?.stickyHeaderRowsUpdated({
857
- sizes: stickyCellHeights,
858
- offsets: stickyOffsets,
859
- elements: elementsToStick,
860
- });
861
- }
862
- else {
863
- this._positionListener?.stickyFooterRowsUpdated({
864
- sizes: stickyCellHeights,
865
- offsets: stickyOffsets,
866
- elements: elementsToStick,
867
- });
868
- }
869
- },
870
- });
871
- }
872
- /**
873
- * When using the native table in Safari, sticky footer cells do not stick. The only way to stick
874
- * footer rows is to apply sticky styling to the tfoot container. This should only be done if
875
- * all footer rows are sticky. If not all footer rows are sticky, remove sticky positioning from
876
- * the tfoot element.
877
- */
878
- updateStickyFooterContainer(tableElement, stickyStates) {
879
- if (!this._isNativeHtmlTable) {
880
- return;
881
- }
882
- // Coalesce with other sticky updates (and potentially other changes like column resize).
883
- this._afterNextRender({
884
- write: () => {
885
- const tfoot = tableElement.querySelector('tfoot');
886
- if (tfoot) {
887
- if (stickyStates.some(state => !state)) {
888
- this._removeStickyStyle(tfoot, ['bottom']);
889
- }
890
- else {
891
- this._addStickyStyle(tfoot, 'bottom', 0, false);
892
- }
893
- }
894
- },
895
- });
896
- }
897
- /** Triggered by the table's OnDestroy hook. */
898
- destroy() {
899
- if (this._stickyColumnsReplayTimeout) {
900
- clearTimeout(this._stickyColumnsReplayTimeout);
901
- }
902
- this._resizeObserver?.disconnect();
903
- this._destroyed = true;
904
- }
905
- /**
906
- * Removes the sticky style on the element by removing the sticky cell CSS class, re-evaluating
907
- * the zIndex, removing each of the provided sticky directions, and removing the
908
- * sticky position if there are no more directions.
909
- */
910
- _removeStickyStyle(element, stickyDirections) {
911
- if (!element.classList.contains(this._stickCellCss)) {
912
- return;
913
- }
914
- for (const dir of stickyDirections) {
915
- element.style[dir] = '';
916
- element.classList.remove(this._borderCellCss[dir]);
917
- }
918
- // If the element no longer has any more sticky directions, remove sticky positioning and
919
- // the sticky CSS class.
920
- // Short-circuit checking element.style[dir] for stickyDirections as they
921
- // were already removed above.
922
- const hasDirection = STICKY_DIRECTIONS.some(dir => stickyDirections.indexOf(dir) === -1 && element.style[dir]);
923
- if (hasDirection) {
924
- element.style.zIndex = this._getCalculatedZIndex(element);
925
- }
926
- else {
927
- // When not hasDirection, _getCalculatedZIndex will always return ''.
928
- element.style.zIndex = '';
929
- if (this._needsPositionStickyOnElement) {
930
- element.style.position = '';
931
- }
932
- element.classList.remove(this._stickCellCss);
933
- }
934
- }
935
- /**
936
- * Adds the sticky styling to the element by adding the sticky style class, changing position
937
- * to be sticky (and -webkit-sticky), setting the appropriate zIndex, and adding a sticky
938
- * direction and value.
939
- */
940
- _addStickyStyle(element, dir, dirValue, isBorderElement) {
941
- element.classList.add(this._stickCellCss);
942
- if (isBorderElement) {
943
- element.classList.add(this._borderCellCss[dir]);
944
- }
945
- element.style[dir] = `${dirValue}px`;
946
- element.style.zIndex = this._getCalculatedZIndex(element);
947
- if (this._needsPositionStickyOnElement) {
948
- element.style.cssText += 'position: -webkit-sticky; position: sticky; ';
949
- }
950
- }
951
- /**
952
- * Calculate what the z-index should be for the element, depending on what directions (top,
953
- * bottom, left, right) have been set. It should be true that elements with a top direction
954
- * should have the highest index since these are elements like a table header. If any of those
955
- * elements are also sticky in another direction, then they should appear above other elements
956
- * that are only sticky top (e.g. a sticky column on a sticky header). Bottom-sticky elements
957
- * (e.g. footer rows) should then be next in the ordering such that they are below the header
958
- * but above any non-sticky elements. Finally, left/right sticky elements (e.g. sticky columns)
959
- * should minimally increment so that they are above non-sticky elements but below top and bottom
960
- * elements.
961
- */
962
- _getCalculatedZIndex(element) {
963
- const zIndexIncrements = {
964
- top: 100,
965
- bottom: 10,
966
- left: 1,
967
- right: 1,
968
- };
969
- let zIndex = 0;
970
- // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,
971
- // loses the array generic type in the `for of`. But we *also* have to use `Array` because
972
- // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration`
973
- for (const dir of STICKY_DIRECTIONS) {
974
- if (element.style[dir]) {
975
- zIndex += zIndexIncrements[dir];
976
- }
977
- }
978
- return zIndex ? `${zIndex}` : '';
979
- }
980
- /** Gets the widths for each cell in the provided row. */
981
- _getCellWidths(row, recalculateCellWidths = true) {
982
- if (!recalculateCellWidths && this._cachedCellWidths.length) {
983
- return this._cachedCellWidths;
984
- }
985
- const cellWidths = [];
986
- const firstRowCells = row.children;
987
- for (let i = 0; i < firstRowCells.length; i++) {
988
- const cell = firstRowCells[i];
989
- cellWidths.push(this._retrieveElementSize(cell).width);
990
- }
991
- this._cachedCellWidths = cellWidths;
992
- return cellWidths;
993
- }
994
- /**
995
- * Determines the left and right positions of each sticky column cell, which will be the
996
- * accumulation of all sticky column cell widths to the left and right, respectively.
997
- * Non-sticky cells do not need to have a value set since their positions will not be applied.
998
- */
999
- _getStickyStartColumnPositions(widths, stickyStates) {
1000
- const positions = [];
1001
- let nextPosition = 0;
1002
- for (let i = 0; i < widths.length; i++) {
1003
- if (stickyStates[i]) {
1004
- positions[i] = nextPosition;
1005
- nextPosition += widths[i];
1006
- }
1007
- }
1008
- return positions;
1009
- }
1010
- /**
1011
- * Determines the left and right positions of each sticky column cell, which will be the
1012
- * accumulation of all sticky column cell widths to the left and right, respectively.
1013
- * Non-sticky cells do not need to have a value set since their positions will not be applied.
1014
- */
1015
- _getStickyEndColumnPositions(widths, stickyStates) {
1016
- const positions = [];
1017
- let nextPosition = 0;
1018
- for (let i = widths.length; i > 0; i--) {
1019
- if (stickyStates[i]) {
1020
- positions[i] = nextPosition;
1021
- nextPosition += widths[i];
1022
- }
1023
- }
1024
- return positions;
1025
- }
1026
- /**
1027
- * Retreives the most recently observed size of the specified element from the cache, or
1028
- * meaures it directly if not yet cached.
1029
- */
1030
- _retrieveElementSize(element) {
1031
- const cachedSize = this._elemSizeCache.get(element);
1032
- if (cachedSize) {
1033
- return cachedSize;
1034
- }
1035
- const clientRect = element.getBoundingClientRect();
1036
- const size = { width: clientRect.width, height: clientRect.height };
1037
- if (!this._resizeObserver) {
1038
- return size;
1039
- }
1040
- this._elemSizeCache.set(element, size);
1041
- this._resizeObserver.observe(element, { box: 'border-box' });
1042
- return size;
1043
- }
1044
- /**
1045
- * Conditionally enqueue the requested sticky update and clear previously queued updates
1046
- * for the same rows.
1047
- */
1048
- _updateStickyColumnReplayQueue(params) {
1049
- this._removeFromStickyColumnReplayQueue(params.rows);
1050
- // No need to replay if a flush is pending.
1051
- if (!this._stickyColumnsReplayTimeout) {
1052
- this._updatedStickyColumnsParamsToReplay.push(params);
1053
- }
1054
- }
1055
- /** Remove updates for the specified rows from the queue. */
1056
- _removeFromStickyColumnReplayQueue(rows) {
1057
- const rowsSet = new Set(rows);
1058
- for (const update of this._updatedStickyColumnsParamsToReplay) {
1059
- update.rows = update.rows.filter(row => !rowsSet.has(row));
1060
- }
1061
- this._updatedStickyColumnsParamsToReplay = this._updatedStickyColumnsParamsToReplay.filter(update => !!update.rows.length);
1062
- }
1063
- /** Update _elemSizeCache with the observed sizes. */
1064
- _updateCachedSizes(entries) {
1065
- let needsColumnUpdate = false;
1066
- for (const entry of entries) {
1067
- const newEntry = entry.borderBoxSize?.length
1068
- ? {
1069
- width: entry.borderBoxSize[0].inlineSize,
1070
- height: entry.borderBoxSize[0].blockSize,
1071
- }
1072
- : {
1073
- width: entry.contentRect.width,
1074
- height: entry.contentRect.height,
1075
- };
1076
- if (newEntry.width !== this._elemSizeCache.get(entry.target)?.width &&
1077
- isCell(entry.target)) {
1078
- needsColumnUpdate = true;
1079
- }
1080
- this._elemSizeCache.set(entry.target, newEntry);
1081
- }
1082
- if (needsColumnUpdate && this._updatedStickyColumnsParamsToReplay.length) {
1083
- if (this._stickyColumnsReplayTimeout) {
1084
- clearTimeout(this._stickyColumnsReplayTimeout);
1085
- }
1086
- this._stickyColumnsReplayTimeout = setTimeout(() => {
1087
- if (this._destroyed) {
1088
- return;
1089
- }
1090
- for (const update of this._updatedStickyColumnsParamsToReplay) {
1091
- this.updateStickyColumns(update.rows, update.stickyStartStates, update.stickyEndStates, true, false);
1092
- }
1093
- this._updatedStickyColumnsParamsToReplay = [];
1094
- this._stickyColumnsReplayTimeout = null;
1095
- }, 0);
1096
- }
1097
- }
1098
- /**
1099
- * Invoke afterNextRender with the table's injector, falling back to CoalescedStyleScheduler
1100
- * if the injector was not provided.
1101
- */
1102
- _afterNextRender(spec) {
1103
- if (this._tableInjector) {
1104
- afterNextRender(spec, { injector: this._tableInjector });
1105
- }
1106
- else {
1107
- this._coalescedStyleScheduler.schedule(() => {
1108
- spec.earlyRead?.();
1109
- spec.write();
1110
- });
1111
- }
1112
- }
1113
- }
1114
- function isCell(element) {
1115
- return ['cdk-cell', 'cdk-header-cell', 'cdk-footer-cell'].some(klass => element.classList.contains(klass));
1116
- }
1117
-
1118
- /**
1119
- * Returns an error to be thrown when attempting to find an nonexistent column.
1120
- * @param id Id whose lookup failed.
1121
- * @docs-private
1122
- */
1123
- function getTableUnknownColumnError(id) {
1124
- return Error(`Could not find column with id "${id}".`);
1125
- }
1126
- /**
1127
- * Returns an error to be thrown when two column definitions have the same name.
1128
- * @docs-private
1129
- */
1130
- function getTableDuplicateColumnNameError(name) {
1131
- return Error(`Duplicate column definition name provided: "${name}".`);
1132
- }
1133
- /**
1134
- * Returns an error to be thrown when there are multiple rows that are missing a when function.
1135
- * @docs-private
1136
- */
1137
- function getTableMultipleDefaultRowDefsError() {
1138
- return Error(`There can only be one default row without a when predicate function.`);
1139
- }
1140
- /**
1141
- * Returns an error to be thrown when there are no matching row defs for a particular set of data.
1142
- * @docs-private
1143
- */
1144
- function getTableMissingMatchingRowDefError(data) {
1145
- return Error(`Could not find a matching row definition for the` +
1146
- `provided row data: ${JSON.stringify(data)}`);
1147
- }
1148
- /**
1149
- * Returns an error to be thrown when there is no row definitions present in the content.
1150
- * @docs-private
1151
- */
1152
- function getTableMissingRowDefsError() {
1153
- return Error('Missing definitions for header, footer, and row; ' +
1154
- 'cannot determine which columns should be rendered.');
1155
- }
1156
- /**
1157
- * Returns an error to be thrown when the data source does not match the compatible types.
1158
- * @docs-private
1159
- */
1160
- function getTableUnknownDataSourceError() {
1161
- return Error(`Provided data source did not match an array, Observable, or DataSource`);
1162
- }
1163
- /**
1164
- * Returns an error to be thrown when the text column cannot find a parent table to inject.
1165
- * @docs-private
1166
- */
1167
- function getTableTextColumnMissingParentTableError() {
1168
- return Error(`Text column could not find a parent table for registration.`);
1169
- }
1170
- /**
1171
- * Returns an error to be thrown when a table text column doesn't have a name.
1172
- * @docs-private
1173
- */
1174
- function getTableTextColumnMissingNameError() {
1175
- return Error(`Table text column must have a name.`);
1176
- }
1177
-
1178
- /** The injection token used to specify the StickyPositioningListener. */
1179
- const STICKY_POSITIONING_LISTENER = new InjectionToken('CDK_SPL');
1180
-
1181
- /**
1182
- * Enables the recycle view repeater strategy, which reduces rendering latency. Not compatible with
1183
- * tables that animate rows.
1184
- */
1185
- class CdkRecycleRows {
1186
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkRecycleRows, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1187
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: CdkRecycleRows, isStandalone: true, selector: "cdk-table[recycleRows], table[cdk-table][recycleRows]", providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 });
1188
- }
1189
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkRecycleRows, decorators: [{
1190
- type: Directive,
1191
- args: [{
1192
- selector: 'cdk-table[recycleRows], table[cdk-table][recycleRows]',
1193
- providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }],
1194
- }]
1195
- }] });
1196
- /**
1197
- * Provides a handle for the table to grab the view container's ng-container to insert data rows.
1198
- * @docs-private
1199
- */
1200
- class DataRowOutlet {
1201
- viewContainer = inject(ViewContainerRef);
1202
- elementRef = inject(ElementRef);
1203
- constructor() {
1204
- const table = inject(CDK_TABLE);
1205
- table._rowOutlet = this;
1206
- table._outletAssigned();
1207
- }
1208
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DataRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1209
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: DataRowOutlet, isStandalone: true, selector: "[rowOutlet]", ngImport: i0 });
1210
- }
1211
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DataRowOutlet, decorators: [{
1212
- type: Directive,
1213
- args: [{
1214
- selector: '[rowOutlet]',
1215
- }]
1216
- }], ctorParameters: () => [] });
1217
- /**
1218
- * Provides a handle for the table to grab the view container's ng-container to insert the header.
1219
- * @docs-private
1220
- */
1221
- class HeaderRowOutlet {
1222
- viewContainer = inject(ViewContainerRef);
1223
- elementRef = inject(ElementRef);
1224
- constructor() {
1225
- const table = inject(CDK_TABLE);
1226
- table._headerRowOutlet = this;
1227
- table._outletAssigned();
1228
- }
1229
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: HeaderRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1230
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: HeaderRowOutlet, isStandalone: true, selector: "[headerRowOutlet]", ngImport: i0 });
1231
- }
1232
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: HeaderRowOutlet, decorators: [{
1233
- type: Directive,
1234
- args: [{
1235
- selector: '[headerRowOutlet]',
1236
- }]
1237
- }], ctorParameters: () => [] });
1238
- /**
1239
- * Provides a handle for the table to grab the view container's ng-container to insert the footer.
1240
- * @docs-private
1241
- */
1242
- class FooterRowOutlet {
1243
- viewContainer = inject(ViewContainerRef);
1244
- elementRef = inject(ElementRef);
1245
- constructor() {
1246
- const table = inject(CDK_TABLE);
1247
- table._footerRowOutlet = this;
1248
- table._outletAssigned();
1249
- }
1250
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FooterRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1251
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: FooterRowOutlet, isStandalone: true, selector: "[footerRowOutlet]", ngImport: i0 });
1252
- }
1253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FooterRowOutlet, decorators: [{
1254
- type: Directive,
1255
- args: [{
1256
- selector: '[footerRowOutlet]',
1257
- }]
1258
- }], ctorParameters: () => [] });
1259
- /**
1260
- * Provides a handle for the table to grab the view
1261
- * container's ng-container to insert the no data row.
1262
- * @docs-private
1263
- */
1264
- class NoDataRowOutlet {
1265
- viewContainer = inject(ViewContainerRef);
1266
- elementRef = inject(ElementRef);
1267
- constructor() {
1268
- const table = inject(CDK_TABLE);
1269
- table._noDataRowOutlet = this;
1270
- table._outletAssigned();
1271
- }
1272
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: NoDataRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1273
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: NoDataRowOutlet, isStandalone: true, selector: "[noDataRowOutlet]", ngImport: i0 });
1274
- }
1275
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: NoDataRowOutlet, decorators: [{
1276
- type: Directive,
1277
- args: [{
1278
- selector: '[noDataRowOutlet]',
1279
- }]
1280
- }], ctorParameters: () => [] });
1281
- /**
1282
- * The table template that can be used by the mat-table. Should not be used outside of the
1283
- * material library.
1284
- * @docs-private
1285
- */
1286
- const CDK_TABLE_TEMPLATE =
1287
- // Note that according to MDN, the `caption` element has to be projected as the **first**
1288
- // element in the table. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption
1289
- `
1290
- <ng-content select="caption"/>
1291
- <ng-content select="colgroup, col"/>
1292
-
1293
- <!--
1294
- Unprojected content throws a hydration error so we need this to capture it.
1295
- It gets removed on the client so it doesn't affect the layout.
1296
- -->
1297
- @if (_isServer) {
1298
- <ng-content/>
1299
- }
1300
-
1301
- @if (_isNativeHtmlTable) {
1302
- <thead role="rowgroup">
1303
- <ng-container headerRowOutlet/>
1304
- </thead>
1305
- <tbody role="rowgroup">
1306
- <ng-container rowOutlet/>
1307
- <ng-container noDataRowOutlet/>
1308
- </tbody>
1309
- <tfoot role="rowgroup">
1310
- <ng-container footerRowOutlet/>
1311
- </tfoot>
1312
- } @else {
1313
- <ng-container headerRowOutlet/>
1314
- <ng-container rowOutlet/>
1315
- <ng-container noDataRowOutlet/>
1316
- <ng-container footerRowOutlet/>
1317
- }
1318
- `;
1319
- /**
1320
- * A data table that can render a header row, data rows, and a footer row.
1321
- * Uses the dataSource input to determine the data to be rendered. The data can be provided either
1322
- * as a data array, an Observable stream that emits the data array to render, or a DataSource with a
1323
- * connect function that will return an Observable stream that emits the data array to render.
1324
- */
1325
- class CdkTable {
1326
- _differs = inject(IterableDiffers);
1327
- _changeDetectorRef = inject(ChangeDetectorRef);
1328
- _elementRef = inject(ElementRef);
1329
- _dir = inject(Directionality, { optional: true });
1330
- _platform = inject(Platform);
1331
- _viewRepeater = inject(_VIEW_REPEATER_STRATEGY);
1332
- _coalescedStyleScheduler = inject(_COALESCED_STYLE_SCHEDULER);
1333
- _viewportRuler = inject(ViewportRuler);
1334
- _stickyPositioningListener = inject(STICKY_POSITIONING_LISTENER, { optional: true, skipSelf: true });
1335
- _document = inject(DOCUMENT);
1336
- /** Latest data provided by the data source. */
1337
- _data;
1338
- /** Subject that emits when the component has been destroyed. */
1339
- _onDestroy = new Subject();
1340
- /** List of the rendered rows as identified by their `RenderRow` object. */
1341
- _renderRows;
1342
- /** Subscription that listens for the data provided by the data source. */
1343
- _renderChangeSubscription;
1344
- /**
1345
- * Map of all the user's defined columns (header, data, and footer cell template) identified by
1346
- * name. Collection populated by the column definitions gathered by `ContentChildren` as well as
1347
- * any custom column definitions added to `_customColumnDefs`.
1348
- */
1349
- _columnDefsByName = new Map();
1350
- /**
1351
- * Set of all row definitions that can be used by this table. Populated by the rows gathered by
1352
- * using `ContentChildren` as well as any custom row definitions added to `_customRowDefs`.
1353
- */
1354
- _rowDefs;
1355
- /**
1356
- * Set of all header row definitions that can be used by this table. Populated by the rows
1357
- * gathered by using `ContentChildren` as well as any custom row definitions added to
1358
- * `_customHeaderRowDefs`.
1359
- */
1360
- _headerRowDefs;
1361
- /**
1362
- * Set of all row definitions that can be used by this table. Populated by the rows gathered by
1363
- * using `ContentChildren` as well as any custom row definitions added to
1364
- * `_customFooterRowDefs`.
1365
- */
1366
- _footerRowDefs;
1367
- /** Differ used to find the changes in the data provided by the data source. */
1368
- _dataDiffer;
1369
- /** Stores the row definition that does not have a when predicate. */
1370
- _defaultRowDef;
1371
- /**
1372
- * Column definitions that were defined outside of the direct content children of the table.
1373
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1374
- * column definitions as *its* content child.
1375
- */
1376
- _customColumnDefs = new Set();
1377
- /**
1378
- * Data row definitions that were defined outside of the direct content children of the table.
1379
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1380
- * built-in data rows as *its* content child.
1381
- */
1382
- _customRowDefs = new Set();
1383
- /**
1384
- * Header row definitions that were defined outside of the direct content children of the table.
1385
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1386
- * built-in header rows as *its* content child.
1387
- */
1388
- _customHeaderRowDefs = new Set();
1389
- /**
1390
- * Footer row definitions that were defined outside of the direct content children of the table.
1391
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has a
1392
- * built-in footer row as *its* content child.
1393
- */
1394
- _customFooterRowDefs = new Set();
1395
- /** No data row that was defined outside of the direct content children of the table. */
1396
- _customNoDataRow;
1397
- /**
1398
- * Whether the header row definition has been changed. Triggers an update to the header row after
1399
- * content is checked. Initialized as true so that the table renders the initial set of rows.
1400
- */
1401
- _headerRowDefChanged = true;
1402
- /**
1403
- * Whether the footer row definition has been changed. Triggers an update to the footer row after
1404
- * content is checked. Initialized as true so that the table renders the initial set of rows.
1405
- */
1406
- _footerRowDefChanged = true;
1407
- /**
1408
- * Whether the sticky column styles need to be updated. Set to `true` when the visible columns
1409
- * change.
1410
- */
1411
- _stickyColumnStylesNeedReset = true;
1412
- /**
1413
- * Whether the sticky styler should recalculate cell widths when applying sticky styles. If
1414
- * `false`, cached values will be used instead. This is only applicable to tables with
1415
- * {@link fixedLayout} enabled. For other tables, cell widths will always be recalculated.
1416
- */
1417
- _forceRecalculateCellWidths = true;
1418
- /**
1419
- * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing
1420
- * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with
1421
- * the cached `RenderRow` objects when possible, the row identity is preserved when the data
1422
- * and row template matches, which allows the `IterableDiffer` to check rows by reference
1423
- * and understand which rows are added/moved/removed.
1424
- *
1425
- * Implemented as a map of maps where the first key is the `data: T` object and the second is the
1426
- * `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that
1427
- * contains an array of created pairs. The array is necessary to handle cases where the data
1428
- * array contains multiple duplicate data objects and each instantiated `RenderRow` must be
1429
- * stored.
1430
- */
1431
- _cachedRenderRowsMap = new Map();
1432
- /** Whether the table is applied to a native `<table>`. */
1433
- _isNativeHtmlTable;
1434
- /**
1435
- * Utility class that is responsible for applying the appropriate sticky positioning styles to
1436
- * the table's rows and cells.
1437
- */
1438
- _stickyStyler;
1439
- /**
1440
- * CSS class added to any row or cell that has sticky positioning applied. May be overridden by
1441
- * table subclasses.
1442
- */
1443
- stickyCssClass = 'cdk-table-sticky';
1444
- /**
1445
- * Whether to manually add position: sticky to all sticky cell elements. Not needed if
1446
- * the position is set in a selector associated with the value of stickyCssClass. May be
1447
- * overridden by table subclasses
1448
- */
1449
- needsPositionStickyOnElement = true;
1450
- /** Whether the component is being rendered on the server. */
1451
- _isServer;
1452
- /** Whether the no data row is currently showing anything. */
1453
- _isShowingNoDataRow = false;
1454
- /** Whether the table has rendered out all the outlets for the first time. */
1455
- _hasAllOutlets = false;
1456
- /** Whether the table is done initializing. */
1457
- _hasInitialized = false;
1458
- /** Aria role to apply to the table's cells based on the table's own role. */
1459
- _getCellRole() {
1460
- // Perform this lazily in case the table's role was updated by a directive after construction.
1461
- if (this._cellRoleInternal === undefined) {
1462
- // Note that we set `role="cell"` even on native `td` elements,
1463
- // because some browsers seem to require it. See #29784.
1464
- const tableRole = this._elementRef.nativeElement.getAttribute('role');
1465
- return tableRole === 'grid' || tableRole === 'treegrid' ? 'gridcell' : 'cell';
1466
- }
1467
- return this._cellRoleInternal;
1468
- }
1469
- _cellRoleInternal = undefined;
1470
- /**
1471
- * Tracking function that will be used to check the differences in data changes. Used similarly
1472
- * to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
1473
- * relative to the function to know if a row should be added/removed/moved.
1474
- * Accepts a function that takes two parameters, `index` and `item`.
1475
- */
1476
- get trackBy() {
1477
- return this._trackByFn;
1478
- }
1479
- set trackBy(fn) {
1480
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {
1481
- console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`);
1482
- }
1483
- this._trackByFn = fn;
1484
- }
1485
- _trackByFn;
1486
- /**
1487
- * The table's source of data, which can be provided in three ways (in order of complexity):
1488
- * - Simple data array (each object represents one table row)
1489
- * - Stream that emits a data array each time the array changes
1490
- * - `DataSource` object that implements the connect/disconnect interface.
1491
- *
1492
- * If a data array is provided, the table must be notified when the array's objects are
1493
- * added, removed, or moved. This can be done by calling the `renderRows()` function which will
1494
- * render the diff since the last table render. If the data array reference is changed, the table
1495
- * will automatically trigger an update to the rows.
1496
- *
1497
- * When providing an Observable stream, the table will trigger an update automatically when the
1498
- * stream emits a new array of data.
1499
- *
1500
- * Finally, when providing a `DataSource` object, the table will use the Observable stream
1501
- * provided by the connect function and trigger updates when that stream emits new data array
1502
- * values. During the table's ngOnDestroy or when the data source is removed from the table, the
1503
- * table will call the DataSource's `disconnect` function (may be useful for cleaning up any
1504
- * subscriptions registered during the connect process).
1505
- */
1506
- get dataSource() {
1507
- return this._dataSource;
1508
- }
1509
- set dataSource(dataSource) {
1510
- if (this._dataSource !== dataSource) {
1511
- this._switchDataSource(dataSource);
1512
- }
1513
- }
1514
- _dataSource;
1515
- /**
1516
- * Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when'
1517
- * predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each
1518
- * dataobject will render the first row that evaluates its when predicate to true, in the order
1519
- * defined in the table, or otherwise the default row which does not have a when predicate.
1520
- */
1521
- get multiTemplateDataRows() {
1522
- return this._multiTemplateDataRows;
1523
- }
1524
- set multiTemplateDataRows(value) {
1525
- this._multiTemplateDataRows = value;
1526
- // In Ivy if this value is set via a static attribute (e.g. <table multiTemplateDataRows>),
1527
- // this setter will be invoked before the row outlet has been defined hence the null check.
1528
- if (this._rowOutlet && this._rowOutlet.viewContainer.length) {
1529
- this._forceRenderDataRows();
1530
- this.updateStickyColumnStyles();
1531
- }
1532
- }
1533
- _multiTemplateDataRows = false;
1534
- /**
1535
- * Whether to use a fixed table layout. Enabling this option will enforce consistent column widths
1536
- * and optimize rendering sticky styles for native tables. No-op for flex tables.
1537
- */
1538
- get fixedLayout() {
1539
- return this._fixedLayout;
1540
- }
1541
- set fixedLayout(value) {
1542
- this._fixedLayout = value;
1543
- // Toggling `fixedLayout` may change column widths. Sticky column styles should be recalculated.
1544
- this._forceRecalculateCellWidths = true;
1545
- this._stickyColumnStylesNeedReset = true;
1546
- }
1547
- _fixedLayout = false;
1548
- /**
1549
- * Emits when the table completes rendering a set of data rows based on the latest data from the
1550
- * data source, even if the set of rows is empty.
1551
- */
1552
- contentChanged = new EventEmitter();
1553
- // TODO(andrewseguin): Remove max value as the end index
1554
- // and instead calculate the view on init and scroll.
1555
- /**
1556
- * Stream containing the latest information on what rows are being displayed on screen.
1557
- * Can be used by the data source to as a heuristic of what data should be provided.
1558
- *
1559
- * @docs-private
1560
- */
1561
- viewChange = new BehaviorSubject({
1562
- start: 0,
1563
- end: Number.MAX_VALUE,
1564
- });
1565
- // Outlets in the table's template where the header, data rows, and footer will be inserted.
1566
- _rowOutlet;
1567
- _headerRowOutlet;
1568
- _footerRowOutlet;
1569
- _noDataRowOutlet;
1570
- /**
1571
- * The column definitions provided by the user that contain what the header, data, and footer
1572
- * cells should render for each column.
1573
- */
1574
- _contentColumnDefs;
1575
- /** Set of data row definitions that were provided to the table as content children. */
1576
- _contentRowDefs;
1577
- /** Set of header row definitions that were provided to the table as content children. */
1578
- _contentHeaderRowDefs;
1579
- /** Set of footer row definitions that were provided to the table as content children. */
1580
- _contentFooterRowDefs;
1581
- /** Row definition that will only be rendered if there's no data in the table. */
1582
- _noDataRow;
1583
- _injector = inject(Injector);
1584
- constructor() {
1585
- const role = inject(new HostAttributeToken('role'), { optional: true });
1586
- if (!role) {
1587
- this._elementRef.nativeElement.setAttribute('role', 'table');
1588
- }
1589
- this._isServer = !this._platform.isBrowser;
1590
- this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE';
1591
- // Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If
1592
- // the user has provided a custom trackBy, return the result of that function as evaluated
1593
- // with the values of the `RenderRow`'s data and index.
1594
- this._dataDiffer = this._differs.find([]).create((_i, dataRow) => {
1595
- return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow;
1596
- });
1597
- }
1598
- ngOnInit() {
1599
- this._setupStickyStyler();
1600
- this._viewportRuler
1601
- .change()
1602
- .pipe(takeUntil(this._onDestroy))
1603
- .subscribe(() => {
1604
- this._forceRecalculateCellWidths = true;
1605
- });
1606
- }
1607
- ngAfterContentInit() {
1608
- this._hasInitialized = true;
1609
- }
1610
- ngAfterContentChecked() {
1611
- // Only start re-rendering in `ngAfterContentChecked` after the first render.
1612
- if (this._canRender()) {
1613
- this._render();
1614
- }
1615
- }
1616
- ngOnDestroy() {
1617
- this._stickyStyler?.destroy();
1618
- [
1619
- this._rowOutlet?.viewContainer,
1620
- this._headerRowOutlet?.viewContainer,
1621
- this._footerRowOutlet?.viewContainer,
1622
- this._cachedRenderRowsMap,
1623
- this._customColumnDefs,
1624
- this._customRowDefs,
1625
- this._customHeaderRowDefs,
1626
- this._customFooterRowDefs,
1627
- this._columnDefsByName,
1628
- ].forEach((def) => {
1629
- def?.clear();
1630
- });
1631
- this._headerRowDefs = [];
1632
- this._footerRowDefs = [];
1633
- this._defaultRowDef = null;
1634
- this._onDestroy.next();
1635
- this._onDestroy.complete();
1636
- if (isDataSource(this.dataSource)) {
1637
- this.dataSource.disconnect(this);
1638
- }
1639
- }
1640
- /**
1641
- * Renders rows based on the table's latest set of data, which was either provided directly as an
1642
- * input or retrieved through an Observable stream (directly or from a DataSource).
1643
- * Checks for differences in the data since the last diff to perform only the necessary
1644
- * changes (add/remove/move rows).
1645
- *
1646
- * If the table's data source is a DataSource or Observable, this will be invoked automatically
1647
- * each time the provided Observable stream emits a new data array. Otherwise if your data is
1648
- * an array, this function will need to be called to render any changes.
1649
- */
1650
- renderRows() {
1651
- this._renderRows = this._getAllRenderRows();
1652
- const changes = this._dataDiffer.diff(this._renderRows);
1653
- if (!changes) {
1654
- this._updateNoDataRow();
1655
- this.contentChanged.next();
1656
- return;
1657
- }
1658
- const viewContainer = this._rowOutlet.viewContainer;
1659
- this._viewRepeater.applyChanges(changes, viewContainer, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record.item, currentIndex), record => record.item.data, (change) => {
1660
- if (change.operation === _ViewRepeaterOperation.INSERTED && change.context) {
1661
- this._renderCellTemplateForItem(change.record.item.rowDef, change.context);
1662
- }
1663
- });
1664
- // Update the meta context of a row's context data (index, count, first, last, ...)
1665
- this._updateRowIndexContext();
1666
- // Update rows that did not get added/removed/moved but may have had their identity changed,
1667
- // e.g. if trackBy matched data on some property but the actual data reference changed.
1668
- changes.forEachIdentityChange((record) => {
1669
- const rowView = viewContainer.get(record.currentIndex);
1670
- rowView.context.$implicit = record.item.data;
1671
- });
1672
- this._updateNoDataRow();
1673
- this.contentChanged.next();
1674
- this.updateStickyColumnStyles();
1675
- }
1676
- /** Adds a column definition that was not included as part of the content children. */
1677
- addColumnDef(columnDef) {
1678
- this._customColumnDefs.add(columnDef);
1679
- }
1680
- /** Removes a column definition that was not included as part of the content children. */
1681
- removeColumnDef(columnDef) {
1682
- this._customColumnDefs.delete(columnDef);
1683
- }
1684
- /** Adds a row definition that was not included as part of the content children. */
1685
- addRowDef(rowDef) {
1686
- this._customRowDefs.add(rowDef);
1687
- }
1688
- /** Removes a row definition that was not included as part of the content children. */
1689
- removeRowDef(rowDef) {
1690
- this._customRowDefs.delete(rowDef);
1691
- }
1692
- /** Adds a header row definition that was not included as part of the content children. */
1693
- addHeaderRowDef(headerRowDef) {
1694
- this._customHeaderRowDefs.add(headerRowDef);
1695
- this._headerRowDefChanged = true;
1696
- }
1697
- /** Removes a header row definition that was not included as part of the content children. */
1698
- removeHeaderRowDef(headerRowDef) {
1699
- this._customHeaderRowDefs.delete(headerRowDef);
1700
- this._headerRowDefChanged = true;
1701
- }
1702
- /** Adds a footer row definition that was not included as part of the content children. */
1703
- addFooterRowDef(footerRowDef) {
1704
- this._customFooterRowDefs.add(footerRowDef);
1705
- this._footerRowDefChanged = true;
1706
- }
1707
- /** Removes a footer row definition that was not included as part of the content children. */
1708
- removeFooterRowDef(footerRowDef) {
1709
- this._customFooterRowDefs.delete(footerRowDef);
1710
- this._footerRowDefChanged = true;
1711
- }
1712
- /** Sets a no data row definition that was not included as a part of the content children. */
1713
- setNoDataRow(noDataRow) {
1714
- this._customNoDataRow = noDataRow;
1715
- }
1716
- /**
1717
- * Updates the header sticky styles. First resets all applied styles with respect to the cells
1718
- * sticking to the top. Then, evaluating which cells need to be stuck to the top. This is
1719
- * automatically called when the header row changes its displayed set of columns, or if its
1720
- * sticky input changes. May be called manually for cases where the cell content changes outside
1721
- * of these events.
1722
- */
1723
- updateStickyHeaderRowStyles() {
1724
- const headerRows = this._getRenderedRows(this._headerRowOutlet);
1725
- // Hide the thead element if there are no header rows. This is necessary to satisfy
1726
- // overzealous a11y checkers that fail because the `rowgroup` element does not contain
1727
- // required child `row`.
1728
- if (this._isNativeHtmlTable) {
1729
- const thead = closestTableSection(this._headerRowOutlet, 'thead');
1730
- if (thead) {
1731
- thead.style.display = headerRows.length ? '' : 'none';
1732
- }
1733
- }
1734
- const stickyStates = this._headerRowDefs.map(def => def.sticky);
1735
- this._stickyStyler.clearStickyPositioning(headerRows, ['top']);
1736
- this._stickyStyler.stickRows(headerRows, stickyStates, 'top');
1737
- // Reset the dirty state of the sticky input change since it has been used.
1738
- this._headerRowDefs.forEach(def => def.resetStickyChanged());
1739
- }
1740
- /**
1741
- * Updates the footer sticky styles. First resets all applied styles with respect to the cells
1742
- * sticking to the bottom. Then, evaluating which cells need to be stuck to the bottom. This is
1743
- * automatically called when the footer row changes its displayed set of columns, or if its
1744
- * sticky input changes. May be called manually for cases where the cell content changes outside
1745
- * of these events.
1746
- */
1747
- updateStickyFooterRowStyles() {
1748
- const footerRows = this._getRenderedRows(this._footerRowOutlet);
1749
- // Hide the tfoot element if there are no footer rows. This is necessary to satisfy
1750
- // overzealous a11y checkers that fail because the `rowgroup` element does not contain
1751
- // required child `row`.
1752
- if (this._isNativeHtmlTable) {
1753
- const tfoot = closestTableSection(this._footerRowOutlet, 'tfoot');
1754
- if (tfoot) {
1755
- tfoot.style.display = footerRows.length ? '' : 'none';
1756
- }
1757
- }
1758
- const stickyStates = this._footerRowDefs.map(def => def.sticky);
1759
- this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']);
1760
- this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom');
1761
- this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates);
1762
- // Reset the dirty state of the sticky input change since it has been used.
1763
- this._footerRowDefs.forEach(def => def.resetStickyChanged());
1764
- }
1765
- /**
1766
- * Updates the column sticky styles. First resets all applied styles with respect to the cells
1767
- * sticking to the left and right. Then sticky styles are added for the left and right according
1768
- * to the column definitions for each cell in each row. This is automatically called when
1769
- * the data source provides a new set of data or when a column definition changes its sticky
1770
- * input. May be called manually for cases where the cell content changes outside of these events.
1771
- */
1772
- updateStickyColumnStyles() {
1773
- const headerRows = this._getRenderedRows(this._headerRowOutlet);
1774
- const dataRows = this._getRenderedRows(this._rowOutlet);
1775
- const footerRows = this._getRenderedRows(this._footerRowOutlet);
1776
- // For tables not using a fixed layout, the column widths may change when new rows are rendered.
1777
- // In a table using a fixed layout, row content won't affect column width, so sticky styles
1778
- // don't need to be cleared unless either the sticky column config changes or one of the row
1779
- // defs change.
1780
- if ((this._isNativeHtmlTable && !this._fixedLayout) || this._stickyColumnStylesNeedReset) {
1781
- // Clear the left and right positioning from all columns in the table across all rows since
1782
- // sticky columns span across all table sections (header, data, footer)
1783
- this._stickyStyler.clearStickyPositioning([...headerRows, ...dataRows, ...footerRows], ['left', 'right']);
1784
- this._stickyColumnStylesNeedReset = false;
1785
- }
1786
- // Update the sticky styles for each header row depending on the def's sticky state
1787
- headerRows.forEach((headerRow, i) => {
1788
- this._addStickyColumnStyles([headerRow], this._headerRowDefs[i]);
1789
- });
1790
- // Update the sticky styles for each data row depending on its def's sticky state
1791
- this._rowDefs.forEach(rowDef => {
1792
- // Collect all the rows rendered with this row definition.
1793
- const rows = [];
1794
- for (let i = 0; i < dataRows.length; i++) {
1795
- if (this._renderRows[i].rowDef === rowDef) {
1796
- rows.push(dataRows[i]);
1797
- }
1798
- }
1799
- this._addStickyColumnStyles(rows, rowDef);
1800
- });
1801
- // Update the sticky styles for each footer row depending on the def's sticky state
1802
- footerRows.forEach((footerRow, i) => {
1803
- this._addStickyColumnStyles([footerRow], this._footerRowDefs[i]);
1804
- });
1805
- // Reset the dirty state of the sticky input change since it has been used.
1806
- Array.from(this._columnDefsByName.values()).forEach(def => def.resetStickyChanged());
1807
- }
1808
- /** Invoked whenever an outlet is created and has been assigned to the table. */
1809
- _outletAssigned() {
1810
- // Trigger the first render once all outlets have been assigned. We do it this way, as
1811
- // opposed to waiting for the next `ngAfterContentChecked`, because we don't know when
1812
- // the next change detection will happen.
1813
- // Also we can't use queries to resolve the outlets, because they're wrapped in a
1814
- // conditional, so we have to rely on them being assigned via DI.
1815
- if (!this._hasAllOutlets &&
1816
- this._rowOutlet &&
1817
- this._headerRowOutlet &&
1818
- this._footerRowOutlet &&
1819
- this._noDataRowOutlet) {
1820
- this._hasAllOutlets = true;
1821
- // In some setups this may fire before `ngAfterContentInit`
1822
- // so we need a check here. See #28538.
1823
- if (this._canRender()) {
1824
- this._render();
1825
- }
1826
- }
1827
- }
1828
- /** Whether the table has all the information to start rendering. */
1829
- _canRender() {
1830
- return this._hasAllOutlets && this._hasInitialized;
1831
- }
1832
- /** Renders the table if its state has changed. */
1833
- _render() {
1834
- // Cache the row and column definitions gathered by ContentChildren and programmatic injection.
1835
- this._cacheRowDefs();
1836
- this._cacheColumnDefs();
1837
- // Make sure that the user has at least added header, footer, or data row def.
1838
- if (!this._headerRowDefs.length &&
1839
- !this._footerRowDefs.length &&
1840
- !this._rowDefs.length &&
1841
- (typeof ngDevMode === 'undefined' || ngDevMode)) {
1842
- throw getTableMissingRowDefsError();
1843
- }
1844
- // Render updates if the list of columns have been changed for the header, row, or footer defs.
1845
- const columnsChanged = this._renderUpdatedColumns();
1846
- const rowDefsChanged = columnsChanged || this._headerRowDefChanged || this._footerRowDefChanged;
1847
- // Ensure sticky column styles are reset if set to `true` elsewhere.
1848
- this._stickyColumnStylesNeedReset = this._stickyColumnStylesNeedReset || rowDefsChanged;
1849
- this._forceRecalculateCellWidths = rowDefsChanged;
1850
- // If the header row definition has been changed, trigger a render to the header row.
1851
- if (this._headerRowDefChanged) {
1852
- this._forceRenderHeaderRows();
1853
- this._headerRowDefChanged = false;
1854
- }
1855
- // If the footer row definition has been changed, trigger a render to the footer row.
1856
- if (this._footerRowDefChanged) {
1857
- this._forceRenderFooterRows();
1858
- this._footerRowDefChanged = false;
1859
- }
1860
- // If there is a data source and row definitions, connect to the data source unless a
1861
- // connection has already been made.
1862
- if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
1863
- this._observeRenderChanges();
1864
- }
1865
- else if (this._stickyColumnStylesNeedReset) {
1866
- // In the above case, _observeRenderChanges will result in updateStickyColumnStyles being
1867
- // called when it row data arrives. Otherwise, we need to call it proactively.
1868
- this.updateStickyColumnStyles();
1869
- }
1870
- this._checkStickyStates();
1871
- }
1872
- /**
1873
- * Get the list of RenderRow objects to render according to the current list of data and defined
1874
- * row definitions. If the previous list already contained a particular pair, it should be reused
1875
- * so that the differ equates their references.
1876
- */
1877
- _getAllRenderRows() {
1878
- const renderRows = [];
1879
- // Store the cache and create a new one. Any re-used RenderRow objects will be moved into the
1880
- // new cache while unused ones can be picked up by garbage collection.
1881
- const prevCachedRenderRows = this._cachedRenderRowsMap;
1882
- this._cachedRenderRowsMap = new Map();
1883
- if (!this._data) {
1884
- return renderRows;
1885
- }
1886
- // For each data object, get the list of rows that should be rendered, represented by the
1887
- // respective `RenderRow` object which is the pair of `data` and `CdkRowDef`.
1888
- for (let i = 0; i < this._data.length; i++) {
1889
- let data = this._data[i];
1890
- const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data));
1891
- if (!this._cachedRenderRowsMap.has(data)) {
1892
- this._cachedRenderRowsMap.set(data, new WeakMap());
1893
- }
1894
- for (let j = 0; j < renderRowsForData.length; j++) {
1895
- let renderRow = renderRowsForData[j];
1896
- const cache = this._cachedRenderRowsMap.get(renderRow.data);
1897
- if (cache.has(renderRow.rowDef)) {
1898
- cache.get(renderRow.rowDef).push(renderRow);
1899
- }
1900
- else {
1901
- cache.set(renderRow.rowDef, [renderRow]);
1902
- }
1903
- renderRows.push(renderRow);
1904
- }
1905
- }
1906
- return renderRows;
1907
- }
1908
- /**
1909
- * Gets a list of `RenderRow<T>` for the provided data object and any `CdkRowDef` objects that
1910
- * should be rendered for this data. Reuses the cached RenderRow objects if they match the same
1911
- * `(T, CdkRowDef)` pair.
1912
- */
1913
- _getRenderRowsForData(data, dataIndex, cache) {
1914
- const rowDefs = this._getRowDefs(data, dataIndex);
1915
- return rowDefs.map(rowDef => {
1916
- const cachedRenderRows = cache && cache.has(rowDef) ? cache.get(rowDef) : [];
1917
- if (cachedRenderRows.length) {
1918
- const dataRow = cachedRenderRows.shift();
1919
- dataRow.dataIndex = dataIndex;
1920
- return dataRow;
1921
- }
1922
- else {
1923
- return { data, rowDef, dataIndex };
1924
- }
1925
- });
1926
- }
1927
- /** Update the map containing the content's column definitions. */
1928
- _cacheColumnDefs() {
1929
- this._columnDefsByName.clear();
1930
- const columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);
1931
- columnDefs.forEach(columnDef => {
1932
- if (this._columnDefsByName.has(columnDef.name) &&
1933
- (typeof ngDevMode === 'undefined' || ngDevMode)) {
1934
- throw getTableDuplicateColumnNameError(columnDef.name);
1935
- }
1936
- this._columnDefsByName.set(columnDef.name, columnDef);
1937
- });
1938
- }
1939
- /** Update the list of all available row definitions that can be used. */
1940
- _cacheRowDefs() {
1941
- this._headerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentHeaderRowDefs), this._customHeaderRowDefs);
1942
- this._footerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentFooterRowDefs), this._customFooterRowDefs);
1943
- this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs);
1944
- // After all row definitions are determined, find the row definition to be considered default.
1945
- const defaultRowDefs = this._rowDefs.filter(def => !def.when);
1946
- if (!this.multiTemplateDataRows &&
1947
- defaultRowDefs.length > 1 &&
1948
- (typeof ngDevMode === 'undefined' || ngDevMode)) {
1949
- throw getTableMultipleDefaultRowDefsError();
1950
- }
1951
- this._defaultRowDef = defaultRowDefs[0];
1952
- }
1953
- /**
1954
- * Check if the header, data, or footer rows have changed what columns they want to display or
1955
- * whether the sticky states have changed for the header or footer. If there is a diff, then
1956
- * re-render that section.
1957
- */
1958
- _renderUpdatedColumns() {
1959
- const columnsDiffReducer = (acc, def) => {
1960
- // The differ should be run for every column, even if `acc` is already
1961
- // true (see #29922)
1962
- const diff = !!def.getColumnsDiff();
1963
- return acc || diff;
1964
- };
1965
- // Force re-render data rows if the list of column definitions have changed.
1966
- const dataColumnsChanged = this._rowDefs.reduce(columnsDiffReducer, false);
1967
- if (dataColumnsChanged) {
1968
- this._forceRenderDataRows();
1969
- }
1970
- // Force re-render header/footer rows if the list of column definitions have changed.
1971
- const headerColumnsChanged = this._headerRowDefs.reduce(columnsDiffReducer, false);
1972
- if (headerColumnsChanged) {
1973
- this._forceRenderHeaderRows();
1974
- }
1975
- const footerColumnsChanged = this._footerRowDefs.reduce(columnsDiffReducer, false);
1976
- if (footerColumnsChanged) {
1977
- this._forceRenderFooterRows();
1978
- }
1979
- return dataColumnsChanged || headerColumnsChanged || footerColumnsChanged;
1980
- }
1981
- /**
1982
- * Switch to the provided data source by resetting the data and unsubscribing from the current
1983
- * render change subscription if one exists. If the data source is null, interpret this by
1984
- * clearing the row outlet. Otherwise start listening for new data.
1985
- */
1986
- _switchDataSource(dataSource) {
1987
- this._data = [];
1988
- if (isDataSource(this.dataSource)) {
1989
- this.dataSource.disconnect(this);
1990
- }
1991
- // Stop listening for data from the previous data source.
1992
- if (this._renderChangeSubscription) {
1993
- this._renderChangeSubscription.unsubscribe();
1994
- this._renderChangeSubscription = null;
1995
- }
1996
- if (!dataSource) {
1997
- if (this._dataDiffer) {
1998
- this._dataDiffer.diff([]);
1999
- }
2000
- if (this._rowOutlet) {
2001
- this._rowOutlet.viewContainer.clear();
2002
- }
2003
- }
2004
- this._dataSource = dataSource;
2005
- }
2006
- /** Set up a subscription for the data provided by the data source. */
2007
- _observeRenderChanges() {
2008
- // If no data source has been set, there is nothing to observe for changes.
2009
- if (!this.dataSource) {
2010
- return;
2011
- }
2012
- let dataStream;
2013
- if (isDataSource(this.dataSource)) {
2014
- dataStream = this.dataSource.connect(this);
2015
- }
2016
- else if (isObservable(this.dataSource)) {
2017
- dataStream = this.dataSource;
2018
- }
2019
- else if (Array.isArray(this.dataSource)) {
2020
- dataStream = of(this.dataSource);
2021
- }
2022
- if (dataStream === undefined && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2023
- throw getTableUnknownDataSourceError();
2024
- }
2025
- this._renderChangeSubscription = dataStream
2026
- .pipe(takeUntil(this._onDestroy))
2027
- .subscribe(data => {
2028
- this._data = data || [];
2029
- this.renderRows();
2030
- });
2031
- }
2032
- /**
2033
- * Clears any existing content in the header row outlet and creates a new embedded view
2034
- * in the outlet using the header row definition.
2035
- */
2036
- _forceRenderHeaderRows() {
2037
- // Clear the header row outlet if any content exists.
2038
- if (this._headerRowOutlet.viewContainer.length > 0) {
2039
- this._headerRowOutlet.viewContainer.clear();
2040
- }
2041
- this._headerRowDefs.forEach((def, i) => this._renderRow(this._headerRowOutlet, def, i));
2042
- this.updateStickyHeaderRowStyles();
2043
- }
2044
- /**
2045
- * Clears any existing content in the footer row outlet and creates a new embedded view
2046
- * in the outlet using the footer row definition.
2047
- */
2048
- _forceRenderFooterRows() {
2049
- // Clear the footer row outlet if any content exists.
2050
- if (this._footerRowOutlet.viewContainer.length > 0) {
2051
- this._footerRowOutlet.viewContainer.clear();
2052
- }
2053
- this._footerRowDefs.forEach((def, i) => this._renderRow(this._footerRowOutlet, def, i));
2054
- this.updateStickyFooterRowStyles();
2055
- }
2056
- /** Adds the sticky column styles for the rows according to the columns' stick states. */
2057
- _addStickyColumnStyles(rows, rowDef) {
2058
- const columnDefs = Array.from(rowDef?.columns || []).map(columnName => {
2059
- const columnDef = this._columnDefsByName.get(columnName);
2060
- if (!columnDef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2061
- throw getTableUnknownColumnError(columnName);
2062
- }
2063
- return columnDef;
2064
- });
2065
- const stickyStartStates = columnDefs.map(columnDef => columnDef.sticky);
2066
- const stickyEndStates = columnDefs.map(columnDef => columnDef.stickyEnd);
2067
- this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates, !this._fixedLayout || this._forceRecalculateCellWidths);
2068
- }
2069
- /** Gets the list of rows that have been rendered in the row outlet. */
2070
- _getRenderedRows(rowOutlet) {
2071
- const renderedRows = [];
2072
- for (let i = 0; i < rowOutlet.viewContainer.length; i++) {
2073
- const viewRef = rowOutlet.viewContainer.get(i);
2074
- renderedRows.push(viewRef.rootNodes[0]);
2075
- }
2076
- return renderedRows;
2077
- }
2078
- /**
2079
- * Get the matching row definitions that should be used for this row data. If there is only
2080
- * one row definition, it is returned. Otherwise, find the row definitions that has a when
2081
- * predicate that returns true with the data. If none return true, return the default row
2082
- * definition.
2083
- */
2084
- _getRowDefs(data, dataIndex) {
2085
- if (this._rowDefs.length == 1) {
2086
- return [this._rowDefs[0]];
2087
- }
2088
- let rowDefs = [];
2089
- if (this.multiTemplateDataRows) {
2090
- rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data));
2091
- }
2092
- else {
2093
- let rowDef = this._rowDefs.find(def => def.when && def.when(dataIndex, data)) || this._defaultRowDef;
2094
- if (rowDef) {
2095
- rowDefs.push(rowDef);
2096
- }
2097
- }
2098
- if (!rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2099
- throw getTableMissingMatchingRowDefError(data);
2100
- }
2101
- return rowDefs;
2102
- }
2103
- _getEmbeddedViewArgs(renderRow, index) {
2104
- const rowDef = renderRow.rowDef;
2105
- const context = { $implicit: renderRow.data };
2106
- return {
2107
- templateRef: rowDef.template,
2108
- context,
2109
- index,
2110
- };
2111
- }
2112
- /**
2113
- * Creates a new row template in the outlet and fills it with the set of cell templates.
2114
- * Optionally takes a context to provide to the row and cells, as well as an optional index
2115
- * of where to place the new row template in the outlet.
2116
- */
2117
- _renderRow(outlet, rowDef, index, context = {}) {
2118
- // TODO(andrewseguin): enforce that one outlet was instantiated from createEmbeddedView
2119
- const view = outlet.viewContainer.createEmbeddedView(rowDef.template, context, index);
2120
- this._renderCellTemplateForItem(rowDef, context);
2121
- return view;
2122
- }
2123
- _renderCellTemplateForItem(rowDef, context) {
2124
- for (let cellTemplate of this._getCellTemplates(rowDef)) {
2125
- if (CdkCellOutlet.mostRecentCellOutlet) {
2126
- CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cellTemplate, context);
2127
- }
2128
- }
2129
- this._changeDetectorRef.markForCheck();
2130
- }
2131
- /**
2132
- * Updates the index-related context for each row to reflect any changes in the index of the rows,
2133
- * e.g. first/last/even/odd.
2134
- */
2135
- _updateRowIndexContext() {
2136
- const viewContainer = this._rowOutlet.viewContainer;
2137
- for (let renderIndex = 0, count = viewContainer.length; renderIndex < count; renderIndex++) {
2138
- const viewRef = viewContainer.get(renderIndex);
2139
- const context = viewRef.context;
2140
- context.count = count;
2141
- context.first = renderIndex === 0;
2142
- context.last = renderIndex === count - 1;
2143
- context.even = renderIndex % 2 === 0;
2144
- context.odd = !context.even;
2145
- if (this.multiTemplateDataRows) {
2146
- context.dataIndex = this._renderRows[renderIndex].dataIndex;
2147
- context.renderIndex = renderIndex;
2148
- }
2149
- else {
2150
- context.index = this._renderRows[renderIndex].dataIndex;
2151
- }
2152
- }
2153
- }
2154
- /** Gets the column definitions for the provided row def. */
2155
- _getCellTemplates(rowDef) {
2156
- if (!rowDef || !rowDef.columns) {
2157
- return [];
2158
- }
2159
- return Array.from(rowDef.columns, columnId => {
2160
- const column = this._columnDefsByName.get(columnId);
2161
- if (!column && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2162
- throw getTableUnknownColumnError(columnId);
2163
- }
2164
- return rowDef.extractCellTemplate(column);
2165
- });
2166
- }
2167
- /**
2168
- * Forces a re-render of the data rows. Should be called in cases where there has been an input
2169
- * change that affects the evaluation of which rows should be rendered, e.g. toggling
2170
- * `multiTemplateDataRows` or adding/removing row definitions.
2171
- */
2172
- _forceRenderDataRows() {
2173
- this._dataDiffer.diff([]);
2174
- this._rowOutlet.viewContainer.clear();
2175
- this.renderRows();
2176
- }
2177
- /**
2178
- * Checks if there has been a change in sticky states since last check and applies the correct
2179
- * sticky styles. Since checking resets the "dirty" state, this should only be performed once
2180
- * during a change detection and after the inputs are settled (after content check).
2181
- */
2182
- _checkStickyStates() {
2183
- const stickyCheckReducer = (acc, d) => {
2184
- return acc || d.hasStickyChanged();
2185
- };
2186
- // Note that the check needs to occur for every definition since it notifies the definition
2187
- // that it can reset its dirty state. Using another operator like `some` may short-circuit
2188
- // remaining definitions and leave them in an unchecked state.
2189
- if (this._headerRowDefs.reduce(stickyCheckReducer, false)) {
2190
- this.updateStickyHeaderRowStyles();
2191
- }
2192
- if (this._footerRowDefs.reduce(stickyCheckReducer, false)) {
2193
- this.updateStickyFooterRowStyles();
2194
- }
2195
- if (Array.from(this._columnDefsByName.values()).reduce(stickyCheckReducer, false)) {
2196
- this._stickyColumnStylesNeedReset = true;
2197
- this.updateStickyColumnStyles();
2198
- }
2199
- }
2200
- /**
2201
- * Creates the sticky styler that will be used for sticky rows and columns. Listens
2202
- * for directionality changes and provides the latest direction to the styler. Re-applies column
2203
- * stickiness when directionality changes.
2204
- */
2205
- _setupStickyStyler() {
2206
- const direction = this._dir ? this._dir.value : 'ltr';
2207
- this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, direction, this._coalescedStyleScheduler, this._platform.isBrowser, this.needsPositionStickyOnElement, this._stickyPositioningListener, this._injector);
2208
- (this._dir ? this._dir.change : of())
2209
- .pipe(takeUntil(this._onDestroy))
2210
- .subscribe(value => {
2211
- this._stickyStyler.direction = value;
2212
- this.updateStickyColumnStyles();
2213
- });
2214
- }
2215
- /** Filters definitions that belong to this table from a QueryList. */
2216
- _getOwnDefs(items) {
2217
- return items.filter(item => !item._table || item._table === this);
2218
- }
2219
- /** Creates or removes the no data row, depending on whether any data is being shown. */
2220
- _updateNoDataRow() {
2221
- const noDataRow = this._customNoDataRow || this._noDataRow;
2222
- if (!noDataRow) {
2223
- return;
2224
- }
2225
- const shouldShow = this._rowOutlet.viewContainer.length === 0;
2226
- if (shouldShow === this._isShowingNoDataRow) {
2227
- return;
2228
- }
2229
- const container = this._noDataRowOutlet.viewContainer;
2230
- if (shouldShow) {
2231
- const view = container.createEmbeddedView(noDataRow.templateRef);
2232
- const rootNode = view.rootNodes[0];
2233
- // Only add the attributes if we have a single root node since it's hard
2234
- // to figure out which one to add it to when there are multiple.
2235
- if (view.rootNodes.length === 1 && rootNode?.nodeType === this._document.ELEMENT_NODE) {
2236
- rootNode.setAttribute('role', 'row');
2237
- rootNode.classList.add(noDataRow._contentClassName);
2238
- }
2239
- }
2240
- else {
2241
- container.clear();
2242
- }
2243
- this._isShowingNoDataRow = shouldShow;
2244
- this._changeDetectorRef.markForCheck();
2245
- }
2246
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
2247
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: CdkTable, isStandalone: true, selector: "cdk-table, table[cdk-table]", inputs: { trackBy: "trackBy", dataSource: "dataSource", multiTemplateDataRows: ["multiTemplateDataRows", "multiTemplateDataRows", booleanAttribute], fixedLayout: ["fixedLayout", "fixedLayout", booleanAttribute] }, outputs: { contentChanged: "contentChanged" }, host: { properties: { "class.cdk-table-fixed-layout": "fixedLayout" }, classAttribute: "cdk-table" }, providers: [
2248
- { provide: CDK_TABLE, useExisting: CdkTable },
2249
- { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
2250
- { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
2251
- // Prevent nested tables from seeing this table's StickyPositioningListener.
2252
- { provide: STICKY_POSITIONING_LISTENER, useValue: null },
2253
- ], queries: [{ propertyName: "_noDataRow", first: true, predicate: CdkNoDataRow, descendants: true }, { propertyName: "_contentColumnDefs", predicate: CdkColumnDef, descendants: true }, { propertyName: "_contentRowDefs", predicate: CdkRowDef, descendants: true }, { propertyName: "_contentHeaderRowDefs", predicate: CdkHeaderRowDef, descendants: true }, { propertyName: "_contentFooterRowDefs", predicate: CdkFooterRowDef, descendants: true }], exportAs: ["cdkTable"], ngImport: i0, template: "\n <ng-content select=\"caption\"/>\n <ng-content select=\"colgroup, col\"/>\n\n <!--\n Unprojected content throws a hydration error so we need this to capture it.\n It gets removed on the client so it doesn't affect the layout.\n -->\n @if (_isServer) {\n <ng-content/>\n }\n\n @if (_isNativeHtmlTable) {\n <thead role=\"rowgroup\">\n <ng-container headerRowOutlet/>\n </thead>\n <tbody role=\"rowgroup\">\n <ng-container rowOutlet/>\n <ng-container noDataRowOutlet/>\n </tbody>\n <tfoot role=\"rowgroup\">\n <ng-container footerRowOutlet/>\n </tfoot>\n } @else {\n <ng-container headerRowOutlet/>\n <ng-container rowOutlet/>\n <ng-container noDataRowOutlet/>\n <ng-container footerRowOutlet/>\n }\n", isInline: true, styles: [".cdk-table-fixed-layout{table-layout:fixed}\n"], dependencies: [{ kind: "directive", type: HeaderRowOutlet, selector: "[headerRowOutlet]" }, { kind: "directive", type: DataRowOutlet, selector: "[rowOutlet]" }, { kind: "directive", type: NoDataRowOutlet, selector: "[noDataRowOutlet]" }, { kind: "directive", type: FooterRowOutlet, selector: "[footerRowOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
2254
- }
2255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkTable, decorators: [{
2256
- type: Component,
2257
- args: [{ selector: 'cdk-table, table[cdk-table]', exportAs: 'cdkTable', template: CDK_TABLE_TEMPLATE, host: {
2258
- 'class': 'cdk-table',
2259
- '[class.cdk-table-fixed-layout]': 'fixedLayout',
2260
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, providers: [
2261
- { provide: CDK_TABLE, useExisting: CdkTable },
2262
- { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
2263
- { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
2264
- // Prevent nested tables from seeing this table's StickyPositioningListener.
2265
- { provide: STICKY_POSITIONING_LISTENER, useValue: null },
2266
- ], imports: [HeaderRowOutlet, DataRowOutlet, NoDataRowOutlet, FooterRowOutlet], styles: [".cdk-table-fixed-layout{table-layout:fixed}\n"] }]
2267
- }], ctorParameters: () => [], propDecorators: { trackBy: [{
2268
- type: Input
2269
- }], dataSource: [{
2270
- type: Input
2271
- }], multiTemplateDataRows: [{
2272
- type: Input,
2273
- args: [{ transform: booleanAttribute }]
2274
- }], fixedLayout: [{
2275
- type: Input,
2276
- args: [{ transform: booleanAttribute }]
2277
- }], contentChanged: [{
2278
- type: Output
2279
- }], _contentColumnDefs: [{
2280
- type: ContentChildren,
2281
- args: [CdkColumnDef, { descendants: true }]
2282
- }], _contentRowDefs: [{
2283
- type: ContentChildren,
2284
- args: [CdkRowDef, { descendants: true }]
2285
- }], _contentHeaderRowDefs: [{
2286
- type: ContentChildren,
2287
- args: [CdkHeaderRowDef, {
2288
- descendants: true,
2289
- }]
2290
- }], _contentFooterRowDefs: [{
2291
- type: ContentChildren,
2292
- args: [CdkFooterRowDef, {
2293
- descendants: true,
2294
- }]
2295
- }], _noDataRow: [{
2296
- type: ContentChild,
2297
- args: [CdkNoDataRow]
2298
- }] } });
2299
- /** Utility function that gets a merged list of the entries in an array and values of a Set. */
2300
- function mergeArrayAndSet(array, set) {
2301
- return array.concat(Array.from(set));
2302
- }
2303
- /**
2304
- * Finds the closest table section to an outlet. We can't use `HTMLElement.closest` for this,
2305
- * because the node representing the outlet is a comment.
2306
- */
2307
- function closestTableSection(outlet, section) {
2308
- const uppercaseSection = section.toUpperCase();
2309
- let current = outlet.viewContainer.element.nativeElement;
2310
- while (current) {
2311
- // 1 is an element node.
2312
- const nodeName = current.nodeType === 1 ? current.nodeName : null;
2313
- if (nodeName === uppercaseSection) {
2314
- return current;
2315
- }
2316
- else if (nodeName === 'TABLE') {
2317
- // Stop traversing past the `table` node.
2318
- break;
2319
- }
2320
- current = current.parentNode;
2321
- }
2322
- return null;
2323
- }
2324
-
2325
- /**
2326
- * Column that simply shows text content for the header and row cells. Assumes that the table
2327
- * is using the native table implementation (`<table>`).
2328
- *
2329
- * By default, the name of this column will be the header text and data property accessor.
2330
- * The header text can be overridden with the `headerText` input. Cell values can be overridden with
2331
- * the `dataAccessor` input. Change the text justification to the start or end using the `justify`
2332
- * input.
2333
- */
2334
- class CdkTextColumn {
2335
- _table = inject(CdkTable, { optional: true });
2336
- _options = inject(TEXT_COLUMN_OPTIONS, { optional: true });
2337
- /** Column name that should be used to reference this column. */
2338
- get name() {
2339
- return this._name;
2340
- }
2341
- set name(name) {
2342
- this._name = name;
2343
- // With Ivy, inputs can be initialized before static query results are
2344
- // available. In that case, we defer the synchronization until "ngOnInit" fires.
2345
- this._syncColumnDefName();
2346
- }
2347
- _name;
2348
- /**
2349
- * Text label that should be used for the column header. If this property is not
2350
- * set, the header text will default to the column name with its first letter capitalized.
2351
- */
2352
- headerText;
2353
- /**
2354
- * Accessor function to retrieve the data rendered for each cell. If this
2355
- * property is not set, the data cells will render the value found in the data's property matching
2356
- * the column's name. For example, if the column is named `id`, then the rendered value will be
2357
- * value defined by the data's `id` property.
2358
- */
2359
- dataAccessor;
2360
- /** Alignment of the cell values. */
2361
- justify = 'start';
2362
- /** @docs-private */
2363
- columnDef;
2364
- /**
2365
- * The column cell is provided to the column during `ngOnInit` with a static query.
2366
- * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
2367
- * column definition was provided in the same view as the table, which is not the case with this
2368
- * component.
2369
- * @docs-private
2370
- */
2371
- cell;
2372
- /**
2373
- * The column headerCell is provided to the column during `ngOnInit` with a static query.
2374
- * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
2375
- * column definition was provided in the same view as the table, which is not the case with this
2376
- * component.
2377
- * @docs-private
2378
- */
2379
- headerCell;
2380
- constructor() {
2381
- this._options = this._options || {};
2382
- }
2383
- ngOnInit() {
2384
- this._syncColumnDefName();
2385
- if (this.headerText === undefined) {
2386
- this.headerText = this._createDefaultHeaderText();
2387
- }
2388
- if (!this.dataAccessor) {
2389
- this.dataAccessor =
2390
- this._options.defaultDataAccessor || ((data, name) => data[name]);
2391
- }
2392
- if (this._table) {
2393
- // Provide the cell and headerCell directly to the table with the static `ViewChild` query,
2394
- // since the columnDef will not pick up its content by the time the table finishes checking
2395
- // its content and initializing the rows.
2396
- this.columnDef.cell = this.cell;
2397
- this.columnDef.headerCell = this.headerCell;
2398
- this._table.addColumnDef(this.columnDef);
2399
- }
2400
- else if (typeof ngDevMode === 'undefined' || ngDevMode) {
2401
- throw getTableTextColumnMissingParentTableError();
2402
- }
2403
- }
2404
- ngOnDestroy() {
2405
- if (this._table) {
2406
- this._table.removeColumnDef(this.columnDef);
2407
- }
2408
- }
2409
- /**
2410
- * Creates a default header text. Use the options' header text transformation function if one
2411
- * has been provided. Otherwise simply capitalize the column name.
2412
- */
2413
- _createDefaultHeaderText() {
2414
- const name = this.name;
2415
- if (!name && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2416
- throw getTableTextColumnMissingNameError();
2417
- }
2418
- if (this._options && this._options.defaultHeaderTextTransform) {
2419
- return this._options.defaultHeaderTextTransform(name);
2420
- }
2421
- return name[0].toUpperCase() + name.slice(1);
2422
- }
2423
- /** Synchronizes the column definition name with the text column name. */
2424
- _syncColumnDefName() {
2425
- if (this.columnDef) {
2426
- this.columnDef.name = this.name;
2427
- }
2428
- }
2429
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkTextColumn, deps: [], target: i0.ɵɵFactoryTarget.Component });
2430
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: CdkTextColumn, isStandalone: true, selector: "cdk-text-column", inputs: { name: "name", headerText: "headerText", dataAccessor: "dataAccessor", justify: "justify" }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: CdkColumnDef, descendants: true, static: true }, { propertyName: "cell", first: true, predicate: CdkCellDef, descendants: true, static: true }, { propertyName: "headerCell", first: true, predicate: CdkHeaderCellDef, descendants: true, static: true }], ngImport: i0, template: `
2431
- <ng-container cdkColumnDef>
2432
- <th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">
2433
- {{headerText}}
2434
- </th>
2435
- <td cdk-cell *cdkCellDef="let data" [style.text-align]="justify">
2436
- {{dataAccessor(data, name)}}
2437
- </td>
2438
- </ng-container>
2439
- `, isInline: true, dependencies: [{ kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: CdkCell, selector: "cdk-cell, td[cdk-cell]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
2440
- }
2441
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkTextColumn, decorators: [{
2442
- type: Component,
2443
- args: [{
2444
- selector: 'cdk-text-column',
2445
- template: `
2446
- <ng-container cdkColumnDef>
2447
- <th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">
2448
- {{headerText}}
2449
- </th>
2450
- <td cdk-cell *cdkCellDef="let data" [style.text-align]="justify">
2451
- {{dataAccessor(data, name)}}
2452
- </td>
2453
- </ng-container>
2454
- `,
2455
- encapsulation: ViewEncapsulation.None,
2456
- // Change detection is intentionally not set to OnPush. This component's template will be provided
2457
- // to the table to be inserted into its view. This is problematic when change detection runs since
2458
- // the bindings in this template will be evaluated _after_ the table's view is evaluated, which
2459
- // mean's the template in the table's view will not have the updated value (and in fact will cause
2460
- // an ExpressionChangedAfterItHasBeenCheckedError).
2461
- // tslint:disable-next-line:validate-decorators
2462
- changeDetection: ChangeDetectionStrategy.Default,
2463
- imports: [CdkColumnDef, CdkHeaderCellDef, CdkHeaderCell, CdkCellDef, CdkCell],
2464
- }]
2465
- }], ctorParameters: () => [], propDecorators: { name: [{
2466
- type: Input
2467
- }], headerText: [{
2468
- type: Input
2469
- }], dataAccessor: [{
2470
- type: Input
2471
- }], justify: [{
2472
- type: Input
2473
- }], columnDef: [{
2474
- type: ViewChild,
2475
- args: [CdkColumnDef, { static: true }]
2476
- }], cell: [{
2477
- type: ViewChild,
2478
- args: [CdkCellDef, { static: true }]
2479
- }], headerCell: [{
2480
- type: ViewChild,
2481
- args: [CdkHeaderCellDef, { static: true }]
2482
- }] } });
2483
-
2484
- const EXPORTED_DECLARATIONS = [
2485
- CdkTable,
2486
- CdkRowDef,
2487
- CdkCellDef,
2488
- CdkCellOutlet,
2489
- CdkHeaderCellDef,
2490
- CdkFooterCellDef,
2491
- CdkColumnDef,
2492
- CdkCell,
2493
- CdkRow,
2494
- CdkHeaderCell,
2495
- CdkFooterCell,
2496
- CdkHeaderRow,
2497
- CdkHeaderRowDef,
2498
- CdkFooterRow,
2499
- CdkFooterRowDef,
2500
- DataRowOutlet,
2501
- HeaderRowOutlet,
2502
- FooterRowOutlet,
2503
- CdkTextColumn,
2504
- CdkNoDataRow,
2505
- CdkRecycleRows,
2506
- NoDataRowOutlet,
2507
- ];
2508
- class CdkTableModule {
2509
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2510
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.6", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule, CdkTable,
2511
- CdkRowDef,
2512
- CdkCellDef,
2513
- CdkCellOutlet,
2514
- CdkHeaderCellDef,
2515
- CdkFooterCellDef,
2516
- CdkColumnDef,
2517
- CdkCell,
2518
- CdkRow,
2519
- CdkHeaderCell,
2520
- CdkFooterCell,
2521
- CdkHeaderRow,
2522
- CdkHeaderRowDef,
2523
- CdkFooterRow,
2524
- CdkFooterRowDef,
2525
- DataRowOutlet,
2526
- HeaderRowOutlet,
2527
- FooterRowOutlet,
2528
- CdkTextColumn,
2529
- CdkNoDataRow,
2530
- CdkRecycleRows,
2531
- NoDataRowOutlet], exports: [CdkTable,
2532
- CdkRowDef,
2533
- CdkCellDef,
2534
- CdkCellOutlet,
2535
- CdkHeaderCellDef,
2536
- CdkFooterCellDef,
2537
- CdkColumnDef,
2538
- CdkCell,
2539
- CdkRow,
2540
- CdkHeaderCell,
2541
- CdkFooterCell,
2542
- CdkHeaderRow,
2543
- CdkHeaderRowDef,
2544
- CdkFooterRow,
2545
- CdkFooterRowDef,
2546
- DataRowOutlet,
2547
- HeaderRowOutlet,
2548
- FooterRowOutlet,
2549
- CdkTextColumn,
2550
- CdkNoDataRow,
2551
- CdkRecycleRows,
2552
- NoDataRowOutlet] });
2553
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule] });
2554
- }
2555
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkTableModule, decorators: [{
2556
- type: NgModule,
2557
- args: [{
2558
- exports: EXPORTED_DECLARATIONS,
2559
- imports: [ScrollingModule, ...EXPORTED_DECLARATIONS],
2560
- }]
2561
- }] });
2562
-
2563
- /**
2564
- * Mixin to provide a directive with a function that checks if the sticky input has been
2565
- * changed since the last time the function was called. Essentially adds a dirty-check to the
2566
- * sticky value.
2567
- * @docs-private
2568
- * @deprecated Implement the `CanStick` interface instead.
2569
- * @breaking-change 19.0.0
2570
- */
2571
- function mixinHasStickyInput(base) {
2572
- return class extends base {
2573
- /** Whether sticky positioning should be applied. */
2574
- get sticky() {
2575
- return this._sticky;
2576
- }
2577
- set sticky(v) {
2578
- const prevValue = this._sticky;
2579
- this._sticky = coerceBooleanProperty(v);
2580
- this._hasStickyChanged = prevValue !== this._sticky;
2581
- }
2582
- _sticky = false;
2583
- /** Whether the sticky input has changed since it was last checked. */
2584
- _hasStickyChanged = false;
2585
- /** Whether the sticky value has changed since this was last called. */
2586
- hasStickyChanged() {
2587
- const hasStickyChanged = this._hasStickyChanged;
2588
- this._hasStickyChanged = false;
2589
- return hasStickyChanged;
2590
- }
2591
- /** Resets the dirty check for cases where the sticky state has been used without checking. */
2592
- resetStickyChanged() {
2593
- this._hasStickyChanged = false;
2594
- }
2595
- constructor(...args) {
2596
- super(...args);
2597
- }
2598
- };
2599
- }
2600
-
2601
- export { BaseCdkCell, BaseRowDef, CDK_ROW_TEMPLATE, CDK_TABLE, CDK_TABLE_TEMPLATE, CdkCell, CdkCellDef, CdkCellOutlet, CdkColumnDef, CdkFooterCell, CdkFooterCellDef, CdkFooterRow, CdkFooterRowDef, CdkHeaderCell, CdkHeaderCellDef, CdkHeaderRow, CdkHeaderRowDef, CdkNoDataRow, CdkRecycleRows, CdkRow, CdkRowDef, CdkTable, CdkTableModule, CdkTextColumn, DataRowOutlet, FooterRowOutlet, HeaderRowOutlet, NoDataRowOutlet, STICKY_DIRECTIONS, STICKY_POSITIONING_LISTENER, StickyStyler, TEXT_COLUMN_OPTIONS, _COALESCED_STYLE_SCHEDULER, _CoalescedStyleScheduler, _Schedule, mixinHasStickyInput };
2602
- //# sourceMappingURL=table.mjs.map