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