@visactor/vtable-gantt 1.17.1-alpha.8 → 1.17.1-alpha.9
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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/tools/inertia.js +1 -2
- package/cjs/ts-types/gantt-engine.js +2 -1
- package/dist/vtable-gantt.js +605 -1116
- package/dist/vtable-gantt.min.js +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/tools/inertia.js +1 -2
- package/es/ts-types/gantt-engine.js +2 -1
- package/package.json +3 -3
package/dist/vtable-gantt.js
CHANGED
|
@@ -1158,72 +1158,72 @@
|
|
|
1158
1158
|
var eventemitter3Exports = eventemitter3.exports;
|
|
1159
1159
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
1160
1160
|
|
|
1161
|
-
const isType$
|
|
1162
|
-
var isType$
|
|
1161
|
+
const isType$2 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
1162
|
+
var isType$3 = isType$2;
|
|
1163
1163
|
|
|
1164
|
-
const isBoolean$
|
|
1164
|
+
const isBoolean$3 = function (value) {
|
|
1165
1165
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1166
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$
|
|
1166
|
+
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$3(value, "Boolean");
|
|
1167
1167
|
};
|
|
1168
|
-
var isBoolean$
|
|
1168
|
+
var isBoolean$4 = isBoolean$3;
|
|
1169
1169
|
|
|
1170
|
-
const isFunction$
|
|
1171
|
-
var isFunction$
|
|
1170
|
+
const isFunction$4 = value => "function" == typeof value;
|
|
1171
|
+
var isFunction$5 = isFunction$4;
|
|
1172
1172
|
|
|
1173
|
-
const isNil$
|
|
1174
|
-
var isNil$
|
|
1173
|
+
const isNil$2 = value => null == value;
|
|
1174
|
+
var isNil$3 = isNil$2;
|
|
1175
1175
|
|
|
1176
|
-
const isValid$
|
|
1177
|
-
var isValid$
|
|
1176
|
+
const isValid$2 = value => null != value;
|
|
1177
|
+
var isValid$3 = isValid$2;
|
|
1178
1178
|
|
|
1179
|
-
const isObject$
|
|
1179
|
+
const isObject$7 = value => {
|
|
1180
1180
|
const type = typeof value;
|
|
1181
1181
|
return null !== value && "object" === type || "function" === type;
|
|
1182
1182
|
};
|
|
1183
|
-
var isObject$
|
|
1183
|
+
var isObject$8 = isObject$7;
|
|
1184
1184
|
|
|
1185
|
-
const isObjectLike$
|
|
1186
|
-
var isObjectLike$
|
|
1185
|
+
const isObjectLike$4 = value => "object" == typeof value && null !== value;
|
|
1186
|
+
var isObjectLike$5 = isObjectLike$4;
|
|
1187
1187
|
|
|
1188
|
-
const isPlainObject$
|
|
1189
|
-
if (!isObjectLike$
|
|
1188
|
+
const isPlainObject$2 = function (value) {
|
|
1189
|
+
if (!isObjectLike$5(value) || !isType$3(value, "Object")) return !1;
|
|
1190
1190
|
if (null === Object.getPrototypeOf(value)) return !0;
|
|
1191
1191
|
let proto = value;
|
|
1192
1192
|
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
1193
1193
|
return Object.getPrototypeOf(value) === proto;
|
|
1194
1194
|
};
|
|
1195
|
-
var isPlainObject$
|
|
1195
|
+
var isPlainObject$3 = isPlainObject$2;
|
|
1196
1196
|
|
|
1197
1197
|
const isUndefined = value => void 0 === value;
|
|
1198
1198
|
var isUndefined$1 = isUndefined;
|
|
1199
1199
|
|
|
1200
|
-
const isString$
|
|
1200
|
+
const isString$3 = function (value) {
|
|
1201
1201
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1202
1202
|
const type = typeof value;
|
|
1203
|
-
return fuzzy ? "string" === type : "string" === type || isType$
|
|
1203
|
+
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
1204
1204
|
};
|
|
1205
|
-
var isString$
|
|
1205
|
+
var isString$4 = isString$3;
|
|
1206
1206
|
|
|
1207
|
-
const isArray$
|
|
1208
|
-
var isArray$
|
|
1207
|
+
const isArray$6 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
1208
|
+
var isArray$7 = isArray$6;
|
|
1209
1209
|
|
|
1210
|
-
const isArrayLike$
|
|
1210
|
+
const isArrayLike$2 = function (value) {
|
|
1211
1211
|
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
1212
1212
|
};
|
|
1213
|
-
var isArrayLike$
|
|
1213
|
+
var isArrayLike$3 = isArrayLike$2;
|
|
1214
1214
|
|
|
1215
|
-
const isDate$
|
|
1216
|
-
var isDate$
|
|
1215
|
+
const isDate$2 = value => isType$3(value, "Date");
|
|
1216
|
+
var isDate$3 = isDate$2;
|
|
1217
1217
|
|
|
1218
|
-
const isNumber$
|
|
1218
|
+
const isNumber$3 = function (value) {
|
|
1219
1219
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1220
1220
|
const type = typeof value;
|
|
1221
|
-
return fuzzy ? "number" === type : "number" === type || isType$
|
|
1221
|
+
return fuzzy ? "number" === type : "number" === type || isType$3(value, "Number");
|
|
1222
1222
|
};
|
|
1223
|
-
var isNumber$
|
|
1223
|
+
var isNumber$4 = isNumber$3;
|
|
1224
1224
|
|
|
1225
|
-
const isValidNumber
|
|
1226
|
-
var isValidNumber$
|
|
1225
|
+
const isValidNumber = value => isNumber$4(value) && Number.isFinite(value);
|
|
1226
|
+
var isValidNumber$1 = isValidNumber;
|
|
1227
1227
|
|
|
1228
1228
|
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
1229
1229
|
var isValidUrl$1 = isValidUrl;
|
|
@@ -1231,60 +1231,60 @@
|
|
|
1231
1231
|
const isBase64 = value => new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(value);
|
|
1232
1232
|
var isBase64$1 = isBase64;
|
|
1233
1233
|
|
|
1234
|
-
const getType
|
|
1235
|
-
var getType$
|
|
1234
|
+
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
1235
|
+
var getType$1 = getType;
|
|
1236
1236
|
|
|
1237
|
-
const objectProto$
|
|
1238
|
-
isPrototype
|
|
1237
|
+
const objectProto$5 = Object.prototype,
|
|
1238
|
+
isPrototype = function (value) {
|
|
1239
1239
|
const Ctor = value && value.constructor;
|
|
1240
|
-
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto$
|
|
1240
|
+
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto$5);
|
|
1241
1241
|
};
|
|
1242
|
-
var isPrototype$
|
|
1242
|
+
var isPrototype$1 = isPrototype;
|
|
1243
1243
|
|
|
1244
|
-
const hasOwnProperty$
|
|
1245
|
-
function isEmpty
|
|
1246
|
-
if (isNil$
|
|
1247
|
-
if (isArrayLike$
|
|
1248
|
-
const type = getType$
|
|
1244
|
+
const hasOwnProperty$5 = Object.prototype.hasOwnProperty;
|
|
1245
|
+
function isEmpty(value) {
|
|
1246
|
+
if (isNil$3(value)) return !0;
|
|
1247
|
+
if (isArrayLike$3(value)) return !value.length;
|
|
1248
|
+
const type = getType$1(value);
|
|
1249
1249
|
if ("Map" === type || "Set" === type) return !value.size;
|
|
1250
|
-
if (isPrototype$
|
|
1251
|
-
for (const key in value) if (hasOwnProperty$
|
|
1250
|
+
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
1251
|
+
for (const key in value) if (hasOwnProperty$5.call(value, key)) return !1;
|
|
1252
1252
|
return !0;
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
|
-
const get$
|
|
1256
|
-
const paths = isString$
|
|
1255
|
+
const get$6 = (obj, path, defaultValue) => {
|
|
1256
|
+
const paths = isString$4(path) ? path.split(".") : path;
|
|
1257
1257
|
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
1258
1258
|
return void 0 === obj ? defaultValue : obj;
|
|
1259
1259
|
};
|
|
1260
|
-
var get$
|
|
1260
|
+
var get$7 = get$6;
|
|
1261
1261
|
|
|
1262
|
-
const hasOwnProperty$
|
|
1263
|
-
has = (object, key) => null != object && hasOwnProperty$
|
|
1262
|
+
const hasOwnProperty$4 = Object.prototype.hasOwnProperty,
|
|
1263
|
+
has = (object, key) => null != object && hasOwnProperty$4.call(object, key);
|
|
1264
1264
|
var has$1 = has;
|
|
1265
1265
|
|
|
1266
|
-
function cloneDeep$
|
|
1266
|
+
function cloneDeep$1(value, ignoreWhen, excludeKeys) {
|
|
1267
1267
|
let result;
|
|
1268
|
-
if (!isValid$
|
|
1269
|
-
const isArr = isArray$
|
|
1268
|
+
if (!isValid$3(value) || "object" != typeof value || ignoreWhen && ignoreWhen(value)) return value;
|
|
1269
|
+
const isArr = isArray$7(value),
|
|
1270
1270
|
length = value.length;
|
|
1271
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$
|
|
1271
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$4(value) || isNumber$4(value) || isString$4(value) ? value : isDate$3(value) ? new Date(+value) : void 0;
|
|
1272
1272
|
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
1273
1273
|
let index = -1;
|
|
1274
1274
|
if (result) for (; ++index < (props || value).length;) {
|
|
1275
1275
|
const key = props ? props[index] : index,
|
|
1276
1276
|
subValue = value[key];
|
|
1277
|
-
excludeKeys && excludeKeys.includes(key.toString()) ? result[key] = subValue : result[key] = cloneDeep$
|
|
1277
|
+
excludeKeys && excludeKeys.includes(key.toString()) ? result[key] = subValue : result[key] = cloneDeep$1(subValue, ignoreWhen, excludeKeys);
|
|
1278
1278
|
}
|
|
1279
1279
|
return result;
|
|
1280
1280
|
}
|
|
1281
1281
|
|
|
1282
|
-
function baseMerge$
|
|
1282
|
+
function baseMerge$1(target, source) {
|
|
1283
1283
|
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1284
1284
|
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1285
1285
|
if (source) {
|
|
1286
1286
|
if (target === source) return;
|
|
1287
|
-
if (isValid$
|
|
1287
|
+
if (isValid$3(source) && "object" == typeof source) {
|
|
1288
1288
|
const iterable = Object(source),
|
|
1289
1289
|
props = [];
|
|
1290
1290
|
for (const key in iterable) props.push(key);
|
|
@@ -1294,43 +1294,87 @@
|
|
|
1294
1294
|
propIndex = -1;
|
|
1295
1295
|
for (; length--;) {
|
|
1296
1296
|
const key = props[++propIndex];
|
|
1297
|
-
!isValid$
|
|
1297
|
+
!isValid$3(iterable[key]) || "object" != typeof iterable[key] || skipTargetArray && isArray$7(target[key]) ? assignMergeValue$1(target, key, iterable[key]) : baseMergeDeep$1(target, source, key, shallowArray, skipTargetArray);
|
|
1298
1298
|
}
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
1301
|
}
|
|
1302
|
-
function baseMergeDeep$
|
|
1302
|
+
function baseMergeDeep$1(target, source, key) {
|
|
1303
1303
|
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1304
1304
|
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
1305
1305
|
const objValue = target[key],
|
|
1306
1306
|
srcValue = source[key];
|
|
1307
1307
|
let newValue = source[key],
|
|
1308
1308
|
isCommon = !0;
|
|
1309
|
-
if (isArray$
|
|
1310
|
-
if (shallowArray) newValue = [];else if (isArray$
|
|
1309
|
+
if (isArray$7(srcValue)) {
|
|
1310
|
+
if (shallowArray) newValue = [];else if (isArray$7(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
1311
1311
|
newValue = new Array(objValue.length);
|
|
1312
1312
|
let index = -1;
|
|
1313
1313
|
const length = objValue.length;
|
|
1314
1314
|
for (; ++index < length;) newValue[index] = objValue[index];
|
|
1315
1315
|
}
|
|
1316
|
-
} else isPlainObject$
|
|
1317
|
-
isCommon && baseMerge$
|
|
1316
|
+
} else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
1317
|
+
isCommon && baseMerge$1(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue$1(target, key, newValue);
|
|
1318
1318
|
}
|
|
1319
|
-
function assignMergeValue$
|
|
1320
|
-
(void 0 !== value && !eq$
|
|
1319
|
+
function assignMergeValue$1(target, key, value) {
|
|
1320
|
+
(void 0 !== value && !eq$3(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
1321
1321
|
}
|
|
1322
|
-
function eq$
|
|
1322
|
+
function eq$3(value, other) {
|
|
1323
1323
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
1324
1324
|
}
|
|
1325
|
-
function merge$
|
|
1325
|
+
function merge$1(target) {
|
|
1326
1326
|
let sourceIndex = -1;
|
|
1327
1327
|
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
1328
1328
|
for (; ++sourceIndex < length;) {
|
|
1329
|
-
baseMerge$
|
|
1329
|
+
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
1330
1330
|
}
|
|
1331
1331
|
return target;
|
|
1332
1332
|
}
|
|
1333
1333
|
|
|
1334
|
+
function pickWithout(obj, keys) {
|
|
1335
|
+
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
1336
|
+
const result = {};
|
|
1337
|
+
return Object.keys(obj).forEach(k => {
|
|
1338
|
+
const v = obj[k];
|
|
1339
|
+
let match = !1;
|
|
1340
|
+
keys.forEach(itKey => {
|
|
1341
|
+
(isString$4(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
1342
|
+
}), match || (result[k] = v);
|
|
1343
|
+
}), result;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
function objToString(obj) {
|
|
1347
|
+
return Object.prototype.toString.call(obj);
|
|
1348
|
+
}
|
|
1349
|
+
function objectKeys(obj) {
|
|
1350
|
+
return Object.keys(obj);
|
|
1351
|
+
}
|
|
1352
|
+
function isEqual(a, b, options) {
|
|
1353
|
+
if (a === b) return !0;
|
|
1354
|
+
if (typeof a != typeof b) return !1;
|
|
1355
|
+
if (null == a || null == b) return !1;
|
|
1356
|
+
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
1357
|
+
if (objToString(a) !== objToString(b)) return !1;
|
|
1358
|
+
if (isFunction$5(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
1359
|
+
if ("object" != typeof a) return !1;
|
|
1360
|
+
if (isArray$7(a)) {
|
|
1361
|
+
if (a.length !== b.length) return !1;
|
|
1362
|
+
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
1363
|
+
return !0;
|
|
1364
|
+
}
|
|
1365
|
+
if (!isPlainObject$3(a)) return !1;
|
|
1366
|
+
const ka = objectKeys(a),
|
|
1367
|
+
kb = objectKeys(b);
|
|
1368
|
+
if (ka.length !== kb.length) return !1;
|
|
1369
|
+
ka.sort(), kb.sort();
|
|
1370
|
+
for (let i = ka.length - 1; i >= 0; i--) if (ka[i] != kb[i]) return !1;
|
|
1371
|
+
for (let i = ka.length - 1; i >= 0; i--) {
|
|
1372
|
+
const key = ka[i];
|
|
1373
|
+
if (!isEqual(a[key], b[key], options)) return !1;
|
|
1374
|
+
}
|
|
1375
|
+
return !0;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1334
1378
|
function keys$1(obj) {
|
|
1335
1379
|
if (!obj) return [];
|
|
1336
1380
|
if (Object.keys) return Object.keys(obj);
|
|
@@ -1358,14 +1402,14 @@
|
|
|
1358
1402
|
}
|
|
1359
1403
|
|
|
1360
1404
|
function array$1(arr) {
|
|
1361
|
-
return isValid$
|
|
1405
|
+
return isValid$3(arr) ? isArray$7(arr) ? arr : [arr] : [];
|
|
1362
1406
|
}
|
|
1363
|
-
function last
|
|
1364
|
-
if (isArrayLike$
|
|
1407
|
+
function last(val) {
|
|
1408
|
+
if (isArrayLike$3(val)) {
|
|
1365
1409
|
return val[val.length - 1];
|
|
1366
1410
|
}
|
|
1367
1411
|
}
|
|
1368
|
-
const maxInArray
|
|
1412
|
+
const maxInArray = (arr, compareFn) => {
|
|
1369
1413
|
var _a;
|
|
1370
1414
|
if (0 === arr.length) return;
|
|
1371
1415
|
let max = arr[0];
|
|
@@ -1375,7 +1419,7 @@
|
|
|
1375
1419
|
}
|
|
1376
1420
|
return max;
|
|
1377
1421
|
};
|
|
1378
|
-
const minInArray
|
|
1422
|
+
const minInArray = (arr, compareFn) => {
|
|
1379
1423
|
var _a;
|
|
1380
1424
|
if (0 === arr.length) return;
|
|
1381
1425
|
let min = arr[0];
|
|
@@ -1385,21 +1429,21 @@
|
|
|
1385
1429
|
}
|
|
1386
1430
|
return min;
|
|
1387
1431
|
};
|
|
1388
|
-
function arrayEqual
|
|
1389
|
-
if (!isArray$
|
|
1432
|
+
function arrayEqual(a, b) {
|
|
1433
|
+
if (!isArray$7(a) || !isArray$7(b)) return !1;
|
|
1390
1434
|
if (a.length !== b.length) return !1;
|
|
1391
1435
|
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
1392
1436
|
return !0;
|
|
1393
1437
|
}
|
|
1394
1438
|
function flattenArray(arr) {
|
|
1395
|
-
if (!isArray$
|
|
1439
|
+
if (!isArray$7(arr)) return [arr];
|
|
1396
1440
|
const result = [];
|
|
1397
1441
|
for (const value of arr) result.push(...flattenArray(value));
|
|
1398
1442
|
return result;
|
|
1399
1443
|
}
|
|
1400
1444
|
|
|
1401
1445
|
function range$1(start, stop, step) {
|
|
1402
|
-
isValid$
|
|
1446
|
+
isValid$3(stop) || (stop = start, start = 0), isValid$3(step) || (step = 1);
|
|
1403
1447
|
let i = -1;
|
|
1404
1448
|
const n = 0 | Math.max(0, Math.ceil((stop - start) / step)),
|
|
1405
1449
|
range = new Array(n);
|
|
@@ -1426,7 +1470,7 @@
|
|
|
1426
1470
|
}(LoggerLevel$1 || (LoggerLevel$1 = {}));
|
|
1427
1471
|
let Logger$1 = class Logger {
|
|
1428
1472
|
static getInstance(level, method) {
|
|
1429
|
-
return Logger._instance && isNumber$
|
|
1473
|
+
return Logger._instance && isNumber$4(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1430
1474
|
}
|
|
1431
1475
|
static setInstance(logger) {
|
|
1432
1476
|
return Logger._instance = logger;
|
|
@@ -1501,7 +1545,7 @@
|
|
|
1501
1545
|
function bisect$1(a, x) {
|
|
1502
1546
|
let lo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1503
1547
|
let hi = arguments.length > 3 ? arguments[3] : undefined;
|
|
1504
|
-
for (isNil$
|
|
1548
|
+
for (isNil$3(hi) && (hi = a.length); lo < hi;) {
|
|
1505
1549
|
const mid = lo + hi >>> 1;
|
|
1506
1550
|
ascending$1(a[mid], x) > 0 ? hi = mid : lo = mid + 1;
|
|
1507
1551
|
}
|
|
@@ -1613,7 +1657,7 @@
|
|
|
1613
1657
|
}
|
|
1614
1658
|
return void 0 === timerId && (timerId = startTimer(timerExpired, wait)), result;
|
|
1615
1659
|
}
|
|
1616
|
-
return wait = +wait || 0, isObject$
|
|
1660
|
+
return wait = +wait || 0, isObject$8(options) && (leading = !!options.leading, maxing = "maxWait" in options, maxing && (maxWait = Math.max(isValidNumber$1(options.maxWait) ? options.maxWait : 0, wait)), trailing = "trailing" in options ? !!options.trailing : trailing), debounced.cancel = function () {
|
|
1617
1661
|
void 0 !== timerId && function (id) {
|
|
1618
1662
|
if (useRAF) return cancelAnimationFrame(id);
|
|
1619
1663
|
clearTimeout(id);
|
|
@@ -1630,7 +1674,7 @@
|
|
|
1630
1674
|
let leading = !0,
|
|
1631
1675
|
trailing = !0;
|
|
1632
1676
|
if ("function" != typeof func) throw new TypeError("Expected a function");
|
|
1633
|
-
return isObject$
|
|
1677
|
+
return isObject$8(options) && (leading = "leading" in options ? !!options.leading : leading, trailing = "trailing" in options ? !!options.trailing : trailing), debounce$2(func, wait, {
|
|
1634
1678
|
leading: leading,
|
|
1635
1679
|
trailing: trailing,
|
|
1636
1680
|
maxWait: wait
|
|
@@ -1701,10 +1745,10 @@
|
|
|
1701
1745
|
return this.x = x, this.y = y, this;
|
|
1702
1746
|
}
|
|
1703
1747
|
add(point) {
|
|
1704
|
-
return isNumber$
|
|
1748
|
+
return isNumber$4(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1705
1749
|
}
|
|
1706
1750
|
sub(point) {
|
|
1707
|
-
return isNumber$
|
|
1751
|
+
return isNumber$4(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1708
1752
|
}
|
|
1709
1753
|
multi(point) {
|
|
1710
1754
|
throw new Error("暂不支持");
|
|
@@ -1728,7 +1772,7 @@
|
|
|
1728
1772
|
}
|
|
1729
1773
|
}
|
|
1730
1774
|
|
|
1731
|
-
function degreeToRadian
|
|
1775
|
+
function degreeToRadian(degree) {
|
|
1732
1776
|
return degree * (Math.PI / 180);
|
|
1733
1777
|
}
|
|
1734
1778
|
function radianToDegree(radian) {
|
|
@@ -1859,7 +1903,7 @@
|
|
|
1859
1903
|
};
|
|
1860
1904
|
}
|
|
1861
1905
|
function toRect(box, isDeg) {
|
|
1862
|
-
const deg = isDeg ? degreeToRadian
|
|
1906
|
+
const deg = isDeg ? degreeToRadian(box.angle) : box.angle,
|
|
1863
1907
|
cp = getCenterPoint(box);
|
|
1864
1908
|
return [rotatePoint({
|
|
1865
1909
|
x: box.x1,
|
|
@@ -1885,10 +1929,10 @@
|
|
|
1885
1929
|
BC = vector(rect1[1], rect1[2]),
|
|
1886
1930
|
A1B1 = vector(rect2[0], rect2[1]),
|
|
1887
1931
|
B1C1 = vector(rect2[1], rect2[2]),
|
|
1888
|
-
deg11 = isDeg ? degreeToRadian
|
|
1889
|
-
let deg12 = isDeg ? degreeToRadian
|
|
1890
|
-
const deg21 = isDeg ? degreeToRadian
|
|
1891
|
-
let deg22 = isDeg ? degreeToRadian
|
|
1932
|
+
deg11 = isDeg ? degreeToRadian(box1.angle) : box1.angle;
|
|
1933
|
+
let deg12 = isDeg ? degreeToRadian(90 - box1.angle) : box1.angle + halfPi$1;
|
|
1934
|
+
const deg21 = isDeg ? degreeToRadian(box2.angle) : box2.angle;
|
|
1935
|
+
let deg22 = isDeg ? degreeToRadian(90 - box2.angle) : box2.angle + halfPi$1;
|
|
1892
1936
|
deg12 > pi2 && (deg12 -= pi2), deg22 > pi2 && (deg22 -= pi2);
|
|
1893
1937
|
const isCover = (checkAxisRadius, deg, targetAxis1, targetAxis2) => {
|
|
1894
1938
|
const checkAxis = [Math.cos(deg), Math.sin(deg)];
|
|
@@ -1897,14 +1941,14 @@
|
|
|
1897
1941
|
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);
|
|
1898
1942
|
}
|
|
1899
1943
|
|
|
1900
|
-
const eastAsianCharacterInfo
|
|
1944
|
+
const eastAsianCharacterInfo = character => {
|
|
1901
1945
|
let x = character.charCodeAt(0),
|
|
1902
1946
|
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
1903
1947
|
codePoint = x;
|
|
1904
1948
|
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";
|
|
1905
1949
|
};
|
|
1906
1950
|
|
|
1907
|
-
function getContextFont
|
|
1951
|
+
function getContextFont(text) {
|
|
1908
1952
|
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1909
1953
|
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
1910
1954
|
fontSizeScale || (fontSizeScale = 1);
|
|
@@ -1918,17 +1962,17 @@
|
|
|
1918
1962
|
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
1919
1963
|
}
|
|
1920
1964
|
|
|
1921
|
-
|
|
1965
|
+
class TextMeasure {
|
|
1922
1966
|
constructor(option, textSpec) {
|
|
1923
|
-
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$
|
|
1967
|
+
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);
|
|
1924
1968
|
}
|
|
1925
1969
|
initContext() {
|
|
1926
1970
|
if (this._notSupportCanvas) return !1;
|
|
1927
|
-
if (isNil$
|
|
1971
|
+
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)) {
|
|
1928
1972
|
const context = this._canvas.getContext("2d");
|
|
1929
|
-
isValid$
|
|
1973
|
+
isValid$3(context) && (context.save(), context.font = getContextFont(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
1930
1974
|
}
|
|
1931
|
-
return !isNil$
|
|
1975
|
+
return !isNil$3(this._context) || (this._notSupportCanvas = !0, !1);
|
|
1932
1976
|
}
|
|
1933
1977
|
_initSpec() {
|
|
1934
1978
|
var _a, _b, _c;
|
|
@@ -1951,7 +1995,7 @@
|
|
|
1951
1995
|
let {
|
|
1952
1996
|
lineHeight = fontSize
|
|
1953
1997
|
} = this._userSpec;
|
|
1954
|
-
if (isString$
|
|
1998
|
+
if (isString$4(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
1955
1999
|
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
1956
2000
|
lineHeight = fontSize * scale;
|
|
1957
2001
|
}
|
|
@@ -1982,11 +2026,11 @@
|
|
|
1982
2026
|
}
|
|
1983
2027
|
}
|
|
1984
2028
|
fullMeasure(text) {
|
|
1985
|
-
if (isNil$
|
|
2029
|
+
if (isNil$3(text)) return {
|
|
1986
2030
|
width: 0,
|
|
1987
2031
|
height: 0
|
|
1988
2032
|
};
|
|
1989
|
-
if (isNil$
|
|
2033
|
+
if (isNil$3(this._option.getTextBounds) || !this._notSupportVRender) return this.measureWithNaiveCanvas(text);
|
|
1990
2034
|
const {
|
|
1991
2035
|
fontFamily: fontFamily,
|
|
1992
2036
|
fontSize: fontSize,
|
|
@@ -2048,7 +2092,7 @@
|
|
|
2048
2092
|
for (let i = 0; i < text.length; i++) {
|
|
2049
2093
|
const char = text[i];
|
|
2050
2094
|
let size = this._measureSpecialChar(char);
|
|
2051
|
-
isNil$
|
|
2095
|
+
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), !isNil$3(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent), !isNil$3(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
|
|
2052
2096
|
}
|
|
2053
2097
|
return totalSize;
|
|
2054
2098
|
}
|
|
@@ -2067,7 +2111,7 @@
|
|
|
2067
2111
|
} = this.textSpec;
|
|
2068
2112
|
for (let i = 0; i < text.length; i++) {
|
|
2069
2113
|
const char = text[i],
|
|
2070
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo
|
|
2114
|
+
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
2071
2115
|
totalSize.width += size * fontSize;
|
|
2072
2116
|
}
|
|
2073
2117
|
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
@@ -2082,9 +2126,9 @@
|
|
|
2082
2126
|
width: 0,
|
|
2083
2127
|
height: 0
|
|
2084
2128
|
};
|
|
2085
|
-
if (isNil$
|
|
2086
|
-
if (isArray$
|
|
2087
|
-
const textArr = text.filter(isValid$
|
|
2129
|
+
if (isNil$3(text)) return defaultResult;
|
|
2130
|
+
if (isArray$7(text)) {
|
|
2131
|
+
const textArr = text.filter(isValid$3).map(s => s.toString());
|
|
2088
2132
|
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
2089
2133
|
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
2090
2134
|
height: textArr.length * ((null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize) + 1) + 1
|
|
@@ -2093,7 +2137,7 @@
|
|
|
2093
2137
|
return processor(text.toString());
|
|
2094
2138
|
}
|
|
2095
2139
|
_measureNumberChar() {
|
|
2096
|
-
if (isNil$
|
|
2140
|
+
if (isNil$3(this._numberCharSize)) {
|
|
2097
2141
|
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
2098
2142
|
this._numberCharSize = {
|
|
2099
2143
|
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
@@ -2105,10 +2149,10 @@
|
|
|
2105
2149
|
return this._numberCharSize;
|
|
2106
2150
|
}
|
|
2107
2151
|
_measureFullSizeChar() {
|
|
2108
|
-
return isNil$
|
|
2152
|
+
return isNil$3(this._fullCharSize) && (this._fullCharSize = this._standardMethod(TextMeasure.FULL_SIZE_CHAR)), this._fullCharSize;
|
|
2109
2153
|
}
|
|
2110
2154
|
_measureLetterChar() {
|
|
2111
|
-
if (isNil$
|
|
2155
|
+
if (isNil$3(this._letterCharSize)) {
|
|
2112
2156
|
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
2113
2157
|
this._letterCharSize = {
|
|
2114
2158
|
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
@@ -2120,15 +2164,15 @@
|
|
|
2120
2164
|
return this._letterCharSize;
|
|
2121
2165
|
}
|
|
2122
2166
|
_measureSpecialChar(char) {
|
|
2123
|
-
return isValid$
|
|
2167
|
+
return isValid$3(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
2124
2168
|
}
|
|
2125
2169
|
release() {
|
|
2126
|
-
isValid$
|
|
2170
|
+
isValid$3(this._canvas) && (this._canvas = null), isValid$3(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
2127
2171
|
}
|
|
2128
|
-
}
|
|
2129
|
-
TextMeasure
|
|
2172
|
+
}
|
|
2173
|
+
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
2130
2174
|
|
|
2131
|
-
function transformBoundsWithMatrix
|
|
2175
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
2132
2176
|
const {
|
|
2133
2177
|
x1: x1,
|
|
2134
2178
|
y1: y1,
|
|
@@ -2137,7 +2181,7 @@
|
|
|
2137
2181
|
} = bounds;
|
|
2138
2182
|
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);
|
|
2139
2183
|
}
|
|
2140
|
-
|
|
2184
|
+
class Bounds {
|
|
2141
2185
|
constructor(bounds) {
|
|
2142
2186
|
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
2143
2187
|
}
|
|
@@ -2174,7 +2218,7 @@
|
|
|
2174
2218
|
}
|
|
2175
2219
|
expand() {
|
|
2176
2220
|
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2177
|
-
return isArray$
|
|
2221
|
+
return isArray$7(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;
|
|
2178
2222
|
}
|
|
2179
2223
|
round() {
|
|
2180
2224
|
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;
|
|
@@ -2237,7 +2281,7 @@
|
|
|
2237
2281
|
return this.y1 *= s, this.y2 *= s, this;
|
|
2238
2282
|
}
|
|
2239
2283
|
transformWithMatrix(matrix) {
|
|
2240
|
-
return transformBoundsWithMatrix
|
|
2284
|
+
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
2241
2285
|
}
|
|
2242
2286
|
copy(b) {
|
|
2243
2287
|
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
@@ -2264,9 +2308,9 @@
|
|
|
2264
2308
|
} = this;
|
|
2265
2309
|
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
2266
2310
|
}
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
class OBBBounds extends Bounds
|
|
2311
|
+
}
|
|
2312
|
+
class AABBBounds extends Bounds {}
|
|
2313
|
+
class OBBBounds extends Bounds {
|
|
2270
2314
|
constructor(bounds) {
|
|
2271
2315
|
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2272
2316
|
var _a;
|
|
@@ -2693,10 +2737,10 @@
|
|
|
2693
2737
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2694
2738
|
}
|
|
2695
2739
|
function rgb$1(value) {
|
|
2696
|
-
return isNumber$
|
|
2740
|
+
return isNumber$4(value) ? new RGB$1(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$7(value) ? new RGB$1(value[0], value[1], value[2]) : new RGB$1(255, 255, 255);
|
|
2697
2741
|
}
|
|
2698
2742
|
function rgba$1(value) {
|
|
2699
|
-
return isNumber$
|
|
2743
|
+
return isNumber$4(value) ? new RGB$1(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$7(value) ? new RGB$1(value[0], value[1], value[2], value[3]) : new RGB$1(255, 255, 255, 1);
|
|
2700
2744
|
}
|
|
2701
2745
|
function SRGBToLinear$1(c) {
|
|
2702
2746
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -2736,13 +2780,11 @@
|
|
|
2736
2780
|
return color.getLuminance2();
|
|
2737
2781
|
case "lum3":
|
|
2738
2782
|
return color.getLuminance3();
|
|
2739
|
-
case "wcag":
|
|
2740
|
-
return color.getLuminanceWCAG();
|
|
2741
2783
|
}
|
|
2742
2784
|
}
|
|
2743
2785
|
static parseColorString(value) {
|
|
2744
|
-
if (isValid$
|
|
2745
|
-
if (isValid$
|
|
2786
|
+
if (isValid$3(DEFAULT_COLORS_OPACITY$1[value])) return rgba$1(DEFAULT_COLORS_OPACITY$1[value]);
|
|
2787
|
+
if (isValid$3(DEFAULT_COLORS$1[value])) return rgb$1(DEFAULT_COLORS$1[value]);
|
|
2746
2788
|
const formatValue = `${value}`.trim().toLowerCase(),
|
|
2747
2789
|
hexRes = setHex$1(formatValue);
|
|
2748
2790
|
if (void 0 !== hexRes) return hexRes;
|
|
@@ -2808,11 +2850,11 @@
|
|
|
2808
2850
|
setHsl(h, s, l) {
|
|
2809
2851
|
const opacity = this.color.opacity,
|
|
2810
2852
|
hsl = rgbToHsl$1(this.color.r, this.color.g, this.color.b),
|
|
2811
|
-
rgb = hslToRgb$1(isNil$
|
|
2853
|
+
rgb = hslToRgb$1(isNil$3(h) ? hsl.h : clamp$3(h, 0, 360), isNil$3(s) ? hsl.s : s >= 0 && s <= 1 ? 100 * s : s, isNil$3(l) ? hsl.l : l <= 1 && l >= 0 ? 100 * l : l);
|
|
2812
2854
|
return this.color = new RGB$1(rgb.r, rgb.g, rgb.b, opacity), this;
|
|
2813
2855
|
}
|
|
2814
2856
|
setRGB(r, g, b) {
|
|
2815
|
-
return !isNil$
|
|
2857
|
+
return !isNil$3(r) && (this.color.r = r), !isNil$3(g) && (this.color.g = g), !isNil$3(b) && (this.color.b = b), this;
|
|
2816
2858
|
}
|
|
2817
2859
|
setHex(value) {
|
|
2818
2860
|
const formatValue = `${value}`.trim().toLowerCase(),
|
|
@@ -2839,14 +2881,6 @@
|
|
|
2839
2881
|
getLuminance3() {
|
|
2840
2882
|
return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
|
|
2841
2883
|
}
|
|
2842
|
-
getLuminanceWCAG() {
|
|
2843
|
-
const RsRGB = this.color.r / 255,
|
|
2844
|
-
GsRGB = this.color.g / 255,
|
|
2845
|
-
BsRGB = this.color.b / 255;
|
|
2846
|
-
let R, G, B;
|
|
2847
|
-
R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
2848
|
-
return .2126 * R + .7152 * G + .0722 * B;
|
|
2849
|
-
}
|
|
2850
2884
|
clone() {
|
|
2851
2885
|
return new Color(this.color.toString());
|
|
2852
2886
|
}
|
|
@@ -2880,7 +2914,7 @@
|
|
|
2880
2914
|
};
|
|
2881
2915
|
let RGB$1 = class RGB {
|
|
2882
2916
|
constructor(r, g, b, opacity) {
|
|
2883
|
-
this.r = isNaN(+r) ? 255 : Math.max(0, Math.min(255, +r)), this.g = isNaN(+g) ? 255 : Math.max(0, Math.min(255, +g)), this.b = isNaN(+b) ? 255 : Math.max(0, Math.min(255, +b)), isValid$
|
|
2917
|
+
this.r = isNaN(+r) ? 255 : Math.max(0, Math.min(255, +r)), this.g = isNaN(+g) ? 255 : Math.max(0, Math.min(255, +g)), this.b = isNaN(+b) ? 255 : Math.max(0, Math.min(255, +b)), isValid$3(opacity) ? this.opacity = isNaN(+opacity) ? 1 : Math.max(0, Math.min(1, +opacity)) : this.opacity = 1;
|
|
2884
2918
|
}
|
|
2885
2919
|
formatHex() {
|
|
2886
2920
|
return `#${hex$1(this.r) + hex$1(this.g) + hex$1(this.b) + (1 === this.opacity ? "" : hex$1(255 * this.opacity))}`;
|
|
@@ -2946,8 +2980,8 @@
|
|
|
2946
2980
|
});
|
|
2947
2981
|
|
|
2948
2982
|
function normalizePadding(padding) {
|
|
2949
|
-
if (isValidNumber$
|
|
2950
|
-
if (isArray$
|
|
2983
|
+
if (isValidNumber$1(padding)) return [padding, padding, padding, padding];
|
|
2984
|
+
if (isArray$7(padding)) {
|
|
2951
2985
|
const length = padding.length;
|
|
2952
2986
|
if (1 === length) {
|
|
2953
2987
|
const paddingValue = padding[0];
|
|
@@ -2963,7 +2997,7 @@
|
|
|
2963
2997
|
}
|
|
2964
2998
|
if (4 === length) return padding;
|
|
2965
2999
|
}
|
|
2966
|
-
if (isObject$
|
|
3000
|
+
if (isObject$8(padding)) {
|
|
2967
3001
|
const {
|
|
2968
3002
|
top = 0,
|
|
2969
3003
|
right = 0,
|
|
@@ -3029,7 +3063,7 @@
|
|
|
3029
3063
|
|
|
3030
3064
|
class CurvePath {
|
|
3031
3065
|
constructor() {
|
|
3032
|
-
this.curves = [], this.bounds = new AABBBounds
|
|
3066
|
+
this.curves = [], this.bounds = new AABBBounds();
|
|
3033
3067
|
}
|
|
3034
3068
|
getCurveLengths() {
|
|
3035
3069
|
return this.curves.map(curve => curve.getLength());
|
|
@@ -3140,7 +3174,7 @@
|
|
|
3140
3174
|
}(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
|
|
3141
3175
|
|
|
3142
3176
|
function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
|
|
3143
|
-
const th = degreeToRadian
|
|
3177
|
+
const th = degreeToRadian(rotateX),
|
|
3144
3178
|
sin_th = Math.sin(th),
|
|
3145
3179
|
cos_th = Math.cos(th),
|
|
3146
3180
|
px = cos_th * (ox - x) * .5 + sin_th * (oy - y) * .5,
|
|
@@ -4709,7 +4743,7 @@
|
|
|
4709
4743
|
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
4710
4744
|
if (!c || !0 === c) return "black";
|
|
4711
4745
|
let result, color;
|
|
4712
|
-
if (isArray$
|
|
4746
|
+
if (isArray$7(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
4713
4747
|
if (color = GradientParser.Parse(color), "string" == typeof color) return color;
|
|
4714
4748
|
if (params.AABBBounds && (!params.attribute || 0 !== params.attribute.scaleX || 0 !== params.attribute.scaleY)) {
|
|
4715
4749
|
const bounds = params.AABBBounds;
|
|
@@ -4887,9 +4921,6 @@
|
|
|
4887
4921
|
}
|
|
4888
4922
|
compatibleMetrics(metrics, options) {
|
|
4889
4923
|
if (null == metrics.actualBoundingBoxAscent || null == metrics.actualBoundingBoxDescent || null == metrics.fontBoundingBoxAscent || null == metrics.fontBoundingBoxDescent) {
|
|
4890
|
-
metrics = {
|
|
4891
|
-
width: metrics.width
|
|
4892
|
-
};
|
|
4893
4924
|
const {
|
|
4894
4925
|
ascent: ascent,
|
|
4895
4926
|
descent: descent
|
|
@@ -4897,13 +4928,6 @@
|
|
|
4897
4928
|
metrics.actualBoundingBoxAscent = ascent, metrics.actualBoundingBoxDescent = descent, metrics.fontBoundingBoxAscent = ascent, metrics.fontBoundingBoxDescent = descent;
|
|
4898
4929
|
}
|
|
4899
4930
|
if (null == metrics.actualBoundingBoxLeft || null == metrics.actualBoundingBoxRight) {
|
|
4900
|
-
metrics = {
|
|
4901
|
-
width: metrics.width,
|
|
4902
|
-
actualBoundingBoxAscent: metrics.actualBoundingBoxAscent,
|
|
4903
|
-
actualBoundingBoxDescent: metrics.actualBoundingBoxDescent,
|
|
4904
|
-
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
4905
|
-
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
4906
|
-
};
|
|
4907
4931
|
const {
|
|
4908
4932
|
left: left,
|
|
4909
4933
|
right: right
|
|
@@ -5532,14 +5556,14 @@
|
|
|
5532
5556
|
return this.global.measureTextMethod = m, data;
|
|
5533
5557
|
}
|
|
5534
5558
|
createTextMeasureInstance(textSpec, option, getCanvasForMeasure) {
|
|
5535
|
-
return this.configure(this.global, this.global.env), new TextMeasure
|
|
5559
|
+
return this.configure(this.global, this.global.env), new TextMeasure(Object.assign({
|
|
5536
5560
|
defaultFontParams: {
|
|
5537
5561
|
fontFamily: DefaultTextStyle.fontFamily,
|
|
5538
5562
|
fontSize: DefaultTextStyle.fontSize
|
|
5539
5563
|
},
|
|
5540
5564
|
getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),
|
|
5541
5565
|
getTextBounds: void 0,
|
|
5542
|
-
specialCharSet: "-/: .,@%'\"~" + TextMeasure
|
|
5566
|
+
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
5543
5567
|
}, null != option ? option : {}), textSpec);
|
|
5544
5568
|
}
|
|
5545
5569
|
drawGraphicToCanvas(graphic, stage, canvas) {
|
|
@@ -6050,26 +6074,26 @@
|
|
|
6050
6074
|
return this.removeChild(child);
|
|
6051
6075
|
}
|
|
6052
6076
|
addEventListener(type, listener, options) {
|
|
6053
|
-
const capture = isBoolean$
|
|
6054
|
-
once = isObject$
|
|
6055
|
-
context = isFunction$
|
|
6056
|
-
return type = capture ? `${type}capture` : type, listener = isFunction$
|
|
6077
|
+
const capture = isBoolean$4(options, !0) && options || isObject$8(options) && options.capture,
|
|
6078
|
+
once = isObject$8(options) && options.once,
|
|
6079
|
+
context = isFunction$5(listener) ? void 0 : listener;
|
|
6080
|
+
return type = capture ? `${type}capture` : type, listener = isFunction$5(listener) ? listener : listener.handleEvent, once ? super.once(type, listener, context) : super.on(type, listener, context), this;
|
|
6057
6081
|
}
|
|
6058
6082
|
on(type, listener, options) {
|
|
6059
6083
|
return this.addEventListener(type, listener, options);
|
|
6060
6084
|
}
|
|
6061
6085
|
removeEventListener(type, listener, options) {
|
|
6062
|
-
const capture = isBoolean$
|
|
6063
|
-
context = isFunction$
|
|
6064
|
-
type = capture ? `${type}capture` : type, listener = isFunction$
|
|
6065
|
-
const once = isObject$
|
|
6086
|
+
const capture = isBoolean$4(options, !0) && options || isObject$8(options) && options.capture,
|
|
6087
|
+
context = isFunction$5(listener) ? void 0 : listener;
|
|
6088
|
+
type = capture ? `${type}capture` : type, listener = isFunction$5(listener) ? listener : listener.handleEvent;
|
|
6089
|
+
const once = isObject$8(options) && options.once;
|
|
6066
6090
|
return super.off(type, listener, context, once), this;
|
|
6067
6091
|
}
|
|
6068
6092
|
off(type, listener, options) {
|
|
6069
6093
|
return this.removeEventListener(type, listener, options);
|
|
6070
6094
|
}
|
|
6071
6095
|
once(type, listener, options) {
|
|
6072
|
-
return isObject$
|
|
6096
|
+
return isObject$8(options) ? (options.once = !0, this.addEventListener(type, listener, options)) : this.addEventListener(type, listener, {
|
|
6073
6097
|
once: !0
|
|
6074
6098
|
});
|
|
6075
6099
|
}
|
|
@@ -6158,7 +6182,7 @@
|
|
|
6158
6182
|
try {
|
|
6159
6183
|
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault();
|
|
6160
6184
|
} catch (err) {
|
|
6161
|
-
this.nativeEvent.preventDefault && isFunction$
|
|
6185
|
+
this.nativeEvent.preventDefault && isFunction$5(this.nativeEvent.preventDefault) && this.nativeEvent.preventDefault();
|
|
6162
6186
|
}
|
|
6163
6187
|
this.defaultPrevented = !0;
|
|
6164
6188
|
}
|
|
@@ -6169,7 +6193,7 @@
|
|
|
6169
6193
|
try {
|
|
6170
6194
|
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.stopPropagation();
|
|
6171
6195
|
} catch (err) {
|
|
6172
|
-
this.nativeEvent.stopPropagation && isFunction$
|
|
6196
|
+
this.nativeEvent.stopPropagation && isFunction$5(this.nativeEvent.stopPropagation) && this.nativeEvent.stopPropagation();
|
|
6173
6197
|
}
|
|
6174
6198
|
this.propagationStopped = !0;
|
|
6175
6199
|
}
|
|
@@ -6622,7 +6646,7 @@
|
|
|
6622
6646
|
if (this.currentCursor === mode) return;
|
|
6623
6647
|
this.currentCursor = mode;
|
|
6624
6648
|
const style = this.cursorStyles[mode];
|
|
6625
|
-
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$
|
|
6649
|
+
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$4(mode) && !has$1(this.cursorStyles, mode) && (domElement.style.cursor = mode);
|
|
6626
6650
|
}
|
|
6627
6651
|
setTargetElement(element) {
|
|
6628
6652
|
this.removeEvents(), this.domElement = element, this.addEvents();
|
|
@@ -7409,7 +7433,7 @@
|
|
|
7409
7433
|
const parseStroke = stroke => {
|
|
7410
7434
|
var _a;
|
|
7411
7435
|
let isFullStroke = !0;
|
|
7412
|
-
if (isBoolean$
|
|
7436
|
+
if (isBoolean$4(stroke, !0)) {
|
|
7413
7437
|
for (let i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
7414
7438
|
isFullStroke = stroke;
|
|
7415
7439
|
} else if (Array.isArray(stroke)) for (let i = 0; i < 4; i++) _strokeVec4[i] = !!stroke[i], isFullStroke && (isFullStroke = !!_strokeVec4[i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
|
|
@@ -7419,7 +7443,7 @@
|
|
|
7419
7443
|
};
|
|
7420
7444
|
};
|
|
7421
7445
|
const _paddingVec4 = [0, 0, 0, 0];
|
|
7422
|
-
const parsePadding = padding => padding ? isArray$
|
|
7446
|
+
const parsePadding = padding => padding ? isArray$7(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
|
|
7423
7447
|
const _coords = [{
|
|
7424
7448
|
x: 0,
|
|
7425
7449
|
y: 0
|
|
@@ -7488,7 +7512,7 @@
|
|
|
7488
7512
|
return points;
|
|
7489
7513
|
}
|
|
7490
7514
|
function getAttributeFromDefaultAttrList(attr, key) {
|
|
7491
|
-
if (isArray$
|
|
7515
|
+
if (isArray$7(attr)) {
|
|
7492
7516
|
let val;
|
|
7493
7517
|
for (let i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
7494
7518
|
return val;
|
|
@@ -7515,7 +7539,7 @@
|
|
|
7515
7539
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
7516
7540
|
const rafBasedSto = new RafBasedSTO();
|
|
7517
7541
|
const _calculateLineHeight = (lineHeight, fontSize) => {
|
|
7518
|
-
if (isString$
|
|
7542
|
+
if (isString$4(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
7519
7543
|
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
7520
7544
|
}
|
|
7521
7545
|
return lineHeight;
|
|
@@ -7532,8 +7556,8 @@
|
|
|
7532
7556
|
width: 0,
|
|
7533
7557
|
height: 0
|
|
7534
7558
|
};
|
|
7535
|
-
let width = isNil$
|
|
7536
|
-
height = isNil$
|
|
7559
|
+
let width = isNil$3(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
|
|
7560
|
+
height = isNil$3(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
|
|
7537
7561
|
x = 0,
|
|
7538
7562
|
y = 0;
|
|
7539
7563
|
return width < 0 ? (x = width, width = -width) : Number.isNaN(width) && (width = 0), height < 0 ? (y = height, height = -height) : Number.isNaN(height) && (height = 0), {
|
|
@@ -7581,11 +7605,11 @@
|
|
|
7581
7605
|
|
|
7582
7606
|
function colorArrayToString(color) {
|
|
7583
7607
|
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7584
|
-
return Array.isArray(color) && isNumber$
|
|
7608
|
+
return Array.isArray(color) && isNumber$4(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
|
|
7585
7609
|
}
|
|
7586
7610
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
7587
|
-
if (Array.isArray(from) && !isNumber$
|
|
7588
|
-
return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$
|
|
7611
|
+
if (Array.isArray(from) && !isNumber$4(from[0]) || Array.isArray(to) && !isNumber$4(to[0])) {
|
|
7612
|
+
return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$7(from) ? from[index] : from, isArray$7(to) ? to[index] : to, ratio, alphaChannel));
|
|
7589
7613
|
}
|
|
7590
7614
|
return _interpolateColor(from, to, ratio, alphaChannel, cb);
|
|
7591
7615
|
}
|
|
@@ -7766,7 +7790,7 @@
|
|
|
7766
7790
|
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [], ResourceLoader.onLoadSuccessCb = [];
|
|
7767
7791
|
|
|
7768
7792
|
const tempMatrix = new Matrix(),
|
|
7769
|
-
tempBounds$1 = new AABBBounds
|
|
7793
|
+
tempBounds$1 = new AABBBounds();
|
|
7770
7794
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
7771
7795
|
const tempConstantXYKey = ["x", "y"],
|
|
7772
7796
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -7828,7 +7852,7 @@
|
|
|
7828
7852
|
constructor() {
|
|
7829
7853
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7830
7854
|
var _a;
|
|
7831
|
-
super(), this._AABBBounds = new AABBBounds
|
|
7855
|
+
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
7832
7856
|
}
|
|
7833
7857
|
setMode(mode) {
|
|
7834
7858
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -7968,7 +7992,7 @@
|
|
|
7968
7992
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
7969
7993
|
[key]: value
|
|
7970
7994
|
}, this.attribute, key, context);
|
|
7971
|
-
params ? this._setAttributes(params, forceUpdateTag, context) : isNil$
|
|
7995
|
+
params ? this._setAttributes(params, forceUpdateTag, context) : isNil$3(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
7972
7996
|
}
|
|
7973
7997
|
needUpdateTags(keys) {
|
|
7974
7998
|
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
@@ -8106,7 +8130,7 @@
|
|
|
8106
8130
|
d ? (d.bounds && this.tryUpdateAABBBounds("imprecise" === this.attribute.boundsMode), d.trans && this.tryUpdateLocalTransMatrix()) : (this.tryUpdateAABBBounds("imprecise" === this.attribute.boundsMode), this.tryUpdateLocalTransMatrix());
|
|
8107
8131
|
}
|
|
8108
8132
|
hasState(stateName) {
|
|
8109
|
-
return !(!this.currentStates || !this.currentStates.length) && (!!isNil$
|
|
8133
|
+
return !(!this.currentStates || !this.currentStates.length) && (!!isNil$3(stateName) || this.currentStates.includes(stateName));
|
|
8110
8134
|
}
|
|
8111
8135
|
getState(stateName) {
|
|
8112
8136
|
var _a;
|
|
@@ -8402,7 +8426,7 @@
|
|
|
8402
8426
|
};
|
|
8403
8427
|
}
|
|
8404
8428
|
createPathProxy(path) {
|
|
8405
|
-
return isString$
|
|
8429
|
+
return isString$4(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
8406
8430
|
}
|
|
8407
8431
|
loadImage(image) {
|
|
8408
8432
|
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
@@ -8413,7 +8437,7 @@
|
|
|
8413
8437
|
data: "init",
|
|
8414
8438
|
state: null
|
|
8415
8439
|
};
|
|
8416
|
-
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$
|
|
8440
|
+
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$8(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
|
|
8417
8441
|
}
|
|
8418
8442
|
setShadowGraphic(graphic) {
|
|
8419
8443
|
if (graphic) {
|
|
@@ -9139,7 +9163,7 @@
|
|
|
9139
9163
|
}
|
|
9140
9164
|
function runStroke(stroke, lineWidth) {
|
|
9141
9165
|
let s;
|
|
9142
|
-
return s = isArray$
|
|
9166
|
+
return s = isArray$7(stroke) ? stroke.some(item => item || void 0 === item) : !!stroke, s && lineWidth > 0;
|
|
9143
9167
|
}
|
|
9144
9168
|
function fillVisible(opacity, fillOpacity, fill) {
|
|
9145
9169
|
return fill && opacity * fillOpacity > 0;
|
|
@@ -9224,7 +9248,7 @@
|
|
|
9224
9248
|
function calculateArcCornerRadius(arc, startAngle, endAngle, innerRadius, outerRadius) {
|
|
9225
9249
|
const deltaAngle = abs(endAngle - startAngle),
|
|
9226
9250
|
cornerRadius = arc.getParsedCornerRadius(),
|
|
9227
|
-
cornerRadiusIsArray = isArray$
|
|
9251
|
+
cornerRadiusIsArray = isArray$7(cornerRadius),
|
|
9228
9252
|
{
|
|
9229
9253
|
outerDeltaAngle: outerDeltaAngle,
|
|
9230
9254
|
innerDeltaAngle: innerDeltaAngle,
|
|
@@ -9718,7 +9742,7 @@
|
|
|
9718
9742
|
beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
|
|
9719
9743
|
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"]),
|
|
9720
9744
|
clearAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds"])
|
|
9721
|
-
}, this.tempAABBBounds1 = new AABBBounds
|
|
9745
|
+
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds();
|
|
9722
9746
|
}
|
|
9723
9747
|
onAttributeUpdate(graphic) {
|
|
9724
9748
|
this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
|
|
@@ -9759,12 +9783,12 @@
|
|
|
9759
9783
|
textBaseline: textBaseline
|
|
9760
9784
|
} = attribute;
|
|
9761
9785
|
if (null != attribute.forceBoundsHeight) {
|
|
9762
|
-
const h = isNumber$
|
|
9786
|
+
const h = isNumber$4(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
|
|
9763
9787
|
dy = textLayoutOffsetY(textBaseline, h, h);
|
|
9764
9788
|
aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);
|
|
9765
9789
|
}
|
|
9766
9790
|
if (null != attribute.forceBoundsWidth) {
|
|
9767
|
-
const w = isNumber$
|
|
9791
|
+
const w = isNumber$4(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
|
|
9768
9792
|
dx = textDrawOffsetX(textAlign, w);
|
|
9769
9793
|
aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
|
|
9770
9794
|
}
|
|
@@ -9804,7 +9828,7 @@
|
|
|
9804
9828
|
if (this.combindShadowAABBBounds(aabbBounds, graphic), aabbBounds.empty()) return;
|
|
9805
9829
|
let updateMatrix = !0;
|
|
9806
9830
|
const m = graphic.transMatrix;
|
|
9807
|
-
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix
|
|
9831
|
+
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);
|
|
9808
9832
|
}
|
|
9809
9833
|
validCheck(attribute, theme, aabbBounds, graphic) {
|
|
9810
9834
|
if (!graphic) return !0;
|
|
@@ -10292,7 +10316,7 @@
|
|
|
10292
10316
|
const halfPi = pi / 2;
|
|
10293
10317
|
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
10294
10318
|
let cornerRadius;
|
|
10295
|
-
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
10319
|
+
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$4(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
10296
10320
|
const cornerRadiusArr = rectCornerRadius;
|
|
10297
10321
|
let cr0, cr1;
|
|
10298
10322
|
switch (cornerRadiusArr.length) {
|
|
@@ -10322,23 +10346,23 @@
|
|
|
10322
10346
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
10323
10347
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
10324
10348
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
10325
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual
|
|
10349
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
10326
10350
|
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
10327
10351
|
const centerX = rightTopPoint1[0],
|
|
10328
10352
|
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
10329
10353
|
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
10330
10354
|
}
|
|
10331
|
-
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual
|
|
10355
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
10332
10356
|
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
10333
10357
|
centerY = rightBottomPoint2[1];
|
|
10334
10358
|
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
10335
10359
|
}
|
|
10336
|
-
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual
|
|
10360
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
10337
10361
|
const centerX = leftBottomPoint1[0],
|
|
10338
10362
|
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
10339
10363
|
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
10340
10364
|
}
|
|
10341
|
-
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual
|
|
10365
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
10342
10366
|
const centerX = leftTopPoint1[0],
|
|
10343
10367
|
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
10344
10368
|
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
@@ -10391,7 +10415,7 @@
|
|
|
10391
10415
|
nextX = x + sign * d,
|
|
10392
10416
|
nextY = y + sign * d,
|
|
10393
10417
|
dw = 2 * d;
|
|
10394
|
-
if (0 === cornerRadius || isArray$
|
|
10418
|
+
if (0 === cornerRadius || isArray$7(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
|
|
10395
10419
|
const lastOpacity = rectAttribute[key].opacity;
|
|
10396
10420
|
rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
|
|
10397
10421
|
}
|
|
@@ -10429,7 +10453,7 @@
|
|
|
10429
10453
|
height: height
|
|
10430
10454
|
} = rect.attribute;
|
|
10431
10455
|
if (width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0, Array.isArray(stroke) && stroke.some(s => !1 === s)) {
|
|
10432
|
-
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$
|
|
10456
|
+
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$7(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
10433
10457
|
let lastStroke,
|
|
10434
10458
|
lastStrokeI = 0;
|
|
10435
10459
|
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
@@ -10633,7 +10657,7 @@
|
|
|
10633
10657
|
} = arc.attribute;
|
|
10634
10658
|
outerRadius += outerPadding, innerRadius -= innerPadding;
|
|
10635
10659
|
let conicalOffset = 0;
|
|
10636
|
-
const tempChangeConicalColor = (isBoolean$
|
|
10660
|
+
const tempChangeConicalColor = (isBoolean$4(cap) && cap || cap[0]) && "conical" === fill.gradient;
|
|
10637
10661
|
if (tempChangeConicalColor) {
|
|
10638
10662
|
const {
|
|
10639
10663
|
sc: sc,
|
|
@@ -10662,7 +10686,7 @@
|
|
|
10662
10686
|
drawArcPath(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
|
|
10663
10687
|
beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
|
|
10664
10688
|
}
|
|
10665
|
-
if ((isBoolean$
|
|
10689
|
+
if ((isBoolean$4(cap) && cap || cap[1]) && forceShowCap) {
|
|
10666
10690
|
const {
|
|
10667
10691
|
startAngle: sa,
|
|
10668
10692
|
endAngle: ea
|
|
@@ -10899,7 +10923,7 @@
|
|
|
10899
10923
|
offsetX: offsetX,
|
|
10900
10924
|
offsetY: offsetY,
|
|
10901
10925
|
offsetZ: z
|
|
10902
|
-
}), line.cache && !isArray$
|
|
10926
|
+
}), line.cache && !isArray$7(line.cache) && line.cache.curves.every(c => c.defined) && line.attribute.curveType && line.attribute.curveType.includes("Closed") && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(line, attribute, defaultAttribute);
|
|
10903
10927
|
const {
|
|
10904
10928
|
x: originX = 0,
|
|
10905
10929
|
x: originY = 0
|
|
@@ -10911,7 +10935,7 @@
|
|
|
10911
10935
|
connectedY: connectedY,
|
|
10912
10936
|
connectedStyle: connectedStyle
|
|
10913
10937
|
} = attribute;
|
|
10914
|
-
if (isArray$
|
|
10938
|
+
if (isArray$7(defaultAttribute) ? (connectedType = null !== (_b = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _b ? _b : defaultAttribute[1].connectedType, connectedX = null !== (_c = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _c ? _c : defaultAttribute[1].connectedX, connectedY = null !== (_d = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _d ? _d : defaultAttribute[1].connectedY, connectedStyle = null !== (_e = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _e ? _e : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), "none" !== connectedType) {
|
|
10915
10939
|
context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
10916
10940
|
offsetX: offsetX,
|
|
10917
10941
|
offsetY: offsetY,
|
|
@@ -10922,7 +10946,7 @@
|
|
|
10922
10946
|
zeroY: connectedY
|
|
10923
10947
|
});
|
|
10924
10948
|
const da = [];
|
|
10925
|
-
isArray$
|
|
10949
|
+
isArray$7(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute), !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.stroke()));
|
|
10926
10950
|
}
|
|
10927
10951
|
return !1;
|
|
10928
10952
|
}
|
|
@@ -11217,7 +11241,7 @@
|
|
|
11217
11241
|
const {
|
|
11218
11242
|
stroke = areaAttribute && areaAttribute.stroke
|
|
11219
11243
|
} = area.attribute;
|
|
11220
|
-
if (isArray$
|
|
11244
|
+
if (isArray$7(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
11221
11245
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
11222
11246
|
for (let i = 1; i < points.length; i++) {
|
|
11223
11247
|
const p = points[i];
|
|
@@ -11367,7 +11391,7 @@
|
|
|
11367
11391
|
connectedStyle: connectedStyle
|
|
11368
11392
|
} = attribute;
|
|
11369
11393
|
const da = [];
|
|
11370
|
-
if (connect && (isArray$
|
|
11394
|
+
if (connect && (isArray$7(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$7(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
11371
11395
|
context.beginPath();
|
|
11372
11396
|
const {
|
|
11373
11397
|
points: points,
|
|
@@ -11405,7 +11429,7 @@
|
|
|
11405
11429
|
const {
|
|
11406
11430
|
stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
|
|
11407
11431
|
} = attribute;
|
|
11408
|
-
isArray$
|
|
11432
|
+
isArray$7(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
|
|
11409
11433
|
offsetX: offsetX,
|
|
11410
11434
|
offsetY: offsetY,
|
|
11411
11435
|
offsetZ: offsetZ,
|
|
@@ -11529,7 +11553,7 @@
|
|
|
11529
11553
|
if (!rect.valid || !visible) return;
|
|
11530
11554
|
if (!doFill && !doStroke) return;
|
|
11531
11555
|
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
11532
|
-
0 === cornerRadius || isArray$
|
|
11556
|
+
0 === cornerRadius || isArray$7(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
11533
11557
|
const doFillOrStroke = {
|
|
11534
11558
|
doFill: doFill,
|
|
11535
11559
|
doStroke: doStroke
|
|
@@ -11612,7 +11636,7 @@
|
|
|
11612
11636
|
if (keepDirIn3d && context.camera && context.project) {
|
|
11613
11637
|
const p = context.project(x, y, z),
|
|
11614
11638
|
camera = context.camera;
|
|
11615
|
-
context.camera = null, !1 === parsedPath.draw(context, isArray$
|
|
11639
|
+
context.camera = null, !1 === parsedPath.draw(context, isArray$7(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, void 0, callback) && context.closePath(), context.camera = camera;
|
|
11616
11640
|
} else !1 === parsedPath.draw(context, size, x, y, z, callback) && context.closePath();
|
|
11617
11641
|
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
11618
11642
|
const _runFill = () => {
|
|
@@ -11633,15 +11657,15 @@
|
|
|
11633
11657
|
class DefaultBoundsAllocate {
|
|
11634
11658
|
constructor() {
|
|
11635
11659
|
this.pools = [];
|
|
11636
|
-
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds
|
|
11660
|
+
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds());
|
|
11637
11661
|
}
|
|
11638
11662
|
allocate(x1, y1, x2, y2) {
|
|
11639
|
-
if (!this.pools.length) return new AABBBounds
|
|
11663
|
+
if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
|
|
11640
11664
|
const b = this.pools.pop();
|
|
11641
11665
|
return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
|
|
11642
11666
|
}
|
|
11643
11667
|
allocateByObj(b) {
|
|
11644
|
-
if (!this.pools.length) return new AABBBounds
|
|
11668
|
+
if (!this.pools.length) return new AABBBounds(b);
|
|
11645
11669
|
const _b = this.pools.pop();
|
|
11646
11670
|
return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
|
|
11647
11671
|
}
|
|
@@ -11696,7 +11720,7 @@
|
|
|
11696
11720
|
};
|
|
11697
11721
|
let b;
|
|
11698
11722
|
"richtext" === graphic.type && (matrix = context.currentMatrix.clone(), context.restore(), context.save(), context.setTransformForCurrent());
|
|
11699
|
-
const shouldReCalBounds = isObject$
|
|
11723
|
+
const shouldReCalBounds = isObject$8(background) && background.background,
|
|
11700
11724
|
onlyTranslate = graphic.transMatrix.onlyTranslate();
|
|
11701
11725
|
if (shouldReCalBounds) {
|
|
11702
11726
|
const _b = graphic.AABBBounds,
|
|
@@ -11861,7 +11885,7 @@
|
|
|
11861
11885
|
underlineDash = textAttribute.underlineDash,
|
|
11862
11886
|
fillOpacity = textAttribute.fillOpacity
|
|
11863
11887
|
} = text.attribute,
|
|
11864
|
-
isMulti = !isNil$
|
|
11888
|
+
isMulti = !isNil$3(multiOption),
|
|
11865
11889
|
w = isMulti ? multiOption.width : text.clipedWidth,
|
|
11866
11890
|
offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w),
|
|
11867
11891
|
attribute = {
|
|
@@ -11975,7 +11999,7 @@
|
|
|
11975
11999
|
doFill: doFill,
|
|
11976
12000
|
doStroke: doStroke
|
|
11977
12001
|
} = data;
|
|
11978
|
-
context.beginPath(), cornerRadius <= 0 || isArray$
|
|
12002
|
+
context.beginPath(), cornerRadius <= 0 || isArray$7(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
11979
12003
|
const _runFill = () => {
|
|
11980
12004
|
doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
|
|
11981
12005
|
},
|
|
@@ -12046,7 +12070,7 @@
|
|
|
12046
12070
|
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
12047
12071
|
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
12048
12072
|
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
12049
|
-
} else 0 === cornerRadius || isArray$
|
|
12073
|
+
} else 0 === cornerRadius || isArray$7(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
12050
12074
|
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
12051
12075
|
const doFillOrStroke = {
|
|
12052
12076
|
doFill: doFill,
|
|
@@ -12142,7 +12166,7 @@
|
|
|
12142
12166
|
const res = image.resources.get(url);
|
|
12143
12167
|
if ("success" !== res.state) return;
|
|
12144
12168
|
let needRestore = !1;
|
|
12145
|
-
0 === cornerRadius || isArray$
|
|
12169
|
+
0 === cornerRadius || isArray$7(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), needRestore = !0), context.setShadowBlendStyle && context.setShadowBlendStyle(image, image.attribute, imageAttribute);
|
|
12146
12170
|
const _runFill = () => {
|
|
12147
12171
|
if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
|
|
12148
12172
|
context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
@@ -12164,7 +12188,7 @@
|
|
|
12164
12188
|
} = image.attribute;
|
|
12165
12189
|
if (!url || !image.resources) return;
|
|
12166
12190
|
const res = image.resources.get(url);
|
|
12167
|
-
if ("loading" === res.state && isString$
|
|
12191
|
+
if ("loading" === res.state && isString$4(url)) return void ResourceLoader.improveImageLoading(url);
|
|
12168
12192
|
if ("success" !== res.state) return;
|
|
12169
12193
|
const {
|
|
12170
12194
|
context: context
|
|
@@ -12247,8 +12271,8 @@
|
|
|
12247
12271
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12248
12272
|
};
|
|
12249
12273
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
12250
|
-
const tempDirtyBounds = new AABBBounds
|
|
12251
|
-
tempBackupDirtyBounds = new AABBBounds
|
|
12274
|
+
const tempDirtyBounds = new AABBBounds(),
|
|
12275
|
+
tempBackupDirtyBounds = new AABBBounds();
|
|
12252
12276
|
class ShadowRootDrawItemInterceptorContribution {
|
|
12253
12277
|
constructor() {
|
|
12254
12278
|
this.order = 1;
|
|
@@ -12642,7 +12666,7 @@
|
|
|
12642
12666
|
let Text$1 = class Text extends Graphic {
|
|
12643
12667
|
get font() {
|
|
12644
12668
|
const textTheme = this.getGraphicTheme();
|
|
12645
|
-
return this._font || (this._font = getContextFont
|
|
12669
|
+
return this._font || (this._font = getContextFont(this.attribute, textTheme)), this._font;
|
|
12646
12670
|
}
|
|
12647
12671
|
get clipedText() {
|
|
12648
12672
|
var _a;
|
|
@@ -12692,7 +12716,7 @@
|
|
|
12692
12716
|
const {
|
|
12693
12717
|
text: text
|
|
12694
12718
|
} = this.attribute;
|
|
12695
|
-
return isArray$
|
|
12719
|
+
return isArray$7(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
|
|
12696
12720
|
}
|
|
12697
12721
|
getGraphicTheme() {
|
|
12698
12722
|
return getTheme(this).text;
|
|
@@ -12744,7 +12768,7 @@
|
|
|
12744
12768
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
12745
12769
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
12746
12770
|
}
|
|
12747
|
-
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix
|
|
12771
|
+
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
12748
12772
|
}
|
|
12749
12773
|
updateSingallineAABBBounds(text) {
|
|
12750
12774
|
this.updateMultilineAABBBounds([text]);
|
|
@@ -12847,7 +12871,7 @@
|
|
|
12847
12871
|
lineHeight: lineHeight
|
|
12848
12872
|
},
|
|
12849
12873
|
layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure),
|
|
12850
|
-
lines = isArray$
|
|
12874
|
+
lines = isArray$7(text) ? text.map(l => l.toString()) : [text.toString()],
|
|
12851
12875
|
linesLayout = [],
|
|
12852
12876
|
bboxWH = [0, 0];
|
|
12853
12877
|
let lineCountLimit = 1 / 0;
|
|
@@ -13067,7 +13091,7 @@
|
|
|
13067
13091
|
const {
|
|
13068
13092
|
text: text
|
|
13069
13093
|
} = this.attribute;
|
|
13070
|
-
return isArray$
|
|
13094
|
+
return isArray$7(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
|
|
13071
13095
|
}
|
|
13072
13096
|
updateMultilineAABBBounds(text) {
|
|
13073
13097
|
var _a, _b, _c, _d;
|
|
@@ -13202,13 +13226,13 @@
|
|
|
13202
13226
|
|
|
13203
13227
|
class BaseSymbol {
|
|
13204
13228
|
bounds(size, bounds) {
|
|
13205
|
-
if (isNumber$
|
|
13229
|
+
if (isNumber$4(size)) {
|
|
13206
13230
|
const halfS = size / 2;
|
|
13207
13231
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
13208
13232
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
13209
13233
|
}
|
|
13210
13234
|
parseSize(size) {
|
|
13211
|
-
return isNumber$
|
|
13235
|
+
return isNumber$4(size) ? size : Math.min(size[0], size[1]);
|
|
13212
13236
|
}
|
|
13213
13237
|
}
|
|
13214
13238
|
|
|
@@ -13627,19 +13651,19 @@
|
|
|
13627
13651
|
super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
|
|
13628
13652
|
}
|
|
13629
13653
|
draw(ctx, size, x, y) {
|
|
13630
|
-
return isNumber$
|
|
13654
|
+
return isNumber$4(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
13631
13655
|
}
|
|
13632
13656
|
drawOffset(ctx, size, x, y, offset) {
|
|
13633
|
-
return isNumber$
|
|
13657
|
+
return isNumber$4(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
13634
13658
|
}
|
|
13635
13659
|
}
|
|
13636
13660
|
var rect = new RectSymbol();
|
|
13637
13661
|
|
|
13638
|
-
const tempBounds = new AABBBounds
|
|
13662
|
+
const tempBounds = new AABBBounds();
|
|
13639
13663
|
class CustomSymbolClass {
|
|
13640
13664
|
constructor(type, path) {
|
|
13641
13665
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
13642
|
-
this.pathStr = "", this.type = type, isArray$
|
|
13666
|
+
this.pathStr = "", this.type = type, isArray$7(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
13643
13667
|
}
|
|
13644
13668
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
13645
13669
|
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
@@ -13650,7 +13674,7 @@
|
|
|
13650
13674
|
return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
13651
13675
|
}
|
|
13652
13676
|
parseSize(size) {
|
|
13653
|
-
return isNumber$
|
|
13677
|
+
return isNumber$4(size) ? size : Math.min(size[0], size[1]);
|
|
13654
13678
|
}
|
|
13655
13679
|
bounds(size, bounds) {
|
|
13656
13680
|
if (size = this.parseSize(size), this.isSvg) {
|
|
@@ -13695,7 +13719,7 @@
|
|
|
13695
13719
|
return aabbBounds;
|
|
13696
13720
|
};
|
|
13697
13721
|
|
|
13698
|
-
const _tempBounds$1 = new AABBBounds
|
|
13722
|
+
const _tempBounds$1 = new AABBBounds(),
|
|
13699
13723
|
SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
13700
13724
|
let Symbol$5 = class Symbol extends Graphic {
|
|
13701
13725
|
constructor() {
|
|
@@ -13714,7 +13738,7 @@
|
|
|
13714
13738
|
const {
|
|
13715
13739
|
size: size
|
|
13716
13740
|
} = this.attribute;
|
|
13717
|
-
return isArray$
|
|
13741
|
+
return isArray$7(size) ? 2 === size.length && size.every(this._validNumber) : this._validNumber(size);
|
|
13718
13742
|
}
|
|
13719
13743
|
doUpdateParsedPath() {
|
|
13720
13744
|
const symbolTheme = this.getGraphicTheme();
|
|
@@ -13731,7 +13755,7 @@
|
|
|
13731
13755
|
svg: svg
|
|
13732
13756
|
} = parser.parse(symbolType);
|
|
13733
13757
|
if (!svg) return null;
|
|
13734
|
-
const path = isArray$
|
|
13758
|
+
const path = isArray$7(svg.path) ? svg.path : [svg.path];
|
|
13735
13759
|
_tempBounds$1.clear();
|
|
13736
13760
|
const cacheList = [];
|
|
13737
13761
|
path.forEach(item => {
|
|
@@ -13774,7 +13798,7 @@
|
|
|
13774
13798
|
const {
|
|
13775
13799
|
size = symbolTheme.size
|
|
13776
13800
|
} = attribute;
|
|
13777
|
-
if (isArray$
|
|
13801
|
+
if (isArray$7(size)) aabbBounds.set(-size[0] / 2, -size[1] / 2, size[0] / 2, size[1] / 2);else {
|
|
13778
13802
|
const halfWH = size / 2;
|
|
13779
13803
|
aabbBounds.set(-halfWH, -halfWH, halfWH, halfWH);
|
|
13780
13804
|
}
|
|
@@ -13795,7 +13819,7 @@
|
|
|
13795
13819
|
toCustomPath() {
|
|
13796
13820
|
const symbolInstance = this.getParsedPath(),
|
|
13797
13821
|
size = this.attribute.size,
|
|
13798
|
-
formattedSize = isArray$
|
|
13822
|
+
formattedSize = isArray$7(size) ? size : [size, size];
|
|
13799
13823
|
return symbolInstance.path ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, 0, 0, formattedSize[0], formattedSize[1]) : new CustomPath2D().fromString(symbolInstance.pathStr, 0, 0, formattedSize[0], formattedSize[1]);
|
|
13800
13824
|
}
|
|
13801
13825
|
clone() {
|
|
@@ -14289,7 +14313,7 @@
|
|
|
14289
14313
|
this._marginArray = "number" == typeof marginArray ? [marginArray, marginArray, marginArray, marginArray] : marginArray;
|
|
14290
14314
|
}
|
|
14291
14315
|
this.onBeforeAttributeUpdate = (val, attributes, key) => {
|
|
14292
|
-
if (isArray$
|
|
14316
|
+
if (isArray$7(key) && -1 !== key.indexOf("margin") || "margin" === key) if (attributes.margin) {
|
|
14293
14317
|
const marginArray = parsePadding(attributes.margin);
|
|
14294
14318
|
this._marginArray = "number" == typeof marginArray ? [marginArray, marginArray, marginArray, marginArray] : marginArray;
|
|
14295
14319
|
} else this._marginArray = [0, 0, 0, 0];
|
|
@@ -14665,7 +14689,7 @@
|
|
|
14665
14689
|
}
|
|
14666
14690
|
} else {
|
|
14667
14691
|
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
14668
|
-
if (isNumber$
|
|
14692
|
+
if (isNumber$4(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
14669
14693
|
const textParts = richTextConfig.text.split("\n");
|
|
14670
14694
|
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
14671
14695
|
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
@@ -14769,7 +14793,7 @@
|
|
|
14769
14793
|
const pathTheme = this.getGraphicTheme();
|
|
14770
14794
|
if (!this.valid) return pathTheme.path;
|
|
14771
14795
|
const attribute = this.attribute;
|
|
14772
|
-
return attribute.path instanceof CustomPath2D ? attribute.path : (isNil$
|
|
14796
|
+
return attribute.path instanceof CustomPath2D ? attribute.path : (isNil$3(this.cache) && this.doUpdatePathShape(), this.cache instanceof CustomPath2D ? this.cache : pathTheme.path);
|
|
14773
14797
|
}
|
|
14774
14798
|
getGraphicTheme() {
|
|
14775
14799
|
return getTheme(this).path;
|
|
@@ -14794,7 +14818,7 @@
|
|
|
14794
14818
|
}
|
|
14795
14819
|
doUpdatePathShape() {
|
|
14796
14820
|
const attribute = this.attribute;
|
|
14797
|
-
isString$
|
|
14821
|
+
isString$4(attribute.path, !0) ? this.cache = new CustomPath2D().fromString(attribute.path) : attribute.customPath && (this.cache = new CustomPath2D(), attribute.customPath(this.cache, this));
|
|
14798
14822
|
}
|
|
14799
14823
|
needUpdateTags(keys) {
|
|
14800
14824
|
return super.needUpdateTags(keys, PATH_UPDATE_TAG_KEY);
|
|
@@ -14943,8 +14967,8 @@
|
|
|
14943
14967
|
} = this.attribute;
|
|
14944
14968
|
if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
14945
14969
|
const deltaRadius = Math.abs(outerRadius - innerRadius),
|
|
14946
|
-
parseCR = cornerRadius => Math.min(isNumber$
|
|
14947
|
-
if (isArray$
|
|
14970
|
+
parseCR = cornerRadius => Math.min(isNumber$4(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
14971
|
+
if (isArray$7(cornerRadius)) {
|
|
14948
14972
|
const crList = cornerRadius.map(cr => parseCR(cr) || 0);
|
|
14949
14973
|
return 0 === crList.length ? [crList[0], crList[0], crList[0], crList[0]] : 2 === crList.length ? [crList[0], crList[1], crList[0], crList[1]] : (3 === crList.length && crList.push(0), crList);
|
|
14950
14974
|
}
|
|
@@ -15592,7 +15616,7 @@
|
|
|
15592
15616
|
};
|
|
15593
15617
|
let DefaultDrawContribution = class {
|
|
15594
15618
|
constructor(contributions, drawItemInterceptorContributions) {
|
|
15595
|
-
this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds
|
|
15619
|
+
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();
|
|
15596
15620
|
}
|
|
15597
15621
|
init() {
|
|
15598
15622
|
this.contributions.forEach(item => {
|
|
@@ -16141,7 +16165,7 @@
|
|
|
16141
16165
|
}
|
|
16142
16166
|
}
|
|
16143
16167
|
|
|
16144
|
-
const globalBounds = new AABBBounds
|
|
16168
|
+
const globalBounds = new AABBBounds();
|
|
16145
16169
|
class DirtyBoundsPlugin {
|
|
16146
16170
|
constructor() {
|
|
16147
16171
|
this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
|
|
@@ -16303,7 +16327,7 @@
|
|
|
16303
16327
|
canvas: params.canvas
|
|
16304
16328
|
}), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
|
|
16305
16329
|
main: !0
|
|
16306
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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$
|
|
16330
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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$4(this._background) && this._background.includes("/") && this.setAttributes({
|
|
16307
16331
|
background: this._background
|
|
16308
16332
|
}), this.ticker.on("afterTick", this.afterTickCb);
|
|
16309
16333
|
}
|
|
@@ -16456,7 +16480,7 @@
|
|
|
16456
16480
|
}
|
|
16457
16481
|
enableDirtyBounds() {
|
|
16458
16482
|
if (this.dirtyBounds) return;
|
|
16459
|
-
this.dirtyBounds = new Bounds
|
|
16483
|
+
this.dirtyBounds = new Bounds();
|
|
16460
16484
|
let plugin = this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];
|
|
16461
16485
|
plugin ? plugin.activate(this.pluginService) : (plugin = new DirtyBoundsPlugin(), this.pluginService.register(plugin));
|
|
16462
16486
|
}
|
|
@@ -16852,7 +16876,7 @@
|
|
|
16852
16876
|
service.env === this.type && service.setActiveEnvContribution(this);
|
|
16853
16877
|
}
|
|
16854
16878
|
getNativeAABBBounds(dom) {
|
|
16855
|
-
return new AABBBounds
|
|
16879
|
+
return new AABBBounds();
|
|
16856
16880
|
}
|
|
16857
16881
|
removeDom(dom) {
|
|
16858
16882
|
return !1;
|
|
@@ -16937,7 +16961,7 @@
|
|
|
16937
16961
|
};
|
|
16938
16962
|
let BaseWindowHandlerContribution = class {
|
|
16939
16963
|
constructor() {
|
|
16940
|
-
this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds
|
|
16964
|
+
this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
16941
16965
|
}
|
|
16942
16966
|
onChange(cb) {
|
|
16943
16967
|
this._onChangeCb = cb;
|
|
@@ -17003,7 +17027,7 @@
|
|
|
17003
17027
|
params.pickerService = this;
|
|
17004
17028
|
const w = params.bounds.width(),
|
|
17005
17029
|
h = params.bounds.height();
|
|
17006
|
-
if (!new AABBBounds
|
|
17030
|
+
if (!new AABBBounds().setValue(0, 0, w, h).containsPoint(point)) return result;
|
|
17007
17031
|
this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
|
|
17008
17032
|
const parentMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
17009
17033
|
let group;
|
|
@@ -17256,10 +17280,10 @@
|
|
|
17256
17280
|
graphicCreator.RegisterGraphicCreator("wrapText", createWrapText);
|
|
17257
17281
|
}
|
|
17258
17282
|
|
|
17259
|
-
const _tempBounds = new AABBBounds
|
|
17283
|
+
const _tempBounds = new AABBBounds();
|
|
17260
17284
|
class FlexLayoutPlugin {
|
|
17261
17285
|
constructor() {
|
|
17262
|
-
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds
|
|
17286
|
+
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
17263
17287
|
}
|
|
17264
17288
|
pauseLayout(p) {
|
|
17265
17289
|
this.pause = p;
|
|
@@ -17540,7 +17564,7 @@
|
|
|
17540
17564
|
[key]: value
|
|
17541
17565
|
}, this.attribute, key, context);
|
|
17542
17566
|
if (params) return this._setAttributes(params, forceUpdateTag);
|
|
17543
|
-
isPlainObject$
|
|
17567
|
+
isPlainObject$3(this.attribute[key]) && isPlainObject$3(value) && !isFunction$5(this.attribute[key]) && !isFunction$5(value) ? merge$1(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();
|
|
17544
17568
|
}
|
|
17545
17569
|
setAttributes(params, forceUpdateTag, context) {
|
|
17546
17570
|
return params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this._setAttributes(params, forceUpdateTag);
|
|
@@ -17550,10 +17574,10 @@
|
|
|
17550
17574
|
this._mergeAttributes(params, keys), keys.every(key => GROUP_ATTRIBUTES.includes(key)) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
|
|
17551
17575
|
}
|
|
17552
17576
|
_mergeAttributes(params, keys) {
|
|
17553
|
-
isNil$
|
|
17577
|
+
isNil$3(keys) && (keys = Object.keys(params));
|
|
17554
17578
|
for (let i = 0; i < keys.length; i++) {
|
|
17555
17579
|
const key = keys[i];
|
|
17556
|
-
!isPlainObject$
|
|
17580
|
+
!isPlainObject$3(this.attribute[key]) || isFunction$5(this.attribute[key]) || isFunction$5(params[key]) ? this.attribute[key] = params[key] : merge$1(this.attribute[key], params[key]);
|
|
17557
17581
|
}
|
|
17558
17582
|
}
|
|
17559
17583
|
bindEvents() {}
|
|
@@ -18342,7 +18366,7 @@
|
|
|
18342
18366
|
const {
|
|
18343
18367
|
scaleIn3d = defaultParams.scaleIn3d
|
|
18344
18368
|
} = params;
|
|
18345
|
-
params.font ? _context.font = params.font : _context.font = getContextFont
|
|
18369
|
+
params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, scaleIn3d && this.camera && this.camera.getProjectionScale(z));
|
|
18346
18370
|
const {
|
|
18347
18371
|
fontFamily = defaultParams.fontFamily,
|
|
18348
18372
|
fontSize = defaultParams.fontSize
|
|
@@ -18352,7 +18376,7 @@
|
|
|
18352
18376
|
setTextStyle(params, defaultParams, z) {
|
|
18353
18377
|
var _a, _b;
|
|
18354
18378
|
const _context = this.nativeContext;
|
|
18355
|
-
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont
|
|
18379
|
+
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, this.camera && this.camera.getProjectionScale(z));
|
|
18356
18380
|
const {
|
|
18357
18381
|
fontFamily = defaultParams.fontFamily,
|
|
18358
18382
|
fontSize = defaultParams.fontSize
|
|
@@ -18569,7 +18593,7 @@
|
|
|
18569
18593
|
return `${BrowserWindowHandlerContribution_1.idprefix}_${BrowserWindowHandlerContribution_1.prefix_count++}`;
|
|
18570
18594
|
}
|
|
18571
18595
|
constructor() {
|
|
18572
|
-
super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global, this.viewBox = new AABBBounds
|
|
18596
|
+
super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global, this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
18573
18597
|
}
|
|
18574
18598
|
getTitle() {
|
|
18575
18599
|
return this.canvas.id && this.canvas.id.toString();
|
|
@@ -18823,8 +18847,8 @@
|
|
|
18823
18847
|
nativeCanvas = null === (_b = domElement.getNativeHandler) || void 0 === _b ? void 0 : _b.call(domElement).nativeCanvas;
|
|
18824
18848
|
let scaleX, scaleY;
|
|
18825
18849
|
return nativeCanvas && (scaleX = rect.width / nativeCanvas.offsetWidth, scaleY = rect.height / nativeCanvas.offsetHeight), {
|
|
18826
|
-
x: (x - rect.left) / (isValidNumber$
|
|
18827
|
-
y: (y - rect.top) / (isValidNumber$
|
|
18850
|
+
x: (x - rect.left) / (isValidNumber$1(scaleX) ? scaleX : 1),
|
|
18851
|
+
y: (y - rect.top) / (isValidNumber$1(scaleY) ? scaleY : 1)
|
|
18828
18852
|
};
|
|
18829
18853
|
}
|
|
18830
18854
|
return {
|
|
@@ -18838,7 +18862,7 @@
|
|
|
18838
18862
|
const b = dom.getBoundingClientRect();
|
|
18839
18863
|
return new DynamicB(b);
|
|
18840
18864
|
}
|
|
18841
|
-
return new AABBBounds
|
|
18865
|
+
return new AABBBounds();
|
|
18842
18866
|
}
|
|
18843
18867
|
removeDom(dom) {
|
|
18844
18868
|
return dom.parentElement.removeChild(dom), !0;
|
|
@@ -18849,7 +18873,7 @@
|
|
|
18849
18873
|
height: height,
|
|
18850
18874
|
style: style
|
|
18851
18875
|
} = params;
|
|
18852
|
-
return style && (isString$
|
|
18876
|
+
return style && (isString$4(style) ? dom.setAttribute("style", style) : Object.keys(style).forEach(k => {
|
|
18853
18877
|
dom.style[k] = style[k];
|
|
18854
18878
|
})), null != width && (dom.style.width = `${width}px`), null != height && (dom.style.height = `${height}px`), !0;
|
|
18855
18879
|
}
|
|
@@ -18860,7 +18884,7 @@
|
|
|
18860
18884
|
} = params,
|
|
18861
18885
|
element = document.createElement(tagName);
|
|
18862
18886
|
if (this.updateDom(element, params), parent) {
|
|
18863
|
-
const pd = isString$
|
|
18887
|
+
const pd = isString$4(parent) ? this.getElementById(parent) : parent;
|
|
18864
18888
|
pd && pd.appendChild && pd.appendChild(element);
|
|
18865
18889
|
}
|
|
18866
18890
|
return element;
|
|
@@ -18951,7 +18975,7 @@
|
|
|
18951
18975
|
}
|
|
18952
18976
|
loadFont(font, source, descriptors) {
|
|
18953
18977
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
18954
|
-
return new FontFace(font, isString$
|
|
18978
|
+
return new FontFace(font, isString$4(source) ? `url(${source})` : source, descriptors).load().then(function (loadedFont) {
|
|
18955
18979
|
return document.fonts.add(loadedFont), {
|
|
18956
18980
|
loadState: "success"
|
|
18957
18981
|
};
|
|
@@ -19164,7 +19188,7 @@
|
|
|
19164
19188
|
loadPathPick$1 || (loadPathPick$1 = !0, bind(MathPathPicker).to(DefaultMathPathPicker).inSingletonScope(), bind(MathPickerContribution).toService(MathPathPicker));
|
|
19165
19189
|
});
|
|
19166
19190
|
|
|
19167
|
-
const _bounds = new AABBBounds
|
|
19191
|
+
const _bounds = new AABBBounds();
|
|
19168
19192
|
class RectPickerBase {
|
|
19169
19193
|
constructor() {
|
|
19170
19194
|
this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
@@ -19191,7 +19215,7 @@
|
|
|
19191
19215
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
19192
19216
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
19193
19217
|
let picked = !0;
|
|
19194
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
19218
|
+
if (!onlyTranslate || rect.shadowRoot || isNumber$4(cornerRadius, !0) && 0 !== cornerRadius || isArray$7(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
19195
19219
|
if (picked) return !0;
|
|
19196
19220
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
19197
19221
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
@@ -19332,7 +19356,7 @@
|
|
|
19332
19356
|
this._context = new NodeContext2d(this, this._dpr), this.nativeCanvas.width = this._pixelWidth, this.nativeCanvas.height = this._pixelHeight;
|
|
19333
19357
|
}
|
|
19334
19358
|
release() {
|
|
19335
|
-
this._nativeCanvas.release && isFunction$
|
|
19359
|
+
this._nativeCanvas.release && isFunction$5(this._nativeCanvas.release) && this._nativeCanvas.release();
|
|
19336
19360
|
}
|
|
19337
19361
|
};
|
|
19338
19362
|
NodeCanvas.env = "node", NodeCanvas = __decorate$l([injectable(), __metadata$a("design:paramtypes", [Object])], NodeCanvas);
|
|
@@ -20656,7 +20680,7 @@
|
|
|
20656
20680
|
loadScrollbarComponent();
|
|
20657
20681
|
class ScrollBar extends AbstractComponent {
|
|
20658
20682
|
constructor(attributes, options) {
|
|
20659
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
20683
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._onRailPointerDown = e => {
|
|
20660
20684
|
const {
|
|
20661
20685
|
viewX: viewX,
|
|
20662
20686
|
viewY: viewY
|
|
@@ -20942,13 +20966,13 @@
|
|
|
20942
20966
|
return direct ? angleLargeThanPI ? 2 * Math.PI - ang : ang : angleLargeThanPI ? ang : 2 * Math.PI - ang;
|
|
20943
20967
|
}
|
|
20944
20968
|
|
|
20945
|
-
const initTextMeasure = (textSpec, option, useNaiveCanvas, defaultFontParams) => new TextMeasure
|
|
20969
|
+
const initTextMeasure = (textSpec, option, useNaiveCanvas, defaultFontParams) => new TextMeasure(Object.assign({
|
|
20946
20970
|
defaultFontParams: Object.assign({
|
|
20947
20971
|
fontFamily: DEFAULT_TEXT_FONT_FAMILY$1,
|
|
20948
20972
|
fontSize: DEFAULT_TEXT_FONT_SIZE$1
|
|
20949
20973
|
}, defaultFontParams),
|
|
20950
20974
|
getTextBounds: useNaiveCanvas ? void 0 : getTextBounds,
|
|
20951
|
-
specialCharSet: "-/: .,@%'\"~" + TextMeasure
|
|
20975
|
+
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
20952
20976
|
}, null != option ? option : {}), textSpec);
|
|
20953
20977
|
function measureTextSize(text, textSpec) {
|
|
20954
20978
|
let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -20979,11 +21003,11 @@
|
|
|
20979
21003
|
function getTextType(attributes) {
|
|
20980
21004
|
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
20981
21005
|
var _a, _b;
|
|
20982
|
-
return isObject$
|
|
21006
|
+
return isObject$8(attributes.text) && "type" in attributes.text ? null !== (_a = attributes.text.type) && void 0 !== _a ? _a : "text" : typeKey in attributes && null !== (_b = attributes[typeKey]) && void 0 !== _b ? _b : "text";
|
|
20983
21007
|
}
|
|
20984
21008
|
function richTextAttributeTransform(attributes) {
|
|
20985
21009
|
var _a, _b;
|
|
20986
|
-
return isValid$
|
|
21010
|
+
return isValid$3(attributes.maxLineWidth) && (attributes.maxWidth = attributes.maxLineWidth, delete attributes.maxLineWidth), attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.textConfig = attributes.text.text || attributes.text, attributes;
|
|
20987
21011
|
}
|
|
20988
21012
|
function htmlAttributeTransform(attributes) {
|
|
20989
21013
|
const {
|
|
@@ -21033,7 +21057,7 @@
|
|
|
21033
21057
|
return this._textShape;
|
|
21034
21058
|
}
|
|
21035
21059
|
constructor(attributes, options) {
|
|
21036
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
21060
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Tag.defaultAttributes, attributes)), this.name = "tag", this._tagStates = [], this._rectStates = [], this._symbolStates = [], this._textStates = [];
|
|
21037
21061
|
}
|
|
21038
21062
|
render() {
|
|
21039
21063
|
var _a, _b, _c;
|
|
@@ -21070,9 +21094,9 @@
|
|
|
21070
21094
|
visible: shapeVisible
|
|
21071
21095
|
} = shape,
|
|
21072
21096
|
shapeStyle = __rest$5(shape, ["visible"]);
|
|
21073
|
-
if (isBoolean$
|
|
21097
|
+
if (isBoolean$4(shapeVisible)) {
|
|
21074
21098
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
21075
|
-
maxSize = isNumber$
|
|
21099
|
+
maxSize = isNumber$4(size) ? size : Math.max(size[0], size[1]);
|
|
21076
21100
|
symbol = group.createOrUpdateChild("tag-shape", Object.assign(Object.assign({
|
|
21077
21101
|
symbolType: "circle",
|
|
21078
21102
|
size: size,
|
|
@@ -21081,7 +21105,7 @@
|
|
|
21081
21105
|
visible: shapeVisible,
|
|
21082
21106
|
x: maxSize / 2,
|
|
21083
21107
|
y: maxSize / 2
|
|
21084
|
-
}), "symbol"), isEmpty
|
|
21108
|
+
}), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
|
|
21085
21109
|
}
|
|
21086
21110
|
let textShape;
|
|
21087
21111
|
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
@@ -21092,33 +21116,33 @@
|
|
|
21092
21116
|
type: type,
|
|
21093
21117
|
text: text
|
|
21094
21118
|
}, textStyle))), textStyle), {
|
|
21095
|
-
visible: isValid$
|
|
21119
|
+
visible: isValid$3(text) && !1 !== visible,
|
|
21096
21120
|
x: textX,
|
|
21097
21121
|
y: 0
|
|
21098
21122
|
});
|
|
21099
21123
|
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), tagWidth += textShape.AABBBounds.width(), tagHeight += textShape.AABBBounds.height(), tagX += textShape.AABBBounds.x1, tagY += textShape.AABBBounds.y1;
|
|
21100
21124
|
} else {
|
|
21101
21125
|
const textAttrs = Object.assign(Object.assign({
|
|
21102
|
-
text: isObject$
|
|
21103
|
-
visible: isValid$
|
|
21126
|
+
text: isObject$8(text) && "type" in text && "text" === text.type ? text.text : text,
|
|
21127
|
+
visible: isValid$3(text) && !1 !== visible,
|
|
21104
21128
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
21105
21129
|
}, textStyle), {
|
|
21106
21130
|
x: textX,
|
|
21107
21131
|
y: 0
|
|
21108
21132
|
});
|
|
21109
|
-
isNil$
|
|
21133
|
+
isNil$3(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text"), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
|
|
21110
21134
|
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme()) || void 0 === _b ? void 0 : _b.text),
|
|
21111
21135
|
textWidth = textBounds.width,
|
|
21112
21136
|
textHeight = textBounds.height;
|
|
21113
21137
|
tagWidth += textWidth;
|
|
21114
21138
|
const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
|
|
21115
|
-
maxSize = isNumber$
|
|
21139
|
+
maxSize = isNumber$4(size) ? size : Math.max(size[0], size[1]);
|
|
21116
21140
|
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
21117
21141
|
const {
|
|
21118
21142
|
textAlign: textAlign,
|
|
21119
21143
|
textBaseline: textBaseline
|
|
21120
21144
|
} = textStyle;
|
|
21121
|
-
(isValid$
|
|
21145
|
+
(isValid$3(minWidth) || isValid$3(maxWidth)) && (isValid$3(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$3(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2]))), tagX = 0, tagY = 0;
|
|
21122
21146
|
let flag = 0;
|
|
21123
21147
|
"left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (tagX -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (tagX -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
|
|
21124
21148
|
const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
|
|
@@ -21170,7 +21194,7 @@
|
|
|
21170
21194
|
visible: bgVisible
|
|
21171
21195
|
} = panel,
|
|
21172
21196
|
backgroundStyle = __rest$5(panel, ["visible"]);
|
|
21173
|
-
if (visible && isBoolean$
|
|
21197
|
+
if (visible && isBoolean$4(bgVisible)) {
|
|
21174
21198
|
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
21175
21199
|
visible: bgVisible && !!text,
|
|
21176
21200
|
width: tagWidth,
|
|
@@ -21178,7 +21202,7 @@
|
|
|
21178
21202
|
x: tagX,
|
|
21179
21203
|
y: tagY
|
|
21180
21204
|
}), "rect");
|
|
21181
|
-
if (isEmpty
|
|
21205
|
+
if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
|
|
21182
21206
|
const customShape = backgroundStyle.customShape;
|
|
21183
21207
|
bgRect.pathProxy = attrs => customShape(this, attrs, new CustomPath2D());
|
|
21184
21208
|
}
|
|
@@ -21187,7 +21211,7 @@
|
|
|
21187
21211
|
this._textShape = textShape, this._symbol = symbol, this.resetStates();
|
|
21188
21212
|
}
|
|
21189
21213
|
initAttributes(params, options) {
|
|
21190
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
21214
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Tag.defaultAttributes, params), super.initAttributes(params), this.render();
|
|
21191
21215
|
}
|
|
21192
21216
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
21193
21217
|
super.addState(stateName, keepCurrentStates, hasAnimation), this._textShape && this._textShape.addState(stateName, keepCurrentStates, hasAnimation), this._bgRect && this._bgRect.addState(stateName, keepCurrentStates, hasAnimation), this._symbol && this._symbol.addState(stateName, keepCurrentStates, hasAnimation);
|
|
@@ -21241,14 +21265,14 @@
|
|
|
21241
21265
|
}
|
|
21242
21266
|
};
|
|
21243
21267
|
const theme$2 = {
|
|
21244
|
-
poptip: merge$
|
|
21268
|
+
poptip: merge$1({}, DEFAULT_THEME)
|
|
21245
21269
|
};
|
|
21246
21270
|
|
|
21247
21271
|
function loadPoptipComponent() {
|
|
21248
21272
|
registerGroup(), registerText(), registerSymbol(), registerRect();
|
|
21249
21273
|
}
|
|
21250
21274
|
function setPoptipTheme(defaultPoptipTheme) {
|
|
21251
|
-
merge$
|
|
21275
|
+
merge$1(theme$2.poptip, DEFAULT_THEME, defaultPoptipTheme);
|
|
21252
21276
|
}
|
|
21253
21277
|
|
|
21254
21278
|
var __rest$4 = undefined && undefined.__rest || function (s, e) {
|
|
@@ -21260,11 +21284,11 @@
|
|
|
21260
21284
|
}
|
|
21261
21285
|
return t;
|
|
21262
21286
|
};
|
|
21263
|
-
const _tBounds = new AABBBounds
|
|
21287
|
+
const _tBounds = new AABBBounds();
|
|
21264
21288
|
loadPoptipComponent();
|
|
21265
21289
|
class PopTip extends AbstractComponent {
|
|
21266
21290
|
constructor(attributes, options) {
|
|
21267
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
21291
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, PopTip.defaultAttributes, attributes)), this.name = "poptip", this.positionList = ["top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb"];
|
|
21268
21292
|
}
|
|
21269
21293
|
render() {
|
|
21270
21294
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -21295,9 +21319,9 @@
|
|
|
21295
21319
|
zIndex: 1
|
|
21296
21320
|
}, "group"),
|
|
21297
21321
|
maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3],
|
|
21298
|
-
titleVisible = isValid$
|
|
21322
|
+
titleVisible = isValid$3(title) && !1 !== visible,
|
|
21299
21323
|
titleAttrs = Object.assign(Object.assign({
|
|
21300
|
-
text: isArray$
|
|
21324
|
+
text: isArray$7(title) ? title : [title],
|
|
21301
21325
|
visible: titleVisible,
|
|
21302
21326
|
wrap: !0
|
|
21303
21327
|
}, titleStyle), {
|
|
@@ -21308,15 +21332,15 @@
|
|
|
21308
21332
|
textBaseline: "top"
|
|
21309
21333
|
}),
|
|
21310
21334
|
titleShape = group.createOrUpdateChild("poptip-title", titleAttrs, "text");
|
|
21311
|
-
isEmpty
|
|
21335
|
+
isEmpty(null == state ? void 0 : state.title) || (titleShape.states = state.title);
|
|
21312
21336
|
const titleBounds = titleShape.AABBBounds,
|
|
21313
21337
|
titleHeight = titleBounds.height(),
|
|
21314
21338
|
titleWidth = titleBounds.width();
|
|
21315
21339
|
let height = titleHeight + space;
|
|
21316
21340
|
titleVisible || (height = 0);
|
|
21317
|
-
const contentVisible = isValid$
|
|
21341
|
+
const contentVisible = isValid$3(content) && !1 !== visible,
|
|
21318
21342
|
contentAttrs = Object.assign(Object.assign({
|
|
21319
|
-
text: isArray$
|
|
21343
|
+
text: isArray$7(content) ? content : [content],
|
|
21320
21344
|
visible: contentVisible,
|
|
21321
21345
|
wrap: !0
|
|
21322
21346
|
}, contentStyle), {
|
|
@@ -21327,7 +21351,7 @@
|
|
|
21327
21351
|
textBaseline: "top"
|
|
21328
21352
|
}),
|
|
21329
21353
|
contentShape = group.createOrUpdateChild("poptip-content", contentAttrs, "text");
|
|
21330
|
-
isEmpty
|
|
21354
|
+
isEmpty(null == state ? void 0 : state.content) || (contentShape.states = state.content);
|
|
21331
21355
|
const contentBounds = contentShape.AABBBounds,
|
|
21332
21356
|
contentHeight = contentBounds.height(),
|
|
21333
21357
|
contentWidth = contentBounds.width();
|
|
@@ -21340,7 +21364,7 @@
|
|
|
21340
21364
|
} = panel,
|
|
21341
21365
|
backgroundStyle = __rest$4(panel, ["visible"]),
|
|
21342
21366
|
symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12,
|
|
21343
|
-
spaceSize = isArray$
|
|
21367
|
+
spaceSize = isArray$7(symbolSize) ? [symbolSize[0] + (null !== (_b = backgroundStyle.space) && void 0 !== _b ? _b : 0), symbolSize[1] + (null !== (_c = backgroundStyle.space) && void 0 !== _c ? _c : 0)] : symbolSize + (null !== (_d = backgroundStyle.space) && void 0 !== _d ? _d : 0),
|
|
21344
21368
|
lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1,
|
|
21345
21369
|
range = this.stage ? [null !== (_f = this.stage.viewWidth) && void 0 !== _f ? _f : this.stage.width, null !== (_g = this.stage.viewHeight) && void 0 !== _g ? _g : this.stage.height] : void 0;
|
|
21346
21370
|
if (range) {
|
|
@@ -21348,7 +21372,7 @@
|
|
|
21348
21372
|
leftWidth = null !== (_h = this.attribute.x) && void 0 !== _h ? _h : b.x1,
|
|
21349
21373
|
rightWidth = range[0] - b.x1;
|
|
21350
21374
|
let maxSpace = Math.max(leftWidth, rightWidth);
|
|
21351
|
-
const buf = (isArray$
|
|
21375
|
+
const buf = (isArray$7(symbolSize) ? symbolSize[0] : 12) + 3;
|
|
21352
21376
|
if (maxSpace = Math.min(maxSpace - buf, maxSpace * maxWidthPercent), maxSpace < popTipWidth) {
|
|
21353
21377
|
popTipWidth = maxSpace;
|
|
21354
21378
|
const buf = parsedPadding[1] + parsedPadding[3];
|
|
@@ -21364,9 +21388,9 @@
|
|
|
21364
21388
|
angle: angle,
|
|
21365
21389
|
offset: offset,
|
|
21366
21390
|
rectOffset: rectOffset
|
|
21367
|
-
} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$
|
|
21368
|
-
if (isBoolean$
|
|
21369
|
-
const offsetX = (isArray$
|
|
21391
|
+
} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$7(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth]);
|
|
21392
|
+
if (isBoolean$4(bgVisible)) {
|
|
21393
|
+
const offsetX = (isArray$7(symbolSize) ? symbolSize[0] : symbolSize) / 4,
|
|
21370
21394
|
bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
21371
21395
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
21372
21396
|
x: offsetX,
|
|
@@ -21381,7 +21405,7 @@
|
|
|
21381
21405
|
size: symbolSize,
|
|
21382
21406
|
zIndex: -9
|
|
21383
21407
|
}), "symbol");
|
|
21384
|
-
isEmpty
|
|
21408
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel);
|
|
21385
21409
|
const bgRect = group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
21386
21410
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
21387
21411
|
x: 0,
|
|
@@ -21390,7 +21414,7 @@
|
|
|
21390
21414
|
height: poptipHeight,
|
|
21391
21415
|
zIndex: -8
|
|
21392
21416
|
}), "rect");
|
|
21393
|
-
isEmpty
|
|
21417
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
21394
21418
|
}
|
|
21395
21419
|
if (group.setAttributes({
|
|
21396
21420
|
x: -offset[0] + dx,
|
|
@@ -21399,7 +21423,7 @@
|
|
|
21399
21423
|
{
|
|
21400
21424
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
21401
21425
|
const b = _tBounds,
|
|
21402
|
-
stageBounds = new Bounds
|
|
21426
|
+
stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
21403
21427
|
if (rectInsideAnotherRect(b, stageBounds, !1)) break;
|
|
21404
21428
|
{
|
|
21405
21429
|
const bbox = getRectIntersect(b, stageBounds, !1),
|
|
@@ -21517,7 +21541,7 @@
|
|
|
21517
21541
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21518
21542
|
};
|
|
21519
21543
|
function wrapPoptip(target, source) {
|
|
21520
|
-
return merge$
|
|
21544
|
+
return merge$1(target, theme$2.poptip, source), target;
|
|
21521
21545
|
}
|
|
21522
21546
|
let PopTipRenderContribution = class {
|
|
21523
21547
|
render(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
@@ -21529,7 +21553,7 @@
|
|
|
21529
21553
|
} = graphic.attribute.poptip || {};
|
|
21530
21554
|
if (!1 === visible || visibleCb && !1 === visibleCb(graphic)) return;
|
|
21531
21555
|
const attribute = {};
|
|
21532
|
-
merge$
|
|
21556
|
+
merge$1(attribute, PopTip.defaultAttributes, graphic.attribute.poptip ? graphic.attribute.poptip : {}), this.poptipComponent ? this.poptipComponent.initAttributes(attribute) : this.poptipComponent = new PopTip(attribute);
|
|
21533
21557
|
let poptip = graphic.attribute.poptip || {};
|
|
21534
21558
|
if ("text" === graphic.type && null == poptip.title && null == poptip.content) {
|
|
21535
21559
|
const out = {};
|
|
@@ -21652,7 +21676,7 @@
|
|
|
21652
21676
|
return this._mainSegmentPoints;
|
|
21653
21677
|
}
|
|
21654
21678
|
constructor(attributes, options) {
|
|
21655
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
21679
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Segment.defaultAttributes, attributes)), this.name = "segment", this.key = "segment", this.lines = [];
|
|
21656
21680
|
}
|
|
21657
21681
|
render() {
|
|
21658
21682
|
this.removeAllChild(!0), this._reset();
|
|
@@ -21672,7 +21696,7 @@
|
|
|
21672
21696
|
endSymbolShape = this._renderSymbol(endSymbol, points, "end");
|
|
21673
21697
|
if (this.startSymbol = startSymbolShape, this.endSymbol = endSymbolShape, multiSegment) {
|
|
21674
21698
|
const points = [...this.attribute.points];
|
|
21675
|
-
if (isValidNumber$
|
|
21699
|
+
if (isValidNumber$1(mainSegmentIndex)) points[mainSegmentIndex] = this._clipPoints(points[mainSegmentIndex]);else {
|
|
21676
21700
|
const clipPoints = this._clipPoints(flattenArray(points));
|
|
21677
21701
|
points[0][0] = clipPoints[0], points[points.length - 1][points[points.length - 1].length - 1] = clipPoints[clipPoints.length - 1];
|
|
21678
21702
|
}
|
|
@@ -21680,10 +21704,10 @@
|
|
|
21680
21704
|
var _a, _b;
|
|
21681
21705
|
const line = graphicCreator.line(Object.assign(Object.assign({
|
|
21682
21706
|
points: point
|
|
21683
|
-
}, isArray$
|
|
21707
|
+
}, isArray$7(lineStyle) ? null !== (_a = lineStyle[index]) && void 0 !== _a ? _a : lineStyle[lineStyle.length - 1] : lineStyle), {
|
|
21684
21708
|
fill: !1
|
|
21685
21709
|
}));
|
|
21686
|
-
line.name = `${this.name}-line`, line.id = this._getNodeId("line" + index), isEmpty
|
|
21710
|
+
line.name = `${this.name}-line`, line.id = this._getNodeId("line" + index), isEmpty(null == state ? void 0 : state.line) || (line.states = isArray$7(state.line) ? null !== (_b = state.line[index]) && void 0 !== _b ? _b : state.line[state.line.length - 1] : state.line), this.add(line), this.lines.push(line);
|
|
21687
21711
|
});
|
|
21688
21712
|
} else {
|
|
21689
21713
|
let lineCreator = graphicCreator.line;
|
|
@@ -21694,7 +21718,7 @@
|
|
|
21694
21718
|
fill: !1,
|
|
21695
21719
|
closePath: !1
|
|
21696
21720
|
}));
|
|
21697
|
-
line.name = `${this.name}-line`, line.id = this._getNodeId("line"), isEmpty
|
|
21721
|
+
line.name = `${this.name}-line`, line.id = this._getNodeId("line"), isEmpty(null == state ? void 0 : state.line) || (line.states = [].concat(state.line)[0]), this.add(line), this.lines.push(line);
|
|
21698
21722
|
}
|
|
21699
21723
|
}
|
|
21700
21724
|
_computeStartRotate(angle) {
|
|
@@ -21727,17 +21751,17 @@
|
|
|
21727
21751
|
} = attribute;
|
|
21728
21752
|
let position, rotate;
|
|
21729
21753
|
"start" === dim ? (position = {
|
|
21730
|
-
x: start.x + (isValidNumber$
|
|
21731
|
-
y: start.y + (isValidNumber$
|
|
21754
|
+
x: start.x + (isValidNumber$1(startAngle) ? refX * Math.cos(startAngle) + refY * Math.cos(startAngle - Math.PI / 2) : 0),
|
|
21755
|
+
y: start.y + (isValidNumber$1(startAngle) ? refX * Math.sin(startAngle) + refY * Math.sin(startAngle - Math.PI / 2) : 0)
|
|
21732
21756
|
}, rotate = this._computeStartRotate(this._startAngle)) : (position = {
|
|
21733
|
-
x: end.x + (isValidNumber$
|
|
21734
|
-
y: end.y + (isValidNumber$
|
|
21757
|
+
x: end.x + (isValidNumber$1(endAngle) ? refX * Math.cos(endAngle) + refY * Math.cos(endAngle - Math.PI / 2) : 0),
|
|
21758
|
+
y: end.y + (isValidNumber$1(endAngle) ? refX * Math.sin(endAngle) + refY * Math.sin(endAngle - Math.PI / 2) : 0)
|
|
21735
21759
|
}, rotate = this._computeEndRotate(this._endAngle)), symbol = graphicCreator.symbol(Object.assign(Object.assign(Object.assign({}, position), {
|
|
21736
21760
|
symbolType: symbolType,
|
|
21737
21761
|
size: size,
|
|
21738
21762
|
angle: autoRotate ? rotate + refAngle : 0,
|
|
21739
21763
|
strokeBoundsBuffer: 0
|
|
21740
|
-
}), style)), symbol.name = `${this.name}-${dim}-symbol`, symbol.id = this._getNodeId(`${dim}-symbol`), isEmpty
|
|
21764
|
+
}), style)), symbol.name = `${this.name}-${dim}-symbol`, symbol.id = this._getNodeId(`${dim}-symbol`), isEmpty(null == state ? void 0 : state.symbol) || (symbol.states = state.symbol), "start" === dim ? isEmpty(null == state ? void 0 : state.startSymbol) || (symbol.states = state.startSymbol) : isEmpty(null == state ? void 0 : state.endSymbol) || (symbol.states = state.endSymbol), this.add(symbol);
|
|
21741
21765
|
}
|
|
21742
21766
|
return symbol;
|
|
21743
21767
|
}
|
|
@@ -21749,7 +21773,7 @@
|
|
|
21749
21773
|
mainSegmentIndex: mainSegmentIndex
|
|
21750
21774
|
} = this.attribute;
|
|
21751
21775
|
let points;
|
|
21752
|
-
return points = multiSegment ? isValidNumber$
|
|
21776
|
+
return points = multiSegment ? isValidNumber$1(mainSegmentIndex) ? originPoints[mainSegmentIndex] : flattenArray(originPoints) : originPoints, this._mainSegmentPoints = points, points;
|
|
21753
21777
|
}
|
|
21754
21778
|
_clipPoints(points) {
|
|
21755
21779
|
const {
|
|
@@ -21937,13 +21961,13 @@
|
|
|
21937
21961
|
const DELTA_ANGLE = Math.sin(Math.PI / 10);
|
|
21938
21962
|
function isAngleVertical(angle) {
|
|
21939
21963
|
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
21940
|
-
const hasAngle = !isNil$
|
|
21964
|
+
const hasAngle = !isNil$3(angle) && 0 !== angle,
|
|
21941
21965
|
cos = hasAngle ? Math.cos(angle) : 1;
|
|
21942
21966
|
return hasAngle && Math.abs(cos) <= delta;
|
|
21943
21967
|
}
|
|
21944
21968
|
function isAngleHorizontal(angle) {
|
|
21945
21969
|
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
21946
|
-
const hasAngle = !isNil$
|
|
21970
|
+
const hasAngle = !isNil$3(angle) && 0 !== angle,
|
|
21947
21971
|
sin = hasAngle ? Math.sin(angle) : 0;
|
|
21948
21972
|
return !hasAngle || Math.abs(sin) <= delta;
|
|
21949
21973
|
}
|
|
@@ -21961,7 +21985,7 @@
|
|
|
21961
21985
|
style = {},
|
|
21962
21986
|
angle = .5 * Math.PI
|
|
21963
21987
|
} = props,
|
|
21964
|
-
symbolStyle = merge$
|
|
21988
|
+
symbolStyle = merge$1({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style),
|
|
21965
21989
|
symbolSize = null !== (_a = symbolStyle.size) && void 0 !== _a ? _a : DEFAULT_AXIS_BREAK_SYMBOL_STYLE.size;
|
|
21966
21990
|
return Object.assign(Object.assign({}, symbolStyle), {
|
|
21967
21991
|
symbolType: null !== (_b = symbolStyle.symbolType) && void 0 !== _b ? _b : `M ${-symbolSize / 2} ${symbolSize * Math.sin(angle)} L ${symbolSize / 2} ${-symbolSize * Math.sin(angle)}`,
|
|
@@ -22008,19 +22032,19 @@
|
|
|
22008
22032
|
|
|
22009
22033
|
const dispatchHoverState = (e, container, lastHover) => {
|
|
22010
22034
|
const target = e.target;
|
|
22011
|
-
return target !== lastHover && target.name && !isEmpty
|
|
22012
|
-
node !== target && node.name && !isEmpty
|
|
22035
|
+
return target !== lastHover && target.name && !isEmpty(target.states) ? (target.addState(StateValue.hover, !0), traverseGroup(container, node => {
|
|
22036
|
+
node !== target && node.name && !isEmpty(node.states) && node.addState(StateValue.hoverReverse, !0);
|
|
22013
22037
|
}), target) : lastHover;
|
|
22014
22038
|
};
|
|
22015
22039
|
const dispatchUnHoverState = (e, container, lastHover) => lastHover ? (traverseGroup(container, node => {
|
|
22016
|
-
node.name && !isEmpty
|
|
22040
|
+
node.name && !isEmpty(node.states) && (node.removeState(StateValue.hoverReverse), node.removeState(StateValue.hover));
|
|
22017
22041
|
}), null) : lastHover;
|
|
22018
22042
|
const dispatchClickState = (e, container, lastSelect) => {
|
|
22019
22043
|
const target = e.target;
|
|
22020
22044
|
return lastSelect === target && target.hasState(StateValue.selected) ? (traverseGroup(container, node => {
|
|
22021
|
-
node.name && !isEmpty
|
|
22022
|
-
}), null) : target.name && !isEmpty
|
|
22023
|
-
node !== target && node.name && !isEmpty
|
|
22045
|
+
node.name && !isEmpty(node.states) && (node.removeState(StateValue.selectedReverse), node.removeState(StateValue.selected));
|
|
22046
|
+
}), null) : target.name && !isEmpty(target.states) ? (target.addState(StateValue.selected, !0), traverseGroup(container, node => {
|
|
22047
|
+
node !== target && node.name && !isEmpty(node.states) && node.addState(StateValue.selectedReverse, !0);
|
|
22024
22048
|
}), target) : lastSelect;
|
|
22025
22049
|
};
|
|
22026
22050
|
|
|
@@ -22041,8 +22065,8 @@
|
|
|
22041
22065
|
return this._prevInnerView;
|
|
22042
22066
|
}
|
|
22043
22067
|
getBoundsWithoutRender(attributes) {
|
|
22044
|
-
const currentAttribute = cloneDeep$
|
|
22045
|
-
merge$
|
|
22068
|
+
const currentAttribute = cloneDeep$1(this.attribute);
|
|
22069
|
+
merge$1(this.attribute, attributes);
|
|
22046
22070
|
const offscreenGroup = graphicCreator.group({
|
|
22047
22071
|
x: this.attribute.x,
|
|
22048
22072
|
y: this.attribute.y
|
|
@@ -22122,11 +22146,11 @@
|
|
|
22122
22146
|
tickLineGroup.name = AXIS_ELEMENT_NAME.tickContainer, tickLineGroup.id = this._getNodeId("tick-container"), container.add(tickLineGroup), tickLineItems.forEach((item, index) => {
|
|
22123
22147
|
var _a;
|
|
22124
22148
|
const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("tick", item, index, tickLineItems)));
|
|
22125
|
-
if (line.name = AXIS_ELEMENT_NAME.tick, line.id = this._getNodeId(item.id), isEmpty
|
|
22149
|
+
if (line.name = AXIS_ELEMENT_NAME.tick, line.id = this._getNodeId(item.id), isEmpty(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.state)) line.states = DEFAULT_STATES$2;else {
|
|
22126
22150
|
const data = this.data[index],
|
|
22127
|
-
tickLineState = merge$
|
|
22151
|
+
tickLineState = merge$1({}, DEFAULT_STATES$2, this.attribute.tick.state);
|
|
22128
22152
|
Object.keys(tickLineState).forEach(key => {
|
|
22129
|
-
isFunction$
|
|
22153
|
+
isFunction$5(tickLineState[key]) && (tickLineState[key] = tickLineState[key](data.rawValue, index, data, this.data));
|
|
22130
22154
|
}), line.states = tickLineState;
|
|
22131
22155
|
}
|
|
22132
22156
|
tickLineGroup.add(line);
|
|
@@ -22138,10 +22162,10 @@
|
|
|
22138
22162
|
const subTickLineItems = this.getSubTickLineItems();
|
|
22139
22163
|
subTickLineItems.length && subTickLineItems.forEach((item, index) => {
|
|
22140
22164
|
const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("subTick", item, index, tickLineItems)));
|
|
22141
|
-
if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty
|
|
22142
|
-
const subTickLineState = merge$
|
|
22165
|
+
if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty(subTick.state)) line.states = DEFAULT_STATES$2;else {
|
|
22166
|
+
const subTickLineState = merge$1({}, DEFAULT_STATES$2, subTick.state);
|
|
22143
22167
|
Object.keys(subTickLineState).forEach(key => {
|
|
22144
|
-
isFunction$
|
|
22168
|
+
isFunction$5(subTickLineState[key]) && (subTickLineState[key] = subTickLineState[key](item.value, index, item, tickLineItems));
|
|
22145
22169
|
}), line.states = subTickLineState;
|
|
22146
22170
|
}
|
|
22147
22171
|
tickLineGroup.add(line);
|
|
@@ -22152,7 +22176,7 @@
|
|
|
22152
22176
|
const {
|
|
22153
22177
|
dataFilter: dataFilter
|
|
22154
22178
|
} = this.attribute.label;
|
|
22155
|
-
dataFilter && isFunction$
|
|
22179
|
+
dataFilter && isFunction$5(dataFilter) && (items = dataFilter(items, layer));
|
|
22156
22180
|
const data = this._transformItems(items),
|
|
22157
22181
|
labelGroup = graphicCreator.group({
|
|
22158
22182
|
x: 0,
|
|
@@ -22163,10 +22187,10 @@
|
|
|
22163
22187
|
var _a;
|
|
22164
22188
|
const labelStyle = this._getLabelAttribute(item, index, data, layer),
|
|
22165
22189
|
text = createTextGraphicByType(labelStyle);
|
|
22166
|
-
if (text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty
|
|
22167
|
-
const labelState = merge$
|
|
22190
|
+
if (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 {
|
|
22191
|
+
const labelState = merge$1({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
22168
22192
|
Object.keys(labelState).forEach(key => {
|
|
22169
|
-
isFunction$
|
|
22193
|
+
isFunction$5(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
22170
22194
|
}), text.states = labelState;
|
|
22171
22195
|
}
|
|
22172
22196
|
text.data = Object.assign(Object.assign({}, item), {
|
|
@@ -22196,7 +22220,7 @@
|
|
|
22196
22220
|
dataFilter: dataFilter
|
|
22197
22221
|
} = tick;
|
|
22198
22222
|
let tickSegment = 1;
|
|
22199
|
-
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$
|
|
22223
|
+
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$5(dataFilter) ? dataFilter(data) : data).forEach(item => {
|
|
22200
22224
|
let point = item.point,
|
|
22201
22225
|
tickValue = item.value;
|
|
22202
22226
|
if (!alignWithLabel) {
|
|
@@ -22257,9 +22281,9 @@
|
|
|
22257
22281
|
return subTickLineItems;
|
|
22258
22282
|
}
|
|
22259
22283
|
_getTickLineAttribute(type, tickItem, index, tickItems) {
|
|
22260
|
-
let style = get$
|
|
22284
|
+
let style = get$7(this.attribute, `${type}.style`);
|
|
22261
22285
|
const data = this.data[index];
|
|
22262
|
-
style = isFunction$
|
|
22286
|
+
style = isFunction$5(style) ? merge$1({}, get$7(DEFAULT_AXIS_THEME, `${type}.style`), "tick" === type ? style(data.rawValue, index, data, this.data) : style(tickItem.value, index, tickItem, tickItems)) : style;
|
|
22263
22287
|
const {
|
|
22264
22288
|
start: start,
|
|
22265
22289
|
end: end,
|
|
@@ -22287,16 +22311,16 @@
|
|
|
22287
22311
|
tickLength = 0;
|
|
22288
22312
|
(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.visible) && this.attribute.tick.inside === inside && (tickLength = this.attribute.tick.length || 4), (null === (_b = this.attribute.subTick) || void 0 === _b ? void 0 : _b.visible) && this.attribute.subTick.inside === inside && (tickLength = Math.max(tickLength, this.attribute.subTick.length || 2)), offset += tickLength;
|
|
22289
22313
|
const axisVector = this.getRelativeVector(tickDatum.point);
|
|
22290
|
-
layer > 0 && (0 === axisVector[1] ? offset += (this.axisLabelLayerSize[layer - 1].height + get$
|
|
22314
|
+
layer > 0 && (0 === axisVector[1] ? offset += (this.axisLabelLayerSize[layer - 1].height + get$7(this.attribute, "label.space", 4)) * layer : offset += (this.axisLabelLayerSize[layer - 1].width + get$7(this.attribute, "label.space", 4)) * layer);
|
|
22291
22315
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside),
|
|
22292
22316
|
vector = this.getVerticalVector(offset || 1, inside, point),
|
|
22293
22317
|
textContent = formatMethod ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer) : tickDatum.label;
|
|
22294
22318
|
let {
|
|
22295
22319
|
style: textStyle
|
|
22296
22320
|
} = this.attribute.label;
|
|
22297
|
-
textStyle = isFunction$
|
|
22321
|
+
textStyle = isFunction$5(textStyle) ? merge$1({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
22298
22322
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
22299
|
-
return textStyle = merge$
|
|
22323
|
+
return textStyle = merge$1(labelAlign, textStyle), isFunction$5(textStyle.text) && (textStyle.text = textStyle.text({
|
|
22300
22324
|
label: tickDatum.label,
|
|
22301
22325
|
value: tickDatum.rawValue,
|
|
22302
22326
|
index: tickDatum.index,
|
|
@@ -22357,16 +22381,16 @@
|
|
|
22357
22381
|
}
|
|
22358
22382
|
}
|
|
22359
22383
|
function autoHide(labels, config) {
|
|
22360
|
-
if (isEmpty
|
|
22384
|
+
if (isEmpty(labels)) return;
|
|
22361
22385
|
const source = labels.filter(hasBounds);
|
|
22362
|
-
if (isEmpty
|
|
22386
|
+
if (isEmpty(source)) return;
|
|
22363
22387
|
let items;
|
|
22364
22388
|
items = reset(source);
|
|
22365
22389
|
const {
|
|
22366
22390
|
method = "parity",
|
|
22367
22391
|
separation: sep = 0
|
|
22368
22392
|
} = config,
|
|
22369
|
-
reduce = isFunction$
|
|
22393
|
+
reduce = isFunction$5(method) ? method : methods$1[method] || methods$1.parity;
|
|
22370
22394
|
if (items.length >= 3 && hasOverlap(items, sep)) {
|
|
22371
22395
|
do {
|
|
22372
22396
|
items = reduce(items, sep);
|
|
@@ -22378,7 +22402,7 @@
|
|
|
22378
22402
|
checkFirst = shouldCheck(items.length, config.firstVisible, !1);
|
|
22379
22403
|
let checkLast = shouldCheck(items.length, config.lastVisible);
|
|
22380
22404
|
const firstSourceItem = source[0],
|
|
22381
|
-
lastSourceItem = last
|
|
22405
|
+
lastSourceItem = last(source);
|
|
22382
22406
|
textIntersect(firstSourceItem, lastSourceItem, sep) && checkFirst && checkLast && (lastSourceItem.setAttribute("opacity", 0), checkLast = !1), forceItemVisible$1(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, sep)), forceItemVisible$1(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, sep) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, sep), !0);
|
|
22383
22407
|
}
|
|
22384
22408
|
source.forEach(item => {
|
|
@@ -22387,7 +22411,7 @@
|
|
|
22387
22411
|
}
|
|
22388
22412
|
|
|
22389
22413
|
function autoRotate(items, rotateConfig) {
|
|
22390
|
-
if (isEmpty
|
|
22414
|
+
if (isEmpty(items)) return;
|
|
22391
22415
|
const {
|
|
22392
22416
|
orient: orient,
|
|
22393
22417
|
labelRotateAngle = [0, 45, 90]
|
|
@@ -22398,7 +22422,7 @@
|
|
|
22398
22422
|
for (labelRotateAngle && labelRotateAngle.length > 0 && (n = labelRotateAngle.length); i < n;) {
|
|
22399
22423
|
const angle = labelRotateAngle[i++];
|
|
22400
22424
|
if (items.forEach(item => {
|
|
22401
|
-
item.attribute.angle = degreeToRadian
|
|
22425
|
+
item.attribute.angle = degreeToRadian(angle);
|
|
22402
22426
|
}), tryRotate(orient, items), !hasIntersect(items)) break;
|
|
22403
22427
|
}
|
|
22404
22428
|
}
|
|
@@ -22455,10 +22479,10 @@
|
|
|
22455
22479
|
}
|
|
22456
22480
|
|
|
22457
22481
|
function normalizeOverflowLimitLength(overflowLimitLength) {
|
|
22458
|
-
return isValidNumber$
|
|
22482
|
+
return isValidNumber$1(overflowLimitLength) ? {
|
|
22459
22483
|
left: overflowLimitLength,
|
|
22460
22484
|
right: overflowLimitLength
|
|
22461
|
-
} : isObject$
|
|
22485
|
+
} : isObject$8(overflowLimitLength) ? {
|
|
22462
22486
|
left: overflowLimitLength.left || 0,
|
|
22463
22487
|
right: overflowLimitLength.right || 0
|
|
22464
22488
|
} : {
|
|
@@ -22474,11 +22498,11 @@
|
|
|
22474
22498
|
orient: orient,
|
|
22475
22499
|
axisLength: axisLength
|
|
22476
22500
|
} = config;
|
|
22477
|
-
if (isEmpty
|
|
22501
|
+
if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
|
|
22478
22502
|
const overflowLimitLength = normalizeOverflowLimitLength(config.overflowLimitLength),
|
|
22479
22503
|
firstLabel = labels[0],
|
|
22480
22504
|
angle = firstLabel.attribute.angle,
|
|
22481
|
-
hasAngle = !isNil$
|
|
22505
|
+
hasAngle = !isNil$3(angle),
|
|
22482
22506
|
cos = hasAngle ? Math.cos(angle) : 1,
|
|
22483
22507
|
sin = hasAngle ? Math.sin(angle) : 0,
|
|
22484
22508
|
isHorizontal = isAngleHorizontal(angle),
|
|
@@ -22515,7 +22539,7 @@
|
|
|
22515
22539
|
limitLabelLength = Math.min(lengthLimit, verticalSizeLimit);
|
|
22516
22540
|
} else limitLabelLength = verticalSizeLimit;
|
|
22517
22541
|
} else limitLabelLength = Math.abs(limitLength / cos);
|
|
22518
|
-
isValidNumber$
|
|
22542
|
+
isValidNumber$1(label.attribute.maxLineWidth) && (limitLabelLength = isValidNumber$1(limitLabelLength) ? Math.min(label.attribute.maxLineWidth, limitLabelLength) : label.attribute.maxLineWidth), label.setAttributes({
|
|
22519
22543
|
maxLineWidth: limitLabelLength,
|
|
22520
22544
|
ellipsis: null !== (_a = label.attribute.ellipsis) && void 0 !== _a ? _a : ellipsis
|
|
22521
22545
|
});
|
|
@@ -22529,7 +22553,7 @@
|
|
|
22529
22553
|
ellipsis = "...",
|
|
22530
22554
|
orient: orient
|
|
22531
22555
|
} = config;
|
|
22532
|
-
if (isEmpty
|
|
22556
|
+
if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
|
|
22533
22557
|
const angle = labels[0].attribute.angle,
|
|
22534
22558
|
isHorizontal = isAngleHorizontal(angle),
|
|
22535
22559
|
isVertical = isAngleVertical(angle),
|
|
@@ -22541,12 +22565,12 @@
|
|
|
22541
22565
|
if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) return;
|
|
22542
22566
|
if (isHorizontal) {
|
|
22543
22567
|
const minGap = getLabelMinGap(label.attribute.x, null === (_a = labels[index + 1]) || void 0 === _a ? void 0 : _a.attribute.x, null === (_b = labels[index - 1]) || void 0 === _b ? void 0 : _b.attribute.x);
|
|
22544
|
-
isValidNumber$
|
|
22568
|
+
isValidNumber$1(minGap) && (verticalLimitLength = min(verticalLimitLength, minGap));
|
|
22545
22569
|
}
|
|
22546
22570
|
} else {
|
|
22547
22571
|
if (isVertical) {
|
|
22548
22572
|
const minGap = getLabelMinGap(label.attribute.y, null === (_c = labels[index + 1]) || void 0 === _c ? void 0 : _c.attribute.y, null === (_d = labels[index - 1]) || void 0 === _d ? void 0 : _d.attribute.y);
|
|
22549
|
-
isValidNumber$
|
|
22573
|
+
isValidNumber$1(minGap) && (verticalLimitLength = min(verticalLimitLength, minGap));
|
|
22550
22574
|
}
|
|
22551
22575
|
if (isHorizontal && Math.floor(label.AABBBounds.width()) <= limitLength) return;
|
|
22552
22576
|
}
|
|
@@ -22562,7 +22586,7 @@
|
|
|
22562
22586
|
}
|
|
22563
22587
|
function getLabelMinGap(current, next, prev) {
|
|
22564
22588
|
let minGap;
|
|
22565
|
-
return isValidNumber$
|
|
22589
|
+
return isValidNumber$1(next) && (minGap = Math.abs(next - current)), isValidNumber$1(prev) && (minGap = isValidNumber$1(minGap) ? Math.min(Math.abs(current - prev), minGap) : Math.abs(current - prev)), minGap;
|
|
22566
22590
|
}
|
|
22567
22591
|
|
|
22568
22592
|
function alignAxisLabels(labels, start, containerSize, orient, align) {
|
|
@@ -22651,7 +22675,7 @@
|
|
|
22651
22675
|
loadLineAxisComponent();
|
|
22652
22676
|
class LineAxis extends AxisBase {
|
|
22653
22677
|
constructor(attributes, options) {
|
|
22654
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
22678
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, LineAxis.defaultAttributes, attributes), options);
|
|
22655
22679
|
}
|
|
22656
22680
|
_renderInner(container) {
|
|
22657
22681
|
var _a;
|
|
@@ -22711,7 +22735,7 @@
|
|
|
22711
22735
|
width: axisContainerBounds.width(),
|
|
22712
22736
|
height: axisContainerBounds.height()
|
|
22713
22737
|
}, panel.style));
|
|
22714
|
-
bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge$
|
|
22738
|
+
bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge$1({}, DEFAULT_STATES$1, null !== (_a = panel.state) && void 0 !== _a ? _a : {}), axisContainer.insertBefore(bgRect, axisContainer.firstChild);
|
|
22715
22739
|
}
|
|
22716
22740
|
}
|
|
22717
22741
|
renderLine(container) {
|
|
@@ -22744,9 +22768,9 @@
|
|
|
22744
22768
|
linePoints.push([lastStartPoint, startPoint]), lastStartPoint = endPoint;
|
|
22745
22769
|
}), linePoints.push([lastStartPoint, end]), lineAttrs.points = linePoints, lineAttrs.multiSegment = !0;
|
|
22746
22770
|
} else lineAttrs.points = [start, end];
|
|
22747
|
-
isEmpty
|
|
22748
|
-
line: merge$
|
|
22749
|
-
symbol: merge$
|
|
22771
|
+
isEmpty(state) || (lineAttrs.state = {
|
|
22772
|
+
line: merge$1({}, DEFAULT_STATES$1, state),
|
|
22773
|
+
symbol: merge$1({}, DEFAULT_STATES$1, state)
|
|
22750
22774
|
});
|
|
22751
22775
|
const axisLineGroup = new Segment(lineAttrs);
|
|
22752
22776
|
axisLineGroup.name = AXIS_ELEMENT_NAME.line, axisLineGroup.id = this._getNodeId("line"), container.add(axisLineGroup);
|
|
@@ -22779,7 +22803,7 @@
|
|
|
22779
22803
|
axisVector = this.getRelativeVector();
|
|
22780
22804
|
let labelLength = 0;
|
|
22781
22805
|
if ((null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.label.inside) {
|
|
22782
|
-
const space = +get$
|
|
22806
|
+
const space = +get$7(this.attribute, "label.space", 4);
|
|
22783
22807
|
labelLength += space;
|
|
22784
22808
|
const layerCount = Object.keys(this.axisLabelLayerSize).length;
|
|
22785
22809
|
if (0 === axisVector[1]) {
|
|
@@ -22808,7 +22832,7 @@
|
|
|
22808
22832
|
{
|
|
22809
22833
|
angle: angle
|
|
22810
22834
|
} = restAttrs;
|
|
22811
|
-
if (textAlign = "start" === position ? "start" : "end" === position ? "end" : "center", isNil$
|
|
22835
|
+
if (textAlign = "start" === position ? "start" : "end" === position ? "end" : "center", isNil$3(angle) && autoRotate) {
|
|
22812
22836
|
angle = angleTo(axisVector, [1, 0], !0);
|
|
22813
22837
|
const {
|
|
22814
22838
|
verticalFactor = 1
|
|
@@ -22816,14 +22840,14 @@
|
|
|
22816
22840
|
textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
|
|
22817
22841
|
} else textAlign = this.getTextAlign(vector), textBaseline = this.getTextBaseline(vector, !1);
|
|
22818
22842
|
let maxTagWidth = maxWidth;
|
|
22819
|
-
if (isNil$
|
|
22843
|
+
if (isNil$3(maxTagWidth)) {
|
|
22820
22844
|
const {
|
|
22821
22845
|
verticalLimitSize: verticalLimitSize,
|
|
22822
22846
|
verticalMinSize: verticalMinSize,
|
|
22823
22847
|
orient: orient
|
|
22824
22848
|
} = this.attribute,
|
|
22825
22849
|
limitSize = Math.min(verticalLimitSize || 1 / 0, verticalMinSize || 1 / 0);
|
|
22826
|
-
if (isValidNumber$
|
|
22850
|
+
if (isValidNumber$1(limitSize)) {
|
|
22827
22851
|
if ("bottom" === orient || "top" === orient) {
|
|
22828
22852
|
if (angle !== Math.PI / 2) {
|
|
22829
22853
|
const cosValue = Math.abs(Math.cos(null != angle ? angle : 0));
|
|
@@ -22842,9 +22866,9 @@
|
|
|
22842
22866
|
textBaseline: textBaseline
|
|
22843
22867
|
}, textStyle),
|
|
22844
22868
|
state: {
|
|
22845
|
-
text: merge$
|
|
22846
|
-
shape: merge$
|
|
22847
|
-
panel: merge$
|
|
22869
|
+
text: merge$1({}, DEFAULT_STATES$1, state.text),
|
|
22870
|
+
shape: merge$1({}, DEFAULT_STATES$1, state.shape),
|
|
22871
|
+
panel: merge$1({}, DEFAULT_STATES$1, state.background)
|
|
22848
22872
|
}
|
|
22849
22873
|
});
|
|
22850
22874
|
return attrs.angle = angle, shape && shape.visible && (attrs.shape = Object.assign({
|
|
@@ -22885,11 +22909,11 @@
|
|
|
22885
22909
|
} = this.attribute,
|
|
22886
22910
|
isX = "bottom" === orient || "top" === orient,
|
|
22887
22911
|
first = labelShapes[0],
|
|
22888
|
-
last = last
|
|
22889
|
-
isInverse = isX ? first.attribute.x > last.attribute.x : first.attribute.y < last.attribute.y;
|
|
22912
|
+
last$1 = last(labelShapes),
|
|
22913
|
+
isInverse = isX ? first.attribute.x > last$1.attribute.x : first.attribute.y < last$1.attribute.y;
|
|
22890
22914
|
if (isX) {
|
|
22891
|
-
const leftMostLabel = isInverse ? last : first,
|
|
22892
|
-
rightMostLabel = isInverse ? first : last,
|
|
22915
|
+
const leftMostLabel = isInverse ? last$1 : first,
|
|
22916
|
+
rightMostLabel = isInverse ? first : last$1,
|
|
22893
22917
|
left = axisStart.x,
|
|
22894
22918
|
right = axisEnd.x,
|
|
22895
22919
|
leftBound = leftMostLabel.AABBBounds.x1,
|
|
@@ -22911,8 +22935,8 @@
|
|
|
22911
22935
|
});
|
|
22912
22936
|
}
|
|
22913
22937
|
} else {
|
|
22914
|
-
const bottomMostLabel = isInverse ? last : first,
|
|
22915
|
-
topMostLabel = isInverse ? first : last,
|
|
22938
|
+
const bottomMostLabel = isInverse ? last$1 : first,
|
|
22939
|
+
topMostLabel = isInverse ? first : last$1,
|
|
22916
22940
|
bottomBound = bottomMostLabel.AABBBounds.y2,
|
|
22917
22941
|
topBound = topMostLabel.AABBBounds.y1,
|
|
22918
22942
|
top = axisStart.y,
|
|
@@ -22937,7 +22961,7 @@
|
|
|
22937
22961
|
}
|
|
22938
22962
|
}
|
|
22939
22963
|
handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
22940
|
-
if (isEmpty
|
|
22964
|
+
if (isEmpty(labelShapes)) return;
|
|
22941
22965
|
const {
|
|
22942
22966
|
verticalLimitSize: verticalLimitSize,
|
|
22943
22967
|
label: label,
|
|
@@ -22958,7 +22982,7 @@
|
|
|
22958
22982
|
autoWrap: autoWrap$1,
|
|
22959
22983
|
overflowLimitLength: overflowLimitLength
|
|
22960
22984
|
} = label;
|
|
22961
|
-
if (isFunction$
|
|
22985
|
+
if (isFunction$5(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
22962
22986
|
if (autoRotate$1) autoRotate(labelShapes, {
|
|
22963
22987
|
labelRotateAngle: autoRotateAngle,
|
|
22964
22988
|
orient: orient
|
|
@@ -22971,7 +22995,7 @@
|
|
|
22971
22995
|
ellipsis: limitEllipsis
|
|
22972
22996
|
});
|
|
22973
22997
|
}
|
|
22974
|
-
if (!autoWrap$1 && autoLimit$1 && isValidNumber$
|
|
22998
|
+
if (!autoWrap$1 && autoLimit$1 && isValidNumber$1(limitLength) && limitLength > 0) {
|
|
22975
22999
|
const isVertical = "left" === orient || "right" === orient,
|
|
22976
23000
|
axisLength = isVertical ? Math.abs(this.attribute.start.y - this.attribute.end.y) : Math.abs(this.attribute.start.x - this.attribute.end.x),
|
|
22977
23001
|
verticalLimitLength = isVertical ? axisLength / labelShapes.length : autoHide$1 || autoRotate$1 ? 1 / 0 : axisLength / labelShapes.length;
|
|
@@ -23004,7 +23028,7 @@
|
|
|
23004
23028
|
const {
|
|
23005
23029
|
verticalMinSize: verticalMinSize
|
|
23006
23030
|
} = this.attribute;
|
|
23007
|
-
if (isValidNumber$
|
|
23031
|
+
if (isValidNumber$1(verticalMinSize) && (!isValidNumber$1(verticalLimitSize) || verticalMinSize <= verticalLimitSize)) {
|
|
23008
23032
|
const minSize = this._getAxisLabelLimitLength(verticalMinSize, layerCount);
|
|
23009
23033
|
let x, y;
|
|
23010
23034
|
axisLabelContainerSize = Math.max(axisLabelContainerSize, minSize), "left" === orient ? (x = axisLabelContainerBounds.x2 - axisLabelContainerSize, y = axisLabelContainerBounds.y1) : "right" === orient ? (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y1) : "top" === orient ? (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y2 - axisLabelContainerSize) : "bottom" === orient && (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y1);
|
|
@@ -23017,7 +23041,7 @@
|
|
|
23017
23041
|
});
|
|
23018
23042
|
bgRect.name = AXIS_ELEMENT_NAME.axisLabelBackground, bgRect.id = this._getNodeId("axis-label-background"), labelContainer.insertBefore(bgRect, labelContainer.firstChild);
|
|
23019
23043
|
}
|
|
23020
|
-
if (isValid$
|
|
23044
|
+
if (isValid$3(this.attribute.label.containerAlign)) {
|
|
23021
23045
|
let start;
|
|
23022
23046
|
"left" === orient ? start = axisLabelContainerBounds.x2 - axisLabelContainerSize : "right" === orient ? start = axisLabelContainerBounds.x1 : "top" === orient ? start = axisLabelContainerBounds.y2 - axisLabelContainerSize : "bottom" === orient && (start = axisLabelContainerBounds.y1), alignAxisLabels(labelShapes, start, axisLabelContainerSize, orient, this.attribute.label.containerAlign);
|
|
23023
23047
|
}
|
|
@@ -23055,8 +23079,8 @@
|
|
|
23055
23079
|
}));
|
|
23056
23080
|
const labelOverlap = function (prevLabel, nextLabel) {
|
|
23057
23081
|
let gap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
23058
|
-
const prevBounds = new AABBBounds
|
|
23059
|
-
nextBounds = new AABBBounds
|
|
23082
|
+
const prevBounds = new AABBBounds(prevLabel).expand(gap / 2),
|
|
23083
|
+
nextBounds = new AABBBounds(nextLabel).expand(gap / 2);
|
|
23060
23084
|
return prevBounds.intersects(nextBounds);
|
|
23061
23085
|
};
|
|
23062
23086
|
const MIN_TICK_GAP = 12;
|
|
@@ -23071,7 +23095,7 @@
|
|
|
23071
23095
|
startAngle = 0
|
|
23072
23096
|
} = op;
|
|
23073
23097
|
let labelAngle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0;
|
|
23074
|
-
"vertical" === labelStyle.direction && (labelAngle += degreeToRadian
|
|
23098
|
+
"vertical" === labelStyle.direction && (labelAngle += degreeToRadian(90));
|
|
23075
23099
|
const isHorizontal = ["bottom", "top"].includes(axisOrientType),
|
|
23076
23100
|
isVertical = ["left", "right"].includes(axisOrientType);
|
|
23077
23101
|
let scaleX = 1,
|
|
@@ -23096,7 +23120,7 @@
|
|
|
23096
23120
|
textX = baseTextX,
|
|
23097
23121
|
textY = baseTextY;
|
|
23098
23122
|
labelFlush && isHorizontal && 0 === i ? textX = calculateFlushPos(baseTextX, textWidth, range[0], range[range.length - 1]) : labelFlush && isHorizontal && i === domain.length - 1 ? textX = calculateFlushPos(baseTextX, textWidth, range[range.length - 1], range[0]) : align = null !== (_a = labelStyle.textAlign) && void 0 !== _a ? _a : "center", "right" === align ? textX -= textWidth : "center" === align && (textX -= textWidth / 2), labelFlush && isVertical && 0 === i ? textY = calculateFlushPos(baseTextY, textHeight, range[0], range[range.length - 1]) : labelFlush && isVertical && i === domain.length - 1 ? textY = calculateFlushPos(baseTextY, textHeight, range[range.length - 1], range[0]) : baseline = null !== (_b = labelStyle.textBaseline) && void 0 !== _b ? _b : "middle", "bottom" === baseline ? textY -= textHeight : "middle" === baseline && (textY -= textHeight / 2);
|
|
23099
|
-
const bounds = new AABBBounds
|
|
23123
|
+
const bounds = new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight);
|
|
23100
23124
|
return labelAngle && bounds.rotate(labelAngle, baseTextX, baseTextY), bounds;
|
|
23101
23125
|
});
|
|
23102
23126
|
return labelBoundsList;
|
|
@@ -23171,18 +23195,18 @@
|
|
|
23171
23195
|
this._rangeFactorStart = null, this._rangeFactorEnd = null;
|
|
23172
23196
|
}
|
|
23173
23197
|
_calculateWholeRange(range) {
|
|
23174
|
-
return this._wholeRange ? this._wholeRange : isValid$
|
|
23198
|
+
return this._wholeRange ? this._wholeRange : isValid$3(this._rangeFactorStart) && isValid$3(this._rangeFactorEnd) && 2 === range.length ? (this._wholeRange = calculateWholeRangeFromRangeFactor$1(range, [this._rangeFactorStart, this._rangeFactorEnd]), this._wholeRange) : range;
|
|
23175
23199
|
}
|
|
23176
23200
|
rangeFactor(_, slience, clear) {
|
|
23177
|
-
return _ ? (2 === _.length && _.every(r => r >= 0 && r <= 1) && (this._wholeRange = null, 0 === _[0] && 1 === _[1] ? (this._rangeFactorStart = null, this._rangeFactorEnd = null) : (this._rangeFactorStart = _[0], this._rangeFactorEnd = _[1])), this) : clear ? (this._wholeRange = null, this._rangeFactorStart = null, this._rangeFactorEnd = null, this) : isValid$
|
|
23201
|
+
return _ ? (2 === _.length && _.every(r => r >= 0 && r <= 1) && (this._wholeRange = null, 0 === _[0] && 1 === _[1] ? (this._rangeFactorStart = null, this._rangeFactorEnd = null) : (this._rangeFactorStart = _[0], this._rangeFactorEnd = _[1])), this) : clear ? (this._wholeRange = null, this._rangeFactorStart = null, this._rangeFactorEnd = null, this) : isValid$3(this._rangeFactorStart) && isValid$3(this._rangeFactorEnd) ? [this._rangeFactorStart, this._rangeFactorEnd] : null;
|
|
23178
23202
|
}
|
|
23179
23203
|
rangeFactorStart(_, slience) {
|
|
23180
23204
|
var _a;
|
|
23181
|
-
return isNil$
|
|
23205
|
+
return isNil$3(_) ? this._rangeFactorStart : (_ >= 0 && _ <= 1 && (this._wholeRange = null, 0 !== _ || !isNil$3(this._rangeFactorEnd) && 1 !== this._rangeFactorEnd ? (this._rangeFactorStart = _, this._rangeFactorEnd = null !== (_a = this._rangeFactorEnd) && void 0 !== _a ? _a : 1) : (this._rangeFactorStart = null, this._rangeFactorEnd = null)), this);
|
|
23182
23206
|
}
|
|
23183
23207
|
rangeFactorEnd(_, slience) {
|
|
23184
23208
|
var _a;
|
|
23185
|
-
return isNil$
|
|
23209
|
+
return isNil$3(_) ? this._rangeFactorEnd : (_ >= 0 && _ <= 1 && (this._wholeRange = null, 0 !== _ || !isNil$3(this._rangeFactorStart) && 0 !== this._rangeFactorStart ? (this._rangeFactorEnd = _, this._rangeFactorStart = null !== (_a = this._rangeFactorStart) && void 0 !== _a ? _a : 0) : (this._rangeFactorStart = null, this._rangeFactorEnd = null)), this);
|
|
23186
23210
|
}
|
|
23187
23211
|
generateFishEyeTransform() {
|
|
23188
23212
|
var _a;
|
|
@@ -23198,7 +23222,7 @@
|
|
|
23198
23222
|
min = Math.min(first, last),
|
|
23199
23223
|
max = Math.max(first, last),
|
|
23200
23224
|
focus = clamp$3(null !== (_a = this._fishEyeOptions.focus) && void 0 !== _a ? _a : 0, min, max),
|
|
23201
|
-
rangeRadius = isNil$
|
|
23225
|
+
rangeRadius = isNil$3(radius) ? (max - min) * radiusRatio : radius;
|
|
23202
23226
|
let k0 = Math.exp(distortion);
|
|
23203
23227
|
k0 = k0 / (k0 - 1) * rangeRadius;
|
|
23204
23228
|
const k1 = distortion / rangeRadius;
|
|
@@ -23225,7 +23249,7 @@
|
|
|
23225
23249
|
function interpolate$1(a, b) {
|
|
23226
23250
|
const t = typeof b;
|
|
23227
23251
|
let c;
|
|
23228
|
-
if (isNil$
|
|
23252
|
+
if (isNil$3(b) || "boolean" === t) return () => b;
|
|
23229
23253
|
if ("number" === t) return interpolateNumber$1(a, b);
|
|
23230
23254
|
if ("string" === t) {
|
|
23231
23255
|
if (c = Color$1.parseColorString(b)) {
|
|
@@ -23245,7 +23269,7 @@
|
|
|
23245
23269
|
}
|
|
23246
23270
|
calculateVisibleDomain(range) {
|
|
23247
23271
|
var _a;
|
|
23248
|
-
if (isValid$
|
|
23272
|
+
if (isValid$3(this._rangeFactorStart) && isValid$3(this._rangeFactorEnd) && 2 === range.length) {
|
|
23249
23273
|
return [this.invert(range[0]), this.invert(range[1])];
|
|
23250
23274
|
}
|
|
23251
23275
|
return null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain;
|
|
@@ -23318,10 +23342,10 @@
|
|
|
23318
23342
|
return _ ? (super.rangeFactor(_), this._output = this._input = null, this) : super.rangeFactor();
|
|
23319
23343
|
}
|
|
23320
23344
|
rangeFactorStart(_, slience) {
|
|
23321
|
-
return isNil$
|
|
23345
|
+
return isNil$3(_) ? super.rangeFactorStart() : (super.rangeFactorStart(_), this._output = this._input = null, this);
|
|
23322
23346
|
}
|
|
23323
23347
|
rangeFactorEnd(_, slience) {
|
|
23324
|
-
return isNil$
|
|
23348
|
+
return isNil$3(_) ? super.rangeFactorEnd() : (super.rangeFactorEnd(_), this._output = this._input = null, this);
|
|
23325
23349
|
}
|
|
23326
23350
|
forceAlignDomainRange(forceAlign) {
|
|
23327
23351
|
return arguments.length ? (this._forceAlign = forceAlign, this) : this._forceAlign;
|
|
@@ -23479,13 +23503,13 @@
|
|
|
23479
23503
|
}
|
|
23480
23504
|
}
|
|
23481
23505
|
function parseNiceOptions$1(originalDomain, option) {
|
|
23482
|
-
const hasForceMin = isNumber$
|
|
23483
|
-
hasForceMax = isNumber$
|
|
23506
|
+
const hasForceMin = isNumber$4(option.forceMin),
|
|
23507
|
+
hasForceMax = isNumber$4(option.forceMax);
|
|
23484
23508
|
let niceType = null;
|
|
23485
23509
|
const niceMinMax = [];
|
|
23486
23510
|
let niceDomain = null;
|
|
23487
23511
|
const domainValidator = hasForceMin && hasForceMax ? x => x >= option.forceMin && x <= option.forceMax : hasForceMin ? x => x >= option.forceMin : hasForceMax ? x => x <= option.forceMax : null;
|
|
23488
|
-
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$
|
|
23512
|
+
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$4(option.min) && option.min <= Math.min(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[0] = option.min), hasForceMax ? niceMinMax[1] = option.forceMax : isNumber$4(option.max) && option.max >= Math.max(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[1] = option.max), isNumber$4(niceMinMax[0]) && isNumber$4(niceMinMax[1]) ? (niceDomain = originalDomain.slice(), niceDomain[0] = niceMinMax[0], niceDomain[niceDomain.length - 1] = niceMinMax[1]) : niceType = isNumber$4(niceMinMax[0]) || isNumber$4(niceMinMax[1]) ? isNumber$4(niceMinMax[0]) ? "max" : "min" : "all", {
|
|
23489
23513
|
niceType: niceType,
|
|
23490
23514
|
niceDomain: niceDomain,
|
|
23491
23515
|
niceMinMax: niceMinMax,
|
|
@@ -23513,8 +23537,8 @@
|
|
|
23513
23537
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
23514
23538
|
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
23515
23539
|
var _a;
|
|
23516
|
-
if (isFunction$
|
|
23517
|
-
if (isValid$
|
|
23540
|
+
if (isFunction$5(null == options ? void 0 : options.customTicks)) return options.customTicks(this, count);
|
|
23541
|
+
if (isValid$3(this._rangeFactorStart) && isValid$3(this._rangeFactorEnd) && (this._rangeFactorStart > 0 || this._rangeFactorEnd < 1) && 2 === this._range.length || !this._niceType) return this.d3Ticks(count, options);
|
|
23518
23542
|
const curNiceDomain = null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain,
|
|
23519
23543
|
originalDomain = this._domain,
|
|
23520
23544
|
start = curNiceDomain[0],
|
|
@@ -23621,8 +23645,8 @@
|
|
|
23621
23645
|
breakData: breakData
|
|
23622
23646
|
} = op;
|
|
23623
23647
|
let scaleTicks;
|
|
23624
|
-
if (isValid$
|
|
23625
|
-
const count = null !== (_a = isFunction$
|
|
23648
|
+
if (isValid$3(tickStep)) ticks = scale.stepTicks(tickStep), breakDomains = breakData && breakData() ? breakData().breakDomains : null, scaleTicks = breakDomains && breakDomains.length ? ticks.filter(tick => breakDomains.every(breakDomain => tick < breakDomain[0] || tick > breakDomain[1])) : ticks;else if (isValid$3(forceTickCount)) scaleTicks = getScaleTicks(op, scale, forceTickCount, (count, subDomain) => subDomain && subDomain.length ? scale.domain(subDomain, !0).forceTicks(count) : scale.forceTicks(count));else if ("d3" === op.tickMode) {
|
|
23649
|
+
const count = null !== (_a = isFunction$5(tickCount) ? tickCount({
|
|
23626
23650
|
axisLength: rangeSize,
|
|
23627
23651
|
labelStyle: labelStyle
|
|
23628
23652
|
}) : tickCount) && void 0 !== _a ? _a : 5;
|
|
@@ -23632,11 +23656,11 @@
|
|
|
23632
23656
|
noDecimals: noDecimals
|
|
23633
23657
|
}));
|
|
23634
23658
|
} else {
|
|
23635
|
-
const count = null !== (_b = isFunction$
|
|
23659
|
+
const count = null !== (_b = isFunction$5(tickCount) ? tickCount({
|
|
23636
23660
|
axisLength: rangeSize,
|
|
23637
23661
|
labelStyle: labelStyle
|
|
23638
23662
|
}) : tickCount) && void 0 !== _b ? _b : 5,
|
|
23639
|
-
customTicks = isFunction$
|
|
23663
|
+
customTicks = isFunction$5(op.tickMode) ? op.tickMode : void 0;
|
|
23640
23664
|
scaleTicks = getScaleTicks(op, scale, count, (count, subDomain) => subDomain && subDomain.length ? scale.domain(subDomain, !0).ticks(count, {
|
|
23641
23665
|
noDecimals: noDecimals,
|
|
23642
23666
|
customTicks: customTicks
|
|
@@ -23668,14 +23692,14 @@
|
|
|
23668
23692
|
value: scaleTicks[i]
|
|
23669
23693
|
}));
|
|
23670
23694
|
const firstSourceItem = items[0],
|
|
23671
|
-
lastSourceItem = last
|
|
23695
|
+
lastSourceItem = last(items),
|
|
23672
23696
|
samplingMethod = breakData && breakData() ? methods.greedy : methods.parity;
|
|
23673
23697
|
for (; items.length >= 3 && hasOverlap(items, labelGap);) items = samplingMethod(items, labelGap);
|
|
23674
23698
|
const checkFirst = op.labelFirstVisible;
|
|
23675
23699
|
let checkLast = op.labelLastVisible;
|
|
23676
23700
|
textIntersect(firstSourceItem, lastSourceItem, labelGap) && items.includes(lastSourceItem) && items.length > 1 && checkFirst && checkLast && (items.splice(items.indexOf(lastSourceItem), 1), checkLast = !1), forceItemVisible(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, labelGap)), forceItemVisible(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, labelGap) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, labelGap), !0);
|
|
23677
23701
|
const ticks = items.map(item => item.value);
|
|
23678
|
-
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last
|
|
23702
|
+
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
|
|
23679
23703
|
}
|
|
23680
23704
|
return convertDomainToTickData(scaleTicks);
|
|
23681
23705
|
};
|
|
@@ -23712,16 +23736,16 @@
|
|
|
23712
23736
|
rangeSize = scale.calculateWholeRangeSize();
|
|
23713
23737
|
if (rangeSize < 2) return op.labelLastVisible ? convertDomainToTickData([domain[domain.length - 1]]) : convertDomainToTickData([domain[0]]);
|
|
23714
23738
|
let scaleTicks;
|
|
23715
|
-
if (isValid$
|
|
23716
|
-
const count = isFunction$
|
|
23739
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
23740
|
+
const count = isFunction$5(tickCount) ? tickCount({
|
|
23717
23741
|
axisLength: rangeSize,
|
|
23718
23742
|
labelStyle: labelStyle
|
|
23719
23743
|
}) : tickCount;
|
|
23720
23744
|
scaleTicks = scale.ticks(count);
|
|
23721
23745
|
} else if (op.sampling) {
|
|
23722
23746
|
const fontSize = (null !== (_a = op.labelStyle.fontSize) && void 0 !== _a ? _a : 12) + 2,
|
|
23723
|
-
rangeStart = minInArray
|
|
23724
|
-
rangeEnd = maxInArray
|
|
23747
|
+
rangeStart = minInArray(range),
|
|
23748
|
+
rangeEnd = maxInArray(range);
|
|
23725
23749
|
if (domain.length <= rangeSize / fontSize) {
|
|
23726
23750
|
const incrementUnit = (rangeEnd - rangeStart) / domain.length,
|
|
23727
23751
|
labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal),
|
|
@@ -23832,7 +23856,7 @@
|
|
|
23832
23856
|
y: y
|
|
23833
23857
|
} = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside);
|
|
23834
23858
|
orient.align || (isNumberClose$1(x, center.x) ? orient.baseline || (orient.baseline = y > center.y ? "top" : "bottom") : x > center.x ? orient.align = "left" : x < center.x && (orient.align = "right")), textX = x + ("right" === orient.align ? -textWidth : "left" === orient.align ? 0 : -textWidth / 2), textY = y + ("bottom" === orient.baseline ? -textHeight : "top" === orient.baseline ? 0 : -textHeight / 2);
|
|
23835
|
-
return new AABBBounds
|
|
23859
|
+
return new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight).rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
|
|
23836
23860
|
});
|
|
23837
23861
|
};
|
|
23838
23862
|
const polarAngleAxisDiscreteTicks = (scale, op) => {
|
|
@@ -23848,10 +23872,10 @@
|
|
|
23848
23872
|
radius = null == getRadius ? void 0 : getRadius();
|
|
23849
23873
|
if (!radius) return convertDomainToTickData(scale.domain());
|
|
23850
23874
|
let scaleTicks;
|
|
23851
|
-
if (isValid$
|
|
23875
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
23852
23876
|
const range = scale.range(),
|
|
23853
23877
|
rangeSize = Math.abs(range[range.length - 1] - range[0]),
|
|
23854
|
-
count = isFunction$
|
|
23878
|
+
count = isFunction$5(tickCount) ? tickCount({
|
|
23855
23879
|
axisLength: rangeSize,
|
|
23856
23880
|
labelStyle: labelStyle
|
|
23857
23881
|
}) : tickCount;
|
|
@@ -23860,8 +23884,8 @@
|
|
|
23860
23884
|
const domain = scale.domain(),
|
|
23861
23885
|
range = scale.range(),
|
|
23862
23886
|
labelBoundsList = getPolarAngleLabelBounds(scale, domain, op),
|
|
23863
|
-
rangeStart = minInArray
|
|
23864
|
-
rangeEnd = maxInArray
|
|
23887
|
+
rangeStart = minInArray(range),
|
|
23888
|
+
rangeEnd = maxInArray(range),
|
|
23865
23889
|
incrementUnit = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset) / domain.length,
|
|
23866
23890
|
{
|
|
23867
23891
|
step: step,
|
|
@@ -23927,7 +23951,7 @@
|
|
|
23927
23951
|
return this._current;
|
|
23928
23952
|
}
|
|
23929
23953
|
constructor(attributes, options) {
|
|
23930
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
23954
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Pager.defaultAttributes, attributes)), this.name = "pager", this._current = 1, this._onHover = e => {
|
|
23931
23955
|
const target = e.target;
|
|
23932
23956
|
target.hasState("disable") || target.addState("hover");
|
|
23933
23957
|
}, this._onUnHover = e => {
|
|
@@ -23999,8 +24023,8 @@
|
|
|
23999
24023
|
textAlign: "center",
|
|
24000
24024
|
textBaseline: "middle"
|
|
24001
24025
|
}, textStyle), null === (_c = null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme()) || void 0 === _c ? void 0 : _c.text),
|
|
24002
|
-
handlerSizeX = isNumber$
|
|
24003
|
-
handlerSizeY = isNumber$
|
|
24026
|
+
handlerSizeX = isNumber$4(handlerSize) ? handlerSize : handlerSize[0],
|
|
24027
|
+
handlerSizeY = isNumber$4(handlerSize) ? handlerSize : handlerSize[1],
|
|
24004
24028
|
text = graphicCreator.text(Object.assign({
|
|
24005
24029
|
x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
|
|
24006
24030
|
y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
|
|
@@ -24035,7 +24059,7 @@
|
|
|
24035
24059
|
const {
|
|
24036
24060
|
pageFormatter: pageFormatter
|
|
24037
24061
|
} = this.attribute;
|
|
24038
|
-
return pageFormatter ? isFunction$
|
|
24062
|
+
return pageFormatter ? isFunction$5(pageFormatter) ? pageFormatter(current, this._total) : `${pageFormatter}`.replace("{current}", `${current}`).replace("{total}", `${this._total}`) : `${current}/${this._total}`;
|
|
24039
24063
|
}
|
|
24040
24064
|
setTotal(total) {
|
|
24041
24065
|
total !== this.attribute.total && (this._total = total, 1 !== this._current && this._current <= total ? this.setAttributes({
|
|
@@ -24116,7 +24140,7 @@
|
|
|
24116
24140
|
};
|
|
24117
24141
|
shape && shape.visible && (tagAttrs.shape = Object.assign({
|
|
24118
24142
|
visible: !0
|
|
24119
|
-
}, shape.style), isValid$
|
|
24143
|
+
}, shape.style), isValid$3(shape.space) && (tagAttrs.space = shape.space)), background && background.visible && (tagAttrs.panel = Object.assign({
|
|
24120
24144
|
visible: !0
|
|
24121
24145
|
}, background.style));
|
|
24122
24146
|
const titleTag = new Tag$1(tagAttrs);
|
|
@@ -24169,7 +24193,7 @@
|
|
|
24169
24193
|
loadDiscreteLegendComponent();
|
|
24170
24194
|
class DiscreteLegend extends LegendBase {
|
|
24171
24195
|
constructor(attributes, options) {
|
|
24172
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
24196
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._contentMaxHeight = 0, this._onHover = e => {
|
|
24173
24197
|
const target = e.target;
|
|
24174
24198
|
if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
24175
24199
|
const legendItem = target.delegate;
|
|
@@ -24264,18 +24288,18 @@
|
|
|
24264
24288
|
for (let index = startIndex, len = legendItems.length; index < len && !(lazyload && pages > this._itemContext.currentPage * maxPages); index++) {
|
|
24265
24289
|
lazyload && (this._itemContext.startIndex = index + 1), item = legendItems[index], item.id || (item.id = item.label), item.index = index;
|
|
24266
24290
|
let isSelected = !0;
|
|
24267
|
-
isArray$
|
|
24291
|
+
isArray$7(defaultSelected) && (isSelected = defaultSelected.includes(item.label));
|
|
24268
24292
|
const itemGroup = this._renderEachItem(item, isSelected, index, legendItems),
|
|
24269
24293
|
itemWidth = itemGroup.attribute.width,
|
|
24270
24294
|
itemHeight = itemGroup.attribute.height;
|
|
24271
|
-
this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (isValid$
|
|
24295
|
+
this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (isValid$3(maxWidth) && (isScrollbar && autoPage ? (pages = Math.ceil((startX + itemWidth) / maxWidth), doWrap = pages > 1) : startX + itemWidth > maxWidth && (doWrap = !0, startX > 0 && ("middle" !== verticalAlign && "bottom" !== verticalAlign || lastLineItemGroup.forEach(i => {
|
|
24272
24296
|
i.setAttributes({
|
|
24273
24297
|
y: i.attribute.y + (lastLineHeight - i.attribute.height) / ("middle" === verticalAlign ? 2 : 1)
|
|
24274
24298
|
});
|
|
24275
24299
|
}), pages += 1, startX = 0, startY += lastLineHeight + spaceRow, lastLineHeight = 0, lastLineItemGroup.length = 0))), 0 === startX && 0 === startY || itemGroup.setAttributes({
|
|
24276
24300
|
x: startX,
|
|
24277
24301
|
y: startY
|
|
24278
|
-
}), startX += spaceCol + itemWidth, lastLineHeight = Math.max(lastLineHeight, itemHeight), lastLineItemGroup.push(itemGroup)) : (isValid$
|
|
24302
|
+
}), startX += spaceCol + itemWidth, lastLineHeight = Math.max(lastLineHeight, itemHeight), lastLineItemGroup.push(itemGroup)) : (isValid$3(maxHeight) && (isScrollbar && autoPage ? (pages = Math.ceil((startY + itemHeight) / maxHeight), doWrap = pages > 1) : maxHeight <= itemHeight ? (pages += 1, doWrap = !0, startY = 0, index > 0 && (startX += lastItemWidth + spaceCol)) : maxHeight < startY + itemHeight && (pages += 1, doWrap = !0, startY = 0, startX += maxWidthInCol + spaceCol, maxWidthInCol = 0)), 0 === startX && 0 === startY || itemGroup.setAttributes({
|
|
24279
24303
|
x: startX,
|
|
24280
24304
|
y: startY
|
|
24281
24305
|
}), startY += spaceRow + itemHeight), itemsContainer.add(itemGroup), lastItemWidth = itemWidth;
|
|
@@ -24294,7 +24318,7 @@
|
|
|
24294
24318
|
maxWidth: maxWidth,
|
|
24295
24319
|
maxHeight: maxHeight
|
|
24296
24320
|
} = this.attribute;
|
|
24297
|
-
if (!1 === item.visible || isEmpty
|
|
24321
|
+
if (!1 === item.visible || isEmpty(items)) return;
|
|
24298
24322
|
let legendItems = items;
|
|
24299
24323
|
reversed && (legendItems = null == items ? void 0 : items.reverse()), this._contentMaxHeight = Math.max(0, maxHeight - this._parsedPadding[0] - this._parsedPadding[2]);
|
|
24300
24324
|
const itemsContainer = graphicCreator.group({
|
|
@@ -24313,7 +24337,7 @@
|
|
|
24313
24337
|
height: itemHeight
|
|
24314
24338
|
} = item,
|
|
24315
24339
|
widthsOptions = [];
|
|
24316
|
-
isValid$
|
|
24340
|
+
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);
|
|
24317
24341
|
const pager = this.attribute.pager;
|
|
24318
24342
|
this._itemContext = {
|
|
24319
24343
|
currentPage: pager && pager.defaultCurrent || 1,
|
|
@@ -24331,7 +24355,7 @@
|
|
|
24331
24355
|
clipContainer: void 0
|
|
24332
24356
|
}, this._itemContext = this._renderItems();
|
|
24333
24357
|
let pagerRendered = !1;
|
|
24334
|
-
this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages && (pagerRendered = this._renderPagerComponent()), pagerRendered || (itemsContainer.setAttribute("y", this._title ? this._title.AABBBounds.height() + get$
|
|
24358
|
+
this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages && (pagerRendered = this._renderPagerComponent()), pagerRendered || (itemsContainer.setAttribute("y", this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", 8) : 0), this._innerView.add(itemsContainer));
|
|
24335
24359
|
}
|
|
24336
24360
|
_bindEvents() {
|
|
24337
24361
|
if (this.attribute.disableTriggerEvent) return;
|
|
@@ -24343,11 +24367,11 @@
|
|
|
24343
24367
|
if (hover) {
|
|
24344
24368
|
let trigger = "pointermove",
|
|
24345
24369
|
triggerOff = "pointerleave";
|
|
24346
|
-
isObject$
|
|
24370
|
+
isObject$8(hover) && (hover.trigger && (trigger = hover.trigger), hover.triggerOff && (triggerOff = hover.triggerOff)), this._itemsContainer.addEventListener(trigger, this._onHover), this._itemsContainer.addEventListener(triggerOff, this._onUnHover);
|
|
24347
24371
|
}
|
|
24348
24372
|
if (select) {
|
|
24349
24373
|
let trigger = "pointerdown";
|
|
24350
|
-
isObject$
|
|
24374
|
+
isObject$8(select) && select.trigger && (trigger = select.trigger), this._itemsContainer.addEventListener(trigger, this._onClick);
|
|
24351
24375
|
}
|
|
24352
24376
|
}
|
|
24353
24377
|
_autoEllipsis(autoEllipsisStrategy, layoutWidth, labelShape, valueShape) {
|
|
@@ -24409,8 +24433,8 @@
|
|
|
24409
24433
|
shapeSize = 0,
|
|
24410
24434
|
shapeSpace = 0;
|
|
24411
24435
|
if (shapeAttr && !1 !== shapeAttr.visible) {
|
|
24412
|
-
const s = get$
|
|
24413
|
-
shapeSize = isArray$
|
|
24436
|
+
const s = get$7(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
|
|
24437
|
+
shapeSize = isArray$7(s) ? s[0] || 0 : s, shapeSpace = get$7(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
|
|
24414
24438
|
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
24415
24439
|
x: 0,
|
|
24416
24440
|
y: 0,
|
|
@@ -24419,12 +24443,12 @@
|
|
|
24419
24443
|
}, shape), shapeStyle.style));
|
|
24420
24444
|
Object.keys(shapeStyle.state || {}).forEach(key => {
|
|
24421
24445
|
const color = shapeStyle.state[key].fill || shapeStyle.state[key].stroke;
|
|
24422
|
-
shape.fill && isNil$
|
|
24446
|
+
shape.fill && isNil$3(shapeStyle.state[key].fill) && color && (shapeStyle.state[key].fill = color), shape.stroke && isNil$3(shapeStyle.state[key].stroke) && color && (shapeStyle.state[key].stroke = color);
|
|
24423
24447
|
}), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
24424
24448
|
}
|
|
24425
24449
|
let focusSpace = 0;
|
|
24426
24450
|
if (focus) {
|
|
24427
|
-
const focusSize = get$
|
|
24451
|
+
const focusSize = get$7(focusIconStyle, "size", DEFAULT_SHAPE_SIZE);
|
|
24428
24452
|
focusShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
24429
24453
|
x: 0,
|
|
24430
24454
|
y: -focusSize / 2 - 1,
|
|
@@ -24448,9 +24472,9 @@
|
|
|
24448
24472
|
}),
|
|
24449
24473
|
labelShape = createTextGraphicByType(labelAttributes);
|
|
24450
24474
|
this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
|
|
24451
|
-
const labelSpace = get$
|
|
24452
|
-
if (isValid$
|
|
24453
|
-
const valueSpace = get$
|
|
24475
|
+
const labelSpace = get$7(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
24476
|
+
if (isValid$3(value)) {
|
|
24477
|
+
const valueSpace = get$7(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
24454
24478
|
valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value,
|
|
24455
24479
|
valueAttributes = Object.assign(Object.assign({
|
|
24456
24480
|
x: 0,
|
|
@@ -24486,7 +24510,7 @@
|
|
|
24486
24510
|
});
|
|
24487
24511
|
}
|
|
24488
24512
|
const innerGroupHeight = innerGroupBounds.height(),
|
|
24489
|
-
itemGroupWidth = isValid$
|
|
24513
|
+
itemGroupWidth = isValid$3(this.attribute.item.width) ? this.attribute.item.width : innerGroupWidth + parsedPadding[1] + parsedPadding[3],
|
|
24490
24514
|
itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
|
|
24491
24515
|
return itemGroup.attribute.width = itemGroupWidth, itemGroup.attribute.height = itemGroupHeight, focusShape && focusShape.setAttribute("visible", !1), innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
|
|
24492
24516
|
}
|
|
@@ -24500,7 +24524,7 @@
|
|
|
24500
24524
|
return this._itemContext.isHorizontal ? new Pager(Object.assign(Object.assign({
|
|
24501
24525
|
layout: 1 === maxRow ? "horizontal" : "vertical",
|
|
24502
24526
|
total: estimateTotal(this._itemContext.pages)
|
|
24503
|
-
}, merge$
|
|
24527
|
+
}, merge$1({
|
|
24504
24528
|
handler: {
|
|
24505
24529
|
preShape: "triangleUp",
|
|
24506
24530
|
nextShape: "triangleDown"
|
|
@@ -24643,7 +24667,7 @@
|
|
|
24643
24667
|
} else this._pagerComponent.addEventListener("toPrev", onPaging), this._pagerComponent.addEventListener("toNext", onPaging);
|
|
24644
24668
|
}
|
|
24645
24669
|
_renderPager() {
|
|
24646
|
-
const renderStartY = this._title ? this._title.AABBBounds.height() + get$
|
|
24670
|
+
const renderStartY = this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", 8) : 0,
|
|
24647
24671
|
{
|
|
24648
24672
|
maxWidth: maxWidth,
|
|
24649
24673
|
maxCol = 1,
|
|
@@ -24714,7 +24738,7 @@
|
|
|
24714
24738
|
}
|
|
24715
24739
|
_renderScrollbar() {
|
|
24716
24740
|
var _a;
|
|
24717
|
-
const renderStartY = this._title ? this._title.AABBBounds.height() + get$
|
|
24741
|
+
const renderStartY = this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", 8) : 0,
|
|
24718
24742
|
{
|
|
24719
24743
|
maxWidth: maxWidth,
|
|
24720
24744
|
item = {},
|
|
@@ -24874,7 +24898,7 @@
|
|
|
24874
24898
|
}
|
|
24875
24899
|
_appendDataToShape(shape, name, data, delegateShape) {
|
|
24876
24900
|
let states = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
24877
|
-
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$
|
|
24901
|
+
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$1({}, DEFAULT_STATES, states);
|
|
24878
24902
|
}
|
|
24879
24903
|
_dispatchLegendEvent(eventName, legendItem, event) {
|
|
24880
24904
|
const currentSelectedItems = this._getSelectedLegends();
|
|
@@ -24891,8 +24915,8 @@
|
|
|
24891
24915
|
}
|
|
24892
24916
|
_handleStyle(config, item, isSelected, index, items) {
|
|
24893
24917
|
const newConfig = {};
|
|
24894
|
-
return config.style && (isFunction$
|
|
24895
|
-
config.state[key] && (isFunction$
|
|
24918
|
+
return config.style && (isFunction$5(config.style) ? newConfig.style = config.style(item, isSelected, index, items) : newConfig.style = config.style), config.state && (newConfig.state = {}, Object.keys(config.state).forEach(key => {
|
|
24919
|
+
config.state[key] && (isFunction$5(config.state[key]) ? newConfig.state[key] = config.state[key](item, isSelected, index, items) : newConfig.state[key] = config.state[key]);
|
|
24896
24920
|
})), newConfig;
|
|
24897
24921
|
}
|
|
24898
24922
|
release() {
|
|
@@ -24995,7 +25019,7 @@
|
|
|
24995
25019
|
}(SLIDER_ELEMENT_NAME || (SLIDER_ELEMENT_NAME = {}));
|
|
24996
25020
|
|
|
24997
25021
|
function convertValueToRange(value) {
|
|
24998
|
-
return isArray$
|
|
25022
|
+
return isArray$7(value) ? value : [value, value];
|
|
24999
25023
|
}
|
|
25000
25024
|
function getDefaultCursor(isHorizontal) {
|
|
25001
25025
|
return isHorizontal ? "ew-resize" : "ns-resize";
|
|
@@ -25018,7 +25042,7 @@
|
|
|
25018
25042
|
return this._tooltipShape;
|
|
25019
25043
|
}
|
|
25020
25044
|
constructor(attributes, options) {
|
|
25021
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
25045
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Slider.defaultAttributes, attributes)), this.name = "slider", this._isHorizontal = !0, this._startHandler = null, this._endHandler = null, this._startHandlerText = null, this._endHandlerText = null, this._currentHandler = null, this._currentValue = {}, this._onTooltipShow = e => {
|
|
25022
25046
|
this._isChanging || this._tooltipState && this._tooltipState.isActive || (this._tooltipState ? this._tooltipState.isActive = !0 : this._tooltipState = {
|
|
25023
25047
|
isActive: !0
|
|
25024
25048
|
}, this._onTooltipUpdate(e), this._dispatchTooltipEvent("sliderTooltipShow"));
|
|
@@ -25143,7 +25167,7 @@
|
|
|
25143
25167
|
let currentPos, startHandlerPos, endHandlerPos;
|
|
25144
25168
|
this._isHorizontal ? (currentPos = e.viewX - this._rail.globalAABBBounds.x1, startHandlerPos = null == startHandler ? void 0 : startHandler.attribute.x, endHandlerPos = null == endHandler ? void 0 : endHandler.attribute.x, railWidth) : (currentPos = e.viewY - this._rail.globalAABBBounds.y1, startHandlerPos = null == startHandler ? void 0 : startHandler.attribute.y, endHandlerPos = null == endHandler ? void 0 : endHandler.attribute.y, railHeight);
|
|
25145
25169
|
const currentValue = this.calculateValueByPos(currentPos);
|
|
25146
|
-
if (isValid$
|
|
25170
|
+
if (isValid$3(endHandlerPos)) {
|
|
25147
25171
|
const updateHandler = Math.abs(currentPos - startHandlerPos) > Math.abs(currentPos - endHandlerPos) ? endHandler : startHandler;
|
|
25148
25172
|
this._updateHandler(updateHandler, currentPos, currentValue);
|
|
25149
25173
|
} else this._updateHandler(startHandler, currentPos, currentValue);
|
|
@@ -25205,7 +25229,7 @@
|
|
|
25205
25229
|
let {
|
|
25206
25230
|
value: value
|
|
25207
25231
|
} = this.attribute;
|
|
25208
|
-
isNil$
|
|
25232
|
+
isNil$3(value) && (value = [min, max]), this._currentValue = {
|
|
25209
25233
|
startValue: convertValueToRange(value)[0],
|
|
25210
25234
|
endValue: convertValueToRange(value)[1]
|
|
25211
25235
|
};
|
|
@@ -25227,7 +25251,7 @@
|
|
|
25227
25251
|
text: startText.text,
|
|
25228
25252
|
lineHeight: null === (_a = startText.style) || void 0 === _a ? void 0 : _a.fontSize
|
|
25229
25253
|
}, startText.style)), startTextShape.name = SLIDER_ELEMENT_NAME.startText, innerView.add(startTextShape);
|
|
25230
|
-
const space = isValid$
|
|
25254
|
+
const space = isValid$3(startText.space) ? startText.space : 0;
|
|
25231
25255
|
startLen += (isHorizontal ? startTextShape.AABBBounds.width() : startTextShape.AABBBounds.height()) + space;
|
|
25232
25256
|
}
|
|
25233
25257
|
const mainContainer = graphicCreator.group({
|
|
@@ -25241,7 +25265,7 @@
|
|
|
25241
25265
|
});
|
|
25242
25266
|
let endTextShape;
|
|
25243
25267
|
if (railContainer.name = SLIDER_ELEMENT_NAME.railContainer, this._railContainer = railContainer, mainContainer.add(railContainer), this._mainContainer = mainContainer, this._renderRail(railContainer), startLen += isHorizontal ? railWidth : railHeight, endText && endText.visible) {
|
|
25244
|
-
const space = isValid$
|
|
25268
|
+
const space = isValid$3(endText.space) ? endText.space : 0;
|
|
25245
25269
|
endTextShape = graphicCreator.text(Object.assign({
|
|
25246
25270
|
x: isHorizontal ? startLen + space : railWidth / 2,
|
|
25247
25271
|
y: isHorizontal ? railHeight / 2 : startLen + space,
|
|
@@ -25286,7 +25310,7 @@
|
|
|
25286
25310
|
let {
|
|
25287
25311
|
value: value
|
|
25288
25312
|
} = this.attribute;
|
|
25289
|
-
isNil$
|
|
25313
|
+
isNil$3(value) && (value = [min, max]);
|
|
25290
25314
|
const handlerTextVisible = handlerText && handlerText.visible,
|
|
25291
25315
|
isHorizontal = this._isHorizontal,
|
|
25292
25316
|
[startValue, endValue] = convertValueToRange(value),
|
|
@@ -25330,7 +25354,7 @@
|
|
|
25330
25354
|
value: value
|
|
25331
25355
|
} = this.attribute;
|
|
25332
25356
|
let startValue, endValue;
|
|
25333
|
-
if (isNil$
|
|
25357
|
+
if (isNil$3(value)) range ? (startValue = min, endValue = max) : startValue = endValue = min;else if (range) {
|
|
25334
25358
|
const clampValue = clampRange$1(value, min, max);
|
|
25335
25359
|
startValue = clampValue[0], endValue = clampValue[1];
|
|
25336
25360
|
} else startValue = min, endValue = clamp$3(value, min, max);
|
|
@@ -25346,7 +25370,7 @@
|
|
|
25346
25370
|
pickable: !1
|
|
25347
25371
|
});
|
|
25348
25372
|
trackContainer.name = SLIDER_ELEMENT_NAME.trackContainer;
|
|
25349
|
-
const draggableTrack = isObject$
|
|
25373
|
+
const draggableTrack = isObject$8(range) && !0 === range.draggableTrack;
|
|
25350
25374
|
let cursor;
|
|
25351
25375
|
cursor = !1 === slidable ? "default" : !1 === range || !1 === draggableTrack ? "pointer" : getDefaultCursor(isHorizontal);
|
|
25352
25376
|
const startPos = this.calculatePosByValue(startValue, "start"),
|
|
@@ -25451,7 +25475,7 @@
|
|
|
25451
25475
|
slidable: slidable,
|
|
25452
25476
|
range: range
|
|
25453
25477
|
} = this.attribute;
|
|
25454
|
-
slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$
|
|
25478
|
+
slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$8(range) && range.draggableTrack && this._track.addEventListener("pointerdown", this._onTrackPointerdown), this._railContainer.addEventListener("pointerdown", this._onRailPointerDown));
|
|
25455
25479
|
}
|
|
25456
25480
|
_bindTooltipEvents() {
|
|
25457
25481
|
this.attribute.disableTriggerEvent || (this._mainContainer.addEventListener("pointerenter", this._onTooltipShow), this._mainContainer.addEventListener("pointermove", this._onTooltipUpdate), this._mainContainer.addEventListener("pointerleave", this._onTooltipHide));
|
|
@@ -25619,9 +25643,9 @@
|
|
|
25619
25643
|
loadColorContinuousLegendComponent();
|
|
25620
25644
|
class ColorContinuousLegend extends LegendBase {
|
|
25621
25645
|
constructor(attributes, options) {
|
|
25622
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
25646
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ColorContinuousLegend.defaultAttributes, attributes)), this.name = "colorLegend", this._onSliderToolipChange = e => {
|
|
25623
25647
|
const tooltipShape = this._slider.tooltipShape;
|
|
25624
|
-
if (tooltipShape && e.detail && !isNil$
|
|
25648
|
+
if (tooltipShape && e.detail && !isNil$3(e.detail.value)) {
|
|
25625
25649
|
const color = this._colorScale.scale(e.detail.value);
|
|
25626
25650
|
tooltipShape.setAttribute("fill", color);
|
|
25627
25651
|
}
|
|
@@ -25690,7 +25714,7 @@
|
|
|
25690
25714
|
disableTriggerEvent: disableTriggerEvent,
|
|
25691
25715
|
inverse: inverse
|
|
25692
25716
|
});
|
|
25693
|
-
this._innerView.add(slider), this._slider = slider, slider.translateTo(0 - slider.AABBBounds.x1, (this._title ? this._title.AABBBounds.height() + get$
|
|
25717
|
+
this._innerView.add(slider), this._slider = slider, slider.translateTo(0 - slider.AABBBounds.x1, (this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", DEFAULT_TITLE_SPACE) : 0) - slider.AABBBounds.y1), this._updateColor();
|
|
25694
25718
|
}
|
|
25695
25719
|
_bindEvents() {
|
|
25696
25720
|
this.attribute.disableTriggerEvent || this._slider && (this._slider.addEventListener("change", this._onSliderChange), this._slider.addEventListener("sliderTooltip", this._onSliderToolipChange));
|
|
@@ -25701,7 +25725,7 @@
|
|
|
25701
25725
|
layout: layout,
|
|
25702
25726
|
inverse: inverse
|
|
25703
25727
|
} = this.attribute;
|
|
25704
|
-
if (isEmpty
|
|
25728
|
+
if (isEmpty(colors)) return;
|
|
25705
25729
|
const count = colors.length;
|
|
25706
25730
|
if (1 === count) return colors[0];
|
|
25707
25731
|
const stops = [];
|
|
@@ -25822,7 +25846,7 @@
|
|
|
25822
25846
|
loadSizeContinuousLegendComponent();
|
|
25823
25847
|
class SizeContinuousLegend extends LegendBase {
|
|
25824
25848
|
constructor(attributes, options) {
|
|
25825
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
25849
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, SizeContinuousLegend.defaultAttributes, attributes)), this.name = "sizeLegend", this._onSliderChange = e => {
|
|
25826
25850
|
this.dispatchEvent(e);
|
|
25827
25851
|
}, this._onSliderToolipChange = e => {
|
|
25828
25852
|
this.dispatchEvent(e);
|
|
@@ -25902,7 +25926,7 @@
|
|
|
25902
25926
|
zIndex: 0
|
|
25903
25927
|
}));
|
|
25904
25928
|
mainContainer.add(background);
|
|
25905
|
-
const titleSpace = this._title ? this._title.AABBBounds.height() + get$
|
|
25929
|
+
const titleSpace = this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", DEFAULT_TITLE_SPACE) : 0;
|
|
25906
25930
|
mainContainer.translate(0 - mainContainer.AABBBounds.x1, titleSpace - mainContainer.AABBBounds.y1), this._slider = slider;
|
|
25907
25931
|
}
|
|
25908
25932
|
_bindEvents() {
|
|
@@ -25938,7 +25962,7 @@
|
|
|
25938
25962
|
loadTitleComponent();
|
|
25939
25963
|
let Title$1 = class Title extends AbstractComponent {
|
|
25940
25964
|
constructor(attributes, options) {
|
|
25941
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
25965
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Title.defaultAttributes, attributes)), this.name = "title";
|
|
25942
25966
|
}
|
|
25943
25967
|
render() {
|
|
25944
25968
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
@@ -25978,7 +26002,7 @@
|
|
|
25978
26002
|
maxWidth: maxWidth,
|
|
25979
26003
|
lineClamp: lineClamp
|
|
25980
26004
|
} = textStyle;
|
|
25981
|
-
if ("rich" === textType || isValid$
|
|
26005
|
+
if ("rich" === textType || isValid$3(textStyle.character)) {
|
|
25982
26006
|
const attr = Object.assign({
|
|
25983
26007
|
x: x,
|
|
25984
26008
|
y: y,
|
|
@@ -26007,8 +26031,8 @@
|
|
|
26007
26031
|
textConfig: []
|
|
26008
26032
|
}, textStyle);
|
|
26009
26033
|
this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
|
|
26010
|
-
} else isValid$
|
|
26011
|
-
text: isArray$
|
|
26034
|
+
} else isValid$3(text) && (this._mainTitle = group.createOrUpdateChild("mainTitle", Object.assign(Object.assign({
|
|
26035
|
+
text: isArray$7(text) ? text : [text],
|
|
26012
26036
|
whiteSpace: "normal"
|
|
26013
26037
|
}, textStyle), {
|
|
26014
26038
|
maxLineWidth: null !== (_f = null !== (_e = textStyle.maxLineWidth) && void 0 !== _e ? _e : mainTitleWidth) && void 0 !== _f ? _f : width,
|
|
@@ -26034,7 +26058,7 @@
|
|
|
26034
26058
|
lineClamp: lineClamp
|
|
26035
26059
|
} = subtextStyle,
|
|
26036
26060
|
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
|
|
26037
|
-
if ("rich" === subtextType || isValid$
|
|
26061
|
+
if ("rich" === subtextType || isValid$3(subtextStyle.character)) {
|
|
26038
26062
|
const attr = Object.assign({
|
|
26039
26063
|
x: x,
|
|
26040
26064
|
y: y,
|
|
@@ -26063,8 +26087,8 @@
|
|
|
26063
26087
|
textConfig: []
|
|
26064
26088
|
}, subtextStyle);
|
|
26065
26089
|
this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
|
|
26066
|
-
} else isValid$
|
|
26067
|
-
text: isArray$
|
|
26090
|
+
} else isValid$3(subtext) && (this._subTitle = group.createOrUpdateChild("subTitle", Object.assign(Object.assign({
|
|
26091
|
+
text: isArray$7(subtext) ? subtext : [subtext],
|
|
26068
26092
|
whiteSpace: "normal"
|
|
26069
26093
|
}, subtextStyle), {
|
|
26070
26094
|
maxLineWidth: null !== (_o = subtextStyle.maxLineWidth) && void 0 !== _o ? _o : width,
|
|
@@ -26079,28 +26103,28 @@
|
|
|
26079
26103
|
subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
26080
26104
|
let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth),
|
|
26081
26105
|
totalHeight = mainTextBoundsHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subTextBoundsHeight);
|
|
26082
|
-
if (isValid$
|
|
26083
|
-
if (isValid$
|
|
26106
|
+
if (isValid$3(width) && (totalWidth = width), isValid$3(height) && (totalHeight = height), isValid$3(minWidth) && totalWidth < minWidth && (totalWidth = minWidth), isValid$3(maxWidth) && totalWidth > maxWidth && (totalWidth = maxWidth), isValid$3(minHeight) && totalHeight < minHeight && (totalHeight = minHeight), isValid$3(maxHeight) && totalHeight > maxHeight && (totalHeight = maxHeight), group.attribute.width = totalWidth, group.attribute.height = totalHeight, group.attribute.boundsPadding = parsedPadding, this._mainTitle) {
|
|
26107
|
+
if (isValid$3(align) || isValid$3(textStyle.align)) {
|
|
26084
26108
|
const mainTitleAlign = textStyle.align ? textStyle.align : align,
|
|
26085
26109
|
mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : totalWidth;
|
|
26086
26110
|
"center" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth / 2), this._mainTitle.setAttribute("textAlign", "center")) : "right" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth), this._mainTitle.setAttribute("textAlign", "right")) : (this._mainTitle.setAttribute("x", 0), this._mainTitle.setAttribute("textAlign", "left"));
|
|
26087
26111
|
}
|
|
26088
|
-
if (isValid$
|
|
26112
|
+
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
26089
26113
|
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
26090
|
-
"middle" === mainTitleVerticalAlign && isValid$
|
|
26114
|
+
"middle" === mainTitleVerticalAlign && isValid$3(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight / 2), this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && isValid$3(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight), this._mainTitle.setAttribute("textBaseline", "bottom")) : (this._mainTitle.setAttribute("y", 0), this._mainTitle.setAttribute("textBaseline", "top"));
|
|
26091
26115
|
}
|
|
26092
26116
|
}
|
|
26093
26117
|
if (this._subTitle) {
|
|
26094
|
-
if (isValid$
|
|
26118
|
+
if (isValid$3(align) || isValid$3(subtextStyle.align)) {
|
|
26095
26119
|
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align,
|
|
26096
26120
|
subTitleWidth = null !== (_t = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s : textStyle.width) && void 0 !== _t ? _t : totalWidth;
|
|
26097
26121
|
"center" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth / 2), this._subTitle.setAttribute("textAlign", "center")) : "right" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth), this._subTitle.setAttribute("textAlign", "right")) : (this._subTitle.setAttribute("x", 0), this._subTitle.setAttribute("textAlign", "left"));
|
|
26098
26122
|
}
|
|
26099
|
-
if (isValid$
|
|
26123
|
+
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
26100
26124
|
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign,
|
|
26101
|
-
subTitleYStart = this._mainTitle ? isValid$
|
|
26125
|
+
subTitleYStart = this._mainTitle ? isValid$3(fixedMainTitleHeight) ? this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight) : this._mainTitle.AABBBounds.y2 : 0,
|
|
26102
26126
|
subTitleHeight = null !== (_u = subtextStyle.height) && void 0 !== _u ? _u : height;
|
|
26103
|
-
"middle" === subTitleVerticalAlign && isValid$
|
|
26127
|
+
"middle" === subTitleVerticalAlign && isValid$3(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight / 2), this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && isValid$3(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight), this._subTitle.setAttribute("textBaseline", "bottom")) : (this._subTitle.setAttribute("y", subTitleYStart), this._subTitle.setAttribute("textBaseline", "top"));
|
|
26104
26128
|
}
|
|
26105
26129
|
}
|
|
26106
26130
|
}
|
|
@@ -26133,7 +26157,7 @@
|
|
|
26133
26157
|
loadCheckBoxComponent();
|
|
26134
26158
|
class CheckBox extends AbstractComponent {
|
|
26135
26159
|
constructor(attributes, options) {
|
|
26136
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26160
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, CheckBox.defaultAttributes, attributes)), this._handlePointerUp = () => {
|
|
26137
26161
|
this.attribute.disabled || (this.attribute.checked ? (this.setAttribute("checked", !1), this.setAttribute("indeterminate", !1)) : (this.setAttribute("checked", !0), this.setAttribute("indeterminate", !1)), this._dispatchEvent("checkbox_state_change", {
|
|
26138
26162
|
eventType: "checkbox_state_change",
|
|
26139
26163
|
checked: this.attribute.checked
|
|
@@ -26146,7 +26170,7 @@
|
|
|
26146
26170
|
this.removeAllChild(!0), this.renderBox(), this.renderIcon(), this.renderText(), this.layout();
|
|
26147
26171
|
}
|
|
26148
26172
|
renderBox() {
|
|
26149
|
-
this._box = new Rect$2(merge$
|
|
26173
|
+
this._box = new Rect$2(merge$1({}, this.attribute.box));
|
|
26150
26174
|
const isCheckedOrIndeterminate = this.attribute.checked || this.attribute.indeterminate;
|
|
26151
26175
|
isCheckedOrIndeterminate && this.attribute.disabled ? this._box.setAttributes({
|
|
26152
26176
|
fill: this.attribute.box.disableCheckedFill,
|
|
@@ -26159,14 +26183,14 @@
|
|
|
26159
26183
|
}), this.appendChild(this._box);
|
|
26160
26184
|
}
|
|
26161
26185
|
renderIcon() {
|
|
26162
|
-
this._checkIcon = new Image$2(merge$
|
|
26186
|
+
this._checkIcon = new Image$2(merge$1({
|
|
26163
26187
|
image: this.attribute.icon.checkIconImage
|
|
26164
|
-
}, this.attribute.icon)), this.appendChild(this._checkIcon), this._indeterminateIcon = new Image$2(merge$
|
|
26188
|
+
}, this.attribute.icon)), this.appendChild(this._checkIcon), this._indeterminateIcon = new Image$2(merge$1({
|
|
26165
26189
|
image: this.attribute.icon.indeterminateIconImage
|
|
26166
26190
|
}, this.attribute.icon)), this.appendChild(this._indeterminateIcon), this.attribute.checked ? (this._checkIcon.setAttribute("visible", !0), this._indeterminateIcon.setAttribute("visible", !1)) : this.attribute.indeterminate ? (this._checkIcon.setAttribute("visible", !1), this._indeterminateIcon.setAttribute("visible", !0)) : (this._checkIcon.setAttribute("visible", !1), this._indeterminateIcon.setAttribute("visible", !1));
|
|
26167
26191
|
}
|
|
26168
26192
|
renderText() {
|
|
26169
|
-
this._text = new Text$1(merge$
|
|
26193
|
+
this._text = new Text$1(merge$1({
|
|
26170
26194
|
wrap: !0
|
|
26171
26195
|
}, this.attribute.text)), this.attribute.disabled && this._text.setAttribute("fill", this.attribute.text.disableFill), this.appendChild(this._text);
|
|
26172
26196
|
}
|
|
@@ -26202,7 +26226,7 @@
|
|
|
26202
26226
|
});
|
|
26203
26227
|
}
|
|
26204
26228
|
initAttributes(params, options) {
|
|
26205
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
26229
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, CheckBox.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
|
|
26206
26230
|
}
|
|
26207
26231
|
}
|
|
26208
26232
|
CheckBox.defaultAttributes = {
|
|
@@ -26250,7 +26274,7 @@
|
|
|
26250
26274
|
loadRadioComponent();
|
|
26251
26275
|
class Radio extends AbstractComponent {
|
|
26252
26276
|
constructor(attributes, options) {
|
|
26253
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26277
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Radio.defaultAttributes, attributes)), this._handlePointerUp = () => {
|
|
26254
26278
|
this.attribute.disabled || this.attribute.checked || (this.setAttribute("checked", !0), this._dispatchEvent("radio_checked", {
|
|
26255
26279
|
eventType: "radio_checked",
|
|
26256
26280
|
target: this
|
|
@@ -26263,7 +26287,7 @@
|
|
|
26263
26287
|
this.removeAllChild(!0), this.renderCircle(), this.renderText(), this.layout();
|
|
26264
26288
|
}
|
|
26265
26289
|
renderCircle() {
|
|
26266
|
-
this._circle = new Arc$1(merge$
|
|
26290
|
+
this._circle = new Arc$1(merge$1({}, this.attribute.circle));
|
|
26267
26291
|
const isChecked = this.attribute.checked;
|
|
26268
26292
|
isChecked && this.attribute.disabled ? this._circle.setAttributes({
|
|
26269
26293
|
fill: this.attribute.circle.disableCheckedFill,
|
|
@@ -26276,7 +26300,7 @@
|
|
|
26276
26300
|
}), this.appendChild(this._circle);
|
|
26277
26301
|
}
|
|
26278
26302
|
renderText() {
|
|
26279
|
-
this._text = new Text$1(merge$
|
|
26303
|
+
this._text = new Text$1(merge$1({}, this.attribute.text)), this.attribute.disabled && this._text.setAttribute("fill", this.attribute.text.disableFill), this.appendChild(this._text);
|
|
26280
26304
|
}
|
|
26281
26305
|
renderGroup() {
|
|
26282
26306
|
this.attribute.interactive || this.setAttribute("pickable", !1), this.attribute.disabled && this.setAttribute("cursor", this.attribute.disableCursor);
|
|
@@ -26299,7 +26323,7 @@
|
|
|
26299
26323
|
});
|
|
26300
26324
|
}
|
|
26301
26325
|
initAttributes(params, options) {
|
|
26302
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
26326
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Radio.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
|
|
26303
26327
|
}
|
|
26304
26328
|
}
|
|
26305
26329
|
Radio.defaultAttributes = {
|
|
@@ -26342,18 +26366,18 @@
|
|
|
26342
26366
|
loadEmptyTipComponent();
|
|
26343
26367
|
let EmptyTip$1 = class EmptyTip extends AbstractComponent {
|
|
26344
26368
|
constructor(attributes, options) {
|
|
26345
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26369
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, EmptyTip.defaultAttributes, attributes));
|
|
26346
26370
|
}
|
|
26347
26371
|
render() {
|
|
26348
26372
|
this.removeAllChild(!0), this.renderIcon(), this.renderText(), this.layout();
|
|
26349
26373
|
}
|
|
26350
26374
|
renderIcon() {
|
|
26351
|
-
this._emptyTipIcon = new Image$2(merge$
|
|
26375
|
+
this._emptyTipIcon = new Image$2(merge$1({
|
|
26352
26376
|
image: this.attribute.icon.image
|
|
26353
26377
|
}, this.attribute.icon)), this.appendChild(this._emptyTipIcon);
|
|
26354
26378
|
}
|
|
26355
26379
|
renderText() {
|
|
26356
|
-
this._text = new Text$1(merge$
|
|
26380
|
+
this._text = new Text$1(merge$1({
|
|
26357
26381
|
wrap: !0
|
|
26358
26382
|
}, this.attribute.text)), this.appendChild(this._text);
|
|
26359
26383
|
}
|
|
@@ -26393,7 +26417,7 @@
|
|
|
26393
26417
|
loadSwitchComponent();
|
|
26394
26418
|
class Switch extends AbstractComponent {
|
|
26395
26419
|
constructor(attributes, options) {
|
|
26396
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26420
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Switch.defaultAttributes, attributes)), this._handlePointerUp = () => {
|
|
26397
26421
|
this.attribute.disabled || (this.attribute.checked ? this.setAttribute("checked", !1) : this.setAttribute("checked", !0), this._dispatchEvent("switch_state_change", {
|
|
26398
26422
|
eventType: "switch_state_change",
|
|
26399
26423
|
checked: this.attribute.checked
|
|
@@ -26406,7 +26430,7 @@
|
|
|
26406
26430
|
this.removeAllChild(!0), this.renderBox(), this.renderCircle(), this.renderText(), this.layout();
|
|
26407
26431
|
}
|
|
26408
26432
|
renderBox() {
|
|
26409
|
-
this._box = new Rect$2(merge$
|
|
26433
|
+
this._box = new Rect$2(merge$1({}, this.attribute.box)), this.attribute.disabled && this.attribute.checked ? this._box.setAttributes({
|
|
26410
26434
|
fill: this.attribute.box.disableCheckedFill
|
|
26411
26435
|
}) : this.attribute.disabled && !this.attribute.checked ? this._box.setAttributes({
|
|
26412
26436
|
fill: this.attribute.box.disableUncheckedFill
|
|
@@ -26417,11 +26441,11 @@
|
|
|
26417
26441
|
}), this.appendChild(this._box);
|
|
26418
26442
|
}
|
|
26419
26443
|
renderCircle() {
|
|
26420
|
-
this._circle = new Circle$1(merge$
|
|
26444
|
+
this._circle = new Circle$1(merge$1({}, this.attribute.circle)), this.appendChild(this._circle);
|
|
26421
26445
|
}
|
|
26422
26446
|
renderText() {
|
|
26423
26447
|
var _a, _b, _c;
|
|
26424
|
-
this._text = new Text$1(merge$
|
|
26448
|
+
this._text = new Text$1(merge$1({}, null !== (_a = this.attribute.text) && void 0 !== _a ? _a : {})), this.attribute.checked && (null === (_b = this.attribute.text) || void 0 === _b ? void 0 : _b.checkedText) ? this._text.setAttributes({
|
|
26425
26449
|
text: this.attribute.text.checkedText
|
|
26426
26450
|
}) : (null === (_c = this.attribute.text) || void 0 === _c ? void 0 : _c.uncheckedText) && this._text.setAttributes({
|
|
26427
26451
|
text: this.attribute.text.uncheckedText
|
|
@@ -26458,7 +26482,7 @@
|
|
|
26458
26482
|
});
|
|
26459
26483
|
}
|
|
26460
26484
|
initAttributes(params, options) {
|
|
26461
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
26485
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Switch.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
|
|
26462
26486
|
}
|
|
26463
26487
|
}
|
|
26464
26488
|
Switch.defaultAttributes = {
|
|
@@ -28141,616 +28165,6 @@
|
|
|
28141
28165
|
return mode;
|
|
28142
28166
|
}
|
|
28143
28167
|
|
|
28144
|
-
const isType$2 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
28145
|
-
var isType$3 = isType$2;
|
|
28146
|
-
|
|
28147
|
-
const isBoolean$3 = function (value) {
|
|
28148
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
28149
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$3(value, "Boolean");
|
|
28150
|
-
};
|
|
28151
|
-
var isBoolean$4 = isBoolean$3;
|
|
28152
|
-
|
|
28153
|
-
const isFunction$4 = value => "function" == typeof value;
|
|
28154
|
-
var isFunction$5 = isFunction$4;
|
|
28155
|
-
|
|
28156
|
-
const isNil$2 = value => null == value;
|
|
28157
|
-
var isNil$3 = isNil$2;
|
|
28158
|
-
|
|
28159
|
-
const isValid$2 = value => null != value;
|
|
28160
|
-
var isValid$3 = isValid$2;
|
|
28161
|
-
|
|
28162
|
-
const isObject$7 = value => {
|
|
28163
|
-
const type = typeof value;
|
|
28164
|
-
return null !== value && "object" === type || "function" === type;
|
|
28165
|
-
};
|
|
28166
|
-
var isObject$8 = isObject$7;
|
|
28167
|
-
|
|
28168
|
-
const isObjectLike$4 = value => "object" == typeof value && null !== value;
|
|
28169
|
-
var isObjectLike$5 = isObjectLike$4;
|
|
28170
|
-
|
|
28171
|
-
const isPlainObject$2 = function (value) {
|
|
28172
|
-
if (!isObjectLike$5(value) || !isType$3(value, "Object")) return !1;
|
|
28173
|
-
if (null === Object.getPrototypeOf(value)) return !0;
|
|
28174
|
-
let proto = value;
|
|
28175
|
-
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
28176
|
-
return Object.getPrototypeOf(value) === proto;
|
|
28177
|
-
};
|
|
28178
|
-
var isPlainObject$3 = isPlainObject$2;
|
|
28179
|
-
|
|
28180
|
-
const isString$3 = function (value) {
|
|
28181
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
28182
|
-
const type = typeof value;
|
|
28183
|
-
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
28184
|
-
};
|
|
28185
|
-
var isString$4 = isString$3;
|
|
28186
|
-
|
|
28187
|
-
const isArray$6 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
28188
|
-
var isArray$7 = isArray$6;
|
|
28189
|
-
|
|
28190
|
-
const isArrayLike$2 = function (value) {
|
|
28191
|
-
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
28192
|
-
};
|
|
28193
|
-
var isArrayLike$3 = isArrayLike$2;
|
|
28194
|
-
|
|
28195
|
-
const isDate$2 = value => isType$3(value, "Date");
|
|
28196
|
-
var isDate$3 = isDate$2;
|
|
28197
|
-
|
|
28198
|
-
const isNumber$3 = function (value) {
|
|
28199
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
28200
|
-
const type = typeof value;
|
|
28201
|
-
return fuzzy ? "number" === type : "number" === type || isType$3(value, "Number");
|
|
28202
|
-
};
|
|
28203
|
-
var isNumber$4 = isNumber$3;
|
|
28204
|
-
|
|
28205
|
-
const isValidNumber = value => isNumber$4(value) && Number.isFinite(value);
|
|
28206
|
-
var isValidNumber$1 = isValidNumber;
|
|
28207
|
-
|
|
28208
|
-
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
28209
|
-
var getType$1 = getType;
|
|
28210
|
-
|
|
28211
|
-
const objectProto$5 = Object.prototype,
|
|
28212
|
-
isPrototype = function (value) {
|
|
28213
|
-
const Ctor = value && value.constructor;
|
|
28214
|
-
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto$5);
|
|
28215
|
-
};
|
|
28216
|
-
var isPrototype$1 = isPrototype;
|
|
28217
|
-
|
|
28218
|
-
const hasOwnProperty$4 = Object.prototype.hasOwnProperty;
|
|
28219
|
-
function isEmpty(value) {
|
|
28220
|
-
if (isNil$3(value)) return !0;
|
|
28221
|
-
if (isArrayLike$3(value)) return !value.length;
|
|
28222
|
-
const type = getType$1(value);
|
|
28223
|
-
if ("Map" === type || "Set" === type) return !value.size;
|
|
28224
|
-
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
28225
|
-
for (const key in value) if (hasOwnProperty$4.call(value, key)) return !1;
|
|
28226
|
-
return !0;
|
|
28227
|
-
}
|
|
28228
|
-
|
|
28229
|
-
const get$6 = (obj, path, defaultValue) => {
|
|
28230
|
-
const paths = isString$4(path) ? path.split(".") : path;
|
|
28231
|
-
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
28232
|
-
return void 0 === obj ? defaultValue : obj;
|
|
28233
|
-
};
|
|
28234
|
-
var get$7 = get$6;
|
|
28235
|
-
|
|
28236
|
-
function cloneDeep$1(value, ignoreWhen, excludeKeys) {
|
|
28237
|
-
let result;
|
|
28238
|
-
if (!isValid$3(value) || "object" != typeof value || ignoreWhen && ignoreWhen(value)) return value;
|
|
28239
|
-
const isArr = isArray$7(value),
|
|
28240
|
-
length = value.length;
|
|
28241
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$4(value) || isNumber$4(value) || isString$4(value) ? value : isDate$3(value) ? new Date(+value) : void 0;
|
|
28242
|
-
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
28243
|
-
let index = -1;
|
|
28244
|
-
if (result) for (; ++index < (props || value).length;) {
|
|
28245
|
-
const key = props ? props[index] : index,
|
|
28246
|
-
subValue = value[key];
|
|
28247
|
-
excludeKeys && excludeKeys.includes(key.toString()) ? result[key] = subValue : result[key] = cloneDeep$1(subValue, ignoreWhen, excludeKeys);
|
|
28248
|
-
}
|
|
28249
|
-
return result;
|
|
28250
|
-
}
|
|
28251
|
-
|
|
28252
|
-
function baseMerge$1(target, source) {
|
|
28253
|
-
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
28254
|
-
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
28255
|
-
if (source) {
|
|
28256
|
-
if (target === source) return;
|
|
28257
|
-
if (isValid$3(source) && "object" == typeof source) {
|
|
28258
|
-
const iterable = Object(source),
|
|
28259
|
-
props = [];
|
|
28260
|
-
for (const key in iterable) props.push(key);
|
|
28261
|
-
let {
|
|
28262
|
-
length: length
|
|
28263
|
-
} = props,
|
|
28264
|
-
propIndex = -1;
|
|
28265
|
-
for (; length--;) {
|
|
28266
|
-
const key = props[++propIndex];
|
|
28267
|
-
!isValid$3(iterable[key]) || "object" != typeof iterable[key] || skipTargetArray && isArray$7(target[key]) ? assignMergeValue$1(target, key, iterable[key]) : baseMergeDeep$1(target, source, key, shallowArray, skipTargetArray);
|
|
28268
|
-
}
|
|
28269
|
-
}
|
|
28270
|
-
}
|
|
28271
|
-
}
|
|
28272
|
-
function baseMergeDeep$1(target, source, key) {
|
|
28273
|
-
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
28274
|
-
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
28275
|
-
const objValue = target[key],
|
|
28276
|
-
srcValue = source[key];
|
|
28277
|
-
let newValue = source[key],
|
|
28278
|
-
isCommon = !0;
|
|
28279
|
-
if (isArray$7(srcValue)) {
|
|
28280
|
-
if (shallowArray) newValue = [];else if (isArray$7(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
28281
|
-
newValue = new Array(objValue.length);
|
|
28282
|
-
let index = -1;
|
|
28283
|
-
const length = objValue.length;
|
|
28284
|
-
for (; ++index < length;) newValue[index] = objValue[index];
|
|
28285
|
-
}
|
|
28286
|
-
} else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
28287
|
-
isCommon && baseMerge$1(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue$1(target, key, newValue);
|
|
28288
|
-
}
|
|
28289
|
-
function assignMergeValue$1(target, key, value) {
|
|
28290
|
-
(void 0 !== value && !eq$3(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
28291
|
-
}
|
|
28292
|
-
function eq$3(value, other) {
|
|
28293
|
-
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
28294
|
-
}
|
|
28295
|
-
function merge$1(target) {
|
|
28296
|
-
let sourceIndex = -1;
|
|
28297
|
-
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
28298
|
-
for (; ++sourceIndex < length;) {
|
|
28299
|
-
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
28300
|
-
}
|
|
28301
|
-
return target;
|
|
28302
|
-
}
|
|
28303
|
-
|
|
28304
|
-
function pickWithout(obj, keys) {
|
|
28305
|
-
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
28306
|
-
const result = {};
|
|
28307
|
-
return Object.keys(obj).forEach(k => {
|
|
28308
|
-
const v = obj[k];
|
|
28309
|
-
let match = !1;
|
|
28310
|
-
keys.forEach(itKey => {
|
|
28311
|
-
(isString$4(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
28312
|
-
}), match || (result[k] = v);
|
|
28313
|
-
}), result;
|
|
28314
|
-
}
|
|
28315
|
-
|
|
28316
|
-
function objToString(obj) {
|
|
28317
|
-
return Object.prototype.toString.call(obj);
|
|
28318
|
-
}
|
|
28319
|
-
function objectKeys(obj) {
|
|
28320
|
-
return Object.keys(obj);
|
|
28321
|
-
}
|
|
28322
|
-
function isEqual(a, b, options) {
|
|
28323
|
-
if (a === b) return !0;
|
|
28324
|
-
if (typeof a != typeof b) return !1;
|
|
28325
|
-
if (null == a || null == b) return !1;
|
|
28326
|
-
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
28327
|
-
if (objToString(a) !== objToString(b)) return !1;
|
|
28328
|
-
if (isFunction$5(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
28329
|
-
if ("object" != typeof a) return !1;
|
|
28330
|
-
if (isArray$7(a)) {
|
|
28331
|
-
if (a.length !== b.length) return !1;
|
|
28332
|
-
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
28333
|
-
return !0;
|
|
28334
|
-
}
|
|
28335
|
-
if (!isPlainObject$3(a)) return !1;
|
|
28336
|
-
const ka = objectKeys(a),
|
|
28337
|
-
kb = objectKeys(b);
|
|
28338
|
-
if (ka.length !== kb.length) return !1;
|
|
28339
|
-
ka.sort(), kb.sort();
|
|
28340
|
-
for (let i = ka.length - 1; i >= 0; i--) if (ka[i] != kb[i]) return !1;
|
|
28341
|
-
for (let i = ka.length - 1; i >= 0; i--) {
|
|
28342
|
-
const key = ka[i];
|
|
28343
|
-
if (!isEqual(a[key], b[key], options)) return !1;
|
|
28344
|
-
}
|
|
28345
|
-
return !0;
|
|
28346
|
-
}
|
|
28347
|
-
|
|
28348
|
-
function last(val) {
|
|
28349
|
-
if (isArrayLike$3(val)) {
|
|
28350
|
-
return val[val.length - 1];
|
|
28351
|
-
}
|
|
28352
|
-
}
|
|
28353
|
-
const maxInArray = (arr, compareFn) => {
|
|
28354
|
-
var _a;
|
|
28355
|
-
if (0 === arr.length) return;
|
|
28356
|
-
let max = arr[0];
|
|
28357
|
-
for (let i = 1; i < arr.length; i++) {
|
|
28358
|
-
const value = arr[i];
|
|
28359
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max) > 0 && (max = value);
|
|
28360
|
-
}
|
|
28361
|
-
return max;
|
|
28362
|
-
};
|
|
28363
|
-
const minInArray = (arr, compareFn) => {
|
|
28364
|
-
var _a;
|
|
28365
|
-
if (0 === arr.length) return;
|
|
28366
|
-
let min = arr[0];
|
|
28367
|
-
for (let i = 1; i < arr.length; i++) {
|
|
28368
|
-
const value = arr[i];
|
|
28369
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min) < 0 && (min = value);
|
|
28370
|
-
}
|
|
28371
|
-
return min;
|
|
28372
|
-
};
|
|
28373
|
-
function arrayEqual(a, b) {
|
|
28374
|
-
if (!isArray$7(a) || !isArray$7(b)) return !1;
|
|
28375
|
-
if (a.length !== b.length) return !1;
|
|
28376
|
-
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
28377
|
-
return !0;
|
|
28378
|
-
}
|
|
28379
|
-
|
|
28380
|
-
function degreeToRadian(degree) {
|
|
28381
|
-
return degree * (Math.PI / 180);
|
|
28382
|
-
}
|
|
28383
|
-
|
|
28384
|
-
const eastAsianCharacterInfo = character => {
|
|
28385
|
-
let x = character.charCodeAt(0),
|
|
28386
|
-
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
28387
|
-
codePoint = x;
|
|
28388
|
-
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";
|
|
28389
|
-
};
|
|
28390
|
-
|
|
28391
|
-
function getContextFont(text) {
|
|
28392
|
-
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28393
|
-
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
28394
|
-
fontSizeScale || (fontSizeScale = 1);
|
|
28395
|
-
const {
|
|
28396
|
-
fontStyle = defaultAttr.fontStyle,
|
|
28397
|
-
fontVariant = defaultAttr.fontVariant,
|
|
28398
|
-
fontWeight = defaultAttr.fontWeight,
|
|
28399
|
-
fontSize = defaultAttr.fontSize,
|
|
28400
|
-
fontFamily = defaultAttr.fontFamily
|
|
28401
|
-
} = text;
|
|
28402
|
-
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
28403
|
-
}
|
|
28404
|
-
|
|
28405
|
-
class TextMeasure {
|
|
28406
|
-
constructor(option, textSpec) {
|
|
28407
|
-
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);
|
|
28408
|
-
}
|
|
28409
|
-
initContext() {
|
|
28410
|
-
if (this._notSupportCanvas) return !1;
|
|
28411
|
-
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)) {
|
|
28412
|
-
const context = this._canvas.getContext("2d");
|
|
28413
|
-
isValid$3(context) && (context.save(), context.font = getContextFont(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
28414
|
-
}
|
|
28415
|
-
return !isNil$3(this._context) || (this._notSupportCanvas = !0, !1);
|
|
28416
|
-
}
|
|
28417
|
-
_initSpec() {
|
|
28418
|
-
var _a, _b, _c;
|
|
28419
|
-
const {
|
|
28420
|
-
defaultFontParams = {}
|
|
28421
|
-
} = this._option,
|
|
28422
|
-
{
|
|
28423
|
-
fontStyle = defaultFontParams.fontStyle,
|
|
28424
|
-
fontVariant = defaultFontParams.fontVariant,
|
|
28425
|
-
fontWeight = null !== (_a = defaultFontParams.fontWeight) && void 0 !== _a ? _a : "normal",
|
|
28426
|
-
fontSize = null !== (_b = defaultFontParams.fontSize) && void 0 !== _b ? _b : 12,
|
|
28427
|
-
fontFamily = null !== (_c = defaultFontParams.fontFamily) && void 0 !== _c ? _c : "sans-serif",
|
|
28428
|
-
align: align,
|
|
28429
|
-
textAlign = null != align ? align : "center",
|
|
28430
|
-
baseline: baseline,
|
|
28431
|
-
textBaseline = null != baseline ? baseline : "middle",
|
|
28432
|
-
ellipsis: ellipsis,
|
|
28433
|
-
limit: limit
|
|
28434
|
-
} = this._userSpec;
|
|
28435
|
-
let {
|
|
28436
|
-
lineHeight = fontSize
|
|
28437
|
-
} = this._userSpec;
|
|
28438
|
-
if (isString$4(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
28439
|
-
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
28440
|
-
lineHeight = fontSize * scale;
|
|
28441
|
-
}
|
|
28442
|
-
return {
|
|
28443
|
-
fontStyle: fontStyle,
|
|
28444
|
-
fontVariant: fontVariant,
|
|
28445
|
-
fontFamily: fontFamily,
|
|
28446
|
-
fontSize: fontSize,
|
|
28447
|
-
fontWeight: fontWeight,
|
|
28448
|
-
textAlign: textAlign,
|
|
28449
|
-
textBaseline: textBaseline,
|
|
28450
|
-
ellipsis: ellipsis,
|
|
28451
|
-
limit: limit,
|
|
28452
|
-
lineHeight: lineHeight
|
|
28453
|
-
};
|
|
28454
|
-
}
|
|
28455
|
-
measure(text, method) {
|
|
28456
|
-
switch (method) {
|
|
28457
|
-
case "vrender":
|
|
28458
|
-
case "canopus":
|
|
28459
|
-
return this.fullMeasure(text);
|
|
28460
|
-
case "canvas":
|
|
28461
|
-
return this.measureWithNaiveCanvas(text);
|
|
28462
|
-
case "simple":
|
|
28463
|
-
return this.quickMeasureWithoutCanvas(text);
|
|
28464
|
-
default:
|
|
28465
|
-
return this.quickMeasure(text);
|
|
28466
|
-
}
|
|
28467
|
-
}
|
|
28468
|
-
fullMeasure(text) {
|
|
28469
|
-
if (isNil$3(text)) return {
|
|
28470
|
-
width: 0,
|
|
28471
|
-
height: 0
|
|
28472
|
-
};
|
|
28473
|
-
if (isNil$3(this._option.getTextBounds) || !this._notSupportVRender) return this.measureWithNaiveCanvas(text);
|
|
28474
|
-
const {
|
|
28475
|
-
fontFamily: fontFamily,
|
|
28476
|
-
fontSize: fontSize,
|
|
28477
|
-
fontWeight: fontWeight,
|
|
28478
|
-
textAlign: textAlign,
|
|
28479
|
-
textBaseline: textBaseline,
|
|
28480
|
-
ellipsis: ellipsis,
|
|
28481
|
-
limit: limit,
|
|
28482
|
-
lineHeight: lineHeight
|
|
28483
|
-
} = this.textSpec;
|
|
28484
|
-
let size;
|
|
28485
|
-
try {
|
|
28486
|
-
const bounds = this._option.getTextBounds({
|
|
28487
|
-
text: text,
|
|
28488
|
-
fontFamily: fontFamily,
|
|
28489
|
-
fontSize: fontSize,
|
|
28490
|
-
fontWeight: fontWeight,
|
|
28491
|
-
textAlign: textAlign,
|
|
28492
|
-
textBaseline: textBaseline,
|
|
28493
|
-
ellipsis: !!ellipsis,
|
|
28494
|
-
maxLineWidth: limit || 1 / 0,
|
|
28495
|
-
lineHeight: lineHeight
|
|
28496
|
-
});
|
|
28497
|
-
size = {
|
|
28498
|
-
width: bounds.width(),
|
|
28499
|
-
height: bounds.height()
|
|
28500
|
-
};
|
|
28501
|
-
} catch (e) {
|
|
28502
|
-
this._notSupportVRender = !0, size = this.measureWithNaiveCanvas(text);
|
|
28503
|
-
}
|
|
28504
|
-
return size;
|
|
28505
|
-
}
|
|
28506
|
-
measureWithNaiveCanvas(text) {
|
|
28507
|
-
return this._measureReduce(text, this._measureWithNaiveCanvas.bind(this));
|
|
28508
|
-
}
|
|
28509
|
-
_measureWithNaiveCanvas(text) {
|
|
28510
|
-
var _a;
|
|
28511
|
-
if (!this.initContext()) return this._quickMeasureWithoutCanvas(text);
|
|
28512
|
-
const metrics = this._context.measureText(text),
|
|
28513
|
-
{
|
|
28514
|
-
fontSize: fontSize,
|
|
28515
|
-
lineHeight: lineHeight
|
|
28516
|
-
} = this.textSpec;
|
|
28517
|
-
return {
|
|
28518
|
-
width: metrics.width,
|
|
28519
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize,
|
|
28520
|
-
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
28521
|
-
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
28522
|
-
};
|
|
28523
|
-
}
|
|
28524
|
-
quickMeasure(text) {
|
|
28525
|
-
return this._measureReduce(text, this._quickMeasure.bind(this));
|
|
28526
|
-
}
|
|
28527
|
-
_quickMeasure(text) {
|
|
28528
|
-
const totalSize = {
|
|
28529
|
-
width: 0,
|
|
28530
|
-
height: 0
|
|
28531
|
-
};
|
|
28532
|
-
for (let i = 0; i < text.length; i++) {
|
|
28533
|
-
const char = text[i];
|
|
28534
|
-
let size = this._measureSpecialChar(char);
|
|
28535
|
-
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), !isNil$3(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent), !isNil$3(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
|
|
28536
|
-
}
|
|
28537
|
-
return totalSize;
|
|
28538
|
-
}
|
|
28539
|
-
quickMeasureWithoutCanvas(text) {
|
|
28540
|
-
return this._measureReduce(text, this._quickMeasureWithoutCanvas.bind(this));
|
|
28541
|
-
}
|
|
28542
|
-
_quickMeasureWithoutCanvas(text) {
|
|
28543
|
-
var _a;
|
|
28544
|
-
const totalSize = {
|
|
28545
|
-
width: 0,
|
|
28546
|
-
height: 0
|
|
28547
|
-
},
|
|
28548
|
-
{
|
|
28549
|
-
fontSize: fontSize,
|
|
28550
|
-
lineHeight: lineHeight
|
|
28551
|
-
} = this.textSpec;
|
|
28552
|
-
for (let i = 0; i < text.length; i++) {
|
|
28553
|
-
const char = text[i],
|
|
28554
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
28555
|
-
totalSize.width += size * fontSize;
|
|
28556
|
-
}
|
|
28557
|
-
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
28558
|
-
}
|
|
28559
|
-
_measureReduce(text, processor) {
|
|
28560
|
-
var _a;
|
|
28561
|
-
const {
|
|
28562
|
-
fontSize: fontSize,
|
|
28563
|
-
lineHeight: lineHeight
|
|
28564
|
-
} = this.textSpec,
|
|
28565
|
-
defaultResult = {
|
|
28566
|
-
width: 0,
|
|
28567
|
-
height: 0
|
|
28568
|
-
};
|
|
28569
|
-
if (isNil$3(text)) return defaultResult;
|
|
28570
|
-
if (isArray$7(text)) {
|
|
28571
|
-
const textArr = text.filter(isValid$3).map(s => s.toString());
|
|
28572
|
-
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
28573
|
-
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
28574
|
-
height: textArr.length * ((null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize) + 1) + 1
|
|
28575
|
-
};
|
|
28576
|
-
}
|
|
28577
|
-
return processor(text.toString());
|
|
28578
|
-
}
|
|
28579
|
-
_measureNumberChar() {
|
|
28580
|
-
if (isNil$3(this._numberCharSize)) {
|
|
28581
|
-
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
28582
|
-
this._numberCharSize = {
|
|
28583
|
-
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
28584
|
-
height: numberBounds.height,
|
|
28585
|
-
fontBoundingBoxAscent: numberBounds.fontBoundingBoxAscent,
|
|
28586
|
-
fontBoundingBoxDescent: numberBounds.fontBoundingBoxDescent
|
|
28587
|
-
};
|
|
28588
|
-
}
|
|
28589
|
-
return this._numberCharSize;
|
|
28590
|
-
}
|
|
28591
|
-
_measureFullSizeChar() {
|
|
28592
|
-
return isNil$3(this._fullCharSize) && (this._fullCharSize = this._standardMethod(TextMeasure.FULL_SIZE_CHAR)), this._fullCharSize;
|
|
28593
|
-
}
|
|
28594
|
-
_measureLetterChar() {
|
|
28595
|
-
if (isNil$3(this._letterCharSize)) {
|
|
28596
|
-
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
28597
|
-
this._letterCharSize = {
|
|
28598
|
-
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
28599
|
-
height: alphabetBounds.height,
|
|
28600
|
-
fontBoundingBoxAscent: alphabetBounds.fontBoundingBoxAscent,
|
|
28601
|
-
fontBoundingBoxDescent: alphabetBounds.fontBoundingBoxDescent
|
|
28602
|
-
};
|
|
28603
|
-
}
|
|
28604
|
-
return this._letterCharSize;
|
|
28605
|
-
}
|
|
28606
|
-
_measureSpecialChar(char) {
|
|
28607
|
-
return isValid$3(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
28608
|
-
}
|
|
28609
|
-
release() {
|
|
28610
|
-
isValid$3(this._canvas) && (this._canvas = null), isValid$3(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
28611
|
-
}
|
|
28612
|
-
}
|
|
28613
|
-
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
28614
|
-
|
|
28615
|
-
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
28616
|
-
const {
|
|
28617
|
-
x1: x1,
|
|
28618
|
-
y1: y1,
|
|
28619
|
-
x2: x2,
|
|
28620
|
-
y2: y2
|
|
28621
|
-
} = bounds;
|
|
28622
|
-
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);
|
|
28623
|
-
}
|
|
28624
|
-
class Bounds {
|
|
28625
|
-
constructor(bounds) {
|
|
28626
|
-
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
28627
|
-
}
|
|
28628
|
-
clone() {
|
|
28629
|
-
return new Bounds(this);
|
|
28630
|
-
}
|
|
28631
|
-
clear() {
|
|
28632
|
-
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
28633
|
-
}
|
|
28634
|
-
empty() {
|
|
28635
|
-
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
28636
|
-
}
|
|
28637
|
-
equals(b) {
|
|
28638
|
-
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
28639
|
-
}
|
|
28640
|
-
setValue() {
|
|
28641
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28642
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28643
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
28644
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
28645
|
-
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
28646
|
-
}
|
|
28647
|
-
set() {
|
|
28648
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28649
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28650
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
28651
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
28652
|
-
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;
|
|
28653
|
-
}
|
|
28654
|
-
add() {
|
|
28655
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28656
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28657
|
-
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;
|
|
28658
|
-
}
|
|
28659
|
-
expand() {
|
|
28660
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28661
|
-
return isArray$7(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;
|
|
28662
|
-
}
|
|
28663
|
-
round() {
|
|
28664
|
-
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;
|
|
28665
|
-
}
|
|
28666
|
-
translate() {
|
|
28667
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28668
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28669
|
-
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
28670
|
-
}
|
|
28671
|
-
rotate() {
|
|
28672
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28673
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28674
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
28675
|
-
const p = this.rotatedPoints(angle, x, y);
|
|
28676
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
28677
|
-
}
|
|
28678
|
-
scale() {
|
|
28679
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28680
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28681
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
28682
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
28683
|
-
const p = this.scalePoints(sx, sy, x, y);
|
|
28684
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
28685
|
-
}
|
|
28686
|
-
union(b) {
|
|
28687
|
-
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;
|
|
28688
|
-
}
|
|
28689
|
-
intersect(b) {
|
|
28690
|
-
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;
|
|
28691
|
-
}
|
|
28692
|
-
encloses(b) {
|
|
28693
|
-
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
28694
|
-
}
|
|
28695
|
-
alignsWith(b) {
|
|
28696
|
-
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
28697
|
-
}
|
|
28698
|
-
intersects(b) {
|
|
28699
|
-
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
28700
|
-
}
|
|
28701
|
-
contains() {
|
|
28702
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28703
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28704
|
-
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
28705
|
-
}
|
|
28706
|
-
containsPoint(p) {
|
|
28707
|
-
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
28708
|
-
}
|
|
28709
|
-
width() {
|
|
28710
|
-
return this.empty() ? 0 : this.x2 - this.x1;
|
|
28711
|
-
}
|
|
28712
|
-
height() {
|
|
28713
|
-
return this.empty() ? 0 : this.y2 - this.y1;
|
|
28714
|
-
}
|
|
28715
|
-
scaleX() {
|
|
28716
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28717
|
-
return this.x1 *= s, this.x2 *= s, this;
|
|
28718
|
-
}
|
|
28719
|
-
scaleY() {
|
|
28720
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28721
|
-
return this.y1 *= s, this.y2 *= s, this;
|
|
28722
|
-
}
|
|
28723
|
-
transformWithMatrix(matrix) {
|
|
28724
|
-
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
28725
|
-
}
|
|
28726
|
-
copy(b) {
|
|
28727
|
-
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
28728
|
-
}
|
|
28729
|
-
rotatedPoints(angle, x, y) {
|
|
28730
|
-
const {
|
|
28731
|
-
x1: x1,
|
|
28732
|
-
y1: y1,
|
|
28733
|
-
x2: x2,
|
|
28734
|
-
y2: y2
|
|
28735
|
-
} = this,
|
|
28736
|
-
cos = Math.cos(angle),
|
|
28737
|
-
sin = Math.sin(angle),
|
|
28738
|
-
cx = x - x * cos + y * sin,
|
|
28739
|
-
cy = y - x * sin - y * cos;
|
|
28740
|
-
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];
|
|
28741
|
-
}
|
|
28742
|
-
scalePoints(sx, sy, x, y) {
|
|
28743
|
-
const {
|
|
28744
|
-
x1: x1,
|
|
28745
|
-
y1: y1,
|
|
28746
|
-
x2: x2,
|
|
28747
|
-
y2: y2
|
|
28748
|
-
} = this;
|
|
28749
|
-
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
28750
|
-
}
|
|
28751
|
-
}
|
|
28752
|
-
class AABBBounds extends Bounds {}
|
|
28753
|
-
|
|
28754
28168
|
class ScrollBarComponent {
|
|
28755
28169
|
hScrollBar;
|
|
28756
28170
|
vScrollBar;
|
|
@@ -47420,7 +46834,14 @@
|
|
|
47420
46834
|
if (recordIndex >= 0) {
|
|
47421
46835
|
const dataIndex = state.table.dataSource.getIndexKey(recordIndex).toString();
|
|
47422
46836
|
if (isValid$3(null === (_b = state.checkedState.get(dataIndex)) || void 0 === _b ? void 0 : _b[field])) return state.checkedState.get(dataIndex)[field];
|
|
47423
|
-
state.checkedState.has(dataIndex)
|
|
46837
|
+
if (state.checkedState.has(dataIndex)) state.checkedState.get(dataIndex)[field] = checked;else if (dataIndex.includes(",")) {
|
|
46838
|
+
const parentDataIndex = dataIndex.split(",").slice(0, -1).join(",");
|
|
46839
|
+
state.checkedState.has(parentDataIndex) && !0 === state.checkedState.get(parentDataIndex)[field] ? state.checkedState.set(dataIndex, {
|
|
46840
|
+
[field]: !0
|
|
46841
|
+
}) : state.checkedState.set(dataIndex, {
|
|
46842
|
+
[field]: checked
|
|
46843
|
+
});
|
|
46844
|
+
} else state.checkedState.set(dataIndex, {
|
|
47424
46845
|
[field]: checked
|
|
47425
46846
|
});
|
|
47426
46847
|
}
|
|
@@ -49644,20 +49065,22 @@
|
|
|
49644
49065
|
|
|
49645
49066
|
function bindGroupTitleCheckboxChange(table) {
|
|
49646
49067
|
table.on("checkbox_state_change", args => {
|
|
49647
|
-
var _a;
|
|
49648
|
-
if (!0 !== (null === (_a = table.internalProps.rowSeriesNumber) || void 0 === _a ? void 0 : _a.enableTreeCheckbox)) return;
|
|
49068
|
+
var _a, _b;
|
|
49649
49069
|
const {
|
|
49650
|
-
|
|
49651
|
-
|
|
49652
|
-
|
|
49653
|
-
|
|
49654
|
-
|
|
49070
|
+
col: col,
|
|
49071
|
+
row: row,
|
|
49072
|
+
checked: checked,
|
|
49073
|
+
field: field
|
|
49074
|
+
} = args;
|
|
49075
|
+
if ("_vtable_rowSeries_number" !== field || !0 !== (null === (_a = table.internalProps.rowSeriesNumber) || void 0 === _a ? void 0 : _a.enableTreeCheckbox)) return;
|
|
49076
|
+
if (table.isHeader(col, row)) return;
|
|
49077
|
+
const record = table.getCellOriginRecord(col, row),
|
|
49655
49078
|
indexedData = table.dataSource.currentPagerIndexedData,
|
|
49656
49079
|
titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
49657
49080
|
let titleIndex = indexedData[titleShowIndex];
|
|
49658
|
-
if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge) {
|
|
49659
|
-
if (checked)
|
|
49660
|
-
|
|
49081
|
+
if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge || (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length)) {
|
|
49082
|
+
if (checked) getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!0, titleIndex, table) : setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);else {
|
|
49083
|
+
getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!1, titleIndex, table) : setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
|
|
49661
49084
|
const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
|
|
49662
49085
|
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState("_vtable_rowSeries_number", col, row);
|
|
49663
49086
|
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
@@ -49693,8 +49116,23 @@
|
|
|
49693
49116
|
key = currentIndex.toString(),
|
|
49694
49117
|
currentIndexLength = isArray$7(currentIndex) ? currentIndex.length : 1;
|
|
49695
49118
|
let start = !1;
|
|
49696
|
-
const result = []
|
|
49697
|
-
|
|
49119
|
+
const result = [],
|
|
49120
|
+
keys = Array.from(checkedState.keys()).sort((a, b) => {
|
|
49121
|
+
var _a, _b;
|
|
49122
|
+
const aArr = a.split(","),
|
|
49123
|
+
bArr = b.split(","),
|
|
49124
|
+
maxLength = Math.max(aArr.length, bArr.length);
|
|
49125
|
+
for (let i = 0; i < maxLength; i++) {
|
|
49126
|
+
const a = null !== (_a = Number(aArr[i])) && void 0 !== _a ? _a : 0,
|
|
49127
|
+
b = null !== (_b = Number(bArr[i])) && void 0 !== _b ? _b : 0;
|
|
49128
|
+
if (a !== b) return a - b;
|
|
49129
|
+
}
|
|
49130
|
+
return 0;
|
|
49131
|
+
}),
|
|
49132
|
+
stateArr = keys.map(key => checkedState.get(key));
|
|
49133
|
+
if (stateArr.forEach((state, i) => {
|
|
49134
|
+
const index = keys[i],
|
|
49135
|
+
value = state;
|
|
49698
49136
|
if (start) {
|
|
49699
49137
|
index.split(",").length === currentIndexLength ? start = !1 : result.push(value._vtable_rowSeries_number);
|
|
49700
49138
|
}
|
|
@@ -49704,20 +49142,60 @@
|
|
|
49704
49142
|
allUnChecked = result.every(item => !item);
|
|
49705
49143
|
allChecked ? (table.stateManager.setCheckedState(col, row, "_vtable_rowSeries_number", !0), setCellCheckboxStateByAttribute(col, row, !0, table)) : allUnChecked ? (table.stateManager.setCheckedState(col, row, "_vtable_rowSeries_number", !1), setCellCheckboxStateByAttribute(col, row, !1, table)) : (table.stateManager.setCheckedState(col, row, "_vtable_rowSeries_number", "indeterminate"), setCellCheckboxStateByAttribute(col, row, "indeterminate", table));
|
|
49706
49144
|
}
|
|
49707
|
-
function updateChildrenCheckboxState(
|
|
49145
|
+
function updateChildrenCheckboxState(parentState, currentIndex, table) {
|
|
49708
49146
|
const {
|
|
49709
49147
|
checkedState: checkedState
|
|
49710
49148
|
} = table.stateManager,
|
|
49711
49149
|
key = currentIndex.toString(),
|
|
49712
49150
|
currentIndexLength = isArray$7(currentIndex) ? currentIndex.length : 1;
|
|
49713
49151
|
let start = !1;
|
|
49714
|
-
checkedState.
|
|
49152
|
+
const keys = Array.from(checkedState.keys()).sort((a, b) => {
|
|
49153
|
+
var _a, _b;
|
|
49154
|
+
const aArr = a.split(","),
|
|
49155
|
+
bArr = b.split(","),
|
|
49156
|
+
maxLength = Math.max(aArr.length, bArr.length);
|
|
49157
|
+
for (let i = 0; i < maxLength; i++) {
|
|
49158
|
+
const a = null !== (_a = Number(aArr[i])) && void 0 !== _a ? _a : 0,
|
|
49159
|
+
b = null !== (_b = Number(bArr[i])) && void 0 !== _b ? _b : 0;
|
|
49160
|
+
if (a !== b) return a - b;
|
|
49161
|
+
}
|
|
49162
|
+
return 0;
|
|
49163
|
+
}),
|
|
49164
|
+
stateArr = keys.map(key => checkedState.get(key));
|
|
49165
|
+
stateArr.forEach((state, i) => {
|
|
49166
|
+
const index = keys[i],
|
|
49167
|
+
value = state;
|
|
49715
49168
|
if (start) {
|
|
49716
|
-
index.split(",").length === currentIndexLength ? start = !1 : value._vtable_rowSeries_number =
|
|
49169
|
+
index.split(",").length === currentIndexLength ? start = !1 : value._vtable_rowSeries_number = parentState;
|
|
49717
49170
|
}
|
|
49718
49171
|
index === key && (start = !0);
|
|
49719
49172
|
});
|
|
49720
49173
|
}
|
|
49174
|
+
function bindHeaderCheckboxChange(table) {
|
|
49175
|
+
table.on("checkbox_state_change", args => {
|
|
49176
|
+
const {
|
|
49177
|
+
col: col,
|
|
49178
|
+
row: row,
|
|
49179
|
+
checked: checked,
|
|
49180
|
+
field: field
|
|
49181
|
+
} = args;
|
|
49182
|
+
if (table.isHeader(col, row)) {
|
|
49183
|
+
table.stateManager.setHeaderCheckedState(field, checked);
|
|
49184
|
+
"checkbox" === table.getCellType(col, row) && table.scenegraph.updateCheckboxCellState(col, row, checked);
|
|
49185
|
+
} else {
|
|
49186
|
+
table.stateManager.setCheckedState(col, row, field, checked);
|
|
49187
|
+
if ("checkbox" === table.getCellType(col, row)) {
|
|
49188
|
+
const oldHeaderCheckedState = table.stateManager.headerCheckedState[field],
|
|
49189
|
+
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(field, col, row);
|
|
49190
|
+
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
49191
|
+
}
|
|
49192
|
+
}
|
|
49193
|
+
});
|
|
49194
|
+
}
|
|
49195
|
+
function getHierarchyState(table, col, row) {
|
|
49196
|
+
const index = table.getRecordShowIndexByCell(col, row);
|
|
49197
|
+
return table.dataSource.getHierarchyState(index);
|
|
49198
|
+
}
|
|
49721
49199
|
|
|
49722
49200
|
function bindButtonClickEvent(table) {
|
|
49723
49201
|
table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
@@ -49795,7 +49273,7 @@
|
|
|
49795
49273
|
});
|
|
49796
49274
|
}
|
|
49797
49275
|
}
|
|
49798
|
-
}), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindButtonClickEvent(this.table);
|
|
49276
|
+
}), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindHeaderCheckboxChange(this.table), bindButtonClickEvent(this.table);
|
|
49799
49277
|
}
|
|
49800
49278
|
dealTableHover(eventArgsSet) {
|
|
49801
49279
|
if (!eventArgsSet) return void this.table.stateManager.updateHoverPos(-1, -1);
|
|
@@ -52525,7 +52003,7 @@
|
|
|
52525
52003
|
constructor(container) {
|
|
52526
52004
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
52527
52005
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
52528
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.17.1-alpha.
|
|
52006
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.17.1-alpha.9", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
52529
52007
|
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
52530
52008
|
const {
|
|
52531
52009
|
frozenColCount = 0,
|
|
@@ -57654,8 +57132,19 @@
|
|
|
57654
57132
|
}
|
|
57655
57133
|
getCheckboxState(field) {
|
|
57656
57134
|
if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$3(field)) {
|
|
57657
|
-
let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) =>
|
|
57658
|
-
|
|
57135
|
+
let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => {
|
|
57136
|
+
var _a, _b;
|
|
57137
|
+
const aArr = a.split(","),
|
|
57138
|
+
bArr = b.split(","),
|
|
57139
|
+
maxLength = Math.max(aArr.length, bArr.length);
|
|
57140
|
+
for (let i = 0; i < maxLength; i++) {
|
|
57141
|
+
const a = null !== (_a = Number(aArr[i])) && void 0 !== _a ? _a : 0,
|
|
57142
|
+
b = null !== (_b = Number(bArr[i])) && void 0 !== _b ? _b : 0;
|
|
57143
|
+
if (a !== b) return a - b;
|
|
57144
|
+
}
|
|
57145
|
+
return 0;
|
|
57146
|
+
}).map(key => this.stateManager.checkedState.get(key));
|
|
57147
|
+
return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state && state[field]);
|
|
57659
57148
|
}
|
|
57660
57149
|
return new Array(...this.stateManager.checkedState.values());
|
|
57661
57150
|
}
|
|
@@ -65424,7 +64913,7 @@
|
|
|
65424
64913
|
themes: themes$1
|
|
65425
64914
|
});
|
|
65426
64915
|
|
|
65427
|
-
const version = "1.17.1-alpha.
|
|
64916
|
+
const version = "1.17.1-alpha.9";
|
|
65428
64917
|
|
|
65429
64918
|
exports.Gantt = Gantt;
|
|
65430
64919
|
exports.TYPES = index$3;
|