@visactor/vtable
Version:
canvas table width high performance
83 lines (80 loc) • 4.39 kB
JavaScript
import { Style } from "../style";
let defaultStyle;
export class SwitchStyle extends Style {
static get DEFAULT() {
return defaultStyle || (defaultStyle = new SwitchStyle);
}
constructor(style = {}, headerStyle = {}, switchThemeStyle = {}) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
super(style, headerStyle), this._spaceBetweenTextAndCircle = (null !== (_b = null !== (_a = null == style ? void 0 : style.spaceBetweenTextAndCircle) && void 0 !== _a ? _a : null == headerStyle ? void 0 : headerStyle.spaceBetweenTextAndCircle) && void 0 !== _b ? _b : null == switchThemeStyle ? void 0 : switchThemeStyle.spaceBetweenTextAndCircle) || 6,
this._circleRadius = (null !== (_d = null === (_c = null == style ? void 0 : style.switchStyle) || void 0 === _c ? void 0 : _c.circleRadius) && void 0 !== _d ? _d : null == switchThemeStyle ? void 0 : switchThemeStyle.circleRadius) || 8,
this._boxWidth = (null !== (_f = null === (_e = null == style ? void 0 : style.switchStyle) || void 0 === _e ? void 0 : _e.boxWidth) && void 0 !== _f ? _f : null == switchThemeStyle ? void 0 : switchThemeStyle.boxWidth) || 40,
this._boxHeight = (null !== (_h = null === (_g = null == style ? void 0 : style.switchStyle) || void 0 === _g ? void 0 : _g.boxHeight) && void 0 !== _h ? _h : null == switchThemeStyle ? void 0 : switchThemeStyle.boxHeight) || 24,
this._checkedFill = (null !== (_k = null === (_j = null == style ? void 0 : style.switchStyle) || void 0 === _j ? void 0 : _j.checkedFill) && void 0 !== _k ? _k : null == switchThemeStyle ? void 0 : switchThemeStyle.checkedFill) || "#165DFF",
this._uncheckedFill = (null !== (_m = null === (_l = null == style ? void 0 : style.switchStyle) || void 0 === _l ? void 0 : _l.uncheckedFill) && void 0 !== _m ? _m : null == switchThemeStyle ? void 0 : switchThemeStyle.uncheckedFill) || "#c9cdd4",
this._disableCheckedFill = (null !== (_p = null === (_o = null == style ? void 0 : style.switchStyle) || void 0 === _o ? void 0 : _o.disableCheckedFill) && void 0 !== _p ? _p : null == switchThemeStyle ? void 0 : switchThemeStyle.disableCheckedFill) || "#94bfff",
this._disableUncheckedFill = (null !== (_r = null === (_q = null == style ? void 0 : style.switchStyle) || void 0 === _q ? void 0 : _q.disableUncheckedFill) && void 0 !== _r ? _r : null == switchThemeStyle ? void 0 : switchThemeStyle.disableUncheckedFill) || "#f2f3f5",
this._circleFill = (null !== (_t = null === (_s = null == style ? void 0 : style.switchStyle) || void 0 === _s ? void 0 : _s.circleFill) && void 0 !== _t ? _t : null == switchThemeStyle ? void 0 : switchThemeStyle.circleFill) || "#FFF";
}
get spaceBetweenTextAndCircle() {
return this._spaceBetweenTextAndCircle;
}
set spaceBetweenTextAndCircle(spaceBetweenTextAndCircle) {
this._spaceBetweenTextAndCircle = spaceBetweenTextAndCircle;
}
get circleRadius() {
return this._circleRadius;
}
set circleRadius(circleRadius) {
this._circleRadius = circleRadius;
}
get boxWidth() {
return this._boxWidth;
}
set boxWidth(boxWidth) {
this._boxWidth = boxWidth;
}
get boxHeight() {
return this._boxHeight;
}
set boxHeight(boxHeight) {
this._boxHeight = boxHeight;
}
get checkedFill() {
return this._checkedFill;
}
set checkedFill(checkedFill) {
this._checkedFill = checkedFill;
}
get uncheckedFill() {
return this._uncheckedFill;
}
set uncheckedFill(uncheckedFill) {
this._uncheckedFill = uncheckedFill;
}
get disableCheckedFill() {
return this._disableCheckedFill;
}
set disableCheckedFill(disableCheckedFill) {
this._disableCheckedFill = disableCheckedFill;
}
get disableUncheckedFill() {
return this._disableUncheckedFill;
}
set disableUncheckedFill(disableUncheckedFill) {
this._disableUncheckedFill = disableUncheckedFill;
}
get circleFill() {
return this._circleFill;
}
set circleFill(circleFill) {
this._circleFill = circleFill;
}
getStyle(style) {
return new SwitchStyle(style, this);
}
clone() {
return new SwitchStyle(this);
}
}
//# sourceMappingURL=SwitchStyle.js.map