@coolon/angular-ui-powerups 0.0.26 → 0.0.27

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