import { __decorate } from "tslib";
import { DesignSystem } from '@ni/fast-foundation';
import { attr, nullableNumberConverter } from '@ni/fast-element';
import { styles } from './styles';
import { template } from './template';
import { AnchorBase } from '../anchor-base';
import { mixinSeverityPattern } from '../patterns/severity/types';
import { StepInternals } from '../patterns/step/models/step-internals';
import { AnchorStepSeverity } from './types';
/**
 * A nimble-styled anchor step for a stepper
 */
export class AnchorStep extends mixinSeverityPattern(AnchorBase) {
    constructor() {
        super(...arguments);
        /**
         * @public
         * @remarks
         * HTML Attribute: disabled
         */
        this.severity = AnchorStepSeverity.default;
        /**
         * @public
         * @remarks
         * HTML Attribute: disabled
         */
        this.disabled = false;
        /**
         * @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()
], AnchorStep.prototype, "severity", void 0);
__decorate([
    attr({ mode: 'boolean' })
], AnchorStep.prototype, "disabled", void 0);
__decorate([
    attr({ attribute: 'readonly', mode: 'boolean' })
], AnchorStep.prototype, "readOnly", void 0);
__decorate([
    attr({ mode: 'boolean' })
], AnchorStep.prototype, "selected", void 0);
__decorate([
    attr({ attribute: 'tabindex', converter: nullableNumberConverter })
], AnchorStep.prototype, "tabIndex", void 0);
const nimbleAnchorStep = AnchorStep.compose({
    baseName: 'anchor-step',
    template,
    styles,
    shadowOptions: {
        delegatesFocus: true
    }
});
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorStep());
export const anchorStepTag = 'nimble-anchor-step';
//# sourceMappingURL=index.js.map