@progress/kendo-react-layout 14.4.1-develop.9 → 14.5.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/actionsheet/ActionSheet.d.ts +1 -1
- package/actionsheet/ActionSheetContent.d.ts +1 -1
- package/actionsheet/ActionSheetFooter.d.ts +1 -1
- package/actionsheet/ActionSheetHeader.d.ts +1 -1
- package/actionsheet/ActionSheetItem.d.ts +1 -1
- package/appbar/AppBar.d.ts +1 -1
- package/appbar/AppBarSection.d.ts +1 -1
- package/appbar/AppBarSpacer.d.ts +1 -1
- package/bottomnavigation/BottomNavigation.d.ts +1 -1
- package/bottomnavigation/BottomNavigationProps.d.ts +2 -2
- package/card/Avatar.d.ts +1 -1
- package/card/Card.d.ts +2 -2
- package/card/CardActions.d.ts +1 -1
- package/card/CardBody.d.ts +1 -1
- package/card/CardFooter.d.ts +1 -1
- package/card/CardHeader.d.ts +1 -1
- package/card/CardImage.d.ts +1 -1
- package/card/CardSubtitle.d.ts +1 -1
- package/card/CardTitle.d.ts +1 -1
- package/card/interfaces/CardHandle.d.ts +1 -1
- package/contextmenu/ContextMenu.d.ts +2 -2
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.d.ts +1 -1
- package/drawer/DrawerContent.d.ts +1 -1
- package/drawer/DrawerItem.d.ts +2 -2
- package/drawer/DrawerNavigation.d.ts +1 -1
- package/drawer/context/DrawerContext.d.ts +2 -2
- package/drawer/interfaces/DrawerProps.d.ts +3 -3
- package/expansionpanel/ExpansionPanel.d.ts +1 -1
- package/expansionpanel/index.d.ts +1 -1
- package/gridlayout/GridLayout.d.ts +1 -1
- package/gridlayout/GridLayoutItem.d.ts +1 -1
- package/gridlayout/interfaces/GridLayoutProps.d.ts +2 -2
- package/index.d.mts +39 -39
- package/index.d.ts +39 -39
- package/menu/MenuProps.d.ts +2 -2
- package/menu/components/Menu.d.ts +15 -94
- package/menu/components/Menu.js +1 -1
- package/menu/components/Menu.mjs +223 -212
- package/menu/components/MenuItem.d.ts +5 -25
- package/menu/components/MenuItem.js +1 -1
- package/menu/components/MenuItem.mjs +16 -24
- package/menu/components/MenuItemArrow.d.ts +1 -16
- package/menu/components/MenuItemArrow.js +1 -1
- package/menu/components/MenuItemArrow.mjs +26 -35
- package/menu/components/MenuItemInternal.d.ts +4 -37
- package/menu/components/MenuItemInternal.js +1 -1
- package/menu/components/MenuItemInternal.mjs +174 -219
- package/menu/components/MenuItemLink.d.ts +1 -15
- package/menu/components/MenuItemLink.js +1 -1
- package/menu/components/MenuItemLink.mjs +17 -30
- package/menu/events.d.ts +5 -5
- package/menu/models/MenuItemModel.d.ts +1 -1
- package/menu/utils/DirectionHolder.js +1 -1
- package/menu/utils/DirectionHolder.mjs +1 -1
- package/menu/utils/getNewItemIdUponKeyboardNavigation.d.ts +1 -1
- package/menu/utils/hoverDelay.d.ts +1 -1
- package/menu/utils/prepareInputItemsForInternalWork.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/panelbar/PanelBarItem.d.ts +1 -1
- package/panelbar/interfaces/PanelBarItemHandle.d.ts +1 -1
- package/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +1 -1
- package/panelbar/util.d.ts +2 -2
- package/stacklayout/StackLayout.d.ts +1 -1
- package/stepper/Step.d.ts +2 -2
- package/stepper/Stepper.d.ts +2 -2
- package/stepper/context/StepperContext.d.ts +3 -3
- package/stepper/interfaces/StepChangeEvent.d.ts +1 -1
- package/stepper/interfaces/StepFocusEvent.d.ts +1 -1
- package/stepper/interfaces/StepperChangeEvent.d.ts +1 -1
- package/stepper/interfaces/StepperFocusEvent.d.ts +1 -1
- package/stepper/interfaces/StepperOnNavigateEvent.d.ts +1 -1
- package/stepper/interfaces/StepperProps.d.ts +3 -3
package/menu/components/Menu.mjs
CHANGED
|
@@ -5,240 +5,251 @@
|
|
|
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 {
|
|
11
|
-
import { ZERO_LEVEL_ZERO_ITEM_ID as
|
|
12
|
-
import { prepareInputItemsForInternalWork as
|
|
13
|
-
import { getNewItemIdUponKeyboardNavigation as
|
|
14
|
-
import { getHoverOpenDelay as
|
|
15
|
-
import { MenuItemInternalsList as
|
|
16
|
-
import { DirectionHolder as
|
|
17
|
-
import { MouseOverHandler as
|
|
18
|
-
const
|
|
19
|
-
focusedItemId:
|
|
20
|
-
hoveredItemId:
|
|
21
|
-
tabbableItemId:
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import u from "prop-types";
|
|
10
|
+
import { dispatchEvent as oe, Keys as B, classNames as ce } from "@progress/kendo-react-common";
|
|
11
|
+
import { ZERO_LEVEL_ZERO_ITEM_ID as A, EMPTY_ID as i, getRootParentId as _, isIdEmptyOrZeroLevel as P, getItemById as S, isIdZeroLevel as O, getDirectParentId as W } from "../utils/itemsIdsUtils.mjs";
|
|
12
|
+
import { prepareInputItemsForInternalWork as se } from "../utils/prepareInputItemsForInternalWork.mjs";
|
|
13
|
+
import { getNewItemIdUponKeyboardNavigation as Z } from "../utils/getNewItemIdUponKeyboardNavigation.mjs";
|
|
14
|
+
import { getHoverOpenDelay as ue, getHoverCloseDelay as ie } from "../utils/hoverDelay.mjs";
|
|
15
|
+
import { MenuItemInternalsList as le } from "./MenuItemInternal.mjs";
|
|
16
|
+
import { DirectionHolder as ae } from "../utils/DirectionHolder.mjs";
|
|
17
|
+
import { MouseOverHandler as de } from "../utils/MouseOverHandler.mjs";
|
|
18
|
+
const q = {
|
|
19
|
+
focusedItemId: i,
|
|
20
|
+
hoveredItemId: i,
|
|
21
|
+
tabbableItemId: A
|
|
22
|
+
}, j = r.forwardRef((o, x) => {
|
|
23
|
+
const R = r.useRef(null), g = r.useRef(null), h = r.useRef(null), k = r.useRef(new ae()), D = r.useRef([]), F = r.useRef([]), l = r.useRef(o);
|
|
24
|
+
l.current = o;
|
|
25
|
+
const [f, L] = r.useState({ ...q }), C = r.useRef(f);
|
|
26
|
+
C.current = f;
|
|
27
|
+
const H = r.useRef(() => {
|
|
28
|
+
}), p = r.useRef(new de(o.openOnClick, () => H.current())), { items: z, inputItems: G } = se(
|
|
29
|
+
o.items,
|
|
30
|
+
o.children
|
|
31
|
+
);
|
|
32
|
+
D.current = z, F.current = G, k.current.setIsDirectionRightToLeft(U());
|
|
33
|
+
function U() {
|
|
34
|
+
return !!(l.current.dir !== void 0 ? l.current.dir === "rtl" : R.current && getComputedStyle(R.current).direction === "rtl");
|
|
35
|
+
}
|
|
36
|
+
const b = r.useCallback(() => {
|
|
37
|
+
g.current && (clearTimeout(g.current), g.current = null), h.current && (clearTimeout(h.current), h.current = null);
|
|
38
|
+
}, []), K = r.useCallback(() => {
|
|
39
|
+
b(), L({ ...q });
|
|
40
|
+
}, [b]);
|
|
41
|
+
H.current = K;
|
|
42
|
+
const y = r.useRef({
|
|
43
|
+
get element() {
|
|
44
|
+
return R.current;
|
|
45
|
+
},
|
|
46
|
+
reset: () => H.current()
|
|
47
|
+
});
|
|
48
|
+
r.useImperativeHandle(x, () => y.current, []);
|
|
49
|
+
const m = r.useCallback((e) => {
|
|
50
|
+
L((t) => {
|
|
51
|
+
const n = e === i ? t.tabbableItemId : _(e);
|
|
52
|
+
return { hoveredItemId: e === i || P(t.hoveredItemId) && P(e) ? t.hoveredItemId : i, focusedItemId: e, tabbableItemId: n };
|
|
53
|
+
});
|
|
54
|
+
}, []), a = r.useCallback((e) => {
|
|
55
|
+
L((t) => P(e) && P(t.focusedItemId) ? {
|
|
56
|
+
hoveredItemId: e,
|
|
57
|
+
focusedItemId: t.focusedItemId,
|
|
58
|
+
tabbableItemId: t.tabbableItemId
|
|
59
|
+
} : { hoveredItemId: e, focusedItemId: i, tabbableItemId: A });
|
|
60
|
+
}, []), I = r.useCallback((e) => S(e, F.current), []), T = r.useCallback(
|
|
61
|
+
(e, t) => {
|
|
62
|
+
oe(l.current.onSelect, e, y.current, {
|
|
63
|
+
item: I(t),
|
|
64
|
+
itemId: t
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
[I]
|
|
68
|
+
), E = r.useCallback((e) => !l.current.customCloseItemIds || l.current.customCloseItemIds.indexOf(e) === -1, []), N = r.useCallback(
|
|
69
|
+
(e) => {
|
|
70
|
+
var c, s;
|
|
71
|
+
const t = l.current, n = C.current;
|
|
72
|
+
if (t.openOnClick && n.hoveredItemId !== i) {
|
|
73
|
+
const d = e.target;
|
|
74
|
+
((c = R.current) == null ? void 0 : c.contains(d)) === !1 && (t.id && ((s = d.closest) != null && s.call(d, `[id^="${t.id}_"]`)) || a(i));
|
|
31
75
|
}
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
76
|
+
},
|
|
77
|
+
[a]
|
|
78
|
+
), Y = r.useCallback(
|
|
79
|
+
(e) => {
|
|
80
|
+
const t = C.current, n = l.current, c = D.current;
|
|
81
|
+
if (t.focusedItemId !== i) {
|
|
82
|
+
const s = S(t.focusedItemId, c);
|
|
83
|
+
let d = Z(
|
|
84
|
+
c,
|
|
85
|
+
s.id,
|
|
38
86
|
e.keyCode,
|
|
39
87
|
e.key,
|
|
40
|
-
|
|
41
|
-
|
|
88
|
+
n.vertical,
|
|
89
|
+
k.current.getIsDirectionRightToLeft()
|
|
42
90
|
);
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
91
|
+
const v = S(d, c);
|
|
92
|
+
if (v != null && v.separator && (d = Z(
|
|
93
|
+
c,
|
|
94
|
+
d,
|
|
47
95
|
e.keyCode,
|
|
48
96
|
e.key,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
)),
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
target:
|
|
55
|
-
item:
|
|
56
|
-
itemId:
|
|
97
|
+
n.vertical,
|
|
98
|
+
k.current.getIsDirectionRightToLeft()
|
|
99
|
+
)), s.id !== d && (e.preventDefault(), m(d)), (e.keyCode === B.enter || e.keyCode === B.space) && !s.disabled && (p.current.handleItemSelectedViaKeyboard(), T(e, s.id), !e.isDefaultPrevented() && s.items.length === 0 && s.url && window.location.assign(s.url)), e.keyCode === B.esc && O(s.id) && n.onClose) {
|
|
100
|
+
const w = I(s.id);
|
|
101
|
+
n.onClose({
|
|
102
|
+
target: y.current,
|
|
103
|
+
item: w,
|
|
104
|
+
itemId: s.id
|
|
57
105
|
});
|
|
58
106
|
}
|
|
59
107
|
}
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
108
|
+
},
|
|
109
|
+
[m, T, I]
|
|
110
|
+
), $ = r.useCallback(
|
|
111
|
+
(e) => {
|
|
112
|
+
const t = C.current, n = l.current, c = n.openOnClick && !O(e) && t.hoveredItemId !== i;
|
|
113
|
+
(p.current.IsMouseOverEnabled || c) && (b(), g.current = window.setTimeout(() => {
|
|
114
|
+
a(e), g.current = null;
|
|
115
|
+
}, ue(n)));
|
|
116
|
+
},
|
|
117
|
+
[b, a]
|
|
118
|
+
), J = r.useCallback(
|
|
119
|
+
(e) => {
|
|
120
|
+
const t = C.current, n = l.current, c = n.openOnClick && !O(e) && t.hoveredItemId !== i;
|
|
121
|
+
(p.current.IsMouseOverEnabled || c) && E(e) && (b(), h.current = window.setTimeout(() => {
|
|
122
|
+
a(c ? W(e) : i), h.current = null;
|
|
123
|
+
}, ie(n)));
|
|
124
|
+
},
|
|
125
|
+
[b, E, a]
|
|
126
|
+
), Q = r.useCallback(
|
|
127
|
+
(e) => {
|
|
128
|
+
C.current.hoveredItemId === i ? m(e) : L((n) => ({
|
|
72
129
|
focusedItemId: e,
|
|
73
|
-
hoveredItemId:
|
|
74
|
-
tabbableItemId:
|
|
130
|
+
hoveredItemId: n.hoveredItemId,
|
|
131
|
+
tabbableItemId: _(e)
|
|
75
132
|
}));
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
133
|
+
},
|
|
134
|
+
[m]
|
|
135
|
+
), X = r.useCallback(
|
|
136
|
+
(e, t) => {
|
|
137
|
+
const n = D.current, c = S(t, n), s = C.current, d = l.current;
|
|
138
|
+
if (!c.disabled) {
|
|
139
|
+
const v = O(t), w = !c.items || c.items.length === 0;
|
|
140
|
+
v ? (m(t), w ? a(i) : d.openOnClick && s.hoveredItemId !== i && _(s.hoveredItemId) === t ? a(i) : a(t)) : w && (m(t), a(i)), T(e, t), !e.isDefaultPrevented() && c.url && window.location.assign(c.url);
|
|
81
141
|
}
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
142
|
+
},
|
|
143
|
+
[m, a, T]
|
|
144
|
+
), ee = r.useCallback(
|
|
145
|
+
(e, t) => {
|
|
146
|
+
const n = l.current;
|
|
147
|
+
n.onClose && n.onClose({
|
|
148
|
+
target: y.current,
|
|
149
|
+
item: I(e),
|
|
86
150
|
itemId: e,
|
|
87
151
|
popupCloseEvent: t
|
|
88
152
|
});
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
153
|
+
},
|
|
154
|
+
[I]
|
|
155
|
+
), te = r.useCallback(
|
|
156
|
+
(e, t) => {
|
|
157
|
+
var c;
|
|
158
|
+
const n = l.current;
|
|
159
|
+
if (E(e) && m(i), ((c = t.relatedTarget) == null ? void 0 : c.nodeName) === "LI") {
|
|
160
|
+
const s = t.relatedTarget.getAttribute("id");
|
|
161
|
+
if (s != null && s.includes(n.id))
|
|
93
162
|
return;
|
|
94
163
|
}
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
target:
|
|
99
|
-
item:
|
|
164
|
+
if (O(e) && n.onClose) {
|
|
165
|
+
const s = I(e);
|
|
166
|
+
n.onClose({
|
|
167
|
+
target: y.current,
|
|
168
|
+
item: s,
|
|
100
169
|
itemId: e
|
|
101
170
|
});
|
|
102
171
|
}
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
172
|
+
},
|
|
173
|
+
[E, m, I]
|
|
174
|
+
), V = r.useRef(o.vertical);
|
|
175
|
+
r.useEffect(() => () => {
|
|
176
|
+
b();
|
|
177
|
+
}, [b]), r.useEffect(() => (o.openOnClick && document.addEventListener("mousedown", N), () => {
|
|
178
|
+
document.removeEventListener("mousedown", N);
|
|
179
|
+
}), [o.openOnClick, N]), r.useEffect(() => {
|
|
180
|
+
const e = !!V.current != !!o.vertical, t = k.current.hasDirectionChanged();
|
|
181
|
+
(e || t) && K(), p.current.OpenOnClick = o.openOnClick, V.current = o.vertical;
|
|
182
|
+
});
|
|
183
|
+
const re = () => ce(
|
|
184
|
+
"k-reset",
|
|
185
|
+
"k-header",
|
|
186
|
+
"k-menu",
|
|
187
|
+
{ "k-menu-horizontal": !o.vertical },
|
|
188
|
+
{ "k-menu-vertical": o.vertical },
|
|
189
|
+
o.className
|
|
190
|
+
);
|
|
191
|
+
let M;
|
|
192
|
+
f.hoveredItemId ? M = f.hoveredItemId : f.focusedItemId ? M = W(f.focusedItemId) : M = i;
|
|
193
|
+
const ne = o.animate !== void 0 ? o.animate : !0;
|
|
194
|
+
return /* @__PURE__ */ r.createElement(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
id: o.id,
|
|
198
|
+
onKeyDown: Y,
|
|
199
|
+
style: o.style,
|
|
200
|
+
className: k.current.getIsDirectionRightToLeft() ? "k-rtl" : void 0,
|
|
201
|
+
ref: R
|
|
202
|
+
},
|
|
203
|
+
/* @__PURE__ */ r.createElement(
|
|
204
|
+
le,
|
|
125
205
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* @hidden
|
|
163
|
-
*/
|
|
164
|
-
componentDidMount() {
|
|
165
|
-
this.setState({ isFirstRender: !1 }), this.props.openOnClick && document.addEventListener("mousedown", this.handleClickOutside);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* @hidden
|
|
169
|
-
*/
|
|
170
|
-
componentDidUpdate(s) {
|
|
171
|
-
(!!s.vertical != !!this.props.vertical || this.directionHolder.hasDirectionChanged()) && this.reset(), this.mouseOverHandler.OpenOnClick = this.props.openOnClick, s.openOnClick !== this.props.openOnClick && (this.props.openOnClick ? document.addEventListener("mousedown", this.handleClickOutside) : document.removeEventListener("mousedown", this.handleClickOutside));
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* @hidden
|
|
175
|
-
*/
|
|
176
|
-
componentWillUnmount() {
|
|
177
|
-
this.clearItemHoverAndLeaveRequestsIfApplicable(), document.removeEventListener("mousedown", this.handleClickOutside);
|
|
178
|
-
}
|
|
179
|
-
setFocusedItemId(s) {
|
|
180
|
-
this.setState((e) => {
|
|
181
|
-
const t = s === r ? e.tabbableItemId : u(s);
|
|
182
|
-
return { hoveredItemId: s === r || m(e.hoveredItemId) && m(s) ? e.hoveredItemId : r, focusedItemId: s, tabbableItemId: t };
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
setHoveredItemId(s) {
|
|
186
|
-
this.setState((e) => m(s) && m(e.focusedItemId) ? {
|
|
187
|
-
hoveredItemId: s,
|
|
188
|
-
focusedItemId: e.focusedItemId,
|
|
189
|
-
tabbableItemId: e.tabbableItemId
|
|
190
|
-
} : { hoveredItemId: s, focusedItemId: r, tabbableItemId: g });
|
|
191
|
-
}
|
|
192
|
-
getMenuClassName() {
|
|
193
|
-
return C(
|
|
194
|
-
"k-reset",
|
|
195
|
-
"k-header",
|
|
196
|
-
"k-menu",
|
|
197
|
-
{ "k-menu-horizontal": !this.props.vertical },
|
|
198
|
-
{ "k-menu-vertical": this.props.vertical },
|
|
199
|
-
this.props.className
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
clearItemHoverAndLeaveRequestsIfApplicable() {
|
|
203
|
-
this.itemHoverRequest && (clearTimeout(this.itemHoverRequest), this.itemHoverRequest = null), this.itemLeaveRequest && (clearTimeout(this.itemLeaveRequest), this.itemLeaveRequest = null);
|
|
204
|
-
}
|
|
205
|
-
isItemWithDefaultClose(s) {
|
|
206
|
-
return !this.props.customCloseItemIds || this.props.customCloseItemIds.indexOf(s) === -1;
|
|
207
|
-
}
|
|
208
|
-
checkIsDirectionRightToLeft() {
|
|
209
|
-
return !!(this.props.dir !== void 0 ? this.props.dir === "rtl" : this.menuWrapperEl && getComputedStyle(this.menuWrapperEl).direction === "rtl");
|
|
210
|
-
}
|
|
211
|
-
prepareItems() {
|
|
212
|
-
const { items: s, inputItems: e } = O(this.props.items, this.props.children);
|
|
213
|
-
this.items = s, this.inputItems = e;
|
|
214
|
-
}
|
|
215
|
-
dispatchSelectEventIfWired(s, e) {
|
|
216
|
-
k(this.props.onSelect, s, this, { item: this.getInputItem(e), itemId: e });
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
h.propTypes = {
|
|
220
|
-
vertical: o.bool,
|
|
221
|
-
items: o.arrayOf(o.object),
|
|
222
|
-
style: o.object,
|
|
223
|
-
animate: o.oneOfType([
|
|
224
|
-
o.bool,
|
|
225
|
-
o.shape({
|
|
226
|
-
openDuration: o.number,
|
|
227
|
-
closeDuration: o.number
|
|
206
|
+
className: re(),
|
|
207
|
+
"aria-orientation": o.vertical ? "vertical" : void 0,
|
|
208
|
+
items: D.current,
|
|
209
|
+
animate: ne,
|
|
210
|
+
isMenuVertical: o.vertical,
|
|
211
|
+
isDirectionRightToLeft: k.current.getIsDirectionRightToLeft(),
|
|
212
|
+
focusedItemId: f.focusedItemId,
|
|
213
|
+
lastItemIdToBeOpened: M,
|
|
214
|
+
tabbableItemId: f.tabbableItemId,
|
|
215
|
+
itemRender: o.itemRender,
|
|
216
|
+
linkRender: o.linkRender,
|
|
217
|
+
menuGuid: o.id,
|
|
218
|
+
onMouseLeave: J,
|
|
219
|
+
onMouseOver: $,
|
|
220
|
+
onFocus: Q,
|
|
221
|
+
onClick: X,
|
|
222
|
+
onBlur: te,
|
|
223
|
+
onOriginalItemNeeded: I,
|
|
224
|
+
onPopupClose: ee,
|
|
225
|
+
role: o.role
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
);
|
|
229
|
+
});
|
|
230
|
+
j.propTypes = {
|
|
231
|
+
vertical: u.bool,
|
|
232
|
+
items: u.arrayOf(u.object),
|
|
233
|
+
style: u.object,
|
|
234
|
+
animate: u.oneOfType([
|
|
235
|
+
u.bool,
|
|
236
|
+
u.shape({
|
|
237
|
+
openDuration: u.number,
|
|
238
|
+
closeDuration: u.number
|
|
228
239
|
})
|
|
229
240
|
]),
|
|
230
|
-
dir:
|
|
231
|
-
hoverOpenDelay:
|
|
232
|
-
hoverCloseDelay:
|
|
233
|
-
openOnClick:
|
|
234
|
-
itemRender:
|
|
235
|
-
linkRender:
|
|
236
|
-
customCloseItemIds:
|
|
237
|
-
onSelect:
|
|
238
|
-
onClose:
|
|
239
|
-
role:
|
|
240
|
-
}
|
|
241
|
-
|
|
241
|
+
dir: u.string,
|
|
242
|
+
hoverOpenDelay: u.number,
|
|
243
|
+
hoverCloseDelay: u.number,
|
|
244
|
+
openOnClick: u.bool,
|
|
245
|
+
itemRender: u.any,
|
|
246
|
+
linkRender: u.any,
|
|
247
|
+
customCloseItemIds: u.arrayOf(u.string),
|
|
248
|
+
onSelect: u.func,
|
|
249
|
+
onClose: u.func,
|
|
250
|
+
role: u.string
|
|
251
|
+
};
|
|
252
|
+
j.displayName = "Menu";
|
|
242
253
|
export {
|
|
243
|
-
|
|
254
|
+
j as Menu
|
|
244
255
|
};
|
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { BaseMenuItem } from '../models/BaseMenuItem.js';
|
|
10
|
-
import * as React from 'react';
|
|
8
|
+
import { BaseMenuItem } from '../models/BaseMenuItem';
|
|
11
9
|
/**
|
|
12
10
|
* The properties of the KendoReact MenuItem component ([more information and examples](https://www.telerik.com/kendo-react-ui/components/layout/menu/items/items)).
|
|
13
11
|
*/
|
|
@@ -19,25 +17,7 @@ export interface MenuItemProps extends BaseMenuItem {
|
|
|
19
17
|
* @remarks
|
|
20
18
|
* Supported children components are: {@link MenuItem}.
|
|
21
19
|
*/
|
|
22
|
-
export declare
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
static propTypes: {
|
|
27
|
-
text: PropTypes.Requireable<string>;
|
|
28
|
-
url: PropTypes.Requireable<string>;
|
|
29
|
-
icon: PropTypes.Requireable<string>;
|
|
30
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
31
|
-
cssClass: PropTypes.Requireable<string>;
|
|
32
|
-
cssStyle: PropTypes.Requireable<object>;
|
|
33
|
-
render: PropTypes.Requireable<any>;
|
|
34
|
-
linkRender: PropTypes.Requireable<any>;
|
|
35
|
-
contentRender: PropTypes.Requireable<any>;
|
|
36
|
-
data: PropTypes.Requireable<any>;
|
|
37
|
-
separator: PropTypes.Requireable<boolean>;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
render(): null;
|
|
43
|
-
}
|
|
20
|
+
export declare const MenuItem: {
|
|
21
|
+
(_props: MenuItemProps): null;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
@@ -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"),n=t=>null;n.propTypes={text:e.string,url:e.string,icon:e.string,disabled:e.bool,cssClass:e.string,cssStyle:e.object,render:e.any,linkRender:e.any,contentRender:e.any,data:e.any,separator:e.bool};n.displayName="MenuItem";exports.MenuItem=n;
|
|
@@ -5,30 +5,22 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
import e from "prop-types";
|
|
9
|
+
const n = (r) => null;
|
|
10
|
+
n.propTypes = {
|
|
11
|
+
text: e.string,
|
|
12
|
+
url: e.string,
|
|
13
|
+
icon: e.string,
|
|
14
|
+
disabled: e.bool,
|
|
15
|
+
cssClass: e.string,
|
|
16
|
+
cssStyle: e.object,
|
|
17
|
+
render: e.any,
|
|
18
|
+
linkRender: e.any,
|
|
19
|
+
contentRender: e.any,
|
|
20
|
+
data: e.any,
|
|
21
|
+
separator: e.bool
|
|
17
22
|
};
|
|
18
|
-
|
|
19
|
-
text: r.string,
|
|
20
|
-
url: r.string,
|
|
21
|
-
icon: r.string,
|
|
22
|
-
disabled: r.bool,
|
|
23
|
-
cssClass: r.string,
|
|
24
|
-
cssStyle: r.object,
|
|
25
|
-
render: r.any,
|
|
26
|
-
linkRender: r.any,
|
|
27
|
-
contentRender: r.any,
|
|
28
|
-
data: r.any,
|
|
29
|
-
separator: r.bool
|
|
30
|
-
};
|
|
31
|
-
let t = s;
|
|
23
|
+
n.displayName = "MenuItem";
|
|
32
24
|
export {
|
|
33
|
-
|
|
25
|
+
n as MenuItem
|
|
34
26
|
};
|
|
@@ -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 properties of the KendoReact MenuItemArrow component.
|
|
@@ -36,18 +35,4 @@ export declare const rightArrowName = "caret-alt-right";
|
|
|
36
35
|
* @hidden
|
|
37
36
|
*/
|
|
38
37
|
export declare const leftArrowName = "caret-alt-left";
|
|
39
|
-
export declare
|
|
40
|
-
/**
|
|
41
|
-
* @hidden
|
|
42
|
-
*/
|
|
43
|
-
static propTypes: {
|
|
44
|
-
itemId: PropTypes.Requireable<string>;
|
|
45
|
-
dir: PropTypes.Requireable<string>;
|
|
46
|
-
verticalMenu: PropTypes.Requireable<boolean>;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
render(): React.JSX.Element;
|
|
52
|
-
private getIcon;
|
|
53
|
-
}
|
|
38
|
+
export declare const MenuItemArrow: (props: MenuItemArrowProps) => React.JSX.Element;
|
|
@@ -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 u=require("react"),n=require("prop-types"),d=require("@progress/kendo-react-common"),o=require("@progress/kendo-svg-icons"),m=require("../utils/misc.js");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const g=w(u),a="caret-alt-down",i="caret-alt-right",l="caret-alt-left",f=e=>{switch(m.getChildrenPosition(e.itemId,e.verticalMenu===!0,e.dir==="rtl")){case"downward":return{name:a,icon:o.caretAltDownIcon};case"rightward":return{name:i,icon:o.caretAltRightIcon};case"leftward":return{name:l,icon:o.caretAltLeftIcon};default:return{}}},s=e=>g.createElement(d.IconWrap,{"aria-hidden":!0,...f(e)});s.propTypes={itemId:n.string,dir:n.string,verticalMenu:n.bool};exports.MenuItemArrow=s;exports.downArrowName=a;exports.leftArrowName=l;exports.rightArrowName=i;
|