@progress/kendo-react-layout 14.5.0-develop.12 → 14.5.0-develop.14

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.
@@ -6,83 +6,85 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as e from "react";
9
- import s from "prop-types";
10
- import { StepperContext as ne } from "./context/StepperContext.mjs";
11
- import { focusFirstFocusableChild as oe, useDir as se, dispatchEvent as L, Navigation as re, classNames as A, svgIconPropType as M } from "@progress/kendo-react-common";
12
- import { Step as ie } from "./Step.mjs";
13
- import { ProgressBar as le } from "@progress/kendo-react-progressbars";
14
- import { DEFAULT_ANIMATION_DURATION as ae, NO_ANIMATION as ce } from "./contants.mjs";
15
- import { useLocalization as ue } from "@progress/kendo-react-intl";
16
- import { progBarAriaLabel as P, messages as de } from "./messages/index.mjs";
17
- const V = e.forwardRef((S, z) => {
9
+ import o from "prop-types";
10
+ import { StepperContext as se } from "./context/StepperContext.mjs";
11
+ import { useWebMcpRegister as oe, focusFirstFocusableChild as re, useDir as ie, dispatchEvent as L, Navigation as le, classNames as A, svgIconPropType as P } from "@progress/kendo-react-common";
12
+ import { Step as ae } from "./Step.mjs";
13
+ import { ProgressBar as ce } from "@progress/kendo-react-progressbars";
14
+ import { DEFAULT_ANIMATION_DURATION as ue, NO_ANIMATION as de } from "./contants.mjs";
15
+ import { useLocalization as me } from "@progress/kendo-react-intl";
16
+ import { progBarAriaLabel as V, messages as pe } from "./messages/index.mjs";
17
+ const z = e.forwardRef((b, H) => {
18
18
  const {
19
- animationDuration: b,
19
+ animationDuration: k,
20
20
  children: K,
21
21
  className: x,
22
22
  disabled: m,
23
23
  errorIcon: G,
24
- errorSVGIcon: H,
24
+ errorSVGIcon: _,
25
25
  item: N,
26
26
  items: p,
27
27
  linear: g,
28
- mode: _,
29
- orientation: E,
28
+ mode: B,
29
+ orientation: h,
30
30
  selectOnFocus: v,
31
- style: D,
32
- successIcon: B,
33
- successSVGIcon: U,
31
+ style: R,
32
+ successIcon: U,
33
+ successSVGIcon: j,
34
34
  value: a = 0,
35
- onChange: y,
36
- onFocus: h
37
- } = S, j = ue().toLanguageString(P, de[P]), f = e.useRef(null), R = e.useCallback(() => {
38
- f.current && oe(f.current);
39
- }, []), I = e.useCallback(
35
+ onChange: I,
36
+ onFocus: C
37
+ } = b, q = me().toLanguageString(V, pe[V]), f = e.useRef(null), D = e.useRef(null);
38
+ oe("stepper", D, b, b.webMcp);
39
+ const w = e.useCallback(() => {
40
+ f.current && re(f.current);
41
+ }, []), E = e.useCallback(
40
42
  () => ({
41
43
  element: f.current,
42
- focus: R
44
+ focus: w
43
45
  }),
44
- [R]
46
+ [w]
45
47
  );
46
- e.useImperativeHandle(z, I);
47
- const [q, u] = e.useState(a), d = p ? p.length : 0, o = E === "vertical", C = se(f, S.dir), J = typeof b == "number" ? b : b !== !1 ? ae : ce;
48
+ e.useImperativeHandle(H, E), e.useImperativeHandle(D, E);
49
+ const [W, u] = e.useState(a), d = p ? p.length : 0, s = h === "vertical", S = ie(f, b.dir), J = typeof k == "number" ? k : k !== !1 ? ue : de;
48
50
  e.useEffect(() => {
49
51
  u(a);
50
52
  }, [a]);
51
- const w = e.useCallback(
53
+ const T = e.useCallback(
52
54
  (l, r) => {
53
55
  const t = r === a - 1, n = r === a, i = r === a + 1;
54
- a !== r && y && !m && (!g || t || n || i) && (L(y, l, I(), {
56
+ a !== r && I && !m && (!g || t || n || i) && (L(I, l, E(), {
55
57
  value: r
56
58
  }), u(r));
57
59
  },
58
- [a, g, y, m, u]
60
+ [a, g, I, m, u]
59
61
  ), Q = e.useCallback(
60
62
  (l) => {
61
63
  const r = l.value, t = l.syntheticEvent;
62
- w(t, r);
64
+ T(t, r);
63
65
  },
64
- [w]
65
- ), W = e.useCallback(
66
+ [T]
67
+ ), X = e.useCallback(
66
68
  (l) => {
67
- h && !m && L(
68
- h,
69
+ C && !m && L(
70
+ C,
69
71
  l.syntheticEvent,
70
- I(),
72
+ E(),
71
73
  void 0
72
74
  );
73
75
  },
74
- [h, m]
75
- ), k = e.useMemo(() => {
76
- const l = C === "rtl", r = p.length - 1;
77
- return new re({
76
+ [C, m]
77
+ ), y = e.useMemo(() => {
78
+ const l = S === "rtl", r = p.length - 1;
79
+ return new le({
78
80
  root: f,
79
81
  selectors: ["ol.k-step-list li.k-step a.k-step-link"],
80
82
  tabIndex: 0,
81
83
  keyboardEvents: {
82
84
  keydown: {
83
85
  Tab: (t, n, i) => {
84
- const c = n.elements.indexOf(t), F = n.previous(t).children[0], O = n.next(t).children[0];
85
- i.shiftKey ? !l && c > 0 ? (i.preventDefault(), n.focusPrevious(t), u(c - 1), v && F.click()) : l && c < r && (i.preventDefault(), n.focusNext(t), u(c + 1), v && O.click()) : !l && c < r ? (i.preventDefault(), n.focusNext(t), u(c + 1), v && O.click()) : l && c > 0 && (i.preventDefault(), n.focusPrevious(t), u(c - 1), v && F.click());
86
+ const c = n.elements.indexOf(t), M = n.previous(t).children[0], O = n.next(t).children[0];
87
+ i.shiftKey ? !l && c > 0 ? (i.preventDefault(), n.focusPrevious(t), u(c - 1), v && M.click()) : l && c < r && (i.preventDefault(), n.focusNext(t), u(c + 1), v && O.click()) : !l && c < r ? (i.preventDefault(), n.focusNext(t), u(c + 1), v && O.click()) : l && c > 0 && (i.preventDefault(), n.focusPrevious(t), u(c - 1), v && M.click());
86
88
  },
87
89
  Home: (t, n, i) => {
88
90
  i.preventDefault(), n.focusElement(n.first, t), u(0);
@@ -99,9 +101,9 @@ const V = e.forwardRef((S, z) => {
99
101
  }
100
102
  }
101
103
  });
102
- }, [C, p.length, u, v]);
103
- e.useEffect(() => (k.initializeRovingTab(a), () => k.removeFocusListener()), []);
104
- const X = e.useCallback(k.triggerKeyboardEvent.bind(k), []), Y = e.useMemo(
104
+ }, [S, p.length, u, v]);
105
+ e.useEffect(() => (y.initializeRovingTab(a), () => y.removeFocusListener()), []);
106
+ const Y = e.useCallback(y.triggerKeyboardEvent.bind(y), []), Z = e.useMemo(
105
107
  () => A(
106
108
  "k-stepper",
107
109
  {
@@ -110,89 +112,89 @@ const V = e.forwardRef((S, z) => {
110
112
  x
111
113
  ),
112
114
  [g, x]
113
- ), Z = e.useMemo(
115
+ ), $ = e.useMemo(
114
116
  () => ({
115
117
  display: "grid",
116
- gridTemplateColumns: o ? void 0 : "repeat(" + d * 2 + ", 1fr)",
117
- gridTemplateRows: o ? "repeat(" + d + ", 1fr)" : void 0,
118
- ...D
118
+ gridTemplateColumns: s ? void 0 : "repeat(" + d * 2 + ", 1fr)",
119
+ gridTemplateRows: s ? "repeat(" + d + ", 1fr)" : void 0,
120
+ ...R
119
121
  }),
120
- [o, d, D]
121
- ), $ = e.useMemo(
122
+ [s, d, R]
123
+ ), ee = e.useMemo(
122
124
  () => A("k-step-list", {
123
- "k-step-list-horizontal": !o,
124
- "k-step-list-vertical": o
125
+ "k-step-list-horizontal": !s,
126
+ "k-step-list-vertical": s
125
127
  }),
126
- [o]
127
- ), ee = e.useMemo(
128
+ [s]
129
+ ), te = e.useMemo(
128
130
  () => ({
129
- gridColumnStart: o ? void 0 : 1,
130
- gridColumnEnd: o ? void 0 : -1,
131
- gridRowStart: o ? 1 : void 0,
132
- gridRowEnd: o ? -1 : void 0
131
+ gridColumnStart: s ? void 0 : 1,
132
+ gridColumnEnd: s ? void 0 : -1,
133
+ gridRowStart: s ? 1 : void 0,
134
+ gridRowEnd: s ? -1 : void 0
133
135
  }),
134
- [o]
135
- ), te = e.useMemo(
136
+ [s]
137
+ ), ne = e.useMemo(
136
138
  () => ({
137
- gridColumnStart: o ? void 0 : 2,
138
- gridColumnEnd: o ? void 0 : d * 2,
139
- gridRowStart: o ? 1 : void 0,
140
- gridRowEnd: o ? d : void 0,
141
- top: o ? 17 : void 0
139
+ gridColumnStart: s ? void 0 : 2,
140
+ gridColumnEnd: s ? void 0 : d * 2,
141
+ gridRowStart: s ? 1 : void 0,
142
+ gridRowEnd: s ? d : void 0,
143
+ top: s ? 17 : void 0
142
144
  }),
143
- [o, d]
144
- ), T = p && p.map((l, r) => {
145
+ [s, d]
146
+ ), F = p && p.map((l, r) => {
145
147
  const t = {
146
148
  index: r,
147
149
  disabled: m || l.disabled,
148
- focused: r === q,
150
+ focused: r === W,
149
151
  current: r === a,
150
152
  ...l
151
- }, n = N || ie;
153
+ }, n = N || ae;
152
154
  return /* @__PURE__ */ e.createElement(n, { key: r, ...t });
153
155
  });
154
156
  return /* @__PURE__ */ e.createElement(
155
- ne.Provider,
157
+ se.Provider,
156
158
  {
157
159
  value: {
158
- animationDuration: b,
159
- isVertical: o,
160
+ animationDuration: k,
161
+ isVertical: s,
160
162
  item: N,
161
163
  linear: g,
162
- mode: _,
164
+ mode: B,
163
165
  numOfSteps: d,
164
166
  value: a,
165
- successIcon: B,
166
- successSVGIcon: U,
167
+ successIcon: U,
168
+ successSVGIcon: j,
167
169
  errorIcon: G,
168
- errorSVGIcon: H,
170
+ errorSVGIcon: _,
169
171
  onChange: Q,
170
- onFocus: W
172
+ onFocus: X
171
173
  }
172
174
  },
173
175
  /* @__PURE__ */ e.createElement(
174
176
  "nav",
175
177
  {
176
- className: Y,
177
- style: Z,
178
- dir: C,
178
+ className: Z,
179
+ style: $,
180
+ dir: S,
179
181
  role: "navigation",
180
182
  ref: f,
181
- onKeyDown: X
183
+ onKeyDown: Y
182
184
  },
183
- /* @__PURE__ */ e.createElement("ol", { className: $, style: ee }, T || K),
185
+ /* @__PURE__ */ e.createElement("ol", { className: ee, style: te }, F || K),
184
186
  /* @__PURE__ */ e.createElement(
185
- le,
187
+ ce,
186
188
  {
187
- style: te,
189
+ style: ne,
188
190
  labelPlacement: "start",
189
191
  animation: { duration: J },
190
- ariaLabel: j,
192
+ ariaLabel: q,
191
193
  "aria-hidden": !0,
192
194
  max: d - 1,
193
195
  labelVisible: !1,
194
- orientation: E,
195
- reverse: E === "vertical",
196
+ orientation: h,
197
+ reverse: h === "vertical",
196
198
  value: a,
197
199
  disabled: m,
198
200
  tabIndex: -1
@@ -201,27 +203,27 @@ const V = e.forwardRef((S, z) => {
201
203
  )
202
204
  );
203
205
  });
204
- V.propTypes = {
205
- animationDuration: s.oneOfType([s.bool, s.number]),
206
- children: s.any,
207
- className: s.string,
208
- dir: s.string,
209
- disabled: s.bool,
210
- errorIcon: s.string,
211
- errorSVGIcon: M,
212
- item: s.any,
213
- items: s.any,
214
- linear: s.bool,
215
- mode: s.oneOf(["steps", "labels"]),
216
- orientation: s.oneOf(["horizontal", "vertical"]),
217
- style: s.object,
218
- successIcon: s.string,
219
- successSVGIcon: M,
220
- value: s.number.isRequired,
221
- onChange: s.func,
222
- onFocus: s.func
206
+ z.propTypes = {
207
+ animationDuration: o.oneOfType([o.bool, o.number]),
208
+ children: o.any,
209
+ className: o.string,
210
+ dir: o.string,
211
+ disabled: o.bool,
212
+ errorIcon: o.string,
213
+ errorSVGIcon: P,
214
+ item: o.any,
215
+ items: o.any,
216
+ linear: o.bool,
217
+ mode: o.oneOf(["steps", "labels"]),
218
+ orientation: o.oneOf(["horizontal", "vertical"]),
219
+ style: o.object,
220
+ successIcon: o.string,
221
+ successSVGIcon: P,
222
+ value: o.number.isRequired,
223
+ onChange: o.func,
224
+ onFocus: o.func
223
225
  };
224
- V.displayName = "KendoStepper";
226
+ z.displayName = "KendoStepper";
225
227
  export {
226
- V as Stepper
228
+ z as Stepper
227
229
  };
@@ -8,7 +8,7 @@
8
8
  import { StepProps } from './StepProps';
9
9
  import { StepperChangeEvent } from './StepperChangeEvent';
10
10
  import { StepperFocusEvent } from './StepperFocusEvent';
11
- import { SVGIcon } from '@progress/kendo-react-common';
11
+ import { SVGIcon, WebMcpProps } from '@progress/kendo-react-common';
12
12
  import * as React from 'react';
13
13
  /**
14
14
  * Represents the props of the [KendoReact Stepper component](https://www.telerik.com/kendo-react-ui/components/layout/stepper).
@@ -213,4 +213,11 @@ export interface StepperProps {
213
213
  * ```
214
214
  */
215
215
  onFocus?: (event: StepperFocusEvent) => void;
216
+ /**
217
+ * Enables Web MCP tool registration so AI agents can interact with this Stepper.
218
+ * Set to `true` to use the provider-level `dataName`, or pass a config object to override.
219
+ *
220
+ * Requires a `WebMcpProvider` ancestor from `@progress/kendo-react-webmcp`.
221
+ */
222
+ webMcp?: boolean | WebMcpProps;
216
223
  }
@@ -5,7 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
8
+ import { KendoReactComponentBaseProps, WebMcpProps } from '@progress/kendo-react-common';
9
9
  import { ButtonProps } from '@progress/kendo-react-buttons';
10
10
  import * as React from 'react';
11
11
  /**
@@ -208,6 +208,13 @@ export interface TabStripProps extends KendoReactComponentBaseProps, TabStripScr
208
208
  * ```
209
209
  */
210
210
  onSelect?: (e: TabStripSelectEventArguments) => void;
211
+ /**
212
+ * Enables Web MCP tool registration so AI agents can interact with this TabStrip.
213
+ * Set to `true` to use the provider-level `dataName`, or pass a config object to override.
214
+ *
215
+ * Requires a `WebMcpProvider` ancestor from `@progress/kendo-react-webmcp`.
216
+ */
217
+ webMcp?: boolean | WebMcpProps;
211
218
  }
212
219
  /**
213
220
  * @hidden
@@ -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 ce=require("react"),l=require("prop-types"),ee=require("./TabStripNavigation.js"),ae=require("./TabStripContent.js"),A=require("@progress/kendo-react-common");function ue(S){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(S){for(const f in S)if(f!=="default"){const b=Object.getOwnPropertyDescriptor(S,f);Object.defineProperty(C,f,b.get?b:{enumerable:!0,get:()=>S[f]})}}return C.default=S,Object.freeze(C)}const n=ue(ce),de={animation:!0,tabPosition:"top",tabAlignment:"start",keepTabsMounted:!1,buttonScrollSpeed:100,mouseScrollSpeed:10,scrollButtons:"auto",scrollButtonsPosition:"split",renderAllContent:!1},E=n.forwardRef((S,C)=>{const f={...de,...S},{id:b,animation:H,children:j,selected:u,onSelect:B,style:te,tabContentStyle:q,tabPosition:p,tabAlignment:L,tabIndex:W,className:K,dir:x,renderAllContent:O,keepTabsMounted:_,size:k,scrollable:h,scrollButtons:I,scrollButtonsPosition:F,buttonScrollSpeed:U,mouseScrollSpeed:ne,prevButton:$,nextButton:G}=f,[g,oe]=n.useState(null),se=n.useRef({props:f}),R=n.useRef(null),z=n.useRef(null),y=n.useRef(void 0),P=n.useRef(void 0),J=n.useCallback(()=>({props:f}),[f]);n.useImperativeHandle(se,J),n.useImperativeHandle(C,J);const w=n.useMemo(()=>b?b+"-content-panel-id":void 0,[b]),N=n.useMemo(()=>b?b+"-nav-item-id":void 0,[b]),v=n.useMemo(()=>n.Children.toArray(j).filter(Boolean),[j]),Q=n.useCallback(()=>/top|bottom/.test(p||"top"),[p]),T=n.useCallback(()=>{const s=Q(),i=z.current;if(!i)return;const a=i.scrollLeft,t=i.clientWidth,e=i.scrollWidth,r=i.scrollTop,o=i.scrollHeight,d=i.clientHeight;let c=null;const ie=s?e>t:o>d,Z=x==="rtl";ie?s?a+t===e||(Z&&t-a)===e?c="end":a===0||Z&&-a===0?c="start":a>0&&a+t<e||-a>0&&t-a<e?c="middle":c=null:o-(r+d)===0?c="bottom":r===0?c="top":r>0&&o-(r+d)>0?c="middle":c=null:c=null,oe(c)},[Q,x]),D=n.useCallback(s=>{u!==s&&B&&B({selected:s})},[u,B]),m=n.useCallback(s=>{var t,e;const i=v;((e=(t=i==null?void 0:i[s])==null?void 0:t.props)==null?void 0:e.disabled)||D(s)},[v,D]),V=n.useCallback(s=>{P.current&&P.current.triggerKeyboardEvent(s)},[]);n.useEffect(()=>{var a;const s=R.current,i=s&&getComputedStyle(s).direction==="rtl"||!1;return s&&(P.current=new A.Navigation({tabIndex:0,root:R,rovingTabIndex:!0,focusClass:"k-focus",selectors:[".k-tabstrip .k-tabstrip-item"],keyboardEvents:{keydown:{ArrowLeft:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),d=o!==0?o-1:e.elements.length-1,c=o!==e.elements.length-1?o+1:0;i?(e.focusNext(t),m(c)):(e.focusPrevious(t),m(d))},ArrowRight:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),d=o!==0?o-1:e.elements.length-1,c=o!==e.elements.length-1?o+1:0;i?(e.focusPrevious(t),m(d)):(e.focusNext(t),m(c))},ArrowDown:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),d=o!==e.elements.length-1?o+1:0;e.focusNext(t),m(d)},ArrowUp:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),d=o!==0?o-1:e.elements.length-1;e.focusPrevious(t),m(d)},Home:(t,e,r)=>{r.preventDefault(),e.focusElement(e.first,t),m(0)},End:(t,e,r)=>{r.preventDefault(),e.focusElement(e.last,t),m(e.elements.length-1)}}}}),(a=P.current)==null||a.initializeRovingTab(u),T(),y.current=window.ResizeObserver&&new ResizeObserver(()=>T()),R.current&&y.current&&y.current.observe(R.current)),()=>{var t;(t=P.current)==null||t.removeFocusListener(),y.current&&y.current.disconnect()}},[u,m,T]);const re=n.useMemo(()=>{const s=n.Children.count(v);return u<s&&u>-1?n.createElement(ae.TabStripContent,{index:u,selected:u,contentPanelId:w,navItemId:N,animation:H,keepTabsMounted:_,renderAllContent:O,style:q},v):null},[u,v,w,N,H,_,O,q]),M=I==="hidden"||g===null&&I==="auto"?"hidden":"visible",X=n.useMemo(()=>({itemsNavRef:z,children:v,selected:u,tabIndex:W,tabPosition:p,tabAlignment:L,size:k,scrollable:h,scrollButtons:M,scrollButtonsPosition:F,buttonScrollSpeed:U,mouseScrollSpeed:ne,prevButton:$,nextButton:G,dir:x,contentPanelId:w,renderAllContent:O,navItemId:N,onKeyDown:V,onSelect:D,onScroll:T,containerScrollPosition:g}),[z,v,u,W,p,L,k,h,M,F,U,$,G,x,w,O,N,V,D,T,g]),Y=p==="bottom",le=n.useMemo(()=>A.classNames("k-tabstrip k-pos-relative",{[`k-tabstrip-${A.kendoThemeMaps.sizeMap[k||"medium"]||k}`]:k,"k-tabstrip-left":p==="left","k-tabstrip-right":p==="right","k-tabstrip-bottom":p==="bottom","k-tabstrip-top":p==="top","k-tabstrip-scrollable":h,"k-tabstrip-scrollable-start k-tabstrip-scrollable-end":h&&M==="visible","k-tabstrip-scrollable-start":h&&I==="auto"&&(g==="end"||g==="middle"),"k-tabstrip-scrollable-end":h&&I==="auto"&&(g==="start"||g==="middle")},K),[k,p,h,I,M,g,K]);return n.createElement("div",{id:b,ref:R,dir:x,className:le,style:te,onScroll:T},!Y&&n.createElement(ee.TabStripNavigation,{...X}),re,Y&&n.createElement(ee.TabStripNavigation,{...X}))});E.displayName="TabStrip";E.propTypes={id:l.string,animation:l.bool,children:l.node,onSelect:l.func,selected:l.number,style:l.object,tabContentStyle:l.object,tabPosition:l.string,tabAlignment:l.string,tabIndex:l.number,className:l.string,dir:l.string,renderAllContent:l.bool,size:l.oneOf(["small","medium","large"]),scrollButtons:l.oneOf(["auto","visible","hidden"]),scrollButtonsPosition:l.oneOf(["split","start","end","around","before","after"])};const be=E;exports.TabStrip=be;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ce=require("react"),l=require("prop-types"),ne=require("./TabStripNavigation.js"),ae=require("./TabStripContent.js"),B=require("@progress/kendo-react-common");function ue(g){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(g){for(const u in g)if(u!=="default"){const p=Object.getOwnPropertyDescriptor(g,u);Object.defineProperty(C,u,p.get?p:{enumerable:!0,get:()=>g[u]})}}return C.default=g,Object.freeze(C)}const n=ue(ce),de={animation:!0,tabPosition:"top",tabAlignment:"start",keepTabsMounted:!1,buttonScrollSpeed:100,mouseScrollSpeed:10,scrollButtons:"auto",scrollButtonsPosition:"split",renderAllContent:!1},E=n.forwardRef((g,C)=>{const u=n.useMemo(()=>({...de,...g}),[g]),{id:p,animation:H,children:j,selected:d,onSelect:z,style:oe,tabContentStyle:q,tabPosition:f,tabAlignment:W,tabIndex:L,className:K,dir:x,renderAllContent:O,keepTabsMounted:_,size:k,scrollable:h,scrollButtons:R,scrollButtonsPosition:F,buttonScrollSpeed:U,mouseScrollSpeed:$,prevButton:G,nextButton:J}=u,[S,se]=n.useState(null),Q=n.useRef({props:u}),I=n.useRef(null),A=n.useRef(null),y=n.useRef(void 0),P=n.useRef(void 0),V=n.useCallback(()=>({props:u}),[u]);n.useImperativeHandle(Q,V),n.useImperativeHandle(C,V),B.useWebMcpRegister("tabstrip",Q,u,u.webMcp);const w=n.useMemo(()=>p?p+"-content-panel-id":void 0,[p]),M=n.useMemo(()=>p?p+"-nav-item-id":void 0,[p]),v=n.useMemo(()=>n.Children.toArray(j).filter(Boolean),[j]),X=n.useCallback(()=>/top|bottom/.test(f||"top"),[f]),T=n.useCallback(()=>{const s=X(),i=A.current;if(!i)return;const a=i.scrollLeft,t=i.clientWidth,e=i.scrollWidth,r=i.scrollTop,o=i.scrollHeight,b=i.clientHeight;let c=null;const ie=s?e>t:o>b,te=x==="rtl";ie?s?a+t===e||(te&&t-a)===e?c="end":a===0||te&&-a===0?c="start":a>0&&a+t<e||-a>0&&t-a<e?c="middle":c=null:o-(r+b)===0?c="bottom":r===0?c="top":r>0&&o-(r+b)>0?c="middle":c=null:c=null,se(c)},[X,x]),N=n.useCallback(s=>{d!==s&&z&&z({selected:s})},[d,z]),m=n.useCallback(s=>{var t,e;const i=v;((e=(t=i==null?void 0:i[s])==null?void 0:t.props)==null?void 0:e.disabled)||N(s)},[v,N]),Y=n.useCallback(s=>{P.current&&P.current.triggerKeyboardEvent(s)},[]);n.useEffect(()=>{var a;const s=I.current,i=s&&getComputedStyle(s).direction==="rtl"||!1;return s&&(P.current=new B.Navigation({tabIndex:0,root:I,rovingTabIndex:!0,focusClass:"k-focus",selectors:[".k-tabstrip .k-tabstrip-item"],keyboardEvents:{keydown:{ArrowLeft:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),b=o!==0?o-1:e.elements.length-1,c=o!==e.elements.length-1?o+1:0;i?(e.focusNext(t),m(c)):(e.focusPrevious(t),m(b))},ArrowRight:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),b=o!==0?o-1:e.elements.length-1,c=o!==e.elements.length-1?o+1:0;i?(e.focusPrevious(t),m(b)):(e.focusNext(t),m(c))},ArrowDown:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),b=o!==e.elements.length-1?o+1:0;e.focusNext(t),m(b)},ArrowUp:(t,e,r)=>{r.preventDefault();const o=e.elements.indexOf(t),b=o!==0?o-1:e.elements.length-1;e.focusPrevious(t),m(b)},Home:(t,e,r)=>{r.preventDefault(),e.focusElement(e.first,t),m(0)},End:(t,e,r)=>{r.preventDefault(),e.focusElement(e.last,t),m(e.elements.length-1)}}}}),(a=P.current)==null||a.initializeRovingTab(d),T(),y.current=window.ResizeObserver&&new ResizeObserver(()=>T()),I.current&&y.current&&y.current.observe(I.current)),()=>{var t;(t=P.current)==null||t.removeFocusListener(),y.current&&y.current.disconnect()}},[d,m,T]);const re=n.useMemo(()=>{const s=n.Children.count(v);return d<s&&d>-1?n.createElement(ae.TabStripContent,{index:d,selected:d,contentPanelId:w,navItemId:M,animation:H,keepTabsMounted:_,renderAllContent:O,style:q},v):null},[d,v,w,M,H,_,O,q]),D=R==="hidden"||S===null&&R==="auto"?"hidden":"visible",Z=n.useMemo(()=>({itemsNavRef:A,children:v,selected:d,tabIndex:L,tabPosition:f,tabAlignment:W,size:k,scrollable:h,scrollButtons:D,scrollButtonsPosition:F,buttonScrollSpeed:U,mouseScrollSpeed:$,prevButton:G,nextButton:J,dir:x,contentPanelId:w,renderAllContent:O,navItemId:M,onKeyDown:Y,onSelect:N,onScroll:T,containerScrollPosition:S}),[A,v,d,L,f,W,k,h,D,F,U,$,G,J,x,w,O,M,Y,N,T,S]),ee=f==="bottom",le=n.useMemo(()=>B.classNames("k-tabstrip k-pos-relative",{[`k-tabstrip-${B.kendoThemeMaps.sizeMap[k||"medium"]||k}`]:k,"k-tabstrip-left":f==="left","k-tabstrip-right":f==="right","k-tabstrip-bottom":f==="bottom","k-tabstrip-top":f==="top","k-tabstrip-scrollable":h,"k-tabstrip-scrollable-start k-tabstrip-scrollable-end":h&&D==="visible","k-tabstrip-scrollable-start":h&&R==="auto"&&(S==="end"||S==="middle"),"k-tabstrip-scrollable-end":h&&R==="auto"&&(S==="start"||S==="middle")},K),[k,f,h,R,D,S,K]);return n.createElement("div",{id:p,ref:I,dir:x,className:le,style:oe,onScroll:T},!ee&&n.createElement(ne.TabStripNavigation,{...Z}),re,ee&&n.createElement(ne.TabStripNavigation,{...Z}))});E.displayName="TabStrip";E.propTypes={id:l.string,animation:l.bool,children:l.node,onSelect:l.func,selected:l.number,style:l.object,tabContentStyle:l.object,tabPosition:l.string,tabAlignment:l.string,tabIndex:l.number,className:l.string,dir:l.string,renderAllContent:l.bool,size:l.oneOf(["small","medium","large"]),scrollButtons:l.oneOf(["auto","visible","hidden"]),scrollButtonsPosition:l.oneOf(["split","start","end","around","before","after"])};const be=E;exports.TabStrip=be;