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