@progress/kendo-react-layout 14.5.0-develop.8 → 15.0.0-develop.1
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.d.ts +12 -0
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +69 -68
- package/actionsheet/ActionSheetItem.js +1 -1
- package/actionsheet/ActionSheetItem.mjs +1 -3
- package/appbar/interfaces/AppBarProps.d.ts +2 -14
- package/bottomnavigation/BottomNavigation.js +1 -1
- package/bottomnavigation/BottomNavigation.mjs +81 -76
- package/bottomnavigation/BottomNavigationItem.js +1 -1
- package/bottomnavigation/BottomNavigationItem.mjs +34 -33
- package/bottomnavigation/BottomNavigationProps.d.ts +3 -13
- 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/card/Avatar.js +1 -1
- package/card/Avatar.mjs +14 -26
- package/card/interfaces/AvatarProps.d.ts +1 -8
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.d.ts +1 -1
- package/drawer/Drawer.js +1 -1
- package/drawer/Drawer.mjs +63 -63
- package/drawer/DrawerContent.d.ts +1 -1
- package/drawer/DrawerItem.d.ts +1 -1
- 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/menu/components/MenuItemArrow.d.ts +3 -3
- package/menu/components/MenuItemArrow.js +1 -1
- package/menu/components/MenuItemArrow.mjs +13 -23
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +14 -9
- 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 +81 -72
- 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/tabstrip/TabStripNavigation.js +1 -1
- package/tabstrip/TabStripNavigation.mjs +31 -31
- 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 +27 -18
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +113 -109
|
@@ -12,11 +12,21 @@ export declare const optionalText = "stepper.optionalText";
|
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const progressBarAriaLabel = "stepper.progressBarAriaLabel";
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export declare const ariaLabel = "stepper.ariaLabel";
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export declare const stepAriaLabel = "stepper.stepAriaLabel";
|
|
16
24
|
/**
|
|
17
25
|
* @hidden
|
|
18
26
|
*/
|
|
19
27
|
export declare const messages: {
|
|
20
28
|
"stepper.optionalText": string;
|
|
21
|
-
"stepper.
|
|
29
|
+
"stepper.progressBarAriaLabel": string;
|
|
30
|
+
"stepper.ariaLabel": string;
|
|
31
|
+
"stepper.stepAriaLabel": string;
|
|
22
32
|
};
|
|
@@ -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 e="stepper.optionalText",a="stepper.
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="stepper.optionalText",a="stepper.progressBarAriaLabel",r="stepper.ariaLabel",s="stepper.stepAriaLabel",t={[e]:"(Optional)",[a]:"progressbar",[r]:"Stepper",[s]:"Step"};exports.ariaLabel=r;exports.messages=t;exports.optionalText=e;exports.progressBarAriaLabel=a;exports.stepAriaLabel=s;
|
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
const e = "stepper.optionalText",
|
|
8
|
+
const e = "stepper.optionalText", a = "stepper.progressBarAriaLabel", r = "stepper.ariaLabel", p = "stepper.stepAriaLabel", s = {
|
|
9
9
|
[e]: "(Optional)",
|
|
10
|
-
[
|
|
10
|
+
[a]: "progressbar",
|
|
11
|
+
[r]: "Stepper",
|
|
12
|
+
[p]: "Step"
|
|
11
13
|
};
|
|
12
14
|
export {
|
|
13
|
-
r as
|
|
15
|
+
r as ariaLabel,
|
|
16
|
+
s as messages,
|
|
14
17
|
e as optionalText,
|
|
15
|
-
|
|
18
|
+
a as progressBarAriaLabel,
|
|
19
|
+
p as stepAriaLabel
|
|
16
20
|
};
|
package/tabstrip/TabStrip.d.ts
CHANGED
|
@@ -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
|
package/tabstrip/TabStrip.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 ce=require("react"),l=require("prop-types"),
|
|
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;
|
package/tabstrip/TabStrip.mjs
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as n from "react";
|
|
9
|
-
import
|
|
10
|
-
import { TabStripNavigation as
|
|
9
|
+
import l from "prop-types";
|
|
10
|
+
import { TabStripNavigation as ee } from "./TabStripNavigation.mjs";
|
|
11
11
|
import { TabStripContent as ie } from "./TabStripContent.mjs";
|
|
12
|
-
import {
|
|
13
|
-
const
|
|
12
|
+
import { useWebMcpRegister as ce, Navigation as ae, classNames as ue, kendoThemeMaps as de } from "@progress/kendo-react-common";
|
|
13
|
+
const be = {
|
|
14
14
|
animation: !0,
|
|
15
15
|
tabPosition: "top",
|
|
16
16
|
tabAlignment: "start",
|
|
@@ -20,101 +20,101 @@ const de = {
|
|
|
20
20
|
scrollButtons: "auto",
|
|
21
21
|
scrollButtonsPosition: "split",
|
|
22
22
|
renderAllContent: !1
|
|
23
|
-
},
|
|
24
|
-
const
|
|
23
|
+
}, D = n.forwardRef((E, te) => {
|
|
24
|
+
const h = n.useMemo(() => ({ ...be, ...E }), [E]), {
|
|
25
25
|
id: m,
|
|
26
26
|
animation: H,
|
|
27
|
-
children:
|
|
27
|
+
children: O,
|
|
28
28
|
selected: u,
|
|
29
|
-
onSelect:
|
|
30
|
-
style:
|
|
31
|
-
tabContentStyle:
|
|
32
|
-
tabPosition:
|
|
33
|
-
tabAlignment:
|
|
29
|
+
onSelect: N,
|
|
30
|
+
style: ne,
|
|
31
|
+
tabContentStyle: z,
|
|
32
|
+
tabPosition: b,
|
|
33
|
+
tabAlignment: W,
|
|
34
34
|
tabIndex: L,
|
|
35
|
-
className:
|
|
36
|
-
dir:
|
|
35
|
+
className: K,
|
|
36
|
+
dir: x,
|
|
37
37
|
renderAllContent: P,
|
|
38
|
-
keepTabsMounted:
|
|
39
|
-
size:
|
|
38
|
+
keepTabsMounted: j,
|
|
39
|
+
size: k,
|
|
40
40
|
scrollable: g,
|
|
41
|
-
scrollButtons:
|
|
42
|
-
scrollButtonsPosition:
|
|
43
|
-
buttonScrollSpeed:
|
|
44
|
-
mouseScrollSpeed:
|
|
45
|
-
prevButton:
|
|
46
|
-
nextButton:
|
|
47
|
-
} =
|
|
48
|
-
n.useImperativeHandle(
|
|
49
|
-
const
|
|
50
|
-
const s =
|
|
41
|
+
scrollButtons: C,
|
|
42
|
+
scrollButtonsPosition: F,
|
|
43
|
+
buttonScrollSpeed: U,
|
|
44
|
+
mouseScrollSpeed: $,
|
|
45
|
+
prevButton: q,
|
|
46
|
+
nextButton: G
|
|
47
|
+
} = h, [f, oe] = n.useState(null), J = n.useRef({ props: h }), T = n.useRef(null), A = n.useRef(null), I = n.useRef(void 0), R = n.useRef(void 0), Q = n.useCallback(() => ({ props: h }), [h]);
|
|
48
|
+
n.useImperativeHandle(J, Q), n.useImperativeHandle(te, Q), ce("tabstrip", J, h, h.webMcp);
|
|
49
|
+
const w = n.useMemo(() => m ? m + "-content-panel-id" : void 0, [m]), y = n.useMemo(() => m ? m + "-nav-item-id" : void 0, [m]), S = n.useMemo(() => n.Children.toArray(O).filter(Boolean), [O]), V = n.useCallback(() => /top|bottom/.test(b || "top"), [b]), v = n.useCallback(() => {
|
|
50
|
+
const s = V(), i = A.current;
|
|
51
51
|
if (!i)
|
|
52
52
|
return;
|
|
53
|
-
const a = i.scrollLeft, t = i.clientWidth, e = i.scrollWidth,
|
|
53
|
+
const a = i.scrollLeft, t = i.clientWidth, e = i.scrollWidth, r = i.scrollTop, o = i.scrollHeight, d = i.clientHeight;
|
|
54
54
|
let c = null;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}, [
|
|
55
|
+
const le = s ? e > t : o > d, _ = x === "rtl";
|
|
56
|
+
le ? s ? a + t === e || (_ && t - a) === e ? c = "end" : a === 0 || _ && -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);
|
|
57
|
+
}, [V, x]), M = n.useCallback(
|
|
58
58
|
(s) => {
|
|
59
|
-
u !== s &&
|
|
59
|
+
u !== s && N && N({
|
|
60
60
|
selected: s
|
|
61
61
|
});
|
|
62
62
|
},
|
|
63
|
-
[u,
|
|
64
|
-
),
|
|
63
|
+
[u, N]
|
|
64
|
+
), p = n.useCallback(
|
|
65
65
|
(s) => {
|
|
66
66
|
var t, e;
|
|
67
67
|
const i = S;
|
|
68
|
-
((e = (t = i == null ? void 0 : i[s]) == null ? void 0 : t.props) == null ? void 0 : e.disabled) ||
|
|
68
|
+
((e = (t = i == null ? void 0 : i[s]) == null ? void 0 : t.props) == null ? void 0 : e.disabled) || M(s);
|
|
69
69
|
},
|
|
70
|
-
[S,
|
|
71
|
-
),
|
|
72
|
-
|
|
70
|
+
[S, M]
|
|
71
|
+
), X = n.useCallback((s) => {
|
|
72
|
+
R.current && R.current.triggerKeyboardEvent(s);
|
|
73
73
|
}, []);
|
|
74
74
|
n.useEffect(() => {
|
|
75
75
|
var a;
|
|
76
|
-
const s =
|
|
77
|
-
return s && (
|
|
76
|
+
const s = T.current, i = s && getComputedStyle(s).direction === "rtl" || !1;
|
|
77
|
+
return s && (R.current = new ae({
|
|
78
78
|
tabIndex: 0,
|
|
79
|
-
root:
|
|
79
|
+
root: T,
|
|
80
80
|
rovingTabIndex: !0,
|
|
81
81
|
focusClass: "k-focus",
|
|
82
82
|
selectors: [".k-tabstrip .k-tabstrip-item"],
|
|
83
83
|
keyboardEvents: {
|
|
84
84
|
keydown: {
|
|
85
|
-
ArrowLeft: (t, e,
|
|
86
|
-
|
|
85
|
+
ArrowLeft: (t, e, r) => {
|
|
86
|
+
r.preventDefault();
|
|
87
87
|
const o = e.elements.indexOf(t), d = o !== 0 ? o - 1 : e.elements.length - 1, c = o !== e.elements.length - 1 ? o + 1 : 0;
|
|
88
|
-
i ? (e.focusNext(t),
|
|
88
|
+
i ? (e.focusNext(t), p(c)) : (e.focusPrevious(t), p(d));
|
|
89
89
|
},
|
|
90
|
-
ArrowRight: (t, e,
|
|
91
|
-
|
|
90
|
+
ArrowRight: (t, e, r) => {
|
|
91
|
+
r.preventDefault();
|
|
92
92
|
const o = e.elements.indexOf(t), d = o !== 0 ? o - 1 : e.elements.length - 1, c = o !== e.elements.length - 1 ? o + 1 : 0;
|
|
93
|
-
i ? (e.focusPrevious(t),
|
|
93
|
+
i ? (e.focusPrevious(t), p(d)) : (e.focusNext(t), p(c));
|
|
94
94
|
},
|
|
95
|
-
ArrowDown: (t, e,
|
|
96
|
-
|
|
95
|
+
ArrowDown: (t, e, r) => {
|
|
96
|
+
r.preventDefault();
|
|
97
97
|
const o = e.elements.indexOf(t), d = o !== e.elements.length - 1 ? o + 1 : 0;
|
|
98
|
-
e.focusNext(t),
|
|
98
|
+
e.focusNext(t), p(d);
|
|
99
99
|
},
|
|
100
|
-
ArrowUp: (t, e,
|
|
101
|
-
|
|
100
|
+
ArrowUp: (t, e, r) => {
|
|
101
|
+
r.preventDefault();
|
|
102
102
|
const o = e.elements.indexOf(t), d = o !== 0 ? o - 1 : e.elements.length - 1;
|
|
103
|
-
e.focusPrevious(t),
|
|
103
|
+
e.focusPrevious(t), p(d);
|
|
104
104
|
},
|
|
105
|
-
Home: (t, e,
|
|
106
|
-
|
|
105
|
+
Home: (t, e, r) => {
|
|
106
|
+
r.preventDefault(), e.focusElement(e.first, t), p(0);
|
|
107
107
|
},
|
|
108
|
-
End: (t, e,
|
|
109
|
-
|
|
108
|
+
End: (t, e, r) => {
|
|
109
|
+
r.preventDefault(), e.focusElement(e.last, t), p(e.elements.length - 1);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
}), (a =
|
|
113
|
+
}), (a = R.current) == null || a.initializeRovingTab(u), v(), I.current = window.ResizeObserver && new ResizeObserver(() => v()), T.current && I.current && I.current.observe(T.current)), () => {
|
|
114
114
|
var t;
|
|
115
|
-
(t =
|
|
115
|
+
(t = R.current) == null || t.removeFocusListener(), I.current && I.current.disconnect();
|
|
116
116
|
};
|
|
117
|
-
}, [u,
|
|
117
|
+
}, [u, p, v]);
|
|
118
118
|
const se = n.useMemo(() => {
|
|
119
119
|
const s = n.Children.count(S);
|
|
120
120
|
return u < s && u > -1 ? /* @__PURE__ */ n.createElement(
|
|
@@ -122,103 +122,104 @@ const de = {
|
|
|
122
122
|
{
|
|
123
123
|
index: u,
|
|
124
124
|
selected: u,
|
|
125
|
-
contentPanelId:
|
|
126
|
-
navItemId:
|
|
125
|
+
contentPanelId: w,
|
|
126
|
+
navItemId: y,
|
|
127
127
|
animation: H,
|
|
128
|
-
keepTabsMounted:
|
|
128
|
+
keepTabsMounted: j,
|
|
129
129
|
renderAllContent: P,
|
|
130
|
-
style:
|
|
130
|
+
style: z
|
|
131
131
|
},
|
|
132
132
|
S
|
|
133
133
|
) : null;
|
|
134
|
-
}, [u, S,
|
|
134
|
+
}, [u, S, w, y, H, j, P, z]), B = C === "hidden" || f === null && C === "auto" ? "hidden" : "visible", Y = n.useMemo(
|
|
135
135
|
() => ({
|
|
136
|
-
itemsNavRef:
|
|
136
|
+
itemsNavRef: A,
|
|
137
137
|
children: S,
|
|
138
138
|
selected: u,
|
|
139
139
|
tabIndex: L,
|
|
140
|
-
tabPosition:
|
|
141
|
-
tabAlignment:
|
|
142
|
-
size:
|
|
140
|
+
tabPosition: b,
|
|
141
|
+
tabAlignment: W,
|
|
142
|
+
size: k,
|
|
143
143
|
scrollable: g,
|
|
144
|
-
scrollButtons:
|
|
145
|
-
scrollButtonsPosition:
|
|
146
|
-
buttonScrollSpeed:
|
|
147
|
-
mouseScrollSpeed:
|
|
148
|
-
prevButton:
|
|
149
|
-
nextButton:
|
|
150
|
-
dir:
|
|
151
|
-
contentPanelId:
|
|
144
|
+
scrollButtons: B,
|
|
145
|
+
scrollButtonsPosition: F,
|
|
146
|
+
buttonScrollSpeed: U,
|
|
147
|
+
mouseScrollSpeed: $,
|
|
148
|
+
prevButton: q,
|
|
149
|
+
nextButton: G,
|
|
150
|
+
dir: x,
|
|
151
|
+
contentPanelId: w,
|
|
152
152
|
renderAllContent: P,
|
|
153
|
-
navItemId:
|
|
154
|
-
onKeyDown:
|
|
155
|
-
onSelect:
|
|
156
|
-
onScroll:
|
|
153
|
+
navItemId: y,
|
|
154
|
+
onKeyDown: X,
|
|
155
|
+
onSelect: M,
|
|
156
|
+
onScroll: v,
|
|
157
157
|
containerScrollPosition: f
|
|
158
158
|
}),
|
|
159
159
|
[
|
|
160
|
-
|
|
160
|
+
A,
|
|
161
161
|
S,
|
|
162
162
|
u,
|
|
163
163
|
L,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
b,
|
|
165
|
+
W,
|
|
166
|
+
k,
|
|
167
167
|
g,
|
|
168
|
-
|
|
169
|
-
j,
|
|
168
|
+
B,
|
|
170
169
|
F,
|
|
171
170
|
U,
|
|
172
171
|
$,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
q,
|
|
173
|
+
G,
|
|
174
|
+
x,
|
|
176
175
|
w,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
P,
|
|
177
|
+
y,
|
|
178
|
+
X,
|
|
179
|
+
M,
|
|
180
|
+
v,
|
|
180
181
|
f
|
|
181
182
|
]
|
|
182
|
-
),
|
|
183
|
-
() =>
|
|
183
|
+
), Z = b === "bottom", re = n.useMemo(
|
|
184
|
+
() => ue(
|
|
184
185
|
"k-tabstrip k-pos-relative",
|
|
185
186
|
{
|
|
186
|
-
[`k-tabstrip-${
|
|
187
|
-
"k-tabstrip-left":
|
|
188
|
-
"k-tabstrip-right":
|
|
189
|
-
"k-tabstrip-bottom":
|
|
190
|
-
"k-tabstrip-top":
|
|
187
|
+
[`k-tabstrip-${de.sizeMap[k || "medium"] || k}`]: k,
|
|
188
|
+
"k-tabstrip-left": b === "left",
|
|
189
|
+
"k-tabstrip-right": b === "right",
|
|
190
|
+
"k-tabstrip-bottom": b === "bottom",
|
|
191
|
+
"k-tabstrip-top": b === "top",
|
|
191
192
|
"k-tabstrip-scrollable": g,
|
|
192
|
-
"k-tabstrip-scrollable-start k-tabstrip-scrollable-end": g &&
|
|
193
|
-
"k-tabstrip-scrollable-start": g &&
|
|
194
|
-
"k-tabstrip-scrollable-end": g &&
|
|
193
|
+
"k-tabstrip-scrollable-start k-tabstrip-scrollable-end": g && B === "visible",
|
|
194
|
+
"k-tabstrip-scrollable-start": g && C === "auto" && (f === "end" || f === "middle"),
|
|
195
|
+
"k-tabstrip-scrollable-end": g && C === "auto" && (f === "start" || f === "middle")
|
|
195
196
|
},
|
|
196
|
-
|
|
197
|
+
K
|
|
197
198
|
),
|
|
198
|
-
[
|
|
199
|
+
[k, b, g, C, B, f, K]
|
|
199
200
|
);
|
|
200
|
-
return /* @__PURE__ */ n.createElement("div", { id: m, ref:
|
|
201
|
+
return /* @__PURE__ */ n.createElement("div", { id: m, ref: T, dir: x, className: re, style: ne, onScroll: v }, !Z && /* @__PURE__ */ n.createElement(ee, { ...Y }), se, Z && /* @__PURE__ */ n.createElement(ee, { ...Y }));
|
|
201
202
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
id:
|
|
205
|
-
animation:
|
|
206
|
-
children:
|
|
207
|
-
onSelect:
|
|
208
|
-
selected:
|
|
209
|
-
style:
|
|
210
|
-
tabContentStyle:
|
|
211
|
-
tabPosition:
|
|
212
|
-
tabAlignment:
|
|
213
|
-
tabIndex:
|
|
214
|
-
className:
|
|
215
|
-
dir:
|
|
216
|
-
renderAllContent:
|
|
217
|
-
size:
|
|
218
|
-
scrollButtons:
|
|
219
|
-
scrollButtonsPosition:
|
|
203
|
+
D.displayName = "TabStrip";
|
|
204
|
+
D.propTypes = {
|
|
205
|
+
id: l.string,
|
|
206
|
+
animation: l.bool,
|
|
207
|
+
children: l.node,
|
|
208
|
+
onSelect: l.func,
|
|
209
|
+
selected: l.number,
|
|
210
|
+
style: l.object,
|
|
211
|
+
tabContentStyle: l.object,
|
|
212
|
+
tabPosition: l.string,
|
|
213
|
+
tabAlignment: l.string,
|
|
214
|
+
tabIndex: l.number,
|
|
215
|
+
className: l.string,
|
|
216
|
+
dir: l.string,
|
|
217
|
+
renderAllContent: l.bool,
|
|
218
|
+
size: l.oneOf(["small", "medium", "large"]),
|
|
219
|
+
scrollButtons: l.oneOf(["auto", "visible", "hidden"]),
|
|
220
|
+
scrollButtonsPosition: l.oneOf(["split", "start", "end", "around", "before", "after"])
|
|
220
221
|
};
|
|
221
|
-
const
|
|
222
|
+
const Se = D;
|
|
222
223
|
export {
|
|
223
|
-
|
|
224
|
+
Se as TabStrip
|
|
224
225
|
};
|
|
@@ -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 ft=require("react"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ft=require("react"),l=require("prop-types"),ut=require("./TabStripNavigationItem.js"),M=require("@progress/kendo-react-common"),bt=require("@progress/kendo-react-buttons"),I=require("@progress/kendo-svg-icons"),dt=require("@progress/kendo-react-intl"),S=require("./messages/index.js");function mt(b){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(b){for(const r in b)if(r!=="default"){const T=Object.getOwnPropertyDescriptor(b,r);Object.defineProperty(d,r,T.get?T:{enumerable:!0,get:()=>b[r]})}}return d.default=b,Object.freeze(d)}const n=mt(ft),vt=b=>Array.from({length:b}),C="smooth",v="prev",k="next",x=b=>{const{selected:d,tabPosition:r,tabAlignment:T,children:w,onSelect:y,onKeyDown:q,onScroll:P,navItemId:E,contentPanelId:F,renderAllContent:D,scrollable:H,scrollButtons:z,scrollButtonsPosition:m,tabIndex:_,buttonScrollSpeed:j,mouseScrollSpeed:W,prevButton:$,nextButton:K,dir:U,size:V,containerScrollPosition:h,itemsNavRef:ot}=b,nt=n.useRef(null),N=ot||nt,A=dt.useLocalization(),p=n.useCallback(()=>/top|bottom/.test(r||"top"),[r]),g=n.useCallback(()=>U==="rtl",[U]),X=n.useCallback(()=>{const t=N.current,e=t==null?void 0:t.children[d||0];if(e instanceof HTMLElement&&t instanceof HTMLElement){const s=p(),u=s?t.offsetWidth:t.offsetHeight,c=s?e.offsetWidth:e.offsetHeight,i=s?"left":"top";let o=s?t.scrollLeft:t.scrollTop,a=0;if(g()){const f=e.offsetLeft;o=o*-1,f<0?(a=f-c+t.offsetLeft,t.scrollTo({[i]:a,behavior:C})):f+c>u-o&&(a=o+f-c,t.scrollTo({[i]:a,behavior:C}))}else{const f=s?e.offsetLeft-t.offsetLeft:e.offsetTop-t.offsetTop;o+u<f+c?(a=f+c-u,t.scrollTo({[i]:a,behavior:C})):o>f&&(a=f,t.scrollTo({[i]:a,behavior:C}))}}},[N,d,p,g]);n.useEffect(()=>{H&&X()},[H,d,X]);const B=n.useCallback(()=>{P==null||P()},[P]),G=n.useCallback((t,e)=>{const s=N.current;if(!s)return;const u=p(),c=u?s.scrollWidth-s.offsetWidth:s.scrollHeight-s.offsetHeight,i=(e.type==="click"?j:W)||0;let o=u?s.scrollLeft:s.scrollTop;g()&&p()?(t===v&&o<0&&(o+=i),t===k&&o<c&&(o-=i),o=Math.min(0,Math.min(c,o))):(t===v&&o>0&&(o-=i),t===k&&o<c&&(o+=i),o=Math.max(0,Math.min(c,o)));const a=e.type==="click"?C:void 0;u?s.scrollTo({left:o,behavior:a}):s.scrollTo({top:o,behavior:a})},[N,p,g,j,W]),O=n.useCallback((t,e)=>{G(t,e)},[G]),J=n.useCallback(t=>{O(v,t)},[O]),Q=n.useCallback(t=>{O(k,t)},[O]),L=n.useCallback(t=>{const e=p(),s=g(),c=e?s?"chevron-right":"chevron-left":"chevron-up",i=s?I.chevronRightIcon:I.chevronLeftIcon,o=e?i:I.chevronUpIcon,f=e?s?"chevron-left":"chevron-right":"chevron-down",rt=s?I.chevronLeftIcon:I.chevronRightIcon,lt=e?rt:I.chevronDownIcon,R={prev:{arrowTab:"k-tabstrip-prev",fontIcon:c,svgIcon:o,title:A.toLanguageString(S.prevArrowTitle,S.messages[S.prevArrowTitle])},next:{arrowTab:"k-tabstrip-next",fontIcon:f,svgIcon:lt,title:A.toLanguageString(S.nextArrowTitle,S.messages[S.nextArrowTitle])}},ct=(t===v?$:K)||bt.Button,at=t===v?J:Q,it=h===null||t===v&&(h==="start"||h==="top")||t===k&&(h==="end"||h==="bottom");return n.createElement(ct,{disabled:it,className:M.classNames(`${R[t].arrowTab}`),onClick:at,icon:R[t].fontIcon,svgIcon:R[t].svgIcon,size:V,tabIndex:-1,fillMode:"flat",title:R[t].title})},[p,g,$,K,J,Q,h,V,A]),Y=n.Children.count(w),Z=n.Children.toArray(w),tt=n.useMemo(()=>w?vt(Y).map((t,e,s)=>{const u={active:d===e,disabled:Z[e].props.disabled,index:e,title:Z[e].props.title,first:e===0,last:e===s.length-1,contentPanelId:F,renderAllContent:D,id:E,onSelect:y,onScroll:B};return n.createElement(ut.TabStripNavigationItem,{key:`${E}-${e}`,...u})}):null,[w,Y,d,F,D,E,y,B]),st=n.useMemo(()=>M.classNames("k-tabstrip-items-wrapper k-tabstrip-items-wrapper-scroll",{"k-hstack":r==="top"||r==="bottom","k-vstack":r==="left"||r==="right"}),[r]),et=n.useMemo(()=>M.classNames("k-tabstrip-items k-tabstrip-items-scroll k-reset",`k-tabstrip-items-${T}`),[T]);return n.createElement("div",{className:st},H?n.createElement(n.Fragment,null,z!=="hidden"&&m&&["split","start","around","before"].includes(m)&&L(v),z!=="hidden"&&(m==="start"||m==="before")&&L(k),n.createElement("ul",{ref:N,className:et,role:"tablist",tabIndex:_,onKeyDown:q,onScroll:B,"aria-orientation":r==="left"||r==="right"?"vertical":void 0},tt),z!=="hidden"&&(m==="end"||m==="after")&&L(v),z!=="hidden"&&m&&["split","end","around","after"].includes(m)&&L(k)):n.createElement("ul",{className:et,role:"tablist",tabIndex:_,onKeyDown:q},tt))};x.propTypes={children:l.oneOfType([l.element,l.arrayOf(l.element)]),onSelect:l.func,onKeyDown:l.func,onScroll:l.func,selected:l.number,tabIndex:l.number,scrollable:l.bool,size:l.oneOf(["small","medium","large"]),scrollButtons:l.oneOf(["auto","visible","hidden"]),scrollButtonsPosition:l.oneOf(["split","start","end","around","before","after"]),containerScrollPosition:l.oneOf(["start","end","top","bottom","middle",null])};x.displayName="TabStripNavigation";exports.TabStripNavigation=x;
|