@visactor/vtable 0.13.4 → 0.14.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/cjs/PivotTable.d.ts +2 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/style/CheckboxStyle.d.ts +8 -2
- package/cjs/body-helper/style/CheckboxStyle.js +17 -3
- package/cjs/body-helper/style/CheckboxStyle.js.map +1 -1
- package/cjs/components/axis/get-axis-attributes.d.ts +7 -0
- package/cjs/components/axis/get-axis-attributes.js +13 -17
- package/cjs/components/axis/get-axis-attributes.js.map +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js +1 -0
- package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -0
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/title/title.js +7 -6
- package/cjs/components/title/title.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +28 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +0 -1
- package/cjs/dataset/dataset.js +3 -43
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/header-helper/header-helper.d.ts +2 -1
- package/cjs/header-helper/style/CheckboxStyle.d.ts +8 -2
- package/cjs/header-helper/style/CheckboxStyle.js +15 -1
- package/cjs/header-helper/style/CheckboxStyle.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/chart-helper/get-axis-config.js +71 -35
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.js +18 -8
- package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +33 -17
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/chart-helper/zero-align.js.map +1 -0
- package/cjs/layout/pivot-header-layout.js +20 -11
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +2 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/render/layout/arc.d.ts +10 -21
- package/cjs/render/layout/arc.js +7 -9
- package/cjs/render/layout/arc.js.map +1 -1
- package/cjs/render/layout/circle.d.ts +10 -17
- package/cjs/render/layout/circle.js +5 -6
- package/cjs/render/layout/circle.js.map +1 -1
- package/cjs/render/layout/container.d.ts +10 -48
- package/cjs/render/layout/container.js +15 -100
- package/cjs/render/layout/container.js.map +1 -1
- package/cjs/render/layout/group-element.d.ts +4 -24
- package/cjs/render/layout/group-element.js +4 -40
- package/cjs/render/layout/group-element.js.map +1 -1
- package/cjs/render/layout/group.d.ts +12 -0
- package/cjs/render/layout/group.js +18 -0
- package/cjs/render/layout/group.js.map +1 -0
- package/cjs/render/layout/icon.d.ts +10 -10
- package/cjs/render/layout/icon.js +11 -9
- package/cjs/render/layout/icon.js.map +1 -1
- package/cjs/render/layout/image.d.ts +10 -17
- package/cjs/render/layout/image.js +6 -7
- package/cjs/render/layout/image.js.map +1 -1
- package/cjs/render/layout/index.d.ts +2 -0
- package/cjs/render/layout/index.js +2 -1
- package/cjs/render/layout/index.js.map +1 -1
- package/cjs/render/layout/percent-calc.d.ts +1 -4
- package/cjs/render/layout/percent-calc.js.map +1 -1
- package/cjs/render/layout/rect.d.ts +10 -20
- package/cjs/render/layout/rect.js +5 -6
- package/cjs/render/layout/rect.js.map +1 -1
- package/cjs/render/layout/tag.d.ts +14 -0
- package/cjs/render/layout/tag.js +21 -0
- package/cjs/render/layout/tag.js.map +1 -0
- package/cjs/render/layout/text.d.ts +9 -46
- package/cjs/render/layout/text.js +8 -18
- package/cjs/render/layout/text.js.map +1 -1
- package/cjs/scenegraph/component/custom.d.ts +2 -2
- package/cjs/scenegraph/component/custom.js +14 -6
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/group.d.ts +6 -2
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +3 -3
- package/cjs/scenegraph/group-creater/cell-helper.js +40 -40
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +22 -3
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.d.ts +3 -2
- package/cjs/scenegraph/group-creater/column-helper.js +78 -46
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +4 -5
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.d.ts +17 -0
- package/cjs/scenegraph/icon/icon-update.js +165 -0
- package/cjs/scenegraph/icon/icon-update.js.map +1 -0
- package/cjs/scenegraph/layout/compute-col-width.js +22 -15
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +49 -15
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.js +8 -27
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +39 -29
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +6 -2
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +43 -29
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +7 -13
- package/cjs/scenegraph/scenegraph.js +25 -141
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +77 -38
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/utils/is-merge-cell-group.d.ts +2 -0
- package/cjs/scenegraph/utils/is-merge-cell-group.js +16 -0
- package/cjs/scenegraph/utils/is-merge-cell-group.js.map +1 -0
- package/cjs/scenegraph/utils/text-icon-layout.d.ts +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +11 -5
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +14 -12
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.js +4 -2
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/state/hover/update-cell.js +10 -5
- package/cjs/state/hover/update-cell.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/BRIGHT.js +2 -1
- package/cjs/themes/DARK.js +1 -2
- package/cjs/tools/calc.js +1 -1
- package/cjs/tools/util.js +1 -1
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +9 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/style.d.ts +4 -1
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/common.d.ts +2 -0
- package/cjs/ts-types/common.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +13 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/dist/vtable.js +22152 -11275
- package/dist/vtable.min.js +2 -2
- package/es/PivotTable.d.ts +2 -1
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/style/CheckboxStyle.d.ts +8 -2
- package/es/body-helper/style/CheckboxStyle.js +17 -3
- package/es/body-helper/style/CheckboxStyle.js.map +1 -1
- package/es/components/axis/get-axis-attributes.d.ts +7 -0
- package/es/components/axis/get-axis-attributes.js +1 -1
- package/es/components/axis/get-axis-attributes.js.map +1 -1
- package/es/components/legend/continue-legend/continue-legend.js +1 -0
- package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +1 -0
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/title/title.js +6 -6
- package/es/components/title/title.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +28 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.d.ts +0 -1
- package/es/dataset/dataset.js +2 -46
- package/es/dataset/dataset.js.map +1 -1
- package/es/header-helper/header-helper.d.ts +2 -1
- package/es/header-helper/style/CheckboxStyle.d.ts +8 -2
- package/es/header-helper/style/CheckboxStyle.js +15 -1
- package/es/header-helper/style/CheckboxStyle.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/chart-helper/get-axis-config.js +72 -33
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/es/layout/chart-helper/get-axis-domain.js +20 -8
- package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +33 -12
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/chart-helper/zero-align.js.map +1 -0
- package/es/layout/pivot-header-layout.js +20 -11
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.js +2 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/render/layout/arc.d.ts +10 -21
- package/es/render/layout/arc.js +7 -7
- package/es/render/layout/arc.js.map +1 -1
- package/es/render/layout/circle.d.ts +10 -17
- package/es/render/layout/circle.js +7 -6
- package/es/render/layout/circle.js.map +1 -1
- package/es/render/layout/container.d.ts +10 -48
- package/es/render/layout/container.js +16 -107
- package/es/render/layout/container.js.map +1 -1
- package/es/render/layout/group-element.d.ts +4 -24
- package/es/render/layout/group-element.js +4 -42
- package/es/render/layout/group-element.js.map +1 -1
- package/es/render/layout/group.d.ts +12 -0
- package/es/render/layout/group.js +12 -0
- package/es/render/layout/group.js.map +1 -0
- package/es/render/layout/icon.d.ts +10 -10
- package/es/render/layout/icon.js +12 -10
- package/es/render/layout/icon.js.map +1 -1
- package/es/render/layout/image.d.ts +10 -17
- package/es/render/layout/image.js +8 -7
- package/es/render/layout/image.js.map +1 -1
- package/es/render/layout/index.d.ts +2 -0
- package/es/render/layout/index.js +4 -0
- package/es/render/layout/index.js.map +1 -1
- package/es/render/layout/percent-calc.d.ts +1 -4
- package/es/render/layout/percent-calc.js.map +1 -1
- package/es/render/layout/rect.d.ts +10 -20
- package/es/render/layout/rect.js +7 -6
- package/es/render/layout/rect.js.map +1 -1
- package/es/render/layout/tag.d.ts +14 -0
- package/es/render/layout/tag.js +15 -0
- package/es/render/layout/tag.js.map +1 -0
- package/es/render/layout/text.d.ts +9 -46
- package/es/render/layout/text.js +10 -18
- package/es/render/layout/text.js.map +1 -1
- package/es/scenegraph/component/custom.d.ts +2 -2
- package/es/scenegraph/component/custom.js +15 -7
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/group.d.ts +6 -2
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +3 -3
- package/es/scenegraph/group-creater/cell-helper.js +41 -40
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +22 -2
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.d.ts +3 -2
- package/es/scenegraph/group-creater/column-helper.js +75 -44
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -4
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +3 -6
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/icon/icon-update.d.ts +17 -0
- package/es/scenegraph/icon/icon-update.js +154 -0
- package/es/scenegraph/icon/icon-update.js.map +1 -0
- package/es/scenegraph/layout/compute-col-width.js +23 -14
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +51 -15
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/move-cell.js +8 -27
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +41 -27
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +6 -1
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +45 -27
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +7 -13
- package/es/scenegraph/scenegraph.js +25 -142
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +75 -38
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/utils/is-merge-cell-group.d.ts +2 -0
- package/es/scenegraph/utils/is-merge-cell-group.js +6 -0
- package/es/scenegraph/utils/is-merge-cell-group.js.map +1 -0
- package/es/scenegraph/utils/text-icon-layout.d.ts +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +11 -5
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +14 -12
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/hover/is-cell-hover.js +3 -1
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/state/hover/update-cell.js +4 -2
- package/es/state/hover/update-cell.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/state/state.js.map +1 -1
- package/es/themes/BRIGHT.js +2 -1
- package/es/themes/DARK.js +1 -2
- package/es/tools/calc.js +1 -1
- package/es/tools/util.js +1 -1
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +9 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/style.d.ts +4 -1
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/common.d.ts +2 -0
- package/es/ts-types/common.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +13 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/package.json +3 -3
- package/cjs/dataset/util/zero-align.js.map +0 -1
- package/cjs/scenegraph/header-icon/layout.d.ts +0 -3
- package/cjs/scenegraph/header-icon/layout.js +0 -75
- package/cjs/scenegraph/header-icon/layout.js.map +0 -1
- package/cjs/scenegraph/hover-state.d.ts +0 -14
- package/cjs/scenegraph/hover-state.js +0 -27
- package/cjs/scenegraph/hover-state.js.map +0 -1
- package/es/dataset/util/zero-align.js.map +0 -1
- package/es/scenegraph/header-icon/layout.d.ts +0 -3
- package/es/scenegraph/header-icon/layout.js +0 -69
- package/es/scenegraph/header-icon/layout.js.map +0 -1
- package/es/scenegraph/hover-state.d.ts +0 -14
- package/es/scenegraph/hover-state.js +0 -19
- package/es/scenegraph/hover-state.js.map +0 -1
- /package/cjs/{dataset/util → layout/chart-helper}/zero-align.d.ts +0 -0
- /package/cjs/{dataset/util → layout/chart-helper}/zero-align.js +0 -0
- /package/es/{dataset/util → layout/chart-helper}/zero-align.d.ts +0 -0
- /package/es/{dataset/util → layout/chart-helper}/zero-align.js +0 -0
|
@@ -6,7 +6,7 @@ import { isEqual } from "@visactor/vutils";
|
|
|
6
6
|
|
|
7
7
|
export class Title {
|
|
8
8
|
constructor(titleOption, table) {
|
|
9
|
-
this.isReleased = !1, this.table = table, this._titleOption = titleOption, this._titleComponent = this._createOrUpdateTitleComponent(this._getTitleAttrs());
|
|
9
|
+
this.isReleased = !1, this.table = table, this._titleOption = titleOption, !1 !== titleOption.visible && (this._titleComponent = this._createOrUpdateTitleComponent(this._getTitleAttrs()));
|
|
10
10
|
}
|
|
11
11
|
_createOrUpdateTitleComponent(attrs) {
|
|
12
12
|
if (this._titleComponent) isEqual(attrs, this._cacheAttrs) || this._titleComponent.setAttributes(attrs); else {
|
|
@@ -34,14 +34,14 @@ export class Title {
|
|
|
34
34
|
}), this._adjustTableSize(this._titleComponent.attribute);
|
|
35
35
|
}
|
|
36
36
|
_adjustTableSize(attrs) {
|
|
37
|
-
var _a, _b;
|
|
38
|
-
const width = isFinite(this._titleComponent.AABBBounds.width()) ? this._titleComponent.AABBBounds.width() : 0, height = isFinite(this._titleComponent.AABBBounds.height()) ? this._titleComponent.AABBBounds.height() : 0;
|
|
37
|
+
var _a, _b, _c, _d;
|
|
38
|
+
const width = isFinite(null === (_a = this._titleComponent) || void 0 === _a ? void 0 : _a.AABBBounds.width()) ? this._titleComponent.AABBBounds.width() : 0, height = isFinite(null === (_b = this._titleComponent) || void 0 === _b ? void 0 : _b.AABBBounds.height()) ? this._titleComponent.AABBBounds.height() : 0;
|
|
39
39
|
"left" === this._titleOption.orient ? (this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width),
|
|
40
40
|
this.table.tableX += Math.ceil(width)) : "top" === this._titleOption.orient ? (this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height),
|
|
41
41
|
this.table.tableY += Math.ceil(height)) : "right" === this._titleOption.orient ? this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width) : "bottom" === this._titleOption.orient && (this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height)),
|
|
42
42
|
this._cacheAttrs = attrs, "right" !== this._titleOption.orient && "bottom" !== this._titleOption.orient || this._titleComponent.setAttributes({
|
|
43
|
-
x: (null !== (
|
|
44
|
-
y: (null !== (
|
|
43
|
+
x: (null !== (_c = this._titleOption.x) && void 0 !== _c ? _c : "right" === this._titleOption.orient) ? this.table.tableX + this.table.tableNoFrameWidth : this.table.tableX,
|
|
44
|
+
y: (null !== (_d = this._titleOption.y) && void 0 !== _d ? _d : "bottom" === this._titleOption.orient) ? this.table.tableY + this.table.tableNoFrameHeight : this.table.tableY
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
release() {
|
|
@@ -50,7 +50,7 @@ export class Title {
|
|
|
50
50
|
}
|
|
51
51
|
_getTitleAttrs() {
|
|
52
52
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53
|
-
const padding = getQuadProps(null !== (_a = this._titleOption.padding) && void 0 !== _a ? _a :
|
|
53
|
+
const defaultPadding = this._titleOption.text || this._titleOption.subtext ? 10 : 0, padding = getQuadProps(null !== (_a = this._titleOption.padding) && void 0 !== _a ? _a : defaultPadding), realWidth = null !== (_b = this._titleOption.width) && void 0 !== _b ? _b : Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3], realHeight = null !== (_c = this._titleOption.height) && void 0 !== _c ? _c : Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];
|
|
54
54
|
return {
|
|
55
55
|
text: null !== (_d = this._titleOption.text) && void 0 !== _d ? _d : "",
|
|
56
56
|
subtext: null !== (_e = this._titleOption.subtext) && void 0 !== _e ? _e : "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/title/title.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIxE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,MAAM,OAAO,KAAK;IAMhB,YAAY,WAAmB,EAAE,KAAmB;QAHpD,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IACnF,CAAC;IAEO,6BAA6B,CAAC,KAAiB;QACrD,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;gBACrC,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;aAC3C;SACF;aAAM;YACL,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;YACzC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC5D,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;SAG9B;QAED,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,MAAM;;QACJ,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,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mCAAI,MAAM;YACxC,aAAa,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,aAAa,mCAAI,KAAK;YACvD,SAAS,kBACP,KAAK,EAAE,SAAS,IACb,IAAI,CAAC,YAAY,CAAC,SAAS,CAC/B;YACD,YAAY,kBACV,KAAK,EAAE,SAAS,IACb,IAAI,CAAC,YAAY,CAAC,YAAY,CAClC;SACY,CAAC;IAClB,CAAC;CACF","file":"title.js","sourcesContent":["import { Title as TitleComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { TitleAttrs } from '@visactor/vrender-components';\nimport type { ITitle } from '../../ts-types/component/title';\nimport { getQuadProps } from '../../scenegraph/utils/padding';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nexport class Title {\n table: BaseTableAPI;\n _titleOption: ITitle;\n isReleased: boolean = false;\n private _titleComponent: TitleComponents;\n private _cacheAttrs: TitleAttrs;\n constructor(titleOption: ITitle, table: BaseTableAPI) {\n this.table = table;\n this._titleOption = titleOption;\n this._titleComponent = this._createOrUpdateTitleComponent(this._getTitleAttrs());\n }\n\n private _createOrUpdateTitleComponent(attrs: TitleAttrs): TitleComponents {\n if (this._titleComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._titleComponent.setAttributes(attrs);\n }\n } else {\n const title = new TitleComponents(attrs);\n title.name = 'title';\n this.table.scenegraph.stage.defaultLayer.appendChild(title);\n this._titleComponent = title;\n // 代理 title 组件上的事件\n // title.on('*', (event: any, type: string) => this._delegateEvent(title as unknown as INode, event, type));\n }\n // update table size\n this._adjustTableSize(this._titleComponent.attribute);\n return this._titleComponent;\n }\n\n resize() {\n if (!this._titleComponent) {\n return;\n }\n const padding = getQuadProps(this._titleOption.padding ?? 10);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n // width: realWidth,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n }\n });\n this._adjustTableSize(this._titleComponent.attribute);\n }\n\n _adjustTableSize(attrs: TitleAttrs) {\n // 调整位置\n const width = isFinite(this._titleComponent.AABBBounds.width()) ? this._titleComponent.AABBBounds.width() : 0;\n const height = isFinite(this._titleComponent.AABBBounds.height()) ? this._titleComponent.AABBBounds.height() : 0;\n // const rectWidth = this.table.tableNoFrameWidth;\n // const rectHeight = this.table.tableNoFrameHeight;\n // const padding = getQuadProps((attrs.padding as number | number[]) ?? this._titleOption.padding ?? 10);\n\n // let x = 0;\n // let y = 0;\n // if (this._titleOption.orient === 'left') {\n // x = padding[3];\n // y = 0;\n // // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'top') {\n // x = 0;\n // y = padding[0];\n // // height += padding[0] + padding[2];\n // } else if (this._titleOption.orient === 'right') {\n // x = rectWidth - width - padding[1];\n // y = 0;\n // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'bottom') {\n // x = 0;\n // y = rectHeight - height - padding[2];\n // // height += padding[0] + padding[2];\n // }\n if (this._titleOption.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this._titleOption.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this._titleOption.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this._titleOption.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n this._cacheAttrs = attrs;\n if (this._titleOption.orient === 'right' || this._titleOption.orient === 'bottom') {\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + this.table.tableNoFrameWidth\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY\n });\n }\n }\n\n release(): void {\n this._titleComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent);\n this._titleComponent = null;\n this.isReleased = true;\n }\n private _getTitleAttrs() {\n const padding = getQuadProps(this._titleOption.padding ?? 10);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n return {\n text: this._titleOption.text ?? '',\n subtext: this._titleOption.subtext ?? '',\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n minWidth: this._titleOption.minWidth,\n maxWidth: this._titleOption.maxWidth,\n minHeight: this._titleOption.minHeight,\n maxHeight: this._titleOption.maxHeight,\n padding: this._titleOption.padding,\n align: this._titleOption.align ?? 'left',\n verticalAlign: this._titleOption.verticalAlign ?? 'top',\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n }\n } as TitleAttrs;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["components/title/title.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIxE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,MAAM,OAAO,KAAK;IAMhB,YAAY,WAAmB,EAAE,KAAmB;QAHpD,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,EAAE;YACjC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;SAClF;IACH,CAAC;IAEO,6BAA6B,CAAC,KAAiB;QACrD,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;gBACrC,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;aAC3C;SACF;aAAM;YACL,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;YACzC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC5D,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;SAG9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,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM;YAC9B,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ;YACpC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ;YACpC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS;YACtC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS;YACtC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO;YAClC,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,KAAK,mCAAI,MAAM;YACxC,aAAa,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,aAAa,mCAAI,KAAK;YACvD,SAAS,kBACP,KAAK,EAAE,SAAS,IACb,IAAI,CAAC,YAAY,CAAC,SAAS,CAC/B;YACD,YAAY,kBACV,KAAK,EAAE,SAAS,IACb,IAAI,CAAC,YAAY,CAAC,YAAY,CAClC;SACY,CAAC;IAClB,CAAC;CACF","file":"title.js","sourcesContent":["import { Title as TitleComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { TitleAttrs } from '@visactor/vrender-components';\nimport type { ITitle } from '../../ts-types/component/title';\nimport { getQuadProps } from '../../scenegraph/utils/padding';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nexport class Title {\n table: BaseTableAPI;\n _titleOption: ITitle;\n isReleased: boolean = false;\n private _titleComponent: TitleComponents;\n private _cacheAttrs: TitleAttrs;\n constructor(titleOption: ITitle, table: BaseTableAPI) {\n this.table = table;\n this._titleOption = titleOption;\n if (titleOption.visible !== false) {\n this._titleComponent = this._createOrUpdateTitleComponent(this._getTitleAttrs());\n }\n }\n\n private _createOrUpdateTitleComponent(attrs: TitleAttrs): TitleComponents {\n if (this._titleComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._titleComponent.setAttributes(attrs);\n }\n } else {\n const title = new TitleComponents(attrs);\n title.name = 'title';\n this.table.scenegraph.stage.defaultLayer.appendChild(title);\n this._titleComponent = title;\n // 代理 title 组件上的事件\n // title.on('*', (event: any, type: string) => this._delegateEvent(title as unknown as INode, event, type));\n }\n // update table size\n this._adjustTableSize(this._titleComponent.attribute);\n return this._titleComponent;\n }\n\n resize() {\n if (!this._titleComponent) {\n return;\n }\n const padding = getQuadProps(this._titleOption.padding ?? 10);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n // width: realWidth,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n }\n });\n this._adjustTableSize(this._titleComponent.attribute);\n }\n\n _adjustTableSize(attrs: TitleAttrs) {\n // 调整位置\n const width = isFinite(this._titleComponent?.AABBBounds.width()) ? this._titleComponent.AABBBounds.width() : 0;\n const height = isFinite(this._titleComponent?.AABBBounds.height()) ? this._titleComponent.AABBBounds.height() : 0;\n // const rectWidth = this.table.tableNoFrameWidth;\n // const rectHeight = this.table.tableNoFrameHeight;\n // const padding = getQuadProps((attrs.padding as number | number[]) ?? this._titleOption.padding ?? 10);\n\n // let x = 0;\n // let y = 0;\n // if (this._titleOption.orient === 'left') {\n // x = padding[3];\n // y = 0;\n // // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'top') {\n // x = 0;\n // y = padding[0];\n // // height += padding[0] + padding[2];\n // } else if (this._titleOption.orient === 'right') {\n // x = rectWidth - width - padding[1];\n // y = 0;\n // width += padding[1] + padding[3];\n // } else if (this._titleOption.orient === 'bottom') {\n // x = 0;\n // y = rectHeight - height - padding[2];\n // // height += padding[0] + padding[2];\n // }\n if (this._titleOption.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this._titleOption.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this._titleOption.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this._titleOption.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n this._cacheAttrs = attrs;\n if (this._titleOption.orient === 'right' || this._titleOption.orient === 'bottom') {\n this._titleComponent.setAttributes({\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + this.table.tableNoFrameWidth\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY\n });\n }\n }\n\n release(): void {\n this._titleComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent);\n this._titleComponent = null;\n this.isReleased = true;\n }\n private _getTitleAttrs() {\n const defaultPadding = this._titleOption.text || this._titleOption.subtext ? 10 : 0;\n const padding = getQuadProps(this._titleOption.padding ?? defaultPadding);\n const realWidth =\n this._titleOption.width ??\n Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];\n const realHeight =\n this._titleOption.height ??\n Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];\n return {\n text: this._titleOption.text ?? '',\n subtext: this._titleOption.subtext ?? '',\n x:\n this._titleOption.x ?? this._titleOption.orient === 'right'\n ? this.table.tableX + Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)\n : this.table.tableX,\n y:\n this._titleOption.y ?? this._titleOption.orient === 'bottom'\n ? this.table.tableY + this.table.tableNoFrameHeight\n : this.table.tableY,\n width:\n this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'\n ? realWidth\n : this._titleOption.width,\n height:\n this._titleOption.orient === 'left' || this._titleOption.orient === 'right'\n ? realHeight\n : this._titleOption.height,\n minWidth: this._titleOption.minWidth,\n maxWidth: this._titleOption.maxWidth,\n minHeight: this._titleOption.minHeight,\n maxHeight: this._titleOption.maxHeight,\n padding: this._titleOption.padding,\n align: this._titleOption.align ?? 'left',\n verticalAlign: this._titleOption.verticalAlign ?? 'top',\n textStyle: {\n width: realWidth,\n ...this._titleOption.textStyle\n },\n subtextStyle: {\n width: realWidth,\n ...this._titleOption.subtextStyle\n }\n } as TitleAttrs;\n }\n}\n"]}
|
package/es/core/BaseTable.d.ts
CHANGED
|
@@ -280,6 +280,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
280
280
|
getRecordStartRowByRecordIndex(index: number): number;
|
|
281
281
|
_getHeaderCellBySortState(sortState: SortState): CellAddress | undefined;
|
|
282
282
|
getCellRange(col: number, row: number): CellRange;
|
|
283
|
+
getCustomMerge(col: number, row: number): import("../ts-types").CustomMerge;
|
|
283
284
|
isCellRangeEqual(col: number, row: number, targetCol: number, targetRow: number): boolean;
|
|
284
285
|
_getLayoutCellId(col: number, row: number): LayoutObjectId;
|
|
285
286
|
getHeaderDescription(col: number, row: number): string | undefined;
|
package/es/core/BaseTable.js
CHANGED
|
@@ -72,7 +72,7 @@ export class BaseTable extends EventTarget {
|
|
|
72
72
|
}
|
|
73
73
|
constructor(container, options = {}) {
|
|
74
74
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
75
|
-
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.
|
|
75
|
+
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.14.0",
|
|
76
76
|
this.id = `VTable${Date.now()}`, this.isReleased = !1, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
77
77
|
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
78
78
|
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, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior} = options;
|
|
@@ -130,7 +130,9 @@ export class BaseTable extends EventTarget {
|
|
|
130
130
|
}, options.menu), Array.isArray(null === (_e = options.menu) || void 0 === _e ? void 0 : _e.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_f = options.menu) || void 0 === _f ? void 0 : _f.dropDownMenuHighlight),
|
|
131
131
|
Array.isArray(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
|
|
132
132
|
"html" === internalProps.menu.renderMode && (internalProps.menuHandler = new MenuHandler(this)),
|
|
133
|
-
this.headerStyleCache = new Map, this.bodyStyleCache = new Map
|
|
133
|
+
this.headerStyleCache = new Map, this.bodyStyleCache = new Map, internalProps.stick = {
|
|
134
|
+
changedCells: []
|
|
135
|
+
}, internalProps.customMergeCell = options.customMergeCell;
|
|
134
136
|
}
|
|
135
137
|
getContainer() {
|
|
136
138
|
return this.container;
|
|
@@ -1014,8 +1016,31 @@ export class BaseTable extends EventTarget {
|
|
|
1014
1016
|
}
|
|
1015
1017
|
}
|
|
1016
1018
|
getCellRange(col, row) {
|
|
1019
|
+
if (this.internalProps.customMergeCell) {
|
|
1020
|
+
const customMerge = this.internalProps.customMergeCell(col, row, this);
|
|
1021
|
+
if (customMerge && customMerge.range && customMerge.text) return customMerge.range;
|
|
1022
|
+
}
|
|
1017
1023
|
return this.internalProps.layoutMap.getCellRange(col, row);
|
|
1018
1024
|
}
|
|
1025
|
+
getCustomMerge(col, row) {
|
|
1026
|
+
if (this.internalProps.customMergeCell) {
|
|
1027
|
+
const customMerge = this.internalProps.customMergeCell(col, row, this);
|
|
1028
|
+
if (customMerge && customMerge.range && customMerge.text) {
|
|
1029
|
+
if (customMerge.style) {
|
|
1030
|
+
const styleClass = this.internalProps.bodyHelper.getStyleClass("text"), style = customMerge.style, fullStyle = columnStyleContents.of(style, this.theme.bodyStyle, {
|
|
1031
|
+
col: col,
|
|
1032
|
+
row: row,
|
|
1033
|
+
table: this,
|
|
1034
|
+
value: this.getCellValue(col, row),
|
|
1035
|
+
dataValue: this.getCellOriginValue(col, row),
|
|
1036
|
+
cellHeaderPaths: this.getCellHeaderPaths(col, row)
|
|
1037
|
+
}, styleClass, this.options.autoWrapText);
|
|
1038
|
+
customMerge.style = fullStyle;
|
|
1039
|
+
}
|
|
1040
|
+
return customMerge;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1019
1044
|
isCellRangeEqual(col, row, targetCol, targetRow) {
|
|
1020
1045
|
return this.internalProps.layoutMap.isCellRangeEqual(col, row, targetCol, targetRow);
|
|
1021
1046
|
}
|
|
@@ -1469,6 +1494,7 @@ export class BaseTable extends EventTarget {
|
|
|
1469
1494
|
}
|
|
1470
1495
|
getImageBuffer(type = "image/png") {
|
|
1471
1496
|
if ("node" !== this.options.mode) return;
|
|
1497
|
+
this.render();
|
|
1472
1498
|
const stage = this.scenegraph.stage;
|
|
1473
1499
|
if (stage) {
|
|
1474
1500
|
const contentWidth = this.tableX + this.getAllColsWidth(), contentHeight = this.tableY + this.getAllRowsHeight();
|