@progress/kendo-react-layout 13.4.0-develop.5 → 14.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/dist/cdn/js/kendo-react-layout.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +105 -104
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/panelbar/PanelBar.d.ts +4 -65
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +182 -161
- package/panelbar/PanelBarItem.d.ts +8 -46
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +125 -119
- package/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +2 -2
- package/panelbar/interfaces/PanelBarItemHandle.d.ts +17 -0
- 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
|
@@ -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 ft=require("react"),r=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 s in b)if(s!=="default"){const T=Object.getOwnPropertyDescriptor(b,s);Object.defineProperty(d,s,T.get?T:{enumerable:!0,get:()=>b[s]})}}return d.default=b,Object.freeze(d)}const n=mt(ft),pt=b=>Array.from({length:b}),C="smooth",p="prev",k="next",x=b=>{const{selected:d,tabPosition:s,tabAlignment:T,children:w,onSelect:y,onKeyDown:q,onScroll:A,navItemId:R,contentPanelId:F,renderAllContent:D,scrollable:E,scrollButtons:P,scrollButtonsPosition:m,tabIndex:_,buttonScrollSpeed:j,mouseScrollSpeed:W,prevButton:$,nextButton:K,dir:U,size:V,containerScrollPosition:v,itemsNavRef:ot}=b,nt=n.useRef(null),N=ot||nt,H=dt.useLocalization(),g=n.useCallback(()=>/top|bottom/.test(s||"top"),[s]),h=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 l=g(),u=l?t.offsetWidth:t.offsetHeight,c=l?e.offsetWidth:e.offsetHeight,i=l?"left":"top";let o=l?t.scrollLeft:t.scrollTop,a=0;if(h()){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=l?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,g,h]);n.useEffect(()=>{E&&X()},[E,d,X]);const B=n.useCallback(()=>{A==null||A()},[A]),G=n.useCallback((t,e)=>{const l=N.current;if(!l)return;const u=g(),c=u?l.scrollWidth-l.offsetWidth:l.scrollHeight-l.offsetHeight,i=(e.type==="click"?j:W)||0;let o=u?l.scrollLeft:l.scrollTop;h()&&g()?(t===p&&o<0&&(o+=i),t===k&&o<c&&(o-=i),o=Math.min(0,Math.min(c,o))):(t===p&&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?l.scrollTo({left:o,behavior:a}):l.scrollTo({top:o,behavior:a})},[N,g,h,j,W]),z=n.useCallback((t,e)=>{G(t,e)},[G]),J=n.useCallback(t=>{z(p,t)},[z]),Q=n.useCallback(t=>{z(k,t)},[z]),O=n.useCallback(t=>{const e=g(),l=h(),c=e?l?"caret-alt-right":"caret-alt-left":"caret-alt-up",i=l?I.caretAltRightIcon:I.caretAltLeftIcon,o=e?i:I.caretAltUpIcon,f=e?l?"caret-alt-left":"caret-alt-right":"caret-alt-down",st=l?I.caretAltLeftIcon:I.caretAltRightIcon,rt=e?st:I.caretAltDownIcon,L={prev:{arrowTab:"k-tabstrip-prev",fontIcon:c,svgIcon:o,title:H.toLanguageString(S.prevArrowTitle,S.messages[S.prevArrowTitle])},next:{arrowTab:"k-tabstrip-next",fontIcon:f,svgIcon:rt,title:H.toLanguageString(S.nextArrowTitle,S.messages[S.nextArrowTitle])}},ct=(t===p?$:K)||bt.Button,at=t===p?J:Q,it=v===null||t===p&&(v==="start"||v==="top")||t===k&&(v==="end"||v==="bottom");return n.createElement(ct,{disabled:it,className:M.classNames(`${L[t].arrowTab}`),onClick:at,icon:L[t].fontIcon,svgIcon:L[t].svgIcon,size:V,tabIndex:-1,fillMode:"flat",title:L[t].title})},[g,h,$,K,J,Q,v,V,H]),Y=n.Children.count(w),Z=n.Children.toArray(w),tt=n.useMemo(()=>w?pt(Y).map((t,e,l)=>{const u={active:d===e,disabled:Z[e].props.disabled,index:e,title:Z[e].props.title,first:e===0,last:e===l.length-1,contentPanelId:F,renderAllContent:D,id:R,onSelect:y,onScroll:B};return n.createElement(ut.TabStripNavigationItem,{key:`${R}-${e}`,...u})}):null,[w,Y,d,F,D,R,y,B]),lt=n.useMemo(()=>M.classNames("k-tabstrip-items-wrapper k-tabstrip-items-wrapper-scroll",{"k-hstack":s==="top"||s==="bottom","k-vstack":s==="left"||s==="right"}),[s]),et=n.useMemo(()=>M.classNames("k-tabstrip-items k-tabstrip-items-scroll k-reset",`k-tabstrip-items-${T}`),[T]);return n.createElement("div",{className:lt},E?n.createElement(n.Fragment,null,P!=="hidden"&&m&&["split","start","around","before"].includes(m)&&O(p),P!=="hidden"&&(m==="start"||m==="before")&&O(k),n.createElement("ul",{ref:N,className:et,role:"tablist",tabIndex:_,onKeyDown:q,onScroll:B,"aria-orientation":s==="left"||s==="right"?"vertical":void 0},tt),P!=="hidden"&&(m==="end"||m==="after")&&O(p),P!=="hidden"&&m&&["split","end","around","after"].includes(m)&&O(k)):n.createElement("ul",{className:et,role:"tablist",tabIndex:_,onKeyDown:q},tt))};x.propTypes={children:r.oneOfType([r.element,r.arrayOf(r.element)]),onSelect:r.func,onKeyDown:r.func,onScroll:r.func,selected:r.number,tabIndex:r.number,scrollable:r.bool,size:r.oneOf(["small","medium","large"]),scrollButtons:r.oneOf(["auto","visible","hidden"]),scrollButtonsPosition:r.oneOf(["split","start","end","around","before","after"]),containerScrollPosition:r.oneOf(["start","end","top","bottom","middle",null])};x.displayName="TabStripNavigation";exports.TabStripNavigation=x;
|
|
@@ -5,166 +5,179 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import { TabStripNavigationItem as
|
|
11
|
-
import { classNames as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { caretAltLeftIcon as
|
|
14
|
-
import {
|
|
15
|
-
import { nextArrowTitle as
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
import * as n from "react";
|
|
9
|
+
import r from "prop-types";
|
|
10
|
+
import { TabStripNavigationItem as bt } from "./TabStripNavigationItem.mjs";
|
|
11
|
+
import { classNames as x } from "@progress/kendo-react-common";
|
|
12
|
+
import { Button as pt } from "@progress/kendo-react-buttons";
|
|
13
|
+
import { caretAltLeftIcon as Z, caretAltRightIcon as tt, caretAltDownIcon as ut, caretAltUpIcon as dt } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { useLocalization as vt } from "@progress/kendo-react-intl";
|
|
15
|
+
import { nextArrowTitle as ot, messages as et, prevArrowTitle as nt } from "./messages/index.mjs";
|
|
16
|
+
const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next", lt = (P) => {
|
|
17
|
+
const {
|
|
18
|
+
selected: g,
|
|
19
|
+
tabPosition: m,
|
|
20
|
+
tabAlignment: B,
|
|
21
|
+
children: k,
|
|
22
|
+
onSelect: O,
|
|
23
|
+
onKeyDown: R,
|
|
24
|
+
onScroll: T,
|
|
25
|
+
navItemId: E,
|
|
26
|
+
contentPanelId: M,
|
|
27
|
+
renderAllContent: F,
|
|
28
|
+
scrollable: H,
|
|
29
|
+
scrollButtons: C,
|
|
30
|
+
scrollButtonsPosition: b,
|
|
31
|
+
tabIndex: y,
|
|
32
|
+
buttonScrollSpeed: D,
|
|
33
|
+
mouseScrollSpeed: W,
|
|
34
|
+
prevButton: $,
|
|
35
|
+
nextButton: _,
|
|
36
|
+
dir: K,
|
|
37
|
+
size: U,
|
|
38
|
+
containerScrollPosition: d,
|
|
39
|
+
itemsNavRef: rt
|
|
40
|
+
} = P, st = n.useRef(null), I = rt || st, L = vt(), u = n.useCallback(() => /top|bottom/.test(m || "top"), [m]), v = n.useCallback(() => K === "rtl", [K]), V = n.useCallback(() => {
|
|
41
|
+
const t = I.current, o = t == null ? void 0 : t.children[g || 0];
|
|
42
|
+
if (o instanceof HTMLElement && t instanceof HTMLElement) {
|
|
43
|
+
const l = u(), i = l ? t.offsetWidth : t.offsetHeight, s = l ? o.offsetWidth : o.offsetHeight, f = l ? "left" : "top";
|
|
44
|
+
let e = l ? t.scrollLeft : t.scrollTop, c = 0;
|
|
45
|
+
if (v()) {
|
|
46
|
+
const a = o.offsetLeft;
|
|
47
|
+
e = e * -1, a < 0 ? (c = a - s + t.offsetLeft, t.scrollTo({ [f]: c, behavior: S })) : a + s > i - e && (c = e + a - s, t.scrollTo({ [f]: c, behavior: S }));
|
|
48
|
+
} else {
|
|
49
|
+
const a = l ? o.offsetLeft - t.offsetLeft : o.offsetTop - t.offsetTop;
|
|
50
|
+
e + i < a + s ? (c = a + s - i, t.scrollTo({ [f]: c, behavior: S })) : e > a && (c = a, t.scrollTo({ [f]: c, behavior: S }));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, [I, g, u, v]);
|
|
54
|
+
n.useEffect(() => {
|
|
55
|
+
H && V();
|
|
56
|
+
}, [H, g, V]);
|
|
57
|
+
const A = n.useCallback(() => {
|
|
58
|
+
T == null || T();
|
|
59
|
+
}, [T]), X = n.useCallback(
|
|
60
|
+
(t, o) => {
|
|
61
|
+
const l = I.current;
|
|
62
|
+
if (!l)
|
|
30
63
|
return;
|
|
31
|
-
const
|
|
32
|
-
let e =
|
|
33
|
-
|
|
34
|
-
const c = o.type === "click" ?
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
64
|
+
const i = u(), s = i ? l.scrollWidth - l.offsetWidth : l.scrollHeight - l.offsetHeight, f = (o.type === "click" ? D : W) || 0;
|
|
65
|
+
let e = i ? l.scrollLeft : l.scrollTop;
|
|
66
|
+
v() && u() ? (t === p && e < 0 && (e += f), t === h && e < s && (e -= f), e = Math.min(0, Math.min(s, e))) : (t === p && e > 0 && (e -= f), t === h && e < s && (e += f), e = Math.max(0, Math.min(s, e)));
|
|
67
|
+
const c = o.type === "click" ? S : void 0;
|
|
68
|
+
i ? l.scrollTo({ left: e, behavior: c }) : l.scrollTo({ top: e, behavior: c });
|
|
69
|
+
},
|
|
70
|
+
[I, u, v, D, W]
|
|
71
|
+
), N = n.useCallback(
|
|
72
|
+
(t, o) => {
|
|
73
|
+
X(t, o);
|
|
74
|
+
},
|
|
75
|
+
[X]
|
|
76
|
+
), j = n.useCallback(
|
|
77
|
+
(t) => {
|
|
78
|
+
N(p, t);
|
|
79
|
+
},
|
|
80
|
+
[N]
|
|
81
|
+
), q = n.useCallback(
|
|
82
|
+
(t) => {
|
|
83
|
+
N(h, t);
|
|
84
|
+
},
|
|
85
|
+
[N]
|
|
86
|
+
), z = n.useCallback(
|
|
87
|
+
(t) => {
|
|
88
|
+
const o = u(), l = v(), s = o ? l ? "caret-alt-right" : "caret-alt-left" : "caret-alt-up", e = o ? l ? tt : Z : dt, a = o ? l ? "caret-alt-left" : "caret-alt-right" : "caret-alt-down", at = o ? l ? Z : tt : ut, w = {
|
|
38
89
|
prev: {
|
|
39
90
|
arrowTab: "k-tabstrip-prev",
|
|
40
|
-
fontIcon:
|
|
41
|
-
svgIcon:
|
|
42
|
-
title:
|
|
91
|
+
fontIcon: s,
|
|
92
|
+
svgIcon: e,
|
|
93
|
+
title: L.toLanguageString(nt, et[nt])
|
|
43
94
|
},
|
|
44
95
|
next: {
|
|
45
96
|
arrowTab: "k-tabstrip-next",
|
|
46
|
-
fontIcon:
|
|
47
|
-
svgIcon:
|
|
48
|
-
title:
|
|
97
|
+
fontIcon: a,
|
|
98
|
+
svgIcon: at,
|
|
99
|
+
title: L.toLanguageString(ot, et[ot])
|
|
49
100
|
}
|
|
50
|
-
},
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
101
|
+
}, it = (t === p ? $ : _) || pt, ft = t === p ? j : q, mt = d === null || t === p && (d === "start" || d === "top") || t === h && (d === "end" || d === "bottom");
|
|
102
|
+
return /* @__PURE__ */ n.createElement(
|
|
103
|
+
it,
|
|
53
104
|
{
|
|
54
|
-
disabled:
|
|
55
|
-
className:
|
|
56
|
-
onClick:
|
|
57
|
-
icon:
|
|
58
|
-
svgIcon:
|
|
59
|
-
size:
|
|
105
|
+
disabled: mt,
|
|
106
|
+
className: x(`${w[t].arrowTab}`),
|
|
107
|
+
onClick: ft,
|
|
108
|
+
icon: w[t].fontIcon,
|
|
109
|
+
svgIcon: w[t].svgIcon,
|
|
110
|
+
size: U,
|
|
60
111
|
tabIndex: -1,
|
|
61
112
|
fillMode: "flat",
|
|
62
|
-
title:
|
|
113
|
+
title: w[t].title
|
|
63
114
|
}
|
|
64
115
|
);
|
|
116
|
+
},
|
|
117
|
+
[
|
|
118
|
+
u,
|
|
119
|
+
v,
|
|
120
|
+
$,
|
|
121
|
+
_,
|
|
122
|
+
j,
|
|
123
|
+
q,
|
|
124
|
+
d,
|
|
125
|
+
U,
|
|
126
|
+
L
|
|
127
|
+
]
|
|
128
|
+
), G = n.Children.count(k), J = n.Children.toArray(k), Q = n.useMemo(() => k ? ht(G).map((t, o, l) => {
|
|
129
|
+
const i = {
|
|
130
|
+
active: g === o,
|
|
131
|
+
disabled: J[o].props.disabled,
|
|
132
|
+
index: o,
|
|
133
|
+
title: J[o].props.title,
|
|
134
|
+
first: o === 0,
|
|
135
|
+
last: o === l.length - 1,
|
|
136
|
+
contentPanelId: M,
|
|
137
|
+
renderAllContent: F,
|
|
138
|
+
id: E,
|
|
139
|
+
onSelect: O,
|
|
140
|
+
onScroll: A
|
|
65
141
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
onKeyDown: i,
|
|
91
|
-
navItemId: e,
|
|
92
|
-
contentPanelId: c,
|
|
93
|
-
renderAllContent: a,
|
|
94
|
-
scrollable: L,
|
|
95
|
-
scrollButtons: u,
|
|
96
|
-
scrollButtonsPosition: p
|
|
97
|
-
} = this.props, E = h.Children.count(r), g = h.Children.toArray(r);
|
|
98
|
-
let S;
|
|
99
|
-
r && (S = W(E).map((U, d, B) => {
|
|
100
|
-
const O = {
|
|
101
|
-
active: t === d,
|
|
102
|
-
disabled: g[d].props.disabled,
|
|
103
|
-
index: d,
|
|
104
|
-
title: g[d].props.title,
|
|
105
|
-
first: d === 0,
|
|
106
|
-
last: d === B.length - 1,
|
|
107
|
-
contentPanelId: c,
|
|
108
|
-
renderAllContent: a,
|
|
109
|
-
id: e,
|
|
110
|
-
onSelect: l,
|
|
111
|
-
onScroll: this.onScroll
|
|
112
|
-
};
|
|
113
|
-
return /* @__PURE__ */ h.createElement(x, { key: d, ...O });
|
|
114
|
-
}));
|
|
115
|
-
const N = v("k-tabstrip-items-wrapper k-tabstrip-items-wrapper-scroll", {
|
|
116
|
-
"k-hstack": o === "top" || o === "bottom",
|
|
117
|
-
"k-vstack": o === "left" || o === "right"
|
|
118
|
-
}), T = v(
|
|
119
|
-
"k-tabstrip-items k-tabstrip-items-scroll k-reset",
|
|
120
|
-
`k-tabstrip-items-${s}`
|
|
121
|
-
);
|
|
122
|
-
return /* @__PURE__ */ h.createElement("div", { className: N }, L ? /* @__PURE__ */ h.createElement(h.Fragment, null, u !== "hidden" && p && ["split", "start", "around", "before"].includes(p) && this.renderArrow(f), u !== "hidden" && (p === "start" || p === "before") && this.renderArrow(m), /* @__PURE__ */ h.createElement(
|
|
123
|
-
"ul",
|
|
124
|
-
{
|
|
125
|
-
ref: this.itemsNavRef,
|
|
126
|
-
className: T,
|
|
127
|
-
role: "tablist",
|
|
128
|
-
tabIndex: this.props.tabIndex,
|
|
129
|
-
onKeyDown: i,
|
|
130
|
-
onScroll: this.onScroll,
|
|
131
|
-
"aria-orientation": o === "left" || o === "right" ? "vertical" : void 0
|
|
132
|
-
},
|
|
133
|
-
S
|
|
134
|
-
), u !== "hidden" && (p === "end" || p === "after") && this.renderArrow(f), u !== "hidden" && p && ["split", "end", "around", "after"].includes(p) && this.renderArrow(m)) : /* @__PURE__ */ h.createElement("ul", { className: T, role: "tablist", tabIndex: this.props.tabIndex, onKeyDown: i }, S));
|
|
135
|
-
}
|
|
136
|
-
scrollToSelected() {
|
|
137
|
-
const t = this.itemsNavRef.current, o = t && t.children[this.props.selected || 0];
|
|
138
|
-
if (o instanceof HTMLElement && t instanceof HTMLElement) {
|
|
139
|
-
const s = this.horizontalScroll(), r = s ? t.offsetWidth : t.offsetHeight, l = s ? o.offsetWidth : o.offsetHeight, i = s ? "left" : "top";
|
|
140
|
-
let e = s ? t.scrollLeft : t.scrollTop, c = 0;
|
|
141
|
-
if (this.isRtl()) {
|
|
142
|
-
const a = o.offsetLeft;
|
|
143
|
-
e = e * -1, a < 0 ? (c = a - l + t.offsetLeft, t.scrollTo({ [i]: c, behavior: b })) : a + l > r - e && (c = e + a - l, t.scrollTo({ [i]: c, behavior: b }));
|
|
144
|
-
} else {
|
|
145
|
-
const a = s ? o.offsetLeft - t.offsetLeft : o.offsetTop - t.offsetTop;
|
|
146
|
-
e + r < a + l ? (c = a + l - r, t.scrollTo({ [i]: c, behavior: b })) : e > a && (c = a, t.scrollTo({ [i]: c, behavior: b }));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
horizontalScroll() {
|
|
151
|
-
return /top|bottom/.test(this.props.tabPosition || "top");
|
|
152
|
-
}
|
|
142
|
+
return /* @__PURE__ */ n.createElement(bt, { key: `${E}-${o}`, ...i });
|
|
143
|
+
}) : null, [k, G, g, M, F, E, O, A]), ct = n.useMemo(
|
|
144
|
+
() => x("k-tabstrip-items-wrapper k-tabstrip-items-wrapper-scroll", {
|
|
145
|
+
"k-hstack": m === "top" || m === "bottom",
|
|
146
|
+
"k-vstack": m === "left" || m === "right"
|
|
147
|
+
}),
|
|
148
|
+
[m]
|
|
149
|
+
), Y = n.useMemo(
|
|
150
|
+
() => x("k-tabstrip-items k-tabstrip-items-scroll k-reset", `k-tabstrip-items-${B}`),
|
|
151
|
+
[B]
|
|
152
|
+
);
|
|
153
|
+
return /* @__PURE__ */ n.createElement("div", { className: ct }, H ? /* @__PURE__ */ n.createElement(n.Fragment, null, C !== "hidden" && b && ["split", "start", "around", "before"].includes(b) && z(p), C !== "hidden" && (b === "start" || b === "before") && z(h), /* @__PURE__ */ n.createElement(
|
|
154
|
+
"ul",
|
|
155
|
+
{
|
|
156
|
+
ref: I,
|
|
157
|
+
className: Y,
|
|
158
|
+
role: "tablist",
|
|
159
|
+
tabIndex: y,
|
|
160
|
+
onKeyDown: R,
|
|
161
|
+
onScroll: A,
|
|
162
|
+
"aria-orientation": m === "left" || m === "right" ? "vertical" : void 0
|
|
163
|
+
},
|
|
164
|
+
Q
|
|
165
|
+
), C !== "hidden" && (b === "end" || b === "after") && z(p), C !== "hidden" && b && ["split", "end", "around", "after"].includes(b) && z(h)) : /* @__PURE__ */ n.createElement("ul", { className: Y, role: "tablist", tabIndex: y, onKeyDown: R }, Q));
|
|
153
166
|
};
|
|
154
|
-
|
|
155
|
-
children:
|
|
156
|
-
onSelect:
|
|
157
|
-
onKeyDown:
|
|
158
|
-
onScroll:
|
|
159
|
-
selected:
|
|
160
|
-
tabIndex:
|
|
161
|
-
scrollable:
|
|
162
|
-
size:
|
|
163
|
-
scrollButtons:
|
|
164
|
-
scrollButtonsPosition:
|
|
165
|
-
containerScrollPosition:
|
|
167
|
+
lt.propTypes = {
|
|
168
|
+
children: r.oneOfType([r.element, r.arrayOf(r.element)]),
|
|
169
|
+
onSelect: r.func,
|
|
170
|
+
onKeyDown: r.func,
|
|
171
|
+
onScroll: r.func,
|
|
172
|
+
selected: r.number,
|
|
173
|
+
tabIndex: r.number,
|
|
174
|
+
scrollable: r.bool,
|
|
175
|
+
size: r.oneOf(["small", "medium", "large"]),
|
|
176
|
+
scrollButtons: r.oneOf(["auto", "visible", "hidden"]),
|
|
177
|
+
scrollButtonsPosition: r.oneOf(["split", "start", "end", "around", "before", "after"]),
|
|
178
|
+
containerScrollPosition: r.oneOf(["start", "end", "top", "bottom", "middle", null])
|
|
166
179
|
};
|
|
167
|
-
|
|
180
|
+
lt.displayName = "TabStripNavigation";
|
|
168
181
|
export {
|
|
169
|
-
|
|
182
|
+
lt as TabStripNavigation
|
|
170
183
|
};
|
|
@@ -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 by the TabStripNavigation to the TabStripNavigationItem.
|
|
@@ -52,31 +51,10 @@ export interface TabStripNavigationItemProps {
|
|
|
52
51
|
*/
|
|
53
52
|
renderAllContent?: boolean;
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
static propTypes: {
|
|
60
|
-
active: PropTypes.Requireable<boolean>;
|
|
61
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
62
|
-
index: PropTypes.Requireable<number>;
|
|
63
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
|
-
title: PropTypes.Requireable<NonNullable<string | PropTypes.ReactElementLike | null | undefined>>;
|
|
65
|
-
first: PropTypes.Requireable<boolean>;
|
|
66
|
-
last: PropTypes.Requireable<boolean>;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* @hidden
|
|
70
|
-
*/
|
|
71
|
-
private itemRef;
|
|
72
|
-
/**
|
|
73
|
-
* @hidden
|
|
74
|
-
*/
|
|
54
|
+
/**
|
|
55
|
+
* Represents the TabStripNavigationItem component.
|
|
56
|
+
*/
|
|
57
|
+
export declare const TabStripNavigationItem: React.ForwardRefExoticComponent<TabStripNavigationItemProps & React.RefAttributes<{
|
|
75
58
|
focus: () => void;
|
|
76
59
|
blur: () => void;
|
|
77
|
-
|
|
78
|
-
* @hidden
|
|
79
|
-
*/
|
|
80
|
-
render(): React.JSX.Element;
|
|
81
|
-
private onClick;
|
|
82
|
-
}
|
|
60
|
+
}>>;
|
|
@@ -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 T=require("react"),t=require("prop-types"),O=require("@progress/kendo-react-common");function P(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}return i.default=n,Object.freeze(i)}const e=P(T),f=e.forwardRef((n,i)=>{const{id:r,active:a,disabled:l,title:C="Untitled",index:o,renderAllContent:p,first:k,last:g,contentPanelId:d,onSelect:u}=n,s=e.useRef(null),v=e.useCallback(()=>{var c;(c=s.current)==null||c.focus()},[]),b=e.useCallback(()=>{var c;(c=s.current)==null||c.blur()},[]),S=e.useCallback(()=>({focus:v,blur:b}),[v,b]);e.useImperativeHandle(i,S);const y=e.useCallback(()=>{u==null||u(o),s.current&&(s.current.tabIndex=0,s.current.focus())},[u,o]),m=e.useMemo(()=>p?`${d}-${o.toString()}`:d,[p,d,o]),I=e.useMemo(()=>O.classNames("k-tabstrip-item",{"k-disabled":l,"k-active":a,"k-first":k,"k-last":g}),[l,a,k,g]),N=e.useMemo(()=>({id:`${r}-${o.toString()}`,"aria-selected":a,"aria-controls":a?m:void 0,"aria-disabled":l,role:"tab",onClick:l?void 0:y}),[r,o,a,m,l,y]);return e.createElement("li",{...N,className:I,ref:s,onBlur:b,"aria-controls":m},e.createElement("span",{className:"k-link"},C))});f.propTypes={active:t.bool,disabled:t.bool,index:t.number,onSelect:t.func,title:t.oneOfType([t.string,t.element]),first:t.bool,last:t.bool};f.displayName="TabStripNavigationItem";exports.TabStripNavigationItem=f;
|
|
@@ -5,52 +5,62 @@
|
|
|
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 e from "react";
|
|
9
9
|
import t from "prop-types";
|
|
10
|
-
import { classNames as
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
import { classNames as y } from "@progress/kendo-react-common";
|
|
11
|
+
const v = e.forwardRef((C, I) => {
|
|
12
|
+
const {
|
|
13
|
+
id: d,
|
|
14
|
+
active: o,
|
|
15
|
+
disabled: r,
|
|
16
|
+
title: g = "Untitled",
|
|
17
|
+
index: a,
|
|
18
|
+
renderAllContent: u,
|
|
19
|
+
first: b,
|
|
20
|
+
last: p,
|
|
21
|
+
contentPanelId: n,
|
|
22
|
+
onSelect: i
|
|
23
|
+
} = C, s = e.useRef(null), f = e.useCallback(() => {
|
|
24
|
+
var l;
|
|
25
|
+
(l = s.current) == null || l.focus();
|
|
26
|
+
}, []), c = e.useCallback(() => {
|
|
27
|
+
var l;
|
|
28
|
+
(l = s.current) == null || l.blur();
|
|
29
|
+
}, []), N = e.useCallback(
|
|
30
|
+
() => ({
|
|
31
|
+
focus: f,
|
|
32
|
+
blur: c
|
|
33
|
+
}),
|
|
34
|
+
[f, c]
|
|
35
|
+
);
|
|
36
|
+
e.useImperativeHandle(I, N);
|
|
37
|
+
const k = e.useCallback(() => {
|
|
38
|
+
i == null || i(a), s.current && (s.current.tabIndex = 0, s.current.focus());
|
|
39
|
+
}, [i, a]), m = e.useMemo(
|
|
40
|
+
() => u ? `${n}-${a.toString()}` : n,
|
|
41
|
+
[u, n, a]
|
|
42
|
+
), T = e.useMemo(
|
|
43
|
+
() => y("k-tabstrip-item", {
|
|
44
|
+
"k-disabled": r,
|
|
45
|
+
"k-active": o,
|
|
46
|
+
"k-first": b,
|
|
47
|
+
"k-last": p
|
|
48
|
+
}),
|
|
49
|
+
[r, o, b, p]
|
|
50
|
+
), x = e.useMemo(
|
|
51
|
+
() => ({
|
|
52
|
+
id: `${d}-${a.toString()}`,
|
|
53
|
+
"aria-selected": o,
|
|
54
|
+
"aria-controls": o ? m : void 0,
|
|
55
|
+
"aria-disabled": r,
|
|
30
56
|
role: "tab",
|
|
31
|
-
onClick:
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return /* @__PURE__ */ i.createElement(
|
|
39
|
-
"li",
|
|
40
|
-
{
|
|
41
|
-
...m,
|
|
42
|
-
className: h,
|
|
43
|
-
ref: (u) => {
|
|
44
|
-
this.itemRef = u;
|
|
45
|
-
},
|
|
46
|
-
onBlur: this.blur,
|
|
47
|
-
"aria-controls": r
|
|
48
|
-
},
|
|
49
|
-
/* @__PURE__ */ i.createElement("span", { className: "k-link" }, c)
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
o.propTypes = {
|
|
57
|
+
onClick: r ? void 0 : k
|
|
58
|
+
}),
|
|
59
|
+
[d, a, o, m, r, k]
|
|
60
|
+
);
|
|
61
|
+
return /* @__PURE__ */ e.createElement("li", { ...x, className: T, ref: s, onBlur: c, "aria-controls": m }, /* @__PURE__ */ e.createElement("span", { className: "k-link" }, g));
|
|
62
|
+
});
|
|
63
|
+
v.propTypes = {
|
|
54
64
|
active: t.bool,
|
|
55
65
|
disabled: t.bool,
|
|
56
66
|
index: t.number,
|
|
@@ -59,7 +69,7 @@ o.propTypes = {
|
|
|
59
69
|
first: t.bool,
|
|
60
70
|
last: t.bool
|
|
61
71
|
};
|
|
62
|
-
|
|
72
|
+
v.displayName = "TabStripNavigationItem";
|
|
63
73
|
export {
|
|
64
|
-
|
|
74
|
+
v as TabStripNavigationItem
|
|
65
75
|
};
|
|
@@ -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
|
* Represents the props of the TabStrip tabs.
|
|
@@ -33,18 +32,4 @@ export interface TabStripTabProps {
|
|
|
33
32
|
/**
|
|
34
33
|
* Represents the TabStripTab component.
|
|
35
34
|
*/
|
|
36
|
-
export declare
|
|
37
|
-
/**
|
|
38
|
-
* @hidden
|
|
39
|
-
*/
|
|
40
|
-
static propTypes: {
|
|
41
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
42
|
-
contentClassName: PropTypes.Requireable<string>;
|
|
43
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
44
|
-
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
render(): null;
|
|
50
|
-
}
|
|
35
|
+
export declare const TabStripTab: React.FC<TabStripTabProps>;
|
package/tabstrip/TabStripTab.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 e=require("prop-types"),t=()=>null;t.propTypes={disabled:e.bool,contentClassName:e.string,children:e.oneOfType([e.element,e.node]),title:e.oneOfType([e.string,e.element,e.node])};t.displayName="TabStripTab";exports.TabStripTab=t;
|
package/tabstrip/TabStripTab.mjs
CHANGED
|
@@ -5,23 +5,15 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as t from "react";
|
|
9
8
|
import e from "prop-types";
|
|
10
|
-
const n =
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
render() {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
9
|
+
const n = () => null;
|
|
18
10
|
n.propTypes = {
|
|
19
11
|
disabled: e.bool,
|
|
20
12
|
contentClassName: e.string,
|
|
21
13
|
children: e.oneOfType([e.element, e.node]),
|
|
22
14
|
title: e.oneOfType([e.string, e.element, e.node])
|
|
23
15
|
};
|
|
24
|
-
|
|
16
|
+
n.displayName = "TabStripTab";
|
|
25
17
|
export {
|
|
26
|
-
|
|
18
|
+
n as TabStripTab
|
|
27
19
|
};
|