@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.
Files changed (75) hide show
  1. package/actionsheet/ActionSheet.d.ts +1 -1
  2. package/actionsheet/ActionSheetContent.d.ts +1 -1
  3. package/actionsheet/ActionSheetFooter.d.ts +1 -1
  4. package/actionsheet/ActionSheetHeader.d.ts +1 -1
  5. package/actionsheet/ActionSheetItem.d.ts +1 -1
  6. package/appbar/AppBar.d.ts +1 -1
  7. package/appbar/AppBarSection.d.ts +1 -1
  8. package/appbar/AppBarSpacer.d.ts +1 -1
  9. package/bottomnavigation/BottomNavigation.d.ts +1 -1
  10. package/bottomnavigation/BottomNavigationProps.d.ts +2 -2
  11. package/card/Avatar.d.ts +1 -1
  12. package/card/Card.d.ts +2 -2
  13. package/card/CardActions.d.ts +1 -1
  14. package/card/CardBody.d.ts +1 -1
  15. package/card/CardFooter.d.ts +1 -1
  16. package/card/CardHeader.d.ts +1 -1
  17. package/card/CardImage.d.ts +1 -1
  18. package/card/CardSubtitle.d.ts +1 -1
  19. package/card/CardTitle.d.ts +1 -1
  20. package/card/interfaces/CardHandle.d.ts +1 -1
  21. package/contextmenu/ContextMenu.d.ts +2 -2
  22. package/dist/cdn/js/kendo-react-layout.js +1 -1
  23. package/drawer/Drawer.d.ts +1 -1
  24. package/drawer/DrawerContent.d.ts +1 -1
  25. package/drawer/DrawerItem.d.ts +2 -2
  26. package/drawer/DrawerNavigation.d.ts +1 -1
  27. package/drawer/context/DrawerContext.d.ts +2 -2
  28. package/drawer/interfaces/DrawerProps.d.ts +3 -3
  29. package/expansionpanel/ExpansionPanel.d.ts +1 -1
  30. package/expansionpanel/index.d.ts +1 -1
  31. package/gridlayout/GridLayout.d.ts +1 -1
  32. package/gridlayout/GridLayoutItem.d.ts +1 -1
  33. package/gridlayout/interfaces/GridLayoutProps.d.ts +2 -2
  34. package/index.d.mts +39 -39
  35. package/index.d.ts +39 -39
  36. package/menu/MenuProps.d.ts +2 -2
  37. package/menu/components/Menu.d.ts +15 -94
  38. package/menu/components/Menu.js +1 -1
  39. package/menu/components/Menu.mjs +223 -212
  40. package/menu/components/MenuItem.d.ts +5 -25
  41. package/menu/components/MenuItem.js +1 -1
  42. package/menu/components/MenuItem.mjs +16 -24
  43. package/menu/components/MenuItemArrow.d.ts +1 -16
  44. package/menu/components/MenuItemArrow.js +1 -1
  45. package/menu/components/MenuItemArrow.mjs +26 -35
  46. package/menu/components/MenuItemInternal.d.ts +4 -37
  47. package/menu/components/MenuItemInternal.js +1 -1
  48. package/menu/components/MenuItemInternal.mjs +174 -219
  49. package/menu/components/MenuItemLink.d.ts +1 -15
  50. package/menu/components/MenuItemLink.js +1 -1
  51. package/menu/components/MenuItemLink.mjs +17 -30
  52. package/menu/events.d.ts +5 -5
  53. package/menu/models/MenuItemModel.d.ts +1 -1
  54. package/menu/utils/DirectionHolder.js +1 -1
  55. package/menu/utils/DirectionHolder.mjs +1 -1
  56. package/menu/utils/getNewItemIdUponKeyboardNavigation.d.ts +1 -1
  57. package/menu/utils/hoverDelay.d.ts +1 -1
  58. package/menu/utils/prepareInputItemsForInternalWork.d.ts +1 -1
  59. package/package-metadata.js +1 -1
  60. package/package-metadata.mjs +2 -2
  61. package/package.json +8 -8
  62. package/panelbar/PanelBarItem.d.ts +1 -1
  63. package/panelbar/interfaces/PanelBarItemHandle.d.ts +1 -1
  64. package/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +1 -1
  65. package/panelbar/util.d.ts +2 -2
  66. package/stacklayout/StackLayout.d.ts +1 -1
  67. package/stepper/Step.d.ts +2 -2
  68. package/stepper/Stepper.d.ts +2 -2
  69. package/stepper/context/StepperContext.d.ts +3 -3
  70. package/stepper/interfaces/StepChangeEvent.d.ts +1 -1
  71. package/stepper/interfaces/StepFocusEvent.d.ts +1 -1
  72. package/stepper/interfaces/StepperChangeEvent.d.ts +1 -1
  73. package/stepper/interfaces/StepperFocusEvent.d.ts +1 -1
  74. package/stepper/interfaces/StepperOnNavigateEvent.d.ts +1 -1
  75. package/stepper/interfaces/StepperProps.d.ts +3 -3
@@ -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 p from "react";
9
- import o from "prop-types";
10
- import { Keys as I, classNames as C, dispatchEvent as k } from "@progress/kendo-react-common";
11
- import { ZERO_LEVEL_ZERO_ITEM_ID as g, EMPTY_ID as r, getItemById as l, isIdZeroLevel as d, getDirectParentId as c, getRootParentId as u, isIdEmptyOrZeroLevel as m } from "../utils/itemsIdsUtils.mjs";
12
- import { prepareInputItemsForInternalWork as O } from "../utils/prepareInputItemsForInternalWork.mjs";
13
- import { getNewItemIdUponKeyboardNavigation as f } from "../utils/getNewItemIdUponKeyboardNavigation.mjs";
14
- import { getHoverOpenDelay as H, getHoverCloseDelay as R } from "../utils/hoverDelay.mjs";
15
- import { MenuItemInternalsList as L } from "./MenuItemInternal.mjs";
16
- import { DirectionHolder as y } from "../utils/DirectionHolder.mjs";
17
- import { MouseOverHandler as D } from "../utils/MouseOverHandler.mjs";
18
- const v = {
19
- focusedItemId: r,
20
- hoveredItemId: r,
21
- tabbableItemId: g
22
- }, h = class h extends p.Component {
23
- constructor(s) {
24
- super(s), this.menuWrapperEl = null, this.directionHolder = new y(), this.inputItems = [], this.items = [], this.reset = () => {
25
- this.clearItemHoverAndLeaveRequestsIfApplicable(), this.setState(v);
26
- }, this.handleClickOutside = (e) => {
27
- var t;
28
- if (this.props.openOnClick && this.state.hoveredItemId !== r) {
29
- const i = e.target;
30
- this.menuWrapperEl && !this.menuWrapperEl.contains(i) && (this.menuItemId && ((t = i.closest) != null && t.call(i, `[id^="${this.menuItemId}_"]`)) || this.setHoveredItemId(r));
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
- }, this.onKeyDown = (e) => {
33
- if (this.state.focusedItemId !== r) {
34
- const t = l(this.state.focusedItemId, this.items);
35
- let i = f(
36
- this.items,
37
- t.id,
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
- this.props.vertical,
41
- this.directionHolder.getIsDirectionRightToLeft()
88
+ n.vertical,
89
+ k.current.getIsDirectionRightToLeft()
42
90
  );
43
- const n = l(i, this.items);
44
- if (n && n.separator && (i = f(
45
- this.items,
46
- i,
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
- this.props.vertical,
50
- this.directionHolder.getIsDirectionRightToLeft()
51
- )), t.id !== i && (e.preventDefault(), this.setFocusedItemId(i)), (e.keyCode === I.enter || e.keyCode === I.space) && !t.disabled && (this.mouseOverHandler.handleItemSelectedViaKeyboard(), this.dispatchSelectEventIfWired(e, t.id), !e.isDefaultPrevented() && t.items.length === 0 && t.url && window.location.assign(t.url)), e.keyCode === I.esc && d(t.id) && this.props.onClose) {
52
- const a = this.getInputItem(t.id);
53
- this.props.onClose({
54
- target: this,
55
- item: a,
56
- itemId: t.id
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
- }, this.onItemMouseOver = (e) => {
61
- const t = this.props.openOnClick && !d(e) && this.state.hoveredItemId !== r;
62
- (this.mouseOverHandler.IsMouseOverEnabled || t) && (this.clearItemHoverAndLeaveRequestsIfApplicable(), this.itemHoverRequest = window.setTimeout(() => {
63
- this.setHoveredItemId(e), this.itemHoverRequest = null;
64
- }, H(this.props)));
65
- }, this.onItemMouseLeave = (e) => {
66
- const t = this.props.openOnClick && !d(e) && this.state.hoveredItemId !== r;
67
- (this.mouseOverHandler.IsMouseOverEnabled || t) && this.isItemWithDefaultClose(e) && (this.clearItemHoverAndLeaveRequestsIfApplicable(), this.itemLeaveRequest = window.setTimeout(() => {
68
- t ? this.setHoveredItemId(c(e)) : this.setHoveredItemId(r), this.itemLeaveRequest = null;
69
- }, R(this.props)));
70
- }, this.onItemFocus = (e) => {
71
- this.state.hoveredItemId === r ? this.setFocusedItemId(e) : this.setState((t) => ({
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: t.hoveredItemId,
74
- tabbableItemId: u(e)
130
+ hoveredItemId: n.hoveredItemId,
131
+ tabbableItemId: _(e)
75
132
  }));
76
- }, this.onItemClick = (e, t) => {
77
- const i = l(t, this.items);
78
- if (!i.disabled) {
79
- const n = d(t), a = !i.items || i.items.length === 0;
80
- n ? (this.setFocusedItemId(t), a ? this.setHoveredItemId(r) : this.props.openOnClick && this.state.hoveredItemId !== r && u(this.state.hoveredItemId) === t ? this.setHoveredItemId(r) : this.setHoveredItemId(t)) : a && (this.setFocusedItemId(t), this.setHoveredItemId(r)), this.dispatchSelectEventIfWired(e, t), !e.isDefaultPrevented() && i.url && window.location.assign(i.url);
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
- }, this.onPopupClose = (e, t) => {
83
- this.props.onClose && this.props.onClose({
84
- target: this,
85
- item: this.getInputItem(e),
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
- }, this.onItemBlur = (e, t) => {
90
- if (this.isItemWithDefaultClose(e) && this.setFocusedItemId(r), t.relatedTarget && t.relatedTarget.nodeName === "LI") {
91
- const i = t.relatedTarget.getAttribute("id");
92
- if (i && i.includes(this.menuItemId))
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 (d(e) && this.props.onClose) {
96
- const i = this.getInputItem(e);
97
- this.props.onClose({
98
- target: this,
99
- item: i,
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
- }, this.getInputItem = (e) => l(e, this.inputItems), this.mouseOverHandler = new D(this.props.openOnClick, this.reset), this.state = Object.assign({}, v, { isFirstRender: !0 });
104
- }
105
- get menuItemId() {
106
- return this.props.id;
107
- }
108
- /**
109
- * The current element or `null` if there is no one.
110
- */
111
- get element() {
112
- return this.menuWrapperEl;
113
- }
114
- get animate() {
115
- return this.props.animate !== void 0 ? this.props.animate : h.defaultProps.animate;
116
- }
117
- /**
118
- * @hidden
119
- */
120
- render() {
121
- this.prepareItems(), this.state.isFirstRender || this.directionHolder.setIsDirectionRightToLeft(this.checkIsDirectionRightToLeft());
122
- const s = this.state.hoveredItemId ? this.state.hoveredItemId : this.state.focusedItemId ? c(this.state.focusedItemId) : r;
123
- return /* @__PURE__ */ p.createElement(
124
- "div",
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
- id: this.props.id,
127
- onKeyDown: this.onKeyDown,
128
- style: this.props.style,
129
- className: this.directionHolder.getIsDirectionRightToLeft() ? "k-rtl" : void 0,
130
- ref: (e) => {
131
- this.menuWrapperEl = e;
132
- }
133
- },
134
- /* @__PURE__ */ p.createElement(
135
- L,
136
- {
137
- className: this.getMenuClassName(),
138
- "aria-orientation": this.props.vertical ? "vertical" : void 0,
139
- items: this.items,
140
- animate: this.animate,
141
- isMenuVertical: this.props.vertical,
142
- isDirectionRightToLeft: this.directionHolder.getIsDirectionRightToLeft(),
143
- focusedItemId: this.state.focusedItemId,
144
- lastItemIdToBeOpened: s,
145
- tabbableItemId: this.state.tabbableItemId,
146
- itemRender: this.props.itemRender,
147
- linkRender: this.props.linkRender,
148
- menuGuid: this.menuItemId,
149
- onMouseLeave: this.onItemMouseLeave,
150
- onMouseOver: this.onItemMouseOver,
151
- onFocus: this.onItemFocus,
152
- onClick: this.onItemClick,
153
- onBlur: this.onItemBlur,
154
- onOriginalItemNeeded: this.getInputItem,
155
- onPopupClose: this.onPopupClose,
156
- role: this.props.role
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: o.string,
231
- hoverOpenDelay: o.number,
232
- hoverCloseDelay: o.number,
233
- openOnClick: o.bool,
234
- itemRender: o.any,
235
- linkRender: o.any,
236
- customCloseItemIds: o.arrayOf(o.string),
237
- onSelect: o.func,
238
- onClose: o.func,
239
- role: o.string
240
- }, h.defaultProps = { vertical: !1, animate: !0 };
241
- let b = h;
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
- b as Menu
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 { default as PropTypes } from 'prop-types';
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 class MenuItem extends React.Component<MenuItemProps, {}> {
23
- /**
24
- * @hidden
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 c=require("react"),e=require("prop-types");function i(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const l=i(c),s=class s extends l.Component{render(){return null}};s.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};let o=s;exports.MenuItem=o;
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 * as n from "react";
9
- import r from "prop-types";
10
- const s = class s extends n.Component {
11
- /**
12
- * @hidden
13
- */
14
- render() {
15
- return null;
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
- s.propTypes = {
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
- t as MenuItem
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 class MenuItemArrow extends React.Component<MenuItemArrowProps, {}> {
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 m=require("react"),n=require("prop-types"),p=require("@progress/kendo-react-common"),o=require("@progress/kendo-svg-icons"),g=require("../utils/misc.js");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=f(m),l="caret-alt-down",d="caret-alt-right",u="caret-alt-left",i=class i extends s.Component{render(){return s.createElement(p.IconWrap,{"aria-hidden":!0,...this.getIcon()})}getIcon(){switch(g.getChildrenPosition(this.props.itemId,this.props.verticalMenu===!0,this.props.dir==="rtl")){case"downward":return{name:l,icon:o.caretAltDownIcon};case"rightward":return{name:d,icon:o.caretAltRightIcon};case"leftward":return{name:u,icon:o.caretAltLeftIcon};default:return{}}}};i.propTypes={itemId:n.string,dir:n.string,verticalMenu:n.bool};let c=i;exports.MenuItemArrow=c;exports.downArrowName=l;exports.leftArrowName=u;exports.rightArrowName=d;
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;