@progress/kendo-react-layout 7.4.0 → 7.5.0-develop.2
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/breadcrumb/BreadcrumbLink.js +1 -1
- package/breadcrumb/BreadcrumbLink.mjs +22 -22
- package/card/Card.js +1 -1
- package/card/Card.mjs +19 -19
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/drawer/Drawer.mjs +22 -22
- package/drawer/DrawerNavigation.js +1 -1
- package/drawer/DrawerNavigation.mjs +65 -61
- package/index.d.mts +6 -1
- package/index.d.ts +6 -1
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +6 -7
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +68 -65
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +74 -71
- package/splitter/Splitter.js +1 -1
- package/splitter/Splitter.mjs +6 -7
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +48 -48
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +76 -75
- package/timeline/TimelineCard.js +1 -1
- package/timeline/TimelineCard.mjs +15 -20
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +98 -93
package/drawer/Drawer.mjs
CHANGED
|
@@ -12,11 +12,11 @@ import { DrawerContext as S } from "./context/DrawerContext.mjs";
|
|
|
12
12
|
import { DrawerNavigation as I } from "./DrawerNavigation.mjs";
|
|
13
13
|
import { validatePackage as W, useDir as O, classNames as T } from "@progress/kendo-react-common";
|
|
14
14
|
import { packageMetadata as j } from "../package-metadata.mjs";
|
|
15
|
-
const
|
|
15
|
+
const l = t.forwardRef((d, u) => {
|
|
16
16
|
W(j);
|
|
17
17
|
const {
|
|
18
|
-
expanded:
|
|
19
|
-
mode:
|
|
18
|
+
expanded: n,
|
|
19
|
+
mode: i,
|
|
20
20
|
position: p,
|
|
21
21
|
className: f,
|
|
22
22
|
children: v,
|
|
@@ -29,8 +29,8 @@ const s = t.forwardRef((l, u) => {
|
|
|
29
29
|
item: k,
|
|
30
30
|
tabIndex: g,
|
|
31
31
|
onOverlayClick: x,
|
|
32
|
-
onSelect:
|
|
33
|
-
} =
|
|
32
|
+
onSelect: o
|
|
33
|
+
} = d, r = t.useRef(null), E = t.useCallback(
|
|
34
34
|
() => {
|
|
35
35
|
r.current && r.current.focus();
|
|
36
36
|
},
|
|
@@ -41,26 +41,26 @@ const s = t.forwardRef((l, u) => {
|
|
|
41
41
|
focus: E
|
|
42
42
|
}));
|
|
43
43
|
const N = t.useCallback(
|
|
44
|
-
(D, P,
|
|
45
|
-
if (a &&
|
|
44
|
+
(D, P, s) => {
|
|
45
|
+
if (a && o) {
|
|
46
46
|
const R = {
|
|
47
47
|
itemTarget: D,
|
|
48
48
|
itemIndex: P,
|
|
49
|
-
syntheticEvent:
|
|
50
|
-
nativeEvent:
|
|
49
|
+
syntheticEvent: s,
|
|
50
|
+
nativeEvent: s && s.nativeEvent,
|
|
51
51
|
target: void 0
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
o.call(void 0, R);
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
[a,
|
|
57
|
-
), c = O(r,
|
|
56
|
+
[a, o]
|
|
57
|
+
), c = O(r, d.dir), C = T(
|
|
58
58
|
{
|
|
59
59
|
"k-drawer-container": !0,
|
|
60
|
-
"k-drawer-expanded":
|
|
61
|
-
"k-drawer-overlay":
|
|
62
|
-
"k-drawer-push":
|
|
63
|
-
"k-drawer-mini": m
|
|
60
|
+
"k-drawer-expanded": n,
|
|
61
|
+
"k-drawer-overlay": i === "overlay",
|
|
62
|
+
"k-drawer-push": i === "push",
|
|
63
|
+
"k-drawer-mini": m && !n
|
|
64
64
|
},
|
|
65
65
|
f
|
|
66
66
|
);
|
|
@@ -69,8 +69,8 @@ const s = t.forwardRef((l, u) => {
|
|
|
69
69
|
{
|
|
70
70
|
value: {
|
|
71
71
|
animation: y,
|
|
72
|
-
expanded:
|
|
73
|
-
mode:
|
|
72
|
+
expanded: n,
|
|
73
|
+
mode: i,
|
|
74
74
|
position: p,
|
|
75
75
|
mini: m,
|
|
76
76
|
dir: c,
|
|
@@ -96,7 +96,7 @@ const s = t.forwardRef((l, u) => {
|
|
|
96
96
|
)
|
|
97
97
|
);
|
|
98
98
|
});
|
|
99
|
-
|
|
99
|
+
l.propTypes = {
|
|
100
100
|
animation: e.any,
|
|
101
101
|
expanded: e.bool,
|
|
102
102
|
children: e.any,
|
|
@@ -123,8 +123,8 @@ const H = {
|
|
|
123
123
|
width: 240,
|
|
124
124
|
miniWidth: 50
|
|
125
125
|
};
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
l.defaultProps = H;
|
|
127
|
+
l.displayName = "KendoDrawer";
|
|
128
128
|
export {
|
|
129
|
-
|
|
129
|
+
l as Drawer
|
|
130
130
|
};
|
|
@@ -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 V=require("react"),i=require("prop-types"),$=require("./context/DrawerContext.js"),G=require("./DrawerItem.js"),l=require("@progress/kendo-react-common"),O=require("../package-metadata.js");function J(a){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(s,n,c.get?c:{enumerable:!0,get:()=>a[n]})}}return s.default=a,Object.freeze(s)}const t=J(V),Q=240,Y=50,Z={type:"slide",duration:200},ee={type:"slide",duration:0},f=t.forwardRef((a,s)=>{const{children:n,className:c,style:k}=a;l.validatePackage(O.packageMetadata);const E=l.shouldShowValidationUI(O.packageMetadata),{animation:p,expanded:m,mode:d,position:o,onOverlayClick:W,mini:r,dir:w,width:v,miniWidth:N,items:b,item:C,onSelect:M}=t.useContext($.DrawerContext),u=t.useRef(null),x=t.useCallback(()=>{u.current&&u.current.focus()},[]),e=typeof p!="boolean"?p:p===!1?ee:Z,g=v||Q,D=N||Y;t.useImperativeHandle(s,()=>({element:u.current,focus:x}));const A=t.useMemo(()=>"k-drawer "+l.classNames({"k-drawer-start":o==="start","k-drawer-end":o==="end"},c),[o]),P={opacity:1,flexBasis:g,WebkitTransition:"all "+(e&&e.duration)+"ms",transition:"all "+(e&&e.duration)+"ms"},_={opacity:1,transform:"translateX(0px)",WebkitTransition:"all "+(e&&e.duration)+"ms",transition:"all "+(e&&e.duration)+"ms"},R={opacity:r?1:0,flexBasis:r?D:0,WebkitTransition:"all "+(e&&e.duration)+"ms",transition:"all "+(e&&e.duration)+"ms"},S={opacity:0,transform:"translateX(-100%)",WebkitTransition:"all "+(e&&e.duration)+"ms",transition:"all "+(e&&e.duration)+"ms"},j={opacity:0,transform:"translateX(100%)",WebkitTransition:"all "+(e&&e.duration)+"ms",transition:"all "+(e&&e.duration)+"ms"},T={transform:"translateX(0%)",WebkitTransitionDuration:(e&&e.duration)+"ms",transitionDuration:(e&&e.duration)+"ms"},q=m?d==="push"?P:_:d==="push"?R:w==="ltr"&&o==="start"||w==="rtl"&&o==="end"?r?T:S:r?T:j,L=b&&t.createElement("ul",{className:"k-drawer-items",role:"menubar","aria-label":"drawer-list","aria-expanded":m},b.map((X,I)=>{const{className:F,level:y,...U}=X,H=y!=null?y:0,B=l.classNames(F,r?"":`k-level-${H}`),z={index:I,className:B,...U,onSelect:M},K=C||G.DrawerItem;return t.createElement(K,{key:I,...z})})),h=t.createElement("div",{style:e?{...q,...k}:k,className:A,ref:u},t.createElement("div",{className:"k-drawer-wrapper",style:!m&&r&&d==="overlay"?{width:D}:{width:g}},L||n),E&&t.createElement(l.WatermarkOverlay,null));return d==="overlay"?t.createElement(t.Fragment,null,m&&t.createElement("div",{className:"k-overlay",onClick:W}),h):h});f.propTypes={children:i.any,className:i.string,style:i.object,item:i.any,tabIndex:i.number};f.displayName="KendoDrawerNavigation";exports.DrawerNavigation=f;
|
|
@@ -7,82 +7,82 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
|
-
import
|
|
11
|
-
import { DrawerContext as
|
|
12
|
-
import { DrawerItem as
|
|
13
|
-
import { validatePackage as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
const
|
|
16
|
-
const { children:
|
|
17
|
-
|
|
18
|
-
const
|
|
10
|
+
import r from "prop-types";
|
|
11
|
+
import { DrawerContext as q } from "./context/DrawerContext.mjs";
|
|
12
|
+
import { DrawerItem as z } from "./DrawerItem.mjs";
|
|
13
|
+
import { validatePackage as G, shouldShowValidationUI as J, classNames as h, WatermarkOverlay as Q } from "@progress/kendo-react-common";
|
|
14
|
+
import { packageMetadata as I } from "../package-metadata.mjs";
|
|
15
|
+
const Y = 240, Z = 50, tt = { type: "slide", duration: 200 }, at = { type: "slide", duration: 0 }, T = a.forwardRef((b, D) => {
|
|
16
|
+
const { children: E, className: W, style: c } = b;
|
|
17
|
+
G(I);
|
|
18
|
+
const x = J(I), {
|
|
19
19
|
animation: l,
|
|
20
20
|
expanded: s,
|
|
21
21
|
mode: o,
|
|
22
|
-
position:
|
|
23
|
-
onOverlayClick:
|
|
24
|
-
mini:
|
|
25
|
-
dir:
|
|
26
|
-
width:
|
|
27
|
-
miniWidth:
|
|
28
|
-
items:
|
|
29
|
-
item:
|
|
30
|
-
onSelect:
|
|
31
|
-
} = a.useContext(
|
|
22
|
+
position: n,
|
|
23
|
+
onOverlayClick: g,
|
|
24
|
+
mini: e,
|
|
25
|
+
dir: d,
|
|
26
|
+
width: u,
|
|
27
|
+
miniWidth: p,
|
|
28
|
+
items: y,
|
|
29
|
+
item: A,
|
|
30
|
+
onSelect: C
|
|
31
|
+
} = a.useContext(q), i = a.useRef(null), O = a.useCallback(
|
|
32
32
|
() => {
|
|
33
33
|
i.current && i.current.focus();
|
|
34
34
|
},
|
|
35
35
|
[]
|
|
36
|
-
), t = typeof l != "boolean" ? l : l === !1 ?
|
|
37
|
-
a.useImperativeHandle(
|
|
36
|
+
), t = typeof l != "boolean" ? l : l === !1 ? at : tt, f = u || Y, k = p || Z;
|
|
37
|
+
a.useImperativeHandle(D, () => ({
|
|
38
38
|
element: i.current,
|
|
39
|
-
focus:
|
|
39
|
+
focus: O
|
|
40
40
|
}));
|
|
41
|
-
const
|
|
42
|
-
() => "k-
|
|
41
|
+
const M = a.useMemo(
|
|
42
|
+
() => "k-drawer " + h(
|
|
43
43
|
{
|
|
44
|
-
"k-drawer-start":
|
|
45
|
-
"k-drawer-end":
|
|
44
|
+
"k-drawer-start": n === "start",
|
|
45
|
+
"k-drawer-end": n === "end"
|
|
46
46
|
},
|
|
47
|
-
|
|
47
|
+
W
|
|
48
48
|
),
|
|
49
|
-
[
|
|
50
|
-
),
|
|
49
|
+
[n]
|
|
50
|
+
), P = {
|
|
51
51
|
opacity: 1,
|
|
52
|
-
flexBasis:
|
|
52
|
+
flexBasis: f,
|
|
53
53
|
WebkitTransition: "all " + (t && t.duration) + "ms",
|
|
54
54
|
/* Safari */
|
|
55
55
|
transition: "all " + (t && t.duration) + "ms"
|
|
56
|
-
},
|
|
56
|
+
}, _ = {
|
|
57
57
|
opacity: 1,
|
|
58
58
|
transform: "translateX(0px)",
|
|
59
59
|
WebkitTransition: "all " + (t && t.duration) + "ms",
|
|
60
60
|
/* Safari */
|
|
61
61
|
transition: "all " + (t && t.duration) + "ms"
|
|
62
|
-
},
|
|
63
|
-
opacity:
|
|
64
|
-
flexBasis:
|
|
62
|
+
}, L = {
|
|
63
|
+
opacity: e ? 1 : 0,
|
|
64
|
+
flexBasis: e ? k : 0,
|
|
65
65
|
WebkitTransition: "all " + (t && t.duration) + "ms",
|
|
66
66
|
/* Safari */
|
|
67
67
|
transition: "all " + (t && t.duration) + "ms"
|
|
68
|
-
},
|
|
68
|
+
}, R = {
|
|
69
69
|
opacity: 0,
|
|
70
70
|
transform: "translateX(-100%)",
|
|
71
71
|
WebkitTransition: "all " + (t && t.duration) + "ms",
|
|
72
72
|
/* Safari */
|
|
73
73
|
transition: "all " + (t && t.duration) + "ms"
|
|
74
|
-
},
|
|
74
|
+
}, X = {
|
|
75
75
|
opacity: 0,
|
|
76
76
|
transform: "translateX(100%)",
|
|
77
77
|
WebkitTransition: "all " + (t && t.duration) + "ms",
|
|
78
78
|
/* Safari */
|
|
79
79
|
transition: "all " + (t && t.duration) + "ms"
|
|
80
|
-
},
|
|
80
|
+
}, v = {
|
|
81
81
|
transform: "translateX(0%)",
|
|
82
82
|
WebkitTransitionDuration: (t && t.duration) + "ms",
|
|
83
83
|
/* Safari */
|
|
84
84
|
transitionDuration: (t && t.duration) + "ms"
|
|
85
|
-
},
|
|
85
|
+
}, F = s ? o === "push" ? P : _ : o === "push" ? L : d === "ltr" && n === "start" || d === "rtl" && n === "end" ? e ? v : R : e ? v : X, U = y && /* @__PURE__ */ a.createElement(
|
|
86
86
|
"ul",
|
|
87
87
|
{
|
|
88
88
|
className: "k-drawer-items",
|
|
@@ -90,43 +90,47 @@ const z = 240, G = 50, J = { type: "slide", duration: 200 }, Q = { type: "slide"
|
|
|
90
90
|
"aria-label": "drawer-list",
|
|
91
91
|
"aria-expanded": s
|
|
92
92
|
},
|
|
93
|
-
|
|
94
|
-
(
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
y.map(
|
|
94
|
+
(H, N) => {
|
|
95
|
+
const { className: S, level: m, ...B } = H, j = m != null ? m : 0, K = h(
|
|
96
|
+
S,
|
|
97
|
+
e ? "" : `k-level-${j}`
|
|
98
|
+
), V = {
|
|
99
|
+
index: N,
|
|
100
|
+
className: K,
|
|
101
|
+
...B,
|
|
102
|
+
onSelect: C
|
|
103
|
+
}, $ = A || z;
|
|
104
|
+
return /* @__PURE__ */ a.createElement($, { key: N, ...V });
|
|
101
105
|
}
|
|
102
106
|
)
|
|
103
|
-
),
|
|
107
|
+
), w = /* @__PURE__ */ a.createElement(
|
|
104
108
|
"div",
|
|
105
109
|
{
|
|
106
|
-
style: t ? { ...
|
|
107
|
-
className:
|
|
110
|
+
style: t ? { ...F, ...c } : c,
|
|
111
|
+
className: M,
|
|
108
112
|
ref: i
|
|
109
113
|
},
|
|
110
114
|
/* @__PURE__ */ a.createElement(
|
|
111
115
|
"div",
|
|
112
116
|
{
|
|
113
117
|
className: "k-drawer-wrapper",
|
|
114
|
-
style: !s &&
|
|
118
|
+
style: !s && e && o === "overlay" ? { width: k } : { width: f }
|
|
115
119
|
},
|
|
116
|
-
|
|
120
|
+
U || E
|
|
117
121
|
),
|
|
118
|
-
|
|
122
|
+
x && /* @__PURE__ */ a.createElement(Q, null)
|
|
119
123
|
);
|
|
120
|
-
return o === "overlay" ? /* @__PURE__ */ a.createElement(a.Fragment, null, s && /* @__PURE__ */ a.createElement("div", { className: "k-overlay", onClick:
|
|
124
|
+
return o === "overlay" ? /* @__PURE__ */ a.createElement(a.Fragment, null, s && /* @__PURE__ */ a.createElement("div", { className: "k-overlay", onClick: g }), w) : w;
|
|
121
125
|
});
|
|
122
|
-
|
|
123
|
-
children:
|
|
124
|
-
className:
|
|
125
|
-
style:
|
|
126
|
-
item:
|
|
127
|
-
tabIndex:
|
|
126
|
+
T.propTypes = {
|
|
127
|
+
children: r.any,
|
|
128
|
+
className: r.string,
|
|
129
|
+
style: r.object,
|
|
130
|
+
item: r.any,
|
|
131
|
+
tabIndex: r.number
|
|
128
132
|
};
|
|
129
|
-
|
|
133
|
+
T.displayName = "KendoDrawerNavigation";
|
|
130
134
|
export {
|
|
131
|
-
|
|
135
|
+
T as DrawerNavigation
|
|
132
136
|
};
|
package/index.d.mts
CHANGED
|
@@ -1112,7 +1112,7 @@ export declare interface BreadcrumbLinkHandle {
|
|
|
1112
1112
|
/**
|
|
1113
1113
|
* The current element or `null` if there is none.
|
|
1114
1114
|
*/
|
|
1115
|
-
element:
|
|
1115
|
+
element: HTMLAnchorElement | null;
|
|
1116
1116
|
/**
|
|
1117
1117
|
* The props values of the BreadcrumbLink.
|
|
1118
1118
|
*/
|
|
@@ -1903,6 +1903,11 @@ export declare interface DrawerItemProps {
|
|
|
1903
1903
|
* Sets a custom property. Contained in the DrawerItem props that are returned from the `onSelect` Drawer event.
|
|
1904
1904
|
*/
|
|
1905
1905
|
[customProp: string]: any;
|
|
1906
|
+
/**
|
|
1907
|
+
* This property is used in scenarios with hierarchical drawer. The rendering of the component requires each node to have a "`k-level-` + the level of nesting" className.
|
|
1908
|
+
* The nesting levels should be handled by the developer. The root level items have a level of 0.
|
|
1909
|
+
*/
|
|
1910
|
+
level?: number;
|
|
1906
1911
|
/**
|
|
1907
1912
|
* @hidden
|
|
1908
1913
|
*/
|
package/index.d.ts
CHANGED
|
@@ -1112,7 +1112,7 @@ export declare interface BreadcrumbLinkHandle {
|
|
|
1112
1112
|
/**
|
|
1113
1113
|
* The current element or `null` if there is none.
|
|
1114
1114
|
*/
|
|
1115
|
-
element:
|
|
1115
|
+
element: HTMLAnchorElement | null;
|
|
1116
1116
|
/**
|
|
1117
1117
|
* The props values of the BreadcrumbLink.
|
|
1118
1118
|
*/
|
|
@@ -1903,6 +1903,11 @@ export declare interface DrawerItemProps {
|
|
|
1903
1903
|
* Sets a custom property. Contained in the DrawerItem props that are returned from the `onSelect` Drawer event.
|
|
1904
1904
|
*/
|
|
1905
1905
|
[customProp: string]: any;
|
|
1906
|
+
/**
|
|
1907
|
+
* This property is used in scenarios with hierarchical drawer. The rendering of the component requires each node to have a "`k-level-` + the level of nesting" className.
|
|
1908
|
+
* The nesting levels should be handled by the developer. The root level items have a level of 0.
|
|
1909
|
+
*/
|
|
1910
|
+
level?: number;
|
|
1906
1911
|
/**
|
|
1907
1912
|
* @hidden
|
|
1908
1913
|
*/
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-layout",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1712928244,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-layout",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0-develop.2",
|
|
4
4
|
"description": "React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-animation": "7.
|
|
27
|
-
"@progress/kendo-react-common": "7.
|
|
28
|
-
"@progress/kendo-react-intl": "7.
|
|
29
|
-
"@progress/kendo-react-popup": "7.
|
|
30
|
-
"@progress/kendo-react-progressbars": "7.
|
|
26
|
+
"@progress/kendo-react-animation": "7.5.0-develop.2",
|
|
27
|
+
"@progress/kendo-react-common": "7.5.0-develop.2",
|
|
28
|
+
"@progress/kendo-react-intl": "7.5.0-develop.2",
|
|
29
|
+
"@progress/kendo-react-popup": "7.5.0-develop.2",
|
|
30
|
+
"@progress/kendo-react-progressbars": "7.5.0-develop.2",
|
|
31
31
|
"@progress/kendo-svg-icons": "^2.1.0",
|
|
32
32
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
33
33
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/panelbar/PanelBar.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 v=require("react"),r=require("prop-types"),g=require("./PanelBarItem.js"),d=require("./util.js"),o=require("@progress/kendo-react-common"),y=require("../package-metadata.js"),l=require("./interfaces/NavigationAction.js");function x(p){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const a in p)if(a!=="default"){const e=Object.getOwnPropertyDescriptor(p,a);Object.defineProperty(s,a,e.get?e:{enumerable:!0,get:()=>p[a]})}}return s.default=p,Object.freeze(s)}const u=x(v),h=class h extends u.Component{constructor(s){super(s),this._element=null,this.showLicenseWatermark=!1,this.handleSelect=e=>{this.onSelect(e),this.onFocus(e)},this.onSelect=e=>{const n=d.flatChildren(u.Children.toArray(this.children));let i,t;switch(n.forEach(c=>{c.props.uniquePrivateKey===(e.uniquePrivateKey||this.state.focused)&&(i=c)}),this.expandMode){case"single":t=[...i.props.parentUniquePrivateKey,i.props.uniquePrivateKey],d.isArrayEqual(this.expandedItems,t)&&(i.props.parentUniquePrivateKey?t=[...i.props.parentUniquePrivateKey]:t=[]);break;case"multiple":{t=this.expandedItems.slice();const c=t.indexOf(i.props.uniquePrivateKey);c===-1?t.push(i.props.uniquePrivateKey):t.splice(c,1);break}default:t=this.expandedItems.slice();break}this.setState({selected:i.props.uniquePrivateKey,expanded:t}),this.props.onSelect&&this.props.onSelect.call(void 0,{target:i,expandedItems:t})},this.onFocus=(e,n=0)=>{const i=d.flatVisibleChildren(u.Children.toArray(this.children));let t;i.forEach((c,f)=>{if(c.props.uniquePrivateKey===(e.uniquePrivateKey||this.state.focused)){const k=f+n<0?0:f+n>i.length?i.length-1:f+n;t=i[k]}}),t&&(this.activeDescendant=t.props.id,this.setState({focused:t.props.uniquePrivateKey}))},this.onNavigate=(e,n)=>{let i;switch(n){case l.NavigationAction.Previous:i=-1,this.onFocus(e,i);break;case l.NavigationAction.Next:i=1,this.onFocus(e,i);break;case l.NavigationAction.Toggle:this.onSelect(e);break}},this.handleWrapperFocus=()=>{clearTimeout(this.nextTickId),this.state.wrapperFocused||this.setState({wrapperFocused:!0})},this.handleWrapperBlur=()=>{this.nextTick(()=>{this.setState({wrapperFocused:!1})})},this.handleKeyDown=e=>{const n=this._element&&getComputedStyle(this._element).direction==="rtl"||!1;if(e.target===e.currentTarget){const i=e.keyCode;let t;switch(i){case o.Keys.left:t=n?l.NavigationAction.Next:l.NavigationAction.Previous;break;case o.Keys.up:t=l.NavigationAction.Previous;break;case o.Keys.right:t=n?l.NavigationAction.Previous:l.NavigationAction.Next;break;case o.Keys.down:t=l.NavigationAction.Next;break;case o.Keys.space:case o.Keys.enter:t=l.NavigationAction.Toggle;break;default:t=null;break}t!==null&&(e.preventDefault(),this.onNavigate(e,t))}},o.validatePackage(y.packageMetadata),this.showLicenseWatermark=o.shouldShowValidationUI(y.packageMetadata);const a=d.getInitialState(s,this.expandMode);a.focused||(a.focused=d.getFirstId(s)),this.state=a}get expandMode(){return this.props.expandMode||"multiple"}get selectedItem(){const{selected:s=this.state.selected}=this.props;return s}get expandedItems(){return this.props.isControlled?this.props.expanded||[]:this.state.expanded}get children(){const s={...this.state,selected:this.selectedItem},a={animation:this.props.animation,keepItemsMounted:this.props.keepItemsMounted,state:s,expanded:this.expandedItems,handleSelect:this.handleSelect,children:this.props.children};return d.renderChildren(a)}render(){const s={"aria-activedescendant":this.activeDescendant},a=o.classNames("k-panelbar",
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),r=require("prop-types"),g=require("./PanelBarItem.js"),d=require("./util.js"),o=require("@progress/kendo-react-common"),y=require("../package-metadata.js"),l=require("./interfaces/NavigationAction.js");function x(p){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const a in p)if(a!=="default"){const e=Object.getOwnPropertyDescriptor(p,a);Object.defineProperty(s,a,e.get?e:{enumerable:!0,get:()=>p[a]})}}return s.default=p,Object.freeze(s)}const u=x(v),h=class h extends u.Component{constructor(s){super(s),this._element=null,this.showLicenseWatermark=!1,this.handleSelect=e=>{this.onSelect(e),this.onFocus(e)},this.onSelect=e=>{const n=d.flatChildren(u.Children.toArray(this.children));let i,t;switch(n.forEach(c=>{c.props.uniquePrivateKey===(e.uniquePrivateKey||this.state.focused)&&(i=c)}),this.expandMode){case"single":t=[...i.props.parentUniquePrivateKey,i.props.uniquePrivateKey],d.isArrayEqual(this.expandedItems,t)&&(i.props.parentUniquePrivateKey?t=[...i.props.parentUniquePrivateKey]:t=[]);break;case"multiple":{t=this.expandedItems.slice();const c=t.indexOf(i.props.uniquePrivateKey);c===-1?t.push(i.props.uniquePrivateKey):t.splice(c,1);break}default:t=this.expandedItems.slice();break}this.setState({selected:i.props.uniquePrivateKey,expanded:t}),this.props.onSelect&&this.props.onSelect.call(void 0,{target:i,expandedItems:t})},this.onFocus=(e,n=0)=>{const i=d.flatVisibleChildren(u.Children.toArray(this.children));let t;i.forEach((c,f)=>{if(c.props.uniquePrivateKey===(e.uniquePrivateKey||this.state.focused)){const k=f+n<0?0:f+n>i.length?i.length-1:f+n;t=i[k]}}),t&&(this.activeDescendant=t.props.id,this.setState({focused:t.props.uniquePrivateKey}))},this.onNavigate=(e,n)=>{let i;switch(n){case l.NavigationAction.Previous:i=-1,this.onFocus(e,i);break;case l.NavigationAction.Next:i=1,this.onFocus(e,i);break;case l.NavigationAction.Toggle:this.onSelect(e);break}},this.handleWrapperFocus=()=>{clearTimeout(this.nextTickId),this.state.wrapperFocused||this.setState({wrapperFocused:!0})},this.handleWrapperBlur=()=>{this.nextTick(()=>{this.setState({wrapperFocused:!1})})},this.handleKeyDown=e=>{const n=this._element&&getComputedStyle(this._element).direction==="rtl"||!1;if(e.target===e.currentTarget){const i=e.keyCode;let t;switch(i){case o.Keys.left:t=n?l.NavigationAction.Next:l.NavigationAction.Previous;break;case o.Keys.up:t=l.NavigationAction.Previous;break;case o.Keys.right:t=n?l.NavigationAction.Previous:l.NavigationAction.Next;break;case o.Keys.down:t=l.NavigationAction.Next;break;case o.Keys.space:case o.Keys.enter:t=l.NavigationAction.Toggle;break;default:t=null;break}t!==null&&(e.preventDefault(),this.onNavigate(e,t))}},o.validatePackage(y.packageMetadata),this.showLicenseWatermark=o.shouldShowValidationUI(y.packageMetadata);const a=d.getInitialState(s,this.expandMode);a.focused||(a.focused=d.getFirstId(s)),this.state=a}get expandMode(){return this.props.expandMode||"multiple"}get selectedItem(){const{selected:s=this.state.selected}=this.props;return s}get expandedItems(){return this.props.isControlled?this.props.expanded||[]:this.state.expanded}get children(){const s={...this.state,selected:this.selectedItem},a={animation:this.props.animation,keepItemsMounted:this.props.keepItemsMounted,state:s,expanded:this.expandedItems,handleSelect:this.handleSelect,children:this.props.children};return d.renderChildren(a)}render(){const s={"aria-activedescendant":this.activeDescendant},a=o.classNames("k-panelbar",this.props.className);return u.createElement("ul",{ref:e=>{this._element=e},dir:this.props.dir,role:"tree",tabIndex:0,onKeyDown:this.handleKeyDown,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,className:a,style:this.props.style,...s},this.children,this.showLicenseWatermark&&u.createElement(o.WatermarkOverlay,null))}nextTick(s){this.nextTickId=window.setTimeout(()=>s())}};h.propTypes={animation:r.bool,children:function(s,a){const e=s[a];if(e){if(Array.isArray(e)){for(const n of e)if(!n.type||n.type!==g.PanelBarItem)return new Error("PanelBar children should be either PanelBarItem or Array of PanelBarItem.")}else if(e.type!==g.PanelBarItem)return new Error("PanelBar child should be either PanelBarItem or Array of PanelBarItem.");return null}return null},dir:r.string,selected:r.string,expanded:r.arrayOf(r.string),focused:r.string,expandMode:r.oneOf(["single","multiple"]),className:r.string,keepItemsMounted:r.bool,onSelect:r.func,style:r.object},h.defaultProps={expandMode:"multiple",animation:!0,keepItemsMounted:!1};let m=h;exports.PanelBar=m;
|
package/panelbar/PanelBar.mjs
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
import * as p from "react";
|
|
10
10
|
import a from "prop-types";
|
|
11
11
|
import { PanelBarItem as u } from "./PanelBarItem.mjs";
|
|
12
|
-
import { flatChildren as x, isArrayEqual as
|
|
13
|
-
import { Keys as d, validatePackage as
|
|
12
|
+
import { flatChildren as x, isArrayEqual as g, flatVisibleChildren as k, getInitialState as P, getFirstId as I, renderChildren as b } from "./util.mjs";
|
|
13
|
+
import { Keys as d, validatePackage as v, shouldShowValidationUI as w, classNames as S, WatermarkOverlay as K } from "@progress/kendo-react-common";
|
|
14
14
|
import { packageMetadata as m } from "../package-metadata.mjs";
|
|
15
15
|
import { NavigationAction as n } from "./interfaces/NavigationAction.mjs";
|
|
16
16
|
const c = class c extends p.Component {
|
|
@@ -24,7 +24,7 @@ const c = class c extends p.Component {
|
|
|
24
24
|
l.props.uniquePrivateKey === (t.uniquePrivateKey || this.state.focused) && (s = l);
|
|
25
25
|
}), this.expandMode) {
|
|
26
26
|
case "single":
|
|
27
|
-
e = [...s.props.parentUniquePrivateKey, s.props.uniquePrivateKey],
|
|
27
|
+
e = [...s.props.parentUniquePrivateKey, s.props.uniquePrivateKey], g(this.expandedItems, e) && (s.props.parentUniquePrivateKey ? e = [...s.props.parentUniquePrivateKey] : e = []);
|
|
28
28
|
break;
|
|
29
29
|
case "multiple": {
|
|
30
30
|
e = this.expandedItems.slice();
|
|
@@ -41,7 +41,7 @@ const c = class c extends p.Component {
|
|
|
41
41
|
expandedItems: e
|
|
42
42
|
});
|
|
43
43
|
}, this.onFocus = (t, r = 0) => {
|
|
44
|
-
const s =
|
|
44
|
+
const s = k(p.Children.toArray(this.children));
|
|
45
45
|
let e;
|
|
46
46
|
s.forEach((l, h) => {
|
|
47
47
|
if (l.props.uniquePrivateKey === (t.uniquePrivateKey || this.state.focused)) {
|
|
@@ -96,7 +96,7 @@ const c = class c extends p.Component {
|
|
|
96
96
|
}
|
|
97
97
|
e !== null && (t.preventDefault(), this.onNavigate(t, e));
|
|
98
98
|
}
|
|
99
|
-
},
|
|
99
|
+
}, v(m), this.showLicenseWatermark = w(m);
|
|
100
100
|
const o = P(i, this.expandMode);
|
|
101
101
|
o.focused || (o.focused = I(i)), this.state = o;
|
|
102
102
|
}
|
|
@@ -119,7 +119,7 @@ const c = class c extends p.Component {
|
|
|
119
119
|
handleSelect: this.handleSelect,
|
|
120
120
|
children: this.props.children
|
|
121
121
|
};
|
|
122
|
-
return
|
|
122
|
+
return b(o);
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* @hidden
|
|
@@ -129,7 +129,6 @@ const c = class c extends p.Component {
|
|
|
129
129
|
"aria-activedescendant": this.activeDescendant
|
|
130
130
|
}, o = S(
|
|
131
131
|
"k-panelbar",
|
|
132
|
-
"k-pos-relative",
|
|
133
132
|
this.props.className
|
|
134
133
|
);
|
|
135
134
|
return /* @__PURE__ */ p.createElement(
|
package/panelbar/PanelBarItem.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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),t=require("prop-types"),c=require("@progress/kendo-react-common"),y=require("@progress/kendo-svg-icons"),T=require("@progress/kendo-react-animation");function A(i){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>i[e]})}}return n.default=i,Object.freeze(n)}const a=A(P);function j({imageUrl:i,icon:n,svgIcon:e,iconClass:r}){return i?a.createElement("img",{role:"presentation",className:"k-panelbar-item-icon k-image",src:i}):n||e?a.createElement(c.IconWrap,{className:"k-panelbar-item-icon",name:n,icon:e}):r?a.createElement("span",{role:"presentation",className:"k-panelbar-item-icon "+r}):null}const d=class d extends a.PureComponent{constructor(n){super(n),this.handleItemClick=()=>{const{onSelect:e,disabled:r,id:p}=this.props;e&&!r&&e.call(void 0,{uniquePrivateKey:this.props.uniquePrivateKey,id:p,target:this})},this.childFactory=e=>this.props.keepItemsMounted?a.cloneElement(e,{...e.props,in:this.props.expanded}):e,this.state={show:n.expanded||!1}}render(){const{id:n,children:e,title:r,uniquePrivateKey:p,disabled:s,selected:m,focused:g,expanded:o,className:v,level:h,headerClassName:N,animation:b,keepItemsMounted:l}=this.props,E={role:"treeitem","aria-disabled":s,"aria-hidden":!s&&!o,"aria-selected":!s&&m,"aria-expanded":!s&&o&&!!e},x=c.classNames("k-panelbar-item",{"k-panelbar-header":h===0,"k-expanded":o&&!!e,"k-disabled":s},`k-level-${h}`,v),I=c.classNames("k-link",{"k-selected":!s&&m,"k-focus":!s&&g},N),S={display:"block"},C=j(this.props),O=!s&&e?a.createElement(c.IconWrap,{name:o?"chevron-up":"chevron-down",icon:o?y.chevronUpIcon:y.chevronDownIcon,className:c.classNames("k-panelbar-toggle",o?"k-panelbar-collapse":"k-panelbar-expand")}):null;let k=!1;e&&Array.isArray(e)&&(k=e[0].type===d);const q=k?a.createElement("ul",{role:"group","aria-expanded":o,"aria-hidden":!o,className:"k-panelbar-group",style:{display:l?this.state.show?"block":"none":"block"}},e):e,f=!s&&o||l?q:null,w=(b===void 0||b)&&!s&&e?a.createElement(T.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,key:p+"_animation",style:S,children:f,childFactory:l&&this.childFactory,unmountOnExit:!l,onBeforeEnter:()=>l&&this.setState({show:!0}),onAfterExited:()=>l&&this.setState({show:!1})}):f;return a.createElement("li",{id:n,className:x,...E},a.createElement("span",{className:I,onClick:this.handleItemClick},C,a.createElement("span",{className:"k-panelbar-item-text"},r),O),w)}};d.propTypes={animation:t.bool,children:t.any,className:t.string,icon:t.string,iconClass:t.string,imageUrl:t.string,svgIcon:c.svgIconPropType,expanded:t.bool,disabled:t.bool,onSelect:t.func,selected:t.bool,level:t.number,title:t.oneOfType([t.string,t.element]),id:t.oneOfType([t.string,t.number]),focused:t.bool,keepItemsMounted:t.bool},d.defaultProps={title:"Untitled"};let u=d;exports.PanelBarItem=u;
|