import { Host, h } from "@stencil/core";
export class SpwWizardItem {
    constructor() {
        /** État de l'étape (géré automatiquement par spw-wizard sauf si status est défini) */
        this.state = 'inactive';
        /** Indique si c'est le dernier item (géré automatiquement par spw-wizard) */
        this.isLast = 'false';
        /** Indique si l'item est cliquable (géré automatiquement par spw-wizard) */
        this.isClickable = 'false';
        /** Indique si l'item est avant l'étape courante (géré automatiquement par spw-wizard) */
        this.isBeforeCurrent = 'false';
        /** Indique si l'item est après l'étape courante (géré automatiquement par spw-wizard) */
        this.isAfterCurrent = 'false';
        /** Indique si c'est l'étape courante (géré automatiquement par spw-wizard) */
        this.isCurrent = 'false';
        this.handleClick = () => {
            if (this.isClickable === 'true') {
                this.wizardItemClick.emit(this.stepNumber);
            }
        };
    }
    renderIcon() {
        const effectiveState = this.status || this.state;
        if (effectiveState === 'warning') {
            return h("spw-icon", { variant: "fa-solid", icon: "fa-triangle-exclamation" });
        }
        if (effectiveState === 'error') {
            return h("spw-icon", { variant: "fa-solid", icon: "fa-xmark" });
        }
        if (this.icon) {
            return h("spw-icon", { variant: "fa-solid", icon: this.icon });
        }
        return h("span", null, this.stepNumber);
    }
    get elementClass() {
        const effectiveState = this.status || this.state;
        return {
            'spw-wizard-item': true,
            [`spw-wizard-item--${effectiveState}`]: true,
            [`spw-wizard-item--${this.variant}`]: true,
            'spw-wizard-item--clickable': this.isClickable === 'true',
            'spw-wizard-item--current': this.isCurrent === 'true',
            'spw-wizard-item--before-current': this.isBeforeCurrent === 'true',
            'spw-wizard-item--after-current': this.isAfterCurrent === 'true',
        };
    }
    render() {
        const showConnector = this.isLast === 'false';
        return (h(Host, { key: '90bdc7c000be2257281014d92eef7237b9bfab25' }, h("div", { key: '3c44adde161d24cffdbceb1036e73c0895fc7eec', class: this.elementClass, onClick: this.handleClick }, h("div", { key: 'e58c9780ea03174e1c8b20d389ab411d09dbb7d9', class: "spw-wizard-item__step" }, h("div", { key: '60a9f6f938bb6f3225bc346885b15f13789bd0b0', class: "spw-wizard-item__icon" }, this.renderIcon()), showConnector && h("div", { key: 'adbab83e37e40ab36c471cfc7248f4742d60bf45', class: "spw-wizard-item__connector" })), h("div", { key: 'c36b69d6d4167637fd9d71471dd0c06afc74390f', class: "spw-wizard-item__content" }, this.label && h("div", { key: '5b9524a000c531154ad184aa11394b4d889d66d2', class: "spw-wizard-item__label" }, this.label), this.description && h("div", { key: '6e0121cb665cb0fb90df0ebb0ffb80efdd6e5a72', class: "spw-wizard-item__description" }, this.description), this.additionalInfo && h("div", { key: '2cf6b99687e5c9531a6a45a287f29970f324fb24', class: "spw-wizard-item__additional-info" }, this.additionalInfo)))));
    }
    static get is() { return "spw-wizard-item"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["spw-wizard-item.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["spw-wizard-item.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Label affich\u00E9 sous l'ic\u00F4ne"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Description affich\u00E9 sous le label"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "description"
            },
            "additionalInfo": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Info additionnelle affich\u00E9e sous la description (par exemple lors d'une erreur)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "additional-info"
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Ic\u00F4ne \u00E0 afficher (r\u00E9f\u00E9rence font-awesome)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "icon"
            },
            "state": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'inactive' | 'active' | 'completed' | 'warning' | 'error'",
                    "resolved": "\"active\" | \"completed\" | \"error\" | \"inactive\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u00C9tat de l'\u00E9tape (g\u00E9r\u00E9 automatiquement par spw-wizard sauf si status est d\u00E9fini)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "state",
                "defaultValue": "'inactive'"
            },
            "status": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'inactive' | 'active' | 'completed' | 'warning' | 'error'",
                    "resolved": "\"active\" | \"completed\" | \"error\" | \"inactive\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Statut manuel qui override l'\u00E9tat automatique"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "status"
            },
            "isLast": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si c'est le dernier item (g\u00E9r\u00E9 automatiquement par spw-wizard)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-last",
                "defaultValue": "'false'"
            },
            "stepNumber": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Num\u00E9ro de l'\u00E9tape (g\u00E9r\u00E9 automatiquement par spw-wizard)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "step-number"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'vertical' | 'horizontal'",
                    "resolved": "\"horizontal\" | \"vertical\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Variant qui permet de d\u00E9finir la direction (g\u00E9r\u00E9 automatiquement par spw-wizard)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "variant"
            },
            "isClickable": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si l'item est cliquable (g\u00E9r\u00E9 automatiquement par spw-wizard)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-clickable",
                "defaultValue": "'false'"
            },
            "isBeforeCurrent": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si l'item est avant l'\u00E9tape courante (g\u00E9r\u00E9 automatiquement par spw-wizard)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-before-current",
                "defaultValue": "'false'"
            },
            "isAfterCurrent": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si l'item est apr\u00E8s l'\u00E9tape courante (g\u00E9r\u00E9 automatiquement par spw-wizard)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-after-current",
                "defaultValue": "'false'"
            },
            "isCurrent": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si c'est l'\u00E9tape courante (g\u00E9r\u00E9 automatiquement par spw-wizard)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-current",
                "defaultValue": "'false'"
            }
        };
    }
    static get events() {
        return [{
                "method": "wizardItemClick",
                "name": "wizardItemClick",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u00C9v\u00E9nement \u00E9mis lors du clic sur l'item"
                },
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                }
            }];
    }
}
