import { __decorate, __metadata } from "tslib";
import { h, Host } from "@stencil/core";
import { BEM } from "../../utils/bem";
import { Logger } from "../../utils/log";
export class Stack {
    constructor() {
        /**
         * PUBLIC PROPERTY API
         * ------------------------------------------------------
         */
        /**
         * Defines the position of the child elements if they
         * are showed verticaly or horizontally. Default is horizontally.
         */
        this.layout = 'horizontal';
        /**
         * Defines the text positioning like center, right or
         * default to start.
         */
        this.align = '';
        /**
         * Defines the space between the child elements. Default is normal.
         */
        this.space = 'normal';
        /**
         * Defines the horizontal padding left and right of the stack element.
         */
        this.px = '';
        /**
         * Defines the vertical padding top and bottom of the stack element.
         */
        this.py = '';
        /**
         * Defines if the child elements will wrap to the next line if there
         * is not enough space left
         */
        this.useWrap = false;
        /**
         * Defines the width of the stack to be exactly the with of the content.
         */
        this.fitContent = false;
        /**
         * @internal
         * Please use layout instead.
         */
        this.direction = '';
        /**
         * @internal
         * Please use align instead.
         */
        this.alignment = '';
    }
    createLogger(log) {
        this.log = log;
    }
    /**
     * RENDER
     * ------------------------------------------------------
     */
    render() {
        const block = BEM.block('stack');
        const direction = !!this.direction;
        const layout = !!this.layout;
        const align = !!this.align;
        const alignment = !!this.alignment;
        const space = !!this.space;
        const spaceRow = !!this.spaceRow;
        const spaceColumn = !!this.spaceColumn;
        const useWrap = !!this.useWrap;
        const fitContent = !!this.fitContent;
        const px = !!this.px;
        const py = !!this.py;
        let layoutValue = this.layout;
        if (direction) {
            layoutValue = this.direction === 'row' ? 'horizontal' : 'vertical';
        }
        let alignValue = this.align.split(' ').join('-');
        if (alignment) {
            alignValue = this.alignment.split(' ').join('-');
        }
        return (h(Host, { key: '221668cc1bec71015c1616e156bd7805dc583c6c', class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier(`use-wrap`).class(useWrap)), block.modifier(`layout-${layoutValue}`).class(layout || direction)), block.modifier(`align-${alignValue}`).class(align || alignment)), block.modifier(`space-${this.space}`).class(space)), block.modifier(`space-row-${this.spaceRow}`).class(spaceRow)), block.modifier(`space-row-${this.spaceColumn}`).class(spaceColumn)), block.modifier(`px-${this.px}`).class(px)), block.modifier(`py-${this.py}`).class(py)), block.modifier(`fit-content`).class(fitContent)) }, h("slot", { key: '2cd538d3e31d76403cbc1bd61ac518a5f2dcc6a5' })));
    }
    static get is() { return "bal-stack"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bal-stack.sass"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bal-stack.css"]
        };
    }
    static get properties() {
        return {
            "layout": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackLayout",
                    "resolved": "\"\" | \"horizontal\" | \"horizontal-reverse\" | \"vertical\" | \"vertical-reverse\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the position of the child elements if they\nare showed verticaly or horizontally. Default is horizontally."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "layout",
                "defaultValue": "'horizontal'"
            },
            "align": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackAlignment",
                    "resolved": "\"\" | \"bottom center\" | \"bottom end\" | \"bottom start\" | \"center\" | \"end\" | \"start\" | \"top center\" | \"top end\" | \"top start\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the text positioning like center, right or\ndefault to start."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "align",
                "defaultValue": "''"
            },
            "space": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackSpace",
                    "resolved": "\"\" | \"auto\" | \"large\" | \"medium\" | \"none\" | \"normal\" | \"small\" | \"x-large\" | \"x-small\" | \"xx-large\" | \"xx-small\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the space between the child elements. Default is normal."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "space",
                "defaultValue": "'normal'"
            },
            "spaceRow": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackSpace",
                    "resolved": "\"\" | \"auto\" | \"large\" | \"medium\" | \"none\" | \"normal\" | \"small\" | \"x-large\" | \"x-small\" | \"xx-large\" | \"xx-small\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Defines the space between the child elements. Default is normal."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "space-row"
            },
            "spaceColumn": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackSpace",
                    "resolved": "\"\" | \"auto\" | \"large\" | \"medium\" | \"none\" | \"normal\" | \"small\" | \"x-large\" | \"x-small\" | \"xx-large\" | \"xx-small\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Defines the space between the child elements. Default is normal."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "space-column"
            },
            "px": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackPadding",
                    "resolved": "\"\" | \"large\" | \"medium\" | \"none\" | \"normal\" | \"small\" | \"x-large\" | \"x-small\" | \"xx-large\" | \"xx-small\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the horizontal padding left and right of the stack element."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "px",
                "defaultValue": "''"
            },
            "py": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackPadding",
                    "resolved": "\"\" | \"large\" | \"medium\" | \"none\" | \"normal\" | \"small\" | \"x-large\" | \"x-small\" | \"xx-large\" | \"xx-small\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the vertical padding top and bottom of the stack element."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "py",
                "defaultValue": "''"
            },
            "useWrap": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines if the child elements will wrap to the next line if there\nis not enough space left"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "use-wrap",
                "defaultValue": "false"
            },
            "fitContent": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the width of the stack to be exactly the with of the content."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "fit-content",
                "defaultValue": "false"
            },
            "direction": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackDirection",
                    "resolved": "\"\" | \"column\" | \"row\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "internal",
                            "text": "Please use layout instead."
                        }],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "direction",
                "defaultValue": "''"
            },
            "alignment": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "BalProps.BalStackAlignment",
                    "resolved": "\"\" | \"bottom center\" | \"bottom end\" | \"bottom start\" | \"center\" | \"end\" | \"start\" | \"top center\" | \"top end\" | \"top start\"",
                    "references": {
                        "BalProps": {
                            "location": "global",
                            "id": "global::BalProps"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "internal",
                            "text": "Please use align instead."
                        }],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "alignment",
                "defaultValue": "''"
            }
        };
    }
}
__decorate([
    Logger('bal-stack'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Function]),
    __metadata("design:returntype", void 0)
], Stack.prototype, "createLogger", null);
