@progress/kendo-react-layout 10.1.0-develop.1 → 10.1.0-develop.11
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/README.md +1 -1
- package/contextmenu/ContextMenu.js +1 -1
- package/contextmenu/ContextMenu.mjs +16 -14
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/index.d.mts +12 -4
- package/index.d.ts +12 -4
- package/menu/components/Menu.js +1 -1
- package/menu/components/Menu.mjs +28 -17
- package/menu/components/MenuItemInternal.js +1 -1
- package/menu/components/MenuItemInternal.mjs +81 -78
- package/menu/consts.js +1 -1
- package/menu/consts.mjs +26 -16
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +23 -8
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +1 -4
package/index.d.mts
CHANGED
|
@@ -13,6 +13,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
13
13
|
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
14
14
|
import { Navigation } from '@progress/kendo-react-common';
|
|
15
15
|
import { Offset } from '@progress/kendo-react-popup';
|
|
16
|
+
import { PopupAnimation } from '@progress/kendo-react-popup';
|
|
16
17
|
import * as React_2 from 'react';
|
|
17
18
|
import { RefAttributes } from 'react';
|
|
18
19
|
import { SVGIcon } from '@progress/kendo-react-common';
|
|
@@ -2546,6 +2547,10 @@ export declare class MenuClassComponent extends React_2.Component<MenuProps, Men
|
|
|
2546
2547
|
vertical: default_2.Requireable<boolean>;
|
|
2547
2548
|
items: default_2.Requireable<(object | null | undefined)[]>;
|
|
2548
2549
|
style: default_2.Requireable<object>;
|
|
2550
|
+
animate: default_2.Requireable<NonNullable<boolean | default_2.InferProps<{
|
|
2551
|
+
openDuration: default_2.Requireable<number>;
|
|
2552
|
+
closeDuration: default_2.Requireable<number>;
|
|
2553
|
+
}> | null | undefined>>;
|
|
2549
2554
|
dir: default_2.Requireable<string>;
|
|
2550
2555
|
hoverOpenDelay: default_2.Requireable<number>;
|
|
2551
2556
|
hoverCloseDelay: default_2.Requireable<number>;
|
|
@@ -2561,6 +2566,7 @@ export declare class MenuClassComponent extends React_2.Component<MenuProps, Men
|
|
|
2561
2566
|
*/
|
|
2562
2567
|
static defaultProps: {
|
|
2563
2568
|
vertical: boolean;
|
|
2569
|
+
animate: boolean;
|
|
2564
2570
|
};
|
|
2565
2571
|
/**
|
|
2566
2572
|
* @hidden
|
|
@@ -2576,6 +2582,7 @@ export declare class MenuClassComponent extends React_2.Component<MenuProps, Men
|
|
|
2576
2582
|
private mouseOverHandler;
|
|
2577
2583
|
get element(): HTMLDivElement | null;
|
|
2578
2584
|
constructor(props: MenuProps);
|
|
2585
|
+
protected get animate(): boolean;
|
|
2579
2586
|
/**
|
|
2580
2587
|
* @hidden
|
|
2581
2588
|
*/
|
|
@@ -2704,6 +2711,7 @@ declare interface MenuItemInternalsListProps extends BaseMenuItemInternalProps {
|
|
|
2704
2711
|
items: MenuItemInternalModel[];
|
|
2705
2712
|
parentItemId?: string;
|
|
2706
2713
|
className: string;
|
|
2714
|
+
animate?: boolean | PopupAnimation;
|
|
2707
2715
|
role?: string;
|
|
2708
2716
|
'aria-orientation'?: 'vertical';
|
|
2709
2717
|
}
|
|
@@ -2781,6 +2789,10 @@ export declare interface MenuProps {
|
|
|
2781
2789
|
* Sets the ID of the Menu.
|
|
2782
2790
|
*/
|
|
2783
2791
|
id?: string;
|
|
2792
|
+
/**
|
|
2793
|
+
* Controls the Popup animation. By default, the opening and closing animations are enabled and set to `300`.
|
|
2794
|
+
*/
|
|
2795
|
+
animate?: boolean | PopupAnimation;
|
|
2784
2796
|
/**
|
|
2785
2797
|
* Sets the direction of the Menu.
|
|
2786
2798
|
*/
|
|
@@ -3903,10 +3915,6 @@ export declare class TabStripClassComponent extends React_2.Component<TabStripPr
|
|
|
3903
3915
|
* @hidden
|
|
3904
3916
|
*/
|
|
3905
3917
|
private onScroll;
|
|
3906
|
-
/**
|
|
3907
|
-
* @hidden
|
|
3908
|
-
*/
|
|
3909
|
-
private handleResize;
|
|
3910
3918
|
/**
|
|
3911
3919
|
* @hidden
|
|
3912
3920
|
*/
|
package/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
13
13
|
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
14
14
|
import { Navigation } from '@progress/kendo-react-common';
|
|
15
15
|
import { Offset } from '@progress/kendo-react-popup';
|
|
16
|
+
import { PopupAnimation } from '@progress/kendo-react-popup';
|
|
16
17
|
import * as React_2 from 'react';
|
|
17
18
|
import { RefAttributes } from 'react';
|
|
18
19
|
import { SVGIcon } from '@progress/kendo-react-common';
|
|
@@ -2546,6 +2547,10 @@ export declare class MenuClassComponent extends React_2.Component<MenuProps, Men
|
|
|
2546
2547
|
vertical: default_2.Requireable<boolean>;
|
|
2547
2548
|
items: default_2.Requireable<(object | null | undefined)[]>;
|
|
2548
2549
|
style: default_2.Requireable<object>;
|
|
2550
|
+
animate: default_2.Requireable<NonNullable<boolean | default_2.InferProps<{
|
|
2551
|
+
openDuration: default_2.Requireable<number>;
|
|
2552
|
+
closeDuration: default_2.Requireable<number>;
|
|
2553
|
+
}> | null | undefined>>;
|
|
2549
2554
|
dir: default_2.Requireable<string>;
|
|
2550
2555
|
hoverOpenDelay: default_2.Requireable<number>;
|
|
2551
2556
|
hoverCloseDelay: default_2.Requireable<number>;
|
|
@@ -2561,6 +2566,7 @@ export declare class MenuClassComponent extends React_2.Component<MenuProps, Men
|
|
|
2561
2566
|
*/
|
|
2562
2567
|
static defaultProps: {
|
|
2563
2568
|
vertical: boolean;
|
|
2569
|
+
animate: boolean;
|
|
2564
2570
|
};
|
|
2565
2571
|
/**
|
|
2566
2572
|
* @hidden
|
|
@@ -2576,6 +2582,7 @@ export declare class MenuClassComponent extends React_2.Component<MenuProps, Men
|
|
|
2576
2582
|
private mouseOverHandler;
|
|
2577
2583
|
get element(): HTMLDivElement | null;
|
|
2578
2584
|
constructor(props: MenuProps);
|
|
2585
|
+
protected get animate(): boolean;
|
|
2579
2586
|
/**
|
|
2580
2587
|
* @hidden
|
|
2581
2588
|
*/
|
|
@@ -2704,6 +2711,7 @@ declare interface MenuItemInternalsListProps extends BaseMenuItemInternalProps {
|
|
|
2704
2711
|
items: MenuItemInternalModel[];
|
|
2705
2712
|
parentItemId?: string;
|
|
2706
2713
|
className: string;
|
|
2714
|
+
animate?: boolean | PopupAnimation;
|
|
2707
2715
|
role?: string;
|
|
2708
2716
|
'aria-orientation'?: 'vertical';
|
|
2709
2717
|
}
|
|
@@ -2781,6 +2789,10 @@ export declare interface MenuProps {
|
|
|
2781
2789
|
* Sets the ID of the Menu.
|
|
2782
2790
|
*/
|
|
2783
2791
|
id?: string;
|
|
2792
|
+
/**
|
|
2793
|
+
* Controls the Popup animation. By default, the opening and closing animations are enabled and set to `300`.
|
|
2794
|
+
*/
|
|
2795
|
+
animate?: boolean | PopupAnimation;
|
|
2784
2796
|
/**
|
|
2785
2797
|
* Sets the direction of the Menu.
|
|
2786
2798
|
*/
|
|
@@ -3903,10 +3915,6 @@ export declare class TabStripClassComponent extends React_2.Component<TabStripPr
|
|
|
3903
3915
|
* @hidden
|
|
3904
3916
|
*/
|
|
3905
3917
|
private onScroll;
|
|
3906
|
-
/**
|
|
3907
|
-
* @hidden
|
|
3908
|
-
*/
|
|
3909
|
-
private handleResize;
|
|
3910
3918
|
/**
|
|
3911
3919
|
* @hidden
|
|
3912
3920
|
*/
|
package/menu/components/Menu.js
CHANGED
|
@@ -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 p=require("react"),o=require("prop-types"),a=require("@progress/kendo-react-common"),i=require("../utils/itemsIdsUtils.js"),v=require("../utils/prepareInputItemsForInternalWork.js"),h=require("../utils/getNewItemIdUponKeyboardNavigation.js"),u=require("../utils/hoverDelay.js"),f=require("./MenuItemInternal.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),o=require("prop-types"),a=require("@progress/kendo-react-common"),i=require("../utils/itemsIdsUtils.js"),v=require("../utils/prepareInputItemsForInternalWork.js"),h=require("../utils/getNewItemIdUponKeyboardNavigation.js"),u=require("../utils/hoverDelay.js"),f=require("./MenuItemInternal.js"),b=require("../utils/DirectionHolder.js"),g=require("../utils/MouseOverHandler.js");function D(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const d=D(p),c={focusedItemId:i.EMPTY_ID,hoveredItemId:i.EMPTY_ID,tabbableItemId:i.ZERO_LEVEL_ZERO_ITEM_ID},l=class l extends d.Component{constructor(t){super(t),this.menuWrapperEl=null,this.directionHolder=new b.DirectionHolder,this.inputItems=[],this.items=[],this.reset=()=>{this.clearItemHoverAndLeaveRequestsIfApplicable(),this.setState(c)},this.onKeyDown=e=>{if(this.state.focusedItemId!==i.EMPTY_ID){const s=i.getItemById(this.state.focusedItemId,this.items);let r=h.getNewItemIdUponKeyboardNavigation(this.items,s.id,e.keyCode,e.key,this.props.vertical,this.directionHolder.getIsDirectionRightToLeft());const I=i.getItemById(r,this.items);I&&I.separator&&(r=h.getNewItemIdUponKeyboardNavigation(this.items,r,e.keyCode,e.key,this.props.vertical,this.directionHolder.getIsDirectionRightToLeft())),s.id!==r&&(e.preventDefault(),this.setFocusedItemId(r)),(e.keyCode===a.Keys.enter||e.keyCode===a.Keys.space)&&!s.disabled&&(this.mouseOverHandler.handleItemSelectedViaKeyboard(),this.dispatchSelectEventIfWired(e,s.id),!e.isDefaultPrevented()&&s.items.length===0&&s.url&&window.location.assign(s.url))}e.keyCode===a.Keys.esc&&this.props.onClose&&this.props.onClose.call(void 0,e)},this.onItemMouseOver=e=>{this.mouseOverHandler.IsMouseOverEnabled&&(this.clearItemHoverAndLeaveRequestsIfApplicable(),this.itemHoverRequest=window.setTimeout(()=>{this.setHoveredItemId(e),this.itemHoverRequest=null},u.getHoverOpenDelay(this.props)))},this.onItemMouseLeave=e=>{this.mouseOverHandler.IsMouseOverEnabled&&this.isItemWithDefaultClose(e)&&(this.clearItemHoverAndLeaveRequestsIfApplicable(),this.itemLeaveRequest=window.setTimeout(()=>{this.setHoveredItemId(i.EMPTY_ID),this.itemLeaveRequest=null},u.getHoverCloseDelay(this.props)))},this.onItemMouseDown=()=>{this.mouseOverHandler.handleItemMouseDown()},this.onItemFocus=e=>{this.setFocusedItemId(e),this.mouseOverHandler.handleItemFocus()},this.onItemClick=(e,s)=>{const r=i.getItemById(s,this.items);r.disabled||(this.setFocusedItemId(s),this.mouseOverHandler.handleItemClick(s,this.isItemWithDefaultClose(s)),this.dispatchSelectEventIfWired(e,s),!e.isDefaultPrevented()&&r.url&&window.location.assign(r.url))},this.onItemBlur=(e,s)=>{if(this.isItemWithDefaultClose(e)&&this.setFocusedItemId(i.EMPTY_ID),s.relatedTarget&&s.relatedTarget.nodeName==="LI"){const r=s.relatedTarget.getAttribute("id");if(r&&r.includes(this.menuItemId))return}this.props.onClose&&this.props.onClose.call(void 0,s)},this.getInputItem=e=>i.getItemById(e,this.inputItems),this.mouseOverHandler=new g.MouseOverHandler(this.props.openOnClick,this.reset,this.onItemMouseOver),this.state=Object.assign({},c,{isFirstRender:!0})}get menuItemId(){return this.props.id}get element(){return this.menuWrapperEl}get animate(){return this.props.animate!==void 0?this.props.animate:l.defaultProps.animate}render(){this.prepareItems(),this.state.isFirstRender||this.directionHolder.setIsDirectionRightToLeft(this.checkIsDirectionRightToLeft());const t=this.state.hoveredItemId?this.state.hoveredItemId:this.state.focusedItemId?i.getDirectParentId(this.state.focusedItemId):i.EMPTY_ID;return d.createElement("div",{id:this.props.id,onKeyDown:this.onKeyDown,style:this.props.style,className:this.directionHolder.getIsDirectionRightToLeft()?"k-rtl":void 0,ref:e=>this.menuWrapperEl=e},d.createElement(f.MenuItemInternalsList,{className:this.getMenuClassName(),"aria-orientation":this.props.vertical?"vertical":void 0,items:this.items,animate:this.animate,isMenuVertical:this.props.vertical,isDirectionRightToLeft:this.directionHolder.getIsDirectionRightToLeft(),focusedItemId:this.state.focusedItemId,lastItemIdToBeOpened:t,tabbableItemId:this.state.tabbableItemId,itemRender:this.props.itemRender,linkRender:this.props.linkRender,menuGuid:this.menuItemId,onMouseLeave:this.onItemMouseLeave,onMouseOver:this.onItemMouseOver,onMouseDown:this.onItemMouseDown,onFocus:this.onItemFocus,onClick:this.onItemClick,onBlur:this.onItemBlur,onOriginalItemNeeded:this.getInputItem,role:this.props.role}))}componentDidMount(){this.setState({isFirstRender:!1})}componentDidUpdate(t){(!!t.vertical!=!!this.props.vertical||this.directionHolder.hasDirectionChanged())&&this.reset(),this.mouseOverHandler.OpenOnClick=this.props.openOnClick}componentWillUnmount(){this.clearItemHoverAndLeaveRequestsIfApplicable()}setFocusedItemId(t){this.setState(e=>{const s=t===i.EMPTY_ID?e.tabbableItemId:i.getRootParentId(t);return{hoveredItemId:t===i.EMPTY_ID||i.isIdEmptyOrZeroLevel(e.hoveredItemId)&&i.isIdEmptyOrZeroLevel(t)?e.hoveredItemId:i.EMPTY_ID,focusedItemId:t,tabbableItemId:s}})}setHoveredItemId(t){this.setState(e=>i.isIdEmptyOrZeroLevel(t)&&i.isIdEmptyOrZeroLevel(e.focusedItemId)?{hoveredItemId:t,focusedItemId:e.focusedItemId,tabbableItemId:e.tabbableItemId}:{hoveredItemId:t,focusedItemId:i.EMPTY_ID,tabbableItemId:i.ZERO_LEVEL_ZERO_ITEM_ID})}getMenuClassName(){return a.classNames("k-reset","k-header","k-menu",{"k-menu-horizontal":!this.props.vertical},{"k-menu-vertical":this.props.vertical},this.props.className)}clearItemHoverAndLeaveRequestsIfApplicable(){this.itemHoverRequest&&(clearTimeout(this.itemHoverRequest),this.itemHoverRequest=null),this.itemLeaveRequest&&(clearTimeout(this.itemLeaveRequest),this.itemLeaveRequest=null)}isItemWithDefaultClose(t){return!this.props.customCloseItemIds||this.props.customCloseItemIds.indexOf(t)===-1}checkIsDirectionRightToLeft(){return!!(this.props.dir!==void 0?this.props.dir==="rtl":this.menuWrapperEl&&getComputedStyle(this.menuWrapperEl).direction==="rtl")}prepareItems(){const{items:t,inputItems:e}=v.prepareInputItemsForInternalWork(this.props.items,this.props.children);this.items=t,this.inputItems=e}dispatchSelectEventIfWired(t,e){a.dispatchEvent(this.props.onSelect,t,this,{item:this.getInputItem(e),itemId:e})}};l.propTypes={vertical:o.bool,items:o.arrayOf(o.object),style:o.object,animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),dir:o.string,hoverOpenDelay:o.number,hoverCloseDelay:o.number,openOnClick:o.bool,itemRender:o.any,linkRender:o.any,customCloseItemIds:o.arrayOf(o.string),onSelect:o.func,role:o.string},l.defaultProps={vertical:!1,animate:!0};let m=l;exports.Menu=m;
|
package/menu/components/Menu.mjs
CHANGED
|
@@ -7,25 +7,25 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as m from "react";
|
|
9
9
|
import i from "prop-types";
|
|
10
|
-
import { Keys as
|
|
11
|
-
import { EMPTY_ID as r, getItemById as
|
|
10
|
+
import { Keys as h, classNames as f, dispatchEvent as v } from "@progress/kendo-react-common";
|
|
11
|
+
import { EMPTY_ID as r, getItemById as a, getDirectParentId as b, getRootParentId as g, isIdEmptyOrZeroLevel as l, ZERO_LEVEL_ZERO_ITEM_ID as c } from "../utils/itemsIdsUtils.mjs";
|
|
12
12
|
import { prepareInputItemsForInternalWork as R } from "../utils/prepareInputItemsForInternalWork.mjs";
|
|
13
13
|
import { getNewItemIdUponKeyboardNavigation as I } from "../utils/getNewItemIdUponKeyboardNavigation.mjs";
|
|
14
14
|
import { getHoverOpenDelay as D, getHoverCloseDelay as H } from "../utils/hoverDelay.mjs";
|
|
15
|
-
import { MenuItemInternalsList as
|
|
16
|
-
import { DirectionHolder as
|
|
15
|
+
import { MenuItemInternalsList as O } from "./MenuItemInternal.mjs";
|
|
16
|
+
import { DirectionHolder as C } from "../utils/DirectionHolder.mjs";
|
|
17
17
|
import { MouseOverHandler as y } from "../utils/MouseOverHandler.mjs";
|
|
18
18
|
const p = {
|
|
19
19
|
focusedItemId: r,
|
|
20
20
|
hoveredItemId: r,
|
|
21
21
|
tabbableItemId: c
|
|
22
|
-
},
|
|
22
|
+
}, n = class n extends m.Component {
|
|
23
23
|
constructor(t) {
|
|
24
|
-
super(t), this.menuWrapperEl = null, this.directionHolder = new
|
|
24
|
+
super(t), this.menuWrapperEl = null, this.directionHolder = new C(), this.inputItems = [], this.items = [], this.reset = () => {
|
|
25
25
|
this.clearItemHoverAndLeaveRequestsIfApplicable(), this.setState(p);
|
|
26
26
|
}, this.onKeyDown = (e) => {
|
|
27
27
|
if (this.state.focusedItemId !== r) {
|
|
28
|
-
const s =
|
|
28
|
+
const s = a(this.state.focusedItemId, this.items);
|
|
29
29
|
let o = I(
|
|
30
30
|
this.items,
|
|
31
31
|
s.id,
|
|
@@ -34,17 +34,17 @@ const p = {
|
|
|
34
34
|
this.props.vertical,
|
|
35
35
|
this.directionHolder.getIsDirectionRightToLeft()
|
|
36
36
|
);
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const d = a(o, this.items);
|
|
38
|
+
d && d.separator && (o = I(
|
|
39
39
|
this.items,
|
|
40
40
|
o,
|
|
41
41
|
e.keyCode,
|
|
42
42
|
e.key,
|
|
43
43
|
this.props.vertical,
|
|
44
44
|
this.directionHolder.getIsDirectionRightToLeft()
|
|
45
|
-
)), s.id !== o && (e.preventDefault(), this.setFocusedItemId(o)), (e.keyCode ===
|
|
45
|
+
)), s.id !== o && (e.preventDefault(), this.setFocusedItemId(o)), (e.keyCode === h.enter || e.keyCode === h.space) && !s.disabled && (this.mouseOverHandler.handleItemSelectedViaKeyboard(), this.dispatchSelectEventIfWired(e, s.id), !e.isDefaultPrevented() && s.items.length === 0 && s.url && window.location.assign(s.url));
|
|
46
46
|
}
|
|
47
|
-
e.keyCode ===
|
|
47
|
+
e.keyCode === h.esc && this.props.onClose && this.props.onClose.call(void 0, e);
|
|
48
48
|
}, this.onItemMouseOver = (e) => {
|
|
49
49
|
this.mouseOverHandler.IsMouseOverEnabled && (this.clearItemHoverAndLeaveRequestsIfApplicable(), this.itemHoverRequest = window.setTimeout(() => {
|
|
50
50
|
this.setHoveredItemId(e), this.itemHoverRequest = null;
|
|
@@ -58,7 +58,7 @@ const p = {
|
|
|
58
58
|
}, this.onItemFocus = (e) => {
|
|
59
59
|
this.setFocusedItemId(e), this.mouseOverHandler.handleItemFocus();
|
|
60
60
|
}, this.onItemClick = (e, s) => {
|
|
61
|
-
const o =
|
|
61
|
+
const o = a(s, this.items);
|
|
62
62
|
o.disabled || (this.setFocusedItemId(s), this.mouseOverHandler.handleItemClick(s, this.isItemWithDefaultClose(s)), this.dispatchSelectEventIfWired(e, s), !e.isDefaultPrevented() && o.url && window.location.assign(o.url));
|
|
63
63
|
}, this.onItemBlur = (e, s) => {
|
|
64
64
|
if (this.isItemWithDefaultClose(e) && this.setFocusedItemId(r), s.relatedTarget && s.relatedTarget.nodeName === "LI") {
|
|
@@ -67,7 +67,7 @@ const p = {
|
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
this.props.onClose && this.props.onClose.call(void 0, s);
|
|
70
|
-
}, this.getInputItem = (e) =>
|
|
70
|
+
}, this.getInputItem = (e) => a(e, this.inputItems), this.mouseOverHandler = new y(this.props.openOnClick, this.reset, this.onItemMouseOver), this.state = Object.assign({}, p, { isFirstRender: !0 });
|
|
71
71
|
}
|
|
72
72
|
get menuItemId() {
|
|
73
73
|
return this.props.id;
|
|
@@ -75,6 +75,9 @@ const p = {
|
|
|
75
75
|
get element() {
|
|
76
76
|
return this.menuWrapperEl;
|
|
77
77
|
}
|
|
78
|
+
get animate() {
|
|
79
|
+
return this.props.animate !== void 0 ? this.props.animate : n.defaultProps.animate;
|
|
80
|
+
}
|
|
78
81
|
/**
|
|
79
82
|
* @hidden
|
|
80
83
|
*/
|
|
@@ -91,11 +94,12 @@ const p = {
|
|
|
91
94
|
ref: (e) => this.menuWrapperEl = e
|
|
92
95
|
},
|
|
93
96
|
/* @__PURE__ */ m.createElement(
|
|
94
|
-
|
|
97
|
+
O,
|
|
95
98
|
{
|
|
96
99
|
className: this.getMenuClassName(),
|
|
97
100
|
"aria-orientation": this.props.vertical ? "vertical" : void 0,
|
|
98
101
|
items: this.items,
|
|
102
|
+
animate: this.animate,
|
|
99
103
|
isMenuVertical: this.props.vertical,
|
|
100
104
|
isDirectionRightToLeft: this.directionHolder.getIsDirectionRightToLeft(),
|
|
101
105
|
focusedItemId: this.state.focusedItemId,
|
|
@@ -174,10 +178,17 @@ const p = {
|
|
|
174
178
|
v(this.props.onSelect, t, this, { item: this.getInputItem(e), itemId: e });
|
|
175
179
|
}
|
|
176
180
|
};
|
|
177
|
-
|
|
181
|
+
n.propTypes = {
|
|
178
182
|
vertical: i.bool,
|
|
179
183
|
items: i.arrayOf(i.object),
|
|
180
184
|
style: i.object,
|
|
185
|
+
animate: i.oneOfType([
|
|
186
|
+
i.bool,
|
|
187
|
+
i.shape({
|
|
188
|
+
openDuration: i.number,
|
|
189
|
+
closeDuration: i.number
|
|
190
|
+
})
|
|
191
|
+
]),
|
|
181
192
|
dir: i.string,
|
|
182
193
|
hoverOpenDelay: i.number,
|
|
183
194
|
hoverCloseDelay: i.number,
|
|
@@ -187,8 +198,8 @@ a.propTypes = {
|
|
|
187
198
|
customCloseItemIds: i.arrayOf(i.string),
|
|
188
199
|
onSelect: i.func,
|
|
189
200
|
role: i.string
|
|
190
|
-
},
|
|
191
|
-
let u =
|
|
201
|
+
}, n.defaultProps = { vertical: !1, animate: !0 };
|
|
202
|
+
let u = n;
|
|
192
203
|
export {
|
|
193
204
|
u as Menu
|
|
194
205
|
};
|
|
@@ -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 h=require("react"),a=require("@progress/kendo-react-common"),I=require("@progress/kendo-react-popup"),m=require("../utils/itemsIdsUtils.js"),p=require("../utils/misc.js"),g=require("./MenuItemLink.js"),M=require("./MenuItemArrow.js");function f(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const s=f(h);class u extends s.Component{constructor(){super(...arguments),this.onMouseOver=e=>{this.props.onMouseOver(this.props.parentItemId),e.stopPropagation()},this.onMouseLeave=e=>{this.props.onMouseLeave(this.props.parentItemId),e.stopPropagation()}}render(){const e=this.props.parentItemId;return s.createElement("ul",{className:this.props.className,role:this.props.role?this.props.role:e!==void 0?"menu":"menubar",id:e!==void 0?p.getDOMElementId(this.props.menuGuid,e):void 0,onMouseOver:e!==void 0?this.onMouseOver:void 0,onMouseLeave:e!==void 0?this.onMouseLeave:void 0,"aria-orientation":this.props["aria-orientation"]},this.renderChildItems())}renderChildItems(){return this.props.items.length>0?this.props.items.map((e,t)=>s.createElement(l,{item:e,animate:this.props.animate,isMenuVertical:this.props.isMenuVertical,isDirectionRightToLeft:this.props.isDirectionRightToLeft,focusedItemId:this.props.focusedItemId,lastItemIdToBeOpened:this.props.lastItemIdToBeOpened,tabbableItemId:this.props.tabbableItemId,itemRender:this.props.itemRender,linkRender:this.props.linkRender,menuGuid:this.props.menuGuid,onMouseOver:this.props.onMouseOver,onMouseLeave:this.props.onMouseLeave,onMouseDown:this.props.onMouseDown,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:this.props.onClick,onOriginalItemNeeded:this.props.onOriginalItemNeeded,key:t})):null}}class l extends s.Component{constructor(e){super(e),this.isFirstRender=!0,this.onMouseOver=t=>{this.props.onMouseOver(this.props.item.id),t.stopPropagation()},this.onMouseLeave=t=>{this.props.onMouseLeave(this.props.item.id),t.stopPropagation()},this.state={opened:!1}}componentDidMount(){const e=this.props.focusedItemId,t=this.props.item.id;e&&e===t&&this.itemElement.focus({preventScroll:!0}),this.isFirstRender=!1}componentDidUpdate(e){const t=this.props.focusedItemId,i=this.props.item.id;if(t){const r=a.getActiveElement(document);e.focusedItemId!==t&&t===i&&!this.itemElement.contains(r)&&this.itemElement.focus({preventScroll:!0})}}render(){const e=this.props.item,t=e.id,i=p.getDOMElementId(this.props.menuGuid,t),r=e.separator;return s.createElement(s.Fragment,null,r?s.createElement("li",{className:"k-separator k-item","aria-hidden":!0,key:i,id:i,ref:n=>this.itemElement=n}):s.createElement("li",{id:i,className:this.getMenuItemClassName(e),style:e.cssStyle,tabIndex:t===this.props.tabbableItemId?0:-1,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,onMouseDown:n=>this.props.onMouseDown(n),onBlur:n=>this.props.onBlur(t,n),onFocus:()=>this.props.onFocus(t),onClick:n=>this.props.onClick(n,t),role:"menuitem","aria-disabled":e.disabled?!0:void 0,"aria-haspopup":e.items.length>0?!0:void 0,"aria-expanded":e.items.length>0?this.Opened:void 0,"aria-label":e.text,"aria-owns":this.Opened?i:void 0,ref:n=>this.itemElement=n,key:i},this.contentRender?this.renderContent():this.renderMenuItemLink()),this.renderPopupIfOpened())}renderContent(){const e=this.props.item.contentParentItemId;return s.createElement("div",{className:"k-content",role:"presentation"},s.createElement(this.contentRender,{item:this.props.onOriginalItemNeeded(e),itemId:e}))}renderMenuItemLink(){const e=this.props.item;if(this.linkRender)return s.createElement(this.linkRender,{item:this.props.onOriginalItemNeeded(e.id),itemId:e.id,opened:this.Opened,dir:p.convertBoolDirectionToString(this.props.isDirectionRightToLeft)});const t=this.itemRender?s.createElement(this.itemRender,{item:this.props.onOriginalItemNeeded(e.id),itemId:e.id,key:"1"}):s.createElement("span",{className:"k-menu-link-text"},e.text);return s.createElement(g.MenuItemLink,{url:e.url,opened:this.Opened},this.renderMenuIconIfApplicable(),t,this.renderArrowIfApplicable())}renderPopupIfOpened(){const e=this.props.item.id,t=this.props.animate,{anchorAlign:i,popupAlign:r,collision:n,animationDirection:d}=p.getPopupSettings(e,this.props.isMenuVertical,this.props.isDirectionRightToLeft),c=t===!0?{openDuration:300,closeDuration:300,direction:d}:t===!1?!1:{openDuration:(t==null?void 0:t.openDuration)||300,closeDuration:(t==null?void 0:t.closeDuration)||300,direction:(t==null?void 0:t.direction)||d};return s.createElement(I.Popup,{anchor:this.itemElement,show:this.Opened,popupClass:this.getPopupClassName(),anchorAlign:i,popupAlign:r,collision:n,animate:c,key:"1"},s.createElement(u,{parentItemId:e,animate:this.props.animate,items:this.props.item.items,menuGuid:this.props.menuGuid,focusedItemId:this.props.focusedItemId,lastItemIdToBeOpened:this.props.lastItemIdToBeOpened,tabbableItemId:this.props.tabbableItemId,itemRender:this.props.itemRender,linkRender:this.props.linkRender,isMenuVertical:this.props.isMenuVertical,isDirectionRightToLeft:this.props.isDirectionRightToLeft,className:"k-group k-menu-group k-reset k-menu-group-md",onMouseOver:this.props.onMouseOver,onMouseLeave:this.props.onMouseLeave,onMouseDown:this.props.onMouseDown,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:this.props.onClick,onOriginalItemNeeded:this.props.onOriginalItemNeeded}))}renderMenuIconIfApplicable(){const{icon:e,svgIcon:t}=this.props.item;return e||t?s.createElement(a.IconWrap,{name:e,icon:t,key:"0"}):null}renderArrowIfApplicable(){return this.props.item.items.length>0?s.createElement("span",{className:"k-menu-expand-arrow","aria-hidden":!0},s.createElement(M.MenuItemArrow,{itemId:this.props.item.id,verticalMenu:this.props.isMenuVertical,dir:p.convertBoolDirectionToString(this.props.isDirectionRightToLeft),key:"2"})):null}get itemRender(){return this.props.item.render||this.props.itemRender}get linkRender(){return this.props.item.linkRender||this.props.linkRender}get contentRender(){return this.props.item.contentParentItemId?this.props.item.contentRender:null}get Opened(){const e=this.props;return e.item.items.length>0&&m.shouldOpenItem(e.item.id,e.lastItemIdToBeOpened)&&!this.isFirstRender}getPopupClassName(){return a.classNames("k-menu-popup",{"k-rtl":this.props.isDirectionRightToLeft})}getMenuItemClassName(e){return a.classNames("k-item","k-menu-item",{"k-first":m.isFirstItemFromSiblings(e.id),"k-last":e.isLastFromSiblings,"k-disabled":e.disabled},e.cssClass)}}exports.MenuItemInternal=l;exports.MenuItemInternalsList=u;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as s from "react";
|
|
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
|
-
class
|
|
9
|
+
import { getActiveElement as u, IconWrap as h, classNames as p } from "@progress/kendo-react-common";
|
|
10
|
+
import { Popup as c } from "@progress/kendo-react-popup";
|
|
11
|
+
import { shouldOpenItem as I, isFirstItemFromSiblings as M } from "../utils/itemsIdsUtils.mjs";
|
|
12
|
+
import { getDOMElementId as d, convertBoolDirectionToString as m, getPopupSettings as g } from "../utils/misc.mjs";
|
|
13
|
+
import { MenuItemLink as f } from "./MenuItemLink.mjs";
|
|
14
|
+
import { MenuItemArrow as v } from "./MenuItemArrow.mjs";
|
|
15
|
+
class k extends s.Component {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.onMouseOver = (e) => {
|
|
18
18
|
this.props.onMouseOver(this.props.parentItemId), e.stopPropagation();
|
|
@@ -27,7 +27,7 @@ class f extends s.Component {
|
|
|
27
27
|
{
|
|
28
28
|
className: this.props.className,
|
|
29
29
|
role: this.props.role ? this.props.role : e !== void 0 ? "menu" : "menubar",
|
|
30
|
-
id: e !== void 0 ?
|
|
30
|
+
id: e !== void 0 ? d(this.props.menuGuid, e) : void 0,
|
|
31
31
|
onMouseOver: e !== void 0 ? this.onMouseOver : void 0,
|
|
32
32
|
onMouseLeave: e !== void 0 ? this.onMouseLeave : void 0,
|
|
33
33
|
"aria-orientation": this.props["aria-orientation"]
|
|
@@ -37,9 +37,10 @@ class f extends s.Component {
|
|
|
37
37
|
}
|
|
38
38
|
renderChildItems() {
|
|
39
39
|
return this.props.items.length > 0 ? this.props.items.map((e, t) => /* @__PURE__ */ s.createElement(
|
|
40
|
-
|
|
40
|
+
O,
|
|
41
41
|
{
|
|
42
42
|
item: e,
|
|
43
|
+
animate: this.props.animate,
|
|
43
44
|
isMenuVertical: this.props.isMenuVertical,
|
|
44
45
|
isDirectionRightToLeft: this.props.isDirectionRightToLeft,
|
|
45
46
|
focusedItemId: this.props.focusedItemId,
|
|
@@ -60,7 +61,7 @@ class f extends s.Component {
|
|
|
60
61
|
)) : null;
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
class
|
|
64
|
+
class O extends s.Component {
|
|
64
65
|
constructor(e) {
|
|
65
66
|
super(e), this.isFirstRender = !0, this.onMouseOver = (t) => {
|
|
66
67
|
this.props.onMouseOver(this.props.item.id), t.stopPropagation();
|
|
@@ -73,47 +74,47 @@ class v extends s.Component {
|
|
|
73
74
|
e && e === t && this.itemElement.focus({ preventScroll: !0 }), this.isFirstRender = !1;
|
|
74
75
|
}
|
|
75
76
|
componentDidUpdate(e) {
|
|
76
|
-
const t = this.props.focusedItemId,
|
|
77
|
+
const t = this.props.focusedItemId, o = this.props.item.id;
|
|
77
78
|
if (t) {
|
|
78
|
-
const n =
|
|
79
|
-
e.focusedItemId !== t && t ===
|
|
79
|
+
const n = u(document);
|
|
80
|
+
e.focusedItemId !== t && t === o && // https://github.com/telerik/kendo-react/issues/216 :
|
|
80
81
|
// No need to focus the wrapping menu item DOM element
|
|
81
82
|
// when a child DOM element was clicked.
|
|
82
83
|
!this.itemElement.contains(n) && this.itemElement.focus({ preventScroll: !0 });
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
render() {
|
|
86
|
-
const e = this.props.item, t = e.id,
|
|
87
|
+
const e = this.props.item, t = e.id, o = d(this.props.menuGuid, t), n = e.separator;
|
|
87
88
|
return /* @__PURE__ */ s.createElement(s.Fragment, null, n ? /* @__PURE__ */ s.createElement(
|
|
88
89
|
"li",
|
|
89
90
|
{
|
|
90
91
|
className: "k-separator k-item",
|
|
91
92
|
"aria-hidden": !0,
|
|
92
|
-
key:
|
|
93
|
-
id:
|
|
94
|
-
ref: (
|
|
93
|
+
key: o,
|
|
94
|
+
id: o,
|
|
95
|
+
ref: (i) => this.itemElement = i
|
|
95
96
|
}
|
|
96
97
|
) : /* @__PURE__ */ s.createElement(
|
|
97
98
|
"li",
|
|
98
99
|
{
|
|
99
|
-
id:
|
|
100
|
+
id: o,
|
|
100
101
|
className: this.getMenuItemClassName(e),
|
|
101
102
|
style: e.cssStyle,
|
|
102
103
|
tabIndex: t === this.props.tabbableItemId ? 0 : -1,
|
|
103
104
|
onMouseOver: this.onMouseOver,
|
|
104
105
|
onMouseLeave: this.onMouseLeave,
|
|
105
|
-
onMouseDown: (
|
|
106
|
-
onBlur: (
|
|
106
|
+
onMouseDown: (i) => this.props.onMouseDown(i),
|
|
107
|
+
onBlur: (i) => this.props.onBlur(t, i),
|
|
107
108
|
onFocus: () => this.props.onFocus(t),
|
|
108
|
-
onClick: (
|
|
109
|
+
onClick: (i) => this.props.onClick(i, t),
|
|
109
110
|
role: "menuitem",
|
|
110
111
|
"aria-disabled": e.disabled ? !0 : void 0,
|
|
111
112
|
"aria-haspopup": e.items.length > 0 ? !0 : void 0,
|
|
112
113
|
"aria-expanded": e.items.length > 0 ? this.Opened : void 0,
|
|
113
114
|
"aria-label": e.text,
|
|
114
|
-
"aria-owns": this.Opened ?
|
|
115
|
-
ref: (
|
|
116
|
-
key:
|
|
115
|
+
"aria-owns": this.Opened ? o : void 0,
|
|
116
|
+
ref: (i) => this.itemElement = i,
|
|
117
|
+
key: o
|
|
117
118
|
},
|
|
118
119
|
this.contentRender ? this.renderContent() : this.renderMenuItemLink()
|
|
119
120
|
), this.renderPopupIfOpened());
|
|
@@ -131,69 +132,71 @@ class v extends s.Component {
|
|
|
131
132
|
item: this.props.onOriginalItemNeeded(e.id),
|
|
132
133
|
itemId: e.id,
|
|
133
134
|
opened: this.Opened,
|
|
134
|
-
dir:
|
|
135
|
+
dir: m(this.props.isDirectionRightToLeft)
|
|
135
136
|
}
|
|
136
137
|
);
|
|
137
138
|
const t = this.itemRender ? /* @__PURE__ */ s.createElement(this.itemRender, { item: this.props.onOriginalItemNeeded(e.id), itemId: e.id, key: "1" }) : /* @__PURE__ */ s.createElement("span", { className: "k-menu-link-text" }, e.text);
|
|
138
|
-
return /* @__PURE__ */ s.createElement(
|
|
139
|
+
return /* @__PURE__ */ s.createElement(f, { url: e.url, opened: this.Opened }, this.renderMenuIconIfApplicable(), t, this.renderArrowIfApplicable());
|
|
139
140
|
}
|
|
140
141
|
renderPopupIfOpened() {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
const e = this.props.item.id, t = this.props.animate, { anchorAlign: o, popupAlign: n, collision: i, animationDirection: r } = g(
|
|
143
|
+
e,
|
|
144
|
+
this.props.isMenuVertical,
|
|
145
|
+
this.props.isDirectionRightToLeft
|
|
146
|
+
), l = t === !0 ? { openDuration: 300, closeDuration: 300, direction: r } : t === !1 ? !1 : {
|
|
147
|
+
openDuration: (t == null ? void 0 : t.openDuration) || 300,
|
|
148
|
+
closeDuration: (t == null ? void 0 : t.closeDuration) || 300,
|
|
149
|
+
direction: (t == null ? void 0 : t.direction) || r
|
|
150
|
+
};
|
|
151
|
+
return /* @__PURE__ */ s.createElement(
|
|
152
|
+
c,
|
|
153
|
+
{
|
|
154
|
+
anchor: this.itemElement,
|
|
155
|
+
show: this.Opened,
|
|
156
|
+
popupClass: this.getPopupClassName(),
|
|
157
|
+
anchorAlign: o,
|
|
158
|
+
popupAlign: n,
|
|
159
|
+
collision: i,
|
|
160
|
+
animate: l,
|
|
161
|
+
key: "1"
|
|
162
|
+
},
|
|
163
|
+
/* @__PURE__ */ s.createElement(
|
|
164
|
+
k,
|
|
149
165
|
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
className: "k-group k-menu-group k-reset k-menu-group-md",
|
|
173
|
-
onMouseOver: this.props.onMouseOver,
|
|
174
|
-
onMouseLeave: this.props.onMouseLeave,
|
|
175
|
-
onMouseDown: this.props.onMouseDown,
|
|
176
|
-
onBlur: this.props.onBlur,
|
|
177
|
-
onFocus: this.props.onFocus,
|
|
178
|
-
onClick: this.props.onClick,
|
|
179
|
-
onOriginalItemNeeded: this.props.onOriginalItemNeeded
|
|
180
|
-
}
|
|
181
|
-
)
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
return null;
|
|
166
|
+
parentItemId: e,
|
|
167
|
+
animate: this.props.animate,
|
|
168
|
+
items: this.props.item.items,
|
|
169
|
+
menuGuid: this.props.menuGuid,
|
|
170
|
+
focusedItemId: this.props.focusedItemId,
|
|
171
|
+
lastItemIdToBeOpened: this.props.lastItemIdToBeOpened,
|
|
172
|
+
tabbableItemId: this.props.tabbableItemId,
|
|
173
|
+
itemRender: this.props.itemRender,
|
|
174
|
+
linkRender: this.props.linkRender,
|
|
175
|
+
isMenuVertical: this.props.isMenuVertical,
|
|
176
|
+
isDirectionRightToLeft: this.props.isDirectionRightToLeft,
|
|
177
|
+
className: "k-group k-menu-group k-reset k-menu-group-md",
|
|
178
|
+
onMouseOver: this.props.onMouseOver,
|
|
179
|
+
onMouseLeave: this.props.onMouseLeave,
|
|
180
|
+
onMouseDown: this.props.onMouseDown,
|
|
181
|
+
onBlur: this.props.onBlur,
|
|
182
|
+
onFocus: this.props.onFocus,
|
|
183
|
+
onClick: this.props.onClick,
|
|
184
|
+
onOriginalItemNeeded: this.props.onOriginalItemNeeded
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
);
|
|
185
188
|
}
|
|
186
189
|
renderMenuIconIfApplicable() {
|
|
187
190
|
const { icon: e, svgIcon: t } = this.props.item;
|
|
188
|
-
return e || t ? /* @__PURE__ */ s.createElement(
|
|
191
|
+
return e || t ? /* @__PURE__ */ s.createElement(h, { name: e, icon: t, key: "0" }) : null;
|
|
189
192
|
}
|
|
190
193
|
renderArrowIfApplicable() {
|
|
191
194
|
return this.props.item.items.length > 0 ? /* @__PURE__ */ s.createElement("span", { className: "k-menu-expand-arrow", "aria-hidden": !0 }, /* @__PURE__ */ s.createElement(
|
|
192
|
-
|
|
195
|
+
v,
|
|
193
196
|
{
|
|
194
197
|
itemId: this.props.item.id,
|
|
195
198
|
verticalMenu: this.props.isMenuVertical,
|
|
196
|
-
dir:
|
|
199
|
+
dir: m(this.props.isDirectionRightToLeft),
|
|
197
200
|
key: "2"
|
|
198
201
|
}
|
|
199
202
|
)) : null;
|
|
@@ -209,19 +212,19 @@ class v extends s.Component {
|
|
|
209
212
|
}
|
|
210
213
|
get Opened() {
|
|
211
214
|
const e = this.props;
|
|
212
|
-
return e.item.items.length > 0 &&
|
|
215
|
+
return e.item.items.length > 0 && I(e.item.id, e.lastItemIdToBeOpened) && // HACK: Wait for the second render because otherwise the scenario of
|
|
213
216
|
// popup inside popup throws an error (for example, hover of item with id '0_0').
|
|
214
217
|
!this.isFirstRender;
|
|
215
218
|
}
|
|
216
219
|
getPopupClassName() {
|
|
217
|
-
return
|
|
220
|
+
return p("k-menu-popup", { "k-rtl": this.props.isDirectionRightToLeft });
|
|
218
221
|
}
|
|
219
222
|
getMenuItemClassName(e) {
|
|
220
|
-
return
|
|
223
|
+
return p(
|
|
221
224
|
"k-item",
|
|
222
225
|
"k-menu-item",
|
|
223
226
|
{
|
|
224
|
-
"k-first":
|
|
227
|
+
"k-first": M(e.id),
|
|
225
228
|
"k-last": e.isLastFromSiblings,
|
|
226
229
|
"k-disabled": e.disabled
|
|
227
230
|
},
|
|
@@ -230,6 +233,6 @@ class v extends s.Component {
|
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
235
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
O as MenuItemInternal,
|
|
237
|
+
k as MenuItemInternalsList
|
|
235
238
|
};
|
package/menu/consts.js
CHANGED
|
@@ -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 i={vertical:"top",horizontal:"left"},n={vertical:"top",horizontal:"left"},l={vertical:"top",horizontal:"right"},r={vertical:"top",horizontal:"right"},o={vertical:"flip",horizontal:"fit"},t={vertical:"fit",horizontal:"flip"},a={downward:{anchorAlign:{vertical:"bottom",horizontal:"right"},popupAlign:l,collision:o,animationDirection:"down"},leftward:{anchorAlign:{vertical:"top",horizontal:"left"},popupAlign:r,collision:t,animationDirection:"left"}},c={downward:{anchorAlign:{vertical:"bottom",horizontal:"left"},popupAlign:i,collision:o,animationDirection:"down"},rightward:{anchorAlign:{vertical:"top",horizontal:"right"},popupAlign:n,collision:t,animationDirection:"right"}};exports.POPUP_SETTINGS=c;exports.POPUP_SETTINGS_RTL=a;
|