@progress/kendo-angular-dialog 19.1.2-develop.1 → 19.1.2-develop.3
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/common/actions-layout.d.ts +4 -1
- package/common/animation-types.d.ts +3 -0
- package/common/dialog-animation-direction.d.ts +3 -0
- package/common/preventable-event.d.ts +4 -0
- package/dialog/dialog-actions.component.d.ts +5 -4
- package/dialog/dialog-container.directive.d.ts +3 -4
- package/dialog/dialog-content-base.d.ts +3 -2
- package/dialog/dialog-titlebar.component.d.ts +3 -2
- package/dialog/dialog.component.d.ts +56 -33
- package/dialog/dialog.service.d.ts +15 -36
- package/dialog/models/dialog-action-divider.d.ts +4 -1
- package/dialog/models/dialog-action.d.ts +10 -9
- package/dialog/models/dialog-animation.d.ts +7 -4
- package/dialog/models/dialog-close-result.d.ts +4 -3
- package/dialog/models/dialog-ref.d.ts +8 -16
- package/dialog/models/dialog-result.d.ts +5 -5
- package/dialog/models/dialog-settings.d.ts +33 -44
- package/dialog/models/theme-color.d.ts +6 -5
- package/dialog.module.d.ts +6 -8
- package/dialogs.module.d.ts +5 -9
- package/directives.d.ts +54 -6
- package/esm2022/common/preventable-event.mjs +4 -0
- package/esm2022/dialog/dialog-actions.component.mjs +5 -4
- package/esm2022/dialog/dialog-container.directive.mjs +3 -4
- package/esm2022/dialog/dialog-content-base.mjs +3 -2
- package/esm2022/dialog/dialog-titlebar.component.mjs +3 -2
- package/esm2022/dialog/dialog.component.mjs +56 -33
- package/esm2022/dialog/dialog.service.mjs +15 -36
- package/esm2022/dialog/models/dialog-action.mjs +10 -9
- package/esm2022/dialog/models/dialog-close-result.mjs +4 -3
- package/esm2022/dialog/models/dialog-ref.mjs +8 -16
- package/esm2022/dialog/models/dialog-settings.mjs +33 -44
- package/esm2022/dialog.module.mjs +6 -8
- package/esm2022/dialogs.module.mjs +5 -9
- package/esm2022/directives.mjs +54 -6
- package/esm2022/localization/custom-messages.component.mjs +23 -2
- package/esm2022/localization/messages.mjs +4 -4
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/window/models/window-close-result.mjs +2 -1
- package/esm2022/window/models/window-ref.mjs +5 -16
- package/esm2022/window/models/window-settings.mjs +20 -29
- package/esm2022/window/window-container.directive.mjs +3 -4
- package/esm2022/window/window-titlebar.component.mjs +4 -0
- package/esm2022/window/window.component.mjs +29 -46
- package/esm2022/window/window.service.mjs +11 -31
- package/esm2022/window.module.mjs +6 -8
- package/fesm2022/progress-kendo-angular-dialog.mjs +318 -319
- package/localization/custom-messages.component.d.ts +23 -2
- package/localization/messages.d.ts +4 -4
- package/package.json +7 -7
- package/schematics/ngAdd/index.js +1 -1
- package/window/models/theme-color.d.ts +1 -1
- package/window/models/window-close-result.d.ts +2 -1
- package/window/models/window-messages.d.ts +2 -2
- package/window/models/window-ref.d.ts +5 -16
- package/window/models/window-settings.d.ts +20 -29
- package/window/window-container.directive.d.ts +3 -4
- package/window/window-titlebar.component.d.ts +4 -0
- package/window/window.component.d.ts +29 -46
- package/window/window.service.d.ts +11 -31
- package/window.module.d.ts +6 -8
@@ -9,106 +9,95 @@ import { DialogRef } from "./dialog-ref";
|
|
9
9
|
import { DialogResult } from "./dialog-result";
|
10
10
|
import { DialogThemeColor } from "./theme-color";
|
11
11
|
/**
|
12
|
-
*
|
13
|
-
* ([
|
12
|
+
* Represents the settings for opening a Dialog through the `DialogService`.
|
13
|
+
* ([See example.]({% slug api_dialog_dialogservice %}#toc-open))
|
14
|
+
*
|
14
15
|
*/
|
15
16
|
export declare class DialogSettings {
|
16
17
|
/**
|
17
|
-
*
|
18
|
-
* If the **Close** button
|
19
|
-
* If the
|
20
|
-
* @param {DialogResult} ev
|
21
|
-
* @param {DialogRef} [dialogRef]
|
22
|
-
* @returns
|
18
|
+
* Use the `preventAction` callback to check if the pressed Dialog action should be prevented. If `true`, the Dialog does not close.
|
19
|
+
* If the **Close** button in the title bar is clicked, `DialogResult` is a `DialogCloseResult` instance.
|
20
|
+
* If the action buttons are used to close the Dialog, `DialogResult` contains the object passed when opening the Dialog. ([See example.](slug:service_dialog#toc-dialog-close-prevention))
|
21
|
+
* @param {DialogResult} ev The Dialog result.
|
22
|
+
* @param {DialogRef} [dialogRef] The Dialog reference, provided only when you create the Dialog using a component.
|
23
|
+
* @returns Returns `true` to prevent closing the Dialog.
|
23
24
|
*/
|
24
25
|
preventAction?: (ev: DialogResult, dialogRef?: DialogRef) => boolean;
|
25
26
|
/**
|
26
|
-
* Sets the title
|
27
|
-
* the Dialog will not render a **Close** button.
|
27
|
+
* Sets the Dialog `title`. If you omit `title`, the Dialog does not render a **Close** button.
|
28
28
|
*/
|
29
29
|
title?: string;
|
30
30
|
/**
|
31
|
-
* Sets the CSS classes
|
32
|
-
* Supports the union type of values that NgClass accepts [ngClass](link:site.data.urls.angular['ngclassapi']).
|
31
|
+
* Sets the CSS classes for the Dialog wrapper element. Accepts any value supported by [`ngClass`](link:site.data.urls.angular['ngclassapi']).
|
33
32
|
*/
|
34
33
|
cssClass?: any;
|
35
34
|
/**
|
36
|
-
* Configures the Dialog opening animation ([see example]({% slug animations_dialog %})).
|
37
|
-
*
|
35
|
+
* Configures the Dialog opening `animation` ([see example]({% slug animations_dialog %})).
|
36
|
+
* @default { type: 'translate', duration: 300 }
|
38
37
|
*/
|
39
38
|
animation?: boolean | DialogAnimation;
|
40
39
|
/**
|
41
|
-
* Sets the HTML attributes
|
42
|
-
* The property accepts string key-value based pairs.
|
40
|
+
* Sets the HTML attributes for the Dialog wrapper element. Accepts string key-value pairs.
|
43
41
|
*/
|
44
42
|
htmlAttributes?: {
|
45
43
|
[key: string]: string;
|
46
44
|
};
|
47
45
|
/**
|
48
|
-
* Defines the content
|
49
|
-
* ([see example](slug:service_dialog#toc-rendering-the-content-area)).
|
46
|
+
* Defines the Dialog `content`. ([See example.](slug:service_dialog#toc-rendering-the-content-area))
|
50
47
|
*/
|
51
48
|
content?: string | TemplateRef<any> | Function;
|
52
49
|
/**
|
53
|
-
*
|
54
|
-
*
|
55
|
-
* A string value sets the width in arbitrary units—for example, `50%`.
|
50
|
+
* Sets the width of the Dialog.
|
51
|
+
* Use a number for pixels or a string for other units, for example, `50%`.
|
56
52
|
*/
|
57
53
|
width?: number | string;
|
58
54
|
/**
|
59
|
-
*
|
60
|
-
*
|
61
|
-
* A string value sets the minimum width in arbitrary units—for example, `50%`.
|
55
|
+
* Sets the minimum width of the Dialog.
|
56
|
+
* Use a number for pixels or a string for other units, for example, `50%`.
|
62
57
|
*/
|
63
58
|
minWidth?: number | string;
|
64
59
|
/**
|
65
|
-
*
|
66
|
-
*
|
67
|
-
* A string value sets the maximum width in arbitrary units—for example, `50%`.
|
60
|
+
* Sets the maximum width of the Dialog.
|
61
|
+
* Use a number for pixels or a string for other units, for example, `50%`.
|
68
62
|
*/
|
69
63
|
maxWidth?: number | string;
|
70
64
|
/**
|
71
|
-
*
|
72
|
-
*
|
73
|
-
* A string value sets the height in arbitrary units—for example, `50%`.
|
65
|
+
* Sets the height of the Dialog.
|
66
|
+
* Use a number for pixels or a string for other units, for example, `50%`.
|
74
67
|
*/
|
75
68
|
height?: number | string;
|
76
69
|
/**
|
77
|
-
*
|
78
|
-
*
|
79
|
-
* A string value sets the minimum height in arbitrary units—for example, `50%`.
|
70
|
+
* Sets the minimum height of the Dialog.
|
71
|
+
* Use a number for pixels or a string for other units, for example, `50%`.
|
80
72
|
*/
|
81
73
|
minHeight?: number | string;
|
82
74
|
/**
|
83
|
-
*
|
84
|
-
*
|
85
|
-
* A string value sets the maximum height in arbitrary units—for example, `50%`.
|
75
|
+
* Sets the maximum height of the Dialog.
|
76
|
+
* Use a number for pixels or a string for other units, for example, `50%`.
|
86
77
|
*/
|
87
78
|
maxHeight?: number | string;
|
88
79
|
/**
|
89
|
-
* Defines the container in
|
90
|
-
* Specifying this option changes the place in the page hierarchy where the Dialog will be inserted.
|
91
|
-
* The styling of the component will remain the same.
|
80
|
+
* Defines the container where the Dialog is inserted. This changes the place in the page hierarchy where the Dialog appears. The component styling stays the same.
|
92
81
|
*/
|
93
82
|
appendTo?: ViewContainerRef;
|
94
83
|
/**
|
95
|
-
*
|
84
|
+
* Sets the `closeTitle` for the **Close** button.
|
96
85
|
*/
|
97
86
|
closeTitle?: string;
|
98
87
|
/**
|
99
|
-
* Sets the
|
88
|
+
* Sets the Dialog `actions` buttons.
|
100
89
|
*/
|
101
90
|
actions?: any[] | TemplateRef<any>;
|
102
91
|
/**
|
103
|
-
*
|
92
|
+
* Sets the layout of the Dialog action buttons with `actionsLayout`.
|
104
93
|
*/
|
105
94
|
actionsLayout?: ActionsLayout;
|
106
95
|
/**
|
107
|
-
* Sets the
|
96
|
+
* Sets the query selector for the element to focus automatically with `autoFocusedElement`.
|
108
97
|
*/
|
109
98
|
autoFocusedElement?: string;
|
110
99
|
/**
|
111
|
-
*
|
100
|
+
* Sets the theme color of the Dialog.
|
112
101
|
*/
|
113
102
|
themeColor?: DialogThemeColor;
|
114
103
|
}
|
@@ -3,11 +3,12 @@
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
5
|
/**
|
6
|
-
*
|
6
|
+
* Represents the possible theme colors for the Dialog.
|
7
|
+
*
|
8
|
+
* Use the `DialogThemeColor` type to set the color theme for Dialog components. The possible values are:
|
9
|
+
* - `primary` —Applies coloring based on the `primary` theme color.
|
10
|
+
* - `light`— Applies coloring based on the `light` theme color.
|
11
|
+
* - `dark`— Applies coloring based on the `dark` theme color.
|
7
12
|
*
|
8
|
-
* The possible values are:
|
9
|
-
* * `primary` —Applies coloring based on the `primary` theme color.
|
10
|
-
* * `light`— Applies coloring based on the `light` theme color.
|
11
|
-
* * `dark`— Applies coloring based on the `dark` theme color.
|
12
13
|
*/
|
13
14
|
export type DialogThemeColor = 'primary' | 'light' | 'dark';
|
package/dialog.module.d.ts
CHANGED
@@ -9,25 +9,23 @@ import * as i3 from "./dialog/dialog-container.directive";
|
|
9
9
|
import * as i4 from "./dialog/dialog-actions.component";
|
10
10
|
import * as i5 from "./localization/custom-messages.component";
|
11
11
|
/**
|
12
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
13
|
-
*
|
14
|
-
*
|
15
|
-
* of your application or into any other sub-module that will use the Dialog component.
|
12
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the Dialog component.
|
13
|
+
*
|
14
|
+
* Use the `DialogModule` to include all Dialog components and directives in your application.
|
16
15
|
*
|
17
16
|
* @example
|
18
|
-
* ```
|
17
|
+
* ```typescript
|
19
18
|
* import { NgModule } from '@angular/core';
|
20
19
|
* import { BrowserModule } from '@angular/platform-browser';
|
21
20
|
* import { DialogModule } from '@progress/kendo-angular-dialog';
|
22
21
|
* import { AppComponent } from './app.component';
|
23
22
|
*
|
24
|
-
*
|
23
|
+
* @NgModule({
|
25
24
|
* bootstrap: [AppComponent],
|
26
25
|
* declarations: [AppComponent],
|
27
26
|
* imports: [BrowserModule, DialogModule]
|
28
27
|
* })
|
29
|
-
* export class AppModule {
|
30
|
-
* }
|
28
|
+
* export class AppModule {}
|
31
29
|
* ```
|
32
30
|
*/
|
33
31
|
export declare class DialogModule {
|
package/dialogs.module.d.ts
CHANGED
@@ -16,28 +16,24 @@ import * as i10 from "./window/actions/window-restore-action.directive";
|
|
16
16
|
import * as i11 from "./window/window-titlebar.component";
|
17
17
|
import * as i12 from "./window/window-container.directive";
|
18
18
|
/**
|
19
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
20
|
-
* definition for the Dialogs components.
|
19
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the Dialogs components.
|
21
20
|
*
|
22
|
-
*
|
21
|
+
* Use the `DialogsModule` to include all Dialog and Window components and services in your application.
|
23
22
|
*
|
24
|
-
*
|
23
|
+
* @example
|
24
|
+
* ```typescript
|
25
25
|
* import { DialogsModule } from '@progress/kendo-angular-dialog';
|
26
|
-
*
|
27
26
|
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
28
27
|
* import { NgModule } from '@angular/core';
|
29
|
-
*
|
30
28
|
* import { AppComponent } from './app.component';
|
31
29
|
*
|
32
|
-
*
|
30
|
+
* @NgModule({
|
33
31
|
* declarations: [AppComponent],
|
34
32
|
* imports: [BrowserModule, DialogsModule],
|
35
33
|
* bootstrap: [AppComponent]
|
36
34
|
* })
|
37
35
|
* export class AppModule {}
|
38
36
|
*
|
39
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
40
|
-
*
|
41
37
|
* ```
|
42
38
|
*/
|
43
39
|
export declare class DialogsModule {
|
package/directives.d.ts
CHANGED
@@ -15,14 +15,62 @@ import { WindowContainerDirective } from "./window/window-container.directive";
|
|
15
15
|
import { WindowTitleBarComponent } from "./window/window-titlebar.component";
|
16
16
|
import { WindowComponent } from "./window/window.component";
|
17
17
|
/**
|
18
|
-
*
|
19
|
-
|
18
|
+
* Represents the utility array that that contains all `Dialog`-related components and directives.
|
19
|
+
*
|
20
|
+
* Use `KENDO_DIALOG` to import all Dialog components and directives at once.
|
21
|
+
*
|
22
|
+
* @example
|
23
|
+
* ```typescript
|
24
|
+
* import { Component } from '@angular/core';
|
25
|
+
* import { KENDO_DIALOG } from '@progress/kendo-angular-dialog';
|
26
|
+
*
|
27
|
+
* @Component({
|
28
|
+
* selector: 'my-dialog-app',
|
29
|
+
* standalone: true,
|
30
|
+
* imports: [KENDO_DIALOG],
|
31
|
+
* template: `...`
|
32
|
+
* })
|
33
|
+
* export class DialogAppComponent {}
|
34
|
+
* ```
|
35
|
+
*/
|
20
36
|
export declare const KENDO_DIALOG: readonly [typeof DialogComponent, typeof DialogTitleBarComponent, typeof DialogContainerDirective, typeof DialogActionsComponent, typeof CustomMessagesComponent];
|
21
37
|
/**
|
22
|
-
*
|
23
|
-
|
38
|
+
* Represents the utility array that contains all `Window`-related components and directives.
|
39
|
+
*
|
40
|
+
* Use `KENDO_WINDOW` to import all Window components and directives at once.
|
41
|
+
*
|
42
|
+
* @example
|
43
|
+
* ```typescript
|
44
|
+
* import { Component } from '@angular/core';
|
45
|
+
* import { KENDO_WINDOW } from '@progress/kendo-angular-dialog';
|
46
|
+
*
|
47
|
+
* @Component({
|
48
|
+
* selector: 'my-window-app',
|
49
|
+
* standalone: true,
|
50
|
+
* imports: [KENDO_WINDOW],
|
51
|
+
* template: `...`
|
52
|
+
* })
|
53
|
+
* export class WindowAppComponent {}
|
54
|
+
* ```
|
55
|
+
*/
|
24
56
|
export declare const KENDO_WINDOW: readonly [typeof WindowComponent, typeof WindowCloseActionDirective, typeof WindowMinimizeActionDirective, typeof WindowMaximizeActionDirective, typeof WindowRestoreActionDirective, typeof WindowTitleBarComponent, typeof WindowContainerDirective, typeof DialogActionsComponent, typeof CustomMessagesComponent];
|
25
57
|
/**
|
26
|
-
*
|
27
|
-
|
58
|
+
* Represents the utility array that contains all `@progress/kendo-angular-dialog`-related components and directives.
|
59
|
+
*
|
60
|
+
* Use `KENDO_DIALOGS` to import all Dialog and Window components and directives at once.
|
61
|
+
*
|
62
|
+
* @example
|
63
|
+
* ```typescript
|
64
|
+
* import { Component } from '@angular/core';
|
65
|
+
* import { KENDO_DIALOGS } from '@progress/kendo-angular-dialog';
|
66
|
+
*
|
67
|
+
* @Component({
|
68
|
+
* selector: 'my-app',
|
69
|
+
* standalone: true,
|
70
|
+
* imports: [KENDO_DIALOGS],
|
71
|
+
* template: `...`
|
72
|
+
* })
|
73
|
+
* export class AppComponent {}
|
74
|
+
* ```
|
75
|
+
*/
|
28
76
|
export declare const KENDO_DIALOGS: readonly [typeof DialogComponent, typeof DialogTitleBarComponent, typeof DialogContainerDirective, typeof DialogActionsComponent, typeof CustomMessagesComponent, typeof WindowComponent, typeof WindowCloseActionDirective, typeof WindowMinimizeActionDirective, typeof WindowMaximizeActionDirective, typeof WindowRestoreActionDirective, typeof WindowTitleBarComponent, typeof WindowContainerDirective, typeof DialogActionsComponent, typeof CustomMessagesComponent];
|
@@ -2,6 +2,10 @@
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
|
+
/**
|
6
|
+
* Represents a preventable event in Dialog and Window components.
|
7
|
+
*
|
8
|
+
*/
|
5
9
|
export class PreventableEvent {
|
6
10
|
prevented = false;
|
7
11
|
/**
|
@@ -8,13 +8,14 @@ import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
|
|
8
8
|
import * as i0 from "@angular/core";
|
9
9
|
import * as i1 from "@progress/kendo-angular-buttons";
|
10
10
|
/**
|
11
|
-
*
|
12
|
-
* ([
|
11
|
+
* Represents the action buttons of the Dialog.
|
12
|
+
* ([See example.]({% slug actionbuttons_dialog %}))
|
13
|
+
*
|
13
14
|
*/
|
14
15
|
export class DialogActionsComponent {
|
15
16
|
el;
|
16
17
|
/**
|
17
|
-
* Allows the declarative specification of the actions
|
18
|
+
* Allows the declarative specification of the Dialog `actions`.
|
18
19
|
*/
|
19
20
|
set actions(value) {
|
20
21
|
if (value instanceof TemplateRef) {
|
@@ -36,7 +37,7 @@ export class DialogActionsComponent {
|
|
36
37
|
*/
|
37
38
|
actionsTemplate;
|
38
39
|
/**
|
39
|
-
*
|
40
|
+
* Sets the possible layout of the action buttons.
|
40
41
|
* @default 'stretched'
|
41
42
|
*/
|
42
43
|
layout = 'stretched';
|
@@ -7,12 +7,11 @@ import { DialogContainerService } from './dialog-container.service';
|
|
7
7
|
import * as i0 from "@angular/core";
|
8
8
|
import * as i1 from "./dialog-container.service";
|
9
9
|
/**
|
10
|
-
*
|
11
|
-
*
|
12
|
-
* Created Dialogs will be mounted after that element.
|
10
|
+
* Represents an insertion point for Dialogs created through the Dialog service.
|
11
|
+
* The created Dialogs mount after this element. ([See example.]({% slug api_dialog_dialogservice %}#toc-open))
|
13
12
|
*
|
14
13
|
* @example
|
15
|
-
* ```html
|
14
|
+
* ```html
|
16
15
|
* <div kendoDialogContainer></div>
|
17
16
|
* ```
|
18
17
|
*/
|
@@ -10,8 +10,9 @@ import { filter } from 'rxjs/operators';
|
|
10
10
|
import * as i0 from "@angular/core";
|
11
11
|
import * as i1 from "./models/dialog-ref";
|
12
12
|
/**
|
13
|
-
*
|
14
|
-
* ([
|
13
|
+
* Serves as the base class for a component provided as Dialog content through the `content` property.
|
14
|
+
* ([See example.](slug:service_dialog#toc-single-component-rendering)).
|
15
|
+
*
|
15
16
|
*/
|
16
17
|
export class DialogContentBase {
|
17
18
|
dialog;
|
@@ -15,14 +15,15 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
15
15
|
/**
|
16
16
|
* Represents the [Kendo UI DialogTitleBar component for Angular]({% slug api_dialog_dialogtitlebarcomponent %}).
|
17
17
|
*
|
18
|
-
*
|
18
|
+
* Use this component as part of the Dialog content when you create the Dialog dynamically with an [Angular service]({% slug service_dialog %}).
|
19
|
+
*
|
19
20
|
*/
|
20
21
|
export class DialogTitleBarComponent {
|
21
22
|
zone;
|
22
23
|
hostElement;
|
23
24
|
localizationService;
|
24
25
|
/**
|
25
|
-
* Fires when the close button
|
26
|
+
* Fires when the close button in the title bar is clicked.
|
26
27
|
*/
|
27
28
|
close = new EventEmitter();
|
28
29
|
/**
|
@@ -25,6 +25,23 @@ import * as i2 from "@angular/animations";
|
|
25
25
|
const DEFAULT_ANIMATION_CONFIG = { duration: 300, type: 'translate' };
|
26
26
|
/**
|
27
27
|
* Represents the [Kendo UI Dialog component for Angular]({% slug overview_dialog_dialogs %}).
|
28
|
+
*
|
29
|
+
* Use this component to display modal dialog windows in your application.
|
30
|
+
*
|
31
|
+
* @example
|
32
|
+
* ```ts
|
33
|
+
* import { Component } from '@angular/core';
|
34
|
+
*
|
35
|
+
* @Component({
|
36
|
+
* selector: 'my-app',
|
37
|
+
* template: `
|
38
|
+
* <kendo-dialog title="Example Dialog">
|
39
|
+
* <p>Dialog content goes here.</p>
|
40
|
+
* </kendo-dialog>
|
41
|
+
* `
|
42
|
+
* })
|
43
|
+
* export class AppComponent {}
|
44
|
+
* ```
|
28
45
|
*/
|
29
46
|
export class DialogComponent {
|
30
47
|
wrapper;
|
@@ -33,75 +50,78 @@ export class DialogComponent {
|
|
33
50
|
ngZone;
|
34
51
|
builder;
|
35
52
|
/**
|
36
|
-
* Specifies the action buttons
|
53
|
+
* Specifies the action buttons to render in the Dialog.
|
54
|
+
*
|
55
|
+
* @type {DialogAction[]}
|
37
56
|
*/
|
38
57
|
actions;
|
39
58
|
/**
|
40
|
-
*
|
41
|
-
* This option is only applicable if the action buttons are specified through the `actions` options.
|
59
|
+
* Sets the layout of the action buttons in the Dialog. Applies only if you specify action buttons through the `actions` option.
|
42
60
|
*
|
61
|
+
* @type {ActionsLayout}
|
43
62
|
* @default 'stretched'
|
44
63
|
*/
|
45
64
|
actionsLayout = 'stretched';
|
46
65
|
/**
|
47
|
-
*
|
66
|
+
* Sets the query selector for the element to receive initial focus. ([See examples.]({% slug initial_focus_dialog %}))
|
67
|
+
*
|
68
|
+
* @type {string}
|
48
69
|
*/
|
49
70
|
autoFocusedElement;
|
50
71
|
/**
|
51
|
-
*
|
72
|
+
* Sets the text in the Dialog title bar.
|
73
|
+
*
|
74
|
+
* @type {string}
|
52
75
|
*/
|
53
76
|
title;
|
54
77
|
/**
|
55
|
-
*
|
56
|
-
*
|
57
|
-
*
|
78
|
+
* Sets the width of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
79
|
+
*
|
80
|
+
* @type {number | string}
|
58
81
|
*/
|
59
82
|
width;
|
60
83
|
/**
|
61
|
-
*
|
62
|
-
*
|
63
|
-
*
|
84
|
+
* Sets the minimum width of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
85
|
+
*
|
86
|
+
* @type {number | string}
|
64
87
|
*/
|
65
88
|
minWidth;
|
66
89
|
/**
|
67
|
-
*
|
68
|
-
*
|
69
|
-
*
|
90
|
+
* Sets the maximum width of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
91
|
+
*
|
92
|
+
* @type {number | string}
|
70
93
|
*/
|
71
94
|
maxWidth;
|
72
95
|
/**
|
73
|
-
*
|
74
|
-
*
|
75
|
-
*
|
96
|
+
* Sets the height of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
97
|
+
*
|
98
|
+
* @type {number | string}
|
76
99
|
*/
|
77
100
|
height;
|
78
101
|
/**
|
79
|
-
*
|
80
|
-
*
|
81
|
-
*
|
102
|
+
* Sets the minimum height of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
103
|
+
*
|
104
|
+
* @type {number | string}
|
82
105
|
*/
|
83
106
|
minHeight;
|
84
107
|
/**
|
85
|
-
*
|
86
|
-
*
|
87
|
-
*
|
108
|
+
* Sets the maximum height of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
109
|
+
*
|
110
|
+
* @type {number | string}
|
88
111
|
*/
|
89
112
|
maxHeight;
|
90
113
|
/**
|
91
114
|
* Configures the Dialog opening animation ([see example]({% slug animations_dialog %})).
|
92
|
-
*
|
115
|
+
* The default animation type is `translate` and the duration is `300ms`.
|
93
116
|
*
|
117
|
+
* @type {boolean | DialogAnimation}
|
94
118
|
* @default true
|
95
119
|
*/
|
96
120
|
animation = true;
|
97
121
|
/**
|
98
|
-
*
|
99
|
-
* The theme color will be applied as a background and border color to the titlebar while also amending the text color accordingly.
|
122
|
+
* Sets a predefined theme color for the Dialog. The color applies to the title bar background and border, and updates the text color.
|
100
123
|
*
|
101
|
-
*
|
102
|
-
* * `primary`
|
103
|
-
* * `dark`
|
104
|
-
* * `light`
|
124
|
+
* @type {DialogThemeColor}
|
105
125
|
*/
|
106
126
|
set themeColor(themeColor) {
|
107
127
|
this.handleThemeColorClass(this.themeColor, themeColor);
|
@@ -160,12 +180,15 @@ export class DialogComponent {
|
|
160
180
|
*/
|
161
181
|
showLicenseWatermark = false;
|
162
182
|
/**
|
163
|
-
*
|
164
|
-
*
|
183
|
+
* Emits when the user clicks an action button in the Dialog. Fires only if you specify action buttons through the `actions` option.
|
184
|
+
*
|
185
|
+
* @type {EventEmitter<DialogAction>}
|
165
186
|
*/
|
166
187
|
action = new EventEmitter();
|
167
188
|
/**
|
168
|
-
*
|
189
|
+
* Emits when the user clicks the **Close** button or presses the `ESC` key.
|
190
|
+
*
|
191
|
+
* @type {EventEmitter<any>}
|
169
192
|
*/
|
170
193
|
close = new EventEmitter();
|
171
194
|
get dir() {
|
@@ -31,8 +31,7 @@ class DialogInjector {
|
|
31
31
|
}
|
32
32
|
}
|
33
33
|
/**
|
34
|
-
*
|
35
|
-
* ([see example]({% slug service_dialog %})).
|
34
|
+
* Provides a service for opening Dialog windows dynamically ([see example]({% slug service_dialog %})).
|
36
35
|
*/
|
37
36
|
export class DialogService {
|
38
37
|
resolver;
|
@@ -48,45 +47,25 @@ export class DialogService {
|
|
48
47
|
/**
|
49
48
|
* Opens a Dialog window. Requires an element in the application that uses the
|
50
49
|
* [`kendoDialogContainer`]({% slug api_dialog_dialogcontainerdirective %}) directive.
|
51
|
-
*
|
50
|
+
* The created Dialog mounts in the DOM directly after that element.
|
52
51
|
*
|
53
52
|
* @param {DialogAction} options - The options that define the Dialog.
|
54
|
-
* @returns {DialogRef} - A reference to the Dialog object and
|
53
|
+
* @returns {DialogRef} - A reference to the Dialog object and its convenience properties.
|
55
54
|
*
|
56
55
|
* @example
|
57
|
-
*
|
58
|
-
*
|
59
|
-
*
|
60
|
-
*
|
61
|
-
*
|
62
|
-
*
|
63
|
-
*
|
64
|
-
*
|
65
|
-
* })
|
66
|
-
*
|
67
|
-
*
|
68
|
-
*
|
69
|
-
* public open() {
|
70
|
-
* var dialog = this.dialogService.open({
|
71
|
-
* title: "Please confirm",
|
72
|
-
* content: "Are you sure?",
|
73
|
-
* actions: [
|
74
|
-
* { text: "No" },
|
75
|
-
* { text: "Yes", themeColor: 'primary' }
|
76
|
-
* ]
|
77
|
-
* });
|
78
|
-
*
|
79
|
-
* dialog.result.subscribe((result) => {
|
80
|
-
* if (result instanceof DialogCloseResult) {
|
81
|
-
* console.log("close");
|
82
|
-
* } else {
|
83
|
-
* console.log("action", result);
|
84
|
-
* }
|
85
|
-
* });
|
86
|
-
* }
|
87
|
-
* }
|
56
|
+
* ```typescript
|
57
|
+
* const dialog = this.dialogService.open({
|
58
|
+
* title: 'Confirm',
|
59
|
+
* content: 'Are you sure?',
|
60
|
+
* actions: [
|
61
|
+
* { text: 'No' },
|
62
|
+
* { text: 'Yes', themeColor: 'primary' }
|
63
|
+
* ]
|
64
|
+
* });
|
65
|
+
* dialog.result.subscribe(result => {
|
66
|
+
* // handle result
|
67
|
+
* });
|
88
68
|
* ```
|
89
|
-
*
|
90
69
|
*/
|
91
70
|
open(options) {
|
92
71
|
const factory = this.resolver.resolveComponentFactory(DialogComponent);
|