@coolon/angular-ui-powerups 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/coolon-angular-ui-powerups.umd.js +3926 -0
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -0
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -0
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -0
- package/coolon-angular-ui-powerups.d.ts +30 -0
- package/coolon-angular-ui-powerups.metadata.json +1 -0
- package/esm2015/coolon-angular-ui-powerups.js +33 -0
- package/esm2015/index.js +6 -0
- package/esm2015/lib/angular-ui-powerups.module.js +54 -0
- package/esm2015/lib/animations/index.js +9 -0
- package/esm2015/lib/animations/slideDownAndUpAnimation.js +30 -0
- package/esm2015/lib/components/disposable-component.js +14 -0
- package/esm2015/lib/components/forms/abstract-input.component.js +183 -0
- package/esm2015/lib/components/forms/number-input/number-input.component.js +26 -0
- package/esm2015/lib/components/forms/password-input/password-input.component.js +26 -0
- package/esm2015/lib/components/forms/select-input/select-input.component.js +60 -0
- package/esm2015/lib/components/forms/string-input/string-input.component.js +26 -0
- package/esm2015/lib/components/index.js +18 -0
- package/esm2015/lib/components/resize-aware.component.js +96 -0
- package/esm2015/lib/components/types/bounds.class.js +56 -0
- package/esm2015/lib/components/types/dimension.class.js +21 -0
- package/esm2015/lib/components/types/point.class.js +36 -0
- package/esm2015/lib/directives/command.directive.js +135 -0
- package/esm2015/lib/directives/focus-binding.directive.js +179 -0
- package/esm2015/lib/directives/index.js +10 -0
- package/esm2015/lib/interaction/abstract-activity.js +129 -0
- package/esm2015/lib/interaction/activity.js +27 -0
- package/esm2015/lib/interaction/alert.js +23 -0
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +144 -0
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +22 -0
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +169 -0
- package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +37 -0
- package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +46 -0
- package/esm2015/lib/interaction/confirm.js +17 -0
- package/esm2015/lib/interaction/index.js +21 -0
- package/esm2015/lib/interaction/interaction-context.js +35 -0
- package/esm2015/lib/interaction/interaction.module.js +41 -0
- package/esm2015/lib/interaction/result.js +24 -0
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +114 -0
- package/esm2015/lib/place/abstract-place-component.js +59 -0
- package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +44 -0
- package/esm2015/lib/place/components/empty-state/empty-state.component.js +28 -0
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +67 -0
- package/esm2015/lib/place/components/place-outlet/route-animations.js +35 -0
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +50 -0
- package/esm2015/lib/place/guards/leave-place.guard.js +52 -0
- package/esm2015/lib/place/guards/place-route.guard.js +74 -0
- package/esm2015/lib/place/index.js +27 -0
- package/esm2015/lib/place/place-component.js +17 -0
- package/esm2015/lib/place/place.decorator.js +72 -0
- package/esm2015/lib/place/place.module.js +49 -0
- package/esm2015/lib/place/place.service.js +61 -0
- package/esm2015/lib/place/route/json-types.js +13 -0
- package/esm2015/lib/place/route/parameter-decorators.js +178 -0
- package/esm2015/lib/place/route/parameter-definition.class.js +24 -0
- package/esm2015/lib/place/route/parameter-sanitiser.js +17 -0
- package/esm2015/lib/place/route/parameter-type.js +43 -0
- package/esm2015/lib/place/route/route-parameter-bindings.js +294 -0
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +280 -0
- package/esm2015/public_api.js +11 -0
- package/esm5/coolon-angular-ui-powerups.js +33 -0
- package/esm5/index.js +6 -0
- package/esm5/lib/angular-ui-powerups.module.js +58 -0
- package/esm5/lib/animations/index.js +9 -0
- package/esm5/lib/animations/slideDownAndUpAnimation.js +30 -0
- package/esm5/lib/components/disposable-component.js +24 -0
- package/esm5/lib/components/forms/abstract-input.component.js +232 -0
- package/esm5/lib/components/forms/number-input/number-input.component.js +33 -0
- package/esm5/lib/components/forms/password-input/password-input.component.js +33 -0
- package/esm5/lib/components/forms/select-input/select-input.component.js +67 -0
- package/esm5/lib/components/forms/string-input/string-input.component.js +33 -0
- package/esm5/lib/components/index.js +18 -0
- package/esm5/lib/components/resize-aware.component.js +124 -0
- package/esm5/lib/components/types/bounds.class.js +59 -0
- package/esm5/lib/components/types/dimension.class.js +19 -0
- package/esm5/lib/components/types/point.class.js +43 -0
- package/esm5/lib/directives/command.directive.js +155 -0
- package/esm5/lib/directives/focus-binding.directive.js +231 -0
- package/esm5/lib/directives/index.js +10 -0
- package/esm5/lib/interaction/abstract-activity.js +173 -0
- package/esm5/lib/interaction/activity.js +27 -0
- package/esm5/lib/interaction/alert.js +23 -0
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +181 -0
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +22 -0
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +206 -0
- package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +42 -0
- package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +54 -0
- package/esm5/lib/interaction/confirm.js +17 -0
- package/esm5/lib/interaction/index.js +21 -0
- package/esm5/lib/interaction/interaction-context.js +45 -0
- package/esm5/lib/interaction/interaction.module.js +45 -0
- package/esm5/lib/interaction/result.js +24 -0
- package/esm5/lib/interaction/services/dialog-interaction.service.js +140 -0
- package/esm5/lib/place/abstract-place-component.js +66 -0
- package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +49 -0
- package/esm5/lib/place/components/empty-state/empty-state.component.js +29 -0
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +81 -0
- package/esm5/lib/place/components/place-outlet/route-animations.js +35 -0
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +57 -0
- package/esm5/lib/place/guards/leave-place.guard.js +57 -0
- package/esm5/lib/place/guards/place-route.guard.js +78 -0
- package/esm5/lib/place/index.js +27 -0
- package/esm5/lib/place/place-component.js +17 -0
- package/esm5/lib/place/place.decorator.js +69 -0
- package/esm5/lib/place/place.module.js +53 -0
- package/esm5/lib/place/place.service.js +75 -0
- package/esm5/lib/place/route/json-types.js +13 -0
- package/esm5/lib/place/route/parameter-decorators.js +178 -0
- package/esm5/lib/place/route/parameter-definition.class.js +24 -0
- package/esm5/lib/place/route/parameter-sanitiser.js +17 -0
- package/esm5/lib/place/route/parameter-type.js +65 -0
- package/esm5/lib/place/route/route-parameter-bindings.js +339 -0
- package/esm5/lib/place/route/route-parameter-sanitiser.js +395 -0
- package/esm5/public_api.js +11 -0
- package/fesm2015/coolon-angular-ui-powerups.js +3145 -0
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -0
- package/fesm5/coolon-angular-ui-powerups.js +3699 -0
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -0
- package/lib/angular-ui-powerups.module.d.ts +2 -0
- package/{src/lib/animations/index.ts → lib/animations/index.d.ts} +0 -1
- package/lib/animations/slideDownAndUpAnimation.d.ts +5 -0
- package/lib/components/disposable-component.d.ts +5 -0
- package/lib/components/forms/abstract-input.component.d.ts +35 -0
- package/lib/components/forms/number-input/number-input.component.d.ts +6 -0
- package/lib/components/forms/password-input/password-input.component.d.ts +6 -0
- package/lib/components/forms/select-input/select-input.component.d.ts +11 -0
- package/lib/components/forms/string-input/string-input.component.d.ts +6 -0
- package/{src/lib/components/index.ts → lib/components/index.d.ts} +0 -1
- package/lib/components/resize-aware.component.d.ts +22 -0
- package/lib/components/types/bounds.class.d.ts +16 -0
- package/lib/components/types/dimension.class.d.ts +5 -0
- package/lib/components/types/point.class.d.ts +10 -0
- package/lib/directives/command.directive.d.ts +14 -0
- package/lib/directives/focus-binding.directive.d.ts +22 -0
- package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +0 -1
- package/lib/interaction/abstract-activity.d.ts +17 -0
- package/lib/interaction/activity.d.ts +11 -0
- package/lib/interaction/alert.d.ts +5 -0
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +32 -0
- package/{src/lib/interaction/components/activity-outlet/activity-outlet-context.ts → lib/interaction/components/activity-outlet/activity-outlet-context.d.ts} +5 -7
- package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +30 -0
- package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +8 -0
- package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +9 -0
- package/{src/lib/interaction/confirm.ts → lib/interaction/confirm.d.ts} +2 -3
- package/{src/lib/interaction/index.ts → lib/interaction/index.d.ts} +0 -1
- package/lib/interaction/interaction-context.d.ts +11 -0
- package/lib/interaction/interaction.module.d.ts +2 -0
- package/lib/interaction/result.d.ts +8 -0
- package/lib/interaction/services/dialog-interaction.service.d.ts +14 -0
- package/lib/place/abstract-place-component.d.ts +13 -0
- package/lib/place/components/busy-overlay/busy-overlay.component.d.ts +8 -0
- package/lib/place/components/empty-state/empty-state.component.d.ts +5 -0
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +13 -0
- package/lib/place/components/place-outlet/route-animations.d.ts +1 -0
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +11 -0
- package/lib/place/guards/leave-place.guard.d.ts +10 -0
- package/lib/place/guards/place-route.guard.d.ts +9 -0
- package/{src/lib/place/index.ts → lib/place/index.d.ts} +0 -1
- package/lib/place/place-component.d.ts +5 -0
- package/lib/place/place.decorator.d.ts +20 -0
- package/lib/place/place.module.d.ts +2 -0
- package/lib/place/place.service.d.ts +8 -0
- package/lib/place/route/json-types.d.ts +7 -0
- package/lib/place/route/parameter-decorators.d.ts +26 -0
- package/lib/place/route/parameter-definition.class.d.ts +11 -0
- package/{src/lib/place/route/parameter-sanitiser.ts → lib/place/route/parameter-sanitiser.d.ts} +1 -1
- package/lib/place/route/parameter-type.d.ts +16 -0
- package/lib/place/route/route-parameter-bindings.d.ts +18 -0
- package/lib/place/route/route-parameter-sanitiser.d.ts +42 -0
- package/package.json +14 -12
- package/schematics/ng-add/index.d.ts +2 -0
- package/schematics/ng-add/index.js +12 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/place-routes/index.d.ts +3 -0
- package/schematics/place-routes/index.js +114 -0
- package/schematics/place-routes/index.js.map +1 -0
- package/schematics/place-routes/place-def.d.ts +34 -0
- package/schematics/place-routes/place-def.js +84 -0
- package/schematics/place-routes/place-def.js.map +1 -0
- package/schematics/place-routes/scanner.d.ts +26 -0
- package/schematics/place-routes/scanner.js +125 -0
- package/schematics/place-routes/scanner.js.map +1 -0
- package/schematics/place-routes/schema.d.ts +7 -0
- package/schematics/place-routes/schema.js +3 -0
- package/schematics/place-routes/schema.js.map +1 -0
- package/CHANGELOG.md +0 -5
- package/jest.config.js +0 -9
- package/ng-package.json +0 -13
- package/schematics/ng-add/index.ts +0 -10
- package/schematics/place-routes/index.ts +0 -152
- package/schematics/place-routes/place-def.ts +0 -93
- package/schematics/place-routes/scanner.ts +0 -145
- package/schematics/place-routes/schema.ts +0 -7
- package/src/lib/angular-ui-powerups.module.spec.ts +0 -14
- package/src/lib/angular-ui-powerups.module.ts +0 -49
- package/src/lib/animations/slideDownAndUpAnimation.ts +0 -39
- package/src/lib/components/disposable-component.ts +0 -9
- package/src/lib/components/forms/abstract-input.component.ts +0 -108
- package/src/lib/components/forms/number-input/number-input.component.html +0 -15
- package/src/lib/components/forms/number-input/number-input.component.scss +0 -3
- package/src/lib/components/forms/number-input/number-input.component.spec.ts +0 -25
- package/src/lib/components/forms/number-input/number-input.component.ts +0 -19
- package/src/lib/components/forms/password-input/password-input.component.html +0 -16
- package/src/lib/components/forms/password-input/password-input.component.scss +0 -3
- package/src/lib/components/forms/password-input/password-input.component.spec.ts +0 -25
- package/src/lib/components/forms/password-input/password-input.component.ts +0 -18
- package/src/lib/components/forms/scss/mixins.scss +0 -16
- package/src/lib/components/forms/select-input/select-input.component.html +0 -16
- package/src/lib/components/forms/select-input/select-input.component.scss +0 -7
- package/src/lib/components/forms/select-input/select-input.component.spec.ts +0 -25
- package/src/lib/components/forms/select-input/select-input.component.ts +0 -31
- package/src/lib/components/forms/string-input/string-input.component.html +0 -15
- package/src/lib/components/forms/string-input/string-input.component.scss +0 -3
- package/src/lib/components/forms/string-input/string-input.component.spec.ts +0 -25
- package/src/lib/components/forms/string-input/string-input.component.ts +0 -18
- package/src/lib/components/resize-aware.component.ts +0 -52
- package/src/lib/components/types/bounds.class.ts +0 -25
- package/src/lib/components/types/dimension.class.ts +0 -3
- package/src/lib/components/types/point.class.ts +0 -13
- package/src/lib/directives/command.directive.spec.ts +0 -73
- package/src/lib/directives/command.directive.ts +0 -81
- package/src/lib/directives/focus-binding.directive.spec.ts +0 -8
- package/src/lib/directives/focus-binding.directive.ts +0 -108
- package/src/lib/interaction/abstract-activity.ts +0 -57
- package/src/lib/interaction/activity.ts +0 -17
- package/src/lib/interaction/alert.ts +0 -6
- package/src/lib/interaction/components/activity-container/activity-container.component.html +0 -8
- package/src/lib/interaction/components/activity-container/activity-container.component.scss +0 -3
- package/src/lib/interaction/components/activity-container/activity-container.component.spec.ts +0 -25
- package/src/lib/interaction/components/activity-container/activity-container.component.ts +0 -93
- package/src/lib/interaction/components/activity-outlet/activity-outlet.component.scss +0 -3
- package/src/lib/interaction/components/activity-outlet/activity-outlet.component.spec.ts +0 -25
- package/src/lib/interaction/components/activity-outlet/activity-outlet.component.ts +0 -96
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.html +0 -7
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.scss +0 -7
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.spec.ts +0 -25
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.ts +0 -20
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.html +0 -9
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.scss +0 -8
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.spec.ts +0 -25
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.ts +0 -26
- package/src/lib/interaction/interaction-context.ts +0 -16
- package/src/lib/interaction/interaction.module.ts +0 -35
- package/src/lib/interaction/result.ts +0 -16
- package/src/lib/interaction/services/dialog-interaction.service.scss +0 -11
- package/src/lib/interaction/services/dialog-interaction.service.spec.ts +0 -12
- package/src/lib/interaction/services/dialog-interaction.service.ts +0 -63
- package/src/lib/place/abstract-place-component.ts +0 -33
- package/src/lib/place/components/busy-overlay/busy-overlay.component.html +0 -4
- package/src/lib/place/components/busy-overlay/busy-overlay.component.scss +0 -27
- package/src/lib/place/components/busy-overlay/busy-overlay.component.spec.ts +0 -25
- package/src/lib/place/components/busy-overlay/busy-overlay.component.ts +0 -23
- package/src/lib/place/components/empty-state/empty-state.component.scss +0 -15
- package/src/lib/place/components/empty-state/empty-state.component.spec.ts +0 -25
- package/src/lib/place/components/empty-state/empty-state.component.ts +0 -19
- package/src/lib/place/components/place-outlet/place-outlet.component.html +0 -7
- package/src/lib/place/components/place-outlet/place-outlet.component.scss +0 -12
- package/src/lib/place/components/place-outlet/place-outlet.component.spec.ts +0 -25
- package/src/lib/place/components/place-outlet/place-outlet.component.ts +0 -37
- package/src/lib/place/components/place-outlet/route-animations.ts +0 -30
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.html +0 -7
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.scss +0 -100
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.spec.ts +0 -25
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts +0 -30
- package/src/lib/place/guards/leave-place.guard.spec.ts +0 -15
- package/src/lib/place/guards/leave-place.guard.ts +0 -18
- package/src/lib/place/guards/place-route.guard.ts +0 -37
- package/src/lib/place/place-component.ts +0 -6
- package/src/lib/place/place.decorator.ts +0 -40
- package/src/lib/place/place.module.ts +0 -44
- package/src/lib/place/place.service.spec.ts +0 -12
- package/src/lib/place/place.service.ts +0 -29
- package/src/lib/place/route/json-types.ts +0 -5
- package/src/lib/place/route/parameter-decorators.ts +0 -99
- package/src/lib/place/route/parameter-definition.class.ts +0 -12
- package/src/lib/place/route/parameter-type.ts +0 -31
- package/src/lib/place/route/route-parameter-bindings.ts +0 -140
- package/src/lib/place/route/route-parameter-sanitiser.ts +0 -135
- package/src/test-setup.ts +0 -1
- package/tsconfig.json +0 -7
- package/tsconfig.lib.json +0 -20
- package/tsconfig.schematics.json +0 -35
- package/tsconfig.spec.json +0 -10
- package/tslint.json +0 -7
- /package/{src/index.ts → index.d.ts} +0 -0
- /package/{src/public_api.ts → public_api.d.ts} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { Constructable } from '@coolon/pectin';
|
|
3
|
-
import { Activity } from './activity';
|
|
4
|
-
import { Alert } from './alert';
|
|
5
|
-
import { Confirm } from './confirm';
|
|
6
|
-
|
|
7
|
-
export const INTERACTION_CONTEXT = new InjectionToken<any>('InteractionContext');
|
|
8
|
-
|
|
9
|
-
export abstract class InteractionContext {
|
|
10
|
-
|
|
11
|
-
abstract startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R>;
|
|
12
|
-
|
|
13
|
-
abstract confirm(confirm: Confirm): Promise<boolean>;
|
|
14
|
-
|
|
15
|
-
abstract alert(alert: Alert): Promise<void>;
|
|
16
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { PortalModule } from '@angular/cdk/portal';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NgModule } from '@angular/core';
|
|
4
|
-
import { MatButtonModule, MatDialogModule, MatTabsModule } from '@angular/material';
|
|
5
|
-
import { ActivityContainerComponent } from './components/activity-container/activity-container.component';
|
|
6
|
-
import { AlertDialogComponent } from './components/alert-dialog/alert-dialog.component';
|
|
7
|
-
import { ConfirmationDialogComponent } from './components/confirmation-dialog/confirmation-dialog.component';
|
|
8
|
-
import { ActivityOutletComponent } from './components/activity-outlet/activity-outlet.component';
|
|
9
|
-
import { DialogInteractionService } from './services/dialog-interaction.service';
|
|
10
|
-
|
|
11
|
-
@NgModule({
|
|
12
|
-
imports: [
|
|
13
|
-
CommonModule,
|
|
14
|
-
MatButtonModule,
|
|
15
|
-
MatDialogModule,
|
|
16
|
-
MatTabsModule,
|
|
17
|
-
PortalModule
|
|
18
|
-
],
|
|
19
|
-
declarations: [
|
|
20
|
-
ActivityContainerComponent,
|
|
21
|
-
ConfirmationDialogComponent,
|
|
22
|
-
AlertDialogComponent,
|
|
23
|
-
ActivityOutletComponent
|
|
24
|
-
],
|
|
25
|
-
entryComponents: [
|
|
26
|
-
ActivityContainerComponent,
|
|
27
|
-
ConfirmationDialogComponent,
|
|
28
|
-
AlertDialogComponent
|
|
29
|
-
],
|
|
30
|
-
providers: [
|
|
31
|
-
DialogInteractionService
|
|
32
|
-
]
|
|
33
|
-
})
|
|
34
|
-
export class InteractionModule {
|
|
35
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface Result<R, E> {
|
|
2
|
-
// catch(callback: (error: E) => void): Result<R,E>;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export namespace Result {
|
|
6
|
-
export interface Callback<R,E> {
|
|
7
|
-
then: <T>(result:R)=>T;
|
|
8
|
-
catch: <T>(result:E)=>T;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// const r:Result<string, number> = null;
|
|
14
|
-
|
|
15
|
-
// r.catch(e => {}).then();
|
|
16
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// this is currently imported by styles.scss in the project root.
|
|
2
|
-
.dialog-interaction-service {
|
|
3
|
-
max-width: 95vw !important;
|
|
4
|
-
max-height: 95vh !important;
|
|
5
|
-
|
|
6
|
-
mat-dialog-container {
|
|
7
|
-
max-width: 95vw !important;
|
|
8
|
-
max-height: 95vh !important;
|
|
9
|
-
padding: 0;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DialogInteractionService } from './dialog-interaction.service';
|
|
4
|
-
|
|
5
|
-
describe('DialogInteractionService', () => {
|
|
6
|
-
beforeEach(() => TestBed.configureTestingModule({}));
|
|
7
|
-
|
|
8
|
-
it('should be created', () => {
|
|
9
|
-
const service: DialogInteractionService = TestBed.get(DialogInteractionService);
|
|
10
|
-
expect(service).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { MatDialog, MatDialogRef } from '@angular/material';
|
|
3
|
-
import { Constructable } from '@coolon/pectin';
|
|
4
|
-
import { Activity } from '../activity';
|
|
5
|
-
import { Alert } from '../alert';
|
|
6
|
-
import { ActivityContainerComponent } from '../components/activity-container/activity-container.component';
|
|
7
|
-
import { AlertDialogComponent } from '../components/alert-dialog/alert-dialog.component';
|
|
8
|
-
import { ConfirmationDialogComponent } from '../components/confirmation-dialog/confirmation-dialog.component';
|
|
9
|
-
import { Confirm } from '../confirm';
|
|
10
|
-
import { InteractionContext } from '../interaction-context';
|
|
11
|
-
import { assert } from '@coolon/typescript-utilities';
|
|
12
|
-
|
|
13
|
-
@Injectable({
|
|
14
|
-
providedIn: 'root'
|
|
15
|
-
})
|
|
16
|
-
export class DialogInteractionService extends InteractionContext {
|
|
17
|
-
|
|
18
|
-
constructor(private readonly dialogService: MatDialog) {
|
|
19
|
-
super();
|
|
20
|
-
assert.notNil(dialogService);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R> {
|
|
24
|
-
return this._startActivity(activityType, data);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
private _startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data: D, disableClose: boolean = true) {
|
|
28
|
-
const config = {
|
|
29
|
-
data,
|
|
30
|
-
disableClose,
|
|
31
|
-
panelClass: 'dialog-interaction-service',
|
|
32
|
-
autoFocus: false
|
|
33
|
-
};
|
|
34
|
-
const matDialogRef = this.dialogService.open(ActivityContainerComponent, config) as MatDialogRef<ActivityContainerComponent>;
|
|
35
|
-
return new Promise<R>((resolve, reject) => {
|
|
36
|
-
const activityContainer = matDialogRef.componentInstance;
|
|
37
|
-
activityContainer.parentInteractionContext = this;
|
|
38
|
-
activityContainer.initialise({
|
|
39
|
-
activityClass: activityType,
|
|
40
|
-
activityData: data,
|
|
41
|
-
onDone(result) {
|
|
42
|
-
resolve(result);
|
|
43
|
-
matDialogRef.close(result);
|
|
44
|
-
},
|
|
45
|
-
onCancel(error) {
|
|
46
|
-
reject(error);
|
|
47
|
-
matDialogRef.close(error);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
matDialogRef.updateSize();
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
alert(alert: Alert): Promise<void> {
|
|
56
|
-
return this._startActivity(AlertDialogComponent, alert, false);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
confirm(confirm: Confirm): Promise<boolean> {
|
|
60
|
-
return this._startActivity(ConfirmationDialogComponent, confirm, true);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ActivatedRoute, Router } from '@angular/router';
|
|
2
|
-
|
|
3
|
-
import { Constructable, DelegatingValueModel, MutableValueModel, UseDelegate } from '@coolon/pectin';
|
|
4
|
-
import { Memoize } from '@typescript-plus/fast-memoize-decorator';
|
|
5
|
-
import { DisposableComponent } from '../components/disposable-component';
|
|
6
|
-
import { PlaceComponent } from './place-component';
|
|
7
|
-
import { Place } from './place.decorator';
|
|
8
|
-
import { RouteParameterBindings } from './route/route-parameter-bindings';
|
|
9
|
-
|
|
10
|
-
export class AbstractPlaceComponent extends DisposableComponent implements PlaceComponent {
|
|
11
|
-
|
|
12
|
-
@UseDelegate()
|
|
13
|
-
readonly titleModel: MutableValueModel<string>;
|
|
14
|
-
|
|
15
|
-
private routeBindingMediator: RouteParameterBindings;
|
|
16
|
-
|
|
17
|
-
constructor(protected activatedRoute: ActivatedRoute, router: Router) {
|
|
18
|
-
super();
|
|
19
|
-
this.routeBindingMediator = this.registerDisposable(new RouteParameterBindings(this, router, activatedRoute));
|
|
20
|
-
// See https://coolon.atlassian.net/browse/PEC-59
|
|
21
|
-
(this.titleModel as unknown as DelegatingValueModel<string>).setDefault(this.placeConfig.title);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@Memoize()
|
|
25
|
-
get placeConfig(): Place.Descriptor {
|
|
26
|
-
return Place.getDescriptor(this.constructor as any as Constructable<PlaceComponent>);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
canDeactivate(): boolean | Promise<boolean> {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
position: relative;
|
|
3
|
-
//display: grid;
|
|
4
|
-
//grid-template-columns: 1fr;
|
|
5
|
-
//grid-template-rows: 1fr;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.busy-overlay-content {
|
|
9
|
-
//display: grid;
|
|
10
|
-
//grid-template-columns: 1fr;
|
|
11
|
-
//grid-template-rows: 1fr;
|
|
12
|
-
//width: 100%;
|
|
13
|
-
//height: 100%;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
div.busy-overlay-backdrop {
|
|
17
|
-
position: absolute;
|
|
18
|
-
background-color: rgba(0,0,0,0.2);
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
bottom: 0;
|
|
22
|
-
right: 0;
|
|
23
|
-
display: grid;
|
|
24
|
-
grid-template-columns: auto;
|
|
25
|
-
grid-template-rows: auto;
|
|
26
|
-
place-content: center;
|
|
27
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { BusyOverlayComponent } from './busy-overlay.component';
|
|
4
|
-
|
|
5
|
-
describe('BusyComponent', () => {
|
|
6
|
-
let component: BusyOverlayComponent;
|
|
7
|
-
let fixture: ComponentFixture<BusyOverlayComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ BusyOverlayComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(BusyOverlayComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
-
import { StoreInValueModel, UseDelegate, ValueModel } from '@coolon/pectin';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'angular-ui-powerups-busy-overlay',
|
|
6
|
-
templateUrl: `./busy-overlay.component.html`,
|
|
7
|
-
styleUrls: ['./busy-overlay.component.scss']
|
|
8
|
-
})
|
|
9
|
-
export class BusyOverlayComponent implements OnInit {
|
|
10
|
-
|
|
11
|
-
@Input() @UseDelegate()
|
|
12
|
-
busyModel: ValueModel<boolean>;
|
|
13
|
-
|
|
14
|
-
@Input() @StoreInValueModel('busyModel')
|
|
15
|
-
busy: boolean;
|
|
16
|
-
|
|
17
|
-
constructor() {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
ngOnInit() {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
align-items: center;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.container {
|
|
9
|
-
//display: inline-block;
|
|
10
|
-
padding: var(--angular-ui-powerups-default-padding);
|
|
11
|
-
border: 2px dashed rgba(0,0,0,0.2);
|
|
12
|
-
border-radius: 5px;
|
|
13
|
-
font-size: 14px;
|
|
14
|
-
font-weight: 300;
|
|
15
|
-
}
|
|
@@ -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,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
|
-
]);
|
package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.html
DELETED
|
@@ -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
|
-
|
package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.scss
DELETED
|
@@ -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
|
-
//
|
package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.spec.ts
DELETED
|
@@ -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
|
-
});
|
package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts
DELETED
|
@@ -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
|
-
}
|