@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
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),a=require("prop-types"),k=require("@progress/kendo-react-common"),Q=require("./ResizeHandlers.js");function Z(t){const R=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const v in t)if(v!=="default"){const c=Object.getOwnPropertyDescriptor(t,v);Object.defineProperty(R,v,c.get?c:{enumerable:!0,get:()=>t[v]})}}return R.default=t,Object.freeze(R)}const n=Z(J),j=200,O={resizable:!0,reorderable:!0},D=t=>{var q,X,Y;const R=(q=t.reorderable)!=null?q:O.reorderable,v=(X=t.resizable)!=null?X:O.resizable,c=n.useRef(null),s=n.useRef(null),w=n.useRef(null),z=n.useRef(!1),T=n.useRef(!1),N=n.useRef(!1),$=n.useRef({x:0,y:0}),P=n.useRef({x:0,y:0}),u=n.useRef({x:0,y:0}),S=n.useRef(void 0),x=n.useRef(t),[b,p]=n.useState(!1),[H,M]=n.useState(!1),d=n.useCallback(()=>w.current?w.current.element:void 0,[]),E=n.useCallback(()=>{if(c.current&&s.current){const e=c.current.getBoundingClientRect();s.current.style.top=e.top+"px",s.current.style.left=e.left+"px",s.current.style.height=c.current.offsetHeight+"px",s.current.style.width=c.current.offsetWidth+"px"}},[]),F=n.useCallback(()=>{E()},[E]),A=n.useCallback(()=>{setTimeout(()=>{E()},100)},[E]),U=n.useCallback(()=>{const e=d();if(!e||!s.current)return;const r=e.getBoundingClientRect(),i=r.top+u.current.y,o=r.left+u.current.x;s.current.style.top=`${i}px`,s.current.style.left=`${o}px`,s.current.style.display="block"},[d]),L=n.useCallback(()=>{z.current=T.current=!1,u.current={x:0,y:0},c.current&&s.current&&(c.current.style.zIndex="1",s.current.classList.remove("k-layout-item-hint-resize"),M(!1));const e=d();e&&(e.style.transform="translate(0px, 0px)",e.style.transition=`transform ${j}ms cubic-bezier(0.2, 0, 0, 1) 0s`,e.style.marginRight="0px",e.style.marginLeft="0px",e.style.height="100%",e.classList.remove("k-cursor-grabbing"),R&&e.classList.add("k-cursor-move")),t.onRelease()},[t,R,d]),W=n.useCallback((e,r)=>{if(r.end){L();return}if(!c.current||!s.current)return;const i=e.clientX,o=e.clientY;T.current=!0;const f=(r.direction!=="ns"?i-P.current.x:0)*(b?-1:1),l=r.direction!=="ew"?o-P.current.y:0,h=d();if(h&&(b?h.style.marginLeft=-f+"px":h.style.marginRight=-f+"px",h.style.height=`calc(100% + ${l}px)`),s.current.classList.add("k-layout-item-hint-resize"),S.current)return;let g=0,y=0;const C=c.current.getBoundingClientRect();f>C.width/t.defaultPosition.colSpan/3&&(g=1),f<-C.width/t.defaultPosition.colSpan/1.25&&(g=-1),l>C.height/t.defaultPosition.rowSpan/3&&(y=1),l<-C.height/t.defaultPosition.rowSpan/1.25&&(y=-1),(g!==0||y!==0)&&t.update(t.index,0,0,y,g)},[b,t,L,d]),I=n.useCallback(e=>{var o;const r=d();if(!r)return;if(P.current={x:e.event.clientX,y:e.event.clientY},N.current=!1,(o=t.ignoreDrag)!=null&&o.call(t,e.event.originalEvent)){N.current=!0;return}c.current&&(c.current.style.zIndex="10",M(!0)),r.classList.remove("k-cursor-move"),r.classList.add("k-cursor-grabbing");const i=r.getBoundingClientRect();$.current={x:e.event.clientX-i.x,y:e.event.clientY-i.y},t.onPress()},[t,d]),_=n.useCallback(e=>{var h;if(N.current)return;const r=d();if(e.event.originalEvent.defaultPrevented||!r)return;z.current=!0,e.event.originalEvent.preventDefault();const i=r.getBoundingClientRect();if(u.current={x:e.event.clientX-i.x-$.current.x+u.current.x,y:e.event.clientY-i.y-$.current.y+u.current.y},r.style.transform=`translate(${u.current.x}px, ${u.current.y}px)`,r.style.transition="transform 0s",S.current)return;let o=0,f=0;u.current.y>.7*i.height/t.defaultPosition.rowSpan&&(f=1),u.current.y<.7*-i.height/t.defaultPosition.rowSpan&&(f=-1),u.current.x>.7*i.width/t.defaultPosition.colSpan&&(o=1),u.current.x<.7*-i.width/t.defaultPosition.colSpan&&(o=-1),t.update(t.index,f,b?-o:o,0,0);const l=(h=c.current)==null?void 0:h.closest(".k-tilelayout");if(l&&s.current){const g=l.getBoundingClientRect(),y=k.getScrollbarWidth()||50;e.event.clientX<g.left-y||e.event.clientX>g.right-y||e.event.clientY<g.top||e.event.clientY>g.bottom?s.current.style.display="none":s.current.style.display="block"}},[t,b,d]);n.useEffect(()=>{c.current&&(getComputedStyle(c.current).direction==="rtl"&&p(!0),s.current&&(s.current.style.height=c.current.offsetHeight+"px",s.current.style.width=c.current.offsetWidth+"px"))},[]);const B=n.useRef(null);(Y=w.current)!=null&&Y.element&&(B.current=w.current.element.getBoundingClientRect()),n.useLayoutEffect(()=>{const e=d();if(!e)return;const r=e.getBoundingClientRect(),i=B.current;if(!(i!=null&&i.width)){x.current=t;return}if(T.current){const l=r.width-i.width;if(b){const y=parseFloat(e.style.marginLeft||"0");e.style.marginLeft=y-l+"px"}else{const y=parseFloat(e.style.marginRight||"0");e.style.marginRight=y+l+"px"}P.current.x+=b?-l:l;const h=r.height-i.height,g=parseFloat(e.style.height.substring(12));e.style.height=`calc(100% + ${g+h}px)`,P.current.y+=h}const o=i.left-r.left,f=i.top-r.top;if(o===0&&f===0){x.current=t;return}if(z.current){(x.current.defaultPosition.order!==t.defaultPosition.order||x.current.defaultPosition.col!==t.defaultPosition.col)&&(u.current.x=0,u.current.y=0,e.style.transform="",U()),x.current=t;return}if(Math.abs(f)<15&&Math.abs(o)<15){x.current=t;return}requestAnimationFrame(()=>{const l=c.current;l&&(l.style.transform=`translate(${o}px, ${f}px)`,l.style.transition="transform 0s",requestAnimationFrame(()=>{l.style.transform="",l.style.transition=`transform ${j}ms cubic-bezier(0.2, 0, 0, 1) 0s`}))}),x.current=t}),k.canUseDOM&&clearTimeout&&typeof clearTimeout=="function"&&(clearTimeout(S.current),S.current=window.setTimeout(()=>{S.current=void 0},200));const m=t.defaultPosition,K={gridColumnStart:m.col,gridColumnEnd:`span ${m.colSpan}`,gridRowStart:m.row,gridRowEnd:`span ${m.rowSpan}`,outline:"none",order:m.order,display:"block",...t.hintStyle},V={gridColumnStart:m.col,gridColumnEnd:`span ${m.colSpan}`,gridRowStart:m.row,gridRowEnd:`span ${m.rowSpan}`,order:m.order},G=n.createElement("div",{role:"listitem",tabIndex:0,"aria-labelledby":typeof t.header=="string"?t.header:`tile-${t.index}`,"aria-keyshortcuts":"Enter","aria-dropeffect":"execute","aria-grabbed":!1,className:k.classNames("k-tilelayout-item k-card",t.className),style:{height:"100%",...V,...t.style},onMouseDown:F,onMouseUp:A},t.children,n.createElement(Q.ResizeHandlers,{onPress:I,onResize:W,resizable:v,rtl:b}));return n.createElement(n.Fragment,null,H&&n.createElement("div",{ref:e=>{s.current=e},style:{position:"fixed",...K},className:k.classNames("k-layout-item-hint",t.hintClassName)}),n.createElement(k.Draggable,{ref:e=>{w.current=e,c.current=e?e.element:null},onDrag:R?_:void 0,onRelease:R?L:void 0,onPress:R?I:void 0},G))};D.propTypes={update:a.func.isRequired,index:a.number.isRequired,defaultPosition:a.object.isRequired,ignoreDrag:a.func,onPress:a.func.isRequired,onRelease:a.func.isRequired,children:a.node,style:a.object,className:a.string,hintStyle:a.object,hintClassName:a.string,header:a.any,body:a.any,item:a.any,resizable:a.oneOf(["horizontal","vertical",!0,!1]),reorderable:a.bool};D.displayName="KendoTileLayoutItem";D.defaultProps=O;exports.InternalTile=D;
|