@mailstep/design-system 0.6.75-beta.3 → 0.6.75-beta.5
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
|
@@ -4,18 +4,23 @@ 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
|
}, []);
|
|
10
11
|
var handleGoToNextStep = useCallback(function () {
|
|
12
|
+
console.log('handleGoToNextStep');
|
|
11
13
|
if (activeStep + 1 === totalSteps) {
|
|
14
|
+
console.log('success, reset');
|
|
12
15
|
handleReset();
|
|
13
16
|
setSuccess(true);
|
|
14
17
|
return;
|
|
15
18
|
}
|
|
19
|
+
console.log('SET ACTIVE STEP', activeStep + 1);
|
|
16
20
|
setActiveStep(activeStep + 1);
|
|
17
21
|
}, [activeStep, totalSteps, handleReset]);
|
|
18
22
|
var handleChangeStep = useCallback(function (step) { return function () {
|
|
23
|
+
console.log('handleChangeStep');
|
|
19
24
|
setActiveStep(step);
|
|
20
25
|
}; }, []);
|
|
21
26
|
return { activeStep: activeStep, handleChangeStep: handleChangeStep, handleGoToNextStep: handleGoToNextStep, isSuccess: isSuccess, handleReset: handleReset };
|
package/ui/index.es.js
CHANGED
|
@@ -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
|
-
if (t + 1 === e) {
|
|
51743
|
-
o(), i(!0);
|
|
51742
|
+
if (console.log("handleGoToNextStep"), t + 1 === e) {
|
|
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(t+1===e){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)&&(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;
|