@visactor/vtable
Version:
canvas table width high performance
52 lines (40 loc) • 2.8 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.of = exports.TextStyle = exports.ImageStyle = exports.NumberStyle = exports.Style = exports.EVENT_TYPE = void 0;
const vutils_1 = require("@visactor/vutils"), ImageStyle_1 = require("./style/ImageStyle");
Object.defineProperty(exports, "ImageStyle", {
enumerable: !0,
get: function() {
return ImageStyle_1.ImageStyle;
}
});
const MultilineTextStyle_1 = require("./style/MultilineTextStyle");
Object.defineProperty(exports, "TextStyle", {
enumerable: !0,
get: function() {
return MultilineTextStyle_1.TextStyle;
}
});
const NumberStyle_1 = require("./style/NumberStyle");
Object.defineProperty(exports, "NumberStyle", {
enumerable: !0,
get: function() {
return NumberStyle_1.NumberStyle;
}
});
const Style_1 = require("./style/Style");
Object.defineProperty(exports, "Style", {
enumerable: !0,
get: function() {
return Style_1.Style;
}
});
const CheckboxStyle_1 = require("./style/CheckboxStyle"), RadioStyle_1 = require("./style/RadioStyle"), SwitchStyle_1 = require("./style/SwitchStyle"), ButtonStyle_1 = require("./style/ButtonStyle"), {EVENT_TYPE: EVENT_TYPE} = Style_1.Style;
function of(columnStyle, bodyStyle, styleArg, StyleClassDef = Style_1.Style, globalAutoWrapText, theme) {
var _a, _b, _c, _d;
return columnStyle || bodyStyle ? columnStyle instanceof Style_1.Style ? columnStyle : "function" == typeof columnStyle ? of(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText, theme) : (columnStyle || (columnStyle = {}),
globalAutoWrapText && !(0, vutils_1.isValid)(columnStyle.autoWrapText) && (columnStyle.autoWrapText = !0),
StyleClassDef === CheckboxStyle_1.CheckboxStyle ? new CheckboxStyle_1.CheckboxStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle_1.RadioStyle ? new RadioStyle_1.RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : StyleClassDef === SwitchStyle_1.SwitchStyle ? new SwitchStyle_1.SwitchStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_c = theme.switchStyle) && void 0 !== _c ? _c : {}) : StyleClassDef === ButtonStyle_1.ButtonStyle ? new ButtonStyle_1.ButtonStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_d = theme.buttonStyle) && void 0 !== _d ? _d : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
}
exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;