@coolon/angular-ui-powerups 1.8.0 → 1.9.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 (63) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +350 -231
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.d.ts +4 -0
  7. package/coolon-angular-ui-powerups.metadata.json +1 -1
  8. package/esm2015/coolon-angular-ui-powerups.js +4 -0
  9. package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
  10. package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
  11. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  12. package/esm2015/lib/components/forms/text-input/text-input.component.js +1 -1
  13. package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
  14. package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
  15. package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js +51 -0
  16. package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -0
  17. package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json +1 -0
  18. package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.ngfactory.js.map +1 -0
  19. package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.scss.shim.ngstyle.js.map +1 -0
  20. package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js +69 -0
  21. package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js.map +1 -0
  22. package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.metadata.json +1 -0
  23. package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.ngfactory.js.map +1 -0
  24. package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  25. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
  26. package/esm2015/lib/interaction/index.js +2 -0
  27. package/esm2015/lib/interaction/index.js.map +1 -1
  28. package/esm2015/lib/interaction/index.metadata.json +1 -1
  29. package/esm2015/lib/interaction/interaction.module.js +13 -3
  30. package/esm2015/lib/interaction/interaction.module.js.map +1 -1
  31. package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
  32. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  33. package/esm2015/lib/interaction/services/interaction.service.js +0 -15
  34. package/esm2015/lib/interaction/services/interaction.service.js.map +1 -1
  35. package/esm5/coolon-angular-ui-powerups.js +4 -0
  36. package/esm5/coolon-angular-ui-powerups.js.map +1 -1
  37. package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  38. package/esm5/lib/components/forms/text-input/text-input.component.js +1 -1
  39. package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
  40. package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js +58 -0
  41. package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -0
  42. package/esm5/lib/interaction/components/activity-actions/activity-actions.component.ngfactory.js.map +1 -0
  43. package/esm5/lib/interaction/components/activity-actions/activity-actions.component.scss.shim.ngstyle.js.map +1 -0
  44. package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js +76 -0
  45. package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js.map +1 -0
  46. package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.ngfactory.js.map +1 -0
  47. package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  48. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
  49. package/esm5/lib/interaction/index.js +2 -0
  50. package/esm5/lib/interaction/index.js.map +1 -1
  51. package/esm5/lib/interaction/interaction.module.js +13 -3
  52. package/esm5/lib/interaction/interaction.module.js.map +1 -1
  53. package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  54. package/esm5/lib/interaction/services/interaction.service.js +0 -15
  55. package/esm5/lib/interaction/services/interaction.service.js.map +1 -1
  56. package/fesm2015/coolon-angular-ui-powerups.js +303 -204
  57. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  58. package/fesm5/coolon-angular-ui-powerups.js +346 -233
  59. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  60. package/lib/interaction/components/activity-actions/activity-actions.component.d.ts +12 -0
  61. package/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.d.ts +17 -0
  62. package/lib/interaction/index.d.ts +2 -0
  63. package/package.json +1 -1
@@ -10,12 +10,13 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
10
10
  import { MatButtonModule } from '@angular/material/button';
11
11
  import { MatCheckboxModule } from '@angular/material/checkbox';
12
12
  import { MatIconModule } from '@angular/material/icon';
13
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, Command, FocusManager, DelegatingFormValueModel, TrackExternal, ListModel, StoreInListModel, ValueModel, StoreInValueModel, Deferred, Trace, MutableListModel, MutableValueModel, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
13
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, Command, FocusManager, DelegatingFormValueModel, TrackExternal, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MutableValueModel, Deferred, Trace, MutableListModel, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
14
14
  import { PortalModule } from '@angular/cdk/portal';
15
- import { MatDialogModule, MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
15
+ import { MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS, MatDialogModule } from '@angular/material/dialog';
16
16
  import { RouterModule, UrlSegment, Router, UrlSerializer, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterOutlet } from '@angular/router';
17
- import { assert as assert$1, lang as lang$1, Opts, Klass } from '@coolon/typescript-utilities';
18
17
  import ___default, { isEqual, isNil } from 'lodash';
18
+ import ResizeObserver from 'resize-observer-polyfill';
19
+ import { assert as assert$1, lang as lang$1, Opts, Klass } from '@coolon/typescript-utilities';
19
20
  import { FlexModule } from '@angular/flex-layout';
20
21
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
21
22
  import { MatListModule } from '@angular/material/list';
@@ -24,7 +25,6 @@ import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
24
25
  import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
25
26
  import 'reflect-metadata';
26
27
  import { style, query, group, animate, trigger, transition } from '@angular/animations';
27
- import ResizeObserver from 'resize-observer-polyfill';
28
28
  import { Observable } from 'rxjs';
29
29
 
30
30
  let CommandDirective = class CommandDirective extends GarbageCollector {
@@ -749,7 +749,7 @@ __decorate([
749
749
  TextInputComponent = __decorate([
750
750
  Component({
751
751
  selector: 'aup-text-input',
752
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"delegatingFormValueModel.focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
752
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"delegatingFormValueModel.focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
753
753
  styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}button[disabled]{visibility:hidden}textarea{overflow:auto}"]
754
754
  }),
755
755
  __metadata("design:paramtypes", [])
@@ -1082,6 +1082,142 @@ ComponentsModule = __decorate([
1082
1082
  })
1083
1083
  ], ComponentsModule);
1084
1084
 
1085
+ class Dimension {
1086
+ constructor(width, height) {
1087
+ this.width = width;
1088
+ this.height = height;
1089
+ }
1090
+ }
1091
+
1092
+ class Point {
1093
+ constructor(x, y) {
1094
+ this.x = x;
1095
+ this.y = y;
1096
+ }
1097
+ static from(data) {
1098
+ return new Point(data.x, data.y);
1099
+ }
1100
+ translate(x, y) {
1101
+ return new Point(this.x + x, this.y + y);
1102
+ }
1103
+ }
1104
+
1105
+ class Bounds extends Dimension {
1106
+ constructor(top, left, width, height) {
1107
+ super(width, height);
1108
+ this.top = top;
1109
+ this.left = left;
1110
+ this.width = width;
1111
+ this.height = height;
1112
+ }
1113
+ relativePositionOf(point) {
1114
+ if (point instanceof MouseEvent) {
1115
+ return new Point(point.clientX - this.left, point.clientY - this.top);
1116
+ }
1117
+ else {
1118
+ return new Point(point.x - this.left, point.y - this.top);
1119
+ }
1120
+ }
1121
+ }
1122
+ (function (Bounds) {
1123
+ function ofElement(element) {
1124
+ const rect = element.getBoundingClientRect();
1125
+ return new Bounds(rect.top, rect.left, rect.width, rect.height);
1126
+ }
1127
+ Bounds.ofElement = ofElement;
1128
+ })(Bounds || (Bounds = {}));
1129
+
1130
+ let ResizeAwareComponent = class ResizeAwareComponent extends DisposableComponent {
1131
+ constructor(elementRef, ngZone) {
1132
+ super();
1133
+ this.elementRef = elementRef;
1134
+ this.ngZone = ngZone;
1135
+ this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
1136
+ }
1137
+ ngAfterViewInit() {
1138
+ this.updateBounds();
1139
+ const element = this.elementRef.nativeElement;
1140
+ const ro = new ResizeObserver((entries, observer) => {
1141
+ this.ngZone.run(() => this.updateBounds());
1142
+ });
1143
+ ro.observe(element);
1144
+ this.onDispose(() => ro.disconnect());
1145
+ }
1146
+ get boundsModel() {
1147
+ return this._boundsModel.readonly;
1148
+ }
1149
+ get nativeElement() {
1150
+ return this.elementRef.nativeElement;
1151
+ }
1152
+ // TODO: Make this handle body scroll
1153
+ relativePositionOf(point) {
1154
+ return this.bounds.relativePositionOf(point);
1155
+ }
1156
+ get bounds() {
1157
+ return this._boundsModel.value;
1158
+ }
1159
+ updateBounds() {
1160
+ this._boundsModel.value = Bounds.ofElement(this.nativeElement);
1161
+ }
1162
+ };
1163
+ ResizeAwareComponent.ctorParameters = () => [
1164
+ { type: ElementRef },
1165
+ { type: NgZone }
1166
+ ];
1167
+ ResizeAwareComponent = __decorate([
1168
+ Directive(),
1169
+ __metadata("design:paramtypes", [ElementRef, NgZone])
1170
+ ], ResizeAwareComponent);
1171
+
1172
+ /**
1173
+ * @file Automatically generated by barrelsby.
1174
+ */
1175
+
1176
+ let ActivityActionsComponent = class ActivityActionsComponent extends DisposableComponent {
1177
+ constructor() {
1178
+ super(...arguments);
1179
+ this.align = 'start';
1180
+ }
1181
+ get alignEnd() {
1182
+ return this.align === 'end';
1183
+ }
1184
+ ngOnInit() {
1185
+ }
1186
+ hasConfirmText() {
1187
+ return !___default.isEmpty(this.confirmText);
1188
+ }
1189
+ };
1190
+ __decorate([
1191
+ Input(),
1192
+ TrackExternal(),
1193
+ __metadata("design:type", Command)
1194
+ ], ActivityActionsComponent.prototype, "confirmCommand", void 0);
1195
+ __decorate([
1196
+ Input(),
1197
+ __metadata("design:type", String)
1198
+ ], ActivityActionsComponent.prototype, "confirmText", void 0);
1199
+ __decorate([
1200
+ Input(),
1201
+ TrackExternal(),
1202
+ __metadata("design:type", Command)
1203
+ ], ActivityActionsComponent.prototype, "cancelCommand", void 0);
1204
+ __decorate([
1205
+ Input(),
1206
+ __metadata("design:type", String)
1207
+ ], ActivityActionsComponent.prototype, "align", void 0);
1208
+ __decorate([
1209
+ HostBinding('class.align-end'),
1210
+ __metadata("design:type", Boolean),
1211
+ __metadata("design:paramtypes", [])
1212
+ ], ActivityActionsComponent.prototype, "alignEnd", null);
1213
+ ActivityActionsComponent = __decorate([
1214
+ Component({
1215
+ selector: 'aup-activity-actions',
1216
+ template: "<button mat-icon-button [pectinCommand]=\"cancelCommand\"><mat-icon>clear</mat-icon></button>\n<button *ngIf=\"!hasConfirmText()\" mat-icon-button [pectinCommand]=\"confirmCommand\"><mat-icon>done</mat-icon></button>\n<button *ngIf=\"hasConfirmText()\" mat-button [pectinCommand]=\"confirmCommand\">{{confirmText}}</button>\n",
1217
+ styles: [":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start}:host.align-end{justify-content:flex-end}"]
1218
+ })
1219
+ ], ActivityActionsComponent);
1220
+
1085
1221
  const ACTIVITY_DATA = new InjectionToken('InteractionActivityData');
1086
1222
  class Activity extends DisposableComponent {
1087
1223
  constructor() {
@@ -1598,21 +1734,6 @@ let InteractionService = InteractionService_1 = class InteractionService {
1598
1734
  // Todo: allow multiple inplace interactions..
1599
1735
  interactionContext.initialise(`ip${++inplaceMonitorCount}`, new InteractionService_1.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));
1600
1736
  }
1601
- // private assertModalCanStart() {
1602
- // assert.isFalsey(this.inExclusiveInteraction.value);
1603
- // assert.isFalsey(this.modalActive.value);
1604
- // }
1605
- //
1606
- // private assertInPlaceCanStart() {
1607
- // assert.isFalsey(this.inExclusiveInteraction.value);
1608
- // assert.isFalsey(this.modalActive.value);
1609
- // assert.isFalsey(this._activeInlineContext.value);
1610
- // }
1611
- // // @Trace()
1612
- // getActiveContext(): InteractionContext {
1613
- // assert.isTruthy(this.isActive());
1614
- // return this._activeContext.value;
1615
- // }
1616
1737
  /**
1617
1738
  * Creates an interaction context that will prevent any other contexts from starting an
1618
1739
  * activity until it is disposed. This is intended for use by the router for passing
@@ -1771,6 +1892,158 @@ InPlaceInteractionContextComponent = __decorate([
1771
1892
  __metadata("design:paramtypes", [InteractionService, Object])
1772
1893
  ], InPlaceInteractionContextComponent);
1773
1894
 
1895
+ class DialogInteractionContext extends AbstractInteractionContext {
1896
+ constructor(identifier, api, dialogService, config) {
1897
+ super();
1898
+ this.identifier = identifier;
1899
+ this.api = api;
1900
+ this.dialogService = dialogService;
1901
+ this.config = config;
1902
+ this.garbage = new GarbageCollector();
1903
+ assert$1.notNil(dialogService);
1904
+ }
1905
+ cancelActiveActivity() {
1906
+ return this.activityContainer.cancelActiveActivity();
1907
+ }
1908
+ dispose() {
1909
+ if (this.isActive()) {
1910
+ lang.illegalState('Dispose called while active.');
1911
+ }
1912
+ this.garbage.dispose();
1913
+ }
1914
+ registerDisposable(disposable) {
1915
+ return this.garbage.registerDisposable(disposable);
1916
+ }
1917
+ isActive() {
1918
+ return !!this.activityContainer && this.activityContainer.isActive();
1919
+ }
1920
+ createAndLaunchActivity(activityType, data, disableClose) {
1921
+ assert$1.isNil(this._currentActivityRef);
1922
+ const config = Object.assign(Object.assign({}, this.config), {
1923
+ disableClose,
1924
+ panelClass: 'dialog-interaction-context'
1925
+ });
1926
+ const self = this;
1927
+ const matDialogRef = this.dialogService.open(ActivityContainerComponent, config);
1928
+ const activityContainer = this.activityContainer = matDialogRef.componentInstance;
1929
+ this.activityContainer.initialise(this.identifier, this.api);
1930
+ const activityResult = this.activityContainer.startActivity(activityType, data);
1931
+ activityResult.finally(() => matDialogRef.close());
1932
+ // we need to check if our onDone/onCancel methods above we called or if we were
1933
+ // closed by the user clicking the backdrop. If the later then we need to cancel our
1934
+ // activity.
1935
+ matDialogRef.afterClosed().subscribe(promiseAlreadyFinished => {
1936
+ if (activityContainer.isActive()) {
1937
+ activityContainer.cancelActiveActivity();
1938
+ }
1939
+ this.activityContainer = null;
1940
+ });
1941
+ matDialogRef.updateSize();
1942
+ matDialogRef.afterOpened().subscribe(promiseAlreadyFinished => {
1943
+ matDialogRef.updateSize();
1944
+ });
1945
+ return activityResult;
1946
+ }
1947
+ }
1948
+
1949
+ const DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
1950
+ let DialogInteractionContextFactory = class DialogInteractionContextFactory extends ModalInteractionContextFactory {
1951
+ constructor(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
1952
+ super();
1953
+ this.dialogService = dialogService;
1954
+ this.dialogServiceDefaults = dialogServiceDefaults;
1955
+ this.matDialogDefaultConfig = matDialogDefaultConfig;
1956
+ assert$1.notNil(dialogService);
1957
+ }
1958
+ createInteractionContext(identifier, api) {
1959
+ const config = Object.assign(Object.assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig), this.dialogServiceDefaults);
1960
+ return new DialogInteractionContext(identifier, api, this.dialogService, config);
1961
+ }
1962
+ };
1963
+ DialogInteractionContextFactory.ctorParameters = () => [
1964
+ { type: MatDialog },
1965
+ { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
1966
+ { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] }
1967
+ ];
1968
+ 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" });
1969
+ DialogInteractionContextFactory = __decorate([
1970
+ Injectable({
1971
+ providedIn: 'root'
1972
+ }),
1973
+ __param(1, Optional()), __param(1, Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS)),
1974
+ __param(2, Optional()), __param(2, Inject(MAT_DIALOG_DEFAULT_OPTIONS)),
1975
+ __metadata("design:paramtypes", [MatDialog,
1976
+ MatDialogConfig,
1977
+ MatDialogConfig])
1978
+ ], DialogInteractionContextFactory);
1979
+
1980
+ /**
1981
+ * @file Automatically generated by barrelsby.
1982
+ */
1983
+
1984
+ let AddItemInteractionContextComponent = class AddItemInteractionContextComponent extends DisposableComponent {
1985
+ constructor() {
1986
+ super();
1987
+ this.tabindex = 0;
1988
+ this.clickCommand = Command.create((context) => {
1989
+ if (this.activityClass) {
1990
+ this.startActivity(this.activityClass, this.activityData).catch(e => {
1991
+ // don't care.
1992
+ });
1993
+ }
1994
+ else {
1995
+ this.addCommand.withContext(context).execute();
1996
+ }
1997
+ });
1998
+ }
1999
+ get active() {
2000
+ return this.interactionContext ? this.interactionContext.isActive() : false;
2001
+ }
2002
+ startActivity(activityType, data) {
2003
+ return this.interactionContext.startActivity(activityType, data);
2004
+ }
2005
+ ngOnInit() {
2006
+ }
2007
+ };
2008
+ __decorate([
2009
+ Input(),
2010
+ __metadata("design:type", String)
2011
+ ], AddItemInteractionContextComponent.prototype, "label", void 0);
2012
+ __decorate([
2013
+ Input(),
2014
+ __metadata("design:type", Object)
2015
+ ], AddItemInteractionContextComponent.prototype, "activityClass", void 0);
2016
+ __decorate([
2017
+ Input(),
2018
+ __metadata("design:type", Object)
2019
+ ], AddItemInteractionContextComponent.prototype, "activityData", void 0);
2020
+ __decorate([
2021
+ Input(),
2022
+ TrackExternal(),
2023
+ __metadata("design:type", Command)
2024
+ ], AddItemInteractionContextComponent.prototype, "addCommand", void 0);
2025
+ __decorate([
2026
+ ViewChild(InPlaceInteractionContextComponent),
2027
+ __metadata("design:type", InPlaceInteractionContextComponent)
2028
+ ], AddItemInteractionContextComponent.prototype, "interactionContext", void 0);
2029
+ __decorate([
2030
+ HostBinding('class.interaction-active'),
2031
+ __metadata("design:type", Boolean),
2032
+ __metadata("design:paramtypes", [])
2033
+ ], AddItemInteractionContextComponent.prototype, "active", null);
2034
+ __decorate([
2035
+ HostBinding('tabindex'),
2036
+ __metadata("design:type", Object)
2037
+ ], AddItemInteractionContextComponent.prototype, "tabindex", void 0);
2038
+ AddItemInteractionContextComponent = __decorate([
2039
+ Component({
2040
+ selector: 'aup-add-item-interaction-context',
2041
+ template: "<aup-in-place-interaction-context #interactionContext [animateFirstActivity]=\"false\">\n <a part=\"link\" class=\"link\" [pectinCommand]=\"clickCommand\"><mat-icon>add</mat-icon> {{label}}</a>\n</aup-in-place-interaction-context>\n",
2042
+ styles: [":host{--def-link-color:var(--link-color, currentColor);--def-link-backgound:var(--link-background, rgba(0, 0, 0, 0.05));--def-link-border-radius:var(--link-border-radius, 4px);--def-link-padding:var(--link-padding, calc(var(--aup-default-padding) / 2));display:flex;flex-direction:column;border-radius:var(--def-link-border-radius);box-sizing:border-box;outline:0}:host:hover{--link-background:rgba(0,0,0,0.1)}aup-in-place-interaction-context{border-radius:var(--def-link-border-radius)}a.link{display:flex;flex-direction:row;align-items:center;border-radius:var(--def-link-border-radius);color:var(--def-link-color);background:var(--def-link-backgound);padding:var(--def-link-padding);cursor:pointer;text-decoration:none}a.link mat-icon{margin-right:8px}"]
2043
+ }),
2044
+ __metadata("design:paramtypes", [])
2045
+ ], AddItemInteractionContextComponent);
2046
+
1774
2047
  let InteractionModule = class InteractionModule {
1775
2048
  };
1776
2049
  InteractionModule = __decorate([
@@ -1781,7 +2054,9 @@ InteractionModule = __decorate([
1781
2054
  MatDialogModule,
1782
2055
  MatTabsModule,
1783
2056
  PortalModule,
1784
- RouterModule
2057
+ RouterModule,
2058
+ MatIconModule,
2059
+ DirectivesModule
1785
2060
  ],
1786
2061
  declarations: [
1787
2062
  ActivityContainerComponent,
@@ -1789,12 +2064,16 @@ InteractionModule = __decorate([
1789
2064
  ConfirmThenDialogComponent,
1790
2065
  AlertDialogComponent,
1791
2066
  ActivityOutletComponent,
1792
- InPlaceInteractionContextComponent
2067
+ InPlaceInteractionContextComponent,
2068
+ AddItemInteractionContextComponent,
2069
+ ActivityActionsComponent
1793
2070
  ],
1794
2071
  exports: [
1795
2072
  ActivityContainerComponent,
1796
2073
  ActivityOutletComponent,
1797
- InPlaceInteractionContextComponent
2074
+ InPlaceInteractionContextComponent,
2075
+ AddItemInteractionContextComponent,
2076
+ ActivityActionsComponent
1798
2077
  ],
1799
2078
  entryComponents: [
1800
2079
  ActivityContainerComponent,
@@ -3957,186 +4236,6 @@ const slideRightOnEnterAnimation = trigger('slideRightOnEnter', [
3957
4236
  * @file Automatically generated by barrelsby.
3958
4237
  */
3959
4238
 
3960
- class Dimension {
3961
- constructor(width, height) {
3962
- this.width = width;
3963
- this.height = height;
3964
- }
3965
- }
3966
-
3967
- class Point {
3968
- constructor(x, y) {
3969
- this.x = x;
3970
- this.y = y;
3971
- }
3972
- static from(data) {
3973
- return new Point(data.x, data.y);
3974
- }
3975
- translate(x, y) {
3976
- return new Point(this.x + x, this.y + y);
3977
- }
3978
- }
3979
-
3980
- class Bounds extends Dimension {
3981
- constructor(top, left, width, height) {
3982
- super(width, height);
3983
- this.top = top;
3984
- this.left = left;
3985
- this.width = width;
3986
- this.height = height;
3987
- }
3988
- relativePositionOf(point) {
3989
- if (point instanceof MouseEvent) {
3990
- return new Point(point.clientX - this.left, point.clientY - this.top);
3991
- }
3992
- else {
3993
- return new Point(point.x - this.left, point.y - this.top);
3994
- }
3995
- }
3996
- }
3997
- (function (Bounds) {
3998
- function ofElement(element) {
3999
- const rect = element.getBoundingClientRect();
4000
- return new Bounds(rect.top, rect.left, rect.width, rect.height);
4001
- }
4002
- Bounds.ofElement = ofElement;
4003
- })(Bounds || (Bounds = {}));
4004
-
4005
- let ResizeAwareComponent = class ResizeAwareComponent extends DisposableComponent {
4006
- constructor(elementRef, ngZone) {
4007
- super();
4008
- this.elementRef = elementRef;
4009
- this.ngZone = ngZone;
4010
- this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
4011
- }
4012
- ngAfterViewInit() {
4013
- this.updateBounds();
4014
- const element = this.elementRef.nativeElement;
4015
- const ro = new ResizeObserver((entries, observer) => {
4016
- this.ngZone.run(() => this.updateBounds());
4017
- });
4018
- ro.observe(element);
4019
- this.onDispose(() => ro.disconnect());
4020
- }
4021
- get boundsModel() {
4022
- return this._boundsModel.readonly;
4023
- }
4024
- get nativeElement() {
4025
- return this.elementRef.nativeElement;
4026
- }
4027
- // TODO: Make this handle body scroll
4028
- relativePositionOf(point) {
4029
- return this.bounds.relativePositionOf(point);
4030
- }
4031
- get bounds() {
4032
- return this._boundsModel.value;
4033
- }
4034
- updateBounds() {
4035
- this._boundsModel.value = Bounds.ofElement(this.nativeElement);
4036
- }
4037
- };
4038
- ResizeAwareComponent.ctorParameters = () => [
4039
- { type: ElementRef },
4040
- { type: NgZone }
4041
- ];
4042
- ResizeAwareComponent = __decorate([
4043
- Directive(),
4044
- __metadata("design:paramtypes", [ElementRef, NgZone])
4045
- ], ResizeAwareComponent);
4046
-
4047
- /**
4048
- * @file Automatically generated by barrelsby.
4049
- */
4050
-
4051
- /**
4052
- * @file Automatically generated by barrelsby.
4053
- */
4054
-
4055
- class DialogInteractionContext extends AbstractInteractionContext {
4056
- constructor(identifier, api, dialogService, config) {
4057
- super();
4058
- this.identifier = identifier;
4059
- this.api = api;
4060
- this.dialogService = dialogService;
4061
- this.config = config;
4062
- this.garbage = new GarbageCollector();
4063
- assert$1.notNil(dialogService);
4064
- }
4065
- cancelActiveActivity() {
4066
- return this.activityContainer.cancelActiveActivity();
4067
- }
4068
- dispose() {
4069
- if (this.isActive()) {
4070
- lang.illegalState('Dispose called while active.');
4071
- }
4072
- this.garbage.dispose();
4073
- }
4074
- registerDisposable(disposable) {
4075
- return this.garbage.registerDisposable(disposable);
4076
- }
4077
- isActive() {
4078
- return !!this.activityContainer && this.activityContainer.isActive();
4079
- }
4080
- createAndLaunchActivity(activityType, data, disableClose) {
4081
- assert$1.isNil(this._currentActivityRef);
4082
- const config = Object.assign(Object.assign({}, this.config), {
4083
- disableClose,
4084
- panelClass: 'dialog-interaction-context'
4085
- });
4086
- const self = this;
4087
- const matDialogRef = this.dialogService.open(ActivityContainerComponent, config);
4088
- const activityContainer = this.activityContainer = matDialogRef.componentInstance;
4089
- this.activityContainer.initialise(this.identifier, this.api);
4090
- const activityResult = this.activityContainer.startActivity(activityType, data);
4091
- activityResult.finally(() => matDialogRef.close());
4092
- // we need to check if our onDone/onCancel methods above we called or if we were
4093
- // closed by the user clicking the backdrop. If the later then we need to cancel our
4094
- // activity.
4095
- matDialogRef.afterClosed().subscribe(promiseAlreadyFinished => {
4096
- if (activityContainer.isActive()) {
4097
- activityContainer.cancelActiveActivity();
4098
- }
4099
- this.activityContainer = null;
4100
- });
4101
- matDialogRef.updateSize();
4102
- matDialogRef.afterOpened().subscribe(promiseAlreadyFinished => {
4103
- matDialogRef.updateSize();
4104
- });
4105
- return activityResult;
4106
- }
4107
- }
4108
-
4109
- const DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
4110
- let DialogInteractionContextFactory = class DialogInteractionContextFactory extends ModalInteractionContextFactory {
4111
- constructor(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
4112
- super();
4113
- this.dialogService = dialogService;
4114
- this.dialogServiceDefaults = dialogServiceDefaults;
4115
- this.matDialogDefaultConfig = matDialogDefaultConfig;
4116
- assert$1.notNil(dialogService);
4117
- }
4118
- createInteractionContext(identifier, api) {
4119
- const config = Object.assign(Object.assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig), this.dialogServiceDefaults);
4120
- return new DialogInteractionContext(identifier, api, this.dialogService, config);
4121
- }
4122
- };
4123
- DialogInteractionContextFactory.ctorParameters = () => [
4124
- { type: MatDialog },
4125
- { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
4126
- { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] }
4127
- ];
4128
- 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" });
4129
- DialogInteractionContextFactory = __decorate([
4130
- Injectable({
4131
- providedIn: 'root'
4132
- }),
4133
- __param(1, Optional()), __param(1, Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS)),
4134
- __param(2, Optional()), __param(2, Inject(MAT_DIALOG_DEFAULT_OPTIONS)),
4135
- __metadata("design:paramtypes", [MatDialog,
4136
- MatDialogConfig,
4137
- MatDialogConfig])
4138
- ], DialogInteractionContextFactory);
4139
-
4140
4239
  /**
4141
4240
  * @file Automatically generated by barrelsby.
4142
4241
  */
@@ -4461,5 +4560,5 @@ function VisitParameterList(options) {
4461
4560
  * Generated bundle index. Do not edit.
4462
4561
  */
4463
4562
 
4464
- export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CardContainerComponent, CheckboxInputComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, InPlaceInteractionContextComponent, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ModalInteractionContextFactory, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SelectInputComponent, SidePlaceNavigationComponent, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, PlaceOutletComponent as ɵba, leftRightPlaceAnimation as ɵbb, LEFT_RIGHT_PLACE_ANIMATION as ɵbc, AUP_PLACE_CONFIG as ɵbd, PlaceRouter as ɵbf, InteractionService as ɵbg, ModalInteractionContextFactory as ɵbh, UrlService as ɵbi, PlaceHistory as ɵbj, TabbedPlaceNavigationComponent as ɵbk, AbstractPlaceNavigationComponent as ɵbl, ListPlaceNavComponent as ɵbm, SidePlaceNavigationComponent as ɵbn, InteractionModule as ɵbo, ActivityContainerComponent as ɵbp, AbstractInteractionContext as ɵbq, ActivityOutletComponent as ɵbr, ConfirmationDialogComponent as ɵbs, ACTIVITY_DATA as ɵbt, Activity as ɵbu, ConfirmThenDialogComponent as ɵbw, AlertDialogComponent as ɵbx, InPlaceInteractionContextComponent as ɵbz, FocusBindingDirective as ɵc, DisposableComponent as ɵd, FocusBindingFactory as ɵe, ComponentsModule as ɵf, NumberInputComponent as ɵg, AbstractInputComponent as ɵh, StringInputComponent as ɵi, TextInputComponent as ɵj, PasswordInputComponent as ɵk, SelectInputComponent as ɵl, CheckboxInputComponent as ɵm, ScrollContainerComponent as ɵn, NoopComponent as ɵo, SwitchCaseOption as ɵp, SwitchCaseWhenDirective as ɵq, SwitchCaseDefaultDirective as ɵr, SwitchCaseComponent as ɵs, FocusContainerComponent as ɵt, VerticalFocusContainerComponent as ɵu, FocusableComponent as ɵv, CardContainerComponent as ɵw, PlaceModule as ɵx, EmptyStateComponent as ɵy, BusyOverlayComponent as ɵz };
4563
+ export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CardContainerComponent, CheckboxInputComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, InPlaceInteractionContextComponent, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ModalInteractionContextFactory, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SelectInputComponent, SidePlaceNavigationComponent, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, PlaceOutletComponent as ɵba, leftRightPlaceAnimation as ɵbb, LEFT_RIGHT_PLACE_ANIMATION as ɵbc, AUP_PLACE_CONFIG as ɵbd, PlaceRouter as ɵbf, InteractionService as ɵbg, ModalInteractionContextFactory as ɵbh, UrlService as ɵbi, PlaceHistory as ɵbj, TabbedPlaceNavigationComponent as ɵbk, AbstractPlaceNavigationComponent as ɵbl, ListPlaceNavComponent as ɵbm, SidePlaceNavigationComponent as ɵbn, InteractionModule as ɵbo, ActivityContainerComponent as ɵbp, AbstractInteractionContext as ɵbq, ActivityOutletComponent as ɵbr, ConfirmationDialogComponent as ɵbs, ACTIVITY_DATA as ɵbt, Activity as ɵbu, ConfirmThenDialogComponent as ɵbw, AlertDialogComponent as ɵbx, InPlaceInteractionContextComponent as ɵbz, FocusBindingDirective as ɵc, AddItemInteractionContextComponent as ɵca, DisposableComponent as ɵcb, InPlaceInteractionContextComponent as ɵcc, ActivityActionsComponent as ɵcd, DisposableComponent as ɵd, FocusBindingFactory as ɵe, ComponentsModule as ɵf, NumberInputComponent as ɵg, AbstractInputComponent as ɵh, StringInputComponent as ɵi, TextInputComponent as ɵj, PasswordInputComponent as ɵk, SelectInputComponent as ɵl, CheckboxInputComponent as ɵm, ScrollContainerComponent as ɵn, NoopComponent as ɵo, SwitchCaseOption as ɵp, SwitchCaseWhenDirective as ɵq, SwitchCaseDefaultDirective as ɵr, SwitchCaseComponent as ɵs, FocusContainerComponent as ɵt, VerticalFocusContainerComponent as ɵu, FocusableComponent as ɵv, CardContainerComponent as ɵw, PlaceModule as ɵx, EmptyStateComponent as ɵy, BusyOverlayComponent as ɵz };
4465
4564
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map