@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,163 @@
|
|
|
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 r from "react";
|
|
10
|
+
import o from "prop-types";
|
|
11
|
+
import { TabStripNavigation as c } from "./TabStripNavigation.mjs";
|
|
12
|
+
import { TabStripContent as b } from "./TabStripContent.mjs";
|
|
13
|
+
import { Keys as n, validatePackage as m, shouldShowValidationUI as f, classNames as u, WatermarkOverlay as g } from "@progress/kendo-react-common";
|
|
14
|
+
import { packageMetadata as d } from "../package-metadata.mjs";
|
|
15
|
+
const h = class h extends r.Component {
|
|
16
|
+
constructor(a) {
|
|
17
|
+
super(a), this._element = null, this.showLicenseWatermark = !1, this.keyBinding = {
|
|
18
|
+
[n.left]: () => this.prevNavigatableTab(),
|
|
19
|
+
[n.right]: () => this.nextNavigatableTab(),
|
|
20
|
+
[n.down]: () => this.nextNavigatableTab(),
|
|
21
|
+
[n.up]: () => this.prevNavigatableTab(),
|
|
22
|
+
[n.home]: () => 0,
|
|
23
|
+
[n.end]: () => r.Children.count(this.props.children) - 1
|
|
24
|
+
}, this.onSelect = (t) => {
|
|
25
|
+
this.props.selected !== t && this.props.onSelect && this.props.onSelect({
|
|
26
|
+
selected: t
|
|
27
|
+
});
|
|
28
|
+
}, this.onKeyDown = (t) => {
|
|
29
|
+
let e;
|
|
30
|
+
switch (t.keyCode) {
|
|
31
|
+
case n.left:
|
|
32
|
+
e = this.keyBinding[this.invertKeys(n.left, n.right)];
|
|
33
|
+
break;
|
|
34
|
+
case n.right:
|
|
35
|
+
e = this.keyBinding[this.invertKeys(n.right, n.left)];
|
|
36
|
+
break;
|
|
37
|
+
case n.up:
|
|
38
|
+
e = this.keyBinding[n.up];
|
|
39
|
+
break;
|
|
40
|
+
case n.down:
|
|
41
|
+
e = this.keyBinding[n.down];
|
|
42
|
+
break;
|
|
43
|
+
case n.home:
|
|
44
|
+
e = this.keyBinding[n.home];
|
|
45
|
+
break;
|
|
46
|
+
case n.end:
|
|
47
|
+
e = this.keyBinding[n.end];
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
e && (t.preventDefault(), this.onSelect(e()));
|
|
51
|
+
}, this.renderContent = (t) => {
|
|
52
|
+
const { selected: e, children: i, tabContentStyle: s } = t, l = r.Children.count(i);
|
|
53
|
+
return e < l && e > -1 ? /* @__PURE__ */ r.createElement(b, { index: e, ...t, style: s }) : null;
|
|
54
|
+
}, this.firstNavigatableTab = () => {
|
|
55
|
+
const t = this.children(), e = r.Children.count(t);
|
|
56
|
+
if (t) {
|
|
57
|
+
for (let i = 0; i < e; i++)
|
|
58
|
+
if (!t[i].props.disabled)
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
}, this.lastNavigatableTab = () => {
|
|
62
|
+
const t = this.children(), e = r.Children.count(t);
|
|
63
|
+
if (t) {
|
|
64
|
+
for (let i = e - 1; i > 0; i--)
|
|
65
|
+
if (!t[i].props.disabled)
|
|
66
|
+
return i;
|
|
67
|
+
}
|
|
68
|
+
}, this.prevNavigatableTab = () => {
|
|
69
|
+
const t = this.children(), { selected: e } = this.props, i = e ? e - 1 : -1;
|
|
70
|
+
if (i < 0)
|
|
71
|
+
return this.lastNavigatableTab();
|
|
72
|
+
if (t)
|
|
73
|
+
for (let s = i; s > -1; s--) {
|
|
74
|
+
if (!t[s].props.disabled)
|
|
75
|
+
return s;
|
|
76
|
+
if (s === 0)
|
|
77
|
+
return this.lastNavigatableTab();
|
|
78
|
+
}
|
|
79
|
+
}, this.nextNavigatableTab = () => {
|
|
80
|
+
const t = this.children(), { selected: e } = this.props, i = e ? e + 1 : 1, s = r.Children.count(t);
|
|
81
|
+
if (i >= s)
|
|
82
|
+
return this.firstNavigatableTab();
|
|
83
|
+
if (t)
|
|
84
|
+
for (let l = i; l < s; l++) {
|
|
85
|
+
if (!t[l].props.disabled)
|
|
86
|
+
return l;
|
|
87
|
+
if (l + 1 === s)
|
|
88
|
+
return this.firstNavigatableTab();
|
|
89
|
+
}
|
|
90
|
+
}, m(d), this.showLicenseWatermark = f(d);
|
|
91
|
+
}
|
|
92
|
+
get contentPanelId() {
|
|
93
|
+
return this.props.id + "-content-panel-id";
|
|
94
|
+
}
|
|
95
|
+
get navItemId() {
|
|
96
|
+
return this.props.id + "-nav-item-id";
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @hidden
|
|
100
|
+
*/
|
|
101
|
+
render() {
|
|
102
|
+
const a = {
|
|
103
|
+
...this.props,
|
|
104
|
+
children: this.children(),
|
|
105
|
+
contentPanelId: this.contentPanelId,
|
|
106
|
+
navItemId: this.navItemId,
|
|
107
|
+
onKeyDown: this.onKeyDown,
|
|
108
|
+
onSelect: this.onSelect
|
|
109
|
+
}, { tabPosition: t, tabIndex: e = 0 } = a, i = t === "bottom", s = u(
|
|
110
|
+
"k-tabstrip k-pos-relative",
|
|
111
|
+
{
|
|
112
|
+
"k-tabstrip-left": t === "left",
|
|
113
|
+
"k-tabstrip-right": t === "right",
|
|
114
|
+
"k-tabstrip-bottom": t === "bottom",
|
|
115
|
+
"k-tabstrip-top": t === "top",
|
|
116
|
+
"k-tabstrip-scrollable": this.props.scrollable
|
|
117
|
+
},
|
|
118
|
+
this.props.className
|
|
119
|
+
);
|
|
120
|
+
return /* @__PURE__ */ r.createElement(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
id: this.props.id,
|
|
124
|
+
ref: (l) => this._element = l,
|
|
125
|
+
dir: this.props.dir,
|
|
126
|
+
className: s,
|
|
127
|
+
style: this.props.style
|
|
128
|
+
},
|
|
129
|
+
!i && /* @__PURE__ */ r.createElement(c, { ...a, tabIndex: e }),
|
|
130
|
+
this.renderContent(a),
|
|
131
|
+
i && /* @__PURE__ */ r.createElement(c, { ...a, tabIndex: e }),
|
|
132
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(g, null)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
invertKeys(a, t) {
|
|
136
|
+
return this._element && getComputedStyle(this._element).direction === "rtl" || !1 ? t : a;
|
|
137
|
+
}
|
|
138
|
+
children() {
|
|
139
|
+
return r.Children.toArray(this.props.children).filter((a) => a);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
h.propTypes = {
|
|
143
|
+
animation: o.bool,
|
|
144
|
+
children: o.node,
|
|
145
|
+
onSelect: o.func,
|
|
146
|
+
selected: o.number,
|
|
147
|
+
style: o.object,
|
|
148
|
+
tabContentStyle: o.object,
|
|
149
|
+
tabPosition: o.string,
|
|
150
|
+
tabIndex: o.number,
|
|
151
|
+
className: o.string,
|
|
152
|
+
dir: o.string
|
|
153
|
+
}, h.defaultProps = {
|
|
154
|
+
animation: !0,
|
|
155
|
+
tabPosition: "top",
|
|
156
|
+
keepTabsMounted: !1,
|
|
157
|
+
buttonScrollSpeed: 100,
|
|
158
|
+
mouseScrollSpeed: 10
|
|
159
|
+
};
|
|
160
|
+
let p = h;
|
|
161
|
+
export {
|
|
162
|
+
p as TabStrip
|
|
163
|
+
};
|
|
@@ -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 h=require("react"),s=require("prop-types"),u=require("@progress/kendo-react-animation"),m=require("@progress/kendo-react-common");function y(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const r=y(h),p=class p extends r.Component{constructor(){super(...arguments),this.contentId=this.props.contentPanelId,this.childFactory=e=>r.cloneElement(e,{...e.props,in:e.props.children.props.id===String(this.contentId+this.props.selected)})}render(){const{children:e,selected:t,contentPanelId:n,keepTabsMounted:i,navItemId:a}=this.props,l=e&&typeof t=="number"&&r.Children.toArray(e)[t],d=m.classNames("k-tabstrip-content","k-active",l&&l.props.contentClassName);return r.createElement("div",{className:d,style:this.props.style,id:n,role:"tabpanel","aria-hidden":i,"aria-labelledby":`${a}-${(t==null?void 0:t.toString())||""}`},this.renderContent(e))}renderContent(e){return this.props.keepTabsMounted?r.Children.map(this.props.children,(t,n)=>this.renderChild(t,n)):this.renderChild(r.Children.toArray(e)[this.props.selected],this.props.selected)}renderChild(e,t){const n=t===this.props.selected,i={style:{display:n?void 0:"none"}},a={position:"initial",display:n?void 0:"none"};return e.props.disabled?null:this.props.animation?r.createElement(u.Fade,{appear:!0,exit:this.props.keepTabsMounted,style:a,childFactory:this.props.keepTabsMounted?this.childFactory:void 0},r.createElement("div",{...i,id:String(this.contentId+t),key:t},e.props.children)):r.createElement("div",{...i,key:t},e.props.children)}};p.propTypes={animation:s.bool,children:s.oneOfType([s.element,s.arrayOf(s.element)]),selected:s.number,style:s.object};let c=p;exports.TabStripContent=c;
|
|
@@ -0,0 +1,81 @@
|
|
|
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 r from "react";
|
|
10
|
+
import n from "prop-types";
|
|
11
|
+
import { Fade as c } from "@progress/kendo-react-animation";
|
|
12
|
+
import { classNames as h } from "@progress/kendo-react-common";
|
|
13
|
+
const p = class p extends r.Component {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.contentId = this.props.contentPanelId, this.childFactory = (e) => r.cloneElement(e, {
|
|
16
|
+
...e.props,
|
|
17
|
+
in: e.props.children.props.id === String(this.contentId + this.props.selected)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
render() {
|
|
24
|
+
const { children: e, selected: t, contentPanelId: s, keepTabsMounted: o, navItemId: i } = this.props, l = e && typeof t == "number" && r.Children.toArray(e)[t], d = h(
|
|
25
|
+
"k-tabstrip-content",
|
|
26
|
+
"k-active",
|
|
27
|
+
l && l.props.contentClassName
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ r.createElement(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: d,
|
|
33
|
+
style: this.props.style,
|
|
34
|
+
id: s,
|
|
35
|
+
role: "tabpanel",
|
|
36
|
+
"aria-hidden": o,
|
|
37
|
+
"aria-labelledby": `${i}-${(t == null ? void 0 : t.toString()) || ""}`
|
|
38
|
+
},
|
|
39
|
+
this.renderContent(e)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
renderContent(e) {
|
|
43
|
+
return this.props.keepTabsMounted ? r.Children.map(this.props.children, (t, s) => this.renderChild(t, s)) : this.renderChild(
|
|
44
|
+
r.Children.toArray(e)[this.props.selected],
|
|
45
|
+
this.props.selected
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
renderChild(e, t) {
|
|
49
|
+
const s = t === this.props.selected, o = {
|
|
50
|
+
style: {
|
|
51
|
+
display: s ? void 0 : "none"
|
|
52
|
+
}
|
|
53
|
+
}, i = {
|
|
54
|
+
position: "initial",
|
|
55
|
+
display: s ? void 0 : "none"
|
|
56
|
+
};
|
|
57
|
+
return e.props.disabled ? null : this.props.animation ? /* @__PURE__ */ r.createElement(
|
|
58
|
+
c,
|
|
59
|
+
{
|
|
60
|
+
appear: !0,
|
|
61
|
+
exit: this.props.keepTabsMounted,
|
|
62
|
+
style: i,
|
|
63
|
+
childFactory: this.props.keepTabsMounted ? this.childFactory : void 0
|
|
64
|
+
},
|
|
65
|
+
/* @__PURE__ */ r.createElement("div", { ...o, id: String(this.contentId + t), key: t }, e.props.children)
|
|
66
|
+
) : /* @__PURE__ */ r.createElement("div", { ...o, key: t }, e.props.children);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
p.propTypes = {
|
|
70
|
+
animation: n.bool,
|
|
71
|
+
children: n.oneOfType([
|
|
72
|
+
n.element,
|
|
73
|
+
n.arrayOf(n.element)
|
|
74
|
+
]),
|
|
75
|
+
selected: n.number,
|
|
76
|
+
style: n.object
|
|
77
|
+
};
|
|
78
|
+
let a = p;
|
|
79
|
+
export {
|
|
80
|
+
a as TabStripContent
|
|
81
|
+
};
|
|
@@ -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"),d=require("prop-types"),C=require("./TabStripNavigationItem.js"),k=require("@progress/kendo-react-common"),A=require("@progress/kendo-react-buttons"),u=require("@progress/kendo-svg-icons");function M(h){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(l,t,s.get?s:{enumerable:!0,get:()=>h[t]})}}return l.default=h,Object.freeze(l)}const a=M(R),x=h=>Array.apply(null,Array(h)),L=h=>h.preventDefault(),v="smooth",b="prev",S="next",I=class I extends a.Component{constructor(l){super(l),this.itemsNavRef=a.createRef(),this.isRtl=()=>this.props.dir==="rtl",this.onWheel=t=>{t.stopPropagation();const s=t.deltaY<0?b:S;this.setNewScrollPosition(s,t)},this.arrowClickPrev=t=>{this.handleArrowClick(b,t)},this.arrowClickNext=t=>{this.handleArrowClick(S,t)},this.handleArrowClick=(t,s)=>{this.setNewScrollPosition(t,s)},this.setNewScrollPosition=(t,s)=>{const e=this.itemsNavRef.current;if(!e)return;const n=this.horizontalScroll(),c=n?e.scrollWidth-e.offsetWidth:e.scrollHeight-e.offsetHeight,r=(s.type==="click"?this.props.buttonScrollSpeed:this.props.mouseScrollSpeed)||0;let o=n?e.scrollLeft:e.scrollTop,i=n?e.scrollWidth-e.scrollLeft:e.scrollHeight-e.scrollTop,f=e.scrollWidth-e.scrollLeft*-1;this.isRtl()&&this.horizontalScroll()?(t===b&&o<0&&(o+=r,f+=r),t===S&&o<c&&(o-=r,f-=r),o=Math.min(0,Math.min(c,o))):(t===b&&o>0&&(o-=r,i+=r),t===S&&o<c&&(o+=r,i-=r),o=Math.max(0,Math.min(c,o)));const g=o===0,m=s.type==="click"?v:void 0;if(n){const P=this.isRtl()?Math.round(f)<=e.clientWidth||Math.floor(f)<=e.clientWidth:Math.round(i)<=e.clientWidth||Math.floor(i)<=e.clientWidth;this.setState({disabledPrev:g,disabledNext:P}),e.scrollTo({left:o,behavior:m})}else this.setState({disabledPrev:g,disabledNext:Math.round(i)<=e.clientHeight||Math.floor(i)<=e.clientHeight}),e.scrollTo({top:o,behavior:m})},this.renderArrow=(t,s)=>{const e=this.horizontalScroll(),n={prev:{arrowTab:"k-tabstrip-prev",fontIcon:e?this.isRtl()?"caret-alt-right":"caret-alt-left":"caret-alt-up",svgIcon:e?this.isRtl()?u.caretAltRightIcon:u.caretAltLeftIcon:u.caretAltUpIcon},next:{arrowTab:"k-tabstrip-next",fontIcon:e?this.isRtl()?"caret-alt-left":"caret-alt-right":"caret-alt-down",svgIcon:e?this.isRtl()?u.caretAltLeftIcon:u.caretAltRightIcon:u.caretAltDownIcon}},c=(t===b?this.props.prevButton:this.props.nextButton)||A.Button,r=t===b?this.arrowClickPrev:this.arrowClickNext;return a.createElement(c,{disabled:s,className:`${n[t].arrowTab}`,onClick:r,icon:n[t].fontIcon,svgIcon:n[t].svgIcon,onMouseDown:L,tabIndex:-1,fillMode:"flat"})},this.state={disabledPrev:this.props.selected===0,disabledNext:this.props.selected===a.Children.count(this.props.children)-1}}componentDidMount(){this.props.scrollable&&this.scrollToSelected()}componentDidUpdate(l){const{scrollable:t,selected:s}=this.props;t&&l.selected!==s&&(this.scrollToSelected(),this.setState({disabledPrev:s===0,disabledNext:s===a.Children.count(this.props.children)-1}))}render(){const{selected:l,tabPosition:t,children:s,onSelect:e,onKeyDown:n,navItemId:c,contentPanelId:r}=this.props,o=a.Children.count(s),i=a.Children.toArray(s);let f;s&&(f=x(o).map((P,p,w)=>{const N={active:l===p,disabled:i[p].props.disabled,index:p,title:i[p].props.title,first:p===0,last:p===w.length-1,contentPanelId:r,id:c,onSelect:e};return a.createElement(C.TabStripNavigationItem,{key:p,...N})}));const g=k.classNames("k-tabstrip-items-wrapper",{"k-hstack":t==="top"||t==="bottom","k-vstack":t==="left"||t==="right"}),m=k.classNames("k-tabstrip-items","k-reset");return a.createElement("div",{className:g},this.props.scrollable?a.createElement(a.Fragment,null,this.renderArrow(b,this.state.disabledPrev),a.createElement("ul",{ref:this.itemsNavRef,className:m,role:"tablist",tabIndex:this.props.tabIndex,onKeyDown:n,onWheel:this.onWheel,"aria-orientation":t==="left"||t==="right"?"vertical":void 0},f),this.renderArrow(S,this.state.disabledNext)):a.createElement("ul",{className:m,role:"tablist",tabIndex:this.props.tabIndex,onKeyDown:n},f))}scrollToSelected(){const l=this.itemsNavRef.current,t=l&&l.children[this.props.selected||0];if(t instanceof HTMLElement&&l instanceof HTMLElement){const s=this.horizontalScroll(),e=s?l.offsetWidth:l.offsetHeight,n=s?t.offsetWidth:t.offsetHeight,c=s?"left":"top";let r=s?l.scrollLeft:l.scrollTop,o=0;if(this.isRtl()){const i=t.offsetLeft;r=r*-1,i<0?(o=i-n+l.offsetLeft,l.scrollTo({[c]:o,behavior:v})):i+n>e-r&&(o=r+i-n,l.scrollTo({[c]:o,behavior:v}))}else{const i=s?t.offsetLeft-l.offsetLeft:t.offsetTop-l.offsetTop;r+e<i+n?(o=i+n-e,l.scrollTo({[c]:o,behavior:v})):r>i&&(o=i,l.scrollTo({[c]:o,behavior:v}))}}}horizontalScroll(){return/top|bottom/.test(this.props.tabPosition||"top")}};I.propTypes={children:d.oneOfType([d.element,d.arrayOf(d.element)]),onSelect:d.func,onKeyDown:d.func,selected:d.number,tabIndex:d.number};let T=I;exports.TabStripNavigation=T;
|
|
@@ -0,0 +1,171 @@
|
|
|
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 f from "prop-types";
|
|
11
|
+
import { TabStripNavigationItem as C } from "./TabStripNavigationItem.mjs";
|
|
12
|
+
import { classNames as I } from "@progress/kendo-react-common";
|
|
13
|
+
import { Button as x } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { caretAltRightIcon as P, caretAltLeftIcon as k, caretAltUpIcon as A, caretAltDownIcon as M } from "@progress/kendo-svg-icons";
|
|
15
|
+
const E = (S) => Array.apply(null, Array(S)), L = (S) => S.preventDefault(), b = "smooth", d = "prev", u = "next", w = class w extends a.Component {
|
|
16
|
+
constructor(l) {
|
|
17
|
+
super(l), this.itemsNavRef = a.createRef(), this.isRtl = () => this.props.dir === "rtl", this.onWheel = (t) => {
|
|
18
|
+
t.stopPropagation();
|
|
19
|
+
const s = t.deltaY < 0 ? d : u;
|
|
20
|
+
this.setNewScrollPosition(s, t);
|
|
21
|
+
}, this.arrowClickPrev = (t) => {
|
|
22
|
+
this.handleArrowClick(d, t);
|
|
23
|
+
}, this.arrowClickNext = (t) => {
|
|
24
|
+
this.handleArrowClick(u, t);
|
|
25
|
+
}, this.handleArrowClick = (t, s) => {
|
|
26
|
+
this.setNewScrollPosition(t, s);
|
|
27
|
+
}, this.setNewScrollPosition = (t, s) => {
|
|
28
|
+
const e = this.itemsNavRef.current;
|
|
29
|
+
if (!e)
|
|
30
|
+
return;
|
|
31
|
+
const n = this.horizontalScroll(), c = n ? e.scrollWidth - e.offsetWidth : e.scrollHeight - e.offsetHeight, r = (s.type === "click" ? this.props.buttonScrollSpeed : this.props.mouseScrollSpeed) || 0;
|
|
32
|
+
let o = n ? e.scrollLeft : e.scrollTop, i = n ? e.scrollWidth - e.scrollLeft : e.scrollHeight - e.scrollTop, h = e.scrollWidth - e.scrollLeft * -1;
|
|
33
|
+
this.isRtl() && this.horizontalScroll() ? (t === d && o < 0 && (o += r, h += r), t === u && o < c && (o -= r, h -= r), o = Math.min(0, Math.min(c, o))) : (t === d && o > 0 && (o -= r, i += r), t === u && o < c && (o += r, i -= r), o = Math.max(0, Math.min(c, o)));
|
|
34
|
+
const v = o === 0, m = s.type === "click" ? b : void 0;
|
|
35
|
+
if (n) {
|
|
36
|
+
const T = this.isRtl() ? Math.round(h) <= e.clientWidth || Math.floor(h) <= e.clientWidth : Math.round(i) <= e.clientWidth || Math.floor(i) <= e.clientWidth;
|
|
37
|
+
this.setState({
|
|
38
|
+
disabledPrev: v,
|
|
39
|
+
disabledNext: T
|
|
40
|
+
}), e.scrollTo({ left: o, behavior: m });
|
|
41
|
+
} else
|
|
42
|
+
this.setState({
|
|
43
|
+
disabledPrev: v,
|
|
44
|
+
disabledNext: Math.round(i) <= e.clientHeight || Math.floor(i) <= e.clientHeight
|
|
45
|
+
}), e.scrollTo({ top: o, behavior: m });
|
|
46
|
+
}, this.renderArrow = (t, s) => {
|
|
47
|
+
const e = this.horizontalScroll(), n = {
|
|
48
|
+
prev: {
|
|
49
|
+
arrowTab: "k-tabstrip-prev",
|
|
50
|
+
fontIcon: e ? this.isRtl() ? "caret-alt-right" : "caret-alt-left" : "caret-alt-up",
|
|
51
|
+
svgIcon: e ? this.isRtl() ? P : k : A
|
|
52
|
+
},
|
|
53
|
+
next: {
|
|
54
|
+
arrowTab: "k-tabstrip-next",
|
|
55
|
+
fontIcon: e ? this.isRtl() ? "caret-alt-left" : "caret-alt-right" : "caret-alt-down",
|
|
56
|
+
svgIcon: e ? this.isRtl() ? k : P : M
|
|
57
|
+
}
|
|
58
|
+
}, c = (t === d ? this.props.prevButton : this.props.nextButton) || x, r = t === d ? this.arrowClickPrev : this.arrowClickNext;
|
|
59
|
+
return /* @__PURE__ */ a.createElement(
|
|
60
|
+
c,
|
|
61
|
+
{
|
|
62
|
+
disabled: s,
|
|
63
|
+
className: `${n[t].arrowTab}`,
|
|
64
|
+
onClick: r,
|
|
65
|
+
icon: n[t].fontIcon,
|
|
66
|
+
svgIcon: n[t].svgIcon,
|
|
67
|
+
onMouseDown: L,
|
|
68
|
+
tabIndex: -1,
|
|
69
|
+
fillMode: "flat"
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}, this.state = {
|
|
73
|
+
disabledPrev: this.props.selected === 0,
|
|
74
|
+
disabledNext: this.props.selected === a.Children.count(this.props.children) - 1
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
componentDidMount() {
|
|
81
|
+
this.props.scrollable && this.scrollToSelected();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @hidden
|
|
85
|
+
*/
|
|
86
|
+
componentDidUpdate(l) {
|
|
87
|
+
const { scrollable: t, selected: s } = this.props;
|
|
88
|
+
t && l.selected !== s && (this.scrollToSelected(), this.setState({
|
|
89
|
+
disabledPrev: s === 0,
|
|
90
|
+
disabledNext: s === a.Children.count(this.props.children) - 1
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @hidden
|
|
95
|
+
*/
|
|
96
|
+
render() {
|
|
97
|
+
const { selected: l, tabPosition: t, children: s, onSelect: e, onKeyDown: n, navItemId: c, contentPanelId: r } = this.props, o = a.Children.count(s), i = a.Children.toArray(s);
|
|
98
|
+
let h;
|
|
99
|
+
s && (h = E(o).map((T, p, R) => {
|
|
100
|
+
const g = {
|
|
101
|
+
active: l === p,
|
|
102
|
+
disabled: i[p].props.disabled,
|
|
103
|
+
index: p,
|
|
104
|
+
title: i[p].props.title,
|
|
105
|
+
first: p === 0,
|
|
106
|
+
last: p === R.length - 1,
|
|
107
|
+
contentPanelId: r,
|
|
108
|
+
id: c,
|
|
109
|
+
onSelect: e
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ a.createElement(C, { key: p, ...g });
|
|
112
|
+
}));
|
|
113
|
+
const v = I("k-tabstrip-items-wrapper", {
|
|
114
|
+
"k-hstack": t === "top" || t === "bottom",
|
|
115
|
+
"k-vstack": t === "left" || t === "right"
|
|
116
|
+
}), m = I("k-tabstrip-items", "k-reset");
|
|
117
|
+
return /* @__PURE__ */ a.createElement("div", { className: v }, this.props.scrollable ? /* @__PURE__ */ a.createElement(a.Fragment, null, this.renderArrow(d, this.state.disabledPrev), /* @__PURE__ */ a.createElement(
|
|
118
|
+
"ul",
|
|
119
|
+
{
|
|
120
|
+
ref: this.itemsNavRef,
|
|
121
|
+
className: m,
|
|
122
|
+
role: "tablist",
|
|
123
|
+
tabIndex: this.props.tabIndex,
|
|
124
|
+
onKeyDown: n,
|
|
125
|
+
onWheel: this.onWheel,
|
|
126
|
+
"aria-orientation": t === "left" || t === "right" ? "vertical" : void 0
|
|
127
|
+
},
|
|
128
|
+
h
|
|
129
|
+
), this.renderArrow(u, this.state.disabledNext)) : /* @__PURE__ */ a.createElement(
|
|
130
|
+
"ul",
|
|
131
|
+
{
|
|
132
|
+
className: m,
|
|
133
|
+
role: "tablist",
|
|
134
|
+
tabIndex: this.props.tabIndex,
|
|
135
|
+
onKeyDown: n
|
|
136
|
+
},
|
|
137
|
+
h
|
|
138
|
+
));
|
|
139
|
+
}
|
|
140
|
+
scrollToSelected() {
|
|
141
|
+
const l = this.itemsNavRef.current, t = l && l.children[this.props.selected || 0];
|
|
142
|
+
if (t instanceof HTMLElement && l instanceof HTMLElement) {
|
|
143
|
+
const s = this.horizontalScroll(), e = s ? l.offsetWidth : l.offsetHeight, n = s ? t.offsetWidth : t.offsetHeight, c = s ? "left" : "top";
|
|
144
|
+
let r = s ? l.scrollLeft : l.scrollTop, o = 0;
|
|
145
|
+
if (this.isRtl()) {
|
|
146
|
+
const i = t.offsetLeft;
|
|
147
|
+
r = r * -1, i < 0 ? (o = i - n + l.offsetLeft, l.scrollTo({ [c]: o, behavior: b })) : i + n > e - r && (o = r + i - n, l.scrollTo({ [c]: o, behavior: b }));
|
|
148
|
+
} else {
|
|
149
|
+
const i = s ? t.offsetLeft - l.offsetLeft : t.offsetTop - l.offsetTop;
|
|
150
|
+
r + e < i + n ? (o = i + n - e, l.scrollTo({ [c]: o, behavior: b })) : r > i && (o = i, l.scrollTo({ [c]: o, behavior: b }));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
horizontalScroll() {
|
|
155
|
+
return /top|bottom/.test(this.props.tabPosition || "top");
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
w.propTypes = {
|
|
159
|
+
children: f.oneOfType([
|
|
160
|
+
f.element,
|
|
161
|
+
f.arrayOf(f.element)
|
|
162
|
+
]),
|
|
163
|
+
onSelect: f.func,
|
|
164
|
+
onKeyDown: f.func,
|
|
165
|
+
selected: f.number,
|
|
166
|
+
tabIndex: f.number
|
|
167
|
+
};
|
|
168
|
+
let N = w;
|
|
169
|
+
export {
|
|
170
|
+
N as TabStripNavigation
|
|
171
|
+
};
|
|
@@ -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 p=require("react"),e=require("prop-types"),b=require("@progress/kendo-react-common");function h(s){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(o,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return o.default=s,Object.freeze(o)}const n=h(p),l=class l extends n.Component{constructor(){super(...arguments),this.itemRef=null,this.focus=()=>{this.itemRef&&(this.itemRef.tabIndex=0,this.itemRef.focus())},this.blur=()=>{this.itemRef&&(this.itemRef.tabIndex=-1,this.itemRef.blur())},this.onClick=()=>{this.props.onSelect&&this.props.onSelect(this.props.index),this.itemRef&&(this.itemRef.tabIndex=0,this.itemRef.focus())}}render(){const{id:o,active:t,disabled:i,title:a="Untitled",contentPanelId:c,index:f}=this.props,d={id:`${o}-${f.toString()}`,"aria-selected":t,"aria-controls":t?c:void 0,"aria-disabled":i,role:"tab",onClick:i?void 0:this.onClick},u=b.classNames("k-item","k-tabstrip-item",{"k-disabled":i,"k-active":t});return n.createElement("li",{...d,className:u,ref:m=>this.itemRef=m,onBlur:this.blur,"aria-controls":c},n.createElement("span",{className:"k-link"},a))}};l.propTypes={active:e.bool,disabled:e.bool,index:e.number,onSelect:e.func,title:e.oneOfType([e.string,e.element]),first:e.bool,last:e.bool};let r=l;exports.TabStripNavigationItem=r;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 s from "react";
|
|
10
|
+
import e from "prop-types";
|
|
11
|
+
import { classNames as p } from "@progress/kendo-react-common";
|
|
12
|
+
const o = class o extends s.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.itemRef = null, this.focus = () => {
|
|
15
|
+
this.itemRef && (this.itemRef.tabIndex = 0, this.itemRef.focus());
|
|
16
|
+
}, this.blur = () => {
|
|
17
|
+
this.itemRef && (this.itemRef.tabIndex = -1, this.itemRef.blur());
|
|
18
|
+
}, this.onClick = () => {
|
|
19
|
+
this.props.onSelect && this.props.onSelect(this.props.index), this.itemRef && (this.itemRef.tabIndex = 0, this.itemRef.focus());
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
render() {
|
|
26
|
+
const { id: r, active: t, disabled: i, title: a = "Untitled", contentPanelId: l, index: c } = this.props, m = {
|
|
27
|
+
id: `${r}-${c.toString()}`,
|
|
28
|
+
"aria-selected": t,
|
|
29
|
+
"aria-controls": t ? l : void 0,
|
|
30
|
+
"aria-disabled": i,
|
|
31
|
+
role: "tab",
|
|
32
|
+
onClick: i ? void 0 : this.onClick
|
|
33
|
+
}, f = p("k-item", "k-tabstrip-item", {
|
|
34
|
+
"k-disabled": i,
|
|
35
|
+
"k-active": t
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ s.createElement("li", { ...m, className: f, ref: (d) => this.itemRef = d, onBlur: this.blur, "aria-controls": l }, /* @__PURE__ */ s.createElement("span", { className: "k-link" }, a));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
o.propTypes = {
|
|
41
|
+
active: e.bool,
|
|
42
|
+
disabled: e.bool,
|
|
43
|
+
index: e.number,
|
|
44
|
+
onSelect: e.func,
|
|
45
|
+
title: e.oneOfType([
|
|
46
|
+
e.string,
|
|
47
|
+
e.element
|
|
48
|
+
]),
|
|
49
|
+
first: e.bool,
|
|
50
|
+
last: e.bool
|
|
51
|
+
};
|
|
52
|
+
let n = o;
|
|
53
|
+
export {
|
|
54
|
+
n as TabStripNavigationItem
|
|
55
|
+
};
|
|
@@ -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 l=require("react"),e=require("prop-types");function i(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const a=i(l),c=class c extends a.Component{render(){return null}};c.propTypes={disabled:e.bool,contentClassName:e.string,children:e.oneOfType([e.element,e.node]),title:e.oneOfType([e.string,e.element,e.node])};let o=c;exports.TabStripTab=o;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 o from "react";
|
|
10
|
+
import e from "prop-types";
|
|
11
|
+
const n = class n extends o.Component {
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
render() {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
n.propTypes = {
|
|
20
|
+
disabled: e.bool,
|
|
21
|
+
contentClassName: e.string,
|
|
22
|
+
children: e.oneOfType([
|
|
23
|
+
e.element,
|
|
24
|
+
e.node
|
|
25
|
+
]),
|
|
26
|
+
title: e.oneOfType([
|
|
27
|
+
e.string,
|
|
28
|
+
e.element,
|
|
29
|
+
e.node
|
|
30
|
+
])
|
|
31
|
+
};
|
|
32
|
+
let t = n;
|
|
33
|
+
export {
|
|
34
|
+
t as TabStripTab
|
|
35
|
+
};
|
|
@@ -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 y=require("react"),l=require("prop-types"),g=require("@progress/kendo-react-common"),b=require("./ResizeHandlers.js");function x(c){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>c[e]})}}return t.default=c,Object.freeze(t)}const p=x(y),f=200,h=class h extends p.Component{constructor(){super(...arguments),this.state={rtl:!1},this.oldSize={},this.draggable=null,this.dragging=!1,this.resizing=!1,this.element=null,this.hintElement=null,this.ignoreDrag=!1,this.pressOffset={x:0,y:0},this.pressXY={x:0,y:0},this.currentTranslate={x:0,y:0},this.preventDataOps=void 0,this.handleResize=(t,e)=>{if(e.end){this.handleRelease();return}if(!this.element||!this.hintElement)return;const s=t.clientX,n=t.clientY;this.resizing=!0;const a=(e.direction!=="ns"?s-this.pressXY.x:0)*(this.state.rtl?-1:1),i=e.direction!=="ew"?n-this.pressXY.y:0;if(this.dragElement&&(this.state.rtl?this.dragElement.style.marginLeft=-a+"px":this.dragElement.style.marginRight=-a+"px",this.dragElement.style.height=`calc(100% + ${i}px)`),this.hintElement.classList.add("k-layout-item-hint-resize"),this.preventDataOps)return;let r=0,o=0;const d=this.element.getBoundingClientRect();a>d.width/this.props.defaultPosition.colSpan/3&&(r=1),a<-d.width/this.props.defaultPosition.colSpan/1.25&&(r=-1),i>d.height/this.props.defaultPosition.rowSpan/3&&(o=1),i<-d.height/this.props.defaultPosition.rowSpan/1.25&&(o=-1),(r!==0||o!==0)&&this.props.update(this.props.index,0,0,o,r)},this.handlePress=t=>{if(!this.dragElement)return;if(this.pressXY={x:t.event.clientX,y:t.event.clientY},this.ignoreDrag=!1,this.props.ignoreDrag&&this.props.ignoreDrag(t.event.originalEvent)){this.ignoreDrag=!0;return}this.element&&this.hintElement&&(this.element.style.zIndex="10",this.hintElement.style.display="block"),this.dragElement.classList.remove("k-cursor-grab"),this.dragElement.classList.add("k-cursor-grabbing");const e=this.dragElement.getBoundingClientRect();this.pressOffset={x:t.event.clientX-e.x,y:t.event.clientY-e.y}},this.handleDrag=t=>{if(this.ignoreDrag)return;const e=this.dragElement;if(t.event.originalEvent.defaultPrevented||!e)return;this.dragging=!0,t.event.originalEvent.preventDefault();const s=e.getBoundingClientRect();if(this.currentTranslate={x:t.event.clientX-s.x-this.pressOffset.x+this.currentTranslate.x,y:t.event.clientY-s.y-this.pressOffset.y+this.currentTranslate.y},e.style.transform=`translate(${this.currentTranslate.x}px, ${this.currentTranslate.y}px)`,e.style.transition="transform 0s",this.preventDataOps)return;let n=0,a=0;this.currentTranslate.y>.7*s.height/this.props.defaultPosition.rowSpan&&(a=1),this.currentTranslate.y<.7*-s.height/this.props.defaultPosition.rowSpan&&(a=-1),this.currentTranslate.x>.7*s.width/this.props.defaultPosition.colSpan&&(n=1),this.currentTranslate.x<.7*-s.width/this.props.defaultPosition.colSpan&&(n=-1),this.props.update(this.props.index,a,this.state.rtl?-n:n,0,0)},this.handleRelease=()=>{this.dragging=this.resizing=!1,this.currentTranslate={x:0,y:0},this.element&&this.hintElement&&(this.element.style.zIndex="1",this.hintElement.classList.remove("k-layout-item-hint-resize"),this.hintElement.style.display="none");const t=this.dragElement;t&&(t.style.transform="translate(0px, 0px)",t.style.transition=`transform ${f}ms cubic-bezier(0.2, 0, 0, 1) 0s`,t.style.marginRight="0px",t.style.marginLeft="0px",t.style.height="100%",t.classList.remove("k-cursor-grabbing"),t.classList.add("k-cursor-grab"))}}get reorderable(){return this.props.reorderable!==void 0?this.props.reorderable:h.defaultProps.reorderable}get dragElement(){return this.draggable?this.draggable.element:void 0}componentDidMount(){this.element&&(getComputedStyle(this.element).direction==="rtl"&&this.setState({rtl:!0}),this.hintElement&&(this.hintElement.style.height=this.element.offsetHeight+"px",this.hintElement.style.width=this.element.offsetWidth+"px"))}render(){g.canUseDOM&&clearTimeout&&typeof clearTimeout=="function"&&(clearTimeout(this.preventDataOps),this.preventDataOps=window.setTimeout(()=>{this.preventDataOps=void 0},200));const t=this.props.defaultPosition,e=this.props.resizable!==void 0?this.props.resizable:h.defaultProps.resizable,s={gridColumnStart:t.col,gridColumnEnd:`span ${t.colSpan}`,gridRowStart:t.row,gridRowEnd:`span ${t.rowSpan}`,outline:"none",order:t.order,display:"none",...this.props.hintStyle},n={gridColumnStart:t.col,gridColumnEnd:`span ${t.colSpan}`,gridRowStart:t.row,gridRowEnd:`span ${t.rowSpan}`,order:t.order},a=p.createElement("div",{ref:i=>{this.draggable=i?{element:i}:null},className:g.classNames("k-tilelayout-item k-card",{"k-cursor-grab":this.reorderable},this.props.className),style:{height:"100%",...n,...this.props.style}},this.props.children,p.createElement(b.ResizeHandlers,{onPress:this.handlePress,onResize:this.handleResize,resizable:e,rtl:this.state.rtl}));return p.createElement("div",{ref:i=>{this.element=i},style:n},p.createElement("div",{ref:i=>{this.hintElement=i},style:{position:"absolute",...s},className:g.classNames("k-layout-item-hint",this.props.hintClassName)}),p.createElement(g.Draggable,{ref:i=>{this.draggable=i},onDrag:this.props.reorderable?this.handleDrag:void 0,onRelease:this.props.reorderable?this.handleRelease:void 0,onPress:this.props.reorderable?this.handlePress:void 0},a))}getSnapshotBeforeUpdate(t){return this.oldSize={},this.dragElement&&(this.oldSize=this.dragElement.getBoundingClientRect()),null}componentDidUpdate(t){const e=this.dragElement;if(!e)return;const s=e.getBoundingClientRect(),n=this.oldSize;if(this.resizing){const r=s.width-n.width;if(this.state.rtl){const u=parseFloat(e.style.marginLeft||"0");e.style.marginLeft=u-r+"px"}else{const u=parseFloat(e.style.marginRight||"0");e.style.marginRight=u+r+"px"}this.pressXY.x+=this.state.rtl?-r:r;const o=s.height-n.height,d=parseFloat(e.style.height.substring(12));e.style.height=`calc(100% + ${d+o}px)`,this.pressXY.y+=o}const a=n.left-s.left,i=n.top-s.top;if(!(a===0&&i===0)){if(this.dragging){(t.defaultPosition.order!==this.props.defaultPosition.order||t.defaultPosition.col!==this.props.defaultPosition.col)&&(this.currentTranslate.x=0,this.currentTranslate.y=0,e.style.transform="");return}Math.abs(i)<15&&Math.abs(a)<15||requestAnimationFrame(()=>{const r=this.element;r&&(r.style.transform=`translate(${a}px, ${i}px)`,r.style.transition="transform 0s",requestAnimationFrame(()=>{r.style.transform="",r.style.transition=`transform ${f}ms cubic-bezier(0.2, 0, 0, 1) 0s`}))})}}};h.propTypes={defaultPosition:l.object.isRequired,style:l.object,className:l.string,hintStyle:l.object,hintClassName:l.string,header:l.any,body:l.any,item:l.any,resizable:l.oneOf(["horizontal","vertical",!0,!1]),reorderable:l.bool},h.displayName="KendoTileLayoutItem",h.defaultProps={resizable:!0,reorderable:!0};let m=h;exports.InternalTile=m;
|