@progress/kendo-react-layout 14.4.1 → 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/dist/cdn/js/kendo-react-layout.js +1 -1
- package/menu/components/Menu.d.ts +14 -93
- package/menu/components/Menu.js +1 -1
- package/menu/components/Menu.mjs +223 -212
- package/menu/components/MenuItem.d.ts +4 -24
- 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 +2 -35
- 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 +4 -4
- package/menu/utils/DirectionHolder.js +1 -1
- package/menu/utils/DirectionHolder.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
|
@@ -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
8
|
import { BaseMenuItem } from '../models/BaseMenuItem';
|
|
10
|
-
import * as React from 'react';
|
|
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;
|
|
@@ -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
|
};
|
|
@@ -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;
|