@progress/kendo-react-layout 8.1.0-develop.9 → 8.1.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bottomnavigation/BottomNavigation.js +1 -1
- package/bottomnavigation/BottomNavigation.mjs +36 -37
- package/bottomnavigation/BottomNavigationItem.js +1 -1
- package/bottomnavigation/BottomNavigationItem.mjs +33 -34
- package/breadcrumb/Breadcrumb.js +1 -1
- package/breadcrumb/Breadcrumb.mjs +34 -35
- package/card/Card.js +1 -1
- package/card/Card.mjs +28 -20
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/drawer/Drawer.mjs +65 -65
- package/gridlayout/GridLayout.js +1 -1
- package/gridlayout/GridLayout.mjs +11 -12
- package/index.d.mts +16 -9
- package/index.d.ts +16 -9
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/splitter/SplitterBar.js +1 -1
- package/splitter/SplitterBar.mjs +72 -46
- package/stacklayout/StackLayout.js +1 -1
- package/stacklayout/StackLayout.mjs +13 -14
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +68 -72
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +179 -163
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +94 -111
- package/tabstrip/TabStripContent.js +1 -1
- package/tabstrip/TabStripContent.mjs +2 -1
- package/tabstrip/TabStripNavigationItem.js +1 -1
- package/tabstrip/TabStripNavigationItem.mjs +36 -24
package/splitter/SplitterBar.mjs
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
import { caretAltLeftIcon as
|
|
12
|
-
class
|
|
13
|
-
constructor(
|
|
14
|
-
super(
|
|
15
|
-
const { event:
|
|
16
|
-
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import { Navigation as d, classNames as f, Draggable as u, IconWrap as g } from "@progress/kendo-react-common";
|
|
11
|
+
import { caretAltLeftIcon as n, caretAltRightIcon as p, caretAltDownIcon as h, caretAltUpIcon as b } from "@progress/kendo-svg-icons";
|
|
12
|
+
class v extends o.Component {
|
|
13
|
+
constructor(a) {
|
|
14
|
+
super(a), this.draggable = null, this.spliterBarRef = o.createRef(), this.onDrag = (s, e, l) => {
|
|
15
|
+
const { event: i } = s, { onDrag: r, index: t } = this.props, c = this.draggable && this.draggable.element;
|
|
16
|
+
c && !this.isStatic && this.isDraggable && r(i, c, t, e, l);
|
|
17
17
|
}, this.onFocus = () => {
|
|
18
18
|
this.setState({
|
|
19
19
|
focused: !0
|
|
@@ -22,62 +22,88 @@ class k extends a.Component {
|
|
|
22
22
|
this.setState({
|
|
23
23
|
focused: !1
|
|
24
24
|
});
|
|
25
|
-
}, this.onToggle = (
|
|
26
|
-
const { onToggle: e, index: l, prev:
|
|
27
|
-
(
|
|
28
|
-
}, this.onPrevToggle = (
|
|
29
|
-
const { onToggle: e, index: l, prev:
|
|
30
|
-
|
|
31
|
-
}, this.onNextToggle = (
|
|
32
|
-
const { onToggle: e, index: l, next:
|
|
33
|
-
|
|
34
|
-
}, this.onKeyDown = (
|
|
35
|
-
|
|
36
|
-
t.preventDefault(), this.props.onKeyboardResize(p, f, u, t);
|
|
37
|
-
};
|
|
38
|
-
i && (e === n.enter ? (t.preventDefault(), this.onToggle(t)) : this.isDraggable && (l && e === n.left ? r(i, s, -10) : l && e === n.right ? r(i, s, 10) : !l && e === n.up ? r(i, s, -10) : !l && e === n.down && r(i, s, 10)));
|
|
25
|
+
}, this.onToggle = (s) => {
|
|
26
|
+
const { onToggle: e, index: l, prev: i, next: r } = this.props;
|
|
27
|
+
(i.collapsible || r.collapsible) && e(i.collapsible ? l : l + 1, s);
|
|
28
|
+
}, this.onPrevToggle = (s) => {
|
|
29
|
+
const { onToggle: e, index: l, prev: i } = this.props;
|
|
30
|
+
i.collapsible && e(l, s);
|
|
31
|
+
}, this.onNextToggle = (s) => {
|
|
32
|
+
const { onToggle: e, index: l, next: i } = this.props;
|
|
33
|
+
i.collapsible && e(l + 1, s);
|
|
34
|
+
}, this.onKeyDown = (s) => {
|
|
35
|
+
this.navigation.triggerKeyboardEvent(s);
|
|
39
36
|
}, this.state = {
|
|
40
37
|
focused: !1
|
|
41
38
|
};
|
|
42
39
|
}
|
|
43
40
|
get isStatic() {
|
|
44
|
-
const { prev:
|
|
41
|
+
const { prev: a, next: s } = this.props, e = a.resizable && s.resizable, l = a.collapsible || s.collapsible;
|
|
45
42
|
return !e && !l;
|
|
46
43
|
}
|
|
47
44
|
get isDraggable() {
|
|
48
|
-
const { prev:
|
|
45
|
+
const { prev: a, next: s } = this.props, e = a.resizable && s.resizable, l = a.collapsed || s.collapsed;
|
|
49
46
|
return !!e && !l;
|
|
50
47
|
}
|
|
51
48
|
get isHorizontal() {
|
|
52
49
|
return this.props.orientation === "horizontal";
|
|
53
50
|
}
|
|
51
|
+
/** @hidden */
|
|
52
|
+
componentDidMount() {
|
|
53
|
+
const a = this.draggable && this.draggable.element, { index: s, onKeyboardResize: e } = this.props, l = this.isHorizontal;
|
|
54
|
+
a && (this.navigation = new d({
|
|
55
|
+
tabIndex: 0,
|
|
56
|
+
root: this.spliterBarRef,
|
|
57
|
+
selectors: [".k-splitter .k-splitbar"],
|
|
58
|
+
keyboardEvents: {
|
|
59
|
+
keydown: {
|
|
60
|
+
ArrowLeft: (i, r, t) => {
|
|
61
|
+
l && (t.preventDefault(), this.isDraggable && e(a, s, -10, t), (t.metaKey || t.ctrlKey) && (e(a, s, 0, t), this.isDraggable ? this.onPrevToggle(t) : this.onNextToggle(t)));
|
|
62
|
+
},
|
|
63
|
+
ArrowRight: (i, r, t) => {
|
|
64
|
+
l && (t.preventDefault(), this.isDraggable && e(a, s, 10, t), (t.metaKey || t.ctrlKey) && (e(a, s, 0, t), this.isDraggable ? this.onNextToggle(t) : this.onPrevToggle(t)));
|
|
65
|
+
},
|
|
66
|
+
ArrowDown: (i, r, t) => {
|
|
67
|
+
l || (t.preventDefault(), this.isDraggable && e(a, s, 10, t), (t.metaKey || t.ctrlKey) && (e(a, s, 0, t), this.isDraggable ? this.onNextToggle(t) : this.onPrevToggle(t)));
|
|
68
|
+
},
|
|
69
|
+
ArrowUp: (i, r, t) => {
|
|
70
|
+
l || (t.preventDefault(), this.isDraggable && e(a, s, -10, t), (t.metaKey || t.ctrlKey) && (e(a, s, 0, t), this.isDraggable ? this.onPrevToggle(t) : this.onNextToggle(t)));
|
|
71
|
+
},
|
|
72
|
+
Enter: (i, r, t) => {
|
|
73
|
+
t.preventDefault(), this.onToggle(t);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
54
79
|
render() {
|
|
55
|
-
const
|
|
80
|
+
const a = this.isDraggable, s = this.isStatic, e = this.isHorizontal, l = f(
|
|
56
81
|
"k-splitbar",
|
|
57
82
|
{
|
|
58
83
|
"k-focus": this.state.focused,
|
|
59
84
|
"k-splitbar-horizontal": e,
|
|
60
85
|
"k-splitbar-vertical": !e,
|
|
61
|
-
"k-splitbar-draggable-horizontal": e &&
|
|
62
|
-
"k-splitbar-draggable-vertical": !e &&
|
|
63
|
-
"k-splitbar-static-horizontal": e &&
|
|
64
|
-
"k-splitbar-static-vertical": !e &&
|
|
86
|
+
"k-splitbar-draggable-horizontal": e && a,
|
|
87
|
+
"k-splitbar-draggable-vertical": !e && a,
|
|
88
|
+
"k-splitbar-static-horizontal": e && s,
|
|
89
|
+
"k-splitbar-static-vertical": !e && s
|
|
65
90
|
}
|
|
66
91
|
);
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
|
|
92
|
+
return /* @__PURE__ */ o.createElement(
|
|
93
|
+
u,
|
|
69
94
|
{
|
|
70
|
-
onPress: (
|
|
71
|
-
onDrag: (
|
|
72
|
-
onRelease: (
|
|
73
|
-
ref: (
|
|
74
|
-
this.draggable =
|
|
95
|
+
onPress: (i) => this.onDrag(i, !0, !1),
|
|
96
|
+
onDrag: (i) => this.onDrag(i, !1, !1),
|
|
97
|
+
onRelease: (i) => this.onDrag(i, !1, !0),
|
|
98
|
+
ref: (i) => {
|
|
99
|
+
this.draggable = i;
|
|
75
100
|
}
|
|
76
101
|
},
|
|
77
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ o.createElement(
|
|
78
103
|
"div",
|
|
79
104
|
{
|
|
80
|
-
|
|
105
|
+
ref: this.spliterBarRef,
|
|
106
|
+
tabIndex: s ? -1 : 0,
|
|
81
107
|
role: "separator",
|
|
82
108
|
"aria-valuenow": 0,
|
|
83
109
|
"aria-label": this.props.ariaLabel,
|
|
@@ -89,33 +115,33 @@ class k extends a.Component {
|
|
|
89
115
|
onDoubleClick: this.onToggle,
|
|
90
116
|
onKeyDown: this.onKeyDown
|
|
91
117
|
},
|
|
92
|
-
this.props.prev.collapsible && /* @__PURE__ */
|
|
118
|
+
this.props.prev.collapsible && /* @__PURE__ */ o.createElement(
|
|
93
119
|
"div",
|
|
94
120
|
{
|
|
95
121
|
className: "k-collapse-prev",
|
|
96
122
|
onClick: this.onPrevToggle
|
|
97
123
|
},
|
|
98
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ o.createElement(
|
|
99
125
|
g,
|
|
100
126
|
{
|
|
101
127
|
name: this.props.prev.collapsible ? e ? this.props.prev.collapsed ? this.props.isRtl ? "caret-alt-left" : "caret-alt-right" : this.props.isRtl ? "caret-alt-right" : "caret-alt-left" : this.props.prev.collapsed ? "caret-alt-down" : "caret-alt-up" : void 0,
|
|
102
|
-
icon: this.props.prev.collapsible ? e ? this.props.prev.collapsed ? this.props.isRtl ?
|
|
128
|
+
icon: this.props.prev.collapsible ? e ? this.props.prev.collapsed ? this.props.isRtl ? n : p : this.props.isRtl ? p : n : this.props.prev.collapsed ? h : b : void 0,
|
|
103
129
|
size: "xsmall"
|
|
104
130
|
}
|
|
105
131
|
)
|
|
106
132
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
this.props.next.collapsible && /* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ o.createElement("div", { className: "k-resize-handle" }),
|
|
134
|
+
this.props.next.collapsible && /* @__PURE__ */ o.createElement(
|
|
109
135
|
"div",
|
|
110
136
|
{
|
|
111
137
|
className: "k-collapse-next",
|
|
112
138
|
onClick: this.onNextToggle
|
|
113
139
|
},
|
|
114
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ o.createElement(
|
|
115
141
|
g,
|
|
116
142
|
{
|
|
117
143
|
name: this.props.next.collapsible ? e ? this.props.next.collapsed ? this.props.isRtl ? "caret-alt-right" : "caret-alt-left" : this.props.isRtl ? "caret-alt-left" : "caret-alt-right" : this.props.next.collapsed ? "caret-alt-up" : "caret-alt-down" : void 0,
|
|
118
|
-
icon: this.props.next.collapsible ? e ? this.props.next.collapsed ? this.props.isRtl ?
|
|
144
|
+
icon: this.props.next.collapsible ? e ? this.props.next.collapsed ? this.props.isRtl ? p : n : this.props.isRtl ? n : p : this.props.next.collapsed ? b : h : void 0,
|
|
119
145
|
size: "xsmall"
|
|
120
146
|
}
|
|
121
147
|
)
|
|
@@ -125,5 +151,5 @@ class k extends a.Component {
|
|
|
125
151
|
}
|
|
126
152
|
}
|
|
127
153
|
export {
|
|
128
|
-
|
|
154
|
+
v as SplitterBar
|
|
129
155
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),n=require("prop-types"),O=require("../package-metadata.js"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),n=require("prop-types"),O=require("../package-metadata.js"),u=require("@progress/kendo-react-common");function z(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const c in t)if(c!=="default"){const l=Object.getOwnPropertyDescriptor(t,c);Object.defineProperty(s,c,l.get?l:{enumerable:!0,get:()=>t[c]})}}return s.default=t,Object.freeze(s)}const i=z(j),d=i.forwardRef((t,s)=>{u.validatePackage(O.packageMetadata);const c=i.useRef(null),l=i.useCallback(()=>({element:c.current}),[]);i.useImperativeHandle(s,l);const{className:m,style:y,id:f,children:k}=t,h=u.useId(),r=i.useMemo(()=>t.orientation||g.orientation,[t.orientation]),e=r==="horizontal",a=i.useMemo(()=>t.align&&t.align.horizontal?t.align.horizontal:g.hAlign,[t.align]),o=i.useMemo(()=>t.align&&t.align.vertical?t.align.vertical:g.vAlign,[t.align]),b=i.useMemo(()=>u.classNames("k-stack-layout",{"k-hstack":r==="horizontal","k-vstack":r==="vertical","k-justify-content-start":e&&a==="start"||!e&&o==="top","k-justify-content-center":e&&a==="center"||!e&&o==="middle","k-justify-content-end":e&&a==="end"||!e&&o==="bottom","k-justify-content-stretch":e&&a==="stretch"||!e&&o==="stretch","k-align-items-start":!e&&a==="start"||e&&o==="top","k-align-items-center":!e&&a==="center"||e&&o==="middle","k-align-items-end":!e&&a==="end"||e&&o==="bottom","k-align-items-stretch":!e&&a==="stretch"||e&&o==="stretch"},m),[r,e,a,o,m]),v={gap:`${typeof t.gap=="number"?t.gap+"px":t.gap}`,...y};return i.createElement("div",{ref:c,className:b,style:v,id:f||h},k)}),g={orientation:"horizontal",hAlign:"stretch",vAlign:"stretch"};d.propTypes={className:n.string,style:n.object,children:n.any,id:n.string,orientation:n.oneOf(["horizontal","vertical"]),gap:n.oneOfType([n.string,n.number]),align:n.shape({vertical:n.oneOf(["top","middle","bottom","stretch"]),horizontal:n.oneOf(["start","center","end","stretch"])})};d.displayName="KendoReactStackLayout";exports.StackLayout=d;
|
|
@@ -10,16 +10,16 @@ import * as o from "react";
|
|
|
10
10
|
import n from "prop-types";
|
|
11
11
|
import { packageMetadata as z } from "../package-metadata.mjs";
|
|
12
12
|
import { validatePackage as b, useId as A, classNames as j } from "@progress/kendo-react-common";
|
|
13
|
-
const
|
|
13
|
+
const m = o.forwardRef((e, g) => {
|
|
14
14
|
b(z);
|
|
15
|
-
const
|
|
15
|
+
const c = o.useRef(null), d = o.useCallback(
|
|
16
16
|
() => ({
|
|
17
|
-
element:
|
|
17
|
+
element: c.current
|
|
18
18
|
}),
|
|
19
19
|
[]
|
|
20
20
|
);
|
|
21
21
|
o.useImperativeHandle(g, d);
|
|
22
|
-
const { className:
|
|
22
|
+
const { className: r, style: u, id: h, children: k } = e, y = A(), s = o.useMemo(
|
|
23
23
|
() => e.orientation || l.orientation,
|
|
24
24
|
[e.orientation]
|
|
25
25
|
), t = s === "horizontal", a = o.useMemo(
|
|
@@ -28,7 +28,7 @@ const c = o.forwardRef((e, g) => {
|
|
|
28
28
|
), i = o.useMemo(
|
|
29
29
|
() => e.align && e.align.vertical ? e.align.vertical : l.vAlign,
|
|
30
30
|
[e.align]
|
|
31
|
-
),
|
|
31
|
+
), f = o.useMemo(
|
|
32
32
|
() => j(
|
|
33
33
|
"k-stack-layout",
|
|
34
34
|
{
|
|
@@ -43,9 +43,9 @@ const c = o.forwardRef((e, g) => {
|
|
|
43
43
|
"k-align-items-end": !t && a === "end" || t && i === "bottom",
|
|
44
44
|
"k-align-items-stretch": !t && a === "stretch" || t && i === "stretch"
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
r
|
|
47
47
|
),
|
|
48
|
-
[s, t, a, i,
|
|
48
|
+
[s, t, a, i, r]
|
|
49
49
|
), v = {
|
|
50
50
|
gap: `${typeof e.gap == "number" ? e.gap + "px" : e.gap}`,
|
|
51
51
|
...u
|
|
@@ -53,10 +53,10 @@ const c = o.forwardRef((e, g) => {
|
|
|
53
53
|
return /* @__PURE__ */ o.createElement(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
ref:
|
|
57
|
-
className:
|
|
56
|
+
ref: c,
|
|
57
|
+
className: f,
|
|
58
58
|
style: v,
|
|
59
|
-
id: h ||
|
|
59
|
+
id: h || y
|
|
60
60
|
},
|
|
61
61
|
k
|
|
62
62
|
);
|
|
@@ -65,7 +65,7 @@ const c = o.forwardRef((e, g) => {
|
|
|
65
65
|
hAlign: "stretch",
|
|
66
66
|
vAlign: "stretch"
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
m.propTypes = {
|
|
69
69
|
className: n.string,
|
|
70
70
|
style: n.object,
|
|
71
71
|
children: n.any,
|
|
@@ -77,8 +77,7 @@ c.propTypes = {
|
|
|
77
77
|
horizontal: n.oneOf(["start", "center", "end", "stretch"])
|
|
78
78
|
})
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
c.displayName = "KendoReactStackLayout";
|
|
80
|
+
m.displayName = "KendoReactStackLayout";
|
|
82
81
|
export {
|
|
83
|
-
|
|
82
|
+
m as StackLayout
|
|
84
83
|
};
|
package/stepper/Step.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ee=require("react"),n=require("prop-types"),te=require("./context/StepperContext.js"),c=require("@progress/kendo-react-common"),ne=require("@progress/kendo-react-intl"),j=require("@progress/kendo-svg-icons"),D=require("./contants.js"),L=require("./messages/index.js");function ae(s){const p=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const m=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(p,i,m.get?m:{enumerable:!0,get:()=>s[i]})}}return p.default=s,Object.freeze(p)}const e=ae(ee),y=e.forwardRef((s,p)=>{const{children:i,className:m,current:v,disabled:o,focused:O,icon:b,svgIcon:M,index:a,isValid:t,label:l,optional:k,style:T,tabIndex:oe=se.tabIndex,text:q,..._}=s,{animationDuration:I,isVertical:g,item:z,linear:P,mode:F,numOfSteps:r,value:d,onChange:N,onFocus:x,successIcon:V,errorIcon:w,successSVGIcon:H,errorSVGIcon:W}=e.useContext(te.StepperContext),f=e.useRef(null),R=e.useCallback(()=>{f.current&&c.focusFirstFocusableChild(f.current)},[]),E=e.useCallback(()=>({element:f.current,focus:R}),[R]);e.useImperativeHandle(p,E);const C=!P||a===d-1||a===d||a===d+1,S=F==="labels"||!!b&&!!l,$=ne.useLocalization(),B=(u=>$.toLanguageString(u,L.messages[u]))(L.optionalText),G=typeof I=="number"?I:I!==!1?D.DEFAULT_ANIMATION_DURATION:D.NO_ANIMATION,U=e.useCallback(u=>{N&&!o&&c.dispatchEvent(N,u,E(),{value:a})},[N,d,o]),K=e.useCallback(u=>{x&&!o&&c.dispatchEvent(x,u,E(),void 0)},[x,o]),J=e.useMemo(()=>c.classNames("k-step",{"k-step-first":a===0,"k-step-last":r&&a===r-1,"k-step-done":a<d,"k-step-current":v,"k-step-optional":k,"k-step-error":t!==void 0&&!t,"k-step-success":t,"k-disabled":o,"k-focus":O},m),[a,r,d,v,k,o,O,t,m]),Q=e.useMemo(()=>({maxWidth:g?void 0:`calc(100% / ${r})`,maxHeight:g?`calc(100% / ${r})`:void 0,pointerEvents:C?void 0:"none",...T}),[g,r,T,C]),A=t?V:w,h=A?e.createElement("span",{className:"k-step-indicator-icon "+A,"aria-hidden":"true"}):e.createElement(c.IconWrap,{className:"k-step-indicator-icon",name:t?"check-circle":"exclamation-circle",icon:t?H||j.checkOutlineIcon:W||j.exclamationCircleIcon}),X=e.createElement(e.Fragment,null,F!=="labels"?e.createElement("span",{className:"k-step-indicator","aria-hidden":!0,style:{transitionDuration:G+"ms"}},b||M?!S&&t!==void 0?h:e.createElement(c.IconWrap,{className:"k-step-indicator-icon",name:b&&c.toIconName(b),icon:M}):t!==void 0?h:e.createElement("span",{className:"k-step-indicator-text"},q||a+1)):null),Y=(l||S||k)&&e.createElement("span",{className:"k-step-label"},l&&e.createElement("span",{className:"k-step-text"},l),S&&t!==void 0&&h,k&&e.createElement("span",{className:"k-step-label-optional"},B)),Z=e.createElement(e.Fragment,null,X,Y);return e.createElement("li",{ref:f,className:J,style:Q,..._},e.createElement("a",{className:"k-step-link",title:l||void 0,onClick:U,onFocus:K,"aria-current":v?"step":void 0,"aria-disabled":o||!C||void 0,"aria-invalid":t!==void 0&&!t||void 0},z?i:Z))});y.propTypes={children:n.any,className:n.string,current:n.bool,disabled:n.bool,icon:n.string,index:n.number,isValid:n.bool,label:n.string,optional:n.bool,style:n.object,tabIndex:n.number,text:n.string};const se={tabIndex:0};y.displayName="KendoStep";exports.Step=y;
|
package/stepper/Step.mjs
CHANGED
|
@@ -8,79 +8,79 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import a from "prop-types";
|
|
11
|
-
import { StepperContext as
|
|
12
|
-
import { focusFirstFocusableChild as
|
|
13
|
-
import { useLocalization as
|
|
14
|
-
import { checkOutlineIcon as
|
|
15
|
-
import { DEFAULT_ANIMATION_DURATION as
|
|
16
|
-
import { messages as
|
|
17
|
-
const
|
|
11
|
+
import { StepperContext as Y } from "./context/StepperContext.mjs";
|
|
12
|
+
import { focusFirstFocusableChild as Z, dispatchEvent as M, classNames as ee, IconWrap as T, toIconName as te } from "@progress/kendo-react-common";
|
|
13
|
+
import { useLocalization as ae } from "@progress/kendo-react-intl";
|
|
14
|
+
import { checkOutlineIcon as se, exclamationCircleIcon as ne } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { DEFAULT_ANIMATION_DURATION as oe, NO_ANIMATION as ce } from "./contants.mjs";
|
|
16
|
+
import { messages as le, optionalText as ie } from "./messages/index.mjs";
|
|
17
|
+
const L = e.forwardRef((O, R) => {
|
|
18
18
|
const {
|
|
19
19
|
// content
|
|
20
|
-
children:
|
|
21
|
-
className:
|
|
20
|
+
children: V,
|
|
21
|
+
className: g,
|
|
22
22
|
current: d,
|
|
23
23
|
disabled: n,
|
|
24
|
-
focused:
|
|
24
|
+
focused: E,
|
|
25
25
|
icon: r,
|
|
26
|
-
svgIcon:
|
|
26
|
+
svgIcon: h,
|
|
27
27
|
index: s,
|
|
28
28
|
isValid: t,
|
|
29
29
|
label: o,
|
|
30
30
|
optional: m,
|
|
31
|
-
style:
|
|
32
|
-
tabIndex:
|
|
33
|
-
text:
|
|
34
|
-
...
|
|
35
|
-
} =
|
|
36
|
-
animationDuration:
|
|
37
|
-
isVertical:
|
|
38
|
-
item:
|
|
39
|
-
linear:
|
|
40
|
-
mode:
|
|
31
|
+
style: C,
|
|
32
|
+
tabIndex: me = re.tabIndex,
|
|
33
|
+
text: y,
|
|
34
|
+
...z
|
|
35
|
+
} = O, {
|
|
36
|
+
animationDuration: u,
|
|
37
|
+
isVertical: k,
|
|
38
|
+
item: D,
|
|
39
|
+
linear: H,
|
|
40
|
+
mode: S,
|
|
41
41
|
numOfSteps: c,
|
|
42
42
|
value: l,
|
|
43
|
-
onChange:
|
|
44
|
-
onFocus:
|
|
43
|
+
onChange: b,
|
|
44
|
+
onFocus: f,
|
|
45
45
|
successIcon: _,
|
|
46
46
|
errorIcon: w,
|
|
47
47
|
successSVGIcon: B,
|
|
48
48
|
errorSVGIcon: G
|
|
49
|
-
} = e.useContext(
|
|
49
|
+
} = e.useContext(Y), p = e.useRef(null), F = e.useCallback(
|
|
50
50
|
() => {
|
|
51
|
-
p.current &&
|
|
51
|
+
p.current && Z(p.current);
|
|
52
52
|
},
|
|
53
53
|
[]
|
|
54
54
|
), v = e.useCallback(
|
|
55
55
|
() => ({
|
|
56
56
|
element: p.current,
|
|
57
|
-
focus:
|
|
57
|
+
focus: F
|
|
58
58
|
}),
|
|
59
|
-
[
|
|
59
|
+
[F]
|
|
60
60
|
);
|
|
61
|
-
e.useImperativeHandle(
|
|
62
|
-
const
|
|
61
|
+
e.useImperativeHandle(R, v);
|
|
62
|
+
const I = !H || s === l - 1 || s === l || s === l + 1, N = S === "labels" || !!r && !!o, P = ae(), U = ((i) => P.toLanguageString(i, le[i]))(ie), W = typeof u == "number" ? u : u !== !1 ? oe : ce, $ = e.useCallback(
|
|
63
63
|
(i) => {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
b && !n && M(
|
|
65
|
+
b,
|
|
66
66
|
i,
|
|
67
67
|
v(),
|
|
68
68
|
{ value: s }
|
|
69
69
|
);
|
|
70
70
|
},
|
|
71
|
-
[
|
|
72
|
-
),
|
|
71
|
+
[b, l, n]
|
|
72
|
+
), j = e.useCallback(
|
|
73
73
|
(i) => {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
f && !n && M(
|
|
75
|
+
f,
|
|
76
76
|
i,
|
|
77
77
|
v(),
|
|
78
78
|
void 0
|
|
79
79
|
);
|
|
80
80
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
83
|
-
() =>
|
|
81
|
+
[f, n]
|
|
82
|
+
), K = e.useMemo(
|
|
83
|
+
() => ee(
|
|
84
84
|
"k-step",
|
|
85
85
|
{
|
|
86
86
|
"k-step-first": s === 0,
|
|
@@ -89,70 +89,67 @@ const E = e.forwardRef((R, V) => {
|
|
|
89
89
|
"k-step-current": d,
|
|
90
90
|
"k-step-optional": m,
|
|
91
91
|
"k-step-error": t !== void 0 && !t,
|
|
92
|
-
"k-step-success": t
|
|
93
|
-
},
|
|
94
|
-
{
|
|
92
|
+
"k-step-success": t,
|
|
95
93
|
"k-disabled": n,
|
|
96
|
-
"k-focus":
|
|
94
|
+
"k-focus": E
|
|
97
95
|
},
|
|
98
|
-
|
|
96
|
+
g
|
|
99
97
|
),
|
|
100
|
-
[s, c, l, d, m, n,
|
|
101
|
-
),
|
|
98
|
+
[s, c, l, d, m, n, E, t, g]
|
|
99
|
+
), q = e.useMemo(
|
|
102
100
|
() => ({
|
|
103
|
-
maxWidth:
|
|
104
|
-
maxHeight:
|
|
105
|
-
pointerEvents:
|
|
106
|
-
...
|
|
101
|
+
maxWidth: k ? void 0 : `calc(100% / ${c})`,
|
|
102
|
+
maxHeight: k ? `calc(100% / ${c})` : void 0,
|
|
103
|
+
pointerEvents: I ? void 0 : "none",
|
|
104
|
+
...C
|
|
107
105
|
}),
|
|
108
|
-
[
|
|
109
|
-
),
|
|
106
|
+
[k, c, C, I]
|
|
107
|
+
), A = t ? _ : w, x = A ? /* @__PURE__ */ e.createElement(
|
|
110
108
|
"span",
|
|
111
109
|
{
|
|
112
|
-
className: "k-step-indicator-icon " +
|
|
110
|
+
className: "k-step-indicator-icon " + A,
|
|
113
111
|
"aria-hidden": "true"
|
|
114
112
|
}
|
|
115
113
|
) : /* @__PURE__ */ e.createElement(
|
|
116
|
-
|
|
114
|
+
T,
|
|
117
115
|
{
|
|
118
116
|
className: "k-step-indicator-icon",
|
|
119
117
|
name: t ? "check-circle" : "exclamation-circle",
|
|
120
|
-
icon: t ? B ||
|
|
118
|
+
icon: t ? B || se : G || ne
|
|
121
119
|
}
|
|
122
|
-
),
|
|
120
|
+
), J = /* @__PURE__ */ e.createElement(e.Fragment, null, S !== "labels" ? /* @__PURE__ */ e.createElement(
|
|
123
121
|
"span",
|
|
124
122
|
{
|
|
125
123
|
className: "k-step-indicator",
|
|
126
124
|
"aria-hidden": !0,
|
|
127
|
-
style: { transitionDuration:
|
|
125
|
+
style: { transitionDuration: W + "ms" }
|
|
128
126
|
},
|
|
129
|
-
r ||
|
|
130
|
-
) : null),
|
|
127
|
+
r || h ? !N && t !== void 0 ? x : /* @__PURE__ */ e.createElement(T, { className: "k-step-indicator-icon", name: r && te(r), icon: h }) : t !== void 0 ? x : /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-text" }, y || s + 1)
|
|
128
|
+
) : null), Q = (o || N || m) && /* @__PURE__ */ e.createElement("span", { className: "k-step-label" }, o && /* @__PURE__ */ e.createElement("span", { className: "k-step-text" }, o), 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);
|
|
131
129
|
return /* @__PURE__ */ e.createElement(
|
|
132
130
|
"li",
|
|
133
131
|
{
|
|
134
132
|
ref: p,
|
|
135
|
-
className:
|
|
136
|
-
style:
|
|
137
|
-
...
|
|
133
|
+
className: K,
|
|
134
|
+
style: q,
|
|
135
|
+
...z
|
|
138
136
|
},
|
|
139
137
|
/* @__PURE__ */ e.createElement(
|
|
140
138
|
"a",
|
|
141
139
|
{
|
|
142
140
|
className: "k-step-link",
|
|
143
141
|
title: o || void 0,
|
|
144
|
-
onClick:
|
|
145
|
-
onFocus:
|
|
146
|
-
|
|
147
|
-
"aria-
|
|
148
|
-
"aria-disabled": n || !N || void 0,
|
|
142
|
+
onClick: $,
|
|
143
|
+
onFocus: j,
|
|
144
|
+
"aria-current": d ? "step" : void 0,
|
|
145
|
+
"aria-disabled": n || !I || void 0,
|
|
149
146
|
"aria-invalid": t !== void 0 && !t || void 0
|
|
150
147
|
},
|
|
151
|
-
|
|
148
|
+
D ? V : X
|
|
152
149
|
)
|
|
153
150
|
);
|
|
154
151
|
});
|
|
155
|
-
|
|
152
|
+
L.propTypes = {
|
|
156
153
|
children: a.any,
|
|
157
154
|
className: a.string,
|
|
158
155
|
// content: PropTypes.any,
|
|
@@ -167,11 +164,10 @@ E.propTypes = {
|
|
|
167
164
|
tabIndex: a.number,
|
|
168
165
|
text: a.string
|
|
169
166
|
};
|
|
170
|
-
const
|
|
167
|
+
const re = {
|
|
171
168
|
tabIndex: 0
|
|
172
169
|
};
|
|
173
|
-
|
|
174
|
-
E.displayName = "KendoStep";
|
|
170
|
+
L.displayName = "KendoStep";
|
|
175
171
|
export {
|
|
176
|
-
|
|
172
|
+
L as Step
|
|
177
173
|
};
|
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("react"),l=require("prop-types"),$=require("./context/StepperContext.js"),d=require("@progress/kendo-react-common"),ee=require("./Step.js"),te=require("@progress/kendo-react-progressbars"),q=require("./contants.js"),se=require("../package-metadata.js"),ne=require("@progress/kendo-react-intl"),D=require("./messages/index.js");function oe(p){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const f in p)if(f!=="default"){const I=Object.getOwnPropertyDescriptor(p,f);Object.defineProperty(y,f,I.get?I:{enumerable:!0,get:()=>p[f]})}}return y.default=p,Object.freeze(y)}const o=oe(Z),O=o.forwardRef((p,y)=>{d.validatePackage(se.packageMetadata);const{animationDuration:f,children:I,className:w,disabled:g,errorIcon:F,errorSVGIcon:L,item:P,items:b,linear:k,mode:z,orientation:S,style:R,successIcon:V,successSVGIcon:j,value:u=0,onChange:h,onFocus:x}=p,_=ne.useLocalization().toLanguageString(D.progBarAriaLabel,D.messages[D.progBarAriaLabel]),v=o.useRef(null),T=o.useCallback(()=>{v.current&&d.focusFirstFocusableChild(v.current)},[]),C=o.useCallback(()=>({element:v.current,focus:T}),[T]);o.useImperativeHandle(y,C);const[K,c]=o.useState(u),m=b?b.length:0,s=S==="vertical",N=d.useDir(v,p.dir),G=typeof f=="number"?f:f!==!1?q.DEFAULT_ANIMATION_DURATION:q.NO_ANIMATION;o.useEffect(()=>{c(u)},[u]);const A=o.useCallback((r,i)=>{const e=i===u-1,t=i===u,a=i===u+1;u!==i&&h&&!g&&(!k||e||t||a)&&(d.dispatchEvent(h,r,C(),{value:i}),c(i))},[u,k,h,g,c]),B=o.useCallback(r=>{let i=r.value,e=r.syntheticEvent;A(e,i)},[A]),H=o.useCallback(r=>{x&&!g&&d.dispatchEvent(x,r.syntheticEvent,C(),void 0)},[x,g]),E=o.useMemo(()=>{const r=N==="rtl",i=b.length-1;return new d.Navigation({root:v,selectors:["ol.k-step-list li.k-step a.k-step-link"],tabIndex:0,keyboardEvents:{keydown:{ArrowLeft:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);!s&&!r&&n>0?(t.focusPrevious(e),c(n-1)):!s&&r&&n<i&&(t.focusNext(e),c(n+1))},ArrowRight:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);!s&&!r&&n<i?(t.focusNext(e),c(n+1)):!s&&r&&n>0&&(t.focusPrevious(e),c(n-1))},ArrowUp:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);s&&!r&&n>0?(t.focusPrevious(e),c(n-1)):s&&r&&n>0&&(t.focusPrevious(e),c(n+1))},ArrowDown:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);s&&!r&&n<i?(t.focusNext(e),c(n+1)):s&&r&&n<i&&(t.focusNext(e),c(n-1))},Tab:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);a.shiftKey?!s&&!r&&n>0?(t.focusPrevious(e),c(n-1)):!s&&r&&n<i&&(t.focusNext(e),c(n+1)):!s&&!r&&n<i?(t.focusNext(e),c(n+1)):!s&&r&&n>0&&(t.focusPrevious(e),c(n-1))},Home:(e,t,a)=>{a.preventDefault(),t.focusElement(t.first,e),c(0)},End:(e,t,a)=>{a.preventDefault(),t.focusElement(t.last,e),c(i)},Space:(e,t,a)=>{a.preventDefault(),e.children[0].click()},Enter:(e,t,a)=>{a.preventDefault(),e.children[0].click()}}}})},[N,b.length,s,c]);o.useEffect(()=>(E.initializeRovingTab(u),()=>E.removeFocusListener()),[]);const U=o.useCallback(E.triggerKeyboardEvent.bind(E),[]),J=o.useMemo(()=>d.classNames("k-stepper",{"k-stepper-linear":k},w),[k,w]),Q=o.useMemo(()=>({display:"grid",gridTemplateColumns:s?void 0:"repeat("+m*2+", 1fr)",gridTemplateRows:s?"repeat("+m+", 1fr)":void 0,...R}),[s,m,R]),W=o.useMemo(()=>d.classNames("k-step-list",{"k-step-list-horizontal":!s,"k-step-list-vertical":s}),[s]),X=o.useMemo(()=>({gridColumnStart:s?void 0:1,gridColumnEnd:s?void 0:-1,gridRowStart:s?1:void 0,gridRowEnd:s?-1:void 0}),[s]),Y=o.useMemo(()=>({gridColumnStart:s?void 0:2,gridColumnEnd:s?void 0:m*2,gridRowStart:s?1:void 0,gridRowEnd:s?m:void 0,top:s?17:void 0}),[s,m]),M=b&&b.map((r,i)=>{const e={index:i,disabled:g||r.disabled,focused:i===K,current:i===u,...r},t=P||ee.Step;return o.createElement(t,{key:i,...e})});return o.createElement($.StepperContext.Provider,{value:{animationDuration:f,isVertical:s,item:P,linear:k,mode:z,numOfSteps:m,value:u,successIcon:V,successSVGIcon:j,errorIcon:F,errorSVGIcon:L,onChange:B,onFocus:H}},o.createElement("nav",{className:J,style:Q,dir:N,role:"navigation",ref:v,onKeyDown:U},o.createElement("ol",{className:W,style:X},M||I),o.createElement(te.ProgressBar,{style:Y,labelPlacement:"start",animation:{duration:G},ariaLabel:_,"aria-hidden":!0,max:m-1,labelVisible:!1,orientation:S,reverse:S==="vertical",value:u,disabled:g,tabIndex:-1})))});O.propTypes={animationDuration:l.oneOfType([l.bool,l.number]),children:l.any,className:l.string,dir:l.string,disabled:l.bool,errorIcon:l.string,errorSVGIcon:d.svgIconPropType,item:l.any,items:l.any,linear:l.bool,mode:l.oneOf(["steps","labels"]),orientation:l.oneOf(["horizontal","vertical"]),style:l.object,successIcon:l.string,successSVGIcon:d.svgIconPropType,value:l.number.isRequired,onChange:l.func,onFocus:l.func};O.displayName="KendoStepper";exports.Stepper=O;
|