@rxap/window-system 14.0.2 → 16.0.0-dev.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 (55) hide show
  1. package/esm2022/lib/default-window/default-window.component.mjs +14 -0
  2. package/esm2022/lib/window-action-bar/window-action-bar.component.mjs +28 -0
  3. package/esm2022/lib/window-container/window-container.component.mjs +86 -0
  4. package/esm2022/lib/window-content/window-content.component.mjs +75 -0
  5. package/esm2022/lib/window-footer.directive.mjs +59 -0
  6. package/esm2022/lib/window-ref.mjs +162 -0
  7. package/esm2022/lib/window-resizer/window-resizer.component.mjs +80 -0
  8. package/esm2022/lib/window-system.module.mjs +87 -0
  9. package/esm2022/lib/window-task-bar/window-task/window-task.component.mjs +34 -0
  10. package/esm2022/lib/window-task-bar/window-task-bar-container/window-task-bar-container.component.mjs +40 -0
  11. package/esm2022/lib/window-task-bar/window-task-bar.component.mjs +36 -0
  12. package/esm2022/lib/window-task-bar/window-task-bar.module.mjs +51 -0
  13. package/esm2022/lib/window-title.directive.mjs +59 -0
  14. package/esm2022/lib/window-tool-bar/window-tool-bar.component.mjs +26 -0
  15. package/esm2022/lib/window.service.mjs +164 -0
  16. package/{fesm2020 → fesm2022}/rxap-window-system.mjs +133 -138
  17. package/fesm2022/rxap-window-system.mjs.map +1 -0
  18. package/lib/default-window/default-window.component.d.ts +1 -1
  19. package/lib/window-action-bar/window-action-bar.component.d.ts +1 -1
  20. package/lib/window-container/window-container.component.d.ts +1 -1
  21. package/lib/window-content/window-content.component.d.ts +1 -1
  22. package/lib/window-footer.directive.d.ts +1 -1
  23. package/lib/window-resizer/window-resizer.component.d.ts +1 -1
  24. package/lib/window-system.module.d.ts +6 -7
  25. package/lib/window-task-bar/window-task/window-task.component.d.ts +1 -1
  26. package/lib/window-task-bar/window-task-bar-container/window-task-bar-container.component.d.ts +1 -1
  27. package/lib/window-task-bar/window-task-bar.component.d.ts +1 -1
  28. package/lib/window-task-bar/window-task-bar.module.d.ts +2 -2
  29. package/lib/window-title.directive.d.ts +1 -1
  30. package/lib/window-tool-bar/window-tool-bar.component.d.ts +1 -1
  31. package/package.json +25 -30
  32. package/esm2020/lib/default-window/default-window.component.mjs +0 -13
  33. package/esm2020/lib/window-action-bar/window-action-bar.component.mjs +0 -28
  34. package/esm2020/lib/window-container/window-container.component.mjs +0 -85
  35. package/esm2020/lib/window-content/window-content.component.mjs +0 -74
  36. package/esm2020/lib/window-footer.directive.mjs +0 -57
  37. package/esm2020/lib/window-ref.mjs +0 -162
  38. package/esm2020/lib/window-resizer/window-resizer.component.mjs +0 -79
  39. package/esm2020/lib/window-system.module.mjs +0 -90
  40. package/esm2020/lib/window-task-bar/window-task/window-task.component.mjs +0 -33
  41. package/esm2020/lib/window-task-bar/window-task-bar-container/window-task-bar-container.component.mjs +0 -39
  42. package/esm2020/lib/window-task-bar/window-task-bar.component.mjs +0 -35
  43. package/esm2020/lib/window-task-bar/window-task-bar.module.mjs +0 -50
  44. package/esm2020/lib/window-title.directive.mjs +0 -57
  45. package/esm2020/lib/window-tool-bar/window-tool-bar.component.mjs +0 -25
  46. package/esm2020/lib/window.service.mjs +0 -163
  47. package/fesm2015/rxap-window-system.mjs +0 -929
  48. package/fesm2015/rxap-window-system.mjs.map +0 -1
  49. package/fesm2020/rxap-window-system.mjs.map +0 -1
  50. /package/{esm2020 → esm2022}/index.mjs +0 -0
  51. /package/{esm2020 → esm2022}/lib/tokens.mjs +0 -0
  52. /package/{esm2020 → esm2022}/lib/utilities.mjs +0 -0
  53. /package/{esm2020 → esm2022}/lib/window-config.mjs +0 -0
  54. /package/{esm2020 → esm2022}/lib/window-context.mjs +0 -0
  55. /package/{esm2020 → esm2022}/rxap-window-system.mjs +0 -0
@@ -1,929 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, EventEmitter, ElementRef, Component, ChangeDetectionStrategy, Inject, Input, ViewChild, Output, ComponentRef, InjectFlags, ContentChild, HostBinding, isDevMode, Injector, ViewContainerRef, ComponentFactoryResolver, Injectable, Optional, ChangeDetectorRef, NgModule, TemplateRef, Directive } from '@angular/core';
3
- import * as i5 from '@angular/material/button';
4
- import { MatButtonModule } from '@angular/material/button';
5
- import * as i4 from '@angular/material/icon';
6
- import { MatIconModule } from '@angular/material/icon';
7
- import * as i1 from '@angular/material/toolbar';
8
- import { MatToolbarModule } from '@angular/material/toolbar';
9
- import { Subscription, fromEvent, Subject, BehaviorSubject, ReplaySubject, merge, isObservable, TimeoutError, throwError } from 'rxjs';
10
- import { __decorate, __metadata } from 'tslib';
11
- import { tap, switchMap, takeUntil, map, filter, finalize, startWith, take, delay, timeout, catchError } from 'rxjs/operators';
12
- import { Required } from '@rxap/utilities';
13
- import * as i3 from '@angular/flex-layout/extended';
14
- import * as i3$1 from '@angular/common';
15
- import { CommonModule } from '@angular/common';
16
- import * as i1$1 from '@rxap/services';
17
- import { LoadingIndicatorService } from '@rxap/services';
18
- import * as i2 from '@angular/flex-layout/flex';
19
- import * as i5$1 from '@angular/cdk/drag-drop';
20
- import { DragDropModule } from '@angular/cdk/drag-drop';
21
- import * as i6 from '@angular/cdk/portal';
22
- import { TemplatePortal, ComponentPortal, CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
23
- import * as i7$1 from '@angular/material/progress-bar';
24
- import { MatProgressBarModule } from '@angular/material/progress-bar';
25
- import * as i7 from '@rxap/material-directives/icon';
26
- import { IconDirectiveModule } from '@rxap/material-directives/icon';
27
- import { FlexLayoutModule } from '@angular/flex-layout';
28
- import { isDefined } from '@rxap/utilities/rxjs';
29
- import * as i1$2 from '@angular/cdk/overlay';
30
- import { OverlayConfig, Overlay, OverlayModule } from '@angular/cdk/overlay';
31
- import * as i4$1 from '@rxap/components';
32
- import { ButtonComponentModule } from '@rxap/components';
33
- import { v4 } from 'uuid';
34
- import * as i6$1 from '@rxap/directives';
35
- import { StopPropagationDirectiveModule } from '@rxap/directives';
36
- import * as i6$2 from '@angular/material/badge';
37
- import { MatBadgeModule } from '@angular/material/badge';
38
-
39
- const RXAP_WINDOW_CONTEXT = new InjectionToken('rxap/core/window/WINDOW_CONTEXT');
40
- const RXAP_WINDOW_DATA = new InjectionToken('rxap/core/window/WINDOW_DATA');
41
- const RXAP_WINDOW_CONTAINER_CONTEXT = new InjectionToken('rxap/core/window/WINDOW_CONTAINER_CONTEXT');
42
- const RXAP_WINDOW_REF = new InjectionToken('rxap/window-system/WINDOW_REF');
43
- const RXAP_WINDOW_SETTINGS = new InjectionToken('rxap/window-system/window-settings');
44
- const RXAP_WINDOW_DEFAULT_SETTINGS = new InjectionToken('rxap/window-system/default-window-settings');
45
-
46
- class WindowResizerComponent {
47
- constructor(context) {
48
- this.width$ = new EventEmitter();
49
- this.height$ = new EventEmitter();
50
- this.resizing$ = new EventEmitter();
51
- this._subscription = new Subscription();
52
- this.windowRef = context.windowRef;
53
- }
54
- ngOnDestroy() {
55
- this._subscription.unsubscribe();
56
- }
57
- ngOnInit() {
58
- let originalMouseX = 0;
59
- let originalMouseY = 0;
60
- let originalWidth = 0;
61
- let originalHeight = 0;
62
- this._subscription.add(fromEvent(this.resizerRef.nativeElement, 'mousedown').pipe(tap(event => {
63
- this.resizing$.emit(true);
64
- originalMouseX = event.pageX;
65
- originalMouseY = event.pageY;
66
- originalWidth = parseFloat(getComputedStyle(this.containerRef.nativeElement, null)
67
- .getPropertyValue('width')
68
- .replace('px', ''));
69
- originalHeight = parseFloat(getComputedStyle(this.containerRef.nativeElement, null)
70
- .getPropertyValue('height')
71
- .replace('px', ''));
72
- }), switchMap(() => fromEvent(window, 'mousemove').pipe(takeUntil(fromEvent(window, 'mouseup')), map((event) => ({
73
- width: originalWidth + (event.pageX - originalMouseX),
74
- height: originalHeight + (event.pageY - originalMouseY)
75
- })), filter(size => (Number(this.windowRef.getSizeConfig().minHeight) || 0) <=
76
- size.height &&
77
- (Number(this.windowRef.getSizeConfig().minWidth) || 0) <=
78
- size.width), map(size => ({ width: size.width + 'px', height: size.height + 'px' })), tap(size => {
79
- this.width$.emit(size.width);
80
- this.height$.emit(size.height);
81
- }), tap(size => {
82
- this.windowRef.setHeight(size.height);
83
- this.windowRef.setWidth(size.width);
84
- }), finalize(() => this.resizing$.emit(false))))).subscribe());
85
- }
86
- }
87
- WindowResizerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowResizerComponent, deps: [{ token: RXAP_WINDOW_CONTEXT }], target: i0.ɵɵFactoryTarget.Component });
88
- WindowResizerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowResizerComponent, selector: "rxap-window-resizer", inputs: { containerRef: "containerRef" }, outputs: { width$: "width", height$: "height", resizing$: "resizing" }, viewQueries: [{ propertyName: "resizerRef", first: true, predicate: ["resizer"], descendants: true, static: true }], ngImport: i0, template: "<div #resizer class=\"resizer\">\n <mat-icon [fxShow]=\"resizing$ | async\">texture</mat-icon>\n</div>\n", styles: [":host,.resizer{position:absolute;inset:auto 0 0 auto;width:24px;height:24px;cursor:nwse-resize;z-index:100}\n"], dependencies: [{ kind: "directive", type: i3.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
89
- __decorate([
90
- Required,
91
- __metadata("design:type", ElementRef)
92
- ], WindowResizerComponent.prototype, "containerRef", void 0);
93
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowResizerComponent, decorators: [{
94
- type: Component,
95
- args: [{ selector: 'rxap-window-resizer', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #resizer class=\"resizer\">\n <mat-icon [fxShow]=\"resizing$ | async\">texture</mat-icon>\n</div>\n", styles: [":host,.resizer{position:absolute;inset:auto 0 0 auto;width:24px;height:24px;cursor:nwse-resize;z-index:100}\n"] }]
96
- }], ctorParameters: function () {
97
- return [{ type: undefined, decorators: [{
98
- type: Inject,
99
- args: [RXAP_WINDOW_CONTEXT]
100
- }] }];
101
- }, propDecorators: { containerRef: [{
102
- type: Input
103
- }], resizerRef: [{
104
- type: ViewChild,
105
- args: ['resizer', { static: true }]
106
- }], width$: [{
107
- type: Output,
108
- args: ['width']
109
- }], height$: [{
110
- type: Output,
111
- args: ['height']
112
- }], resizing$: [{
113
- type: Output,
114
- args: ['resizing']
115
- }] } });
116
-
117
- class WindowToolBarComponent {
118
- constructor(context) {
119
- this.windowRef = context.windowRef;
120
- }
121
- }
122
- WindowToolBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowToolBarComponent, deps: [{ token: RXAP_WINDOW_CONTEXT }], target: i0.ɵɵFactoryTarget.Component });
123
- WindowToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowToolBarComponent, selector: "rxap-window-tool-bar", ngImport: i0, template: "<mat-toolbar class=\"header\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxLayoutGap=\"1.5rem\">\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"1.0rem\">\n <ng-template [ngIf]=\"windowRef.titlePortal$ | async\" [ngIfElse]=\"titleFromSettings\" let-titlePortal>\n <ng-template [cdkPortalOutlet]=\"titlePortal\"></ng-template>\n </ng-template>\n <ng-template #titleFromSettings>\n <ng-template [ngIf]=\"windowRef.settings$ | async\" let-settings>\n <mat-icon *ngIf=\"settings.icon\" [rxapIcon]=\"settings.icon\" fxFlex=\"40px\"></mat-icon>\n <h3 *ngIf=\"settings.title\" fxFlex=\"nogrow\">{{settings.title}}</h3>\n </ng-template>\n </ng-template>\n </div>\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <button (click)=\"windowRef.minimize()\" *ngIf=\"windowRef.settings.minimizable !== false\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon>minimize</mat-icon>\n </button>\n <button (click)=\"windowRef.fullScreen()\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon>fullscreen</mat-icon>\n </button>\n <button (click)=\"windowRef.complete()\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</mat-toolbar>\n", styles: [":host{width:100%}.header{height:64px}\n"], dependencies: [{ kind: "component", type: i1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "directive", type: i7.IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.Default });
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowToolBarComponent, decorators: [{
125
- type: Component,
126
- args: [{ selector: 'rxap-window-tool-bar', changeDetection: ChangeDetectionStrategy.Default, template: "<mat-toolbar class=\"header\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxLayoutGap=\"1.5rem\">\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"1.0rem\">\n <ng-template [ngIf]=\"windowRef.titlePortal$ | async\" [ngIfElse]=\"titleFromSettings\" let-titlePortal>\n <ng-template [cdkPortalOutlet]=\"titlePortal\"></ng-template>\n </ng-template>\n <ng-template #titleFromSettings>\n <ng-template [ngIf]=\"windowRef.settings$ | async\" let-settings>\n <mat-icon *ngIf=\"settings.icon\" [rxapIcon]=\"settings.icon\" fxFlex=\"40px\"></mat-icon>\n <h3 *ngIf=\"settings.title\" fxFlex=\"nogrow\">{{settings.title}}</h3>\n </ng-template>\n </ng-template>\n </div>\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <button (click)=\"windowRef.minimize()\" *ngIf=\"windowRef.settings.minimizable !== false\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon>minimize</mat-icon>\n </button>\n <button (click)=\"windowRef.fullScreen()\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon>fullscreen</mat-icon>\n </button>\n <button (click)=\"windowRef.complete()\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</mat-toolbar>\n", styles: [":host{width:100%}.header{height:64px}\n"] }]
127
- }], ctorParameters: function () {
128
- return [{ type: undefined, decorators: [{
129
- type: Inject,
130
- args: [RXAP_WINDOW_CONTEXT]
131
- }] }];
132
- } });
133
-
134
- function GetWindowStartPos() {
135
- let top = '16px';
136
- let left = '16px';
137
- // TODO : remove hack to get a better window starting position
138
- const rxapLayoutHeaderElements = document.getElementsByClassName('rxap-layout-header');
139
- if (rxapLayoutHeaderElements) {
140
- const rxapLayoutHeaderElement = rxapLayoutHeaderElements.item(0);
141
- if (rxapLayoutHeaderElement && rxapLayoutHeaderElement instanceof HTMLElement) {
142
- top = (rxapLayoutHeaderElement.offsetHeight + 16) + 'px';
143
- }
144
- }
145
- const rxapLayoutSidenavs = document.getElementsByClassName('rxap-layout-sidenav');
146
- if (rxapLayoutSidenavs) {
147
- const rxapLayoutSidenav = rxapLayoutSidenavs.item(0);
148
- if (rxapLayoutSidenav && rxapLayoutSidenav instanceof HTMLElement) {
149
- const container = rxapLayoutSidenav.firstElementChild;
150
- if (container && container instanceof HTMLElement) {
151
- left = (container.offsetWidth + 16) + 'px';
152
- }
153
- }
154
- }
155
- return { top, left };
156
- }
157
-
158
- class WindowRef extends Subject {
159
- constructor(overlayRef, overlay, settings) {
160
- super();
161
- this.overlayRef = overlayRef;
162
- this.overlay = overlay;
163
- this.settings = settings;
164
- this.width$ = new BehaviorSubject(this.getWidth());
165
- this.height$ = new BehaviorSubject(this.getHeight());
166
- /**
167
- * @deprecated removed. use the subscribe method and wait for the resolve event
168
- */
169
- this.closed$ = new Subject();
170
- this.attachedRef$ = new ReplaySubject(1);
171
- /**
172
- * stores the window size before fullScreen
173
- * @internal
174
- */
175
- this.oldSizes = null;
176
- /**
177
- * @internal
178
- */
179
- this.footerPortal$ = new ReplaySubject(1);
180
- /**
181
- * @internal
182
- */
183
- this.titlePortal$ = new ReplaySubject(1);
184
- this.settings$ = new ReplaySubject(1);
185
- }
186
- get isMinimized() {
187
- return this.overlayRef.hostElement.style.display === 'none';
188
- }
189
- /**
190
- * @deprecated removed. use the complete method
191
- * @param result
192
- */
193
- close(result) {
194
- this.closed$.next(result);
195
- if (result !== undefined) {
196
- this.next(result);
197
- }
198
- this.complete();
199
- }
200
- complete() {
201
- this.overlayRef.dispose();
202
- super.complete();
203
- }
204
- minimize() {
205
- this.overlayRef.hostElement.style.display = 'none';
206
- }
207
- reopen() {
208
- const startPos = GetWindowStartPos();
209
- this.setPos(startPos.left, startPos.top);
210
- this.overlayRef.hostElement.style.display = 'flex';
211
- }
212
- getSizeConfig() {
213
- const config = this.overlayRef.getConfig();
214
- return {
215
- width: config.width,
216
- height: config.height,
217
- minHeight: config.minHeight,
218
- minWidth: config.minWidth,
219
- maxHeight: config.maxHeight,
220
- maxWidth: config.maxWidth
221
- };
222
- }
223
- setWidth(width) {
224
- this.overlayRef.updateSize(Object.assign(Object.assign({}, this.getSizeConfig()), { width }));
225
- this.width$.next(width);
226
- }
227
- setHeight(height) {
228
- this.overlayRef.updateSize(Object.assign(Object.assign({}, this.getSizeConfig()), { height }));
229
- this.height$.next(height);
230
- }
231
- getWidth() {
232
- // tslint:disable-next-line:no-non-null-assertion
233
- return this.getSizeConfig().width + '';
234
- // return this.overlayRef.overlayElement.offsetWidth + 'px'
235
- }
236
- getHeight() {
237
- // tslint:disable-next-line:no-non-null-assertion
238
- return this.getSizeConfig().height + '';
239
- // return this.overlayRef.overlayElement.offsetHeight + 'px';
240
- }
241
- setPos(x, y) {
242
- this.overlayRef.updatePositionStrategy(this
243
- .overlay
244
- .position()
245
- .global()
246
- .top(y)
247
- .left(x));
248
- this.overlayRef.updatePosition();
249
- }
250
- getPos() {
251
- const pos = this.overlayRef.overlayElement.getBoundingClientRect();
252
- return { x: pos.left + 'px', y: pos.top + 'px' };
253
- }
254
- fullScreen() {
255
- if (this.oldSizes === null) {
256
- this.oldSizes = {
257
- width: this.overlayRef.overlayElement.offsetWidth + 'px',
258
- height: this.overlayRef.overlayElement.offsetHeight + 'px',
259
- pos: this.getPos()
260
- };
261
- this.setWidth('100vw');
262
- this.setHeight('100vh');
263
- this.setPos('0px', '0px');
264
- }
265
- else {
266
- this.setWidth(this.oldSizes.width);
267
- this.setHeight(this.oldSizes.height);
268
- this.setPos(this.oldSizes.pos.x, this.oldSizes.pos.y);
269
- this.oldSizes = null;
270
- }
271
- }
272
- /**
273
- * @param portal
274
- */
275
- setFooterPortal(portal) {
276
- setTimeout(() => {
277
- this.footerPortal$.next(portal);
278
- });
279
- }
280
- setTitlePortal(portal) {
281
- setTimeout(() => {
282
- this.titlePortal$.next(portal);
283
- });
284
- }
285
- setAttachedRef(attachedRef) {
286
- if (attachedRef instanceof ComponentRef) {
287
- this.updateWindowSettings(attachedRef);
288
- }
289
- else {
290
- this.updateWindowSettings();
291
- }
292
- this.attachedRef$.next(attachedRef);
293
- }
294
- /**
295
- * Injects the window settings from the component ref injector and overwrites
296
- * the settings
297
- * @private
298
- */
299
- updateWindowSettings(componentRef) {
300
- var _a;
301
- const settings = (_a = componentRef === null || componentRef === void 0 ? void 0 : componentRef.injector.get(RXAP_WINDOW_SETTINGS, null, InjectFlags.Optional)) !== null && _a !== void 0 ? _a : this.settings;
302
- if (settings) {
303
- // prevent change diction error: ExpressionChangedAfterItHasBeenCheckedError
304
- setTimeout(() => {
305
- this.settings$.next(Object.assign({}, this.settings, settings));
306
- });
307
- }
308
- }
309
- }
310
-
311
- class WindowContainerComponent {
312
- constructor(context, windowRef, windowInstance) {
313
- this.context = context;
314
- this.windowRef = windowRef;
315
- this.windowInstance = windowInstance;
316
- }
317
- get id() {
318
- return this.context.id;
319
- }
320
- ngOnInit() {
321
- this.width$ = merge(this.windowContainerResizer.width$, this.windowRef.width$);
322
- this.height$ = merge(this.windowContainerResizer.height$, this.windowRef.height$);
323
- }
324
- onDragEnded($event) {
325
- const nativeElement = $event.source.element.nativeElement;
326
- const pos = nativeElement.getBoundingClientRect();
327
- $event.source.reset();
328
- this.windowRef.setPos(pos.left + 'px', pos.top + 'px');
329
- }
330
- dragConstrainPosition(point, dragRef) {
331
- const height = document.body.offsetHeight;
332
- const width = document.body.offsetWidth;
333
- if (point.y <= 0) {
334
- point.y = 0;
335
- }
336
- if (point.x <= 0) {
337
- point.x = 0;
338
- }
339
- if (point.y > height - 64) {
340
- point.y = height - 64;
341
- }
342
- if (point.x > width - 100) {
343
- point.x = width - 100;
344
- }
345
- return point;
346
- }
347
- }
348
- WindowContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowContainerComponent, deps: [{ token: RXAP_WINDOW_CONTEXT }, { token: RXAP_WINDOW_REF }, { token: LoadingIndicatorService }], target: i0.ɵɵFactoryTarget.Component });
349
- WindowContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowContainerComponent, selector: "rxap-window-container", host: { properties: { "attr.data-id": "this.id" }, classAttribute: "rxap-window-container" }, queries: [{ propertyName: "footerContent", first: true, predicate: ["[footer]"], descendants: true, static: true }], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "windowContainerResizer", first: true, predicate: WindowResizerComponent, descendants: true, static: true }], ngImport: i0, template: "<div #container\n (cdkDragEnded)=\"onDragEnded($event)\"\n [cdkDragDisabled]=\"windowRef.settings.draggable === false\"\n [ngStyle]=\"{\n 'width': width$ | async,\n 'height': height$ | async,\n 'minWidth': windowRef.settings.minWidth,\n 'minHeight': windowRef.settings.minHeight,\n 'maxWidth': windowRef.settings.maxWidth,\n 'maxHeight': windowRef.settings.maxHeight\n }\"\n cdkDrag\n [cdkDragConstrainPosition]=\"dragConstrainPosition\"\n class=\"container mat-elevation-z4\"\n fxLayout=\"column\">\n\n <div cdkDragHandle class=\"tool-bar\" fxFlex=\"nogrow\">\n <rxap-window-tool-bar></rxap-window-tool-bar>\n </div>\n\n <div class=\"content\" fxFlex=\"grow\">\n <ng-content></ng-content>\n </div>\n\n <mat-toolbar *ngIf=\"windowRef.footerPortal$ | async as footerPortal\" class=\"footer mat-elevation-z1\" fxFlex=\"nogrow\">\n <ng-template [cdkPortalOutlet]=\"footerPortal\"></ng-template>\n </mat-toolbar>\n\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"windowInstance.isLoading$ | async\"></mat-progress-bar>\n\n <rxap-window-resizer [containerRef]=\"containerRef\"></rxap-window-resizer>\n\n</div>\n", styles: [".container{cursor:move;position:relative;z-index:1;max-height:100vh;max-width:100vw;background-color:#fff}.container:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.container .tool-bar{width:100%}.container .content{overflow:auto;width:100%}.container .footer{width:100%;height:64px}\n"], dependencies: [{ kind: "component", type: i1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i5$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: i7$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WindowToolBarComponent, selector: "rxap-window-tool-bar" }, { kind: "component", type: WindowResizerComponent, selector: "rxap-window-resizer", inputs: ["containerRef"], outputs: ["width", "height", "resizing"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.Default });
350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowContainerComponent, decorators: [{
351
- type: Component,
352
- args: [{ selector: 'rxap-window-container', changeDetection: ChangeDetectionStrategy.Default, host: {
353
- class: 'rxap-window-container'
354
- }, template: "<div #container\n (cdkDragEnded)=\"onDragEnded($event)\"\n [cdkDragDisabled]=\"windowRef.settings.draggable === false\"\n [ngStyle]=\"{\n 'width': width$ | async,\n 'height': height$ | async,\n 'minWidth': windowRef.settings.minWidth,\n 'minHeight': windowRef.settings.minHeight,\n 'maxWidth': windowRef.settings.maxWidth,\n 'maxHeight': windowRef.settings.maxHeight\n }\"\n cdkDrag\n [cdkDragConstrainPosition]=\"dragConstrainPosition\"\n class=\"container mat-elevation-z4\"\n fxLayout=\"column\">\n\n <div cdkDragHandle class=\"tool-bar\" fxFlex=\"nogrow\">\n <rxap-window-tool-bar></rxap-window-tool-bar>\n </div>\n\n <div class=\"content\" fxFlex=\"grow\">\n <ng-content></ng-content>\n </div>\n\n <mat-toolbar *ngIf=\"windowRef.footerPortal$ | async as footerPortal\" class=\"footer mat-elevation-z1\" fxFlex=\"nogrow\">\n <ng-template [cdkPortalOutlet]=\"footerPortal\"></ng-template>\n </mat-toolbar>\n\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"windowInstance.isLoading$ | async\"></mat-progress-bar>\n\n <rxap-window-resizer [containerRef]=\"containerRef\"></rxap-window-resizer>\n\n</div>\n", styles: [".container{cursor:move;position:relative;z-index:1;max-height:100vh;max-width:100vw;background-color:#fff}.container:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.container .tool-bar{width:100%}.container .content{overflow:auto;width:100%}.container .footer{width:100%;height:64px}\n"] }]
355
- }], ctorParameters: function () {
356
- return [{ type: undefined, decorators: [{
357
- type: Inject,
358
- args: [RXAP_WINDOW_CONTEXT]
359
- }] }, { type: WindowRef, decorators: [{
360
- type: Inject,
361
- args: [RXAP_WINDOW_REF]
362
- }] }, { type: i1$1.LoadingIndicatorService, decorators: [{
363
- type: Inject,
364
- args: [LoadingIndicatorService]
365
- }] }];
366
- }, propDecorators: { footerContent: [{
367
- type: ContentChild,
368
- args: ['[footer]', { static: true }]
369
- }], containerRef: [{
370
- type: ViewChild,
371
- args: ['container', { static: true }]
372
- }], windowContainerResizer: [{
373
- type: ViewChild,
374
- args: [WindowResizerComponent, { static: true }]
375
- }], id: [{
376
- type: HostBinding,
377
- args: ['attr.data-id']
378
- }] } });
379
-
380
- class WindowContentComponent {
381
- constructor(context, windowRef, injector, viewContainerRef, loadingIndicatorService) {
382
- this.windowRef = windowRef;
383
- this.injector = injector;
384
- this.viewContainerRef = viewContainerRef;
385
- this.loadingIndicatorService = loadingIndicatorService;
386
- this.portal = null;
387
- this.context = context;
388
- }
389
- ngOnInit() {
390
- if (this.context.template) {
391
- this.portal = new TemplatePortal(this.context.template, this.viewContainerRef);
392
- }
393
- else if (this.context.component) {
394
- this.portal = new ComponentPortal(this.context.component, this.viewContainerRef, this.injector);
395
- }
396
- }
397
- ngAfterViewInit() {
398
- this.portalOutlet.attached.pipe(startWith(this.portalOutlet.attachedRef), isDefined(), take(1), tap(attachedRef => this.windowRef.setAttachedRef(attachedRef)), tap(attachedRef => {
399
- const promise = [];
400
- if (attachedRef instanceof ComponentRef) {
401
- attachedRef.changeDetectorRef.detectChanges();
402
- const loading$ = attachedRef.instance.loading$;
403
- if (loading$ && isObservable(loading$)) {
404
- if (isDevMode()) {
405
- console.warn('The component has a loading indicator member');
406
- }
407
- this.loadingIndicatorService.attachLoading(loading$);
408
- promise.push(loading$.pipe(filter(Boolean), take(1), delay(100), tap(() => attachedRef.changeDetectorRef.detectChanges())).toPromise());
409
- }
410
- else {
411
- this.loadingIndicatorService.disable();
412
- }
413
- }
414
- else {
415
- this.loadingIndicatorService.disable();
416
- }
417
- return Promise.all(promise);
418
- }), timeout(10000), catchError(error => {
419
- if (error instanceof TimeoutError) {
420
- if (isDevMode()) {
421
- console.warn('The window content never resolved the attached ref');
422
- }
423
- }
424
- return throwError(error);
425
- })).subscribe();
426
- }
427
- }
428
- WindowContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowContentComponent, deps: [{ token: RXAP_WINDOW_CONTAINER_CONTEXT }, { token: RXAP_WINDOW_REF }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token: i1$1.LoadingIndicatorService }], target: i0.ɵɵFactoryTarget.Component });
429
- WindowContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowContentComponent, selector: "rxap-window-content", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true }], ngImport: i0, template: "<div class=\"content\">\n <div class=\"inner\">\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n </div>\n</div>\n", styles: [".content{cursor:initial}.content .inner{padding:1.5rem}\n"], dependencies: [{ kind: "directive", type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
430
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowContentComponent, decorators: [{
431
- type: Component,
432
- args: [{ selector: 'rxap-window-content', changeDetection: ChangeDetectionStrategy.Default, template: "<div class=\"content\">\n <div class=\"inner\">\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n </div>\n</div>\n", styles: [".content{cursor:initial}.content .inner{padding:1.5rem}\n"] }]
433
- }], ctorParameters: function () {
434
- return [{ type: undefined, decorators: [{
435
- type: Inject,
436
- args: [RXAP_WINDOW_CONTAINER_CONTEXT]
437
- }] }, { type: undefined, decorators: [{
438
- type: Inject,
439
- args: [RXAP_WINDOW_REF]
440
- }] }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type: i1$1.LoadingIndicatorService }];
441
- }, propDecorators: { portalOutlet: [{
442
- type: ViewChild,
443
- args: [CdkPortalOutlet]
444
- }] } });
445
-
446
- class DefaultWindowComponent {
447
- }
448
- DefaultWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DefaultWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
449
- DefaultWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: DefaultWindowComponent, selector: "rxap-default-window", ngImport: i0, template: "<rxap-window-container>\n <rxap-window-content></rxap-window-content>\n</rxap-window-container>\n", styles: [""], dependencies: [{ kind: "component", type: WindowContainerComponent, selector: "rxap-window-container" }, { kind: "component", type: WindowContentComponent, selector: "rxap-window-content" }], changeDetection: i0.ChangeDetectionStrategy.Default });
450
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DefaultWindowComponent, decorators: [{
451
- type: Component,
452
- args: [{ selector: 'rxap-default-window', changeDetection: ChangeDetectionStrategy.Default, template: "<rxap-window-container>\n <rxap-window-content></rxap-window-content>\n</rxap-window-container>\n" }]
453
- }] });
454
-
455
- class WindowActionBarComponent {
456
- constructor(context, injector) {
457
- this.injector = injector;
458
- this.definitions = null;
459
- this.position = 'start';
460
- if (context.windowRef.settings.actions) {
461
- this.definitions = context.windowRef.settings.actions.definitions;
462
- this.position = context.windowRef.settings.actions.position || this.position;
463
- }
464
- }
465
- }
466
- WindowActionBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowActionBarComponent, deps: [{ token: RXAP_WINDOW_CONTEXT }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
467
- WindowActionBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowActionBarComponent, selector: "rxap-window-action-bar", ngImport: i0, template: "<mat-toolbar-row *ngIf=\"definitions\" class=\"container\" fxLayout=\"row\" fxLayoutAlign=\"{{position}} center\" fxLayoutGap=\".8rem\">\n <button *ngFor=\"let definition of definitions\" [rxap-button]=\"definition\" fxFlex=\"nogrow\"></button>\n</mat-toolbar-row>\n", styles: [".container{padding:.8rem}\n"], dependencies: [{ kind: "directive", type: i1.MatToolbarRow, selector: "mat-toolbar-row", exportAs: ["matToolbarRow"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$1.ButtonComponent, selector: "button[rxap-button]", inputs: ["disabled", "disableRipple", "color", "context", "contextAll", "action", "rxap-button", "icon", "tooltip", "tooltipDisabled", "label", "show", "confirm"], outputs: ["confirmed", "unconfirmed"] }] });
468
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowActionBarComponent, decorators: [{
469
- type: Component,
470
- args: [{ selector: 'rxap-window-action-bar', template: "<mat-toolbar-row *ngIf=\"definitions\" class=\"container\" fxLayout=\"row\" fxLayoutAlign=\"{{position}} center\" fxLayoutGap=\".8rem\">\n <button *ngFor=\"let definition of definitions\" [rxap-button]=\"definition\" fxFlex=\"nogrow\"></button>\n</mat-toolbar-row>\n", styles: [".container{padding:.8rem}\n"] }]
471
- }], ctorParameters: function () {
472
- return [{ type: undefined, decorators: [{
473
- type: Inject,
474
- args: [RXAP_WINDOW_CONTEXT]
475
- }] }, { type: i0.Injector }];
476
- } });
477
-
478
- const DEFAULT_WINDOW_CONFIG = {
479
- resizeable: true,
480
- draggable: true,
481
- injector: null,
482
- componentFactoryResolver: null,
483
- minWidth: '384px',
484
- minHeight: '192px',
485
- maxWidth: '100vw',
486
- maxHeight: '100vw'
487
- };
488
-
489
- class WindowService {
490
- constructor(injector, overlay, componentFactoryResolver, defaultWindowSettings) {
491
- this.injector = injector;
492
- this.overlay = overlay;
493
- this.componentFactoryResolver = componentFactoryResolver;
494
- this.defaultWindowSettings = defaultWindowSettings;
495
- this.activeCount$ = new Subject();
496
- this.active = new Map();
497
- }
498
- get hasActiveWindows() {
499
- return this.active.size !== 0;
500
- }
501
- get activeWindowCount() {
502
- return this.active.size;
503
- }
504
- get allActiveWindows() {
505
- return Array.from(this.active.values());
506
- }
507
- get(id) {
508
- if (!this.has(id)) {
509
- throw new Error(`Active Window with id '${id}' not found`);
510
- }
511
- // tslint:disable-next-line:no-non-null-assertion
512
- return this.active.get(id);
513
- }
514
- close(id) {
515
- const windowRef = this.get(id);
516
- windowRef.complete();
517
- }
518
- has(id) {
519
- return this.active.has(id);
520
- }
521
- open(config) {
522
- var _a, _b, _c, _d, _e, _f, _g;
523
- // Override default configuration
524
- const windowConfig = Object.assign(Object.assign(Object.assign({ id: v4() }, DEFAULT_WINDOW_CONFIG), ((_a = this.defaultWindowSettings) !== null && _a !== void 0 ? _a : {})), config);
525
- if (this.has(windowConfig.id)) {
526
- return this.get(windowConfig.id);
527
- }
528
- // Returns an OverlayRef which is a PortalHost
529
- const overlayRef = this.createOverlay(windowConfig);
530
- // Instantiate remote control
531
- const windowRef = new WindowRef(overlayRef, this.overlay, windowConfig);
532
- const context = {
533
- id: windowConfig.id,
534
- overlayRef,
535
- windowRef,
536
- data: windowConfig.data,
537
- };
538
- const containerContext = {
539
- template: windowConfig.template,
540
- component: windowConfig.component,
541
- };
542
- const injector = Injector.create({
543
- parent: (_b = windowConfig.injector) !== null && _b !== void 0 ? _b : this.injector,
544
- providers: [
545
- {
546
- provide: RXAP_WINDOW_CONTAINER_CONTEXT,
547
- useValue: containerContext,
548
- },
549
- {
550
- provide: RXAP_WINDOW_CONTEXT,
551
- useValue: context,
552
- },
553
- {
554
- provide: RXAP_WINDOW_DATA,
555
- useValue: windowConfig.data,
556
- },
557
- {
558
- provide: RXAP_WINDOW_REF,
559
- useValue: windowRef,
560
- },
561
- {
562
- provide: LoadingIndicatorService,
563
- useClass: LoadingIndicatorService,
564
- },
565
- ],
566
- name: (_c = windowConfig === null || windowConfig === void 0 ? void 0 : windowConfig.injectorName) !== null && _c !== void 0 ? _c : 'WindowService',
567
- });
568
- const containerPortal = new ComponentPortal(DefaultWindowComponent, (_e = (_d = injector.get(ViewContainerRef, null, InjectFlags.Optional)) !== null && _d !== void 0 ? _d : windowConfig.viewContainerRef) !== null && _e !== void 0 ? _e : null, injector, (_g = (_f = injector.get(ComponentFactoryResolver, null, InjectFlags.Optional)) !== null && _f !== void 0 ? _f : windowConfig.componentFactoryResolver) !== null && _g !== void 0 ? _g : this.componentFactoryResolver);
569
- overlayRef.attach(containerPortal);
570
- overlayRef
571
- .backdropClick()
572
- .pipe(take(1), tap(() => windowRef.complete()))
573
- .subscribe();
574
- windowRef.pipe(finalize(() => this.remove(windowConfig.id))).subscribe();
575
- this.add(windowRef);
576
- return windowRef;
577
- }
578
- remove(id) {
579
- const result = this.active.delete(id);
580
- this.activeCount$.next(this.active.size);
581
- return result;
582
- }
583
- add(windowRef) {
584
- this.active.set(windowRef.settings.id, windowRef);
585
- this.activeCount$.next(this.active.size);
586
- }
587
- createOverlay({ panelClass, width, height, minHeight, minWidth, maxHeight, maxWidth, }) {
588
- var _a, _b, _c, _d, _e, _f, _g, _h;
589
- const startPos = GetWindowStartPos();
590
- const positionStrategy = this.overlay
591
- .position()
592
- .global()
593
- .top(startPos.top)
594
- .left(startPos.left);
595
- const overlayConfig = new OverlayConfig({
596
- hasBackdrop: false,
597
- panelClass,
598
- scrollStrategy: this.overlay.scrollStrategies.block(),
599
- width,
600
- height,
601
- maxWidth: (_b = maxWidth !== null && maxWidth !== void 0 ? maxWidth : (_a = this.defaultWindowSettings) === null || _a === void 0 ? void 0 : _a.maxWidth) !== null && _b !== void 0 ? _b : '100vw',
602
- maxHeight: (_d = maxHeight !== null && maxHeight !== void 0 ? maxHeight : (_c = this.defaultWindowSettings) === null || _c === void 0 ? void 0 : _c.maxHeight) !== null && _d !== void 0 ? _d : '100vh',
603
- minWidth: (_f = minWidth !== null && minWidth !== void 0 ? minWidth : (_e = this.defaultWindowSettings) === null || _e === void 0 ? void 0 : _e.minWidth) !== null && _f !== void 0 ? _f : '384px',
604
- minHeight: (_h = minHeight !== null && minHeight !== void 0 ? minHeight : (_g = this.defaultWindowSettings) === null || _g === void 0 ? void 0 : _g.minHeight) !== null && _h !== void 0 ? _h : '192px',
605
- positionStrategy,
606
- });
607
- return this.overlay.create(overlayConfig);
608
- }
609
- }
610
- WindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowService, deps: [{ token: Injector }, { token: Overlay }, { token: ComponentFactoryResolver }, { token: RXAP_WINDOW_DEFAULT_SETTINGS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
611
- WindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowService, providedIn: 'root' });
612
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowService, decorators: [{
613
- type: Injectable,
614
- args: [{ providedIn: 'root' }]
615
- }], ctorParameters: function () {
616
- return [{ type: i0.Injector, decorators: [{
617
- type: Inject,
618
- args: [Injector]
619
- }] }, { type: i1$2.Overlay, decorators: [{
620
- type: Inject,
621
- args: [Overlay]
622
- }] }, { type: i0.ComponentFactoryResolver, decorators: [{
623
- type: Inject,
624
- args: [ComponentFactoryResolver]
625
- }] }, { type: undefined, decorators: [{
626
- type: Optional
627
- }, {
628
- type: Inject,
629
- args: [RXAP_WINDOW_DEFAULT_SETTINGS]
630
- }] }];
631
- } });
632
-
633
- class WindowTaskComponent {
634
- close() {
635
- this.window.complete();
636
- }
637
- reopen() {
638
- this.window.reopen();
639
- }
640
- }
641
- WindowTaskComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
642
- WindowTaskComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowTaskComponent, selector: "rxap-window-task", inputs: { window: "window" }, ngImport: i0, template: "<div (click)=\"reopen()\" [ngClass]=\"{ minimized: window.isMinimized }\" class=\"container mat-elevation-z2\" fxLayout=\"row\" fxLayoutAlign=\"start center\"\n fxLayoutGap=\".5rem\">\n <ng-template [ngIf]=\"window.settings$ | async\" let-settings>\n <mat-icon *ngIf=\"settings.icon\" [rxapIcon]=\"settings.icon\" fxFlex=\"40px\"></mat-icon>\n <h3 *ngIf=\"settings.title\" fxFlex=\"grow\">{{settings.title}}</h3>\n </ng-template>\n <button (click)=\"close()\" rxapStopPropagation mat-icon-button type=\"button\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n", styles: [".container{padding:.5rem;cursor:pointer}.container.minimized{opacity:.5}\n"], dependencies: [{ kind: "directive", type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6$1.StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "directive", type: i7.IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
643
- __decorate([
644
- Required,
645
- __metadata("design:type", WindowRef)
646
- ], WindowTaskComponent.prototype, "window", void 0);
647
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskComponent, decorators: [{
648
- type: Component,
649
- args: [{ selector: 'rxap-window-task', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"reopen()\" [ngClass]=\"{ minimized: window.isMinimized }\" class=\"container mat-elevation-z2\" fxLayout=\"row\" fxLayoutAlign=\"start center\"\n fxLayoutGap=\".5rem\">\n <ng-template [ngIf]=\"window.settings$ | async\" let-settings>\n <mat-icon *ngIf=\"settings.icon\" [rxapIcon]=\"settings.icon\" fxFlex=\"40px\"></mat-icon>\n <h3 *ngIf=\"settings.title\" fxFlex=\"grow\">{{settings.title}}</h3>\n </ng-template>\n <button (click)=\"close()\" rxapStopPropagation mat-icon-button type=\"button\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n", styles: [".container{padding:.5rem;cursor:pointer}.container.minimized{opacity:.5}\n"] }]
650
- }], propDecorators: { window: [{
651
- type: Input
652
- }] } });
653
-
654
- class WindowTaskBarComponent {
655
- constructor(windowService, cdr) {
656
- this.windowService = windowService;
657
- this.cdr = cdr;
658
- this.subscriptions = new Subscription();
659
- }
660
- ngOnInit() {
661
- this.subscriptions.add(this.windowService.activeCount$.pipe(tap(() => this.cdr.markForCheck())).subscribe());
662
- }
663
- ngOnDestroy() {
664
- this.subscriptions.unsubscribe();
665
- }
666
- }
667
- WindowTaskBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarComponent, deps: [{ token: WindowService }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
668
- WindowTaskBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowTaskBarComponent, selector: "rxap-window-task-bar", ngImport: i0, template: "<div class=\"tasks\"\n fxFlex=\"nogrow\"\n fxLayout=\"row wrap\">\n <rxap-window-task *ngFor=\"let window of windowService.allActiveWindows\"\n [window]=\"window\"\n fxFlex=\"nogrow\">\n </rxap-window-task>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: WindowTaskComponent, selector: "rxap-window-task", inputs: ["window"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarComponent, decorators: [{
670
- type: Component,
671
- args: [{ selector: 'rxap-window-task-bar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"tasks\"\n fxFlex=\"nogrow\"\n fxLayout=\"row wrap\">\n <rxap-window-task *ngFor=\"let window of windowService.allActiveWindows\"\n [window]=\"window\"\n fxFlex=\"nogrow\">\n </rxap-window-task>\n</div>\n" }]
672
- }], ctorParameters: function () {
673
- return [{ type: WindowService, decorators: [{
674
- type: Inject,
675
- args: [WindowService]
676
- }] }, { type: i0.ChangeDetectorRef, decorators: [{
677
- type: Inject,
678
- args: [ChangeDetectorRef]
679
- }] }];
680
- } });
681
-
682
- const RXAP_WINDOW_TASK_BAR_CONTAINER_SETTINGS = new InjectionToken('rxap/window-system/task-bar-container');
683
- class WindowTaskBarContainerComponent {
684
- constructor(windowService, settings = null) {
685
- this.windowService = windowService;
686
- this.expand = true;
687
- if (settings) {
688
- if (settings.expand !== undefined) {
689
- this.expand = settings.expand;
690
- }
691
- }
692
- }
693
- }
694
- WindowTaskBarContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarContainerComponent, deps: [{ token: WindowService }, { token: RXAP_WINDOW_TASK_BAR_CONTAINER_SETTINGS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
695
- WindowTaskBarContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: WindowTaskBarContainerComponent, selector: "rxap-window-task-bar-container", ngImport: i0, template: "<div *ngIf=\"windowService.hasActiveWindows\" class=\"container\" fxLayout=\"column\">\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"end end\">\n <button (click)=\"expand = !expand\"\n [matBadgeHidden]=\"!windowService.hasActiveWindows\"\n [matBadge]=\"windowService.activeWindowCount.toFixed(0)\"\n class=\"pin\"\n color=\"primary\"\n mat-icon-button\n matBadgePosition=\"above before\"\n type=\"button\">\n <mat-icon *ngIf=\"!expand\">keyboard_arrow_up</mat-icon>\n <mat-icon *ngIf=\"expand\">keyboard_arrow_down</mat-icon>\n </button>\n </div>\n <mat-toolbar [fxShow]=\"expand\" class=\"tasks\">\n <rxap-window-task-bar></rxap-window-task-bar>\n </mat-toolbar>\n</div>\n", styles: [".container .pin{border:none;border-radius:50% 50% 0 0;cursor:pointer}.container .tasks{height:auto;padding:1.6rem}\n"], dependencies: [{ kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i6$2.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: WindowTaskBarComponent, selector: "rxap-window-task-bar" }] });
696
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarContainerComponent, decorators: [{
697
- type: Component,
698
- args: [{ selector: 'rxap-window-task-bar-container', template: "<div *ngIf=\"windowService.hasActiveWindows\" class=\"container\" fxLayout=\"column\">\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"end end\">\n <button (click)=\"expand = !expand\"\n [matBadgeHidden]=\"!windowService.hasActiveWindows\"\n [matBadge]=\"windowService.activeWindowCount.toFixed(0)\"\n class=\"pin\"\n color=\"primary\"\n mat-icon-button\n matBadgePosition=\"above before\"\n type=\"button\">\n <mat-icon *ngIf=\"!expand\">keyboard_arrow_up</mat-icon>\n <mat-icon *ngIf=\"expand\">keyboard_arrow_down</mat-icon>\n </button>\n </div>\n <mat-toolbar [fxShow]=\"expand\" class=\"tasks\">\n <rxap-window-task-bar></rxap-window-task-bar>\n </mat-toolbar>\n</div>\n", styles: [".container .pin{border:none;border-radius:50% 50% 0 0;cursor:pointer}.container .tasks{height:auto;padding:1.6rem}\n"] }]
699
- }], ctorParameters: function () {
700
- return [{ type: WindowService, decorators: [{
701
- type: Inject,
702
- args: [WindowService]
703
- }] }, { type: undefined, decorators: [{
704
- type: Optional
705
- }, {
706
- type: Inject,
707
- args: [RXAP_WINDOW_TASK_BAR_CONTAINER_SETTINGS]
708
- }] }];
709
- } });
710
-
711
- class WindowTaskBarModule {
712
- }
713
- WindowTaskBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
714
- WindowTaskBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarModule, declarations: [WindowTaskBarComponent, WindowTaskComponent, WindowTaskBarContainerComponent], imports: [CommonModule,
715
- FlexLayoutModule,
716
- MatIconModule,
717
- MatToolbarModule,
718
- MatBadgeModule,
719
- MatButtonModule,
720
- StopPropagationDirectiveModule,
721
- IconDirectiveModule], exports: [WindowTaskBarComponent, WindowTaskBarContainerComponent] });
722
- WindowTaskBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarModule, imports: [CommonModule,
723
- FlexLayoutModule,
724
- MatIconModule,
725
- MatToolbarModule,
726
- MatBadgeModule,
727
- MatButtonModule,
728
- StopPropagationDirectiveModule,
729
- IconDirectiveModule] });
730
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTaskBarModule, decorators: [{
731
- type: NgModule,
732
- args: [{
733
- declarations: [WindowTaskBarComponent, WindowTaskComponent, WindowTaskBarContainerComponent],
734
- imports: [
735
- CommonModule,
736
- FlexLayoutModule,
737
- MatIconModule,
738
- MatToolbarModule,
739
- MatBadgeModule,
740
- MatButtonModule,
741
- StopPropagationDirectiveModule,
742
- IconDirectiveModule
743
- ],
744
- exports: [WindowTaskBarComponent, WindowTaskBarContainerComponent]
745
- }]
746
- }] });
747
-
748
- class RxapWindowSystemModule {
749
- }
750
- RxapWindowSystemModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RxapWindowSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
751
- RxapWindowSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: RxapWindowSystemModule, declarations: [WindowContainerComponent,
752
- WindowToolBarComponent,
753
- WindowResizerComponent,
754
- DefaultWindowComponent,
755
- WindowContentComponent,
756
- WindowActionBarComponent], imports: [MatToolbarModule,
757
- FlexLayoutModule,
758
- CommonModule,
759
- DragDropModule,
760
- MatIconModule,
761
- MatButtonModule,
762
- OverlayModule,
763
- ButtonComponentModule,
764
- PortalModule,
765
- MatProgressBarModule,
766
- IconDirectiveModule], exports: [WindowContainerComponent,
767
- WindowToolBarComponent,
768
- WindowResizerComponent,
769
- DefaultWindowComponent,
770
- WindowContentComponent,
771
- WindowTaskBarModule] });
772
- RxapWindowSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RxapWindowSystemModule, imports: [MatToolbarModule,
773
- FlexLayoutModule,
774
- CommonModule,
775
- DragDropModule,
776
- MatIconModule,
777
- MatButtonModule,
778
- OverlayModule,
779
- ButtonComponentModule,
780
- PortalModule,
781
- MatProgressBarModule,
782
- IconDirectiveModule, WindowTaskBarModule] });
783
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RxapWindowSystemModule, decorators: [{
784
- type: NgModule,
785
- args: [{
786
- imports: [
787
- MatToolbarModule,
788
- FlexLayoutModule,
789
- CommonModule,
790
- DragDropModule,
791
- MatIconModule,
792
- MatButtonModule,
793
- OverlayModule,
794
- ButtonComponentModule,
795
- PortalModule,
796
- MatProgressBarModule,
797
- IconDirectiveModule
798
- ],
799
- declarations: [
800
- WindowContainerComponent,
801
- WindowToolBarComponent,
802
- WindowResizerComponent,
803
- DefaultWindowComponent,
804
- WindowContentComponent,
805
- WindowActionBarComponent
806
- ],
807
- exports: [
808
- WindowContainerComponent,
809
- WindowToolBarComponent,
810
- WindowResizerComponent,
811
- DefaultWindowComponent,
812
- WindowContentComponent,
813
- WindowTaskBarModule
814
- ]
815
- }]
816
- }] });
817
-
818
- class WindowFooterDirective {
819
- constructor(windowRef, template, viewContainerRef) {
820
- this.windowRef = windowRef;
821
- this.template = template;
822
- this.viewContainerRef = viewContainerRef;
823
- }
824
- /**
825
- * Asserts the correct type of the context for the template that `NgForOf` will render.
826
- *
827
- * The presence of this method is a signal to the Ivy template type-check compiler that the
828
- * `NgForOf` structural directive renders its template with a specific context type.
829
- */
830
- static ngTemplateContextGuard(dir, ctx) {
831
- return true;
832
- }
833
- ngOnInit() {
834
- this.windowRef.setFooterPortal(new TemplatePortal(this.template, this.viewContainerRef, {
835
- $implicit: this.windowRef,
836
- }));
837
- }
838
- }
839
- WindowFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowFooterDirective, deps: [{ token: RXAP_WINDOW_REF }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
840
- WindowFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: WindowFooterDirective, selector: "[rxapWindowFooter]", ngImport: i0 });
841
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowFooterDirective, decorators: [{
842
- type: Directive,
843
- args: [{
844
- selector: '[rxapWindowFooter]',
845
- }]
846
- }], ctorParameters: function () {
847
- return [{ type: WindowRef, decorators: [{
848
- type: Inject,
849
- args: [RXAP_WINDOW_REF]
850
- }] }, { type: i0.TemplateRef, decorators: [{
851
- type: Inject,
852
- args: [TemplateRef]
853
- }] }, { type: i0.ViewContainerRef, decorators: [{
854
- type: Inject,
855
- args: [ViewContainerRef]
856
- }] }];
857
- } });
858
- class WindowFooterDirectiveModule {
859
- }
860
- WindowFooterDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowFooterDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
861
- WindowFooterDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: WindowFooterDirectiveModule, declarations: [WindowFooterDirective], exports: [WindowFooterDirective] });
862
- WindowFooterDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowFooterDirectiveModule });
863
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowFooterDirectiveModule, decorators: [{
864
- type: NgModule,
865
- args: [{
866
- declarations: [WindowFooterDirective],
867
- exports: [WindowFooterDirective]
868
- }]
869
- }] });
870
-
871
- class WindowTitleDirective {
872
- constructor(windowRef, template, viewContainerRef) {
873
- this.windowRef = windowRef;
874
- this.template = template;
875
- this.viewContainerRef = viewContainerRef;
876
- }
877
- /**
878
- * Asserts the correct type of the context for the template that `NgForOf` will render.
879
- *
880
- * The presence of this method is a signal to the Ivy template type-check compiler that the
881
- * `NgForOf` structural directive renders its template with a specific context type.
882
- */
883
- static ngTemplateContextGuard(dir, ctx) {
884
- return true;
885
- }
886
- ngOnInit() {
887
- this.windowRef.setTitlePortal(new TemplatePortal(this.template, this.viewContainerRef, {
888
- $implicit: this.windowRef
889
- }));
890
- }
891
- }
892
- WindowTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTitleDirective, deps: [{ token: RXAP_WINDOW_REF }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
893
- WindowTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: WindowTitleDirective, selector: "[rxapWindowTitle]", ngImport: i0 });
894
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTitleDirective, decorators: [{
895
- type: Directive,
896
- args: [{
897
- selector: '[rxapWindowTitle]'
898
- }]
899
- }], ctorParameters: function () {
900
- return [{ type: WindowRef, decorators: [{
901
- type: Inject,
902
- args: [RXAP_WINDOW_REF]
903
- }] }, { type: i0.TemplateRef, decorators: [{
904
- type: Inject,
905
- args: [TemplateRef]
906
- }] }, { type: i0.ViewContainerRef, decorators: [{
907
- type: Inject,
908
- args: [ViewContainerRef]
909
- }] }];
910
- } });
911
- class WindowTitleDirectiveModule {
912
- }
913
- WindowTitleDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTitleDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
914
- WindowTitleDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: WindowTitleDirectiveModule, declarations: [WindowTitleDirective], exports: [WindowTitleDirective] });
915
- WindowTitleDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTitleDirectiveModule });
916
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: WindowTitleDirectiveModule, decorators: [{
917
- type: NgModule,
918
- args: [{
919
- declarations: [WindowTitleDirective],
920
- exports: [WindowTitleDirective]
921
- }]
922
- }] });
923
-
924
- /**
925
- * Generated bundle index. Do not edit.
926
- */
927
-
928
- export { DEFAULT_WINDOW_CONFIG, DefaultWindowComponent, RXAP_WINDOW_CONTAINER_CONTEXT, RXAP_WINDOW_CONTEXT, RXAP_WINDOW_DATA, RXAP_WINDOW_DEFAULT_SETTINGS, RXAP_WINDOW_REF, RXAP_WINDOW_SETTINGS, RXAP_WINDOW_TASK_BAR_CONTAINER_SETTINGS, RxapWindowSystemModule, WindowContainerComponent, WindowContentComponent, WindowFooterDirective, WindowFooterDirectiveModule, WindowRef, WindowResizerComponent, WindowService, WindowTaskBarComponent, WindowTaskBarContainerComponent, WindowTaskBarModule, WindowTitleDirective, WindowTitleDirectiveModule, WindowToolBarComponent };
929
- //# sourceMappingURL=rxap-window-system.mjs.map