@coolon/angular-ui-powerups 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/jest.config.js +9 -0
  3. package/ng-package.json +13 -0
  4. package/package.json +12 -14
  5. package/schematics/ng-add/index.ts +10 -0
  6. package/schematics/place-routes/index.ts +152 -0
  7. package/schematics/place-routes/place-def.ts +93 -0
  8. package/schematics/place-routes/scanner.ts +145 -0
  9. package/schematics/place-routes/schema.ts +7 -0
  10. package/src/lib/angular-ui-powerups.module.spec.ts +14 -0
  11. package/src/lib/angular-ui-powerups.module.ts +49 -0
  12. package/{lib/animations/index.d.ts → src/lib/animations/index.ts} +1 -0
  13. package/src/lib/animations/slideDownAndUpAnimation.ts +39 -0
  14. package/src/lib/components/disposable-component.ts +9 -0
  15. package/src/lib/components/forms/abstract-input.component.ts +108 -0
  16. package/src/lib/components/forms/number-input/number-input.component.html +15 -0
  17. package/src/lib/components/forms/number-input/number-input.component.scss +3 -0
  18. package/src/lib/components/forms/number-input/number-input.component.spec.ts +25 -0
  19. package/src/lib/components/forms/number-input/number-input.component.ts +19 -0
  20. package/src/lib/components/forms/password-input/password-input.component.html +16 -0
  21. package/src/lib/components/forms/password-input/password-input.component.scss +3 -0
  22. package/src/lib/components/forms/password-input/password-input.component.spec.ts +25 -0
  23. package/src/lib/components/forms/password-input/password-input.component.ts +18 -0
  24. package/src/lib/components/forms/scss/mixins.scss +16 -0
  25. package/src/lib/components/forms/select-input/select-input.component.html +16 -0
  26. package/src/lib/components/forms/select-input/select-input.component.scss +7 -0
  27. package/src/lib/components/forms/select-input/select-input.component.spec.ts +25 -0
  28. package/src/lib/components/forms/select-input/select-input.component.ts +31 -0
  29. package/src/lib/components/forms/string-input/string-input.component.html +15 -0
  30. package/src/lib/components/forms/string-input/string-input.component.scss +3 -0
  31. package/src/lib/components/forms/string-input/string-input.component.spec.ts +25 -0
  32. package/src/lib/components/forms/string-input/string-input.component.ts +18 -0
  33. package/{lib/components/index.d.ts → src/lib/components/index.ts} +1 -0
  34. package/src/lib/components/resize-aware.component.ts +52 -0
  35. package/src/lib/components/types/bounds.class.ts +25 -0
  36. package/src/lib/components/types/dimension.class.ts +3 -0
  37. package/src/lib/components/types/point.class.ts +13 -0
  38. package/src/lib/directives/command.directive.spec.ts +73 -0
  39. package/src/lib/directives/command.directive.ts +81 -0
  40. package/src/lib/directives/focus-binding.directive.spec.ts +8 -0
  41. package/src/lib/directives/focus-binding.directive.ts +108 -0
  42. package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +1 -0
  43. package/src/lib/interaction/abstract-activity.ts +57 -0
  44. package/src/lib/interaction/activity.ts +17 -0
  45. package/src/lib/interaction/alert.ts +6 -0
  46. package/src/lib/interaction/components/activity-container/activity-container.component.html +8 -0
  47. package/src/lib/interaction/components/activity-container/activity-container.component.scss +3 -0
  48. package/src/lib/interaction/components/activity-container/activity-container.component.spec.ts +25 -0
  49. package/src/lib/interaction/components/activity-container/activity-container.component.ts +93 -0
  50. package/{lib/interaction/components/activity-outlet/activity-outlet-context.d.ts → src/lib/interaction/components/activity-outlet/activity-outlet-context.ts} +7 -5
  51. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.scss +3 -0
  52. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.spec.ts +25 -0
  53. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.ts +96 -0
  54. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.html +7 -0
  55. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.scss +7 -0
  56. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.spec.ts +25 -0
  57. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.ts +20 -0
  58. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.html +9 -0
  59. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.scss +8 -0
  60. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.spec.ts +25 -0
  61. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.ts +26 -0
  62. package/{lib/interaction/confirm.d.ts → src/lib/interaction/confirm.ts} +3 -2
  63. package/{lib/interaction/index.d.ts → src/lib/interaction/index.ts} +1 -0
  64. package/src/lib/interaction/interaction-context.ts +16 -0
  65. package/src/lib/interaction/interaction.module.ts +35 -0
  66. package/src/lib/interaction/result.ts +16 -0
  67. package/src/lib/interaction/services/dialog-interaction.service.scss +11 -0
  68. package/src/lib/interaction/services/dialog-interaction.service.spec.ts +12 -0
  69. package/src/lib/interaction/services/dialog-interaction.service.ts +63 -0
  70. package/src/lib/place/abstract-place-component.ts +33 -0
  71. package/src/lib/place/components/busy-overlay/busy-overlay.component.html +4 -0
  72. package/src/lib/place/components/busy-overlay/busy-overlay.component.scss +27 -0
  73. package/src/lib/place/components/busy-overlay/busy-overlay.component.spec.ts +25 -0
  74. package/src/lib/place/components/busy-overlay/busy-overlay.component.ts +23 -0
  75. package/src/lib/place/components/empty-state/empty-state.component.scss +15 -0
  76. package/src/lib/place/components/empty-state/empty-state.component.spec.ts +25 -0
  77. package/src/lib/place/components/empty-state/empty-state.component.ts +19 -0
  78. package/src/lib/place/components/place-outlet/place-outlet.component.html +7 -0
  79. package/src/lib/place/components/place-outlet/place-outlet.component.scss +12 -0
  80. package/src/lib/place/components/place-outlet/place-outlet.component.spec.ts +25 -0
  81. package/src/lib/place/components/place-outlet/place-outlet.component.ts +37 -0
  82. package/src/lib/place/components/place-outlet/route-animations.ts +30 -0
  83. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.html +7 -0
  84. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.scss +100 -0
  85. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.spec.ts +25 -0
  86. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts +30 -0
  87. package/src/lib/place/guards/leave-place.guard.spec.ts +15 -0
  88. package/src/lib/place/guards/leave-place.guard.ts +18 -0
  89. package/src/lib/place/guards/place-route.guard.ts +37 -0
  90. package/{lib/place/index.d.ts → src/lib/place/index.ts} +2 -1
  91. package/src/lib/place/place-component.ts +6 -0
  92. package/src/lib/place/place.decorator.ts +40 -0
  93. package/src/lib/place/place.module.ts +44 -0
  94. package/src/lib/place/place.service.spec.ts +12 -0
  95. package/src/lib/place/place.service.ts +29 -0
  96. package/src/lib/place/route/json-types.ts +5 -0
  97. package/src/lib/place/route/parameter-decorators.ts +99 -0
  98. package/src/lib/place/route/parameter-definition.class.ts +12 -0
  99. package/{lib/place/route/parameter-sanitiser.d.ts → src/lib/place/route/parameter-sanitiser.ts} +1 -1
  100. package/src/lib/place/route/parameter-type.ts +31 -0
  101. package/src/lib/place/route/route-parameter-bindings.ts +140 -0
  102. package/src/lib/place/route/route-parameter-sanitiser.ts +135 -0
  103. package/src/test-setup.ts +1 -0
  104. package/tsconfig.json +7 -0
  105. package/tsconfig.lib.json +20 -0
  106. package/tsconfig.schematics.json +35 -0
  107. package/tsconfig.spec.json +10 -0
  108. package/tslint.json +7 -0
  109. package/bundles/coolon-angular-ui-powerups.umd.js +0 -3908
  110. package/bundles/coolon-angular-ui-powerups.umd.js.map +0 -1
  111. package/bundles/coolon-angular-ui-powerups.umd.min.js +0 -2
  112. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +0 -1
  113. package/coolon-angular-ui-powerups.d.ts +0 -30
  114. package/coolon-angular-ui-powerups.metadata.json +0 -1
  115. package/esm2015/coolon-angular-ui-powerups.js +0 -33
  116. package/esm2015/index.js +0 -6
  117. package/esm2015/lib/angular-ui-powerups.module.js +0 -54
  118. package/esm2015/lib/animations/index.js +0 -9
  119. package/esm2015/lib/animations/slideDownAndUpAnimation.js +0 -30
  120. package/esm2015/lib/components/disposable-component.js +0 -14
  121. package/esm2015/lib/components/forms/abstract-input.component.js +0 -183
  122. package/esm2015/lib/components/forms/number-input/number-input.component.js +0 -26
  123. package/esm2015/lib/components/forms/password-input/password-input.component.js +0 -26
  124. package/esm2015/lib/components/forms/select-input/select-input.component.js +0 -60
  125. package/esm2015/lib/components/forms/string-input/string-input.component.js +0 -26
  126. package/esm2015/lib/components/index.js +0 -18
  127. package/esm2015/lib/components/resize-aware.component.js +0 -96
  128. package/esm2015/lib/components/types/bounds.class.js +0 -56
  129. package/esm2015/lib/components/types/dimension.class.js +0 -21
  130. package/esm2015/lib/components/types/point.class.js +0 -36
  131. package/esm2015/lib/directives/command.directive.js +0 -135
  132. package/esm2015/lib/directives/focus-binding.directive.js +0 -179
  133. package/esm2015/lib/directives/index.js +0 -10
  134. package/esm2015/lib/interaction/abstract-activity.js +0 -129
  135. package/esm2015/lib/interaction/activity.js +0 -27
  136. package/esm2015/lib/interaction/alert.js +0 -23
  137. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +0 -144
  138. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
  139. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -169
  140. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -37
  141. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -46
  142. package/esm2015/lib/interaction/confirm.js +0 -17
  143. package/esm2015/lib/interaction/index.js +0 -21
  144. package/esm2015/lib/interaction/interaction-context.js +0 -35
  145. package/esm2015/lib/interaction/interaction.module.js +0 -41
  146. package/esm2015/lib/interaction/result.js +0 -24
  147. package/esm2015/lib/interaction/services/dialog-interaction.service.js +0 -114
  148. package/esm2015/lib/place/abstract-place-component.js +0 -59
  149. package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +0 -44
  150. package/esm2015/lib/place/components/empty-state/empty-state.component.js +0 -28
  151. package/esm2015/lib/place/components/nav/nav.component.js +0 -31
  152. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +0 -67
  153. package/esm2015/lib/place/components/place-outlet/route-animations.js +0 -35
  154. package/esm2015/lib/place/guards/leave-place.guard.js +0 -52
  155. package/esm2015/lib/place/guards/place-route.guard.js +0 -74
  156. package/esm2015/lib/place/index.js +0 -27
  157. package/esm2015/lib/place/place-component.js +0 -17
  158. package/esm2015/lib/place/place.decorator.js +0 -72
  159. package/esm2015/lib/place/place.module.js +0 -49
  160. package/esm2015/lib/place/place.service.js +0 -61
  161. package/esm2015/lib/place/route/json-types.js +0 -13
  162. package/esm2015/lib/place/route/parameter-decorators.js +0 -178
  163. package/esm2015/lib/place/route/parameter-definition.class.js +0 -24
  164. package/esm2015/lib/place/route/parameter-sanitiser.js +0 -17
  165. package/esm2015/lib/place/route/parameter-type.js +0 -43
  166. package/esm2015/lib/place/route/route-parameter-bindings.js +0 -294
  167. package/esm2015/lib/place/route/route-parameter-sanitiser.js +0 -280
  168. package/esm2015/public_api.js +0 -11
  169. package/esm5/coolon-angular-ui-powerups.js +0 -33
  170. package/esm5/index.js +0 -6
  171. package/esm5/lib/angular-ui-powerups.module.js +0 -58
  172. package/esm5/lib/animations/index.js +0 -9
  173. package/esm5/lib/animations/slideDownAndUpAnimation.js +0 -30
  174. package/esm5/lib/components/disposable-component.js +0 -24
  175. package/esm5/lib/components/forms/abstract-input.component.js +0 -232
  176. package/esm5/lib/components/forms/number-input/number-input.component.js +0 -33
  177. package/esm5/lib/components/forms/password-input/password-input.component.js +0 -33
  178. package/esm5/lib/components/forms/select-input/select-input.component.js +0 -67
  179. package/esm5/lib/components/forms/string-input/string-input.component.js +0 -33
  180. package/esm5/lib/components/index.js +0 -18
  181. package/esm5/lib/components/resize-aware.component.js +0 -124
  182. package/esm5/lib/components/types/bounds.class.js +0 -59
  183. package/esm5/lib/components/types/dimension.class.js +0 -19
  184. package/esm5/lib/components/types/point.class.js +0 -43
  185. package/esm5/lib/directives/command.directive.js +0 -155
  186. package/esm5/lib/directives/focus-binding.directive.js +0 -231
  187. package/esm5/lib/directives/index.js +0 -10
  188. package/esm5/lib/interaction/abstract-activity.js +0 -173
  189. package/esm5/lib/interaction/activity.js +0 -27
  190. package/esm5/lib/interaction/alert.js +0 -23
  191. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +0 -181
  192. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
  193. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -206
  194. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -42
  195. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -54
  196. package/esm5/lib/interaction/confirm.js +0 -17
  197. package/esm5/lib/interaction/index.js +0 -21
  198. package/esm5/lib/interaction/interaction-context.js +0 -45
  199. package/esm5/lib/interaction/interaction.module.js +0 -45
  200. package/esm5/lib/interaction/result.js +0 -24
  201. package/esm5/lib/interaction/services/dialog-interaction.service.js +0 -140
  202. package/esm5/lib/place/abstract-place-component.js +0 -66
  203. package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +0 -49
  204. package/esm5/lib/place/components/empty-state/empty-state.component.js +0 -29
  205. package/esm5/lib/place/components/nav/nav.component.js +0 -36
  206. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +0 -81
  207. package/esm5/lib/place/components/place-outlet/route-animations.js +0 -35
  208. package/esm5/lib/place/guards/leave-place.guard.js +0 -57
  209. package/esm5/lib/place/guards/place-route.guard.js +0 -78
  210. package/esm5/lib/place/index.js +0 -27
  211. package/esm5/lib/place/place-component.js +0 -17
  212. package/esm5/lib/place/place.decorator.js +0 -69
  213. package/esm5/lib/place/place.module.js +0 -53
  214. package/esm5/lib/place/place.service.js +0 -75
  215. package/esm5/lib/place/route/json-types.js +0 -13
  216. package/esm5/lib/place/route/parameter-decorators.js +0 -178
  217. package/esm5/lib/place/route/parameter-definition.class.js +0 -24
  218. package/esm5/lib/place/route/parameter-sanitiser.js +0 -17
  219. package/esm5/lib/place/route/parameter-type.js +0 -65
  220. package/esm5/lib/place/route/route-parameter-bindings.js +0 -339
  221. package/esm5/lib/place/route/route-parameter-sanitiser.js +0 -395
  222. package/esm5/public_api.js +0 -11
  223. package/fesm2015/coolon-angular-ui-powerups.js +0 -3129
  224. package/fesm2015/coolon-angular-ui-powerups.js.map +0 -1
  225. package/fesm5/coolon-angular-ui-powerups.js +0 -3681
  226. package/fesm5/coolon-angular-ui-powerups.js.map +0 -1
  227. package/lib/angular-ui-powerups.module.d.ts +0 -2
  228. package/lib/animations/slideDownAndUpAnimation.d.ts +0 -5
  229. package/lib/components/disposable-component.d.ts +0 -5
  230. package/lib/components/forms/abstract-input.component.d.ts +0 -35
  231. package/lib/components/forms/number-input/number-input.component.d.ts +0 -6
  232. package/lib/components/forms/password-input/password-input.component.d.ts +0 -6
  233. package/lib/components/forms/select-input/select-input.component.d.ts +0 -11
  234. package/lib/components/forms/string-input/string-input.component.d.ts +0 -6
  235. package/lib/components/resize-aware.component.d.ts +0 -22
  236. package/lib/components/types/bounds.class.d.ts +0 -16
  237. package/lib/components/types/dimension.class.d.ts +0 -5
  238. package/lib/components/types/point.class.d.ts +0 -10
  239. package/lib/directives/command.directive.d.ts +0 -14
  240. package/lib/directives/focus-binding.directive.d.ts +0 -22
  241. package/lib/interaction/abstract-activity.d.ts +0 -17
  242. package/lib/interaction/activity.d.ts +0 -11
  243. package/lib/interaction/alert.d.ts +0 -5
  244. package/lib/interaction/components/activity-container/activity-container.component.d.ts +0 -32
  245. package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +0 -30
  246. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +0 -8
  247. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -9
  248. package/lib/interaction/interaction-context.d.ts +0 -11
  249. package/lib/interaction/interaction.module.d.ts +0 -2
  250. package/lib/interaction/result.d.ts +0 -8
  251. package/lib/interaction/services/dialog-interaction.service.d.ts +0 -14
  252. package/lib/place/abstract-place-component.d.ts +0 -13
  253. package/lib/place/components/busy-overlay/busy-overlay.component.d.ts +0 -8
  254. package/lib/place/components/empty-state/empty-state.component.d.ts +0 -5
  255. package/lib/place/components/nav/nav.component.d.ts +0 -7
  256. package/lib/place/components/place-outlet/place-outlet.component.d.ts +0 -13
  257. package/lib/place/components/place-outlet/route-animations.d.ts +0 -1
  258. package/lib/place/guards/leave-place.guard.d.ts +0 -10
  259. package/lib/place/guards/place-route.guard.d.ts +0 -9
  260. package/lib/place/place-component.d.ts +0 -5
  261. package/lib/place/place.decorator.d.ts +0 -20
  262. package/lib/place/place.module.d.ts +0 -2
  263. package/lib/place/place.service.d.ts +0 -8
  264. package/lib/place/route/json-types.d.ts +0 -7
  265. package/lib/place/route/parameter-decorators.d.ts +0 -26
  266. package/lib/place/route/parameter-definition.class.d.ts +0 -11
  267. package/lib/place/route/parameter-type.d.ts +0 -16
  268. package/lib/place/route/route-parameter-bindings.d.ts +0 -18
  269. package/lib/place/route/route-parameter-sanitiser.d.ts +0 -42
  270. package/schematics/ng-add/index.d.ts +0 -2
  271. package/schematics/ng-add/index.js +0 -12
  272. package/schematics/ng-add/index.js.map +0 -1
  273. package/schematics/place-routes/index.d.ts +0 -3
  274. package/schematics/place-routes/index.js +0 -114
  275. package/schematics/place-routes/index.js.map +0 -1
  276. package/schematics/place-routes/place-def.d.ts +0 -34
  277. package/schematics/place-routes/place-def.js +0 -84
  278. package/schematics/place-routes/place-def.js.map +0 -1
  279. package/schematics/place-routes/scanner.d.ts +0 -26
  280. package/schematics/place-routes/scanner.js +0 -125
  281. package/schematics/place-routes/scanner.js.map +0 -1
  282. package/schematics/place-routes/schema.d.ts +0 -7
  283. package/schematics/place-routes/schema.js +0 -3
  284. package/schematics/place-routes/schema.js.map +0 -1
  285. /package/{index.d.ts → src/index.ts} +0 -0
  286. /package/{public_api.d.ts → src/public_api.ts} +0 -0
@@ -1,3129 +0,0 @@
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 NavComponent {
1425
- constructor() {
1426
- }
1427
- /**
1428
- * @return {?}
1429
- */
1430
- ngOnInit() {
1431
- }
1432
- }
1433
- NavComponent.decorators = [
1434
- { type: Component, args: [{
1435
- selector: 'angular-ui-powerups-nav',
1436
- template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let placeDescriptor of places\" [routerLink]='placeDescriptor.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"placeDescriptor.title\">{{placeDescriptor.title}}</a>\n</nav>\n\n",
1437
- styles: [""]
1438
- }] }
1439
- ];
1440
- /** @nocollapse */
1441
- NavComponent.ctorParameters = () => [];
1442
- NavComponent.propDecorators = {
1443
- places: [{ type: Input }]
1444
- };
1445
- if (false) {
1446
- /** @type {?} */
1447
- NavComponent.prototype.places;
1448
- }
1449
-
1450
- /**
1451
- * @fileoverview added by tsickle
1452
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1453
- */
1454
- class PlaceService {
1455
- constructor() {
1456
- this._activePlaces = new MutableListModel();
1457
- }
1458
- /**
1459
- * @return {?}
1460
- */
1461
- get activePlaces() {
1462
- return this._activePlaces.readonly;
1463
- }
1464
- /**
1465
- * @param {?} place
1466
- * @return {?}
1467
- */
1468
- onActivate(place) {
1469
- this._activePlaces.push(place);
1470
- }
1471
- /**
1472
- * @param {?} place
1473
- * @return {?}
1474
- */
1475
- onDeactivate(place) {
1476
- this._activePlaces.remove(place);
1477
- }
1478
- }
1479
- PlaceService.decorators = [
1480
- { type: Injectable, args: [{
1481
- providedIn: 'root'
1482
- },] }
1483
- ];
1484
- /** @nocollapse */
1485
- PlaceService.ctorParameters = () => [];
1486
- /** @nocollapse */ PlaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceService_Factory() { return new PlaceService(); }, token: PlaceService, providedIn: "root" });
1487
- __decorate([
1488
- Trace(),
1489
- __metadata("design:type", Function),
1490
- __metadata("design:paramtypes", [Object]),
1491
- __metadata("design:returntype", void 0)
1492
- ], PlaceService.prototype, "onActivate", null);
1493
- __decorate([
1494
- Trace(),
1495
- __metadata("design:type", Function),
1496
- __metadata("design:paramtypes", [Object]),
1497
- __metadata("design:returntype", void 0)
1498
- ], PlaceService.prototype, "onDeactivate", null);
1499
- if (false) {
1500
- /**
1501
- * @type {?}
1502
- * @private
1503
- */
1504
- PlaceService.prototype._activePlaces;
1505
- }
1506
-
1507
- /**
1508
- * @fileoverview added by tsickle
1509
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1510
- */
1511
- /** @type {?} */
1512
- const left = [
1513
- query(':enter, :leave', style({ position: 'fixed', width: '100%' }), { optional: true }),
1514
- group([
1515
- query(':enter', [style({ transform: 'translateX(-100%)' }), animate('.3s ease-out', style({ transform: 'translateX(0%)' }))], {
1516
- optional: true,
1517
- }),
1518
- query(':leave', [style({ transform: 'translateX(0%)' }), animate('.3s ease-out', style({ transform: 'translateX(100%)' }))], {
1519
- optional: true,
1520
- }),
1521
- ]),
1522
- ];
1523
- /** @type {?} */
1524
- const right = [
1525
- query(':enter, :leave', style({ position: 'fixed', width: '100%' }), { optional: true }),
1526
- group([
1527
- query(':enter', [style({ transform: 'translateX(100%)' }), animate('.3s ease-out', style({ transform: 'translateX(0%)' }))], {
1528
- optional: true,
1529
- }),
1530
- query(':leave', [style({ transform: 'translateX(0%)' }), animate('.3s ease-out', style({ transform: 'translateX(-100%)' }))], {
1531
- optional: true,
1532
- }),
1533
- ]),
1534
- ];
1535
- /** @type {?} */
1536
- const LEFT_RIGHT_PLACE_ANIMATION = trigger('routeAnimations', [
1537
- transition(':increment', right),
1538
- transition(':decrement', left),
1539
- ]);
1540
-
1541
- /**
1542
- * @fileoverview added by tsickle
1543
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1544
- */
1545
- class PlaceOutletComponent {
1546
- /**
1547
- * @param {?} placeService
1548
- */
1549
- constructor(placeService) {
1550
- this.placeService = placeService;
1551
- this.animate = true;
1552
- }
1553
- /**
1554
- * @return {?}
1555
- */
1556
- ngOnInit() {
1557
- }
1558
- /**
1559
- * @param {?} $event
1560
- * @return {?}
1561
- */
1562
- onActivate($event) {
1563
- this.placeService.onActivate($event);
1564
- }
1565
- /**
1566
- * @param {?} $event
1567
- * @return {?}
1568
- */
1569
- onDeactivate($event) {
1570
- this.placeService.onDeactivate($event);
1571
- }
1572
- /**
1573
- * @param {?} outlet
1574
- * @return {?}
1575
- */
1576
- getPlaceOrder(outlet) {
1577
- return this.animate && outlet && outlet.activatedRouteData && outlet.activatedRouteData['placeOrder'];
1578
- }
1579
- }
1580
- PlaceOutletComponent.decorators = [
1581
- { type: Component, args: [{
1582
- selector: 'angular-ui-powerups-place-outlet',
1583
- 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",
1584
- animations: [LEFT_RIGHT_PLACE_ANIMATION],
1585
- styles: [":host{display:block}.container{grid-area:main;display:-ms-grid;display:grid;-ms-grid-rows:0 1fr;grid-template-rows:0 1fr;min-height:0}"]
1586
- }] }
1587
- ];
1588
- /** @nocollapse */
1589
- PlaceOutletComponent.ctorParameters = () => [
1590
- { type: PlaceService }
1591
- ];
1592
- PlaceOutletComponent.propDecorators = {
1593
- animate: [{ type: Input }]
1594
- };
1595
- if (false) {
1596
- /** @type {?} */
1597
- PlaceOutletComponent.prototype.animate;
1598
- /**
1599
- * @type {?}
1600
- * @private
1601
- */
1602
- PlaceOutletComponent.prototype.placeService;
1603
- }
1604
-
1605
- /**
1606
- * @fileoverview added by tsickle
1607
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1608
- */
1609
- class PlaceModule {
1610
- }
1611
- PlaceModule.decorators = [
1612
- { type: NgModule, args: [{
1613
- imports: [
1614
- CommonModule,
1615
- BrowserAnimationsModule,
1616
- MatProgressSpinnerModule,
1617
- RouterModule,
1618
- MatTabsModule$1,
1619
- MatListModule,
1620
- MatTooltipModule
1621
- ],
1622
- declarations: [
1623
- EmptyStateComponent,
1624
- BusyOverlayComponent,
1625
- PlaceOutletComponent,
1626
- NavComponent
1627
- ],
1628
- entryComponents: [BusyOverlayComponent],
1629
- exports: [
1630
- BusyOverlayComponent,
1631
- PlaceOutletComponent,
1632
- EmptyStateComponent,
1633
- NavComponent
1634
- ],
1635
- providers: [
1636
- PlaceService
1637
- ]
1638
- },] }
1639
- ];
1640
-
1641
- /**
1642
- * @fileoverview added by tsickle
1643
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1644
- */
1645
- class AngularUiPowerupsModule {
1646
- }
1647
- AngularUiPowerupsModule.decorators = [
1648
- { type: NgModule, args: [{
1649
- declarations: [
1650
- CommandDirective,
1651
- FocusBindingDirective,
1652
- NumberInputComponent,
1653
- StringInputComponent,
1654
- PasswordInputComponent,
1655
- SelectInputComponent,
1656
- ],
1657
- imports: [
1658
- CommonModule,
1659
- BrowserModule,
1660
- BrowserAnimationsModule,
1661
- FormsModule,
1662
- MatInputModule,
1663
- MatFormFieldModule,
1664
- MatSelectModule,
1665
- PlaceModule,
1666
- InteractionModule
1667
- ],
1668
- exports: [
1669
- CommandDirective,
1670
- FocusBindingDirective,
1671
- NumberInputComponent,
1672
- StringInputComponent,
1673
- PasswordInputComponent,
1674
- SelectInputComponent,
1675
- InteractionModule,
1676
- PlaceModule,
1677
- ]
1678
- },] }
1679
- ];
1680
-
1681
- /**
1682
- * @fileoverview added by tsickle
1683
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1684
- */
1685
- /** @type {?} */
1686
- const defaultHiddenStyleDef = style({
1687
- opacity: 0,
1688
- 'height': '0',
1689
- paddingTop: '0',
1690
- paddingBottom: '0'
1691
- });
1692
- /**
1693
- * @param {?} triggerName
1694
- * @param {?=} options
1695
- * @return {?}
1696
- */
1697
- function slideDownAndUpAnimation(triggerName, options) {
1698
- // SEE to fix this: https://github.com/angular/angular/issues/15587#issuecomment-351510501
1699
- /** @type {?} */
1700
- const duration = OptionsHelper.get(options).getOptional('duration', '100ms');
1701
- /** @type {?} */
1702
- const hiddenStyleDef = OptionsHelper.get(options).getOptional('hiddenStyleDef', defaultHiddenStyleDef);
1703
- return trigger(triggerName, [
1704
- transition(':enter', [hiddenStyleDef, animate('100ms')]),
1705
- transition(':leave', [animate('100ms', hiddenStyleDef)])
1706
- ]);
1707
- }
1708
-
1709
- /**
1710
- * @fileoverview added by tsickle
1711
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1712
- */
1713
-
1714
- /**
1715
- * @fileoverview added by tsickle
1716
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1717
- */
1718
- class Dimension {
1719
- /**
1720
- * @param {?} width
1721
- * @param {?} height
1722
- */
1723
- constructor(width, height) {
1724
- this.width = width;
1725
- this.height = height;
1726
- }
1727
- }
1728
- if (false) {
1729
- /** @type {?} */
1730
- Dimension.prototype.width;
1731
- /** @type {?} */
1732
- Dimension.prototype.height;
1733
- }
1734
-
1735
- /**
1736
- * @fileoverview added by tsickle
1737
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1738
- */
1739
- class Point {
1740
- /**
1741
- * @param {?} x
1742
- * @param {?} y
1743
- */
1744
- constructor(x, y) {
1745
- this.x = x;
1746
- this.y = y;
1747
- }
1748
- /**
1749
- * @param {?} data
1750
- * @return {?}
1751
- */
1752
- static from(data) {
1753
- return new Point(data.x, data.y);
1754
- }
1755
- /**
1756
- * @param {?} x
1757
- * @param {?} y
1758
- * @return {?}
1759
- */
1760
- translate(x, y) {
1761
- return new Point(this.x + x, this.y + y);
1762
- }
1763
- }
1764
- if (false) {
1765
- /** @type {?} */
1766
- Point.prototype.x;
1767
- /** @type {?} */
1768
- Point.prototype.y;
1769
- }
1770
-
1771
- /**
1772
- * @fileoverview added by tsickle
1773
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1774
- */
1775
- class Bounds extends Dimension {
1776
- /**
1777
- * @param {?} top
1778
- * @param {?} left
1779
- * @param {?} width
1780
- * @param {?} height
1781
- */
1782
- constructor(top, left, width, height) {
1783
- super(width, height);
1784
- this.top = top;
1785
- this.left = left;
1786
- this.width = width;
1787
- this.height = height;
1788
- }
1789
- /**
1790
- * @param {?} point
1791
- * @return {?}
1792
- */
1793
- relativePositionOf(point) {
1794
- if (point instanceof MouseEvent) {
1795
- return new Point(point.clientX - this.left, point.clientY - this.top);
1796
- }
1797
- else {
1798
- return new Point(point.x - this.left, point.y - this.top);
1799
- }
1800
- }
1801
- }
1802
- if (false) {
1803
- /** @type {?} */
1804
- Bounds.prototype.top;
1805
- /** @type {?} */
1806
- Bounds.prototype.left;
1807
- /** @type {?} */
1808
- Bounds.prototype.width;
1809
- /** @type {?} */
1810
- Bounds.prototype.height;
1811
- }
1812
- (function (Bounds) {
1813
- /**
1814
- * @param {?} element
1815
- * @return {?}
1816
- */
1817
- function ofElement(element) {
1818
- /** @type {?} */
1819
- const rect = element.getBoundingClientRect();
1820
- return new Bounds(rect.top, rect.left, rect.width, rect.height);
1821
- }
1822
- Bounds.ofElement = ofElement;
1823
- })(Bounds || (Bounds = {}));
1824
-
1825
- /**
1826
- * @fileoverview added by tsickle
1827
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1828
- */
1829
- class ResizeAwareComponent extends DisposableComponent {
1830
- /**
1831
- * @param {?} elementRef
1832
- * @param {?} ngZone
1833
- */
1834
- constructor(elementRef, ngZone) {
1835
- super();
1836
- this.elementRef = elementRef;
1837
- this.ngZone = ngZone;
1838
- this._boundsModel = new ValueHolder(new Bounds(0, 0, 0, 0));
1839
- }
1840
- /**
1841
- * @return {?}
1842
- */
1843
- ngAfterViewInit() {
1844
- this.updateBounds();
1845
- /** @type {?} */
1846
- const element = this.elementRef.nativeElement;
1847
- /** @type {?} */
1848
- const ro = new ResizeObserver((/**
1849
- * @param {?} entries
1850
- * @param {?} observer
1851
- * @return {?}
1852
- */
1853
- (entries, observer) => {
1854
- this.ngZone.run((/**
1855
- * @return {?}
1856
- */
1857
- () => this.updateBounds()));
1858
- }));
1859
- ro.observe(element);
1860
- this.onDispose((/**
1861
- * @return {?}
1862
- */
1863
- () => ro.disconnect()));
1864
- }
1865
- /**
1866
- * @return {?}
1867
- */
1868
- get boundsModel() {
1869
- return this._boundsModel.readonly;
1870
- }
1871
- /**
1872
- * @return {?}
1873
- */
1874
- get nativeElement() {
1875
- return this.elementRef.nativeElement;
1876
- }
1877
- // TODO: Make this handle body scroll
1878
- /**
1879
- * @param {?} point
1880
- * @return {?}
1881
- */
1882
- relativePositionOf(point) {
1883
- return this.bounds.relativePositionOf(point);
1884
- }
1885
- /**
1886
- * @return {?}
1887
- */
1888
- get bounds() {
1889
- return this._boundsModel.value;
1890
- }
1891
- /**
1892
- * @private
1893
- * @return {?}
1894
- */
1895
- updateBounds() {
1896
- this._boundsModel.value = Bounds.ofElement(this.nativeElement);
1897
- }
1898
- }
1899
- if (false) {
1900
- /**
1901
- * @type {?}
1902
- * @private
1903
- */
1904
- ResizeAwareComponent.prototype._boundsModel;
1905
- /**
1906
- * @type {?}
1907
- * @protected
1908
- */
1909
- ResizeAwareComponent.prototype.elementRef;
1910
- /**
1911
- * @type {?}
1912
- * @protected
1913
- */
1914
- ResizeAwareComponent.prototype.ngZone;
1915
- }
1916
-
1917
- /**
1918
- * @fileoverview added by tsickle
1919
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1920
- */
1921
-
1922
- /**
1923
- * @fileoverview added by tsickle
1924
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1925
- */
1926
-
1927
- /**
1928
- * @fileoverview added by tsickle
1929
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1930
- */
1931
- /**
1932
- * @record
1933
- */
1934
- function Alert() { }
1935
- if (false) {
1936
- /**
1937
- * @return {?}
1938
- */
1939
- Alert.prototype.title = function () { };
1940
- /**
1941
- * @return {?}
1942
- */
1943
- Alert.prototype.content = function () { };
1944
- /**
1945
- * @return {?}
1946
- */
1947
- Alert.prototype.ok = function () { };
1948
- }
1949
-
1950
- /**
1951
- * @fileoverview added by tsickle
1952
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1953
- */
1954
- /**
1955
- * @record
1956
- */
1957
- function Confirm() { }
1958
- if (false) {
1959
- /** @type {?|undefined} */
1960
- Confirm.prototype.destructive;
1961
- /**
1962
- * @return {?}
1963
- */
1964
- Confirm.prototype.cancel = function () { };
1965
- }
1966
-
1967
- /**
1968
- * @fileoverview added by tsickle
1969
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1970
- */
1971
- /**
1972
- * @record
1973
- * @template R, E
1974
- */
1975
- function Result() { }
1976
- (function (Result) {
1977
- /**
1978
- * @record
1979
- * @template R, E
1980
- */
1981
- function Callback() { }
1982
- Result.Callback = Callback;
1983
- if (false) {
1984
- /** @type {?} */
1985
- Callback.prototype.then;
1986
- /** @type {?} */
1987
- Callback.prototype.catch;
1988
- }
1989
- })(Result || (Result = {}));
1990
-
1991
- /**
1992
- * @fileoverview added by tsickle
1993
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1994
- */
1995
- /**
1996
- * @record
1997
- * @template D, R, E
1998
- */
1999
- function ActivityOutletContext() { }
2000
- if (false) {
2001
- /** @type {?} */
2002
- ActivityOutletContext.prototype.interactionContext;
2003
- /** @type {?} */
2004
- ActivityOutletContext.prototype.activityClass;
2005
- /** @type {?} */
2006
- ActivityOutletContext.prototype.activityData;
2007
- /** @type {?} */
2008
- ActivityOutletContext.prototype.onDone;
2009
- /** @type {?} */
2010
- ActivityOutletContext.prototype.onCancel;
2011
- }
2012
-
2013
- /**
2014
- * @fileoverview added by tsickle
2015
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2016
- */
2017
-
2018
- /**
2019
- * @fileoverview added by tsickle
2020
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2021
- */
2022
- /**
2023
- * @param {?} options
2024
- * @return {?}
2025
- */
2026
- function Place(options) {
2027
- return (/**
2028
- * @param {?} target
2029
- * @return {?}
2030
- */
2031
- (target) => {
2032
- Reflect.defineMetadata('place.options', options, target);
2033
- });
2034
- }
2035
- (function (Place) {
2036
- /**
2037
- * @record
2038
- */
2039
- function Options() { }
2040
- Place.Options = Options;
2041
- if (false) {
2042
- /** @type {?} */
2043
- Options.prototype.path;
2044
- /** @type {?} */
2045
- Options.prototype.title;
2046
- /** @type {?} */
2047
- Options.prototype.order;
2048
- /** @type {?|undefined} */
2049
- Options.prototype.authenticate;
2050
- }
2051
- class Descriptor {
2052
- /**
2053
- * @param {?} placeClass
2054
- * @param {?} options
2055
- */
2056
- constructor(placeClass, options) {
2057
- assert.notNil(options);
2058
- this.path = options.path;
2059
- this.title = options.title;
2060
- this.order = options.order;
2061
- this.authenticate = isNil(options.authenticate) || options.authenticate;
2062
- }
2063
- }
2064
- Place.Descriptor = Descriptor;
2065
- if (false) {
2066
- /** @type {?} */
2067
- Descriptor.prototype.path;
2068
- /** @type {?} */
2069
- Descriptor.prototype.authenticate;
2070
- /** @type {?} */
2071
- Descriptor.prototype.title;
2072
- /** @type {?} */
2073
- Descriptor.prototype.order;
2074
- }
2075
- /**
2076
- * @param {?} klass
2077
- * @return {?}
2078
- */
2079
- function getDescriptor(klass) {
2080
- /** @type {?} */
2081
- const placeOptions = Reflect.getMetadata('place.options', klass);
2082
- return new Descriptor(klass, placeOptions);
2083
- }
2084
- Place.getDescriptor = getDescriptor;
2085
- })(Place || (Place = {}));
2086
-
2087
- /**
2088
- * @fileoverview added by tsickle
2089
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2090
- */
2091
- /**
2092
- * @record
2093
- * @template T
2094
- */
2095
- function ResolvedParameter() { }
2096
- if (false) {
2097
- /** @type {?} */
2098
- ResolvedParameter.prototype.parameterDef;
2099
- /** @type {?} */
2100
- ResolvedParameter.prototype.resolvedValue;
2101
- }
2102
- class ResolvedParameters {
2103
- /**
2104
- * @param {?} parameters
2105
- */
2106
- constructor(parameters) {
2107
- this.parameters = parameters;
2108
- }
2109
- /**
2110
- * @template T
2111
- * @param {?} parameter
2112
- * @return {?}
2113
- */
2114
- get(parameter) {
2115
- /** @type {?} */
2116
- const resolved = this.parameters.find((/**
2117
- * @param {?} p
2118
- * @return {?}
2119
- */
2120
- p => p.parameterDef === parameter));
2121
- return resolved ? resolved.resolvedValue : null;
2122
- }
2123
- /**
2124
- * @template T
2125
- * @param {?} parameter
2126
- * @param {?} value
2127
- * @return {?}
2128
- */
2129
- replace(parameter, value) {
2130
- return new ResolvedParameters(this.parameters.filter((/**
2131
- * @param {?} p
2132
- * @return {?}
2133
- */
2134
- p => p.parameterDef !== parameter)).concat({
2135
- parameterDef: parameter,
2136
- resolvedValue: value
2137
- }));
2138
- }
2139
- /**
2140
- * @protected
2141
- * @return {?}
2142
- */
2143
- getFormattedRouteId() {
2144
- /** @type {?} */
2145
- const routeIdParam = this.getRouteIdParam();
2146
- return routeIdParam ? routeIdParam.parameterDef.type.format(routeIdParam.resolvedValue) : null;
2147
- }
2148
- /**
2149
- * @private
2150
- * @return {?}
2151
- */
2152
- getRouteIdParam() {
2153
- return this.parameters.find((/**
2154
- * @param {?} p
2155
- * @return {?}
2156
- */
2157
- p => p.parameterDef.isRouteId));
2158
- }
2159
- /**
2160
- * @protected
2161
- * @return {?}
2162
- */
2163
- getFormattedParameters() {
2164
- /** @type {?} */
2165
- const params = {};
2166
- /** @type {?} */
2167
- const routeIdParam = this.parameters.filter((/**
2168
- * @param {?} p
2169
- * @return {?}
2170
- */
2171
- p => !p.parameterDef.isRouteId)).forEach((/**
2172
- * @param {?} p
2173
- * @return {?}
2174
- */
2175
- p => {
2176
- params[p.parameterDef.name] = p.parameterDef.type.format(p.resolvedValue);
2177
- }));
2178
- return params;
2179
- }
2180
- /**
2181
- * @return {?}
2182
- */
2183
- hasRouteId() {
2184
- return !!this.getRouteIdParam();
2185
- }
2186
- /**
2187
- * @param {?} previous
2188
- * @param {?} router
2189
- * @param {?} activatedRoute
2190
- * @return {?}
2191
- */
2192
- redirect(previous, router, activatedRoute) {
2193
- /** @type {?} */
2194
- const routeId = this.getFormattedRouteId();
2195
- /** @type {?} */
2196
- const relativePath = !!previous.hasRouteId() ? '..' : '.';
2197
- /** @type {?} */
2198
- const path = routeId ? [relativePath, routeId, this.getFormattedParameters()] : [relativePath, this.getFormattedParameters()];
2199
- router.navigate(path, {
2200
- relativeTo: activatedRoute
2201
- });
2202
- }
2203
- }
2204
- __decorate([
2205
- Trace(),
2206
- __metadata("design:type", Function),
2207
- __metadata("design:paramtypes", []),
2208
- __metadata("design:returntype", void 0)
2209
- ], ResolvedParameters.prototype, "getFormattedRouteId", null);
2210
- __decorate([
2211
- Trace(),
2212
- __metadata("design:type", Function),
2213
- __metadata("design:paramtypes", []),
2214
- __metadata("design:returntype", void 0)
2215
- ], ResolvedParameters.prototype, "getFormattedParameters", null);
2216
- __decorate([
2217
- Trace(),
2218
- __metadata("design:type", Function),
2219
- __metadata("design:paramtypes", [ResolvedParameters, Router, ActivatedRoute]),
2220
- __metadata("design:returntype", void 0)
2221
- ], ResolvedParameters.prototype, "redirect", null);
2222
- if (false) {
2223
- /** @type {?} */
2224
- ResolvedParameters.prototype.parameters;
2225
- }
2226
- class RouteParameterBindings extends GarbageCollector {
2227
- /**
2228
- * @param {?} component
2229
- * @param {?} router
2230
- * @param {?} activatedRoute
2231
- */
2232
- constructor(component, router, activatedRoute) {
2233
- super();
2234
- this.component = component;
2235
- this.router = router;
2236
- this.activatedRoute = activatedRoute;
2237
- this._incomingRouteChange = new MutableValueModel(false);
2238
- this.resolvedParameters = new MutableValueModel();
2239
- const { chain, valueOf, before, when, after, observe } = Dsl.disposeWith(this);
2240
- this.txo = new TransactionObserver(); //.onEvent(e => console.log(e.toString()));
2241
- //.onEvent(e => console.log(e.toString()));
2242
- /** @type {?} */
2243
- const routeParameterDefs = Klass.get(component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
2244
- routeParameterDefs.forEach((/**
2245
- * @param {?} parameter
2246
- * @return {?}
2247
- */
2248
- parameter => this.installBinding(parameter)));
2249
- /** @type {?} */
2250
- const incomingResolvedRouteParameters = observe.valuesFrom(activatedRoute.paramMap)
2251
- .last()
2252
- .map((/**
2253
- * @param {?} params
2254
- * @return {?}
2255
- */
2256
- params => {
2257
- /** @type {?} */
2258
- const result = [];
2259
- routeParameterDefs.forEach((/**
2260
- * @param {?} parameterDef
2261
- * @return {?}
2262
- */
2263
- parameterDef => {
2264
- /** @type {?} */
2265
- let resolvedValue;
2266
- if (parameterDef.isArray) {
2267
- resolvedValue = params.getAll(parameterDef.name).map((/**
2268
- * @param {?} v
2269
- * @return {?}
2270
- */
2271
- v => parameterDef.type.parse(v)));
2272
- }
2273
- else {
2274
- resolvedValue = parameterDef.type.parse(params.get(parameterDef.name));
2275
- }
2276
- result.push({ parameterDef: parameterDef, resolvedValue: resolvedValue });
2277
- }));
2278
- return new ResolvedParameters(result);
2279
- }));
2280
- incomingResolvedRouteParameters.subscribe((/**
2281
- * @param {?} resolvedParameters
2282
- * @return {?}
2283
- */
2284
- resolvedParameters => {
2285
- this._incomingRouteChange.value = true;
2286
- this.resolvedParameters.value = resolvedParameters;
2287
- this._incomingRouteChange.value = false;
2288
- }));
2289
- when.valueOf(this.resolvedParameters).changes((/**
2290
- * @param {?} params
2291
- * @param {?} previous
2292
- * @return {?}
2293
- */
2294
- (params, previous) => {
2295
- params.redirect(previous, router, activatedRoute);
2296
- }), { unless: this.incomingRouteChange });
2297
- this.txo.observe('incomingResolvedRouteParameters', incomingResolvedRouteParameters);
2298
- this.txo.observe('this.routeIsChanging', this.incomingRouteChange);
2299
- }
2300
- /**
2301
- * @return {?}
2302
- */
2303
- get incomingRouteChange() {
2304
- return this._incomingRouteChange.readonly;
2305
- }
2306
- /**
2307
- * @protected
2308
- * @template T
2309
- * @param {?} parameter
2310
- * @return {?}
2311
- */
2312
- installBinding(parameter) {
2313
- /** @type {?} */
2314
- const model = this.getModelFor(parameter);
2315
- // this.txo.observe(parameter.propertyName, model);
2316
- this.registerDisposable(new Binding(this.resolvedParameters, model, {
2317
- /**
2318
- * @param {?} parameters
2319
- * @return {?}
2320
- */
2321
- toRight(parameters) {
2322
- return parameters.get(parameter);
2323
- },
2324
- /**
2325
- * @param {?} value
2326
- * @param {?=} currentParameters
2327
- * @return {?}
2328
- */
2329
- toLeft(value, currentParameters) {
2330
- return currentParameters.replace(parameter, value);
2331
- }
2332
- }));
2333
- }
2334
- /**
2335
- * @private
2336
- * @template T
2337
- * @param {?} parameter
2338
- * @return {?}
2339
- */
2340
- getModelFor(parameter) {
2341
- return this.component[parameter.propertyName];
2342
- }
2343
- }
2344
- if (false) {
2345
- /** @type {?} */
2346
- RouteParameterBindings.prototype._incomingRouteChange;
2347
- /**
2348
- * @type {?}
2349
- * @private
2350
- */
2351
- RouteParameterBindings.prototype.txo;
2352
- /**
2353
- * @type {?}
2354
- * @private
2355
- */
2356
- RouteParameterBindings.prototype.resolvedParameters;
2357
- /**
2358
- * @type {?}
2359
- * @private
2360
- */
2361
- RouteParameterBindings.prototype.component;
2362
- /**
2363
- * @type {?}
2364
- * @private
2365
- */
2366
- RouteParameterBindings.prototype.router;
2367
- /**
2368
- * @type {?}
2369
- * @private
2370
- */
2371
- RouteParameterBindings.prototype.activatedRoute;
2372
- }
2373
- (function (RouteParameterBindings) {
2374
- RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
2375
- })(RouteParameterBindings || (RouteParameterBindings = {}));
2376
-
2377
- /**
2378
- * @fileoverview added by tsickle
2379
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2380
- */
2381
- class AbstractPlaceComponent extends DisposableComponent {
2382
- /**
2383
- * @param {?} activatedRoute
2384
- * @param {?} router
2385
- */
2386
- constructor(activatedRoute, router) {
2387
- super();
2388
- this.activatedRoute = activatedRoute;
2389
- this.routeBindingMediator = this.registerDisposable(new RouteParameterBindings(this, router, activatedRoute));
2390
- // See https://coolon.atlassian.net/browse/PEC-59
2391
- ((/** @type {?} */ ((/** @type {?} */ (this.titleModel))))).setDefault(this.placeConfig.title);
2392
- }
2393
- /**
2394
- * @return {?}
2395
- */
2396
- get placeConfig() {
2397
- return Place.getDescriptor((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
2398
- }
2399
- /**
2400
- * @return {?}
2401
- */
2402
- canDeactivate() {
2403
- return true;
2404
- }
2405
- }
2406
- __decorate([
2407
- UseDelegate(),
2408
- __metadata("design:type", MutableValueModel)
2409
- ], AbstractPlaceComponent.prototype, "titleModel", void 0);
2410
- __decorate([
2411
- Memoize(),
2412
- __metadata("design:type", Place.Descriptor),
2413
- __metadata("design:paramtypes", [])
2414
- ], AbstractPlaceComponent.prototype, "placeConfig", null);
2415
- if (false) {
2416
- /** @type {?} */
2417
- AbstractPlaceComponent.prototype.titleModel;
2418
- /**
2419
- * @type {?}
2420
- * @private
2421
- */
2422
- AbstractPlaceComponent.prototype.routeBindingMediator;
2423
- /**
2424
- * @type {?}
2425
- * @protected
2426
- */
2427
- AbstractPlaceComponent.prototype.activatedRoute;
2428
- }
2429
-
2430
- /**
2431
- * @fileoverview added by tsickle
2432
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2433
- */
2434
- /**
2435
- * @record
2436
- */
2437
- function PlaceComponent() { }
2438
- if (false) {
2439
- /** @type {?} */
2440
- PlaceComponent.prototype.titleModel;
2441
- /**
2442
- * @return {?}
2443
- */
2444
- PlaceComponent.prototype.canDeactivate = function () { };
2445
- }
2446
-
2447
- /**
2448
- * @fileoverview added by tsickle
2449
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2450
- */
2451
- class LeavePlaceGuard {
2452
- /**
2453
- * @param {?} router
2454
- * @param {?} injector
2455
- */
2456
- constructor(router, injector) {
2457
- this.router = router;
2458
- this.injector = injector;
2459
- }
2460
- /**
2461
- * @param {?} component
2462
- * @param {?} currentRoute
2463
- * @param {?} currentState
2464
- * @param {?=} nextState
2465
- * @return {?}
2466
- */
2467
- canDeactivate(component, currentRoute, currentState, nextState) {
2468
- return component.canDeactivate();
2469
- }
2470
- }
2471
- LeavePlaceGuard.decorators = [
2472
- { type: Injectable, args: [{
2473
- providedIn: 'root'
2474
- },] }
2475
- ];
2476
- /** @nocollapse */
2477
- LeavePlaceGuard.ctorParameters = () => [
2478
- { type: Router },
2479
- { type: Injector }
2480
- ];
2481
- /** @nocollapse */ LeavePlaceGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: LeavePlaceGuard, providedIn: "root" });
2482
- if (false) {
2483
- /**
2484
- * @type {?}
2485
- * @private
2486
- */
2487
- LeavePlaceGuard.prototype.router;
2488
- /**
2489
- * @type {?}
2490
- * @private
2491
- */
2492
- LeavePlaceGuard.prototype.injector;
2493
- }
2494
-
2495
- /**
2496
- * @fileoverview added by tsickle
2497
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2498
- */
2499
- /**
2500
- * @abstract
2501
- * @template T, S
2502
- */
2503
- class Sanitiser {
2504
- /**
2505
- * @param {?} parameterDef
2506
- * @param {?} snapshot
2507
- * @param {?} sanitiser
2508
- */
2509
- constructor(parameterDef, snapshot, sanitiser) {
2510
- this.parameterDef = parameterDef;
2511
- this.snapshot = snapshot;
2512
- this.sanitiser = sanitiser;
2513
- }
2514
- /**
2515
- * @return {?}
2516
- */
2517
- isRouteId() {
2518
- return this.parameterDef.isRouteId;
2519
- }
2520
- /**
2521
- * @return {?}
2522
- */
2523
- get valueChanged() {
2524
- return !isNil(this.initialValue) && this.hasChanged(this.initialValue, this.sanitisedValue);
2525
- }
2526
- /**
2527
- * @return {?}
2528
- */
2529
- get sanitisedValue() {
2530
- return this._sanitisedValue;
2531
- }
2532
- /**
2533
- * @return {?}
2534
- */
2535
- sanitize() {
2536
- return __awaiter(this, void 0, void 0, function* () {
2537
- if (this.sanitiser) {
2538
- this.initialValue = this.readFrom(this.snapshot);
2539
- this._sanitisedValue = yield this.sanitiser.sanitise(this.initialValue);
2540
- if (this.initialValue !== this._sanitisedValue) {
2541
- return false;
2542
- }
2543
- }
2544
- return true;
2545
- });
2546
- }
2547
- }
2548
- if (false) {
2549
- /**
2550
- * @type {?}
2551
- * @private
2552
- */
2553
- Sanitiser.prototype.initialValue;
2554
- /**
2555
- * @type {?}
2556
- * @private
2557
- */
2558
- Sanitiser.prototype._sanitisedValue;
2559
- /** @type {?} */
2560
- Sanitiser.prototype.parameterDef;
2561
- /** @type {?} */
2562
- Sanitiser.prototype.snapshot;
2563
- /** @type {?} */
2564
- Sanitiser.prototype.sanitiser;
2565
- /**
2566
- * @abstract
2567
- * @protected
2568
- * @param {?} snapshot
2569
- * @return {?}
2570
- */
2571
- Sanitiser.prototype.readFrom = function (snapshot) { };
2572
- /**
2573
- * @abstract
2574
- * @protected
2575
- * @param {?} initialValue
2576
- * @param {?} sanitisedValue
2577
- * @return {?}
2578
- */
2579
- Sanitiser.prototype.hasChanged = function (initialValue, sanitisedValue) { };
2580
- /**
2581
- * @abstract
2582
- * @param {?} dest
2583
- * @return {?}
2584
- */
2585
- Sanitiser.prototype.injectRouteParam = function (dest) { };
2586
- }
2587
- class RouteParameterSanitiser {
2588
- /**
2589
- * @param {?} parameterDefs
2590
- * @param {?} snapshot
2591
- * @param {?} injector
2592
- */
2593
- constructor(parameterDefs, snapshot, injector) {
2594
- this.parameterDefs = parameterDefs;
2595
- this.snapshot = snapshot;
2596
- this.injector = injector;
2597
- this.parameterSanitisers = [];
2598
- /** @type {?} */
2599
- const sanitisers = parameterDefs.map((/**
2600
- * @param {?} def
2601
- * @return {?}
2602
- */
2603
- def => {
2604
- return def.isArray ?
2605
- new Sanitiser.Array(def, snapshot, this.getSanitiser(def)) :
2606
- new Sanitiser.Value(def, snapshot, this.getSanitiser(def));
2607
- }));
2608
- this.routeIdSanitiser = sanitisers.find((/**
2609
- * @param {?} p
2610
- * @return {?}
2611
- */
2612
- p => p.isRouteId()));
2613
- this.parameterSanitisers = sanitisers.filter((/**
2614
- * @param {?} p
2615
- * @return {?}
2616
- */
2617
- p => !p.isRouteId()));
2618
- }
2619
- /**
2620
- * @return {?}
2621
- */
2622
- sanitise() {
2623
- return __awaiter(this, void 0, void 0, function* () {
2624
- if (this.routeIdSanitiser) {
2625
- yield this.routeIdSanitiser.sanitize();
2626
- if (this.routeIdSanitiser.valueChanged) {
2627
- // if the route id isn't ok we redirect immediately as the query params may need to be sanitised in the
2628
- // context of the route id.
2629
- return false;
2630
- }
2631
- }
2632
- for (const sanitiser of this.parameterSanitisers) {
2633
- yield sanitiser.sanitize();
2634
- }
2635
- return !this.parameterSanitisers.find((/**
2636
- * @param {?} s
2637
- * @return {?}
2638
- */
2639
- s => s.valueChanged));
2640
- });
2641
- }
2642
- /**
2643
- * @param {?} router
2644
- * @return {?}
2645
- */
2646
- redirect(router) {
2647
- assert.isTruthy(this.parameterSanitisers.length !== 0);
2648
- if (this.routeIdSanitiser.valueChanged) {
2649
- return router.navigate(['..', this.routeIdSanitiser.sanitisedValue]);
2650
- }
2651
- else {
2652
- /** @type {?} */
2653
- const routeParams = {};
2654
- this.parameterSanitisers.forEach((/**
2655
- * @param {?} s
2656
- * @return {?}
2657
- */
2658
- s => s.injectRouteParam(routeParams)));
2659
- return router.navigate(['.', routeParams]);
2660
- }
2661
- }
2662
- /**
2663
- * @private
2664
- * @template T, S
2665
- * @param {?} def
2666
- * @return {?}
2667
- */
2668
- getSanitiser(def) {
2669
- return def.sanitiser ? this.injector.get(def.sanitiser, new def.sanitiser()) : null;
2670
- }
2671
- }
2672
- __decorate([
2673
- Memoize$1(),
2674
- __metadata("design:type", Function),
2675
- __metadata("design:paramtypes", [Object]),
2676
- __metadata("design:returntype", Object)
2677
- ], RouteParameterSanitiser.prototype, "getSanitiser", null);
2678
- if (false) {
2679
- /**
2680
- * @type {?}
2681
- * @private
2682
- */
2683
- RouteParameterSanitiser.prototype.routeIdSanitiser;
2684
- /**
2685
- * @type {?}
2686
- * @private
2687
- */
2688
- RouteParameterSanitiser.prototype.parameterSanitisers;
2689
- /** @type {?} */
2690
- RouteParameterSanitiser.prototype.parameterDefs;
2691
- /** @type {?} */
2692
- RouteParameterSanitiser.prototype.snapshot;
2693
- /** @type {?} */
2694
- RouteParameterSanitiser.prototype.injector;
2695
- }
2696
- (function (Sanitiser) {
2697
- /**
2698
- * @template T
2699
- */
2700
- class Value extends Sanitiser {
2701
- /**
2702
- * @param {?} snapshot
2703
- * @return {?}
2704
- */
2705
- readFrom(snapshot) {
2706
- /** @type {?} */
2707
- const rawValue = this.parameterDef.isRouteId ?
2708
- snapshot.paramMap.get(this.parameterDef.name) :
2709
- snapshot.queryParamMap.get(this.parameterDef.name);
2710
- return this.parameterDef.type.parse(rawValue);
2711
- }
2712
- /**
2713
- * @protected
2714
- * @param {?} initialValue
2715
- * @param {?} sanitisedValue
2716
- * @return {?}
2717
- */
2718
- hasChanged(initialValue, sanitisedValue) {
2719
- return initialValue !== sanitisedValue;
2720
- }
2721
- /**
2722
- * @param {?} dest
2723
- * @return {?}
2724
- */
2725
- injectRouteParam(dest) {
2726
- dest[this.parameterDef.name] = this.parameterDef.type.format(this.sanitisedValue);
2727
- }
2728
- }
2729
- Sanitiser.Value = Value;
2730
- /**
2731
- * @template T
2732
- */
2733
- class Array extends Sanitiser {
2734
- /**
2735
- * @param {?} snapshot
2736
- * @return {?}
2737
- */
2738
- readFrom(snapshot) {
2739
- /** @type {?} */
2740
- const rawValues = snapshot.queryParamMap.getAll(this.parameterDef.name);
2741
- return rawValues.map((/**
2742
- * @param {?} value
2743
- * @return {?}
2744
- */
2745
- value => this.parameterDef.type.parse(value)));
2746
- }
2747
- /**
2748
- * @protected
2749
- * @param {?} initialValue
2750
- * @param {?} sanitisedValue
2751
- * @return {?}
2752
- */
2753
- hasChanged(initialValue, sanitisedValue) {
2754
- return initialValue !== sanitisedValue;
2755
- }
2756
- /**
2757
- * @param {?} dest
2758
- * @return {?}
2759
- */
2760
- injectRouteParam(dest) {
2761
- dest[this.parameterDef.name] = this.sanitisedValue.map((/**
2762
- * @param {?} v
2763
- * @return {?}
2764
- */
2765
- v => this.parameterDef.type.format(v)));
2766
- }
2767
- }
2768
- Sanitiser.Array = Array;
2769
- })(Sanitiser || (Sanitiser = {}));
2770
-
2771
- /**
2772
- * @fileoverview added by tsickle
2773
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2774
- */
2775
- class PlaceRouteGuard {
2776
- /**
2777
- * @param {?} router
2778
- * @param {?} injector
2779
- */
2780
- constructor(router, injector) {
2781
- this.router = router;
2782
- this.injector = injector;
2783
- }
2784
- /**
2785
- * @param {?} route
2786
- * @param {?} state
2787
- * @return {?}
2788
- */
2789
- canActivate(route, state) {
2790
- /** @type {?} */
2791
- const routeParameters = Klass.get(route.component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
2792
- /** @type {?} */
2793
- const sanitiser = new RouteParameterSanitiser(routeParameters, route, this.injector);
2794
- return sanitiser.sanitise().then((/**
2795
- * @param {?} proceed
2796
- * @return {?}
2797
- */
2798
- proceed => {
2799
- if (!proceed) {
2800
- sanitiser.redirect(this.router);
2801
- }
2802
- return proceed;
2803
- }));
2804
- }
2805
- }
2806
- PlaceRouteGuard.decorators = [
2807
- { type: Injectable, args: [{
2808
- providedIn: 'root'
2809
- },] }
2810
- ];
2811
- /** @nocollapse */
2812
- PlaceRouteGuard.ctorParameters = () => [
2813
- { type: Router },
2814
- { type: Injector }
2815
- ];
2816
- /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(Router), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
2817
- __decorate([
2818
- Trace(),
2819
- __metadata("design:type", Function),
2820
- __metadata("design:paramtypes", [ActivatedRouteSnapshot, RouterStateSnapshot]),
2821
- __metadata("design:returntype", Object)
2822
- ], PlaceRouteGuard.prototype, "canActivate", null);
2823
- if (false) {
2824
- /**
2825
- * @type {?}
2826
- * @private
2827
- */
2828
- PlaceRouteGuard.prototype.router;
2829
- /**
2830
- * @type {?}
2831
- * @private
2832
- */
2833
- PlaceRouteGuard.prototype.injector;
2834
- }
2835
-
2836
- /**
2837
- * @fileoverview added by tsickle
2838
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2839
- */
2840
- /**
2841
- * @record
2842
- */
2843
- function JsonArray() { }
2844
- /**
2845
- * @record
2846
- */
2847
- function JsonMap() { }
2848
-
2849
- /**
2850
- * @fileoverview added by tsickle
2851
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2852
- */
2853
- /**
2854
- * @record
2855
- * @template T
2856
- */
2857
- function ParameterOptions() { }
2858
- if (false) {
2859
- /** @type {?|undefined} */
2860
- ParameterOptions.prototype.as;
2861
- /** @type {?|undefined} */
2862
- ParameterOptions.prototype.sanitiser;
2863
- }
2864
- /**
2865
- * @record
2866
- * @template T
2867
- */
2868
- function ListParameterOptions() { }
2869
- if (false) {
2870
- /** @type {?|undefined} */
2871
- ListParameterOptions.prototype.as;
2872
- /** @type {?|undefined} */
2873
- ListParameterOptions.prototype.listSanitiser;
2874
- }
2875
- /**
2876
- * @template T
2877
- * @param {?} type
2878
- * @param {?=} options
2879
- * @return {?}
2880
- */
2881
- function RouteId(type, options) {
2882
- // assert.isTruthy(type.isValid());
2883
- return (/**
2884
- * @param {?} prototype
2885
- * @param {?} propertyKey
2886
- * @return {?}
2887
- */
2888
- (prototype, propertyKey) => {
2889
- /** @type {?} */
2890
- const param = createDefinition(propertyKey, type, options, true);
2891
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
2892
- UseDelegate()(prototype, propertyKey);
2893
- });
2894
- }
2895
- /**
2896
- * @deprecated use RouteParameter instead.
2897
- * @template T
2898
- * @param {?} type
2899
- * @param {?=} options
2900
- * @return {?}
2901
- */
2902
- function QueryParameter(type, options) {
2903
- return (/**
2904
- * @param {?} prototype
2905
- * @param {?} propertyKey
2906
- * @return {?}
2907
- */
2908
- (prototype, propertyKey) => {
2909
- /** @type {?} */
2910
- const param = createDefinition(propertyKey, type, options, false);
2911
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
2912
- UseDelegate()(prototype, propertyKey);
2913
- });
2914
- }
2915
- /**
2916
- * @template T
2917
- * @param {?} type
2918
- * @param {?=} options
2919
- * @return {?}
2920
- */
2921
- function RouteParameter(type, options) {
2922
- // assert.isTruthy(type.isValid());
2923
- return (/**
2924
- * @param {?} prototype
2925
- * @param {?} propertyKey
2926
- * @return {?}
2927
- */
2928
- (prototype, propertyKey) => {
2929
- /** @type {?} */
2930
- const param = createDefinition(propertyKey, type, options, false);
2931
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
2932
- UseDelegate()(prototype, propertyKey);
2933
- });
2934
- }
2935
- /**
2936
- * @deprecated use RouteParameterList instead
2937
- * @template E
2938
- * @param {?} elementType
2939
- * @param {?=} options
2940
- * @return {?}
2941
- */
2942
- function QueryParameterList(elementType, options) {
2943
- // assert.isTruthy(type.isValid());
2944
- return (/**
2945
- * @param {?} prototype
2946
- * @param {?} propertyKey
2947
- * @return {?}
2948
- */
2949
- (prototype, propertyKey) => {
2950
- /** @type {?} */
2951
- const param = createArrayDefinition(propertyKey, elementType, options);
2952
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
2953
- UseDelegate()(prototype, propertyKey);
2954
- });
2955
- }
2956
- /**
2957
- * @template E
2958
- * @param {?} elementType
2959
- * @param {?=} options
2960
- * @return {?}
2961
- */
2962
- function RouteParameterList(elementType, options) {
2963
- // assert.isTruthy(type.isValid());
2964
- return (/**
2965
- * @param {?} prototype
2966
- * @param {?} propertyKey
2967
- * @return {?}
2968
- */
2969
- (prototype, propertyKey) => {
2970
- /** @type {?} */
2971
- const param = createArrayDefinition(propertyKey, elementType, options);
2972
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
2973
- UseDelegate()(prototype, propertyKey);
2974
- });
2975
- }
2976
- /**
2977
- * @template T
2978
- * @param {?} propertyName
2979
- * @param {?} type
2980
- * @param {?} options
2981
- * @param {?} routeId
2982
- * @return {?}
2983
- */
2984
- function createDefinition(propertyName, type, options, routeId) {
2985
- /** @type {?} */
2986
- const opts = Opts.get(options);
2987
- /** @type {?} */
2988
- const propertyNameAsString = assert.notNil(propertyName).toString();
2989
- /** @type {?} */
2990
- const def = {
2991
- name: opts.getOptional('as', propertyNameAsString),
2992
- propertyName: propertyNameAsString,
2993
- type: assert.notNil(type),
2994
- sanitiser: opts.getOptional('sanitiser', null),
2995
- isRouteId: routeId,
2996
- isArray: false
2997
- };
2998
- return def;
2999
- }
3000
- /**
3001
- * @template T
3002
- * @param {?} propertyName
3003
- * @param {?} type
3004
- * @param {?} options
3005
- * @return {?}
3006
- */
3007
- function createArrayDefinition(propertyName, type, options) {
3008
- /** @type {?} */
3009
- const opts = Opts.get(options);
3010
- /** @type {?} */
3011
- const propertyNameAsString = assert.notNil(propertyName).toString();
3012
- /** @type {?} */
3013
- const def = {
3014
- name: opts.getOptional('as', propertyNameAsString),
3015
- propertyName: propertyNameAsString,
3016
- type: assert.notNil(type),
3017
- sanitiser: opts.getOptional('listSanitiser', null),
3018
- isRouteId: false,
3019
- isArray: true
3020
- };
3021
- return def;
3022
- }
3023
-
3024
- /**
3025
- * @fileoverview added by tsickle
3026
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3027
- */
3028
- /**
3029
- * @record
3030
- * @template E, S
3031
- */
3032
- function ParameterDefinition() { }
3033
- if (false) {
3034
- /** @type {?} */
3035
- ParameterDefinition.prototype.name;
3036
- /** @type {?} */
3037
- ParameterDefinition.prototype.propertyName;
3038
- /** @type {?} */
3039
- ParameterDefinition.prototype.type;
3040
- /** @type {?} */
3041
- ParameterDefinition.prototype.sanitiser;
3042
- /** @type {?} */
3043
- ParameterDefinition.prototype.isRouteId;
3044
- /** @type {?} */
3045
- ParameterDefinition.prototype.isArray;
3046
- }
3047
-
3048
- /**
3049
- * @fileoverview added by tsickle
3050
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3051
- */
3052
- /**
3053
- * @record
3054
- * @template T
3055
- */
3056
- function ParameterSanitiser() { }
3057
- if (false) {
3058
- /**
3059
- * @param {?} value
3060
- * @return {?}
3061
- */
3062
- ParameterSanitiser.prototype.sanitise = function (value) { };
3063
- }
3064
-
3065
- /**
3066
- * @fileoverview added by tsickle
3067
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3068
- */
3069
- // WARNING: interface has both a type and a value, skipping emit
3070
- var ParameterType;
3071
- (function (ParameterType) {
3072
- class StringType {
3073
- /**
3074
- * @param {?} value
3075
- * @return {?}
3076
- */
3077
- format(value) {
3078
- return value;
3079
- }
3080
- /**
3081
- * @param {?} value
3082
- * @return {?}
3083
- */
3084
- parse(value) {
3085
- return value;
3086
- }
3087
- }
3088
- class NumberType {
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
- ParameterType.STRING = new StringType();
3105
- ParameterType.NUMBER = new NumberType();
3106
- })(ParameterType || (ParameterType = {}));
3107
-
3108
- /**
3109
- * @fileoverview added by tsickle
3110
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3111
- */
3112
-
3113
- /**
3114
- * @fileoverview added by tsickle
3115
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3116
- */
3117
-
3118
- /**
3119
- * @fileoverview added by tsickle
3120
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3121
- */
3122
-
3123
- /**
3124
- * @fileoverview added by tsickle
3125
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3126
- */
3127
-
3128
- 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, NavComponent, NumberInputComponent, ParameterType, PasswordInputComponent, Place, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, QueryParameter, QueryParameterList, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterBindings, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, 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, NavComponent 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 };
3129
- //# sourceMappingURL=coolon-angular-ui-powerups.js.map