@mailstep/design-system 0.6.75-beta.4 → 0.6.75-beta.6
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/package.json
CHANGED
|
@@ -8,6 +8,7 @@ export var Stepper = function (_a) {
|
|
|
8
8
|
useEffect(function () {
|
|
9
9
|
var _a;
|
|
10
10
|
if (!!activeStep && !((_a = items[activeStep - 1]) === null || _a === void 0 ? void 0 : _a.completed)) {
|
|
11
|
+
console.log('USE EFFECT RESET');
|
|
11
12
|
handleChangeStep === null || handleChangeStep === void 0 ? void 0 : handleChangeStep(0)();
|
|
12
13
|
}
|
|
13
14
|
}, [items]);
|
|
@@ -4,6 +4,7 @@ export var useStepper = function (_a) {
|
|
|
4
4
|
var _b = useState(0), activeStep = _b[0], setActiveStep = _b[1];
|
|
5
5
|
var _c = useState(false), isSuccess = _c[0], setSuccess = _c[1];
|
|
6
6
|
var handleReset = useCallback(function () {
|
|
7
|
+
console.log('RESET');
|
|
7
8
|
setActiveStep(0);
|
|
8
9
|
setSuccess(false);
|
|
9
10
|
}, []);
|
|
@@ -15,9 +16,11 @@ export var useStepper = function (_a) {
|
|
|
15
16
|
setSuccess(true);
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
19
|
+
console.log('SET ACTIVE STEP', activeStep + 1);
|
|
18
20
|
setActiveStep(activeStep + 1);
|
|
19
21
|
}, [activeStep, totalSteps, handleReset]);
|
|
20
22
|
var handleChangeStep = useCallback(function (step) { return function () {
|
|
23
|
+
console.log('handleChangeStep');
|
|
21
24
|
setActiveStep(step);
|
|
22
25
|
}; }, []);
|
|
23
26
|
return { activeStep: activeStep, handleChangeStep: handleChangeStep, handleGoToNextStep: handleGoToNextStep, isSuccess: isSuccess, handleReset: handleReset };
|
package/ui/index.es.js
CHANGED
|
@@ -51722,7 +51722,7 @@ const vke = /* @__PURE__ */ Da(gke), mke = st`
|
|
|
51722
51722
|
}, [e, t]);
|
|
51723
51723
|
return At(() => {
|
|
51724
51724
|
var c;
|
|
51725
|
-
t && !((c = e[t - 1]) != null && c.completed) && (n == null || n(0)());
|
|
51725
|
+
t && !((c = e[t - 1]) != null && c.completed) && (console.log("USE EFFECT RESET"), n == null || n(0)());
|
|
51726
51726
|
}, [e]), e != null && e.length ? /* @__PURE__ */ g.jsxs(xke, { children: [
|
|
51727
51727
|
/* @__PURE__ */ g.jsx(Ske, { total: e.length, hasComponent: !!l, children: e.map(({
|
|
51728
51728
|
title: c,
|
|
@@ -51737,15 +51737,15 @@ const vke = /* @__PURE__ */ Da(gke), mke = st`
|
|
|
51737
51737
|
totalSteps: e
|
|
51738
51738
|
}) => {
|
|
51739
51739
|
const [t, r] = Fe(0), [n, i] = Fe(!1), o = Ce(() => {
|
|
51740
|
-
r(0), i(!1);
|
|
51740
|
+
console.log("RESET"), r(0), i(!1);
|
|
51741
51741
|
}, []), l = Ce(() => {
|
|
51742
51742
|
if (console.log("handleGoToNextStep"), t + 1 === e) {
|
|
51743
51743
|
console.log("success, reset"), o(), i(!0);
|
|
51744
51744
|
return;
|
|
51745
51745
|
}
|
|
51746
|
-
r(t + 1);
|
|
51746
|
+
console.log("SET ACTIVE STEP", t + 1), r(t + 1);
|
|
51747
51747
|
}, [t, e, o]), c = Ce((u) => () => {
|
|
51748
|
-
r(u);
|
|
51748
|
+
console.log("handleChangeStep"), r(u);
|
|
51749
51749
|
}, []);
|
|
51750
51750
|
return {
|
|
51751
51751
|
activeStep: t,
|
package/ui/index.umd.js
CHANGED
|
@@ -3953,7 +3953,7 @@ ${$.current.stack}
|
|
|
3953
3953
|
flex-direction: row;
|
|
3954
3954
|
width: auto;
|
|
3955
3955
|
}
|
|
3956
|
-
`,COe=({items:e,activeStep:t,hasStepNumbering:r,handleChangeStep:n,handleGoToNextStep:i,isLoading:o})=>{const l=I.useMemo(()=>{var u;return(u=e[t])==null?void 0:u.component},[e,t]);return I.useEffect(()=>{var u;t&&!((u=e[t-1])!=null&&u.completed)&&(n==null||n(0)())},[e]),e!=null&&e.length?g.jsxs(bOe,{children:[g.jsx(yOe,{total:e.length,hasComponent:!!l,children:e.map(({title:u,disabled:c,visible:f,completed:A,icon:p},v)=>g.jsx(mOe,{onClick:n==null?void 0:n(v),title:u,index:v,total:e.length,activeStep:t,disabled:c,visible:f,completed:A,hasStepNumbering:r,icon:p},u))}),l&&g.jsx(l,{handleGoToNextStep:i,isLoading:o})]}):null},wOe=({totalSteps:e})=>{const[t,r]=I.useState(0),[n,i]=I.useState(!1),o=I.useCallback(()=>{r(0),i(!1)},[]),l=I.useCallback(()=>{if(console.log("handleGoToNextStep"),t+1===e){console.log("success, reset"),o(),i(!0);return}r(t+1)},[t,e,o]),u=I.useCallback(c=>()=>{r(c)},[]);return{activeStep:t,handleChangeStep:u,handleGoToNextStep:l,isSuccess:n,handleReset:o}},xOe=ee(tt.div)`
|
|
3956
|
+
`,COe=({items:e,activeStep:t,hasStepNumbering:r,handleChangeStep:n,handleGoToNextStep:i,isLoading:o})=>{const l=I.useMemo(()=>{var u;return(u=e[t])==null?void 0:u.component},[e,t]);return I.useEffect(()=>{var u;t&&!((u=e[t-1])!=null&&u.completed)&&(console.log("USE EFFECT RESET"),n==null||n(0)())},[e]),e!=null&&e.length?g.jsxs(bOe,{children:[g.jsx(yOe,{total:e.length,hasComponent:!!l,children:e.map(({title:u,disabled:c,visible:f,completed:A,icon:p},v)=>g.jsx(mOe,{onClick:n==null?void 0:n(v),title:u,index:v,total:e.length,activeStep:t,disabled:c,visible:f,completed:A,hasStepNumbering:r,icon:p},u))}),l&&g.jsx(l,{handleGoToNextStep:i,isLoading:o})]}):null},wOe=({totalSteps:e})=>{const[t,r]=I.useState(0),[n,i]=I.useState(!1),o=I.useCallback(()=>{console.log("RESET"),r(0),i(!1)},[]),l=I.useCallback(()=>{if(console.log("handleGoToNextStep"),t+1===e){console.log("success, reset"),o(),i(!0);return}console.log("SET ACTIVE STEP",t+1),r(t+1)},[t,e,o]),u=I.useCallback(c=>()=>{console.log("handleChangeStep"),r(c)},[]);return{activeStep:t,handleChangeStep:u,handleGoToNextStep:l,isSuccess:n,handleReset:o}},xOe=ee(tt.div)`
|
|
3957
3957
|
margin-right: 1em;
|
|
3958
3958
|
`,SOe=ee.div`
|
|
3959
3959
|
display: flex;
|