@coolon/angular-ui-powerups 0.0.23 → 0.0.25

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 (286) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/jest.config.js +9 -0
  3. package/ng-package.json +13 -0
  4. package/package.json +12 -14
  5. package/schematics/ng-add/index.ts +10 -0
  6. package/schematics/place-routes/index.ts +152 -0
  7. package/schematics/place-routes/place-def.ts +93 -0
  8. package/schematics/place-routes/scanner.ts +145 -0
  9. package/schematics/place-routes/schema.ts +7 -0
  10. package/src/lib/angular-ui-powerups.module.spec.ts +14 -0
  11. package/src/lib/angular-ui-powerups.module.ts +49 -0
  12. package/{lib/animations/index.d.ts → src/lib/animations/index.ts} +1 -0
  13. package/src/lib/animations/slideDownAndUpAnimation.ts +39 -0
  14. package/src/lib/components/disposable-component.ts +9 -0
  15. package/src/lib/components/forms/abstract-input.component.ts +108 -0
  16. package/src/lib/components/forms/number-input/number-input.component.html +15 -0
  17. package/src/lib/components/forms/number-input/number-input.component.scss +3 -0
  18. package/src/lib/components/forms/number-input/number-input.component.spec.ts +25 -0
  19. package/src/lib/components/forms/number-input/number-input.component.ts +19 -0
  20. package/src/lib/components/forms/password-input/password-input.component.html +16 -0
  21. package/src/lib/components/forms/password-input/password-input.component.scss +3 -0
  22. package/src/lib/components/forms/password-input/password-input.component.spec.ts +25 -0
  23. package/src/lib/components/forms/password-input/password-input.component.ts +18 -0
  24. package/src/lib/components/forms/scss/mixins.scss +16 -0
  25. package/src/lib/components/forms/select-input/select-input.component.html +16 -0
  26. package/src/lib/components/forms/select-input/select-input.component.scss +7 -0
  27. package/src/lib/components/forms/select-input/select-input.component.spec.ts +25 -0
  28. package/src/lib/components/forms/select-input/select-input.component.ts +31 -0
  29. package/src/lib/components/forms/string-input/string-input.component.html +15 -0
  30. package/src/lib/components/forms/string-input/string-input.component.scss +3 -0
  31. package/src/lib/components/forms/string-input/string-input.component.spec.ts +25 -0
  32. package/src/lib/components/forms/string-input/string-input.component.ts +18 -0
  33. package/{lib/components/index.d.ts → src/lib/components/index.ts} +1 -0
  34. package/src/lib/components/resize-aware.component.ts +52 -0
  35. package/src/lib/components/types/bounds.class.ts +25 -0
  36. package/src/lib/components/types/dimension.class.ts +3 -0
  37. package/src/lib/components/types/point.class.ts +13 -0
  38. package/src/lib/directives/command.directive.spec.ts +73 -0
  39. package/src/lib/directives/command.directive.ts +81 -0
  40. package/src/lib/directives/focus-binding.directive.spec.ts +8 -0
  41. package/src/lib/directives/focus-binding.directive.ts +108 -0
  42. package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +1 -0
  43. package/src/lib/interaction/abstract-activity.ts +57 -0
  44. package/src/lib/interaction/activity.ts +17 -0
  45. package/src/lib/interaction/alert.ts +6 -0
  46. package/src/lib/interaction/components/activity-container/activity-container.component.html +8 -0
  47. package/src/lib/interaction/components/activity-container/activity-container.component.scss +3 -0
  48. package/src/lib/interaction/components/activity-container/activity-container.component.spec.ts +25 -0
  49. package/src/lib/interaction/components/activity-container/activity-container.component.ts +93 -0
  50. package/{lib/interaction/components/activity-outlet/activity-outlet-context.d.ts → src/lib/interaction/components/activity-outlet/activity-outlet-context.ts} +7 -5
  51. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.scss +3 -0
  52. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.spec.ts +25 -0
  53. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.ts +96 -0
  54. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.html +7 -0
  55. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.scss +7 -0
  56. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.spec.ts +25 -0
  57. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.ts +20 -0
  58. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.html +9 -0
  59. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.scss +8 -0
  60. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.spec.ts +25 -0
  61. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.ts +26 -0
  62. package/{lib/interaction/confirm.d.ts → src/lib/interaction/confirm.ts} +3 -2
  63. package/{lib/interaction/index.d.ts → src/lib/interaction/index.ts} +1 -0
  64. package/src/lib/interaction/interaction-context.ts +16 -0
  65. package/src/lib/interaction/interaction.module.ts +35 -0
  66. package/src/lib/interaction/result.ts +16 -0
  67. package/src/lib/interaction/services/dialog-interaction.service.scss +11 -0
  68. package/src/lib/interaction/services/dialog-interaction.service.spec.ts +12 -0
  69. package/src/lib/interaction/services/dialog-interaction.service.ts +63 -0
  70. package/src/lib/place/abstract-place-component.ts +33 -0
  71. package/src/lib/place/components/busy-overlay/busy-overlay.component.html +4 -0
  72. package/src/lib/place/components/busy-overlay/busy-overlay.component.scss +27 -0
  73. package/src/lib/place/components/busy-overlay/busy-overlay.component.spec.ts +25 -0
  74. package/src/lib/place/components/busy-overlay/busy-overlay.component.ts +23 -0
  75. package/src/lib/place/components/empty-state/empty-state.component.scss +15 -0
  76. package/src/lib/place/components/empty-state/empty-state.component.spec.ts +25 -0
  77. package/src/lib/place/components/empty-state/empty-state.component.ts +19 -0
  78. package/src/lib/place/components/place-outlet/place-outlet.component.html +7 -0
  79. package/src/lib/place/components/place-outlet/place-outlet.component.scss +12 -0
  80. package/src/lib/place/components/place-outlet/place-outlet.component.spec.ts +25 -0
  81. package/src/lib/place/components/place-outlet/place-outlet.component.ts +37 -0
  82. package/src/lib/place/components/place-outlet/route-animations.ts +30 -0
  83. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.html +7 -0
  84. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.scss +100 -0
  85. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.spec.ts +25 -0
  86. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts +30 -0
  87. package/src/lib/place/guards/leave-place.guard.spec.ts +15 -0
  88. package/src/lib/place/guards/leave-place.guard.ts +18 -0
  89. package/src/lib/place/guards/place-route.guard.ts +37 -0
  90. package/{lib/place/index.d.ts → src/lib/place/index.ts} +2 -1
  91. package/src/lib/place/place-component.ts +6 -0
  92. package/src/lib/place/place.decorator.ts +40 -0
  93. package/src/lib/place/place.module.ts +44 -0
  94. package/src/lib/place/place.service.spec.ts +12 -0
  95. package/src/lib/place/place.service.ts +29 -0
  96. package/src/lib/place/route/json-types.ts +5 -0
  97. package/src/lib/place/route/parameter-decorators.ts +99 -0
  98. package/src/lib/place/route/parameter-definition.class.ts +12 -0
  99. package/{lib/place/route/parameter-sanitiser.d.ts → src/lib/place/route/parameter-sanitiser.ts} +1 -1
  100. package/src/lib/place/route/parameter-type.ts +31 -0
  101. package/src/lib/place/route/route-parameter-bindings.ts +140 -0
  102. package/src/lib/place/route/route-parameter-sanitiser.ts +135 -0
  103. package/src/test-setup.ts +1 -0
  104. package/tsconfig.json +7 -0
  105. package/tsconfig.lib.json +20 -0
  106. package/tsconfig.schematics.json +35 -0
  107. package/tsconfig.spec.json +10 -0
  108. package/tslint.json +7 -0
  109. package/bundles/coolon-angular-ui-powerups.umd.js +0 -3908
  110. package/bundles/coolon-angular-ui-powerups.umd.js.map +0 -1
  111. package/bundles/coolon-angular-ui-powerups.umd.min.js +0 -2
  112. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +0 -1
  113. package/coolon-angular-ui-powerups.d.ts +0 -30
  114. package/coolon-angular-ui-powerups.metadata.json +0 -1
  115. package/esm2015/coolon-angular-ui-powerups.js +0 -33
  116. package/esm2015/index.js +0 -6
  117. package/esm2015/lib/angular-ui-powerups.module.js +0 -54
  118. package/esm2015/lib/animations/index.js +0 -9
  119. package/esm2015/lib/animations/slideDownAndUpAnimation.js +0 -30
  120. package/esm2015/lib/components/disposable-component.js +0 -14
  121. package/esm2015/lib/components/forms/abstract-input.component.js +0 -183
  122. package/esm2015/lib/components/forms/number-input/number-input.component.js +0 -26
  123. package/esm2015/lib/components/forms/password-input/password-input.component.js +0 -26
  124. package/esm2015/lib/components/forms/select-input/select-input.component.js +0 -60
  125. package/esm2015/lib/components/forms/string-input/string-input.component.js +0 -26
  126. package/esm2015/lib/components/index.js +0 -18
  127. package/esm2015/lib/components/resize-aware.component.js +0 -96
  128. package/esm2015/lib/components/types/bounds.class.js +0 -56
  129. package/esm2015/lib/components/types/dimension.class.js +0 -21
  130. package/esm2015/lib/components/types/point.class.js +0 -36
  131. package/esm2015/lib/directives/command.directive.js +0 -135
  132. package/esm2015/lib/directives/focus-binding.directive.js +0 -179
  133. package/esm2015/lib/directives/index.js +0 -10
  134. package/esm2015/lib/interaction/abstract-activity.js +0 -129
  135. package/esm2015/lib/interaction/activity.js +0 -27
  136. package/esm2015/lib/interaction/alert.js +0 -23
  137. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +0 -144
  138. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
  139. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -169
  140. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -37
  141. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -46
  142. package/esm2015/lib/interaction/confirm.js +0 -17
  143. package/esm2015/lib/interaction/index.js +0 -21
  144. package/esm2015/lib/interaction/interaction-context.js +0 -35
  145. package/esm2015/lib/interaction/interaction.module.js +0 -41
  146. package/esm2015/lib/interaction/result.js +0 -24
  147. package/esm2015/lib/interaction/services/dialog-interaction.service.js +0 -114
  148. package/esm2015/lib/place/abstract-place-component.js +0 -59
  149. package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +0 -44
  150. package/esm2015/lib/place/components/empty-state/empty-state.component.js +0 -28
  151. package/esm2015/lib/place/components/nav/nav.component.js +0 -31
  152. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +0 -67
  153. package/esm2015/lib/place/components/place-outlet/route-animations.js +0 -35
  154. package/esm2015/lib/place/guards/leave-place.guard.js +0 -52
  155. package/esm2015/lib/place/guards/place-route.guard.js +0 -74
  156. package/esm2015/lib/place/index.js +0 -27
  157. package/esm2015/lib/place/place-component.js +0 -17
  158. package/esm2015/lib/place/place.decorator.js +0 -72
  159. package/esm2015/lib/place/place.module.js +0 -49
  160. package/esm2015/lib/place/place.service.js +0 -61
  161. package/esm2015/lib/place/route/json-types.js +0 -13
  162. package/esm2015/lib/place/route/parameter-decorators.js +0 -178
  163. package/esm2015/lib/place/route/parameter-definition.class.js +0 -24
  164. package/esm2015/lib/place/route/parameter-sanitiser.js +0 -17
  165. package/esm2015/lib/place/route/parameter-type.js +0 -43
  166. package/esm2015/lib/place/route/route-parameter-bindings.js +0 -294
  167. package/esm2015/lib/place/route/route-parameter-sanitiser.js +0 -280
  168. package/esm2015/public_api.js +0 -11
  169. package/esm5/coolon-angular-ui-powerups.js +0 -33
  170. package/esm5/index.js +0 -6
  171. package/esm5/lib/angular-ui-powerups.module.js +0 -58
  172. package/esm5/lib/animations/index.js +0 -9
  173. package/esm5/lib/animations/slideDownAndUpAnimation.js +0 -30
  174. package/esm5/lib/components/disposable-component.js +0 -24
  175. package/esm5/lib/components/forms/abstract-input.component.js +0 -232
  176. package/esm5/lib/components/forms/number-input/number-input.component.js +0 -33
  177. package/esm5/lib/components/forms/password-input/password-input.component.js +0 -33
  178. package/esm5/lib/components/forms/select-input/select-input.component.js +0 -67
  179. package/esm5/lib/components/forms/string-input/string-input.component.js +0 -33
  180. package/esm5/lib/components/index.js +0 -18
  181. package/esm5/lib/components/resize-aware.component.js +0 -124
  182. package/esm5/lib/components/types/bounds.class.js +0 -59
  183. package/esm5/lib/components/types/dimension.class.js +0 -19
  184. package/esm5/lib/components/types/point.class.js +0 -43
  185. package/esm5/lib/directives/command.directive.js +0 -155
  186. package/esm5/lib/directives/focus-binding.directive.js +0 -231
  187. package/esm5/lib/directives/index.js +0 -10
  188. package/esm5/lib/interaction/abstract-activity.js +0 -173
  189. package/esm5/lib/interaction/activity.js +0 -27
  190. package/esm5/lib/interaction/alert.js +0 -23
  191. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +0 -181
  192. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
  193. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -206
  194. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -42
  195. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -54
  196. package/esm5/lib/interaction/confirm.js +0 -17
  197. package/esm5/lib/interaction/index.js +0 -21
  198. package/esm5/lib/interaction/interaction-context.js +0 -45
  199. package/esm5/lib/interaction/interaction.module.js +0 -45
  200. package/esm5/lib/interaction/result.js +0 -24
  201. package/esm5/lib/interaction/services/dialog-interaction.service.js +0 -140
  202. package/esm5/lib/place/abstract-place-component.js +0 -66
  203. package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +0 -49
  204. package/esm5/lib/place/components/empty-state/empty-state.component.js +0 -29
  205. package/esm5/lib/place/components/nav/nav.component.js +0 -36
  206. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +0 -81
  207. package/esm5/lib/place/components/place-outlet/route-animations.js +0 -35
  208. package/esm5/lib/place/guards/leave-place.guard.js +0 -57
  209. package/esm5/lib/place/guards/place-route.guard.js +0 -78
  210. package/esm5/lib/place/index.js +0 -27
  211. package/esm5/lib/place/place-component.js +0 -17
  212. package/esm5/lib/place/place.decorator.js +0 -69
  213. package/esm5/lib/place/place.module.js +0 -53
  214. package/esm5/lib/place/place.service.js +0 -75
  215. package/esm5/lib/place/route/json-types.js +0 -13
  216. package/esm5/lib/place/route/parameter-decorators.js +0 -178
  217. package/esm5/lib/place/route/parameter-definition.class.js +0 -24
  218. package/esm5/lib/place/route/parameter-sanitiser.js +0 -17
  219. package/esm5/lib/place/route/parameter-type.js +0 -65
  220. package/esm5/lib/place/route/route-parameter-bindings.js +0 -339
  221. package/esm5/lib/place/route/route-parameter-sanitiser.js +0 -395
  222. package/esm5/public_api.js +0 -11
  223. package/fesm2015/coolon-angular-ui-powerups.js +0 -3129
  224. package/fesm2015/coolon-angular-ui-powerups.js.map +0 -1
  225. package/fesm5/coolon-angular-ui-powerups.js +0 -3681
  226. package/fesm5/coolon-angular-ui-powerups.js.map +0 -1
  227. package/lib/angular-ui-powerups.module.d.ts +0 -2
  228. package/lib/animations/slideDownAndUpAnimation.d.ts +0 -5
  229. package/lib/components/disposable-component.d.ts +0 -5
  230. package/lib/components/forms/abstract-input.component.d.ts +0 -35
  231. package/lib/components/forms/number-input/number-input.component.d.ts +0 -6
  232. package/lib/components/forms/password-input/password-input.component.d.ts +0 -6
  233. package/lib/components/forms/select-input/select-input.component.d.ts +0 -11
  234. package/lib/components/forms/string-input/string-input.component.d.ts +0 -6
  235. package/lib/components/resize-aware.component.d.ts +0 -22
  236. package/lib/components/types/bounds.class.d.ts +0 -16
  237. package/lib/components/types/dimension.class.d.ts +0 -5
  238. package/lib/components/types/point.class.d.ts +0 -10
  239. package/lib/directives/command.directive.d.ts +0 -14
  240. package/lib/directives/focus-binding.directive.d.ts +0 -22
  241. package/lib/interaction/abstract-activity.d.ts +0 -17
  242. package/lib/interaction/activity.d.ts +0 -11
  243. package/lib/interaction/alert.d.ts +0 -5
  244. package/lib/interaction/components/activity-container/activity-container.component.d.ts +0 -32
  245. package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +0 -30
  246. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +0 -8
  247. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -9
  248. package/lib/interaction/interaction-context.d.ts +0 -11
  249. package/lib/interaction/interaction.module.d.ts +0 -2
  250. package/lib/interaction/result.d.ts +0 -8
  251. package/lib/interaction/services/dialog-interaction.service.d.ts +0 -14
  252. package/lib/place/abstract-place-component.d.ts +0 -13
  253. package/lib/place/components/busy-overlay/busy-overlay.component.d.ts +0 -8
  254. package/lib/place/components/empty-state/empty-state.component.d.ts +0 -5
  255. package/lib/place/components/nav/nav.component.d.ts +0 -7
  256. package/lib/place/components/place-outlet/place-outlet.component.d.ts +0 -13
  257. package/lib/place/components/place-outlet/route-animations.d.ts +0 -1
  258. package/lib/place/guards/leave-place.guard.d.ts +0 -10
  259. package/lib/place/guards/place-route.guard.d.ts +0 -9
  260. package/lib/place/place-component.d.ts +0 -5
  261. package/lib/place/place.decorator.d.ts +0 -20
  262. package/lib/place/place.module.d.ts +0 -2
  263. package/lib/place/place.service.d.ts +0 -8
  264. package/lib/place/route/json-types.d.ts +0 -7
  265. package/lib/place/route/parameter-decorators.d.ts +0 -26
  266. package/lib/place/route/parameter-definition.class.d.ts +0 -11
  267. package/lib/place/route/parameter-type.d.ts +0 -16
  268. package/lib/place/route/route-parameter-bindings.d.ts +0 -18
  269. package/lib/place/route/route-parameter-sanitiser.d.ts +0 -42
  270. package/schematics/ng-add/index.d.ts +0 -2
  271. package/schematics/ng-add/index.js +0 -12
  272. package/schematics/ng-add/index.js.map +0 -1
  273. package/schematics/place-routes/index.d.ts +0 -3
  274. package/schematics/place-routes/index.js +0 -114
  275. package/schematics/place-routes/index.js.map +0 -1
  276. package/schematics/place-routes/place-def.d.ts +0 -34
  277. package/schematics/place-routes/place-def.js +0 -84
  278. package/schematics/place-routes/place-def.js.map +0 -1
  279. package/schematics/place-routes/scanner.d.ts +0 -26
  280. package/schematics/place-routes/scanner.js +0 -125
  281. package/schematics/place-routes/scanner.js.map +0 -1
  282. package/schematics/place-routes/schema.d.ts +0 -7
  283. package/schematics/place-routes/schema.js +0 -3
  284. package/schematics/place-routes/schema.js.map +0 -1
  285. /package/{index.d.ts → src/index.ts} +0 -0
  286. /package/{public_api.d.ts → src/public_api.ts} +0 -0
@@ -1,3908 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/platform-browser'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@coolon/pectin/lib/promise/deferred.class'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('@angular/material/list'), require('@angular/material/tabs'), require('@angular/material/tooltip'), require('@angular/router'), require('@angular/animations'), require('resize-observer-polyfill'), require('@typescript-plus/fast-memoize-decorator'), require('lodash'), require('reflect-metadata'), require('@typescript-plus/fast-memoize-decorator/dist/src')) :
3
- typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/platform-browser', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@coolon/pectin/lib/promise/deferred.class', '@coolon/typescript-utilities', '@angular/material/dialog', '@angular/material/list', '@angular/material/tabs', '@angular/material/tooltip', '@angular/router', '@angular/animations', 'resize-observer-polyfill', '@typescript-plus/fast-memoize-decorator', 'lodash', 'reflect-metadata', '@typescript-plus/fast-memoize-decorator/dist/src'], factory) :
4
- (global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.platformBrowser, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.deferred_class, global.typescriptUtilities, global.ng.material.dialog, global.ng.material.list, global.ng.material.tabs, global.ng.material.tooltip, global.ng.router, global.ng.animations, global.ResizeObserver, global.fastMemoizeDecorator, global.lodash, null, global.src));
5
- }(this, function (exports, common, core, forms, material, platformBrowser, animations, pectin, portal, deferred_class, typescriptUtilities, dialog, list, tabs, tooltip, router, animations$1, ResizeObserver, fastMemoizeDecorator, lodash, reflectMetadata, src) { 'use strict';
6
-
7
- ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
8
-
9
- /*! *****************************************************************************
10
- Copyright (c) Microsoft Corporation. All rights reserved.
11
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
12
- this file except in compliance with the License. You may obtain a copy of the
13
- License at http://www.apache.org/licenses/LICENSE-2.0
14
-
15
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
17
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
18
- MERCHANTABLITY OR NON-INFRINGEMENT.
19
-
20
- See the Apache Version 2.0 License for specific language governing permissions
21
- and limitations under the License.
22
- ***************************************************************************** */
23
- /* global Reflect, Promise */
24
-
25
- var extendStatics = function(d, b) {
26
- extendStatics = Object.setPrototypeOf ||
27
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
29
- return extendStatics(d, b);
30
- };
31
-
32
- function __extends(d, b) {
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
-
38
- var __assign = function() {
39
- __assign = Object.assign || function __assign(t) {
40
- for (var s, i = 1, n = arguments.length; i < n; i++) {
41
- s = arguments[i];
42
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
43
- }
44
- return t;
45
- };
46
- return __assign.apply(this, arguments);
47
- };
48
-
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56
- t[p[i]] = s[p[i]];
57
- }
58
- return t;
59
- }
60
-
61
- function __decorate(decorators, target, key, desc) {
62
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
64
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
65
- return c > 3 && r && Object.defineProperty(target, key, r), r;
66
- }
67
-
68
- function __param(paramIndex, decorator) {
69
- return function (target, key) { decorator(target, key, paramIndex); }
70
- }
71
-
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
74
- }
75
-
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- return new (P || (P = Promise))(function (resolve, reject) {
78
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
79
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
80
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
81
- step((generator = generator.apply(thisArg, _arguments || [])).next());
82
- });
83
- }
84
-
85
- function __generator(thisArg, body) {
86
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
87
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
88
- function verb(n) { return function (v) { return step([n, v]); }; }
89
- function step(op) {
90
- if (f) throw new TypeError("Generator is already executing.");
91
- while (_) try {
92
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
93
- if (y = 0, t) op = [op[0] & 2, t.value];
94
- switch (op[0]) {
95
- case 0: case 1: t = op; break;
96
- case 4: _.label++; return { value: op[1], done: false };
97
- case 5: _.label++; y = op[1]; op = [0]; continue;
98
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
99
- default:
100
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
101
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
102
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
103
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
104
- if (t[2]) _.ops.pop();
105
- _.trys.pop(); continue;
106
- }
107
- op = body.call(thisArg, _);
108
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
109
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
110
- }
111
- }
112
-
113
- function __exportStar(m, exports) {
114
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
115
- }
116
-
117
- function __values(o) {
118
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
119
- if (m) return m.call(o);
120
- return {
121
- next: function () {
122
- if (o && i >= o.length) o = void 0;
123
- return { value: o && o[i++], done: !o };
124
- }
125
- };
126
- }
127
-
128
- function __read(o, n) {
129
- var m = typeof Symbol === "function" && o[Symbol.iterator];
130
- if (!m) return o;
131
- var i = m.call(o), r, ar = [], e;
132
- try {
133
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
134
- }
135
- catch (error) { e = { error: error }; }
136
- finally {
137
- try {
138
- if (r && !r.done && (m = i["return"])) m.call(i);
139
- }
140
- finally { if (e) throw e.error; }
141
- }
142
- return ar;
143
- }
144
-
145
- function __spread() {
146
- for (var ar = [], i = 0; i < arguments.length; i++)
147
- ar = ar.concat(__read(arguments[i]));
148
- return ar;
149
- }
150
-
151
- function __spreadArrays() {
152
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
153
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
154
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
155
- r[k] = a[j];
156
- return r;
157
- };
158
-
159
- function __await(v) {
160
- return this instanceof __await ? (this.v = v, this) : new __await(v);
161
- }
162
-
163
- function __asyncGenerator(thisArg, _arguments, generator) {
164
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
165
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
166
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
167
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
168
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
169
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
170
- function fulfill(value) { resume("next", value); }
171
- function reject(value) { resume("throw", value); }
172
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
173
- }
174
-
175
- function __asyncDelegator(o) {
176
- var i, p;
177
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
178
- 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; }
179
- }
180
-
181
- function __asyncValues(o) {
182
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
183
- var m = o[Symbol.asyncIterator], i;
184
- 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);
185
- 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); }); }; }
186
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
187
- }
188
-
189
- function __makeTemplateObject(cooked, raw) {
190
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
191
- return cooked;
192
- };
193
-
194
- function __importStar(mod) {
195
- if (mod && mod.__esModule) return mod;
196
- var result = {};
197
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
198
- result.default = mod;
199
- return result;
200
- }
201
-
202
- function __importDefault(mod) {
203
- return (mod && mod.__esModule) ? mod : { default: mod };
204
- }
205
-
206
- /**
207
- * @fileoverview added by tsickle
208
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
209
- */
210
- var DisposableComponent = /** @class */ (function (_super) {
211
- __extends(DisposableComponent, _super);
212
- function DisposableComponent() {
213
- return _super !== null && _super.apply(this, arguments) || this;
214
- }
215
- /**
216
- * @return {?}
217
- */
218
- DisposableComponent.prototype.ngOnDestroy = /**
219
- * @return {?}
220
- */
221
- function () {
222
- this.dispose();
223
- };
224
- return DisposableComponent;
225
- }(pectin.GarbageCollector));
226
-
227
- /**
228
- * @fileoverview added by tsickle
229
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
230
- */
231
- /**
232
- * @abstract
233
- * @template T
234
- */
235
- var AbstractInputComponent = /** @class */ (function (_super) {
236
- __extends(AbstractInputComponent, _super);
237
- function AbstractInputComponent() {
238
- var _this = _super.call(this) || this;
239
- _this.valueModel = new pectin.DelegatingFormValueModel();
240
- // TODO: fix this.
241
- // tslint:disable-next-line:no-output-native
242
- _this.focus = new core.EventEmitter();
243
- // tslint:disable-next-line:no-output-native
244
- _this.blur = new core.EventEmitter();
245
- // tslint:disable-next-line:no-output-native
246
- _this.enterKey = new core.EventEmitter();
247
- // tslint:disable-next-line:no-output-native
248
- _this.escapeKey = new core.EventEmitter();
249
- /** @type {?} */
250
- var self = _this;
251
- _this.errorStateMatcher = {
252
- isErrorState: /**
253
- * @param {?} control
254
- * @param {?} form
255
- * @return {?}
256
- */
257
- function (control, form) {
258
- return self.hasErrors();
259
- }
260
- };
261
- return _this;
262
- }
263
- Object.defineProperty(AbstractInputComponent.prototype, "userValueModel", {
264
- set: /**
265
- * @param {?} model
266
- * @return {?}
267
- */
268
- function (model) {
269
- this.valueModel.setDelegate(model);
270
- },
271
- enumerable: true,
272
- configurable: true
273
- });
274
- /**
275
- * @return {?}
276
- */
277
- AbstractInputComponent.prototype.notifyClick = /**
278
- * @return {?}
279
- */
280
- function () {
281
- this.safelyInvoke(this.clickCommand);
282
- };
283
- /**
284
- * @return {?}
285
- */
286
- AbstractInputComponent.prototype.notifyFocusIn = /**
287
- * @return {?}
288
- */
289
- function () {
290
- this.safelyInvoke(this.focusCommand);
291
- this.focus.emit();
292
- };
293
- /**
294
- * @return {?}
295
- */
296
- AbstractInputComponent.prototype.notifyFocusOut = /**
297
- * @return {?}
298
- */
299
- function () {
300
- this.safelyInvoke(this.blurCommand);
301
- this.blur.emit();
302
- };
303
- /**
304
- * @return {?}
305
- */
306
- AbstractInputComponent.prototype.notifyEnterKey = /**
307
- * @return {?}
308
- */
309
- function () {
310
- this.safelyInvoke(this.enterCommand);
311
- this.enterKey.emit();
312
- };
313
- /**
314
- * @return {?}
315
- */
316
- AbstractInputComponent.prototype.notifyEscapeKey = /**
317
- * @return {?}
318
- */
319
- function () {
320
- this.safelyInvoke(this.escapeCommand);
321
- this.escapeKey.emit();
322
- };
323
- /**
324
- * @protected
325
- * @param {?} command
326
- * @return {?}
327
- */
328
- AbstractInputComponent.prototype.safelyInvoke = /**
329
- * @protected
330
- * @param {?} command
331
- * @return {?}
332
- */
333
- function (command) {
334
- if (command && command.enabled.value) {
335
- command.execute();
336
- }
337
- };
338
- /**
339
- * @return {?}
340
- */
341
- AbstractInputComponent.prototype.ngOnInit = /**
342
- * @return {?}
343
- */
344
- function () {
345
- };
346
- /**
347
- * @return {?}
348
- */
349
- AbstractInputComponent.prototype.isEnabled = /**
350
- * @return {?}
351
- */
352
- function () {
353
- return this.enabled.value;
354
- };
355
- Object.defineProperty(AbstractInputComponent.prototype, "enabled", {
356
- get: /**
357
- * @return {?}
358
- */
359
- function () {
360
- return this.valueModel.enabled;
361
- },
362
- enumerable: true,
363
- configurable: true
364
- });
365
- /**
366
- * @return {?}
367
- */
368
- AbstractInputComponent.prototype.hasErrors = /**
369
- * @return {?}
370
- */
371
- function () {
372
- return !this.errorList.query().isEmpty();
373
- };
374
- Object.defineProperty(AbstractInputComponent.prototype, "errorList", {
375
- get: /**
376
- * @return {?}
377
- */
378
- function () {
379
- return this.valueModel.errorList;
380
- },
381
- enumerable: true,
382
- configurable: true
383
- });
384
- Object.defineProperty(AbstractInputComponent.prototype, "firstError", {
385
- get: /**
386
- * @return {?}
387
- */
388
- function () {
389
- return this.hasErrors() ? this.errorList.value[0] : null;
390
- },
391
- enumerable: true,
392
- configurable: true
393
- });
394
- AbstractInputComponent.propDecorators = {
395
- userValueModel: [{ type: core.Input, args: ['valueModel',] }],
396
- label: [{ type: core.Input }],
397
- floatLabel: [{ type: core.Input }],
398
- hint: [{ type: core.Input }],
399
- placeholder: [{ type: core.Input }],
400
- focusCommand: [{ type: core.Input, args: ['command.focus',] }],
401
- blurCommand: [{ type: core.Input, args: ['command.blur',] }],
402
- enterCommand: [{ type: core.Input, args: ['command.enter',] }],
403
- escapeCommand: [{ type: core.Input, args: ['command.escape',] }],
404
- clickCommand: [{ type: core.Input, args: ['command.click',] }],
405
- focus: [{ type: core.Output }],
406
- blur: [{ type: core.Output }],
407
- enterKey: [{ type: core.Output }],
408
- escapeKey: [{ type: core.Output }],
409
- notifyClick: [{ type: core.HostListener, args: ['click',] }],
410
- notifyFocusIn: [{ type: core.HostListener, args: ['focusin',] }],
411
- notifyFocusOut: [{ type: core.HostListener, args: ['focusout',] }]
412
- };
413
- __decorate([
414
- pectin.UseDelegate(),
415
- __metadata("design:type", pectin.ValueModel),
416
- __metadata("design:paramtypes", [pectin.ValueModel])
417
- ], AbstractInputComponent.prototype, "userValueModel", null);
418
- return AbstractInputComponent;
419
- }(DisposableComponent));
420
- if (false) {
421
- /** @type {?} */
422
- AbstractInputComponent.prototype.valueModel;
423
- /** @type {?} */
424
- AbstractInputComponent.prototype.label;
425
- /** @type {?} */
426
- AbstractInputComponent.prototype.floatLabel;
427
- /** @type {?} */
428
- AbstractInputComponent.prototype.hint;
429
- /** @type {?} */
430
- AbstractInputComponent.prototype.placeholder;
431
- /** @type {?} */
432
- AbstractInputComponent.prototype.focusCommand;
433
- /** @type {?} */
434
- AbstractInputComponent.prototype.blurCommand;
435
- /** @type {?} */
436
- AbstractInputComponent.prototype.enterCommand;
437
- /** @type {?} */
438
- AbstractInputComponent.prototype.escapeCommand;
439
- /** @type {?} */
440
- AbstractInputComponent.prototype.clickCommand;
441
- /** @type {?} */
442
- AbstractInputComponent.prototype.focus;
443
- /** @type {?} */
444
- AbstractInputComponent.prototype.blur;
445
- /** @type {?} */
446
- AbstractInputComponent.prototype.enterKey;
447
- /** @type {?} */
448
- AbstractInputComponent.prototype.escapeKey;
449
- /** @type {?} */
450
- AbstractInputComponent.prototype.errorStateMatcher;
451
- }
452
-
453
- /**
454
- * @fileoverview added by tsickle
455
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
456
- */
457
- var NumberInputComponent = /** @class */ (function (_super) {
458
- __extends(NumberInputComponent, _super);
459
- function NumberInputComponent() {
460
- return _super.call(this) || this;
461
- }
462
- /**
463
- * @return {?}
464
- */
465
- NumberInputComponent.prototype.ngOnInit = /**
466
- * @return {?}
467
- */
468
- function () {
469
- };
470
- NumberInputComponent.decorators = [
471
- { type: core.Component, args: [{
472
- selector: 'angular-ui-powerups-number-input',
473
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
474
- styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
475
- }] }
476
- ];
477
- /** @nocollapse */
478
- NumberInputComponent.ctorParameters = function () { return []; };
479
- return NumberInputComponent;
480
- }(AbstractInputComponent));
481
-
482
- /**
483
- * @fileoverview added by tsickle
484
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
485
- */
486
- /**
487
- * @template P
488
- */
489
- var CommandDirective = /** @class */ (function (_super) {
490
- __extends(CommandDirective, _super);
491
- function CommandDirective(elementRef) {
492
- var _this = _super.call(this) || this;
493
- _this.elementRef = elementRef;
494
- _this._commandParameterProvided = false;
495
- return _this;
496
- }
497
- Object.defineProperty(CommandDirective.prototype, "commandParameter", {
498
- get: /**
499
- * @return {?}
500
- */
501
- function () {
502
- return this._commandParameter;
503
- },
504
- set: /**
505
- * @param {?} value
506
- * @return {?}
507
- */
508
- function (value) {
509
- this._commandParameterProvided = true;
510
- this._commandParameter = value;
511
- },
512
- enumerable: true,
513
- configurable: true
514
- });
515
- /**
516
- * @return {?}
517
- */
518
- CommandDirective.prototype.ngOnInit = /**
519
- * @return {?}
520
- */
521
- function () {
522
- pectin.assert.notNil(this.pectinCommand);
523
- if (this.pectinCommand instanceof pectin.UnaryCommand) {
524
- if (!this._commandParameterProvided) {
525
- pectin.lang.illegalState('UnaryCommands required the command parameter to be specified.');
526
- }
527
- }
528
- else {
529
- if (this._commandParameterProvided) {
530
- pectin.lang.illegalState('command parameters are only supported by UnaryCommands');
531
- }
532
- }
533
- };
534
- /**
535
- * @return {?}
536
- */
537
- CommandDirective.prototype.ngAfterViewInit = /**
538
- * @return {?}
539
- */
540
- function () {
541
- var _this = this;
542
- // for some reason mat-buttons kills the disabled host binding. It works on a regular button but for now
543
- // we need to do this.
544
- var chain = pectin.Dsl.disposeWith(this).chain;
545
- chain(this.pectinCommand.enabled).subscribe((/**
546
- * @param {?} enabled
547
- * @return {?}
548
- */
549
- function (enabled) {
550
- if (enabled) {
551
- _this.elementRef.nativeElement.removeAttribute('disabled');
552
- if (_this.elementRef.nativeElement.tagName === 'A') {
553
- _this.elementRef.nativeElement.setAttribute('href', 'javascript:void');
554
- }
555
- }
556
- else {
557
- _this.elementRef.nativeElement.setAttribute('disabled', 'disabled');
558
- if (_this.elementRef.nativeElement.tagName === 'A') {
559
- _this.elementRef.nativeElement.removeAttribute('href');
560
- }
561
- }
562
- }));
563
- };
564
- /**
565
- * @return {?}
566
- */
567
- CommandDirective.prototype.ngOnDestroy = /**
568
- * @return {?}
569
- */
570
- function () {
571
- this.dispose();
572
- };
573
- /**
574
- * @param {?} $event
575
- * @return {?}
576
- */
577
- CommandDirective.prototype.notifyClick = /**
578
- * @param {?} $event
579
- * @return {?}
580
- */
581
- function ($event) {
582
- $event.preventDefault();
583
- $event.stopPropagation();
584
- if (this.pectinCommand.enabled.value) {
585
- if (this.pectinCommand instanceof pectin.UnaryCommand) {
586
- this.pectinCommand.withContext({ event: $event }).execute(this.commandParameter);
587
- }
588
- else {
589
- this.pectinCommand.withContext({ event: $event }).execute();
590
- }
591
- }
592
- else {
593
- console.warn('disabled command clicked, ignoring.');
594
- }
595
- };
596
- CommandDirective.decorators = [
597
- { type: core.Directive, args: [{
598
- // tslint:disable-next-line:directive-selector
599
- selector: '[pectinCommand]'
600
- },] }
601
- ];
602
- /** @nocollapse */
603
- CommandDirective.ctorParameters = function () { return [
604
- { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] }
605
- ]; };
606
- CommandDirective.propDecorators = {
607
- pectinCommand: [{ type: core.Input }],
608
- commandParameter: [{ type: core.Input }],
609
- notifyClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
610
- };
611
- return CommandDirective;
612
- }(pectin.GarbageCollector));
613
- if (false) {
614
- /** @type {?} */
615
- CommandDirective.prototype.pectinCommand;
616
- /**
617
- * @type {?}
618
- * @private
619
- */
620
- CommandDirective.prototype._commandParameter;
621
- /**
622
- * @type {?}
623
- * @private
624
- */
625
- CommandDirective.prototype._commandParameterProvided;
626
- /**
627
- * @type {?}
628
- * @private
629
- */
630
- CommandDirective.prototype.elementRef;
631
- }
632
-
633
- /**
634
- * @fileoverview added by tsickle
635
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
636
- */
637
- var FocusBindingDirective = /** @class */ (function (_super) {
638
- __extends(FocusBindingDirective, _super);
639
- function FocusBindingDirective(el, ngZone, document) {
640
- var _this = _super.call(this) || this;
641
- _this.el = el;
642
- _this.ngZone = ngZone;
643
- // @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642
644
- _this.document = (/** @type {?} */ (document));
645
- return _this;
646
- }
647
- /**
648
- * @return {?}
649
- */
650
- FocusBindingDirective.prototype.onFocusIn = /**
651
- * @return {?}
652
- */
653
- function () {
654
- if (this.hasBinding()) {
655
- this.pectinFocusBinding.focusContext.notifyFocusIn();
656
- }
657
- };
658
- /**
659
- * @return {?}
660
- */
661
- FocusBindingDirective.prototype.onFocusOut = /**
662
- * @return {?}
663
- */
664
- function () {
665
- if (this.hasBinding()) {
666
- this.pectinFocusBinding.focusContext.notifyFocusOut();
667
- }
668
- };
669
- /**
670
- * @return {?}
671
- */
672
- FocusBindingDirective.prototype.ngOnInit = /**
673
- * @return {?}
674
- */
675
- function () {
676
- };
677
- /**
678
- * @return {?}
679
- */
680
- FocusBindingDirective.prototype.ngAfterViewInit = /**
681
- * @return {?}
682
- */
683
- function () {
684
- var _this = this;
685
- // TODO: Make this also track the current enabled/disabled state.
686
- if (this.hasBinding()) {
687
- var chain = pectin.Dsl.disposeWith(this).chain;
688
- chain(this.pectinFocusBinding.focusContext.focused).subscribe((/**
689
- * @param {?} focused
690
- * @return {?}
691
- */
692
- function (focused) {
693
- if (focused && !_this.alreadyHasFocus()) {
694
- _this.tryAndFocus();
695
- }
696
- }));
697
- }
698
- else {
699
- pectin.Logger.get(this).warn("pectinFocusBinding was nil");
700
- }
701
- };
702
- /**
703
- * @private
704
- * @return {?}
705
- */
706
- FocusBindingDirective.prototype.hasBinding = /**
707
- * @private
708
- * @return {?}
709
- */
710
- function () {
711
- return !!this.pectinFocusBinding && !!this.pectinFocusBinding.focusContext;
712
- };
713
- // Hook method for debugging via tracing.
714
- // Hook method for debugging via tracing.
715
- /**
716
- * @return {?}
717
- */
718
- FocusBindingDirective.prototype.alreadyHasFocus =
719
- // Hook method for debugging via tracing.
720
- /**
721
- * @return {?}
722
- */
723
- function () {
724
- return this.isFocused(this.focusTarget);
725
- };
726
- // Hook method for debugging via tracing.
727
- // Hook method for debugging via tracing.
728
- /**
729
- * @param {?} element
730
- * @return {?}
731
- */
732
- FocusBindingDirective.prototype.isFocused =
733
- // Hook method for debugging via tracing.
734
- /**
735
- * @param {?} element
736
- * @return {?}
737
- */
738
- function (element) {
739
- return this.document.activeElement === element;
740
- };
741
- /**
742
- * @param {?=} retries
743
- * @return {?}
744
- */
745
- FocusBindingDirective.prototype.tryAndFocus = /**
746
- * @param {?=} retries
747
- * @return {?}
748
- */
749
- function (retries) {
750
- var _this = this;
751
- if (retries === void 0) { retries = 5; }
752
- if (this.modelShouldStillHaveFocus() && this.canFocus()) {
753
- if (!this.alreadyHasFocus()) {
754
- this.focusTarget.focus();
755
- }
756
- // if we didn't get the focus we try again later.
757
- if (!this.alreadyHasFocus()) {
758
- pectin.Logger.get(this).log("focus failed, trying " + retries + " more times");
759
- if (retries > 0) {
760
- // try again on the next paint
761
- // TODO: is there an angular way of doing this without calling a window function.
762
- requestAnimationFrame((/**
763
- * @return {?}
764
- */
765
- function () {
766
- _this.tryAndFocus(retries - 1);
767
- }));
768
- }
769
- else {
770
- pectin.Logger.get(this).warn("Tried to focus but gave up as the component wasn't enabled or visible.");
771
- }
772
- }
773
- }
774
- };
775
- Object.defineProperty(FocusBindingDirective.prototype, "focusTarget", {
776
- get: /**
777
- * @return {?}
778
- */
779
- function () {
780
- return this.focusBindingTarget || this.el.nativeElement;
781
- },
782
- enumerable: true,
783
- configurable: true
784
- });
785
- // Hook method for debugging via tracing.
786
- // Hook method for debugging via tracing.
787
- /**
788
- * @return {?}
789
- */
790
- FocusBindingDirective.prototype.modelShouldStillHaveFocus =
791
- // Hook method for debugging via tracing.
792
- /**
793
- * @return {?}
794
- */
795
- function () {
796
- return this.hasBinding() && this.pectinFocusBinding.focusContext.focused.value;
797
- };
798
- // Hook method for debugging via tracing.
799
- // Hook method for debugging via tracing.
800
- /**
801
- * @return {?}
802
- */
803
- FocusBindingDirective.prototype.canFocus =
804
- // Hook method for debugging via tracing.
805
- /**
806
- * @return {?}
807
- */
808
- function () {
809
- /** @type {?} */
810
- var dimension = this.focusTarget.getBoundingClientRect();
811
- /** @type {?} */
812
- var hasSize = dimension.height >= 0 && dimension.height >= 0;
813
- // tslint:disable-next-line:no-string-literal
814
- return hasSize && !this.focusTarget['disabled'];
815
- };
816
- FocusBindingDirective.decorators = [
817
- { type: core.Directive, args: [{
818
- // tslint:disable-next-line:directive-selector
819
- selector: '[pectinFocusBinding]'
820
- },] }
821
- ];
822
- /** @nocollapse */
823
- FocusBindingDirective.ctorParameters = function () { return [
824
- { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] },
825
- { type: core.NgZone, decorators: [{ type: core.Inject, args: [core.NgZone,] }] },
826
- { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] }
827
- ]; };
828
- FocusBindingDirective.propDecorators = {
829
- pectinFocusBinding: [{ type: core.Input }],
830
- focusBindingTarget: [{ type: core.Input }],
831
- onFocusIn: [{ type: core.HostListener, args: ['focusin',] }],
832
- onFocusOut: [{ type: core.HostListener, args: ['focusout',] }]
833
- };
834
- return FocusBindingDirective;
835
- }(DisposableComponent));
836
- if (false) {
837
- /**
838
- * @type {?}
839
- * @private
840
- */
841
- FocusBindingDirective.prototype.document;
842
- /** @type {?} */
843
- FocusBindingDirective.prototype.pectinFocusBinding;
844
- /** @type {?} */
845
- FocusBindingDirective.prototype.focusBindingTarget;
846
- /**
847
- * @type {?}
848
- * @private
849
- */
850
- FocusBindingDirective.prototype.el;
851
- /**
852
- * @type {?}
853
- * @private
854
- */
855
- FocusBindingDirective.prototype.ngZone;
856
- }
857
-
858
- /**
859
- * @fileoverview added by tsickle
860
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
861
- */
862
- var StringInputComponent = /** @class */ (function (_super) {
863
- __extends(StringInputComponent, _super);
864
- function StringInputComponent() {
865
- return _super.call(this) || this;
866
- }
867
- /**
868
- * @return {?}
869
- */
870
- StringInputComponent.prototype.ngOnInit = /**
871
- * @return {?}
872
- */
873
- function () {
874
- };
875
- StringInputComponent.decorators = [
876
- { type: core.Component, args: [{
877
- selector: 'angular-ui-powerups-string-input',
878
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
879
- styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
880
- }] }
881
- ];
882
- /** @nocollapse */
883
- StringInputComponent.ctorParameters = function () { return []; };
884
- return StringInputComponent;
885
- }(AbstractInputComponent));
886
-
887
- /**
888
- * @fileoverview added by tsickle
889
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
890
- */
891
- var PasswordInputComponent = /** @class */ (function (_super) {
892
- __extends(PasswordInputComponent, _super);
893
- function PasswordInputComponent() {
894
- return _super.call(this) || this;
895
- }
896
- /**
897
- * @return {?}
898
- */
899
- PasswordInputComponent.prototype.ngOnInit = /**
900
- * @return {?}
901
- */
902
- function () {
903
- };
904
- PasswordInputComponent.decorators = [
905
- { type: core.Component, args: [{
906
- selector: 'angular-ui-powerups-password-input',
907
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
908
- styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
909
- }] }
910
- ];
911
- /** @nocollapse */
912
- PasswordInputComponent.ctorParameters = function () { return []; };
913
- return PasswordInputComponent;
914
- }(AbstractInputComponent));
915
-
916
- /**
917
- * @fileoverview added by tsickle
918
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
919
- */
920
- /**
921
- * @template T
922
- */
923
- var SelectInputComponent = /** @class */ (function (_super) {
924
- __extends(SelectInputComponent, _super);
925
- function SelectInputComponent() {
926
- var _this = _super.call(this) || this;
927
- _this.optionLabelFormat = (/**
928
- * @param {?} option
929
- * @return {?}
930
- */
931
- function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; });
932
- return _this;
933
- }
934
- /**
935
- * @return {?}
936
- */
937
- SelectInputComponent.prototype.ngOnInit = /**
938
- * @return {?}
939
- */
940
- function () {
941
- };
942
- SelectInputComponent.decorators = [
943
- { type: core.Component, args: [{
944
- selector: 'angular-ui-powerups-select-input',
945
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value\" [value]=\"option\">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
946
- styles: [":host{display:inline-block}mat-form-field{width:100%}"]
947
- }] }
948
- ];
949
- /** @nocollapse */
950
- SelectInputComponent.ctorParameters = function () { return []; };
951
- SelectInputComponent.propDecorators = {
952
- optionsModel: [{ type: core.Input }],
953
- options: [{ type: core.Input }],
954
- optionLabel: [{ type: core.Input }],
955
- optionLabelFormat: [{ type: core.Input }]
956
- };
957
- __decorate([
958
- pectin.UseDelegate(),
959
- __metadata("design:type", pectin.ListModel)
960
- ], SelectInputComponent.prototype, "optionsModel", void 0);
961
- __decorate([
962
- pectin.StoreInListModel('optionsModel'),
963
- __metadata("design:type", Array)
964
- ], SelectInputComponent.prototype, "options", void 0);
965
- return SelectInputComponent;
966
- }(AbstractInputComponent));
967
- if (false) {
968
- /** @type {?} */
969
- SelectInputComponent.prototype.optionsModel;
970
- /** @type {?} */
971
- SelectInputComponent.prototype.options;
972
- /** @type {?} */
973
- SelectInputComponent.prototype.optionLabel;
974
- /** @type {?} */
975
- SelectInputComponent.prototype.optionLabelFormat;
976
- }
977
-
978
- /**
979
- * @fileoverview added by tsickle
980
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
981
- */
982
- /** @type {?} */
983
- var INTERACTION_CONTEXT = new core.InjectionToken('InteractionContext');
984
- /**
985
- * @abstract
986
- */
987
- var /**
988
- * @abstract
989
- */
990
- InteractionContext = /** @class */ (function () {
991
- function InteractionContext() {
992
- }
993
- return InteractionContext;
994
- }());
995
- if (false) {
996
- /**
997
- * @abstract
998
- * @template D, R, E
999
- * @param {?} activityType
1000
- * @param {?=} data
1001
- * @return {?}
1002
- */
1003
- InteractionContext.prototype.startActivity = function (activityType, data) { };
1004
- /**
1005
- * @abstract
1006
- * @param {?} confirm
1007
- * @return {?}
1008
- */
1009
- InteractionContext.prototype.confirm = function (confirm) { };
1010
- /**
1011
- * @abstract
1012
- * @param {?} alert
1013
- * @return {?}
1014
- */
1015
- InteractionContext.prototype.alert = function (alert) { };
1016
- }
1017
-
1018
- /**
1019
- * @fileoverview added by tsickle
1020
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1021
- */
1022
- /**
1023
- * @template D, R, E
1024
- */
1025
- var /**
1026
- * @template D, R, E
1027
- */
1028
- AbstractActivity = /** @class */ (function (_super) {
1029
- __extends(AbstractActivity, _super);
1030
- function AbstractActivity() {
1031
- var _this = _super !== null && _super.apply(this, arguments) || this;
1032
- _this._doneListeners = new pectin.EventListenerList();
1033
- _this._cancelListeners = new pectin.EventListenerList();
1034
- _this._finishListeners = new pectin.EventListenerList();
1035
- _this._busyModel = new pectin.DelegatingValueModel().withDefault(false);
1036
- return _this;
1037
- }
1038
- /**
1039
- * @param {?} callback
1040
- * @return {?}
1041
- */
1042
- AbstractActivity.prototype.onDone = /**
1043
- * @param {?} callback
1044
- * @return {?}
1045
- */
1046
- function (callback) {
1047
- this._doneListeners.add(callback);
1048
- };
1049
- /**
1050
- * @param {?} callback
1051
- * @return {?}
1052
- */
1053
- AbstractActivity.prototype.onCancel = /**
1054
- * @param {?} callback
1055
- * @return {?}
1056
- */
1057
- function (callback) {
1058
- this._cancelListeners.add(callback);
1059
- };
1060
- /**
1061
- * @param {?=} result
1062
- * @return {?}
1063
- */
1064
- AbstractActivity.prototype.done = /**
1065
- * @param {?=} result
1066
- * @return {?}
1067
- */
1068
- function (result) {
1069
- var _this = this;
1070
- return this._doneListeners
1071
- .fireAndWait((/**
1072
- * @param {?} l
1073
- * @return {?}
1074
- */
1075
- function (l) { return l(result); }))
1076
- .finally((/**
1077
- * @return {?}
1078
- */
1079
- function () { return _this.finalizeAndDispose(); }));
1080
- };
1081
- /**
1082
- * @param {?=} error
1083
- * @return {?}
1084
- */
1085
- AbstractActivity.prototype.cancel = /**
1086
- * @param {?=} error
1087
- * @return {?}
1088
- */
1089
- function (error) {
1090
- var _this = this;
1091
- return this._cancelListeners
1092
- .fireAndWait((/**
1093
- * @param {?} l
1094
- * @return {?}
1095
- */
1096
- function (l) { return l(error); }))
1097
- .finally((/**
1098
- * @return {?}
1099
- */
1100
- function () { return _this.finalizeAndDispose(); }));
1101
- };
1102
- /**
1103
- * @private
1104
- * @return {?}
1105
- */
1106
- AbstractActivity.prototype.finalizeAndDispose = /**
1107
- * @private
1108
- * @return {?}
1109
- */
1110
- function () {
1111
- // this._activeModel.value = false;
1112
- this._finishListeners.fire((/**
1113
- * @param {?} l
1114
- * @return {?}
1115
- */
1116
- function (l) { return l(); }));
1117
- // this._interactionContext = null;
1118
- // this._initialized = false;
1119
- [
1120
- this._finishListeners,
1121
- this._doneListeners,
1122
- this._cancelListeners
1123
- ].forEach((/**
1124
- * @param {?} l
1125
- * @return {?}
1126
- */
1127
- function (l) { return l.dispose(); }));
1128
- };
1129
- Object.defineProperty(AbstractActivity.prototype, "busy", {
1130
- get: /**
1131
- * @return {?}
1132
- */
1133
- function () {
1134
- return this._busyModel.readonly;
1135
- },
1136
- enumerable: true,
1137
- configurable: true
1138
- });
1139
- /**
1140
- * @param {?} busyModel
1141
- * @return {?}
1142
- */
1143
- AbstractActivity.prototype.busyWhile = /**
1144
- * @param {?} busyModel
1145
- * @return {?}
1146
- */
1147
- function (busyModel) {
1148
- this._busyModel.setDelegate(busyModel);
1149
- };
1150
- /**
1151
- * @return {?}
1152
- */
1153
- AbstractActivity.prototype.isBusy = /**
1154
- * @return {?}
1155
- */
1156
- function () {
1157
- return this._busyModel.value;
1158
- };
1159
- return AbstractActivity;
1160
- }(DisposableComponent));
1161
- if (false) {
1162
- /**
1163
- * @type {?}
1164
- * @private
1165
- */
1166
- AbstractActivity.prototype._doneListeners;
1167
- /**
1168
- * @type {?}
1169
- * @private
1170
- */
1171
- AbstractActivity.prototype._cancelListeners;
1172
- /**
1173
- * @type {?}
1174
- * @private
1175
- */
1176
- AbstractActivity.prototype._finishListeners;
1177
- /**
1178
- * @type {?}
1179
- * @private
1180
- */
1181
- AbstractActivity.prototype._busyModel;
1182
- }
1183
-
1184
- /**
1185
- * @fileoverview added by tsickle
1186
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1187
- */
1188
- /** @type {?} */
1189
- var ACTIVITY_DATA = new core.InjectionToken('InteractionActivityData');
1190
- /**
1191
- * @record
1192
- * @template D, R, E
1193
- */
1194
- function Activity() { }
1195
- if (false) {
1196
- /** @type {?} */
1197
- Activity.prototype.busy;
1198
- /**
1199
- * @param {?} callback
1200
- * @return {?}
1201
- */
1202
- Activity.prototype.onDone = function (callback) { };
1203
- /**
1204
- * @param {?} callback
1205
- * @return {?}
1206
- */
1207
- Activity.prototype.onCancel = function (callback) { };
1208
- }
1209
-
1210
- /**
1211
- * @fileoverview added by tsickle
1212
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1213
- */
1214
- var AlertDialogComponent = /** @class */ (function (_super) {
1215
- __extends(AlertDialogComponent, _super);
1216
- function AlertDialogComponent(alert) {
1217
- var _this = _super.call(this) || this;
1218
- _this.alert = alert;
1219
- return _this;
1220
- }
1221
- /**
1222
- * @return {?}
1223
- */
1224
- AlertDialogComponent.prototype.ngOnInit = /**
1225
- * @return {?}
1226
- */
1227
- function () {
1228
- };
1229
- AlertDialogComponent.decorators = [
1230
- { type: core.Component, args: [{
1231
- selector: 'angular-ui-powerups-alert-dialog',
1232
- template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\">{{alert.ok()}}</button>\n</p>\n",
1233
- styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1234
- }] }
1235
- ];
1236
- /** @nocollapse */
1237
- AlertDialogComponent.ctorParameters = function () { return [
1238
- { type: undefined, decorators: [{ type: core.Inject, args: [ACTIVITY_DATA,] }] }
1239
- ]; };
1240
- return AlertDialogComponent;
1241
- }(AbstractActivity));
1242
- if (false) {
1243
- /** @type {?} */
1244
- AlertDialogComponent.prototype.alert;
1245
- }
1246
-
1247
- /**
1248
- * @fileoverview added by tsickle
1249
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1250
- */
1251
- var ConfirmationDialogComponent = /** @class */ (function (_super) {
1252
- __extends(ConfirmationDialogComponent, _super);
1253
- function ConfirmationDialogComponent(confirm) {
1254
- var _this = _super.call(this) || this;
1255
- _this.confirm = confirm;
1256
- pectin.assert.notNil(confirm);
1257
- console.log(confirm);
1258
- return _this;
1259
- }
1260
- /**
1261
- * @return {?}
1262
- */
1263
- ConfirmationDialogComponent.prototype.ngOnInit = /**
1264
- * @return {?}
1265
- */
1266
- function () {
1267
- };
1268
- /**
1269
- * @return {?}
1270
- */
1271
- ConfirmationDialogComponent.prototype.isDestructive = /**
1272
- * @return {?}
1273
- */
1274
- function () {
1275
- return this.confirm.destructive && this.confirm.destructive();
1276
- };
1277
- ConfirmationDialogComponent.decorators = [
1278
- { type: core.Component, args: [{
1279
- selector: 'angular-ui-powerups-confirmation-dialog',
1280
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\" (click)=\"done(true)\">{{confirm.ok()}}</button>\n</p>\n\n",
1281
- styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1282
- }] }
1283
- ];
1284
- /** @nocollapse */
1285
- ConfirmationDialogComponent.ctorParameters = function () { return [
1286
- { type: undefined, decorators: [{ type: core.Inject, args: [ACTIVITY_DATA,] }] }
1287
- ]; };
1288
- return ConfirmationDialogComponent;
1289
- }(AbstractActivity));
1290
- if (false) {
1291
- /** @type {?} */
1292
- ConfirmationDialogComponent.prototype.confirm;
1293
- }
1294
-
1295
- /**
1296
- * @fileoverview added by tsickle
1297
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1298
- */
1299
- exports.ɵq = /** @class */ (function (_super) {
1300
- __extends(ActivityContainerComponent, _super);
1301
- function ActivityContainerComponent() {
1302
- var _this = _super.call(this) || this;
1303
- _this.activityTabs = new pectin.MutableListModel();
1304
- _this.obsoleteTabs = [];
1305
- return _this;
1306
- }
1307
- /**
1308
- * @return {?}
1309
- */
1310
- ActivityContainerComponent.prototype.ngOnInit = /**
1311
- * @return {?}
1312
- */
1313
- function () {
1314
- };
1315
- /**
1316
- * @return {?}
1317
- */
1318
- ActivityContainerComponent.prototype.ngAfterViewInit = /**
1319
- * @return {?}
1320
- */
1321
- function () {
1322
- var _this = this;
1323
- var observe = pectin.Dsl.disposeWith(this).observe;
1324
- observe.valuesFrom(this.tabs.animationDone).subscribe((/**
1325
- * @return {?}
1326
- */
1327
- function () { return _this.cleanUpTabs(); }));
1328
- };
1329
- /**
1330
- * @template D, R, E
1331
- * @param {?} options
1332
- * @return {?}
1333
- */
1334
- ActivityContainerComponent.prototype.initialise = /**
1335
- * @template D, R, E
1336
- * @param {?} options
1337
- * @return {?}
1338
- */
1339
- function (options) {
1340
- this.initialActivity = __assign({}, options, { interactionContext: this });
1341
- };
1342
- /**
1343
- * @template D, R, E
1344
- * @param {?} activityType
1345
- * @param {?=} data
1346
- * @return {?}
1347
- */
1348
- ActivityContainerComponent.prototype.startActivity = /**
1349
- * @template D, R, E
1350
- * @param {?} activityType
1351
- * @param {?=} data
1352
- * @return {?}
1353
- */
1354
- function (activityType, data) {
1355
- var _this = this;
1356
- /** @type {?} */
1357
- var deferred = deferred_class.Deferred.defer();
1358
- /** @type {?} */
1359
- var context = {
1360
- interactionContext: this,
1361
- activityClass: activityType,
1362
- activityData: data,
1363
- onDone: deferred.resolve,
1364
- onCancel: deferred.reject
1365
- };
1366
- this.activityTabs.push(context);
1367
- this.tabs.selectedIndex = this.activityTabs.length;
1368
- return deferred.promise.finally((/**
1369
- * @return {?}
1370
- */
1371
- function () {
1372
- _this.obsoleteTabs.push(context);
1373
- _this.tabs.selectedIndex = _this.activityTabs.length - 1;
1374
- }));
1375
- };
1376
- /**
1377
- * @param {?} alert
1378
- * @return {?}
1379
- */
1380
- ActivityContainerComponent.prototype.alert = /**
1381
- * @param {?} alert
1382
- * @return {?}
1383
- */
1384
- function (alert) {
1385
- return this.startActivity(AlertDialogComponent, alert);
1386
- };
1387
- /**
1388
- * @param {?} confirm
1389
- * @return {?}
1390
- */
1391
- ActivityContainerComponent.prototype.confirm = /**
1392
- * @param {?} confirm
1393
- * @return {?}
1394
- */
1395
- function (confirm) {
1396
- return this.startActivity(ConfirmationDialogComponent, confirm);
1397
- };
1398
- /**
1399
- * @private
1400
- * @return {?}
1401
- */
1402
- ActivityContainerComponent.prototype.cleanUpTabs = /**
1403
- * @private
1404
- * @return {?}
1405
- */
1406
- function () {
1407
- var _this = this;
1408
- this.activityTabs.value = this.activityTabs.value.filter((/**
1409
- * @param {?} tab
1410
- * @return {?}
1411
- */
1412
- function (tab) {
1413
- return !_this.obsoleteTabs.includes(tab);
1414
- }));
1415
- };
1416
- ActivityContainerComponent.decorators = [
1417
- { type: core.Component, args: [{
1418
- selector: 'angular-ui-powerups-activity-container',
1419
- template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab>\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\" [activityContext]=\"initialActivity\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <angular-ui-powerups-activity-outlet [interactionContext]=\"this\" [activityContext]=\"tab\"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1420
- styles: [":host{display:block}"]
1421
- }] }
1422
- ];
1423
- /** @nocollapse */
1424
- ActivityContainerComponent.ctorParameters = function () { return []; };
1425
- ActivityContainerComponent.propDecorators = {
1426
- parentInteractionContext: [{ type: core.Input }],
1427
- initialActivity: [{ type: core.Input }],
1428
- tabs: [{ type: core.ViewChild, args: ['tabs', { static: true },] }]
1429
- };
1430
- return ActivityContainerComponent;
1431
- }(DisposableComponent));
1432
- if (false) {
1433
- /** @type {?} */
1434
- exports.ɵq.prototype.parentInteractionContext;
1435
- /** @type {?} */
1436
- exports.ɵq.prototype.initialActivity;
1437
- /** @type {?} */
1438
- exports.ɵq.prototype.tabs;
1439
- /** @type {?} */
1440
- exports.ɵq.prototype.activityTabs;
1441
- /**
1442
- * @type {?}
1443
- * @private
1444
- */
1445
- exports.ɵq.prototype.obsoleteTabs;
1446
- }
1447
- (function (ActivityContainerComponent) {
1448
- /**
1449
- * @record
1450
- * @template D, R, E
1451
- */
1452
- function ActivityContext() { }
1453
- ActivityContainerComponent.ActivityContext = ActivityContext;
1454
- if (false) {
1455
- /** @type {?} */
1456
- ActivityContext.prototype.activityClass;
1457
- /** @type {?} */
1458
- ActivityContext.prototype.activityData;
1459
- /** @type {?} */
1460
- ActivityContext.prototype.onDone;
1461
- /** @type {?} */
1462
- ActivityContext.prototype.onCancel;
1463
- }
1464
- })(exports.ɵq || (exports.ɵq = {}));
1465
-
1466
- /**
1467
- * @fileoverview added by tsickle
1468
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1469
- */
1470
- /**
1471
- * @template D, R, E
1472
- */
1473
- exports.ɵx = /** @class */ (function () {
1474
- function ActivityOutletComponent(componentFactoryResolver, viewContainerRef, injector) {
1475
- this.componentFactoryResolver = componentFactoryResolver;
1476
- this.viewContainerRef = viewContainerRef;
1477
- this.injector = injector;
1478
- }
1479
- Object.defineProperty(ActivityOutletComponent.prototype, "activityContext", {
1480
- set: /**
1481
- * @param {?} activityContext
1482
- * @return {?}
1483
- */
1484
- function (activityContext) {
1485
- this.loadActivity(activityContext);
1486
- },
1487
- enumerable: true,
1488
- configurable: true
1489
- });
1490
- ;
1491
- /**
1492
- * @return {?}
1493
- */
1494
- ActivityOutletComponent.prototype.ngOnInit = /**
1495
- * @return {?}
1496
- */
1497
- function () {
1498
- };
1499
- /**
1500
- * @param {?} activityContext
1501
- * @return {?}
1502
- */
1503
- ActivityOutletComponent.prototype.loadActivity = /**
1504
- * @param {?} activityContext
1505
- * @return {?}
1506
- */
1507
- function (activityContext) {
1508
- /** @type {?} */
1509
- var injector = core.Injector.create({
1510
- providers: [
1511
- {
1512
- provide: InteractionContext,
1513
- useValue: this
1514
- },
1515
- { provide: ACTIVITY_DATA, useValue: activityContext.activityData }
1516
- ],
1517
- parent: this.injector
1518
- });
1519
- /** @type {?} */
1520
- var componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityContext.activityClass);
1521
- this.viewContainerRef.clear();
1522
- this.activityComponent = this.viewContainerRef.createComponent(componentFactory, 0, injector);
1523
- this.activityComponent.instance.onDone(activityContext.onDone);
1524
- this.activityComponent.instance.onCancel(activityContext.onCancel);
1525
- };
1526
- /**
1527
- * @param {?} alert
1528
- * @return {?}
1529
- */
1530
- ActivityOutletComponent.prototype.alert = /**
1531
- * @param {?} alert
1532
- * @return {?}
1533
- */
1534
- function (alert) {
1535
- return this.interactionContext.alert(alert);
1536
- };
1537
- /**
1538
- * @param {?} confirm
1539
- * @return {?}
1540
- */
1541
- ActivityOutletComponent.prototype.confirm = /**
1542
- * @param {?} confirm
1543
- * @return {?}
1544
- */
1545
- function (confirm) {
1546
- return this.interactionContext.confirm(confirm);
1547
- };
1548
- /**
1549
- * @template D1, R1, E1
1550
- * @param {?} activityType
1551
- * @param {?=} data
1552
- * @return {?}
1553
- */
1554
- ActivityOutletComponent.prototype.startActivity = /**
1555
- * @template D1, R1, E1
1556
- * @param {?} activityType
1557
- * @param {?=} data
1558
- * @return {?}
1559
- */
1560
- function (activityType, data) {
1561
- return this.interactionContext.startActivity(activityType, data);
1562
- };
1563
- ActivityOutletComponent.decorators = [
1564
- { type: core.Component, args: [{
1565
- selector: 'angular-ui-powerups-activity-outlet',
1566
- template: '',
1567
- styles: [":host{display:block}"]
1568
- }] }
1569
- ];
1570
- /** @nocollapse */
1571
- ActivityOutletComponent.ctorParameters = function () { return [
1572
- { type: core.ComponentFactoryResolver },
1573
- { type: core.ViewContainerRef },
1574
- { type: core.Injector }
1575
- ]; };
1576
- ActivityOutletComponent.propDecorators = {
1577
- interactionContext: [{ type: core.Input }],
1578
- activityContext: [{ type: core.Input }]
1579
- };
1580
- return ActivityOutletComponent;
1581
- }());
1582
- if (false) {
1583
- /** @type {?} */
1584
- exports.ɵx.prototype.interactionContext;
1585
- /**
1586
- * @type {?}
1587
- * @private
1588
- */
1589
- exports.ɵx.prototype.activityComponent;
1590
- /**
1591
- * @type {?}
1592
- * @private
1593
- */
1594
- exports.ɵx.prototype.componentFactoryResolver;
1595
- /**
1596
- * @type {?}
1597
- * @private
1598
- */
1599
- exports.ɵx.prototype.viewContainerRef;
1600
- /**
1601
- * @type {?}
1602
- * @private
1603
- */
1604
- exports.ɵx.prototype.injector;
1605
- /* Skipping unhandled member: ;*/
1606
- }
1607
- (function (ActivityOutletComponent) {
1608
- /**
1609
- * @template D, R, E
1610
- */
1611
- var /**
1612
- * @template D, R, E
1613
- */
1614
- OutletInteractionContext = /** @class */ (function () {
1615
- function OutletInteractionContext(context) {
1616
- this.context = context;
1617
- }
1618
- /**
1619
- * @param {?} alert
1620
- * @return {?}
1621
- */
1622
- OutletInteractionContext.prototype.alert = /**
1623
- * @param {?} alert
1624
- * @return {?}
1625
- */
1626
- function (alert) {
1627
- return pectin.lang.notImplemented();
1628
- };
1629
- /**
1630
- * @param {?} confirm
1631
- * @return {?}
1632
- */
1633
- OutletInteractionContext.prototype.confirm = /**
1634
- * @param {?} confirm
1635
- * @return {?}
1636
- */
1637
- function (confirm) {
1638
- return pectin.lang.notImplemented();
1639
- };
1640
- /**
1641
- * @template D1, R1, E1
1642
- * @param {?} activityType
1643
- * @param {?=} data
1644
- * @return {?}
1645
- */
1646
- OutletInteractionContext.prototype.startActivity = /**
1647
- * @template D1, R1, E1
1648
- * @param {?} activityType
1649
- * @param {?=} data
1650
- * @return {?}
1651
- */
1652
- function (activityType, data) {
1653
- return pectin.lang.notImplemented();
1654
- };
1655
- return OutletInteractionContext;
1656
- }());
1657
- ActivityOutletComponent.OutletInteractionContext = OutletInteractionContext;
1658
- if (false) {
1659
- /**
1660
- * @type {?}
1661
- * @private
1662
- */
1663
- OutletInteractionContext.prototype.context;
1664
- }
1665
- })(exports.ɵx || (exports.ɵx = {}));
1666
-
1667
- /**
1668
- * @fileoverview added by tsickle
1669
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1670
- */
1671
- var DialogInteractionService = /** @class */ (function (_super) {
1672
- __extends(DialogInteractionService, _super);
1673
- function DialogInteractionService(dialogService) {
1674
- var _this = _super.call(this) || this;
1675
- _this.dialogService = dialogService;
1676
- typescriptUtilities.assert.notNil(dialogService);
1677
- return _this;
1678
- }
1679
- /**
1680
- * @template D, R, E
1681
- * @param {?} activityType
1682
- * @param {?=} data
1683
- * @return {?}
1684
- */
1685
- DialogInteractionService.prototype.startActivity = /**
1686
- * @template D, R, E
1687
- * @param {?} activityType
1688
- * @param {?=} data
1689
- * @return {?}
1690
- */
1691
- function (activityType, data) {
1692
- return this._startActivity(activityType, data);
1693
- };
1694
- /**
1695
- * @private
1696
- * @template D, R, E
1697
- * @param {?} activityType
1698
- * @param {?} data
1699
- * @param {?=} disableClose
1700
- * @return {?}
1701
- */
1702
- DialogInteractionService.prototype._startActivity = /**
1703
- * @private
1704
- * @template D, R, E
1705
- * @param {?} activityType
1706
- * @param {?} data
1707
- * @param {?=} disableClose
1708
- * @return {?}
1709
- */
1710
- function (activityType, data, disableClose) {
1711
- var _this = this;
1712
- if (disableClose === void 0) { disableClose = true; }
1713
- /** @type {?} */
1714
- var config = {
1715
- data: data,
1716
- disableClose: disableClose,
1717
- panelClass: 'dialog-interaction-service',
1718
- autoFocus: false
1719
- };
1720
- /** @type {?} */
1721
- var matDialogRef = (/** @type {?} */ (this.dialogService.open(exports.ɵq, config)));
1722
- return new Promise((/**
1723
- * @param {?} resolve
1724
- * @param {?} reject
1725
- * @return {?}
1726
- */
1727
- function (resolve, reject) {
1728
- /** @type {?} */
1729
- var activityContainer = matDialogRef.componentInstance;
1730
- activityContainer.parentInteractionContext = _this;
1731
- activityContainer.initialise({
1732
- activityClass: activityType,
1733
- activityData: data,
1734
- onDone: /**
1735
- * @param {?} result
1736
- * @return {?}
1737
- */
1738
- function (result) {
1739
- resolve(result);
1740
- matDialogRef.close(result);
1741
- },
1742
- onCancel: /**
1743
- * @param {?} error
1744
- * @return {?}
1745
- */
1746
- function (error) {
1747
- reject(error);
1748
- matDialogRef.close(error);
1749
- }
1750
- });
1751
- matDialogRef.updateSize();
1752
- }));
1753
- };
1754
- /**
1755
- * @param {?} alert
1756
- * @return {?}
1757
- */
1758
- DialogInteractionService.prototype.alert = /**
1759
- * @param {?} alert
1760
- * @return {?}
1761
- */
1762
- function (alert) {
1763
- return this._startActivity(AlertDialogComponent, alert, false);
1764
- };
1765
- /**
1766
- * @param {?} confirm
1767
- * @return {?}
1768
- */
1769
- DialogInteractionService.prototype.confirm = /**
1770
- * @param {?} confirm
1771
- * @return {?}
1772
- */
1773
- function (confirm) {
1774
- return this._startActivity(ConfirmationDialogComponent, confirm, true);
1775
- };
1776
- DialogInteractionService.decorators = [
1777
- { type: core.Injectable, args: [{
1778
- providedIn: 'root'
1779
- },] }
1780
- ];
1781
- /** @nocollapse */
1782
- DialogInteractionService.ctorParameters = function () { return [
1783
- { type: material.MatDialog }
1784
- ]; };
1785
- /** @nocollapse */ DialogInteractionService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DialogInteractionService_Factory() { return new DialogInteractionService(core.ɵɵinject(dialog.MatDialog)); }, token: DialogInteractionService, providedIn: "root" });
1786
- return DialogInteractionService;
1787
- }(InteractionContext));
1788
- if (false) {
1789
- /**
1790
- * @type {?}
1791
- * @private
1792
- */
1793
- DialogInteractionService.prototype.dialogService;
1794
- }
1795
-
1796
- /**
1797
- * @fileoverview added by tsickle
1798
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1799
- */
1800
- var InteractionModule = /** @class */ (function () {
1801
- function InteractionModule() {
1802
- }
1803
- InteractionModule.decorators = [
1804
- { type: core.NgModule, args: [{
1805
- imports: [
1806
- common.CommonModule,
1807
- material.MatButtonModule,
1808
- material.MatDialogModule,
1809
- material.MatTabsModule,
1810
- portal.PortalModule
1811
- ],
1812
- declarations: [
1813
- exports.ɵq,
1814
- ConfirmationDialogComponent,
1815
- AlertDialogComponent,
1816
- exports.ɵx
1817
- ],
1818
- entryComponents: [
1819
- exports.ɵq,
1820
- ConfirmationDialogComponent,
1821
- AlertDialogComponent
1822
- ],
1823
- providers: [
1824
- DialogInteractionService
1825
- ]
1826
- },] }
1827
- ];
1828
- return InteractionModule;
1829
- }());
1830
-
1831
- /**
1832
- * @fileoverview added by tsickle
1833
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1834
- */
1835
- var BusyOverlayComponent = /** @class */ (function () {
1836
- function BusyOverlayComponent() {
1837
- }
1838
- /**
1839
- * @return {?}
1840
- */
1841
- BusyOverlayComponent.prototype.ngOnInit = /**
1842
- * @return {?}
1843
- */
1844
- function () {
1845
- };
1846
- BusyOverlayComponent.decorators = [
1847
- { type: core.Component, args: [{
1848
- selector: 'angular-ui-powerups-busy-overlay',
1849
- template: "<ng-content></ng-content>\n<div class=\"busy-overlay-backdrop\" *ngIf=\"busyModel.value\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"52\"></mat-progress-spinner>\n</div>\n",
1850
- styles: [":host{position:relative}div.busy-overlay-backdrop{position:absolute;background-color:rgba(0,0,0,.2);top:0;left:0;bottom:0;right:0;display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;-ms-grid-rows:auto;grid-template-rows:auto;place-content:center}"]
1851
- }] }
1852
- ];
1853
- /** @nocollapse */
1854
- BusyOverlayComponent.ctorParameters = function () { return []; };
1855
- BusyOverlayComponent.propDecorators = {
1856
- busyModel: [{ type: core.Input }],
1857
- busy: [{ type: core.Input }]
1858
- };
1859
- __decorate([
1860
- pectin.UseDelegate(),
1861
- __metadata("design:type", pectin.ValueModel)
1862
- ], BusyOverlayComponent.prototype, "busyModel", void 0);
1863
- __decorate([
1864
- pectin.StoreInValueModel('busyModel'),
1865
- __metadata("design:type", Boolean)
1866
- ], BusyOverlayComponent.prototype, "busy", void 0);
1867
- return BusyOverlayComponent;
1868
- }());
1869
- if (false) {
1870
- /** @type {?} */
1871
- BusyOverlayComponent.prototype.busyModel;
1872
- /** @type {?} */
1873
- BusyOverlayComponent.prototype.busy;
1874
- }
1875
-
1876
- /**
1877
- * @fileoverview added by tsickle
1878
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1879
- */
1880
- var EmptyStateComponent = /** @class */ (function () {
1881
- function EmptyStateComponent() {
1882
- }
1883
- /**
1884
- * @return {?}
1885
- */
1886
- EmptyStateComponent.prototype.ngOnInit = /**
1887
- * @return {?}
1888
- */
1889
- function () {
1890
- };
1891
- EmptyStateComponent.decorators = [
1892
- { type: core.Component, args: [{
1893
- selector: 'angular-ui-powerups-empty-state',
1894
- template: "\n <div class=\"container\">\n <ng-content></ng-content>\n </div>\n ",
1895
- styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--angular-ui-powerups-default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]
1896
- }] }
1897
- ];
1898
- /** @nocollapse */
1899
- EmptyStateComponent.ctorParameters = function () { return []; };
1900
- return EmptyStateComponent;
1901
- }());
1902
-
1903
- /**
1904
- * @fileoverview added by tsickle
1905
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1906
- */
1907
- var NavComponent = /** @class */ (function () {
1908
- function NavComponent() {
1909
- }
1910
- /**
1911
- * @return {?}
1912
- */
1913
- NavComponent.prototype.ngOnInit = /**
1914
- * @return {?}
1915
- */
1916
- function () {
1917
- };
1918
- NavComponent.decorators = [
1919
- { type: core.Component, args: [{
1920
- selector: 'angular-ui-powerups-nav',
1921
- template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let placeDescriptor of places\" [routerLink]='placeDescriptor.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"placeDescriptor.title\">{{placeDescriptor.title}}</a>\n</nav>\n\n",
1922
- styles: [""]
1923
- }] }
1924
- ];
1925
- /** @nocollapse */
1926
- NavComponent.ctorParameters = function () { return []; };
1927
- NavComponent.propDecorators = {
1928
- places: [{ type: core.Input }]
1929
- };
1930
- return NavComponent;
1931
- }());
1932
- if (false) {
1933
- /** @type {?} */
1934
- NavComponent.prototype.places;
1935
- }
1936
-
1937
- /**
1938
- * @fileoverview added by tsickle
1939
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1940
- */
1941
- var PlaceService = /** @class */ (function () {
1942
- function PlaceService() {
1943
- this._activePlaces = new pectin.MutableListModel();
1944
- }
1945
- Object.defineProperty(PlaceService.prototype, "activePlaces", {
1946
- get: /**
1947
- * @return {?}
1948
- */
1949
- function () {
1950
- return this._activePlaces.readonly;
1951
- },
1952
- enumerable: true,
1953
- configurable: true
1954
- });
1955
- /**
1956
- * @param {?} place
1957
- * @return {?}
1958
- */
1959
- PlaceService.prototype.onActivate = /**
1960
- * @param {?} place
1961
- * @return {?}
1962
- */
1963
- function (place) {
1964
- this._activePlaces.push(place);
1965
- };
1966
- /**
1967
- * @param {?} place
1968
- * @return {?}
1969
- */
1970
- PlaceService.prototype.onDeactivate = /**
1971
- * @param {?} place
1972
- * @return {?}
1973
- */
1974
- function (place) {
1975
- this._activePlaces.remove(place);
1976
- };
1977
- PlaceService.decorators = [
1978
- { type: core.Injectable, args: [{
1979
- providedIn: 'root'
1980
- },] }
1981
- ];
1982
- /** @nocollapse */
1983
- PlaceService.ctorParameters = function () { return []; };
1984
- /** @nocollapse */ PlaceService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(); }, token: PlaceService, providedIn: "root" });
1985
- __decorate([
1986
- pectin.Trace(),
1987
- __metadata("design:type", Function),
1988
- __metadata("design:paramtypes", [Object]),
1989
- __metadata("design:returntype", void 0)
1990
- ], PlaceService.prototype, "onActivate", null);
1991
- __decorate([
1992
- pectin.Trace(),
1993
- __metadata("design:type", Function),
1994
- __metadata("design:paramtypes", [Object]),
1995
- __metadata("design:returntype", void 0)
1996
- ], PlaceService.prototype, "onDeactivate", null);
1997
- return PlaceService;
1998
- }());
1999
- if (false) {
2000
- /**
2001
- * @type {?}
2002
- * @private
2003
- */
2004
- PlaceService.prototype._activePlaces;
2005
- }
2006
-
2007
- /**
2008
- * @fileoverview added by tsickle
2009
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2010
- */
2011
- /** @type {?} */
2012
- var left = [
2013
- animations$1.query(':enter, :leave', animations$1.style({ position: 'fixed', width: '100%' }), { optional: true }),
2014
- animations$1.group([
2015
- animations$1.query(':enter', [animations$1.style({ transform: 'translateX(-100%)' }), animations$1.animate('.3s ease-out', animations$1.style({ transform: 'translateX(0%)' }))], {
2016
- optional: true,
2017
- }),
2018
- animations$1.query(':leave', [animations$1.style({ transform: 'translateX(0%)' }), animations$1.animate('.3s ease-out', animations$1.style({ transform: 'translateX(100%)' }))], {
2019
- optional: true,
2020
- }),
2021
- ]),
2022
- ];
2023
- /** @type {?} */
2024
- var right = [
2025
- animations$1.query(':enter, :leave', animations$1.style({ position: 'fixed', width: '100%' }), { optional: true }),
2026
- animations$1.group([
2027
- animations$1.query(':enter', [animations$1.style({ transform: 'translateX(100%)' }), animations$1.animate('.3s ease-out', animations$1.style({ transform: 'translateX(0%)' }))], {
2028
- optional: true,
2029
- }),
2030
- animations$1.query(':leave', [animations$1.style({ transform: 'translateX(0%)' }), animations$1.animate('.3s ease-out', animations$1.style({ transform: 'translateX(-100%)' }))], {
2031
- optional: true,
2032
- }),
2033
- ]),
2034
- ];
2035
- /** @type {?} */
2036
- var LEFT_RIGHT_PLACE_ANIMATION = animations$1.trigger('routeAnimations', [
2037
- animations$1.transition(':increment', right),
2038
- animations$1.transition(':decrement', left),
2039
- ]);
2040
-
2041
- /**
2042
- * @fileoverview added by tsickle
2043
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2044
- */
2045
- var PlaceOutletComponent = /** @class */ (function () {
2046
- function PlaceOutletComponent(placeService) {
2047
- this.placeService = placeService;
2048
- this.animate = true;
2049
- }
2050
- /**
2051
- * @return {?}
2052
- */
2053
- PlaceOutletComponent.prototype.ngOnInit = /**
2054
- * @return {?}
2055
- */
2056
- function () {
2057
- };
2058
- /**
2059
- * @param {?} $event
2060
- * @return {?}
2061
- */
2062
- PlaceOutletComponent.prototype.onActivate = /**
2063
- * @param {?} $event
2064
- * @return {?}
2065
- */
2066
- function ($event) {
2067
- this.placeService.onActivate($event);
2068
- };
2069
- /**
2070
- * @param {?} $event
2071
- * @return {?}
2072
- */
2073
- PlaceOutletComponent.prototype.onDeactivate = /**
2074
- * @param {?} $event
2075
- * @return {?}
2076
- */
2077
- function ($event) {
2078
- this.placeService.onDeactivate($event);
2079
- };
2080
- /**
2081
- * @param {?} outlet
2082
- * @return {?}
2083
- */
2084
- PlaceOutletComponent.prototype.getPlaceOrder = /**
2085
- * @param {?} outlet
2086
- * @return {?}
2087
- */
2088
- function (outlet) {
2089
- return this.animate && outlet && outlet.activatedRouteData && outlet.activatedRouteData['placeOrder'];
2090
- };
2091
- PlaceOutletComponent.decorators = [
2092
- { type: core.Component, args: [{
2093
- selector: 'angular-ui-powerups-place-outlet',
2094
- template: "<div container [@routeAnimations]=\"getPlaceOrder(routerOutlet)\">\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onActivate($event)\"\n (deactivate)=\"onDeactivate($event)\">\n </router-outlet>\n</div>\n\n",
2095
- animations: [LEFT_RIGHT_PLACE_ANIMATION],
2096
- styles: [":host{display:block}.container{grid-area:main;display:-ms-grid;display:grid;-ms-grid-rows:0 1fr;grid-template-rows:0 1fr;min-height:0}"]
2097
- }] }
2098
- ];
2099
- /** @nocollapse */
2100
- PlaceOutletComponent.ctorParameters = function () { return [
2101
- { type: PlaceService }
2102
- ]; };
2103
- PlaceOutletComponent.propDecorators = {
2104
- animate: [{ type: core.Input }]
2105
- };
2106
- return PlaceOutletComponent;
2107
- }());
2108
- if (false) {
2109
- /** @type {?} */
2110
- PlaceOutletComponent.prototype.animate;
2111
- /**
2112
- * @type {?}
2113
- * @private
2114
- */
2115
- PlaceOutletComponent.prototype.placeService;
2116
- }
2117
-
2118
- /**
2119
- * @fileoverview added by tsickle
2120
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2121
- */
2122
- var PlaceModule = /** @class */ (function () {
2123
- function PlaceModule() {
2124
- }
2125
- PlaceModule.decorators = [
2126
- { type: core.NgModule, args: [{
2127
- imports: [
2128
- common.CommonModule,
2129
- animations.BrowserAnimationsModule,
2130
- material.MatProgressSpinnerModule,
2131
- router.RouterModule,
2132
- tabs.MatTabsModule,
2133
- list.MatListModule,
2134
- tooltip.MatTooltipModule
2135
- ],
2136
- declarations: [
2137
- EmptyStateComponent,
2138
- BusyOverlayComponent,
2139
- PlaceOutletComponent,
2140
- NavComponent
2141
- ],
2142
- entryComponents: [BusyOverlayComponent],
2143
- exports: [
2144
- BusyOverlayComponent,
2145
- PlaceOutletComponent,
2146
- EmptyStateComponent,
2147
- NavComponent
2148
- ],
2149
- providers: [
2150
- PlaceService
2151
- ]
2152
- },] }
2153
- ];
2154
- return PlaceModule;
2155
- }());
2156
-
2157
- /**
2158
- * @fileoverview added by tsickle
2159
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2160
- */
2161
- var AngularUiPowerupsModule = /** @class */ (function () {
2162
- function AngularUiPowerupsModule() {
2163
- }
2164
- AngularUiPowerupsModule.decorators = [
2165
- { type: core.NgModule, args: [{
2166
- declarations: [
2167
- CommandDirective,
2168
- FocusBindingDirective,
2169
- NumberInputComponent,
2170
- StringInputComponent,
2171
- PasswordInputComponent,
2172
- SelectInputComponent,
2173
- ],
2174
- imports: [
2175
- common.CommonModule,
2176
- platformBrowser.BrowserModule,
2177
- animations.BrowserAnimationsModule,
2178
- forms.FormsModule,
2179
- material.MatInputModule,
2180
- material.MatFormFieldModule,
2181
- material.MatSelectModule,
2182
- PlaceModule,
2183
- InteractionModule
2184
- ],
2185
- exports: [
2186
- CommandDirective,
2187
- FocusBindingDirective,
2188
- NumberInputComponent,
2189
- StringInputComponent,
2190
- PasswordInputComponent,
2191
- SelectInputComponent,
2192
- InteractionModule,
2193
- PlaceModule,
2194
- ]
2195
- },] }
2196
- ];
2197
- return AngularUiPowerupsModule;
2198
- }());
2199
-
2200
- /**
2201
- * @fileoverview added by tsickle
2202
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2203
- */
2204
- /** @type {?} */
2205
- var defaultHiddenStyleDef = animations$1.style({
2206
- opacity: 0,
2207
- 'height': '0',
2208
- paddingTop: '0',
2209
- paddingBottom: '0'
2210
- });
2211
- /**
2212
- * @param {?} triggerName
2213
- * @param {?=} options
2214
- * @return {?}
2215
- */
2216
- function slideDownAndUpAnimation(triggerName, options) {
2217
- // SEE to fix this: https://github.com/angular/angular/issues/15587#issuecomment-351510501
2218
- /** @type {?} */
2219
- var duration = pectin.OptionsHelper.get(options).getOptional('duration', '100ms');
2220
- /** @type {?} */
2221
- var hiddenStyleDef = pectin.OptionsHelper.get(options).getOptional('hiddenStyleDef', defaultHiddenStyleDef);
2222
- return animations$1.trigger(triggerName, [
2223
- animations$1.transition(':enter', [hiddenStyleDef, animations$1.animate('100ms')]),
2224
- animations$1.transition(':leave', [animations$1.animate('100ms', hiddenStyleDef)])
2225
- ]);
2226
- }
2227
-
2228
- /**
2229
- * @fileoverview added by tsickle
2230
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2231
- */
2232
-
2233
- /**
2234
- * @fileoverview added by tsickle
2235
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2236
- */
2237
- var Dimension = /** @class */ (function () {
2238
- function Dimension(width, height) {
2239
- this.width = width;
2240
- this.height = height;
2241
- }
2242
- return Dimension;
2243
- }());
2244
- if (false) {
2245
- /** @type {?} */
2246
- Dimension.prototype.width;
2247
- /** @type {?} */
2248
- Dimension.prototype.height;
2249
- }
2250
-
2251
- /**
2252
- * @fileoverview added by tsickle
2253
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2254
- */
2255
- var Point = /** @class */ (function () {
2256
- function Point(x, y) {
2257
- this.x = x;
2258
- this.y = y;
2259
- }
2260
- /**
2261
- * @param {?} data
2262
- * @return {?}
2263
- */
2264
- Point.from = /**
2265
- * @param {?} data
2266
- * @return {?}
2267
- */
2268
- function (data) {
2269
- return new Point(data.x, data.y);
2270
- };
2271
- /**
2272
- * @param {?} x
2273
- * @param {?} y
2274
- * @return {?}
2275
- */
2276
- Point.prototype.translate = /**
2277
- * @param {?} x
2278
- * @param {?} y
2279
- * @return {?}
2280
- */
2281
- function (x, y) {
2282
- return new Point(this.x + x, this.y + y);
2283
- };
2284
- return Point;
2285
- }());
2286
- if (false) {
2287
- /** @type {?} */
2288
- Point.prototype.x;
2289
- /** @type {?} */
2290
- Point.prototype.y;
2291
- }
2292
-
2293
- /**
2294
- * @fileoverview added by tsickle
2295
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2296
- */
2297
- exports.Bounds = /** @class */ (function (_super) {
2298
- __extends(Bounds, _super);
2299
- function Bounds(top, left, width, height) {
2300
- var _this = _super.call(this, width, height) || this;
2301
- _this.top = top;
2302
- _this.left = left;
2303
- _this.width = width;
2304
- _this.height = height;
2305
- return _this;
2306
- }
2307
- /**
2308
- * @param {?} point
2309
- * @return {?}
2310
- */
2311
- Bounds.prototype.relativePositionOf = /**
2312
- * @param {?} point
2313
- * @return {?}
2314
- */
2315
- function (point) {
2316
- if (point instanceof MouseEvent) {
2317
- return new Point(point.clientX - this.left, point.clientY - this.top);
2318
- }
2319
- else {
2320
- return new Point(point.x - this.left, point.y - this.top);
2321
- }
2322
- };
2323
- return Bounds;
2324
- }(Dimension));
2325
- if (false) {
2326
- /** @type {?} */
2327
- exports.Bounds.prototype.top;
2328
- /** @type {?} */
2329
- exports.Bounds.prototype.left;
2330
- /** @type {?} */
2331
- exports.Bounds.prototype.width;
2332
- /** @type {?} */
2333
- exports.Bounds.prototype.height;
2334
- }
2335
- (function (Bounds) {
2336
- /**
2337
- * @param {?} element
2338
- * @return {?}
2339
- */
2340
- function ofElement(element) {
2341
- /** @type {?} */
2342
- var rect = element.getBoundingClientRect();
2343
- return new Bounds(rect.top, rect.left, rect.width, rect.height);
2344
- }
2345
- Bounds.ofElement = ofElement;
2346
- })(exports.Bounds || (exports.Bounds = {}));
2347
-
2348
- /**
2349
- * @fileoverview added by tsickle
2350
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2351
- */
2352
- var ResizeAwareComponent = /** @class */ (function (_super) {
2353
- __extends(ResizeAwareComponent, _super);
2354
- function ResizeAwareComponent(elementRef, ngZone) {
2355
- var _this = _super.call(this) || this;
2356
- _this.elementRef = elementRef;
2357
- _this.ngZone = ngZone;
2358
- _this._boundsModel = new pectin.ValueHolder(new exports.Bounds(0, 0, 0, 0));
2359
- return _this;
2360
- }
2361
- /**
2362
- * @return {?}
2363
- */
2364
- ResizeAwareComponent.prototype.ngAfterViewInit = /**
2365
- * @return {?}
2366
- */
2367
- function () {
2368
- var _this = this;
2369
- this.updateBounds();
2370
- /** @type {?} */
2371
- var element = this.elementRef.nativeElement;
2372
- /** @type {?} */
2373
- var ro = new ResizeObserver((/**
2374
- * @param {?} entries
2375
- * @param {?} observer
2376
- * @return {?}
2377
- */
2378
- function (entries, observer) {
2379
- _this.ngZone.run((/**
2380
- * @return {?}
2381
- */
2382
- function () { return _this.updateBounds(); }));
2383
- }));
2384
- ro.observe(element);
2385
- this.onDispose((/**
2386
- * @return {?}
2387
- */
2388
- function () { return ro.disconnect(); }));
2389
- };
2390
- Object.defineProperty(ResizeAwareComponent.prototype, "boundsModel", {
2391
- get: /**
2392
- * @return {?}
2393
- */
2394
- function () {
2395
- return this._boundsModel.readonly;
2396
- },
2397
- enumerable: true,
2398
- configurable: true
2399
- });
2400
- Object.defineProperty(ResizeAwareComponent.prototype, "nativeElement", {
2401
- get: /**
2402
- * @return {?}
2403
- */
2404
- function () {
2405
- return this.elementRef.nativeElement;
2406
- },
2407
- enumerable: true,
2408
- configurable: true
2409
- });
2410
- // TODO: Make this handle body scroll
2411
- // TODO: Make this handle body scroll
2412
- /**
2413
- * @param {?} point
2414
- * @return {?}
2415
- */
2416
- ResizeAwareComponent.prototype.relativePositionOf =
2417
- // TODO: Make this handle body scroll
2418
- /**
2419
- * @param {?} point
2420
- * @return {?}
2421
- */
2422
- function (point) {
2423
- return this.bounds.relativePositionOf(point);
2424
- };
2425
- Object.defineProperty(ResizeAwareComponent.prototype, "bounds", {
2426
- get: /**
2427
- * @return {?}
2428
- */
2429
- function () {
2430
- return this._boundsModel.value;
2431
- },
2432
- enumerable: true,
2433
- configurable: true
2434
- });
2435
- /**
2436
- * @private
2437
- * @return {?}
2438
- */
2439
- ResizeAwareComponent.prototype.updateBounds = /**
2440
- * @private
2441
- * @return {?}
2442
- */
2443
- function () {
2444
- this._boundsModel.value = exports.Bounds.ofElement(this.nativeElement);
2445
- };
2446
- return ResizeAwareComponent;
2447
- }(DisposableComponent));
2448
- if (false) {
2449
- /**
2450
- * @type {?}
2451
- * @private
2452
- */
2453
- ResizeAwareComponent.prototype._boundsModel;
2454
- /**
2455
- * @type {?}
2456
- * @protected
2457
- */
2458
- ResizeAwareComponent.prototype.elementRef;
2459
- /**
2460
- * @type {?}
2461
- * @protected
2462
- */
2463
- ResizeAwareComponent.prototype.ngZone;
2464
- }
2465
-
2466
- /**
2467
- * @fileoverview added by tsickle
2468
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2469
- */
2470
-
2471
- /**
2472
- * @fileoverview added by tsickle
2473
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2474
- */
2475
-
2476
- /**
2477
- * @fileoverview added by tsickle
2478
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2479
- */
2480
- /**
2481
- * @record
2482
- */
2483
- function Alert() { }
2484
- if (false) {
2485
- /**
2486
- * @return {?}
2487
- */
2488
- Alert.prototype.title = function () { };
2489
- /**
2490
- * @return {?}
2491
- */
2492
- Alert.prototype.content = function () { };
2493
- /**
2494
- * @return {?}
2495
- */
2496
- Alert.prototype.ok = function () { };
2497
- }
2498
-
2499
- /**
2500
- * @fileoverview added by tsickle
2501
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2502
- */
2503
- /**
2504
- * @record
2505
- */
2506
- function Confirm() { }
2507
- if (false) {
2508
- /** @type {?|undefined} */
2509
- Confirm.prototype.destructive;
2510
- /**
2511
- * @return {?}
2512
- */
2513
- Confirm.prototype.cancel = function () { };
2514
- }
2515
-
2516
- /**
2517
- * @fileoverview added by tsickle
2518
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2519
- */
2520
- /**
2521
- * @record
2522
- * @template R, E
2523
- */
2524
- function Result() { }
2525
- (function (Result) {
2526
- /**
2527
- * @record
2528
- * @template R, E
2529
- */
2530
- function Callback() { }
2531
- Result.Callback = Callback;
2532
- if (false) {
2533
- /** @type {?} */
2534
- Callback.prototype.then;
2535
- /** @type {?} */
2536
- Callback.prototype.catch;
2537
- }
2538
- })(Result || (Result = {}));
2539
-
2540
- /**
2541
- * @fileoverview added by tsickle
2542
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2543
- */
2544
- /**
2545
- * @record
2546
- * @template D, R, E
2547
- */
2548
- function ActivityOutletContext() { }
2549
- if (false) {
2550
- /** @type {?} */
2551
- ActivityOutletContext.prototype.interactionContext;
2552
- /** @type {?} */
2553
- ActivityOutletContext.prototype.activityClass;
2554
- /** @type {?} */
2555
- ActivityOutletContext.prototype.activityData;
2556
- /** @type {?} */
2557
- ActivityOutletContext.prototype.onDone;
2558
- /** @type {?} */
2559
- ActivityOutletContext.prototype.onCancel;
2560
- }
2561
-
2562
- /**
2563
- * @fileoverview added by tsickle
2564
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2565
- */
2566
-
2567
- /**
2568
- * @fileoverview added by tsickle
2569
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2570
- */
2571
- /**
2572
- * @param {?} options
2573
- * @return {?}
2574
- */
2575
- function Place(options) {
2576
- return (/**
2577
- * @param {?} target
2578
- * @return {?}
2579
- */
2580
- function (target) {
2581
- Reflect.defineMetadata('place.options', options, target);
2582
- });
2583
- }
2584
- (function (Place) {
2585
- /**
2586
- * @record
2587
- */
2588
- function Options() { }
2589
- Place.Options = Options;
2590
- if (false) {
2591
- /** @type {?} */
2592
- Options.prototype.path;
2593
- /** @type {?} */
2594
- Options.prototype.title;
2595
- /** @type {?} */
2596
- Options.prototype.order;
2597
- /** @type {?|undefined} */
2598
- Options.prototype.authenticate;
2599
- }
2600
- var Descriptor = /** @class */ (function () {
2601
- function Descriptor(placeClass, options) {
2602
- pectin.assert.notNil(options);
2603
- this.path = options.path;
2604
- this.title = options.title;
2605
- this.order = options.order;
2606
- this.authenticate = lodash.isNil(options.authenticate) || options.authenticate;
2607
- }
2608
- return Descriptor;
2609
- }());
2610
- Place.Descriptor = Descriptor;
2611
- if (false) {
2612
- /** @type {?} */
2613
- Descriptor.prototype.path;
2614
- /** @type {?} */
2615
- Descriptor.prototype.authenticate;
2616
- /** @type {?} */
2617
- Descriptor.prototype.title;
2618
- /** @type {?} */
2619
- Descriptor.prototype.order;
2620
- }
2621
- /**
2622
- * @param {?} klass
2623
- * @return {?}
2624
- */
2625
- function getDescriptor(klass) {
2626
- /** @type {?} */
2627
- var placeOptions = Reflect.getMetadata('place.options', klass);
2628
- return new Descriptor(klass, placeOptions);
2629
- }
2630
- Place.getDescriptor = getDescriptor;
2631
- })(Place || (Place = {}));
2632
-
2633
- /**
2634
- * @fileoverview added by tsickle
2635
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2636
- */
2637
- /**
2638
- * @record
2639
- * @template T
2640
- */
2641
- function ResolvedParameter() { }
2642
- if (false) {
2643
- /** @type {?} */
2644
- ResolvedParameter.prototype.parameterDef;
2645
- /** @type {?} */
2646
- ResolvedParameter.prototype.resolvedValue;
2647
- }
2648
- var ResolvedParameters = /** @class */ (function () {
2649
- function ResolvedParameters(parameters) {
2650
- this.parameters = parameters;
2651
- }
2652
- /**
2653
- * @template T
2654
- * @param {?} parameter
2655
- * @return {?}
2656
- */
2657
- ResolvedParameters.prototype.get = /**
2658
- * @template T
2659
- * @param {?} parameter
2660
- * @return {?}
2661
- */
2662
- function (parameter) {
2663
- /** @type {?} */
2664
- var resolved = this.parameters.find((/**
2665
- * @param {?} p
2666
- * @return {?}
2667
- */
2668
- function (p) { return p.parameterDef === parameter; }));
2669
- return resolved ? resolved.resolvedValue : null;
2670
- };
2671
- /**
2672
- * @template T
2673
- * @param {?} parameter
2674
- * @param {?} value
2675
- * @return {?}
2676
- */
2677
- ResolvedParameters.prototype.replace = /**
2678
- * @template T
2679
- * @param {?} parameter
2680
- * @param {?} value
2681
- * @return {?}
2682
- */
2683
- function (parameter, value) {
2684
- return new ResolvedParameters(this.parameters.filter((/**
2685
- * @param {?} p
2686
- * @return {?}
2687
- */
2688
- function (p) { return p.parameterDef !== parameter; })).concat({
2689
- parameterDef: parameter,
2690
- resolvedValue: value
2691
- }));
2692
- };
2693
- /**
2694
- * @protected
2695
- * @return {?}
2696
- */
2697
- ResolvedParameters.prototype.getFormattedRouteId = /**
2698
- * @protected
2699
- * @return {?}
2700
- */
2701
- function () {
2702
- /** @type {?} */
2703
- var routeIdParam = this.getRouteIdParam();
2704
- return routeIdParam ? routeIdParam.parameterDef.type.format(routeIdParam.resolvedValue) : null;
2705
- };
2706
- /**
2707
- * @private
2708
- * @return {?}
2709
- */
2710
- ResolvedParameters.prototype.getRouteIdParam = /**
2711
- * @private
2712
- * @return {?}
2713
- */
2714
- function () {
2715
- return this.parameters.find((/**
2716
- * @param {?} p
2717
- * @return {?}
2718
- */
2719
- function (p) { return p.parameterDef.isRouteId; }));
2720
- };
2721
- /**
2722
- * @protected
2723
- * @return {?}
2724
- */
2725
- ResolvedParameters.prototype.getFormattedParameters = /**
2726
- * @protected
2727
- * @return {?}
2728
- */
2729
- function () {
2730
- /** @type {?} */
2731
- var params = {};
2732
- /** @type {?} */
2733
- var routeIdParam = this.parameters.filter((/**
2734
- * @param {?} p
2735
- * @return {?}
2736
- */
2737
- function (p) { return !p.parameterDef.isRouteId; })).forEach((/**
2738
- * @param {?} p
2739
- * @return {?}
2740
- */
2741
- function (p) {
2742
- params[p.parameterDef.name] = p.parameterDef.type.format(p.resolvedValue);
2743
- }));
2744
- return params;
2745
- };
2746
- /**
2747
- * @return {?}
2748
- */
2749
- ResolvedParameters.prototype.hasRouteId = /**
2750
- * @return {?}
2751
- */
2752
- function () {
2753
- return !!this.getRouteIdParam();
2754
- };
2755
- /**
2756
- * @param {?} previous
2757
- * @param {?} router
2758
- * @param {?} activatedRoute
2759
- * @return {?}
2760
- */
2761
- ResolvedParameters.prototype.redirect = /**
2762
- * @param {?} previous
2763
- * @param {?} router
2764
- * @param {?} activatedRoute
2765
- * @return {?}
2766
- */
2767
- function (previous, router, activatedRoute) {
2768
- /** @type {?} */
2769
- var routeId = this.getFormattedRouteId();
2770
- /** @type {?} */
2771
- var relativePath = !!previous.hasRouteId() ? '..' : '.';
2772
- /** @type {?} */
2773
- var path = routeId ? [relativePath, routeId, this.getFormattedParameters()] : [relativePath, this.getFormattedParameters()];
2774
- router.navigate(path, {
2775
- relativeTo: activatedRoute
2776
- });
2777
- };
2778
- __decorate([
2779
- pectin.Trace(),
2780
- __metadata("design:type", Function),
2781
- __metadata("design:paramtypes", []),
2782
- __metadata("design:returntype", void 0)
2783
- ], ResolvedParameters.prototype, "getFormattedRouteId", null);
2784
- __decorate([
2785
- pectin.Trace(),
2786
- __metadata("design:type", Function),
2787
- __metadata("design:paramtypes", []),
2788
- __metadata("design:returntype", void 0)
2789
- ], ResolvedParameters.prototype, "getFormattedParameters", null);
2790
- __decorate([
2791
- pectin.Trace(),
2792
- __metadata("design:type", Function),
2793
- __metadata("design:paramtypes", [ResolvedParameters, router.Router, router.ActivatedRoute]),
2794
- __metadata("design:returntype", void 0)
2795
- ], ResolvedParameters.prototype, "redirect", null);
2796
- return ResolvedParameters;
2797
- }());
2798
- if (false) {
2799
- /** @type {?} */
2800
- ResolvedParameters.prototype.parameters;
2801
- }
2802
- exports.RouteParameterBindings = /** @class */ (function (_super) {
2803
- __extends(RouteParameterBindings, _super);
2804
- function RouteParameterBindings(component, router, activatedRoute) {
2805
- var _this = _super.call(this) || this;
2806
- _this.component = component;
2807
- _this.router = router;
2808
- _this.activatedRoute = activatedRoute;
2809
- _this._incomingRouteChange = new pectin.MutableValueModel(false);
2810
- _this.resolvedParameters = new pectin.MutableValueModel();
2811
- var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe;
2812
- _this.txo = new pectin.TransactionObserver(); //.onEvent(e => console.log(e.toString()));
2813
- //.onEvent(e => console.log(e.toString()));
2814
- /** @type {?} */
2815
- var routeParameterDefs = typescriptUtilities.Klass.get(component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
2816
- routeParameterDefs.forEach((/**
2817
- * @param {?} parameter
2818
- * @return {?}
2819
- */
2820
- function (parameter) { return _this.installBinding(parameter); }));
2821
- /** @type {?} */
2822
- var incomingResolvedRouteParameters = observe.valuesFrom(activatedRoute.paramMap)
2823
- .last()
2824
- .map((/**
2825
- * @param {?} params
2826
- * @return {?}
2827
- */
2828
- function (params) {
2829
- /** @type {?} */
2830
- var result = [];
2831
- routeParameterDefs.forEach((/**
2832
- * @param {?} parameterDef
2833
- * @return {?}
2834
- */
2835
- function (parameterDef) {
2836
- /** @type {?} */
2837
- var resolvedValue;
2838
- if (parameterDef.isArray) {
2839
- resolvedValue = params.getAll(parameterDef.name).map((/**
2840
- * @param {?} v
2841
- * @return {?}
2842
- */
2843
- function (v) { return parameterDef.type.parse(v); }));
2844
- }
2845
- else {
2846
- resolvedValue = parameterDef.type.parse(params.get(parameterDef.name));
2847
- }
2848
- result.push({ parameterDef: parameterDef, resolvedValue: resolvedValue });
2849
- }));
2850
- return new ResolvedParameters(result);
2851
- }));
2852
- incomingResolvedRouteParameters.subscribe((/**
2853
- * @param {?} resolvedParameters
2854
- * @return {?}
2855
- */
2856
- function (resolvedParameters) {
2857
- _this._incomingRouteChange.value = true;
2858
- _this.resolvedParameters.value = resolvedParameters;
2859
- _this._incomingRouteChange.value = false;
2860
- }));
2861
- when.valueOf(_this.resolvedParameters).changes((/**
2862
- * @param {?} params
2863
- * @param {?} previous
2864
- * @return {?}
2865
- */
2866
- function (params, previous) {
2867
- params.redirect(previous, router, activatedRoute);
2868
- }), { unless: _this.incomingRouteChange });
2869
- _this.txo.observe('incomingResolvedRouteParameters', incomingResolvedRouteParameters);
2870
- _this.txo.observe('this.routeIsChanging', _this.incomingRouteChange);
2871
- return _this;
2872
- }
2873
- Object.defineProperty(RouteParameterBindings.prototype, "incomingRouteChange", {
2874
- get: /**
2875
- * @return {?}
2876
- */
2877
- function () {
2878
- return this._incomingRouteChange.readonly;
2879
- },
2880
- enumerable: true,
2881
- configurable: true
2882
- });
2883
- /**
2884
- * @protected
2885
- * @template T
2886
- * @param {?} parameter
2887
- * @return {?}
2888
- */
2889
- RouteParameterBindings.prototype.installBinding = /**
2890
- * @protected
2891
- * @template T
2892
- * @param {?} parameter
2893
- * @return {?}
2894
- */
2895
- function (parameter) {
2896
- /** @type {?} */
2897
- var model = this.getModelFor(parameter);
2898
- // this.txo.observe(parameter.propertyName, model);
2899
- this.registerDisposable(new pectin.Binding(this.resolvedParameters, model, {
2900
- toRight: /**
2901
- * @param {?} parameters
2902
- * @return {?}
2903
- */
2904
- function (parameters) {
2905
- return parameters.get(parameter);
2906
- },
2907
- toLeft: /**
2908
- * @param {?} value
2909
- * @param {?=} currentParameters
2910
- * @return {?}
2911
- */
2912
- function (value, currentParameters) {
2913
- return currentParameters.replace(parameter, value);
2914
- }
2915
- }));
2916
- };
2917
- /**
2918
- * @private
2919
- * @template T
2920
- * @param {?} parameter
2921
- * @return {?}
2922
- */
2923
- RouteParameterBindings.prototype.getModelFor = /**
2924
- * @private
2925
- * @template T
2926
- * @param {?} parameter
2927
- * @return {?}
2928
- */
2929
- function (parameter) {
2930
- return this.component[parameter.propertyName];
2931
- };
2932
- return RouteParameterBindings;
2933
- }(pectin.GarbageCollector));
2934
- if (false) {
2935
- /** @type {?} */
2936
- exports.RouteParameterBindings.prototype._incomingRouteChange;
2937
- /**
2938
- * @type {?}
2939
- * @private
2940
- */
2941
- exports.RouteParameterBindings.prototype.txo;
2942
- /**
2943
- * @type {?}
2944
- * @private
2945
- */
2946
- exports.RouteParameterBindings.prototype.resolvedParameters;
2947
- /**
2948
- * @type {?}
2949
- * @private
2950
- */
2951
- exports.RouteParameterBindings.prototype.component;
2952
- /**
2953
- * @type {?}
2954
- * @private
2955
- */
2956
- exports.RouteParameterBindings.prototype.router;
2957
- /**
2958
- * @type {?}
2959
- * @private
2960
- */
2961
- exports.RouteParameterBindings.prototype.activatedRoute;
2962
- }
2963
- (function (RouteParameterBindings) {
2964
- RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
2965
- })(exports.RouteParameterBindings || (exports.RouteParameterBindings = {}));
2966
-
2967
- /**
2968
- * @fileoverview added by tsickle
2969
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2970
- */
2971
- var AbstractPlaceComponent = /** @class */ (function (_super) {
2972
- __extends(AbstractPlaceComponent, _super);
2973
- function AbstractPlaceComponent(activatedRoute, router) {
2974
- var _this = _super.call(this) || this;
2975
- _this.activatedRoute = activatedRoute;
2976
- _this.routeBindingMediator = _this.registerDisposable(new exports.RouteParameterBindings(_this, router, activatedRoute));
2977
- // See https://coolon.atlassian.net/browse/PEC-59
2978
- ((/** @type {?} */ ((/** @type {?} */ (_this.titleModel))))).setDefault(_this.placeConfig.title);
2979
- return _this;
2980
- }
2981
- Object.defineProperty(AbstractPlaceComponent.prototype, "placeConfig", {
2982
- get: /**
2983
- * @return {?}
2984
- */
2985
- function () {
2986
- return Place.getDescriptor((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
2987
- },
2988
- enumerable: true,
2989
- configurable: true
2990
- });
2991
- /**
2992
- * @return {?}
2993
- */
2994
- AbstractPlaceComponent.prototype.canDeactivate = /**
2995
- * @return {?}
2996
- */
2997
- function () {
2998
- return true;
2999
- };
3000
- __decorate([
3001
- pectin.UseDelegate(),
3002
- __metadata("design:type", pectin.MutableValueModel)
3003
- ], AbstractPlaceComponent.prototype, "titleModel", void 0);
3004
- __decorate([
3005
- fastMemoizeDecorator.Memoize(),
3006
- __metadata("design:type", Place.Descriptor),
3007
- __metadata("design:paramtypes", [])
3008
- ], AbstractPlaceComponent.prototype, "placeConfig", null);
3009
- return AbstractPlaceComponent;
3010
- }(DisposableComponent));
3011
- if (false) {
3012
- /** @type {?} */
3013
- AbstractPlaceComponent.prototype.titleModel;
3014
- /**
3015
- * @type {?}
3016
- * @private
3017
- */
3018
- AbstractPlaceComponent.prototype.routeBindingMediator;
3019
- /**
3020
- * @type {?}
3021
- * @protected
3022
- */
3023
- AbstractPlaceComponent.prototype.activatedRoute;
3024
- }
3025
-
3026
- /**
3027
- * @fileoverview added by tsickle
3028
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3029
- */
3030
- /**
3031
- * @record
3032
- */
3033
- function PlaceComponent() { }
3034
- if (false) {
3035
- /** @type {?} */
3036
- PlaceComponent.prototype.titleModel;
3037
- /**
3038
- * @return {?}
3039
- */
3040
- PlaceComponent.prototype.canDeactivate = function () { };
3041
- }
3042
-
3043
- /**
3044
- * @fileoverview added by tsickle
3045
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3046
- */
3047
- var LeavePlaceGuard = /** @class */ (function () {
3048
- function LeavePlaceGuard(router, injector) {
3049
- this.router = router;
3050
- this.injector = injector;
3051
- }
3052
- /**
3053
- * @param {?} component
3054
- * @param {?} currentRoute
3055
- * @param {?} currentState
3056
- * @param {?=} nextState
3057
- * @return {?}
3058
- */
3059
- LeavePlaceGuard.prototype.canDeactivate = /**
3060
- * @param {?} component
3061
- * @param {?} currentRoute
3062
- * @param {?} currentState
3063
- * @param {?=} nextState
3064
- * @return {?}
3065
- */
3066
- function (component, currentRoute, currentState, nextState) {
3067
- return component.canDeactivate();
3068
- };
3069
- LeavePlaceGuard.decorators = [
3070
- { type: core.Injectable, args: [{
3071
- providedIn: 'root'
3072
- },] }
3073
- ];
3074
- /** @nocollapse */
3075
- LeavePlaceGuard.ctorParameters = function () { return [
3076
- { type: router.Router },
3077
- { type: core.Injector }
3078
- ]; };
3079
- /** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR)); }, token: LeavePlaceGuard, providedIn: "root" });
3080
- return LeavePlaceGuard;
3081
- }());
3082
- if (false) {
3083
- /**
3084
- * @type {?}
3085
- * @private
3086
- */
3087
- LeavePlaceGuard.prototype.router;
3088
- /**
3089
- * @type {?}
3090
- * @private
3091
- */
3092
- LeavePlaceGuard.prototype.injector;
3093
- }
3094
-
3095
- /**
3096
- * @fileoverview added by tsickle
3097
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3098
- */
3099
- /**
3100
- * @abstract
3101
- * @template T, S
3102
- */
3103
- /**
3104
- * @abstract
3105
- * @template T, S
3106
- */
3107
- exports.Sanitiser = /** @class */ (function () {
3108
- function Sanitiser(parameterDef, snapshot, sanitiser) {
3109
- this.parameterDef = parameterDef;
3110
- this.snapshot = snapshot;
3111
- this.sanitiser = sanitiser;
3112
- }
3113
- /**
3114
- * @return {?}
3115
- */
3116
- Sanitiser.prototype.isRouteId = /**
3117
- * @return {?}
3118
- */
3119
- function () {
3120
- return this.parameterDef.isRouteId;
3121
- };
3122
- Object.defineProperty(Sanitiser.prototype, "valueChanged", {
3123
- get: /**
3124
- * @return {?}
3125
- */
3126
- function () {
3127
- return !lodash.isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
3128
- },
3129
- enumerable: true,
3130
- configurable: true
3131
- });
3132
- Object.defineProperty(Sanitiser.prototype, "sanitisedValue", {
3133
- get: /**
3134
- * @return {?}
3135
- */
3136
- function () {
3137
- return this._sanitisedValue;
3138
- },
3139
- enumerable: true,
3140
- configurable: true
3141
- });
3142
- /**
3143
- * @return {?}
3144
- */
3145
- Sanitiser.prototype.sanitize = /**
3146
- * @return {?}
3147
- */
3148
- function () {
3149
- return __awaiter(this, void 0, void 0, function () {
3150
- var _a;
3151
- return __generator(this, function (_b) {
3152
- switch (_b.label) {
3153
- case 0:
3154
- if (!this.sanitiser) return [3 /*break*/, 2];
3155
- this.initialValue = this.readFrom(this.snapshot);
3156
- _a = this;
3157
- return [4 /*yield*/, this.sanitiser.sanitise(this.initialValue)];
3158
- case 1:
3159
- _a._sanitisedValue = _b.sent();
3160
- if (this.initialValue !== this._sanitisedValue) {
3161
- return [2 /*return*/, false];
3162
- }
3163
- _b.label = 2;
3164
- case 2: return [2 /*return*/, true];
3165
- }
3166
- });
3167
- });
3168
- };
3169
- return Sanitiser;
3170
- }());
3171
- if (false) {
3172
- /**
3173
- * @type {?}
3174
- * @private
3175
- */
3176
- exports.Sanitiser.prototype.initialValue;
3177
- /**
3178
- * @type {?}
3179
- * @private
3180
- */
3181
- exports.Sanitiser.prototype._sanitisedValue;
3182
- /** @type {?} */
3183
- exports.Sanitiser.prototype.parameterDef;
3184
- /** @type {?} */
3185
- exports.Sanitiser.prototype.snapshot;
3186
- /** @type {?} */
3187
- exports.Sanitiser.prototype.sanitiser;
3188
- /**
3189
- * @abstract
3190
- * @protected
3191
- * @param {?} snapshot
3192
- * @return {?}
3193
- */
3194
- exports.Sanitiser.prototype.readFrom = function (snapshot) { };
3195
- /**
3196
- * @abstract
3197
- * @protected
3198
- * @param {?} initialValue
3199
- * @param {?} sanitisedValue
3200
- * @return {?}
3201
- */
3202
- exports.Sanitiser.prototype.hasChanged = function (initialValue, sanitisedValue) { };
3203
- /**
3204
- * @abstract
3205
- * @param {?} dest
3206
- * @return {?}
3207
- */
3208
- exports.Sanitiser.prototype.injectRouteParam = function (dest) { };
3209
- }
3210
- var RouteParameterSanitiser = /** @class */ (function () {
3211
- function RouteParameterSanitiser(parameterDefs, snapshot, injector) {
3212
- var _this = this;
3213
- this.parameterDefs = parameterDefs;
3214
- this.snapshot = snapshot;
3215
- this.injector = injector;
3216
- this.parameterSanitisers = [];
3217
- /** @type {?} */
3218
- var sanitisers = parameterDefs.map((/**
3219
- * @param {?} def
3220
- * @return {?}
3221
- */
3222
- function (def) {
3223
- return def.isArray ?
3224
- new exports.Sanitiser.Array(def, snapshot, _this.getSanitiser(def)) :
3225
- new exports.Sanitiser.Value(def, snapshot, _this.getSanitiser(def));
3226
- }));
3227
- this.routeIdSanitiser = sanitisers.find((/**
3228
- * @param {?} p
3229
- * @return {?}
3230
- */
3231
- function (p) { return p.isRouteId(); }));
3232
- this.parameterSanitisers = sanitisers.filter((/**
3233
- * @param {?} p
3234
- * @return {?}
3235
- */
3236
- function (p) { return !p.isRouteId(); }));
3237
- }
3238
- /**
3239
- * @return {?}
3240
- */
3241
- RouteParameterSanitiser.prototype.sanitise = /**
3242
- * @return {?}
3243
- */
3244
- function () {
3245
- return __awaiter(this, void 0, void 0, function () {
3246
- var e_1, _a, _b, _c, sanitiser, e_1_1;
3247
- return __generator(this, function (_d) {
3248
- switch (_d.label) {
3249
- case 0:
3250
- if (!this.routeIdSanitiser) return [3 /*break*/, 2];
3251
- return [4 /*yield*/, this.routeIdSanitiser.sanitize()];
3252
- case 1:
3253
- _d.sent();
3254
- if (this.routeIdSanitiser.valueChanged) {
3255
- // if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
3256
- // context of the route id.
3257
- return [2 /*return*/, false];
3258
- }
3259
- _d.label = 2;
3260
- case 2:
3261
- _d.trys.push([2, 7, 8, 9]);
3262
- _b = __values(this.parameterSanitisers), _c = _b.next();
3263
- _d.label = 3;
3264
- case 3:
3265
- if (!!_c.done) return [3 /*break*/, 6];
3266
- sanitiser = _c.value;
3267
- return [4 /*yield*/, sanitiser.sanitize()];
3268
- case 4:
3269
- _d.sent();
3270
- _d.label = 5;
3271
- case 5:
3272
- _c = _b.next();
3273
- return [3 /*break*/, 3];
3274
- case 6: return [3 /*break*/, 9];
3275
- case 7:
3276
- e_1_1 = _d.sent();
3277
- e_1 = { error: e_1_1 };
3278
- return [3 /*break*/, 9];
3279
- case 8:
3280
- try {
3281
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3282
- }
3283
- finally { if (e_1) throw e_1.error; }
3284
- return [7 /*endfinally*/];
3285
- case 9: return [2 /*return*/, !this.parameterSanitisers.find((/**
3286
- * @param {?} s
3287
- * @return {?}
3288
- */
3289
- function (s) { return s.valueChanged; }))];
3290
- }
3291
- });
3292
- });
3293
- };
3294
- /**
3295
- * @param {?} router
3296
- * @return {?}
3297
- */
3298
- RouteParameterSanitiser.prototype.redirect = /**
3299
- * @param {?} router
3300
- * @return {?}
3301
- */
3302
- function (router) {
3303
- pectin.assert.isTruthy(this.parameterSanitisers.length !== 0);
3304
- if (this.routeIdSanitiser.valueChanged) {
3305
- return router.navigate(['..', this.routeIdSanitiser.sanitisedValue]);
3306
- }
3307
- else {
3308
- /** @type {?} */
3309
- var routeParams_1 = {};
3310
- this.parameterSanitisers.forEach((/**
3311
- * @param {?} s
3312
- * @return {?}
3313
- */
3314
- function (s) { return s.injectRouteParam(routeParams_1); }));
3315
- return router.navigate(['.', routeParams_1]);
3316
- }
3317
- };
3318
- /**
3319
- * @private
3320
- * @template T, S
3321
- * @param {?} def
3322
- * @return {?}
3323
- */
3324
- RouteParameterSanitiser.prototype.getSanitiser = /**
3325
- * @private
3326
- * @template T, S
3327
- * @param {?} def
3328
- * @return {?}
3329
- */
3330
- function (def) {
3331
- return def.sanitiser ? this.injector.get(def.sanitiser, new def.sanitiser()) : null;
3332
- };
3333
- __decorate([
3334
- src.Memoize(),
3335
- __metadata("design:type", Function),
3336
- __metadata("design:paramtypes", [Object]),
3337
- __metadata("design:returntype", Object)
3338
- ], RouteParameterSanitiser.prototype, "getSanitiser", null);
3339
- return RouteParameterSanitiser;
3340
- }());
3341
- if (false) {
3342
- /**
3343
- * @type {?}
3344
- * @private
3345
- */
3346
- RouteParameterSanitiser.prototype.routeIdSanitiser;
3347
- /**
3348
- * @type {?}
3349
- * @private
3350
- */
3351
- RouteParameterSanitiser.prototype.parameterSanitisers;
3352
- /** @type {?} */
3353
- RouteParameterSanitiser.prototype.parameterDefs;
3354
- /** @type {?} */
3355
- RouteParameterSanitiser.prototype.snapshot;
3356
- /** @type {?} */
3357
- RouteParameterSanitiser.prototype.injector;
3358
- }
3359
- (function (Sanitiser) {
3360
- /**
3361
- * @template T
3362
- */
3363
- var /**
3364
- * @template T
3365
- */
3366
- Value = /** @class */ (function (_super) {
3367
- __extends(Value, _super);
3368
- function Value() {
3369
- return _super !== null && _super.apply(this, arguments) || this;
3370
- }
3371
- /**
3372
- * @param {?} snapshot
3373
- * @return {?}
3374
- */
3375
- Value.prototype.readFrom = /**
3376
- * @param {?} snapshot
3377
- * @return {?}
3378
- */
3379
- function (snapshot) {
3380
- /** @type {?} */
3381
- var rawValue = this.parameterDef.isRouteId ?
3382
- snapshot.paramMap.get(this.parameterDef.name) :
3383
- snapshot.queryParamMap.get(this.parameterDef.name);
3384
- return this.parameterDef.type.parse(rawValue);
3385
- };
3386
- /**
3387
- * @protected
3388
- * @param {?} initialValue
3389
- * @param {?} sanitisedValue
3390
- * @return {?}
3391
- */
3392
- Value.prototype.hasChanged = /**
3393
- * @protected
3394
- * @param {?} initialValue
3395
- * @param {?} sanitisedValue
3396
- * @return {?}
3397
- */
3398
- function (initialValue, sanitisedValue) {
3399
- return initialValue !== sanitisedValue;
3400
- };
3401
- /**
3402
- * @param {?} dest
3403
- * @return {?}
3404
- */
3405
- Value.prototype.injectRouteParam = /**
3406
- * @param {?} dest
3407
- * @return {?}
3408
- */
3409
- function (dest) {
3410
- dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
3411
- };
3412
- return Value;
3413
- }(Sanitiser));
3414
- Sanitiser.Value = Value;
3415
- /**
3416
- * @template T
3417
- */
3418
- var /**
3419
- * @template T
3420
- */
3421
- Array = /** @class */ (function (_super) {
3422
- __extends(Array, _super);
3423
- function Array() {
3424
- return _super !== null && _super.apply(this, arguments) || this;
3425
- }
3426
- /**
3427
- * @param {?} snapshot
3428
- * @return {?}
3429
- */
3430
- Array.prototype.readFrom = /**
3431
- * @param {?} snapshot
3432
- * @return {?}
3433
- */
3434
- function (snapshot) {
3435
- var _this = this;
3436
- /** @type {?} */
3437
- var rawValues = snapshot.queryParamMap.getAll(this.parameterDef.name);
3438
- return rawValues.map((/**
3439
- * @param {?} value
3440
- * @return {?}
3441
- */
3442
- function (value) { return _this.parameterDef.type.parse(value); }));
3443
- };
3444
- /**
3445
- * @protected
3446
- * @param {?} initialValue
3447
- * @param {?} sanitisedValue
3448
- * @return {?}
3449
- */
3450
- Array.prototype.hasChanged = /**
3451
- * @protected
3452
- * @param {?} initialValue
3453
- * @param {?} sanitisedValue
3454
- * @return {?}
3455
- */
3456
- function (initialValue, sanitisedValue) {
3457
- return initialValue !== sanitisedValue;
3458
- };
3459
- /**
3460
- * @param {?} dest
3461
- * @return {?}
3462
- */
3463
- Array.prototype.injectRouteParam = /**
3464
- * @param {?} dest
3465
- * @return {?}
3466
- */
3467
- function (dest) {
3468
- var _this = this;
3469
- dest[this.parameterDef.name] = this.sanitisedValue.map((/**
3470
- * @param {?} v
3471
- * @return {?}
3472
- */
3473
- function (v) { return _this.parameterDef.type.format(v); }));
3474
- };
3475
- return Array;
3476
- }(Sanitiser));
3477
- Sanitiser.Array = Array;
3478
- })(exports.Sanitiser || (exports.Sanitiser = {}));
3479
-
3480
- /**
3481
- * @fileoverview added by tsickle
3482
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3483
- */
3484
- var PlaceRouteGuard = /** @class */ (function () {
3485
- function PlaceRouteGuard(router, injector) {
3486
- this.router = router;
3487
- this.injector = injector;
3488
- }
3489
- /**
3490
- * @param {?} route
3491
- * @param {?} state
3492
- * @return {?}
3493
- */
3494
- PlaceRouteGuard.prototype.canActivate = /**
3495
- * @param {?} route
3496
- * @param {?} state
3497
- * @return {?}
3498
- */
3499
- function (route, state) {
3500
- var _this = this;
3501
- /** @type {?} */
3502
- var routeParameters = typescriptUtilities.Klass.get(route.component).getMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
3503
- /** @type {?} */
3504
- var sanitiser = new RouteParameterSanitiser(routeParameters, route, this.injector);
3505
- return sanitiser.sanitise().then((/**
3506
- * @param {?} proceed
3507
- * @return {?}
3508
- */
3509
- function (proceed) {
3510
- if (!proceed) {
3511
- sanitiser.redirect(_this.router);
3512
- }
3513
- return proceed;
3514
- }));
3515
- };
3516
- PlaceRouteGuard.decorators = [
3517
- { type: core.Injectable, args: [{
3518
- providedIn: 'root'
3519
- },] }
3520
- ];
3521
- /** @nocollapse */
3522
- PlaceRouteGuard.ctorParameters = function () { return [
3523
- { type: router.Router },
3524
- { type: core.Injector }
3525
- ]; };
3526
- /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
3527
- __decorate([
3528
- pectin.Trace(),
3529
- __metadata("design:type", Function),
3530
- __metadata("design:paramtypes", [router.ActivatedRouteSnapshot, router.RouterStateSnapshot]),
3531
- __metadata("design:returntype", Object)
3532
- ], PlaceRouteGuard.prototype, "canActivate", null);
3533
- return PlaceRouteGuard;
3534
- }());
3535
- if (false) {
3536
- /**
3537
- * @type {?}
3538
- * @private
3539
- */
3540
- PlaceRouteGuard.prototype.router;
3541
- /**
3542
- * @type {?}
3543
- * @private
3544
- */
3545
- PlaceRouteGuard.prototype.injector;
3546
- }
3547
-
3548
- /**
3549
- * @fileoverview added by tsickle
3550
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3551
- */
3552
- /**
3553
- * @record
3554
- */
3555
- function JsonArray() { }
3556
- /**
3557
- * @record
3558
- */
3559
- function JsonMap() { }
3560
-
3561
- /**
3562
- * @fileoverview added by tsickle
3563
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3564
- */
3565
- /**
3566
- * @record
3567
- * @template T
3568
- */
3569
- function ParameterOptions() { }
3570
- if (false) {
3571
- /** @type {?|undefined} */
3572
- ParameterOptions.prototype.as;
3573
- /** @type {?|undefined} */
3574
- ParameterOptions.prototype.sanitiser;
3575
- }
3576
- /**
3577
- * @record
3578
- * @template T
3579
- */
3580
- function ListParameterOptions() { }
3581
- if (false) {
3582
- /** @type {?|undefined} */
3583
- ListParameterOptions.prototype.as;
3584
- /** @type {?|undefined} */
3585
- ListParameterOptions.prototype.listSanitiser;
3586
- }
3587
- /**
3588
- * @template T
3589
- * @param {?} type
3590
- * @param {?=} options
3591
- * @return {?}
3592
- */
3593
- function RouteId(type, options) {
3594
- // assert.isTruthy(type.isValid());
3595
- return (/**
3596
- * @param {?} prototype
3597
- * @param {?} propertyKey
3598
- * @return {?}
3599
- */
3600
- function (prototype, propertyKey) {
3601
- /** @type {?} */
3602
- var param = createDefinition(propertyKey, type, options, true);
3603
- typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
3604
- pectin.UseDelegate()(prototype, propertyKey);
3605
- });
3606
- }
3607
- /**
3608
- * @deprecated use RouteParameter instead.
3609
- * @template T
3610
- * @param {?} type
3611
- * @param {?=} options
3612
- * @return {?}
3613
- */
3614
- function QueryParameter(type, options) {
3615
- return (/**
3616
- * @param {?} prototype
3617
- * @param {?} propertyKey
3618
- * @return {?}
3619
- */
3620
- function (prototype, propertyKey) {
3621
- /** @type {?} */
3622
- var param = createDefinition(propertyKey, type, options, false);
3623
- typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
3624
- pectin.UseDelegate()(prototype, propertyKey);
3625
- });
3626
- }
3627
- /**
3628
- * @template T
3629
- * @param {?} type
3630
- * @param {?=} options
3631
- * @return {?}
3632
- */
3633
- function RouteParameter(type, options) {
3634
- // assert.isTruthy(type.isValid());
3635
- return (/**
3636
- * @param {?} prototype
3637
- * @param {?} propertyKey
3638
- * @return {?}
3639
- */
3640
- function (prototype, propertyKey) {
3641
- /** @type {?} */
3642
- var param = createDefinition(propertyKey, type, options, false);
3643
- typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
3644
- pectin.UseDelegate()(prototype, propertyKey);
3645
- });
3646
- }
3647
- /**
3648
- * @deprecated use RouteParameterList instead
3649
- * @template E
3650
- * @param {?} elementType
3651
- * @param {?=} options
3652
- * @return {?}
3653
- */
3654
- function QueryParameterList(elementType, options) {
3655
- // assert.isTruthy(type.isValid());
3656
- return (/**
3657
- * @param {?} prototype
3658
- * @param {?} propertyKey
3659
- * @return {?}
3660
- */
3661
- function (prototype, propertyKey) {
3662
- /** @type {?} */
3663
- var param = createArrayDefinition(propertyKey, elementType, options);
3664
- typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
3665
- pectin.UseDelegate()(prototype, propertyKey);
3666
- });
3667
- }
3668
- /**
3669
- * @template E
3670
- * @param {?} elementType
3671
- * @param {?=} options
3672
- * @return {?}
3673
- */
3674
- function RouteParameterList(elementType, options) {
3675
- // assert.isTruthy(type.isValid());
3676
- return (/**
3677
- * @param {?} prototype
3678
- * @param {?} propertyKey
3679
- * @return {?}
3680
- */
3681
- function (prototype, propertyKey) {
3682
- /** @type {?} */
3683
- var param = createArrayDefinition(propertyKey, elementType, options);
3684
- typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
3685
- pectin.UseDelegate()(prototype, propertyKey);
3686
- });
3687
- }
3688
- /**
3689
- * @template T
3690
- * @param {?} propertyName
3691
- * @param {?} type
3692
- * @param {?} options
3693
- * @param {?} routeId
3694
- * @return {?}
3695
- */
3696
- function createDefinition(propertyName, type, options, routeId) {
3697
- /** @type {?} */
3698
- var opts = typescriptUtilities.Opts.get(options);
3699
- /** @type {?} */
3700
- var propertyNameAsString = pectin.assert.notNil(propertyName).toString();
3701
- /** @type {?} */
3702
- var def = {
3703
- name: opts.getOptional('as', propertyNameAsString),
3704
- propertyName: propertyNameAsString,
3705
- type: pectin.assert.notNil(type),
3706
- sanitiser: opts.getOptional('sanitiser', null),
3707
- isRouteId: routeId,
3708
- isArray: false
3709
- };
3710
- return def;
3711
- }
3712
- /**
3713
- * @template T
3714
- * @param {?} propertyName
3715
- * @param {?} type
3716
- * @param {?} options
3717
- * @return {?}
3718
- */
3719
- function createArrayDefinition(propertyName, type, options) {
3720
- /** @type {?} */
3721
- var opts = typescriptUtilities.Opts.get(options);
3722
- /** @type {?} */
3723
- var propertyNameAsString = pectin.assert.notNil(propertyName).toString();
3724
- /** @type {?} */
3725
- var def = {
3726
- name: opts.getOptional('as', propertyNameAsString),
3727
- propertyName: propertyNameAsString,
3728
- type: pectin.assert.notNil(type),
3729
- sanitiser: opts.getOptional('listSanitiser', null),
3730
- isRouteId: false,
3731
- isArray: true
3732
- };
3733
- return def;
3734
- }
3735
-
3736
- /**
3737
- * @fileoverview added by tsickle
3738
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3739
- */
3740
- /**
3741
- * @record
3742
- * @template E, S
3743
- */
3744
- function ParameterDefinition() { }
3745
- if (false) {
3746
- /** @type {?} */
3747
- ParameterDefinition.prototype.name;
3748
- /** @type {?} */
3749
- ParameterDefinition.prototype.propertyName;
3750
- /** @type {?} */
3751
- ParameterDefinition.prototype.type;
3752
- /** @type {?} */
3753
- ParameterDefinition.prototype.sanitiser;
3754
- /** @type {?} */
3755
- ParameterDefinition.prototype.isRouteId;
3756
- /** @type {?} */
3757
- ParameterDefinition.prototype.isArray;
3758
- }
3759
-
3760
- /**
3761
- * @fileoverview added by tsickle
3762
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3763
- */
3764
- /**
3765
- * @record
3766
- * @template T
3767
- */
3768
- function ParameterSanitiser() { }
3769
- if (false) {
3770
- /**
3771
- * @param {?} value
3772
- * @return {?}
3773
- */
3774
- ParameterSanitiser.prototype.sanitise = function (value) { };
3775
- }
3776
-
3777
- /**
3778
- * @fileoverview added by tsickle
3779
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3780
- */
3781
- // WARNING: interface has both a type and a value, skipping emit
3782
-
3783
- (function (ParameterType) {
3784
- var StringType = /** @class */ (function () {
3785
- function StringType() {
3786
- }
3787
- /**
3788
- * @param {?} value
3789
- * @return {?}
3790
- */
3791
- StringType.prototype.format = /**
3792
- * @param {?} value
3793
- * @return {?}
3794
- */
3795
- function (value) {
3796
- return value;
3797
- };
3798
- /**
3799
- * @param {?} value
3800
- * @return {?}
3801
- */
3802
- StringType.prototype.parse = /**
3803
- * @param {?} value
3804
- * @return {?}
3805
- */
3806
- function (value) {
3807
- return value;
3808
- };
3809
- return StringType;
3810
- }());
3811
- var NumberType = /** @class */ (function () {
3812
- function NumberType() {
3813
- }
3814
- /**
3815
- * @param {?} value
3816
- * @return {?}
3817
- */
3818
- NumberType.prototype.format = /**
3819
- * @param {?} value
3820
- * @return {?}
3821
- */
3822
- function (value) {
3823
- return "" + value;
3824
- };
3825
- /**
3826
- * @param {?} value
3827
- * @return {?}
3828
- */
3829
- NumberType.prototype.parse = /**
3830
- * @param {?} value
3831
- * @return {?}
3832
- */
3833
- function (value) {
3834
- return +value;
3835
- };
3836
- return NumberType;
3837
- }());
3838
- ParameterType.STRING = new StringType();
3839
- ParameterType.NUMBER = new NumberType();
3840
- })(exports.ParameterType || (exports.ParameterType = {}));
3841
-
3842
- exports.ACTIVITY_DATA = ACTIVITY_DATA;
3843
- exports.AbstractActivity = AbstractActivity;
3844
- exports.AbstractInputComponent = AbstractInputComponent;
3845
- exports.AbstractPlaceComponent = AbstractPlaceComponent;
3846
- exports.ActivityContainerComponent = exports.ɵq;
3847
- exports.ActivityOutletComponent = exports.ɵx;
3848
- exports.AlertDialogComponent = AlertDialogComponent;
3849
- exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
3850
- exports.BusyOverlayComponent = BusyOverlayComponent;
3851
- exports.CommandDirective = CommandDirective;
3852
- exports.ConfirmationDialogComponent = ConfirmationDialogComponent;
3853
- exports.DialogInteractionService = DialogInteractionService;
3854
- exports.Dimension = Dimension;
3855
- exports.DisposableComponent = DisposableComponent;
3856
- exports.EmptyStateComponent = EmptyStateComponent;
3857
- exports.FocusBindingDirective = FocusBindingDirective;
3858
- exports.INTERACTION_CONTEXT = INTERACTION_CONTEXT;
3859
- exports.InteractionContext = InteractionContext;
3860
- exports.InteractionModule = InteractionModule;
3861
- exports.LEFT_RIGHT_PLACE_ANIMATION = LEFT_RIGHT_PLACE_ANIMATION;
3862
- exports.LeavePlaceGuard = LeavePlaceGuard;
3863
- exports.NavComponent = NavComponent;
3864
- exports.NumberInputComponent = NumberInputComponent;
3865
- exports.PasswordInputComponent = PasswordInputComponent;
3866
- exports.Place = Place;
3867
- exports.PlaceModule = PlaceModule;
3868
- exports.PlaceOutletComponent = PlaceOutletComponent;
3869
- exports.PlaceRouteGuard = PlaceRouteGuard;
3870
- exports.PlaceService = PlaceService;
3871
- exports.Point = Point;
3872
- exports.QueryParameter = QueryParameter;
3873
- exports.QueryParameterList = QueryParameterList;
3874
- exports.ResizeAwareComponent = ResizeAwareComponent;
3875
- exports.RouteId = RouteId;
3876
- exports.RouteParameter = RouteParameter;
3877
- exports.RouteParameterList = RouteParameterList;
3878
- exports.RouteParameterSanitiser = RouteParameterSanitiser;
3879
- exports.SelectInputComponent = SelectInputComponent;
3880
- exports.StringInputComponent = StringInputComponent;
3881
- exports.slideDownAndUpAnimation = slideDownAndUpAnimation;
3882
- exports.ɵa = CommandDirective;
3883
- exports.ɵb = FocusBindingDirective;
3884
- exports.ɵc = DisposableComponent;
3885
- exports.ɵd = NumberInputComponent;
3886
- exports.ɵe = AbstractInputComponent;
3887
- exports.ɵf = StringInputComponent;
3888
- exports.ɵg = PasswordInputComponent;
3889
- exports.ɵh = SelectInputComponent;
3890
- exports.ɵi = PlaceModule;
3891
- exports.ɵj = EmptyStateComponent;
3892
- exports.ɵk = BusyOverlayComponent;
3893
- exports.ɵl = PlaceOutletComponent;
3894
- exports.ɵm = LEFT_RIGHT_PLACE_ANIMATION;
3895
- exports.ɵn = PlaceService;
3896
- exports.ɵo = NavComponent;
3897
- exports.ɵp = InteractionModule;
3898
- exports.ɵr = ConfirmationDialogComponent;
3899
- exports.ɵs = AbstractActivity;
3900
- exports.ɵt = ACTIVITY_DATA;
3901
- exports.ɵv = AlertDialogComponent;
3902
- exports.ɵy = DialogInteractionService;
3903
- exports.ɵz = InteractionContext;
3904
-
3905
- Object.defineProperty(exports, '__esModule', { value: true });
3906
-
3907
- }));
3908
- //# sourceMappingURL=coolon-angular-ui-powerups.umd.js.map