@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.
Files changed (72) hide show
  1. package/MenuMcpWrapper.d.ts +17 -0
  2. package/MenuMcpWrapper.js +8 -0
  3. package/MenuMcpWrapper.mjs +18 -0
  4. package/README.md +4 -4
  5. package/actionsheet/ActionSheet.js +1 -1
  6. package/actionsheet/ActionSheet.mjs +18 -19
  7. package/actionsheet/ActionSheetItem.js +1 -1
  8. package/actionsheet/ActionSheetItem.mjs +1 -3
  9. package/bottomnavigation/BottomNavigation.js +1 -1
  10. package/bottomnavigation/BottomNavigation.mjs +85 -69
  11. package/bottomnavigation/BottomNavigationItem.js +1 -1
  12. package/bottomnavigation/BottomNavigationItem.mjs +34 -33
  13. package/bottomnavigation/messages/index.d.ts +17 -0
  14. package/bottomnavigation/messages/index.js +8 -0
  15. package/bottomnavigation/messages/index.mjs +14 -0
  16. package/breadcrumb/Breadcrumb.js +1 -1
  17. package/breadcrumb/Breadcrumb.mjs +30 -28
  18. package/breadcrumb/BreadcrumbLink.js +1 -1
  19. package/breadcrumb/BreadcrumbLink.mjs +26 -26
  20. package/breadcrumb/messages/index.d.ts +17 -0
  21. package/breadcrumb/messages/index.js +8 -0
  22. package/breadcrumb/messages/index.mjs +14 -0
  23. package/dist/cdn/js/kendo-react-layout.js +1 -1
  24. package/drawer/Drawer.js +1 -1
  25. package/drawer/Drawer.mjs +63 -63
  26. package/drawer/DrawerItem.js +1 -1
  27. package/drawer/DrawerItem.mjs +22 -23
  28. package/drawer/interfaces/DrawerProps.d.ts +8 -0
  29. package/expansionpanel/ExpansionPanel.js +1 -1
  30. package/expansionpanel/ExpansionPanel.mjs +50 -50
  31. package/expansionpanel/ExpansionPanelContent.js +1 -1
  32. package/expansionpanel/ExpansionPanelContent.mjs +7 -4
  33. package/index.d.mts +1 -2
  34. package/index.d.ts +1 -2
  35. package/index.js +1 -1
  36. package/index.mjs +128 -130
  37. package/menu/MenuProps.d.ts +6 -0
  38. package/package-metadata.js +1 -1
  39. package/package-metadata.mjs +2 -2
  40. package/package.json +8 -8
  41. package/panelbar/PanelBar.js +1 -1
  42. package/panelbar/PanelBar.mjs +94 -91
  43. package/panelbar/PanelBarItem.js +1 -1
  44. package/panelbar/PanelBarItem.mjs +13 -15
  45. package/panelbar/interfaces/PanelBarProps.d.ts +8 -0
  46. package/panelbar/interfaces/RenderPanelBarItem.d.ts +1 -0
  47. package/panelbar/util.d.ts +1 -1
  48. package/panelbar/util.js +1 -1
  49. package/panelbar/util.mjs +62 -59
  50. package/splitter/SplitterBar.d.ts +1 -0
  51. package/splitter/SplitterBar.js +1 -1
  52. package/splitter/SplitterBar.mjs +64 -56
  53. package/stepper/Step.js +1 -1
  54. package/stepper/Step.mjs +79 -85
  55. package/stepper/Stepper.js +1 -1
  56. package/stepper/Stepper.mjs +134 -133
  57. package/stepper/interfaces/StepperProps.d.ts +8 -1
  58. package/stepper/messages/index.d.ts +12 -2
  59. package/stepper/messages/index.js +1 -1
  60. package/stepper/messages/index.mjs +8 -4
  61. package/tabstrip/TabStrip.d.ts +8 -1
  62. package/tabstrip/TabStrip.js +1 -1
  63. package/tabstrip/TabStrip.mjs +126 -125
  64. package/tilelayout/InternalTile.js +1 -1
  65. package/tilelayout/InternalTile.mjs +119 -115
  66. package/tilelayout/TileLayout.js +1 -1
  67. package/tilelayout/TileLayout.mjs +58 -58
  68. package/timeline/TimelineCard.d.ts +2 -0
  69. package/timeline/TimelineCard.js +1 -1
  70. package/timeline/TimelineCard.mjs +16 -15
  71. package/timeline/TimelineHorizontal.js +1 -1
  72. package/timeline/TimelineHorizontal.mjs +105 -101
@@ -6,169 +6,172 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as a from "react";
9
- import b from "prop-types";
9
+ import y from "prop-types";
10
10
  import { PanelBarItem as L } from "./PanelBarItem.mjs";
11
- import { getInitialState as J, getFirstId as Q, flatChildren as X, isArrayEqual as Y, flatVisibleChildren as Z, getFocusedChild as _, renderChildren as ee } from "./util.mjs";
12
- import { Keys as m, classNames as re } from "@progress/kendo-react-common";
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 = (p) => {
14
+ const U = (c) => {
15
15
  const {
16
- animation: d = !0,
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: T = !1,
23
+ keepItemsMounted: R = !1,
24
24
  onSelect: C,
25
25
  style: D,
26
26
  isControlled: W
27
- } = p, v = a.useRef(null), E = a.useRef(void 0), x = a.useRef(null), [c, f] = a.useState(() => {
28
- const l = J(p, I || "multiple");
29
- return l.focused || (l.focused = Q(p)), l;
30
- }), F = I || "multiple", R = w !== void 0 ? w : c.selected, h = W ? O || [] : c.expanded, S = a.useCallback((r) => {
31
- x.current = window.setTimeout(() => r());
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
- (r) => {
34
- const l = K, s = X(a.Children.toArray(l));
35
- let t, i;
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 === (r.uniquePrivateKey || c.focused) && (t = e);
38
- }), F) {
39
+ e.props.uniquePrivateKey === (t.uniquePrivateKey || p.focused) && (r = e);
40
+ }), E) {
39
41
  case "single":
40
- i = [...t.props.parentUniquePrivateKey, t.props.uniquePrivateKey], Y(h, i) && (t.props.parentUniquePrivateKey ? i = [...t.props.parentUniquePrivateKey] : i = []);
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
- i = h.slice();
44
- const e = i.indexOf(t.props.uniquePrivateKey);
45
- e === -1 ? i.push(t.props.uniquePrivateKey) : i.splice(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
- i = h.slice();
51
+ l = h.slice();
50
52
  break;
51
53
  }
52
- f((e) => ({ ...e, selected: t.props.uniquePrivateKey, expanded: i })), C && C({
53
- target: t,
54
- expandedItems: i
54
+ f((e) => ({ ...e, selected: r.props.uniquePrivateKey, expanded: l })), C && C({
55
+ target: r,
56
+ expandedItems: l
55
57
  });
56
58
  },
57
- [o, c.focused, F, h, C]
58
- ), u = a.useCallback(
59
- (r, l = 0, s) => {
60
- const t = K, i = Z(a.Children.toArray(t)), e = _(i, l, r, c.focused, s);
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((y) => ({ ...y, expanded: [...new Set(k)] })), e.props.expanded) {
65
- const y = e.props.children[0].props.uniquePrivateKey;
66
- f((P) => ({ ...P, focused: y }));
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 y = e.props.parentUniquePrivateKey;
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((H) => ({ ...H, expanded: k }));
74
+ k.splice(q, 1), f((J) => ({ ...J, expanded: k }));
73
75
  } else if (e.props.level > 0) {
74
- const P = e.props.parentUniquePrivateKey[y.length - 1];
76
+ const P = e.props.parentUniquePrivateKey[b.length - 1];
75
77
  f((q) => ({ ...q, focused: P }));
76
78
  }
77
79
  } else
78
- E.current = e.props.id, f((y) => ({ ...y, focused: e.props.uniquePrivateKey }));
80
+ f((b) => ({ ...b, focused: e.props.uniquePrivateKey }));
79
81
  }
80
82
  },
81
- [o, c.focused, h]
83
+ [o, p.focused, h]
82
84
  ), B = a.useCallback(
83
- (r) => {
84
- g(r), u(r);
85
+ (t) => {
86
+ g(t), d(t);
85
87
  },
86
- [g, u]
87
- ), K = a.useMemo(() => ee({
88
- animation: d,
89
- keepItemsMounted: T,
90
- state: { ...c, selected: R },
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
- }), [d, T, c, R, h, o, B]), M = a.useCallback(
95
- (r, l) => {
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 (l) {
100
+ switch (i) {
98
101
  case n.First:
99
- u(r, s, n.First);
102
+ d(t, s, n.First);
100
103
  break;
101
104
  case n.Last:
102
- u(r, s, n.Last);
105
+ d(t, s, n.Last);
103
106
  break;
104
107
  case n.Left:
105
- u(r, s, n.Left);
108
+ d(t, s, n.Left);
106
109
  break;
107
110
  case n.Right:
108
- u(r, s, n.Right);
111
+ d(t, s, n.Right);
109
112
  break;
110
113
  case n.Previous:
111
- s = -1, u(r, s);
114
+ s = -1, d(t, s);
112
115
  break;
113
116
  case n.Next:
114
- s = 1, u(r, s);
117
+ s = 1, d(t, s);
115
118
  break;
116
119
  case n.Toggle:
117
- g(r);
120
+ g(t);
118
121
  break;
119
122
  }
120
123
  },
121
- [u, g]
122
- ), $ = a.useCallback(() => {
123
- clearTimeout(x.current), c.wrapperFocused || f((r) => ({ ...r, wrapperFocused: !0 }));
124
- }, [c.wrapperFocused]), V = a.useCallback(() => {
125
- S(() => {
126
- f((r) => ({ ...r, wrapperFocused: !1 }));
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
- }, [S]), j = a.useCallback(
129
- (r) => {
130
- const l = v.current && getComputedStyle(v.current).direction === "rtl" || !1;
131
- if (r.target === r.currentTarget) {
132
- const s = r.keyCode;
133
- let t;
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
- t = l ? n.Right : n.Left;
139
+ r = i ? n.Right : n.Left;
137
140
  break;
138
141
  case m.up:
139
- t = n.Previous;
142
+ r = n.Previous;
140
143
  break;
141
144
  case m.right:
142
- t = l ? n.Left : n.Right;
145
+ r = i ? n.Left : n.Right;
143
146
  break;
144
147
  case m.down:
145
- t = n.Next;
148
+ r = n.Next;
146
149
  break;
147
150
  case m.home:
148
- t = n.First;
151
+ r = n.First;
149
152
  break;
150
153
  case m.end:
151
- t = n.Last;
154
+ r = n.Last;
152
155
  break;
153
156
  case m.space:
154
157
  case m.enter:
155
- t = n.Toggle;
158
+ r = n.Toggle;
156
159
  break;
157
160
  default:
158
- t = null;
161
+ r = null;
159
162
  break;
160
163
  }
161
- t !== null && (r.preventDefault(), M(r, t));
164
+ r !== null && (t.preventDefault(), S(t, r));
162
165
  }
163
166
  },
164
- [M]
167
+ [S]
165
168
  );
166
169
  a.useEffect(() => () => {
167
170
  x.current && clearTimeout(x.current);
168
171
  }, []);
169
172
  const z = {
170
- "aria-activedescendant": E.current
171
- }, G = re("k-panelbar", A);
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: b.oneOfType([
194
- b.arrayOf(function(p, d) {
195
- return p[d].type !== L ? new Error("PanelBar children should be either PanelBarItem or an array of PanelBarItem.") : null;
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(p, d) {
198
- const o = p[d];
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: b.string,
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(p, d) {
211
- const o = p[d];
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 '${d}'. It must be either 'single', 'multiple' or 'default'.`
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: b.bool,
222
+ animation: y.bool,
220
223
  /**
221
224
  * When enabled, keeps PanelBarItem content mounted in the DOM even when collapsed.
222
225
  */
223
- keepItemsMounted: b.bool,
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: b.func
231
+ onSelect: y.func
229
232
  };
230
233
  U.defaultProps = {
231
234
  expandMode: "multiple",
@@ -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=h.title,uniquePrivateKey:u,disabled:l,selected:b,focused:C,expanded:o,className:P,level:k,headerClassName:R,animation:y,keepItemsMounted:s,onSelect:m,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(o||!1),T=e.useCallback(()=>{m&&!l&&m({uniquePrivateKey:u,id:r,target:p.current})},[m,l,u,r]),q=e.useCallback(f=>s?e.cloneElement(f,{...f.props,in:o}):f,[s,o]),A=e.useCallback(()=>{s&&g(!0)},[s]),j=e.useCallback(()=>{s&&g(!1)},[s]),U={role:"treeitem","aria-disabled":l,"aria-hidden":!l&&!o?"true":"false","aria-selected":!l&&b,"aria-expanded":!l&&o&&!!t},M=i.classNames("k-panelbar-item",{"k-panelbar-header":k===0,"k-expanded":o&&!!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:o?"chevron-up":"chevron-down",icon:o?N.chevronUpIcon:N.chevronDownIcon,className:i.classNames("k-panelbar-toggle",o?"k-panelbar-collapse":"k-panelbar-expand")}):null;let I=!1;t&&t[0]&&Array.isArray(t)&&(I=t[0].type===d);const K=s&&!w?"none":"block",v=!l&&o||s?I?e.createElement("ul",{role:"group","aria-hidden":o?"false":"true",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:u+"_animation",style:H,children:v,childFactory:s?q:void 0,unmountOnExit:!s,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"},E),F),W)}),h={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=h;
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 v, svgIconPropType as _ } from "@progress/kendo-react-common";
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(v, { className: "k-panelbar-item-icon", name: i, icon: s }) : a ? /* @__PURE__ */ e.createElement("span", { role: "presentation", className: "k-panelbar-item-icon " + a }) : null;
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: E = Q.title,
20
+ title: N = Q.title,
21
21
  uniquePrivateKey: c,
22
22
  disabled: t,
23
23
  selected: k,
24
- focused: N,
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 && !!a
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": N
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
- v,
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 I = !1;
88
- a && a[0] && Array.isArray(a) && (I = a[0].type === f);
89
- const G = l && !A ? "none" : "block", h = !t && r || l ? I ? /* @__PURE__ */ e.createElement(
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: h,
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
- ) : h;
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" }, E), q), W);
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
  }
@@ -19,4 +19,5 @@ export interface RenderPanelBarItem {
19
19
  parentExpanded?: boolean;
20
20
  level?: number;
21
21
  parentPrivateKey?: string[];
22
+ activeDescendantRef?: React.MutableRefObject<string | undefined>;
22
23
  }
@@ -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 B=require("react"),l=require("./PanelBarItem.js"),d=require("./interfaces/NavigationAction.js");function F(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(r,e,o.get?o:{enumerable:!0,get:()=>n[e]})}}return r.default=n,Object.freeze(r)}const i=F(B),O=n=>typeof n!="object"||!("type"in n)||n.type!==l.PanelBarItem,y=({animation:n=!0,keepItemsMounted:r=!1,state:e,expanded:o,handleSelect:a,children:t,parentExpanded:c=!0,level:s=0,parentPrivateKey:f=[]})=>{const b=i.Children.toArray(t).filter(O),q=b.length?b:t;return i.Children.map(q,(p,C)=>{if(p&&p.type===l.PanelBarItem){let m;const u=g(p,f,C);if(p.props.children){const A={animation:n,keepItemsMounted:r,state:e,expanded:o,handleSelect:a,children:p.props.children,parentExpanded:(o||[]).indexOf(u)>-1,level:s+1,parentPrivateKey:[...f,u]};m=y(A)}return i.cloneElement(p,{...p.props,animation:p.props.animation!==void 0?p.props.animation:n,keepItemsMounted:r,id:p.props.id||`k-panelbar-item-default-${u}`,uniquePrivateKey:u,parentUniquePrivateKey:f,parentExpanded:c,level:s,expanded:(o||[]).indexOf(u)>-1,focused:e.focused===u&&e.wrapperFocused,selected:e.selected===u,children:m,onSelect:a})}return i.createElement("div",{className:"k-panelbar-content"},p)})},x=n=>{const r=i.Children.toArray(n.children)[0];return r?g(r,[],0):""},I=(n,r,e={expanded:n.expanded||[],selected:n.selected||"",focused:n.focused||"",wrapperFocused:!1},o=!0,a=[])=>(i.Children.map(n.children,(t,c)=>{if(t&&t.type===l.PanelBarItem){const s=g(t,a,c);!t.props.disabled&&o&&(t.props.selected&&(e.selected=s),t.props.focused&&(e.focused=s),t.props.expanded&&(r==="multiple"?e.expanded.push(s):r==="single"&&(e.expanded=[s])),t.props.children&&(e=I(t.props,r,e,!!t.props.expanded,[...a,s])))}}),e),g=(n,r,e)=>n&&n.props&&n.props.id?n.props.id:r.length?r[r.length-1]+`.${e}`:`.${e}`;function P(n,r=[]){return(n||[]).forEach(e=>{e.disabled||(r.push(e),e.expanded&&e.children&&P(e.children,r))}),r}function v(n,r=[]){return i.Children.forEach(n,e=>{e&&e.props&&!e.props.disabled&&(r.push(e),e.props.children&&v(e.props.children,r))}),r}function E(n,r=[]){return i.Children.forEach(n,e=>{e&&e.props&&(e.props.expanded||e.props.parentExpanded)&&(r.push(e),e.props.children&&E(e.props.children,r))}),r}const N=n=>n!=null;exports.PanelBarUtils=void 0;(n=>{function r(e){return e.map((o,a)=>{let t;return o.content&&(t=o.content),o.children&&(t=r(o.children)),i.createElement(l.PanelBarItem,{...o,children:t,key:o.id||a})})}n.mapItemsToComponents=r})(exports.PanelBarUtils||(exports.PanelBarUtils={}));const S=(n,r)=>n.length!==r.length?!1:n.every((e,o)=>e===r[o]),j=(n,r,e,o,a)=>{let t;if(a===d.NavigationAction.First||a===d.NavigationAction.Last)switch(a){case d.NavigationAction.First:t=n[0];break;case d.NavigationAction.Last:t=n[n.length-1];break}else n.forEach((c,s)=>{if(c.props.uniquePrivateKey===(e.uniquePrivateKey||o)){const f=s+r<0?n.length-1:s+r>n.length-1?0:s+r;t=n[f]}});return t};exports.flatChildren=v;exports.flatVisibleChildren=E;exports.flatVisibleItems=P;exports.getFirstId=x;exports.getFocusedChild=j;exports.getInitialState=I;exports.isArrayEqual=S;exports.isPresent=N;exports.renderChildren=y;
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;