@covalent/core 3.1.0 → 3.1.2-beta.6

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 (639) hide show
  1. package/breadcrumbs/covalent-core-breadcrumbs.metadata.json +1 -1
  2. package/breadcrumbs/package.json +1 -3
  3. package/bundles/covalent-core-breadcrumbs.umd.js +131 -167
  4. package/bundles/covalent-core-breadcrumbs.umd.js.map +1 -1
  5. package/bundles/covalent-core-breadcrumbs.umd.min.js +1 -1
  6. package/bundles/covalent-core-breadcrumbs.umd.min.js.map +1 -1
  7. package/bundles/covalent-core-chips.umd.js +533 -708
  8. package/bundles/covalent-core-chips.umd.js.map +1 -1
  9. package/bundles/covalent-core-chips.umd.min.js +12 -12
  10. package/bundles/covalent-core-chips.umd.min.js.map +1 -1
  11. package/bundles/covalent-core-common.umd.js +566 -571
  12. package/bundles/covalent-core-common.umd.js.map +1 -1
  13. package/bundles/covalent-core-common.umd.min.js +13 -12
  14. package/bundles/covalent-core-common.umd.min.js.map +1 -1
  15. package/bundles/covalent-core-data-table.umd.js +727 -1038
  16. package/bundles/covalent-core-data-table.umd.js.map +1 -1
  17. package/bundles/covalent-core-data-table.umd.min.js +12 -12
  18. package/bundles/covalent-core-data-table.umd.min.js.map +1 -1
  19. package/bundles/covalent-core-dialogs.umd.js +515 -592
  20. package/bundles/covalent-core-dialogs.umd.js.map +1 -1
  21. package/bundles/covalent-core-dialogs.umd.min.js +1 -15
  22. package/bundles/covalent-core-dialogs.umd.min.js.map +1 -1
  23. package/bundles/covalent-core-dynamic-menu.umd.js +73 -62
  24. package/bundles/covalent-core-dynamic-menu.umd.js.map +1 -1
  25. package/bundles/covalent-core-dynamic-menu.umd.min.js +1 -1
  26. package/bundles/covalent-core-dynamic-menu.umd.min.js.map +1 -1
  27. package/bundles/covalent-core-expansion-panel.umd.js +465 -449
  28. package/bundles/covalent-core-expansion-panel.umd.js.map +1 -1
  29. package/bundles/covalent-core-expansion-panel.umd.min.js +12 -12
  30. package/bundles/covalent-core-expansion-panel.umd.min.js.map +1 -1
  31. package/bundles/covalent-core-file.umd.js +533 -598
  32. package/bundles/covalent-core-file.umd.js.map +1 -1
  33. package/bundles/covalent-core-file.umd.min.js +13 -12
  34. package/bundles/covalent-core-file.umd.min.js.map +1 -1
  35. package/bundles/covalent-core-json-formatter.umd.js +101 -152
  36. package/bundles/covalent-core-json-formatter.umd.js.map +1 -1
  37. package/bundles/covalent-core-json-formatter.umd.min.js +1 -1
  38. package/bundles/covalent-core-json-formatter.umd.min.js.map +1 -1
  39. package/bundles/covalent-core-layout.umd.js +845 -883
  40. package/bundles/covalent-core-layout.umd.js.map +1 -1
  41. package/bundles/covalent-core-layout.umd.min.js +13 -12
  42. package/bundles/covalent-core-layout.umd.min.js.map +1 -1
  43. package/bundles/covalent-core-loading.umd.js +481 -723
  44. package/bundles/covalent-core-loading.umd.js.map +1 -1
  45. package/bundles/covalent-core-loading.umd.min.js +12 -12
  46. package/bundles/covalent-core-loading.umd.min.js.map +1 -1
  47. package/bundles/covalent-core-media.umd.js +395 -375
  48. package/bundles/covalent-core-media.umd.js.map +1 -1
  49. package/bundles/covalent-core-media.umd.min.js +12 -12
  50. package/bundles/covalent-core-media.umd.min.js.map +1 -1
  51. package/bundles/covalent-core-menu.umd.js +37 -17
  52. package/bundles/covalent-core-menu.umd.js.map +1 -1
  53. package/bundles/covalent-core-menu.umd.min.js +1 -1
  54. package/bundles/covalent-core-menu.umd.min.js.map +1 -1
  55. package/bundles/covalent-core-message.umd.js +96 -152
  56. package/bundles/covalent-core-message.umd.js.map +1 -1
  57. package/bundles/covalent-core-message.umd.min.js +1 -1
  58. package/bundles/covalent-core-message.umd.min.js.map +1 -1
  59. package/bundles/covalent-core-nav-links.umd.js +63 -75
  60. package/bundles/covalent-core-nav-links.umd.js.map +1 -1
  61. package/bundles/covalent-core-nav-links.umd.min.js +1 -1
  62. package/bundles/covalent-core-nav-links.umd.min.js.map +1 -1
  63. package/bundles/covalent-core-notifications.umd.js +77 -101
  64. package/bundles/covalent-core-notifications.umd.js.map +1 -1
  65. package/bundles/covalent-core-notifications.umd.min.js +1 -1
  66. package/bundles/covalent-core-notifications.umd.min.js.map +1 -1
  67. package/bundles/covalent-core-paging.umd.js +89 -166
  68. package/bundles/covalent-core-paging.umd.js.map +1 -1
  69. package/bundles/covalent-core-paging.umd.min.js +1 -1
  70. package/bundles/covalent-core-paging.umd.min.js.map +1 -1
  71. package/bundles/covalent-core-search.umd.js +469 -418
  72. package/bundles/covalent-core-search.umd.js.map +1 -1
  73. package/bundles/covalent-core-search.umd.min.js +12 -12
  74. package/bundles/covalent-core-search.umd.min.js.map +1 -1
  75. package/bundles/covalent-core-sidesheet.umd.js +72 -52
  76. package/bundles/covalent-core-sidesheet.umd.js.map +1 -1
  77. package/bundles/covalent-core-sidesheet.umd.min.js +1 -1
  78. package/bundles/covalent-core-sidesheet.umd.min.js.map +1 -1
  79. package/bundles/covalent-core-steps.umd.js +663 -822
  80. package/bundles/covalent-core-steps.umd.js.map +1 -1
  81. package/bundles/covalent-core-steps.umd.min.js +12 -12
  82. package/bundles/covalent-core-steps.umd.min.js.map +1 -1
  83. package/bundles/covalent-core-tab-select.umd.js +446 -385
  84. package/bundles/covalent-core-tab-select.umd.js.map +1 -1
  85. package/bundles/covalent-core-tab-select.umd.min.js +12 -12
  86. package/bundles/covalent-core-tab-select.umd.min.js.map +1 -1
  87. package/bundles/covalent-core-user-profile.umd.js +65 -48
  88. package/bundles/covalent-core-user-profile.umd.js.map +1 -1
  89. package/bundles/covalent-core-user-profile.umd.min.js +1 -1
  90. package/bundles/covalent-core-user-profile.umd.min.js.map +1 -1
  91. package/bundles/covalent-core-virtual-scroll.umd.js +412 -356
  92. package/bundles/covalent-core-virtual-scroll.umd.js.map +1 -1
  93. package/bundles/covalent-core-virtual-scroll.umd.min.js +12 -12
  94. package/bundles/covalent-core-virtual-scroll.umd.min.js.map +1 -1
  95. package/bundles/covalent-core.umd.js +0 -8
  96. package/bundles/covalent-core.umd.js.map +1 -1
  97. package/chips/covalent-core-chips.metadata.json +1 -1
  98. package/chips/package.json +1 -3
  99. package/common/_common-theme.scss +11 -0
  100. package/common/package.json +1 -3
  101. package/data-table/covalent-core-data-table.metadata.json +1 -1
  102. package/data-table/package.json +1 -3
  103. package/dialogs/_dialog-theme.scss +6 -0
  104. package/dialogs/covalent-core-dialogs.metadata.json +1 -1
  105. package/dialogs/package.json +1 -3
  106. package/dialogs/window-dialog/window-dialog.component.scss +4 -0
  107. package/dynamic-menu/covalent-core-dynamic-menu.metadata.json +1 -1
  108. package/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.scss +0 -4
  109. package/dynamic-menu/package.json +1 -3
  110. package/esm2015/breadcrumbs/breadcrumb/breadcrumb.component.js +4 -3
  111. package/esm2015/breadcrumbs/breadcrumbs.component.js +3 -2
  112. package/esm2015/breadcrumbs/breadcrumbs.module.js +3 -2
  113. package/esm2015/breadcrumbs/covalent-core-breadcrumbs.js +3 -2
  114. package/esm2015/breadcrumbs/index.js +3 -2
  115. package/esm2015/breadcrumbs/public-api.js +3 -2
  116. package/esm2015/chips/chips.component.js +4 -3
  117. package/esm2015/chips/chips.module.js +3 -2
  118. package/esm2015/chips/covalent-core-chips.js +3 -2
  119. package/esm2015/chips/index.js +3 -2
  120. package/esm2015/chips/public-api.js +3 -2
  121. package/esm2015/common/animations/bounce/bounce.animation.js +3 -2
  122. package/esm2015/common/animations/collapse/collapse.animation.js +3 -2
  123. package/esm2015/common/animations/common/interfaces.js +3 -2
  124. package/esm2015/common/animations/fade/fadeInOut.animation.js +3 -2
  125. package/esm2015/common/animations/flash/flash.animation.js +3 -2
  126. package/esm2015/common/animations/headshake/headshake.animation.js +3 -2
  127. package/esm2015/common/animations/jello/jello.animation.js +3 -2
  128. package/esm2015/common/animations/pulse/pulse.animation.js +3 -2
  129. package/esm2015/common/animations/rotate/rotate.animation.js +3 -2
  130. package/esm2015/common/behaviors/control-value-accesor.mixin.js +3 -2
  131. package/esm2015/common/behaviors/disable-ripple.mixin.js +3 -2
  132. package/esm2015/common/behaviors/disabled.mixin.js +3 -2
  133. package/esm2015/common/common.module.js +3 -2
  134. package/esm2015/common/covalent-core-common.js +3 -2
  135. package/esm2015/common/directives/fullscreen/fullscreen.directive.js +3 -2
  136. package/esm2015/common/forms/auto-trim/auto-trim.directive.js +3 -2
  137. package/esm2015/common/forms/validators/validators.js +3 -2
  138. package/esm2015/common/functions/clipboard.js +3 -2
  139. package/esm2015/common/functions/convert.js +3 -2
  140. package/esm2015/common/functions/download.js +3 -2
  141. package/esm2015/common/functions/file.js +3 -2
  142. package/esm2015/common/index.js +3 -2
  143. package/esm2015/common/pipes/bytes/bytes.pipe.js +3 -2
  144. package/esm2015/common/pipes/decimal-bytes/decimal-bytes.pipe.js +3 -2
  145. package/esm2015/common/pipes/digits/digits.pipe.js +3 -2
  146. package/esm2015/common/pipes/time-ago/time-ago.pipe.js +3 -2
  147. package/esm2015/common/pipes/time-difference/time-difference.pipe.js +3 -2
  148. package/esm2015/common/pipes/time-until/time-until.pipe.js +3 -2
  149. package/esm2015/common/pipes/truncate/truncate.pipe.js +3 -2
  150. package/esm2015/common/public-api.js +3 -2
  151. package/esm2015/common/services/icon.service.js +3 -2
  152. package/esm2015/common/services/router-path.service.js +3 -2
  153. package/esm2015/covalent-core.js +3 -2
  154. package/esm2015/data-table/covalent-core-data-table.js +3 -2
  155. package/esm2015/data-table/data-table-cell/data-table-cell.component.js +4 -3
  156. package/esm2015/data-table/data-table-column/data-table-column.component.js +4 -3
  157. package/esm2015/data-table/data-table-row/data-table-row.component.js +3 -2
  158. package/esm2015/data-table/data-table-table/data-table-table.component.js +4 -3
  159. package/esm2015/data-table/data-table.component.js +6 -5
  160. package/esm2015/data-table/data-table.module.js +3 -2
  161. package/esm2015/data-table/directives/data-table-template.directive.js +3 -2
  162. package/esm2015/data-table/index.js +3 -2
  163. package/esm2015/data-table/public-api.js +3 -2
  164. package/esm2015/data-table/services/data-table.service.js +3 -2
  165. package/esm2015/dialogs/alert-dialog/alert-dialog.component.js +3 -2
  166. package/esm2015/dialogs/confirm-dialog/confirm-dialog.component.js +3 -2
  167. package/esm2015/dialogs/covalent-core-dialogs.js +3 -2
  168. package/esm2015/dialogs/dialog.component.js +4 -3
  169. package/esm2015/dialogs/dialogs.module.js +3 -2
  170. package/esm2015/dialogs/index.js +3 -2
  171. package/esm2015/dialogs/prompt-dialog/prompt-dialog.component.js +4 -3
  172. package/esm2015/dialogs/public-api.js +3 -2
  173. package/esm2015/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.js +14 -13
  174. package/esm2015/dialogs/services/dialog.service.js +3 -2
  175. package/esm2015/dialogs/window-dialog/window-dialog.component.js +4 -3
  176. package/esm2015/dynamic-menu/covalent-core-dynamic-menu.js +3 -2
  177. package/esm2015/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.js +5 -4
  178. package/esm2015/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.js +4 -3
  179. package/esm2015/dynamic-menu/dynamic-menu.component.js +3 -2
  180. package/esm2015/dynamic-menu/dynamic-menu.module.js +3 -2
  181. package/esm2015/dynamic-menu/index.js +3 -2
  182. package/esm2015/dynamic-menu/public_api.js +3 -2
  183. package/esm2015/expansion-panel/covalent-core-expansion-panel.js +3 -2
  184. package/esm2015/expansion-panel/expansion-panel-group.component.js +3 -2
  185. package/esm2015/expansion-panel/expansion-panel.component.js +4 -3
  186. package/esm2015/expansion-panel/expansion-panel.module.js +3 -2
  187. package/esm2015/expansion-panel/index.js +3 -2
  188. package/esm2015/expansion-panel/public-api.js +3 -2
  189. package/esm2015/file/covalent-core-file.js +3 -2
  190. package/esm2015/file/directives/file-drop.directive.js +3 -2
  191. package/esm2015/file/directives/file-select.directive.js +3 -2
  192. package/esm2015/file/file-input/file-input.component.js +3 -2
  193. package/esm2015/file/file-upload/file-upload.component.js +4 -3
  194. package/esm2015/file/file.module.js +3 -2
  195. package/esm2015/file/index.js +3 -2
  196. package/esm2015/file/public-api.js +3 -2
  197. package/esm2015/file/services/file.service.js +3 -2
  198. package/esm2015/index.js +4 -2
  199. package/esm2015/json-formatter/covalent-core-json-formatter.js +3 -2
  200. package/esm2015/json-formatter/index.js +3 -2
  201. package/esm2015/json-formatter/json-formatter.component.js +4 -3
  202. package/esm2015/json-formatter/json-formatter.module.js +3 -2
  203. package/esm2015/json-formatter/public-api.js +3 -2
  204. package/esm2015/layout/covalent-core-layout.js +4 -3
  205. package/esm2015/layout/index.js +4 -3
  206. package/esm2015/layout/layout-card-over/layout-card-over.component.js +4 -3
  207. package/esm2015/layout/layout-footer/layout-footer.component.js +3 -2
  208. package/esm2015/layout/layout-manage-list/layout-manage-list.component.js +4 -3
  209. package/esm2015/layout/layout-manage-list/layout-manage-list.directives.js +7 -6
  210. package/esm2015/layout/layout-nav/layout-nav.component.js +4 -3
  211. package/esm2015/layout/layout-nav-list/layout-nav-list.component.js +4 -3
  212. package/esm2015/layout/layout-nav-list/layout-nav-list.directives.js +7 -6
  213. package/esm2015/layout/layout-toggle.class.js +22 -12
  214. package/esm2015/layout/layout.component.js +4 -3
  215. package/esm2015/layout/layout.directives.js +7 -6
  216. package/esm2015/layout/layout.module.js +3 -2
  217. package/esm2015/layout/navigation-drawer/navigation-drawer.component.js +4 -3
  218. package/esm2015/layout/public-api.js +4 -3
  219. package/esm2015/loading/covalent-core-loading.js +3 -2
  220. package/esm2015/loading/directives/loading.directive.js +3 -2
  221. package/esm2015/loading/index.js +3 -2
  222. package/esm2015/loading/loading.component.js +13 -12
  223. package/esm2015/loading/loading.module.js +3 -2
  224. package/esm2015/loading/public-api.js +3 -2
  225. package/esm2015/loading/services/loading.factory.js +3 -2
  226. package/esm2015/loading/services/loading.service.js +3 -2
  227. package/esm2015/media/covalent-core-media.js +3 -2
  228. package/esm2015/media/directives/media-toggle.directive.js +3 -2
  229. package/esm2015/media/index.js +3 -2
  230. package/esm2015/media/media.module.js +3 -2
  231. package/esm2015/media/public-api.js +3 -2
  232. package/esm2015/media/services/media.service.js +3 -2
  233. package/esm2015/menu/covalent-core-menu.js +3 -2
  234. package/esm2015/menu/index.js +3 -2
  235. package/esm2015/menu/menu.component.js +4 -3
  236. package/esm2015/menu/menu.module.js +3 -2
  237. package/esm2015/menu/public-api.js +3 -2
  238. package/esm2015/message/covalent-core-message.js +3 -2
  239. package/esm2015/message/index.js +3 -2
  240. package/esm2015/message/message.component.js +4 -3
  241. package/esm2015/message/message.module.js +3 -2
  242. package/esm2015/message/public-api.js +3 -2
  243. package/esm2015/nav-links/covalent-core-nav-links.js +3 -2
  244. package/esm2015/nav-links/index.js +3 -2
  245. package/esm2015/nav-links/nav-links.component.js +3 -2
  246. package/esm2015/nav-links/nav-links.module.js +3 -2
  247. package/esm2015/nav-links/public-api.js +3 -2
  248. package/esm2015/notifications/covalent-core-notifications.js +3 -2
  249. package/esm2015/notifications/index.js +3 -2
  250. package/esm2015/notifications/notification-count.component.js +10 -9
  251. package/esm2015/notifications/notifications.module.js +3 -2
  252. package/esm2015/notifications/public-api.js +3 -2
  253. package/esm2015/paging/covalent-core-paging.js +3 -2
  254. package/esm2015/paging/index.js +3 -2
  255. package/esm2015/paging/paging-bar.component.js +4 -3
  256. package/esm2015/paging/paging.module.js +3 -2
  257. package/esm2015/paging/public-api.js +3 -2
  258. package/esm2015/search/covalent-core-search.js +3 -2
  259. package/esm2015/search/index.js +3 -2
  260. package/esm2015/search/public-api.js +3 -2
  261. package/esm2015/search/search-box/search-box.component.js +4 -3
  262. package/esm2015/search/search-input/search-input.component.js +4 -3
  263. package/esm2015/search/search.module.js +3 -2
  264. package/esm2015/sidesheet/covalent-core-sidesheet.js +3 -2
  265. package/esm2015/sidesheet/index.js +3 -2
  266. package/esm2015/sidesheet/public-api.js +3 -2
  267. package/esm2015/sidesheet/sidesheet.component.js +4 -3
  268. package/esm2015/sidesheet/sidesheet.module.js +3 -2
  269. package/esm2015/steps/covalent-core-steps.js +3 -2
  270. package/esm2015/steps/index.js +3 -2
  271. package/esm2015/steps/nav/nav-step-link/nav-step-link.component.js +4 -3
  272. package/esm2015/steps/nav/nav-steps-horizontal/nav-steps-horizontal.component.js +4 -3
  273. package/esm2015/steps/nav/nav-steps-vertical/nav-steps-vertical.component.js +4 -3
  274. package/esm2015/steps/public-api.js +3 -2
  275. package/esm2015/steps/step-body/step-body.component.js +4 -3
  276. package/esm2015/steps/step-header/step-header.component.js +4 -3
  277. package/esm2015/steps/step.component.js +6 -5
  278. package/esm2015/steps/steps.component.js +6 -5
  279. package/esm2015/steps/steps.module.js +3 -2
  280. package/esm2015/tab-select/covalent-core-tab-select.js +3 -2
  281. package/esm2015/tab-select/index.js +3 -2
  282. package/esm2015/tab-select/public-api.js +3 -2
  283. package/esm2015/tab-select/tab-option.component.js +3 -2
  284. package/esm2015/tab-select/tab-select.component.js +3 -2
  285. package/esm2015/tab-select/tab-select.module.js +3 -2
  286. package/esm2015/user-profile/covalent-core-user-profile.js +3 -2
  287. package/esm2015/user-profile/index.js +3 -2
  288. package/esm2015/user-profile/public_api.js +3 -2
  289. package/esm2015/user-profile/user-profile-menu/user-profile-menu.component.js +4 -3
  290. package/esm2015/user-profile/user-profile.component.js +3 -2
  291. package/esm2015/user-profile/user-profile.module.js +3 -2
  292. package/esm2015/virtual-scroll/covalent-core-virtual-scroll.js +3 -2
  293. package/esm2015/virtual-scroll/index.js +3 -2
  294. package/esm2015/virtual-scroll/public-api.js +3 -2
  295. package/esm2015/virtual-scroll/virtual-scroll-container.component.js +4 -3
  296. package/esm2015/virtual-scroll/virtual-scroll-row.directive.js +3 -2
  297. package/esm2015/virtual-scroll/virtual-scroll.module.js +3 -2
  298. package/expansion-panel/covalent-core-expansion-panel.metadata.json +1 -1
  299. package/expansion-panel/package.json +1 -3
  300. package/fesm2015/covalent-core-breadcrumbs.js +13 -7
  301. package/fesm2015/covalent-core-breadcrumbs.js.map +1 -1
  302. package/fesm2015/covalent-core-chips.js +11 -6
  303. package/fesm2015/covalent-core-chips.js.map +1 -1
  304. package/fesm2015/covalent-core-common.js +62 -31
  305. package/fesm2015/covalent-core-common.js.map +1 -1
  306. package/fesm2015/covalent-core-data-table.js +28 -17
  307. package/fesm2015/covalent-core-data-table.js.map +1 -1
  308. package/fesm2015/covalent-core-dialogs.js +36 -25
  309. package/fesm2015/covalent-core-dialogs.js.map +1 -1
  310. package/fesm2015/covalent-core-dynamic-menu.js +17 -10
  311. package/fesm2015/covalent-core-dynamic-menu.js.map +1 -1
  312. package/fesm2015/covalent-core-expansion-panel.js +13 -7
  313. package/fesm2015/covalent-core-expansion-panel.js.map +1 -1
  314. package/fesm2015/covalent-core-file.js +19 -10
  315. package/fesm2015/covalent-core-file.js.map +1 -1
  316. package/fesm2015/covalent-core-json-formatter.js +11 -6
  317. package/fesm2015/covalent-core-json-formatter.js.map +1 -1
  318. package/fesm2015/covalent-core-layout.js +65 -41
  319. package/fesm2015/covalent-core-layout.js.map +1 -1
  320. package/fesm2015/covalent-core-loading.js +26 -18
  321. package/fesm2015/covalent-core-loading.js.map +1 -1
  322. package/fesm2015/covalent-core-media.js +12 -6
  323. package/fesm2015/covalent-core-media.js.map +1 -1
  324. package/fesm2015/covalent-core-menu.js +11 -6
  325. package/fesm2015/covalent-core-menu.js.map +1 -1
  326. package/fesm2015/covalent-core-message.js +11 -6
  327. package/fesm2015/covalent-core-message.js.map +1 -1
  328. package/fesm2015/covalent-core-nav-links.js +10 -5
  329. package/fesm2015/covalent-core-nav-links.js.map +1 -1
  330. package/fesm2015/covalent-core-notifications.js +17 -12
  331. package/fesm2015/covalent-core-notifications.js.map +1 -1
  332. package/fesm2015/covalent-core-paging.js +11 -6
  333. package/fesm2015/covalent-core-paging.js.map +1 -1
  334. package/fesm2015/covalent-core-search.js +14 -8
  335. package/fesm2015/covalent-core-search.js.map +1 -1
  336. package/fesm2015/covalent-core-sidesheet.js +11 -6
  337. package/fesm2015/covalent-core-sidesheet.js.map +1 -1
  338. package/fesm2015/covalent-core-steps.js +33 -22
  339. package/fesm2015/covalent-core-steps.js.map +1 -1
  340. package/fesm2015/covalent-core-tab-select.js +12 -6
  341. package/fesm2015/covalent-core-tab-select.js.map +1 -1
  342. package/fesm2015/covalent-core-user-profile.js +13 -7
  343. package/fesm2015/covalent-core-user-profile.js.map +1 -1
  344. package/fesm2015/covalent-core-virtual-scroll.js +13 -7
  345. package/fesm2015/covalent-core-virtual-scroll.js.map +1 -1
  346. package/fesm2015/covalent-core.js +4 -2
  347. package/fesm2015/covalent-core.js.map +1 -1
  348. package/file/covalent-core-file.metadata.json +1 -1
  349. package/file/package.json +1 -3
  350. package/json-formatter/covalent-core-json-formatter.metadata.json +1 -1
  351. package/json-formatter/package.json +1 -3
  352. package/layout/covalent-core-layout.metadata.json +1 -1
  353. package/layout/layout-manage-list/layout-manage-list.directives.d.ts +4 -4
  354. package/layout/layout-nav-list/layout-nav-list.directives.d.ts +4 -4
  355. package/layout/layout-toggle.class.d.ts +1 -1
  356. package/layout/layout.directives.d.ts +4 -4
  357. package/layout/package.json +1 -3
  358. package/loading/covalent-core-loading.metadata.json +1 -1
  359. package/loading/package.json +1 -3
  360. package/media/package.json +1 -3
  361. package/menu/covalent-core-menu.metadata.json +1 -1
  362. package/menu/package.json +1 -3
  363. package/message/covalent-core-message.metadata.json +1 -1
  364. package/message/package.json +1 -3
  365. package/nav-links/package.json +1 -3
  366. package/notifications/covalent-core-notifications.metadata.json +1 -1
  367. package/notifications/package.json +1 -3
  368. package/package.json +12 -12
  369. package/paging/covalent-core-paging.metadata.json +1 -1
  370. package/paging/package.json +1 -3
  371. package/schematics/components.js +1 -0
  372. package/schematics/components.js.map +1 -1
  373. package/schematics/ng-add/files/theme.scss +1 -1
  374. package/schematics/ng-add/index.js +4 -6
  375. package/schematics/ng-add/index.js.map +1 -1
  376. package/schematics/ng-update/index.js +1 -0
  377. package/schematics/ng-update/index.js.map +1 -1
  378. package/schematics/ng-update/target-version.js +1 -0
  379. package/schematics/ng-update/target-version.js.map +1 -1
  380. package/schematics/version-names.js +1 -0
  381. package/schematics/version-names.js.map +1 -1
  382. package/search/covalent-core-search.metadata.json +1 -1
  383. package/search/package.json +1 -3
  384. package/sidesheet/covalent-core-sidesheet.metadata.json +1 -1
  385. package/sidesheet/package.json +1 -3
  386. package/steps/covalent-core-steps.metadata.json +1 -1
  387. package/steps/package.json +1 -3
  388. package/tab-select/covalent-core-tab-select.metadata.json +1 -1
  389. package/tab-select/package.json +1 -3
  390. package/theming/prebuilt/blue-grey-deep-orange.css +193 -28
  391. package/theming/prebuilt/blue-grey-deep-orange.css.map +1 -1
  392. package/theming/prebuilt/blue-orange.css +193 -28
  393. package/theming/prebuilt/blue-orange.css.map +1 -1
  394. package/theming/prebuilt/indigo-pink.css +193 -28
  395. package/theming/prebuilt/indigo-pink.css.map +1 -1
  396. package/theming/prebuilt/orange-light-blue.css +193 -28
  397. package/theming/prebuilt/orange-light-blue.css.map +1 -1
  398. package/theming/prebuilt/teal-orange.css +193 -28
  399. package/theming/prebuilt/teal-orange.css.map +1 -1
  400. package/user-profile/covalent-core-user-profile.metadata.json +1 -1
  401. package/user-profile/package.json +1 -3
  402. package/virtual-scroll/covalent-core-virtual-scroll.metadata.json +1 -1
  403. package/virtual-scroll/package.json +1 -3
  404. package/esm5/breadcrumbs/breadcrumb/breadcrumb.component.js +0 -216
  405. package/esm5/breadcrumbs/breadcrumbs.component.js +0 -286
  406. package/esm5/breadcrumbs/breadcrumbs.module.js +0 -23
  407. package/esm5/breadcrumbs/covalent-core-breadcrumbs.js +0 -9
  408. package/esm5/breadcrumbs/index.js +0 -6
  409. package/esm5/breadcrumbs/public-api.js +0 -8
  410. package/esm5/chips/chips.component.js +0 -1453
  411. package/esm5/chips/chips.module.js +0 -26
  412. package/esm5/chips/covalent-core-chips.js +0 -9
  413. package/esm5/chips/index.js +0 -6
  414. package/esm5/chips/public-api.js +0 -7
  415. package/esm5/common/animations/bounce/bounce.animation.js +0 -75
  416. package/esm5/common/animations/collapse/collapse.animation.js +0 -66
  417. package/esm5/common/animations/common/interfaces.js +0 -17
  418. package/esm5/common/animations/fade/fadeInOut.animation.js +0 -52
  419. package/esm5/common/animations/flash/flash.animation.js +0 -39
  420. package/esm5/common/animations/headshake/headshake.animation.js +0 -40
  421. package/esm5/common/animations/jello/jello.animation.js +0 -43
  422. package/esm5/common/animations/pulse/pulse.animation.js +0 -37
  423. package/esm5/common/animations/rotate/rotate.animation.js +0 -40
  424. package/esm5/common/behaviors/control-value-accesor.mixin.js +0 -127
  425. package/esm5/common/behaviors/disable-ripple.mixin.js +0 -75
  426. package/esm5/common/behaviors/disabled.mixin.js +0 -75
  427. package/esm5/common/common.module.js +0 -57
  428. package/esm5/common/covalent-core-common.js +0 -11
  429. package/esm5/common/directives/fullscreen/fullscreen.directive.js +0 -228
  430. package/esm5/common/forms/auto-trim/auto-trim.directive.js +0 -52
  431. package/esm5/common/forms/validators/validators.js +0 -73
  432. package/esm5/common/functions/clipboard.js +0 -29
  433. package/esm5/common/functions/convert.js +0 -120
  434. package/esm5/common/functions/download.js +0 -93
  435. package/esm5/common/functions/file.js +0 -28
  436. package/esm5/common/index.js +0 -6
  437. package/esm5/common/pipes/bytes/bytes.pipe.js +0 -54
  438. package/esm5/common/pipes/decimal-bytes/decimal-bytes.pipe.js +0 -54
  439. package/esm5/common/pipes/digits/digits.pipe.js +0 -72
  440. package/esm5/common/pipes/time-ago/time-ago.pipe.js +0 -89
  441. package/esm5/common/pipes/time-difference/time-difference.pipe.js +0 -74
  442. package/esm5/common/pipes/time-until/time-until.pipe.js +0 -89
  443. package/esm5/common/pipes/truncate/truncate.pipe.js +0 -42
  444. package/esm5/common/public-api.js +0 -43
  445. package/esm5/common/services/icon.service.js +0 -1118
  446. package/esm5/common/services/router-path.service.js +0 -69
  447. package/esm5/covalent-core.js +0 -9
  448. package/esm5/data-table/covalent-core-data-table.js +0 -9
  449. package/esm5/data-table/data-table-cell/data-table-cell.component.js +0 -98
  450. package/esm5/data-table/data-table-column/data-table-column.component.js +0 -257
  451. package/esm5/data-table/data-table-row/data-table-row.component.js +0 -145
  452. package/esm5/data-table/data-table-table/data-table-table.component.js +0 -40
  453. package/esm5/data-table/data-table.component.js +0 -2079
  454. package/esm5/data-table/data-table.module.js +0 -42
  455. package/esm5/data-table/directives/data-table-template.directive.js +0 -31
  456. package/esm5/data-table/index.js +0 -6
  457. package/esm5/data-table/public-api.js +0 -13
  458. package/esm5/data-table/services/data-table.service.js +0 -184
  459. package/esm5/dialogs/alert-dialog/alert-dialog.component.js +0 -48
  460. package/esm5/dialogs/confirm-dialog/confirm-dialog.component.js +0 -63
  461. package/esm5/dialogs/covalent-core-dialogs.js +0 -10
  462. package/esm5/dialogs/dialog.component.js +0 -76
  463. package/esm5/dialogs/dialogs.module.js +0 -60
  464. package/esm5/dialogs/index.js +0 -6
  465. package/esm5/dialogs/prompt-dialog/prompt-dialog.component.js +0 -100
  466. package/esm5/dialogs/public-api.js +0 -12
  467. package/esm5/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.js +0 -356
  468. package/esm5/dialogs/services/dialog.service.js +0 -441
  469. package/esm5/dialogs/window-dialog/window-dialog.component.js +0 -60
  470. package/esm5/dynamic-menu/covalent-core-dynamic-menu.js +0 -10
  471. package/esm5/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.js +0 -45
  472. package/esm5/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.js +0 -39
  473. package/esm5/dynamic-menu/dynamic-menu.component.js +0 -94
  474. package/esm5/dynamic-menu/dynamic-menu.module.js +0 -29
  475. package/esm5/dynamic-menu/index.js +0 -6
  476. package/esm5/dynamic-menu/public_api.js +0 -8
  477. package/esm5/expansion-panel/covalent-core-expansion-panel.js +0 -9
  478. package/esm5/expansion-panel/expansion-panel-group.component.js +0 -251
  479. package/esm5/expansion-panel/expansion-panel.component.js +0 -344
  480. package/esm5/expansion-panel/expansion-panel.module.js +0 -34
  481. package/esm5/expansion-panel/index.js +0 -6
  482. package/esm5/expansion-panel/public-api.js +0 -8
  483. package/esm5/file/covalent-core-file.js +0 -9
  484. package/esm5/file/directives/file-drop.directive.js +0 -276
  485. package/esm5/file/directives/file-select.directive.js +0 -124
  486. package/esm5/file/file-input/file-input.component.js +0 -225
  487. package/esm5/file/file-upload/file-upload.component.js +0 -284
  488. package/esm5/file/file.module.js +0 -38
  489. package/esm5/file/index.js +0 -6
  490. package/esm5/file/public-api.js +0 -11
  491. package/esm5/file/services/file.service.js +0 -137
  492. package/esm5/index.js +0 -5
  493. package/esm5/json-formatter/covalent-core-json-formatter.js +0 -9
  494. package/esm5/json-formatter/index.js +0 -6
  495. package/esm5/json-formatter/json-formatter.component.js +0 -433
  496. package/esm5/json-formatter/json-formatter.module.js +0 -23
  497. package/esm5/json-formatter/public-api.js +0 -7
  498. package/esm5/layout/covalent-core-layout.js +0 -9
  499. package/esm5/layout/index.js +0 -6
  500. package/esm5/layout/layout-card-over/layout-card-over.component.js +0 -72
  501. package/esm5/layout/layout-footer/layout-footer.component.js +0 -77
  502. package/esm5/layout/layout-manage-list/layout-manage-list.component.js +0 -175
  503. package/esm5/layout/layout-manage-list/layout-manage-list.directives.js +0 -147
  504. package/esm5/layout/layout-nav/layout-nav.component.js +0 -108
  505. package/esm5/layout/layout-nav-list/layout-nav-list.component.js +0 -257
  506. package/esm5/layout/layout-nav-list/layout-nav-list.directives.js +0 -147
  507. package/esm5/layout/layout-toggle.class.js +0 -214
  508. package/esm5/layout/layout.component.js +0 -175
  509. package/esm5/layout/layout.directives.js +0 -144
  510. package/esm5/layout/layout.module.js +0 -67
  511. package/esm5/layout/navigation-drawer/navigation-drawer.component.js +0 -364
  512. package/esm5/layout/public-api.js +0 -17
  513. package/esm5/loading/covalent-core-loading.js +0 -9
  514. package/esm5/loading/directives/loading.directive.js +0 -304
  515. package/esm5/loading/index.js +0 -6
  516. package/esm5/loading/loading.component.js +0 -367
  517. package/esm5/loading/loading.module.js +0 -33
  518. package/esm5/loading/public-api.js +0 -10
  519. package/esm5/loading/services/loading.factory.js +0 -378
  520. package/esm5/loading/services/loading.service.js +0 -494
  521. package/esm5/media/covalent-core-media.js +0 -9
  522. package/esm5/media/directives/media-toggle.directive.js +0 -261
  523. package/esm5/media/index.js +0 -6
  524. package/esm5/media/media.module.js +0 -23
  525. package/esm5/media/public-api.js +0 -8
  526. package/esm5/media/services/media.service.js +0 -229
  527. package/esm5/menu/covalent-core-menu.js +0 -9
  528. package/esm5/menu/index.js +0 -6
  529. package/esm5/menu/menu.component.js +0 -19
  530. package/esm5/menu/menu.module.js +0 -25
  531. package/esm5/menu/public-api.js +0 -7
  532. package/esm5/message/covalent-core-message.js +0 -9
  533. package/esm5/message/index.js +0 -6
  534. package/esm5/message/message.component.js +0 -402
  535. package/esm5/message/message.module.js +0 -24
  536. package/esm5/message/public-api.js +0 -7
  537. package/esm5/nav-links/covalent-core-nav-links.js +0 -9
  538. package/esm5/nav-links/index.js +0 -6
  539. package/esm5/nav-links/nav-links.component.js +0 -171
  540. package/esm5/nav-links/nav-links.module.js +0 -40
  541. package/esm5/nav-links/public-api.js +0 -7
  542. package/esm5/notifications/covalent-core-notifications.js +0 -9
  543. package/esm5/notifications/index.js +0 -6
  544. package/esm5/notifications/notification-count.component.js +0 -268
  545. package/esm5/notifications/notifications.module.js +0 -23
  546. package/esm5/notifications/public-api.js +0 -7
  547. package/esm5/paging/covalent-core-paging.js +0 -9
  548. package/esm5/paging/index.js +0 -6
  549. package/esm5/paging/paging-bar.component.js +0 -542
  550. package/esm5/paging/paging.module.js +0 -23
  551. package/esm5/paging/public-api.js +0 -7
  552. package/esm5/search/covalent-core-search.js +0 -9
  553. package/esm5/search/index.js +0 -6
  554. package/esm5/search/public-api.js +0 -8
  555. package/esm5/search/search-box/search-box.component.js +0 -298
  556. package/esm5/search/search-input/search-input.component.js +0 -297
  557. package/esm5/search/search.module.js +0 -26
  558. package/esm5/sidesheet/covalent-core-sidesheet.js +0 -9
  559. package/esm5/sidesheet/index.js +0 -6
  560. package/esm5/sidesheet/public-api.js +0 -7
  561. package/esm5/sidesheet/sidesheet.component.js +0 -89
  562. package/esm5/sidesheet/sidesheet.module.js +0 -30
  563. package/esm5/steps/covalent-core-steps.js +0 -9
  564. package/esm5/steps/index.js +0 -6
  565. package/esm5/steps/nav/nav-step-link/nav-step-link.component.js +0 -165
  566. package/esm5/steps/nav/nav-steps-horizontal/nav-steps-horizontal.component.js +0 -464
  567. package/esm5/steps/nav/nav-steps-vertical/nav-steps-vertical.component.js +0 -143
  568. package/esm5/steps/public-api.js +0 -13
  569. package/esm5/steps/step-body/step-body.component.js +0 -103
  570. package/esm5/steps/step-header/step-header.component.js +0 -101
  571. package/esm5/steps/step.component.js +0 -399
  572. package/esm5/steps/steps.component.js +0 -313
  573. package/esm5/steps/steps.module.js +0 -47
  574. package/esm5/tab-select/covalent-core-tab-select.js +0 -9
  575. package/esm5/tab-select/index.js +0 -6
  576. package/esm5/tab-select/public-api.js +0 -8
  577. package/esm5/tab-select/tab-option.component.js +0 -86
  578. package/esm5/tab-select/tab-select.component.js +0 -344
  579. package/esm5/tab-select/tab-select.module.js +0 -34
  580. package/esm5/user-profile/covalent-core-user-profile.js +0 -9
  581. package/esm5/user-profile/index.js +0 -6
  582. package/esm5/user-profile/public_api.js +0 -8
  583. package/esm5/user-profile/user-profile-menu/user-profile-menu.component.js +0 -42
  584. package/esm5/user-profile/user-profile.component.js +0 -29
  585. package/esm5/user-profile/user-profile.module.js +0 -36
  586. package/esm5/virtual-scroll/covalent-core-virtual-scroll.js +0 -9
  587. package/esm5/virtual-scroll/index.js +0 -6
  588. package/esm5/virtual-scroll/public-api.js +0 -8
  589. package/esm5/virtual-scroll/virtual-scroll-container.component.js +0 -468
  590. package/esm5/virtual-scroll/virtual-scroll-row.directive.js +0 -24
  591. package/esm5/virtual-scroll/virtual-scroll.module.js +0 -24
  592. package/fesm5/covalent-core-breadcrumbs.js +0 -535
  593. package/fesm5/covalent-core-breadcrumbs.js.map +0 -1
  594. package/fesm5/covalent-core-chips.js +0 -1484
  595. package/fesm5/covalent-core-chips.js.map +0 -1
  596. package/fesm5/covalent-core-common.js +0 -2961
  597. package/fesm5/covalent-core-common.js.map +0 -1
  598. package/fesm5/covalent-core-data-table.js +0 -2863
  599. package/fesm5/covalent-core-data-table.js.map +0 -1
  600. package/fesm5/covalent-core-dialogs.js +0 -1189
  601. package/fesm5/covalent-core-dialogs.js.map +0 -1
  602. package/fesm5/covalent-core-dynamic-menu.js +0 -214
  603. package/fesm5/covalent-core-dynamic-menu.js.map +0 -1
  604. package/fesm5/covalent-core-expansion-panel.js +0 -631
  605. package/fesm5/covalent-core-expansion-panel.js.map +0 -1
  606. package/fesm5/covalent-core-file.js +0 -1068
  607. package/fesm5/covalent-core-file.js.map +0 -1
  608. package/fesm5/covalent-core-json-formatter.js +0 -470
  609. package/fesm5/covalent-core-json-formatter.js.map +0 -1
  610. package/fesm5/covalent-core-layout.js +0 -1906
  611. package/fesm5/covalent-core-layout.js.map +0 -1
  612. package/fesm5/covalent-core-loading.js +0 -1562
  613. package/fesm5/covalent-core-loading.js.map +0 -1
  614. package/fesm5/covalent-core-media.js +0 -522
  615. package/fesm5/covalent-core-media.js.map +0 -1
  616. package/fesm5/covalent-core-menu.js +0 -58
  617. package/fesm5/covalent-core-menu.js.map +0 -1
  618. package/fesm5/covalent-core-message.js +0 -439
  619. package/fesm5/covalent-core-message.js.map +0 -1
  620. package/fesm5/covalent-core-nav-links.js +0 -224
  621. package/fesm5/covalent-core-nav-links.js.map +0 -1
  622. package/fesm5/covalent-core-notifications.js +0 -303
  623. package/fesm5/covalent-core-notifications.js.map +0 -1
  624. package/fesm5/covalent-core-paging.js +0 -579
  625. package/fesm5/covalent-core-paging.js.map +0 -1
  626. package/fesm5/covalent-core-search.js +0 -623
  627. package/fesm5/covalent-core-search.js.map +0 -1
  628. package/fesm5/covalent-core-sidesheet.js +0 -129
  629. package/fesm5/covalent-core-sidesheet.js.map +0 -1
  630. package/fesm5/covalent-core-steps.js +0 -1704
  631. package/fesm5/covalent-core-steps.js.map +0 -1
  632. package/fesm5/covalent-core-tab-select.js +0 -467
  633. package/fesm5/covalent-core-tab-select.js.map +0 -1
  634. package/fesm5/covalent-core-user-profile.js +0 -118
  635. package/fesm5/covalent-core-user-profile.js.map +0 -1
  636. package/fesm5/covalent-core-virtual-scroll.js +0 -526
  637. package/fesm5/covalent-core-virtual-scroll.js.map +0 -1
  638. package/fesm5/covalent-core.js +0 -10
  639. package/fesm5/covalent-core.js.map +0 -1
@@ -1,2863 +0,0 @@
1
- import { Component, ElementRef, Renderer2, Input, HostListener, Directive, TemplateRef, ViewContainerRef, EventEmitter, forwardRef, ChangeDetectionStrategy, Optional, Inject, ChangeDetectorRef, ContentChildren, ViewChild, ViewChildren, Output, HostBinding, Injectable, NgModule } from '@angular/core';
2
- import { DOCUMENT, CommonModule } from '@angular/common';
3
- import { MatCheckboxModule } from '@angular/material/checkbox';
4
- import { MatTooltipModule } from '@angular/material/tooltip';
5
- import { MatIconModule } from '@angular/material/icon';
6
- import { MatPseudoCheckboxModule } from '@angular/material/core';
7
- import { __extends, __values } from 'tslib';
8
- import { DomSanitizer } from '@angular/platform-browser';
9
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
10
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
11
- import { DOWN_ARROW, UP_ARROW, SPACE, ENTER } from '@angular/cdk/keycodes';
12
- import { Subject } from 'rxjs';
13
- import { debounceTime } from 'rxjs/operators';
14
- import { TemplatePortalDirective } from '@angular/cdk/portal';
15
- import { mixinControlValueAccessor } from '@covalent/core/common';
16
-
17
- /**
18
- * @fileoverview added by tsickle
19
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
20
- */
21
- var TdDataTableColumnRowComponent = /** @class */ (function () {
22
- function TdDataTableColumnRowComponent(_elementRef, _renderer) {
23
- this._elementRef = _elementRef;
24
- this._renderer = _renderer;
25
- this._renderer.addClass(this._elementRef.nativeElement, 'td-data-table-column-row');
26
- }
27
- TdDataTableColumnRowComponent.decorators = [
28
- { type: Component, args: [{
29
- /* tslint:disable-next-line */
30
- selector: 'tr[td-data-table-column-row]',
31
- template: "<ng-content></ng-content>\n",
32
- styles: [":host{border-bottom-style:solid;border-bottom-width:1px}:host.td-data-table-row{height:48px}:host.td-data-table-column-row{height:56px}"]
33
- }] }
34
- ];
35
- /** @nocollapse */
36
- TdDataTableColumnRowComponent.ctorParameters = function () { return [
37
- { type: ElementRef },
38
- { type: Renderer2 }
39
- ]; };
40
- return TdDataTableColumnRowComponent;
41
- }());
42
- if (false) {
43
- /**
44
- * @type {?}
45
- * @protected
46
- */
47
- TdDataTableColumnRowComponent.prototype._elementRef;
48
- /**
49
- * @type {?}
50
- * @protected
51
- */
52
- TdDataTableColumnRowComponent.prototype._renderer;
53
- }
54
- var TdDataTableRowComponent = /** @class */ (function () {
55
- function TdDataTableRowComponent(_elementRef, _renderer) {
56
- this._elementRef = _elementRef;
57
- this._renderer = _renderer;
58
- this._selected = false;
59
- this._renderer.addClass(this._elementRef.nativeElement, 'td-data-table-row');
60
- }
61
- Object.defineProperty(TdDataTableRowComponent.prototype, "selected", {
62
- get: /**
63
- * @return {?}
64
- */
65
- function () {
66
- return this._selected;
67
- },
68
- set: /**
69
- * @param {?} selected
70
- * @return {?}
71
- */
72
- function (selected) {
73
- if (selected) {
74
- this._renderer.addClass(this._elementRef.nativeElement, 'td-selected');
75
- }
76
- else {
77
- this._renderer.removeClass(this._elementRef.nativeElement, 'td-selected');
78
- }
79
- this._selected = selected;
80
- },
81
- enumerable: true,
82
- configurable: true
83
- });
84
- Object.defineProperty(TdDataTableRowComponent.prototype, "height", {
85
- get: /**
86
- * @return {?}
87
- */
88
- function () {
89
- /** @type {?} */
90
- var height = 48;
91
- if (this._elementRef.nativeElement) {
92
- height = ((/** @type {?} */ (this._elementRef.nativeElement))).getBoundingClientRect().height;
93
- }
94
- return height;
95
- },
96
- enumerable: true,
97
- configurable: true
98
- });
99
- /**
100
- * Listening to click event to explicitly focus the row element.
101
- */
102
- /**
103
- * Listening to click event to explicitly focus the row element.
104
- * @return {?}
105
- */
106
- TdDataTableRowComponent.prototype.clickListener = /**
107
- * Listening to click event to explicitly focus the row element.
108
- * @return {?}
109
- */
110
- function () {
111
- this.focus();
112
- };
113
- /**
114
- * @return {?}
115
- */
116
- TdDataTableRowComponent.prototype.focus = /**
117
- * @return {?}
118
- */
119
- function () {
120
- this._elementRef.nativeElement.focus();
121
- };
122
- TdDataTableRowComponent.decorators = [
123
- { type: Component, args: [{
124
- /* tslint:disable-next-line */
125
- selector: 'tr[td-data-table-row]',
126
- template: "<ng-content></ng-content>\n",
127
- styles: [":host{border-bottom-style:solid;border-bottom-width:1px}:host.td-data-table-row{height:48px}:host.td-data-table-column-row{height:56px}"]
128
- }] }
129
- ];
130
- /** @nocollapse */
131
- TdDataTableRowComponent.ctorParameters = function () { return [
132
- { type: ElementRef },
133
- { type: Renderer2 }
134
- ]; };
135
- TdDataTableRowComponent.propDecorators = {
136
- selected: [{ type: Input, args: ['selected',] }],
137
- clickListener: [{ type: HostListener, args: ['click',] }]
138
- };
139
- return TdDataTableRowComponent;
140
- }());
141
- if (false) {
142
- /**
143
- * @type {?}
144
- * @private
145
- */
146
- TdDataTableRowComponent.prototype._selected;
147
- /**
148
- * @type {?}
149
- * @private
150
- */
151
- TdDataTableRowComponent.prototype._elementRef;
152
- /**
153
- * @type {?}
154
- * @private
155
- */
156
- TdDataTableRowComponent.prototype._renderer;
157
- }
158
-
159
- /**
160
- * @fileoverview added by tsickle
161
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
162
- */
163
- var TdDataTableTemplateDirective = /** @class */ (function (_super) {
164
- __extends(TdDataTableTemplateDirective, _super);
165
- function TdDataTableTemplateDirective(templateRef, viewContainerRef) {
166
- return _super.call(this, templateRef, viewContainerRef) || this;
167
- }
168
- TdDataTableTemplateDirective.decorators = [
169
- { type: Directive, args: [{ selector: '[tdDataTableTemplate]ng-template' },] }
170
- ];
171
- /** @nocollapse */
172
- TdDataTableTemplateDirective.ctorParameters = function () { return [
173
- { type: TemplateRef },
174
- { type: ViewContainerRef }
175
- ]; };
176
- TdDataTableTemplateDirective.propDecorators = {
177
- tdDataTableTemplate: [{ type: Input }]
178
- };
179
- return TdDataTableTemplateDirective;
180
- }(TemplatePortalDirective));
181
- if (false) {
182
- /** @type {?} */
183
- TdDataTableTemplateDirective.prototype.tdDataTableTemplate;
184
- }
185
-
186
- /**
187
- * @fileoverview added by tsickle
188
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
189
- */
190
- /** @enum {string} */
191
- var TdDataTableSortingOrder = {
192
- Ascending: 'ASC',
193
- Descending: 'DESC',
194
- };
195
- /**
196
- * @record
197
- */
198
- function ITdDataTableColumnWidth() { }
199
- if (false) {
200
- /** @type {?|undefined} */
201
- ITdDataTableColumnWidth.prototype.min;
202
- /** @type {?|undefined} */
203
- ITdDataTableColumnWidth.prototype.max;
204
- }
205
- /**
206
- * @record
207
- */
208
- function ITdDataTableColumn() { }
209
- if (false) {
210
- /** @type {?} */
211
- ITdDataTableColumn.prototype.name;
212
- /** @type {?} */
213
- ITdDataTableColumn.prototype.label;
214
- /** @type {?|undefined} */
215
- ITdDataTableColumn.prototype.tooltip;
216
- /** @type {?|undefined} */
217
- ITdDataTableColumn.prototype.numeric;
218
- /** @type {?|undefined} */
219
- ITdDataTableColumn.prototype.format;
220
- /** @type {?|undefined} */
221
- ITdDataTableColumn.prototype.nested;
222
- /** @type {?|undefined} */
223
- ITdDataTableColumn.prototype.sortable;
224
- /** @type {?|undefined} */
225
- ITdDataTableColumn.prototype.hidden;
226
- /** @type {?|undefined} */
227
- ITdDataTableColumn.prototype.filter;
228
- /** @type {?|undefined} */
229
- ITdDataTableColumn.prototype.width;
230
- /** @type {?|undefined} */
231
- ITdDataTableColumn.prototype.columnSortOrder;
232
- }
233
- /**
234
- * @record
235
- */
236
- function ITdDataTableSelectEvent() { }
237
- if (false) {
238
- /** @type {?} */
239
- ITdDataTableSelectEvent.prototype.row;
240
- /** @type {?} */
241
- ITdDataTableSelectEvent.prototype.selected;
242
- /** @type {?} */
243
- ITdDataTableSelectEvent.prototype.index;
244
- }
245
- /**
246
- * @record
247
- */
248
- function ITdDataTableSelectAllEvent() { }
249
- if (false) {
250
- /** @type {?} */
251
- ITdDataTableSelectAllEvent.prototype.rows;
252
- /** @type {?} */
253
- ITdDataTableSelectAllEvent.prototype.selected;
254
- }
255
- /**
256
- * @record
257
- */
258
- function ITdDataTableRowClickEvent() { }
259
- if (false) {
260
- /** @type {?} */
261
- ITdDataTableRowClickEvent.prototype.row;
262
- /** @type {?} */
263
- ITdDataTableRowClickEvent.prototype.index;
264
- }
265
- /**
266
- * @record
267
- */
268
- function IInternalColumnWidth() { }
269
- if (false) {
270
- /** @type {?} */
271
- IInternalColumnWidth.prototype.value;
272
- /** @type {?} */
273
- IInternalColumnWidth.prototype.limit;
274
- /** @type {?} */
275
- IInternalColumnWidth.prototype.index;
276
- /** @type {?|undefined} */
277
- IInternalColumnWidth.prototype.min;
278
- /** @type {?|undefined} */
279
- IInternalColumnWidth.prototype.max;
280
- }
281
- /**
282
- * Constant to set the rows offset before and after the viewport
283
- * @type {?}
284
- */
285
- var TD_VIRTUAL_OFFSET = 2;
286
- /**
287
- * Constant to set default row height if none is provided
288
- * @type {?}
289
- */
290
- var TD_VIRTUAL_DEFAULT_ROW_HEIGHT = 48;
291
- var TdDataTableBase = /** @class */ (function () {
292
- function TdDataTableBase(_changeDetectorRef) {
293
- this._changeDetectorRef = _changeDetectorRef;
294
- }
295
- return TdDataTableBase;
296
- }());
297
- if (false) {
298
- /** @type {?} */
299
- TdDataTableBase.prototype._changeDetectorRef;
300
- }
301
- /* tslint:disable-next-line */
302
- /** @type {?} */
303
- var _TdDataTableMixinBase = mixinControlValueAccessor(TdDataTableBase, []);
304
- var TdDataTableComponent = /** @class */ (function (_super) {
305
- __extends(TdDataTableComponent, _super);
306
- function TdDataTableComponent(_document, _elementRef, _domSanitizer, _changeDetectorRef) {
307
- var _this = _super.call(this, _changeDetectorRef) || this;
308
- _this._document = _document;
309
- _this._elementRef = _elementRef;
310
- _this._domSanitizer = _domSanitizer;
311
- _this._hostWidth = 0;
312
- /**
313
- * manually resizable columns
314
- */
315
- _this._resizableColumns = false;
316
- _this._columnClientX = 0;
317
- _this._onColumnResize = new Subject();
318
- _this._widths = [];
319
- _this._onResize = new Subject();
320
- _this._scrollHorizontalOffset = 0;
321
- _this._onHorizontalScroll = new Subject();
322
- _this._onVerticalScroll = new Subject();
323
- // Array of cached row heights to allow dynamic row heights
324
- _this._rowHeightCache = [];
325
- // Total pseudo height of all the elements
326
- _this._totalHeight = 0;
327
- // Total host height for the viewport
328
- _this._hostHeight = 0;
329
- // Scrolled vertical pixels
330
- _this._scrollVerticalOffset = 0;
331
- // Variables that set from and to which rows will be rendered
332
- _this._fromRow = 0;
333
- _this._toRow = 0;
334
- _this._selectable = false;
335
- _this._clickable = false;
336
- _this._multiple = true;
337
- _this._allSelected = false;
338
- _this._indeterminate = false;
339
- /**
340
- * sorting
341
- */
342
- _this._sortable = false;
343
- _this._sortOrder = TdDataTableSortingOrder.Ascending;
344
- /**
345
- * shift select
346
- */
347
- _this._shiftPreviouslyPressed = false;
348
- _this._lastSelectedIndex = -1;
349
- _this._firstSelectedIndex = -1;
350
- _this._firstCheckboxValue = false;
351
- /**
352
- * template fetching support
353
- */
354
- _this._templateMap = new Map();
355
- /**
356
- * sortChange?: function
357
- * Event emitted when the column headers are clicked. [sortable] needs to be enabled.
358
- * Emits an [ITdDataTableSortChangeEvent] implemented object.
359
- */
360
- _this.sortChange = new EventEmitter();
361
- /**
362
- * rowSelect?: function
363
- * Event emitted when a row is selected/deselected. [selectable] needs to be enabled.
364
- * Emits an [ITdDataTableSelectEvent] implemented object.
365
- */
366
- _this.rowSelect = new EventEmitter();
367
- /**
368
- * rowClick?: function
369
- * Event emitted when a row is clicked.
370
- * Emits an [ITdDataTableRowClickEvent] implemented object.
371
- */
372
- _this.rowClick = new EventEmitter();
373
- /**
374
- * selectAll?: function
375
- * Event emitted when all rows are selected/deselected by the all checkbox. [selectable] needs to be enabled.
376
- * Emits an [ITdDataTableSelectAllEvent] implemented object.
377
- */
378
- _this.selectAll = new EventEmitter();
379
- /**
380
- * compareWith?: function(row, model): boolean
381
- * Allows custom comparison between row and model to see if row is selected or not
382
- * Default comparation is by reference
383
- */
384
- _this.compareWith = (/**
385
- * @param {?} row
386
- * @param {?} model
387
- * @return {?}
388
- */
389
- function (row, model) {
390
- return row === model;
391
- });
392
- return _this;
393
- }
394
- Object.defineProperty(TdDataTableComponent.prototype, "resizingColumn", {
395
- get: /**
396
- * @return {?}
397
- */
398
- function () {
399
- return this._resizingColumn;
400
- },
401
- enumerable: true,
402
- configurable: true
403
- });
404
- Object.defineProperty(TdDataTableComponent.prototype, "hostWidth", {
405
- get: /**
406
- * @return {?}
407
- */
408
- function () {
409
- // if the checkboxes are rendered, we need to remove their width
410
- // from the total width to calculate properly
411
- if (this.selectable) {
412
- return this._hostWidth - 42;
413
- }
414
- return this._hostWidth;
415
- },
416
- enumerable: true,
417
- configurable: true
418
- });
419
- Object.defineProperty(TdDataTableComponent.prototype, "offsetTransform", {
420
- /**
421
- * Returns the offset style with a proper calculation on how much it should move
422
- * over the y axis of the total height
423
- */
424
- get: /**
425
- * Returns the offset style with a proper calculation on how much it should move
426
- * over the y axis of the total height
427
- * @return {?}
428
- */
429
- function () {
430
- return this._offsetTransform;
431
- },
432
- enumerable: true,
433
- configurable: true
434
- });
435
- Object.defineProperty(TdDataTableComponent.prototype, "totalHeight", {
436
- /**
437
- * Returns the assumed total height of the rows
438
- */
439
- get: /**
440
- * Returns the assumed total height of the rows
441
- * @return {?}
442
- */
443
- function () {
444
- return this._totalHeight;
445
- },
446
- enumerable: true,
447
- configurable: true
448
- });
449
- Object.defineProperty(TdDataTableComponent.prototype, "fromRow", {
450
- /**
451
- * Returns the initial row to render in the viewport
452
- */
453
- get: /**
454
- * Returns the initial row to render in the viewport
455
- * @return {?}
456
- */
457
- function () {
458
- return this._fromRow;
459
- },
460
- enumerable: true,
461
- configurable: true
462
- });
463
- Object.defineProperty(TdDataTableComponent.prototype, "toRow", {
464
- /**
465
- * Returns the last row to render in the viewport
466
- */
467
- get: /**
468
- * Returns the last row to render in the viewport
469
- * @return {?}
470
- */
471
- function () {
472
- return this._toRow;
473
- },
474
- enumerable: true,
475
- configurable: true
476
- });
477
- Object.defineProperty(TdDataTableComponent.prototype, "columnsLeftScroll", {
478
- /**
479
- * Returns scroll position to reposition column headers
480
- */
481
- get: /**
482
- * Returns scroll position to reposition column headers
483
- * @return {?}
484
- */
485
- function () {
486
- return this._scrollHorizontalOffset * -1;
487
- },
488
- enumerable: true,
489
- configurable: true
490
- });
491
- Object.defineProperty(TdDataTableComponent.prototype, "allSelected", {
492
- /**
493
- * Returns true if all values are selected.
494
- */
495
- get: /**
496
- * Returns true if all values are selected.
497
- * @return {?}
498
- */
499
- function () {
500
- return this._allSelected;
501
- },
502
- enumerable: true,
503
- configurable: true
504
- });
505
- Object.defineProperty(TdDataTableComponent.prototype, "indeterminate", {
506
- /**
507
- * Returns true if all values are not deselected
508
- * and at least one is.
509
- */
510
- get: /**
511
- * Returns true if all values are not deselected
512
- * and at least one is.
513
- * @return {?}
514
- */
515
- function () {
516
- return this._indeterminate;
517
- },
518
- enumerable: true,
519
- configurable: true
520
- });
521
- Object.defineProperty(TdDataTableComponent.prototype, "data", {
522
- get: /**
523
- * @return {?}
524
- */
525
- function () {
526
- return this._data;
527
- },
528
- /**
529
- * data?: {[key: string]: any}[]
530
- * Sets the data to be rendered as rows.
531
- */
532
- set: /**
533
- * data?: {[key: string]: any}[]
534
- * Sets the data to be rendered as rows.
535
- * @param {?} data
536
- * @return {?}
537
- */
538
- function (data) {
539
- var _this = this;
540
- this._data = data;
541
- this._rowHeightCache = [];
542
- Promise.resolve().then((/**
543
- * @return {?}
544
- */
545
- function () {
546
- _this.refresh();
547
- // scroll back to the top if the data has changed
548
- _this._scrollableDiv.nativeElement.scrollTop = 0;
549
- }));
550
- },
551
- enumerable: true,
552
- configurable: true
553
- });
554
- Object.defineProperty(TdDataTableComponent.prototype, "virtualData", {
555
- get: /**
556
- * @return {?}
557
- */
558
- function () {
559
- return this._virtualData;
560
- },
561
- enumerable: true,
562
- configurable: true
563
- });
564
- Object.defineProperty(TdDataTableComponent.prototype, "columns", {
565
- get: /**
566
- * @return {?}
567
- */
568
- function () {
569
- var _this = this;
570
- if (this._columns) {
571
- return this._columns;
572
- }
573
- if (this.hasData) {
574
- this._columns = [];
575
- // if columns is undefined, use key in [data] rows as name and label for column headers.
576
- /** @type {?} */
577
- var row = this._data[0];
578
- Object.keys(row).forEach((/**
579
- * @param {?} k
580
- * @return {?}
581
- */
582
- function (k) {
583
- if (!_this._columns.find((/**
584
- * @param {?} c
585
- * @return {?}
586
- */
587
- function (c) { return c.name === k; }))) {
588
- _this._columns.push({ name: k, label: k });
589
- }
590
- }));
591
- return this._columns;
592
- }
593
- else {
594
- return [];
595
- }
596
- },
597
- /**
598
- * columns?: ITdDataTableColumn[]
599
- * Sets additional column configuration. [ITdDataTableColumn.name] has to exist in [data] as key.
600
- * Defaults to [data] keys.
601
- */
602
- set: /**
603
- * columns?: ITdDataTableColumn[]
604
- * Sets additional column configuration. [ITdDataTableColumn.name] has to exist in [data] as key.
605
- * Defaults to [data] keys.
606
- * @param {?} cols
607
- * @return {?}
608
- */
609
- function (cols) {
610
- this._columns = cols;
611
- },
612
- enumerable: true,
613
- configurable: true
614
- });
615
- Object.defineProperty(TdDataTableComponent.prototype, "resizableColumns", {
616
- get: /**
617
- * @return {?}
618
- */
619
- function () {
620
- return this._resizableColumns;
621
- },
622
- /**
623
- * resizableColumns?: boolean
624
- * Enables manual column resize.
625
- * Defaults to 'false'
626
- */
627
- set: /**
628
- * resizableColumns?: boolean
629
- * Enables manual column resize.
630
- * Defaults to 'false'
631
- * @param {?} resizableColumns
632
- * @return {?}
633
- */
634
- function (resizableColumns) {
635
- this._resizableColumns = coerceBooleanProperty(resizableColumns);
636
- },
637
- enumerable: true,
638
- configurable: true
639
- });
640
- Object.defineProperty(TdDataTableComponent.prototype, "selectable", {
641
- get: /**
642
- * @return {?}
643
- */
644
- function () {
645
- return this._selectable;
646
- },
647
- /**
648
- * selectable?: boolean
649
- * Enables row selection events, hover and selected row states.
650
- * Defaults to 'false'
651
- */
652
- set: /**
653
- * selectable?: boolean
654
- * Enables row selection events, hover and selected row states.
655
- * Defaults to 'false'
656
- * @param {?} selectable
657
- * @return {?}
658
- */
659
- function (selectable) {
660
- this._selectable = coerceBooleanProperty(selectable);
661
- },
662
- enumerable: true,
663
- configurable: true
664
- });
665
- Object.defineProperty(TdDataTableComponent.prototype, "clickable", {
666
- get: /**
667
- * @return {?}
668
- */
669
- function () {
670
- return this._clickable;
671
- },
672
- /**
673
- * clickable?: boolean
674
- * Enables row click events, hover.
675
- * Defaults to 'false'
676
- */
677
- set: /**
678
- * clickable?: boolean
679
- * Enables row click events, hover.
680
- * Defaults to 'false'
681
- * @param {?} clickable
682
- * @return {?}
683
- */
684
- function (clickable) {
685
- this._clickable = coerceBooleanProperty(clickable);
686
- },
687
- enumerable: true,
688
- configurable: true
689
- });
690
- Object.defineProperty(TdDataTableComponent.prototype, "multiple", {
691
- get: /**
692
- * @return {?}
693
- */
694
- function () {
695
- return this._multiple;
696
- },
697
- /**
698
- * multiple?: boolean
699
- * Enables multiple row selection. [selectable] needs to be enabled.
700
- * Defaults to 'false'
701
- */
702
- set: /**
703
- * multiple?: boolean
704
- * Enables multiple row selection. [selectable] needs to be enabled.
705
- * Defaults to 'false'
706
- * @param {?} multiple
707
- * @return {?}
708
- */
709
- function (multiple) {
710
- this._multiple = coerceBooleanProperty(multiple);
711
- },
712
- enumerable: true,
713
- configurable: true
714
- });
715
- Object.defineProperty(TdDataTableComponent.prototype, "sortable", {
716
- get: /**
717
- * @return {?}
718
- */
719
- function () {
720
- return this._sortable;
721
- },
722
- /**
723
- * sortable?: boolean
724
- * Enables sorting events, sort icons and active column states.
725
- * Defaults to 'false'
726
- */
727
- set: /**
728
- * sortable?: boolean
729
- * Enables sorting events, sort icons and active column states.
730
- * Defaults to 'false'
731
- * @param {?} sortable
732
- * @return {?}
733
- */
734
- function (sortable) {
735
- this._sortable = coerceBooleanProperty(sortable);
736
- },
737
- enumerable: true,
738
- configurable: true
739
- });
740
- Object.defineProperty(TdDataTableComponent.prototype, "sortBy", {
741
- /**
742
- * sortBy?: string
743
- * Sets the active sort column. [sortable] needs to be enabled.
744
- */
745
- set: /**
746
- * sortBy?: string
747
- * Sets the active sort column. [sortable] needs to be enabled.
748
- * @param {?} columnName
749
- * @return {?}
750
- */
751
- function (columnName) {
752
- if (!columnName) {
753
- return;
754
- }
755
- /** @type {?} */
756
- var column = this.columns.find((/**
757
- * @param {?} c
758
- * @return {?}
759
- */
760
- function (c) { return c.name === columnName; }));
761
- if (!column) {
762
- throw new Error('[sortBy] must be a valid column name');
763
- }
764
- this._sortBy = column;
765
- },
766
- enumerable: true,
767
- configurable: true
768
- });
769
- Object.defineProperty(TdDataTableComponent.prototype, "sortByColumn", {
770
- get: /**
771
- * @return {?}
772
- */
773
- function () {
774
- return this._sortBy;
775
- },
776
- enumerable: true,
777
- configurable: true
778
- });
779
- Object.defineProperty(TdDataTableComponent.prototype, "sortOrder", {
780
- /**
781
- * sortOrder?: ['ASC' | 'DESC'] or TdDataTableSortingOrder
782
- * Sets the sort order of the [sortBy] column. [sortable] needs to be enabled.
783
- * Defaults to 'ASC' or TdDataTableSortingOrder.Ascending
784
- */
785
- set: /**
786
- * sortOrder?: ['ASC' | 'DESC'] or TdDataTableSortingOrder
787
- * Sets the sort order of the [sortBy] column. [sortable] needs to be enabled.
788
- * Defaults to 'ASC' or TdDataTableSortingOrder.Ascending
789
- * @param {?} order
790
- * @return {?}
791
- */
792
- function (order) {
793
- /** @type {?} */
794
- var sortOrder = order ? order.toUpperCase() : 'ASC';
795
- if (sortOrder !== 'DESC' && sortOrder !== 'ASC') {
796
- throw new Error('[sortOrder] must be empty, ASC or DESC');
797
- }
798
- this._sortOrder = sortOrder === 'ASC' ? TdDataTableSortingOrder.Ascending : TdDataTableSortingOrder.Descending;
799
- },
800
- enumerable: true,
801
- configurable: true
802
- });
803
- Object.defineProperty(TdDataTableComponent.prototype, "sortOrderEnum", {
804
- get: /**
805
- * @return {?}
806
- */
807
- function () {
808
- return this._sortOrder;
809
- },
810
- enumerable: true,
811
- configurable: true
812
- });
813
- Object.defineProperty(TdDataTableComponent.prototype, "hasData", {
814
- get: /**
815
- * @return {?}
816
- */
817
- function () {
818
- return this._data && this._data.length > 0;
819
- },
820
- enumerable: true,
821
- configurable: true
822
- });
823
- /**
824
- * Initialize observable for resize and scroll events
825
- */
826
- /**
827
- * Initialize observable for resize and scroll events
828
- * @return {?}
829
- */
830
- TdDataTableComponent.prototype.ngOnInit = /**
831
- * Initialize observable for resize and scroll events
832
- * @return {?}
833
- */
834
- function () {
835
- var _this = this;
836
- // initialize observable for resize calculations
837
- this._resizeSubs = this._onResize.asObservable().subscribe((/**
838
- * @return {?}
839
- */
840
- function () {
841
- if (_this._rows) {
842
- _this._rows.toArray().forEach((/**
843
- * @param {?} row
844
- * @param {?} index
845
- * @return {?}
846
- */
847
- function (row, index) {
848
- _this._rowHeightCache[_this.fromRow + index] = row.height + 1;
849
- }));
850
- }
851
- _this._calculateWidths();
852
- _this._calculateVirtualRows();
853
- }));
854
- // initialize observable for column resize calculations
855
- this._columnResizeSubs = this._onColumnResize
856
- .asObservable()
857
- .pipe(debounceTime(0))
858
- .subscribe((/**
859
- * @param {?} clientX
860
- * @return {?}
861
- */
862
- function (clientX) {
863
- _this._columnClientX = clientX;
864
- _this._calculateWidths();
865
- _this._changeDetectorRef.markForCheck();
866
- }));
867
- // initialize observable for scroll column header reposition
868
- this._horizontalScrollSubs = this._onHorizontalScroll.asObservable().subscribe((/**
869
- * @param {?} horizontalScroll
870
- * @return {?}
871
- */
872
- function (horizontalScroll) {
873
- _this._scrollHorizontalOffset = horizontalScroll;
874
- _this._changeDetectorRef.markForCheck();
875
- }));
876
- // initialize observable for virtual scroll rendering
877
- this._verticalScrollSubs = this._onVerticalScroll.asObservable().subscribe((/**
878
- * @param {?} verticalScroll
879
- * @return {?}
880
- */
881
- function (verticalScroll) {
882
- _this._scrollVerticalOffset = verticalScroll;
883
- _this._calculateVirtualRows();
884
- _this._changeDetectorRef.markForCheck();
885
- }));
886
- this._valueChangesSubs = this.valueChanges.subscribe((/**
887
- * @param {?} value
888
- * @return {?}
889
- */
890
- function (value) {
891
- _this.refresh();
892
- }));
893
- };
894
- /**
895
- * Loads templates and sets them in a map for faster access.
896
- */
897
- /**
898
- * Loads templates and sets them in a map for faster access.
899
- * @return {?}
900
- */
901
- TdDataTableComponent.prototype.ngAfterContentInit = /**
902
- * Loads templates and sets them in a map for faster access.
903
- * @return {?}
904
- */
905
- function () {
906
- var e_1, _a;
907
- try {
908
- for (var _b = __values(this._templates.toArray()), _c = _b.next(); !_c.done; _c = _b.next()) {
909
- var template = _c.value;
910
- this._templateMap.set(template.tdDataTableTemplate, template.templateRef);
911
- }
912
- }
913
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
914
- finally {
915
- try {
916
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
917
- }
918
- finally { if (e_1) throw e_1.error; }
919
- }
920
- };
921
- /**
922
- * Checks hosts native elements widths to see if it has changed (resize check)
923
- */
924
- /**
925
- * Checks hosts native elements widths to see if it has changed (resize check)
926
- * @return {?}
927
- */
928
- TdDataTableComponent.prototype.ngAfterContentChecked = /**
929
- * Checks hosts native elements widths to see if it has changed (resize check)
930
- * @return {?}
931
- */
932
- function () {
933
- var _this = this;
934
- // check if the scroll has been reset when element is hidden
935
- if (this._scrollVerticalOffset - this._scrollableDiv.nativeElement.scrollTop > 5) {
936
- // scroll back to the top if element has been reset
937
- this._onVerticalScroll.next(0);
938
- }
939
- if (this._elementRef.nativeElement) {
940
- /** @type {?} */
941
- var newHostWidth_1 = this._elementRef.nativeElement.getBoundingClientRect().width;
942
- // if the width has changed then we throw a resize event.
943
- if (this._hostWidth !== newHostWidth_1) {
944
- setTimeout((/**
945
- * @return {?}
946
- */
947
- function () {
948
- _this._hostWidth = newHostWidth_1;
949
- _this._onResize.next();
950
- }), 0);
951
- }
952
- }
953
- if (this._scrollableDiv.nativeElement) {
954
- /** @type {?} */
955
- var newHostHeight = this._scrollableDiv.nativeElement.getBoundingClientRect().height;
956
- // if the height of the viewport has changed, then we mark for check
957
- if (this._hostHeight !== newHostHeight) {
958
- this._hostHeight = newHostHeight;
959
- this._calculateVirtualRows();
960
- this._changeDetectorRef.markForCheck();
961
- }
962
- }
963
- };
964
- /**
965
- * Registers to an observable that checks if all rows have been rendered
966
- * so we can start calculating the widths
967
- */
968
- /**
969
- * Registers to an observable that checks if all rows have been rendered
970
- * so we can start calculating the widths
971
- * @return {?}
972
- */
973
- TdDataTableComponent.prototype.ngAfterViewInit = /**
974
- * Registers to an observable that checks if all rows have been rendered
975
- * so we can start calculating the widths
976
- * @return {?}
977
- */
978
- function () {
979
- var _this = this;
980
- this._rowsChangedSubs = this._rows.changes.pipe(debounceTime(0)).subscribe((/**
981
- * @return {?}
982
- */
983
- function () {
984
- _this._onResize.next();
985
- }));
986
- this._calculateVirtualRows();
987
- };
988
- /**
989
- * Unsubscribes observables when data table is destroyed
990
- */
991
- /**
992
- * Unsubscribes observables when data table is destroyed
993
- * @return {?}
994
- */
995
- TdDataTableComponent.prototype.ngOnDestroy = /**
996
- * Unsubscribes observables when data table is destroyed
997
- * @return {?}
998
- */
999
- function () {
1000
- if (this._resizeSubs) {
1001
- this._resizeSubs.unsubscribe();
1002
- }
1003
- if (this._columnResizeSubs) {
1004
- this._columnResizeSubs.unsubscribe();
1005
- }
1006
- if (this._horizontalScrollSubs) {
1007
- this._horizontalScrollSubs.unsubscribe();
1008
- }
1009
- if (this._verticalScrollSubs) {
1010
- this._verticalScrollSubs.unsubscribe();
1011
- }
1012
- if (this._rowsChangedSubs) {
1013
- this._rowsChangedSubs.unsubscribe();
1014
- }
1015
- if (this._valueChangesSubs) {
1016
- this._valueChangesSubs.unsubscribe();
1017
- }
1018
- };
1019
- /**
1020
- * Method that gets executed every time there is a scroll event
1021
- * Calls the scroll observable
1022
- */
1023
- /**
1024
- * Method that gets executed every time there is a scroll event
1025
- * Calls the scroll observable
1026
- * @param {?} event
1027
- * @return {?}
1028
- */
1029
- TdDataTableComponent.prototype.handleScroll = /**
1030
- * Method that gets executed every time there is a scroll event
1031
- * Calls the scroll observable
1032
- * @param {?} event
1033
- * @return {?}
1034
- */
1035
- function (event) {
1036
- /** @type {?} */
1037
- var element = (/** @type {?} */ (event.target));
1038
- if (element) {
1039
- /** @type {?} */
1040
- var horizontalScroll = element.scrollLeft;
1041
- if (this._scrollHorizontalOffset !== horizontalScroll) {
1042
- this._onHorizontalScroll.next(horizontalScroll);
1043
- }
1044
- /** @type {?} */
1045
- var verticalScroll = element.scrollTop;
1046
- if (this._scrollVerticalOffset !== verticalScroll) {
1047
- this._onVerticalScroll.next(verticalScroll);
1048
- }
1049
- }
1050
- };
1051
- /**
1052
- * Returns the width needed for the columns via index
1053
- */
1054
- /**
1055
- * Returns the width needed for the columns via index
1056
- * @param {?} index
1057
- * @return {?}
1058
- */
1059
- TdDataTableComponent.prototype.getColumnWidth = /**
1060
- * Returns the width needed for the columns via index
1061
- * @param {?} index
1062
- * @return {?}
1063
- */
1064
- function (index) {
1065
- if (this._widths[index]) {
1066
- return this._widths[index].value;
1067
- }
1068
- return undefined;
1069
- };
1070
- /**
1071
- * @param {?} column
1072
- * @param {?} value
1073
- * @return {?}
1074
- */
1075
- TdDataTableComponent.prototype.getCellValue = /**
1076
- * @param {?} column
1077
- * @param {?} value
1078
- * @return {?}
1079
- */
1080
- function (column, value) {
1081
- if (column.nested === undefined || column.nested) {
1082
- return this._getNestedValue(column.name, value);
1083
- }
1084
- return value[column.name];
1085
- };
1086
- /**
1087
- * Getter method for template references
1088
- */
1089
- /**
1090
- * Getter method for template references
1091
- * @param {?} name
1092
- * @return {?}
1093
- */
1094
- TdDataTableComponent.prototype.getTemplateRef = /**
1095
- * Getter method for template references
1096
- * @param {?} name
1097
- * @return {?}
1098
- */
1099
- function (name) {
1100
- return this._templateMap.get(name);
1101
- };
1102
- /**
1103
- * Clears model (ngModel) of component by removing all values in array.
1104
- */
1105
- /**
1106
- * Clears model (ngModel) of component by removing all values in array.
1107
- * @return {?}
1108
- */
1109
- TdDataTableComponent.prototype.clearModel = /**
1110
- * Clears model (ngModel) of component by removing all values in array.
1111
- * @return {?}
1112
- */
1113
- function () {
1114
- this.value.splice(0, this.value.length);
1115
- };
1116
- /**
1117
- * Refreshes data table and rerenders [data] and [columns]
1118
- */
1119
- /**
1120
- * Refreshes data table and rerenders [data] and [columns]
1121
- * @return {?}
1122
- */
1123
- TdDataTableComponent.prototype.refresh = /**
1124
- * Refreshes data table and rerenders [data] and [columns]
1125
- * @return {?}
1126
- */
1127
- function () {
1128
- this._calculateVirtualRows();
1129
- this._calculateWidths();
1130
- this._calculateCheckboxState();
1131
- this._changeDetectorRef.markForCheck();
1132
- };
1133
- /**
1134
- * Selects or clears all rows depending on 'checked' value.
1135
- */
1136
- /**
1137
- * Selects or clears all rows depending on 'checked' value.
1138
- * @param {?} checked
1139
- * @return {?}
1140
- */
1141
- TdDataTableComponent.prototype._selectAll = /**
1142
- * Selects or clears all rows depending on 'checked' value.
1143
- * @param {?} checked
1144
- * @return {?}
1145
- */
1146
- function (checked) {
1147
- var _this = this;
1148
- /** @type {?} */
1149
- var toggledRows = [];
1150
- if (checked) {
1151
- this._data.forEach((/**
1152
- * @param {?} row
1153
- * @return {?}
1154
- */
1155
- function (row) {
1156
- // skiping already selected rows
1157
- if (!_this.isRowSelected(row)) {
1158
- _this.value.push(row);
1159
- // checking which ones are being toggled
1160
- toggledRows.push(row);
1161
- }
1162
- }));
1163
- this._allSelected = true;
1164
- this._indeterminate = true;
1165
- }
1166
- else {
1167
- this._data.forEach((/**
1168
- * @param {?} row
1169
- * @return {?}
1170
- */
1171
- function (row) {
1172
- // checking which ones are being toggled
1173
- if (_this.isRowSelected(row)) {
1174
- toggledRows.push(row);
1175
- /** @type {?} */
1176
- var modelRow = _this.value.filter((/**
1177
- * @param {?} val
1178
- * @return {?}
1179
- */
1180
- function (val) {
1181
- return _this.compareWith(row, val);
1182
- }))[0];
1183
- /** @type {?} */
1184
- var index = _this.value.indexOf(modelRow);
1185
- if (index > -1) {
1186
- _this.value.splice(index, 1);
1187
- }
1188
- }
1189
- }));
1190
- this._allSelected = false;
1191
- this._indeterminate = false;
1192
- }
1193
- this.selectAll.emit({ rows: toggledRows, selected: checked });
1194
- this.onChange(this.value);
1195
- };
1196
- /**
1197
- * Checks if row is selected
1198
- */
1199
- /**
1200
- * Checks if row is selected
1201
- * @param {?} row
1202
- * @return {?}
1203
- */
1204
- TdDataTableComponent.prototype.isRowSelected = /**
1205
- * Checks if row is selected
1206
- * @param {?} row
1207
- * @return {?}
1208
- */
1209
- function (row) {
1210
- var _this = this;
1211
- // compare items by [compareWith] function
1212
- return this.value
1213
- ? this.value.filter((/**
1214
- * @param {?} val
1215
- * @return {?}
1216
- */
1217
- function (val) {
1218
- return _this.compareWith(row, val);
1219
- })).length > 0
1220
- : false;
1221
- };
1222
- /**
1223
- * Selects or clears a row depending on 'checked' value if the row 'isSelectable'
1224
- * handles cntrl clicks and shift clicks for multi-select
1225
- */
1226
- /**
1227
- * Selects or clears a row depending on 'checked' value if the row 'isSelectable'
1228
- * handles cntrl clicks and shift clicks for multi-select
1229
- * @param {?} row
1230
- * @param {?} event
1231
- * @param {?} currentSelected
1232
- * @return {?}
1233
- */
1234
- TdDataTableComponent.prototype.select = /**
1235
- * Selects or clears a row depending on 'checked' value if the row 'isSelectable'
1236
- * handles cntrl clicks and shift clicks for multi-select
1237
- * @param {?} row
1238
- * @param {?} event
1239
- * @param {?} currentSelected
1240
- * @return {?}
1241
- */
1242
- function (row, event, currentSelected) {
1243
- if (this.selectable) {
1244
- this.blockEvent(event);
1245
- // Check to see if Shift key is selected and need to select everything in between
1246
- /** @type {?} */
1247
- var mouseEvent = (/** @type {?} */ (event));
1248
- if (this.multiple && mouseEvent && mouseEvent.shiftKey && this._lastSelectedIndex > -1) {
1249
- /** @type {?} */
1250
- var firstIndex = currentSelected;
1251
- /** @type {?} */
1252
- var lastIndex = this._lastSelectedIndex;
1253
- if (currentSelected > this._lastSelectedIndex) {
1254
- firstIndex = this._lastSelectedIndex;
1255
- lastIndex = currentSelected;
1256
- }
1257
- // if clicking a checkbox behind the initial check, then toggle all selections expect the initial checkbox
1258
- // else the checkboxes clicked are all after the initial one
1259
- if ((this._firstSelectedIndex >= currentSelected && this._lastSelectedIndex > this._firstSelectedIndex) ||
1260
- (this._firstSelectedIndex <= currentSelected && this._lastSelectedIndex < this._firstSelectedIndex)) {
1261
- for (var i = firstIndex; i <= lastIndex; i++) {
1262
- if (this._firstSelectedIndex !== i) {
1263
- this._doSelection(this._data[i], i);
1264
- }
1265
- }
1266
- }
1267
- else if (this._firstSelectedIndex > currentSelected || this._firstSelectedIndex < currentSelected) {
1268
- // change indexes depending on where the next checkbox is selected (before or after)
1269
- if (this._firstSelectedIndex > currentSelected) {
1270
- lastIndex--;
1271
- }
1272
- else if (this._firstSelectedIndex < currentSelected) {
1273
- firstIndex++;
1274
- }
1275
- for (var i = firstIndex; i <= lastIndex; i++) {
1276
- /** @type {?} */
1277
- var rowSelected = this.isRowSelected(this._data[i]);
1278
- // if row is selected and first checkbox was selected
1279
- // or if row was unselected and first checkbox was unselected
1280
- // we ignore the toggle
1281
- if ((this._firstCheckboxValue && !rowSelected) || (!this._firstCheckboxValue && rowSelected)) {
1282
- this._doSelection(this._data[i], i);
1283
- }
1284
- else if (this._shiftPreviouslyPressed &&
1285
- ((currentSelected >= this._firstSelectedIndex && currentSelected <= this._lastSelectedIndex) ||
1286
- (currentSelected <= this._firstSelectedIndex && currentSelected >= this._lastSelectedIndex))) {
1287
- // else if the checkbox selected was in the middle of the last selection and the first selection
1288
- // then we undo the selections
1289
- this._doSelection(this._data[i], i);
1290
- }
1291
- }
1292
- }
1293
- this._shiftPreviouslyPressed = true;
1294
- // if shift wasnt pressed, then we take the element checked as the first row
1295
- // incase the next click uses shift
1296
- }
1297
- else if (mouseEvent && !mouseEvent.shiftKey) {
1298
- this._firstCheckboxValue = this._doSelection(row, currentSelected);
1299
- this._shiftPreviouslyPressed = false;
1300
- this._firstSelectedIndex = currentSelected;
1301
- }
1302
- this._lastSelectedIndex = currentSelected;
1303
- }
1304
- };
1305
- /**
1306
- * Overrides the onselectstart method of the document so other text on the page
1307
- * doesn't get selected when doing shift selections.
1308
- */
1309
- /**
1310
- * Overrides the onselectstart method of the document so other text on the page
1311
- * doesn't get selected when doing shift selections.
1312
- * @return {?}
1313
- */
1314
- TdDataTableComponent.prototype.disableTextSelection = /**
1315
- * Overrides the onselectstart method of the document so other text on the page
1316
- * doesn't get selected when doing shift selections.
1317
- * @return {?}
1318
- */
1319
- function () {
1320
- if (this._document) {
1321
- this._document.onselectstart = (/**
1322
- * @return {?}
1323
- */
1324
- function () {
1325
- return false;
1326
- });
1327
- }
1328
- };
1329
- /**
1330
- * Resets the original onselectstart method.
1331
- */
1332
- /**
1333
- * Resets the original onselectstart method.
1334
- * @return {?}
1335
- */
1336
- TdDataTableComponent.prototype.enableTextSelection = /**
1337
- * Resets the original onselectstart method.
1338
- * @return {?}
1339
- */
1340
- function () {
1341
- if (this._document) {
1342
- this._document.onselectstart = undefined;
1343
- }
1344
- };
1345
- /**
1346
- * emits the onRowClickEvent when a row is clicked
1347
- * if clickable is true and selectable is false then select the row
1348
- */
1349
- /**
1350
- * emits the onRowClickEvent when a row is clicked
1351
- * if clickable is true and selectable is false then select the row
1352
- * @param {?} row
1353
- * @param {?} index
1354
- * @param {?} event
1355
- * @return {?}
1356
- */
1357
- TdDataTableComponent.prototype.handleRowClick = /**
1358
- * emits the onRowClickEvent when a row is clicked
1359
- * if clickable is true and selectable is false then select the row
1360
- * @param {?} row
1361
- * @param {?} index
1362
- * @param {?} event
1363
- * @return {?}
1364
- */
1365
- function (row, index, event) {
1366
- if (this.clickable) {
1367
- // ignoring linting rules here because attribute it actually null or not there
1368
- // can't check for undefined
1369
- /** @type {?} */
1370
- var srcElement = event.srcElement || event.currentTarget;
1371
- /** @type {?} */
1372
- var element = (/** @type {?} */ (event.target));
1373
- /* tslint:disable-next-line */
1374
- if (srcElement.getAttribute('stopRowClick') === null && element.tagName.toLowerCase() !== 'mat-pseudo-checkbox') {
1375
- this.rowClick.emit({
1376
- row: row,
1377
- index: index,
1378
- });
1379
- }
1380
- }
1381
- };
1382
- /**
1383
- * Method handle for sort click event in column headers.
1384
- */
1385
- /**
1386
- * Method handle for sort click event in column headers.
1387
- * @param {?} column
1388
- * @return {?}
1389
- */
1390
- TdDataTableComponent.prototype.handleSort = /**
1391
- * Method handle for sort click event in column headers.
1392
- * @param {?} column
1393
- * @return {?}
1394
- */
1395
- function (column) {
1396
- if (this._sortBy === column) {
1397
- this._sortOrder =
1398
- this._sortOrder === TdDataTableSortingOrder.Ascending
1399
- ? TdDataTableSortingOrder.Descending
1400
- : TdDataTableSortingOrder.Ascending;
1401
- }
1402
- else {
1403
- this._sortBy = column;
1404
- this._sortOrder = TdDataTableSortingOrder.Ascending;
1405
- }
1406
- this.sortChange.next({ name: this._sortBy.name, order: this._sortOrder });
1407
- };
1408
- /**
1409
- * Handle all keyup events when focusing a data table row
1410
- */
1411
- /**
1412
- * Handle all keyup events when focusing a data table row
1413
- * @param {?} event
1414
- * @param {?} row
1415
- * @param {?} index
1416
- * @return {?}
1417
- */
1418
- TdDataTableComponent.prototype._rowKeyup = /**
1419
- * Handle all keyup events when focusing a data table row
1420
- * @param {?} event
1421
- * @param {?} row
1422
- * @param {?} index
1423
- * @return {?}
1424
- */
1425
- function (event, row, index) {
1426
- switch (event.keyCode) {
1427
- case ENTER:
1428
- case SPACE:
1429
- /** if user presses enter or space, the row should be selected */
1430
- if (this.selectable) {
1431
- this._doSelection(this._data[this.fromRow + index], this.fromRow + index);
1432
- }
1433
- break;
1434
- case UP_ARROW:
1435
- /**
1436
- * if users presses the up arrow, we focus the prev row
1437
- * unless its the first row
1438
- */
1439
- if (index > 0) {
1440
- this._rows.toArray()[index - 1].focus();
1441
- }
1442
- this.blockEvent(event);
1443
- if (this.selectable && this.multiple && event.shiftKey && this.fromRow + index >= 0) {
1444
- this._doSelection(this._data[this.fromRow + index], this.fromRow + index);
1445
- }
1446
- break;
1447
- case DOWN_ARROW:
1448
- /**
1449
- * if users presses the down arrow, we focus the next row
1450
- * unless its the last row
1451
- */
1452
- if (index < this._rows.toArray().length - 1) {
1453
- this._rows.toArray()[index + 1].focus();
1454
- }
1455
- this.blockEvent(event);
1456
- if (this.selectable && this.multiple && event.shiftKey && this.fromRow + index < this._data.length) {
1457
- this._doSelection(this._data[this.fromRow + index], this.fromRow + index);
1458
- }
1459
- break;
1460
- default:
1461
- // default
1462
- }
1463
- };
1464
- /**
1465
- * Sets column index of the dragged column and initial clientX of column
1466
- */
1467
- /**
1468
- * Sets column index of the dragged column and initial clientX of column
1469
- * @param {?} index
1470
- * @param {?} event
1471
- * @return {?}
1472
- */
1473
- TdDataTableComponent.prototype._handleStartColumnDrag = /**
1474
- * Sets column index of the dragged column and initial clientX of column
1475
- * @param {?} index
1476
- * @param {?} event
1477
- * @return {?}
1478
- */
1479
- function (index, event) {
1480
- this._columnClientX = event.clientX;
1481
- this._resizingColumn = index;
1482
- };
1483
- /**
1484
- * Calculates new width depending on new clientX of dragger column
1485
- */
1486
- /**
1487
- * Calculates new width depending on new clientX of dragger column
1488
- * @param {?} event
1489
- * @return {?}
1490
- */
1491
- TdDataTableComponent.prototype._handleColumnDrag = /**
1492
- * Calculates new width depending on new clientX of dragger column
1493
- * @param {?} event
1494
- * @return {?}
1495
- */
1496
- function (event) {
1497
- // check if there was been a separator clicked for resize
1498
- if (this._resizingColumn !== undefined && event.clientX > 0) {
1499
- /** @type {?} */
1500
- var xPosition = event.clientX;
1501
- // checks if the separator is being moved to try and resize the column, else dont do anything
1502
- if (xPosition > 0 && this._columnClientX > 0 && xPosition - this._columnClientX !== 0) {
1503
- // calculate the new width depending if making the column bigger or smaller
1504
- /** @type {?} */
1505
- var proposedManualWidth = this._widths[this._resizingColumn].value + (xPosition - this._columnClientX);
1506
- // if the proposed new width is less than the projected min width of the column, use projected min width
1507
- if (proposedManualWidth < this._colElements.toArray()[this._resizingColumn].projectedWidth) {
1508
- proposedManualWidth = this._colElements.toArray()[this._resizingColumn].projectedWidth;
1509
- }
1510
- this.columns[this._resizingColumn].width = proposedManualWidth;
1511
- // update new x position for the resized column
1512
- this._onColumnResize.next(xPosition);
1513
- }
1514
- }
1515
- };
1516
- /**
1517
- * Ends dragged flags
1518
- */
1519
- /**
1520
- * Ends dragged flags
1521
- * @return {?}
1522
- */
1523
- TdDataTableComponent.prototype._handleEndColumnDrag = /**
1524
- * Ends dragged flags
1525
- * @return {?}
1526
- */
1527
- function () {
1528
- this._columnClientX = undefined;
1529
- this._resizingColumn = undefined;
1530
- };
1531
- /**
1532
- * Method to prevent the default events
1533
- */
1534
- /**
1535
- * Method to prevent the default events
1536
- * @param {?} event
1537
- * @return {?}
1538
- */
1539
- TdDataTableComponent.prototype.blockEvent = /**
1540
- * Method to prevent the default events
1541
- * @param {?} event
1542
- * @return {?}
1543
- */
1544
- function (event) {
1545
- event.preventDefault();
1546
- };
1547
- /**
1548
- * @private
1549
- * @param {?} name
1550
- * @param {?} value
1551
- * @return {?}
1552
- */
1553
- TdDataTableComponent.prototype._getNestedValue = /**
1554
- * @private
1555
- * @param {?} name
1556
- * @param {?} value
1557
- * @return {?}
1558
- */
1559
- function (name, value) {
1560
- if (!(value instanceof Object) || !name) {
1561
- return value;
1562
- }
1563
- if (name.indexOf('.') > -1) {
1564
- /** @type {?} */
1565
- var splitName = name.split(/\.(.+)/, 2);
1566
- return this._getNestedValue(splitName[1], value[splitName[0]]);
1567
- }
1568
- else {
1569
- return value[name];
1570
- }
1571
- };
1572
- /**
1573
- * Does the actual Row Selection
1574
- */
1575
- /**
1576
- * Does the actual Row Selection
1577
- * @private
1578
- * @param {?} row
1579
- * @param {?} rowIndex
1580
- * @return {?}
1581
- */
1582
- TdDataTableComponent.prototype._doSelection = /**
1583
- * Does the actual Row Selection
1584
- * @private
1585
- * @param {?} row
1586
- * @param {?} rowIndex
1587
- * @return {?}
1588
- */
1589
- function (row, rowIndex) {
1590
- var _this = this;
1591
- /** @type {?} */
1592
- var wasSelected = this.isRowSelected(row);
1593
- if (!wasSelected) {
1594
- if (!this._multiple) {
1595
- this.clearModel();
1596
- }
1597
- this.value.push(row);
1598
- }
1599
- else {
1600
- // compare items by [compareWith] function
1601
- row = this.value.filter((/**
1602
- * @param {?} val
1603
- * @return {?}
1604
- */
1605
- function (val) {
1606
- return _this.compareWith(row, val);
1607
- }))[0];
1608
- /** @type {?} */
1609
- var index = this.value.indexOf(row);
1610
- if (index > -1) {
1611
- this.value.splice(index, 1);
1612
- }
1613
- }
1614
- this._calculateCheckboxState();
1615
- this.rowSelect.emit({ row: row, index: rowIndex, selected: !wasSelected });
1616
- this.onChange(this.value);
1617
- return !wasSelected;
1618
- };
1619
- /**
1620
- * Calculate all the state of all checkboxes
1621
- */
1622
- /**
1623
- * Calculate all the state of all checkboxes
1624
- * @private
1625
- * @return {?}
1626
- */
1627
- TdDataTableComponent.prototype._calculateCheckboxState = /**
1628
- * Calculate all the state of all checkboxes
1629
- * @private
1630
- * @return {?}
1631
- */
1632
- function () {
1633
- var e_2, _a;
1634
- var _this = this;
1635
- if (this._data) {
1636
- this._allSelected = typeof this._data.find((/**
1637
- * @param {?} d
1638
- * @return {?}
1639
- */
1640
- function (d) { return !_this.isRowSelected(d); })) === 'undefined';
1641
- this._indeterminate = false;
1642
- try {
1643
- for (var _b = __values(this._data), _c = _b.next(); !_c.done; _c = _b.next()) {
1644
- var row = _c.value;
1645
- if (!this.isRowSelected(row)) {
1646
- continue;
1647
- }
1648
- this._indeterminate = true;
1649
- break;
1650
- }
1651
- }
1652
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1653
- finally {
1654
- try {
1655
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1656
- }
1657
- finally { if (e_2) throw e_2.error; }
1658
- }
1659
- }
1660
- };
1661
- /**
1662
- * Calculates the widths for columns and cells depending on content
1663
- */
1664
- /**
1665
- * Calculates the widths for columns and cells depending on content
1666
- * @private
1667
- * @return {?}
1668
- */
1669
- TdDataTableComponent.prototype._calculateWidths = /**
1670
- * Calculates the widths for columns and cells depending on content
1671
- * @private
1672
- * @return {?}
1673
- */
1674
- function () {
1675
- var _this = this;
1676
- if (this._colElements && this._colElements.length) {
1677
- this._widths = [];
1678
- this._colElements.forEach((/**
1679
- * @param {?} col
1680
- * @param {?} index
1681
- * @return {?}
1682
- */
1683
- function (col, index) {
1684
- _this._adjustColumnWidth(index, _this._calculateWidth());
1685
- }));
1686
- this._adjustColumnWidhts();
1687
- this._changeDetectorRef.markForCheck();
1688
- }
1689
- };
1690
- /**
1691
- * Adjusts columns after calculation to see if they need to be recalculated.
1692
- */
1693
- /**
1694
- * Adjusts columns after calculation to see if they need to be recalculated.
1695
- * @private
1696
- * @return {?}
1697
- */
1698
- TdDataTableComponent.prototype._adjustColumnWidhts = /**
1699
- * Adjusts columns after calculation to see if they need to be recalculated.
1700
- * @private
1701
- * @return {?}
1702
- */
1703
- function () {
1704
- var _this = this;
1705
- /** @type {?} */
1706
- var fixedTotalWidth = 0;
1707
- // get the number of total columns that have flexible widths (not fixed or hidden)
1708
- /** @type {?} */
1709
- var flexibleWidths = this._widths.filter((/**
1710
- * @param {?} width
1711
- * @param {?} index
1712
- * @return {?}
1713
- */
1714
- function (width, index) {
1715
- if (_this.columns[index].hidden) {
1716
- return false;
1717
- }
1718
- if (width.limit || width.max || width.min) {
1719
- fixedTotalWidth += width.value;
1720
- }
1721
- return !width.limit && !width.max && !width.min;
1722
- })).length;
1723
- // calculate how much pixes are left that could be spread across
1724
- // the flexible columns
1725
- /** @type {?} */
1726
- var recalculateHostWidth = 0;
1727
- if (fixedTotalWidth < this.hostWidth) {
1728
- recalculateHostWidth = this.hostWidth - fixedTotalWidth;
1729
- }
1730
- // if we have flexible columns and pixels to spare on them
1731
- // we try and spread the pixels across them
1732
- if (flexibleWidths && recalculateHostWidth) {
1733
- /** @type {?} */
1734
- var newValue_1 = Math.floor(recalculateHostWidth / flexibleWidths);
1735
- /** @type {?} */
1736
- var adjustedNumber_1 = 0;
1737
- // adjust the column widths with the spread pixels
1738
- this._widths.forEach((/**
1739
- * @param {?} colWidth
1740
- * @return {?}
1741
- */
1742
- function (colWidth) {
1743
- if ((_this._widths[colWidth.index].max && _this._widths[colWidth.index].value > newValue_1) ||
1744
- (_this._widths[colWidth.index].min && _this._widths[colWidth.index].value < newValue_1) ||
1745
- !_this._widths[colWidth.index].limit) {
1746
- _this._adjustColumnWidth(colWidth.index, newValue_1);
1747
- adjustedNumber_1++;
1748
- }
1749
- }));
1750
- // if there are still columns that need to be recalculated, we start over
1751
- /** @type {?} */
1752
- var newFlexibleWidths = this._widths.filter((/**
1753
- * @param {?} width
1754
- * @return {?}
1755
- */
1756
- function (width) {
1757
- return !width.limit && !width.max;
1758
- })).length;
1759
- if (newFlexibleWidths !== adjustedNumber_1 && newFlexibleWidths !== flexibleWidths) {
1760
- this._adjustColumnWidhts();
1761
- }
1762
- }
1763
- };
1764
- /**
1765
- * Adjusts a single column to see if it can be recalculated
1766
- */
1767
- /**
1768
- * Adjusts a single column to see if it can be recalculated
1769
- * @private
1770
- * @param {?} index
1771
- * @param {?} value
1772
- * @return {?}
1773
- */
1774
- TdDataTableComponent.prototype._adjustColumnWidth = /**
1775
- * Adjusts a single column to see if it can be recalculated
1776
- * @private
1777
- * @param {?} index
1778
- * @param {?} value
1779
- * @return {?}
1780
- */
1781
- function (index, value) {
1782
- this._widths[index] = {
1783
- value: value,
1784
- index: index,
1785
- limit: false,
1786
- min: false,
1787
- max: false,
1788
- };
1789
- // flag to see if we need to skip the min width projection
1790
- // depending if a width or min width has been provided
1791
- /** @type {?} */
1792
- var skipMinWidthProjection = false;
1793
- if (this.columns[index]) {
1794
- // if the provided width has min/max, then we check to see if we need to set it
1795
- if (typeof this.columns[index].width === 'object') {
1796
- /** @type {?} */
1797
- var widthOpts = (/** @type {?} */ (this.columns[index].width));
1798
- // if the column width is less than the configured min, we override it
1799
- skipMinWidthProjection = widthOpts && !!widthOpts.min;
1800
- if (widthOpts && widthOpts.min >= this._widths[index].value) {
1801
- this._widths[index].value = widthOpts.min;
1802
- this._widths[index].min = true;
1803
- // if the column width is more than the configured max, we override it
1804
- }
1805
- else if (widthOpts && widthOpts.max <= this._widths[index].value) {
1806
- this._widths[index].value = widthOpts.max;
1807
- this._widths[index].max = true;
1808
- }
1809
- // if it has a fixed width, then we just set it
1810
- }
1811
- else if (typeof this.columns[index].width === 'number') {
1812
- this._widths[index].value = (/** @type {?} */ (this.columns[index].width));
1813
- skipMinWidthProjection = this._widths[index].limit = true;
1814
- }
1815
- }
1816
- // if there wasn't any width or min width provided, we set a min to what the column width min should be
1817
- if (!skipMinWidthProjection && this._widths[index].value < this._colElements.toArray()[index].projectedWidth) {
1818
- this._widths[index].value = this._colElements.toArray()[index].projectedWidth;
1819
- this._widths[index].min = true;
1820
- this._widths[index].limit = false;
1821
- }
1822
- };
1823
- /**
1824
- * Generic method to calculate column width
1825
- */
1826
- /**
1827
- * Generic method to calculate column width
1828
- * @private
1829
- * @return {?}
1830
- */
1831
- TdDataTableComponent.prototype._calculateWidth = /**
1832
- * Generic method to calculate column width
1833
- * @private
1834
- * @return {?}
1835
- */
1836
- function () {
1837
- /** @type {?} */
1838
- var renderedColumns = this.columns.filter((/**
1839
- * @param {?} col
1840
- * @return {?}
1841
- */
1842
- function (col) { return !col.hidden; }));
1843
- return Math.floor(this.hostWidth / renderedColumns.length);
1844
- };
1845
- /**
1846
- * Method to calculate the rows to be rendered in the viewport
1847
- */
1848
- /**
1849
- * Method to calculate the rows to be rendered in the viewport
1850
- * @private
1851
- * @return {?}
1852
- */
1853
- TdDataTableComponent.prototype._calculateVirtualRows = /**
1854
- * Method to calculate the rows to be rendered in the viewport
1855
- * @private
1856
- * @return {?}
1857
- */
1858
- function () {
1859
- var _this = this;
1860
- /** @type {?} */
1861
- var scrolledRows = 0;
1862
- if (this._data) {
1863
- this._totalHeight = 0;
1864
- /** @type {?} */
1865
- var rowHeightSum_1 = 0;
1866
- // loop through all rows to see if we have their height cached
1867
- // and sum them all to calculate the total height
1868
- this._data.forEach((/**
1869
- * @param {?} d
1870
- * @param {?} i
1871
- * @return {?}
1872
- */
1873
- function (d, i) {
1874
- // iterate through all rows at first and assume all
1875
- // rows are the same height as the first one
1876
- if (!_this._rowHeightCache[i]) {
1877
- _this._rowHeightCache[i] = _this._rowHeightCache[0] || TD_VIRTUAL_DEFAULT_ROW_HEIGHT;
1878
- }
1879
- rowHeightSum_1 += _this._rowHeightCache[i];
1880
- // check how many rows have been scrolled
1881
- if (_this._scrollVerticalOffset - rowHeightSum_1 > 0) {
1882
- scrolledRows++;
1883
- }
1884
- }));
1885
- this._totalHeight = rowHeightSum_1;
1886
- // set the initial row to be rendered taking into account the row offset
1887
- /** @type {?} */
1888
- var fromRow = scrolledRows - TD_VIRTUAL_OFFSET;
1889
- this._fromRow = fromRow > 0 ? fromRow : 0;
1890
- /** @type {?} */
1891
- var hostHeight = this._hostHeight;
1892
- /** @type {?} */
1893
- var index = 0;
1894
- // calculate how many rows can fit in the viewport
1895
- while (hostHeight > 0) {
1896
- hostHeight -= this._rowHeightCache[this.fromRow + index];
1897
- index++;
1898
- }
1899
- // set the last row to be rendered taking into account the row offset
1900
- /** @type {?} */
1901
- var range = index - 1 + TD_VIRTUAL_OFFSET * 2;
1902
- /** @type {?} */
1903
- var toRow = range + this.fromRow;
1904
- // if last row is greater than the total length, then we use the total length
1905
- if (isFinite(toRow) && toRow > this._data.length) {
1906
- toRow = this._data.length;
1907
- }
1908
- else if (!isFinite(toRow)) {
1909
- toRow = TD_VIRTUAL_OFFSET;
1910
- }
1911
- this._toRow = toRow;
1912
- }
1913
- else {
1914
- this._totalHeight = 0;
1915
- this._fromRow = 0;
1916
- this._toRow = 0;
1917
- }
1918
- /** @type {?} */
1919
- var offset = 0;
1920
- // calculate the proper offset depending on how many rows have been scrolled
1921
- if (scrolledRows > TD_VIRTUAL_OFFSET) {
1922
- for (var index = 0; index < this.fromRow; index++) {
1923
- offset += this._rowHeightCache[index];
1924
- }
1925
- }
1926
- this._offsetTransform = this._domSanitizer.bypassSecurityTrustStyle('translateY(' + (offset - this.totalHeight) + 'px)');
1927
- if (this._data) {
1928
- this._virtualData = this.data.slice(this.fromRow, this.toRow);
1929
- }
1930
- // mark for check at the end of the queue so we are sure
1931
- // that the changes will be marked
1932
- Promise.resolve().then((/**
1933
- * @return {?}
1934
- */
1935
- function () {
1936
- _this._changeDetectorRef.markForCheck();
1937
- }));
1938
- };
1939
- TdDataTableComponent.decorators = [
1940
- { type: Component, args: [{
1941
- providers: [
1942
- {
1943
- provide: NG_VALUE_ACCESSOR,
1944
- useExisting: forwardRef((/**
1945
- * @return {?}
1946
- */
1947
- function () { return TdDataTableComponent; })),
1948
- multi: true,
1949
- },
1950
- ],
1951
- selector: 'td-data-table',
1952
- template: "<table td-data-table [style.left.px]=\"columnsLeftScroll\" [class.mat-selectable]=\"selectable\">\n <thead class=\"td-data-table-head\" (dragover)=\"_handleColumnDrag($event)\">\n <tr td-data-table-column-row>\n <th td-data-table-column class=\"mat-checkbox-column\" *ngIf=\"selectable\">\n <mat-checkbox\n #checkBoxAll\n *ngIf=\"multiple\"\n [disabled]=\"!hasData\"\n [indeterminate]=\"indeterminate && !allSelected && hasData\"\n [checked]=\"allSelected && hasData\"\n (click)=\"blockEvent($event); _selectAll(!checkBoxAll.checked)\"\n (keyup.enter)=\"_selectAll(!checkBoxAll.checked)\"\n (keyup.space)=\"_selectAll(!checkBoxAll.checked)\"\n (keydown.space)=\"blockEvent($event)\"\n ></mat-checkbox>\n </th>\n <th\n td-data-table-column\n #columnElement\n *ngFor=\"let column of columns; let i = index; let last = last\"\n [style.min-width.px]=\"getColumnWidth(i)\"\n [style.max-width.px]=\"getColumnWidth(i)\"\n [name]=\"column.name\"\n [numeric]=\"column.numeric\"\n [active]=\"(column.sortable || sortable) && column === sortByColumn\"\n [sortable]=\"column.sortable || (sortable && column.sortable !== false)\"\n [sortOrder]=\"sortOrderEnum\"\n [hidden]=\"column.hidden\"\n [isColumnSortOrder]=\"!!column.columnSortOrder\"\n (sortChange)=\"handleSort(column)\"\n >\n <span [matTooltip]=\"column.tooltip\" [class]=\"column.columnSortOrder ? 'td-table-header-label' : ''\">\n {{ column.label }}\n <span *ngIf=\"column.columnSortOrder\" class=\"td-data-table-sort-badge\">\n {{ column.columnSortOrder || '' }}\n\n <span\n td-column-resizer\n *ngIf=\"resizableColumns\"\n draggable=\"true\"\n class=\"td-data-table-column-resizer\"\n [class.td-resizing]=\"i === resizingColumn\"\n (mousedown)=\"_handleStartColumnDrag(i, $event)\"\n (dragstart)=\"$event?.dataTransfer?.setData('text', '')\"\n (drag)=\"_handleColumnDrag($event)\"\n (dragend)=\"_handleEndColumnDrag()\"\n (mouseup)=\"_handleEndColumnDrag()\"\n >\n <span class=\"td-data-table-column-separator\"></span>\n </span>\n </span>\n </span>\n </th>\n </tr>\n </thead>\n</table>\n<div #scrollableDiv class=\"td-data-table-scrollable\" (scroll)=\"handleScroll($event)\">\n <div [style.height.px]=\"totalHeight\"></div>\n <table\n td-data-table\n [style.transform]=\"offsetTransform\"\n [style.position]=\"'absolute'\"\n [class.mat-selectable]=\"selectable\"\n [class.mat-clickable]=\"clickable\"\n >\n <tbody class=\"td-data-table-body\">\n <tr\n td-data-table-row\n #dtRow\n [tabIndex]=\"selectable ? 0 : -1\"\n [selected]=\"(clickable || selectable) && isRowSelected(row)\"\n *ngFor=\"let row of virtualData; let rowIndex = index\"\n (click)=\"handleRowClick(row, fromRow + rowIndex, $event)\"\n (keyup)=\"selectable && _rowKeyup($event, row, rowIndex)\"\n (keydown.space)=\"blockEvent($event)\"\n (keydown.shift.space)=\"blockEvent($event)\"\n (keydown.shift)=\"disableTextSelection()\"\n (keyup.shift)=\"enableTextSelection()\"\n >\n <td td-data-table-cell class=\"mat-checkbox-cell\" *ngIf=\"selectable\">\n <mat-pseudo-checkbox\n [state]=\"dtRow.selected ? 'checked' : 'unchecked'\"\n (mousedown)=\"disableTextSelection()\"\n (mouseup)=\"enableTextSelection()\"\n stopRowClick\n (click)=\"select(row, $event, fromRow + rowIndex)\"\n ></mat-pseudo-checkbox>\n </td>\n <td\n td-data-table-cell\n [numeric]=\"column.numeric\"\n [hidden]=\"column.hidden\"\n *ngFor=\"let column of columns; let i = index\"\n [style.min-width.px]=\"getColumnWidth(i)\"\n [style.max-width.px]=\"getColumnWidth(i)\"\n >\n <span *ngIf=\"!getTemplateRef(column.name)\">\n {{ column.format ? column.format(getCellValue(column, row)) : getCellValue(column, row) }}\n </span>\n <ng-template\n *ngIf=\"getTemplateRef(column.name)\"\n [ngTemplateOutlet]=\"getTemplateRef(column.name)\"\n [ngTemplateOutletContext]=\"{\n value: getCellValue(column, row),\n row: row,\n column: column.name,\n index: rowIndex\n }\"\n ></ng-template>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n<ng-content></ng-content>\n",
1953
- inputs: ['value'],
1954
- changeDetection: ChangeDetectionStrategy.OnPush,
1955
- styles: [".td-data-table-sort-badge{height:16px;width:16px;border-radius:50%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-left:4px}:host{display:block;overflow:hidden}:host .td-data-table-scrollable{position:relative;overflow:auto;height:calc(100% - 56px)}.td-table-header-label{display:-ms-flexbox;display:flex}.td-data-table-column-resizer{right:0;width:6px;cursor:col-resize}.td-data-table-column-resizer,.td-data-table-column-resizer .td-data-table-column-separator{position:absolute;height:100%;top:0}.td-data-table-column-resizer .td-data-table-column-separator{left:2px}.td-data-table-column-resizer.td-resizing{cursor:-webkit-grabbing}table.td-data-table{width:auto!important}table.td-data-table.mat-selectable tbody>tr.td-data-table-row{transition:background-color .2s}table.td-data-table.mat-selectable .td-data-table-column:first-child>.td-data-table-column-content-wrapper,table.td-data-table.mat-selectable td.td-data-table-cell:first-child>.td-data-table-column-content-wrapper,table.td-data-table.mat-selectable th.td-data-table-column:first-child>.td-data-table-column-content-wrapper{width:18px;min-width:18px;padding:0 24px}table.td-data-table.mat-selectable .td-data-table-column:nth-child(2)>.td-data-table-column-content-wrapper,table.td-data-table.mat-selectable td.td-data-table-cell:nth-child(2)>.td-data-table-column-content-wrapper,table.td-data-table.mat-selectable th.td-data-table-column:nth-child(2)>.td-data-table-column-content-wrapper{padding-left:0}[dir=rtl] table.td-data-table.mat-selectable .td-data-table-column:nth-child(2)>.td-data-table-column-content-wrapper,[dir=rtl] table.td-data-table.mat-selectable td.td-data-table-cell:nth-child(2)>.td-data-table-column-content-wrapper,[dir=rtl] table.td-data-table.mat-selectable th.td-data-table-column:nth-child(2)>.td-data-table-column-content-wrapper{padding-right:0;padding-left:28px}table.td-data-table td.mat-checkbox-cell,table.td-data-table th.mat-checkbox-column{min-width:42px;width:42px;font-size:0!important}table.td-data-table td.mat-checkbox-cell mat-pseudo-checkbox,table.td-data-table th.mat-checkbox-column mat-pseudo-checkbox{width:18px;height:18px}::ng-deep table.td-data-table td.mat-checkbox-cell mat-pseudo-checkbox.mat-pseudo-checkbox-checked::after,::ng-deep table.td-data-table th.mat-checkbox-column mat-pseudo-checkbox.mat-pseudo-checkbox-checked::after{width:11px!important;height:4px!important}table.td-data-table td.mat-checkbox-cell mat-checkbox ::ng-deep .mat-checkbox-inner-container,table.td-data-table th.mat-checkbox-column mat-checkbox ::ng-deep .mat-checkbox-inner-container{width:18px;height:18px;margin:0}"]
1956
- }] }
1957
- ];
1958
- /** @nocollapse */
1959
- TdDataTableComponent.ctorParameters = function () { return [
1960
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
1961
- { type: ElementRef },
1962
- { type: DomSanitizer },
1963
- { type: ChangeDetectorRef }
1964
- ]; };
1965
- TdDataTableComponent.propDecorators = {
1966
- _templates: [{ type: ContentChildren, args: [TdDataTableTemplateDirective, { descendants: true },] }],
1967
- _scrollableDiv: [{ type: ViewChild, args: ['scrollableDiv', { static: true },] }],
1968
- _colElements: [{ type: ViewChildren, args: ['columnElement',] }],
1969
- _rows: [{ type: ViewChildren, args: [TdDataTableRowComponent,] }],
1970
- data: [{ type: Input, args: ['data',] }],
1971
- columns: [{ type: Input, args: ['columns',] }],
1972
- resizableColumns: [{ type: Input, args: ['resizableColumns',] }],
1973
- selectable: [{ type: Input, args: ['selectable',] }],
1974
- clickable: [{ type: Input, args: ['clickable',] }],
1975
- multiple: [{ type: Input, args: ['multiple',] }],
1976
- sortable: [{ type: Input, args: ['sortable',] }],
1977
- sortBy: [{ type: Input, args: ['sortBy',] }],
1978
- sortOrder: [{ type: Input, args: ['sortOrder',] }],
1979
- sortChange: [{ type: Output }],
1980
- rowSelect: [{ type: Output }],
1981
- rowClick: [{ type: Output }],
1982
- selectAll: [{ type: Output }],
1983
- compareWith: [{ type: Input }]
1984
- };
1985
- return TdDataTableComponent;
1986
- }(_TdDataTableMixinBase));
1987
- if (false) {
1988
- /**
1989
- * responsive width calculations
1990
- * @type {?}
1991
- * @private
1992
- */
1993
- TdDataTableComponent.prototype._resizeSubs;
1994
- /**
1995
- * @type {?}
1996
- * @private
1997
- */
1998
- TdDataTableComponent.prototype._rowsChangedSubs;
1999
- /**
2000
- * @type {?}
2001
- * @private
2002
- */
2003
- TdDataTableComponent.prototype._hostWidth;
2004
- /**
2005
- * manually resizable columns
2006
- * @type {?}
2007
- * @private
2008
- */
2009
- TdDataTableComponent.prototype._resizableColumns;
2010
- /**
2011
- * @type {?}
2012
- * @private
2013
- */
2014
- TdDataTableComponent.prototype._columnClientX;
2015
- /**
2016
- * @type {?}
2017
- * @private
2018
- */
2019
- TdDataTableComponent.prototype._columnResizeSubs;
2020
- /**
2021
- * @type {?}
2022
- * @private
2023
- */
2024
- TdDataTableComponent.prototype._resizingColumn;
2025
- /**
2026
- * @type {?}
2027
- * @private
2028
- */
2029
- TdDataTableComponent.prototype._onColumnResize;
2030
- /**
2031
- * @type {?}
2032
- * @private
2033
- */
2034
- TdDataTableComponent.prototype._widths;
2035
- /**
2036
- * @type {?}
2037
- * @private
2038
- */
2039
- TdDataTableComponent.prototype._onResize;
2040
- /**
2041
- * column header reposition and viewpoort
2042
- * @type {?}
2043
- * @private
2044
- */
2045
- TdDataTableComponent.prototype._verticalScrollSubs;
2046
- /**
2047
- * @type {?}
2048
- * @private
2049
- */
2050
- TdDataTableComponent.prototype._horizontalScrollSubs;
2051
- /**
2052
- * @type {?}
2053
- * @private
2054
- */
2055
- TdDataTableComponent.prototype._scrollHorizontalOffset;
2056
- /**
2057
- * @type {?}
2058
- * @private
2059
- */
2060
- TdDataTableComponent.prototype._onHorizontalScroll;
2061
- /**
2062
- * @type {?}
2063
- * @private
2064
- */
2065
- TdDataTableComponent.prototype._onVerticalScroll;
2066
- /**
2067
- * @type {?}
2068
- * @private
2069
- */
2070
- TdDataTableComponent.prototype._rowHeightCache;
2071
- /**
2072
- * @type {?}
2073
- * @private
2074
- */
2075
- TdDataTableComponent.prototype._totalHeight;
2076
- /**
2077
- * @type {?}
2078
- * @private
2079
- */
2080
- TdDataTableComponent.prototype._hostHeight;
2081
- /**
2082
- * @type {?}
2083
- * @private
2084
- */
2085
- TdDataTableComponent.prototype._scrollVerticalOffset;
2086
- /**
2087
- * @type {?}
2088
- * @private
2089
- */
2090
- TdDataTableComponent.prototype._offsetTransform;
2091
- /**
2092
- * @type {?}
2093
- * @private
2094
- */
2095
- TdDataTableComponent.prototype._fromRow;
2096
- /**
2097
- * @type {?}
2098
- * @private
2099
- */
2100
- TdDataTableComponent.prototype._toRow;
2101
- /**
2102
- * @type {?}
2103
- * @private
2104
- */
2105
- TdDataTableComponent.prototype._valueChangesSubs;
2106
- /**
2107
- * internal attributes
2108
- * @type {?}
2109
- * @private
2110
- */
2111
- TdDataTableComponent.prototype._data;
2112
- /**
2113
- * @type {?}
2114
- * @private
2115
- */
2116
- TdDataTableComponent.prototype._virtualData;
2117
- /**
2118
- * @type {?}
2119
- * @private
2120
- */
2121
- TdDataTableComponent.prototype._columns;
2122
- /**
2123
- * @type {?}
2124
- * @private
2125
- */
2126
- TdDataTableComponent.prototype._selectable;
2127
- /**
2128
- * @type {?}
2129
- * @private
2130
- */
2131
- TdDataTableComponent.prototype._clickable;
2132
- /**
2133
- * @type {?}
2134
- * @private
2135
- */
2136
- TdDataTableComponent.prototype._multiple;
2137
- /**
2138
- * @type {?}
2139
- * @private
2140
- */
2141
- TdDataTableComponent.prototype._allSelected;
2142
- /**
2143
- * @type {?}
2144
- * @private
2145
- */
2146
- TdDataTableComponent.prototype._indeterminate;
2147
- /**
2148
- * sorting
2149
- * @type {?}
2150
- * @private
2151
- */
2152
- TdDataTableComponent.prototype._sortable;
2153
- /**
2154
- * @type {?}
2155
- * @private
2156
- */
2157
- TdDataTableComponent.prototype._sortBy;
2158
- /**
2159
- * @type {?}
2160
- * @private
2161
- */
2162
- TdDataTableComponent.prototype._sortOrder;
2163
- /**
2164
- * shift select
2165
- * @type {?}
2166
- * @private
2167
- */
2168
- TdDataTableComponent.prototype._shiftPreviouslyPressed;
2169
- /**
2170
- * @type {?}
2171
- * @private
2172
- */
2173
- TdDataTableComponent.prototype._lastSelectedIndex;
2174
- /**
2175
- * @type {?}
2176
- * @private
2177
- */
2178
- TdDataTableComponent.prototype._firstSelectedIndex;
2179
- /**
2180
- * @type {?}
2181
- * @private
2182
- */
2183
- TdDataTableComponent.prototype._firstCheckboxValue;
2184
- /**
2185
- * template fetching support
2186
- * @type {?}
2187
- * @private
2188
- */
2189
- TdDataTableComponent.prototype._templateMap;
2190
- /** @type {?} */
2191
- TdDataTableComponent.prototype._templates;
2192
- /** @type {?} */
2193
- TdDataTableComponent.prototype._scrollableDiv;
2194
- /** @type {?} */
2195
- TdDataTableComponent.prototype._colElements;
2196
- /** @type {?} */
2197
- TdDataTableComponent.prototype._rows;
2198
- /**
2199
- * sortChange?: function
2200
- * Event emitted when the column headers are clicked. [sortable] needs to be enabled.
2201
- * Emits an [ITdDataTableSortChangeEvent] implemented object.
2202
- * @type {?}
2203
- */
2204
- TdDataTableComponent.prototype.sortChange;
2205
- /**
2206
- * rowSelect?: function
2207
- * Event emitted when a row is selected/deselected. [selectable] needs to be enabled.
2208
- * Emits an [ITdDataTableSelectEvent] implemented object.
2209
- * @type {?}
2210
- */
2211
- TdDataTableComponent.prototype.rowSelect;
2212
- /**
2213
- * rowClick?: function
2214
- * Event emitted when a row is clicked.
2215
- * Emits an [ITdDataTableRowClickEvent] implemented object.
2216
- * @type {?}
2217
- */
2218
- TdDataTableComponent.prototype.rowClick;
2219
- /**
2220
- * selectAll?: function
2221
- * Event emitted when all rows are selected/deselected by the all checkbox. [selectable] needs to be enabled.
2222
- * Emits an [ITdDataTableSelectAllEvent] implemented object.
2223
- * @type {?}
2224
- */
2225
- TdDataTableComponent.prototype.selectAll;
2226
- /**
2227
- * compareWith?: function(row, model): boolean
2228
- * Allows custom comparison between row and model to see if row is selected or not
2229
- * Default comparation is by reference
2230
- * @type {?}
2231
- */
2232
- TdDataTableComponent.prototype.compareWith;
2233
- /**
2234
- * @type {?}
2235
- * @private
2236
- */
2237
- TdDataTableComponent.prototype._document;
2238
- /**
2239
- * @type {?}
2240
- * @private
2241
- */
2242
- TdDataTableComponent.prototype._elementRef;
2243
- /**
2244
- * @type {?}
2245
- * @private
2246
- */
2247
- TdDataTableComponent.prototype._domSanitizer;
2248
- }
2249
-
2250
- /**
2251
- * @fileoverview added by tsickle
2252
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2253
- */
2254
- /**
2255
- * @record
2256
- */
2257
- function ITdDataTableSortChangeEvent() { }
2258
- if (false) {
2259
- /** @type {?} */
2260
- ITdDataTableSortChangeEvent.prototype.order;
2261
- /** @type {?} */
2262
- ITdDataTableSortChangeEvent.prototype.name;
2263
- }
2264
- var TdDataTableColumnComponent = /** @class */ (function () {
2265
- function TdDataTableColumnComponent(_elementRef, _renderer) {
2266
- this._elementRef = _elementRef;
2267
- this._renderer = _renderer;
2268
- this._sortOrder = TdDataTableSortingOrder.Ascending;
2269
- /**
2270
- * name?: string
2271
- * Sets unique column [name] for [sortable] events.
2272
- */
2273
- this.name = '';
2274
- /**
2275
- * sortable?: boolean
2276
- * Enables sorting events, sort icons and active column states.
2277
- * Defaults to 'false'
2278
- */
2279
- this.sortable = false;
2280
- /**
2281
- * active?: boolean
2282
- * Sets column to active state when 'true'.
2283
- * Defaults to 'false'
2284
- */
2285
- this.active = false;
2286
- /**
2287
- * numeric?: boolean
2288
- * Makes column follow the numeric data-table specs and sort icon.
2289
- * Defaults to 'false'
2290
- */
2291
- this.numeric = false;
2292
- /**
2293
- * if column sort order is present
2294
- */
2295
- this.isColumnSortOrder = false;
2296
- /**
2297
- * sortChange?: function
2298
- * Event emitted when the column headers are clicked. [sortable] needs to be enabled.
2299
- * Emits an [ITdDataTableSortChangeEvent] implemented object.
2300
- */
2301
- this.sortChange = new EventEmitter();
2302
- this._renderer.addClass(this._elementRef.nativeElement, 'td-data-table-column');
2303
- }
2304
- Object.defineProperty(TdDataTableColumnComponent.prototype, "projectedWidth", {
2305
- get: /**
2306
- * @return {?}
2307
- */
2308
- function () {
2309
- if (this._columnContent && this._columnContent.nativeElement) {
2310
- return ((/** @type {?} */ (this._columnContent.nativeElement))).getBoundingClientRect().width;
2311
- }
2312
- return 100;
2313
- },
2314
- enumerable: true,
2315
- configurable: true
2316
- });
2317
- Object.defineProperty(TdDataTableColumnComponent.prototype, "sortOrder", {
2318
- /**
2319
- * sortOrder?: ['ASC' | 'DESC'] or TdDataTableSortingOrder
2320
- * Sets the sort order of column.
2321
- * Defaults to 'ASC' or TdDataTableSortingOrder.Ascending
2322
- */
2323
- set: /**
2324
- * sortOrder?: ['ASC' | 'DESC'] or TdDataTableSortingOrder
2325
- * Sets the sort order of column.
2326
- * Defaults to 'ASC' or TdDataTableSortingOrder.Ascending
2327
- * @param {?} order
2328
- * @return {?}
2329
- */
2330
- function (order) {
2331
- /** @type {?} */
2332
- var sortOrder = order ? order.toUpperCase() : 'ASC';
2333
- if (sortOrder !== 'DESC' && sortOrder !== 'ASC') {
2334
- throw new Error('[sortOrder] must be empty, ASC or DESC');
2335
- }
2336
- this._sortOrder = sortOrder === 'ASC' ? TdDataTableSortingOrder.Ascending : TdDataTableSortingOrder.Descending;
2337
- },
2338
- enumerable: true,
2339
- configurable: true
2340
- });
2341
- Object.defineProperty(TdDataTableColumnComponent.prototype, "bindClickable", {
2342
- get: /**
2343
- * @return {?}
2344
- */
2345
- function () {
2346
- return this.sortable;
2347
- },
2348
- enumerable: true,
2349
- configurable: true
2350
- });
2351
- Object.defineProperty(TdDataTableColumnComponent.prototype, "bingSortable", {
2352
- get: /**
2353
- * @return {?}
2354
- */
2355
- function () {
2356
- return this.sortable;
2357
- },
2358
- enumerable: true,
2359
- configurable: true
2360
- });
2361
- Object.defineProperty(TdDataTableColumnComponent.prototype, "bindActive", {
2362
- get: /**
2363
- * @return {?}
2364
- */
2365
- function () {
2366
- return this.active;
2367
- },
2368
- enumerable: true,
2369
- configurable: true
2370
- });
2371
- Object.defineProperty(TdDataTableColumnComponent.prototype, "bindNumeric", {
2372
- get: /**
2373
- * @return {?}
2374
- */
2375
- function () {
2376
- return this.numeric;
2377
- },
2378
- enumerable: true,
2379
- configurable: true
2380
- });
2381
- /**
2382
- * Listening to click event on host to throw a sort event
2383
- */
2384
- /**
2385
- * Listening to click event on host to throw a sort event
2386
- * @return {?}
2387
- */
2388
- TdDataTableColumnComponent.prototype.handleClick = /**
2389
- * Listening to click event on host to throw a sort event
2390
- * @return {?}
2391
- */
2392
- function () {
2393
- if (this.sortable) {
2394
- this.sortChange.emit({ name: this.name, order: this._sortOrder });
2395
- }
2396
- };
2397
- /**
2398
- * @return {?}
2399
- */
2400
- TdDataTableColumnComponent.prototype.isAscending = /**
2401
- * @return {?}
2402
- */
2403
- function () {
2404
- return this._sortOrder === TdDataTableSortingOrder.Ascending;
2405
- };
2406
- /**
2407
- * @return {?}
2408
- */
2409
- TdDataTableColumnComponent.prototype.isDescending = /**
2410
- * @return {?}
2411
- */
2412
- function () {
2413
- return this._sortOrder === TdDataTableSortingOrder.Descending;
2414
- };
2415
- TdDataTableColumnComponent.decorators = [
2416
- { type: Component, args: [{
2417
- /* tslint:disable-next-line */
2418
- selector: 'th[td-data-table-column]',
2419
- template: "<span #columnContent class=\"td-data-table-heading\">\n <mat-icon\n class=\"td-data-table-sort-icon\"\n *ngIf=\"sortable && numeric\"\n [class.mat-asc]=\"isAscending()\"\n [class.mat-desc]=\"isDescending()\"\n >\n arrow_upward\n </mat-icon>\n <span>\n <ng-content></ng-content>\n </span>\n <mat-icon\n class=\"td-data-table-sort-icon\"\n *ngIf=\"sortable && !numeric\"\n [class.mat-asc]=\"isAscending()\"\n [class.mat-desc]=\"isDescending()\"\n [class.display-numeric]=\"isColumnSortOrder\"\n >\n arrow_upward\n </mat-icon>\n</span>\n<ng-content select=\"[td-column-resizer]\"></ng-content>\n",
2420
- styles: [":host{white-space:nowrap;position:relative;padding:0;vertical-align:middle;text-align:left}:host>.td-data-table-heading{padding:0 28px}:host:first-child>.td-data-table-heading{padding-left:24px;padding-right:initial}html[dir=rtl] :host:first-child>.td-data-table-heading{padding-left:initial;unicode-bidi:embed;padding-right:24px;unicode-bidi:embed}body[dir=rtl] :host:first-child>.td-data-table-heading{padding-left:initial;unicode-bidi:embed;padding-right:24px;unicode-bidi:embed}[dir=rtl] :host:first-child>.td-data-table-heading{padding-left:initial;unicode-bidi:embed;padding-right:24px;unicode-bidi:embed}:host:first-child>.td-data-table-heading bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host:first-child>.td-data-table-heading bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host:last-child>.td-data-table-heading{padding-left:28px;padding-right:24px}html[dir=rtl] :host:last-child>.td-data-table-heading{padding-left:24px;unicode-bidi:embed;padding-right:28px;unicode-bidi:embed}body[dir=rtl] :host:last-child>.td-data-table-heading{padding-left:24px;unicode-bidi:embed;padding-right:28px;unicode-bidi:embed}[dir=rtl] :host:last-child>.td-data-table-heading{padding-left:24px;unicode-bidi:embed;padding-right:28px;unicode-bidi:embed}:host:last-child>.td-data-table-heading bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host:last-child>.td-data-table-heading bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host mat-icon{height:16px;width:16px;font-size:16px!important;line-height:16px!important}:host mat-icon.td-data-table-sort-icon{opacity:0;transition:transform .25s;position:absolute;top:0}:host mat-icon.td-data-table-sort-icon.display-numeric{right:0}:host mat-icon.td-data-table-sort-icon.mat-asc{-ms-transform:rotate(0);transform:rotate(0)}:host mat-icon.td-data-table-sort-icon.mat-desc{-ms-transform:rotate(180deg);transform:rotate(180deg)}:host.mat-active.mat-sortable mat-icon.td-data-table-sort-icon,:host:hover.mat-sortable mat-icon.td-data-table-sort-icon{opacity:1}html[dir=rtl] :host{text-align:right;unicode-bidi:embed}body[dir=rtl] :host{text-align:right;unicode-bidi:embed}[dir=rtl] :host{text-align:right;unicode-bidi:embed}:host bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host>*{vertical-align:middle}:host.mat-clickable{cursor:pointer}:host.mat-clickable:focus{outline:0}:host .td-data-table-heading{display:inline-block;position:relative}:host.mat-numeric{text-align:right}html[dir=rtl] :host.mat-numeric{text-align:left;unicode-bidi:embed}body[dir=rtl] :host.mat-numeric{text-align:left;unicode-bidi:embed}[dir=rtl] :host.mat-numeric{text-align:left;unicode-bidi:embed}:host.mat-numeric bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host.mat-numeric bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host.mat-numeric mat-icon.td-data-table-sort-icon{margin-left:-22px;margin-right:initial}html[dir=rtl] :host.mat-numeric mat-icon.td-data-table-sort-icon{margin-left:initial;unicode-bidi:embed;margin-right:-22px;unicode-bidi:embed}body[dir=rtl] :host.mat-numeric mat-icon.td-data-table-sort-icon{margin-left:initial;unicode-bidi:embed;margin-right:-22px;unicode-bidi:embed}[dir=rtl] :host.mat-numeric mat-icon.td-data-table-sort-icon{margin-left:initial;unicode-bidi:embed;margin-right:-22px;unicode-bidi:embed}:host.mat-numeric mat-icon.td-data-table-sort-icon bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host.mat-numeric mat-icon.td-data-table-sort-icon bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host:not(.mat-numeric) mat-icon.td-data-table-sort-icon{margin-left:6px;margin-right:initial}html[dir=rtl] :host:not(.mat-numeric) mat-icon.td-data-table-sort-icon{margin-left:initial;unicode-bidi:embed;margin-right:6px;unicode-bidi:embed}body[dir=rtl] :host:not(.mat-numeric) mat-icon.td-data-table-sort-icon{margin-left:initial;unicode-bidi:embed;margin-right:6px;unicode-bidi:embed}[dir=rtl] :host:not(.mat-numeric) mat-icon.td-data-table-sort-icon{margin-left:initial;unicode-bidi:embed;margin-right:6px;unicode-bidi:embed}:host:not(.mat-numeric) mat-icon.td-data-table-sort-icon bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host:not(.mat-numeric) mat-icon.td-data-table-sort-icon bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}"]
2421
- }] }
2422
- ];
2423
- /** @nocollapse */
2424
- TdDataTableColumnComponent.ctorParameters = function () { return [
2425
- { type: ElementRef },
2426
- { type: Renderer2 }
2427
- ]; };
2428
- TdDataTableColumnComponent.propDecorators = {
2429
- _columnContent: [{ type: ViewChild, args: ['columnContent', { read: ElementRef, static: true },] }],
2430
- name: [{ type: Input }],
2431
- sortable: [{ type: Input }],
2432
- active: [{ type: Input }],
2433
- numeric: [{ type: Input }],
2434
- isColumnSortOrder: [{ type: Input }],
2435
- sortOrder: [{ type: Input, args: ['sortOrder',] }],
2436
- sortChange: [{ type: Output }],
2437
- bindClickable: [{ type: HostBinding, args: ['class.mat-clickable',] }],
2438
- bingSortable: [{ type: HostBinding, args: ['class.mat-sortable',] }],
2439
- bindActive: [{ type: HostBinding, args: ['class.mat-active',] }],
2440
- bindNumeric: [{ type: HostBinding, args: ['class.mat-numeric',] }],
2441
- handleClick: [{ type: HostListener, args: ['click',] }]
2442
- };
2443
- return TdDataTableColumnComponent;
2444
- }());
2445
- if (false) {
2446
- /**
2447
- * @type {?}
2448
- * @private
2449
- */
2450
- TdDataTableColumnComponent.prototype._sortOrder;
2451
- /** @type {?} */
2452
- TdDataTableColumnComponent.prototype._columnContent;
2453
- /**
2454
- * name?: string
2455
- * Sets unique column [name] for [sortable] events.
2456
- * @type {?}
2457
- */
2458
- TdDataTableColumnComponent.prototype.name;
2459
- /**
2460
- * sortable?: boolean
2461
- * Enables sorting events, sort icons and active column states.
2462
- * Defaults to 'false'
2463
- * @type {?}
2464
- */
2465
- TdDataTableColumnComponent.prototype.sortable;
2466
- /**
2467
- * active?: boolean
2468
- * Sets column to active state when 'true'.
2469
- * Defaults to 'false'
2470
- * @type {?}
2471
- */
2472
- TdDataTableColumnComponent.prototype.active;
2473
- /**
2474
- * numeric?: boolean
2475
- * Makes column follow the numeric data-table specs and sort icon.
2476
- * Defaults to 'false'
2477
- * @type {?}
2478
- */
2479
- TdDataTableColumnComponent.prototype.numeric;
2480
- /**
2481
- * if column sort order is present
2482
- * @type {?}
2483
- */
2484
- TdDataTableColumnComponent.prototype.isColumnSortOrder;
2485
- /**
2486
- * sortChange?: function
2487
- * Event emitted when the column headers are clicked. [sortable] needs to be enabled.
2488
- * Emits an [ITdDataTableSortChangeEvent] implemented object.
2489
- * @type {?}
2490
- */
2491
- TdDataTableColumnComponent.prototype.sortChange;
2492
- /**
2493
- * @type {?}
2494
- * @private
2495
- */
2496
- TdDataTableColumnComponent.prototype._elementRef;
2497
- /**
2498
- * @type {?}
2499
- * @private
2500
- */
2501
- TdDataTableColumnComponent.prototype._renderer;
2502
- }
2503
-
2504
- /**
2505
- * @fileoverview added by tsickle
2506
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2507
- */
2508
- var TdDataTableCellComponent = /** @class */ (function () {
2509
- function TdDataTableCellComponent(_elementRef, _renderer) {
2510
- this._elementRef = _elementRef;
2511
- this._renderer = _renderer;
2512
- /**
2513
- * numeric?: boolean
2514
- * Makes cell follow the numeric data-table specs.
2515
- * Defaults to 'false'
2516
- */
2517
- this.numeric = false;
2518
- this._renderer.addClass(this._elementRef.nativeElement, 'td-data-table-cell');
2519
- }
2520
- Object.defineProperty(TdDataTableCellComponent.prototype, "align", {
2521
- get: /**
2522
- * @return {?}
2523
- */
2524
- function () {
2525
- return this._align;
2526
- },
2527
- /**
2528
- * align?: 'start' | 'center' | 'end'
2529
- * Makes cell content align on demand
2530
- * Defaults to 'left', overrides numeric
2531
- */
2532
- set: /**
2533
- * align?: 'start' | 'center' | 'end'
2534
- * Makes cell content align on demand
2535
- * Defaults to 'left', overrides numeric
2536
- * @param {?} align
2537
- * @return {?}
2538
- */
2539
- function (align) {
2540
- this._align = align;
2541
- },
2542
- enumerable: true,
2543
- configurable: true
2544
- });
2545
- Object.defineProperty(TdDataTableCellComponent.prototype, "bindNumeric", {
2546
- get: /**
2547
- * @return {?}
2548
- */
2549
- function () {
2550
- return this.numeric;
2551
- },
2552
- enumerable: true,
2553
- configurable: true
2554
- });
2555
- TdDataTableCellComponent.decorators = [
2556
- { type: Component, args: [{
2557
- /* tslint:disable-next-line */
2558
- selector: 'td[td-data-table-cell]',
2559
- template: "<div\n class=\"td-data-table-cell-content-wrapper\"\n [class.td-data-table-cell-numeric]=\"numeric\"\n [class.td-data-table-cell-align-center]=\"align === 'center'\"\n [class.td-data-table-cell-align-end]=\"align === 'end'\"\n [class.td-data-table-cell-align-start]=\"align === 'start'\"\n>\n <ng-content></ng-content>\n</div>\n",
2560
- styles: [":host{vertical-align:middle;text-align:left;padding:0}html[dir=rtl] :host{text-align:right;unicode-bidi:embed}body[dir=rtl] :host{text-align:right;unicode-bidi:embed}[dir=rtl] :host{text-align:right;unicode-bidi:embed}:host bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host>.td-data-table-cell-content-wrapper{padding:0 28px;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;max-width:100%;-ms-flex-pack:start;justify-content:flex-start}:host>.td-data-table-cell-content-wrapper.td-data-table-cell-numeric{-ms-flex-pack:end;justify-content:flex-end}:host>.td-data-table-cell-content-wrapper.td-data-table-cell-align-start{-ms-flex-pack:start;justify-content:flex-start}:host>.td-data-table-cell-content-wrapper.td-data-table-cell-align-end{-ms-flex-pack:end;justify-content:flex-end}:host>.td-data-table-cell-content-wrapper.td-data-table-cell-align-center{-ms-flex-pack:center;justify-content:center}:host:first-child>.td-data-table-cell-content-wrapper{padding-left:24px;padding-right:initial}html[dir=rtl] :host:first-child>.td-data-table-cell-content-wrapper{padding-left:initial;unicode-bidi:embed;padding-right:24px;unicode-bidi:embed}body[dir=rtl] :host:first-child>.td-data-table-cell-content-wrapper{padding-left:initial;unicode-bidi:embed;padding-right:24px;unicode-bidi:embed}[dir=rtl] :host:first-child>.td-data-table-cell-content-wrapper{padding-left:initial;unicode-bidi:embed;padding-right:24px;unicode-bidi:embed}:host:first-child>.td-data-table-cell-content-wrapper bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host:first-child>.td-data-table-cell-content-wrapper bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host:last-child>.td-data-table-cell-content-wrapper{padding-left:28px;padding-right:24px}html[dir=rtl] :host:last-child>.td-data-table-cell-content-wrapper{padding-left:24px;unicode-bidi:embed;padding-right:28px;unicode-bidi:embed}body[dir=rtl] :host:last-child>.td-data-table-cell-content-wrapper{padding-left:24px;unicode-bidi:embed;padding-right:28px;unicode-bidi:embed}[dir=rtl] :host:last-child>.td-data-table-cell-content-wrapper{padding-left:24px;unicode-bidi:embed;padding-right:28px;unicode-bidi:embed}:host:last-child>.td-data-table-cell-content-wrapper bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host:last-child>.td-data-table-cell-content-wrapper bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}:host>*{vertical-align:middle}:host.mat-clickable{cursor:pointer}:host.mat-clickable:focus{outline:0}:host.mat-numeric{text-align:right}html[dir=rtl] :host.mat-numeric{text-align:left;unicode-bidi:embed}body[dir=rtl] :host.mat-numeric{text-align:left;unicode-bidi:embed}[dir=rtl] :host.mat-numeric{text-align:left;unicode-bidi:embed}:host.mat-numeric bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}:host.mat-numeric bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}"]
2561
- }] }
2562
- ];
2563
- /** @nocollapse */
2564
- TdDataTableCellComponent.ctorParameters = function () { return [
2565
- { type: ElementRef },
2566
- { type: Renderer2 }
2567
- ]; };
2568
- TdDataTableCellComponent.propDecorators = {
2569
- numeric: [{ type: Input }],
2570
- align: [{ type: Input }],
2571
- bindNumeric: [{ type: HostBinding, args: ['class.mat-numeric',] }]
2572
- };
2573
- return TdDataTableCellComponent;
2574
- }());
2575
- if (false) {
2576
- /**
2577
- * @type {?}
2578
- * @private
2579
- */
2580
- TdDataTableCellComponent.prototype._align;
2581
- /**
2582
- * numeric?: boolean
2583
- * Makes cell follow the numeric data-table specs.
2584
- * Defaults to 'false'
2585
- * @type {?}
2586
- */
2587
- TdDataTableCellComponent.prototype.numeric;
2588
- /**
2589
- * @type {?}
2590
- * @private
2591
- */
2592
- TdDataTableCellComponent.prototype._elementRef;
2593
- /**
2594
- * @type {?}
2595
- * @private
2596
- */
2597
- TdDataTableCellComponent.prototype._renderer;
2598
- }
2599
-
2600
- /**
2601
- * @fileoverview added by tsickle
2602
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2603
- */
2604
- var TdDataTableTableComponent = /** @class */ (function () {
2605
- function TdDataTableTableComponent(_elementRef, _renderer) {
2606
- this._elementRef = _elementRef;
2607
- this._renderer = _renderer;
2608
- this._renderer.addClass(this._elementRef.nativeElement, 'td-data-table');
2609
- }
2610
- TdDataTableTableComponent.decorators = [
2611
- { type: Component, args: [{
2612
- /* tslint:disable-next-line */
2613
- selector: 'table[td-data-table]',
2614
- template: "<ng-content></ng-content>\n",
2615
- styles: [":host{width:100%;position:relative;border-spacing:0;overflow:hidden;border-collapse:collapse}"]
2616
- }] }
2617
- ];
2618
- /** @nocollapse */
2619
- TdDataTableTableComponent.ctorParameters = function () { return [
2620
- { type: ElementRef },
2621
- { type: Renderer2 }
2622
- ]; };
2623
- return TdDataTableTableComponent;
2624
- }());
2625
- if (false) {
2626
- /**
2627
- * @type {?}
2628
- * @private
2629
- */
2630
- TdDataTableTableComponent.prototype._elementRef;
2631
- /**
2632
- * @type {?}
2633
- * @private
2634
- */
2635
- TdDataTableTableComponent.prototype._renderer;
2636
- }
2637
-
2638
- /**
2639
- * @fileoverview added by tsickle
2640
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2641
- */
2642
- var TdDataTableService = /** @class */ (function () {
2643
- function TdDataTableService() {
2644
- }
2645
- /**
2646
- * params:
2647
- * - data: any[]
2648
- * - searchTerm: string
2649
- * - ignoreCase: boolean = false
2650
- * - excludedColumns: string[] = []
2651
- *
2652
- * Searches [data] parameter for [searchTerm] matches and returns a new array with them.
2653
- */
2654
- /**
2655
- * params:
2656
- * - data: any[]
2657
- * - searchTerm: string
2658
- * - ignoreCase: boolean = false
2659
- * - excludedColumns: string[] = []
2660
- *
2661
- * Searches [data] parameter for [searchTerm] matches and returns a new array with them.
2662
- * @param {?} data
2663
- * @param {?} searchTerm
2664
- * @param {?=} ignoreCase
2665
- * @param {?=} excludedColumns
2666
- * @return {?}
2667
- */
2668
- TdDataTableService.prototype.filterData = /**
2669
- * params:
2670
- * - data: any[]
2671
- * - searchTerm: string
2672
- * - ignoreCase: boolean = false
2673
- * - excludedColumns: string[] = []
2674
- *
2675
- * Searches [data] parameter for [searchTerm] matches and returns a new array with them.
2676
- * @param {?} data
2677
- * @param {?} searchTerm
2678
- * @param {?=} ignoreCase
2679
- * @param {?=} excludedColumns
2680
- * @return {?}
2681
- */
2682
- function (data, searchTerm, ignoreCase, excludedColumns) {
2683
- if (ignoreCase === void 0) { ignoreCase = false; }
2684
- /** @type {?} */
2685
- var filter = searchTerm ? (ignoreCase ? searchTerm.toLowerCase() : searchTerm) : '';
2686
- if (filter) {
2687
- data = data.filter((/**
2688
- * @param {?} item
2689
- * @return {?}
2690
- */
2691
- function (item) {
2692
- /** @type {?} */
2693
- var res = Object.keys(item).find((/**
2694
- * @param {?} key
2695
- * @return {?}
2696
- */
2697
- function (key) {
2698
- if (!excludedColumns || excludedColumns.indexOf(key) === -1) {
2699
- /** @type {?} */
2700
- var preItemValue = '' + item[key];
2701
- /** @type {?} */
2702
- var itemValue = ignoreCase ? preItemValue.toLowerCase() : preItemValue;
2703
- return itemValue.indexOf(filter) > -1;
2704
- }
2705
- }));
2706
- return typeof res !== 'undefined';
2707
- }));
2708
- }
2709
- return data;
2710
- };
2711
- /**
2712
- * params:
2713
- * - data: any[]
2714
- * - sortBy: string
2715
- * - sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending
2716
- *
2717
- * Sorts [data] parameter by [sortBy] and [sortOrder] and returns the sorted data.
2718
- */
2719
- /**
2720
- * params:
2721
- * - data: any[]
2722
- * - sortBy: string
2723
- * - sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending
2724
- *
2725
- * Sorts [data] parameter by [sortBy] and [sortOrder] and returns the sorted data.
2726
- * @param {?} data
2727
- * @param {?} sortBy
2728
- * @param {?=} sortOrder
2729
- * @return {?}
2730
- */
2731
- TdDataTableService.prototype.sortData = /**
2732
- * params:
2733
- * - data: any[]
2734
- * - sortBy: string
2735
- * - sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending
2736
- *
2737
- * Sorts [data] parameter by [sortBy] and [sortOrder] and returns the sorted data.
2738
- * @param {?} data
2739
- * @param {?} sortBy
2740
- * @param {?=} sortOrder
2741
- * @return {?}
2742
- */
2743
- function (data, sortBy, sortOrder) {
2744
- if (sortOrder === void 0) { sortOrder = TdDataTableSortingOrder.Ascending; }
2745
- if (sortBy) {
2746
- data = Array.from(data); // Change the array reference to trigger OnPush and not mutate original array
2747
- data.sort((/**
2748
- * @param {?} a
2749
- * @param {?} b
2750
- * @return {?}
2751
- */
2752
- function (a, b) {
2753
- /** @type {?} */
2754
- var compA = a[sortBy];
2755
- /** @type {?} */
2756
- var compB = b[sortBy];
2757
- /** @type {?} */
2758
- var direction = 0;
2759
- if (!Number.isNaN(Number.parseFloat(compA)) && !Number.isNaN(Number.parseFloat(compB))) {
2760
- direction = Number.parseFloat(compA) - Number.parseFloat(compB);
2761
- }
2762
- else {
2763
- if (compA < compB) {
2764
- direction = -1;
2765
- }
2766
- else if (compA > compB) {
2767
- direction = 1;
2768
- }
2769
- }
2770
- return direction * (sortOrder === TdDataTableSortingOrder.Descending ? -1 : 1);
2771
- }));
2772
- }
2773
- return data;
2774
- };
2775
- /**
2776
- * params:
2777
- * - data: any[]
2778
- * - fromRow: number
2779
- * - toRow: : number
2780
- *
2781
- * Returns a section of the [data] parameter starting from [fromRow] and ending in [toRow].
2782
- */
2783
- /**
2784
- * params:
2785
- * - data: any[]
2786
- * - fromRow: number
2787
- * - toRow: : number
2788
- *
2789
- * Returns a section of the [data] parameter starting from [fromRow] and ending in [toRow].
2790
- * @param {?} data
2791
- * @param {?} fromRow
2792
- * @param {?} toRow
2793
- * @return {?}
2794
- */
2795
- TdDataTableService.prototype.pageData = /**
2796
- * params:
2797
- * - data: any[]
2798
- * - fromRow: number
2799
- * - toRow: : number
2800
- *
2801
- * Returns a section of the [data] parameter starting from [fromRow] and ending in [toRow].
2802
- * @param {?} data
2803
- * @param {?} fromRow
2804
- * @param {?} toRow
2805
- * @return {?}
2806
- */
2807
- function (data, fromRow, toRow) {
2808
- if (fromRow >= 1) {
2809
- data = data.slice(fromRow - 1, toRow);
2810
- }
2811
- return data;
2812
- };
2813
- TdDataTableService.decorators = [
2814
- { type: Injectable }
2815
- ];
2816
- return TdDataTableService;
2817
- }());
2818
-
2819
- /**
2820
- * @fileoverview added by tsickle
2821
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2822
- */
2823
- /** @type {?} */
2824
- var TD_DATA_TABLE = [
2825
- TdDataTableComponent,
2826
- TdDataTableTemplateDirective,
2827
- TdDataTableColumnComponent,
2828
- TdDataTableCellComponent,
2829
- TdDataTableRowComponent,
2830
- TdDataTableColumnRowComponent,
2831
- TdDataTableTableComponent,
2832
- ];
2833
- var CovalentDataTableModule = /** @class */ (function () {
2834
- function CovalentDataTableModule() {
2835
- }
2836
- CovalentDataTableModule.decorators = [
2837
- { type: NgModule, args: [{
2838
- imports: [CommonModule, MatCheckboxModule, MatTooltipModule, MatIconModule, MatPseudoCheckboxModule],
2839
- declarations: [TD_DATA_TABLE],
2840
- exports: [TD_DATA_TABLE],
2841
- providers: [TdDataTableService],
2842
- },] }
2843
- ];
2844
- return CovalentDataTableModule;
2845
- }());
2846
-
2847
- /**
2848
- * @fileoverview added by tsickle
2849
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2850
- */
2851
-
2852
- /**
2853
- * @fileoverview added by tsickle
2854
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2855
- */
2856
-
2857
- /**
2858
- * @fileoverview added by tsickle
2859
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2860
- */
2861
-
2862
- export { CovalentDataTableModule, TdDataTableBase, TdDataTableCellComponent, TdDataTableColumnComponent, TdDataTableColumnRowComponent, TdDataTableComponent, TdDataTableRowComponent, TdDataTableService, TdDataTableSortingOrder, TdDataTableTableComponent, TdDataTableTemplateDirective, _TdDataTableMixinBase };
2863
- //# sourceMappingURL=covalent-core-data-table.js.map