@visactor/vtable 0.22.1 → 0.22.2-alpha.1
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/cjs/body-helper/style/Style.d.ts +3 -0
- package/cjs/body-helper/style/Style.js +22 -15
- package/cjs/body-helper/style/Style.js.map +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -1
- package/cjs/core/BaseTable.js +21 -15
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/event.js +2 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/header-helper/style/Style.d.ts +3 -0
- package/cjs/header-helper/style/Style.js +26 -19
- package/cjs/header-helper/style/Style.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/tree-helper.js +1 -0
- package/cjs/plugins/themes.js +1 -2
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +10 -6
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +3 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +5 -4
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +12 -8
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +70 -71
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +18 -11
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +19 -13
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/scenegraph/utils/text-measure.js +6 -6
- package/cjs/scenegraph/utils/text-measure.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/themes/component.js +1 -1
- package/cjs/ts-types/base-table.d.ts +3 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +233 -153
- package/dist/vtable.min.js +2 -2
- package/es/body-helper/style/Style.d.ts +3 -0
- package/es/body-helper/style/Style.js +22 -15
- package/es/body-helper/style/Style.js.map +1 -1
- package/es/components/legend/continue-legend/continue-legend.js +1 -1
- package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -1
- package/es/core/BaseTable.js +21 -15
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/event.js +2 -1
- package/es/event/event.js.map +1 -1
- package/es/header-helper/style/Style.d.ts +3 -0
- package/es/header-helper/style/Style.js +26 -19
- package/es/header-helper/style/Style.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/tree-helper.js +2 -1
- package/es/plugins/themes.js +1 -2
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +10 -6
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +2 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +6 -3
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +11 -8
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +69 -70
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +16 -9
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +19 -10
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +1 -1
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/scenegraph/utils/text-measure.js +6 -6
- package/es/scenegraph/utils/text-measure.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/themes/component.js +1 -1
- package/es/ts-types/base-table.d.ts +3 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
|
@@ -10,6 +10,7 @@ export declare class Style extends EventTarget implements ColumnStyle {
|
|
|
10
10
|
private _padding?;
|
|
11
11
|
private _defaultPadding;
|
|
12
12
|
private _textStick;
|
|
13
|
+
private _textStickBaseOnAlign;
|
|
13
14
|
private _textOverflow?;
|
|
14
15
|
private _textAlign?;
|
|
15
16
|
private _textBaseline?;
|
|
@@ -55,6 +56,8 @@ export declare class Style extends EventTarget implements ColumnStyle {
|
|
|
55
56
|
set borderColor(borderColor: ColorsPropertyDefine | undefined);
|
|
56
57
|
get textStick(): boolean;
|
|
57
58
|
set textStick(textStick: boolean);
|
|
59
|
+
get textStickBaseOnAlign(): boolean;
|
|
60
|
+
set textStickBaseOnAlign(textStickBaseOnAlign: boolean);
|
|
58
61
|
get textAlign(): TextAlignType | undefined;
|
|
59
62
|
set textAlign(textAlign: TextAlignType | undefined);
|
|
60
63
|
get textBaseline(): TextBaselineType | undefined;
|
|
@@ -18,7 +18,7 @@ class Style extends EventTarget_1.EventTarget {
|
|
|
18
18
|
return defaultStyle || (defaultStyle = new Style);
|
|
19
19
|
}
|
|
20
20
|
constructor(style = {}, bodyStyle = {}) {
|
|
21
|
-
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, _0, _1, _2, _3;
|
|
21
|
+
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, _0, _1, _2, _3, _4, _5;
|
|
22
22
|
super(), this._defaultPadding = [ 10, 16, 10, 16 ], this._textAlign = null !== (_a = null == style ? void 0 : style.textAlign) && void 0 !== _a ? _a : null == bodyStyle ? void 0 : bodyStyle.textAlign,
|
|
23
23
|
this._textBaseline = null !== (_b = null == style ? void 0 : style.textBaseline) && void 0 !== _b ? _b : null == bodyStyle ? void 0 : bodyStyle.textBaseline,
|
|
24
24
|
this._color = null !== (_c = null == style ? void 0 : style.color) && void 0 !== _c ? _c : null == bodyStyle ? void 0 : bodyStyle.color,
|
|
@@ -31,20 +31,21 @@ class Style extends EventTarget_1.EventTarget {
|
|
|
31
31
|
this._borderColor = null !== (_l = null == style ? void 0 : style.borderColor) && void 0 !== _l ? _l : null == bodyStyle ? void 0 : bodyStyle.borderColor,
|
|
32
32
|
this._textOverflow = null !== (_m = null == style ? void 0 : style.textOverflow) && void 0 !== _m ? _m : null == bodyStyle ? void 0 : bodyStyle.textOverflow,
|
|
33
33
|
this._textStick = null !== (_p = null !== (_o = style.textStick) && void 0 !== _o ? _o : null == bodyStyle ? void 0 : bodyStyle.textStick) && void 0 !== _p && _p,
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
34
|
+
this._textStickBaseOnAlign = null !== (_r = null !== (_q = style.textStickBaseOnAlign) && void 0 !== _q ? _q : null == bodyStyle ? void 0 : bodyStyle.textStickBaseOnAlign) && void 0 !== _r && _r,
|
|
35
|
+
this._bgColor = null !== (_s = null == style ? void 0 : style.bgColor) && void 0 !== _s ? _s : null == bodyStyle ? void 0 : bodyStyle.bgColor,
|
|
36
|
+
this._lineHeight = null !== (_t = null == style ? void 0 : style.lineHeight) && void 0 !== _t ? _t : null == bodyStyle ? void 0 : bodyStyle.lineHeight,
|
|
37
|
+
this._underline = null !== (_u = null == style ? void 0 : style.underline) && void 0 !== _u ? _u : null == bodyStyle ? void 0 : bodyStyle.underline,
|
|
38
|
+
this._underlineColor = null !== (_v = null == style ? void 0 : style.underlineColor) && void 0 !== _v ? _v : null == bodyStyle ? void 0 : bodyStyle.underlineColor,
|
|
39
|
+
this._underlineDash = null !== (_w = null == style ? void 0 : style.underlineDash) && void 0 !== _w ? _w : null == bodyStyle ? void 0 : bodyStyle.underlineDash,
|
|
40
|
+
this._underlineOffset = null !== (_x = null == style ? void 0 : style.underlineOffset) && void 0 !== _x ? _x : null == bodyStyle ? void 0 : bodyStyle.underlineOffset,
|
|
41
|
+
this._lineThrough = null !== (_y = null == style ? void 0 : style.lineThrough) && void 0 !== _y ? _y : null == bodyStyle ? void 0 : bodyStyle.lineThrough,
|
|
42
|
+
this._lineThroughColor = null !== (_z = null == style ? void 0 : style.lineThroughColor) && void 0 !== _z ? _z : null == bodyStyle ? void 0 : bodyStyle.lineThroughColor,
|
|
43
|
+
this._lineThroughDash = null !== (_0 = null == style ? void 0 : style.lineThroughDash) && void 0 !== _0 ? _0 : null == bodyStyle ? void 0 : bodyStyle.lineThroughDash,
|
|
44
|
+
this._linkColor = null !== (_1 = null == style ? void 0 : style.linkColor) && void 0 !== _1 ? _1 : null == bodyStyle ? void 0 : bodyStyle.linkColor,
|
|
45
|
+
this._cursor = null !== (_2 = style.cursor) && void 0 !== _2 ? _2 : null == bodyStyle ? void 0 : bodyStyle.cursor,
|
|
46
|
+
this._borderLineWidth = null !== (_3 = style.borderLineWidth) && void 0 !== _3 ? _3 : null == bodyStyle ? void 0 : bodyStyle.borderLineWidth,
|
|
47
|
+
this._borderLineDash = null !== (_4 = style.borderLineDash) && void 0 !== _4 ? _4 : null == bodyStyle ? void 0 : bodyStyle.borderLineDash,
|
|
48
|
+
this._marked = null !== (_5 = style.marked) && void 0 !== _5 ? _5 : null == bodyStyle ? void 0 : bodyStyle.marked;
|
|
48
49
|
}
|
|
49
50
|
get color() {
|
|
50
51
|
return this._color;
|
|
@@ -112,6 +113,12 @@ class Style extends EventTarget_1.EventTarget {
|
|
|
112
113
|
set textStick(textStick) {
|
|
113
114
|
this._textStick = textStick;
|
|
114
115
|
}
|
|
116
|
+
get textStickBaseOnAlign() {
|
|
117
|
+
return this._textStickBaseOnAlign;
|
|
118
|
+
}
|
|
119
|
+
set textStickBaseOnAlign(textStickBaseOnAlign) {
|
|
120
|
+
this._textStickBaseOnAlign = textStickBaseOnAlign;
|
|
121
|
+
}
|
|
115
122
|
get textAlign() {
|
|
116
123
|
return this._textAlign;
|
|
117
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/body-helper/style/Style.ts"],"names":[],"mappings":";;;AAuBA,IAAI,YAAmB,CAAC;AACxB,yDAAsD;AACtD,MAAM,gBAAgB,GAAG;IACvB,YAAY,EAAE,cAAuB;CACtC,CAAC;AAEF,MAAa,KAAM,SAAQ,yBAAW;IA4BpC,MAAM,KAAK,UAAU;QACnB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IACD,MAAM,KAAK,OAAO;QAChB,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,YAAY,QAAsB,EAAE,EAAE,YAA0B,EAAE;;QAChE,KAAK,EAAE,CAAC;QA3BF,oBAAe,GAA2B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QA4BjE,IAAI,CAAC,UAAU,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,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ef */\nimport type {\n ColorPropertyDefine,\n ColumnStyle,\n IStyleOption,\n TextOverflow,\n UnderlinePropertyDefine,\n LineThroughPropertyDefine,\n LineDashPropertyDefine,\n ColorsPropertyDefine,\n PaddingsPropertyDefine,\n CursorPropertyDefine,\n LineWidthsPropertyDefine,\n LineDashsPropertyDefine,\n MarkedPropertyDefine,\n FontSizePropertyDefine,\n FontFamilyPropertyDefine,\n FontWeightPropertyDefine,\n FontVariantPropertyDefine,\n FontStylePropertyDefine,\n TextAlignType,\n TextBaselineType\n} from '../../ts-types';\nlet defaultStyle: Style;\nimport { EventTarget } from '../../event/EventTarget';\nconst STYLE_EVENT_TYPE = {\n CHANGE_STYLE: 'change_style' as const\n};\n\nexport class Style extends EventTarget implements ColumnStyle {\n private _color?: ColorPropertyDefine;\n private _fontSize?: FontSizePropertyDefine;\n private _fontFamily?: FontFamilyPropertyDefine;\n private _fontWeight?: FontWeightPropertyDefine;\n private _fontVariant?: FontVariantPropertyDefine;\n private _fontStyle?: FontStylePropertyDefine;\n private _padding?: PaddingsPropertyDefine;\n private _defaultPadding: PaddingsPropertyDefine = [10, 16, 10, 16];\n private _textStick: boolean;\n private _textOverflow?: TextOverflow;\n private _textAlign?: TextAlignType;\n private _textBaseline?: TextBaselineType;\n private _bgColor?: ColorPropertyDefine;\n private _borderColor?: ColorsPropertyDefine;\n private _lineHeight?: number;\n private _underline?: UnderlinePropertyDefine;\n private _underlineColor?: ColorPropertyDefine;\n private _underlineDash?: LineDashPropertyDefine;\n private _underlineOffset?: number;\n private _lineThrough?: LineThroughPropertyDefine;\n private _lineThroughColor?: ColorPropertyDefine;\n private _lineThroughDash?: LineDashPropertyDefine;\n private _linkColor?: ColorPropertyDefine;\n private _cursor?: CursorPropertyDefine;\n private _borderLineWidth?: LineWidthsPropertyDefine;\n private _borderLineDash?: LineDashsPropertyDefine;\n private _marked?: MarkedPropertyDefine;\n static get EVENT_TYPE(): { CHANGE_STYLE: 'change_style' } {\n return STYLE_EVENT_TYPE;\n }\n static get DEFAULT(): Style {\n return defaultStyle ? defaultStyle : (defaultStyle = new Style());\n }\n constructor(style: IStyleOption = {}, bodyStyle: IStyleOption = {}) {\n super();\n this._textAlign = style?.textAlign ?? bodyStyle?.textAlign; //|| \"left\";\n this._textBaseline = style?.textBaseline ?? bodyStyle?.textBaseline; //|| \"middle\";\n this._color = style?.color ?? bodyStyle?.color;\n // icon为文字前后可添加的图表\n this._fontSize = style.fontSize ?? bodyStyle?.fontSize;\n this._fontFamily = style.fontFamily ?? bodyStyle?.fontFamily;\n this._fontWeight = style.fontWeight ?? bodyStyle?.fontWeight;\n this._fontVariant = style.fontVariant ?? bodyStyle?.fontVariant;\n this._fontStyle = style.fontStyle ?? bodyStyle?.fontStyle;\n //修改不能设置为0的情况\n this._padding = style?.padding ?? bodyStyle?.padding ?? this._defaultPadding;\n this._borderColor = style?.borderColor ?? bodyStyle?.borderColor;\n this._textOverflow = style?.textOverflow ?? bodyStyle?.textOverflow; //|| \"clip\";\n this._textStick = style.textStick ?? bodyStyle?.textStick ?? false;\n this._bgColor = style?.bgColor ?? bodyStyle?.bgColor;\n this._lineHeight = style?.lineHeight ?? bodyStyle?.lineHeight;\n this._underline = style?.underline ?? bodyStyle?.underline;\n this._underlineColor = style?.underlineColor ?? bodyStyle?.underlineColor;\n this._underlineDash = style?.underlineDash ?? bodyStyle?.underlineDash;\n this._underlineOffset = style?.underlineOffset ?? bodyStyle?.underlineOffset;\n this._lineThrough = style?.lineThrough ?? bodyStyle?.lineThrough;\n this._lineThroughColor = style?.lineThroughColor ?? bodyStyle?.lineThroughColor;\n this._lineThroughDash = style?.lineThroughDash ?? bodyStyle?.lineThroughDash;\n this._linkColor = style?.linkColor ?? bodyStyle?.linkColor;\n this._cursor = style.cursor ?? bodyStyle?.cursor;\n this._borderLineWidth = style.borderLineWidth ?? bodyStyle?.borderLineWidth;\n this._borderLineDash = style.borderLineDash ?? bodyStyle?.borderLineDash;\n this._marked = style.marked ?? bodyStyle?.marked;\n }\n get color(): ColorPropertyDefine | undefined {\n return this._color;\n }\n set color(color: ColorPropertyDefine | undefined) {\n this._color = color;\n // this.doChangeStyle();\n }\n get fontSize(): FontSizePropertyDefine | undefined {\n return this._fontSize;\n }\n set fontSize(fontSize: FontSizePropertyDefine | undefined) {\n this._fontSize = fontSize;\n // this.doChangeStyle();\n }\n get fontFamily(): FontFamilyPropertyDefine | undefined {\n return this._fontFamily;\n }\n set fontFamily(fontFamily: FontFamilyPropertyDefine | undefined) {\n this._fontFamily = fontFamily;\n // this.doChangeStyle();\n }\n get fontWeight(): FontWeightPropertyDefine | undefined {\n return this._fontWeight;\n }\n set fontWeight(fontWeight: FontWeightPropertyDefine | undefined) {\n this._fontWeight = fontWeight;\n // this.doChangeStyle();\n }\n get fontVariant(): FontVariantPropertyDefine | undefined {\n return this._fontVariant;\n }\n set fontVariant(fontVariant: FontVariantPropertyDefine | undefined) {\n this._fontVariant = fontVariant;\n // this.doChangeStyle();\n }\n get fontStyle(): FontStylePropertyDefine | undefined {\n return this._fontStyle;\n }\n set fontStyle(fontStyle: FontStylePropertyDefine | undefined) {\n this._fontStyle = fontStyle;\n // this.doChangeStyle();\n }\n get padding(): PaddingsPropertyDefine | undefined {\n return this._padding;\n }\n set padding(padding: PaddingsPropertyDefine | undefined) {\n this._padding = padding;\n // this.doChangeStyle();\n }\n get textOverflow(): TextOverflow | undefined {\n return this._textOverflow;\n }\n set textOverflow(textOverflow: TextOverflow | undefined) {\n this._textOverflow = textOverflow;\n // this.doChangeStyle();\n }\n get bgColor(): ColorPropertyDefine | undefined {\n return this._bgColor;\n }\n set bgColor(bgColor: ColorPropertyDefine | undefined) {\n this._bgColor = bgColor;\n // this.doChangeStyle();\n }\n get borderColor(): ColorsPropertyDefine | undefined {\n return this._borderColor;\n }\n set borderColor(borderColor: ColorsPropertyDefine | undefined) {\n this._borderColor = borderColor;\n // this.doChangeStyle();\n }\n get textStick(): boolean {\n return this._textStick;\n }\n set textStick(textStick: boolean) {\n this._textStick = textStick;\n // this.doChangeStyle();\n }\n get textAlign(): TextAlignType | undefined {\n return this._textAlign;\n }\n set textAlign(textAlign: TextAlignType | undefined) {\n this._textAlign = textAlign;\n // this.doChangeStyle();\n }\n get textBaseline(): TextBaselineType | undefined {\n return this._textBaseline;\n }\n set textBaseline(textBaseline: TextBaselineType | undefined) {\n this._textBaseline = textBaseline;\n // this.doChangeStyle();\n }\n get lineHeight(): number | undefined {\n return this._lineHeight;\n }\n set lineHeight(lineHeight: number | undefined) {\n this._lineHeight = lineHeight;\n // this.doChangeStyle();\n }\n get underline(): UnderlinePropertyDefine | undefined {\n return this._underline;\n }\n set underline(underline: UnderlinePropertyDefine | undefined) {\n this._underline = underline;\n // this.doChangeStyle();\n }\n get underlineColor(): ColorPropertyDefine | undefined {\n return this._underlineColor;\n }\n set underlineColor(underlineColor: ColorPropertyDefine | undefined) {\n this._underlineColor = underlineColor;\n // this.doChangeStyle();\n }\n get underlineDash(): LineDashPropertyDefine | undefined {\n return this._underlineDash;\n }\n set underlineDash(underlineDash: LineDashPropertyDefine | undefined) {\n this._underlineDash = underlineDash;\n // this.doChangeStyle();\n }\n get underlineOffset(): number | undefined {\n return this._underlineOffset;\n }\n set underlineOffset(underlineOffset: number | undefined) {\n this._underlineOffset = underlineOffset;\n }\n get lineThrough(): LineThroughPropertyDefine | undefined {\n return this._lineThrough;\n }\n set lineThrough(lineThrough: LineThroughPropertyDefine | undefined) {\n this._lineThrough = lineThrough;\n // this.doChangeStyle();\n }\n get lineThroughColor(): ColorPropertyDefine | undefined {\n return this._lineThroughColor;\n }\n set lineThroughColor(lineThroughColor: ColorPropertyDefine | undefined) {\n this._lineThroughColor = lineThroughColor;\n // this.doChangeStyle();\n }\n get lineThroughDash(): LineDashPropertyDefine | undefined {\n return this._lineThroughDash;\n }\n set lineThroughDash(lineThroughDash: LineDashPropertyDefine | undefined) {\n this._lineThroughDash = lineThroughDash;\n // this.doChangeStyle();\n }\n get linkColor(): ColorPropertyDefine | undefined {\n return this._linkColor;\n }\n set linkColor(linkColor: ColorPropertyDefine | undefined) {\n this._linkColor = linkColor;\n // this.doChangeStyle();\n }\n get cursor(): CursorPropertyDefine | undefined {\n return this._cursor;\n }\n set cursor(cursor: CursorPropertyDefine | undefined) {\n this._cursor = cursor;\n // this.doChangeStyle();\n }\n get borderLineWidth(): LineWidthsPropertyDefine | undefined {\n return this._borderLineWidth;\n }\n set borderLineWidth(borderLineWidth: LineWidthsPropertyDefine | undefined) {\n this._borderLineWidth = borderLineWidth;\n // this.doChangeStyle();\n }\n get borderLineDash(): LineDashsPropertyDefine | undefined {\n return this._borderLineDash;\n }\n set borderLineDash(borderLineDash: LineDashsPropertyDefine | undefined) {\n this._borderLineDash = borderLineDash;\n // this.doChangeStyle();\n }\n get marked(): MarkedPropertyDefine | undefined {\n return this._marked;\n }\n set marked(marked: MarkedPropertyDefine | undefined) {\n this._marked = marked;\n // this.doChangeStyle();\n }\n // doChangeStyle(): void {\n // this.fireListeners(STYLE_EVENT_TYPE.CHANGE_STYLE, null);\n // }\n clone(): Style {\n return new Style(this, null);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/body-helper/style/Style.ts"],"names":[],"mappings":";;;AAuBA,IAAI,YAAmB,CAAC;AACxB,yDAAsD;AACtD,MAAM,gBAAgB,GAAG;IACvB,YAAY,EAAE,cAAuB;CACtC,CAAC;AAEF,MAAa,KAAM,SAAQ,yBAAW;IA6BpC,MAAM,KAAK,UAAU;QACnB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IACD,MAAM,KAAK,OAAO;QAChB,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,YAAY,QAAsB,EAAE,EAAE,YAA0B,EAAE;;QAChE,KAAK,EAAE,CAAC;QA5BF,oBAAe,GAA2B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,C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,CAAC;IACD,IAAI,cAAc,CAAC,cAAmD;QACpE,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IAExC,CAAC;IACD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,IAAI,MAAM,CAAC,MAAwC;QACjD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAExB,CAAC;IAID,KAAK;QACH,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AArQD,sBAqQC","file":"Style.js","sourcesContent":["/* eslint-disable no-undef */\nimport type {\n ColorPropertyDefine,\n ColumnStyle,\n IStyleOption,\n TextOverflow,\n UnderlinePropertyDefine,\n LineThroughPropertyDefine,\n LineDashPropertyDefine,\n ColorsPropertyDefine,\n PaddingsPropertyDefine,\n CursorPropertyDefine,\n LineWidthsPropertyDefine,\n LineDashsPropertyDefine,\n MarkedPropertyDefine,\n FontSizePropertyDefine,\n FontFamilyPropertyDefine,\n FontWeightPropertyDefine,\n FontVariantPropertyDefine,\n FontStylePropertyDefine,\n TextAlignType,\n TextBaselineType\n} from '../../ts-types';\nlet defaultStyle: Style;\nimport { EventTarget } from '../../event/EventTarget';\nconst STYLE_EVENT_TYPE = {\n CHANGE_STYLE: 'change_style' as const\n};\n\nexport class Style extends EventTarget implements ColumnStyle {\n private _color?: ColorPropertyDefine;\n private _fontSize?: FontSizePropertyDefine;\n private _fontFamily?: FontFamilyPropertyDefine;\n private _fontWeight?: FontWeightPropertyDefine;\n private _fontVariant?: FontVariantPropertyDefine;\n private _fontStyle?: FontStylePropertyDefine;\n private _padding?: PaddingsPropertyDefine;\n private _defaultPadding: PaddingsPropertyDefine = [10, 16, 10, 16];\n private _textStick: boolean;\n private _textStickBaseOnAlign: boolean;\n private _textOverflow?: TextOverflow;\n private _textAlign?: TextAlignType;\n private _textBaseline?: TextBaselineType;\n private _bgColor?: ColorPropertyDefine;\n private _borderColor?: ColorsPropertyDefine;\n private _lineHeight?: number;\n private _underline?: UnderlinePropertyDefine;\n private _underlineColor?: ColorPropertyDefine;\n private _underlineDash?: LineDashPropertyDefine;\n private _underlineOffset?: number;\n private _lineThrough?: LineThroughPropertyDefine;\n private _lineThroughColor?: ColorPropertyDefine;\n private _lineThroughDash?: LineDashPropertyDefine;\n private _linkColor?: ColorPropertyDefine;\n private _cursor?: CursorPropertyDefine;\n private _borderLineWidth?: LineWidthsPropertyDefine;\n private _borderLineDash?: LineDashsPropertyDefine;\n private _marked?: MarkedPropertyDefine;\n static get EVENT_TYPE(): { CHANGE_STYLE: 'change_style' } {\n return STYLE_EVENT_TYPE;\n }\n static get DEFAULT(): Style {\n return defaultStyle ? defaultStyle : (defaultStyle = new Style());\n }\n constructor(style: IStyleOption = {}, bodyStyle: IStyleOption = {}) {\n super();\n this._textAlign = style?.textAlign ?? bodyStyle?.textAlign; //|| \"left\";\n this._textBaseline = style?.textBaseline ?? bodyStyle?.textBaseline; //|| \"middle\";\n this._color = style?.color ?? bodyStyle?.color;\n // icon为文字前后可添加的图表\n this._fontSize = style.fontSize ?? bodyStyle?.fontSize;\n this._fontFamily = style.fontFamily ?? bodyStyle?.fontFamily;\n this._fontWeight = style.fontWeight ?? bodyStyle?.fontWeight;\n this._fontVariant = style.fontVariant ?? bodyStyle?.fontVariant;\n this._fontStyle = style.fontStyle ?? bodyStyle?.fontStyle;\n //修改不能设置为0的情况\n this._padding = style?.padding ?? bodyStyle?.padding ?? this._defaultPadding;\n this._borderColor = style?.borderColor ?? bodyStyle?.borderColor;\n this._textOverflow = style?.textOverflow ?? bodyStyle?.textOverflow; //|| \"clip\";\n this._textStick = style.textStick ?? bodyStyle?.textStick ?? false;\n this._textStickBaseOnAlign = style.textStickBaseOnAlign ?? bodyStyle?.textStickBaseOnAlign ?? false;\n this._bgColor = style?.bgColor ?? bodyStyle?.bgColor;\n this._lineHeight = style?.lineHeight ?? bodyStyle?.lineHeight;\n this._underline = style?.underline ?? bodyStyle?.underline;\n this._underlineColor = style?.underlineColor ?? bodyStyle?.underlineColor;\n this._underlineDash = style?.underlineDash ?? bodyStyle?.underlineDash;\n this._underlineOffset = style?.underlineOffset ?? bodyStyle?.underlineOffset;\n this._lineThrough = style?.lineThrough ?? bodyStyle?.lineThrough;\n this._lineThroughColor = style?.lineThroughColor ?? bodyStyle?.lineThroughColor;\n this._lineThroughDash = style?.lineThroughDash ?? bodyStyle?.lineThroughDash;\n this._linkColor = style?.linkColor ?? bodyStyle?.linkColor;\n this._cursor = style.cursor ?? bodyStyle?.cursor;\n this._borderLineWidth = style.borderLineWidth ?? bodyStyle?.borderLineWidth;\n this._borderLineDash = style.borderLineDash ?? bodyStyle?.borderLineDash;\n this._marked = style.marked ?? bodyStyle?.marked;\n }\n get color(): ColorPropertyDefine | undefined {\n return this._color;\n }\n set color(color: ColorPropertyDefine | undefined) {\n this._color = color;\n // this.doChangeStyle();\n }\n get fontSize(): FontSizePropertyDefine | undefined {\n return this._fontSize;\n }\n set fontSize(fontSize: FontSizePropertyDefine | undefined) {\n this._fontSize = fontSize;\n // this.doChangeStyle();\n }\n get fontFamily(): FontFamilyPropertyDefine | undefined {\n return this._fontFamily;\n }\n set fontFamily(fontFamily: FontFamilyPropertyDefine | undefined) {\n this._fontFamily = fontFamily;\n // this.doChangeStyle();\n }\n get fontWeight(): FontWeightPropertyDefine | undefined {\n return this._fontWeight;\n }\n set fontWeight(fontWeight: FontWeightPropertyDefine | undefined) {\n this._fontWeight = fontWeight;\n // this.doChangeStyle();\n }\n get fontVariant(): FontVariantPropertyDefine | undefined {\n return this._fontVariant;\n }\n set fontVariant(fontVariant: FontVariantPropertyDefine | undefined) {\n this._fontVariant = fontVariant;\n // this.doChangeStyle();\n }\n get fontStyle(): FontStylePropertyDefine | undefined {\n return this._fontStyle;\n }\n set fontStyle(fontStyle: FontStylePropertyDefine | undefined) {\n this._fontStyle = fontStyle;\n // this.doChangeStyle();\n }\n get padding(): PaddingsPropertyDefine | undefined {\n return this._padding;\n }\n set padding(padding: PaddingsPropertyDefine | undefined) {\n this._padding = padding;\n // this.doChangeStyle();\n }\n get textOverflow(): TextOverflow | undefined {\n return this._textOverflow;\n }\n set textOverflow(textOverflow: TextOverflow | undefined) {\n this._textOverflow = textOverflow;\n // this.doChangeStyle();\n }\n get bgColor(): ColorPropertyDefine | undefined {\n return this._bgColor;\n }\n set bgColor(bgColor: ColorPropertyDefine | undefined) {\n this._bgColor = bgColor;\n // this.doChangeStyle();\n }\n get borderColor(): ColorsPropertyDefine | undefined {\n return this._borderColor;\n }\n set borderColor(borderColor: ColorsPropertyDefine | undefined) {\n this._borderColor = borderColor;\n // this.doChangeStyle();\n }\n get textStick(): boolean {\n return this._textStick;\n }\n set textStick(textStick: boolean) {\n this._textStick = textStick;\n // this.doChangeStyle();\n }\n get textStickBaseOnAlign(): boolean {\n return this._textStickBaseOnAlign;\n }\n set textStickBaseOnAlign(textStickBaseOnAlign: boolean) {\n this._textStickBaseOnAlign = textStickBaseOnAlign;\n // this.doChangeStyle();\n }\n get textAlign(): TextAlignType | undefined {\n return this._textAlign;\n }\n set textAlign(textAlign: TextAlignType | undefined) {\n this._textAlign = textAlign;\n // this.doChangeStyle();\n }\n get textBaseline(): TextBaselineType | undefined {\n return this._textBaseline;\n }\n set textBaseline(textBaseline: TextBaselineType | undefined) {\n this._textBaseline = textBaseline;\n // this.doChangeStyle();\n }\n get lineHeight(): number | undefined {\n return this._lineHeight;\n }\n set lineHeight(lineHeight: number | undefined) {\n this._lineHeight = lineHeight;\n // this.doChangeStyle();\n }\n get underline(): UnderlinePropertyDefine | undefined {\n return this._underline;\n }\n set underline(underline: UnderlinePropertyDefine | undefined) {\n this._underline = underline;\n // this.doChangeStyle();\n }\n get underlineColor(): ColorPropertyDefine | undefined {\n return this._underlineColor;\n }\n set underlineColor(underlineColor: ColorPropertyDefine | undefined) {\n this._underlineColor = underlineColor;\n // this.doChangeStyle();\n }\n get underlineDash(): LineDashPropertyDefine | undefined {\n return this._underlineDash;\n }\n set underlineDash(underlineDash: LineDashPropertyDefine | undefined) {\n this._underlineDash = underlineDash;\n // this.doChangeStyle();\n }\n get underlineOffset(): number | undefined {\n return this._underlineOffset;\n }\n set underlineOffset(underlineOffset: number | undefined) {\n this._underlineOffset = underlineOffset;\n }\n get lineThrough(): LineThroughPropertyDefine | undefined {\n return this._lineThrough;\n }\n set lineThrough(lineThrough: LineThroughPropertyDefine | undefined) {\n this._lineThrough = lineThrough;\n // this.doChangeStyle();\n }\n get lineThroughColor(): ColorPropertyDefine | undefined {\n return this._lineThroughColor;\n }\n set lineThroughColor(lineThroughColor: ColorPropertyDefine | undefined) {\n this._lineThroughColor = lineThroughColor;\n // this.doChangeStyle();\n }\n get lineThroughDash(): LineDashPropertyDefine | undefined {\n return this._lineThroughDash;\n }\n set lineThroughDash(lineThroughDash: LineDashPropertyDefine | undefined) {\n this._lineThroughDash = lineThroughDash;\n // this.doChangeStyle();\n }\n get linkColor(): ColorPropertyDefine | undefined {\n return this._linkColor;\n }\n set linkColor(linkColor: ColorPropertyDefine | undefined) {\n this._linkColor = linkColor;\n // this.doChangeStyle();\n }\n get cursor(): CursorPropertyDefine | undefined {\n return this._cursor;\n }\n set cursor(cursor: CursorPropertyDefine | undefined) {\n this._cursor = cursor;\n // this.doChangeStyle();\n }\n get borderLineWidth(): LineWidthsPropertyDefine | undefined {\n return this._borderLineWidth;\n }\n set borderLineWidth(borderLineWidth: LineWidthsPropertyDefine | undefined) {\n this._borderLineWidth = borderLineWidth;\n // this.doChangeStyle();\n }\n get borderLineDash(): LineDashsPropertyDefine | undefined {\n return this._borderLineDash;\n }\n set borderLineDash(borderLineDash: LineDashsPropertyDefine | undefined) {\n this._borderLineDash = borderLineDash;\n // this.doChangeStyle();\n }\n get marked(): MarkedPropertyDefine | undefined {\n return this._marked;\n }\n set marked(marked: MarkedPropertyDefine | undefined) {\n this._marked = marked;\n // this.doChangeStyle();\n }\n // doChangeStyle(): void {\n // this.fireListeners(STYLE_EVENT_TYPE.CHANGE_STYLE, null);\n // }\n clone(): Style {\n return new Style(this, null);\n }\n}\n"]}
|
|
@@ -11,7 +11,7 @@ class ContinueTableLegend {
|
|
|
11
11
|
var _a, _b, _c, _d;
|
|
12
12
|
this.table = table, this.option = (0, vutils_1.cloneDeep)(option), this.orient = null !== (_a = option.orient) && void 0 !== _a ? _a : "left",
|
|
13
13
|
this.visible = null === (_b = option.visible) || void 0 === _b || _b, this.position = null !== (_c = option.position) && void 0 !== _c ? _c : "middle",
|
|
14
|
-
this.selectedData = null !== (_d = option.defaultSelected) && void 0 !== _d ? _d :
|
|
14
|
+
this.selectedData = null !== (_d = option.defaultSelected) && void 0 !== _d ? _d : null,
|
|
15
15
|
this.createComponent(), this.initEvent();
|
|
16
16
|
}
|
|
17
17
|
createComponent() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/legend/continue-legend/continue-legend.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAGzD,qEAAwG;AACxG,qFAAiF;AACjF,qEAAkE;AAClE,+DAAiE;AAGjE,MAAa,mBAAmB;IAS9B,YAAY,MAAwD,EAAE,KAAmB;;QACvF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAA,MAAM,CAAC,MAAM,mCAAI,MAAM,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,IAAI,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,MAAA,MAAM,CAAC,QAAQ,mCAAI,QAAQ,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,EAAE,CAAC;QAEjD,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,eAAe;QACb,MAAM,KAAK,GAAG,IA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CAAC,CAAC,CAAC,CAAC,CAAC;QAC9G,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjH,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnG,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;CACF;AArLD,kDAqLC","file":"continue-legend.js","sourcesContent":["import { cloneDeep, get, merge } from '@visactor/vutils';\nimport type { IColorTableLegendOption, ISizeTableLegendOption } from '../../../ts-types/component/legend';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { ColorContinuousLegend, SizeContinuousLegend, LegendEvent } from '@visactor/vrender-components';\nimport { getContinuousLegendAttributes } from './get-continue-legend-attributes';\nimport { TABLE_EVENT_TYPE } from '../../../core/TABLE_EVENT_TYPE';\nimport { getQuadProps } from '../../../scenegraph/utils/padding';\nimport type { IOrientType } from '../../../ts-types/component/util';\n\nexport class ContinueTableLegend {\n table: BaseTableAPI;\n option: IColorTableLegendOption | ISizeTableLegendOption;\n orient: IOrientType;\n visible: boolean;\n position: 'start' | 'middle' | 'end';\n selectedData: (string | number)[];\n legendComponent: ColorContinuousLegend | SizeContinuousLegend;\n\n constructor(option: IColorTableLegendOption | ISizeTableLegendOption, table: BaseTableAPI) {\n this.table = table;\n this.option = cloneDeep(option);\n this.orient = option.orient ?? 'left';\n this.visible = option.visible ?? true;\n this.position = option.position ?? 'middle';\n this.selectedData = option.defaultSelected ?? [];\n\n this.createComponent();\n this.initEvent();\n }\n\n createComponent() {\n const attrs = this.getLegendAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n\n let legend;\n if (this.option.type === 'color') {\n legend = new ColorContinuousLegend(\n merge({}, attrs, {\n slidable: true\n // defaultSelected: this.selectedData\n })\n );\n } else {\n legend = new SizeContinuousLegend(\n merge({}, attrs, {\n slidable: true\n // defaultSelected: this.selectedData\n })\n );\n }\n legend.name = 'legend';\n this.legendComponent = legend;\n this.table.scenegraph.stage.defaultLayer.appendChild(legend);\n\n this.adjustTableSize(attrs);\n }\n\n resize() {\n if (!this.legendComponent) {\n return;\n }\n\n this.legendComponent.setAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n\n this.adjustTableSize(this.legendComponent.attribute);\n }\n\n adjustTableSize(attrs: any) {\n // 调整位置\n let width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n let height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n if (width <= 0 || height <= 0) {\n return;\n }\n const rectWidth = this.table.tableNoFrameWidth;\n const rectHeight = this.table.tableNoFrameHeight;\n const padding = getQuadProps(attrs.padding ?? this.option.padding ?? 10);\n\n let x = 0;\n let y = 0;\n if (this.orient === 'left') {\n x = padding[3];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'top') {\n x = 0;\n y = padding[0];\n height += padding[0] + padding[2];\n } else if (this.orient === 'right') {\n x = rectWidth - width - padding[1];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'bottom') {\n x = 0;\n y = rectHeight - height - padding[2];\n height += padding[0] + padding[2];\n }\n\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const position = this.position;\n // const { width: rectWidth, height: rectHeight } = fullSpace;\n let offsetX = 0;\n let offsetY = 0;\n if (layout === 'horizontal') {\n if (position === 'middle') {\n offsetX = (rectWidth - width) / 2;\n } else if (position === 'end') {\n offsetX = rectWidth - width - padding[1];\n } else {\n offsetX = padding[3];\n }\n } else {\n if (position === 'middle') {\n offsetY = (rectHeight - height) / 2;\n } else if (position === 'end') {\n offsetY = rectHeight - height - padding[2];\n } else {\n offsetY = padding[0];\n }\n }\n\n this.legendComponent.setAttributes({\n dx: offsetX,\n dy: offsetY,\n x,\n y\n });\n\n // update table size\n if (this.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n }\n\n getLegendAttributes(rect: any) {\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const align = layout === 'horizontal' ? 'bottom' : this.orient;\n\n const attrs = {\n ...getContinuousLegendAttributes(this.option, rect),\n layout,\n align,\n // zIndex: this.layoutZIndex,\n min: this.option.min,\n max: this.option.max,\n value: this.option.value,\n [this.option.type === 'color' ? 'colors' : 'sizeRange']:\n this.option.type === 'color'\n ? (this.option as IColorTableLegendOption).colors\n : (this.option as ISizeTableLegendOption).sizeRange\n };\n return attrs;\n }\n\n initEvent() {\n if (this.legendComponent) {\n this.legendComponent.addEventListener('change', (e: any) => {\n const selectedData = get(e, 'detail.value');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_CHANGE, { model: this, value: selectedData, event: e });\n this.table.scenegraph.updateNextFrame();\n });\n }\n }\n\n getLegendBounds() {\n const width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n const height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n\n return {\n width: width,\n height: height\n };\n }\n release() {\n this.legendComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent);\n this.legendComponent = null;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/legend/continue-legend/continue-legend.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAGzD,qEAAwG;AACxG,qFAAiF;AACjF,qEAAkE;AAClE,+DAAiE;AAGjE,MAAa,mBAAmB;IAS9B,YAAY,MAAwD,EAAE,KAAmB;;QACvF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAA,MAAM,CAAC,MAAM,mCAAI,MAAM,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,IAAI,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,MAAA,MAAM,CAAC,QAAQ,mCAAI,QAAQ,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,IAAI,CAAC;QAEnD,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,eAAe;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC;YACrC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB;YACnC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB;SACtC,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC;QACX,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;YAChC,MAAM,GAAG,IAAI,0CAAqB,CAChC,IAAA,cAAK,EAAC,EAAE,EAAE,KAAK,EAAE;gBACf,QAAQ,EAAE,IAAI;aAEf,CAAC,CACH,CAAC;SACH;aAAM;YACL,MAAM,GAAG,IAAI,y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YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnG,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;CACF;AArLD,kDAqLC","file":"continue-legend.js","sourcesContent":["import { cloneDeep, get, merge } from '@visactor/vutils';\nimport type { IColorTableLegendOption, ISizeTableLegendOption } from '../../../ts-types/component/legend';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { ColorContinuousLegend, SizeContinuousLegend, LegendEvent } from '@visactor/vrender-components';\nimport { getContinuousLegendAttributes } from './get-continue-legend-attributes';\nimport { TABLE_EVENT_TYPE } from '../../../core/TABLE_EVENT_TYPE';\nimport { getQuadProps } from '../../../scenegraph/utils/padding';\nimport type { IOrientType } from '../../../ts-types/component/util';\n\nexport class ContinueTableLegend {\n table: BaseTableAPI;\n option: IColorTableLegendOption | ISizeTableLegendOption;\n orient: IOrientType;\n visible: boolean;\n position: 'start' | 'middle' | 'end';\n selectedData: (string | number)[];\n legendComponent: ColorContinuousLegend | SizeContinuousLegend;\n\n constructor(option: IColorTableLegendOption | ISizeTableLegendOption, table: BaseTableAPI) {\n this.table = table;\n this.option = cloneDeep(option);\n this.orient = option.orient ?? 'left';\n this.visible = option.visible ?? true;\n this.position = option.position ?? 'middle';\n this.selectedData = option.defaultSelected ?? null;\n\n this.createComponent();\n this.initEvent();\n }\n\n createComponent() {\n const attrs = this.getLegendAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n\n let legend;\n if (this.option.type === 'color') {\n legend = new ColorContinuousLegend(\n merge({}, attrs, {\n slidable: true\n // defaultSelected: this.selectedData\n })\n );\n } else {\n legend = new SizeContinuousLegend(\n merge({}, attrs, {\n slidable: true\n // defaultSelected: this.selectedData\n })\n );\n }\n legend.name = 'legend';\n this.legendComponent = legend;\n this.table.scenegraph.stage.defaultLayer.appendChild(legend);\n\n this.adjustTableSize(attrs);\n }\n\n resize() {\n if (!this.legendComponent) {\n return;\n }\n\n this.legendComponent.setAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n\n this.adjustTableSize(this.legendComponent.attribute);\n }\n\n adjustTableSize(attrs: any) {\n // 调整位置\n let width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n let height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n if (width <= 0 || height <= 0) {\n return;\n }\n const rectWidth = this.table.tableNoFrameWidth;\n const rectHeight = this.table.tableNoFrameHeight;\n const padding = getQuadProps(attrs.padding ?? this.option.padding ?? 10);\n\n let x = 0;\n let y = 0;\n if (this.orient === 'left') {\n x = padding[3];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'top') {\n x = 0;\n y = padding[0];\n height += padding[0] + padding[2];\n } else if (this.orient === 'right') {\n x = rectWidth - width - padding[1];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'bottom') {\n x = 0;\n y = rectHeight - height - padding[2];\n height += padding[0] + padding[2];\n }\n\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const position = this.position;\n // const { width: rectWidth, height: rectHeight } = fullSpace;\n let offsetX = 0;\n let offsetY = 0;\n if (layout === 'horizontal') {\n if (position === 'middle') {\n offsetX = (rectWidth - width) / 2;\n } else if (position === 'end') {\n offsetX = rectWidth - width - padding[1];\n } else {\n offsetX = padding[3];\n }\n } else {\n if (position === 'middle') {\n offsetY = (rectHeight - height) / 2;\n } else if (position === 'end') {\n offsetY = rectHeight - height - padding[2];\n } else {\n offsetY = padding[0];\n }\n }\n\n this.legendComponent.setAttributes({\n dx: offsetX,\n dy: offsetY,\n x,\n y\n });\n\n // update table size\n if (this.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n }\n\n getLegendAttributes(rect: any) {\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const align = layout === 'horizontal' ? 'bottom' : this.orient;\n\n const attrs = {\n ...getContinuousLegendAttributes(this.option, rect),\n layout,\n align,\n // zIndex: this.layoutZIndex,\n min: this.option.min,\n max: this.option.max,\n value: this.option.value,\n [this.option.type === 'color' ? 'colors' : 'sizeRange']:\n this.option.type === 'color'\n ? (this.option as IColorTableLegendOption).colors\n : (this.option as ISizeTableLegendOption).sizeRange\n };\n return attrs;\n }\n\n initEvent() {\n if (this.legendComponent) {\n this.legendComponent.addEventListener('change', (e: any) => {\n const selectedData = get(e, 'detail.value');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_CHANGE, { model: this, value: selectedData, event: e });\n this.table.scenegraph.updateNextFrame();\n });\n }\n }\n\n getLegendBounds() {\n const width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n const height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n\n return {\n width: width,\n height: height\n };\n }\n release() {\n this.legendComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent);\n this.legendComponent = null;\n }\n}\n"]}
|
package/cjs/core/BaseTable.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
57
57
|
callback: AnyFunction;
|
|
58
58
|
}[]>;
|
|
59
59
|
customCellStylePlugin: CustomCellStylePlugin;
|
|
60
|
+
columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';
|
|
60
61
|
constructor(container: HTMLElement, options?: BaseTableConstructorOptions);
|
|
61
62
|
throttleInvalidate: (this: any, ...args: any[]) => void;
|
|
62
63
|
getContainer(): HTMLElement;
|
|
@@ -128,6 +129,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
128
129
|
get rowHierarchyType(): 'grid' | 'tree';
|
|
129
130
|
getColsWidth(startCol: number, endCol: number): number;
|
|
130
131
|
getRowHeight(row: number): number;
|
|
132
|
+
getDefaultColumnWidth(col: number): number | "auto";
|
|
131
133
|
getDefaultRowHeight(row: number): number | "auto";
|
|
132
134
|
_setRowHeight(row: number, height: number, clearCache?: boolean): void;
|
|
133
135
|
getRowsHeight(startRow: number, endRow: number): number;
|
|
@@ -348,7 +350,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
348
350
|
}): ITextSize;
|
|
349
351
|
getCustomRender(col: number, row: number): ICustomRender;
|
|
350
352
|
getCustomLayout(col: number, row: number): ICustomLayout;
|
|
351
|
-
hasAutoImageColumn(): ColumnData;
|
|
353
|
+
hasAutoImageColumn(): HeaderData | ColumnData;
|
|
352
354
|
_getActiveChartInstance(): any;
|
|
353
355
|
cellIsInVisualView(col: number, row: number): boolean;
|
|
354
356
|
getCustomMergeValue(col: number, row: number): string | undefined;
|
package/cjs/core/BaseTable.js
CHANGED
|
@@ -44,8 +44,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
44
44
|
return TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE;
|
|
45
45
|
}
|
|
46
46
|
constructor(container, options = {}) {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
48
|
-
if (super(), this.showFrozenIcon = !0, this.version = "0.22.1", this.id = `VTable${Date.now()}`,
|
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48
|
+
if (super(), this.showFrozenIcon = !0, this.version = "0.22.2-alpha.1", this.id = `VTable${Date.now()}`,
|
|
49
49
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
50
50
|
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
51
51
|
const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = pixel_ratio_1.defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth} = options;
|
|
@@ -60,7 +60,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
60
60
|
this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top),
|
|
61
61
|
padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left),
|
|
62
62
|
padding.right && (this.padding.right = padding.right))), this.tableNoFrameWidth = 0,
|
|
63
|
-
this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight
|
|
63
|
+
this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight,
|
|
64
|
+
this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
|
|
64
65
|
const internalProps = this.internalProps = {};
|
|
65
66
|
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
66
67
|
"node" !== env_1.Env.mode && (internalProps.element = (0, tableHelper_1.createRootElement)(this.padding),
|
|
@@ -85,14 +86,14 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
85
86
|
var _a;
|
|
86
87
|
return "node" === env_1.Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
87
88
|
}
|
|
88
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes_1.default.of(null !== (
|
|
89
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes_1.default.of(null !== (_b = options.theme) && void 0 !== _b ? _b : themes_1.default.DEFAULT),
|
|
89
90
|
internalProps.theme.isPivot = this.isPivotTable(), container ? (container.innerHTML = "",
|
|
90
91
|
container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(),
|
|
91
|
-
this.options = options, internalProps.theme = themes_1.default.of(null !== (
|
|
92
|
+
this.options = options, internalProps.theme = themes_1.default.of(null !== (_c = options.theme) && void 0 !== _c ? _c : themes_1.default.DEFAULT),
|
|
92
93
|
internalProps.theme.isPivot = this.isPivotTable(), internalProps.bodyHelper = new body_helper_1.BodyHelper(this),
|
|
93
94
|
internalProps.headerHelper = new header_helper_1.HeaderHelper(this), internalProps.rowSeriesNumberHelper = new row_series_number_helper_1.RowSeriesNumberHelper(this),
|
|
94
|
-
internalProps.autoWrapText = options.autoWrapText, internalProps.allowFrozenColCount = null !== (
|
|
95
|
-
internalProps.limitMaxAutoWidth = null !== (
|
|
95
|
+
internalProps.autoWrapText = options.autoWrapText, internalProps.allowFrozenColCount = null !== (_d = options.allowFrozenColCount) && void 0 !== _d ? _d : 0,
|
|
96
|
+
internalProps.limitMaxAutoWidth = null !== (_e = options.limitMaxAutoWidth) && void 0 !== _e ? _e : 450,
|
|
96
97
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
97
98
|
this._vDataSet = new vdataset_1.DataSet, this.scenegraph = new scenegraph_1.Scenegraph(this),
|
|
98
99
|
this.stateManager = new state_1.StateManager(this), this.eventManager = new event_1.EventManager(this),
|
|
@@ -107,13 +108,13 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
107
108
|
}, options.tooltip), "html" === internalProps.tooltip.renderMode && (internalProps.tooltipHandler = new TooltipHandler_1.TooltipHandler(this, internalProps.tooltip.confine)),
|
|
108
109
|
internalProps.menu = Object.assign({
|
|
109
110
|
renderMode: "html"
|
|
110
|
-
}, options.menu), Array.isArray(null === (
|
|
111
|
-
Array.isArray(null === (
|
|
111
|
+
}, options.menu), Array.isArray(null === (_f = options.menu) || void 0 === _f ? void 0 : _f.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.dropDownMenuHighlight),
|
|
112
|
+
Array.isArray(null === (_h = options.menu) || void 0 === _h ? void 0 : _h.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
|
|
112
113
|
"html" === internalProps.menu.renderMode && (internalProps.menuHandler = new MenuHandler_1.MenuHandler(this)),
|
|
113
114
|
this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.bodyBottomStyleCache = new Map,
|
|
114
115
|
internalProps.stick = {
|
|
115
116
|
changedCells: new Map
|
|
116
|
-
}, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new custom_cell_style_1.CustomCellStylePlugin(this, null !== (
|
|
117
|
+
}, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new custom_cell_style_1.CustomCellStylePlugin(this, null !== (_j = options.customCellStyle) && void 0 !== _j ? _j : [], null !== (_k = options.customCellStyleArrangement) && void 0 !== _k ? _k : []);
|
|
117
118
|
}
|
|
118
119
|
getContainer() {
|
|
119
120
|
return this.container;
|
|
@@ -349,6 +350,10 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
349
350
|
const defaultHeight = this.getDefaultRowHeight(row);
|
|
350
351
|
return (0, vutils_1.isNumber)(defaultHeight) ? defaultHeight : this.defaultRowHeight;
|
|
351
352
|
}
|
|
353
|
+
getDefaultColumnWidth(col) {
|
|
354
|
+
var _a, _b;
|
|
355
|
+
return this.isRowHeader(col, 0) || this.isCornerHeader(col, 0) ? Array.isArray(this.defaultHeaderColWidth) ? null !== (_a = this.defaultHeaderColWidth[col]) && void 0 !== _a ? _a : this.defaultColWidth : this.defaultHeaderColWidth : this.isRightFrozenColumn(col, this.columnHeaderLevelCount) && this.isPivotTable() ? Array.isArray(this.defaultHeaderColWidth) ? null !== (_b = this.defaultHeaderColWidth[this.rowHeaderLevelCount - this.rightFrozenColCount]) && void 0 !== _b ? _b : this.defaultColWidth : this.defaultHeaderColWidth : this.defaultColWidth;
|
|
356
|
+
}
|
|
352
357
|
getDefaultRowHeight(row) {
|
|
353
358
|
var _a, _b;
|
|
354
359
|
return this.isColumnHeader(0, row) || this.isCornerHeader(0, row) ? Array.isArray(this.defaultHeaderRowHeight) ? null !== (_a = this.defaultHeaderRowHeight[row]) && void 0 !== _a ? _a : this.internalProps.defaultRowHeight : this.defaultHeaderRowHeight : this.isBottomFrozenRow(this.rowHeaderLevelCount, row) ? Array.isArray(this.defaultHeaderRowHeight) ? null !== (_b = this.defaultHeaderRowHeight[this.columnHeaderLevelCount > 0 ? this.columnHeaderLevelCount - this.bottomFrozenRowCount : 0]) && void 0 !== _b ? _b : this.internalProps.defaultRowHeight : this.defaultHeaderRowHeight : this.internalProps.defaultRowHeight;
|
|
@@ -368,19 +373,19 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
368
373
|
return Math.round(h);
|
|
369
374
|
}
|
|
370
375
|
getColWidthDefined(col) {
|
|
371
|
-
var _a
|
|
376
|
+
var _a;
|
|
372
377
|
const {layoutMap: layoutMap} = this.internalProps;
|
|
373
378
|
if ("autoWidth" === this.widthMode) return "auto";
|
|
374
379
|
const {width: width} = null !== (_a = null == layoutMap ? void 0 : layoutMap.getColumnWidthDefined(col)) && void 0 !== _a ? _a : {};
|
|
375
|
-
return "number" == typeof width && width <= 0 ? 0 : width ||
|
|
380
|
+
return "number" == typeof width && width <= 0 ? 0 : width || this.getDefaultColumnWidth(col);
|
|
376
381
|
}
|
|
377
382
|
getColWidthDefinedNumber(col) {
|
|
378
383
|
const width = this.getColWidthDefined(col);
|
|
379
384
|
return this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
|
|
380
385
|
}
|
|
381
386
|
getColWidth(col) {
|
|
382
|
-
var _a
|
|
383
|
-
const width = null !== (_a = this.colWidthsMap.get(col)) && void 0 !== _a ? _a :
|
|
387
|
+
var _a;
|
|
388
|
+
const width = null !== (_a = this.colWidthsMap.get(col)) && void 0 !== _a ? _a : this.getDefaultColumnWidth(col);
|
|
384
389
|
return "adaptive" === this.widthMode && "number" == typeof width || this.transpose && "number" == typeof width ? this._colWidthDefineToPxWidth(width) : this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
|
|
385
390
|
}
|
|
386
391
|
_setColWidth(col, width, clearCache, skipCheckFrozen) {
|
|
@@ -1477,7 +1482,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1477
1482
|
return customLayout;
|
|
1478
1483
|
}
|
|
1479
1484
|
hasAutoImageColumn() {
|
|
1480
|
-
|
|
1485
|
+
const bodyColumn = this.internalProps.layoutMap.columnObjects.find((column => !("image" !== column.cellType && "video" !== column.cellType && "function" != typeof column.cellType || !column.define.imageAutoSizing))), headerObj = this.internalProps.layoutMap.headerObjects.find((column => !(!column || "image" !== column.headerType && "video" !== column.headerType && "function" != typeof column.headerType || !column.define.imageAutoSizing)));
|
|
1486
|
+
return bodyColumn || headerObj;
|
|
1481
1487
|
}
|
|
1482
1488
|
_getActiveChartInstance() {
|
|
1483
1489
|
var _a, _b, _c, _d, _e, _f;
|