@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.
Files changed (179) hide show
  1. package/README.md +7 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +3373 -0
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -0
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -0
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -0
  6. package/coolon-angular-ui-powerups.d.ts +12 -0
  7. package/coolon-angular-ui-powerups.metadata.json +1 -0
  8. package/esm2015/coolon-angular-ui-powerups.js +17 -0
  9. package/esm2015/index.js +6 -0
  10. package/esm2015/lib/angular-ui-powerups.module.js +48 -0
  11. package/esm2015/lib/components/disposable-component.js +14 -0
  12. package/esm2015/lib/components/forms/abstract-input.component.js +173 -0
  13. package/esm2015/lib/components/forms/number-input/number-input.component.js +26 -0
  14. package/esm2015/lib/components/forms/password-input/password-input.component.js +26 -0
  15. package/esm2015/lib/components/forms/select-input/select-input.component.js +60 -0
  16. package/esm2015/lib/components/forms/string-input/string-input.component.js +26 -0
  17. package/esm2015/lib/components/index.js +18 -0
  18. package/esm2015/lib/components/resize-aware.component.js +96 -0
  19. package/esm2015/lib/components/types/bounds.class.js +56 -0
  20. package/esm2015/lib/components/types/dimension.class.js +21 -0
  21. package/esm2015/lib/components/types/point.class.js +36 -0
  22. package/esm2015/lib/directives/command.directive.js +91 -0
  23. package/esm2015/lib/directives/focus-binding.directive.js +163 -0
  24. package/esm2015/lib/directives/index.js +10 -0
  25. package/esm2015/lib/interaction/abstract-activity.js +129 -0
  26. package/esm2015/lib/interaction/activity.js +27 -0
  27. package/esm2015/lib/interaction/alert.js +23 -0
  28. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +144 -0
  29. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +22 -0
  30. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +169 -0
  31. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +37 -0
  32. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +46 -0
  33. package/esm2015/lib/interaction/confirm.js +17 -0
  34. package/esm2015/lib/interaction/index.js +21 -0
  35. package/esm2015/lib/interaction/interaction-context.js +35 -0
  36. package/esm2015/lib/interaction/interaction.module.js +41 -0
  37. package/esm2015/lib/interaction/result.js +24 -0
  38. package/esm2015/lib/interaction/services/dialog-interaction.service.js +112 -0
  39. package/esm2015/lib/place/abstract-place-component.js +59 -0
  40. package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +44 -0
  41. package/esm2015/lib/place/components/empty-state/empty-state.component.js +28 -0
  42. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +52 -0
  43. package/esm2015/lib/place/guards/leave-place.guard.js +52 -0
  44. package/esm2015/lib/place/guards/place-route.guard.js +74 -0
  45. package/esm2015/lib/place/index.js +25 -0
  46. package/esm2015/lib/place/place-component.js +17 -0
  47. package/esm2015/lib/place/place.decorator.js +67 -0
  48. package/esm2015/lib/place/place.module.js +38 -0
  49. package/esm2015/lib/place/place.service.js +61 -0
  50. package/esm2015/lib/place/route/json-types.js +13 -0
  51. package/esm2015/lib/place/route/parameter-decorators.js +82 -0
  52. package/esm2015/lib/place/route/parameter-definition.class.js +22 -0
  53. package/esm2015/lib/place/route/parameter-sanitiser.js +17 -0
  54. package/esm2015/lib/place/route/parameter-type.js +43 -0
  55. package/esm2015/lib/place/route/route-parameter-bindings.js +282 -0
  56. package/esm2015/lib/place/route/route-parameter-sanitiser.js +148 -0
  57. package/esm2015/public_api.js +10 -0
  58. package/esm5/coolon-angular-ui-powerups.js +17 -0
  59. package/esm5/index.js +6 -0
  60. package/esm5/lib/angular-ui-powerups.module.js +52 -0
  61. package/esm5/lib/components/disposable-component.js +24 -0
  62. package/esm5/lib/components/forms/abstract-input.component.js +218 -0
  63. package/esm5/lib/components/forms/number-input/number-input.component.js +33 -0
  64. package/esm5/lib/components/forms/password-input/password-input.component.js +33 -0
  65. package/esm5/lib/components/forms/select-input/select-input.component.js +67 -0
  66. package/esm5/lib/components/forms/string-input/string-input.component.js +33 -0
  67. package/esm5/lib/components/index.js +18 -0
  68. package/esm5/lib/components/resize-aware.component.js +124 -0
  69. package/esm5/lib/components/types/bounds.class.js +59 -0
  70. package/esm5/lib/components/types/dimension.class.js +19 -0
  71. package/esm5/lib/components/types/point.class.js +43 -0
  72. package/esm5/lib/directives/command.directive.js +107 -0
  73. package/esm5/lib/directives/focus-binding.directive.js +211 -0
  74. package/esm5/lib/directives/index.js +10 -0
  75. package/esm5/lib/interaction/abstract-activity.js +173 -0
  76. package/esm5/lib/interaction/activity.js +27 -0
  77. package/esm5/lib/interaction/alert.js +23 -0
  78. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +181 -0
  79. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +22 -0
  80. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +206 -0
  81. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +42 -0
  82. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +54 -0
  83. package/esm5/lib/interaction/confirm.js +17 -0
  84. package/esm5/lib/interaction/index.js +21 -0
  85. package/esm5/lib/interaction/interaction-context.js +45 -0
  86. package/esm5/lib/interaction/interaction.module.js +45 -0
  87. package/esm5/lib/interaction/result.js +24 -0
  88. package/esm5/lib/interaction/services/dialog-interaction.service.js +138 -0
  89. package/esm5/lib/place/abstract-place-component.js +66 -0
  90. package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +49 -0
  91. package/esm5/lib/place/components/empty-state/empty-state.component.js +29 -0
  92. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +62 -0
  93. package/esm5/lib/place/guards/leave-place.guard.js +57 -0
  94. package/esm5/lib/place/guards/place-route.guard.js +78 -0
  95. package/esm5/lib/place/index.js +25 -0
  96. package/esm5/lib/place/place-component.js +17 -0
  97. package/esm5/lib/place/place.decorator.js +64 -0
  98. package/esm5/lib/place/place.module.js +42 -0
  99. package/esm5/lib/place/place.service.js +75 -0
  100. package/esm5/lib/place/route/json-types.js +13 -0
  101. package/esm5/lib/place/route/parameter-decorators.js +82 -0
  102. package/esm5/lib/place/route/parameter-definition.class.js +22 -0
  103. package/esm5/lib/place/route/parameter-sanitiser.js +17 -0
  104. package/esm5/lib/place/route/parameter-type.js +65 -0
  105. package/esm5/lib/place/route/route-parameter-bindings.js +327 -0
  106. package/esm5/lib/place/route/route-parameter-sanitiser.js +203 -0
  107. package/esm5/public_api.js +10 -0
  108. package/fesm2015/coolon-angular-ui-powerups.js +2687 -0
  109. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -0
  110. package/fesm5/coolon-angular-ui-powerups.js +3164 -0
  111. package/fesm5/coolon-angular-ui-powerups.js.map +1 -0
  112. package/index.d.ts +1 -0
  113. package/lib/angular-ui-powerups.module.d.ts +2 -0
  114. package/lib/components/disposable-component.d.ts +5 -0
  115. package/lib/components/forms/abstract-input.component.d.ts +34 -0
  116. package/lib/components/forms/number-input/number-input.component.d.ts +6 -0
  117. package/lib/components/forms/password-input/password-input.component.d.ts +6 -0
  118. package/lib/components/forms/select-input/select-input.component.d.ts +11 -0
  119. package/lib/components/forms/string-input/string-input.component.d.ts +6 -0
  120. package/lib/components/index.d.ts +13 -0
  121. package/lib/components/resize-aware.component.d.ts +22 -0
  122. package/lib/components/types/bounds.class.d.ts +16 -0
  123. package/lib/components/types/dimension.class.d.ts +5 -0
  124. package/lib/components/types/point.class.d.ts +10 -0
  125. package/lib/directives/command.directive.d.ts +11 -0
  126. package/lib/directives/focus-binding.directive.d.ts +21 -0
  127. package/lib/directives/index.d.ts +5 -0
  128. package/lib/interaction/abstract-activity.d.ts +17 -0
  129. package/lib/interaction/activity.d.ts +11 -0
  130. package/lib/interaction/alert.d.ts +5 -0
  131. package/lib/interaction/components/activity-container/activity-container.component.d.ts +32 -0
  132. package/lib/interaction/components/activity-outlet/activity-outlet-context.d.ts +10 -0
  133. package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +30 -0
  134. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +8 -0
  135. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +9 -0
  136. package/lib/interaction/confirm.d.ts +5 -0
  137. package/lib/interaction/index.d.ts +16 -0
  138. package/lib/interaction/interaction-context.d.ts +11 -0
  139. package/lib/interaction/interaction.module.d.ts +2 -0
  140. package/lib/interaction/result.d.ts +8 -0
  141. package/lib/interaction/services/dialog-interaction.service.d.ts +14 -0
  142. package/lib/place/abstract-place-component.d.ts +13 -0
  143. package/lib/place/components/busy-overlay/busy-overlay.component.d.ts +8 -0
  144. package/lib/place/components/empty-state/empty-state.component.d.ts +5 -0
  145. package/lib/place/components/place-outlet/place-outlet.component.d.ts +10 -0
  146. package/lib/place/guards/leave-place.guard.d.ts +10 -0
  147. package/lib/place/guards/place-route.guard.d.ts +9 -0
  148. package/lib/place/index.d.ts +20 -0
  149. package/lib/place/place-component.d.ts +5 -0
  150. package/lib/place/place.decorator.d.ts +18 -0
  151. package/lib/place/place.module.d.ts +2 -0
  152. package/lib/place/place.service.d.ts +8 -0
  153. package/lib/place/route/json-types.d.ts +7 -0
  154. package/lib/place/route/parameter-decorators.d.ts +9 -0
  155. package/lib/place/route/parameter-definition.class.d.ts +10 -0
  156. package/lib/place/route/parameter-sanitiser.d.ts +3 -0
  157. package/lib/place/route/parameter-type.d.ts +16 -0
  158. package/lib/place/route/route-parameter-bindings.d.ts +18 -0
  159. package/lib/place/route/route-parameter-sanitiser.d.ts +15 -0
  160. package/package.json +31 -0
  161. package/public_api.d.ts +5 -0
  162. package/schematics/collection.json +14 -0
  163. package/schematics/ng-add/index.d.ts +2 -0
  164. package/schematics/ng-add/index.js +12 -0
  165. package/schematics/ng-add/index.js.map +1 -0
  166. package/schematics/place-routes/index.d.ts +3 -0
  167. package/schematics/place-routes/index.js +92 -0
  168. package/schematics/place-routes/index.js.map +1 -0
  169. package/schematics/place-routes/place-def.d.ts +31 -0
  170. package/schematics/place-routes/place-def.js +75 -0
  171. package/schematics/place-routes/place-def.js.map +1 -0
  172. package/schematics/place-routes/scanner.d.ts +26 -0
  173. package/schematics/place-routes/scanner.js +124 -0
  174. package/schematics/place-routes/scanner.js.map +1 -0
  175. package/schematics/place-routes/schema.d.ts +7 -0
  176. package/schematics/place-routes/schema.js +3 -0
  177. package/schematics/place-routes/schema.js.map +1 -0
  178. package/schematics/place-routes/schema.json +17 -0
  179. package/schematics/place-routes/templates/apps/__project__/src/app/place-routes.ts.template +31 -0
@@ -0,0 +1,124 @@
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
+ authenticate: 'true'
41
+ }, {
42
+ position: 0,
43
+ required: true
44
+ });
45
+ }
46
+ getRouteIdParameter() {
47
+ const routeProperties = this.getDecoratedProperties('@RouteId');
48
+ if (routeProperties.length === 1) {
49
+ const route = routeProperties[0];
50
+ const routeOptions = Scanner.getOptionsArg(route.decorator, { as: 'id' }, {
51
+ position: 1,
52
+ required: false
53
+ });
54
+ return {
55
+ modelName: route.property.getName(),
56
+ parameterName: routeOptions.as
57
+ };
58
+ }
59
+ else if (routeProperties.length > 1) {
60
+ this.context.logger.error(`There an only be one @RouteId(), got ${routeProperties.length}`);
61
+ }
62
+ return null;
63
+ }
64
+ getQueryParameters() {
65
+ return this.getDecoratedProperties('@QueryParameter')
66
+ .map(p => {
67
+ const options = Scanner.getOptionsArg(p.decorator, { as: p.property.getName() }, {
68
+ position: 1,
69
+ required: false
70
+ });
71
+ return {
72
+ modelName: p.property.getName(),
73
+ parameterName: options.as
74
+ };
75
+ });
76
+ }
77
+ getDecoratedProperties(annotation) {
78
+ return this.classDecl.getProperties().map(p => {
79
+ let result = null;
80
+ p.forEachChild((child) => {
81
+ if (isDecoratorNode(child, annotation)) {
82
+ result = {
83
+ decorator: child,
84
+ property: p
85
+ };
86
+ // stop traversal
87
+ return true;
88
+ }
89
+ });
90
+ return result;
91
+ }).filter(r => !!r);
92
+ }
93
+ }
94
+ exports.Scanner = Scanner;
95
+ (function (Scanner) {
96
+ function getObjectLiteralArgument(annotation, position) {
97
+ const args = annotation.getArguments();
98
+ if (args.length > position && args[position] instanceof ts_morph_1.ObjectLiteralExpression) {
99
+ return args[position];
100
+ }
101
+ return null;
102
+ }
103
+ Scanner.getObjectLiteralArgument = getObjectLiteralArgument;
104
+ function getOptionsArg(annotation, defaults, options = {
105
+ position: 0,
106
+ required: true
107
+ }) {
108
+ const objectLiteralArgument = getObjectLiteralArgument(annotation, options.position);
109
+ if (!objectLiteralArgument) {
110
+ if (options.required) {
111
+ console.error(`expected object literal arg at position ${options.position}`, { expectedType: defaults });
112
+ }
113
+ return defaults;
114
+ }
115
+ else {
116
+ return objectLiteralArgument.getProperties().reduce((result, p) => {
117
+ const structure = p.getStructure();
118
+ return Object.assign({}, result, { [structure.name]: structure.initializer });
119
+ }, Object.assign({}, defaults));
120
+ }
121
+ }
122
+ Scanner.getOptionsArg = getOptionsArg;
123
+ })(Scanner = exports.Scanner || (exports.Scanner = {}));
124
+ //# sourceMappingURL=scanner.js.map
@@ -0,0 +1 @@
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;QACv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C,QAAQ,CAA4B,CAAC;SAClD;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IANe,gCAAwB,2BAMvC,CAAA;IAED,SAAgB,aAAa,CAAe,UAAqB,EAAE,QAAW,EAAE,UAAmD;QACjI,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,IAAI;KACf;QACC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,UAAU,EAAE,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"}
@@ -0,0 +1,7 @@
1
+ export interface Schema {
2
+ project: string;
3
+ authGuard: {
4
+ className: string;
5
+ moduleImport: string;
6
+ };
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "id": "place-routes",
4
+ "type": "object",
5
+ "properties": {
6
+ "project": {
7
+ "type": "string",
8
+ "description": "The name of the project.",
9
+ "$default": {
10
+ "$source": "projectName"
11
+ }
12
+ }
13
+ },
14
+ "required": [
15
+ "project"
16
+ ]
17
+ }
@@ -0,0 +1,31 @@
1
+ // DO NOT EDIT!!!
2
+ // This file is automatically generated using:
3
+ // ng generate @coolon/angular-ui-powerups:place-routes --project=<%=project%>
4
+ //
5
+ // Configuration file must be located in `places.json` or `places.json5` in your app root e.g. `apps/my-project`.
6
+ // {
7
+ // authGuard: {
8
+ // className: "MyApplicationAuthGuardClass",
9
+ // moduleImport: "./guards/myApplicationAuthGuardClass.ts" // a path relative to `apps/my-project/src/app/`
10
+ // }
11
+ // }
12
+
13
+ import { PlaceRouteGuard } from '@coolon/angular-ui-powerups';
14
+ import { LeavePlaceGuard } from '@coolon/angular-ui-powerups';
15
+ import { <%= config.authGuard.className %> } from '<%= config.authGuard.importPath %>';
16
+
17
+ <% placeDefs.forEach(def => { %>import {<%= def.componentClass %>} from "<%= def.importPath %>";
18
+ <% }); %>
19
+
20
+ export const routes = [<% placeDefs.forEach(def => { %>
21
+ <% if (def.routeIdentifier) { %>{
22
+ path: '<%= def.path %>',
23
+ redirectTo: '<%= def.path %>/'
24
+ },<% } %> {
25
+ path: '<%= def.fullPath %>',
26
+ component: <%= def.componentClass %>,
27
+ canActivate: [<%= def.activateGuardNames.join(", ")%>],
28
+ canDeactivate: [LeavePlaceGuard]
29
+ },
30
+ <% }) %>
31
+ ];