@coolon/angular-ui-powerups 0.0.35 → 0.0.36

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.
@@ -1,5 +1,5 @@
1
1
  import { DOCUMENT, CommonModule } from '@angular/common';
2
- import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, ViewChild, Injector, ComponentFactoryResolver, ViewContainerRef, Injectable, ɵɵdefineInjectable, ɵɵinject, NgModule, INJECTOR } from '@angular/core';
2
+ import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, ɵɵdefineInjectable, ɵɵinject, NgModule, INJECTOR } from '@angular/core';
3
3
  import { FormsModule } from '@angular/forms';
4
4
  import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgressSpinnerModule, MatInputModule, MatFormFieldModule, MatSelectModule } from '@angular/material';
5
5
  import { BrowserModule } from '@angular/platform-browser';
@@ -683,6 +683,205 @@ if (false) {
683
683
  InteractionContext.prototype.alert = function (alert) { };
684
684
  }
685
685
 
686
+ /**
687
+ * @fileoverview added by tsickle
688
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
689
+ */
690
+ /** @type {?} */
691
+ const ACTIVITY_DATA = new InjectionToken('InteractionActivityData');
692
+ /**
693
+ * @record
694
+ * @template D, R, E
695
+ */
696
+ function Activity() { }
697
+ if (false) {
698
+ /** @type {?} */
699
+ Activity.prototype.busy;
700
+ /**
701
+ * @param {?} callback
702
+ * @return {?}
703
+ */
704
+ Activity.prototype.onDone = function (callback) { };
705
+ /**
706
+ * @param {?} callback
707
+ * @return {?}
708
+ */
709
+ Activity.prototype.onCancel = function (callback) { };
710
+ }
711
+
712
+ /**
713
+ * @fileoverview added by tsickle
714
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
715
+ */
716
+ /**
717
+ * @template D, R, E
718
+ */
719
+ class ActivityOutletComponent {
720
+ /**
721
+ * @param {?} componentFactoryResolver
722
+ * @param {?} viewContainerRef
723
+ * @param {?} injector
724
+ */
725
+ constructor(componentFactoryResolver, viewContainerRef, injector) {
726
+ this.componentFactoryResolver = componentFactoryResolver;
727
+ this.viewContainerRef = viewContainerRef;
728
+ this.injector = injector;
729
+ }
730
+ /**
731
+ * @param {?} activityContext
732
+ * @return {?}
733
+ */
734
+ set activityContext(activityContext) {
735
+ this.loadActivity(activityContext);
736
+ }
737
+ ;
738
+ /**
739
+ * @return {?}
740
+ */
741
+ ngOnInit() {
742
+ }
743
+ /**
744
+ * @param {?} activityContext
745
+ * @return {?}
746
+ */
747
+ loadActivity(activityContext) {
748
+ /** @type {?} */
749
+ const injector = Injector.create({
750
+ providers: [
751
+ {
752
+ provide: InteractionContext,
753
+ useValue: this
754
+ },
755
+ { provide: ACTIVITY_DATA, useValue: activityContext.activityData }
756
+ ],
757
+ parent: this.injector
758
+ });
759
+ /** @type {?} */
760
+ const componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityContext.activityClass);
761
+ this.viewContainerRef.clear();
762
+ this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
763
+ this.activityComponentRef.instance.onDone(activityContext.onDone);
764
+ this.activityComponentRef.instance.onCancel(activityContext.onCancel);
765
+ }
766
+ /**
767
+ * @param {?} alert
768
+ * @return {?}
769
+ */
770
+ alert(alert) {
771
+ return this.interactionContext.alert(alert);
772
+ }
773
+ /**
774
+ * @param {?} confirm
775
+ * @return {?}
776
+ */
777
+ confirm(confirm) {
778
+ return this.interactionContext.confirm(confirm);
779
+ }
780
+ /**
781
+ * @template D1, R1, E1
782
+ * @param {?} activityType
783
+ * @param {?=} data
784
+ * @return {?}
785
+ */
786
+ startActivity(activityType, data) {
787
+ return this.interactionContext.startActivity(activityType, data);
788
+ }
789
+ /**
790
+ * @return {?}
791
+ */
792
+ notifyReady() {
793
+ if (this.activityComponentRef.instance['onActivityReady']) {
794
+ this.activityComponentRef.instance['onActivityReady']();
795
+ }
796
+ }
797
+ }
798
+ ActivityOutletComponent.decorators = [
799
+ { type: Component, args: [{
800
+ selector: 'angular-ui-powerups-activity-outlet',
801
+ template: '',
802
+ styles: [":host{display:block}"]
803
+ }] }
804
+ ];
805
+ /** @nocollapse */
806
+ ActivityOutletComponent.ctorParameters = () => [
807
+ { type: ComponentFactoryResolver },
808
+ { type: ViewContainerRef },
809
+ { type: Injector }
810
+ ];
811
+ ActivityOutletComponent.propDecorators = {
812
+ interactionContext: [{ type: Input }],
813
+ activityContext: [{ type: Input }]
814
+ };
815
+ if (false) {
816
+ /** @type {?} */
817
+ ActivityOutletComponent.prototype.interactionContext;
818
+ /**
819
+ * @type {?}
820
+ * @private
821
+ */
822
+ ActivityOutletComponent.prototype.activityComponentRef;
823
+ /**
824
+ * @type {?}
825
+ * @private
826
+ */
827
+ ActivityOutletComponent.prototype.componentFactoryResolver;
828
+ /**
829
+ * @type {?}
830
+ * @private
831
+ */
832
+ ActivityOutletComponent.prototype.viewContainerRef;
833
+ /**
834
+ * @type {?}
835
+ * @private
836
+ */
837
+ ActivityOutletComponent.prototype.injector;
838
+ /* Skipping unhandled member: ;*/
839
+ }
840
+ (function (ActivityOutletComponent) {
841
+ /**
842
+ * @template D, R, E
843
+ */
844
+ class OutletInteractionContext {
845
+ /**
846
+ * @param {?} context
847
+ */
848
+ constructor(context) {
849
+ this.context = context;
850
+ }
851
+ /**
852
+ * @param {?} alert
853
+ * @return {?}
854
+ */
855
+ alert(alert) {
856
+ return lang.notImplemented();
857
+ }
858
+ /**
859
+ * @param {?} confirm
860
+ * @return {?}
861
+ */
862
+ confirm(confirm) {
863
+ return lang.notImplemented();
864
+ }
865
+ /**
866
+ * @template D1, R1, E1
867
+ * @param {?} activityType
868
+ * @param {?=} data
869
+ * @return {?}
870
+ */
871
+ startActivity(activityType, data) {
872
+ return lang.notImplemented();
873
+ }
874
+ }
875
+ ActivityOutletComponent.OutletInteractionContext = OutletInteractionContext;
876
+ if (false) {
877
+ /**
878
+ * @type {?}
879
+ * @private
880
+ */
881
+ OutletInteractionContext.prototype.context;
882
+ }
883
+ })(ActivityOutletComponent || (ActivityOutletComponent = {}));
884
+
686
885
  /**
687
886
  * @fileoverview added by tsickle
688
887
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -821,32 +1020,6 @@ if (false) {
821
1020
  AbstractActivity.prototype._busyModel;
822
1021
  }
823
1022
 
824
- /**
825
- * @fileoverview added by tsickle
826
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
827
- */
828
- /** @type {?} */
829
- const ACTIVITY_DATA = new InjectionToken('InteractionActivityData');
830
- /**
831
- * @record
832
- * @template D, R, E
833
- */
834
- function Activity() { }
835
- if (false) {
836
- /** @type {?} */
837
- Activity.prototype.busy;
838
- /**
839
- * @param {?} callback
840
- * @return {?}
841
- */
842
- Activity.prototype.onDone = function (callback) { };
843
- /**
844
- * @param {?} callback
845
- * @return {?}
846
- */
847
- Activity.prototype.onCancel = function (callback) { };
848
- }
849
-
850
1023
  /**
851
1024
  * @fileoverview added by tsickle
852
1025
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -933,7 +1106,7 @@ class ActivityContainerComponent extends DisposableComponent {
933
1106
  this.activityTabs = new MutableListModel();
934
1107
  this.obsoleteTabs = [];
935
1108
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
936
- this.lastActivityTab = chain(this.activityTabs).last();
1109
+ this.lastActivityTab = chain(this.activityTabs).last().otherwise(this.initialActivity);
937
1110
  }
938
1111
  /**
939
1112
  * @return {?}
@@ -1012,9 +1185,7 @@ class ActivityContainerComponent extends DisposableComponent {
1012
1185
  tab => {
1013
1186
  return !this.obsoleteTabs.includes(tab);
1014
1187
  }));
1015
- if (this.lastActivityTab.value && this.lastActivityTab.value['onActivityReady']) {
1016
- this.lastActivityTab.value['onActivityReady']();
1017
- }
1188
+ this.outlets.last.notifyReady();
1018
1189
  }
1019
1190
  }
1020
1191
  ActivityContainerComponent.decorators = [
@@ -1029,7 +1200,8 @@ ActivityContainerComponent.ctorParameters = () => [];
1029
1200
  ActivityContainerComponent.propDecorators = {
1030
1201
  parentInteractionContext: [{ type: Input }],
1031
1202
  initialActivity: [{ type: Input }],
1032
- tabs: [{ type: ViewChild, args: ['tabs', { static: true },] }]
1203
+ tabs: [{ type: ViewChild, args: ['tabs', { static: true },] }],
1204
+ outlets: [{ type: ViewChildren, args: [ActivityOutletComponent,] }]
1033
1205
  };
1034
1206
  if (false) {
1035
1207
  /** @type {?} */
@@ -1039,6 +1211,8 @@ if (false) {
1039
1211
  /** @type {?} */
1040
1212
  ActivityContainerComponent.prototype.tabs;
1041
1213
  /** @type {?} */
1214
+ ActivityContainerComponent.prototype.outlets;
1215
+ /** @type {?} */
1042
1216
  ActivityContainerComponent.prototype.activityTabs;
1043
1217
  /**
1044
1218
  * @type {?}
@@ -1070,171 +1244,6 @@ if (false) {
1070
1244
  }
1071
1245
  })(ActivityContainerComponent || (ActivityContainerComponent = {}));
1072
1246
 
1073
- /**
1074
- * @fileoverview added by tsickle
1075
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1076
- */
1077
- /**
1078
- * @template D, R, E
1079
- */
1080
- class ActivityOutletComponent {
1081
- /**
1082
- * @param {?} componentFactoryResolver
1083
- * @param {?} viewContainerRef
1084
- * @param {?} injector
1085
- */
1086
- constructor(componentFactoryResolver, viewContainerRef, injector) {
1087
- this.componentFactoryResolver = componentFactoryResolver;
1088
- this.viewContainerRef = viewContainerRef;
1089
- this.injector = injector;
1090
- }
1091
- /**
1092
- * @param {?} activityContext
1093
- * @return {?}
1094
- */
1095
- set activityContext(activityContext) {
1096
- this.loadActivity(activityContext);
1097
- }
1098
- ;
1099
- /**
1100
- * @return {?}
1101
- */
1102
- ngOnInit() {
1103
- }
1104
- /**
1105
- * @param {?} activityContext
1106
- * @return {?}
1107
- */
1108
- loadActivity(activityContext) {
1109
- /** @type {?} */
1110
- const injector = Injector.create({
1111
- providers: [
1112
- {
1113
- provide: InteractionContext,
1114
- useValue: this
1115
- },
1116
- { provide: ACTIVITY_DATA, useValue: activityContext.activityData }
1117
- ],
1118
- parent: this.injector
1119
- });
1120
- /** @type {?} */
1121
- const componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityContext.activityClass);
1122
- this.viewContainerRef.clear();
1123
- this.activityComponent = this.viewContainerRef.createComponent(componentFactory, 0, injector);
1124
- this.activityComponent.instance.onDone(activityContext.onDone);
1125
- this.activityComponent.instance.onCancel(activityContext.onCancel);
1126
- }
1127
- /**
1128
- * @param {?} alert
1129
- * @return {?}
1130
- */
1131
- alert(alert) {
1132
- return this.interactionContext.alert(alert);
1133
- }
1134
- /**
1135
- * @param {?} confirm
1136
- * @return {?}
1137
- */
1138
- confirm(confirm) {
1139
- return this.interactionContext.confirm(confirm);
1140
- }
1141
- /**
1142
- * @template D1, R1, E1
1143
- * @param {?} activityType
1144
- * @param {?=} data
1145
- * @return {?}
1146
- */
1147
- startActivity(activityType, data) {
1148
- return this.interactionContext.startActivity(activityType, data);
1149
- }
1150
- }
1151
- ActivityOutletComponent.decorators = [
1152
- { type: Component, args: [{
1153
- selector: 'angular-ui-powerups-activity-outlet',
1154
- template: '',
1155
- styles: [":host{display:block}"]
1156
- }] }
1157
- ];
1158
- /** @nocollapse */
1159
- ActivityOutletComponent.ctorParameters = () => [
1160
- { type: ComponentFactoryResolver },
1161
- { type: ViewContainerRef },
1162
- { type: Injector }
1163
- ];
1164
- ActivityOutletComponent.propDecorators = {
1165
- interactionContext: [{ type: Input }],
1166
- activityContext: [{ type: Input }]
1167
- };
1168
- if (false) {
1169
- /** @type {?} */
1170
- ActivityOutletComponent.prototype.interactionContext;
1171
- /**
1172
- * @type {?}
1173
- * @private
1174
- */
1175
- ActivityOutletComponent.prototype.activityComponent;
1176
- /**
1177
- * @type {?}
1178
- * @private
1179
- */
1180
- ActivityOutletComponent.prototype.componentFactoryResolver;
1181
- /**
1182
- * @type {?}
1183
- * @private
1184
- */
1185
- ActivityOutletComponent.prototype.viewContainerRef;
1186
- /**
1187
- * @type {?}
1188
- * @private
1189
- */
1190
- ActivityOutletComponent.prototype.injector;
1191
- /* Skipping unhandled member: ;*/
1192
- }
1193
- (function (ActivityOutletComponent) {
1194
- /**
1195
- * @template D, R, E
1196
- */
1197
- class OutletInteractionContext {
1198
- /**
1199
- * @param {?} context
1200
- */
1201
- constructor(context) {
1202
- this.context = context;
1203
- }
1204
- /**
1205
- * @param {?} alert
1206
- * @return {?}
1207
- */
1208
- alert(alert) {
1209
- return lang.notImplemented();
1210
- }
1211
- /**
1212
- * @param {?} confirm
1213
- * @return {?}
1214
- */
1215
- confirm(confirm) {
1216
- return lang.notImplemented();
1217
- }
1218
- /**
1219
- * @template D1, R1, E1
1220
- * @param {?} activityType
1221
- * @param {?=} data
1222
- * @return {?}
1223
- */
1224
- startActivity(activityType, data) {
1225
- return lang.notImplemented();
1226
- }
1227
- }
1228
- ActivityOutletComponent.OutletInteractionContext = OutletInteractionContext;
1229
- if (false) {
1230
- /**
1231
- * @type {?}
1232
- * @private
1233
- */
1234
- OutletInteractionContext.prototype.context;
1235
- }
1236
- })(ActivityOutletComponent || (ActivityOutletComponent = {}));
1237
-
1238
1247
  /**
1239
1248
  * @fileoverview added by tsickle
1240
1249
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -3288,5 +3297,5 @@ class VisitSnapshot {
3288
3297
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3289
3298
  */
3290
3299
 
3291
- export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, NumberInputComponent, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, ResizeAwareComponent, ResolvedRouteParameterSnapshot, RouteId, RouteParameter, RouteParameterBindings, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, VisitSnapshot, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, LEFT_RIGHT_PLACE_ANIMATION as ɵm, PlaceService as ɵn, TabbedPlaceNavigationComponent as ɵo, InteractionModule as ɵp, ActivityContainerComponent as ɵq, ConfirmationDialogComponent as ɵr, AbstractActivity as ɵs, ACTIVITY_DATA as ɵt, AlertDialogComponent as ɵv, ActivityOutletComponent as ɵx, DialogInteractionService as ɵy, InteractionContext as ɵz };
3300
+ export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, NumberInputComponent, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, ResizeAwareComponent, ResolvedRouteParameterSnapshot, RouteId, RouteParameter, RouteParameterBindings, RouteParameterList, RouteParameterSanitiser, Sanitiser, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, VisitSnapshot, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, LEFT_RIGHT_PLACE_ANIMATION as ɵm, PlaceService as ɵn, TabbedPlaceNavigationComponent as ɵo, InteractionModule as ɵp, ActivityContainerComponent as ɵq, ActivityOutletComponent as ɵr, ConfirmationDialogComponent as ɵs, AbstractActivity as ɵt, ACTIVITY_DATA as ɵu, AlertDialogComponent as ɵw, DialogInteractionService as ɵy, InteractionContext as ɵz };
3292
3301
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map