@covalent/core 3.1.2-beta.4 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/bundles/covalent-core-side-sheet.umd.js +1458 -0
  2. package/bundles/covalent-core-side-sheet.umd.js.map +1 -0
  3. package/bundles/covalent-core-side-sheet.umd.min.js +16 -0
  4. package/bundles/covalent-core-side-sheet.umd.min.js.map +1 -0
  5. package/bundles/covalent-core-user-profile.umd.js +1 -9
  6. package/bundles/covalent-core-user-profile.umd.js.map +1 -1
  7. package/bundles/covalent-core-user-profile.umd.min.js.map +1 -1
  8. package/dialogs/_dialog-theme.scss +1 -0
  9. package/esm2015/side-sheet/covalent-core-side-sheet.js +12 -0
  10. package/esm2015/side-sheet/index.js +7 -0
  11. package/esm2015/side-sheet/public-api.js +11 -0
  12. package/esm2015/side-sheet/side-sheet-container.js +402 -0
  13. package/esm2015/side-sheet/side-sheet-ref.js +50 -0
  14. package/esm2015/side-sheet/side-sheet.animation.js +20 -0
  15. package/esm2015/side-sheet/side-sheet.config.js +12 -0
  16. package/esm2015/side-sheet/side-sheet.content-directives.js +255 -0
  17. package/esm2015/side-sheet/side-sheet.js +360 -0
  18. package/esm2015/side-sheet/side-sheet.module.js +36 -0
  19. package/esm2015/user-profile/user-profile.module.js +3 -11
  20. package/fesm2015/covalent-core-side-sheet.js +1134 -0
  21. package/fesm2015/covalent-core-side-sheet.js.map +1 -0
  22. package/fesm2015/covalent-core-user-profile.js +1 -9
  23. package/fesm2015/covalent-core-user-profile.js.map +1 -1
  24. package/package.json +1 -1
  25. package/schematics/components.js +1 -14
  26. package/schematics/components.js.map +1 -1
  27. package/side-sheet/README.md +66 -0
  28. package/side-sheet/covalent-core-side-sheet.d.ts +6 -0
  29. package/side-sheet/covalent-core-side-sheet.metadata.json +1 -0
  30. package/{chips → side-sheet}/index.d.ts +0 -0
  31. package/side-sheet/package.json +11 -0
  32. package/side-sheet/public-api.d.ts +5 -0
  33. package/side-sheet/side-sheet-container.d.ts +94 -0
  34. package/side-sheet/side-sheet-ref.d.ts +10 -0
  35. package/side-sheet/side-sheet.animation.d.ts +4 -0
  36. package/side-sheet/side-sheet.config.d.ts +3 -0
  37. package/side-sheet/side-sheet.content-directives.d.ts +50 -0
  38. package/side-sheet/side-sheet.d.ts +61 -0
  39. package/side-sheet/side-sheet.module.d.ts +2 -0
  40. package/side-sheet/side-sheet.scss +69 -0
  41. package/side-sheet/side-sheet.theme.scss +8 -0
  42. package/theming/_all-theme.scss +2 -14
  43. package/theming/prebuilt/blue-grey-deep-orange.css +5 -249
  44. package/theming/prebuilt/blue-grey-deep-orange.css.map +1 -1
  45. package/theming/prebuilt/blue-orange.css +5 -249
  46. package/theming/prebuilt/blue-orange.css.map +1 -1
  47. package/theming/prebuilt/indigo-pink.css +5 -249
  48. package/theming/prebuilt/indigo-pink.css.map +1 -1
  49. package/theming/prebuilt/orange-light-blue.css +5 -249
  50. package/theming/prebuilt/orange-light-blue.css.map +1 -1
  51. package/theming/prebuilt/teal-orange.css +5 -249
  52. package/theming/prebuilt/teal-orange.css.map +1 -1
  53. package/typography/_all-typography.scss +0 -10
  54. package/user-profile/covalent-core-user-profile.metadata.json +1 -1
  55. package/bundles/covalent-core-chips.umd.js +0 -1507
  56. package/bundles/covalent-core-chips.umd.js.map +0 -1
  57. package/bundles/covalent-core-chips.umd.min.js +0 -16
  58. package/bundles/covalent-core-chips.umd.min.js.map +0 -1
  59. package/bundles/covalent-core-data-table.umd.js +0 -2756
  60. package/bundles/covalent-core-data-table.umd.js.map +0 -1
  61. package/bundles/covalent-core-data-table.umd.min.js +0 -16
  62. package/bundles/covalent-core-data-table.umd.min.js.map +0 -1
  63. package/bundles/covalent-core-expansion-panel.umd.js +0 -853
  64. package/bundles/covalent-core-expansion-panel.umd.js.map +0 -1
  65. package/bundles/covalent-core-expansion-panel.umd.min.js +0 -16
  66. package/bundles/covalent-core-expansion-panel.umd.min.js.map +0 -1
  67. package/bundles/covalent-core-loading.umd.js +0 -1534
  68. package/bundles/covalent-core-loading.umd.js.map +0 -1
  69. package/bundles/covalent-core-loading.umd.min.js +0 -16
  70. package/bundles/covalent-core-loading.umd.min.js.map +0 -1
  71. package/bundles/covalent-core-media.umd.js +0 -749
  72. package/bundles/covalent-core-media.umd.js.map +0 -1
  73. package/bundles/covalent-core-media.umd.min.js +0 -16
  74. package/bundles/covalent-core-media.umd.min.js.map +0 -1
  75. package/bundles/covalent-core-nav-links.umd.js +0 -197
  76. package/bundles/covalent-core-nav-links.umd.js.map +0 -1
  77. package/bundles/covalent-core-nav-links.umd.min.js +0 -2
  78. package/bundles/covalent-core-nav-links.umd.min.js.map +0 -1
  79. package/bundles/covalent-core-notifications.umd.js +0 -275
  80. package/bundles/covalent-core-notifications.umd.js.map +0 -1
  81. package/bundles/covalent-core-notifications.umd.min.js +0 -2
  82. package/bundles/covalent-core-notifications.umd.min.js.map +0 -1
  83. package/bundles/covalent-core-paging.umd.js +0 -491
  84. package/bundles/covalent-core-paging.umd.js.map +0 -1
  85. package/bundles/covalent-core-paging.umd.min.js +0 -2
  86. package/bundles/covalent-core-paging.umd.min.js.map +0 -1
  87. package/bundles/covalent-core-sidesheet.umd.js +0 -145
  88. package/bundles/covalent-core-sidesheet.umd.js.map +0 -1
  89. package/bundles/covalent-core-sidesheet.umd.min.js +0 -2
  90. package/bundles/covalent-core-sidesheet.umd.min.js.map +0 -1
  91. package/bundles/covalent-core-steps.umd.js +0 -1756
  92. package/bundles/covalent-core-steps.umd.js.map +0 -1
  93. package/bundles/covalent-core-steps.umd.min.js +0 -16
  94. package/bundles/covalent-core-steps.umd.min.js.map +0 -1
  95. package/bundles/covalent-core-tab-select.umd.js +0 -732
  96. package/bundles/covalent-core-tab-select.umd.js.map +0 -1
  97. package/bundles/covalent-core-tab-select.umd.min.js +0 -16
  98. package/bundles/covalent-core-tab-select.umd.min.js.map +0 -1
  99. package/bundles/covalent-core-virtual-scroll.umd.js +0 -785
  100. package/bundles/covalent-core-virtual-scroll.umd.js.map +0 -1
  101. package/bundles/covalent-core-virtual-scroll.umd.min.js +0 -16
  102. package/bundles/covalent-core-virtual-scroll.umd.min.js.map +0 -1
  103. package/chips/README.md +0 -99
  104. package/chips/_chips-theme.scss +0 -87
  105. package/chips/chips.component.d.ts +0 -287
  106. package/chips/chips.component.scss +0 -147
  107. package/chips/chips.module.d.ts +0 -2
  108. package/chips/covalent-core-chips.d.ts +0 -4
  109. package/chips/covalent-core-chips.metadata.json +0 -1
  110. package/chips/package.json +0 -11
  111. package/chips/public-api.d.ts +0 -2
  112. package/data-table/README.md +0 -134
  113. package/data-table/_data-table-theme.scss +0 -115
  114. package/data-table/covalent-core-data-table.d.ts +0 -4
  115. package/data-table/covalent-core-data-table.metadata.json +0 -1
  116. package/data-table/data-table-cell/data-table-cell.component.d.ts +0 -22
  117. package/data-table/data-table-cell/data-table-cell.component.scss +0 -58
  118. package/data-table/data-table-column/data-table-column.component.d.ts +0 -63
  119. package/data-table/data-table-column/data-table-column.component.scss +0 -80
  120. package/data-table/data-table-row/data-table-row.component.d.ts +0 -20
  121. package/data-table/data-table-row/data-table-row.component.scss +0 -12
  122. package/data-table/data-table-table/data-table-table.component.d.ts +0 -6
  123. package/data-table/data-table-table/data-table-table.component.scss +0 -7
  124. package/data-table/data-table.component.d.ts +0 -356
  125. package/data-table/data-table.component.scss +0 -93
  126. package/data-table/data-table.module.d.ts +0 -2
  127. package/data-table/directives/data-table-template.directive.d.ts +0 -6
  128. package/data-table/index.d.ts +0 -1
  129. package/data-table/package.json +0 -11
  130. package/data-table/public-api.d.ts +0 -8
  131. package/data-table/services/data-table.service.d.ts +0 -31
  132. package/esm2015/chips/chips.component.js +0 -1115
  133. package/esm2015/chips/chips.module.js +0 -23
  134. package/esm2015/chips/covalent-core-chips.js +0 -10
  135. package/esm2015/chips/index.js +0 -7
  136. package/esm2015/chips/public-api.js +0 -8
  137. package/esm2015/data-table/covalent-core-data-table.js +0 -10
  138. package/esm2015/data-table/data-table-cell/data-table-cell.component.js +0 -88
  139. package/esm2015/data-table/data-table-column/data-table-column.component.js +0 -218
  140. package/esm2015/data-table/data-table-row/data-table-row.component.js +0 -132
  141. package/esm2015/data-table/data-table-table/data-table-table.component.js +0 -43
  142. package/esm2015/data-table/data-table.component.js +0 -1640
  143. package/esm2015/data-table/data-table.module.js +0 -39
  144. package/esm2015/data-table/directives/data-table-template.directive.js +0 -32
  145. package/esm2015/data-table/index.js +0 -7
  146. package/esm2015/data-table/public-api.js +0 -14
  147. package/esm2015/data-table/services/data-table.service.js +0 -116
  148. package/esm2015/expansion-panel/covalent-core-expansion-panel.js +0 -10
  149. package/esm2015/expansion-panel/expansion-panel-group.component.js +0 -212
  150. package/esm2015/expansion-panel/expansion-panel.component.js +0 -272
  151. package/esm2015/expansion-panel/expansion-panel.module.js +0 -31
  152. package/esm2015/expansion-panel/index.js +0 -7
  153. package/esm2015/expansion-panel/public-api.js +0 -9
  154. package/esm2015/loading/covalent-core-loading.js +0 -10
  155. package/esm2015/loading/directives/loading.directive.js +0 -231
  156. package/esm2015/loading/index.js +0 -7
  157. package/esm2015/loading/loading.component.js +0 -302
  158. package/esm2015/loading/loading.module.js +0 -30
  159. package/esm2015/loading/public-api.js +0 -11
  160. package/esm2015/loading/services/loading.factory.js +0 -297
  161. package/esm2015/loading/services/loading.service.js +0 -319
  162. package/esm2015/media/covalent-core-media.js +0 -10
  163. package/esm2015/media/directives/media-toggle.directive.js +0 -207
  164. package/esm2015/media/index.js +0 -7
  165. package/esm2015/media/media.module.js +0 -20
  166. package/esm2015/media/public-api.js +0 -9
  167. package/esm2015/media/services/media.service.js +0 -169
  168. package/esm2015/nav-links/covalent-core-nav-links.js +0 -10
  169. package/esm2015/nav-links/index.js +0 -7
  170. package/esm2015/nav-links/nav-links.component.js +0 -138
  171. package/esm2015/nav-links/nav-links.module.js +0 -37
  172. package/esm2015/nav-links/public-api.js +0 -8
  173. package/esm2015/notifications/covalent-core-notifications.js +0 -10
  174. package/esm2015/notifications/index.js +0 -7
  175. package/esm2015/notifications/notification-count.component.js +0 -191
  176. package/esm2015/notifications/notifications.module.js +0 -20
  177. package/esm2015/notifications/public-api.js +0 -8
  178. package/esm2015/paging/covalent-core-paging.js +0 -10
  179. package/esm2015/paging/index.js +0 -7
  180. package/esm2015/paging/paging-bar.component.js +0 -412
  181. package/esm2015/paging/paging.module.js +0 -20
  182. package/esm2015/paging/public-api.js +0 -8
  183. package/esm2015/sidesheet/covalent-core-sidesheet.js +0 -10
  184. package/esm2015/sidesheet/index.js +0 -7
  185. package/esm2015/sidesheet/public-api.js +0 -8
  186. package/esm2015/sidesheet/sidesheet.component.js +0 -72
  187. package/esm2015/sidesheet/sidesheet.module.js +0 -27
  188. package/esm2015/steps/covalent-core-steps.js +0 -10
  189. package/esm2015/steps/index.js +0 -7
  190. package/esm2015/steps/nav/nav-step-link/nav-step-link.component.js +0 -144
  191. package/esm2015/steps/nav/nav-steps-horizontal/nav-steps-horizontal.component.js +0 -371
  192. package/esm2015/steps/nav/nav-steps-vertical/nav-steps-vertical.component.js +0 -130
  193. package/esm2015/steps/public-api.js +0 -14
  194. package/esm2015/steps/step-body/step-body.component.js +0 -83
  195. package/esm2015/steps/step-header/step-header.component.js +0 -79
  196. package/esm2015/steps/step.component.js +0 -312
  197. package/esm2015/steps/steps.component.js +0 -234
  198. package/esm2015/steps/steps.module.js +0 -44
  199. package/esm2015/tab-select/covalent-core-tab-select.js +0 -10
  200. package/esm2015/tab-select/index.js +0 -7
  201. package/esm2015/tab-select/public-api.js +0 -9
  202. package/esm2015/tab-select/tab-option.component.js +0 -82
  203. package/esm2015/tab-select/tab-select.component.js +0 -291
  204. package/esm2015/tab-select/tab-select.module.js +0 -31
  205. package/esm2015/virtual-scroll/covalent-core-virtual-scroll.js +0 -10
  206. package/esm2015/virtual-scroll/index.js +0 -7
  207. package/esm2015/virtual-scroll/public-api.js +0 -9
  208. package/esm2015/virtual-scroll/virtual-scroll-container.component.js +0 -391
  209. package/esm2015/virtual-scroll/virtual-scroll-row.directive.js +0 -25
  210. package/esm2015/virtual-scroll/virtual-scroll.module.js +0 -21
  211. package/expansion-panel/README.md +0 -116
  212. package/expansion-panel/_expansion-panel-theme.scss +0 -80
  213. package/expansion-panel/covalent-core-expansion-panel.d.ts +0 -4
  214. package/expansion-panel/covalent-core-expansion-panel.metadata.json +0 -1
  215. package/expansion-panel/expansion-panel-group.component.d.ts +0 -31
  216. package/expansion-panel/expansion-panel-group.component.scss +0 -0
  217. package/expansion-panel/expansion-panel.component.d.ts +0 -82
  218. package/expansion-panel/expansion-panel.component.scss +0 -50
  219. package/expansion-panel/expansion-panel.module.d.ts +0 -2
  220. package/expansion-panel/index.d.ts +0 -1
  221. package/expansion-panel/package.json +0 -11
  222. package/expansion-panel/public-api.d.ts +0 -3
  223. package/fesm2015/covalent-core-chips.js +0 -1151
  224. package/fesm2015/covalent-core-chips.js.map +0 -1
  225. package/fesm2015/covalent-core-data-table.js +0 -2309
  226. package/fesm2015/covalent-core-data-table.js.map +0 -1
  227. package/fesm2015/covalent-core-expansion-panel.js +0 -528
  228. package/fesm2015/covalent-core-expansion-panel.js.map +0 -1
  229. package/fesm2015/covalent-core-loading.js +0 -1179
  230. package/fesm2015/covalent-core-loading.js.map +0 -1
  231. package/fesm2015/covalent-core-media.js +0 -411
  232. package/fesm2015/covalent-core-media.js.map +0 -1
  233. package/fesm2015/covalent-core-nav-links.js +0 -193
  234. package/fesm2015/covalent-core-nav-links.js.map +0 -1
  235. package/fesm2015/covalent-core-notifications.js +0 -228
  236. package/fesm2015/covalent-core-notifications.js.map +0 -1
  237. package/fesm2015/covalent-core-paging.js +0 -451
  238. package/fesm2015/covalent-core-paging.js.map +0 -1
  239. package/fesm2015/covalent-core-sidesheet.js +0 -118
  240. package/fesm2015/covalent-core-sidesheet.js.map +0 -1
  241. package/fesm2015/covalent-core-steps.js +0 -1384
  242. package/fesm2015/covalent-core-steps.js.map +0 -1
  243. package/fesm2015/covalent-core-tab-select.js +0 -416
  244. package/fesm2015/covalent-core-tab-select.js.map +0 -1
  245. package/fesm2015/covalent-core-virtual-scroll.js +0 -453
  246. package/fesm2015/covalent-core-virtual-scroll.js.map +0 -1
  247. package/loading/README.md +0 -180
  248. package/loading/_loading-theme.scss +0 -10
  249. package/loading/covalent-core-loading.d.ts +0 -4
  250. package/loading/covalent-core-loading.metadata.json +0 -1
  251. package/loading/directives/loading.directive.d.ts +0 -71
  252. package/loading/index.d.ts +0 -1
  253. package/loading/loading.component.d.ts +0 -87
  254. package/loading/loading.component.scss +0 -42
  255. package/loading/loading.module.d.ts +0 -2
  256. package/loading/package.json +0 -11
  257. package/loading/public-api.d.ts +0 -5
  258. package/loading/services/loading.factory.d.ts +0 -66
  259. package/loading/services/loading.service.d.ts +0 -118
  260. package/media/covalent-core-media.d.ts +0 -4
  261. package/media/covalent-core-media.metadata.json +0 -1
  262. package/media/directives/media-toggle.directive.d.ts +0 -42
  263. package/media/index.d.ts +0 -1
  264. package/media/media.module.d.ts +0 -2
  265. package/media/package.json +0 -11
  266. package/media/public-api.d.ts +0 -3
  267. package/media/services/media.service.d.ts +0 -31
  268. package/nav-links/README.md +0 -1
  269. package/nav-links/covalent-core-nav-links.d.ts +0 -4
  270. package/nav-links/covalent-core-nav-links.metadata.json +0 -1
  271. package/nav-links/index.d.ts +0 -1
  272. package/nav-links/nav-links.component.d.ts +0 -51
  273. package/nav-links/nav-links.component.scss +0 -15
  274. package/nav-links/nav-links.module.d.ts +0 -2
  275. package/nav-links/package.json +0 -11
  276. package/nav-links/public-api.d.ts +0 -2
  277. package/notifications/README.md +0 -69
  278. package/notifications/_notification-count-theme.scss +0 -27
  279. package/notifications/covalent-core-notifications.d.ts +0 -4
  280. package/notifications/covalent-core-notifications.metadata.json +0 -1
  281. package/notifications/index.d.ts +0 -1
  282. package/notifications/notification-count.component.d.ts +0 -74
  283. package/notifications/notification-count.component.scss +0 -90
  284. package/notifications/notifications.module.d.ts +0 -2
  285. package/notifications/package.json +0 -11
  286. package/notifications/public-api.d.ts +0 -2
  287. package/paging/README.md +0 -141
  288. package/paging/_paging-bar-theme.scss +0 -26
  289. package/paging/covalent-core-paging.d.ts +0 -4
  290. package/paging/covalent-core-paging.metadata.json +0 -1
  291. package/paging/index.d.ts +0 -1
  292. package/paging/package.json +0 -11
  293. package/paging/paging-bar.component.d.ts +0 -115
  294. package/paging/paging-bar.component.scss +0 -23
  295. package/paging/paging.module.d.ts +0 -2
  296. package/paging/public-api.d.ts +0 -2
  297. package/sidesheet/README.md +0 -68
  298. package/sidesheet/covalent-core-sidesheet.d.ts +0 -4
  299. package/sidesheet/covalent-core-sidesheet.metadata.json +0 -1
  300. package/sidesheet/index.d.ts +0 -1
  301. package/sidesheet/package.json +0 -11
  302. package/sidesheet/public-api.d.ts +0 -2
  303. package/sidesheet/sidesheet.component.d.ts +0 -13
  304. package/sidesheet/sidesheet.component.scss +0 -101
  305. package/sidesheet/sidesheet.module.d.ts +0 -2
  306. package/steps/README.md +0 -159
  307. package/steps/_steps-theme.scss +0 -108
  308. package/steps/covalent-core-steps.d.ts +0 -4
  309. package/steps/covalent-core-steps.metadata.json +0 -1
  310. package/steps/index.d.ts +0 -1
  311. package/steps/nav/README.md +0 -90
  312. package/steps/nav/nav-step-link/nav-step-link.component.d.ts +0 -42
  313. package/steps/nav/nav-step-link/nav-step-link.component.scss +0 -17
  314. package/steps/nav/nav-steps-horizontal/nav-steps-horizontal.component.d.ts +0 -79
  315. package/steps/nav/nav-steps-horizontal/nav-steps-horizontal.component.scss +0 -83
  316. package/steps/nav/nav-steps-vertical/nav-steps-vertical.component.d.ts +0 -18
  317. package/steps/nav/nav-steps-vertical/nav-steps-vertical.component.scss +0 -18
  318. package/steps/package.json +0 -11
  319. package/steps/public-api.d.ts +0 -8
  320. package/steps/step-body/step-body.component.d.ts +0 -25
  321. package/steps/step-body/step-body.component.scss +0 -29
  322. package/steps/step-header/step-header.component.d.ts +0 -35
  323. package/steps/step-header/step-header.component.scss +0 -90
  324. package/steps/step.component.d.ts +0 -97
  325. package/steps/steps.component.d.ts +0 -60
  326. package/steps/steps.component.scss +0 -55
  327. package/steps/steps.module.d.ts +0 -2
  328. package/tab-select/README.md +0 -93
  329. package/tab-select/covalent-core-tab-select.d.ts +0 -4
  330. package/tab-select/covalent-core-tab-select.metadata.json +0 -1
  331. package/tab-select/index.d.ts +0 -1
  332. package/tab-select/package.json +0 -11
  333. package/tab-select/public-api.d.ts +0 -3
  334. package/tab-select/tab-option.component.d.ts +0 -20
  335. package/tab-select/tab-option.component.scss +0 -0
  336. package/tab-select/tab-select.component.d.ts +0 -62
  337. package/tab-select/tab-select.component.scss +0 -3
  338. package/tab-select/tab-select.module.d.ts +0 -2
  339. package/virtual-scroll/README.md +0 -68
  340. package/virtual-scroll/covalent-core-virtual-scroll.d.ts +0 -4
  341. package/virtual-scroll/covalent-core-virtual-scroll.metadata.json +0 -1
  342. package/virtual-scroll/index.d.ts +0 -1
  343. package/virtual-scroll/package.json +0 -11
  344. package/virtual-scroll/public-api.d.ts +0 -3
  345. package/virtual-scroll/virtual-scroll-container.component.d.ts +0 -73
  346. package/virtual-scroll/virtual-scroll-container.component.scss +0 -7
  347. package/virtual-scroll/virtual-scroll-row.directive.d.ts +0 -5
  348. package/virtual-scroll/virtual-scroll.module.d.ts +0 -2
@@ -1,1534 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/cdk/portal'), require('@angular/cdk/overlay'), require('@angular/material/progress-bar'), require('@angular/material/progress-spinner'), require('@covalent/core/common'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@covalent/core/loading', ['exports', '@angular/core', '@angular/common', '@angular/cdk/portal', '@angular/cdk/overlay', '@angular/material/progress-bar', '@angular/material/progress-spinner', '@covalent/core/common', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.covalent = global.covalent || {}, global.covalent.core = global.covalent.core || {}, global.covalent.core.loading = {}), global.ng.core, global.ng.common, global.ng.cdk.portal, global.ng.cdk.overlay, global.ng.material.progressBar, global.ng.material.progressSpinner, global.covalent.core.common, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, core, common$1, portal, overlay, progressBar, progressSpinner, common, rxjs, operators) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
- var __assign = function () {
36
- __assign = Object.assign || function __assign(t) {
37
- for (var s, i = 1, n = arguments.length; i < n; i++) {
38
- s = arguments[i];
39
- for (var p in s)
40
- if (Object.prototype.hasOwnProperty.call(s, p))
41
- t[p] = s[p];
42
- }
43
- return t;
44
- };
45
- return __assign.apply(this, arguments);
46
- };
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s)
50
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- }
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
- r = Reflect.decorate(decorators, target, key, desc);
63
- else
64
- for (var i = decorators.length - 1; i >= 0; i--)
65
- if (d = decorators[i])
66
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
- return c > 3 && r && Object.defineProperty(target, key, r), r;
68
- }
69
- function __param(paramIndex, decorator) {
70
- return function (target, key) { decorator(target, key, paramIndex); };
71
- }
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
- return Reflect.metadata(metadataKey, metadataValue);
75
- }
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
- return new (P || (P = Promise))(function (resolve, reject) {
79
- function fulfilled(value) { try {
80
- step(generator.next(value));
81
- }
82
- catch (e) {
83
- reject(e);
84
- } }
85
- function rejected(value) { try {
86
- step(generator["throw"](value));
87
- }
88
- catch (e) {
89
- reject(e);
90
- } }
91
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
- step((generator = generator.apply(thisArg, _arguments || [])).next());
93
- });
94
- }
95
- function __generator(thisArg, body) {
96
- var _ = { label: 0, sent: function () { if (t[0] & 1)
97
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
98
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
99
- function verb(n) { return function (v) { return step([n, v]); }; }
100
- function step(op) {
101
- if (f)
102
- throw new TypeError("Generator is already executing.");
103
- while (_)
104
- try {
105
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
106
- return t;
107
- if (y = 0, t)
108
- op = [op[0] & 2, t.value];
109
- switch (op[0]) {
110
- case 0:
111
- case 1:
112
- t = op;
113
- break;
114
- case 4:
115
- _.label++;
116
- return { value: op[1], done: false };
117
- case 5:
118
- _.label++;
119
- y = op[1];
120
- op = [0];
121
- continue;
122
- case 7:
123
- op = _.ops.pop();
124
- _.trys.pop();
125
- continue;
126
- default:
127
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
128
- _ = 0;
129
- continue;
130
- }
131
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
132
- _.label = op[1];
133
- break;
134
- }
135
- if (op[0] === 6 && _.label < t[1]) {
136
- _.label = t[1];
137
- t = op;
138
- break;
139
- }
140
- if (t && _.label < t[2]) {
141
- _.label = t[2];
142
- _.ops.push(op);
143
- break;
144
- }
145
- if (t[2])
146
- _.ops.pop();
147
- _.trys.pop();
148
- continue;
149
- }
150
- op = body.call(thisArg, _);
151
- }
152
- catch (e) {
153
- op = [6, e];
154
- y = 0;
155
- }
156
- finally {
157
- f = t = 0;
158
- }
159
- if (op[0] & 5)
160
- throw op[1];
161
- return { value: op[0] ? op[1] : void 0, done: true };
162
- }
163
- }
164
- var __createBinding = Object.create ? (function (o, m, k, k2) {
165
- if (k2 === undefined)
166
- k2 = k;
167
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
168
- }) : (function (o, m, k, k2) {
169
- if (k2 === undefined)
170
- k2 = k;
171
- o[k2] = m[k];
172
- });
173
- function __exportStar(m, o) {
174
- for (var p in m)
175
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
176
- __createBinding(o, m, p);
177
- }
178
- function __values(o) {
179
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
180
- if (m)
181
- return m.call(o);
182
- if (o && typeof o.length === "number")
183
- return {
184
- next: function () {
185
- if (o && i >= o.length)
186
- o = void 0;
187
- return { value: o && o[i++], done: !o };
188
- }
189
- };
190
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
191
- }
192
- function __read(o, n) {
193
- var m = typeof Symbol === "function" && o[Symbol.iterator];
194
- if (!m)
195
- return o;
196
- var i = m.call(o), r, ar = [], e;
197
- try {
198
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
199
- ar.push(r.value);
200
- }
201
- catch (error) {
202
- e = { error: error };
203
- }
204
- finally {
205
- try {
206
- if (r && !r.done && (m = i["return"]))
207
- m.call(i);
208
- }
209
- finally {
210
- if (e)
211
- throw e.error;
212
- }
213
- }
214
- return ar;
215
- }
216
- function __spread() {
217
- for (var ar = [], i = 0; i < arguments.length; i++)
218
- ar = ar.concat(__read(arguments[i]));
219
- return ar;
220
- }
221
- function __spreadArrays() {
222
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
- s += arguments[i].length;
224
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
225
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
226
- r[k] = a[j];
227
- return r;
228
- }
229
- ;
230
- function __await(v) {
231
- return this instanceof __await ? (this.v = v, this) : new __await(v);
232
- }
233
- function __asyncGenerator(thisArg, _arguments, generator) {
234
- if (!Symbol.asyncIterator)
235
- throw new TypeError("Symbol.asyncIterator is not defined.");
236
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
237
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
238
- function verb(n) { if (g[n])
239
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
240
- function resume(n, v) { try {
241
- step(g[n](v));
242
- }
243
- catch (e) {
244
- settle(q[0][3], e);
245
- } }
246
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
247
- function fulfill(value) { resume("next", value); }
248
- function reject(value) { resume("throw", value); }
249
- function settle(f, v) { if (f(v), q.shift(), q.length)
250
- resume(q[0][0], q[0][1]); }
251
- }
252
- function __asyncDelegator(o) {
253
- var i, p;
254
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
255
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
256
- }
257
- function __asyncValues(o) {
258
- if (!Symbol.asyncIterator)
259
- throw new TypeError("Symbol.asyncIterator is not defined.");
260
- var m = o[Symbol.asyncIterator], i;
261
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
262
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
263
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
264
- }
265
- function __makeTemplateObject(cooked, raw) {
266
- if (Object.defineProperty) {
267
- Object.defineProperty(cooked, "raw", { value: raw });
268
- }
269
- else {
270
- cooked.raw = raw;
271
- }
272
- return cooked;
273
- }
274
- ;
275
- var __setModuleDefault = Object.create ? (function (o, v) {
276
- Object.defineProperty(o, "default", { enumerable: true, value: v });
277
- }) : function (o, v) {
278
- o["default"] = v;
279
- };
280
- function __importStar(mod) {
281
- if (mod && mod.__esModule)
282
- return mod;
283
- var result = {};
284
- if (mod != null)
285
- for (var k in mod)
286
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
287
- __createBinding(result, mod, k);
288
- __setModuleDefault(result, mod);
289
- return result;
290
- }
291
- function __importDefault(mod) {
292
- return (mod && mod.__esModule) ? mod : { default: mod };
293
- }
294
- function __classPrivateFieldGet(receiver, privateMap) {
295
- if (!privateMap.has(receiver)) {
296
- throw new TypeError("attempted to get private field on non-instance");
297
- }
298
- return privateMap.get(receiver);
299
- }
300
- function __classPrivateFieldSet(receiver, privateMap, value) {
301
- if (!privateMap.has(receiver)) {
302
- throw new TypeError("attempted to set private field on non-instance");
303
- }
304
- privateMap.set(receiver, value);
305
- return value;
306
- }
307
-
308
- /**
309
- * @fileoverview added by tsickle
310
- * Generated from: loading.component.ts
311
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
312
- */
313
- /** @enum {string} */
314
- var LoadingType = {
315
- Circular: "circular",
316
- Linear: "linear",
317
- };
318
- /** @enum {string} */
319
- var LoadingMode = {
320
- Determinate: "determinate",
321
- Indeterminate: "indeterminate",
322
- };
323
- /** @enum {string} */
324
- var LoadingStrategy = {
325
- Overlay: "overlay",
326
- Replace: "replace",
327
- };
328
- /** @enum {string} */
329
- var LoadingStyle = {
330
- FullScreen: "fullscreen",
331
- Overlay: "overlay",
332
- None: "none",
333
- };
334
- /** @type {?} */
335
- var TD_CIRCLE_DIAMETER = 100;
336
- var TdLoadingComponent = /** @class */ (function () {
337
- /**
338
- * @param {?} _elementRef
339
- * @param {?} _changeDetectorRef
340
- */
341
- function TdLoadingComponent(_elementRef, _changeDetectorRef) {
342
- this._elementRef = _elementRef;
343
- this._changeDetectorRef = _changeDetectorRef;
344
- this._mode = LoadingMode.Indeterminate;
345
- this._defaultMode = LoadingMode.Indeterminate;
346
- this._value = 0;
347
- this._circleDiameter = TD_CIRCLE_DIAMETER;
348
- /**
349
- * Flag for animation
350
- */
351
- this.animation = false;
352
- this.style = LoadingStyle.None;
353
- /**
354
- * type: LoadingType
355
- * Sets type of [TdLoadingComponent] rendered.
356
- */
357
- this.type = LoadingType.Circular;
358
- /**
359
- * color: primary' | 'accent' | 'warn'
360
- * Sets theme color of [TdLoadingComponent] rendered.
361
- */
362
- this.color = 'primary';
363
- }
364
- Object.defineProperty(TdLoadingComponent.prototype, "mode", {
365
- /**
366
- * @return {?}
367
- */
368
- get: function () {
369
- return this._mode;
370
- },
371
- /**
372
- * Sets mode of [TdLoadingComponent] to LoadingMode.Determinate or LoadingMode.Indeterminate
373
- * @param {?} mode
374
- * @return {?}
375
- */
376
- set: function (mode) {
377
- this._defaultMode = mode;
378
- },
379
- enumerable: false,
380
- configurable: true
381
- });
382
- Object.defineProperty(TdLoadingComponent.prototype, "value", {
383
- /**
384
- * @return {?}
385
- */
386
- get: function () {
387
- return this._value;
388
- },
389
- /**
390
- * Sets value of [TdLoadingComponent] if mode is 'LoadingMode.Determinate'
391
- * @param {?} value
392
- * @return {?}
393
- */
394
- set: function (value) {
395
- this._value = value;
396
- // Check for changes for `OnPush` change detection
397
- this._changeDetectorRef.markForCheck();
398
- },
399
- enumerable: false,
400
- configurable: true
401
- });
402
- /**
403
- * @return {?}
404
- */
405
- TdLoadingComponent.prototype.ngDoCheck = function () {
406
- // When overlay is used and the host width has a value greater than 1px
407
- // set the circle diameter when possible incase the loading component was rendered in a hidden state
408
- if (this.isOverlay() && this._hostHeight() > 1 && this.animation) {
409
- this._setCircleDiameter();
410
- this._changeDetectorRef.markForCheck();
411
- }
412
- };
413
- /**
414
- * @return {?}
415
- */
416
- TdLoadingComponent.prototype.getHeight = function () {
417
- // Ignore height if style is `overlay` or `fullscreen`.
418
- // Add height if child elements have a height and style is `none`, else return default height.
419
- if (this.isOverlay() || this.isFullScreen()) {
420
- return undefined;
421
- }
422
- else {
423
- return this.height ? this.height + "px" : '150px';
424
- }
425
- };
426
- /**
427
- * @return {?}
428
- */
429
- TdLoadingComponent.prototype.getCircleDiameter = function () {
430
- return this._circleDiameter;
431
- };
432
- /**
433
- * @return {?}
434
- */
435
- TdLoadingComponent.prototype.getCircleStrokeWidth = function () {
436
- // we calculate the stroke width by setting it as 10% of its diameter
437
- /** @type {?} */
438
- var strokeWidth = this.getCircleDiameter() / 10;
439
- return Math.abs(strokeWidth);
440
- };
441
- /**
442
- * @return {?}
443
- */
444
- TdLoadingComponent.prototype.isCircular = function () {
445
- return this.type === LoadingType.Circular;
446
- };
447
- /**
448
- * @return {?}
449
- */
450
- TdLoadingComponent.prototype.isLinear = function () {
451
- return this.type === LoadingType.Linear;
452
- };
453
- /**
454
- * @return {?}
455
- */
456
- TdLoadingComponent.prototype.isFullScreen = function () {
457
- return this.style === LoadingStyle.FullScreen;
458
- };
459
- /**
460
- * @return {?}
461
- */
462
- TdLoadingComponent.prototype.isOverlay = function () {
463
- return this.style === LoadingStyle.Overlay;
464
- };
465
- /**
466
- * Starts in animation and returns an observable for completition event.
467
- * @return {?}
468
- */
469
- TdLoadingComponent.prototype.show = function () {
470
- /* need to switch back to the selected mode, so we have saved it in another variable
471
- * and then recover it. (issue with protractor)
472
- */
473
- this._mode = this._defaultMode;
474
- // Set values before the animations starts
475
- this._setCircleDiameter();
476
- // Check for changes for `OnPush` change detection
477
- this.animation = true;
478
- this._changeDetectorRef.markForCheck();
479
- };
480
- /**
481
- * Starts out animation and returns an observable for completition event.
482
- * @return {?}
483
- */
484
- TdLoadingComponent.prototype.hide = function () {
485
- this.animation = false;
486
- /* need to switch back and forth from determinate/indeterminate so the setInterval()
487
- * inside mat-progress-spinner stops and protractor doesnt timeout waiting to sync.
488
- */
489
- this._mode = LoadingMode.Determinate;
490
- // Check for changes for `OnPush` change detection
491
- /* little hack to reset the loader value and animation before removing it from DOM
492
- * else, the loader will appear with prev value when its registered again
493
- * and will do an animation going prev value to 0.
494
- */
495
- this.value = 0;
496
- // Check for changes for `OnPush` change detection
497
- this._changeDetectorRef.markForCheck();
498
- };
499
- /**
500
- * Calculate the proper diameter for the circle and set it
501
- * @private
502
- * @return {?}
503
- */
504
- TdLoadingComponent.prototype._setCircleDiameter = function () {
505
- // we set a default diameter of 100 since this is the default in material
506
- /** @type {?} */
507
- var diameter = TD_CIRCLE_DIAMETER;
508
- // if height is provided, then we take that as diameter
509
- if (this.height) {
510
- diameter = this.height;
511
- // else if its not provided, then we take the host height
512
- }
513
- else if (this.height === undefined) {
514
- diameter = this._hostHeight();
515
- }
516
- // if the diameter is over TD_CIRCLE_DIAMETER, we set TD_CIRCLE_DIAMETER
517
- if (!!diameter && diameter <= TD_CIRCLE_DIAMETER) {
518
- this._circleDiameter = Math.floor(diameter);
519
- }
520
- else {
521
- this._circleDiameter = TD_CIRCLE_DIAMETER;
522
- }
523
- };
524
- /**
525
- * Returns the host height of the loading component
526
- * @private
527
- * @return {?}
528
- */
529
- TdLoadingComponent.prototype._hostHeight = function () {
530
- if (( /** @type {?} */(this._elementRef.nativeElement))) {
531
- return (( /** @type {?} */(this._elementRef.nativeElement))).getBoundingClientRect().height;
532
- }
533
- return 0;
534
- };
535
- return TdLoadingComponent;
536
- }());
537
- TdLoadingComponent.decorators = [
538
- { type: core.Component, args: [{
539
- selector: 'td-loading',
540
- template: "<div\n class=\"td-loading-wrapper\"\n [style.min-height]=\"getHeight()\"\n [class.td-overlay-circular]=\"(isOverlay() || isFullScreen()) && !isLinear()\"\n [class.td-overlay]=\"isOverlay() || isFullScreen()\"\n [class.td-fullscreen]=\"isFullScreen()\"\n>\n <div [@tdFadeInOut]=\"animation\" [style.min-height]=\"getHeight()\" class=\"td-loading\">\n <mat-progress-spinner\n *ngIf=\"isCircular()\"\n [mode]=\"mode\"\n [value]=\"value\"\n [color]=\"color\"\n [diameter]=\"getCircleDiameter()\"\n [strokeWidth]=\"getCircleStrokeWidth()\"\n ></mat-progress-spinner>\n <mat-progress-bar *ngIf=\"isLinear()\" [mode]=\"mode\" [value]=\"value\" [color]=\"color\"></mat-progress-bar>\n </div>\n <ng-template [cdkPortalOutlet]=\"content\"></ng-template>\n</div>\n",
541
- animations: [common.tdFadeInOutAnimation],
542
- styles: [".td-loading-wrapper{display:block;position:relative}.td-loading-wrapper.td-fullscreen{position:inherit}.td-loading-wrapper .td-loading{-ms-flex:1;-ms-flex-align:center;-ms-flex-direction:row;-ms-flex-line-pack:center;-ms-flex-pack:center;align-content:center;align-items:center;box-sizing:border-box;display:-ms-flexbox;display:flex;flex:1;flex-direction:row;justify-content:center;max-width:100%}.td-loading-wrapper.td-overlay .td-loading{left:0;margin:0;position:absolute;right:0;top:0;z-index:1000}.td-loading-wrapper.td-overlay .td-loading mat-progress-bar{left:0;position:absolute;right:0;top:0}.td-loading-wrapper.td-overlay-circular .td-loading{bottom:0}"]
543
- }] }
544
- ];
545
- /** @nocollapse */
546
- TdLoadingComponent.ctorParameters = function () { return [
547
- { type: core.ElementRef },
548
- { type: core.ChangeDetectorRef }
549
- ]; };
550
- if (false) {
551
- /**
552
- * @type {?}
553
- * @private
554
- */
555
- TdLoadingComponent.prototype._mode;
556
- /**
557
- * @type {?}
558
- * @private
559
- */
560
- TdLoadingComponent.prototype._defaultMode;
561
- /**
562
- * @type {?}
563
- * @private
564
- */
565
- TdLoadingComponent.prototype._value;
566
- /**
567
- * @type {?}
568
- * @private
569
- */
570
- TdLoadingComponent.prototype._circleDiameter;
571
- /**
572
- * Flag for animation
573
- * @type {?}
574
- */
575
- TdLoadingComponent.prototype.animation;
576
- /**
577
- * Content injected into loading component.
578
- * @type {?}
579
- */
580
- TdLoadingComponent.prototype.content;
581
- /** @type {?} */
582
- TdLoadingComponent.prototype.style;
583
- /**
584
- * height: number
585
- * Sets height of [TdLoadingComponent].
586
- * @type {?}
587
- */
588
- TdLoadingComponent.prototype.height;
589
- /**
590
- * type: LoadingType
591
- * Sets type of [TdLoadingComponent] rendered.
592
- * @type {?}
593
- */
594
- TdLoadingComponent.prototype.type;
595
- /**
596
- * color: primary' | 'accent' | 'warn'
597
- * Sets theme color of [TdLoadingComponent] rendered.
598
- * @type {?}
599
- */
600
- TdLoadingComponent.prototype.color;
601
- /**
602
- * @type {?}
603
- * @private
604
- */
605
- TdLoadingComponent.prototype._elementRef;
606
- /**
607
- * @type {?}
608
- * @private
609
- */
610
- TdLoadingComponent.prototype._changeDetectorRef;
611
- }
612
-
613
- /**
614
- * @fileoverview added by tsickle
615
- * Generated from: services/loading.factory.ts
616
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
617
- */
618
- /**
619
- * @record
620
- */
621
- function IInternalLoadingOptions() { }
622
- if (false) {
623
- /** @type {?|undefined} */
624
- IInternalLoadingOptions.prototype.height;
625
- /** @type {?|undefined} */
626
- IInternalLoadingOptions.prototype.style;
627
- }
628
- /**
629
- * @record
630
- */
631
- function ILoadingRef() { }
632
- if (false) {
633
- /** @type {?} */
634
- ILoadingRef.prototype.observable;
635
- /** @type {?} */
636
- ILoadingRef.prototype.componentRef;
637
- /** @type {?|undefined} */
638
- ILoadingRef.prototype.subject;
639
- /** @type {?|undefined} */
640
- ILoadingRef.prototype.times;
641
- }
642
- /**
643
- * NOTE: \@internal usage only.
644
- */
645
- var TdLoadingFactory = /** @class */ (function () {
646
- /**
647
- * @param {?} _componentFactoryResolver
648
- * @param {?} _overlay
649
- * @param {?} _injector
650
- */
651
- function TdLoadingFactory(_componentFactoryResolver, _overlay, _injector) {
652
- this._componentFactoryResolver = _componentFactoryResolver;
653
- this._overlay = _overlay;
654
- this._injector = _injector;
655
- }
656
- /**
657
- * Uses material `Overlay` services to create a DOM element and attach the loading component
658
- * into it. Leveraging the state and configuration from it.
659
- *
660
- * Saves a reference in context to be called when registering/resolving the loading element.
661
- * @param {?} options
662
- * @return {?}
663
- */
664
- TdLoadingFactory.prototype.createFullScreenComponent = function (options) {
665
- var _this = this;
666
- (( /** @type {?} */(options))).height = undefined;
667
- (( /** @type {?} */(options))).style = LoadingStyle.FullScreen;
668
- /** @type {?} */
669
- var loadingRef = this._initializeContext();
670
- /** @type {?} */
671
- var loading = false;
672
- /** @type {?} */
673
- var overlayRef;
674
- loadingRef.observable.pipe(operators.distinctUntilChanged()).subscribe(( /**
675
- * @param {?} registered
676
- * @return {?}
677
- */function (registered) {
678
- if (registered > 0 && !loading) {
679
- loading = true;
680
- overlayRef = _this._createOverlay();
681
- loadingRef.componentRef = overlayRef.attach(new portal.ComponentPortal(TdLoadingComponent));
682
- _this._mapOptions(options, loadingRef.componentRef.instance);
683
- loadingRef.componentRef.instance.show();
684
- loadingRef.componentRef.changeDetectorRef.detectChanges();
685
- }
686
- else if (registered <= 0 && loading) {
687
- loading = false;
688
- loadingRef.componentRef.instance.hide();
689
- loadingRef.componentRef.destroy();
690
- overlayRef.detach();
691
- overlayRef.dispose();
692
- }
693
- }));
694
- return loadingRef;
695
- };
696
- /**
697
- * Creates a loading component dynamically and attaches it into the given viewContainerRef.
698
- * Leverages TemplatePortals from material to inject the template inside of it so it fits
699
- * perfectly when overlaying it.
700
- *
701
- * Saves a reference in context to be called when registering/resolving the loading element.
702
- * @param {?} options
703
- * @param {?} viewContainerRef
704
- * @param {?} templateRef
705
- * @return {?}
706
- */
707
- TdLoadingFactory.prototype.createOverlayComponent = function (options, viewContainerRef, templateRef) {
708
- (( /** @type {?} */(options))).height = undefined;
709
- (( /** @type {?} */(options))).style = LoadingStyle.Overlay;
710
- /** @type {?} */
711
- var loadingRef = this._createComponent(options);
712
- /** @type {?} */
713
- var loading = false;
714
- loadingRef.componentRef.instance.content = new portal.TemplatePortal(templateRef, viewContainerRef);
715
- viewContainerRef.clear();
716
- viewContainerRef.insert(loadingRef.componentRef.hostView, 0);
717
- loadingRef.observable.pipe(operators.distinctUntilChanged()).subscribe(( /**
718
- * @param {?} registered
719
- * @return {?}
720
- */function (registered) {
721
- if (registered > 0 && !loading) {
722
- loading = true;
723
- loadingRef.componentRef.instance.show();
724
- }
725
- else if (registered <= 0 && loading) {
726
- loading = false;
727
- loadingRef.componentRef.instance.hide();
728
- }
729
- }));
730
- return loadingRef;
731
- };
732
- /**
733
- * Creates a loading component dynamically and attaches it into the given viewContainerRef.
734
- * Replaces the template with the loading component depending if it was registered or resolved.
735
- *
736
- * Saves a reference in context to be called when registering/resolving the loading element.
737
- * @param {?} options
738
- * @param {?} viewContainerRef
739
- * @param {?} templateRef
740
- * @param {?} context
741
- * @return {?}
742
- */
743
- TdLoadingFactory.prototype.createReplaceComponent = function (options, viewContainerRef, templateRef, context) {
744
- /** @type {?} */
745
- var nativeElement = ( /** @type {?} */(templateRef.elementRef.nativeElement));
746
- (( /** @type {?} */(options))).height = nativeElement.nextElementSibling
747
- ? nativeElement.nextElementSibling.scrollHeight
748
- : undefined;
749
- (( /** @type {?} */(options))).style = LoadingStyle.None;
750
- /** @type {?} */
751
- var loadingRef = this._createComponent(options);
752
- /** @type {?} */
753
- var loading = false;
754
- // passing context so when the template is attached, we can keep the reference of the variables
755
- /** @type {?} */
756
- var contentRef = viewContainerRef.createEmbeddedView(templateRef, context);
757
- loadingRef.observable.pipe(operators.distinctUntilChanged()).subscribe(( /**
758
- * @param {?} registered
759
- * @return {?}
760
- */function (registered) {
761
- if (registered > 0 && !loading) {
762
- loading = true;
763
- // detach the content and attach the loader if loader is there
764
- /** @type {?} */
765
- var index = viewContainerRef.indexOf(loadingRef.componentRef.hostView);
766
- if (index < 0) {
767
- viewContainerRef.detach(viewContainerRef.indexOf(contentRef));
768
- viewContainerRef.insert(loadingRef.componentRef.hostView, 0);
769
- }
770
- loadingRef.componentRef.instance.show();
771
- }
772
- else if (registered <= 0 && loading) {
773
- loading = false;
774
- loadingRef.componentRef.instance.hide();
775
- // detach loader and attach the content if content is there
776
- /** @type {?} */
777
- var index = viewContainerRef.indexOf(contentRef);
778
- if (index < 0) {
779
- viewContainerRef.detach(viewContainerRef.indexOf(loadingRef.componentRef.hostView));
780
- viewContainerRef.insert(contentRef, 0);
781
- }
782
- /**
783
- * Need to call "markForCheck" and "detectChanges" on attached template, so its detected by parent component when attached
784
- * with "OnPush" change detection
785
- */
786
- contentRef.detectChanges();
787
- contentRef.markForCheck();
788
- }
789
- }));
790
- return loadingRef;
791
- };
792
- /**
793
- * Creates a fullscreen overlay for the loading usage.
794
- * @private
795
- * @return {?}
796
- */
797
- TdLoadingFactory.prototype._createOverlay = function () {
798
- /** @type {?} */
799
- var state = new overlay.OverlayConfig();
800
- state.hasBackdrop = false;
801
- state.positionStrategy = this._overlay.position().global().centerHorizontally().centerVertically();
802
- return this._overlay.create(state);
803
- };
804
- /**
805
- * Creates a generic component dynamically waiting to be attached to a viewContainerRef.
806
- * @private
807
- * @param {?} options
808
- * @return {?}
809
- */
810
- TdLoadingFactory.prototype._createComponent = function (options) {
811
- /** @type {?} */
812
- var compRef = this._initializeContext();
813
- compRef.componentRef = this._componentFactoryResolver
814
- .resolveComponentFactory(TdLoadingComponent)
815
- .create(this._injector);
816
- this._mapOptions(options, compRef.componentRef.instance);
817
- return compRef;
818
- };
819
- /**
820
- * Initialize context for loading component.
821
- * @private
822
- * @return {?}
823
- */
824
- TdLoadingFactory.prototype._initializeContext = function () {
825
- /** @type {?} */
826
- var subject = new rxjs.Subject();
827
- return {
828
- observable: subject.asObservable(),
829
- subject: subject,
830
- componentRef: undefined,
831
- times: 0,
832
- };
833
- };
834
- /**
835
- * Maps configuration to the loading component instance.
836
- * @private
837
- * @param {?} options
838
- * @param {?} instance
839
- * @return {?}
840
- */
841
- TdLoadingFactory.prototype._mapOptions = function (options, instance) {
842
- instance.style = options.style;
843
- if (options.type !== undefined) {
844
- instance.type = options.type;
845
- }
846
- if (options.height !== undefined) {
847
- instance.height = options.height;
848
- }
849
- if (options.mode !== undefined) {
850
- instance.mode = options.mode;
851
- }
852
- if (options.color !== undefined) {
853
- instance.color = options.color;
854
- }
855
- };
856
- return TdLoadingFactory;
857
- }());
858
- TdLoadingFactory.decorators = [
859
- { type: core.Injectable }
860
- ];
861
- /** @nocollapse */
862
- TdLoadingFactory.ctorParameters = function () { return [
863
- { type: core.ComponentFactoryResolver },
864
- { type: overlay.Overlay },
865
- { type: core.Injector }
866
- ]; };
867
- if (false) {
868
- /**
869
- * @type {?}
870
- * @private
871
- */
872
- TdLoadingFactory.prototype._componentFactoryResolver;
873
- /**
874
- * @type {?}
875
- * @private
876
- */
877
- TdLoadingFactory.prototype._overlay;
878
- /**
879
- * @type {?}
880
- * @private
881
- */
882
- TdLoadingFactory.prototype._injector;
883
- }
884
- /**
885
- * @param {?} parent
886
- * @param {?} componentFactoryResolver
887
- * @param {?} overlay
888
- * @param {?} injector
889
- * @return {?}
890
- */
891
- function LOADING_FACTORY_PROVIDER_FACTORY(parent, componentFactoryResolver, overlay, injector) {
892
- return parent || new TdLoadingFactory(componentFactoryResolver, overlay, injector);
893
- }
894
- /** @type {?} */
895
- var LOADING_FACTORY_PROVIDER = {
896
- // If there is already a service available, use that. Otherwise, provide a new one.
897
- provide: TdLoadingFactory,
898
- deps: [[new core.Optional(), new core.SkipSelf(), TdLoadingFactory], core.ComponentFactoryResolver, overlay.Overlay, core.Injector],
899
- useFactory: LOADING_FACTORY_PROVIDER_FACTORY,
900
- };
901
-
902
- /**
903
- * @record
904
- */
905
- function ITdLoadingConfig() { }
906
- if (false) {
907
- /** @type {?} */
908
- ITdLoadingConfig.prototype.name;
909
- /** @type {?|undefined} */
910
- ITdLoadingConfig.prototype.type;
911
- /** @type {?|undefined} */
912
- ITdLoadingConfig.prototype.mode;
913
- /** @type {?|undefined} */
914
- ITdLoadingConfig.prototype.color;
915
- }
916
- var TdLoadingConfig = /** @class */ (function () {
917
- /**
918
- * @param {?} config
919
- */
920
- function TdLoadingConfig(config) {
921
- this.name = config.name;
922
- if (!this.name) {
923
- throw Error('Name is required for [TdLoading] configuration.');
924
- }
925
- this.mode = config.mode ? config.mode : LoadingMode.Indeterminate;
926
- this.type = config.type ? config.type : LoadingType.Circular;
927
- this.color = config.color ? config.color : 'primary';
928
- }
929
- return TdLoadingConfig;
930
- }());
931
- if (false) {
932
- /** @type {?} */
933
- TdLoadingConfig.prototype.name;
934
- /** @type {?} */
935
- TdLoadingConfig.prototype.type;
936
- /** @type {?} */
937
- TdLoadingConfig.prototype.mode;
938
- /** @type {?} */
939
- TdLoadingConfig.prototype.color;
940
- }
941
- /**
942
- * @record
943
- */
944
- function ITdLoadingDirectiveConfig() { }
945
- if (false) {
946
- /** @type {?|undefined} */
947
- ITdLoadingDirectiveConfig.prototype.strategy;
948
- }
949
- var TdLoadingDirectiveConfig = /** @class */ (function (_super) {
950
- __extends(TdLoadingDirectiveConfig, _super);
951
- /**
952
- * @param {?} config
953
- */
954
- function TdLoadingDirectiveConfig(config) {
955
- var _this = _super.call(this, config) || this;
956
- _this.strategy = config.strategy ? config.strategy : LoadingStrategy.Replace;
957
- return _this;
958
- }
959
- return TdLoadingDirectiveConfig;
960
- }(TdLoadingConfig));
961
- if (false) {
962
- /** @type {?} */
963
- TdLoadingDirectiveConfig.prototype.name;
964
- /** @type {?} */
965
- TdLoadingDirectiveConfig.prototype.type;
966
- /** @type {?} */
967
- TdLoadingDirectiveConfig.prototype.mode;
968
- /** @type {?} */
969
- TdLoadingDirectiveConfig.prototype.strategy;
970
- }
971
- var TdLoadingService = /** @class */ (function () {
972
- /**
973
- * @param {?} _loadingFactory
974
- */
975
- function TdLoadingService(_loadingFactory) {
976
- this._loadingFactory = _loadingFactory;
977
- this._context = {};
978
- this._timeouts = {};
979
- this.create({
980
- name: 'td-loading-main',
981
- });
982
- }
983
- /**
984
- * params:
985
- * - config: ILoadingDirectiveConfig
986
- * - viewContainerRef: ViewContainerRef
987
- * - templateRef: TemplateRef<Object>
988
- *
989
- * Creates an replace loading mask and attaches it to the viewContainerRef.
990
- * Replaces the templateRef with the mask when a request is registered on it.
991
- *
992
- * NOTE: \@internal usage only.
993
- * @param {?} config
994
- * @param {?} viewContainerRef
995
- * @param {?} templateRef
996
- * @param {?} context
997
- * @return {?}
998
- */
999
- TdLoadingService.prototype.createComponent = function (config, viewContainerRef, templateRef, context) {
1000
- /** @type {?} */
1001
- var directiveConfig = new TdLoadingDirectiveConfig(config);
1002
- if (this._context[directiveConfig.name]) {
1003
- throw Error("Name duplication: [TdLoading] directive has a name conflict with " + directiveConfig.name + ".");
1004
- }
1005
- if (directiveConfig.strategy === LoadingStrategy.Overlay) {
1006
- this._context[directiveConfig.name] = this._loadingFactory.createOverlayComponent(directiveConfig, viewContainerRef, templateRef);
1007
- }
1008
- else {
1009
- this._context[directiveConfig.name] = this._loadingFactory.createReplaceComponent(directiveConfig, viewContainerRef, templateRef, context);
1010
- }
1011
- return this._context[directiveConfig.name];
1012
- };
1013
- /**
1014
- * params:
1015
- * - config: ITdLoadingConfig
1016
- *
1017
- * Creates a fullscreen loading mask and attaches it to the DOM with the given configuration.
1018
- * Only displayed when the mask has a request registered on it.
1019
- * @param {?} config
1020
- * @return {?}
1021
- */
1022
- TdLoadingService.prototype.create = function (config) {
1023
- /** @type {?} */
1024
- var fullscreenConfig = new TdLoadingConfig(config);
1025
- this.removeComponent(fullscreenConfig.name);
1026
- this._context[fullscreenConfig.name] = this._loadingFactory.createFullScreenComponent(fullscreenConfig);
1027
- };
1028
- /**
1029
- * params:
1030
- * - name: string
1031
- *
1032
- * Removes `loading` component from service context.
1033
- * @param {?} name
1034
- * @return {?}
1035
- */
1036
- TdLoadingService.prototype.removeComponent = function (name) {
1037
- if (this._context[name]) {
1038
- this._context[name].subject.unsubscribe();
1039
- if (this._context[name].componentRef) {
1040
- this._context[name].componentRef.destroy();
1041
- }
1042
- this._context[name] = undefined;
1043
- delete this._context[name];
1044
- }
1045
- };
1046
- /**
1047
- * params:
1048
- * - name: string
1049
- * - registers?: number
1050
- * returns: true if successful
1051
- *
1052
- * Resolves a request for the loading mask referenced by the name parameter.
1053
- * Can optionally pass registers argument to set a number of register calls.
1054
- *
1055
- * If no paramemeters are used, then default main mask will be used.
1056
- *
1057
- * e.g. loadingService.register()
1058
- * @param {?=} name
1059
- * @param {?=} registers
1060
- * @return {?}
1061
- */
1062
- TdLoadingService.prototype.register = function (name, registers) {
1063
- var _this = this;
1064
- if (name === void 0) { name = 'td-loading-main'; }
1065
- if (registers === void 0) { registers = 1; }
1066
- // try registering into the service if the loading component has been instanciated or if it exists.
1067
- if (this._context[name]) {
1068
- registers = registers < 1 ? 1 : registers;
1069
- this._context[name].times += registers;
1070
- this._context[name].subject.next(this._context[name].times);
1071
- return true;
1072
- }
1073
- else {
1074
- // if it doesnt exist, set a timeout so its registered after change detection happens
1075
- // this in case "register" occured on the `ngOnInit` lifehook cycle.
1076
- if (!this._timeouts[name]) {
1077
- this._timeouts[name] = setTimeout(( /**
1078
- * @return {?}
1079
- */function () {
1080
- _this.register(name, registers);
1081
- }));
1082
- }
1083
- else {
1084
- // if it timeout occured and still doesnt exist, it means the tiemout wasnt needed so we clear it.
1085
- this._clearTimeout(name);
1086
- }
1087
- }
1088
- return false;
1089
- };
1090
- /**
1091
- * params:
1092
- * - name: string
1093
- * - resolves?: number
1094
- * returns: true if successful
1095
- *
1096
- * Resolves a request for the loading mask referenced by the name parameter.
1097
- * Can optionally pass resolves argument to set a number of resolve calls.
1098
- *
1099
- * If no paramemeters are used, then default main mask will be used.
1100
- *
1101
- * e.g. loadingService.resolve()
1102
- * @param {?=} name
1103
- * @param {?=} resolves
1104
- * @return {?}
1105
- */
1106
- TdLoadingService.prototype.resolve = function (name, resolves) {
1107
- if (name === void 0) { name = 'td-loading-main'; }
1108
- if (resolves === void 0) { resolves = 1; }
1109
- // clear timeout if the loading component is "resolved" before its "registered"
1110
- this._clearTimeout(name);
1111
- if (this._context[name]) {
1112
- resolves = resolves < 1 ? 1 : resolves;
1113
- if (this._context[name].times > 0) {
1114
- /** @type {?} */
1115
- var times = this._context[name].times;
1116
- times -= resolves;
1117
- this._context[name].times = times < 0 ? 0 : times;
1118
- }
1119
- this._context[name].subject.next(this._context[name].times);
1120
- return true;
1121
- }
1122
- return false;
1123
- };
1124
- /**
1125
- * params:
1126
- * - name: string
1127
- * returns: true if successful
1128
- *
1129
- * Resolves all request for the loading mask referenced by the name parameter.
1130
- *
1131
- * If no paramemeters are used, then default main mask will be used.
1132
- *
1133
- * e.g. loadingService.resolveAll()
1134
- * @param {?=} name
1135
- * @return {?}
1136
- */
1137
- TdLoadingService.prototype.resolveAll = function (name) {
1138
- if (name === void 0) { name = 'td-loading-main'; }
1139
- // clear timeout if the loading component is "resolved" before its "registered"
1140
- this._clearTimeout(name);
1141
- if (this._context[name]) {
1142
- this._context[name].times = 0;
1143
- this._context[name].subject.next(this._context[name].times);
1144
- return true;
1145
- }
1146
- return false;
1147
- };
1148
- /**
1149
- * params:
1150
- * - name: string
1151
- * - value: number
1152
- * returns: true if successful
1153
- *
1154
- * Set value on a loading mask referenced by the name parameter.
1155
- * Usage only available if its mode is 'determinate' and if loading is showing.
1156
- * @param {?} name
1157
- * @param {?} value
1158
- * @return {?}
1159
- */
1160
- TdLoadingService.prototype.setValue = function (name, value) {
1161
- if (this._context[name]) {
1162
- /** @type {?} */
1163
- var instance = this._context[name].componentRef.instance;
1164
- if (instance.mode === LoadingMode.Determinate && instance.animation) {
1165
- instance.value = value;
1166
- return true;
1167
- }
1168
- }
1169
- return false;
1170
- };
1171
- /**
1172
- * Clears timeout linked to the name.
1173
- * @private
1174
- * @param {?} name Name of the loading component to be cleared
1175
- * @return {?}
1176
- */
1177
- TdLoadingService.prototype._clearTimeout = function (name) {
1178
- clearTimeout(this._timeouts[name]);
1179
- delete this._timeouts[name];
1180
- };
1181
- return TdLoadingService;
1182
- }());
1183
- TdLoadingService.decorators = [
1184
- { type: core.Injectable }
1185
- ];
1186
- /** @nocollapse */
1187
- TdLoadingService.ctorParameters = function () { return [
1188
- { type: TdLoadingFactory }
1189
- ]; };
1190
- if (false) {
1191
- /**
1192
- * @type {?}
1193
- * @private
1194
- */
1195
- TdLoadingService.prototype._context;
1196
- /**
1197
- * @type {?}
1198
- * @private
1199
- */
1200
- TdLoadingService.prototype._timeouts;
1201
- /**
1202
- * @type {?}
1203
- * @private
1204
- */
1205
- TdLoadingService.prototype._loadingFactory;
1206
- }
1207
- /**
1208
- * @param {?} parent
1209
- * @param {?} loadingFactory
1210
- * @return {?}
1211
- */
1212
- function LOADING_PROVIDER_FACTORY(parent, loadingFactory) {
1213
- return parent || new TdLoadingService(loadingFactory);
1214
- }
1215
- /** @type {?} */
1216
- var LOADING_PROVIDER = {
1217
- // If there is already a service available, use that. Otherwise, provide a new one.
1218
- provide: TdLoadingService,
1219
- deps: [[new core.Optional(), new core.SkipSelf(), TdLoadingService], TdLoadingFactory],
1220
- useFactory: LOADING_PROVIDER_FACTORY,
1221
- };
1222
-
1223
- /**
1224
- * @fileoverview added by tsickle
1225
- * Generated from: directives/loading.directive.ts
1226
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1227
- */
1228
- /**
1229
- * Context class for variable reference
1230
- */
1231
- var TdLoadingContext = /** @class */ (function () {
1232
- function TdLoadingContext() {
1233
- this.$implicit = undefined;
1234
- this.tdLoading = undefined;
1235
- }
1236
- return TdLoadingContext;
1237
- }());
1238
- if (false) {
1239
- /** @type {?} */
1240
- TdLoadingContext.prototype.$implicit;
1241
- /** @type {?} */
1242
- TdLoadingContext.prototype.tdLoading;
1243
- }
1244
- // Constant for generation of the id for the next component
1245
- /** @type {?} */
1246
- var TD_LOADING_NEXT_ID = 0;
1247
- var TdLoadingDirective = /** @class */ (function () {
1248
- /**
1249
- * @param {?} _viewContainerRef
1250
- * @param {?} _templateRef
1251
- * @param {?} _loadingService
1252
- */
1253
- function TdLoadingDirective(_viewContainerRef, _templateRef, _loadingService) {
1254
- this._viewContainerRef = _viewContainerRef;
1255
- this._templateRef = _templateRef;
1256
- this._loadingService = _loadingService;
1257
- this._context = new TdLoadingContext();
1258
- /**
1259
- * tdLoadingColor?: "primary" | "accent" | "warn"
1260
- * Sets the theme color of the loading component. Defaults to "primary"
1261
- */
1262
- this.color = 'primary';
1263
- }
1264
- Object.defineProperty(TdLoadingDirective.prototype, "name", {
1265
- /**
1266
- * tdLoading: string
1267
- * Name reference of the loading mask, used to register/resolve requests to the mask.
1268
- * @param {?} name
1269
- * @return {?}
1270
- */
1271
- set: function (name) {
1272
- if (!this._name && name) {
1273
- this._name = name;
1274
- }
1275
- },
1276
- enumerable: false,
1277
- configurable: true
1278
- });
1279
- Object.defineProperty(TdLoadingDirective.prototype, "until", {
1280
- /**
1281
- * tdLoadingUntil?: any
1282
- * If its null, undefined or false it will be used to register requests to the mask.
1283
- * Else if its any value that can be resolved as true, it will resolve the mask.
1284
- * [name] is optional when using [until], but can still be used to register/resolve it manually.
1285
- * @param {?} until
1286
- * @return {?}
1287
- */
1288
- set: function (until) {
1289
- if (!this._name) {
1290
- this._name = 'td-loading-until-' + TD_LOADING_NEXT_ID++;
1291
- }
1292
- this._context.$implicit = this._context.tdLoading = until;
1293
- if (!until) {
1294
- this._loadingService.register(this._name);
1295
- }
1296
- else {
1297
- this._loadingService.resolveAll(this._name);
1298
- }
1299
- },
1300
- enumerable: false,
1301
- configurable: true
1302
- });
1303
- Object.defineProperty(TdLoadingDirective.prototype, "type", {
1304
- /**
1305
- * tdLoadingType?: LoadingType or ['linear' | 'circular']
1306
- * Sets the type of loading mask depending on value.
1307
- * Defaults to [LoadingType.Circular | 'circular'].
1308
- * @param {?} type
1309
- * @return {?}
1310
- */
1311
- set: function (type) {
1312
- if (type === LoadingType.Linear) {
1313
- this._type = LoadingType.Linear;
1314
- }
1315
- else {
1316
- this._type = LoadingType.Circular;
1317
- }
1318
- },
1319
- enumerable: false,
1320
- configurable: true
1321
- });
1322
- Object.defineProperty(TdLoadingDirective.prototype, "mode", {
1323
- /**
1324
- * tdLoadingMode?: LoadingMode or ['determinate' | 'indeterminate']
1325
- * Sets the mode of loading mask depending on value.
1326
- * Defaults to [LoadingMode.Indeterminate | 'indeterminate'].
1327
- * @param {?} mode
1328
- * @return {?}
1329
- */
1330
- set: function (mode) {
1331
- if (mode === LoadingMode.Determinate) {
1332
- this._mode = LoadingMode.Determinate;
1333
- }
1334
- else {
1335
- this._mode = LoadingMode.Indeterminate;
1336
- }
1337
- },
1338
- enumerable: false,
1339
- configurable: true
1340
- });
1341
- Object.defineProperty(TdLoadingDirective.prototype, "strategy", {
1342
- /**
1343
- * tdLoadingStrategy?: LoadingStrategy or ['replace' | 'overlay']
1344
- * Sets the strategy of loading mask depending on value.
1345
- * Defaults to [LoadingMode.Replace | 'replace'].
1346
- * @param {?} strategy
1347
- * @return {?}
1348
- */
1349
- set: function (strategy) {
1350
- if (strategy === LoadingStrategy.Overlay) {
1351
- this._strategy = LoadingStrategy.Overlay;
1352
- }
1353
- else {
1354
- this._strategy = LoadingStrategy.Replace;
1355
- }
1356
- },
1357
- enumerable: false,
1358
- configurable: true
1359
- });
1360
- /**
1361
- * Registers component in the DOM, so it will be available when calling resolve/register.
1362
- * @return {?}
1363
- */
1364
- TdLoadingDirective.prototype.ngOnInit = function () {
1365
- this._registerComponent();
1366
- };
1367
- /**
1368
- * Remove component when directive is destroyed.
1369
- * @return {?}
1370
- */
1371
- TdLoadingDirective.prototype.ngOnDestroy = function () {
1372
- this._loadingService.removeComponent(this._name);
1373
- this._loadingRef = undefined;
1374
- };
1375
- /**
1376
- * Creates [TdLoadingComponent] and attaches it to this directive's [ViewContainerRef].
1377
- * Passes this directive's [TemplateRef] to modify DOM depending on loading `strategy`.
1378
- * @private
1379
- * @return {?}
1380
- */
1381
- TdLoadingDirective.prototype._registerComponent = function () {
1382
- if (!this._name) {
1383
- throw new Error('Name is needed to register loading directive');
1384
- }
1385
- // Check if `TdLoadingComponent` has been created before trying to add one again.
1386
- // There is a weird edge case when using `[routerLinkActive]` that calls the `ngOnInit` twice in a row
1387
- if (!this._loadingRef) {
1388
- this._loadingRef = this._loadingService.createComponent({
1389
- name: this._name,
1390
- type: this._type,
1391
- mode: this._mode,
1392
- color: this.color,
1393
- strategy: this._strategy,
1394
- }, this._viewContainerRef, this._templateRef, this._context);
1395
- }
1396
- };
1397
- return TdLoadingDirective;
1398
- }());
1399
- TdLoadingDirective.decorators = [
1400
- { type: core.Directive, args: [{
1401
- selector: '[tdLoading]',
1402
- },] }
1403
- ];
1404
- /** @nocollapse */
1405
- TdLoadingDirective.ctorParameters = function () { return [
1406
- { type: core.ViewContainerRef },
1407
- { type: core.TemplateRef },
1408
- { type: TdLoadingService }
1409
- ]; };
1410
- TdLoadingDirective.propDecorators = {
1411
- name: [{ type: core.Input, args: ['tdLoading',] }],
1412
- until: [{ type: core.Input, args: ['tdLoadingUntil',] }],
1413
- type: [{ type: core.Input, args: ['tdLoadingType',] }],
1414
- mode: [{ type: core.Input, args: ['tdLoadingMode',] }],
1415
- strategy: [{ type: core.Input, args: ['tdLoadingStrategy',] }],
1416
- color: [{ type: core.Input, args: ['tdLoadingColor',] }]
1417
- };
1418
- if (false) {
1419
- /**
1420
- * @type {?}
1421
- * @private
1422
- */
1423
- TdLoadingDirective.prototype._context;
1424
- /**
1425
- * @type {?}
1426
- * @private
1427
- */
1428
- TdLoadingDirective.prototype._type;
1429
- /**
1430
- * @type {?}
1431
- * @private
1432
- */
1433
- TdLoadingDirective.prototype._mode;
1434
- /**
1435
- * @type {?}
1436
- * @private
1437
- */
1438
- TdLoadingDirective.prototype._strategy;
1439
- /**
1440
- * @type {?}
1441
- * @private
1442
- */
1443
- TdLoadingDirective.prototype._name;
1444
- /**
1445
- * @type {?}
1446
- * @private
1447
- */
1448
- TdLoadingDirective.prototype._loadingRef;
1449
- /**
1450
- * tdLoadingColor?: "primary" | "accent" | "warn"
1451
- * Sets the theme color of the loading component. Defaults to "primary"
1452
- * @type {?}
1453
- */
1454
- TdLoadingDirective.prototype.color;
1455
- /**
1456
- * @type {?}
1457
- * @private
1458
- */
1459
- TdLoadingDirective.prototype._viewContainerRef;
1460
- /**
1461
- * @type {?}
1462
- * @private
1463
- */
1464
- TdLoadingDirective.prototype._templateRef;
1465
- /**
1466
- * @type {?}
1467
- * @private
1468
- */
1469
- TdLoadingDirective.prototype._loadingService;
1470
- }
1471
-
1472
- /**
1473
- * @fileoverview added by tsickle
1474
- * Generated from: loading.module.ts
1475
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1476
- */
1477
- /** @type {?} */
1478
- var TD_LOADING = [TdLoadingComponent, TdLoadingDirective];
1479
- /** @type {?} */
1480
- var TD_LOADING_ENTRY_COMPONENTS = [TdLoadingComponent];
1481
- var CovalentLoadingModule = /** @class */ (function () {
1482
- function CovalentLoadingModule() {
1483
- }
1484
- return CovalentLoadingModule;
1485
- }());
1486
- CovalentLoadingModule.decorators = [
1487
- { type: core.NgModule, args: [{
1488
- imports: [common$1.CommonModule, progressBar.MatProgressBarModule, progressSpinner.MatProgressSpinnerModule, overlay.OverlayModule, portal.PortalModule],
1489
- declarations: [TD_LOADING],
1490
- exports: [TD_LOADING],
1491
- providers: [LOADING_FACTORY_PROVIDER, LOADING_PROVIDER],
1492
- },] }
1493
- ];
1494
-
1495
- /**
1496
- * @fileoverview added by tsickle
1497
- * Generated from: public-api.ts
1498
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1499
- */
1500
-
1501
- /**
1502
- * @fileoverview added by tsickle
1503
- * Generated from: index.ts
1504
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1505
- */
1506
-
1507
- /**
1508
- * @fileoverview added by tsickle
1509
- * Generated from: covalent-core-loading.ts
1510
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1511
- */
1512
-
1513
- exports.CovalentLoadingModule = CovalentLoadingModule;
1514
- exports.LOADING_FACTORY_PROVIDER = LOADING_FACTORY_PROVIDER;
1515
- exports.LOADING_FACTORY_PROVIDER_FACTORY = LOADING_FACTORY_PROVIDER_FACTORY;
1516
- exports.LOADING_PROVIDER = LOADING_PROVIDER;
1517
- exports.LOADING_PROVIDER_FACTORY = LOADING_PROVIDER_FACTORY;
1518
- exports.LoadingMode = LoadingMode;
1519
- exports.LoadingStrategy = LoadingStrategy;
1520
- exports.LoadingStyle = LoadingStyle;
1521
- exports.LoadingType = LoadingType;
1522
- exports.TD_CIRCLE_DIAMETER = TD_CIRCLE_DIAMETER;
1523
- exports.TdLoadingComponent = TdLoadingComponent;
1524
- exports.TdLoadingConfig = TdLoadingConfig;
1525
- exports.TdLoadingContext = TdLoadingContext;
1526
- exports.TdLoadingDirective = TdLoadingDirective;
1527
- exports.TdLoadingDirectiveConfig = TdLoadingDirectiveConfig;
1528
- exports.TdLoadingFactory = TdLoadingFactory;
1529
- exports.TdLoadingService = TdLoadingService;
1530
-
1531
- Object.defineProperty(exports, '__esModule', { value: true });
1532
-
1533
- })));
1534
- //# sourceMappingURL=covalent-core-loading.umd.js.map