Space.js 982 Bytes
import template from "./Space.html";
import style from "antd/lib/space/style/index.css";
class Space {
    useModules = ["esNgAntd"];

    props = { direction: String, size: String };

    state = {
        direction: this.props.direction || "horizontal",
        size: this.props.size || 8
    };

    template = template;

    constructor() {
        esNgAntd.createStyle("ant-space", style);
        $element.removeAttr("ng-class");
        $element.removeAttr("ng-style");
        let childrens = $transclude();
        for (const key in childrens) {
            if (Object.hasOwnProperty.call(childrens, key)) {
                const children = childrens[key];
                if (children.nodeType === 1) {
                    let item = angular
                        .element("<div>")
                        .addClass("ant-space-item")
                        .append(children);
                    $element.append(item);
                }
            }
        }
    }
}