@progress/kendo-react-layout 13.4.0-develop.5 → 14.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/dist/cdn/js/kendo-react-layout.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/tabstrip/TabStrip.d.ts +13 -79
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +179 -132
- package/tabstrip/TabStripContent.d.ts +1 -21
- package/tabstrip/TabStripContent.js +1 -1
- package/tabstrip/TabStripContent.mjs +75 -83
- package/tabstrip/TabStripNavigation.d.ts +1 -41
- package/tabstrip/TabStripNavigation.js +1 -1
- package/tabstrip/TabStripNavigation.mjs +159 -146
- package/tabstrip/TabStripNavigationItem.d.ts +5 -27
- package/tabstrip/TabStripNavigationItem.js +1 -1
- package/tabstrip/TabStripNavigationItem.mjs +56 -46
- package/tabstrip/TabStripTab.d.ts +1 -16
- package/tabstrip/TabStripTab.js +1 -1
- package/tabstrip/TabStripTab.mjs +3 -11
package/package-metadata.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 e=Object.freeze({name:"@progress/kendo-react-layout",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-layout",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1770382818,version:"14.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -8,6 +8,6 @@ export const packageMetadata = Object.freeze({
|
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
10
|
publishDate: 0,
|
|
11
|
-
version: '
|
|
11
|
+
version: '14.0.0-develop.1',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-layout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-develop.1",
|
|
4
4
|
"description": "React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.7.2",
|
|
29
|
-
"@progress/kendo-react-animation": "
|
|
30
|
-
"@progress/kendo-react-buttons": "
|
|
31
|
-
"@progress/kendo-react-common": "
|
|
32
|
-
"@progress/kendo-react-intl": "
|
|
33
|
-
"@progress/kendo-react-popup": "
|
|
34
|
-
"@progress/kendo-react-progressbars": "
|
|
29
|
+
"@progress/kendo-react-animation": "14.0.0-develop.1",
|
|
30
|
+
"@progress/kendo-react-buttons": "14.0.0-develop.1",
|
|
31
|
+
"@progress/kendo-react-common": "14.0.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-intl": "14.0.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-popup": "14.0.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-progressbars": "14.0.0-develop.1",
|
|
35
35
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
36
36
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
37
37
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"package": {
|
|
77
77
|
"productName": "KendoReact",
|
|
78
78
|
"productCode": "KENDOUIREACT",
|
|
79
|
-
"publishDate":
|
|
79
|
+
"publishDate": 1770382818,
|
|
80
80
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
81
81
|
}
|
|
82
82
|
},
|
package/tabstrip/TabStrip.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as PropTypes } from 'prop-types';
|
|
9
8
|
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
10
9
|
import { ButtonProps } from '@progress/kendo-react-buttons';
|
|
11
10
|
import * as React from 'react';
|
|
@@ -37,6 +36,12 @@ export interface TabStripScrollableProps {
|
|
|
37
36
|
* @default 100
|
|
38
37
|
*/
|
|
39
38
|
buttonScrollSpeed?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the tab list scroll speed in pixels when scrolling via mouse wheel.
|
|
41
|
+
*
|
|
42
|
+
* @default 10
|
|
43
|
+
*/
|
|
44
|
+
mouseScrollSpeed?: number;
|
|
40
45
|
/**
|
|
41
46
|
* Sets the visibility of the scroll buttons.
|
|
42
47
|
*
|
|
@@ -166,6 +171,8 @@ export interface TabStripProps extends KendoReactComponentBaseProps, TabStripScr
|
|
|
166
171
|
/**
|
|
167
172
|
* Specifies the possible sizes of the TabStrip.
|
|
168
173
|
*
|
|
174
|
+
* @default undefined (theme-controlled)
|
|
175
|
+
*
|
|
169
176
|
* @example
|
|
170
177
|
* ```jsx
|
|
171
178
|
* <TabStrip size="small" />
|
|
@@ -212,86 +219,13 @@ export type StateScrollPosition = 'start' | 'end' | 'top' | 'bottom' | 'middle'
|
|
|
212
219
|
export interface TabStripStateProps {
|
|
213
220
|
containerScrollPosition: StateScrollPosition;
|
|
214
221
|
}
|
|
222
|
+
export declare const TabStrip: React.ForwardRefExoticComponent<TabStripProps & React.RefAttributes<TabStripHandle | null>>;
|
|
215
223
|
/**
|
|
216
|
-
* Represents the TabStrip component.
|
|
217
|
-
*
|
|
218
|
-
* @remarks
|
|
219
|
-
* Supported children components are: {@link TabStripTab}.
|
|
224
|
+
* Represents the `ref` of the TabStrip component.
|
|
220
225
|
*/
|
|
221
|
-
export
|
|
222
|
-
/**
|
|
223
|
-
* @hidden
|
|
224
|
-
*/
|
|
225
|
-
static propTypes: {
|
|
226
|
-
id: PropTypes.Requireable<string>;
|
|
227
|
-
animation: PropTypes.Requireable<boolean>;
|
|
228
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
229
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
230
|
-
selected: PropTypes.Requireable<number>;
|
|
231
|
-
style: PropTypes.Requireable<object>;
|
|
232
|
-
tabContentStyle: PropTypes.Requireable<object>;
|
|
233
|
-
tabPosition: PropTypes.Requireable<string>;
|
|
234
|
-
tabAlignment: PropTypes.Requireable<string>;
|
|
235
|
-
tabIndex: PropTypes.Requireable<number>;
|
|
236
|
-
className: PropTypes.Requireable<string>;
|
|
237
|
-
dir: PropTypes.Requireable<string>;
|
|
238
|
-
renderAllContent: PropTypes.Requireable<boolean>;
|
|
239
|
-
size: PropTypes.Requireable<string | null>;
|
|
240
|
-
scrollButtons: PropTypes.Requireable<string>;
|
|
241
|
-
scrollButtonsPosition: PropTypes.Requireable<string>;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* @hidden
|
|
245
|
-
*/
|
|
246
|
-
static defaultProps: {
|
|
247
|
-
animation: boolean;
|
|
248
|
-
tabPosition: string;
|
|
249
|
-
tabAlignment: string;
|
|
250
|
-
keepTabsMounted: boolean;
|
|
251
|
-
buttonScrollSpeed: number;
|
|
252
|
-
mouseScrollSpeed: number;
|
|
253
|
-
scrollButtons: string;
|
|
254
|
-
scrollButtonsPosition: string;
|
|
255
|
-
size: undefined;
|
|
256
|
-
renderAllContent: boolean;
|
|
257
|
-
};
|
|
258
|
-
private tabStripRef;
|
|
259
|
-
private itemsNavRef;
|
|
260
|
-
private resizeObserver?;
|
|
261
|
-
private get contentPanelId();
|
|
262
|
-
private get navItemId();
|
|
263
|
-
private navigation?;
|
|
264
|
-
constructor(props: TabStripProps);
|
|
265
|
-
/** @hidden */
|
|
266
|
-
componentDidMount(): void;
|
|
267
|
-
/** @hidden */
|
|
268
|
-
componentWillUnmount(): void;
|
|
269
|
-
private horizontalScroll;
|
|
270
|
-
/**
|
|
271
|
-
* @hidden
|
|
272
|
-
*/
|
|
273
|
-
private onScroll;
|
|
226
|
+
export interface TabStripHandle {
|
|
274
227
|
/**
|
|
275
|
-
*
|
|
276
|
-
*/
|
|
277
|
-
onSelect: (index: any) => void;
|
|
278
|
-
/**
|
|
279
|
-
* @hidden
|
|
280
|
-
*/
|
|
281
|
-
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
282
|
-
/**
|
|
283
|
-
* @hidden
|
|
228
|
+
* The props of the TabStrip component.
|
|
284
229
|
*/
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* @hidden
|
|
288
|
-
*/
|
|
289
|
-
render(): React.JSX.Element;
|
|
290
|
-
private renderContent;
|
|
291
|
-
private children;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Represent the `ref` of the TabStrip component.
|
|
295
|
-
*/
|
|
296
|
-
export interface TabStripHandle extends Pick<TabStrip, keyof TabStrip> {
|
|
230
|
+
props: TabStripProps;
|
|
297
231
|
}
|
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
|
|
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;
|
package/tabstrip/TabStrip.mjs
CHANGED
|
@@ -5,144 +5,202 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as n from "react";
|
|
9
9
|
import r from "prop-types";
|
|
10
|
-
import { TabStripNavigation as
|
|
11
|
-
import { TabStripContent as
|
|
12
|
-
import { Navigation as
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
import { TabStripNavigation as Y } from "./TabStripNavigation.mjs";
|
|
11
|
+
import { TabStripContent as ie } from "./TabStripContent.mjs";
|
|
12
|
+
import { Navigation as ce, classNames as ae, kendoThemeMaps as ue } from "@progress/kendo-react-common";
|
|
13
|
+
const de = {
|
|
14
|
+
animation: !0,
|
|
15
|
+
tabPosition: "top",
|
|
16
|
+
tabAlignment: "start",
|
|
17
|
+
keepTabsMounted: !1,
|
|
18
|
+
buttonScrollSpeed: 100,
|
|
19
|
+
mouseScrollSpeed: 10,
|
|
20
|
+
scrollButtons: "auto",
|
|
21
|
+
scrollButtonsPosition: "split",
|
|
22
|
+
renderAllContent: !1
|
|
23
|
+
}, E = n.forwardRef((Z, _) => {
|
|
24
|
+
const R = { ...de, ...Z }, {
|
|
25
|
+
id: m,
|
|
26
|
+
animation: H,
|
|
27
|
+
children: M,
|
|
28
|
+
selected: u,
|
|
29
|
+
onSelect: A,
|
|
30
|
+
style: ee,
|
|
31
|
+
tabContentStyle: O,
|
|
32
|
+
tabPosition: p,
|
|
33
|
+
tabAlignment: z,
|
|
34
|
+
tabIndex: L,
|
|
35
|
+
className: W,
|
|
36
|
+
dir: v,
|
|
37
|
+
renderAllContent: P,
|
|
38
|
+
keepTabsMounted: K,
|
|
39
|
+
size: h,
|
|
40
|
+
scrollable: g,
|
|
41
|
+
scrollButtons: x,
|
|
42
|
+
scrollButtonsPosition: j,
|
|
43
|
+
buttonScrollSpeed: F,
|
|
44
|
+
mouseScrollSpeed: te,
|
|
45
|
+
prevButton: U,
|
|
46
|
+
nextButton: $
|
|
47
|
+
} = R, [f, ne] = n.useState(null), oe = n.useRef({ props: R }), C = n.useRef(null), D = n.useRef(null), T = n.useRef(void 0), I = n.useRef(void 0), q = n.useCallback(() => ({ props: R }), [R]);
|
|
48
|
+
n.useImperativeHandle(oe, q), n.useImperativeHandle(_, q);
|
|
49
|
+
const y = n.useMemo(() => m ? m + "-content-panel-id" : void 0, [m]), w = n.useMemo(() => m ? m + "-nav-item-id" : void 0, [m]), S = n.useMemo(() => n.Children.toArray(M).filter(Boolean), [M]), G = n.useCallback(() => /top|bottom/.test(p || "top"), [p]), k = n.useCallback(() => {
|
|
50
|
+
const s = G(), i = D.current;
|
|
51
|
+
if (!i)
|
|
52
|
+
return;
|
|
53
|
+
const a = i.scrollLeft, t = i.clientWidth, e = i.scrollWidth, l = i.scrollTop, o = i.scrollHeight, d = i.clientHeight;
|
|
54
|
+
let c = null;
|
|
55
|
+
const re = s ? e > t : o > d, X = v === "rtl";
|
|
56
|
+
re ? s ? a + t === e || (X && t - a) === e ? c = "end" : a === 0 || X && -a === 0 ? c = "start" : a > 0 && a + t < e || -a > 0 && t - a < e ? c = "middle" : c = null : o - (l + d) === 0 ? c = "bottom" : l === 0 ? c = "top" : l > 0 && o - (l + d) > 0 ? c = "middle" : c = null : c = null, ne(c);
|
|
57
|
+
}, [G, v]), B = n.useCallback(
|
|
58
|
+
(s) => {
|
|
59
|
+
u !== s && A && A({
|
|
60
|
+
selected: s
|
|
26
61
|
});
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return this.props.id + "-nav-item-id";
|
|
44
|
-
}
|
|
45
|
-
/** @hidden */
|
|
46
|
-
componentDidMount() {
|
|
47
|
-
var o;
|
|
48
|
-
const l = this.tabStripRef.current, i = l && getComputedStyle(l).direction === "rtl" || !1;
|
|
49
|
-
l && (this.navigation = new g({
|
|
62
|
+
},
|
|
63
|
+
[u, A]
|
|
64
|
+
), b = n.useCallback(
|
|
65
|
+
(s) => {
|
|
66
|
+
var t, e;
|
|
67
|
+
const i = S;
|
|
68
|
+
((e = (t = i == null ? void 0 : i[s]) == null ? void 0 : t.props) == null ? void 0 : e.disabled) || B(s);
|
|
69
|
+
},
|
|
70
|
+
[S, B]
|
|
71
|
+
), J = n.useCallback((s) => {
|
|
72
|
+
I.current && I.current.triggerKeyboardEvent(s);
|
|
73
|
+
}, []);
|
|
74
|
+
n.useEffect(() => {
|
|
75
|
+
var a;
|
|
76
|
+
const s = C.current, i = s && getComputedStyle(s).direction === "rtl" || !1;
|
|
77
|
+
return s && (I.current = new ce({
|
|
50
78
|
tabIndex: 0,
|
|
51
|
-
root:
|
|
79
|
+
root: C,
|
|
52
80
|
rovingTabIndex: !0,
|
|
53
81
|
focusClass: "k-focus",
|
|
54
82
|
selectors: [".k-tabstrip .k-tabstrip-item"],
|
|
55
83
|
keyboardEvents: {
|
|
56
84
|
keydown: {
|
|
57
|
-
ArrowLeft: (
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
i ? (
|
|
85
|
+
ArrowLeft: (t, e, l) => {
|
|
86
|
+
l.preventDefault();
|
|
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), b(c)) : (e.focusPrevious(t), b(d));
|
|
61
89
|
},
|
|
62
|
-
ArrowRight: (
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
i ? (
|
|
90
|
+
ArrowRight: (t, e, l) => {
|
|
91
|
+
l.preventDefault();
|
|
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), b(d)) : (e.focusNext(t), b(c));
|
|
66
94
|
},
|
|
67
|
-
ArrowDown: (
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
95
|
+
ArrowDown: (t, e, l) => {
|
|
96
|
+
l.preventDefault();
|
|
97
|
+
const o = e.elements.indexOf(t), d = o !== e.elements.length - 1 ? o + 1 : 0;
|
|
98
|
+
e.focusNext(t), b(d);
|
|
71
99
|
},
|
|
72
|
-
ArrowUp: (
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
100
|
+
ArrowUp: (t, e, l) => {
|
|
101
|
+
l.preventDefault();
|
|
102
|
+
const o = e.elements.indexOf(t), d = o !== 0 ? o - 1 : e.elements.length - 1;
|
|
103
|
+
e.focusPrevious(t), b(d);
|
|
76
104
|
},
|
|
77
|
-
Home: (
|
|
78
|
-
|
|
105
|
+
Home: (t, e, l) => {
|
|
106
|
+
l.preventDefault(), e.focusElement(e.first, t), b(0);
|
|
79
107
|
},
|
|
80
|
-
End: (
|
|
81
|
-
|
|
108
|
+
End: (t, e, l) => {
|
|
109
|
+
l.preventDefault(), e.focusElement(e.last, t), b(e.elements.length - 1);
|
|
82
110
|
}
|
|
83
111
|
}
|
|
84
112
|
}
|
|
85
|
-
}), (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* @hidden
|
|
97
|
-
*/
|
|
98
|
-
render() {
|
|
99
|
-
const l = {
|
|
100
|
-
itemsNavRef: this.itemsNavRef,
|
|
101
|
-
...this.props,
|
|
102
|
-
children: this.children(),
|
|
103
|
-
contentPanelId: this.contentPanelId,
|
|
104
|
-
renderAllContent: this.props.renderAllContent,
|
|
105
|
-
navItemId: this.navItemId,
|
|
106
|
-
onKeyDown: this.onKeyDown,
|
|
107
|
-
onSelect: this.onSelect,
|
|
108
|
-
onScroll: this.onScroll,
|
|
109
|
-
containerScrollPosition: this.state.containerScrollPosition,
|
|
110
|
-
scrollButtons: this.props.scrollButtons === "hidden" || this.state.containerScrollPosition === null && this.props.scrollButtons === "auto" ? "hidden" : "visible"
|
|
111
|
-
}, { scrollable: i, scrollButtons: o, size: e, tabPosition: t, tabIndex: n } = l, s = t === "bottom", c = v(
|
|
112
|
-
"k-tabstrip k-pos-relative",
|
|
113
|
+
}), (a = I.current) == null || a.initializeRovingTab(u), k(), T.current = window.ResizeObserver && new ResizeObserver(() => k()), C.current && T.current && T.current.observe(C.current)), () => {
|
|
114
|
+
var t;
|
|
115
|
+
(t = I.current) == null || t.removeFocusListener(), T.current && T.current.disconnect();
|
|
116
|
+
};
|
|
117
|
+
}, [u, b, k]);
|
|
118
|
+
const se = n.useMemo(() => {
|
|
119
|
+
const s = n.Children.count(S);
|
|
120
|
+
return u < s && u > -1 ? /* @__PURE__ */ n.createElement(
|
|
121
|
+
ie,
|
|
113
122
|
{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"k-tabstrip-scrollable-end": i && o === "auto" && (this.state.containerScrollPosition === "start" || this.state.containerScrollPosition === "middle")
|
|
123
|
+
index: u,
|
|
124
|
+
selected: u,
|
|
125
|
+
contentPanelId: y,
|
|
126
|
+
navItemId: w,
|
|
127
|
+
animation: H,
|
|
128
|
+
keepTabsMounted: K,
|
|
129
|
+
renderAllContent: P,
|
|
130
|
+
style: O
|
|
123
131
|
},
|
|
124
|
-
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
S
|
|
133
|
+
) : null;
|
|
134
|
+
}, [u, S, y, w, H, K, P, O]), N = x === "hidden" || f === null && x === "auto" ? "hidden" : "visible", Q = n.useMemo(
|
|
135
|
+
() => ({
|
|
136
|
+
itemsNavRef: D,
|
|
137
|
+
children: S,
|
|
138
|
+
selected: u,
|
|
139
|
+
tabIndex: L,
|
|
140
|
+
tabPosition: p,
|
|
141
|
+
tabAlignment: z,
|
|
142
|
+
size: h,
|
|
143
|
+
scrollable: g,
|
|
144
|
+
scrollButtons: N,
|
|
145
|
+
scrollButtonsPosition: j,
|
|
146
|
+
buttonScrollSpeed: F,
|
|
147
|
+
mouseScrollSpeed: te,
|
|
148
|
+
prevButton: U,
|
|
149
|
+
nextButton: $,
|
|
150
|
+
dir: v,
|
|
151
|
+
contentPanelId: y,
|
|
152
|
+
renderAllContent: P,
|
|
153
|
+
navItemId: w,
|
|
154
|
+
onKeyDown: J,
|
|
155
|
+
onSelect: B,
|
|
156
|
+
onScroll: k,
|
|
157
|
+
containerScrollPosition: f
|
|
158
|
+
}),
|
|
159
|
+
[
|
|
160
|
+
D,
|
|
161
|
+
S,
|
|
162
|
+
u,
|
|
163
|
+
L,
|
|
164
|
+
p,
|
|
165
|
+
z,
|
|
166
|
+
h,
|
|
167
|
+
g,
|
|
168
|
+
N,
|
|
169
|
+
j,
|
|
170
|
+
F,
|
|
171
|
+
U,
|
|
172
|
+
$,
|
|
173
|
+
v,
|
|
174
|
+
y,
|
|
175
|
+
P,
|
|
176
|
+
w,
|
|
177
|
+
J,
|
|
178
|
+
B,
|
|
179
|
+
k,
|
|
180
|
+
f
|
|
181
|
+
]
|
|
182
|
+
), V = p === "bottom", le = n.useMemo(
|
|
183
|
+
() => ae(
|
|
184
|
+
"k-tabstrip k-pos-relative",
|
|
128
185
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
186
|
+
[`k-tabstrip-${ue.sizeMap[h || "medium"] || h}`]: h,
|
|
187
|
+
"k-tabstrip-left": p === "left",
|
|
188
|
+
"k-tabstrip-right": p === "right",
|
|
189
|
+
"k-tabstrip-bottom": p === "bottom",
|
|
190
|
+
"k-tabstrip-top": p === "top",
|
|
191
|
+
"k-tabstrip-scrollable": g,
|
|
192
|
+
"k-tabstrip-scrollable-start k-tabstrip-scrollable-end": g && N === "visible",
|
|
193
|
+
"k-tabstrip-scrollable-start": g && x === "auto" && (f === "end" || f === "middle"),
|
|
194
|
+
"k-tabstrip-scrollable-end": g && x === "auto" && (f === "start" || f === "middle")
|
|
135
195
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
p.propTypes = {
|
|
196
|
+
W
|
|
197
|
+
),
|
|
198
|
+
[h, p, g, x, N, f, W]
|
|
199
|
+
);
|
|
200
|
+
return /* @__PURE__ */ n.createElement("div", { id: m, ref: C, dir: v, className: le, style: ee, onScroll: k }, !V && /* @__PURE__ */ n.createElement(Y, { ...Q }), se, V && /* @__PURE__ */ n.createElement(Y, { ...Q }));
|
|
201
|
+
});
|
|
202
|
+
E.displayName = "TabStrip";
|
|
203
|
+
E.propTypes = {
|
|
146
204
|
id: r.string,
|
|
147
205
|
animation: r.bool,
|
|
148
206
|
children: r.node,
|
|
@@ -156,22 +214,11 @@ p.propTypes = {
|
|
|
156
214
|
className: r.string,
|
|
157
215
|
dir: r.string,
|
|
158
216
|
renderAllContent: r.bool,
|
|
159
|
-
size: r.oneOf(["small", "medium", "large"
|
|
217
|
+
size: r.oneOf(["small", "medium", "large"]),
|
|
160
218
|
scrollButtons: r.oneOf(["auto", "visible", "hidden"]),
|
|
161
219
|
scrollButtonsPosition: r.oneOf(["split", "start", "end", "around", "before", "after"])
|
|
162
|
-
}, p.defaultProps = {
|
|
163
|
-
animation: !0,
|
|
164
|
-
tabPosition: "top",
|
|
165
|
-
tabAlignment: "start",
|
|
166
|
-
keepTabsMounted: !1,
|
|
167
|
-
buttonScrollSpeed: 100,
|
|
168
|
-
mouseScrollSpeed: 10,
|
|
169
|
-
scrollButtons: "auto",
|
|
170
|
-
scrollButtonsPosition: "split",
|
|
171
|
-
size: void 0,
|
|
172
|
-
renderAllContent: !1
|
|
173
220
|
};
|
|
174
|
-
|
|
221
|
+
const ge = E;
|
|
175
222
|
export {
|
|
176
|
-
|
|
223
|
+
ge as TabStrip
|
|
177
224
|
};
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as PropTypes } from 'prop-types';
|
|
9
8
|
import * as React from 'react';
|
|
10
9
|
/**
|
|
11
10
|
* The props that are passed to the TabStripContent by the TabStrip.
|
|
@@ -48,23 +47,4 @@ export interface TabStripContentProps {
|
|
|
48
47
|
*/
|
|
49
48
|
navItemId?: string;
|
|
50
49
|
}
|
|
51
|
-
export declare
|
|
52
|
-
/**
|
|
53
|
-
* @hidden
|
|
54
|
-
*/
|
|
55
|
-
static propTypes: {
|
|
56
|
-
animation: PropTypes.Requireable<boolean>;
|
|
57
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[] | null | undefined>>;
|
|
58
|
-
selected: PropTypes.Requireable<number>;
|
|
59
|
-
style: PropTypes.Requireable<object>;
|
|
60
|
-
};
|
|
61
|
-
private contentId;
|
|
62
|
-
/**
|
|
63
|
-
* @hidden
|
|
64
|
-
*/
|
|
65
|
-
render(): React.JSX.Element | React.JSX.Element[] | null | undefined;
|
|
66
|
-
private renderContent;
|
|
67
|
-
private renderAllContent;
|
|
68
|
-
private renderChild;
|
|
69
|
-
private childFactory;
|
|
70
|
-
}
|
|
50
|
+
export declare const TabStripContent: React.FC<TabStripContentProps>;
|
|
@@ -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 M=require("react"),c=require("prop-types"),v=require("@progress/kendo-react-animation"),S=require("@progress/kendo-react-common");function N(s){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(o,e,l.get?l:{enumerable:!0,get:()=>s[e]})}}return o.default=s,Object.freeze(o)}const t=N(M),h=s=>{const{children:o,selected:e,contentPanelId:l,keepTabsMounted:p,navItemId:b,renderAllContent:g,animation:d,style:y}=s,u=l,k=t.useCallback(n=>t.cloneElement(n,{...n.props,in:n.props.children.props.id===String(u+e)}),[u,e]),C=t.useCallback((n,r)=>{const a=r===e,i={style:{display:a?void 0:"none"}},f={display:a?void 0:"none"};return n.props.disabled?null:d?t.createElement(v.Fade,{appear:!0,exit:p,style:f,childFactory:p?k:void 0},t.createElement("div",{...i,id:String(u+r),key:r},n.props.children)):t.createElement("div",{...i,key:r},n.props.children)},[e,d,p,k,u]),O=t.useCallback(n=>p?t.Children.map(n,(r,a)=>C(r,a)):C(t.Children.toArray(n)[e],e),[p,C,e]),T=t.useMemo(()=>t.Children.map(o,(n,r)=>{const a=n,i=r===e,f=S.classNames("k-tabstrip-content",{"k-active":i},a.props.contentClassName),E=d?t.createElement(v.Fade,{key:`${r}-${i}`,appear:!0,enter:!0,exit:!1},a.props.children):a.props.children;return t.createElement("div",{className:f,style:y,id:`${l}-${r}`,role:"tabpanel","aria-hidden":!i,hidden:!i,"aria-labelledby":`${b}-${r}`},E)}),[o,e,l,b,y,d]),m=t.useMemo(()=>!o||typeof e!="number"?null:t.Children.toArray(o)[e],[o,e]),$=t.useMemo(()=>S.classNames("k-tabstrip-content","k-active",m==null?void 0:m.props.contentClassName),[m]);return g?T:t.createElement("div",{className:$,style:y,id:l,role:"tabpanel","aria-hidden":p,"aria-labelledby":`${b}-${(e==null?void 0:e.toString())||""}`,tabIndex:0},O(o))};h.propTypes={animation:c.bool,children:c.oneOfType([c.element,c.arrayOf(c.element)]),selected:c.number,style:c.object};h.displayName="TabStripContent";exports.TabStripContent=h;
|