@progress/kendo-react-layout 7.4.0-develop.9 → 7.5.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/appbar/AppBar.js +1 -1
- package/appbar/AppBar.mjs +41 -43
- 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/index.d.mts +17 -9
- package/index.d.ts +17 -9
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +9 -10
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +68 -65
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +74 -70
- 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/index.d.mts
CHANGED
|
@@ -517,12 +517,20 @@ export declare interface AppBarSpacerProps {
|
|
|
517
517
|
* Specifies the theme color of the AppBar ([see example]({% slug appearance_appbar %})).
|
|
518
518
|
*
|
|
519
519
|
* * The possible values are:
|
|
520
|
-
* * `inherit`
|
|
521
520
|
* * `light` (Default)
|
|
522
|
-
* *
|
|
521
|
+
* * 'primary'
|
|
522
|
+
* * 'secondary'
|
|
523
|
+
* * 'tertiary'
|
|
524
|
+
* * 'info'
|
|
525
|
+
* * 'success'
|
|
526
|
+
* * 'warning'
|
|
527
|
+
* * 'error'
|
|
528
|
+
* * 'dark'
|
|
529
|
+
* * 'inherit'
|
|
530
|
+
* * 'inverse'
|
|
523
531
|
*
|
|
524
532
|
*/
|
|
525
|
-
export declare type AppBarThemeColor = '
|
|
533
|
+
export declare type AppBarThemeColor = 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inherit' | 'inverse';
|
|
526
534
|
|
|
527
535
|
export declare const Avatar: React_2.FunctionComponent<AvatarProps>;
|
|
528
536
|
|
|
@@ -1104,7 +1112,7 @@ export declare interface BreadcrumbLinkHandle {
|
|
|
1104
1112
|
/**
|
|
1105
1113
|
* The current element or `null` if there is none.
|
|
1106
1114
|
*/
|
|
1107
|
-
element:
|
|
1115
|
+
element: HTMLAnchorElement | null;
|
|
1108
1116
|
/**
|
|
1109
1117
|
* The props values of the BreadcrumbLink.
|
|
1110
1118
|
*/
|
|
@@ -2445,7 +2453,7 @@ export declare const isArrayEqual: (firstArray: any[], secondArray: any[]) => bo
|
|
|
2445
2453
|
/**
|
|
2446
2454
|
* @hidden
|
|
2447
2455
|
*/
|
|
2448
|
-
export declare const isPresent:
|
|
2456
|
+
export declare const isPresent: (value: any) => boolean;
|
|
2449
2457
|
|
|
2450
2458
|
/**
|
|
2451
2459
|
* @hidden
|
|
@@ -3040,15 +3048,15 @@ export declare interface PanelBarProps {
|
|
|
3040
3048
|
*/
|
|
3041
3049
|
dir?: string;
|
|
3042
3050
|
/**
|
|
3043
|
-
* If set, overrides the currently selected property in the PanelBar state.
|
|
3051
|
+
* If set, overrides the currently selected property in the PanelBar state. Takes the `id` of the item.
|
|
3044
3052
|
*/
|
|
3045
3053
|
selected?: string;
|
|
3046
3054
|
/**
|
|
3047
|
-
* Sets the initial expanded state of the PanelBar.
|
|
3055
|
+
* Sets the initial expanded state of the PanelBar. Takes the `id` of the item.
|
|
3048
3056
|
*/
|
|
3049
3057
|
expanded?: string[];
|
|
3050
3058
|
/**
|
|
3051
|
-
* Sets the initial focused state of the PanelBar.
|
|
3059
|
+
* Sets the initial focused state of the PanelBar. Takes the `id` of the item.
|
|
3052
3060
|
*/
|
|
3053
3061
|
focused?: string;
|
|
3054
3062
|
/**
|
|
@@ -3105,7 +3113,7 @@ export declare namespace PanelBarUtils {
|
|
|
3105
3113
|
* @param items - A collection of PanelBarItemProps.
|
|
3106
3114
|
* @return {PanelBarItem[]} Returns an array of PanelBarItem components.
|
|
3107
3115
|
*/
|
|
3108
|
-
export function mapItemsToComponents(items: Array<PanelBarItemProps>):
|
|
3116
|
+
export function mapItemsToComponents(items: Array<PanelBarItemProps>): React_2.ReactNode[];
|
|
3109
3117
|
}
|
|
3110
3118
|
|
|
3111
3119
|
/**
|
package/index.d.ts
CHANGED
|
@@ -517,12 +517,20 @@ export declare interface AppBarSpacerProps {
|
|
|
517
517
|
* Specifies the theme color of the AppBar ([see example]({% slug appearance_appbar %})).
|
|
518
518
|
*
|
|
519
519
|
* * The possible values are:
|
|
520
|
-
* * `inherit`
|
|
521
520
|
* * `light` (Default)
|
|
522
|
-
* *
|
|
521
|
+
* * 'primary'
|
|
522
|
+
* * 'secondary'
|
|
523
|
+
* * 'tertiary'
|
|
524
|
+
* * 'info'
|
|
525
|
+
* * 'success'
|
|
526
|
+
* * 'warning'
|
|
527
|
+
* * 'error'
|
|
528
|
+
* * 'dark'
|
|
529
|
+
* * 'inherit'
|
|
530
|
+
* * 'inverse'
|
|
523
531
|
*
|
|
524
532
|
*/
|
|
525
|
-
export declare type AppBarThemeColor = '
|
|
533
|
+
export declare type AppBarThemeColor = 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inherit' | 'inverse';
|
|
526
534
|
|
|
527
535
|
export declare const Avatar: React_2.FunctionComponent<AvatarProps>;
|
|
528
536
|
|
|
@@ -1104,7 +1112,7 @@ export declare interface BreadcrumbLinkHandle {
|
|
|
1104
1112
|
/**
|
|
1105
1113
|
* The current element or `null` if there is none.
|
|
1106
1114
|
*/
|
|
1107
|
-
element:
|
|
1115
|
+
element: HTMLAnchorElement | null;
|
|
1108
1116
|
/**
|
|
1109
1117
|
* The props values of the BreadcrumbLink.
|
|
1110
1118
|
*/
|
|
@@ -2445,7 +2453,7 @@ export declare const isArrayEqual: (firstArray: any[], secondArray: any[]) => bo
|
|
|
2445
2453
|
/**
|
|
2446
2454
|
* @hidden
|
|
2447
2455
|
*/
|
|
2448
|
-
export declare const isPresent:
|
|
2456
|
+
export declare const isPresent: (value: any) => boolean;
|
|
2449
2457
|
|
|
2450
2458
|
/**
|
|
2451
2459
|
* @hidden
|
|
@@ -3040,15 +3048,15 @@ export declare interface PanelBarProps {
|
|
|
3040
3048
|
*/
|
|
3041
3049
|
dir?: string;
|
|
3042
3050
|
/**
|
|
3043
|
-
* If set, overrides the currently selected property in the PanelBar state.
|
|
3051
|
+
* If set, overrides the currently selected property in the PanelBar state. Takes the `id` of the item.
|
|
3044
3052
|
*/
|
|
3045
3053
|
selected?: string;
|
|
3046
3054
|
/**
|
|
3047
|
-
* Sets the initial expanded state of the PanelBar.
|
|
3055
|
+
* Sets the initial expanded state of the PanelBar. Takes the `id` of the item.
|
|
3048
3056
|
*/
|
|
3049
3057
|
expanded?: string[];
|
|
3050
3058
|
/**
|
|
3051
|
-
* Sets the initial focused state of the PanelBar.
|
|
3059
|
+
* Sets the initial focused state of the PanelBar. Takes the `id` of the item.
|
|
3052
3060
|
*/
|
|
3053
3061
|
focused?: string;
|
|
3054
3062
|
/**
|
|
@@ -3105,7 +3113,7 @@ export declare namespace PanelBarUtils {
|
|
|
3105
3113
|
* @param items - A collection of PanelBarItemProps.
|
|
3106
3114
|
* @return {PanelBarItem[]} Returns an array of PanelBarItem components.
|
|
3107
3115
|
*/
|
|
3108
|
-
export function mapItemsToComponents(items: Array<PanelBarItemProps>):
|
|
3116
|
+
export function mapItemsToComponents(items: Array<PanelBarItemProps>): React_2.ReactNode[];
|
|
3109
3117
|
}
|
|
3110
3118
|
|
|
3111
3119
|
/**
|
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: 1712850582,
|
|
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.1",
|
|
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.1",
|
|
27
|
+
"@progress/kendo-react-common": "7.5.0-develop.1",
|
|
28
|
+
"@progress/kendo-react-intl": "7.5.0-develop.1",
|
|
29
|
+
"@progress/kendo-react-popup": "7.5.0-develop.1",
|
|
30
|
+
"@progress/kendo-react-progressbars": "7.5.0-develop.1",
|
|
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"),
|
|
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,11 +24,11 @@ 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();
|
|
31
|
-
|
|
31
|
+
const l = e.indexOf(s.props.uniquePrivateKey);
|
|
32
32
|
l === -1 ? e.push(s.props.uniquePrivateKey) : e.splice(l, 1);
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
@@ -41,11 +41,11 @@ 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)) {
|
|
48
|
-
|
|
48
|
+
const y = h + r < 0 ? 0 : h + r > s.length ? s.length - 1 : h + r;
|
|
49
49
|
e = s[y];
|
|
50
50
|
}
|
|
51
51
|
}), e && (this.activeDescendant = e.props.id, this.setState({ focused: e.props.uniquePrivateKey }));
|
|
@@ -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(
|
|
@@ -162,7 +161,7 @@ c.propTypes = {
|
|
|
162
161
|
const t = i[o];
|
|
163
162
|
if (t) {
|
|
164
163
|
if (Array.isArray(t)) {
|
|
165
|
-
for (
|
|
164
|
+
for (const r of t)
|
|
166
165
|
if (!r.type || r.type !== u)
|
|
167
166
|
return new Error(
|
|
168
167
|
"PanelBar children should be either PanelBarItem or Array of PanelBarItem."
|
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;
|
|
@@ -7,27 +7,27 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
|
-
import
|
|
11
|
-
import { svgIconPropType as
|
|
12
|
-
import { chevronUpIcon as
|
|
13
|
-
import { Reveal as
|
|
14
|
-
function
|
|
15
|
-
return d ? /* @__PURE__ */ n.createElement("img", { role: "presentation", className: "k-panelbar-item-icon k-image", src: d }) :
|
|
10
|
+
import t from "prop-types";
|
|
11
|
+
import { svgIconPropType as P, classNames as p, IconWrap as y } from "@progress/kendo-react-common";
|
|
12
|
+
import { chevronUpIcon as q, chevronDownIcon as D } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { Reveal as F } from "@progress/kendo-react-animation";
|
|
14
|
+
function K({ imageUrl: d, icon: r, svgIcon: e, iconClass: o }) {
|
|
15
|
+
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;
|
|
16
16
|
}
|
|
17
17
|
const l = class l extends n.PureComponent {
|
|
18
|
-
constructor(
|
|
19
|
-
super(
|
|
20
|
-
const { onSelect:
|
|
21
|
-
|
|
18
|
+
constructor(r) {
|
|
19
|
+
super(r), this.handleItemClick = () => {
|
|
20
|
+
const { onSelect: e, disabled: o, id: c } = this.props;
|
|
21
|
+
e && !o && e.call(void 0, {
|
|
22
22
|
uniquePrivateKey: this.props.uniquePrivateKey,
|
|
23
23
|
id: c,
|
|
24
24
|
target: this
|
|
25
25
|
});
|
|
26
|
-
}, this.childFactory = (
|
|
27
|
-
...
|
|
26
|
+
}, this.childFactory = (e) => this.props.keepItemsMounted ? n.cloneElement(e, {
|
|
27
|
+
...e.props,
|
|
28
28
|
in: this.props.expanded
|
|
29
|
-
}) :
|
|
30
|
-
show:
|
|
29
|
+
}) : e, this.state = {
|
|
30
|
+
show: r.expanded || !1
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -35,114 +35,117 @@ const l = class l extends n.PureComponent {
|
|
|
35
35
|
*/
|
|
36
36
|
render() {
|
|
37
37
|
const {
|
|
38
|
-
id:
|
|
39
|
-
children:
|
|
40
|
-
title:
|
|
38
|
+
id: r,
|
|
39
|
+
children: e,
|
|
40
|
+
title: o,
|
|
41
41
|
uniquePrivateKey: c,
|
|
42
42
|
disabled: a,
|
|
43
43
|
selected: m,
|
|
44
|
-
focused:
|
|
44
|
+
focused: E,
|
|
45
45
|
expanded: s,
|
|
46
|
-
className:
|
|
46
|
+
className: g,
|
|
47
47
|
level: u,
|
|
48
|
-
headerClassName:
|
|
48
|
+
headerClassName: v,
|
|
49
49
|
animation: h,
|
|
50
50
|
keepItemsMounted: i
|
|
51
|
-
} = this.props,
|
|
51
|
+
} = this.props, x = {
|
|
52
52
|
role: "treeitem",
|
|
53
53
|
"aria-disabled": a,
|
|
54
54
|
"aria-hidden": !a && !s,
|
|
55
55
|
"aria-selected": !a && m,
|
|
56
|
-
"aria-expanded": !a && s && !!
|
|
57
|
-
},
|
|
56
|
+
"aria-expanded": !a && s && !!e
|
|
57
|
+
}, N = p(
|
|
58
58
|
"k-panelbar-item",
|
|
59
59
|
{
|
|
60
60
|
"k-panelbar-header": u === 0,
|
|
61
|
-
"k-expanded": s && !!
|
|
61
|
+
"k-expanded": s && !!e,
|
|
62
62
|
"k-disabled": a
|
|
63
63
|
},
|
|
64
64
|
`k-level-${u}`,
|
|
65
|
-
|
|
66
|
-
),
|
|
65
|
+
g
|
|
66
|
+
), C = p(
|
|
67
67
|
"k-link",
|
|
68
68
|
{
|
|
69
69
|
"k-selected": !a && m,
|
|
70
|
-
"k-focus": !a &&
|
|
70
|
+
"k-focus": !a && E
|
|
71
71
|
},
|
|
72
|
-
|
|
73
|
-
), I = { display: "block" }, w =
|
|
74
|
-
|
|
72
|
+
v
|
|
73
|
+
), I = { display: "block" }, w = K(this.props), A = !a && e ? /* @__PURE__ */ n.createElement(
|
|
74
|
+
y,
|
|
75
75
|
{
|
|
76
76
|
name: s ? "chevron-up" : "chevron-down",
|
|
77
|
-
icon: s ?
|
|
77
|
+
icon: s ? q : D,
|
|
78
78
|
className: p(
|
|
79
79
|
"k-panelbar-toggle",
|
|
80
80
|
s ? "k-panelbar-collapse" : "k-panelbar-expand"
|
|
81
81
|
)
|
|
82
82
|
}
|
|
83
|
-
) : null
|
|
83
|
+
) : null;
|
|
84
|
+
let k = !1;
|
|
85
|
+
e && Array.isArray(e) && (k = e[0].type === l);
|
|
86
|
+
const S = k ? /* @__PURE__ */ n.createElement(
|
|
84
87
|
"ul",
|
|
85
88
|
{
|
|
86
89
|
role: "group",
|
|
87
90
|
"aria-expanded": s,
|
|
88
91
|
"aria-hidden": !s,
|
|
89
|
-
className: "k-panelbar-group
|
|
92
|
+
className: "k-panelbar-group",
|
|
90
93
|
style: { display: i ? this.state.show ? "block" : "none" : "block" }
|
|
91
94
|
},
|
|
92
|
-
|
|
93
|
-
) :
|
|
94
|
-
|
|
95
|
+
e
|
|
96
|
+
) : e, b = !a && s || i ? S : null, T = (h === void 0 || h) && !a && e ? /* @__PURE__ */ n.createElement(
|
|
97
|
+
F,
|
|
95
98
|
{
|
|
96
99
|
transitionEnterDuration: 200,
|
|
97
100
|
transitionExitDuration: 200,
|
|
98
101
|
key: c + "_animation",
|
|
99
102
|
style: I,
|
|
100
|
-
children:
|
|
103
|
+
children: b,
|
|
101
104
|
childFactory: i && this.childFactory,
|
|
102
105
|
unmountOnExit: !i,
|
|
103
106
|
onBeforeEnter: () => i && this.setState({ show: !0 }),
|
|
104
107
|
onAfterExited: () => i && this.setState({ show: !1 })
|
|
105
108
|
}
|
|
106
|
-
) :
|
|
109
|
+
) : b;
|
|
107
110
|
return /* @__PURE__ */ n.createElement(
|
|
108
111
|
"li",
|
|
109
112
|
{
|
|
110
|
-
id:
|
|
111
|
-
className:
|
|
112
|
-
...
|
|
113
|
+
id: r,
|
|
114
|
+
className: N,
|
|
115
|
+
...x
|
|
113
116
|
},
|
|
114
|
-
/* @__PURE__ */ n.createElement("span", { className:
|
|
115
|
-
|
|
117
|
+
/* @__PURE__ */ n.createElement("span", { className: C, onClick: this.handleItemClick }, w, /* @__PURE__ */ n.createElement("span", { className: "k-panelbar-item-text" }, o), A),
|
|
118
|
+
T
|
|
116
119
|
);
|
|
117
120
|
}
|
|
118
121
|
};
|
|
119
122
|
l.propTypes = {
|
|
120
|
-
animation:
|
|
121
|
-
children:
|
|
122
|
-
className:
|
|
123
|
-
icon:
|
|
124
|
-
iconClass:
|
|
125
|
-
imageUrl:
|
|
126
|
-
svgIcon:
|
|
127
|
-
expanded:
|
|
128
|
-
disabled:
|
|
129
|
-
onSelect:
|
|
130
|
-
selected:
|
|
131
|
-
level:
|
|
132
|
-
title:
|
|
133
|
-
|
|
134
|
-
|
|
123
|
+
animation: t.bool,
|
|
124
|
+
children: t.any,
|
|
125
|
+
className: t.string,
|
|
126
|
+
icon: t.string,
|
|
127
|
+
iconClass: t.string,
|
|
128
|
+
imageUrl: t.string,
|
|
129
|
+
svgIcon: P,
|
|
130
|
+
expanded: t.bool,
|
|
131
|
+
disabled: t.bool,
|
|
132
|
+
onSelect: t.func,
|
|
133
|
+
selected: t.bool,
|
|
134
|
+
level: t.number,
|
|
135
|
+
title: t.oneOfType([
|
|
136
|
+
t.string,
|
|
137
|
+
t.element
|
|
135
138
|
]),
|
|
136
|
-
id:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
id: t.oneOfType([
|
|
140
|
+
t.string,
|
|
141
|
+
t.number
|
|
139
142
|
]),
|
|
140
|
-
focused:
|
|
141
|
-
keepItemsMounted:
|
|
143
|
+
focused: t.bool,
|
|
144
|
+
keepItemsMounted: t.bool
|
|
142
145
|
}, l.defaultProps = {
|
|
143
146
|
title: "Untitled"
|
|
144
147
|
};
|
|
145
|
-
let
|
|
148
|
+
let f = l;
|
|
146
149
|
export {
|
|
147
|
-
|
|
150
|
+
f as PanelBarItem
|
|
148
151
|
};
|
package/panelbar/util.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 O=require("react"),l=require("./PanelBarItem.js");function S(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(r,e,t.get?t:{enumerable:!0,get:()=>n[e]})}}return r.default=n,Object.freeze(r)}const p=S(O),j=n=>typeof n!="object"||!("type"in n)||n.type!==l.PanelBarItem,m=({animation:n=!0,keepItemsMounted:r=!1,state:e,expanded:t,handleSelect:i,children:o,parentExpanded:u=!0,level:a=0,parentPrivateKey:d=[]})=>{const b=p.Children.toArray(o).filter(j),E=b.length?b:o;return p.Children.map(E,(s,x)=>{if(s&&s.type===l.PanelBarItem){let g;const f=c(s,d,x);if(s.props.children){const B={animation:n,keepItemsMounted:r,state:e,expanded:t,handleSelect:i,children:s.props.children,parentExpanded:(t||[]).indexOf(f)>-1,level:a+1,parentPrivateKey:[...d,f]};g=m(B)}return p.cloneElement(s,{...s.props,animation:s.props.animation!==void 0?s.props.animation:n,keepItemsMounted:r,id:s.props.id||`k-panelbar-item-default-${f}`,uniquePrivateKey:f,parentUniquePrivateKey:d,parentExpanded:u,level:a,expanded:(t||[]).indexOf(f)>-1,focused:e.focused===f&&e.wrapperFocused,selected:e.selected===f,children:g,onSelect:i})}else return p.createElement("div",{className:"k-panelbar-content"},s)})},q=n=>{const r=p.Children.toArray(n.children)[0];return r?c(r,[],0):""},y=(n,r,e={expanded:n.expanded||[],selected:n.selected||"",focused:n.focused||"",wrapperFocused:!1},t=!0,i=[])=>(p.Children.map(n.children,(o,u)=>{if(o&&o.type===l.PanelBarItem){const a=c(o,i,u);!o.props.disabled&&t&&(o.props.selected&&(e.selected=a),o.props.focused&&(e.focused=a),o.props.expanded&&(r==="multiple"?e.expanded.push(a):r==="single"&&(e.expanded=[a])),o.props.children&&(e=y(o.props,r,e,!!o.props.expanded,[...i,a])))}}),e),c=(n,r,e)=>n&&n.props&&n.props.id?n.props.id:r.length?r[r.length-1]+`.${e}`:`.${e}`;function I(n,r=[]){return(n||[]).forEach(e=>{e.disabled||(r.push(e),e.expanded&&e.children&&I(e.children,r))}),r}function C(n,r=[]){return p.Children.forEach(n,e=>{e&&e.props&&!e.props.disabled&&(r.push(e),e.props.children&&C(e.props.children,r))}),r}function P(n,r=[]){return p.Children.forEach(n,e=>{e&&e.props&&!e.props.disabled&&(e.props.expanded||e.props.parentExpanded)&&(r.push(e),e.props.children&&P(e.props.children,r))}),r}const v=n=>n!=null;exports.PanelBarUtils=void 0;(n=>{function r(e){return e.map((t,i)=>{let o;return t.content&&(o=t.content),t.children&&(o=r(t.children)),p.createElement(l.PanelBarItem,{...t,children:o,key:t.id||i})})}n.mapItemsToComponents=r})(exports.PanelBarUtils||(exports.PanelBarUtils={}));const F=(n,r)=>n.length!==r.length?!1:n.every((e,t)=>e===r[t]);exports.flatChildren=C;exports.flatVisibleChildren=P;exports.flatVisibleItems=I;exports.getFirstId=q;exports.getInitialState=y;exports.isArrayEqual=F;exports.isPresent=v;exports.renderChildren=m;
|