@furystack/shades-common-components
Version:
30 lines • 1.34 kB
JavaScript
import { createComponent, Shade } from '@furystack/shades';
import { Paper } from '../paper.js';
export const Wizard = Shade({
shadowDomName: 'shades-wizard',
render: ({ props, useState }) => {
const [currentPage, setCurrentPage] = useState('currentPage', 0);
const CurrentPage = props.steps[currentPage];
return (createComponent("div", { style: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: '100%',
height: '100%',
} },
createComponent(Paper, { style: { maxWidth: '100%', maxHeight: '100%' }, elevation: 3, onclick: (ev) => ev.stopPropagation() },
createComponent(CurrentPage, { currentPage: currentPage, maxPages: props.steps.length, onNext: () => {
if (currentPage < props.steps.length - 1) {
setCurrentPage(currentPage + 1);
}
else {
props.onFinish?.();
}
}, onPrev: () => {
if (currentPage > 0) {
setCurrentPage(currentPage - 1);
}
} }))));
},
});
//# sourceMappingURL=index.js.map