@progress/kendo-react-layout 14.5.0-develop.12 → 14.5.0-develop.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MenuMcpWrapper.d.ts +17 -0
- package/MenuMcpWrapper.js +8 -0
- package/MenuMcpWrapper.mjs +18 -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/interfaces/DrawerProps.d.ts +8 -0
- 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 +92 -90
- package/panelbar/interfaces/PanelBarProps.d.ts +8 -0
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +109 -107
- package/stepper/interfaces/StepperProps.d.ts +8 -1
- package/tabstrip/TabStrip.d.ts +8 -1
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +126 -125
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
|
};
|