import { h } from "@stencil/core";
/**
 * Timeline 时间线组件
 * 按竖线渲染每个 item 的圆点 + 内容 + 时间，支持左/右/交替三种模式
 */
export class Timeline {
    /** 时间线模式 */
    mode = 'left';
    /** 时间线节点数组 */
    items = [];
    render() {
        return (h("div", { key: 'ea2098bc94d05340618eb088badcaa2c18136cf1', class: { 'hb-timeline': true, [`hb-timeline--${this.mode}`]: true } }, this.items.map((item, i) => (h("div", { class: {
                'hb-timeline__item': true,
                'hb-timeline__item--right': this.mode === 'alternate' && i % 2 === 1,
                'hb-timeline__item--left': this.mode === 'alternate' && i % 2 === 0,
            } }, h("div", { class: "hb-timeline__content" }, h("div", { class: "hb-timeline__content-text" }, item.content), item.time && h("div", { class: "hb-timeline__time" }, item.time)), h("div", { class: { 'hb-timeline__dot': true, [`hb-timeline__dot--${item.color || 'blue'}`]: true } }))))));
    }
    static get is() { return "hb-timeline"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["timeline.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["timeline.css"]
        };
    }
    static get properties() {
        return {
            "mode": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'left' | 'alternate' | 'right'",
                    "resolved": "\"alternate\" | \"left\" | \"right\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u65F6\u95F4\u7EBF\u6A21\u5F0F"
                },
                "getter": false,
                "setter": false,
                "attribute": "mode",
                "reflect": false,
                "defaultValue": "'left'"
            },
            "items": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "TimelineItem[]",
                    "resolved": "TimelineItem[]",
                    "references": {
                        "TimelineItem": {
                            "location": "local",
                            "path": "/Users/vscoderwhy/Desktop/product/web-common/huibo-ui/src/components/Timeline/Timeline.tsx",
                            "id": "src/components/Timeline/Timeline.tsx::TimelineItem"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u65F6\u95F4\u7EBF\u8282\u70B9\u6570\u7EC4"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            }
        };
    }
}
//# sourceMappingURL=Timeline.js.map
