@progress/kendo-vue-layout 3.1.2 → 3.1.4-dev.202204051326
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-layout.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 +117 -67
- package/dist/es/splitter/SplitterPane.d.ts +8 -30
- package/dist/es/splitter/SplitterPane.js +10 -4
- 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 +117 -67
- package/dist/npm/splitter/SplitterPane.d.ts +8 -30
- package/dist/npm/splitter/SplitterPane.js +9 -3
- package/package.json +10 -10
package/dist/es/panelbar/util.js
CHANGED
|
@@ -1,63 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var __spreadArrays = this && this.__spreadArrays || function () {
|
|
18
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
|
19
|
+
s += arguments[i].length;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
23
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
24
|
+
r[k] = a[j];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return r;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
import { getListeners, templateRendering } from '@progress/kendo-vue-common';
|
|
2
32
|
/**
|
|
3
33
|
* @hidden
|
|
4
34
|
*/
|
|
5
35
|
|
|
6
|
-
export var renderChildren = function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
export var renderChildren = function renderChildren(items, _a) {
|
|
37
|
+
var _b = _a.animation,
|
|
38
|
+
animation = _b === void 0 ? true : _b,
|
|
39
|
+
_c = _a.keepItemsMounted,
|
|
40
|
+
keepItemsMounted = _c === void 0 ? false : _c,
|
|
41
|
+
state = _a.state,
|
|
42
|
+
expanded = _a.expanded,
|
|
43
|
+
handleSelect = _a.handleSelect,
|
|
44
|
+
_d = _a.parentExpanded,
|
|
45
|
+
parentExpanded = _d === void 0 ? true : _d,
|
|
46
|
+
_e = _a.level,
|
|
47
|
+
level = _e === void 0 ? 0 : _e,
|
|
48
|
+
_f = _a.parentPrivateKey,
|
|
49
|
+
parentPrivateKey = _f === void 0 ? [] : _f;
|
|
50
|
+
return items.map(function (child, idx) {
|
|
51
|
+
var nestedChildren;
|
|
52
|
+
var privateKey = getId(child, parentPrivateKey, idx);
|
|
53
|
+
var content = templateRendering.call(this, child.content, getListeners.call(this));
|
|
54
|
+
var header = templateRendering.call(this, child.header, getListeners.call(this));
|
|
55
|
+
|
|
56
|
+
if (child.items) {
|
|
57
|
+
var renderState = {
|
|
58
|
+
animation: animation,
|
|
59
|
+
keepItemsMounted: keepItemsMounted,
|
|
60
|
+
state: state,
|
|
61
|
+
expanded: expanded,
|
|
62
|
+
handleSelect: handleSelect,
|
|
63
|
+
parentExpanded: (expanded || []).indexOf(privateKey) > -1,
|
|
64
|
+
level: level + 1,
|
|
65
|
+
parentPrivateKey: __spreadArrays(parentPrivateKey, [privateKey])
|
|
66
|
+
};
|
|
67
|
+
nestedChildren = renderChildren.call(this, child.items, renderState);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return __assign(__assign({}, child), {
|
|
71
|
+
animation: child.animation !== undefined ? child.animation : animation,
|
|
72
|
+
keepItemsMounted: keepItemsMounted,
|
|
73
|
+
id: child.id || "k-panelbar-item-default-" + privateKey,
|
|
74
|
+
uniquePrivateKey: privateKey,
|
|
75
|
+
parentUniquePrivateKey: parentPrivateKey,
|
|
76
|
+
parentExpanded: parentExpanded,
|
|
77
|
+
level: level,
|
|
78
|
+
expanded: (expanded || []).indexOf(privateKey) > -1,
|
|
79
|
+
focused: state.currentFocused === privateKey && state.wrapperFocused,
|
|
80
|
+
selected: state.currentSelected === privateKey,
|
|
81
|
+
items: nestedChildren,
|
|
82
|
+
content: content,
|
|
83
|
+
header: header
|
|
84
|
+
});
|
|
85
|
+
}, this);
|
|
54
86
|
};
|
|
55
87
|
/**
|
|
56
88
|
* @hidden
|
|
57
89
|
*/
|
|
58
90
|
|
|
59
|
-
export var getFirstId = function getFirstId(
|
|
60
|
-
var firstItem =
|
|
91
|
+
export var getFirstId = function getFirstId(props) {
|
|
92
|
+
var firstItem = props.items[0];
|
|
61
93
|
|
|
62
94
|
if (firstItem) {
|
|
63
95
|
return getId(firstItem, [], 0);
|
|
@@ -69,52 +101,49 @@ export var getFirstId = function getFirstId(_props) {
|
|
|
69
101
|
* @hidden
|
|
70
102
|
*/
|
|
71
103
|
|
|
72
|
-
export var getInitialState = function getInitialState(props,
|
|
73
|
-
// React.Children.map(props.children, (child: React.ReactElement<any>, idx) => {
|
|
74
|
-
// if (child && child.type === PanelBarItem) {
|
|
75
|
-
// let privateKey = getId(child, parentPrivateKey, idx);
|
|
104
|
+
export var getInitialState = function getInitialState(props, expandMode, result, parentExpanded, parentPrivateKey) {
|
|
76
105
|
if (result === void 0) {
|
|
77
106
|
result = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
107
|
+
currentExpanded: props.expanded || [],
|
|
108
|
+
currentSelected: props.selected || '',
|
|
109
|
+
currentFocused: props.focused || '',
|
|
81
110
|
wrapperFocused: false
|
|
82
111
|
};
|
|
83
112
|
}
|
|
84
113
|
|
|
85
|
-
if (
|
|
86
|
-
|
|
114
|
+
if (parentExpanded === void 0) {
|
|
115
|
+
parentExpanded = true;
|
|
87
116
|
}
|
|
88
117
|
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// }
|
|
105
|
-
// if (child.props.children) {
|
|
106
|
-
// result = getInitialState(
|
|
107
|
-
// child.props,
|
|
108
|
-
// expandMode,
|
|
109
|
-
// result,
|
|
110
|
-
// !!child.props.expanded,
|
|
111
|
-
// [...parentPrivateKey, privateKey]);
|
|
112
|
-
// }
|
|
113
|
-
// }
|
|
114
|
-
// }
|
|
115
|
-
// });
|
|
118
|
+
if (parentPrivateKey === void 0) {
|
|
119
|
+
parentPrivateKey = [];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
props.items.forEach(function (item, idx) {
|
|
123
|
+
var privateKey = getId(item, parentPrivateKey, idx);
|
|
124
|
+
|
|
125
|
+
if (!item.disabled && parentExpanded) {
|
|
126
|
+
if (item.selected) {
|
|
127
|
+
result.currentSelected = privateKey;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (item.focused) {
|
|
131
|
+
result.currentFocused = privateKey;
|
|
132
|
+
}
|
|
116
133
|
|
|
134
|
+
if (item.expanded) {
|
|
135
|
+
if (expandMode === 'multiple') {
|
|
136
|
+
result.currentExpanded.push(privateKey);
|
|
137
|
+
} else if (expandMode === 'single') {
|
|
138
|
+
result.currentExpanded = [privateKey];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
117
141
|
|
|
142
|
+
if (item.items) {
|
|
143
|
+
result = getInitialState(item, expandMode, result, !!item.expanded, __spreadArrays(parentPrivateKey, [privateKey]));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
118
147
|
return result;
|
|
119
148
|
};
|
|
120
149
|
/**
|
|
@@ -149,38 +178,40 @@ export function flatVisibleItems(data, flattedItems) {
|
|
|
149
178
|
* @hidden
|
|
150
179
|
*/
|
|
151
180
|
|
|
152
|
-
export function flatChildren(
|
|
181
|
+
export function flatChildren(children, flattenChildren) {
|
|
153
182
|
if (flattenChildren === void 0) {
|
|
154
183
|
flattenChildren = [];
|
|
155
|
-
}
|
|
156
|
-
// if (child && child.props && !child.props.disabled) {
|
|
157
|
-
// flattenChildren.push(child);
|
|
158
|
-
// if (child.props.children) {
|
|
159
|
-
// flatChildren(child.props.children, flattenChildren);
|
|
160
|
-
// }
|
|
161
|
-
// }
|
|
162
|
-
// });
|
|
184
|
+
}
|
|
163
185
|
|
|
186
|
+
children.forEach(function (child) {
|
|
187
|
+
if (child && child && !child.disabled) {
|
|
188
|
+
flattenChildren.push(child);
|
|
164
189
|
|
|
190
|
+
if (child.items) {
|
|
191
|
+
flatChildren(child.items, flattenChildren);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
165
195
|
return flattenChildren;
|
|
166
196
|
}
|
|
167
197
|
/**
|
|
168
198
|
* @hidden
|
|
169
199
|
*/
|
|
170
200
|
|
|
171
|
-
export function flatVisibleChildren(
|
|
201
|
+
export function flatVisibleChildren(children, flattenVisibleChildren) {
|
|
172
202
|
if (flattenVisibleChildren === void 0) {
|
|
173
203
|
flattenVisibleChildren = [];
|
|
174
|
-
}
|
|
175
|
-
// if (child && child.props && !child.props.disabled && (child.props.expanded || child.props.parentExpanded)) {
|
|
176
|
-
// flattenVisibleChildren.push(child);
|
|
177
|
-
// if (child.props.children) {
|
|
178
|
-
// flatVisibleChildren(child.props.children, flattenVisibleChildren);
|
|
179
|
-
// }
|
|
180
|
-
// }
|
|
181
|
-
// });
|
|
204
|
+
}
|
|
182
205
|
|
|
206
|
+
children.forEach(function (child) {
|
|
207
|
+
if (child && !child.disabled && (child.expanded || child.parentExpanded)) {
|
|
208
|
+
flattenVisibleChildren.push(child);
|
|
183
209
|
|
|
210
|
+
if (child.items) {
|
|
211
|
+
flatVisibleChildren(child.items, flattenVisibleChildren);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
184
215
|
return flattenVisibleChildren;
|
|
185
216
|
}
|
|
186
217
|
/**
|
|
@@ -190,51 +221,10 @@ export function flatVisibleChildren(_children, flattenVisibleChildren) {
|
|
|
190
221
|
export var isPresent = function isPresent(value) {
|
|
191
222
|
return value !== null && value !== undefined;
|
|
192
223
|
};
|
|
193
|
-
/**
|
|
194
|
-
* Represents the PanelBarUtils functions.
|
|
195
|
-
*/
|
|
196
|
-
|
|
197
|
-
export var PanelBarUtils;
|
|
198
|
-
|
|
199
|
-
(function (PanelBarUtils) {
|
|
200
|
-
/**
|
|
201
|
-
* Maps a collection of PanelBarItemProps to PanelBarItem components
|
|
202
|
-
* ([see example]({% slug customization_panelbar %})).
|
|
203
|
-
* Contained in the `PanelBarUtils` object.
|
|
204
|
-
*
|
|
205
|
-
* @param items - A collection of PanelBarItemProps.
|
|
206
|
-
* @return {PanelBarItem[]} Returns an array of PanelBarItem components.
|
|
207
|
-
*/
|
|
208
|
-
function mapItemsToComponents(items) {
|
|
209
|
-
return items.map(function (item, idx) {
|
|
210
|
-
var children;
|
|
211
|
-
|
|
212
|
-
if (item.content) {
|
|
213
|
-
children = item.content;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (item.children) {
|
|
217
|
-
children = mapItemsToComponents(item.children);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return h(PanelBarItem // {...item}
|
|
221
|
-
, {
|
|
222
|
-
children: children,
|
|
223
|
-
attrs: this.v3 ? undefined : {
|
|
224
|
-
children: children
|
|
225
|
-
},
|
|
226
|
-
key: item.id || idx
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
PanelBarUtils.mapItemsToComponents = mapItemsToComponents;
|
|
232
|
-
})(PanelBarUtils || (PanelBarUtils = {}));
|
|
233
224
|
/**
|
|
234
225
|
* @hidden
|
|
235
226
|
*/
|
|
236
227
|
|
|
237
|
-
|
|
238
228
|
export var isArrayEqual = function isArrayEqual(firstArray, secondArray) {
|
|
239
229
|
if (firstArray.length !== secondArray.length) {
|
|
240
230
|
return false;
|
|
@@ -41,10 +41,6 @@ export interface SplitterProps {
|
|
|
41
41
|
* Fires after a Splitter pane is resized or collapsed. Useful for updating the pane options and triggering layout calculations on components which are positioned inside the panes.
|
|
42
42
|
*/
|
|
43
43
|
onChange?: (event: SplitterOnChangeEvent) => void;
|
|
44
|
-
/**
|
|
45
|
-
* The class name that is set to the Splitter.
|
|
46
|
-
*/
|
|
47
|
-
className?: string;
|
|
48
44
|
}
|
|
49
45
|
/**
|
|
50
46
|
* @hidden
|
|
@@ -74,7 +70,7 @@ export interface SplitterData {
|
|
|
74
70
|
originalY: number;
|
|
75
71
|
originalPrevSize: number;
|
|
76
72
|
originalNextSize: number;
|
|
77
|
-
|
|
73
|
+
currentPanes: SplitterPaneProps[];
|
|
78
74
|
}
|
|
79
75
|
/**
|
|
80
76
|
* @hidden
|