@progress/kendo-react-layout 4.14.0-dev.202112221027 → 4.14.0-dev.202112301830
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-react-layout.js +1 -1
- package/dist/es/main.d.ts +4 -1
- 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/main.d.ts +4 -1
- 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/{PanelBarInterface.js → interfaces/PanelBarItemClickEventArguments.js} +0 -1
- 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
package/dist/es/main.d.ts
CHANGED
|
@@ -6,7 +6,10 @@ export * from './tabstrip/TabStripTab';
|
|
|
6
6
|
export * from './panelbar/PanelBar';
|
|
7
7
|
export * from './panelbar/PanelBarItem';
|
|
8
8
|
export * from './panelbar/util';
|
|
9
|
-
export * from './panelbar/
|
|
9
|
+
export * from './panelbar/interfaces/PanelBarProps';
|
|
10
|
+
export * from './panelbar/interfaces/PanelBarItemProps';
|
|
11
|
+
export * from './panelbar/interfaces/RenderPanelBarItem';
|
|
12
|
+
export * from './panelbar/interfaces/PanelBarSelectEventArguments';
|
|
10
13
|
export * from './menu/components/Menu';
|
|
11
14
|
export * from './menu/components/MenuItemLink';
|
|
12
15
|
export * from './menu/components/MenuItem';
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-layout',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1640888048,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { NavigationAction } from './
|
|
6
|
-
/**
|
|
7
|
-
* Represents the props of the [KendoReact PanelBar component]({% slug overview_panelbar %}).
|
|
8
|
-
*/
|
|
9
|
-
export interface PanelBarProps extends PanelBarInterface {
|
|
10
|
-
/**
|
|
11
|
-
* The child can be either a single PanelBarItem or a PanelBarItem array.
|
|
12
|
-
*/
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* The class name that is set to the PanelBar.
|
|
16
|
-
*/
|
|
17
|
-
className?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Determines if the PanelBar items will be mounted after expand collapse. Defaults to `false`.
|
|
20
|
-
*/
|
|
21
|
-
keepItemsMounted?: boolean;
|
|
22
|
-
}
|
|
3
|
+
import { PanelBarProps } from '../main';
|
|
4
|
+
import { PanelBarItemClickEventArguments } from './interfaces/PanelBarItemClickEventArguments';
|
|
5
|
+
import { NavigationAction } from './interfaces/NavigationAction';
|
|
23
6
|
/**
|
|
24
7
|
* @hidden
|
|
25
8
|
*/
|
|
@@ -60,15 +43,12 @@ export declare class PanelBar extends React.Component<PanelBarProps, PanelBarSta
|
|
|
60
43
|
readonly state: PanelBarState;
|
|
61
44
|
private activeDescendant?;
|
|
62
45
|
private _element;
|
|
63
|
-
private _selectionService;
|
|
64
|
-
private _navigationService;
|
|
65
46
|
private nextTickId;
|
|
66
|
-
private readonly
|
|
47
|
+
private readonly expandMode;
|
|
48
|
+
private readonly selectedItem;
|
|
49
|
+
private readonly expandedItems;
|
|
50
|
+
private readonly children;
|
|
67
51
|
constructor(props: PanelBarProps);
|
|
68
|
-
/**
|
|
69
|
-
* @hidden
|
|
70
|
-
*/
|
|
71
|
-
componentDidUpdate(prevProps: PanelBarProps): void;
|
|
72
52
|
/**
|
|
73
53
|
* @hidden
|
|
74
54
|
*/
|
|
@@ -76,15 +56,15 @@ export declare class PanelBar extends React.Component<PanelBarProps, PanelBarSta
|
|
|
76
56
|
/**
|
|
77
57
|
* @hidden
|
|
78
58
|
*/
|
|
79
|
-
onSelect: (
|
|
59
|
+
onSelect: (event: any) => void;
|
|
80
60
|
/**
|
|
81
61
|
* @hidden
|
|
82
62
|
*/
|
|
83
|
-
onFocus: (
|
|
63
|
+
onFocus: (event: any, step?: number) => void;
|
|
84
64
|
/**
|
|
85
65
|
* @hidden
|
|
86
66
|
*/
|
|
87
|
-
onNavigate: (action: NavigationAction) => void;
|
|
67
|
+
onNavigate: (event: any, action: NavigationAction) => void;
|
|
88
68
|
/**
|
|
89
69
|
* @hidden
|
|
90
70
|
*/
|
|
@@ -25,12 +25,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
import * as React from 'react';
|
|
26
26
|
import * as PropTypes from 'prop-types';
|
|
27
27
|
import { PanelBarItem } from './PanelBarItem';
|
|
28
|
-
import { renderChildren, getInitialState } from './util';
|
|
29
|
-
import {
|
|
30
|
-
import { NavigationService, NavigationAction } from './services/navigationService';
|
|
31
|
-
import { classNames } from '@progress/kendo-react-common';
|
|
28
|
+
import { renderChildren, getInitialState, flatVisibleChildren, flatChildren, isArrayEqual, getFirstId } from './util';
|
|
29
|
+
import { classNames, Keys } from '@progress/kendo-react-common';
|
|
32
30
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
33
31
|
import { packageMetadata } from '../package-metadata';
|
|
32
|
+
import { NavigationAction } from './interfaces/NavigationAction';
|
|
34
33
|
var PanelBar = /** @class */ (function (_super) {
|
|
35
34
|
__extends(PanelBar, _super);
|
|
36
35
|
function PanelBar(props) {
|
|
@@ -40,44 +39,88 @@ var PanelBar = /** @class */ (function (_super) {
|
|
|
40
39
|
* @hidden
|
|
41
40
|
*/
|
|
42
41
|
_this.handleSelect = function (event) {
|
|
43
|
-
|
|
44
|
-
_this.
|
|
45
|
-
_this._selectionService.focus(event.uniquePrivateKey, 0, renderChildren(_this.props.animation, _this.props.keepItemsMounted, state, _this.handleSelect, _this.props.children));
|
|
42
|
+
_this.onSelect(event);
|
|
43
|
+
_this.onFocus(event);
|
|
46
44
|
};
|
|
47
45
|
/**
|
|
48
46
|
* @hidden
|
|
49
47
|
*/
|
|
50
|
-
_this.onSelect = function (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
_this.onSelect = function (event) {
|
|
49
|
+
var flattenChildren = flatChildren(React.Children.toArray(_this.children));
|
|
50
|
+
var selectedChild;
|
|
51
|
+
var newExpanded;
|
|
52
|
+
flattenChildren.forEach(function (child) {
|
|
53
|
+
if (child.props.uniquePrivateKey === (event.uniquePrivateKey || _this.state.focused)) {
|
|
54
|
+
selectedChild = child;
|
|
57
55
|
}
|
|
58
56
|
});
|
|
57
|
+
switch (_this.expandMode) {
|
|
58
|
+
case 'single':
|
|
59
|
+
newExpanded = selectedChild.props.parentUniquePrivateKey.concat([selectedChild.props.uniquePrivateKey]);
|
|
60
|
+
if (isArrayEqual(_this.expandedItems, newExpanded)) {
|
|
61
|
+
if (selectedChild.props.parentUniquePrivateKey) {
|
|
62
|
+
newExpanded = selectedChild.props.parentUniquePrivateKey.slice();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
newExpanded = [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case 'multiple':
|
|
70
|
+
newExpanded = _this.expandedItems.slice();
|
|
71
|
+
var index = newExpanded.indexOf(selectedChild.props.uniquePrivateKey);
|
|
72
|
+
index === -1 ? newExpanded.push(selectedChild.props.uniquePrivateKey) : newExpanded.splice(index, 1);
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
newExpanded = _this.expandedItems.slice();
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
_this.setState({ selected: selectedChild.props.uniquePrivateKey, expanded: newExpanded });
|
|
79
|
+
if (_this.props.onSelect) {
|
|
80
|
+
_this.props.onSelect.call(undefined, {
|
|
81
|
+
target: selectedChild,
|
|
82
|
+
expandedItems: newExpanded
|
|
83
|
+
});
|
|
84
|
+
}
|
|
59
85
|
};
|
|
60
86
|
/**
|
|
61
87
|
* @hidden
|
|
62
88
|
*/
|
|
63
|
-
_this.onFocus = function (
|
|
64
|
-
|
|
65
|
-
|
|
89
|
+
_this.onFocus = function (event, step) {
|
|
90
|
+
if (step === void 0) { step = 0; }
|
|
91
|
+
var flattenChildren = flatVisibleChildren(React.Children.toArray(_this.children));
|
|
92
|
+
var focusedChild;
|
|
93
|
+
flattenChildren.forEach(function (child, ixd) {
|
|
94
|
+
if (child.props.uniquePrivateKey === (event.uniquePrivateKey || _this.state.focused)) {
|
|
95
|
+
var index = ixd + step < 0
|
|
96
|
+
? 0
|
|
97
|
+
: ixd + step > flattenChildren.length
|
|
98
|
+
? flattenChildren.length - 1
|
|
99
|
+
: ixd + step;
|
|
100
|
+
focusedChild = flattenChildren[index];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
if (focusedChild) {
|
|
104
|
+
_this.activeDescendant = focusedChild.props.id;
|
|
105
|
+
_this.setState({ focused: focusedChild.props.uniquePrivateKey });
|
|
106
|
+
}
|
|
66
107
|
};
|
|
67
108
|
/**
|
|
68
109
|
* @hidden
|
|
69
110
|
*/
|
|
70
|
-
_this.onNavigate = function (action) {
|
|
71
|
-
var
|
|
111
|
+
_this.onNavigate = function (event, action) {
|
|
112
|
+
var step;
|
|
72
113
|
switch (action) {
|
|
73
114
|
case NavigationAction.Previous:
|
|
74
|
-
|
|
115
|
+
step = -1;
|
|
116
|
+
_this.onFocus(event, step);
|
|
75
117
|
break;
|
|
76
118
|
case NavigationAction.Next:
|
|
77
|
-
|
|
119
|
+
step = 1;
|
|
120
|
+
_this.onFocus(event, step);
|
|
78
121
|
break;
|
|
79
122
|
case NavigationAction.Toggle:
|
|
80
|
-
_this.
|
|
123
|
+
_this.onSelect(event);
|
|
81
124
|
break;
|
|
82
125
|
default:
|
|
83
126
|
}
|
|
@@ -95,18 +138,52 @@ var PanelBar = /** @class */ (function (_super) {
|
|
|
95
138
|
};
|
|
96
139
|
_this.handleKeyDown = function (event) {
|
|
97
140
|
var rtl = _this._element && (getComputedStyle(_this._element).direction === 'rtl') || false;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
141
|
+
if (event.target === event.currentTarget) {
|
|
142
|
+
var keyCode = event.keyCode;
|
|
143
|
+
var action = void 0;
|
|
144
|
+
switch (keyCode) {
|
|
145
|
+
case Keys.left:
|
|
146
|
+
action = !rtl ? NavigationAction.Previous : NavigationAction.Next;
|
|
147
|
+
break;
|
|
148
|
+
case Keys.up:
|
|
149
|
+
action = NavigationAction.Previous;
|
|
150
|
+
break;
|
|
151
|
+
case Keys.right:
|
|
152
|
+
action = !rtl ? NavigationAction.Next : NavigationAction.Previous;
|
|
153
|
+
break;
|
|
154
|
+
case Keys.down:
|
|
155
|
+
action = NavigationAction.Next;
|
|
156
|
+
break;
|
|
157
|
+
case Keys.space:
|
|
158
|
+
case Keys.enter:
|
|
159
|
+
action = NavigationAction.Toggle;
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
action = null;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
if (action !== null) {
|
|
166
|
+
event.preventDefault();
|
|
167
|
+
_this.onNavigate(event, action);
|
|
168
|
+
}
|
|
101
169
|
}
|
|
102
170
|
};
|
|
103
171
|
validatePackage(packageMetadata);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
172
|
+
var initialState = getInitialState(props, _this.expandMode);
|
|
173
|
+
if (!initialState.focused) {
|
|
174
|
+
initialState.focused = getFirstId(props);
|
|
175
|
+
}
|
|
176
|
+
_this.state = initialState;
|
|
107
177
|
return _this;
|
|
108
178
|
}
|
|
109
|
-
Object.defineProperty(PanelBar.prototype, "
|
|
179
|
+
Object.defineProperty(PanelBar.prototype, "expandMode", {
|
|
180
|
+
get: function () {
|
|
181
|
+
return this.props.expandMode || 'multiple';
|
|
182
|
+
},
|
|
183
|
+
enumerable: true,
|
|
184
|
+
configurable: true
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(PanelBar.prototype, "selectedItem", {
|
|
110
187
|
get: function () {
|
|
111
188
|
var _a = this.props.selected, selected = _a === void 0 ? this.state.selected : _a;
|
|
112
189
|
return selected;
|
|
@@ -114,15 +191,30 @@ var PanelBar = /** @class */ (function (_super) {
|
|
|
114
191
|
enumerable: true,
|
|
115
192
|
configurable: true
|
|
116
193
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
194
|
+
Object.defineProperty(PanelBar.prototype, "expandedItems", {
|
|
195
|
+
get: function () {
|
|
196
|
+
var expanded = this.props.isControlled ? this.props.expanded || [] : this.state.expanded;
|
|
197
|
+
return expanded;
|
|
198
|
+
},
|
|
199
|
+
enumerable: true,
|
|
200
|
+
configurable: true
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(PanelBar.prototype, "children", {
|
|
203
|
+
get: function () {
|
|
204
|
+
var state = __assign({}, this.state, { selected: this.selectedItem });
|
|
205
|
+
var renderState = {
|
|
206
|
+
animation: this.props.animation,
|
|
207
|
+
keepItemsMounted: this.props.keepItemsMounted,
|
|
208
|
+
state: state,
|
|
209
|
+
expanded: this.expandedItems,
|
|
210
|
+
handleSelect: this.handleSelect,
|
|
211
|
+
children: this.props.children
|
|
212
|
+
};
|
|
213
|
+
return renderChildren(renderState);
|
|
214
|
+
},
|
|
215
|
+
enumerable: true,
|
|
216
|
+
configurable: true
|
|
217
|
+
});
|
|
126
218
|
/**
|
|
127
219
|
* @hidden
|
|
128
220
|
*/
|
|
@@ -131,16 +223,10 @@ var PanelBar = /** @class */ (function (_super) {
|
|
|
131
223
|
var ariaProps = {
|
|
132
224
|
'aria-activedescendant': this.activeDescendant
|
|
133
225
|
};
|
|
134
|
-
var state = __assign({}, this.state, { selected: this.selected });
|
|
135
|
-
var children = renderChildren(this.props.animation, this.props.keepItemsMounted, state, this.handleSelect, this.props.children);
|
|
136
226
|
var className = classNames('k-panelbar', this.props.className);
|
|
137
|
-
return (React.createElement("ul", __assign({ ref: function (div) { _this._element = div; }, dir: this.props.dir, role: 'tree', tabIndex: 0, onKeyDown: this.handleKeyDown, onFocus: this.handleWrapperFocus, onBlur: this.handleWrapperBlur, className: className, style: this.props.style }, ariaProps), children));
|
|
227
|
+
return (React.createElement("ul", __assign({ ref: function (div) { _this._element = div; }, dir: this.props.dir, role: 'tree', tabIndex: 0, onKeyDown: this.handleKeyDown, onFocus: this.handleWrapperFocus, onBlur: this.handleWrapperBlur, className: className, style: this.props.style }, ariaProps), this.children));
|
|
138
228
|
};
|
|
139
229
|
PanelBar.prototype.nextTick = function (f) {
|
|
140
|
-
// XXX: use window.setTimeout due to async focus/blur events in IE, and missing relatedTarget prop.
|
|
141
|
-
// XXX: https://github.com/facebook/react/issues/3751
|
|
142
|
-
// Handles multiple focus events happening at the same time.
|
|
143
|
-
clearTimeout(this.nextTickId);
|
|
144
230
|
this.nextTickId = window.setTimeout(function () { return f(); });
|
|
145
231
|
};
|
|
146
232
|
/**
|
|
@@ -1,94 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
* Represents the props of the PanelBarItem component.
|
|
5
|
-
*/
|
|
6
|
-
export interface PanelBarItemProps {
|
|
7
|
-
/**
|
|
8
|
-
* Allows individual animation control over the child ([see example]({% slug animations_panelbar %})). By default, it is controlled by the PanelBar component.
|
|
9
|
-
*/
|
|
10
|
-
animation?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Can be any of PanelBar items, an array of PanelBar items, or a custom component.
|
|
13
|
-
*/
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* The class name that is set to the PanelBarItem component.
|
|
17
|
-
*/
|
|
18
|
-
className?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The class name that is set to the PanelBarItem header.
|
|
21
|
-
*/
|
|
22
|
-
headerClassName?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Sets the initial expanded state of the PanelBarItem ([see example]({% slug statesitems_panelbar %}#toc-expanded-items)). Controlled by the PanelBar component.
|
|
25
|
-
*/
|
|
26
|
-
expanded?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Sets the disabled state of the PanelBarItem ([see example]({% slug statesitems_panelbar %}#toc-disabled-items)).
|
|
29
|
-
*/
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
onSelect?: Function;
|
|
35
|
-
/**
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
38
|
-
level?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Defines an icon that will be rendered next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-icons)).
|
|
41
|
-
*/
|
|
42
|
-
icon?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Defines an icon with a custom CSS class that will be rendered next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-icons)).
|
|
45
|
-
*/
|
|
46
|
-
iconClass?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Defines the location of the image that will be displayed next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-images)).
|
|
49
|
-
*/
|
|
50
|
-
imageUrl?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Sets the initial selected state of the PanelBarItem. Controlled by the PanelBarItem component ([see example]({% slug statesitems_panelbar %}#toc-selected-items)).
|
|
53
|
-
*/
|
|
54
|
-
selected?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Sets the title of the PanelBar item ([see example]({% slug titlesitems_panelbar %}#toc-getting-started)).
|
|
57
|
-
*/
|
|
58
|
-
title?: React.ReactNode;
|
|
59
|
-
/**
|
|
60
|
-
* Allows the component to set the `id` property to each item. If not set, a default `id` is applied.
|
|
61
|
-
*/
|
|
62
|
-
id?: string;
|
|
63
|
-
/**
|
|
64
|
-
* Sets the initial focused state of the PanelBarItem. Controlled by the PanelBar component.
|
|
65
|
-
*/
|
|
66
|
-
focused?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* @hidden
|
|
69
|
-
*/
|
|
70
|
-
parentExpanded?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* @hidden
|
|
73
|
-
*/
|
|
74
|
-
content?: any;
|
|
75
|
-
/**
|
|
76
|
-
* Used to identify the PanelBarItems inside the PanelBar ([see example]({% slug controlling_state_panelbar %})). Does not depend on the state of the PanelBarItem.
|
|
77
|
-
*/
|
|
78
|
-
uniquePrivateKey?: string;
|
|
79
|
-
/**
|
|
80
|
-
* @hidden
|
|
81
|
-
*/
|
|
82
|
-
parentUniquePrivateKey?: string[];
|
|
83
|
-
/**
|
|
84
|
-
* @hidden
|
|
85
|
-
*/
|
|
86
|
-
keepItemsMounted?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Sets a custom property. Contained in the PanelBarItem props that are returned from the `onSelect` PanelBar event.
|
|
89
|
-
*/
|
|
90
|
-
[customProp: string]: any;
|
|
91
|
-
}
|
|
3
|
+
import { PanelBarItemProps } from '../main';
|
|
92
4
|
/** @hidden */
|
|
93
5
|
interface PanelBarItemState {
|
|
94
6
|
show: boolean;
|
|
@@ -103,7 +103,9 @@ var PanelBarItem = /** @class */ (function (_super) {
|
|
|
103
103
|
var arrow = (!disabled && children) ? React.createElement("span", { className: panelBarItemArrowClassName }) : null;
|
|
104
104
|
var opened = (!disabled && expanded);
|
|
105
105
|
var content = opened || keepItemsMounted
|
|
106
|
-
? (React.createElement("ul", { role: "group", className: "k-panelbar-group k-panel k-group", style: { display: keepItemsMounted
|
|
106
|
+
? (React.createElement("ul", { role: "group", className: "k-panelbar-group k-panel k-group", style: { display: keepItemsMounted
|
|
107
|
+
? (this.state.show ? 'block' : 'none')
|
|
108
|
+
: 'block' } }, children))
|
|
107
109
|
: null;
|
|
108
110
|
var child = ((animation !== undefined ? animation : true) && !disabled && children)
|
|
109
111
|
? (React.createElement(Reveal, { transitionEnterDuration: 200, transitionExitDuration: 200, key: uniquePrivateKey + '_animation', style: animationStyle, children: content, childFactory: keepItemsMounted && this.childFactory, unmountOnExit: !keepItemsMounted, onBeforeEnter: function () { return keepItemsMounted && _this.setState({ show: true }); }, onAfterExited: function () { return keepItemsMounted && _this.setState({ show: false }); } }))
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export var NavigationAction;
|
|
5
|
+
(function (NavigationAction) {
|
|
6
|
+
NavigationAction[NavigationAction["Toggle"] = 0] = "Toggle";
|
|
7
|
+
NavigationAction[NavigationAction["Next"] = 1] = "Next";
|
|
8
|
+
NavigationAction[NavigationAction["Previous"] = 2] = "Previous";
|
|
9
|
+
})(NavigationAction || (NavigationAction = {}));
|
|
File without changes
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Represents the props of the PanelBarItem component.
|
|
4
|
+
*/
|
|
5
|
+
export interface PanelBarItemProps {
|
|
6
|
+
/**
|
|
7
|
+
* Allows individual animation control over the child ([see example]({% slug animations_panelbar %})). By default, it is controlled by the PanelBar component.
|
|
8
|
+
*/
|
|
9
|
+
animation?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Can be any of PanelBar items, an array of PanelBar items, or a custom component.
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The class name that is set to the PanelBarItem component.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The class name that is set to the PanelBarItem header.
|
|
20
|
+
*/
|
|
21
|
+
headerClassName?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the initial expanded state of the PanelBarItem ([see example]({% slug statesitems_panelbar %}#toc-expanded-items)). Controlled by the PanelBar component.
|
|
24
|
+
*/
|
|
25
|
+
expanded?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Sets the disabled state of the PanelBarItem ([see example]({% slug statesitems_panelbar %}#toc-disabled-items)).
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
onSelect?: Function;
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
level?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Defines an icon that will be rendered next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-icons)).
|
|
40
|
+
*/
|
|
41
|
+
icon?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Defines an icon with a custom CSS class that will be rendered next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-icons)).
|
|
44
|
+
*/
|
|
45
|
+
iconClass?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Defines the location of the image that will be displayed next to the title ([see example]({% slug titlesitems_panelbar %}#toc-adding-images)).
|
|
48
|
+
*/
|
|
49
|
+
imageUrl?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Sets the initial selected state of the PanelBarItem. Controlled by the PanelBarItem component ([see example]({% slug statesitems_panelbar %}#toc-selected-items)).
|
|
52
|
+
*/
|
|
53
|
+
selected?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the title of the PanelBar item ([see example]({% slug titlesitems_panelbar %}#toc-getting-started)).
|
|
56
|
+
*/
|
|
57
|
+
title?: React.ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Allows the component to set the `id` property to each item. If not set, a default `id` is applied.
|
|
60
|
+
*/
|
|
61
|
+
id?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Sets the initial focused state of the PanelBarItem. Controlled by the PanelBar component.
|
|
64
|
+
*/
|
|
65
|
+
focused?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* @hidden
|
|
68
|
+
*/
|
|
69
|
+
parentExpanded?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
content?: any;
|
|
74
|
+
/**
|
|
75
|
+
* Used to identify the PanelBarItems inside the PanelBar ([see example]({% slug controlling_state_panelbar %})). Does not depend on the state of the PanelBarItem.
|
|
76
|
+
*/
|
|
77
|
+
uniquePrivateKey?: string;
|
|
78
|
+
/**
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
parentUniquePrivateKey?: string[];
|
|
82
|
+
/**
|
|
83
|
+
* @hidden
|
|
84
|
+
*/
|
|
85
|
+
keepItemsMounted?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Sets a custom property. Contained in the PanelBarItem props that are returned from the `onSelect` PanelBar event.
|
|
88
|
+
*/
|
|
89
|
+
[customProp: string]: any;
|
|
90
|
+
}
|
|
File without changes
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
/**
|
|
4
|
-
* The arguments that are passed to the `onSelect` callback function.
|
|
5
|
-
*/
|
|
6
|
-
export interface PanelBarSelectEventArguments {
|
|
7
|
-
/**
|
|
8
|
-
* The selected PanelBar item.
|
|
9
|
-
*/
|
|
10
|
-
target: React.ReactElement<PanelBarItemProps>;
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
action: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
export interface PanelBarItemClickEventArguments {
|
|
20
|
-
uniquePrivateKey: number;
|
|
21
|
-
target: PanelBarItem;
|
|
22
|
-
}
|
|
2
|
+
import { PanelBarSelectEventArguments } from '../../main';
|
|
23
3
|
/**
|
|
24
4
|
* Represents the expand modes of the KendoReact PanelBar. Defaults to `multiple`.
|
|
25
5
|
*/
|
|
26
6
|
export declare type PanelBarExpandMode = 'single' | 'multiple';
|
|
27
7
|
/**
|
|
28
|
-
*
|
|
8
|
+
* Represents the props of the [KendoReact PanelBar component]({% slug overview_panelbar %}).
|
|
29
9
|
*/
|
|
30
|
-
export interface
|
|
10
|
+
export interface PanelBarProps {
|
|
11
|
+
/**
|
|
12
|
+
* The child can be either a single PanelBarItem or a PanelBarItem array.
|
|
13
|
+
*/
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The class name that is set to the PanelBar.
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
31
19
|
/**
|
|
32
20
|
* Sets the animation state of the PanelBar.
|
|
33
21
|
*/
|
|
@@ -56,6 +44,14 @@ export interface PanelBarInterface {
|
|
|
56
44
|
* Sets the initial focused state of the PanelBar.
|
|
57
45
|
*/
|
|
58
46
|
focused?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Determines if the PanelBar items will be mounted after expand collapse. Defaults to `false`.
|
|
49
|
+
*/
|
|
50
|
+
keepItemsMounted?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Determines if the PanelBar is going to be used in controlled state.
|
|
53
|
+
*/
|
|
54
|
+
isControlled?: boolean;
|
|
59
55
|
/**
|
|
60
56
|
* Fires each time the user makes a selection ([see example]({% slug controlling_state_panelbar %})).
|
|
61
57
|
*/
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PanelBarItemProps } from '../interfaces/PanelBarItemProps';
|
|
3
|
+
/**
|
|
4
|
+
* The arguments that are passed to the `onSelect` callback function.
|
|
5
|
+
*/
|
|
6
|
+
export interface PanelBarSelectEventArguments {
|
|
7
|
+
/**
|
|
8
|
+
* The selected PanelBar item.
|
|
9
|
+
*/
|
|
10
|
+
target: React.ReactElement<PanelBarItemProps>;
|
|
11
|
+
/**
|
|
12
|
+
* The new expanded PanelBar items state.
|
|
13
|
+
*/
|
|
14
|
+
expandedItems: string[];
|
|
15
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PanelBarState } from '../PanelBar';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export interface RenderPanelBarItem {
|
|
7
|
+
animation?: boolean;
|
|
8
|
+
keepItemsMounted?: boolean;
|
|
9
|
+
state: PanelBarState;
|
|
10
|
+
expanded: string[];
|
|
11
|
+
handleSelect: any;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
parentExpanded?: boolean;
|
|
14
|
+
level?: number;
|
|
15
|
+
parentPrivateKey?: string[];
|
|
16
|
+
}
|
|
File without changes
|