@progress/kendo-react-layout 7.2.4-develop.3 → 7.2.4-develop.4
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/actionsheet/ActionSheet.js +8 -0
- package/actionsheet/ActionSheet.mjs +184 -0
- package/actionsheet/ActionSheetContent.js +8 -0
- package/actionsheet/ActionSheetContent.mjs +32 -0
- package/actionsheet/ActionSheetFooter.js +8 -0
- package/actionsheet/ActionSheetFooter.mjs +32 -0
- package/actionsheet/ActionSheetHeader.js +8 -0
- package/actionsheet/ActionSheetHeader.mjs +32 -0
- package/actionsheet/ActionSheetItem.js +8 -0
- package/actionsheet/ActionSheetItem.mjs +52 -0
- package/appbar/AppBar.js +8 -0
- package/appbar/AppBar.mjs +86 -0
- package/appbar/AppBarSection.js +8 -0
- package/appbar/AppBarSection.mjs +47 -0
- package/appbar/AppBarSpacer.js +8 -0
- package/appbar/AppBarSpacer.mjs +55 -0
- package/bottomnavigation/BottomNavigation.js +8 -0
- package/bottomnavigation/BottomNavigation.mjs +160 -0
- package/bottomnavigation/BottomNavigationItem.js +8 -0
- package/bottomnavigation/BottomNavigationItem.mjs +93 -0
- package/bottomnavigation/models/utils.js +8 -0
- package/bottomnavigation/models/utils.mjs +19 -0
- package/breadcrumb/Breadcrumb.js +8 -0
- package/breadcrumb/Breadcrumb.mjs +158 -0
- package/breadcrumb/BreadcrumbDelimiter.js +8 -0
- package/breadcrumb/BreadcrumbDelimiter.mjs +48 -0
- package/breadcrumb/BreadcrumbLink.js +8 -0
- package/breadcrumb/BreadcrumbLink.mjs +82 -0
- package/breadcrumb/BreadcrumbListItem.js +8 -0
- package/breadcrumb/BreadcrumbListItem.mjs +52 -0
- package/breadcrumb/BreadcrumbOrderedList.js +8 -0
- package/breadcrumb/BreadcrumbOrderedList.mjs +67 -0
- package/card/Avatar.js +8 -0
- package/card/Avatar.mjs +53 -0
- package/card/Card.js +8 -0
- package/card/Card.mjs +52 -0
- package/card/CardActions.js +8 -0
- package/card/CardActions.mjs +40 -0
- package/card/CardBody.js +8 -0
- package/card/CardBody.mjs +28 -0
- package/card/CardFooter.js +8 -0
- package/card/CardFooter.mjs +28 -0
- package/card/CardHeader.js +8 -0
- package/card/CardHeader.mjs +28 -0
- package/card/CardImage.js +8 -0
- package/card/CardImage.mjs +36 -0
- package/card/CardSubtitle.js +8 -0
- package/card/CardSubtitle.mjs +28 -0
- package/card/CardTitle.js +8 -0
- package/card/CardTitle.mjs +28 -0
- package/card/interfaces/Enums.js +8 -0
- package/card/interfaces/Enums.mjs +15 -0
- package/contextmenu/ContextMenu.js +8 -0
- package/contextmenu/ContextMenu.mjs +48 -0
- package/dist/cdn/js/kendo-react-layout.js +8 -5
- package/drawer/Drawer.js +8 -0
- package/drawer/Drawer.mjs +130 -0
- package/drawer/DrawerContent.js +8 -0
- package/drawer/DrawerContent.mjs +33 -0
- package/drawer/DrawerItem.js +8 -0
- package/drawer/DrawerItem.mjs +89 -0
- package/drawer/DrawerNavigation.js +8 -0
- package/drawer/DrawerNavigation.mjs +132 -0
- package/drawer/context/DrawerContext.js +8 -0
- package/drawer/context/DrawerContext.mjs +22 -0
- package/expansionpanel/ExpansionPanel.js +8 -0
- package/expansionpanel/ExpansionPanel.mjs +116 -0
- package/expansionpanel/ExpansionPanelContent.js +8 -0
- package/expansionpanel/ExpansionPanelContent.mjs +23 -0
- package/gridlayout/GridLayout.js +8 -0
- package/gridlayout/GridLayout.mjs +83 -0
- package/gridlayout/GridLayoutItem.js +8 -0
- package/gridlayout/GridLayoutItem.mjs +46 -0
- package/index.d.mts +4593 -5
- package/index.d.ts +4593 -103
- package/index.js +8 -5
- package/index.mjs +139 -5037
- package/menu/components/Menu.js +8 -0
- package/menu/components/Menu.mjs +193 -0
- package/menu/components/MenuItem.js +8 -0
- package/menu/components/MenuItem.mjs +34 -0
- package/menu/components/MenuItemArrow.js +8 -0
- package/menu/components/MenuItemArrow.mjs +49 -0
- package/menu/components/MenuItemInternal.js +8 -0
- package/menu/components/MenuItemInternal.mjs +222 -0
- package/menu/components/MenuItemLink.js +8 -0
- package/menu/components/MenuItemLink.mjs +54 -0
- package/menu/consts.js +8 -0
- package/menu/consts.mjs +59 -0
- package/menu/utils/DirectionHolder.js +8 -0
- package/menu/utils/DirectionHolder.mjs +25 -0
- package/menu/utils/MouseOverHandler.js +8 -0
- package/menu/utils/MouseOverHandler.mjs +34 -0
- package/menu/utils/getNewItemIdUponKeyboardNavigation.js +8 -0
- package/menu/utils/getNewItemIdUponKeyboardNavigation.mjs +124 -0
- package/menu/utils/hoverDelay.js +8 -0
- package/menu/utils/hoverDelay.mjs +18 -0
- package/menu/utils/itemsIdsUtils.js +8 -0
- package/menu/utils/itemsIdsUtils.mjs +81 -0
- package/menu/utils/misc.js +8 -0
- package/menu/utils/misc.mjs +29 -0
- package/menu/utils/prepareInputItemsForInternalWork.js +8 -0
- package/menu/utils/prepareInputItemsForInternalWork.mjs +59 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +6 -6
- package/panelbar/PanelBar.js +8 -0
- package/panelbar/PanelBar.mjs +195 -0
- package/panelbar/PanelBarItem.js +8 -0
- package/panelbar/PanelBarItem.mjs +148 -0
- package/panelbar/interfaces/NavigationAction.js +8 -0
- package/panelbar/interfaces/NavigationAction.mjs +12 -0
- package/panelbar/util.js +8 -0
- package/panelbar/util.mjs +122 -0
- package/splitter/Splitter.js +8 -0
- package/splitter/Splitter.mjs +238 -0
- package/splitter/SplitterBar.js +8 -0
- package/splitter/SplitterBar.mjs +129 -0
- package/splitter/SplitterPane.js +8 -0
- package/splitter/SplitterPane.mjs +50 -0
- package/splitter/messages/index.js +8 -0
- package/splitter/messages/index.mjs +15 -0
- package/stacklayout/StackLayout.js +8 -0
- package/stacklayout/StackLayout.mjs +84 -0
- package/stepper/Step.js +8 -0
- package/stepper/Step.mjs +177 -0
- package/stepper/Stepper.js +8 -0
- package/stepper/Stepper.mjs +252 -0
- package/stepper/contants.js +8 -0
- package/stepper/contants.mjs +13 -0
- package/stepper/context/StepperContext.js +8 -0
- package/stepper/context/StepperContext.mjs +17 -0
- package/stepper/messages/index.js +8 -0
- package/stepper/messages/index.mjs +17 -0
- package/tabstrip/TabStrip.js +8 -0
- package/tabstrip/TabStrip.mjs +163 -0
- package/tabstrip/TabStripContent.js +8 -0
- package/tabstrip/TabStripContent.mjs +81 -0
- package/tabstrip/TabStripNavigation.js +8 -0
- package/tabstrip/TabStripNavigation.mjs +171 -0
- package/tabstrip/TabStripNavigationItem.js +8 -0
- package/tabstrip/TabStripNavigationItem.mjs +55 -0
- package/tabstrip/TabStripTab.js +8 -0
- package/tabstrip/TabStripTab.mjs +35 -0
- package/tilelayout/InternalTile.js +8 -0
- package/tilelayout/InternalTile.mjs +203 -0
- package/tilelayout/ResizeHandlers.js +8 -0
- package/tilelayout/ResizeHandlers.mjs +53 -0
- package/tilelayout/TileLayout.js +8 -0
- package/tilelayout/TileLayout.mjs +122 -0
- package/timeline/Timeline.js +8 -0
- package/timeline/Timeline.mjs +79 -0
- package/timeline/TimelineCard.js +8 -0
- package/timeline/TimelineCard.mjs +109 -0
- package/timeline/TimelineHorizontal.js +8 -0
- package/timeline/TimelineHorizontal.mjs +239 -0
- package/timeline/TimelineVertical.js +8 -0
- package/timeline/TimelineVertical.mjs +78 -0
- package/timeline/utils.js +8 -0
- package/timeline/utils.mjs +16 -0
- package/actionsheet/ActionSheet.d.ts +0 -138
- package/actionsheet/ActionSheetContent.d.ts +0 -14
- package/actionsheet/ActionSheetFooter.d.ts +0 -14
- package/actionsheet/ActionSheetHeader.d.ts +0 -14
- package/actionsheet/ActionSheetItem.d.ts +0 -10
- package/actionsheet/interfaces/ActionSheetChildrenProps.d.ts +0 -17
- package/actionsheet/interfaces/ActionSheetItemProps.d.ts +0 -70
- package/appbar/AppBar.d.ts +0 -54
- package/appbar/AppBarSection.d.ts +0 -53
- package/appbar/AppBarSpacer.d.ts +0 -54
- package/appbar/interfaces/AppBarProps.d.ts +0 -83
- package/appbar/interfaces/AppBarSectionProps.d.ts +0 -22
- package/appbar/interfaces/AppBarSpacerProps.d.ts +0 -23
- package/bottomnavigation/BottomNavigation.d.ts +0 -42
- package/bottomnavigation/BottomNavigationItem.d.ts +0 -16
- package/bottomnavigation/BottomNavigationItemProps.d.ts +0 -64
- package/bottomnavigation/BottomNavigationProps.d.ts +0 -157
- package/bottomnavigation/models/events.d.ts +0 -24
- package/bottomnavigation/models/utils.d.ts +0 -40
- package/breadcrumb/Breadcrumb.d.ts +0 -163
- package/breadcrumb/BreadcrumbDelimiter.d.ts +0 -47
- package/breadcrumb/BreadcrumbLink.d.ts +0 -135
- package/breadcrumb/BreadcrumbListItem.d.ts +0 -55
- package/breadcrumb/BreadcrumbOrderedList.d.ts +0 -59
- package/card/Avatar.d.ts +0 -7
- package/card/Card.d.ts +0 -8
- package/card/CardActions.d.ts +0 -7
- package/card/CardBody.d.ts +0 -7
- package/card/CardFooter.d.ts +0 -7
- package/card/CardHeader.d.ts +0 -7
- package/card/CardImage.d.ts +0 -7
- package/card/CardSubtitle.d.ts +0 -7
- package/card/CardTitle.d.ts +0 -7
- package/card/interfaces/AvatarProps.d.ts +0 -88
- package/card/interfaces/CardActionsProps.d.ts +0 -38
- package/card/interfaces/CardBodyProps.d.ts +0 -18
- package/card/interfaces/CardFooterProps.d.ts +0 -18
- package/card/interfaces/CardHandle.d.ts +0 -18
- package/card/interfaces/CardHeaderProps.d.ts +0 -18
- package/card/interfaces/CardImageProps.d.ts +0 -22
- package/card/interfaces/CardProps.d.ts +0 -48
- package/card/interfaces/CardSubtitleProps.d.ts +0 -18
- package/card/interfaces/CardTitleProps.d.ts +0 -18
- package/card/interfaces/Enums.d.ts +0 -27
- package/contextmenu/ContextMenu.d.ts +0 -31
- package/drawer/Drawer.d.ts +0 -44
- package/drawer/DrawerContent.d.ts +0 -43
- package/drawer/DrawerItem.d.ts +0 -36
- package/drawer/DrawerNavigation.d.ts +0 -47
- package/drawer/context/DrawerContext.d.ts +0 -24
- package/drawer/interfaces/DrawerAnimation.d.ts +0 -18
- package/drawer/interfaces/DrawerContentProps.d.ts +0 -21
- package/drawer/interfaces/DrawerItemHandle.d.ts +0 -21
- package/drawer/interfaces/DrawerItemProps.d.ts +0 -64
- package/drawer/interfaces/DrawerNavigationProps.d.ts +0 -21
- package/drawer/interfaces/DrawerProps.d.ts +0 -86
- package/drawer/interfaces/DrawerSelectEvent.d.ts +0 -19
- package/expansionpanel/ExpansionPanel.d.ts +0 -10
- package/expansionpanel/ExpansionPanelContent.d.ts +0 -9
- package/expansionpanel/index.d.ts +0 -7
- package/expansionpanel/interfaces.d.ts +0 -92
- package/gridlayout/GridLayout.d.ts +0 -43
- package/gridlayout/GridLayoutItem.d.ts +0 -42
- package/gridlayout/interfaces/GridLayoutColumnProps.d.ts +0 -13
- package/gridlayout/interfaces/GridLayoutItemProps.d.ts +0 -44
- package/gridlayout/interfaces/GridLayoutProps.d.ts +0 -99
- package/gridlayout/interfaces/GridLayoutRowProps.d.ts +0 -13
- package/menu/BaseMenuItemInternalProps.d.ts +0 -24
- package/menu/MenuProps.d.ts +0 -75
- package/menu/components/Menu.d.ts +0 -118
- package/menu/components/MenuItem.d.ts +0 -33
- package/menu/components/MenuItemArrow.d.ts +0 -50
- package/menu/components/MenuItemInternal.d.ts +0 -63
- package/menu/components/MenuItemLink.d.ts +0 -34
- package/menu/consts.d.ts +0 -58
- package/menu/events.d.ts +0 -20
- package/menu/models/BaseMenuItem.d.ts +0 -58
- package/menu/models/MenuItemModel.d.ts +0 -23
- package/menu/utils/DirectionHolder.d.ts +0 -15
- package/menu/utils/MouseOverHandler.d.ts +0 -21
- package/menu/utils/getNewItemIdUponKeyboardNavigation.d.ts +0 -11
- package/menu/utils/hoverDelay.d.ts +0 -13
- package/menu/utils/itemsIdsUtils.d.ts +0 -68
- package/menu/utils/misc.d.ts +0 -20
- package/menu/utils/prepareInputItemsForInternalWork.d.ts +0 -10
- package/package-metadata.d.ts +0 -9
- package/panelbar/PanelBar.d.ts +0 -81
- package/panelbar/PanelBarItem.d.ts +0 -52
- package/panelbar/interfaces/NavigationAction.d.ts +0 -12
- package/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +0 -12
- package/panelbar/interfaces/PanelBarItemProps.d.ts +0 -98
- package/panelbar/interfaces/PanelBarProps.d.ts +0 -66
- package/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +0 -18
- package/panelbar/interfaces/RenderPanelBarItem.d.ts +0 -19
- package/panelbar/util.d.ts +0 -56
- package/splitter/Splitter.d.ts +0 -136
- package/splitter/SplitterBar.d.ts +0 -44
- package/splitter/SplitterPane.d.ts +0 -57
- package/splitter/messages/index.d.ts +0 -14
- package/stacklayout/StackLayout.d.ts +0 -41
- package/stacklayout/StackLayoutProps.d.ts +0 -92
- package/stepper/Step.d.ts +0 -27
- package/stepper/Stepper.d.ts +0 -27
- package/stepper/contants.d.ts +0 -12
- package/stepper/context/StepperContext.d.ts +0 -27
- package/stepper/interfaces/StepChangeEvent.d.ts +0 -15
- package/stepper/interfaces/StepFocusEvent.d.ts +0 -11
- package/stepper/interfaces/StepHandle.d.ts +0 -17
- package/stepper/interfaces/StepProps.d.ts +0 -83
- package/stepper/interfaces/StepperChangeEvent.d.ts +0 -15
- package/stepper/interfaces/StepperFocusEvent.d.ts +0 -11
- package/stepper/interfaces/StepperHandle.d.ts +0 -17
- package/stepper/interfaces/StepperProps.d.ts +0 -98
- package/stepper/messages/index.d.ts +0 -19
- package/tabstrip/TabStrip.d.ts +0 -158
- package/tabstrip/TabStripContent.d.ts +0 -62
- package/tabstrip/TabStripNavigation.d.ts +0 -110
- package/tabstrip/TabStripNavigationItem.d.ts +0 -75
- package/tabstrip/TabStripTab.d.ts +0 -42
- package/tilelayout/InternalTile.d.ts +0 -94
- package/tilelayout/ResizeHandlers.d.ts +0 -24
- package/tilelayout/TileLayout.d.ts +0 -153
- package/tilelayout/interfaces/index.d.ts +0 -145
- package/timeline/Timeline.d.ts +0 -102
- package/timeline/TimelineCard.d.ts +0 -38
- package/timeline/TimelineHorizontal.d.ts +0 -7
- package/timeline/TimelineVertical.d.ts +0 -16
- package/timeline/utils.d.ts +0 -19
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as p from "react";
|
|
10
|
+
import a from "prop-types";
|
|
11
|
+
import { PanelBarItem as u } from "./PanelBarItem.mjs";
|
|
12
|
+
import { flatChildren as x, isArrayEqual as k, flatVisibleChildren as g, getInitialState as P, getFirstId as I, renderChildren as v } from "./util.mjs";
|
|
13
|
+
import { Keys as d, validatePackage as b, shouldShowValidationUI as w, classNames as S, WatermarkOverlay as K } from "@progress/kendo-react-common";
|
|
14
|
+
import { packageMetadata as m } from "../package-metadata.mjs";
|
|
15
|
+
import { NavigationAction as n } from "./interfaces/NavigationAction.mjs";
|
|
16
|
+
const c = class c extends p.Component {
|
|
17
|
+
constructor(i) {
|
|
18
|
+
super(i), this._element = null, this.showLicenseWatermark = !1, this.handleSelect = (t) => {
|
|
19
|
+
this.onSelect(t), this.onFocus(t);
|
|
20
|
+
}, this.onSelect = (t) => {
|
|
21
|
+
const r = x(p.Children.toArray(this.children));
|
|
22
|
+
let s, e;
|
|
23
|
+
switch (r.forEach((l) => {
|
|
24
|
+
l.props.uniquePrivateKey === (t.uniquePrivateKey || this.state.focused) && (s = l);
|
|
25
|
+
}), this.expandMode) {
|
|
26
|
+
case "single":
|
|
27
|
+
e = [...s.props.parentUniquePrivateKey, s.props.uniquePrivateKey], k(this.expandedItems, e) && (s.props.parentUniquePrivateKey ? e = [...s.props.parentUniquePrivateKey] : e = []);
|
|
28
|
+
break;
|
|
29
|
+
case "multiple": {
|
|
30
|
+
e = this.expandedItems.slice();
|
|
31
|
+
let l = e.indexOf(s.props.uniquePrivateKey);
|
|
32
|
+
l === -1 ? e.push(s.props.uniquePrivateKey) : e.splice(l, 1);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
default:
|
|
36
|
+
e = this.expandedItems.slice();
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
this.setState({ selected: s.props.uniquePrivateKey, expanded: e }), this.props.onSelect && this.props.onSelect.call(void 0, {
|
|
40
|
+
target: s,
|
|
41
|
+
expandedItems: e
|
|
42
|
+
});
|
|
43
|
+
}, this.onFocus = (t, r = 0) => {
|
|
44
|
+
const s = g(p.Children.toArray(this.children));
|
|
45
|
+
let e;
|
|
46
|
+
s.forEach((l, h) => {
|
|
47
|
+
if (l.props.uniquePrivateKey === (t.uniquePrivateKey || this.state.focused)) {
|
|
48
|
+
let y = h + r < 0 ? 0 : h + r > s.length ? s.length - 1 : h + r;
|
|
49
|
+
e = s[y];
|
|
50
|
+
}
|
|
51
|
+
}), e && (this.activeDescendant = e.props.id, this.setState({ focused: e.props.uniquePrivateKey }));
|
|
52
|
+
}, this.onNavigate = (t, r) => {
|
|
53
|
+
let s;
|
|
54
|
+
switch (r) {
|
|
55
|
+
case n.Previous:
|
|
56
|
+
s = -1, this.onFocus(t, s);
|
|
57
|
+
break;
|
|
58
|
+
case n.Next:
|
|
59
|
+
s = 1, this.onFocus(t, s);
|
|
60
|
+
break;
|
|
61
|
+
case n.Toggle:
|
|
62
|
+
this.onSelect(t);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}, this.handleWrapperFocus = () => {
|
|
66
|
+
clearTimeout(this.nextTickId), this.state.wrapperFocused || this.setState({ wrapperFocused: !0 });
|
|
67
|
+
}, this.handleWrapperBlur = () => {
|
|
68
|
+
this.nextTick(() => {
|
|
69
|
+
this.setState({ wrapperFocused: !1 });
|
|
70
|
+
});
|
|
71
|
+
}, this.handleKeyDown = (t) => {
|
|
72
|
+
const r = this._element && getComputedStyle(this._element).direction === "rtl" || !1;
|
|
73
|
+
if (t.target === t.currentTarget) {
|
|
74
|
+
const s = t.keyCode;
|
|
75
|
+
let e;
|
|
76
|
+
switch (s) {
|
|
77
|
+
case d.left:
|
|
78
|
+
e = r ? n.Next : n.Previous;
|
|
79
|
+
break;
|
|
80
|
+
case d.up:
|
|
81
|
+
e = n.Previous;
|
|
82
|
+
break;
|
|
83
|
+
case d.right:
|
|
84
|
+
e = r ? n.Previous : n.Next;
|
|
85
|
+
break;
|
|
86
|
+
case d.down:
|
|
87
|
+
e = n.Next;
|
|
88
|
+
break;
|
|
89
|
+
case d.space:
|
|
90
|
+
case d.enter:
|
|
91
|
+
e = n.Toggle;
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
e = null;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
e !== null && (t.preventDefault(), this.onNavigate(t, e));
|
|
98
|
+
}
|
|
99
|
+
}, b(m), this.showLicenseWatermark = w(m);
|
|
100
|
+
const o = P(i, this.expandMode);
|
|
101
|
+
o.focused || (o.focused = I(i)), this.state = o;
|
|
102
|
+
}
|
|
103
|
+
get expandMode() {
|
|
104
|
+
return this.props.expandMode || "multiple";
|
|
105
|
+
}
|
|
106
|
+
get selectedItem() {
|
|
107
|
+
const { selected: i = this.state.selected } = this.props;
|
|
108
|
+
return i;
|
|
109
|
+
}
|
|
110
|
+
get expandedItems() {
|
|
111
|
+
return this.props.isControlled ? this.props.expanded || [] : this.state.expanded;
|
|
112
|
+
}
|
|
113
|
+
get children() {
|
|
114
|
+
const i = { ...this.state, selected: this.selectedItem }, o = {
|
|
115
|
+
animation: this.props.animation,
|
|
116
|
+
keepItemsMounted: this.props.keepItemsMounted,
|
|
117
|
+
state: i,
|
|
118
|
+
expanded: this.expandedItems,
|
|
119
|
+
handleSelect: this.handleSelect,
|
|
120
|
+
children: this.props.children
|
|
121
|
+
};
|
|
122
|
+
return v(o);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @hidden
|
|
126
|
+
*/
|
|
127
|
+
render() {
|
|
128
|
+
const i = {
|
|
129
|
+
"aria-activedescendant": this.activeDescendant
|
|
130
|
+
}, o = S(
|
|
131
|
+
"k-panelbar",
|
|
132
|
+
"k-pos-relative",
|
|
133
|
+
this.props.className
|
|
134
|
+
);
|
|
135
|
+
return /* @__PURE__ */ p.createElement(
|
|
136
|
+
"ul",
|
|
137
|
+
{
|
|
138
|
+
ref: (t) => {
|
|
139
|
+
this._element = t;
|
|
140
|
+
},
|
|
141
|
+
dir: this.props.dir,
|
|
142
|
+
role: "tree",
|
|
143
|
+
tabIndex: 0,
|
|
144
|
+
onKeyDown: this.handleKeyDown,
|
|
145
|
+
onFocus: this.handleWrapperFocus,
|
|
146
|
+
onBlur: this.handleWrapperBlur,
|
|
147
|
+
className: o,
|
|
148
|
+
style: this.props.style,
|
|
149
|
+
...i
|
|
150
|
+
},
|
|
151
|
+
this.children,
|
|
152
|
+
this.showLicenseWatermark && /* @__PURE__ */ p.createElement(K, null)
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
nextTick(i) {
|
|
156
|
+
this.nextTickId = window.setTimeout(() => i());
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
c.propTypes = {
|
|
160
|
+
animation: a.bool,
|
|
161
|
+
children: function(i, o) {
|
|
162
|
+
const t = i[o];
|
|
163
|
+
if (t) {
|
|
164
|
+
if (Array.isArray(t)) {
|
|
165
|
+
for (let r of t)
|
|
166
|
+
if (!r.type || r.type !== u)
|
|
167
|
+
return new Error(
|
|
168
|
+
"PanelBar children should be either PanelBarItem or Array of PanelBarItem."
|
|
169
|
+
);
|
|
170
|
+
} else if (t.type !== u)
|
|
171
|
+
return new Error(
|
|
172
|
+
"PanelBar child should be either PanelBarItem or Array of PanelBarItem."
|
|
173
|
+
);
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
},
|
|
178
|
+
dir: a.string,
|
|
179
|
+
selected: a.string,
|
|
180
|
+
expanded: a.arrayOf(a.string),
|
|
181
|
+
focused: a.string,
|
|
182
|
+
expandMode: a.oneOf(["single", "multiple"]),
|
|
183
|
+
className: a.string,
|
|
184
|
+
keepItemsMounted: a.bool,
|
|
185
|
+
onSelect: a.func,
|
|
186
|
+
style: a.object
|
|
187
|
+
}, c.defaultProps = {
|
|
188
|
+
expandMode: "multiple",
|
|
189
|
+
animation: !0,
|
|
190
|
+
keepItemsMounted: !1
|
|
191
|
+
};
|
|
192
|
+
let f = c;
|
|
193
|
+
export {
|
|
194
|
+
f as PanelBar
|
|
195
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),t=require("prop-types"),c=require("@progress/kendo-react-common"),f=require("@progress/kendo-svg-icons"),C=require("@progress/kendo-react-animation");function P(i){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>i[e]})}}return n.default=i,Object.freeze(n)}const a=P(w);function T({imageUrl:i,icon:n,svgIcon:e,iconClass:o}){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}):o?a.createElement("span",{role:"presentation",className:"k-panelbar-item-icon "+o}):null}const p=class p extends a.PureComponent{constructor(n){super(n),this.handleItemClick=()=>{const{onSelect:e,disabled:o,id:d}=this.props;e&&!o&&e.call(void 0,{uniquePrivateKey:this.props.uniquePrivateKey,id:d,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:o,uniquePrivateKey:d,disabled:s,selected:m,focused:g,expanded:r,className:y,level:h,headerClassName:v,animation:b,keepItemsMounted:l}=this.props,N={role:"treeitem","aria-disabled":s,"aria-hidden":!s&&!r,"aria-selected":!s&&m,"aria-expanded":!s&&r&&!!e},E=c.classNames("k-panelbar-item",{"k-panelbar-header":h===0,"k-expanded":r&&!!e,"k-disabled":s},`k-level-${h}`,y),x=c.classNames("k-link",{"k-selected":!s&&m,"k-focus":!s&&g},v),I={display:"block"},S=T(this.props),O=!s&&e?a.createElement(c.IconWrap,{name:r?"chevron-up":"chevron-down",icon:r?f.chevronUpIcon:f.chevronDownIcon,className:c.classNames("k-panelbar-toggle",r?"k-panelbar-collapse":"k-panelbar-expand")}):null,k=!s&&r||l?a.createElement("ul",{role:"group","aria-expanded":r,"aria-hidden":!r,className:"k-panelbar-group k-panel k-group",style:{display:l?this.state.show?"block":"none":"block"}},e):null,q=(b===void 0||b)&&!s&&e?a.createElement(C.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,key:d+"_animation",style:I,children:k,childFactory:l&&this.childFactory,unmountOnExit:!l,onBeforeEnter:()=>l&&this.setState({show:!0}),onAfterExited:()=>l&&this.setState({show:!1})}):k;return a.createElement("li",{id:n,className:E,...N},a.createElement("span",{className:x,onClick:this.handleItemClick},S,a.createElement("span",{className:"k-panelbar-item-text"},o),O),q)}};p.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},p.defaultProps={title:"Untitled"};let u=p;exports.PanelBarItem=u;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import e from "prop-types";
|
|
11
|
+
import { svgIconPropType as T, classNames as p, IconWrap as f } from "@progress/kendo-react-common";
|
|
12
|
+
import { chevronUpIcon as P, chevronDownIcon as q } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { Reveal as A } from "@progress/kendo-react-animation";
|
|
14
|
+
function D({ imageUrl: d, icon: o, svgIcon: t, iconClass: r }) {
|
|
15
|
+
return d ? /* @__PURE__ */ n.createElement("img", { role: "presentation", className: "k-panelbar-item-icon k-image", src: d }) : o || t ? /* @__PURE__ */ n.createElement(f, { className: "k-panelbar-item-icon", name: o, icon: t }) : r ? /* @__PURE__ */ n.createElement("span", { role: "presentation", className: "k-panelbar-item-icon " + r }) : null;
|
|
16
|
+
}
|
|
17
|
+
const l = class l extends n.PureComponent {
|
|
18
|
+
constructor(o) {
|
|
19
|
+
super(o), this.handleItemClick = () => {
|
|
20
|
+
const { onSelect: t, disabled: r, id: c } = this.props;
|
|
21
|
+
t && !r && t.call(void 0, {
|
|
22
|
+
uniquePrivateKey: this.props.uniquePrivateKey,
|
|
23
|
+
id: c,
|
|
24
|
+
target: this
|
|
25
|
+
});
|
|
26
|
+
}, this.childFactory = (t) => this.props.keepItemsMounted ? n.cloneElement(t, {
|
|
27
|
+
...t.props,
|
|
28
|
+
in: this.props.expanded
|
|
29
|
+
}) : t, this.state = {
|
|
30
|
+
show: o.expanded || !1
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
render() {
|
|
37
|
+
const {
|
|
38
|
+
id: o,
|
|
39
|
+
children: t,
|
|
40
|
+
title: r,
|
|
41
|
+
uniquePrivateKey: c,
|
|
42
|
+
disabled: a,
|
|
43
|
+
selected: m,
|
|
44
|
+
focused: y,
|
|
45
|
+
expanded: s,
|
|
46
|
+
className: E,
|
|
47
|
+
level: u,
|
|
48
|
+
headerClassName: g,
|
|
49
|
+
animation: h,
|
|
50
|
+
keepItemsMounted: i
|
|
51
|
+
} = this.props, v = {
|
|
52
|
+
role: "treeitem",
|
|
53
|
+
"aria-disabled": a,
|
|
54
|
+
"aria-hidden": !a && !s,
|
|
55
|
+
"aria-selected": !a && m,
|
|
56
|
+
"aria-expanded": !a && s && !!t
|
|
57
|
+
}, x = p(
|
|
58
|
+
"k-panelbar-item",
|
|
59
|
+
{
|
|
60
|
+
"k-panelbar-header": u === 0,
|
|
61
|
+
"k-expanded": s && !!t,
|
|
62
|
+
"k-disabled": a
|
|
63
|
+
},
|
|
64
|
+
`k-level-${u}`,
|
|
65
|
+
E
|
|
66
|
+
), N = p(
|
|
67
|
+
"k-link",
|
|
68
|
+
{
|
|
69
|
+
"k-selected": !a && m,
|
|
70
|
+
"k-focus": !a && y
|
|
71
|
+
},
|
|
72
|
+
g
|
|
73
|
+
), I = { display: "block" }, w = D(this.props), C = !a && t ? /* @__PURE__ */ n.createElement(
|
|
74
|
+
f,
|
|
75
|
+
{
|
|
76
|
+
name: s ? "chevron-up" : "chevron-down",
|
|
77
|
+
icon: s ? P : q,
|
|
78
|
+
className: p(
|
|
79
|
+
"k-panelbar-toggle",
|
|
80
|
+
s ? "k-panelbar-collapse" : "k-panelbar-expand"
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
) : null, k = !a && s || i ? /* @__PURE__ */ n.createElement(
|
|
84
|
+
"ul",
|
|
85
|
+
{
|
|
86
|
+
role: "group",
|
|
87
|
+
"aria-expanded": s,
|
|
88
|
+
"aria-hidden": !s,
|
|
89
|
+
className: "k-panelbar-group k-panel k-group",
|
|
90
|
+
style: { display: i ? this.state.show ? "block" : "none" : "block" }
|
|
91
|
+
},
|
|
92
|
+
t
|
|
93
|
+
) : null, S = (h === void 0 || h) && !a && t ? /* @__PURE__ */ n.createElement(
|
|
94
|
+
A,
|
|
95
|
+
{
|
|
96
|
+
transitionEnterDuration: 200,
|
|
97
|
+
transitionExitDuration: 200,
|
|
98
|
+
key: c + "_animation",
|
|
99
|
+
style: I,
|
|
100
|
+
children: k,
|
|
101
|
+
childFactory: i && this.childFactory,
|
|
102
|
+
unmountOnExit: !i,
|
|
103
|
+
onBeforeEnter: () => i && this.setState({ show: !0 }),
|
|
104
|
+
onAfterExited: () => i && this.setState({ show: !1 })
|
|
105
|
+
}
|
|
106
|
+
) : k;
|
|
107
|
+
return /* @__PURE__ */ n.createElement(
|
|
108
|
+
"li",
|
|
109
|
+
{
|
|
110
|
+
id: o,
|
|
111
|
+
className: x,
|
|
112
|
+
...v
|
|
113
|
+
},
|
|
114
|
+
/* @__PURE__ */ n.createElement("span", { className: N, onClick: this.handleItemClick }, w, /* @__PURE__ */ n.createElement("span", { className: "k-panelbar-item-text" }, r), C),
|
|
115
|
+
S
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
l.propTypes = {
|
|
120
|
+
animation: e.bool,
|
|
121
|
+
children: e.any,
|
|
122
|
+
className: e.string,
|
|
123
|
+
icon: e.string,
|
|
124
|
+
iconClass: e.string,
|
|
125
|
+
imageUrl: e.string,
|
|
126
|
+
svgIcon: T,
|
|
127
|
+
expanded: e.bool,
|
|
128
|
+
disabled: e.bool,
|
|
129
|
+
onSelect: e.func,
|
|
130
|
+
selected: e.bool,
|
|
131
|
+
level: e.number,
|
|
132
|
+
title: e.oneOfType([
|
|
133
|
+
e.string,
|
|
134
|
+
e.element
|
|
135
|
+
]),
|
|
136
|
+
id: e.oneOfType([
|
|
137
|
+
e.string,
|
|
138
|
+
e.number
|
|
139
|
+
]),
|
|
140
|
+
focused: e.bool,
|
|
141
|
+
keepItemsMounted: e.bool
|
|
142
|
+
}, l.defaultProps = {
|
|
143
|
+
title: "Untitled"
|
|
144
|
+
};
|
|
145
|
+
let b = l;
|
|
146
|
+
export {
|
|
147
|
+
b as PanelBarItem
|
|
148
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var r=(e=>(e[e.Toggle=0]="Toggle",e[e.Next=1]="Next",e[e.Previous=2]="Previous",e))(r||{});exports.NavigationAction=r;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
var r = /* @__PURE__ */ ((e) => (e[e.Toggle = 0] = "Toggle", e[e.Next = 1] = "Next", e[e.Previous = 2] = "Previous", e))(r || {});
|
|
10
|
+
export {
|
|
11
|
+
r as NavigationAction
|
|
12
|
+
};
|
package/panelbar/util.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),d=require("./PanelBarItem.js");function O(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 a=O(x),m=({animation:n=!0,keepItemsMounted:r=!1,state:e,expanded:t,handleSelect:i,children:p,parentExpanded:u=!0,level:o=0,parentPrivateKey:l=[]})=>a.Children.map(p,(s,E)=>{if(s&&s.type===d.PanelBarItem){let g,f=c(s,l,E);if(s.props.children){const P={animation:n,keepItemsMounted:r,state:e,expanded:t,handleSelect:i,children:s.props.children,parentExpanded:(t||[]).indexOf(f)>-1,level:o+1,parentPrivateKey:[...l,f]};g=m(P)}return a.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:l,parentExpanded:u,level:o,expanded:(t||[]).indexOf(f)>-1,focused:e.focused===f&&e.wrapperFocused,selected:e.selected===f,children:g,onSelect:i})}else return a.createElement("div",{className:"k-panelbar-content k-content"},s)}),B=n=>{const r=a.Children.toArray(n.children)[0];return r?c(r,[],0):""},b=(n,r,e={expanded:n.expanded||[],selected:n.selected||"",focused:n.focused||"",wrapperFocused:!1},t=!0,i=[])=>(a.Children.map(n.children,(p,u)=>{if(p&&p.type===d.PanelBarItem){let o=c(p,i,u);!p.props.disabled&&t&&(p.props.selected&&(e.selected=o),p.props.focused&&(e.focused=o),p.props.expanded&&(r==="multiple"?e.expanded.push(o):r==="single"&&(e.expanded=[o])),p.props.children&&(e=b(p.props,r,e,!!p.props.expanded,[...i,o])))}}),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 y(n,r=[]){return a.Children.forEach(n,e=>{e&&e.props&&!e.props.disabled&&(r.push(e),e.props.children&&y(e.props.children,r))}),r}function C(n,r=[]){return a.Children.forEach(n,e=>{e&&e.props&&!e.props.disabled&&(e.props.expanded||e.props.parentExpanded)&&(r.push(e),e.props.children&&C(e.props.children,r))}),r}const S=n=>n!=null;exports.PanelBarUtils=void 0;(n=>{function r(e){return e.map((t,i)=>{let p;return t.content&&(p=t.content),t.children&&(p=r(t.children)),a.createElement(d.PanelBarItem,{...t,children:p,key:t.id||i})})}n.mapItemsToComponents=r})(exports.PanelBarUtils||(exports.PanelBarUtils={}));const q=(n,r)=>n.length!==r.length?!1:n.every((e,t)=>e===r[t]);exports.flatChildren=y;exports.flatVisibleChildren=C;exports.flatVisibleItems=I;exports.getFirstId=B;exports.getInitialState=b;exports.isArrayEqual=q;exports.isPresent=S;exports.renderChildren=m;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import { PanelBarItem as c } from "./PanelBarItem.mjs";
|
|
11
|
+
const C = ({
|
|
12
|
+
animation: n = !0,
|
|
13
|
+
keepItemsMounted: r = !1,
|
|
14
|
+
state: e,
|
|
15
|
+
expanded: o,
|
|
16
|
+
handleSelect: f,
|
|
17
|
+
children: p,
|
|
18
|
+
parentExpanded: i = !0,
|
|
19
|
+
level: t = 0,
|
|
20
|
+
parentPrivateKey: u = []
|
|
21
|
+
}) => a.Children.map(p, (s, E) => {
|
|
22
|
+
if (s && s.type === c) {
|
|
23
|
+
let m, d = l(s, u, E);
|
|
24
|
+
if (s.props.children) {
|
|
25
|
+
const g = {
|
|
26
|
+
animation: n,
|
|
27
|
+
keepItemsMounted: r,
|
|
28
|
+
state: e,
|
|
29
|
+
expanded: o,
|
|
30
|
+
handleSelect: f,
|
|
31
|
+
children: s.props.children,
|
|
32
|
+
parentExpanded: (o || []).indexOf(d) > -1,
|
|
33
|
+
level: t + 1,
|
|
34
|
+
parentPrivateKey: [...u, d]
|
|
35
|
+
};
|
|
36
|
+
m = C(g);
|
|
37
|
+
}
|
|
38
|
+
return a.cloneElement(
|
|
39
|
+
s,
|
|
40
|
+
{
|
|
41
|
+
...s.props,
|
|
42
|
+
animation: s.props.animation !== void 0 ? s.props.animation : n,
|
|
43
|
+
keepItemsMounted: r,
|
|
44
|
+
id: s.props.id || `k-panelbar-item-default-${d}`,
|
|
45
|
+
uniquePrivateKey: d,
|
|
46
|
+
parentUniquePrivateKey: u,
|
|
47
|
+
parentExpanded: i,
|
|
48
|
+
level: t,
|
|
49
|
+
expanded: (o || []).indexOf(d) > -1,
|
|
50
|
+
focused: e.focused === d && e.wrapperFocused,
|
|
51
|
+
selected: e.selected === d,
|
|
52
|
+
children: m,
|
|
53
|
+
onSelect: f
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
} else
|
|
57
|
+
return /* @__PURE__ */ a.createElement("div", { className: "k-panelbar-content k-content" }, s);
|
|
58
|
+
}), q = (n) => {
|
|
59
|
+
const r = a.Children.toArray(n.children)[0];
|
|
60
|
+
return r ? l(r, [], 0) : "";
|
|
61
|
+
}, b = (n, r, e = {
|
|
62
|
+
expanded: n.expanded || [],
|
|
63
|
+
selected: n.selected || "",
|
|
64
|
+
focused: n.focused || "",
|
|
65
|
+
wrapperFocused: !1
|
|
66
|
+
}, o = !0, f = []) => (a.Children.map(n.children, (p, i) => {
|
|
67
|
+
if (p && p.type === c) {
|
|
68
|
+
let t = l(p, f, i);
|
|
69
|
+
!p.props.disabled && o && (p.props.selected && (e.selected = t), p.props.focused && (e.focused = t), p.props.expanded && (r === "multiple" ? e.expanded.push(t) : r === "single" && (e.expanded = [t])), p.props.children && (e = b(
|
|
70
|
+
p.props,
|
|
71
|
+
r,
|
|
72
|
+
e,
|
|
73
|
+
!!p.props.expanded,
|
|
74
|
+
[...f, t]
|
|
75
|
+
)));
|
|
76
|
+
}
|
|
77
|
+
}), e), l = (n, r, e) => n && n.props && n.props.id ? n.props.id : r.length ? r[r.length - 1] + `.${e}` : `.${e}`;
|
|
78
|
+
function I(n, r = []) {
|
|
79
|
+
return (n || []).forEach((e) => {
|
|
80
|
+
e.disabled || (r.push(e), e.expanded && e.children && I(e.children, r));
|
|
81
|
+
}), r;
|
|
82
|
+
}
|
|
83
|
+
function v(n, r = []) {
|
|
84
|
+
return a.Children.forEach(n, (e) => {
|
|
85
|
+
e && e.props && !e.props.disabled && (r.push(e), e.props.children && v(e.props.children, r));
|
|
86
|
+
}), r;
|
|
87
|
+
}
|
|
88
|
+
function y(n, r = []) {
|
|
89
|
+
return a.Children.forEach(n, (e) => {
|
|
90
|
+
e && e.props && !e.props.disabled && (e.props.expanded || e.props.parentExpanded) && (r.push(e), e.props.children && y(e.props.children, r));
|
|
91
|
+
}), r;
|
|
92
|
+
}
|
|
93
|
+
const F = (n) => n != null;
|
|
94
|
+
var x;
|
|
95
|
+
((n) => {
|
|
96
|
+
function r(e) {
|
|
97
|
+
return e.map((o, f) => {
|
|
98
|
+
let p;
|
|
99
|
+
return o.content && (p = o.content), o.children && (p = r(o.children)), /* @__PURE__ */ a.createElement(
|
|
100
|
+
c,
|
|
101
|
+
{
|
|
102
|
+
...o,
|
|
103
|
+
children: p,
|
|
104
|
+
key: o.id || f
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
n.mapItemsToComponents = r;
|
|
110
|
+
})(x || (x = {}));
|
|
111
|
+
const $ = (n, r) => n.length !== r.length ? !1 : n.every((e, o) => e === r[o]);
|
|
112
|
+
export {
|
|
113
|
+
x as PanelBarUtils,
|
|
114
|
+
v as flatChildren,
|
|
115
|
+
y as flatVisibleChildren,
|
|
116
|
+
I as flatVisibleItems,
|
|
117
|
+
q as getFirstId,
|
|
118
|
+
b as getInitialState,
|
|
119
|
+
$ as isArrayEqual,
|
|
120
|
+
F as isPresent,
|
|
121
|
+
C as renderChildren
|
|
122
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),k=require("./SplitterPane.js"),B=require("./SplitterBar.js"),T=require("@progress/kendo-react-common"),_=require("../package-metadata.js"),C=require("./messages/index.js"),w=require("@progress/kendo-react-intl");function N(d){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(i,e,t.get?t:{enumerable:!0,get:()=>d[e]})}}return i.default=d,Object.freeze(i)}const S=N(R),q={collapsible:!1,collapsed:!1,resizable:!0,scrollable:!0},L=150,b=class b extends S.Component{constructor(i){super(i),this._container=null,this.validatePanes=e=>{if(!e.filter(n=>n.size===void 0).length)throw new Error("The Splitter should have at least one pane without a set size.")},this.mapPaneOptions=(e,t)=>{const n=this.orientation,{dragIndex:r,isDragging:a}=this.state,l=[];for(let s=0;s<t.length;s++){let o=!1;const p=t[s];S.isValidElement(p)&&(o=p.type.displayName==="Splitter");let h=!1;a&&r!==void 0&&(h=r===s||r+1===s),l.push({...q,orientation:n,containsSplitter:o,overlay:h,...(e||[])[s]})}return l},this.mapSplitterPanes=(e,t)=>{const n=w.provideLocalizationService(this).toLanguageString(C.splitBarLabel,C.messages[C.splitBarLabel]);return e.map((r,a)=>{let l;const s=a*2,o=s+1;if(a+1<e.length){const h=e[a+1];l=S.createElement(B.SplitterBar,{key:o,index:a,orientation:r.orientation,prev:r,next:h,ariaLabel:n,onDrag:this.onBarDragResize,onToggle:this.onBarToggle,onKeyboardResize:this.onBarKeyboardResize,isRtl:this.isRtl})}return[S.createElement(k.SplitterPane,{key:s,...r},t[a]),l]})},this.onBarToggle=(e,t)=>{const r=this.panesOptions(this.panesContent).map((a,l)=>{const s=this.getPaneProps(a);return l===e?{...s,collapsed:!a.collapsed}:{...s}});this.props.onChange&&this.props.onChange({newState:r,isLast:!0,nativeEvent:t})},this.onBarDragResize=(e,t,n,r,a)=>{const l=new Date().getTime(),{pageX:s,pageY:o}=e,{prevElement:p,nextElement:h}=this.surroudingPanes(t);if(!p||!h)return;if(r){this.setState({isDragging:!0,dragIndex:n,startTime:l,originalX:s,originalY:o,originalPrevSize:this.elementSize(p),originalNextSize:this.elementSize(h)});return}const{originalPrevSize:P,originalNextSize:c,startTime:v,originalX:f,originalY:m}=this.state;if(!r&&l-v<L){a&&this.resetDragState();return}let g;this.orientation==="vertical"?g=o-m:this.isRtl?g=f-s:g=s-f,this.resize(n,n+1,P,c,g,a,e),a&&this.resetDragState()},this.onBarKeyboardResize=(e,t,n,r)=>{const{prevElement:a,nextElement:l}=this.surroudingPanes(e),s=this.elementSize(a),o=this.elementSize(l);this.resize(t,t+1,s,o,n,!0,r)},this.containerSize=()=>this._container?this.elementSize(this._container,!0):0,this.panesOptions=e=>this.mapPaneOptions(this.panes,e),this.elementSize=(e,t)=>{const n=t?"client":"offset";return this.orientation==="vertical"?e[`${n}Height`]:e[`${n}Width`]},this.clamp=(e,t,n)=>Math.min(t,Math.max(e,n)),this.fixedSize=e=>e&&e.length>0,T.validatePackage(_.packageMetadata),this.state={isDragging:!1,dragIndex:void 0,startTime:0,originalX:0,originalY:0,originalPrevSize:0,originalNextSize:0,panes:i.defaultPanes||[]}}get isControlledState(){return this.props.panes!==void 0}get panes(){return this.panesDuringOnChange!==void 0?this.panesDuringOnChange:this.isControlledState?this.props.panes:this.state.panes}get orientation(){return this.props.orientation||"horizontal"}get isRtl(){return this._container&&getComputedStyle(this._container).direction==="rtl"||!1}get panesContent(){return S.Children.toArray(this.props.children).filter(i=>i)}render(){const i=this.panesContent,e=this.panesOptions(i),t=T.classNames("k-widget","k-splitter","k-splitter-flex",`k-splitter-${this.orientation}`,this.props.className);return this.validatePanes(e),S.createElement("div",{style:this.props.style,ref:n=>this._container=n,className:t},this.mapSplitterPanes(e,i))}surroudingPanes(i){return{prevElement:i.previousElementSibling,nextElement:i.nextElementSibling}}isPercent(i){return/%$/.test(i)}toPixels(i,e){let t=parseInt(i,10);return this.isPercent(i)&&(t=e*t/100),t}resetDragState(){this.setState({isDragging:!1,dragIndex:void 0,startTime:0,originalX:0,originalY:0,originalPrevSize:0,originalNextSize:0})}resize(i,e,t,n,r,a,l){const s=this.panesOptions(this.panesContent),o=s[i],p=s[e],h=t+n,P=this.containerSize(),c=u=>this.toPixels(u,P),v={index:i,initialSize:t,min:c(o.min)||h-c(p.max)||0,max:c(o.max)||h-c(p.min)||h},f={index:e,initialSize:n,min:c(p.min)||h-c(o.max)||0,max:c(p.max)||h-c(o.min)||h},m=(u,x)=>{const z=s[u.index],E=this.clamp(u.min,u.max,u.initialSize+x);return this.isPercent(z.size||"")?100*E/P+"%":E+"px"};let g,O;this.fixedSize(o.size)&&this.fixedSize(p.size)?(g=m(v,r),O=m(f,-r)):p.collapsible||this.fixedSize(p.size)?O=m(f,-r):g=m(v,r);const y=s.map((u,x)=>{const z=this.getPaneProps(u);return x===i?{...z,size:g}:x===e?{...z,size:O}:{...z}});this.panesDuringOnChange=y,this.isControlledState||this.setState({panes:y}),this.props.onChange&&this.props.onChange({newState:y,isLast:a,nativeEvent:l}),this.panesDuringOnChange=void 0}getPaneProps(i){const{orientation:e,overlay:t,containsSplitter:n,...r}=i;return r}};b.displayName="Splitter";let D=b;exports.Splitter=D;
|