import { __decorate } from "tslib";
import { Button as FoundationButton, DesignSystem } from '@ni/fast-foundation';
import { attr, nullableNumberConverter } from '@ni/fast-element';
import { styles } from './styles';
import { template } from './template';
import { mixinSeverityPattern } from '../patterns/severity/types';
import { StepInternals } from '../patterns/step/models/step-internals';
import { StepSeverity } from './types';
/**
 * A nimble-styled step for a stepper
 */
export class Step extends mixinSeverityPattern(FoundationButton) {
    constructor() {
        super(...arguments);
        /**
         * @public
         * @remarks
         * HTML Attribute: disabled
         */
        this.severity = StepSeverity.default;
        /**
         * @public
         * @remarks
         * HTML Attribute: readonly
         */
        this.readOnly = false;
        /**
         * @public
         * @remarks
         * HTML Attribute: selected
         */
        this.selected = false;
        /**
         * @internal
         */
        this.stepInternals = new StepInternals();
    }
    /**
     * @internal
     */
    onClick(e) {
        if (this.disabled || this.readOnly) {
            e.stopImmediatePropagation();
            return false; /* Do prevent default */
        }
        return true; /* Do not prevent default */
    }
}
__decorate([
    attr()
], Step.prototype, "severity", void 0);
__decorate([
    attr({ attribute: 'readonly', mode: 'boolean' })
], Step.prototype, "readOnly", void 0);
__decorate([
    attr({ mode: 'boolean' })
], Step.prototype, "selected", void 0);
__decorate([
    attr({ attribute: 'tabindex', converter: nullableNumberConverter })
], Step.prototype, "tabIndex", void 0);
const nimbleStep = Step.compose({
    baseName: 'step',
    template,
    styles,
    shadowOptions: {
        delegatesFocus: true
    }
});
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleStep());
export const stepTag = 'nimble-step';
//# sourceMappingURL=index.js.map