Spin.js 606 Bytes
import template from "./Spin.html";

class Spin {
    props = {
        size: String,
        spinning: Boolean
    };

    state = {
        className: [],
        hasChildren: false,
    };

    template = template;

    constructor() {
        this.state.className = ["ant-spin", "ant-spin-spinning"];
        this.state.hasChildren = JSON.stringify($transclude()) !== "{}";

        if (this.size === "small") {
            this.state.className.splice(1, 0, "ant-spin-sm");
        }

        if (this.size === "large") {
            this.state.className.splice(1, 0, "ant-spin-lg");
        }
    }
}