@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,206 +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 { ComponentFactoryResolver, Injectable, Renderer2, TemplateRef, Inject } from '@angular/core';
|
|
6
|
-
import { merge, Subject } from 'rxjs';
|
|
7
|
-
import { filter, map, share, take } from 'rxjs/operators';
|
|
8
|
-
import { WindowComponent } from './window.component';
|
|
9
|
-
import { isPresent, isString } from '../common/util';
|
|
10
|
-
import { WindowContainerService } from '../window/window-container.service';
|
|
11
|
-
import { WindowRef } from './models/window-ref';
|
|
12
|
-
import { WindowCloseResult } from './models/window-close-result';
|
|
13
|
-
import * as i0 from "@angular/core";
|
|
14
|
-
import * as i1 from "../window/window-container.service";
|
|
15
|
-
const isNotComponent = (component) => isString(component) || component instanceof TemplateRef;
|
|
16
|
-
class WindowInjector {
|
|
17
|
-
getWindowRef;
|
|
18
|
-
parentInjector;
|
|
19
|
-
constructor(getWindowRef, parentInjector) {
|
|
20
|
-
this.getWindowRef = getWindowRef;
|
|
21
|
-
this.parentInjector = parentInjector;
|
|
22
|
-
}
|
|
23
|
-
get(token, notFoundValue) {
|
|
24
|
-
if (token === WindowRef) {
|
|
25
|
-
return this.getWindowRef();
|
|
26
|
-
}
|
|
27
|
-
return this.parentInjector.get(token, notFoundValue);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Provides methods for opening Windows dynamically.
|
|
32
|
-
*
|
|
33
|
-
* Use this service to open a Window component and manage its lifecycle. ([See example.]({% slug service_window %}))
|
|
34
|
-
*/
|
|
35
|
-
export class WindowService {
|
|
36
|
-
resolver;
|
|
37
|
-
containerService;
|
|
38
|
-
constructor(
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
resolver, containerService) {
|
|
43
|
-
this.resolver = resolver;
|
|
44
|
-
this.containerService = containerService;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Opens a Window component with the specified settings.
|
|
48
|
-
*
|
|
49
|
-
* @param settings The settings that configure the Window.
|
|
50
|
-
* @returns A `WindowRef` instance for controlling the Window.
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* const window = windowService.open({
|
|
55
|
-
* title: 'My window',
|
|
56
|
-
* content: 'My content!'
|
|
57
|
-
* });
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
open(settings) {
|
|
61
|
-
const factory = this.resolver.resolveComponentFactory(WindowComponent);
|
|
62
|
-
const container = settings.appendTo || this.containerService.container;
|
|
63
|
-
if (!container) {
|
|
64
|
-
throw new Error(`Cannot attach window to the page.
|
|
65
|
-
Add an element that uses the kendoWindowContainer directive, or set the 'appendTo' property.
|
|
66
|
-
See https://www.telerik.com/kendo-angular-ui/components/dialogs/window/service/
|
|
67
|
-
`);
|
|
68
|
-
}
|
|
69
|
-
const windowRef = {
|
|
70
|
-
close: () => { },
|
|
71
|
-
content: null,
|
|
72
|
-
result: null,
|
|
73
|
-
window: null
|
|
74
|
-
};
|
|
75
|
-
const content = this.contentFrom(settings.content, container, windowRef);
|
|
76
|
-
const window = container.createComponent(factory, undefined, undefined, content.nodes);
|
|
77
|
-
windowRef.window = window;
|
|
78
|
-
this.applyOptions(window.instance, settings);
|
|
79
|
-
const apiClose = new Subject();
|
|
80
|
-
const close = (e) => {
|
|
81
|
-
apiClose.next(e || new WindowCloseResult());
|
|
82
|
-
if (content.componentRef) {
|
|
83
|
-
content.componentRef.destroy();
|
|
84
|
-
}
|
|
85
|
-
window.destroy();
|
|
86
|
-
};
|
|
87
|
-
const result = merge(apiClose, window.instance.close.pipe(map(e => (e ? e : new WindowCloseResult())), filter((e) => {
|
|
88
|
-
if (settings.preventClose) {
|
|
89
|
-
// add windowRef only when using component
|
|
90
|
-
const windowRefParameter = isNotComponent(settings.content) ? undefined : windowRef;
|
|
91
|
-
return !settings.preventClose(e, windowRefParameter);
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
}))).pipe(take(1),
|
|
95
|
-
// Takes care for multiple subscriptions:
|
|
96
|
-
// We subscribe internally and the user may subscribe to get a close result - window.result.subscribe().
|
|
97
|
-
// This causes multiple subscriptions to the same source and thus multiple emissions. share() solves that.
|
|
98
|
-
share());
|
|
99
|
-
result.subscribe(close);
|
|
100
|
-
windowRef.close = close;
|
|
101
|
-
windowRef.result = result;
|
|
102
|
-
window.changeDetectorRef.markForCheck();
|
|
103
|
-
return windowRef;
|
|
104
|
-
}
|
|
105
|
-
applyOptions(instance, options) {
|
|
106
|
-
if (isPresent(options.htmlAttributes)) {
|
|
107
|
-
instance.htmlAttributes = options.htmlAttributes;
|
|
108
|
-
}
|
|
109
|
-
if (isPresent(options.cssClass)) {
|
|
110
|
-
instance.cssClass = options.cssClass;
|
|
111
|
-
}
|
|
112
|
-
if (isPresent(options.title)) {
|
|
113
|
-
instance.title = options.title;
|
|
114
|
-
}
|
|
115
|
-
if (isPresent(options.keepContent)) {
|
|
116
|
-
instance.keepContent = options.keepContent;
|
|
117
|
-
}
|
|
118
|
-
if (isPresent(options.width)) {
|
|
119
|
-
instance.width = options.width;
|
|
120
|
-
}
|
|
121
|
-
if (isPresent(options.minWidth)) {
|
|
122
|
-
instance.minWidth = options.minWidth;
|
|
123
|
-
}
|
|
124
|
-
if (isPresent(options.height)) {
|
|
125
|
-
instance.height = options.height;
|
|
126
|
-
}
|
|
127
|
-
if (isPresent(options.minHeight)) {
|
|
128
|
-
instance.minHeight = options.minHeight;
|
|
129
|
-
}
|
|
130
|
-
if (isPresent(options.left)) {
|
|
131
|
-
instance.left = options.left;
|
|
132
|
-
}
|
|
133
|
-
if (isPresent(options.top)) {
|
|
134
|
-
instance.top = options.top;
|
|
135
|
-
}
|
|
136
|
-
if (isPresent(options.draggable)) {
|
|
137
|
-
instance.draggable = options.draggable;
|
|
138
|
-
}
|
|
139
|
-
if (isPresent(options.resizable)) {
|
|
140
|
-
instance.resizable = options.resizable;
|
|
141
|
-
}
|
|
142
|
-
if (isPresent(options.messages && options.messages.closeTitle)) {
|
|
143
|
-
instance.messages.closeTitle = options.messages.closeTitle;
|
|
144
|
-
}
|
|
145
|
-
if (isPresent(options.messages && options.messages.restoreTitle)) {
|
|
146
|
-
instance.messages.restoreTitle = options.messages.restoreTitle;
|
|
147
|
-
}
|
|
148
|
-
if (isPresent(options.messages && options.messages.maximizeTitle)) {
|
|
149
|
-
instance.messages.maximizeTitle = options.messages.maximizeTitle;
|
|
150
|
-
}
|
|
151
|
-
if (isPresent(options.messages && options.messages.minimizeTitle)) {
|
|
152
|
-
instance.messages.minimizeTitle = options.messages.minimizeTitle;
|
|
153
|
-
}
|
|
154
|
-
if (isPresent(options.autoFocusedElement)) {
|
|
155
|
-
instance.autoFocusedElement = options.autoFocusedElement;
|
|
156
|
-
}
|
|
157
|
-
if (isPresent(options.state)) {
|
|
158
|
-
instance.state = options.state;
|
|
159
|
-
if (options.state === 'minimized') {
|
|
160
|
-
instance.keepContent = true;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (isPresent(options.themeColor)) {
|
|
164
|
-
instance.themeColor = options.themeColor;
|
|
165
|
-
}
|
|
166
|
-
if (options.content instanceof TemplateRef) {
|
|
167
|
-
instance.contentTemplate = options.content;
|
|
168
|
-
}
|
|
169
|
-
if (options.titleBarContent instanceof TemplateRef) {
|
|
170
|
-
instance.titleBarTemplate = options.titleBarContent;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
contentFrom(content, container, windowRef) {
|
|
174
|
-
const renderer = container.injector.get(Renderer2);
|
|
175
|
-
let nodes = [];
|
|
176
|
-
let componentRef = null;
|
|
177
|
-
if (typeof content === 'string') {
|
|
178
|
-
nodes = [renderer.createText(content)];
|
|
179
|
-
}
|
|
180
|
-
else if (content && !(content instanceof TemplateRef)) {
|
|
181
|
-
const injector = new WindowInjector(() => windowRef, container.injector);
|
|
182
|
-
const factory = this.resolver.resolveComponentFactory(content);
|
|
183
|
-
componentRef = container.createComponent(factory, undefined, injector);
|
|
184
|
-
nodes = [componentRef.location.nativeElement];
|
|
185
|
-
windowRef.content = componentRef;
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
componentRef,
|
|
189
|
-
nodes: [
|
|
190
|
-
[], // TitleBar
|
|
191
|
-
nodes // Content
|
|
192
|
-
]
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowService, deps: [{ token: i0.ComponentFactoryResolver }, { token: WindowContainerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
196
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowService, providedIn: 'root' });
|
|
197
|
-
}
|
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowService, decorators: [{
|
|
199
|
-
type: Injectable,
|
|
200
|
-
args: [{
|
|
201
|
-
providedIn: 'root'
|
|
202
|
-
}]
|
|
203
|
-
}], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i1.WindowContainerService, decorators: [{
|
|
204
|
-
type: Inject,
|
|
205
|
-
args: [WindowContainerService]
|
|
206
|
-
}] }] });
|
|
@@ -1,53 +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 { NgModule } from "@angular/core";
|
|
6
|
-
import { IconsService } from "@progress/kendo-angular-icons";
|
|
7
|
-
import { WindowService } from './window/window.service';
|
|
8
|
-
import { WindowContainerService } from './window/window-container.service';
|
|
9
|
-
import { KENDO_WINDOW } from "./directives";
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "./window/window.component";
|
|
12
|
-
import * as i2 from "./window/actions/window-close-action.directive";
|
|
13
|
-
import * as i3 from "./window/actions/window-minimize-action.directive";
|
|
14
|
-
import * as i4 from "./window/actions/window-maximize-action.directive";
|
|
15
|
-
import * as i5 from "./window/actions/window-restore-action.directive";
|
|
16
|
-
import * as i6 from "./window/window-titlebar.component";
|
|
17
|
-
import * as i7 from "./window/window-container.directive";
|
|
18
|
-
import * as i8 from "./dialog/dialog-actions.component";
|
|
19
|
-
import * as i9 from "./localization/custom-messages.component";
|
|
20
|
-
//IMPORTANT: NgModule export kept for backwards compatibility
|
|
21
|
-
/**
|
|
22
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the Window component.
|
|
23
|
-
*
|
|
24
|
-
* Use the `WindowModule` to include all Window components and directives in your application.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* import { NgModule } from '@angular/core';
|
|
29
|
-
* import { BrowserModule } from '@angular/platform-browser';
|
|
30
|
-
* import { WindowModule } from '@progress/kendo-angular-window';
|
|
31
|
-
* import { AppComponent } from './app.component';
|
|
32
|
-
*
|
|
33
|
-
* @NgModule({
|
|
34
|
-
* bootstrap: [AppComponent],
|
|
35
|
-
* declarations: [AppComponent],
|
|
36
|
-
* imports: [BrowserModule, WindowModule]
|
|
37
|
-
* })
|
|
38
|
-
* export class AppModule {}
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export class WindowModule {
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
43
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: WindowModule, imports: [i1.WindowComponent, i2.WindowCloseActionDirective, i3.WindowMinimizeActionDirective, i4.WindowMaximizeActionDirective, i5.WindowRestoreActionDirective, i6.WindowTitleBarComponent, i7.WindowContainerDirective, i8.DialogActionsComponent, i9.CustomMessagesComponent], exports: [i1.WindowComponent, i2.WindowCloseActionDirective, i3.WindowMinimizeActionDirective, i4.WindowMaximizeActionDirective, i5.WindowRestoreActionDirective, i6.WindowTitleBarComponent, i7.WindowContainerDirective, i8.DialogActionsComponent, i9.CustomMessagesComponent] });
|
|
44
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowModule, providers: [WindowContainerService, WindowService, IconsService], imports: [i1.WindowComponent, i2.WindowCloseActionDirective, i3.WindowMinimizeActionDirective, i4.WindowMaximizeActionDirective, i5.WindowRestoreActionDirective, i8.DialogActionsComponent] });
|
|
45
|
-
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WindowModule, decorators: [{
|
|
47
|
-
type: NgModule,
|
|
48
|
-
args: [{
|
|
49
|
-
imports: [...KENDO_WINDOW],
|
|
50
|
-
exports: [...KENDO_WINDOW],
|
|
51
|
-
providers: [WindowContainerService, WindowService, IconsService]
|
|
52
|
-
}]
|
|
53
|
-
}] });
|