@progress/kendo-react-layout 14.5.0-develop.9 → 15.0.0-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MenuMcpWrapper.d.ts +17 -0
- package/MenuMcpWrapper.js +8 -0
- package/MenuMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +18 -19
- package/actionsheet/ActionSheetItem.js +1 -1
- package/actionsheet/ActionSheetItem.mjs +1 -3
- package/bottomnavigation/BottomNavigation.js +1 -1
- package/bottomnavigation/BottomNavigation.mjs +85 -69
- package/bottomnavigation/BottomNavigationItem.js +1 -1
- package/bottomnavigation/BottomNavigationItem.mjs +34 -33
- package/bottomnavigation/messages/index.d.ts +17 -0
- package/bottomnavigation/messages/index.js +8 -0
- package/bottomnavigation/messages/index.mjs +14 -0
- package/breadcrumb/Breadcrumb.js +1 -1
- package/breadcrumb/Breadcrumb.mjs +30 -28
- package/breadcrumb/BreadcrumbLink.js +1 -1
- package/breadcrumb/BreadcrumbLink.mjs +26 -26
- package/breadcrumb/messages/index.d.ts +17 -0
- package/breadcrumb/messages/index.js +8 -0
- package/breadcrumb/messages/index.mjs +14 -0
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/drawer/Drawer.mjs +63 -63
- package/drawer/DrawerItem.js +1 -1
- package/drawer/DrawerItem.mjs +22 -23
- package/drawer/interfaces/DrawerProps.d.ts +8 -0
- package/expansionpanel/ExpansionPanel.js +1 -1
- package/expansionpanel/ExpansionPanel.mjs +50 -50
- package/expansionpanel/ExpansionPanelContent.js +1 -1
- package/expansionpanel/ExpansionPanelContent.mjs +7 -4
- package/index.d.mts +1 -2
- package/index.d.ts +1 -2
- package/index.js +1 -1
- package/index.mjs +128 -130
- package/menu/MenuProps.d.ts +6 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +94 -91
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +13 -15
- package/panelbar/interfaces/PanelBarProps.d.ts +8 -0
- package/panelbar/interfaces/RenderPanelBarItem.d.ts +1 -0
- package/panelbar/util.d.ts +1 -1
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +62 -59
- package/splitter/SplitterBar.d.ts +1 -0
- package/splitter/SplitterBar.js +1 -1
- package/splitter/SplitterBar.mjs +64 -56
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +79 -85
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +134 -133
- package/stepper/interfaces/StepperProps.d.ts +8 -1
- package/stepper/messages/index.d.ts +12 -2
- package/stepper/messages/index.js +1 -1
- package/stepper/messages/index.mjs +8 -4
- package/tabstrip/TabStrip.d.ts +8 -1
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +126 -125
- package/tilelayout/InternalTile.js +1 -1
- package/tilelayout/InternalTile.mjs +119 -115
- package/tilelayout/TileLayout.js +1 -1
- package/tilelayout/TileLayout.mjs +58 -58
- package/timeline/TimelineCard.d.ts +2 -0
- package/timeline/TimelineCard.js +1 -1
- package/timeline/TimelineCard.mjs +16 -15
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +105 -101
package/stepper/Step.mjs
CHANGED
|
@@ -7,127 +7,121 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import a from "prop-types";
|
|
10
|
-
import { StepperContext as
|
|
11
|
-
import { focusFirstFocusableChild as
|
|
12
|
-
import { useLocalization as
|
|
13
|
-
import { checkIcon as
|
|
14
|
-
import { DEFAULT_ANIMATION_DURATION as
|
|
15
|
-
import { messages as
|
|
16
|
-
const
|
|
10
|
+
import { StepperContext as te } from "./context/StepperContext.mjs";
|
|
11
|
+
import { focusFirstFocusableChild as ae, dispatchEvent as O, classNames as se, IconWrap as R, toIconName as oe } from "@progress/kendo-react-common";
|
|
12
|
+
import { useLocalization as ne } from "@progress/kendo-react-intl";
|
|
13
|
+
import { checkIcon as le, exclamationCircleIcon as ce } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { DEFAULT_ANIMATION_DURATION as ie, NO_ANIMATION as re } from "./contants.mjs";
|
|
15
|
+
import { messages as me, optionalText as pe, stepAriaLabel as de } from "./messages/index.mjs";
|
|
16
|
+
const V = e.forwardRef((D, $) => {
|
|
17
17
|
const {
|
|
18
18
|
// content
|
|
19
|
-
children:
|
|
20
|
-
className:
|
|
21
|
-
current:
|
|
19
|
+
children: z,
|
|
20
|
+
className: h,
|
|
21
|
+
current: b,
|
|
22
22
|
disabled: o,
|
|
23
|
-
focused:
|
|
24
|
-
icon:
|
|
25
|
-
svgIcon:
|
|
23
|
+
focused: y,
|
|
24
|
+
icon: l,
|
|
25
|
+
svgIcon: k,
|
|
26
26
|
index: s,
|
|
27
27
|
isValid: t,
|
|
28
28
|
label: n,
|
|
29
29
|
optional: m,
|
|
30
|
-
style:
|
|
31
|
-
tabIndex:
|
|
32
|
-
text:
|
|
33
|
-
...
|
|
34
|
-
} =
|
|
35
|
-
animationDuration:
|
|
36
|
-
isVertical:
|
|
37
|
-
item:
|
|
38
|
-
linear:
|
|
39
|
-
mode:
|
|
30
|
+
style: S,
|
|
31
|
+
tabIndex: be = ue.tabIndex,
|
|
32
|
+
text: p,
|
|
33
|
+
...H
|
|
34
|
+
} = D, {
|
|
35
|
+
animationDuration: f,
|
|
36
|
+
isVertical: v,
|
|
37
|
+
item: _,
|
|
38
|
+
linear: w,
|
|
39
|
+
mode: A,
|
|
40
40
|
numOfSteps: c,
|
|
41
|
-
value:
|
|
42
|
-
onChange:
|
|
43
|
-
onFocus:
|
|
44
|
-
successIcon:
|
|
45
|
-
errorIcon:
|
|
46
|
-
successSVGIcon:
|
|
47
|
-
errorSVGIcon:
|
|
48
|
-
} = e.useContext(
|
|
49
|
-
|
|
50
|
-
}, []),
|
|
41
|
+
value: i,
|
|
42
|
+
onChange: I,
|
|
43
|
+
onFocus: N,
|
|
44
|
+
successIcon: B,
|
|
45
|
+
errorIcon: G,
|
|
46
|
+
successSVGIcon: P,
|
|
47
|
+
errorSVGIcon: U
|
|
48
|
+
} = e.useContext(te), d = e.useRef(null), F = e.useCallback(() => {
|
|
49
|
+
d.current && ae(d.current);
|
|
50
|
+
}, []), x = e.useCallback(
|
|
51
51
|
() => ({
|
|
52
|
-
element:
|
|
52
|
+
element: d.current,
|
|
53
53
|
focus: F
|
|
54
54
|
}),
|
|
55
55
|
[F]
|
|
56
56
|
);
|
|
57
|
-
e.useImperativeHandle(
|
|
58
|
-
const
|
|
59
|
-
(
|
|
60
|
-
|
|
57
|
+
e.useImperativeHandle($, x);
|
|
58
|
+
const g = !w || s === i - 1 || s === i || s === i + 1, E = A === "labels" || !!l && !!n, W = ne(), L = (r) => W.toLanguageString(r, me[r]), j = L(pe), K = typeof f == "number" ? f : f !== !1 ? ie : re, q = e.useCallback(
|
|
59
|
+
(r) => {
|
|
60
|
+
I && !o && O(I, r, x(), { value: s });
|
|
61
61
|
},
|
|
62
|
-
[
|
|
63
|
-
),
|
|
64
|
-
(
|
|
65
|
-
|
|
62
|
+
[I, i, o]
|
|
63
|
+
), J = e.useCallback(
|
|
64
|
+
(r) => {
|
|
65
|
+
N && !o && O(N, r, x(), void 0);
|
|
66
66
|
},
|
|
67
|
-
[
|
|
68
|
-
),
|
|
69
|
-
() =>
|
|
67
|
+
[N, o]
|
|
68
|
+
), Q = e.useMemo(
|
|
69
|
+
() => se(
|
|
70
70
|
"k-step",
|
|
71
71
|
{
|
|
72
72
|
"k-step-first": s === 0,
|
|
73
73
|
"k-step-last": c && s === c - 1,
|
|
74
|
-
"k-step-done": s <
|
|
75
|
-
"k-step-current":
|
|
74
|
+
"k-step-done": s < i,
|
|
75
|
+
"k-step-current": b,
|
|
76
76
|
"k-step-optional": m,
|
|
77
77
|
"k-step-error": t !== void 0 && !t,
|
|
78
78
|
"k-step-success": t,
|
|
79
79
|
"k-disabled": o,
|
|
80
|
-
"k-focus":
|
|
80
|
+
"k-focus": y
|
|
81
81
|
},
|
|
82
|
-
|
|
82
|
+
h
|
|
83
83
|
),
|
|
84
|
-
[s, c,
|
|
85
|
-
),
|
|
84
|
+
[s, c, i, b, m, o, y, t, h]
|
|
85
|
+
), X = e.useMemo(
|
|
86
86
|
() => ({
|
|
87
|
-
maxWidth:
|
|
88
|
-
maxHeight:
|
|
89
|
-
pointerEvents:
|
|
90
|
-
...
|
|
87
|
+
maxWidth: v ? void 0 : `calc(100% / ${c})`,
|
|
88
|
+
maxHeight: v ? `calc(100% / ${c})` : void 0,
|
|
89
|
+
pointerEvents: g ? void 0 : "none",
|
|
90
|
+
...S
|
|
91
91
|
}),
|
|
92
|
-
[
|
|
93
|
-
),
|
|
94
|
-
|
|
92
|
+
[v, c, S, g]
|
|
93
|
+
), M = t ? B : G, C = M ? /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-icon " + M, "aria-hidden": "true" }) : /* @__PURE__ */ e.createElement(
|
|
94
|
+
R,
|
|
95
95
|
{
|
|
96
96
|
className: "k-step-indicator-icon",
|
|
97
97
|
name: t ? "check-circle" : "exclamation-circle",
|
|
98
|
-
icon: t ?
|
|
98
|
+
icon: t ? P || le : U || ce
|
|
99
99
|
}
|
|
100
|
-
),
|
|
101
|
-
|
|
100
|
+
), Y = /* @__PURE__ */ e.createElement(e.Fragment, null, A !== "labels" ? /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator", style: { transitionDuration: K + "ms" } }, l || k ? !E && t !== void 0 ? C : /* @__PURE__ */ e.createElement(
|
|
101
|
+
R,
|
|
102
102
|
{
|
|
103
|
-
className: "k-step-indicator",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
className: "k-step-indicator-icon",
|
|
111
|
-
name: r && te(r),
|
|
112
|
-
icon: h
|
|
113
|
-
}
|
|
114
|
-
) : t !== void 0 ? x : /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-text" }, y || s + 1)
|
|
115
|
-
) : null), Q = (n || N || m) && /* @__PURE__ */ e.createElement("span", { className: "k-step-label" }, n && /* @__PURE__ */ e.createElement("span", { className: "k-step-text" }, n), N && t !== void 0 && x, m && /* @__PURE__ */ e.createElement("span", { className: "k-step-label-optional" }, U)), X = /* @__PURE__ */ e.createElement(e.Fragment, null, J, Q);
|
|
116
|
-
return /* @__PURE__ */ e.createElement("li", { ref: p, className: K, style: q, ...z }, /* @__PURE__ */ e.createElement(
|
|
103
|
+
className: "k-step-indicator-icon",
|
|
104
|
+
name: l && oe(l),
|
|
105
|
+
icon: k
|
|
106
|
+
}
|
|
107
|
+
) : t !== void 0 ? C : /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-text" }, p || s + 1)) : null), Z = (n || E || m) && /* @__PURE__ */ e.createElement("span", { className: "k-step-label" }, n && /* @__PURE__ */ e.createElement("span", { className: "k-step-text" }, n), E && t !== void 0 && C, m && /* @__PURE__ */ e.createElement("span", { className: "k-step-label-optional" }, j)), ee = /* @__PURE__ */ e.createElement(e.Fragment, null, Y, Z), T = L(de);
|
|
108
|
+
let u = n;
|
|
109
|
+
return u || (p ? u = `${T} ${p}` : (l || k) && (u = T)), /* @__PURE__ */ e.createElement("li", { ref: d, className: Q, style: X, ...H }, /* @__PURE__ */ e.createElement(
|
|
117
110
|
"a",
|
|
118
111
|
{
|
|
119
112
|
className: "k-step-link",
|
|
120
113
|
title: n || void 0,
|
|
121
|
-
onClick:
|
|
122
|
-
onFocus:
|
|
123
|
-
"aria-current":
|
|
124
|
-
"aria-disabled": o || !
|
|
125
|
-
"aria-invalid": t !== void 0 && !t || void 0
|
|
114
|
+
onClick: q,
|
|
115
|
+
onFocus: J,
|
|
116
|
+
"aria-current": b ? "step" : void 0,
|
|
117
|
+
"aria-disabled": o || !g || void 0,
|
|
118
|
+
"aria-invalid": t !== void 0 && !t || void 0,
|
|
119
|
+
"aria-label": u
|
|
126
120
|
},
|
|
127
|
-
|
|
121
|
+
_ ? z : ee
|
|
128
122
|
));
|
|
129
123
|
});
|
|
130
|
-
|
|
124
|
+
V.propTypes = {
|
|
131
125
|
children: a.any,
|
|
132
126
|
className: a.string,
|
|
133
127
|
// content: PropTypes.any,
|
|
@@ -142,10 +136,10 @@ L.propTypes = {
|
|
|
142
136
|
tabIndex: a.number,
|
|
143
137
|
text: a.string
|
|
144
138
|
};
|
|
145
|
-
const
|
|
139
|
+
const ue = {
|
|
146
140
|
tabIndex: 0
|
|
147
141
|
};
|
|
148
|
-
|
|
142
|
+
V.displayName = "KendoStep";
|
|
149
143
|
export {
|
|
150
|
-
|
|
144
|
+
V as Step
|
|
151
145
|
};
|
package/stepper/Stepper.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("react"),o=require("prop-types"),re=require("./context/StepperContext.js"),p=require("@progress/kendo-react-common"),ae=require("./Step.js"),ie=require("@progress/kendo-react-progressbars"),z=require("./contants.js"),ce=require("@progress/kendo-react-intl"),k=require("./messages/index.js");function le(u){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const m in u)if(m!=="default"){const I=Object.getOwnPropertyDescriptor(u,m);Object.defineProperty(y,m,I.get?I:{enumerable:!0,get:()=>u[m]})}}return y.default=u,Object.freeze(y)}const e=le(oe),O=e.forwardRef((u,y)=>{const{animationDuration:m,children:I,className:T,disabled:g,errorIcon:_,errorSVGIcon:H,item:w,items:b,linear:E,mode:K,orientation:R,selectOnFocus:h,style:L,successIcon:G,successSVGIcon:B,value:c=0,onChange:N,onFocus:D}=u,M=ce.useLocalization(),U=M.toLanguageString(k.progressBarAriaLabel,k.messages[k.progressBarAriaLabel]),W=M.toLanguageString(k.ariaLabel,k.messages[k.ariaLabel]),v=e.useRef(null),P=e.useRef(null);p.useWebMcpRegister("stepper",P,u,u.webMcp);const q=e.useCallback(()=>{v.current&&p.focusFirstFocusableChild(v.current)},[]),S=e.useCallback(()=>({element:v.current,focus:q}),[q]);e.useImperativeHandle(y,S),e.useImperativeHandle(P,S);const[J,d]=e.useState(c),f=b?b.length:0,s=R==="vertical",x=p.useDir(v,u.dir),Q=typeof m=="number"?m:m!==!1?z.DEFAULT_ANIMATION_DURATION:z.NO_ANIMATION;e.useEffect(()=>{d(c)},[c]);const A=e.useCallback((i,r)=>{const t=r===c-1,n=r===c,a=r===c+1;c!==r&&N&&!g&&(!E||t||n||a)&&(p.dispatchEvent(N,i,S(),{value:r}),d(r))},[c,E,N,g,d]),X=e.useCallback(i=>{const r=i.value,t=i.syntheticEvent;A(t,r)},[A]),Y=e.useCallback(i=>{D&&!g&&p.dispatchEvent(D,i.syntheticEvent,S(),void 0)},[D,g]),C=e.useMemo(()=>{const i=x==="rtl",r=b.length-1;return new p.Navigation({root:v,selectors:["ol.k-step-list li.k-step a.k-step-link"],tabIndex:0,keyboardEvents:{keydown:{Tab:(t,n,a)=>{const l=n.elements.indexOf(t),V=n.previous(t).children[0],j=n.next(t).children[0];a.shiftKey?!i&&l>0?(a.preventDefault(),n.focusPrevious(t),d(l-1),h&&V.click()):i&&l<r&&(a.preventDefault(),n.focusNext(t),d(l+1),h&&j.click()):!i&&l<r?(a.preventDefault(),n.focusNext(t),d(l+1),h&&j.click()):i&&l>0&&(a.preventDefault(),n.focusPrevious(t),d(l-1),h&&V.click())},Home:(t,n,a)=>{a.preventDefault(),n.focusElement(n.first,t),d(0)},End:(t,n,a)=>{a.preventDefault(),n.focusElement(n.last,t),d(r)},Space:(t,n,a)=>{a.preventDefault(),t.children[0].click()},Enter:(t,n,a)=>{a.preventDefault(),t.children[0].click()}}}})},[x,b.length,d,h]);e.useEffect(()=>(C.initializeRovingTab(c),()=>C.removeFocusListener()),[]);const Z=e.useCallback(C.triggerKeyboardEvent.bind(C),[]),$=e.useMemo(()=>p.classNames("k-stepper",{"k-stepper-linear":E},T),[E,T]),ee=e.useMemo(()=>({display:"grid",gridTemplateColumns:s?void 0:"repeat("+f*2+", 1fr)",gridTemplateRows:s?"repeat("+f+", 1fr)":void 0,...L}),[s,f,L]),te=e.useMemo(()=>p.classNames("k-step-list",{"k-step-list-horizontal":!s,"k-step-list-vertical":s}),[s]),ne=e.useMemo(()=>({gridColumnStart:s?void 0:1,gridColumnEnd:s?void 0:-1,gridRowStart:s?1:void 0,gridRowEnd:s?-1:void 0}),[s]),se=e.useMemo(()=>({gridColumnStart:s?void 0:2,gridColumnEnd:s?void 0:f*2,gridRowStart:s?1:void 0,gridRowEnd:s?f:void 0,top:s?17:void 0}),[s,f]),F=b&&b.map((i,r)=>{const t={index:r,disabled:g||i.disabled,focused:r===J,current:r===c,...i},n=w||ae.Step;return e.createElement(n,{key:r,...t})});return e.createElement(re.StepperContext.Provider,{value:{animationDuration:m,isVertical:s,item:w,linear:E,mode:K,numOfSteps:f,value:c,successIcon:G,successSVGIcon:B,errorIcon:_,errorSVGIcon:H,onChange:X,onFocus:Y}},e.createElement("nav",{className:$,style:ee,dir:x,ref:v,onKeyDown:Z,"aria-label":W},e.createElement("ol",{className:te,style:ne},F||I),e.createElement(ie.ProgressBar,{style:se,labelPlacement:"start",animation:{duration:Q},ariaLabel:U,"aria-hidden":!0,labelVisible:!1,orientation:R,reverse:R==="vertical",value:f>1?Math.round(c/(f-1)*100):0,disabled:g,tabIndex:-1})))});O.propTypes={animationDuration:o.oneOfType([o.bool,o.number]),children:o.any,className:o.string,dir:o.string,disabled:o.bool,errorIcon:o.string,errorSVGIcon:p.svgIconPropType,item:o.any,items:o.any,linear:o.bool,mode:o.oneOf(["steps","labels"]),orientation:o.oneOf(["horizontal","vertical"]),style:o.object,successIcon:o.string,successSVGIcon:p.svgIconPropType,value:o.number.isRequired,onChange:o.func,onFocus:o.func};O.displayName="KendoStepper";exports.Stepper=O;
|
package/stepper/Stepper.mjs
CHANGED
|
@@ -6,194 +6,195 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import
|
|
10
|
-
import { StepperContext as
|
|
11
|
-
import { focusFirstFocusableChild as
|
|
12
|
-
import { Step as
|
|
13
|
-
import { ProgressBar as
|
|
14
|
-
import { DEFAULT_ANIMATION_DURATION as
|
|
15
|
-
import { useLocalization as
|
|
16
|
-
import {
|
|
17
|
-
const
|
|
9
|
+
import o from "prop-types";
|
|
10
|
+
import { StepperContext as le } from "./context/StepperContext.mjs";
|
|
11
|
+
import { useWebMcpRegister as ae, focusFirstFocusableChild as ce, useDir as ue, dispatchEvent as A, Navigation as de, classNames as P, svgIconPropType as V } from "@progress/kendo-react-common";
|
|
12
|
+
import { Step as me } from "./Step.mjs";
|
|
13
|
+
import { ProgressBar as pe } from "@progress/kendo-react-progressbars";
|
|
14
|
+
import { DEFAULT_ANIMATION_DURATION as fe, NO_ANIMATION as ge } from "./contants.mjs";
|
|
15
|
+
import { useLocalization as be } from "@progress/kendo-react-intl";
|
|
16
|
+
import { progressBarAriaLabel as z, messages as H, ariaLabel as K } from "./messages/index.mjs";
|
|
17
|
+
const G = e.forwardRef((v, _) => {
|
|
18
18
|
const {
|
|
19
|
-
animationDuration:
|
|
20
|
-
children:
|
|
21
|
-
className:
|
|
19
|
+
animationDuration: k,
|
|
20
|
+
children: B,
|
|
21
|
+
className: N,
|
|
22
22
|
disabled: m,
|
|
23
|
-
errorIcon:
|
|
24
|
-
errorSVGIcon:
|
|
25
|
-
item:
|
|
23
|
+
errorIcon: U,
|
|
24
|
+
errorSVGIcon: j,
|
|
25
|
+
item: R,
|
|
26
26
|
items: p,
|
|
27
27
|
linear: g,
|
|
28
|
-
mode:
|
|
29
|
-
orientation:
|
|
30
|
-
selectOnFocus:
|
|
31
|
-
style:
|
|
32
|
-
successIcon:
|
|
33
|
-
successSVGIcon:
|
|
28
|
+
mode: q,
|
|
29
|
+
orientation: y,
|
|
30
|
+
selectOnFocus: b,
|
|
31
|
+
style: x,
|
|
32
|
+
successIcon: W,
|
|
33
|
+
successSVGIcon: J,
|
|
34
34
|
value: a = 0,
|
|
35
|
-
onChange:
|
|
36
|
-
onFocus:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
onChange: I,
|
|
36
|
+
onFocus: C
|
|
37
|
+
} = v, D = be(), Q = D.toLanguageString(z, H[z]), X = D.toLanguageString(K, H[K]), f = e.useRef(null), w = e.useRef(null);
|
|
38
|
+
ae("stepper", w, v, v.webMcp);
|
|
39
|
+
const L = e.useCallback(() => {
|
|
40
|
+
f.current && ce(f.current);
|
|
41
|
+
}, []), E = e.useCallback(
|
|
40
42
|
() => ({
|
|
41
43
|
element: f.current,
|
|
42
|
-
focus:
|
|
44
|
+
focus: L
|
|
43
45
|
}),
|
|
44
|
-
[
|
|
46
|
+
[L]
|
|
45
47
|
);
|
|
46
|
-
e.useImperativeHandle(
|
|
47
|
-
const [
|
|
48
|
+
e.useImperativeHandle(_, E), e.useImperativeHandle(w, E);
|
|
49
|
+
const [Y, u] = e.useState(a), d = p ? p.length : 0, n = y === "vertical", S = ue(f, v.dir), Z = typeof k == "number" ? k : k !== !1 ? fe : ge;
|
|
48
50
|
e.useEffect(() => {
|
|
49
51
|
u(a);
|
|
50
52
|
}, [a]);
|
|
51
|
-
const
|
|
53
|
+
const T = e.useCallback(
|
|
52
54
|
(l, r) => {
|
|
53
|
-
const t = r === a - 1,
|
|
54
|
-
a !== r &&
|
|
55
|
+
const t = r === a - 1, s = r === a, i = r === a + 1;
|
|
56
|
+
a !== r && I && !m && (!g || t || s || i) && (A(I, l, E(), {
|
|
55
57
|
value: r
|
|
56
58
|
}), u(r));
|
|
57
59
|
},
|
|
58
|
-
[a, g,
|
|
59
|
-
),
|
|
60
|
+
[a, g, I, m, u]
|
|
61
|
+
), $ = e.useCallback(
|
|
60
62
|
(l) => {
|
|
61
63
|
const r = l.value, t = l.syntheticEvent;
|
|
62
|
-
|
|
64
|
+
T(t, r);
|
|
63
65
|
},
|
|
64
|
-
[
|
|
65
|
-
),
|
|
66
|
+
[T]
|
|
67
|
+
), ee = e.useCallback(
|
|
66
68
|
(l) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
C && !m && A(
|
|
70
|
+
C,
|
|
69
71
|
l.syntheticEvent,
|
|
70
|
-
|
|
72
|
+
E(),
|
|
71
73
|
void 0
|
|
72
74
|
);
|
|
73
75
|
},
|
|
74
|
-
[
|
|
75
|
-
),
|
|
76
|
-
const l =
|
|
77
|
-
return new
|
|
76
|
+
[C, m]
|
|
77
|
+
), h = e.useMemo(() => {
|
|
78
|
+
const l = S === "rtl", r = p.length - 1;
|
|
79
|
+
return new de({
|
|
78
80
|
root: f,
|
|
79
81
|
selectors: ["ol.k-step-list li.k-step a.k-step-link"],
|
|
80
82
|
tabIndex: 0,
|
|
81
83
|
keyboardEvents: {
|
|
82
84
|
keydown: {
|
|
83
|
-
Tab: (t,
|
|
84
|
-
const c =
|
|
85
|
-
i.shiftKey ? !l && c > 0 ? (i.preventDefault(),
|
|
85
|
+
Tab: (t, s, i) => {
|
|
86
|
+
const c = s.elements.indexOf(t), F = s.previous(t).children[0], O = s.next(t).children[0];
|
|
87
|
+
i.shiftKey ? !l && c > 0 ? (i.preventDefault(), s.focusPrevious(t), u(c - 1), b && F.click()) : l && c < r && (i.preventDefault(), s.focusNext(t), u(c + 1), b && O.click()) : !l && c < r ? (i.preventDefault(), s.focusNext(t), u(c + 1), b && O.click()) : l && c > 0 && (i.preventDefault(), s.focusPrevious(t), u(c - 1), b && F.click());
|
|
86
88
|
},
|
|
87
|
-
Home: (t,
|
|
88
|
-
i.preventDefault(),
|
|
89
|
+
Home: (t, s, i) => {
|
|
90
|
+
i.preventDefault(), s.focusElement(s.first, t), u(0);
|
|
89
91
|
},
|
|
90
|
-
End: (t,
|
|
91
|
-
i.preventDefault(),
|
|
92
|
+
End: (t, s, i) => {
|
|
93
|
+
i.preventDefault(), s.focusElement(s.last, t), u(r);
|
|
92
94
|
},
|
|
93
|
-
Space: (t,
|
|
95
|
+
Space: (t, s, i) => {
|
|
94
96
|
i.preventDefault(), t.children[0].click();
|
|
95
97
|
},
|
|
96
|
-
Enter: (t,
|
|
98
|
+
Enter: (t, s, i) => {
|
|
97
99
|
i.preventDefault(), t.children[0].click();
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
});
|
|
102
|
-
}, [
|
|
103
|
-
e.useEffect(() => (
|
|
104
|
-
const
|
|
105
|
-
() =>
|
|
104
|
+
}, [S, p.length, u, b]);
|
|
105
|
+
e.useEffect(() => (h.initializeRovingTab(a), () => h.removeFocusListener()), []);
|
|
106
|
+
const te = e.useCallback(h.triggerKeyboardEvent.bind(h), []), se = e.useMemo(
|
|
107
|
+
() => P(
|
|
106
108
|
"k-stepper",
|
|
107
109
|
{
|
|
108
110
|
"k-stepper-linear": g
|
|
109
111
|
},
|
|
110
|
-
|
|
112
|
+
N
|
|
111
113
|
),
|
|
112
|
-
[g,
|
|
113
|
-
),
|
|
114
|
+
[g, N]
|
|
115
|
+
), ne = e.useMemo(
|
|
114
116
|
() => ({
|
|
115
117
|
display: "grid",
|
|
116
|
-
gridTemplateColumns:
|
|
117
|
-
gridTemplateRows:
|
|
118
|
-
...
|
|
118
|
+
gridTemplateColumns: n ? void 0 : "repeat(" + d * 2 + ", 1fr)",
|
|
119
|
+
gridTemplateRows: n ? "repeat(" + d + ", 1fr)" : void 0,
|
|
120
|
+
...x
|
|
119
121
|
}),
|
|
120
|
-
[
|
|
121
|
-
),
|
|
122
|
-
() =>
|
|
123
|
-
"k-step-list-horizontal": !
|
|
124
|
-
"k-step-list-vertical":
|
|
122
|
+
[n, d, x]
|
|
123
|
+
), oe = e.useMemo(
|
|
124
|
+
() => P("k-step-list", {
|
|
125
|
+
"k-step-list-horizontal": !n,
|
|
126
|
+
"k-step-list-vertical": n
|
|
125
127
|
}),
|
|
126
|
-
[
|
|
127
|
-
),
|
|
128
|
+
[n]
|
|
129
|
+
), re = e.useMemo(
|
|
128
130
|
() => ({
|
|
129
|
-
gridColumnStart:
|
|
130
|
-
gridColumnEnd:
|
|
131
|
-
gridRowStart:
|
|
132
|
-
gridRowEnd:
|
|
131
|
+
gridColumnStart: n ? void 0 : 1,
|
|
132
|
+
gridColumnEnd: n ? void 0 : -1,
|
|
133
|
+
gridRowStart: n ? 1 : void 0,
|
|
134
|
+
gridRowEnd: n ? -1 : void 0
|
|
133
135
|
}),
|
|
134
|
-
[
|
|
135
|
-
),
|
|
136
|
+
[n]
|
|
137
|
+
), ie = e.useMemo(
|
|
136
138
|
() => ({
|
|
137
|
-
gridColumnStart:
|
|
138
|
-
gridColumnEnd:
|
|
139
|
-
gridRowStart:
|
|
140
|
-
gridRowEnd:
|
|
141
|
-
top:
|
|
139
|
+
gridColumnStart: n ? void 0 : 2,
|
|
140
|
+
gridColumnEnd: n ? void 0 : d * 2,
|
|
141
|
+
gridRowStart: n ? 1 : void 0,
|
|
142
|
+
gridRowEnd: n ? d : void 0,
|
|
143
|
+
top: n ? 17 : void 0
|
|
142
144
|
}),
|
|
143
|
-
[
|
|
144
|
-
),
|
|
145
|
+
[n, d]
|
|
146
|
+
), M = p && p.map((l, r) => {
|
|
145
147
|
const t = {
|
|
146
148
|
index: r,
|
|
147
149
|
disabled: m || l.disabled,
|
|
148
|
-
focused: r ===
|
|
150
|
+
focused: r === Y,
|
|
149
151
|
current: r === a,
|
|
150
152
|
...l
|
|
151
|
-
},
|
|
152
|
-
return /* @__PURE__ */ e.createElement(
|
|
153
|
+
}, s = R || me;
|
|
154
|
+
return /* @__PURE__ */ e.createElement(s, { key: r, ...t });
|
|
153
155
|
});
|
|
154
156
|
return /* @__PURE__ */ e.createElement(
|
|
155
|
-
|
|
157
|
+
le.Provider,
|
|
156
158
|
{
|
|
157
159
|
value: {
|
|
158
|
-
animationDuration:
|
|
159
|
-
isVertical:
|
|
160
|
-
item:
|
|
160
|
+
animationDuration: k,
|
|
161
|
+
isVertical: n,
|
|
162
|
+
item: R,
|
|
161
163
|
linear: g,
|
|
162
|
-
mode:
|
|
164
|
+
mode: q,
|
|
163
165
|
numOfSteps: d,
|
|
164
166
|
value: a,
|
|
165
|
-
successIcon:
|
|
166
|
-
successSVGIcon:
|
|
167
|
-
errorIcon:
|
|
168
|
-
errorSVGIcon:
|
|
169
|
-
onChange:
|
|
170
|
-
onFocus:
|
|
167
|
+
successIcon: W,
|
|
168
|
+
successSVGIcon: J,
|
|
169
|
+
errorIcon: U,
|
|
170
|
+
errorSVGIcon: j,
|
|
171
|
+
onChange: $,
|
|
172
|
+
onFocus: ee
|
|
171
173
|
}
|
|
172
174
|
},
|
|
173
175
|
/* @__PURE__ */ e.createElement(
|
|
174
176
|
"nav",
|
|
175
177
|
{
|
|
176
|
-
className:
|
|
177
|
-
style:
|
|
178
|
-
dir:
|
|
179
|
-
role: "navigation",
|
|
178
|
+
className: se,
|
|
179
|
+
style: ne,
|
|
180
|
+
dir: S,
|
|
180
181
|
ref: f,
|
|
181
|
-
onKeyDown:
|
|
182
|
+
onKeyDown: te,
|
|
183
|
+
"aria-label": X
|
|
182
184
|
},
|
|
183
|
-
/* @__PURE__ */ e.createElement("ol", { className:
|
|
185
|
+
/* @__PURE__ */ e.createElement("ol", { className: oe, style: re }, M || B),
|
|
184
186
|
/* @__PURE__ */ e.createElement(
|
|
185
|
-
|
|
187
|
+
pe,
|
|
186
188
|
{
|
|
187
|
-
style:
|
|
189
|
+
style: ie,
|
|
188
190
|
labelPlacement: "start",
|
|
189
|
-
animation: { duration:
|
|
190
|
-
ariaLabel:
|
|
191
|
+
animation: { duration: Z },
|
|
192
|
+
ariaLabel: Q,
|
|
191
193
|
"aria-hidden": !0,
|
|
192
|
-
max: d - 1,
|
|
193
194
|
labelVisible: !1,
|
|
194
|
-
orientation:
|
|
195
|
-
reverse:
|
|
196
|
-
value: a,
|
|
195
|
+
orientation: y,
|
|
196
|
+
reverse: y === "vertical",
|
|
197
|
+
value: d > 1 ? Math.round(a / (d - 1) * 100) : 0,
|
|
197
198
|
disabled: m,
|
|
198
199
|
tabIndex: -1
|
|
199
200
|
}
|
|
@@ -201,27 +202,27 @@ const V = e.forwardRef((S, z) => {
|
|
|
201
202
|
)
|
|
202
203
|
);
|
|
203
204
|
});
|
|
204
|
-
|
|
205
|
-
animationDuration:
|
|
206
|
-
children:
|
|
207
|
-
className:
|
|
208
|
-
dir:
|
|
209
|
-
disabled:
|
|
210
|
-
errorIcon:
|
|
211
|
-
errorSVGIcon:
|
|
212
|
-
item:
|
|
213
|
-
items:
|
|
214
|
-
linear:
|
|
215
|
-
mode:
|
|
216
|
-
orientation:
|
|
217
|
-
style:
|
|
218
|
-
successIcon:
|
|
219
|
-
successSVGIcon:
|
|
220
|
-
value:
|
|
221
|
-
onChange:
|
|
222
|
-
onFocus:
|
|
205
|
+
G.propTypes = {
|
|
206
|
+
animationDuration: o.oneOfType([o.bool, o.number]),
|
|
207
|
+
children: o.any,
|
|
208
|
+
className: o.string,
|
|
209
|
+
dir: o.string,
|
|
210
|
+
disabled: o.bool,
|
|
211
|
+
errorIcon: o.string,
|
|
212
|
+
errorSVGIcon: V,
|
|
213
|
+
item: o.any,
|
|
214
|
+
items: o.any,
|
|
215
|
+
linear: o.bool,
|
|
216
|
+
mode: o.oneOf(["steps", "labels"]),
|
|
217
|
+
orientation: o.oneOf(["horizontal", "vertical"]),
|
|
218
|
+
style: o.object,
|
|
219
|
+
successIcon: o.string,
|
|
220
|
+
successSVGIcon: V,
|
|
221
|
+
value: o.number.isRequired,
|
|
222
|
+
onChange: o.func,
|
|
223
|
+
onFocus: o.func
|
|
223
224
|
};
|
|
224
|
-
|
|
225
|
+
G.displayName = "KendoStepper";
|
|
225
226
|
export {
|
|
226
|
-
|
|
227
|
+
G as Stepper
|
|
227
228
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { StepProps } from './StepProps';
|
|
9
9
|
import { StepperChangeEvent } from './StepperChangeEvent';
|
|
10
10
|
import { StepperFocusEvent } from './StepperFocusEvent';
|
|
11
|
-
import { SVGIcon } from '@progress/kendo-react-common';
|
|
11
|
+
import { SVGIcon, WebMcpProps } from '@progress/kendo-react-common';
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
/**
|
|
14
14
|
* Represents the props of the [KendoReact Stepper component](https://www.telerik.com/kendo-react-ui/components/layout/stepper).
|
|
@@ -213,4 +213,11 @@ export interface StepperProps {
|
|
|
213
213
|
* ```
|
|
214
214
|
*/
|
|
215
215
|
onFocus?: (event: StepperFocusEvent) => void;
|
|
216
|
+
/**
|
|
217
|
+
* Enables Web MCP tool registration so AI agents can interact with this Stepper.
|
|
218
|
+
* Set to `true` to use the provider-level `dataName`, or pass a config object to override.
|
|
219
|
+
*
|
|
220
|
+
* Requires a `WebMcpProvider` ancestor from `@progress/kendo-react-webmcp`.
|
|
221
|
+
*/
|
|
222
|
+
webMcp?: boolean | WebMcpProps;
|
|
216
223
|
}
|