@progress/kendo-react-layout 4.14.0-dev.202112221027 → 4.14.0-dev.202201131122
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/LICENSE.md +1 -1
- package/NOTICE.txt +54 -21
- package/README.md +1 -1
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/dist/es/expansionpanel/ExpansionPanel.d.ts +6 -0
- package/dist/es/expansionpanel/ExpansionPanel.js +72 -0
- package/dist/es/expansionpanel/ExpansionPanelContent.d.ts +5 -0
- package/dist/es/expansionpanel/ExpansionPanelContent.js +21 -0
- package/dist/es/expansionpanel/index.d.ts +3 -0
- package/dist/es/expansionpanel/index.js +2 -0
- package/dist/es/expansionpanel/interfaces.d.ts +77 -0
- package/dist/es/expansionpanel/interfaces.js +0 -0
- package/dist/es/main.d.ts +5 -1
- package/dist/es/main.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/panelbar/PanelBar.d.ts +10 -30
- package/dist/es/panelbar/PanelBar.js +131 -45
- package/dist/es/panelbar/PanelBarItem.d.ts +1 -89
- package/dist/es/panelbar/PanelBarItem.js +3 -1
- package/dist/es/panelbar/interfaces/NavigationAction.d.ts +8 -0
- package/dist/es/panelbar/interfaces/NavigationAction.js +9 -0
- package/dist/es/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +8 -0
- package/dist/es/panelbar/interfaces/PanelBarItemClickEventArguments.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarItemProps.d.ts +90 -0
- package/dist/es/panelbar/interfaces/PanelBarItemProps.js +0 -0
- package/dist/es/panelbar/{PanelBarInterface.d.ts → interfaces/PanelBarProps.d.ts} +19 -23
- package/dist/es/panelbar/interfaces/PanelBarProps.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +15 -0
- package/dist/es/panelbar/interfaces/PanelBarSelectEventArguments.js +0 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.d.ts +16 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.js +0 -0
- package/dist/es/panelbar/util.d.ts +19 -5
- package/dist/es/panelbar/util.js +75 -21
- package/dist/npm/expansionpanel/ExpansionPanel.d.ts +6 -0
- package/dist/npm/expansionpanel/ExpansionPanel.js +74 -0
- package/dist/npm/expansionpanel/ExpansionPanelContent.d.ts +5 -0
- package/dist/npm/expansionpanel/ExpansionPanelContent.js +23 -0
- package/dist/npm/expansionpanel/index.d.ts +3 -0
- package/dist/npm/expansionpanel/index.js +7 -0
- package/dist/npm/expansionpanel/interfaces.d.ts +77 -0
- package/dist/npm/{panelbar/PanelBarInterface.js → expansionpanel/interfaces.js} +0 -1
- package/dist/npm/main.d.ts +5 -1
- package/dist/npm/main.js +1 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/panelbar/PanelBar.d.ts +10 -30
- package/dist/npm/panelbar/PanelBar.js +132 -46
- package/dist/npm/panelbar/PanelBarItem.d.ts +1 -89
- package/dist/npm/panelbar/PanelBarItem.js +3 -1
- package/dist/npm/panelbar/interfaces/NavigationAction.d.ts +8 -0
- package/dist/npm/panelbar/interfaces/NavigationAction.js +11 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +8 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemClickEventArguments.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.d.ts +90 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.js +2 -0
- package/dist/npm/panelbar/{PanelBarInterface.d.ts → interfaces/PanelBarProps.d.ts} +19 -23
- package/dist/npm/panelbar/interfaces/PanelBarProps.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +15 -0
- package/dist/npm/panelbar/interfaces/PanelBarSelectEventArguments.js +2 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.d.ts +16 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.js +2 -0
- package/dist/npm/panelbar/util.d.ts +19 -5
- package/dist/npm/panelbar/util.js +77 -21
- package/dist/systemjs/kendo-react-layout.js +1 -1
- package/package.json +13 -13
- package/dist/es/panelbar/PanelBarInterface.js +0 -1
- package/dist/es/panelbar/services/navigationService.d.ts +0 -23
- package/dist/es/panelbar/services/navigationService.js +0 -51
- package/dist/es/panelbar/services/selectionService.d.ts +0 -23
- package/dist/es/panelbar/services/selectionService.js +0 -88
- package/dist/npm/panelbar/services/navigationService.d.ts +0 -23
- package/dist/npm/panelbar/services/navigationService.js +0 -53
- package/dist/npm/panelbar/services/selectionService.d.ts +0 -23
- package/dist/npm/panelbar/services/selectionService.js +0 -90
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PanelBarState } from './PanelBar';
|
|
3
|
-
import { PanelBarItem
|
|
4
|
-
import {
|
|
3
|
+
import { PanelBarItem } from './PanelBarItem';
|
|
4
|
+
import { RenderPanelBarItem } from './interfaces/RenderPanelBarItem';
|
|
5
|
+
import { PanelBarItemProps } from '../main';
|
|
6
|
+
import { PanelBarExpandMode } from './interfaces/PanelBarProps';
|
|
5
7
|
/**
|
|
6
8
|
* @hidden
|
|
7
9
|
*/
|
|
8
|
-
export declare const renderChildren: (animation
|
|
10
|
+
export declare const renderChildren: ({ animation, keepItemsMounted, state, expanded, handleSelect, children, parentExpanded, level, parentPrivateKey }: RenderPanelBarItem) => React.ReactNode;
|
|
9
11
|
/**
|
|
10
12
|
* @hidden
|
|
11
13
|
*/
|
|
12
|
-
export declare const
|
|
14
|
+
export declare const getFirstId: (props: any) => any;
|
|
13
15
|
/**
|
|
14
16
|
* @hidden
|
|
15
17
|
*/
|
|
16
|
-
export declare
|
|
18
|
+
export declare const getInitialState: (props: any, expandMode: PanelBarExpandMode, result?: PanelBarState, parentExpanded?: boolean, parentPrivateKey?: string[]) => PanelBarState;
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export declare function flatVisibleItems(data: any, flattedItems?: any[]): any[];
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
export declare function flatChildren(children: any, flattenChildren?: any[]): any[];
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
export declare function flatVisibleChildren(children: any, flattenVisibleChildren?: any[]): any[];
|
|
17
31
|
/**
|
|
18
32
|
* @hidden
|
|
19
33
|
*/
|
|
@@ -16,23 +16,27 @@ var PanelBarItem_1 = require("./PanelBarItem");
|
|
|
16
16
|
/**
|
|
17
17
|
* @hidden
|
|
18
18
|
*/
|
|
19
|
-
exports.renderChildren = function (
|
|
20
|
-
|
|
21
|
-
if (keepItemsMounted === void 0) { keepItemsMounted = false; }
|
|
22
|
-
if (parentExpanded === void 0) { parentExpanded = true; }
|
|
23
|
-
if (level === void 0) { level = 0; }
|
|
24
|
-
if (parentPrivateKey === void 0) { parentPrivateKey = []; }
|
|
19
|
+
exports.renderChildren = function (_a) {
|
|
20
|
+
var _b = _a.animation, animation = _b === void 0 ? true : _b, _c = _a.keepItemsMounted, keepItemsMounted = _c === void 0 ? false : _c, state = _a.state, expanded = _a.expanded, handleSelect = _a.handleSelect, children = _a.children, _d = _a.parentExpanded, parentExpanded = _d === void 0 ? true : _d, _e = _a.level, level = _e === void 0 ? 0 : _e, _f = _a.parentPrivateKey, parentPrivateKey = _f === void 0 ? [] : _f;
|
|
25
21
|
return React.Children.map(children, function (child, idx) {
|
|
26
22
|
if (child && child.type === PanelBarItem_1.PanelBarItem) {
|
|
27
23
|
var nestedChildren = void 0;
|
|
28
|
-
var privateKey = parentPrivateKey
|
|
29
|
-
parentPrivateKey[parentPrivateKey.length - 1] + ("." + idx)
|
|
30
|
-
: "." + idx;
|
|
24
|
+
var privateKey = getId(child, parentPrivateKey, idx);
|
|
31
25
|
if (child.props.children) {
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
var renderState = {
|
|
27
|
+
animation: animation,
|
|
28
|
+
keepItemsMounted: keepItemsMounted,
|
|
29
|
+
state: state,
|
|
30
|
+
expanded: expanded,
|
|
31
|
+
handleSelect: handleSelect,
|
|
32
|
+
children: child.props.children,
|
|
33
|
+
parentExpanded: (expanded || []).indexOf(privateKey) > -1,
|
|
34
|
+
level: level + 1,
|
|
35
|
+
parentPrivateKey: parentPrivateKey.concat([privateKey])
|
|
36
|
+
};
|
|
37
|
+
nestedChildren = exports.renderChildren(renderState);
|
|
34
38
|
}
|
|
35
|
-
return React.cloneElement(child, __assign({}, child.props, { animation: child.props.animation !== undefined ? child.props.animation : animation, keepItemsMounted: keepItemsMounted, id: child.props.id || "k-panelbar-item-default-" + privateKey, uniquePrivateKey: privateKey, parentUniquePrivateKey: parentPrivateKey, parentExpanded: parentExpanded, level: level, expanded: (
|
|
39
|
+
return React.cloneElement(child, __assign({}, child.props, { animation: child.props.animation !== undefined ? child.props.animation : animation, keepItemsMounted: keepItemsMounted, id: child.props.id || "k-panelbar-item-default-" + privateKey, uniquePrivateKey: privateKey, parentUniquePrivateKey: parentPrivateKey, parentExpanded: parentExpanded, level: level, expanded: (expanded || []).indexOf(privateKey) > -1, focused: state.focused === privateKey && state.wrapperFocused, selected: state.selected === privateKey, children: nestedChildren, onSelect: handleSelect }));
|
|
36
40
|
}
|
|
37
41
|
else {
|
|
38
42
|
return React.createElement("div", { className: "k-panelbar-content k-content" }, child);
|
|
@@ -42,21 +46,28 @@ exports.renderChildren = function (animation, keepItemsMounted, state, handleSel
|
|
|
42
46
|
/**
|
|
43
47
|
* @hidden
|
|
44
48
|
*/
|
|
45
|
-
exports.
|
|
49
|
+
exports.getFirstId = function (props) {
|
|
50
|
+
var firstItem = React.Children.toArray(props.children)[0];
|
|
51
|
+
if (firstItem) {
|
|
52
|
+
return getId(firstItem, [], 0);
|
|
53
|
+
}
|
|
54
|
+
return '';
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
*/
|
|
59
|
+
exports.getInitialState = function (props, expandMode, result, parentExpanded, parentPrivateKey) {
|
|
46
60
|
if (result === void 0) { result = {
|
|
47
61
|
expanded: props.expanded || [],
|
|
48
62
|
selected: props.selected || '',
|
|
49
|
-
focused: props.focused || '
|
|
63
|
+
focused: props.focused || '',
|
|
50
64
|
wrapperFocused: false
|
|
51
65
|
}; }
|
|
52
|
-
if (_ === void 0) { _ = true; }
|
|
53
66
|
if (parentExpanded === void 0) { parentExpanded = true; }
|
|
54
67
|
if (parentPrivateKey === void 0) { parentPrivateKey = []; }
|
|
55
68
|
React.Children.map(props.children, function (child, idx) {
|
|
56
69
|
if (child && child.type === PanelBarItem_1.PanelBarItem) {
|
|
57
|
-
var privateKey = parentPrivateKey
|
|
58
|
-
parentPrivateKey[parentPrivateKey.length - 1] + ("." + idx)
|
|
59
|
-
: "." + idx;
|
|
70
|
+
var privateKey = getId(child, parentPrivateKey, idx);
|
|
60
71
|
if (!child.props.disabled && parentExpanded) {
|
|
61
72
|
if (child.props.selected) {
|
|
62
73
|
result.selected = privateKey;
|
|
@@ -73,7 +84,7 @@ exports.getInitialState = function (props, expandMode, result, _, parentExpanded
|
|
|
73
84
|
}
|
|
74
85
|
}
|
|
75
86
|
if (child.props.children) {
|
|
76
|
-
result = exports.getInitialState(child.props, expandMode, result,
|
|
87
|
+
result = exports.getInitialState(child.props, expandMode, result, !!child.props.expanded, parentPrivateKey.concat([privateKey]));
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
90
|
}
|
|
@@ -83,9 +94,18 @@ exports.getInitialState = function (props, expandMode, result, _, parentExpanded
|
|
|
83
94
|
/**
|
|
84
95
|
* @hidden
|
|
85
96
|
*/
|
|
86
|
-
function
|
|
97
|
+
var getId = function (child, parentPrivateKey, idx) {
|
|
98
|
+
return child && child.props && child.props.id
|
|
99
|
+
? child.props.id
|
|
100
|
+
: parentPrivateKey.length
|
|
101
|
+
? parentPrivateKey[parentPrivateKey.length - 1] + ("." + idx)
|
|
102
|
+
: "." + idx;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* @hidden
|
|
106
|
+
*/
|
|
107
|
+
function flatVisibleItems(data, flattedItems) {
|
|
87
108
|
if (flattedItems === void 0) { flattedItems = []; }
|
|
88
|
-
if (_ === void 0) { _ = null; }
|
|
89
109
|
(data || []).forEach(function (item) {
|
|
90
110
|
if (!item.disabled) {
|
|
91
111
|
flattedItems.push(item);
|
|
@@ -97,6 +117,42 @@ function flatVisibleItems(data, flattedItems, _) {
|
|
|
97
117
|
return flattedItems;
|
|
98
118
|
}
|
|
99
119
|
exports.flatVisibleItems = flatVisibleItems;
|
|
120
|
+
/**
|
|
121
|
+
* @hidden
|
|
122
|
+
*/
|
|
123
|
+
function flatChildren(children, flattenChildren) {
|
|
124
|
+
var _this = this;
|
|
125
|
+
if (flattenChildren === void 0) { flattenChildren = []; }
|
|
126
|
+
React.Children.forEach(children, function (child) {
|
|
127
|
+
if (child && child.props && !child.props.disabled) {
|
|
128
|
+
flattenChildren.push(child);
|
|
129
|
+
if (child.props.children) {
|
|
130
|
+
_this.flatChildren(child.props.children, flattenChildren);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return flattenChildren;
|
|
135
|
+
}
|
|
136
|
+
exports.flatChildren = flatChildren;
|
|
137
|
+
;
|
|
138
|
+
/**
|
|
139
|
+
* @hidden
|
|
140
|
+
*/
|
|
141
|
+
function flatVisibleChildren(children, flattenVisibleChildren) {
|
|
142
|
+
var _this = this;
|
|
143
|
+
if (flattenVisibleChildren === void 0) { flattenVisibleChildren = []; }
|
|
144
|
+
React.Children.forEach(children, function (child) {
|
|
145
|
+
if (child && child.props && !child.props.disabled && (child.props.expanded || child.props.parentExpanded)) {
|
|
146
|
+
flattenVisibleChildren.push(child);
|
|
147
|
+
if (child.props.children) {
|
|
148
|
+
_this.flatVisibleChildren(child.props.children, flattenVisibleChildren);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return flattenVisibleChildren;
|
|
153
|
+
}
|
|
154
|
+
exports.flatVisibleChildren = flatVisibleChildren;
|
|
155
|
+
;
|
|
100
156
|
/**
|
|
101
157
|
* @hidden
|
|
102
158
|
*/
|