@progress/kendo-vue-layout 3.1.3 → 3.1.5-dev.202204110939
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/NOTICE.txt +49 -6
- package/dist/cdn/js/kendo-vue-layout.js +1 -1
- package/dist/es/card/Avatar.js +1 -1
- package/dist/es/main.d.ts +9 -0
- package/dist/es/main.js +9 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/panelbar/PanelBar.d.ts +4 -4
- package/dist/es/panelbar/PanelBar.js +62 -95
- package/dist/es/panelbar/PanelBarGroup.d.ts +47 -0
- package/dist/es/panelbar/PanelBarGroup.js +126 -0
- package/dist/es/panelbar/PanelBarItem.d.ts +0 -1
- package/dist/es/panelbar/PanelBarItem.js +118 -125
- package/dist/es/panelbar/interfaces/PanelBarItemProps.d.ts +9 -13
- package/dist/es/panelbar/interfaces/PanelBarProps.d.ts +4 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.d.ts +2 -2
- package/dist/es/panelbar/util.d.ts +7 -21
- package/dist/es/panelbar/util.js +136 -146
- package/dist/es/splitter/Splitter.d.ts +1 -5
- package/dist/es/splitter/Splitter.js +114 -146
- package/dist/es/splitter/SplitterBar.js +118 -68
- package/dist/es/splitter/SplitterPane.d.ts +8 -30
- package/dist/es/splitter/SplitterPane.js +10 -4
- package/dist/npm/card/Avatar.js +1 -1
- package/dist/npm/main.d.ts +9 -0
- package/dist/npm/main.js +9 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/panelbar/PanelBar.d.ts +4 -4
- package/dist/npm/panelbar/PanelBar.js +62 -94
- package/dist/npm/panelbar/PanelBarGroup.d.ts +47 -0
- package/dist/npm/panelbar/PanelBarGroup.js +138 -0
- package/dist/npm/panelbar/PanelBarItem.d.ts +0 -1
- package/dist/npm/panelbar/PanelBarItem.js +117 -124
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.d.ts +9 -13
- package/dist/npm/panelbar/interfaces/PanelBarProps.d.ts +4 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.d.ts +2 -2
- package/dist/npm/panelbar/util.d.ts +7 -21
- package/dist/npm/panelbar/util.js +137 -147
- package/dist/npm/splitter/Splitter.d.ts +1 -5
- package/dist/npm/splitter/Splitter.js +113 -145
- package/dist/npm/splitter/SplitterBar.js +118 -68
- package/dist/npm/splitter/SplitterPane.d.ts +8 -30
- package/dist/npm/splitter/SplitterPane.js +9 -3
- package/package.json +10 -10
|
@@ -35,10 +35,18 @@ export interface SplitterPaneProps {
|
|
|
35
35
|
* Specifies if overflowing content is scrollable or hidden ([see example]({% slug panes_splitter %}#toc-scrolling)). If `scrollable` is not specified, the content will be scrollable.
|
|
36
36
|
*/
|
|
37
37
|
scrollable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Specifies if the content of the pane contains Splitter.
|
|
40
|
+
*/
|
|
41
|
+
containsSplitter: boolean;
|
|
38
42
|
/**
|
|
39
43
|
* Specifies if the children of the pane should be mounted when it's in collapsed state.
|
|
40
44
|
*/
|
|
41
45
|
keepMounted?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The slot template for the content of the splitter
|
|
48
|
+
*/
|
|
49
|
+
content?: any;
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* @hidden
|
|
@@ -46,36 +54,6 @@ export interface SplitterPaneProps {
|
|
|
46
54
|
export interface SplitterPaneExtendedProps extends SplitterPaneProps {
|
|
47
55
|
orientation: 'vertical' | 'horizontal' | string;
|
|
48
56
|
overlay: boolean;
|
|
49
|
-
containsSplitter: boolean;
|
|
50
|
-
size?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Sets the minimum possible size of the pane ([see example]({% slug panes_splitter %}#toc-dimensions)).
|
|
53
|
-
*/
|
|
54
|
-
min?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Sets the maximum possible size of the pane ([see example]({% slug panes_splitter %}#toc-dimensions)).
|
|
57
|
-
*/
|
|
58
|
-
max?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Specifies if the user is allowed to resize the pane and provide space for other panes ([see example]({% slug panes_splitter %}#toc-resizing)). If `resizable` is not specified, the resizing of the pane will be enabled.
|
|
61
|
-
*/
|
|
62
|
-
resizable?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Specifies if the user is allowed to hide the pane and provide space for other panes ([see example]({% slug panes_splitter %}#toc-collapsing)).
|
|
65
|
-
*/
|
|
66
|
-
collapsible?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Specifies the pane collapsed state ([see example]({% slug panes_splitter %}#toc-collapsing)).
|
|
69
|
-
*/
|
|
70
|
-
collapsed?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Specifies if overflowing content is scrollable or hidden ([see example]({% slug panes_splitter %}#toc-scrolling)). If `scrollable` is not specified, the content will be scrollable.
|
|
73
|
-
*/
|
|
74
|
-
scrollable?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Specifies if the children of the pane should be mounted when it's in collapsed state.
|
|
77
|
-
*/
|
|
78
|
-
keepMounted?: boolean;
|
|
79
57
|
}
|
|
80
58
|
/**
|
|
81
59
|
* @hidden
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as Vue from 'vue';
|
|
3
3
|
var allVue = Vue;
|
|
4
4
|
var gh = allVue.h;
|
|
5
|
-
import { classNames } from '@progress/kendo-vue-common'; // tslint:enable:max-line-length
|
|
5
|
+
import { classNames, getTemplate } from '@progress/kendo-vue-common'; // tslint:enable:max-line-length
|
|
6
6
|
|
|
7
7
|
var SplitterPaneVue2 = {
|
|
8
8
|
name: 'KendoSplitterPane',
|
|
@@ -25,7 +25,8 @@ var SplitterPaneVue2 = {
|
|
|
25
25
|
collapsible: Boolean,
|
|
26
26
|
collapsed: Boolean,
|
|
27
27
|
scrollable: Boolean,
|
|
28
|
-
keepMounted: Boolean
|
|
28
|
+
keepMounted: Boolean,
|
|
29
|
+
content: [Object, Function, String]
|
|
29
30
|
},
|
|
30
31
|
// @ts-ignore
|
|
31
32
|
setup: !gh ? undefined : function () {
|
|
@@ -39,7 +40,7 @@ var SplitterPaneVue2 = {
|
|
|
39
40
|
var _a;
|
|
40
41
|
|
|
41
42
|
var h = gh || createElement;
|
|
42
|
-
var _b = this
|
|
43
|
+
var _b = this.$props,
|
|
43
44
|
size = _b.size,
|
|
44
45
|
collapsed = _b.collapsed,
|
|
45
46
|
overlay = _b.overlay,
|
|
@@ -53,10 +54,15 @@ var SplitterPaneVue2 = {
|
|
|
53
54
|
flexBasis: size
|
|
54
55
|
};
|
|
55
56
|
var paneClasses = classNames('k-pane', (_a = {}, _a['k-state-hidden'] = collapsed, _a['hidden'] = collapsed, _a['k-pane-flex'] = containsSplitter, _a['k-pane-static'] = !resizable && !collapsible || fixedSize, _a['k-scrollable'] = scrollable, _a));
|
|
57
|
+
var content = getTemplate.call(this, {
|
|
58
|
+
h: h,
|
|
59
|
+
template: this.$props.content,
|
|
60
|
+
defaultRendering: null
|
|
61
|
+
});
|
|
56
62
|
return h("div", {
|
|
57
63
|
style: style,
|
|
58
64
|
"class": paneClasses
|
|
59
|
-
}, [!collapsed || keepMounted ?
|
|
65
|
+
}, [!collapsed || keepMounted ? content : undefined, overlay ? h("div", {
|
|
60
66
|
"class": 'k-splitter-overlay k-overlay'
|
|
61
67
|
}) : undefined]);
|
|
62
68
|
}
|
package/dist/npm/card/Avatar.js
CHANGED
|
@@ -84,7 +84,7 @@ var AvatarVue2 = {
|
|
|
84
84
|
return _a = {
|
|
85
85
|
'k-avatar-bordered': border,
|
|
86
86
|
'k-avatar': true
|
|
87
|
-
}, _a["k-avatar-" +
|
|
87
|
+
}, _a["k-avatar-" + (kendo_vue_common_1.kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-rounded-" + (kendo_vue_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a["k-avatar-" + fillMode] = fillMode, _a["k-avatar-" + fillMode + "-" + themeColor] = Boolean(fillMode && themeColor), _a;
|
|
88
88
|
},
|
|
89
89
|
innerClass: function innerClass() {
|
|
90
90
|
var _a;
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -38,3 +38,12 @@ export * from './menu/components/MenuItemLink';
|
|
|
38
38
|
export * from './menu/components/MenuItemArrow';
|
|
39
39
|
export * from './menu/models/MenuItemModel';
|
|
40
40
|
export * from './menu/events';
|
|
41
|
+
export * from './splitter/Splitter';
|
|
42
|
+
export * from './splitter/SplitterPane';
|
|
43
|
+
export * from './panelbar/PanelBar';
|
|
44
|
+
export * from './panelbar/PanelBarItem';
|
|
45
|
+
export * from './panelbar/util';
|
|
46
|
+
export * from './panelbar/interfaces/PanelBarProps';
|
|
47
|
+
export * from './panelbar/interfaces/PanelBarItemProps';
|
|
48
|
+
export * from './panelbar/interfaces/RenderPanelBarItem';
|
|
49
|
+
export * from './panelbar/interfaces/PanelBarSelectEventArguments';
|
package/dist/npm/main.js
CHANGED
|
@@ -50,3 +50,12 @@ __exportStar(require("./menu/components/MenuItemLink"), exports);
|
|
|
50
50
|
__exportStar(require("./menu/components/MenuItemArrow"), exports);
|
|
51
51
|
__exportStar(require("./menu/models/MenuItemModel"), exports);
|
|
52
52
|
__exportStar(require("./menu/events"), exports);
|
|
53
|
+
__exportStar(require("./splitter/Splitter"), exports);
|
|
54
|
+
__exportStar(require("./splitter/SplitterPane"), exports);
|
|
55
|
+
__exportStar(require("./panelbar/PanelBar"), exports);
|
|
56
|
+
__exportStar(require("./panelbar/PanelBarItem"), exports);
|
|
57
|
+
__exportStar(require("./panelbar/util"), exports);
|
|
58
|
+
__exportStar(require("./panelbar/interfaces/PanelBarProps"), exports);
|
|
59
|
+
__exportStar(require("./panelbar/interfaces/PanelBarItemProps"), exports);
|
|
60
|
+
__exportStar(require("./panelbar/interfaces/RenderPanelBarItem"), exports);
|
|
61
|
+
__exportStar(require("./panelbar/interfaces/PanelBarSelectEventArguments"), exports);
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-vue-layout',
|
|
9
9
|
productName: 'Kendo UI for Vue',
|
|
10
10
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1649669495,
|
|
12
12
|
version: '',
|
|
13
13
|
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'
|
|
14
14
|
};
|
|
@@ -8,10 +8,6 @@ import { PanelBarProps } from './interfaces/PanelBarProps';
|
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
10
|
export interface PanelBarState {
|
|
11
|
-
focused?: string;
|
|
12
|
-
wrapperFocused?: boolean;
|
|
13
|
-
selected?: string;
|
|
14
|
-
expanded: string[];
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
13
|
* @hidden
|
|
@@ -29,6 +25,10 @@ export interface PanelBarMethods {
|
|
|
29
25
|
* @hidden
|
|
30
26
|
*/
|
|
31
27
|
export interface PanelBarData {
|
|
28
|
+
currentFocused?: string;
|
|
29
|
+
wrapperFocused?: boolean;
|
|
30
|
+
currentSelected?: string;
|
|
31
|
+
currentExpanded: string[];
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* @hidden
|
|
@@ -40,6 +40,8 @@ var Vue = require("vue");
|
|
|
40
40
|
var allVue = Vue;
|
|
41
41
|
var gh = allVue.h;
|
|
42
42
|
|
|
43
|
+
var PanelBarItem_1 = require("./PanelBarItem");
|
|
44
|
+
|
|
43
45
|
var util_1 = require("./util");
|
|
44
46
|
|
|
45
47
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
@@ -58,25 +60,7 @@ var PanelBarVue2 = {
|
|
|
58
60
|
type: Boolean,
|
|
59
61
|
default: true
|
|
60
62
|
},
|
|
61
|
-
|
|
62
|
-
// const prop = props[propName];
|
|
63
|
-
// if (prop) {
|
|
64
|
-
// if (Array.isArray(prop)) {
|
|
65
|
-
// for (let value of prop) {
|
|
66
|
-
// if (!value.type || value.type !== PanelBarItem) {
|
|
67
|
-
// return new Error(
|
|
68
|
-
// 'PanelBar children should be either PanelBarItem or Array of PanelBarItem.');
|
|
69
|
-
// }
|
|
70
|
-
// }
|
|
71
|
-
// } else {
|
|
72
|
-
// if (prop.type !== PanelBarItem) {
|
|
73
|
-
// return new Error(
|
|
74
|
-
// 'PanelBar child should be either PanelBarItem or Array of PanelBarItem.');
|
|
75
|
-
// }
|
|
76
|
-
// }
|
|
77
|
-
// return null;
|
|
78
|
-
// }
|
|
79
|
-
// },
|
|
63
|
+
items: Array,
|
|
80
64
|
dir: String,
|
|
81
65
|
selected: String,
|
|
82
66
|
expanded: Array,
|
|
@@ -92,47 +76,50 @@ var PanelBarVue2 = {
|
|
|
92
76
|
keepItemsMounted: Boolean
|
|
93
77
|
},
|
|
94
78
|
created: function created() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// this.state = initialState;
|
|
79
|
+
this.activeDescendant = null;
|
|
80
|
+
kendo_vue_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
81
|
+
},
|
|
82
|
+
data: function data() {
|
|
83
|
+
var initialState = util_1.getInitialState(this.$props, this.expandMode);
|
|
84
|
+
|
|
85
|
+
if (!initialState.currentFocused) {
|
|
86
|
+
initialState.currentFocused = util_1.getFirstId(this.$props);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return initialState;
|
|
107
90
|
},
|
|
108
91
|
computed: {
|
|
109
|
-
expandMode: function expandMode() {
|
|
110
|
-
return this.props.expandMode || 'multiple';
|
|
111
|
-
},
|
|
112
92
|
selectedItem: function selectedItem() {
|
|
113
|
-
var _a = this
|
|
114
|
-
selected = _a === void 0 ? this.
|
|
93
|
+
var _a = this.$props.selected,
|
|
94
|
+
selected = _a === void 0 ? this.currentSelected : _a;
|
|
115
95
|
return selected;
|
|
116
96
|
},
|
|
117
97
|
expandedItems: function expandedItems() {
|
|
118
|
-
var expanded = this
|
|
98
|
+
var expanded = this.$props.isControlled ? this.$props.expanded || [] : this.currentExpanded;
|
|
119
99
|
return expanded;
|
|
120
100
|
},
|
|
121
|
-
|
|
122
|
-
var state = __assign(__assign({
|
|
101
|
+
computedItems: function computedItems() {
|
|
102
|
+
var state = __assign(__assign({
|
|
103
|
+
currentExpanded: []
|
|
104
|
+
}, this.$data), {
|
|
123
105
|
selected: this.selectedItem
|
|
124
106
|
});
|
|
125
107
|
|
|
126
108
|
var renderState = {
|
|
127
|
-
animation: this
|
|
128
|
-
keepItemsMounted: this
|
|
109
|
+
animation: this.$props.animation,
|
|
110
|
+
keepItemsMounted: this.$props.keepItemsMounted,
|
|
129
111
|
state: state,
|
|
130
112
|
expanded: this.expandedItems,
|
|
131
113
|
handleSelect: this.handleSelect
|
|
132
114
|
};
|
|
133
|
-
return util_1.renderChildren(
|
|
115
|
+
return util_1.renderChildren.call(this, this.items, renderState);
|
|
134
116
|
}
|
|
135
117
|
},
|
|
118
|
+
provide: function provide() {
|
|
119
|
+
return {
|
|
120
|
+
dispatchItemSelect: this.handleSelect
|
|
121
|
+
};
|
|
122
|
+
},
|
|
136
123
|
// @ts-ignore
|
|
137
124
|
setup: !gh ? undefined : function () {
|
|
138
125
|
var v3 = !!gh;
|
|
@@ -142,36 +129,33 @@ var PanelBarVue2 = {
|
|
|
142
129
|
},
|
|
143
130
|
// @ts-ignore
|
|
144
131
|
render: function render(createElement) {
|
|
145
|
-
var _this = this;
|
|
146
|
-
|
|
147
132
|
var h = gh || createElement;
|
|
148
|
-
var
|
|
149
|
-
'aria-activedescendant': this.activeDescendant
|
|
150
|
-
};
|
|
151
|
-
var className = kendo_vue_common_1.classNames('k-panelbar', this.props.className);
|
|
133
|
+
var className = kendo_vue_common_1.classNames('k-panelbar', this.$props.className);
|
|
152
134
|
return h("ul", {
|
|
153
|
-
|
|
154
|
-
_this._element = div;
|
|
155
|
-
},
|
|
156
|
-
dir: this.props.dir,
|
|
135
|
+
dir: this.$props.dir,
|
|
157
136
|
attrs: this.v3 ? undefined : {
|
|
158
|
-
dir: this
|
|
137
|
+
dir: this.$props.dir,
|
|
159
138
|
role: 'tree',
|
|
160
|
-
tabIndex: 0
|
|
139
|
+
tabIndex: 0,
|
|
140
|
+
"aria-activedescendant": this.activeDescendant
|
|
161
141
|
},
|
|
162
142
|
role: 'tree',
|
|
163
143
|
tabIndex: 0,
|
|
164
|
-
|
|
144
|
+
onKeydown: this.handleKeyDown,
|
|
165
145
|
on: this.v3 ? undefined : {
|
|
166
|
-
"
|
|
146
|
+
"keydown": this.handleKeyDown,
|
|
167
147
|
"focus": this.handleWrapperFocus,
|
|
168
148
|
"blur": this.handleWrapperBlur
|
|
169
149
|
},
|
|
170
150
|
onFocus: this.handleWrapperFocus,
|
|
171
151
|
onBlur: this.handleWrapperBlur,
|
|
172
152
|
"class": className,
|
|
173
|
-
|
|
174
|
-
}, [this.
|
|
153
|
+
"aria-activedescendant": this.activeDescendant
|
|
154
|
+
}, [this.computedItems.map(function (item) {
|
|
155
|
+
return h(PanelBarItem_1.PanelBarItem, __assign({
|
|
156
|
+
props: this.v3 ? undefined : item
|
|
157
|
+
}, item));
|
|
158
|
+
}, this)]);
|
|
175
159
|
},
|
|
176
160
|
methods: {
|
|
177
161
|
handleSelect: function handleSelect(event) {
|
|
@@ -181,23 +165,22 @@ var PanelBarVue2 = {
|
|
|
181
165
|
onSelect: function onSelect(event) {
|
|
182
166
|
var _this = this;
|
|
183
167
|
|
|
184
|
-
var flattenChildren =
|
|
185
|
-
|
|
168
|
+
var flattenChildren = util_1.flatChildren(this.computedItems);
|
|
186
169
|
var selectedChild;
|
|
187
170
|
var newExpanded;
|
|
188
171
|
flattenChildren.forEach(function (child) {
|
|
189
|
-
if (child.
|
|
172
|
+
if (child.uniquePrivateKey === (event.uniquePrivateKey || _this.currentFocused)) {
|
|
190
173
|
selectedChild = child;
|
|
191
174
|
}
|
|
192
175
|
});
|
|
193
176
|
|
|
194
177
|
switch (this.expandMode) {
|
|
195
178
|
case 'single':
|
|
196
|
-
newExpanded = __spreadArrays(selectedChild.
|
|
179
|
+
newExpanded = __spreadArrays(selectedChild.parentUniquePrivateKey, [selectedChild.uniquePrivateKey]);
|
|
197
180
|
|
|
198
181
|
if (util_1.isArrayEqual(this.expandedItems, newExpanded)) {
|
|
199
|
-
if (selectedChild.
|
|
200
|
-
newExpanded = __spreadArrays(selectedChild.
|
|
182
|
+
if (selectedChild.parentUniquePrivateKey) {
|
|
183
|
+
newExpanded = __spreadArrays(selectedChild.parentUniquePrivateKey);
|
|
201
184
|
} else {
|
|
202
185
|
newExpanded = [];
|
|
203
186
|
}
|
|
@@ -207,8 +190,8 @@ var PanelBarVue2 = {
|
|
|
207
190
|
|
|
208
191
|
case 'multiple':
|
|
209
192
|
newExpanded = this.expandedItems.slice();
|
|
210
|
-
var index = newExpanded.indexOf(selectedChild.
|
|
211
|
-
index === -1 ? newExpanded.push(selectedChild.
|
|
193
|
+
var index = newExpanded.indexOf(selectedChild.uniquePrivateKey);
|
|
194
|
+
index === -1 ? newExpanded.push(selectedChild.uniquePrivateKey) : newExpanded.splice(index, 1);
|
|
212
195
|
break;
|
|
213
196
|
|
|
214
197
|
default:
|
|
@@ -216,17 +199,12 @@ var PanelBarVue2 = {
|
|
|
216
199
|
break;
|
|
217
200
|
}
|
|
218
201
|
|
|
219
|
-
this.
|
|
220
|
-
|
|
221
|
-
|
|
202
|
+
this.currentSelected = selectedChild.uniquePrivateKey;
|
|
203
|
+
this.currentExpanded = newExpanded;
|
|
204
|
+
this.$emit('select', {
|
|
205
|
+
target: selectedChild,
|
|
206
|
+
expandedItems: newExpanded
|
|
222
207
|
});
|
|
223
|
-
|
|
224
|
-
if (this.props.onSelect) {
|
|
225
|
-
this.props.onSelect.call(undefined, {
|
|
226
|
-
target: selectedChild,
|
|
227
|
-
expandedItems: newExpanded
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
208
|
},
|
|
231
209
|
onFocus: function onFocus(event, step) {
|
|
232
210
|
var _this = this;
|
|
@@ -235,21 +213,18 @@ var PanelBarVue2 = {
|
|
|
235
213
|
step = 0;
|
|
236
214
|
}
|
|
237
215
|
|
|
238
|
-
var flattenChildren =
|
|
239
|
-
|
|
216
|
+
var flattenChildren = util_1.flatVisibleChildren(this.computedItems);
|
|
240
217
|
var focusedChild;
|
|
241
218
|
flattenChildren.forEach(function (child, ixd) {
|
|
242
|
-
if (child.
|
|
219
|
+
if (child.uniquePrivateKey === (event.uniquePrivateKey || _this.currentFocused)) {
|
|
243
220
|
var index = ixd + step < 0 ? 0 : ixd + step > flattenChildren.length ? flattenChildren.length - 1 : ixd + step;
|
|
244
221
|
focusedChild = flattenChildren[index];
|
|
245
222
|
}
|
|
246
223
|
});
|
|
247
224
|
|
|
248
225
|
if (focusedChild) {
|
|
249
|
-
this.activeDescendant = focusedChild.
|
|
250
|
-
this.
|
|
251
|
-
focused: focusedChild.props.uniquePrivateKey
|
|
252
|
-
});
|
|
226
|
+
this.activeDescendant = focusedChild.id;
|
|
227
|
+
this.currentFocused = focusedChild.uniquePrivateKey;
|
|
253
228
|
}
|
|
254
229
|
},
|
|
255
230
|
onNavigate: function onNavigate(event, action) {
|
|
@@ -281,20 +256,13 @@ var PanelBarVue2 = {
|
|
|
281
256
|
handleWrapperFocus: function handleWrapperFocus() {
|
|
282
257
|
clearTimeout(this.nextTickId);
|
|
283
258
|
|
|
284
|
-
if (!this.
|
|
285
|
-
this.
|
|
286
|
-
wrapperFocused: true
|
|
287
|
-
});
|
|
259
|
+
if (!this.wrapperFocused) {
|
|
260
|
+
this.wrapperFocused = true;
|
|
288
261
|
}
|
|
289
262
|
},
|
|
290
263
|
handleWrapperBlur: function handleWrapperBlur() {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
this.nextTick(function () {
|
|
294
|
-
_this.setState({
|
|
295
|
-
wrapperFocused: false
|
|
296
|
-
});
|
|
297
|
-
});
|
|
264
|
+
// this.nextTick(() => {
|
|
265
|
+
this.wrapperFocused = false; // });
|
|
298
266
|
},
|
|
299
267
|
handleKeyDown: function handleKeyDown(event) {
|
|
300
268
|
var rtl = this._element && getComputedStyle(this._element).direction === 'rtl' || false;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 PanelBarGroupProps {
|
|
10
|
+
item?: object;
|
|
11
|
+
items?: any[];
|
|
12
|
+
animation?: boolean;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
content?: any;
|
|
16
|
+
keepItemsMounted?: boolean;
|
|
17
|
+
uniquePrivateKey?: string;
|
|
18
|
+
}
|
|
19
|
+
/** @hidden */
|
|
20
|
+
interface PanelBarGroupState {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
export interface PanelBarGroupComputed {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
export interface PanelBarGroupMethods {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
export interface PanelBarGroupData {
|
|
38
|
+
show: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
export interface PanelBarGroupAll extends Vue2type, PanelBarGroupMethods, PanelBarGroupData, PanelBarGroupComputed, PanelBarGroupState {
|
|
44
|
+
}
|
|
45
|
+
declare let PanelBarGroupVue2: ComponentOptions<PanelBarGroupAll, DefaultData<PanelBarGroupData>, DefaultMethods<PanelBarGroupAll>, PanelBarGroupComputed, RecordPropsDefinition<PanelBarGroupProps>>;
|
|
46
|
+
declare const PanelBarGroup: DefineComponent<PanelBarGroupProps, any, PanelBarGroupData, PanelBarGroupComputed, PanelBarGroupMethods, {}, {}, {}, string, PanelBarGroupProps, PanelBarGroupProps, {}>;
|
|
47
|
+
export { PanelBarGroup, PanelBarGroupVue2 };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __assign = undefined && undefined.__assign || function () {
|
|
4
|
+
__assign = Object.assign || function (t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
|
|
8
|
+
for (var p in s) {
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return __assign.apply(this, arguments);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
exports.PanelBarGroupVue2 = exports.PanelBarGroup = void 0; // @ts-ignore
|
|
23
|
+
|
|
24
|
+
var Vue = require("vue");
|
|
25
|
+
|
|
26
|
+
var allVue = Vue;
|
|
27
|
+
var gh = allVue.h;
|
|
28
|
+
|
|
29
|
+
var kendo_vue_animation_1 = require("@progress/kendo-vue-animation");
|
|
30
|
+
|
|
31
|
+
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
32
|
+
|
|
33
|
+
var PanelBarItem_1 = require("./PanelBarItem"); // tslint:enable:max-line-length
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var PanelBarGroupVue2 = {
|
|
37
|
+
name: 'KendoPanelBarGroup',
|
|
38
|
+
props: {
|
|
39
|
+
item: Object,
|
|
40
|
+
items: Array,
|
|
41
|
+
animation: Boolean,
|
|
42
|
+
expanded: Boolean,
|
|
43
|
+
disabled: Boolean,
|
|
44
|
+
keepItemsMounted: Boolean,
|
|
45
|
+
uniquePrivateKey: String,
|
|
46
|
+
content: Object
|
|
47
|
+
},
|
|
48
|
+
data: function data() {
|
|
49
|
+
return {
|
|
50
|
+
show: this.$props.expanded
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
setup: !gh ? undefined : function () {
|
|
55
|
+
var v3 = !!gh;
|
|
56
|
+
return {
|
|
57
|
+
v3: v3
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
render: function render(createElement) {
|
|
62
|
+
var h = gh || createElement;
|
|
63
|
+
var _a = this.$props,
|
|
64
|
+
items = _a.items,
|
|
65
|
+
uniquePrivateKey = _a.uniquePrivateKey,
|
|
66
|
+
disabled = _a.disabled,
|
|
67
|
+
expanded = _a.expanded,
|
|
68
|
+
animation = _a.animation,
|
|
69
|
+
keepItemsMounted = _a.keepItemsMounted;
|
|
70
|
+
var animationStyle = {
|
|
71
|
+
display: 'block'
|
|
72
|
+
};
|
|
73
|
+
var content = kendo_vue_common_1.getTemplate.call(this, {
|
|
74
|
+
h: h,
|
|
75
|
+
template: this.$props.content,
|
|
76
|
+
defaultRendering: null,
|
|
77
|
+
additionalProps: __assign(__assign({}, this.$props), {
|
|
78
|
+
show: this.show
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
var opened = !disabled && expanded;
|
|
82
|
+
var itemContent = opened || keepItemsMounted ? items ? h("ul", {
|
|
83
|
+
role: "group",
|
|
84
|
+
attrs: this.v3 ? undefined : {
|
|
85
|
+
role: "group"
|
|
86
|
+
},
|
|
87
|
+
"class": "k-panelbar-group k-panel k-group",
|
|
88
|
+
style: {
|
|
89
|
+
display: keepItemsMounted ? this.$data.show ? 'block' : 'none' : 'block'
|
|
90
|
+
}
|
|
91
|
+
}, [items.map(function (item) {
|
|
92
|
+
return h(PanelBarItem_1.PanelBarItem, __assign({
|
|
93
|
+
props: this.v3 ? undefined : item
|
|
94
|
+
}, item));
|
|
95
|
+
}, this)]) : this.$props.content ? h("div", {
|
|
96
|
+
"class": "k-panelbar-content k-content"
|
|
97
|
+
}, [content]) : null : null;
|
|
98
|
+
return (animation !== undefined ? animation : true) && !disabled ? // @ts-ignore function children
|
|
99
|
+
h(kendo_vue_animation_1.Reveal, {
|
|
100
|
+
appear: opened,
|
|
101
|
+
attrs: this.v3 ? undefined : {
|
|
102
|
+
appear: opened,
|
|
103
|
+
transitionEnterDuration: 200,
|
|
104
|
+
transitionExitDuration: 200,
|
|
105
|
+
// childFactory={keepItemsMounted && this.childFactory}
|
|
106
|
+
unmountOnExit: !keepItemsMounted
|
|
107
|
+
},
|
|
108
|
+
transitionEnterDuration: 200,
|
|
109
|
+
transitionExitDuration: 200,
|
|
110
|
+
key: uniquePrivateKey + '_animation',
|
|
111
|
+
style: animationStyle,
|
|
112
|
+
unmountOnExit: !keepItemsMounted,
|
|
113
|
+
onEntering: this.handleEntering,
|
|
114
|
+
on: this.v3 ? undefined : {
|
|
115
|
+
"entering": this.handleEntering,
|
|
116
|
+
"exited": this.handleExited
|
|
117
|
+
},
|
|
118
|
+
onExited: this.handleExited
|
|
119
|
+
}, this.v3 ? function () {
|
|
120
|
+
return [itemContent];
|
|
121
|
+
} : [itemContent]) : itemContent;
|
|
122
|
+
},
|
|
123
|
+
methods: {
|
|
124
|
+
handleEntering: function handleEntering() {
|
|
125
|
+
if (this.keepItemsMounted) {
|
|
126
|
+
this.show = true;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
handleExited: function handleExited() {
|
|
130
|
+
if (this.keepItemsMounted) {
|
|
131
|
+
this.show = false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
exports.PanelBarGroupVue2 = PanelBarGroupVue2;
|
|
137
|
+
var PanelBarGroup = PanelBarGroupVue2;
|
|
138
|
+
exports.PanelBarGroup = PanelBarGroup;
|