@progress/kendo-react-layout 14.0.0-develop.1 → 14.0.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.
@@ -5,128 +5,134 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as n from "react";
9
- import t from "prop-types";
10
- import { svgIconPropType as P, classNames as p, IconWrap as y } from "@progress/kendo-react-common";
11
- import { chevronUpIcon as q, chevronDownIcon as D } from "@progress/kendo-svg-icons";
12
- import { Reveal as F } from "@progress/kendo-react-animation";
13
- function K({ imageUrl: d, icon: r, svgIcon: e, iconClass: o }) {
14
- return d ? /* @__PURE__ */ n.createElement("img", { role: "presentation", className: "k-panelbar-item-icon k-image", src: d }) : r || e ? /* @__PURE__ */ n.createElement(y, { className: "k-panelbar-item-icon", name: r, icon: e }) : o ? /* @__PURE__ */ n.createElement("span", { role: "presentation", className: "k-panelbar-item-icon " + o }) : null;
8
+ import * as e from "react";
9
+ import n from "prop-types";
10
+ import { classNames as u, IconWrap as v, svgIconPropType as _ } from "@progress/kendo-react-common";
11
+ import { chevronUpIcon as $, chevronDownIcon as j } from "@progress/kendo-svg-icons";
12
+ import { Reveal as z } from "@progress/kendo-react-animation";
13
+ function J({ imageUrl: o, icon: i, svgIcon: s, iconClass: a }) {
14
+ return o ? /* @__PURE__ */ e.createElement("img", { role: "presentation", className: "k-panelbar-item-icon k-image", src: o }) : i || s ? /* @__PURE__ */ e.createElement(v, { className: "k-panelbar-item-icon", name: i, icon: s }) : a ? /* @__PURE__ */ e.createElement("span", { role: "presentation", className: "k-panelbar-item-icon " + a }) : null;
15
15
  }
16
- const l = class l extends n.PureComponent {
17
- constructor(r) {
18
- super(r), this.handleItemClick = () => {
19
- const { onSelect: e, disabled: o, id: c } = this.props;
20
- e && !o && e.call(void 0, {
21
- uniquePrivateKey: this.props.uniquePrivateKey,
22
- id: c,
23
- target: this
24
- });
25
- }, this.childFactory = (e) => this.props.keepItemsMounted ? n.cloneElement(e, {
26
- ...e.props,
27
- in: this.props.expanded
28
- }) : e, this.state = {
29
- show: r.expanded || !1
30
- };
31
- }
32
- /**
33
- * @hidden
34
- */
35
- render() {
36
- const {
37
- id: r,
38
- children: e,
39
- title: o,
16
+ const f = e.forwardRef((o, i) => {
17
+ const {
18
+ id: s,
19
+ children: a,
20
+ title: E = Q.title,
21
+ uniquePrivateKey: c,
22
+ disabled: t,
23
+ selected: k,
24
+ focused: N,
25
+ expanded: r,
26
+ className: C,
27
+ level: b,
28
+ headerClassName: x,
29
+ animation: y,
30
+ keepItemsMounted: l,
31
+ onSelect: m,
32
+ imageUrl: B,
33
+ icon: R,
34
+ svgIcon: w,
35
+ iconClass: P
36
+ } = o, d = e.useRef({ props: o }), S = e.useRef(null);
37
+ e.useImperativeHandle(d, () => ({ props: o })), e.useImperativeHandle(
38
+ i,
39
+ () => d.current
40
+ );
41
+ const [A, g] = e.useState(r || !1), D = e.useCallback(() => {
42
+ m && !t && m({
40
43
  uniquePrivateKey: c,
41
- disabled: a,
42
- selected: m,
43
- focused: E,
44
- expanded: s,
45
- className: g,
46
- level: u,
47
- headerClassName: v,
48
- animation: h,
49
- keepItemsMounted: i
50
- } = this.props, x = {
51
- role: "treeitem",
52
- "aria-disabled": a,
53
- "aria-hidden": !a && !s,
54
- "aria-selected": !a && m,
55
- "aria-expanded": !a && s && !!e
56
- }, N = p(
57
- "k-panelbar-item",
58
- {
59
- "k-panelbar-header": u === 0,
60
- "k-expanded": s && !!e,
61
- "k-disabled": a
62
- },
63
- `k-level-${u}`,
64
- g
65
- ), C = p(
66
- "k-link",
67
- {
68
- "k-selected": !a && m,
69
- "k-focus": E
70
- },
71
- v
72
- ), I = { display: "block" }, w = K(this.props), A = !a && e ? /* @__PURE__ */ n.createElement(
73
- y,
74
- {
75
- name: s ? "chevron-up" : "chevron-down",
76
- icon: s ? q : D,
77
- className: p("k-panelbar-toggle", s ? "k-panelbar-collapse" : "k-panelbar-expand")
78
- }
79
- ) : null;
80
- let k = !1;
81
- e && e[0] && Array.isArray(e) && (k = e[0].type === l);
82
- const S = k ? /* @__PURE__ */ n.createElement(
83
- "ul",
84
- {
85
- role: "group",
86
- "aria-expanded": s,
87
- "aria-hidden": !s,
88
- className: "k-panelbar-group",
89
- style: { display: i ? this.state.show ? "block" : "none" : "block" }
90
- },
91
- e
92
- ) : e, b = !a && s || i ? S : null, T = (h === void 0 || h) && !a && e ? /* @__PURE__ */ n.createElement(
93
- F,
94
- {
95
- transitionEnterDuration: 200,
96
- transitionExitDuration: 200,
97
- key: c + "_animation",
98
- style: I,
99
- children: b,
100
- childFactory: i && this.childFactory,
101
- unmountOnExit: !i,
102
- onBeforeEnter: () => i && this.setState({ show: !0 }),
103
- onAfterExited: () => i && this.setState({ show: !1 })
104
- }
105
- ) : b;
106
- return /* @__PURE__ */ n.createElement("li", { id: r, className: N, ...x }, /* @__PURE__ */ n.createElement("span", { className: C, onClick: this.handleItemClick }, w, /* @__PURE__ */ n.createElement("span", { className: "k-panelbar-item-text" }, o), A), T);
107
- }
108
- };
109
- l.propTypes = {
110
- animation: t.bool,
111
- children: t.any,
112
- className: t.string,
113
- icon: t.string,
114
- iconClass: t.string,
115
- imageUrl: t.string,
116
- svgIcon: P,
117
- expanded: t.bool,
118
- disabled: t.bool,
119
- onSelect: t.func,
120
- selected: t.bool,
121
- level: t.number,
122
- title: t.oneOfType([t.string, t.element]),
123
- id: t.oneOfType([t.string, t.number]),
124
- focused: t.bool,
125
- keepItemsMounted: t.bool
126
- }, l.defaultProps = {
44
+ id: s,
45
+ target: d.current
46
+ });
47
+ }, [m, t, c, s]), T = e.useCallback(
48
+ (p) => l ? e.cloneElement(p, {
49
+ ...p.props,
50
+ in: r
51
+ }) : p,
52
+ [l, r]
53
+ ), U = e.useCallback(() => {
54
+ l && g(!0);
55
+ }, [l]), H = e.useCallback(() => {
56
+ l && g(!1);
57
+ }, [l]), L = {
58
+ role: "treeitem",
59
+ "aria-disabled": t,
60
+ "aria-hidden": !t && !r ? "true" : "false",
61
+ "aria-selected": !t && k,
62
+ "aria-expanded": !t && r && !!a
63
+ }, O = u(
64
+ "k-panelbar-item",
65
+ {
66
+ "k-panelbar-header": b === 0,
67
+ "k-expanded": r && !!a,
68
+ "k-disabled": t
69
+ },
70
+ `k-level-${b}`,
71
+ C
72
+ ), F = u(
73
+ "k-link",
74
+ {
75
+ "k-selected": !t && k,
76
+ "k-focus": N
77
+ },
78
+ x
79
+ ), K = { display: "block" }, M = J({ imageUrl: B, icon: R, svgIcon: w, iconClass: P }), q = !t && a ? /* @__PURE__ */ e.createElement(
80
+ v,
81
+ {
82
+ name: r ? "chevron-up" : "chevron-down",
83
+ icon: r ? $ : j,
84
+ className: u("k-panelbar-toggle", r ? "k-panelbar-collapse" : "k-panelbar-expand")
85
+ }
86
+ ) : null;
87
+ let I = !1;
88
+ a && a[0] && Array.isArray(a) && (I = a[0].type === f);
89
+ const G = l && !A ? "none" : "block", h = !t && r || l ? I ? /* @__PURE__ */ e.createElement(
90
+ "ul",
91
+ {
92
+ role: "group",
93
+ "aria-hidden": r ? "false" : "true",
94
+ className: "k-panelbar-group",
95
+ style: { display: G }
96
+ },
97
+ a
98
+ ) : a : null, W = (y === void 0 || y) && !t && a ? /* @__PURE__ */ e.createElement(
99
+ z,
100
+ {
101
+ transitionEnterDuration: 200,
102
+ transitionExitDuration: 200,
103
+ key: c + "_animation",
104
+ style: K,
105
+ children: h,
106
+ childFactory: l ? T : void 0,
107
+ unmountOnExit: !l,
108
+ onBeforeEnter: U,
109
+ onAfterExited: H
110
+ }
111
+ ) : h;
112
+ return /* @__PURE__ */ e.createElement("li", { ref: S, id: s, className: O, ...L }, /* @__PURE__ */ e.createElement("span", { className: F, onClick: D }, M, /* @__PURE__ */ e.createElement("span", { className: "k-panelbar-item-text" }, E), q), W);
113
+ }), Q = {
127
114
  title: "Untitled"
128
115
  };
129
- let f = l;
116
+ f.propTypes = {
117
+ animation: n.bool,
118
+ children: n.any,
119
+ className: n.string,
120
+ icon: n.string,
121
+ iconClass: n.string,
122
+ imageUrl: n.string,
123
+ svgIcon: _,
124
+ expanded: n.bool,
125
+ disabled: n.bool,
126
+ onSelect: n.func,
127
+ selected: n.bool,
128
+ level: n.number,
129
+ title: n.oneOfType([n.string, n.element]),
130
+ id: n.oneOfType([n.string, n.number]),
131
+ focused: n.bool,
132
+ keepItemsMounted: n.bool
133
+ };
134
+ f.displayName = "KendoReactPanelBarItem";
130
135
  export {
131
- f as PanelBarItem
136
+ f as PanelBarItem,
137
+ Q as panelBarItemDefaultProps
132
138
  };
@@ -5,11 +5,11 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { PanelBarItem } from '../PanelBarItem.js';
8
+ import * as React from 'react';
9
9
  /**
10
10
  * @hidden
11
11
  */
12
12
  export interface PanelBarItemClickEventArguments {
13
13
  uniquePrivateKey: number;
14
- target: PanelBarItem;
14
+ target: React.ReactElement;
15
15
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { PanelBarItemProps } from './PanelBarItemProps.js';
9
+ /**
10
+ * Represents the handle of the PanelBarItem component.
11
+ */
12
+ export interface PanelBarItemHandle {
13
+ /**
14
+ * The props of the PanelBarItem component.
15
+ */
16
+ props: PanelBarItemProps;
17
+ }