@progress/kendo-angular-dialog 21.4.1-develop.1 → 22.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dialog/dialog-content-base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-dialog.mjs +84 -84
- package/localization/messages.d.ts +1 -1
- package/package.json +11 -19
- package/schematics/ngAdd/index.js +1 -1
- package/esm2022/common/actions-layout.mjs +0 -5
- package/esm2022/common/animation-types.mjs +0 -5
- package/esm2022/common/dialog-animation-direction.mjs +0 -5
- package/esm2022/common/preventable-event.mjs +0 -30
- package/esm2022/common/util.mjs +0 -167
- package/esm2022/dialog/dialog-actions.component.mjs +0 -182
- package/esm2022/dialog/dialog-animations/animate-content.mjs +0 -19
- package/esm2022/dialog/dialog-animations/animations.mjs +0 -69
- package/esm2022/dialog/dialog-animations/create-animation-player.mjs +0 -18
- package/esm2022/dialog/dialog-container.directive.mjs +0 -31
- package/esm2022/dialog/dialog-container.service.mjs +0 -26
- package/esm2022/dialog/dialog-content-base.mjs +0 -57
- package/esm2022/dialog/dialog-titlebar.component.mjs +0 -170
- package/esm2022/dialog/dialog.component.mjs +0 -650
- package/esm2022/dialog/dialog.service.mjs +0 -210
- package/esm2022/dialog/models/dialog-action-divider.mjs +0 -5
- package/esm2022/dialog/models/dialog-action.mjs +0 -40
- package/esm2022/dialog/models/dialog-animation.mjs +0 -5
- package/esm2022/dialog/models/dialog-close-result.mjs +0 -12
- package/esm2022/dialog/models/dialog-ref.mjs +0 -39
- package/esm2022/dialog/models/dialog-result.mjs +0 -5
- package/esm2022/dialog/models/dialog-settings.mjs +0 -95
- package/esm2022/dialog/models/index.mjs +0 -12
- package/esm2022/dialog/models/theme-color.mjs +0 -5
- package/esm2022/dialog.module.mjs +0 -49
- package/esm2022/dialogs.module.mjs +0 -59
- package/esm2022/directives.mjs +0 -95
- package/esm2022/index.mjs +0 -33
- package/esm2022/localization/custom-messages.component.mjs +0 -65
- package/esm2022/localization/dialog-localization.service.mjs +0 -9
- package/esm2022/localization/localized-messages.directive.mjs +0 -43
- package/esm2022/localization/messages.mjs +0 -45
- package/esm2022/localization/titlebar-localization.service.mjs +0 -45
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-dialog.mjs +0 -8
- package/esm2022/window/actions/window-close-action.directive.mjs +0 -119
- package/esm2022/window/actions/window-maximize-action.directive.mjs +0 -125
- package/esm2022/window/actions/window-minimize-action.directive.mjs +0 -125
- package/esm2022/window/actions/window-restore-action.directive.mjs +0 -125
- package/esm2022/window/drag-resize.service.mjs +0 -335
- package/esm2022/window/models/index.mjs +0 -11
- package/esm2022/window/models/theme-color.mjs +0 -5
- package/esm2022/window/models/window-close-result.mjs +0 -10
- package/esm2022/window/models/window-messages.mjs +0 -5
- package/esm2022/window/models/window-options.mjs +0 -5
- package/esm2022/window/models/window-ref.mjs +0 -25
- package/esm2022/window/models/window-settings.mjs +0 -92
- package/esm2022/window/models/window-types.mjs +0 -5
- package/esm2022/window/navigation.service.mjs +0 -160
- package/esm2022/window/window-container.directive.mjs +0 -31
- package/esm2022/window/window-container.service.mjs +0 -26
- package/esm2022/window/window-events.mjs +0 -5
- package/esm2022/window/window-resize-handle.directive.mjs +0 -74
- package/esm2022/window/window-titlebar.component.mjs +0 -173
- package/esm2022/window/window.component.mjs +0 -831
- package/esm2022/window/window.service.mjs +0 -206
- package/esm2022/window.module.mjs +0 -53
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, ElementRef, HostBinding, HostListener, Input, Optional, NgZone, Renderer2 } from "@angular/core";
|
|
6
|
-
import { NgClass } from "@angular/common";
|
|
7
|
-
import { Button } from '@progress/kendo-angular-buttons';
|
|
8
|
-
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { windowRestoreIcon } from '@progress/kendo-svg-icons';
|
|
10
|
-
import { IconWrapperComponent } from "@progress/kendo-angular-icons";
|
|
11
|
-
import { DragResizeService } from './../drag-resize.service';
|
|
12
|
-
import * as i0 from "@angular/core";
|
|
13
|
-
import * as i1 from "./../drag-resize.service";
|
|
14
|
-
import * as i2 from "@progress/kendo-angular-l10n";
|
|
15
|
-
/**
|
|
16
|
-
* Represents the restore action directive of the Window component.
|
|
17
|
-
*
|
|
18
|
-
* ```html
|
|
19
|
-
* <button kendoWindowRestoreAction>Restore</button>
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export class WindowRestoreActionDirective extends Button {
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
window;
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
windowRestoreIcon = windowRestoreIcon;
|
|
31
|
-
buttonType = 'button';
|
|
32
|
-
buttonClass = true;
|
|
33
|
-
constructor(el, renderer, _service, localization, ngZone) {
|
|
34
|
-
super(el, renderer, null, localization, ngZone);
|
|
35
|
-
this.window = _service;
|
|
36
|
-
this.fillMode = 'flat';
|
|
37
|
-
this.icon = 'window-restore';
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
onClick() {
|
|
43
|
-
if (!this.isDisabled) {
|
|
44
|
-
this.window.restoreAction();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
get visible() {
|
|
48
|
-
return this.window.options.state === 'default' ? 'none' : 'inline-flex';
|
|
49
|
-
}
|
|
50
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowRestoreActionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.DragResizeService, optional: true }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WindowRestoreActionDirective, isStandalone: true, selector: "button[kendoWindowRestoreAction]", inputs: { window: "window" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.buttonType", "class.k-window-titlebar-action": "this.buttonClass", "style.display": "this.visible" } }, providers: [
|
|
52
|
-
LocalizationService,
|
|
53
|
-
{
|
|
54
|
-
provide: L10N_PREFIX,
|
|
55
|
-
useValue: 'kendo.button'
|
|
56
|
-
}
|
|
57
|
-
], exportAs: ["kendoWindowRestoreAction"], usesInheritance: true, ngImport: i0, template: `
|
|
58
|
-
@if (!imageUrl && !iconClass) {
|
|
59
|
-
<kendo-icon-wrapper
|
|
60
|
-
innerCssClass="k-button-icon"
|
|
61
|
-
name="window-restore"
|
|
62
|
-
[svgIcon]="windowRestoreIcon">
|
|
63
|
-
</kendo-icon-wrapper>
|
|
64
|
-
}
|
|
65
|
-
@if (imageUrl) {
|
|
66
|
-
<span class="k-button-icon k-icon">
|
|
67
|
-
<img [src]="imageUrl" class="k-image" role="presentation" />
|
|
68
|
-
</span>
|
|
69
|
-
}
|
|
70
|
-
@if (iconClass) {
|
|
71
|
-
<span class="k-button-icon" [ngClass]="iconClass"></span>
|
|
72
|
-
}
|
|
73
|
-
<span class="k-button-text"><ng-content></ng-content></span>
|
|
74
|
-
`, isInline: true, dependencies: [{ kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
75
|
-
}
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowRestoreActionDirective, decorators: [{
|
|
77
|
-
type: Component,
|
|
78
|
-
args: [{
|
|
79
|
-
exportAs: 'kendoWindowRestoreAction',
|
|
80
|
-
providers: [
|
|
81
|
-
LocalizationService,
|
|
82
|
-
{
|
|
83
|
-
provide: L10N_PREFIX,
|
|
84
|
-
useValue: 'kendo.button'
|
|
85
|
-
}
|
|
86
|
-
],
|
|
87
|
-
selector: 'button[kendoWindowRestoreAction]',
|
|
88
|
-
template: `
|
|
89
|
-
@if (!imageUrl && !iconClass) {
|
|
90
|
-
<kendo-icon-wrapper
|
|
91
|
-
innerCssClass="k-button-icon"
|
|
92
|
-
name="window-restore"
|
|
93
|
-
[svgIcon]="windowRestoreIcon">
|
|
94
|
-
</kendo-icon-wrapper>
|
|
95
|
-
}
|
|
96
|
-
@if (imageUrl) {
|
|
97
|
-
<span class="k-button-icon k-icon">
|
|
98
|
-
<img [src]="imageUrl" class="k-image" role="presentation" />
|
|
99
|
-
</span>
|
|
100
|
-
}
|
|
101
|
-
@if (iconClass) {
|
|
102
|
-
<span class="k-button-icon" [ngClass]="iconClass"></span>
|
|
103
|
-
}
|
|
104
|
-
<span class="k-button-text"><ng-content></ng-content></span>
|
|
105
|
-
`,
|
|
106
|
-
standalone: true,
|
|
107
|
-
imports: [IconWrapperComponent, NgClass]
|
|
108
|
-
}]
|
|
109
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.DragResizeService, decorators: [{
|
|
110
|
-
type: Optional
|
|
111
|
-
}] }, { type: i2.LocalizationService }, { type: i0.NgZone }], propDecorators: { window: [{
|
|
112
|
-
type: Input
|
|
113
|
-
}], buttonType: [{
|
|
114
|
-
type: HostBinding,
|
|
115
|
-
args: ['attr.type']
|
|
116
|
-
}], buttonClass: [{
|
|
117
|
-
type: HostBinding,
|
|
118
|
-
args: ['class.k-window-titlebar-action']
|
|
119
|
-
}], onClick: [{
|
|
120
|
-
type: HostListener,
|
|
121
|
-
args: ['click']
|
|
122
|
-
}], visible: [{
|
|
123
|
-
type: HostBinding,
|
|
124
|
-
args: ['style.display']
|
|
125
|
-
}] } });
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Injectable, NgZone, EventEmitter } from "@angular/core";
|
|
6
|
-
import { Subscription } from 'rxjs';
|
|
7
|
-
import { tap, map, switchMap, takeUntil, take } from 'rxjs/operators';
|
|
8
|
-
import { isPresent, OFFSET_STYLES, preventDefault } from '../common/util';
|
|
9
|
-
import { scrollPosition, offset, getDocumentElement, positionWithScroll, getWindowViewPort } from '@progress/kendo-popup-common';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
let newZIndex = 11510;
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
const DEFAULT_OPTIONS = {
|
|
19
|
-
draggable: true,
|
|
20
|
-
height: null,
|
|
21
|
-
left: null,
|
|
22
|
-
minHeight: 100,
|
|
23
|
-
minWidth: 120,
|
|
24
|
-
position: 'absolute',
|
|
25
|
-
resizable: true,
|
|
26
|
-
state: 'default',
|
|
27
|
-
top: null,
|
|
28
|
-
width: null
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* @hidden
|
|
32
|
-
*/
|
|
33
|
-
const createMoveStream = (el, ev) => mouseDown => {
|
|
34
|
-
return el.kendoDrag
|
|
35
|
-
.pipe(takeUntil(el.kendoRelease.pipe(tap(() => { ev.emit(); }))), map(({ pageX, pageY }) => ({
|
|
36
|
-
originalX: mouseDown.pageX,
|
|
37
|
-
originalY: mouseDown.pageY,
|
|
38
|
-
pageX,
|
|
39
|
-
pageY
|
|
40
|
-
})));
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
export class DragResizeService {
|
|
46
|
-
ngZone;
|
|
47
|
-
close = new EventEmitter();
|
|
48
|
-
focus = new EventEmitter();
|
|
49
|
-
change = new EventEmitter();
|
|
50
|
-
stateChange = new EventEmitter();
|
|
51
|
-
dragStart = new EventEmitter();
|
|
52
|
-
dragEnd = new EventEmitter();
|
|
53
|
-
resizeStart = new EventEmitter();
|
|
54
|
-
resizeEnd = new EventEmitter();
|
|
55
|
-
options = Object.assign({}, DEFAULT_OPTIONS);
|
|
56
|
-
restoreOptions;
|
|
57
|
-
window;
|
|
58
|
-
lastAction = null;
|
|
59
|
-
subscriptions = new Subscription();
|
|
60
|
-
dragSubscription = new Subscription();
|
|
61
|
-
constructor(ngZone) {
|
|
62
|
-
this.ngZone = ngZone;
|
|
63
|
-
}
|
|
64
|
-
ngOnDestroy() {
|
|
65
|
-
if (this.subscriptions) {
|
|
66
|
-
this.subscriptions.unsubscribe();
|
|
67
|
-
}
|
|
68
|
-
if (this.dragSubscription) {
|
|
69
|
-
this.dragSubscription.unsubscribe();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
init(el) {
|
|
73
|
-
const state = this.options.state;
|
|
74
|
-
const options = this.options;
|
|
75
|
-
this.window = el;
|
|
76
|
-
if (state !== 'default') {
|
|
77
|
-
this.restoreOptions = Object.assign({}, options);
|
|
78
|
-
}
|
|
79
|
-
if (state === 'minimized') {
|
|
80
|
-
options.height = 0;
|
|
81
|
-
options.minHeight = 0;
|
|
82
|
-
}
|
|
83
|
-
if (state === 'maximized') {
|
|
84
|
-
options.position = 'fixed';
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
onDrag(el) {
|
|
88
|
-
this.subscriptions.add(this.ngZone.runOutsideAngular(() => {
|
|
89
|
-
let startPosition;
|
|
90
|
-
let dragStarted;
|
|
91
|
-
this.dragSubscription = el.kendoPress
|
|
92
|
-
.pipe(tap((ev) => {
|
|
93
|
-
if (!ev.isTouch) {
|
|
94
|
-
preventDefault(ev);
|
|
95
|
-
}
|
|
96
|
-
this.focus.emit();
|
|
97
|
-
startPosition = this.currentPosition();
|
|
98
|
-
dragStarted = false;
|
|
99
|
-
}), switchMap(createMoveStream(el, this.dragEnd)))
|
|
100
|
-
.subscribe(({ pageX, pageY, originalX, originalY }) => {
|
|
101
|
-
if (!dragStarted) {
|
|
102
|
-
this.ensureWidth();
|
|
103
|
-
this.dragStart.emit();
|
|
104
|
-
dragStarted = true;
|
|
105
|
-
}
|
|
106
|
-
this.handleDrag({
|
|
107
|
-
originalX, originalY,
|
|
108
|
-
pageX, pageY, startPosition
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
handleDrag({ originalX, originalY, pageX, pageY, startPosition }) {
|
|
114
|
-
this.options.left = startPosition.x + pageX - originalX;
|
|
115
|
-
this.options.top = startPosition.y + pageY - originalY;
|
|
116
|
-
if (this.options.state === 'minimized' && isPresent(this.restoreOptions)) {
|
|
117
|
-
this.restoreOptions.left = this.options.left;
|
|
118
|
-
this.restoreOptions.top = this.options.top;
|
|
119
|
-
}
|
|
120
|
-
this.change.emit({
|
|
121
|
-
left: startPosition.x + pageX - originalX,
|
|
122
|
-
top: startPosition.y + pageY - originalY
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
onResize(handle, direction) {
|
|
126
|
-
this.subscriptions.add(this.ngZone.runOutsideAngular(() => {
|
|
127
|
-
let startOffsetAndPosition;
|
|
128
|
-
let resizeStarted = false;
|
|
129
|
-
handle.kendoPress.pipe(tap((ev) => {
|
|
130
|
-
preventDefault(ev);
|
|
131
|
-
this.focus.emit();
|
|
132
|
-
startOffsetAndPosition = this.currentOffsetAndPosition();
|
|
133
|
-
resizeStarted = false;
|
|
134
|
-
}), switchMap(createMoveStream(handle, this.resizeEnd)))
|
|
135
|
-
.subscribe(({ pageX, pageY, originalX, originalY }) => {
|
|
136
|
-
if (!resizeStarted) {
|
|
137
|
-
this.resizeStart.emit(direction);
|
|
138
|
-
resizeStarted = true;
|
|
139
|
-
}
|
|
140
|
-
const deltaX = pageX - originalX;
|
|
141
|
-
const deltaY = pageY - originalY;
|
|
142
|
-
this.handleResize(startOffsetAndPosition, direction, deltaX, deltaY);
|
|
143
|
-
});
|
|
144
|
-
}));
|
|
145
|
-
}
|
|
146
|
-
handleResize(initial, dir, deltaX, deltaY) {
|
|
147
|
-
const old = this.options;
|
|
148
|
-
const ev = {};
|
|
149
|
-
if (dir.indexOf('e') >= 0) {
|
|
150
|
-
const newWidth = initial.width + deltaX;
|
|
151
|
-
if (newWidth !== old.width && newWidth >= old.minWidth) {
|
|
152
|
-
ev.width = newWidth;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (dir.indexOf('n') >= 0) {
|
|
156
|
-
const newHeight = initial.height - deltaY;
|
|
157
|
-
const newTop = initial.y + deltaY;
|
|
158
|
-
if (newHeight !== old.height && newHeight >= old.minHeight && newTop !== old.top) {
|
|
159
|
-
ev.height = newHeight;
|
|
160
|
-
ev.top = newTop;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (dir.indexOf('s') >= 0) {
|
|
164
|
-
const newHeight = initial.height + deltaY;
|
|
165
|
-
if (newHeight !== old.height && newHeight >= old.minHeight) {
|
|
166
|
-
ev.height = newHeight;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
if (dir.indexOf('w') >= 0) {
|
|
170
|
-
const newLeft = initial.x + deltaX;
|
|
171
|
-
const newWidth = initial.width - deltaX;
|
|
172
|
-
if (newWidth !== old.width && newWidth >= old.minWidth && newLeft !== old.left) {
|
|
173
|
-
ev.width = newWidth;
|
|
174
|
-
ev.left = newLeft;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
if (isPresent(ev.width) || isPresent(ev.height)) {
|
|
178
|
-
OFFSET_STYLES.forEach((style) => {
|
|
179
|
-
if (isPresent(ev[style])) {
|
|
180
|
-
this.options[style] = ev[style];
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
this.change.emit(ev);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
restoreAction() {
|
|
187
|
-
this.lastAction = 'restore';
|
|
188
|
-
this.defaultState();
|
|
189
|
-
}
|
|
190
|
-
defaultState() {
|
|
191
|
-
if (isPresent(this.restoreOptions)) {
|
|
192
|
-
this.options = Object.assign({}, this.restoreOptions);
|
|
193
|
-
}
|
|
194
|
-
this.options.state = 'default';
|
|
195
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
196
|
-
if (!isPresent(this.options.left) || !isPresent(this.options.top)) {
|
|
197
|
-
this.center();
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
this.stateChange.emit('default');
|
|
201
|
-
}
|
|
202
|
-
storeOptions() {
|
|
203
|
-
this.restoreOptions = Object.assign({}, this.options);
|
|
204
|
-
}
|
|
205
|
-
maximizeAction() {
|
|
206
|
-
this.lastAction = 'maximize';
|
|
207
|
-
this.maximizeState();
|
|
208
|
-
}
|
|
209
|
-
maximizeState() {
|
|
210
|
-
this.storeOptions();
|
|
211
|
-
const wnd = this.windowViewPort;
|
|
212
|
-
this.options = Object.assign({}, this.options, {
|
|
213
|
-
height: wnd.height,
|
|
214
|
-
left: 0,
|
|
215
|
-
position: 'fixed',
|
|
216
|
-
state: 'maximized',
|
|
217
|
-
top: 0,
|
|
218
|
-
width: wnd.width
|
|
219
|
-
});
|
|
220
|
-
this.stateChange.emit('maximized');
|
|
221
|
-
}
|
|
222
|
-
minimizeAction() {
|
|
223
|
-
this.lastAction = 'minimize';
|
|
224
|
-
this.minimizeState();
|
|
225
|
-
}
|
|
226
|
-
minimizeState() {
|
|
227
|
-
this.storeOptions();
|
|
228
|
-
this.options = Object.assign({}, this.options, {
|
|
229
|
-
height: null,
|
|
230
|
-
minHeight: 0,
|
|
231
|
-
state: 'minimized'
|
|
232
|
-
});
|
|
233
|
-
this.stateChange.emit('minimized');
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Handles manual changes of the 'state' property.
|
|
237
|
-
* Required to distinguish them from action clicks.
|
|
238
|
-
*/
|
|
239
|
-
applyManualState() {
|
|
240
|
-
const state = this.options.state;
|
|
241
|
-
switch (state) {
|
|
242
|
-
case 'default':
|
|
243
|
-
this.clearHeight();
|
|
244
|
-
this.defaultState();
|
|
245
|
-
break;
|
|
246
|
-
case 'maximized':
|
|
247
|
-
this.clearHeight();
|
|
248
|
-
this.maximizeState();
|
|
249
|
-
break;
|
|
250
|
-
case 'minimized':
|
|
251
|
-
this.minimizeState();
|
|
252
|
-
break;
|
|
253
|
-
default:
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
closeAction() {
|
|
258
|
-
this.close.emit();
|
|
259
|
-
}
|
|
260
|
-
ensureWidth() {
|
|
261
|
-
const windowOffset = offset(this.window.nativeElement);
|
|
262
|
-
if (!isPresent(this.options.width)) {
|
|
263
|
-
this.options.width = windowOffset.width;
|
|
264
|
-
this.change.emit({ width: windowOffset.width });
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
clearHeight() {
|
|
268
|
-
if (this.options.height === 0) {
|
|
269
|
-
delete this.options.height;
|
|
270
|
-
}
|
|
271
|
-
if (this.options.minHeight === 0) {
|
|
272
|
-
delete this.options.minHeight;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
center() {
|
|
276
|
-
if (this.options.state === 'maximized') {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
const scroll = scrollPosition(this.window.nativeElement);
|
|
280
|
-
const wnd = this.windowViewPort;
|
|
281
|
-
const wrapper = offset(this.window.nativeElement);
|
|
282
|
-
const ev = {};
|
|
283
|
-
if (!isPresent(this.options.left)) {
|
|
284
|
-
this.options.left = scroll.x + Math.max(0, (wnd.width - wrapper.width) / 2);
|
|
285
|
-
ev.left = this.options.left;
|
|
286
|
-
}
|
|
287
|
-
if (!isPresent(this.options.top)) {
|
|
288
|
-
this.options.top = scroll.y + Math.max(0, (wnd.height - wrapper.height) / 2);
|
|
289
|
-
ev.top = this.options.top;
|
|
290
|
-
}
|
|
291
|
-
this.change.emit(ev);
|
|
292
|
-
}
|
|
293
|
-
currentOffsetAndPosition() {
|
|
294
|
-
const o = this.options;
|
|
295
|
-
const off = offset(this.window.nativeElement);
|
|
296
|
-
return Object.assign({}, this.currentPosition(), {
|
|
297
|
-
height: o.height ? o.height : off.height,
|
|
298
|
-
width: o.width ? o.width : off.width
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
currentPosition() {
|
|
302
|
-
const o = this.options;
|
|
303
|
-
if (!o.top || !o.left) {
|
|
304
|
-
this.setPosition();
|
|
305
|
-
}
|
|
306
|
-
return {
|
|
307
|
-
x: this.options.left,
|
|
308
|
-
y: this.options.top
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
setPosition() {
|
|
312
|
-
const wrapper = positionWithScroll(this.window.nativeElement, getDocumentElement(this.window.nativeElement));
|
|
313
|
-
this.options.left = wrapper.left;
|
|
314
|
-
this.options.top = wrapper.top;
|
|
315
|
-
}
|
|
316
|
-
setRestoreOption(style, value) {
|
|
317
|
-
if (isPresent(this.restoreOptions)) {
|
|
318
|
-
this.restoreOptions[style] = value;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
get nextPossibleZIndex() {
|
|
322
|
-
return newZIndex;
|
|
323
|
-
}
|
|
324
|
-
get nextZIndex() {
|
|
325
|
-
return newZIndex++;
|
|
326
|
-
}
|
|
327
|
-
get windowViewPort() {
|
|
328
|
-
return getWindowViewPort(this.window.nativeElement);
|
|
329
|
-
}
|
|
330
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DragResizeService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
331
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DragResizeService });
|
|
332
|
-
}
|
|
333
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DragResizeService, decorators: [{
|
|
334
|
-
type: Injectable
|
|
335
|
-
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export * from './window-close-result';
|
|
6
|
-
export * from './window-messages';
|
|
7
|
-
export * from './window-options';
|
|
8
|
-
export * from './window-ref';
|
|
9
|
-
export * from './window-settings';
|
|
10
|
-
export * from './window-types';
|
|
11
|
-
export * from './theme-color';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* Indicates that the **Close** button of a Window opened through `WindowService` is clicked.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export class WindowCloseResult {
|
|
10
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* Holds references to the Window instance. Controls Windows opened through `WindowService`. ([See example.]({% slug api_dialog_windowservice %}#toc-open))
|
|
7
|
-
*/
|
|
8
|
-
export class WindowRef {
|
|
9
|
-
/**
|
|
10
|
-
* Represents a reference to the Window instance.
|
|
11
|
-
*/
|
|
12
|
-
window;
|
|
13
|
-
/**
|
|
14
|
-
* Represents a reference to the child component of the Window. Available when you open the Window with [component content](slug:service_window#toc-rendering-the-content-area).
|
|
15
|
-
*/
|
|
16
|
-
content;
|
|
17
|
-
/**
|
|
18
|
-
* Allows you to close the Window by using code. When called with no arguments, the `result` Observable is of type `WindowCloseResult`. When called with an argument, the `result` Observable holds the provided value.
|
|
19
|
-
*/
|
|
20
|
-
close;
|
|
21
|
-
/**
|
|
22
|
-
* Emits events when the Window is closed through the `Esc` key, the **Close** button of the title bar, or by calling the `close` method. When the Window is closed with the title bar button, `Esc`, or by calling `close` with no arguments, the result is of type [`WindowCloseResult`]({% slug api_dialog_windowcloseresult %}). When `close` is called with an argument, the result is the passed argument.
|
|
23
|
-
*/
|
|
24
|
-
result;
|
|
25
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* Represents the settings for the Window actions when you open a Window through `WindowService`. ([See example.]({% slug api_dialog_windowservice %}#toc-open))
|
|
7
|
-
*/
|
|
8
|
-
export class WindowSettings {
|
|
9
|
-
/**
|
|
10
|
-
* Use the `preventClose` predicate to check if closing the Window should be prevented. Applies to clicking the **Close** button, pressing **Esc**, or calling the `close` method. Return `true` to prevent closing. If the **Close** button or **Esc** is used, a [`WindowCloseResult`]({% slug api_dialog_windowcloseresult %}) instance is passed.
|
|
11
|
-
* @param {any} ev The event argument.
|
|
12
|
-
* @param {WindowRef} [windowRef] - The window reference, provided only when you create the window using a component.
|
|
13
|
-
* @returns Returns `true` to prevent closing the window.
|
|
14
|
-
*/
|
|
15
|
-
preventClose;
|
|
16
|
-
/**
|
|
17
|
-
* Sets the Window `title`.
|
|
18
|
-
*/
|
|
19
|
-
title;
|
|
20
|
-
/**
|
|
21
|
-
* Defines the Window `content`.
|
|
22
|
-
*/
|
|
23
|
-
content;
|
|
24
|
-
/**
|
|
25
|
-
* Defines the content of the title bar.
|
|
26
|
-
*/
|
|
27
|
-
titleBarContent;
|
|
28
|
-
/**
|
|
29
|
-
* Sets the text of the labels shown in the Window. Use for localization.
|
|
30
|
-
*/
|
|
31
|
-
messages;
|
|
32
|
-
/**
|
|
33
|
-
* Set to `true` to persist the Window content in the DOM when minimized.
|
|
34
|
-
*/
|
|
35
|
-
keepContent;
|
|
36
|
-
/**
|
|
37
|
-
* Sets the width of the Window in pixels.
|
|
38
|
-
*/
|
|
39
|
-
width;
|
|
40
|
-
/**
|
|
41
|
-
* Sets the minimum width of the Window in pixels.
|
|
42
|
-
*/
|
|
43
|
-
minWidth;
|
|
44
|
-
/**
|
|
45
|
-
* Sets the height of the Window in pixels.
|
|
46
|
-
*/
|
|
47
|
-
height;
|
|
48
|
-
/**
|
|
49
|
-
* Sets the minimum height of the Window in pixels.
|
|
50
|
-
*/
|
|
51
|
-
minHeight;
|
|
52
|
-
/**
|
|
53
|
-
* Sets the left offset of the Window in pixels.
|
|
54
|
-
*/
|
|
55
|
-
left;
|
|
56
|
-
/**
|
|
57
|
-
* Sets the top offset of the Window in pixels.
|
|
58
|
-
*/
|
|
59
|
-
top;
|
|
60
|
-
/**
|
|
61
|
-
* Specifies is the Window is draggable.
|
|
62
|
-
*/
|
|
63
|
-
draggable;
|
|
64
|
-
/**
|
|
65
|
-
* Sets custom CSS classes for the Window wrapper element. Accepts any value supported by [`ngClass`](link:site.data.urls.angular['ngclassapi']).
|
|
66
|
-
*/
|
|
67
|
-
cssClass;
|
|
68
|
-
/**
|
|
69
|
-
* Sets HTML attributes for the Window wrapper element. Accepts string key-value pairs.
|
|
70
|
-
*/
|
|
71
|
-
htmlAttributes;
|
|
72
|
-
/**
|
|
73
|
-
* Specifies if the Window is resizable.
|
|
74
|
-
*/
|
|
75
|
-
resizable;
|
|
76
|
-
/**
|
|
77
|
-
* Sets the initial state of the Window.
|
|
78
|
-
*/
|
|
79
|
-
state;
|
|
80
|
-
/**
|
|
81
|
-
* Defines the container where the Window is inserted. This changes the place in the page hierarchy where the Window appears.
|
|
82
|
-
*/
|
|
83
|
-
appendTo;
|
|
84
|
-
/**
|
|
85
|
-
* Sets the query selector for the element to focus automatically.
|
|
86
|
-
*/
|
|
87
|
-
autoFocusedElement;
|
|
88
|
-
/**
|
|
89
|
-
* Sets the theme color of the Window.
|
|
90
|
-
*/
|
|
91
|
-
themeColor;
|
|
92
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|