UNPKG

react-antd-admin-panel

Version:

Easy prototyping admin panel using React and Antd

66 lines 2.34 kB
import Default from "./Default"; import { Helpers } from "../../index"; export default class Section extends Default { constructor() { super('Section'); this._cols = 24; this._type = 'Col'; this._justify = 'start'; this._align = 'start'; this._overlay = false; this._card = false; this._cardStyle = { marginTop: '24px' }; this._ignore = false; this._key = Helpers.stamp(); } cols(cols) { this._cols = cols; return this; } type(type) { this._type = type; return this; } row() { this._type = 'Row'; return this; } col() { this._type = 'Col'; return this; } between() { this._justify = 'space-between'; return this; } center() { this._justify = 'center'; return this; } start() { this._justify = 'start'; return this; } end() { this._justify = 'end'; return this; } align(v) { this._align = v; return this; } async(v = true) { this._async = v; return this; } overlay(v) { this._overlay = v !== null && v !== void 0 ? v : true; return this; } card(v) { this._card = v !== null && v !== void 0 ? v : true; return this; } cardStyle(v) { this._cardStyle = v; return this; } addRowEnd(items) { let section = new Section().row().end(); this.add(section); this.addManyTo(section, items); return this; } addRowStart(items) { let section = new Section().row().start(); this.add(section); this.addManyTo(section, items); return this; } addManyTo(section, items) { if (Array.isArray(items)) { items.forEach((r) => section.add(r)); } else { section.add(items); } } ignore(v) { this._ignore = v; return this; } object(v) { this._object = v; return this; } component(component, args = undefined) { this._component = component; this._componentArgs = args; return this; } init() { var _a; if (this._formulaIsRoot) (_a = this.formulaSetChildren) === null || _a === void 0 ? void 0 : _a.call(this); return this; } immediate(func, args) { return super.fetch(func, args); } } //# sourceMappingURL=Section.js.map