reactjs-multi-stepper 1.4.1 → 1.5.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/dist/index.es.js +163 -164
- package/package.json +13 -6
package/dist/index.es.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import z, { createContext as se, useContext as
|
|
1
|
+
import z, { createContext as se, useContext as le, useCallback as _, Fragment as $, useState as U, useEffect as ce, useMemo as ie } from "react";
|
|
2
2
|
var P = { exports: {} }, R = {};
|
|
3
3
|
var V;
|
|
4
4
|
function ue() {
|
|
5
5
|
if (V) return R;
|
|
6
6
|
V = 1;
|
|
7
7
|
var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
-
function
|
|
8
|
+
function s(r, i, o) {
|
|
9
9
|
var m = null;
|
|
10
|
-
if (
|
|
11
|
-
|
|
10
|
+
if (o !== void 0 && (m = "" + o), i.key !== void 0 && (m = "" + i.key), "key" in i) {
|
|
11
|
+
o = {};
|
|
12
12
|
for (var v in i)
|
|
13
|
-
v !== "key" && (
|
|
14
|
-
} else
|
|
15
|
-
return i =
|
|
13
|
+
v !== "key" && (o[v] = i[v]);
|
|
14
|
+
} else o = i;
|
|
15
|
+
return i = o.ref, {
|
|
16
16
|
$$typeof: n,
|
|
17
|
-
type:
|
|
17
|
+
type: r,
|
|
18
18
|
key: m,
|
|
19
19
|
ref: i !== void 0 ? i : null,
|
|
20
|
-
props:
|
|
20
|
+
props: o
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return R.Fragment = u, R.jsx =
|
|
23
|
+
return R.Fragment = u, R.jsx = s, R.jsxs = s, R;
|
|
24
24
|
}
|
|
25
25
|
var j = {};
|
|
26
26
|
var q;
|
|
@@ -42,28 +42,28 @@ function fe() {
|
|
|
42
42
|
return "Suspense";
|
|
43
43
|
case ee:
|
|
44
44
|
return "SuspenseList";
|
|
45
|
-
case
|
|
45
|
+
case te:
|
|
46
46
|
return "Activity";
|
|
47
47
|
}
|
|
48
48
|
if (typeof e == "object")
|
|
49
49
|
switch (typeof e.tag == "number" && console.error(
|
|
50
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
51
|
), e.$$typeof) {
|
|
52
|
-
case
|
|
52
|
+
case h:
|
|
53
53
|
return "Portal";
|
|
54
54
|
case Z:
|
|
55
55
|
return e.displayName || "Context";
|
|
56
56
|
case H:
|
|
57
57
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
58
|
case Q:
|
|
59
|
-
var
|
|
60
|
-
return e = e.displayName, e || (e =
|
|
61
|
-
case
|
|
62
|
-
return
|
|
59
|
+
var t = e.render;
|
|
60
|
+
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
+
case re:
|
|
62
|
+
return t = e.displayName || null, t !== null ? t : n(e.type) || "Memo";
|
|
63
63
|
case A:
|
|
64
|
-
|
|
64
|
+
t = e._payload, e = e._init;
|
|
65
65
|
try {
|
|
66
|
-
return n(e(
|
|
66
|
+
return n(e(t));
|
|
67
67
|
} catch {
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -72,30 +72,30 @@ function fe() {
|
|
|
72
72
|
function u(e) {
|
|
73
73
|
return "" + e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function s(e) {
|
|
76
76
|
try {
|
|
77
77
|
u(e);
|
|
78
|
-
var
|
|
78
|
+
var t = !1;
|
|
79
79
|
} catch {
|
|
80
|
-
|
|
80
|
+
t = !0;
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
var
|
|
85
|
-
return
|
|
86
|
-
|
|
82
|
+
if (t) {
|
|
83
|
+
t = console;
|
|
84
|
+
var l = t.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return l.call(
|
|
86
|
+
t,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
-
|
|
88
|
+
d
|
|
89
89
|
), u(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function r(e) {
|
|
93
93
|
if (e === O) return "<>";
|
|
94
94
|
if (typeof e == "object" && e !== null && e.$$typeof === A)
|
|
95
95
|
return "<...>";
|
|
96
96
|
try {
|
|
97
|
-
var
|
|
98
|
-
return
|
|
97
|
+
var t = n(e);
|
|
98
|
+
return t ? "<" + t + ">" : "<...>";
|
|
99
99
|
} catch {
|
|
100
100
|
return "<...>";
|
|
101
101
|
}
|
|
@@ -104,45 +104,45 @@ function fe() {
|
|
|
104
104
|
var e = y.A;
|
|
105
105
|
return e === null ? null : e.getOwner();
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function o() {
|
|
108
108
|
return Error("react-stack-top-frame");
|
|
109
109
|
}
|
|
110
110
|
function m(e) {
|
|
111
111
|
if (F.call(e, "key")) {
|
|
112
|
-
var
|
|
113
|
-
if (
|
|
112
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
|
+
if (t && t.isReactWarning) return !1;
|
|
114
114
|
}
|
|
115
115
|
return e.key !== void 0;
|
|
116
116
|
}
|
|
117
|
-
function v(e,
|
|
118
|
-
function
|
|
117
|
+
function v(e, t) {
|
|
118
|
+
function l() {
|
|
119
119
|
M || (M = !0, console.error(
|
|
120
120
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
|
-
|
|
121
|
+
t
|
|
122
122
|
));
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
get:
|
|
124
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: l,
|
|
126
126
|
configurable: !0
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function T() {
|
|
130
130
|
var e = n(this.type);
|
|
131
131
|
return I[e] || (I[e] = !0, console.error(
|
|
132
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
135
|
+
function S(e, t, l, d, N, C) {
|
|
136
|
+
var p = l.ref;
|
|
137
137
|
return e = {
|
|
138
|
-
$$typeof:
|
|
138
|
+
$$typeof: c,
|
|
139
139
|
type: e,
|
|
140
|
-
key:
|
|
141
|
-
props:
|
|
142
|
-
_owner:
|
|
143
|
-
}, (
|
|
140
|
+
key: t,
|
|
141
|
+
props: l,
|
|
142
|
+
_owner: d
|
|
143
|
+
}, (p !== void 0 ? p : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
145
|
-
get:
|
|
145
|
+
get: T
|
|
146
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
147
147
|
configurable: !1,
|
|
148
148
|
enumerable: !1,
|
|
@@ -165,61 +165,61 @@ function fe() {
|
|
|
165
165
|
value: C
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function x(e,
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
if (oe(
|
|
173
|
-
for (
|
|
174
|
-
k(d
|
|
175
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function x(e, t, l, d, N, C) {
|
|
169
|
+
var p = t.children;
|
|
170
|
+
if (p !== void 0)
|
|
171
|
+
if (d)
|
|
172
|
+
if (oe(p)) {
|
|
173
|
+
for (d = 0; d < p.length; d++)
|
|
174
|
+
k(p[d]);
|
|
175
|
+
Object.freeze && Object.freeze(p);
|
|
176
176
|
} else
|
|
177
177
|
console.error(
|
|
178
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
179
|
);
|
|
180
|
-
else k(
|
|
181
|
-
if (F.call(
|
|
182
|
-
|
|
183
|
-
var
|
|
180
|
+
else k(p);
|
|
181
|
+
if (F.call(t, "key")) {
|
|
182
|
+
p = n(e);
|
|
183
|
+
var E = Object.keys(t).filter(function(ae) {
|
|
184
184
|
return ae !== "key";
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
d = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", W[p + d] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
188
188
|
let props = %s;
|
|
189
189
|
<%s {...props} />
|
|
190
190
|
React keys must be passed directly to JSX without using spread:
|
|
191
191
|
let props = %s;
|
|
192
192
|
<%s key={someKey} {...props} />`,
|
|
193
|
-
f,
|
|
194
193
|
d,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
p,
|
|
195
|
+
E,
|
|
196
|
+
p
|
|
197
|
+
), W[p + d] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
for (var Y in
|
|
202
|
-
Y !== "key" && (
|
|
203
|
-
} else
|
|
204
|
-
return
|
|
205
|
-
|
|
199
|
+
if (p = null, l !== void 0 && (s(l), p = "" + l), m(t) && (s(t.key), p = "" + t.key), "key" in t) {
|
|
200
|
+
l = {};
|
|
201
|
+
for (var Y in t)
|
|
202
|
+
Y !== "key" && (l[Y] = t[Y]);
|
|
203
|
+
} else l = t;
|
|
204
|
+
return p && v(
|
|
205
|
+
l,
|
|
206
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
|
-
),
|
|
207
|
+
), S(
|
|
208
208
|
e,
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
p,
|
|
210
|
+
l,
|
|
211
211
|
i(),
|
|
212
212
|
N,
|
|
213
213
|
C
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
function k(e) {
|
|
217
|
-
|
|
217
|
+
f(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === A && (e._payload.status === "fulfilled" ? f(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
219
|
+
function f(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === c;
|
|
221
221
|
}
|
|
222
|
-
var b = z,
|
|
222
|
+
var b = z, c = /* @__PURE__ */ Symbol.for("react.transitional.element"), h = /* @__PURE__ */ Symbol.for("react.portal"), O = /* @__PURE__ */ Symbol.for("react.fragment"), X = /* @__PURE__ */ Symbol.for("react.strict_mode"), B = /* @__PURE__ */ Symbol.for("react.profiler"), H = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Q = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), ee = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), A = /* @__PURE__ */ Symbol.for("react.lazy"), te = /* @__PURE__ */ Symbol.for("react.activity"), ne = /* @__PURE__ */ Symbol.for("react.client.reference"), y = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, oe = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
223
223
|
return null;
|
|
224
224
|
};
|
|
225
225
|
b = {
|
|
@@ -229,27 +229,27 @@ React keys must be passed directly to JSX without using spread:
|
|
|
229
229
|
};
|
|
230
230
|
var M, I = {}, D = b.react_stack_bottom_frame.bind(
|
|
231
231
|
b,
|
|
232
|
-
|
|
233
|
-
)(), L = w(
|
|
234
|
-
j.Fragment = O, j.jsx = function(e,
|
|
235
|
-
var
|
|
232
|
+
o
|
|
233
|
+
)(), L = w(r(o)), W = {};
|
|
234
|
+
j.Fragment = O, j.jsx = function(e, t, l) {
|
|
235
|
+
var d = 1e4 > y.recentlyCreatedOwnerStacks++;
|
|
236
236
|
return x(
|
|
237
237
|
e,
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
t,
|
|
239
|
+
l,
|
|
240
240
|
!1,
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
d ? Error("react-stack-top-frame") : D,
|
|
242
|
+
d ? w(r(e)) : L
|
|
243
243
|
);
|
|
244
|
-
}, j.jsxs = function(e,
|
|
245
|
-
var
|
|
244
|
+
}, j.jsxs = function(e, t, l) {
|
|
245
|
+
var d = 1e4 > y.recentlyCreatedOwnerStacks++;
|
|
246
246
|
return x(
|
|
247
247
|
e,
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
t,
|
|
249
|
+
l,
|
|
250
250
|
!0,
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
d ? Error("react-stack-top-frame") : D,
|
|
252
|
+
d ? w(r(e)) : L
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
255
|
})()), j;
|
|
@@ -258,38 +258,38 @@ var J;
|
|
|
258
258
|
function de() {
|
|
259
259
|
return J || (J = 1, process.env.NODE_ENV === "production" ? P.exports = ue() : P.exports = fe()), P.exports;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
261
|
+
var a = de();
|
|
262
262
|
const G = se(
|
|
263
263
|
void 0
|
|
264
264
|
), g = () => {
|
|
265
|
-
const n =
|
|
265
|
+
const n = le(G);
|
|
266
266
|
if (!n)
|
|
267
267
|
throw new Error(
|
|
268
268
|
"useMultiStepperForm must be used within a MultiStepperProvider"
|
|
269
269
|
);
|
|
270
270
|
return n;
|
|
271
271
|
}, pe = () => {
|
|
272
|
-
const { steps: n, currentStep: u } = g(),
|
|
273
|
-
return !
|
|
272
|
+
const { steps: n, currentStep: u } = g(), s = n?.[u];
|
|
273
|
+
return !s || !s.children ? null : /* @__PURE__ */ a.jsx("div", { className: "stepper-content", children: s.children });
|
|
274
274
|
}, me = z.memo(({ onClickNext: n }) => {
|
|
275
|
-
const { handlePrevStep: u, currentStep:
|
|
276
|
-
|
|
277
|
-
}, [
|
|
278
|
-
|
|
279
|
-
}, [
|
|
280
|
-
return /* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
275
|
+
const { handlePrevStep: u, currentStep: s, steps: r } = g(), i = s === r.length - 1, o = s === 0, m = _(() => {
|
|
276
|
+
r[s].completed || n();
|
|
277
|
+
}, [r, s, n]), v = _(() => {
|
|
278
|
+
o || u();
|
|
279
|
+
}, [o, u]);
|
|
280
|
+
return /* @__PURE__ */ a.jsxs("div", { className: "stepper-footer", children: [
|
|
281
|
+
/* @__PURE__ */ a.jsx(
|
|
282
282
|
"button",
|
|
283
283
|
{
|
|
284
284
|
type: "button",
|
|
285
285
|
className: `stepper-button
|
|
286
|
-
${
|
|
286
|
+
${o ? "stepper-button-disbled" : ""}`,
|
|
287
287
|
onClick: v,
|
|
288
|
-
disabled:
|
|
288
|
+
disabled: s < 0,
|
|
289
289
|
children: "Prev"
|
|
290
290
|
}
|
|
291
291
|
),
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ a.jsx(
|
|
293
293
|
"button",
|
|
294
294
|
{
|
|
295
295
|
type: "button",
|
|
@@ -303,89 +303,88 @@ const G = se(
|
|
|
303
303
|
step: n,
|
|
304
304
|
index: u
|
|
305
305
|
}) => {
|
|
306
|
-
const { steps:
|
|
307
|
-
return
|
|
306
|
+
const { steps: s, options: r } = g();
|
|
307
|
+
return s.length ? n.completed ? /* @__PURE__ */ a.jsx("div", { className: "step step-complete", children: n.icon ? n.icon : r?.completedIcon ?? /* @__PURE__ */ a.jsx("span", { className: "text-white", children: "✓" }) }) : n.active ? /* @__PURE__ */ a.jsx("div", { className: "step step-active", children: n.icon ? n.icon : r?.activeIcon ?? /* @__PURE__ */ a.jsx("h2", { className: "text-white", children: u }) }) : /* @__PURE__ */ a.jsx("div", { className: "step step-default", children: n.icon ?? /* @__PURE__ */ a.jsx("h2", { children: u }) }) : /* @__PURE__ */ a.jsx($, {});
|
|
308
308
|
}, be = () => {
|
|
309
|
-
const { steps: n, updateSteps: u } = g(),
|
|
310
|
-
return n.length ? /* @__PURE__ */
|
|
311
|
-
const
|
|
312
|
-
return /* @__PURE__ */
|
|
309
|
+
const { steps: n, updateSteps: u } = g(), s = (r) => u(r);
|
|
310
|
+
return n.length ? /* @__PURE__ */ a.jsx("div", { className: "app-container", children: /* @__PURE__ */ a.jsx("ol", { className: "stepper-header", children: n.map((r, i) => {
|
|
311
|
+
const o = !!r.active, m = !!r.completed;
|
|
312
|
+
return /* @__PURE__ */ a.jsxs(
|
|
313
313
|
"div",
|
|
314
314
|
{
|
|
315
|
-
onClick: () =>
|
|
316
|
-
className: `step-item ${
|
|
315
|
+
onClick: () => s(i),
|
|
316
|
+
className: `step-item ${o ? "active" : ""} ${m ? "complete" : ""}`,
|
|
317
317
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
/* @__PURE__ */ a.jsx(ve, { index: i + 1, step: r }),
|
|
319
|
+
/* @__PURE__ */ a.jsxs("div", { className: "step-text", children: [
|
|
320
|
+
r.title && /* @__PURE__ */ a.jsx("h3", { className: "step-title", children: r.title }),
|
|
321
|
+
r.description && /* @__PURE__ */ a.jsx("h3", { className: "step-description", children: r.description })
|
|
322
322
|
] })
|
|
323
323
|
]
|
|
324
324
|
},
|
|
325
|
-
|
|
325
|
+
r.id ?? i
|
|
326
326
|
);
|
|
327
|
-
}) }) }) : /* @__PURE__ */
|
|
328
|
-
},
|
|
327
|
+
}) }) }) : /* @__PURE__ */ a.jsx($, {});
|
|
328
|
+
}, Ee = ({
|
|
329
329
|
onClickNext: n
|
|
330
|
-
}) => /* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
] }),
|
|
335
|
-
const [
|
|
336
|
-
|
|
330
|
+
}) => /* @__PURE__ */ a.jsxs($, { children: [
|
|
331
|
+
/* @__PURE__ */ a.jsx(be, {}),
|
|
332
|
+
/* @__PURE__ */ a.jsx(pe, {}),
|
|
333
|
+
/* @__PURE__ */ a.jsx(me, { onClickNext: n })
|
|
334
|
+
] }), _e = ({ children: n, steppers: u, options: s }) => {
|
|
335
|
+
const [r, i] = U(0), [o, m] = U([]);
|
|
336
|
+
ce(() => {
|
|
337
337
|
if (u.length) {
|
|
338
|
-
const
|
|
339
|
-
|
|
338
|
+
const f = [...u];
|
|
339
|
+
f[0].active = !0, m(f);
|
|
340
340
|
}
|
|
341
341
|
}, [u, u.length]);
|
|
342
|
-
const v =
|
|
343
|
-
m((b) => {
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
(p) => {
|
|
342
|
+
const v = _((f) => {
|
|
343
|
+
f < 0 || f > o.length - 1 || (m((b) => {
|
|
344
|
+
const c = [...b];
|
|
345
|
+
c[r] && (c[r] = { ...c[r], active: !1 }), c[f] && (c[f] = { ...c[f], active: !0 });
|
|
346
|
+
for (let h = 0; h < f; h++)
|
|
347
|
+
c[h] = { ...c[h], completed: !0 };
|
|
348
|
+
for (let h = f; h < c.length; h++)
|
|
349
|
+
c[h] = { ...c[h], completed: !1 };
|
|
350
|
+
return c;
|
|
351
|
+
}), i(f));
|
|
352
|
+
}, [r, o.length]), T = _(() => {
|
|
353
|
+
o.length && (r < o.length - 1 ? v(r + 1) : m((f) => {
|
|
354
|
+
const b = [...f];
|
|
355
|
+
return b[r] ? (b[r] = { ...b[r], completed: !0 }, b) : f;
|
|
356
|
+
}));
|
|
357
|
+
}, [r, o.length, v]), S = _(() => {
|
|
358
|
+
r > 0 && v(r - 1);
|
|
359
|
+
}, [r, v]), x = _(
|
|
360
|
+
(f) => {
|
|
362
361
|
m((b) => {
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
-
...
|
|
362
|
+
const c = [...b];
|
|
363
|
+
return c[r] && (c[r] = {
|
|
364
|
+
...c[r],
|
|
366
365
|
active: !1,
|
|
367
366
|
completed: !1
|
|
368
|
-
},
|
|
367
|
+
}, c[r][f] = !0), c;
|
|
369
368
|
});
|
|
370
369
|
},
|
|
371
|
-
[
|
|
370
|
+
[r]
|
|
372
371
|
), k = ie(
|
|
373
372
|
() => ({
|
|
374
|
-
currentStep:
|
|
375
|
-
steps:
|
|
376
|
-
handleNextStep:
|
|
377
|
-
handlePrevStep:
|
|
373
|
+
currentStep: r,
|
|
374
|
+
steps: o,
|
|
375
|
+
handleNextStep: T,
|
|
376
|
+
handlePrevStep: S,
|
|
378
377
|
updateSteps: v,
|
|
379
378
|
setStepStatus: x,
|
|
380
379
|
// styles,
|
|
381
|
-
options:
|
|
380
|
+
options: s
|
|
382
381
|
}),
|
|
383
|
-
[
|
|
382
|
+
[r, o, T, S, v, x, s]
|
|
384
383
|
);
|
|
385
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ a.jsx(G.Provider, { value: k, children: n });
|
|
386
385
|
};
|
|
387
386
|
export {
|
|
388
|
-
|
|
389
|
-
|
|
387
|
+
Ee as MultiStepper,
|
|
388
|
+
_e as MultiStepperProvider,
|
|
390
389
|
g as useMultiStepper
|
|
391
390
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactjs-multi-stepper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/reactjs-multi-stepper.es.js",
|
|
6
6
|
"module": "./dist/reactjs-multi-stepper.es.js",
|
|
@@ -29,22 +29,26 @@
|
|
|
29
29
|
"test": "vitest",
|
|
30
30
|
"test:coverage": "vitest run --coverage",
|
|
31
31
|
"typecheck": "tsc --noEmit",
|
|
32
|
-
"preview": "vite preview"
|
|
33
|
-
|
|
34
|
-
"dependencies": {
|
|
32
|
+
"preview": "vite preview",
|
|
33
|
+
"format": "prettier --write ."
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@eslint/js": "^9.39.1",
|
|
37
|
+
"@microsoft/api-extractor": "^7.48.0",
|
|
38
38
|
"@testing-library/jest-dom": "^6.9.1",
|
|
39
39
|
"@testing-library/react": "^16.3.2",
|
|
40
40
|
"@types/node": "^25.1.0",
|
|
41
41
|
"@types/react": "^19.2.5",
|
|
42
42
|
"@types/react-dom": "^19.2.3",
|
|
43
43
|
"@vitejs/plugin-react": "^5.1.2",
|
|
44
|
+
"@vitejs/plugin-react-swc": "^4.2.3",
|
|
45
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
44
46
|
"eslint": "^9.39.1",
|
|
45
47
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
46
48
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
47
49
|
"globals": "^16.5.0",
|
|
50
|
+
"jsdom": "^28.1.0",
|
|
51
|
+
"prettier": "^3.4.2",
|
|
48
52
|
"react": "^18.0.0 || ^19.2.0",
|
|
49
53
|
"react-dom": "^18.0.0 || ^19.2.0",
|
|
50
54
|
"rollup-plugin-visualizer": "^6.0.5",
|
|
@@ -53,12 +57,15 @@
|
|
|
53
57
|
"vite-plugin-dts": "^4.5.4",
|
|
54
58
|
"vitest": "^4.0.18"
|
|
55
59
|
},
|
|
60
|
+
"overrides": {
|
|
61
|
+
"minimatch": "^9.0.5"
|
|
62
|
+
},
|
|
56
63
|
"repository": {
|
|
57
|
-
"url": "https://github.com/UppiliSrinivas/react-stepper
|
|
64
|
+
"url": "https://github.com/UppiliSrinivas/react-stepper"
|
|
58
65
|
},
|
|
59
66
|
"license": "ISC",
|
|
60
67
|
"peerDependencies": {
|
|
61
68
|
"react": "^18.0.0 || ^19.2.0",
|
|
62
69
|
"react-dom": "^18.0.0 || ^19.2.0"
|
|
63
70
|
}
|
|
64
|
-
}
|
|
71
|
+
}
|