@visactor/react-vtable 1.17.7-alpha.1 → 1.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/tag/tag.js +1 -2
- package/cjs/eventsUtils.d.ts +2 -0
- package/cjs/eventsUtils.js +2 -1
- package/cjs/eventsUtils.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/table-components/pivot/pivot-corner.js +2 -1
- package/dist/react-vtable.js +2070 -1855
- package/dist/react-vtable.min.js +2 -2
- package/es/components/tag/tag.js +1 -2
- package/es/eventsUtils.d.ts +2 -0
- package/es/eventsUtils.js +2 -1
- package/es/eventsUtils.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/table-components/pivot/pivot-corner.js +2 -1
- package/package.json +5 -5
package/dist/react-vtable.js
CHANGED
|
@@ -347,104 +347,64 @@
|
|
|
347
347
|
var eventemitter3Exports = eventemitter3.exports;
|
|
348
348
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
349
349
|
|
|
350
|
-
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
351
|
-
var isType$
|
|
352
|
-
|
|
353
|
-
const isBoolean = function (value) {
|
|
354
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
355
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
356
|
-
};
|
|
357
|
-
var isBoolean$1 = isBoolean;
|
|
350
|
+
const isType$2 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
351
|
+
var isType$3 = isType$2;
|
|
358
352
|
|
|
359
|
-
const isFunction = value => "function" == typeof value;
|
|
360
|
-
var isFunction$
|
|
353
|
+
const isFunction$2 = value => "function" == typeof value;
|
|
354
|
+
var isFunction$3 = isFunction$2;
|
|
361
355
|
|
|
362
|
-
const isNil = value => null == value;
|
|
363
|
-
var isNil$
|
|
356
|
+
const isNil$2 = value => null == value;
|
|
357
|
+
var isNil$3 = isNil$2;
|
|
364
358
|
|
|
365
|
-
const isValid = value => null != value;
|
|
366
|
-
var isValid$
|
|
359
|
+
const isValid$2 = value => null != value;
|
|
360
|
+
var isValid$3 = isValid$2;
|
|
367
361
|
|
|
368
|
-
const isObject = value => {
|
|
362
|
+
const isObject$2 = value => {
|
|
369
363
|
const type = typeof value;
|
|
370
364
|
return null !== value && "object" === type || "function" === type;
|
|
371
365
|
};
|
|
372
|
-
var isObject$
|
|
366
|
+
var isObject$3 = isObject$2;
|
|
373
367
|
|
|
374
|
-
const isObjectLike = value => "object" == typeof value && null !== value;
|
|
375
|
-
var isObjectLike$
|
|
368
|
+
const isObjectLike$2 = value => "object" == typeof value && null !== value;
|
|
369
|
+
var isObjectLike$3 = isObjectLike$2;
|
|
376
370
|
|
|
377
|
-
const isPlainObject = function (value) {
|
|
378
|
-
if (!isObjectLike$
|
|
371
|
+
const isPlainObject$2 = function (value) {
|
|
372
|
+
if (!isObjectLike$3(value) || !isType$3(value, "Object")) return !1;
|
|
379
373
|
if (null === Object.getPrototypeOf(value)) return !0;
|
|
380
374
|
let proto = value;
|
|
381
375
|
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
382
376
|
return Object.getPrototypeOf(value) === proto;
|
|
383
377
|
};
|
|
384
|
-
var isPlainObject$
|
|
378
|
+
var isPlainObject$3 = isPlainObject$2;
|
|
385
379
|
|
|
386
|
-
const isString = function (value) {
|
|
380
|
+
const isString$2 = function (value) {
|
|
387
381
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
388
382
|
const type = typeof value;
|
|
389
|
-
return fuzzy ? "string" === type : "string" === type || isType$
|
|
383
|
+
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
390
384
|
};
|
|
391
|
-
var isString$
|
|
385
|
+
var isString$3 = isString$2;
|
|
392
386
|
|
|
393
|
-
const isArray = value => Array.isArray ? Array.isArray(value) : isType$
|
|
394
|
-
var isArray$
|
|
387
|
+
const isArray$2 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
388
|
+
var isArray$3 = isArray$2;
|
|
395
389
|
|
|
396
|
-
const isArrayLike = function (value) {
|
|
390
|
+
const isArrayLike$2 = function (value) {
|
|
397
391
|
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
398
392
|
};
|
|
399
|
-
var isArrayLike$
|
|
393
|
+
var isArrayLike$3 = isArrayLike$2;
|
|
400
394
|
|
|
401
|
-
const isNumber = function (value) {
|
|
395
|
+
const isNumber$2 = function (value) {
|
|
402
396
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
403
397
|
const type = typeof value;
|
|
404
|
-
return fuzzy ? "number" === type : "number" === type || isType$
|
|
398
|
+
return fuzzy ? "number" === type : "number" === type || isType$3(value, "Number");
|
|
405
399
|
};
|
|
406
|
-
var isNumber$
|
|
407
|
-
|
|
408
|
-
const isValidNumber = value => isNumber$1(value) && Number.isFinite(value);
|
|
409
|
-
var isValidNumber$1 = isValidNumber;
|
|
410
|
-
|
|
411
|
-
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
412
|
-
var isValidUrl$1 = isValidUrl;
|
|
413
|
-
|
|
414
|
-
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);
|
|
415
|
-
var isBase64$1 = isBase64;
|
|
416
|
-
|
|
417
|
-
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
418
|
-
var getType$1 = getType;
|
|
419
|
-
|
|
420
|
-
const objectProto = Object.prototype,
|
|
421
|
-
isPrototype = function (value) {
|
|
422
|
-
const Ctor = value && value.constructor;
|
|
423
|
-
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
|
|
424
|
-
};
|
|
425
|
-
var isPrototype$1 = isPrototype;
|
|
426
|
-
|
|
427
|
-
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
428
|
-
function isEmpty(value) {
|
|
429
|
-
if (isNil$1(value)) return !0;
|
|
430
|
-
if (isArrayLike$1(value)) return !value.length;
|
|
431
|
-
const type = getType$1(value);
|
|
432
|
-
if ("Map" === type || "Set" === type) return !value.size;
|
|
433
|
-
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
434
|
-
for (const key in value) if (hasOwnProperty$1.call(value, key)) return !1;
|
|
435
|
-
return !0;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
439
|
-
has = (object, key) => null != object && hasOwnProperty.call(object, key);
|
|
440
|
-
var has$1 = has;
|
|
400
|
+
var isNumber$3 = isNumber$2;
|
|
441
401
|
|
|
442
|
-
function baseMerge(target, source) {
|
|
402
|
+
function baseMerge$1(target, source) {
|
|
443
403
|
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
444
404
|
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
445
405
|
if (source) {
|
|
446
406
|
if (target === source) return;
|
|
447
|
-
if (isValid$
|
|
407
|
+
if (isValid$3(source) && "object" == typeof source) {
|
|
448
408
|
const iterable = Object(source),
|
|
449
409
|
props = [];
|
|
450
410
|
for (const key in iterable) props.push(key);
|
|
@@ -454,51 +414,51 @@
|
|
|
454
414
|
propIndex = -1;
|
|
455
415
|
for (; length--;) {
|
|
456
416
|
const key = props[++propIndex];
|
|
457
|
-
!isValid$
|
|
417
|
+
!isValid$3(iterable[key]) || "object" != typeof iterable[key] || skipTargetArray && isArray$3(target[key]) ? assignMergeValue$1(target, key, iterable[key]) : baseMergeDeep$1(target, source, key, shallowArray, skipTargetArray);
|
|
458
418
|
}
|
|
459
419
|
}
|
|
460
420
|
}
|
|
461
421
|
}
|
|
462
|
-
function baseMergeDeep(target, source, key) {
|
|
422
|
+
function baseMergeDeep$1(target, source, key) {
|
|
463
423
|
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
464
424
|
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
465
425
|
const objValue = target[key],
|
|
466
426
|
srcValue = source[key];
|
|
467
427
|
let newValue = source[key],
|
|
468
428
|
isCommon = !0;
|
|
469
|
-
if (isArray$
|
|
470
|
-
if (shallowArray) newValue = [];else if (isArray$
|
|
429
|
+
if (isArray$3(srcValue)) {
|
|
430
|
+
if (shallowArray) newValue = [];else if (isArray$3(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
471
431
|
newValue = new Array(objValue.length);
|
|
472
432
|
let index = -1;
|
|
473
433
|
const length = objValue.length;
|
|
474
434
|
for (; ++index < length;) newValue[index] = objValue[index];
|
|
475
435
|
}
|
|
476
|
-
} else isPlainObject$
|
|
477
|
-
isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
|
|
436
|
+
} else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
437
|
+
isCommon && baseMerge$1(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue$1(target, key, newValue);
|
|
478
438
|
}
|
|
479
|
-
function assignMergeValue(target, key, value) {
|
|
480
|
-
(void 0 !== value && !eq(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
439
|
+
function assignMergeValue$1(target, key, value) {
|
|
440
|
+
(void 0 !== value && !eq$1(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
481
441
|
}
|
|
482
|
-
function eq(value, other) {
|
|
442
|
+
function eq$1(value, other) {
|
|
483
443
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
484
444
|
}
|
|
485
|
-
function merge(target) {
|
|
445
|
+
function merge$1(target) {
|
|
486
446
|
let sourceIndex = -1;
|
|
487
447
|
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
488
448
|
for (; ++sourceIndex < length;) {
|
|
489
|
-
baseMerge(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
449
|
+
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
490
450
|
}
|
|
491
451
|
return target;
|
|
492
452
|
}
|
|
493
453
|
|
|
494
454
|
function pickWithout(obj, keys) {
|
|
495
|
-
if (!obj || !isPlainObject$
|
|
455
|
+
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
496
456
|
const result = {};
|
|
497
457
|
return Object.keys(obj).forEach(k => {
|
|
498
458
|
const v = obj[k];
|
|
499
459
|
let match = !1;
|
|
500
460
|
keys.forEach(itKey => {
|
|
501
|
-
(isString$
|
|
461
|
+
(isString$3(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
502
462
|
}), match || (result[k] = v);
|
|
503
463
|
}), result;
|
|
504
464
|
}
|
|
@@ -515,14 +475,14 @@
|
|
|
515
475
|
if (null == a || null == b) return !1;
|
|
516
476
|
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
517
477
|
if (objToString(a) !== objToString(b)) return !1;
|
|
518
|
-
if (isFunction$
|
|
478
|
+
if (isFunction$3(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
519
479
|
if ("object" != typeof a) return !1;
|
|
520
|
-
if (isArray$
|
|
480
|
+
if (isArray$3(a)) {
|
|
521
481
|
if (a.length !== b.length) return !1;
|
|
522
482
|
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
523
483
|
return !0;
|
|
524
484
|
}
|
|
525
|
-
if (!isPlainObject$
|
|
485
|
+
if (!isPlainObject$3(a)) return !1;
|
|
526
486
|
const ka = objectKeys(a),
|
|
527
487
|
kb = objectKeys(b);
|
|
528
488
|
if (ka.length !== kb.length) return !1;
|
|
@@ -535,1900 +495,2127 @@
|
|
|
535
495
|
return !0;
|
|
536
496
|
}
|
|
537
497
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
const index = this._onErrorHandler.findIndex(h => h === handler);
|
|
580
|
-
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
581
|
-
}
|
|
582
|
-
callErrorHandler() {
|
|
583
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
584
|
-
args[_key] = arguments[_key];
|
|
585
|
-
}
|
|
586
|
-
this._onErrorHandler.forEach(h => h(...args));
|
|
587
|
-
}
|
|
588
|
-
canLogInfo() {
|
|
589
|
-
return this._level >= LoggerLevel.Info;
|
|
590
|
-
}
|
|
591
|
-
canLogDebug() {
|
|
592
|
-
return this._level >= LoggerLevel.Debug;
|
|
593
|
-
}
|
|
594
|
-
canLogError() {
|
|
595
|
-
return this._level >= LoggerLevel.Error;
|
|
596
|
-
}
|
|
597
|
-
canLogWarn() {
|
|
598
|
-
return this._level >= LoggerLevel.Warn;
|
|
599
|
-
}
|
|
600
|
-
level(levelValue) {
|
|
601
|
-
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
602
|
-
}
|
|
603
|
-
error() {
|
|
604
|
-
var _a;
|
|
605
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
606
|
-
args[_key2] = arguments[_key2];
|
|
607
|
-
}
|
|
608
|
-
return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler(...args) : log(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
|
|
609
|
-
}
|
|
610
|
-
warn() {
|
|
611
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
612
|
-
args[_key3] = arguments[_key3];
|
|
613
|
-
}
|
|
614
|
-
return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
|
|
615
|
-
}
|
|
616
|
-
info() {
|
|
617
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
618
|
-
args[_key4] = arguments[_key4];
|
|
619
|
-
}
|
|
620
|
-
return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
|
|
621
|
-
}
|
|
622
|
-
debug() {
|
|
623
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
624
|
-
args[_key5] = arguments[_key5];
|
|
625
|
-
}
|
|
626
|
-
return this._level >= LoggerLevel.Debug && log(this._method || "log", "DEBUG", args), this;
|
|
498
|
+
const calculateAnchorOfBounds$1 = (bounds, anchorType) => {
|
|
499
|
+
const {
|
|
500
|
+
x1: x1,
|
|
501
|
+
x2: x2,
|
|
502
|
+
y1: y1,
|
|
503
|
+
y2: y2
|
|
504
|
+
} = bounds,
|
|
505
|
+
rectWidth = Math.abs(x2 - x1),
|
|
506
|
+
rectHeight = Math.abs(y2 - y1);
|
|
507
|
+
let anchorX = (x1 + x2) / 2,
|
|
508
|
+
anchorY = (y1 + y2) / 2,
|
|
509
|
+
sx = 0,
|
|
510
|
+
sy = 0;
|
|
511
|
+
switch (anchorType) {
|
|
512
|
+
case "top":
|
|
513
|
+
case "inside-top":
|
|
514
|
+
sy = -.5;
|
|
515
|
+
break;
|
|
516
|
+
case "bottom":
|
|
517
|
+
case "inside-bottom":
|
|
518
|
+
sy = .5;
|
|
519
|
+
break;
|
|
520
|
+
case "left":
|
|
521
|
+
case "inside-left":
|
|
522
|
+
sx = -.5;
|
|
523
|
+
break;
|
|
524
|
+
case "right":
|
|
525
|
+
case "inside-right":
|
|
526
|
+
sx = .5;
|
|
527
|
+
break;
|
|
528
|
+
case "top-right":
|
|
529
|
+
sx = .5, sy = -.5;
|
|
530
|
+
break;
|
|
531
|
+
case "top-left":
|
|
532
|
+
sx = -.5, sy = -.5;
|
|
533
|
+
break;
|
|
534
|
+
case "bottom-right":
|
|
535
|
+
sx = .5, sy = .5;
|
|
536
|
+
break;
|
|
537
|
+
case "bottom-left":
|
|
538
|
+
sx = -.5, sy = .5;
|
|
627
539
|
}
|
|
628
|
-
|
|
629
|
-
|
|
540
|
+
return anchorX += sx * rectWidth, anchorY += sy * rectHeight, {
|
|
541
|
+
x: anchorX,
|
|
542
|
+
y: anchorY
|
|
543
|
+
};
|
|
544
|
+
};
|
|
630
545
|
|
|
631
|
-
const
|
|
632
|
-
|
|
546
|
+
const styleStringToObject$1 = function () {
|
|
547
|
+
let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
548
|
+
const res = {};
|
|
549
|
+
return styleStr.split(";").forEach(item => {
|
|
550
|
+
if (item) {
|
|
551
|
+
const arr = item.split(":");
|
|
552
|
+
if (2 === arr.length) {
|
|
553
|
+
const key = arr[0].trim(),
|
|
554
|
+
value = arr[1].trim();
|
|
555
|
+
key && value && (res[key] = value);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}), res;
|
|
633
559
|
};
|
|
634
|
-
var clamp$1 = clamp;
|
|
635
560
|
|
|
636
|
-
|
|
637
|
-
const pi = Math.PI;
|
|
638
|
-
const halfPi$1 = pi / 2;
|
|
639
|
-
const tau = 2 * pi;
|
|
640
|
-
const pi2 = 2 * Math.PI;
|
|
641
|
-
const abs = Math.abs;
|
|
642
|
-
const atan2 = Math.atan2;
|
|
643
|
-
const cos = Math.cos;
|
|
644
|
-
const max = Math.max;
|
|
645
|
-
const min = Math.min;
|
|
646
|
-
const sin = Math.sin;
|
|
647
|
-
const sqrt = Math.sqrt;
|
|
648
|
-
const pow = Math.pow;
|
|
649
|
-
function asin(x) {
|
|
650
|
-
return x >= 1 ? halfPi$1 : x <= -1 ? -halfPi$1 : Math.asin(x);
|
|
651
|
-
}
|
|
561
|
+
var reactIs = {exports: {}};
|
|
652
562
|
|
|
653
|
-
|
|
654
|
-
constructor() {
|
|
655
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
656
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
657
|
-
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
658
|
-
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
659
|
-
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
660
|
-
}
|
|
661
|
-
clone() {
|
|
662
|
-
return new Point(this.x, this.y);
|
|
663
|
-
}
|
|
664
|
-
copyFrom(p) {
|
|
665
|
-
return this.x = p.x, this.y = p.y, this.x1 = p.x1, this.y1 = p.y1, this.defined = p.defined, this.context = p.context, this;
|
|
666
|
-
}
|
|
667
|
-
set(x, y) {
|
|
668
|
-
return this.x = x, this.y = y, this;
|
|
669
|
-
}
|
|
670
|
-
add(point) {
|
|
671
|
-
return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
672
|
-
}
|
|
673
|
-
sub(point) {
|
|
674
|
-
return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
675
|
-
}
|
|
676
|
-
multi(point) {
|
|
677
|
-
throw new Error("暂不支持");
|
|
678
|
-
}
|
|
679
|
-
div(point) {
|
|
680
|
-
throw new Error("暂不支持");
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
class PointService {
|
|
684
|
-
static distancePP(p1, p2) {
|
|
685
|
-
return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
|
|
686
|
-
}
|
|
687
|
-
static distanceNN(x, y, x1, y1) {
|
|
688
|
-
return sqrt(pow(x - x1, 2) + pow(y - y1, 2));
|
|
689
|
-
}
|
|
690
|
-
static distancePN(point, x, y) {
|
|
691
|
-
return sqrt(pow(x - point.x, 2) + pow(y - point.y, 2));
|
|
692
|
-
}
|
|
693
|
-
static pointAtPP(p1, p2, t) {
|
|
694
|
-
return new Point((p2.x - p1.x) * t + p1.x, (p2.y - p1.y) * t + p1.y);
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
function degreeToRadian(degree) {
|
|
699
|
-
return degree * (Math.PI / 180);
|
|
700
|
-
}
|
|
701
|
-
function radianToDegree(radian) {
|
|
702
|
-
return 180 * radian / Math.PI;
|
|
703
|
-
}
|
|
704
|
-
const clampRadian = function () {
|
|
705
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
706
|
-
if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
707
|
-
return angle;
|
|
708
|
-
};
|
|
709
|
-
const clampAngleByRadian = clampRadian;
|
|
563
|
+
var reactIs_production_min = {};
|
|
710
564
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
565
|
+
/**
|
|
566
|
+
* @license React
|
|
567
|
+
* react-is.production.min.js
|
|
568
|
+
*
|
|
569
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
570
|
+
*
|
|
571
|
+
* This source code is licensed under the MIT license found in the
|
|
572
|
+
* LICENSE file in the root directory of this source tree.
|
|
573
|
+
*/
|
|
574
|
+
var hasRequiredReactIs_production_min;
|
|
575
|
+
function requireReactIs_production_min() {
|
|
576
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
577
|
+
hasRequiredReactIs_production_min = 1;
|
|
578
|
+
var b = Symbol.for("react.element"),
|
|
579
|
+
c = Symbol.for("react.portal"),
|
|
580
|
+
d = Symbol.for("react.fragment"),
|
|
581
|
+
e = Symbol.for("react.strict_mode"),
|
|
582
|
+
f = Symbol.for("react.profiler"),
|
|
583
|
+
g = Symbol.for("react.provider"),
|
|
584
|
+
h = Symbol.for("react.context"),
|
|
585
|
+
k = Symbol.for("react.server_context"),
|
|
586
|
+
l = Symbol.for("react.forward_ref"),
|
|
587
|
+
m = Symbol.for("react.suspense"),
|
|
588
|
+
n = Symbol.for("react.suspense_list"),
|
|
589
|
+
p = Symbol.for("react.memo"),
|
|
590
|
+
q = Symbol.for("react.lazy"),
|
|
591
|
+
t = Symbol.for("react.offscreen"),
|
|
592
|
+
u;
|
|
593
|
+
u = Symbol.for("react.module.reference");
|
|
594
|
+
function v(a) {
|
|
595
|
+
if ("object" === typeof a && null !== a) {
|
|
596
|
+
var r = a.$$typeof;
|
|
597
|
+
switch (r) {
|
|
598
|
+
case b:
|
|
599
|
+
switch (a = a.type, a) {
|
|
600
|
+
case d:
|
|
601
|
+
case f:
|
|
602
|
+
case e:
|
|
603
|
+
case m:
|
|
604
|
+
case n:
|
|
605
|
+
return a;
|
|
606
|
+
default:
|
|
607
|
+
switch (a = a && a.$$typeof, a) {
|
|
608
|
+
case k:
|
|
609
|
+
case h:
|
|
610
|
+
case l:
|
|
611
|
+
case q:
|
|
612
|
+
case p:
|
|
613
|
+
case g:
|
|
614
|
+
return a;
|
|
615
|
+
default:
|
|
616
|
+
return r;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
case c:
|
|
620
|
+
return r;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
reactIs_production_min.ContextConsumer = h;
|
|
625
|
+
reactIs_production_min.ContextProvider = g;
|
|
626
|
+
reactIs_production_min.Element = b;
|
|
627
|
+
reactIs_production_min.ForwardRef = l;
|
|
628
|
+
reactIs_production_min.Fragment = d;
|
|
629
|
+
reactIs_production_min.Lazy = q;
|
|
630
|
+
reactIs_production_min.Memo = p;
|
|
631
|
+
reactIs_production_min.Portal = c;
|
|
632
|
+
reactIs_production_min.Profiler = f;
|
|
633
|
+
reactIs_production_min.StrictMode = e;
|
|
634
|
+
reactIs_production_min.Suspense = m;
|
|
635
|
+
reactIs_production_min.SuspenseList = n;
|
|
636
|
+
reactIs_production_min.isAsyncMode = function () {
|
|
637
|
+
return !1;
|
|
726
638
|
};
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
639
|
+
reactIs_production_min.isConcurrentMode = function () {
|
|
640
|
+
return !1;
|
|
730
641
|
};
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
return {
|
|
734
|
-
x: (box.x1 + box.x2) / 2,
|
|
735
|
-
y: (box.y1 + box.y2) / 2
|
|
642
|
+
reactIs_production_min.isContextConsumer = function (a) {
|
|
643
|
+
return v(a) === h;
|
|
736
644
|
};
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
const deg = isDeg ? degreeToRadian(box.angle) : box.angle,
|
|
740
|
-
cp = getCenterPoint(box);
|
|
741
|
-
return [rotatePoint({
|
|
742
|
-
x: box.x1,
|
|
743
|
-
y: box.y1
|
|
744
|
-
}, deg, cp), rotatePoint({
|
|
745
|
-
x: box.x2,
|
|
746
|
-
y: box.y1
|
|
747
|
-
}, deg, cp), rotatePoint({
|
|
748
|
-
x: box.x2,
|
|
749
|
-
y: box.y2
|
|
750
|
-
}, deg, cp), rotatePoint({
|
|
751
|
-
x: box.x1,
|
|
752
|
-
y: box.y2
|
|
753
|
-
}, deg, cp)];
|
|
754
|
-
}
|
|
755
|
-
function isRotateAABBIntersect(box1, box2) {
|
|
756
|
-
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
757
|
-
const rect1 = toRect(box1, isDeg),
|
|
758
|
-
rect2 = toRect(box2, isDeg),
|
|
759
|
-
vector = (start, end) => [end.x - start.x, end.y - start.y],
|
|
760
|
-
vp1p2 = vector(getCenterPoint(box1), getCenterPoint(box2)),
|
|
761
|
-
AB = vector(rect1[0], rect1[1]),
|
|
762
|
-
BC = vector(rect1[1], rect1[2]),
|
|
763
|
-
A1B1 = vector(rect2[0], rect2[1]),
|
|
764
|
-
B1C1 = vector(rect2[1], rect2[2]),
|
|
765
|
-
deg11 = isDeg ? degreeToRadian(box1.angle) : box1.angle;
|
|
766
|
-
let deg12 = isDeg ? degreeToRadian(90 - box1.angle) : box1.angle + halfPi$1;
|
|
767
|
-
const deg21 = isDeg ? degreeToRadian(box2.angle) : box2.angle;
|
|
768
|
-
let deg22 = isDeg ? degreeToRadian(90 - box2.angle) : box2.angle + halfPi$1;
|
|
769
|
-
deg12 > pi2 && (deg12 -= pi2), deg22 > pi2 && (deg22 -= pi2);
|
|
770
|
-
const isCover = (checkAxisRadius, deg, targetAxis1, targetAxis2) => {
|
|
771
|
-
const checkAxis = [Math.cos(deg), Math.sin(deg)];
|
|
772
|
-
return checkAxisRadius + (getProjectionRadius(checkAxis, targetAxis1) + getProjectionRadius(checkAxis, targetAxis2)) / 2 > getProjectionRadius(checkAxis, vp1p2);
|
|
645
|
+
reactIs_production_min.isContextProvider = function (a) {
|
|
646
|
+
return v(a) === g;
|
|
773
647
|
};
|
|
774
|
-
|
|
648
|
+
reactIs_production_min.isElement = function (a) {
|
|
649
|
+
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
650
|
+
};
|
|
651
|
+
reactIs_production_min.isForwardRef = function (a) {
|
|
652
|
+
return v(a) === l;
|
|
653
|
+
};
|
|
654
|
+
reactIs_production_min.isFragment = function (a) {
|
|
655
|
+
return v(a) === d;
|
|
656
|
+
};
|
|
657
|
+
reactIs_production_min.isLazy = function (a) {
|
|
658
|
+
return v(a) === q;
|
|
659
|
+
};
|
|
660
|
+
reactIs_production_min.isMemo = function (a) {
|
|
661
|
+
return v(a) === p;
|
|
662
|
+
};
|
|
663
|
+
reactIs_production_min.isPortal = function (a) {
|
|
664
|
+
return v(a) === c;
|
|
665
|
+
};
|
|
666
|
+
reactIs_production_min.isProfiler = function (a) {
|
|
667
|
+
return v(a) === f;
|
|
668
|
+
};
|
|
669
|
+
reactIs_production_min.isStrictMode = function (a) {
|
|
670
|
+
return v(a) === e;
|
|
671
|
+
};
|
|
672
|
+
reactIs_production_min.isSuspense = function (a) {
|
|
673
|
+
return v(a) === m;
|
|
674
|
+
};
|
|
675
|
+
reactIs_production_min.isSuspenseList = function (a) {
|
|
676
|
+
return v(a) === n;
|
|
677
|
+
};
|
|
678
|
+
reactIs_production_min.isValidElementType = function (a) {
|
|
679
|
+
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? !0 : !1;
|
|
680
|
+
};
|
|
681
|
+
reactIs_production_min.typeOf = v;
|
|
682
|
+
return reactIs_production_min;
|
|
775
683
|
}
|
|
776
684
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
780
|
-
fontSizeScale || (fontSizeScale = 1);
|
|
781
|
-
const {
|
|
782
|
-
fontStyle = defaultAttr.fontStyle,
|
|
783
|
-
fontVariant = defaultAttr.fontVariant,
|
|
784
|
-
fontWeight = defaultAttr.fontWeight,
|
|
785
|
-
fontSize = defaultAttr.fontSize,
|
|
786
|
-
fontFamily = defaultAttr.fontFamily
|
|
787
|
-
} = text;
|
|
788
|
-
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
685
|
+
{
|
|
686
|
+
reactIs.exports = requireReactIs_production_min();
|
|
789
687
|
}
|
|
688
|
+
var reactIsExports = reactIs.exports;
|
|
790
689
|
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
case "top":
|
|
806
|
-
case "inside-top":
|
|
807
|
-
sy = -.5;
|
|
808
|
-
break;
|
|
809
|
-
case "bottom":
|
|
810
|
-
case "inside-bottom":
|
|
811
|
-
sy = .5;
|
|
812
|
-
break;
|
|
813
|
-
case "left":
|
|
814
|
-
case "inside-left":
|
|
815
|
-
sx = -.5;
|
|
816
|
-
break;
|
|
817
|
-
case "right":
|
|
818
|
-
case "inside-right":
|
|
819
|
-
sx = .5;
|
|
820
|
-
break;
|
|
821
|
-
case "top-right":
|
|
822
|
-
sx = .5, sy = -.5;
|
|
823
|
-
break;
|
|
824
|
-
case "top-left":
|
|
825
|
-
sx = -.5, sy = -.5;
|
|
826
|
-
break;
|
|
827
|
-
case "bottom-right":
|
|
828
|
-
sx = .5, sy = .5;
|
|
829
|
-
break;
|
|
830
|
-
case "bottom-left":
|
|
831
|
-
sx = -.5, sy = .5;
|
|
832
|
-
}
|
|
833
|
-
return anchorX += sx * rectWidth, anchorY += sy * rectHeight, {
|
|
834
|
-
x: anchorX,
|
|
835
|
-
y: anchorY
|
|
836
|
-
};
|
|
690
|
+
const toArray = (children) => {
|
|
691
|
+
let result = [];
|
|
692
|
+
React.Children.forEach(children, child => {
|
|
693
|
+
if (isNil$3(child)) {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
if (reactIsExports.isFragment(child)) {
|
|
697
|
+
result = result.concat(toArray(child.props.children));
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
result.push(child);
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
return result;
|
|
837
704
|
};
|
|
838
705
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
return
|
|
706
|
+
const REACT_PRIVATE_PROPS = ['children', 'hooks', 'ref'];
|
|
707
|
+
|
|
708
|
+
const EVENT_TYPE = {
|
|
709
|
+
...vtable.TABLE_EVENT_TYPE,
|
|
710
|
+
...vtable.PIVOT_TABLE_EVENT_TYPE,
|
|
711
|
+
...vtable.PIVOT_CHART_EVENT_TYPE
|
|
712
|
+
};
|
|
713
|
+
const TABLE_EVENTS = {
|
|
714
|
+
onClickCell: EVENT_TYPE.CLICK_CELL,
|
|
715
|
+
onDblClickCell: EVENT_TYPE.DBLCLICK_CELL,
|
|
716
|
+
onMouseDownCell: EVENT_TYPE.MOUSEDOWN_CELL,
|
|
717
|
+
onMouseUpCell: EVENT_TYPE.MOUSEUP_CELL,
|
|
718
|
+
onSelectedCell: EVENT_TYPE.SELECTED_CELL,
|
|
719
|
+
onSelectedClear: EVENT_TYPE.SELECTED_CLEAR,
|
|
720
|
+
onKeyDown: EVENT_TYPE.KEYDOWN,
|
|
721
|
+
onMouseEnterTable: EVENT_TYPE.MOUSEENTER_TABLE,
|
|
722
|
+
onMouseLeaveTable: EVENT_TYPE.MOUSELEAVE_TABLE,
|
|
723
|
+
onMouseDownTable: EVENT_TYPE.MOUSEDOWN_TABLE,
|
|
724
|
+
onMouseMoveCell: EVENT_TYPE.MOUSEMOVE_CELL,
|
|
725
|
+
onMouseMoveTable: EVENT_TYPE.MOUSEMOVE_TABLE,
|
|
726
|
+
onMouseEnterCell: EVENT_TYPE.MOUSEENTER_CELL,
|
|
727
|
+
onMouseLeaveCell: EVENT_TYPE.MOUSELEAVE_CELL,
|
|
728
|
+
onContextMenuCell: EVENT_TYPE.CONTEXTMENU_CELL,
|
|
729
|
+
onResizeColumn: EVENT_TYPE.RESIZE_COLUMN,
|
|
730
|
+
onResizeColumnEnd: EVENT_TYPE.RESIZE_COLUMN_END,
|
|
731
|
+
onResizeRow: EVENT_TYPE.RESIZE_ROW,
|
|
732
|
+
onResizeRowEnd: EVENT_TYPE.RESIZE_ROW_END,
|
|
733
|
+
onChangeHeaderPositionStart: EVENT_TYPE.CHANGE_HEADER_POSITION_START,
|
|
734
|
+
onChangeHeaderPosition: EVENT_TYPE.CHANGE_HEADER_POSITION,
|
|
735
|
+
onChangeHeaderPositionFail: EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL,
|
|
736
|
+
onSortClick: EVENT_TYPE.SORT_CLICK,
|
|
737
|
+
onAfterSort: EVENT_TYPE.AFTER_SORT,
|
|
738
|
+
onFreezeClick: EVENT_TYPE.FREEZE_CLICK,
|
|
739
|
+
onScroll: EVENT_TYPE.SCROLL,
|
|
740
|
+
onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END,
|
|
741
|
+
onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
|
|
742
|
+
onDropdownMenuClick: EVENT_TYPE.DROPDOWN_MENU_CLICK,
|
|
743
|
+
onMouseOverChartSymbol: EVENT_TYPE.MOUSEOVER_CHART_SYMBOL,
|
|
744
|
+
onDragSelectEnd: EVENT_TYPE.DRAG_SELECT_END,
|
|
745
|
+
onCopyData: EVENT_TYPE.COPY_DATA,
|
|
746
|
+
onDropdownIconClick: EVENT_TYPE.DROPDOWN_ICON_CLICK,
|
|
747
|
+
onDropdownMenuClear: EVENT_TYPE.DROPDOWN_MENU_CLEAR,
|
|
748
|
+
onTreeHierarchyStateChange: EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,
|
|
749
|
+
onShowMenu: EVENT_TYPE.SHOW_MENU,
|
|
750
|
+
onHideMenu: EVENT_TYPE.HIDE_MENU,
|
|
751
|
+
onIconClick: EVENT_TYPE.ICON_CLICK,
|
|
752
|
+
onLegendItemClick: EVENT_TYPE.LEGEND_ITEM_CLICK,
|
|
753
|
+
onLegendItemHover: EVENT_TYPE.LEGEND_ITEM_HOVER,
|
|
754
|
+
onLegendItemUnHover: EVENT_TYPE.LEGEND_ITEM_UNHOVER,
|
|
755
|
+
onLegendChange: EVENT_TYPE.LEGEND_CHANGE,
|
|
756
|
+
onMouseEnterAxis: EVENT_TYPE.MOUSEENTER_AXIS,
|
|
757
|
+
onMouseLeaveAxis: EVENT_TYPE.MOUSELEAVE_AXIS,
|
|
758
|
+
onCheckboxStateChange: EVENT_TYPE.CHECKBOX_STATE_CHANGE,
|
|
759
|
+
onRadioStateChange: EVENT_TYPE.RADIO_STATE_CHANGE,
|
|
760
|
+
onSwitchStateChange: EVENT_TYPE.SWITCH_STATE_CHANGE,
|
|
761
|
+
onAfterRender: EVENT_TYPE.AFTER_RENDER,
|
|
762
|
+
onInitialized: EVENT_TYPE.INITIALIZED,
|
|
763
|
+
onChangeCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
764
|
+
onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
|
|
765
|
+
onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
|
|
766
|
+
onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
|
|
767
|
+
onPivotSortClick: EVENT_TYPE.PIVOT_SORT_CLICK,
|
|
768
|
+
onDrillMenuClick: EVENT_TYPE.DRILLMENU_CLICK,
|
|
769
|
+
onVChartEventType: EVENT_TYPE.VCHART_EVENT_TYPE,
|
|
770
|
+
onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
771
|
+
onEmptyTipClick: EVENT_TYPE.EMPTY_TIP_CLICK,
|
|
772
|
+
onEmptyTipDblClick: EVENT_TYPE.EMPTY_TIP_DBLCLICK,
|
|
773
|
+
onButtonClick: EVENT_TYPE.BUTTON_CLICK,
|
|
774
|
+
onBeforeCacheChartImage: EVENT_TYPE.BEFORE_CACHE_CHART_IMAGE
|
|
775
|
+
};
|
|
776
|
+
const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
|
|
777
|
+
const findEventProps = (props, supportedEvents = TABLE_EVENTS) => {
|
|
778
|
+
const result = {};
|
|
779
|
+
Object.keys(props).forEach(key => {
|
|
780
|
+
if (supportedEvents[key] && props[key]) {
|
|
781
|
+
result[key] = props[key];
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
return result;
|
|
785
|
+
};
|
|
786
|
+
const bindEventsToTable = (table, newProps, prevProps, supportedEvents = TABLE_EVENTS) => {
|
|
787
|
+
if ((!newProps && !prevProps) || !table) {
|
|
788
|
+
return false;
|
|
789
|
+
}
|
|
790
|
+
const prevEventProps = prevProps ? findEventProps(prevProps, supportedEvents) : null;
|
|
791
|
+
const newEventProps = newProps ? findEventProps(newProps, supportedEvents) : null;
|
|
792
|
+
if (prevEventProps) {
|
|
793
|
+
Object.keys(prevEventProps).forEach(eventKey => {
|
|
794
|
+
if (!newEventProps ||
|
|
795
|
+
!newEventProps[eventKey] ||
|
|
796
|
+
newEventProps[eventKey] !== prevEventProps[eventKey]) {
|
|
797
|
+
table.off(supportedEvents[eventKey], prevProps[eventKey]);
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
if (newEventProps) {
|
|
802
|
+
Object.keys(newEventProps).forEach(eventKey => {
|
|
803
|
+
if (!prevEventProps ||
|
|
804
|
+
!prevEventProps[eventKey] ||
|
|
805
|
+
prevEventProps[eventKey] !== newEventProps[eventKey]) {
|
|
806
|
+
table.on(supportedEvents[eventKey], newEventProps[eventKey]);
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
return true;
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
class Generator {
|
|
814
|
+
static GenAutoIncrementId() {
|
|
815
|
+
return Generator.auto_increment_id++;
|
|
918
816
|
}
|
|
919
|
-
|
|
920
|
-
|
|
817
|
+
}
|
|
818
|
+
Generator.auto_increment_id = 0;
|
|
819
|
+
|
|
820
|
+
class ContainerModule {
|
|
821
|
+
constructor(registry) {
|
|
822
|
+
this.id = Generator.GenAutoIncrementId(), this.registry = registry;
|
|
921
823
|
}
|
|
922
|
-
|
|
923
|
-
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
const NAMED_TAG = "named";
|
|
827
|
+
const INJECT_TAG = "inject";
|
|
828
|
+
const MULTI_INJECT_TAG = "multi_inject";
|
|
829
|
+
const TAGGED = "inversify:tagged";
|
|
830
|
+
const PARAM_TYPES = "inversify:paramtypes";
|
|
831
|
+
|
|
832
|
+
class Metadata {
|
|
833
|
+
constructor(key, value) {
|
|
834
|
+
this.key = key, this.value = value;
|
|
924
835
|
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
928
|
-
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
836
|
+
toString() {
|
|
837
|
+
return this.key === NAMED_TAG ? `named: ${String(this.value).toString()} ` : `tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`;
|
|
929
838
|
}
|
|
930
|
-
|
|
931
|
-
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
var Reflect$1 = (function (Reflect) {
|
|
842
|
+
var target;
|
|
843
|
+
return function (exporter) {
|
|
844
|
+
const supportsSymbol = "function" == typeof Symbol,
|
|
845
|
+
toPrimitiveSymbol = supportsSymbol && void 0 !== Symbol.toPrimitive ? Symbol.toPrimitive : "@@toPrimitive",
|
|
846
|
+
functionPrototype = (Object.getPrototypeOf(Function)),
|
|
847
|
+
_Map = ("object" == typeof process && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL, Map),
|
|
848
|
+
Metadata = (new WeakMap());
|
|
849
|
+
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
850
|
+
if (!IsObject(target)) throw new TypeError();
|
|
851
|
+
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
852
|
+
}
|
|
853
|
+
function hasMetadata(metadataKey, target, propertyKey) {
|
|
854
|
+
if (!IsObject(target)) throw new TypeError();
|
|
855
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
856
|
+
}
|
|
857
|
+
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
858
|
+
if (!IsObject(target)) throw new TypeError();
|
|
859
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
860
|
+
}
|
|
861
|
+
function getMetadata(metadataKey, target, propertyKey) {
|
|
862
|
+
if (!IsObject(target)) throw new TypeError();
|
|
863
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
864
|
+
}
|
|
865
|
+
function GetOrCreateMetadataMap(O, P, Create) {
|
|
866
|
+
let targetMetadata = Metadata.get(O);
|
|
867
|
+
if (IsUndefined(targetMetadata)) {
|
|
868
|
+
if (!Create) return;
|
|
869
|
+
targetMetadata = new _Map(), Metadata.set(O, targetMetadata);
|
|
870
|
+
}
|
|
871
|
+
let metadataMap = targetMetadata.get(P);
|
|
872
|
+
if (IsUndefined(metadataMap)) {
|
|
873
|
+
if (!Create) return;
|
|
874
|
+
metadataMap = new _Map(), targetMetadata.set(P, metadataMap);
|
|
875
|
+
}
|
|
876
|
+
return metadataMap;
|
|
877
|
+
}
|
|
878
|
+
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
879
|
+
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return !0;
|
|
880
|
+
const parent = OrdinaryGetPrototypeOf(O);
|
|
881
|
+
return !IsNull(parent) && OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
882
|
+
}
|
|
883
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
884
|
+
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
885
|
+
return !IsUndefined(metadataMap) && ToBoolean(metadataMap.has(MetadataKey));
|
|
886
|
+
}
|
|
887
|
+
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
888
|
+
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
889
|
+
const parent = OrdinaryGetPrototypeOf(O);
|
|
890
|
+
return IsNull(parent) ? void 0 : OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
891
|
+
}
|
|
892
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
893
|
+
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
894
|
+
if (!IsUndefined(metadataMap)) return metadataMap.get(MetadataKey);
|
|
895
|
+
}
|
|
896
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
897
|
+
GetOrCreateMetadataMap(O, P, !0).set(MetadataKey, MetadataValue);
|
|
898
|
+
}
|
|
899
|
+
function Type(x) {
|
|
900
|
+
if (null === x) return 1;
|
|
901
|
+
switch (typeof x) {
|
|
902
|
+
case "undefined":
|
|
903
|
+
return 0;
|
|
904
|
+
case "boolean":
|
|
905
|
+
return 2;
|
|
906
|
+
case "string":
|
|
907
|
+
return 3;
|
|
908
|
+
case "symbol":
|
|
909
|
+
return 4;
|
|
910
|
+
case "number":
|
|
911
|
+
return 5;
|
|
912
|
+
case "object":
|
|
913
|
+
return null === x ? 1 : 6;
|
|
914
|
+
default:
|
|
915
|
+
return 6;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
function IsUndefined(x) {
|
|
919
|
+
return void 0 === x;
|
|
920
|
+
}
|
|
921
|
+
function IsNull(x) {
|
|
922
|
+
return null === x;
|
|
923
|
+
}
|
|
924
|
+
function IsSymbol(x) {
|
|
925
|
+
return "symbol" == typeof x;
|
|
926
|
+
}
|
|
927
|
+
function IsObject(x) {
|
|
928
|
+
return "object" == typeof x ? null !== x : "function" == typeof x;
|
|
929
|
+
}
|
|
930
|
+
function ToPrimitive(input, PreferredType) {
|
|
931
|
+
switch (Type(input)) {
|
|
932
|
+
case 0:
|
|
933
|
+
case 1:
|
|
934
|
+
case 2:
|
|
935
|
+
case 3:
|
|
936
|
+
case 4:
|
|
937
|
+
case 5:
|
|
938
|
+
return input;
|
|
939
|
+
}
|
|
940
|
+
const hint = 3 === PreferredType ? "string" : 5 === PreferredType ? "number" : "default",
|
|
941
|
+
exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
942
|
+
if (void 0 !== exoticToPrim) {
|
|
943
|
+
const result = exoticToPrim.call(input, hint);
|
|
944
|
+
if (IsObject(result)) throw new TypeError();
|
|
945
|
+
return result;
|
|
946
|
+
}
|
|
947
|
+
return OrdinaryToPrimitive(input, "default" === hint ? "number" : hint);
|
|
948
|
+
}
|
|
949
|
+
function OrdinaryToPrimitive(O, hint) {
|
|
950
|
+
if ("string" === hint) {
|
|
951
|
+
const toString_1 = O.toString;
|
|
952
|
+
if (IsCallable(toString_1)) {
|
|
953
|
+
const result = toString_1.call(O);
|
|
954
|
+
if (!IsObject(result)) return result;
|
|
955
|
+
}
|
|
956
|
+
const valueOf = O.valueOf;
|
|
957
|
+
if (IsCallable(valueOf)) {
|
|
958
|
+
const result = valueOf.call(O);
|
|
959
|
+
if (!IsObject(result)) return result;
|
|
960
|
+
}
|
|
961
|
+
} else {
|
|
962
|
+
const valueOf = O.valueOf;
|
|
963
|
+
if (IsCallable(valueOf)) {
|
|
964
|
+
const result = valueOf.call(O);
|
|
965
|
+
if (!IsObject(result)) return result;
|
|
966
|
+
}
|
|
967
|
+
const toString_2 = O.toString;
|
|
968
|
+
if (IsCallable(toString_2)) {
|
|
969
|
+
const result = toString_2.call(O);
|
|
970
|
+
if (!IsObject(result)) return result;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
throw new TypeError();
|
|
974
|
+
}
|
|
975
|
+
function ToBoolean(argument) {
|
|
976
|
+
return !!argument;
|
|
977
|
+
}
|
|
978
|
+
function ToString(argument) {
|
|
979
|
+
return "" + argument;
|
|
980
|
+
}
|
|
981
|
+
function ToPropertyKey(argument) {
|
|
982
|
+
const key = ToPrimitive(argument, 3);
|
|
983
|
+
return IsSymbol(key) ? key : ToString(key);
|
|
984
|
+
}
|
|
985
|
+
function IsCallable(argument) {
|
|
986
|
+
return "function" == typeof argument;
|
|
987
|
+
}
|
|
988
|
+
function GetMethod(V, P) {
|
|
989
|
+
const func = V[P];
|
|
990
|
+
if (null != func) {
|
|
991
|
+
if (!IsCallable(func)) throw new TypeError();
|
|
992
|
+
return func;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
function OrdinaryGetPrototypeOf(O) {
|
|
996
|
+
const proto = Object.getPrototypeOf(O);
|
|
997
|
+
if ("function" != typeof O || O === functionPrototype) return proto;
|
|
998
|
+
if (proto !== functionPrototype) return proto;
|
|
999
|
+
const prototype = O.prototype,
|
|
1000
|
+
prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
1001
|
+
if (null == prototypeProto || prototypeProto === Object.prototype) return proto;
|
|
1002
|
+
const constructor = prototypeProto.constructor;
|
|
1003
|
+
return "function" != typeof constructor || constructor === O ? proto : constructor;
|
|
1004
|
+
}
|
|
1005
|
+
exporter("defineMetadata", defineMetadata), exporter("hasMetadata", hasMetadata), exporter("hasOwnMetadata", hasOwnMetadata), exporter("getMetadata", getMetadata);
|
|
1006
|
+
}((target = Reflect, function (key, value) {
|
|
1007
|
+
"function" != typeof target[key] && Object.defineProperty(target, key, {
|
|
1008
|
+
configurable: !0,
|
|
1009
|
+
writable: !0,
|
|
1010
|
+
value: value
|
|
1011
|
+
});
|
|
1012
|
+
})), Reflect;
|
|
1013
|
+
})({});
|
|
1014
|
+
|
|
1015
|
+
function _tagParameterOrProperty(metadataKey, annotationTarget, key, metadata) {
|
|
1016
|
+
const metadatas = [metadata];
|
|
1017
|
+
let paramsOrPropertiesMetadata = {};
|
|
1018
|
+
Reflect$1.hasOwnMetadata(metadataKey, annotationTarget) && (paramsOrPropertiesMetadata = Reflect$1.getMetadata(metadataKey, annotationTarget));
|
|
1019
|
+
let paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
|
|
1020
|
+
void 0 === paramOrPropertyMetadata && (paramOrPropertyMetadata = []), paramOrPropertyMetadata.push(...metadatas), paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata, Reflect$1.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
|
|
1021
|
+
}
|
|
1022
|
+
function tagParameter(annotationTarget, parameterName, parameterIndex, metadata) {
|
|
1023
|
+
_tagParameterOrProperty(TAGGED, annotationTarget, parameterIndex.toString(), metadata);
|
|
1024
|
+
}
|
|
1025
|
+
function createTaggedDecorator(metadata) {
|
|
1026
|
+
return (target, targetKey, indexOrPropertyDescriptor) => {
|
|
1027
|
+
tagParameter(target, targetKey, indexOrPropertyDescriptor, metadata);
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
function injectBase(metadataKey) {
|
|
1031
|
+
return serviceIdentifier => (target, targetKey, indexOrPropertyDescriptor) => createTaggedDecorator(new Metadata(metadataKey, serviceIdentifier))(target, targetKey, indexOrPropertyDescriptor);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
const inject = injectBase(INJECT_TAG);
|
|
1035
|
+
|
|
1036
|
+
function injectable() {
|
|
1037
|
+
return function (target) {
|
|
1038
|
+
return Reflect$1.defineMetadata(PARAM_TYPES, null, target), target;
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function named(name) {
|
|
1043
|
+
return createTaggedDecorator(new Metadata(NAMED_TAG, name));
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
const BindingScopeEnum = {
|
|
1047
|
+
Singleton: "Singleton",
|
|
1048
|
+
Transient: "Transient"
|
|
1049
|
+
},
|
|
1050
|
+
BindingTypeEnum = {
|
|
1051
|
+
ConstantValue: "ConstantValue",
|
|
1052
|
+
Constructor: "Constructor",
|
|
1053
|
+
DynamicValue: "DynamicValue",
|
|
1054
|
+
Factory: "Factory",
|
|
1055
|
+
Function: "Function",
|
|
1056
|
+
Instance: "Instance",
|
|
1057
|
+
Invalid: "Invalid",
|
|
1058
|
+
Provider: "Provider"
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
class Binding {
|
|
1062
|
+
constructor(serviceIdentifier, scope) {
|
|
1063
|
+
this.id = Generator.GenAutoIncrementId(), this.activated = !1, this.serviceIdentifier = serviceIdentifier, this.scope = scope, this.type = BindingTypeEnum.Invalid, this.constraint = request => !0, this.implementationType = null, this.cache = null, this.factory = null, this.provider = null, this.dynamicValue = null;
|
|
932
1064
|
}
|
|
933
|
-
|
|
934
|
-
|
|
1065
|
+
clone() {
|
|
1066
|
+
const clone = new Binding(this.serviceIdentifier, this.scope);
|
|
1067
|
+
return clone.activated = clone.scope === BindingScopeEnum.Singleton && this.activated, clone.implementationType = this.implementationType, clone.dynamicValue = this.dynamicValue, clone.scope = this.scope, clone.type = this.type, clone.provider = this.provider, clone.constraint = this.constraint, clone.cache = this.cache, clone;
|
|
935
1068
|
}
|
|
936
|
-
|
|
937
|
-
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
class MetadataReader {
|
|
1072
|
+
getConstructorMetadata(constructorFunc) {
|
|
1073
|
+
return {
|
|
1074
|
+
compilerGeneratedMetadata: Reflect$1.getMetadata(PARAM_TYPES, constructorFunc),
|
|
1075
|
+
userGeneratedMetadata: Reflect$1.getMetadata(TAGGED, constructorFunc) || {}
|
|
1076
|
+
};
|
|
938
1077
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
return this.x1 *= s, this.x2 *= s, this;
|
|
1078
|
+
getPropertiesMetadata(constructorFunc) {
|
|
1079
|
+
throw new Error("暂未实现");
|
|
942
1080
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
const taggedConstraint = key => value => {
|
|
1084
|
+
const constraint = request => {
|
|
1085
|
+
if (null == request) return !1;
|
|
1086
|
+
if (request.key === key && request.value === value) return !0;
|
|
1087
|
+
if (null == request.constructorArgsMetadata) return !1;
|
|
1088
|
+
const constructorArgsMetadata = request.constructorArgsMetadata;
|
|
1089
|
+
for (let i = 0; i < constructorArgsMetadata.length; i++) if (constructorArgsMetadata[i].key === key && constructorArgsMetadata[i].value === value) return !0;
|
|
1090
|
+
return !1;
|
|
1091
|
+
};
|
|
1092
|
+
return constraint.metaData = new Metadata(key, value), constraint;
|
|
1093
|
+
};
|
|
1094
|
+
const namedConstraint = taggedConstraint(NAMED_TAG);
|
|
1095
|
+
|
|
1096
|
+
class BindingInSyntax {
|
|
1097
|
+
constructor(binding) {
|
|
1098
|
+
this._binding = binding;
|
|
946
1099
|
}
|
|
947
|
-
|
|
948
|
-
|
|
1100
|
+
inRequestScope() {
|
|
1101
|
+
throw new Error("暂未实现");
|
|
949
1102
|
}
|
|
950
|
-
|
|
951
|
-
return this.
|
|
1103
|
+
inSingletonScope() {
|
|
1104
|
+
return this._binding.scope = BindingScopeEnum.Singleton, this;
|
|
952
1105
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
x1: x1,
|
|
956
|
-
y1: y1,
|
|
957
|
-
x2: x2,
|
|
958
|
-
y2: y2
|
|
959
|
-
} = this,
|
|
960
|
-
cos = Math.cos(angle),
|
|
961
|
-
sin = Math.sin(angle),
|
|
962
|
-
cx = x - x * cos + y * sin,
|
|
963
|
-
cy = y - x * sin - y * cos;
|
|
964
|
-
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];
|
|
1106
|
+
inTransientScope() {
|
|
1107
|
+
return this._binding.scope = BindingScopeEnum.Transient, this;
|
|
965
1108
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
x1: x1,
|
|
969
|
-
y1: y1,
|
|
970
|
-
x2: x2,
|
|
971
|
-
y2: y2
|
|
972
|
-
} = this;
|
|
973
|
-
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
1109
|
+
whenTargetNamed(name) {
|
|
1110
|
+
return this._binding.constraint = namedConstraint(name), this;
|
|
974
1111
|
}
|
|
975
1112
|
}
|
|
976
|
-
|
|
977
|
-
class
|
|
978
|
-
constructor(
|
|
979
|
-
|
|
980
|
-
var _a;
|
|
981
|
-
super(bounds), bounds && (this.angle = null !== (_a = bounds.angle) && void 0 !== _a ? _a : angle);
|
|
1113
|
+
|
|
1114
|
+
class BindingToSyntax {
|
|
1115
|
+
constructor(binding) {
|
|
1116
|
+
this._binding = binding;
|
|
982
1117
|
}
|
|
983
|
-
|
|
984
|
-
return
|
|
1118
|
+
to(constructor) {
|
|
1119
|
+
return this._binding.type = BindingTypeEnum.Instance, this._binding.implementationType = constructor, new BindingInSyntax(this._binding);
|
|
985
1120
|
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
990
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
991
|
-
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
992
|
-
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
1121
|
+
toSelf() {
|
|
1122
|
+
const self = this._binding.serviceIdentifier;
|
|
1123
|
+
return this.to(self);
|
|
993
1124
|
}
|
|
994
|
-
|
|
995
|
-
return new
|
|
1125
|
+
toDynamicValue(func) {
|
|
1126
|
+
return this._binding.type = BindingTypeEnum.DynamicValue, this._binding.cache = null, this._binding.dynamicValue = func, this._binding.implementationType = null, new BindingInSyntax(this._binding);
|
|
1127
|
+
}
|
|
1128
|
+
toConstantValue(value) {
|
|
1129
|
+
return this._binding.type = BindingTypeEnum.ConstantValue, this._binding.cache = value, this._binding.dynamicValue = null, this._binding.implementationType = null, this._binding.scope = BindingScopeEnum.Singleton, new BindingInSyntax(this._binding);
|
|
1130
|
+
}
|
|
1131
|
+
toFactory(factory) {
|
|
1132
|
+
return this._binding.type = BindingTypeEnum.Factory, this._binding.factory = factory, this._binding.scope = BindingScopeEnum.Singleton, new BindingInSyntax(this._binding);
|
|
1133
|
+
}
|
|
1134
|
+
toService(service) {
|
|
1135
|
+
this.toDynamicValue(context => context.container.get(service));
|
|
996
1136
|
}
|
|
997
1137
|
}
|
|
998
1138
|
|
|
999
|
-
class
|
|
1000
|
-
constructor() {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1139
|
+
class Container {
|
|
1140
|
+
constructor(containerOptions) {
|
|
1141
|
+
const options = containerOptions || {};
|
|
1142
|
+
options.defaultScope = options.defaultScope || BindingScopeEnum.Transient, this.options = options, this.id = Generator.GenAutoIncrementId(), this._bindingDictionary = new Map(), this._metadataReader = new MetadataReader();
|
|
1143
|
+
}
|
|
1144
|
+
load(module) {
|
|
1145
|
+
const containerModuleHelpers = this._getContainerModuleHelpersFactory()(module.id);
|
|
1146
|
+
module.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
|
|
1147
|
+
}
|
|
1148
|
+
get(serviceIdentifier) {
|
|
1149
|
+
const getArgs = this._getNotAllArgs(serviceIdentifier, !1);
|
|
1150
|
+
return this._get(getArgs);
|
|
1151
|
+
}
|
|
1152
|
+
getAll(serviceIdentifier) {
|
|
1153
|
+
const getArgs = this._getAllArgs(serviceIdentifier);
|
|
1154
|
+
return this._get(getArgs);
|
|
1155
|
+
}
|
|
1156
|
+
getTagged(serviceIdentifier, key, value) {
|
|
1157
|
+
const getArgs = this._getNotAllArgs(serviceIdentifier, !1, key, value);
|
|
1158
|
+
return this._get(getArgs);
|
|
1159
|
+
}
|
|
1160
|
+
getNamed(serviceIdentifier, named) {
|
|
1161
|
+
return this.getTagged(serviceIdentifier, NAMED_TAG, named);
|
|
1162
|
+
}
|
|
1163
|
+
isBound(serviceIdentifier) {
|
|
1164
|
+
return this._bindingDictionary.has(serviceIdentifier);
|
|
1165
|
+
}
|
|
1166
|
+
bind(serviceIdentifier) {
|
|
1167
|
+
const scope = this.options.defaultScope,
|
|
1168
|
+
binding = new Binding(serviceIdentifier, scope),
|
|
1169
|
+
list = this._bindingDictionary.get(serviceIdentifier) || [];
|
|
1170
|
+
return list.push(binding), this._bindingDictionary.set(serviceIdentifier, list), new BindingToSyntax(binding);
|
|
1171
|
+
}
|
|
1172
|
+
unbind(serviceIdentifier) {
|
|
1173
|
+
this._bindingDictionary.delete(serviceIdentifier);
|
|
1174
|
+
}
|
|
1175
|
+
rebind(serviceIdentifier) {
|
|
1176
|
+
return this.unbind(serviceIdentifier), this.bind(serviceIdentifier);
|
|
1177
|
+
}
|
|
1178
|
+
_getContainerModuleHelpersFactory() {
|
|
1179
|
+
const setModuleId = (bindingToSyntax, moduleId) => {
|
|
1180
|
+
bindingToSyntax._binding.moduleId = moduleId;
|
|
1181
|
+
},
|
|
1182
|
+
getBindFunction = moduleId => serviceIdentifier => {
|
|
1183
|
+
const bindingToSyntax = this.bind(serviceIdentifier);
|
|
1184
|
+
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
1185
|
+
},
|
|
1186
|
+
getUnbindFunction = () => serviceIdentifier => this.unbind(serviceIdentifier),
|
|
1187
|
+
getIsboundFunction = () => serviceIdentifier => this.isBound(serviceIdentifier),
|
|
1188
|
+
getRebindFunction = moduleId => serviceIdentifier => {
|
|
1189
|
+
const bindingToSyntax = this.rebind(serviceIdentifier);
|
|
1190
|
+
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
1191
|
+
};
|
|
1192
|
+
return mId => ({
|
|
1193
|
+
bindFunction: getBindFunction(mId),
|
|
1194
|
+
isboundFunction: getIsboundFunction(),
|
|
1195
|
+
rebindFunction: getRebindFunction(mId),
|
|
1196
|
+
unbindFunction: getUnbindFunction(),
|
|
1197
|
+
unbindAsyncFunction: serviceIdentifier => null
|
|
1198
|
+
});
|
|
1008
1199
|
}
|
|
1009
|
-
|
|
1010
|
-
return
|
|
1200
|
+
_getNotAllArgs(serviceIdentifier, isMultiInject, key, value) {
|
|
1201
|
+
return {
|
|
1202
|
+
avoidConstraints: !1,
|
|
1203
|
+
isMultiInject: isMultiInject,
|
|
1204
|
+
serviceIdentifier: serviceIdentifier,
|
|
1205
|
+
key: key,
|
|
1206
|
+
value: value
|
|
1207
|
+
};
|
|
1011
1208
|
}
|
|
1012
|
-
|
|
1013
|
-
return
|
|
1209
|
+
_getAllArgs(serviceIdentifier) {
|
|
1210
|
+
return {
|
|
1211
|
+
avoidConstraints: !0,
|
|
1212
|
+
isMultiInject: !0,
|
|
1213
|
+
serviceIdentifier: serviceIdentifier
|
|
1214
|
+
};
|
|
1014
1215
|
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1216
|
+
_get(getArgs) {
|
|
1217
|
+
const result = [];
|
|
1218
|
+
return this._bindingDictionary.get(getArgs.serviceIdentifier).filter(b => b.constraint(getArgs)).forEach(binding => {
|
|
1219
|
+
result.push(this._resolveFromBinding(binding));
|
|
1220
|
+
}), getArgs.isMultiInject || 1 !== result.length ? result : result[0];
|
|
1017
1221
|
}
|
|
1018
|
-
|
|
1019
|
-
|
|
1222
|
+
_getChildRequest(binding) {
|
|
1223
|
+
const constr = binding.implementationType,
|
|
1224
|
+
{
|
|
1225
|
+
userGeneratedMetadata: userGeneratedMetadata
|
|
1226
|
+
} = this._metadataReader.getConstructorMetadata(constr),
|
|
1227
|
+
keys = Object.keys(userGeneratedMetadata),
|
|
1228
|
+
arr = [];
|
|
1229
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1230
|
+
const constructorArgsMetadata = userGeneratedMetadata[i],
|
|
1231
|
+
targetMetadataMap = {};
|
|
1232
|
+
constructorArgsMetadata.forEach(md => {
|
|
1233
|
+
targetMetadataMap[md.key] = md.value;
|
|
1234
|
+
});
|
|
1235
|
+
const metadata = {
|
|
1236
|
+
inject: targetMetadataMap[INJECT_TAG],
|
|
1237
|
+
multiInject: targetMetadataMap[MULTI_INJECT_TAG]
|
|
1238
|
+
},
|
|
1239
|
+
injectIdentifier = metadata.inject || metadata.multiInject,
|
|
1240
|
+
target = {
|
|
1241
|
+
serviceIdentifier: injectIdentifier,
|
|
1242
|
+
constructorArgsMetadata: constructorArgsMetadata
|
|
1243
|
+
},
|
|
1244
|
+
bindings = (this._bindingDictionary.get(injectIdentifier) || []).filter(b => b.constraint(target));
|
|
1245
|
+
if (bindings.length) {
|
|
1246
|
+
const request = {
|
|
1247
|
+
injectIdentifier: injectIdentifier,
|
|
1248
|
+
metadata: constructorArgsMetadata,
|
|
1249
|
+
bindings: bindings
|
|
1250
|
+
};
|
|
1251
|
+
arr.push(request);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
return arr;
|
|
1020
1255
|
}
|
|
1021
|
-
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1024
|
-
c = this.c,
|
|
1025
|
-
d = this.d,
|
|
1026
|
-
e = this.e,
|
|
1027
|
-
f = this.f,
|
|
1028
|
-
m = new Matrix(),
|
|
1029
|
-
dt = a * d - b * c;
|
|
1030
|
-
return m.a = d / dt, m.b = -b / dt, m.c = -c / dt, m.d = a / dt, m.e = (c * f - d * e) / dt, m.f = -(a * f - b * e) / dt, m;
|
|
1256
|
+
_resolveFromBinding(binding) {
|
|
1257
|
+
const result = this._getResolvedFromBinding(binding);
|
|
1258
|
+
return this._saveToScope(binding, result), result;
|
|
1031
1259
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1260
|
+
_getResolvedFromBinding(binding) {
|
|
1261
|
+
let result;
|
|
1262
|
+
switch (binding.type) {
|
|
1263
|
+
case BindingTypeEnum.ConstantValue:
|
|
1264
|
+
case BindingTypeEnum.Function:
|
|
1265
|
+
result = binding.cache;
|
|
1266
|
+
break;
|
|
1267
|
+
case BindingTypeEnum.Instance:
|
|
1268
|
+
result = this._resolveInstance(binding, binding.implementationType);
|
|
1269
|
+
break;
|
|
1270
|
+
default:
|
|
1271
|
+
result = binding.dynamicValue({
|
|
1272
|
+
container: this
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
return result;
|
|
1040
1276
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
rotateM23 = (1 - cos) * cy - sin * cx,
|
|
1046
|
-
m11 = cos * this.a - sin * this.b,
|
|
1047
|
-
m21 = sin * this.a + cos * this.b,
|
|
1048
|
-
m12 = cos * this.c - sin * this.d,
|
|
1049
|
-
m22 = sin * this.c + cos * this.d,
|
|
1050
|
-
m13 = cos * this.e - sin * this.f + rotateM13,
|
|
1051
|
-
m23 = sin * this.e + cos * this.f + rotateM23;
|
|
1052
|
-
return this.a = m11, this.b = m21, this.c = m12, this.d = m22, this.e = m13, this.f = m23, this;
|
|
1277
|
+
_resolveInstance(binding, constr) {
|
|
1278
|
+
if (binding.activated) return binding.cache;
|
|
1279
|
+
const childRequests = this._getChildRequest(binding);
|
|
1280
|
+
return this._createInstance(constr, childRequests);
|
|
1053
1281
|
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1282
|
+
_createInstance(constr, childRequests) {
|
|
1283
|
+
if (childRequests.length) {
|
|
1284
|
+
return new constr(...this._resolveRequests(childRequests));
|
|
1285
|
+
}
|
|
1286
|
+
return new constr();
|
|
1056
1287
|
}
|
|
1057
|
-
|
|
1058
|
-
return
|
|
1288
|
+
_resolveRequests(childRequests) {
|
|
1289
|
+
return childRequests.map(request => request.bindings.length > 1 ? request.bindings.map(binding => this._resolveFromBinding(binding)) : this._resolveFromBinding(request.bindings[0]));
|
|
1059
1290
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1291
|
+
_saveToScope(binding, result) {
|
|
1292
|
+
binding.scope === BindingScopeEnum.Singleton && (binding.cache = result, binding.activated = !0);
|
|
1062
1293
|
}
|
|
1063
|
-
|
|
1064
|
-
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
const ContributionProvider = Symbol("ContributionProvider");
|
|
1297
|
+
class ContributionProviderCache {
|
|
1298
|
+
constructor(serviceIdentifier, container) {
|
|
1299
|
+
this.serviceIdentifier = serviceIdentifier, this.container = container;
|
|
1065
1300
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
a: a,
|
|
1069
|
-
b: b,
|
|
1070
|
-
c: c,
|
|
1071
|
-
d: d,
|
|
1072
|
-
e: e,
|
|
1073
|
-
f: f
|
|
1074
|
-
} = this;
|
|
1075
|
-
return this.a = b, this.b = a, this.c = d, this.d = c, this.e = f, this.f = e, this;
|
|
1301
|
+
getContributions() {
|
|
1302
|
+
return this.caches || (this.caches = [], this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier))), this.caches;
|
|
1076
1303
|
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1304
|
+
}
|
|
1305
|
+
function bindContributionProvider(bind, id) {
|
|
1306
|
+
bind(ContributionProvider).toDynamicValue(_ref => {
|
|
1307
|
+
let {
|
|
1308
|
+
container: container
|
|
1309
|
+
} = _ref;
|
|
1310
|
+
return new ContributionProviderCache(id, container);
|
|
1311
|
+
}).inSingletonScope().whenTargetNamed(id);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
class Hook {
|
|
1315
|
+
constructor(args, name) {
|
|
1316
|
+
this._args = args, this.name = name, this.taps = [];
|
|
1089
1317
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
return m.a = this.a + (m2.a - this.a) * t, m.b = this.b + (m2.b - this.b) * t, m.c = this.c + (m2.c - this.c) * t, m.d = this.d + (m2.d - this.d) * t, m.e = this.e + (m2.e - this.e) * t, m.f = this.f + (m2.f - this.f) * t, m;
|
|
1318
|
+
tap(options, fn) {
|
|
1319
|
+
this._tap("sync", options, fn);
|
|
1093
1320
|
}
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1097
|
-
b: b,
|
|
1098
|
-
c: c,
|
|
1099
|
-
d: d,
|
|
1100
|
-
e: e,
|
|
1101
|
-
f: f
|
|
1102
|
-
} = this,
|
|
1103
|
-
dt = a * d - b * c,
|
|
1104
|
-
nextA = d / dt,
|
|
1105
|
-
nextB = -b / dt,
|
|
1106
|
-
nextC = -c / dt,
|
|
1107
|
-
nextD = a / dt,
|
|
1108
|
-
nextE = (c * f - d * e) / dt,
|
|
1109
|
-
nextF = -(a * f - b * e) / dt,
|
|
1110
|
-
{
|
|
1111
|
-
x: x,
|
|
1112
|
-
y: y
|
|
1113
|
-
} = source;
|
|
1114
|
-
target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
|
|
1321
|
+
unTap(options, fn) {
|
|
1322
|
+
const name = "string" == typeof options ? options.trim() : options.name;
|
|
1323
|
+
name && (this.taps = this.taps.filter(tap => !(tap.name === name && (!fn || tap.fn === fn))));
|
|
1115
1324
|
}
|
|
1116
|
-
|
|
1117
|
-
let
|
|
1118
|
-
|
|
1325
|
+
_parseOptions(type, options, fn) {
|
|
1326
|
+
let _options;
|
|
1327
|
+
if ("string" == typeof options) _options = {
|
|
1328
|
+
name: options.trim()
|
|
1329
|
+
};else if ("object" != typeof options || null === options) throw new Error("Invalid tap options");
|
|
1330
|
+
if ("string" != typeof _options.name || "" === _options.name) throw new Error("Missing name for tap");
|
|
1331
|
+
return _options = Object.assign({
|
|
1332
|
+
type: type,
|
|
1333
|
+
fn: fn
|
|
1334
|
+
}, _options), _options;
|
|
1119
1335
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1336
|
+
_tap(type, options, fn) {
|
|
1337
|
+
this._insert(this._parseOptions(type, options, fn));
|
|
1122
1338
|
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1339
|
+
_insert(item) {
|
|
1340
|
+
let before;
|
|
1341
|
+
"string" == typeof item.before ? before = new Set([item.before]) : Array.isArray(item.before) && (before = new Set(item.before));
|
|
1342
|
+
let stage = 0;
|
|
1343
|
+
"number" == typeof item.stage && (stage = item.stage);
|
|
1344
|
+
let i = this.taps.length;
|
|
1345
|
+
for (; i > 0;) {
|
|
1346
|
+
i--;
|
|
1347
|
+
const x = this.taps[i];
|
|
1348
|
+
this.taps[i + 1] = x;
|
|
1349
|
+
const xStage = x.stage || 0;
|
|
1350
|
+
if (before) {
|
|
1351
|
+
if (before.has(x.name)) {
|
|
1352
|
+
before.delete(x.name);
|
|
1353
|
+
continue;
|
|
1354
|
+
}
|
|
1355
|
+
if (before.size > 0) continue;
|
|
1356
|
+
}
|
|
1357
|
+
if (!(xStage > stage)) {
|
|
1358
|
+
i++;
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1144
1361
|
}
|
|
1145
|
-
|
|
1362
|
+
this.taps[i] = item;
|
|
1146
1363
|
}
|
|
1147
1364
|
}
|
|
1148
|
-
function normalTransform(out, origin, x, y, scaleX, scaleY, angle, rotateCenter) {
|
|
1149
|
-
const oa = origin.a,
|
|
1150
|
-
ob = origin.b,
|
|
1151
|
-
oc = origin.c,
|
|
1152
|
-
od = origin.d,
|
|
1153
|
-
oe = origin.e,
|
|
1154
|
-
of = origin.f,
|
|
1155
|
-
cosTheta = cos(angle),
|
|
1156
|
-
sinTheta = sin(angle);
|
|
1157
|
-
let rotateCenterX, rotateCenterY;
|
|
1158
|
-
rotateCenter ? (rotateCenterX = rotateCenter[0], rotateCenterY = rotateCenter[1]) : (rotateCenterX = x, rotateCenterY = y);
|
|
1159
|
-
const offsetX = rotateCenterX - x,
|
|
1160
|
-
offsetY = rotateCenterY - y,
|
|
1161
|
-
a1 = oa * cosTheta + oc * sinTheta,
|
|
1162
|
-
b1 = ob * cosTheta + od * sinTheta,
|
|
1163
|
-
c1 = oc * cosTheta - oa * sinTheta,
|
|
1164
|
-
d1 = od * cosTheta - ob * sinTheta;
|
|
1165
|
-
out.a = scaleX * a1, out.b = scaleX * b1, out.c = scaleY * c1, out.d = scaleY * d1, out.e = oe + oa * rotateCenterX + oc * rotateCenterY - a1 * offsetX - c1 * offsetY, out.f = of + ob * rotateCenterX + od * rotateCenterY - b1 * offsetX - d1 * offsetY;
|
|
1166
|
-
}
|
|
1167
1365
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
b = 0;
|
|
1176
|
-
return 0 <= h && h < 60 ? (r = c, g = x, b = 0) : 60 <= h && h < 120 ? (r = x, g = c, b = 0) : 120 <= h && h < 180 ? (r = 0, g = c, b = x) : 180 <= h && h < 240 ? (r = 0, g = x, b = c) : 240 <= h && h < 300 ? (r = x, g = 0, b = c) : 300 <= h && h < 360 && (r = c, g = 0, b = x), r = Math.round(255 * (r + m)), g = Math.round(255 * (g + m)), b = Math.round(255 * (b + m)), {
|
|
1177
|
-
r: r,
|
|
1178
|
-
g: g,
|
|
1179
|
-
b: b
|
|
1180
|
-
};
|
|
1366
|
+
class SyncHook extends Hook {
|
|
1367
|
+
call() {
|
|
1368
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1369
|
+
args[_key] = arguments[_key];
|
|
1370
|
+
}
|
|
1371
|
+
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
1372
|
+
}
|
|
1181
1373
|
}
|
|
1182
1374
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
const cMin = Math.min(r, g, b),
|
|
1186
|
-
cMax = Math.max(r, g, b),
|
|
1187
|
-
delta = cMax - cMin;
|
|
1188
|
-
let h = 0,
|
|
1189
|
-
s = 0,
|
|
1190
|
-
l = 0;
|
|
1191
|
-
return h = 0 === delta ? 0 : cMax === r ? (g - b) / delta % 6 : cMax === g ? (b - r) / delta + 2 : (r - g) / delta + 4, h = Math.round(60 * h), h < 0 && (h += 360), l = (cMax + cMin) / 2, s = 0 === delta ? 0 : delta / (1 - Math.abs(2 * l - 1)), s = +(100 * s).toFixed(1), l = +(100 * l).toFixed(1), {
|
|
1192
|
-
h: h,
|
|
1193
|
-
s: s,
|
|
1194
|
-
l: l
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1375
|
+
const EnvContribution = Symbol.for("EnvContribution");
|
|
1376
|
+
const DEFAULT_TEXT_FONT_FAMILY$1 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
|
|
1197
1377
|
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
darksalmon: 15308410,
|
|
1237
|
-
darkseagreen: 9419919,
|
|
1238
|
-
darkslateblue: 4734347,
|
|
1239
|
-
darkslategray: 3100495,
|
|
1240
|
-
darkslategrey: 3100495,
|
|
1241
|
-
darkturquoise: 52945,
|
|
1242
|
-
darkviolet: 9699539,
|
|
1243
|
-
deeppink: 16716947,
|
|
1244
|
-
deepskyblue: 49151,
|
|
1245
|
-
dimgray: 6908265,
|
|
1246
|
-
dimgrey: 6908265,
|
|
1247
|
-
dodgerblue: 2003199,
|
|
1248
|
-
firebrick: 11674146,
|
|
1249
|
-
floralwhite: 16775920,
|
|
1250
|
-
forestgreen: 2263842,
|
|
1251
|
-
fuchsia: 16711935,
|
|
1252
|
-
gainsboro: 14474460,
|
|
1253
|
-
ghostwhite: 16316671,
|
|
1254
|
-
gold: 16766720,
|
|
1255
|
-
goldenrod: 14329120,
|
|
1256
|
-
gray: 8421504,
|
|
1257
|
-
green: 32768,
|
|
1258
|
-
greenyellow: 11403055,
|
|
1259
|
-
grey: 8421504,
|
|
1260
|
-
honeydew: 15794160,
|
|
1261
|
-
hotpink: 16738740,
|
|
1262
|
-
indianred: 13458524,
|
|
1263
|
-
indigo: 4915330,
|
|
1264
|
-
ivory: 16777200,
|
|
1265
|
-
khaki: 15787660,
|
|
1266
|
-
lavender: 15132410,
|
|
1267
|
-
lavenderblush: 16773365,
|
|
1268
|
-
lawngreen: 8190976,
|
|
1269
|
-
lemonchiffon: 16775885,
|
|
1270
|
-
lightblue: 11393254,
|
|
1271
|
-
lightcoral: 15761536,
|
|
1272
|
-
lightcyan: 14745599,
|
|
1273
|
-
lightgoldenrodyellow: 16448210,
|
|
1274
|
-
lightgray: 13882323,
|
|
1275
|
-
lightgreen: 9498256,
|
|
1276
|
-
lightgrey: 13882323,
|
|
1277
|
-
lightpink: 16758465,
|
|
1278
|
-
lightsalmon: 16752762,
|
|
1279
|
-
lightseagreen: 2142890,
|
|
1280
|
-
lightskyblue: 8900346,
|
|
1281
|
-
lightslategray: 7833753,
|
|
1282
|
-
lightslategrey: 7833753,
|
|
1283
|
-
lightsteelblue: 11584734,
|
|
1284
|
-
lightyellow: 16777184,
|
|
1285
|
-
lime: 65280,
|
|
1286
|
-
limegreen: 3329330,
|
|
1287
|
-
linen: 16445670,
|
|
1288
|
-
magenta: 16711935,
|
|
1289
|
-
maroon: 8388608,
|
|
1290
|
-
mediumaquamarine: 6737322,
|
|
1291
|
-
mediumblue: 205,
|
|
1292
|
-
mediumorchid: 12211667,
|
|
1293
|
-
mediumpurple: 9662683,
|
|
1294
|
-
mediumseagreen: 3978097,
|
|
1295
|
-
mediumslateblue: 8087790,
|
|
1296
|
-
mediumspringgreen: 64154,
|
|
1297
|
-
mediumturquoise: 4772300,
|
|
1298
|
-
mediumvioletred: 13047173,
|
|
1299
|
-
midnightblue: 1644912,
|
|
1300
|
-
mintcream: 16121850,
|
|
1301
|
-
mistyrose: 16770273,
|
|
1302
|
-
moccasin: 16770229,
|
|
1303
|
-
navajowhite: 16768685,
|
|
1304
|
-
navy: 128,
|
|
1305
|
-
oldlace: 16643558,
|
|
1306
|
-
olive: 8421376,
|
|
1307
|
-
olivedrab: 7048739,
|
|
1308
|
-
orange: 16753920,
|
|
1309
|
-
orangered: 16729344,
|
|
1310
|
-
orchid: 14315734,
|
|
1311
|
-
palegoldenrod: 15657130,
|
|
1312
|
-
palegreen: 10025880,
|
|
1313
|
-
paleturquoise: 11529966,
|
|
1314
|
-
palevioletred: 14381203,
|
|
1315
|
-
papayawhip: 16773077,
|
|
1316
|
-
peachpuff: 16767673,
|
|
1317
|
-
peru: 13468991,
|
|
1318
|
-
pink: 16761035,
|
|
1319
|
-
plum: 14524637,
|
|
1320
|
-
powderblue: 11591910,
|
|
1321
|
-
purple: 8388736,
|
|
1322
|
-
rebeccapurple: 6697881,
|
|
1323
|
-
red: 16711680,
|
|
1324
|
-
rosybrown: 12357519,
|
|
1325
|
-
royalblue: 4286945,
|
|
1326
|
-
saddlebrown: 9127187,
|
|
1327
|
-
salmon: 16416882,
|
|
1328
|
-
sandybrown: 16032864,
|
|
1329
|
-
seagreen: 3050327,
|
|
1330
|
-
seashell: 16774638,
|
|
1331
|
-
sienna: 10506797,
|
|
1332
|
-
silver: 12632256,
|
|
1333
|
-
skyblue: 8900331,
|
|
1334
|
-
slateblue: 6970061,
|
|
1335
|
-
slategray: 7372944,
|
|
1336
|
-
slategrey: 7372944,
|
|
1337
|
-
snow: 16775930,
|
|
1338
|
-
springgreen: 65407,
|
|
1339
|
-
steelblue: 4620980,
|
|
1340
|
-
tan: 13808780,
|
|
1341
|
-
teal: 32896,
|
|
1342
|
-
thistle: 14204888,
|
|
1343
|
-
tomato: 16737095,
|
|
1344
|
-
turquoise: 4251856,
|
|
1345
|
-
violet: 15631086,
|
|
1346
|
-
wheat: 16113331,
|
|
1347
|
-
white: 16777215,
|
|
1348
|
-
whitesmoke: 16119285,
|
|
1349
|
-
yellow: 16776960,
|
|
1350
|
-
yellowgreen: 10145074
|
|
1378
|
+
var MeasureModeEnum;
|
|
1379
|
+
!function (MeasureModeEnum) {
|
|
1380
|
+
MeasureModeEnum[MeasureModeEnum.estimate = 0] = "estimate", MeasureModeEnum[MeasureModeEnum.actualBounding = 1] = "actualBounding", MeasureModeEnum[MeasureModeEnum.fontBounding = 2] = "fontBounding";
|
|
1381
|
+
}(MeasureModeEnum || (MeasureModeEnum = {}));
|
|
1382
|
+
|
|
1383
|
+
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
1384
|
+
var isType$1 = isType;
|
|
1385
|
+
|
|
1386
|
+
const isBoolean = function (value) {
|
|
1387
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1388
|
+
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
1389
|
+
};
|
|
1390
|
+
var isBoolean$1 = isBoolean;
|
|
1391
|
+
|
|
1392
|
+
const isFunction = value => "function" == typeof value;
|
|
1393
|
+
var isFunction$1 = isFunction;
|
|
1394
|
+
|
|
1395
|
+
const isNil = value => null == value;
|
|
1396
|
+
var isNil$1 = isNil;
|
|
1397
|
+
|
|
1398
|
+
const isValid = value => null != value;
|
|
1399
|
+
var isValid$1 = isValid;
|
|
1400
|
+
|
|
1401
|
+
const isObject = value => {
|
|
1402
|
+
const type = typeof value;
|
|
1403
|
+
return null !== value && "object" === type || "function" === type;
|
|
1404
|
+
};
|
|
1405
|
+
var isObject$1 = isObject;
|
|
1406
|
+
|
|
1407
|
+
const isObjectLike = value => "object" == typeof value && null !== value;
|
|
1408
|
+
var isObjectLike$1 = isObjectLike;
|
|
1409
|
+
|
|
1410
|
+
const isPlainObject = function (value) {
|
|
1411
|
+
if (!isObjectLike$1(value) || !isType$1(value, "Object")) return !1;
|
|
1412
|
+
if (null === Object.getPrototypeOf(value)) return !0;
|
|
1413
|
+
let proto = value;
|
|
1414
|
+
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
1415
|
+
return Object.getPrototypeOf(value) === proto;
|
|
1351
1416
|
};
|
|
1352
|
-
|
|
1353
|
-
|
|
1417
|
+
var isPlainObject$1 = isPlainObject;
|
|
1418
|
+
|
|
1419
|
+
const isString = function (value) {
|
|
1420
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1421
|
+
const type = typeof value;
|
|
1422
|
+
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
1423
|
+
};
|
|
1424
|
+
var isString$1 = isString;
|
|
1425
|
+
|
|
1426
|
+
const isArray = value => Array.isArray ? Array.isArray(value) : isType$1(value, "Array");
|
|
1427
|
+
var isArray$1 = isArray;
|
|
1428
|
+
|
|
1429
|
+
const isArrayLike = function (value) {
|
|
1430
|
+
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
1431
|
+
};
|
|
1432
|
+
var isArrayLike$1 = isArrayLike;
|
|
1433
|
+
|
|
1434
|
+
const isNumber = function (value) {
|
|
1435
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1436
|
+
const type = typeof value;
|
|
1437
|
+
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
1438
|
+
};
|
|
1439
|
+
var isNumber$1 = isNumber;
|
|
1440
|
+
|
|
1441
|
+
const isValidNumber = value => isNumber$1(value) && Number.isFinite(value);
|
|
1442
|
+
var isValidNumber$1 = isValidNumber;
|
|
1443
|
+
|
|
1444
|
+
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
1445
|
+
var isValidUrl$1 = isValidUrl;
|
|
1446
|
+
|
|
1447
|
+
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);
|
|
1448
|
+
var isBase64$1 = isBase64;
|
|
1449
|
+
|
|
1450
|
+
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
1451
|
+
var getType$1 = getType;
|
|
1452
|
+
|
|
1453
|
+
const objectProto = Object.prototype,
|
|
1454
|
+
isPrototype = function (value) {
|
|
1455
|
+
const Ctor = value && value.constructor;
|
|
1456
|
+
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
|
|
1457
|
+
};
|
|
1458
|
+
var isPrototype$1 = isPrototype;
|
|
1459
|
+
|
|
1460
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1461
|
+
function isEmpty(value) {
|
|
1462
|
+
if (isNil$1(value)) return !0;
|
|
1463
|
+
if (isArrayLike$1(value)) return !value.length;
|
|
1464
|
+
const type = getType$1(value);
|
|
1465
|
+
if ("Map" === type || "Set" === type) return !value.size;
|
|
1466
|
+
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
1467
|
+
for (const key in value) if (hasOwnProperty$1.call(value, key)) return !1;
|
|
1468
|
+
return !0;
|
|
1354
1469
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1470
|
+
|
|
1471
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
1472
|
+
has = (object, key) => null != object && hasOwnProperty.call(object, key);
|
|
1473
|
+
var has$1 = has;
|
|
1474
|
+
|
|
1475
|
+
function baseMerge(target, source) {
|
|
1476
|
+
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1477
|
+
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1478
|
+
if (source) {
|
|
1479
|
+
if (target === source) return;
|
|
1480
|
+
if (isValid$1(source) && "object" == typeof source) {
|
|
1481
|
+
const iterable = Object(source),
|
|
1482
|
+
props = [];
|
|
1483
|
+
for (const key in iterable) props.push(key);
|
|
1484
|
+
let {
|
|
1485
|
+
length: length
|
|
1486
|
+
} = props,
|
|
1487
|
+
propIndex = -1;
|
|
1488
|
+
for (; length--;) {
|
|
1489
|
+
const key = props[++propIndex];
|
|
1490
|
+
!isValid$1(iterable[key]) || "object" != typeof iterable[key] || skipTargetArray && isArray$1(target[key]) ? assignMergeValue(target, key, iterable[key]) : baseMergeDeep(target, source, key, shallowArray, skipTargetArray);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1357
1494
|
}
|
|
1358
|
-
function
|
|
1359
|
-
|
|
1495
|
+
function baseMergeDeep(target, source, key) {
|
|
1496
|
+
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1497
|
+
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
1498
|
+
const objValue = target[key],
|
|
1499
|
+
srcValue = source[key];
|
|
1500
|
+
let newValue = source[key],
|
|
1501
|
+
isCommon = !0;
|
|
1502
|
+
if (isArray$1(srcValue)) {
|
|
1503
|
+
if (shallowArray) newValue = [];else if (isArray$1(objValue)) newValue = objValue;else if (isArrayLike$1(objValue)) {
|
|
1504
|
+
newValue = new Array(objValue.length);
|
|
1505
|
+
let index = -1;
|
|
1506
|
+
const length = objValue.length;
|
|
1507
|
+
for (; ++index < length;) newValue[index] = objValue[index];
|
|
1508
|
+
}
|
|
1509
|
+
} else isPlainObject$1(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
1510
|
+
isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
|
|
1360
1511
|
}
|
|
1361
|
-
function
|
|
1362
|
-
|
|
1512
|
+
function assignMergeValue(target, key, value) {
|
|
1513
|
+
(void 0 !== value && !eq(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
1363
1514
|
}
|
|
1364
|
-
function
|
|
1365
|
-
return
|
|
1515
|
+
function eq(value, other) {
|
|
1516
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
1366
1517
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
return 3 === hexLength ? new RGB((hex >> 8 & 15) + ((hex >> 8 & 15) << 4), (hex >> 4 & 15) + ((hex >> 4 & 15) << 4), (15 & hex) + ((15 & hex) << 4), 1) : 6 === hexLength ? rgb(hex) : 8 === hexLength ? new RGB(hex >> 24 & 255, hex >> 16 & 255, hex >> 8 & 255, (255 & hex) / 255) : null;
|
|
1518
|
+
function merge(target) {
|
|
1519
|
+
let sourceIndex = -1;
|
|
1520
|
+
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
1521
|
+
for (; ++sourceIndex < length;) {
|
|
1522
|
+
baseMerge(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
1373
1523
|
}
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1524
|
+
return target;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
function array(arr) {
|
|
1528
|
+
return isValid$1(arr) ? isArray$1(arr) ? arr : [arr] : [];
|
|
1529
|
+
}
|
|
1530
|
+
function arrayEqual(a, b) {
|
|
1531
|
+
if (!isArray$1(a) || !isArray$1(b)) return !1;
|
|
1532
|
+
if (a.length !== b.length) return !1;
|
|
1533
|
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
1534
|
+
return !0;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
const hasConsole = "undefined" != typeof console;
|
|
1538
|
+
function log(method, level, input) {
|
|
1539
|
+
const args = [level].concat([].slice.call(input));
|
|
1540
|
+
hasConsole && console[method].apply(console, args);
|
|
1541
|
+
}
|
|
1542
|
+
var LoggerLevel;
|
|
1543
|
+
!function (LoggerLevel) {
|
|
1544
|
+
LoggerLevel[LoggerLevel.None = 0] = "None", LoggerLevel[LoggerLevel.Error = 1] = "Error", LoggerLevel[LoggerLevel.Warn = 2] = "Warn", LoggerLevel[LoggerLevel.Info = 3] = "Info", LoggerLevel[LoggerLevel.Debug = 4] = "Debug";
|
|
1545
|
+
}(LoggerLevel || (LoggerLevel = {}));
|
|
1546
|
+
class Logger {
|
|
1547
|
+
static getInstance(level, method) {
|
|
1548
|
+
return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1379
1549
|
}
|
|
1380
|
-
static
|
|
1381
|
-
|
|
1382
|
-
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
1550
|
+
static setInstance(logger) {
|
|
1551
|
+
return Logger._instance = logger;
|
|
1383
1552
|
}
|
|
1384
|
-
static
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1553
|
+
static setInstanceLevel(level) {
|
|
1554
|
+
Logger._instance ? Logger._instance.level(level) : Logger._instance = new Logger(level);
|
|
1555
|
+
}
|
|
1556
|
+
static clearInstance() {
|
|
1557
|
+
Logger._instance = null;
|
|
1558
|
+
}
|
|
1559
|
+
constructor() {
|
|
1560
|
+
let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
|
|
1561
|
+
let method = arguments.length > 1 ? arguments[1] : undefined;
|
|
1562
|
+
this._onErrorHandler = [], this._level = level, this._method = method;
|
|
1563
|
+
}
|
|
1564
|
+
addErrorHandler(handler) {
|
|
1565
|
+
this._onErrorHandler.find(h => h === handler) || this._onErrorHandler.push(handler);
|
|
1566
|
+
}
|
|
1567
|
+
removeErrorHandler(handler) {
|
|
1568
|
+
const index = this._onErrorHandler.findIndex(h => h === handler);
|
|
1569
|
+
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
1570
|
+
}
|
|
1571
|
+
callErrorHandler() {
|
|
1572
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1573
|
+
args[_key] = arguments[_key];
|
|
1574
|
+
}
|
|
1575
|
+
this._onErrorHandler.forEach(h => h(...args));
|
|
1576
|
+
}
|
|
1577
|
+
canLogInfo() {
|
|
1578
|
+
return this._level >= LoggerLevel.Info;
|
|
1579
|
+
}
|
|
1580
|
+
canLogDebug() {
|
|
1581
|
+
return this._level >= LoggerLevel.Debug;
|
|
1582
|
+
}
|
|
1583
|
+
canLogError() {
|
|
1584
|
+
return this._level >= LoggerLevel.Error;
|
|
1585
|
+
}
|
|
1586
|
+
canLogWarn() {
|
|
1587
|
+
return this._level >= LoggerLevel.Warn;
|
|
1588
|
+
}
|
|
1589
|
+
level(levelValue) {
|
|
1590
|
+
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
1591
|
+
}
|
|
1592
|
+
error() {
|
|
1593
|
+
var _a;
|
|
1594
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1595
|
+
args[_key2] = arguments[_key2];
|
|
1596
|
+
}
|
|
1597
|
+
return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler(...args) : log(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
|
|
1598
|
+
}
|
|
1599
|
+
warn() {
|
|
1600
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1601
|
+
args[_key3] = arguments[_key3];
|
|
1602
|
+
}
|
|
1603
|
+
return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
|
|
1604
|
+
}
|
|
1605
|
+
info() {
|
|
1606
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
1607
|
+
args[_key4] = arguments[_key4];
|
|
1608
|
+
}
|
|
1609
|
+
return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
|
|
1610
|
+
}
|
|
1611
|
+
debug() {
|
|
1612
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
1613
|
+
args[_key5] = arguments[_key5];
|
|
1401
1614
|
}
|
|
1615
|
+
return this._level >= LoggerLevel.Debug && log(this._method || "log", "DEBUG", args), this;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
Logger._instance = null;
|
|
1619
|
+
|
|
1620
|
+
const clamp = function (input, min, max) {
|
|
1621
|
+
return input < min ? min : input > max ? max : input;
|
|
1622
|
+
};
|
|
1623
|
+
var clamp$1 = clamp;
|
|
1624
|
+
|
|
1625
|
+
const epsilon = 1e-12;
|
|
1626
|
+
const pi = Math.PI;
|
|
1627
|
+
const halfPi$1 = pi / 2;
|
|
1628
|
+
const tau = 2 * pi;
|
|
1629
|
+
const pi2 = 2 * Math.PI;
|
|
1630
|
+
const abs = Math.abs;
|
|
1631
|
+
const atan2 = Math.atan2;
|
|
1632
|
+
const cos = Math.cos;
|
|
1633
|
+
const max = Math.max;
|
|
1634
|
+
const min = Math.min;
|
|
1635
|
+
const sin = Math.sin;
|
|
1636
|
+
const sqrt = Math.sqrt;
|
|
1637
|
+
const pow = Math.pow;
|
|
1638
|
+
function asin(x) {
|
|
1639
|
+
return x >= 1 ? halfPi$1 : x <= -1 ? -halfPi$1 : Math.asin(x);
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
class Point {
|
|
1643
|
+
constructor() {
|
|
1644
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1645
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1646
|
+
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
1647
|
+
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
1648
|
+
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
1402
1649
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
if (isValid$1(DEFAULT_COLORS[value])) return rgb(DEFAULT_COLORS[value]);
|
|
1406
|
-
const formatValue = `${value}`.trim().toLowerCase(),
|
|
1407
|
-
hexRes = setHex(formatValue);
|
|
1408
|
-
if (void 0 !== hexRes) return hexRes;
|
|
1409
|
-
if (/^(rgb|RGB|rgba|RGBA)/.test(formatValue)) {
|
|
1410
|
-
const aColor = formatValue.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g, "").split(",");
|
|
1411
|
-
return new RGB(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10), parseFloat(aColor[3]));
|
|
1412
|
-
}
|
|
1413
|
-
if (/^(hsl|HSL|hsla|HSLA)/.test(formatValue)) {
|
|
1414
|
-
const aColor = formatValue.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g, "").split(","),
|
|
1415
|
-
rgb = hslToRgb(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10));
|
|
1416
|
-
return new RGB(rgb.r, rgb.g, rgb.b, parseFloat(aColor[3]));
|
|
1417
|
-
}
|
|
1650
|
+
clone() {
|
|
1651
|
+
return new Point(this.x, this.y);
|
|
1418
1652
|
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
color ? this.color = color : (this.color = new RGB(255, 255, 255));
|
|
1653
|
+
copyFrom(p) {
|
|
1654
|
+
return this.x = p.x, this.y = p.y, this.x1 = p.x1, this.y1 = p.y1, this.defined = p.defined, this.context = p.context, this;
|
|
1422
1655
|
}
|
|
1423
|
-
|
|
1424
|
-
return this.
|
|
1656
|
+
set(x, y) {
|
|
1657
|
+
return this.x = x, this.y = y, this;
|
|
1425
1658
|
}
|
|
1426
|
-
|
|
1427
|
-
return this.
|
|
1659
|
+
add(point) {
|
|
1660
|
+
return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1428
1661
|
}
|
|
1429
|
-
|
|
1430
|
-
return this.
|
|
1662
|
+
sub(point) {
|
|
1663
|
+
return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1431
1664
|
}
|
|
1432
|
-
|
|
1433
|
-
|
|
1665
|
+
multi(point) {
|
|
1666
|
+
throw new Error("暂不支持");
|
|
1434
1667
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
r: r,
|
|
1438
|
-
g: g,
|
|
1439
|
-
b: b
|
|
1440
|
-
} = this.color;
|
|
1441
|
-
return this.color.r = Math.max(0, Math.min(255, Math.floor(r * k))), this.color.g = Math.max(0, Math.min(255, Math.floor(g * k))), this.color.b = Math.max(0, Math.min(255, Math.floor(b * k))), this;
|
|
1668
|
+
div(point) {
|
|
1669
|
+
throw new Error("暂不支持");
|
|
1442
1670
|
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
b: b
|
|
1448
|
-
} = this.color;
|
|
1449
|
-
return this.color.r += Math.min(255, r + color.color.r), this.color.g += Math.min(255, g + color.color.g), this.color.b += Math.min(255, b + color.color.b), this;
|
|
1671
|
+
}
|
|
1672
|
+
class PointService {
|
|
1673
|
+
static distancePP(p1, p2) {
|
|
1674
|
+
return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
|
|
1450
1675
|
}
|
|
1451
|
-
|
|
1452
|
-
return
|
|
1676
|
+
static distanceNN(x, y, x1, y1) {
|
|
1677
|
+
return sqrt(pow(x - x1, 2) + pow(y - y1, 2));
|
|
1453
1678
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
r: r,
|
|
1457
|
-
g: g,
|
|
1458
|
-
b: b
|
|
1459
|
-
} = this.color;
|
|
1460
|
-
return this.color.r = Math.max(0, Math.min(255, Math.floor(r * color.color.r))), this.color.g = Math.max(0, Math.min(255, Math.floor(g * color.color.g))), this.color.b = Math.max(0, Math.min(255, Math.floor(b * color.color.b))), this;
|
|
1679
|
+
static distancePN(point, x, y) {
|
|
1680
|
+
return sqrt(pow(x - point.x, 2) + pow(y - point.y, 2));
|
|
1461
1681
|
}
|
|
1462
|
-
|
|
1463
|
-
return
|
|
1682
|
+
static pointAtPP(p1, p2, t) {
|
|
1683
|
+
return new Point((p2.x - p1.x) * t + p1.x, (p2.y - p1.y) * t + p1.y);
|
|
1464
1684
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
function degreeToRadian(degree) {
|
|
1688
|
+
return degree * (Math.PI / 180);
|
|
1689
|
+
}
|
|
1690
|
+
function radianToDegree(radian) {
|
|
1691
|
+
return 180 * radian / Math.PI;
|
|
1692
|
+
}
|
|
1693
|
+
const clampRadian = function () {
|
|
1694
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1695
|
+
if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
1696
|
+
return angle;
|
|
1697
|
+
};
|
|
1698
|
+
const clampAngleByRadian = clampRadian;
|
|
1699
|
+
|
|
1700
|
+
var InnerBBox;
|
|
1701
|
+
!function (InnerBBox) {
|
|
1702
|
+
InnerBBox[InnerBBox.NONE = 0] = "NONE", InnerBBox[InnerBBox.BBOX1 = 1] = "BBOX1", InnerBBox[InnerBBox.BBOX2 = 2] = "BBOX2";
|
|
1703
|
+
}(InnerBBox || (InnerBBox = {}));
|
|
1704
|
+
function getProjectionRadius(checkAxis, axis) {
|
|
1705
|
+
return Math.abs(axis[0] * checkAxis[0] + axis[1] * checkAxis[1]);
|
|
1706
|
+
}
|
|
1707
|
+
function rotatePoint(_ref, rad) {
|
|
1708
|
+
let {
|
|
1709
|
+
x: x,
|
|
1710
|
+
y: y
|
|
1711
|
+
} = _ref;
|
|
1712
|
+
let origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
1713
|
+
x: 0,
|
|
1714
|
+
y: 0
|
|
1715
|
+
};
|
|
1716
|
+
return {
|
|
1717
|
+
x: (x - origin.x) * Math.cos(rad) - (y - origin.y) * Math.sin(rad) + origin.x,
|
|
1718
|
+
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
1719
|
+
};
|
|
1720
|
+
}
|
|
1721
|
+
function getCenterPoint(box) {
|
|
1722
|
+
return {
|
|
1723
|
+
x: (box.x1 + box.x2) / 2,
|
|
1724
|
+
y: (box.y1 + box.y2) / 2
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
function toRect(box, isDeg) {
|
|
1728
|
+
const deg = isDeg ? degreeToRadian(box.angle) : box.angle,
|
|
1729
|
+
cp = getCenterPoint(box);
|
|
1730
|
+
return [rotatePoint({
|
|
1731
|
+
x: box.x1,
|
|
1732
|
+
y: box.y1
|
|
1733
|
+
}, deg, cp), rotatePoint({
|
|
1734
|
+
x: box.x2,
|
|
1735
|
+
y: box.y1
|
|
1736
|
+
}, deg, cp), rotatePoint({
|
|
1737
|
+
x: box.x2,
|
|
1738
|
+
y: box.y2
|
|
1739
|
+
}, deg, cp), rotatePoint({
|
|
1740
|
+
x: box.x1,
|
|
1741
|
+
y: box.y2
|
|
1742
|
+
}, deg, cp)];
|
|
1743
|
+
}
|
|
1744
|
+
function isRotateAABBIntersect(box1, box2) {
|
|
1745
|
+
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1746
|
+
const rect1 = toRect(box1, isDeg),
|
|
1747
|
+
rect2 = toRect(box2, isDeg),
|
|
1748
|
+
vector = (start, end) => [end.x - start.x, end.y - start.y],
|
|
1749
|
+
vp1p2 = vector(getCenterPoint(box1), getCenterPoint(box2)),
|
|
1750
|
+
AB = vector(rect1[0], rect1[1]),
|
|
1751
|
+
BC = vector(rect1[1], rect1[2]),
|
|
1752
|
+
A1B1 = vector(rect2[0], rect2[1]),
|
|
1753
|
+
B1C1 = vector(rect2[1], rect2[2]),
|
|
1754
|
+
deg11 = isDeg ? degreeToRadian(box1.angle) : box1.angle;
|
|
1755
|
+
let deg12 = isDeg ? degreeToRadian(90 - box1.angle) : box1.angle + halfPi$1;
|
|
1756
|
+
const deg21 = isDeg ? degreeToRadian(box2.angle) : box2.angle;
|
|
1757
|
+
let deg22 = isDeg ? degreeToRadian(90 - box2.angle) : box2.angle + halfPi$1;
|
|
1758
|
+
deg12 > pi2 && (deg12 -= pi2), deg22 > pi2 && (deg22 -= pi2);
|
|
1759
|
+
const isCover = (checkAxisRadius, deg, targetAxis1, targetAxis2) => {
|
|
1760
|
+
const checkAxis = [Math.cos(deg), Math.sin(deg)];
|
|
1761
|
+
return checkAxisRadius + (getProjectionRadius(checkAxis, targetAxis1) + getProjectionRadius(checkAxis, targetAxis2)) / 2 > getProjectionRadius(checkAxis, vp1p2);
|
|
1762
|
+
};
|
|
1763
|
+
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);
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
function getContextFont(text) {
|
|
1767
|
+
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1768
|
+
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
1769
|
+
fontSizeScale || (fontSizeScale = 1);
|
|
1770
|
+
const {
|
|
1771
|
+
fontStyle = defaultAttr.fontStyle,
|
|
1772
|
+
fontVariant = defaultAttr.fontVariant,
|
|
1773
|
+
fontWeight = defaultAttr.fontWeight,
|
|
1774
|
+
fontSize = defaultAttr.fontSize,
|
|
1775
|
+
fontFamily = defaultAttr.fontFamily
|
|
1776
|
+
} = text;
|
|
1777
|
+
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
const calculateAnchorOfBounds = (bounds, anchorType) => {
|
|
1781
|
+
const {
|
|
1782
|
+
x1: x1,
|
|
1783
|
+
x2: x2,
|
|
1784
|
+
y1: y1,
|
|
1785
|
+
y2: y2
|
|
1786
|
+
} = bounds,
|
|
1787
|
+
rectWidth = Math.abs(x2 - x1),
|
|
1788
|
+
rectHeight = Math.abs(y2 - y1);
|
|
1789
|
+
let anchorX = (x1 + x2) / 2,
|
|
1790
|
+
anchorY = (y1 + y2) / 2,
|
|
1791
|
+
sx = 0,
|
|
1792
|
+
sy = 0;
|
|
1793
|
+
switch (anchorType) {
|
|
1794
|
+
case "top":
|
|
1795
|
+
case "inside-top":
|
|
1796
|
+
sy = -.5;
|
|
1797
|
+
break;
|
|
1798
|
+
case "bottom":
|
|
1799
|
+
case "inside-bottom":
|
|
1800
|
+
sy = .5;
|
|
1801
|
+
break;
|
|
1802
|
+
case "left":
|
|
1803
|
+
case "inside-left":
|
|
1804
|
+
sx = -.5;
|
|
1805
|
+
break;
|
|
1806
|
+
case "right":
|
|
1807
|
+
case "inside-right":
|
|
1808
|
+
sx = .5;
|
|
1809
|
+
break;
|
|
1810
|
+
case "top-right":
|
|
1811
|
+
sx = .5, sy = -.5;
|
|
1812
|
+
break;
|
|
1813
|
+
case "top-left":
|
|
1814
|
+
sx = -.5, sy = -.5;
|
|
1815
|
+
break;
|
|
1816
|
+
case "bottom-right":
|
|
1817
|
+
sx = .5, sy = .5;
|
|
1818
|
+
break;
|
|
1819
|
+
case "bottom-left":
|
|
1820
|
+
sx = -.5, sy = .5;
|
|
1467
1821
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1822
|
+
return anchorX += sx * rectWidth, anchorY += sy * rectHeight, {
|
|
1823
|
+
x: anchorX,
|
|
1824
|
+
y: anchorY
|
|
1825
|
+
};
|
|
1826
|
+
};
|
|
1827
|
+
|
|
1828
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
1829
|
+
const {
|
|
1830
|
+
x1: x1,
|
|
1831
|
+
y1: y1,
|
|
1832
|
+
x2: x2,
|
|
1833
|
+
y2: y2
|
|
1834
|
+
} = bounds;
|
|
1835
|
+
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);
|
|
1836
|
+
}
|
|
1837
|
+
class Bounds {
|
|
1838
|
+
constructor(bounds) {
|
|
1839
|
+
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
1473
1840
|
}
|
|
1474
|
-
|
|
1475
|
-
return
|
|
1841
|
+
clone() {
|
|
1842
|
+
return new Bounds(this);
|
|
1476
1843
|
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
res = setHex(formatValue, !0);
|
|
1480
|
-
return null != res ? res : this;
|
|
1844
|
+
clear() {
|
|
1845
|
+
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
1481
1846
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
return void 0 !== hex ? this.setHex(hex) : (void 0), this;
|
|
1847
|
+
empty() {
|
|
1848
|
+
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
1485
1849
|
}
|
|
1486
|
-
|
|
1487
|
-
return this.
|
|
1850
|
+
equals(b) {
|
|
1851
|
+
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
1488
1852
|
}
|
|
1489
|
-
|
|
1490
|
-
let
|
|
1491
|
-
|
|
1853
|
+
setValue() {
|
|
1854
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1855
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1856
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1857
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1858
|
+
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
1492
1859
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1860
|
+
set() {
|
|
1861
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1862
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1863
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1864
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1865
|
+
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;
|
|
1495
1866
|
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1867
|
+
add() {
|
|
1868
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1869
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1870
|
+
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;
|
|
1498
1871
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1872
|
+
expand() {
|
|
1873
|
+
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1874
|
+
return isArray$1(d) ? (this.y1 -= d[0], this.x2 += d[1], this.y2 += d[2], this.x1 -= d[3]) : (this.x1 -= d, this.y1 -= d, this.x2 += d, this.y2 += d), this;
|
|
1501
1875
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
GsRGB = this.color.g / 255,
|
|
1505
|
-
BsRGB = this.color.b / 255;
|
|
1506
|
-
let R, G, B;
|
|
1507
|
-
R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
1508
|
-
return .2126 * R + .7152 * G + .0722 * B;
|
|
1876
|
+
round() {
|
|
1877
|
+
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;
|
|
1509
1878
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1879
|
+
translate() {
|
|
1880
|
+
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1881
|
+
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1882
|
+
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
1512
1883
|
}
|
|
1513
|
-
|
|
1514
|
-
let
|
|
1515
|
-
|
|
1884
|
+
rotate() {
|
|
1885
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1886
|
+
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1887
|
+
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1888
|
+
const p = this.rotatedPoints(angle, x, y);
|
|
1889
|
+
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
1516
1890
|
}
|
|
1517
|
-
|
|
1518
|
-
let
|
|
1519
|
-
|
|
1520
|
-
|
|
1891
|
+
scale() {
|
|
1892
|
+
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1893
|
+
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1894
|
+
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1895
|
+
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1896
|
+
const p = this.scalePoints(sx, sy, x, y);
|
|
1897
|
+
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
1521
1898
|
}
|
|
1522
|
-
|
|
1523
|
-
return this.
|
|
1899
|
+
union(b) {
|
|
1900
|
+
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;
|
|
1524
1901
|
}
|
|
1525
|
-
|
|
1526
|
-
return this.
|
|
1902
|
+
intersect(b) {
|
|
1903
|
+
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;
|
|
1527
1904
|
}
|
|
1528
|
-
|
|
1529
|
-
return this.
|
|
1905
|
+
encloses(b) {
|
|
1906
|
+
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
1530
1907
|
}
|
|
1531
|
-
|
|
1532
|
-
return this.
|
|
1908
|
+
alignsWith(b) {
|
|
1909
|
+
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
1533
1910
|
}
|
|
1534
|
-
|
|
1535
|
-
return this.
|
|
1911
|
+
intersects(b) {
|
|
1912
|
+
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
1536
1913
|
}
|
|
1537
|
-
|
|
1538
|
-
|
|
1914
|
+
contains() {
|
|
1915
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1916
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1917
|
+
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
1539
1918
|
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
constructor(r, g, b, opacity) {
|
|
1543
|
-
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$1(opacity) ? this.opacity = isNaN(+opacity) ? 1 : Math.max(0, Math.min(1, +opacity)) : this.opacity = 1;
|
|
1919
|
+
containsPoint(p) {
|
|
1920
|
+
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
1544
1921
|
}
|
|
1545
|
-
|
|
1546
|
-
return
|
|
1922
|
+
width() {
|
|
1923
|
+
return this.empty() ? 0 : this.x2 - this.x1;
|
|
1547
1924
|
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
return `${1 === opacity ? "rgb(" : "rgba("}${this.r},${this.g},${this.b}${1 === opacity ? ")" : `,${opacity})`}`;
|
|
1925
|
+
height() {
|
|
1926
|
+
return this.empty() ? 0 : this.y2 - this.y1;
|
|
1551
1927
|
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
h: h,
|
|
1556
|
-
s: s,
|
|
1557
|
-
l: l
|
|
1558
|
-
} = rgbToHsl(this.r, this.g, this.b);
|
|
1559
|
-
return `${1 === opacity ? "hsl(" : "hsla("}${h},${s}%,${l}%${1 === opacity ? ")" : `,${opacity})`}`;
|
|
1928
|
+
scaleX() {
|
|
1929
|
+
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1930
|
+
return this.x1 *= s, this.x2 *= s, this;
|
|
1560
1931
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1932
|
+
scaleY() {
|
|
1933
|
+
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1934
|
+
return this.y1 *= s, this.y2 *= s, this;
|
|
1563
1935
|
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
function normalizePadding(padding) {
|
|
1567
|
-
if (isValidNumber$1(padding)) return [padding, padding, padding, padding];
|
|
1568
|
-
if (isArray$1(padding)) {
|
|
1569
|
-
const length = padding.length;
|
|
1570
|
-
if (1 === length) {
|
|
1571
|
-
const paddingValue = padding[0];
|
|
1572
|
-
return [paddingValue, paddingValue, paddingValue, paddingValue];
|
|
1573
|
-
}
|
|
1574
|
-
if (2 === length) {
|
|
1575
|
-
const [vertical, horizontal] = padding;
|
|
1576
|
-
return [vertical, horizontal, vertical, horizontal];
|
|
1577
|
-
}
|
|
1578
|
-
if (3 === length) {
|
|
1579
|
-
const [top, horizontal, bottom] = padding;
|
|
1580
|
-
return [top, horizontal, bottom, horizontal];
|
|
1581
|
-
}
|
|
1582
|
-
if (4 === length) return padding;
|
|
1936
|
+
transformWithMatrix(matrix) {
|
|
1937
|
+
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
1583
1938
|
}
|
|
1584
|
-
|
|
1939
|
+
copy(b) {
|
|
1940
|
+
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
1941
|
+
}
|
|
1942
|
+
rotatedPoints(angle, x, y) {
|
|
1585
1943
|
const {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1944
|
+
x1: x1,
|
|
1945
|
+
y1: y1,
|
|
1946
|
+
x2: x2,
|
|
1947
|
+
y2: y2
|
|
1948
|
+
} = this,
|
|
1949
|
+
cos = Math.cos(angle),
|
|
1950
|
+
sin = Math.sin(angle),
|
|
1951
|
+
cx = x - x * cos + y * sin,
|
|
1952
|
+
cy = y - x * sin - y * cos;
|
|
1953
|
+
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];
|
|
1592
1954
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
const arr = item.split(":");
|
|
1602
|
-
if (2 === arr.length) {
|
|
1603
|
-
const key = arr[0].trim(),
|
|
1604
|
-
value = arr[1].trim();
|
|
1605
|
-
key && value && (res[key] = value);
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
}), res;
|
|
1609
|
-
};
|
|
1610
|
-
const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1611
|
-
|
|
1612
|
-
var reactIs = {exports: {}};
|
|
1613
|
-
|
|
1614
|
-
var reactIs_production_min = {};
|
|
1615
|
-
|
|
1616
|
-
/**
|
|
1617
|
-
* @license React
|
|
1618
|
-
* react-is.production.min.js
|
|
1619
|
-
*
|
|
1620
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1621
|
-
*
|
|
1622
|
-
* This source code is licensed under the MIT license found in the
|
|
1623
|
-
* LICENSE file in the root directory of this source tree.
|
|
1624
|
-
*/
|
|
1625
|
-
var hasRequiredReactIs_production_min;
|
|
1626
|
-
function requireReactIs_production_min() {
|
|
1627
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1628
|
-
hasRequiredReactIs_production_min = 1;
|
|
1629
|
-
var b = Symbol.for("react.element"),
|
|
1630
|
-
c = Symbol.for("react.portal"),
|
|
1631
|
-
d = Symbol.for("react.fragment"),
|
|
1632
|
-
e = Symbol.for("react.strict_mode"),
|
|
1633
|
-
f = Symbol.for("react.profiler"),
|
|
1634
|
-
g = Symbol.for("react.provider"),
|
|
1635
|
-
h = Symbol.for("react.context"),
|
|
1636
|
-
k = Symbol.for("react.server_context"),
|
|
1637
|
-
l = Symbol.for("react.forward_ref"),
|
|
1638
|
-
m = Symbol.for("react.suspense"),
|
|
1639
|
-
n = Symbol.for("react.suspense_list"),
|
|
1640
|
-
p = Symbol.for("react.memo"),
|
|
1641
|
-
q = Symbol.for("react.lazy"),
|
|
1642
|
-
t = Symbol.for("react.offscreen"),
|
|
1643
|
-
u;
|
|
1644
|
-
u = Symbol.for("react.module.reference");
|
|
1645
|
-
function v(a) {
|
|
1646
|
-
if ("object" === typeof a && null !== a) {
|
|
1647
|
-
var r = a.$$typeof;
|
|
1648
|
-
switch (r) {
|
|
1649
|
-
case b:
|
|
1650
|
-
switch (a = a.type, a) {
|
|
1651
|
-
case d:
|
|
1652
|
-
case f:
|
|
1653
|
-
case e:
|
|
1654
|
-
case m:
|
|
1655
|
-
case n:
|
|
1656
|
-
return a;
|
|
1657
|
-
default:
|
|
1658
|
-
switch (a = a && a.$$typeof, a) {
|
|
1659
|
-
case k:
|
|
1660
|
-
case h:
|
|
1661
|
-
case l:
|
|
1662
|
-
case q:
|
|
1663
|
-
case p:
|
|
1664
|
-
case g:
|
|
1665
|
-
return a;
|
|
1666
|
-
default:
|
|
1667
|
-
return r;
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
case c:
|
|
1671
|
-
return r;
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1955
|
+
scalePoints(sx, sy, x, y) {
|
|
1956
|
+
const {
|
|
1957
|
+
x1: x1,
|
|
1958
|
+
y1: y1,
|
|
1959
|
+
x2: x2,
|
|
1960
|
+
y2: y2
|
|
1961
|
+
} = this;
|
|
1962
|
+
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
1674
1963
|
}
|
|
1675
|
-
reactIs_production_min.ContextConsumer = h;
|
|
1676
|
-
reactIs_production_min.ContextProvider = g;
|
|
1677
|
-
reactIs_production_min.Element = b;
|
|
1678
|
-
reactIs_production_min.ForwardRef = l;
|
|
1679
|
-
reactIs_production_min.Fragment = d;
|
|
1680
|
-
reactIs_production_min.Lazy = q;
|
|
1681
|
-
reactIs_production_min.Memo = p;
|
|
1682
|
-
reactIs_production_min.Portal = c;
|
|
1683
|
-
reactIs_production_min.Profiler = f;
|
|
1684
|
-
reactIs_production_min.StrictMode = e;
|
|
1685
|
-
reactIs_production_min.Suspense = m;
|
|
1686
|
-
reactIs_production_min.SuspenseList = n;
|
|
1687
|
-
reactIs_production_min.isAsyncMode = function () {
|
|
1688
|
-
return !1;
|
|
1689
|
-
};
|
|
1690
|
-
reactIs_production_min.isConcurrentMode = function () {
|
|
1691
|
-
return !1;
|
|
1692
|
-
};
|
|
1693
|
-
reactIs_production_min.isContextConsumer = function (a) {
|
|
1694
|
-
return v(a) === h;
|
|
1695
|
-
};
|
|
1696
|
-
reactIs_production_min.isContextProvider = function (a) {
|
|
1697
|
-
return v(a) === g;
|
|
1698
|
-
};
|
|
1699
|
-
reactIs_production_min.isElement = function (a) {
|
|
1700
|
-
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
1701
|
-
};
|
|
1702
|
-
reactIs_production_min.isForwardRef = function (a) {
|
|
1703
|
-
return v(a) === l;
|
|
1704
|
-
};
|
|
1705
|
-
reactIs_production_min.isFragment = function (a) {
|
|
1706
|
-
return v(a) === d;
|
|
1707
|
-
};
|
|
1708
|
-
reactIs_production_min.isLazy = function (a) {
|
|
1709
|
-
return v(a) === q;
|
|
1710
|
-
};
|
|
1711
|
-
reactIs_production_min.isMemo = function (a) {
|
|
1712
|
-
return v(a) === p;
|
|
1713
|
-
};
|
|
1714
|
-
reactIs_production_min.isPortal = function (a) {
|
|
1715
|
-
return v(a) === c;
|
|
1716
|
-
};
|
|
1717
|
-
reactIs_production_min.isProfiler = function (a) {
|
|
1718
|
-
return v(a) === f;
|
|
1719
|
-
};
|
|
1720
|
-
reactIs_production_min.isStrictMode = function (a) {
|
|
1721
|
-
return v(a) === e;
|
|
1722
|
-
};
|
|
1723
|
-
reactIs_production_min.isSuspense = function (a) {
|
|
1724
|
-
return v(a) === m;
|
|
1725
|
-
};
|
|
1726
|
-
reactIs_production_min.isSuspenseList = function (a) {
|
|
1727
|
-
return v(a) === n;
|
|
1728
|
-
};
|
|
1729
|
-
reactIs_production_min.isValidElementType = function (a) {
|
|
1730
|
-
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? !0 : !1;
|
|
1731
|
-
};
|
|
1732
|
-
reactIs_production_min.typeOf = v;
|
|
1733
|
-
return reactIs_production_min;
|
|
1734
1964
|
}
|
|
1735
|
-
|
|
1736
|
-
{
|
|
1737
|
-
|
|
1965
|
+
class AABBBounds extends Bounds {}
|
|
1966
|
+
class OBBBounds extends Bounds {
|
|
1967
|
+
constructor(bounds) {
|
|
1968
|
+
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1969
|
+
var _a;
|
|
1970
|
+
super(bounds), bounds && (this.angle = null !== (_a = bounds.angle) && void 0 !== _a ? _a : angle);
|
|
1971
|
+
}
|
|
1972
|
+
intersects(b) {
|
|
1973
|
+
return isRotateAABBIntersect(this, b);
|
|
1974
|
+
}
|
|
1975
|
+
setValue() {
|
|
1976
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1977
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1978
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1979
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1980
|
+
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1981
|
+
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
1982
|
+
}
|
|
1983
|
+
clone() {
|
|
1984
|
+
return new OBBBounds(this);
|
|
1985
|
+
}
|
|
1986
|
+
getRotatedCorners() {
|
|
1987
|
+
const originPoint = {
|
|
1988
|
+
x: (this.x1 + this.x2) / 2,
|
|
1989
|
+
y: (this.y1 + this.y2) / 2
|
|
1990
|
+
};
|
|
1991
|
+
return [rotatePoint({
|
|
1992
|
+
x: this.x1,
|
|
1993
|
+
y: this.y1
|
|
1994
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1995
|
+
x: this.x2,
|
|
1996
|
+
y: this.y1
|
|
1997
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1998
|
+
x: this.x1,
|
|
1999
|
+
y: this.y2
|
|
2000
|
+
}, this.angle, originPoint), rotatePoint({
|
|
2001
|
+
x: this.x2,
|
|
2002
|
+
y: this.y2
|
|
2003
|
+
}, this.angle, originPoint)];
|
|
2004
|
+
}
|
|
1738
2005
|
}
|
|
1739
|
-
var reactIsExports = reactIs.exports;
|
|
1740
|
-
|
|
1741
|
-
const toArray = (children) => {
|
|
1742
|
-
let result = [];
|
|
1743
|
-
React.Children.forEach(children, child => {
|
|
1744
|
-
if (isNil$1(child)) {
|
|
1745
|
-
return;
|
|
1746
|
-
}
|
|
1747
|
-
if (reactIsExports.isFragment(child)) {
|
|
1748
|
-
result = result.concat(toArray(child.props.children));
|
|
1749
|
-
}
|
|
1750
|
-
else {
|
|
1751
|
-
result.push(child);
|
|
1752
|
-
}
|
|
1753
|
-
});
|
|
1754
|
-
return result;
|
|
1755
|
-
};
|
|
1756
|
-
|
|
1757
|
-
const REACT_PRIVATE_PROPS = ['children', 'hooks', 'ref'];
|
|
1758
|
-
|
|
1759
|
-
const EVENT_TYPE = {
|
|
1760
|
-
...vtable.TABLE_EVENT_TYPE,
|
|
1761
|
-
...vtable.PIVOT_TABLE_EVENT_TYPE,
|
|
1762
|
-
...vtable.PIVOT_CHART_EVENT_TYPE
|
|
1763
|
-
};
|
|
1764
|
-
const TABLE_EVENTS = {
|
|
1765
|
-
onClickCell: EVENT_TYPE.CLICK_CELL,
|
|
1766
|
-
onDblClickCell: EVENT_TYPE.DBLCLICK_CELL,
|
|
1767
|
-
onMouseDownCell: EVENT_TYPE.MOUSEDOWN_CELL,
|
|
1768
|
-
onMouseUpCell: EVENT_TYPE.MOUSEUP_CELL,
|
|
1769
|
-
onSelectedCell: EVENT_TYPE.SELECTED_CELL,
|
|
1770
|
-
onSelectedClear: EVENT_TYPE.SELECTED_CLEAR,
|
|
1771
|
-
onKeyDown: EVENT_TYPE.KEYDOWN,
|
|
1772
|
-
onMouseEnterTable: EVENT_TYPE.MOUSEENTER_TABLE,
|
|
1773
|
-
onMouseLeaveTable: EVENT_TYPE.MOUSELEAVE_TABLE,
|
|
1774
|
-
onMouseDownTable: EVENT_TYPE.MOUSEDOWN_TABLE,
|
|
1775
|
-
onMouseMoveCell: EVENT_TYPE.MOUSEMOVE_CELL,
|
|
1776
|
-
onMouseMoveTable: EVENT_TYPE.MOUSEMOVE_TABLE,
|
|
1777
|
-
onMouseEnterCell: EVENT_TYPE.MOUSEENTER_CELL,
|
|
1778
|
-
onMouseLeaveCell: EVENT_TYPE.MOUSELEAVE_CELL,
|
|
1779
|
-
onContextMenuCell: EVENT_TYPE.CONTEXTMENU_CELL,
|
|
1780
|
-
onResizeColumn: EVENT_TYPE.RESIZE_COLUMN,
|
|
1781
|
-
onResizeColumnEnd: EVENT_TYPE.RESIZE_COLUMN_END,
|
|
1782
|
-
onResizeRow: EVENT_TYPE.RESIZE_ROW,
|
|
1783
|
-
onResizeRowEnd: EVENT_TYPE.RESIZE_ROW_END,
|
|
1784
|
-
onChangeHeaderPositionStart: EVENT_TYPE.CHANGE_HEADER_POSITION_START,
|
|
1785
|
-
onChangeHeaderPosition: EVENT_TYPE.CHANGE_HEADER_POSITION,
|
|
1786
|
-
onChangeHeaderPositionFail: EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL,
|
|
1787
|
-
onSortClick: EVENT_TYPE.SORT_CLICK,
|
|
1788
|
-
onAfterSort: EVENT_TYPE.AFTER_SORT,
|
|
1789
|
-
onFreezeClick: EVENT_TYPE.FREEZE_CLICK,
|
|
1790
|
-
onScroll: EVENT_TYPE.SCROLL,
|
|
1791
|
-
onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END,
|
|
1792
|
-
onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
|
|
1793
|
-
onDropdownMenuClick: EVENT_TYPE.DROPDOWN_MENU_CLICK,
|
|
1794
|
-
onMouseOverChartSymbol: EVENT_TYPE.MOUSEOVER_CHART_SYMBOL,
|
|
1795
|
-
onDragSelectEnd: EVENT_TYPE.DRAG_SELECT_END,
|
|
1796
|
-
onCopyData: EVENT_TYPE.COPY_DATA,
|
|
1797
|
-
onDropdownIconClick: EVENT_TYPE.DROPDOWN_ICON_CLICK,
|
|
1798
|
-
onDropdownMenuClear: EVENT_TYPE.DROPDOWN_MENU_CLEAR,
|
|
1799
|
-
onTreeHierarchyStateChange: EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,
|
|
1800
|
-
onShowMenu: EVENT_TYPE.SHOW_MENU,
|
|
1801
|
-
onHideMenu: EVENT_TYPE.HIDE_MENU,
|
|
1802
|
-
onIconClick: EVENT_TYPE.ICON_CLICK,
|
|
1803
|
-
onLegendItemClick: EVENT_TYPE.LEGEND_ITEM_CLICK,
|
|
1804
|
-
onLegendItemHover: EVENT_TYPE.LEGEND_ITEM_HOVER,
|
|
1805
|
-
onLegendItemUnHover: EVENT_TYPE.LEGEND_ITEM_UNHOVER,
|
|
1806
|
-
onLegendChange: EVENT_TYPE.LEGEND_CHANGE,
|
|
1807
|
-
onMouseEnterAxis: EVENT_TYPE.MOUSEENTER_AXIS,
|
|
1808
|
-
onMouseLeaveAxis: EVENT_TYPE.MOUSELEAVE_AXIS,
|
|
1809
|
-
onCheckboxStateChange: EVENT_TYPE.CHECKBOX_STATE_CHANGE,
|
|
1810
|
-
onRadioStateChange: EVENT_TYPE.RADIO_STATE_CHANGE,
|
|
1811
|
-
onSwitchStateChange: EVENT_TYPE.SWITCH_STATE_CHANGE,
|
|
1812
|
-
onAfterRender: EVENT_TYPE.AFTER_RENDER,
|
|
1813
|
-
onInitialized: EVENT_TYPE.INITIALIZED,
|
|
1814
|
-
onChangeCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
1815
|
-
onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
|
|
1816
|
-
onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
|
|
1817
|
-
onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
|
|
1818
|
-
onPivotSortClick: EVENT_TYPE.PIVOT_SORT_CLICK,
|
|
1819
|
-
onDrillMenuClick: EVENT_TYPE.DRILLMENU_CLICK,
|
|
1820
|
-
onVChartEventType: EVENT_TYPE.VCHART_EVENT_TYPE,
|
|
1821
|
-
onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
1822
|
-
onEmptyTipClick: EVENT_TYPE.EMPTY_TIP_CLICK,
|
|
1823
|
-
onEmptyTipDblClick: EVENT_TYPE.EMPTY_TIP_DBLCLICK,
|
|
1824
|
-
onButtonClick: EVENT_TYPE.BUTTON_CLICK
|
|
1825
|
-
};
|
|
1826
|
-
const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
|
|
1827
|
-
const findEventProps = (props, supportedEvents = TABLE_EVENTS) => {
|
|
1828
|
-
const result = {};
|
|
1829
|
-
Object.keys(props).forEach(key => {
|
|
1830
|
-
if (supportedEvents[key] && props[key]) {
|
|
1831
|
-
result[key] = props[key];
|
|
1832
|
-
}
|
|
1833
|
-
});
|
|
1834
|
-
return result;
|
|
1835
|
-
};
|
|
1836
|
-
const bindEventsToTable = (table, newProps, prevProps, supportedEvents = TABLE_EVENTS) => {
|
|
1837
|
-
if ((!newProps && !prevProps) || !table) {
|
|
1838
|
-
return false;
|
|
1839
|
-
}
|
|
1840
|
-
const prevEventProps = prevProps ? findEventProps(prevProps, supportedEvents) : null;
|
|
1841
|
-
const newEventProps = newProps ? findEventProps(newProps, supportedEvents) : null;
|
|
1842
|
-
if (prevEventProps) {
|
|
1843
|
-
Object.keys(prevEventProps).forEach(eventKey => {
|
|
1844
|
-
if (!newEventProps ||
|
|
1845
|
-
!newEventProps[eventKey] ||
|
|
1846
|
-
newEventProps[eventKey] !== prevEventProps[eventKey]) {
|
|
1847
|
-
table.off(supportedEvents[eventKey], prevProps[eventKey]);
|
|
1848
|
-
}
|
|
1849
|
-
});
|
|
1850
|
-
}
|
|
1851
|
-
if (newEventProps) {
|
|
1852
|
-
Object.keys(newEventProps).forEach(eventKey => {
|
|
1853
|
-
if (!prevEventProps ||
|
|
1854
|
-
!prevEventProps[eventKey] ||
|
|
1855
|
-
prevEventProps[eventKey] !== newEventProps[eventKey]) {
|
|
1856
|
-
table.on(supportedEvents[eventKey], newEventProps[eventKey]);
|
|
1857
|
-
}
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1860
|
-
return true;
|
|
1861
|
-
};
|
|
1862
2006
|
|
|
1863
|
-
class
|
|
1864
|
-
|
|
1865
|
-
|
|
2007
|
+
class Matrix {
|
|
2008
|
+
constructor() {
|
|
2009
|
+
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2010
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2011
|
+
let c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2012
|
+
let d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2013
|
+
let e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2014
|
+
let f = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
2015
|
+
this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f;
|
|
2016
|
+
}
|
|
2017
|
+
equalToMatrix(m2) {
|
|
2018
|
+
return !(this.e !== m2.e || this.f !== m2.f || this.a !== m2.a || this.d !== m2.d || this.b !== m2.b || this.c !== m2.c);
|
|
2019
|
+
}
|
|
2020
|
+
equalTo(a, b, c, d, e, f) {
|
|
2021
|
+
return !(this.e !== e || this.f !== f || this.a !== a || this.d !== d || this.b !== b || this.c !== c);
|
|
2022
|
+
}
|
|
2023
|
+
setValue(a, b, c, d, e, f) {
|
|
2024
|
+
return this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f, this;
|
|
2025
|
+
}
|
|
2026
|
+
reset() {
|
|
2027
|
+
return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.e = 0, this.f = 0, this;
|
|
2028
|
+
}
|
|
2029
|
+
getInverse() {
|
|
2030
|
+
const a = this.a,
|
|
2031
|
+
b = this.b,
|
|
2032
|
+
c = this.c,
|
|
2033
|
+
d = this.d,
|
|
2034
|
+
e = this.e,
|
|
2035
|
+
f = this.f,
|
|
2036
|
+
m = new Matrix(),
|
|
2037
|
+
dt = a * d - b * c;
|
|
2038
|
+
return m.a = d / dt, m.b = -b / dt, m.c = -c / dt, m.d = a / dt, m.e = (c * f - d * e) / dt, m.f = -(a * f - b * e) / dt, m;
|
|
2039
|
+
}
|
|
2040
|
+
rotate(rad) {
|
|
2041
|
+
const c = Math.cos(rad),
|
|
2042
|
+
s = Math.sin(rad),
|
|
2043
|
+
m11 = this.a * c + this.c * s,
|
|
2044
|
+
m12 = this.b * c + this.d * s,
|
|
2045
|
+
m21 = this.a * -s + this.c * c,
|
|
2046
|
+
m22 = this.b * -s + this.d * c;
|
|
2047
|
+
return this.a = m11, this.b = m12, this.c = m21, this.d = m22, this;
|
|
1866
2048
|
}
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
2049
|
+
rotateByCenter(rad, cx, cy) {
|
|
2050
|
+
const cos = Math.cos(rad),
|
|
2051
|
+
sin = Math.sin(rad),
|
|
2052
|
+
rotateM13 = (1 - cos) * cx + sin * cy,
|
|
2053
|
+
rotateM23 = (1 - cos) * cy - sin * cx,
|
|
2054
|
+
m11 = cos * this.a - sin * this.b,
|
|
2055
|
+
m21 = sin * this.a + cos * this.b,
|
|
2056
|
+
m12 = cos * this.c - sin * this.d,
|
|
2057
|
+
m22 = sin * this.c + cos * this.d,
|
|
2058
|
+
m13 = cos * this.e - sin * this.f + rotateM13,
|
|
2059
|
+
m23 = sin * this.e + cos * this.f + rotateM23;
|
|
2060
|
+
return this.a = m11, this.b = m21, this.c = m12, this.d = m22, this.e = m13, this.f = m23, this;
|
|
1873
2061
|
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
const NAMED_TAG = "named";
|
|
1877
|
-
const INJECT_TAG = "inject";
|
|
1878
|
-
const MULTI_INJECT_TAG = "multi_inject";
|
|
1879
|
-
const TAGGED = "inversify:tagged";
|
|
1880
|
-
const PARAM_TYPES = "inversify:paramtypes";
|
|
1881
|
-
|
|
1882
|
-
class Metadata {
|
|
1883
|
-
constructor(key, value) {
|
|
1884
|
-
this.key = key, this.value = value;
|
|
2062
|
+
scale(sx, sy) {
|
|
2063
|
+
return this.a *= sx, this.b *= sx, this.c *= sy, this.d *= sy, this;
|
|
1885
2064
|
}
|
|
1886
|
-
|
|
1887
|
-
return this.
|
|
2065
|
+
setScale(sx, sy) {
|
|
2066
|
+
return this.b = this.b / this.a * sx, this.c = this.c / this.d * sy, this.a = sx, this.d = sy, this;
|
|
1888
2067
|
}
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
}
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
}
|
|
1974
|
-
function IsSymbol(x) {
|
|
1975
|
-
return "symbol" == typeof x;
|
|
1976
|
-
}
|
|
1977
|
-
function IsObject(x) {
|
|
1978
|
-
return "object" == typeof x ? null !== x : "function" == typeof x;
|
|
1979
|
-
}
|
|
1980
|
-
function ToPrimitive(input, PreferredType) {
|
|
1981
|
-
switch (Type(input)) {
|
|
1982
|
-
case 0:
|
|
1983
|
-
case 1:
|
|
1984
|
-
case 2:
|
|
1985
|
-
case 3:
|
|
1986
|
-
case 4:
|
|
1987
|
-
case 5:
|
|
1988
|
-
return input;
|
|
1989
|
-
}
|
|
1990
|
-
const hint = 3 === PreferredType ? "string" : 5 === PreferredType ? "number" : "default",
|
|
1991
|
-
exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
1992
|
-
if (void 0 !== exoticToPrim) {
|
|
1993
|
-
const result = exoticToPrim.call(input, hint);
|
|
1994
|
-
if (IsObject(result)) throw new TypeError();
|
|
1995
|
-
return result;
|
|
1996
|
-
}
|
|
1997
|
-
return OrdinaryToPrimitive(input, "default" === hint ? "number" : hint);
|
|
1998
|
-
}
|
|
1999
|
-
function OrdinaryToPrimitive(O, hint) {
|
|
2000
|
-
if ("string" === hint) {
|
|
2001
|
-
const toString_1 = O.toString;
|
|
2002
|
-
if (IsCallable(toString_1)) {
|
|
2003
|
-
const result = toString_1.call(O);
|
|
2004
|
-
if (!IsObject(result)) return result;
|
|
2005
|
-
}
|
|
2006
|
-
const valueOf = O.valueOf;
|
|
2007
|
-
if (IsCallable(valueOf)) {
|
|
2008
|
-
const result = valueOf.call(O);
|
|
2009
|
-
if (!IsObject(result)) return result;
|
|
2010
|
-
}
|
|
2011
|
-
} else {
|
|
2012
|
-
const valueOf = O.valueOf;
|
|
2013
|
-
if (IsCallable(valueOf)) {
|
|
2014
|
-
const result = valueOf.call(O);
|
|
2015
|
-
if (!IsObject(result)) return result;
|
|
2016
|
-
}
|
|
2017
|
-
const toString_2 = O.toString;
|
|
2018
|
-
if (IsCallable(toString_2)) {
|
|
2019
|
-
const result = toString_2.call(O);
|
|
2020
|
-
if (!IsObject(result)) return result;
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
throw new TypeError();
|
|
2024
|
-
}
|
|
2025
|
-
function ToBoolean(argument) {
|
|
2026
|
-
return !!argument;
|
|
2027
|
-
}
|
|
2028
|
-
function ToString(argument) {
|
|
2029
|
-
return "" + argument;
|
|
2030
|
-
}
|
|
2031
|
-
function ToPropertyKey(argument) {
|
|
2032
|
-
const key = ToPrimitive(argument, 3);
|
|
2033
|
-
return IsSymbol(key) ? key : ToString(key);
|
|
2034
|
-
}
|
|
2035
|
-
function IsCallable(argument) {
|
|
2036
|
-
return "function" == typeof argument;
|
|
2037
|
-
}
|
|
2038
|
-
function GetMethod(V, P) {
|
|
2039
|
-
const func = V[P];
|
|
2040
|
-
if (null != func) {
|
|
2041
|
-
if (!IsCallable(func)) throw new TypeError();
|
|
2042
|
-
return func;
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
function OrdinaryGetPrototypeOf(O) {
|
|
2046
|
-
const proto = Object.getPrototypeOf(O);
|
|
2047
|
-
if ("function" != typeof O || O === functionPrototype) return proto;
|
|
2048
|
-
if (proto !== functionPrototype) return proto;
|
|
2049
|
-
const prototype = O.prototype,
|
|
2050
|
-
prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
2051
|
-
if (null == prototypeProto || prototypeProto === Object.prototype) return proto;
|
|
2052
|
-
const constructor = prototypeProto.constructor;
|
|
2053
|
-
return "function" != typeof constructor || constructor === O ? proto : constructor;
|
|
2068
|
+
transform(a, b, c, d, e, f) {
|
|
2069
|
+
return this.multiply(a, b, c, d, e, f), this;
|
|
2070
|
+
}
|
|
2071
|
+
translate(x, y) {
|
|
2072
|
+
return this.e += this.a * x + this.c * y, this.f += this.b * x + this.d * y, this;
|
|
2073
|
+
}
|
|
2074
|
+
transpose() {
|
|
2075
|
+
const {
|
|
2076
|
+
a: a,
|
|
2077
|
+
b: b,
|
|
2078
|
+
c: c,
|
|
2079
|
+
d: d,
|
|
2080
|
+
e: e,
|
|
2081
|
+
f: f
|
|
2082
|
+
} = this;
|
|
2083
|
+
return this.a = b, this.b = a, this.c = d, this.d = c, this.e = f, this.f = e, this;
|
|
2084
|
+
}
|
|
2085
|
+
multiply(a2, b2, c2, d2, e2, f2) {
|
|
2086
|
+
const a1 = this.a,
|
|
2087
|
+
b1 = this.b,
|
|
2088
|
+
c1 = this.c,
|
|
2089
|
+
d1 = this.d,
|
|
2090
|
+
m11 = a1 * a2 + c1 * b2,
|
|
2091
|
+
m12 = b1 * a2 + d1 * b2,
|
|
2092
|
+
m21 = a1 * c2 + c1 * d2,
|
|
2093
|
+
m22 = b1 * c2 + d1 * d2,
|
|
2094
|
+
dx = a1 * e2 + c1 * f2 + this.e,
|
|
2095
|
+
dy = b1 * e2 + d1 * f2 + this.f;
|
|
2096
|
+
return this.a = m11, this.b = m12, this.c = m21, this.d = m22, this.e = dx, this.f = dy, this;
|
|
2097
|
+
}
|
|
2098
|
+
interpolate(m2, t) {
|
|
2099
|
+
const m = new Matrix();
|
|
2100
|
+
return m.a = this.a + (m2.a - this.a) * t, m.b = this.b + (m2.b - this.b) * t, m.c = this.c + (m2.c - this.c) * t, m.d = this.d + (m2.d - this.d) * t, m.e = this.e + (m2.e - this.e) * t, m.f = this.f + (m2.f - this.f) * t, m;
|
|
2101
|
+
}
|
|
2102
|
+
transformPoint(source, target) {
|
|
2103
|
+
const {
|
|
2104
|
+
a: a,
|
|
2105
|
+
b: b,
|
|
2106
|
+
c: c,
|
|
2107
|
+
d: d,
|
|
2108
|
+
e: e,
|
|
2109
|
+
f: f
|
|
2110
|
+
} = this,
|
|
2111
|
+
dt = a * d - b * c,
|
|
2112
|
+
nextA = d / dt,
|
|
2113
|
+
nextB = -b / dt,
|
|
2114
|
+
nextC = -c / dt,
|
|
2115
|
+
nextD = a / dt,
|
|
2116
|
+
nextE = (c * f - d * e) / dt,
|
|
2117
|
+
nextF = -(a * f - b * e) / dt,
|
|
2118
|
+
{
|
|
2119
|
+
x: x,
|
|
2120
|
+
y: y
|
|
2121
|
+
} = source;
|
|
2122
|
+
target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
|
|
2123
|
+
}
|
|
2124
|
+
onlyTranslate() {
|
|
2125
|
+
let scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2126
|
+
return this.a === scale && 0 === this.b && 0 === this.c && this.d === scale;
|
|
2127
|
+
}
|
|
2128
|
+
clone() {
|
|
2129
|
+
return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
|
|
2130
|
+
}
|
|
2131
|
+
toTransformAttrs() {
|
|
2132
|
+
const a = this.a,
|
|
2133
|
+
b = this.b,
|
|
2134
|
+
c = this.c,
|
|
2135
|
+
d = this.d,
|
|
2136
|
+
delta = a * d - b * c,
|
|
2137
|
+
result = {
|
|
2138
|
+
x: this.e,
|
|
2139
|
+
y: this.f,
|
|
2140
|
+
rotateDeg: 0,
|
|
2141
|
+
scaleX: 0,
|
|
2142
|
+
scaleY: 0,
|
|
2143
|
+
skewX: 0,
|
|
2144
|
+
skewY: 0
|
|
2145
|
+
};
|
|
2146
|
+
if (0 !== a || 0 !== b) {
|
|
2147
|
+
const r = Math.sqrt(a * a + b * b);
|
|
2148
|
+
result.rotateDeg = b > 0 ? Math.acos(a / r) : -Math.acos(a / r), result.scaleX = r, result.scaleY = delta / r, result.skewX = (a * c + b * d) / delta, result.skewY = 0;
|
|
2149
|
+
} else if (0 !== c || 0 !== d) {
|
|
2150
|
+
const s = Math.sqrt(c * c + d * d);
|
|
2151
|
+
result.rotateDeg = Math.PI / 2 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)), result.scaleX = delta / s, result.scaleY = s, result.skewX = 0, result.skewY = (a * c + b * d) / delta;
|
|
2054
2152
|
}
|
|
2055
|
-
|
|
2056
|
-
}
|
|
2057
|
-
"function" != typeof target[key] && Object.defineProperty(target, key, {
|
|
2058
|
-
configurable: !0,
|
|
2059
|
-
writable: !0,
|
|
2060
|
-
value: value
|
|
2061
|
-
});
|
|
2062
|
-
})), Reflect;
|
|
2063
|
-
})({});
|
|
2064
|
-
|
|
2065
|
-
function _tagParameterOrProperty(metadataKey, annotationTarget, key, metadata) {
|
|
2066
|
-
const metadatas = [metadata];
|
|
2067
|
-
let paramsOrPropertiesMetadata = {};
|
|
2068
|
-
Reflect$1.hasOwnMetadata(metadataKey, annotationTarget) && (paramsOrPropertiesMetadata = Reflect$1.getMetadata(metadataKey, annotationTarget));
|
|
2069
|
-
let paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
|
|
2070
|
-
void 0 === paramOrPropertyMetadata && (paramOrPropertyMetadata = []), paramOrPropertyMetadata.push(...metadatas), paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata, Reflect$1.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
|
|
2153
|
+
return result.rotateDeg = radianToDegree(result.rotateDeg), result;
|
|
2154
|
+
}
|
|
2071
2155
|
}
|
|
2072
|
-
function
|
|
2073
|
-
|
|
2156
|
+
function normalTransform(out, origin, x, y, scaleX, scaleY, angle, rotateCenter) {
|
|
2157
|
+
const oa = origin.a,
|
|
2158
|
+
ob = origin.b,
|
|
2159
|
+
oc = origin.c,
|
|
2160
|
+
od = origin.d,
|
|
2161
|
+
oe = origin.e,
|
|
2162
|
+
of = origin.f,
|
|
2163
|
+
cosTheta = cos(angle),
|
|
2164
|
+
sinTheta = sin(angle);
|
|
2165
|
+
let rotateCenterX, rotateCenterY;
|
|
2166
|
+
rotateCenter ? (rotateCenterX = rotateCenter[0], rotateCenterY = rotateCenter[1]) : (rotateCenterX = x, rotateCenterY = y);
|
|
2167
|
+
const offsetX = rotateCenterX - x,
|
|
2168
|
+
offsetY = rotateCenterY - y,
|
|
2169
|
+
a1 = oa * cosTheta + oc * sinTheta,
|
|
2170
|
+
b1 = ob * cosTheta + od * sinTheta,
|
|
2171
|
+
c1 = oc * cosTheta - oa * sinTheta,
|
|
2172
|
+
d1 = od * cosTheta - ob * sinTheta;
|
|
2173
|
+
out.a = scaleX * a1, out.b = scaleX * b1, out.c = scaleY * c1, out.d = scaleY * d1, out.e = oe + oa * rotateCenterX + oc * rotateCenterY - a1 * offsetX - c1 * offsetY, out.f = of + ob * rotateCenterX + od * rotateCenterY - b1 * offsetX - d1 * offsetY;
|
|
2074
2174
|
}
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2175
|
+
|
|
2176
|
+
function hslToRgb(h, s, l) {
|
|
2177
|
+
s /= 100, l /= 100;
|
|
2178
|
+
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
2179
|
+
x = c * (1 - Math.abs(h / 60 % 2 - 1)),
|
|
2180
|
+
m = l - c / 2;
|
|
2181
|
+
let r = 0,
|
|
2182
|
+
g = 0,
|
|
2183
|
+
b = 0;
|
|
2184
|
+
return 0 <= h && h < 60 ? (r = c, g = x, b = 0) : 60 <= h && h < 120 ? (r = x, g = c, b = 0) : 120 <= h && h < 180 ? (r = 0, g = c, b = x) : 180 <= h && h < 240 ? (r = 0, g = x, b = c) : 240 <= h && h < 300 ? (r = x, g = 0, b = c) : 300 <= h && h < 360 && (r = c, g = 0, b = x), r = Math.round(255 * (r + m)), g = Math.round(255 * (g + m)), b = Math.round(255 * (b + m)), {
|
|
2185
|
+
r: r,
|
|
2186
|
+
g: g,
|
|
2187
|
+
b: b
|
|
2078
2188
|
};
|
|
2079
2189
|
}
|
|
2080
|
-
function injectBase(metadataKey) {
|
|
2081
|
-
return serviceIdentifier => (target, targetKey, indexOrPropertyDescriptor) => createTaggedDecorator(new Metadata(metadataKey, serviceIdentifier))(target, targetKey, indexOrPropertyDescriptor);
|
|
2082
|
-
}
|
|
2083
2190
|
|
|
2084
|
-
|
|
2191
|
+
function rgbToHsl(r, g, b) {
|
|
2192
|
+
r /= 255, g /= 255, b /= 255;
|
|
2193
|
+
const cMin = Math.min(r, g, b),
|
|
2194
|
+
cMax = Math.max(r, g, b),
|
|
2195
|
+
delta = cMax - cMin;
|
|
2196
|
+
let h = 0,
|
|
2197
|
+
s = 0,
|
|
2198
|
+
l = 0;
|
|
2199
|
+
return h = 0 === delta ? 0 : cMax === r ? (g - b) / delta % 6 : cMax === g ? (b - r) / delta + 2 : (r - g) / delta + 4, h = Math.round(60 * h), h < 0 && (h += 360), l = (cMax + cMin) / 2, s = 0 === delta ? 0 : delta / (1 - Math.abs(2 * l - 1)), s = +(100 * s).toFixed(1), l = +(100 * l).toFixed(1), {
|
|
2200
|
+
h: h,
|
|
2201
|
+
s: s,
|
|
2202
|
+
l: l
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
2085
2205
|
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2206
|
+
const REG_HEX = /^#([0-9a-f]{3,8})$/,
|
|
2207
|
+
DEFAULT_COLORS_OPACITY = {
|
|
2208
|
+
transparent: 4294967040
|
|
2089
2209
|
};
|
|
2210
|
+
const DEFAULT_COLORS = {
|
|
2211
|
+
aliceblue: 15792383,
|
|
2212
|
+
antiquewhite: 16444375,
|
|
2213
|
+
aqua: 65535,
|
|
2214
|
+
aquamarine: 8388564,
|
|
2215
|
+
azure: 15794175,
|
|
2216
|
+
beige: 16119260,
|
|
2217
|
+
bisque: 16770244,
|
|
2218
|
+
black: 0,
|
|
2219
|
+
blanchedalmond: 16772045,
|
|
2220
|
+
blue: 255,
|
|
2221
|
+
blueviolet: 9055202,
|
|
2222
|
+
brown: 10824234,
|
|
2223
|
+
burlywood: 14596231,
|
|
2224
|
+
cadetblue: 6266528,
|
|
2225
|
+
chartreuse: 8388352,
|
|
2226
|
+
chocolate: 13789470,
|
|
2227
|
+
coral: 16744272,
|
|
2228
|
+
cornflowerblue: 6591981,
|
|
2229
|
+
cornsilk: 16775388,
|
|
2230
|
+
crimson: 14423100,
|
|
2231
|
+
cyan: 65535,
|
|
2232
|
+
darkblue: 139,
|
|
2233
|
+
darkcyan: 35723,
|
|
2234
|
+
darkgoldenrod: 12092939,
|
|
2235
|
+
darkgray: 11119017,
|
|
2236
|
+
darkgreen: 25600,
|
|
2237
|
+
darkgrey: 11119017,
|
|
2238
|
+
darkkhaki: 12433259,
|
|
2239
|
+
darkmagenta: 9109643,
|
|
2240
|
+
darkolivegreen: 5597999,
|
|
2241
|
+
darkorange: 16747520,
|
|
2242
|
+
darkorchid: 10040012,
|
|
2243
|
+
darkred: 9109504,
|
|
2244
|
+
darksalmon: 15308410,
|
|
2245
|
+
darkseagreen: 9419919,
|
|
2246
|
+
darkslateblue: 4734347,
|
|
2247
|
+
darkslategray: 3100495,
|
|
2248
|
+
darkslategrey: 3100495,
|
|
2249
|
+
darkturquoise: 52945,
|
|
2250
|
+
darkviolet: 9699539,
|
|
2251
|
+
deeppink: 16716947,
|
|
2252
|
+
deepskyblue: 49151,
|
|
2253
|
+
dimgray: 6908265,
|
|
2254
|
+
dimgrey: 6908265,
|
|
2255
|
+
dodgerblue: 2003199,
|
|
2256
|
+
firebrick: 11674146,
|
|
2257
|
+
floralwhite: 16775920,
|
|
2258
|
+
forestgreen: 2263842,
|
|
2259
|
+
fuchsia: 16711935,
|
|
2260
|
+
gainsboro: 14474460,
|
|
2261
|
+
ghostwhite: 16316671,
|
|
2262
|
+
gold: 16766720,
|
|
2263
|
+
goldenrod: 14329120,
|
|
2264
|
+
gray: 8421504,
|
|
2265
|
+
green: 32768,
|
|
2266
|
+
greenyellow: 11403055,
|
|
2267
|
+
grey: 8421504,
|
|
2268
|
+
honeydew: 15794160,
|
|
2269
|
+
hotpink: 16738740,
|
|
2270
|
+
indianred: 13458524,
|
|
2271
|
+
indigo: 4915330,
|
|
2272
|
+
ivory: 16777200,
|
|
2273
|
+
khaki: 15787660,
|
|
2274
|
+
lavender: 15132410,
|
|
2275
|
+
lavenderblush: 16773365,
|
|
2276
|
+
lawngreen: 8190976,
|
|
2277
|
+
lemonchiffon: 16775885,
|
|
2278
|
+
lightblue: 11393254,
|
|
2279
|
+
lightcoral: 15761536,
|
|
2280
|
+
lightcyan: 14745599,
|
|
2281
|
+
lightgoldenrodyellow: 16448210,
|
|
2282
|
+
lightgray: 13882323,
|
|
2283
|
+
lightgreen: 9498256,
|
|
2284
|
+
lightgrey: 13882323,
|
|
2285
|
+
lightpink: 16758465,
|
|
2286
|
+
lightsalmon: 16752762,
|
|
2287
|
+
lightseagreen: 2142890,
|
|
2288
|
+
lightskyblue: 8900346,
|
|
2289
|
+
lightslategray: 7833753,
|
|
2290
|
+
lightslategrey: 7833753,
|
|
2291
|
+
lightsteelblue: 11584734,
|
|
2292
|
+
lightyellow: 16777184,
|
|
2293
|
+
lime: 65280,
|
|
2294
|
+
limegreen: 3329330,
|
|
2295
|
+
linen: 16445670,
|
|
2296
|
+
magenta: 16711935,
|
|
2297
|
+
maroon: 8388608,
|
|
2298
|
+
mediumaquamarine: 6737322,
|
|
2299
|
+
mediumblue: 205,
|
|
2300
|
+
mediumorchid: 12211667,
|
|
2301
|
+
mediumpurple: 9662683,
|
|
2302
|
+
mediumseagreen: 3978097,
|
|
2303
|
+
mediumslateblue: 8087790,
|
|
2304
|
+
mediumspringgreen: 64154,
|
|
2305
|
+
mediumturquoise: 4772300,
|
|
2306
|
+
mediumvioletred: 13047173,
|
|
2307
|
+
midnightblue: 1644912,
|
|
2308
|
+
mintcream: 16121850,
|
|
2309
|
+
mistyrose: 16770273,
|
|
2310
|
+
moccasin: 16770229,
|
|
2311
|
+
navajowhite: 16768685,
|
|
2312
|
+
navy: 128,
|
|
2313
|
+
oldlace: 16643558,
|
|
2314
|
+
olive: 8421376,
|
|
2315
|
+
olivedrab: 7048739,
|
|
2316
|
+
orange: 16753920,
|
|
2317
|
+
orangered: 16729344,
|
|
2318
|
+
orchid: 14315734,
|
|
2319
|
+
palegoldenrod: 15657130,
|
|
2320
|
+
palegreen: 10025880,
|
|
2321
|
+
paleturquoise: 11529966,
|
|
2322
|
+
palevioletred: 14381203,
|
|
2323
|
+
papayawhip: 16773077,
|
|
2324
|
+
peachpuff: 16767673,
|
|
2325
|
+
peru: 13468991,
|
|
2326
|
+
pink: 16761035,
|
|
2327
|
+
plum: 14524637,
|
|
2328
|
+
powderblue: 11591910,
|
|
2329
|
+
purple: 8388736,
|
|
2330
|
+
rebeccapurple: 6697881,
|
|
2331
|
+
red: 16711680,
|
|
2332
|
+
rosybrown: 12357519,
|
|
2333
|
+
royalblue: 4286945,
|
|
2334
|
+
saddlebrown: 9127187,
|
|
2335
|
+
salmon: 16416882,
|
|
2336
|
+
sandybrown: 16032864,
|
|
2337
|
+
seagreen: 3050327,
|
|
2338
|
+
seashell: 16774638,
|
|
2339
|
+
sienna: 10506797,
|
|
2340
|
+
silver: 12632256,
|
|
2341
|
+
skyblue: 8900331,
|
|
2342
|
+
slateblue: 6970061,
|
|
2343
|
+
slategray: 7372944,
|
|
2344
|
+
slategrey: 7372944,
|
|
2345
|
+
snow: 16775930,
|
|
2346
|
+
springgreen: 65407,
|
|
2347
|
+
steelblue: 4620980,
|
|
2348
|
+
tan: 13808780,
|
|
2349
|
+
teal: 32896,
|
|
2350
|
+
thistle: 14204888,
|
|
2351
|
+
tomato: 16737095,
|
|
2352
|
+
turquoise: 4251856,
|
|
2353
|
+
violet: 15631086,
|
|
2354
|
+
wheat: 16113331,
|
|
2355
|
+
white: 16777215,
|
|
2356
|
+
whitesmoke: 16119285,
|
|
2357
|
+
yellow: 16776960,
|
|
2358
|
+
yellowgreen: 10145074
|
|
2359
|
+
};
|
|
2360
|
+
function hex(value) {
|
|
2361
|
+
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2090
2362
|
}
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
return createTaggedDecorator(new Metadata(NAMED_TAG, name));
|
|
2363
|
+
function rgb(value) {
|
|
2364
|
+
return isNumber$1(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
2094
2365
|
}
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
Singleton: "Singleton",
|
|
2098
|
-
Transient: "Transient"
|
|
2099
|
-
},
|
|
2100
|
-
BindingTypeEnum = {
|
|
2101
|
-
ConstantValue: "ConstantValue",
|
|
2102
|
-
Constructor: "Constructor",
|
|
2103
|
-
DynamicValue: "DynamicValue",
|
|
2104
|
-
Factory: "Factory",
|
|
2105
|
-
Function: "Function",
|
|
2106
|
-
Instance: "Instance",
|
|
2107
|
-
Invalid: "Invalid",
|
|
2108
|
-
Provider: "Provider"
|
|
2109
|
-
};
|
|
2110
|
-
|
|
2111
|
-
class Binding {
|
|
2112
|
-
constructor(serviceIdentifier, scope) {
|
|
2113
|
-
this.id = Generator.GenAutoIncrementId(), this.activated = !1, this.serviceIdentifier = serviceIdentifier, this.scope = scope, this.type = BindingTypeEnum.Invalid, this.constraint = request => !0, this.implementationType = null, this.cache = null, this.factory = null, this.provider = null, this.dynamicValue = null;
|
|
2114
|
-
}
|
|
2115
|
-
clone() {
|
|
2116
|
-
const clone = new Binding(this.serviceIdentifier, this.scope);
|
|
2117
|
-
return clone.activated = clone.scope === BindingScopeEnum.Singleton && this.activated, clone.implementationType = this.implementationType, clone.dynamicValue = this.dynamicValue, clone.scope = this.scope, clone.type = this.type, clone.provider = this.provider, clone.constraint = this.constraint, clone.cache = this.cache, clone;
|
|
2118
|
-
}
|
|
2366
|
+
function rgba(value) {
|
|
2367
|
+
return isNumber$1(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
2119
2368
|
}
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
getConstructorMetadata(constructorFunc) {
|
|
2123
|
-
return {
|
|
2124
|
-
compilerGeneratedMetadata: Reflect$1.getMetadata(PARAM_TYPES, constructorFunc),
|
|
2125
|
-
userGeneratedMetadata: Reflect$1.getMetadata(TAGGED, constructorFunc) || {}
|
|
2126
|
-
};
|
|
2127
|
-
}
|
|
2128
|
-
getPropertiesMetadata(constructorFunc) {
|
|
2129
|
-
throw new Error("暂未实现");
|
|
2130
|
-
}
|
|
2369
|
+
function SRGBToLinear(c) {
|
|
2370
|
+
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
2131
2371
|
}
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
const
|
|
2139
|
-
|
|
2140
|
-
return
|
|
2141
|
-
};
|
|
2142
|
-
return constraint.metaData = new Metadata(key, value), constraint;
|
|
2143
|
-
};
|
|
2144
|
-
const namedConstraint = taggedConstraint(NAMED_TAG);
|
|
2145
|
-
|
|
2146
|
-
class BindingInSyntax {
|
|
2147
|
-
constructor(binding) {
|
|
2148
|
-
this._binding = binding;
|
|
2149
|
-
}
|
|
2150
|
-
inRequestScope() {
|
|
2151
|
-
throw new Error("暂未实现");
|
|
2152
|
-
}
|
|
2153
|
-
inSingletonScope() {
|
|
2154
|
-
return this._binding.scope = BindingScopeEnum.Singleton, this;
|
|
2372
|
+
function LinearToSRGB(c) {
|
|
2373
|
+
return c < .0031308 ? 12.92 * c : 1.055 * Math.pow(c, .41666) - .055;
|
|
2374
|
+
}
|
|
2375
|
+
const setHex = (formatValue, forceHex) => {
|
|
2376
|
+
const isHex = REG_HEX.exec(formatValue);
|
|
2377
|
+
if (forceHex || isHex) {
|
|
2378
|
+
const hex = parseInt(isHex[1], 16),
|
|
2379
|
+
hexLength = isHex[1].length;
|
|
2380
|
+
return 3 === hexLength ? new RGB((hex >> 8 & 15) + ((hex >> 8 & 15) << 4), (hex >> 4 & 15) + ((hex >> 4 & 15) << 4), (15 & hex) + ((15 & hex) << 4), 1) : 6 === hexLength ? rgb(hex) : 8 === hexLength ? new RGB(hex >> 24 & 255, hex >> 16 & 255, hex >> 8 & 255, (255 & hex) / 255) : null;
|
|
2155
2381
|
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2382
|
+
};
|
|
2383
|
+
class Color {
|
|
2384
|
+
static Brighter(source) {
|
|
2385
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2386
|
+
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
2158
2387
|
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2388
|
+
static SetOpacity(source) {
|
|
2389
|
+
let o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2390
|
+
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
2161
2391
|
}
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2392
|
+
static getColorBrightness(source) {
|
|
2393
|
+
let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "hsl";
|
|
2394
|
+
const color = source instanceof Color ? source : new Color(source);
|
|
2395
|
+
switch (model) {
|
|
2396
|
+
case "hsv":
|
|
2397
|
+
default:
|
|
2398
|
+
return color.getHSVBrightness();
|
|
2399
|
+
case "hsl":
|
|
2400
|
+
return color.getHSLBrightness();
|
|
2401
|
+
case "lum":
|
|
2402
|
+
return color.getLuminance();
|
|
2403
|
+
case "lum2":
|
|
2404
|
+
return color.getLuminance2();
|
|
2405
|
+
case "lum3":
|
|
2406
|
+
return color.getLuminance3();
|
|
2407
|
+
case "wcag":
|
|
2408
|
+
return color.getLuminanceWCAG();
|
|
2409
|
+
}
|
|
2167
2410
|
}
|
|
2168
|
-
|
|
2169
|
-
|
|
2411
|
+
static parseColorString(value) {
|
|
2412
|
+
if (isValid$1(DEFAULT_COLORS_OPACITY[value])) return rgba(DEFAULT_COLORS_OPACITY[value]);
|
|
2413
|
+
if (isValid$1(DEFAULT_COLORS[value])) return rgb(DEFAULT_COLORS[value]);
|
|
2414
|
+
const formatValue = `${value}`.trim().toLowerCase(),
|
|
2415
|
+
hexRes = setHex(formatValue);
|
|
2416
|
+
if (void 0 !== hexRes) return hexRes;
|
|
2417
|
+
if (/^(rgb|RGB|rgba|RGBA)/.test(formatValue)) {
|
|
2418
|
+
const aColor = formatValue.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g, "").split(",");
|
|
2419
|
+
return new RGB(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10), parseFloat(aColor[3]));
|
|
2420
|
+
}
|
|
2421
|
+
if (/^(hsl|HSL|hsla|HSLA)/.test(formatValue)) {
|
|
2422
|
+
const aColor = formatValue.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g, "").split(","),
|
|
2423
|
+
rgb = hslToRgb(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10));
|
|
2424
|
+
return new RGB(rgb.r, rgb.g, rgb.b, parseFloat(aColor[3]));
|
|
2425
|
+
}
|
|
2170
2426
|
}
|
|
2171
|
-
|
|
2172
|
-
const
|
|
2173
|
-
|
|
2427
|
+
constructor(value) {
|
|
2428
|
+
const color = Color.parseColorString(value);
|
|
2429
|
+
color ? this.color = color : (this.color = new RGB(255, 255, 255));
|
|
2174
2430
|
}
|
|
2175
|
-
|
|
2176
|
-
return this.
|
|
2431
|
+
toRGBA() {
|
|
2432
|
+
return this.color.formatRgb();
|
|
2177
2433
|
}
|
|
2178
|
-
|
|
2179
|
-
return this.
|
|
2434
|
+
toString() {
|
|
2435
|
+
return this.color.formatRgb();
|
|
2180
2436
|
}
|
|
2181
|
-
|
|
2182
|
-
return this.
|
|
2437
|
+
toHex() {
|
|
2438
|
+
return this.color.formatHex();
|
|
2183
2439
|
}
|
|
2184
|
-
|
|
2185
|
-
this.
|
|
2440
|
+
toHsl() {
|
|
2441
|
+
return this.color.formatHsl();
|
|
2186
2442
|
}
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2443
|
+
brighter(k) {
|
|
2444
|
+
const {
|
|
2445
|
+
r: r,
|
|
2446
|
+
g: g,
|
|
2447
|
+
b: b
|
|
2448
|
+
} = this.color;
|
|
2449
|
+
return this.color.r = Math.max(0, Math.min(255, Math.floor(r * k))), this.color.g = Math.max(0, Math.min(255, Math.floor(g * k))), this.color.b = Math.max(0, Math.min(255, Math.floor(b * k))), this;
|
|
2193
2450
|
}
|
|
2194
|
-
|
|
2195
|
-
const
|
|
2196
|
-
|
|
2451
|
+
add(color) {
|
|
2452
|
+
const {
|
|
2453
|
+
r: r,
|
|
2454
|
+
g: g,
|
|
2455
|
+
b: b
|
|
2456
|
+
} = this.color;
|
|
2457
|
+
return this.color.r += Math.min(255, r + color.color.r), this.color.g += Math.min(255, g + color.color.g), this.color.b += Math.min(255, b + color.color.b), this;
|
|
2197
2458
|
}
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
return this._get(getArgs);
|
|
2459
|
+
sub(color) {
|
|
2460
|
+
return this.color.r = Math.max(0, this.color.r - color.color.r), this.color.g = Math.max(0, this.color.g - color.color.g), this.color.b = Math.max(0, this.color.b - color.color.b), this;
|
|
2201
2461
|
}
|
|
2202
|
-
|
|
2203
|
-
const
|
|
2204
|
-
|
|
2462
|
+
multiply(color) {
|
|
2463
|
+
const {
|
|
2464
|
+
r: r,
|
|
2465
|
+
g: g,
|
|
2466
|
+
b: b
|
|
2467
|
+
} = this.color;
|
|
2468
|
+
return this.color.r = Math.max(0, Math.min(255, Math.floor(r * color.color.r))), this.color.g = Math.max(0, Math.min(255, Math.floor(g * color.color.g))), this.color.b = Math.max(0, Math.min(255, Math.floor(b * color.color.b))), this;
|
|
2205
2469
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
return this._get(getArgs);
|
|
2470
|
+
getHSVBrightness() {
|
|
2471
|
+
return Math.max(this.color.r, this.color.g, this.color.b) / 255;
|
|
2209
2472
|
}
|
|
2210
|
-
|
|
2211
|
-
return this.
|
|
2473
|
+
getHSLBrightness() {
|
|
2474
|
+
return .5 * (Math.max(this.color.r, this.color.g, this.color.b) / 255 + Math.min(this.color.r, this.color.g, this.color.b) / 255);
|
|
2212
2475
|
}
|
|
2213
|
-
|
|
2214
|
-
|
|
2476
|
+
setHsl(h, s, l) {
|
|
2477
|
+
const opacity = this.color.opacity,
|
|
2478
|
+
hsl = rgbToHsl(this.color.r, this.color.g, this.color.b),
|
|
2479
|
+
rgb = hslToRgb(isNil$1(h) ? hsl.h : clamp$1(h, 0, 360), isNil$1(s) ? hsl.s : s >= 0 && s <= 1 ? 100 * s : s, isNil$1(l) ? hsl.l : l <= 1 && l >= 0 ? 100 * l : l);
|
|
2480
|
+
return this.color = new RGB(rgb.r, rgb.g, rgb.b, opacity), this;
|
|
2215
2481
|
}
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
binding = new Binding(serviceIdentifier, scope),
|
|
2219
|
-
list = this._bindingDictionary.get(serviceIdentifier) || [];
|
|
2220
|
-
return list.push(binding), this._bindingDictionary.set(serviceIdentifier, list), new BindingToSyntax(binding);
|
|
2482
|
+
setRGB(r, g, b) {
|
|
2483
|
+
return !isNil$1(r) && (this.color.r = r), !isNil$1(g) && (this.color.g = g), !isNil$1(b) && (this.color.b = b), this;
|
|
2221
2484
|
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2485
|
+
setHex(value) {
|
|
2486
|
+
const formatValue = `${value}`.trim().toLowerCase(),
|
|
2487
|
+
res = setHex(formatValue, !0);
|
|
2488
|
+
return null != res ? res : this;
|
|
2224
2489
|
}
|
|
2225
|
-
|
|
2226
|
-
|
|
2490
|
+
setColorName(name) {
|
|
2491
|
+
const hex = DEFAULT_COLORS[name.toLowerCase()];
|
|
2492
|
+
return void 0 !== hex ? this.setHex(hex) : (void 0), this;
|
|
2227
2493
|
}
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
bindingToSyntax._binding.moduleId = moduleId;
|
|
2231
|
-
},
|
|
2232
|
-
getBindFunction = moduleId => serviceIdentifier => {
|
|
2233
|
-
const bindingToSyntax = this.bind(serviceIdentifier);
|
|
2234
|
-
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
2235
|
-
},
|
|
2236
|
-
getUnbindFunction = () => serviceIdentifier => this.unbind(serviceIdentifier),
|
|
2237
|
-
getIsboundFunction = () => serviceIdentifier => this.isBound(serviceIdentifier),
|
|
2238
|
-
getRebindFunction = moduleId => serviceIdentifier => {
|
|
2239
|
-
const bindingToSyntax = this.rebind(serviceIdentifier);
|
|
2240
|
-
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
2241
|
-
};
|
|
2242
|
-
return mId => ({
|
|
2243
|
-
bindFunction: getBindFunction(mId),
|
|
2244
|
-
isboundFunction: getIsboundFunction(),
|
|
2245
|
-
rebindFunction: getRebindFunction(mId),
|
|
2246
|
-
unbindFunction: getUnbindFunction(),
|
|
2247
|
-
unbindAsyncFunction: serviceIdentifier => null
|
|
2248
|
-
});
|
|
2494
|
+
setScalar(scalar) {
|
|
2495
|
+
return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
|
|
2249
2496
|
}
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
isMultiInject: isMultiInject,
|
|
2254
|
-
serviceIdentifier: serviceIdentifier,
|
|
2255
|
-
key: key,
|
|
2256
|
-
value: value
|
|
2257
|
-
};
|
|
2497
|
+
setOpacity() {
|
|
2498
|
+
let o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2499
|
+
return this.color.opacity = o, this;
|
|
2258
2500
|
}
|
|
2259
|
-
|
|
2260
|
-
return
|
|
2261
|
-
avoidConstraints: !0,
|
|
2262
|
-
isMultiInject: !0,
|
|
2263
|
-
serviceIdentifier: serviceIdentifier
|
|
2264
|
-
};
|
|
2501
|
+
getLuminance() {
|
|
2502
|
+
return (.2126 * this.color.r + .7152 * this.color.g + .0722 * this.color.b) / 255;
|
|
2265
2503
|
}
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
return this._bindingDictionary.get(getArgs.serviceIdentifier).filter(b => b.constraint(getArgs)).forEach(binding => {
|
|
2269
|
-
result.push(this._resolveFromBinding(binding));
|
|
2270
|
-
}), getArgs.isMultiInject || 1 !== result.length ? result : result[0];
|
|
2504
|
+
getLuminance2() {
|
|
2505
|
+
return (.2627 * this.color.r + .678 * this.color.g + .0593 * this.color.b) / 255;
|
|
2271
2506
|
}
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
{
|
|
2275
|
-
userGeneratedMetadata: userGeneratedMetadata
|
|
2276
|
-
} = this._metadataReader.getConstructorMetadata(constr),
|
|
2277
|
-
keys = Object.keys(userGeneratedMetadata),
|
|
2278
|
-
arr = [];
|
|
2279
|
-
for (let i = 0; i < keys.length; i++) {
|
|
2280
|
-
const constructorArgsMetadata = userGeneratedMetadata[i],
|
|
2281
|
-
targetMetadataMap = {};
|
|
2282
|
-
constructorArgsMetadata.forEach(md => {
|
|
2283
|
-
targetMetadataMap[md.key] = md.value;
|
|
2284
|
-
});
|
|
2285
|
-
const metadata = {
|
|
2286
|
-
inject: targetMetadataMap[INJECT_TAG],
|
|
2287
|
-
multiInject: targetMetadataMap[MULTI_INJECT_TAG]
|
|
2288
|
-
},
|
|
2289
|
-
injectIdentifier = metadata.inject || metadata.multiInject,
|
|
2290
|
-
target = {
|
|
2291
|
-
serviceIdentifier: injectIdentifier,
|
|
2292
|
-
constructorArgsMetadata: constructorArgsMetadata
|
|
2293
|
-
},
|
|
2294
|
-
bindings = (this._bindingDictionary.get(injectIdentifier) || []).filter(b => b.constraint(target));
|
|
2295
|
-
if (bindings.length) {
|
|
2296
|
-
const request = {
|
|
2297
|
-
injectIdentifier: injectIdentifier,
|
|
2298
|
-
metadata: constructorArgsMetadata,
|
|
2299
|
-
bindings: bindings
|
|
2300
|
-
};
|
|
2301
|
-
arr.push(request);
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
|
-
return arr;
|
|
2507
|
+
getLuminance3() {
|
|
2508
|
+
return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
|
|
2305
2509
|
}
|
|
2306
|
-
|
|
2307
|
-
const
|
|
2308
|
-
|
|
2510
|
+
getLuminanceWCAG() {
|
|
2511
|
+
const RsRGB = this.color.r / 255,
|
|
2512
|
+
GsRGB = this.color.g / 255,
|
|
2513
|
+
BsRGB = this.color.b / 255;
|
|
2514
|
+
let R, G, B;
|
|
2515
|
+
R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
2516
|
+
return .2126 * R + .7152 * G + .0722 * B;
|
|
2309
2517
|
}
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
switch (binding.type) {
|
|
2313
|
-
case BindingTypeEnum.ConstantValue:
|
|
2314
|
-
case BindingTypeEnum.Function:
|
|
2315
|
-
result = binding.cache;
|
|
2316
|
-
break;
|
|
2317
|
-
case BindingTypeEnum.Instance:
|
|
2318
|
-
result = this._resolveInstance(binding, binding.implementationType);
|
|
2319
|
-
break;
|
|
2320
|
-
default:
|
|
2321
|
-
result = binding.dynamicValue({
|
|
2322
|
-
container: this
|
|
2323
|
-
});
|
|
2324
|
-
}
|
|
2325
|
-
return result;
|
|
2518
|
+
clone() {
|
|
2519
|
+
return new Color(this.color.toString());
|
|
2326
2520
|
}
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
return this._createInstance(constr, childRequests);
|
|
2521
|
+
copyGammaToLinear(color) {
|
|
2522
|
+
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2523
|
+
return this.color.r = Math.pow(color.color.r, gammaFactor), this.color.g = Math.pow(color.color.g, gammaFactor), this.color.b = Math.pow(color.color.b, gammaFactor), this;
|
|
2331
2524
|
}
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
return new constr();
|
|
2525
|
+
copyLinearToGamma(color) {
|
|
2526
|
+
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2527
|
+
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
2528
|
+
return this.color.r = Math.pow(color.color.r, safeInverse), this.color.g = Math.pow(color.color.g, safeInverse), this.color.b = Math.pow(color.color.b, safeInverse), this;
|
|
2337
2529
|
}
|
|
2338
|
-
|
|
2339
|
-
return
|
|
2530
|
+
convertGammaToLinear(gammaFactor) {
|
|
2531
|
+
return this.copyGammaToLinear(this, gammaFactor), this;
|
|
2340
2532
|
}
|
|
2341
|
-
|
|
2342
|
-
|
|
2533
|
+
convertLinearToGamma(gammaFactor) {
|
|
2534
|
+
return this.copyLinearToGamma(this, gammaFactor), this;
|
|
2343
2535
|
}
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
const ContributionProvider = Symbol("ContributionProvider");
|
|
2347
|
-
class ContributionProviderCache {
|
|
2348
|
-
constructor(serviceIdentifier, container) {
|
|
2349
|
-
this.serviceIdentifier = serviceIdentifier, this.container = container;
|
|
2536
|
+
copySRGBToLinear(color) {
|
|
2537
|
+
return this.color.r = SRGBToLinear(color.color.r), this.color.g = SRGBToLinear(color.color.g), this.color.b = SRGBToLinear(color.color.b), this;
|
|
2350
2538
|
}
|
|
2351
|
-
|
|
2352
|
-
return this.
|
|
2539
|
+
copyLinearToSRGB(color) {
|
|
2540
|
+
return this.color.r = LinearToSRGB(color.color.r), this.color.g = LinearToSRGB(color.color.g), this.color.b = LinearToSRGB(color.color.b), this;
|
|
2353
2541
|
}
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
bind(ContributionProvider).toDynamicValue(_ref => {
|
|
2357
|
-
let {
|
|
2358
|
-
container: container
|
|
2359
|
-
} = _ref;
|
|
2360
|
-
return new ContributionProviderCache(id, container);
|
|
2361
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
2362
|
-
}
|
|
2363
|
-
|
|
2364
|
-
class Hook {
|
|
2365
|
-
constructor(args, name) {
|
|
2366
|
-
this._args = args, this.name = name, this.taps = [];
|
|
2542
|
+
convertSRGBToLinear() {
|
|
2543
|
+
return this.copySRGBToLinear(this), this;
|
|
2367
2544
|
}
|
|
2368
|
-
|
|
2369
|
-
this.
|
|
2545
|
+
convertLinearToSRGB() {
|
|
2546
|
+
return this.copyLinearToSRGB(this), this;
|
|
2370
2547
|
}
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2548
|
+
}
|
|
2549
|
+
class RGB {
|
|
2550
|
+
constructor(r, g, b, opacity) {
|
|
2551
|
+
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$1(opacity) ? this.opacity = isNaN(+opacity) ? 1 : Math.max(0, Math.min(1, +opacity)) : this.opacity = 1;
|
|
2374
2552
|
}
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
if ("string" == typeof options) _options = {
|
|
2378
|
-
name: options.trim()
|
|
2379
|
-
};else if ("object" != typeof options || null === options) throw new Error("Invalid tap options");
|
|
2380
|
-
if ("string" != typeof _options.name || "" === _options.name) throw new Error("Missing name for tap");
|
|
2381
|
-
return _options = Object.assign({
|
|
2382
|
-
type: type,
|
|
2383
|
-
fn: fn
|
|
2384
|
-
}, _options), _options;
|
|
2553
|
+
formatHex() {
|
|
2554
|
+
return `#${hex(this.r) + hex(this.g) + hex(this.b) + (1 === this.opacity ? "" : hex(255 * this.opacity))}`;
|
|
2385
2555
|
}
|
|
2386
|
-
|
|
2387
|
-
this.
|
|
2556
|
+
formatRgb() {
|
|
2557
|
+
const opacity = this.opacity;
|
|
2558
|
+
return `${1 === opacity ? "rgb(" : "rgba("}${this.r},${this.g},${this.b}${1 === opacity ? ")" : `,${opacity})`}`;
|
|
2388
2559
|
}
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
if (before) {
|
|
2401
|
-
if (before.has(x.name)) {
|
|
2402
|
-
before.delete(x.name);
|
|
2403
|
-
continue;
|
|
2404
|
-
}
|
|
2405
|
-
if (before.size > 0) continue;
|
|
2406
|
-
}
|
|
2407
|
-
if (!(xStage > stage)) {
|
|
2408
|
-
i++;
|
|
2409
|
-
break;
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
this.taps[i] = item;
|
|
2560
|
+
formatHsl() {
|
|
2561
|
+
const opacity = this.opacity,
|
|
2562
|
+
{
|
|
2563
|
+
h: h,
|
|
2564
|
+
s: s,
|
|
2565
|
+
l: l
|
|
2566
|
+
} = rgbToHsl(this.r, this.g, this.b);
|
|
2567
|
+
return `${1 === opacity ? "hsl(" : "hsla("}${h},${s}%,${l}%${1 === opacity ? ")" : `,${opacity})`}`;
|
|
2568
|
+
}
|
|
2569
|
+
toString() {
|
|
2570
|
+
return this.formatHex();
|
|
2413
2571
|
}
|
|
2414
2572
|
}
|
|
2415
2573
|
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2574
|
+
function normalizePadding(padding) {
|
|
2575
|
+
if (isValidNumber$1(padding)) return [padding, padding, padding, padding];
|
|
2576
|
+
if (isArray$1(padding)) {
|
|
2577
|
+
const length = padding.length;
|
|
2578
|
+
if (1 === length) {
|
|
2579
|
+
const paddingValue = padding[0];
|
|
2580
|
+
return [paddingValue, paddingValue, paddingValue, paddingValue];
|
|
2420
2581
|
}
|
|
2421
|
-
|
|
2582
|
+
if (2 === length) {
|
|
2583
|
+
const [vertical, horizontal] = padding;
|
|
2584
|
+
return [vertical, horizontal, vertical, horizontal];
|
|
2585
|
+
}
|
|
2586
|
+
if (3 === length) {
|
|
2587
|
+
const [top, horizontal, bottom] = padding;
|
|
2588
|
+
return [top, horizontal, bottom, horizontal];
|
|
2589
|
+
}
|
|
2590
|
+
if (4 === length) return padding;
|
|
2591
|
+
}
|
|
2592
|
+
if (isObject$1(padding)) {
|
|
2593
|
+
const {
|
|
2594
|
+
top = 0,
|
|
2595
|
+
right = 0,
|
|
2596
|
+
bottom = 0,
|
|
2597
|
+
left = 0
|
|
2598
|
+
} = padding;
|
|
2599
|
+
return [top, right, bottom, left];
|
|
2422
2600
|
}
|
|
2601
|
+
return [0, 0, 0, 0];
|
|
2423
2602
|
}
|
|
2424
2603
|
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2604
|
+
const styleStringToObject = function () {
|
|
2605
|
+
let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2606
|
+
const res = {};
|
|
2607
|
+
return styleStr.split(";").forEach(item => {
|
|
2608
|
+
if (item) {
|
|
2609
|
+
const arr = item.split(":");
|
|
2610
|
+
if (2 === arr.length) {
|
|
2611
|
+
const key = arr[0].trim(),
|
|
2612
|
+
value = arr[1].trim();
|
|
2613
|
+
key && value && (res[key] = value);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
}), res;
|
|
2617
|
+
};
|
|
2618
|
+
const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
2432
2619
|
|
|
2433
2620
|
const circleThreshold = tau - 1e-8;
|
|
2434
2621
|
class BoundsContext {
|
|
@@ -3913,7 +4100,8 @@
|
|
|
3913
4100
|
filter: "",
|
|
3914
4101
|
cursor: null,
|
|
3915
4102
|
html: null,
|
|
3916
|
-
react: null
|
|
4103
|
+
react: null,
|
|
4104
|
+
vue: null
|
|
3917
4105
|
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
|
|
3918
4106
|
const DefaultConnectAttribute = {
|
|
3919
4107
|
connectedType: "none",
|
|
@@ -4021,6 +4209,12 @@
|
|
|
4021
4209
|
cornerRadius: 0,
|
|
4022
4210
|
closePath: !0
|
|
4023
4211
|
});
|
|
4212
|
+
const DefaultStarAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4213
|
+
width: 100,
|
|
4214
|
+
height: 100,
|
|
4215
|
+
spikes: 5,
|
|
4216
|
+
thickness: .5
|
|
4217
|
+
});
|
|
4024
4218
|
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4025
4219
|
width: 0,
|
|
4026
4220
|
height: 0,
|
|
@@ -4346,6 +4540,7 @@
|
|
|
4346
4540
|
function createColor(context, c, params) {
|
|
4347
4541
|
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
4348
4542
|
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
4543
|
+
var _a, _b;
|
|
4349
4544
|
if (!c || !0 === c) return "black";
|
|
4350
4545
|
let result, color;
|
|
4351
4546
|
if (isArray$1(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
@@ -4359,9 +4554,10 @@
|
|
|
4359
4554
|
if (params.attribute) {
|
|
4360
4555
|
const {
|
|
4361
4556
|
scaleX = 1,
|
|
4362
|
-
scaleY = 1
|
|
4557
|
+
scaleY = 1,
|
|
4558
|
+
angle = 0
|
|
4363
4559
|
} = params.attribute;
|
|
4364
|
-
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
|
|
4560
|
+
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = 0, y = 0, w = null !== (_a = params.widthWithoutTransform) && void 0 !== _a ? _a : w, h = null !== (_b = params.heightWithoutTransform) && void 0 !== _b ? _b : h);
|
|
4365
4561
|
}
|
|
4366
4562
|
"linear" === color.gradient ? result = createLinearGradient(context, color, x, y, w, h) : "conical" === color.gradient ? result = createConicGradient(context, color, x, y, w, h) : "radial" === color.gradient && (result = createRadialGradient(context, color, x, y, w, h));
|
|
4367
4563
|
}
|
|
@@ -4461,6 +4657,7 @@
|
|
|
4461
4657
|
ctx.globalAlpha = strokeOpacity * opacity, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.strokeStyle = strokeStyle, setTextStyle(ctx, character);
|
|
4462
4658
|
}
|
|
4463
4659
|
function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter) {
|
|
4660
|
+
if (desc.length <= 1) return 0;
|
|
4464
4661
|
if (!width || width <= 0) return 0;
|
|
4465
4662
|
const textMeasure = application.graphicUtil.textMeasure;
|
|
4466
4663
|
let index = guessIndex,
|
|
@@ -4494,6 +4691,13 @@
|
|
|
4494
4691
|
}
|
|
4495
4692
|
function measureTextCanvas(text, character) {
|
|
4496
4693
|
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
4694
|
+
var _a;
|
|
4695
|
+
if ("" === text) return {
|
|
4696
|
+
ascent: 0,
|
|
4697
|
+
height: 0,
|
|
4698
|
+
descent: 0,
|
|
4699
|
+
width: 0
|
|
4700
|
+
};
|
|
4497
4701
|
const measurement = application.graphicUtil.textMeasure.measureText(text, character),
|
|
4498
4702
|
result = {
|
|
4499
4703
|
ascent: 0,
|
|
@@ -4503,7 +4707,9 @@
|
|
|
4503
4707
|
},
|
|
4504
4708
|
ascent = "actual" === mode ? measurement.actualBoundingBoxAscent : measurement.fontBoundingBoxAscent,
|
|
4505
4709
|
descent = "actual" === mode ? measurement.actualBoundingBoxDescent : measurement.fontBoundingBoxDescent;
|
|
4506
|
-
|
|
4710
|
+
"number" != typeof ascent || "number" != typeof descent ? (result.width = Math.floor(measurement.width), result.height = character.fontSize || 0, result.ascent = result.height, result.descent = 0) : (result.width = Math.floor(measurement.width), result.height = Math.floor(ascent + descent), result.ascent = Math.floor(ascent), result.descent = result.height - result.ascent);
|
|
4711
|
+
const space = null !== (_a = character.space) && void 0 !== _a ? _a : 0;
|
|
4712
|
+
return result.width += space, result;
|
|
4507
4713
|
}
|
|
4508
4714
|
|
|
4509
4715
|
const container = new Container();
|
|
@@ -4575,6 +4781,7 @@
|
|
|
4575
4781
|
text: DefaultTextAttribute,
|
|
4576
4782
|
rect: DefaultRectAttribute,
|
|
4577
4783
|
polygon: DefaultPolygonAttribute,
|
|
4784
|
+
star: DefaultStarAttribute,
|
|
4578
4785
|
richtext: DefaultRichTextAttribute,
|
|
4579
4786
|
richtextIcon: DefaultRichTextIconAttribute,
|
|
4580
4787
|
image: DefaultImageAttribute,
|
|
@@ -4593,6 +4800,7 @@
|
|
|
4593
4800
|
text: Object.assign({}, defaultThemeObj.text),
|
|
4594
4801
|
rect: Object.assign({}, defaultThemeObj.rect),
|
|
4595
4802
|
polygon: Object.assign({}, defaultThemeObj.polygon),
|
|
4803
|
+
star: Object.assign({}, defaultThemeObj.star),
|
|
4596
4804
|
richtext: Object.assign({}, defaultThemeObj.richtext),
|
|
4597
4805
|
richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),
|
|
4598
4806
|
image: Object.assign({}, defaultThemeObj.image),
|
|
@@ -5072,7 +5280,7 @@
|
|
|
5072
5280
|
}
|
|
5073
5281
|
_composedDetailPath(params) {
|
|
5074
5282
|
if (params && params.graphic) {
|
|
5075
|
-
const g =
|
|
5283
|
+
const g = params.graphic;
|
|
5076
5284
|
if (g.stage) {
|
|
5077
5285
|
const path = g.stage.eventSystem.manager.propagationPath(g);
|
|
5078
5286
|
this.detailPath.push(path), this._composedDetailPath(params.params);
|
|
@@ -6731,6 +6939,7 @@
|
|
|
6731
6939
|
const RECT_NUMBER_TYPE = genNumberType();
|
|
6732
6940
|
genNumberType();
|
|
6733
6941
|
const RICHTEXT_NUMBER_TYPE = genNumberType();
|
|
6942
|
+
genNumberType();
|
|
6734
6943
|
const SYMBOL_NUMBER_TYPE = genNumberType();
|
|
6735
6944
|
const TEXT_NUMBER_TYPE = genNumberType();
|
|
6736
6945
|
const GraphicCreator$1 = Symbol.for("GraphicCreator");
|
|
@@ -6984,6 +7193,9 @@
|
|
|
6984
7193
|
y: y
|
|
6985
7194
|
});
|
|
6986
7195
|
}
|
|
7196
|
+
setWidthHeightWithoutTransform(aabbBounds) {
|
|
7197
|
+
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
7198
|
+
}
|
|
6987
7199
|
setAttributes(params) {
|
|
6988
7200
|
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6989
7201
|
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -7272,16 +7484,17 @@
|
|
|
7272
7484
|
const {
|
|
7273
7485
|
scaleX: scaleX,
|
|
7274
7486
|
scaleY: scaleY,
|
|
7275
|
-
angle: angle
|
|
7487
|
+
angle: angle,
|
|
7488
|
+
scaleCenter: scaleCenter
|
|
7276
7489
|
} = this.attribute;
|
|
7277
7490
|
return tempBounds.copy(this._AABBBounds), this.setAttributes({
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
angle: 0
|
|
7491
|
+
angle: 0,
|
|
7492
|
+
scaleCenter: null
|
|
7281
7493
|
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
7282
7494
|
scaleX: scaleX,
|
|
7283
7495
|
scaleY: scaleY,
|
|
7284
|
-
angle: angle
|
|
7496
|
+
angle: angle,
|
|
7497
|
+
scaleCenter: scaleCenter
|
|
7285
7498
|
}), params.b;
|
|
7286
7499
|
};
|
|
7287
7500
|
if ("string" == typeof anchor[0]) {
|
|
@@ -7309,7 +7522,7 @@
|
|
|
7309
7522
|
} = this.attribute;
|
|
7310
7523
|
let _anchor = [0, 0];
|
|
7311
7524
|
const params = {};
|
|
7312
|
-
if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
|
|
7525
|
+
if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
|
|
7313
7526
|
const m = this._transMatrix;
|
|
7314
7527
|
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
7315
7528
|
x: _anchor[0],
|
|
@@ -8302,7 +8515,7 @@
|
|
|
8302
8515
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
8303
8516
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
8304
8517
|
}
|
|
8305
|
-
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
8518
|
+
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
8306
8519
|
}
|
|
8307
8520
|
updateSingallineAABBBounds(text) {
|
|
8308
8521
|
this.updateMultilineAABBBounds([text]);
|
|
@@ -8827,7 +9040,7 @@
|
|
|
8827
9040
|
tb1: tb1,
|
|
8828
9041
|
tb2: tb2
|
|
8829
9042
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
8830
|
-
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
9043
|
+
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
8831
9044
|
const {
|
|
8832
9045
|
lineJoin = symbolTheme.lineJoin
|
|
8833
9046
|
} = attribute;
|
|
@@ -8907,7 +9120,7 @@
|
|
|
8907
9120
|
tb1: tb1,
|
|
8908
9121
|
tb2: tb2
|
|
8909
9122
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
8910
|
-
return updateBoundsOfCommonOuterBorder(attribute, rectTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, this), aabbBounds;
|
|
9123
|
+
return updateBoundsOfCommonOuterBorder(attribute, rectTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, this), aabbBounds;
|
|
8911
9124
|
}
|
|
8912
9125
|
needUpdateTags(keys) {
|
|
8913
9126
|
return super.needUpdateTags(keys, RECT_UPDATE_TAG_KEY);
|
|
@@ -9099,6 +9312,7 @@
|
|
|
9099
9312
|
}
|
|
9100
9313
|
class Paragraph {
|
|
9101
9314
|
constructor(text, newLine, character, ascentDescentMode) {
|
|
9315
|
+
var _a, _b;
|
|
9102
9316
|
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic", this.ascentDescentMode = ascentDescentMode;
|
|
9103
9317
|
const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
9104
9318
|
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
@@ -9111,7 +9325,7 @@
|
|
|
9111
9325
|
let halfDetaHeight = 0,
|
|
9112
9326
|
deltaAscent = 0,
|
|
9113
9327
|
deltaDescent = 0;
|
|
9114
|
-
this.height > height && (halfDetaHeight = (this.height - height) / 2, deltaAscent = Math.ceil(halfDetaHeight), deltaDescent = Math.floor(halfDetaHeight)), "top" === this.textBaseline ? (this.ascent = halfDetaHeight, this.descent = height - halfDetaHeight) : "bottom" === this.textBaseline ? (this.ascent = height - halfDetaHeight, this.descent = halfDetaHeight) : "middle" === this.textBaseline ? (this.ascent = this.height / 2, this.descent = this.height / 2) : (this.ascent = ascent + deltaAscent, this.descent = descent + deltaDescent), this.length = text.length, this.width = width || 0, this.text = text || "", this.newLine = newLine || !1, this.character = character, this.left = 0, this.top = 0, this.ellipsis = "normal", this.ellipsisWidth = 0, this.ellipsisOtherParagraphWidth = 0, "vertical" === character.direction && (this.direction = character.direction, this.widthOrigin = this.width, this.heightOrigin = this.height, this.width = this.heightOrigin, this.height = this.widthOrigin, this.lineHeight = this.height), this.ellipsisStr = "...";
|
|
9328
|
+
this.height > height && (halfDetaHeight = (this.height - height) / 2, deltaAscent = Math.ceil(halfDetaHeight), deltaDescent = Math.floor(halfDetaHeight)), "top" === this.textBaseline ? (this.ascent = halfDetaHeight, this.descent = height - halfDetaHeight) : "bottom" === this.textBaseline ? (this.ascent = height - halfDetaHeight, this.descent = halfDetaHeight) : "middle" === this.textBaseline ? (this.ascent = this.height / 2, this.descent = this.height / 2) : (this.ascent = ascent + deltaAscent, this.descent = descent + deltaDescent), this.length = text.length, this.width = width || 0, this.text = text || "", this.newLine = newLine || !1, this.character = character, this.left = 0, this.top = 0, this.ellipsis = "normal", this.ellipsisWidth = 0, this.ellipsisOtherParagraphWidth = 0, this.space = character.space, this.dx = null !== (_a = character.dx) && void 0 !== _a ? _a : 0, this.dy = null !== (_b = character.dy) && void 0 !== _b ? _b : 0, "vertical" === character.direction && (this.direction = character.direction, this.widthOrigin = this.width, this.heightOrigin = this.height, this.width = this.heightOrigin, this.height = this.widthOrigin, this.lineHeight = this.height), this.ellipsisStr = "...";
|
|
9115
9329
|
}
|
|
9116
9330
|
updateWidth() {
|
|
9117
9331
|
const {
|
|
@@ -9130,11 +9344,11 @@
|
|
|
9130
9344
|
if ("hide" === this.ellipsis) return;
|
|
9131
9345
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
9132
9346
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
9133
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
9347
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
9134
9348
|
const {
|
|
9135
9349
|
width: width
|
|
9136
9350
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
9137
|
-
|
|
9351
|
+
left -= this.ellipsisWidth - width;
|
|
9138
9352
|
}
|
|
9139
9353
|
}
|
|
9140
9354
|
}
|
|
@@ -9145,20 +9359,21 @@
|
|
|
9145
9359
|
});
|
|
9146
9360
|
}
|
|
9147
9361
|
draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
9362
|
+
var _a;
|
|
9148
9363
|
let baseline = top + ascent,
|
|
9149
9364
|
text = this.text,
|
|
9150
|
-
left = this.left + deltaLeft;
|
|
9365
|
+
left = this.left + deltaLeft + (null !== (_a = this.space) && void 0 !== _a ? _a : 0) / 2;
|
|
9151
9366
|
baseline += this.top;
|
|
9152
9367
|
let direction = this.direction;
|
|
9153
9368
|
if (this.verticalEllipsis) text = this.ellipsisStr, direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
9154
9369
|
if ("hide" === this.ellipsis) return;
|
|
9155
9370
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
9156
9371
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
9157
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
9372
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
9158
9373
|
const {
|
|
9159
9374
|
width: width
|
|
9160
9375
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
9161
|
-
|
|
9376
|
+
left -= this.ellipsisWidth - width;
|
|
9162
9377
|
}
|
|
9163
9378
|
}
|
|
9164
9379
|
}
|
|
@@ -9173,7 +9388,7 @@
|
|
|
9173
9388
|
const {
|
|
9174
9389
|
lineWidth = 1
|
|
9175
9390
|
} = this.character;
|
|
9176
|
-
if (this.character.stroke && lineWidth && ctx.strokeText(text, left, baseline), this.character.fill && ctx.fillText(text, left, baseline), this.character.fill) if (this.character.lineThrough || this.character.underline) {
|
|
9391
|
+
if (this.character.stroke && lineWidth && ctx.strokeText(text, left, baseline + this.dy), this.character.fill && ctx.fillText(text, left, baseline + this.dy), this.character.fill) if (this.character.lineThrough || this.character.underline) {
|
|
9177
9392
|
if (this.character.underline) {
|
|
9178
9393
|
const top = 1 + baseline,
|
|
9179
9394
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
@@ -9302,7 +9517,7 @@
|
|
|
9302
9517
|
tb1: tb1,
|
|
9303
9518
|
tb2: tb2
|
|
9304
9519
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
9305
|
-
return updateBoundsOfCommonOuterBorder(attribute, imageTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, this), aabbBounds;
|
|
9520
|
+
return updateBoundsOfCommonOuterBorder(attribute, imageTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, this), aabbBounds;
|
|
9306
9521
|
}
|
|
9307
9522
|
getDefaultAttribute(name) {
|
|
9308
9523
|
return DefaultImageAttribute[name];
|
|
@@ -9645,7 +9860,7 @@
|
|
|
9645
9860
|
maxWidth = richtextTheme.maxWidth,
|
|
9646
9861
|
maxHeight = richtextTheme.maxHeight,
|
|
9647
9862
|
textAlign = richtextTheme.textAlign,
|
|
9648
|
-
|
|
9863
|
+
textBaseline = null !== (_b = null !== (_a = attribute.textBaseline) && void 0 !== _a ? _a : richtextTheme.textBaseline) && void 0 !== _b ? _b : "top",
|
|
9649
9864
|
editOptions: editOptions
|
|
9650
9865
|
} = attribute;
|
|
9651
9866
|
if (width > 0 && height > 0) aabbBounds.set(0, 0, width, height);else {
|
|
@@ -9660,7 +9875,7 @@
|
|
|
9660
9875
|
}
|
|
9661
9876
|
editOptions && editOptions.keepHeightWhileEmpty && !aabbBounds.height() && !(null === (_c = attribute.textConfig) || void 0 === _c ? void 0 : _c.length) && (aabbBounds.y2 = aabbBounds.y1 + (null !== (_d = attribute.fontSize) && void 0 !== _d ? _d : 12), aabbBounds.x2 = aabbBounds.x1 + 2);
|
|
9662
9877
|
let deltaY = 0;
|
|
9663
|
-
switch (
|
|
9878
|
+
switch (textBaseline) {
|
|
9664
9879
|
case "top":
|
|
9665
9880
|
deltaY = 0;
|
|
9666
9881
|
break;
|
|
@@ -9681,7 +9896,7 @@
|
|
|
9681
9896
|
case "right":
|
|
9682
9897
|
deltaX = -aabbBounds.width();
|
|
9683
9898
|
}
|
|
9684
|
-
return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
|
|
9899
|
+
return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
|
|
9685
9900
|
}
|
|
9686
9901
|
needUpdateTags(keys) {
|
|
9687
9902
|
return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);
|
|
@@ -9993,7 +10208,7 @@
|
|
|
9993
10208
|
tb1: tb1,
|
|
9994
10209
|
tb2: tb2
|
|
9995
10210
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
9996
|
-
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
10211
|
+
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.setWidthHeightWithoutTransform(aabbBounds);
|
|
9997
10212
|
const {
|
|
9998
10213
|
lineJoin = arcTheme.lineJoin
|
|
9999
10214
|
} = attribute;
|
|
@@ -13161,7 +13376,7 @@
|
|
|
13161
13376
|
if (!(element && ReactDOM && (ReactDOM.createRoot || ReactDOM.render))) {
|
|
13162
13377
|
return;
|
|
13163
13378
|
}
|
|
13164
|
-
const id = isNil$
|
|
13379
|
+
const id = isNil$3(react.id) ? `${graphic.id ?? graphic._uid}_react` : react.id;
|
|
13165
13380
|
if (this.htmlMap && this.htmlMap[id] && container && container !== this.htmlMap[id].container) {
|
|
13166
13381
|
this.removeElement(id);
|
|
13167
13382
|
}
|
|
@@ -13247,7 +13462,7 @@
|
|
|
13247
13462
|
let top = 0;
|
|
13248
13463
|
const b = graphic.globalAABBBounds;
|
|
13249
13464
|
let anchorType = options.anchorType;
|
|
13250
|
-
if (isNil$
|
|
13465
|
+
if (isNil$3(anchorType)) {
|
|
13251
13466
|
anchorType = graphic.type === 'text' ? 'position' : 'boundsLeftTop';
|
|
13252
13467
|
}
|
|
13253
13468
|
if (anchorType === 'boundsLeftTop') {
|
|
@@ -13259,7 +13474,7 @@
|
|
|
13259
13474
|
top = matrix.f;
|
|
13260
13475
|
}
|
|
13261
13476
|
else {
|
|
13262
|
-
const anchor = calculateAnchorOfBounds(b, anchorType);
|
|
13477
|
+
const anchor = calculateAnchorOfBounds$1(b, anchorType);
|
|
13263
13478
|
left = anchor.x;
|
|
13264
13479
|
top = anchor.y;
|
|
13265
13480
|
}
|
|
@@ -13275,17 +13490,17 @@
|
|
|
13275
13490
|
...this.getTransformOfText(graphic)
|
|
13276
13491
|
};
|
|
13277
13492
|
}
|
|
13278
|
-
if (isFunction$
|
|
13493
|
+
if (isFunction$3(options.style)) {
|
|
13279
13494
|
const userStyle = options.style({ top: offsetTop, left: offsetX, width: b.width(), height: b.height() }, graphic, wrapContainer);
|
|
13280
13495
|
if (userStyle) {
|
|
13281
13496
|
calculateStyle = { ...calculateStyle, ...userStyle };
|
|
13282
13497
|
}
|
|
13283
13498
|
}
|
|
13284
|
-
else if (isObject$
|
|
13499
|
+
else if (isObject$3(options.style)) {
|
|
13285
13500
|
calculateStyle = { ...calculateStyle, ...options.style };
|
|
13286
13501
|
}
|
|
13287
|
-
else if (isString$
|
|
13288
|
-
calculateStyle = { ...calculateStyle, ...styleStringToObject(options.style) };
|
|
13502
|
+
else if (isString$3(options.style) && options.style) {
|
|
13503
|
+
calculateStyle = { ...calculateStyle, ...styleStringToObject$1(options.style) };
|
|
13289
13504
|
}
|
|
13290
13505
|
application.global.updateDom(wrapContainer, {
|
|
13291
13506
|
width: options.width,
|
|
@@ -13385,7 +13600,7 @@
|
|
|
13385
13600
|
}
|
|
13386
13601
|
const { width, height, style } = params;
|
|
13387
13602
|
if (style) {
|
|
13388
|
-
if (isString$
|
|
13603
|
+
if (isString$3(style)) {
|
|
13389
13604
|
dom.setAttribute('style', style);
|
|
13390
13605
|
}
|
|
13391
13606
|
else {
|
|
@@ -13427,7 +13642,7 @@
|
|
|
13427
13642
|
toArray(props.children).map((child, index) => {
|
|
13428
13643
|
const parseOption = child && child.type && child.type.parseOption;
|
|
13429
13644
|
if (parseOption && child.props) {
|
|
13430
|
-
const childProps = isNil$
|
|
13645
|
+
const childProps = isNil$3(child.props.componentId)
|
|
13431
13646
|
? {
|
|
13432
13647
|
...child.props,
|
|
13433
13648
|
componentId: getComponentId(child, index)
|
|
@@ -19332,7 +19547,7 @@
|
|
|
19332
19547
|
return graphic;
|
|
19333
19548
|
}
|
|
19334
19549
|
function isEventProp(key, props) {
|
|
19335
|
-
return key.startsWith('on') && isFunction$
|
|
19550
|
+
return key.startsWith('on') && isFunction$3(props[key]);
|
|
19336
19551
|
}
|
|
19337
19552
|
function bindEventsToGraphic(graphic, props) {
|
|
19338
19553
|
for (const key in props) {
|
|
@@ -19352,7 +19567,7 @@
|
|
|
19352
19567
|
graphic.addEventListener(REACT_TO_CANOPUS_EVENTS[propKey], newProps[propKey]);
|
|
19353
19568
|
}
|
|
19354
19569
|
}
|
|
19355
|
-
const attribute = newProps.attribute ?? merge({}, newProps);
|
|
19570
|
+
const attribute = newProps.attribute ?? merge$1({}, newProps);
|
|
19356
19571
|
graphic.initAttributes(attribute);
|
|
19357
19572
|
if (graphic.type === 'image') {
|
|
19358
19573
|
graphic.loadImage(attribute.image);
|
|
@@ -19360,8 +19575,8 @@
|
|
|
19360
19575
|
if (attribute.display === 'flex' &&
|
|
19361
19576
|
attribute.width === undefined &&
|
|
19362
19577
|
attribute.height === undefined &&
|
|
19363
|
-
isNumber$
|
|
19364
|
-
isNumber$
|
|
19578
|
+
isNumber$3(oldProps.attribute.width) &&
|
|
19579
|
+
isNumber$3(oldProps.attribute.height)) {
|
|
19365
19580
|
const plugin = graphic.stage.pluginService.findPluginsByName('FlexLayoutPlugin')[0];
|
|
19366
19581
|
if (plugin) {
|
|
19367
19582
|
plugin.tryLayoutChildren(graphic);
|
|
@@ -19624,7 +19839,7 @@
|
|
|
19624
19839
|
styleTop = cellRect.top + dealWidthNumber(dy, cellRect.height) + cellRect.height + 'px';
|
|
19625
19840
|
}
|
|
19626
19841
|
}
|
|
19627
|
-
const componentStyle = merge({}, style, {
|
|
19842
|
+
const componentStyle = merge$1({}, style, {
|
|
19628
19843
|
position: 'absolute',
|
|
19629
19844
|
zIndex: 1000,
|
|
19630
19845
|
width: styleWidth,
|
|
@@ -19644,7 +19859,7 @@
|
|
|
19644
19859
|
return { ...defaultProps };
|
|
19645
19860
|
}, [defaultProps]);
|
|
19646
19861
|
const props = React.useMemo(() => {
|
|
19647
|
-
const mProps = merge({}, componentProps);
|
|
19862
|
+
const mProps = merge$1({}, componentProps);
|
|
19648
19863
|
for (const propName in _defaultProps) {
|
|
19649
19864
|
if (mProps[propName] === undefined) {
|
|
19650
19865
|
mProps[propName] = _defaultProps[propName];
|
|
@@ -19655,7 +19870,7 @@
|
|
|
19655
19870
|
return props;
|
|
19656
19871
|
}
|
|
19657
19872
|
function dealWidthNumber(value, refenceValue) {
|
|
19658
|
-
if (isNumber$
|
|
19873
|
+
if (isNumber$3(value)) {
|
|
19659
19874
|
return value;
|
|
19660
19875
|
}
|
|
19661
19876
|
if (typeof value === 'string' && value.endsWith('%')) {
|
|
@@ -19703,7 +19918,7 @@
|
|
|
19703
19918
|
}
|
|
19704
19919
|
};
|
|
19705
19920
|
function ButtonComponent(baseProps, ref) {
|
|
19706
|
-
const props = merge({}, defaultProps$6, baseProps);
|
|
19921
|
+
const props = merge$1({}, defaultProps$6, baseProps);
|
|
19707
19922
|
const { disabled, onClick } = props;
|
|
19708
19923
|
let buttonRef = React.useRef(null);
|
|
19709
19924
|
buttonRef = ref ? ref : buttonRef;
|
|
@@ -19798,7 +20013,7 @@
|
|
|
19798
20013
|
}
|
|
19799
20014
|
};
|
|
19800
20015
|
function LinkComponent(baseProps, ref) {
|
|
19801
|
-
const props = merge({}, defaultProps$5, baseProps);
|
|
20016
|
+
const props = merge$1({}, defaultProps$5, baseProps);
|
|
19802
20017
|
const { disabled, href, onClick } = props;
|
|
19803
20018
|
let linkRef = React.useRef(null);
|
|
19804
20019
|
linkRef = ref ? ref : linkRef;
|
|
@@ -19891,7 +20106,7 @@
|
|
|
19891
20106
|
autoFixFontSize: true
|
|
19892
20107
|
};
|
|
19893
20108
|
function AvatarComponent(baseProps, ref) {
|
|
19894
|
-
const props = merge({}, defaultProps$4, baseProps);
|
|
20109
|
+
const props = merge$1({}, defaultProps$4, baseProps);
|
|
19895
20110
|
const { size, children, onClick } = props;
|
|
19896
20111
|
let avatarRef = React.useRef(null);
|
|
19897
20112
|
avatarRef = ref ? ref : avatarRef;
|
|
@@ -19899,7 +20114,7 @@
|
|
|
19899
20114
|
onClick && onClick(event);
|
|
19900
20115
|
}, [onClick]);
|
|
19901
20116
|
const groupAttribute = getGroupAttribute(props);
|
|
19902
|
-
if (isString$
|
|
20117
|
+
if (isString$3(children)) {
|
|
19903
20118
|
const textAttribute = getTextAttribute(props);
|
|
19904
20119
|
return (React.createElement(Group, { ref: avatarRef, attribute: groupAttribute, onClick: handleClick },
|
|
19905
20120
|
React.createElement(Text, { attribute: textAttribute })));
|
|
@@ -19977,11 +20192,11 @@
|
|
|
19977
20192
|
...props.arrowStyle
|
|
19978
20193
|
};
|
|
19979
20194
|
return props.visible ? (React.createElement(React.Fragment, null,
|
|
19980
|
-
React.createElement("div", { style: merge({}, defaultPoptipPanelStyle, props.panelStyle) }, props.content),
|
|
20195
|
+
React.createElement("div", { style: merge$1({}, defaultPoptipPanelStyle, props.panelStyle) }, props.content),
|
|
19981
20196
|
React.createElement("div", { style: arrowStyle }))) : (React.createElement(React.Fragment, null));
|
|
19982
20197
|
};
|
|
19983
20198
|
function PopoverComponent(baseProps, ref) {
|
|
19984
|
-
const props = merge({}, defaultProps$3, baseProps);
|
|
20199
|
+
const props = merge$1({}, defaultProps$3, baseProps);
|
|
19985
20200
|
const { content, position, popupVisible, defaultPopupVisible, panelStyle, arrowStyle, children } = props;
|
|
19986
20201
|
let popoverRef = React.useRef(null);
|
|
19987
20202
|
popoverRef = ref ? ref : popoverRef;
|
|
@@ -20013,14 +20228,14 @@
|
|
|
20013
20228
|
}
|
|
20014
20229
|
};
|
|
20015
20230
|
const groupMouseEnter = React.useCallback((event) => {
|
|
20016
|
-
if (isValid$
|
|
20231
|
+
if (isValid$3(popupVisible)) {
|
|
20017
20232
|
return;
|
|
20018
20233
|
}
|
|
20019
20234
|
setPopupOpen(true);
|
|
20020
20235
|
event.currentTarget.stage.renderNextFrame();
|
|
20021
20236
|
}, []);
|
|
20022
20237
|
const groupMouseLeave = React.useCallback((event) => {
|
|
20023
|
-
if (isValid$
|
|
20238
|
+
if (isValid$3(popupVisible)) {
|
|
20024
20239
|
return;
|
|
20025
20240
|
}
|
|
20026
20241
|
setPopupOpen(false);
|
|
@@ -20197,7 +20412,7 @@
|
|
|
20197
20412
|
}
|
|
20198
20413
|
};
|
|
20199
20414
|
function TagComponent(baseProps, ref) {
|
|
20200
|
-
const props = merge({}, defaultProps$2, baseProps);
|
|
20415
|
+
const props = merge$1({}, defaultProps$2, baseProps);
|
|
20201
20416
|
const { attribute, panelStyle, children, ...rest } = props;
|
|
20202
20417
|
let tagRef = React.useRef(null);
|
|
20203
20418
|
tagRef = ref ? ref : tagRef;
|
|
@@ -20214,7 +20429,7 @@
|
|
|
20214
20429
|
|
|
20215
20430
|
const defaultProps$1 = {};
|
|
20216
20431
|
function RadioComponent(baseProps, ref) {
|
|
20217
|
-
const props = merge({}, defaultProps$1, baseProps);
|
|
20432
|
+
const props = merge$1({}, defaultProps$1, baseProps);
|
|
20218
20433
|
const { textStyle, circleStyle, children, ...rest } = props;
|
|
20219
20434
|
let radioRef = React.useRef(null);
|
|
20220
20435
|
radioRef = ref ? ref : radioRef;
|
|
@@ -20243,7 +20458,7 @@
|
|
|
20243
20458
|
|
|
20244
20459
|
const defaultProps = {};
|
|
20245
20460
|
function CheckboxComponent(baseProps, ref) {
|
|
20246
|
-
const props = merge({}, defaultProps, baseProps);
|
|
20461
|
+
const props = merge$1({}, defaultProps, baseProps);
|
|
20247
20462
|
const { textStyle, boxStyle, iconStyle, children, ...rest } = props;
|
|
20248
20463
|
let checkboxRef = React.useRef(null);
|
|
20249
20464
|
checkboxRef = ref ? ref : checkboxRef;
|
|
@@ -20269,7 +20484,7 @@
|
|
|
20269
20484
|
const Checkbox = React.forwardRef(CheckboxComponent);
|
|
20270
20485
|
Checkbox.displayName = 'Checkbox';
|
|
20271
20486
|
|
|
20272
|
-
const version = "1.17.7
|
|
20487
|
+
const version = "1.17.7";
|
|
20273
20488
|
|
|
20274
20489
|
Object.defineProperty(exports, 'register', {
|
|
20275
20490
|
enumerable: true,
|