@visactor/vtable-calendar 1.17.1-alpha.8 → 1.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vtable-calendar.js +594 -1114
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +5 -5
package/dist/vtable-calendar.js
CHANGED
|
@@ -1113,72 +1113,72 @@
|
|
|
1113
1113
|
var eventemitter3Exports = eventemitter3.exports;
|
|
1114
1114
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
1115
1115
|
|
|
1116
|
-
const isType$
|
|
1117
|
-
var isType$
|
|
1116
|
+
const isType$2 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
1117
|
+
var isType$3 = isType$2;
|
|
1118
1118
|
|
|
1119
|
-
const isBoolean$
|
|
1119
|
+
const isBoolean$3 = function (value) {
|
|
1120
1120
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1121
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$
|
|
1121
|
+
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$3(value, "Boolean");
|
|
1122
1122
|
};
|
|
1123
|
-
var isBoolean$
|
|
1123
|
+
var isBoolean$4 = isBoolean$3;
|
|
1124
1124
|
|
|
1125
|
-
const isFunction$
|
|
1126
|
-
var isFunction$
|
|
1125
|
+
const isFunction$4 = value => "function" == typeof value;
|
|
1126
|
+
var isFunction$5 = isFunction$4;
|
|
1127
1127
|
|
|
1128
|
-
const isNil$
|
|
1129
|
-
var isNil$
|
|
1128
|
+
const isNil$2 = value => null == value;
|
|
1129
|
+
var isNil$3 = isNil$2;
|
|
1130
1130
|
|
|
1131
|
-
const isValid$
|
|
1132
|
-
var isValid$
|
|
1131
|
+
const isValid$2 = value => null != value;
|
|
1132
|
+
var isValid$3 = isValid$2;
|
|
1133
1133
|
|
|
1134
|
-
const isObject$
|
|
1134
|
+
const isObject$6 = value => {
|
|
1135
1135
|
const type = typeof value;
|
|
1136
1136
|
return null !== value && "object" === type || "function" === type;
|
|
1137
1137
|
};
|
|
1138
|
-
var isObject$
|
|
1138
|
+
var isObject$7 = isObject$6;
|
|
1139
1139
|
|
|
1140
|
-
const isObjectLike$
|
|
1141
|
-
var isObjectLike$
|
|
1140
|
+
const isObjectLike$4 = value => "object" == typeof value && null !== value;
|
|
1141
|
+
var isObjectLike$5 = isObjectLike$4;
|
|
1142
1142
|
|
|
1143
|
-
const isPlainObject$
|
|
1144
|
-
if (!isObjectLike$
|
|
1143
|
+
const isPlainObject$2 = function (value) {
|
|
1144
|
+
if (!isObjectLike$5(value) || !isType$3(value, "Object")) return !1;
|
|
1145
1145
|
if (null === Object.getPrototypeOf(value)) return !0;
|
|
1146
1146
|
let proto = value;
|
|
1147
1147
|
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
1148
1148
|
return Object.getPrototypeOf(value) === proto;
|
|
1149
1149
|
};
|
|
1150
|
-
var isPlainObject$
|
|
1150
|
+
var isPlainObject$3 = isPlainObject$2;
|
|
1151
1151
|
|
|
1152
1152
|
const isUndefined = value => void 0 === value;
|
|
1153
1153
|
var isUndefined$1 = isUndefined;
|
|
1154
1154
|
|
|
1155
|
-
const isString$
|
|
1155
|
+
const isString$3 = function (value) {
|
|
1156
1156
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1157
1157
|
const type = typeof value;
|
|
1158
|
-
return fuzzy ? "string" === type : "string" === type || isType$
|
|
1158
|
+
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
1159
1159
|
};
|
|
1160
|
-
var isString$
|
|
1160
|
+
var isString$4 = isString$3;
|
|
1161
1161
|
|
|
1162
|
-
const isArray$
|
|
1163
|
-
var isArray$
|
|
1162
|
+
const isArray$6 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
1163
|
+
var isArray$7 = isArray$6;
|
|
1164
1164
|
|
|
1165
|
-
const isArrayLike$
|
|
1165
|
+
const isArrayLike$2 = function (value) {
|
|
1166
1166
|
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
1167
1167
|
};
|
|
1168
|
-
var isArrayLike$
|
|
1168
|
+
var isArrayLike$3 = isArrayLike$2;
|
|
1169
1169
|
|
|
1170
|
-
const isDate$
|
|
1171
|
-
var isDate$
|
|
1170
|
+
const isDate$2 = value => isType$3(value, "Date");
|
|
1171
|
+
var isDate$3 = isDate$2;
|
|
1172
1172
|
|
|
1173
|
-
const isNumber$
|
|
1173
|
+
const isNumber$3 = function (value) {
|
|
1174
1174
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1175
1175
|
const type = typeof value;
|
|
1176
|
-
return fuzzy ? "number" === type : "number" === type || isType$
|
|
1176
|
+
return fuzzy ? "number" === type : "number" === type || isType$3(value, "Number");
|
|
1177
1177
|
};
|
|
1178
|
-
var isNumber$
|
|
1178
|
+
var isNumber$4 = isNumber$3;
|
|
1179
1179
|
|
|
1180
|
-
const isValidNumber
|
|
1181
|
-
var isValidNumber$
|
|
1180
|
+
const isValidNumber = value => isNumber$4(value) && Number.isFinite(value);
|
|
1181
|
+
var isValidNumber$1 = isValidNumber;
|
|
1182
1182
|
|
|
1183
1183
|
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
1184
1184
|
var isValidUrl$1 = isValidUrl;
|
|
@@ -1186,60 +1186,60 @@
|
|
|
1186
1186
|
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);
|
|
1187
1187
|
var isBase64$1 = isBase64;
|
|
1188
1188
|
|
|
1189
|
-
const getType
|
|
1190
|
-
var getType$
|
|
1189
|
+
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
1190
|
+
var getType$1 = getType;
|
|
1191
1191
|
|
|
1192
|
-
const objectProto$
|
|
1193
|
-
isPrototype
|
|
1192
|
+
const objectProto$5 = Object.prototype,
|
|
1193
|
+
isPrototype = function (value) {
|
|
1194
1194
|
const Ctor = value && value.constructor;
|
|
1195
|
-
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto$
|
|
1195
|
+
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto$5);
|
|
1196
1196
|
};
|
|
1197
|
-
var isPrototype$
|
|
1197
|
+
var isPrototype$1 = isPrototype;
|
|
1198
1198
|
|
|
1199
|
-
const hasOwnProperty$
|
|
1200
|
-
function isEmpty
|
|
1201
|
-
if (isNil$
|
|
1202
|
-
if (isArrayLike$
|
|
1203
|
-
const type = getType$
|
|
1199
|
+
const hasOwnProperty$5 = Object.prototype.hasOwnProperty;
|
|
1200
|
+
function isEmpty(value) {
|
|
1201
|
+
if (isNil$3(value)) return !0;
|
|
1202
|
+
if (isArrayLike$3(value)) return !value.length;
|
|
1203
|
+
const type = getType$1(value);
|
|
1204
1204
|
if ("Map" === type || "Set" === type) return !value.size;
|
|
1205
|
-
if (isPrototype$
|
|
1206
|
-
for (const key in value) if (hasOwnProperty$
|
|
1205
|
+
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
1206
|
+
for (const key in value) if (hasOwnProperty$5.call(value, key)) return !1;
|
|
1207
1207
|
return !0;
|
|
1208
1208
|
}
|
|
1209
1209
|
|
|
1210
|
-
const get$
|
|
1211
|
-
const paths = isString$
|
|
1210
|
+
const get$6 = (obj, path, defaultValue) => {
|
|
1211
|
+
const paths = isString$4(path) ? path.split(".") : path;
|
|
1212
1212
|
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
1213
1213
|
return void 0 === obj ? defaultValue : obj;
|
|
1214
1214
|
};
|
|
1215
|
-
var get$
|
|
1215
|
+
var get$7 = get$6;
|
|
1216
1216
|
|
|
1217
|
-
const hasOwnProperty$
|
|
1218
|
-
has = (object, key) => null != object && hasOwnProperty$
|
|
1217
|
+
const hasOwnProperty$4 = Object.prototype.hasOwnProperty,
|
|
1218
|
+
has = (object, key) => null != object && hasOwnProperty$4.call(object, key);
|
|
1219
1219
|
var has$1 = has;
|
|
1220
1220
|
|
|
1221
|
-
function cloneDeep$
|
|
1221
|
+
function cloneDeep$1(value, ignoreWhen, excludeKeys) {
|
|
1222
1222
|
let result;
|
|
1223
|
-
if (!isValid$
|
|
1224
|
-
const isArr = isArray$
|
|
1223
|
+
if (!isValid$3(value) || "object" != typeof value || ignoreWhen && ignoreWhen(value)) return value;
|
|
1224
|
+
const isArr = isArray$7(value),
|
|
1225
1225
|
length = value.length;
|
|
1226
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$
|
|
1226
|
+
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;
|
|
1227
1227
|
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
1228
1228
|
let index = -1;
|
|
1229
1229
|
if (result) for (; ++index < (props || value).length;) {
|
|
1230
1230
|
const key = props ? props[index] : index,
|
|
1231
1231
|
subValue = value[key];
|
|
1232
|
-
excludeKeys && excludeKeys.includes(key.toString()) ? result[key] = subValue : result[key] = cloneDeep$
|
|
1232
|
+
excludeKeys && excludeKeys.includes(key.toString()) ? result[key] = subValue : result[key] = cloneDeep$1(subValue, ignoreWhen, excludeKeys);
|
|
1233
1233
|
}
|
|
1234
1234
|
return result;
|
|
1235
1235
|
}
|
|
1236
1236
|
|
|
1237
|
-
function baseMerge$
|
|
1237
|
+
function baseMerge$1(target, source) {
|
|
1238
1238
|
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1239
1239
|
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1240
1240
|
if (source) {
|
|
1241
1241
|
if (target === source) return;
|
|
1242
|
-
if (isValid$
|
|
1242
|
+
if (isValid$3(source) && "object" == typeof source) {
|
|
1243
1243
|
const iterable = Object(source),
|
|
1244
1244
|
props = [];
|
|
1245
1245
|
for (const key in iterable) props.push(key);
|
|
@@ -1249,43 +1249,87 @@
|
|
|
1249
1249
|
propIndex = -1;
|
|
1250
1250
|
for (; length--;) {
|
|
1251
1251
|
const key = props[++propIndex];
|
|
1252
|
-
!isValid$
|
|
1252
|
+
!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);
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
-
function baseMergeDeep$
|
|
1257
|
+
function baseMergeDeep$1(target, source, key) {
|
|
1258
1258
|
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1259
1259
|
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
1260
1260
|
const objValue = target[key],
|
|
1261
1261
|
srcValue = source[key];
|
|
1262
1262
|
let newValue = source[key],
|
|
1263
1263
|
isCommon = !0;
|
|
1264
|
-
if (isArray$
|
|
1265
|
-
if (shallowArray) newValue = [];else if (isArray$
|
|
1264
|
+
if (isArray$7(srcValue)) {
|
|
1265
|
+
if (shallowArray) newValue = [];else if (isArray$7(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
1266
1266
|
newValue = new Array(objValue.length);
|
|
1267
1267
|
let index = -1;
|
|
1268
1268
|
const length = objValue.length;
|
|
1269
1269
|
for (; ++index < length;) newValue[index] = objValue[index];
|
|
1270
1270
|
}
|
|
1271
|
-
} else isPlainObject$
|
|
1272
|
-
isCommon && baseMerge$
|
|
1271
|
+
} else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
1272
|
+
isCommon && baseMerge$1(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue$1(target, key, newValue);
|
|
1273
1273
|
}
|
|
1274
|
-
function assignMergeValue$
|
|
1275
|
-
(void 0 !== value && !eq$
|
|
1274
|
+
function assignMergeValue$1(target, key, value) {
|
|
1275
|
+
(void 0 !== value && !eq$3(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
1276
1276
|
}
|
|
1277
|
-
function eq$
|
|
1277
|
+
function eq$3(value, other) {
|
|
1278
1278
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
1279
1279
|
}
|
|
1280
|
-
function merge$
|
|
1280
|
+
function merge$1(target) {
|
|
1281
1281
|
let sourceIndex = -1;
|
|
1282
1282
|
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
1283
1283
|
for (; ++sourceIndex < length;) {
|
|
1284
|
-
baseMerge$
|
|
1284
|
+
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
1285
1285
|
}
|
|
1286
1286
|
return target;
|
|
1287
1287
|
}
|
|
1288
1288
|
|
|
1289
|
+
function pickWithout(obj, keys) {
|
|
1290
|
+
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
1291
|
+
const result = {};
|
|
1292
|
+
return Object.keys(obj).forEach(k => {
|
|
1293
|
+
const v = obj[k];
|
|
1294
|
+
let match = !1;
|
|
1295
|
+
keys.forEach(itKey => {
|
|
1296
|
+
(isString$4(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
1297
|
+
}), match || (result[k] = v);
|
|
1298
|
+
}), result;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
function objToString(obj) {
|
|
1302
|
+
return Object.prototype.toString.call(obj);
|
|
1303
|
+
}
|
|
1304
|
+
function objectKeys(obj) {
|
|
1305
|
+
return Object.keys(obj);
|
|
1306
|
+
}
|
|
1307
|
+
function isEqual(a, b, options) {
|
|
1308
|
+
if (a === b) return !0;
|
|
1309
|
+
if (typeof a != typeof b) return !1;
|
|
1310
|
+
if (null == a || null == b) return !1;
|
|
1311
|
+
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
1312
|
+
if (objToString(a) !== objToString(b)) return !1;
|
|
1313
|
+
if (isFunction$5(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
1314
|
+
if ("object" != typeof a) return !1;
|
|
1315
|
+
if (isArray$7(a)) {
|
|
1316
|
+
if (a.length !== b.length) return !1;
|
|
1317
|
+
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
1318
|
+
return !0;
|
|
1319
|
+
}
|
|
1320
|
+
if (!isPlainObject$3(a)) return !1;
|
|
1321
|
+
const ka = objectKeys(a),
|
|
1322
|
+
kb = objectKeys(b);
|
|
1323
|
+
if (ka.length !== kb.length) return !1;
|
|
1324
|
+
ka.sort(), kb.sort();
|
|
1325
|
+
for (let i = ka.length - 1; i >= 0; i--) if (ka[i] != kb[i]) return !1;
|
|
1326
|
+
for (let i = ka.length - 1; i >= 0; i--) {
|
|
1327
|
+
const key = ka[i];
|
|
1328
|
+
if (!isEqual(a[key], b[key], options)) return !1;
|
|
1329
|
+
}
|
|
1330
|
+
return !0;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1289
1333
|
function keys$1(obj) {
|
|
1290
1334
|
if (!obj) return [];
|
|
1291
1335
|
if (Object.keys) return Object.keys(obj);
|
|
@@ -1313,14 +1357,14 @@
|
|
|
1313
1357
|
}
|
|
1314
1358
|
|
|
1315
1359
|
function array$1(arr) {
|
|
1316
|
-
return isValid$
|
|
1360
|
+
return isValid$3(arr) ? isArray$7(arr) ? arr : [arr] : [];
|
|
1317
1361
|
}
|
|
1318
|
-
function last
|
|
1319
|
-
if (isArrayLike$
|
|
1362
|
+
function last(val) {
|
|
1363
|
+
if (isArrayLike$3(val)) {
|
|
1320
1364
|
return val[val.length - 1];
|
|
1321
1365
|
}
|
|
1322
1366
|
}
|
|
1323
|
-
const maxInArray
|
|
1367
|
+
const maxInArray = (arr, compareFn) => {
|
|
1324
1368
|
var _a;
|
|
1325
1369
|
if (0 === arr.length) return;
|
|
1326
1370
|
let max = arr[0];
|
|
@@ -1330,7 +1374,7 @@
|
|
|
1330
1374
|
}
|
|
1331
1375
|
return max;
|
|
1332
1376
|
};
|
|
1333
|
-
const minInArray
|
|
1377
|
+
const minInArray = (arr, compareFn) => {
|
|
1334
1378
|
var _a;
|
|
1335
1379
|
if (0 === arr.length) return;
|
|
1336
1380
|
let min = arr[0];
|
|
@@ -1340,21 +1384,21 @@
|
|
|
1340
1384
|
}
|
|
1341
1385
|
return min;
|
|
1342
1386
|
};
|
|
1343
|
-
function arrayEqual
|
|
1344
|
-
if (!isArray$
|
|
1387
|
+
function arrayEqual(a, b) {
|
|
1388
|
+
if (!isArray$7(a) || !isArray$7(b)) return !1;
|
|
1345
1389
|
if (a.length !== b.length) return !1;
|
|
1346
1390
|
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
1347
1391
|
return !0;
|
|
1348
1392
|
}
|
|
1349
1393
|
function flattenArray(arr) {
|
|
1350
|
-
if (!isArray$
|
|
1394
|
+
if (!isArray$7(arr)) return [arr];
|
|
1351
1395
|
const result = [];
|
|
1352
1396
|
for (const value of arr) result.push(...flattenArray(value));
|
|
1353
1397
|
return result;
|
|
1354
1398
|
}
|
|
1355
1399
|
|
|
1356
1400
|
function range$1(start, stop, step) {
|
|
1357
|
-
isValid$
|
|
1401
|
+
isValid$3(stop) || (stop = start, start = 0), isValid$3(step) || (step = 1);
|
|
1358
1402
|
let i = -1;
|
|
1359
1403
|
const n = 0 | Math.max(0, Math.ceil((stop - start) / step)),
|
|
1360
1404
|
range = new Array(n);
|
|
@@ -1381,7 +1425,7 @@
|
|
|
1381
1425
|
}(LoggerLevel$1 || (LoggerLevel$1 = {}));
|
|
1382
1426
|
let Logger$1 = class Logger {
|
|
1383
1427
|
static getInstance(level, method) {
|
|
1384
|
-
return Logger._instance && isNumber$
|
|
1428
|
+
return Logger._instance && isNumber$4(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1385
1429
|
}
|
|
1386
1430
|
static setInstance(logger) {
|
|
1387
1431
|
return Logger._instance = logger;
|
|
@@ -1456,7 +1500,7 @@
|
|
|
1456
1500
|
function bisect$1(a, x) {
|
|
1457
1501
|
let lo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1458
1502
|
let hi = arguments.length > 3 ? arguments[3] : undefined;
|
|
1459
|
-
for (isNil$
|
|
1503
|
+
for (isNil$3(hi) && (hi = a.length); lo < hi;) {
|
|
1460
1504
|
const mid = lo + hi >>> 1;
|
|
1461
1505
|
ascending$1(a[mid], x) > 0 ? hi = mid : lo = mid + 1;
|
|
1462
1506
|
}
|
|
@@ -1568,7 +1612,7 @@
|
|
|
1568
1612
|
}
|
|
1569
1613
|
return void 0 === timerId && (timerId = startTimer(timerExpired, wait)), result;
|
|
1570
1614
|
}
|
|
1571
|
-
return wait = +wait || 0, isObject$
|
|
1615
|
+
return wait = +wait || 0, isObject$7(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 () {
|
|
1572
1616
|
void 0 !== timerId && function (id) {
|
|
1573
1617
|
if (useRAF) return cancelAnimationFrame(id);
|
|
1574
1618
|
clearTimeout(id);
|
|
@@ -1585,7 +1629,7 @@
|
|
|
1585
1629
|
let leading = !0,
|
|
1586
1630
|
trailing = !0;
|
|
1587
1631
|
if ("function" != typeof func) throw new TypeError("Expected a function");
|
|
1588
|
-
return isObject$
|
|
1632
|
+
return isObject$7(options) && (leading = "leading" in options ? !!options.leading : leading, trailing = "trailing" in options ? !!options.trailing : trailing), debounce$1(func, wait, {
|
|
1589
1633
|
leading: leading,
|
|
1590
1634
|
trailing: trailing,
|
|
1591
1635
|
maxWait: wait
|
|
@@ -1656,10 +1700,10 @@
|
|
|
1656
1700
|
return this.x = x, this.y = y, this;
|
|
1657
1701
|
}
|
|
1658
1702
|
add(point) {
|
|
1659
|
-
return isNumber$
|
|
1703
|
+
return isNumber$4(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1660
1704
|
}
|
|
1661
1705
|
sub(point) {
|
|
1662
|
-
return isNumber$
|
|
1706
|
+
return isNumber$4(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1663
1707
|
}
|
|
1664
1708
|
multi(point) {
|
|
1665
1709
|
throw new Error("暂不支持");
|
|
@@ -1683,7 +1727,7 @@
|
|
|
1683
1727
|
}
|
|
1684
1728
|
}
|
|
1685
1729
|
|
|
1686
|
-
function degreeToRadian
|
|
1730
|
+
function degreeToRadian(degree) {
|
|
1687
1731
|
return degree * (Math.PI / 180);
|
|
1688
1732
|
}
|
|
1689
1733
|
function radianToDegree(radian) {
|
|
@@ -1814,7 +1858,7 @@
|
|
|
1814
1858
|
};
|
|
1815
1859
|
}
|
|
1816
1860
|
function toRect(box, isDeg) {
|
|
1817
|
-
const deg = isDeg ? degreeToRadian
|
|
1861
|
+
const deg = isDeg ? degreeToRadian(box.angle) : box.angle,
|
|
1818
1862
|
cp = getCenterPoint(box);
|
|
1819
1863
|
return [rotatePoint({
|
|
1820
1864
|
x: box.x1,
|
|
@@ -1840,10 +1884,10 @@
|
|
|
1840
1884
|
BC = vector(rect1[1], rect1[2]),
|
|
1841
1885
|
A1B1 = vector(rect2[0], rect2[1]),
|
|
1842
1886
|
B1C1 = vector(rect2[1], rect2[2]),
|
|
1843
|
-
deg11 = isDeg ? degreeToRadian
|
|
1844
|
-
let deg12 = isDeg ? degreeToRadian
|
|
1845
|
-
const deg21 = isDeg ? degreeToRadian
|
|
1846
|
-
let deg22 = isDeg ? degreeToRadian
|
|
1887
|
+
deg11 = isDeg ? degreeToRadian(box1.angle) : box1.angle;
|
|
1888
|
+
let deg12 = isDeg ? degreeToRadian(90 - box1.angle) : box1.angle + halfPi$1;
|
|
1889
|
+
const deg21 = isDeg ? degreeToRadian(box2.angle) : box2.angle;
|
|
1890
|
+
let deg22 = isDeg ? degreeToRadian(90 - box2.angle) : box2.angle + halfPi$1;
|
|
1847
1891
|
deg12 > pi2 && (deg12 -= pi2), deg22 > pi2 && (deg22 -= pi2);
|
|
1848
1892
|
const isCover = (checkAxisRadius, deg, targetAxis1, targetAxis2) => {
|
|
1849
1893
|
const checkAxis = [Math.cos(deg), Math.sin(deg)];
|
|
@@ -1852,14 +1896,14 @@
|
|
|
1852
1896
|
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);
|
|
1853
1897
|
}
|
|
1854
1898
|
|
|
1855
|
-
const eastAsianCharacterInfo
|
|
1899
|
+
const eastAsianCharacterInfo = character => {
|
|
1856
1900
|
let x = character.charCodeAt(0),
|
|
1857
1901
|
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
1858
1902
|
codePoint = x;
|
|
1859
1903
|
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";
|
|
1860
1904
|
};
|
|
1861
1905
|
|
|
1862
|
-
function getContextFont
|
|
1906
|
+
function getContextFont(text) {
|
|
1863
1907
|
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1864
1908
|
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
1865
1909
|
fontSizeScale || (fontSizeScale = 1);
|
|
@@ -1873,17 +1917,17 @@
|
|
|
1873
1917
|
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
1874
1918
|
}
|
|
1875
1919
|
|
|
1876
|
-
|
|
1920
|
+
class TextMeasure {
|
|
1877
1921
|
constructor(option, textSpec) {
|
|
1878
|
-
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$
|
|
1922
|
+
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);
|
|
1879
1923
|
}
|
|
1880
1924
|
initContext() {
|
|
1881
1925
|
if (this._notSupportCanvas) return !1;
|
|
1882
|
-
if (isNil$
|
|
1926
|
+
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)) {
|
|
1883
1927
|
const context = this._canvas.getContext("2d");
|
|
1884
|
-
isValid$
|
|
1928
|
+
isValid$3(context) && (context.save(), context.font = getContextFont(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
1885
1929
|
}
|
|
1886
|
-
return !isNil$
|
|
1930
|
+
return !isNil$3(this._context) || (this._notSupportCanvas = !0, !1);
|
|
1887
1931
|
}
|
|
1888
1932
|
_initSpec() {
|
|
1889
1933
|
var _a, _b, _c;
|
|
@@ -1906,7 +1950,7 @@
|
|
|
1906
1950
|
let {
|
|
1907
1951
|
lineHeight = fontSize
|
|
1908
1952
|
} = this._userSpec;
|
|
1909
|
-
if (isString$
|
|
1953
|
+
if (isString$4(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
1910
1954
|
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
1911
1955
|
lineHeight = fontSize * scale;
|
|
1912
1956
|
}
|
|
@@ -1937,11 +1981,11 @@
|
|
|
1937
1981
|
}
|
|
1938
1982
|
}
|
|
1939
1983
|
fullMeasure(text) {
|
|
1940
|
-
if (isNil$
|
|
1984
|
+
if (isNil$3(text)) return {
|
|
1941
1985
|
width: 0,
|
|
1942
1986
|
height: 0
|
|
1943
1987
|
};
|
|
1944
|
-
if (isNil$
|
|
1988
|
+
if (isNil$3(this._option.getTextBounds) || !this._notSupportVRender) return this.measureWithNaiveCanvas(text);
|
|
1945
1989
|
const {
|
|
1946
1990
|
fontFamily: fontFamily,
|
|
1947
1991
|
fontSize: fontSize,
|
|
@@ -2003,7 +2047,7 @@
|
|
|
2003
2047
|
for (let i = 0; i < text.length; i++) {
|
|
2004
2048
|
const char = text[i];
|
|
2005
2049
|
let size = this._measureSpecialChar(char);
|
|
2006
|
-
isNil$
|
|
2050
|
+
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);
|
|
2007
2051
|
}
|
|
2008
2052
|
return totalSize;
|
|
2009
2053
|
}
|
|
@@ -2022,7 +2066,7 @@
|
|
|
2022
2066
|
} = this.textSpec;
|
|
2023
2067
|
for (let i = 0; i < text.length; i++) {
|
|
2024
2068
|
const char = text[i],
|
|
2025
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo
|
|
2069
|
+
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
2026
2070
|
totalSize.width += size * fontSize;
|
|
2027
2071
|
}
|
|
2028
2072
|
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
@@ -2037,9 +2081,9 @@
|
|
|
2037
2081
|
width: 0,
|
|
2038
2082
|
height: 0
|
|
2039
2083
|
};
|
|
2040
|
-
if (isNil$
|
|
2041
|
-
if (isArray$
|
|
2042
|
-
const textArr = text.filter(isValid$
|
|
2084
|
+
if (isNil$3(text)) return defaultResult;
|
|
2085
|
+
if (isArray$7(text)) {
|
|
2086
|
+
const textArr = text.filter(isValid$3).map(s => s.toString());
|
|
2043
2087
|
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
2044
2088
|
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
2045
2089
|
height: textArr.length * ((null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize) + 1) + 1
|
|
@@ -2048,7 +2092,7 @@
|
|
|
2048
2092
|
return processor(text.toString());
|
|
2049
2093
|
}
|
|
2050
2094
|
_measureNumberChar() {
|
|
2051
|
-
if (isNil$
|
|
2095
|
+
if (isNil$3(this._numberCharSize)) {
|
|
2052
2096
|
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
2053
2097
|
this._numberCharSize = {
|
|
2054
2098
|
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
@@ -2060,10 +2104,10 @@
|
|
|
2060
2104
|
return this._numberCharSize;
|
|
2061
2105
|
}
|
|
2062
2106
|
_measureFullSizeChar() {
|
|
2063
|
-
return isNil$
|
|
2107
|
+
return isNil$3(this._fullCharSize) && (this._fullCharSize = this._standardMethod(TextMeasure.FULL_SIZE_CHAR)), this._fullCharSize;
|
|
2064
2108
|
}
|
|
2065
2109
|
_measureLetterChar() {
|
|
2066
|
-
if (isNil$
|
|
2110
|
+
if (isNil$3(this._letterCharSize)) {
|
|
2067
2111
|
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
2068
2112
|
this._letterCharSize = {
|
|
2069
2113
|
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
@@ -2075,15 +2119,15 @@
|
|
|
2075
2119
|
return this._letterCharSize;
|
|
2076
2120
|
}
|
|
2077
2121
|
_measureSpecialChar(char) {
|
|
2078
|
-
return isValid$
|
|
2122
|
+
return isValid$3(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
2079
2123
|
}
|
|
2080
2124
|
release() {
|
|
2081
|
-
isValid$
|
|
2125
|
+
isValid$3(this._canvas) && (this._canvas = null), isValid$3(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
2082
2126
|
}
|
|
2083
|
-
}
|
|
2084
|
-
TextMeasure
|
|
2127
|
+
}
|
|
2128
|
+
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
2085
2129
|
|
|
2086
|
-
function transformBoundsWithMatrix
|
|
2130
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
2087
2131
|
const {
|
|
2088
2132
|
x1: x1,
|
|
2089
2133
|
y1: y1,
|
|
@@ -2092,7 +2136,7 @@
|
|
|
2092
2136
|
} = bounds;
|
|
2093
2137
|
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);
|
|
2094
2138
|
}
|
|
2095
|
-
|
|
2139
|
+
class Bounds {
|
|
2096
2140
|
constructor(bounds) {
|
|
2097
2141
|
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
2098
2142
|
}
|
|
@@ -2129,7 +2173,7 @@
|
|
|
2129
2173
|
}
|
|
2130
2174
|
expand() {
|
|
2131
2175
|
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2132
|
-
return isArray$
|
|
2176
|
+
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;
|
|
2133
2177
|
}
|
|
2134
2178
|
round() {
|
|
2135
2179
|
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;
|
|
@@ -2192,7 +2236,7 @@
|
|
|
2192
2236
|
return this.y1 *= s, this.y2 *= s, this;
|
|
2193
2237
|
}
|
|
2194
2238
|
transformWithMatrix(matrix) {
|
|
2195
|
-
return transformBoundsWithMatrix
|
|
2239
|
+
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
2196
2240
|
}
|
|
2197
2241
|
copy(b) {
|
|
2198
2242
|
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
@@ -2219,9 +2263,9 @@
|
|
|
2219
2263
|
} = this;
|
|
2220
2264
|
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
2221
2265
|
}
|
|
2222
|
-
}
|
|
2223
|
-
|
|
2224
|
-
class OBBBounds extends Bounds
|
|
2266
|
+
}
|
|
2267
|
+
class AABBBounds extends Bounds {}
|
|
2268
|
+
class OBBBounds extends Bounds {
|
|
2225
2269
|
constructor(bounds) {
|
|
2226
2270
|
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2227
2271
|
var _a;
|
|
@@ -2648,10 +2692,10 @@
|
|
|
2648
2692
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2649
2693
|
}
|
|
2650
2694
|
function rgb$1(value) {
|
|
2651
|
-
return isNumber$
|
|
2695
|
+
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);
|
|
2652
2696
|
}
|
|
2653
2697
|
function rgba$1(value) {
|
|
2654
|
-
return isNumber$
|
|
2698
|
+
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);
|
|
2655
2699
|
}
|
|
2656
2700
|
function SRGBToLinear$1(c) {
|
|
2657
2701
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -2696,8 +2740,8 @@
|
|
|
2696
2740
|
}
|
|
2697
2741
|
}
|
|
2698
2742
|
static parseColorString(value) {
|
|
2699
|
-
if (isValid$
|
|
2700
|
-
if (isValid$
|
|
2743
|
+
if (isValid$3(DEFAULT_COLORS_OPACITY$1[value])) return rgba$1(DEFAULT_COLORS_OPACITY$1[value]);
|
|
2744
|
+
if (isValid$3(DEFAULT_COLORS$1[value])) return rgb$1(DEFAULT_COLORS$1[value]);
|
|
2701
2745
|
const formatValue = `${value}`.trim().toLowerCase(),
|
|
2702
2746
|
hexRes = setHex$1(formatValue);
|
|
2703
2747
|
if (void 0 !== hexRes) return hexRes;
|
|
@@ -2763,11 +2807,11 @@
|
|
|
2763
2807
|
setHsl(h, s, l) {
|
|
2764
2808
|
const opacity = this.color.opacity,
|
|
2765
2809
|
hsl = rgbToHsl$1(this.color.r, this.color.g, this.color.b),
|
|
2766
|
-
rgb = hslToRgb$1(isNil$
|
|
2810
|
+
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);
|
|
2767
2811
|
return this.color = new RGB$1(rgb.r, rgb.g, rgb.b, opacity), this;
|
|
2768
2812
|
}
|
|
2769
2813
|
setRGB(r, g, b) {
|
|
2770
|
-
return !isNil$
|
|
2814
|
+
return !isNil$3(r) && (this.color.r = r), !isNil$3(g) && (this.color.g = g), !isNil$3(b) && (this.color.b = b), this;
|
|
2771
2815
|
}
|
|
2772
2816
|
setHex(value) {
|
|
2773
2817
|
const formatValue = `${value}`.trim().toLowerCase(),
|
|
@@ -2835,7 +2879,7 @@
|
|
|
2835
2879
|
};
|
|
2836
2880
|
let RGB$1 = class RGB {
|
|
2837
2881
|
constructor(r, g, b, opacity) {
|
|
2838
|
-
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$
|
|
2882
|
+
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;
|
|
2839
2883
|
}
|
|
2840
2884
|
formatHex() {
|
|
2841
2885
|
return `#${hex$1(this.r) + hex$1(this.g) + hex$1(this.b) + (1 === this.opacity ? "" : hex$1(255 * this.opacity))}`;
|
|
@@ -2901,8 +2945,8 @@
|
|
|
2901
2945
|
});
|
|
2902
2946
|
|
|
2903
2947
|
function normalizePadding(padding) {
|
|
2904
|
-
if (isValidNumber$
|
|
2905
|
-
if (isArray$
|
|
2948
|
+
if (isValidNumber$1(padding)) return [padding, padding, padding, padding];
|
|
2949
|
+
if (isArray$7(padding)) {
|
|
2906
2950
|
const length = padding.length;
|
|
2907
2951
|
if (1 === length) {
|
|
2908
2952
|
const paddingValue = padding[0];
|
|
@@ -2918,7 +2962,7 @@
|
|
|
2918
2962
|
}
|
|
2919
2963
|
if (4 === length) return padding;
|
|
2920
2964
|
}
|
|
2921
|
-
if (isObject$
|
|
2965
|
+
if (isObject$7(padding)) {
|
|
2922
2966
|
const {
|
|
2923
2967
|
top = 0,
|
|
2924
2968
|
right = 0,
|
|
@@ -2984,7 +3028,7 @@
|
|
|
2984
3028
|
|
|
2985
3029
|
class CurvePath {
|
|
2986
3030
|
constructor() {
|
|
2987
|
-
this.curves = [], this.bounds = new AABBBounds
|
|
3031
|
+
this.curves = [], this.bounds = new AABBBounds();
|
|
2988
3032
|
}
|
|
2989
3033
|
getCurveLengths() {
|
|
2990
3034
|
return this.curves.map(curve => curve.getLength());
|
|
@@ -3095,7 +3139,7 @@
|
|
|
3095
3139
|
}(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
|
|
3096
3140
|
|
|
3097
3141
|
function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
|
|
3098
|
-
const th = degreeToRadian
|
|
3142
|
+
const th = degreeToRadian(rotateX),
|
|
3099
3143
|
sin_th = Math.sin(th),
|
|
3100
3144
|
cos_th = Math.cos(th),
|
|
3101
3145
|
px = cos_th * (ox - x) * .5 + sin_th * (oy - y) * .5,
|
|
@@ -4664,7 +4708,7 @@
|
|
|
4664
4708
|
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
4665
4709
|
if (!c || !0 === c) return "black";
|
|
4666
4710
|
let result, color;
|
|
4667
|
-
if (isArray$
|
|
4711
|
+
if (isArray$7(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
4668
4712
|
if (color = GradientParser.Parse(color), "string" == typeof color) return color;
|
|
4669
4713
|
if (params.AABBBounds && (!params.attribute || 0 !== params.attribute.scaleX || 0 !== params.attribute.scaleY)) {
|
|
4670
4714
|
const bounds = params.AABBBounds;
|
|
@@ -5487,14 +5531,14 @@
|
|
|
5487
5531
|
return this.global.measureTextMethod = m, data;
|
|
5488
5532
|
}
|
|
5489
5533
|
createTextMeasureInstance(textSpec, option, getCanvasForMeasure) {
|
|
5490
|
-
return this.configure(this.global, this.global.env), new TextMeasure
|
|
5534
|
+
return this.configure(this.global, this.global.env), new TextMeasure(Object.assign({
|
|
5491
5535
|
defaultFontParams: {
|
|
5492
5536
|
fontFamily: DefaultTextStyle.fontFamily,
|
|
5493
5537
|
fontSize: DefaultTextStyle.fontSize
|
|
5494
5538
|
},
|
|
5495
5539
|
getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),
|
|
5496
5540
|
getTextBounds: void 0,
|
|
5497
|
-
specialCharSet: "-/: .,@%'\"~" + TextMeasure
|
|
5541
|
+
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
5498
5542
|
}, null != option ? option : {}), textSpec);
|
|
5499
5543
|
}
|
|
5500
5544
|
drawGraphicToCanvas(graphic, stage, canvas) {
|
|
@@ -6005,26 +6049,26 @@
|
|
|
6005
6049
|
return this.removeChild(child);
|
|
6006
6050
|
}
|
|
6007
6051
|
addEventListener(type, listener, options) {
|
|
6008
|
-
const capture = isBoolean$
|
|
6009
|
-
once = isObject$
|
|
6010
|
-
context = isFunction$
|
|
6011
|
-
return type = capture ? `${type}capture` : type, listener = isFunction$
|
|
6052
|
+
const capture = isBoolean$4(options, !0) && options || isObject$7(options) && options.capture,
|
|
6053
|
+
once = isObject$7(options) && options.once,
|
|
6054
|
+
context = isFunction$5(listener) ? void 0 : listener;
|
|
6055
|
+
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;
|
|
6012
6056
|
}
|
|
6013
6057
|
on(type, listener, options) {
|
|
6014
6058
|
return this.addEventListener(type, listener, options);
|
|
6015
6059
|
}
|
|
6016
6060
|
removeEventListener(type, listener, options) {
|
|
6017
|
-
const capture = isBoolean$
|
|
6018
|
-
context = isFunction$
|
|
6019
|
-
type = capture ? `${type}capture` : type, listener = isFunction$
|
|
6020
|
-
const once = isObject$
|
|
6061
|
+
const capture = isBoolean$4(options, !0) && options || isObject$7(options) && options.capture,
|
|
6062
|
+
context = isFunction$5(listener) ? void 0 : listener;
|
|
6063
|
+
type = capture ? `${type}capture` : type, listener = isFunction$5(listener) ? listener : listener.handleEvent;
|
|
6064
|
+
const once = isObject$7(options) && options.once;
|
|
6021
6065
|
return super.off(type, listener, context, once), this;
|
|
6022
6066
|
}
|
|
6023
6067
|
off(type, listener, options) {
|
|
6024
6068
|
return this.removeEventListener(type, listener, options);
|
|
6025
6069
|
}
|
|
6026
6070
|
once(type, listener, options) {
|
|
6027
|
-
return isObject$
|
|
6071
|
+
return isObject$7(options) ? (options.once = !0, this.addEventListener(type, listener, options)) : this.addEventListener(type, listener, {
|
|
6028
6072
|
once: !0
|
|
6029
6073
|
});
|
|
6030
6074
|
}
|
|
@@ -6113,7 +6157,7 @@
|
|
|
6113
6157
|
try {
|
|
6114
6158
|
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault();
|
|
6115
6159
|
} catch (err) {
|
|
6116
|
-
this.nativeEvent.preventDefault && isFunction$
|
|
6160
|
+
this.nativeEvent.preventDefault && isFunction$5(this.nativeEvent.preventDefault) && this.nativeEvent.preventDefault();
|
|
6117
6161
|
}
|
|
6118
6162
|
this.defaultPrevented = !0;
|
|
6119
6163
|
}
|
|
@@ -6124,7 +6168,7 @@
|
|
|
6124
6168
|
try {
|
|
6125
6169
|
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.stopPropagation();
|
|
6126
6170
|
} catch (err) {
|
|
6127
|
-
this.nativeEvent.stopPropagation && isFunction$
|
|
6171
|
+
this.nativeEvent.stopPropagation && isFunction$5(this.nativeEvent.stopPropagation) && this.nativeEvent.stopPropagation();
|
|
6128
6172
|
}
|
|
6129
6173
|
this.propagationStopped = !0;
|
|
6130
6174
|
}
|
|
@@ -6577,7 +6621,7 @@
|
|
|
6577
6621
|
if (this.currentCursor === mode) return;
|
|
6578
6622
|
this.currentCursor = mode;
|
|
6579
6623
|
const style = this.cursorStyles[mode];
|
|
6580
|
-
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$
|
|
6624
|
+
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);
|
|
6581
6625
|
}
|
|
6582
6626
|
setTargetElement(element) {
|
|
6583
6627
|
this.removeEvents(), this.domElement = element, this.addEvents();
|
|
@@ -7364,7 +7408,7 @@
|
|
|
7364
7408
|
const parseStroke = stroke => {
|
|
7365
7409
|
var _a;
|
|
7366
7410
|
let isFullStroke = !0;
|
|
7367
|
-
if (isBoolean$
|
|
7411
|
+
if (isBoolean$4(stroke, !0)) {
|
|
7368
7412
|
for (let i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
7369
7413
|
isFullStroke = stroke;
|
|
7370
7414
|
} 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;
|
|
@@ -7374,7 +7418,7 @@
|
|
|
7374
7418
|
};
|
|
7375
7419
|
};
|
|
7376
7420
|
const _paddingVec4 = [0, 0, 0, 0];
|
|
7377
|
-
const parsePadding = padding => padding ? isArray$
|
|
7421
|
+
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;
|
|
7378
7422
|
const _coords = [{
|
|
7379
7423
|
x: 0,
|
|
7380
7424
|
y: 0
|
|
@@ -7443,7 +7487,7 @@
|
|
|
7443
7487
|
return points;
|
|
7444
7488
|
}
|
|
7445
7489
|
function getAttributeFromDefaultAttrList(attr, key) {
|
|
7446
|
-
if (isArray$
|
|
7490
|
+
if (isArray$7(attr)) {
|
|
7447
7491
|
let val;
|
|
7448
7492
|
for (let i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
7449
7493
|
return val;
|
|
@@ -7470,7 +7514,7 @@
|
|
|
7470
7514
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
7471
7515
|
const rafBasedSto = new RafBasedSTO();
|
|
7472
7516
|
const _calculateLineHeight = (lineHeight, fontSize) => {
|
|
7473
|
-
if (isString$
|
|
7517
|
+
if (isString$4(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
7474
7518
|
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
7475
7519
|
}
|
|
7476
7520
|
return lineHeight;
|
|
@@ -7487,8 +7531,8 @@
|
|
|
7487
7531
|
width: 0,
|
|
7488
7532
|
height: 0
|
|
7489
7533
|
};
|
|
7490
|
-
let width = isNil$
|
|
7491
|
-
height = isNil$
|
|
7534
|
+
let width = isNil$3(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
|
|
7535
|
+
height = isNil$3(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
|
|
7492
7536
|
x = 0,
|
|
7493
7537
|
y = 0;
|
|
7494
7538
|
return width < 0 ? (x = width, width = -width) : Number.isNaN(width) && (width = 0), height < 0 ? (y = height, height = -height) : Number.isNaN(height) && (height = 0), {
|
|
@@ -7536,11 +7580,11 @@
|
|
|
7536
7580
|
|
|
7537
7581
|
function colorArrayToString(color) {
|
|
7538
7582
|
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7539
|
-
return Array.isArray(color) && isNumber$
|
|
7583
|
+
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;
|
|
7540
7584
|
}
|
|
7541
7585
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
7542
|
-
if (Array.isArray(from) && !isNumber$
|
|
7543
|
-
return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$
|
|
7586
|
+
if (Array.isArray(from) && !isNumber$4(from[0]) || Array.isArray(to) && !isNumber$4(to[0])) {
|
|
7587
|
+
return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$7(from) ? from[index] : from, isArray$7(to) ? to[index] : to, ratio, alphaChannel));
|
|
7544
7588
|
}
|
|
7545
7589
|
return _interpolateColor(from, to, ratio, alphaChannel, cb);
|
|
7546
7590
|
}
|
|
@@ -7721,7 +7765,7 @@
|
|
|
7721
7765
|
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [], ResourceLoader.onLoadSuccessCb = [];
|
|
7722
7766
|
|
|
7723
7767
|
const tempMatrix = new Matrix(),
|
|
7724
|
-
tempBounds$1 = new AABBBounds
|
|
7768
|
+
tempBounds$1 = new AABBBounds();
|
|
7725
7769
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
7726
7770
|
const tempConstantXYKey = ["x", "y"],
|
|
7727
7771
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -7783,7 +7827,7 @@
|
|
|
7783
7827
|
constructor() {
|
|
7784
7828
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7785
7829
|
var _a;
|
|
7786
|
-
super(), this._AABBBounds = new AABBBounds
|
|
7830
|
+
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);
|
|
7787
7831
|
}
|
|
7788
7832
|
setMode(mode) {
|
|
7789
7833
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -7923,7 +7967,7 @@
|
|
|
7923
7967
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
7924
7968
|
[key]: value
|
|
7925
7969
|
}, this.attribute, key, context);
|
|
7926
|
-
params ? this._setAttributes(params, forceUpdateTag, context) : isNil$
|
|
7970
|
+
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);
|
|
7927
7971
|
}
|
|
7928
7972
|
needUpdateTags(keys) {
|
|
7929
7973
|
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
@@ -8061,7 +8105,7 @@
|
|
|
8061
8105
|
d ? (d.bounds && this.tryUpdateAABBBounds("imprecise" === this.attribute.boundsMode), d.trans && this.tryUpdateLocalTransMatrix()) : (this.tryUpdateAABBBounds("imprecise" === this.attribute.boundsMode), this.tryUpdateLocalTransMatrix());
|
|
8062
8106
|
}
|
|
8063
8107
|
hasState(stateName) {
|
|
8064
|
-
return !(!this.currentStates || !this.currentStates.length) && (!!isNil$
|
|
8108
|
+
return !(!this.currentStates || !this.currentStates.length) && (!!isNil$3(stateName) || this.currentStates.includes(stateName));
|
|
8065
8109
|
}
|
|
8066
8110
|
getState(stateName) {
|
|
8067
8111
|
var _a;
|
|
@@ -8357,7 +8401,7 @@
|
|
|
8357
8401
|
};
|
|
8358
8402
|
}
|
|
8359
8403
|
createPathProxy(path) {
|
|
8360
|
-
return isString$
|
|
8404
|
+
return isString$4(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
8361
8405
|
}
|
|
8362
8406
|
loadImage(image) {
|
|
8363
8407
|
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
@@ -8368,7 +8412,7 @@
|
|
|
8368
8412
|
data: "init",
|
|
8369
8413
|
state: null
|
|
8370
8414
|
};
|
|
8371
|
-
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$
|
|
8415
|
+
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$7(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
|
|
8372
8416
|
}
|
|
8373
8417
|
setShadowGraphic(graphic) {
|
|
8374
8418
|
if (graphic) {
|
|
@@ -9094,7 +9138,7 @@
|
|
|
9094
9138
|
}
|
|
9095
9139
|
function runStroke(stroke, lineWidth) {
|
|
9096
9140
|
let s;
|
|
9097
|
-
return s = isArray$
|
|
9141
|
+
return s = isArray$7(stroke) ? stroke.some(item => item || void 0 === item) : !!stroke, s && lineWidth > 0;
|
|
9098
9142
|
}
|
|
9099
9143
|
function fillVisible(opacity, fillOpacity, fill) {
|
|
9100
9144
|
return fill && opacity * fillOpacity > 0;
|
|
@@ -9179,7 +9223,7 @@
|
|
|
9179
9223
|
function calculateArcCornerRadius(arc, startAngle, endAngle, innerRadius, outerRadius) {
|
|
9180
9224
|
const deltaAngle = abs(endAngle - startAngle),
|
|
9181
9225
|
cornerRadius = arc.getParsedCornerRadius(),
|
|
9182
|
-
cornerRadiusIsArray = isArray$
|
|
9226
|
+
cornerRadiusIsArray = isArray$7(cornerRadius),
|
|
9183
9227
|
{
|
|
9184
9228
|
outerDeltaAngle: outerDeltaAngle,
|
|
9185
9229
|
innerDeltaAngle: innerDeltaAngle,
|
|
@@ -9673,7 +9717,7 @@
|
|
|
9673
9717
|
beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
|
|
9674
9718
|
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"]),
|
|
9675
9719
|
clearAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds"])
|
|
9676
|
-
}, this.tempAABBBounds1 = new AABBBounds
|
|
9720
|
+
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds();
|
|
9677
9721
|
}
|
|
9678
9722
|
onAttributeUpdate(graphic) {
|
|
9679
9723
|
this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
|
|
@@ -9714,12 +9758,12 @@
|
|
|
9714
9758
|
textBaseline: textBaseline
|
|
9715
9759
|
} = attribute;
|
|
9716
9760
|
if (null != attribute.forceBoundsHeight) {
|
|
9717
|
-
const h = isNumber$
|
|
9761
|
+
const h = isNumber$4(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
|
|
9718
9762
|
dy = textLayoutOffsetY(textBaseline, h, h);
|
|
9719
9763
|
aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);
|
|
9720
9764
|
}
|
|
9721
9765
|
if (null != attribute.forceBoundsWidth) {
|
|
9722
|
-
const w = isNumber$
|
|
9766
|
+
const w = isNumber$4(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
|
|
9723
9767
|
dx = textDrawOffsetX(textAlign, w);
|
|
9724
9768
|
aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
|
|
9725
9769
|
}
|
|
@@ -9759,7 +9803,7 @@
|
|
|
9759
9803
|
if (this.combindShadowAABBBounds(aabbBounds, graphic), aabbBounds.empty()) return;
|
|
9760
9804
|
let updateMatrix = !0;
|
|
9761
9805
|
const m = graphic.transMatrix;
|
|
9762
|
-
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix
|
|
9806
|
+
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);
|
|
9763
9807
|
}
|
|
9764
9808
|
validCheck(attribute, theme, aabbBounds, graphic) {
|
|
9765
9809
|
if (!graphic) return !0;
|
|
@@ -10247,7 +10291,7 @@
|
|
|
10247
10291
|
const halfPi = pi / 2;
|
|
10248
10292
|
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
10249
10293
|
let cornerRadius;
|
|
10250
|
-
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
10294
|
+
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)) {
|
|
10251
10295
|
const cornerRadiusArr = rectCornerRadius;
|
|
10252
10296
|
let cr0, cr1;
|
|
10253
10297
|
switch (cornerRadiusArr.length) {
|
|
@@ -10277,23 +10321,23 @@
|
|
|
10277
10321
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
10278
10322
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
10279
10323
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
10280
|
-
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
|
|
10324
|
+
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)) {
|
|
10281
10325
|
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
10282
10326
|
const centerX = rightTopPoint1[0],
|
|
10283
10327
|
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
10284
10328
|
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
10285
10329
|
}
|
|
10286
|
-
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual
|
|
10330
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
10287
10331
|
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
10288
10332
|
centerY = rightBottomPoint2[1];
|
|
10289
10333
|
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
10290
10334
|
}
|
|
10291
|
-
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual
|
|
10335
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
10292
10336
|
const centerX = leftBottomPoint1[0],
|
|
10293
10337
|
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
10294
10338
|
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
10295
10339
|
}
|
|
10296
|
-
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual
|
|
10340
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
10297
10341
|
const centerX = leftTopPoint1[0],
|
|
10298
10342
|
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
10299
10343
|
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
@@ -10346,7 +10390,7 @@
|
|
|
10346
10390
|
nextX = x + sign * d,
|
|
10347
10391
|
nextY = y + sign * d,
|
|
10348
10392
|
dw = 2 * d;
|
|
10349
|
-
if (0 === cornerRadius || isArray$
|
|
10393
|
+
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) {
|
|
10350
10394
|
const lastOpacity = rectAttribute[key].opacity;
|
|
10351
10395
|
rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
|
|
10352
10396
|
}
|
|
@@ -10384,7 +10428,7 @@
|
|
|
10384
10428
|
height: height
|
|
10385
10429
|
} = rect.attribute;
|
|
10386
10430
|
if (width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0, Array.isArray(stroke) && stroke.some(s => !1 === s)) {
|
|
10387
|
-
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$
|
|
10431
|
+
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$7(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
10388
10432
|
let lastStroke,
|
|
10389
10433
|
lastStrokeI = 0;
|
|
10390
10434
|
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
@@ -10588,7 +10632,7 @@
|
|
|
10588
10632
|
} = arc.attribute;
|
|
10589
10633
|
outerRadius += outerPadding, innerRadius -= innerPadding;
|
|
10590
10634
|
let conicalOffset = 0;
|
|
10591
|
-
const tempChangeConicalColor = (isBoolean$
|
|
10635
|
+
const tempChangeConicalColor = (isBoolean$4(cap) && cap || cap[0]) && "conical" === fill.gradient;
|
|
10592
10636
|
if (tempChangeConicalColor) {
|
|
10593
10637
|
const {
|
|
10594
10638
|
sc: sc,
|
|
@@ -10617,7 +10661,7 @@
|
|
|
10617
10661
|
drawArcPath(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
|
|
10618
10662
|
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());
|
|
10619
10663
|
}
|
|
10620
|
-
if ((isBoolean$
|
|
10664
|
+
if ((isBoolean$4(cap) && cap || cap[1]) && forceShowCap) {
|
|
10621
10665
|
const {
|
|
10622
10666
|
startAngle: sa,
|
|
10623
10667
|
endAngle: ea
|
|
@@ -10854,7 +10898,7 @@
|
|
|
10854
10898
|
offsetX: offsetX,
|
|
10855
10899
|
offsetY: offsetY,
|
|
10856
10900
|
offsetZ: z
|
|
10857
|
-
}), line.cache && !isArray$
|
|
10901
|
+
}), 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);
|
|
10858
10902
|
const {
|
|
10859
10903
|
x: originX = 0,
|
|
10860
10904
|
x: originY = 0
|
|
@@ -10866,7 +10910,7 @@
|
|
|
10866
10910
|
connectedY: connectedY,
|
|
10867
10911
|
connectedStyle: connectedStyle
|
|
10868
10912
|
} = attribute;
|
|
10869
|
-
if (isArray$
|
|
10913
|
+
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) {
|
|
10870
10914
|
context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
10871
10915
|
offsetX: offsetX,
|
|
10872
10916
|
offsetY: offsetY,
|
|
@@ -10877,7 +10921,7 @@
|
|
|
10877
10921
|
zeroY: connectedY
|
|
10878
10922
|
});
|
|
10879
10923
|
const da = [];
|
|
10880
|
-
isArray$
|
|
10924
|
+
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()));
|
|
10881
10925
|
}
|
|
10882
10926
|
return !1;
|
|
10883
10927
|
}
|
|
@@ -11172,7 +11216,7 @@
|
|
|
11172
11216
|
const {
|
|
11173
11217
|
stroke = areaAttribute && areaAttribute.stroke
|
|
11174
11218
|
} = area.attribute;
|
|
11175
|
-
if (isArray$
|
|
11219
|
+
if (isArray$7(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
11176
11220
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
11177
11221
|
for (let i = 1; i < points.length; i++) {
|
|
11178
11222
|
const p = points[i];
|
|
@@ -11322,7 +11366,7 @@
|
|
|
11322
11366
|
connectedStyle: connectedStyle
|
|
11323
11367
|
} = attribute;
|
|
11324
11368
|
const da = [];
|
|
11325
|
-
if (connect && (isArray$
|
|
11369
|
+
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;
|
|
11326
11370
|
context.beginPath();
|
|
11327
11371
|
const {
|
|
11328
11372
|
points: points,
|
|
@@ -11360,7 +11404,7 @@
|
|
|
11360
11404
|
const {
|
|
11361
11405
|
stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
|
|
11362
11406
|
} = attribute;
|
|
11363
|
-
isArray$
|
|
11407
|
+
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", {
|
|
11364
11408
|
offsetX: offsetX,
|
|
11365
11409
|
offsetY: offsetY,
|
|
11366
11410
|
offsetZ: offsetZ,
|
|
@@ -11484,7 +11528,7 @@
|
|
|
11484
11528
|
if (!rect.valid || !visible) return;
|
|
11485
11529
|
if (!doFill && !doStroke) return;
|
|
11486
11530
|
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
11487
|
-
0 === cornerRadius || isArray$
|
|
11531
|
+
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));
|
|
11488
11532
|
const doFillOrStroke = {
|
|
11489
11533
|
doFill: doFill,
|
|
11490
11534
|
doStroke: doStroke
|
|
@@ -11567,7 +11611,7 @@
|
|
|
11567
11611
|
if (keepDirIn3d && context.camera && context.project) {
|
|
11568
11612
|
const p = context.project(x, y, z),
|
|
11569
11613
|
camera = context.camera;
|
|
11570
|
-
context.camera = null, !1 === parsedPath.draw(context, isArray$
|
|
11614
|
+
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;
|
|
11571
11615
|
} else !1 === parsedPath.draw(context, size, x, y, z, callback) && context.closePath();
|
|
11572
11616
|
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
11573
11617
|
const _runFill = () => {
|
|
@@ -11588,15 +11632,15 @@
|
|
|
11588
11632
|
class DefaultBoundsAllocate {
|
|
11589
11633
|
constructor() {
|
|
11590
11634
|
this.pools = [];
|
|
11591
|
-
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds
|
|
11635
|
+
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds());
|
|
11592
11636
|
}
|
|
11593
11637
|
allocate(x1, y1, x2, y2) {
|
|
11594
|
-
if (!this.pools.length) return new AABBBounds
|
|
11638
|
+
if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
|
|
11595
11639
|
const b = this.pools.pop();
|
|
11596
11640
|
return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
|
|
11597
11641
|
}
|
|
11598
11642
|
allocateByObj(b) {
|
|
11599
|
-
if (!this.pools.length) return new AABBBounds
|
|
11643
|
+
if (!this.pools.length) return new AABBBounds(b);
|
|
11600
11644
|
const _b = this.pools.pop();
|
|
11601
11645
|
return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
|
|
11602
11646
|
}
|
|
@@ -11651,7 +11695,7 @@
|
|
|
11651
11695
|
};
|
|
11652
11696
|
let b;
|
|
11653
11697
|
"richtext" === graphic.type && (matrix = context.currentMatrix.clone(), context.restore(), context.save(), context.setTransformForCurrent());
|
|
11654
|
-
const shouldReCalBounds = isObject$
|
|
11698
|
+
const shouldReCalBounds = isObject$7(background) && background.background,
|
|
11655
11699
|
onlyTranslate = graphic.transMatrix.onlyTranslate();
|
|
11656
11700
|
if (shouldReCalBounds) {
|
|
11657
11701
|
const _b = graphic.AABBBounds,
|
|
@@ -11816,7 +11860,7 @@
|
|
|
11816
11860
|
underlineDash = textAttribute.underlineDash,
|
|
11817
11861
|
fillOpacity = textAttribute.fillOpacity
|
|
11818
11862
|
} = text.attribute,
|
|
11819
|
-
isMulti = !isNil$
|
|
11863
|
+
isMulti = !isNil$3(multiOption),
|
|
11820
11864
|
w = isMulti ? multiOption.width : text.clipedWidth,
|
|
11821
11865
|
offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w),
|
|
11822
11866
|
attribute = {
|
|
@@ -11930,7 +11974,7 @@
|
|
|
11930
11974
|
doFill: doFill,
|
|
11931
11975
|
doStroke: doStroke
|
|
11932
11976
|
} = data;
|
|
11933
|
-
context.beginPath(), cornerRadius <= 0 || isArray$
|
|
11977
|
+
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);
|
|
11934
11978
|
const _runFill = () => {
|
|
11935
11979
|
doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
|
|
11936
11980
|
},
|
|
@@ -12001,7 +12045,7 @@
|
|
|
12001
12045
|
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
12002
12046
|
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
12003
12047
|
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
12004
|
-
} else 0 === cornerRadius || isArray$
|
|
12048
|
+
} 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));
|
|
12005
12049
|
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
12006
12050
|
const doFillOrStroke = {
|
|
12007
12051
|
doFill: doFill,
|
|
@@ -12097,7 +12141,7 @@
|
|
|
12097
12141
|
const res = image.resources.get(url);
|
|
12098
12142
|
if ("success" !== res.state) return;
|
|
12099
12143
|
let needRestore = !1;
|
|
12100
|
-
0 === cornerRadius || isArray$
|
|
12144
|
+
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);
|
|
12101
12145
|
const _runFill = () => {
|
|
12102
12146
|
if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
|
|
12103
12147
|
context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
@@ -12119,7 +12163,7 @@
|
|
|
12119
12163
|
} = image.attribute;
|
|
12120
12164
|
if (!url || !image.resources) return;
|
|
12121
12165
|
const res = image.resources.get(url);
|
|
12122
|
-
if ("loading" === res.state && isString$
|
|
12166
|
+
if ("loading" === res.state && isString$4(url)) return void ResourceLoader.improveImageLoading(url);
|
|
12123
12167
|
if ("success" !== res.state) return;
|
|
12124
12168
|
const {
|
|
12125
12169
|
context: context
|
|
@@ -12202,8 +12246,8 @@
|
|
|
12202
12246
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12203
12247
|
};
|
|
12204
12248
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
12205
|
-
const tempDirtyBounds = new AABBBounds
|
|
12206
|
-
tempBackupDirtyBounds = new AABBBounds
|
|
12249
|
+
const tempDirtyBounds = new AABBBounds(),
|
|
12250
|
+
tempBackupDirtyBounds = new AABBBounds();
|
|
12207
12251
|
class ShadowRootDrawItemInterceptorContribution {
|
|
12208
12252
|
constructor() {
|
|
12209
12253
|
this.order = 1;
|
|
@@ -12597,7 +12641,7 @@
|
|
|
12597
12641
|
class Text extends Graphic {
|
|
12598
12642
|
get font() {
|
|
12599
12643
|
const textTheme = this.getGraphicTheme();
|
|
12600
|
-
return this._font || (this._font = getContextFont
|
|
12644
|
+
return this._font || (this._font = getContextFont(this.attribute, textTheme)), this._font;
|
|
12601
12645
|
}
|
|
12602
12646
|
get clipedText() {
|
|
12603
12647
|
var _a;
|
|
@@ -12647,7 +12691,7 @@
|
|
|
12647
12691
|
const {
|
|
12648
12692
|
text: text
|
|
12649
12693
|
} = this.attribute;
|
|
12650
|
-
return isArray$
|
|
12694
|
+
return isArray$7(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
|
|
12651
12695
|
}
|
|
12652
12696
|
getGraphicTheme() {
|
|
12653
12697
|
return getTheme(this).text;
|
|
@@ -12699,7 +12743,7 @@
|
|
|
12699
12743
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
12700
12744
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
12701
12745
|
}
|
|
12702
|
-
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix
|
|
12746
|
+
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
12703
12747
|
}
|
|
12704
12748
|
updateSingallineAABBBounds(text) {
|
|
12705
12749
|
this.updateMultilineAABBBounds([text]);
|
|
@@ -12802,7 +12846,7 @@
|
|
|
12802
12846
|
lineHeight: lineHeight
|
|
12803
12847
|
},
|
|
12804
12848
|
layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure),
|
|
12805
|
-
lines = isArray$
|
|
12849
|
+
lines = isArray$7(text) ? text.map(l => l.toString()) : [text.toString()],
|
|
12806
12850
|
linesLayout = [],
|
|
12807
12851
|
bboxWH = [0, 0];
|
|
12808
12852
|
let lineCountLimit = 1 / 0;
|
|
@@ -13022,7 +13066,7 @@
|
|
|
13022
13066
|
const {
|
|
13023
13067
|
text: text
|
|
13024
13068
|
} = this.attribute;
|
|
13025
|
-
return isArray$
|
|
13069
|
+
return isArray$7(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
|
|
13026
13070
|
}
|
|
13027
13071
|
updateMultilineAABBBounds(text) {
|
|
13028
13072
|
var _a, _b, _c, _d;
|
|
@@ -13157,13 +13201,13 @@
|
|
|
13157
13201
|
|
|
13158
13202
|
class BaseSymbol {
|
|
13159
13203
|
bounds(size, bounds) {
|
|
13160
|
-
if (isNumber$
|
|
13204
|
+
if (isNumber$4(size)) {
|
|
13161
13205
|
const halfS = size / 2;
|
|
13162
13206
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
13163
13207
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
13164
13208
|
}
|
|
13165
13209
|
parseSize(size) {
|
|
13166
|
-
return isNumber$
|
|
13210
|
+
return isNumber$4(size) ? size : Math.min(size[0], size[1]);
|
|
13167
13211
|
}
|
|
13168
13212
|
}
|
|
13169
13213
|
|
|
@@ -13582,19 +13626,19 @@
|
|
|
13582
13626
|
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";
|
|
13583
13627
|
}
|
|
13584
13628
|
draw(ctx, size, x, y) {
|
|
13585
|
-
return isNumber$
|
|
13629
|
+
return isNumber$4(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
13586
13630
|
}
|
|
13587
13631
|
drawOffset(ctx, size, x, y, offset) {
|
|
13588
|
-
return isNumber$
|
|
13632
|
+
return isNumber$4(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
13589
13633
|
}
|
|
13590
13634
|
}
|
|
13591
13635
|
var rect = new RectSymbol();
|
|
13592
13636
|
|
|
13593
|
-
const tempBounds = new AABBBounds
|
|
13637
|
+
const tempBounds = new AABBBounds();
|
|
13594
13638
|
class CustomSymbolClass {
|
|
13595
13639
|
constructor(type, path) {
|
|
13596
13640
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
13597
|
-
this.pathStr = "", this.type = type, isArray$
|
|
13641
|
+
this.pathStr = "", this.type = type, isArray$7(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
13598
13642
|
}
|
|
13599
13643
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
13600
13644
|
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
@@ -13605,7 +13649,7 @@
|
|
|
13605
13649
|
return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
13606
13650
|
}
|
|
13607
13651
|
parseSize(size) {
|
|
13608
|
-
return isNumber$
|
|
13652
|
+
return isNumber$4(size) ? size : Math.min(size[0], size[1]);
|
|
13609
13653
|
}
|
|
13610
13654
|
bounds(size, bounds) {
|
|
13611
13655
|
if (size = this.parseSize(size), this.isSvg) {
|
|
@@ -13650,7 +13694,7 @@
|
|
|
13650
13694
|
return aabbBounds;
|
|
13651
13695
|
};
|
|
13652
13696
|
|
|
13653
|
-
const _tempBounds$1 = new AABBBounds
|
|
13697
|
+
const _tempBounds$1 = new AABBBounds(),
|
|
13654
13698
|
SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
13655
13699
|
let Symbol$5 = class Symbol extends Graphic {
|
|
13656
13700
|
constructor() {
|
|
@@ -13669,7 +13713,7 @@
|
|
|
13669
13713
|
const {
|
|
13670
13714
|
size: size
|
|
13671
13715
|
} = this.attribute;
|
|
13672
|
-
return isArray$
|
|
13716
|
+
return isArray$7(size) ? 2 === size.length && size.every(this._validNumber) : this._validNumber(size);
|
|
13673
13717
|
}
|
|
13674
13718
|
doUpdateParsedPath() {
|
|
13675
13719
|
const symbolTheme = this.getGraphicTheme();
|
|
@@ -13686,7 +13730,7 @@
|
|
|
13686
13730
|
svg: svg
|
|
13687
13731
|
} = parser.parse(symbolType);
|
|
13688
13732
|
if (!svg) return null;
|
|
13689
|
-
const path = isArray$
|
|
13733
|
+
const path = isArray$7(svg.path) ? svg.path : [svg.path];
|
|
13690
13734
|
_tempBounds$1.clear();
|
|
13691
13735
|
const cacheList = [];
|
|
13692
13736
|
path.forEach(item => {
|
|
@@ -13729,7 +13773,7 @@
|
|
|
13729
13773
|
const {
|
|
13730
13774
|
size = symbolTheme.size
|
|
13731
13775
|
} = attribute;
|
|
13732
|
-
if (isArray$
|
|
13776
|
+
if (isArray$7(size)) aabbBounds.set(-size[0] / 2, -size[1] / 2, size[0] / 2, size[1] / 2);else {
|
|
13733
13777
|
const halfWH = size / 2;
|
|
13734
13778
|
aabbBounds.set(-halfWH, -halfWH, halfWH, halfWH);
|
|
13735
13779
|
}
|
|
@@ -13750,7 +13794,7 @@
|
|
|
13750
13794
|
toCustomPath() {
|
|
13751
13795
|
const symbolInstance = this.getParsedPath(),
|
|
13752
13796
|
size = this.attribute.size,
|
|
13753
|
-
formattedSize = isArray$
|
|
13797
|
+
formattedSize = isArray$7(size) ? size : [size, size];
|
|
13754
13798
|
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]);
|
|
13755
13799
|
}
|
|
13756
13800
|
clone() {
|
|
@@ -14244,7 +14288,7 @@
|
|
|
14244
14288
|
this._marginArray = "number" == typeof marginArray ? [marginArray, marginArray, marginArray, marginArray] : marginArray;
|
|
14245
14289
|
}
|
|
14246
14290
|
this.onBeforeAttributeUpdate = (val, attributes, key) => {
|
|
14247
|
-
if (isArray$
|
|
14291
|
+
if (isArray$7(key) && -1 !== key.indexOf("margin") || "margin" === key) if (attributes.margin) {
|
|
14248
14292
|
const marginArray = parsePadding(attributes.margin);
|
|
14249
14293
|
this._marginArray = "number" == typeof marginArray ? [marginArray, marginArray, marginArray, marginArray] : marginArray;
|
|
14250
14294
|
} else this._marginArray = [0, 0, 0, 0];
|
|
@@ -14620,7 +14664,7 @@
|
|
|
14620
14664
|
}
|
|
14621
14665
|
} else {
|
|
14622
14666
|
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
14623
|
-
if (isNumber$
|
|
14667
|
+
if (isNumber$4(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
14624
14668
|
const textParts = richTextConfig.text.split("\n");
|
|
14625
14669
|
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
14626
14670
|
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
@@ -14724,7 +14768,7 @@
|
|
|
14724
14768
|
const pathTheme = this.getGraphicTheme();
|
|
14725
14769
|
if (!this.valid) return pathTheme.path;
|
|
14726
14770
|
const attribute = this.attribute;
|
|
14727
|
-
return attribute.path instanceof CustomPath2D ? attribute.path : (isNil$
|
|
14771
|
+
return attribute.path instanceof CustomPath2D ? attribute.path : (isNil$3(this.cache) && this.doUpdatePathShape(), this.cache instanceof CustomPath2D ? this.cache : pathTheme.path);
|
|
14728
14772
|
}
|
|
14729
14773
|
getGraphicTheme() {
|
|
14730
14774
|
return getTheme(this).path;
|
|
@@ -14749,7 +14793,7 @@
|
|
|
14749
14793
|
}
|
|
14750
14794
|
doUpdatePathShape() {
|
|
14751
14795
|
const attribute = this.attribute;
|
|
14752
|
-
isString$
|
|
14796
|
+
isString$4(attribute.path, !0) ? this.cache = new CustomPath2D().fromString(attribute.path) : attribute.customPath && (this.cache = new CustomPath2D(), attribute.customPath(this.cache, this));
|
|
14753
14797
|
}
|
|
14754
14798
|
needUpdateTags(keys) {
|
|
14755
14799
|
return super.needUpdateTags(keys, PATH_UPDATE_TAG_KEY);
|
|
@@ -14805,8 +14849,8 @@
|
|
|
14805
14849
|
} = this.attribute;
|
|
14806
14850
|
if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
14807
14851
|
const deltaRadius = Math.abs(outerRadius - innerRadius),
|
|
14808
|
-
parseCR = cornerRadius => Math.min(isNumber$
|
|
14809
|
-
if (isArray$
|
|
14852
|
+
parseCR = cornerRadius => Math.min(isNumber$4(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
14853
|
+
if (isArray$7(cornerRadius)) {
|
|
14810
14854
|
const crList = cornerRadius.map(cr => parseCR(cr) || 0);
|
|
14811
14855
|
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);
|
|
14812
14856
|
}
|
|
@@ -15454,7 +15498,7 @@
|
|
|
15454
15498
|
};
|
|
15455
15499
|
let DefaultDrawContribution = class {
|
|
15456
15500
|
constructor(contributions, drawItemInterceptorContributions) {
|
|
15457
|
-
this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds
|
|
15501
|
+
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();
|
|
15458
15502
|
}
|
|
15459
15503
|
init() {
|
|
15460
15504
|
this.contributions.forEach(item => {
|
|
@@ -16003,7 +16047,7 @@
|
|
|
16003
16047
|
}
|
|
16004
16048
|
}
|
|
16005
16049
|
|
|
16006
|
-
const globalBounds = new AABBBounds
|
|
16050
|
+
const globalBounds = new AABBBounds();
|
|
16007
16051
|
class DirtyBoundsPlugin {
|
|
16008
16052
|
constructor() {
|
|
16009
16053
|
this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
|
|
@@ -16165,7 +16209,7 @@
|
|
|
16165
16209
|
canvas: params.canvas
|
|
16166
16210
|
}), 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, {
|
|
16167
16211
|
main: !0
|
|
16168
|
-
})), 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$
|
|
16212
|
+
})), 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({
|
|
16169
16213
|
background: this._background
|
|
16170
16214
|
}), this.ticker.on("afterTick", this.afterTickCb);
|
|
16171
16215
|
}
|
|
@@ -16318,7 +16362,7 @@
|
|
|
16318
16362
|
}
|
|
16319
16363
|
enableDirtyBounds() {
|
|
16320
16364
|
if (this.dirtyBounds) return;
|
|
16321
|
-
this.dirtyBounds = new Bounds
|
|
16365
|
+
this.dirtyBounds = new Bounds();
|
|
16322
16366
|
let plugin = this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];
|
|
16323
16367
|
plugin ? plugin.activate(this.pluginService) : (plugin = new DirtyBoundsPlugin(), this.pluginService.register(plugin));
|
|
16324
16368
|
}
|
|
@@ -16714,7 +16758,7 @@
|
|
|
16714
16758
|
service.env === this.type && service.setActiveEnvContribution(this);
|
|
16715
16759
|
}
|
|
16716
16760
|
getNativeAABBBounds(dom) {
|
|
16717
|
-
return new AABBBounds
|
|
16761
|
+
return new AABBBounds();
|
|
16718
16762
|
}
|
|
16719
16763
|
removeDom(dom) {
|
|
16720
16764
|
return !1;
|
|
@@ -16799,7 +16843,7 @@
|
|
|
16799
16843
|
};
|
|
16800
16844
|
let BaseWindowHandlerContribution = class {
|
|
16801
16845
|
constructor() {
|
|
16802
|
-
this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds
|
|
16846
|
+
this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
16803
16847
|
}
|
|
16804
16848
|
onChange(cb) {
|
|
16805
16849
|
this._onChangeCb = cb;
|
|
@@ -16865,7 +16909,7 @@
|
|
|
16865
16909
|
params.pickerService = this;
|
|
16866
16910
|
const w = params.bounds.width(),
|
|
16867
16911
|
h = params.bounds.height();
|
|
16868
|
-
if (!new AABBBounds
|
|
16912
|
+
if (!new AABBBounds().setValue(0, 0, w, h).containsPoint(point)) return result;
|
|
16869
16913
|
this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
|
|
16870
16914
|
const parentMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
16871
16915
|
let group;
|
|
@@ -17118,10 +17162,10 @@
|
|
|
17118
17162
|
graphicCreator.RegisterGraphicCreator("wrapText", createWrapText);
|
|
17119
17163
|
}
|
|
17120
17164
|
|
|
17121
|
-
const _tempBounds = new AABBBounds
|
|
17165
|
+
const _tempBounds = new AABBBounds();
|
|
17122
17166
|
class FlexLayoutPlugin {
|
|
17123
17167
|
constructor() {
|
|
17124
|
-
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds
|
|
17168
|
+
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
17125
17169
|
}
|
|
17126
17170
|
pauseLayout(p) {
|
|
17127
17171
|
this.pause = p;
|
|
@@ -17402,7 +17446,7 @@
|
|
|
17402
17446
|
[key]: value
|
|
17403
17447
|
}, this.attribute, key, context);
|
|
17404
17448
|
if (params) return this._setAttributes(params, forceUpdateTag);
|
|
17405
|
-
isPlainObject$
|
|
17449
|
+
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();
|
|
17406
17450
|
}
|
|
17407
17451
|
setAttributes(params, forceUpdateTag, context) {
|
|
17408
17452
|
return params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this._setAttributes(params, forceUpdateTag);
|
|
@@ -17412,10 +17456,10 @@
|
|
|
17412
17456
|
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();
|
|
17413
17457
|
}
|
|
17414
17458
|
_mergeAttributes(params, keys) {
|
|
17415
|
-
isNil$
|
|
17459
|
+
isNil$3(keys) && (keys = Object.keys(params));
|
|
17416
17460
|
for (let i = 0; i < keys.length; i++) {
|
|
17417
17461
|
const key = keys[i];
|
|
17418
|
-
!isPlainObject$
|
|
17462
|
+
!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]);
|
|
17419
17463
|
}
|
|
17420
17464
|
}
|
|
17421
17465
|
bindEvents() {}
|
|
@@ -18204,7 +18248,7 @@
|
|
|
18204
18248
|
const {
|
|
18205
18249
|
scaleIn3d = defaultParams.scaleIn3d
|
|
18206
18250
|
} = params;
|
|
18207
|
-
params.font ? _context.font = params.font : _context.font = getContextFont
|
|
18251
|
+
params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, scaleIn3d && this.camera && this.camera.getProjectionScale(z));
|
|
18208
18252
|
const {
|
|
18209
18253
|
fontFamily = defaultParams.fontFamily,
|
|
18210
18254
|
fontSize = defaultParams.fontSize
|
|
@@ -18214,7 +18258,7 @@
|
|
|
18214
18258
|
setTextStyle(params, defaultParams, z) {
|
|
18215
18259
|
var _a, _b;
|
|
18216
18260
|
const _context = this.nativeContext;
|
|
18217
|
-
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont
|
|
18261
|
+
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, this.camera && this.camera.getProjectionScale(z));
|
|
18218
18262
|
const {
|
|
18219
18263
|
fontFamily = defaultParams.fontFamily,
|
|
18220
18264
|
fontSize = defaultParams.fontSize
|
|
@@ -18431,7 +18475,7 @@
|
|
|
18431
18475
|
return `${BrowserWindowHandlerContribution_1.idprefix}_${BrowserWindowHandlerContribution_1.prefix_count++}`;
|
|
18432
18476
|
}
|
|
18433
18477
|
constructor() {
|
|
18434
|
-
super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global, this.viewBox = new AABBBounds
|
|
18478
|
+
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);
|
|
18435
18479
|
}
|
|
18436
18480
|
getTitle() {
|
|
18437
18481
|
return this.canvas.id && this.canvas.id.toString();
|
|
@@ -18685,8 +18729,8 @@
|
|
|
18685
18729
|
nativeCanvas = null === (_b = domElement.getNativeHandler) || void 0 === _b ? void 0 : _b.call(domElement).nativeCanvas;
|
|
18686
18730
|
let scaleX, scaleY;
|
|
18687
18731
|
return nativeCanvas && (scaleX = rect.width / nativeCanvas.offsetWidth, scaleY = rect.height / nativeCanvas.offsetHeight), {
|
|
18688
|
-
x: (x - rect.left) / (isValidNumber$
|
|
18689
|
-
y: (y - rect.top) / (isValidNumber$
|
|
18732
|
+
x: (x - rect.left) / (isValidNumber$1(scaleX) ? scaleX : 1),
|
|
18733
|
+
y: (y - rect.top) / (isValidNumber$1(scaleY) ? scaleY : 1)
|
|
18690
18734
|
};
|
|
18691
18735
|
}
|
|
18692
18736
|
return {
|
|
@@ -18700,7 +18744,7 @@
|
|
|
18700
18744
|
const b = dom.getBoundingClientRect();
|
|
18701
18745
|
return new DynamicB(b);
|
|
18702
18746
|
}
|
|
18703
|
-
return new AABBBounds
|
|
18747
|
+
return new AABBBounds();
|
|
18704
18748
|
}
|
|
18705
18749
|
removeDom(dom) {
|
|
18706
18750
|
return dom.parentElement.removeChild(dom), !0;
|
|
@@ -18711,7 +18755,7 @@
|
|
|
18711
18755
|
height: height,
|
|
18712
18756
|
style: style
|
|
18713
18757
|
} = params;
|
|
18714
|
-
return style && (isString$
|
|
18758
|
+
return style && (isString$4(style) ? dom.setAttribute("style", style) : Object.keys(style).forEach(k => {
|
|
18715
18759
|
dom.style[k] = style[k];
|
|
18716
18760
|
})), null != width && (dom.style.width = `${width}px`), null != height && (dom.style.height = `${height}px`), !0;
|
|
18717
18761
|
}
|
|
@@ -18722,7 +18766,7 @@
|
|
|
18722
18766
|
} = params,
|
|
18723
18767
|
element = document.createElement(tagName);
|
|
18724
18768
|
if (this.updateDom(element, params), parent) {
|
|
18725
|
-
const pd = isString$
|
|
18769
|
+
const pd = isString$4(parent) ? this.getElementById(parent) : parent;
|
|
18726
18770
|
pd && pd.appendChild && pd.appendChild(element);
|
|
18727
18771
|
}
|
|
18728
18772
|
return element;
|
|
@@ -18813,7 +18857,7 @@
|
|
|
18813
18857
|
}
|
|
18814
18858
|
loadFont(font, source, descriptors) {
|
|
18815
18859
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
18816
|
-
return new FontFace(font, isString$
|
|
18860
|
+
return new FontFace(font, isString$4(source) ? `url(${source})` : source, descriptors).load().then(function (loadedFont) {
|
|
18817
18861
|
return document.fonts.add(loadedFont), {
|
|
18818
18862
|
loadState: "success"
|
|
18819
18863
|
};
|
|
@@ -19026,7 +19070,7 @@
|
|
|
19026
19070
|
loadPathPick$1 || (loadPathPick$1 = !0, bind(MathPathPicker).to(DefaultMathPathPicker).inSingletonScope(), bind(MathPickerContribution).toService(MathPathPicker));
|
|
19027
19071
|
});
|
|
19028
19072
|
|
|
19029
|
-
const _bounds = new AABBBounds
|
|
19073
|
+
const _bounds = new AABBBounds();
|
|
19030
19074
|
class RectPickerBase {
|
|
19031
19075
|
constructor() {
|
|
19032
19076
|
this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
@@ -19053,7 +19097,7 @@
|
|
|
19053
19097
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
19054
19098
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
19055
19099
|
let picked = !0;
|
|
19056
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
19100
|
+
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) => {
|
|
19057
19101
|
if (picked) return !0;
|
|
19058
19102
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
19059
19103
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
@@ -19194,7 +19238,7 @@
|
|
|
19194
19238
|
this._context = new NodeContext2d(this, this._dpr), this.nativeCanvas.width = this._pixelWidth, this.nativeCanvas.height = this._pixelHeight;
|
|
19195
19239
|
}
|
|
19196
19240
|
release() {
|
|
19197
|
-
this._nativeCanvas.release && isFunction$
|
|
19241
|
+
this._nativeCanvas.release && isFunction$5(this._nativeCanvas.release) && this._nativeCanvas.release();
|
|
19198
19242
|
}
|
|
19199
19243
|
};
|
|
19200
19244
|
NodeCanvas.env = "node", NodeCanvas = __decorate$k([injectable(), __metadata$a("design:paramtypes", [Object])], NodeCanvas);
|
|
@@ -20518,7 +20562,7 @@
|
|
|
20518
20562
|
loadScrollbarComponent();
|
|
20519
20563
|
class ScrollBar extends AbstractComponent {
|
|
20520
20564
|
constructor(attributes, options) {
|
|
20521
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
20565
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._onRailPointerDown = e => {
|
|
20522
20566
|
const {
|
|
20523
20567
|
viewX: viewX,
|
|
20524
20568
|
viewY: viewY
|
|
@@ -20804,13 +20848,13 @@
|
|
|
20804
20848
|
return direct ? angleLargeThanPI ? 2 * Math.PI - ang : ang : angleLargeThanPI ? ang : 2 * Math.PI - ang;
|
|
20805
20849
|
}
|
|
20806
20850
|
|
|
20807
|
-
const initTextMeasure = (textSpec, option, useNaiveCanvas, defaultFontParams) => new TextMeasure
|
|
20851
|
+
const initTextMeasure = (textSpec, option, useNaiveCanvas, defaultFontParams) => new TextMeasure(Object.assign({
|
|
20808
20852
|
defaultFontParams: Object.assign({
|
|
20809
20853
|
fontFamily: DEFAULT_TEXT_FONT_FAMILY$1,
|
|
20810
20854
|
fontSize: DEFAULT_TEXT_FONT_SIZE$1
|
|
20811
20855
|
}, defaultFontParams),
|
|
20812
20856
|
getTextBounds: useNaiveCanvas ? void 0 : getTextBounds,
|
|
20813
|
-
specialCharSet: "-/: .,@%'\"~" + TextMeasure
|
|
20857
|
+
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
20814
20858
|
}, null != option ? option : {}), textSpec);
|
|
20815
20859
|
function measureTextSize(text, textSpec) {
|
|
20816
20860
|
let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -20841,11 +20885,11 @@
|
|
|
20841
20885
|
function getTextType(attributes) {
|
|
20842
20886
|
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
20843
20887
|
var _a, _b;
|
|
20844
|
-
return isObject$
|
|
20888
|
+
return isObject$7(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";
|
|
20845
20889
|
}
|
|
20846
20890
|
function richTextAttributeTransform(attributes) {
|
|
20847
20891
|
var _a, _b;
|
|
20848
|
-
return isValid$
|
|
20892
|
+
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;
|
|
20849
20893
|
}
|
|
20850
20894
|
function htmlAttributeTransform(attributes) {
|
|
20851
20895
|
const {
|
|
@@ -20895,7 +20939,7 @@
|
|
|
20895
20939
|
return this._textShape;
|
|
20896
20940
|
}
|
|
20897
20941
|
constructor(attributes, options) {
|
|
20898
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
20942
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Tag.defaultAttributes, attributes)), this.name = "tag", this._tagStates = [], this._rectStates = [], this._symbolStates = [], this._textStates = [];
|
|
20899
20943
|
}
|
|
20900
20944
|
render() {
|
|
20901
20945
|
var _a, _b, _c;
|
|
@@ -20932,9 +20976,9 @@
|
|
|
20932
20976
|
visible: shapeVisible
|
|
20933
20977
|
} = shape,
|
|
20934
20978
|
shapeStyle = __rest$5(shape, ["visible"]);
|
|
20935
|
-
if (isBoolean$
|
|
20979
|
+
if (isBoolean$4(shapeVisible)) {
|
|
20936
20980
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
20937
|
-
maxSize = isNumber$
|
|
20981
|
+
maxSize = isNumber$4(size) ? size : Math.max(size[0], size[1]);
|
|
20938
20982
|
symbol = group.createOrUpdateChild("tag-shape", Object.assign(Object.assign({
|
|
20939
20983
|
symbolType: "circle",
|
|
20940
20984
|
size: size,
|
|
@@ -20943,7 +20987,7 @@
|
|
|
20943
20987
|
visible: shapeVisible,
|
|
20944
20988
|
x: maxSize / 2,
|
|
20945
20989
|
y: maxSize / 2
|
|
20946
|
-
}), "symbol"), isEmpty
|
|
20990
|
+
}), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
|
|
20947
20991
|
}
|
|
20948
20992
|
let textShape;
|
|
20949
20993
|
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
@@ -20954,33 +20998,33 @@
|
|
|
20954
20998
|
type: type,
|
|
20955
20999
|
text: text
|
|
20956
21000
|
}, textStyle))), textStyle), {
|
|
20957
|
-
visible: isValid$
|
|
21001
|
+
visible: isValid$3(text) && !1 !== visible,
|
|
20958
21002
|
x: textX,
|
|
20959
21003
|
y: 0
|
|
20960
21004
|
});
|
|
20961
21005
|
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), tagWidth += textShape.AABBBounds.width(), tagHeight += textShape.AABBBounds.height(), tagX += textShape.AABBBounds.x1, tagY += textShape.AABBBounds.y1;
|
|
20962
21006
|
} else {
|
|
20963
21007
|
const textAttrs = Object.assign(Object.assign({
|
|
20964
|
-
text: isObject$
|
|
20965
|
-
visible: isValid$
|
|
21008
|
+
text: isObject$7(text) && "type" in text && "text" === text.type ? text.text : text,
|
|
21009
|
+
visible: isValid$3(text) && !1 !== visible,
|
|
20966
21010
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
20967
21011
|
}, textStyle), {
|
|
20968
21012
|
x: textX,
|
|
20969
21013
|
y: 0
|
|
20970
21014
|
});
|
|
20971
|
-
isNil$
|
|
21015
|
+
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);
|
|
20972
21016
|
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),
|
|
20973
21017
|
textWidth = textBounds.width,
|
|
20974
21018
|
textHeight = textBounds.height;
|
|
20975
21019
|
tagWidth += textWidth;
|
|
20976
21020
|
const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
|
|
20977
|
-
maxSize = isNumber$
|
|
21021
|
+
maxSize = isNumber$4(size) ? size : Math.max(size[0], size[1]);
|
|
20978
21022
|
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
20979
21023
|
const {
|
|
20980
21024
|
textAlign: textAlign,
|
|
20981
21025
|
textBaseline: textBaseline
|
|
20982
21026
|
} = textStyle;
|
|
20983
|
-
(isValid$
|
|
21027
|
+
(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;
|
|
20984
21028
|
let flag = 0;
|
|
20985
21029
|
"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));
|
|
20986
21030
|
const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
|
|
@@ -21032,7 +21076,7 @@
|
|
|
21032
21076
|
visible: bgVisible
|
|
21033
21077
|
} = panel,
|
|
21034
21078
|
backgroundStyle = __rest$5(panel, ["visible"]);
|
|
21035
|
-
if (visible && isBoolean$
|
|
21079
|
+
if (visible && isBoolean$4(bgVisible)) {
|
|
21036
21080
|
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
21037
21081
|
visible: bgVisible && !!text,
|
|
21038
21082
|
width: tagWidth,
|
|
@@ -21040,7 +21084,7 @@
|
|
|
21040
21084
|
x: tagX,
|
|
21041
21085
|
y: tagY
|
|
21042
21086
|
}), "rect");
|
|
21043
|
-
if (isEmpty
|
|
21087
|
+
if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
|
|
21044
21088
|
const customShape = backgroundStyle.customShape;
|
|
21045
21089
|
bgRect.pathProxy = attrs => customShape(this, attrs, new CustomPath2D());
|
|
21046
21090
|
}
|
|
@@ -21049,7 +21093,7 @@
|
|
|
21049
21093
|
this._textShape = textShape, this._symbol = symbol, this.resetStates();
|
|
21050
21094
|
}
|
|
21051
21095
|
initAttributes(params, options) {
|
|
21052
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
21096
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Tag.defaultAttributes, params), super.initAttributes(params), this.render();
|
|
21053
21097
|
}
|
|
21054
21098
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
21055
21099
|
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);
|
|
@@ -21103,14 +21147,14 @@
|
|
|
21103
21147
|
}
|
|
21104
21148
|
};
|
|
21105
21149
|
const theme$1 = {
|
|
21106
|
-
poptip: merge$
|
|
21150
|
+
poptip: merge$1({}, DEFAULT_THEME)
|
|
21107
21151
|
};
|
|
21108
21152
|
|
|
21109
21153
|
function loadPoptipComponent() {
|
|
21110
21154
|
registerGroup(), registerText(), registerSymbol(), registerRect();
|
|
21111
21155
|
}
|
|
21112
21156
|
function setPoptipTheme(defaultPoptipTheme) {
|
|
21113
|
-
merge$
|
|
21157
|
+
merge$1(theme$1.poptip, DEFAULT_THEME, defaultPoptipTheme);
|
|
21114
21158
|
}
|
|
21115
21159
|
|
|
21116
21160
|
var __rest$4 = undefined && undefined.__rest || function (s, e) {
|
|
@@ -21122,11 +21166,11 @@
|
|
|
21122
21166
|
}
|
|
21123
21167
|
return t;
|
|
21124
21168
|
};
|
|
21125
|
-
const _tBounds = new AABBBounds
|
|
21169
|
+
const _tBounds = new AABBBounds();
|
|
21126
21170
|
loadPoptipComponent();
|
|
21127
21171
|
class PopTip extends AbstractComponent {
|
|
21128
21172
|
constructor(attributes, options) {
|
|
21129
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
21173
|
+
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"];
|
|
21130
21174
|
}
|
|
21131
21175
|
render() {
|
|
21132
21176
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -21157,9 +21201,9 @@
|
|
|
21157
21201
|
zIndex: 1
|
|
21158
21202
|
}, "group"),
|
|
21159
21203
|
maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3],
|
|
21160
|
-
titleVisible = isValid$
|
|
21204
|
+
titleVisible = isValid$3(title) && !1 !== visible,
|
|
21161
21205
|
titleAttrs = Object.assign(Object.assign({
|
|
21162
|
-
text: isArray$
|
|
21206
|
+
text: isArray$7(title) ? title : [title],
|
|
21163
21207
|
visible: titleVisible,
|
|
21164
21208
|
wrap: !0
|
|
21165
21209
|
}, titleStyle), {
|
|
@@ -21170,15 +21214,15 @@
|
|
|
21170
21214
|
textBaseline: "top"
|
|
21171
21215
|
}),
|
|
21172
21216
|
titleShape = group.createOrUpdateChild("poptip-title", titleAttrs, "text");
|
|
21173
|
-
isEmpty
|
|
21217
|
+
isEmpty(null == state ? void 0 : state.title) || (titleShape.states = state.title);
|
|
21174
21218
|
const titleBounds = titleShape.AABBBounds,
|
|
21175
21219
|
titleHeight = titleBounds.height(),
|
|
21176
21220
|
titleWidth = titleBounds.width();
|
|
21177
21221
|
let height = titleHeight + space;
|
|
21178
21222
|
titleVisible || (height = 0);
|
|
21179
|
-
const contentVisible = isValid$
|
|
21223
|
+
const contentVisible = isValid$3(content) && !1 !== visible,
|
|
21180
21224
|
contentAttrs = Object.assign(Object.assign({
|
|
21181
|
-
text: isArray$
|
|
21225
|
+
text: isArray$7(content) ? content : [content],
|
|
21182
21226
|
visible: contentVisible,
|
|
21183
21227
|
wrap: !0
|
|
21184
21228
|
}, contentStyle), {
|
|
@@ -21189,7 +21233,7 @@
|
|
|
21189
21233
|
textBaseline: "top"
|
|
21190
21234
|
}),
|
|
21191
21235
|
contentShape = group.createOrUpdateChild("poptip-content", contentAttrs, "text");
|
|
21192
|
-
isEmpty
|
|
21236
|
+
isEmpty(null == state ? void 0 : state.content) || (contentShape.states = state.content);
|
|
21193
21237
|
const contentBounds = contentShape.AABBBounds,
|
|
21194
21238
|
contentHeight = contentBounds.height(),
|
|
21195
21239
|
contentWidth = contentBounds.width();
|
|
@@ -21202,7 +21246,7 @@
|
|
|
21202
21246
|
} = panel,
|
|
21203
21247
|
backgroundStyle = __rest$4(panel, ["visible"]),
|
|
21204
21248
|
symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12,
|
|
21205
|
-
spaceSize = isArray$
|
|
21249
|
+
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),
|
|
21206
21250
|
lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1,
|
|
21207
21251
|
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;
|
|
21208
21252
|
if (range) {
|
|
@@ -21210,7 +21254,7 @@
|
|
|
21210
21254
|
leftWidth = null !== (_h = this.attribute.x) && void 0 !== _h ? _h : b.x1,
|
|
21211
21255
|
rightWidth = range[0] - b.x1;
|
|
21212
21256
|
let maxSpace = Math.max(leftWidth, rightWidth);
|
|
21213
|
-
const buf = (isArray$
|
|
21257
|
+
const buf = (isArray$7(symbolSize) ? symbolSize[0] : 12) + 3;
|
|
21214
21258
|
if (maxSpace = Math.min(maxSpace - buf, maxSpace * maxWidthPercent), maxSpace < popTipWidth) {
|
|
21215
21259
|
popTipWidth = maxSpace;
|
|
21216
21260
|
const buf = parsedPadding[1] + parsedPadding[3];
|
|
@@ -21226,9 +21270,9 @@
|
|
|
21226
21270
|
angle: angle,
|
|
21227
21271
|
offset: offset,
|
|
21228
21272
|
rectOffset: rectOffset
|
|
21229
|
-
} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$
|
|
21230
|
-
if (isBoolean$
|
|
21231
|
-
const offsetX = (isArray$
|
|
21273
|
+
} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$7(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth]);
|
|
21274
|
+
if (isBoolean$4(bgVisible)) {
|
|
21275
|
+
const offsetX = (isArray$7(symbolSize) ? symbolSize[0] : symbolSize) / 4,
|
|
21232
21276
|
bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
21233
21277
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
21234
21278
|
x: offsetX,
|
|
@@ -21243,7 +21287,7 @@
|
|
|
21243
21287
|
size: symbolSize,
|
|
21244
21288
|
zIndex: -9
|
|
21245
21289
|
}), "symbol");
|
|
21246
|
-
isEmpty
|
|
21290
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel);
|
|
21247
21291
|
const bgRect = group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
21248
21292
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
21249
21293
|
x: 0,
|
|
@@ -21252,7 +21296,7 @@
|
|
|
21252
21296
|
height: poptipHeight,
|
|
21253
21297
|
zIndex: -8
|
|
21254
21298
|
}), "rect");
|
|
21255
|
-
isEmpty
|
|
21299
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
21256
21300
|
}
|
|
21257
21301
|
if (group.setAttributes({
|
|
21258
21302
|
x: -offset[0] + dx,
|
|
@@ -21261,7 +21305,7 @@
|
|
|
21261
21305
|
{
|
|
21262
21306
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
21263
21307
|
const b = _tBounds,
|
|
21264
|
-
stageBounds = new Bounds
|
|
21308
|
+
stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
21265
21309
|
if (rectInsideAnotherRect(b, stageBounds, !1)) break;
|
|
21266
21310
|
{
|
|
21267
21311
|
const bbox = getRectIntersect(b, stageBounds, !1),
|
|
@@ -21379,7 +21423,7 @@
|
|
|
21379
21423
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21380
21424
|
};
|
|
21381
21425
|
function wrapPoptip(target, source) {
|
|
21382
|
-
return merge$
|
|
21426
|
+
return merge$1(target, theme$1.poptip, source), target;
|
|
21383
21427
|
}
|
|
21384
21428
|
let PopTipRenderContribution = class {
|
|
21385
21429
|
render(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
@@ -21391,7 +21435,7 @@
|
|
|
21391
21435
|
} = graphic.attribute.poptip || {};
|
|
21392
21436
|
if (!1 === visible || visibleCb && !1 === visibleCb(graphic)) return;
|
|
21393
21437
|
const attribute = {};
|
|
21394
|
-
merge$
|
|
21438
|
+
merge$1(attribute, PopTip.defaultAttributes, graphic.attribute.poptip ? graphic.attribute.poptip : {}), this.poptipComponent ? this.poptipComponent.initAttributes(attribute) : this.poptipComponent = new PopTip(attribute);
|
|
21395
21439
|
let poptip = graphic.attribute.poptip || {};
|
|
21396
21440
|
if ("text" === graphic.type && null == poptip.title && null == poptip.content) {
|
|
21397
21441
|
const out = {};
|
|
@@ -21514,7 +21558,7 @@
|
|
|
21514
21558
|
return this._mainSegmentPoints;
|
|
21515
21559
|
}
|
|
21516
21560
|
constructor(attributes, options) {
|
|
21517
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
21561
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Segment.defaultAttributes, attributes)), this.name = "segment", this.key = "segment", this.lines = [];
|
|
21518
21562
|
}
|
|
21519
21563
|
render() {
|
|
21520
21564
|
this.removeAllChild(!0), this._reset();
|
|
@@ -21534,7 +21578,7 @@
|
|
|
21534
21578
|
endSymbolShape = this._renderSymbol(endSymbol, points, "end");
|
|
21535
21579
|
if (this.startSymbol = startSymbolShape, this.endSymbol = endSymbolShape, multiSegment) {
|
|
21536
21580
|
const points = [...this.attribute.points];
|
|
21537
|
-
if (isValidNumber$
|
|
21581
|
+
if (isValidNumber$1(mainSegmentIndex)) points[mainSegmentIndex] = this._clipPoints(points[mainSegmentIndex]);else {
|
|
21538
21582
|
const clipPoints = this._clipPoints(flattenArray(points));
|
|
21539
21583
|
points[0][0] = clipPoints[0], points[points.length - 1][points[points.length - 1].length - 1] = clipPoints[clipPoints.length - 1];
|
|
21540
21584
|
}
|
|
@@ -21542,10 +21586,10 @@
|
|
|
21542
21586
|
var _a, _b;
|
|
21543
21587
|
const line = graphicCreator.line(Object.assign(Object.assign({
|
|
21544
21588
|
points: point
|
|
21545
|
-
}, isArray$
|
|
21589
|
+
}, isArray$7(lineStyle) ? null !== (_a = lineStyle[index]) && void 0 !== _a ? _a : lineStyle[lineStyle.length - 1] : lineStyle), {
|
|
21546
21590
|
fill: !1
|
|
21547
21591
|
}));
|
|
21548
|
-
line.name = `${this.name}-line`, line.id = this._getNodeId("line" + index), isEmpty
|
|
21592
|
+
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);
|
|
21549
21593
|
});
|
|
21550
21594
|
} else {
|
|
21551
21595
|
let lineCreator = graphicCreator.line;
|
|
@@ -21556,7 +21600,7 @@
|
|
|
21556
21600
|
fill: !1,
|
|
21557
21601
|
closePath: !1
|
|
21558
21602
|
}));
|
|
21559
|
-
line.name = `${this.name}-line`, line.id = this._getNodeId("line"), isEmpty
|
|
21603
|
+
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);
|
|
21560
21604
|
}
|
|
21561
21605
|
}
|
|
21562
21606
|
_computeStartRotate(angle) {
|
|
@@ -21589,17 +21633,17 @@
|
|
|
21589
21633
|
} = attribute;
|
|
21590
21634
|
let position, rotate;
|
|
21591
21635
|
"start" === dim ? (position = {
|
|
21592
|
-
x: start.x + (isValidNumber$
|
|
21593
|
-
y: start.y + (isValidNumber$
|
|
21636
|
+
x: start.x + (isValidNumber$1(startAngle) ? refX * Math.cos(startAngle) + refY * Math.cos(startAngle - Math.PI / 2) : 0),
|
|
21637
|
+
y: start.y + (isValidNumber$1(startAngle) ? refX * Math.sin(startAngle) + refY * Math.sin(startAngle - Math.PI / 2) : 0)
|
|
21594
21638
|
}, rotate = this._computeStartRotate(this._startAngle)) : (position = {
|
|
21595
|
-
x: end.x + (isValidNumber$
|
|
21596
|
-
y: end.y + (isValidNumber$
|
|
21639
|
+
x: end.x + (isValidNumber$1(endAngle) ? refX * Math.cos(endAngle) + refY * Math.cos(endAngle - Math.PI / 2) : 0),
|
|
21640
|
+
y: end.y + (isValidNumber$1(endAngle) ? refX * Math.sin(endAngle) + refY * Math.sin(endAngle - Math.PI / 2) : 0)
|
|
21597
21641
|
}, rotate = this._computeEndRotate(this._endAngle)), symbol = graphicCreator.symbol(Object.assign(Object.assign(Object.assign({}, position), {
|
|
21598
21642
|
symbolType: symbolType,
|
|
21599
21643
|
size: size,
|
|
21600
21644
|
angle: autoRotate ? rotate + refAngle : 0,
|
|
21601
21645
|
strokeBoundsBuffer: 0
|
|
21602
|
-
}), style)), symbol.name = `${this.name}-${dim}-symbol`, symbol.id = this._getNodeId(`${dim}-symbol`), isEmpty
|
|
21646
|
+
}), 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);
|
|
21603
21647
|
}
|
|
21604
21648
|
return symbol;
|
|
21605
21649
|
}
|
|
@@ -21611,7 +21655,7 @@
|
|
|
21611
21655
|
mainSegmentIndex: mainSegmentIndex
|
|
21612
21656
|
} = this.attribute;
|
|
21613
21657
|
let points;
|
|
21614
|
-
return points = multiSegment ? isValidNumber$
|
|
21658
|
+
return points = multiSegment ? isValidNumber$1(mainSegmentIndex) ? originPoints[mainSegmentIndex] : flattenArray(originPoints) : originPoints, this._mainSegmentPoints = points, points;
|
|
21615
21659
|
}
|
|
21616
21660
|
_clipPoints(points) {
|
|
21617
21661
|
const {
|
|
@@ -21799,13 +21843,13 @@
|
|
|
21799
21843
|
const DELTA_ANGLE = Math.sin(Math.PI / 10);
|
|
21800
21844
|
function isAngleVertical(angle) {
|
|
21801
21845
|
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
21802
|
-
const hasAngle = !isNil$
|
|
21846
|
+
const hasAngle = !isNil$3(angle) && 0 !== angle,
|
|
21803
21847
|
cos = hasAngle ? Math.cos(angle) : 1;
|
|
21804
21848
|
return hasAngle && Math.abs(cos) <= delta;
|
|
21805
21849
|
}
|
|
21806
21850
|
function isAngleHorizontal(angle) {
|
|
21807
21851
|
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
21808
|
-
const hasAngle = !isNil$
|
|
21852
|
+
const hasAngle = !isNil$3(angle) && 0 !== angle,
|
|
21809
21853
|
sin = hasAngle ? Math.sin(angle) : 0;
|
|
21810
21854
|
return !hasAngle || Math.abs(sin) <= delta;
|
|
21811
21855
|
}
|
|
@@ -21823,7 +21867,7 @@
|
|
|
21823
21867
|
style = {},
|
|
21824
21868
|
angle = .5 * Math.PI
|
|
21825
21869
|
} = props,
|
|
21826
|
-
symbolStyle = merge$
|
|
21870
|
+
symbolStyle = merge$1({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style),
|
|
21827
21871
|
symbolSize = null !== (_a = symbolStyle.size) && void 0 !== _a ? _a : DEFAULT_AXIS_BREAK_SYMBOL_STYLE.size;
|
|
21828
21872
|
return Object.assign(Object.assign({}, symbolStyle), {
|
|
21829
21873
|
symbolType: null !== (_b = symbolStyle.symbolType) && void 0 !== _b ? _b : `M ${-symbolSize / 2} ${symbolSize * Math.sin(angle)} L ${symbolSize / 2} ${-symbolSize * Math.sin(angle)}`,
|
|
@@ -21870,19 +21914,19 @@
|
|
|
21870
21914
|
|
|
21871
21915
|
const dispatchHoverState = (e, container, lastHover) => {
|
|
21872
21916
|
const target = e.target;
|
|
21873
|
-
return target !== lastHover && target.name && !isEmpty
|
|
21874
|
-
node !== target && node.name && !isEmpty
|
|
21917
|
+
return target !== lastHover && target.name && !isEmpty(target.states) ? (target.addState(StateValue.hover, !0), traverseGroup(container, node => {
|
|
21918
|
+
node !== target && node.name && !isEmpty(node.states) && node.addState(StateValue.hoverReverse, !0);
|
|
21875
21919
|
}), target) : lastHover;
|
|
21876
21920
|
};
|
|
21877
21921
|
const dispatchUnHoverState = (e, container, lastHover) => lastHover ? (traverseGroup(container, node => {
|
|
21878
|
-
node.name && !isEmpty
|
|
21922
|
+
node.name && !isEmpty(node.states) && (node.removeState(StateValue.hoverReverse), node.removeState(StateValue.hover));
|
|
21879
21923
|
}), null) : lastHover;
|
|
21880
21924
|
const dispatchClickState = (e, container, lastSelect) => {
|
|
21881
21925
|
const target = e.target;
|
|
21882
21926
|
return lastSelect === target && target.hasState(StateValue.selected) ? (traverseGroup(container, node => {
|
|
21883
|
-
node.name && !isEmpty
|
|
21884
|
-
}), null) : target.name && !isEmpty
|
|
21885
|
-
node !== target && node.name && !isEmpty
|
|
21927
|
+
node.name && !isEmpty(node.states) && (node.removeState(StateValue.selectedReverse), node.removeState(StateValue.selected));
|
|
21928
|
+
}), null) : target.name && !isEmpty(target.states) ? (target.addState(StateValue.selected, !0), traverseGroup(container, node => {
|
|
21929
|
+
node !== target && node.name && !isEmpty(node.states) && node.addState(StateValue.selectedReverse, !0);
|
|
21886
21930
|
}), target) : lastSelect;
|
|
21887
21931
|
};
|
|
21888
21932
|
|
|
@@ -21903,8 +21947,8 @@
|
|
|
21903
21947
|
return this._prevInnerView;
|
|
21904
21948
|
}
|
|
21905
21949
|
getBoundsWithoutRender(attributes) {
|
|
21906
|
-
const currentAttribute = cloneDeep$
|
|
21907
|
-
merge$
|
|
21950
|
+
const currentAttribute = cloneDeep$1(this.attribute);
|
|
21951
|
+
merge$1(this.attribute, attributes);
|
|
21908
21952
|
const offscreenGroup = graphicCreator.group({
|
|
21909
21953
|
x: this.attribute.x,
|
|
21910
21954
|
y: this.attribute.y
|
|
@@ -21984,11 +22028,11 @@
|
|
|
21984
22028
|
tickLineGroup.name = AXIS_ELEMENT_NAME.tickContainer, tickLineGroup.id = this._getNodeId("tick-container"), container.add(tickLineGroup), tickLineItems.forEach((item, index) => {
|
|
21985
22029
|
var _a;
|
|
21986
22030
|
const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("tick", item, index, tickLineItems)));
|
|
21987
|
-
if (line.name = AXIS_ELEMENT_NAME.tick, line.id = this._getNodeId(item.id), isEmpty
|
|
22031
|
+
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 {
|
|
21988
22032
|
const data = this.data[index],
|
|
21989
|
-
tickLineState = merge$
|
|
22033
|
+
tickLineState = merge$1({}, DEFAULT_STATES$2, this.attribute.tick.state);
|
|
21990
22034
|
Object.keys(tickLineState).forEach(key => {
|
|
21991
|
-
isFunction$
|
|
22035
|
+
isFunction$5(tickLineState[key]) && (tickLineState[key] = tickLineState[key](data.rawValue, index, data, this.data));
|
|
21992
22036
|
}), line.states = tickLineState;
|
|
21993
22037
|
}
|
|
21994
22038
|
tickLineGroup.add(line);
|
|
@@ -22000,10 +22044,10 @@
|
|
|
22000
22044
|
const subTickLineItems = this.getSubTickLineItems();
|
|
22001
22045
|
subTickLineItems.length && subTickLineItems.forEach((item, index) => {
|
|
22002
22046
|
const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("subTick", item, index, tickLineItems)));
|
|
22003
|
-
if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty
|
|
22004
|
-
const subTickLineState = merge$
|
|
22047
|
+
if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty(subTick.state)) line.states = DEFAULT_STATES$2;else {
|
|
22048
|
+
const subTickLineState = merge$1({}, DEFAULT_STATES$2, subTick.state);
|
|
22005
22049
|
Object.keys(subTickLineState).forEach(key => {
|
|
22006
|
-
isFunction$
|
|
22050
|
+
isFunction$5(subTickLineState[key]) && (subTickLineState[key] = subTickLineState[key](item.value, index, item, tickLineItems));
|
|
22007
22051
|
}), line.states = subTickLineState;
|
|
22008
22052
|
}
|
|
22009
22053
|
tickLineGroup.add(line);
|
|
@@ -22014,7 +22058,7 @@
|
|
|
22014
22058
|
const {
|
|
22015
22059
|
dataFilter: dataFilter
|
|
22016
22060
|
} = this.attribute.label;
|
|
22017
|
-
dataFilter && isFunction$
|
|
22061
|
+
dataFilter && isFunction$5(dataFilter) && (items = dataFilter(items, layer));
|
|
22018
22062
|
const data = this._transformItems(items),
|
|
22019
22063
|
labelGroup = graphicCreator.group({
|
|
22020
22064
|
x: 0,
|
|
@@ -22025,10 +22069,10 @@
|
|
|
22025
22069
|
var _a;
|
|
22026
22070
|
const labelStyle = this._getLabelAttribute(item, index, data, layer),
|
|
22027
22071
|
text = createTextGraphicByType(labelStyle);
|
|
22028
|
-
if (text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty
|
|
22029
|
-
const labelState = merge$
|
|
22072
|
+
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 {
|
|
22073
|
+
const labelState = merge$1({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
22030
22074
|
Object.keys(labelState).forEach(key => {
|
|
22031
|
-
isFunction$
|
|
22075
|
+
isFunction$5(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
22032
22076
|
}), text.states = labelState;
|
|
22033
22077
|
}
|
|
22034
22078
|
text.data = Object.assign(Object.assign({}, item), {
|
|
@@ -22058,7 +22102,7 @@
|
|
|
22058
22102
|
dataFilter: dataFilter
|
|
22059
22103
|
} = tick;
|
|
22060
22104
|
let tickSegment = 1;
|
|
22061
|
-
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$
|
|
22105
|
+
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$5(dataFilter) ? dataFilter(data) : data).forEach(item => {
|
|
22062
22106
|
let point = item.point,
|
|
22063
22107
|
tickValue = item.value;
|
|
22064
22108
|
if (!alignWithLabel) {
|
|
@@ -22119,9 +22163,9 @@
|
|
|
22119
22163
|
return subTickLineItems;
|
|
22120
22164
|
}
|
|
22121
22165
|
_getTickLineAttribute(type, tickItem, index, tickItems) {
|
|
22122
|
-
let style = get$
|
|
22166
|
+
let style = get$7(this.attribute, `${type}.style`);
|
|
22123
22167
|
const data = this.data[index];
|
|
22124
|
-
style = isFunction$
|
|
22168
|
+
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;
|
|
22125
22169
|
const {
|
|
22126
22170
|
start: start,
|
|
22127
22171
|
end: end,
|
|
@@ -22149,16 +22193,16 @@
|
|
|
22149
22193
|
tickLength = 0;
|
|
22150
22194
|
(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;
|
|
22151
22195
|
const axisVector = this.getRelativeVector(tickDatum.point);
|
|
22152
|
-
layer > 0 && (0 === axisVector[1] ? offset += (this.axisLabelLayerSize[layer - 1].height + get$
|
|
22196
|
+
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);
|
|
22153
22197
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside),
|
|
22154
22198
|
vector = this.getVerticalVector(offset || 1, inside, point),
|
|
22155
22199
|
textContent = formatMethod ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer) : tickDatum.label;
|
|
22156
22200
|
let {
|
|
22157
22201
|
style: textStyle
|
|
22158
22202
|
} = this.attribute.label;
|
|
22159
|
-
textStyle = isFunction$
|
|
22203
|
+
textStyle = isFunction$5(textStyle) ? merge$1({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
22160
22204
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
22161
|
-
return textStyle = merge$
|
|
22205
|
+
return textStyle = merge$1(labelAlign, textStyle), isFunction$5(textStyle.text) && (textStyle.text = textStyle.text({
|
|
22162
22206
|
label: tickDatum.label,
|
|
22163
22207
|
value: tickDatum.rawValue,
|
|
22164
22208
|
index: tickDatum.index,
|
|
@@ -22219,16 +22263,16 @@
|
|
|
22219
22263
|
}
|
|
22220
22264
|
}
|
|
22221
22265
|
function autoHide(labels, config) {
|
|
22222
|
-
if (isEmpty
|
|
22266
|
+
if (isEmpty(labels)) return;
|
|
22223
22267
|
const source = labels.filter(hasBounds);
|
|
22224
|
-
if (isEmpty
|
|
22268
|
+
if (isEmpty(source)) return;
|
|
22225
22269
|
let items;
|
|
22226
22270
|
items = reset(source);
|
|
22227
22271
|
const {
|
|
22228
22272
|
method = "parity",
|
|
22229
22273
|
separation: sep = 0
|
|
22230
22274
|
} = config,
|
|
22231
|
-
reduce = isFunction$
|
|
22275
|
+
reduce = isFunction$5(method) ? method : methods$1[method] || methods$1.parity;
|
|
22232
22276
|
if (items.length >= 3 && hasOverlap(items, sep)) {
|
|
22233
22277
|
do {
|
|
22234
22278
|
items = reduce(items, sep);
|
|
@@ -22240,7 +22284,7 @@
|
|
|
22240
22284
|
checkFirst = shouldCheck(items.length, config.firstVisible, !1);
|
|
22241
22285
|
let checkLast = shouldCheck(items.length, config.lastVisible);
|
|
22242
22286
|
const firstSourceItem = source[0],
|
|
22243
|
-
lastSourceItem = last
|
|
22287
|
+
lastSourceItem = last(source);
|
|
22244
22288
|
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);
|
|
22245
22289
|
}
|
|
22246
22290
|
source.forEach(item => {
|
|
@@ -22249,7 +22293,7 @@
|
|
|
22249
22293
|
}
|
|
22250
22294
|
|
|
22251
22295
|
function autoRotate(items, rotateConfig) {
|
|
22252
|
-
if (isEmpty
|
|
22296
|
+
if (isEmpty(items)) return;
|
|
22253
22297
|
const {
|
|
22254
22298
|
orient: orient,
|
|
22255
22299
|
labelRotateAngle = [0, 45, 90]
|
|
@@ -22260,7 +22304,7 @@
|
|
|
22260
22304
|
for (labelRotateAngle && labelRotateAngle.length > 0 && (n = labelRotateAngle.length); i < n;) {
|
|
22261
22305
|
const angle = labelRotateAngle[i++];
|
|
22262
22306
|
if (items.forEach(item => {
|
|
22263
|
-
item.attribute.angle = degreeToRadian
|
|
22307
|
+
item.attribute.angle = degreeToRadian(angle);
|
|
22264
22308
|
}), tryRotate(orient, items), !hasIntersect(items)) break;
|
|
22265
22309
|
}
|
|
22266
22310
|
}
|
|
@@ -22317,10 +22361,10 @@
|
|
|
22317
22361
|
}
|
|
22318
22362
|
|
|
22319
22363
|
function normalizeOverflowLimitLength(overflowLimitLength) {
|
|
22320
|
-
return isValidNumber$
|
|
22364
|
+
return isValidNumber$1(overflowLimitLength) ? {
|
|
22321
22365
|
left: overflowLimitLength,
|
|
22322
22366
|
right: overflowLimitLength
|
|
22323
|
-
} : isObject$
|
|
22367
|
+
} : isObject$7(overflowLimitLength) ? {
|
|
22324
22368
|
left: overflowLimitLength.left || 0,
|
|
22325
22369
|
right: overflowLimitLength.right || 0
|
|
22326
22370
|
} : {
|
|
@@ -22336,11 +22380,11 @@
|
|
|
22336
22380
|
orient: orient,
|
|
22337
22381
|
axisLength: axisLength
|
|
22338
22382
|
} = config;
|
|
22339
|
-
if (isEmpty
|
|
22383
|
+
if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
|
|
22340
22384
|
const overflowLimitLength = normalizeOverflowLimitLength(config.overflowLimitLength),
|
|
22341
22385
|
firstLabel = labels[0],
|
|
22342
22386
|
angle = firstLabel.attribute.angle,
|
|
22343
|
-
hasAngle = !isNil$
|
|
22387
|
+
hasAngle = !isNil$3(angle),
|
|
22344
22388
|
cos = hasAngle ? Math.cos(angle) : 1,
|
|
22345
22389
|
sin = hasAngle ? Math.sin(angle) : 0,
|
|
22346
22390
|
isHorizontal = isAngleHorizontal(angle),
|
|
@@ -22377,7 +22421,7 @@
|
|
|
22377
22421
|
limitLabelLength = Math.min(lengthLimit, verticalSizeLimit);
|
|
22378
22422
|
} else limitLabelLength = verticalSizeLimit;
|
|
22379
22423
|
} else limitLabelLength = Math.abs(limitLength / cos);
|
|
22380
|
-
isValidNumber$
|
|
22424
|
+
isValidNumber$1(label.attribute.maxLineWidth) && (limitLabelLength = isValidNumber$1(limitLabelLength) ? Math.min(label.attribute.maxLineWidth, limitLabelLength) : label.attribute.maxLineWidth), label.setAttributes({
|
|
22381
22425
|
maxLineWidth: limitLabelLength,
|
|
22382
22426
|
ellipsis: null !== (_a = label.attribute.ellipsis) && void 0 !== _a ? _a : ellipsis
|
|
22383
22427
|
});
|
|
@@ -22391,7 +22435,7 @@
|
|
|
22391
22435
|
ellipsis = "...",
|
|
22392
22436
|
orient: orient
|
|
22393
22437
|
} = config;
|
|
22394
|
-
if (isEmpty
|
|
22438
|
+
if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
|
|
22395
22439
|
const angle = labels[0].attribute.angle,
|
|
22396
22440
|
isHorizontal = isAngleHorizontal(angle),
|
|
22397
22441
|
isVertical = isAngleVertical(angle),
|
|
@@ -22403,12 +22447,12 @@
|
|
|
22403
22447
|
if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) return;
|
|
22404
22448
|
if (isHorizontal) {
|
|
22405
22449
|
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);
|
|
22406
|
-
isValidNumber$
|
|
22450
|
+
isValidNumber$1(minGap) && (verticalLimitLength = min$1(verticalLimitLength, minGap));
|
|
22407
22451
|
}
|
|
22408
22452
|
} else {
|
|
22409
22453
|
if (isVertical) {
|
|
22410
22454
|
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);
|
|
22411
|
-
isValidNumber$
|
|
22455
|
+
isValidNumber$1(minGap) && (verticalLimitLength = min$1(verticalLimitLength, minGap));
|
|
22412
22456
|
}
|
|
22413
22457
|
if (isHorizontal && Math.floor(label.AABBBounds.width()) <= limitLength) return;
|
|
22414
22458
|
}
|
|
@@ -22424,7 +22468,7 @@
|
|
|
22424
22468
|
}
|
|
22425
22469
|
function getLabelMinGap(current, next, prev) {
|
|
22426
22470
|
let minGap;
|
|
22427
|
-
return isValidNumber$
|
|
22471
|
+
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;
|
|
22428
22472
|
}
|
|
22429
22473
|
|
|
22430
22474
|
function alignAxisLabels(labels, start, containerSize, orient, align) {
|
|
@@ -22513,7 +22557,7 @@
|
|
|
22513
22557
|
loadLineAxisComponent();
|
|
22514
22558
|
class LineAxis extends AxisBase {
|
|
22515
22559
|
constructor(attributes, options) {
|
|
22516
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
22560
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, LineAxis.defaultAttributes, attributes), options);
|
|
22517
22561
|
}
|
|
22518
22562
|
_renderInner(container) {
|
|
22519
22563
|
var _a;
|
|
@@ -22573,7 +22617,7 @@
|
|
|
22573
22617
|
width: axisContainerBounds.width(),
|
|
22574
22618
|
height: axisContainerBounds.height()
|
|
22575
22619
|
}, panel.style));
|
|
22576
|
-
bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge$
|
|
22620
|
+
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);
|
|
22577
22621
|
}
|
|
22578
22622
|
}
|
|
22579
22623
|
renderLine(container) {
|
|
@@ -22606,9 +22650,9 @@
|
|
|
22606
22650
|
linePoints.push([lastStartPoint, startPoint]), lastStartPoint = endPoint;
|
|
22607
22651
|
}), linePoints.push([lastStartPoint, end]), lineAttrs.points = linePoints, lineAttrs.multiSegment = !0;
|
|
22608
22652
|
} else lineAttrs.points = [start, end];
|
|
22609
|
-
isEmpty
|
|
22610
|
-
line: merge$
|
|
22611
|
-
symbol: merge$
|
|
22653
|
+
isEmpty(state) || (lineAttrs.state = {
|
|
22654
|
+
line: merge$1({}, DEFAULT_STATES$1, state),
|
|
22655
|
+
symbol: merge$1({}, DEFAULT_STATES$1, state)
|
|
22612
22656
|
});
|
|
22613
22657
|
const axisLineGroup = new Segment(lineAttrs);
|
|
22614
22658
|
axisLineGroup.name = AXIS_ELEMENT_NAME.line, axisLineGroup.id = this._getNodeId("line"), container.add(axisLineGroup);
|
|
@@ -22641,7 +22685,7 @@
|
|
|
22641
22685
|
axisVector = this.getRelativeVector();
|
|
22642
22686
|
let labelLength = 0;
|
|
22643
22687
|
if ((null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.label.inside) {
|
|
22644
|
-
const space = +get$
|
|
22688
|
+
const space = +get$7(this.attribute, "label.space", 4);
|
|
22645
22689
|
labelLength += space;
|
|
22646
22690
|
const layerCount = Object.keys(this.axisLabelLayerSize).length;
|
|
22647
22691
|
if (0 === axisVector[1]) {
|
|
@@ -22670,7 +22714,7 @@
|
|
|
22670
22714
|
{
|
|
22671
22715
|
angle: angle
|
|
22672
22716
|
} = restAttrs;
|
|
22673
|
-
if (textAlign = "start" === position ? "start" : "end" === position ? "end" : "center", isNil$
|
|
22717
|
+
if (textAlign = "start" === position ? "start" : "end" === position ? "end" : "center", isNil$3(angle) && autoRotate) {
|
|
22674
22718
|
angle = angleTo(axisVector, [1, 0], !0);
|
|
22675
22719
|
const {
|
|
22676
22720
|
verticalFactor = 1
|
|
@@ -22678,14 +22722,14 @@
|
|
|
22678
22722
|
textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
|
|
22679
22723
|
} else textAlign = this.getTextAlign(vector), textBaseline = this.getTextBaseline(vector, !1);
|
|
22680
22724
|
let maxTagWidth = maxWidth;
|
|
22681
|
-
if (isNil$
|
|
22725
|
+
if (isNil$3(maxTagWidth)) {
|
|
22682
22726
|
const {
|
|
22683
22727
|
verticalLimitSize: verticalLimitSize,
|
|
22684
22728
|
verticalMinSize: verticalMinSize,
|
|
22685
22729
|
orient: orient
|
|
22686
22730
|
} = this.attribute,
|
|
22687
22731
|
limitSize = Math.min(verticalLimitSize || 1 / 0, verticalMinSize || 1 / 0);
|
|
22688
|
-
if (isValidNumber$
|
|
22732
|
+
if (isValidNumber$1(limitSize)) {
|
|
22689
22733
|
if ("bottom" === orient || "top" === orient) {
|
|
22690
22734
|
if (angle !== Math.PI / 2) {
|
|
22691
22735
|
const cosValue = Math.abs(Math.cos(null != angle ? angle : 0));
|
|
@@ -22704,9 +22748,9 @@
|
|
|
22704
22748
|
textBaseline: textBaseline
|
|
22705
22749
|
}, textStyle),
|
|
22706
22750
|
state: {
|
|
22707
|
-
text: merge$
|
|
22708
|
-
shape: merge$
|
|
22709
|
-
panel: merge$
|
|
22751
|
+
text: merge$1({}, DEFAULT_STATES$1, state.text),
|
|
22752
|
+
shape: merge$1({}, DEFAULT_STATES$1, state.shape),
|
|
22753
|
+
panel: merge$1({}, DEFAULT_STATES$1, state.background)
|
|
22710
22754
|
}
|
|
22711
22755
|
});
|
|
22712
22756
|
return attrs.angle = angle, shape && shape.visible && (attrs.shape = Object.assign({
|
|
@@ -22747,11 +22791,11 @@
|
|
|
22747
22791
|
} = this.attribute,
|
|
22748
22792
|
isX = "bottom" === orient || "top" === orient,
|
|
22749
22793
|
first = labelShapes[0],
|
|
22750
|
-
last = last
|
|
22751
|
-
isInverse = isX ? first.attribute.x > last.attribute.x : first.attribute.y < last.attribute.y;
|
|
22794
|
+
last$1 = last(labelShapes),
|
|
22795
|
+
isInverse = isX ? first.attribute.x > last$1.attribute.x : first.attribute.y < last$1.attribute.y;
|
|
22752
22796
|
if (isX) {
|
|
22753
|
-
const leftMostLabel = isInverse ? last : first,
|
|
22754
|
-
rightMostLabel = isInverse ? first : last,
|
|
22797
|
+
const leftMostLabel = isInverse ? last$1 : first,
|
|
22798
|
+
rightMostLabel = isInverse ? first : last$1,
|
|
22755
22799
|
left = axisStart.x,
|
|
22756
22800
|
right = axisEnd.x,
|
|
22757
22801
|
leftBound = leftMostLabel.AABBBounds.x1,
|
|
@@ -22773,8 +22817,8 @@
|
|
|
22773
22817
|
});
|
|
22774
22818
|
}
|
|
22775
22819
|
} else {
|
|
22776
|
-
const bottomMostLabel = isInverse ? last : first,
|
|
22777
|
-
topMostLabel = isInverse ? first : last,
|
|
22820
|
+
const bottomMostLabel = isInverse ? last$1 : first,
|
|
22821
|
+
topMostLabel = isInverse ? first : last$1,
|
|
22778
22822
|
bottomBound = bottomMostLabel.AABBBounds.y2,
|
|
22779
22823
|
topBound = topMostLabel.AABBBounds.y1,
|
|
22780
22824
|
top = axisStart.y,
|
|
@@ -22799,7 +22843,7 @@
|
|
|
22799
22843
|
}
|
|
22800
22844
|
}
|
|
22801
22845
|
handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
22802
|
-
if (isEmpty
|
|
22846
|
+
if (isEmpty(labelShapes)) return;
|
|
22803
22847
|
const {
|
|
22804
22848
|
verticalLimitSize: verticalLimitSize,
|
|
22805
22849
|
label: label,
|
|
@@ -22820,7 +22864,7 @@
|
|
|
22820
22864
|
autoWrap: autoWrap$1,
|
|
22821
22865
|
overflowLimitLength: overflowLimitLength
|
|
22822
22866
|
} = label;
|
|
22823
|
-
if (isFunction$
|
|
22867
|
+
if (isFunction$5(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
22824
22868
|
if (autoRotate$1) autoRotate(labelShapes, {
|
|
22825
22869
|
labelRotateAngle: autoRotateAngle,
|
|
22826
22870
|
orient: orient
|
|
@@ -22833,7 +22877,7 @@
|
|
|
22833
22877
|
ellipsis: limitEllipsis
|
|
22834
22878
|
});
|
|
22835
22879
|
}
|
|
22836
|
-
if (!autoWrap$1 && autoLimit$1 && isValidNumber$
|
|
22880
|
+
if (!autoWrap$1 && autoLimit$1 && isValidNumber$1(limitLength) && limitLength > 0) {
|
|
22837
22881
|
const isVertical = "left" === orient || "right" === orient,
|
|
22838
22882
|
axisLength = isVertical ? Math.abs(this.attribute.start.y - this.attribute.end.y) : Math.abs(this.attribute.start.x - this.attribute.end.x),
|
|
22839
22883
|
verticalLimitLength = isVertical ? axisLength / labelShapes.length : autoHide$1 || autoRotate$1 ? 1 / 0 : axisLength / labelShapes.length;
|
|
@@ -22866,7 +22910,7 @@
|
|
|
22866
22910
|
const {
|
|
22867
22911
|
verticalMinSize: verticalMinSize
|
|
22868
22912
|
} = this.attribute;
|
|
22869
|
-
if (isValidNumber$
|
|
22913
|
+
if (isValidNumber$1(verticalMinSize) && (!isValidNumber$1(verticalLimitSize) || verticalMinSize <= verticalLimitSize)) {
|
|
22870
22914
|
const minSize = this._getAxisLabelLimitLength(verticalMinSize, layerCount);
|
|
22871
22915
|
let x, y;
|
|
22872
22916
|
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);
|
|
@@ -22879,7 +22923,7 @@
|
|
|
22879
22923
|
});
|
|
22880
22924
|
bgRect.name = AXIS_ELEMENT_NAME.axisLabelBackground, bgRect.id = this._getNodeId("axis-label-background"), labelContainer.insertBefore(bgRect, labelContainer.firstChild);
|
|
22881
22925
|
}
|
|
22882
|
-
if (isValid$
|
|
22926
|
+
if (isValid$3(this.attribute.label.containerAlign)) {
|
|
22883
22927
|
let start;
|
|
22884
22928
|
"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);
|
|
22885
22929
|
}
|
|
@@ -22917,8 +22961,8 @@
|
|
|
22917
22961
|
}));
|
|
22918
22962
|
const labelOverlap = function (prevLabel, nextLabel) {
|
|
22919
22963
|
let gap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
22920
|
-
const prevBounds = new AABBBounds
|
|
22921
|
-
nextBounds = new AABBBounds
|
|
22964
|
+
const prevBounds = new AABBBounds(prevLabel).expand(gap / 2),
|
|
22965
|
+
nextBounds = new AABBBounds(nextLabel).expand(gap / 2);
|
|
22922
22966
|
return prevBounds.intersects(nextBounds);
|
|
22923
22967
|
};
|
|
22924
22968
|
const MIN_TICK_GAP = 12;
|
|
@@ -22933,7 +22977,7 @@
|
|
|
22933
22977
|
startAngle = 0
|
|
22934
22978
|
} = op;
|
|
22935
22979
|
let labelAngle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0;
|
|
22936
|
-
"vertical" === labelStyle.direction && (labelAngle += degreeToRadian
|
|
22980
|
+
"vertical" === labelStyle.direction && (labelAngle += degreeToRadian(90));
|
|
22937
22981
|
const isHorizontal = ["bottom", "top"].includes(axisOrientType),
|
|
22938
22982
|
isVertical = ["left", "right"].includes(axisOrientType);
|
|
22939
22983
|
let scaleX = 1,
|
|
@@ -22958,7 +23002,7 @@
|
|
|
22958
23002
|
textX = baseTextX,
|
|
22959
23003
|
textY = baseTextY;
|
|
22960
23004
|
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);
|
|
22961
|
-
const bounds = new AABBBounds
|
|
23005
|
+
const bounds = new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight);
|
|
22962
23006
|
return labelAngle && bounds.rotate(labelAngle, baseTextX, baseTextY), bounds;
|
|
22963
23007
|
});
|
|
22964
23008
|
return labelBoundsList;
|
|
@@ -23033,18 +23077,18 @@
|
|
|
23033
23077
|
this._rangeFactorStart = null, this._rangeFactorEnd = null;
|
|
23034
23078
|
}
|
|
23035
23079
|
_calculateWholeRange(range) {
|
|
23036
|
-
return this._wholeRange ? this._wholeRange : isValid$
|
|
23080
|
+
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;
|
|
23037
23081
|
}
|
|
23038
23082
|
rangeFactor(_, slience, clear) {
|
|
23039
|
-
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$
|
|
23083
|
+
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;
|
|
23040
23084
|
}
|
|
23041
23085
|
rangeFactorStart(_, slience) {
|
|
23042
23086
|
var _a;
|
|
23043
|
-
return isNil$
|
|
23087
|
+
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);
|
|
23044
23088
|
}
|
|
23045
23089
|
rangeFactorEnd(_, slience) {
|
|
23046
23090
|
var _a;
|
|
23047
|
-
return isNil$
|
|
23091
|
+
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);
|
|
23048
23092
|
}
|
|
23049
23093
|
generateFishEyeTransform() {
|
|
23050
23094
|
var _a;
|
|
@@ -23060,7 +23104,7 @@
|
|
|
23060
23104
|
min = Math.min(first, last),
|
|
23061
23105
|
max = Math.max(first, last),
|
|
23062
23106
|
focus = clamp$3(null !== (_a = this._fishEyeOptions.focus) && void 0 !== _a ? _a : 0, min, max),
|
|
23063
|
-
rangeRadius = isNil$
|
|
23107
|
+
rangeRadius = isNil$3(radius) ? (max - min) * radiusRatio : radius;
|
|
23064
23108
|
let k0 = Math.exp(distortion);
|
|
23065
23109
|
k0 = k0 / (k0 - 1) * rangeRadius;
|
|
23066
23110
|
const k1 = distortion / rangeRadius;
|
|
@@ -23087,7 +23131,7 @@
|
|
|
23087
23131
|
function interpolate$1(a, b) {
|
|
23088
23132
|
const t = typeof b;
|
|
23089
23133
|
let c;
|
|
23090
|
-
if (isNil$
|
|
23134
|
+
if (isNil$3(b) || "boolean" === t) return () => b;
|
|
23091
23135
|
if ("number" === t) return interpolateNumber$1(a, b);
|
|
23092
23136
|
if ("string" === t) {
|
|
23093
23137
|
if (c = Color$1.parseColorString(b)) {
|
|
@@ -23107,7 +23151,7 @@
|
|
|
23107
23151
|
}
|
|
23108
23152
|
calculateVisibleDomain(range) {
|
|
23109
23153
|
var _a;
|
|
23110
|
-
if (isValid$
|
|
23154
|
+
if (isValid$3(this._rangeFactorStart) && isValid$3(this._rangeFactorEnd) && 2 === range.length) {
|
|
23111
23155
|
return [this.invert(range[0]), this.invert(range[1])];
|
|
23112
23156
|
}
|
|
23113
23157
|
return null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain;
|
|
@@ -23180,10 +23224,10 @@
|
|
|
23180
23224
|
return _ ? (super.rangeFactor(_), this._output = this._input = null, this) : super.rangeFactor();
|
|
23181
23225
|
}
|
|
23182
23226
|
rangeFactorStart(_, slience) {
|
|
23183
|
-
return isNil$
|
|
23227
|
+
return isNil$3(_) ? super.rangeFactorStart() : (super.rangeFactorStart(_), this._output = this._input = null, this);
|
|
23184
23228
|
}
|
|
23185
23229
|
rangeFactorEnd(_, slience) {
|
|
23186
|
-
return isNil$
|
|
23230
|
+
return isNil$3(_) ? super.rangeFactorEnd() : (super.rangeFactorEnd(_), this._output = this._input = null, this);
|
|
23187
23231
|
}
|
|
23188
23232
|
forceAlignDomainRange(forceAlign) {
|
|
23189
23233
|
return arguments.length ? (this._forceAlign = forceAlign, this) : this._forceAlign;
|
|
@@ -23341,13 +23385,13 @@
|
|
|
23341
23385
|
}
|
|
23342
23386
|
}
|
|
23343
23387
|
function parseNiceOptions$1(originalDomain, option) {
|
|
23344
|
-
const hasForceMin = isNumber$
|
|
23345
|
-
hasForceMax = isNumber$
|
|
23388
|
+
const hasForceMin = isNumber$4(option.forceMin),
|
|
23389
|
+
hasForceMax = isNumber$4(option.forceMax);
|
|
23346
23390
|
let niceType = null;
|
|
23347
23391
|
const niceMinMax = [];
|
|
23348
23392
|
let niceDomain = null;
|
|
23349
23393
|
const domainValidator = hasForceMin && hasForceMax ? x => x >= option.forceMin && x <= option.forceMax : hasForceMin ? x => x >= option.forceMin : hasForceMax ? x => x <= option.forceMax : null;
|
|
23350
|
-
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$
|
|
23394
|
+
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", {
|
|
23351
23395
|
niceType: niceType,
|
|
23352
23396
|
niceDomain: niceDomain,
|
|
23353
23397
|
niceMinMax: niceMinMax,
|
|
@@ -23375,8 +23419,8 @@
|
|
|
23375
23419
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
23376
23420
|
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
23377
23421
|
var _a;
|
|
23378
|
-
if (isFunction$
|
|
23379
|
-
if (isValid$
|
|
23422
|
+
if (isFunction$5(null == options ? void 0 : options.customTicks)) return options.customTicks(this, count);
|
|
23423
|
+
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);
|
|
23380
23424
|
const curNiceDomain = null !== (_a = this._niceDomain) && void 0 !== _a ? _a : this._domain,
|
|
23381
23425
|
originalDomain = this._domain,
|
|
23382
23426
|
start = curNiceDomain[0],
|
|
@@ -23483,8 +23527,8 @@
|
|
|
23483
23527
|
breakData: breakData
|
|
23484
23528
|
} = op;
|
|
23485
23529
|
let scaleTicks;
|
|
23486
|
-
if (isValid$
|
|
23487
|
-
const count = null !== (_a = isFunction$
|
|
23530
|
+
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) {
|
|
23531
|
+
const count = null !== (_a = isFunction$5(tickCount) ? tickCount({
|
|
23488
23532
|
axisLength: rangeSize,
|
|
23489
23533
|
labelStyle: labelStyle
|
|
23490
23534
|
}) : tickCount) && void 0 !== _a ? _a : 5;
|
|
@@ -23494,11 +23538,11 @@
|
|
|
23494
23538
|
noDecimals: noDecimals
|
|
23495
23539
|
}));
|
|
23496
23540
|
} else {
|
|
23497
|
-
const count = null !== (_b = isFunction$
|
|
23541
|
+
const count = null !== (_b = isFunction$5(tickCount) ? tickCount({
|
|
23498
23542
|
axisLength: rangeSize,
|
|
23499
23543
|
labelStyle: labelStyle
|
|
23500
23544
|
}) : tickCount) && void 0 !== _b ? _b : 5,
|
|
23501
|
-
customTicks = isFunction$
|
|
23545
|
+
customTicks = isFunction$5(op.tickMode) ? op.tickMode : void 0;
|
|
23502
23546
|
scaleTicks = getScaleTicks(op, scale, count, (count, subDomain) => subDomain && subDomain.length ? scale.domain(subDomain, !0).ticks(count, {
|
|
23503
23547
|
noDecimals: noDecimals,
|
|
23504
23548
|
customTicks: customTicks
|
|
@@ -23530,14 +23574,14 @@
|
|
|
23530
23574
|
value: scaleTicks[i]
|
|
23531
23575
|
}));
|
|
23532
23576
|
const firstSourceItem = items[0],
|
|
23533
|
-
lastSourceItem = last
|
|
23577
|
+
lastSourceItem = last(items),
|
|
23534
23578
|
samplingMethod = breakData && breakData() ? methods.greedy : methods.parity;
|
|
23535
23579
|
for (; items.length >= 3 && hasOverlap(items, labelGap);) items = samplingMethod(items, labelGap);
|
|
23536
23580
|
const checkFirst = op.labelFirstVisible;
|
|
23537
23581
|
let checkLast = op.labelLastVisible;
|
|
23538
23582
|
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);
|
|
23539
23583
|
const ticks = items.map(item => item.value);
|
|
23540
|
-
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last
|
|
23584
|
+
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
|
|
23541
23585
|
}
|
|
23542
23586
|
return convertDomainToTickData(scaleTicks);
|
|
23543
23587
|
};
|
|
@@ -23574,16 +23618,16 @@
|
|
|
23574
23618
|
rangeSize = scale.calculateWholeRangeSize();
|
|
23575
23619
|
if (rangeSize < 2) return op.labelLastVisible ? convertDomainToTickData([domain[domain.length - 1]]) : convertDomainToTickData([domain[0]]);
|
|
23576
23620
|
let scaleTicks;
|
|
23577
|
-
if (isValid$
|
|
23578
|
-
const count = isFunction$
|
|
23621
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
23622
|
+
const count = isFunction$5(tickCount) ? tickCount({
|
|
23579
23623
|
axisLength: rangeSize,
|
|
23580
23624
|
labelStyle: labelStyle
|
|
23581
23625
|
}) : tickCount;
|
|
23582
23626
|
scaleTicks = scale.ticks(count);
|
|
23583
23627
|
} else if (op.sampling) {
|
|
23584
23628
|
const fontSize = (null !== (_a = op.labelStyle.fontSize) && void 0 !== _a ? _a : 12) + 2,
|
|
23585
|
-
rangeStart = minInArray
|
|
23586
|
-
rangeEnd = maxInArray
|
|
23629
|
+
rangeStart = minInArray(range),
|
|
23630
|
+
rangeEnd = maxInArray(range);
|
|
23587
23631
|
if (domain.length <= rangeSize / fontSize) {
|
|
23588
23632
|
const incrementUnit = (rangeEnd - rangeStart) / domain.length,
|
|
23589
23633
|
labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal),
|
|
@@ -23694,7 +23738,7 @@
|
|
|
23694
23738
|
y: y
|
|
23695
23739
|
} = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside);
|
|
23696
23740
|
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);
|
|
23697
|
-
return new AABBBounds
|
|
23741
|
+
return new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight).rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
|
|
23698
23742
|
});
|
|
23699
23743
|
};
|
|
23700
23744
|
const polarAngleAxisDiscreteTicks = (scale, op) => {
|
|
@@ -23710,10 +23754,10 @@
|
|
|
23710
23754
|
radius = null == getRadius ? void 0 : getRadius();
|
|
23711
23755
|
if (!radius) return convertDomainToTickData(scale.domain());
|
|
23712
23756
|
let scaleTicks;
|
|
23713
|
-
if (isValid$
|
|
23757
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
23714
23758
|
const range = scale.range(),
|
|
23715
23759
|
rangeSize = Math.abs(range[range.length - 1] - range[0]),
|
|
23716
|
-
count = isFunction$
|
|
23760
|
+
count = isFunction$5(tickCount) ? tickCount({
|
|
23717
23761
|
axisLength: rangeSize,
|
|
23718
23762
|
labelStyle: labelStyle
|
|
23719
23763
|
}) : tickCount;
|
|
@@ -23722,8 +23766,8 @@
|
|
|
23722
23766
|
const domain = scale.domain(),
|
|
23723
23767
|
range = scale.range(),
|
|
23724
23768
|
labelBoundsList = getPolarAngleLabelBounds(scale, domain, op),
|
|
23725
|
-
rangeStart = minInArray
|
|
23726
|
-
rangeEnd = maxInArray
|
|
23769
|
+
rangeStart = minInArray(range),
|
|
23770
|
+
rangeEnd = maxInArray(range),
|
|
23727
23771
|
incrementUnit = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset) / domain.length,
|
|
23728
23772
|
{
|
|
23729
23773
|
step: step,
|
|
@@ -23789,7 +23833,7 @@
|
|
|
23789
23833
|
return this._current;
|
|
23790
23834
|
}
|
|
23791
23835
|
constructor(attributes, options) {
|
|
23792
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
23836
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Pager.defaultAttributes, attributes)), this.name = "pager", this._current = 1, this._onHover = e => {
|
|
23793
23837
|
const target = e.target;
|
|
23794
23838
|
target.hasState("disable") || target.addState("hover");
|
|
23795
23839
|
}, this._onUnHover = e => {
|
|
@@ -23861,8 +23905,8 @@
|
|
|
23861
23905
|
textAlign: "center",
|
|
23862
23906
|
textBaseline: "middle"
|
|
23863
23907
|
}, textStyle), null === (_c = null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme()) || void 0 === _c ? void 0 : _c.text),
|
|
23864
|
-
handlerSizeX = isNumber$
|
|
23865
|
-
handlerSizeY = isNumber$
|
|
23908
|
+
handlerSizeX = isNumber$4(handlerSize) ? handlerSize : handlerSize[0],
|
|
23909
|
+
handlerSizeY = isNumber$4(handlerSize) ? handlerSize : handlerSize[1],
|
|
23866
23910
|
text = graphicCreator.text(Object.assign({
|
|
23867
23911
|
x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
|
|
23868
23912
|
y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
|
|
@@ -23897,7 +23941,7 @@
|
|
|
23897
23941
|
const {
|
|
23898
23942
|
pageFormatter: pageFormatter
|
|
23899
23943
|
} = this.attribute;
|
|
23900
|
-
return pageFormatter ? isFunction$
|
|
23944
|
+
return pageFormatter ? isFunction$5(pageFormatter) ? pageFormatter(current, this._total) : `${pageFormatter}`.replace("{current}", `${current}`).replace("{total}", `${this._total}`) : `${current}/${this._total}`;
|
|
23901
23945
|
}
|
|
23902
23946
|
setTotal(total) {
|
|
23903
23947
|
total !== this.attribute.total && (this._total = total, 1 !== this._current && this._current <= total ? this.setAttributes({
|
|
@@ -23978,7 +24022,7 @@
|
|
|
23978
24022
|
};
|
|
23979
24023
|
shape && shape.visible && (tagAttrs.shape = Object.assign({
|
|
23980
24024
|
visible: !0
|
|
23981
|
-
}, shape.style), isValid$
|
|
24025
|
+
}, shape.style), isValid$3(shape.space) && (tagAttrs.space = shape.space)), background && background.visible && (tagAttrs.panel = Object.assign({
|
|
23982
24026
|
visible: !0
|
|
23983
24027
|
}, background.style));
|
|
23984
24028
|
const titleTag = new Tag(tagAttrs);
|
|
@@ -24031,7 +24075,7 @@
|
|
|
24031
24075
|
loadDiscreteLegendComponent();
|
|
24032
24076
|
class DiscreteLegend extends LegendBase {
|
|
24033
24077
|
constructor(attributes, options) {
|
|
24034
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
24078
|
+
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 => {
|
|
24035
24079
|
const target = e.target;
|
|
24036
24080
|
if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
24037
24081
|
const legendItem = target.delegate;
|
|
@@ -24126,18 +24170,18 @@
|
|
|
24126
24170
|
for (let index = startIndex, len = legendItems.length; index < len && !(lazyload && pages > this._itemContext.currentPage * maxPages); index++) {
|
|
24127
24171
|
lazyload && (this._itemContext.startIndex = index + 1), item = legendItems[index], item.id || (item.id = item.label), item.index = index;
|
|
24128
24172
|
let isSelected = !0;
|
|
24129
|
-
isArray$
|
|
24173
|
+
isArray$7(defaultSelected) && (isSelected = defaultSelected.includes(item.label));
|
|
24130
24174
|
const itemGroup = this._renderEachItem(item, isSelected, index, legendItems),
|
|
24131
24175
|
itemWidth = itemGroup.attribute.width,
|
|
24132
24176
|
itemHeight = itemGroup.attribute.height;
|
|
24133
|
-
this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (isValid$
|
|
24177
|
+
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 => {
|
|
24134
24178
|
i.setAttributes({
|
|
24135
24179
|
y: i.attribute.y + (lastLineHeight - i.attribute.height) / ("middle" === verticalAlign ? 2 : 1)
|
|
24136
24180
|
});
|
|
24137
24181
|
}), pages += 1, startX = 0, startY += lastLineHeight + spaceRow, lastLineHeight = 0, lastLineItemGroup.length = 0))), 0 === startX && 0 === startY || itemGroup.setAttributes({
|
|
24138
24182
|
x: startX,
|
|
24139
24183
|
y: startY
|
|
24140
|
-
}), startX += spaceCol + itemWidth, lastLineHeight = Math.max(lastLineHeight, itemHeight), lastLineItemGroup.push(itemGroup)) : (isValid$
|
|
24184
|
+
}), 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({
|
|
24141
24185
|
x: startX,
|
|
24142
24186
|
y: startY
|
|
24143
24187
|
}), startY += spaceRow + itemHeight), itemsContainer.add(itemGroup), lastItemWidth = itemWidth;
|
|
@@ -24156,7 +24200,7 @@
|
|
|
24156
24200
|
maxWidth: maxWidth,
|
|
24157
24201
|
maxHeight: maxHeight
|
|
24158
24202
|
} = this.attribute;
|
|
24159
|
-
if (!1 === item.visible || isEmpty
|
|
24203
|
+
if (!1 === item.visible || isEmpty(items)) return;
|
|
24160
24204
|
let legendItems = items;
|
|
24161
24205
|
reversed && (legendItems = null == items ? void 0 : items.reverse()), this._contentMaxHeight = Math.max(0, maxHeight - this._parsedPadding[0] - this._parsedPadding[2]);
|
|
24162
24206
|
const itemsContainer = graphicCreator.group({
|
|
@@ -24175,7 +24219,7 @@
|
|
|
24175
24219
|
height: itemHeight
|
|
24176
24220
|
} = item,
|
|
24177
24221
|
widthsOptions = [];
|
|
24178
|
-
isValid$
|
|
24222
|
+
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);
|
|
24179
24223
|
const pager = this.attribute.pager;
|
|
24180
24224
|
this._itemContext = {
|
|
24181
24225
|
currentPage: pager && pager.defaultCurrent || 1,
|
|
@@ -24193,7 +24237,7 @@
|
|
|
24193
24237
|
clipContainer: void 0
|
|
24194
24238
|
}, this._itemContext = this._renderItems();
|
|
24195
24239
|
let pagerRendered = !1;
|
|
24196
|
-
this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages && (pagerRendered = this._renderPagerComponent()), pagerRendered || (itemsContainer.setAttribute("y", this._title ? this._title.AABBBounds.height() + get$
|
|
24240
|
+
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));
|
|
24197
24241
|
}
|
|
24198
24242
|
_bindEvents() {
|
|
24199
24243
|
if (this.attribute.disableTriggerEvent) return;
|
|
@@ -24205,11 +24249,11 @@
|
|
|
24205
24249
|
if (hover) {
|
|
24206
24250
|
let trigger = "pointermove",
|
|
24207
24251
|
triggerOff = "pointerleave";
|
|
24208
|
-
isObject$
|
|
24252
|
+
isObject$7(hover) && (hover.trigger && (trigger = hover.trigger), hover.triggerOff && (triggerOff = hover.triggerOff)), this._itemsContainer.addEventListener(trigger, this._onHover), this._itemsContainer.addEventListener(triggerOff, this._onUnHover);
|
|
24209
24253
|
}
|
|
24210
24254
|
if (select) {
|
|
24211
24255
|
let trigger = "pointerdown";
|
|
24212
|
-
isObject$
|
|
24256
|
+
isObject$7(select) && select.trigger && (trigger = select.trigger), this._itemsContainer.addEventListener(trigger, this._onClick);
|
|
24213
24257
|
}
|
|
24214
24258
|
}
|
|
24215
24259
|
_autoEllipsis(autoEllipsisStrategy, layoutWidth, labelShape, valueShape) {
|
|
@@ -24271,8 +24315,8 @@
|
|
|
24271
24315
|
shapeSize = 0,
|
|
24272
24316
|
shapeSpace = 0;
|
|
24273
24317
|
if (shapeAttr && !1 !== shapeAttr.visible) {
|
|
24274
|
-
const s = get$
|
|
24275
|
-
shapeSize = isArray$
|
|
24318
|
+
const s = get$7(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
|
|
24319
|
+
shapeSize = isArray$7(s) ? s[0] || 0 : s, shapeSpace = get$7(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
|
|
24276
24320
|
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
24277
24321
|
x: 0,
|
|
24278
24322
|
y: 0,
|
|
@@ -24281,12 +24325,12 @@
|
|
|
24281
24325
|
}, shape), shapeStyle.style));
|
|
24282
24326
|
Object.keys(shapeStyle.state || {}).forEach(key => {
|
|
24283
24327
|
const color = shapeStyle.state[key].fill || shapeStyle.state[key].stroke;
|
|
24284
|
-
shape.fill && isNil$
|
|
24328
|
+
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);
|
|
24285
24329
|
}), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
24286
24330
|
}
|
|
24287
24331
|
let focusSpace = 0;
|
|
24288
24332
|
if (focus) {
|
|
24289
|
-
const focusSize = get$
|
|
24333
|
+
const focusSize = get$7(focusIconStyle, "size", DEFAULT_SHAPE_SIZE);
|
|
24290
24334
|
focusShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
24291
24335
|
x: 0,
|
|
24292
24336
|
y: -focusSize / 2 - 1,
|
|
@@ -24310,9 +24354,9 @@
|
|
|
24310
24354
|
}),
|
|
24311
24355
|
labelShape = createTextGraphicByType(labelAttributes);
|
|
24312
24356
|
this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
|
|
24313
|
-
const labelSpace = get$
|
|
24314
|
-
if (isValid$
|
|
24315
|
-
const valueSpace = get$
|
|
24357
|
+
const labelSpace = get$7(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
24358
|
+
if (isValid$3(value)) {
|
|
24359
|
+
const valueSpace = get$7(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
24316
24360
|
valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value,
|
|
24317
24361
|
valueAttributes = Object.assign(Object.assign({
|
|
24318
24362
|
x: 0,
|
|
@@ -24348,7 +24392,7 @@
|
|
|
24348
24392
|
});
|
|
24349
24393
|
}
|
|
24350
24394
|
const innerGroupHeight = innerGroupBounds.height(),
|
|
24351
|
-
itemGroupWidth = isValid$
|
|
24395
|
+
itemGroupWidth = isValid$3(this.attribute.item.width) ? this.attribute.item.width : innerGroupWidth + parsedPadding[1] + parsedPadding[3],
|
|
24352
24396
|
itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
|
|
24353
24397
|
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;
|
|
24354
24398
|
}
|
|
@@ -24362,7 +24406,7 @@
|
|
|
24362
24406
|
return this._itemContext.isHorizontal ? new Pager(Object.assign(Object.assign({
|
|
24363
24407
|
layout: 1 === maxRow ? "horizontal" : "vertical",
|
|
24364
24408
|
total: estimateTotal(this._itemContext.pages)
|
|
24365
|
-
}, merge$
|
|
24409
|
+
}, merge$1({
|
|
24366
24410
|
handler: {
|
|
24367
24411
|
preShape: "triangleUp",
|
|
24368
24412
|
nextShape: "triangleDown"
|
|
@@ -24505,7 +24549,7 @@
|
|
|
24505
24549
|
} else this._pagerComponent.addEventListener("toPrev", onPaging), this._pagerComponent.addEventListener("toNext", onPaging);
|
|
24506
24550
|
}
|
|
24507
24551
|
_renderPager() {
|
|
24508
|
-
const renderStartY = this._title ? this._title.AABBBounds.height() + get$
|
|
24552
|
+
const renderStartY = this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", 8) : 0,
|
|
24509
24553
|
{
|
|
24510
24554
|
maxWidth: maxWidth,
|
|
24511
24555
|
maxCol = 1,
|
|
@@ -24576,7 +24620,7 @@
|
|
|
24576
24620
|
}
|
|
24577
24621
|
_renderScrollbar() {
|
|
24578
24622
|
var _a;
|
|
24579
|
-
const renderStartY = this._title ? this._title.AABBBounds.height() + get$
|
|
24623
|
+
const renderStartY = this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", 8) : 0,
|
|
24580
24624
|
{
|
|
24581
24625
|
maxWidth: maxWidth,
|
|
24582
24626
|
item = {},
|
|
@@ -24736,7 +24780,7 @@
|
|
|
24736
24780
|
}
|
|
24737
24781
|
_appendDataToShape(shape, name, data, delegateShape) {
|
|
24738
24782
|
let states = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
24739
|
-
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$
|
|
24783
|
+
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$1({}, DEFAULT_STATES, states);
|
|
24740
24784
|
}
|
|
24741
24785
|
_dispatchLegendEvent(eventName, legendItem, event) {
|
|
24742
24786
|
const currentSelectedItems = this._getSelectedLegends();
|
|
@@ -24753,8 +24797,8 @@
|
|
|
24753
24797
|
}
|
|
24754
24798
|
_handleStyle(config, item, isSelected, index, items) {
|
|
24755
24799
|
const newConfig = {};
|
|
24756
|
-
return config.style && (isFunction$
|
|
24757
|
-
config.state[key] && (isFunction$
|
|
24800
|
+
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 => {
|
|
24801
|
+
config.state[key] && (isFunction$5(config.state[key]) ? newConfig.state[key] = config.state[key](item, isSelected, index, items) : newConfig.state[key] = config.state[key]);
|
|
24758
24802
|
})), newConfig;
|
|
24759
24803
|
}
|
|
24760
24804
|
release() {
|
|
@@ -24857,7 +24901,7 @@
|
|
|
24857
24901
|
}(SLIDER_ELEMENT_NAME || (SLIDER_ELEMENT_NAME = {}));
|
|
24858
24902
|
|
|
24859
24903
|
function convertValueToRange(value) {
|
|
24860
|
-
return isArray$
|
|
24904
|
+
return isArray$7(value) ? value : [value, value];
|
|
24861
24905
|
}
|
|
24862
24906
|
function getDefaultCursor(isHorizontal) {
|
|
24863
24907
|
return isHorizontal ? "ew-resize" : "ns-resize";
|
|
@@ -24880,7 +24924,7 @@
|
|
|
24880
24924
|
return this._tooltipShape;
|
|
24881
24925
|
}
|
|
24882
24926
|
constructor(attributes, options) {
|
|
24883
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
24927
|
+
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 => {
|
|
24884
24928
|
this._isChanging || this._tooltipState && this._tooltipState.isActive || (this._tooltipState ? this._tooltipState.isActive = !0 : this._tooltipState = {
|
|
24885
24929
|
isActive: !0
|
|
24886
24930
|
}, this._onTooltipUpdate(e), this._dispatchTooltipEvent("sliderTooltipShow"));
|
|
@@ -25005,7 +25049,7 @@
|
|
|
25005
25049
|
let currentPos, startHandlerPos, endHandlerPos;
|
|
25006
25050
|
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);
|
|
25007
25051
|
const currentValue = this.calculateValueByPos(currentPos);
|
|
25008
|
-
if (isValid$
|
|
25052
|
+
if (isValid$3(endHandlerPos)) {
|
|
25009
25053
|
const updateHandler = Math.abs(currentPos - startHandlerPos) > Math.abs(currentPos - endHandlerPos) ? endHandler : startHandler;
|
|
25010
25054
|
this._updateHandler(updateHandler, currentPos, currentValue);
|
|
25011
25055
|
} else this._updateHandler(startHandler, currentPos, currentValue);
|
|
@@ -25067,7 +25111,7 @@
|
|
|
25067
25111
|
let {
|
|
25068
25112
|
value: value
|
|
25069
25113
|
} = this.attribute;
|
|
25070
|
-
isNil$
|
|
25114
|
+
isNil$3(value) && (value = [min, max]), this._currentValue = {
|
|
25071
25115
|
startValue: convertValueToRange(value)[0],
|
|
25072
25116
|
endValue: convertValueToRange(value)[1]
|
|
25073
25117
|
};
|
|
@@ -25089,7 +25133,7 @@
|
|
|
25089
25133
|
text: startText.text,
|
|
25090
25134
|
lineHeight: null === (_a = startText.style) || void 0 === _a ? void 0 : _a.fontSize
|
|
25091
25135
|
}, startText.style)), startTextShape.name = SLIDER_ELEMENT_NAME.startText, innerView.add(startTextShape);
|
|
25092
|
-
const space = isValid$
|
|
25136
|
+
const space = isValid$3(startText.space) ? startText.space : 0;
|
|
25093
25137
|
startLen += (isHorizontal ? startTextShape.AABBBounds.width() : startTextShape.AABBBounds.height()) + space;
|
|
25094
25138
|
}
|
|
25095
25139
|
const mainContainer = graphicCreator.group({
|
|
@@ -25103,7 +25147,7 @@
|
|
|
25103
25147
|
});
|
|
25104
25148
|
let endTextShape;
|
|
25105
25149
|
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) {
|
|
25106
|
-
const space = isValid$
|
|
25150
|
+
const space = isValid$3(endText.space) ? endText.space : 0;
|
|
25107
25151
|
endTextShape = graphicCreator.text(Object.assign({
|
|
25108
25152
|
x: isHorizontal ? startLen + space : railWidth / 2,
|
|
25109
25153
|
y: isHorizontal ? railHeight / 2 : startLen + space,
|
|
@@ -25148,7 +25192,7 @@
|
|
|
25148
25192
|
let {
|
|
25149
25193
|
value: value
|
|
25150
25194
|
} = this.attribute;
|
|
25151
|
-
isNil$
|
|
25195
|
+
isNil$3(value) && (value = [min, max]);
|
|
25152
25196
|
const handlerTextVisible = handlerText && handlerText.visible,
|
|
25153
25197
|
isHorizontal = this._isHorizontal,
|
|
25154
25198
|
[startValue, endValue] = convertValueToRange(value),
|
|
@@ -25192,7 +25236,7 @@
|
|
|
25192
25236
|
value: value
|
|
25193
25237
|
} = this.attribute;
|
|
25194
25238
|
let startValue, endValue;
|
|
25195
|
-
if (isNil$
|
|
25239
|
+
if (isNil$3(value)) range ? (startValue = min, endValue = max) : startValue = endValue = min;else if (range) {
|
|
25196
25240
|
const clampValue = clampRange$1(value, min, max);
|
|
25197
25241
|
startValue = clampValue[0], endValue = clampValue[1];
|
|
25198
25242
|
} else startValue = min, endValue = clamp$3(value, min, max);
|
|
@@ -25208,7 +25252,7 @@
|
|
|
25208
25252
|
pickable: !1
|
|
25209
25253
|
});
|
|
25210
25254
|
trackContainer.name = SLIDER_ELEMENT_NAME.trackContainer;
|
|
25211
|
-
const draggableTrack = isObject$
|
|
25255
|
+
const draggableTrack = isObject$7(range) && !0 === range.draggableTrack;
|
|
25212
25256
|
let cursor;
|
|
25213
25257
|
cursor = !1 === slidable ? "default" : !1 === range || !1 === draggableTrack ? "pointer" : getDefaultCursor(isHorizontal);
|
|
25214
25258
|
const startPos = this.calculatePosByValue(startValue, "start"),
|
|
@@ -25313,7 +25357,7 @@
|
|
|
25313
25357
|
slidable: slidable,
|
|
25314
25358
|
range: range
|
|
25315
25359
|
} = this.attribute;
|
|
25316
|
-
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$
|
|
25360
|
+
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$7(range) && range.draggableTrack && this._track.addEventListener("pointerdown", this._onTrackPointerdown), this._railContainer.addEventListener("pointerdown", this._onRailPointerDown));
|
|
25317
25361
|
}
|
|
25318
25362
|
_bindTooltipEvents() {
|
|
25319
25363
|
this.attribute.disableTriggerEvent || (this._mainContainer.addEventListener("pointerenter", this._onTooltipShow), this._mainContainer.addEventListener("pointermove", this._onTooltipUpdate), this._mainContainer.addEventListener("pointerleave", this._onTooltipHide));
|
|
@@ -25481,9 +25525,9 @@
|
|
|
25481
25525
|
loadColorContinuousLegendComponent();
|
|
25482
25526
|
class ColorContinuousLegend extends LegendBase {
|
|
25483
25527
|
constructor(attributes, options) {
|
|
25484
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
25528
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ColorContinuousLegend.defaultAttributes, attributes)), this.name = "colorLegend", this._onSliderToolipChange = e => {
|
|
25485
25529
|
const tooltipShape = this._slider.tooltipShape;
|
|
25486
|
-
if (tooltipShape && e.detail && !isNil$
|
|
25530
|
+
if (tooltipShape && e.detail && !isNil$3(e.detail.value)) {
|
|
25487
25531
|
const color = this._colorScale.scale(e.detail.value);
|
|
25488
25532
|
tooltipShape.setAttribute("fill", color);
|
|
25489
25533
|
}
|
|
@@ -25552,7 +25596,7 @@
|
|
|
25552
25596
|
disableTriggerEvent: disableTriggerEvent,
|
|
25553
25597
|
inverse: inverse
|
|
25554
25598
|
});
|
|
25555
|
-
this._innerView.add(slider), this._slider = slider, slider.translateTo(0 - slider.AABBBounds.x1, (this._title ? this._title.AABBBounds.height() + get$
|
|
25599
|
+
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();
|
|
25556
25600
|
}
|
|
25557
25601
|
_bindEvents() {
|
|
25558
25602
|
this.attribute.disableTriggerEvent || this._slider && (this._slider.addEventListener("change", this._onSliderChange), this._slider.addEventListener("sliderTooltip", this._onSliderToolipChange));
|
|
@@ -25563,7 +25607,7 @@
|
|
|
25563
25607
|
layout: layout,
|
|
25564
25608
|
inverse: inverse
|
|
25565
25609
|
} = this.attribute;
|
|
25566
|
-
if (isEmpty
|
|
25610
|
+
if (isEmpty(colors)) return;
|
|
25567
25611
|
const count = colors.length;
|
|
25568
25612
|
if (1 === count) return colors[0];
|
|
25569
25613
|
const stops = [];
|
|
@@ -25684,7 +25728,7 @@
|
|
|
25684
25728
|
loadSizeContinuousLegendComponent();
|
|
25685
25729
|
class SizeContinuousLegend extends LegendBase {
|
|
25686
25730
|
constructor(attributes, options) {
|
|
25687
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
25731
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, SizeContinuousLegend.defaultAttributes, attributes)), this.name = "sizeLegend", this._onSliderChange = e => {
|
|
25688
25732
|
this.dispatchEvent(e);
|
|
25689
25733
|
}, this._onSliderToolipChange = e => {
|
|
25690
25734
|
this.dispatchEvent(e);
|
|
@@ -25764,7 +25808,7 @@
|
|
|
25764
25808
|
zIndex: 0
|
|
25765
25809
|
}));
|
|
25766
25810
|
mainContainer.add(background);
|
|
25767
|
-
const titleSpace = this._title ? this._title.AABBBounds.height() + get$
|
|
25811
|
+
const titleSpace = this._title ? this._title.AABBBounds.height() + get$7(this.attribute, "title.space", DEFAULT_TITLE_SPACE) : 0;
|
|
25768
25812
|
mainContainer.translate(0 - mainContainer.AABBBounds.x1, titleSpace - mainContainer.AABBBounds.y1), this._slider = slider;
|
|
25769
25813
|
}
|
|
25770
25814
|
_bindEvents() {
|
|
@@ -25800,7 +25844,7 @@
|
|
|
25800
25844
|
loadTitleComponent();
|
|
25801
25845
|
let Title$1 = class Title extends AbstractComponent {
|
|
25802
25846
|
constructor(attributes, options) {
|
|
25803
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
25847
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Title.defaultAttributes, attributes)), this.name = "title";
|
|
25804
25848
|
}
|
|
25805
25849
|
render() {
|
|
25806
25850
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
@@ -25840,7 +25884,7 @@
|
|
|
25840
25884
|
maxWidth: maxWidth,
|
|
25841
25885
|
lineClamp: lineClamp
|
|
25842
25886
|
} = textStyle;
|
|
25843
|
-
if ("rich" === textType || isValid$
|
|
25887
|
+
if ("rich" === textType || isValid$3(textStyle.character)) {
|
|
25844
25888
|
const attr = Object.assign({
|
|
25845
25889
|
x: x,
|
|
25846
25890
|
y: y,
|
|
@@ -25869,8 +25913,8 @@
|
|
|
25869
25913
|
textConfig: []
|
|
25870
25914
|
}, textStyle);
|
|
25871
25915
|
this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
|
|
25872
|
-
} else isValid$
|
|
25873
|
-
text: isArray$
|
|
25916
|
+
} else isValid$3(text) && (this._mainTitle = group.createOrUpdateChild("mainTitle", Object.assign(Object.assign({
|
|
25917
|
+
text: isArray$7(text) ? text : [text],
|
|
25874
25918
|
whiteSpace: "normal"
|
|
25875
25919
|
}, textStyle), {
|
|
25876
25920
|
maxLineWidth: null !== (_f = null !== (_e = textStyle.maxLineWidth) && void 0 !== _e ? _e : mainTitleWidth) && void 0 !== _f ? _f : width,
|
|
@@ -25896,7 +25940,7 @@
|
|
|
25896
25940
|
lineClamp: lineClamp
|
|
25897
25941
|
} = subtextStyle,
|
|
25898
25942
|
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
|
|
25899
|
-
if ("rich" === subtextType || isValid$
|
|
25943
|
+
if ("rich" === subtextType || isValid$3(subtextStyle.character)) {
|
|
25900
25944
|
const attr = Object.assign({
|
|
25901
25945
|
x: x,
|
|
25902
25946
|
y: y,
|
|
@@ -25925,8 +25969,8 @@
|
|
|
25925
25969
|
textConfig: []
|
|
25926
25970
|
}, subtextStyle);
|
|
25927
25971
|
this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
|
|
25928
|
-
} else isValid$
|
|
25929
|
-
text: isArray$
|
|
25972
|
+
} else isValid$3(subtext) && (this._subTitle = group.createOrUpdateChild("subTitle", Object.assign(Object.assign({
|
|
25973
|
+
text: isArray$7(subtext) ? subtext : [subtext],
|
|
25930
25974
|
whiteSpace: "normal"
|
|
25931
25975
|
}, subtextStyle), {
|
|
25932
25976
|
maxLineWidth: null !== (_o = subtextStyle.maxLineWidth) && void 0 !== _o ? _o : width,
|
|
@@ -25941,28 +25985,28 @@
|
|
|
25941
25985
|
subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
25942
25986
|
let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth),
|
|
25943
25987
|
totalHeight = mainTextBoundsHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subTextBoundsHeight);
|
|
25944
|
-
if (isValid$
|
|
25945
|
-
if (isValid$
|
|
25988
|
+
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) {
|
|
25989
|
+
if (isValid$3(align) || isValid$3(textStyle.align)) {
|
|
25946
25990
|
const mainTitleAlign = textStyle.align ? textStyle.align : align,
|
|
25947
25991
|
mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : totalWidth;
|
|
25948
25992
|
"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"));
|
|
25949
25993
|
}
|
|
25950
|
-
if (isValid$
|
|
25994
|
+
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
25951
25995
|
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
25952
|
-
"middle" === mainTitleVerticalAlign && isValid$
|
|
25996
|
+
"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"));
|
|
25953
25997
|
}
|
|
25954
25998
|
}
|
|
25955
25999
|
if (this._subTitle) {
|
|
25956
|
-
if (isValid$
|
|
26000
|
+
if (isValid$3(align) || isValid$3(subtextStyle.align)) {
|
|
25957
26001
|
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align,
|
|
25958
26002
|
subTitleWidth = null !== (_t = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s : textStyle.width) && void 0 !== _t ? _t : totalWidth;
|
|
25959
26003
|
"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"));
|
|
25960
26004
|
}
|
|
25961
|
-
if (isValid$
|
|
26005
|
+
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
25962
26006
|
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign,
|
|
25963
|
-
subTitleYStart = this._mainTitle ? isValid$
|
|
26007
|
+
subTitleYStart = this._mainTitle ? isValid$3(fixedMainTitleHeight) ? this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight) : this._mainTitle.AABBBounds.y2 : 0,
|
|
25964
26008
|
subTitleHeight = null !== (_u = subtextStyle.height) && void 0 !== _u ? _u : height;
|
|
25965
|
-
"middle" === subTitleVerticalAlign && isValid$
|
|
26009
|
+
"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"));
|
|
25966
26010
|
}
|
|
25967
26011
|
}
|
|
25968
26012
|
}
|
|
@@ -25995,7 +26039,7 @@
|
|
|
25995
26039
|
loadCheckBoxComponent();
|
|
25996
26040
|
class CheckBox extends AbstractComponent {
|
|
25997
26041
|
constructor(attributes, options) {
|
|
25998
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26042
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, CheckBox.defaultAttributes, attributes)), this._handlePointerUp = () => {
|
|
25999
26043
|
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", {
|
|
26000
26044
|
eventType: "checkbox_state_change",
|
|
26001
26045
|
checked: this.attribute.checked
|
|
@@ -26008,7 +26052,7 @@
|
|
|
26008
26052
|
this.removeAllChild(!0), this.renderBox(), this.renderIcon(), this.renderText(), this.layout();
|
|
26009
26053
|
}
|
|
26010
26054
|
renderBox() {
|
|
26011
|
-
this._box = new Rect$1(merge$
|
|
26055
|
+
this._box = new Rect$1(merge$1({}, this.attribute.box));
|
|
26012
26056
|
const isCheckedOrIndeterminate = this.attribute.checked || this.attribute.indeterminate;
|
|
26013
26057
|
isCheckedOrIndeterminate && this.attribute.disabled ? this._box.setAttributes({
|
|
26014
26058
|
fill: this.attribute.box.disableCheckedFill,
|
|
@@ -26021,14 +26065,14 @@
|
|
|
26021
26065
|
}), this.appendChild(this._box);
|
|
26022
26066
|
}
|
|
26023
26067
|
renderIcon() {
|
|
26024
|
-
this._checkIcon = new Image$1(merge$
|
|
26068
|
+
this._checkIcon = new Image$1(merge$1({
|
|
26025
26069
|
image: this.attribute.icon.checkIconImage
|
|
26026
|
-
}, this.attribute.icon)), this.appendChild(this._checkIcon), this._indeterminateIcon = new Image$1(merge$
|
|
26070
|
+
}, this.attribute.icon)), this.appendChild(this._checkIcon), this._indeterminateIcon = new Image$1(merge$1({
|
|
26027
26071
|
image: this.attribute.icon.indeterminateIconImage
|
|
26028
26072
|
}, 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));
|
|
26029
26073
|
}
|
|
26030
26074
|
renderText() {
|
|
26031
|
-
this._text = new Text(merge$
|
|
26075
|
+
this._text = new Text(merge$1({
|
|
26032
26076
|
wrap: !0
|
|
26033
26077
|
}, this.attribute.text)), this.attribute.disabled && this._text.setAttribute("fill", this.attribute.text.disableFill), this.appendChild(this._text);
|
|
26034
26078
|
}
|
|
@@ -26064,7 +26108,7 @@
|
|
|
26064
26108
|
});
|
|
26065
26109
|
}
|
|
26066
26110
|
initAttributes(params, options) {
|
|
26067
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
26111
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, CheckBox.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
|
|
26068
26112
|
}
|
|
26069
26113
|
}
|
|
26070
26114
|
CheckBox.defaultAttributes = {
|
|
@@ -26112,7 +26156,7 @@
|
|
|
26112
26156
|
loadRadioComponent();
|
|
26113
26157
|
class Radio extends AbstractComponent {
|
|
26114
26158
|
constructor(attributes, options) {
|
|
26115
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26159
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Radio.defaultAttributes, attributes)), this._handlePointerUp = () => {
|
|
26116
26160
|
this.attribute.disabled || this.attribute.checked || (this.setAttribute("checked", !0), this._dispatchEvent("radio_checked", {
|
|
26117
26161
|
eventType: "radio_checked",
|
|
26118
26162
|
target: this
|
|
@@ -26125,7 +26169,7 @@
|
|
|
26125
26169
|
this.removeAllChild(!0), this.renderCircle(), this.renderText(), this.layout();
|
|
26126
26170
|
}
|
|
26127
26171
|
renderCircle() {
|
|
26128
|
-
this._circle = new Arc(merge$
|
|
26172
|
+
this._circle = new Arc(merge$1({}, this.attribute.circle));
|
|
26129
26173
|
const isChecked = this.attribute.checked;
|
|
26130
26174
|
isChecked && this.attribute.disabled ? this._circle.setAttributes({
|
|
26131
26175
|
fill: this.attribute.circle.disableCheckedFill,
|
|
@@ -26138,7 +26182,7 @@
|
|
|
26138
26182
|
}), this.appendChild(this._circle);
|
|
26139
26183
|
}
|
|
26140
26184
|
renderText() {
|
|
26141
|
-
this._text = new Text(merge$
|
|
26185
|
+
this._text = new Text(merge$1({}, this.attribute.text)), this.attribute.disabled && this._text.setAttribute("fill", this.attribute.text.disableFill), this.appendChild(this._text);
|
|
26142
26186
|
}
|
|
26143
26187
|
renderGroup() {
|
|
26144
26188
|
this.attribute.interactive || this.setAttribute("pickable", !1), this.attribute.disabled && this.setAttribute("cursor", this.attribute.disableCursor);
|
|
@@ -26161,7 +26205,7 @@
|
|
|
26161
26205
|
});
|
|
26162
26206
|
}
|
|
26163
26207
|
initAttributes(params, options) {
|
|
26164
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
26208
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Radio.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
|
|
26165
26209
|
}
|
|
26166
26210
|
}
|
|
26167
26211
|
Radio.defaultAttributes = {
|
|
@@ -26204,18 +26248,18 @@
|
|
|
26204
26248
|
loadEmptyTipComponent();
|
|
26205
26249
|
let EmptyTip$1 = class EmptyTip extends AbstractComponent {
|
|
26206
26250
|
constructor(attributes, options) {
|
|
26207
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26251
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, EmptyTip.defaultAttributes, attributes));
|
|
26208
26252
|
}
|
|
26209
26253
|
render() {
|
|
26210
26254
|
this.removeAllChild(!0), this.renderIcon(), this.renderText(), this.layout();
|
|
26211
26255
|
}
|
|
26212
26256
|
renderIcon() {
|
|
26213
|
-
this._emptyTipIcon = new Image$1(merge$
|
|
26257
|
+
this._emptyTipIcon = new Image$1(merge$1({
|
|
26214
26258
|
image: this.attribute.icon.image
|
|
26215
26259
|
}, this.attribute.icon)), this.appendChild(this._emptyTipIcon);
|
|
26216
26260
|
}
|
|
26217
26261
|
renderText() {
|
|
26218
|
-
this._text = new Text(merge$
|
|
26262
|
+
this._text = new Text(merge$1({
|
|
26219
26263
|
wrap: !0
|
|
26220
26264
|
}, this.attribute.text)), this.appendChild(this._text);
|
|
26221
26265
|
}
|
|
@@ -26255,7 +26299,7 @@
|
|
|
26255
26299
|
loadSwitchComponent();
|
|
26256
26300
|
class Switch extends AbstractComponent {
|
|
26257
26301
|
constructor(attributes, options) {
|
|
26258
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$
|
|
26302
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Switch.defaultAttributes, attributes)), this._handlePointerUp = () => {
|
|
26259
26303
|
this.attribute.disabled || (this.attribute.checked ? this.setAttribute("checked", !1) : this.setAttribute("checked", !0), this._dispatchEvent("switch_state_change", {
|
|
26260
26304
|
eventType: "switch_state_change",
|
|
26261
26305
|
checked: this.attribute.checked
|
|
@@ -26268,7 +26312,7 @@
|
|
|
26268
26312
|
this.removeAllChild(!0), this.renderBox(), this.renderCircle(), this.renderText(), this.layout();
|
|
26269
26313
|
}
|
|
26270
26314
|
renderBox() {
|
|
26271
|
-
this._box = new Rect$1(merge$
|
|
26315
|
+
this._box = new Rect$1(merge$1({}, this.attribute.box)), this.attribute.disabled && this.attribute.checked ? this._box.setAttributes({
|
|
26272
26316
|
fill: this.attribute.box.disableCheckedFill
|
|
26273
26317
|
}) : this.attribute.disabled && !this.attribute.checked ? this._box.setAttributes({
|
|
26274
26318
|
fill: this.attribute.box.disableUncheckedFill
|
|
@@ -26279,11 +26323,11 @@
|
|
|
26279
26323
|
}), this.appendChild(this._box);
|
|
26280
26324
|
}
|
|
26281
26325
|
renderCircle() {
|
|
26282
|
-
this._circle = new Circle(merge$
|
|
26326
|
+
this._circle = new Circle(merge$1({}, this.attribute.circle)), this.appendChild(this._circle);
|
|
26283
26327
|
}
|
|
26284
26328
|
renderText() {
|
|
26285
26329
|
var _a, _b, _c;
|
|
26286
|
-
this._text = new Text(merge$
|
|
26330
|
+
this._text = new Text(merge$1({}, null !== (_a = this.attribute.text) && void 0 !== _a ? _a : {})), this.attribute.checked && (null === (_b = this.attribute.text) || void 0 === _b ? void 0 : _b.checkedText) ? this._text.setAttributes({
|
|
26287
26331
|
text: this.attribute.text.checkedText
|
|
26288
26332
|
}) : (null === (_c = this.attribute.text) || void 0 === _c ? void 0 : _c.uncheckedText) && this._text.setAttributes({
|
|
26289
26333
|
text: this.attribute.text.uncheckedText
|
|
@@ -26320,7 +26364,7 @@
|
|
|
26320
26364
|
});
|
|
26321
26365
|
}
|
|
26322
26366
|
initAttributes(params, options) {
|
|
26323
|
-
params = (null == options ? void 0 : options.skipDefault) ? params : merge$
|
|
26367
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Switch.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
|
|
26324
26368
|
}
|
|
26325
26369
|
}
|
|
26326
26370
|
Switch.defaultAttributes = {
|
|
@@ -26399,616 +26443,6 @@
|
|
|
26399
26443
|
InternalIconName.upwardIconName = "sort_upward", InternalIconName.downwardIconName = "sort_downward", InternalIconName.normalIconName = "sort_normal", InternalIconName.freezeIconName = "freeze", InternalIconName.frozenIconName = "frozen", InternalIconName.frozenCurrentIconName = "frozenCurrent", InternalIconName.dropdownIconName = "dropdownIcon", InternalIconName.expandIconName = "expand", InternalIconName.collapseIconName = "collapse", InternalIconName.dragReorderIconName = "dragReorder", InternalIconName.loadingIconName = "loading";
|
|
26400
26444
|
}(InternalIconName || (InternalIconName = {}));
|
|
26401
26445
|
|
|
26402
|
-
const isType$2 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
26403
|
-
var isType$3 = isType$2;
|
|
26404
|
-
|
|
26405
|
-
const isBoolean$3 = function (value) {
|
|
26406
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
26407
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$3(value, "Boolean");
|
|
26408
|
-
};
|
|
26409
|
-
var isBoolean$4 = isBoolean$3;
|
|
26410
|
-
|
|
26411
|
-
const isFunction$4 = value => "function" == typeof value;
|
|
26412
|
-
var isFunction$5 = isFunction$4;
|
|
26413
|
-
|
|
26414
|
-
const isNil$2 = value => null == value;
|
|
26415
|
-
var isNil$3 = isNil$2;
|
|
26416
|
-
|
|
26417
|
-
const isValid$2 = value => null != value;
|
|
26418
|
-
var isValid$3 = isValid$2;
|
|
26419
|
-
|
|
26420
|
-
const isObject$6 = value => {
|
|
26421
|
-
const type = typeof value;
|
|
26422
|
-
return null !== value && "object" === type || "function" === type;
|
|
26423
|
-
};
|
|
26424
|
-
var isObject$7 = isObject$6;
|
|
26425
|
-
|
|
26426
|
-
const isObjectLike$4 = value => "object" == typeof value && null !== value;
|
|
26427
|
-
var isObjectLike$5 = isObjectLike$4;
|
|
26428
|
-
|
|
26429
|
-
const isPlainObject$2 = function (value) {
|
|
26430
|
-
if (!isObjectLike$5(value) || !isType$3(value, "Object")) return !1;
|
|
26431
|
-
if (null === Object.getPrototypeOf(value)) return !0;
|
|
26432
|
-
let proto = value;
|
|
26433
|
-
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
26434
|
-
return Object.getPrototypeOf(value) === proto;
|
|
26435
|
-
};
|
|
26436
|
-
var isPlainObject$3 = isPlainObject$2;
|
|
26437
|
-
|
|
26438
|
-
const isString$3 = function (value) {
|
|
26439
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
26440
|
-
const type = typeof value;
|
|
26441
|
-
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
26442
|
-
};
|
|
26443
|
-
var isString$4 = isString$3;
|
|
26444
|
-
|
|
26445
|
-
const isArray$6 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
26446
|
-
var isArray$7 = isArray$6;
|
|
26447
|
-
|
|
26448
|
-
const isArrayLike$2 = function (value) {
|
|
26449
|
-
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
26450
|
-
};
|
|
26451
|
-
var isArrayLike$3 = isArrayLike$2;
|
|
26452
|
-
|
|
26453
|
-
const isDate$2 = value => isType$3(value, "Date");
|
|
26454
|
-
var isDate$3 = isDate$2;
|
|
26455
|
-
|
|
26456
|
-
const isNumber$3 = function (value) {
|
|
26457
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
26458
|
-
const type = typeof value;
|
|
26459
|
-
return fuzzy ? "number" === type : "number" === type || isType$3(value, "Number");
|
|
26460
|
-
};
|
|
26461
|
-
var isNumber$4 = isNumber$3;
|
|
26462
|
-
|
|
26463
|
-
const isValidNumber = value => isNumber$4(value) && Number.isFinite(value);
|
|
26464
|
-
var isValidNumber$1 = isValidNumber;
|
|
26465
|
-
|
|
26466
|
-
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
26467
|
-
var getType$1 = getType;
|
|
26468
|
-
|
|
26469
|
-
const objectProto$5 = Object.prototype,
|
|
26470
|
-
isPrototype = function (value) {
|
|
26471
|
-
const Ctor = value && value.constructor;
|
|
26472
|
-
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto$5);
|
|
26473
|
-
};
|
|
26474
|
-
var isPrototype$1 = isPrototype;
|
|
26475
|
-
|
|
26476
|
-
const hasOwnProperty$4 = Object.prototype.hasOwnProperty;
|
|
26477
|
-
function isEmpty(value) {
|
|
26478
|
-
if (isNil$3(value)) return !0;
|
|
26479
|
-
if (isArrayLike$3(value)) return !value.length;
|
|
26480
|
-
const type = getType$1(value);
|
|
26481
|
-
if ("Map" === type || "Set" === type) return !value.size;
|
|
26482
|
-
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
26483
|
-
for (const key in value) if (hasOwnProperty$4.call(value, key)) return !1;
|
|
26484
|
-
return !0;
|
|
26485
|
-
}
|
|
26486
|
-
|
|
26487
|
-
const get$6 = (obj, path, defaultValue) => {
|
|
26488
|
-
const paths = isString$4(path) ? path.split(".") : path;
|
|
26489
|
-
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
26490
|
-
return void 0 === obj ? defaultValue : obj;
|
|
26491
|
-
};
|
|
26492
|
-
var get$7 = get$6;
|
|
26493
|
-
|
|
26494
|
-
function cloneDeep$1(value, ignoreWhen, excludeKeys) {
|
|
26495
|
-
let result;
|
|
26496
|
-
if (!isValid$3(value) || "object" != typeof value || ignoreWhen && ignoreWhen(value)) return value;
|
|
26497
|
-
const isArr = isArray$7(value),
|
|
26498
|
-
length = value.length;
|
|
26499
|
-
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;
|
|
26500
|
-
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
26501
|
-
let index = -1;
|
|
26502
|
-
if (result) for (; ++index < (props || value).length;) {
|
|
26503
|
-
const key = props ? props[index] : index,
|
|
26504
|
-
subValue = value[key];
|
|
26505
|
-
excludeKeys && excludeKeys.includes(key.toString()) ? result[key] = subValue : result[key] = cloneDeep$1(subValue, ignoreWhen, excludeKeys);
|
|
26506
|
-
}
|
|
26507
|
-
return result;
|
|
26508
|
-
}
|
|
26509
|
-
|
|
26510
|
-
function baseMerge$1(target, source) {
|
|
26511
|
-
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
26512
|
-
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
26513
|
-
if (source) {
|
|
26514
|
-
if (target === source) return;
|
|
26515
|
-
if (isValid$3(source) && "object" == typeof source) {
|
|
26516
|
-
const iterable = Object(source),
|
|
26517
|
-
props = [];
|
|
26518
|
-
for (const key in iterable) props.push(key);
|
|
26519
|
-
let {
|
|
26520
|
-
length: length
|
|
26521
|
-
} = props,
|
|
26522
|
-
propIndex = -1;
|
|
26523
|
-
for (; length--;) {
|
|
26524
|
-
const key = props[++propIndex];
|
|
26525
|
-
!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);
|
|
26526
|
-
}
|
|
26527
|
-
}
|
|
26528
|
-
}
|
|
26529
|
-
}
|
|
26530
|
-
function baseMergeDeep$1(target, source, key) {
|
|
26531
|
-
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
26532
|
-
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
26533
|
-
const objValue = target[key],
|
|
26534
|
-
srcValue = source[key];
|
|
26535
|
-
let newValue = source[key],
|
|
26536
|
-
isCommon = !0;
|
|
26537
|
-
if (isArray$7(srcValue)) {
|
|
26538
|
-
if (shallowArray) newValue = [];else if (isArray$7(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
26539
|
-
newValue = new Array(objValue.length);
|
|
26540
|
-
let index = -1;
|
|
26541
|
-
const length = objValue.length;
|
|
26542
|
-
for (; ++index < length;) newValue[index] = objValue[index];
|
|
26543
|
-
}
|
|
26544
|
-
} else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
26545
|
-
isCommon && baseMerge$1(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue$1(target, key, newValue);
|
|
26546
|
-
}
|
|
26547
|
-
function assignMergeValue$1(target, key, value) {
|
|
26548
|
-
(void 0 !== value && !eq$3(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
26549
|
-
}
|
|
26550
|
-
function eq$3(value, other) {
|
|
26551
|
-
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
26552
|
-
}
|
|
26553
|
-
function merge$1(target) {
|
|
26554
|
-
let sourceIndex = -1;
|
|
26555
|
-
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
26556
|
-
for (; ++sourceIndex < length;) {
|
|
26557
|
-
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
26558
|
-
}
|
|
26559
|
-
return target;
|
|
26560
|
-
}
|
|
26561
|
-
|
|
26562
|
-
function pickWithout(obj, keys) {
|
|
26563
|
-
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
26564
|
-
const result = {};
|
|
26565
|
-
return Object.keys(obj).forEach(k => {
|
|
26566
|
-
const v = obj[k];
|
|
26567
|
-
let match = !1;
|
|
26568
|
-
keys.forEach(itKey => {
|
|
26569
|
-
(isString$4(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
26570
|
-
}), match || (result[k] = v);
|
|
26571
|
-
}), result;
|
|
26572
|
-
}
|
|
26573
|
-
|
|
26574
|
-
function objToString(obj) {
|
|
26575
|
-
return Object.prototype.toString.call(obj);
|
|
26576
|
-
}
|
|
26577
|
-
function objectKeys(obj) {
|
|
26578
|
-
return Object.keys(obj);
|
|
26579
|
-
}
|
|
26580
|
-
function isEqual(a, b, options) {
|
|
26581
|
-
if (a === b) return !0;
|
|
26582
|
-
if (typeof a != typeof b) return !1;
|
|
26583
|
-
if (null == a || null == b) return !1;
|
|
26584
|
-
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
26585
|
-
if (objToString(a) !== objToString(b)) return !1;
|
|
26586
|
-
if (isFunction$5(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
26587
|
-
if ("object" != typeof a) return !1;
|
|
26588
|
-
if (isArray$7(a)) {
|
|
26589
|
-
if (a.length !== b.length) return !1;
|
|
26590
|
-
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
26591
|
-
return !0;
|
|
26592
|
-
}
|
|
26593
|
-
if (!isPlainObject$3(a)) return !1;
|
|
26594
|
-
const ka = objectKeys(a),
|
|
26595
|
-
kb = objectKeys(b);
|
|
26596
|
-
if (ka.length !== kb.length) return !1;
|
|
26597
|
-
ka.sort(), kb.sort();
|
|
26598
|
-
for (let i = ka.length - 1; i >= 0; i--) if (ka[i] != kb[i]) return !1;
|
|
26599
|
-
for (let i = ka.length - 1; i >= 0; i--) {
|
|
26600
|
-
const key = ka[i];
|
|
26601
|
-
if (!isEqual(a[key], b[key], options)) return !1;
|
|
26602
|
-
}
|
|
26603
|
-
return !0;
|
|
26604
|
-
}
|
|
26605
|
-
|
|
26606
|
-
function last(val) {
|
|
26607
|
-
if (isArrayLike$3(val)) {
|
|
26608
|
-
return val[val.length - 1];
|
|
26609
|
-
}
|
|
26610
|
-
}
|
|
26611
|
-
const maxInArray = (arr, compareFn) => {
|
|
26612
|
-
var _a;
|
|
26613
|
-
if (0 === arr.length) return;
|
|
26614
|
-
let max = arr[0];
|
|
26615
|
-
for (let i = 1; i < arr.length; i++) {
|
|
26616
|
-
const value = arr[i];
|
|
26617
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max) > 0 && (max = value);
|
|
26618
|
-
}
|
|
26619
|
-
return max;
|
|
26620
|
-
};
|
|
26621
|
-
const minInArray = (arr, compareFn) => {
|
|
26622
|
-
var _a;
|
|
26623
|
-
if (0 === arr.length) return;
|
|
26624
|
-
let min = arr[0];
|
|
26625
|
-
for (let i = 1; i < arr.length; i++) {
|
|
26626
|
-
const value = arr[i];
|
|
26627
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min) < 0 && (min = value);
|
|
26628
|
-
}
|
|
26629
|
-
return min;
|
|
26630
|
-
};
|
|
26631
|
-
function arrayEqual(a, b) {
|
|
26632
|
-
if (!isArray$7(a) || !isArray$7(b)) return !1;
|
|
26633
|
-
if (a.length !== b.length) return !1;
|
|
26634
|
-
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
26635
|
-
return !0;
|
|
26636
|
-
}
|
|
26637
|
-
|
|
26638
|
-
function degreeToRadian(degree) {
|
|
26639
|
-
return degree * (Math.PI / 180);
|
|
26640
|
-
}
|
|
26641
|
-
|
|
26642
|
-
const eastAsianCharacterInfo = character => {
|
|
26643
|
-
let x = character.charCodeAt(0),
|
|
26644
|
-
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
26645
|
-
codePoint = x;
|
|
26646
|
-
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";
|
|
26647
|
-
};
|
|
26648
|
-
|
|
26649
|
-
function getContextFont(text) {
|
|
26650
|
-
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
26651
|
-
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
26652
|
-
fontSizeScale || (fontSizeScale = 1);
|
|
26653
|
-
const {
|
|
26654
|
-
fontStyle = defaultAttr.fontStyle,
|
|
26655
|
-
fontVariant = defaultAttr.fontVariant,
|
|
26656
|
-
fontWeight = defaultAttr.fontWeight,
|
|
26657
|
-
fontSize = defaultAttr.fontSize,
|
|
26658
|
-
fontFamily = defaultAttr.fontFamily
|
|
26659
|
-
} = text;
|
|
26660
|
-
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
26661
|
-
}
|
|
26662
|
-
|
|
26663
|
-
class TextMeasure {
|
|
26664
|
-
constructor(option, textSpec) {
|
|
26665
|
-
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);
|
|
26666
|
-
}
|
|
26667
|
-
initContext() {
|
|
26668
|
-
if (this._notSupportCanvas) return !1;
|
|
26669
|
-
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)) {
|
|
26670
|
-
const context = this._canvas.getContext("2d");
|
|
26671
|
-
isValid$3(context) && (context.save(), context.font = getContextFont(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
26672
|
-
}
|
|
26673
|
-
return !isNil$3(this._context) || (this._notSupportCanvas = !0, !1);
|
|
26674
|
-
}
|
|
26675
|
-
_initSpec() {
|
|
26676
|
-
var _a, _b, _c;
|
|
26677
|
-
const {
|
|
26678
|
-
defaultFontParams = {}
|
|
26679
|
-
} = this._option,
|
|
26680
|
-
{
|
|
26681
|
-
fontStyle = defaultFontParams.fontStyle,
|
|
26682
|
-
fontVariant = defaultFontParams.fontVariant,
|
|
26683
|
-
fontWeight = null !== (_a = defaultFontParams.fontWeight) && void 0 !== _a ? _a : "normal",
|
|
26684
|
-
fontSize = null !== (_b = defaultFontParams.fontSize) && void 0 !== _b ? _b : 12,
|
|
26685
|
-
fontFamily = null !== (_c = defaultFontParams.fontFamily) && void 0 !== _c ? _c : "sans-serif",
|
|
26686
|
-
align: align,
|
|
26687
|
-
textAlign = null != align ? align : "center",
|
|
26688
|
-
baseline: baseline,
|
|
26689
|
-
textBaseline = null != baseline ? baseline : "middle",
|
|
26690
|
-
ellipsis: ellipsis,
|
|
26691
|
-
limit: limit
|
|
26692
|
-
} = this._userSpec;
|
|
26693
|
-
let {
|
|
26694
|
-
lineHeight = fontSize
|
|
26695
|
-
} = this._userSpec;
|
|
26696
|
-
if (isString$4(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
26697
|
-
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
26698
|
-
lineHeight = fontSize * scale;
|
|
26699
|
-
}
|
|
26700
|
-
return {
|
|
26701
|
-
fontStyle: fontStyle,
|
|
26702
|
-
fontVariant: fontVariant,
|
|
26703
|
-
fontFamily: fontFamily,
|
|
26704
|
-
fontSize: fontSize,
|
|
26705
|
-
fontWeight: fontWeight,
|
|
26706
|
-
textAlign: textAlign,
|
|
26707
|
-
textBaseline: textBaseline,
|
|
26708
|
-
ellipsis: ellipsis,
|
|
26709
|
-
limit: limit,
|
|
26710
|
-
lineHeight: lineHeight
|
|
26711
|
-
};
|
|
26712
|
-
}
|
|
26713
|
-
measure(text, method) {
|
|
26714
|
-
switch (method) {
|
|
26715
|
-
case "vrender":
|
|
26716
|
-
case "canopus":
|
|
26717
|
-
return this.fullMeasure(text);
|
|
26718
|
-
case "canvas":
|
|
26719
|
-
return this.measureWithNaiveCanvas(text);
|
|
26720
|
-
case "simple":
|
|
26721
|
-
return this.quickMeasureWithoutCanvas(text);
|
|
26722
|
-
default:
|
|
26723
|
-
return this.quickMeasure(text);
|
|
26724
|
-
}
|
|
26725
|
-
}
|
|
26726
|
-
fullMeasure(text) {
|
|
26727
|
-
if (isNil$3(text)) return {
|
|
26728
|
-
width: 0,
|
|
26729
|
-
height: 0
|
|
26730
|
-
};
|
|
26731
|
-
if (isNil$3(this._option.getTextBounds) || !this._notSupportVRender) return this.measureWithNaiveCanvas(text);
|
|
26732
|
-
const {
|
|
26733
|
-
fontFamily: fontFamily,
|
|
26734
|
-
fontSize: fontSize,
|
|
26735
|
-
fontWeight: fontWeight,
|
|
26736
|
-
textAlign: textAlign,
|
|
26737
|
-
textBaseline: textBaseline,
|
|
26738
|
-
ellipsis: ellipsis,
|
|
26739
|
-
limit: limit,
|
|
26740
|
-
lineHeight: lineHeight
|
|
26741
|
-
} = this.textSpec;
|
|
26742
|
-
let size;
|
|
26743
|
-
try {
|
|
26744
|
-
const bounds = this._option.getTextBounds({
|
|
26745
|
-
text: text,
|
|
26746
|
-
fontFamily: fontFamily,
|
|
26747
|
-
fontSize: fontSize,
|
|
26748
|
-
fontWeight: fontWeight,
|
|
26749
|
-
textAlign: textAlign,
|
|
26750
|
-
textBaseline: textBaseline,
|
|
26751
|
-
ellipsis: !!ellipsis,
|
|
26752
|
-
maxLineWidth: limit || 1 / 0,
|
|
26753
|
-
lineHeight: lineHeight
|
|
26754
|
-
});
|
|
26755
|
-
size = {
|
|
26756
|
-
width: bounds.width(),
|
|
26757
|
-
height: bounds.height()
|
|
26758
|
-
};
|
|
26759
|
-
} catch (e) {
|
|
26760
|
-
this._notSupportVRender = !0, size = this.measureWithNaiveCanvas(text);
|
|
26761
|
-
}
|
|
26762
|
-
return size;
|
|
26763
|
-
}
|
|
26764
|
-
measureWithNaiveCanvas(text) {
|
|
26765
|
-
return this._measureReduce(text, this._measureWithNaiveCanvas.bind(this));
|
|
26766
|
-
}
|
|
26767
|
-
_measureWithNaiveCanvas(text) {
|
|
26768
|
-
var _a;
|
|
26769
|
-
if (!this.initContext()) return this._quickMeasureWithoutCanvas(text);
|
|
26770
|
-
const metrics = this._context.measureText(text),
|
|
26771
|
-
{
|
|
26772
|
-
fontSize: fontSize,
|
|
26773
|
-
lineHeight: lineHeight
|
|
26774
|
-
} = this.textSpec;
|
|
26775
|
-
return {
|
|
26776
|
-
width: metrics.width,
|
|
26777
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize,
|
|
26778
|
-
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
26779
|
-
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
26780
|
-
};
|
|
26781
|
-
}
|
|
26782
|
-
quickMeasure(text) {
|
|
26783
|
-
return this._measureReduce(text, this._quickMeasure.bind(this));
|
|
26784
|
-
}
|
|
26785
|
-
_quickMeasure(text) {
|
|
26786
|
-
const totalSize = {
|
|
26787
|
-
width: 0,
|
|
26788
|
-
height: 0
|
|
26789
|
-
};
|
|
26790
|
-
for (let i = 0; i < text.length; i++) {
|
|
26791
|
-
const char = text[i];
|
|
26792
|
-
let size = this._measureSpecialChar(char);
|
|
26793
|
-
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);
|
|
26794
|
-
}
|
|
26795
|
-
return totalSize;
|
|
26796
|
-
}
|
|
26797
|
-
quickMeasureWithoutCanvas(text) {
|
|
26798
|
-
return this._measureReduce(text, this._quickMeasureWithoutCanvas.bind(this));
|
|
26799
|
-
}
|
|
26800
|
-
_quickMeasureWithoutCanvas(text) {
|
|
26801
|
-
var _a;
|
|
26802
|
-
const totalSize = {
|
|
26803
|
-
width: 0,
|
|
26804
|
-
height: 0
|
|
26805
|
-
},
|
|
26806
|
-
{
|
|
26807
|
-
fontSize: fontSize,
|
|
26808
|
-
lineHeight: lineHeight
|
|
26809
|
-
} = this.textSpec;
|
|
26810
|
-
for (let i = 0; i < text.length; i++) {
|
|
26811
|
-
const char = text[i],
|
|
26812
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
26813
|
-
totalSize.width += size * fontSize;
|
|
26814
|
-
}
|
|
26815
|
-
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
26816
|
-
}
|
|
26817
|
-
_measureReduce(text, processor) {
|
|
26818
|
-
var _a;
|
|
26819
|
-
const {
|
|
26820
|
-
fontSize: fontSize,
|
|
26821
|
-
lineHeight: lineHeight
|
|
26822
|
-
} = this.textSpec,
|
|
26823
|
-
defaultResult = {
|
|
26824
|
-
width: 0,
|
|
26825
|
-
height: 0
|
|
26826
|
-
};
|
|
26827
|
-
if (isNil$3(text)) return defaultResult;
|
|
26828
|
-
if (isArray$7(text)) {
|
|
26829
|
-
const textArr = text.filter(isValid$3).map(s => s.toString());
|
|
26830
|
-
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
26831
|
-
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
26832
|
-
height: textArr.length * ((null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize) + 1) + 1
|
|
26833
|
-
};
|
|
26834
|
-
}
|
|
26835
|
-
return processor(text.toString());
|
|
26836
|
-
}
|
|
26837
|
-
_measureNumberChar() {
|
|
26838
|
-
if (isNil$3(this._numberCharSize)) {
|
|
26839
|
-
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
26840
|
-
this._numberCharSize = {
|
|
26841
|
-
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
26842
|
-
height: numberBounds.height,
|
|
26843
|
-
fontBoundingBoxAscent: numberBounds.fontBoundingBoxAscent,
|
|
26844
|
-
fontBoundingBoxDescent: numberBounds.fontBoundingBoxDescent
|
|
26845
|
-
};
|
|
26846
|
-
}
|
|
26847
|
-
return this._numberCharSize;
|
|
26848
|
-
}
|
|
26849
|
-
_measureFullSizeChar() {
|
|
26850
|
-
return isNil$3(this._fullCharSize) && (this._fullCharSize = this._standardMethod(TextMeasure.FULL_SIZE_CHAR)), this._fullCharSize;
|
|
26851
|
-
}
|
|
26852
|
-
_measureLetterChar() {
|
|
26853
|
-
if (isNil$3(this._letterCharSize)) {
|
|
26854
|
-
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
26855
|
-
this._letterCharSize = {
|
|
26856
|
-
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
26857
|
-
height: alphabetBounds.height,
|
|
26858
|
-
fontBoundingBoxAscent: alphabetBounds.fontBoundingBoxAscent,
|
|
26859
|
-
fontBoundingBoxDescent: alphabetBounds.fontBoundingBoxDescent
|
|
26860
|
-
};
|
|
26861
|
-
}
|
|
26862
|
-
return this._letterCharSize;
|
|
26863
|
-
}
|
|
26864
|
-
_measureSpecialChar(char) {
|
|
26865
|
-
return isValid$3(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
26866
|
-
}
|
|
26867
|
-
release() {
|
|
26868
|
-
isValid$3(this._canvas) && (this._canvas = null), isValid$3(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
26869
|
-
}
|
|
26870
|
-
}
|
|
26871
|
-
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
26872
|
-
|
|
26873
|
-
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
26874
|
-
const {
|
|
26875
|
-
x1: x1,
|
|
26876
|
-
y1: y1,
|
|
26877
|
-
x2: x2,
|
|
26878
|
-
y2: y2
|
|
26879
|
-
} = bounds;
|
|
26880
|
-
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);
|
|
26881
|
-
}
|
|
26882
|
-
class Bounds {
|
|
26883
|
-
constructor(bounds) {
|
|
26884
|
-
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
26885
|
-
}
|
|
26886
|
-
clone() {
|
|
26887
|
-
return new Bounds(this);
|
|
26888
|
-
}
|
|
26889
|
-
clear() {
|
|
26890
|
-
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
26891
|
-
}
|
|
26892
|
-
empty() {
|
|
26893
|
-
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
26894
|
-
}
|
|
26895
|
-
equals(b) {
|
|
26896
|
-
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
26897
|
-
}
|
|
26898
|
-
setValue() {
|
|
26899
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26900
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26901
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
26902
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
26903
|
-
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
26904
|
-
}
|
|
26905
|
-
set() {
|
|
26906
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26907
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26908
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
26909
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
26910
|
-
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;
|
|
26911
|
-
}
|
|
26912
|
-
add() {
|
|
26913
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26914
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26915
|
-
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;
|
|
26916
|
-
}
|
|
26917
|
-
expand() {
|
|
26918
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26919
|
-
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;
|
|
26920
|
-
}
|
|
26921
|
-
round() {
|
|
26922
|
-
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;
|
|
26923
|
-
}
|
|
26924
|
-
translate() {
|
|
26925
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26926
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26927
|
-
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
26928
|
-
}
|
|
26929
|
-
rotate() {
|
|
26930
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26931
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26932
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
26933
|
-
const p = this.rotatedPoints(angle, x, y);
|
|
26934
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
26935
|
-
}
|
|
26936
|
-
scale() {
|
|
26937
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26938
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26939
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
26940
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
26941
|
-
const p = this.scalePoints(sx, sy, x, y);
|
|
26942
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
26943
|
-
}
|
|
26944
|
-
union(b) {
|
|
26945
|
-
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;
|
|
26946
|
-
}
|
|
26947
|
-
intersect(b) {
|
|
26948
|
-
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;
|
|
26949
|
-
}
|
|
26950
|
-
encloses(b) {
|
|
26951
|
-
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
26952
|
-
}
|
|
26953
|
-
alignsWith(b) {
|
|
26954
|
-
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
26955
|
-
}
|
|
26956
|
-
intersects(b) {
|
|
26957
|
-
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
26958
|
-
}
|
|
26959
|
-
contains() {
|
|
26960
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26961
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26962
|
-
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
26963
|
-
}
|
|
26964
|
-
containsPoint(p) {
|
|
26965
|
-
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
26966
|
-
}
|
|
26967
|
-
width() {
|
|
26968
|
-
return this.empty() ? 0 : this.x2 - this.x1;
|
|
26969
|
-
}
|
|
26970
|
-
height() {
|
|
26971
|
-
return this.empty() ? 0 : this.y2 - this.y1;
|
|
26972
|
-
}
|
|
26973
|
-
scaleX() {
|
|
26974
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26975
|
-
return this.x1 *= s, this.x2 *= s, this;
|
|
26976
|
-
}
|
|
26977
|
-
scaleY() {
|
|
26978
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
26979
|
-
return this.y1 *= s, this.y2 *= s, this;
|
|
26980
|
-
}
|
|
26981
|
-
transformWithMatrix(matrix) {
|
|
26982
|
-
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
26983
|
-
}
|
|
26984
|
-
copy(b) {
|
|
26985
|
-
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
26986
|
-
}
|
|
26987
|
-
rotatedPoints(angle, x, y) {
|
|
26988
|
-
const {
|
|
26989
|
-
x1: x1,
|
|
26990
|
-
y1: y1,
|
|
26991
|
-
x2: x2,
|
|
26992
|
-
y2: y2
|
|
26993
|
-
} = this,
|
|
26994
|
-
cos = Math.cos(angle),
|
|
26995
|
-
sin = Math.sin(angle),
|
|
26996
|
-
cx = x - x * cos + y * sin,
|
|
26997
|
-
cy = y - x * sin - y * cos;
|
|
26998
|
-
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];
|
|
26999
|
-
}
|
|
27000
|
-
scalePoints(sx, sy, x, y) {
|
|
27001
|
-
const {
|
|
27002
|
-
x1: x1,
|
|
27003
|
-
y1: y1,
|
|
27004
|
-
x2: x2,
|
|
27005
|
-
y2: y2
|
|
27006
|
-
} = this;
|
|
27007
|
-
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
27008
|
-
}
|
|
27009
|
-
}
|
|
27010
|
-
class AABBBounds extends Bounds {}
|
|
27011
|
-
|
|
27012
26446
|
class Aggregator {
|
|
27013
26447
|
constructor(config) {
|
|
27014
26448
|
var _a;
|
|
@@ -41996,7 +41430,8 @@
|
|
|
41996
41430
|
updateReactContainer(this.table);
|
|
41997
41431
|
}
|
|
41998
41432
|
setLoadingHierarchyState(col, row) {
|
|
41999
|
-
const
|
|
41433
|
+
const cellGroup = this.getCell(col, row),
|
|
41434
|
+
iconGraphic = cellGroup.getChildByName("collapse", !0) || cellGroup.getChildByName("expand", !0);
|
|
42000
41435
|
if (iconGraphic) {
|
|
42001
41436
|
const loadingIcon = get$2()[InternalIconName.loadingIconName];
|
|
42002
41437
|
loadingIcon && dealWithIcon(loadingIcon, iconGraphic, col, row);
|
|
@@ -42337,7 +41772,7 @@
|
|
|
42337
41772
|
}) : state.select.ranges.push({
|
|
42338
41773
|
start: {
|
|
42339
41774
|
col: cellRange.start.col,
|
|
42340
|
-
row: row
|
|
41775
|
+
row: cellRange.start.row
|
|
42341
41776
|
},
|
|
42342
41777
|
end: {
|
|
42343
41778
|
col: cellRange.end.col,
|
|
@@ -42359,7 +41794,7 @@
|
|
|
42359
41794
|
skipBodyMerge: !0
|
|
42360
41795
|
}) : state.select.ranges.push({
|
|
42361
41796
|
start: {
|
|
42362
|
-
col: col,
|
|
41797
|
+
col: cellRange.start.col,
|
|
42363
41798
|
row: cellRange.start.row
|
|
42364
41799
|
},
|
|
42365
41800
|
end: {
|
|
@@ -43396,7 +42831,7 @@
|
|
|
43396
42831
|
if (this.select.selecting) {
|
|
43397
42832
|
if (this.select.selecting = !1, 0 === this.select.ranges.length) return;
|
|
43398
42833
|
const currentRange = this.select.ranges[this.select.ranges.length - 1];
|
|
43399
|
-
expendCellRange(currentRange, this.table);
|
|
42834
|
+
this.table.isSeriesNumber(this.select.cellPos.col, this.select.cellPos.row) || this.table.isHeader(this.select.cellPos.col, this.select.cellPos.row) || expendCellRange(currentRange, this.table);
|
|
43400
42835
|
let isSame = !1;
|
|
43401
42836
|
for (let i = 0; i < this.select.ranges.length - 1; i++) {
|
|
43402
42837
|
const range = this.select.ranges[i];
|
|
@@ -44218,7 +43653,7 @@
|
|
|
44218
43653
|
callback: globalPointerdownCallback
|
|
44219
43654
|
}), vglobal.addEventListener("pointerup", globalPointerupCallback), vglobal.addEventListener("pointerdown", globalPointerdownCallback), table.scenegraph.tableGroup.addEventListener("pointerdown", e => {
|
|
44220
43655
|
var _a, _b, _c, _d, _e;
|
|
44221
|
-
|
|
43656
|
+
table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE) && table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
44222
43657
|
event: e.nativeEvent
|
|
44223
43658
|
}), table.eventManager.isDown = !0, table.eventManager.LastBodyPointerXY = {
|
|
44224
43659
|
x: e.x,
|
|
@@ -44226,22 +43661,42 @@
|
|
|
44226
43661
|
}, table.eventManager.LastPointerXY = {
|
|
44227
43662
|
x: e.x,
|
|
44228
43663
|
y: e.y
|
|
44229
|
-
}
|
|
43664
|
+
};
|
|
44230
43665
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
44231
43666
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
44232
43667
|
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
|
|
44233
43668
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
44234
43669
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
44235
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
43670
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
44236
43671
|
if (!1 === isCompleteEdit) return;
|
|
44237
43672
|
const hitIcon = (null === (_c = null === (_b = null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target) || void 0 === _b ? void 0 : _b.role) || void 0 === _c ? void 0 : _c.startsWith("icon")) ? eventArgsSet.eventArgs.target : (null === (_d = e.target.role) || void 0 === _d ? void 0 : _d.startsWith("icon")) ? e.target : void 0;
|
|
44238
|
-
if (eventManager.downIcon = hitIcon, hitIcon && !1 !== hitIcon.attribute.interactive) hitIcon.attribute.funcType === IconFuncTypeEnum.dragReorder && (stateManager.startMoveCol(eventArgsSet.eventArgs.col, eventArgsSet.eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (
|
|
44239
|
-
|
|
44240
|
-
|
|
44241
|
-
|
|
44242
|
-
|
|
44243
|
-
|
|
44244
|
-
|
|
43673
|
+
if (eventManager.downIcon = hitIcon, hitIcon && !1 !== hitIcon.attribute.interactive) hitIcon.attribute.funcType === IconFuncTypeEnum.dragReorder && (stateManager.startMoveCol(eventArgsSet.eventArgs.col, eventArgsSet.eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_k = null === (_j = eventArgsSet.eventArgs) || void 0 === _j ? void 0 : _j.event) || void 0 === _k ? void 0 : _k.nativeEvent), stateManager.updateInteractionState(InteractionState.grabing));else {
|
|
43674
|
+
if (eventManager.cellIsHeaderCheck(eventArgsSet)) return;
|
|
43675
|
+
if ("touch" === e.pointerType) {
|
|
43676
|
+
if (eventManager.touchEnd = !1, eventManager.touchSetTimeout = setTimeout(() => {
|
|
43677
|
+
eventManager.isTouchdown = !1, eventManager.touchMove = !0, (eventManager.touchEnd || !eventManager.checkColumnResize(eventArgsSet, !0) && !eventManager.checkRowResize(eventArgsSet, !0)) && (eventManager.touchEnd || !eventManager.checkColumnMover(eventArgsSet)) ? eventManager.dealTableSelect(eventArgsSet) && !eventManager.touchEnd && stateManager.updateInteractionState(InteractionState.grabing) : stateManager.updateInteractionState(InteractionState.grabing);
|
|
43678
|
+
}, 500), table.hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL)) {
|
|
43679
|
+
const cellGoup = e.path.find(node => "cell" === node.role);
|
|
43680
|
+
"cell" !== (null == cellGoup ? void 0 : cellGoup.role) || !isValid$3(cellGoup.col) || !isValid$3(cellGoup.row) || cellGoup.col === table.stateManager.hover.cellPos.col && cellGoup.row === table.stateManager.hover.cellPos.row || cellGoup.col === (null === (_e = table.stateManager.hover.cellPosContainHeader) || void 0 === _e ? void 0 : _e.col) && cellGoup.row === (null === (_f = table.stateManager.hover.cellPosContainHeader) || void 0 === _f ? void 0 : _f.row) || table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {
|
|
43681
|
+
col: cellGoup.col,
|
|
43682
|
+
row: cellGoup.row,
|
|
43683
|
+
cellRange: table.getCellRangeRelativeRect({
|
|
43684
|
+
col: cellGoup.col,
|
|
43685
|
+
row: cellGoup.row
|
|
43686
|
+
}),
|
|
43687
|
+
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
|
|
43688
|
+
event: e.nativeEvent,
|
|
43689
|
+
target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
|
|
43690
|
+
mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
|
|
43691
|
+
});
|
|
43692
|
+
}
|
|
43693
|
+
eventManager.dealTableHover(eventArgsSet);
|
|
43694
|
+
} else {
|
|
43695
|
+
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
43696
|
+
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
43697
|
+
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
43698
|
+
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
43699
|
+
}
|
|
44245
43700
|
}
|
|
44246
43701
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_CELL)) {
|
|
44247
43702
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
@@ -44249,7 +43704,7 @@
|
|
|
44249
43704
|
col: eventArgsSet.eventArgs.col,
|
|
44250
43705
|
row: eventArgsSet.eventArgs.row,
|
|
44251
43706
|
event: e.nativeEvent,
|
|
44252
|
-
target: null === (
|
|
43707
|
+
target: null === (_l = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _l ? void 0 : _l.target,
|
|
44253
43708
|
mergeCellInfo: eventArgsSet.eventArgs.mergeInfo
|
|
44254
43709
|
});
|
|
44255
43710
|
}
|
|
@@ -45351,6 +44806,18 @@
|
|
|
45351
44806
|
}
|
|
45352
44807
|
return !1;
|
|
45353
44808
|
}
|
|
44809
|
+
cellIsHeaderCheck(eventArgsSet, update) {
|
|
44810
|
+
const {
|
|
44811
|
+
eventArgs: eventArgs
|
|
44812
|
+
} = eventArgsSet,
|
|
44813
|
+
{
|
|
44814
|
+
col: col,
|
|
44815
|
+
row: row,
|
|
44816
|
+
target: target
|
|
44817
|
+
} = eventArgs;
|
|
44818
|
+
if (!this.table.isHeader(col, row)) return !1;
|
|
44819
|
+
return "checkbox" === this.table.getCellType(eventArgs.col, eventArgs.row) && "checkbox" === target.name;
|
|
44820
|
+
}
|
|
45354
44821
|
checkCellFillhandle(eventArgsSet, update) {
|
|
45355
44822
|
var _a, _b, _c, _d;
|
|
45356
44823
|
if (null === (_a = this.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle) {
|
|
@@ -45375,7 +44842,7 @@
|
|
|
45375
44842
|
dealRowResize(xInTable, yInTable) {
|
|
45376
44843
|
this.table.stateManager.updateResizeRow(xInTable, yInTable);
|
|
45377
44844
|
}
|
|
45378
|
-
|
|
44845
|
+
checkColumnMover(eventArgsSet) {
|
|
45379
44846
|
var _a;
|
|
45380
44847
|
const {
|
|
45381
44848
|
eventArgs: eventArgs
|
|
@@ -47768,7 +47235,17 @@
|
|
|
47768
47235
|
const styles = [];
|
|
47769
47236
|
return customStyleIds.forEach(customStyleId => {
|
|
47770
47237
|
const styleOption = this.getCustomCellStyleOption(customStyleId);
|
|
47771
|
-
(null == styleOption ? void 0 : styleOption.style)
|
|
47238
|
+
if (isFunction$5(null == styleOption ? void 0 : styleOption.style)) {
|
|
47239
|
+
const style = styleOption.style({
|
|
47240
|
+
col: col,
|
|
47241
|
+
row: row,
|
|
47242
|
+
table: this.table,
|
|
47243
|
+
value: this.table.getCellValue(col, row),
|
|
47244
|
+
dataValue: this.table.getCellOriginValue(col, row),
|
|
47245
|
+
cellHeaderPaths: this.table.getCellHeaderPaths(col, row)
|
|
47246
|
+
});
|
|
47247
|
+
styles.push(style);
|
|
47248
|
+
} else (null == styleOption ? void 0 : styleOption.style) && styles.push(styleOption.style);
|
|
47772
47249
|
}), merge$1({}, ...styles);
|
|
47773
47250
|
}
|
|
47774
47251
|
}
|
|
@@ -48003,8 +47480,8 @@
|
|
|
48003
47480
|
}
|
|
48004
47481
|
constructor(container) {
|
|
48005
47482
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
48006
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
48007
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.17.1
|
|
47483
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
47484
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.17.1", 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");
|
|
48008
47485
|
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
48009
47486
|
const {
|
|
48010
47487
|
frozenColCount = 0,
|
|
@@ -48027,6 +47504,7 @@
|
|
|
48027
47504
|
rowResizeMode = "none",
|
|
48028
47505
|
resize: resize,
|
|
48029
47506
|
dragHeaderMode: dragHeaderMode,
|
|
47507
|
+
dragOrder: dragOrder,
|
|
48030
47508
|
showFrozenIcon: showFrozenIcon,
|
|
48031
47509
|
allowFrozenColCount: allowFrozenColCount,
|
|
48032
47510
|
padding: padding,
|
|
@@ -48053,7 +47531,7 @@
|
|
|
48053
47531
|
bottom: 0
|
|
48054
47532
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), isValid$3(canvasHeight) && isValid$3(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
48055
47533
|
const internalProps = this.internalProps = {};
|
|
48056
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_d = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _d ? _d : columnResizeMode, internalProps.rowResizeMode = null !== (_e = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _e ? _e : rowResizeMode, internalProps.dragHeaderMode = null
|
|
47534
|
+
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_d = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _d ? _d : columnResizeMode, internalProps.rowResizeMode = null !== (_e = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _e ? _e : rowResizeMode, internalProps.dragHeaderMode = null !== (_g = null !== (_f = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _f ? _f : dragHeaderMode) && void 0 !== _g ? _g : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
48057
47535
|
const that = this;
|
|
48058
47536
|
if (internalProps.calcWidthContext = {
|
|
48059
47537
|
_: internalProps,
|
|
@@ -48061,7 +47539,7 @@
|
|
|
48061
47539
|
var _a;
|
|
48062
47540
|
return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
48063
47541
|
}
|
|
48064
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (
|
|
47542
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_h = options.theme) && void 0 !== _h ? _h : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this), internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_j = options.allowFrozenColCount) && void 0 !== _j ? _j : 0, internalProps.limitMaxAutoWidth = null !== (_k = options.limitMaxAutoWidth) && void 0 !== _k ? _k : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this), this.eventManager = new EventManager(this), this.animationManager = new TableAnimationManager(this), options.legends) {
|
|
48065
47543
|
internalProps.legends = [];
|
|
48066
47544
|
const createLegend = Factory.getFunction("createLegend");
|
|
48067
47545
|
if (Array.isArray(options.legends)) {
|
|
@@ -48087,7 +47565,7 @@
|
|
|
48087
47565
|
}
|
|
48088
47566
|
if (internalProps.menu = Object.assign({
|
|
48089
47567
|
renderMode: "html"
|
|
48090
|
-
}, options.menu), Array.isArray(null === (
|
|
47568
|
+
}, options.menu), Array.isArray(null === (_l = options.menu) || void 0 === _l ? void 0 : _l.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_m = options.menu) || void 0 === _m ? void 0 : _m.dropDownMenuHighlight), (Array.isArray(null === (_o = options.menu) || void 0 === _o ? void 0 : _o.defaultHeaderMenuItems) || "function" == typeof (null === (_p = options.menu) || void 0 === _p ? void 0 : _p.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode) {
|
|
48091
47569
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
48092
47570
|
internalProps.menuHandler = new MenuHandler(this);
|
|
48093
47571
|
}
|
|
@@ -48095,7 +47573,7 @@
|
|
|
48095
47573
|
changedCells: new Map()
|
|
48096
47574
|
}, internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell);
|
|
48097
47575
|
const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
|
|
48098
|
-
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
47576
|
+
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_q = options.customCellStyle) && void 0 !== _q ? _q : [], null !== (_r = options.customCellStyleArrangement) && void 0 !== _r ? _r : [])), this._adjustCanvasSizeByOption();
|
|
48099
47577
|
}
|
|
48100
47578
|
_adjustCanvasSizeByOption() {
|
|
48101
47579
|
"auto" !== this.options.canvasHeight && "auto" !== this.options.canvasWidth || setTimeout(() => {
|
|
@@ -48832,7 +48310,7 @@
|
|
|
48832
48310
|
return super.fireListeners(type, event);
|
|
48833
48311
|
}
|
|
48834
48312
|
updateOption(options) {
|
|
48835
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
48313
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
48836
48314
|
this.options = options, this._hasAutoImageColumn = void 0;
|
|
48837
48315
|
const {
|
|
48838
48316
|
frozenColCount = 0,
|
|
@@ -48848,6 +48326,7 @@
|
|
|
48848
48326
|
rowResizeMode = "none",
|
|
48849
48327
|
resize: resize,
|
|
48850
48328
|
dragHeaderMode: dragHeaderMode,
|
|
48329
|
+
dragOrder: dragOrder,
|
|
48851
48330
|
showFrozenIcon: showFrozenIcon,
|
|
48852
48331
|
allowFrozenColCount: allowFrozenColCount,
|
|
48853
48332
|
padding: padding,
|
|
@@ -48872,9 +48351,9 @@
|
|
|
48872
48351
|
} = options;
|
|
48873
48352
|
pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio), padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), this.showFrozenIcon = "boolean" != typeof showFrozenIcon || showFrozenIcon, "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.widthMode = null != widthMode ? widthMode : "standard", this.heightMode = null != heightMode ? heightMode : "standard", this._widthAdaptiveMode = null != widthAdaptiveMode ? widthAdaptiveMode : "only-body", this._heightAdaptiveMode = null != heightAdaptiveMode ? heightAdaptiveMode : "only-body", this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight, this.customRender = customRender, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0;
|
|
48874
48353
|
const internalProps = this.internalProps;
|
|
48875
|
-
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_b = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _b ? _b : columnResizeMode, internalProps.rowResizeMode = null !== (_c = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _c ? _c : rowResizeMode, internalProps.dragHeaderMode = null
|
|
48354
|
+
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_b = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _b ? _b : columnResizeMode, internalProps.rowResizeMode = null !== (_c = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _c ? _c : rowResizeMode, internalProps.dragHeaderMode = null !== (_e = null !== (_d = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _d ? _d : dragHeaderMode) && void 0 !== _e ? _e : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_f = options.theme) && void 0 !== _f ? _f : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_g = options.allowFrozenColCount) && void 0 !== _g ? _g : 0, internalProps.limitMaxAutoWidth = null !== (_h = options.limitMaxAutoWidth) && void 0 !== _h ? _h : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_j = internalProps.legends) || void 0 === _j || _j.forEach(legend => {
|
|
48876
48355
|
null == legend || legend.release();
|
|
48877
|
-
}), null === (
|
|
48356
|
+
}), null === (_k = internalProps.title) || void 0 === _k || _k.release(), internalProps.title = null, null === (_l = internalProps.emptyTip) || void 0 === _l || _l.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
48878
48357
|
internalProps.legends = [];
|
|
48879
48358
|
const createLegend = Factory.getFunction("createLegend");
|
|
48880
48359
|
if (Array.isArray(options.legends)) {
|
|
@@ -48900,11 +48379,11 @@
|
|
|
48900
48379
|
}
|
|
48901
48380
|
if (internalProps.menu = Object.assign({
|
|
48902
48381
|
renderMode: "html"
|
|
48903
|
-
}, options.menu), Array.isArray(null === (
|
|
48382
|
+
}, options.menu), Array.isArray(null === (_m = options.menu) || void 0 === _m ? void 0 : _m.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_o = options.menu) || void 0 === _o ? void 0 : _o.dropDownMenuHighlight), (Array.isArray(null === (_p = options.menu) || void 0 === _p ? void 0 : _p.defaultHeaderMenuItems) || "function" == typeof (null === (_q = options.menu) || void 0 === _q ? void 0 : _q.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode && !internalProps.menuHandler) {
|
|
48904
48383
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
48905
48384
|
internalProps.menuHandler = new MenuHandler(this);
|
|
48906
48385
|
}
|
|
48907
|
-
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (
|
|
48386
|
+
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_r = this.customCellStylePlugin) || void 0 === _r || _r.updateCustomCell(null !== (_s = options.customCellStyle) && void 0 !== _s ? _s : [], null !== (_t = options.customCellStyleArrangement) && void 0 !== _t ? _t : []), this._adjustCanvasSizeByOption();
|
|
48908
48387
|
}
|
|
48909
48388
|
renderWithRecreateCells() {
|
|
48910
48389
|
this.internalProps.stick.changedCells.clear();
|
|
@@ -49728,13 +49207,13 @@
|
|
|
49728
49207
|
}
|
|
49729
49208
|
getBodyIndexByTableIndex(col, row) {
|
|
49730
49209
|
return {
|
|
49731
|
-
col: col - this.rowHeaderLevelCount,
|
|
49210
|
+
col: col - this.rowHeaderLevelCount - this.leftRowSeriesNumberCount,
|
|
49732
49211
|
row: row - this.columnHeaderLevelCount
|
|
49733
49212
|
};
|
|
49734
49213
|
}
|
|
49735
49214
|
getTableIndexByBodyIndex(col, row) {
|
|
49736
49215
|
return {
|
|
49737
|
-
col: col + this.rowHeaderLevelCount,
|
|
49216
|
+
col: col + this.rowHeaderLevelCount + this.leftRowSeriesNumberCount,
|
|
49738
49217
|
row: row + this.columnHeaderLevelCount
|
|
49739
49218
|
};
|
|
49740
49219
|
}
|
|
@@ -51913,7 +51392,8 @@
|
|
|
51913
51392
|
return !1;
|
|
51914
51393
|
}
|
|
51915
51394
|
moveHeaderPosition(source, target) {
|
|
51916
|
-
|
|
51395
|
+
var _a, _b;
|
|
51396
|
+
if (((null === (_a = this._table.options.dragOrder) || void 0 === _a ? void 0 : _a.validateDragOrderOnEnd(source, target)) || !(null === (_b = this._table.options.dragOrder) || void 0 === _b ? void 0 : _b.validateDragOrderOnEnd)) && this.canMoveHeaderPosition(source, target)) {
|
|
51917
51397
|
let sourceCellRange = this.getCellRange(source.col, source.row);
|
|
51918
51398
|
if (this.isColumnHeader(source.col, source.row)) {
|
|
51919
51399
|
const sourceSize = sourceCellRange.end.col - sourceCellRange.start.col + 1;
|
|
@@ -52682,18 +52162,18 @@
|
|
|
52682
52162
|
|
|
52683
52163
|
class ListTable extends BaseTable {
|
|
52684
52164
|
constructor(container, options) {
|
|
52685
|
-
var _a, _b, _c, _d, _e, _f;
|
|
52165
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
52686
52166
|
"node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), super(container, options), this.showHeader = !0;
|
|
52687
52167
|
const internalProps = this.internalProps;
|
|
52688
|
-
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (
|
|
52168
|
+
if (internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_d = null !== (_c = options.enableTreeNodeMerge) && void 0 !== _c ? _c : isValid$3(options.groupBy)) && void 0 !== _d && _d, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_e = options.showHeader) || void 0 === _e || _e, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, "node" !== Env.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
|
|
52689
52169
|
sortState: internalProps.sortState
|
|
52690
52170
|
}) : this.setRecords([]), options.title) {
|
|
52691
52171
|
const Title = Factory.getComponent("title");
|
|
52692
52172
|
internalProps.title = new Title(options.title, this), this.scenegraph.resize();
|
|
52693
52173
|
}
|
|
52694
|
-
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (
|
|
52174
|
+
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible();else {
|
|
52695
52175
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
52696
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
52176
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();
|
|
52697
52177
|
}
|
|
52698
52178
|
if (options.enableTreeStickCell) {
|
|
52699
52179
|
const ListTreeStickCellPlugin = Factory.getComponent("listTreeStickCellPlugin");
|
|
@@ -52895,9 +52375,9 @@
|
|
|
52895
52375
|
return ifCan;
|
|
52896
52376
|
}
|
|
52897
52377
|
updateOption(options) {
|
|
52898
|
-
var _a, _b, _c, _d, _e, _f;
|
|
52378
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
52899
52379
|
const internalProps = this.internalProps;
|
|
52900
|
-
if (super.updateOption(options), internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (
|
|
52380
|
+
if (super.updateOption(options), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$3(options.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
|
|
52901
52381
|
var _a;
|
|
52902
52382
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
52903
52383
|
}), internalProps.releaseList = null), options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
|
|
@@ -52906,9 +52386,9 @@
|
|
|
52906
52386
|
const Title = Factory.getComponent("title");
|
|
52907
52387
|
internalProps.title = new Title(options.title, this), this.scenegraph.resize();
|
|
52908
52388
|
}
|
|
52909
|
-
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (
|
|
52389
|
+
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible();else {
|
|
52910
52390
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
52911
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
52391
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();
|
|
52912
52392
|
}
|
|
52913
52393
|
return new Promise(resolve => {
|
|
52914
52394
|
setTimeout(resolve, 0);
|