@progress/kendo-react-layout 8.2.1-develop.5 → 8.3.0-develop.10

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.
@@ -7,83 +7,84 @@
7
7
  */
8
8
  "use client";
9
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
- import { ProgressBar as re } from "@progress/kendo-react-progressbars";
15
- import { DEFAULT_ANIMATION_DURATION as ie, NO_ANIMATION as le } from "./contants.mjs";
16
- import { packageMetadata as ae } from "../package-metadata.mjs";
17
- import { useLocalization as ce } from "@progress/kendo-react-intl";
18
- import { progBarAriaLabel as T, messages as ue } from "./messages/index.mjs";
19
- const F = n.forwardRef((x, M) => {
20
- ee(ae);
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: L,
24
- className: C,
23
+ children: K,
24
+ className: S,
25
25
  disabled: f,
26
- errorIcon: V,
27
- errorSVGIcon: z,
28
- item: S,
26
+ errorIcon: G,
27
+ errorSVGIcon: H,
28
+ item: N,
29
29
  items: m,
30
30
  linear: g,
31
- mode: K,
32
- orientation: I,
33
- style: N,
34
- successIcon: G,
35
- successSVGIcon: H,
31
+ mode: U,
32
+ orientation: E,
33
+ selectOnFocus: b,
34
+ style: w,
35
+ successIcon: _,
36
+ successSVGIcon: B,
36
37
  value: u = 0,
37
- onChange: k,
38
- onFocus: y
39
- } = x, U = ce().toLanguageString(T, ue[T]), p = n.useRef(null), w = n.useCallback(
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 && te(p.current);
42
+ p.current && ne(p.current);
42
43
  },
43
44
  []
44
- ), E = n.useCallback(
45
+ ), x = n.useCallback(
45
46
  () => ({
46
47
  element: p.current,
47
- focus: w
48
+ focus: D
48
49
  }),
49
- [w]
50
+ [D]
50
51
  );
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;
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
- a(u);
55
+ c(u);
55
56
  }, [u]);
56
- const D = n.useCallback(
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 && k && !f && (!g || e || t || l) && (O(
60
- k,
60
+ u !== i && I && !f && (!g || e || t || l) && (T(
61
+ I,
61
62
  r,
62
- E(),
63
+ x(),
63
64
  { value: i }
64
- ), a(i));
65
+ ), c(i));
65
66
  },
66
- [u, g, k, f, a]
67
- ), j = n.useCallback(
67
+ [u, g, I, f, c]
68
+ ), Q = n.useCallback(
68
69
  (r) => {
69
70
  let i = r.value, e = r.syntheticEvent;
70
- D(e, i);
71
+ O(e, i);
71
72
  },
72
- [D]
73
- ), q = n.useCallback(
73
+ [O]
74
+ ), W = n.useCallback(
74
75
  (r) => {
75
- y && !f && O(
76
- y,
76
+ h && !f && T(
77
+ h,
77
78
  r.syntheticEvent,
78
- E(),
79
+ x(),
79
80
  void 0
80
81
  );
81
82
  },
82
- [y, f]
83
- ), b = n.useMemo(
83
+ [h, f]
84
+ ), k = n.useMemo(
84
85
  () => {
85
- const r = h === "rtl", i = m.length - 1;
86
- return new se({
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), a(s - 1)) : !o && r && s < i && (t.focusNext(e), a(s + 1));
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), a(s + 1)) : !o && r && s > 0 && (t.focusPrevious(e), a(s - 1));
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), a(s - 1)) : o && r && s > 0 && (t.focusPrevious(e), a(s + 1));
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), a(s + 1)) : o && r && s < i && (t.focusNext(e), a(s - 1));
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), 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));
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), a(0);
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), a(i);
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
- [h, m.length, o, a]
134
+ [y, m.length, o, c]
134
135
  );
135
- n.useEffect(() => (b.initializeRovingTab(u), () => b.removeFocusListener()), []);
136
- const J = n.useCallback(b.triggerKeyboardEvent.bind(b), []), Q = n.useMemo(
137
- () => P(
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
- C
143
+ S
143
144
  ),
144
- [g, C]
145
- ), W = n.useMemo(
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
- ...N
151
+ ...w
151
152
  }),
152
- [o, d, N]
153
- ), X = n.useMemo(
154
- () => P(
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
- ), Y = n.useMemo(
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
- ), Z = n.useMemo(
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 = S || ne;
187
+ }, t = N || le;
187
188
  return /* @__PURE__ */ n.createElement(t, { key: i, ...e });
188
189
  });
189
190
  return /* @__PURE__ */ n.createElement(
190
- $.Provider,
191
+ oe.Provider,
191
192
  {
192
193
  value: {
193
194
  animationDuration: v,
194
195
  isVertical: o,
195
- item: S,
196
+ item: N,
196
197
  linear: g,
197
- mode: K,
198
+ mode: U,
198
199
  numOfSteps: d,
199
200
  value: u,
200
- successIcon: G,
201
- successSVGIcon: H,
202
- errorIcon: V,
203
- errorSVGIcon: z,
204
- onChange: j,
205
- onFocus: q
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: Q,
212
- style: W,
213
- dir: h,
212
+ className: Y,
213
+ style: Z,
214
+ dir: y,
214
215
  role: "navigation",
215
216
  ref: p,
216
- onKeyDown: J
217
+ onKeyDown: X
217
218
  },
218
219
  /* @__PURE__ */ n.createElement(
219
220
  "ol",
220
221
  {
221
- className: X,
222
- style: Y
222
+ className: $,
223
+ style: ee
223
224
  },
224
- R || L
225
+ R || K
225
226
  ),
226
227
  /* @__PURE__ */ n.createElement(
227
- re,
228
+ ce,
228
229
  {
229
- style: Z,
230
+ style: te,
230
231
  labelPlacement: "start",
231
- animation: { duration: B },
232
- ariaLabel: U,
232
+ animation: { duration: J },
233
+ ariaLabel: j,
233
234
  "aria-hidden": !0,
234
235
  max: d - 1,
235
236
  labelVisible: !1,
236
- orientation: I,
237
- reverse: I === "vertical",
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
- 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
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
- F.displayName = "KendoStepper";
267
+ V.displayName = "KendoStepper";
267
268
  export {
268
- F as Stepper
269
+ V as Stepper
269
270
  };