@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
|
@@ -6,43 +6,34 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import
|
|
10
|
-
import { IconWrap as
|
|
11
|
-
import { caretAltLeftIcon as
|
|
12
|
-
import { getChildrenPosition as
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
import r from "prop-types";
|
|
10
|
+
import { IconWrap as o } from "@progress/kendo-react-common";
|
|
11
|
+
import { caretAltLeftIcon as n, caretAltRightIcon as i, caretAltDownIcon as a } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { getChildrenPosition as c } from "../utils/misc.mjs";
|
|
13
|
+
const m = "caret-alt-down", l = "caret-alt-right", d = "caret-alt-left", s = (t) => {
|
|
14
|
+
switch (c(
|
|
15
|
+
t.itemId,
|
|
16
|
+
t.verticalMenu === !0,
|
|
17
|
+
t.dir === "rtl"
|
|
18
|
+
)) {
|
|
19
|
+
case "downward":
|
|
20
|
+
return { name: m, icon: a };
|
|
21
|
+
case "rightward":
|
|
22
|
+
return { name: l, icon: i };
|
|
23
|
+
case "leftward":
|
|
24
|
+
return { name: d, icon: n };
|
|
25
|
+
default:
|
|
26
|
+
return {};
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)) {
|
|
26
|
-
case "downward":
|
|
27
|
-
return { name: l, icon: c };
|
|
28
|
-
case "rightward":
|
|
29
|
-
return { name: p, icon: a };
|
|
30
|
-
case "leftward":
|
|
31
|
-
return { name: d, icon: i };
|
|
32
|
-
default:
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
r.propTypes = {
|
|
38
|
-
itemId: t.string,
|
|
39
|
-
dir: t.string,
|
|
40
|
-
verticalMenu: t.bool
|
|
28
|
+
}, w = (t) => /* @__PURE__ */ e.createElement(o, { "aria-hidden": !0, ...s(t) });
|
|
29
|
+
w.propTypes = {
|
|
30
|
+
itemId: r.string,
|
|
31
|
+
dir: r.string,
|
|
32
|
+
verticalMenu: r.bool
|
|
41
33
|
};
|
|
42
|
-
let o = r;
|
|
43
34
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
w as MenuItemArrow,
|
|
36
|
+
m as downArrowName,
|
|
46
37
|
d as leftArrowName,
|
|
47
|
-
|
|
38
|
+
l as rightArrowName
|
|
48
39
|
};
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { MenuItemInternalModel } from '../models/MenuItemModel
|
|
8
|
+
import { MenuItemInternalModel } from '../models/MenuItemModel';
|
|
9
9
|
import { PopupAnimation } from '@progress/kendo-react-popup';
|
|
10
|
-
import { BaseMenuItemInternalProps } from './../BaseMenuItemInternalProps
|
|
10
|
+
import { BaseMenuItemInternalProps } from './../BaseMenuItemInternalProps';
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
@@ -23,12 +23,7 @@ export interface MenuItemInternalsListProps extends BaseMenuItemInternalProps {
|
|
|
23
23
|
/**
|
|
24
24
|
* @hidden
|
|
25
25
|
*/
|
|
26
|
-
export declare
|
|
27
|
-
render(): React.JSX.Element;
|
|
28
|
-
private renderChildItems;
|
|
29
|
-
private onMouseOver;
|
|
30
|
-
private onMouseLeave;
|
|
31
|
-
}
|
|
26
|
+
export declare const MenuItemInternalsList: (props: MenuItemInternalsListProps) => React.JSX.Element;
|
|
32
27
|
/**
|
|
33
28
|
* @hidden
|
|
34
29
|
*/
|
|
@@ -39,32 +34,4 @@ export interface MenuItemInternalProps extends BaseMenuItemInternalProps {
|
|
|
39
34
|
/**
|
|
40
35
|
* @hidden
|
|
41
36
|
*/
|
|
42
|
-
export
|
|
43
|
-
opened: boolean;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @hidden
|
|
47
|
-
*/
|
|
48
|
-
export declare class MenuItemInternal extends React.Component<MenuItemInternalProps, MenuItemInternalState> {
|
|
49
|
-
readonly state: MenuItemInternalState;
|
|
50
|
-
private itemElement;
|
|
51
|
-
private isFirstRender;
|
|
52
|
-
constructor(props: MenuItemInternalProps);
|
|
53
|
-
componentDidMount(): void;
|
|
54
|
-
componentDidUpdate(prevProps: MenuItemInternalProps): void;
|
|
55
|
-
render(): React.JSX.Element;
|
|
56
|
-
private renderContent;
|
|
57
|
-
private renderMenuItemLink;
|
|
58
|
-
private renderPopupIfOpened;
|
|
59
|
-
private renderMenuIconIfApplicable;
|
|
60
|
-
private renderArrowIfApplicable;
|
|
61
|
-
private onMouseOver;
|
|
62
|
-
private onMouseLeave;
|
|
63
|
-
private get itemRender();
|
|
64
|
-
private onPopupClose;
|
|
65
|
-
private get linkRender();
|
|
66
|
-
private get contentRender();
|
|
67
|
-
private get Opened();
|
|
68
|
-
private getPopupClassName;
|
|
69
|
-
private getMenuItemClassName;
|
|
70
|
-
}
|
|
37
|
+
export declare const MenuItemInternal: (props: MenuItemInternalProps) => 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 F=require("react"),k=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-popup"),M=require("../utils/itemsIdsUtils.js"),f=require("../utils/misc.js"),q=require("./MenuItemLink.js"),x=require("./MenuItemArrow.js");function w(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const i=w(F),b=e=>{const{parentItemId:o}=e,r=o!==void 0?a=>{e.onMouseOver(o),a.stopPropagation()}:void 0,l=o!==void 0?a=>{e.onMouseLeave(o),a.stopPropagation()}:void 0;let t;return e.role?t=e.role:o!==void 0?t="menu":t="menubar",i.createElement("ul",{className:e.className,role:t,id:o!==void 0?f.getDOMElementId(e.menuGuid,o):void 0,onMouseOver:r,onMouseLeave:l,"aria-orientation":e["aria-orientation"]},e.items.length>0?e.items.map((a,u)=>i.createElement(O,{item:a,animate:e.animate,isMenuVertical:e.isMenuVertical,isDirectionRightToLeft:e.isDirectionRightToLeft,focusedItemId:e.focusedItemId,lastItemIdToBeOpened:e.lastItemIdToBeOpened,tabbableItemId:e.tabbableItemId,itemRender:e.itemRender,linkRender:e.linkRender,menuGuid:e.menuGuid,onMouseOver:e.onMouseOver,onMouseLeave:e.onMouseLeave,onBlur:e.onBlur,onFocus:e.onFocus,onClick:e.onClick,onOriginalItemNeeded:e.onOriginalItemNeeded,onPopupClose:e.onPopupClose,key:u})):null)},O=e=>{const o=i.useRef(null),r=i.useRef(!0),l=i.useRef(void 0),t=e.item,a=t.id,u=f.getDOMElementId(e.menuGuid,a),L=t.separator,E=t.render||e.itemRender,v=t.linkRender||e.linkRender,R=t.contentParentItemId?t.contentRender:null,m=t.items.length>0&&M.shouldOpenItem(a,e.lastItemIdToBeOpened)&&!r.current;i.useEffect(()=>{var g,I,d;const n=e.focusedItemId,c=e.item.id,s=l.current;if(r.current)n&&n===c&&((g=o.current)==null||g.focus({preventScroll:!0})),r.current=!1;else if(n){const B=k.getActiveElement(document);s!==n&&n===c&&!((I=o.current)!=null&&I.contains(B))&&((d=o.current)==null||d.focus({preventScroll:!0}))}l.current=n});const D=n=>{e.onMouseOver(a),n.stopPropagation()},h=n=>{e.onMouseLeave(a),n.stopPropagation()},P=n=>{e.onPopupClose(a,n)},C=()=>{const n=t.contentParentItemId,c=R;return i.createElement("div",{className:"k-content",role:"presentation"},i.createElement(c,{item:e.onOriginalItemNeeded(n),itemId:n}))},N=()=>{if(v){const s=v;return i.createElement(s,{item:e.onOriginalItemNeeded(t.id),itemId:t.id,opened:m,dir:f.convertBoolDirectionToString(e.isDirectionRightToLeft)})}const n=E,c=n?i.createElement(n,{item:e.onOriginalItemNeeded(t.id),itemId:t.id,key:"1"}):i.createElement("span",{className:"k-menu-link-text"},t.text);return i.createElement(q.MenuItemLink,{url:t.url,opened:m},t.icon||t.svgIcon?i.createElement(k.IconWrap,{name:t.icon,icon:t.svgIcon,key:"0"}):null,c,t.items.length>0?i.createElement("span",{className:"k-menu-expand-arrow","aria-hidden":!0},i.createElement(x.MenuItemArrow,{itemId:t.id,verticalMenu:e.isMenuVertical,dir:f.convertBoolDirectionToString(e.isDirectionRightToLeft),key:"2"})):null)},T=()=>{const n=e.animate,{anchorAlign:c,popupAlign:s,collision:g,animationDirection:I}=f.getPopupSettings(a,e.isMenuVertical,e.isDirectionRightToLeft);let d;return n===!0?d={openDuration:300,closeDuration:300,direction:I}:n===!1?d=!1:d={openDuration:(n==null?void 0:n.openDuration)||300,closeDuration:(n==null?void 0:n.closeDuration)||300,direction:(n==null?void 0:n.direction)||I},i.createElement(S.Popup,{anchor:o.current,show:m,popupClass:k.classNames("k-menu-popup",{"k-rtl":e.isDirectionRightToLeft}),anchorAlign:c,popupAlign:s,collision:g,animate:d,onClose:P,key:"1"},i.createElement(b,{parentItemId:a,animate:e.animate,items:t.items,menuGuid:e.menuGuid,focusedItemId:e.focusedItemId,lastItemIdToBeOpened:e.lastItemIdToBeOpened,tabbableItemId:e.tabbableItemId,itemRender:e.itemRender,linkRender:e.linkRender,isMenuVertical:e.isMenuVertical,isDirectionRightToLeft:e.isDirectionRightToLeft,className:"k-group k-menu-group k-reset k-menu-group-md",onMouseOver:e.onMouseOver,onMouseLeave:e.onMouseLeave,onBlur:e.onBlur,onFocus:e.onFocus,onClick:e.onClick,onOriginalItemNeeded:e.onOriginalItemNeeded,onPopupClose:e.onPopupClose}))},y=k.classNames("k-item","k-menu-item",{"k-first":M.isFirstItemFromSiblings(a),"k-last":t.isLastFromSiblings,"k-disabled":t.disabled},t.cssClass);return i.createElement(i.Fragment,null,L?i.createElement("li",{className:"k-separator k-item","aria-hidden":!0,key:u,id:u,ref:o}):i.createElement("li",{id:u,className:y,style:t.cssStyle,tabIndex:a===e.tabbableItemId?0:-1,onMouseOver:D,onMouseLeave:h,onBlur:n=>e.onBlur(a,n),onFocus:()=>e.onFocus(a),onClick:n=>e.onClick(n,a),role:"menuitem","aria-disabled":t.disabled?!0:void 0,"aria-haspopup":t.items.length>0?!0:void 0,"aria-expanded":t.items.length>0?m:void 0,"aria-label":t.text,"aria-owns":m?u:void 0,ref:o,key:u},R?C():N()),T())};exports.MenuItemInternal=O;exports.MenuItemInternalsList=b;
|
|
@@ -5,240 +5,195 @@
|
|
|
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 { getActiveElement as
|
|
10
|
-
import { Popup as
|
|
11
|
-
import { shouldOpenItem as
|
|
12
|
-
import { getDOMElementId as
|
|
13
|
-
import { MenuItemLink as
|
|
14
|
-
import { MenuItemArrow as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
import * as i from "react";
|
|
9
|
+
import { getActiveElement as F, classNames as v, IconWrap as B } from "@progress/kendo-react-common";
|
|
10
|
+
import { Popup as y } from "@progress/kendo-react-popup";
|
|
11
|
+
import { shouldOpenItem as x, isFirstItemFromSiblings as S } from "../utils/itemsIdsUtils.mjs";
|
|
12
|
+
import { getDOMElementId as M, convertBoolDirectionToString as R, getPopupSettings as G } from "../utils/misc.mjs";
|
|
13
|
+
import { MenuItemLink as V } from "./MenuItemLink.mjs";
|
|
14
|
+
import { MenuItemArrow as w } from "./MenuItemArrow.mjs";
|
|
15
|
+
const A = (e) => {
|
|
16
|
+
const { parentItemId: a } = e, c = a !== void 0 ? (o) => {
|
|
17
|
+
e.onMouseOver(a), o.stopPropagation();
|
|
18
|
+
} : void 0, I = a !== void 0 ? (o) => {
|
|
19
|
+
e.onMouseLeave(a), o.stopPropagation();
|
|
20
|
+
} : void 0;
|
|
21
|
+
let t;
|
|
22
|
+
return e.role ? t = e.role : a !== void 0 ? t = "menu" : t = "menubar", /* @__PURE__ */ i.createElement(
|
|
23
|
+
"ul",
|
|
24
|
+
{
|
|
25
|
+
className: e.className,
|
|
26
|
+
role: t,
|
|
27
|
+
id: a !== void 0 ? M(e.menuGuid, a) : void 0,
|
|
28
|
+
onMouseOver: c,
|
|
29
|
+
onMouseLeave: I,
|
|
30
|
+
"aria-orientation": e["aria-orientation"]
|
|
31
|
+
},
|
|
32
|
+
e.items.length > 0 ? e.items.map((o, l) => /* @__PURE__ */ i.createElement(
|
|
33
|
+
W,
|
|
27
34
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
focusedItemId: this.props.focusedItemId,
|
|
47
|
-
lastItemIdToBeOpened: this.props.lastItemIdToBeOpened,
|
|
48
|
-
tabbableItemId: this.props.tabbableItemId,
|
|
49
|
-
itemRender: this.props.itemRender,
|
|
50
|
-
linkRender: this.props.linkRender,
|
|
51
|
-
menuGuid: this.props.menuGuid,
|
|
52
|
-
onMouseOver: this.props.onMouseOver,
|
|
53
|
-
onMouseLeave: this.props.onMouseLeave,
|
|
54
|
-
onBlur: this.props.onBlur,
|
|
55
|
-
onFocus: this.props.onFocus,
|
|
56
|
-
onClick: this.props.onClick,
|
|
57
|
-
onOriginalItemNeeded: this.props.onOriginalItemNeeded,
|
|
58
|
-
onPopupClose: this.props.onPopupClose,
|
|
59
|
-
key: t
|
|
35
|
+
item: o,
|
|
36
|
+
animate: e.animate,
|
|
37
|
+
isMenuVertical: e.isMenuVertical,
|
|
38
|
+
isDirectionRightToLeft: e.isDirectionRightToLeft,
|
|
39
|
+
focusedItemId: e.focusedItemId,
|
|
40
|
+
lastItemIdToBeOpened: e.lastItemIdToBeOpened,
|
|
41
|
+
tabbableItemId: e.tabbableItemId,
|
|
42
|
+
itemRender: e.itemRender,
|
|
43
|
+
linkRender: e.linkRender,
|
|
44
|
+
menuGuid: e.menuGuid,
|
|
45
|
+
onMouseOver: e.onMouseOver,
|
|
46
|
+
onMouseLeave: e.onMouseLeave,
|
|
47
|
+
onBlur: e.onBlur,
|
|
48
|
+
onFocus: e.onFocus,
|
|
49
|
+
onClick: e.onClick,
|
|
50
|
+
onOriginalItemNeeded: e.onOriginalItemNeeded,
|
|
51
|
+
onPopupClose: e.onPopupClose,
|
|
52
|
+
key: l
|
|
60
53
|
}
|
|
61
|
-
)) : null
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
componentDidMount() {
|
|
75
|
-
const e = this.props.focusedItemId, t = this.props.item.id;
|
|
76
|
-
e && e === t && this.itemElement.focus({ preventScroll: !0 }), this.isFirstRender = !1;
|
|
77
|
-
}
|
|
78
|
-
componentDidUpdate(e) {
|
|
79
|
-
const t = this.props.focusedItemId, i = this.props.item.id;
|
|
80
|
-
if (t) {
|
|
81
|
-
const n = u(document);
|
|
82
|
-
e.focusedItemId !== t && t === i && // https://github.com/telerik/kendo-react/issues/216 :
|
|
54
|
+
)) : null
|
|
55
|
+
);
|
|
56
|
+
}, W = (e) => {
|
|
57
|
+
const a = i.useRef(null), c = i.useRef(!0), I = i.useRef(void 0), t = e.item, o = t.id, l = M(e.menuGuid, o), b = t.separator, O = t.render || e.itemRender, k = t.linkRender || e.linkRender, g = t.contentParentItemId ? t.contentRender : null, d = t.items.length > 0 && x(o, e.lastItemIdToBeOpened) && !c.current;
|
|
58
|
+
i.useEffect(() => {
|
|
59
|
+
var f, s, m;
|
|
60
|
+
const n = e.focusedItemId, r = e.item.id, u = I.current;
|
|
61
|
+
if (c.current)
|
|
62
|
+
n && n === r && ((f = a.current) == null || f.focus({ preventScroll: !0 })), c.current = !1;
|
|
63
|
+
else if (n) {
|
|
64
|
+
const T = F(document);
|
|
65
|
+
u !== n && n === r && // https://github.com/telerik/kendo-react/issues/216 :
|
|
83
66
|
// No need to focus the wrapping menu item DOM element
|
|
84
67
|
// when a child DOM element was clicked.
|
|
85
|
-
!
|
|
68
|
+
!((s = a.current) != null && s.contains(T)) && ((m = a.current) == null || m.focus({ preventScroll: !0 }));
|
|
86
69
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
id: i,
|
|
105
|
-
className: this.getMenuItemClassName(e),
|
|
106
|
-
style: e.cssStyle,
|
|
107
|
-
tabIndex: t === this.props.tabbableItemId ? 0 : -1,
|
|
108
|
-
onMouseOver: this.onMouseOver,
|
|
109
|
-
onMouseLeave: this.onMouseLeave,
|
|
110
|
-
onBlur: (o) => this.props.onBlur(t, o),
|
|
111
|
-
onFocus: () => this.props.onFocus(t),
|
|
112
|
-
onClick: (o) => this.props.onClick(o, t),
|
|
113
|
-
role: "menuitem",
|
|
114
|
-
"aria-disabled": e.disabled ? !0 : void 0,
|
|
115
|
-
"aria-haspopup": e.items.length > 0 ? !0 : void 0,
|
|
116
|
-
"aria-expanded": e.items.length > 0 ? this.Opened : void 0,
|
|
117
|
-
"aria-label": e.text,
|
|
118
|
-
"aria-owns": this.Opened ? i : void 0,
|
|
119
|
-
ref: (o) => {
|
|
120
|
-
this.itemElement = o;
|
|
121
|
-
},
|
|
122
|
-
key: i
|
|
123
|
-
},
|
|
124
|
-
this.contentRender ? this.renderContent() : this.renderMenuItemLink()
|
|
125
|
-
), this.renderPopupIfOpened());
|
|
126
|
-
}
|
|
127
|
-
renderContent() {
|
|
128
|
-
const e = this.props.item.contentParentItemId;
|
|
129
|
-
return /* @__PURE__ */ s.createElement("div", { className: "k-content", role: "presentation" }, /* @__PURE__ */ s.createElement(this.contentRender, { item: this.props.onOriginalItemNeeded(e), itemId: e }));
|
|
130
|
-
}
|
|
131
|
-
renderMenuItemLink() {
|
|
132
|
-
const e = this.props.item;
|
|
133
|
-
if (this.linkRender)
|
|
134
|
-
return /* @__PURE__ */ s.createElement(
|
|
135
|
-
this.linkRender,
|
|
70
|
+
I.current = n;
|
|
71
|
+
});
|
|
72
|
+
const E = (n) => {
|
|
73
|
+
e.onMouseOver(o), n.stopPropagation();
|
|
74
|
+
}, L = (n) => {
|
|
75
|
+
e.onMouseLeave(o), n.stopPropagation();
|
|
76
|
+
}, h = (n) => {
|
|
77
|
+
e.onPopupClose(o, n);
|
|
78
|
+
}, C = () => {
|
|
79
|
+
const n = t.contentParentItemId, r = g;
|
|
80
|
+
return /* @__PURE__ */ i.createElement("div", { className: "k-content", role: "presentation" }, /* @__PURE__ */ i.createElement(r, { item: e.onOriginalItemNeeded(n), itemId: n }));
|
|
81
|
+
}, D = () => {
|
|
82
|
+
if (k) {
|
|
83
|
+
const u = k;
|
|
84
|
+
return /* @__PURE__ */ i.createElement(
|
|
85
|
+
u,
|
|
136
86
|
{
|
|
137
|
-
item:
|
|
138
|
-
itemId:
|
|
139
|
-
opened:
|
|
140
|
-
dir:
|
|
87
|
+
item: e.onOriginalItemNeeded(t.id),
|
|
88
|
+
itemId: t.id,
|
|
89
|
+
opened: d,
|
|
90
|
+
dir: R(e.isDirectionRightToLeft)
|
|
141
91
|
}
|
|
142
92
|
);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const e = this.props.item.id, t = this.props.animate, { anchorAlign: i, popupAlign: n, collision: o, animationDirection: r } = f(
|
|
148
|
-
e,
|
|
149
|
-
this.props.isMenuVertical,
|
|
150
|
-
this.props.isDirectionRightToLeft
|
|
151
|
-
), l = t === !0 ? { openDuration: 300, closeDuration: 300, direction: r } : t === !1 ? !1 : {
|
|
152
|
-
openDuration: (t == null ? void 0 : t.openDuration) || 300,
|
|
153
|
-
closeDuration: (t == null ? void 0 : t.closeDuration) || 300,
|
|
154
|
-
direction: (t == null ? void 0 : t.direction) || r
|
|
155
|
-
};
|
|
156
|
-
return /* @__PURE__ */ s.createElement(
|
|
157
|
-
c,
|
|
93
|
+
}
|
|
94
|
+
const n = O, r = n ? /* @__PURE__ */ i.createElement(n, { item: e.onOriginalItemNeeded(t.id), itemId: t.id, key: "1" }) : /* @__PURE__ */ i.createElement("span", { className: "k-menu-link-text" }, t.text);
|
|
95
|
+
return /* @__PURE__ */ i.createElement(V, { url: t.url, opened: d }, t.icon || t.svgIcon ? /* @__PURE__ */ i.createElement(B, { name: t.icon, icon: t.svgIcon, key: "0" }) : null, r, t.items.length > 0 ? /* @__PURE__ */ i.createElement("span", { className: "k-menu-expand-arrow", "aria-hidden": !0 }, /* @__PURE__ */ i.createElement(
|
|
96
|
+
w,
|
|
158
97
|
{
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
98
|
+
itemId: t.id,
|
|
99
|
+
verticalMenu: e.isMenuVertical,
|
|
100
|
+
dir: R(e.isDirectionRightToLeft),
|
|
101
|
+
key: "2"
|
|
102
|
+
}
|
|
103
|
+
)) : null);
|
|
104
|
+
}, N = () => {
|
|
105
|
+
const n = e.animate, { anchorAlign: r, popupAlign: u, collision: f, animationDirection: s } = G(
|
|
106
|
+
o,
|
|
107
|
+
e.isMenuVertical,
|
|
108
|
+
e.isDirectionRightToLeft
|
|
109
|
+
);
|
|
110
|
+
let m;
|
|
111
|
+
return n === !0 ? m = { openDuration: 300, closeDuration: 300, direction: s } : n === !1 ? m = !1 : m = {
|
|
112
|
+
openDuration: (n == null ? void 0 : n.openDuration) || 300,
|
|
113
|
+
closeDuration: (n == null ? void 0 : n.closeDuration) || 300,
|
|
114
|
+
direction: (n == null ? void 0 : n.direction) || s
|
|
115
|
+
}, /* @__PURE__ */ i.createElement(
|
|
116
|
+
y,
|
|
117
|
+
{
|
|
118
|
+
anchor: a.current,
|
|
119
|
+
show: d,
|
|
120
|
+
popupClass: v("k-menu-popup", { "k-rtl": e.isDirectionRightToLeft }),
|
|
121
|
+
anchorAlign: r,
|
|
122
|
+
popupAlign: u,
|
|
123
|
+
collision: f,
|
|
124
|
+
animate: m,
|
|
125
|
+
onClose: h,
|
|
167
126
|
key: "1"
|
|
168
127
|
},
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
|
|
128
|
+
/* @__PURE__ */ i.createElement(
|
|
129
|
+
A,
|
|
171
130
|
{
|
|
172
|
-
parentItemId:
|
|
173
|
-
animate:
|
|
174
|
-
items:
|
|
175
|
-
menuGuid:
|
|
176
|
-
focusedItemId:
|
|
177
|
-
lastItemIdToBeOpened:
|
|
178
|
-
tabbableItemId:
|
|
179
|
-
itemRender:
|
|
180
|
-
linkRender:
|
|
181
|
-
isMenuVertical:
|
|
182
|
-
isDirectionRightToLeft:
|
|
131
|
+
parentItemId: o,
|
|
132
|
+
animate: e.animate,
|
|
133
|
+
items: t.items,
|
|
134
|
+
menuGuid: e.menuGuid,
|
|
135
|
+
focusedItemId: e.focusedItemId,
|
|
136
|
+
lastItemIdToBeOpened: e.lastItemIdToBeOpened,
|
|
137
|
+
tabbableItemId: e.tabbableItemId,
|
|
138
|
+
itemRender: e.itemRender,
|
|
139
|
+
linkRender: e.linkRender,
|
|
140
|
+
isMenuVertical: e.isMenuVertical,
|
|
141
|
+
isDirectionRightToLeft: e.isDirectionRightToLeft,
|
|
183
142
|
className: "k-group k-menu-group k-reset k-menu-group-md",
|
|
184
|
-
onMouseOver:
|
|
185
|
-
onMouseLeave:
|
|
186
|
-
onBlur:
|
|
187
|
-
onFocus:
|
|
188
|
-
onClick:
|
|
189
|
-
onOriginalItemNeeded:
|
|
190
|
-
onPopupClose:
|
|
143
|
+
onMouseOver: e.onMouseOver,
|
|
144
|
+
onMouseLeave: e.onMouseLeave,
|
|
145
|
+
onBlur: e.onBlur,
|
|
146
|
+
onFocus: e.onFocus,
|
|
147
|
+
onClick: e.onClick,
|
|
148
|
+
onOriginalItemNeeded: e.onOriginalItemNeeded,
|
|
149
|
+
onPopupClose: e.onPopupClose
|
|
191
150
|
}
|
|
192
151
|
)
|
|
193
152
|
);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
"
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
e.cssClass
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
153
|
+
}, P = v(
|
|
154
|
+
"k-item",
|
|
155
|
+
"k-menu-item",
|
|
156
|
+
{
|
|
157
|
+
"k-first": S(o),
|
|
158
|
+
"k-last": t.isLastFromSiblings,
|
|
159
|
+
"k-disabled": t.disabled
|
|
160
|
+
},
|
|
161
|
+
t.cssClass
|
|
162
|
+
);
|
|
163
|
+
return /* @__PURE__ */ i.createElement(i.Fragment, null, b ? /* @__PURE__ */ i.createElement(
|
|
164
|
+
"li",
|
|
165
|
+
{
|
|
166
|
+
className: "k-separator k-item",
|
|
167
|
+
"aria-hidden": !0,
|
|
168
|
+
key: l,
|
|
169
|
+
id: l,
|
|
170
|
+
ref: a
|
|
171
|
+
}
|
|
172
|
+
) : /* @__PURE__ */ i.createElement(
|
|
173
|
+
"li",
|
|
174
|
+
{
|
|
175
|
+
id: l,
|
|
176
|
+
className: P,
|
|
177
|
+
style: t.cssStyle,
|
|
178
|
+
tabIndex: o === e.tabbableItemId ? 0 : -1,
|
|
179
|
+
onMouseOver: E,
|
|
180
|
+
onMouseLeave: L,
|
|
181
|
+
onBlur: (n) => e.onBlur(o, n),
|
|
182
|
+
onFocus: () => e.onFocus(o),
|
|
183
|
+
onClick: (n) => e.onClick(n, o),
|
|
184
|
+
role: "menuitem",
|
|
185
|
+
"aria-disabled": t.disabled ? !0 : void 0,
|
|
186
|
+
"aria-haspopup": t.items.length > 0 ? !0 : void 0,
|
|
187
|
+
"aria-expanded": t.items.length > 0 ? d : void 0,
|
|
188
|
+
"aria-label": t.text,
|
|
189
|
+
"aria-owns": d ? l : void 0,
|
|
190
|
+
ref: a,
|
|
191
|
+
key: l
|
|
192
|
+
},
|
|
193
|
+
g ? C() : D()
|
|
194
|
+
), N());
|
|
195
|
+
};
|
|
241
196
|
export {
|
|
242
|
-
|
|
243
|
-
|
|
197
|
+
W as MenuItemInternal,
|
|
198
|
+
A as MenuItemInternalsList
|
|
244
199
|
};
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as PropTypes } from 'prop-types';
|
|
9
8
|
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
10
9
|
import * as React from 'react';
|
|
11
10
|
/**
|
|
@@ -21,17 +20,4 @@ export interface MenuItemLinkProps extends KendoReactComponentBaseProps {
|
|
|
21
20
|
*/
|
|
22
21
|
url?: string;
|
|
23
22
|
}
|
|
24
|
-
export declare
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
static propTypes: {
|
|
29
|
-
opened: PropTypes.Requireable<boolean>;
|
|
30
|
-
url: PropTypes.Requireable<string>;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @hidden
|
|
34
|
-
*/
|
|
35
|
-
render(): React.JSX.Element;
|
|
36
|
-
private getMenuItemClassName;
|
|
37
|
-
}
|
|
23
|
+
export declare const MenuItemLink: (props: MenuItemLinkProps) => 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 o=require("react"),r=require("prop-types"),s=require("@progress/kendo-react-common");function u(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=u(o),l=e=>s.classNames("k-link","k-menu-link",{"k-active":e}),i=e=>e.url?c.createElement("a",{className:l(e.opened),href:e.url,tabIndex:-1},e.children):c.createElement("span",{id:e.id,className:s.classNames(l(e.opened),e.className),style:e.style,role:"presentation"},e.children);i.propTypes={opened:r.bool,url:r.string};exports.MenuItemLink=i;
|