@progress/kendo-react-layout 8.1.0-develop.13 → 8.1.0-develop.15
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/dist/cdn/js/kendo-react-layout.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +74 -77
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +179 -163
package/stepper/Stepper.mjs
CHANGED
|
@@ -6,134 +6,152 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { StepperContext as
|
|
12
|
-
import { validatePackage as
|
|
13
|
-
import { Step as
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import c from "prop-types";
|
|
11
|
+
import { StepperContext as $ } from "./context/StepperContext.mjs";
|
|
12
|
+
import { validatePackage as ee, focusFirstFocusableChild as te, useDir as oe, dispatchEvent as O, Navigation as se, classNames as P, svgIconPropType as A } from "@progress/kendo-react-common";
|
|
13
|
+
import { Step as ne } from "./Step.mjs";
|
|
14
14
|
import { ProgressBar as re } from "@progress/kendo-react-progressbars";
|
|
15
|
-
import { DEFAULT_ANIMATION_DURATION as
|
|
16
|
-
import { packageMetadata as
|
|
15
|
+
import { DEFAULT_ANIMATION_DURATION as ie, NO_ANIMATION as le } from "./contants.mjs";
|
|
16
|
+
import { packageMetadata as ae } from "../package-metadata.mjs";
|
|
17
17
|
import { useLocalization as ce } from "@progress/kendo-react-intl";
|
|
18
|
-
import { progBarAriaLabel as
|
|
19
|
-
const
|
|
20
|
-
|
|
18
|
+
import { progBarAriaLabel as T, messages as ue } from "./messages/index.mjs";
|
|
19
|
+
const F = n.forwardRef((x, M) => {
|
|
20
|
+
ee(ae);
|
|
21
21
|
const {
|
|
22
|
-
animationDuration:
|
|
22
|
+
animationDuration: v,
|
|
23
23
|
children: L,
|
|
24
|
-
className:
|
|
25
|
-
disabled:
|
|
26
|
-
errorIcon:
|
|
27
|
-
errorSVGIcon:
|
|
28
|
-
item:
|
|
29
|
-
items:
|
|
30
|
-
linear:
|
|
24
|
+
className: C,
|
|
25
|
+
disabled: f,
|
|
26
|
+
errorIcon: V,
|
|
27
|
+
errorSVGIcon: z,
|
|
28
|
+
item: S,
|
|
29
|
+
items: m,
|
|
30
|
+
linear: g,
|
|
31
31
|
mode: K,
|
|
32
|
-
orientation:
|
|
33
|
-
style:
|
|
34
|
-
successIcon:
|
|
35
|
-
successSVGIcon:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
orientation: I,
|
|
33
|
+
style: N,
|
|
34
|
+
successIcon: G,
|
|
35
|
+
successSVGIcon: H,
|
|
36
|
+
value: u = 0,
|
|
37
|
+
onChange: k,
|
|
38
|
+
onFocus: y
|
|
39
|
+
} = x, U = ce().toLanguageString(T, ue[T]), p = n.useRef(null), w = n.useCallback(
|
|
39
40
|
() => {
|
|
40
|
-
|
|
41
|
+
p.current && te(p.current);
|
|
41
42
|
},
|
|
42
43
|
[]
|
|
43
|
-
),
|
|
44
|
+
), E = n.useCallback(
|
|
44
45
|
() => ({
|
|
45
|
-
element:
|
|
46
|
+
element: p.current,
|
|
46
47
|
focus: w
|
|
47
48
|
}),
|
|
48
49
|
[w]
|
|
49
50
|
);
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
const
|
|
56
|
-
(
|
|
57
|
-
const e =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{ value:
|
|
63
|
-
),
|
|
51
|
+
n.useImperativeHandle(M, E);
|
|
52
|
+
const [_, a] = n.useState(u), d = m ? m.length : 0, o = I === "vertical", h = oe(p, x.dir), B = typeof v == "number" ? v : v !== !1 ? ie : le;
|
|
53
|
+
n.useEffect(() => {
|
|
54
|
+
a(u);
|
|
55
|
+
}, [u]);
|
|
56
|
+
const D = n.useCallback(
|
|
57
|
+
(r, i) => {
|
|
58
|
+
const e = i === u - 1, t = i === u, l = i === u + 1;
|
|
59
|
+
u !== i && k && !f && (!g || e || t || l) && (O(
|
|
60
|
+
k,
|
|
61
|
+
r,
|
|
62
|
+
E(),
|
|
63
|
+
{ value: i }
|
|
64
|
+
), a(i));
|
|
64
65
|
},
|
|
65
|
-
[
|
|
66
|
-
), j =
|
|
67
|
-
(
|
|
68
|
-
let
|
|
69
|
-
|
|
66
|
+
[u, g, k, f, a]
|
|
67
|
+
), j = n.useCallback(
|
|
68
|
+
(r) => {
|
|
69
|
+
let i = r.value, e = r.syntheticEvent;
|
|
70
|
+
D(e, i);
|
|
70
71
|
},
|
|
71
|
-
[
|
|
72
|
-
), q =
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
[D]
|
|
73
|
+
), q = n.useCallback(
|
|
74
|
+
(r) => {
|
|
75
|
+
y && !f && O(
|
|
76
|
+
y,
|
|
77
|
+
r.syntheticEvent,
|
|
78
|
+
E(),
|
|
78
79
|
void 0
|
|
79
80
|
);
|
|
80
81
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
82
|
+
[y, f]
|
|
83
|
+
), b = n.useMemo(
|
|
84
|
+
() => {
|
|
85
|
+
const r = h === "rtl", i = m.length - 1;
|
|
86
|
+
return new se({
|
|
87
|
+
root: p,
|
|
88
|
+
selectors: ["ol.k-step-list li.k-step a.k-step-link"],
|
|
89
|
+
tabIndex: 0,
|
|
90
|
+
keyboardEvents: {
|
|
91
|
+
keydown: {
|
|
92
|
+
ArrowLeft: (e, t, l) => {
|
|
93
|
+
l.preventDefault();
|
|
94
|
+
const s = t.elements.indexOf(e);
|
|
95
|
+
!o && !r && s > 0 ? (t.focusPrevious(e), a(s - 1)) : !o && r && s < i && (t.focusNext(e), a(s + 1));
|
|
96
|
+
},
|
|
97
|
+
ArrowRight: (e, t, l) => {
|
|
98
|
+
l.preventDefault();
|
|
99
|
+
const s = t.elements.indexOf(e);
|
|
100
|
+
!o && !r && s < i ? (t.focusNext(e), a(s + 1)) : !o && r && s > 0 && (t.focusPrevious(e), a(s - 1));
|
|
101
|
+
},
|
|
102
|
+
ArrowUp: (e, t, l) => {
|
|
103
|
+
l.preventDefault();
|
|
104
|
+
const s = t.elements.indexOf(e);
|
|
105
|
+
o && !r && s > 0 ? (t.focusPrevious(e), a(s - 1)) : o && r && s > 0 && (t.focusPrevious(e), a(s + 1));
|
|
106
|
+
},
|
|
107
|
+
ArrowDown: (e, t, l) => {
|
|
108
|
+
l.preventDefault();
|
|
109
|
+
const s = t.elements.indexOf(e);
|
|
110
|
+
o && !r && s < i ? (t.focusNext(e), a(s + 1)) : o && r && s < i && (t.focusNext(e), a(s - 1));
|
|
111
|
+
},
|
|
112
|
+
Tab: (e, t, l) => {
|
|
113
|
+
l.preventDefault();
|
|
114
|
+
const s = t.elements.indexOf(e);
|
|
115
|
+
l.shiftKey ? !o && !r && s > 0 ? (t.focusPrevious(e), a(s - 1)) : !o && r && s < i && (t.focusNext(e), a(s + 1)) : !o && !r && s < i ? (t.focusNext(e), a(s + 1)) : !o && r && s > 0 && (t.focusPrevious(e), a(s - 1));
|
|
116
|
+
},
|
|
117
|
+
Home: (e, t, l) => {
|
|
118
|
+
l.preventDefault(), t.focusElement(t.first, e), a(0);
|
|
119
|
+
},
|
|
120
|
+
End: (e, t, l) => {
|
|
121
|
+
l.preventDefault(), t.focusElement(t.last, e), a(i);
|
|
122
|
+
},
|
|
123
|
+
Space: (e, t, l) => {
|
|
124
|
+
l.preventDefault(), e.children[0].click();
|
|
125
|
+
},
|
|
126
|
+
Enter: (e, t, l) => {
|
|
127
|
+
l.preventDefault(), e.children[0].click();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
116
132
|
},
|
|
117
|
-
[
|
|
118
|
-
)
|
|
119
|
-
|
|
133
|
+
[h, m.length, o, a]
|
|
134
|
+
);
|
|
135
|
+
n.useEffect(() => (b.initializeRovingTab(u), () => b.removeFocusListener()), []);
|
|
136
|
+
const J = n.useCallback(b.triggerKeyboardEvent.bind(b), []), Q = n.useMemo(
|
|
137
|
+
() => P(
|
|
120
138
|
"k-stepper",
|
|
121
139
|
{
|
|
122
|
-
"k-stepper-linear":
|
|
140
|
+
"k-stepper-linear": g
|
|
123
141
|
},
|
|
124
|
-
|
|
142
|
+
C
|
|
125
143
|
),
|
|
126
|
-
[
|
|
127
|
-
), W =
|
|
144
|
+
[g, C]
|
|
145
|
+
), W = n.useMemo(
|
|
128
146
|
() => ({
|
|
129
147
|
display: "grid",
|
|
130
|
-
gridTemplateColumns: o ? void 0 : "repeat(" +
|
|
131
|
-
gridTemplateRows: o ? "repeat(" +
|
|
132
|
-
...
|
|
148
|
+
gridTemplateColumns: o ? void 0 : "repeat(" + d * 2 + ", 1fr)",
|
|
149
|
+
gridTemplateRows: o ? "repeat(" + d + ", 1fr)" : void 0,
|
|
150
|
+
...N
|
|
133
151
|
}),
|
|
134
|
-
[o,
|
|
135
|
-
), X =
|
|
136
|
-
() =>
|
|
152
|
+
[o, d, N]
|
|
153
|
+
), X = n.useMemo(
|
|
154
|
+
() => P(
|
|
137
155
|
"k-step-list",
|
|
138
156
|
{
|
|
139
157
|
"k-step-list-horizontal": !o,
|
|
@@ -141,7 +159,7 @@ const E = a.forwardRef((k, V) => {
|
|
|
141
159
|
}
|
|
142
160
|
),
|
|
143
161
|
[o]
|
|
144
|
-
), Y =
|
|
162
|
+
), Y = n.useMemo(
|
|
145
163
|
() => ({
|
|
146
164
|
gridColumnStart: o ? void 0 : 1,
|
|
147
165
|
gridColumnEnd: o ? void 0 : -1,
|
|
@@ -149,105 +167,103 @@ const E = a.forwardRef((k, V) => {
|
|
|
149
167
|
gridRowEnd: o ? -1 : void 0
|
|
150
168
|
}),
|
|
151
169
|
[o]
|
|
152
|
-
), Z =
|
|
170
|
+
), Z = n.useMemo(
|
|
153
171
|
() => ({
|
|
154
172
|
gridColumnStart: o ? void 0 : 2,
|
|
155
|
-
gridColumnEnd: o ? void 0 :
|
|
173
|
+
gridColumnEnd: o ? void 0 : d * 2,
|
|
156
174
|
gridRowStart: o ? 1 : void 0,
|
|
157
|
-
gridRowEnd: o ?
|
|
175
|
+
gridRowEnd: o ? d : void 0,
|
|
158
176
|
top: o ? 17 : void 0
|
|
159
177
|
}),
|
|
160
|
-
[o,
|
|
161
|
-
),
|
|
178
|
+
[o, d]
|
|
179
|
+
), R = m && m.map((r, i) => {
|
|
162
180
|
const e = {
|
|
163
|
-
index:
|
|
164
|
-
disabled:
|
|
165
|
-
focused:
|
|
166
|
-
current:
|
|
167
|
-
...
|
|
168
|
-
},
|
|
169
|
-
return /* @__PURE__ */
|
|
181
|
+
index: i,
|
|
182
|
+
disabled: f || r.disabled,
|
|
183
|
+
focused: i === _,
|
|
184
|
+
current: i === u,
|
|
185
|
+
...r
|
|
186
|
+
}, t = S || ne;
|
|
187
|
+
return /* @__PURE__ */ n.createElement(t, { key: i, ...e });
|
|
170
188
|
});
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
|
|
189
|
+
return /* @__PURE__ */ n.createElement(
|
|
190
|
+
$.Provider,
|
|
173
191
|
{
|
|
174
192
|
value: {
|
|
175
|
-
animationDuration:
|
|
193
|
+
animationDuration: v,
|
|
176
194
|
isVertical: o,
|
|
177
|
-
item:
|
|
178
|
-
linear:
|
|
195
|
+
item: S,
|
|
196
|
+
linear: g,
|
|
179
197
|
mode: K,
|
|
180
|
-
numOfSteps:
|
|
181
|
-
value:
|
|
182
|
-
successIcon:
|
|
183
|
-
successSVGIcon:
|
|
184
|
-
errorIcon:
|
|
185
|
-
errorSVGIcon:
|
|
198
|
+
numOfSteps: d,
|
|
199
|
+
value: u,
|
|
200
|
+
successIcon: G,
|
|
201
|
+
successSVGIcon: H,
|
|
202
|
+
errorIcon: V,
|
|
203
|
+
errorSVGIcon: z,
|
|
186
204
|
onChange: j,
|
|
187
205
|
onFocus: q
|
|
188
206
|
}
|
|
189
207
|
},
|
|
190
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ n.createElement(
|
|
191
209
|
"nav",
|
|
192
210
|
{
|
|
193
211
|
className: Q,
|
|
194
212
|
style: W,
|
|
195
|
-
dir:
|
|
213
|
+
dir: h,
|
|
214
|
+
role: "navigation",
|
|
215
|
+
ref: p,
|
|
196
216
|
onKeyDown: J
|
|
197
217
|
},
|
|
198
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ n.createElement(
|
|
199
219
|
"ol",
|
|
200
220
|
{
|
|
201
221
|
className: X,
|
|
202
222
|
style: Y
|
|
203
223
|
},
|
|
204
|
-
|
|
224
|
+
R || L
|
|
205
225
|
),
|
|
206
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ n.createElement(
|
|
207
227
|
re,
|
|
208
228
|
{
|
|
209
229
|
style: Z,
|
|
210
230
|
labelPlacement: "start",
|
|
211
|
-
animation: { duration:
|
|
212
|
-
ariaLabel:
|
|
231
|
+
animation: { duration: B },
|
|
232
|
+
ariaLabel: U,
|
|
213
233
|
"aria-hidden": !0,
|
|
214
|
-
max:
|
|
234
|
+
max: d - 1,
|
|
215
235
|
labelVisible: !1,
|
|
216
|
-
orientation:
|
|
217
|
-
reverse:
|
|
218
|
-
value:
|
|
219
|
-
disabled:
|
|
236
|
+
orientation: I,
|
|
237
|
+
reverse: I === "vertical",
|
|
238
|
+
value: u,
|
|
239
|
+
disabled: f,
|
|
220
240
|
tabIndex: -1
|
|
221
241
|
}
|
|
222
242
|
)
|
|
223
243
|
)
|
|
224
244
|
);
|
|
225
245
|
});
|
|
226
|
-
|
|
227
|
-
animationDuration:
|
|
228
|
-
children:
|
|
229
|
-
className:
|
|
230
|
-
dir:
|
|
231
|
-
disabled:
|
|
232
|
-
errorIcon:
|
|
233
|
-
errorSVGIcon:
|
|
234
|
-
item:
|
|
235
|
-
items:
|
|
236
|
-
linear:
|
|
237
|
-
mode:
|
|
238
|
-
orientation:
|
|
239
|
-
style:
|
|
240
|
-
successIcon:
|
|
241
|
-
successSVGIcon:
|
|
242
|
-
value:
|
|
243
|
-
onChange:
|
|
244
|
-
onFocus:
|
|
245
|
-
};
|
|
246
|
-
const O = {
|
|
247
|
-
value: 0
|
|
246
|
+
F.propTypes = {
|
|
247
|
+
animationDuration: c.oneOfType([c.bool, c.number]),
|
|
248
|
+
children: c.any,
|
|
249
|
+
className: c.string,
|
|
250
|
+
dir: c.string,
|
|
251
|
+
disabled: c.bool,
|
|
252
|
+
errorIcon: c.string,
|
|
253
|
+
errorSVGIcon: A,
|
|
254
|
+
item: c.any,
|
|
255
|
+
items: c.any,
|
|
256
|
+
linear: c.bool,
|
|
257
|
+
mode: c.oneOf(["steps", "labels"]),
|
|
258
|
+
orientation: c.oneOf(["horizontal", "vertical"]),
|
|
259
|
+
style: c.object,
|
|
260
|
+
successIcon: c.string,
|
|
261
|
+
successSVGIcon: A,
|
|
262
|
+
value: c.number.isRequired,
|
|
263
|
+
onChange: c.func,
|
|
264
|
+
onFocus: c.func
|
|
248
265
|
};
|
|
249
|
-
|
|
250
|
-
E.displayName = "KendoStepper";
|
|
266
|
+
F.displayName = "KendoStepper";
|
|
251
267
|
export {
|
|
252
|
-
|
|
268
|
+
F as Stepper
|
|
253
269
|
};
|