import React from 'react';
import ReactDOM from 'react-dom';
import Step from '..';
import { Button } from '../..';
const StepItem = Step.Item, ButtonGroup = Button.Group;
class Component extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            currentStep: 3,
        };
    }
    next() {
        const s = this.state.currentStep + 1;
        this.setState({
            currentStep: s > 6 ? 6 : s,
        });
    }
    prev() {
        const s = this.state.currentStep - 1;
        this.setState({
            currentStep: s < 0 ? 0 : s,
        });
    }
    onClick(currentStep) {
        console.log(currentStep);
        this.setState({
            currentStep,
        });
    }
    render() {
        const { currentStep } = this.state;
        return (React.createElement("div", null,
            React.createElement(Step, { current: currentStep, readOnly: true },
                React.createElement(StepItem, { title: "Step 1", onClick: this.onClick.bind(this) }),
                React.createElement(StepItem, { title: "Step 2", onClick: this.onClick.bind(this) }),
                React.createElement(StepItem, { title: "Step 3", onClick: this.onClick.bind(this) }),
                React.createElement(StepItem, { title: "Step 4", onClick: this.onClick.bind(this) }),
                React.createElement(StepItem, { title: "Step 5", onClick: this.onClick.bind(this) }),
                React.createElement(StepItem, { title: "Step 6", onClick: this.onClick.bind(this) })),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement(ButtonGroup, null,
                React.createElement(Button, { onClick: this.prev.bind(this), type: "primary", disabled: currentStep === 0 }, "Backward"),
                React.createElement(Button, { onClick: this.next.bind(this), type: "primary", disabled: currentStep === 6 }, "Forward"))));
    }
}
ReactDOM.render(React.createElement(Component, null), document.getElementById('step-demo-7'));
