@coolon/angular-ui-powerups 0.0.24 → 0.0.26
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/CHANGELOG.md +7 -0
- package/jest.config.js +9 -0
- package/ng-package.json +13 -0
- package/package.json +12 -14
- package/schematics/ng-add/index.ts +10 -0
- package/schematics/place-routes/index.ts +152 -0
- package/schematics/place-routes/place-def.ts +93 -0
- package/schematics/place-routes/scanner.ts +145 -0
- package/schematics/place-routes/schema.ts +7 -0
- package/src/lib/angular-ui-powerups.module.spec.ts +14 -0
- package/src/lib/angular-ui-powerups.module.ts +49 -0
- package/{lib/animations/index.d.ts → src/lib/animations/index.ts} +1 -0
- package/src/lib/animations/slideDownAndUpAnimation.ts +39 -0
- package/src/lib/components/disposable-component.ts +9 -0
- package/src/lib/components/forms/abstract-input.component.ts +108 -0
- package/src/lib/components/forms/number-input/number-input.component.html +15 -0
- package/src/lib/components/forms/number-input/number-input.component.scss +3 -0
- package/src/lib/components/forms/number-input/number-input.component.spec.ts +25 -0
- package/src/lib/components/forms/number-input/number-input.component.ts +19 -0
- package/src/lib/components/forms/password-input/password-input.component.html +16 -0
- package/src/lib/components/forms/password-input/password-input.component.scss +3 -0
- package/src/lib/components/forms/password-input/password-input.component.spec.ts +25 -0
- package/src/lib/components/forms/password-input/password-input.component.ts +18 -0
- package/src/lib/components/forms/scss/mixins.scss +16 -0
- package/src/lib/components/forms/select-input/select-input.component.html +16 -0
- package/src/lib/components/forms/select-input/select-input.component.scss +7 -0
- package/src/lib/components/forms/select-input/select-input.component.spec.ts +25 -0
- package/src/lib/components/forms/select-input/select-input.component.ts +31 -0
- package/src/lib/components/forms/string-input/string-input.component.html +15 -0
- package/src/lib/components/forms/string-input/string-input.component.scss +3 -0
- package/src/lib/components/forms/string-input/string-input.component.spec.ts +25 -0
- package/src/lib/components/forms/string-input/string-input.component.ts +18 -0
- package/{lib/components/index.d.ts → src/lib/components/index.ts} +1 -0
- package/src/lib/components/resize-aware.component.ts +52 -0
- package/src/lib/components/types/bounds.class.ts +25 -0
- package/src/lib/components/types/dimension.class.ts +3 -0
- package/src/lib/components/types/point.class.ts +13 -0
- package/src/lib/directives/command.directive.spec.ts +73 -0
- package/src/lib/directives/command.directive.ts +81 -0
- package/src/lib/directives/focus-binding.directive.spec.ts +8 -0
- package/src/lib/directives/focus-binding.directive.ts +108 -0
- package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +1 -0
- package/src/lib/interaction/abstract-activity.ts +57 -0
- package/src/lib/interaction/activity.ts +17 -0
- package/src/lib/interaction/alert.ts +6 -0
- package/src/lib/interaction/components/activity-container/activity-container.component.html +8 -0
- package/src/lib/interaction/components/activity-container/activity-container.component.scss +3 -0
- package/src/lib/interaction/components/activity-container/activity-container.component.spec.ts +25 -0
- package/src/lib/interaction/components/activity-container/activity-container.component.ts +93 -0
- package/{lib/interaction/components/activity-outlet/activity-outlet-context.d.ts → src/lib/interaction/components/activity-outlet/activity-outlet-context.ts} +7 -5
- package/src/lib/interaction/components/activity-outlet/activity-outlet.component.scss +3 -0
- package/src/lib/interaction/components/activity-outlet/activity-outlet.component.spec.ts +25 -0
- package/src/lib/interaction/components/activity-outlet/activity-outlet.component.ts +96 -0
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.html +7 -0
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.scss +7 -0
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.spec.ts +25 -0
- package/src/lib/interaction/components/alert-dialog/alert-dialog.component.ts +20 -0
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.html +9 -0
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.scss +8 -0
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.spec.ts +25 -0
- package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.ts +26 -0
- package/{lib/interaction/confirm.d.ts → src/lib/interaction/confirm.ts} +3 -2
- package/{lib/interaction/index.d.ts → src/lib/interaction/index.ts} +1 -0
- package/src/lib/interaction/interaction-context.ts +16 -0
- package/src/lib/interaction/interaction.module.ts +35 -0
- package/src/lib/interaction/result.ts +16 -0
- package/src/lib/interaction/services/dialog-interaction.service.scss +11 -0
- package/src/lib/interaction/services/dialog-interaction.service.spec.ts +12 -0
- package/src/lib/interaction/services/dialog-interaction.service.ts +63 -0
- package/src/lib/place/abstract-place-component.ts +33 -0
- package/src/lib/place/components/busy-overlay/busy-overlay.component.html +4 -0
- package/src/lib/place/components/busy-overlay/busy-overlay.component.scss +27 -0
- package/src/lib/place/components/busy-overlay/busy-overlay.component.spec.ts +25 -0
- package/src/lib/place/components/busy-overlay/busy-overlay.component.ts +23 -0
- package/src/lib/place/components/empty-state/empty-state.component.scss +15 -0
- package/src/lib/place/components/empty-state/empty-state.component.spec.ts +25 -0
- package/src/lib/place/components/empty-state/empty-state.component.ts +19 -0
- package/src/lib/place/components/place-outlet/place-outlet.component.html +7 -0
- package/src/lib/place/components/place-outlet/place-outlet.component.scss +12 -0
- package/src/lib/place/components/place-outlet/place-outlet.component.spec.ts +25 -0
- package/src/lib/place/components/place-outlet/place-outlet.component.ts +37 -0
- package/src/lib/place/components/place-outlet/route-animations.ts +30 -0
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.html +7 -0
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.scss +100 -0
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.spec.ts +25 -0
- package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts +30 -0
- package/src/lib/place/guards/leave-place.guard.spec.ts +15 -0
- package/src/lib/place/guards/leave-place.guard.ts +18 -0
- package/src/lib/place/guards/place-route.guard.ts +37 -0
- package/{lib/place/index.d.ts → src/lib/place/index.ts} +1 -0
- package/src/lib/place/place-component.ts +6 -0
- package/src/lib/place/place.decorator.ts +40 -0
- package/src/lib/place/place.module.ts +44 -0
- package/src/lib/place/place.service.spec.ts +12 -0
- package/src/lib/place/place.service.ts +29 -0
- package/src/lib/place/route/json-types.ts +5 -0
- package/src/lib/place/route/parameter-decorators.ts +99 -0
- package/src/lib/place/route/parameter-definition.class.ts +12 -0
- package/{lib/place/route/parameter-sanitiser.d.ts → src/lib/place/route/parameter-sanitiser.ts} +1 -1
- package/src/lib/place/route/parameter-type.ts +31 -0
- package/src/lib/place/route/route-parameter-bindings.ts +140 -0
- package/src/lib/place/route/route-parameter-sanitiser.ts +135 -0
- package/src/test-setup.ts +1 -0
- package/tsconfig.json +7 -0
- package/tsconfig.lib.json +20 -0
- package/tsconfig.schematics.json +35 -0
- package/tsconfig.spec.json +10 -0
- package/tslint.json +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +0 -3926
- package/bundles/coolon-angular-ui-powerups.umd.js.map +0 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +0 -2
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +0 -1
- package/coolon-angular-ui-powerups.d.ts +0 -30
- package/coolon-angular-ui-powerups.metadata.json +0 -1
- package/esm2015/coolon-angular-ui-powerups.js +0 -33
- package/esm2015/index.js +0 -6
- package/esm2015/lib/angular-ui-powerups.module.js +0 -54
- package/esm2015/lib/animations/index.js +0 -9
- package/esm2015/lib/animations/slideDownAndUpAnimation.js +0 -30
- package/esm2015/lib/components/disposable-component.js +0 -14
- package/esm2015/lib/components/forms/abstract-input.component.js +0 -183
- package/esm2015/lib/components/forms/number-input/number-input.component.js +0 -26
- package/esm2015/lib/components/forms/password-input/password-input.component.js +0 -26
- package/esm2015/lib/components/forms/select-input/select-input.component.js +0 -60
- package/esm2015/lib/components/forms/string-input/string-input.component.js +0 -26
- package/esm2015/lib/components/index.js +0 -18
- package/esm2015/lib/components/resize-aware.component.js +0 -96
- package/esm2015/lib/components/types/bounds.class.js +0 -56
- package/esm2015/lib/components/types/dimension.class.js +0 -21
- package/esm2015/lib/components/types/point.class.js +0 -36
- package/esm2015/lib/directives/command.directive.js +0 -135
- package/esm2015/lib/directives/focus-binding.directive.js +0 -179
- package/esm2015/lib/directives/index.js +0 -10
- package/esm2015/lib/interaction/abstract-activity.js +0 -129
- package/esm2015/lib/interaction/activity.js +0 -27
- package/esm2015/lib/interaction/alert.js +0 -23
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +0 -144
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -169
- package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -37
- package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -46
- package/esm2015/lib/interaction/confirm.js +0 -17
- package/esm2015/lib/interaction/index.js +0 -21
- package/esm2015/lib/interaction/interaction-context.js +0 -35
- package/esm2015/lib/interaction/interaction.module.js +0 -41
- package/esm2015/lib/interaction/result.js +0 -24
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +0 -114
- package/esm2015/lib/place/abstract-place-component.js +0 -59
- package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +0 -44
- package/esm2015/lib/place/components/empty-state/empty-state.component.js +0 -28
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +0 -67
- package/esm2015/lib/place/components/place-outlet/route-animations.js +0 -35
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +0 -50
- package/esm2015/lib/place/guards/leave-place.guard.js +0 -52
- package/esm2015/lib/place/guards/place-route.guard.js +0 -74
- package/esm2015/lib/place/index.js +0 -27
- package/esm2015/lib/place/place-component.js +0 -17
- package/esm2015/lib/place/place.decorator.js +0 -72
- package/esm2015/lib/place/place.module.js +0 -49
- package/esm2015/lib/place/place.service.js +0 -61
- package/esm2015/lib/place/route/json-types.js +0 -13
- package/esm2015/lib/place/route/parameter-decorators.js +0 -178
- package/esm2015/lib/place/route/parameter-definition.class.js +0 -24
- package/esm2015/lib/place/route/parameter-sanitiser.js +0 -17
- package/esm2015/lib/place/route/parameter-type.js +0 -43
- package/esm2015/lib/place/route/route-parameter-bindings.js +0 -294
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +0 -280
- package/esm2015/public_api.js +0 -11
- package/esm5/coolon-angular-ui-powerups.js +0 -33
- package/esm5/index.js +0 -6
- package/esm5/lib/angular-ui-powerups.module.js +0 -58
- package/esm5/lib/animations/index.js +0 -9
- package/esm5/lib/animations/slideDownAndUpAnimation.js +0 -30
- package/esm5/lib/components/disposable-component.js +0 -24
- package/esm5/lib/components/forms/abstract-input.component.js +0 -232
- package/esm5/lib/components/forms/number-input/number-input.component.js +0 -33
- package/esm5/lib/components/forms/password-input/password-input.component.js +0 -33
- package/esm5/lib/components/forms/select-input/select-input.component.js +0 -67
- package/esm5/lib/components/forms/string-input/string-input.component.js +0 -33
- package/esm5/lib/components/index.js +0 -18
- package/esm5/lib/components/resize-aware.component.js +0 -124
- package/esm5/lib/components/types/bounds.class.js +0 -59
- package/esm5/lib/components/types/dimension.class.js +0 -19
- package/esm5/lib/components/types/point.class.js +0 -43
- package/esm5/lib/directives/command.directive.js +0 -155
- package/esm5/lib/directives/focus-binding.directive.js +0 -231
- package/esm5/lib/directives/index.js +0 -10
- package/esm5/lib/interaction/abstract-activity.js +0 -173
- package/esm5/lib/interaction/activity.js +0 -27
- package/esm5/lib/interaction/alert.js +0 -23
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +0 -181
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -206
- package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -42
- package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -54
- package/esm5/lib/interaction/confirm.js +0 -17
- package/esm5/lib/interaction/index.js +0 -21
- package/esm5/lib/interaction/interaction-context.js +0 -45
- package/esm5/lib/interaction/interaction.module.js +0 -45
- package/esm5/lib/interaction/result.js +0 -24
- package/esm5/lib/interaction/services/dialog-interaction.service.js +0 -140
- package/esm5/lib/place/abstract-place-component.js +0 -66
- package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +0 -49
- package/esm5/lib/place/components/empty-state/empty-state.component.js +0 -29
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +0 -81
- package/esm5/lib/place/components/place-outlet/route-animations.js +0 -35
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +0 -57
- package/esm5/lib/place/guards/leave-place.guard.js +0 -57
- package/esm5/lib/place/guards/place-route.guard.js +0 -78
- package/esm5/lib/place/index.js +0 -27
- package/esm5/lib/place/place-component.js +0 -17
- package/esm5/lib/place/place.decorator.js +0 -69
- package/esm5/lib/place/place.module.js +0 -53
- package/esm5/lib/place/place.service.js +0 -75
- package/esm5/lib/place/route/json-types.js +0 -13
- package/esm5/lib/place/route/parameter-decorators.js +0 -178
- package/esm5/lib/place/route/parameter-definition.class.js +0 -24
- package/esm5/lib/place/route/parameter-sanitiser.js +0 -17
- package/esm5/lib/place/route/parameter-type.js +0 -65
- package/esm5/lib/place/route/route-parameter-bindings.js +0 -339
- package/esm5/lib/place/route/route-parameter-sanitiser.js +0 -395
- package/esm5/public_api.js +0 -11
- package/fesm2015/coolon-angular-ui-powerups.js +0 -3145
- package/fesm2015/coolon-angular-ui-powerups.js.map +0 -1
- package/fesm5/coolon-angular-ui-powerups.js +0 -3699
- package/fesm5/coolon-angular-ui-powerups.js.map +0 -1
- package/lib/angular-ui-powerups.module.d.ts +0 -2
- package/lib/animations/slideDownAndUpAnimation.d.ts +0 -5
- package/lib/components/disposable-component.d.ts +0 -5
- package/lib/components/forms/abstract-input.component.d.ts +0 -35
- package/lib/components/forms/number-input/number-input.component.d.ts +0 -6
- package/lib/components/forms/password-input/password-input.component.d.ts +0 -6
- package/lib/components/forms/select-input/select-input.component.d.ts +0 -11
- package/lib/components/forms/string-input/string-input.component.d.ts +0 -6
- package/lib/components/resize-aware.component.d.ts +0 -22
- package/lib/components/types/bounds.class.d.ts +0 -16
- package/lib/components/types/dimension.class.d.ts +0 -5
- package/lib/components/types/point.class.d.ts +0 -10
- package/lib/directives/command.directive.d.ts +0 -14
- package/lib/directives/focus-binding.directive.d.ts +0 -22
- package/lib/interaction/abstract-activity.d.ts +0 -17
- package/lib/interaction/activity.d.ts +0 -11
- package/lib/interaction/alert.d.ts +0 -5
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +0 -32
- package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +0 -30
- package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +0 -8
- package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -9
- package/lib/interaction/interaction-context.d.ts +0 -11
- package/lib/interaction/interaction.module.d.ts +0 -2
- package/lib/interaction/result.d.ts +0 -8
- package/lib/interaction/services/dialog-interaction.service.d.ts +0 -14
- package/lib/place/abstract-place-component.d.ts +0 -13
- package/lib/place/components/busy-overlay/busy-overlay.component.d.ts +0 -8
- package/lib/place/components/empty-state/empty-state.component.d.ts +0 -5
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +0 -13
- package/lib/place/components/place-outlet/route-animations.d.ts +0 -1
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +0 -11
- package/lib/place/guards/leave-place.guard.d.ts +0 -10
- package/lib/place/guards/place-route.guard.d.ts +0 -9
- package/lib/place/place-component.d.ts +0 -5
- package/lib/place/place.decorator.d.ts +0 -20
- package/lib/place/place.module.d.ts +0 -2
- package/lib/place/place.service.d.ts +0 -8
- package/lib/place/route/json-types.d.ts +0 -7
- package/lib/place/route/parameter-decorators.d.ts +0 -26
- package/lib/place/route/parameter-definition.class.d.ts +0 -11
- package/lib/place/route/parameter-type.d.ts +0 -16
- package/lib/place/route/route-parameter-bindings.d.ts +0 -18
- package/lib/place/route/route-parameter-sanitiser.d.ts +0 -42
- package/schematics/ng-add/index.d.ts +0 -2
- package/schematics/ng-add/index.js +0 -12
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/place-routes/index.d.ts +0 -3
- package/schematics/place-routes/index.js +0 -114
- package/schematics/place-routes/index.js.map +0 -1
- package/schematics/place-routes/place-def.d.ts +0 -34
- package/schematics/place-routes/place-def.js +0 -84
- package/schematics/place-routes/place-def.js.map +0 -1
- package/schematics/place-routes/scanner.d.ts +0 -26
- package/schematics/place-routes/scanner.js +0 -125
- package/schematics/place-routes/scanner.js.map +0 -1
- package/schematics/place-routes/schema.d.ts +0 -7
- package/schematics/place-routes/schema.js +0 -3
- package/schematics/place-routes/schema.js.map +0 -1
- /package/{index.d.ts → src/index.ts} +0 -0
- /package/{public_api.d.ts → src/public_api.ts} +0 -0
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ts_morph_1 = require("ts-morph");
|
|
4
|
-
const place_def_1 = require("./place-def");
|
|
5
|
-
function isDecoratorNode(node, name) {
|
|
6
|
-
return node.getKind() === ts_morph_1.SyntaxKind.Decorator && node.getText().startsWith(`${name}(`); // NOTE: I'm only supporting the @Decorator(...) style of usage (i.e. decorator factories).
|
|
7
|
-
}
|
|
8
|
-
class Scanner {
|
|
9
|
-
constructor(classDecl, context) {
|
|
10
|
-
this.classDecl = classDecl;
|
|
11
|
-
this.context = context;
|
|
12
|
-
classDecl.forEachChild((node) => {
|
|
13
|
-
if (isDecoratorNode(node, '@Place')) {
|
|
14
|
-
this.placeAnnotation = node;
|
|
15
|
-
// stop iterating when the node is a class declaration
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
isPlace() {
|
|
21
|
-
return !!this.placeAnnotation;
|
|
22
|
-
}
|
|
23
|
-
onMatch(callback) {
|
|
24
|
-
if (this.isPlace()) {
|
|
25
|
-
callback(this);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
createDefinition(moduleImportPath) {
|
|
29
|
-
this.getRouteIdParameter();
|
|
30
|
-
return new place_def_1.PlaceDef(moduleImportPath, this.classDecl.getName(), this.getPlaceOptions(), this.getRouteIdParameter(), this.getQueryParameters());
|
|
31
|
-
}
|
|
32
|
-
getPlaceOptions() {
|
|
33
|
-
// const args = this.placeAnnotation.getArguments();
|
|
34
|
-
// if (args.length !== 1) {
|
|
35
|
-
// console.error('@Place() accepts a single Options argument. got', args);
|
|
36
|
-
// }
|
|
37
|
-
return Scanner.getOptionsArg(this.placeAnnotation, {
|
|
38
|
-
title: '',
|
|
39
|
-
path: '',
|
|
40
|
-
order: -1,
|
|
41
|
-
authenticate: 'true'
|
|
42
|
-
}, {
|
|
43
|
-
position: 0,
|
|
44
|
-
required: true
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
getRouteIdParameter() {
|
|
48
|
-
const routeProperties = this.getDecoratedProperties('@RouteId');
|
|
49
|
-
if (routeProperties.length === 1) {
|
|
50
|
-
const route = routeProperties[0];
|
|
51
|
-
const routeOptions = Scanner.getOptionsArg(route.decorator, { as: 'id' }, {
|
|
52
|
-
position: 1,
|
|
53
|
-
required: false
|
|
54
|
-
});
|
|
55
|
-
return {
|
|
56
|
-
modelName: route.property.getName(),
|
|
57
|
-
parameterName: routeOptions.as
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
else if (routeProperties.length > 1) {
|
|
61
|
-
this.context.logger.error(`There an only be one @RouteId(), got ${routeProperties.length}`);
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
getQueryParameters() {
|
|
66
|
-
return this.getDecoratedProperties('@QueryParameter')
|
|
67
|
-
.map(p => {
|
|
68
|
-
const options = Scanner.getOptionsArg(p.decorator, { as: p.property.getName() }, {
|
|
69
|
-
position: 1,
|
|
70
|
-
required: false
|
|
71
|
-
});
|
|
72
|
-
return {
|
|
73
|
-
modelName: p.property.getName(),
|
|
74
|
-
parameterName: options.as
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
getDecoratedProperties(annotation) {
|
|
79
|
-
return this.classDecl.getProperties().map(p => {
|
|
80
|
-
let result = null;
|
|
81
|
-
p.forEachChild((child) => {
|
|
82
|
-
if (isDecoratorNode(child, annotation)) {
|
|
83
|
-
result = {
|
|
84
|
-
decorator: child,
|
|
85
|
-
property: p
|
|
86
|
-
};
|
|
87
|
-
// stop traversal
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
return result;
|
|
92
|
-
}).filter(r => !!r);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.Scanner = Scanner;
|
|
96
|
-
(function (Scanner) {
|
|
97
|
-
function getObjectLiteralArgument(annotation, position) {
|
|
98
|
-
const args = annotation.getArguments();
|
|
99
|
-
if (args.length > position && args[position] instanceof ts_morph_1.ObjectLiteralExpression) {
|
|
100
|
-
return args[position];
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
Scanner.getObjectLiteralArgument = getObjectLiteralArgument;
|
|
105
|
-
function getOptionsArg(annotation, defaults, options = {
|
|
106
|
-
position: 0,
|
|
107
|
-
required: true
|
|
108
|
-
}) {
|
|
109
|
-
const objectLiteralArgument = getObjectLiteralArgument(annotation, options.position);
|
|
110
|
-
if (!objectLiteralArgument) {
|
|
111
|
-
if (options.required) {
|
|
112
|
-
console.error(`expected object literal arg at position ${options.position}`, { expectedType: defaults });
|
|
113
|
-
}
|
|
114
|
-
return defaults;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
return objectLiteralArgument.getProperties().reduce((result, p) => {
|
|
118
|
-
const structure = p.getStructure();
|
|
119
|
-
return Object.assign({}, result, { [structure.name]: structure.initializer });
|
|
120
|
-
}, Object.assign({}, defaults));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
Scanner.getOptionsArg = getOptionsArg;
|
|
124
|
-
})(Scanner = exports.Scanner || (exports.Scanner = {}));
|
|
125
|
-
//# sourceMappingURL=scanner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/scanner.ts"],"names":[],"mappings":";;AACA,uCAQkB;AAClB,2CAAuC;AAEvC,SAAS,eAAe,CAAC,IAAU,EAAE,IAAY;IAC/C,OAAO,IAAI,CAAC,OAAO,EAAE,KAAK,qBAAU,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,2FAA2F;AACtL,CAAC;AAED,MAAa,OAAO;IAIlB,YAA6B,SAA2B,EAAW,OAAyB;QAA/D,cAAS,GAAT,SAAS,CAAkB;QAAW,YAAO,GAAP,OAAO,CAAkB;QAC1F,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9B,IAAI,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE;gBACnC,IAAI,CAAC,eAAe,GAAG,IAAiB,CAAC;gBACzC,sDAAsD;gBACtD,OAAO,IAAI,CAAC;aACb;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,QAAiC;QACvC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;YAClB,QAAQ,CAAC,IAAI,CAAC,CAAC;SAChB;IACH,CAAC;IAED,gBAAgB,CAAC,gBAAwB;QACvC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,IAAI,oBAAQ,CAAC,gBAAgB,EAClC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EACxB,IAAI,CAAC,eAAe,EAAE,EACtB,IAAI,CAAC,mBAAmB,EAAE,EAC1B,IAAI,CAAC,kBAAkB,EAAE,CAC1B,CAAC;IACJ,CAAC;IAES,eAAe;QACvB,oDAAoD;QACpD,2BAA2B;Q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OAAO,CAAC,QAAQ,CAAC,CAAC;QACrF,IAAI,CAAC,qBAAqB,EAAE;YAC1B,IAAI,OAAO,CAAC,QAAQ,EAAE;gBACpB,OAAO,CAAC,KAAK,CAAC,2CAA2C,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;aAC1G;YACD,OAAO,QAAQ,CAAC;SACjB;aAAM;YACL,OAAO,qBAAqB,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAChE,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,EAAiC,CAAC;gBAClE,yBAAY,MAAM,IAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAqB,IAAG;YAC1E,CAAC,oBAAO,QAAQ,EAAG,CAAC;SACrB;IACH,CAAC;IAhBe,qBAAa,gBAgB5B,CAAA;AACH,CAAC,EA3BgB,OAAO,GAAP,eAAO,KAAP,eAAO,QA2BvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/schema.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|