@coolon/angular-ui-powerups 0.0.26 → 0.0.28

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 (287) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +3930 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -0
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -0
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -0
  5. package/coolon-angular-ui-powerups.d.ts +30 -0
  6. package/coolon-angular-ui-powerups.metadata.json +1 -0
  7. package/esm2015/coolon-angular-ui-powerups.js +33 -0
  8. package/esm2015/index.js +6 -0
  9. package/esm2015/lib/angular-ui-powerups.module.js +54 -0
  10. package/esm2015/lib/animations/index.js +9 -0
  11. package/esm2015/lib/animations/slideDownAndUpAnimation.js +30 -0
  12. package/esm2015/lib/components/disposable-component.js +14 -0
  13. package/esm2015/lib/components/forms/abstract-input.component.js +183 -0
  14. package/esm2015/lib/components/forms/number-input/number-input.component.js +26 -0
  15. package/esm2015/lib/components/forms/password-input/password-input.component.js +26 -0
  16. package/esm2015/lib/components/forms/select-input/select-input.component.js +60 -0
  17. package/esm2015/lib/components/forms/string-input/string-input.component.js +26 -0
  18. package/esm2015/lib/components/index.js +18 -0
  19. package/esm2015/lib/components/resize-aware.component.js +96 -0
  20. package/esm2015/lib/components/types/bounds.class.js +56 -0
  21. package/esm2015/lib/components/types/dimension.class.js +21 -0
  22. package/esm2015/lib/components/types/point.class.js +36 -0
  23. package/esm2015/lib/directives/command.directive.js +135 -0
  24. package/esm2015/lib/directives/focus-binding.directive.js +179 -0
  25. package/esm2015/lib/directives/index.js +10 -0
  26. package/esm2015/lib/interaction/abstract-activity.js +129 -0
  27. package/esm2015/lib/interaction/activity.js +27 -0
  28. package/esm2015/lib/interaction/alert.js +23 -0
  29. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +144 -0
  30. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +22 -0
  31. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +169 -0
  32. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +37 -0
  33. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +46 -0
  34. package/esm2015/lib/interaction/confirm.js +17 -0
  35. package/esm2015/lib/interaction/index.js +21 -0
  36. package/esm2015/lib/interaction/interaction-context.js +35 -0
  37. package/esm2015/lib/interaction/interaction.module.js +41 -0
  38. package/esm2015/lib/interaction/result.js +24 -0
  39. package/esm2015/lib/interaction/services/dialog-interaction.service.js +114 -0
  40. package/esm2015/lib/place/abstract-place-component.js +59 -0
  41. package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +44 -0
  42. package/esm2015/lib/place/components/empty-state/empty-state.component.js +28 -0
  43. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +67 -0
  44. package/esm2015/lib/place/components/place-outlet/route-animations.js +35 -0
  45. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +50 -0
  46. package/esm2015/lib/place/guards/leave-place.guard.js +52 -0
  47. package/esm2015/lib/place/guards/place-route.guard.js +74 -0
  48. package/esm2015/lib/place/index.js +27 -0
  49. package/esm2015/lib/place/place-component.js +17 -0
  50. package/esm2015/lib/place/place.decorator.js +72 -0
  51. package/esm2015/lib/place/place.module.js +49 -0
  52. package/esm2015/lib/place/place.service.js +61 -0
  53. package/esm2015/lib/place/route/json-types.js +13 -0
  54. package/esm2015/lib/place/route/parameter-decorators.js +182 -0
  55. package/esm2015/lib/place/route/parameter-definition.class.js +24 -0
  56. package/esm2015/lib/place/route/parameter-sanitiser.js +17 -0
  57. package/esm2015/lib/place/route/parameter-type.js +43 -0
  58. package/esm2015/lib/place/route/route-parameter-bindings.js +294 -0
  59. package/esm2015/lib/place/route/route-parameter-sanitiser.js +280 -0
  60. package/esm2015/public_api.js +11 -0
  61. package/esm5/coolon-angular-ui-powerups.js +33 -0
  62. package/esm5/index.js +6 -0
  63. package/esm5/lib/angular-ui-powerups.module.js +58 -0
  64. package/esm5/lib/animations/index.js +9 -0
  65. package/esm5/lib/animations/slideDownAndUpAnimation.js +30 -0
  66. package/esm5/lib/components/disposable-component.js +24 -0
  67. package/esm5/lib/components/forms/abstract-input.component.js +232 -0
  68. package/esm5/lib/components/forms/number-input/number-input.component.js +33 -0
  69. package/esm5/lib/components/forms/password-input/password-input.component.js +33 -0
  70. package/esm5/lib/components/forms/select-input/select-input.component.js +67 -0
  71. package/esm5/lib/components/forms/string-input/string-input.component.js +33 -0
  72. package/esm5/lib/components/index.js +18 -0
  73. package/esm5/lib/components/resize-aware.component.js +124 -0
  74. package/esm5/lib/components/types/bounds.class.js +59 -0
  75. package/esm5/lib/components/types/dimension.class.js +19 -0
  76. package/esm5/lib/components/types/point.class.js +43 -0
  77. package/esm5/lib/directives/command.directive.js +155 -0
  78. package/esm5/lib/directives/focus-binding.directive.js +231 -0
  79. package/esm5/lib/directives/index.js +10 -0
  80. package/esm5/lib/interaction/abstract-activity.js +173 -0
  81. package/esm5/lib/interaction/activity.js +27 -0
  82. package/esm5/lib/interaction/alert.js +23 -0
  83. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +181 -0
  84. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +22 -0
  85. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +206 -0
  86. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +42 -0
  87. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +54 -0
  88. package/esm5/lib/interaction/confirm.js +17 -0
  89. package/esm5/lib/interaction/index.js +21 -0
  90. package/esm5/lib/interaction/interaction-context.js +45 -0
  91. package/esm5/lib/interaction/interaction.module.js +45 -0
  92. package/esm5/lib/interaction/result.js +24 -0
  93. package/esm5/lib/interaction/services/dialog-interaction.service.js +140 -0
  94. package/esm5/lib/place/abstract-place-component.js +66 -0
  95. package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +49 -0
  96. package/esm5/lib/place/components/empty-state/empty-state.component.js +29 -0
  97. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +81 -0
  98. package/esm5/lib/place/components/place-outlet/route-animations.js +35 -0
  99. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +57 -0
  100. package/esm5/lib/place/guards/leave-place.guard.js +57 -0
  101. package/esm5/lib/place/guards/place-route.guard.js +78 -0
  102. package/esm5/lib/place/index.js +27 -0
  103. package/esm5/lib/place/place-component.js +17 -0
  104. package/esm5/lib/place/place.decorator.js +69 -0
  105. package/esm5/lib/place/place.module.js +53 -0
  106. package/esm5/lib/place/place.service.js +75 -0
  107. package/esm5/lib/place/route/json-types.js +13 -0
  108. package/esm5/lib/place/route/parameter-decorators.js +182 -0
  109. package/esm5/lib/place/route/parameter-definition.class.js +24 -0
  110. package/esm5/lib/place/route/parameter-sanitiser.js +17 -0
  111. package/esm5/lib/place/route/parameter-type.js +65 -0
  112. package/esm5/lib/place/route/route-parameter-bindings.js +339 -0
  113. package/esm5/lib/place/route/route-parameter-sanitiser.js +395 -0
  114. package/esm5/public_api.js +11 -0
  115. package/fesm2015/coolon-angular-ui-powerups.js +3149 -0
  116. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -0
  117. package/fesm5/coolon-angular-ui-powerups.js +3703 -0
  118. package/fesm5/coolon-angular-ui-powerups.js.map +1 -0
  119. package/lib/angular-ui-powerups.module.d.ts +2 -0
  120. package/{src/lib/animations/index.ts → lib/animations/index.d.ts} +0 -1
  121. package/lib/animations/slideDownAndUpAnimation.d.ts +5 -0
  122. package/lib/components/disposable-component.d.ts +5 -0
  123. package/lib/components/forms/abstract-input.component.d.ts +35 -0
  124. package/lib/components/forms/number-input/number-input.component.d.ts +6 -0
  125. package/lib/components/forms/password-input/password-input.component.d.ts +6 -0
  126. package/lib/components/forms/select-input/select-input.component.d.ts +11 -0
  127. package/lib/components/forms/string-input/string-input.component.d.ts +6 -0
  128. package/{src/lib/components/index.ts → lib/components/index.d.ts} +0 -1
  129. package/lib/components/resize-aware.component.d.ts +22 -0
  130. package/lib/components/types/bounds.class.d.ts +16 -0
  131. package/lib/components/types/dimension.class.d.ts +5 -0
  132. package/lib/components/types/point.class.d.ts +10 -0
  133. package/lib/directives/command.directive.d.ts +14 -0
  134. package/lib/directives/focus-binding.directive.d.ts +22 -0
  135. package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +0 -1
  136. package/lib/interaction/abstract-activity.d.ts +17 -0
  137. package/lib/interaction/activity.d.ts +11 -0
  138. package/lib/interaction/alert.d.ts +5 -0
  139. package/lib/interaction/components/activity-container/activity-container.component.d.ts +32 -0
  140. package/{src/lib/interaction/components/activity-outlet/activity-outlet-context.ts → lib/interaction/components/activity-outlet/activity-outlet-context.d.ts} +5 -7
  141. package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +30 -0
  142. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +8 -0
  143. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +9 -0
  144. package/{src/lib/interaction/confirm.ts → lib/interaction/confirm.d.ts} +2 -3
  145. package/{src/lib/interaction/index.ts → lib/interaction/index.d.ts} +0 -1
  146. package/lib/interaction/interaction-context.d.ts +11 -0
  147. package/lib/interaction/interaction.module.d.ts +2 -0
  148. package/lib/interaction/result.d.ts +8 -0
  149. package/lib/interaction/services/dialog-interaction.service.d.ts +14 -0
  150. package/lib/place/abstract-place-component.d.ts +13 -0
  151. package/lib/place/components/busy-overlay/busy-overlay.component.d.ts +8 -0
  152. package/lib/place/components/empty-state/empty-state.component.d.ts +5 -0
  153. package/lib/place/components/place-outlet/place-outlet.component.d.ts +13 -0
  154. package/lib/place/components/place-outlet/route-animations.d.ts +1 -0
  155. package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +11 -0
  156. package/lib/place/guards/leave-place.guard.d.ts +10 -0
  157. package/lib/place/guards/place-route.guard.d.ts +9 -0
  158. package/{src/lib/place/index.ts → lib/place/index.d.ts} +0 -1
  159. package/lib/place/place-component.d.ts +5 -0
  160. package/lib/place/place.decorator.d.ts +20 -0
  161. package/lib/place/place.module.d.ts +2 -0
  162. package/lib/place/place.service.d.ts +8 -0
  163. package/lib/place/route/json-types.d.ts +7 -0
  164. package/lib/place/route/parameter-decorators.d.ts +28 -0
  165. package/lib/place/route/parameter-definition.class.d.ts +11 -0
  166. package/{src/lib/place/route/parameter-sanitiser.ts → lib/place/route/parameter-sanitiser.d.ts} +1 -1
  167. package/lib/place/route/parameter-type.d.ts +16 -0
  168. package/lib/place/route/route-parameter-bindings.d.ts +18 -0
  169. package/lib/place/route/route-parameter-sanitiser.d.ts +42 -0
  170. package/package.json +14 -12
  171. package/schematics/ng-add/index.d.ts +2 -0
  172. package/schematics/ng-add/index.js +12 -0
  173. package/schematics/ng-add/index.js.map +1 -0
  174. package/schematics/place-routes/index.d.ts +3 -0
  175. package/schematics/place-routes/index.js +114 -0
  176. package/schematics/place-routes/index.js.map +1 -0
  177. package/schematics/place-routes/place-def.d.ts +37 -0
  178. package/schematics/place-routes/place-def.js +108 -0
  179. package/schematics/place-routes/place-def.js.map +1 -0
  180. package/schematics/place-routes/scanner.d.ts +38 -0
  181. package/schematics/place-routes/scanner.js +169 -0
  182. package/schematics/place-routes/scanner.js.map +1 -0
  183. package/schematics/place-routes/schema.d.ts +7 -0
  184. package/schematics/place-routes/schema.js +3 -0
  185. package/schematics/place-routes/schema.js.map +1 -0
  186. package/schematics/place-routes/templates/{services/place-router.service.ts.template → place-router.ts.template} +13 -18
  187. package/CHANGELOG.md +0 -7
  188. package/jest.config.js +0 -9
  189. package/ng-package.json +0 -13
  190. package/schematics/ng-add/index.ts +0 -10
  191. package/schematics/place-routes/index.ts +0 -152
  192. package/schematics/place-routes/place-def.ts +0 -93
  193. package/schematics/place-routes/scanner.ts +0 -145
  194. package/schematics/place-routes/schema.ts +0 -7
  195. package/src/lib/angular-ui-powerups.module.spec.ts +0 -14
  196. package/src/lib/angular-ui-powerups.module.ts +0 -49
  197. package/src/lib/animations/slideDownAndUpAnimation.ts +0 -39
  198. package/src/lib/components/disposable-component.ts +0 -9
  199. package/src/lib/components/forms/abstract-input.component.ts +0 -108
  200. package/src/lib/components/forms/number-input/number-input.component.html +0 -15
  201. package/src/lib/components/forms/number-input/number-input.component.scss +0 -3
  202. package/src/lib/components/forms/number-input/number-input.component.spec.ts +0 -25
  203. package/src/lib/components/forms/number-input/number-input.component.ts +0 -19
  204. package/src/lib/components/forms/password-input/password-input.component.html +0 -16
  205. package/src/lib/components/forms/password-input/password-input.component.scss +0 -3
  206. package/src/lib/components/forms/password-input/password-input.component.spec.ts +0 -25
  207. package/src/lib/components/forms/password-input/password-input.component.ts +0 -18
  208. package/src/lib/components/forms/scss/mixins.scss +0 -16
  209. package/src/lib/components/forms/select-input/select-input.component.html +0 -16
  210. package/src/lib/components/forms/select-input/select-input.component.scss +0 -7
  211. package/src/lib/components/forms/select-input/select-input.component.spec.ts +0 -25
  212. package/src/lib/components/forms/select-input/select-input.component.ts +0 -31
  213. package/src/lib/components/forms/string-input/string-input.component.html +0 -15
  214. package/src/lib/components/forms/string-input/string-input.component.scss +0 -3
  215. package/src/lib/components/forms/string-input/string-input.component.spec.ts +0 -25
  216. package/src/lib/components/forms/string-input/string-input.component.ts +0 -18
  217. package/src/lib/components/resize-aware.component.ts +0 -52
  218. package/src/lib/components/types/bounds.class.ts +0 -25
  219. package/src/lib/components/types/dimension.class.ts +0 -3
  220. package/src/lib/components/types/point.class.ts +0 -13
  221. package/src/lib/directives/command.directive.spec.ts +0 -73
  222. package/src/lib/directives/command.directive.ts +0 -81
  223. package/src/lib/directives/focus-binding.directive.spec.ts +0 -8
  224. package/src/lib/directives/focus-binding.directive.ts +0 -108
  225. package/src/lib/interaction/abstract-activity.ts +0 -57
  226. package/src/lib/interaction/activity.ts +0 -17
  227. package/src/lib/interaction/alert.ts +0 -6
  228. package/src/lib/interaction/components/activity-container/activity-container.component.html +0 -8
  229. package/src/lib/interaction/components/activity-container/activity-container.component.scss +0 -3
  230. package/src/lib/interaction/components/activity-container/activity-container.component.spec.ts +0 -25
  231. package/src/lib/interaction/components/activity-container/activity-container.component.ts +0 -93
  232. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.scss +0 -3
  233. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.spec.ts +0 -25
  234. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.ts +0 -96
  235. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.html +0 -7
  236. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.scss +0 -7
  237. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.spec.ts +0 -25
  238. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.ts +0 -20
  239. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.html +0 -9
  240. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.scss +0 -8
  241. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.spec.ts +0 -25
  242. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.ts +0 -26
  243. package/src/lib/interaction/interaction-context.ts +0 -16
  244. package/src/lib/interaction/interaction.module.ts +0 -35
  245. package/src/lib/interaction/result.ts +0 -16
  246. package/src/lib/interaction/services/dialog-interaction.service.scss +0 -11
  247. package/src/lib/interaction/services/dialog-interaction.service.spec.ts +0 -12
  248. package/src/lib/interaction/services/dialog-interaction.service.ts +0 -63
  249. package/src/lib/place/abstract-place-component.ts +0 -33
  250. package/src/lib/place/components/busy-overlay/busy-overlay.component.html +0 -4
  251. package/src/lib/place/components/busy-overlay/busy-overlay.component.scss +0 -27
  252. package/src/lib/place/components/busy-overlay/busy-overlay.component.spec.ts +0 -25
  253. package/src/lib/place/components/busy-overlay/busy-overlay.component.ts +0 -23
  254. package/src/lib/place/components/empty-state/empty-state.component.scss +0 -15
  255. package/src/lib/place/components/empty-state/empty-state.component.spec.ts +0 -25
  256. package/src/lib/place/components/empty-state/empty-state.component.ts +0 -19
  257. package/src/lib/place/components/place-outlet/place-outlet.component.html +0 -7
  258. package/src/lib/place/components/place-outlet/place-outlet.component.scss +0 -12
  259. package/src/lib/place/components/place-outlet/place-outlet.component.spec.ts +0 -25
  260. package/src/lib/place/components/place-outlet/place-outlet.component.ts +0 -37
  261. package/src/lib/place/components/place-outlet/route-animations.ts +0 -30
  262. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.html +0 -7
  263. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.scss +0 -100
  264. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.spec.ts +0 -25
  265. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts +0 -30
  266. package/src/lib/place/guards/leave-place.guard.spec.ts +0 -15
  267. package/src/lib/place/guards/leave-place.guard.ts +0 -18
  268. package/src/lib/place/guards/place-route.guard.ts +0 -37
  269. package/src/lib/place/place-component.ts +0 -6
  270. package/src/lib/place/place.decorator.ts +0 -40
  271. package/src/lib/place/place.module.ts +0 -44
  272. package/src/lib/place/place.service.spec.ts +0 -12
  273. package/src/lib/place/place.service.ts +0 -29
  274. package/src/lib/place/route/json-types.ts +0 -5
  275. package/src/lib/place/route/parameter-decorators.ts +0 -99
  276. package/src/lib/place/route/parameter-definition.class.ts +0 -12
  277. package/src/lib/place/route/parameter-type.ts +0 -31
  278. package/src/lib/place/route/route-parameter-bindings.ts +0 -140
  279. package/src/lib/place/route/route-parameter-sanitiser.ts +0 -135
  280. package/src/test-setup.ts +0 -1
  281. package/tsconfig.json +0 -7
  282. package/tsconfig.lib.json +0 -20
  283. package/tsconfig.schematics.json +0 -35
  284. package/tsconfig.spec.json +0 -10
  285. package/tslint.json +0 -7
  286. /package/{src/index.ts → index.d.ts} +0 -0
  287. /package/{src/public_api.ts → public_api.d.ts} +0 -0
@@ -1,25 +0,0 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { EmptyStateComponent } from './empty-state.component';
4
-
5
- describe('EmptyStateComponent', () => {
6
- let component: EmptyStateComponent;
7
- let fixture: ComponentFixture<EmptyStateComponent>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ EmptyStateComponent ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(EmptyStateComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,19 +0,0 @@
1
- import { Component, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'angular-ui-powerups-empty-state',
5
- template: `
6
- <div class="container">
7
- <ng-content></ng-content>
8
- </div>
9
- `,
10
- styleUrls: ['./empty-state.component.scss']
11
- })
12
- export class EmptyStateComponent implements OnInit {
13
-
14
- constructor() {
15
- }
16
-
17
- ngOnInit() {
18
- }
19
- }
@@ -1,7 +0,0 @@
1
- <div container [@routeAnimations]="getPlaceOrder(routerOutlet)">
2
- <router-outlet #routerOutlet="outlet"
3
- (activate)="onActivate($event)"
4
- (deactivate)="onDeactivate($event)">
5
- </router-outlet>
6
- </div>
7
-
@@ -1,12 +0,0 @@
1
- :host {
2
- display: flex;
3
- flex-direction: column;
4
- min-height: 0;
5
- }
6
-
7
- [container] {
8
- flex: 1;
9
- display: grid;
10
- grid-template-rows: 0 1fr; // the first row is the empty router outlet.
11
- min-height: 0;
12
- }
@@ -1,25 +0,0 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { PlaceOutletComponent } from './place-outlet.component';
4
-
5
- describe('PlaceOutletComponent', () => {
6
- let component: PlaceOutletComponent;
7
- let fixture: ComponentFixture<PlaceOutletComponent>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ PlaceOutletComponent ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(PlaceOutletComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,37 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { RouterOutlet } from '@angular/router';
3
- import { PlaceComponent } from '../../place-component';
4
- import { PlaceService } from '../../place.service';
5
- import { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';
6
- import {Trace} from "@coolon/pectin";
7
-
8
- @Component({
9
- selector: 'angular-ui-powerups-place-outlet',
10
- templateUrl: './place-outlet.component.html',
11
- styleUrls: ['./place-outlet.component.scss'],
12
- animations: [LEFT_RIGHT_PLACE_ANIMATION]
13
- })
14
- export class PlaceOutletComponent implements OnInit {
15
-
16
- @Input()
17
- animate = true;
18
-
19
- constructor(private readonly placeService: PlaceService) {
20
- }
21
-
22
- ngOnInit() {
23
- }
24
-
25
- onActivate($event: PlaceComponent) {
26
- this.placeService.onActivate($event);
27
- }
28
-
29
- onDeactivate($event: PlaceComponent) {
30
- this.placeService.onDeactivate($event);
31
- }
32
-
33
- getPlaceOrder(outlet: RouterOutlet) {
34
- return this.animate && outlet && outlet.activatedRouteData && outlet.activatedRouteData['placeOrder'];
35
- }
36
-
37
- }
@@ -1,30 +0,0 @@
1
- import { animate, animateChild, group, query, style, transition, trigger } from '@angular/animations';
2
-
3
- const left = [
4
- query(':enter, :leave', style({ position: 'fixed', width: '100%' }), { optional: true }),
5
- group([
6
- query(':enter', [style({ transform: 'translateX(-100%)' }), animate('.3s ease-out', style({ transform: 'translateX(0%)' }))], {
7
- optional: true,
8
- }),
9
- query(':leave', [style({ transform: 'translateX(0%)' }), animate('.3s ease-out', style({ transform: 'translateX(100%)' }))], {
10
- optional: true,
11
- }),
12
- ]),
13
- ];
14
-
15
- const right = [
16
- query(':enter, :leave', style({ position: 'fixed', width: '100%' }), { optional: true }),
17
- group([
18
- query(':enter', [style({ transform: 'translateX(100%)' }), animate('.3s ease-out', style({ transform: 'translateX(0%)' }))], {
19
- optional: true,
20
- }),
21
- query(':leave', [style({ transform: 'translateX(0%)' }), animate('.3s ease-out', style({ transform: 'translateX(-100%)' }))], {
22
- optional: true,
23
- }),
24
- ]),
25
- ];
26
-
27
- export const LEFT_RIGHT_PLACE_ANIMATION = trigger('routeAnimations', [
28
- transition(':increment', right),
29
- transition(':decrement', left),
30
- ]);
@@ -1,7 +0,0 @@
1
- <nav mat-tab-nav-bar>
2
- <a mat-tab-link *ngFor="let placeDescriptor of orderedPlaces.value" [routerLink]='placeDescriptor.path'
3
- routerLinkActive #rla="routerLinkActive"
4
- [active]="rla.isActive"
5
- [matTooltip]="placeDescriptor.title">{{placeDescriptor.title}}</a>
6
- </nav>
7
-
@@ -1,100 +0,0 @@
1
- //:host {
2
- // display: flex;
3
- // flex-direction: column;
4
- // --expanded-width: 235px;
5
- // --nav-item-width: var(--nav-bar-height);
6
- //
7
- // width: var(--nav-item-width);
8
- // //max-width: var(--nav-item-width);
9
- //
10
- // transition: width 125ms linear;
11
- //
12
- // &.expanded {
13
- // width: var(--expanded-width);
14
- // max-width: var(--expanded-width);
15
- // }
16
- //
17
- // background-color: #555;
18
- // color: rgba(255, 255, 255, 0.9);
19
- //}
20
- //
21
- //.expanded-only {
22
- // max-width: 0;
23
- // overflow: hidden;
24
- //}
25
- //
26
- //.collapsed-only {
27
- // max-width: 100%;
28
- // overflow: hidden;
29
- //}
30
- //
31
- //.header {
32
- // display: flex;
33
- // flex-direction: row;
34
- // justify-content: flex-end;
35
- // align-items: center;
36
- // height: var(--nav-bar-height);
37
- // border-bottom: 1px solid rgba(0, 0, 0, 0.2);
38
- //
39
- // .menu {
40
- // //padding-left: var(--default-padding);
41
- // flex: 1;
42
- // }
43
- //
44
- // button {
45
- // color: inherit;
46
- // width: var(--nav-item-width);
47
- // height: var(--nav-bar-height);
48
- // }
49
- //
50
- //}
51
- //
52
- //mat-nav-list {
53
- // flex: 1;
54
- // display: flex;
55
- // flex-direction: column;
56
- //}
57
- //
58
- //.mat-list-item {
59
- // width: var(--nav-item-width);
60
- // height: var(--nav-bar-height);
61
- // color: inherit;
62
- //
63
- // &.active {
64
- // background-color: #444;
65
- // }
66
- //}
67
- //
68
- //mat-icon {
69
- // color: inherit;
70
- // &.flip-horizontal {
71
- // transform: scaleX(-1);
72
- // }
73
- //}
74
- //
75
- //:host-context(.expanded) {
76
- //
77
- // .expanded-only {
78
- // max-width: 100%;
79
- // }
80
- // .collapsed-only {
81
- // max-width: 0;
82
- // }
83
- //
84
- // .mat-list-item {
85
- // mat-icon {
86
- // margin-right: 12px;
87
- // }
88
- //
89
- // span {
90
- // text-wrap: none;
91
- // white-space: nowrap;
92
- // }
93
- // }
94
- //}
95
- //
96
- //.app-menu {
97
- // padding-top: 0;
98
- //}
99
- //
100
- //
@@ -1,25 +0,0 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { TabbedPlaceNavigationComponent } from './tabbed-place-navigation.component';
4
-
5
- describe('NavComponent', () => {
6
- let component: TabbedPlaceNavigationComponent;
7
- let fixture: ComponentFixture<TabbedPlaceNavigationComponent>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ TabbedPlaceNavigationComponent ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(TabbedPlaceNavigationComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,30 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { Dsl, ListModel, ListModelChain, StoreInListModel, UseDelegate } from '@coolon/pectin';
3
- import { DisposableComponent } from '../../../components/disposable-component';
4
- import { Place } from '../../place.decorator';
5
-
6
- @Component({
7
- selector: 'angular-ui-powerups-tabbed-place-navigation',
8
- templateUrl: './tabbed-place-navigation.component.html',
9
- styleUrls: ['./tabbed-place-navigation.component.scss']
10
- })
11
- export class TabbedPlaceNavigationComponent extends DisposableComponent implements OnInit {
12
-
13
- @Input() @StoreInListModel('placesModel')
14
- places: Place.Descriptor[];
15
-
16
- @Input() @UseDelegate()
17
- placesModel: ListModel<Place.Descriptor>;
18
-
19
- readonly orderedPlaces: ListModelChain<Place.Descriptor>;
20
-
21
- constructor() {
22
- super();
23
- const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
24
- this.orderedPlaces = chain(this.placesModel).sortBy('order');
25
- }
26
-
27
- ngOnInit() {
28
- }
29
-
30
- }
@@ -1,15 +0,0 @@
1
- import { TestBed, async, inject } from '@angular/core/testing';
2
-
3
- import { LeavePlaceGuard } from './leave-place.guard';
4
-
5
- describe('LeavePlaceGuard', () => {
6
- beforeEach(() => {
7
- TestBed.configureTestingModule({
8
- providers: [LeavePlaceGuard]
9
- });
10
- });
11
-
12
- it('should ...', inject([LeavePlaceGuard], (guard: LeavePlaceGuard) => {
13
- expect(guard).toBeTruthy();
14
- }));
15
- });
@@ -1,18 +0,0 @@
1
- import { Injectable, Injector } from '@angular/core';
2
- import { ActivatedRouteSnapshot, CanDeactivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
3
- import { Observable } from 'rxjs';
4
- import { PlaceComponent } from '../place-component';
5
-
6
- @Injectable({
7
- providedIn: 'root'
8
- })
9
- export class LeavePlaceGuard implements CanDeactivate<PlaceComponent> {
10
-
11
- constructor(private router: Router, private injector: Injector) {
12
- }
13
-
14
- canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
15
- return component.canDeactivate();
16
- }
17
-
18
- }
@@ -1,37 +0,0 @@
1
- import { Injectable, Injector } from '@angular/core';
2
- import {
3
- ActivatedRouteSnapshot,
4
- CanActivate,
5
- CanDeactivate,
6
- Router,
7
- RouterStateSnapshot,
8
- UrlTree
9
- } from '@angular/router';
10
- import { Trace } from '@coolon/pectin';
11
- import { Klass } from '@coolon/typescript-utilities';
12
- import { Observable } from 'rxjs';
13
- import { PlaceComponent } from '../place-component';
14
- import { RouteParameterBindings } from '../route/route-parameter-bindings';
15
- import { RouteParameterSanitiser } from '../route/route-parameter-sanitiser';
16
-
17
- @Injectable({
18
- providedIn: 'root'
19
- })
20
- export class PlaceRouteGuard implements CanActivate {
21
-
22
- constructor(private router: Router, private injector: Injector) {
23
- }
24
-
25
- @Trace()
26
- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
27
- const routeParameters = Klass.get(route.component).getMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY);
28
- const sanitiser = new RouteParameterSanitiser(routeParameters, route, this.injector);
29
- return sanitiser.sanitise().then(proceed => {
30
- if (!proceed) {
31
- sanitiser.redirect(this.router);
32
- }
33
- return proceed;
34
- });
35
- }
36
-
37
- }
@@ -1,6 +0,0 @@
1
- import { ValueModel } from '@coolon/pectin';
2
-
3
- export interface PlaceComponent {
4
- titleModel:ValueModel<string>;
5
- canDeactivate(): boolean | Promise<boolean>;
6
- }
@@ -1,40 +0,0 @@
1
- import { assert, Constructable } from '@coolon/pectin';
2
- import * as _ from 'lodash';
3
- import 'reflect-metadata';
4
- import { PlaceComponent } from './place-component';
5
-
6
- export function Place(options: Place.Options) {
7
- return (target: Function) => {
8
- Reflect.defineMetadata('place.options', options, target);
9
- };
10
- }
11
-
12
- export namespace Place {
13
- export interface Options {
14
- path: string,
15
- title: string,
16
- order: number;
17
- authenticate?: boolean // defaults to true
18
- // childOf?: Constructable<PlaceComponent>
19
- }
20
-
21
- export class Descriptor {
22
- readonly path: string;
23
- readonly authenticate: boolean;
24
- readonly title: string;
25
- readonly order: number;
26
-
27
- constructor(placeClass: Constructable<PlaceComponent>, options: Options) {
28
- assert.notNil(options);
29
- this.path = options.path;
30
- this.title = options.title;
31
- this.order = options.order;
32
- this.authenticate = _.isNil(options.authenticate) || options.authenticate;
33
- }
34
- }
35
-
36
- export function getDescriptor(klass: Constructable<PlaceComponent>): Descriptor {
37
- const placeOptions = Reflect.getMetadata('place.options', klass);
38
- return new Descriptor(klass, placeOptions);
39
- }
40
- }
@@ -1,44 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { MatProgressSpinnerModule } from '@angular/material';
4
- import { MatListModule } from '@angular/material/list';
5
- import { MatTabsModule } from '@angular/material/tabs';
6
- import { MatTooltipModule } from '@angular/material/tooltip';
7
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
8
- import { RouterModule } from '@angular/router';
9
- import { BusyOverlayComponent } from './components/busy-overlay/busy-overlay.component';
10
- import { EmptyStateComponent } from './components/empty-state/empty-state.component';
11
- import { PlaceOutletComponent } from './components/place-outlet/place-outlet.component';
12
- import { TabbedPlaceNavigationComponent } from './components/tabbed-place-navigation/tabbed-place-navigation.component';
13
- import { PlaceService } from './place.service';
14
-
15
- @NgModule({
16
- imports: [
17
- CommonModule,
18
- BrowserAnimationsModule,
19
- MatProgressSpinnerModule,
20
- RouterModule,
21
- MatTabsModule,
22
- MatListModule,
23
- MatTooltipModule
24
- ],
25
- declarations: [
26
- EmptyStateComponent,
27
- BusyOverlayComponent,
28
- PlaceOutletComponent,
29
- TabbedPlaceNavigationComponent
30
- ],
31
- entryComponents: [BusyOverlayComponent],
32
- exports: [
33
- BusyOverlayComponent,
34
- PlaceOutletComponent,
35
- EmptyStateComponent,
36
- TabbedPlaceNavigationComponent
37
- ],
38
- providers: [
39
- PlaceService
40
- ]
41
- })
42
- export class PlaceModule {
43
-
44
- }
@@ -1,12 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { PlaceService } from './place.service';
4
-
5
- describe('PlaceService', () => {
6
- beforeEach(() => TestBed.configureTestingModule({}));
7
-
8
- it('should be created', () => {
9
- const service: PlaceService = TestBed.get(PlaceService);
10
- expect(service).toBeTruthy();
11
- });
12
- });
@@ -1,29 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { MutableListModel, Trace } from '@coolon/pectin';
3
- import { PlaceComponent } from './place-component';
4
-
5
- @Injectable({
6
- providedIn: 'root'
7
- })
8
- export class PlaceService {
9
-
10
- private _activePlaces = new MutableListModel<PlaceComponent>();
11
-
12
- constructor() {
13
- }
14
-
15
- get activePlaces() {
16
- return this._activePlaces.readonly;
17
- }
18
-
19
- @Trace()
20
- onActivate(place: PlaceComponent) {
21
- this._activePlaces.push(place);
22
- }
23
-
24
- @Trace()
25
- onDeactivate(place: PlaceComponent) {
26
- this._activePlaces.remove(place);
27
- }
28
-
29
- }
@@ -1,5 +0,0 @@
1
- export type JsonPrimitive = boolean | number | string;
2
- export type AnyJson = JsonPrimitive | null | JsonArray | JsonMap;
3
- export interface JsonArray extends Array<AnyJson> {}
4
- export interface JsonMap { [key: string]: AnyJson; }
5
-
@@ -1,99 +0,0 @@
1
- import { assert, Constructable, UseDelegate } from '@coolon/pectin';
2
- import { Klass, Opts } from '@coolon/typescript-utilities';
3
- import { ParameterDefinition } from './parameter-definition.class';
4
- import { ParameterSanitiser } from './parameter-sanitiser';
5
- import { ParameterType } from './parameter-type';
6
- import { RouteParameterBindings } from './route-parameter-bindings';
7
-
8
- export interface ParameterOptions<T> {
9
- as?: string;
10
- sanitiser?: Constructable<ParameterSanitiser<T>>;
11
- }
12
-
13
- export interface ListParameterOptions<T> {
14
- as?: string;
15
- listSanitiser?: Constructable<ParameterSanitiser<T[]>>;
16
- }
17
-
18
- export function RouteId<T extends string | number>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator {
19
- // assert.isTruthy(type.isValid());
20
- return (prototype: Object, propertyKey: string | symbol) => {
21
- const param = createDefinition(propertyKey, type, options, true);
22
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
23
- UseDelegate()(prototype, propertyKey);
24
- };
25
- }
26
-
27
- /**
28
- * @deprecated use RouteParameter instead.
29
- * @param type
30
- * @param options
31
- */
32
- export function QueryParameter<T>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator {
33
- return (prototype: Object, propertyKey: string | symbol) => {
34
- const param = createDefinition(propertyKey, type, options, false);
35
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
36
- UseDelegate()(prototype, propertyKey);
37
- };
38
- }
39
-
40
- export function RouteParameter<T>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator {
41
- // assert.isTruthy(type.isValid());
42
- return (prototype: Object, propertyKey: string | symbol) => {
43
- const param = createDefinition(propertyKey, type, options, false);
44
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
45
- UseDelegate()(prototype, propertyKey);
46
- };
47
- }
48
-
49
- /**
50
- * @deprecated use RouteParameterList instead
51
- * @param elementType
52
- * @param options
53
- */
54
- export function QueryParameterList<E>(elementType: ParameterType<E>, options?: ListParameterOptions<E>): PropertyDecorator {
55
- // assert.isTruthy(type.isValid());
56
- return (prototype: Object, propertyKey: string | symbol) => {
57
- const param = createArrayDefinition(propertyKey, elementType, options);
58
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
59
- UseDelegate()(prototype, propertyKey);
60
- };
61
- }
62
-
63
- export function RouteParameterList<E>(elementType: ParameterType<E>, options?: ListParameterOptions<E>): PropertyDecorator {
64
- // assert.isTruthy(type.isValid());
65
- return (prototype: Object, propertyKey: string | symbol) => {
66
- const param = createArrayDefinition(propertyKey, elementType, options);
67
- Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
68
- UseDelegate()(prototype, propertyKey);
69
- };
70
- }
71
-
72
- function createDefinition<T>(propertyName: symbol | string, type: ParameterType<T>, options: ParameterOptions<T>, routeId: boolean) {
73
- const opts = Opts.get(options);
74
- const propertyNameAsString = assert.notNil(propertyName).toString();
75
- const def: ParameterDefinition<T> = {
76
- name: opts.getOptional('as', propertyNameAsString),
77
- propertyName: propertyNameAsString,
78
- type: assert.notNil(type),
79
- sanitiser: opts.getOptional('sanitiser', null),
80
- isRouteId: routeId,
81
- isArray: false
82
- };
83
- return def;
84
- }
85
-
86
- function createArrayDefinition<T>(propertyName: symbol | string, type: ParameterType<T>, options: ListParameterOptions<T>) {
87
- const opts = Opts.get(options);
88
- const propertyNameAsString = assert.notNil(propertyName).toString();
89
-
90
- const def: ParameterDefinition<T, T[]> = {
91
- name: opts.getOptional('as', propertyNameAsString),
92
- propertyName: propertyNameAsString,
93
- type: assert.notNil(type),
94
- sanitiser: opts.getOptional('listSanitiser', null),
95
- isRouteId: false,
96
- isArray: true
97
- };
98
- return def;
99
- }
@@ -1,12 +0,0 @@
1
- import { Constructable } from '@coolon/pectin';
2
- import { ParameterSanitiser } from './parameter-sanitiser';
3
- import { ParameterType } from './parameter-type';
4
-
5
- export interface ParameterDefinition<E,S=E> {
6
- readonly name: string;
7
- readonly propertyName: string;
8
- readonly type: ParameterType<E>;
9
- readonly sanitiser: Constructable<ParameterSanitiser<S>>;
10
- readonly isRouteId: boolean;
11
- readonly isArray: boolean;
12
- }