@coolon/angular-ui-powerups 0.0.1
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/README.md +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +3373 -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 +12 -0
- package/coolon-angular-ui-powerups.metadata.json +1 -0
- package/esm2015/coolon-angular-ui-powerups.js +17 -0
- package/esm2015/index.js +6 -0
- package/esm2015/lib/angular-ui-powerups.module.js +48 -0
- package/esm2015/lib/components/disposable-component.js +14 -0
- package/esm2015/lib/components/forms/abstract-input.component.js +173 -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 +91 -0
- package/esm2015/lib/directives/focus-binding.directive.js +163 -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 +112 -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 +52 -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 +25 -0
- package/esm2015/lib/place/place-component.js +17 -0
- package/esm2015/lib/place/place.decorator.js +67 -0
- package/esm2015/lib/place/place.module.js +38 -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 +82 -0
- package/esm2015/lib/place/route/parameter-definition.class.js +22 -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 +282 -0
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +148 -0
- package/esm2015/public_api.js +10 -0
- package/esm5/coolon-angular-ui-powerups.js +17 -0
- package/esm5/index.js +6 -0
- package/esm5/lib/angular-ui-powerups.module.js +52 -0
- package/esm5/lib/components/disposable-component.js +24 -0
- package/esm5/lib/components/forms/abstract-input.component.js +218 -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 +107 -0
- package/esm5/lib/directives/focus-binding.directive.js +211 -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 +138 -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 +62 -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 +25 -0
- package/esm5/lib/place/place-component.js +17 -0
- package/esm5/lib/place/place.decorator.js +64 -0
- package/esm5/lib/place/place.module.js +42 -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 +82 -0
- package/esm5/lib/place/route/parameter-definition.class.js +22 -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 +327 -0
- package/esm5/lib/place/route/route-parameter-sanitiser.js +203 -0
- package/esm5/public_api.js +10 -0
- package/fesm2015/coolon-angular-ui-powerups.js +2687 -0
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -0
- package/fesm5/coolon-angular-ui-powerups.js +3164 -0
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -0
- package/index.d.ts +1 -0
- package/lib/angular-ui-powerups.module.d.ts +2 -0
- package/lib/components/disposable-component.d.ts +5 -0
- package/lib/components/forms/abstract-input.component.d.ts +34 -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/lib/components/index.d.ts +13 -0
- 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 +11 -0
- package/lib/directives/focus-binding.directive.d.ts +21 -0
- package/lib/directives/index.d.ts +5 -0
- 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/lib/interaction/components/activity-outlet/activity-outlet-context.d.ts +10 -0
- 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/lib/interaction/confirm.d.ts +5 -0
- package/lib/interaction/index.d.ts +16 -0
- 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 +10 -0
- package/lib/place/guards/leave-place.guard.d.ts +10 -0
- package/lib/place/guards/place-route.guard.d.ts +9 -0
- package/lib/place/index.d.ts +20 -0
- package/lib/place/place-component.d.ts +5 -0
- package/lib/place/place.decorator.d.ts +18 -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 +9 -0
- package/lib/place/route/parameter-definition.class.d.ts +10 -0
- package/lib/place/route/parameter-sanitiser.d.ts +3 -0
- 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 +15 -0
- package/package.json +31 -0
- package/public_api.d.ts +5 -0
- package/schematics/collection.json +14 -0
- 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 +92 -0
- package/schematics/place-routes/index.js.map +1 -0
- package/schematics/place-routes/place-def.d.ts +31 -0
- package/schematics/place-routes/place-def.js +75 -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 +124 -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/schematics/place-routes/schema.json +17 -0
- package/schematics/place-routes/templates/apps/__project__/src/app/place-routes.ts.template +31 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
2
|
+
import { MutableValueModel } from '@coolon/pectin';
|
|
3
|
+
import { DisposableComponent } from '../components/disposable-component';
|
|
4
|
+
import { PlaceComponent } from './place-component';
|
|
5
|
+
import { Place } from './place.decorator';
|
|
6
|
+
export declare class AbstractPlaceComponent extends DisposableComponent implements PlaceComponent {
|
|
7
|
+
protected activatedRoute: ActivatedRoute;
|
|
8
|
+
readonly titleModel: MutableValueModel<string>;
|
|
9
|
+
private routeBindingMediator;
|
|
10
|
+
constructor(activatedRoute: ActivatedRoute, router: Router);
|
|
11
|
+
readonly placeConfig: Place.Descriptor;
|
|
12
|
+
canDeactivate(): boolean | Promise<boolean>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { PlaceComponent } from '../../place-component';
|
|
3
|
+
import { PlaceService } from '../../place.service';
|
|
4
|
+
export declare class PlaceOutletComponent implements OnInit {
|
|
5
|
+
private readonly placeService;
|
|
6
|
+
constructor(placeService: PlaceService);
|
|
7
|
+
ngOnInit(): void;
|
|
8
|
+
onActivate($event: PlaceComponent): void;
|
|
9
|
+
onDeactivate($event: PlaceComponent): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { 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
|
+
export declare class LeavePlaceGuard implements CanDeactivate<PlaceComponent> {
|
|
6
|
+
private router;
|
|
7
|
+
private injector;
|
|
8
|
+
constructor(router: Router, injector: Injector);
|
|
9
|
+
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
export declare class PlaceRouteGuard implements CanActivate {
|
|
5
|
+
private router;
|
|
6
|
+
private injector;
|
|
7
|
+
constructor(router: Router, injector: Injector);
|
|
8
|
+
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./abstract-place-component";
|
|
5
|
+
export * from "./place-component";
|
|
6
|
+
export * from "./place.decorator";
|
|
7
|
+
export * from "./place.module";
|
|
8
|
+
export * from "./place.service";
|
|
9
|
+
export * from "./components/busy-overlay/busy-overlay.component";
|
|
10
|
+
export * from "./components/empty-state/empty-state.component";
|
|
11
|
+
export * from "./components/place-outlet/place-outlet.component";
|
|
12
|
+
export * from "./guards/leave-place.guard";
|
|
13
|
+
export * from "./guards/place-route.guard";
|
|
14
|
+
export * from "./route/json-types";
|
|
15
|
+
export * from "./route/parameter-decorators";
|
|
16
|
+
export * from "./route/parameter-definition.class";
|
|
17
|
+
export * from "./route/parameter-sanitiser";
|
|
18
|
+
export * from "./route/parameter-type";
|
|
19
|
+
export * from "./route/route-parameter-bindings";
|
|
20
|
+
export * from "./route/route-parameter-sanitiser";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Constructable } from '@coolon/pectin';
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
import { PlaceComponent } from './place-component';
|
|
4
|
+
export declare function Place(options: Place.Options): (target: Function) => void;
|
|
5
|
+
export declare namespace Place {
|
|
6
|
+
interface Options {
|
|
7
|
+
path: string;
|
|
8
|
+
title: string;
|
|
9
|
+
authenticate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
class Descriptor {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly authenticate: boolean;
|
|
14
|
+
readonly title: string;
|
|
15
|
+
constructor(placeClass: Constructable<PlaceComponent>, options: Options);
|
|
16
|
+
}
|
|
17
|
+
function getDescriptor(klass: Constructable<PlaceComponent>): Descriptor;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PlaceComponent } from './place-component';
|
|
2
|
+
export declare class PlaceService {
|
|
3
|
+
private _activePlaces;
|
|
4
|
+
constructor();
|
|
5
|
+
readonly activePlaces: import("@coolon/pectin").ListModel<PlaceComponent>;
|
|
6
|
+
onActivate(place: PlaceComponent): void;
|
|
7
|
+
onDeactivate(place: PlaceComponent): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Constructable } from '@coolon/pectin';
|
|
2
|
+
import { ParameterSanitiser } from './parameter-sanitiser';
|
|
3
|
+
import { ParameterType } from './parameter-type';
|
|
4
|
+
export interface ParameterOptions<T> {
|
|
5
|
+
as?: string;
|
|
6
|
+
sanitiser?: Constructable<ParameterSanitiser<T>>;
|
|
7
|
+
}
|
|
8
|
+
export declare function RouteId<T extends string | number>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator;
|
|
9
|
+
export declare function QueryParameter<T>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Constructable } from '@coolon/pectin';
|
|
2
|
+
import { ParameterSanitiser } from './parameter-sanitiser';
|
|
3
|
+
import { ParameterType } from './parameter-type';
|
|
4
|
+
export interface ParameterDefinition<T> {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly propertyName: string;
|
|
7
|
+
readonly type: ParameterType<T>;
|
|
8
|
+
readonly sanitiser: Constructable<ParameterSanitiser<T>>;
|
|
9
|
+
readonly isRouteId: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ParameterType<T> {
|
|
2
|
+
format(value: T): string;
|
|
3
|
+
parse(value: string): T;
|
|
4
|
+
}
|
|
5
|
+
export declare namespace ParameterType {
|
|
6
|
+
class StringType implements ParameterType<string> {
|
|
7
|
+
format(value: string): string;
|
|
8
|
+
parse(value: string): string;
|
|
9
|
+
}
|
|
10
|
+
class NumberType implements ParameterType<number> {
|
|
11
|
+
format(value: number): string;
|
|
12
|
+
parse(value: string): number;
|
|
13
|
+
}
|
|
14
|
+
const STRING: StringType;
|
|
15
|
+
const NUMBER: NumberType;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
2
|
+
import { GarbageCollector, MutableValueModel } from '@coolon/pectin';
|
|
3
|
+
import { ParameterDefinition } from './parameter-definition.class';
|
|
4
|
+
export declare class RouteParameterBindings extends GarbageCollector {
|
|
5
|
+
private readonly component;
|
|
6
|
+
private readonly router;
|
|
7
|
+
private readonly activatedRoute;
|
|
8
|
+
readonly _incomingRouteChange: MutableValueModel<boolean>;
|
|
9
|
+
private txo;
|
|
10
|
+
private readonly resolvedParameters;
|
|
11
|
+
constructor(component: any, router: Router, activatedRoute: ActivatedRoute);
|
|
12
|
+
readonly incomingRouteChange: import("@coolon/pectin").ValueModel<boolean>;
|
|
13
|
+
protected installBinding<T>(parameter: ParameterDefinition<T>): void;
|
|
14
|
+
private getModelFor;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace RouteParameterBindings {
|
|
17
|
+
const ROUTE_PARAMETER_LIST_KEY: unique symbol;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { ActivatedRouteSnapshot, Router } from '@angular/router';
|
|
3
|
+
import { ParameterDefinition } from './parameter-definition.class';
|
|
4
|
+
export declare class RouteParameterSanitiser {
|
|
5
|
+
readonly parameterDefs: ParameterDefinition<any>[];
|
|
6
|
+
readonly injector: Injector;
|
|
7
|
+
private readonly routeParameter;
|
|
8
|
+
private readonly queryParameters;
|
|
9
|
+
private readonly sanitisedParameters;
|
|
10
|
+
constructor(parameterDefs: ParameterDefinition<any>[], injector: Injector);
|
|
11
|
+
sanitise(snapshot: ActivatedRouteSnapshot): Promise<boolean>;
|
|
12
|
+
sanitiseParameter<T>(def: ParameterDefinition<T>, formattedInitialValue: string): Promise<boolean>;
|
|
13
|
+
redirect(router: Router): Promise<boolean>;
|
|
14
|
+
private getSanitiser;
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coolon/angular-ui-powerups",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"schematics": "./schematics/collection.json",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"ts-morph": "^3.1.3",
|
|
7
|
+
"@typescript-plus/fast-memoize-decorator": "^0.1.0",
|
|
8
|
+
"@coolon/typescript-utilities": "^2.0.0",
|
|
9
|
+
"json5": "^2.1.0",
|
|
10
|
+
"tslib": "^1.9.0"
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"@angular/common": "^8.1.1",
|
|
14
|
+
"@angular/core": "^8.1.1",
|
|
15
|
+
"@angular/material": "^8.1.3",
|
|
16
|
+
"@angular/animations": "^8.2.2",
|
|
17
|
+
"@angular/cdk": "^8.1.3",
|
|
18
|
+
"@coolon/pectin": ">=1.14",
|
|
19
|
+
"resize-observer-polyfill": "^1.5.1"
|
|
20
|
+
},
|
|
21
|
+
"main": "bundles/coolon-angular-ui-powerups.umd.js",
|
|
22
|
+
"module": "fesm5/coolon-angular-ui-powerups.js",
|
|
23
|
+
"es2015": "fesm2015/coolon-angular-ui-powerups.js",
|
|
24
|
+
"esm5": "esm5/coolon-angular-ui-powerups.js",
|
|
25
|
+
"esm2015": "esm2015/coolon-angular-ui-powerups.js",
|
|
26
|
+
"fesm5": "fesm5/coolon-angular-ui-powerups.js",
|
|
27
|
+
"fesm2015": "fesm2015/coolon-angular-ui-powerups.js",
|
|
28
|
+
"typings": "coolon-angular-ui-powerups.d.ts",
|
|
29
|
+
"metadata": "coolon-angular-ui-powerups.metadata.json",
|
|
30
|
+
"sideEffects": false
|
|
31
|
+
}
|
package/public_api.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Add angular-ui-powerups to your application.",
|
|
6
|
+
"factory": "./ng-add/index#ngAdd"
|
|
7
|
+
},
|
|
8
|
+
"place-routes": {
|
|
9
|
+
"description": "Generates the place routes file",
|
|
10
|
+
"factory": "./place-routes/index#generateRoutes",
|
|
11
|
+
"schema": "./place-routes/schema.json"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
4
|
+
// Just return the tree
|
|
5
|
+
function ngAdd(_options) {
|
|
6
|
+
return (tree, _context) => {
|
|
7
|
+
_context.addTask(new tasks_1.NodePackageInstallTask());
|
|
8
|
+
return tree;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
exports.ngAdd = ngAdd;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/ng-add/index.ts"],"names":[],"mappings":";;AACA,4DAA0E;AAE1E,uBAAuB;AACvB,SAAgB,KAAK,CAAC,QAAa;IACjC,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,QAAQ,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AALD,sBAKC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@angular-devkit/core");
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const JSON5 = require("json5");
|
|
6
|
+
const ts_morph_1 = require("ts-morph");
|
|
7
|
+
const place_def_1 = require("./place-def");
|
|
8
|
+
const PLACE_ANNOTATION = /@Place\({([^})]*)}\)/m;
|
|
9
|
+
function generateRoutes(schema) {
|
|
10
|
+
return (tree, context) => {
|
|
11
|
+
const projectPath = `apps/${schema.project}/`;
|
|
12
|
+
const config = loadConfig(projectPath, tree, context);
|
|
13
|
+
const placeDefs = extractPlaces(projectPath, schema, tree, context);
|
|
14
|
+
const files = schematics_1.apply(schematics_1.url('./templates'), [
|
|
15
|
+
schematics_1.applyTemplates(Object.assign({}, schema, { placeDefs,
|
|
16
|
+
config }, core_1.strings)),
|
|
17
|
+
// @see https://github.com/angular/angular-cli/issues/11337#issuecomment-448259549
|
|
18
|
+
schematics_1.forEach((fileEntry) => {
|
|
19
|
+
if (tree.exists(fileEntry.path)) {
|
|
20
|
+
tree.overwrite(fileEntry.path, fileEntry.content);
|
|
21
|
+
}
|
|
22
|
+
return fileEntry;
|
|
23
|
+
})
|
|
24
|
+
]);
|
|
25
|
+
return schematics_1.mergeWith(files);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.generateRoutes = generateRoutes;
|
|
29
|
+
// function applyWithOverwrite(source: Source, rules: Rule[]): Rule {
|
|
30
|
+
// return (tree: Tree, _context: SchematicContext) => {
|
|
31
|
+
// const rule = mergeWith(
|
|
32
|
+
// apply(source, [
|
|
33
|
+
// ...rules,
|
|
34
|
+
// forEach((fileEntry) => {
|
|
35
|
+
// if (tree.exists(fileEntry.path)) {
|
|
36
|
+
// tree.overwrite(fileEntry.path, fileEntry.content);
|
|
37
|
+
// return null;
|
|
38
|
+
// }
|
|
39
|
+
// return fileEntry;
|
|
40
|
+
// })
|
|
41
|
+
// ])
|
|
42
|
+
// );
|
|
43
|
+
//
|
|
44
|
+
// return rule(tree, _context);
|
|
45
|
+
// };
|
|
46
|
+
// }
|
|
47
|
+
function createProject(projectPath, context) {
|
|
48
|
+
try {
|
|
49
|
+
return new ts_morph_1.Project({
|
|
50
|
+
tsConfigFilePath: `${projectPath}/tsconfig.json`
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
context.logger.fatal(`Failed to load typescript project form: ${projectPath} You probably need to specify the --project option?`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function loadConfig(projectPath, tree, context) {
|
|
58
|
+
const fileEntry = tree.get(`${projectPath}/places.json5`) || tree.get(`${projectPath}/places.json5`);
|
|
59
|
+
if (!fileEntry) {
|
|
60
|
+
throw new Error(`Unable to find config file at '${projectPath}places.json' or '${projectPath}places.json5'`);
|
|
61
|
+
}
|
|
62
|
+
const config = JSON5.parse(fileEntry.content.toString('utf-8'));
|
|
63
|
+
return config;
|
|
64
|
+
}
|
|
65
|
+
function extractPlaces(projectPath, schema, tree, context) {
|
|
66
|
+
const importPrefix = `${projectPath}/src/app/`;
|
|
67
|
+
const project = createProject(projectPath, context);
|
|
68
|
+
const placeDefs = [];
|
|
69
|
+
tree.getDir(projectPath).visit(filePath => {
|
|
70
|
+
if (!filePath.endsWith('.ts')) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const content = tree.read(filePath);
|
|
74
|
+
if (!content) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const sourceText = content.toString('utf-8');
|
|
78
|
+
if (sourceText.match(PLACE_ANNOTATION)) {
|
|
79
|
+
const sourceFile = project.getSourceFileOrThrow(`./${filePath}`);
|
|
80
|
+
sourceFile.getClasses().forEach((classDecl) => {
|
|
81
|
+
place_def_1.PlaceDef.scan(classDecl, context).onMatch(result => {
|
|
82
|
+
const moduleImportPath = `./${filePath.substr(importPrefix.length, filePath.length - importPrefix.length - '.ts'.length)}`;
|
|
83
|
+
const definition = result.createDefinition(moduleImportPath);
|
|
84
|
+
context.logger.info(`${moduleImportPath} -> ${classDecl.getName()}(route: /${definition.fullPath})`);
|
|
85
|
+
placeDefs.push(definition);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return placeDefs;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/index.ts"],"names":[],"mappings":";;AAAA,+CAA+C;AAC/C,2DAUoC;AACpC,+BAA8B;AAC9B,uCAAqD;AACrD,2CAAuC;AAGvC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEjD,SAAgB,cAAc,CAAC,MAAc;IAE3C,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,WAAW,GAAG,QAAQ,MAAM,CAAC,OAAO,GAAG,CAAC;QAC9C,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEpE,MAAM,KAAK,GAAG,kBAAK,CACjB,gBAAG,CAAC,aAAa,CAAC,EAClB;YACE,2BAAc,mBACT,MAAM,IACT,SAAS;gBACT,MAAM,IACH,cAAO,EACV;YACF,kFAAkF;YAClF,oBAAO,CAAC,CAAC,SAAoB,EAAE,EAAE;gBAC/B,IAAI,IAAI,CAAC,MAAM,CAAC,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AAC,CAAC;oBACrG,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC7B,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SchematicContext } from '@angular-devkit/schematics';
|
|
2
|
+
import { ClassDeclaration } from 'ts-morph';
|
|
3
|
+
import { Scanner } from './scanner';
|
|
4
|
+
export declare class PlaceDef {
|
|
5
|
+
readonly importPath: string;
|
|
6
|
+
readonly componentClass: string;
|
|
7
|
+
readonly properties: PlaceDef.Options;
|
|
8
|
+
readonly routeDef: PlaceDef.Parameter;
|
|
9
|
+
readonly queryParameters: PlaceDef.Parameter[];
|
|
10
|
+
constructor(importPath: string, componentClass: string, properties: PlaceDef.Options, routeDef: PlaceDef.Parameter, queryParameters: PlaceDef.Parameter[]);
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly routeIdentifier: string;
|
|
13
|
+
readonly fullPath: string;
|
|
14
|
+
readonly activateGuardNames: string[];
|
|
15
|
+
private requiresRouteGuard;
|
|
16
|
+
readonly routeModelName: string;
|
|
17
|
+
readonly authenticate: boolean;
|
|
18
|
+
stripEnclosingQuotes(value: string): string;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace PlaceDef {
|
|
21
|
+
interface Options {
|
|
22
|
+
title: string;
|
|
23
|
+
path: string;
|
|
24
|
+
authenticate: string;
|
|
25
|
+
}
|
|
26
|
+
interface Parameter {
|
|
27
|
+
parameterName: string;
|
|
28
|
+
modelName: string;
|
|
29
|
+
}
|
|
30
|
+
function scan(classDecl: ClassDeclaration, context: SchematicContext): Scanner;
|
|
31
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const src_1 = require("@typescript-plus/fast-memoize-decorator/dist/src");
|
|
10
|
+
const scanner_1 = require("./scanner");
|
|
11
|
+
class PlaceDef {
|
|
12
|
+
constructor(importPath, componentClass, properties, routeDef, queryParameters) {
|
|
13
|
+
this.importPath = importPath;
|
|
14
|
+
this.componentClass = componentClass;
|
|
15
|
+
this.properties = properties;
|
|
16
|
+
this.routeDef = routeDef;
|
|
17
|
+
this.queryParameters = queryParameters;
|
|
18
|
+
// console.log({ properties, routeDef });
|
|
19
|
+
}
|
|
20
|
+
get path() {
|
|
21
|
+
return this.stripEnclosingQuotes(this.properties.path);
|
|
22
|
+
}
|
|
23
|
+
get routeIdentifier() {
|
|
24
|
+
return this.routeDef ? this.stripEnclosingQuotes(this.routeDef.parameterName) : null;
|
|
25
|
+
}
|
|
26
|
+
get fullPath() {
|
|
27
|
+
return !!this.routeIdentifier ?
|
|
28
|
+
`${this.path}/:${this.routeIdentifier}` :
|
|
29
|
+
this.path;
|
|
30
|
+
}
|
|
31
|
+
get activateGuardNames() {
|
|
32
|
+
const activateGuards = [];
|
|
33
|
+
if (this.authenticate) {
|
|
34
|
+
activateGuards.push('AuthGuard');
|
|
35
|
+
}
|
|
36
|
+
if (this.requiresRouteGuard()) {
|
|
37
|
+
activateGuards.push('PlaceRouteGuard');
|
|
38
|
+
}
|
|
39
|
+
return activateGuards;
|
|
40
|
+
}
|
|
41
|
+
requiresRouteGuard() {
|
|
42
|
+
return this.routeIdentifier || this.queryParameters.length > 0;
|
|
43
|
+
}
|
|
44
|
+
get routeModelName() {
|
|
45
|
+
return this.routeDef ? this.stripEnclosingQuotes(this.routeDef.modelName) : null;
|
|
46
|
+
}
|
|
47
|
+
get authenticate() {
|
|
48
|
+
return this.properties.authenticate === 'true';
|
|
49
|
+
}
|
|
50
|
+
stripEnclosingQuotes(value) {
|
|
51
|
+
const cooked = value.replace(/(^["'])|(["']$)/g, '');
|
|
52
|
+
// console.log({ raw: value, cooked: cooked });
|
|
53
|
+
return cooked;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
__decorate([
|
|
57
|
+
src_1.Memoize()
|
|
58
|
+
], PlaceDef.prototype, "path", null);
|
|
59
|
+
__decorate([
|
|
60
|
+
src_1.Memoize()
|
|
61
|
+
], PlaceDef.prototype, "routeIdentifier", null);
|
|
62
|
+
__decorate([
|
|
63
|
+
src_1.Memoize()
|
|
64
|
+
], PlaceDef.prototype, "activateGuardNames", null);
|
|
65
|
+
__decorate([
|
|
66
|
+
src_1.Memoize()
|
|
67
|
+
], PlaceDef.prototype, "routeModelName", null);
|
|
68
|
+
exports.PlaceDef = PlaceDef;
|
|
69
|
+
(function (PlaceDef) {
|
|
70
|
+
function scan(classDecl, context) {
|
|
71
|
+
return new scanner_1.Scanner(classDecl, context);
|
|
72
|
+
}
|
|
73
|
+
PlaceDef.scan = scan;
|
|
74
|
+
})(PlaceDef = exports.PlaceDef || (exports.PlaceDef = {}));
|
|
75
|
+
//# sourceMappingURL=place-def.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/place-def.ts"],"names":[],"mappings":";;;;;;;;AACA,0EAA2E;AAE3E,uCAAoC;AAEpC,MAAa,QAAQ;IAGnB,YACW,UAAkB,EAClB,cAAsB,EACtB,UAA4B,EAC5B,QAA4B,EAC5B,eAAqC;QAJrC,eAAU,GAAV,UAAU,CAAQ;QAClB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UAAU,CAAC,YAAY,KAAK,MAAM,CAAC;IACjD,CAAC;IAED,oBAAoB,CAAC,KAAa;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QACrD,+CAA+C;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA7CC;IADC,aAAO,EAAE;oCAGT;AAGD;IADC,aAAO,EAAE;+CAGT;AASD;IADC,aAAO,EAAE;kDAUT;AAOD;IADC,aAAO,EAAE;8CAGT;AAhDH,4BA2DC;AAED,WAAiB,QAAQ;IAavB,SAAgB,IAAI,CAAC,SAA2B,EAAE,OAAyB;QACzE,OAAO,IAAI,iBAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAFe,aAAI,OAEnB,CAAA;AACH,CAAC,EAhBgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAgBxB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SchematicContext } from '@angular-devkit/schematics';
|
|
2
|
+
import { ClassDeclaration, Decorator, ObjectLiteralExpression, PropertyDeclaration } from 'ts-morph';
|
|
3
|
+
import { PlaceDef } from './place-def';
|
|
4
|
+
export declare class Scanner {
|
|
5
|
+
private readonly classDecl;
|
|
6
|
+
readonly context: SchematicContext;
|
|
7
|
+
private placeAnnotation;
|
|
8
|
+
constructor(classDecl: ClassDeclaration, context: SchematicContext);
|
|
9
|
+
isPlace(): boolean;
|
|
10
|
+
onMatch(callback: (scan: Scanner) => void): void;
|
|
11
|
+
createDefinition(moduleImportPath: string): PlaceDef;
|
|
12
|
+
protected getPlaceOptions(): PlaceDef.Options;
|
|
13
|
+
protected getRouteIdParameter(): PlaceDef.Parameter;
|
|
14
|
+
protected getQueryParameters(): PlaceDef.Parameter[];
|
|
15
|
+
protected getDecoratedProperties(annotation: string): {
|
|
16
|
+
decorator: Decorator;
|
|
17
|
+
property: PropertyDeclaration;
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
export declare namespace Scanner {
|
|
21
|
+
function getObjectLiteralArgument(annotation: Decorator, position: number): ObjectLiteralExpression;
|
|
22
|
+
function getOptionsArg<T extends {}>(annotation: Decorator, defaults: T, options?: {
|
|
23
|
+
position: number;
|
|
24
|
+
required: boolean;
|
|
25
|
+
}): T;
|
|
26
|
+
}
|