@progress/kendo-react-layout 14.5.0-develop.9 → 15.0.0-develop.2
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/MenuMcpWrapper.d.ts +17 -0
- package/MenuMcpWrapper.js +8 -0
- package/MenuMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +18 -19
- package/actionsheet/ActionSheetItem.js +1 -1
- package/actionsheet/ActionSheetItem.mjs +1 -3
- package/bottomnavigation/BottomNavigation.js +1 -1
- package/bottomnavigation/BottomNavigation.mjs +85 -69
- package/bottomnavigation/BottomNavigationItem.js +1 -1
- package/bottomnavigation/BottomNavigationItem.mjs +34 -33
- package/bottomnavigation/messages/index.d.ts +17 -0
- package/bottomnavigation/messages/index.js +8 -0
- package/bottomnavigation/messages/index.mjs +14 -0
- package/breadcrumb/Breadcrumb.js +1 -1
- package/breadcrumb/Breadcrumb.mjs +30 -28
- package/breadcrumb/BreadcrumbLink.js +1 -1
- package/breadcrumb/BreadcrumbLink.mjs +26 -26
- package/breadcrumb/messages/index.d.ts +17 -0
- package/breadcrumb/messages/index.js +8 -0
- package/breadcrumb/messages/index.mjs +14 -0
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/drawer/Drawer.mjs +63 -63
- package/drawer/DrawerItem.js +1 -1
- package/drawer/DrawerItem.mjs +22 -23
- package/drawer/interfaces/DrawerProps.d.ts +8 -0
- package/expansionpanel/ExpansionPanel.js +1 -1
- package/expansionpanel/ExpansionPanel.mjs +50 -50
- package/expansionpanel/ExpansionPanelContent.js +1 -1
- package/expansionpanel/ExpansionPanelContent.mjs +7 -4
- package/index.d.mts +1 -2
- package/index.d.ts +1 -2
- package/index.js +1 -1
- package/index.mjs +128 -130
- package/menu/MenuProps.d.ts +6 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +94 -91
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +13 -15
- package/panelbar/interfaces/PanelBarProps.d.ts +8 -0
- package/panelbar/interfaces/RenderPanelBarItem.d.ts +1 -0
- package/panelbar/util.d.ts +1 -1
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +62 -59
- package/splitter/SplitterBar.d.ts +1 -0
- package/splitter/SplitterBar.js +1 -1
- package/splitter/SplitterBar.mjs +64 -56
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +79 -85
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +134 -133
- package/stepper/interfaces/StepperProps.d.ts +8 -1
- package/stepper/messages/index.d.ts +12 -2
- package/stepper/messages/index.js +1 -1
- package/stepper/messages/index.mjs +8 -4
- package/tabstrip/TabStrip.d.ts +8 -1
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +126 -125
- package/tilelayout/InternalTile.js +1 -1
- package/tilelayout/InternalTile.mjs +119 -115
- package/tilelayout/TileLayout.js +1 -1
- package/tilelayout/TileLayout.mjs +58 -58
- package/timeline/TimelineCard.d.ts +2 -0
- package/timeline/TimelineCard.js +1 -1
- package/timeline/TimelineCard.mjs +16 -15
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +105 -101
package/panelbar/PanelBar.mjs
CHANGED
|
@@ -6,169 +6,172 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as a from "react";
|
|
9
|
-
import
|
|
9
|
+
import y from "prop-types";
|
|
10
10
|
import { PanelBarItem as L } from "./PanelBarItem.mjs";
|
|
11
|
-
import { getInitialState as
|
|
12
|
-
import { Keys as m, classNames as
|
|
11
|
+
import { getInitialState as Q, getFirstId as X, flatChildren as Y, isArrayEqual as Z, flatVisibleChildren as _, getFocusedChild as ee, renderChildren as te } from "./util.mjs";
|
|
12
|
+
import { useWebMcpRegister as re, Keys as m, classNames as ne } from "@progress/kendo-react-common";
|
|
13
13
|
import { NavigationAction as n } from "./interfaces/NavigationAction.mjs";
|
|
14
|
-
const U = (
|
|
14
|
+
const U = (c) => {
|
|
15
15
|
const {
|
|
16
|
-
animation:
|
|
16
|
+
animation: u = !0,
|
|
17
17
|
children: o,
|
|
18
18
|
dir: N,
|
|
19
19
|
selected: w,
|
|
20
20
|
expanded: O,
|
|
21
21
|
expandMode: I = "multiple",
|
|
22
22
|
className: A,
|
|
23
|
-
keepItemsMounted:
|
|
23
|
+
keepItemsMounted: R = !1,
|
|
24
24
|
onSelect: C,
|
|
25
25
|
style: D,
|
|
26
26
|
isControlled: W
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
} = c, v = a.useRef(null), $ = a.useRef(null), T = a.useRef(void 0), x = a.useRef(null);
|
|
28
|
+
re("panelbar", $, c, c.webMcp);
|
|
29
|
+
const [p, f] = a.useState(() => {
|
|
30
|
+
const i = Q(c, I || "multiple");
|
|
31
|
+
return i.focused || (i.focused = X(c)), i;
|
|
32
|
+
}), E = I || "multiple", F = w !== void 0 ? w : p.selected, h = W ? O || [] : p.expanded, M = a.useCallback((t) => {
|
|
33
|
+
x.current = window.setTimeout(() => t());
|
|
32
34
|
}, []), g = a.useCallback(
|
|
33
|
-
(
|
|
34
|
-
const
|
|
35
|
-
let
|
|
35
|
+
(t) => {
|
|
36
|
+
const i = K, s = Y(a.Children.toArray(i));
|
|
37
|
+
let r, l;
|
|
36
38
|
switch (s.forEach((e) => {
|
|
37
|
-
e.props.uniquePrivateKey === (
|
|
38
|
-
}),
|
|
39
|
+
e.props.uniquePrivateKey === (t.uniquePrivateKey || p.focused) && (r = e);
|
|
40
|
+
}), E) {
|
|
39
41
|
case "single":
|
|
40
|
-
|
|
42
|
+
l = [...r.props.parentUniquePrivateKey, r.props.uniquePrivateKey], Z(h, l) && (r.props.parentUniquePrivateKey ? l = [...r.props.parentUniquePrivateKey] : l = []);
|
|
41
43
|
break;
|
|
42
44
|
case "multiple": {
|
|
43
|
-
|
|
44
|
-
const e =
|
|
45
|
-
e === -1 ?
|
|
45
|
+
l = h.slice();
|
|
46
|
+
const e = l.indexOf(r.props.uniquePrivateKey);
|
|
47
|
+
e === -1 ? l.push(r.props.uniquePrivateKey) : l.splice(e, 1);
|
|
46
48
|
break;
|
|
47
49
|
}
|
|
48
50
|
default:
|
|
49
|
-
|
|
51
|
+
l = h.slice();
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
|
-
f((e) => ({ ...e, selected:
|
|
53
|
-
target:
|
|
54
|
-
expandedItems:
|
|
54
|
+
f((e) => ({ ...e, selected: r.props.uniquePrivateKey, expanded: l })), C && C({
|
|
55
|
+
target: r,
|
|
56
|
+
expandedItems: l
|
|
55
57
|
});
|
|
56
58
|
},
|
|
57
|
-
[o,
|
|
58
|
-
),
|
|
59
|
-
(
|
|
60
|
-
const
|
|
59
|
+
[o, p.focused, E, h, C]
|
|
60
|
+
), d = a.useCallback(
|
|
61
|
+
(t, i = 0, s) => {
|
|
62
|
+
const r = K, l = _(a.Children.toArray(r)), e = ee(l, i, t, p.focused, s);
|
|
61
63
|
if (e) {
|
|
62
64
|
const k = h.slice();
|
|
63
65
|
if (s === n.Right && e && e.props && e.props.children && e.props.children.length > 0) {
|
|
64
|
-
if (k.push(e.props.uniquePrivateKey), f((
|
|
65
|
-
const
|
|
66
|
-
f((P) => ({ ...P, focused:
|
|
66
|
+
if (k.push(e.props.uniquePrivateKey), f((b) => ({ ...b, expanded: [...new Set(k)] })), e.props.expanded) {
|
|
67
|
+
const b = e.props.children[0];
|
|
68
|
+
f((P) => ({ ...P, focused: b.props.uniquePrivateKey }));
|
|
67
69
|
}
|
|
68
70
|
} else if (s === n.Left && (e && e.props && e.props.parentUniquePrivateKey && e.props.parentUniquePrivateKey.length > 0 || e && e.props && !e.props.disabled && e.props.children && e.props.children.length > 0)) {
|
|
69
|
-
const
|
|
71
|
+
const b = e.props.parentUniquePrivateKey;
|
|
70
72
|
if (e.props.expanded) {
|
|
71
73
|
const P = e.props.uniquePrivateKey, q = k.indexOf(P);
|
|
72
|
-
k.splice(q, 1), f((
|
|
74
|
+
k.splice(q, 1), f((J) => ({ ...J, expanded: k }));
|
|
73
75
|
} else if (e.props.level > 0) {
|
|
74
|
-
const P = e.props.parentUniquePrivateKey[
|
|
76
|
+
const P = e.props.parentUniquePrivateKey[b.length - 1];
|
|
75
77
|
f((q) => ({ ...q, focused: P }));
|
|
76
78
|
}
|
|
77
79
|
} else
|
|
78
|
-
|
|
80
|
+
f((b) => ({ ...b, focused: e.props.uniquePrivateKey }));
|
|
79
81
|
}
|
|
80
82
|
},
|
|
81
|
-
[o,
|
|
83
|
+
[o, p.focused, h]
|
|
82
84
|
), B = a.useCallback(
|
|
83
|
-
(
|
|
84
|
-
g(
|
|
85
|
+
(t) => {
|
|
86
|
+
g(t), d(t);
|
|
85
87
|
},
|
|
86
|
-
[g,
|
|
87
|
-
), K = a.useMemo(() =>
|
|
88
|
-
animation:
|
|
89
|
-
keepItemsMounted:
|
|
90
|
-
state: { ...
|
|
88
|
+
[g, d]
|
|
89
|
+
), K = a.useMemo(() => te({
|
|
90
|
+
animation: u,
|
|
91
|
+
keepItemsMounted: R,
|
|
92
|
+
state: { ...p, selected: F },
|
|
91
93
|
expanded: h,
|
|
92
94
|
handleSelect: B,
|
|
93
|
-
children: o
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
children: o,
|
|
96
|
+
activeDescendantRef: T
|
|
97
|
+
}), [u, R, p, F, h, o, B]), S = a.useCallback(
|
|
98
|
+
(t, i) => {
|
|
96
99
|
let s;
|
|
97
|
-
switch (
|
|
100
|
+
switch (i) {
|
|
98
101
|
case n.First:
|
|
99
|
-
|
|
102
|
+
d(t, s, n.First);
|
|
100
103
|
break;
|
|
101
104
|
case n.Last:
|
|
102
|
-
|
|
105
|
+
d(t, s, n.Last);
|
|
103
106
|
break;
|
|
104
107
|
case n.Left:
|
|
105
|
-
|
|
108
|
+
d(t, s, n.Left);
|
|
106
109
|
break;
|
|
107
110
|
case n.Right:
|
|
108
|
-
|
|
111
|
+
d(t, s, n.Right);
|
|
109
112
|
break;
|
|
110
113
|
case n.Previous:
|
|
111
|
-
s = -1,
|
|
114
|
+
s = -1, d(t, s);
|
|
112
115
|
break;
|
|
113
116
|
case n.Next:
|
|
114
|
-
s = 1,
|
|
117
|
+
s = 1, d(t, s);
|
|
115
118
|
break;
|
|
116
119
|
case n.Toggle:
|
|
117
|
-
g(
|
|
120
|
+
g(t);
|
|
118
121
|
break;
|
|
119
122
|
}
|
|
120
123
|
},
|
|
121
|
-
[
|
|
122
|
-
),
|
|
123
|
-
clearTimeout(x.current),
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
f((
|
|
124
|
+
[d, g]
|
|
125
|
+
), H = a.useCallback(() => {
|
|
126
|
+
clearTimeout(x.current), p.wrapperFocused || f((t) => ({ ...t, wrapperFocused: !0 }));
|
|
127
|
+
}, [p.wrapperFocused]), V = a.useCallback(() => {
|
|
128
|
+
M(() => {
|
|
129
|
+
f((t) => ({ ...t, wrapperFocused: !1 }));
|
|
127
130
|
});
|
|
128
|
-
}, [
|
|
129
|
-
(
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
const s =
|
|
133
|
-
let
|
|
131
|
+
}, [M]), j = a.useCallback(
|
|
132
|
+
(t) => {
|
|
133
|
+
const i = v.current && getComputedStyle(v.current).direction === "rtl" || !1;
|
|
134
|
+
if (t.target === t.currentTarget) {
|
|
135
|
+
const s = t.keyCode;
|
|
136
|
+
let r;
|
|
134
137
|
switch (s) {
|
|
135
138
|
case m.left:
|
|
136
|
-
|
|
139
|
+
r = i ? n.Right : n.Left;
|
|
137
140
|
break;
|
|
138
141
|
case m.up:
|
|
139
|
-
|
|
142
|
+
r = n.Previous;
|
|
140
143
|
break;
|
|
141
144
|
case m.right:
|
|
142
|
-
|
|
145
|
+
r = i ? n.Left : n.Right;
|
|
143
146
|
break;
|
|
144
147
|
case m.down:
|
|
145
|
-
|
|
148
|
+
r = n.Next;
|
|
146
149
|
break;
|
|
147
150
|
case m.home:
|
|
148
|
-
|
|
151
|
+
r = n.First;
|
|
149
152
|
break;
|
|
150
153
|
case m.end:
|
|
151
|
-
|
|
154
|
+
r = n.Last;
|
|
152
155
|
break;
|
|
153
156
|
case m.space:
|
|
154
157
|
case m.enter:
|
|
155
|
-
|
|
158
|
+
r = n.Toggle;
|
|
156
159
|
break;
|
|
157
160
|
default:
|
|
158
|
-
|
|
161
|
+
r = null;
|
|
159
162
|
break;
|
|
160
163
|
}
|
|
161
|
-
|
|
164
|
+
r !== null && (t.preventDefault(), S(t, r));
|
|
162
165
|
}
|
|
163
166
|
},
|
|
164
|
-
[
|
|
167
|
+
[S]
|
|
165
168
|
);
|
|
166
169
|
a.useEffect(() => () => {
|
|
167
170
|
x.current && clearTimeout(x.current);
|
|
168
171
|
}, []);
|
|
169
172
|
const z = {
|
|
170
|
-
"aria-activedescendant":
|
|
171
|
-
}, G =
|
|
173
|
+
"aria-activedescendant": T.current
|
|
174
|
+
}, G = ne("k-panelbar", A);
|
|
172
175
|
return /* @__PURE__ */ a.createElement(
|
|
173
176
|
"ul",
|
|
174
177
|
{
|
|
@@ -177,7 +180,7 @@ const U = (p) => {
|
|
|
177
180
|
role: "tree",
|
|
178
181
|
tabIndex: 0,
|
|
179
182
|
onKeyDown: j,
|
|
180
|
-
onFocus:
|
|
183
|
+
onFocus: H,
|
|
181
184
|
onBlur: V,
|
|
182
185
|
className: G,
|
|
183
186
|
style: D,
|
|
@@ -190,12 +193,12 @@ U.propTypes = {
|
|
|
190
193
|
/**
|
|
191
194
|
* A collection of `PanelBarItem` components.
|
|
192
195
|
*/
|
|
193
|
-
children:
|
|
194
|
-
|
|
195
|
-
return
|
|
196
|
+
children: y.oneOfType([
|
|
197
|
+
y.arrayOf(function(c, u) {
|
|
198
|
+
return c[u].type !== L ? new Error("PanelBar children should be either PanelBarItem or an array of PanelBarItem.") : null;
|
|
196
199
|
}),
|
|
197
|
-
function(
|
|
198
|
-
const o =
|
|
200
|
+
function(c, u) {
|
|
201
|
+
const o = c[u];
|
|
199
202
|
return o && o.type !== L ? new Error("PanelBar children should be either PanelBarItem or an array of PanelBarItem.") : null;
|
|
200
203
|
}
|
|
201
204
|
]),
|
|
@@ -203,29 +206,29 @@ U.propTypes = {
|
|
|
203
206
|
* Expands the item or items that match the `selected` property while respecting the `expandMode` property (see [example]({% slug expandModes_panelbar %}#toc-single-expandMode)).
|
|
204
207
|
* To expand the item on the initial load of the PanelBar, define the `expanded` property of each PanelBarItem.
|
|
205
208
|
*/
|
|
206
|
-
selected:
|
|
209
|
+
selected: y.string,
|
|
207
210
|
/**
|
|
208
211
|
* Sets the expand mode of the PanelBar through the `single`, `multiple`, or `default` keywords (see [example]({% slug expandModes_panelbar %})).
|
|
209
212
|
*/
|
|
210
|
-
expandMode(
|
|
211
|
-
const o =
|
|
213
|
+
expandMode(c, u) {
|
|
214
|
+
const o = c[u];
|
|
212
215
|
return o !== "single" && o !== "multiple" && o !== "default" ? new Error(
|
|
213
|
-
`Invalid value '${o}' given to '${
|
|
216
|
+
`Invalid value '${o}' given to '${u}'. It must be either 'single', 'multiple' or 'default'.`
|
|
214
217
|
) : null;
|
|
215
218
|
},
|
|
216
219
|
/**
|
|
217
220
|
* Enables or disables the animation of the PanelBar items.
|
|
218
221
|
*/
|
|
219
|
-
animation:
|
|
222
|
+
animation: y.bool,
|
|
220
223
|
/**
|
|
221
224
|
* When enabled, keeps PanelBarItem content mounted in the DOM even when collapsed.
|
|
222
225
|
*/
|
|
223
|
-
keepItemsMounted:
|
|
226
|
+
keepItemsMounted: y.bool,
|
|
224
227
|
/**
|
|
225
228
|
* Fires when the expand mode of the PanelBar is set to `single` or `multiple`
|
|
226
229
|
* and an item is toggled (see [example]({% slug overview_panelbar %}#toc-expanded-state-management)).
|
|
227
230
|
*/
|
|
228
|
-
onSelect:
|
|
231
|
+
onSelect: y.func
|
|
229
232
|
};
|
|
230
233
|
U.defaultProps = {
|
|
231
234
|
expandMode: "multiple",
|
package/panelbar/PanelBarItem.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react"),n=require("prop-types"),i=require("@progress/kendo-react-common"),N=require("@progress/kendo-svg-icons"),G=require("@progress/kendo-react-animation");function $(a){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(c,r,t.get?t:{enumerable:!0,get:()=>a[r]})}}return c.default=a,Object.freeze(c)}const e=$(z);function J({imageUrl:a,icon:c,svgIcon:r,iconClass:t}){return a?e.createElement("img",{role:"presentation",className:"k-panelbar-item-icon k-image",src:a}):c||r?e.createElement(i.IconWrap,{className:"k-panelbar-item-icon",name:c,icon:r}):t?e.createElement("span",{role:"presentation",className:"k-panelbar-item-icon "+t}):null}const d=e.forwardRef((a,c)=>{const{id:r,children:t,title:E
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react"),n=require("prop-types"),i=require("@progress/kendo-react-common"),N=require("@progress/kendo-svg-icons"),G=require("@progress/kendo-react-animation");function $(a){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(c,r,t.get?t:{enumerable:!0,get:()=>a[r]})}}return c.default=a,Object.freeze(c)}const e=$(z);function J({imageUrl:a,icon:c,svgIcon:r,iconClass:t}){return a?e.createElement("img",{role:"presentation",className:"k-panelbar-item-icon k-image",src:a}):c||r?e.createElement(i.IconWrap,{className:"k-panelbar-item-icon",name:c,icon:r}):t?e.createElement("span",{role:"presentation",className:"k-panelbar-item-icon "+t}):null}const d=e.forwardRef((a,c)=>{const{id:r,children:t,title:h=E.title,uniquePrivateKey:m,disabled:l,selected:b,focused:C,expanded:s,className:P,level:k,headerClassName:R,animation:y,keepItemsMounted:o,onSelect:u,imageUrl:S,icon:B,svgIcon:x,iconClass:O}=a,p=e.useRef({props:a}),D=e.useRef(null);e.useImperativeHandle(p,()=>({props:a})),e.useImperativeHandle(c,()=>p.current);const[w,g]=e.useState(s||!1),T=e.useCallback(()=>{u&&!l&&u({uniquePrivateKey:m,id:r,target:p.current})},[u,l,m,r]),q=e.useCallback(f=>o?e.cloneElement(f,{...f.props,in:s}):f,[o,s]),A=e.useCallback(()=>{o&&g(!0)},[o]),j=e.useCallback(()=>{o&&g(!1)},[o]),U={role:"treeitem","aria-disabled":l,"aria-selected":!l&&b,"aria-expanded":t?!l&&s:void 0},M=i.classNames("k-panelbar-item",{"k-panelbar-header":k===0,"k-expanded":s&&!!t,"k-disabled":l},`k-level-${k}`,P),_=i.classNames("k-link",{"k-selected":!l&&b,"k-focus":C},R),H={display:"block"},L=J({imageUrl:S,icon:B,svgIcon:x,iconClass:O}),F=!l&&t?e.createElement(i.IconWrap,{name:s?"chevron-up":"chevron-down",icon:s?N.chevronUpIcon:N.chevronDownIcon,className:i.classNames("k-panelbar-toggle",s?"k-panelbar-collapse":"k-panelbar-expand")}):null;let I=!1;t&&t[0]&&Array.isArray(t)&&(I=t[0].type===d);const K=o&&!w?"none":"block",v=!l&&s||o?I?e.createElement("ul",{role:"group",className:"k-panelbar-group",style:{display:K}},t):t:null,W=(y===void 0||y)&&!l&&t?e.createElement(G.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,key:m+"_animation",style:H,children:v,childFactory:o?q:void 0,unmountOnExit:!o,onBeforeEnter:A,onAfterExited:j}):v;return e.createElement("li",{ref:D,id:r,className:M,...U},e.createElement("span",{className:_,onClick:T},L,e.createElement("span",{className:"k-panelbar-item-text"},h),F),W)}),E={title:"Untitled"};d.propTypes={animation:n.bool,children:n.any,className:n.string,icon:n.string,iconClass:n.string,imageUrl:n.string,svgIcon:i.svgIconPropType,expanded:n.bool,disabled:n.bool,onSelect:n.func,selected:n.bool,level:n.number,title:n.oneOfType([n.string,n.element]),id:n.oneOfType([n.string,n.number]),focused:n.bool,keepItemsMounted:n.bool};d.displayName="KendoReactPanelBarItem";exports.PanelBarItem=d;exports.panelBarItemDefaultProps=E;
|
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
|
-
import { classNames as u, IconWrap as
|
|
10
|
+
import { classNames as u, IconWrap as E, svgIconPropType as _ } from "@progress/kendo-react-common";
|
|
11
11
|
import { chevronUpIcon as $, chevronDownIcon as j } from "@progress/kendo-svg-icons";
|
|
12
12
|
import { Reveal as z } from "@progress/kendo-react-animation";
|
|
13
13
|
function J({ imageUrl: o, icon: i, svgIcon: s, iconClass: a }) {
|
|
14
|
-
return o ? /* @__PURE__ */ e.createElement("img", { role: "presentation", className: "k-panelbar-item-icon k-image", src: o }) : i || s ? /* @__PURE__ */ e.createElement(
|
|
14
|
+
return o ? /* @__PURE__ */ e.createElement("img", { role: "presentation", className: "k-panelbar-item-icon k-image", src: o }) : i || s ? /* @__PURE__ */ e.createElement(E, { className: "k-panelbar-item-icon", name: i, icon: s }) : a ? /* @__PURE__ */ e.createElement("span", { role: "presentation", className: "k-panelbar-item-icon " + a }) : null;
|
|
15
15
|
}
|
|
16
16
|
const f = e.forwardRef((o, i) => {
|
|
17
17
|
const {
|
|
18
18
|
id: s,
|
|
19
19
|
children: a,
|
|
20
|
-
title:
|
|
20
|
+
title: N = Q.title,
|
|
21
21
|
uniquePrivateKey: c,
|
|
22
22
|
disabled: t,
|
|
23
23
|
selected: k,
|
|
24
|
-
focused:
|
|
24
|
+
focused: h,
|
|
25
25
|
expanded: r,
|
|
26
26
|
className: C,
|
|
27
27
|
level: b,
|
|
@@ -57,9 +57,8 @@ const f = e.forwardRef((o, i) => {
|
|
|
57
57
|
}, [l]), L = {
|
|
58
58
|
role: "treeitem",
|
|
59
59
|
"aria-disabled": t,
|
|
60
|
-
"aria-hidden": !t && !r ? "true" : "false",
|
|
61
60
|
"aria-selected": !t && k,
|
|
62
|
-
"aria-expanded": !t && r
|
|
61
|
+
"aria-expanded": a ? !t && r : void 0
|
|
63
62
|
}, O = u(
|
|
64
63
|
"k-panelbar-item",
|
|
65
64
|
{
|
|
@@ -73,24 +72,23 @@ const f = e.forwardRef((o, i) => {
|
|
|
73
72
|
"k-link",
|
|
74
73
|
{
|
|
75
74
|
"k-selected": !t && k,
|
|
76
|
-
"k-focus":
|
|
75
|
+
"k-focus": h
|
|
77
76
|
},
|
|
78
77
|
x
|
|
79
78
|
), K = { display: "block" }, M = J({ imageUrl: B, icon: R, svgIcon: w, iconClass: P }), q = !t && a ? /* @__PURE__ */ e.createElement(
|
|
80
|
-
|
|
79
|
+
E,
|
|
81
80
|
{
|
|
82
81
|
name: r ? "chevron-up" : "chevron-down",
|
|
83
82
|
icon: r ? $ : j,
|
|
84
83
|
className: u("k-panelbar-toggle", r ? "k-panelbar-collapse" : "k-panelbar-expand")
|
|
85
84
|
}
|
|
86
85
|
) : null;
|
|
87
|
-
let
|
|
88
|
-
a && a[0] && Array.isArray(a) && (
|
|
89
|
-
const G = l && !A ? "none" : "block",
|
|
86
|
+
let v = !1;
|
|
87
|
+
a && a[0] && Array.isArray(a) && (v = a[0].type === f);
|
|
88
|
+
const G = l && !A ? "none" : "block", I = !t && r || l ? v ? /* @__PURE__ */ e.createElement(
|
|
90
89
|
"ul",
|
|
91
90
|
{
|
|
92
91
|
role: "group",
|
|
93
|
-
"aria-hidden": r ? "false" : "true",
|
|
94
92
|
className: "k-panelbar-group",
|
|
95
93
|
style: { display: G }
|
|
96
94
|
},
|
|
@@ -102,14 +100,14 @@ const f = e.forwardRef((o, i) => {
|
|
|
102
100
|
transitionExitDuration: 200,
|
|
103
101
|
key: c + "_animation",
|
|
104
102
|
style: K,
|
|
105
|
-
children:
|
|
103
|
+
children: I,
|
|
106
104
|
childFactory: l ? T : void 0,
|
|
107
105
|
unmountOnExit: !l,
|
|
108
106
|
onBeforeEnter: U,
|
|
109
107
|
onAfterExited: H
|
|
110
108
|
}
|
|
111
|
-
) :
|
|
112
|
-
return /* @__PURE__ */ e.createElement("li", { ref: S, id: s, className: O, ...L }, /* @__PURE__ */ e.createElement("span", { className: F, onClick: D }, M, /* @__PURE__ */ e.createElement("span", { className: "k-panelbar-item-text" },
|
|
109
|
+
) : I;
|
|
110
|
+
return /* @__PURE__ */ e.createElement("li", { ref: S, id: s, className: O, ...L }, /* @__PURE__ */ e.createElement("span", { className: F, onClick: D }, M, /* @__PURE__ */ e.createElement("span", { className: "k-panelbar-item-text" }, N), q), W);
|
|
113
111
|
}), Q = {
|
|
114
112
|
title: "Untitled"
|
|
115
113
|
};
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { PanelBarSelectEventArguments } from '../../index.js';
|
|
9
|
+
import { WebMcpProps } from '@progress/kendo-react-common';
|
|
9
10
|
/**
|
|
10
11
|
* Represents the expand modes of the KendoReact PanelBar. Defaults to `multiple`.
|
|
11
12
|
*/
|
|
@@ -137,4 +138,11 @@ export interface PanelBarProps {
|
|
|
137
138
|
* ```
|
|
138
139
|
*/
|
|
139
140
|
style?: React.CSSProperties;
|
|
141
|
+
/**
|
|
142
|
+
* Enables Web MCP tool registration so AI agents can interact with this PanelBar.
|
|
143
|
+
* Set to `true` to use the provider-level `dataName`, or pass a config object to override.
|
|
144
|
+
*
|
|
145
|
+
* Requires a `WebMcpProvider` ancestor from `@progress/kendo-react-webmcp`.
|
|
146
|
+
*/
|
|
147
|
+
webMcp?: boolean | WebMcpProps;
|
|
140
148
|
}
|
package/panelbar/util.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import * as React from 'react';
|
|
|
14
14
|
/**
|
|
15
15
|
* @hidden
|
|
16
16
|
*/
|
|
17
|
-
export declare const renderChildren: ({ animation, keepItemsMounted, state, expanded, handleSelect, children, parentExpanded, level, parentPrivateKey }: RenderPanelBarItem) => React.ReactNode;
|
|
17
|
+
export declare const renderChildren: ({ animation, keepItemsMounted, state, expanded, handleSelect, children, parentExpanded, level, parentPrivateKey, activeDescendantRef }: RenderPanelBarItem) => React.ReactNode;
|
|
18
18
|
/**
|
|
19
19
|
* @hidden
|
|
20
20
|
*/
|
package/panelbar/util.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),l=require("./PanelBarItem.js"),d=require("./interfaces/NavigationAction.js");function N(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}const a=N(O),S=r=>typeof r!="object"||!("type"in r)||r.type!==l.PanelBarItem,P=({animation:r=!0,keepItemsMounted:n=!1,state:e,expanded:o,handleSelect:p,children:t,parentExpanded:c=!0,level:s=0,parentPrivateKey:f=[],activeDescendantRef:g})=>{const m=a.Children.toArray(t).filter(S),F=m.length?m:t;return a.Children.map(F,(i,A)=>{if(i&&i.type===l.PanelBarItem){let y;const u=b(i,f,A);if(i.props.children){const B={animation:r,keepItemsMounted:n,state:e,expanded:o,handleSelect:p,children:i.props.children,parentExpanded:(o||[]).indexOf(u)>-1,level:s+1,parentPrivateKey:[...f,u],activeDescendantRef:g};y=P(B)}const I=i.props.id||`k-panelbar-item-default-${u}`;return g&&e.wrapperFocused&&e.focused===u&&(g.current=I),a.cloneElement(i,{...i.props,animation:i.props.animation!==void 0?i.props.animation:r,keepItemsMounted:n,id:I,uniquePrivateKey:u,parentUniquePrivateKey:f,parentExpanded:c,level:s,expanded:(o||[]).indexOf(u)>-1,focused:e.focused===u&&e.wrapperFocused,selected:e.selected===u,children:y,onSelect:p})}return a.createElement("div",{className:"k-panelbar-content","aria-hidden":c?void 0:"true"},i)})},j=r=>{const n=a.Children.toArray(r.children)[0];return n?b(n,[],0):""},v=(r,n,e={expanded:r.expanded||[],selected:r.selected||"",focused:r.focused||"",wrapperFocused:!1},o=!0,p=[])=>(a.Children.map(r.children,(t,c)=>{if(t&&t.type===l.PanelBarItem){const s=b(t,p,c);!t.props.disabled&&o&&(t.props.selected&&(e.selected=s),t.props.focused&&(e.focused=s),t.props.expanded&&(n==="multiple"?e.expanded.push(s):n==="single"&&(e.expanded=[s])),t.props.children&&(e=v(t.props,n,e,!!t.props.expanded,[...p,s])))}}),e),b=(r,n,e)=>r&&r.props&&r.props.id?r.props.id:n.length?n[n.length-1]+`.${e}`:`.${e}`;function E(r,n=[]){return(r||[]).forEach(e=>{e.disabled||(n.push(e),e.expanded&&e.children&&E(e.children,n))}),n}function q(r,n=[]){return a.Children.forEach(r,e=>{e&&e.props&&!e.props.disabled&&(n.push(e),e.props.children&&q(e.props.children,n))}),n}function C(r,n=[]){return a.Children.forEach(r,e=>{e&&e.props&&(e.props.expanded||e.props.parentExpanded)&&(n.push(e),e.props.children&&C(e.props.children,n))}),n}const x=r=>r!=null;exports.PanelBarUtils=void 0;(r=>{function n(e){return e.map((o,p)=>{let t;return o.content&&(t=o.content),o.children&&(t=n(o.children)),a.createElement(l.PanelBarItem,{...o,children:t,key:o.id||p})})}r.mapItemsToComponents=n})(exports.PanelBarUtils||(exports.PanelBarUtils={}));const h=(r,n)=>r.length!==n.length?!1:r.every((e,o)=>e===n[o]),k=(r,n,e,o,p)=>{let t;if(p===d.NavigationAction.First||p===d.NavigationAction.Last)switch(p){case d.NavigationAction.First:t=r[0];break;case d.NavigationAction.Last:t=r[r.length-1];break}else r.forEach((c,s)=>{if(c.props.uniquePrivateKey===(e.uniquePrivateKey||o)){const f=s+n<0?r.length-1:s+n>r.length-1?0:s+n;t=r[f]}});return t};exports.flatChildren=q;exports.flatVisibleChildren=C;exports.flatVisibleItems=E;exports.getFirstId=j;exports.getFocusedChild=k;exports.getInitialState=v;exports.isArrayEqual=h;exports.isPresent=x;exports.renderChildren=P;
|