@visactor/vtable
Version:
canvas table width high performance
22 lines (19 loc) • 2.87 kB
JavaScript
import { isArray } from "@visactor/vutils";
import { Group } from "./../../vrender";
export class Container extends Group {
constructor(containerOptions) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
containerOptions.direction && (containerOptions.flexDirection = containerOptions.direction),
!containerOptions.justifyContent || "start" !== containerOptions.justifyContent && "end" !== containerOptions.justifyContent || (containerOptions.justifyContent = "flex-" + containerOptions.justifyContent),
!containerOptions.alignItems || "start" !== containerOptions.alignItems && "end" !== containerOptions.alignItems || (containerOptions.alignItems = "flex-" + containerOptions.alignItems),
!containerOptions.alignContent || "start" !== containerOptions.alignContent && "end" !== containerOptions.alignContent || (containerOptions.alignContent = "flex-" + containerOptions.alignContent),
containerOptions.display = "flex", containerOptions.flexDirection || (containerOptions.flexDirection = "row"),
containerOptions.clip = !0, containerOptions.fill = null === (_a = null == containerOptions ? void 0 : containerOptions.background) || void 0 === _a ? void 0 : _a.fill,
containerOptions.stroke = null === (_b = null == containerOptions ? void 0 : containerOptions.background) || void 0 === _b ? void 0 : _b.stroke,
containerOptions.lineWidth = null === (_c = null == containerOptions ? void 0 : containerOptions.background) || void 0 === _c ? void 0 : _c.lineWidth,
containerOptions.cornerRadius = null === (_d = null == containerOptions ? void 0 : containerOptions.background) || void 0 === _d ? void 0 : _d.cornerRadius;
const isPaddingNumber = isArray(containerOptions.boundsPadding), padding = [ null !== (_f = null !== (_e = containerOptions.marginTop) && void 0 !== _e ? _e : isPaddingNumber ? containerOptions.boundsPadding[0] : containerOptions.boundsPadding) && void 0 !== _f ? _f : 0, null !== (_h = null !== (_g = containerOptions.marginRight) && void 0 !== _g ? _g : isPaddingNumber ? containerOptions.boundsPadding[1] : containerOptions.boundsPadding) && void 0 !== _h ? _h : 0, null !== (_l = null !== (_j = containerOptions.marginBottom) && void 0 !== _j ? _j : isPaddingNumber ? null !== (_k = containerOptions.boundsPadding[2]) && void 0 !== _k ? _k : containerOptions.boundsPadding[0] : containerOptions.boundsPadding) && void 0 !== _l ? _l : 0, null !== (_p = null !== (_m = containerOptions.marginLeft) && void 0 !== _m ? _m : isPaddingNumber ? null !== (_o = containerOptions.boundsPadding[3]) && void 0 !== _o ? _o : containerOptions.boundsPadding[1] : containerOptions.boundsPadding) && void 0 !== _p ? _p : 0 ];
containerOptions.boundsPadding = padding, super(containerOptions);
}
}
//# sourceMappingURL=container.js.map