@progress/kendo-react-layout 8.6.0-develop.1 → 9.0.0-develop.10
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 +82 -82
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +25 -38
- package/actionsheet/ActionSheetFooter.mjs +1 -10
- package/actionsheet/ActionSheetHeader.mjs +1 -10
- package/actionsheet/ActionSheetItem.mjs +10 -7
- package/appbar/AppBar.mjs +5 -30
- package/appbar/AppBarSection.mjs +4 -17
- package/appbar/AppBarSpacer.mjs +6 -16
- package/bottomnavigation/BottomNavigation.mjs +30 -54
- package/bottomnavigation/BottomNavigationItem.mjs +63 -61
- package/breadcrumb/Breadcrumb.mjs +39 -63
- package/breadcrumb/BreadcrumbDelimiter.mjs +29 -24
- package/breadcrumb/BreadcrumbLink.mjs +16 -18
- package/breadcrumb/BreadcrumbListItem.mjs +31 -29
- package/breadcrumb/BreadcrumbOrderedList.mjs +47 -42
- package/card/Avatar.mjs +15 -1
- package/card/CardBody.mjs +1 -11
- package/card/CardFooter.mjs +1 -11
- package/card/CardHeader.mjs +1 -11
- package/card/CardImage.mjs +1 -4
- package/card/CardSubtitle.mjs +1 -11
- package/card/CardTitle.mjs +1 -11
- package/contextmenu/ContextMenu.js +1 -1
- package/contextmenu/ContextMenu.mjs +12 -24
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.mjs +10 -21
- package/drawer/DrawerContent.mjs +6 -3
- package/drawer/DrawerItem.mjs +10 -10
- package/drawer/DrawerNavigation.mjs +109 -130
- package/expansionpanel/ExpansionPanel.mjs +12 -15
- package/expansionpanel/ExpansionPanelContent.mjs +3 -9
- package/gridlayout/GridLayout.mjs +1 -10
- package/gridlayout/GridLayoutItem.mjs +1 -10
- package/index.d.mts +10 -0
- package/index.d.ts +10 -0
- package/menu/components/MenuItem.js +1 -1
- package/menu/components/MenuItem.mjs +17 -16
- package/menu/components/MenuItemInternal.js +1 -1
- package/menu/components/MenuItemInternal.mjs +35 -34
- package/menu/components/MenuItemLink.mjs +4 -17
- package/menu/utils/getNewItemIdUponKeyboardNavigation.js +1 -1
- package/menu/utils/getNewItemIdUponKeyboardNavigation.mjs +55 -57
- package/menu/utils/hoverDelay.js +1 -1
- package/menu/utils/hoverDelay.mjs +2 -2
- package/menu/utils/itemsIdsUtils.js +1 -1
- package/menu/utils/itemsIdsUtils.mjs +14 -18
- package/menu/utils/misc.js +1 -1
- package/menu/utils/misc.mjs +2 -2
- package/menu/utils/prepareInputItemsForInternalWork.js +1 -1
- package/menu/utils/prepareInputItemsForInternalWork.mjs +50 -35
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/panelbar/PanelBar.mjs +2 -7
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +27 -40
- package/splitter/SplitterBar.mjs +23 -40
- package/splitter/SplitterPane.mjs +1 -11
- package/stacklayout/StackLayout.mjs +2 -14
- package/stepper/Step.mjs +25 -46
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +147 -186
- package/tabstrip/TabStripContent.mjs +2 -14
- package/tabstrip/TabStripTab.mjs +2 -9
- package/tilelayout/InternalTile.mjs +31 -19
- package/tilelayout/ResizeHandlers.mjs +7 -1
- package/tilelayout/TileLayout.mjs +24 -20
- package/timeline/TimelineCard.mjs +1 -4
- package/timeline/TimelineHorizontal.mjs +52 -63
- package/timeline/TimelineVertical.mjs +7 -5
- package/timeline/utils.mjs +4 -1
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as s from "react";
|
|
10
|
-
import { getActiveElement as
|
|
10
|
+
import { getActiveElement as a, IconWrap as l, classNames as p } from "@progress/kendo-react-common";
|
|
11
11
|
import { Popup as u } from "@progress/kendo-react-popup";
|
|
12
|
-
import { shouldOpenItem as
|
|
13
|
-
import { getDOMElementId as
|
|
14
|
-
import { MenuItemLink as
|
|
15
|
-
import { MenuItemArrow as
|
|
16
|
-
class
|
|
12
|
+
import { shouldOpenItem as h, isFirstItemFromSiblings as c } from "../utils/itemsIdsUtils.mjs";
|
|
13
|
+
import { getDOMElementId as r, convertBoolDirectionToString as m, getPopupSettings as I } from "../utils/misc.mjs";
|
|
14
|
+
import { MenuItemLink as M } from "./MenuItemLink.mjs";
|
|
15
|
+
import { MenuItemArrow as g } from "./MenuItemArrow.mjs";
|
|
16
|
+
class v extends s.Component {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments), this.onMouseOver = (e) => {
|
|
19
19
|
this.props.onMouseOver(this.props.parentItemId), e.stopPropagation();
|
|
@@ -28,7 +28,7 @@ class g extends s.Component {
|
|
|
28
28
|
{
|
|
29
29
|
className: this.props.className,
|
|
30
30
|
role: this.props.role ? this.props.role : e !== void 0 ? "menu" : "menubar",
|
|
31
|
-
id: e !== void 0 ?
|
|
31
|
+
id: e !== void 0 ? r(this.props.menuGuid, e) : void 0,
|
|
32
32
|
onMouseOver: e !== void 0 ? this.onMouseOver : void 0,
|
|
33
33
|
onMouseLeave: e !== void 0 ? this.onMouseLeave : void 0,
|
|
34
34
|
"aria-orientation": this.props["aria-orientation"]
|
|
@@ -38,7 +38,7 @@ class g extends s.Component {
|
|
|
38
38
|
}
|
|
39
39
|
renderChildItems() {
|
|
40
40
|
return this.props.items.length > 0 ? this.props.items.map((e, t) => /* @__PURE__ */ s.createElement(
|
|
41
|
-
|
|
41
|
+
f,
|
|
42
42
|
{
|
|
43
43
|
item: e,
|
|
44
44
|
isMenuVertical: this.props.isMenuVertical,
|
|
@@ -61,7 +61,7 @@ class g extends s.Component {
|
|
|
61
61
|
)) : null;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
class
|
|
64
|
+
class f extends s.Component {
|
|
65
65
|
constructor(e) {
|
|
66
66
|
super(e), this.isFirstRender = !0, this.onMouseOver = (t) => {
|
|
67
67
|
this.props.onMouseOver(this.props.item.id), t.stopPropagation();
|
|
@@ -76,19 +76,19 @@ class v extends s.Component {
|
|
|
76
76
|
componentDidUpdate(e) {
|
|
77
77
|
const t = this.props.focusedItemId, o = this.props.item.id;
|
|
78
78
|
if (t) {
|
|
79
|
-
const
|
|
79
|
+
const n = a(document);
|
|
80
80
|
e.focusedItemId !== t && t === o && // https://github.com/telerik/kendo-react/issues/216 :
|
|
81
81
|
// No need to focus the wrapping menu item DOM element
|
|
82
82
|
// when a child DOM element was clicked.
|
|
83
|
-
!this.itemElement.contains(
|
|
83
|
+
!this.itemElement.contains(n) && this.itemElement.focus({ preventScroll: !0 });
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
const e = this.props.item, t = e.id, o =
|
|
88
|
-
return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
87
|
+
const e = this.props.item, t = e.id, o = r(this.props.menuGuid, t), n = e.separator;
|
|
88
|
+
return /* @__PURE__ */ s.createElement(s.Fragment, null, n ? /* @__PURE__ */ s.createElement("li", { className: "k-separator k-item", "aria-hidden": !0, key: o }) : /* @__PURE__ */ s.createElement(
|
|
89
89
|
"li",
|
|
90
90
|
{
|
|
91
|
-
id:
|
|
91
|
+
id: r(this.props.menuGuid, t),
|
|
92
92
|
className: this.getMenuItemClassName(e),
|
|
93
93
|
style: e.cssStyle,
|
|
94
94
|
tabIndex: t === this.props.tabbableItemId ? 0 : -1,
|
|
@@ -105,10 +105,10 @@ class v extends s.Component {
|
|
|
105
105
|
"aria-label": e.text,
|
|
106
106
|
"aria-owns": this.Opened ? o : void 0,
|
|
107
107
|
ref: (i) => this.itemElement = i,
|
|
108
|
-
key:
|
|
108
|
+
key: o
|
|
109
109
|
},
|
|
110
110
|
this.contentRender ? this.renderContent() : this.renderMenuItemLink()
|
|
111
|
-
), this.renderPopupIfOpened());
|
|
111
|
+
), this.renderPopupIfOpened(this.itemElement));
|
|
112
112
|
}
|
|
113
113
|
renderContent() {
|
|
114
114
|
const e = this.props.item.contentParentItemId;
|
|
@@ -123,16 +123,16 @@ class v extends s.Component {
|
|
|
123
123
|
item: this.props.onOriginalItemNeeded(e.id),
|
|
124
124
|
itemId: e.id,
|
|
125
125
|
opened: this.Opened,
|
|
126
|
-
dir:
|
|
126
|
+
dir: m(this.props.isDirectionRightToLeft)
|
|
127
127
|
}
|
|
128
128
|
);
|
|
129
129
|
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);
|
|
130
|
-
return /* @__PURE__ */ s.createElement(
|
|
130
|
+
return /* @__PURE__ */ s.createElement(M, { url: e.url, opened: this.Opened }, this.renderMenuIconIfApplicable(), t, this.renderArrowIfApplicable());
|
|
131
131
|
}
|
|
132
|
-
renderPopupIfOpened() {
|
|
132
|
+
renderPopupIfOpened(e) {
|
|
133
133
|
if (this.Opened) {
|
|
134
|
-
const
|
|
135
|
-
|
|
134
|
+
const t = this.props.item.id, { anchorAlign: o, popupAlign: n, collision: i } = I(
|
|
135
|
+
t,
|
|
136
136
|
this.props.isMenuVertical,
|
|
137
137
|
this.props.isDirectionRightToLeft
|
|
138
138
|
);
|
|
@@ -140,18 +140,19 @@ class v extends s.Component {
|
|
|
140
140
|
u,
|
|
141
141
|
{
|
|
142
142
|
anchor: this.itemElement,
|
|
143
|
+
appendTo: e,
|
|
143
144
|
show: !0,
|
|
144
145
|
popupClass: this.getPopupClassName(),
|
|
145
|
-
anchorAlign:
|
|
146
|
-
popupAlign:
|
|
146
|
+
anchorAlign: o,
|
|
147
|
+
popupAlign: n,
|
|
147
148
|
collision: i,
|
|
148
149
|
animate: !1,
|
|
149
150
|
key: "1"
|
|
150
151
|
},
|
|
151
152
|
/* @__PURE__ */ s.createElement(
|
|
152
|
-
|
|
153
|
+
v,
|
|
153
154
|
{
|
|
154
|
-
parentItemId:
|
|
155
|
+
parentItemId: t,
|
|
155
156
|
items: this.props.item.items,
|
|
156
157
|
menuGuid: this.props.menuGuid,
|
|
157
158
|
focusedItemId: this.props.focusedItemId,
|
|
@@ -177,15 +178,15 @@ class v extends s.Component {
|
|
|
177
178
|
}
|
|
178
179
|
renderMenuIconIfApplicable() {
|
|
179
180
|
const { icon: e, svgIcon: t } = this.props.item;
|
|
180
|
-
return e || t ? /* @__PURE__ */ s.createElement(
|
|
181
|
+
return e || t ? /* @__PURE__ */ s.createElement(l, { name: e, icon: t, key: "0" }) : null;
|
|
181
182
|
}
|
|
182
183
|
renderArrowIfApplicable() {
|
|
183
184
|
return this.props.item.items.length > 0 ? /* @__PURE__ */ s.createElement("span", { className: "k-menu-expand-arrow", "aria-hidden": !0 }, /* @__PURE__ */ s.createElement(
|
|
184
|
-
|
|
185
|
+
g,
|
|
185
186
|
{
|
|
186
187
|
itemId: this.props.item.id,
|
|
187
188
|
verticalMenu: this.props.isMenuVertical,
|
|
188
|
-
dir:
|
|
189
|
+
dir: m(this.props.isDirectionRightToLeft),
|
|
189
190
|
key: "2"
|
|
190
191
|
}
|
|
191
192
|
)) : null;
|
|
@@ -201,19 +202,19 @@ class v extends s.Component {
|
|
|
201
202
|
}
|
|
202
203
|
get Opened() {
|
|
203
204
|
const e = this.props;
|
|
204
|
-
return e.item.items.length > 0 &&
|
|
205
|
+
return e.item.items.length > 0 && h(e.item.id, e.lastItemIdToBeOpened) && // HACK: Wait for the second render because otherwise the scenario of
|
|
205
206
|
// popup inside popup throws an error (for example, hover of item with id '0_0').
|
|
206
207
|
!this.isFirstRender;
|
|
207
208
|
}
|
|
208
209
|
getPopupClassName() {
|
|
209
|
-
return
|
|
210
|
+
return p("k-menu-popup k-overflow-visible", { "k-rtl": this.props.isDirectionRightToLeft });
|
|
210
211
|
}
|
|
211
212
|
getMenuItemClassName(e) {
|
|
212
|
-
return
|
|
213
|
+
return p(
|
|
213
214
|
"k-item",
|
|
214
215
|
"k-menu-item",
|
|
215
216
|
{
|
|
216
|
-
"k-first":
|
|
217
|
+
"k-first": c(e.id),
|
|
217
218
|
"k-last": e.isLastFromSiblings,
|
|
218
219
|
"k-disabled": e.disabled
|
|
219
220
|
},
|
|
@@ -222,6 +223,6 @@ class v extends s.Component {
|
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
export {
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
f as MenuItemInternal,
|
|
227
|
+
v as MenuItemInternalsList
|
|
227
228
|
};
|
|
@@ -14,16 +14,7 @@ const s = class s extends e.Component {
|
|
|
14
14
|
* @hidden
|
|
15
15
|
*/
|
|
16
16
|
render() {
|
|
17
|
-
return this.props.url ? /* @__PURE__ */ e.createElement(
|
|
18
|
-
"a",
|
|
19
|
-
{
|
|
20
|
-
className: this.getMenuItemClassName(),
|
|
21
|
-
role: "presentation",
|
|
22
|
-
href: this.props.url,
|
|
23
|
-
tabIndex: -1
|
|
24
|
-
},
|
|
25
|
-
this.props.children
|
|
26
|
-
) : /* @__PURE__ */ e.createElement(
|
|
17
|
+
return this.props.url ? /* @__PURE__ */ e.createElement("a", { className: this.getMenuItemClassName(), role: "presentation", href: this.props.url, tabIndex: -1 }, this.props.children) : /* @__PURE__ */ e.createElement(
|
|
27
18
|
"span",
|
|
28
19
|
{
|
|
29
20
|
id: this.props.id,
|
|
@@ -35,13 +26,9 @@ const s = class s extends e.Component {
|
|
|
35
26
|
);
|
|
36
27
|
}
|
|
37
28
|
getMenuItemClassName() {
|
|
38
|
-
return r(
|
|
39
|
-
"k-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
"k-active": this.props.opened
|
|
43
|
-
}
|
|
44
|
-
);
|
|
29
|
+
return r("k-link", "k-menu-link", {
|
|
30
|
+
"k-active": this.props.opened
|
|
31
|
+
});
|
|
45
32
|
}
|
|
46
33
|
};
|
|
47
34
|
s.propTypes = {
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@progress/kendo-react-common"),n=require("./itemsIdsUtils.js"),A=/\S/;function M(
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@progress/kendo-react-common"),n=require("./itemsIdsUtils.js"),A=/\S/;function M(u,e,P,y,l,d){const Z=g();switch(P){case i.Keys.left:return E();case i.Keys.right:return w();case i.Keys.up:return O();case i.Keys.down:return N();case i.Keys.enter:case i.Keys.space:return R();case i.Keys.home:return D();case i.Keys.end:return G();case i.Keys.esc:return H();default:return q()?B():e}function E(){return l?d?v():S():d?p():b()}function w(){return l?d?S():v():d?b():p()}function N(){return l?a():n.isIdZeroLevel(e)?s():a()}function O(){return l?c():n.isIdZeroLevel(e)?L():c()}function R(){return Z.disabled?e:f()?n.getFirstChildId(e):n.getRootParentId(e)}function D(){return K()[0].id}function G(){const t=K();return t[t.length-1].id}function H(){return n.isIdZeroLevel(e)?e:n.getDirectParentId(e)}function B(){const t=y.toLowerCase(),r=K(),o=Number(n.getShortId(e)),h=r.slice(o+1).concat(r.slice(0,o+1)).find(z=>(z.text||"").toLowerCase().startsWith(t));return h?h.id:e}function b(){return n.isIdZeroLevel(e)?c():n.isIdFirstLevel(e)?s(c(n.getRootParentId(e))):n.getDirectParentId(e)}function S(){return n.isIdZeroLevel(e)?L():n.getDirectParentId(e)}function p(){return n.isIdZeroLevel(e)?a():s(f()?e:a(n.getRootParentId(e)))}function v(){return s(n.isIdZeroLevel(e)||f()?e:a(n.getRootParentId(e)))}function s(t){return U(!0,t)}function L(t){return U(!1,t)}function q(){return y.length===1&&A.test(y)}function g(t,r){return t===void 0&&(t=e),r===void 0&&(r=u),n.getItemById(t,r)}function f(t){return g(t).items.length>0}function c(t){return C(!1,t)}function a(t){return C(!0,t)}function x(t){const r=g(t).items;return r[r.length-1].id}function K(){return n.isIdZeroLevel(e)?u:g(n.getDirectParentId(e),u).items}function U(t,r){r===void 0&&(r=e);const o=g(r);return f(r)&&!o.disabled?t?n.getFirstChildId(r):x(r):r}function C(t,r){if(r===void 0&&(r=e),n.isIdZeroLevel(r))return n.getDirectSiblingIdForLevelZero(t,r,u.length);const o=n.getDirectParentId(r),F=n.getShortId(r),h=g(o).items.length;return n.createId(n.getDirectSiblingIdForLevelZero(t,F,h),o)}}exports.getNewItemIdUponKeyboardNavigation=M;
|
|
@@ -6,117 +6,115 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { Keys as
|
|
10
|
-
import { isIdZeroLevel as i, getFirstChildId as N, getRootParentId as b, getDirectParentId as
|
|
9
|
+
import { Keys as e } from "@progress/kendo-react-common";
|
|
10
|
+
import { isIdZeroLevel as i, getFirstChildId as N, getRootParentId as b, getDirectParentId as a, getShortId as O, isIdFirstLevel as q, getItemById as D, getDirectSiblingIdForLevelZero as P, createId as J } from "./itemsIdsUtils.mjs";
|
|
11
11
|
const Q = /\S/;
|
|
12
|
-
function V(
|
|
13
|
-
const H =
|
|
12
|
+
function V(g, n, G, S, l, c) {
|
|
13
|
+
const H = u();
|
|
14
14
|
switch (G) {
|
|
15
|
-
case
|
|
15
|
+
case e.left:
|
|
16
16
|
return x();
|
|
17
|
-
case
|
|
17
|
+
case e.right:
|
|
18
18
|
return B();
|
|
19
|
-
case
|
|
19
|
+
case e.up:
|
|
20
20
|
return A();
|
|
21
|
-
case
|
|
21
|
+
case e.down:
|
|
22
22
|
return z();
|
|
23
|
-
case
|
|
24
|
-
case
|
|
23
|
+
case e.enter:
|
|
24
|
+
case e.space:
|
|
25
25
|
return R();
|
|
26
|
-
case
|
|
26
|
+
case e.home:
|
|
27
27
|
return W();
|
|
28
|
-
case
|
|
28
|
+
case e.end:
|
|
29
29
|
return Z();
|
|
30
|
-
case
|
|
30
|
+
case e.esc:
|
|
31
31
|
return _();
|
|
32
32
|
default:
|
|
33
33
|
return X() ? M() : n;
|
|
34
34
|
}
|
|
35
35
|
function x() {
|
|
36
|
-
return
|
|
36
|
+
return l ? c ? F() : U() : c ? C() : K();
|
|
37
37
|
}
|
|
38
38
|
function B() {
|
|
39
|
-
return
|
|
39
|
+
return l ? c ? U() : F() : c ? K() : C();
|
|
40
40
|
}
|
|
41
41
|
function z() {
|
|
42
|
-
return
|
|
42
|
+
return l ? f() : i(n) ? d() : f();
|
|
43
43
|
}
|
|
44
44
|
function A() {
|
|
45
|
-
return
|
|
45
|
+
return l ? s() : i(n) ? E() : s();
|
|
46
46
|
}
|
|
47
47
|
function R() {
|
|
48
|
-
return H.disabled ? n :
|
|
48
|
+
return H.disabled ? n : h() ? N(n) : b(n);
|
|
49
49
|
}
|
|
50
50
|
function W() {
|
|
51
51
|
return y()[0].id;
|
|
52
52
|
}
|
|
53
53
|
function Z() {
|
|
54
|
-
const
|
|
55
|
-
return
|
|
54
|
+
const t = y();
|
|
55
|
+
return t[t.length - 1].id;
|
|
56
56
|
}
|
|
57
57
|
function _() {
|
|
58
|
-
return i(n) ? n :
|
|
58
|
+
return i(n) ? n : a(n);
|
|
59
59
|
}
|
|
60
60
|
function M() {
|
|
61
|
-
const
|
|
61
|
+
const t = S.toLowerCase(), r = y(), o = Number(O(n)), p = r.slice(o + 1).concat(r.slice(0, o + 1)).find((j) => (j.text || "").toLowerCase().startsWith(t));
|
|
62
62
|
return p ? p.id : n;
|
|
63
63
|
}
|
|
64
64
|
function K() {
|
|
65
|
-
return i(n) ?
|
|
65
|
+
return i(n) ? s() : q(n) ? d(s(b(n))) : a(n);
|
|
66
66
|
}
|
|
67
67
|
function U() {
|
|
68
|
-
return i(n) ? E() :
|
|
68
|
+
return i(n) ? E() : a(n);
|
|
69
69
|
}
|
|
70
70
|
function C() {
|
|
71
|
-
return i(n) ?
|
|
72
|
-
|
|
71
|
+
return i(n) ? f() : d(
|
|
72
|
+
h() ? n : f(b(n))
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
function F() {
|
|
76
|
-
return
|
|
77
|
-
i(n) ||
|
|
76
|
+
return d(
|
|
77
|
+
i(n) || h() ? n : f(b(n))
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return v(!0,
|
|
80
|
+
function d(t) {
|
|
81
|
+
return v(!0, t);
|
|
82
82
|
}
|
|
83
|
-
function E(
|
|
84
|
-
return v(!1,
|
|
83
|
+
function E(t) {
|
|
84
|
+
return v(!1, t);
|
|
85
85
|
}
|
|
86
86
|
function X() {
|
|
87
87
|
return S.length === 1 && Q.test(S);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function u(t, r) {
|
|
90
|
+
return t === void 0 && (t = n), r === void 0 && (r = g), D(t, r);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function h(t) {
|
|
93
|
+
return u(t).items.length > 0;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return L(!1,
|
|
95
|
+
function s(t) {
|
|
96
|
+
return L(!1, t);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
return L(!0,
|
|
98
|
+
function f(t) {
|
|
99
|
+
return L(!0, t);
|
|
100
100
|
}
|
|
101
|
-
function $(
|
|
102
|
-
const
|
|
103
|
-
return
|
|
101
|
+
function $(t) {
|
|
102
|
+
const r = u(t).items;
|
|
103
|
+
return r[r.length - 1].id;
|
|
104
104
|
}
|
|
105
105
|
function y() {
|
|
106
|
-
return i(n) ?
|
|
107
|
-
}
|
|
108
|
-
function v(
|
|
109
|
-
|
|
110
|
-
const o =
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
function L(
|
|
114
|
-
if (
|
|
115
|
-
return P(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return J(P(e, w, p), o);
|
|
119
|
-
}
|
|
106
|
+
return i(n) ? g : u(a(n), g).items;
|
|
107
|
+
}
|
|
108
|
+
function v(t, r) {
|
|
109
|
+
r === void 0 && (r = n);
|
|
110
|
+
const o = u(r);
|
|
111
|
+
return h(r) && !o.disabled ? t ? N(r) : $(r) : r;
|
|
112
|
+
}
|
|
113
|
+
function L(t, r) {
|
|
114
|
+
if (r === void 0 && (r = n), i(r))
|
|
115
|
+
return P(t, r, g.length);
|
|
116
|
+
const o = a(r), w = O(r), p = u(o).items.length;
|
|
117
|
+
return J(P(t, w, p), o);
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
120
|
export {
|
package/menu/utils/hoverDelay.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(e){return e.hoverOpenDelay!==void 0?e.hoverOpenDelay:e.openOnClick?0:100}function l(e){return e.hoverCloseDelay!==void 0?e.hoverCloseDelay:100}exports.getHoverCloseDelay=l;exports.getHoverOpenDelay=o;
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
function n(e) {
|
|
10
10
|
return e.hoverOpenDelay !== void 0 ? e.hoverOpenDelay : e.openOnClick ? 0 : 100;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function o(e) {
|
|
13
13
|
return e.hoverCloseDelay !== void 0 ? e.hoverCloseDelay : 100;
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
o as getHoverCloseDelay,
|
|
17
17
|
n as getHoverOpenDelay
|
|
18
18
|
};
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o="",s="0",
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o="",s="0",e="_";function c(t,r){if(u(t))return r[Number(t)];const n=r[Number(g(t))];return n.items?c(f(t),n.items):void 0}function g(t){return i(t)?t:t.split(e)[0]}function f(t){if(i(t))return t;const r=t.indexOf(e);return t.substring(r+1)}function S(t){return l("0",t)}function E(t,r){return r.indexOf(t)===0?r.length===t.length||r.charAt(t.length)===e:!1}function l(t,r){return r?r+e+t:t}function O(t){const r=t.lastIndexOf(e);return r<0?o:t.substring(0,r)}function i(t){return t===o||t.indexOf(e)<0}function u(t){return t!==o&&t.indexOf(e)<0}function b(t){return P(t)===1}function d(t){return a(t)===s}function a(t){const r=t.lastIndexOf(e);return r<0?t:t.substring(r+1)}function L(t,r,n){return u(r)?t?Number(r)<n-1?(Number(r)+1).toString():"0":Number(r)>0?(Number(r)-1).toString():(n-1).toString():r}function P(t){return t.split(e).length-1}exports.EMPTY_ID=o;exports.SEPARATOR=e;exports.ZERO_LEVEL_ZERO_ITEM_ID=s;exports.createId=l;exports.getDirectParentId=O;exports.getDirectSiblingIdForLevelZero=L;exports.getFirstChildId=S;exports.getIdWithoutRootParentId=f;exports.getItemById=c;exports.getRootParentId=g;exports.getShortId=a;exports.isFirstItemFromSiblings=d;exports.isIdEmptyOrZeroLevel=i;exports.isIdFirstLevel=b;exports.isIdZeroLevel=u;exports.shouldOpenItem=E;
|
|
@@ -7,32 +7,28 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
const u = "", c = "0", t = "_";
|
|
10
|
-
function
|
|
10
|
+
function f(n, r) {
|
|
11
11
|
if (i(n))
|
|
12
12
|
return r[Number(n)];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return e.items ? s(g(n), e.items) : void 0;
|
|
16
|
-
}
|
|
13
|
+
const e = r[Number(s(n))];
|
|
14
|
+
return e.items ? f(g(n), e.items) : void 0;
|
|
17
15
|
}
|
|
18
|
-
function
|
|
16
|
+
function s(n) {
|
|
19
17
|
return o(n) ? n : n.split(t)[0];
|
|
20
18
|
}
|
|
21
19
|
function g(n) {
|
|
22
20
|
if (o(n))
|
|
23
21
|
return n;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return n.substring(r + 1);
|
|
27
|
-
}
|
|
22
|
+
const r = n.indexOf(t);
|
|
23
|
+
return n.substring(r + 1);
|
|
28
24
|
}
|
|
29
25
|
function b(n) {
|
|
30
|
-
return
|
|
26
|
+
return a("0", n);
|
|
31
27
|
}
|
|
32
28
|
function x(n, r) {
|
|
33
29
|
return r.indexOf(n) === 0 ? r.length === n.length || r.charAt(n.length) === t : !1;
|
|
34
30
|
}
|
|
35
|
-
function
|
|
31
|
+
function a(n, r) {
|
|
36
32
|
return r ? r + t + n : n;
|
|
37
33
|
}
|
|
38
34
|
function O(n) {
|
|
@@ -49,9 +45,9 @@ function E(n) {
|
|
|
49
45
|
return S(n) === 1;
|
|
50
46
|
}
|
|
51
47
|
function p(n) {
|
|
52
|
-
return
|
|
48
|
+
return l(n) === c;
|
|
53
49
|
}
|
|
54
|
-
function
|
|
50
|
+
function l(n) {
|
|
55
51
|
const r = n.lastIndexOf(t);
|
|
56
52
|
return r < 0 ? n : n.substring(r + 1);
|
|
57
53
|
}
|
|
@@ -65,14 +61,14 @@ export {
|
|
|
65
61
|
u as EMPTY_ID,
|
|
66
62
|
t as SEPARATOR,
|
|
67
63
|
c as ZERO_LEVEL_ZERO_ITEM_ID,
|
|
68
|
-
|
|
64
|
+
a as createId,
|
|
69
65
|
O as getDirectParentId,
|
|
70
66
|
L as getDirectSiblingIdForLevelZero,
|
|
71
67
|
b as getFirstChildId,
|
|
72
68
|
g as getIdWithoutRootParentId,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
f as getItemById,
|
|
70
|
+
s as getRootParentId,
|
|
71
|
+
l as getShortId,
|
|
76
72
|
p as isFirstItemFromSiblings,
|
|
77
73
|
o as isIdEmptyOrZeroLevel,
|
|
78
74
|
E as isIdFirstLevel,
|
package/menu/utils/misc.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../consts.js"),d=require("./itemsIdsUtils.js");function
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../consts.js"),d=require("./itemsIdsUtils.js");function u(t,r,e){const o=i(t,r,e);return e?o==="downward"?n.POPUP_SETTINGS_RTL.downward:n.POPUP_SETTINGS_RTL.leftward:o==="downward"?n.POPUP_SETTINGS.downward:n.POPUP_SETTINGS.rightward}function i(t,r,e){return d.isIdZeroLevel(t)?r?e?"leftward":"rightward":"downward":e?"leftward":"rightward"}function l(t){return t?"rtl":"ltr"}function P(t,r){return`${t}_${r}`}exports.convertBoolDirectionToString=l;exports.getChildrenPosition=i;exports.getDOMElementId=P;exports.getPopupSettings=u;
|
package/menu/utils/misc.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import { POPUP_SETTINGS_RTL as o, POPUP_SETTINGS as d } from "../consts.mjs";
|
|
10
10
|
import { isIdZeroLevel as i } from "./itemsIdsUtils.mjs";
|
|
11
|
-
function
|
|
11
|
+
function l(r, n, t) {
|
|
12
12
|
const e = w(r, n, t);
|
|
13
13
|
return t ? e === "downward" ? o.downward : o.leftward : e === "downward" ? d.downward : d.rightward;
|
|
14
14
|
}
|
|
@@ -25,5 +25,5 @@ export {
|
|
|
25
25
|
f as convertBoolDirectionToString,
|
|
26
26
|
w as getChildrenPosition,
|
|
27
27
|
P as getDOMElementId,
|
|
28
|
-
|
|
28
|
+
l as getPopupSettings
|
|
29
29
|
};
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),s=require("./itemsIdsUtils.js"),R=require("../components/MenuItem.js");function O(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const S=O(y);function C(t,n){if(t&&t.length>0)return{items:u(t),inputItems:t};if(c(n).length>0){const e=h(c(n));return{items:u(e),inputItems:e}}return{items:[],inputItems:[]}}function b(t,n){const e={},{text:r,url:o,icon:i,svgIcon:a,disabled:d,cssClass:l,cssStyle:f,render:p,linkRender:I,contentRender:m,data:g,separator:v}=t||n.props;return r!==void 0&&(e.text=r),o!==void 0&&(e.url=o),i!==void 0&&(e.icon=i),a!==void 0&&(e.svgIcon=a),d!==void 0&&(e.disabled=d),l!==void 0&&(e.cssClass=l),f!==void 0&&(e.cssStyle=f),p!==void 0&&(e.render=p),I!==void 0&&(e.linkRender=I),m!==void 0&&(e.contentRender=m),g!==void 0&&(e.data=g),v!==void 0&&(e.separator=v),e}function c(t){return S.Children.toArray(t).filter(n=>n&&n.type===R.MenuItem)}function h(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e],o=b(void 0,r),i=h(c(r.props.children));i.length>0&&(o.items=i),n.push(o)}return n}function u(t,n){const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=b(o);i.id=s.createId(r.toString(),n),i.isLastFromSiblings=r===t.length-1,i.separator=o.separator===!0,i.items=_(o,i),e.push(i)}return e}function _(t,n){return t.contentRender?[{contentParentItemId:n.id,id:s.createId(s.ZERO_LEVEL_ZERO_ITEM_ID,n.id),isLastFromSiblings:!0,separator:!1,contentRender:t.contentRender,items:[]}]:t.items?u(t.items,n.id):[]}exports.prepareInputItemsForInternalWork=C;
|