import { h } from "@stencil/core";
/**
 * Space 间距组件
 * 设置组件之间的间距
 */
export class Space {
    /**
     * 间距大小
     * @default 'small'
     */
    size = 'small';
    /**
     * 间距方向
     * @default 'horizontal'
     */
    direction = 'horizontal';
    /**
     * 是否自动换行，仅在 horizontal 时有效
     * @default false
     */
    wrap = false;
    /**
     * 对齐方式
     */
    alignment = 'start';
    /**
     * 是否填充父容器
     * @default false
     */
    fill = false;
    /**
     * 是否填充每行
     * @default false
     */
    fillRatio = 100;
    getSizeValue() {
        if (typeof this.size === 'number') {
            return `${this.size}px`;
        }
        const sizeMap = {
            small: '8px',
            default: '16px',
            large: '24px',
        };
        return sizeMap[this.size];
    }
    render() {
        const sizeValue = this.getSizeValue();
        return (h("div", { key: 'c6a3c89f29c25988b47aa100c8d3ac45c44f550e', class: {
                'hb-space': true,
                [`hb-space--${this.direction}`]: true,
                'hb-space--wrap': this.wrap && this.direction === 'horizontal',
                'hb-space--fill': this.fill,
            }, style: {
                '--hb-space-size': sizeValue,
                '--hb-space-alignment': this.alignment,
                '--hb-space-fill-ratio': `${this.fillRatio}%`,
            } }, h("slot", { key: '638d65e135eb572d71d3220183031cb0b18b1078' })));
    }
    static get is() { return "hb-space"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["space.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["space.css"]
        };
    }
    static get properties() {
        return {
            "size": {
                "type": "any",
                "mutable": false,
                "complexType": {
                    "original": "'small' | 'default' | 'large' | number",
                    "resolved": "\"default\" | \"large\" | \"small\" | number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "'small'"
                        }],
                    "text": "\u95F4\u8DDD\u5927\u5C0F"
                },
                "getter": false,
                "setter": false,
                "attribute": "size",
                "reflect": false,
                "defaultValue": "'small'"
            },
            "direction": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'horizontal' | 'vertical'",
                    "resolved": "\"horizontal\" | \"vertical\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "'horizontal'"
                        }],
                    "text": "\u95F4\u8DDD\u65B9\u5411"
                },
                "getter": false,
                "setter": false,
                "attribute": "direction",
                "reflect": false,
                "defaultValue": "'horizontal'"
            },
            "wrap": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u81EA\u52A8\u6362\u884C\uFF0C\u4EC5\u5728 horizontal \u65F6\u6709\u6548"
                },
                "getter": false,
                "setter": false,
                "attribute": "wrap",
                "reflect": false,
                "defaultValue": "false"
            },
            "alignment": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'start' | 'end' | 'center' | 'baseline'",
                    "resolved": "\"baseline\" | \"center\" | \"end\" | \"start\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u5BF9\u9F50\u65B9\u5F0F"
                },
                "getter": false,
                "setter": false,
                "attribute": "alignment",
                "reflect": false,
                "defaultValue": "'start'"
            },
            "fill": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u586B\u5145\u7236\u5BB9\u5668"
                },
                "getter": false,
                "setter": false,
                "attribute": "fill",
                "reflect": false,
                "defaultValue": "false"
            },
            "fillRatio": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u586B\u5145\u6BCF\u884C"
                },
                "getter": false,
                "setter": false,
                "attribute": "fill-ratio",
                "reflect": false,
                "defaultValue": "100"
            }
        };
    }
}
//# sourceMappingURL=Space.js.map
