@progress/kendo-vue-dialogs 3.5.0 → 3.5.1-dev.202208150613
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/dist/cdn/js/kendo-vue-dialogs.js +1 -1
- package/dist/es/WindowProps.js +1 -1
- package/dist/es/events.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/esm/Dialog.d.ts +99 -0
- package/dist/esm/Dialog.js +177 -0
- package/dist/esm/DialogActionsBar.d.ts +33 -0
- package/dist/esm/DialogActionsBar.js +58 -0
- package/dist/esm/DialogTitleBar.d.ts +46 -0
- package/dist/esm/DialogTitleBar.js +82 -0
- package/dist/esm/StageEnum.d.ts +5 -0
- package/dist/esm/StageEnum.js +6 -0
- package/dist/esm/Window.d.ts +75 -0
- package/dist/esm/Window.js +664 -0
- package/dist/esm/WindowProps.d.ts +130 -0
- package/dist/esm/WindowProps.js +1 -0
- package/dist/esm/WindowResizeHandlers.d.ts +30 -0
- package/dist/esm/WindowResizeHandlers.js +92 -0
- package/dist/esm/WindowTitlebar.d.ts +82 -0
- package/dist/esm/WindowTitlebar.js +165 -0
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.js +2 -0
- package/dist/esm/events.d.ts +34 -0
- package/dist/esm/events.js +2 -0
- package/dist/esm/main.d.ts +6 -0
- package/dist/esm/main.js +4 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/npm/Dialog.js +3 -3
- package/dist/npm/DialogActionsBar.js +1 -1
- package/dist/npm/Window.js +3 -3
- package/dist/npm/package-metadata.js +1 -1
- package/package.json +9 -3
package/dist/es/WindowProps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
// tslint:enable:max-line-length
|
|
1
|
+
export {}; // tslint:enable:max-line-length
|
package/dist/es/events.js
CHANGED
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-dialogs',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1660543150,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
import { DialogCloseEvent } from './events';
|
|
7
|
+
/**
|
|
8
|
+
* Represents the props of the [KendoVue Dialog component]({% slug overview_dialog %}).
|
|
9
|
+
*/
|
|
10
|
+
export interface DialogProps {
|
|
11
|
+
/**
|
|
12
|
+
* Defines the string selector to the element to which the Dialog will be appended. Defaults to its parent element.
|
|
13
|
+
*/
|
|
14
|
+
appendTo?: String;
|
|
15
|
+
/**
|
|
16
|
+
* Sets the title of the Dialog ([see example]({% slug title_dialog %})). If `title` is not specified, the Dialog does not render a **Close** button.
|
|
17
|
+
*/
|
|
18
|
+
title?: string | any;
|
|
19
|
+
/**
|
|
20
|
+
* Defines the custom rendering of the title. Accepts a Vue component, a `render` function, or a slot name.
|
|
21
|
+
*/
|
|
22
|
+
titleRender?: ((h: any, defaultRendering: any | null, props: any, listeners: any) => any) | string | any;
|
|
23
|
+
/**
|
|
24
|
+
* Sets a class of the Dialog DOM element.
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Specifies whether a close button should be rendered at the top corner of the dialog.
|
|
29
|
+
*/
|
|
30
|
+
closeIcon?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the width of the Dialog ([see example]({% slug dimensions_dialog %})).
|
|
33
|
+
*/
|
|
34
|
+
width?: number | string;
|
|
35
|
+
/**
|
|
36
|
+
* Specifies the height of the Dialog ([see example]({% slug dimensions_dialog %})).
|
|
37
|
+
*/
|
|
38
|
+
height?: number | string;
|
|
39
|
+
/**
|
|
40
|
+
* Specifies the minimum width of the Dialog.
|
|
41
|
+
*/
|
|
42
|
+
minWidth?: number | string;
|
|
43
|
+
/**
|
|
44
|
+
* Fires when the **Close** button in the title is clicked or when the `Esc` button is pressed.
|
|
45
|
+
*/
|
|
46
|
+
onClose?: (event: DialogCloseEvent) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the `aria-labelledby` value.
|
|
49
|
+
*/
|
|
50
|
+
id?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Sets the `id` of the wrapper element.
|
|
53
|
+
*/
|
|
54
|
+
wrapperId?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Represents the `dir` HTML attribute.
|
|
57
|
+
*/
|
|
58
|
+
dir?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The styles that are applied to the Dialog.
|
|
61
|
+
*/
|
|
62
|
+
style?: any;
|
|
63
|
+
/**
|
|
64
|
+
* The styles that are applied to the content of the Dialog.
|
|
65
|
+
*/
|
|
66
|
+
contentStyle?: any;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @hidden
|
|
70
|
+
*/
|
|
71
|
+
export interface DialogMethods extends Vue2type {
|
|
72
|
+
handleCloseDialog: (event: any) => void;
|
|
73
|
+
handleKeyDown: (event: any) => void;
|
|
74
|
+
transformDimesion: (initialValue: string | number | undefined) => string;
|
|
75
|
+
getActionBarIndex: (children: any) => any;
|
|
76
|
+
generateTitleId: () => string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
export interface DialogState {
|
|
82
|
+
titleId?: string;
|
|
83
|
+
v3: boolean;
|
|
84
|
+
windowElement?: any;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
89
|
+
export interface DialogAll extends DialogMethods, DialogState, DialogProps {
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @hidden
|
|
93
|
+
*/
|
|
94
|
+
declare let DialogVue2: ComponentOptions<Vue2type, DefaultData<{}>, DefaultMethods<DialogAll>, {}, RecordPropsDefinition<DialogProps>>;
|
|
95
|
+
/**
|
|
96
|
+
* @hidden
|
|
97
|
+
*/
|
|
98
|
+
declare const Dialog: DefineComponent<DialogProps, any, {}, {}, DialogMethods, {}, {}, {}, string, DialogProps, DialogProps, {}>;
|
|
99
|
+
export { Dialog, DialogVue2 };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { DialogTitleBar } from './DialogTitleBar.js';
|
|
7
|
+
import { guid, Keys, templateRendering, hasListener, templateDefinition, getListeners, getDefaultSlots, validatePackage } from '@progress/kendo-vue-common';
|
|
8
|
+
import { packageMetadata } from './package-metadata.js';
|
|
9
|
+
import { DEFAULT_DIALOGS_ZINDEX } from './constants.js';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var DialogVue2 = {
|
|
15
|
+
name: 'KendoDialog',
|
|
16
|
+
props: {
|
|
17
|
+
appendTo: String,
|
|
18
|
+
title: String,
|
|
19
|
+
titleRender: templateDefinition,
|
|
20
|
+
id: String,
|
|
21
|
+
wrapperId: String,
|
|
22
|
+
dir: String,
|
|
23
|
+
closeIcon: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
width: [String, Number],
|
|
28
|
+
height: [String, Number],
|
|
29
|
+
minWidth: [String, Number]
|
|
30
|
+
},
|
|
31
|
+
provide: function provide() {
|
|
32
|
+
return {
|
|
33
|
+
kCurrentZIndex: DEFAULT_DIALOGS_ZINDEX
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
created: function created() {
|
|
37
|
+
validatePackage(packageMetadata);
|
|
38
|
+
this.titleId = this.generateTitleId();
|
|
39
|
+
},
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
setup: !isV3 ? undefined : function () {
|
|
42
|
+
var v3 = !!isV3;
|
|
43
|
+
return {
|
|
44
|
+
v3: v3
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
mounted: function mounted() {
|
|
48
|
+
if (this.$props.appendTo) {
|
|
49
|
+
var body = document.querySelector(this.$props.appendTo);
|
|
50
|
+
this.windowElement = this.$refs.wrapper;
|
|
51
|
+
body.append(this.windowElement);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
beforeDestroy: !!isV3 ? undefined : function () {
|
|
55
|
+
if (this.$props.appendTo) {
|
|
56
|
+
this.windowElement.remove();
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
beforeUnmount: function beforeUnmount() {
|
|
61
|
+
if (this.$props.appendTo) {
|
|
62
|
+
this.windowElement.remove();
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
handleCloseDialog: function handleCloseDialog(event) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
this.$emit('close', {
|
|
69
|
+
event: event,
|
|
70
|
+
target: this
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
handleKeyDown: function handleKeyDown(event) {
|
|
74
|
+
if (event.keyCode === Keys.esc && hasListener.call(this, 'close')) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
this.handleCloseDialog(event);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
transformDimesion: function transformDimesion(initialValue) {
|
|
80
|
+
return typeof initialValue === 'string' ? initialValue.endsWith('px') || initialValue.endsWith('%') ? initialValue : initialValue + 'px' : initialValue + 'px';
|
|
81
|
+
},
|
|
82
|
+
getActionBarIndex: function getActionBarIndex(children) {
|
|
83
|
+
var actionBarIndex = children.findIndex(function (child) {
|
|
84
|
+
return child && child.tag && child.tag.toLowerCase().indexOf('dialogactionsbar') !== -1 || child.componentOptions && child.componentOptions.tag && child.componentOptions.tag.toLowerCase().indexOf('actions-bar') !== -1 || child.type && child.type.name && child.type.name.toLowerCase().indexOf('dialogactionsbar') !== -1;
|
|
85
|
+
});
|
|
86
|
+
return actionBarIndex;
|
|
87
|
+
},
|
|
88
|
+
generateTitleId: function generateTitleId() {
|
|
89
|
+
return 'dialog-title' + guid();
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
render: function render(createElement) {
|
|
94
|
+
var h = gh || createElement;
|
|
95
|
+
var id = this.$props.id !== undefined ? this.$props.id : this.titleId;
|
|
96
|
+
var _a = this.$props,
|
|
97
|
+
title = _a.title,
|
|
98
|
+
width = _a.width,
|
|
99
|
+
height = _a.height,
|
|
100
|
+
minWidth = _a.minWidth,
|
|
101
|
+
dir = _a.dir,
|
|
102
|
+
contentStyle = _a.contentStyle,
|
|
103
|
+
wrapperId = _a.wrapperId;
|
|
104
|
+
var titleRender = this.$props.titleRender ? templateRendering.call(this, this.$props.titleRender, getListeners.call(this)) : null;
|
|
105
|
+
var defaultSlot = getDefaultSlots(this);
|
|
106
|
+
var content = defaultSlot || [];
|
|
107
|
+
width = this.transformDimesion(width);
|
|
108
|
+
height = this.transformDimesion(height);
|
|
109
|
+
minWidth = this.transformDimesion(minWidth);
|
|
110
|
+
var actionBarIndex = this.getActionBarIndex(content);
|
|
111
|
+
var actions;
|
|
112
|
+
|
|
113
|
+
if (actionBarIndex !== -1) {
|
|
114
|
+
actions = content[actionBarIndex];
|
|
115
|
+
content.splice(actionBarIndex, 1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var closeIcon = this.$props.closeIcon !== undefined ? this.$props.closeIcon : true;
|
|
119
|
+
var dialog = h("div", {
|
|
120
|
+
ref: 'wrapper',
|
|
121
|
+
"class": 'k-dialog-wrapper',
|
|
122
|
+
onKeydown: this.handleKeyDown,
|
|
123
|
+
on: this.v3 ? undefined : {
|
|
124
|
+
"keydown": this.handleKeyDown
|
|
125
|
+
},
|
|
126
|
+
tabindex: 0,
|
|
127
|
+
attrs: this.v3 ? undefined : {
|
|
128
|
+
tabindex: 0,
|
|
129
|
+
id: wrapperId,
|
|
130
|
+
dir: dir
|
|
131
|
+
},
|
|
132
|
+
id: wrapperId,
|
|
133
|
+
dir: dir
|
|
134
|
+
}, [h("div", {
|
|
135
|
+
"class": "k-overlay"
|
|
136
|
+
}), h("div", {
|
|
137
|
+
"aria-labelledby": title || titleRender ? id : undefined,
|
|
138
|
+
attrs: this.v3 ? undefined : {
|
|
139
|
+
"aria-labelledby": title || titleRender ? id : undefined,
|
|
140
|
+
role: "dialog"
|
|
141
|
+
},
|
|
142
|
+
"class": "k-widget k-window k-dialog",
|
|
143
|
+
role: "dialog",
|
|
144
|
+
style: {
|
|
145
|
+
width: width,
|
|
146
|
+
height: height,
|
|
147
|
+
minWidth: minWidth
|
|
148
|
+
}
|
|
149
|
+
}, [(title || titleRender) && // @ts-ignore
|
|
150
|
+
h(DialogTitleBar, {
|
|
151
|
+
closeIcon: closeIcon,
|
|
152
|
+
attrs: this.v3 ? undefined : {
|
|
153
|
+
closeIcon: closeIcon,
|
|
154
|
+
id: id,
|
|
155
|
+
title: title,
|
|
156
|
+
titleRender: titleRender
|
|
157
|
+
},
|
|
158
|
+
onClosebuttonclick: this.handleCloseDialog,
|
|
159
|
+
on: this.v3 ? undefined : {
|
|
160
|
+
"closebuttonclick": this.handleCloseDialog
|
|
161
|
+
},
|
|
162
|
+
id: id,
|
|
163
|
+
title: title,
|
|
164
|
+
titleRender: titleRender
|
|
165
|
+
}), h("div", {
|
|
166
|
+
"class": "k-content k-window-content k-dialog-content",
|
|
167
|
+
style: contentStyle
|
|
168
|
+
}, [content]), actions])]);
|
|
169
|
+
return this.$props.appendTo ? h("div", [dialog]) : dialog;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* @hidden
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
var Dialog = DialogVue2;
|
|
177
|
+
export { Dialog, DialogVue2 };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export interface DialogActionsBarProps {
|
|
10
|
+
layout: string;
|
|
11
|
+
buttonGroupClass?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export interface DialogActionsBarComputed {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
wrapperClasses: object;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export interface DialogActionsBarAll extends DialogActionsBarComputed, DialogActionsBarProps, Vue2type {
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
declare let DialogActionsBarVue2: ComponentOptions<Vue2type, DefaultData<{}>, DefaultMethods<DialogActionsBarAll>, {}, RecordPropsDefinition<DialogActionsBarProps>>;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
declare const DialogActionsBar: DefineComponent<{}, any, {}, {}, {}, {}, {}, {}, string, {}, {}, {}>;
|
|
33
|
+
export { DialogActionsBar, DialogActionsBarVue2 };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { getDefaultSlots } from '@progress/kendo-vue-common';
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var DialogActionsBarVue2 = {
|
|
12
|
+
name: 'DialogActionsBar',
|
|
13
|
+
props: {
|
|
14
|
+
layout: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'stretched'
|
|
17
|
+
},
|
|
18
|
+
buttonGroupClass: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
setup: !isV3 ? undefined : function () {
|
|
25
|
+
var v3 = !!isV3;
|
|
26
|
+
return {
|
|
27
|
+
v3: v3
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
computed: {
|
|
31
|
+
wrapperClasses: function wrapperClasses() {
|
|
32
|
+
var layout = this.$props.layout;
|
|
33
|
+
return {
|
|
34
|
+
'k-dialog-buttongroup': this.buttonGroupClass,
|
|
35
|
+
'k-actions': true,
|
|
36
|
+
'k-hstack': true,
|
|
37
|
+
'k-justify-content-start': layout === 'start',
|
|
38
|
+
'k-justify-content-center': layout === 'center',
|
|
39
|
+
'k-justify-content-end': layout === 'end',
|
|
40
|
+
'k-justify-content-stretch': layout === 'stretched'
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
render: function render(createElement) {
|
|
46
|
+
var h = gh || createElement;
|
|
47
|
+
var defaultSlot = getDefaultSlots(this);
|
|
48
|
+
return h("div", {
|
|
49
|
+
"class": this.wrapperClasses
|
|
50
|
+
}, [defaultSlot]);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
var DialogActionsBar = DialogActionsBarVue2;
|
|
58
|
+
export { DialogActionsBar, DialogActionsBarVue2 };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export interface DialogTitleBarProps {
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
onClosebuttonclick?: (event: any) => void;
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
closeIcon?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the title of the Dialog .
|
|
24
|
+
* If `title` of 'titleRender' is not specified, the Dialog does not render a **Close** button.
|
|
25
|
+
*/
|
|
26
|
+
title?: string | any;
|
|
27
|
+
/**
|
|
28
|
+
* Defines the custom rendering of the title. Accepts a Vue component, a `render` function, or a slot name.
|
|
29
|
+
*/
|
|
30
|
+
titleRender?: ((h: any, defaultRendering: any | null, props: any, listeners: any) => any) | string | any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
export interface DialogTitleBarMethods extends Vue2type {
|
|
36
|
+
onCloseButtonClick: (event: any) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
declare let DialogTitleBarVue2: ComponentOptions<Vue2type, DefaultData<{}>, DefaultMethods<DialogTitleBarMethods>, {}, RecordPropsDefinition<DialogTitleBarProps>>;
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
declare const DialogTitleBar: DefineComponent<DialogTitleBarProps, any, {}, {}, DialogTitleBarMethods, {}, {}, {}, string, DialogTitleBarProps, DialogTitleBarProps, {}>;
|
|
46
|
+
export { DialogTitleBar, DialogTitleBarVue2 };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { getTemplate } from '@progress/kendo-vue-common';
|
|
7
|
+
import { Button } from '@progress/kendo-vue-buttons';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
var DialogTitleBarVue2 = {
|
|
13
|
+
props: {
|
|
14
|
+
id: String,
|
|
15
|
+
closeIcon: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true
|
|
18
|
+
},
|
|
19
|
+
title: String,
|
|
20
|
+
titleRender: [String, Function, Object]
|
|
21
|
+
},
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
setup: !isV3 ? undefined : function () {
|
|
24
|
+
var v3 = !!isV3;
|
|
25
|
+
return {
|
|
26
|
+
v3: v3
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
onCloseButtonClick: function onCloseButtonClick(e) {
|
|
31
|
+
this.$emit('closebuttonclick', e);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
render: function render(createElement) {
|
|
36
|
+
var h = gh || createElement;
|
|
37
|
+
var _a = this.$props,
|
|
38
|
+
id = _a.id,
|
|
39
|
+
closeIcon = _a.closeIcon,
|
|
40
|
+
titleRender = _a.titleRender,
|
|
41
|
+
title = _a.title;
|
|
42
|
+
var titleElement;
|
|
43
|
+
titleElement = getTemplate.call(this, {
|
|
44
|
+
h: h,
|
|
45
|
+
template: titleRender,
|
|
46
|
+
defaultRendering: title
|
|
47
|
+
});
|
|
48
|
+
return h("div", {
|
|
49
|
+
"class": "k-window-titlebar k-dialog-titlebar k-header",
|
|
50
|
+
id: id,
|
|
51
|
+
attrs: this.v3 ? undefined : {
|
|
52
|
+
id: id
|
|
53
|
+
}
|
|
54
|
+
}, [h("div", {
|
|
55
|
+
"class": "k-window-title k-dialog-title"
|
|
56
|
+
}, [titleElement]), h("div", {
|
|
57
|
+
"class": "k-window-actions k-dialog-actions"
|
|
58
|
+
}, [closeIcon && // @ts-ignore
|
|
59
|
+
h(Button, {
|
|
60
|
+
type: "button",
|
|
61
|
+
attrs: this.v3 ? undefined : {
|
|
62
|
+
type: "button",
|
|
63
|
+
fillMode: 'flat',
|
|
64
|
+
"aria-label": "Close",
|
|
65
|
+
icon: 'x'
|
|
66
|
+
},
|
|
67
|
+
fillMode: 'flat',
|
|
68
|
+
"aria-label": "Close",
|
|
69
|
+
icon: 'x',
|
|
70
|
+
onClick: this.onCloseButtonClick,
|
|
71
|
+
on: this.v3 ? undefined : {
|
|
72
|
+
"click": this.onCloseButtonClick
|
|
73
|
+
}
|
|
74
|
+
})])]);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
var DialogTitleBar = DialogTitleBarVue2;
|
|
82
|
+
export { DialogTitleBar, DialogTitleBarVue2 };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
|
|
2
|
+
import { WindowProps } from './WindowProps';
|
|
3
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
4
|
+
declare type DefaultMethods<V> = {
|
|
5
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
6
|
+
};
|
|
7
|
+
import { windowStage } from './StageEnum';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export interface WindowComputed {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
computedTop: number;
|
|
14
|
+
computedLeft: number;
|
|
15
|
+
computedWidth: number;
|
|
16
|
+
computedHeight: number;
|
|
17
|
+
windowStage: any;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
interface WindowData {
|
|
23
|
+
currentStage: windowStage | string;
|
|
24
|
+
isDragging: boolean;
|
|
25
|
+
currentTop: number;
|
|
26
|
+
currentLeft: number;
|
|
27
|
+
currentWidth: number;
|
|
28
|
+
currentHeight: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
interface WindowState {
|
|
34
|
+
windowCoordinatesState: any;
|
|
35
|
+
draggable: any;
|
|
36
|
+
windowElement: any;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export interface WindowMethods extends Vue2type {
|
|
42
|
+
getInitialTop: () => number;
|
|
43
|
+
getInitialLeft: () => number;
|
|
44
|
+
getInitialWidth: () => number;
|
|
45
|
+
getInitialHeight: () => number;
|
|
46
|
+
dispatchMoveEvent: (eventName: string, event: any, drag: boolean, end: boolean | undefined) => void;
|
|
47
|
+
handleFullscreen: (event: any) => void;
|
|
48
|
+
handleCloseWindow: (event: any) => void;
|
|
49
|
+
handleRestore: (event: any) => void;
|
|
50
|
+
handleMinimize: (event: any) => void;
|
|
51
|
+
handleDoubleClick: (e: any) => void;
|
|
52
|
+
handleResize: (event: any, props: {
|
|
53
|
+
end: boolean;
|
|
54
|
+
direction: string;
|
|
55
|
+
}) => void;
|
|
56
|
+
onPress: (data: any) => void;
|
|
57
|
+
onDrag: (data: any) => void;
|
|
58
|
+
onRelease: (data: any) => void;
|
|
59
|
+
handleKeyDown: (event: any) => void;
|
|
60
|
+
handleBrowserWindowResize: () => void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
export interface WindowAll extends WindowMethods, WindowData, WindowState, WindowComputed {
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
declare let WindowVue2: ComponentOptions<Vue2type, DefaultData<WindowData>, DefaultMethods<WindowAll>, WindowComputed, RecordPropsDefinition<WindowProps>>;
|
|
71
|
+
/**
|
|
72
|
+
* @hidden
|
|
73
|
+
*/
|
|
74
|
+
declare const Window: DefineComponent<WindowProps, any, WindowData, WindowComputed, WindowMethods, {}, {}, {}, string, WindowProps, WindowProps, {}>;
|
|
75
|
+
export { Window, WindowVue2 };
|