@visactor/vtable 0.23.2-alpha.0 → 0.23.3
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/ListTable.js +10 -6
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +4 -3
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +5 -3
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/body-helper.d.ts +1 -0
- package/cjs/body-helper/body-helper.js +4 -0
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/components/tooltip/TooltipHandler.d.ts +1 -0
- package/cjs/components/tooltip/TooltipHandler.js +36 -33
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +11 -2
- package/cjs/core/BaseTable.js +39 -15
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/event/event.d.ts +3 -2
- package/cjs/event/event.js +10 -8
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +3 -3
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js +9 -3
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.js +17 -17
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/listener/touch.js +20 -18
- package/cjs/event/listener/touch.js.map +1 -1
- package/cjs/header-helper/header-helper.d.ts +1 -0
- package/cjs/header-helper/header-helper.js +4 -0
- package/cjs/header-helper/header-helper.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.d.ts +2 -0
- package/cjs/layout/chart-helper/get-axis-config.js +9 -6
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +2 -2
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +1 -0
- package/cjs/layout/pivot-header-layout.js +3 -2
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +1 -0
- package/cjs/layout/simple-header-layout.js +1 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/plugins/custom-cell-style.d.ts +1 -0
- package/cjs/plugins/custom-cell-style.js +7 -0
- package/cjs/plugins/custom-cell-style.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +2 -2
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +6 -6
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +13 -5
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +3 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +10 -6
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +8 -5
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +12 -8
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +2 -2
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +59 -14
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +12 -12
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +5 -5
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +1 -1
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +5 -3
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/scenegraph/utils/text-measure.d.ts +1 -0
- package/cjs/scenegraph/utils/text-measure.js +11 -1
- package/cjs/scenegraph/utils/text-measure.js.map +1 -1
- package/cjs/state/state.js +21 -18
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/global.d.ts +2 -2
- package/cjs/tools/global.js +2 -2
- package/cjs/tools/global.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +6 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +10 -2
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +4 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1142 -1246
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +9 -6
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +4 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +5 -2
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/body-helper.d.ts +1 -0
- package/es/body-helper/body-helper.js +4 -0
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/components/tooltip/TooltipHandler.d.ts +1 -0
- package/es/components/tooltip/TooltipHandler.js +36 -33
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/core/BaseTable.d.ts +11 -2
- package/es/core/BaseTable.js +40 -16
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/event/event.d.ts +3 -2
- package/es/event/event.js +10 -8
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +3 -3
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.js +10 -2
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.js +17 -17
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/listener/touch.js +19 -15
- package/es/event/listener/touch.js.map +1 -1
- package/es/header-helper/header-helper.d.ts +1 -0
- package/es/header-helper/header-helper.js +4 -0
- package/es/header-helper/header-helper.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.d.ts +2 -0
- package/es/layout/chart-helper/get-axis-config.js +9 -6
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +4 -2
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +1 -0
- package/es/layout/pivot-header-layout.js +3 -2
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +1 -0
- package/es/layout/simple-header-layout.js +1 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/plugins/custom-cell-style.d.ts +1 -0
- package/es/plugins/custom-cell-style.js +7 -0
- package/es/plugins/custom-cell-style.js.map +1 -1
- package/es/scenegraph/component/table-component.js +2 -2
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +6 -6
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +13 -4
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +1 -1
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +4 -1
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +5 -3
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +8 -5
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +14 -9
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +2 -2
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +59 -15
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +12 -12
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +4 -6
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +1 -1
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js +6 -2
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/scenegraph/utils/text-measure.d.ts +1 -0
- package/es/scenegraph/utils/text-measure.js +9 -1
- package/es/scenegraph/utils/text-measure.js.map +1 -1
- package/es/state/state.js +21 -18
- package/es/state/state.js.map +1 -1
- package/es/tools/global.d.ts +2 -2
- package/es/tools/global.js +2 -2
- package/es/tools/global.js.map +1 -1
- package/es/ts-types/base-table.d.ts +6 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +10 -2
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +4 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/dist/vtable.js
CHANGED
|
@@ -1281,8 +1281,8 @@
|
|
|
1281
1281
|
};
|
|
1282
1282
|
var isBoolean$2 = isBoolean$1;
|
|
1283
1283
|
|
|
1284
|
-
const isFunction
|
|
1285
|
-
var isFunction$
|
|
1284
|
+
const isFunction = value => "function" == typeof value;
|
|
1285
|
+
var isFunction$1 = isFunction;
|
|
1286
1286
|
|
|
1287
1287
|
const isNil$2 = value => null == value;
|
|
1288
1288
|
var isNil$3 = isNil$2;
|
|
@@ -1311,20 +1311,20 @@
|
|
|
1311
1311
|
const isUndefined = value => void 0 === value;
|
|
1312
1312
|
var isUndefined$1 = isUndefined;
|
|
1313
1313
|
|
|
1314
|
-
const isString$
|
|
1314
|
+
const isString$1 = function (value) {
|
|
1315
1315
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1316
1316
|
const type = typeof value;
|
|
1317
1317
|
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
1318
1318
|
};
|
|
1319
|
-
var isString$
|
|
1319
|
+
var isString$2 = isString$1;
|
|
1320
1320
|
|
|
1321
1321
|
const isArray$2 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
1322
1322
|
var isArray$3 = isArray$2;
|
|
1323
1323
|
|
|
1324
|
-
const isArrayLike
|
|
1324
|
+
const isArrayLike = function (value) {
|
|
1325
1325
|
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
1326
1326
|
};
|
|
1327
|
-
var isArrayLike$
|
|
1327
|
+
var isArrayLike$1 = isArrayLike;
|
|
1328
1328
|
|
|
1329
1329
|
const isDate = value => isType$3(value, "Date");
|
|
1330
1330
|
var isDate$1 = isDate;
|
|
@@ -1358,7 +1358,7 @@
|
|
|
1358
1358
|
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1359
1359
|
function isEmpty(value) {
|
|
1360
1360
|
if (isNil$3(value)) return !0;
|
|
1361
|
-
if (isArrayLike$
|
|
1361
|
+
if (isArrayLike$1(value)) return !value.length;
|
|
1362
1362
|
const type = getType$1(value);
|
|
1363
1363
|
if ("Map" === type || "Set" === type) return !value.size;
|
|
1364
1364
|
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
@@ -1367,7 +1367,7 @@
|
|
|
1367
1367
|
}
|
|
1368
1368
|
|
|
1369
1369
|
const get$4 = (obj, path, defaultValue) => {
|
|
1370
|
-
const paths = isString$
|
|
1370
|
+
const paths = isString$2(path) ? path.split(".") : path;
|
|
1371
1371
|
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
1372
1372
|
return void 0 === obj ? defaultValue : obj;
|
|
1373
1373
|
};
|
|
@@ -1382,7 +1382,7 @@
|
|
|
1382
1382
|
if (!isValid$3(value) || "object" != typeof value) return value;
|
|
1383
1383
|
const isArr = isArray$3(value),
|
|
1384
1384
|
length = value.length;
|
|
1385
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$4(value) || isString$
|
|
1385
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$4(value) || isString$2(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
|
|
1386
1386
|
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
1387
1387
|
let index = -1;
|
|
1388
1388
|
if (result) for (; ++index < (props || value).length;) {
|
|
@@ -1419,7 +1419,7 @@
|
|
|
1419
1419
|
let newValue = source[key],
|
|
1420
1420
|
isCommon = !0;
|
|
1421
1421
|
if (isArray$3(srcValue)) {
|
|
1422
|
-
if (shallowArray) newValue = [];else if (isArray$3(objValue)) newValue = objValue;else if (isArrayLike$
|
|
1422
|
+
if (shallowArray) newValue = [];else if (isArray$3(objValue)) newValue = objValue;else if (isArrayLike$1(objValue)) {
|
|
1423
1423
|
newValue = new Array(objValue.length);
|
|
1424
1424
|
let index = -1;
|
|
1425
1425
|
const length = objValue.length;
|
|
@@ -1450,7 +1450,7 @@
|
|
|
1450
1450
|
const v = obj[k];
|
|
1451
1451
|
let match = !1;
|
|
1452
1452
|
keys.forEach(itKey => {
|
|
1453
|
-
(isString$
|
|
1453
|
+
(isString$2(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
1454
1454
|
}), match || (result[k] = v);
|
|
1455
1455
|
}), result;
|
|
1456
1456
|
}
|
|
@@ -1467,7 +1467,7 @@
|
|
|
1467
1467
|
if (null == a || null == b) return !1;
|
|
1468
1468
|
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
1469
1469
|
if (objToString(a) !== objToString(b)) return !1;
|
|
1470
|
-
if (isFunction$
|
|
1470
|
+
if (isFunction$1(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
1471
1471
|
if ("object" != typeof a) return !1;
|
|
1472
1472
|
if (isArray$3(a)) {
|
|
1473
1473
|
if (a.length !== b.length) return !1;
|
|
@@ -1516,12 +1516,12 @@
|
|
|
1516
1516
|
function array$1(arr) {
|
|
1517
1517
|
return isValid$3(arr) ? isArray$3(arr) ? arr : [arr] : [];
|
|
1518
1518
|
}
|
|
1519
|
-
function last
|
|
1520
|
-
if (isArrayLike$
|
|
1519
|
+
function last(val) {
|
|
1520
|
+
if (isArrayLike$1(val)) {
|
|
1521
1521
|
return val[val.length - 1];
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
1524
|
-
const maxInArray
|
|
1524
|
+
const maxInArray = (arr, compareFn) => {
|
|
1525
1525
|
var _a;
|
|
1526
1526
|
if (0 === arr.length) return;
|
|
1527
1527
|
let max = arr[0];
|
|
@@ -1531,7 +1531,7 @@
|
|
|
1531
1531
|
}
|
|
1532
1532
|
return max;
|
|
1533
1533
|
};
|
|
1534
|
-
const minInArray
|
|
1534
|
+
const minInArray = (arr, compareFn) => {
|
|
1535
1535
|
var _a;
|
|
1536
1536
|
if (0 === arr.length) return;
|
|
1537
1537
|
let min = arr[0];
|
|
@@ -1794,7 +1794,7 @@
|
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
|
|
1797
|
-
function transformBoundsWithMatrix
|
|
1797
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
1798
1798
|
const {
|
|
1799
1799
|
x1: x1,
|
|
1800
1800
|
y1: y1,
|
|
@@ -1803,7 +1803,7 @@
|
|
|
1803
1803
|
} = bounds;
|
|
1804
1804
|
return matrix.onlyTranslate() ? (out !== bounds && out.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), out.translate(matrix.e, matrix.f), bounds) : (out.clear(), out.add(matrix.a * x1 + matrix.c * y1 + matrix.e, matrix.b * x1 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y1 + matrix.e, matrix.b * x2 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y2 + matrix.e, matrix.b * x2 + matrix.d * y2 + matrix.f), out.add(matrix.a * x1 + matrix.c * y2 + matrix.e, matrix.b * x1 + matrix.d * y2 + matrix.f), bounds);
|
|
1805
1805
|
}
|
|
1806
|
-
|
|
1806
|
+
class Bounds {
|
|
1807
1807
|
constructor(bounds) {
|
|
1808
1808
|
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
1809
1809
|
}
|
|
@@ -1903,7 +1903,7 @@
|
|
|
1903
1903
|
return this.y1 *= s, this.y2 *= s, this;
|
|
1904
1904
|
}
|
|
1905
1905
|
transformWithMatrix(matrix) {
|
|
1906
|
-
return transformBoundsWithMatrix
|
|
1906
|
+
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
1907
1907
|
}
|
|
1908
1908
|
copy(b) {
|
|
1909
1909
|
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
@@ -1930,21 +1930,27 @@
|
|
|
1930
1930
|
} = this;
|
|
1931
1931
|
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
1932
1932
|
}
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1933
|
+
}
|
|
1934
|
+
class AABBBounds extends Bounds {}
|
|
1935
1935
|
|
|
1936
|
-
function degreeToRadian
|
|
1936
|
+
function degreeToRadian(degree) {
|
|
1937
1937
|
return degree * (Math.PI / 180);
|
|
1938
1938
|
}
|
|
1939
1939
|
function radianToDegree(radian) {
|
|
1940
1940
|
return 180 * radian / Math.PI;
|
|
1941
1941
|
}
|
|
1942
|
-
const clampRadian = function () {
|
|
1942
|
+
const clampRadian$1 = function () {
|
|
1943
1943
|
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1944
1944
|
if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
1945
1945
|
return angle;
|
|
1946
1946
|
};
|
|
1947
|
-
const clampAngleByRadian = clampRadian;
|
|
1947
|
+
const clampAngleByRadian = clampRadian$1;
|
|
1948
|
+
function polarToCartesian(center, radius, angleInRadian) {
|
|
1949
|
+
return {
|
|
1950
|
+
x: center.x + radius * Math.cos(angleInRadian),
|
|
1951
|
+
y: center.y + radius * Math.sin(angleInRadian)
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1948
1954
|
|
|
1949
1955
|
class Matrix {
|
|
1950
1956
|
constructor() {
|
|
@@ -2689,14 +2695,14 @@
|
|
|
2689
2695
|
return isCover((box1.x2 - box1.x1) / 2, deg11, A1B1, B1C1) && isCover((box1.y2 - box1.y1) / 2, deg12, A1B1, B1C1) && isCover((box2.x2 - box2.x1) / 2, deg21, AB, BC) && isCover((box2.y2 - box2.y1) / 2, deg22, AB, BC);
|
|
2690
2696
|
}
|
|
2691
2697
|
|
|
2692
|
-
const eastAsianCharacterInfo
|
|
2698
|
+
const eastAsianCharacterInfo = character => {
|
|
2693
2699
|
let x = character.charCodeAt(0),
|
|
2694
2700
|
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
2695
2701
|
codePoint = x;
|
|
2696
2702
|
return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
2697
2703
|
};
|
|
2698
2704
|
|
|
2699
|
-
function getContextFont$
|
|
2705
|
+
function getContextFont$1(text) {
|
|
2700
2706
|
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2701
2707
|
const {
|
|
2702
2708
|
fontStyle = defaultAttr.fontStyle,
|
|
@@ -2708,7 +2714,7 @@
|
|
|
2708
2714
|
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize + "px " + (fontFamily || "sans-serif");
|
|
2709
2715
|
}
|
|
2710
2716
|
|
|
2711
|
-
|
|
2717
|
+
class TextMeasure {
|
|
2712
2718
|
constructor(option, textSpec) {
|
|
2713
2719
|
this._numberCharSize = null, this._fullCharSize = null, this._letterCharSize = null, this._specialCharSizeMap = {}, this._canvas = null, this._context = null, this._contextSaved = !1, this._notSupportCanvas = !1, this._notSupportVRender = !1, this._userSpec = {}, this.specialCharSet = "-/: .,@%'\"~", this._option = option, this._userSpec = null != textSpec ? textSpec : {}, this.textSpec = this._initSpec(), isValid$3(option.specialCharSet) && (this.specialCharSet = option.specialCharSet), this._standardMethod = isValid$3(option.getTextBounds) ? this.fullMeasure.bind(this) : this.measureWithNaiveCanvas.bind(this);
|
|
2714
2720
|
}
|
|
@@ -2716,7 +2722,7 @@
|
|
|
2716
2722
|
if (this._notSupportCanvas) return !1;
|
|
2717
2723
|
if (isNil$3(this._canvas) && (isValid$3(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$3(this._canvas) && "undefined" != typeof window && void 0 !== window.document && globalThis && isValid$3(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$3(this._context) && isValid$3(this._canvas)) {
|
|
2718
2724
|
const context = this._canvas.getContext("2d");
|
|
2719
|
-
isValid$3(context) && (context.save(), context.font = getContextFont$
|
|
2725
|
+
isValid$3(context) && (context.save(), context.font = getContextFont$1(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
2720
2726
|
}
|
|
2721
2727
|
return !isNil$3(this._context) || (this._notSupportCanvas = !0, !1);
|
|
2722
2728
|
}
|
|
@@ -2741,7 +2747,7 @@
|
|
|
2741
2747
|
let {
|
|
2742
2748
|
lineHeight = fontSize
|
|
2743
2749
|
} = this._userSpec;
|
|
2744
|
-
if (isString$
|
|
2750
|
+
if (isString$2(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
2745
2751
|
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
2746
2752
|
lineHeight = fontSize * scale;
|
|
2747
2753
|
}
|
|
@@ -2836,7 +2842,7 @@
|
|
|
2836
2842
|
for (let i = 0; i < text.length; i++) {
|
|
2837
2843
|
const char = text[i];
|
|
2838
2844
|
let size = this._measureSpecialChar(char);
|
|
2839
|
-
isNil$3(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$3(size) && ["F", "W"].includes(eastAsianCharacterInfo
|
|
2845
|
+
isNil$3(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$3(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$3(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
2840
2846
|
}
|
|
2841
2847
|
return totalSize;
|
|
2842
2848
|
}
|
|
@@ -2855,7 +2861,7 @@
|
|
|
2855
2861
|
} = this.textSpec;
|
|
2856
2862
|
for (let i = 0; i < text.length; i++) {
|
|
2857
2863
|
const char = text[i],
|
|
2858
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo
|
|
2864
|
+
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
2859
2865
|
totalSize.width += size * fontSize;
|
|
2860
2866
|
}
|
|
2861
2867
|
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
@@ -2909,8 +2915,8 @@
|
|
|
2909
2915
|
release() {
|
|
2910
2916
|
isValid$3(this._canvas) && (this._canvas = null), isValid$3(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
2911
2917
|
}
|
|
2912
|
-
}
|
|
2913
|
-
TextMeasure
|
|
2918
|
+
}
|
|
2919
|
+
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
2914
2920
|
|
|
2915
2921
|
const hasConsole = "undefined" != typeof console;
|
|
2916
2922
|
function log(method, level, input) {
|
|
@@ -3079,7 +3085,7 @@
|
|
|
3079
3085
|
|
|
3080
3086
|
class CurvePath {
|
|
3081
3087
|
constructor() {
|
|
3082
|
-
this.curves = [], this.bounds = new AABBBounds
|
|
3088
|
+
this.curves = [], this.bounds = new AABBBounds();
|
|
3083
3089
|
}
|
|
3084
3090
|
getCurveLengths() {
|
|
3085
3091
|
return this.curves.map(curve => curve.getLength());
|
|
@@ -3189,7 +3195,7 @@
|
|
|
3189
3195
|
}(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
|
|
3190
3196
|
|
|
3191
3197
|
function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
|
|
3192
|
-
const th = degreeToRadian
|
|
3198
|
+
const th = degreeToRadian(rotateX),
|
|
3193
3199
|
sin_th = Math.sin(th),
|
|
3194
3200
|
cos_th = Math.cos(th),
|
|
3195
3201
|
px = cos_th * (ox - x) * .5 + sin_th * (oy - y) * .5,
|
|
@@ -3918,7 +3924,7 @@
|
|
|
3918
3924
|
controlX = 0,
|
|
3919
3925
|
controlY = 0;
|
|
3920
3926
|
for (let i = 0, len = commandStrList.length; i < len; ++i) {
|
|
3921
|
-
switch (current = commandStrList[i], 1 === sX && 1 === sY || (current = scale$
|
|
3927
|
+
switch (current = commandStrList[i], 1 === sX && 1 === sY || (current = scale$3(current, sX, sY)), current[0]) {
|
|
3922
3928
|
case "l":
|
|
3923
3929
|
x += current[1], y += current[2], this.lineTo(x + l, y + t);
|
|
3924
3930
|
break;
|
|
@@ -4062,7 +4068,7 @@
|
|
|
4062
4068
|
}
|
|
4063
4069
|
}
|
|
4064
4070
|
const temp = ["l", 0, 0, 0, 0, 0, 0, 0];
|
|
4065
|
-
function scale$
|
|
4071
|
+
function scale$3(current, sX, sY) {
|
|
4066
4072
|
const c = temp[0] = current[0];
|
|
4067
4073
|
if ("a" === c || "A" === c) temp[1] = sX * current[1], temp[2] = sY * current[2], temp[3] = current[3], temp[4] = current[4], temp[5] = current[5], temp[6] = sX * current[6], temp[7] = sY * current[7];else if ("h" === c || "H" === c) temp[1] = sX * current[1];else if ("v" === c || "V" === c) temp[1] = sY * current[1];else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
|
|
4068
4074
|
return temp;
|
|
@@ -4947,14 +4953,14 @@
|
|
|
4947
4953
|
return this.global.measureTextMethod = m, data;
|
|
4948
4954
|
}
|
|
4949
4955
|
createTextMeasureInstance(textSpec, option, getCanvasForMeasure) {
|
|
4950
|
-
return this.configure(this.global, this.global.env), new TextMeasure
|
|
4956
|
+
return this.configure(this.global, this.global.env), new TextMeasure(Object.assign({
|
|
4951
4957
|
defaultFontParams: {
|
|
4952
4958
|
fontFamily: DefaultTextStyle.fontFamily,
|
|
4953
4959
|
fontSize: DefaultTextStyle.fontSize
|
|
4954
4960
|
},
|
|
4955
4961
|
getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),
|
|
4956
4962
|
getTextBounds: void 0,
|
|
4957
|
-
specialCharSet: "-/: .,@%'\"~" + TextMeasure
|
|
4963
|
+
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
4958
4964
|
}, null != option ? option : {}), textSpec);
|
|
4959
4965
|
}
|
|
4960
4966
|
drawGraphicToCanvas(graphic, stage, canvas) {
|
|
@@ -5464,16 +5470,16 @@
|
|
|
5464
5470
|
addEventListener(type, listener, options) {
|
|
5465
5471
|
const capture = isBoolean$2(options, !0) && options || isObject$4(options) && options.capture,
|
|
5466
5472
|
once = isObject$4(options) && options.once,
|
|
5467
|
-
context = isFunction$
|
|
5468
|
-
return type = capture ? `${type}capture` : type, listener = isFunction$
|
|
5473
|
+
context = isFunction$1(listener) ? void 0 : listener;
|
|
5474
|
+
return type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent, once ? super.once(type, listener, context) : super.on(type, listener, context), this;
|
|
5469
5475
|
}
|
|
5470
5476
|
on(type, listener, options) {
|
|
5471
5477
|
return this.addEventListener(type, listener, options);
|
|
5472
5478
|
}
|
|
5473
5479
|
removeEventListener(type, listener, options) {
|
|
5474
5480
|
const capture = isBoolean$2(options, !0) && options || isObject$4(options) && options.capture,
|
|
5475
|
-
context = isFunction$
|
|
5476
|
-
type = capture ? `${type}capture` : type, listener = isFunction$
|
|
5481
|
+
context = isFunction$1(listener) ? void 0 : listener;
|
|
5482
|
+
type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent;
|
|
5477
5483
|
const once = isObject$4(options) && options.once;
|
|
5478
5484
|
return super.off(type, listener, context, once), this;
|
|
5479
5485
|
}
|
|
@@ -5997,7 +6003,7 @@
|
|
|
5997
6003
|
if (this.currentCursor === mode) return;
|
|
5998
6004
|
this.currentCursor = mode;
|
|
5999
6005
|
const style = this.cursorStyles[mode];
|
|
6000
|
-
style ? "string" == typeof style && applyStyles ? domElement.style.cursor = style : "function" == typeof style ? style(mode) : "object" == typeof style && applyStyles && Object.assign(domElement.style, style) : applyStyles && isString$
|
|
6006
|
+
style ? "string" == typeof style && applyStyles ? domElement.style.cursor = style : "function" == typeof style ? style(mode) : "object" == typeof style && applyStyles && Object.assign(domElement.style, style) : applyStyles && isString$2(mode) && !has$1(this.cursorStyles, mode) && (domElement.style.cursor = mode);
|
|
6001
6007
|
}
|
|
6002
6008
|
setTargetElement(element) {
|
|
6003
6009
|
this.removeEvents(), this.domElement = element, this.addEvents();
|
|
@@ -6902,7 +6908,7 @@
|
|
|
6902
6908
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
6903
6909
|
const rafBasedSto = new RafBasedSTO();
|
|
6904
6910
|
const calculateLineHeight = (lineHeight, fontSize) => {
|
|
6905
|
-
if (isString$
|
|
6911
|
+
if (isString$2(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
6906
6912
|
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
6907
6913
|
}
|
|
6908
6914
|
return lineHeight;
|
|
@@ -7140,7 +7146,7 @@
|
|
|
7140
7146
|
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
7141
7147
|
|
|
7142
7148
|
const tempMatrix = new Matrix(),
|
|
7143
|
-
tempBounds$1 = new AABBBounds
|
|
7149
|
+
tempBounds$1 = new AABBBounds();
|
|
7144
7150
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
7145
7151
|
const tempConstantXYKey = ["x", "y"],
|
|
7146
7152
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -7202,7 +7208,7 @@
|
|
|
7202
7208
|
constructor() {
|
|
7203
7209
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7204
7210
|
var _a;
|
|
7205
|
-
super(), this._AABBBounds = new AABBBounds
|
|
7211
|
+
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0);
|
|
7206
7212
|
}
|
|
7207
7213
|
setMode(mode) {
|
|
7208
7214
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -7744,7 +7750,7 @@
|
|
|
7744
7750
|
};
|
|
7745
7751
|
}
|
|
7746
7752
|
createPathProxy(path) {
|
|
7747
|
-
return isString$
|
|
7753
|
+
return isString$2(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
7748
7754
|
}
|
|
7749
7755
|
loadImage(image) {
|
|
7750
7756
|
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
@@ -8822,7 +8828,7 @@
|
|
|
8822
8828
|
return new Circle$1(attributes);
|
|
8823
8829
|
}
|
|
8824
8830
|
|
|
8825
|
-
function getContextFont
|
|
8831
|
+
function getContextFont(text) {
|
|
8826
8832
|
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8827
8833
|
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
8828
8834
|
fontSizeScale || (fontSizeScale = 1);
|
|
@@ -8937,7 +8943,7 @@
|
|
|
8937
8943
|
let Text$1 = class Text extends Graphic {
|
|
8938
8944
|
get font() {
|
|
8939
8945
|
const textTheme = getTheme(this).text;
|
|
8940
|
-
return this._font || (this._font = getContextFont
|
|
8946
|
+
return this._font || (this._font = getContextFont(this.attribute, textTheme)), this._font;
|
|
8941
8947
|
}
|
|
8942
8948
|
get clipedText() {
|
|
8943
8949
|
var _a;
|
|
@@ -9980,7 +9986,7 @@
|
|
|
9980
9986
|
}
|
|
9981
9987
|
var rect = new RectSymbol();
|
|
9982
9988
|
|
|
9983
|
-
const tempBounds = new AABBBounds
|
|
9989
|
+
const tempBounds = new AABBBounds();
|
|
9984
9990
|
class CustomSymbolClass {
|
|
9985
9991
|
constructor(type, path) {
|
|
9986
9992
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
@@ -10022,7 +10028,7 @@
|
|
|
10022
10028
|
roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
|
|
10023
10029
|
};
|
|
10024
10030
|
|
|
10025
|
-
const _tempBounds$1 = new AABBBounds
|
|
10031
|
+
const _tempBounds$1 = new AABBBounds(),
|
|
10026
10032
|
SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
10027
10033
|
let Symbol$1 = class Symbol extends Graphic {
|
|
10028
10034
|
constructor() {
|
|
@@ -11146,7 +11152,7 @@
|
|
|
11146
11152
|
}
|
|
11147
11153
|
doUpdatePathShape() {
|
|
11148
11154
|
const attribute = this.attribute;
|
|
11149
|
-
isString$
|
|
11155
|
+
isString$2(attribute.path, !0) ? this.cache = new CustomPath2D().fromString(attribute.path) : attribute.customPath && (this.cache = new CustomPath2D(), attribute.customPath(this.cache, this));
|
|
11150
11156
|
}
|
|
11151
11157
|
tryUpdateOBBBounds() {
|
|
11152
11158
|
throw new Error("暂不支持");
|
|
@@ -11810,7 +11816,7 @@
|
|
|
11810
11816
|
function mat3Tomat4(out, b) {
|
|
11811
11817
|
out[0] = b.a, out[1] = b.b, out[2] = 0, out[3] = 0, out[4] = b.c, out[5] = b.d, out[6] = 0, out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = b.e, out[13] = b.f, out[14] = 0, out[15] = 1;
|
|
11812
11818
|
}
|
|
11813
|
-
function scale$
|
|
11819
|
+
function scale$2(out, a, v) {
|
|
11814
11820
|
const x = v[0],
|
|
11815
11821
|
y = v[1],
|
|
11816
11822
|
z = v[2];
|
|
@@ -11871,7 +11877,7 @@
|
|
|
11871
11877
|
} else _anchor[1] = anchor3d[1];
|
|
11872
11878
|
_anchor[2] = null !== (_a = anchor3d[2]) && void 0 !== _a ? _a : 0;
|
|
11873
11879
|
}
|
|
11874
|
-
if (identity$2(out), translate(out, out, [x + dx, y + dy, z + dz]), translate(out, out, [_anchor[0], _anchor[1], _anchor[2]]), rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [-_anchor[0], -_anchor[1], _anchor[2]]), scale$
|
|
11880
|
+
if (identity$2(out), translate(out, out, [x + dx, y + dy, z + dz]), translate(out, out, [_anchor[0], _anchor[1], _anchor[2]]), rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [-_anchor[0], -_anchor[1], _anchor[2]]), scale$2(out, out, [scaleX, scaleY, scaleZ]), angle) {
|
|
11875
11881
|
const m = mat4Allocate.allocate(),
|
|
11876
11882
|
_anchor = [0, 0];
|
|
11877
11883
|
if (anchor) {
|
|
@@ -11907,7 +11913,7 @@
|
|
|
11907
11913
|
onClearIncremental: new SyncHook(["graphic", "group", "stage"]),
|
|
11908
11914
|
beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
|
|
11909
11915
|
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"])
|
|
11910
|
-
}, this.tempAABBBounds1 = new AABBBounds
|
|
11916
|
+
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds(), this._rectBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._symbolBoundsContribitions = [new DefaultSymbolOuterBorderBoundsContribution()], this._circleBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._arcBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._pathBoundsContribitions = [new DefaultOuterBorderBoundsContribution()];
|
|
11911
11917
|
}
|
|
11912
11918
|
onAttributeUpdate(graphic) {
|
|
11913
11919
|
this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
|
|
@@ -12049,7 +12055,7 @@
|
|
|
12049
12055
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
12050
12056
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
12051
12057
|
}
|
|
12052
|
-
return this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix
|
|
12058
|
+
return this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
|
|
12053
12059
|
}
|
|
12054
12060
|
updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
|
|
12055
12061
|
if (!this._validCheck(attribute, pathTheme, aabbBounds, graphic)) return aabbBounds;
|
|
@@ -12327,7 +12333,7 @@
|
|
|
12327
12333
|
if (this.combindShadowAABBBounds(aabbBounds, graphic), aabbBounds.empty()) return;
|
|
12328
12334
|
let updateMatrix = !0;
|
|
12329
12335
|
const m = graphic.transMatrix;
|
|
12330
|
-
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix
|
|
12336
|
+
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);
|
|
12331
12337
|
}
|
|
12332
12338
|
_validCheck(attribute, theme, aabbBounds, graphic) {
|
|
12333
12339
|
if (!graphic) return !0;
|
|
@@ -14529,15 +14535,15 @@
|
|
|
14529
14535
|
class DefaultBoundsAllocate {
|
|
14530
14536
|
constructor() {
|
|
14531
14537
|
this.pools = [];
|
|
14532
|
-
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds
|
|
14538
|
+
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds());
|
|
14533
14539
|
}
|
|
14534
14540
|
allocate(x1, y1, x2, y2) {
|
|
14535
|
-
if (!this.pools.length) return new AABBBounds
|
|
14541
|
+
if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
|
|
14536
14542
|
const b = this.pools.pop();
|
|
14537
14543
|
return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
|
|
14538
14544
|
}
|
|
14539
14545
|
allocateByObj(b) {
|
|
14540
|
-
if (!this.pools.length) return new AABBBounds
|
|
14546
|
+
if (!this.pools.length) return new AABBBounds(b);
|
|
14541
14547
|
const _b = this.pools.pop();
|
|
14542
14548
|
return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
|
|
14543
14549
|
}
|
|
@@ -14973,7 +14979,7 @@
|
|
|
14973
14979
|
} = image.attribute;
|
|
14974
14980
|
if (!url || !image.resources) return;
|
|
14975
14981
|
const res = image.resources.get(url);
|
|
14976
|
-
if ("loading" === res.state && isString$
|
|
14982
|
+
if ("loading" === res.state && isString$2(url)) return void ResourceLoader.improveImageLoading(url);
|
|
14977
14983
|
if ("success" !== res.state) return;
|
|
14978
14984
|
const {
|
|
14979
14985
|
context: context
|
|
@@ -15016,7 +15022,7 @@
|
|
|
15016
15022
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
15017
15023
|
};
|
|
15018
15024
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
15019
|
-
const tempDirtyBounds = new AABBBounds
|
|
15025
|
+
const tempDirtyBounds = new AABBBounds();
|
|
15020
15026
|
class ShadowRootDrawItemInterceptorContribution {
|
|
15021
15027
|
constructor() {
|
|
15022
15028
|
this.order = 1;
|
|
@@ -15766,7 +15772,7 @@
|
|
|
15766
15772
|
};
|
|
15767
15773
|
let DefaultDrawContribution = class {
|
|
15768
15774
|
constructor(contributions, drawItemInterceptorContributions) {
|
|
15769
|
-
this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds
|
|
15775
|
+
this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, this.init();
|
|
15770
15776
|
}
|
|
15771
15777
|
init() {
|
|
15772
15778
|
this.contributions.forEach(item => {
|
|
@@ -16507,7 +16513,7 @@
|
|
|
16507
16513
|
}
|
|
16508
16514
|
}
|
|
16509
16515
|
|
|
16510
|
-
const globalBounds = new AABBBounds
|
|
16516
|
+
const globalBounds = new AABBBounds();
|
|
16511
16517
|
class DirtyBoundsPlugin {
|
|
16512
16518
|
constructor() {
|
|
16513
16519
|
this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
|
|
@@ -16529,10 +16535,10 @@
|
|
|
16529
16535
|
}
|
|
16530
16536
|
}
|
|
16531
16537
|
|
|
16532
|
-
const _tempBounds = new AABBBounds
|
|
16538
|
+
const _tempBounds = new AABBBounds();
|
|
16533
16539
|
class FlexLayoutPlugin {
|
|
16534
16540
|
constructor() {
|
|
16535
|
-
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds
|
|
16541
|
+
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
16536
16542
|
}
|
|
16537
16543
|
pauseLayout(p) {
|
|
16538
16544
|
this.pause = p;
|
|
@@ -16809,7 +16815,7 @@
|
|
|
16809
16815
|
const lightDir = this.formatedDir,
|
|
16810
16816
|
brightness = min(max((normal[0] * lightDir[0] + normal[1] * lightDir[1] + normal[2] * lightDir[2]) * (1 - this.ambient / 2), 0) + this.ambient, 1);
|
|
16811
16817
|
let colorArray;
|
|
16812
|
-
colorArray = isString$
|
|
16818
|
+
colorArray = isString$2(color) ? ColorStore.Get(color, ColorType.Color1) : color;
|
|
16813
16819
|
const lightColorArray = this.colorRgb;
|
|
16814
16820
|
return `rgb(${lightColorArray[0] * colorArray[0] * brightness}, ${lightColorArray[1] * colorArray[1] * brightness}, ${lightColorArray[2] * colorArray[2] * brightness})`;
|
|
16815
16821
|
}
|
|
@@ -17039,9 +17045,9 @@
|
|
|
17039
17045
|
canvasControled: !1 !== params.canvasControled,
|
|
17040
17046
|
title: params.title || "",
|
|
17041
17047
|
canvas: params.canvas
|
|
17042
|
-
}), this._viewBox = new AABBBounds
|
|
17048
|
+
}), this._viewBox = new AABBBounds(), params.viewBox ? this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : this._viewBox.setValue(0, 0, this.width, this.height), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
|
|
17043
17049
|
main: !0
|
|
17044
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$
|
|
17050
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$2(this._background) && this._background.includes("/") && this.setAttributes({
|
|
17045
17051
|
background: this._background
|
|
17046
17052
|
});
|
|
17047
17053
|
}
|
|
@@ -17185,7 +17191,7 @@
|
|
|
17185
17191
|
}
|
|
17186
17192
|
enableDirtyBounds() {
|
|
17187
17193
|
if (this.dirtyBounds) return;
|
|
17188
|
-
this.dirtyBounds = new Bounds
|
|
17194
|
+
this.dirtyBounds = new Bounds();
|
|
17189
17195
|
let plugin = this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];
|
|
17190
17196
|
plugin ? plugin.activate(this.pluginService) : (plugin = new DirtyBoundsPlugin(), this.pluginService.register(plugin));
|
|
17191
17197
|
}
|
|
@@ -17524,7 +17530,7 @@
|
|
|
17524
17530
|
service.env === this.type && service.setActiveEnvContribution(this);
|
|
17525
17531
|
}
|
|
17526
17532
|
getNativeAABBBounds(dom) {
|
|
17527
|
-
return new AABBBounds
|
|
17533
|
+
return new AABBBounds();
|
|
17528
17534
|
}
|
|
17529
17535
|
removeDom(dom) {
|
|
17530
17536
|
return !1;
|
|
@@ -18469,7 +18475,7 @@
|
|
|
18469
18475
|
} = _a,
|
|
18470
18476
|
props = __rest$4(_a, ["key", "name", "id", "attribute", "stateProxy"]);
|
|
18471
18477
|
let c = type;
|
|
18472
|
-
isString$
|
|
18478
|
+
isString$2(type) && (c = graphicCreator$1[type]);
|
|
18473
18479
|
const childrenList = [];
|
|
18474
18480
|
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
18475
18481
|
children[_key - 2] = arguments[_key];
|
|
@@ -19200,7 +19206,7 @@
|
|
|
19200
19206
|
const {
|
|
19201
19207
|
scaleIn3d = defaultParams.scaleIn3d
|
|
19202
19208
|
} = params;
|
|
19203
|
-
params.font ? _context.font = params.font : _context.font = getContextFont
|
|
19209
|
+
params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, scaleIn3d && this.camera && this.camera.getProjectionScale(z));
|
|
19204
19210
|
const {
|
|
19205
19211
|
fontFamily = defaultParams.fontFamily,
|
|
19206
19212
|
fontSize = defaultParams.fontSize
|
|
@@ -19210,7 +19216,7 @@
|
|
|
19210
19216
|
setTextStyle(params, defaultParams, z) {
|
|
19211
19217
|
var _a, _b;
|
|
19212
19218
|
const _context = this.nativeContext;
|
|
19213
|
-
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont
|
|
19219
|
+
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, this.camera && this.camera.getProjectionScale(z));
|
|
19214
19220
|
const {
|
|
19215
19221
|
fontFamily = defaultParams.fontFamily,
|
|
19216
19222
|
fontSize = defaultParams.fontSize
|
|
@@ -19688,7 +19694,7 @@
|
|
|
19688
19694
|
const b = dom.getBoundingClientRect();
|
|
19689
19695
|
return new DynamicB(b);
|
|
19690
19696
|
}
|
|
19691
|
-
return new AABBBounds
|
|
19697
|
+
return new AABBBounds();
|
|
19692
19698
|
}
|
|
19693
19699
|
removeDom(dom) {
|
|
19694
19700
|
return dom.parentElement.removeChild(dom), !0;
|
|
@@ -19702,10 +19708,10 @@
|
|
|
19702
19708
|
parent: parent
|
|
19703
19709
|
} = params,
|
|
19704
19710
|
element = document.createElement(tagName);
|
|
19705
|
-
if (style && (isString$
|
|
19711
|
+
if (style && (isString$2(style) ? element.setAttribute("style", style) : Object.keys(style).forEach(k => {
|
|
19706
19712
|
element.setAttribute(k, style[k]);
|
|
19707
19713
|
})), null != width && (element.style.width = `${width}px`), null != height && (element.style.height = `${height}px`), parent) {
|
|
19708
|
-
const pd = isString$
|
|
19714
|
+
const pd = isString$2(parent) ? this.getElementById(parent) : parent;
|
|
19709
19715
|
pd && pd.appendChild && pd.appendChild(element);
|
|
19710
19716
|
}
|
|
19711
19717
|
return element;
|
|
@@ -19846,7 +19852,7 @@
|
|
|
19846
19852
|
this._context = new NodeContext2d(this, this._dpr), this.nativeCanvas.width = this._pixelWidth, this.nativeCanvas.height = this._pixelHeight;
|
|
19847
19853
|
}
|
|
19848
19854
|
release() {
|
|
19849
|
-
this._nativeCanvas.release && isFunction$
|
|
19855
|
+
this._nativeCanvas.release && isFunction$1(this._nativeCanvas.release) && this._nativeCanvas.release();
|
|
19850
19856
|
}
|
|
19851
19857
|
};
|
|
19852
19858
|
NodeCanvas.env = "node", NodeCanvas = __decorate$w([injectable(), __metadata$o("design:paramtypes", [Object])], NodeCanvas);
|
|
@@ -20175,7 +20181,7 @@
|
|
|
20175
20181
|
decorator(target, key, paramIndex);
|
|
20176
20182
|
};
|
|
20177
20183
|
};
|
|
20178
|
-
const _bounds$1 = new AABBBounds
|
|
20184
|
+
const _bounds$1 = new AABBBounds();
|
|
20179
20185
|
let DefaultCanvasRectPicker = class {
|
|
20180
20186
|
constructor(canvasRenderer) {
|
|
20181
20187
|
this.canvasRenderer = canvasRenderer, this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
@@ -20243,7 +20249,7 @@
|
|
|
20243
20249
|
decorator(target, key, paramIndex);
|
|
20244
20250
|
};
|
|
20245
20251
|
};
|
|
20246
|
-
const _bounds = new AABBBounds
|
|
20252
|
+
const _bounds = new AABBBounds();
|
|
20247
20253
|
let DefaultMathRectPicker = class {
|
|
20248
20254
|
constructor(canvasRenderer) {
|
|
20249
20255
|
this.canvasRenderer = canvasRenderer, this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
@@ -21221,7 +21227,7 @@
|
|
|
21221
21227
|
decorator(target, key, paramIndex);
|
|
21222
21228
|
};
|
|
21223
21229
|
};
|
|
21224
|
-
new AABBBounds
|
|
21230
|
+
new AABBBounds();
|
|
21225
21231
|
let DefaultCanvasRect3dPicker = class extends BasePicker {
|
|
21226
21232
|
constructor(canvasRenderer) {
|
|
21227
21233
|
super(), this.canvasRenderer = canvasRenderer, this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
|
|
@@ -22662,7 +22668,7 @@
|
|
|
22662
22668
|
};
|
|
22663
22669
|
const isIt$1 = (v, type) => judgeType$1(v) === type;
|
|
22664
22670
|
const isObject$2 = (v) => isIt$1(v, 'object');
|
|
22665
|
-
const isString
|
|
22671
|
+
const isString = (v) => isIt$1(v, 'string');
|
|
22666
22672
|
const isNumber$2 = (v) => isIt$1(v, 'number');
|
|
22667
22673
|
const isBoolean = (v) => isIt$1(v, 'boolean');
|
|
22668
22674
|
function ingoreNoneValueMerge(target, ...sources) {
|
|
@@ -22773,7 +22779,7 @@
|
|
|
22773
22779
|
].join('');
|
|
22774
22780
|
}
|
|
22775
22781
|
function validToString(v) {
|
|
22776
|
-
if (isString
|
|
22782
|
+
if (isString(v) || isNumber$2(v) || isBoolean(v)) {
|
|
22777
22783
|
return v.toString();
|
|
22778
22784
|
}
|
|
22779
22785
|
return '';
|
|
@@ -23593,7 +23599,7 @@
|
|
|
23593
23599
|
let Rect$1 = class Rect {
|
|
23594
23600
|
bounds;
|
|
23595
23601
|
constructor(left, top, width, height) {
|
|
23596
|
-
this.bounds = new Bounds
|
|
23602
|
+
this.bounds = new Bounds();
|
|
23597
23603
|
this.bounds.set(left, top, left + width, top + height);
|
|
23598
23604
|
}
|
|
23599
23605
|
static bounds(left, top, right, bottom) {
|
|
@@ -24068,8 +24074,8 @@
|
|
|
24068
24074
|
const regUrl = /^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
|
24069
24075
|
const ResizeColumnHotSpotSize = 16;
|
|
24070
24076
|
const IndicatorDimensionKeyPlaceholder = '$$indicator$$';
|
|
24071
|
-
const DrillDown = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path
|
|
24072
|
-
const DrillUp = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>`;
|
|
24077
|
+
const DrillDown = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>`;
|
|
24078
|
+
const DrillUp = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>`;
|
|
24073
24079
|
const DefaultSparklineSpec = {
|
|
24074
24080
|
type: 'line'
|
|
24075
24081
|
};
|
|
@@ -24844,7 +24850,7 @@
|
|
|
24844
24850
|
});
|
|
24845
24851
|
}
|
|
24846
24852
|
setAttribute(key, value, forceUpdateTag) {
|
|
24847
|
-
isPlainObject$1(this.attribute[key]) && isPlainObject$1(value) && !isFunction$
|
|
24853
|
+
isPlainObject$1(this.attribute[key]) && isPlainObject$1(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge(this.attribute[key], value) : this.attribute[key] = value, GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
|
|
24848
24854
|
}
|
|
24849
24855
|
setAttributes(params, forceUpdateTag) {
|
|
24850
24856
|
const keys = Object.keys(params);
|
|
@@ -24854,7 +24860,7 @@
|
|
|
24854
24860
|
isNil$3(keys) && (keys = Object.keys(params));
|
|
24855
24861
|
for (let i = 0; i < keys.length; i++) {
|
|
24856
24862
|
const key = keys[i];
|
|
24857
|
-
!isPlainObject$1(this.attribute[key]) || isFunction$
|
|
24863
|
+
!isPlainObject$1(this.attribute[key]) || isFunction$1(this.attribute[key]) || isFunction$1(params[key]) ? this.attribute[key] = params[key] : merge(this.attribute[key], params[key]);
|
|
24858
24864
|
}
|
|
24859
24865
|
}
|
|
24860
24866
|
bindEvents() {}
|
|
@@ -25127,7 +25133,7 @@
|
|
|
25127
25133
|
});
|
|
25128
25134
|
}
|
|
25129
25135
|
|
|
25130
|
-
function scale(vector, scale) {
|
|
25136
|
+
function scale$1(vector, scale) {
|
|
25131
25137
|
return [vector[0] * scale, vector[1] * scale];
|
|
25132
25138
|
}
|
|
25133
25139
|
function normalize$2(vector) {
|
|
@@ -25402,7 +25408,7 @@
|
|
|
25402
25408
|
}
|
|
25403
25409
|
return t;
|
|
25404
25410
|
};
|
|
25405
|
-
const _tBounds = new AABBBounds
|
|
25411
|
+
const _tBounds = new AABBBounds();
|
|
25406
25412
|
loadPoptipComponent();
|
|
25407
25413
|
class PopTip extends AbstractComponent {
|
|
25408
25414
|
constructor(attributes, options) {
|
|
@@ -25539,7 +25545,7 @@
|
|
|
25539
25545
|
{
|
|
25540
25546
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
25541
25547
|
const b = _tBounds,
|
|
25542
|
-
stageBounds = new Bounds
|
|
25548
|
+
stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
25543
25549
|
if (rectInsideAnotherRect(b, stageBounds, !1)) break;
|
|
25544
25550
|
{
|
|
25545
25551
|
const bbox = getRectIntersect(b, stageBounds, !1),
|
|
@@ -26138,7 +26144,7 @@
|
|
|
26138
26144
|
const data = this.data[index],
|
|
26139
26145
|
tickLineState = merge({}, DEFAULT_STATES$2, this.attribute.tick.state);
|
|
26140
26146
|
Object.keys(tickLineState).forEach(key => {
|
|
26141
|
-
isFunction$
|
|
26147
|
+
isFunction$1(tickLineState[key]) && (tickLineState[key] = tickLineState[key](data.rawValue, index, data, this.data));
|
|
26142
26148
|
}), line.states = tickLineState;
|
|
26143
26149
|
}
|
|
26144
26150
|
tickLineGroup.add(line);
|
|
@@ -26153,7 +26159,7 @@
|
|
|
26153
26159
|
if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty(subTick.state)) line.states = DEFAULT_STATES$2;else {
|
|
26154
26160
|
const subTickLineState = merge({}, DEFAULT_STATES$2, subTick.state);
|
|
26155
26161
|
Object.keys(subTickLineState).forEach(key => {
|
|
26156
|
-
isFunction$
|
|
26162
|
+
isFunction$1(subTickLineState[key]) && (subTickLineState[key] = subTickLineState[key](item.value, index, item, tickLineItems));
|
|
26157
26163
|
}), line.states = subTickLineState;
|
|
26158
26164
|
}
|
|
26159
26165
|
tickLineGroup.add(line);
|
|
@@ -26164,7 +26170,7 @@
|
|
|
26164
26170
|
const {
|
|
26165
26171
|
dataFilter: dataFilter
|
|
26166
26172
|
} = this.attribute.label;
|
|
26167
|
-
dataFilter && isFunction$
|
|
26173
|
+
dataFilter && isFunction$1(dataFilter) && (items = dataFilter(items, layer));
|
|
26168
26174
|
const data = this._transformItems(items),
|
|
26169
26175
|
labelGroup = graphicCreator$1.group({
|
|
26170
26176
|
x: 0,
|
|
@@ -26178,7 +26184,7 @@
|
|
|
26178
26184
|
if (text = isRichText(labelStyle) ? graphicCreator$1.richtext(richTextAttributeTransform(labelStyle)) : graphicCreator$1.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.state)) text.states = DEFAULT_STATES$2;else {
|
|
26179
26185
|
const labelState = merge({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
26180
26186
|
Object.keys(labelState).forEach(key => {
|
|
26181
|
-
isFunction$
|
|
26187
|
+
isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
26182
26188
|
}), text.states = labelState;
|
|
26183
26189
|
}
|
|
26184
26190
|
labelGroup.add(text);
|
|
@@ -26213,7 +26219,7 @@
|
|
|
26213
26219
|
dataFilter: dataFilter
|
|
26214
26220
|
} = tick;
|
|
26215
26221
|
let tickSegment = 1;
|
|
26216
|
-
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$
|
|
26222
|
+
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$1(dataFilter) ? dataFilter(data) : data).forEach(item => {
|
|
26217
26223
|
let point = item.point,
|
|
26218
26224
|
tickValue = item.value;
|
|
26219
26225
|
if (!alignWithLabel) {
|
|
@@ -26276,7 +26282,7 @@
|
|
|
26276
26282
|
_getTickLineAttribute(type, tickItem, index, tickItems) {
|
|
26277
26283
|
let style = get$5(this.attribute, `${type}.style`);
|
|
26278
26284
|
const data = this.data[index];
|
|
26279
|
-
style = isFunction$
|
|
26285
|
+
style = isFunction$1(style) ? merge({}, get$5(DEFAULT_AXIS_THEME, `${type}.style`), "tick" === type ? style(data.rawValue, index, data, this.data) : style(tickItem.value, index, tickItem, tickItems)) : style;
|
|
26280
26286
|
const {
|
|
26281
26287
|
start: start,
|
|
26282
26288
|
end: end,
|
|
@@ -26311,9 +26317,9 @@
|
|
|
26311
26317
|
let {
|
|
26312
26318
|
style: textStyle
|
|
26313
26319
|
} = this.attribute.label;
|
|
26314
|
-
textStyle = isFunction$
|
|
26320
|
+
textStyle = isFunction$1(textStyle) ? merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
26315
26321
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
26316
|
-
return textStyle = merge(labelAlign, textStyle), isFunction$
|
|
26322
|
+
return textStyle = merge(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
|
|
26317
26323
|
label: tickDatum.label,
|
|
26318
26324
|
value: tickDatum.rawValue,
|
|
26319
26325
|
index: tickDatum.index,
|
|
@@ -26405,13 +26411,13 @@
|
|
|
26405
26411
|
method = "parity",
|
|
26406
26412
|
separation: sep = 0
|
|
26407
26413
|
} = config,
|
|
26408
|
-
reduce = isFunction$
|
|
26414
|
+
reduce = isFunction$1(method) ? method : methods$1[method] || methods$1.parity;
|
|
26409
26415
|
if (items.length >= 3 && hasOverlap$1(items, sep)) {
|
|
26410
26416
|
do {
|
|
26411
26417
|
items = reduce(items, sep);
|
|
26412
26418
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
26413
26419
|
if (items.length < 3 || config.lastVisible) {
|
|
26414
|
-
const lastSourceItem = last
|
|
26420
|
+
const lastSourceItem = last(source);
|
|
26415
26421
|
if (!lastSourceItem.attribute.opacity) {
|
|
26416
26422
|
const remainLength = items.length;
|
|
26417
26423
|
if (remainLength > 1) {
|
|
@@ -26438,7 +26444,7 @@
|
|
|
26438
26444
|
for (labelRotateAngle && labelRotateAngle.length > 0 && (n = labelRotateAngle.length); i < n;) {
|
|
26439
26445
|
const angle = labelRotateAngle[i++];
|
|
26440
26446
|
if (items.forEach(item => {
|
|
26441
|
-
item.attribute.angle = degreeToRadian
|
|
26447
|
+
item.attribute.angle = degreeToRadian(angle);
|
|
26442
26448
|
}), tryRotate(orient, items), !hasIntersect(items)) break;
|
|
26443
26449
|
}
|
|
26444
26450
|
}
|
|
@@ -26599,7 +26605,7 @@
|
|
|
26599
26605
|
axisVector = this.getRelativeVector(),
|
|
26600
26606
|
normalizedAxisVector = normalize$2(axisVector),
|
|
26601
26607
|
verticalVector = [normalizedAxisVector[1], -1 * normalizedAxisVector[0]];
|
|
26602
|
-
return scale(verticalVector, offset * (inside ? 1 : -1) * verticalFactor);
|
|
26608
|
+
return scale$1(verticalVector, offset * (inside ? 1 : -1) * verticalFactor);
|
|
26603
26609
|
}
|
|
26604
26610
|
}
|
|
26605
26611
|
|
|
@@ -26784,11 +26790,11 @@
|
|
|
26784
26790
|
} = this.attribute,
|
|
26785
26791
|
isX = "bottom" === orient || "top" === orient,
|
|
26786
26792
|
first = labelShapes[0],
|
|
26787
|
-
last = last
|
|
26788
|
-
isInverse = isX ? first.attribute.x > last.attribute.x : first.attribute.y < last.attribute.y;
|
|
26793
|
+
last$1 = last(labelShapes),
|
|
26794
|
+
isInverse = isX ? first.attribute.x > last$1.attribute.x : first.attribute.y < last$1.attribute.y;
|
|
26789
26795
|
if (isX) {
|
|
26790
|
-
const leftMostLabel = isInverse ? last : first,
|
|
26791
|
-
rightMostLabel = isInverse ? first : last,
|
|
26796
|
+
const leftMostLabel = isInverse ? last$1 : first,
|
|
26797
|
+
rightMostLabel = isInverse ? first : last$1,
|
|
26792
26798
|
left = axisStart.x,
|
|
26793
26799
|
right = axisEnd.x,
|
|
26794
26800
|
leftBound = leftMostLabel.AABBBounds.x1,
|
|
@@ -26810,8 +26816,8 @@
|
|
|
26810
26816
|
});
|
|
26811
26817
|
}
|
|
26812
26818
|
} else {
|
|
26813
|
-
const bottomMostLabel = isInverse ? last : first,
|
|
26814
|
-
topMostLabel = isInverse ? first : last,
|
|
26819
|
+
const bottomMostLabel = isInverse ? last$1 : first,
|
|
26820
|
+
topMostLabel = isInverse ? first : last$1,
|
|
26815
26821
|
bottomBound = bottomMostLabel.AABBBounds.y2,
|
|
26816
26822
|
topBound = topMostLabel.AABBBounds.y1,
|
|
26817
26823
|
top = axisStart.y,
|
|
@@ -26854,7 +26860,7 @@
|
|
|
26854
26860
|
autoHideSeparation: autoHideSeparation,
|
|
26855
26861
|
lastVisible: lastVisible
|
|
26856
26862
|
} = label;
|
|
26857
|
-
if (isFunction$
|
|
26863
|
+
if (isFunction$1(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
26858
26864
|
if (autoRotate$1 && autoRotate(labelShapes, {
|
|
26859
26865
|
labelRotateAngle: autoRotateAngle,
|
|
26860
26866
|
orient: orient
|
|
@@ -27061,7 +27067,7 @@
|
|
|
27061
27067
|
const {
|
|
27062
27068
|
pageFormatter: pageFormatter
|
|
27063
27069
|
} = this.attribute;
|
|
27064
|
-
return pageFormatter ? isFunction$
|
|
27070
|
+
return pageFormatter ? isFunction$1(pageFormatter) ? pageFormatter(current, this._total) : `${pageFormatter}`.replace("{current}", `${current}`).replace("{total}", `${this._total}`) : `${current}/${this._total}`;
|
|
27065
27071
|
}
|
|
27066
27072
|
setTotal(total) {
|
|
27067
27073
|
total !== this.attribute.total && (this._total = total, 1 !== this._current && this._current <= total ? this.setAttributes({
|
|
@@ -27321,7 +27327,7 @@
|
|
|
27321
27327
|
height: itemHeight
|
|
27322
27328
|
} = item,
|
|
27323
27329
|
widthsOptions = [];
|
|
27324
|
-
isValid$3(maxItemWidth) && widthsOptions.push(maxItemWidth), isValid$3(itemWidth) && widthsOptions.push(itemWidth), widthsOptions.length && (isValid$3(maxWidth) && widthsOptions.push(maxWidth), this._itemWidthByUser = minInArray
|
|
27330
|
+
isValid$3(maxItemWidth) && widthsOptions.push(maxItemWidth), isValid$3(itemWidth) && widthsOptions.push(itemWidth), widthsOptions.length && (isValid$3(maxWidth) && widthsOptions.push(maxWidth), this._itemWidthByUser = minInArray(widthsOptions)), isValid$3(itemHeight) && (this._itemHeightByUser = itemHeight), this._itemContext = {
|
|
27325
27331
|
currentPage: this.attribute.pager && this.attribute.pager.defaultCurrent || 1,
|
|
27326
27332
|
doWrap: !1,
|
|
27327
27333
|
maxWidthInCol: 0,
|
|
@@ -27707,8 +27713,8 @@
|
|
|
27707
27713
|
}
|
|
27708
27714
|
_handleStyle(config, item, isSelected, index, items) {
|
|
27709
27715
|
const newConfig = {};
|
|
27710
|
-
return config.style && (isFunction$
|
|
27711
|
-
config.state[key] && (isFunction$
|
|
27716
|
+
return config.style && (isFunction$1(config.style) ? newConfig.style = config.style(item, isSelected, index, items) : newConfig.style = config.style), config.state && (newConfig.state = {}, Object.keys(config.state).forEach(key => {
|
|
27717
|
+
config.state[key] && (isFunction$1(config.state[key]) ? newConfig.state[key] = config.state[key](item, isSelected, index, items) : newConfig.state[key] = config.state[key]);
|
|
27712
27718
|
})), newConfig;
|
|
27713
27719
|
}
|
|
27714
27720
|
}
|
|
@@ -27805,30 +27811,15 @@
|
|
|
27805
27811
|
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
27806
27812
|
var isType$1 = isType;
|
|
27807
27813
|
|
|
27808
|
-
const isFunction = value => "function" == typeof value;
|
|
27809
|
-
var isFunction$1 = isFunction;
|
|
27810
|
-
|
|
27811
27814
|
const isNil = value => null == value;
|
|
27812
27815
|
var isNil$1 = isNil;
|
|
27813
27816
|
|
|
27814
27817
|
const isValid = value => null != value;
|
|
27815
27818
|
var isValid$1 = isValid;
|
|
27816
27819
|
|
|
27817
|
-
const isString = function (value) {
|
|
27818
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
27819
|
-
const type = typeof value;
|
|
27820
|
-
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
27821
|
-
};
|
|
27822
|
-
var isString$1 = isString;
|
|
27823
|
-
|
|
27824
27820
|
const isArray = value => Array.isArray ? Array.isArray(value) : isType$1(value, "Array");
|
|
27825
27821
|
var isArray$1 = isArray;
|
|
27826
27822
|
|
|
27827
|
-
const isArrayLike = function (value) {
|
|
27828
|
-
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
27829
|
-
};
|
|
27830
|
-
var isArrayLike$1 = isArrayLike;
|
|
27831
|
-
|
|
27832
27823
|
const isNumber = function (value) {
|
|
27833
27824
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
27834
27825
|
const type = typeof value;
|
|
@@ -27836,32 +27827,6 @@
|
|
|
27836
27827
|
};
|
|
27837
27828
|
var isNumber$1 = isNumber;
|
|
27838
27829
|
|
|
27839
|
-
function last(val) {
|
|
27840
|
-
if (isArrayLike$1(val)) {
|
|
27841
|
-
return val[val.length - 1];
|
|
27842
|
-
}
|
|
27843
|
-
}
|
|
27844
|
-
const maxInArray = (arr, compareFn) => {
|
|
27845
|
-
var _a;
|
|
27846
|
-
if (0 === arr.length) return;
|
|
27847
|
-
let max = arr[0];
|
|
27848
|
-
for (let i = 1; i < arr.length; i++) {
|
|
27849
|
-
const value = arr[i];
|
|
27850
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max > 0) && (max = value);
|
|
27851
|
-
}
|
|
27852
|
-
return max;
|
|
27853
|
-
};
|
|
27854
|
-
const minInArray = (arr, compareFn) => {
|
|
27855
|
-
var _a;
|
|
27856
|
-
if (0 === arr.length) return;
|
|
27857
|
-
let min = arr[0];
|
|
27858
|
-
for (let i = 1; i < arr.length; i++) {
|
|
27859
|
-
const value = arr[i];
|
|
27860
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min < 0) && (min = value);
|
|
27861
|
-
}
|
|
27862
|
-
return min;
|
|
27863
|
-
};
|
|
27864
|
-
|
|
27865
27830
|
function range(start, stop, step) {
|
|
27866
27831
|
isValid$1(stop) || (stop = start, start = 0), isValid$1(step) || (step = 1);
|
|
27867
27832
|
let i = -1;
|
|
@@ -27925,155 +27890,6 @@
|
|
|
27925
27890
|
return t => (d.setTime(aVal * (1 - t) + bVal * t), d);
|
|
27926
27891
|
}
|
|
27927
27892
|
|
|
27928
|
-
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
27929
|
-
const {
|
|
27930
|
-
x1: x1,
|
|
27931
|
-
y1: y1,
|
|
27932
|
-
x2: x2,
|
|
27933
|
-
y2: y2
|
|
27934
|
-
} = bounds;
|
|
27935
|
-
return matrix.onlyTranslate() ? (out !== bounds && out.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), out.translate(matrix.e, matrix.f), bounds) : (out.clear(), out.add(matrix.a * x1 + matrix.c * y1 + matrix.e, matrix.b * x1 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y1 + matrix.e, matrix.b * x2 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y2 + matrix.e, matrix.b * x2 + matrix.d * y2 + matrix.f), out.add(matrix.a * x1 + matrix.c * y2 + matrix.e, matrix.b * x1 + matrix.d * y2 + matrix.f), bounds);
|
|
27936
|
-
}
|
|
27937
|
-
class Bounds {
|
|
27938
|
-
constructor(bounds) {
|
|
27939
|
-
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
27940
|
-
}
|
|
27941
|
-
clone() {
|
|
27942
|
-
return new Bounds(this);
|
|
27943
|
-
}
|
|
27944
|
-
clear() {
|
|
27945
|
-
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
27946
|
-
}
|
|
27947
|
-
empty() {
|
|
27948
|
-
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
27949
|
-
}
|
|
27950
|
-
equals(b) {
|
|
27951
|
-
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
27952
|
-
}
|
|
27953
|
-
setValue() {
|
|
27954
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27955
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27956
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27957
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
27958
|
-
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
27959
|
-
}
|
|
27960
|
-
set() {
|
|
27961
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27962
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27963
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27964
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
27965
|
-
return x2 < x1 ? (this.x2 = x1, this.x1 = x2) : (this.x1 = x1, this.x2 = x2), y2 < y1 ? (this.y2 = y1, this.y1 = y2) : (this.y1 = y1, this.y2 = y2), this;
|
|
27966
|
-
}
|
|
27967
|
-
add() {
|
|
27968
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27969
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27970
|
-
return x < this.x1 && (this.x1 = x), y < this.y1 && (this.y1 = y), x > this.x2 && (this.x2 = x), y > this.y2 && (this.y2 = y), this;
|
|
27971
|
-
}
|
|
27972
|
-
expand() {
|
|
27973
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27974
|
-
return isArray$1(d) ? (this.y1 -= d[0], this.x2 += d[1], this.y2 += d[2], this.x1 -= d[3]) : (this.x1 -= d, this.y1 -= d, this.x2 += d, this.y2 += d), this;
|
|
27975
|
-
}
|
|
27976
|
-
round() {
|
|
27977
|
-
return this.x1 = Math.floor(this.x1), this.y1 = Math.floor(this.y1), this.x2 = Math.ceil(this.x2), this.y2 = Math.ceil(this.y2), this;
|
|
27978
|
-
}
|
|
27979
|
-
translate() {
|
|
27980
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27981
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27982
|
-
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
27983
|
-
}
|
|
27984
|
-
rotate() {
|
|
27985
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27986
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27987
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27988
|
-
const p = this.rotatedPoints(angle, x, y);
|
|
27989
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
27990
|
-
}
|
|
27991
|
-
scale() {
|
|
27992
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27993
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27994
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27995
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
27996
|
-
const p = this.scalePoints(sx, sy, x, y);
|
|
27997
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
27998
|
-
}
|
|
27999
|
-
union(b) {
|
|
28000
|
-
return b.x1 < this.x1 && (this.x1 = b.x1), b.y1 < this.y1 && (this.y1 = b.y1), b.x2 > this.x2 && (this.x2 = b.x2), b.y2 > this.y2 && (this.y2 = b.y2), this;
|
|
28001
|
-
}
|
|
28002
|
-
intersect(b) {
|
|
28003
|
-
return b.x1 > this.x1 && (this.x1 = b.x1), b.y1 > this.y1 && (this.y1 = b.y1), b.x2 < this.x2 && (this.x2 = b.x2), b.y2 < this.y2 && (this.y2 = b.y2), this;
|
|
28004
|
-
}
|
|
28005
|
-
encloses(b) {
|
|
28006
|
-
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
28007
|
-
}
|
|
28008
|
-
alignsWith(b) {
|
|
28009
|
-
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
28010
|
-
}
|
|
28011
|
-
intersects(b) {
|
|
28012
|
-
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
28013
|
-
}
|
|
28014
|
-
contains() {
|
|
28015
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28016
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28017
|
-
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
28018
|
-
}
|
|
28019
|
-
containsPoint(p) {
|
|
28020
|
-
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
28021
|
-
}
|
|
28022
|
-
width() {
|
|
28023
|
-
return this.empty() ? 0 : this.x2 - this.x1;
|
|
28024
|
-
}
|
|
28025
|
-
height() {
|
|
28026
|
-
return this.empty() ? 0 : this.y2 - this.y1;
|
|
28027
|
-
}
|
|
28028
|
-
scaleX() {
|
|
28029
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28030
|
-
return this.x1 *= s, this.x2 *= s, this;
|
|
28031
|
-
}
|
|
28032
|
-
scaleY() {
|
|
28033
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28034
|
-
return this.y1 *= s, this.y2 *= s, this;
|
|
28035
|
-
}
|
|
28036
|
-
transformWithMatrix(matrix) {
|
|
28037
|
-
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
28038
|
-
}
|
|
28039
|
-
copy(b) {
|
|
28040
|
-
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
28041
|
-
}
|
|
28042
|
-
rotatedPoints(angle, x, y) {
|
|
28043
|
-
const {
|
|
28044
|
-
x1: x1,
|
|
28045
|
-
y1: y1,
|
|
28046
|
-
x2: x2,
|
|
28047
|
-
y2: y2
|
|
28048
|
-
} = this,
|
|
28049
|
-
cos = Math.cos(angle),
|
|
28050
|
-
sin = Math.sin(angle),
|
|
28051
|
-
cx = x - x * cos + y * sin,
|
|
28052
|
-
cy = y - x * sin - y * cos;
|
|
28053
|
-
return [cos * x1 - sin * y1 + cx, sin * x1 + cos * y1 + cy, cos * x1 - sin * y2 + cx, sin * x1 + cos * y2 + cy, cos * x2 - sin * y1 + cx, sin * x2 + cos * y1 + cy, cos * x2 - sin * y2 + cx, sin * x2 + cos * y2 + cy];
|
|
28054
|
-
}
|
|
28055
|
-
scalePoints(sx, sy, x, y) {
|
|
28056
|
-
const {
|
|
28057
|
-
x1: x1,
|
|
28058
|
-
y1: y1,
|
|
28059
|
-
x2: x2,
|
|
28060
|
-
y2: y2
|
|
28061
|
-
} = this;
|
|
28062
|
-
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
28063
|
-
}
|
|
28064
|
-
}
|
|
28065
|
-
class AABBBounds extends Bounds {}
|
|
28066
|
-
|
|
28067
|
-
function degreeToRadian(degree) {
|
|
28068
|
-
return degree * (Math.PI / 180);
|
|
28069
|
-
}
|
|
28070
|
-
function polarToCartesian(center, radius, angleInRadian) {
|
|
28071
|
-
return {
|
|
28072
|
-
x: center.x + radius * Math.cos(angleInRadian),
|
|
28073
|
-
y: center.y + radius * Math.sin(angleInRadian)
|
|
28074
|
-
};
|
|
28075
|
-
}
|
|
28076
|
-
|
|
28077
27893
|
function hslToRgb(h, s, l) {
|
|
28078
27894
|
s /= 100, l /= 100;
|
|
28079
27895
|
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
@@ -28502,258 +28318,12 @@
|
|
|
28502
28318
|
rgbToHsl: rgbToHsl
|
|
28503
28319
|
});
|
|
28504
28320
|
|
|
28505
|
-
const eastAsianCharacterInfo = character => {
|
|
28506
|
-
let x = character.charCodeAt(0),
|
|
28507
|
-
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
28508
|
-
codePoint = x;
|
|
28509
|
-
return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
28510
|
-
};
|
|
28511
|
-
|
|
28512
|
-
function getContextFont(text) {
|
|
28513
|
-
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28514
|
-
const {
|
|
28515
|
-
fontStyle = defaultAttr.fontStyle,
|
|
28516
|
-
fontVariant = defaultAttr.fontVariant,
|
|
28517
|
-
fontWeight = defaultAttr.fontWeight,
|
|
28518
|
-
fontSize = defaultAttr.fontSize,
|
|
28519
|
-
fontFamily = defaultAttr.fontFamily
|
|
28520
|
-
} = text;
|
|
28521
|
-
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize + "px " + (fontFamily || "sans-serif");
|
|
28522
|
-
}
|
|
28523
|
-
|
|
28524
|
-
class TextMeasure {
|
|
28525
|
-
constructor(option, textSpec) {
|
|
28526
|
-
this._numberCharSize = null, this._fullCharSize = null, this._letterCharSize = null, this._specialCharSizeMap = {}, this._canvas = null, this._context = null, this._contextSaved = !1, this._notSupportCanvas = !1, this._notSupportVRender = !1, this._userSpec = {}, this.specialCharSet = "-/: .,@%'\"~", this._option = option, this._userSpec = null != textSpec ? textSpec : {}, this.textSpec = this._initSpec(), isValid$1(option.specialCharSet) && (this.specialCharSet = option.specialCharSet), this._standardMethod = isValid$1(option.getTextBounds) ? this.fullMeasure.bind(this) : this.measureWithNaiveCanvas.bind(this);
|
|
28527
|
-
}
|
|
28528
|
-
initContext() {
|
|
28529
|
-
if (this._notSupportCanvas) return !1;
|
|
28530
|
-
if (isNil$1(this._canvas) && (isValid$1(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$1(this._canvas) && "undefined" != typeof window && void 0 !== window.document && globalThis && isValid$1(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$1(this._context) && isValid$1(this._canvas)) {
|
|
28531
|
-
const context = this._canvas.getContext("2d");
|
|
28532
|
-
isValid$1(context) && (context.save(), context.font = getContextFont(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
28533
|
-
}
|
|
28534
|
-
return !isNil$1(this._context) || (this._notSupportCanvas = !0, !1);
|
|
28535
|
-
}
|
|
28536
|
-
_initSpec() {
|
|
28537
|
-
var _a, _b, _c;
|
|
28538
|
-
const {
|
|
28539
|
-
defaultFontParams = {}
|
|
28540
|
-
} = this._option,
|
|
28541
|
-
{
|
|
28542
|
-
fontStyle = defaultFontParams.fontStyle,
|
|
28543
|
-
fontVariant = defaultFontParams.fontVariant,
|
|
28544
|
-
fontWeight = null !== (_a = defaultFontParams.fontWeight) && void 0 !== _a ? _a : "normal",
|
|
28545
|
-
fontSize = null !== (_b = defaultFontParams.fontSize) && void 0 !== _b ? _b : 12,
|
|
28546
|
-
fontFamily = null !== (_c = defaultFontParams.fontFamily) && void 0 !== _c ? _c : "sans-serif",
|
|
28547
|
-
align: align,
|
|
28548
|
-
textAlign = null != align ? align : "center",
|
|
28549
|
-
baseline: baseline,
|
|
28550
|
-
textBaseline = null != baseline ? baseline : "middle",
|
|
28551
|
-
ellipsis: ellipsis,
|
|
28552
|
-
limit: limit
|
|
28553
|
-
} = this._userSpec;
|
|
28554
|
-
let {
|
|
28555
|
-
lineHeight = fontSize
|
|
28556
|
-
} = this._userSpec;
|
|
28557
|
-
if (isString$1(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
28558
|
-
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
28559
|
-
lineHeight = fontSize * scale;
|
|
28560
|
-
}
|
|
28561
|
-
return {
|
|
28562
|
-
fontStyle: fontStyle,
|
|
28563
|
-
fontVariant: fontVariant,
|
|
28564
|
-
fontFamily: fontFamily,
|
|
28565
|
-
fontSize: fontSize,
|
|
28566
|
-
fontWeight: fontWeight,
|
|
28567
|
-
textAlign: textAlign,
|
|
28568
|
-
textBaseline: textBaseline,
|
|
28569
|
-
ellipsis: ellipsis,
|
|
28570
|
-
limit: limit,
|
|
28571
|
-
lineHeight: lineHeight
|
|
28572
|
-
};
|
|
28573
|
-
}
|
|
28574
|
-
measure(text, method) {
|
|
28575
|
-
switch (method) {
|
|
28576
|
-
case "vrender":
|
|
28577
|
-
case "canopus":
|
|
28578
|
-
return this.fullMeasure(text);
|
|
28579
|
-
case "canvas":
|
|
28580
|
-
return this.measureWithNaiveCanvas(text);
|
|
28581
|
-
case "simple":
|
|
28582
|
-
return this.quickMeasureWithoutCanvas(text);
|
|
28583
|
-
default:
|
|
28584
|
-
return this.quickMeasure(text);
|
|
28585
|
-
}
|
|
28586
|
-
}
|
|
28587
|
-
fullMeasure(text) {
|
|
28588
|
-
if (isNil$1(text)) return {
|
|
28589
|
-
width: 0,
|
|
28590
|
-
height: 0
|
|
28591
|
-
};
|
|
28592
|
-
if (isNil$1(this._option.getTextBounds) || !this._notSupportVRender) return this.measureWithNaiveCanvas(text);
|
|
28593
|
-
const {
|
|
28594
|
-
fontFamily: fontFamily,
|
|
28595
|
-
fontSize: fontSize,
|
|
28596
|
-
fontWeight: fontWeight,
|
|
28597
|
-
textAlign: textAlign,
|
|
28598
|
-
textBaseline: textBaseline,
|
|
28599
|
-
ellipsis: ellipsis,
|
|
28600
|
-
limit: limit,
|
|
28601
|
-
lineHeight: lineHeight
|
|
28602
|
-
} = this.textSpec;
|
|
28603
|
-
let size;
|
|
28604
|
-
try {
|
|
28605
|
-
const bounds = this._option.getTextBounds({
|
|
28606
|
-
text: text,
|
|
28607
|
-
fontFamily: fontFamily,
|
|
28608
|
-
fontSize: fontSize,
|
|
28609
|
-
fontWeight: fontWeight,
|
|
28610
|
-
textAlign: textAlign,
|
|
28611
|
-
textBaseline: textBaseline,
|
|
28612
|
-
ellipsis: !!ellipsis,
|
|
28613
|
-
maxLineWidth: limit || 1 / 0,
|
|
28614
|
-
lineHeight: lineHeight
|
|
28615
|
-
});
|
|
28616
|
-
size = {
|
|
28617
|
-
width: bounds.width(),
|
|
28618
|
-
height: bounds.height()
|
|
28619
|
-
};
|
|
28620
|
-
} catch (e) {
|
|
28621
|
-
this._notSupportVRender = !0, size = this.measureWithNaiveCanvas(text);
|
|
28622
|
-
}
|
|
28623
|
-
return size;
|
|
28624
|
-
}
|
|
28625
|
-
measureWithNaiveCanvas(text) {
|
|
28626
|
-
return this._measureReduce(text, this._measureWithNaiveCanvas.bind(this));
|
|
28627
|
-
}
|
|
28628
|
-
_measureWithNaiveCanvas(text) {
|
|
28629
|
-
var _a;
|
|
28630
|
-
if (!this.initContext()) return this._quickMeasureWithoutCanvas(text);
|
|
28631
|
-
const metrics = this._context.measureText(text),
|
|
28632
|
-
{
|
|
28633
|
-
fontSize: fontSize,
|
|
28634
|
-
lineHeight: lineHeight
|
|
28635
|
-
} = this.textSpec;
|
|
28636
|
-
return {
|
|
28637
|
-
width: metrics.width,
|
|
28638
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
|
|
28639
|
-
};
|
|
28640
|
-
}
|
|
28641
|
-
quickMeasure(text) {
|
|
28642
|
-
return this._measureReduce(text, this._quickMeasure.bind(this));
|
|
28643
|
-
}
|
|
28644
|
-
_quickMeasure(text) {
|
|
28645
|
-
const totalSize = {
|
|
28646
|
-
width: 0,
|
|
28647
|
-
height: 0
|
|
28648
|
-
};
|
|
28649
|
-
for (let i = 0; i < text.length; i++) {
|
|
28650
|
-
const char = text[i];
|
|
28651
|
-
let size = this._measureSpecialChar(char);
|
|
28652
|
-
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
28653
|
-
}
|
|
28654
|
-
return totalSize;
|
|
28655
|
-
}
|
|
28656
|
-
quickMeasureWithoutCanvas(text) {
|
|
28657
|
-
return this._measureReduce(text, this._quickMeasureWithoutCanvas.bind(this));
|
|
28658
|
-
}
|
|
28659
|
-
_quickMeasureWithoutCanvas(text) {
|
|
28660
|
-
var _a;
|
|
28661
|
-
const totalSize = {
|
|
28662
|
-
width: 0,
|
|
28663
|
-
height: 0
|
|
28664
|
-
},
|
|
28665
|
-
{
|
|
28666
|
-
fontSize: fontSize,
|
|
28667
|
-
lineHeight: lineHeight
|
|
28668
|
-
} = this.textSpec;
|
|
28669
|
-
for (let i = 0; i < text.length; i++) {
|
|
28670
|
-
const char = text[i],
|
|
28671
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
28672
|
-
totalSize.width += size * fontSize;
|
|
28673
|
-
}
|
|
28674
|
-
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
28675
|
-
}
|
|
28676
|
-
_measureReduce(text, processor) {
|
|
28677
|
-
var _a;
|
|
28678
|
-
const {
|
|
28679
|
-
fontSize: fontSize,
|
|
28680
|
-
lineHeight: lineHeight
|
|
28681
|
-
} = this.textSpec,
|
|
28682
|
-
defaultResult = {
|
|
28683
|
-
width: 0,
|
|
28684
|
-
height: 0
|
|
28685
|
-
};
|
|
28686
|
-
if (isNil$1(text)) return defaultResult;
|
|
28687
|
-
if (isArray$1(text)) {
|
|
28688
|
-
const textArr = text.filter(isValid$1).map(s => s.toString());
|
|
28689
|
-
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
28690
|
-
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
28691
|
-
height: textArr.length * ((null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize) + 1) + 1
|
|
28692
|
-
};
|
|
28693
|
-
}
|
|
28694
|
-
return processor(text.toString());
|
|
28695
|
-
}
|
|
28696
|
-
_measureNumberChar() {
|
|
28697
|
-
if (isNil$1(this._numberCharSize)) {
|
|
28698
|
-
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
28699
|
-
this._numberCharSize = {
|
|
28700
|
-
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
28701
|
-
height: numberBounds.height
|
|
28702
|
-
};
|
|
28703
|
-
}
|
|
28704
|
-
return this._numberCharSize;
|
|
28705
|
-
}
|
|
28706
|
-
_measureFullSizeChar() {
|
|
28707
|
-
return isNil$1(this._fullCharSize) && (this._fullCharSize = this._standardMethod(TextMeasure.FULL_SIZE_CHAR)), this._fullCharSize;
|
|
28708
|
-
}
|
|
28709
|
-
_measureLetterChar() {
|
|
28710
|
-
if (isNil$1(this._letterCharSize)) {
|
|
28711
|
-
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
28712
|
-
this._letterCharSize = {
|
|
28713
|
-
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
28714
|
-
height: alphabetBounds.height
|
|
28715
|
-
};
|
|
28716
|
-
}
|
|
28717
|
-
return this._letterCharSize;
|
|
28718
|
-
}
|
|
28719
|
-
_measureSpecialChar(char) {
|
|
28720
|
-
return isValid$1(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
28721
|
-
}
|
|
28722
|
-
release() {
|
|
28723
|
-
isValid$1(this._canvas) && (this._canvas = null), isValid$1(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
28724
|
-
}
|
|
28725
|
-
}
|
|
28726
|
-
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
28727
|
-
|
|
28728
28321
|
var ScaleEnum$1;
|
|
28729
28322
|
!function (ScaleEnum) {
|
|
28730
28323
|
ScaleEnum.Identity = "identity", ScaleEnum.Linear = "linear", ScaleEnum.Log = "log", ScaleEnum.Pow = "pow", ScaleEnum.Sqrt = "sqrt", ScaleEnum.Symlog = "symlog", ScaleEnum.Time = "time", ScaleEnum.Quantile = "quantile", ScaleEnum.Quantize = "quantize", ScaleEnum.Threshold = "threshold", ScaleEnum.Ordinal = "ordinal", ScaleEnum.Point = "point", ScaleEnum.Band = "band";
|
|
28731
28324
|
}(ScaleEnum$1 || (ScaleEnum$1 = {}));
|
|
28732
28325
|
Object.values(ScaleEnum$1).forEach(v => {
|
|
28733
28326
|
});
|
|
28734
|
-
function isContinuous(type) {
|
|
28735
|
-
switch (type) {
|
|
28736
|
-
case ScaleEnum$1.Linear:
|
|
28737
|
-
case ScaleEnum$1.Log:
|
|
28738
|
-
case ScaleEnum$1.Pow:
|
|
28739
|
-
case ScaleEnum$1.Sqrt:
|
|
28740
|
-
case ScaleEnum$1.Symlog:
|
|
28741
|
-
case ScaleEnum$1.Time:
|
|
28742
|
-
return !0;
|
|
28743
|
-
default:
|
|
28744
|
-
return !1;
|
|
28745
|
-
}
|
|
28746
|
-
}
|
|
28747
|
-
function isDiscrete(type) {
|
|
28748
|
-
switch (type) {
|
|
28749
|
-
case ScaleEnum$1.Ordinal:
|
|
28750
|
-
case ScaleEnum$1.Point:
|
|
28751
|
-
case ScaleEnum$1.Band:
|
|
28752
|
-
return !0;
|
|
28753
|
-
default:
|
|
28754
|
-
return !1;
|
|
28755
|
-
}
|
|
28756
|
-
}
|
|
28757
28327
|
|
|
28758
28328
|
function identity$1(x) {
|
|
28759
28329
|
return x;
|
|
@@ -30368,7 +29938,7 @@
|
|
|
30368
29938
|
return style;
|
|
30369
29939
|
}
|
|
30370
29940
|
if (style.angle) {
|
|
30371
|
-
style.angle = degreeToRadian
|
|
29941
|
+
style.angle = degreeToRadian(style.angle);
|
|
30372
29942
|
}
|
|
30373
29943
|
return style;
|
|
30374
29944
|
}
|
|
@@ -30578,7 +30148,7 @@
|
|
|
30578
30148
|
position: spec.title.position,
|
|
30579
30149
|
space: spec.title.space,
|
|
30580
30150
|
autoRotate: false,
|
|
30581
|
-
angle: titleAngle ? degreeToRadian
|
|
30151
|
+
angle: titleAngle ? degreeToRadian(titleAngle) : null,
|
|
30582
30152
|
textStyle: merge({}, titleTextStyle, transformToGraphic(spec.title.style)),
|
|
30583
30153
|
padding: spec.title.padding,
|
|
30584
30154
|
shape: {
|
|
@@ -30617,6 +30187,29 @@
|
|
|
30617
30187
|
}(ScaleEnum || (ScaleEnum = {}));
|
|
30618
30188
|
Object.values(ScaleEnum).forEach(v => {
|
|
30619
30189
|
});
|
|
30190
|
+
function isContinuous(type) {
|
|
30191
|
+
switch (type) {
|
|
30192
|
+
case ScaleEnum.Linear:
|
|
30193
|
+
case ScaleEnum.Log:
|
|
30194
|
+
case ScaleEnum.Pow:
|
|
30195
|
+
case ScaleEnum.Sqrt:
|
|
30196
|
+
case ScaleEnum.Symlog:
|
|
30197
|
+
case ScaleEnum.Time:
|
|
30198
|
+
return !0;
|
|
30199
|
+
default:
|
|
30200
|
+
return !1;
|
|
30201
|
+
}
|
|
30202
|
+
}
|
|
30203
|
+
function isDiscrete(type) {
|
|
30204
|
+
switch (type) {
|
|
30205
|
+
case ScaleEnum.Ordinal:
|
|
30206
|
+
case ScaleEnum.Point:
|
|
30207
|
+
case ScaleEnum.Band:
|
|
30208
|
+
return !0;
|
|
30209
|
+
default:
|
|
30210
|
+
return !1;
|
|
30211
|
+
}
|
|
30212
|
+
}
|
|
30620
30213
|
|
|
30621
30214
|
function identity(x) {
|
|
30622
30215
|
return x;
|
|
@@ -31950,19 +31543,66 @@
|
|
|
31950
31543
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
31951
31544
|
}, null != option ? option : {}), textSpec);
|
|
31952
31545
|
|
|
31953
|
-
function
|
|
31954
|
-
|
|
31955
|
-
|
|
31546
|
+
function scale(vector, scale) {
|
|
31547
|
+
return [vector[0] * scale, vector[1] * scale];
|
|
31548
|
+
}
|
|
31549
|
+
function length(vector) {
|
|
31550
|
+
const [x, y] = vector;
|
|
31551
|
+
return Math.sqrt(x * x + y * y);
|
|
31552
|
+
}
|
|
31553
|
+
|
|
31554
|
+
const clampRadian = function () {
|
|
31555
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
31556
|
+
if (angle < 0) for (; angle < 0;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
31956
31557
|
return angle;
|
|
31558
|
+
};
|
|
31559
|
+
function isInRange(a, min, max) {
|
|
31560
|
+
return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6);
|
|
31957
31561
|
}
|
|
31958
|
-
function
|
|
31959
|
-
|
|
31960
|
-
|
|
31961
|
-
|
|
31962
|
-
|
|
31963
|
-
|
|
31562
|
+
function getCircleLabelPosition(tickPosition, tickVector, text, style) {
|
|
31563
|
+
const labelBounds = getTextBounds(Object.assign({
|
|
31564
|
+
text: text
|
|
31565
|
+
}, style)),
|
|
31566
|
+
width = labelBounds.width(),
|
|
31567
|
+
height = labelBounds.height(),
|
|
31568
|
+
angle = clampRadian(Math.atan2(tickVector[1], tickVector[0])) - Math.PI,
|
|
31569
|
+
PI_3_4 = 3 * Math.PI / 4,
|
|
31570
|
+
PI_1_4 = Math.PI / 4,
|
|
31571
|
+
PI_1_2 = Math.PI / 2,
|
|
31572
|
+
baseX = tickPosition.x;
|
|
31573
|
+
let dx = 0;
|
|
31574
|
+
dx = isInRange(angle, -PI_3_4, -PI_1_4) ? ((angle + PI_3_4) / PI_1_2 - .5) * width : isInRange(angle, PI_1_4, PI_3_4) ? (.5 - (angle - PI_1_4) / PI_1_2) * width : Math.cos(angle) >= 0 ? .5 * width : .5 * -width;
|
|
31575
|
+
const x = baseX - dx,
|
|
31576
|
+
baseY = tickPosition.y;
|
|
31577
|
+
let dy = 0;
|
|
31578
|
+
dy = isInRange(angle, -PI_3_4, -PI_1_4) ? .5 * -height : isInRange(angle, PI_1_4, PI_3_4) ? .5 * height : Math.cos(angle) >= 0 ? (.5 - (PI_1_4 - angle) / PI_1_2) * height : (.5 - clampRadian(angle - PI_3_4) / PI_1_2) * height;
|
|
31579
|
+
return {
|
|
31580
|
+
x: x,
|
|
31581
|
+
y: baseY - dy
|
|
31582
|
+
};
|
|
31583
|
+
}
|
|
31584
|
+
function getVerticalCoord(point, vector) {
|
|
31585
|
+
return {
|
|
31586
|
+
x: point.x + vector[0],
|
|
31587
|
+
y: point.y + vector[1]
|
|
31964
31588
|
};
|
|
31965
31589
|
}
|
|
31590
|
+
function getCircleVerticalVector(offset, point, center) {
|
|
31591
|
+
let inside = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
31592
|
+
let axisInside = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
31593
|
+
const vector = [point.x - center.x, point.y - center.y];
|
|
31594
|
+
return scale(vector, (inside ? -1 : 1) * (axisInside ? -1 : 1) * offset / length(vector));
|
|
31595
|
+
}
|
|
31596
|
+
|
|
31597
|
+
function getLabelPosition(angle, center, radius, labelOffset, inside, text, style) {
|
|
31598
|
+
const point = polarToCartesian({
|
|
31599
|
+
x: 0,
|
|
31600
|
+
y: 0
|
|
31601
|
+
}, radius, angle),
|
|
31602
|
+
labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside)),
|
|
31603
|
+
vector = getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside);
|
|
31604
|
+
return getCircleLabelPosition(labelPoint, vector, text, style);
|
|
31605
|
+
}
|
|
31966
31606
|
|
|
31967
31607
|
const convertDomainToTickData = domain => domain.map((t, index) => ({
|
|
31968
31608
|
index: index,
|
|
@@ -32026,33 +31666,37 @@
|
|
|
32026
31666
|
labelStyle: labelStyle,
|
|
32027
31667
|
getRadius: getRadius,
|
|
32028
31668
|
labelOffset: labelOffset,
|
|
32029
|
-
labelFormatter: labelFormatter
|
|
31669
|
+
labelFormatter: labelFormatter,
|
|
31670
|
+
inside: inside
|
|
32030
31671
|
} = op,
|
|
32031
31672
|
radius = null == getRadius ? void 0 : getRadius(),
|
|
32032
31673
|
labelAngle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0,
|
|
32033
|
-
textMeasure = initTextMeasure$1(labelStyle)
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
{
|
|
32037
|
-
|
|
32038
|
-
|
|
32039
|
-
|
|
32040
|
-
|
|
32041
|
-
|
|
32042
|
-
|
|
32043
|
-
|
|
32044
|
-
|
|
32045
|
-
|
|
32046
|
-
|
|
32047
|
-
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
|
|
32052
|
-
|
|
32053
|
-
|
|
32054
|
-
|
|
32055
|
-
|
|
31674
|
+
textMeasure = initTextMeasure$1(labelStyle),
|
|
31675
|
+
labelBoundsList = domain.map(v => {
|
|
31676
|
+
var _a, _b;
|
|
31677
|
+
const str = labelFormatter ? labelFormatter(v) : `${v}`,
|
|
31678
|
+
{
|
|
31679
|
+
width: width,
|
|
31680
|
+
height: height
|
|
31681
|
+
} = textMeasure.quickMeasure(str),
|
|
31682
|
+
textWidth = Math.max(width, 12),
|
|
31683
|
+
textHeight = Math.max(height, 12),
|
|
31684
|
+
angle = scale.scale(v);
|
|
31685
|
+
let textX = 0,
|
|
31686
|
+
textY = 0;
|
|
31687
|
+
const orient_align = null !== (_a = labelStyle.textAlign) && void 0 !== _a ? _a : "center",
|
|
31688
|
+
orient_baseline = null !== (_b = labelStyle.textBaseline) && void 0 !== _b ? _b : "middle",
|
|
31689
|
+
{
|
|
31690
|
+
x: x,
|
|
31691
|
+
y: y
|
|
31692
|
+
} = getLabelPosition(angle, {
|
|
31693
|
+
x: 0,
|
|
31694
|
+
y: 0
|
|
31695
|
+
}, radius, labelOffset, inside, str, labelStyle);
|
|
31696
|
+
textX = x + ("right" === orient_align ? -textWidth : "center" === orient_align ? -textWidth / 2 : 0), textY = y + ("bottom" === orient_baseline ? -textHeight : "middle" === orient_baseline ? -textHeight / 2 : 0);
|
|
31697
|
+
return new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight).rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
|
|
31698
|
+
});
|
|
31699
|
+
return labelBoundsList;
|
|
32056
31700
|
};
|
|
32057
31701
|
const isAxisHorizontal = axisOrientType => ["bottom", "top", "z"].includes(axisOrientType);
|
|
32058
31702
|
|
|
@@ -32069,7 +31713,7 @@
|
|
|
32069
31713
|
labelStyle: labelStyle
|
|
32070
31714
|
} = op;
|
|
32071
31715
|
let scaleTicks;
|
|
32072
|
-
if (isValid$
|
|
31716
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if ("d3" === op.tickMode) {
|
|
32073
31717
|
const count = isFunction$1(tickCount) ? tickCount({
|
|
32074
31718
|
axisLength: rangeSize,
|
|
32075
31719
|
labelStyle: labelStyle
|
|
@@ -32144,7 +31788,7 @@
|
|
|
32144
31788
|
rangeSize = scale.calculateWholeRangeSize();
|
|
32145
31789
|
if (rangeSize < 2) return op.labelLastVisible ? convertDomainToTickData([domain[domain.length - 1]]) : convertDomainToTickData([domain[0]]);
|
|
32146
31790
|
let scaleTicks;
|
|
32147
|
-
if (isValid$
|
|
31791
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
32148
31792
|
const count = isFunction$1(tickCount) ? tickCount({
|
|
32149
31793
|
axisLength: rangeSize,
|
|
32150
31794
|
labelStyle: labelStyle
|
|
@@ -32241,7 +31885,7 @@
|
|
|
32241
31885
|
radius = null == getRadius ? void 0 : getRadius();
|
|
32242
31886
|
if (!radius) return convertDomainToTickData(scale.domain());
|
|
32243
31887
|
let scaleTicks;
|
|
32244
|
-
if (isValid$
|
|
31888
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
32245
31889
|
const range = scale.range(),
|
|
32246
31890
|
rangeSize = Math.abs(range[range.length - 1] - range[0]),
|
|
32247
31891
|
count = isFunction$1(tickCount) ? tickCount({
|
|
@@ -32295,6 +31939,38 @@
|
|
|
32295
31939
|
return convertDomainToTickData(scale.domain());
|
|
32296
31940
|
};
|
|
32297
31941
|
|
|
31942
|
+
function isDataView(obj) {
|
|
31943
|
+
return obj instanceof DataView;
|
|
31944
|
+
}
|
|
31945
|
+
function isHTMLElement(obj) {
|
|
31946
|
+
try {
|
|
31947
|
+
return obj instanceof Element;
|
|
31948
|
+
} catch (_a) {
|
|
31949
|
+
const htmlElementKeys = ["children", "innerHTML", "classList", "setAttribute", "tagName", "getBoundingClientRect"],
|
|
31950
|
+
keys = Object.keys(obj);
|
|
31951
|
+
return htmlElementKeys.every(key => keys.includes(key));
|
|
31952
|
+
}
|
|
31953
|
+
}
|
|
31954
|
+
|
|
31955
|
+
function cloneDeepSpec(spec) {
|
|
31956
|
+
let excludeKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ["data"];
|
|
31957
|
+
const value = spec;
|
|
31958
|
+
let result;
|
|
31959
|
+
if (!isValid$3(value) || "object" != typeof value) return value;
|
|
31960
|
+
if (isDataView(value) || isHTMLElement(value)) return value;
|
|
31961
|
+
const isArr = isArray$3(value),
|
|
31962
|
+
length = value.length;
|
|
31963
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$4(value) || isString$2(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
|
|
31964
|
+
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
31965
|
+
let index = -1;
|
|
31966
|
+
if (result) for (; ++index < (props || value).length;) {
|
|
31967
|
+
const key = props ? props[index] : index,
|
|
31968
|
+
subValue = value[key];
|
|
31969
|
+
(null == excludeKeys ? void 0 : excludeKeys.includes(key.toString())) ? result[key] = subValue : result[key] = cloneDeepSpec(subValue, excludeKeys);
|
|
31970
|
+
}
|
|
31971
|
+
return result;
|
|
31972
|
+
}
|
|
31973
|
+
|
|
32298
31974
|
const e10 = Math.sqrt(50);
|
|
32299
31975
|
const e5 = Math.sqrt(10);
|
|
32300
31976
|
const e2 = Math.sqrt(2);
|
|
@@ -32417,7 +32093,7 @@
|
|
|
32417
32093
|
if (isValid$3(domain[0]) || isValid$3(domain[1]) || this.type !== 'linear') {
|
|
32418
32094
|
return domain;
|
|
32419
32095
|
}
|
|
32420
|
-
if (Math.abs(minInArray
|
|
32096
|
+
if (Math.abs(minInArray(domain) - maxInArray(domain)) <= 1e-12) {
|
|
32421
32097
|
let num = domain[0];
|
|
32422
32098
|
const flag = num >= 0 ? 1 : -1;
|
|
32423
32099
|
num = Math.abs(num);
|
|
@@ -32542,13 +32218,13 @@
|
|
|
32542
32218
|
const isX = isXAxis(axis.orient);
|
|
32543
32219
|
const isInverse = axis.option.inverse === true;
|
|
32544
32220
|
const first = axisLabels[0];
|
|
32545
|
-
const last = last
|
|
32221
|
+
const last$1 = last(axisLabels);
|
|
32546
32222
|
if (isX) {
|
|
32547
32223
|
if (isInverse) {
|
|
32548
32224
|
const start = width;
|
|
32549
32225
|
const end = 0;
|
|
32550
32226
|
const startBound = first.AABBBounds.x2;
|
|
32551
|
-
const endBound = last.AABBBounds.x1;
|
|
32227
|
+
const endBound = last$1.AABBBounds.x1;
|
|
32552
32228
|
if (startBound > start) {
|
|
32553
32229
|
first.setAttributes({
|
|
32554
32230
|
x: start,
|
|
@@ -32556,7 +32232,7 @@
|
|
|
32556
32232
|
});
|
|
32557
32233
|
}
|
|
32558
32234
|
if (endBound < end) {
|
|
32559
|
-
last.setAttributes({
|
|
32235
|
+
last$1.setAttributes({
|
|
32560
32236
|
x: end,
|
|
32561
32237
|
textAlign: 'left'
|
|
32562
32238
|
});
|
|
@@ -32566,7 +32242,7 @@
|
|
|
32566
32242
|
const start = 0;
|
|
32567
32243
|
const end = width;
|
|
32568
32244
|
const startBound = first.AABBBounds.x1;
|
|
32569
|
-
const endBound = last.AABBBounds.x2;
|
|
32245
|
+
const endBound = last$1.AABBBounds.x2;
|
|
32570
32246
|
if (startBound < start) {
|
|
32571
32247
|
first.setAttributes({
|
|
32572
32248
|
x: start,
|
|
@@ -32574,7 +32250,7 @@
|
|
|
32574
32250
|
});
|
|
32575
32251
|
}
|
|
32576
32252
|
if (endBound > end) {
|
|
32577
|
-
last.setAttributes({
|
|
32253
|
+
last$1.setAttributes({
|
|
32578
32254
|
x: end,
|
|
32579
32255
|
textAlign: 'right'
|
|
32580
32256
|
});
|
|
@@ -32584,7 +32260,7 @@
|
|
|
32584
32260
|
else {
|
|
32585
32261
|
if (isInverse) {
|
|
32586
32262
|
const startBound = first.AABBBounds.y1;
|
|
32587
|
-
const endBound = last.AABBBounds.y2;
|
|
32263
|
+
const endBound = last$1.AABBBounds.y2;
|
|
32588
32264
|
const start = 0;
|
|
32589
32265
|
const end = height;
|
|
32590
32266
|
if (startBound < start) {
|
|
@@ -32594,7 +32270,7 @@
|
|
|
32594
32270
|
});
|
|
32595
32271
|
}
|
|
32596
32272
|
if (endBound > end) {
|
|
32597
|
-
last.setAttributes({
|
|
32273
|
+
last$1.setAttributes({
|
|
32598
32274
|
y: end,
|
|
32599
32275
|
textBaseline: 'bottom'
|
|
32600
32276
|
});
|
|
@@ -32604,7 +32280,7 @@
|
|
|
32604
32280
|
const start = height;
|
|
32605
32281
|
const end = 0;
|
|
32606
32282
|
const startBound = first.AABBBounds.y2;
|
|
32607
|
-
const endBound = last.AABBBounds.y1;
|
|
32283
|
+
const endBound = last$1.AABBBounds.y1;
|
|
32608
32284
|
if (startBound > start) {
|
|
32609
32285
|
first.setAttributes({
|
|
32610
32286
|
y: start,
|
|
@@ -32612,7 +32288,7 @@
|
|
|
32612
32288
|
});
|
|
32613
32289
|
}
|
|
32614
32290
|
if (endBound < end) {
|
|
32615
|
-
last.setAttributes({
|
|
32291
|
+
last$1.setAttributes({
|
|
32616
32292
|
y: end,
|
|
32617
32293
|
textBaseline: 'top'
|
|
32618
32294
|
});
|
|
@@ -32843,11 +32519,11 @@
|
|
|
32843
32519
|
}
|
|
32844
32520
|
if (isX) {
|
|
32845
32521
|
const width = this.getLayoutRect().width;
|
|
32846
|
-
const cosValue = Math.abs(Math.cos(degreeToRadian
|
|
32522
|
+
const cosValue = Math.abs(Math.cos(degreeToRadian(angle)));
|
|
32847
32523
|
return cosValue < 1e-6 ? Infinity : width / cosValue;
|
|
32848
32524
|
}
|
|
32849
32525
|
const height = this.getLayoutRect().height;
|
|
32850
|
-
const sinValue = Math.abs(Math.sin(degreeToRadian
|
|
32526
|
+
const sinValue = Math.abs(Math.sin(degreeToRadian(angle)));
|
|
32851
32527
|
return sinValue < 1e-6 ? Infinity : height / sinValue;
|
|
32852
32528
|
}
|
|
32853
32529
|
return null;
|
|
@@ -34657,7 +34333,7 @@
|
|
|
34657
34333
|
}
|
|
34658
34334
|
|
|
34659
34335
|
function getQuadProps(paddingOrigin) {
|
|
34660
|
-
if (isNumber$4(paddingOrigin) || isString$
|
|
34336
|
+
if (isNumber$4(paddingOrigin) || isString$2(paddingOrigin) || isArray$3(paddingOrigin)) {
|
|
34661
34337
|
let padding = parsePadding(paddingOrigin);
|
|
34662
34338
|
if (typeof padding === 'number' || typeof padding === 'string') {
|
|
34663
34339
|
padding = [padding, padding, padding, padding];
|
|
@@ -34929,7 +34605,7 @@
|
|
|
34929
34605
|
return +v === +v;
|
|
34930
34606
|
}
|
|
34931
34607
|
function isPercent(v) {
|
|
34932
|
-
if (!isString$
|
|
34608
|
+
if (!isString$2(v)) {
|
|
34933
34609
|
return false;
|
|
34934
34610
|
}
|
|
34935
34611
|
if (!v.endsWith('%')) {
|
|
@@ -35521,47 +35197,47 @@
|
|
|
35521
35197
|
const originalElement = originalElements[i];
|
|
35522
35198
|
const element = Object.assign({}, originalElement);
|
|
35523
35199
|
for (const name in element) {
|
|
35524
|
-
if (element.hasOwnProperty(name) && isFunction$
|
|
35200
|
+
if (element.hasOwnProperty(name) && isFunction$1(element[name])) {
|
|
35525
35201
|
element[name] = element[name](value);
|
|
35526
35202
|
}
|
|
35527
35203
|
}
|
|
35528
35204
|
const rect = element;
|
|
35529
35205
|
if (isValid$3(rect.x)) {
|
|
35530
|
-
rect.x = isString$
|
|
35206
|
+
rect.x = isString$2(rect.x)
|
|
35531
35207
|
? transformString(rect.x, width - borderLineWidths[1])
|
|
35532
35208
|
: Number(rect.x);
|
|
35533
35209
|
}
|
|
35534
35210
|
if (isValid$3(rect.y)) {
|
|
35535
|
-
rect.y = isString$
|
|
35211
|
+
rect.y = isString$2(rect.y)
|
|
35536
35212
|
? transformString(rect.y, height - borderLineWidths[2])
|
|
35537
35213
|
: Number(rect.y);
|
|
35538
35214
|
}
|
|
35539
35215
|
if ('width' in element) {
|
|
35540
|
-
element.width = isString$
|
|
35216
|
+
element.width = isString$2(element.width)
|
|
35541
35217
|
? transformString(element.width, width - borderLineWidths[1])
|
|
35542
35218
|
: Number(element.width);
|
|
35543
35219
|
}
|
|
35544
35220
|
if ('height' in element) {
|
|
35545
|
-
element.height = isString$
|
|
35221
|
+
element.height = isString$2(element.height)
|
|
35546
35222
|
? transformString(element.height, height - borderLineWidths[2])
|
|
35547
35223
|
: Number(element.height);
|
|
35548
35224
|
}
|
|
35549
35225
|
if ('radius' in element) {
|
|
35550
|
-
element.radius = isString$
|
|
35226
|
+
element.radius = isString$2(element.radius)
|
|
35551
35227
|
? transformString(element.radius, Math.min(width - borderLineWidths[1], height - borderLineWidths[2]))
|
|
35552
35228
|
: Number(element.radius);
|
|
35553
35229
|
}
|
|
35554
35230
|
if ('hover' in element) {
|
|
35555
|
-
element.hover.x = isString$
|
|
35231
|
+
element.hover.x = isString$2(element.hover.x)
|
|
35556
35232
|
? transformString(element.hover.x, width - borderLineWidths[1])
|
|
35557
35233
|
: Number(element.hover.x);
|
|
35558
|
-
element.hover.y = isString$
|
|
35234
|
+
element.hover.y = isString$2(element.hover.y)
|
|
35559
35235
|
? transformString(element.hover.y, height - borderLineWidths[2])
|
|
35560
35236
|
: Number(element.hover.y);
|
|
35561
|
-
element.hover.width = isString$
|
|
35237
|
+
element.hover.width = isString$2(element.hover.width)
|
|
35562
35238
|
? transformString(element.hover.width, width - borderLineWidths[1])
|
|
35563
35239
|
: Number(element.hover.width);
|
|
35564
|
-
element.hover.height = isString$
|
|
35240
|
+
element.hover.height = isString$2(element.hover.height)
|
|
35565
35241
|
? transformString(element.hover.height, height - borderLineWidths[2])
|
|
35566
35242
|
: Number(element.hover.height);
|
|
35567
35243
|
element.hover.x += left;
|
|
@@ -36635,7 +36311,7 @@
|
|
|
36635
36311
|
const barPaddingLeft = Math.max(barPadding[3], Math.ceil(borderWidth[3] / 2));
|
|
36636
36312
|
contentWidth -= barPaddingRight + barPaddingLeft;
|
|
36637
36313
|
contentHeight -= barPaddingBottom + barPaddingTop;
|
|
36638
|
-
if (row === table.rowCount - 1) {
|
|
36314
|
+
if (row === table.rowCount - 1 && [0, '0'].includes(barBottom)) {
|
|
36639
36315
|
contentHeight -= 1;
|
|
36640
36316
|
}
|
|
36641
36317
|
const top = barPaddingTop;
|
|
@@ -36680,8 +36356,11 @@
|
|
|
36680
36356
|
: (num - progressBarDefine.min) / (progressBarDefine.max - progressBarDefine.min);
|
|
36681
36357
|
const barMaxWidth = contentWidth;
|
|
36682
36358
|
const barTop = top + contentHeight - barHeight - barBottom;
|
|
36683
|
-
|
|
36359
|
+
let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
36684
36360
|
const barLeft = barRightToLeft ? left + right - barSize : left;
|
|
36361
|
+
if (col === table.colCount - 1 && percentile === 1) {
|
|
36362
|
+
barSize -= 1;
|
|
36363
|
+
}
|
|
36685
36364
|
const bgFillColor = getOrApply(barBgColor, {
|
|
36686
36365
|
col,
|
|
36687
36366
|
row,
|
|
@@ -36780,7 +36459,10 @@
|
|
|
36780
36459
|
fill: barNagiFillColor
|
|
36781
36460
|
});
|
|
36782
36461
|
percentCompleteBarGroup.addChild(barNega);
|
|
36783
|
-
|
|
36462
|
+
let barSizePosi = Math.min(barMaxWidth * positiveFactor * positiveRate, barMaxWidth);
|
|
36463
|
+
if (col === table.colCount - 1 && positiveRate === 1) {
|
|
36464
|
+
barSizePosi -= 1;
|
|
36465
|
+
}
|
|
36784
36466
|
const barRectPosi = barRightToLeft
|
|
36785
36467
|
? {
|
|
36786
36468
|
left: barLeft + positiveLeft - barSizePosi,
|
|
@@ -36903,7 +36585,10 @@
|
|
|
36903
36585
|
const range = Math.max(_negativeRange, _positiveRange);
|
|
36904
36586
|
const percentile = range === 0 ? 0 : Math.abs(num) / range;
|
|
36905
36587
|
const barMaxWidth = contentWidth;
|
|
36906
|
-
|
|
36588
|
+
let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
36589
|
+
if (col === table.colCount - 1 && percentile === 1) {
|
|
36590
|
+
barSize -= 1;
|
|
36591
|
+
}
|
|
36907
36592
|
const barTop = top + contentHeight - barHeight - barBottom;
|
|
36908
36593
|
const barLeft = barRightToLeft ? left + right - barSize : left;
|
|
36909
36594
|
const bgFillColor = getOrApply(barBgColor, {
|
|
@@ -37367,7 +37052,7 @@
|
|
|
37367
37052
|
}
|
|
37368
37053
|
function getTableBounds(col, row, table) {
|
|
37369
37054
|
const { layoutMap } = table.internalProps;
|
|
37370
|
-
const bodyBound = new Bounds
|
|
37055
|
+
const bodyBound = new Bounds();
|
|
37371
37056
|
const tableBound = table.scenegraph.tableGroup.globalAABBBounds;
|
|
37372
37057
|
bodyBound.x1 = tableBound.x1;
|
|
37373
37058
|
bodyBound.x2 = tableBound.x2;
|
|
@@ -37633,8 +37318,12 @@
|
|
|
37633
37318
|
const layoutMap = table.internalProps.layoutMap;
|
|
37634
37319
|
if (layoutMap.isHeader(col, row)) {
|
|
37635
37320
|
const hd = layoutMap.getHeader(col, row);
|
|
37636
|
-
if (hd?.hierarchyLevel) {
|
|
37321
|
+
if (isValid$3(hd?.hierarchyLevel)) {
|
|
37637
37322
|
cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * (layoutMap.rowHierarchyIndent ?? 0);
|
|
37323
|
+
if (layoutMap.rowHierarchyTextStartAlignment &&
|
|
37324
|
+
!table.internalProps.headerHelper.getHierarchyIcon(col, row)) {
|
|
37325
|
+
cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth();
|
|
37326
|
+
}
|
|
37638
37327
|
}
|
|
37639
37328
|
}
|
|
37640
37329
|
else {
|
|
@@ -37645,6 +37334,10 @@
|
|
|
37645
37334
|
Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none
|
|
37646
37335
|
? (indexArr.length - 1) * (layoutMap.hierarchyIndent ?? 0)
|
|
37647
37336
|
: 0;
|
|
37337
|
+
if (layoutMap.hierarchyTextStartAlignment &&
|
|
37338
|
+
!table.internalProps.bodyHelper.getHierarchyIcon(col, row)) {
|
|
37339
|
+
cellHierarchyIndent += table.internalProps.bodyHelper.getHierarchyIconWidth();
|
|
37340
|
+
}
|
|
37648
37341
|
}
|
|
37649
37342
|
}
|
|
37650
37343
|
return cellHierarchyIndent;
|
|
@@ -38165,7 +37858,7 @@
|
|
|
38165
37858
|
if (cellTheme?.text?.textBaseline) {
|
|
38166
37859
|
textBaseline = cellTheme?.text?.textBaseline;
|
|
38167
37860
|
}
|
|
38168
|
-
const autoRowHeight = table.
|
|
37861
|
+
const autoRowHeight = table.isAutoRowHeight(row);
|
|
38169
37862
|
const autoColWidth = colWidth === 'auto';
|
|
38170
37863
|
const autoWrapText = headerStyle.autoWrapText ?? table.internalProps.autoWrapText;
|
|
38171
37864
|
const lineClamp = headerStyle.lineClamp;
|
|
@@ -38446,7 +38139,7 @@
|
|
|
38446
38139
|
dataValue
|
|
38447
38140
|
});
|
|
38448
38141
|
const autoColWidth = colWidth === 'auto';
|
|
38449
|
-
const autoRowHeight = table.
|
|
38142
|
+
const autoRowHeight = table.isAutoRowHeight(row);
|
|
38450
38143
|
const attribute = {
|
|
38451
38144
|
text: text.length === 1 ? text[0] : text,
|
|
38452
38145
|
maxLineWidth: autoColWidth
|
|
@@ -38547,7 +38240,7 @@
|
|
|
38547
38240
|
customLayout = define?.customLayout;
|
|
38548
38241
|
}
|
|
38549
38242
|
if (customLayout || customRender) {
|
|
38550
|
-
const customResult = dealWithCustom(customLayout, customRender, col, row, cellWidth, cellHeight, false, table.
|
|
38243
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, cellWidth, cellHeight, false, table.isAutoRowHeight(row), padding, table);
|
|
38551
38244
|
customElementsGroup = customResult.elementsGroup;
|
|
38552
38245
|
renderDefault = customResult.renderDefault;
|
|
38553
38246
|
}
|
|
@@ -38625,7 +38318,7 @@
|
|
|
38625
38318
|
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
|
|
38626
38319
|
}
|
|
38627
38320
|
if (customLayout || customRender) {
|
|
38628
|
-
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.
|
|
38321
|
+
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], table);
|
|
38629
38322
|
}
|
|
38630
38323
|
}
|
|
38631
38324
|
}
|
|
@@ -38778,7 +38471,7 @@
|
|
|
38778
38471
|
const define = table.getBodyColumnDefine(col, row);
|
|
38779
38472
|
const mayHaveIcon = !!define?.icon || !!define?.tree || define?.dragOrder;
|
|
38780
38473
|
const cellType = table.getBodyColumnType(col, row);
|
|
38781
|
-
const autoRowHeight = table.
|
|
38474
|
+
const autoRowHeight = table.isAutoRowHeight(row);
|
|
38782
38475
|
const value = table.getCellValue(col, row);
|
|
38783
38476
|
if (!table.isHeader(col, row) &&
|
|
38784
38477
|
oldCellGroup.role === 'cell' &&
|
|
@@ -38797,10 +38490,10 @@
|
|
|
38797
38490
|
for (let row = range.start.row; row <= range.end.row; row++) {
|
|
38798
38491
|
const cellGroup = table.scenegraph.getCell(col, row, true);
|
|
38799
38492
|
if (cellGroup.role === 'cell' && range.start.row !== range.end.row && cellGroup.contentWidth !== cellWidth) {
|
|
38800
|
-
updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.
|
|
38493
|
+
updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.isAutoRowHeight(row), padding, textAlign, textBaseline);
|
|
38801
38494
|
}
|
|
38802
38495
|
if (cellGroup.role === 'cell' && range.start.col !== range.end.col && cellGroup.contentHeight !== cellHeight) {
|
|
38803
|
-
updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.
|
|
38496
|
+
updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.isAutoRowHeight(row), padding, textAlign, textBaseline, table.scenegraph);
|
|
38804
38497
|
}
|
|
38805
38498
|
cellGroup.contentWidth = cellWidth;
|
|
38806
38499
|
cellGroup.contentHeight = cellHeight;
|
|
@@ -38875,7 +38568,7 @@
|
|
|
38875
38568
|
if (customMerge) {
|
|
38876
38569
|
const { range: customMergeRange, text: customMergeText, style: customMergeStyle, customLayout: customMergeLayout, customRender: customMergeRender } = customMerge;
|
|
38877
38570
|
if (customMergeLayout || customMergeRender) {
|
|
38878
|
-
const customResult = dealWithCustom(customMergeLayout, customMergeRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.
|
|
38571
|
+
const customResult = dealWithCustom(customMergeLayout, customMergeRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], table);
|
|
38879
38572
|
const customElementsGroup = customResult.elementsGroup;
|
|
38880
38573
|
if (cellGroup.childrenCount > 0 && customElementsGroup) {
|
|
38881
38574
|
cellGroup.insertBefore(customElementsGroup, cellGroup.firstChild);
|
|
@@ -38945,7 +38638,7 @@
|
|
|
38945
38638
|
scale.domain([min, max], !!axisOption?.nice);
|
|
38946
38639
|
if (axisOption?.nice) {
|
|
38947
38640
|
let tickCount = axisOption.tick?.forceTickCount ?? axisOption.tick?.tickCount ?? 10;
|
|
38948
|
-
if (isFunction$
|
|
38641
|
+
if (isFunction$1(tickCount)) {
|
|
38949
38642
|
tickCount = tickCount({
|
|
38950
38643
|
axisLength,
|
|
38951
38644
|
labelStyle: axisOption?.label?.style ?? {
|
|
@@ -39293,12 +38986,12 @@
|
|
|
39293
38986
|
const data = layout.dataset.collectedValues[rowDimensionKey] ?? [];
|
|
39294
38987
|
const rowPath = layout.getRowKeysPath(col, row);
|
|
39295
38988
|
const domain = data[rowPath ?? ''] ?? [];
|
|
39296
|
-
const { axisOption,
|
|
38989
|
+
const { axisOption, theme, chartType } = getAxisOption(col + 1, row, 'left', layout);
|
|
39297
38990
|
if (axisOption?.visible === false) {
|
|
39298
38991
|
return;
|
|
39299
38992
|
}
|
|
39300
38993
|
return merge({
|
|
39301
|
-
domain: Array.from(domain).reverse(),
|
|
38994
|
+
domain: chartType === 'common' ? Array.from(domain) : Array.from(domain).reverse(),
|
|
39302
38995
|
title: {
|
|
39303
38996
|
autoRotate: true
|
|
39304
38997
|
}
|
|
@@ -39457,7 +39150,8 @@
|
|
|
39457
39150
|
isPercent: spec.percent,
|
|
39458
39151
|
isZeroAlign: checkZeroAlign(spec, orient, layout),
|
|
39459
39152
|
seriesIndice,
|
|
39460
|
-
theme: spec.theme
|
|
39153
|
+
theme: spec.theme,
|
|
39154
|
+
chartType: spec.type
|
|
39461
39155
|
};
|
|
39462
39156
|
}
|
|
39463
39157
|
}
|
|
@@ -39468,7 +39162,8 @@
|
|
|
39468
39162
|
axisOption,
|
|
39469
39163
|
isPercent: false,
|
|
39470
39164
|
isZeroAlign: checkZeroAlign(spec, orient, layout),
|
|
39471
|
-
theme: spec.theme
|
|
39165
|
+
theme: spec.theme,
|
|
39166
|
+
chartType: spec.type
|
|
39472
39167
|
};
|
|
39473
39168
|
}
|
|
39474
39169
|
function checkZeroAlign(spec, orient, layout) {
|
|
@@ -39548,7 +39243,7 @@
|
|
|
39548
39243
|
return range;
|
|
39549
39244
|
}
|
|
39550
39245
|
function getRange$1(position, colForAxisOption, rowForAxisOption, colForIndicatorKey, rowForIndicatorKey, col, row, defaultSeriesIndice, layout) {
|
|
39551
|
-
const { axisOption, isPercent, isZeroAlign, seriesIndice, theme } = getAxisOption(colForAxisOption, rowForAxisOption, position, layout);
|
|
39246
|
+
const { axisOption, isPercent, isZeroAlign, seriesIndice, theme, chartType } = getAxisOption(colForAxisOption, rowForAxisOption, position, layout);
|
|
39552
39247
|
if (axisOption?.visible === false) {
|
|
39553
39248
|
return undefined;
|
|
39554
39249
|
}
|
|
@@ -39588,7 +39283,8 @@
|
|
|
39588
39283
|
isZeroAlign,
|
|
39589
39284
|
range,
|
|
39590
39285
|
ticks,
|
|
39591
|
-
theme
|
|
39286
|
+
theme,
|
|
39287
|
+
chartType
|
|
39592
39288
|
};
|
|
39593
39289
|
}
|
|
39594
39290
|
function isTopOrBottomAxis(col, row, layout) {
|
|
@@ -39827,9 +39523,160 @@
|
|
|
39827
39523
|
};
|
|
39828
39524
|
}
|
|
39829
39525
|
|
|
39526
|
+
let customAlphabetCharSet = '';
|
|
39527
|
+
let textMeasureMode = 'quick';
|
|
39528
|
+
const textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
39529
|
+
if (isBound(TextMeasureContribution)) {
|
|
39530
|
+
rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
|
|
39531
|
+
}
|
|
39532
|
+
else {
|
|
39533
|
+
bind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
|
|
39534
|
+
}
|
|
39535
|
+
});
|
|
39536
|
+
const restoreTextMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
39537
|
+
if (isBound(TextMeasureContribution)) {
|
|
39538
|
+
rebind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
|
|
39539
|
+
}
|
|
39540
|
+
else {
|
|
39541
|
+
bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
|
|
39542
|
+
}
|
|
39543
|
+
});
|
|
39544
|
+
const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
|
|
39545
|
+
return new TextMeasure({
|
|
39546
|
+
defaultFontParams: {
|
|
39547
|
+
fontFamily: DefaultTextStyle.fontFamily,
|
|
39548
|
+
fontSize: DefaultTextStyle.fontSize
|
|
39549
|
+
},
|
|
39550
|
+
getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
|
|
39551
|
+
specialCharSet: `{}()//&-/: .,@%'"~…=${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,
|
|
39552
|
+
...(option ?? {})
|
|
39553
|
+
}, textSpec);
|
|
39554
|
+
};
|
|
39555
|
+
const fastTextMeasureCache = new Map();
|
|
39556
|
+
function getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle = 'normal') {
|
|
39557
|
+
const key = `${fontSize}-${fontWeight}-${fontFamily}-${fontStyle}`;
|
|
39558
|
+
const cache = fastTextMeasureCache.get(key);
|
|
39559
|
+
if (cache) {
|
|
39560
|
+
return cache;
|
|
39561
|
+
}
|
|
39562
|
+
const fastTextMeasure = initTextMeasure({
|
|
39563
|
+
fontSize,
|
|
39564
|
+
fontFamily,
|
|
39565
|
+
fontWeight,
|
|
39566
|
+
fontStyle
|
|
39567
|
+
});
|
|
39568
|
+
fastTextMeasureCache.set(key, fastTextMeasure);
|
|
39569
|
+
return fastTextMeasure;
|
|
39570
|
+
}
|
|
39571
|
+
class FastTextMeasureContribution extends DefaultTextMeasureContribution {
|
|
39572
|
+
measureTextWidth(text, options) {
|
|
39573
|
+
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
39574
|
+
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
39575
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
39576
|
+
return textMeasure.width;
|
|
39577
|
+
}
|
|
39578
|
+
measureText(text, options) {
|
|
39579
|
+
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
39580
|
+
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
39581
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
39582
|
+
return textMeasure;
|
|
39583
|
+
}
|
|
39584
|
+
}
|
|
39585
|
+
class TextMeasureTool {
|
|
39586
|
+
measureText(text, options) {
|
|
39587
|
+
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
39588
|
+
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
39589
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
39590
|
+
return textMeasure;
|
|
39591
|
+
}
|
|
39592
|
+
measureTextWidth(text, options) {
|
|
39593
|
+
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
39594
|
+
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
39595
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
39596
|
+
return textMeasure.width;
|
|
39597
|
+
}
|
|
39598
|
+
clipText(text, options, width) {
|
|
39599
|
+
if (text.length === 0) {
|
|
39600
|
+
return { str: '', width: 0 };
|
|
39601
|
+
}
|
|
39602
|
+
let length = this.measureTextWidth(text, options);
|
|
39603
|
+
if (length <= width) {
|
|
39604
|
+
return { str: text, width: length };
|
|
39605
|
+
}
|
|
39606
|
+
length = this.measureTextWidth(text[0], options);
|
|
39607
|
+
if (length > width) {
|
|
39608
|
+
return { str: '', width: 0 };
|
|
39609
|
+
}
|
|
39610
|
+
return this._clipText(text, options, width, 0, text.length - 1);
|
|
39611
|
+
}
|
|
39612
|
+
_clipText(text, options, width, leftIdx, rightIdx) {
|
|
39613
|
+
const middleIdx = Math.floor((leftIdx + rightIdx) / 2);
|
|
39614
|
+
const subText = text.substring(0, middleIdx + 1);
|
|
39615
|
+
const strWidth = this.measureTextWidth(subText, options);
|
|
39616
|
+
let length;
|
|
39617
|
+
if (strWidth > width) {
|
|
39618
|
+
if (subText.length <= 1) {
|
|
39619
|
+
return { str: '', width: 0 };
|
|
39620
|
+
}
|
|
39621
|
+
const str = text.substring(0, middleIdx);
|
|
39622
|
+
length = this.measureTextWidth(str, options);
|
|
39623
|
+
if (length <= width) {
|
|
39624
|
+
return { str, width: length };
|
|
39625
|
+
}
|
|
39626
|
+
return this._clipText(text, options, width, leftIdx, middleIdx);
|
|
39627
|
+
}
|
|
39628
|
+
else if (strWidth < width) {
|
|
39629
|
+
if (middleIdx >= text.length - 1) {
|
|
39630
|
+
return { str: text, width: this.measureTextWidth(text, options) };
|
|
39631
|
+
}
|
|
39632
|
+
const str = text.substring(0, middleIdx + 2);
|
|
39633
|
+
length = this.measureTextWidth(str, options);
|
|
39634
|
+
if (length >= width) {
|
|
39635
|
+
return { str: subText, width: strWidth };
|
|
39636
|
+
}
|
|
39637
|
+
return this._clipText(text, options, width, middleIdx, rightIdx);
|
|
39638
|
+
}
|
|
39639
|
+
return { str: subText, width: strWidth };
|
|
39640
|
+
}
|
|
39641
|
+
clipTextWithSuffix(text, options, width, suffix) {
|
|
39642
|
+
if (suffix === '') {
|
|
39643
|
+
return this.clipText(text, options, width);
|
|
39644
|
+
}
|
|
39645
|
+
if (text.length === 0) {
|
|
39646
|
+
return { str: '', width: 0 };
|
|
39647
|
+
}
|
|
39648
|
+
const length = this.measureTextWidth(text, options);
|
|
39649
|
+
if (length <= width) {
|
|
39650
|
+
return { str: text, width: length };
|
|
39651
|
+
}
|
|
39652
|
+
const suffixWidth = this.measureTextWidth(suffix, options);
|
|
39653
|
+
if (suffixWidth > width) {
|
|
39654
|
+
return { str: '', width: 0 };
|
|
39655
|
+
}
|
|
39656
|
+
width -= suffixWidth;
|
|
39657
|
+
const data = this._clipText(text, options, width, 0, text.length - 1);
|
|
39658
|
+
data.str += suffix;
|
|
39659
|
+
data.width += suffixWidth;
|
|
39660
|
+
return data;
|
|
39661
|
+
}
|
|
39662
|
+
}
|
|
39663
|
+
const textMeasure = new TextMeasureTool();
|
|
39664
|
+
function setCustomAlphabetCharSet(str) {
|
|
39665
|
+
customAlphabetCharSet = str;
|
|
39666
|
+
fastTextMeasureCache.clear();
|
|
39667
|
+
}
|
|
39668
|
+
function restoreMeasureText() {
|
|
39669
|
+
textMeasureMode = 'canvas';
|
|
39670
|
+
container.load(restoreTextMeasureModule);
|
|
39671
|
+
}
|
|
39830
39672
|
const utilTextMark = new Text$1({
|
|
39831
39673
|
ignoreBuf: true
|
|
39832
39674
|
});
|
|
39675
|
+
function measureTextBounds(attribute) {
|
|
39676
|
+
utilTextMark.setAttributes(attribute);
|
|
39677
|
+
return utilTextMark.AABBBounds;
|
|
39678
|
+
}
|
|
39679
|
+
|
|
39833
39680
|
const utilRichTextMark = new RichText({
|
|
39834
39681
|
width: 0,
|
|
39835
39682
|
height: 0,
|
|
@@ -39946,11 +39793,16 @@
|
|
|
39946
39793
|
}
|
|
39947
39794
|
if (table.heightMode === 'adaptive') {
|
|
39948
39795
|
table._clearRowRangeHeightsMap();
|
|
39949
|
-
|
|
39950
|
-
|
|
39951
|
-
|
|
39952
|
-
|
|
39953
|
-
|
|
39796
|
+
let totalDrawHeight = table.tableNoFrameHeight;
|
|
39797
|
+
let startRow = 0;
|
|
39798
|
+
let endRow = table.rowCount;
|
|
39799
|
+
if (table.heightAdaptiveMode === 'only-body') {
|
|
39800
|
+
const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);
|
|
39801
|
+
const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;
|
|
39802
|
+
totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;
|
|
39803
|
+
startRow = table.columnHeaderLevelCount;
|
|
39804
|
+
endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;
|
|
39805
|
+
}
|
|
39954
39806
|
let actualHeight = 0;
|
|
39955
39807
|
for (let row = startRow; row < endRow; row++) {
|
|
39956
39808
|
actualHeight += update ? newHeights[row] : table.getRowHeight(row);
|
|
@@ -40343,7 +40195,7 @@
|
|
|
40343
40195
|
spaceBetweenTextAndIcon
|
|
40344
40196
|
});
|
|
40345
40197
|
utilCheckBoxMark.render();
|
|
40346
|
-
maxHeight =
|
|
40198
|
+
maxHeight = utilCheckBoxMark.AABBBounds.height();
|
|
40347
40199
|
}
|
|
40348
40200
|
else {
|
|
40349
40201
|
maxHeight = Math.max(size, lines.length * lineHeight);
|
|
@@ -40390,7 +40242,7 @@
|
|
|
40390
40242
|
else if (autoWrapText) {
|
|
40391
40243
|
const hierarchyOffset = getHierarchyOffset(col, row, table);
|
|
40392
40244
|
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - hierarchyOffset;
|
|
40393
|
-
|
|
40245
|
+
const bounds = measureTextBounds({
|
|
40394
40246
|
maxLineWidth,
|
|
40395
40247
|
text: lines,
|
|
40396
40248
|
fontSize,
|
|
@@ -40401,7 +40253,7 @@
|
|
|
40401
40253
|
wordBreak: 'break-word',
|
|
40402
40254
|
whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
|
|
40403
40255
|
});
|
|
40404
|
-
maxHeight =
|
|
40256
|
+
maxHeight = bounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
|
|
40405
40257
|
}
|
|
40406
40258
|
else {
|
|
40407
40259
|
maxHeight = lines.length * lineHeight;
|
|
@@ -40563,7 +40415,7 @@
|
|
|
40563
40415
|
width = scene.table.getColsWidth(cell.mergeStartCol, cell.mergeEndCol);
|
|
40564
40416
|
height = scene.table.getRowsHeight(cell.mergeStartRow, cell.mergeEndRow);
|
|
40565
40417
|
}
|
|
40566
|
-
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.
|
|
40418
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.isAutoRowHeight(row), padding, scene.table);
|
|
40567
40419
|
customElementsGroup = customResult.elementsGroup;
|
|
40568
40420
|
renderDefault = customResult.renderDefault;
|
|
40569
40421
|
}
|
|
@@ -40575,7 +40427,7 @@
|
|
|
40575
40427
|
}
|
|
40576
40428
|
}
|
|
40577
40429
|
}
|
|
40578
|
-
updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.
|
|
40430
|
+
updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.isAutoRowHeight(row), renderDefault, scene.table);
|
|
40579
40431
|
}
|
|
40580
40432
|
}
|
|
40581
40433
|
function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, renderDefault, table) {
|
|
@@ -40627,30 +40479,29 @@
|
|
|
40627
40479
|
if (!skipTableWidthMap) {
|
|
40628
40480
|
scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);
|
|
40629
40481
|
}
|
|
40630
|
-
const autoRowHeight = scene.table.heightMode === 'autoHeight';
|
|
40631
40482
|
const colOrCornerHeaderColumn = scene.getColGroup(col, true);
|
|
40632
40483
|
const rightTopColumn = scene.getColGroupInRightTopCorner(col);
|
|
40633
40484
|
if (colOrCornerHeaderColumn && !rightTopColumn) {
|
|
40634
|
-
updateColunmWidth(colOrCornerHeaderColumn, detaX,
|
|
40485
|
+
updateColunmWidth(colOrCornerHeaderColumn, detaX, 'col-corner', scene);
|
|
40635
40486
|
}
|
|
40636
40487
|
if (rightTopColumn) {
|
|
40637
|
-
updateColunmWidth(rightTopColumn, detaX,
|
|
40488
|
+
updateColunmWidth(rightTopColumn, detaX, 'right-top', scene);
|
|
40638
40489
|
}
|
|
40639
40490
|
const rowHeaderOrBodyColumn = scene.getColGroup(col);
|
|
40640
40491
|
if (rowHeaderOrBodyColumn) {
|
|
40641
|
-
updateColunmWidth(rowHeaderOrBodyColumn, detaX,
|
|
40492
|
+
updateColunmWidth(rowHeaderOrBodyColumn, detaX, 'row-body', scene);
|
|
40642
40493
|
}
|
|
40643
40494
|
const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);
|
|
40644
40495
|
if (leftBottomColumn) {
|
|
40645
|
-
updateColunmWidth(leftBottomColumn, detaX,
|
|
40496
|
+
updateColunmWidth(leftBottomColumn, detaX, 'left-bottom', scene);
|
|
40646
40497
|
}
|
|
40647
40498
|
const bottomColumn = scene.getColGroupInBottom(col);
|
|
40648
40499
|
if (bottomColumn) {
|
|
40649
|
-
updateColunmWidth(bottomColumn, detaX,
|
|
40500
|
+
updateColunmWidth(bottomColumn, detaX, 'bottom', scene);
|
|
40650
40501
|
}
|
|
40651
40502
|
const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);
|
|
40652
40503
|
if (rightBottomColumn) {
|
|
40653
|
-
updateColunmWidth(rightBottomColumn, detaX,
|
|
40504
|
+
updateColunmWidth(rightBottomColumn, detaX, 'right-bottom', scene);
|
|
40654
40505
|
}
|
|
40655
40506
|
if (col < scene.frozenColCount) {
|
|
40656
40507
|
scene.cornerHeaderGroup.forEachChildrenSkipChild((column, index) => {
|
|
@@ -40698,12 +40549,12 @@
|
|
|
40698
40549
|
});
|
|
40699
40550
|
}
|
|
40700
40551
|
}
|
|
40701
|
-
function updateColunmWidth(columnGroup, detaX,
|
|
40552
|
+
function updateColunmWidth(columnGroup, detaX, mode, scene) {
|
|
40702
40553
|
let needRerangeRow = false;
|
|
40703
40554
|
const oldColumnWidth = columnGroup?.attribute.width ?? 0;
|
|
40704
40555
|
columnGroup?.setAttribute('width', oldColumnWidth + detaX);
|
|
40705
40556
|
columnGroup?.forEachChildren((cell, index) => {
|
|
40706
|
-
const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, oldColumnWidth + detaX, detaX, mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,
|
|
40557
|
+
const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, oldColumnWidth + detaX, detaX, mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true, scene.table.internalProps.autoWrapText);
|
|
40707
40558
|
if (isHeightChange) {
|
|
40708
40559
|
const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
|
|
40709
40560
|
if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
|
|
@@ -40790,7 +40641,7 @@
|
|
|
40790
40641
|
}
|
|
40791
40642
|
}
|
|
40792
40643
|
}
|
|
40793
|
-
function updateCellWidth(scene, cell, col, row, oldWidth, distWidth, detaX, isHeader,
|
|
40644
|
+
function updateCellWidth(scene, cell, col, row, oldWidth, distWidth, detaX, isHeader, autoWrapText) {
|
|
40794
40645
|
if (cell.attribute.width === distWidth && !cell.needUpdateWidth) {
|
|
40795
40646
|
return false;
|
|
40796
40647
|
}
|
|
@@ -40800,6 +40651,7 @@
|
|
|
40800
40651
|
if (!cellGroup) {
|
|
40801
40652
|
return false;
|
|
40802
40653
|
}
|
|
40654
|
+
const autoRowHeight = scene.table.isAutoRowHeight(row);
|
|
40803
40655
|
const type = scene.table.isHeader(col, row)
|
|
40804
40656
|
? scene.table._getHeaderLayoutMap(col, row).headerType
|
|
40805
40657
|
: scene.table.getBodyColumnType(col, row);
|
|
@@ -40870,7 +40722,7 @@
|
|
|
40870
40722
|
width = scene.table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol);
|
|
40871
40723
|
height = scene.table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow);
|
|
40872
40724
|
}
|
|
40873
|
-
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.
|
|
40725
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.isAutoRowHeight(row), padding, scene.table);
|
|
40874
40726
|
customElementsGroup = customResult.elementsGroup;
|
|
40875
40727
|
renderDefault = customResult.renderDefault;
|
|
40876
40728
|
isHeightChange = true;
|
|
@@ -41644,7 +41496,10 @@
|
|
|
41644
41496
|
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
41645
41497
|
let attrY = 0;
|
|
41646
41498
|
if (this.table.theme.scrollStyle.barToSide) {
|
|
41647
|
-
attrY =
|
|
41499
|
+
attrY =
|
|
41500
|
+
this.table.tableNoFrameHeight -
|
|
41501
|
+
(hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) +
|
|
41502
|
+
this.table.tableY;
|
|
41648
41503
|
}
|
|
41649
41504
|
else {
|
|
41650
41505
|
attrY = y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
|
|
@@ -41679,7 +41534,10 @@
|
|
|
41679
41534
|
let attrX = 0;
|
|
41680
41535
|
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
41681
41536
|
if (this.table.theme.scrollStyle.barToSide) {
|
|
41682
|
-
attrX =
|
|
41537
|
+
attrX =
|
|
41538
|
+
this.table.tableNoFrameWidth -
|
|
41539
|
+
(hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x) +
|
|
41540
|
+
this.table.tableX;
|
|
41683
41541
|
}
|
|
41684
41542
|
else {
|
|
41685
41543
|
attrX = x - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x);
|
|
@@ -42295,7 +42153,7 @@
|
|
|
42295
42153
|
const endY = startY + cacheCanvasSizeLimit > viewHeight ? viewHeight : startY + cacheCanvasSizeLimit;
|
|
42296
42154
|
const width = endX - startX;
|
|
42297
42155
|
const height = endY - startY;
|
|
42298
|
-
const bounds = new Bounds
|
|
42156
|
+
const bounds = new Bounds();
|
|
42299
42157
|
bounds.setValue(startX, startY, endX, endY);
|
|
42300
42158
|
const canvas = stage.toCanvas(false, bounds);
|
|
42301
42159
|
cacheCanvas.push({
|
|
@@ -43247,153 +43105,6 @@
|
|
|
43247
43105
|
}
|
|
43248
43106
|
}
|
|
43249
43107
|
|
|
43250
|
-
let customAlphabetCharSet = '';
|
|
43251
|
-
let textMeasureMode = 'quick';
|
|
43252
|
-
const textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
43253
|
-
if (isBound(TextMeasureContribution)) {
|
|
43254
|
-
rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
|
|
43255
|
-
}
|
|
43256
|
-
else {
|
|
43257
|
-
bind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
|
|
43258
|
-
}
|
|
43259
|
-
});
|
|
43260
|
-
const restoreTextMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
43261
|
-
if (isBound(TextMeasureContribution)) {
|
|
43262
|
-
rebind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
|
|
43263
|
-
}
|
|
43264
|
-
else {
|
|
43265
|
-
bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
|
|
43266
|
-
}
|
|
43267
|
-
});
|
|
43268
|
-
const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
|
|
43269
|
-
return new TextMeasure$1({
|
|
43270
|
-
defaultFontParams: {
|
|
43271
|
-
fontFamily: DefaultTextStyle.fontFamily,
|
|
43272
|
-
fontSize: DefaultTextStyle.fontSize
|
|
43273
|
-
},
|
|
43274
|
-
getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
|
|
43275
|
-
specialCharSet: `{}()//&-/: .,@%'"~…=${TextMeasure$1.ALPHABET_CHAR_SET}${TextMeasure$1.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,
|
|
43276
|
-
...(option ?? {})
|
|
43277
|
-
}, textSpec);
|
|
43278
|
-
};
|
|
43279
|
-
const fastTextMeasureCache = new Map();
|
|
43280
|
-
function getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle = 'normal') {
|
|
43281
|
-
const key = `${fontSize}-${fontWeight}-${fontFamily}-${fontStyle}`;
|
|
43282
|
-
const cache = fastTextMeasureCache.get(key);
|
|
43283
|
-
if (cache) {
|
|
43284
|
-
return cache;
|
|
43285
|
-
}
|
|
43286
|
-
const fastTextMeasure = initTextMeasure({
|
|
43287
|
-
fontSize,
|
|
43288
|
-
fontFamily,
|
|
43289
|
-
fontWeight,
|
|
43290
|
-
fontStyle
|
|
43291
|
-
});
|
|
43292
|
-
fastTextMeasureCache.set(key, fastTextMeasure);
|
|
43293
|
-
return fastTextMeasure;
|
|
43294
|
-
}
|
|
43295
|
-
class FastTextMeasureContribution extends DefaultTextMeasureContribution {
|
|
43296
|
-
measureTextWidth(text, options) {
|
|
43297
|
-
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43298
|
-
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43299
|
-
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43300
|
-
return textMeasure.width;
|
|
43301
|
-
}
|
|
43302
|
-
measureText(text, options) {
|
|
43303
|
-
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43304
|
-
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43305
|
-
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43306
|
-
return textMeasure;
|
|
43307
|
-
}
|
|
43308
|
-
}
|
|
43309
|
-
class TextMeasureTool {
|
|
43310
|
-
measureText(text, options) {
|
|
43311
|
-
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43312
|
-
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43313
|
-
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43314
|
-
return textMeasure;
|
|
43315
|
-
}
|
|
43316
|
-
measureTextWidth(text, options) {
|
|
43317
|
-
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43318
|
-
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43319
|
-
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43320
|
-
return textMeasure.width;
|
|
43321
|
-
}
|
|
43322
|
-
clipText(text, options, width) {
|
|
43323
|
-
if (text.length === 0) {
|
|
43324
|
-
return { str: '', width: 0 };
|
|
43325
|
-
}
|
|
43326
|
-
let length = this.measureTextWidth(text, options);
|
|
43327
|
-
if (length <= width) {
|
|
43328
|
-
return { str: text, width: length };
|
|
43329
|
-
}
|
|
43330
|
-
length = this.measureTextWidth(text[0], options);
|
|
43331
|
-
if (length > width) {
|
|
43332
|
-
return { str: '', width: 0 };
|
|
43333
|
-
}
|
|
43334
|
-
return this._clipText(text, options, width, 0, text.length - 1);
|
|
43335
|
-
}
|
|
43336
|
-
_clipText(text, options, width, leftIdx, rightIdx) {
|
|
43337
|
-
const middleIdx = Math.floor((leftIdx + rightIdx) / 2);
|
|
43338
|
-
const subText = text.substring(0, middleIdx + 1);
|
|
43339
|
-
const strWidth = this.measureTextWidth(subText, options);
|
|
43340
|
-
let length;
|
|
43341
|
-
if (strWidth > width) {
|
|
43342
|
-
if (subText.length <= 1) {
|
|
43343
|
-
return { str: '', width: 0 };
|
|
43344
|
-
}
|
|
43345
|
-
const str = text.substring(0, middleIdx);
|
|
43346
|
-
length = this.measureTextWidth(str, options);
|
|
43347
|
-
if (length <= width) {
|
|
43348
|
-
return { str, width: length };
|
|
43349
|
-
}
|
|
43350
|
-
return this._clipText(text, options, width, leftIdx, middleIdx);
|
|
43351
|
-
}
|
|
43352
|
-
else if (strWidth < width) {
|
|
43353
|
-
if (middleIdx >= text.length - 1) {
|
|
43354
|
-
return { str: text, width: this.measureTextWidth(text, options) };
|
|
43355
|
-
}
|
|
43356
|
-
const str = text.substring(0, middleIdx + 2);
|
|
43357
|
-
length = this.measureTextWidth(str, options);
|
|
43358
|
-
if (length >= width) {
|
|
43359
|
-
return { str: subText, width: strWidth };
|
|
43360
|
-
}
|
|
43361
|
-
return this._clipText(text, options, width, middleIdx, rightIdx);
|
|
43362
|
-
}
|
|
43363
|
-
return { str: subText, width: strWidth };
|
|
43364
|
-
}
|
|
43365
|
-
clipTextWithSuffix(text, options, width, suffix) {
|
|
43366
|
-
if (suffix === '') {
|
|
43367
|
-
return this.clipText(text, options, width);
|
|
43368
|
-
}
|
|
43369
|
-
if (text.length === 0) {
|
|
43370
|
-
return { str: '', width: 0 };
|
|
43371
|
-
}
|
|
43372
|
-
const length = this.measureTextWidth(text, options);
|
|
43373
|
-
if (length <= width) {
|
|
43374
|
-
return { str: text, width: length };
|
|
43375
|
-
}
|
|
43376
|
-
const suffixWidth = this.measureTextWidth(suffix, options);
|
|
43377
|
-
if (suffixWidth > width) {
|
|
43378
|
-
return { str: '', width: 0 };
|
|
43379
|
-
}
|
|
43380
|
-
width -= suffixWidth;
|
|
43381
|
-
const data = this._clipText(text, options, width, 0, text.length - 1);
|
|
43382
|
-
data.str += suffix;
|
|
43383
|
-
data.width += suffixWidth;
|
|
43384
|
-
return data;
|
|
43385
|
-
}
|
|
43386
|
-
}
|
|
43387
|
-
const textMeasure = new TextMeasureTool();
|
|
43388
|
-
function setCustomAlphabetCharSet(str) {
|
|
43389
|
-
customAlphabetCharSet = str;
|
|
43390
|
-
fastTextMeasureCache.clear();
|
|
43391
|
-
}
|
|
43392
|
-
function restoreMeasureText() {
|
|
43393
|
-
textMeasureMode = 'canvas';
|
|
43394
|
-
container.load(restoreTextMeasureModule);
|
|
43395
|
-
}
|
|
43396
|
-
|
|
43397
43108
|
let SuffixTextBeforeRenderContribution = class SuffixTextBeforeRenderContribution {
|
|
43398
43109
|
time = BaseRenderContributionTime.afterFillStroke;
|
|
43399
43110
|
useStyle = true;
|
|
@@ -43416,7 +43127,7 @@
|
|
|
43416
43127
|
if (!isEmpty) {
|
|
43417
43128
|
return;
|
|
43418
43129
|
}
|
|
43419
|
-
const textStr = isString$
|
|
43130
|
+
const textStr = isString$2(ellipsis) ? ellipsis : '...';
|
|
43420
43131
|
const lineHeight = calculateLineHeight(text.attribute.lineHeight, fontSize) ?? fontSize;
|
|
43421
43132
|
let dy = 0;
|
|
43422
43133
|
if (lineHeight !== fontSize) {
|
|
@@ -43588,15 +43299,19 @@
|
|
|
43588
43299
|
table._clearColRangeWidthsMap();
|
|
43589
43300
|
const canvasWidth = table.tableNoFrameWidth;
|
|
43590
43301
|
let actualHeaderWidth = 0;
|
|
43591
|
-
|
|
43592
|
-
|
|
43593
|
-
|
|
43594
|
-
|
|
43595
|
-
|
|
43302
|
+
let startCol = 0;
|
|
43303
|
+
let endCol = table.colCount;
|
|
43304
|
+
if (table.widthAdaptiveMode === 'only-body') {
|
|
43305
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
43306
|
+
const colWidth = update ? newWidths[col] : table.getColWidth(col);
|
|
43307
|
+
if (col < table.rowHeaderLevelCount ||
|
|
43308
|
+
(table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {
|
|
43309
|
+
actualHeaderWidth += colWidth;
|
|
43310
|
+
}
|
|
43596
43311
|
}
|
|
43312
|
+
startCol = table.rowHeaderLevelCount;
|
|
43313
|
+
endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
|
|
43597
43314
|
}
|
|
43598
|
-
const startCol = table.rowHeaderLevelCount;
|
|
43599
|
-
const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
|
|
43600
43315
|
getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
|
|
43601
43316
|
}
|
|
43602
43317
|
else if (table.autoFillWidth) {
|
|
@@ -43980,7 +43695,7 @@
|
|
|
43980
43695
|
value = customMergeText;
|
|
43981
43696
|
customStyle = customMergeStyle;
|
|
43982
43697
|
if (customLayout || customRender) {
|
|
43983
|
-
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.
|
|
43698
|
+
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], table);
|
|
43984
43699
|
}
|
|
43985
43700
|
}
|
|
43986
43701
|
}
|
|
@@ -44501,14 +44216,18 @@
|
|
|
44501
44216
|
else if (part) {
|
|
44502
44217
|
const baseCellGroup = table.scenegraph.highPerformanceGetCell(col, rowEnd + 1, true);
|
|
44503
44218
|
y = baseCellGroup.attribute.y;
|
|
44504
|
-
|
|
44505
|
-
|
|
44219
|
+
if (isValid$3(y)) {
|
|
44220
|
+
for (let r = rowStart; r <= rowEnd; r++) {
|
|
44221
|
+
y -= table.getRowHeight(r);
|
|
44222
|
+
}
|
|
44506
44223
|
}
|
|
44507
44224
|
}
|
|
44508
44225
|
else {
|
|
44509
44226
|
y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);
|
|
44510
44227
|
}
|
|
44511
|
-
|
|
44228
|
+
if (isValid$3(y)) {
|
|
44229
|
+
cellGroup.setAttribute('y', y);
|
|
44230
|
+
}
|
|
44512
44231
|
}
|
|
44513
44232
|
}
|
|
44514
44233
|
}
|
|
@@ -44874,6 +44593,269 @@
|
|
|
44874
44593
|
await proxy.progress();
|
|
44875
44594
|
}
|
|
44876
44595
|
|
|
44596
|
+
function handleTextStick(table) {
|
|
44597
|
+
const { changedCells } = table.internalProps.stick;
|
|
44598
|
+
changedCells.forEach((cellPos) => {
|
|
44599
|
+
const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);
|
|
44600
|
+
cellGroup.forEachChildren((child) => {
|
|
44601
|
+
child.setAttributes({
|
|
44602
|
+
dx: cellPos.dx,
|
|
44603
|
+
dy: cellPos.dy
|
|
44604
|
+
});
|
|
44605
|
+
});
|
|
44606
|
+
});
|
|
44607
|
+
changedCells.clear();
|
|
44608
|
+
const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
|
|
44609
|
+
const frozenRowsHeight = table.getFrozenRowsHeight();
|
|
44610
|
+
const frozenColsWidth = table.getFrozenColsWidth();
|
|
44611
|
+
const { row: rowTop } = table.getRowAt(scrollTop + frozenRowsHeight + 1);
|
|
44612
|
+
const { col: colLeft } = table.getColAt(scrollLeft + frozenColsWidth + 1);
|
|
44613
|
+
const rowStart = Math.max(rowTop, table.frozenRowCount);
|
|
44614
|
+
const colStart = Math.max(colLeft, table.frozenColCount);
|
|
44615
|
+
const rowEnd = table.getAllRowsHeight() > table.tableNoFrameHeight
|
|
44616
|
+
? table.getRowAt(scrollTop + table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() - 1).row
|
|
44617
|
+
: table.rowCount - table.bottomFrozenRowCount - 1;
|
|
44618
|
+
const colEnd = table.getAllColsWidth() > table.tableNoFrameWidth
|
|
44619
|
+
? table.getColAt(scrollLeft + table.tableNoFrameWidth - table.getRightFrozenColsWidth() - 1).col
|
|
44620
|
+
: table.colCount - table.rightFrozenColCount - 1;
|
|
44621
|
+
if (colEnd < 0 || rowEnd < 0) {
|
|
44622
|
+
return;
|
|
44623
|
+
}
|
|
44624
|
+
for (let row = 0; row < frozenRowCount; row++) {
|
|
44625
|
+
if (colEnd < colStart) {
|
|
44626
|
+
break;
|
|
44627
|
+
}
|
|
44628
|
+
[colStart, colEnd].forEach((col) => {
|
|
44629
|
+
const style = table._getCellStyle(col, row);
|
|
44630
|
+
if (style?.textStick) {
|
|
44631
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
44632
|
+
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
44633
|
+
}
|
|
44634
|
+
});
|
|
44635
|
+
}
|
|
44636
|
+
for (let col = 0; col < frozenColCount; col++) {
|
|
44637
|
+
if (rowEnd < rowStart) {
|
|
44638
|
+
break;
|
|
44639
|
+
}
|
|
44640
|
+
[rowStart, rowEnd].forEach((row) => {
|
|
44641
|
+
const style = table._getCellStyle(col, row);
|
|
44642
|
+
if (style?.textStick && table.internalProps.layoutMap.rowHierarchyType !== 'tree') {
|
|
44643
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
44644
|
+
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
44645
|
+
}
|
|
44646
|
+
});
|
|
44647
|
+
}
|
|
44648
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
44649
|
+
if (rowEnd < rowStart) {
|
|
44650
|
+
break;
|
|
44651
|
+
}
|
|
44652
|
+
[rowStart, rowEnd].forEach((row) => {
|
|
44653
|
+
const style = table._getCellStyle(col, row);
|
|
44654
|
+
if (style?.textStick) {
|
|
44655
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
44656
|
+
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
44657
|
+
}
|
|
44658
|
+
});
|
|
44659
|
+
}
|
|
44660
|
+
for (let row = rowStart; row < rowEnd; row++) {
|
|
44661
|
+
if (colEnd < colStart) {
|
|
44662
|
+
break;
|
|
44663
|
+
}
|
|
44664
|
+
[colStart, colEnd].forEach((col) => {
|
|
44665
|
+
const style = table._getCellStyle(col, row);
|
|
44666
|
+
if (table._getCellStyle(col, row)?.textStick) {
|
|
44667
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
44668
|
+
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
44669
|
+
}
|
|
44670
|
+
});
|
|
44671
|
+
}
|
|
44672
|
+
}
|
|
44673
|
+
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table) {
|
|
44674
|
+
if (isNumber$4(cellGroup.mergeStartCol) &&
|
|
44675
|
+
isNumber$4(cellGroup.mergeStartRow) &&
|
|
44676
|
+
isNumber$4(cellGroup.mergeEndCol) &&
|
|
44677
|
+
isNumber$4(cellGroup.mergeEndRow)) {
|
|
44678
|
+
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
44679
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
44680
|
+
for (let row = rowStart; row <= rowEnd; row++) {
|
|
44681
|
+
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
44682
|
+
dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
44683
|
+
}
|
|
44684
|
+
}
|
|
44685
|
+
}
|
|
44686
|
+
else {
|
|
44687
|
+
dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
44688
|
+
}
|
|
44689
|
+
}
|
|
44690
|
+
function dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign) {
|
|
44691
|
+
const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
|
|
44692
|
+
if (!graphic) {
|
|
44693
|
+
return;
|
|
44694
|
+
}
|
|
44695
|
+
if (graphic.type === 'image') {
|
|
44696
|
+
const { image: url } = graphic.attribute;
|
|
44697
|
+
if (!url || !graphic.resources) {
|
|
44698
|
+
return;
|
|
44699
|
+
}
|
|
44700
|
+
const res = graphic.resources.get(url);
|
|
44701
|
+
if (res.state !== 'success') {
|
|
44702
|
+
return;
|
|
44703
|
+
}
|
|
44704
|
+
}
|
|
44705
|
+
const textBaseline = graphic.textBaseline ?? 'top';
|
|
44706
|
+
graphic.AABBBounds.width();
|
|
44707
|
+
const textTop = graphic.globalAABBBounds.y1;
|
|
44708
|
+
const textBottom = graphic.globalAABBBounds.y2;
|
|
44709
|
+
if (textBaseline === 'middle' && textStickBaseOnAlign) {
|
|
44710
|
+
const cellTop = cellGroup.globalAABBBounds.y1 + (cellGroup.firstChild?.attribute.dy ?? 0);
|
|
44711
|
+
const cellBottom = cellTop + (cellGroup.contentHeight ?? cellGroup.attribute.height ?? 0);
|
|
44712
|
+
if (cellTop < minTop || cellBottom > maxTop) {
|
|
44713
|
+
const visibleCellTop = Math.max(cellTop, minTop);
|
|
44714
|
+
const visibleCellBottom = Math.min(cellBottom, maxTop);
|
|
44715
|
+
const delta = graphic.globalTransMatrix.f - (visibleCellBottom + visibleCellTop) / 2;
|
|
44716
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
44717
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
44718
|
+
col: cellGroup.col,
|
|
44719
|
+
row: cellGroup.row,
|
|
44720
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
44721
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
44722
|
+
});
|
|
44723
|
+
cellGroup.forEachChildren((child) => {
|
|
44724
|
+
child.setAttribute('dy', (child.attribute.dy ?? 0) - delta + 2);
|
|
44725
|
+
});
|
|
44726
|
+
}
|
|
44727
|
+
}
|
|
44728
|
+
else if (textTop < minTop) {
|
|
44729
|
+
const deltaHeight = textTop - minTop;
|
|
44730
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
44731
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
44732
|
+
col: cellGroup.col,
|
|
44733
|
+
row: cellGroup.row,
|
|
44734
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
44735
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
44736
|
+
});
|
|
44737
|
+
cellGroup.forEachChildren((child) => {
|
|
44738
|
+
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
|
|
44739
|
+
});
|
|
44740
|
+
}
|
|
44741
|
+
else if (textBottom > maxTop) {
|
|
44742
|
+
const deltaHeight = textBottom - maxTop;
|
|
44743
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
44744
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
44745
|
+
col: cellGroup.col,
|
|
44746
|
+
row: cellGroup.row,
|
|
44747
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
44748
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
44749
|
+
});
|
|
44750
|
+
cellGroup.forEachChildren((child) => {
|
|
44751
|
+
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
|
|
44752
|
+
});
|
|
44753
|
+
}
|
|
44754
|
+
}
|
|
44755
|
+
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table) {
|
|
44756
|
+
if (isNumber$4(cellGroup.mergeStartCol) &&
|
|
44757
|
+
isNumber$4(cellGroup.mergeStartRow) &&
|
|
44758
|
+
isNumber$4(cellGroup.mergeEndCol) &&
|
|
44759
|
+
isNumber$4(cellGroup.mergeEndRow)) {
|
|
44760
|
+
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
44761
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
44762
|
+
for (let row = rowStart; row <= rowEnd; row++) {
|
|
44763
|
+
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
44764
|
+
dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
|
|
44765
|
+
}
|
|
44766
|
+
}
|
|
44767
|
+
}
|
|
44768
|
+
else {
|
|
44769
|
+
dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
|
|
44770
|
+
}
|
|
44771
|
+
}
|
|
44772
|
+
function dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign) {
|
|
44773
|
+
const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
|
|
44774
|
+
if (!graphic) {
|
|
44775
|
+
return;
|
|
44776
|
+
}
|
|
44777
|
+
if (graphic.type === 'image') {
|
|
44778
|
+
const { image: url } = graphic.attribute;
|
|
44779
|
+
if (!url || !graphic.resources) {
|
|
44780
|
+
return;
|
|
44781
|
+
}
|
|
44782
|
+
const res = graphic.resources.get(url);
|
|
44783
|
+
if (res.state !== 'success') {
|
|
44784
|
+
return;
|
|
44785
|
+
}
|
|
44786
|
+
}
|
|
44787
|
+
const textAlign = graphic.attribute.textAlign ?? graphic.textAlign ?? 'left';
|
|
44788
|
+
graphic.AABBBounds.width();
|
|
44789
|
+
const textLeft = graphic.globalAABBBounds.x1;
|
|
44790
|
+
const textRight = graphic.globalAABBBounds.x2;
|
|
44791
|
+
if (textAlign === 'center' && textStickBaseOnAlign) {
|
|
44792
|
+
const cellLeft = cellGroup.globalAABBBounds.x1 + (cellGroup.firstChild?.attribute.dx ?? 0);
|
|
44793
|
+
const cellRight = cellLeft + (cellGroup.contentWidth ?? cellGroup.attribute.width ?? 0);
|
|
44794
|
+
if (cellLeft < minLeft || cellRight > maxLeft) {
|
|
44795
|
+
const visibleCellLeft = Math.max(cellLeft, minLeft);
|
|
44796
|
+
const visibleCellRight = Math.min(cellRight, maxLeft);
|
|
44797
|
+
const delta = graphic.globalTransMatrix.e - (visibleCellRight + visibleCellLeft) / 2;
|
|
44798
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
44799
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
44800
|
+
col: cellGroup.col,
|
|
44801
|
+
row: cellGroup.row,
|
|
44802
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
44803
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
44804
|
+
});
|
|
44805
|
+
cellGroup.forEachChildren((child) => {
|
|
44806
|
+
child.setAttribute('dx', (child.attribute.dx ?? 0) - delta + 2);
|
|
44807
|
+
});
|
|
44808
|
+
}
|
|
44809
|
+
}
|
|
44810
|
+
else if (textLeft < minLeft) {
|
|
44811
|
+
const deltaWidth = textLeft - minLeft;
|
|
44812
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
44813
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
44814
|
+
col: cellGroup.col,
|
|
44815
|
+
row: cellGroup.row,
|
|
44816
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
44817
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
44818
|
+
});
|
|
44819
|
+
cellGroup.forEachChildren((child) => {
|
|
44820
|
+
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
|
|
44821
|
+
});
|
|
44822
|
+
}
|
|
44823
|
+
else if (textRight > maxLeft) {
|
|
44824
|
+
const deltaWidth = textRight - maxLeft;
|
|
44825
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
44826
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
44827
|
+
col: cellGroup.col,
|
|
44828
|
+
row: cellGroup.row,
|
|
44829
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
44830
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
44831
|
+
});
|
|
44832
|
+
cellGroup.forEachChildren((child) => {
|
|
44833
|
+
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
|
|
44834
|
+
});
|
|
44835
|
+
}
|
|
44836
|
+
}
|
|
44837
|
+
function checkHaveTextStick(table) {
|
|
44838
|
+
const headerObjects = table.internalProps.layoutMap.headerObjects;
|
|
44839
|
+
const columnObjects = table.internalProps.layoutMap.columnObjects;
|
|
44840
|
+
for (let i = 0; i < headerObjects.length; i++) {
|
|
44841
|
+
const header = headerObjects[i];
|
|
44842
|
+
if (header && header.style?.textStick) {
|
|
44843
|
+
return true;
|
|
44844
|
+
}
|
|
44845
|
+
}
|
|
44846
|
+
for (let i = 0; i < columnObjects.length; i++) {
|
|
44847
|
+
const column = columnObjects[i];
|
|
44848
|
+
if (column && column.style?.textStick) {
|
|
44849
|
+
return true;
|
|
44850
|
+
}
|
|
44851
|
+
}
|
|
44852
|
+
const themeStick = table.theme.headerStyle.textStick || table.theme.rowHeaderStyle.textStick || table.theme.bodyStyle.textStick;
|
|
44853
|
+
if (themeStick) {
|
|
44854
|
+
return true;
|
|
44855
|
+
}
|
|
44856
|
+
return false;
|
|
44857
|
+
}
|
|
44858
|
+
|
|
44877
44859
|
class SceneProxy {
|
|
44878
44860
|
table;
|
|
44879
44861
|
isRelease = false;
|
|
@@ -45019,6 +45001,8 @@
|
|
|
45019
45001
|
await this.createRow();
|
|
45020
45002
|
await this.progress();
|
|
45021
45003
|
}
|
|
45004
|
+
handleTextStick(this.table);
|
|
45005
|
+
this.table.scenegraph.updateNextFrame();
|
|
45022
45006
|
resolve();
|
|
45023
45007
|
}, 16);
|
|
45024
45008
|
});
|
|
@@ -45984,6 +45968,24 @@
|
|
|
45984
45968
|
const removeRows = deduplication$1(removeCells.map(cell => cell.row)).sort((a, b) => b - a);
|
|
45985
45969
|
const addRows = deduplication$1(addCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
45986
45970
|
const updateRows = deduplication$1(updateCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
45971
|
+
let rowUpdatePos;
|
|
45972
|
+
if (updateRows.length) {
|
|
45973
|
+
const beforeRow = updateRows[0] - 1;
|
|
45974
|
+
const afterRow = updateRows[updateRows.length - 1] + 1;
|
|
45975
|
+
rowUpdatePos = _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene);
|
|
45976
|
+
}
|
|
45977
|
+
if (addRows.length) {
|
|
45978
|
+
const beforeRow = addRows[0] - 1;
|
|
45979
|
+
const afterRow = addRows[addRows.length - 1] + 1;
|
|
45980
|
+
const pos = _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene);
|
|
45981
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45982
|
+
}
|
|
45983
|
+
if (removeRows.length) {
|
|
45984
|
+
const beforeRow = removeRows[0] - 1;
|
|
45985
|
+
const afterRow = removeRows[removeRows.length - 1] + 1;
|
|
45986
|
+
const pos = _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene);
|
|
45987
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45988
|
+
}
|
|
45987
45989
|
removeRows.forEach(row => {
|
|
45988
45990
|
removeRow(row, scene);
|
|
45989
45991
|
});
|
|
@@ -45995,8 +45997,8 @@
|
|
|
45995
45997
|
resetRowNumber(scene);
|
|
45996
45998
|
const beforeRow = removeRows[removeRows.length - 1] - 1;
|
|
45997
45999
|
const afterRow = removeRows[0] - removeRows.length + 1;
|
|
45998
|
-
const
|
|
45999
|
-
|
|
46000
|
+
const pos = _getUpdateRowIndex(beforeRow, afterRow, scene);
|
|
46001
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
46000
46002
|
}
|
|
46001
46003
|
scene.table._clearRowRangeHeightsMap();
|
|
46002
46004
|
let updateAfter;
|
|
@@ -46009,8 +46011,8 @@
|
|
|
46009
46011
|
if (addRows.length) {
|
|
46010
46012
|
const beforeRow = addRows[0] - 1;
|
|
46011
46013
|
const afterRow = addRows[addRows.length - 1] + 1;
|
|
46012
|
-
const
|
|
46013
|
-
|
|
46014
|
+
const pos = _getUpdateRowIndex(beforeRow, afterRow, scene);
|
|
46015
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
46014
46016
|
}
|
|
46015
46017
|
for (let col = 0; col < table.colCount; col++) {
|
|
46016
46018
|
updateRows.forEach(r => {
|
|
@@ -46030,8 +46032,8 @@
|
|
|
46030
46032
|
if (updateRows.length) {
|
|
46031
46033
|
const beforeRow = updateRows[0] - 1;
|
|
46032
46034
|
const afterRow = updateRows[updateRows.length - 1] + 1;
|
|
46033
|
-
const
|
|
46034
|
-
|
|
46035
|
+
const pos = _getUpdateRowIndex(beforeRow, afterRow, scene);
|
|
46036
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
46035
46037
|
}
|
|
46036
46038
|
if (isNumber$4(updateAfter)) {
|
|
46037
46039
|
for (let col = 0; col < table.colCount; col++) {
|
|
@@ -46040,8 +46042,13 @@
|
|
|
46040
46042
|
cellGroup && (cellGroup.needUpdate = true);
|
|
46041
46043
|
}
|
|
46042
46044
|
}
|
|
46043
|
-
|
|
46045
|
+
rowUpdatePos = isValid$3(rowUpdatePos)
|
|
46046
|
+
? isValid$3(updateAfter)
|
|
46047
|
+
? Math.min(rowUpdatePos, updateAfter)
|
|
46048
|
+
: rowUpdatePos
|
|
46049
|
+
: updateAfter;
|
|
46044
46050
|
}
|
|
46051
|
+
isNumber$4(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
|
|
46045
46052
|
if (addRows.length) {
|
|
46046
46053
|
if (!isNumber$4(updateAfter)) {
|
|
46047
46054
|
const minRow = Math.min(...addRows);
|
|
@@ -46303,23 +46310,65 @@
|
|
|
46303
46310
|
}
|
|
46304
46311
|
}
|
|
46305
46312
|
}
|
|
46306
|
-
function
|
|
46313
|
+
function _getUpdateRowIndex(beforeRow, afterRow, scene) {
|
|
46307
46314
|
let updateRow;
|
|
46308
46315
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
46309
46316
|
const rangeBefore = scene.table.getCellRange(col, beforeRow);
|
|
46317
|
+
let row;
|
|
46310
46318
|
if (rangeBefore.start.row <= beforeRow + 1 && rangeBefore.end.row >= beforeRow + 1) {
|
|
46311
|
-
|
|
46312
|
-
|
|
46319
|
+
addNeedUpdateTag(rangeBefore, scene);
|
|
46320
|
+
row = rangeBefore.start.row;
|
|
46313
46321
|
}
|
|
46314
46322
|
const rangeAfter = scene.table.getCellRange(col, afterRow);
|
|
46315
|
-
if (rangeAfter.start.row <= afterRow
|
|
46316
|
-
|
|
46317
|
-
|
|
46323
|
+
if (rangeAfter.start.row <= afterRow + 1 && rangeAfter.end.row >= afterRow + 1) {
|
|
46324
|
+
addNeedUpdateTag(rangeAfter, scene);
|
|
46325
|
+
row = rangeAfter.start.row;
|
|
46326
|
+
}
|
|
46327
|
+
if (isValid$3(row)) {
|
|
46328
|
+
updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
|
|
46318
46329
|
}
|
|
46319
46330
|
}
|
|
46320
46331
|
return updateRow;
|
|
46321
46332
|
}
|
|
46322
|
-
function
|
|
46333
|
+
function _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene) {
|
|
46334
|
+
let updateRow;
|
|
46335
|
+
for (let col = 0; col < scene.table.colCount; col++) {
|
|
46336
|
+
let row;
|
|
46337
|
+
const beforeCell = scene.highPerformanceGetCell(col, beforeRow);
|
|
46338
|
+
if (beforeCell.mergeStartRow && beforeCell.mergeEndRow && beforeCell.mergeEndRow > beforeRow) {
|
|
46339
|
+
addNeedUpdateTag({
|
|
46340
|
+
start: {
|
|
46341
|
+
row: beforeCell.mergeStartRow,
|
|
46342
|
+
col: scene.table.heightMode === 'autoHeight' ? 0 : beforeCell.mergeStartCol
|
|
46343
|
+
},
|
|
46344
|
+
end: {
|
|
46345
|
+
row: beforeCell.mergeEndRow,
|
|
46346
|
+
col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : beforeCell.mergeEndCol
|
|
46347
|
+
}
|
|
46348
|
+
}, scene);
|
|
46349
|
+
row = beforeCell.mergeStartRow;
|
|
46350
|
+
}
|
|
46351
|
+
const afterCell = scene.highPerformanceGetCell(col, afterRow);
|
|
46352
|
+
if (afterCell.mergeStartRow && afterCell.mergeEndRow && afterCell.mergeStartRow < afterRow) {
|
|
46353
|
+
addNeedUpdateTag({
|
|
46354
|
+
start: {
|
|
46355
|
+
row: afterCell.mergeStartRow,
|
|
46356
|
+
col: scene.table.heightMode === 'autoHeight' ? 0 : afterCell.mergeStartCol
|
|
46357
|
+
},
|
|
46358
|
+
end: {
|
|
46359
|
+
row: afterCell.mergeEndRow,
|
|
46360
|
+
col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : afterCell.mergeEndCol
|
|
46361
|
+
}
|
|
46362
|
+
}, scene);
|
|
46363
|
+
row = afterCell.mergeStartRow;
|
|
46364
|
+
}
|
|
46365
|
+
if (isValid$3(row)) {
|
|
46366
|
+
updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
|
|
46367
|
+
}
|
|
46368
|
+
}
|
|
46369
|
+
return updateRow;
|
|
46370
|
+
}
|
|
46371
|
+
function addNeedUpdateTag(range, scene) {
|
|
46323
46372
|
const { start, end } = range;
|
|
46324
46373
|
for (let col = start.col; col <= end.col; col++) {
|
|
46325
46374
|
for (let row = start.row; row <= end.row; row++) {
|
|
@@ -46339,265 +46388,6 @@
|
|
|
46339
46388
|
}
|
|
46340
46389
|
}
|
|
46341
46390
|
|
|
46342
|
-
function handleTextStick(table) {
|
|
46343
|
-
const { changedCells } = table.internalProps.stick;
|
|
46344
|
-
changedCells.forEach((cellPos) => {
|
|
46345
|
-
const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);
|
|
46346
|
-
cellGroup.forEachChildren((child) => {
|
|
46347
|
-
child.setAttributes({
|
|
46348
|
-
dx: cellPos.dx,
|
|
46349
|
-
dy: cellPos.dy
|
|
46350
|
-
});
|
|
46351
|
-
});
|
|
46352
|
-
});
|
|
46353
|
-
changedCells.clear();
|
|
46354
|
-
const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
|
|
46355
|
-
const frozenRowsHeight = table.getFrozenRowsHeight();
|
|
46356
|
-
const frozenColsWidth = table.getFrozenColsWidth();
|
|
46357
|
-
const { row: rowTop } = table.getRowAt(scrollTop + frozenRowsHeight + 1);
|
|
46358
|
-
const { col: colLeft } = table.getColAt(scrollLeft + frozenColsWidth + 1);
|
|
46359
|
-
const rowStart = Math.max(rowTop, table.frozenRowCount);
|
|
46360
|
-
const colStart = Math.max(colLeft, table.frozenColCount);
|
|
46361
|
-
const rowEnd = table.getAllRowsHeight() > table.tableNoFrameHeight
|
|
46362
|
-
? table.getRowAt(scrollTop + table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() - 1).row
|
|
46363
|
-
: table.rowCount - table.bottomFrozenRowCount - 1;
|
|
46364
|
-
const colEnd = table.getAllColsWidth() > table.tableNoFrameWidth
|
|
46365
|
-
? table.getColAt(scrollLeft + table.tableNoFrameWidth - table.getRightFrozenColsWidth() - 1).col
|
|
46366
|
-
: table.colCount - table.rightFrozenColCount - 1;
|
|
46367
|
-
if (colEnd < 0 || rowEnd < 0) {
|
|
46368
|
-
return;
|
|
46369
|
-
}
|
|
46370
|
-
for (let row = 0; row < frozenRowCount; row++) {
|
|
46371
|
-
if (colEnd < colStart) {
|
|
46372
|
-
break;
|
|
46373
|
-
}
|
|
46374
|
-
[colStart, colEnd].forEach((col) => {
|
|
46375
|
-
const style = table._getCellStyle(col, row);
|
|
46376
|
-
if (style?.textStick) {
|
|
46377
|
-
const cellGroup = table.scenegraph.getCell(col, row);
|
|
46378
|
-
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
46379
|
-
}
|
|
46380
|
-
});
|
|
46381
|
-
}
|
|
46382
|
-
for (let col = 0; col < frozenColCount; col++) {
|
|
46383
|
-
if (rowEnd < rowStart) {
|
|
46384
|
-
break;
|
|
46385
|
-
}
|
|
46386
|
-
[rowStart, rowEnd].forEach((row) => {
|
|
46387
|
-
const style = table._getCellStyle(col, row);
|
|
46388
|
-
if (style?.textStick && table.internalProps.layoutMap.rowHierarchyType !== 'tree') {
|
|
46389
|
-
const cellGroup = table.scenegraph.getCell(col, row);
|
|
46390
|
-
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
46391
|
-
}
|
|
46392
|
-
});
|
|
46393
|
-
}
|
|
46394
|
-
for (let col = colStart; col <= colEnd; col++) {
|
|
46395
|
-
if (rowEnd < rowStart) {
|
|
46396
|
-
break;
|
|
46397
|
-
}
|
|
46398
|
-
[rowStart, rowEnd].forEach((row) => {
|
|
46399
|
-
const style = table._getCellStyle(col, row);
|
|
46400
|
-
if (style?.textStick) {
|
|
46401
|
-
const cellGroup = table.scenegraph.getCell(col, row);
|
|
46402
|
-
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
46403
|
-
}
|
|
46404
|
-
});
|
|
46405
|
-
}
|
|
46406
|
-
for (let row = rowStart; row < rowEnd; row++) {
|
|
46407
|
-
if (colEnd < colStart) {
|
|
46408
|
-
break;
|
|
46409
|
-
}
|
|
46410
|
-
[colStart, colEnd].forEach((col) => {
|
|
46411
|
-
const style = table._getCellStyle(col, row);
|
|
46412
|
-
if (table._getCellStyle(col, row)?.textStick) {
|
|
46413
|
-
const cellGroup = table.scenegraph.getCell(col, row);
|
|
46414
|
-
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
46415
|
-
}
|
|
46416
|
-
});
|
|
46417
|
-
}
|
|
46418
|
-
}
|
|
46419
|
-
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table) {
|
|
46420
|
-
if (isNumber$4(cellGroup.mergeStartCol) &&
|
|
46421
|
-
isNumber$4(cellGroup.mergeStartRow) &&
|
|
46422
|
-
isNumber$4(cellGroup.mergeEndCol) &&
|
|
46423
|
-
isNumber$4(cellGroup.mergeEndRow)) {
|
|
46424
|
-
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
46425
|
-
for (let col = colStart; col <= colEnd; col++) {
|
|
46426
|
-
for (let row = rowStart; row <= rowEnd; row++) {
|
|
46427
|
-
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
46428
|
-
dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
46429
|
-
}
|
|
46430
|
-
}
|
|
46431
|
-
}
|
|
46432
|
-
else {
|
|
46433
|
-
dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
46434
|
-
}
|
|
46435
|
-
}
|
|
46436
|
-
function dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign) {
|
|
46437
|
-
const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
|
|
46438
|
-
if (!graphic) {
|
|
46439
|
-
return;
|
|
46440
|
-
}
|
|
46441
|
-
if (graphic.type === 'image') {
|
|
46442
|
-
const { image: url } = graphic.attribute;
|
|
46443
|
-
if (!url || !graphic.resources) {
|
|
46444
|
-
return;
|
|
46445
|
-
}
|
|
46446
|
-
const res = graphic.resources.get(url);
|
|
46447
|
-
if (res.state !== 'success') {
|
|
46448
|
-
return;
|
|
46449
|
-
}
|
|
46450
|
-
}
|
|
46451
|
-
const textBaseline = graphic.textBaseline ?? 'top';
|
|
46452
|
-
graphic.AABBBounds.width();
|
|
46453
|
-
const textTop = graphic.globalAABBBounds.y1;
|
|
46454
|
-
const textBottom = graphic.globalAABBBounds.y2;
|
|
46455
|
-
if (textBaseline === 'middle' && textStickBaseOnAlign) {
|
|
46456
|
-
const cellTop = cellGroup.globalAABBBounds.y1 + (cellGroup.firstChild?.attribute.dy ?? 0);
|
|
46457
|
-
const cellBottom = cellTop + (cellGroup.contentHeight ?? cellGroup.attribute.height ?? 0);
|
|
46458
|
-
if (cellTop < minTop || cellBottom > maxTop) {
|
|
46459
|
-
const visibleCellTop = Math.max(cellTop, minTop);
|
|
46460
|
-
const visibleCellBottom = Math.min(cellBottom, maxTop);
|
|
46461
|
-
const delta = graphic.globalTransMatrix.f - (visibleCellBottom + visibleCellTop) / 2;
|
|
46462
|
-
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
46463
|
-
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
46464
|
-
col: cellGroup.col,
|
|
46465
|
-
row: cellGroup.row,
|
|
46466
|
-
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
46467
|
-
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
46468
|
-
});
|
|
46469
|
-
cellGroup.forEachChildren((child) => {
|
|
46470
|
-
child.setAttribute('dy', (child.attribute.dy ?? 0) - delta + 2);
|
|
46471
|
-
});
|
|
46472
|
-
}
|
|
46473
|
-
}
|
|
46474
|
-
else if (textTop < minTop) {
|
|
46475
|
-
const deltaHeight = textTop - minTop;
|
|
46476
|
-
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
46477
|
-
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
46478
|
-
col: cellGroup.col,
|
|
46479
|
-
row: cellGroup.row,
|
|
46480
|
-
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
46481
|
-
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
46482
|
-
});
|
|
46483
|
-
cellGroup.forEachChildren((child) => {
|
|
46484
|
-
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
|
|
46485
|
-
});
|
|
46486
|
-
}
|
|
46487
|
-
else if (textBottom > maxTop) {
|
|
46488
|
-
const deltaHeight = textBottom - maxTop;
|
|
46489
|
-
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
46490
|
-
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
46491
|
-
col: cellGroup.col,
|
|
46492
|
-
row: cellGroup.row,
|
|
46493
|
-
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
46494
|
-
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
46495
|
-
});
|
|
46496
|
-
cellGroup.forEachChildren((child) => {
|
|
46497
|
-
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
|
|
46498
|
-
});
|
|
46499
|
-
}
|
|
46500
|
-
}
|
|
46501
|
-
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table) {
|
|
46502
|
-
if (isNumber$4(cellGroup.mergeStartCol) &&
|
|
46503
|
-
isNumber$4(cellGroup.mergeStartRow) &&
|
|
46504
|
-
isNumber$4(cellGroup.mergeEndCol) &&
|
|
46505
|
-
isNumber$4(cellGroup.mergeEndRow)) {
|
|
46506
|
-
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
46507
|
-
for (let col = colStart; col <= colEnd; col++) {
|
|
46508
|
-
for (let row = rowStart; row <= rowEnd; row++) {
|
|
46509
|
-
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
46510
|
-
dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
|
|
46511
|
-
}
|
|
46512
|
-
}
|
|
46513
|
-
}
|
|
46514
|
-
else {
|
|
46515
|
-
dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
|
|
46516
|
-
}
|
|
46517
|
-
}
|
|
46518
|
-
function dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign) {
|
|
46519
|
-
const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
|
|
46520
|
-
if (!graphic) {
|
|
46521
|
-
return;
|
|
46522
|
-
}
|
|
46523
|
-
if (graphic.type === 'image') {
|
|
46524
|
-
const { image: url } = graphic.attribute;
|
|
46525
|
-
if (!url || !graphic.resources) {
|
|
46526
|
-
return;
|
|
46527
|
-
}
|
|
46528
|
-
const res = graphic.resources.get(url);
|
|
46529
|
-
if (res.state !== 'success') {
|
|
46530
|
-
return;
|
|
46531
|
-
}
|
|
46532
|
-
}
|
|
46533
|
-
const textAlign = graphic.attribute.textAlign ?? graphic.textAlign ?? 'left';
|
|
46534
|
-
graphic.AABBBounds.width();
|
|
46535
|
-
const textLeft = graphic.globalAABBBounds.x1;
|
|
46536
|
-
const textRight = graphic.globalAABBBounds.x2;
|
|
46537
|
-
if (textAlign === 'center' && textStickBaseOnAlign) {
|
|
46538
|
-
const cellLeft = cellGroup.globalAABBBounds.x1 + (cellGroup.firstChild?.attribute.dx ?? 0);
|
|
46539
|
-
const cellRight = cellLeft + (cellGroup.contentWidth ?? cellGroup.attribute.width ?? 0);
|
|
46540
|
-
if (cellLeft < minLeft || cellRight > maxLeft) {
|
|
46541
|
-
const visibleCellLeft = Math.max(cellLeft, minLeft);
|
|
46542
|
-
const visibleCellRight = Math.min(cellRight, maxLeft);
|
|
46543
|
-
const delta = graphic.globalTransMatrix.e - (visibleCellRight + visibleCellLeft) / 2;
|
|
46544
|
-
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
46545
|
-
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
46546
|
-
col: cellGroup.col,
|
|
46547
|
-
row: cellGroup.row,
|
|
46548
|
-
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
46549
|
-
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
46550
|
-
});
|
|
46551
|
-
cellGroup.forEachChildren((child) => {
|
|
46552
|
-
child.setAttribute('dx', (child.attribute.dx ?? 0) - delta + 2);
|
|
46553
|
-
});
|
|
46554
|
-
}
|
|
46555
|
-
}
|
|
46556
|
-
else if (textLeft < minLeft) {
|
|
46557
|
-
const deltaWidth = textLeft - minLeft;
|
|
46558
|
-
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
46559
|
-
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
46560
|
-
col: cellGroup.col,
|
|
46561
|
-
row: cellGroup.row,
|
|
46562
|
-
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
46563
|
-
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
46564
|
-
});
|
|
46565
|
-
cellGroup.forEachChildren((child) => {
|
|
46566
|
-
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
|
|
46567
|
-
});
|
|
46568
|
-
}
|
|
46569
|
-
else if (textRight > maxLeft) {
|
|
46570
|
-
const deltaWidth = textRight - maxLeft;
|
|
46571
|
-
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
46572
|
-
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
46573
|
-
col: cellGroup.col,
|
|
46574
|
-
row: cellGroup.row,
|
|
46575
|
-
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
46576
|
-
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
46577
|
-
});
|
|
46578
|
-
cellGroup.forEachChildren((child) => {
|
|
46579
|
-
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
|
|
46580
|
-
});
|
|
46581
|
-
}
|
|
46582
|
-
}
|
|
46583
|
-
function checkHaveTextStick(table) {
|
|
46584
|
-
const headerObjects = table.internalProps.layoutMap.headerObjects;
|
|
46585
|
-
const columnObjects = table.internalProps.layoutMap.columnObjects;
|
|
46586
|
-
for (let i = 0; i < headerObjects.length; i++) {
|
|
46587
|
-
const header = headerObjects[i];
|
|
46588
|
-
if (header && header.style?.textStick) {
|
|
46589
|
-
return true;
|
|
46590
|
-
}
|
|
46591
|
-
}
|
|
46592
|
-
for (let i = 0; i < columnObjects.length; i++) {
|
|
46593
|
-
const column = columnObjects[i];
|
|
46594
|
-
if (column && column.style?.textStick) {
|
|
46595
|
-
return true;
|
|
46596
|
-
}
|
|
46597
|
-
}
|
|
46598
|
-
return false;
|
|
46599
|
-
}
|
|
46600
|
-
|
|
46601
46391
|
function dealFrozen(scene) {
|
|
46602
46392
|
if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
|
|
46603
46393
|
scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
|
|
@@ -48530,7 +48320,6 @@
|
|
|
48530
48320
|
this.createFrameBorder();
|
|
48531
48321
|
this.updateBorderSizeAndPosition();
|
|
48532
48322
|
this.component.updateScrollBar();
|
|
48533
|
-
handleTextStick(this.table);
|
|
48534
48323
|
this.updateNextFrame();
|
|
48535
48324
|
}
|
|
48536
48325
|
dealWidthMode() {
|
|
@@ -48768,12 +48557,13 @@
|
|
|
48768
48557
|
}
|
|
48769
48558
|
createFrameBorder() {
|
|
48770
48559
|
this.updateTableSize();
|
|
48771
|
-
const isListTableWithFrozen = !this.isPivot;
|
|
48560
|
+
const isListTableWithFrozen = !this.isPivot && !this.table.internalProps.transpose;
|
|
48772
48561
|
createFrameBorder(this.bodyGroup, this.table.theme.bodyStyle.frameStyle, this.bodyGroup.role, isListTableWithFrozen ? [true, true, true, false] : undefined);
|
|
48773
48562
|
createFrameBorder(this.rowHeaderGroup, this.isPivot
|
|
48774
48563
|
? this.table.theme.rowHeaderStyle.frameStyle
|
|
48775
|
-
:
|
|
48776
|
-
this.table.theme.
|
|
48564
|
+
: this.table.internalProps.transpose
|
|
48565
|
+
? this.table.theme.rowHeaderStyle.frameStyle
|
|
48566
|
+
: this.table.theme.bodyStyle.frameStyle, this.rowHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
|
|
48777
48567
|
createFrameBorder(this.colHeaderGroup, this.table.theme.headerStyle.frameStyle, this.colHeaderGroup.role, isListTableWithFrozen ? [true, true, true, false] : undefined);
|
|
48778
48568
|
createFrameBorder(this.cornerHeaderGroup, this.isPivot ? this.table.theme.cornerHeaderStyle.frameStyle : this.table.theme.headerStyle.frameStyle, this.cornerHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
|
|
48779
48569
|
createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, undefined);
|
|
@@ -48874,7 +48664,7 @@
|
|
|
48874
48664
|
? text.attribute.text.join('')
|
|
48875
48665
|
: text.attribute.text;
|
|
48876
48666
|
let cacheStr = '';
|
|
48877
|
-
if (isString$
|
|
48667
|
+
if (isString$2(text.cache.clipedText)) {
|
|
48878
48668
|
cacheStr = text.cache.clipedText;
|
|
48879
48669
|
}
|
|
48880
48670
|
else {
|
|
@@ -48913,6 +48703,7 @@
|
|
|
48913
48703
|
this.stage.enableDirtyBounds();
|
|
48914
48704
|
}
|
|
48915
48705
|
updateRow(removeCells, addCells, updateCells = []) {
|
|
48706
|
+
this.table.internalProps.layoutMap.clearCellRangeMap();
|
|
48916
48707
|
const addRows = deduplication$1(addCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
48917
48708
|
const updateRows = deduplication$1(updateCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
48918
48709
|
const isNotFillHeight = this.table.getAllRowsHeight() -
|
|
@@ -50109,7 +49900,7 @@
|
|
|
50109
49900
|
y: -1,
|
|
50110
49901
|
isShow: false,
|
|
50111
49902
|
itemList: [],
|
|
50112
|
-
bounds: new Bounds
|
|
49903
|
+
bounds: new Bounds(),
|
|
50113
49904
|
highlightIndex: -1,
|
|
50114
49905
|
dropDownMenuHighlight: []
|
|
50115
49906
|
};
|
|
@@ -50181,7 +49972,7 @@
|
|
|
50181
49972
|
y: -1,
|
|
50182
49973
|
isShow: false,
|
|
50183
49974
|
itemList: [],
|
|
50184
|
-
bounds: new Bounds
|
|
49975
|
+
bounds: new Bounds(),
|
|
50185
49976
|
highlightIndex: -1,
|
|
50186
49977
|
dropDownMenuHighlight: []
|
|
50187
49978
|
};
|
|
@@ -50299,7 +50090,7 @@
|
|
|
50299
50090
|
return checkMultiCellInSelect(cellPosStart, cellPosEnd, this.select.ranges, this.select.highlightScope);
|
|
50300
50091
|
}
|
|
50301
50092
|
updateHoverIcon(col, row, target, cellGroup, event) {
|
|
50302
|
-
if (target === this.residentHoverIcon?.icon) {
|
|
50093
|
+
if (this.residentHoverIcon?.icon && target === this.residentHoverIcon?.icon) {
|
|
50303
50094
|
return;
|
|
50304
50095
|
}
|
|
50305
50096
|
const iconInfo = getIconAndPositionFromTarget(target);
|
|
@@ -50329,7 +50120,7 @@
|
|
|
50329
50120
|
rect: iconInfo.position,
|
|
50330
50121
|
placement: inlineIcon.attribute.tooltip.placement
|
|
50331
50122
|
},
|
|
50332
|
-
style: Object.assign({}, this.table.internalProps.theme?.tooltipStyle, inlineIcon.tooltip?.style)
|
|
50123
|
+
style: Object.assign({}, this.table.internalProps.theme?.tooltipStyle, inlineIcon.tooltip?.style, inlineIcon.attribute?.tooltip?.style)
|
|
50333
50124
|
};
|
|
50334
50125
|
if (!this.table.internalProps.tooltipHandler.isBinded(tooltipOptions)) {
|
|
50335
50126
|
this.table.showTooltip(col, row, tooltipOptions);
|
|
@@ -50360,19 +50151,21 @@
|
|
|
50360
50151
|
return this.select.selecting;
|
|
50361
50152
|
}
|
|
50362
50153
|
endSelectCells(fireListener = true) {
|
|
50363
|
-
this.select.selecting
|
|
50364
|
-
|
|
50365
|
-
|
|
50154
|
+
if (this.select.selecting) {
|
|
50155
|
+
this.select.selecting = false;
|
|
50156
|
+
if (this.select.ranges.length === 0) {
|
|
50157
|
+
return;
|
|
50158
|
+
}
|
|
50159
|
+
selectEnd(this.table.scenegraph);
|
|
50160
|
+
const lastCol = this.select.ranges[this.select.ranges.length - 1].end.col;
|
|
50161
|
+
const lastRow = this.select.ranges[this.select.ranges.length - 1].end.row;
|
|
50162
|
+
fireListener &&
|
|
50163
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.SELECTED_CELL, {
|
|
50164
|
+
ranges: this.select.ranges,
|
|
50165
|
+
col: lastCol,
|
|
50166
|
+
row: lastRow
|
|
50167
|
+
});
|
|
50366
50168
|
}
|
|
50367
|
-
selectEnd(this.table.scenegraph);
|
|
50368
|
-
const lastCol = this.select.ranges[this.select.ranges.length - 1].end.col;
|
|
50369
|
-
const lastRow = this.select.ranges[this.select.ranges.length - 1].end.row;
|
|
50370
|
-
fireListener &&
|
|
50371
|
-
this.table.fireListeners(TABLE_EVENT_TYPE.SELECTED_CELL, {
|
|
50372
|
-
ranges: this.select.ranges,
|
|
50373
|
-
col: lastCol,
|
|
50374
|
-
row: lastRow
|
|
50375
|
-
});
|
|
50376
50169
|
}
|
|
50377
50170
|
endResizeCol() {
|
|
50378
50171
|
setTimeout(() => {
|
|
@@ -50564,21 +50357,22 @@
|
|
|
50564
50357
|
this.table.scenegraph.setY(-top);
|
|
50565
50358
|
const yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
50566
50359
|
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
50567
|
-
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
50568
|
-
scrollTop: this.scroll.verticalBarPos,
|
|
50569
|
-
scrollLeft: this.scroll.horizontalBarPos,
|
|
50570
|
-
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
50571
|
-
scrollWidth: this.table.theme.scrollStyle?.width,
|
|
50572
|
-
viewHeight: this.table.tableNoFrameHeight,
|
|
50573
|
-
viewWidth: this.table.tableNoFrameWidth,
|
|
50574
|
-
scrollDirection: 'vertical',
|
|
50575
|
-
scrollRatioY: yRatio
|
|
50576
|
-
});
|
|
50577
50360
|
if (oldVerticalBarPos !== top) {
|
|
50361
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
50362
|
+
scrollTop: this.scroll.verticalBarPos,
|
|
50363
|
+
scrollLeft: this.scroll.horizontalBarPos,
|
|
50364
|
+
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
50365
|
+
scrollWidth: this.table.theme.scrollStyle?.width,
|
|
50366
|
+
viewHeight: this.table.tableNoFrameHeight,
|
|
50367
|
+
viewWidth: this.table.tableNoFrameWidth,
|
|
50368
|
+
scrollDirection: 'vertical',
|
|
50369
|
+
scrollRatioY: yRatio
|
|
50370
|
+
});
|
|
50578
50371
|
this.checkVerticalScrollBarEnd();
|
|
50579
50372
|
}
|
|
50580
50373
|
}
|
|
50581
50374
|
setScrollLeft(left) {
|
|
50375
|
+
this.table.scrollLeft;
|
|
50582
50376
|
const totalWidth = this.table.getAllColsWidth();
|
|
50583
50377
|
this.table.getFrozenColsWidth();
|
|
50584
50378
|
left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width));
|
|
@@ -50594,17 +50388,17 @@
|
|
|
50594
50388
|
this.table.scenegraph.setX(-left);
|
|
50595
50389
|
const xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
50596
50390
|
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
50597
|
-
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
50598
|
-
scrollTop: this.scroll.verticalBarPos,
|
|
50599
|
-
scrollLeft: this.scroll.horizontalBarPos,
|
|
50600
|
-
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
50601
|
-
scrollWidth: this.table.theme.scrollStyle?.width,
|
|
50602
|
-
viewHeight: this.table.tableNoFrameHeight,
|
|
50603
|
-
viewWidth: this.table.tableNoFrameWidth,
|
|
50604
|
-
scrollDirection: 'horizontal',
|
|
50605
|
-
scrollRatioX: xRatio
|
|
50606
|
-
});
|
|
50607
50391
|
if (oldHorizontalBarPos !== left) {
|
|
50392
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
50393
|
+
scrollTop: this.scroll.verticalBarPos,
|
|
50394
|
+
scrollLeft: this.scroll.horizontalBarPos,
|
|
50395
|
+
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
50396
|
+
scrollWidth: this.table.theme.scrollStyle?.width,
|
|
50397
|
+
viewHeight: this.table.tableNoFrameHeight,
|
|
50398
|
+
viewWidth: this.table.tableNoFrameWidth,
|
|
50399
|
+
scrollDirection: 'horizontal',
|
|
50400
|
+
scrollRatioX: xRatio
|
|
50401
|
+
});
|
|
50608
50402
|
this.checkHorizontalScrollBarEnd();
|
|
50609
50403
|
}
|
|
50610
50404
|
}
|
|
@@ -50761,7 +50555,7 @@
|
|
|
50761
50555
|
if (isObject$4(item) && (item.menuKey || item.text) === (menuKey || '') && i === index) {
|
|
50762
50556
|
return true;
|
|
50763
50557
|
}
|
|
50764
|
-
else if (isString$
|
|
50558
|
+
else if (isString$2(item) && item === menuKey && i === index) {
|
|
50765
50559
|
return true;
|
|
50766
50560
|
}
|
|
50767
50561
|
}
|
|
@@ -51355,6 +51149,11 @@
|
|
|
51355
51149
|
stateManager.showHorizontalScrollBar();
|
|
51356
51150
|
stateManager.showVerticalScrollBar();
|
|
51357
51151
|
}
|
|
51152
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_TABLE)) {
|
|
51153
|
+
table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_TABLE, {
|
|
51154
|
+
event: e.nativeEvent
|
|
51155
|
+
});
|
|
51156
|
+
}
|
|
51358
51157
|
});
|
|
51359
51158
|
table.scenegraph.tableGroup.addEventListener('pointerleave', (e) => {
|
|
51360
51159
|
if (!stateManager.isResizeCol() && !stateManager.isMoveCol() && !stateManager.isSelecting()) {
|
|
@@ -51384,10 +51183,7 @@
|
|
|
51384
51183
|
const target = e.target;
|
|
51385
51184
|
if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {
|
|
51386
51185
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {
|
|
51387
|
-
|
|
51388
|
-
row: -1,
|
|
51389
|
-
event: e.nativeEvent,
|
|
51390
|
-
target: undefined
|
|
51186
|
+
event: e.nativeEvent
|
|
51391
51187
|
});
|
|
51392
51188
|
}
|
|
51393
51189
|
});
|
|
@@ -51444,6 +51240,11 @@
|
|
|
51444
51240
|
eventManager.dealTableHover();
|
|
51445
51241
|
});
|
|
51446
51242
|
table.scenegraph.tableGroup.addEventListener('pointerdown', (e) => {
|
|
51243
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
|
|
51244
|
+
table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
51245
|
+
event: e.nativeEvent
|
|
51246
|
+
});
|
|
51247
|
+
}
|
|
51447
51248
|
table.eventManager.isDown = true;
|
|
51448
51249
|
table.eventManager.LastBodyPointerXY = { x: e.x, y: e.y };
|
|
51449
51250
|
table.eventManager.LastPointerXY = { x: e.x, y: e.y };
|
|
@@ -51451,6 +51252,7 @@
|
|
|
51451
51252
|
return;
|
|
51452
51253
|
}
|
|
51453
51254
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
51255
|
+
eventManager.downIcon = undefined;
|
|
51454
51256
|
if (stateManager.interactionState !== InteractionState.default) {
|
|
51455
51257
|
return;
|
|
51456
51258
|
}
|
|
@@ -51464,6 +51266,7 @@
|
|
|
51464
51266
|
const hitIcon = eventArgsSet?.eventArgs?.target?.role?.startsWith('icon')
|
|
51465
51267
|
? eventArgsSet.eventArgs.target
|
|
51466
51268
|
: undefined;
|
|
51269
|
+
eventManager.downIcon = hitIcon;
|
|
51467
51270
|
if (!hitIcon || hitIcon.attribute.interactive === false) {
|
|
51468
51271
|
if (e.pointerType === 'touch') {
|
|
51469
51272
|
eventManager.touchEnd = false;
|
|
@@ -51637,7 +51440,7 @@
|
|
|
51637
51440
|
}
|
|
51638
51441
|
}
|
|
51639
51442
|
}
|
|
51640
|
-
if (!eventManager.touchMove && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
|
|
51443
|
+
if (!eventManager.touchMove && e.button === 0 && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
|
|
51641
51444
|
const { col, row } = eventArgsSet.eventArgs;
|
|
51642
51445
|
const cellInfo = table.getCellInfo(col, row);
|
|
51643
51446
|
let icon;
|
|
@@ -51750,16 +51553,14 @@
|
|
|
51750
51553
|
}
|
|
51751
51554
|
function endResizeCol(table) {
|
|
51752
51555
|
table.stateManager.endResizeCol();
|
|
51753
|
-
|
|
51754
|
-
|
|
51755
|
-
|
|
51756
|
-
columns.push(table.getColWidth(col));
|
|
51757
|
-
}
|
|
51758
|
-
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
51759
|
-
col: table.stateManager.columnResize.col,
|
|
51760
|
-
colWidths: columns
|
|
51761
|
-
});
|
|
51556
|
+
const columns = [];
|
|
51557
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
51558
|
+
columns.push(table.getColWidth(col));
|
|
51762
51559
|
}
|
|
51560
|
+
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
51561
|
+
col: table.stateManager.columnResize.col,
|
|
51562
|
+
colWidths: columns
|
|
51563
|
+
});
|
|
51763
51564
|
}
|
|
51764
51565
|
function dblclickHandler(e, table) {
|
|
51765
51566
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
@@ -51832,6 +51633,11 @@
|
|
|
51832
51633
|
}
|
|
51833
51634
|
scenegraph.table.stateManager.hideMenu();
|
|
51834
51635
|
scenegraph.table.editorManager?.completeEdit();
|
|
51636
|
+
if (scenegraph.table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
|
|
51637
|
+
scenegraph.table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
51638
|
+
event: e.nativeEvent
|
|
51639
|
+
});
|
|
51640
|
+
}
|
|
51835
51641
|
});
|
|
51836
51642
|
scenegraph.component.vScrollBar.addEventListener('pointerup', () => {
|
|
51837
51643
|
stateManager.fastScrolling = false;
|
|
@@ -51857,6 +51663,11 @@
|
|
|
51857
51663
|
}
|
|
51858
51664
|
scenegraph.table.stateManager.hideMenu();
|
|
51859
51665
|
scenegraph.table.editorManager?.completeEdit();
|
|
51666
|
+
if (scenegraph.table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
|
|
51667
|
+
scenegraph.table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
51668
|
+
event: e.nativeEvent
|
|
51669
|
+
});
|
|
51670
|
+
}
|
|
51860
51671
|
});
|
|
51861
51672
|
scenegraph.component.hScrollBar.addEventListener('pointerup', () => {
|
|
51862
51673
|
stateManager.fastScrolling = false;
|
|
@@ -52436,7 +52247,7 @@
|
|
|
52436
52247
|
}
|
|
52437
52248
|
}
|
|
52438
52249
|
const isSelecting = table.stateManager.isSelecting();
|
|
52439
|
-
if (eventManager.isDraging && isSelecting) {
|
|
52250
|
+
if (eventManager.isDraging && isSelecting && table.stateManager.select.ranges?.length > 0) {
|
|
52440
52251
|
const drawRange = table.getDrawRange();
|
|
52441
52252
|
const topFrozenRowHeight = table.getFrozenRowsHeight();
|
|
52442
52253
|
const bottomFrozenRowHeight = table.getBottomFrozenRowsHeight();
|
|
@@ -52444,8 +52255,10 @@
|
|
|
52444
52255
|
const rightFrozenColsWidth = table.getRightFrozenColsWidth();
|
|
52445
52256
|
const startCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].start;
|
|
52446
52257
|
const endCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end;
|
|
52447
|
-
const canScrollY = table.isFrozenRow(startCell.row) === false || table.isFrozenRow(endCell.row) === false
|
|
52448
|
-
|
|
52258
|
+
const canScrollY = (table.isFrozenRow(startCell.row) === false || table.isFrozenRow(endCell.row) === false) &&
|
|
52259
|
+
table.getAllRowsHeight() > table.tableNoFrameHeight;
|
|
52260
|
+
const canScrollX = (table.isFrozenColumn(startCell.col) === false || table.isFrozenColumn(endCell.col) === false) &&
|
|
52261
|
+
table.getAllColsWidth() > table.tableNoFrameWidth;
|
|
52449
52262
|
if (((y > drawRange.bottom - bottomFrozenRowHeight || y < drawRange.top + topFrozenRowHeight) && canScrollY) ||
|
|
52450
52263
|
((x > drawRange.right - rightFrozenColsWidth || x < drawRange.left + leftFrozenColsWidth) && canScrollX)) {
|
|
52451
52264
|
table.eventManager.scrollXSpeed = 0;
|
|
@@ -52556,25 +52369,30 @@
|
|
|
52556
52369
|
if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
|
|
52557
52370
|
return;
|
|
52558
52371
|
}
|
|
52559
|
-
if (eventManager.
|
|
52560
|
-
eventManager.touchMovePoints.shift();
|
|
52561
|
-
}
|
|
52562
|
-
eventManager.touchMovePoints.push({
|
|
52563
|
-
x: e.changedTouches[0].pageX,
|
|
52564
|
-
y: e.changedTouches[0].pageY,
|
|
52565
|
-
timestamp: Date.now()
|
|
52566
|
-
});
|
|
52567
|
-
const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x +
|
|
52568
|
-
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x;
|
|
52569
|
-
const deltaY = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].y +
|
|
52570
|
-
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].y;
|
|
52571
|
-
handleWhell({ deltaX, deltaY }, stateManager);
|
|
52572
|
-
if (e.cancelable &&
|
|
52573
|
-
(table.internalProps.overscrollBehavior === 'none' ||
|
|
52574
|
-
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, stateManager)) ||
|
|
52575
|
-
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, stateManager)))) {
|
|
52372
|
+
if (eventManager.downIcon?.attribute?.funcType === IconFuncTypeEnum.dragReorder) {
|
|
52576
52373
|
e.preventDefault();
|
|
52577
52374
|
}
|
|
52375
|
+
else {
|
|
52376
|
+
if (eventManager.touchMovePoints.length > 4) {
|
|
52377
|
+
eventManager.touchMovePoints.shift();
|
|
52378
|
+
}
|
|
52379
|
+
eventManager.touchMovePoints.push({
|
|
52380
|
+
x: e.changedTouches[0].pageX,
|
|
52381
|
+
y: e.changedTouches[0].pageY,
|
|
52382
|
+
timestamp: Date.now()
|
|
52383
|
+
});
|
|
52384
|
+
const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x +
|
|
52385
|
+
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x;
|
|
52386
|
+
const deltaY = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].y +
|
|
52387
|
+
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].y;
|
|
52388
|
+
handleWhell({ deltaX, deltaY }, stateManager);
|
|
52389
|
+
if (e.cancelable &&
|
|
52390
|
+
(table.internalProps.overscrollBehavior === 'none' ||
|
|
52391
|
+
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, stateManager)) ||
|
|
52392
|
+
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, stateManager)))) {
|
|
52393
|
+
e.preventDefault();
|
|
52394
|
+
}
|
|
52395
|
+
}
|
|
52578
52396
|
};
|
|
52579
52397
|
window.addEventListener('touchmove', globalTouchMoveCallback, { passive: false });
|
|
52580
52398
|
eventManager.globalEventListeners.push({
|
|
@@ -52588,23 +52406,28 @@
|
|
|
52588
52406
|
if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
|
|
52589
52407
|
return;
|
|
52590
52408
|
}
|
|
52591
|
-
if (eventManager.
|
|
52592
|
-
|
|
52593
|
-
|
|
52409
|
+
if (eventManager.downIcon?.attribute?.funcType === IconFuncTypeEnum.dragReorder) {
|
|
52410
|
+
e.preventDefault();
|
|
52411
|
+
}
|
|
52412
|
+
else {
|
|
52413
|
+
if (eventManager.touchMovePoints?.length) {
|
|
52414
|
+
if (eventManager.touchMovePoints.length > 4) {
|
|
52415
|
+
eventManager.touchMovePoints.shift();
|
|
52416
|
+
}
|
|
52417
|
+
eventManager.touchMovePoints.push({
|
|
52418
|
+
x: e.changedTouches[0].pageX,
|
|
52419
|
+
y: e.changedTouches[0].pageY,
|
|
52420
|
+
timestamp: Date.now()
|
|
52421
|
+
});
|
|
52422
|
+
const firstPoint = eventManager.touchMovePoints[0];
|
|
52423
|
+
const lastPoint = eventManager.touchMovePoints[eventManager.touchMovePoints?.length - 1];
|
|
52424
|
+
const vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
52425
|
+
const vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
52426
|
+
eventManager.inertiaScroll.startInertia(vX, vY, 0.95);
|
|
52427
|
+
table.eventManager.inertiaScroll.setScrollHandle((dx, dy) => {
|
|
52428
|
+
handleWhell({ deltaX: -dx, deltaY: -dy }, table.stateManager);
|
|
52429
|
+
});
|
|
52594
52430
|
}
|
|
52595
|
-
eventManager.touchMovePoints.push({
|
|
52596
|
-
x: e.changedTouches[0].pageX,
|
|
52597
|
-
y: e.changedTouches[0].pageY,
|
|
52598
|
-
timestamp: Date.now()
|
|
52599
|
-
});
|
|
52600
|
-
const firstPoint = eventManager.touchMovePoints[0];
|
|
52601
|
-
const lastPoint = eventManager.touchMovePoints[eventManager.touchMovePoints?.length - 1];
|
|
52602
|
-
const vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
52603
|
-
const vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
52604
|
-
eventManager.inertiaScroll.startInertia(vX, vY, 0.95);
|
|
52605
|
-
table.eventManager.inertiaScroll.setScrollHandle((dx, dy) => {
|
|
52606
|
-
handleWhell({ deltaX: -dx, deltaY: -dy }, table.stateManager);
|
|
52607
|
-
});
|
|
52608
52431
|
}
|
|
52609
52432
|
eventManager.isTouchdown = false;
|
|
52610
52433
|
eventManager.touchMovePoints = [];
|
|
@@ -52775,10 +52598,12 @@
|
|
|
52775
52598
|
isDraging = false;
|
|
52776
52599
|
scrollYSpeed;
|
|
52777
52600
|
scrollXSpeed;
|
|
52601
|
+
downIcon;
|
|
52778
52602
|
globalEventListeners = [];
|
|
52779
52603
|
inertiaScroll;
|
|
52780
52604
|
constructor(table) {
|
|
52781
52605
|
this.table = table;
|
|
52606
|
+
this.handleTextStickBindId = [];
|
|
52782
52607
|
this.inertiaScroll = new InertiaScroll(table.stateManager);
|
|
52783
52608
|
if (Env.mode === 'node') {
|
|
52784
52609
|
return;
|
|
@@ -52797,14 +52622,19 @@
|
|
|
52797
52622
|
}
|
|
52798
52623
|
updateEventBinder() {
|
|
52799
52624
|
setTimeout(() => {
|
|
52800
|
-
if (checkHaveTextStick(this.table) &&
|
|
52801
|
-
this.handleTextStickBindId
|
|
52625
|
+
if (checkHaveTextStick(this.table) && this.handleTextStickBindId?.length === 0) {
|
|
52626
|
+
this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
|
|
52802
52627
|
handleTextStick(this.table);
|
|
52803
|
-
});
|
|
52628
|
+
}));
|
|
52629
|
+
this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, e => {
|
|
52630
|
+
handleTextStick(this.table);
|
|
52631
|
+
}));
|
|
52804
52632
|
}
|
|
52805
52633
|
else if (!checkHaveTextStick(this.table) && this.handleTextStickBindId) {
|
|
52806
|
-
this.
|
|
52807
|
-
|
|
52634
|
+
this.handleTextStickBindId.forEach(id => {
|
|
52635
|
+
this.table.off(id);
|
|
52636
|
+
});
|
|
52637
|
+
this.handleTextStickBindId = [];
|
|
52808
52638
|
}
|
|
52809
52639
|
}, 0);
|
|
52810
52640
|
}
|
|
@@ -52835,11 +52665,7 @@
|
|
|
52835
52665
|
this.table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
|
|
52836
52666
|
stateManager.hideMenu();
|
|
52837
52667
|
});
|
|
52838
|
-
|
|
52839
|
-
this.handleTextStickBindId = this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
|
|
52840
|
-
handleTextStick(this.table);
|
|
52841
|
-
});
|
|
52842
|
-
}
|
|
52668
|
+
this.updateEventBinder();
|
|
52843
52669
|
bindMediaClick(this.table);
|
|
52844
52670
|
this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, (e) => {
|
|
52845
52671
|
if (e.federatedEvent) {
|
|
@@ -53390,6 +53216,9 @@
|
|
|
53390
53216
|
}
|
|
53391
53217
|
return undefined;
|
|
53392
53218
|
}
|
|
53219
|
+
getHierarchyIconWidth() {
|
|
53220
|
+
return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);
|
|
53221
|
+
}
|
|
53393
53222
|
}
|
|
53394
53223
|
|
|
53395
53224
|
function createElement(tagName, classNames) {
|
|
@@ -54271,6 +54100,9 @@
|
|
|
54271
54100
|
}
|
|
54272
54101
|
return undefined;
|
|
54273
54102
|
}
|
|
54103
|
+
getHierarchyIconWidth() {
|
|
54104
|
+
return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);
|
|
54105
|
+
}
|
|
54274
54106
|
checkDropDownIcon(_table, col, row) {
|
|
54275
54107
|
if (_table.isPivotTable()) {
|
|
54276
54108
|
const headerC = _table._getHeaderLayoutMap(col, row);
|
|
@@ -54777,39 +54609,7 @@
|
|
|
54777
54609
|
return;
|
|
54778
54610
|
}
|
|
54779
54611
|
const { col, row } = e;
|
|
54780
|
-
|
|
54781
|
-
const headerDescription = table.getHeaderDescription(col, row);
|
|
54782
|
-
if (headerDescription) {
|
|
54783
|
-
const rect = table.getCellRangeRelativeRect({ col, row });
|
|
54784
|
-
tooltipOption = {
|
|
54785
|
-
content: headerDescription,
|
|
54786
|
-
referencePosition: {
|
|
54787
|
-
placement: Placement.bottom,
|
|
54788
|
-
rect
|
|
54789
|
-
},
|
|
54790
|
-
style: { arrowMark: false }
|
|
54791
|
-
};
|
|
54792
|
-
}
|
|
54793
|
-
else if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {
|
|
54794
|
-
const overflowText = table.getCellOverflowText(col, row);
|
|
54795
|
-
const rect = table.getCellRangeRelativeRect({ col, row });
|
|
54796
|
-
if (overflowText) {
|
|
54797
|
-
tooltipOption = {
|
|
54798
|
-
content: headerDescription
|
|
54799
|
-
? `${headerDescription}
|
|
54800
|
-
${overflowText}`
|
|
54801
|
-
: overflowText,
|
|
54802
|
-
referencePosition: {
|
|
54803
|
-
placement: Placement.bottom,
|
|
54804
|
-
rect
|
|
54805
|
-
},
|
|
54806
|
-
style: table.theme.tooltipStyle
|
|
54807
|
-
};
|
|
54808
|
-
}
|
|
54809
|
-
}
|
|
54810
|
-
if (tooltipOption) {
|
|
54811
|
-
this._bindToCell(e.col, e.row, tooltipOption);
|
|
54812
|
-
}
|
|
54612
|
+
this.showTooltip(col, row);
|
|
54813
54613
|
});
|
|
54814
54614
|
table.on(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, e => {
|
|
54815
54615
|
if (isMobile()) {
|
|
@@ -54847,6 +54647,45 @@
|
|
|
54847
54647
|
this._unbindFromCell();
|
|
54848
54648
|
});
|
|
54849
54649
|
}
|
|
54650
|
+
showTooltip(col, row) {
|
|
54651
|
+
let tooltipOption;
|
|
54652
|
+
const table = this._table;
|
|
54653
|
+
const headerDescription = table.getHeaderDescription(col, row);
|
|
54654
|
+
if (headerDescription) {
|
|
54655
|
+
const rect = table.getCellRangeRelativeRect({ col, row });
|
|
54656
|
+
tooltipOption = {
|
|
54657
|
+
content: headerDescription,
|
|
54658
|
+
referencePosition: {
|
|
54659
|
+
placement: Placement.bottom,
|
|
54660
|
+
rect
|
|
54661
|
+
},
|
|
54662
|
+
style: { arrowMark: false }
|
|
54663
|
+
};
|
|
54664
|
+
}
|
|
54665
|
+
else if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {
|
|
54666
|
+
const overflowText = table.getCellOverflowText(col, row);
|
|
54667
|
+
const rect = table.getCellRangeRelativeRect({ col, row });
|
|
54668
|
+
if (overflowText) {
|
|
54669
|
+
tooltipOption = {
|
|
54670
|
+
content: headerDescription
|
|
54671
|
+
? `${headerDescription}
|
|
54672
|
+
${overflowText}`
|
|
54673
|
+
: overflowText,
|
|
54674
|
+
referencePosition: {
|
|
54675
|
+
placement: Placement.bottom,
|
|
54676
|
+
rect
|
|
54677
|
+
},
|
|
54678
|
+
style: table.theme.tooltipStyle
|
|
54679
|
+
};
|
|
54680
|
+
}
|
|
54681
|
+
}
|
|
54682
|
+
if (tooltipOption) {
|
|
54683
|
+
this._bindToCell(col, row, tooltipOption);
|
|
54684
|
+
}
|
|
54685
|
+
else {
|
|
54686
|
+
this._unbindFromCell();
|
|
54687
|
+
}
|
|
54688
|
+
}
|
|
54850
54689
|
_getTooltipInstanceInfo(col, row) {
|
|
54851
54690
|
const table = this._table;
|
|
54852
54691
|
const tooltipInstances = this._tooltipInstances;
|
|
@@ -56275,6 +56114,14 @@
|
|
|
56275
56114
|
}
|
|
56276
56115
|
this.table.scenegraph.updateNextFrame();
|
|
56277
56116
|
}
|
|
56117
|
+
updateCustomCell(customCellStyle, customCellStyleArrangement) {
|
|
56118
|
+
customCellStyle.forEach((cellStyle) => {
|
|
56119
|
+
this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
|
|
56120
|
+
});
|
|
56121
|
+
customCellStyleArrangement.forEach((cellStyle) => {
|
|
56122
|
+
this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
|
|
56123
|
+
});
|
|
56124
|
+
}
|
|
56278
56125
|
}
|
|
56279
56126
|
function mergeStyle(cacheStyle, customCellStyle) {
|
|
56280
56127
|
cacheStyle = cacheStyle.clone();
|
|
@@ -56305,6 +56152,8 @@
|
|
|
56305
56152
|
_heightMode;
|
|
56306
56153
|
_autoFillWidth;
|
|
56307
56154
|
_autoFillHeight;
|
|
56155
|
+
_widthAdaptiveMode;
|
|
56156
|
+
_heightAdaptiveMode;
|
|
56308
56157
|
customRender;
|
|
56309
56158
|
canvasWidth;
|
|
56310
56159
|
canvasHeight;
|
|
@@ -56317,7 +56166,7 @@
|
|
|
56317
56166
|
return TABLE_EVENT_TYPE;
|
|
56318
56167
|
}
|
|
56319
56168
|
options;
|
|
56320
|
-
version = "0.23.
|
|
56169
|
+
version = "0.23.3";
|
|
56321
56170
|
pagination;
|
|
56322
56171
|
id = `VTable${Date.now()}`;
|
|
56323
56172
|
headerStyleCache;
|
|
@@ -56333,11 +56182,13 @@
|
|
|
56333
56182
|
if (!container && options.mode !== 'node') {
|
|
56334
56183
|
throw new Error("vtable's container is undefined");
|
|
56335
56184
|
}
|
|
56336
|
-
const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth } = options;
|
|
56185
|
+
const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth } = options;
|
|
56337
56186
|
this.container = container;
|
|
56338
56187
|
this.options = options;
|
|
56339
56188
|
this._widthMode = widthMode;
|
|
56340
56189
|
this._heightMode = heightMode;
|
|
56190
|
+
this._widthAdaptiveMode = widthAdaptiveMode;
|
|
56191
|
+
this._heightAdaptiveMode = heightAdaptiveMode;
|
|
56341
56192
|
this._autoFillWidth = autoFillWidth;
|
|
56342
56193
|
this._autoFillHeight = autoFillHeight;
|
|
56343
56194
|
this.customRender = customRender;
|
|
@@ -56673,6 +56524,22 @@
|
|
|
56673
56524
|
this._autoFillHeight = autoFillHeight;
|
|
56674
56525
|
}
|
|
56675
56526
|
}
|
|
56527
|
+
get widthAdaptiveMode() {
|
|
56528
|
+
return this._widthAdaptiveMode;
|
|
56529
|
+
}
|
|
56530
|
+
set widthAdaptiveMode(widthAdaptiveMode) {
|
|
56531
|
+
if (widthAdaptiveMode !== this._widthAdaptiveMode) {
|
|
56532
|
+
this._widthAdaptiveMode = widthAdaptiveMode;
|
|
56533
|
+
}
|
|
56534
|
+
}
|
|
56535
|
+
get heightAdaptiveMode() {
|
|
56536
|
+
return this._heightAdaptiveMode;
|
|
56537
|
+
}
|
|
56538
|
+
set heightAdaptiveMode(heightAdaptiveMode) {
|
|
56539
|
+
if (heightAdaptiveMode !== this._heightAdaptiveMode) {
|
|
56540
|
+
this._heightAdaptiveMode = heightAdaptiveMode;
|
|
56541
|
+
}
|
|
56542
|
+
}
|
|
56676
56543
|
_colWidthDefineToPxWidth(width) {
|
|
56677
56544
|
if (width === 'auto') {
|
|
56678
56545
|
return 0;
|
|
@@ -56811,12 +56678,12 @@
|
|
|
56811
56678
|
return this.defaultColWidth;
|
|
56812
56679
|
}
|
|
56813
56680
|
getDefaultRowHeight(row) {
|
|
56814
|
-
if (this.isColumnHeader(0, row) || this.isCornerHeader(0, row)) {
|
|
56681
|
+
if (this.isColumnHeader(0, row) || this.isCornerHeader(0, row) || this.isSeriesNumberInHeader(0, row)) {
|
|
56815
56682
|
return Array.isArray(this.defaultHeaderRowHeight)
|
|
56816
56683
|
? this.defaultHeaderRowHeight[row] ?? this.internalProps.defaultRowHeight
|
|
56817
56684
|
: this.defaultHeaderRowHeight;
|
|
56818
56685
|
}
|
|
56819
|
-
if (this.isBottomFrozenRow(
|
|
56686
|
+
if (this.isBottomFrozenRow(row)) {
|
|
56820
56687
|
return Array.isArray(this.defaultHeaderRowHeight)
|
|
56821
56688
|
? this.defaultHeaderRowHeight[this.columnHeaderLevelCount > 0 ? this.columnHeaderLevelCount - this.bottomFrozenRowCount : 0] ?? this.internalProps.defaultRowHeight
|
|
56822
56689
|
: this.defaultHeaderRowHeight;
|
|
@@ -56870,6 +56737,15 @@
|
|
|
56870
56737
|
const width = this.getColWidthDefined(col);
|
|
56871
56738
|
return this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
|
|
56872
56739
|
}
|
|
56740
|
+
isAutoRowHeight(row) {
|
|
56741
|
+
if (this.heightMode === 'autoHeight') {
|
|
56742
|
+
return true;
|
|
56743
|
+
}
|
|
56744
|
+
else if (row >= 0 && row < this.columnHeaderLevelCount) {
|
|
56745
|
+
return this.getDefaultRowHeight(row) === 'auto';
|
|
56746
|
+
}
|
|
56747
|
+
return false;
|
|
56748
|
+
}
|
|
56873
56749
|
getColWidth(col) {
|
|
56874
56750
|
const width = this.colWidthsMap.get(col) ?? this.getDefaultColumnWidth(col);
|
|
56875
56751
|
if ((this.widthMode === 'adaptive' && typeof width === 'number') ||
|
|
@@ -57402,6 +57278,7 @@
|
|
|
57402
57278
|
if (parentElement) {
|
|
57403
57279
|
parentElement.removeChild(internalProps.element);
|
|
57404
57280
|
}
|
|
57281
|
+
this.editorManager?.editingEditor?.onEnd?.();
|
|
57405
57282
|
this.isReleased = true;
|
|
57406
57283
|
}
|
|
57407
57284
|
fireListeners(type, event) {
|
|
@@ -57409,7 +57286,7 @@
|
|
|
57409
57286
|
}
|
|
57410
57287
|
updateOption(options) {
|
|
57411
57288
|
this.options = options;
|
|
57412
|
-
const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, customRender, renderChartAsync, renderChartAsyncBatchCount, overscrollBehavior, limitMinWidth } = options;
|
|
57289
|
+
const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, overscrollBehavior, limitMinWidth } = options;
|
|
57413
57290
|
if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
|
|
57414
57291
|
this.internalProps.pixelRatio = pixelRatio;
|
|
57415
57292
|
}
|
|
@@ -57433,6 +57310,8 @@
|
|
|
57433
57310
|
}
|
|
57434
57311
|
this.widthMode = widthMode ?? 'standard';
|
|
57435
57312
|
this.heightMode = heightMode ?? 'standard';
|
|
57313
|
+
this._widthAdaptiveMode = widthAdaptiveMode ?? 'only-body';
|
|
57314
|
+
this._heightAdaptiveMode = heightAdaptiveMode ?? 'only-body';
|
|
57436
57315
|
this.autoFillWidth = autoFillWidth ?? false;
|
|
57437
57316
|
this.autoFillHeight = autoFillHeight ?? false;
|
|
57438
57317
|
this.customRender = customRender;
|
|
@@ -57440,6 +57319,7 @@
|
|
|
57440
57319
|
if (Env.mode !== 'node') {
|
|
57441
57320
|
updateRootElementPadding(internalProps.element, this.padding);
|
|
57442
57321
|
}
|
|
57322
|
+
this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
|
|
57443
57323
|
internalProps.frozenColCount = frozenColCount;
|
|
57444
57324
|
internalProps.defaultRowHeight = defaultRowHeight;
|
|
57445
57325
|
internalProps.defaultHeaderRowHeight = defaultHeaderRowHeight ?? defaultRowHeight;
|
|
@@ -57509,6 +57389,8 @@
|
|
|
57509
57389
|
this.clearCellStyleCache();
|
|
57510
57390
|
this.clearColWidthCache();
|
|
57511
57391
|
this.clearRowHeightCache();
|
|
57392
|
+
internalProps.customMergeCell = options.customMergeCell;
|
|
57393
|
+
this.customCellStylePlugin.updateCustomCell(options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
|
|
57512
57394
|
}
|
|
57513
57395
|
renderWithRecreateCells() {
|
|
57514
57396
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
@@ -58192,7 +58074,7 @@
|
|
|
58192
58074
|
if (bgColorFunc) {
|
|
58193
58075
|
cacheStyle = mergeStyle(cacheStyle, { bgColor: bgColorFunc });
|
|
58194
58076
|
}
|
|
58195
|
-
if (!isFunction$
|
|
58077
|
+
if (!isFunction$1(style)) {
|
|
58196
58078
|
if (layoutMap.isBottomFrozenRow(row)) {
|
|
58197
58079
|
this.bodyBottomStyleCache.set(cacheKey, cacheStyle);
|
|
58198
58080
|
}
|
|
@@ -58602,6 +58484,9 @@
|
|
|
58602
58484
|
measureText(text, font) {
|
|
58603
58485
|
return textMeasure.measureText(text, font);
|
|
58604
58486
|
}
|
|
58487
|
+
measureTextBounds(attribute) {
|
|
58488
|
+
return measureTextBounds(attribute);
|
|
58489
|
+
}
|
|
58605
58490
|
getCustomRender(col, row) {
|
|
58606
58491
|
let customRender;
|
|
58607
58492
|
if (this.getCellLocation(col, row) !== 'body') {
|
|
@@ -58692,7 +58577,7 @@
|
|
|
58692
58577
|
const { col: hoverCol, row: hoverRow } = this.stateManager.hover.cellPos;
|
|
58693
58578
|
this.stateManager.updateHoverPos(-1, -1);
|
|
58694
58579
|
this.scenegraph.renderSceneGraph();
|
|
58695
|
-
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds
|
|
58580
|
+
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
|
|
58696
58581
|
if (!isInView) {
|
|
58697
58582
|
this.setScrollTop(scrollTop);
|
|
58698
58583
|
this.setScrollLeft(scrollLeft);
|
|
@@ -58718,7 +58603,7 @@
|
|
|
58718
58603
|
start: { col: minCol, row: minRow },
|
|
58719
58604
|
end: { col: maxCol, row: maxRow }
|
|
58720
58605
|
});
|
|
58721
|
-
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds
|
|
58606
|
+
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
|
|
58722
58607
|
const base64Image = c.toDataURL();
|
|
58723
58608
|
if (!isInView || !isMaxCellInView) {
|
|
58724
58609
|
this.setScrollTop(scrollTop);
|
|
@@ -58744,7 +58629,7 @@
|
|
|
58744
58629
|
const buffer = stage.window.getImageBuffer(type);
|
|
58745
58630
|
return buffer;
|
|
58746
58631
|
}
|
|
58747
|
-
const newCanvas = this.scenegraph.stage.toCanvas(false, new AABBBounds
|
|
58632
|
+
const newCanvas = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(0, 0, Math.min(this.canvasWidth, contentWidth), Math.min(this.canvasHeight, contentHeight)));
|
|
58748
58633
|
const buffer = newCanvas.toBuffer(type);
|
|
58749
58634
|
return buffer;
|
|
58750
58635
|
}
|
|
@@ -59068,7 +58953,7 @@
|
|
|
59068
58953
|
let chartSpec = layout.getRawChartSpec(col, row);
|
|
59069
58954
|
if (chartSpec) {
|
|
59070
58955
|
if (layout._table.isPivotChart()) {
|
|
59071
|
-
chartSpec =
|
|
58956
|
+
chartSpec = cloneDeepSpec(chartSpec);
|
|
59072
58957
|
chartSpec.sortDataByAxis = true;
|
|
59073
58958
|
if (isArray$3(chartSpec.series)) {
|
|
59074
58959
|
chartSpec.series.forEach((serie) => {
|
|
@@ -59744,6 +59629,7 @@
|
|
|
59744
59629
|
columnTree;
|
|
59745
59630
|
bodyRowSpanCount = 1;
|
|
59746
59631
|
hierarchyIndent;
|
|
59632
|
+
hierarchyTextStartAlignment;
|
|
59747
59633
|
_transpose = false;
|
|
59748
59634
|
_showHeader = true;
|
|
59749
59635
|
_recordsCount = 0;
|
|
@@ -59760,6 +59646,7 @@
|
|
|
59760
59646
|
this._columns = [];
|
|
59761
59647
|
this._headerCellIds = [];
|
|
59762
59648
|
this.hierarchyIndent = hierarchyIndent ?? 20;
|
|
59649
|
+
this.hierarchyTextStartAlignment = table.options.hierarchyTextStartAlignment;
|
|
59763
59650
|
this.columnTree = new DimensionTree(columns, { seqId: 0 });
|
|
59764
59651
|
this._headerObjects = this._addHeaders(0, columns, []);
|
|
59765
59652
|
this._headerObjectMap = this._headerObjects.reduce((o, e) => {
|
|
@@ -61283,9 +61170,9 @@
|
|
|
61283
61170
|
internalProps.sortState = options.sortState;
|
|
61284
61171
|
internalProps.dataConfig = {};
|
|
61285
61172
|
internalProps.columns = options.columns
|
|
61286
|
-
?
|
|
61173
|
+
? cloneDeepSpec(options.columns)
|
|
61287
61174
|
: options.header
|
|
61288
|
-
?
|
|
61175
|
+
? cloneDeepSpec(options.header)
|
|
61289
61176
|
: [];
|
|
61290
61177
|
options.columns?.forEach((colDefine, index) => {
|
|
61291
61178
|
if (colDefine.editor) {
|
|
@@ -61335,7 +61222,7 @@
|
|
|
61335
61222
|
}
|
|
61336
61223
|
updateColumns(columns) {
|
|
61337
61224
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
61338
|
-
this.internalProps.columns =
|
|
61225
|
+
this.internalProps.columns = cloneDeepSpec(columns);
|
|
61339
61226
|
columns.forEach((colDefine, index) => {
|
|
61340
61227
|
if (colDefine.editor) {
|
|
61341
61228
|
this.internalProps.columns[index].editor = colDefine.editor;
|
|
@@ -61521,9 +61408,9 @@
|
|
|
61521
61408
|
internalProps.dataConfig = {};
|
|
61522
61409
|
this.showHeader = options.showHeader ?? true;
|
|
61523
61410
|
internalProps.columns = options.columns
|
|
61524
|
-
?
|
|
61411
|
+
? cloneDeepSpec(options.columns)
|
|
61525
61412
|
: options.header
|
|
61526
|
-
?
|
|
61413
|
+
? cloneDeepSpec(options.header)
|
|
61527
61414
|
: [];
|
|
61528
61415
|
options.columns.forEach((colDefine, index) => {
|
|
61529
61416
|
if (colDefine.editor) {
|
|
@@ -61770,6 +61657,7 @@
|
|
|
61770
61657
|
return this.dataSource.getHierarchyState(index);
|
|
61771
61658
|
}
|
|
61772
61659
|
toggleHierarchyState(col, row) {
|
|
61660
|
+
this.stateManager.updateHoverIcon(col, row, undefined, undefined);
|
|
61773
61661
|
const hierarchyState = this.getHierarchyState(col, row);
|
|
61774
61662
|
if (hierarchyState === HierarchyState.expand) {
|
|
61775
61663
|
this._refreshHierarchyState(col, row);
|
|
@@ -61984,6 +61872,11 @@
|
|
|
61984
61872
|
this.scenegraph.resize();
|
|
61985
61873
|
}
|
|
61986
61874
|
this.render();
|
|
61875
|
+
if (isValid$3(oldHoverState.col) && isValid$3(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0) {
|
|
61876
|
+
setTimeout(() => {
|
|
61877
|
+
this.internalProps.tooltipHandler.showTooltip(oldHoverState.col, oldHoverState.row);
|
|
61878
|
+
}, 0);
|
|
61879
|
+
}
|
|
61987
61880
|
}
|
|
61988
61881
|
setRecordChildren(records, col, row) {
|
|
61989
61882
|
const record = this.getCellOriginRecord(col, row);
|
|
@@ -62618,6 +62511,7 @@
|
|
|
62618
62511
|
rowHierarchyType;
|
|
62619
62512
|
rowExpandLevel;
|
|
62620
62513
|
rowHierarchyIndent;
|
|
62514
|
+
rowHierarchyTextStartAlignment = false;
|
|
62621
62515
|
rowDimensionKeys = [];
|
|
62622
62516
|
colDimensionKeys = [];
|
|
62623
62517
|
indicatorKeys = [];
|
|
@@ -62671,6 +62565,7 @@
|
|
|
62671
62565
|
this.rowHierarchyType = table.options.rowHierarchyType ?? 'grid';
|
|
62672
62566
|
this.rowExpandLevel = table.options.rowExpandLevel ?? 1;
|
|
62673
62567
|
this.rowHierarchyIndent = table.options.rowHierarchyIndent ?? 20;
|
|
62568
|
+
this.rowHierarchyTextStartAlignment = table.options.rowHierarchyTextStartAlignment;
|
|
62674
62569
|
this.cornerSetting = table.options.corner ?? { titleOnDimension: 'column' };
|
|
62675
62570
|
if (dataset) {
|
|
62676
62571
|
this.rowTree = dataset.rowHeaderTree;
|
|
@@ -66243,7 +66138,7 @@
|
|
|
66243
66138
|
}
|
|
66244
66139
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
66245
66140
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
66246
|
-
this.internalProps.indicators =
|
|
66141
|
+
this.internalProps.indicators = cloneDeepSpec(options.indicators);
|
|
66247
66142
|
options.indicators?.forEach((indicatorDefine, index) => {
|
|
66248
66143
|
if (typeof indicatorDefine === 'object' && indicatorDefine?.editor) {
|
|
66249
66144
|
this.internalProps.indicators[index].editor = indicatorDefine.editor;
|
|
@@ -66360,7 +66255,7 @@
|
|
|
66360
66255
|
super.updateOption(options);
|
|
66361
66256
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
66362
66257
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
66363
|
-
this.internalProps.indicators = !options.indicators?.length ? [] :
|
|
66258
|
+
this.internalProps.indicators = !options.indicators?.length ? [] : cloneDeepSpec(options.indicators);
|
|
66364
66259
|
options.indicators?.forEach((indicatorDefine, index) => {
|
|
66365
66260
|
if (typeof indicatorDefine === 'object' && indicatorDefine?.editor) {
|
|
66366
66261
|
this.internalProps.indicators[index].editor = indicatorDefine.editor;
|
|
@@ -66825,6 +66720,7 @@
|
|
|
66825
66720
|
toggleHierarchyState(col, row) {
|
|
66826
66721
|
let notFillWidth = false;
|
|
66827
66722
|
let notFillHeight = false;
|
|
66723
|
+
this.stateManager.updateHoverIcon(col, row, undefined, undefined);
|
|
66828
66724
|
const checkHasChart = this.internalProps.layoutMap.checkHasChart();
|
|
66829
66725
|
if (checkHasChart) {
|
|
66830
66726
|
if (this.autoFillWidth) {
|
|
@@ -67197,7 +67093,7 @@
|
|
|
67197
67093
|
}
|
|
67198
67094
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
67199
67095
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
67200
|
-
this.internalProps.indicators =
|
|
67096
|
+
this.internalProps.indicators = cloneDeepSpec(options.indicators);
|
|
67201
67097
|
this.internalProps.columnTree =
|
|
67202
67098
|
options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep(options.columnTree);
|
|
67203
67099
|
this.internalProps.rowTree =
|
|
@@ -67284,7 +67180,7 @@
|
|
|
67284
67180
|
super.updateOption(options);
|
|
67285
67181
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
67286
67182
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
67287
|
-
this.internalProps.indicators = !options.indicators?.length ? [] :
|
|
67183
|
+
this.internalProps.indicators = !options.indicators?.length ? [] : cloneDeepSpec(options.indicators);
|
|
67288
67184
|
this.internalProps.columnTree =
|
|
67289
67185
|
options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep(options.columnTree);
|
|
67290
67186
|
this.internalProps.rowTree =
|
|
@@ -68125,7 +68021,7 @@
|
|
|
68125
68021
|
cache;
|
|
68126
68022
|
constructor(options) {
|
|
68127
68023
|
let cache;
|
|
68128
|
-
if (isString$
|
|
68024
|
+
if (isString$2(options.iconName)) {
|
|
68129
68025
|
const regedIcons = get$2();
|
|
68130
68026
|
cache = regedIcons[options.iconName];
|
|
68131
68027
|
if (cache) {
|
|
@@ -68551,7 +68447,7 @@
|
|
|
68551
68447
|
}
|
|
68552
68448
|
|
|
68553
68449
|
registerForVrender();
|
|
68554
|
-
const version = "0.23.
|
|
68450
|
+
const version = "0.23.3";
|
|
68555
68451
|
function getIcons() {
|
|
68556
68452
|
return get$2();
|
|
68557
68453
|
}
|