@progress/kendo-react-layout 7.2.4-develop.2 → 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
package/stepper/Step.mjs
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
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 e from "react";
|
|
10
|
+
import a from "prop-types";
|
|
11
|
+
import { StepperContext as Z } from "./context/StepperContext.mjs";
|
|
12
|
+
import { focusFirstFocusableChild as ee, dispatchEvent as L, classNames as te, IconWrap as O, toIconName as ae } from "@progress/kendo-react-common";
|
|
13
|
+
import { useLocalization as se } from "@progress/kendo-react-intl";
|
|
14
|
+
import { checkOutlineIcon as ne, exclamationCircleIcon as oe } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { DEFAULT_ANIMATION_DURATION as ce, NO_ANIMATION as le } from "./contants.mjs";
|
|
16
|
+
import { messages as ie, optionalText as re } from "./messages/index.mjs";
|
|
17
|
+
const g = e.forwardRef((R, V) => {
|
|
18
|
+
const {
|
|
19
|
+
// content
|
|
20
|
+
children: z,
|
|
21
|
+
className: E,
|
|
22
|
+
current: p,
|
|
23
|
+
disabled: n,
|
|
24
|
+
focused: d,
|
|
25
|
+
icon: i,
|
|
26
|
+
svgIcon: h,
|
|
27
|
+
index: s,
|
|
28
|
+
isValid: t,
|
|
29
|
+
label: r,
|
|
30
|
+
optional: u,
|
|
31
|
+
style: C,
|
|
32
|
+
tabIndex: y,
|
|
33
|
+
text: S,
|
|
34
|
+
...D
|
|
35
|
+
} = R, {
|
|
36
|
+
animationDuration: k,
|
|
37
|
+
isVertical: b,
|
|
38
|
+
item: H,
|
|
39
|
+
linear: P,
|
|
40
|
+
mode: F,
|
|
41
|
+
numOfSteps: o,
|
|
42
|
+
value: c,
|
|
43
|
+
onChange: f,
|
|
44
|
+
onFocus: I,
|
|
45
|
+
successIcon: _,
|
|
46
|
+
errorIcon: w,
|
|
47
|
+
successSVGIcon: B,
|
|
48
|
+
errorSVGIcon: G
|
|
49
|
+
} = e.useContext(Z), m = e.useRef(null), A = e.useCallback(
|
|
50
|
+
() => {
|
|
51
|
+
m.current && ee(m.current);
|
|
52
|
+
},
|
|
53
|
+
[]
|
|
54
|
+
), v = e.useCallback(
|
|
55
|
+
() => ({
|
|
56
|
+
element: m.current,
|
|
57
|
+
focus: A
|
|
58
|
+
}),
|
|
59
|
+
[A]
|
|
60
|
+
);
|
|
61
|
+
e.useImperativeHandle(V, v);
|
|
62
|
+
const N = !P || s === c - 1 || s === c || s === c + 1, M = F === "labels" || !!i && !!r, U = se(), W = ((l) => U.toLanguageString(l, ie[l]))(re), $ = typeof k == "number" ? k : k !== !1 ? ce : le, j = e.useCallback(
|
|
63
|
+
(l) => {
|
|
64
|
+
f && !n && L(
|
|
65
|
+
f,
|
|
66
|
+
l,
|
|
67
|
+
v(),
|
|
68
|
+
{ value: s }
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
[f, c, n]
|
|
72
|
+
), K = e.useCallback(
|
|
73
|
+
(l) => {
|
|
74
|
+
I && !n && L(
|
|
75
|
+
I,
|
|
76
|
+
l,
|
|
77
|
+
v(),
|
|
78
|
+
void 0
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
[I, n]
|
|
82
|
+
), q = e.useMemo(
|
|
83
|
+
() => te(
|
|
84
|
+
"k-step",
|
|
85
|
+
{
|
|
86
|
+
"k-step-first": s === 0,
|
|
87
|
+
"k-step-last": o && s === o - 1,
|
|
88
|
+
"k-step-done": s < c,
|
|
89
|
+
"k-step-current": p,
|
|
90
|
+
"k-step-optional": u,
|
|
91
|
+
"k-step-error": t !== void 0 && !t,
|
|
92
|
+
"k-step-success": t
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"k-disabled": n,
|
|
96
|
+
"k-focus": d
|
|
97
|
+
},
|
|
98
|
+
E
|
|
99
|
+
),
|
|
100
|
+
[s, o, c, p, u, n, d, t, E]
|
|
101
|
+
), J = e.useMemo(
|
|
102
|
+
() => ({
|
|
103
|
+
maxWidth: b ? void 0 : `calc(100% / ${o})`,
|
|
104
|
+
maxHeight: b ? `calc(100% / ${o})` : void 0,
|
|
105
|
+
pointerEvents: N ? void 0 : "none",
|
|
106
|
+
...C
|
|
107
|
+
}),
|
|
108
|
+
[b, o, C, N]
|
|
109
|
+
), T = t ? _ : w, x = T ? /* @__PURE__ */ e.createElement(
|
|
110
|
+
"span",
|
|
111
|
+
{
|
|
112
|
+
className: "k-step-indicator-icon " + T,
|
|
113
|
+
"aria-hidden": "true"
|
|
114
|
+
}
|
|
115
|
+
) : /* @__PURE__ */ e.createElement(
|
|
116
|
+
O,
|
|
117
|
+
{
|
|
118
|
+
className: "k-step-indicator-icon",
|
|
119
|
+
name: t ? "check-circle" : "exclamation-circle",
|
|
120
|
+
icon: t ? B || ne : G || oe
|
|
121
|
+
}
|
|
122
|
+
), Q = /* @__PURE__ */ e.createElement(e.Fragment, null, F !== "labels" ? /* @__PURE__ */ e.createElement(
|
|
123
|
+
"span",
|
|
124
|
+
{
|
|
125
|
+
className: "k-step-indicator",
|
|
126
|
+
"aria-hidden": !0,
|
|
127
|
+
style: { transitionDuration: $ + "ms" }
|
|
128
|
+
},
|
|
129
|
+
i || h ? !M && t !== void 0 ? x : /* @__PURE__ */ e.createElement(O, { className: "k-step-indicator-icon", name: i && ae(i), icon: h }) : t !== void 0 ? x : /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-text" }, S || s + 1)
|
|
130
|
+
) : null), X = /* @__PURE__ */ e.createElement("span", { className: "k-step-label" }, r && /* @__PURE__ */ e.createElement("span", { className: "k-step-text" }, r), M && t !== void 0 && x, u && /* @__PURE__ */ e.createElement("span", { className: "k-step-label-optional" }, W)), Y = /* @__PURE__ */ e.createElement(e.Fragment, null, Q, X);
|
|
131
|
+
return /* @__PURE__ */ e.createElement(
|
|
132
|
+
"li",
|
|
133
|
+
{
|
|
134
|
+
ref: m,
|
|
135
|
+
className: q,
|
|
136
|
+
style: J,
|
|
137
|
+
...D
|
|
138
|
+
},
|
|
139
|
+
/* @__PURE__ */ e.createElement(
|
|
140
|
+
"a",
|
|
141
|
+
{
|
|
142
|
+
className: "k-step-link",
|
|
143
|
+
title: r || void 0,
|
|
144
|
+
onClick: j,
|
|
145
|
+
onFocus: K,
|
|
146
|
+
tabIndex: y || (d ? 0 : -1),
|
|
147
|
+
"aria-current": p,
|
|
148
|
+
"aria-disabled": n || !N || void 0,
|
|
149
|
+
"aria-invalid": t !== void 0 && !t || void 0
|
|
150
|
+
},
|
|
151
|
+
H ? z : Y
|
|
152
|
+
)
|
|
153
|
+
);
|
|
154
|
+
});
|
|
155
|
+
g.propTypes = {
|
|
156
|
+
children: a.any,
|
|
157
|
+
className: a.string,
|
|
158
|
+
// content: PropTypes.any,
|
|
159
|
+
current: a.bool,
|
|
160
|
+
disabled: a.bool,
|
|
161
|
+
icon: a.string,
|
|
162
|
+
index: a.number,
|
|
163
|
+
isValid: a.bool,
|
|
164
|
+
label: a.string,
|
|
165
|
+
optional: a.bool,
|
|
166
|
+
style: a.object,
|
|
167
|
+
tabIndex: a.number,
|
|
168
|
+
text: a.string
|
|
169
|
+
};
|
|
170
|
+
const me = {
|
|
171
|
+
tabIndex: 0
|
|
172
|
+
};
|
|
173
|
+
g.defaultProps = me;
|
|
174
|
+
g.displayName = "KendoStep";
|
|
175
|
+
export {
|
|
176
|
+
g as Step
|
|
177
|
+
};
|
|
@@ -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 Z=require("react"),r=require("prop-types"),$=require("./context/StepperContext.js"),o=require("@progress/kendo-react-common"),ee=require("./Step.js"),te=require("@progress/kendo-react-progressbars"),K=require("./contants.js"),se=require("../package-metadata.js"),ae=require("@progress/kendo-react-intl"),N=require("./messages/index.js");function ne(l){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const u in l)if(u!=="default"){const v=Object.getOwnPropertyDescriptor(l,u);Object.defineProperty(b,u,v.get?v:{enumerable:!0,get:()=>l[u]})}}return b.default=l,Object.freeze(b)}const a=ne(Z),I=a.forwardRef((l,b)=>{o.validatePackage(se.packageMetadata);const{animationDuration:u,children:v,className:O,disabled:f,errorIcon:A,errorSVGIcon:F,item:w,items:m,linear:g,mode:L,orientation:S,style:P,successIcon:V,successSVGIcon:j,onChange:h,onFocus:E}=l,z=ae.useLocalization().toLanguageString(N.progBarAriaLabel,N.messages[N.progBarAriaLabel]),k=a.useRef(null),T=a.useCallback(()=>{k.current&&o.focusFirstFocusableChild(k.current)},[]),R=a.useCallback(()=>({element:k.current,focus:T}),[T]);a.useImperativeHandle(b,R);const i=l.value||M.value,[y,c]=a.useState(i),p=m?m.length:0,n=S==="vertical",D=o.useRtl(k,l.dir),_=typeof u=="number"?u:u!==!1?K.DEFAULT_ANIMATION_DURATION:K.NO_ANIMATION;a.useEffect(()=>{c(i)},[i]);const C=a.useCallback((t,s)=>{const e=s===i-1,d=s===i,Y=s===i+1;i!==s&&h&&!f&&(!g||e||d||Y)&&(o.dispatchEvent(h,t,R(),{value:s}),c(s))},[i,g,h,f,c]),G=a.useCallback(t=>{let s=t.value,e=t.syntheticEvent;C(e,s)},[C]),B=a.useCallback(t=>{E&&!f&&o.dispatchEvent(E,t.syntheticEvent,R(),void 0)},[E,f]),q=a.useCallback(t=>{C(t,y)},[C,y]),H=a.useCallback(t=>{const s=D==="rtl",e=y,d=m.length-1;switch(t.keyCode){case o.Keys.left:t.preventDefault(),!s&&e>0&&c(e-1),s&&e<d&&c(e+1);break;case o.Keys.right:t.preventDefault(),!s&&e<d&&c(e+1),s&&e>0&&c(e-1);break;case o.Keys.up:t.preventDefault(),!s&&e>0&&c(e-1),s&&e>0&&c(e-1);break;case o.Keys.down:t.preventDefault(),!s&&e<d&&c(e+1),s&&e<d&&c(e+1);break;case o.Keys.home:t.preventDefault(),c(0);break;case o.Keys.end:t.preventDefault(),c(d);break;case o.Keys.space:t.preventDefault();break;case o.Keys.enter:t.preventDefault(),m[e].disabled||q(t);break}},[m,c,y,D,q]),U=a.useMemo(()=>o.classNames("k-stepper",{"k-stepper-linear":g},O),[g,O]),J=a.useMemo(()=>({display:"grid",gridTemplateColumns:n?void 0:"repeat("+p*2+", 1fr)",gridTemplateRows:n?"repeat("+p+", 1fr)":void 0,...P}),[n,p,P]),Q=a.useMemo(()=>o.classNames("k-step-list",{"k-step-list-horizontal":!n,"k-step-list-vertical":n}),[n]),W=a.useMemo(()=>({gridColumnStart:n?void 0:1,gridColumnEnd:n?void 0:-1,gridRowStart:n?1:void 0,gridRowEnd:n?-1:void 0}),[n]),X=a.useMemo(()=>({gridColumnStart:n?void 0:2,gridColumnEnd:n?void 0:p*2,gridRowStart:n?1:void 0,gridRowEnd:n?p:void 0,top:n?17:void 0}),[n,p]),x=m&&m.map((t,s)=>{const e={index:s,disabled:f||t.disabled,focused:s===y,current:s===i,...t},d=w||ee.Step;return a.createElement(d,{key:s,...e})});return a.createElement($.StepperContext.Provider,{value:{animationDuration:u,isVertical:n,item:w,linear:g,mode:L,numOfSteps:p,value:i,successIcon:V,successSVGIcon:j,errorIcon:A,errorSVGIcon:F,onChange:G,onFocus:B}},a.createElement("nav",{className:U,style:J,dir:D,onKeyDown:H},a.createElement("ol",{className:Q,style:W},x||v),a.createElement(te.ProgressBar,{style:X,animation:{duration:_},ariaLabel:z,"aria-hidden":!0,max:p-1,labelVisible:!1,orientation:S,reverse:S==="vertical",value:i,disabled:f,tabIndex:-1})))});I.propTypes={animationDuration:r.oneOfType([r.bool,r.number]),children:r.any,className:r.string,dir:r.string,disabled:r.bool,errorIcon:r.string,errorSVGIcon:o.svgIconPropType,item:r.any,items:r.any,linear:r.bool,mode:r.oneOf(["steps","labels"]),orientation:r.oneOf(["horizontal","vertical"]),style:r.object,successIcon:r.string,successSVGIcon:o.svgIconPropType,value:r.number.isRequired,onChange:r.func,onFocus:r.func};const M={value:0};I.defaultProps=M;I.displayName="KendoStepper";exports.Stepper=I;
|
|
@@ -0,0 +1,252 @@
|
|
|
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 r from "prop-types";
|
|
11
|
+
import { StepperContext as ee } from "./context/StepperContext.mjs";
|
|
12
|
+
import { validatePackage as te, focusFirstFocusableChild as se, useRtl as oe, dispatchEvent as A, Keys as u, classNames as F, svgIconPropType as M } from "@progress/kendo-react-common";
|
|
13
|
+
import { Step as ae } from "./Step.mjs";
|
|
14
|
+
import { ProgressBar as re } from "@progress/kendo-react-progressbars";
|
|
15
|
+
import { DEFAULT_ANIMATION_DURATION as ne, NO_ANIMATION as ie } from "./contants.mjs";
|
|
16
|
+
import { packageMetadata as le } from "../package-metadata.mjs";
|
|
17
|
+
import { useLocalization as ce } from "@progress/kendo-react-intl";
|
|
18
|
+
import { progBarAriaLabel as O, messages as ue } from "./messages/index.mjs";
|
|
19
|
+
const E = o.forwardRef((k, V) => {
|
|
20
|
+
te(le);
|
|
21
|
+
const {
|
|
22
|
+
animationDuration: b,
|
|
23
|
+
children: L,
|
|
24
|
+
className: D,
|
|
25
|
+
disabled: p,
|
|
26
|
+
errorIcon: z,
|
|
27
|
+
errorSVGIcon: G,
|
|
28
|
+
item: N,
|
|
29
|
+
items: d,
|
|
30
|
+
linear: m,
|
|
31
|
+
mode: K,
|
|
32
|
+
orientation: y,
|
|
33
|
+
style: R,
|
|
34
|
+
successIcon: _,
|
|
35
|
+
successSVGIcon: B,
|
|
36
|
+
onChange: h,
|
|
37
|
+
onFocus: C
|
|
38
|
+
} = k, H = ce().toLanguageString(O, ue[O]), g = o.useRef(null), w = o.useCallback(
|
|
39
|
+
() => {
|
|
40
|
+
g.current && se(g.current);
|
|
41
|
+
},
|
|
42
|
+
[]
|
|
43
|
+
), I = o.useCallback(
|
|
44
|
+
() => ({
|
|
45
|
+
element: g.current,
|
|
46
|
+
focus: w
|
|
47
|
+
}),
|
|
48
|
+
[w]
|
|
49
|
+
);
|
|
50
|
+
o.useImperativeHandle(V, I);
|
|
51
|
+
const i = k.value || P.value, [f, n] = o.useState(i), c = d ? d.length : 0, a = y === "vertical", S = oe(g, k.dir), U = typeof b == "number" ? b : b !== !1 ? ne : ie;
|
|
52
|
+
o.useEffect(() => {
|
|
53
|
+
n(i);
|
|
54
|
+
}, [i]);
|
|
55
|
+
const v = o.useCallback(
|
|
56
|
+
(t, s) => {
|
|
57
|
+
const e = s === i - 1, l = s === i, $ = s === i + 1;
|
|
58
|
+
i !== s && h && !p && (!m || e || l || $) && (A(
|
|
59
|
+
h,
|
|
60
|
+
t,
|
|
61
|
+
I(),
|
|
62
|
+
{ value: s }
|
|
63
|
+
), n(s));
|
|
64
|
+
},
|
|
65
|
+
[i, m, h, p, n]
|
|
66
|
+
), j = o.useCallback(
|
|
67
|
+
(t) => {
|
|
68
|
+
let s = t.value, e = t.syntheticEvent;
|
|
69
|
+
v(e, s);
|
|
70
|
+
},
|
|
71
|
+
[v]
|
|
72
|
+
), q = o.useCallback(
|
|
73
|
+
(t) => {
|
|
74
|
+
C && !p && A(
|
|
75
|
+
C,
|
|
76
|
+
t.syntheticEvent,
|
|
77
|
+
I(),
|
|
78
|
+
void 0
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
[C, p]
|
|
82
|
+
), x = o.useCallback(
|
|
83
|
+
(t) => {
|
|
84
|
+
v(t, f);
|
|
85
|
+
},
|
|
86
|
+
[v, f]
|
|
87
|
+
), J = o.useCallback(
|
|
88
|
+
(t) => {
|
|
89
|
+
const s = S === "rtl", e = f, l = d.length - 1;
|
|
90
|
+
switch (t.keyCode) {
|
|
91
|
+
case u.left:
|
|
92
|
+
t.preventDefault(), !s && e > 0 && n(e - 1), s && e < l && n(e + 1);
|
|
93
|
+
break;
|
|
94
|
+
case u.right:
|
|
95
|
+
t.preventDefault(), !s && e < l && n(e + 1), s && e > 0 && n(e - 1);
|
|
96
|
+
break;
|
|
97
|
+
case u.up:
|
|
98
|
+
t.preventDefault(), !s && e > 0 && n(e - 1), s && e > 0 && n(e - 1);
|
|
99
|
+
break;
|
|
100
|
+
case u.down:
|
|
101
|
+
t.preventDefault(), !s && e < l && n(e + 1), s && e < l && n(e + 1);
|
|
102
|
+
break;
|
|
103
|
+
case u.home:
|
|
104
|
+
t.preventDefault(), n(0);
|
|
105
|
+
break;
|
|
106
|
+
case u.end:
|
|
107
|
+
t.preventDefault(), n(l);
|
|
108
|
+
break;
|
|
109
|
+
case u.space:
|
|
110
|
+
t.preventDefault();
|
|
111
|
+
break;
|
|
112
|
+
case u.enter:
|
|
113
|
+
t.preventDefault(), d[e].disabled || x(t);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
[d, n, f, S, x]
|
|
118
|
+
), Q = o.useMemo(
|
|
119
|
+
() => F(
|
|
120
|
+
"k-stepper",
|
|
121
|
+
{
|
|
122
|
+
"k-stepper-linear": m
|
|
123
|
+
},
|
|
124
|
+
D
|
|
125
|
+
),
|
|
126
|
+
[m, D]
|
|
127
|
+
), W = o.useMemo(
|
|
128
|
+
() => ({
|
|
129
|
+
display: "grid",
|
|
130
|
+
gridTemplateColumns: a ? void 0 : "repeat(" + c * 2 + ", 1fr)",
|
|
131
|
+
gridTemplateRows: a ? "repeat(" + c + ", 1fr)" : void 0,
|
|
132
|
+
...R
|
|
133
|
+
}),
|
|
134
|
+
[a, c, R]
|
|
135
|
+
), X = o.useMemo(
|
|
136
|
+
() => F(
|
|
137
|
+
"k-step-list",
|
|
138
|
+
{
|
|
139
|
+
"k-step-list-horizontal": !a,
|
|
140
|
+
"k-step-list-vertical": a
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
[a]
|
|
144
|
+
), Y = o.useMemo(
|
|
145
|
+
() => ({
|
|
146
|
+
gridColumnStart: a ? void 0 : 1,
|
|
147
|
+
gridColumnEnd: a ? void 0 : -1,
|
|
148
|
+
gridRowStart: a ? 1 : void 0,
|
|
149
|
+
gridRowEnd: a ? -1 : void 0
|
|
150
|
+
}),
|
|
151
|
+
[a]
|
|
152
|
+
), Z = o.useMemo(
|
|
153
|
+
() => ({
|
|
154
|
+
gridColumnStart: a ? void 0 : 2,
|
|
155
|
+
gridColumnEnd: a ? void 0 : c * 2,
|
|
156
|
+
gridRowStart: a ? 1 : void 0,
|
|
157
|
+
gridRowEnd: a ? c : void 0,
|
|
158
|
+
top: a ? 17 : void 0
|
|
159
|
+
}),
|
|
160
|
+
[a, c]
|
|
161
|
+
), T = d && d.map((t, s) => {
|
|
162
|
+
const e = {
|
|
163
|
+
index: s,
|
|
164
|
+
disabled: p || t.disabled,
|
|
165
|
+
focused: s === f,
|
|
166
|
+
current: s === i,
|
|
167
|
+
...t
|
|
168
|
+
}, l = N || ae;
|
|
169
|
+
return /* @__PURE__ */ o.createElement(l, { key: s, ...e });
|
|
170
|
+
});
|
|
171
|
+
return /* @__PURE__ */ o.createElement(
|
|
172
|
+
ee.Provider,
|
|
173
|
+
{
|
|
174
|
+
value: {
|
|
175
|
+
animationDuration: b,
|
|
176
|
+
isVertical: a,
|
|
177
|
+
item: N,
|
|
178
|
+
linear: m,
|
|
179
|
+
mode: K,
|
|
180
|
+
numOfSteps: c,
|
|
181
|
+
value: i,
|
|
182
|
+
successIcon: _,
|
|
183
|
+
successSVGIcon: B,
|
|
184
|
+
errorIcon: z,
|
|
185
|
+
errorSVGIcon: G,
|
|
186
|
+
onChange: j,
|
|
187
|
+
onFocus: q
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
/* @__PURE__ */ o.createElement(
|
|
191
|
+
"nav",
|
|
192
|
+
{
|
|
193
|
+
className: Q,
|
|
194
|
+
style: W,
|
|
195
|
+
dir: S,
|
|
196
|
+
onKeyDown: J
|
|
197
|
+
},
|
|
198
|
+
/* @__PURE__ */ o.createElement(
|
|
199
|
+
"ol",
|
|
200
|
+
{
|
|
201
|
+
className: X,
|
|
202
|
+
style: Y
|
|
203
|
+
},
|
|
204
|
+
T || L
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ o.createElement(
|
|
207
|
+
re,
|
|
208
|
+
{
|
|
209
|
+
style: Z,
|
|
210
|
+
animation: { duration: U },
|
|
211
|
+
ariaLabel: H,
|
|
212
|
+
"aria-hidden": !0,
|
|
213
|
+
max: c - 1,
|
|
214
|
+
labelVisible: !1,
|
|
215
|
+
orientation: y,
|
|
216
|
+
reverse: y === "vertical",
|
|
217
|
+
value: i,
|
|
218
|
+
disabled: p,
|
|
219
|
+
tabIndex: -1
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
)
|
|
223
|
+
);
|
|
224
|
+
});
|
|
225
|
+
E.propTypes = {
|
|
226
|
+
animationDuration: r.oneOfType([r.bool, r.number]),
|
|
227
|
+
children: r.any,
|
|
228
|
+
className: r.string,
|
|
229
|
+
dir: r.string,
|
|
230
|
+
disabled: r.bool,
|
|
231
|
+
errorIcon: r.string,
|
|
232
|
+
errorSVGIcon: M,
|
|
233
|
+
item: r.any,
|
|
234
|
+
items: r.any,
|
|
235
|
+
linear: r.bool,
|
|
236
|
+
mode: r.oneOf(["steps", "labels"]),
|
|
237
|
+
orientation: r.oneOf(["horizontal", "vertical"]),
|
|
238
|
+
style: r.object,
|
|
239
|
+
successIcon: r.string,
|
|
240
|
+
successSVGIcon: M,
|
|
241
|
+
value: r.number.isRequired,
|
|
242
|
+
onChange: r.func,
|
|
243
|
+
onFocus: r.func
|
|
244
|
+
};
|
|
245
|
+
const P = {
|
|
246
|
+
value: 0
|
|
247
|
+
};
|
|
248
|
+
E.defaultProps = P;
|
|
249
|
+
E.displayName = "KendoStepper";
|
|
250
|
+
export {
|
|
251
|
+
E as Stepper
|
|
252
|
+
};
|
|
@@ -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 A=400,N=0;exports.DEFAULT_ANIMATION_DURATION=A;exports.NO_ANIMATION=N;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
const A = 400, N = 0;
|
|
10
|
+
export {
|
|
11
|
+
A as DEFAULT_ANIMATION_DURATION,
|
|
12
|
+
N as NO_ANIMATION
|
|
13
|
+
};
|
|
@@ -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");function c(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const a=c(r),l={linear:!1,mode:"steps",value:0},u=a.createContext(l);exports.StepperContext=u;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 e from "react";
|
|
10
|
+
const t = {
|
|
11
|
+
linear: !1,
|
|
12
|
+
mode: "steps",
|
|
13
|
+
value: 0
|
|
14
|
+
}, o = e.createContext(t);
|
|
15
|
+
export {
|
|
16
|
+
o as StepperContext
|
|
17
|
+
};
|
|
@@ -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 e="stepper.optionalText",t="stepper.progBarAriaLabel",a={[e]:"(Optional)",[t]:"progressbar"};exports.messages=a;exports.optionalText=e;exports.progBarAriaLabel=t;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
const e = "stepper.optionalText", o = "stepper.progBarAriaLabel", r = {
|
|
10
|
+
[e]: "(Optional)",
|
|
11
|
+
[o]: "progressbar"
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
r as messages,
|
|
15
|
+
e as optionalText,
|
|
16
|
+
o as progBarAriaLabel
|
|
17
|
+
};
|
|
@@ -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 u=require("react"),o=require("prop-types"),p=require("./TabStripNavigation.js"),y=require("./TabStripContent.js"),i=require("@progress/kendo-react-common"),b=require("../package-metadata.js");function f(c){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:()=>c[e]})}}return n.default=c,Object.freeze(n)}const a=f(u),h=class h extends a.Component{constructor(n){super(n),this._element=null,this.showLicenseWatermark=!1,this.keyBinding={[i.Keys.left]:()=>this.prevNavigatableTab(),[i.Keys.right]:()=>this.nextNavigatableTab(),[i.Keys.down]:()=>this.nextNavigatableTab(),[i.Keys.up]:()=>this.prevNavigatableTab(),[i.Keys.home]:()=>0,[i.Keys.end]:()=>a.Children.count(this.props.children)-1},this.onSelect=e=>{this.props.selected!==e&&this.props.onSelect&&this.props.onSelect({selected:e})},this.onKeyDown=e=>{let t;switch(e.keyCode){case i.Keys.left:t=this.keyBinding[this.invertKeys(i.Keys.left,i.Keys.right)];break;case i.Keys.right:t=this.keyBinding[this.invertKeys(i.Keys.right,i.Keys.left)];break;case i.Keys.up:t=this.keyBinding[i.Keys.up];break;case i.Keys.down:t=this.keyBinding[i.Keys.down];break;case i.Keys.home:t=this.keyBinding[i.Keys.home];break;case i.Keys.end:t=this.keyBinding[i.Keys.end];break}t&&(e.preventDefault(),this.onSelect(t()))},this.renderContent=e=>{const{selected:t,children:s,tabContentStyle:r}=e,l=a.Children.count(s);return t<l&&t>-1?a.createElement(y.TabStripContent,{index:t,...e,style:r}):null},this.firstNavigatableTab=()=>{const e=this.children(),t=a.Children.count(e);if(e){for(let s=0;s<t;s++)if(!e[s].props.disabled)return s}},this.lastNavigatableTab=()=>{const e=this.children(),t=a.Children.count(e);if(e){for(let s=t-1;s>0;s--)if(!e[s].props.disabled)return s}},this.prevNavigatableTab=()=>{const e=this.children(),{selected:t}=this.props,s=t?t-1:-1;if(s<0)return this.lastNavigatableTab();if(e)for(let r=s;r>-1;r--){if(!e[r].props.disabled)return r;if(r===0)return this.lastNavigatableTab()}},this.nextNavigatableTab=()=>{const e=this.children(),{selected:t}=this.props,s=t?t+1:1,r=a.Children.count(e);if(s>=r)return this.firstNavigatableTab();if(e)for(let l=s;l<r;l++){if(!e[l].props.disabled)return l;if(l+1===r)return this.firstNavigatableTab()}},i.validatePackage(b.packageMetadata),this.showLicenseWatermark=i.shouldShowValidationUI(b.packageMetadata)}get contentPanelId(){return this.props.id+"-content-panel-id"}get navItemId(){return this.props.id+"-nav-item-id"}render(){const n={...this.props,children:this.children(),contentPanelId:this.contentPanelId,navItemId:this.navItemId,onKeyDown:this.onKeyDown,onSelect:this.onSelect},{tabPosition:e,tabIndex:t=0}=n,s=e==="bottom",r=i.classNames("k-tabstrip k-pos-relative",{"k-tabstrip-left":e==="left","k-tabstrip-right":e==="right","k-tabstrip-bottom":e==="bottom","k-tabstrip-top":e==="top","k-tabstrip-scrollable":this.props.scrollable},this.props.className);return a.createElement("div",{id:this.props.id,ref:l=>this._element=l,dir:this.props.dir,className:r,style:this.props.style},!s&&a.createElement(p.TabStripNavigation,{...n,tabIndex:t}),this.renderContent(n),s&&a.createElement(p.TabStripNavigation,{...n,tabIndex:t}),this.showLicenseWatermark&&a.createElement(i.WatermarkOverlay,null))}invertKeys(n,e){return this._element&&getComputedStyle(this._element).direction==="rtl"||!1?e:n}children(){return a.Children.toArray(this.props.children).filter(n=>n)}};h.propTypes={animation:o.bool,children:o.node,onSelect:o.func,selected:o.number,style:o.object,tabContentStyle:o.object,tabPosition:o.string,tabIndex:o.number,className:o.string,dir:o.string},h.defaultProps={animation:!0,tabPosition:"top",keepTabsMounted:!1,buttonScrollSpeed:100,mouseScrollSpeed:10};let d=h;exports.TabStrip=d;
|