@visactor/react-vtable 1.8.1 → 1.8.3-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/react-vtable.js +2122 -1781
- package/dist/react-vtable.min.js +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/react-vtable.js
CHANGED
|
@@ -714,104 +714,64 @@
|
|
|
714
714
|
var eventemitter3Exports = eventemitter3.exports;
|
|
715
715
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
716
716
|
|
|
717
|
-
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
718
|
-
var isType$
|
|
719
|
-
|
|
720
|
-
const isBoolean = function (value) {
|
|
721
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
722
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
723
|
-
};
|
|
724
|
-
var isBoolean$1 = isBoolean;
|
|
717
|
+
const isType$2 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
718
|
+
var isType$3 = isType$2;
|
|
725
719
|
|
|
726
|
-
const isFunction = value => "function" == typeof value;
|
|
727
|
-
var isFunction$
|
|
720
|
+
const isFunction$2 = value => "function" == typeof value;
|
|
721
|
+
var isFunction$3 = isFunction$2;
|
|
728
722
|
|
|
729
|
-
const isNil = value => null == value;
|
|
730
|
-
var isNil$
|
|
723
|
+
const isNil$2 = value => null == value;
|
|
724
|
+
var isNil$3 = isNil$2;
|
|
731
725
|
|
|
732
|
-
const isValid = value => null != value;
|
|
733
|
-
var isValid$
|
|
726
|
+
const isValid$2 = value => null != value;
|
|
727
|
+
var isValid$3 = isValid$2;
|
|
734
728
|
|
|
735
|
-
const isObject = value => {
|
|
729
|
+
const isObject$2 = value => {
|
|
736
730
|
const type = typeof value;
|
|
737
731
|
return null !== value && "object" === type || "function" === type;
|
|
738
732
|
};
|
|
739
|
-
var isObject$
|
|
733
|
+
var isObject$3 = isObject$2;
|
|
740
734
|
|
|
741
|
-
const isObjectLike = value => "object" == typeof value && null !== value;
|
|
742
|
-
var isObjectLike$
|
|
735
|
+
const isObjectLike$2 = value => "object" == typeof value && null !== value;
|
|
736
|
+
var isObjectLike$3 = isObjectLike$2;
|
|
743
737
|
|
|
744
|
-
const isPlainObject = function (value) {
|
|
745
|
-
if (!isObjectLike$
|
|
738
|
+
const isPlainObject$2 = function (value) {
|
|
739
|
+
if (!isObjectLike$3(value) || !isType$3(value, "Object")) return !1;
|
|
746
740
|
if (null === Object.getPrototypeOf(value)) return !0;
|
|
747
741
|
let proto = value;
|
|
748
742
|
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
749
743
|
return Object.getPrototypeOf(value) === proto;
|
|
750
744
|
};
|
|
751
|
-
var isPlainObject$
|
|
745
|
+
var isPlainObject$3 = isPlainObject$2;
|
|
752
746
|
|
|
753
|
-
const isString = function (value) {
|
|
747
|
+
const isString$2 = function (value) {
|
|
754
748
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
755
749
|
const type = typeof value;
|
|
756
|
-
return fuzzy ? "string" === type : "string" === type || isType$
|
|
750
|
+
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
757
751
|
};
|
|
758
|
-
var isString$
|
|
752
|
+
var isString$3 = isString$2;
|
|
759
753
|
|
|
760
|
-
const isArray = value => Array.isArray ? Array.isArray(value) : isType$
|
|
761
|
-
var isArray$
|
|
754
|
+
const isArray$2 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
755
|
+
var isArray$3 = isArray$2;
|
|
762
756
|
|
|
763
|
-
const isArrayLike = function (value) {
|
|
757
|
+
const isArrayLike$2 = function (value) {
|
|
764
758
|
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
765
759
|
};
|
|
766
|
-
var isArrayLike$
|
|
760
|
+
var isArrayLike$3 = isArrayLike$2;
|
|
767
761
|
|
|
768
|
-
const isNumber = function (value) {
|
|
762
|
+
const isNumber$2 = function (value) {
|
|
769
763
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
770
764
|
const type = typeof value;
|
|
771
|
-
return fuzzy ? "number" === type : "number" === type || isType$
|
|
765
|
+
return fuzzy ? "number" === type : "number" === type || isType$3(value, "Number");
|
|
772
766
|
};
|
|
773
|
-
var isNumber$
|
|
774
|
-
|
|
775
|
-
const isValidNumber = value => isNumber$1(value) && Number.isFinite(value);
|
|
776
|
-
var isValidNumber$1 = isValidNumber;
|
|
777
|
-
|
|
778
|
-
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
779
|
-
var isValidUrl$1 = isValidUrl;
|
|
780
|
-
|
|
781
|
-
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);
|
|
782
|
-
var isBase64$1 = isBase64;
|
|
783
|
-
|
|
784
|
-
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
785
|
-
var getType$1 = getType;
|
|
786
|
-
|
|
787
|
-
const objectProto = Object.prototype,
|
|
788
|
-
isPrototype = function (value) {
|
|
789
|
-
const Ctor = value && value.constructor;
|
|
790
|
-
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
|
|
791
|
-
};
|
|
792
|
-
var isPrototype$1 = isPrototype;
|
|
793
|
-
|
|
794
|
-
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
795
|
-
function isEmpty(value) {
|
|
796
|
-
if (isNil$1(value)) return !0;
|
|
797
|
-
if (isArrayLike$1(value)) return !value.length;
|
|
798
|
-
const type = getType$1(value);
|
|
799
|
-
if ("Map" === type || "Set" === type) return !value.size;
|
|
800
|
-
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
801
|
-
for (const key in value) if (hasOwnProperty$1.call(value, key)) return !1;
|
|
802
|
-
return !0;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
806
|
-
has = (object, key) => null != object && hasOwnProperty.call(object, key);
|
|
807
|
-
var has$1 = has;
|
|
767
|
+
var isNumber$3 = isNumber$2;
|
|
808
768
|
|
|
809
|
-
function baseMerge(target, source) {
|
|
769
|
+
function baseMerge$1(target, source) {
|
|
810
770
|
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
811
771
|
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
812
772
|
if (source) {
|
|
813
773
|
if (target === source) return;
|
|
814
|
-
if (isValid$
|
|
774
|
+
if (isValid$3(source) && "object" == typeof source) {
|
|
815
775
|
const iterable = Object(source),
|
|
816
776
|
props = [];
|
|
817
777
|
for (const key in iterable) props.push(key);
|
|
@@ -821,51 +781,51 @@
|
|
|
821
781
|
propIndex = -1;
|
|
822
782
|
for (; length--;) {
|
|
823
783
|
const key = props[++propIndex];
|
|
824
|
-
!isValid$
|
|
784
|
+
!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);
|
|
825
785
|
}
|
|
826
786
|
}
|
|
827
787
|
}
|
|
828
788
|
}
|
|
829
|
-
function baseMergeDeep(target, source, key) {
|
|
789
|
+
function baseMergeDeep$1(target, source, key) {
|
|
830
790
|
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
831
791
|
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
832
792
|
const objValue = target[key],
|
|
833
793
|
srcValue = source[key];
|
|
834
794
|
let newValue = source[key],
|
|
835
795
|
isCommon = !0;
|
|
836
|
-
if (isArray$
|
|
837
|
-
if (shallowArray) newValue = [];else if (isArray$
|
|
796
|
+
if (isArray$3(srcValue)) {
|
|
797
|
+
if (shallowArray) newValue = [];else if (isArray$3(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
838
798
|
newValue = new Array(objValue.length);
|
|
839
799
|
let index = -1;
|
|
840
800
|
const length = objValue.length;
|
|
841
801
|
for (; ++index < length;) newValue[index] = objValue[index];
|
|
842
802
|
}
|
|
843
|
-
} else isPlainObject$
|
|
844
|
-
isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
|
|
803
|
+
} else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
804
|
+
isCommon && baseMerge$1(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue$1(target, key, newValue);
|
|
845
805
|
}
|
|
846
|
-
function assignMergeValue(target, key, value) {
|
|
847
|
-
(void 0 !== value && !eq(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
806
|
+
function assignMergeValue$1(target, key, value) {
|
|
807
|
+
(void 0 !== value && !eq$1(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
848
808
|
}
|
|
849
|
-
function eq(value, other) {
|
|
809
|
+
function eq$1(value, other) {
|
|
850
810
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
851
811
|
}
|
|
852
|
-
function merge(target) {
|
|
812
|
+
function merge$1(target) {
|
|
853
813
|
let sourceIndex = -1;
|
|
854
814
|
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
855
815
|
for (; ++sourceIndex < length;) {
|
|
856
|
-
baseMerge(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
816
|
+
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
857
817
|
}
|
|
858
818
|
return target;
|
|
859
819
|
}
|
|
860
820
|
|
|
861
821
|
function pickWithout(obj, keys) {
|
|
862
|
-
if (!obj || !isPlainObject$
|
|
822
|
+
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
863
823
|
const result = {};
|
|
864
824
|
return Object.keys(obj).forEach(k => {
|
|
865
825
|
const v = obj[k];
|
|
866
826
|
let match = !1;
|
|
867
827
|
keys.forEach(itKey => {
|
|
868
|
-
(isString$
|
|
828
|
+
(isString$3(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
869
829
|
}), match || (result[k] = v);
|
|
870
830
|
}), result;
|
|
871
831
|
}
|
|
@@ -882,14 +842,14 @@
|
|
|
882
842
|
if (null == a || null == b) return !1;
|
|
883
843
|
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
884
844
|
if (objToString(a) !== objToString(b)) return !1;
|
|
885
|
-
if (isFunction$
|
|
845
|
+
if (isFunction$3(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
886
846
|
if ("object" != typeof a) return !1;
|
|
887
|
-
if (isArray$
|
|
847
|
+
if (isArray$3(a)) {
|
|
888
848
|
if (a.length !== b.length) return !1;
|
|
889
849
|
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
890
850
|
return !0;
|
|
891
851
|
}
|
|
892
|
-
if (!isPlainObject$
|
|
852
|
+
if (!isPlainObject$3(a)) return !1;
|
|
893
853
|
const ka = objectKeys(a),
|
|
894
854
|
kb = objectKeys(b);
|
|
895
855
|
if (ka.length !== kb.length) return !1;
|
|
@@ -902,872 +862,1258 @@
|
|
|
902
862
|
return !0;
|
|
903
863
|
}
|
|
904
864
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
callErrorHandler() {
|
|
947
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
948
|
-
args[_key] = arguments[_key];
|
|
949
|
-
}
|
|
950
|
-
this._onErrorHandler.forEach(h => h(...args));
|
|
951
|
-
}
|
|
952
|
-
canLogInfo() {
|
|
953
|
-
return this._level >= LoggerLevel.Info;
|
|
954
|
-
}
|
|
955
|
-
canLogDebug() {
|
|
956
|
-
return this._level >= LoggerLevel.Debug;
|
|
957
|
-
}
|
|
958
|
-
canLogError() {
|
|
959
|
-
return this._level >= LoggerLevel.Error;
|
|
960
|
-
}
|
|
961
|
-
canLogWarn() {
|
|
962
|
-
return this._level >= LoggerLevel.Warn;
|
|
963
|
-
}
|
|
964
|
-
level(levelValue) {
|
|
965
|
-
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
966
|
-
}
|
|
967
|
-
error() {
|
|
968
|
-
var _a;
|
|
969
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
970
|
-
args[_key2] = arguments[_key2];
|
|
971
|
-
}
|
|
972
|
-
return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler(...args) : log(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
|
|
973
|
-
}
|
|
974
|
-
warn() {
|
|
975
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
976
|
-
args[_key3] = arguments[_key3];
|
|
977
|
-
}
|
|
978
|
-
return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
|
|
979
|
-
}
|
|
980
|
-
info() {
|
|
981
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
982
|
-
args[_key4] = arguments[_key4];
|
|
983
|
-
}
|
|
984
|
-
return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
|
|
985
|
-
}
|
|
986
|
-
debug() {
|
|
987
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
988
|
-
args[_key5] = arguments[_key5];
|
|
989
|
-
}
|
|
990
|
-
return this._level >= LoggerLevel.Debug && log(this._method || "log", "DEBUG", args), this;
|
|
865
|
+
const calculateAnchorOfBounds$1 = (bounds, anchorType) => {
|
|
866
|
+
const {
|
|
867
|
+
x1: x1,
|
|
868
|
+
x2: x2,
|
|
869
|
+
y1: y1,
|
|
870
|
+
y2: y2
|
|
871
|
+
} = bounds,
|
|
872
|
+
rectWidth = Math.abs(x2 - x1),
|
|
873
|
+
rectHeight = Math.abs(y2 - y1);
|
|
874
|
+
let anchorX = (x1 + x2) / 2,
|
|
875
|
+
anchorY = (y1 + y2) / 2,
|
|
876
|
+
sx = 0,
|
|
877
|
+
sy = 0;
|
|
878
|
+
switch (anchorType) {
|
|
879
|
+
case "top":
|
|
880
|
+
case "inside-top":
|
|
881
|
+
sy = -.5;
|
|
882
|
+
break;
|
|
883
|
+
case "bottom":
|
|
884
|
+
case "inside-bottom":
|
|
885
|
+
sy = .5;
|
|
886
|
+
break;
|
|
887
|
+
case "left":
|
|
888
|
+
case "inside-left":
|
|
889
|
+
sx = -.5;
|
|
890
|
+
break;
|
|
891
|
+
case "right":
|
|
892
|
+
case "inside-right":
|
|
893
|
+
sx = .5;
|
|
894
|
+
break;
|
|
895
|
+
case "top-right":
|
|
896
|
+
sx = .5, sy = -.5;
|
|
897
|
+
break;
|
|
898
|
+
case "top-left":
|
|
899
|
+
sx = -.5, sy = -.5;
|
|
900
|
+
break;
|
|
901
|
+
case "bottom-right":
|
|
902
|
+
sx = .5, sy = .5;
|
|
903
|
+
break;
|
|
904
|
+
case "bottom-left":
|
|
905
|
+
sx = -.5, sy = .5;
|
|
991
906
|
}
|
|
992
|
-
|
|
993
|
-
|
|
907
|
+
return anchorX += sx * rectWidth, anchorY += sy * rectHeight, {
|
|
908
|
+
x: anchorX,
|
|
909
|
+
y: anchorY
|
|
910
|
+
};
|
|
911
|
+
};
|
|
994
912
|
|
|
995
|
-
const
|
|
996
|
-
|
|
913
|
+
const styleStringToObject$1 = function () {
|
|
914
|
+
let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
915
|
+
const res = {};
|
|
916
|
+
return styleStr.split(";").forEach(item => {
|
|
917
|
+
if (item) {
|
|
918
|
+
const arr = item.split(":");
|
|
919
|
+
if (2 === arr.length) {
|
|
920
|
+
const key = arr[0].trim(),
|
|
921
|
+
value = arr[1].trim();
|
|
922
|
+
key && value && (res[key] = value);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}), res;
|
|
997
926
|
};
|
|
998
|
-
var clamp$1 = clamp;
|
|
999
927
|
|
|
1000
|
-
|
|
1001
|
-
const pi = Math.PI;
|
|
1002
|
-
const halfPi$1 = pi / 2;
|
|
1003
|
-
const tau = 2 * pi;
|
|
1004
|
-
const pi2 = 2 * Math.PI;
|
|
1005
|
-
const abs = Math.abs;
|
|
1006
|
-
const atan2 = Math.atan2;
|
|
1007
|
-
const cos = Math.cos;
|
|
1008
|
-
const max = Math.max;
|
|
1009
|
-
const min = Math.min;
|
|
1010
|
-
const sin = Math.sin;
|
|
1011
|
-
const sqrt = Math.sqrt;
|
|
1012
|
-
const pow = Math.pow;
|
|
1013
|
-
function asin(x) {
|
|
1014
|
-
return x >= 1 ? halfPi$1 : x <= -1 ? -halfPi$1 : Math.asin(x);
|
|
1015
|
-
}
|
|
928
|
+
var reactIs = {exports: {}};
|
|
1016
929
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
930
|
+
var reactIs_production_min = {};
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* @license React
|
|
934
|
+
* react-is.production.min.js
|
|
935
|
+
*
|
|
936
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
937
|
+
*
|
|
938
|
+
* This source code is licensed under the MIT license found in the
|
|
939
|
+
* LICENSE file in the root directory of this source tree.
|
|
940
|
+
*/
|
|
941
|
+
var hasRequiredReactIs_production_min;
|
|
942
|
+
function requireReactIs_production_min() {
|
|
943
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
944
|
+
hasRequiredReactIs_production_min = 1;
|
|
945
|
+
var b = Symbol.for("react.element"),
|
|
946
|
+
c = Symbol.for("react.portal"),
|
|
947
|
+
d = Symbol.for("react.fragment"),
|
|
948
|
+
e = Symbol.for("react.strict_mode"),
|
|
949
|
+
f = Symbol.for("react.profiler"),
|
|
950
|
+
g = Symbol.for("react.provider"),
|
|
951
|
+
h = Symbol.for("react.context"),
|
|
952
|
+
k = Symbol.for("react.server_context"),
|
|
953
|
+
l = Symbol.for("react.forward_ref"),
|
|
954
|
+
m = Symbol.for("react.suspense"),
|
|
955
|
+
n = Symbol.for("react.suspense_list"),
|
|
956
|
+
p = Symbol.for("react.memo"),
|
|
957
|
+
q = Symbol.for("react.lazy"),
|
|
958
|
+
t = Symbol.for("react.offscreen"),
|
|
959
|
+
u;
|
|
960
|
+
u = Symbol.for("react.module.reference");
|
|
961
|
+
function v(a) {
|
|
962
|
+
if ("object" === typeof a && null !== a) {
|
|
963
|
+
var r = a.$$typeof;
|
|
964
|
+
switch (r) {
|
|
965
|
+
case b:
|
|
966
|
+
switch (a = a.type, a) {
|
|
967
|
+
case d:
|
|
968
|
+
case f:
|
|
969
|
+
case e:
|
|
970
|
+
case m:
|
|
971
|
+
case n:
|
|
972
|
+
return a;
|
|
973
|
+
default:
|
|
974
|
+
switch (a = a && a.$$typeof, a) {
|
|
975
|
+
case k:
|
|
976
|
+
case h:
|
|
977
|
+
case l:
|
|
978
|
+
case q:
|
|
979
|
+
case p:
|
|
980
|
+
case g:
|
|
981
|
+
return a;
|
|
982
|
+
default:
|
|
983
|
+
return r;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
case c:
|
|
987
|
+
return r;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
1059
990
|
}
|
|
991
|
+
reactIs_production_min.ContextConsumer = h;
|
|
992
|
+
reactIs_production_min.ContextProvider = g;
|
|
993
|
+
reactIs_production_min.Element = b;
|
|
994
|
+
reactIs_production_min.ForwardRef = l;
|
|
995
|
+
reactIs_production_min.Fragment = d;
|
|
996
|
+
reactIs_production_min.Lazy = q;
|
|
997
|
+
reactIs_production_min.Memo = p;
|
|
998
|
+
reactIs_production_min.Portal = c;
|
|
999
|
+
reactIs_production_min.Profiler = f;
|
|
1000
|
+
reactIs_production_min.StrictMode = e;
|
|
1001
|
+
reactIs_production_min.Suspense = m;
|
|
1002
|
+
reactIs_production_min.SuspenseList = n;
|
|
1003
|
+
reactIs_production_min.isAsyncMode = function () {
|
|
1004
|
+
return !1;
|
|
1005
|
+
};
|
|
1006
|
+
reactIs_production_min.isConcurrentMode = function () {
|
|
1007
|
+
return !1;
|
|
1008
|
+
};
|
|
1009
|
+
reactIs_production_min.isContextConsumer = function (a) {
|
|
1010
|
+
return v(a) === h;
|
|
1011
|
+
};
|
|
1012
|
+
reactIs_production_min.isContextProvider = function (a) {
|
|
1013
|
+
return v(a) === g;
|
|
1014
|
+
};
|
|
1015
|
+
reactIs_production_min.isElement = function (a) {
|
|
1016
|
+
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
1017
|
+
};
|
|
1018
|
+
reactIs_production_min.isForwardRef = function (a) {
|
|
1019
|
+
return v(a) === l;
|
|
1020
|
+
};
|
|
1021
|
+
reactIs_production_min.isFragment = function (a) {
|
|
1022
|
+
return v(a) === d;
|
|
1023
|
+
};
|
|
1024
|
+
reactIs_production_min.isLazy = function (a) {
|
|
1025
|
+
return v(a) === q;
|
|
1026
|
+
};
|
|
1027
|
+
reactIs_production_min.isMemo = function (a) {
|
|
1028
|
+
return v(a) === p;
|
|
1029
|
+
};
|
|
1030
|
+
reactIs_production_min.isPortal = function (a) {
|
|
1031
|
+
return v(a) === c;
|
|
1032
|
+
};
|
|
1033
|
+
reactIs_production_min.isProfiler = function (a) {
|
|
1034
|
+
return v(a) === f;
|
|
1035
|
+
};
|
|
1036
|
+
reactIs_production_min.isStrictMode = function (a) {
|
|
1037
|
+
return v(a) === e;
|
|
1038
|
+
};
|
|
1039
|
+
reactIs_production_min.isSuspense = function (a) {
|
|
1040
|
+
return v(a) === m;
|
|
1041
|
+
};
|
|
1042
|
+
reactIs_production_min.isSuspenseList = function (a) {
|
|
1043
|
+
return v(a) === n;
|
|
1044
|
+
};
|
|
1045
|
+
reactIs_production_min.isValidElementType = function (a) {
|
|
1046
|
+
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;
|
|
1047
|
+
};
|
|
1048
|
+
reactIs_production_min.typeOf = v;
|
|
1049
|
+
return reactIs_production_min;
|
|
1060
1050
|
}
|
|
1061
1051
|
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
x1: x1,
|
|
1065
|
-
y1: y1,
|
|
1066
|
-
x2: x2,
|
|
1067
|
-
y2: y2
|
|
1068
|
-
} = bounds;
|
|
1069
|
-
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);
|
|
1052
|
+
{
|
|
1053
|
+
reactIs.exports = requireReactIs_production_min();
|
|
1070
1054
|
}
|
|
1071
|
-
|
|
1072
|
-
constructor(bounds) {
|
|
1073
|
-
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
1074
|
-
}
|
|
1075
|
-
clone() {
|
|
1076
|
-
return new Bounds(this);
|
|
1077
|
-
}
|
|
1078
|
-
clear() {
|
|
1079
|
-
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
1080
|
-
}
|
|
1081
|
-
empty() {
|
|
1082
|
-
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
1083
|
-
}
|
|
1084
|
-
equals(b) {
|
|
1085
|
-
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
1086
|
-
}
|
|
1087
|
-
setValue() {
|
|
1088
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1089
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1090
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1091
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1092
|
-
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
1093
|
-
}
|
|
1094
|
-
set() {
|
|
1095
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1096
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1097
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1098
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1099
|
-
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;
|
|
1100
|
-
}
|
|
1101
|
-
add() {
|
|
1102
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1103
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1104
|
-
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;
|
|
1105
|
-
}
|
|
1106
|
-
expand() {
|
|
1107
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1108
|
-
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;
|
|
1109
|
-
}
|
|
1110
|
-
round() {
|
|
1111
|
-
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;
|
|
1112
|
-
}
|
|
1113
|
-
translate() {
|
|
1114
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1115
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1116
|
-
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
1117
|
-
}
|
|
1118
|
-
rotate() {
|
|
1119
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1120
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1121
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1122
|
-
const p = this.rotatedPoints(angle, x, y);
|
|
1123
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
1124
|
-
}
|
|
1125
|
-
scale() {
|
|
1126
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1127
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1128
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1129
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1130
|
-
const p = this.scalePoints(sx, sy, x, y);
|
|
1131
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
1132
|
-
}
|
|
1133
|
-
union(b) {
|
|
1134
|
-
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;
|
|
1135
|
-
}
|
|
1136
|
-
intersect(b) {
|
|
1137
|
-
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;
|
|
1138
|
-
}
|
|
1139
|
-
encloses(b) {
|
|
1140
|
-
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
1141
|
-
}
|
|
1142
|
-
alignsWith(b) {
|
|
1143
|
-
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
1144
|
-
}
|
|
1145
|
-
intersects(b) {
|
|
1146
|
-
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
1147
|
-
}
|
|
1148
|
-
contains() {
|
|
1149
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1150
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1151
|
-
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
1152
|
-
}
|
|
1153
|
-
containsPoint(p) {
|
|
1154
|
-
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
1155
|
-
}
|
|
1156
|
-
width() {
|
|
1157
|
-
return this.empty() ? 0 : this.x2 - this.x1;
|
|
1158
|
-
}
|
|
1159
|
-
height() {
|
|
1160
|
-
return this.empty() ? 0 : this.y2 - this.y1;
|
|
1161
|
-
}
|
|
1162
|
-
scaleX() {
|
|
1163
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1164
|
-
return this.x1 *= s, this.x2 *= s, this;
|
|
1165
|
-
}
|
|
1166
|
-
scaleY() {
|
|
1167
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1168
|
-
return this.y1 *= s, this.y2 *= s, this;
|
|
1169
|
-
}
|
|
1170
|
-
transformWithMatrix(matrix) {
|
|
1171
|
-
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
1172
|
-
}
|
|
1173
|
-
copy(b) {
|
|
1174
|
-
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
1175
|
-
}
|
|
1176
|
-
rotatedPoints(angle, x, y) {
|
|
1177
|
-
const {
|
|
1178
|
-
x1: x1,
|
|
1179
|
-
y1: y1,
|
|
1180
|
-
x2: x2,
|
|
1181
|
-
y2: y2
|
|
1182
|
-
} = this,
|
|
1183
|
-
cos = Math.cos(angle),
|
|
1184
|
-
sin = Math.sin(angle),
|
|
1185
|
-
cx = x - x * cos + y * sin,
|
|
1186
|
-
cy = y - x * sin - y * cos;
|
|
1187
|
-
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];
|
|
1188
|
-
}
|
|
1189
|
-
scalePoints(sx, sy, x, y) {
|
|
1190
|
-
const {
|
|
1191
|
-
x1: x1,
|
|
1192
|
-
y1: y1,
|
|
1193
|
-
x2: x2,
|
|
1194
|
-
y2: y2
|
|
1195
|
-
} = this;
|
|
1196
|
-
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
class AABBBounds extends Bounds {}
|
|
1055
|
+
var reactIsExports = reactIs.exports;
|
|
1200
1056
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1057
|
+
const toArray = (children) => {
|
|
1058
|
+
let result = [];
|
|
1059
|
+
React.Children.forEach(children, child => {
|
|
1060
|
+
if (isNil$3(child)) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
if (reactIsExports.isFragment(child)) {
|
|
1064
|
+
result = result.concat(toArray(child.props.children));
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
result.push(child);
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
return result;
|
|
1211
1071
|
};
|
|
1212
|
-
const clampAngleByRadian = clampRadian;
|
|
1213
1072
|
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1073
|
+
const REACT_PRIVATE_PROPS = ['children', 'hooks', 'ref'];
|
|
1074
|
+
|
|
1075
|
+
const EVENT_TYPE = {
|
|
1076
|
+
...vtable.TABLE_EVENT_TYPE,
|
|
1077
|
+
...vtable.PIVOT_TABLE_EVENT_TYPE,
|
|
1078
|
+
...vtable.PIVOT_CHART_EVENT_TYPE
|
|
1079
|
+
};
|
|
1080
|
+
const TABLE_EVENTS = {
|
|
1081
|
+
onClickCell: EVENT_TYPE.CLICK_CELL,
|
|
1082
|
+
onDblClickCell: EVENT_TYPE.DBLCLICK_CELL,
|
|
1083
|
+
onMouseDownCell: EVENT_TYPE.MOUSEDOWN_CELL,
|
|
1084
|
+
onMouseUpCell: EVENT_TYPE.MOUSEUP_CELL,
|
|
1085
|
+
onSelectedCell: EVENT_TYPE.SELECTED_CELL,
|
|
1086
|
+
onSelectedClear: EVENT_TYPE.SELECTED_CLEAR,
|
|
1087
|
+
onKeyDown: EVENT_TYPE.KEYDOWN,
|
|
1088
|
+
onMouseEnterTable: EVENT_TYPE.MOUSEENTER_TABLE,
|
|
1089
|
+
onMouseLeaveTable: EVENT_TYPE.MOUSELEAVE_TABLE,
|
|
1090
|
+
onMouseDownTable: EVENT_TYPE.MOUSEDOWN_TABLE,
|
|
1091
|
+
onMouseMoveCell: EVENT_TYPE.MOUSEMOVE_CELL,
|
|
1092
|
+
onMouseEnterCell: EVENT_TYPE.MOUSEENTER_CELL,
|
|
1093
|
+
onMouseLeaveCell: EVENT_TYPE.MOUSELEAVE_CELL,
|
|
1094
|
+
onContextMenuCell: EVENT_TYPE.CONTEXTMENU_CELL,
|
|
1095
|
+
onResizeColumn: EVENT_TYPE.RESIZE_COLUMN,
|
|
1096
|
+
onResizeColumnEnd: EVENT_TYPE.RESIZE_COLUMN_END,
|
|
1097
|
+
onChangeHeaderPosition: EVENT_TYPE.CHANGE_HEADER_POSITION,
|
|
1098
|
+
onSortClick: EVENT_TYPE.SORT_CLICK,
|
|
1099
|
+
onFreezeClick: EVENT_TYPE.FREEZE_CLICK,
|
|
1100
|
+
onScroll: EVENT_TYPE.SCROLL,
|
|
1101
|
+
onDropdownMenuClick: EVENT_TYPE.DROPDOWN_MENU_CLICK,
|
|
1102
|
+
onMouseOverChartSymbol: EVENT_TYPE.MOUSEOVER_CHART_SYMBOL,
|
|
1103
|
+
onDragSelectEnd: EVENT_TYPE.DRAG_SELECT_END,
|
|
1104
|
+
onDropdownIconClick: EVENT_TYPE.DROPDOWN_ICON_CLICK,
|
|
1105
|
+
onDropdownMenuClear: EVENT_TYPE.DROPDOWN_MENU_CLEAR,
|
|
1106
|
+
onTreeHierarchyStateChange: EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,
|
|
1107
|
+
onShowMenu: EVENT_TYPE.SHOW_MENU,
|
|
1108
|
+
onHideMenu: EVENT_TYPE.HIDE_MENU,
|
|
1109
|
+
onIconClick: EVENT_TYPE.ICON_CLICK,
|
|
1110
|
+
onLegendItemClick: EVENT_TYPE.LEGEND_ITEM_CLICK,
|
|
1111
|
+
onLegendItemHover: EVENT_TYPE.LEGEND_ITEM_HOVER,
|
|
1112
|
+
onLegendItemUnHover: EVENT_TYPE.LEGEND_ITEM_UNHOVER,
|
|
1113
|
+
onLegendChange: EVENT_TYPE.LEGEND_CHANGE,
|
|
1114
|
+
onMouseEnterAxis: EVENT_TYPE.MOUSEENTER_AXIS,
|
|
1115
|
+
onMouseLeaveAxis: EVENT_TYPE.MOUSELEAVE_AXIS,
|
|
1116
|
+
onCheckboxStateChange: EVENT_TYPE.CHECKBOX_STATE_CHANGE,
|
|
1117
|
+
onRadioStateChange: EVENT_TYPE.RADIO_STATE_CHANGE,
|
|
1118
|
+
onAfterRender: EVENT_TYPE.AFTER_RENDER,
|
|
1119
|
+
onInitialized: EVENT_TYPE.INITIALIZED,
|
|
1120
|
+
onPivotSortClick: EVENT_TYPE.PIVOT_SORT_CLICK,
|
|
1121
|
+
onDrillMenuClick: EVENT_TYPE.DRILLMENU_CLICK,
|
|
1122
|
+
onVChartEventType: EVENT_TYPE.VCHART_EVENT_TYPE,
|
|
1123
|
+
onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
1124
|
+
onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
|
|
1125
|
+
onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
|
|
1126
|
+
onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
|
|
1127
|
+
onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
|
|
1128
|
+
onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END
|
|
1129
|
+
};
|
|
1130
|
+
const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
|
|
1131
|
+
const findEventProps = (props, supportedEvents = TABLE_EVENTS) => {
|
|
1132
|
+
const result = {};
|
|
1133
|
+
Object.keys(props).forEach(key => {
|
|
1134
|
+
if (supportedEvents[key] && props[key]) {
|
|
1135
|
+
result[key] = props[key];
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
return result;
|
|
1139
|
+
};
|
|
1140
|
+
const bindEventsToTable = (table, newProps, prevProps, supportedEvents = TABLE_EVENTS) => {
|
|
1141
|
+
if ((!newProps && !prevProps) || !table) {
|
|
1142
|
+
return false;
|
|
1143
|
+
}
|
|
1144
|
+
const prevEventProps = prevProps ? findEventProps(prevProps, supportedEvents) : null;
|
|
1145
|
+
const newEventProps = newProps ? findEventProps(newProps, supportedEvents) : null;
|
|
1146
|
+
if (prevEventProps) {
|
|
1147
|
+
Object.keys(prevEventProps).forEach(eventKey => {
|
|
1148
|
+
if (!newEventProps ||
|
|
1149
|
+
!newEventProps[eventKey] ||
|
|
1150
|
+
newEventProps[eventKey] !== prevEventProps[eventKey]) {
|
|
1151
|
+
table.off(supportedEvents[eventKey], prevProps[eventKey]);
|
|
1152
|
+
}
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
if (newEventProps) {
|
|
1156
|
+
Object.keys(newEventProps).forEach(eventKey => {
|
|
1157
|
+
if (!prevEventProps ||
|
|
1158
|
+
!prevEventProps[eventKey] ||
|
|
1159
|
+
prevEventProps[eventKey] !== newEventProps[eventKey]) {
|
|
1160
|
+
table.on(supportedEvents[eventKey], newEventProps[eventKey]);
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
return true;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
class Generator {
|
|
1168
|
+
static GenAutoIncrementId() {
|
|
1169
|
+
return Generator.auto_increment_id++;
|
|
1274
1170
|
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1171
|
+
}
|
|
1172
|
+
Generator.auto_increment_id = 0;
|
|
1173
|
+
|
|
1174
|
+
class ContainerModule {
|
|
1175
|
+
constructor(registry) {
|
|
1176
|
+
this.id = Generator.GenAutoIncrementId(), this.registry = registry;
|
|
1277
1177
|
}
|
|
1278
|
-
|
|
1279
|
-
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
const NAMED_TAG = "named";
|
|
1181
|
+
const INJECT_TAG = "inject";
|
|
1182
|
+
const MULTI_INJECT_TAG = "multi_inject";
|
|
1183
|
+
const TAGGED = "inversify:tagged";
|
|
1184
|
+
const PARAM_TYPES = "inversify:paramtypes";
|
|
1185
|
+
|
|
1186
|
+
class Metadata {
|
|
1187
|
+
constructor(key, value) {
|
|
1188
|
+
this.key = key, this.value = value;
|
|
1280
1189
|
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
a: a,
|
|
1284
|
-
b: b,
|
|
1285
|
-
c: c,
|
|
1286
|
-
d: d,
|
|
1287
|
-
e: e,
|
|
1288
|
-
f: f
|
|
1289
|
-
} = this;
|
|
1290
|
-
return this.a = b, this.b = a, this.c = d, this.d = c, this.e = f, this.f = e, this;
|
|
1190
|
+
toString() {
|
|
1191
|
+
return this.key === NAMED_TAG ? `named: ${String(this.value).toString()} ` : `tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`;
|
|
1291
1192
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
var Reflect$1 = (function (Reflect) {
|
|
1196
|
+
var target;
|
|
1197
|
+
return function (exporter) {
|
|
1198
|
+
const supportsSymbol = "function" == typeof Symbol,
|
|
1199
|
+
toPrimitiveSymbol = supportsSymbol && void 0 !== Symbol.toPrimitive ? Symbol.toPrimitive : "@@toPrimitive",
|
|
1200
|
+
functionPrototype = (Object.getPrototypeOf(Function)),
|
|
1201
|
+
_Map = ("object" == typeof process && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL, Map),
|
|
1202
|
+
Metadata = (new WeakMap());
|
|
1203
|
+
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
1204
|
+
if (!IsObject(target)) throw new TypeError();
|
|
1205
|
+
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
1206
|
+
}
|
|
1207
|
+
function hasMetadata(metadataKey, target, propertyKey) {
|
|
1208
|
+
if (!IsObject(target)) throw new TypeError();
|
|
1209
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
1210
|
+
}
|
|
1211
|
+
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
1212
|
+
if (!IsObject(target)) throw new TypeError();
|
|
1213
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
1214
|
+
}
|
|
1215
|
+
function getMetadata(metadataKey, target, propertyKey) {
|
|
1216
|
+
if (!IsObject(target)) throw new TypeError();
|
|
1217
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
1218
|
+
}
|
|
1219
|
+
function GetOrCreateMetadataMap(O, P, Create) {
|
|
1220
|
+
let targetMetadata = Metadata.get(O);
|
|
1221
|
+
if (IsUndefined(targetMetadata)) {
|
|
1222
|
+
if (!Create) return;
|
|
1223
|
+
targetMetadata = new _Map(), Metadata.set(O, targetMetadata);
|
|
1224
|
+
}
|
|
1225
|
+
let metadataMap = targetMetadata.get(P);
|
|
1226
|
+
if (IsUndefined(metadataMap)) {
|
|
1227
|
+
if (!Create) return;
|
|
1228
|
+
metadataMap = new _Map(), targetMetadata.set(P, metadataMap);
|
|
1229
|
+
}
|
|
1230
|
+
return metadataMap;
|
|
1231
|
+
}
|
|
1232
|
+
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
1233
|
+
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return !0;
|
|
1234
|
+
const parent = OrdinaryGetPrototypeOf(O);
|
|
1235
|
+
return !IsNull(parent) && OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
1236
|
+
}
|
|
1237
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
1238
|
+
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
1239
|
+
return !IsUndefined(metadataMap) && ToBoolean(metadataMap.has(MetadataKey));
|
|
1240
|
+
}
|
|
1241
|
+
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
1242
|
+
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
1243
|
+
const parent = OrdinaryGetPrototypeOf(O);
|
|
1244
|
+
return IsNull(parent) ? void 0 : OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
1245
|
+
}
|
|
1246
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
1247
|
+
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
1248
|
+
if (!IsUndefined(metadataMap)) return metadataMap.get(MetadataKey);
|
|
1249
|
+
}
|
|
1250
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
1251
|
+
GetOrCreateMetadataMap(O, P, !0).set(MetadataKey, MetadataValue);
|
|
1252
|
+
}
|
|
1253
|
+
function Type(x) {
|
|
1254
|
+
if (null === x) return 1;
|
|
1255
|
+
switch (typeof x) {
|
|
1256
|
+
case "undefined":
|
|
1257
|
+
return 0;
|
|
1258
|
+
case "boolean":
|
|
1259
|
+
return 2;
|
|
1260
|
+
case "string":
|
|
1261
|
+
return 3;
|
|
1262
|
+
case "symbol":
|
|
1263
|
+
return 4;
|
|
1264
|
+
case "number":
|
|
1265
|
+
return 5;
|
|
1266
|
+
case "object":
|
|
1267
|
+
return null === x ? 1 : 6;
|
|
1268
|
+
default:
|
|
1269
|
+
return 6;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
function IsUndefined(x) {
|
|
1273
|
+
return void 0 === x;
|
|
1274
|
+
}
|
|
1275
|
+
function IsNull(x) {
|
|
1276
|
+
return null === x;
|
|
1277
|
+
}
|
|
1278
|
+
function IsSymbol(x) {
|
|
1279
|
+
return "symbol" == typeof x;
|
|
1280
|
+
}
|
|
1281
|
+
function IsObject(x) {
|
|
1282
|
+
return "object" == typeof x ? null !== x : "function" == typeof x;
|
|
1283
|
+
}
|
|
1284
|
+
function ToPrimitive(input, PreferredType) {
|
|
1285
|
+
switch (Type(input)) {
|
|
1286
|
+
case 0:
|
|
1287
|
+
case 1:
|
|
1288
|
+
case 2:
|
|
1289
|
+
case 3:
|
|
1290
|
+
case 4:
|
|
1291
|
+
case 5:
|
|
1292
|
+
return input;
|
|
1293
|
+
}
|
|
1294
|
+
const hint = 3 === PreferredType ? "string" : 5 === PreferredType ? "number" : "default",
|
|
1295
|
+
exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
1296
|
+
if (void 0 !== exoticToPrim) {
|
|
1297
|
+
const result = exoticToPrim.call(input, hint);
|
|
1298
|
+
if (IsObject(result)) throw new TypeError();
|
|
1299
|
+
return result;
|
|
1300
|
+
}
|
|
1301
|
+
return OrdinaryToPrimitive(input, "default" === hint ? "number" : hint);
|
|
1302
|
+
}
|
|
1303
|
+
function OrdinaryToPrimitive(O, hint) {
|
|
1304
|
+
if ("string" === hint) {
|
|
1305
|
+
const toString_1 = O.toString;
|
|
1306
|
+
if (IsCallable(toString_1)) {
|
|
1307
|
+
const result = toString_1.call(O);
|
|
1308
|
+
if (!IsObject(result)) return result;
|
|
1309
|
+
}
|
|
1310
|
+
const valueOf = O.valueOf;
|
|
1311
|
+
if (IsCallable(valueOf)) {
|
|
1312
|
+
const result = valueOf.call(O);
|
|
1313
|
+
if (!IsObject(result)) return result;
|
|
1314
|
+
}
|
|
1315
|
+
} else {
|
|
1316
|
+
const valueOf = O.valueOf;
|
|
1317
|
+
if (IsCallable(valueOf)) {
|
|
1318
|
+
const result = valueOf.call(O);
|
|
1319
|
+
if (!IsObject(result)) return result;
|
|
1320
|
+
}
|
|
1321
|
+
const toString_2 = O.toString;
|
|
1322
|
+
if (IsCallable(toString_2)) {
|
|
1323
|
+
const result = toString_2.call(O);
|
|
1324
|
+
if (!IsObject(result)) return result;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
throw new TypeError();
|
|
1328
|
+
}
|
|
1329
|
+
function ToBoolean(argument) {
|
|
1330
|
+
return !!argument;
|
|
1331
|
+
}
|
|
1332
|
+
function ToString(argument) {
|
|
1333
|
+
return "" + argument;
|
|
1334
|
+
}
|
|
1335
|
+
function ToPropertyKey(argument) {
|
|
1336
|
+
const key = ToPrimitive(argument, 3);
|
|
1337
|
+
return IsSymbol(key) ? key : ToString(key);
|
|
1338
|
+
}
|
|
1339
|
+
function IsCallable(argument) {
|
|
1340
|
+
return "function" == typeof argument;
|
|
1341
|
+
}
|
|
1342
|
+
function GetMethod(V, P) {
|
|
1343
|
+
const func = V[P];
|
|
1344
|
+
if (null != func) {
|
|
1345
|
+
if (!IsCallable(func)) throw new TypeError();
|
|
1346
|
+
return func;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
function OrdinaryGetPrototypeOf(O) {
|
|
1350
|
+
const proto = Object.getPrototypeOf(O);
|
|
1351
|
+
if ("function" != typeof O || O === functionPrototype) return proto;
|
|
1352
|
+
if (proto !== functionPrototype) return proto;
|
|
1353
|
+
const prototype = O.prototype,
|
|
1354
|
+
prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
1355
|
+
if (null == prototypeProto || prototypeProto === Object.prototype) return proto;
|
|
1356
|
+
const constructor = prototypeProto.constructor;
|
|
1357
|
+
return "function" != typeof constructor || constructor === O ? proto : constructor;
|
|
1358
|
+
}
|
|
1359
|
+
exporter("defineMetadata", defineMetadata), exporter("hasMetadata", hasMetadata), exporter("hasOwnMetadata", hasOwnMetadata), exporter("getMetadata", getMetadata);
|
|
1360
|
+
}((target = Reflect, function (key, value) {
|
|
1361
|
+
"function" != typeof target[key] && Object.defineProperty(target, key, {
|
|
1362
|
+
configurable: !0,
|
|
1363
|
+
writable: !0,
|
|
1364
|
+
value: value
|
|
1365
|
+
});
|
|
1366
|
+
})), Reflect;
|
|
1367
|
+
})({});
|
|
1368
|
+
|
|
1369
|
+
function _tagParameterOrProperty(metadataKey, annotationTarget, key, metadata) {
|
|
1370
|
+
const metadatas = [metadata];
|
|
1371
|
+
let paramsOrPropertiesMetadata = {};
|
|
1372
|
+
Reflect$1.hasOwnMetadata(metadataKey, annotationTarget) && (paramsOrPropertiesMetadata = Reflect$1.getMetadata(metadataKey, annotationTarget));
|
|
1373
|
+
let paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
|
|
1374
|
+
void 0 === paramOrPropertyMetadata && (paramOrPropertyMetadata = []), paramOrPropertyMetadata.push(...metadatas), paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata, Reflect$1.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
|
|
1375
|
+
}
|
|
1376
|
+
function tagParameter(annotationTarget, parameterName, parameterIndex, metadata) {
|
|
1377
|
+
_tagParameterOrProperty(TAGGED, annotationTarget, parameterIndex.toString(), metadata);
|
|
1378
|
+
}
|
|
1379
|
+
function createTaggedDecorator(metadata) {
|
|
1380
|
+
return (target, targetKey, indexOrPropertyDescriptor) => {
|
|
1381
|
+
tagParameter(target, targetKey, indexOrPropertyDescriptor, metadata);
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
function injectBase(metadataKey) {
|
|
1385
|
+
return serviceIdentifier => (target, targetKey, indexOrPropertyDescriptor) => createTaggedDecorator(new Metadata(metadataKey, serviceIdentifier))(target, targetKey, indexOrPropertyDescriptor);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
const inject = injectBase(INJECT_TAG);
|
|
1389
|
+
|
|
1390
|
+
function injectable() {
|
|
1391
|
+
return function (target) {
|
|
1392
|
+
return Reflect$1.defineMetadata(PARAM_TYPES, null, target), target;
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
function named(name) {
|
|
1397
|
+
return createTaggedDecorator(new Metadata(NAMED_TAG, name));
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
const BindingScopeEnum = {
|
|
1401
|
+
Singleton: "Singleton",
|
|
1402
|
+
Transient: "Transient"
|
|
1403
|
+
},
|
|
1404
|
+
BindingTypeEnum = {
|
|
1405
|
+
ConstantValue: "ConstantValue",
|
|
1406
|
+
Constructor: "Constructor",
|
|
1407
|
+
DynamicValue: "DynamicValue",
|
|
1408
|
+
Factory: "Factory",
|
|
1409
|
+
Function: "Function",
|
|
1410
|
+
Instance: "Instance",
|
|
1411
|
+
Invalid: "Invalid",
|
|
1412
|
+
Provider: "Provider"
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
class Binding {
|
|
1416
|
+
constructor(serviceIdentifier, scope) {
|
|
1417
|
+
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;
|
|
1304
1418
|
}
|
|
1305
|
-
|
|
1306
|
-
const
|
|
1307
|
-
return
|
|
1419
|
+
clone() {
|
|
1420
|
+
const clone = new Binding(this.serviceIdentifier, this.scope);
|
|
1421
|
+
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;
|
|
1308
1422
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
class MetadataReader {
|
|
1426
|
+
getConstructorMetadata(constructorFunc) {
|
|
1427
|
+
return {
|
|
1428
|
+
compilerGeneratedMetadata: Reflect$1.getMetadata(PARAM_TYPES, constructorFunc),
|
|
1429
|
+
userGeneratedMetadata: Reflect$1.getMetadata(TAGGED, constructorFunc) || {}
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
getPropertiesMetadata(constructorFunc) {
|
|
1433
|
+
throw new Error("暂未实现");
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
const taggedConstraint = key => value => {
|
|
1438
|
+
const constraint = request => {
|
|
1439
|
+
if (null == request) return !1;
|
|
1440
|
+
if (request.key === key && request.value === value) return !0;
|
|
1441
|
+
if (null == request.constructorArgsMetadata) return !1;
|
|
1442
|
+
const constructorArgsMetadata = request.constructorArgsMetadata;
|
|
1443
|
+
for (let i = 0; i < constructorArgsMetadata.length; i++) if (constructorArgsMetadata[i].key === key && constructorArgsMetadata[i].value === value) return !0;
|
|
1444
|
+
return !1;
|
|
1445
|
+
};
|
|
1446
|
+
return constraint.metaData = new Metadata(key, value), constraint;
|
|
1447
|
+
};
|
|
1448
|
+
const namedConstraint = taggedConstraint(NAMED_TAG);
|
|
1449
|
+
|
|
1450
|
+
class BindingInSyntax {
|
|
1451
|
+
constructor(binding) {
|
|
1452
|
+
this._binding = binding;
|
|
1453
|
+
}
|
|
1454
|
+
inRequestScope() {
|
|
1455
|
+
throw new Error("暂未实现");
|
|
1456
|
+
}
|
|
1457
|
+
inSingletonScope() {
|
|
1458
|
+
return this._binding.scope = BindingScopeEnum.Singleton, this;
|
|
1459
|
+
}
|
|
1460
|
+
inTransientScope() {
|
|
1461
|
+
return this._binding.scope = BindingScopeEnum.Transient, this;
|
|
1462
|
+
}
|
|
1463
|
+
whenTargetNamed(name) {
|
|
1464
|
+
return this._binding.constraint = namedConstraint(name), this;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
class BindingToSyntax {
|
|
1469
|
+
constructor(binding) {
|
|
1470
|
+
this._binding = binding;
|
|
1471
|
+
}
|
|
1472
|
+
to(constructor) {
|
|
1473
|
+
return this._binding.type = BindingTypeEnum.Instance, this._binding.implementationType = constructor, new BindingInSyntax(this._binding);
|
|
1474
|
+
}
|
|
1475
|
+
toSelf() {
|
|
1476
|
+
const self = this._binding.serviceIdentifier;
|
|
1477
|
+
return this.to(self);
|
|
1478
|
+
}
|
|
1479
|
+
toDynamicValue(func) {
|
|
1480
|
+
return this._binding.type = BindingTypeEnum.DynamicValue, this._binding.cache = null, this._binding.dynamicValue = func, this._binding.implementationType = null, new BindingInSyntax(this._binding);
|
|
1481
|
+
}
|
|
1482
|
+
toConstantValue(value) {
|
|
1483
|
+
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);
|
|
1484
|
+
}
|
|
1485
|
+
toFactory(factory) {
|
|
1486
|
+
return this._binding.type = BindingTypeEnum.Factory, this._binding.factory = factory, this._binding.scope = BindingScopeEnum.Singleton, new BindingInSyntax(this._binding);
|
|
1487
|
+
}
|
|
1488
|
+
toService(service) {
|
|
1489
|
+
this.toDynamicValue(context => context.container.get(service));
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
class Container {
|
|
1494
|
+
constructor(containerOptions) {
|
|
1495
|
+
const options = containerOptions || {};
|
|
1496
|
+
options.defaultScope = options.defaultScope || BindingScopeEnum.Transient, this.options = options, this.id = Generator.GenAutoIncrementId(), this._bindingDictionary = new Map(), this._metadataReader = new MetadataReader();
|
|
1497
|
+
}
|
|
1498
|
+
load(module) {
|
|
1499
|
+
const containerModuleHelpers = this._getContainerModuleHelpersFactory()(module.id);
|
|
1500
|
+
module.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
|
|
1501
|
+
}
|
|
1502
|
+
get(serviceIdentifier) {
|
|
1503
|
+
const getArgs = this._getNotAllArgs(serviceIdentifier, !1);
|
|
1504
|
+
return this._get(getArgs);
|
|
1505
|
+
}
|
|
1506
|
+
getAll(serviceIdentifier) {
|
|
1507
|
+
const getArgs = this._getAllArgs(serviceIdentifier);
|
|
1508
|
+
return this._get(getArgs);
|
|
1509
|
+
}
|
|
1510
|
+
getTagged(serviceIdentifier, key, value) {
|
|
1511
|
+
const getArgs = this._getNotAllArgs(serviceIdentifier, !1, key, value);
|
|
1512
|
+
return this._get(getArgs);
|
|
1513
|
+
}
|
|
1514
|
+
getNamed(serviceIdentifier, named) {
|
|
1515
|
+
return this.getTagged(serviceIdentifier, NAMED_TAG, named);
|
|
1516
|
+
}
|
|
1517
|
+
isBound(serviceIdentifier) {
|
|
1518
|
+
return this._bindingDictionary.has(serviceIdentifier);
|
|
1519
|
+
}
|
|
1520
|
+
bind(serviceIdentifier) {
|
|
1521
|
+
const scope = this.options.defaultScope,
|
|
1522
|
+
binding = new Binding(serviceIdentifier, scope),
|
|
1523
|
+
list = this._bindingDictionary.get(serviceIdentifier) || [];
|
|
1524
|
+
return list.push(binding), this._bindingDictionary.set(serviceIdentifier, list), new BindingToSyntax(binding);
|
|
1525
|
+
}
|
|
1526
|
+
unbind(serviceIdentifier) {
|
|
1527
|
+
this._bindingDictionary.delete(serviceIdentifier);
|
|
1528
|
+
}
|
|
1529
|
+
rebind(serviceIdentifier) {
|
|
1530
|
+
return this.unbind(serviceIdentifier), this.bind(serviceIdentifier);
|
|
1531
|
+
}
|
|
1532
|
+
_getContainerModuleHelpersFactory() {
|
|
1533
|
+
const setModuleId = (bindingToSyntax, moduleId) => {
|
|
1534
|
+
bindingToSyntax._binding.moduleId = moduleId;
|
|
1535
|
+
},
|
|
1536
|
+
getBindFunction = moduleId => serviceIdentifier => {
|
|
1537
|
+
const bindingToSyntax = this.bind(serviceIdentifier);
|
|
1538
|
+
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
1539
|
+
},
|
|
1540
|
+
getUnbindFunction = () => serviceIdentifier => this.unbind(serviceIdentifier),
|
|
1541
|
+
getIsboundFunction = () => serviceIdentifier => this.isBound(serviceIdentifier),
|
|
1542
|
+
getRebindFunction = moduleId => serviceIdentifier => {
|
|
1543
|
+
const bindingToSyntax = this.rebind(serviceIdentifier);
|
|
1544
|
+
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
1545
|
+
};
|
|
1546
|
+
return mId => ({
|
|
1547
|
+
bindFunction: getBindFunction(mId),
|
|
1548
|
+
isboundFunction: getIsboundFunction(),
|
|
1549
|
+
rebindFunction: getRebindFunction(mId),
|
|
1550
|
+
unbindFunction: getUnbindFunction(),
|
|
1551
|
+
unbindAsyncFunction: serviceIdentifier => null
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
_getNotAllArgs(serviceIdentifier, isMultiInject, key, value) {
|
|
1555
|
+
return {
|
|
1556
|
+
avoidConstraints: !1,
|
|
1557
|
+
isMultiInject: isMultiInject,
|
|
1558
|
+
serviceIdentifier: serviceIdentifier,
|
|
1559
|
+
key: key,
|
|
1560
|
+
value: value
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
_getAllArgs(serviceIdentifier) {
|
|
1564
|
+
return {
|
|
1565
|
+
avoidConstraints: !0,
|
|
1566
|
+
isMultiInject: !0,
|
|
1567
|
+
serviceIdentifier: serviceIdentifier
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
_get(getArgs) {
|
|
1571
|
+
const result = [];
|
|
1572
|
+
return this._bindingDictionary.get(getArgs.serviceIdentifier).filter(b => b.constraint(getArgs)).forEach(binding => {
|
|
1573
|
+
result.push(this._resolveFromBinding(binding));
|
|
1574
|
+
}), getArgs.isMultiInject || 1 !== result.length ? result : result[0];
|
|
1575
|
+
}
|
|
1576
|
+
_getChildRequest(binding) {
|
|
1577
|
+
const constr = binding.implementationType,
|
|
1325
1578
|
{
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1579
|
+
userGeneratedMetadata: userGeneratedMetadata
|
|
1580
|
+
} = this._metadataReader.getConstructorMetadata(constr),
|
|
1581
|
+
keys = Object.keys(userGeneratedMetadata),
|
|
1582
|
+
arr = [];
|
|
1583
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1584
|
+
const constructorArgsMetadata = userGeneratedMetadata[i],
|
|
1585
|
+
targetMetadataMap = {};
|
|
1586
|
+
constructorArgsMetadata.forEach(md => {
|
|
1587
|
+
targetMetadataMap[md.key] = md.value;
|
|
1588
|
+
});
|
|
1589
|
+
const metadata = {
|
|
1590
|
+
inject: targetMetadataMap[INJECT_TAG],
|
|
1591
|
+
multiInject: targetMetadataMap[MULTI_INJECT_TAG]
|
|
1592
|
+
},
|
|
1593
|
+
injectIdentifier = metadata.inject || metadata.multiInject,
|
|
1594
|
+
target = {
|
|
1595
|
+
serviceIdentifier: injectIdentifier,
|
|
1596
|
+
constructorArgsMetadata: constructorArgsMetadata
|
|
1597
|
+
},
|
|
1598
|
+
request = {
|
|
1599
|
+
injectIdentifier: injectIdentifier,
|
|
1600
|
+
metadata: constructorArgsMetadata,
|
|
1601
|
+
bindings: this._bindingDictionary.get(injectIdentifier).filter(b => b.constraint(target))
|
|
1602
|
+
};
|
|
1603
|
+
arr.push(request);
|
|
1604
|
+
}
|
|
1605
|
+
return arr;
|
|
1330
1606
|
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
return this.
|
|
1607
|
+
_resolveFromBinding(binding) {
|
|
1608
|
+
const result = this._getResolvedFromBinding(binding);
|
|
1609
|
+
return this._saveToScope(binding, result), result;
|
|
1610
|
+
}
|
|
1611
|
+
_getResolvedFromBinding(binding) {
|
|
1612
|
+
let result;
|
|
1613
|
+
switch (binding.type) {
|
|
1614
|
+
case BindingTypeEnum.ConstantValue:
|
|
1615
|
+
case BindingTypeEnum.Function:
|
|
1616
|
+
result = binding.cache;
|
|
1617
|
+
break;
|
|
1618
|
+
case BindingTypeEnum.Instance:
|
|
1619
|
+
result = this._resolveInstance(binding, binding.implementationType);
|
|
1620
|
+
break;
|
|
1621
|
+
default:
|
|
1622
|
+
result = binding.dynamicValue({
|
|
1623
|
+
container: this
|
|
1624
|
+
});
|
|
1625
|
+
}
|
|
1626
|
+
return result;
|
|
1334
1627
|
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1628
|
+
_resolveInstance(binding, constr) {
|
|
1629
|
+
if (binding.activated) return binding.cache;
|
|
1630
|
+
const childRequests = this._getChildRequest(binding);
|
|
1631
|
+
return this._createInstance(constr, childRequests);
|
|
1337
1632
|
}
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
c = this.c,
|
|
1342
|
-
d = this.d,
|
|
1343
|
-
delta = a * d - b * c,
|
|
1344
|
-
result = {
|
|
1345
|
-
x: this.e,
|
|
1346
|
-
y: this.f,
|
|
1347
|
-
rotateDeg: 0,
|
|
1348
|
-
scaleX: 0,
|
|
1349
|
-
scaleY: 0,
|
|
1350
|
-
skewX: 0,
|
|
1351
|
-
skewY: 0
|
|
1352
|
-
};
|
|
1353
|
-
if (0 !== a || 0 !== b) {
|
|
1354
|
-
const r = Math.sqrt(a * a + b * b);
|
|
1355
|
-
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;
|
|
1356
|
-
} else if (0 !== c || 0 !== d) {
|
|
1357
|
-
const s = Math.sqrt(c * c + d * d);
|
|
1358
|
-
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;
|
|
1633
|
+
_createInstance(constr, childRequests) {
|
|
1634
|
+
if (childRequests.length) {
|
|
1635
|
+
return new constr(...this._resolveRequests(childRequests));
|
|
1359
1636
|
}
|
|
1360
|
-
return
|
|
1637
|
+
return new constr();
|
|
1638
|
+
}
|
|
1639
|
+
_resolveRequests(childRequests) {
|
|
1640
|
+
return childRequests.map(request => request.bindings.length > 1 ? request.bindings.map(binding => this._resolveFromBinding(binding)) : this._resolveFromBinding(request.bindings[0]));
|
|
1641
|
+
}
|
|
1642
|
+
_saveToScope(binding, result) {
|
|
1643
|
+
binding.scope === BindingScopeEnum.Singleton && (binding.cache = result, binding.activated = !0);
|
|
1361
1644
|
}
|
|
1362
1645
|
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
let rotateCenterX, rotateCenterY;
|
|
1373
|
-
rotateCenter ? (rotateCenterX = rotateCenter[0], rotateCenterY = rotateCenter[1]) : (rotateCenterX = x, rotateCenterY = y);
|
|
1374
|
-
const offsetX = rotateCenterX - x,
|
|
1375
|
-
offsetY = rotateCenterY - y,
|
|
1376
|
-
a1 = oa * cosTheta + oc * sinTheta,
|
|
1377
|
-
b1 = ob * cosTheta + od * sinTheta,
|
|
1378
|
-
c1 = oc * cosTheta - oa * sinTheta,
|
|
1379
|
-
d1 = od * cosTheta - ob * sinTheta;
|
|
1380
|
-
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;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
function hslToRgb(h, s, l) {
|
|
1384
|
-
s /= 100, l /= 100;
|
|
1385
|
-
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
1386
|
-
x = c * (1 - Math.abs(h / 60 % 2 - 1)),
|
|
1387
|
-
m = l - c / 2;
|
|
1388
|
-
let r = 0,
|
|
1389
|
-
g = 0,
|
|
1390
|
-
b = 0;
|
|
1391
|
-
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)), {
|
|
1392
|
-
r: r,
|
|
1393
|
-
g: g,
|
|
1394
|
-
b: b
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
function rgbToHsl(r, g, b) {
|
|
1399
|
-
r /= 255, g /= 255, b /= 255;
|
|
1400
|
-
const cMin = Math.min(r, g, b),
|
|
1401
|
-
cMax = Math.max(r, g, b),
|
|
1402
|
-
delta = cMax - cMin;
|
|
1403
|
-
let h = 0,
|
|
1404
|
-
s = 0,
|
|
1405
|
-
l = 0;
|
|
1406
|
-
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), {
|
|
1407
|
-
h: h,
|
|
1408
|
-
s: s,
|
|
1409
|
-
l: l
|
|
1410
|
-
};
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
const REG_HEX = /^#([0-9a-f]{3,8})$/,
|
|
1414
|
-
DEFAULT_COLORS_OPACITY = {
|
|
1415
|
-
transparent: 4294967040
|
|
1416
|
-
};
|
|
1417
|
-
const DEFAULT_COLORS = {
|
|
1418
|
-
aliceblue: 15792383,
|
|
1419
|
-
antiquewhite: 16444375,
|
|
1420
|
-
aqua: 65535,
|
|
1421
|
-
aquamarine: 8388564,
|
|
1422
|
-
azure: 15794175,
|
|
1423
|
-
beige: 16119260,
|
|
1424
|
-
bisque: 16770244,
|
|
1425
|
-
black: 0,
|
|
1426
|
-
blanchedalmond: 16772045,
|
|
1427
|
-
blue: 255,
|
|
1428
|
-
blueviolet: 9055202,
|
|
1429
|
-
brown: 10824234,
|
|
1430
|
-
burlywood: 14596231,
|
|
1431
|
-
cadetblue: 6266528,
|
|
1432
|
-
chartreuse: 8388352,
|
|
1433
|
-
chocolate: 13789470,
|
|
1434
|
-
coral: 16744272,
|
|
1435
|
-
cornflowerblue: 6591981,
|
|
1436
|
-
cornsilk: 16775388,
|
|
1437
|
-
crimson: 14423100,
|
|
1438
|
-
cyan: 65535,
|
|
1439
|
-
darkblue: 139,
|
|
1440
|
-
darkcyan: 35723,
|
|
1441
|
-
darkgoldenrod: 12092939,
|
|
1442
|
-
darkgray: 11119017,
|
|
1443
|
-
darkgreen: 25600,
|
|
1444
|
-
darkgrey: 11119017,
|
|
1445
|
-
darkkhaki: 12433259,
|
|
1446
|
-
darkmagenta: 9109643,
|
|
1447
|
-
darkolivegreen: 5597999,
|
|
1448
|
-
darkorange: 16747520,
|
|
1449
|
-
darkorchid: 10040012,
|
|
1450
|
-
darkred: 9109504,
|
|
1451
|
-
darksalmon: 15308410,
|
|
1452
|
-
darkseagreen: 9419919,
|
|
1453
|
-
darkslateblue: 4734347,
|
|
1454
|
-
darkslategray: 3100495,
|
|
1455
|
-
darkslategrey: 3100495,
|
|
1456
|
-
darkturquoise: 52945,
|
|
1457
|
-
darkviolet: 9699539,
|
|
1458
|
-
deeppink: 16716947,
|
|
1459
|
-
deepskyblue: 49151,
|
|
1460
|
-
dimgray: 6908265,
|
|
1461
|
-
dimgrey: 6908265,
|
|
1462
|
-
dodgerblue: 2003199,
|
|
1463
|
-
firebrick: 11674146,
|
|
1464
|
-
floralwhite: 16775920,
|
|
1465
|
-
forestgreen: 2263842,
|
|
1466
|
-
fuchsia: 16711935,
|
|
1467
|
-
gainsboro: 14474460,
|
|
1468
|
-
ghostwhite: 16316671,
|
|
1469
|
-
gold: 16766720,
|
|
1470
|
-
goldenrod: 14329120,
|
|
1471
|
-
gray: 8421504,
|
|
1472
|
-
green: 32768,
|
|
1473
|
-
greenyellow: 11403055,
|
|
1474
|
-
grey: 8421504,
|
|
1475
|
-
honeydew: 15794160,
|
|
1476
|
-
hotpink: 16738740,
|
|
1477
|
-
indianred: 13458524,
|
|
1478
|
-
indigo: 4915330,
|
|
1479
|
-
ivory: 16777200,
|
|
1480
|
-
khaki: 15787660,
|
|
1481
|
-
lavender: 15132410,
|
|
1482
|
-
lavenderblush: 16773365,
|
|
1483
|
-
lawngreen: 8190976,
|
|
1484
|
-
lemonchiffon: 16775885,
|
|
1485
|
-
lightblue: 11393254,
|
|
1486
|
-
lightcoral: 15761536,
|
|
1487
|
-
lightcyan: 14745599,
|
|
1488
|
-
lightgoldenrodyellow: 16448210,
|
|
1489
|
-
lightgray: 13882323,
|
|
1490
|
-
lightgreen: 9498256,
|
|
1491
|
-
lightgrey: 13882323,
|
|
1492
|
-
lightpink: 16758465,
|
|
1493
|
-
lightsalmon: 16752762,
|
|
1494
|
-
lightseagreen: 2142890,
|
|
1495
|
-
lightskyblue: 8900346,
|
|
1496
|
-
lightslategray: 7833753,
|
|
1497
|
-
lightslategrey: 7833753,
|
|
1498
|
-
lightsteelblue: 11584734,
|
|
1499
|
-
lightyellow: 16777184,
|
|
1500
|
-
lime: 65280,
|
|
1501
|
-
limegreen: 3329330,
|
|
1502
|
-
linen: 16445670,
|
|
1503
|
-
magenta: 16711935,
|
|
1504
|
-
maroon: 8388608,
|
|
1505
|
-
mediumaquamarine: 6737322,
|
|
1506
|
-
mediumblue: 205,
|
|
1507
|
-
mediumorchid: 12211667,
|
|
1508
|
-
mediumpurple: 9662683,
|
|
1509
|
-
mediumseagreen: 3978097,
|
|
1510
|
-
mediumslateblue: 8087790,
|
|
1511
|
-
mediumspringgreen: 64154,
|
|
1512
|
-
mediumturquoise: 4772300,
|
|
1513
|
-
mediumvioletred: 13047173,
|
|
1514
|
-
midnightblue: 1644912,
|
|
1515
|
-
mintcream: 16121850,
|
|
1516
|
-
mistyrose: 16770273,
|
|
1517
|
-
moccasin: 16770229,
|
|
1518
|
-
navajowhite: 16768685,
|
|
1519
|
-
navy: 128,
|
|
1520
|
-
oldlace: 16643558,
|
|
1521
|
-
olive: 8421376,
|
|
1522
|
-
olivedrab: 7048739,
|
|
1523
|
-
orange: 16753920,
|
|
1524
|
-
orangered: 16729344,
|
|
1525
|
-
orchid: 14315734,
|
|
1526
|
-
palegoldenrod: 15657130,
|
|
1527
|
-
palegreen: 10025880,
|
|
1528
|
-
paleturquoise: 11529966,
|
|
1529
|
-
palevioletred: 14381203,
|
|
1530
|
-
papayawhip: 16773077,
|
|
1531
|
-
peachpuff: 16767673,
|
|
1532
|
-
peru: 13468991,
|
|
1533
|
-
pink: 16761035,
|
|
1534
|
-
plum: 14524637,
|
|
1535
|
-
powderblue: 11591910,
|
|
1536
|
-
purple: 8388736,
|
|
1537
|
-
rebeccapurple: 6697881,
|
|
1538
|
-
red: 16711680,
|
|
1539
|
-
rosybrown: 12357519,
|
|
1540
|
-
royalblue: 4286945,
|
|
1541
|
-
saddlebrown: 9127187,
|
|
1542
|
-
salmon: 16416882,
|
|
1543
|
-
sandybrown: 16032864,
|
|
1544
|
-
seagreen: 3050327,
|
|
1545
|
-
seashell: 16774638,
|
|
1546
|
-
sienna: 10506797,
|
|
1547
|
-
silver: 12632256,
|
|
1548
|
-
skyblue: 8900331,
|
|
1549
|
-
slateblue: 6970061,
|
|
1550
|
-
slategray: 7372944,
|
|
1551
|
-
slategrey: 7372944,
|
|
1552
|
-
snow: 16775930,
|
|
1553
|
-
springgreen: 65407,
|
|
1554
|
-
steelblue: 4620980,
|
|
1555
|
-
tan: 13808780,
|
|
1556
|
-
teal: 32896,
|
|
1557
|
-
thistle: 14204888,
|
|
1558
|
-
tomato: 16737095,
|
|
1559
|
-
turquoise: 4251856,
|
|
1560
|
-
violet: 15631086,
|
|
1561
|
-
wheat: 16113331,
|
|
1562
|
-
white: 16777215,
|
|
1563
|
-
whitesmoke: 16119285,
|
|
1564
|
-
yellow: 16776960,
|
|
1565
|
-
yellowgreen: 10145074
|
|
1566
|
-
};
|
|
1567
|
-
function hex(value) {
|
|
1568
|
-
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
1569
|
-
}
|
|
1570
|
-
function rgb(value) {
|
|
1571
|
-
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);
|
|
1572
|
-
}
|
|
1573
|
-
function rgba(value) {
|
|
1574
|
-
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);
|
|
1575
|
-
}
|
|
1576
|
-
function SRGBToLinear(c) {
|
|
1577
|
-
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
1646
|
+
|
|
1647
|
+
const ContributionProvider = Symbol("ContributionProvider");
|
|
1648
|
+
class ContributionProviderCache {
|
|
1649
|
+
constructor(serviceIdentifier, container) {
|
|
1650
|
+
this.serviceIdentifier = serviceIdentifier, this.container = container;
|
|
1651
|
+
}
|
|
1652
|
+
getContributions() {
|
|
1653
|
+
return this.caches || (this.caches = [], this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier))), this.caches;
|
|
1654
|
+
}
|
|
1578
1655
|
}
|
|
1579
|
-
function
|
|
1580
|
-
|
|
1656
|
+
function bindContributionProvider(bind, id) {
|
|
1657
|
+
bind(ContributionProvider).toDynamicValue(_ref => {
|
|
1658
|
+
let {
|
|
1659
|
+
container: container
|
|
1660
|
+
} = _ref;
|
|
1661
|
+
return new ContributionProviderCache(id, container);
|
|
1662
|
+
}).inSingletonScope().whenTargetNamed(id);
|
|
1581
1663
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
hexLength = isHex[1].length;
|
|
1587
|
-
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;
|
|
1664
|
+
|
|
1665
|
+
class Hook {
|
|
1666
|
+
constructor(args, name) {
|
|
1667
|
+
this._args = args, this.name = name, this.taps = [];
|
|
1588
1668
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
static Brighter(source) {
|
|
1592
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1593
|
-
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
1669
|
+
tap(options, fn) {
|
|
1670
|
+
this._tap("sync", options, fn);
|
|
1594
1671
|
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1672
|
+
unTap(options, fn) {
|
|
1673
|
+
const name = "string" == typeof options ? options.trim() : options.name;
|
|
1674
|
+
name && (this.taps = this.taps.filter(tap => !(tap.name === name && (!fn || tap.fn === fn))));
|
|
1598
1675
|
}
|
|
1599
|
-
|
|
1600
|
-
let
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
return color.getLuminance();
|
|
1610
|
-
case "lum2":
|
|
1611
|
-
return color.getLuminance2();
|
|
1612
|
-
case "lum3":
|
|
1613
|
-
return color.getLuminance3();
|
|
1614
|
-
}
|
|
1676
|
+
_parseOptions(type, options, fn) {
|
|
1677
|
+
let _options;
|
|
1678
|
+
if ("string" == typeof options) _options = {
|
|
1679
|
+
name: options.trim()
|
|
1680
|
+
};else if ("object" != typeof options || null === options) throw new Error("Invalid tap options");
|
|
1681
|
+
if ("string" != typeof _options.name || "" === _options.name) throw new Error("Missing name for tap");
|
|
1682
|
+
return _options = Object.assign({
|
|
1683
|
+
type: type,
|
|
1684
|
+
fn: fn
|
|
1685
|
+
}, _options), _options;
|
|
1615
1686
|
}
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1687
|
+
_tap(type, options, fn) {
|
|
1688
|
+
this._insert(this._parseOptions(type, options, fn));
|
|
1689
|
+
}
|
|
1690
|
+
_insert(item) {
|
|
1691
|
+
let before;
|
|
1692
|
+
"string" == typeof item.before ? before = new Set([item.before]) : Array.isArray(item.before) && (before = new Set(item.before));
|
|
1693
|
+
let stage = 0;
|
|
1694
|
+
"number" == typeof item.stage && (stage = item.stage);
|
|
1695
|
+
let i = this.taps.length;
|
|
1696
|
+
for (; i > 0;) {
|
|
1697
|
+
i--;
|
|
1698
|
+
const x = this.taps[i];
|
|
1699
|
+
this.taps[i + 1] = x;
|
|
1700
|
+
const xStage = x.stage || 0;
|
|
1701
|
+
if (before) {
|
|
1702
|
+
if (before.has(x.name)) {
|
|
1703
|
+
before.delete(x.name);
|
|
1704
|
+
continue;
|
|
1705
|
+
}
|
|
1706
|
+
if (before.size > 0) continue;
|
|
1707
|
+
}
|
|
1708
|
+
if (!(xStage > stage)) {
|
|
1709
|
+
i++;
|
|
1710
|
+
break;
|
|
1711
|
+
}
|
|
1625
1712
|
}
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1713
|
+
this.taps[i] = item;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
class SyncHook extends Hook {
|
|
1718
|
+
call() {
|
|
1719
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1720
|
+
args[_key] = arguments[_key];
|
|
1630
1721
|
}
|
|
1722
|
+
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
1631
1723
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
const EnvContribution = Symbol.for("EnvContribution");
|
|
1727
|
+
|
|
1728
|
+
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
1729
|
+
var isType$1 = isType;
|
|
1730
|
+
|
|
1731
|
+
const isBoolean = function (value) {
|
|
1732
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1733
|
+
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
1734
|
+
};
|
|
1735
|
+
var isBoolean$1 = isBoolean;
|
|
1736
|
+
|
|
1737
|
+
const isFunction = value => "function" == typeof value;
|
|
1738
|
+
var isFunction$1 = isFunction;
|
|
1739
|
+
|
|
1740
|
+
const isNil = value => null == value;
|
|
1741
|
+
var isNil$1 = isNil;
|
|
1742
|
+
|
|
1743
|
+
const isValid = value => null != value;
|
|
1744
|
+
var isValid$1 = isValid;
|
|
1745
|
+
|
|
1746
|
+
const isObject = value => {
|
|
1747
|
+
const type = typeof value;
|
|
1748
|
+
return null !== value && "object" === type || "function" === type;
|
|
1749
|
+
};
|
|
1750
|
+
var isObject$1 = isObject;
|
|
1751
|
+
|
|
1752
|
+
const isObjectLike = value => "object" == typeof value && null !== value;
|
|
1753
|
+
var isObjectLike$1 = isObjectLike;
|
|
1754
|
+
|
|
1755
|
+
const isPlainObject = function (value) {
|
|
1756
|
+
if (!isObjectLike$1(value) || !isType$1(value, "Object")) return !1;
|
|
1757
|
+
if (null === Object.getPrototypeOf(value)) return !0;
|
|
1758
|
+
let proto = value;
|
|
1759
|
+
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
1760
|
+
return Object.getPrototypeOf(value) === proto;
|
|
1761
|
+
};
|
|
1762
|
+
var isPlainObject$1 = isPlainObject;
|
|
1763
|
+
|
|
1764
|
+
const isString = function (value) {
|
|
1765
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1766
|
+
const type = typeof value;
|
|
1767
|
+
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
1768
|
+
};
|
|
1769
|
+
var isString$1 = isString;
|
|
1770
|
+
|
|
1771
|
+
const isArray = value => Array.isArray ? Array.isArray(value) : isType$1(value, "Array");
|
|
1772
|
+
var isArray$1 = isArray;
|
|
1773
|
+
|
|
1774
|
+
const isArrayLike = function (value) {
|
|
1775
|
+
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
1776
|
+
};
|
|
1777
|
+
var isArrayLike$1 = isArrayLike;
|
|
1778
|
+
|
|
1779
|
+
const isNumber = function (value) {
|
|
1780
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1781
|
+
const type = typeof value;
|
|
1782
|
+
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
1783
|
+
};
|
|
1784
|
+
var isNumber$1 = isNumber;
|
|
1785
|
+
|
|
1786
|
+
const isValidNumber = value => isNumber$1(value) && Number.isFinite(value);
|
|
1787
|
+
var isValidNumber$1 = isValidNumber;
|
|
1788
|
+
|
|
1789
|
+
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
1790
|
+
var isValidUrl$1 = isValidUrl;
|
|
1791
|
+
|
|
1792
|
+
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);
|
|
1793
|
+
var isBase64$1 = isBase64;
|
|
1794
|
+
|
|
1795
|
+
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
1796
|
+
var getType$1 = getType;
|
|
1797
|
+
|
|
1798
|
+
const objectProto = Object.prototype,
|
|
1799
|
+
isPrototype = function (value) {
|
|
1800
|
+
const Ctor = value && value.constructor;
|
|
1801
|
+
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
|
|
1802
|
+
};
|
|
1803
|
+
var isPrototype$1 = isPrototype;
|
|
1804
|
+
|
|
1805
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1806
|
+
function isEmpty(value) {
|
|
1807
|
+
if (isNil$1(value)) return !0;
|
|
1808
|
+
if (isArrayLike$1(value)) return !value.length;
|
|
1809
|
+
const type = getType$1(value);
|
|
1810
|
+
if ("Map" === type || "Set" === type) return !value.size;
|
|
1811
|
+
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
1812
|
+
for (const key in value) if (hasOwnProperty$1.call(value, key)) return !1;
|
|
1813
|
+
return !0;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
1817
|
+
has = (object, key) => null != object && hasOwnProperty.call(object, key);
|
|
1818
|
+
var has$1 = has;
|
|
1819
|
+
|
|
1820
|
+
function baseMerge(target, source) {
|
|
1821
|
+
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1822
|
+
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1823
|
+
if (source) {
|
|
1824
|
+
if (target === source) return;
|
|
1825
|
+
if (isValid$1(source) && "object" == typeof source) {
|
|
1826
|
+
const iterable = Object(source),
|
|
1827
|
+
props = [];
|
|
1828
|
+
for (const key in iterable) props.push(key);
|
|
1829
|
+
let {
|
|
1830
|
+
length: length
|
|
1831
|
+
} = props,
|
|
1832
|
+
propIndex = -1;
|
|
1833
|
+
for (; length--;) {
|
|
1834
|
+
const key = props[++propIndex];
|
|
1835
|
+
!isValid$1(iterable[key]) || "object" != typeof iterable[key] || skipTargetArray && isArray$1(target[key]) ? assignMergeValue(target, key, iterable[key]) : baseMergeDeep(target, source, key, shallowArray, skipTargetArray);
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1635
1838
|
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1839
|
+
}
|
|
1840
|
+
function baseMergeDeep(target, source, key) {
|
|
1841
|
+
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
1842
|
+
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
1843
|
+
const objValue = target[key],
|
|
1844
|
+
srcValue = source[key];
|
|
1845
|
+
let newValue = source[key],
|
|
1846
|
+
isCommon = !0;
|
|
1847
|
+
if (isArray$1(srcValue)) {
|
|
1848
|
+
if (shallowArray) newValue = [];else if (isArray$1(objValue)) newValue = objValue;else if (isArrayLike$1(objValue)) {
|
|
1849
|
+
newValue = new Array(objValue.length);
|
|
1850
|
+
let index = -1;
|
|
1851
|
+
const length = objValue.length;
|
|
1852
|
+
for (; ++index < length;) newValue[index] = objValue[index];
|
|
1853
|
+
}
|
|
1854
|
+
} else isPlainObject$1(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
1855
|
+
isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
|
|
1856
|
+
}
|
|
1857
|
+
function assignMergeValue(target, key, value) {
|
|
1858
|
+
(void 0 !== value && !eq(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
1859
|
+
}
|
|
1860
|
+
function eq(value, other) {
|
|
1861
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
1862
|
+
}
|
|
1863
|
+
function merge(target) {
|
|
1864
|
+
let sourceIndex = -1;
|
|
1865
|
+
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
1866
|
+
for (; ++sourceIndex < length;) {
|
|
1867
|
+
baseMerge(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
1638
1868
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1869
|
+
return target;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
function arrayEqual(a, b) {
|
|
1873
|
+
if (!isArray$1(a) || !isArray$1(b)) return !1;
|
|
1874
|
+
if (a.length !== b.length) return !1;
|
|
1875
|
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
1876
|
+
return !0;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
const hasConsole = "undefined" != typeof console;
|
|
1880
|
+
function log(method, level, input) {
|
|
1881
|
+
const args = [level].concat([].slice.call(input));
|
|
1882
|
+
hasConsole && console[method].apply(console, args);
|
|
1883
|
+
}
|
|
1884
|
+
var LoggerLevel;
|
|
1885
|
+
!function (LoggerLevel) {
|
|
1886
|
+
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";
|
|
1887
|
+
}(LoggerLevel || (LoggerLevel = {}));
|
|
1888
|
+
class Logger {
|
|
1889
|
+
static getInstance(level, method) {
|
|
1890
|
+
return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1641
1891
|
}
|
|
1642
|
-
|
|
1643
|
-
return
|
|
1892
|
+
static setInstance(logger) {
|
|
1893
|
+
return Logger._instance = logger;
|
|
1644
1894
|
}
|
|
1645
|
-
|
|
1646
|
-
|
|
1895
|
+
static setInstanceLevel(level) {
|
|
1896
|
+
Logger._instance ? Logger._instance.level(level) : Logger._instance = new Logger(level);
|
|
1647
1897
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
r: r,
|
|
1651
|
-
g: g,
|
|
1652
|
-
b: b
|
|
1653
|
-
} = this.color;
|
|
1654
|
-
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;
|
|
1898
|
+
static clearInstance() {
|
|
1899
|
+
Logger._instance = null;
|
|
1655
1900
|
}
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
b: b
|
|
1661
|
-
} = this.color;
|
|
1662
|
-
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;
|
|
1901
|
+
constructor() {
|
|
1902
|
+
let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
|
|
1903
|
+
let method = arguments.length > 1 ? arguments[1] : undefined;
|
|
1904
|
+
this._onErrorHandler = [], this._level = level, this._method = method;
|
|
1663
1905
|
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1906
|
+
addErrorHandler(handler) {
|
|
1907
|
+
this._onErrorHandler.find(h => h === handler) || this._onErrorHandler.push(handler);
|
|
1666
1908
|
}
|
|
1667
|
-
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1670
|
-
g: g,
|
|
1671
|
-
b: b
|
|
1672
|
-
} = this.color;
|
|
1673
|
-
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;
|
|
1909
|
+
removeErrorHandler(handler) {
|
|
1910
|
+
const index = this._onErrorHandler.findIndex(h => h === handler);
|
|
1911
|
+
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
1674
1912
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1913
|
+
callErrorHandler() {
|
|
1914
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1915
|
+
args[_key] = arguments[_key];
|
|
1916
|
+
}
|
|
1917
|
+
this._onErrorHandler.forEach(h => h(...args));
|
|
1677
1918
|
}
|
|
1678
|
-
|
|
1679
|
-
return
|
|
1919
|
+
canLogInfo() {
|
|
1920
|
+
return this._level >= LoggerLevel.Info;
|
|
1680
1921
|
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
hsl = rgbToHsl(this.color.r, this.color.g, this.color.b),
|
|
1684
|
-
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);
|
|
1685
|
-
return this.color = new RGB(rgb.r, rgb.g, rgb.b, opacity), this;
|
|
1922
|
+
canLogDebug() {
|
|
1923
|
+
return this._level >= LoggerLevel.Debug;
|
|
1686
1924
|
}
|
|
1687
|
-
|
|
1688
|
-
return
|
|
1925
|
+
canLogError() {
|
|
1926
|
+
return this._level >= LoggerLevel.Error;
|
|
1689
1927
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
res = setHex(formatValue, !0);
|
|
1693
|
-
return null != res ? res : this;
|
|
1928
|
+
canLogWarn() {
|
|
1929
|
+
return this._level >= LoggerLevel.Warn;
|
|
1694
1930
|
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
return void 0 !== hex ? this.setHex(hex) : (void 0), this;
|
|
1931
|
+
level(levelValue) {
|
|
1932
|
+
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
1698
1933
|
}
|
|
1699
|
-
|
|
1700
|
-
|
|
1934
|
+
error() {
|
|
1935
|
+
var _a;
|
|
1936
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1937
|
+
args[_key2] = arguments[_key2];
|
|
1938
|
+
}
|
|
1939
|
+
return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler(...args) : log(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
|
|
1701
1940
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1941
|
+
warn() {
|
|
1942
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1943
|
+
args[_key3] = arguments[_key3];
|
|
1944
|
+
}
|
|
1945
|
+
return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
|
|
1705
1946
|
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1947
|
+
info() {
|
|
1948
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
1949
|
+
args[_key4] = arguments[_key4];
|
|
1950
|
+
}
|
|
1951
|
+
return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
|
|
1708
1952
|
}
|
|
1709
|
-
|
|
1710
|
-
|
|
1953
|
+
debug() {
|
|
1954
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
1955
|
+
args[_key5] = arguments[_key5];
|
|
1956
|
+
}
|
|
1957
|
+
return this._level >= LoggerLevel.Debug && log(this._method || "log", "DEBUG", args), this;
|
|
1711
1958
|
}
|
|
1712
|
-
|
|
1713
|
-
|
|
1959
|
+
}
|
|
1960
|
+
Logger._instance = null;
|
|
1961
|
+
|
|
1962
|
+
const clamp = function (input, min, max) {
|
|
1963
|
+
return input < min ? min : input > max ? max : input;
|
|
1964
|
+
};
|
|
1965
|
+
var clamp$1 = clamp;
|
|
1966
|
+
|
|
1967
|
+
const epsilon = 1e-12;
|
|
1968
|
+
const pi = Math.PI;
|
|
1969
|
+
const halfPi$1 = pi / 2;
|
|
1970
|
+
const tau = 2 * pi;
|
|
1971
|
+
const pi2 = 2 * Math.PI;
|
|
1972
|
+
const abs = Math.abs;
|
|
1973
|
+
const atan2 = Math.atan2;
|
|
1974
|
+
const cos = Math.cos;
|
|
1975
|
+
const max = Math.max;
|
|
1976
|
+
const min = Math.min;
|
|
1977
|
+
const sin = Math.sin;
|
|
1978
|
+
const sqrt = Math.sqrt;
|
|
1979
|
+
const pow = Math.pow;
|
|
1980
|
+
function asin(x) {
|
|
1981
|
+
return x >= 1 ? halfPi$1 : x <= -1 ? -halfPi$1 : Math.asin(x);
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
class Point {
|
|
1985
|
+
constructor() {
|
|
1986
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1987
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1988
|
+
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
1989
|
+
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
1990
|
+
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
1714
1991
|
}
|
|
1715
1992
|
clone() {
|
|
1716
|
-
return new
|
|
1717
|
-
}
|
|
1718
|
-
copyGammaToLinear(color) {
|
|
1719
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1720
|
-
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;
|
|
1721
|
-
}
|
|
1722
|
-
copyLinearToGamma(color) {
|
|
1723
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1724
|
-
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
1725
|
-
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;
|
|
1993
|
+
return new Point(this.x, this.y);
|
|
1726
1994
|
}
|
|
1727
|
-
|
|
1728
|
-
return this.
|
|
1995
|
+
copyFrom(p) {
|
|
1996
|
+
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;
|
|
1729
1997
|
}
|
|
1730
|
-
|
|
1731
|
-
return this.
|
|
1998
|
+
set(x, y) {
|
|
1999
|
+
return this.x = x, this.y = y, this;
|
|
1732
2000
|
}
|
|
1733
|
-
|
|
1734
|
-
return this.
|
|
2001
|
+
add(point) {
|
|
2002
|
+
return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1735
2003
|
}
|
|
1736
|
-
|
|
1737
|
-
return this.
|
|
2004
|
+
sub(point) {
|
|
2005
|
+
return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1738
2006
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
2007
|
+
multi(point) {
|
|
2008
|
+
throw new Error("暂不支持");
|
|
1741
2009
|
}
|
|
1742
|
-
|
|
1743
|
-
|
|
2010
|
+
div(point) {
|
|
2011
|
+
throw new Error("暂不支持");
|
|
1744
2012
|
}
|
|
1745
2013
|
}
|
|
1746
|
-
class
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
}
|
|
1750
|
-
formatHex() {
|
|
1751
|
-
return `#${hex(this.r) + hex(this.g) + hex(this.b) + (1 === this.opacity ? "" : hex(255 * this.opacity))}`;
|
|
2014
|
+
class PointService {
|
|
2015
|
+
static distancePP(p1, p2) {
|
|
2016
|
+
return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
|
|
1752
2017
|
}
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
return `${1 === opacity ? "rgb(" : "rgba("}${this.r},${this.g},${this.b}${1 === opacity ? ")" : `,${opacity})`}`;
|
|
2018
|
+
static distanceNN(x, y, x1, y1) {
|
|
2019
|
+
return sqrt(pow(x - x1, 2) + pow(y - y1, 2));
|
|
1756
2020
|
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
{
|
|
1760
|
-
h: h,
|
|
1761
|
-
s: s,
|
|
1762
|
-
l: l
|
|
1763
|
-
} = rgbToHsl(this.r, this.g, this.b);
|
|
1764
|
-
return `${1 === opacity ? "hsl(" : "hsla("}${h},${s}%,${l}%${1 === opacity ? ")" : `,${opacity})`}`;
|
|
2021
|
+
static distancePN(point, x, y) {
|
|
2022
|
+
return sqrt(pow(x - point.x, 2) + pow(y - point.y, 2));
|
|
1765
2023
|
}
|
|
1766
|
-
|
|
1767
|
-
return
|
|
2024
|
+
static pointAtPP(p1, p2, t) {
|
|
2025
|
+
return new Point((p2.x - p1.x) * t + p1.x, (p2.y - p1.y) * t + p1.y);
|
|
1768
2026
|
}
|
|
1769
2027
|
}
|
|
1770
2028
|
|
|
2029
|
+
function degreeToRadian(degree) {
|
|
2030
|
+
return degree * (Math.PI / 180);
|
|
2031
|
+
}
|
|
2032
|
+
function radianToDegree(radian) {
|
|
2033
|
+
return 180 * radian / Math.PI;
|
|
2034
|
+
}
|
|
2035
|
+
const clampRadian = function () {
|
|
2036
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2037
|
+
if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
2038
|
+
return angle;
|
|
2039
|
+
};
|
|
2040
|
+
const clampAngleByRadian = clampRadian;
|
|
2041
|
+
|
|
2042
|
+
var InnerBBox;
|
|
2043
|
+
!function (InnerBBox) {
|
|
2044
|
+
InnerBBox[InnerBBox.NONE = 0] = "NONE", InnerBBox[InnerBBox.BBOX1 = 1] = "BBOX1", InnerBBox[InnerBBox.BBOX2 = 2] = "BBOX2";
|
|
2045
|
+
}(InnerBBox || (InnerBBox = {}));
|
|
2046
|
+
function getProjectionRadius(checkAxis, axis) {
|
|
2047
|
+
return Math.abs(axis[0] * checkAxis[0] + axis[1] * checkAxis[1]);
|
|
2048
|
+
}
|
|
2049
|
+
function rotatePoint(_ref, rad) {
|
|
2050
|
+
let {
|
|
2051
|
+
x: x,
|
|
2052
|
+
y: y
|
|
2053
|
+
} = _ref;
|
|
2054
|
+
let origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
2055
|
+
x: 0,
|
|
2056
|
+
y: 0
|
|
2057
|
+
};
|
|
2058
|
+
return {
|
|
2059
|
+
x: (x - origin.x) * Math.cos(rad) - (y - origin.y) * Math.sin(rad) + origin.x,
|
|
2060
|
+
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
2061
|
+
};
|
|
2062
|
+
}
|
|
2063
|
+
function getCenterPoint(box) {
|
|
2064
|
+
return {
|
|
2065
|
+
x: (box.x1 + box.x2) / 2,
|
|
2066
|
+
y: (box.y1 + box.y2) / 2
|
|
2067
|
+
};
|
|
2068
|
+
}
|
|
2069
|
+
function toRect(box, isDeg) {
|
|
2070
|
+
const deg = isDeg ? degreeToRadian(box.angle) : box.angle,
|
|
2071
|
+
cp = getCenterPoint(box);
|
|
2072
|
+
return [rotatePoint({
|
|
2073
|
+
x: box.x1,
|
|
2074
|
+
y: box.y1
|
|
2075
|
+
}, deg, cp), rotatePoint({
|
|
2076
|
+
x: box.x2,
|
|
2077
|
+
y: box.y1
|
|
2078
|
+
}, deg, cp), rotatePoint({
|
|
2079
|
+
x: box.x2,
|
|
2080
|
+
y: box.y2
|
|
2081
|
+
}, deg, cp), rotatePoint({
|
|
2082
|
+
x: box.x1,
|
|
2083
|
+
y: box.y2
|
|
2084
|
+
}, deg, cp)];
|
|
2085
|
+
}
|
|
2086
|
+
function isRotateAABBIntersect(box1, box2) {
|
|
2087
|
+
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
2088
|
+
let ctx = arguments.length > 3 ? arguments[3] : undefined;
|
|
2089
|
+
const rect1 = toRect(box1, isDeg),
|
|
2090
|
+
rect2 = toRect(box2, isDeg),
|
|
2091
|
+
vector = (start, end) => [end.x - start.x, end.y - start.y];
|
|
2092
|
+
ctx && (ctx.save(), ctx.fillStyle = "red", ctx.globalAlpha = .6, rect1.forEach((item, index) => {
|
|
2093
|
+
0 === index ? ctx.moveTo(item.x, item.y) : ctx.lineTo(item.x, item.y);
|
|
2094
|
+
}), ctx.fill(), ctx.restore(), ctx.save(), ctx.fillStyle = "green", ctx.globalAlpha = .6, rect2.forEach((item, index) => {
|
|
2095
|
+
0 === index ? ctx.moveTo(item.x, item.y) : ctx.lineTo(item.x, item.y);
|
|
2096
|
+
}), ctx.fill(), ctx.restore());
|
|
2097
|
+
const p1 = getCenterPoint(box1),
|
|
2098
|
+
p2 = getCenterPoint(box2);
|
|
2099
|
+
ctx && ctx.fillRect(p1.x, p1.y, 2, 2), ctx && ctx.fillRect(p2.x, p2.y, 2, 2);
|
|
2100
|
+
const vp1p2 = vector(p1, p2),
|
|
2101
|
+
AB = vector(rect1[0], rect1[1]),
|
|
2102
|
+
BC = vector(rect1[1], rect1[2]),
|
|
2103
|
+
A1B1 = vector(rect2[0], rect2[1]),
|
|
2104
|
+
B1C1 = vector(rect2[1], rect2[2]),
|
|
2105
|
+
deg11 = isDeg ? degreeToRadian(box1.angle) : box1.angle;
|
|
2106
|
+
let deg12 = isDeg ? degreeToRadian(90 - box1.angle) : box1.angle + halfPi$1;
|
|
2107
|
+
const deg21 = isDeg ? degreeToRadian(box2.angle) : box2.angle;
|
|
2108
|
+
let deg22 = isDeg ? degreeToRadian(90 - box2.angle) : box2.angle + halfPi$1;
|
|
2109
|
+
deg12 > pi2 && (deg12 -= pi2), deg22 > pi2 && (deg22 -= pi2);
|
|
2110
|
+
const isCover = (checkAxisRadius, deg, targetAxis1, targetAxis2) => {
|
|
2111
|
+
const checkAxis = [Math.cos(deg), Math.sin(deg)];
|
|
2112
|
+
return checkAxisRadius + (getProjectionRadius(checkAxis, targetAxis1) + getProjectionRadius(checkAxis, targetAxis2)) / 2 > getProjectionRadius(checkAxis, vp1p2);
|
|
2113
|
+
};
|
|
2114
|
+
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);
|
|
2115
|
+
}
|
|
2116
|
+
|
|
1771
2117
|
function getContextFont(text) {
|
|
1772
2118
|
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1773
2119
|
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -1830,851 +2176,764 @@
|
|
|
1830
2176
|
};
|
|
1831
2177
|
};
|
|
1832
2178
|
|
|
1833
|
-
function
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
if (3 === length) {
|
|
1846
|
-
const [top, horizontal, bottom] = padding;
|
|
1847
|
-
return [top, horizontal, bottom, horizontal];
|
|
1848
|
-
}
|
|
1849
|
-
if (4 === length) return padding;
|
|
2179
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
2180
|
+
const {
|
|
2181
|
+
x1: x1,
|
|
2182
|
+
y1: y1,
|
|
2183
|
+
x2: x2,
|
|
2184
|
+
y2: y2
|
|
2185
|
+
} = bounds;
|
|
2186
|
+
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);
|
|
2187
|
+
}
|
|
2188
|
+
class Bounds {
|
|
2189
|
+
constructor(bounds) {
|
|
2190
|
+
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
1850
2191
|
}
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
top = 0,
|
|
1854
|
-
right = 0,
|
|
1855
|
-
bottom = 0,
|
|
1856
|
-
left = 0
|
|
1857
|
-
} = padding;
|
|
1858
|
-
return [top, right, bottom, left];
|
|
2192
|
+
clone() {
|
|
2193
|
+
return new Bounds(this);
|
|
1859
2194
|
}
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
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
|
-
|
|
2195
|
+
clear() {
|
|
2196
|
+
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
2197
|
+
}
|
|
2198
|
+
empty() {
|
|
2199
|
+
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
2200
|
+
}
|
|
2201
|
+
equals(b) {
|
|
2202
|
+
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
2203
|
+
}
|
|
2204
|
+
setValue() {
|
|
2205
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2206
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2207
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2208
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2209
|
+
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
2210
|
+
}
|
|
2211
|
+
set() {
|
|
2212
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2213
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2214
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2215
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2216
|
+
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;
|
|
2217
|
+
}
|
|
2218
|
+
add() {
|
|
2219
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2220
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2221
|
+
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;
|
|
2222
|
+
}
|
|
2223
|
+
expand() {
|
|
2224
|
+
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2225
|
+
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;
|
|
2226
|
+
}
|
|
2227
|
+
round() {
|
|
2228
|
+
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;
|
|
2229
|
+
}
|
|
2230
|
+
translate() {
|
|
2231
|
+
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2232
|
+
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2233
|
+
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
2234
|
+
}
|
|
2235
|
+
rotate() {
|
|
2236
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2237
|
+
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2238
|
+
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2239
|
+
const p = this.rotatedPoints(angle, x, y);
|
|
2240
|
+
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
2241
|
+
}
|
|
2242
|
+
scale() {
|
|
2243
|
+
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2244
|
+
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2245
|
+
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2246
|
+
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2247
|
+
const p = this.scalePoints(sx, sy, x, y);
|
|
2248
|
+
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
2249
|
+
}
|
|
2250
|
+
union(b) {
|
|
2251
|
+
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;
|
|
2252
|
+
}
|
|
2253
|
+
intersect(b) {
|
|
2254
|
+
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;
|
|
2255
|
+
}
|
|
2256
|
+
encloses(b) {
|
|
2257
|
+
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
2258
|
+
}
|
|
2259
|
+
alignsWith(b) {
|
|
2260
|
+
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
2261
|
+
}
|
|
2262
|
+
intersects(b) {
|
|
2263
|
+
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
2264
|
+
}
|
|
2265
|
+
contains() {
|
|
2266
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2267
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2268
|
+
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
2269
|
+
}
|
|
2270
|
+
containsPoint(p) {
|
|
2271
|
+
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
2272
|
+
}
|
|
2273
|
+
width() {
|
|
2274
|
+
return this.empty() ? 0 : this.x2 - this.x1;
|
|
2275
|
+
}
|
|
2276
|
+
height() {
|
|
2277
|
+
return this.empty() ? 0 : this.y2 - this.y1;
|
|
2278
|
+
}
|
|
2279
|
+
scaleX() {
|
|
2280
|
+
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2281
|
+
return this.x1 *= s, this.x2 *= s, this;
|
|
2282
|
+
}
|
|
2283
|
+
scaleY() {
|
|
2284
|
+
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2285
|
+
return this.y1 *= s, this.y2 *= s, this;
|
|
2286
|
+
}
|
|
2287
|
+
transformWithMatrix(matrix) {
|
|
2288
|
+
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
2289
|
+
}
|
|
2290
|
+
copy(b) {
|
|
2291
|
+
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
2292
|
+
}
|
|
2293
|
+
rotatedPoints(angle, x, y) {
|
|
2294
|
+
const {
|
|
2295
|
+
x1: x1,
|
|
2296
|
+
y1: y1,
|
|
2297
|
+
x2: x2,
|
|
2298
|
+
y2: y2
|
|
2299
|
+
} = this,
|
|
2300
|
+
cos = Math.cos(angle),
|
|
2301
|
+
sin = Math.sin(angle),
|
|
2302
|
+
cx = x - x * cos + y * sin,
|
|
2303
|
+
cy = y - x * sin - y * cos;
|
|
2304
|
+
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];
|
|
2305
|
+
}
|
|
2306
|
+
scalePoints(sx, sy, x, y) {
|
|
2307
|
+
const {
|
|
2308
|
+
x1: x1,
|
|
2309
|
+
y1: y1,
|
|
2310
|
+
x2: x2,
|
|
2311
|
+
y2: y2
|
|
2312
|
+
} = this;
|
|
2313
|
+
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
1941
2314
|
}
|
|
1942
|
-
reactIs_production_min.ContextConsumer = h;
|
|
1943
|
-
reactIs_production_min.ContextProvider = g;
|
|
1944
|
-
reactIs_production_min.Element = b;
|
|
1945
|
-
reactIs_production_min.ForwardRef = l;
|
|
1946
|
-
reactIs_production_min.Fragment = d;
|
|
1947
|
-
reactIs_production_min.Lazy = q;
|
|
1948
|
-
reactIs_production_min.Memo = p;
|
|
1949
|
-
reactIs_production_min.Portal = c;
|
|
1950
|
-
reactIs_production_min.Profiler = f;
|
|
1951
|
-
reactIs_production_min.StrictMode = e;
|
|
1952
|
-
reactIs_production_min.Suspense = m;
|
|
1953
|
-
reactIs_production_min.SuspenseList = n;
|
|
1954
|
-
reactIs_production_min.isAsyncMode = function () {
|
|
1955
|
-
return !1;
|
|
1956
|
-
};
|
|
1957
|
-
reactIs_production_min.isConcurrentMode = function () {
|
|
1958
|
-
return !1;
|
|
1959
|
-
};
|
|
1960
|
-
reactIs_production_min.isContextConsumer = function (a) {
|
|
1961
|
-
return v(a) === h;
|
|
1962
|
-
};
|
|
1963
|
-
reactIs_production_min.isContextProvider = function (a) {
|
|
1964
|
-
return v(a) === g;
|
|
1965
|
-
};
|
|
1966
|
-
reactIs_production_min.isElement = function (a) {
|
|
1967
|
-
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
1968
|
-
};
|
|
1969
|
-
reactIs_production_min.isForwardRef = function (a) {
|
|
1970
|
-
return v(a) === l;
|
|
1971
|
-
};
|
|
1972
|
-
reactIs_production_min.isFragment = function (a) {
|
|
1973
|
-
return v(a) === d;
|
|
1974
|
-
};
|
|
1975
|
-
reactIs_production_min.isLazy = function (a) {
|
|
1976
|
-
return v(a) === q;
|
|
1977
|
-
};
|
|
1978
|
-
reactIs_production_min.isMemo = function (a) {
|
|
1979
|
-
return v(a) === p;
|
|
1980
|
-
};
|
|
1981
|
-
reactIs_production_min.isPortal = function (a) {
|
|
1982
|
-
return v(a) === c;
|
|
1983
|
-
};
|
|
1984
|
-
reactIs_production_min.isProfiler = function (a) {
|
|
1985
|
-
return v(a) === f;
|
|
1986
|
-
};
|
|
1987
|
-
reactIs_production_min.isStrictMode = function (a) {
|
|
1988
|
-
return v(a) === e;
|
|
1989
|
-
};
|
|
1990
|
-
reactIs_production_min.isSuspense = function (a) {
|
|
1991
|
-
return v(a) === m;
|
|
1992
|
-
};
|
|
1993
|
-
reactIs_production_min.isSuspenseList = function (a) {
|
|
1994
|
-
return v(a) === n;
|
|
1995
|
-
};
|
|
1996
|
-
reactIs_production_min.isValidElementType = function (a) {
|
|
1997
|
-
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;
|
|
1998
|
-
};
|
|
1999
|
-
reactIs_production_min.typeOf = v;
|
|
2000
|
-
return reactIs_production_min;
|
|
2001
2315
|
}
|
|
2002
|
-
|
|
2003
|
-
{
|
|
2004
|
-
|
|
2316
|
+
class AABBBounds extends Bounds {}
|
|
2317
|
+
class OBBBounds extends Bounds {
|
|
2318
|
+
constructor(bounds) {
|
|
2319
|
+
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2320
|
+
super(bounds), bounds && (this.angle = angle);
|
|
2321
|
+
}
|
|
2322
|
+
intersects(b) {
|
|
2323
|
+
return isRotateAABBIntersect(this, b);
|
|
2324
|
+
}
|
|
2325
|
+
setValue() {
|
|
2326
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
2327
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2328
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2329
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2330
|
+
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2331
|
+
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
2332
|
+
}
|
|
2005
2333
|
}
|
|
2006
|
-
var reactIsExports = reactIs.exports;
|
|
2007
|
-
|
|
2008
|
-
const toArray = (children) => {
|
|
2009
|
-
let result = [];
|
|
2010
|
-
React.Children.forEach(children, child => {
|
|
2011
|
-
if (isNil$1(child)) {
|
|
2012
|
-
return;
|
|
2013
|
-
}
|
|
2014
|
-
if (reactIsExports.isFragment(child)) {
|
|
2015
|
-
result = result.concat(toArray(child.props.children));
|
|
2016
|
-
}
|
|
2017
|
-
else {
|
|
2018
|
-
result.push(child);
|
|
2019
|
-
}
|
|
2020
|
-
});
|
|
2021
|
-
return result;
|
|
2022
|
-
};
|
|
2023
|
-
|
|
2024
|
-
const REACT_PRIVATE_PROPS = ['children', 'hooks', 'ref'];
|
|
2025
|
-
|
|
2026
|
-
const EVENT_TYPE = {
|
|
2027
|
-
...vtable.TABLE_EVENT_TYPE,
|
|
2028
|
-
...vtable.PIVOT_TABLE_EVENT_TYPE,
|
|
2029
|
-
...vtable.PIVOT_CHART_EVENT_TYPE
|
|
2030
|
-
};
|
|
2031
|
-
const TABLE_EVENTS = {
|
|
2032
|
-
onClickCell: EVENT_TYPE.CLICK_CELL,
|
|
2033
|
-
onDblClickCell: EVENT_TYPE.DBLCLICK_CELL,
|
|
2034
|
-
onMouseDownCell: EVENT_TYPE.MOUSEDOWN_CELL,
|
|
2035
|
-
onMouseUpCell: EVENT_TYPE.MOUSEUP_CELL,
|
|
2036
|
-
onSelectedCell: EVENT_TYPE.SELECTED_CELL,
|
|
2037
|
-
onSelectedClear: EVENT_TYPE.SELECTED_CLEAR,
|
|
2038
|
-
onKeyDown: EVENT_TYPE.KEYDOWN,
|
|
2039
|
-
onMouseEnterTable: EVENT_TYPE.MOUSEENTER_TABLE,
|
|
2040
|
-
onMouseLeaveTable: EVENT_TYPE.MOUSELEAVE_TABLE,
|
|
2041
|
-
onMouseDownTable: EVENT_TYPE.MOUSEDOWN_TABLE,
|
|
2042
|
-
onMouseMoveCell: EVENT_TYPE.MOUSEMOVE_CELL,
|
|
2043
|
-
onMouseEnterCell: EVENT_TYPE.MOUSEENTER_CELL,
|
|
2044
|
-
onMouseLeaveCell: EVENT_TYPE.MOUSELEAVE_CELL,
|
|
2045
|
-
onContextMenuCell: EVENT_TYPE.CONTEXTMENU_CELL,
|
|
2046
|
-
onResizeColumn: EVENT_TYPE.RESIZE_COLUMN,
|
|
2047
|
-
onResizeColumnEnd: EVENT_TYPE.RESIZE_COLUMN_END,
|
|
2048
|
-
onChangeHeaderPosition: EVENT_TYPE.CHANGE_HEADER_POSITION,
|
|
2049
|
-
onSortClick: EVENT_TYPE.SORT_CLICK,
|
|
2050
|
-
onFreezeClick: EVENT_TYPE.FREEZE_CLICK,
|
|
2051
|
-
onScroll: EVENT_TYPE.SCROLL,
|
|
2052
|
-
onDropdownMenuClick: EVENT_TYPE.DROPDOWN_MENU_CLICK,
|
|
2053
|
-
onMouseOverChartSymbol: EVENT_TYPE.MOUSEOVER_CHART_SYMBOL,
|
|
2054
|
-
onDragSelectEnd: EVENT_TYPE.DRAG_SELECT_END,
|
|
2055
|
-
onDropdownIconClick: EVENT_TYPE.DROPDOWN_ICON_CLICK,
|
|
2056
|
-
onDropdownMenuClear: EVENT_TYPE.DROPDOWN_MENU_CLEAR,
|
|
2057
|
-
onTreeHierarchyStateChange: EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,
|
|
2058
|
-
onShowMenu: EVENT_TYPE.SHOW_MENU,
|
|
2059
|
-
onHideMenu: EVENT_TYPE.HIDE_MENU,
|
|
2060
|
-
onIconClick: EVENT_TYPE.ICON_CLICK,
|
|
2061
|
-
onLegendItemClick: EVENT_TYPE.LEGEND_ITEM_CLICK,
|
|
2062
|
-
onLegendItemHover: EVENT_TYPE.LEGEND_ITEM_HOVER,
|
|
2063
|
-
onLegendItemUnHover: EVENT_TYPE.LEGEND_ITEM_UNHOVER,
|
|
2064
|
-
onLegendChange: EVENT_TYPE.LEGEND_CHANGE,
|
|
2065
|
-
onMouseEnterAxis: EVENT_TYPE.MOUSEENTER_AXIS,
|
|
2066
|
-
onMouseLeaveAxis: EVENT_TYPE.MOUSELEAVE_AXIS,
|
|
2067
|
-
onCheckboxStateChange: EVENT_TYPE.CHECKBOX_STATE_CHANGE,
|
|
2068
|
-
onRadioStateChange: EVENT_TYPE.RADIO_STATE_CHANGE,
|
|
2069
|
-
onAfterRender: EVENT_TYPE.AFTER_RENDER,
|
|
2070
|
-
onInitialized: EVENT_TYPE.INITIALIZED,
|
|
2071
|
-
onPivotSortClick: EVENT_TYPE.PIVOT_SORT_CLICK,
|
|
2072
|
-
onDrillMenuClick: EVENT_TYPE.DRILLMENU_CLICK,
|
|
2073
|
-
onVChartEventType: EVENT_TYPE.VCHART_EVENT_TYPE,
|
|
2074
|
-
onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
2075
|
-
onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
|
|
2076
|
-
onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
|
|
2077
|
-
onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
|
|
2078
|
-
onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
|
|
2079
|
-
onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END
|
|
2080
|
-
};
|
|
2081
|
-
const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
|
|
2082
|
-
const findEventProps = (props, supportedEvents = TABLE_EVENTS) => {
|
|
2083
|
-
const result = {};
|
|
2084
|
-
Object.keys(props).forEach(key => {
|
|
2085
|
-
if (supportedEvents[key] && props[key]) {
|
|
2086
|
-
result[key] = props[key];
|
|
2087
|
-
}
|
|
2088
|
-
});
|
|
2089
|
-
return result;
|
|
2090
|
-
};
|
|
2091
|
-
const bindEventsToTable = (table, newProps, prevProps, supportedEvents = TABLE_EVENTS) => {
|
|
2092
|
-
if ((!newProps && !prevProps) || !table) {
|
|
2093
|
-
return false;
|
|
2094
|
-
}
|
|
2095
|
-
const prevEventProps = prevProps ? findEventProps(prevProps, supportedEvents) : null;
|
|
2096
|
-
const newEventProps = newProps ? findEventProps(newProps, supportedEvents) : null;
|
|
2097
|
-
if (prevEventProps) {
|
|
2098
|
-
Object.keys(prevEventProps).forEach(eventKey => {
|
|
2099
|
-
if (!newEventProps ||
|
|
2100
|
-
!newEventProps[eventKey] ||
|
|
2101
|
-
newEventProps[eventKey] !== prevEventProps[eventKey]) {
|
|
2102
|
-
table.off(supportedEvents[eventKey], prevProps[eventKey]);
|
|
2103
|
-
}
|
|
2104
|
-
});
|
|
2105
|
-
}
|
|
2106
|
-
if (newEventProps) {
|
|
2107
|
-
Object.keys(newEventProps).forEach(eventKey => {
|
|
2108
|
-
if (!prevEventProps ||
|
|
2109
|
-
!prevEventProps[eventKey] ||
|
|
2110
|
-
prevEventProps[eventKey] !== newEventProps[eventKey]) {
|
|
2111
|
-
table.on(supportedEvents[eventKey], newEventProps[eventKey]);
|
|
2112
|
-
}
|
|
2113
|
-
});
|
|
2114
|
-
}
|
|
2115
|
-
return true;
|
|
2116
|
-
};
|
|
2117
2334
|
|
|
2118
|
-
class
|
|
2119
|
-
|
|
2120
|
-
|
|
2335
|
+
class Matrix {
|
|
2336
|
+
constructor() {
|
|
2337
|
+
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2338
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2339
|
+
let c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2340
|
+
let d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2341
|
+
let e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2342
|
+
let f = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
2343
|
+
this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f;
|
|
2344
|
+
}
|
|
2345
|
+
equalToMatrix(m2) {
|
|
2346
|
+
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);
|
|
2347
|
+
}
|
|
2348
|
+
equalTo(a, b, c, d, e, f) {
|
|
2349
|
+
return !(this.e !== e || this.f !== f || this.a !== a || this.d !== d || this.b !== b || this.c !== c);
|
|
2350
|
+
}
|
|
2351
|
+
setValue(a, b, c, d, e, f) {
|
|
2352
|
+
return this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f, this;
|
|
2353
|
+
}
|
|
2354
|
+
reset() {
|
|
2355
|
+
return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.e = 0, this.f = 0, this;
|
|
2356
|
+
}
|
|
2357
|
+
getInverse() {
|
|
2358
|
+
const a = this.a,
|
|
2359
|
+
b = this.b,
|
|
2360
|
+
c = this.c,
|
|
2361
|
+
d = this.d,
|
|
2362
|
+
e = this.e,
|
|
2363
|
+
f = this.f,
|
|
2364
|
+
m = new Matrix(),
|
|
2365
|
+
dt = a * d - b * c;
|
|
2366
|
+
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;
|
|
2367
|
+
}
|
|
2368
|
+
rotate(rad) {
|
|
2369
|
+
const c = Math.cos(rad),
|
|
2370
|
+
s = Math.sin(rad),
|
|
2371
|
+
m11 = this.a * c + this.c * s,
|
|
2372
|
+
m12 = this.b * c + this.d * s,
|
|
2373
|
+
m21 = this.a * -s + this.c * c,
|
|
2374
|
+
m22 = this.b * -s + this.d * c;
|
|
2375
|
+
return this.a = m11, this.b = m12, this.c = m21, this.d = m22, this;
|
|
2376
|
+
}
|
|
2377
|
+
rotateByCenter(rad, cx, cy) {
|
|
2378
|
+
const cos = Math.cos(rad),
|
|
2379
|
+
sin = Math.sin(rad),
|
|
2380
|
+
rotateM13 = (1 - cos) * cx + sin * cy,
|
|
2381
|
+
rotateM23 = (1 - cos) * cy - sin * cx,
|
|
2382
|
+
m11 = cos * this.a - sin * this.b,
|
|
2383
|
+
m21 = sin * this.a + cos * this.b,
|
|
2384
|
+
m12 = cos * this.c - sin * this.d,
|
|
2385
|
+
m22 = sin * this.c + cos * this.d,
|
|
2386
|
+
m13 = cos * this.e - sin * this.f + rotateM13,
|
|
2387
|
+
m23 = sin * this.e + cos * this.f + rotateM23;
|
|
2388
|
+
return this.a = m11, this.b = m21, this.c = m12, this.d = m22, this.e = m13, this.f = m23, this;
|
|
2389
|
+
}
|
|
2390
|
+
scale(sx, sy) {
|
|
2391
|
+
return this.a *= sx, this.b *= sx, this.c *= sy, this.d *= sy, this;
|
|
2392
|
+
}
|
|
2393
|
+
setScale(sx, sy) {
|
|
2394
|
+
return this.b = this.b / this.a * sx, this.c = this.c / this.d * sy, this.a = sx, this.d = sy, this;
|
|
2395
|
+
}
|
|
2396
|
+
transform(a, b, c, d, e, f) {
|
|
2397
|
+
return this.multiply(a, b, c, d, e, f), this;
|
|
2398
|
+
}
|
|
2399
|
+
translate(x, y) {
|
|
2400
|
+
return this.e += this.a * x + this.c * y, this.f += this.b * x + this.d * y, this;
|
|
2401
|
+
}
|
|
2402
|
+
transpose() {
|
|
2403
|
+
const {
|
|
2404
|
+
a: a,
|
|
2405
|
+
b: b,
|
|
2406
|
+
c: c,
|
|
2407
|
+
d: d,
|
|
2408
|
+
e: e,
|
|
2409
|
+
f: f
|
|
2410
|
+
} = this;
|
|
2411
|
+
return this.a = b, this.b = a, this.c = d, this.d = c, this.e = f, this.f = e, this;
|
|
2412
|
+
}
|
|
2413
|
+
multiply(a2, b2, c2, d2, e2, f2) {
|
|
2414
|
+
const a1 = this.a,
|
|
2415
|
+
b1 = this.b,
|
|
2416
|
+
c1 = this.c,
|
|
2417
|
+
d1 = this.d,
|
|
2418
|
+
m11 = a1 * a2 + c1 * b2,
|
|
2419
|
+
m12 = b1 * a2 + d1 * b2,
|
|
2420
|
+
m21 = a1 * c2 + c1 * d2,
|
|
2421
|
+
m22 = b1 * c2 + d1 * d2,
|
|
2422
|
+
dx = a1 * e2 + c1 * f2 + this.e,
|
|
2423
|
+
dy = b1 * e2 + d1 * f2 + this.f;
|
|
2424
|
+
return this.a = m11, this.b = m12, this.c = m21, this.d = m22, this.e = dx, this.f = dy, this;
|
|
2121
2425
|
}
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
class ContainerModule {
|
|
2126
|
-
constructor(registry) {
|
|
2127
|
-
this.id = Generator.GenAutoIncrementId(), this.registry = registry;
|
|
2426
|
+
interpolate(m2, t) {
|
|
2427
|
+
const m = new Matrix();
|
|
2428
|
+
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;
|
|
2128
2429
|
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2430
|
+
transformPoint(source, target) {
|
|
2431
|
+
const {
|
|
2432
|
+
a: a,
|
|
2433
|
+
b: b,
|
|
2434
|
+
c: c,
|
|
2435
|
+
d: d,
|
|
2436
|
+
e: e,
|
|
2437
|
+
f: f
|
|
2438
|
+
} = this,
|
|
2439
|
+
dt = a * d - b * c,
|
|
2440
|
+
nextA = d / dt,
|
|
2441
|
+
nextB = -b / dt,
|
|
2442
|
+
nextC = -c / dt,
|
|
2443
|
+
nextD = a / dt,
|
|
2444
|
+
nextE = (c * f - d * e) / dt,
|
|
2445
|
+
nextF = -(a * f - b * e) / dt,
|
|
2446
|
+
{
|
|
2447
|
+
x: x,
|
|
2448
|
+
y: y
|
|
2449
|
+
} = source;
|
|
2450
|
+
target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
|
|
2140
2451
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2452
|
+
onlyTranslate() {
|
|
2453
|
+
let scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2454
|
+
return this.a === scale && 0 === this.b && 0 === this.c && this.d === scale;
|
|
2455
|
+
}
|
|
2456
|
+
clone() {
|
|
2457
|
+
return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
|
|
2458
|
+
}
|
|
2459
|
+
toTransformAttrs() {
|
|
2460
|
+
const a = this.a,
|
|
2461
|
+
b = this.b,
|
|
2462
|
+
c = this.c,
|
|
2463
|
+
d = this.d,
|
|
2464
|
+
delta = a * d - b * c,
|
|
2465
|
+
result = {
|
|
2466
|
+
x: this.e,
|
|
2467
|
+
y: this.f,
|
|
2468
|
+
rotateDeg: 0,
|
|
2469
|
+
scaleX: 0,
|
|
2470
|
+
scaleY: 0,
|
|
2471
|
+
skewX: 0,
|
|
2472
|
+
skewY: 0
|
|
2473
|
+
};
|
|
2474
|
+
if (0 !== a || 0 !== b) {
|
|
2475
|
+
const r = Math.sqrt(a * a + b * b);
|
|
2476
|
+
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;
|
|
2477
|
+
} else if (0 !== c || 0 !== d) {
|
|
2478
|
+
const s = Math.sqrt(c * c + d * d);
|
|
2479
|
+
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;
|
|
2480
|
+
}
|
|
2481
|
+
return result.rotateDeg = radianToDegree(result.rotateDeg), result;
|
|
2143
2482
|
}
|
|
2144
2483
|
}
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
if (!IsObject(target)) throw new TypeError();
|
|
2164
|
-
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
2165
|
-
}
|
|
2166
|
-
function getMetadata(metadataKey, target, propertyKey) {
|
|
2167
|
-
if (!IsObject(target)) throw new TypeError();
|
|
2168
|
-
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
2169
|
-
}
|
|
2170
|
-
function GetOrCreateMetadataMap(O, P, Create) {
|
|
2171
|
-
let targetMetadata = Metadata.get(O);
|
|
2172
|
-
if (IsUndefined(targetMetadata)) {
|
|
2173
|
-
if (!Create) return;
|
|
2174
|
-
targetMetadata = new _Map(), Metadata.set(O, targetMetadata);
|
|
2175
|
-
}
|
|
2176
|
-
let metadataMap = targetMetadata.get(P);
|
|
2177
|
-
if (IsUndefined(metadataMap)) {
|
|
2178
|
-
if (!Create) return;
|
|
2179
|
-
metadataMap = new _Map(), targetMetadata.set(P, metadataMap);
|
|
2180
|
-
}
|
|
2181
|
-
return metadataMap;
|
|
2182
|
-
}
|
|
2183
|
-
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
2184
|
-
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return !0;
|
|
2185
|
-
const parent = OrdinaryGetPrototypeOf(O);
|
|
2186
|
-
return !IsNull(parent) && OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
2187
|
-
}
|
|
2188
|
-
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
2189
|
-
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
2190
|
-
return !IsUndefined(metadataMap) && ToBoolean(metadataMap.has(MetadataKey));
|
|
2191
|
-
}
|
|
2192
|
-
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
2193
|
-
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
2194
|
-
const parent = OrdinaryGetPrototypeOf(O);
|
|
2195
|
-
return IsNull(parent) ? void 0 : OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
2196
|
-
}
|
|
2197
|
-
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
2198
|
-
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
2199
|
-
if (!IsUndefined(metadataMap)) return metadataMap.get(MetadataKey);
|
|
2200
|
-
}
|
|
2201
|
-
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
2202
|
-
GetOrCreateMetadataMap(O, P, !0).set(MetadataKey, MetadataValue);
|
|
2203
|
-
}
|
|
2204
|
-
function Type(x) {
|
|
2205
|
-
if (null === x) return 1;
|
|
2206
|
-
switch (typeof x) {
|
|
2207
|
-
case "undefined":
|
|
2208
|
-
return 0;
|
|
2209
|
-
case "boolean":
|
|
2210
|
-
return 2;
|
|
2211
|
-
case "string":
|
|
2212
|
-
return 3;
|
|
2213
|
-
case "symbol":
|
|
2214
|
-
return 4;
|
|
2215
|
-
case "number":
|
|
2216
|
-
return 5;
|
|
2217
|
-
case "object":
|
|
2218
|
-
return null === x ? 1 : 6;
|
|
2219
|
-
default:
|
|
2220
|
-
return 6;
|
|
2221
|
-
}
|
|
2222
|
-
}
|
|
2223
|
-
function IsUndefined(x) {
|
|
2224
|
-
return void 0 === x;
|
|
2225
|
-
}
|
|
2226
|
-
function IsNull(x) {
|
|
2227
|
-
return null === x;
|
|
2228
|
-
}
|
|
2229
|
-
function IsSymbol(x) {
|
|
2230
|
-
return "symbol" == typeof x;
|
|
2231
|
-
}
|
|
2232
|
-
function IsObject(x) {
|
|
2233
|
-
return "object" == typeof x ? null !== x : "function" == typeof x;
|
|
2234
|
-
}
|
|
2235
|
-
function ToPrimitive(input, PreferredType) {
|
|
2236
|
-
switch (Type(input)) {
|
|
2237
|
-
case 0:
|
|
2238
|
-
case 1:
|
|
2239
|
-
case 2:
|
|
2240
|
-
case 3:
|
|
2241
|
-
case 4:
|
|
2242
|
-
case 5:
|
|
2243
|
-
return input;
|
|
2244
|
-
}
|
|
2245
|
-
const hint = 3 === PreferredType ? "string" : 5 === PreferredType ? "number" : "default",
|
|
2246
|
-
exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
2247
|
-
if (void 0 !== exoticToPrim) {
|
|
2248
|
-
const result = exoticToPrim.call(input, hint);
|
|
2249
|
-
if (IsObject(result)) throw new TypeError();
|
|
2250
|
-
return result;
|
|
2251
|
-
}
|
|
2252
|
-
return OrdinaryToPrimitive(input, "default" === hint ? "number" : hint);
|
|
2253
|
-
}
|
|
2254
|
-
function OrdinaryToPrimitive(O, hint) {
|
|
2255
|
-
if ("string" === hint) {
|
|
2256
|
-
const toString_1 = O.toString;
|
|
2257
|
-
if (IsCallable(toString_1)) {
|
|
2258
|
-
const result = toString_1.call(O);
|
|
2259
|
-
if (!IsObject(result)) return result;
|
|
2260
|
-
}
|
|
2261
|
-
const valueOf = O.valueOf;
|
|
2262
|
-
if (IsCallable(valueOf)) {
|
|
2263
|
-
const result = valueOf.call(O);
|
|
2264
|
-
if (!IsObject(result)) return result;
|
|
2265
|
-
}
|
|
2266
|
-
} else {
|
|
2267
|
-
const valueOf = O.valueOf;
|
|
2268
|
-
if (IsCallable(valueOf)) {
|
|
2269
|
-
const result = valueOf.call(O);
|
|
2270
|
-
if (!IsObject(result)) return result;
|
|
2271
|
-
}
|
|
2272
|
-
const toString_2 = O.toString;
|
|
2273
|
-
if (IsCallable(toString_2)) {
|
|
2274
|
-
const result = toString_2.call(O);
|
|
2275
|
-
if (!IsObject(result)) return result;
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
throw new TypeError();
|
|
2279
|
-
}
|
|
2280
|
-
function ToBoolean(argument) {
|
|
2281
|
-
return !!argument;
|
|
2282
|
-
}
|
|
2283
|
-
function ToString(argument) {
|
|
2284
|
-
return "" + argument;
|
|
2285
|
-
}
|
|
2286
|
-
function ToPropertyKey(argument) {
|
|
2287
|
-
const key = ToPrimitive(argument, 3);
|
|
2288
|
-
return IsSymbol(key) ? key : ToString(key);
|
|
2289
|
-
}
|
|
2290
|
-
function IsCallable(argument) {
|
|
2291
|
-
return "function" == typeof argument;
|
|
2292
|
-
}
|
|
2293
|
-
function GetMethod(V, P) {
|
|
2294
|
-
const func = V[P];
|
|
2295
|
-
if (null != func) {
|
|
2296
|
-
if (!IsCallable(func)) throw new TypeError();
|
|
2297
|
-
return func;
|
|
2298
|
-
}
|
|
2299
|
-
}
|
|
2300
|
-
function OrdinaryGetPrototypeOf(O) {
|
|
2301
|
-
const proto = Object.getPrototypeOf(O);
|
|
2302
|
-
if ("function" != typeof O || O === functionPrototype) return proto;
|
|
2303
|
-
if (proto !== functionPrototype) return proto;
|
|
2304
|
-
const prototype = O.prototype,
|
|
2305
|
-
prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
2306
|
-
if (null == prototypeProto || prototypeProto === Object.prototype) return proto;
|
|
2307
|
-
const constructor = prototypeProto.constructor;
|
|
2308
|
-
return "function" != typeof constructor || constructor === O ? proto : constructor;
|
|
2309
|
-
}
|
|
2310
|
-
exporter("defineMetadata", defineMetadata), exporter("hasMetadata", hasMetadata), exporter("hasOwnMetadata", hasOwnMetadata), exporter("getMetadata", getMetadata);
|
|
2311
|
-
}((target = Reflect, function (key, value) {
|
|
2312
|
-
"function" != typeof target[key] && Object.defineProperty(target, key, {
|
|
2313
|
-
configurable: !0,
|
|
2314
|
-
writable: !0,
|
|
2315
|
-
value: value
|
|
2316
|
-
});
|
|
2317
|
-
})), Reflect;
|
|
2318
|
-
})({});
|
|
2319
|
-
|
|
2320
|
-
function _tagParameterOrProperty(metadataKey, annotationTarget, key, metadata) {
|
|
2321
|
-
const metadatas = [metadata];
|
|
2322
|
-
let paramsOrPropertiesMetadata = {};
|
|
2323
|
-
Reflect$1.hasOwnMetadata(metadataKey, annotationTarget) && (paramsOrPropertiesMetadata = Reflect$1.getMetadata(metadataKey, annotationTarget));
|
|
2324
|
-
let paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
|
|
2325
|
-
void 0 === paramOrPropertyMetadata && (paramOrPropertyMetadata = []), paramOrPropertyMetadata.push(...metadatas), paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata, Reflect$1.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
|
|
2326
|
-
}
|
|
2327
|
-
function tagParameter(annotationTarget, parameterName, parameterIndex, metadata) {
|
|
2328
|
-
_tagParameterOrProperty(TAGGED, annotationTarget, parameterIndex.toString(), metadata);
|
|
2329
|
-
}
|
|
2330
|
-
function createTaggedDecorator(metadata) {
|
|
2331
|
-
return (target, targetKey, indexOrPropertyDescriptor) => {
|
|
2332
|
-
tagParameter(target, targetKey, indexOrPropertyDescriptor, metadata);
|
|
2333
|
-
};
|
|
2334
|
-
}
|
|
2335
|
-
function injectBase(metadataKey) {
|
|
2336
|
-
return serviceIdentifier => (target, targetKey, indexOrPropertyDescriptor) => createTaggedDecorator(new Metadata(metadataKey, serviceIdentifier))(target, targetKey, indexOrPropertyDescriptor);
|
|
2484
|
+
function normalTransform(out, origin, x, y, scaleX, scaleY, angle, rotateCenter) {
|
|
2485
|
+
const oa = origin.a,
|
|
2486
|
+
ob = origin.b,
|
|
2487
|
+
oc = origin.c,
|
|
2488
|
+
od = origin.d,
|
|
2489
|
+
oe = origin.e,
|
|
2490
|
+
of = origin.f,
|
|
2491
|
+
cosTheta = cos(angle),
|
|
2492
|
+
sinTheta = sin(angle);
|
|
2493
|
+
let rotateCenterX, rotateCenterY;
|
|
2494
|
+
rotateCenter ? (rotateCenterX = rotateCenter[0], rotateCenterY = rotateCenter[1]) : (rotateCenterX = x, rotateCenterY = y);
|
|
2495
|
+
const offsetX = rotateCenterX - x,
|
|
2496
|
+
offsetY = rotateCenterY - y,
|
|
2497
|
+
a1 = oa * cosTheta + oc * sinTheta,
|
|
2498
|
+
b1 = ob * cosTheta + od * sinTheta,
|
|
2499
|
+
c1 = oc * cosTheta - oa * sinTheta,
|
|
2500
|
+
d1 = od * cosTheta - ob * sinTheta;
|
|
2501
|
+
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;
|
|
2337
2502
|
}
|
|
2338
2503
|
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2504
|
+
function hslToRgb(h, s, l) {
|
|
2505
|
+
s /= 100, l /= 100;
|
|
2506
|
+
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
2507
|
+
x = c * (1 - Math.abs(h / 60 % 2 - 1)),
|
|
2508
|
+
m = l - c / 2;
|
|
2509
|
+
let r = 0,
|
|
2510
|
+
g = 0,
|
|
2511
|
+
b = 0;
|
|
2512
|
+
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)), {
|
|
2513
|
+
r: r,
|
|
2514
|
+
g: g,
|
|
2515
|
+
b: b
|
|
2344
2516
|
};
|
|
2345
2517
|
}
|
|
2346
2518
|
|
|
2347
|
-
function
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
Factory: "Factory",
|
|
2360
|
-
Function: "Function",
|
|
2361
|
-
Instance: "Instance",
|
|
2362
|
-
Invalid: "Invalid",
|
|
2363
|
-
Provider: "Provider"
|
|
2519
|
+
function rgbToHsl(r, g, b) {
|
|
2520
|
+
r /= 255, g /= 255, b /= 255;
|
|
2521
|
+
const cMin = Math.min(r, g, b),
|
|
2522
|
+
cMax = Math.max(r, g, b),
|
|
2523
|
+
delta = cMax - cMin;
|
|
2524
|
+
let h = 0,
|
|
2525
|
+
s = 0,
|
|
2526
|
+
l = 0;
|
|
2527
|
+
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), {
|
|
2528
|
+
h: h,
|
|
2529
|
+
s: s,
|
|
2530
|
+
l: l
|
|
2364
2531
|
};
|
|
2365
|
-
|
|
2366
|
-
class Binding {
|
|
2367
|
-
constructor(serviceIdentifier, scope) {
|
|
2368
|
-
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;
|
|
2369
|
-
}
|
|
2370
|
-
clone() {
|
|
2371
|
-
const clone = new Binding(this.serviceIdentifier, this.scope);
|
|
2372
|
-
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;
|
|
2373
|
-
}
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
class MetadataReader {
|
|
2377
|
-
getConstructorMetadata(constructorFunc) {
|
|
2378
|
-
return {
|
|
2379
|
-
compilerGeneratedMetadata: Reflect$1.getMetadata(PARAM_TYPES, constructorFunc),
|
|
2380
|
-
userGeneratedMetadata: Reflect$1.getMetadata(TAGGED, constructorFunc) || {}
|
|
2381
|
-
};
|
|
2382
|
-
}
|
|
2383
|
-
getPropertiesMetadata(constructorFunc) {
|
|
2384
|
-
throw new Error("暂未实现");
|
|
2385
|
-
}
|
|
2386
2532
|
}
|
|
2387
2533
|
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
if (request.key === key && request.value === value) return !0;
|
|
2392
|
-
if (null == request.constructorArgsMetadata) return !1;
|
|
2393
|
-
const constructorArgsMetadata = request.constructorArgsMetadata;
|
|
2394
|
-
for (let i = 0; i < constructorArgsMetadata.length; i++) if (constructorArgsMetadata[i].key === key && constructorArgsMetadata[i].value === value) return !0;
|
|
2395
|
-
return !1;
|
|
2534
|
+
const REG_HEX = /^#([0-9a-f]{3,8})$/,
|
|
2535
|
+
DEFAULT_COLORS_OPACITY = {
|
|
2536
|
+
transparent: 4294967040
|
|
2396
2537
|
};
|
|
2397
|
-
|
|
2538
|
+
const DEFAULT_COLORS = {
|
|
2539
|
+
aliceblue: 15792383,
|
|
2540
|
+
antiquewhite: 16444375,
|
|
2541
|
+
aqua: 65535,
|
|
2542
|
+
aquamarine: 8388564,
|
|
2543
|
+
azure: 15794175,
|
|
2544
|
+
beige: 16119260,
|
|
2545
|
+
bisque: 16770244,
|
|
2546
|
+
black: 0,
|
|
2547
|
+
blanchedalmond: 16772045,
|
|
2548
|
+
blue: 255,
|
|
2549
|
+
blueviolet: 9055202,
|
|
2550
|
+
brown: 10824234,
|
|
2551
|
+
burlywood: 14596231,
|
|
2552
|
+
cadetblue: 6266528,
|
|
2553
|
+
chartreuse: 8388352,
|
|
2554
|
+
chocolate: 13789470,
|
|
2555
|
+
coral: 16744272,
|
|
2556
|
+
cornflowerblue: 6591981,
|
|
2557
|
+
cornsilk: 16775388,
|
|
2558
|
+
crimson: 14423100,
|
|
2559
|
+
cyan: 65535,
|
|
2560
|
+
darkblue: 139,
|
|
2561
|
+
darkcyan: 35723,
|
|
2562
|
+
darkgoldenrod: 12092939,
|
|
2563
|
+
darkgray: 11119017,
|
|
2564
|
+
darkgreen: 25600,
|
|
2565
|
+
darkgrey: 11119017,
|
|
2566
|
+
darkkhaki: 12433259,
|
|
2567
|
+
darkmagenta: 9109643,
|
|
2568
|
+
darkolivegreen: 5597999,
|
|
2569
|
+
darkorange: 16747520,
|
|
2570
|
+
darkorchid: 10040012,
|
|
2571
|
+
darkred: 9109504,
|
|
2572
|
+
darksalmon: 15308410,
|
|
2573
|
+
darkseagreen: 9419919,
|
|
2574
|
+
darkslateblue: 4734347,
|
|
2575
|
+
darkslategray: 3100495,
|
|
2576
|
+
darkslategrey: 3100495,
|
|
2577
|
+
darkturquoise: 52945,
|
|
2578
|
+
darkviolet: 9699539,
|
|
2579
|
+
deeppink: 16716947,
|
|
2580
|
+
deepskyblue: 49151,
|
|
2581
|
+
dimgray: 6908265,
|
|
2582
|
+
dimgrey: 6908265,
|
|
2583
|
+
dodgerblue: 2003199,
|
|
2584
|
+
firebrick: 11674146,
|
|
2585
|
+
floralwhite: 16775920,
|
|
2586
|
+
forestgreen: 2263842,
|
|
2587
|
+
fuchsia: 16711935,
|
|
2588
|
+
gainsboro: 14474460,
|
|
2589
|
+
ghostwhite: 16316671,
|
|
2590
|
+
gold: 16766720,
|
|
2591
|
+
goldenrod: 14329120,
|
|
2592
|
+
gray: 8421504,
|
|
2593
|
+
green: 32768,
|
|
2594
|
+
greenyellow: 11403055,
|
|
2595
|
+
grey: 8421504,
|
|
2596
|
+
honeydew: 15794160,
|
|
2597
|
+
hotpink: 16738740,
|
|
2598
|
+
indianred: 13458524,
|
|
2599
|
+
indigo: 4915330,
|
|
2600
|
+
ivory: 16777200,
|
|
2601
|
+
khaki: 15787660,
|
|
2602
|
+
lavender: 15132410,
|
|
2603
|
+
lavenderblush: 16773365,
|
|
2604
|
+
lawngreen: 8190976,
|
|
2605
|
+
lemonchiffon: 16775885,
|
|
2606
|
+
lightblue: 11393254,
|
|
2607
|
+
lightcoral: 15761536,
|
|
2608
|
+
lightcyan: 14745599,
|
|
2609
|
+
lightgoldenrodyellow: 16448210,
|
|
2610
|
+
lightgray: 13882323,
|
|
2611
|
+
lightgreen: 9498256,
|
|
2612
|
+
lightgrey: 13882323,
|
|
2613
|
+
lightpink: 16758465,
|
|
2614
|
+
lightsalmon: 16752762,
|
|
2615
|
+
lightseagreen: 2142890,
|
|
2616
|
+
lightskyblue: 8900346,
|
|
2617
|
+
lightslategray: 7833753,
|
|
2618
|
+
lightslategrey: 7833753,
|
|
2619
|
+
lightsteelblue: 11584734,
|
|
2620
|
+
lightyellow: 16777184,
|
|
2621
|
+
lime: 65280,
|
|
2622
|
+
limegreen: 3329330,
|
|
2623
|
+
linen: 16445670,
|
|
2624
|
+
magenta: 16711935,
|
|
2625
|
+
maroon: 8388608,
|
|
2626
|
+
mediumaquamarine: 6737322,
|
|
2627
|
+
mediumblue: 205,
|
|
2628
|
+
mediumorchid: 12211667,
|
|
2629
|
+
mediumpurple: 9662683,
|
|
2630
|
+
mediumseagreen: 3978097,
|
|
2631
|
+
mediumslateblue: 8087790,
|
|
2632
|
+
mediumspringgreen: 64154,
|
|
2633
|
+
mediumturquoise: 4772300,
|
|
2634
|
+
mediumvioletred: 13047173,
|
|
2635
|
+
midnightblue: 1644912,
|
|
2636
|
+
mintcream: 16121850,
|
|
2637
|
+
mistyrose: 16770273,
|
|
2638
|
+
moccasin: 16770229,
|
|
2639
|
+
navajowhite: 16768685,
|
|
2640
|
+
navy: 128,
|
|
2641
|
+
oldlace: 16643558,
|
|
2642
|
+
olive: 8421376,
|
|
2643
|
+
olivedrab: 7048739,
|
|
2644
|
+
orange: 16753920,
|
|
2645
|
+
orangered: 16729344,
|
|
2646
|
+
orchid: 14315734,
|
|
2647
|
+
palegoldenrod: 15657130,
|
|
2648
|
+
palegreen: 10025880,
|
|
2649
|
+
paleturquoise: 11529966,
|
|
2650
|
+
palevioletred: 14381203,
|
|
2651
|
+
papayawhip: 16773077,
|
|
2652
|
+
peachpuff: 16767673,
|
|
2653
|
+
peru: 13468991,
|
|
2654
|
+
pink: 16761035,
|
|
2655
|
+
plum: 14524637,
|
|
2656
|
+
powderblue: 11591910,
|
|
2657
|
+
purple: 8388736,
|
|
2658
|
+
rebeccapurple: 6697881,
|
|
2659
|
+
red: 16711680,
|
|
2660
|
+
rosybrown: 12357519,
|
|
2661
|
+
royalblue: 4286945,
|
|
2662
|
+
saddlebrown: 9127187,
|
|
2663
|
+
salmon: 16416882,
|
|
2664
|
+
sandybrown: 16032864,
|
|
2665
|
+
seagreen: 3050327,
|
|
2666
|
+
seashell: 16774638,
|
|
2667
|
+
sienna: 10506797,
|
|
2668
|
+
silver: 12632256,
|
|
2669
|
+
skyblue: 8900331,
|
|
2670
|
+
slateblue: 6970061,
|
|
2671
|
+
slategray: 7372944,
|
|
2672
|
+
slategrey: 7372944,
|
|
2673
|
+
snow: 16775930,
|
|
2674
|
+
springgreen: 65407,
|
|
2675
|
+
steelblue: 4620980,
|
|
2676
|
+
tan: 13808780,
|
|
2677
|
+
teal: 32896,
|
|
2678
|
+
thistle: 14204888,
|
|
2679
|
+
tomato: 16737095,
|
|
2680
|
+
turquoise: 4251856,
|
|
2681
|
+
violet: 15631086,
|
|
2682
|
+
wheat: 16113331,
|
|
2683
|
+
white: 16777215,
|
|
2684
|
+
whitesmoke: 16119285,
|
|
2685
|
+
yellow: 16776960,
|
|
2686
|
+
yellowgreen: 10145074
|
|
2398
2687
|
};
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
class BindingInSyntax {
|
|
2402
|
-
constructor(binding) {
|
|
2403
|
-
this._binding = binding;
|
|
2404
|
-
}
|
|
2405
|
-
inRequestScope() {
|
|
2406
|
-
throw new Error("暂未实现");
|
|
2407
|
-
}
|
|
2408
|
-
inSingletonScope() {
|
|
2409
|
-
return this._binding.scope = BindingScopeEnum.Singleton, this;
|
|
2410
|
-
}
|
|
2411
|
-
inTransientScope() {
|
|
2412
|
-
return this._binding.scope = BindingScopeEnum.Transient, this;
|
|
2413
|
-
}
|
|
2414
|
-
whenTargetNamed(name) {
|
|
2415
|
-
return this._binding.constraint = namedConstraint(name), this;
|
|
2416
|
-
}
|
|
2688
|
+
function hex(value) {
|
|
2689
|
+
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2417
2690
|
}
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2691
|
+
function rgb(value) {
|
|
2692
|
+
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);
|
|
2693
|
+
}
|
|
2694
|
+
function rgba(value) {
|
|
2695
|
+
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);
|
|
2696
|
+
}
|
|
2697
|
+
function SRGBToLinear(c) {
|
|
2698
|
+
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
2699
|
+
}
|
|
2700
|
+
function LinearToSRGB(c) {
|
|
2701
|
+
return c < .0031308 ? 12.92 * c : 1.055 * Math.pow(c, .41666) - .055;
|
|
2702
|
+
}
|
|
2703
|
+
const setHex = (formatValue, forceHex) => {
|
|
2704
|
+
const isHex = REG_HEX.exec(formatValue);
|
|
2705
|
+
if (forceHex || isHex) {
|
|
2706
|
+
const hex = parseInt(isHex[1], 16),
|
|
2707
|
+
hexLength = isHex[1].length;
|
|
2708
|
+
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;
|
|
2425
2709
|
}
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2710
|
+
};
|
|
2711
|
+
class Color {
|
|
2712
|
+
static Brighter(source) {
|
|
2713
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2714
|
+
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
2429
2715
|
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2716
|
+
static SetOpacity(source) {
|
|
2717
|
+
let o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2718
|
+
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
2432
2719
|
}
|
|
2433
|
-
|
|
2434
|
-
|
|
2720
|
+
static getColorBrightness(source) {
|
|
2721
|
+
let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "hsl";
|
|
2722
|
+
const color = source instanceof Color ? source : new Color(source);
|
|
2723
|
+
switch (model) {
|
|
2724
|
+
case "hsv":
|
|
2725
|
+
default:
|
|
2726
|
+
return color.getHSVBrightness();
|
|
2727
|
+
case "hsl":
|
|
2728
|
+
return color.getHSLBrightness();
|
|
2729
|
+
case "lum":
|
|
2730
|
+
return color.getLuminance();
|
|
2731
|
+
case "lum2":
|
|
2732
|
+
return color.getLuminance2();
|
|
2733
|
+
case "lum3":
|
|
2734
|
+
return color.getLuminance3();
|
|
2735
|
+
}
|
|
2435
2736
|
}
|
|
2436
|
-
|
|
2437
|
-
|
|
2737
|
+
static parseColorString(value) {
|
|
2738
|
+
if (isValid$1(DEFAULT_COLORS_OPACITY[value])) return rgba(DEFAULT_COLORS_OPACITY[value]);
|
|
2739
|
+
if (isValid$1(DEFAULT_COLORS[value])) return rgb(DEFAULT_COLORS[value]);
|
|
2740
|
+
const formatValue = `${value}`.trim().toLowerCase(),
|
|
2741
|
+
hexRes = setHex(formatValue);
|
|
2742
|
+
if (void 0 !== hexRes) return hexRes;
|
|
2743
|
+
if (/^(rgb|RGB|rgba|RGBA)/.test(formatValue)) {
|
|
2744
|
+
const aColor = formatValue.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g, "").split(",");
|
|
2745
|
+
return new RGB(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10), parseFloat(aColor[3]));
|
|
2746
|
+
}
|
|
2747
|
+
if (/^(hsl|HSL|hsla|HSLA)/.test(formatValue)) {
|
|
2748
|
+
const aColor = formatValue.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g, "").split(","),
|
|
2749
|
+
rgb = hslToRgb(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10));
|
|
2750
|
+
return new RGB(rgb.r, rgb.g, rgb.b, parseFloat(aColor[3]));
|
|
2751
|
+
}
|
|
2438
2752
|
}
|
|
2439
|
-
|
|
2440
|
-
|
|
2753
|
+
constructor(value) {
|
|
2754
|
+
const color = Color.parseColorString(value);
|
|
2755
|
+
color ? this.color = color : (this.color = new RGB(255, 255, 255));
|
|
2441
2756
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
class Container {
|
|
2445
|
-
constructor(containerOptions) {
|
|
2446
|
-
const options = containerOptions || {};
|
|
2447
|
-
options.defaultScope = options.defaultScope || BindingScopeEnum.Transient, this.options = options, this.id = Generator.GenAutoIncrementId(), this._bindingDictionary = new Map(), this._metadataReader = new MetadataReader();
|
|
2757
|
+
toRGBA() {
|
|
2758
|
+
return this.color.formatRgb();
|
|
2448
2759
|
}
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
module.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
|
|
2760
|
+
toString() {
|
|
2761
|
+
return this.color.formatRgb();
|
|
2452
2762
|
}
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
return this._get(getArgs);
|
|
2763
|
+
toHex() {
|
|
2764
|
+
return this.color.formatHex();
|
|
2456
2765
|
}
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
return this._get(getArgs);
|
|
2766
|
+
toHsl() {
|
|
2767
|
+
return this.color.formatHsl();
|
|
2460
2768
|
}
|
|
2461
|
-
|
|
2462
|
-
const
|
|
2463
|
-
|
|
2769
|
+
brighter(k) {
|
|
2770
|
+
const {
|
|
2771
|
+
r: r,
|
|
2772
|
+
g: g,
|
|
2773
|
+
b: b
|
|
2774
|
+
} = this.color;
|
|
2775
|
+
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;
|
|
2464
2776
|
}
|
|
2465
|
-
|
|
2466
|
-
|
|
2777
|
+
add(color) {
|
|
2778
|
+
const {
|
|
2779
|
+
r: r,
|
|
2780
|
+
g: g,
|
|
2781
|
+
b: b
|
|
2782
|
+
} = this.color;
|
|
2783
|
+
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;
|
|
2467
2784
|
}
|
|
2468
|
-
|
|
2469
|
-
return this.
|
|
2785
|
+
sub(color) {
|
|
2786
|
+
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;
|
|
2470
2787
|
}
|
|
2471
|
-
|
|
2472
|
-
const
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2788
|
+
multiply(color) {
|
|
2789
|
+
const {
|
|
2790
|
+
r: r,
|
|
2791
|
+
g: g,
|
|
2792
|
+
b: b
|
|
2793
|
+
} = this.color;
|
|
2794
|
+
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;
|
|
2476
2795
|
}
|
|
2477
|
-
|
|
2478
|
-
this.
|
|
2796
|
+
getHSVBrightness() {
|
|
2797
|
+
return Math.max(this.color.r, this.color.g, this.color.b) / 255;
|
|
2479
2798
|
}
|
|
2480
|
-
|
|
2481
|
-
return this.
|
|
2799
|
+
getHSLBrightness() {
|
|
2800
|
+
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);
|
|
2482
2801
|
}
|
|
2483
|
-
|
|
2484
|
-
const
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
const bindingToSyntax = this.bind(serviceIdentifier);
|
|
2489
|
-
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
2490
|
-
},
|
|
2491
|
-
getUnbindFunction = () => serviceIdentifier => this.unbind(serviceIdentifier),
|
|
2492
|
-
getIsboundFunction = () => serviceIdentifier => this.isBound(serviceIdentifier),
|
|
2493
|
-
getRebindFunction = moduleId => serviceIdentifier => {
|
|
2494
|
-
const bindingToSyntax = this.rebind(serviceIdentifier);
|
|
2495
|
-
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
2496
|
-
};
|
|
2497
|
-
return mId => ({
|
|
2498
|
-
bindFunction: getBindFunction(mId),
|
|
2499
|
-
isboundFunction: getIsboundFunction(),
|
|
2500
|
-
rebindFunction: getRebindFunction(mId),
|
|
2501
|
-
unbindFunction: getUnbindFunction(),
|
|
2502
|
-
unbindAsyncFunction: serviceIdentifier => null
|
|
2503
|
-
});
|
|
2802
|
+
setHsl(h, s, l) {
|
|
2803
|
+
const opacity = this.color.opacity,
|
|
2804
|
+
hsl = rgbToHsl(this.color.r, this.color.g, this.color.b),
|
|
2805
|
+
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);
|
|
2806
|
+
return this.color = new RGB(rgb.r, rgb.g, rgb.b, opacity), this;
|
|
2504
2807
|
}
|
|
2505
|
-
|
|
2506
|
-
return
|
|
2507
|
-
avoidConstraints: !1,
|
|
2508
|
-
isMultiInject: isMultiInject,
|
|
2509
|
-
serviceIdentifier: serviceIdentifier,
|
|
2510
|
-
key: key,
|
|
2511
|
-
value: value
|
|
2512
|
-
};
|
|
2808
|
+
setRGB(r, g, b) {
|
|
2809
|
+
return !isNil$1(r) && (this.color.r = r), !isNil$1(g) && (this.color.g = g), !isNil$1(b) && (this.color.b = b), this;
|
|
2513
2810
|
}
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
serviceIdentifier: serviceIdentifier
|
|
2519
|
-
};
|
|
2811
|
+
setHex(value) {
|
|
2812
|
+
const formatValue = `${value}`.trim().toLowerCase(),
|
|
2813
|
+
res = setHex(formatValue, !0);
|
|
2814
|
+
return null != res ? res : this;
|
|
2520
2815
|
}
|
|
2521
|
-
|
|
2522
|
-
const
|
|
2523
|
-
return this.
|
|
2524
|
-
result.push(this._resolveFromBinding(binding));
|
|
2525
|
-
}), getArgs.isMultiInject || 1 !== result.length ? result : result[0];
|
|
2816
|
+
setColorName(name) {
|
|
2817
|
+
const hex = DEFAULT_COLORS[name.toLowerCase()];
|
|
2818
|
+
return void 0 !== hex ? this.setHex(hex) : (void 0), this;
|
|
2526
2819
|
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
{
|
|
2530
|
-
userGeneratedMetadata: userGeneratedMetadata
|
|
2531
|
-
} = this._metadataReader.getConstructorMetadata(constr),
|
|
2532
|
-
keys = Object.keys(userGeneratedMetadata),
|
|
2533
|
-
arr = [];
|
|
2534
|
-
for (let i = 0; i < keys.length; i++) {
|
|
2535
|
-
const constructorArgsMetadata = userGeneratedMetadata[i],
|
|
2536
|
-
targetMetadataMap = {};
|
|
2537
|
-
constructorArgsMetadata.forEach(md => {
|
|
2538
|
-
targetMetadataMap[md.key] = md.value;
|
|
2539
|
-
});
|
|
2540
|
-
const metadata = {
|
|
2541
|
-
inject: targetMetadataMap[INJECT_TAG],
|
|
2542
|
-
multiInject: targetMetadataMap[MULTI_INJECT_TAG]
|
|
2543
|
-
},
|
|
2544
|
-
injectIdentifier = metadata.inject || metadata.multiInject,
|
|
2545
|
-
target = {
|
|
2546
|
-
serviceIdentifier: injectIdentifier,
|
|
2547
|
-
constructorArgsMetadata: constructorArgsMetadata
|
|
2548
|
-
},
|
|
2549
|
-
request = {
|
|
2550
|
-
injectIdentifier: injectIdentifier,
|
|
2551
|
-
metadata: constructorArgsMetadata,
|
|
2552
|
-
bindings: this._bindingDictionary.get(injectIdentifier).filter(b => b.constraint(target))
|
|
2553
|
-
};
|
|
2554
|
-
arr.push(request);
|
|
2555
|
-
}
|
|
2556
|
-
return arr;
|
|
2820
|
+
setScalar(scalar) {
|
|
2821
|
+
return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
|
|
2557
2822
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
return this.
|
|
2823
|
+
setOpacity() {
|
|
2824
|
+
let o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2825
|
+
return this.color.opacity = o, this;
|
|
2561
2826
|
}
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
switch (binding.type) {
|
|
2565
|
-
case BindingTypeEnum.ConstantValue:
|
|
2566
|
-
case BindingTypeEnum.Function:
|
|
2567
|
-
result = binding.cache;
|
|
2568
|
-
break;
|
|
2569
|
-
case BindingTypeEnum.Instance:
|
|
2570
|
-
result = this._resolveInstance(binding, binding.implementationType);
|
|
2571
|
-
break;
|
|
2572
|
-
default:
|
|
2573
|
-
result = binding.dynamicValue({
|
|
2574
|
-
container: this
|
|
2575
|
-
});
|
|
2576
|
-
}
|
|
2577
|
-
return result;
|
|
2827
|
+
getLuminance() {
|
|
2828
|
+
return (.2126 * this.color.r + .7152 * this.color.g + .0722 * this.color.b) / 255;
|
|
2578
2829
|
}
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
const childRequests = this._getChildRequest(binding);
|
|
2582
|
-
return this._createInstance(constr, childRequests);
|
|
2830
|
+
getLuminance2() {
|
|
2831
|
+
return (.2627 * this.color.r + .678 * this.color.g + .0593 * this.color.b) / 255;
|
|
2583
2832
|
}
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
return new constr(...this._resolveRequests(childRequests));
|
|
2587
|
-
}
|
|
2588
|
-
return new constr();
|
|
2833
|
+
getLuminance3() {
|
|
2834
|
+
return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
|
|
2589
2835
|
}
|
|
2590
|
-
|
|
2591
|
-
return
|
|
2836
|
+
clone() {
|
|
2837
|
+
return new Color(this.color.toString());
|
|
2592
2838
|
}
|
|
2593
|
-
|
|
2594
|
-
|
|
2839
|
+
copyGammaToLinear(color) {
|
|
2840
|
+
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2841
|
+
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;
|
|
2595
2842
|
}
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
constructor(serviceIdentifier, container) {
|
|
2601
|
-
this.serviceIdentifier = serviceIdentifier, this.container = container;
|
|
2843
|
+
copyLinearToGamma(color) {
|
|
2844
|
+
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2845
|
+
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
2846
|
+
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;
|
|
2602
2847
|
}
|
|
2603
|
-
|
|
2604
|
-
return this.
|
|
2848
|
+
convertGammaToLinear(gammaFactor) {
|
|
2849
|
+
return this.copyGammaToLinear(this, gammaFactor), this;
|
|
2605
2850
|
}
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
bind(ContributionProvider).toDynamicValue(_ref => {
|
|
2609
|
-
let {
|
|
2610
|
-
container: container
|
|
2611
|
-
} = _ref;
|
|
2612
|
-
return new ContributionProviderCache(id, container);
|
|
2613
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
class Hook {
|
|
2617
|
-
constructor(args, name) {
|
|
2618
|
-
this._args = args, this.name = name, this.taps = [];
|
|
2851
|
+
convertLinearToGamma(gammaFactor) {
|
|
2852
|
+
return this.copyLinearToGamma(this, gammaFactor), this;
|
|
2619
2853
|
}
|
|
2620
|
-
|
|
2621
|
-
this.
|
|
2854
|
+
copySRGBToLinear(color) {
|
|
2855
|
+
return this.color.r = SRGBToLinear(color.color.r), this.color.g = SRGBToLinear(color.color.g), this.color.b = SRGBToLinear(color.color.b), this;
|
|
2622
2856
|
}
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
name && (this.taps = this.taps.filter(tap => !(tap.name === name && (!fn || tap.fn === fn))));
|
|
2857
|
+
copyLinearToSRGB(color) {
|
|
2858
|
+
return this.color.r = LinearToSRGB(color.color.r), this.color.g = LinearToSRGB(color.color.g), this.color.b = LinearToSRGB(color.color.b), this;
|
|
2626
2859
|
}
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
if ("string" == typeof options) _options = {
|
|
2630
|
-
name: options.trim()
|
|
2631
|
-
};else if ("object" != typeof options || null === options) throw new Error("Invalid tap options");
|
|
2632
|
-
if ("string" != typeof _options.name || "" === _options.name) throw new Error("Missing name for tap");
|
|
2633
|
-
return _options = Object.assign({
|
|
2634
|
-
type: type,
|
|
2635
|
-
fn: fn
|
|
2636
|
-
}, _options), _options;
|
|
2860
|
+
convertSRGBToLinear() {
|
|
2861
|
+
return this.copySRGBToLinear(this), this;
|
|
2637
2862
|
}
|
|
2638
|
-
|
|
2639
|
-
this.
|
|
2863
|
+
convertLinearToSRGB() {
|
|
2864
|
+
return this.copyLinearToSRGB(this), this;
|
|
2640
2865
|
}
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
this.taps[i] = item;
|
|
2866
|
+
}
|
|
2867
|
+
class RGB {
|
|
2868
|
+
constructor(r, g, b, opacity) {
|
|
2869
|
+
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;
|
|
2870
|
+
}
|
|
2871
|
+
formatHex() {
|
|
2872
|
+
return `#${hex(this.r) + hex(this.g) + hex(this.b) + (1 === this.opacity ? "" : hex(255 * this.opacity))}`;
|
|
2873
|
+
}
|
|
2874
|
+
formatRgb() {
|
|
2875
|
+
const opacity = this.opacity;
|
|
2876
|
+
return `${1 === opacity ? "rgb(" : "rgba("}${this.r},${this.g},${this.b}${1 === opacity ? ")" : `,${opacity})`}`;
|
|
2877
|
+
}
|
|
2878
|
+
formatHsl() {
|
|
2879
|
+
const opacity = this.opacity,
|
|
2880
|
+
{
|
|
2881
|
+
h: h,
|
|
2882
|
+
s: s,
|
|
2883
|
+
l: l
|
|
2884
|
+
} = rgbToHsl(this.r, this.g, this.b);
|
|
2885
|
+
return `${1 === opacity ? "hsl(" : "hsla("}${h},${s}%,${l}%${1 === opacity ? ")" : `,${opacity})`}`;
|
|
2886
|
+
}
|
|
2887
|
+
toString() {
|
|
2888
|
+
return this.formatHex();
|
|
2665
2889
|
}
|
|
2666
2890
|
}
|
|
2667
2891
|
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2892
|
+
function normalizePadding(padding) {
|
|
2893
|
+
if (isValidNumber$1(padding)) return [padding, padding, padding, padding];
|
|
2894
|
+
if (isArray$1(padding)) {
|
|
2895
|
+
const length = padding.length;
|
|
2896
|
+
if (1 === length) {
|
|
2897
|
+
const paddingValue = padding[0];
|
|
2898
|
+
return [paddingValue, paddingValue, paddingValue, paddingValue];
|
|
2672
2899
|
}
|
|
2673
|
-
|
|
2900
|
+
if (2 === length) {
|
|
2901
|
+
const [vertical, horizontal] = padding;
|
|
2902
|
+
return [vertical, horizontal, vertical, horizontal];
|
|
2903
|
+
}
|
|
2904
|
+
if (3 === length) {
|
|
2905
|
+
const [top, horizontal, bottom] = padding;
|
|
2906
|
+
return [top, horizontal, bottom, horizontal];
|
|
2907
|
+
}
|
|
2908
|
+
if (4 === length) return padding;
|
|
2909
|
+
}
|
|
2910
|
+
if (isObject$1(padding)) {
|
|
2911
|
+
const {
|
|
2912
|
+
top = 0,
|
|
2913
|
+
right = 0,
|
|
2914
|
+
bottom = 0,
|
|
2915
|
+
left = 0
|
|
2916
|
+
} = padding;
|
|
2917
|
+
return [top, right, bottom, left];
|
|
2674
2918
|
}
|
|
2919
|
+
return [0, 0, 0, 0];
|
|
2675
2920
|
}
|
|
2676
2921
|
|
|
2677
|
-
const
|
|
2922
|
+
const styleStringToObject = function () {
|
|
2923
|
+
let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2924
|
+
const res = {};
|
|
2925
|
+
return styleStr.split(";").forEach(item => {
|
|
2926
|
+
if (item) {
|
|
2927
|
+
const arr = item.split(":");
|
|
2928
|
+
if (2 === arr.length) {
|
|
2929
|
+
const key = arr[0].trim(),
|
|
2930
|
+
value = arr[1].trim();
|
|
2931
|
+
key && value && (res[key] = value);
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
}), res;
|
|
2935
|
+
};
|
|
2936
|
+
const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
2678
2937
|
|
|
2679
2938
|
const circleThreshold = tau - 1e-8;
|
|
2680
2939
|
class BoundsContext {
|
|
@@ -2701,7 +2960,7 @@
|
|
|
2701
2960
|
this.bounds.add(cx + xmin, cy + ymin), this.bounds.add(cx + xmax, cy + ymax);
|
|
2702
2961
|
}
|
|
2703
2962
|
arcTo(x1, y1, x2, y2, radius) {
|
|
2704
|
-
|
|
2963
|
+
this.bounds.add(x1, y1);
|
|
2705
2964
|
}
|
|
2706
2965
|
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
|
|
2707
2966
|
this.bounds.add(cp1x, cp1y), this.bounds.add(cp2x, cp2y), this.bounds.add(x, y);
|
|
@@ -2910,19 +3169,25 @@
|
|
|
2910
3169
|
}
|
|
2911
3170
|
const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry) => {
|
|
2912
3171
|
const delta = Math.abs(endAngle - startAngle),
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
3172
|
+
count = delta > .5 * Math.PI ? Math.ceil(2 * delta / Math.PI) : 1,
|
|
3173
|
+
stepAngle = (endAngle - startAngle) / count;
|
|
3174
|
+
for (let i = 0; i < count; i++) {
|
|
3175
|
+
const sa = startAngle + stepAngle * i,
|
|
3176
|
+
ea = startAngle + stepAngle * (i + 1),
|
|
3177
|
+
len = 4 * Math.tan(Math.abs(stepAngle) / 4) / 3,
|
|
3178
|
+
dir = ea < sa ? -1 : 1,
|
|
3179
|
+
c1 = Math.cos(sa),
|
|
3180
|
+
s1 = Math.sin(sa),
|
|
3181
|
+
c2 = Math.cos(ea),
|
|
3182
|
+
s2 = Math.sin(ea),
|
|
3183
|
+
x1 = c1 * rx + cx,
|
|
3184
|
+
y1 = s1 * ry + cy,
|
|
3185
|
+
x4 = c2 * rx + cx,
|
|
3186
|
+
y4 = s2 * ry + cy,
|
|
3187
|
+
hx = rx * len * dir,
|
|
3188
|
+
hy = ry * len * dir;
|
|
3189
|
+
bezierPath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);
|
|
3190
|
+
}
|
|
2926
3191
|
};
|
|
2927
3192
|
|
|
2928
3193
|
const commandFuncs = [(command, context, x, y, sx, sy, z) => context.arc(command[1] * sx + x, command[2] * sy + y, command[3] * (sx + sy) / 2, command[4], command[5], command[6], z), (command, context, x, y, sx, sy, z) => context.arcTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * (sx + sy) / 2, z), (command, context, x, y, sx, sy, z) => context.bezierCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * sx + x, command[6] * sy + y, z), (command, context, x, y) => context.closePath(), (command, context, x, y, sx, sy) => context.ellipse(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, command[5], command[6], command[7], command[8]), (command, context, x, y, sx, sy, z) => context.lineTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.moveTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.quadraticCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, z), (command, context, x, y, sx, sy, z) => context.rect(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, z)];
|
|
@@ -5029,7 +5294,8 @@
|
|
|
5029
5294
|
constructor() {
|
|
5030
5295
|
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
5031
5296
|
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
5032
|
-
|
|
5297
|
+
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
5298
|
+
this.id = id, this.timeline = timeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
5033
5299
|
}
|
|
5034
5300
|
setTimeline(timeline) {
|
|
5035
5301
|
timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
|
|
@@ -5157,7 +5423,7 @@
|
|
|
5157
5423
|
return !this._preventAttrs || !this._preventAttrs.has(key);
|
|
5158
5424
|
}
|
|
5159
5425
|
bind(target) {
|
|
5160
|
-
return this.target = target, this.target.onAnimateBind && this.target.onAnimateBind(this), this.subAnimates.forEach(sa => {
|
|
5426
|
+
return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.subAnimates.forEach(sa => {
|
|
5161
5427
|
sa.bind(target);
|
|
5162
5428
|
}), this;
|
|
5163
5429
|
}
|
|
@@ -5694,6 +5960,9 @@
|
|
|
5694
5960
|
get AABBBounds() {
|
|
5695
5961
|
return this.tryUpdateAABBBounds("imprecise" === this.attribute.boundsMode);
|
|
5696
5962
|
}
|
|
5963
|
+
get OBBBounds() {
|
|
5964
|
+
return this.tryUpdateOBBBounds();
|
|
5965
|
+
}
|
|
5697
5966
|
get globalAABBBounds() {
|
|
5698
5967
|
return this.tryUpdateGlobalAABBBounds();
|
|
5699
5968
|
}
|
|
@@ -5706,7 +5975,7 @@
|
|
|
5706
5975
|
constructor() {
|
|
5707
5976
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5708
5977
|
var _a;
|
|
5709
|
-
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
5978
|
+
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
5710
5979
|
}
|
|
5711
5980
|
setMode(mode) {
|
|
5712
5981
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -5740,13 +6009,22 @@
|
|
|
5740
6009
|
const bounds = this.doUpdateAABBBounds(full);
|
|
5741
6010
|
return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
|
|
5742
6011
|
}
|
|
6012
|
+
tryUpdateOBBBounds() {
|
|
6013
|
+
if (this._OBBBounds || (this._OBBBounds = new OBBBounds()), this.tryUpdateAABBBounds(), this.updateOBBBoundsStamp === this.updateAABBBoundsStamp) return this._OBBBounds;
|
|
6014
|
+
if (this.updateOBBBoundsStamp = this.updateAABBBoundsStamp, !this.valid) return this._OBBBounds.clear(), this._OBBBounds;
|
|
6015
|
+
return this.doUpdateOBBBounds();
|
|
6016
|
+
}
|
|
5743
6017
|
combindShadowAABBBounds(bounds) {
|
|
5744
6018
|
if (this.shadowRoot) {
|
|
5745
6019
|
const b = this.shadowRoot.AABBBounds.clone();
|
|
5746
6020
|
bounds.union(b);
|
|
5747
6021
|
}
|
|
5748
6022
|
}
|
|
6023
|
+
doUpdateOBBBounds() {
|
|
6024
|
+
return this._OBBBounds;
|
|
6025
|
+
}
|
|
5749
6026
|
doUpdateAABBBounds(full) {
|
|
6027
|
+
this.updateAABBBoundsStamp++;
|
|
5750
6028
|
const graphicTheme = this.getGraphicTheme();
|
|
5751
6029
|
this._AABBBounds.clear();
|
|
5752
6030
|
const attribute = this.attribute,
|
|
@@ -5784,7 +6062,7 @@
|
|
|
5784
6062
|
return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
|
|
5785
6063
|
}
|
|
5786
6064
|
shouldUpdateAABBBounds() {
|
|
5787
|
-
return this.shadowRoot ? !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds() : !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);
|
|
6065
|
+
return this.shadowRoot ? (!!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds()) && application.graphicService.validCheck(this.attribute, this.getGraphicTheme(), this._AABBBounds, this) : !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) && application.graphicService.validCheck(this.attribute, this.getGraphicTheme(), this._AABBBounds, this);
|
|
5788
6066
|
}
|
|
5789
6067
|
shouldSelfChangeUpdateAABBBounds() {
|
|
5790
6068
|
return this.shadowRoot ? !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds() : !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);
|
|
@@ -5954,8 +6232,8 @@
|
|
|
5954
6232
|
}
|
|
5955
6233
|
animate(params) {
|
|
5956
6234
|
this.animates || (this.animates = new Map());
|
|
5957
|
-
const animate = new Animate(null == params ? void 0 : params.id, this.stage && this.stage.getTimeline()
|
|
5958
|
-
if (params) {
|
|
6235
|
+
const animate = new Animate(null == params ? void 0 : params.id, this.stage && this.stage.getTimeline(), null == params ? void 0 : params.slience);
|
|
6236
|
+
if (animate.bind(this), params) {
|
|
5959
6237
|
const {
|
|
5960
6238
|
onStart: onStart,
|
|
5961
6239
|
onFrame: onFrame,
|
|
@@ -5991,7 +6269,9 @@
|
|
|
5991
6269
|
keys.forEach(key => {
|
|
5992
6270
|
noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
|
|
5993
6271
|
});
|
|
5994
|
-
const animate = this.animate(
|
|
6272
|
+
const animate = this.animate({
|
|
6273
|
+
slience: !0
|
|
6274
|
+
});
|
|
5995
6275
|
animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
|
|
5996
6276
|
type: AttributeUpdateType.STATE
|
|
5997
6277
|
});
|
|
@@ -6208,7 +6488,7 @@
|
|
|
6208
6488
|
if (!animate.validAttr(key)) return;
|
|
6209
6489
|
const nextStepVal = nextProps[key],
|
|
6210
6490
|
lastStepVal = null !== (_a = lastProps && lastProps[key]) && void 0 !== _a ? _a : subAnimate.getLastPropByName(key, step);
|
|
6211
|
-
if (null == nextStepVal || null == lastStepVal) return void (nextAttributes[key] = nextStepVal);
|
|
6491
|
+
if (null == nextStepVal || null == lastStepVal || nextStepVal === lastStepVal) return void (nextAttributes[key] = nextStepVal);
|
|
6212
6492
|
let match;
|
|
6213
6493
|
match = animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes), match || (match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, this, nextAttributes), match || this.defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) || this._interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes));
|
|
6214
6494
|
}), step.parsedProps = nextParsedProps;
|
|
@@ -6701,6 +6981,7 @@
|
|
|
6701
6981
|
}), application.graphicService.updateTempAABBBounds(aabbBounds), application.graphicService.transformAABBBounds(attribute, aabbBounds, groupTheme, !1, this), originalAABBBounds.copy(aabbBounds), originalAABBBounds;
|
|
6702
6982
|
}
|
|
6703
6983
|
doUpdateAABBBounds() {
|
|
6984
|
+
this.updateAABBBoundsStamp++;
|
|
6704
6985
|
const bounds = super.doUpdateAABBBounds();
|
|
6705
6986
|
return this.parent && this.parent.addChildUpdateBoundTag(), this._emitCustomEvent("AAABBBoundsChange"), bounds;
|
|
6706
6987
|
}
|
|
@@ -7091,7 +7372,8 @@
|
|
|
7091
7372
|
onAddIncremental: new SyncHook(["graphic", "group", "stage"]),
|
|
7092
7373
|
onClearIncremental: new SyncHook(["graphic", "group", "stage"]),
|
|
7093
7374
|
beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
|
|
7094
|
-
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"])
|
|
7375
|
+
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"]),
|
|
7376
|
+
clearAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds"])
|
|
7095
7377
|
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds();
|
|
7096
7378
|
}
|
|
7097
7379
|
onAttributeUpdate(graphic) {
|
|
@@ -7118,6 +7400,9 @@
|
|
|
7118
7400
|
afterUpdateAABBBounds(graphic, stage, bounds, params, selfChange) {
|
|
7119
7401
|
this.hooks.afterUpdateAABBBounds.taps.length && this.hooks.afterUpdateAABBBounds.call(graphic, stage, bounds, params, selfChange);
|
|
7120
7402
|
}
|
|
7403
|
+
clearAABBBounds(graphic, stage, b) {
|
|
7404
|
+
this.hooks.clearAABBBounds.taps.length && this.hooks.clearAABBBounds.call(graphic, stage, b);
|
|
7405
|
+
}
|
|
7121
7406
|
updatePathProxyAABBBounds(aabbBounds, graphic) {
|
|
7122
7407
|
const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
|
|
7123
7408
|
if (!path) return !1;
|
|
@@ -7180,11 +7465,11 @@
|
|
|
7180
7465
|
validCheck(attribute, theme, aabbBounds, graphic) {
|
|
7181
7466
|
if (!graphic) return !0;
|
|
7182
7467
|
if (null != attribute.forceBoundsHeight || null != attribute.forceBoundsWidth) return !0;
|
|
7183
|
-
if (
|
|
7468
|
+
if (graphic.shadowRoot) return !0;
|
|
7184
7469
|
const {
|
|
7185
7470
|
visible = theme.visible
|
|
7186
7471
|
} = attribute;
|
|
7187
|
-
return
|
|
7472
|
+
return !(!graphic.valid || !visible) || (aabbBounds.empty() || (graphic.parent && aabbBounds.transformWithMatrix(graphic.parent.globalTransMatrix), application.graphicService.clearAABBBounds(graphic, graphic.stage, aabbBounds), aabbBounds.clear()), !1);
|
|
7188
7473
|
}
|
|
7189
7474
|
updateTempAABBBounds(aabbBounds) {
|
|
7190
7475
|
const tb1 = this.tempAABBBounds1,
|
|
@@ -8443,13 +8728,23 @@
|
|
|
8443
8728
|
if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
|
|
8444
8729
|
}
|
|
8445
8730
|
get cliped() {
|
|
8731
|
+
var _a, _b;
|
|
8446
8732
|
const textTheme = this.getGraphicTheme(),
|
|
8447
|
-
attribute = this.attribute
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8733
|
+
attribute = this.attribute,
|
|
8734
|
+
{
|
|
8735
|
+
maxLineWidth = textTheme.maxLineWidth,
|
|
8736
|
+
text: text,
|
|
8737
|
+
whiteSpace = textTheme.whiteSpace
|
|
8738
|
+
} = attribute;
|
|
8739
|
+
if (!Number.isFinite(maxLineWidth)) return !1;
|
|
8740
|
+
if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
|
|
8741
|
+
let mergedText = "";
|
|
8742
|
+
this.cache.layoutData.lines.forEach(item => {
|
|
8743
|
+
mergedText += item.str;
|
|
8744
|
+
});
|
|
8745
|
+
return (Array.isArray(text) ? text.join("") : text) !== mergedText;
|
|
8746
|
+
}
|
|
8747
|
+
return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
|
|
8453
8748
|
}
|
|
8454
8749
|
get multilineLayout() {
|
|
8455
8750
|
if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
@@ -8479,8 +8774,36 @@
|
|
|
8479
8774
|
getGraphicTheme() {
|
|
8480
8775
|
return getTheme(this).text;
|
|
8481
8776
|
}
|
|
8777
|
+
doUpdateOBBBounds() {
|
|
8778
|
+
const graphicTheme = this.getGraphicTheme();
|
|
8779
|
+
this._OBBBounds.clear();
|
|
8780
|
+
const attribute = this.attribute,
|
|
8781
|
+
{
|
|
8782
|
+
angle = graphicTheme.angle
|
|
8783
|
+
} = attribute;
|
|
8784
|
+
if (!angle) {
|
|
8785
|
+
const b = this.AABBBounds;
|
|
8786
|
+
return this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2), this._OBBBounds;
|
|
8787
|
+
}
|
|
8788
|
+
this.obbText || (this.obbText = new Text({})), this.obbText.setAttributes(Object.assign(Object.assign({}, attribute), {
|
|
8789
|
+
angle: 0
|
|
8790
|
+
}));
|
|
8791
|
+
const bounds1 = this.obbText.AABBBounds,
|
|
8792
|
+
{
|
|
8793
|
+
x: x,
|
|
8794
|
+
y: y
|
|
8795
|
+
} = attribute,
|
|
8796
|
+
boundsCenter = {
|
|
8797
|
+
x: (bounds1.x1 + bounds1.x2) / 2,
|
|
8798
|
+
y: (bounds1.y1 + bounds1.y2) / 2
|
|
8799
|
+
},
|
|
8800
|
+
center = rotatePoint(boundsCenter, angle, {
|
|
8801
|
+
x: x,
|
|
8802
|
+
y: y
|
|
8803
|
+
});
|
|
8804
|
+
return this._OBBBounds.copy(bounds1), this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y), this._OBBBounds.angle = angle, this._OBBBounds;
|
|
8805
|
+
}
|
|
8482
8806
|
updateAABBBounds(attribute, textTheme, aabbBounds) {
|
|
8483
|
-
if (!application.graphicService.validCheck(attribute, textTheme, aabbBounds, this)) return aabbBounds;
|
|
8484
8807
|
const {
|
|
8485
8808
|
text = textTheme.text
|
|
8486
8809
|
} = this.attribute;
|
|
@@ -9589,7 +9912,6 @@
|
|
|
9589
9912
|
return getTheme(this).symbol;
|
|
9590
9913
|
}
|
|
9591
9914
|
updateAABBBounds(attribute, symbolTheme, aabbBounds, full) {
|
|
9592
|
-
if (!application.graphicService.validCheck(attribute, symbolTheme, aabbBounds, this)) return aabbBounds;
|
|
9593
9915
|
this.updatePathProxyAABBBounds(aabbBounds) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds));
|
|
9594
9916
|
const {
|
|
9595
9917
|
tb1: tb1,
|
|
@@ -9658,7 +9980,6 @@
|
|
|
9658
9980
|
return getTheme(this).rect;
|
|
9659
9981
|
}
|
|
9660
9982
|
updateAABBBounds(attribute, rectTheme, aabbBounds) {
|
|
9661
|
-
if (!application.graphicService.validCheck(attribute, rectTheme, aabbBounds, this)) return aabbBounds;
|
|
9662
9983
|
if (!this.updatePathProxyAABBBounds(aabbBounds)) {
|
|
9663
9984
|
let {
|
|
9664
9985
|
width: width,
|
|
@@ -9983,7 +10304,6 @@
|
|
|
9983
10304
|
return getTheme(this).image;
|
|
9984
10305
|
}
|
|
9985
10306
|
updateAABBBounds(attribute, imageTheme, aabbBounds) {
|
|
9986
|
-
if (!application.graphicService.validCheck(attribute, imageTheme, aabbBounds, this)) return aabbBounds;
|
|
9987
10307
|
if (!this.updatePathProxyAABBBounds(aabbBounds)) {
|
|
9988
10308
|
const {
|
|
9989
10309
|
width = imageTheme.width,
|
|
@@ -10086,10 +10406,22 @@
|
|
|
10086
10406
|
}
|
|
10087
10407
|
draw(ctx, lastLine, x, y, drawEllipsis, drawIcon) {
|
|
10088
10408
|
if (drawEllipsis && (lastLine || this.paragraphs.some(p => p.overflow))) {
|
|
10089
|
-
let
|
|
10409
|
+
let emptyOverflow = !0,
|
|
10410
|
+
skipEllipsis = !1;
|
|
10090
10411
|
for (let i = this.paragraphs.length - 1; i >= 0; i--) {
|
|
10091
10412
|
const paragraph = this.paragraphs[i];
|
|
10092
|
-
if (paragraph.overflow)
|
|
10413
|
+
if (paragraph.overflow) emptyOverflow = emptyOverflow && "" === paragraph.text;else if (emptyOverflow) {
|
|
10414
|
+
skipEllipsis = !0;
|
|
10415
|
+
break;
|
|
10416
|
+
}
|
|
10417
|
+
}
|
|
10418
|
+
let otherParagraphWidth = 0;
|
|
10419
|
+
if (!skipEllipsis) for (let i = this.paragraphs.length - 1; i >= 0; i--) {
|
|
10420
|
+
const paragraph = this.paragraphs[i];
|
|
10421
|
+
if (paragraph.overflow) {
|
|
10422
|
+
if ("" === paragraph.text) break;
|
|
10423
|
+
continue;
|
|
10424
|
+
}
|
|
10093
10425
|
if (paragraph instanceof RichTextIcon) break;
|
|
10094
10426
|
if ("vertical" === this.direction && "vertical" !== paragraph.direction) {
|
|
10095
10427
|
paragraph.verticalEllipsis = !0;
|
|
@@ -10183,7 +10515,13 @@
|
|
|
10183
10515
|
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
10184
10516
|
let RichText$1 = class RichText extends Graphic {
|
|
10185
10517
|
constructor(params) {
|
|
10186
|
-
super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE
|
|
10518
|
+
super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE, this.onBeforeAttributeUpdate = (val, attributes, key) => {
|
|
10519
|
+
for (const key in val) if ("hoverIconId" === key) {
|
|
10520
|
+
if (val[key] === attributes[key]) continue;
|
|
10521
|
+
const icon = this._frameCache.icons.get(val[key]);
|
|
10522
|
+
this.updateHoverIconState(icon);
|
|
10523
|
+
}
|
|
10524
|
+
};
|
|
10187
10525
|
}
|
|
10188
10526
|
get width() {
|
|
10189
10527
|
var _a;
|
|
@@ -10257,7 +10595,6 @@
|
|
|
10257
10595
|
return getTheme(this).richtext;
|
|
10258
10596
|
}
|
|
10259
10597
|
updateAABBBounds(attribute, richtextTheme, aabbBounds) {
|
|
10260
|
-
if (!application.graphicService.validCheck(attribute, richtextTheme, aabbBounds, this)) return aabbBounds;
|
|
10261
10598
|
const {
|
|
10262
10599
|
width = richtextTheme.width,
|
|
10263
10600
|
height = richtextTheme.height,
|
|
@@ -10309,6 +10646,21 @@
|
|
|
10309
10646
|
getFrameCache() {
|
|
10310
10647
|
return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
|
|
10311
10648
|
}
|
|
10649
|
+
get cliped() {
|
|
10650
|
+
const frameCache = this.getFrameCache();
|
|
10651
|
+
if (frameCache.actualHeight > frameCache.height) return !0;
|
|
10652
|
+
const {
|
|
10653
|
+
disableAutoWrapLine: disableAutoWrapLine
|
|
10654
|
+
} = this.attribute;
|
|
10655
|
+
if (disableAutoWrapLine) for (let i = 0; i < frameCache.lines.length; i++) {
|
|
10656
|
+
const l = frameCache.lines[i];
|
|
10657
|
+
for (let j = 0; j < l.paragraphs.length; j++) {
|
|
10658
|
+
const p = l.paragraphs[j];
|
|
10659
|
+
if (p.overflow && "" !== p.text) return !0;
|
|
10660
|
+
}
|
|
10661
|
+
}
|
|
10662
|
+
return !1;
|
|
10663
|
+
}
|
|
10312
10664
|
combinedStyleToCharacter(config) {
|
|
10313
10665
|
const {
|
|
10314
10666
|
fill: fill,
|
|
@@ -10355,8 +10707,9 @@
|
|
|
10355
10707
|
paragraphs = [],
|
|
10356
10708
|
textConfig = null != tc ? tc : _tc;
|
|
10357
10709
|
for (let i = 0; i < textConfig.length; i++) if ("image" in textConfig[i]) {
|
|
10358
|
-
const config = this.combinedStyleToCharacter(textConfig[i])
|
|
10359
|
-
|
|
10710
|
+
const config = this.combinedStyleToCharacter(textConfig[i]);
|
|
10711
|
+
config.lineWidth = void 0;
|
|
10712
|
+
const iconCache = config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);
|
|
10360
10713
|
if (iconCache) paragraphs.push(iconCache);else {
|
|
10361
10714
|
const icon = new RichTextIcon(config);
|
|
10362
10715
|
icon.successCallback = () => {
|
|
@@ -10406,14 +10759,16 @@
|
|
|
10406
10759
|
}
|
|
10407
10760
|
bindIconEvent() {
|
|
10408
10761
|
this.addEventListener("pointermove", e => {
|
|
10409
|
-
var _a, _b, _c, _d, _e;
|
|
10410
10762
|
const pickedIcon = this.pickIcon(e.global);
|
|
10411
|
-
pickedIcon && pickedIcon === this._currentHoverIcon || (pickedIcon ?
|
|
10763
|
+
pickedIcon && pickedIcon === this._currentHoverIcon || (pickedIcon ? this.setAttribute("hoverIconId", pickedIcon.richtextId) : !pickedIcon && this._currentHoverIcon && this.setAttribute("hoverIconId", void 0));
|
|
10412
10764
|
}), this.addEventListener("pointerleave", e => {
|
|
10413
|
-
|
|
10414
|
-
this._currentHoverIcon && (this._currentHoverIcon.setHoverState(!1), this._currentHoverIcon = null, null === (_a = this.stage) || void 0 === _a || _a.setCursor(), null === (_b = this.stage) || void 0 === _b || _b.renderNextFrame());
|
|
10765
|
+
this._currentHoverIcon && this.setAttribute("hoverIconId", void 0);
|
|
10415
10766
|
});
|
|
10416
10767
|
}
|
|
10768
|
+
updateHoverIconState(pickedIcon) {
|
|
10769
|
+
var _a, _b, _c, _d, _e;
|
|
10770
|
+
pickedIcon ? (null === (_a = this._currentHoverIcon) || void 0 === _a || _a.setHoverState(!1), this._currentHoverIcon = pickedIcon, this._currentHoverIcon.setHoverState(!0), null === (_b = this.stage) || void 0 === _b || _b.setCursor(pickedIcon.attribute.cursor), null === (_c = this.stage) || void 0 === _c || _c.renderNextFrame()) : (this._currentHoverIcon.setHoverState(!1), this._currentHoverIcon = null, null === (_d = this.stage) || void 0 === _d || _d.setCursor(), null === (_e = this.stage) || void 0 === _e || _e.renderNextFrame());
|
|
10771
|
+
}
|
|
10417
10772
|
pickIcon(point) {
|
|
10418
10773
|
const frameCache = this.getFrameCache(),
|
|
10419
10774
|
{
|
|
@@ -10421,7 +10776,7 @@
|
|
|
10421
10776
|
f: y
|
|
10422
10777
|
} = this.globalTransMatrix;
|
|
10423
10778
|
let pickIcon;
|
|
10424
|
-
return frameCache.icons.forEach(icon => {
|
|
10779
|
+
return frameCache.icons.forEach((icon, key) => {
|
|
10425
10780
|
var _a, _b;
|
|
10426
10781
|
const bounds = icon.AABBBounds.clone();
|
|
10427
10782
|
bounds.translate(icon._marginArray[3], icon._marginArray[0]), bounds.containsPoint({
|
|
@@ -10571,7 +10926,6 @@
|
|
|
10571
10926
|
return getTheme(this).arc;
|
|
10572
10927
|
}
|
|
10573
10928
|
updateAABBBounds(attribute, arcTheme, aabbBounds, full) {
|
|
10574
|
-
if (!application.graphicService.validCheck(attribute, arcTheme, aabbBounds, this)) return aabbBounds;
|
|
10575
10929
|
this.updatePathProxyAABBBounds(aabbBounds) || (full ? this.updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds) : this.updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds));
|
|
10576
10930
|
const {
|
|
10577
10931
|
tb1: tb1,
|
|
@@ -10624,13 +10978,14 @@
|
|
|
10624
10978
|
return super.needUpdateTag(key, ARC_UPDATE_TAG_KEY);
|
|
10625
10979
|
}
|
|
10626
10980
|
toCustomPath() {
|
|
10981
|
+
var _a, _b, _c, _d;
|
|
10627
10982
|
const attribute = this.attribute,
|
|
10628
10983
|
{
|
|
10629
10984
|
startAngle: startAngle,
|
|
10630
10985
|
endAngle: endAngle
|
|
10631
10986
|
} = this.getParsedAngle();
|
|
10632
|
-
let innerRadius = attribute.innerRadius - (attribute.innerPadding
|
|
10633
|
-
outerRadius = attribute.outerRadius - (attribute.outerPadding
|
|
10987
|
+
let innerRadius = (null !== (_a = attribute.innerRadius) && void 0 !== _a ? _a : 0) - (null !== (_b = attribute.innerPadding) && void 0 !== _b ? _b : 0),
|
|
10988
|
+
outerRadius = (null !== (_c = attribute.outerRadius) && void 0 !== _c ? _c : 0) - (null !== (_d = attribute.outerPadding) && void 0 !== _d ? _d : 0);
|
|
10634
10989
|
const deltaAngle = abs(endAngle - startAngle),
|
|
10635
10990
|
clockwise = endAngle > startAngle;
|
|
10636
10991
|
if (outerRadius < innerRadius) {
|
|
@@ -11919,7 +12274,7 @@
|
|
|
11919
12274
|
}
|
|
11920
12275
|
function richTextAttributeTransform(attributes) {
|
|
11921
12276
|
var _a, _b;
|
|
11922
|
-
return attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.
|
|
12277
|
+
return isValid$1(attributes.maxLineWidth) && (attributes.maxWidth = attributes.maxLineWidth, delete attributes.maxLineWidth), attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.textConfig = attributes.text.text || attributes.text, attributes;
|
|
11923
12278
|
}
|
|
11924
12279
|
|
|
11925
12280
|
function loadTagComponent() {
|
|
@@ -11971,6 +12326,8 @@
|
|
|
11971
12326
|
zIndex: 1
|
|
11972
12327
|
}, "group");
|
|
11973
12328
|
let symbol,
|
|
12329
|
+
tagX = -parsedPadding[3],
|
|
12330
|
+
tagY = -parsedPadding[0],
|
|
11974
12331
|
tagWidth = parsedPadding[1] + parsedPadding[3],
|
|
11975
12332
|
tagHeight = parsedPadding[0] + parsedPadding[2],
|
|
11976
12333
|
textX = 0,
|
|
@@ -12005,25 +12362,7 @@
|
|
|
12005
12362
|
x: textX,
|
|
12006
12363
|
y: 0
|
|
12007
12364
|
});
|
|
12008
|
-
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
|
|
12009
|
-
const {
|
|
12010
|
-
visible: bgVisible
|
|
12011
|
-
} = panel,
|
|
12012
|
-
backgroundStyle = __rest(panel, ["visible"]);
|
|
12013
|
-
if (visible && isBoolean$1(bgVisible)) {
|
|
12014
|
-
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
12015
|
-
visible: bgVisible && !!text,
|
|
12016
|
-
x: textShape.AABBBounds.x1,
|
|
12017
|
-
y: textShape.AABBBounds.y1,
|
|
12018
|
-
width: textShape.AABBBounds.width(),
|
|
12019
|
-
height: textShape.AABBBounds.height()
|
|
12020
|
-
}), "rect");
|
|
12021
|
-
if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
|
|
12022
|
-
const customShape = backgroundStyle.customShape;
|
|
12023
|
-
bgRect.pathProxy = attrs => customShape(textShape.attribute, attrs, new CustomPath2D());
|
|
12024
|
-
}
|
|
12025
|
-
this._bgRect = bgRect;
|
|
12026
|
-
}
|
|
12365
|
+
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), tagWidth += textShape.AABBBounds.width(), tagHeight += textShape.AABBBounds.height(), tagX += textShape.AABBBounds.x1, tagY += textShape.AABBBounds.y1;
|
|
12027
12366
|
} else {
|
|
12028
12367
|
const textAttrs = Object.assign(Object.assign({
|
|
12029
12368
|
text: isObject$1(text) && "type" in text && "text" === text.type ? text.text : text,
|
|
@@ -12045,11 +12384,9 @@
|
|
|
12045
12384
|
textAlign: textAlign,
|
|
12046
12385
|
textBaseline: textBaseline
|
|
12047
12386
|
} = textStyle;
|
|
12048
|
-
(isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2])));
|
|
12049
|
-
let
|
|
12050
|
-
|
|
12051
|
-
flag = 0;
|
|
12052
|
-
"left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
|
|
12387
|
+
(isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2]))), tagX = 0, tagY = 0;
|
|
12388
|
+
let flag = 0;
|
|
12389
|
+
"left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (tagX -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (tagX -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
|
|
12053
12390
|
const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
|
|
12054
12391
|
shouldLeft = "left" === containerTextAlign || "start" === containerTextAlign;
|
|
12055
12392
|
if ((containerTextAlign ? "center" === containerTextAlign : textAlwaysCenter) && flag) {
|
|
@@ -12093,25 +12430,25 @@
|
|
|
12093
12430
|
});
|
|
12094
12431
|
}
|
|
12095
12432
|
}
|
|
12096
|
-
"middle" === textBaseline ? (
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
this._bgRect = bgRect;
|
|
12433
|
+
"middle" === textBaseline ? (tagY -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (tagY -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
|
|
12434
|
+
}
|
|
12435
|
+
const {
|
|
12436
|
+
visible: bgVisible
|
|
12437
|
+
} = panel,
|
|
12438
|
+
backgroundStyle = __rest(panel, ["visible"]);
|
|
12439
|
+
if (visible && isBoolean$1(bgVisible)) {
|
|
12440
|
+
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
12441
|
+
visible: bgVisible && !!text,
|
|
12442
|
+
width: tagWidth,
|
|
12443
|
+
height: tagHeight,
|
|
12444
|
+
x: tagX,
|
|
12445
|
+
y: tagY
|
|
12446
|
+
}), "rect");
|
|
12447
|
+
if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
|
|
12448
|
+
const customShape = backgroundStyle.customShape;
|
|
12449
|
+
bgRect.pathProxy = attrs => customShape(this, attrs, new CustomPath2D());
|
|
12114
12450
|
}
|
|
12451
|
+
this._bgRect = bgRect;
|
|
12115
12452
|
}
|
|
12116
12453
|
this._textShape = textShape, this._symbol = symbol, this.resetStates();
|
|
12117
12454
|
}
|
|
@@ -12175,9 +12512,11 @@
|
|
|
12175
12512
|
isCheckedOrIndeterminate && this.attribute.disabled ? this._box.setAttributes({
|
|
12176
12513
|
fill: this.attribute.box.disableCheckedFill,
|
|
12177
12514
|
stroke: this.attribute.box.disableCheckedStroke
|
|
12178
|
-
}) : isCheckedOrIndeterminate
|
|
12515
|
+
}) : isCheckedOrIndeterminate ? this._box.setAttributes({
|
|
12179
12516
|
fill: this.attribute.box.checkedFill,
|
|
12180
12517
|
stroke: this.attribute.box.checkedStroke
|
|
12518
|
+
}) : this.attribute.disabled && this._box.setAttributes({
|
|
12519
|
+
fill: this.attribute.box.disableFill
|
|
12181
12520
|
}), this.appendChild(this._box);
|
|
12182
12521
|
}
|
|
12183
12522
|
renderIcon() {
|
|
@@ -12290,9 +12629,11 @@
|
|
|
12290
12629
|
isChecked && this.attribute.disabled ? this._circle.setAttributes({
|
|
12291
12630
|
fill: this.attribute.circle.disableCheckedFill,
|
|
12292
12631
|
stroke: this.attribute.circle.disableCheckedStroke
|
|
12293
|
-
}) : isChecked
|
|
12632
|
+
}) : isChecked ? this._circle.setAttributes({
|
|
12294
12633
|
fill: this.attribute.circle.checkedFill,
|
|
12295
12634
|
stroke: this.attribute.circle.checkedStroke
|
|
12635
|
+
}) : this.attribute.disabled && this._circle.setAttributes({
|
|
12636
|
+
fill: this.attribute.circle.disableFill
|
|
12296
12637
|
}), this.appendChild(this._circle);
|
|
12297
12638
|
}
|
|
12298
12639
|
renderText() {
|
|
@@ -12374,7 +12715,7 @@
|
|
|
12374
12715
|
if (!(element && ReactDOM && ReactDOM.createRoot)) {
|
|
12375
12716
|
return;
|
|
12376
12717
|
}
|
|
12377
|
-
const id = isNil$
|
|
12718
|
+
const id = isNil$3(react.id) ? `${graphic.id ?? graphic._uid}_react` : react.id;
|
|
12378
12719
|
if (this.htmlMap && this.htmlMap[id] && container && container !== this.htmlMap[id].container) {
|
|
12379
12720
|
this.removeElement(id);
|
|
12380
12721
|
}
|
|
@@ -12432,7 +12773,7 @@
|
|
|
12432
12773
|
let top = 0;
|
|
12433
12774
|
const b = graphic.globalAABBBounds;
|
|
12434
12775
|
let anchorType = options.anchorType;
|
|
12435
|
-
if (isNil$
|
|
12776
|
+
if (isNil$3(anchorType)) {
|
|
12436
12777
|
anchorType = graphic.type === 'text' ? 'position' : 'boundsLeftTop';
|
|
12437
12778
|
}
|
|
12438
12779
|
if (anchorType === 'boundsLeftTop') {
|
|
@@ -12444,7 +12785,7 @@
|
|
|
12444
12785
|
top = matrix.f;
|
|
12445
12786
|
}
|
|
12446
12787
|
else {
|
|
12447
|
-
const anchor = calculateAnchorOfBounds(b, anchorType);
|
|
12788
|
+
const anchor = calculateAnchorOfBounds$1(b, anchorType);
|
|
12448
12789
|
left = anchor.x;
|
|
12449
12790
|
top = anchor.y;
|
|
12450
12791
|
}
|
|
@@ -12460,17 +12801,17 @@
|
|
|
12460
12801
|
...this.getTransformOfText(graphic)
|
|
12461
12802
|
};
|
|
12462
12803
|
}
|
|
12463
|
-
if (isFunction$
|
|
12804
|
+
if (isFunction$3(options.style)) {
|
|
12464
12805
|
const userStyle = options.style({ top: offsetTop, left: offsetX, width: b.width(), height: b.height() }, graphic, wrapContainer);
|
|
12465
12806
|
if (userStyle) {
|
|
12466
12807
|
calculateStyle = { ...calculateStyle, ...userStyle };
|
|
12467
12808
|
}
|
|
12468
12809
|
}
|
|
12469
|
-
else if (isObject$
|
|
12810
|
+
else if (isObject$3(options.style)) {
|
|
12470
12811
|
calculateStyle = { ...calculateStyle, ...options.style };
|
|
12471
12812
|
}
|
|
12472
|
-
else if (isString$
|
|
12473
|
-
calculateStyle = { ...calculateStyle, ...styleStringToObject(options.style) };
|
|
12813
|
+
else if (isString$3(options.style) && options.style) {
|
|
12814
|
+
calculateStyle = { ...calculateStyle, ...styleStringToObject$1(options.style) };
|
|
12474
12815
|
}
|
|
12475
12816
|
application.global.updateDom(wrapContainer, {
|
|
12476
12817
|
width: options.width,
|
|
@@ -12558,7 +12899,7 @@
|
|
|
12558
12899
|
}
|
|
12559
12900
|
const { width, height, style } = params;
|
|
12560
12901
|
if (style) {
|
|
12561
|
-
if (isString$
|
|
12902
|
+
if (isString$3(style)) {
|
|
12562
12903
|
dom.setAttribute('style', style);
|
|
12563
12904
|
}
|
|
12564
12905
|
else {
|
|
@@ -12600,7 +12941,7 @@
|
|
|
12600
12941
|
toArray(props.children).map((child, index) => {
|
|
12601
12942
|
const parseOption = child && child.type && child.type.parseOption;
|
|
12602
12943
|
if (parseOption && child.props) {
|
|
12603
|
-
const childProps = isNil$
|
|
12944
|
+
const childProps = isNil$3(child.props.componentId)
|
|
12604
12945
|
? {
|
|
12605
12946
|
...child.props,
|
|
12606
12947
|
componentId: getComponentId(child, index)
|
|
@@ -18425,7 +18766,7 @@
|
|
|
18425
18766
|
return graphic;
|
|
18426
18767
|
}
|
|
18427
18768
|
function isEventProp(key, props) {
|
|
18428
|
-
return key.startsWith('on') && isFunction$
|
|
18769
|
+
return key.startsWith('on') && isFunction$3(props[key]);
|
|
18429
18770
|
}
|
|
18430
18771
|
function bindEventsToGraphic(graphic, props) {
|
|
18431
18772
|
for (const key in props) {
|
|
@@ -18445,7 +18786,7 @@
|
|
|
18445
18786
|
graphic.addEventListener(REACT_TO_CANOPUS_EVENTS[propKey], newProps[propKey]);
|
|
18446
18787
|
}
|
|
18447
18788
|
}
|
|
18448
|
-
const attribute = newProps.attribute ?? merge({}, newProps);
|
|
18789
|
+
const attribute = newProps.attribute ?? merge$1({}, newProps);
|
|
18449
18790
|
graphic.initAttributes(attribute);
|
|
18450
18791
|
if (graphic.type === 'image') {
|
|
18451
18792
|
graphic.loadImage(attribute.image);
|
|
@@ -18704,7 +19045,7 @@
|
|
|
18704
19045
|
styleTop = cellRect.top + dealWidthNumber(dy, cellRect.height) + cellRect.height + 'px';
|
|
18705
19046
|
}
|
|
18706
19047
|
}
|
|
18707
|
-
const componentStyle = merge({}, style, {
|
|
19048
|
+
const componentStyle = merge$1({}, style, {
|
|
18708
19049
|
position: 'absolute',
|
|
18709
19050
|
zIndex: 1000,
|
|
18710
19051
|
width: styleWidth,
|
|
@@ -18724,7 +19065,7 @@
|
|
|
18724
19065
|
return { ...defaultProps };
|
|
18725
19066
|
}, [defaultProps]);
|
|
18726
19067
|
const props = reactExports.useMemo(() => {
|
|
18727
|
-
const mProps = merge({}, componentProps);
|
|
19068
|
+
const mProps = merge$1({}, componentProps);
|
|
18728
19069
|
for (const propName in _defaultProps) {
|
|
18729
19070
|
if (mProps[propName] === undefined) {
|
|
18730
19071
|
mProps[propName] = _defaultProps[propName];
|
|
@@ -18735,7 +19076,7 @@
|
|
|
18735
19076
|
return props;
|
|
18736
19077
|
}
|
|
18737
19078
|
function dealWidthNumber(value, refenceValue) {
|
|
18738
|
-
if (isNumber$
|
|
19079
|
+
if (isNumber$3(value)) {
|
|
18739
19080
|
return value;
|
|
18740
19081
|
}
|
|
18741
19082
|
if (typeof value === 'string' && value.endsWith('%')) {
|
|
@@ -18783,7 +19124,7 @@
|
|
|
18783
19124
|
}
|
|
18784
19125
|
};
|
|
18785
19126
|
function ButtonComponent(baseProps, ref) {
|
|
18786
|
-
const props = merge({}, defaultProps$6, baseProps);
|
|
19127
|
+
const props = merge$1({}, defaultProps$6, baseProps);
|
|
18787
19128
|
const { disabled, onClick } = props;
|
|
18788
19129
|
let buttonRef = React.useRef(null);
|
|
18789
19130
|
buttonRef = ref ? ref : buttonRef;
|
|
@@ -18878,7 +19219,7 @@
|
|
|
18878
19219
|
}
|
|
18879
19220
|
};
|
|
18880
19221
|
function LinkComponent(baseProps, ref) {
|
|
18881
|
-
const props = merge({}, defaultProps$5, baseProps);
|
|
19222
|
+
const props = merge$1({}, defaultProps$5, baseProps);
|
|
18882
19223
|
const { disabled, href, onClick } = props;
|
|
18883
19224
|
let linkRef = React.useRef(null);
|
|
18884
19225
|
linkRef = ref ? ref : linkRef;
|
|
@@ -18971,7 +19312,7 @@
|
|
|
18971
19312
|
autoFixFontSize: true
|
|
18972
19313
|
};
|
|
18973
19314
|
function AvatarComponent(baseProps, ref) {
|
|
18974
|
-
const props = merge({}, defaultProps$4, baseProps);
|
|
19315
|
+
const props = merge$1({}, defaultProps$4, baseProps);
|
|
18975
19316
|
const { size, children, onClick } = props;
|
|
18976
19317
|
let avatarRef = React.useRef(null);
|
|
18977
19318
|
avatarRef = ref ? ref : avatarRef;
|
|
@@ -18979,7 +19320,7 @@
|
|
|
18979
19320
|
onClick && onClick(event);
|
|
18980
19321
|
}, [onClick]);
|
|
18981
19322
|
const groupAttribute = getGroupAttribute(props);
|
|
18982
|
-
if (isString$
|
|
19323
|
+
if (isString$3(children)) {
|
|
18983
19324
|
const textAttribute = getTextAttribute(props);
|
|
18984
19325
|
return (React.createElement(Group, { ref: avatarRef, attribute: groupAttribute, onClick: handleClick },
|
|
18985
19326
|
React.createElement(Text, { attribute: textAttribute })));
|
|
@@ -19060,7 +19401,7 @@
|
|
|
19060
19401
|
React.createElement("div", { style: arrowStyle }))) : (React.createElement(React.Fragment, null));
|
|
19061
19402
|
};
|
|
19062
19403
|
function PopoverComponent(baseProps, ref) {
|
|
19063
|
-
const props = merge({}, defaultProps$3, baseProps);
|
|
19404
|
+
const props = merge$1({}, defaultProps$3, baseProps);
|
|
19064
19405
|
const { content, position, popupVisible, defaultPopupVisible, children } = props;
|
|
19065
19406
|
let popoverRef = React.useRef(null);
|
|
19066
19407
|
popoverRef = ref ? ref : popoverRef;
|
|
@@ -19092,14 +19433,14 @@
|
|
|
19092
19433
|
}
|
|
19093
19434
|
};
|
|
19094
19435
|
const groupMouseEnter = reactExports.useCallback((event) => {
|
|
19095
|
-
if (isValid$
|
|
19436
|
+
if (isValid$3(popupVisible)) {
|
|
19096
19437
|
return;
|
|
19097
19438
|
}
|
|
19098
19439
|
setPopupOpen(true);
|
|
19099
19440
|
event.currentTarget.stage.renderNextFrame();
|
|
19100
19441
|
}, []);
|
|
19101
19442
|
const groupMouseLeave = reactExports.useCallback((event) => {
|
|
19102
|
-
if (isValid$
|
|
19443
|
+
if (isValid$3(popupVisible)) {
|
|
19103
19444
|
return;
|
|
19104
19445
|
}
|
|
19105
19446
|
setPopupOpen(false);
|
|
@@ -19276,7 +19617,7 @@
|
|
|
19276
19617
|
}
|
|
19277
19618
|
};
|
|
19278
19619
|
function TagComponent(baseProps, ref) {
|
|
19279
|
-
const props = merge({}, defaultProps$2, baseProps);
|
|
19620
|
+
const props = merge$1({}, defaultProps$2, baseProps);
|
|
19280
19621
|
const { attribute, panelStyle, children, ...rest } = props;
|
|
19281
19622
|
let tagRef = React.useRef(null);
|
|
19282
19623
|
tagRef = ref ? ref : tagRef;
|
|
@@ -19293,7 +19634,7 @@
|
|
|
19293
19634
|
|
|
19294
19635
|
const defaultProps$1 = {};
|
|
19295
19636
|
function RadioComponent(baseProps, ref) {
|
|
19296
|
-
const props = merge({}, defaultProps$1, baseProps);
|
|
19637
|
+
const props = merge$1({}, defaultProps$1, baseProps);
|
|
19297
19638
|
const { textStyle, circleStyle, children, ...rest } = props;
|
|
19298
19639
|
let radioRef = React.useRef(null);
|
|
19299
19640
|
radioRef = ref ? ref : radioRef;
|
|
@@ -19322,7 +19663,7 @@
|
|
|
19322
19663
|
|
|
19323
19664
|
const defaultProps = {};
|
|
19324
19665
|
function CheckboxComponent(baseProps, ref) {
|
|
19325
|
-
const props = merge({}, defaultProps, baseProps);
|
|
19666
|
+
const props = merge$1({}, defaultProps, baseProps);
|
|
19326
19667
|
const { textStyle, boxStyle, iconStyle, children, ...rest } = props;
|
|
19327
19668
|
let checkboxRef = React.useRef(null);
|
|
19328
19669
|
checkboxRef = ref ? ref : checkboxRef;
|
|
@@ -19348,7 +19689,7 @@
|
|
|
19348
19689
|
const Checkbox = React.forwardRef(CheckboxComponent);
|
|
19349
19690
|
Checkbox.displayName = 'Checkbox';
|
|
19350
19691
|
|
|
19351
|
-
const version = "1.8.
|
|
19692
|
+
const version = "1.8.3-alpha.0";
|
|
19352
19693
|
|
|
19353
19694
|
Object.defineProperty(exports, 'register', {
|
|
19354
19695
|
enumerable: true,
|