import { h } from "@stencil/core";
export class DgaProgressIndicator {
    constructor() {
        this.activeStep = 1;
        this.alignment = 'horizontal';
    }
    updateSlottedElements() {
        // Get all slotted elements
        const slot = this.el.querySelector('slot[name="progress-indicator-step"]');
        if (slot) {
            const slottedElements = slot.assignedElements();
            // Update each slotted element
            slottedElements.forEach(element => {
                if (element.tagName === 'DGA-PROGRESS-INDICATOR-STEP') {
                    element.setAttribute('active-step', this.activeStep.toString());
                }
            });
        }
    }
    updateInternalActiveStep() {
        // Force a state update
        this.internalActiveStep = this.activeStep;
        this.stepChange.emit(this.activeStep);
        this.updateSlottedElements();
    }
    componentDidLoad() {
        this.updateInternalActiveStep();
    }
    componentWillLoad() {
        this.el.childNodes.forEach(item => {
            const el = item;
            if (el.tagName === 'DGA-PROGRESS-INDICATOR-STEP' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'progress-indicator-step');
            }
        });
    }
    render() {
        // console.log(this.activeStep , "<= active step")
        return (h("div", { key: '65e5213ff4ccc172d6f9651e1eac9512fa7c3f74', class: "progress-indicator dga-flex", "data-alignment": this.alignment }, h("slot", { key: '8312ebf2d0d9f2f749d540692c63a76eb0aa52d8', name: 'progress-indicator-step' })));
    }
    static get is() { return "dga-progress-indicator"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-progress-indicator.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-progress-indicator.css"]
        };
    }
    static get properties() {
        return {
            "activeStep": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "active-step",
                "reflect": false,
                "defaultValue": "1"
            },
            "alignment": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'horizontal' | 'vertical'",
                    "resolved": "\"horizontal\" | \"vertical\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "alignment",
                "reflect": false,
                "defaultValue": "'horizontal'"
            }
        };
    }
    static get states() {
        return {
            "internalActiveStep": {}
        };
    }
    static get events() {
        return [{
                "method": "stepChange",
                "name": "stepChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                }
            }];
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "activeStep",
                "methodName": "updateInternalActiveStep"
            }];
    }
}
//# sourceMappingURL=dga-progress-indicator.js.map
