@visactor/vtable
Version:
canvas table width high performance
28 lines (23 loc) • 3.03 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.Container = void 0;
const vutils_1 = require("@visactor/vutils"), vrender_1 = require("./../../vrender");
class Container extends vrender_1.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 = (0, vutils_1.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);
}
}
exports.Container = Container;
//# sourceMappingURL=container.js.map