@visactor/vtable-calendar 1.16.3-alpha.3 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vtable-calendar.js +916 -138
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +5 -5
package/dist/vtable-calendar.js
CHANGED
|
@@ -26272,6 +26272,110 @@
|
|
|
26272
26272
|
}
|
|
26273
26273
|
};
|
|
26274
26274
|
|
|
26275
|
+
function loadSwitchComponent() {
|
|
26276
|
+
registerGroup(), registerRect(), registerText(), registerCircle();
|
|
26277
|
+
}
|
|
26278
|
+
|
|
26279
|
+
loadSwitchComponent();
|
|
26280
|
+
class Switch extends AbstractComponent {
|
|
26281
|
+
constructor(attributes, options) {
|
|
26282
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Switch.defaultAttributes, attributes)), this._handlePointerUp = () => {
|
|
26283
|
+
this.attribute.disabled || (this.attribute.checked ? this.setAttribute("checked", !1) : this.setAttribute("checked", !0), this._dispatchEvent("switch_state_change", {
|
|
26284
|
+
eventType: "switch_state_change",
|
|
26285
|
+
checked: this.attribute.checked
|
|
26286
|
+
}), this.stage.renderNextFrame());
|
|
26287
|
+
}, this.renderGroup(), this.onBeforeAttributeUpdate = (val, attributes, key) => {
|
|
26288
|
+
"interactive" in val && this.setAttribute("pickable", val.interactive), "disabled" in val && this.setAttribute("cursor", val.disable ? this.attribute.disableCursor : this.attribute.cursor);
|
|
26289
|
+
}, this.addEventListener("pointerup", this._handlePointerUp);
|
|
26290
|
+
}
|
|
26291
|
+
render() {
|
|
26292
|
+
this.removeAllChild(!0), this.renderBox(), this.renderCircle(), this.renderText(), this.layout();
|
|
26293
|
+
}
|
|
26294
|
+
renderBox() {
|
|
26295
|
+
this._box = new Rect$1(merge$1({}, this.attribute.box)), this.attribute.disabled && this.attribute.checked ? this._box.setAttributes({
|
|
26296
|
+
fill: this.attribute.box.disableCheckedFill
|
|
26297
|
+
}) : this.attribute.disabled && !this.attribute.checked ? this._box.setAttributes({
|
|
26298
|
+
fill: this.attribute.box.disableUncheckedFill
|
|
26299
|
+
}) : this.attribute.checked ? this._box.setAttributes({
|
|
26300
|
+
fill: this.attribute.box.checkedFill
|
|
26301
|
+
}) : this._box.setAttributes({
|
|
26302
|
+
fill: this.attribute.box.uncheckedFill
|
|
26303
|
+
}), this.appendChild(this._box);
|
|
26304
|
+
}
|
|
26305
|
+
renderCircle() {
|
|
26306
|
+
this._circle = new Circle(merge$1({}, this.attribute.circle)), this.appendChild(this._circle);
|
|
26307
|
+
}
|
|
26308
|
+
renderText() {
|
|
26309
|
+
var _a, _b, _c;
|
|
26310
|
+
this._text = new Text(merge$1({}, null !== (_a = this.attribute.text) && void 0 !== _a ? _a : {})), this.attribute.checked && (null === (_b = this.attribute.text) || void 0 === _b ? void 0 : _b.checkedText) ? this._text.setAttributes({
|
|
26311
|
+
text: this.attribute.text.checkedText
|
|
26312
|
+
}) : (null === (_c = this.attribute.text) || void 0 === _c ? void 0 : _c.uncheckedText) && this._text.setAttributes({
|
|
26313
|
+
text: this.attribute.text.uncheckedText
|
|
26314
|
+
}), this.appendChild(this._text);
|
|
26315
|
+
}
|
|
26316
|
+
renderGroup() {
|
|
26317
|
+
this.attribute.interactive || this.setAttribute("pickable", !1), this.attribute.disabled && this.setAttribute("cursor", this.attribute.disableCursor);
|
|
26318
|
+
}
|
|
26319
|
+
layout() {
|
|
26320
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
26321
|
+
const space = this.attribute.spaceBetweenTextAndCircle,
|
|
26322
|
+
radius = this.attribute.circle.radius,
|
|
26323
|
+
boxHeight = this.attribute.box.height,
|
|
26324
|
+
circleHeight = 2 * radius,
|
|
26325
|
+
textHeight = this._text.AABBBounds.height(),
|
|
26326
|
+
maxHeight = Math.max(boxHeight, circleHeight, textHeight),
|
|
26327
|
+
circleY = maxHeight / 2 - circleHeight / 2 + radius,
|
|
26328
|
+
textY = maxHeight / 2 - textHeight / 2,
|
|
26329
|
+
boxWidth = this.attribute.box.width,
|
|
26330
|
+
circleWidth = 2 * radius,
|
|
26331
|
+
textWidth = measureTextSize((null !== (_c = null === (_b = null === (_a = this.attribute.text) || void 0 === _a ? void 0 : _a.checkedText) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) > (null !== (_f = null === (_e = null === (_d = this.attribute.text) || void 0 === _d ? void 0 : _d.uncheckedText) || void 0 === _e ? void 0 : _e.length) && void 0 !== _f ? _f : 0) ? null !== (_h = null === (_g = this.attribute.text) || void 0 === _g ? void 0 : _g.checkedText) && void 0 !== _h ? _h : "" : null !== (_k = null === (_j = this.attribute.text) || void 0 === _j ? void 0 : _j.uncheckedText) && void 0 !== _k ? _k : "", this._text.attribute).width,
|
|
26332
|
+
maxWidth = Math.max(boxWidth, circleWidth + textWidth + 3 * space),
|
|
26333
|
+
circleX = boxHeight / 2 - circleWidth / 2 + radius,
|
|
26334
|
+
textX = circleX + radius + space;
|
|
26335
|
+
this._box.setAttributes({
|
|
26336
|
+
width: maxWidth,
|
|
26337
|
+
height: maxHeight
|
|
26338
|
+
}), this._circle.setAttributes({
|
|
26339
|
+
y: circleY,
|
|
26340
|
+
x: this.attribute.checked ? circleX : maxWidth - circleX
|
|
26341
|
+
}), this._text.setAttributes({
|
|
26342
|
+
x: this.attribute.checked ? textX : maxWidth - textX - textWidth,
|
|
26343
|
+
y: textY
|
|
26344
|
+
});
|
|
26345
|
+
}
|
|
26346
|
+
initAttributes(params, options) {
|
|
26347
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Switch.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
|
|
26348
|
+
}
|
|
26349
|
+
}
|
|
26350
|
+
Switch.defaultAttributes = {
|
|
26351
|
+
interactive: !0,
|
|
26352
|
+
disabled: !1,
|
|
26353
|
+
checked: !1,
|
|
26354
|
+
cursor: "pointer",
|
|
26355
|
+
disableCursor: "not-allowed",
|
|
26356
|
+
circle: {
|
|
26357
|
+
radius: 8,
|
|
26358
|
+
fill: "#FFF",
|
|
26359
|
+
pickable: !1
|
|
26360
|
+
},
|
|
26361
|
+
box: {
|
|
26362
|
+
width: 40,
|
|
26363
|
+
height: 24,
|
|
26364
|
+
cornerRadius: 12,
|
|
26365
|
+
uncheckedFill: "rgb(201,205,212)",
|
|
26366
|
+
checkedFill: "#165DFF",
|
|
26367
|
+
disableUncheckedFill: "rgb(242,243,245)",
|
|
26368
|
+
disableCheckedFill: "rgb(148,191,255)",
|
|
26369
|
+
pickable: !1
|
|
26370
|
+
},
|
|
26371
|
+
text: {
|
|
26372
|
+
textAlign: "left",
|
|
26373
|
+
textBaseline: "top",
|
|
26374
|
+
pickable: !1
|
|
26375
|
+
},
|
|
26376
|
+
spaceBetweenTextAndCircle: 6
|
|
26377
|
+
};
|
|
26378
|
+
|
|
26275
26379
|
let registed = !1;
|
|
26276
26380
|
function registerForVrender() {
|
|
26277
26381
|
registed || (registed = !0, preLoadAllModule(), isBrowserEnv() ? loadBrowserEnv(container) : isNodeEnv() && loadNodeEnv(container), registerArc(), registerCircle(), registerGroup(), registerImage(), registerLine(), registerRect(), registerRichtext(), registerShadowRoot(), registerSymbol(), registerText(), registerFlexLayoutPlugin(), loadPoptip(), registerFlexLayoutPlugin());
|
|
@@ -26628,7 +26732,7 @@
|
|
|
26628
26732
|
}
|
|
26629
26733
|
};
|
|
26630
26734
|
|
|
26631
|
-
let defaultStyle$
|
|
26735
|
+
let defaultStyle$b;
|
|
26632
26736
|
const STYLE_EVENT_TYPE = {
|
|
26633
26737
|
CHANGE_STYLE: "change_style"
|
|
26634
26738
|
};
|
|
@@ -26637,7 +26741,7 @@
|
|
|
26637
26741
|
return STYLE_EVENT_TYPE;
|
|
26638
26742
|
}
|
|
26639
26743
|
static get DEFAULT() {
|
|
26640
|
-
return defaultStyle$
|
|
26744
|
+
return defaultStyle$b || (defaultStyle$b = new Style());
|
|
26641
26745
|
}
|
|
26642
26746
|
constructor() {
|
|
26643
26747
|
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -26818,10 +26922,10 @@
|
|
|
26818
26922
|
}
|
|
26819
26923
|
};
|
|
26820
26924
|
|
|
26821
|
-
let defaultStyle$
|
|
26925
|
+
let defaultStyle$a;
|
|
26822
26926
|
let ImageStyle$1 = class ImageStyle extends Style$1 {
|
|
26823
26927
|
static get DEFAULT() {
|
|
26824
|
-
return defaultStyle$
|
|
26928
|
+
return defaultStyle$a || (defaultStyle$a = new ImageStyle());
|
|
26825
26929
|
}
|
|
26826
26930
|
constructor() {
|
|
26827
26931
|
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -26833,10 +26937,10 @@
|
|
|
26833
26937
|
}
|
|
26834
26938
|
};
|
|
26835
26939
|
|
|
26836
|
-
let defaultStyle$
|
|
26940
|
+
let defaultStyle$9;
|
|
26837
26941
|
class TextStyle extends Style$1 {
|
|
26838
26942
|
static get DEFAULT() {
|
|
26839
|
-
return defaultStyle$
|
|
26943
|
+
return defaultStyle$9 || (defaultStyle$9 = new TextStyle());
|
|
26840
26944
|
}
|
|
26841
26945
|
constructor() {
|
|
26842
26946
|
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -26861,10 +26965,10 @@
|
|
|
26861
26965
|
}
|
|
26862
26966
|
}
|
|
26863
26967
|
|
|
26864
|
-
let defaultStyle$
|
|
26968
|
+
let defaultStyle$8;
|
|
26865
26969
|
let CheckboxStyle$1 = class CheckboxStyle extends Style$1 {
|
|
26866
26970
|
static get DEFAULT() {
|
|
26867
|
-
return defaultStyle$
|
|
26971
|
+
return defaultStyle$8 || (defaultStyle$8 = new CheckboxStyle());
|
|
26868
26972
|
}
|
|
26869
26973
|
constructor() {
|
|
26870
26974
|
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -26947,10 +27051,10 @@
|
|
|
26947
27051
|
}
|
|
26948
27052
|
};
|
|
26949
27053
|
|
|
26950
|
-
let defaultStyle$
|
|
27054
|
+
let defaultStyle$7;
|
|
26951
27055
|
class RadioStyle extends Style$1 {
|
|
26952
27056
|
static get DEFAULT() {
|
|
26953
|
-
return defaultStyle$
|
|
27057
|
+
return defaultStyle$7 || (defaultStyle$7 = new RadioStyle());
|
|
26954
27058
|
}
|
|
26955
27059
|
constructor() {
|
|
26956
27060
|
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -27039,12 +27143,178 @@
|
|
|
27039
27143
|
}
|
|
27040
27144
|
}
|
|
27041
27145
|
|
|
27146
|
+
let defaultStyle$6;
|
|
27147
|
+
class SwitchStyle extends Style$1 {
|
|
27148
|
+
static get DEFAULT() {
|
|
27149
|
+
return defaultStyle$6 || (defaultStyle$6 = new SwitchStyle());
|
|
27150
|
+
}
|
|
27151
|
+
constructor() {
|
|
27152
|
+
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
27153
|
+
let headerStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
27154
|
+
let switchThemeStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
27155
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
27156
|
+
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";
|
|
27157
|
+
}
|
|
27158
|
+
get spaceBetweenTextAndCircle() {
|
|
27159
|
+
return this._spaceBetweenTextAndCircle;
|
|
27160
|
+
}
|
|
27161
|
+
set spaceBetweenTextAndCircle(spaceBetweenTextAndCircle) {
|
|
27162
|
+
this._spaceBetweenTextAndCircle = spaceBetweenTextAndCircle;
|
|
27163
|
+
}
|
|
27164
|
+
get circleRadius() {
|
|
27165
|
+
return this._circleRadius;
|
|
27166
|
+
}
|
|
27167
|
+
set circleRadius(circleRadius) {
|
|
27168
|
+
this._circleRadius = circleRadius;
|
|
27169
|
+
}
|
|
27170
|
+
get boxWidth() {
|
|
27171
|
+
return this._boxWidth;
|
|
27172
|
+
}
|
|
27173
|
+
set boxWidth(boxWidth) {
|
|
27174
|
+
this._boxWidth = boxWidth;
|
|
27175
|
+
}
|
|
27176
|
+
get boxHeight() {
|
|
27177
|
+
return this._boxHeight;
|
|
27178
|
+
}
|
|
27179
|
+
set boxHeight(boxHeight) {
|
|
27180
|
+
this._boxHeight = boxHeight;
|
|
27181
|
+
}
|
|
27182
|
+
get checkedFill() {
|
|
27183
|
+
return this._checkedFill;
|
|
27184
|
+
}
|
|
27185
|
+
set checkedFill(checkedFill) {
|
|
27186
|
+
this._checkedFill = checkedFill;
|
|
27187
|
+
}
|
|
27188
|
+
get uncheckedFill() {
|
|
27189
|
+
return this._uncheckedFill;
|
|
27190
|
+
}
|
|
27191
|
+
set uncheckedFill(uncheckedFill) {
|
|
27192
|
+
this._uncheckedFill = uncheckedFill;
|
|
27193
|
+
}
|
|
27194
|
+
get disableCheckedFill() {
|
|
27195
|
+
return this._disableCheckedFill;
|
|
27196
|
+
}
|
|
27197
|
+
set disableCheckedFill(disableCheckedFill) {
|
|
27198
|
+
this._disableCheckedFill = disableCheckedFill;
|
|
27199
|
+
}
|
|
27200
|
+
get disableUncheckedFill() {
|
|
27201
|
+
return this._disableUncheckedFill;
|
|
27202
|
+
}
|
|
27203
|
+
set disableUncheckedFill(disableUncheckedFill) {
|
|
27204
|
+
this._disableUncheckedFill = disableUncheckedFill;
|
|
27205
|
+
}
|
|
27206
|
+
get circleFill() {
|
|
27207
|
+
return this._circleFill;
|
|
27208
|
+
}
|
|
27209
|
+
set circleFill(circleFill) {
|
|
27210
|
+
this._circleFill = circleFill;
|
|
27211
|
+
}
|
|
27212
|
+
getStyle(style) {
|
|
27213
|
+
return new SwitchStyle(style, this);
|
|
27214
|
+
}
|
|
27215
|
+
clone() {
|
|
27216
|
+
return new SwitchStyle(this);
|
|
27217
|
+
}
|
|
27218
|
+
}
|
|
27219
|
+
|
|
27220
|
+
let defaultStyle$5;
|
|
27221
|
+
class ButtonStyle extends Style$1 {
|
|
27222
|
+
static get DEFAULT() {
|
|
27223
|
+
return defaultStyle$5 || (defaultStyle$5 = new ButtonStyle());
|
|
27224
|
+
}
|
|
27225
|
+
constructor() {
|
|
27226
|
+
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
27227
|
+
let headerStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
27228
|
+
let buttonThemeStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
27229
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
27230
|
+
super(style, headerStyle), this._buttonColor = (null !== (_b = null === (_a = null == style ? void 0 : style.buttonStyle) || void 0 === _a ? void 0 : _a.buttonColor) && void 0 !== _b ? _b : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonColor) || "#165DFF", this._buttonBorderColor = (null !== (_d = null === (_c = null == style ? void 0 : style.buttonStyle) || void 0 === _c ? void 0 : _c.buttonBorderColor) && void 0 !== _d ? _d : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonBorderColor) || "#165DFF", this._buttonLineWidth = (null !== (_f = null === (_e = null == style ? void 0 : style.buttonStyle) || void 0 === _e ? void 0 : _e.buttonLineWidth) && void 0 !== _f ? _f : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonLineWidth) || 1, this._buttonBorderRadius = (null !== (_h = null === (_g = null == style ? void 0 : style.buttonStyle) || void 0 === _g ? void 0 : _g.buttonBorderRadius) && void 0 !== _h ? _h : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonBorderRadius) || 2, this._buttonHoverColor = (null !== (_k = null === (_j = null == style ? void 0 : style.buttonStyle) || void 0 === _j ? void 0 : _j.buttonHoverColor) && void 0 !== _k ? _k : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonHoverColor) || "#4080FF", this._buttonHoverBorderColor = (null !== (_m = null === (_l = null == style ? void 0 : style.buttonStyle) || void 0 === _l ? void 0 : _l.buttonHoverBorderColor) && void 0 !== _m ? _m : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonHoverBorderColor) || "#4080FF", this._buttonTextHoverColor = null !== (_p = null === (_o = null == style ? void 0 : style.buttonStyle) || void 0 === _o ? void 0 : _o.buttonTextHoverColor) && void 0 !== _p ? _p : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonTextHoverColor, this._buttonDisableColor = (null !== (_r = null === (_q = null == style ? void 0 : style.buttonStyle) || void 0 === _q ? void 0 : _q.buttonDisableColor) && void 0 !== _r ? _r : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonDisableColor) || "#94bfff", this._buttonDisableBorderColor = (null !== (_t = null === (_s = null == style ? void 0 : style.buttonStyle) || void 0 === _s ? void 0 : _s.buttonDisableBorderColor) && void 0 !== _t ? _t : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonDisableBorderColor) || "#94bfff", this._buttonTextDisableColor = null !== (_v = null === (_u = null == style ? void 0 : style.buttonStyle) || void 0 === _u ? void 0 : _u.buttonTextDisableColor) && void 0 !== _v ? _v : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonTextDisableColor, this._buttonPadding = (null !== (_x = null === (_w = null == style ? void 0 : style.buttonStyle) || void 0 === _w ? void 0 : _w.buttonPadding) && void 0 !== _x ? _x : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonPadding) || 10;
|
|
27231
|
+
}
|
|
27232
|
+
get buttonColor() {
|
|
27233
|
+
return this._buttonColor;
|
|
27234
|
+
}
|
|
27235
|
+
set buttonColor(buttonColor) {
|
|
27236
|
+
this._buttonColor = buttonColor;
|
|
27237
|
+
}
|
|
27238
|
+
get buttonBorderColor() {
|
|
27239
|
+
return this._buttonBorderColor;
|
|
27240
|
+
}
|
|
27241
|
+
set buttonBorderColor(buttonBorderColor) {
|
|
27242
|
+
this._buttonBorderColor = buttonBorderColor;
|
|
27243
|
+
}
|
|
27244
|
+
get buttonLineWidth() {
|
|
27245
|
+
return this._buttonLineWidth;
|
|
27246
|
+
}
|
|
27247
|
+
set buttonLineWidth(buttonLineWidth) {
|
|
27248
|
+
this._buttonLineWidth = buttonLineWidth;
|
|
27249
|
+
}
|
|
27250
|
+
get buttonBorderRadius() {
|
|
27251
|
+
return this._buttonBorderRadius;
|
|
27252
|
+
}
|
|
27253
|
+
set buttonBorderRadius(buttonBorderRadius) {
|
|
27254
|
+
this._buttonBorderRadius = buttonBorderRadius;
|
|
27255
|
+
}
|
|
27256
|
+
get buttonHoverColor() {
|
|
27257
|
+
return this._buttonHoverColor;
|
|
27258
|
+
}
|
|
27259
|
+
set buttonHoverColor(buttonHoverColor) {
|
|
27260
|
+
this._buttonHoverColor = buttonHoverColor;
|
|
27261
|
+
}
|
|
27262
|
+
get buttonHoverBorderColor() {
|
|
27263
|
+
return this._buttonHoverBorderColor;
|
|
27264
|
+
}
|
|
27265
|
+
set buttonHoverBorderColor(buttonHoverBorderColor) {
|
|
27266
|
+
this._buttonHoverBorderColor = buttonHoverBorderColor;
|
|
27267
|
+
}
|
|
27268
|
+
get buttonTextHoverColor() {
|
|
27269
|
+
return this._buttonTextHoverColor;
|
|
27270
|
+
}
|
|
27271
|
+
set buttonTextHoverColor(buttonTextHoverColor) {
|
|
27272
|
+
this._buttonTextHoverColor = buttonTextHoverColor;
|
|
27273
|
+
}
|
|
27274
|
+
get buttonDisableColor() {
|
|
27275
|
+
return this._buttonDisableColor;
|
|
27276
|
+
}
|
|
27277
|
+
set buttonDisableColor(buttonDisableColor) {
|
|
27278
|
+
this._buttonDisableColor = buttonDisableColor;
|
|
27279
|
+
}
|
|
27280
|
+
get buttonDisableBorderColor() {
|
|
27281
|
+
return this._buttonDisableBorderColor;
|
|
27282
|
+
}
|
|
27283
|
+
set buttonDisableBorderColor(buttonDisableBorderColor) {
|
|
27284
|
+
this._buttonDisableBorderColor = buttonDisableBorderColor;
|
|
27285
|
+
}
|
|
27286
|
+
get buttonTextDisableColor() {
|
|
27287
|
+
return this._buttonTextDisableColor;
|
|
27288
|
+
}
|
|
27289
|
+
set buttonTextDisableColor(buttonTextDisableColor) {
|
|
27290
|
+
this._buttonTextDisableColor = buttonTextDisableColor;
|
|
27291
|
+
}
|
|
27292
|
+
get buttonTextHoverBorderColor() {
|
|
27293
|
+
return this._buttonTextHoverBorderColor;
|
|
27294
|
+
}
|
|
27295
|
+
set buttonTextHoverBorderColor(buttonTextHoverBorderColor) {
|
|
27296
|
+
this._buttonTextHoverBorderColor = buttonTextHoverBorderColor;
|
|
27297
|
+
}
|
|
27298
|
+
get buttonPadding() {
|
|
27299
|
+
return this._buttonPadding;
|
|
27300
|
+
}
|
|
27301
|
+
set buttonPadding(buttonPadding) {
|
|
27302
|
+
this._buttonPadding = buttonPadding;
|
|
27303
|
+
}
|
|
27304
|
+
getStyle(style) {
|
|
27305
|
+
return new ButtonStyle(style, this);
|
|
27306
|
+
}
|
|
27307
|
+
clone() {
|
|
27308
|
+
return new ButtonStyle(this);
|
|
27309
|
+
}
|
|
27310
|
+
}
|
|
27311
|
+
|
|
27042
27312
|
function of$2(columnStyle, bodyStyle, styleArg) {
|
|
27043
27313
|
let StyleClassDef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Style$1;
|
|
27044
27314
|
let globalAutoWrapText = arguments.length > 4 ? arguments[4] : undefined;
|
|
27045
27315
|
let theme = arguments.length > 5 ? arguments[5] : undefined;
|
|
27046
|
-
var _a, _b;
|
|
27047
|
-
return columnStyle || bodyStyle ? columnStyle instanceof Style$1 ? columnStyle : "function" == typeof columnStyle ? of$2(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText, theme) : (columnStyle || (columnStyle = {}), globalAutoWrapText && !isValid$3(columnStyle.autoWrapText) && (columnStyle.autoWrapText = !0), StyleClassDef === CheckboxStyle$1 ? new CheckboxStyle$1(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle ? new RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
|
|
27316
|
+
var _a, _b, _c, _d;
|
|
27317
|
+
return columnStyle || bodyStyle ? columnStyle instanceof Style$1 ? columnStyle : "function" == typeof columnStyle ? of$2(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText, theme) : (columnStyle || (columnStyle = {}), globalAutoWrapText && !isValid$3(columnStyle.autoWrapText) && (columnStyle.autoWrapText = !0), StyleClassDef === CheckboxStyle$1 ? new CheckboxStyle$1(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle ? new RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : StyleClassDef === SwitchStyle ? new SwitchStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_c = theme.switchStyle) && void 0 !== _c ? _c : {}) : StyleClassDef === ButtonStyle ? new 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;
|
|
27048
27318
|
}
|
|
27049
27319
|
|
|
27050
27320
|
class Env {
|
|
@@ -27453,6 +27723,7 @@
|
|
|
27453
27723
|
MOUSELEAVE_AXIS: "mouseleave_axis",
|
|
27454
27724
|
CHECKBOX_STATE_CHANGE: "checkbox_state_change",
|
|
27455
27725
|
RADIO_STATE_CHANGE: "radio_state_change",
|
|
27726
|
+
SWITCH_STATE_CHANGE: "switch_state_change",
|
|
27456
27727
|
AFTER_RENDER: "after_render",
|
|
27457
27728
|
INITIALIZED: "initialized",
|
|
27458
27729
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
@@ -27460,7 +27731,8 @@
|
|
|
27460
27731
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
27461
27732
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
27462
27733
|
EMPTY_TIP_CLICK: "empty_tip_click",
|
|
27463
|
-
EMPTY_TIP_DBLCLICK: "empty_tip_dblclick"
|
|
27734
|
+
EMPTY_TIP_DBLCLICK: "empty_tip_dblclick",
|
|
27735
|
+
BUTTON_CLICK: "button_click"
|
|
27464
27736
|
};
|
|
27465
27737
|
|
|
27466
27738
|
const judgeType = value => {
|
|
@@ -28345,7 +28617,7 @@
|
|
|
28345
28617
|
}
|
|
28346
28618
|
class TableTheme {
|
|
28347
28619
|
constructor(obj, superTheme) {
|
|
28348
|
-
this._defaultStyle = null, this._header = null, this._cornerHeader = null, this._cornerRightTopCell = null, this._cornerLeftBottomCell = null, this._cornerRightBottomCell = null, this._rightFrozen = null, this._bottomFrozen = null, this._rowHeader = null, this._body = null, this._groupTitle = null, this._scroll = null, this._tooltip = null, this._frameStyle = null, this._columnResize = null, this._dragHeaderSplitLine = null, this._frozenColumnLine = null, this._selectionStyle = null, this._axisStyle = null, this._checkboxStyle = null, this._radioStyle = null, this._textPopTipStyle = null, this._internalIconsStyle = null, this.isPivot = !1, this.name = "", this.internalTheme = {
|
|
28620
|
+
this._defaultStyle = null, this._header = null, this._cornerHeader = null, this._cornerRightTopCell = null, this._cornerLeftBottomCell = null, this._cornerRightBottomCell = null, this._rightFrozen = null, this._bottomFrozen = null, this._rowHeader = null, this._body = null, this._groupTitle = null, this._scroll = null, this._tooltip = null, this._frameStyle = null, this._columnResize = null, this._dragHeaderSplitLine = null, this._frozenColumnLine = null, this._selectionStyle = null, this._axisStyle = null, this._checkboxStyle = null, this._radioStyle = null, this._switchStyle = null, this._buttonStyle = null, this._textPopTipStyle = null, this._internalIconsStyle = null, this.isPivot = !1, this.name = "", this.internalTheme = {
|
|
28349
28621
|
obj: obj,
|
|
28350
28622
|
superTheme: superTheme
|
|
28351
28623
|
}, this.name = getProp$1(obj, superTheme, ["name"]);
|
|
@@ -28979,6 +29251,28 @@
|
|
|
28979
29251
|
}
|
|
28980
29252
|
return this._radioStyle;
|
|
28981
29253
|
}
|
|
29254
|
+
get switchStyle() {
|
|
29255
|
+
if (!this._switchStyle) {
|
|
29256
|
+
const {
|
|
29257
|
+
obj: obj,
|
|
29258
|
+
superTheme: superTheme
|
|
29259
|
+
} = this.internalTheme,
|
|
29260
|
+
switchStyle = ingoreNoneValueMerge({}, superTheme.switchStyle, obj.switchStyle);
|
|
29261
|
+
this._switchStyle = switchStyle;
|
|
29262
|
+
}
|
|
29263
|
+
return this._switchStyle;
|
|
29264
|
+
}
|
|
29265
|
+
get buttonStyle() {
|
|
29266
|
+
if (!this._buttonStyle) {
|
|
29267
|
+
const {
|
|
29268
|
+
obj: obj,
|
|
29269
|
+
superTheme: superTheme
|
|
29270
|
+
} = this.internalTheme,
|
|
29271
|
+
buttonStyle = ingoreNoneValueMerge({}, superTheme.buttonStyle, obj.buttonStyle);
|
|
29272
|
+
this._buttonStyle = buttonStyle;
|
|
29273
|
+
}
|
|
29274
|
+
return this._buttonStyle;
|
|
29275
|
+
}
|
|
28982
29276
|
get textPopTipStyle() {
|
|
28983
29277
|
if (!this._textPopTipStyle) {
|
|
28984
29278
|
const {
|
|
@@ -32019,6 +32313,12 @@
|
|
|
32019
32313
|
super.setAttributes(params, forceUpdateTag, context), params.gif && this.loadGif();
|
|
32020
32314
|
}
|
|
32021
32315
|
}
|
|
32316
|
+
class TextIcon extends Text {
|
|
32317
|
+
constructor(params) {
|
|
32318
|
+
var _a, _b, _c, _d, _e;
|
|
32319
|
+
params.fill = null !== (_a = params.fill) && void 0 !== _a ? _a : "#00F", params.fontSize = null !== (_b = params.fontSize) && void 0 !== _b ? _b : 12, params.underline = null !== (_c = params.underline) && void 0 !== _c ? _c : 1, params.textBaseline = null !== (_d = params.textBaseline) && void 0 !== _d ? _d : "top", params.cursor = null !== (_e = params.cursor) && void 0 !== _e ? _e : "pointer", super(params);
|
|
32320
|
+
}
|
|
32321
|
+
}
|
|
32022
32322
|
|
|
32023
32323
|
function emptyCustomLayout(args) {
|
|
32024
32324
|
return {
|
|
@@ -32760,24 +33060,6 @@
|
|
|
32760
33060
|
cursor: "pointer"
|
|
32761
33061
|
};
|
|
32762
33062
|
},
|
|
32763
|
-
get loading() {
|
|
32764
|
-
return {
|
|
32765
|
-
type: "image",
|
|
32766
|
-
src: "https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/media/loading-circle.gif",
|
|
32767
|
-
width: collapse_size,
|
|
32768
|
-
height: collapse_size,
|
|
32769
|
-
name: "loading",
|
|
32770
|
-
positionType: IconPosition.contentLeft,
|
|
32771
|
-
marginLeft: 0,
|
|
32772
|
-
marginRight: 4,
|
|
32773
|
-
hover: {
|
|
32774
|
-
width: collapse_size_2,
|
|
32775
|
-
height: collapse_size_2,
|
|
32776
|
-
bgColor: "rgba(101, 117, 168, 0.1)"
|
|
32777
|
-
},
|
|
32778
|
-
isGif: !0
|
|
32779
|
-
};
|
|
32780
|
-
},
|
|
32781
33063
|
get drillDown() {
|
|
32782
33064
|
return {
|
|
32783
33065
|
name: "drillDown",
|
|
@@ -33064,7 +33346,7 @@
|
|
|
33064
33346
|
updateCenterLayout(contentWidth) {
|
|
33065
33347
|
let textWidth = contentWidth;
|
|
33066
33348
|
this._centerGroup.forEachChildren(child => {
|
|
33067
|
-
child instanceof Icon && (textWidth -= child.AABBBounds.width());
|
|
33349
|
+
(child instanceof Icon || child instanceof TextIcon) && (textWidth -= child.AABBBounds.width());
|
|
33068
33350
|
});
|
|
33069
33351
|
const text = this._centerGroup.getChildByName("text");
|
|
33070
33352
|
text instanceof RichText ? text.setAttribute("width", textWidth) : text instanceof Text && text.setAttribute("maxLineWidth", textWidth);
|
|
@@ -33249,10 +33531,9 @@
|
|
|
33249
33531
|
var _a, _b, _c, _d, _e, _f;
|
|
33250
33532
|
const iconAttribute = {};
|
|
33251
33533
|
"image" === icon.type ? icon.isGif ? (iconAttribute.gif = icon.src, iconAttribute.image = icon.src) : iconAttribute.image = icon.src : ("svg" === icon.type || "svg" in icon) && (iconAttribute.image = icon.svg), iconAttribute.width = icon.width, iconAttribute.height = icon.height, iconAttribute.visibleTime = null !== (_a = icon.visibleTime) && void 0 !== _a ? _a : "always", iconAttribute.funcType = icon.funcType, iconAttribute.interactive = icon.interactive, iconAttribute.isGif = icon.isGif;
|
|
33252
|
-
let
|
|
33253
|
-
|
|
33254
|
-
|
|
33255
|
-
return iconMark.tooltip = icon.tooltip, iconMark.name = icon.name, iconMark;
|
|
33534
|
+
let iconMark,
|
|
33535
|
+
hierarchyOffset = 0;
|
|
33536
|
+
return dealWithIconComputeVar && 0 !== (null == dealWithIconComputeVar ? void 0 : dealWithIconComputeVar.addedHierarchyOffset) || !isNumber$4(col) || !isNumber$4(row) || !table || icon.funcType !== IconFuncTypeEnum.collapse && icon.funcType !== IconFuncTypeEnum.expand && icon.positionType !== IconPosition.contentLeft && icon.positionType !== IconPosition.contentRight || (hierarchyOffset = range ? getHierarchyOffset(range.start.col, range.start.row, table) : getHierarchyOffset(col, row, table), dealWithIconComputeVar && (dealWithIconComputeVar.addedHierarchyOffset = 1)), iconAttribute.marginLeft = (null !== (_b = icon.marginLeft) && void 0 !== _b ? _b : 0) + hierarchyOffset, iconAttribute.marginRight = null !== (_c = icon.marginRight) && void 0 !== _c ? _c : 0, !1 === icon.interactive && (iconAttribute.pickable = !1), icon.hover && (iconAttribute.backgroundWidth = null !== (_d = icon.hover.width) && void 0 !== _d ? _d : icon.width, iconAttribute.backgroundHeight = null !== (_e = icon.hover.width) && void 0 !== _e ? _e : icon.width, iconAttribute.backgroundColor = null !== (_f = icon.hover.bgColor) && void 0 !== _f ? _f : "rgba(22,44,66,0.2)", iconAttribute.hoverImage = icon.hover.image), icon.cursor && (iconAttribute.cursor = icon.cursor), "shape" in icon && "circle" === icon.shape && (iconAttribute.shape = icon.shape), mark ? (mark.setAttributes(iconAttribute), mark.loadImage(iconAttribute.image), mark.tooltip = icon.tooltip, mark.name = icon.name, mark) : ("text" === icon.type ? (iconAttribute.text = icon.content, merge$1(iconAttribute, icon.style), iconMark = new TextIcon(iconAttribute), iconMark.tooltip = icon.tooltip, iconMark.name = icon.name) : (iconMark = new Icon(iconAttribute), iconMark.tooltip = icon.tooltip, iconMark.name = icon.name), iconMark);
|
|
33256
33537
|
}
|
|
33257
33538
|
function dealWithRichTextIcon(icon) {
|
|
33258
33539
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -33737,6 +34018,10 @@
|
|
|
33737
34018
|
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
33738
34019
|
} else if ("radio" === type) {
|
|
33739
34020
|
cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
|
|
34021
|
+
} else if ("switch" === type) {
|
|
34022
|
+
cellGroup = Factory.getFunction("createSwitchCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
34023
|
+
} else if ("button" === type) {
|
|
34024
|
+
cellGroup = Factory.getFunction("createButtonCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
33740
34025
|
}
|
|
33741
34026
|
return cellGroup.onBeforeAttributeUpdate = onBeforeAttributeUpdateForInvertHighlight, cellGroup;
|
|
33742
34027
|
}
|
|
@@ -34029,7 +34314,8 @@
|
|
|
34029
34314
|
}
|
|
34030
34315
|
|
|
34031
34316
|
const utilCheckBoxMark = new CheckBox({}),
|
|
34032
|
-
utilRadioMark = new Radio({})
|
|
34317
|
+
utilRadioMark = new Radio({}),
|
|
34318
|
+
utilButtonMark = new Tag({});
|
|
34033
34319
|
function computeCheckboxCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
|
|
34034
34320
|
const text = isObject$7(cellValue) ? cellValue.text : cellValue,
|
|
34035
34321
|
lines = validToString(text).split("\n") || [],
|
|
@@ -34112,6 +34398,41 @@
|
|
|
34112
34398
|
} else maxHeight = Math.max(size, lines.length * lineHeight);
|
|
34113
34399
|
return maxHeight;
|
|
34114
34400
|
}
|
|
34401
|
+
function computeSwitchCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
|
|
34402
|
+
return getProp("boxWidth", actStyle, col, row, table);
|
|
34403
|
+
}
|
|
34404
|
+
function computeButtonCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
|
|
34405
|
+
const text = isObject$7(cellValue) ? cellValue.text : cellValue,
|
|
34406
|
+
lines = validToString(text).split("\n") || [],
|
|
34407
|
+
cellWidth = table.getColsWidth(col, endCol),
|
|
34408
|
+
buttonPadding = getProp("buttonPadding", actStyle, col, row, table),
|
|
34409
|
+
buttonLineWidth = getProp("buttonLineWidth", actStyle, col, row, table);
|
|
34410
|
+
let maxHeight = 0;
|
|
34411
|
+
if (autoWrapText) {
|
|
34412
|
+
const maxLineWidth = cellWidth - (padding[1] + padding[3]);
|
|
34413
|
+
utilButtonMark.setAttributes({
|
|
34414
|
+
text: lines,
|
|
34415
|
+
textStyle: {
|
|
34416
|
+
maxLineWidth: maxLineWidth,
|
|
34417
|
+
fontSize: fontSize,
|
|
34418
|
+
fontStyle: fontStyle,
|
|
34419
|
+
fontWeight: fontWeight,
|
|
34420
|
+
fontFamily: fontFamily,
|
|
34421
|
+
lineHeight: lineHeight,
|
|
34422
|
+
wordBreak: "break-word",
|
|
34423
|
+
lineClamp: lineClamp
|
|
34424
|
+
},
|
|
34425
|
+
padding: buttonPadding,
|
|
34426
|
+
panel: {
|
|
34427
|
+
visible: !0,
|
|
34428
|
+
fill: "red",
|
|
34429
|
+
stroke: "red",
|
|
34430
|
+
lineWidth: buttonLineWidth
|
|
34431
|
+
}
|
|
34432
|
+
}), utilRadioMark.render(), maxHeight = utilRadioMark.AABBBounds.height();
|
|
34433
|
+
} else maxHeight = lines.length * lineHeight + 2 * buttonPadding;
|
|
34434
|
+
return maxHeight;
|
|
34435
|
+
}
|
|
34115
34436
|
|
|
34116
34437
|
let customAlphabetCharSet = "",
|
|
34117
34438
|
textMeasureMode = "quick";
|
|
@@ -34537,7 +34858,7 @@
|
|
|
34537
34858
|
underline = getProp("underline", actStyle, col, row, table),
|
|
34538
34859
|
underlineOffset = null !== (_c = getProp("underlineOffset", actStyle, col, row, table)) && void 0 !== _c ? _c : 0;
|
|
34539
34860
|
let text;
|
|
34540
|
-
if ("text" !== cellType && "link" !== cellType && "progressbar" !== cellType && "checkbox" !== cellType && "radio" !== cellType) maxHeight = lineHeight;else if ("checkbox" === cellType) maxHeight = computeCheckboxCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);else if ("radio" === cellType) maxHeight = computeRadioCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);else {
|
|
34861
|
+
if ("text" !== cellType && "link" !== cellType && "progressbar" !== cellType && "checkbox" !== cellType && "radio" !== cellType && "switch" !== cellType && "button" !== cellType) maxHeight = lineHeight;else if ("checkbox" === cellType) maxHeight = computeCheckboxCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);else if ("radio" === cellType) maxHeight = computeRadioCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);else if ("switch" === cellType) maxHeight = computeSwitchCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);else if ("button" === cellType) maxHeight = computeButtonCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);else {
|
|
34541
34862
|
text = cellValue;
|
|
34542
34863
|
const lines = breakString(text, table).text,
|
|
34543
34864
|
cellWidth = table.getColsWidth(col, endCol);
|
|
@@ -35168,10 +35489,12 @@
|
|
|
35168
35489
|
getMenuInfo(col, row, type) {
|
|
35169
35490
|
var _a;
|
|
35170
35491
|
if (type === MenuType.dropDown) {
|
|
35171
|
-
|
|
35172
|
-
|
|
35173
|
-
|
|
35174
|
-
|
|
35492
|
+
let dropDownMenu = this._table.globalDropDownMenu;
|
|
35493
|
+
dropDownMenu = this._table._getHeaderLayoutMap(col, row).dropDownMenu, "function" == typeof dropDownMenu && (dropDownMenu = dropDownMenu({
|
|
35494
|
+
row: row,
|
|
35495
|
+
col: col,
|
|
35496
|
+
table: this._table
|
|
35497
|
+
}));
|
|
35175
35498
|
let highlightIndex = -1;
|
|
35176
35499
|
if (Array.isArray(dropDownMenu)) for (let i = 0; i < dropDownMenu.length; i++) if (this._table._dropDownMenuIsHighlight(col, row, i)) {
|
|
35177
35500
|
highlightIndex = i;
|
|
@@ -36132,7 +36455,7 @@
|
|
|
36132
36455
|
}
|
|
36133
36456
|
}
|
|
36134
36457
|
activate(table) {
|
|
36135
|
-
var _a, _b, _c, _d;
|
|
36458
|
+
var _a, _b, _c, _d, _e;
|
|
36136
36459
|
this.active = !0;
|
|
36137
36460
|
const {
|
|
36138
36461
|
col: col,
|
|
@@ -36150,7 +36473,7 @@
|
|
|
36150
36473
|
y1: y1 - table.scrollTop,
|
|
36151
36474
|
y2: y2 - table.scrollTop
|
|
36152
36475
|
});
|
|
36153
|
-
this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge$1({}, this.attribute.tableChartOption, {
|
|
36476
|
+
null === (_a = this.activeChartInstance) || void 0 === _a || _a.release(), this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge$1({}, this.attribute.tableChartOption, {
|
|
36154
36477
|
renderCanvas: this.attribute.canvas,
|
|
36155
36478
|
mode: "desktop-browser",
|
|
36156
36479
|
canvasControled: !1,
|
|
@@ -36178,7 +36501,7 @@
|
|
|
36178
36501
|
const chartStage = this.activeChartInstance.getStage(),
|
|
36179
36502
|
matrix = this.globalTransMatrix.clone(),
|
|
36180
36503
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
36181
|
-
matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (
|
|
36504
|
+
matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, this.activeChartInstance), this.activeChartInstance.on("click", params => {
|
|
36182
36505
|
var _a;
|
|
36183
36506
|
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
|
|
36184
36507
|
}), this.activeChartInstance.on("brushEnd", params => {
|
|
@@ -36186,7 +36509,7 @@
|
|
|
36186
36509
|
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
36187
36510
|
Chart.temp = 1;
|
|
36188
36511
|
}, 0);
|
|
36189
|
-
}), null === (
|
|
36512
|
+
}), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
|
|
36190
36513
|
}
|
|
36191
36514
|
deactivate() {
|
|
36192
36515
|
var _a, _b;
|
|
@@ -36241,7 +36564,7 @@
|
|
|
36241
36564
|
return isHandlingChartQueue;
|
|
36242
36565
|
}
|
|
36243
36566
|
function renderChart(chart) {
|
|
36244
|
-
var _a, _b, _c, _d, _e, _f;
|
|
36567
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
36245
36568
|
const {
|
|
36246
36569
|
axes: axes,
|
|
36247
36570
|
dataId: dataId,
|
|
@@ -36288,10 +36611,10 @@
|
|
|
36288
36611
|
} = chart.getRootNode();
|
|
36289
36612
|
let updateSpec = !1;
|
|
36290
36613
|
if (table.options.specFormat) {
|
|
36291
|
-
const formatResult = table.options.specFormat(chart.attribute.spec);
|
|
36614
|
+
const formatResult = table.options.specFormat(chart.attribute.spec, chartInstance, chart);
|
|
36292
36615
|
if (formatResult.needFormatSpec && formatResult.spec) {
|
|
36293
36616
|
const spec = formatResult.spec;
|
|
36294
|
-
chartInstance.updateSpecSync(spec), updateSpec =
|
|
36617
|
+
chartInstance.updateSpecSync(spec), updateSpec = null === (_a = formatResult.updateSpec) || void 0 === _a || _a;
|
|
36295
36618
|
}
|
|
36296
36619
|
}
|
|
36297
36620
|
if (!updateSpec) if (null == axes || axes.forEach((axis, index) => {
|
|
@@ -36311,7 +36634,7 @@
|
|
|
36311
36634
|
tickMode: null === (_e = axis.tick) || void 0 === _e ? void 0 : _e.tickMode
|
|
36312
36635
|
}
|
|
36313
36636
|
}, !0);
|
|
36314
|
-
}), null === (
|
|
36637
|
+
}), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId) chartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
36315
36638
|
const dataBatch = [];
|
|
36316
36639
|
for (const dataIdStr in dataId) {
|
|
36317
36640
|
const dataIdAndField = dataId[dataIdStr],
|
|
@@ -36321,11 +36644,11 @@
|
|
|
36321
36644
|
});
|
|
36322
36645
|
dataBatch.push({
|
|
36323
36646
|
id: dataIdStr,
|
|
36324
|
-
values: dataIdAndField ? null !== (
|
|
36325
|
-
fields: null === (
|
|
36326
|
-
}), chartInstance.updateFullDataSync || chartInstance.updateDataSync(dataIdStr, dataIdAndField ? null !== (
|
|
36647
|
+
values: dataIdAndField ? null !== (_d = null == data ? void 0 : data.filter(item => item.hasOwnProperty(dataIdAndField))) && void 0 !== _d ? _d : [] : null != data ? data : [],
|
|
36648
|
+
fields: null === (_e = null == series ? void 0 : series.data) || void 0 === _e ? void 0 : _e.fields
|
|
36649
|
+
}), chartInstance.updateFullDataSync || chartInstance.updateDataSync(dataIdStr, dataIdAndField ? null !== (_f = null == data ? void 0 : data.filter(item => item.hasOwnProperty(dataIdAndField))) && void 0 !== _f ? _f : [] : null != data ? data : []);
|
|
36327
36650
|
}
|
|
36328
|
-
null === (
|
|
36651
|
+
null === (_g = chartInstance.updateFullDataSync) || void 0 === _g || _g.call(chartInstance, dataBatch);
|
|
36329
36652
|
}
|
|
36330
36653
|
cacheStageCanvas(chartInstance.getStage(), chart);
|
|
36331
36654
|
}
|
|
@@ -36447,10 +36770,10 @@
|
|
|
36447
36770
|
context.drawImage(canvas, x, y, width, height);
|
|
36448
36771
|
}) : context.drawImage(cacheCanvas, x, y, width, height);else if (activeChartInstance) {
|
|
36449
36772
|
if (table.options.specFormat) {
|
|
36450
|
-
const formatResult = table.options.specFormat(chart.attribute.spec);
|
|
36773
|
+
const formatResult = table.options.specFormat(chart.attribute.spec, activeChartInstance, chart);
|
|
36451
36774
|
if (formatResult.needFormatSpec && formatResult.spec) {
|
|
36452
36775
|
const spec = formatResult.spec;
|
|
36453
|
-
|
|
36776
|
+
activeChartInstance.updateSpecSync(spec);
|
|
36454
36777
|
}
|
|
36455
36778
|
}
|
|
36456
36779
|
const viewBox = chart.getViewBox();
|
|
@@ -37290,10 +37613,10 @@
|
|
|
37290
37613
|
actualWidth = 0;
|
|
37291
37614
|
for (let col = 0; col < table.colCount; col++) {
|
|
37292
37615
|
const colWidth = update && null !== (_f = newWidths[col]) && void 0 !== _f ? _f : table.getColWidth(col);
|
|
37293
|
-
(col < table.rowHeaderLevelCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
|
|
37616
|
+
(col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
|
|
37294
37617
|
}
|
|
37295
37618
|
if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
|
|
37296
|
-
getAdaptiveWidth(canvasWidth - actualHeaderWidth, table.rowHeaderLevelCount, table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount, update, newWidths, table);
|
|
37619
|
+
getAdaptiveWidth(canvasWidth - actualHeaderWidth, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount, update, newWidths, table);
|
|
37297
37620
|
}
|
|
37298
37621
|
}
|
|
37299
37622
|
if (update) {
|
|
@@ -37347,7 +37670,7 @@
|
|
|
37347
37670
|
continue;
|
|
37348
37671
|
}
|
|
37349
37672
|
const cellType = table.isHeader(col, row) ? null === (_a = table._getHeaderLayoutMap(col, row)) || void 0 === _a ? void 0 : _a.headerType : table.getBodyColumnType(col, row);
|
|
37350
|
-
if (isValid$3(cellType) && "text" !== cellType && "link" !== cellType && "progressbar" !== cellType && "checkbox" !== cellType && "radio" !== cellType) {
|
|
37673
|
+
if (isValid$3(cellType) && "text" !== cellType && "link" !== cellType && "progressbar" !== cellType && "checkbox" !== cellType && "radio" !== cellType && "switch" !== cellType && "button" !== cellType) {
|
|
37351
37674
|
maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);
|
|
37352
37675
|
continue;
|
|
37353
37676
|
}
|
|
@@ -37416,7 +37739,7 @@
|
|
|
37416
37739
|
}
|
|
37417
37740
|
}
|
|
37418
37741
|
function computeTextWidth(col, row, cellType, table) {
|
|
37419
|
-
var _a, _b, _c;
|
|
37742
|
+
var _a, _b, _c, _d;
|
|
37420
37743
|
let maxWidth = 0;
|
|
37421
37744
|
const cellValue = table.getCellValue(col, row),
|
|
37422
37745
|
actStyle = table._getCellStyle(col, row);
|
|
@@ -37455,6 +37778,17 @@
|
|
|
37455
37778
|
text += (isObject$7(line) ? line.text : line).toString();
|
|
37456
37779
|
});
|
|
37457
37780
|
} else text = isObject$7(cellValue) ? cellValue.text : cellValue;
|
|
37781
|
+
} else if ("button" === cellType) {
|
|
37782
|
+
const define = table.getBodyColumnDefine(col, row),
|
|
37783
|
+
buttonTextValue = getOrApply(define.text, {
|
|
37784
|
+
col: col,
|
|
37785
|
+
row: row,
|
|
37786
|
+
table: table,
|
|
37787
|
+
context: null,
|
|
37788
|
+
value: cellValue,
|
|
37789
|
+
dataValue: table.getCellOriginValue(col, row)
|
|
37790
|
+
});
|
|
37791
|
+
text = null !== (_c = null != buttonTextValue ? buttonTextValue : cellValue) && void 0 !== _c ? _c : "";
|
|
37458
37792
|
} else text = cellValue;
|
|
37459
37793
|
const lines = breakString(text, table).text;
|
|
37460
37794
|
if (lines.length >= 1 && (1 !== lines.length || "" !== lines[0]) ? lines.forEach(line => {
|
|
@@ -37478,9 +37812,15 @@
|
|
|
37478
37812
|
if (isArray$7(cellValue)) {
|
|
37479
37813
|
const define = table.getBodyColumnDefine(col, row),
|
|
37480
37814
|
spaceBetweenRadio = getProp("spaceBetweenRadio", actStyle, col, row, table),
|
|
37481
|
-
radioDirectionInCell = null !== (
|
|
37815
|
+
radioDirectionInCell = null !== (_d = null == define ? void 0 : define.radioDirectionInCell) && void 0 !== _d ? _d : "vertical";
|
|
37482
37816
|
"vertical" === radioDirectionInCell ? (maxWidth += circleSize, maxWidth += spaceBetweenTextAndIcon) : "horizontal" === radioDirectionInCell && (maxWidth += (circleSize + spaceBetweenTextAndIcon) * cellValue.length, maxWidth += spaceBetweenRadio * (cellValue.length - 1));
|
|
37483
37817
|
} else maxWidth += circleSize, text && (maxWidth += spaceBetweenTextAndIcon);
|
|
37818
|
+
} else if ("switch" === cellType) {
|
|
37819
|
+
const boxWidth = getProp("boxWidth", actStyle, col, row, table);
|
|
37820
|
+
maxWidth = boxWidth;
|
|
37821
|
+
} else if ("button" === cellType) {
|
|
37822
|
+
const buttonPadding = getProp("buttonPadding", actStyle, col, row, table);
|
|
37823
|
+
maxWidth += 2 * buttonPadding;
|
|
37484
37824
|
}
|
|
37485
37825
|
return maxWidth;
|
|
37486
37826
|
}
|
|
@@ -40337,7 +40677,7 @@
|
|
|
40337
40677
|
class Scenegraph {
|
|
40338
40678
|
constructor(table) {
|
|
40339
40679
|
let width, height;
|
|
40340
|
-
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map(), setPoptipTheme(this.table.theme.textPopTipStyle), table.options.canvas && table.options.viewBox ? (vglobal.setEnv("browser"), width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) :
|
|
40680
|
+
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map(), setPoptipTheme(this.table.theme.textPopTipStyle), "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams), width = table.canvasWidth, height = table.canvasHeight) : table.options.canvas && table.options.viewBox ? (vglobal.setEnv("browser"), width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : (vglobal.setEnv("browser"), width = table.canvas.width, height = table.canvas.height), this.stage = createStage(Object.assign({
|
|
40341
40681
|
canvas: table.canvas,
|
|
40342
40682
|
width: width,
|
|
40343
40683
|
height: height,
|
|
@@ -40589,10 +40929,10 @@
|
|
|
40589
40929
|
null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) || void 0 === _b || _b.call(_a);
|
|
40590
40930
|
}
|
|
40591
40931
|
activateChart(col, row) {
|
|
40592
|
-
var _a, _b;
|
|
40932
|
+
var _a, _b, _c;
|
|
40593
40933
|
if (-1 === col || -1 === row) return;
|
|
40594
40934
|
const cellGroup = this.getCell(col, row);
|
|
40595
|
-
null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.activate) || void 0 === _b || _b.call(_a, this.table);
|
|
40935
|
+
return null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.activate) || void 0 === _b || _b.call(_a, this.table), null === (_c = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _c ? void 0 : _c.activeChartInstance;
|
|
40596
40936
|
}
|
|
40597
40937
|
removeInteractionBorder(col, row) {
|
|
40598
40938
|
const cellGroup = this.getCell(col, row);
|
|
@@ -41073,7 +41413,7 @@
|
|
|
41073
41413
|
const iconGraphic = this.getCell(col, row).getChildByName("collapse", !0);
|
|
41074
41414
|
if (iconGraphic) {
|
|
41075
41415
|
const loadingIcon = get$2()[InternalIconName.loadingIconName];
|
|
41076
|
-
dealWithIcon(loadingIcon, iconGraphic, col, row);
|
|
41416
|
+
loadingIcon && dealWithIcon(loadingIcon, iconGraphic, col, row);
|
|
41077
41417
|
}
|
|
41078
41418
|
}
|
|
41079
41419
|
temporarilyUpdateSelectRectStyle(rectAttribute) {
|
|
@@ -41884,7 +42224,7 @@
|
|
|
41884
42224
|
const define = table.getBodyColumnDefine(col, row),
|
|
41885
42225
|
field = null == define ? void 0 : define.field,
|
|
41886
42226
|
cellType = table.getCellType(col, row);
|
|
41887
|
-
if (isValid$3(field) && "
|
|
42227
|
+
if (isValid$3(field) && "radio" === cellType) {
|
|
41888
42228
|
const dataIndex = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row)),
|
|
41889
42229
|
columnState = null === (_a = table.stateManager.radioState) || void 0 === _a ? void 0 : _a[field];
|
|
41890
42230
|
if (isNumber$4(columnState)) {
|
|
@@ -42751,8 +43091,12 @@
|
|
|
42751
43091
|
col = cellAddress.col, row = cellAddress.row;
|
|
42752
43092
|
}
|
|
42753
43093
|
if (isValid$3(col) && isValid$3(row) && this.table.isCellRangeEqual(colNow, rowNow, col, row)) {
|
|
42754
|
-
|
|
42755
|
-
if (dropDownMenu
|
|
43094
|
+
let dropDownMenu = this.table._getHeaderLayoutMap(null != col ? col : colNow, null != row ? row : rowNow).dropDownMenu || this.table.globalDropDownMenu;
|
|
43095
|
+
if ("function" == typeof dropDownMenu && (dropDownMenu = dropDownMenu({
|
|
43096
|
+
row: row,
|
|
43097
|
+
col: col,
|
|
43098
|
+
table: this.table
|
|
43099
|
+
})), dropDownMenu) for (let i = 0; i < dropDownMenu.length; i++) {
|
|
42756
43100
|
const item = dropDownMenu[i];
|
|
42757
43101
|
if (isObject$7(item) && (item.menuKey || item.text) === (menuKey || "") && i === index) return !0;
|
|
42758
43102
|
if (isString$4(item) && item === menuKey && i === index) return !0;
|
|
@@ -43546,6 +43890,30 @@
|
|
|
43546
43890
|
radioIndexInCell: radioIndexInCell
|
|
43547
43891
|
});
|
|
43548
43892
|
table.fireListeners(TABLE_EVENT_TYPE.RADIO_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
43893
|
+
}), table.scenegraph.tableGroup.addEventListener("switch_state_change", e => {
|
|
43894
|
+
var _a, _b;
|
|
43895
|
+
const eventArgsSet = getCellEventArgsSet(e),
|
|
43896
|
+
{
|
|
43897
|
+
col: col,
|
|
43898
|
+
row: row,
|
|
43899
|
+
target: target
|
|
43900
|
+
} = eventArgsSet.eventArgs,
|
|
43901
|
+
cellInfo = table.getCellInfo(col, row),
|
|
43902
|
+
mergeRange = getCellMergeInfo(table, col, row);
|
|
43903
|
+
if (mergeRange) for (let col = mergeRange.start.col; col <= mergeRange.end.col; col++) for (let row = mergeRange.start.row; row <= mergeRange.end.row; row++) {
|
|
43904
|
+
table.scenegraph.getCell(col, row).forEachChildren(switchComponent => {
|
|
43905
|
+
"switch" === switchComponent.name && switchComponent.setAttributes({
|
|
43906
|
+
checked: e.target.attribute.checked
|
|
43907
|
+
});
|
|
43908
|
+
});
|
|
43909
|
+
}
|
|
43910
|
+
const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
|
|
43911
|
+
event: e.nativeEvent,
|
|
43912
|
+
target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
|
|
43913
|
+
mergeCellInfo: null === (_b = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo,
|
|
43914
|
+
checked: e.detail.checked
|
|
43915
|
+
});
|
|
43916
|
+
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
43549
43917
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
43550
43918
|
var _a;
|
|
43551
43919
|
e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
|
|
@@ -44244,6 +44612,21 @@
|
|
|
44244
44612
|
});
|
|
44245
44613
|
}
|
|
44246
44614
|
|
|
44615
|
+
function bindButtonClickEvent(table) {
|
|
44616
|
+
table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
44617
|
+
const {
|
|
44618
|
+
col: col,
|
|
44619
|
+
row: row,
|
|
44620
|
+
target: target
|
|
44621
|
+
} = e;
|
|
44622
|
+
"button" !== target.name || target.attribute.disable || table.hasListeners(TABLE_EVENT_TYPE.BUTTON_CLICK) && table.fireListeners(TABLE_EVENT_TYPE.BUTTON_CLICK, {
|
|
44623
|
+
col: col,
|
|
44624
|
+
row: row,
|
|
44625
|
+
event: e.event
|
|
44626
|
+
});
|
|
44627
|
+
});
|
|
44628
|
+
}
|
|
44629
|
+
|
|
44247
44630
|
class EventManager {
|
|
44248
44631
|
constructor(table) {
|
|
44249
44632
|
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
@@ -44288,11 +44671,12 @@
|
|
|
44288
44671
|
}), this.table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
|
|
44289
44672
|
stateManager.hideMenu();
|
|
44290
44673
|
}), this.updateEventBinder(), bindMediaClick(this.table), this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
|
|
44291
|
-
var _a;
|
|
44674
|
+
var _a, _b, _c;
|
|
44292
44675
|
if (e.federatedEvent) {
|
|
44293
44676
|
const eventArgsSet = getCellEventArgsSet(e.federatedEvent),
|
|
44294
|
-
resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.targetCell)
|
|
44295
|
-
|
|
44677
|
+
resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.targetCell),
|
|
44678
|
+
disableDblclickAutoResizeColWidth = null !== (_b = this.table.options.disableDblclickAutoResizeColWidth) && void 0 !== _b ? _b : null === (_c = this.table.options.resize) || void 0 === _c ? void 0 : _c.disableDblclickAutoResizeColWidth;
|
|
44679
|
+
if (this.table.eventManager.checkCellFillhandle(eventArgsSet)) this.table.fireListeners(TABLE_EVENT_TYPE.DBLCLICK_FILL_HANDLE, {});else if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0 && !disableDblclickAutoResizeColWidth) {
|
|
44296
44680
|
this.table.scenegraph.updateAutoColWidth(resizeCol.col), this.table.internalProps._widthResizedColMap.add(resizeCol.col), this.table.scenegraph.updateChartSizeForResizeColWidth(resizeCol.col);
|
|
44297
44681
|
const state = this.table.stateManager;
|
|
44298
44682
|
state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
@@ -44304,7 +44688,7 @@
|
|
|
44304
44688
|
});
|
|
44305
44689
|
}
|
|
44306
44690
|
}
|
|
44307
|
-
}), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table);
|
|
44691
|
+
}), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindButtonClickEvent(this.table);
|
|
44308
44692
|
}
|
|
44309
44693
|
dealTableHover(eventArgsSet) {
|
|
44310
44694
|
if (!eventArgsSet) return void this.table.stateManager.updateHoverPos(-1, -1);
|
|
@@ -44327,7 +44711,7 @@
|
|
|
44327
44711
|
eventArgs: eventArgs
|
|
44328
44712
|
} = eventArgsSet;
|
|
44329
44713
|
if (eventArgs) {
|
|
44330
|
-
if ("checkbox" === eventArgs.target.name || "radio" === eventArgs.target.name) return !1;
|
|
44714
|
+
if ("checkbox" === eventArgs.target.name || "radio" === eventArgs.target.name || "switch" === eventArgs.target.name || "button" === eventArgs.target.name) return !1;
|
|
44331
44715
|
if (this.table.isHeader(eventArgs.col, eventArgs.row) && isCellDisableSelect(this.table, eventArgs.col, eventArgs.row)) return isSelectMoving || this.table.stateManager.updateSelectPos(-1, -1), !1;
|
|
44332
44716
|
if (!this.table.isHeader(eventArgs.col, eventArgs.row) && isCellDisableSelect(this.table, eventArgs.col, eventArgs.row)) {
|
|
44333
44717
|
if (!isSelectMoving) {
|
|
@@ -44584,7 +44968,7 @@
|
|
|
44584
44968
|
}
|
|
44585
44969
|
}
|
|
44586
44970
|
|
|
44587
|
-
const ICON_PROP_KEYS = ["type", "content", "
|
|
44971
|
+
const ICON_PROP_KEYS = ["type", "content", "style", "color", "width", "height", "marginRight", "marginLeft", "src", "svg", "name", "path", "positionType", "tooltip", "hover", "cursor", "shape", "interactive", "isGif"];
|
|
44588
44972
|
const iconPropKeys = ICON_PROP_KEYS;
|
|
44589
44973
|
|
|
44590
44974
|
class BodyHelper {
|
|
@@ -44641,6 +45025,10 @@
|
|
|
44641
45025
|
return CheckboxStyle$1;
|
|
44642
45026
|
case "radio":
|
|
44643
45027
|
return RadioStyle;
|
|
45028
|
+
case "switch":
|
|
45029
|
+
return SwitchStyle;
|
|
45030
|
+
case "button":
|
|
45031
|
+
return ButtonStyle;
|
|
44644
45032
|
}
|
|
44645
45033
|
return TextStyle;
|
|
44646
45034
|
}
|
|
@@ -45460,13 +45848,24 @@
|
|
|
45460
45848
|
getDropDownStateIcons(_table, col, row) {
|
|
45461
45849
|
var _a, _b, _c;
|
|
45462
45850
|
const headerC = _table.getHeaderDefine(col, row),
|
|
45463
|
-
headerL = _table._getHeaderLayoutMap(col, row)
|
|
45464
|
-
|
|
45465
|
-
|
|
45466
|
-
|
|
45467
|
-
|
|
45468
|
-
|
|
45469
|
-
|
|
45851
|
+
headerL = _table._getHeaderLayoutMap(col, row);
|
|
45852
|
+
let {
|
|
45853
|
+
dropDownMenu: dropDownMenu
|
|
45854
|
+
} = headerL;
|
|
45855
|
+
"function" == typeof dropDownMenu && (dropDownMenu = dropDownMenu({
|
|
45856
|
+
row: row,
|
|
45857
|
+
col: col,
|
|
45858
|
+
table: _table
|
|
45859
|
+
}));
|
|
45860
|
+
let globalDropDownMenu = _table.globalDropDownMenu;
|
|
45861
|
+
"function" == typeof globalDropDownMenu && (globalDropDownMenu = globalDropDownMenu({
|
|
45862
|
+
row: row,
|
|
45863
|
+
col: col,
|
|
45864
|
+
table: _table
|
|
45865
|
+
}));
|
|
45866
|
+
const results = [];
|
|
45867
|
+
if (Array.isArray(dropDownMenu) && dropDownMenu.length || Array.isArray(globalDropDownMenu) && globalDropDownMenu.length && !(null === (_a = null == headerC ? void 0 : headerC.columns) || void 0 === _a ? void 0 : _a.length)) {
|
|
45868
|
+
const menus = dropDownMenu || globalDropDownMenu;
|
|
45470
45869
|
let highlightIndex = -1,
|
|
45471
45870
|
subHighlightIndex = -1;
|
|
45472
45871
|
for (let i = 0; i < menus.length; i++) {
|
|
@@ -45485,7 +45884,7 @@
|
|
|
45485
45884
|
}
|
|
45486
45885
|
if (-1 !== highlightIndex) {
|
|
45487
45886
|
let menu;
|
|
45488
|
-
menu = -1 !== subHighlightIndex ?
|
|
45887
|
+
menu = -1 !== subHighlightIndex ? menus[highlightIndex].children[subHighlightIndex] : menus[highlightIndex], menu.stateIcon && (menu.stateIcon.svg ? results.push({
|
|
45489
45888
|
type: "svg",
|
|
45490
45889
|
name: menu.stateIcon.src || menu.stateIcon.svg,
|
|
45491
45890
|
width: menu.stateIcon.width || 22,
|
|
@@ -45543,11 +45942,21 @@
|
|
|
45543
45942
|
checkDropDownIcon(_table, col, row) {
|
|
45544
45943
|
var _a;
|
|
45545
45944
|
if (_table.isPivotTable()) {
|
|
45546
|
-
|
|
45547
|
-
if (
|
|
45945
|
+
let dropDownMenu = _table._getHeaderLayoutMap(col, row).dropDownMenu;
|
|
45946
|
+
if ("function" == typeof dropDownMenu && (dropDownMenu = dropDownMenu({
|
|
45947
|
+
row: row,
|
|
45948
|
+
col: col,
|
|
45949
|
+
table: _table
|
|
45950
|
+
})), Array.isArray(dropDownMenu) && dropDownMenu.length) return !0;
|
|
45548
45951
|
} else {
|
|
45549
|
-
const headerC = _table.getHeaderDefine(col, row)
|
|
45550
|
-
|
|
45952
|
+
const headerC = _table.getHeaderDefine(col, row),
|
|
45953
|
+
dropDownMenu = headerC.dropDownMenu;
|
|
45954
|
+
let globalDropDownMenu = _table.globalDropDownMenu;
|
|
45955
|
+
if ("function" == typeof globalDropDownMenu && (globalDropDownMenu = globalDropDownMenu({
|
|
45956
|
+
row: row,
|
|
45957
|
+
col: col,
|
|
45958
|
+
table: _table
|
|
45959
|
+
})), Array.isArray(dropDownMenu) && dropDownMenu.length || (!Array.isArray(headerC.dropDownMenu) || 0 !== headerC.dropDownMenu.length) && Array.isArray(globalDropDownMenu) && globalDropDownMenu.length && !(null === (_a = null == headerC ? void 0 : headerC.columns) || void 0 === _a ? void 0 : _a.length)) return !0;
|
|
45551
45960
|
}
|
|
45552
45961
|
return !1;
|
|
45553
45962
|
}
|
|
@@ -46047,13 +46456,15 @@
|
|
|
46047
46456
|
})(candCol, right);
|
|
46048
46457
|
}
|
|
46049
46458
|
function getTargetRowAt(absoluteY, _this) {
|
|
46459
|
+
var _a;
|
|
46050
46460
|
if (0 === absoluteY) return {
|
|
46051
46461
|
top: 0,
|
|
46052
46462
|
row: 0,
|
|
46053
46463
|
bottom: 0,
|
|
46054
46464
|
height: 0
|
|
46055
46465
|
};
|
|
46056
|
-
const
|
|
46466
|
+
const floorOrRound = !0 === (null === (_a = _this.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? Math.floor : Math.round,
|
|
46467
|
+
candRow = computeTargetRowByY(absoluteY, _this),
|
|
46057
46468
|
bottom = _this.getRowsHeight(0, candRow);
|
|
46058
46469
|
return absoluteY >= bottom ? ((startRow, startBottom) => {
|
|
46059
46470
|
let top = startBottom - _this.getRowHeight(startRow);
|
|
@@ -46063,7 +46474,7 @@
|
|
|
46063
46474
|
for (let row = startRow; row < rowCount; row++) {
|
|
46064
46475
|
const height = _this.getRowHeight(row),
|
|
46065
46476
|
bottom = top + height;
|
|
46066
|
-
if (
|
|
46477
|
+
if (floorOrRound(top) <= floorOrRound(absoluteY) && floorOrRound(absoluteY) < floorOrRound(bottom)) return {
|
|
46067
46478
|
top: top,
|
|
46068
46479
|
row: row,
|
|
46069
46480
|
bottom: bottom,
|
|
@@ -46077,7 +46488,7 @@
|
|
|
46077
46488
|
for (let row = startRow; row >= 0; row--) {
|
|
46078
46489
|
const height = _this.getRowHeight(row),
|
|
46079
46490
|
top = bottom - height;
|
|
46080
|
-
if (
|
|
46491
|
+
if (floorOrRound(top) <= floorOrRound(absoluteY) && floorOrRound(absoluteY) < floorOrRound(bottom)) return {
|
|
46081
46492
|
top: top,
|
|
46082
46493
|
row: row,
|
|
46083
46494
|
bottom: bottom,
|
|
@@ -46930,6 +47341,9 @@
|
|
|
46930
47341
|
})), isFunction$5(style) || (layoutMap.isBottomFrozenRow(row) ? table.bodyBottomStyleCache.set(cacheKey, cacheStyle) : table.bodyStyleCache.set(cacheKey, cacheStyle)), customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
|
|
46931
47342
|
}
|
|
46932
47343
|
|
|
47344
|
+
function isInteger(value) {
|
|
47345
|
+
return Math.floor(value) === value;
|
|
47346
|
+
}
|
|
46933
47347
|
class Animateaaa extends ACustomAnimate {
|
|
46934
47348
|
onUpdate(end, ratio, out) {
|
|
46935
47349
|
if (this.from.x !== this.to.x) {
|
|
@@ -46948,18 +47362,32 @@
|
|
|
46948
47362
|
this.ticker.setFPS(60), this.tempGraphic = createRect({});
|
|
46949
47363
|
}
|
|
46950
47364
|
scrollTo(position, animationOption) {
|
|
46951
|
-
var _a, _b
|
|
47365
|
+
var _a, _b;
|
|
46952
47366
|
const from = {
|
|
46953
47367
|
x: this.table.scrollLeft,
|
|
46954
47368
|
y: this.table.scrollTop
|
|
46955
47369
|
},
|
|
46956
|
-
|
|
46957
|
-
|
|
46958
|
-
|
|
46959
|
-
|
|
47370
|
+
{
|
|
47371
|
+
col: col,
|
|
47372
|
+
row: row
|
|
47373
|
+
} = position;
|
|
47374
|
+
let colDecimal,
|
|
47375
|
+
rowDecimal,
|
|
47376
|
+
colInt = col,
|
|
47377
|
+
rowInt = row;
|
|
47378
|
+
isNumber$4(col) && !isInteger(col) && (colInt = Math.floor(col), colDecimal = col - colInt), isNumber$4(row) && !isInteger(row) && (rowInt = Math.floor(row), rowDecimal = row - rowInt);
|
|
47379
|
+
const cellRect = this.table.getCellRect(null != colInt ? colInt : 0, null != rowInt ? rowInt : 0);
|
|
47380
|
+
let {
|
|
47381
|
+
left: left,
|
|
47382
|
+
top: top
|
|
47383
|
+
} = cellRect;
|
|
47384
|
+
colDecimal && (left += colDecimal * cellRect.width), rowDecimal && (top += rowDecimal * cellRect.height);
|
|
47385
|
+
const to = {
|
|
47386
|
+
x: isNumber$4(col) ? left - this.table.getFrozenColsWidth() : this.table.scrollLeft,
|
|
47387
|
+
y: isNumber$4(row) ? top - this.table.getFrozenRowsHeight() : this.table.scrollTop
|
|
46960
47388
|
},
|
|
46961
|
-
duration = isBoolean$4(animationOption) ? animationOption ? 3e3 : 0 : null !== (
|
|
46962
|
-
easing = isBoolean$4(animationOption) ? animationOption ? "linear" : "" : null !== (
|
|
47389
|
+
duration = isBoolean$4(animationOption) ? animationOption ? 3e3 : 0 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3,
|
|
47390
|
+
easing = isBoolean$4(animationOption) ? animationOption ? "linear" : "" : null !== (_b = null == animationOption ? void 0 : animationOption.easing) && void 0 !== _b ? _b : "linear";
|
|
46963
47391
|
new Animate(Generator.GenAutoIncrementId(), this.timeline).bind(this.tempGraphic).play(new Animateaaa(from, to, duration, easing, {
|
|
46964
47392
|
graphic: this.tempGraphic,
|
|
46965
47393
|
table: this.table
|
|
@@ -46989,8 +47417,8 @@
|
|
|
46989
47417
|
}
|
|
46990
47418
|
constructor(container) {
|
|
46991
47419
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46992
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
46993
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.
|
|
47420
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
47421
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.17.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
46994
47422
|
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
46995
47423
|
const {
|
|
46996
47424
|
frozenColCount = 0,
|
|
@@ -47011,6 +47439,7 @@
|
|
|
47011
47439
|
rowSeriesNumber: rowSeriesNumber,
|
|
47012
47440
|
columnResizeMode: columnResizeMode,
|
|
47013
47441
|
rowResizeMode = "none",
|
|
47442
|
+
resize: resize,
|
|
47014
47443
|
dragHeaderMode: dragHeaderMode,
|
|
47015
47444
|
showFrozenIcon: showFrozenIcon,
|
|
47016
47445
|
allowFrozenColCount: allowFrozenColCount,
|
|
@@ -47038,7 +47467,7 @@
|
|
|
47038
47467
|
bottom: 0
|
|
47039
47468
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), isValid$3(canvasHeight) && isValid$3(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
47040
47469
|
const internalProps = this.internalProps = {};
|
|
47041
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = columnResizeMode, internalProps.rowResizeMode = rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
47470
|
+
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_d = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _d ? _d : columnResizeMode, internalProps.rowResizeMode = null !== (_e = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _e ? _e : rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
47042
47471
|
const that = this;
|
|
47043
47472
|
if (internalProps.calcWidthContext = {
|
|
47044
47473
|
_: internalProps,
|
|
@@ -47046,7 +47475,7 @@
|
|
|
47046
47475
|
var _a;
|
|
47047
47476
|
return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
47048
47477
|
}
|
|
47049
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (
|
|
47478
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_f = options.theme) && void 0 !== _f ? _f : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this), internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_g = options.allowFrozenColCount) && void 0 !== _g ? _g : 0, internalProps.limitMaxAutoWidth = null !== (_h = options.limitMaxAutoWidth) && void 0 !== _h ? _h : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this), this.eventManager = new EventManager(this), this.animationManager = new TableAnimationManager(this), options.legends) {
|
|
47050
47479
|
internalProps.legends = [];
|
|
47051
47480
|
const createLegend = Factory.getFunction("createLegend");
|
|
47052
47481
|
if (Array.isArray(options.legends)) {
|
|
@@ -47072,7 +47501,7 @@
|
|
|
47072
47501
|
}
|
|
47073
47502
|
if (internalProps.menu = Object.assign({
|
|
47074
47503
|
renderMode: "html"
|
|
47075
|
-
}, options.menu), Array.isArray(null === (
|
|
47504
|
+
}, options.menu), Array.isArray(null === (_j = options.menu) || void 0 === _j ? void 0 : _j.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_k = options.menu) || void 0 === _k ? void 0 : _k.dropDownMenuHighlight), (Array.isArray(null === (_l = options.menu) || void 0 === _l ? void 0 : _l.defaultHeaderMenuItems) || "function" == typeof (null === (_m = options.menu) || void 0 === _m ? void 0 : _m.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode) {
|
|
47076
47505
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
47077
47506
|
internalProps.menuHandler = new MenuHandler(this);
|
|
47078
47507
|
}
|
|
@@ -47080,7 +47509,7 @@
|
|
|
47080
47509
|
changedCells: new Map()
|
|
47081
47510
|
}, internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell);
|
|
47082
47511
|
const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
|
|
47083
|
-
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
47512
|
+
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_o = options.customCellStyle) && void 0 !== _o ? _o : [], null !== (_p = options.customCellStyleArrangement) && void 0 !== _p ? _p : [])), this._adjustCanvasSizeByOption();
|
|
47084
47513
|
}
|
|
47085
47514
|
_adjustCanvasSizeByOption() {
|
|
47086
47515
|
"auto" !== this.options.canvasHeight && "auto" !== this.options.canvasWidth || setTimeout(() => {
|
|
@@ -47817,7 +48246,7 @@
|
|
|
47817
48246
|
return super.fireListeners(type, event);
|
|
47818
48247
|
}
|
|
47819
48248
|
updateOption(options) {
|
|
47820
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
48249
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
47821
48250
|
this.options = options, this._hasAutoImageColumn = void 0;
|
|
47822
48251
|
const {
|
|
47823
48252
|
frozenColCount = 0,
|
|
@@ -47831,6 +48260,7 @@
|
|
|
47831
48260
|
rowSeriesNumber: rowSeriesNumber,
|
|
47832
48261
|
columnResizeMode: columnResizeMode,
|
|
47833
48262
|
rowResizeMode = "none",
|
|
48263
|
+
resize: resize,
|
|
47834
48264
|
dragHeaderMode: dragHeaderMode,
|
|
47835
48265
|
showFrozenIcon: showFrozenIcon,
|
|
47836
48266
|
allowFrozenColCount: allowFrozenColCount,
|
|
@@ -47856,9 +48286,9 @@
|
|
|
47856
48286
|
} = options;
|
|
47857
48287
|
pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio), padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), this.showFrozenIcon = "boolean" != typeof showFrozenIcon || showFrozenIcon, "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.widthMode = null != widthMode ? widthMode : "standard", this.heightMode = null != heightMode ? heightMode : "standard", this._widthAdaptiveMode = null != widthAdaptiveMode ? widthAdaptiveMode : "only-body", this._heightAdaptiveMode = null != heightAdaptiveMode ? heightAdaptiveMode : "only-body", this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight, this.customRender = customRender, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0;
|
|
47858
48288
|
const internalProps = this.internalProps;
|
|
47859
|
-
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = columnResizeMode, internalProps.rowResizeMode = rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (
|
|
48289
|
+
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_b = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _b ? _b : columnResizeMode, internalProps.rowResizeMode = null !== (_c = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _c ? _c : rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_d = options.theme) && void 0 !== _d ? _d : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_e = options.allowFrozenColCount) && void 0 !== _e ? _e : 0, internalProps.limitMaxAutoWidth = null !== (_f = options.limitMaxAutoWidth) && void 0 !== _f ? _f : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_g = internalProps.legends) || void 0 === _g || _g.forEach(legend => {
|
|
47860
48290
|
null == legend || legend.release();
|
|
47861
|
-
}), null === (
|
|
48291
|
+
}), null === (_h = internalProps.title) || void 0 === _h || _h.release(), internalProps.title = null, null === (_j = internalProps.emptyTip) || void 0 === _j || _j.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
47862
48292
|
internalProps.legends = [];
|
|
47863
48293
|
const createLegend = Factory.getFunction("createLegend");
|
|
47864
48294
|
if (Array.isArray(options.legends)) {
|
|
@@ -47884,11 +48314,11 @@
|
|
|
47884
48314
|
}
|
|
47885
48315
|
if (internalProps.menu = Object.assign({
|
|
47886
48316
|
renderMode: "html"
|
|
47887
|
-
}, options.menu), Array.isArray(null === (
|
|
48317
|
+
}, options.menu), Array.isArray(null === (_k = options.menu) || void 0 === _k ? void 0 : _k.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_l = options.menu) || void 0 === _l ? void 0 : _l.dropDownMenuHighlight), (Array.isArray(null === (_m = options.menu) || void 0 === _m ? void 0 : _m.defaultHeaderMenuItems) || "function" == typeof (null === (_o = options.menu) || void 0 === _o ? void 0 : _o.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode && !internalProps.menuHandler) {
|
|
47888
48318
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
47889
48319
|
internalProps.menuHandler = new MenuHandler(this);
|
|
47890
48320
|
}
|
|
47891
|
-
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (
|
|
48321
|
+
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_p = this.customCellStylePlugin) || void 0 === _p || _p.updateCustomCell(null !== (_q = options.customCellStyle) && void 0 !== _q ? _q : [], null !== (_r = options.customCellStyleArrangement) && void 0 !== _r ? _r : []), this._adjustCanvasSizeByOption();
|
|
47892
48322
|
}
|
|
47893
48323
|
renderWithRecreateCells() {
|
|
47894
48324
|
this.internalProps.stick.changedCells.clear();
|
|
@@ -51046,32 +51476,37 @@
|
|
|
51046
51476
|
|
|
51047
51477
|
class EditManager {
|
|
51048
51478
|
constructor(table) {
|
|
51049
|
-
this.isValidatingValue = !1, this.table = table, this.bindEvent();
|
|
51479
|
+
this.isValidatingValue = !1, this.listenersId = [], this.table = table, this.bindEvent();
|
|
51050
51480
|
}
|
|
51051
51481
|
bindEvent() {
|
|
51052
|
-
this.table
|
|
51053
|
-
|
|
51054
|
-
|
|
51055
|
-
|
|
51056
|
-
|
|
51482
|
+
const table = this.table,
|
|
51483
|
+
doubleClickEventId = table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
|
|
51484
|
+
var _a;
|
|
51485
|
+
const {
|
|
51486
|
+
editCellTrigger = "doubleclick"
|
|
51487
|
+
} = table.options;
|
|
51488
|
+
if (!editCellTrigger.includes("doubleclick")) return;
|
|
51057
51489
|
const {
|
|
51058
51490
|
col: col,
|
|
51059
51491
|
row: row
|
|
51060
51492
|
} = e,
|
|
51061
51493
|
eventArgsSet = getCellEventArgsSet(e.federatedEvent),
|
|
51062
|
-
resizeCol =
|
|
51063
|
-
|
|
51064
|
-
|
|
51065
|
-
|
|
51066
|
-
}), this.table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
51067
|
-
if ("click" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("click")) {
|
|
51494
|
+
resizeCol = table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.targetCell);
|
|
51495
|
+
table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0 || this.startEditCell(col, row);
|
|
51496
|
+
}),
|
|
51497
|
+
clickEventId = table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
51068
51498
|
const {
|
|
51069
|
-
|
|
51070
|
-
|
|
51071
|
-
|
|
51072
|
-
|
|
51073
|
-
|
|
51074
|
-
|
|
51499
|
+
editCellTrigger = "doubleclick"
|
|
51500
|
+
} = table.options;
|
|
51501
|
+
if ("click" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("click")) {
|
|
51502
|
+
const {
|
|
51503
|
+
col: col,
|
|
51504
|
+
row: row
|
|
51505
|
+
} = e;
|
|
51506
|
+
this.startEditCell(col, row);
|
|
51507
|
+
}
|
|
51508
|
+
});
|
|
51509
|
+
this.listenersId.push(doubleClickEventId, clickEventId);
|
|
51075
51510
|
}
|
|
51076
51511
|
startEditCell(col, row, value) {
|
|
51077
51512
|
var _a, _b, _c, _d, _e;
|
|
@@ -51102,9 +51537,9 @@
|
|
|
51102
51537
|
},
|
|
51103
51538
|
referencePosition: referencePosition,
|
|
51104
51539
|
container: this.table.getElement(),
|
|
51105
|
-
table: this.table,
|
|
51106
51540
|
col: col,
|
|
51107
|
-
row: row
|
|
51541
|
+
row: row,
|
|
51542
|
+
table: this.table
|
|
51108
51543
|
});
|
|
51109
51544
|
}
|
|
51110
51545
|
}
|
|
@@ -51150,6 +51585,11 @@
|
|
|
51150
51585
|
var _a, _b, _c, _d;
|
|
51151
51586
|
this.editingEditor && (null === (_b = (_a = this.editingEditor).exit) || void 0 === _b || _b.call(_a), null === (_d = (_c = this.editingEditor).onEnd) || void 0 === _d || _d.call(_c), this.editingEditor = null);
|
|
51152
51587
|
}
|
|
51588
|
+
release() {
|
|
51589
|
+
this.listenersId.forEach(id => {
|
|
51590
|
+
this.table.off(id);
|
|
51591
|
+
});
|
|
51592
|
+
}
|
|
51153
51593
|
}
|
|
51154
51594
|
function dealWithValidateValue(validateValue, editManager, oldValue, resolve) {
|
|
51155
51595
|
return editManager.isValidatingValue = !1, "validate-exit" === validateValue ? (editManager.doExit(), null == resolve || resolve(!0), !0) : "invalidate-exit" === validateValue ? (editManager.editingEditor.setValue(oldValue), editManager.doExit(), null == resolve || resolve(!0), !0) : "validate-not-exit" === validateValue || "invalidate-not-exit" === validateValue ? (null == resolve || resolve(!1), !1) : !0 === validateValue ? (editManager.doExit(), null == resolve || resolve(!0), !0) : (null == resolve || resolve(!1), !1);
|
|
@@ -52081,7 +52521,7 @@
|
|
|
52081
52521
|
const define = this.getBodyColumnDefine(col, row),
|
|
52082
52522
|
field = null == define ? void 0 : define.field,
|
|
52083
52523
|
cellType = this.getCellType(col, row);
|
|
52084
|
-
if (isValid$3(field) && "checkbox" === cellType) {
|
|
52524
|
+
if (isValid$3(field) && ("checkbox" === cellType || "switch" === cellType)) {
|
|
52085
52525
|
const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row)).toString();
|
|
52086
52526
|
return null === (_a = this.stateManager.checkedState.get(dataIndex)) || void 0 === _a ? void 0 : _a[field];
|
|
52087
52527
|
}
|
|
@@ -52098,6 +52538,15 @@
|
|
|
52098
52538
|
setCellRadioState(col, row, index) {
|
|
52099
52539
|
setCellRadioState(col, row, index, this);
|
|
52100
52540
|
}
|
|
52541
|
+
getSwitchState(field) {
|
|
52542
|
+
return this.getCheckboxState(field);
|
|
52543
|
+
}
|
|
52544
|
+
getCellSwitchState(col, row) {
|
|
52545
|
+
return this.getCellCheckboxState(col, row);
|
|
52546
|
+
}
|
|
52547
|
+
setCellSwitchState(col, row, checked) {
|
|
52548
|
+
this.setCellCheckboxState(col, row, checked);
|
|
52549
|
+
}
|
|
52101
52550
|
setRecords(records, option) {
|
|
52102
52551
|
var _a, _b, _c, _d;
|
|
52103
52552
|
let sort;
|
|
@@ -52266,6 +52715,9 @@
|
|
|
52266
52715
|
}
|
|
52267
52716
|
}
|
|
52268
52717
|
}
|
|
52718
|
+
release() {
|
|
52719
|
+
this.editorManager.release(), super.release();
|
|
52720
|
+
}
|
|
52269
52721
|
}
|
|
52270
52722
|
|
|
52271
52723
|
function isXAxis(orient) {
|
|
@@ -54505,7 +54957,7 @@
|
|
|
54505
54957
|
container: table => new Container(table)
|
|
54506
54958
|
};
|
|
54507
54959
|
function getMenuInstanceInfo(table, col, row, type, dropDownMenuOptions) {
|
|
54508
|
-
var _a;
|
|
54960
|
+
var _a, _b;
|
|
54509
54961
|
const {
|
|
54510
54962
|
lineHeight: lineHeight,
|
|
54511
54963
|
textBaseline: textBaseline,
|
|
@@ -54547,11 +54999,15 @@
|
|
|
54547
54999
|
content: dropDownMenuOptions.content
|
|
54548
55000
|
};
|
|
54549
55001
|
if ("dropdown-menu" === type) {
|
|
54550
|
-
|
|
54551
|
-
|
|
54552
|
-
|
|
54553
|
-
|
|
54554
|
-
return {
|
|
55002
|
+
let dropDownMenu = table.globalDropDownMenu;
|
|
55003
|
+
const headerData = table._getHeaderLayoutMap(col, row);
|
|
55004
|
+
dropDownMenu = null !== (_b = headerData.dropDownMenu) && void 0 !== _b ? _b : dropDownMenu;
|
|
55005
|
+
const pivotInfo = headerData.pivotInfo;
|
|
55006
|
+
return "function" == typeof dropDownMenu && (dropDownMenu = dropDownMenu({
|
|
55007
|
+
row: row,
|
|
55008
|
+
col: col,
|
|
55009
|
+
table: table
|
|
55010
|
+
})), {
|
|
54555
55011
|
type: type,
|
|
54556
55012
|
referencePosition: {
|
|
54557
55013
|
rect: {
|
|
@@ -55336,7 +55792,7 @@
|
|
|
55336
55792
|
canvas: null !== (_0 = table.canvas) && void 0 !== _0 ? _0 : table.scenegraph.stage.window.getContext().canvas,
|
|
55337
55793
|
mode: table.options.mode,
|
|
55338
55794
|
modeParams: table.options.modeParams,
|
|
55339
|
-
spec: chartSpec,
|
|
55795
|
+
spec: table.options.specTransformInCell ? table.options.specTransformInCell(chartSpec, col, row) : chartSpec,
|
|
55340
55796
|
ClassType: ClassType,
|
|
55341
55797
|
width: width - padding[3] - padding[1],
|
|
55342
55798
|
height: height - padding[2] - padding[0],
|
|
@@ -55346,7 +55802,9 @@
|
|
|
55346
55802
|
cellPadding: padding,
|
|
55347
55803
|
dpr: table.internalProps.pixelRatio,
|
|
55348
55804
|
axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],
|
|
55349
|
-
tableChartOption: table.options.chartOption
|
|
55805
|
+
tableChartOption: table.options.chartOption,
|
|
55806
|
+
col: col,
|
|
55807
|
+
row: row
|
|
55350
55808
|
});
|
|
55351
55809
|
cellGroup.appendChild(chartGroup), table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
|
|
55352
55810
|
}
|
|
@@ -55638,6 +56096,167 @@
|
|
|
55638
56096
|
return null !== (_a = null != isDisabled ? isDisabled : globalDisable) && void 0 !== _a && _a;
|
|
55639
56097
|
}
|
|
55640
56098
|
|
|
56099
|
+
function createSwitchCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
|
|
56100
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
56101
|
+
if (!cellGroup) {
|
|
56102
|
+
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
56103
|
+
isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0)) && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
56104
|
+
x: xOrigin,
|
|
56105
|
+
y: yOrigin,
|
|
56106
|
+
width: width,
|
|
56107
|
+
height: height,
|
|
56108
|
+
lineWidth: null !== (_b = null === (_a = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _a ? void 0 : _a.lineWidth) && void 0 !== _b ? _b : void 0,
|
|
56109
|
+
fill: null !== (_d = null === (_c = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _c ? void 0 : _c.fill) && void 0 !== _d ? _d : void 0,
|
|
56110
|
+
stroke: null !== (_f = null === (_e = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _e ? void 0 : _e.stroke) && void 0 !== _f ? _f : void 0,
|
|
56111
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
56112
|
+
strokeArrayColor: null !== (_h = null === (_g = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _g ? void 0 : _g.strokeArrayColor) && void 0 !== _h ? _h : void 0,
|
|
56113
|
+
cursor: null !== (_k = null === (_j = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _j ? void 0 : _j.cursor) && void 0 !== _k ? _k : void 0,
|
|
56114
|
+
lineDash: null !== (_m = null === (_l = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _l ? void 0 : _l.lineDash) && void 0 !== _m ? _m : void 0,
|
|
56115
|
+
lineCap: "butt",
|
|
56116
|
+
clip: !0,
|
|
56117
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
56118
|
+
}), cellGroup && "cell" === cellGroup.role || ((cellGroup = new Group({
|
|
56119
|
+
x: xOrigin,
|
|
56120
|
+
y: yOrigin,
|
|
56121
|
+
width: width,
|
|
56122
|
+
height: height,
|
|
56123
|
+
lineWidth: null !== (_p = null === (_o = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _o ? void 0 : _o.lineWidth) && void 0 !== _p ? _p : void 0,
|
|
56124
|
+
fill: null !== (_r = null === (_q = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _q ? void 0 : _q.fill) && void 0 !== _r ? _r : void 0,
|
|
56125
|
+
stroke: null !== (_t = null === (_s = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _s ? void 0 : _s.stroke) && void 0 !== _t ? _t : void 0,
|
|
56126
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
56127
|
+
strokeArrayColor: null !== (_v = null === (_u = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _u ? void 0 : _u.strokeArrayColor) && void 0 !== _v ? _v : void 0,
|
|
56128
|
+
cursor: null !== (_x = null === (_w = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _w ? void 0 : _w.cursor) && void 0 !== _x ? _x : void 0,
|
|
56129
|
+
lineDash: null !== (_z = null === (_y = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _y ? void 0 : _y.lineDash) && void 0 !== _z ? _z : void 0,
|
|
56130
|
+
lineCap: "butt",
|
|
56131
|
+
clip: !0,
|
|
56132
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
56133
|
+
})).role = "cell", cellGroup.col = col, cellGroup.row = row, null == columnGroup || columnGroup.addCellGroup(cellGroup));
|
|
56134
|
+
}
|
|
56135
|
+
let icons;
|
|
56136
|
+
if (mayHaveIcon) {
|
|
56137
|
+
let iconCol = col,
|
|
56138
|
+
iconRow = row;
|
|
56139
|
+
range && (iconCol = range.start.col, iconRow = range.start.row), icons = table.getCellIcons(iconCol, iconRow);
|
|
56140
|
+
}
|
|
56141
|
+
let iconWidth = 0,
|
|
56142
|
+
cellLeftIconWidth = 0;
|
|
56143
|
+
if (Array.isArray(icons) && 0 !== icons.length) {
|
|
56144
|
+
const {
|
|
56145
|
+
leftIconWidth: leftIconWidth,
|
|
56146
|
+
rightIconWidth: rightIconWidth,
|
|
56147
|
+
absoluteLeftIconWidth: absoluteLeftIconWidth,
|
|
56148
|
+
absoluteRightIconWidth: absoluteRightIconWidth
|
|
56149
|
+
} = dealWithIconLayout(icons, cellGroup, range, table);
|
|
56150
|
+
iconWidth = leftIconWidth + rightIconWidth, cellLeftIconWidth = leftIconWidth, cellGroup.forEachChildren(child => {
|
|
56151
|
+
"icon-left" === child.role ? child.setAttribute("x", child.attribute.x + padding[3]) : "icon-right" === child.role ? child.setAttribute("x", child.attribute.x + width - rightIconWidth - padding[1]) : "icon-absolute-right" === child.role && child.setAttribute("x", child.attribute.x + width - absoluteRightIconWidth - padding[1]);
|
|
56152
|
+
}), cellGroup.forEachChildren(child => {
|
|
56153
|
+
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
56154
|
+
});
|
|
56155
|
+
}
|
|
56156
|
+
const switchComponent = createSwitch(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
56157
|
+
return switchComponent && cellGroup.appendChild(switchComponent), switchComponent.render(), width -= padding[1] + padding[3] + iconWidth, height -= padding[0] + padding[2], "center" === textAlign ? switchComponent.setAttribute("x", padding[3] + cellLeftIconWidth + (width - switchComponent.AABBBounds.width()) / 2) : "right" === textAlign ? switchComponent.setAttribute("x", padding[3] + cellLeftIconWidth + width - switchComponent.AABBBounds.width()) : switchComponent.setAttribute("x", padding[3] + cellLeftIconWidth), "middle" === textBaseline ? switchComponent.setAttribute("y", padding[0] + (height - switchComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? switchComponent.setAttribute("y", padding[0] + height - switchComponent.AABBBounds.height()) : switchComponent.setAttribute("y", padding[0]), cellGroup;
|
|
56158
|
+
}
|
|
56159
|
+
function createSwitch(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
56160
|
+
var _a, _b, _c, _d;
|
|
56161
|
+
const style = table._getCellStyle(col, row),
|
|
56162
|
+
spaceBetweenTextAndCircle = getProp("spaceBetweenTextAndCircle", style, col, row, table),
|
|
56163
|
+
circleRadius = getProp("circleRadius", style, col, row, table),
|
|
56164
|
+
boxWidth = getProp("boxWidth", style, col, row, table),
|
|
56165
|
+
boxHeight = getProp("boxHeight", style, col, row, table),
|
|
56166
|
+
checkedFill = getProp("checkedFill", style, col, row, table),
|
|
56167
|
+
uncheckedFill = getProp("uncheckedFill", style, col, row, table),
|
|
56168
|
+
disableCheckedFill = getProp("disableCheckedFill", style, col, row, table),
|
|
56169
|
+
disableUncheckedFill = getProp("disableUncheckedFill", style, col, row, table),
|
|
56170
|
+
circleFill = getProp("circleFill", style, col, row, table),
|
|
56171
|
+
value = table.getCellValue(col, row),
|
|
56172
|
+
dataValue = table.getCellOriginValue(col, row);
|
|
56173
|
+
let isChecked,
|
|
56174
|
+
isDisabled,
|
|
56175
|
+
text = null !== (_a = value) && void 0 !== _a ? _a : "";
|
|
56176
|
+
isObject$7(value) ? (isChecked = value.checked, isDisabled = value.disable, text = null !== (_b = value.text) && void 0 !== _b ? _b : "") : "boolean" == typeof value && (isChecked = value, text = ""), isChecked = table.stateManager.syncCheckedState(col, row, define.field, isChecked);
|
|
56177
|
+
const hierarchyOffset = getHierarchyOffset(col, row, table),
|
|
56178
|
+
cellStyle = table._getCellStyle(col, row),
|
|
56179
|
+
autoWrapText = null !== (_c = cellStyle.autoWrapText) && void 0 !== _c ? _c : table.internalProps.autoWrapText,
|
|
56180
|
+
{
|
|
56181
|
+
lineClamp: lineClamp
|
|
56182
|
+
} = cellStyle,
|
|
56183
|
+
{
|
|
56184
|
+
checked: checked,
|
|
56185
|
+
disable: disable,
|
|
56186
|
+
uncheckedText: uncheckedText,
|
|
56187
|
+
checkedText: checkedText
|
|
56188
|
+
} = define;
|
|
56189
|
+
if (null == isChecked || "function" == typeof isChecked) {
|
|
56190
|
+
const globalChecked = getOrApply(checked, {
|
|
56191
|
+
col: col,
|
|
56192
|
+
row: row,
|
|
56193
|
+
table: table,
|
|
56194
|
+
context: null,
|
|
56195
|
+
value: value,
|
|
56196
|
+
dataValue: dataValue
|
|
56197
|
+
});
|
|
56198
|
+
isChecked = table.stateManager.syncCheckedState(col, row, define.field, globalChecked);
|
|
56199
|
+
}
|
|
56200
|
+
const globalDisable = getOrApply(disable, {
|
|
56201
|
+
col: col,
|
|
56202
|
+
row: row,
|
|
56203
|
+
table: table,
|
|
56204
|
+
context: null,
|
|
56205
|
+
value: value,
|
|
56206
|
+
dataValue: dataValue
|
|
56207
|
+
}),
|
|
56208
|
+
checkedTextString = getOrApply(checkedText, {
|
|
56209
|
+
col: col,
|
|
56210
|
+
row: row,
|
|
56211
|
+
table: table,
|
|
56212
|
+
context: null,
|
|
56213
|
+
value: value,
|
|
56214
|
+
dataValue: dataValue
|
|
56215
|
+
}),
|
|
56216
|
+
uncheckedTextString = getOrApply(uncheckedText, {
|
|
56217
|
+
col: col,
|
|
56218
|
+
row: row,
|
|
56219
|
+
table: table,
|
|
56220
|
+
context: null,
|
|
56221
|
+
value: value,
|
|
56222
|
+
dataValue: dataValue
|
|
56223
|
+
}),
|
|
56224
|
+
autoColWidth = "auto" === colWidth,
|
|
56225
|
+
autoRowHeight = table.isAutoRowHeight(row),
|
|
56226
|
+
attribute = {
|
|
56227
|
+
text: 1 === text.length ? text[0] : text,
|
|
56228
|
+
maxLineWidth: autoColWidth ? 1 / 0 : cellWidth - (padding[1] + padding[3] + hierarchyOffset) - 2 * circleRadius - spaceBetweenTextAndCircle,
|
|
56229
|
+
textAlign: "left",
|
|
56230
|
+
textBaseline: "top",
|
|
56231
|
+
autoWrapText: autoWrapText,
|
|
56232
|
+
lineClamp: lineClamp,
|
|
56233
|
+
wordBreak: "break-word",
|
|
56234
|
+
heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
|
|
56235
|
+
pickable: !1,
|
|
56236
|
+
dx: hierarchyOffset,
|
|
56237
|
+
whiteSpace: 1 !== text.length || autoWrapText ? "normal" : "no-wrap",
|
|
56238
|
+
checkedText: checkedTextString,
|
|
56239
|
+
uncheckedText: uncheckedTextString
|
|
56240
|
+
},
|
|
56241
|
+
switchAttributes = {
|
|
56242
|
+
x: 0,
|
|
56243
|
+
y: 0,
|
|
56244
|
+
text: cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute,
|
|
56245
|
+
circle: {
|
|
56246
|
+
radius: circleRadius
|
|
56247
|
+
},
|
|
56248
|
+
box: {
|
|
56249
|
+
width: boxWidth,
|
|
56250
|
+
height: boxHeight
|
|
56251
|
+
},
|
|
56252
|
+
spaceBetweenTextAndCircle: spaceBetweenTextAndCircle,
|
|
56253
|
+
disabled: null !== (_d = null != isDisabled ? isDisabled : globalDisable) && void 0 !== _d && _d
|
|
56254
|
+
};
|
|
56255
|
+
switchAttributes.checked = isChecked, uncheckedFill && (switchAttributes.box.uncheckedFill = uncheckedFill), disableUncheckedFill && (switchAttributes.box.disableUncheckedFill = disableUncheckedFill), checkedFill && (switchAttributes.box.checkedFill = checkedFill), disableCheckedFill && (switchAttributes.box.disableCheckedFill = disableCheckedFill), circleFill && (switchAttributes.circle.fill = circleFill);
|
|
56256
|
+
const switchComponent = new Switch(switchAttributes);
|
|
56257
|
+
return switchComponent.name = "switch", switchComponent;
|
|
56258
|
+
}
|
|
56259
|
+
|
|
55641
56260
|
const xScale = new PointScale(),
|
|
55642
56261
|
yScale = new LinearScale();
|
|
55643
56262
|
function createSparkLineCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, table, cellTheme, isAsync) {
|
|
@@ -56476,6 +57095,159 @@
|
|
|
56476
57095
|
scale.niceMax(target.targetTicks.length);
|
|
56477
57096
|
}
|
|
56478
57097
|
|
|
57098
|
+
function createButtonCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
|
|
57099
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
57100
|
+
if (!cellGroup) {
|
|
57101
|
+
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
57102
|
+
isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0)) && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
57103
|
+
x: xOrigin,
|
|
57104
|
+
y: yOrigin,
|
|
57105
|
+
width: width,
|
|
57106
|
+
height: height,
|
|
57107
|
+
lineWidth: null !== (_b = null === (_a = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _a ? void 0 : _a.lineWidth) && void 0 !== _b ? _b : void 0,
|
|
57108
|
+
fill: null !== (_d = null === (_c = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _c ? void 0 : _c.fill) && void 0 !== _d ? _d : void 0,
|
|
57109
|
+
stroke: null !== (_f = null === (_e = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _e ? void 0 : _e.stroke) && void 0 !== _f ? _f : void 0,
|
|
57110
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
57111
|
+
strokeArrayColor: null !== (_h = null === (_g = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _g ? void 0 : _g.strokeArrayColor) && void 0 !== _h ? _h : void 0,
|
|
57112
|
+
cursor: null !== (_k = null === (_j = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _j ? void 0 : _j.cursor) && void 0 !== _k ? _k : void 0,
|
|
57113
|
+
lineDash: null !== (_m = null === (_l = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _l ? void 0 : _l.lineDash) && void 0 !== _m ? _m : void 0,
|
|
57114
|
+
lineCap: "butt",
|
|
57115
|
+
clip: !0,
|
|
57116
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
57117
|
+
}), cellGroup && "cell" === cellGroup.role || ((cellGroup = new Group({
|
|
57118
|
+
x: xOrigin,
|
|
57119
|
+
y: yOrigin,
|
|
57120
|
+
width: width,
|
|
57121
|
+
height: height,
|
|
57122
|
+
lineWidth: null !== (_p = null === (_o = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _o ? void 0 : _o.lineWidth) && void 0 !== _p ? _p : void 0,
|
|
57123
|
+
fill: null !== (_r = null === (_q = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _q ? void 0 : _q.fill) && void 0 !== _r ? _r : void 0,
|
|
57124
|
+
stroke: null !== (_t = null === (_s = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _s ? void 0 : _s.stroke) && void 0 !== _t ? _t : void 0,
|
|
57125
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
57126
|
+
strokeArrayColor: null !== (_v = null === (_u = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _u ? void 0 : _u.strokeArrayColor) && void 0 !== _v ? _v : void 0,
|
|
57127
|
+
cursor: null !== (_x = null === (_w = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _w ? void 0 : _w.cursor) && void 0 !== _x ? _x : void 0,
|
|
57128
|
+
lineDash: null !== (_z = null === (_y = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _y ? void 0 : _y.lineDash) && void 0 !== _z ? _z : void 0,
|
|
57129
|
+
lineCap: "butt",
|
|
57130
|
+
clip: !0,
|
|
57131
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
57132
|
+
})).role = "cell", cellGroup.col = col, cellGroup.row = row, null == columnGroup || columnGroup.addCellGroup(cellGroup));
|
|
57133
|
+
}
|
|
57134
|
+
let icons;
|
|
57135
|
+
if (mayHaveIcon) {
|
|
57136
|
+
let iconCol = col,
|
|
57137
|
+
iconRow = row;
|
|
57138
|
+
range && (iconCol = range.start.col, iconRow = range.start.row), icons = table.getCellIcons(iconCol, iconRow);
|
|
57139
|
+
}
|
|
57140
|
+
let iconWidth = 0,
|
|
57141
|
+
cellLeftIconWidth = 0;
|
|
57142
|
+
if (Array.isArray(icons) && 0 !== icons.length) {
|
|
57143
|
+
const {
|
|
57144
|
+
leftIconWidth: leftIconWidth,
|
|
57145
|
+
rightIconWidth: rightIconWidth,
|
|
57146
|
+
absoluteLeftIconWidth: absoluteLeftIconWidth,
|
|
57147
|
+
absoluteRightIconWidth: absoluteRightIconWidth
|
|
57148
|
+
} = dealWithIconLayout(icons, cellGroup, range, table);
|
|
57149
|
+
iconWidth = leftIconWidth + rightIconWidth, cellLeftIconWidth = leftIconWidth, cellGroup.forEachChildren(child => {
|
|
57150
|
+
"icon-left" === child.role ? child.setAttribute("x", child.attribute.x + padding[3]) : "icon-right" === child.role ? child.setAttribute("x", child.attribute.x + width - rightIconWidth - padding[1]) : "icon-absolute-right" === child.role && child.setAttribute("x", child.attribute.x + width - absoluteRightIconWidth - padding[1]);
|
|
57151
|
+
}), cellGroup.forEachChildren(child => {
|
|
57152
|
+
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
57153
|
+
});
|
|
57154
|
+
}
|
|
57155
|
+
const buttonComponent = createButton(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
57156
|
+
return buttonComponent && cellGroup.appendChild(buttonComponent), width -= padding[1] + padding[3] + iconWidth, height -= padding[0] + padding[2], "center" === textAlign ? buttonComponent.setAttribute("x", padding[3] + cellLeftIconWidth + (width - buttonComponent.AABBBounds.width()) / 2) : "right" === textAlign ? buttonComponent.setAttribute("x", padding[3] + cellLeftIconWidth + width - buttonComponent.AABBBounds.width()) : buttonComponent.setAttribute("x", padding[3] + cellLeftIconWidth), "middle" === textBaseline ? buttonComponent.setAttribute("y", padding[0] + (height - buttonComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? buttonComponent.setAttribute("y", padding[0] + height - buttonComponent.AABBBounds.height()) : buttonComponent.setAttribute("y", padding[0]), cellGroup;
|
|
57157
|
+
}
|
|
57158
|
+
function createButton(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
57159
|
+
var _a, _b;
|
|
57160
|
+
const style = table._getCellStyle(col, row),
|
|
57161
|
+
buttonColor = getProp("buttonColor", style, col, row, table),
|
|
57162
|
+
buttonBorderColor = getProp("buttonBorderColor", style, col, row, table),
|
|
57163
|
+
buttonLineWidth = getProp("buttonLineWidth", style, col, row, table),
|
|
57164
|
+
buttonBorderRadius = getProp("buttonBorderRadius", style, col, row, table),
|
|
57165
|
+
buttonHoverColor = getProp("buttonHoverColor", style, col, row, table),
|
|
57166
|
+
buttonHoverBorderColor = getProp("buttonHoverBorderColor", style, col, row, table),
|
|
57167
|
+
buttonPadding = getProp("buttonPadding", style, col, row, table),
|
|
57168
|
+
buttonTextHoverColor = getProp("buttonTextHoverColor", style, col, row, table),
|
|
57169
|
+
buttonDisableColor = getProp("buttonDisableColor", style, col, row, table),
|
|
57170
|
+
buttonDisableBorderColor = getProp("buttonDisableBorderColor", style, col, row, table),
|
|
57171
|
+
buttonTextDisableColor = getProp("buttonTextDisableColor", style, col, row, table),
|
|
57172
|
+
value = table.getCellValue(col, row),
|
|
57173
|
+
dataValue = table.getCellOriginValue(col, row),
|
|
57174
|
+
hierarchyOffset = getHierarchyOffset(col, row, table),
|
|
57175
|
+
cellStyle = table._getCellStyle(col, row),
|
|
57176
|
+
autoWrapText = null !== (_a = cellStyle.autoWrapText) && void 0 !== _a ? _a : table.internalProps.autoWrapText,
|
|
57177
|
+
{
|
|
57178
|
+
lineClamp: lineClamp
|
|
57179
|
+
} = cellStyle,
|
|
57180
|
+
autoColWidth = "auto" === colWidth,
|
|
57181
|
+
autoRowHeight = table.isAutoRowHeight(row),
|
|
57182
|
+
{
|
|
57183
|
+
disable: disable,
|
|
57184
|
+
text: text
|
|
57185
|
+
} = define,
|
|
57186
|
+
isDisable = getOrApply(disable, {
|
|
57187
|
+
col: col,
|
|
57188
|
+
row: row,
|
|
57189
|
+
table: table,
|
|
57190
|
+
context: null,
|
|
57191
|
+
value: value,
|
|
57192
|
+
dataValue: dataValue
|
|
57193
|
+
}),
|
|
57194
|
+
buttonTextValue = getOrApply(text, {
|
|
57195
|
+
col: col,
|
|
57196
|
+
row: row,
|
|
57197
|
+
table: table,
|
|
57198
|
+
context: null,
|
|
57199
|
+
value: value,
|
|
57200
|
+
dataValue: dataValue
|
|
57201
|
+
}),
|
|
57202
|
+
buttonText = null !== (_b = null != buttonTextValue ? buttonTextValue : value) && void 0 !== _b ? _b : "",
|
|
57203
|
+
attribute = {
|
|
57204
|
+
maxLineWidth: autoColWidth ? 1 / 0 : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
|
|
57205
|
+
textAlign: "left",
|
|
57206
|
+
textBaseline: "top",
|
|
57207
|
+
autoWrapText: autoWrapText,
|
|
57208
|
+
lineClamp: lineClamp,
|
|
57209
|
+
wordBreak: "break-word",
|
|
57210
|
+
heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
|
|
57211
|
+
pickable: !1,
|
|
57212
|
+
dx: hierarchyOffset,
|
|
57213
|
+
whiteSpace: 1 !== buttonText.length || autoWrapText ? "normal" : "no-wrap"
|
|
57214
|
+
},
|
|
57215
|
+
testAttribute = cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute,
|
|
57216
|
+
buttonAttributes = {
|
|
57217
|
+
x: 0,
|
|
57218
|
+
y: 0,
|
|
57219
|
+
cursor: isDisable ? "not-allowed" : "pointer",
|
|
57220
|
+
disable: isDisable,
|
|
57221
|
+
childrenPickable: !1,
|
|
57222
|
+
text: 1 === buttonText.length ? buttonText[0] : buttonText,
|
|
57223
|
+
textStyle: testAttribute,
|
|
57224
|
+
padding: buttonPadding,
|
|
57225
|
+
panel: {
|
|
57226
|
+
visible: !0,
|
|
57227
|
+
fill: isDisable ? buttonDisableColor : buttonColor,
|
|
57228
|
+
stroke: isDisable ? buttonDisableBorderColor : buttonBorderColor,
|
|
57229
|
+
lineWidth: buttonLineWidth,
|
|
57230
|
+
cornerRadius: buttonBorderRadius
|
|
57231
|
+
},
|
|
57232
|
+
state: {
|
|
57233
|
+
text: {},
|
|
57234
|
+
panel: {
|
|
57235
|
+
hover: {
|
|
57236
|
+
fill: buttonHoverColor,
|
|
57237
|
+
stroke: buttonHoverBorderColor
|
|
57238
|
+
}
|
|
57239
|
+
}
|
|
57240
|
+
}
|
|
57241
|
+
};
|
|
57242
|
+
buttonTextDisableColor && (buttonAttributes.state.text.fill = buttonTextDisableColor), buttonTextHoverColor && (buttonAttributes.state.text.hover.fill = buttonTextHoverColor);
|
|
57243
|
+
const buttonComponent = new Tag(buttonAttributes);
|
|
57244
|
+
return buttonComponent.name = "button", isDisable || (buttonComponent.addEventListener("mouseenter", () => {
|
|
57245
|
+
buttonComponent.addState("hover", !0, !1), buttonComponent.stage.renderNextFrame();
|
|
57246
|
+
}), buttonComponent.addEventListener("mouseleave", () => {
|
|
57247
|
+
buttonComponent.removeState("hover", !1), buttonComponent.stage.renderNextFrame();
|
|
57248
|
+
})), buttonComponent;
|
|
57249
|
+
}
|
|
57250
|
+
|
|
56479
57251
|
const registerChartCell = () => {
|
|
56480
57252
|
Factory.registerFunction("createChartCellGroup", createChartCellGroup), Factory.registerFunction("getAxisDomainRangeAndLabels", getAxisDomainRangeAndLabels);
|
|
56481
57253
|
};
|
|
@@ -56491,6 +57263,12 @@
|
|
|
56491
57263
|
const registerRadioCell = () => {
|
|
56492
57264
|
Factory.registerFunction("createRadioCellGroup", createRadioCellGroup);
|
|
56493
57265
|
};
|
|
57266
|
+
const registerSwitchCell = () => {
|
|
57267
|
+
Factory.registerFunction("createSwitchCellGroup", createSwitchCellGroup);
|
|
57268
|
+
};
|
|
57269
|
+
const registerButtonCell = () => {
|
|
57270
|
+
Factory.registerFunction("createButtonCellGroup", createButtonCellGroup);
|
|
57271
|
+
};
|
|
56494
57272
|
const registerSparkLineCell = () => {
|
|
56495
57273
|
Factory.registerFunction("createSparkLineCellGroup", createSparkLineCellGroup);
|
|
56496
57274
|
};
|
|
@@ -56501,7 +57279,7 @@
|
|
|
56501
57279
|
Factory.registerFunction("createVideoCellGroup", createVideoCellGroup);
|
|
56502
57280
|
};
|
|
56503
57281
|
|
|
56504
|
-
registerAxis(), registerEmptyTip(), registerLegend(), registerMenu(), registerTitle(), registerTooltip(), registerListTreeStickCellPlugin(), registerCustomCellStylePlugin(), registerChartCell(), registerCheckboxCell(), registerImageCell(), registerProgressBarCell(), registerRadioCell(), registerSparkLineCell(), registerTextCell(), registerVideoCell();
|
|
57282
|
+
registerAxis(), registerEmptyTip(), registerLegend(), registerMenu(), registerTitle(), registerTooltip(), registerListTreeStickCellPlugin(), registerCustomCellStylePlugin(), registerChartCell(), registerCheckboxCell(), registerImageCell(), registerProgressBarCell(), registerRadioCell(), registerSwitchCell(), registerButtonCell(), registerSparkLineCell(), registerTextCell(), registerVideoCell();
|
|
56505
57283
|
class ListTableAll extends ListTable {}
|
|
56506
57284
|
|
|
56507
57285
|
registerForVrender();
|