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