@coolon/angular-ui-powerups 1.15.0 → 1.16.0

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 (36) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +135 -135
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/lib/interaction/abstract-interaction-context.js +3 -2
  8. package/esm2015/lib/interaction/abstract-interaction-context.js.map +1 -1
  9. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +3 -3
  10. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
  11. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.metadata.json +1 -1
  12. package/esm2015/lib/interaction/components/input-activities/abstract-input-activity.js +1 -1
  13. package/esm2015/lib/interaction/components/input-activities/abstract-input-activity.js.map +1 -1
  14. package/esm2015/lib/interaction/components/input-activities/abstract-input-activity.metadata.json +1 -1
  15. package/esm2015/lib/interaction/interaction-context.js.map +1 -1
  16. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +1 -1
  17. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  18. package/esm5/lib/interaction/abstract-interaction-context.js +3 -2
  19. package/esm5/lib/interaction/abstract-interaction-context.js.map +1 -1
  20. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +3 -3
  21. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
  22. package/esm5/lib/interaction/components/input-activities/abstract-input-activity.js +1 -1
  23. package/esm5/lib/interaction/components/input-activities/abstract-input-activity.js.map +1 -1
  24. package/esm5/lib/interaction/interaction-context.js.map +1 -1
  25. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +1 -1
  26. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  27. package/fesm2015/coolon-angular-ui-powerups.js +131 -131
  28. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  29. package/fesm5/coolon-angular-ui-powerups.js +137 -137
  30. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  31. package/lib/interaction/abstract-interaction-context.d.ts +1 -1
  32. package/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.d.ts +1 -1
  33. package/lib/interaction/components/input-activities/abstract-input-activity.d.ts +1 -1
  34. package/lib/interaction/interaction-context.d.ts +6 -1
  35. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +1 -1
  36. package/package.json +1 -1
@@ -14,14 +14,14 @@ import { MatCheckboxModule } from '@angular/material/checkbox';
14
14
  import { MatIconModule } from '@angular/material/icon';
15
15
  import { MatTableModule } from '@angular/material/table';
16
16
  import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, FocusManager, DelegatingFormListModel, DelegatingFormValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MutableValueModel, MultipleSelectionModel, MutableListModel, Form, Deferred, Trace, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
17
- import { assert as assert$1, lang as lang$1, Opts, Klass } from '@coolon/typescript-utilities';
17
+ import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
18
18
  import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
19
19
  import ___default, { isEqual, isNil } from 'lodash';
20
20
  import produce from 'immer';
21
21
  import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
22
22
  import { fas } from '@fortawesome/free-solid-svg-icons';
23
23
  import { FlexModule, GridModule } from '@angular/flex-layout';
24
- import { MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS, MatDialogModule } from '@angular/material/dialog';
24
+ import { MatDialogModule, MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
25
25
  import { RouterModule, UrlSegment, Router, UrlSerializer, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterOutlet } from '@angular/router';
26
26
  import { Overlay, CdkScrollable } from '@angular/cdk/overlay';
27
27
  import ResizeObserver from 'resize-observer-polyfill';
@@ -2267,8 +2267,8 @@ ConfirmationDialogComponent = __decorate([
2267
2267
  ], ConfirmationDialogComponent);
2268
2268
 
2269
2269
  class AbstractInteractionContext {
2270
- startActivity(activityType, data) {
2271
- return this.createAndLaunchActivity(activityType, data, false);
2270
+ startActivity(activityType, data, options) {
2271
+ return this.createAndLaunchActivity(activityType, data, Opts.get(options).getOptional('disableClose', false));
2272
2272
  }
2273
2273
  confirm(confirm) {
2274
2274
  // Important: we have to implement confirmOrReject as the main entry point
@@ -2781,7 +2781,7 @@ let InPlaceInteractionContextComponent = class InPlaceInteractionContextComponen
2781
2781
  }
2782
2782
  get animationDuration() {
2783
2783
  var _a;
2784
- return this.animateFirstActivity ? (((_a = this.tabConfig) === null || _a === void 0 ? void 0 : _a.animationDuration) || '500ms') : "0ms";
2784
+ return this.animateFirstActivity ? (((_a = this.tabConfig) === null || _a === void 0 ? void 0 : _a.animationDuration) || '500ms') : '0ms';
2785
2785
  }
2786
2786
  ngAfterViewInit() {
2787
2787
  this.interactionService.registerInplaceInteractionContext(this);
@@ -2810,8 +2810,8 @@ let InPlaceInteractionContextComponent = class InPlaceInteractionContextComponen
2810
2810
  isActive() {
2811
2811
  return this.activityContainerComponent.isActive();
2812
2812
  }
2813
- startActivity(activityType, data) {
2814
- return this.activityContainerComponent.startActivity(activityType, data);
2813
+ startActivity(activityType, data, options) {
2814
+ return this.activityContainerComponent.startActivity(activityType, data, options);
2815
2815
  }
2816
2816
  };
2817
2817
  InPlaceInteractionContextComponent.ctorParameters = () => [
@@ -3076,130 +3076,6 @@ InteractionContextTriggerFor = __decorate([
3076
3076
  __metadata("design:paramtypes", [])
3077
3077
  ], InteractionContextTriggerFor);
3078
3078
 
3079
- let SelectInputActivity = class SelectInputActivity extends AbstractInputActivity {
3080
- constructor() {
3081
- super(...arguments);
3082
- this.defaultOptionLabelFormat = (option) => {
3083
- return this.data.optionLabel ? option[this.data.optionLabel] : option;
3084
- };
3085
- }
3086
- get optionLabelFormat() {
3087
- var _a;
3088
- return (_a = this.data.optionLabelFormat) !== null && _a !== void 0 ? _a : this.defaultOptionLabelFormat;
3089
- }
3090
- get options() {
3091
- var _a;
3092
- return ((_a = this.data.optionsModel) === null || _a === void 0 ? void 0 : _a.value) || this.data.options;
3093
- }
3094
- };
3095
- SelectInputActivity = __decorate([
3096
- Component({
3097
- selector: 'aup-select-input-activity',
3098
- template: `
3099
- <aup-select-input [valueModel]="valueModel"
3100
- [label]="data.label"
3101
- [placeholder]="data.placeholder"
3102
- [command.enter]="confirmCommand"
3103
- [command.escape]="cancelCommand"
3104
- [options]="options"
3105
- [optionLabelFormat]="optionLabelFormat"
3106
- ></aup-select-input>
3107
- <aup-activity-actions align="end"
3108
- [confirmCommand]="confirmCommand"
3109
- [cancelCommand]="cancelCommand"></aup-activity-actions>
3110
- `
3111
- })
3112
- ], SelectInputActivity);
3113
-
3114
- class DialogInteractionContext extends AbstractInteractionContext {
3115
- constructor(identifier, api, dialogService, config) {
3116
- super();
3117
- this.identifier = identifier;
3118
- this.api = api;
3119
- this.dialogService = dialogService;
3120
- this.config = config;
3121
- this.garbage = new GarbageCollector();
3122
- assert$1.notNil(dialogService);
3123
- }
3124
- cancelActiveActivity() {
3125
- return this.activityContainer.cancelActiveActivity();
3126
- }
3127
- dispose() {
3128
- if (this.isActive()) {
3129
- lang.illegalState('Dispose called while active.');
3130
- }
3131
- this.garbage.dispose();
3132
- }
3133
- registerDisposable(disposable) {
3134
- return this.garbage.registerDisposable(disposable);
3135
- }
3136
- isActive() {
3137
- return !!this.activityContainer && this.activityContainer.isActive();
3138
- }
3139
- createAndLaunchActivity(activityType, data, disableClose) {
3140
- assert$1.isNil(this._currentActivityRef);
3141
- const config = Object.assign(Object.assign({}, this.config), {
3142
- disableClose,
3143
- panelClass: 'dialog-interaction-context'
3144
- });
3145
- const self = this;
3146
- const matDialogRef = this.dialogService.open(ActivityContainerComponent, config);
3147
- const activityContainer = this.activityContainer = matDialogRef.componentInstance;
3148
- this.activityContainer.initialise(this.identifier, this.api);
3149
- const activityResult = this.activityContainer.startActivity(activityType, data);
3150
- activityResult.finally(() => matDialogRef.close());
3151
- // we need to check if our onDone/onCancel methods above we called or if we were
3152
- // closed by the user clicking the backdrop. If the later then we need to cancel our
3153
- // activity.
3154
- matDialogRef.afterClosed().subscribe(promiseAlreadyFinished => {
3155
- if (activityContainer.isActive()) {
3156
- activityContainer.cancelActiveActivity();
3157
- }
3158
- this.activityContainer = null;
3159
- });
3160
- matDialogRef.updateSize();
3161
- matDialogRef.afterOpened().subscribe(promiseAlreadyFinished => {
3162
- matDialogRef.updateSize();
3163
- });
3164
- return activityResult;
3165
- }
3166
- }
3167
-
3168
- const DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
3169
- let DialogInteractionContextFactory = class DialogInteractionContextFactory extends ModalInteractionContextFactory {
3170
- constructor(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
3171
- super();
3172
- this.dialogService = dialogService;
3173
- this.dialogServiceDefaults = dialogServiceDefaults;
3174
- this.matDialogDefaultConfig = matDialogDefaultConfig;
3175
- assert$1.notNil(dialogService);
3176
- }
3177
- createInteractionContext(identifier, api) {
3178
- const config = Object.assign(Object.assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig), this.dialogServiceDefaults);
3179
- return new DialogInteractionContext(identifier, api, this.dialogService, config);
3180
- }
3181
- };
3182
- DialogInteractionContextFactory.ctorParameters = () => [
3183
- { type: MatDialog },
3184
- { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
3185
- { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] }
3186
- ];
3187
- DialogInteractionContextFactory.ɵprov = ɵɵdefineInjectable({ factory: function DialogInteractionContextFactory_Factory() { return new DialogInteractionContextFactory(ɵɵinject(MatDialog), ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), ɵɵinject(MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionContextFactory, providedIn: "root" });
3188
- DialogInteractionContextFactory = __decorate([
3189
- Injectable({
3190
- providedIn: 'root'
3191
- }),
3192
- __param(1, Optional()), __param(1, Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS)),
3193
- __param(2, Optional()), __param(2, Inject(MAT_DIALOG_DEFAULT_OPTIONS)),
3194
- __metadata("design:paramtypes", [MatDialog,
3195
- MatDialogConfig,
3196
- MatDialogConfig])
3197
- ], DialogInteractionContextFactory);
3198
-
3199
- /**
3200
- * @file Automatically generated by barrelsby.
3201
- */
3202
-
3203
3079
  // @see https://github.com/ng-packagr/ng-packagr/issues/641 and https://github.com/angular/angular/issues/21123
3204
3080
  // we're getting a metadata error for D for no reason that I can find and only during the build (ng serve works fine)
3205
3081
  // @dynamic
@@ -3261,6 +3137,41 @@ StringInputActivity = __decorate([
3261
3137
  })
3262
3138
  ], StringInputActivity);
3263
3139
 
3140
+ let SelectInputActivity = class SelectInputActivity extends AbstractInputActivity {
3141
+ constructor() {
3142
+ super(...arguments);
3143
+ this.defaultOptionLabelFormat = (option) => {
3144
+ return this.data.optionLabel ? option[this.data.optionLabel] : option;
3145
+ };
3146
+ }
3147
+ get optionLabelFormat() {
3148
+ var _a;
3149
+ return (_a = this.data.optionLabelFormat) !== null && _a !== void 0 ? _a : this.defaultOptionLabelFormat;
3150
+ }
3151
+ get options() {
3152
+ var _a;
3153
+ return ((_a = this.data.optionsModel) === null || _a === void 0 ? void 0 : _a.value) || this.data.options;
3154
+ }
3155
+ };
3156
+ SelectInputActivity = __decorate([
3157
+ Component({
3158
+ selector: 'aup-select-input-activity',
3159
+ template: `
3160
+ <aup-select-input [valueModel]="valueModel"
3161
+ [label]="data.label"
3162
+ [placeholder]="data.placeholder"
3163
+ [command.enter]="confirmCommand"
3164
+ [command.escape]="cancelCommand"
3165
+ [options]="options"
3166
+ [optionLabelFormat]="optionLabelFormat"
3167
+ ></aup-select-input>
3168
+ <aup-activity-actions align="end"
3169
+ [confirmCommand]="confirmCommand"
3170
+ [cancelCommand]="cancelCommand"></aup-activity-actions>
3171
+ `
3172
+ })
3173
+ ], SelectInputActivity);
3174
+
3264
3175
  class Dimension {
3265
3176
  constructor(width, height) {
3266
3177
  this.width = width;
@@ -5560,6 +5471,95 @@ const slideRightOnEnterAnimation = trigger('slideRightOnEnter', [
5560
5471
  * @file Automatically generated by barrelsby.
5561
5472
  */
5562
5473
 
5474
+ /**
5475
+ * @file Automatically generated by barrelsby.
5476
+ */
5477
+
5478
+ class DialogInteractionContext extends AbstractInteractionContext {
5479
+ constructor(identifier, api, dialogService, config) {
5480
+ super();
5481
+ this.identifier = identifier;
5482
+ this.api = api;
5483
+ this.dialogService = dialogService;
5484
+ this.config = config;
5485
+ this.garbage = new GarbageCollector();
5486
+ assert$1.notNil(dialogService);
5487
+ }
5488
+ cancelActiveActivity() {
5489
+ return this.activityContainer.cancelActiveActivity();
5490
+ }
5491
+ dispose() {
5492
+ if (this.isActive()) {
5493
+ lang.illegalState('Dispose called while active.');
5494
+ }
5495
+ this.garbage.dispose();
5496
+ }
5497
+ registerDisposable(disposable) {
5498
+ return this.garbage.registerDisposable(disposable);
5499
+ }
5500
+ isActive() {
5501
+ return !!this.activityContainer && this.activityContainer.isActive();
5502
+ }
5503
+ createAndLaunchActivity(activityType, data, disableClose) {
5504
+ assert$1.isNil(this._currentActivityRef);
5505
+ const config = Object.assign(Object.assign({}, this.config), {
5506
+ disableClose,
5507
+ panelClass: 'dialog-interaction-context'
5508
+ });
5509
+ const self = this;
5510
+ const matDialogRef = this.dialogService.open(ActivityContainerComponent, config);
5511
+ const activityContainer = this.activityContainer = matDialogRef.componentInstance;
5512
+ this.activityContainer.initialise(this.identifier, this.api);
5513
+ const activityResult = this.activityContainer.startActivity(activityType, data);
5514
+ activityResult.finally(() => matDialogRef.close());
5515
+ // we need to check if our onDone/onCancel methods above we called or if we were
5516
+ // closed by the user clicking the backdrop. If the later then we need to cancel our
5517
+ // activity.
5518
+ matDialogRef.afterClosed().subscribe(promiseAlreadyFinished => {
5519
+ if (activityContainer.isActive()) {
5520
+ activityContainer.cancelActiveActivity();
5521
+ }
5522
+ this.activityContainer = null;
5523
+ });
5524
+ matDialogRef.updateSize();
5525
+ matDialogRef.afterOpened().subscribe(promiseAlreadyFinished => {
5526
+ matDialogRef.updateSize();
5527
+ });
5528
+ return activityResult;
5529
+ }
5530
+ }
5531
+
5532
+ const DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
5533
+ let DialogInteractionContextFactory = class DialogInteractionContextFactory extends ModalInteractionContextFactory {
5534
+ constructor(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
5535
+ super();
5536
+ this.dialogService = dialogService;
5537
+ this.dialogServiceDefaults = dialogServiceDefaults;
5538
+ this.matDialogDefaultConfig = matDialogDefaultConfig;
5539
+ assert$1.notNil(dialogService);
5540
+ }
5541
+ createInteractionContext(identifier, api, disableClose) {
5542
+ const config = Object.assign(Object.assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig), this.dialogServiceDefaults);
5543
+ return new DialogInteractionContext(identifier, api, this.dialogService, config);
5544
+ }
5545
+ };
5546
+ DialogInteractionContextFactory.ctorParameters = () => [
5547
+ { type: MatDialog },
5548
+ { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
5549
+ { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] }
5550
+ ];
5551
+ DialogInteractionContextFactory.ɵprov = ɵɵdefineInjectable({ factory: function DialogInteractionContextFactory_Factory() { return new DialogInteractionContextFactory(ɵɵinject(MatDialog), ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), ɵɵinject(MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionContextFactory, providedIn: "root" });
5552
+ DialogInteractionContextFactory = __decorate([
5553
+ Injectable({
5554
+ providedIn: 'root'
5555
+ }),
5556
+ __param(1, Optional()), __param(1, Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS)),
5557
+ __param(2, Optional()), __param(2, Inject(MAT_DIALOG_DEFAULT_OPTIONS)),
5558
+ __metadata("design:paramtypes", [MatDialog,
5559
+ MatDialogConfig,
5560
+ MatDialogConfig])
5561
+ ], DialogInteractionContextFactory);
5562
+
5563
5563
  /**
5564
5564
  * @file Automatically generated by barrelsby.
5565
5565
  */