@visactor/react-vtable 1.9.2-alpha.3 → 1.10.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/cjs/tables/base-table.d.ts +2 -2
- package/cjs/tables/base-table.js +2 -2
- package/cjs/tables/base-table.js.map +1 -1
- package/dist/react-vtable.js +1809 -1967
- 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/es/tables/base-table.d.ts +2 -2
- package/es/tables/base-table.js +2 -2
- package/es/tables/base-table.js.map +1 -1
- package/package.json +3 -3
package/dist/react-vtable.js
CHANGED
|
@@ -714,64 +714,104 @@
|
|
|
714
714
|
var eventemitter3Exports = eventemitter3.exports;
|
|
715
715
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
716
716
|
|
|
717
|
-
const isType
|
|
718
|
-
var isType$
|
|
717
|
+
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
718
|
+
var isType$1 = 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;
|
|
719
725
|
|
|
720
|
-
const isFunction
|
|
721
|
-
var isFunction$
|
|
726
|
+
const isFunction = value => "function" == typeof value;
|
|
727
|
+
var isFunction$1 = isFunction;
|
|
722
728
|
|
|
723
|
-
const isNil
|
|
724
|
-
var isNil$
|
|
729
|
+
const isNil = value => null == value;
|
|
730
|
+
var isNil$1 = isNil;
|
|
725
731
|
|
|
726
|
-
const isValid
|
|
727
|
-
var isValid$
|
|
732
|
+
const isValid = value => null != value;
|
|
733
|
+
var isValid$1 = isValid;
|
|
728
734
|
|
|
729
|
-
const isObject
|
|
735
|
+
const isObject = value => {
|
|
730
736
|
const type = typeof value;
|
|
731
737
|
return null !== value && "object" === type || "function" === type;
|
|
732
738
|
};
|
|
733
|
-
var isObject$
|
|
739
|
+
var isObject$1 = isObject;
|
|
734
740
|
|
|
735
|
-
const isObjectLike
|
|
736
|
-
var isObjectLike$
|
|
741
|
+
const isObjectLike = value => "object" == typeof value && null !== value;
|
|
742
|
+
var isObjectLike$1 = isObjectLike;
|
|
737
743
|
|
|
738
|
-
const isPlainObject
|
|
739
|
-
if (!isObjectLike$
|
|
744
|
+
const isPlainObject = function (value) {
|
|
745
|
+
if (!isObjectLike$1(value) || !isType$1(value, "Object")) return !1;
|
|
740
746
|
if (null === Object.getPrototypeOf(value)) return !0;
|
|
741
747
|
let proto = value;
|
|
742
748
|
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
743
749
|
return Object.getPrototypeOf(value) === proto;
|
|
744
750
|
};
|
|
745
|
-
var isPlainObject$
|
|
751
|
+
var isPlainObject$1 = isPlainObject;
|
|
746
752
|
|
|
747
|
-
const isString
|
|
753
|
+
const isString = function (value) {
|
|
748
754
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
749
755
|
const type = typeof value;
|
|
750
|
-
return fuzzy ? "string" === type : "string" === type || isType$
|
|
756
|
+
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
751
757
|
};
|
|
752
|
-
var isString$
|
|
758
|
+
var isString$1 = isString;
|
|
753
759
|
|
|
754
|
-
const isArray
|
|
755
|
-
var isArray$
|
|
760
|
+
const isArray = value => Array.isArray ? Array.isArray(value) : isType$1(value, "Array");
|
|
761
|
+
var isArray$1 = isArray;
|
|
756
762
|
|
|
757
|
-
const isArrayLike
|
|
763
|
+
const isArrayLike = function (value) {
|
|
758
764
|
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
759
765
|
};
|
|
760
|
-
var isArrayLike$
|
|
766
|
+
var isArrayLike$1 = isArrayLike;
|
|
761
767
|
|
|
762
|
-
const isNumber
|
|
768
|
+
const isNumber = function (value) {
|
|
763
769
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
764
770
|
const type = typeof value;
|
|
765
|
-
return fuzzy ? "number" === type : "number" === type || isType$
|
|
771
|
+
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
766
772
|
};
|
|
767
|
-
var isNumber$
|
|
773
|
+
var isNumber$1 = 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;
|
|
768
808
|
|
|
769
|
-
function baseMerge
|
|
809
|
+
function baseMerge(target, source) {
|
|
770
810
|
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
771
811
|
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
772
812
|
if (source) {
|
|
773
813
|
if (target === source) return;
|
|
774
|
-
if (isValid$
|
|
814
|
+
if (isValid$1(source) && "object" == typeof source) {
|
|
775
815
|
const iterable = Object(source),
|
|
776
816
|
props = [];
|
|
777
817
|
for (const key in iterable) props.push(key);
|
|
@@ -781,51 +821,51 @@
|
|
|
781
821
|
propIndex = -1;
|
|
782
822
|
for (; length--;) {
|
|
783
823
|
const key = props[++propIndex];
|
|
784
|
-
!isValid$
|
|
824
|
+
!isValid$1(iterable[key]) || "object" != typeof iterable[key] || skipTargetArray && isArray$1(target[key]) ? assignMergeValue(target, key, iterable[key]) : baseMergeDeep(target, source, key, shallowArray, skipTargetArray);
|
|
785
825
|
}
|
|
786
826
|
}
|
|
787
827
|
}
|
|
788
828
|
}
|
|
789
|
-
function baseMergeDeep
|
|
829
|
+
function baseMergeDeep(target, source, key) {
|
|
790
830
|
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
791
831
|
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
792
832
|
const objValue = target[key],
|
|
793
833
|
srcValue = source[key];
|
|
794
834
|
let newValue = source[key],
|
|
795
835
|
isCommon = !0;
|
|
796
|
-
if (isArray$
|
|
797
|
-
if (shallowArray) newValue = [];else if (isArray$
|
|
836
|
+
if (isArray$1(srcValue)) {
|
|
837
|
+
if (shallowArray) newValue = [];else if (isArray$1(objValue)) newValue = objValue;else if (isArrayLike$1(objValue)) {
|
|
798
838
|
newValue = new Array(objValue.length);
|
|
799
839
|
let index = -1;
|
|
800
840
|
const length = objValue.length;
|
|
801
841
|
for (; ++index < length;) newValue[index] = objValue[index];
|
|
802
842
|
}
|
|
803
|
-
} else isPlainObject$
|
|
804
|
-
isCommon && baseMerge
|
|
843
|
+
} else isPlainObject$1(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
844
|
+
isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
|
|
805
845
|
}
|
|
806
|
-
function assignMergeValue
|
|
807
|
-
(void 0 !== value && !eq
|
|
846
|
+
function assignMergeValue(target, key, value) {
|
|
847
|
+
(void 0 !== value && !eq(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
808
848
|
}
|
|
809
|
-
function eq
|
|
849
|
+
function eq(value, other) {
|
|
810
850
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
811
851
|
}
|
|
812
|
-
function merge
|
|
852
|
+
function merge(target) {
|
|
813
853
|
let sourceIndex = -1;
|
|
814
854
|
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
815
855
|
for (; ++sourceIndex < length;) {
|
|
816
|
-
baseMerge
|
|
856
|
+
baseMerge(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
817
857
|
}
|
|
818
858
|
return target;
|
|
819
859
|
}
|
|
820
860
|
|
|
821
861
|
function pickWithout(obj, keys) {
|
|
822
|
-
if (!obj || !isPlainObject$
|
|
862
|
+
if (!obj || !isPlainObject$1(obj)) return obj;
|
|
823
863
|
const result = {};
|
|
824
864
|
return Object.keys(obj).forEach(k => {
|
|
825
865
|
const v = obj[k];
|
|
826
866
|
let match = !1;
|
|
827
867
|
keys.forEach(itKey => {
|
|
828
|
-
(isString$
|
|
868
|
+
(isString$1(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
829
869
|
}), match || (result[k] = v);
|
|
830
870
|
}), result;
|
|
831
871
|
}
|
|
@@ -842,14 +882,14 @@
|
|
|
842
882
|
if (null == a || null == b) return !1;
|
|
843
883
|
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
844
884
|
if (objToString(a) !== objToString(b)) return !1;
|
|
845
|
-
if (isFunction$
|
|
885
|
+
if (isFunction$1(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
846
886
|
if ("object" != typeof a) return !1;
|
|
847
|
-
if (isArray$
|
|
887
|
+
if (isArray$1(a)) {
|
|
848
888
|
if (a.length !== b.length) return !1;
|
|
849
889
|
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
850
890
|
return !0;
|
|
851
891
|
}
|
|
852
|
-
if (!isPlainObject$
|
|
892
|
+
if (!isPlainObject$1(a)) return !1;
|
|
853
893
|
const ka = objectKeys(a),
|
|
854
894
|
kb = objectKeys(b);
|
|
855
895
|
if (ka.length !== kb.length) return !1;
|
|
@@ -862,2078 +902,1871 @@
|
|
|
862
902
|
return !0;
|
|
863
903
|
}
|
|
864
904
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
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;
|
|
906
|
-
}
|
|
907
|
-
return anchorX += sx * rectWidth, anchorY += sy * rectHeight, {
|
|
908
|
-
x: anchorX,
|
|
909
|
-
y: anchorY
|
|
910
|
-
};
|
|
911
|
-
};
|
|
905
|
+
function arrayEqual(a, b) {
|
|
906
|
+
if (!isArray$1(a) || !isArray$1(b)) return !1;
|
|
907
|
+
if (a.length !== b.length) return !1;
|
|
908
|
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
909
|
+
return !0;
|
|
910
|
+
}
|
|
912
911
|
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
912
|
+
const hasConsole = "undefined" != typeof console;
|
|
913
|
+
function log(method, level, input) {
|
|
914
|
+
const args = [level].concat([].slice.call(input));
|
|
915
|
+
hasConsole && console[method].apply(console, args);
|
|
916
|
+
}
|
|
917
|
+
var LoggerLevel;
|
|
918
|
+
!function (LoggerLevel) {
|
|
919
|
+
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";
|
|
920
|
+
}(LoggerLevel || (LoggerLevel = {}));
|
|
921
|
+
class Logger {
|
|
922
|
+
static getInstance(level, method) {
|
|
923
|
+
return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
924
|
+
}
|
|
925
|
+
static setInstance(logger) {
|
|
926
|
+
return Logger._instance = logger;
|
|
927
|
+
}
|
|
928
|
+
static setInstanceLevel(level) {
|
|
929
|
+
Logger._instance ? Logger._instance.level(level) : Logger._instance = new Logger(level);
|
|
930
|
+
}
|
|
931
|
+
static clearInstance() {
|
|
932
|
+
Logger._instance = null;
|
|
933
|
+
}
|
|
934
|
+
constructor() {
|
|
935
|
+
let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
|
|
936
|
+
let method = arguments.length > 1 ? arguments[1] : undefined;
|
|
937
|
+
this._onErrorHandler = [], this._level = level, this._method = method;
|
|
938
|
+
}
|
|
939
|
+
addErrorHandler(handler) {
|
|
940
|
+
this._onErrorHandler.find(h => h === handler) || this._onErrorHandler.push(handler);
|
|
941
|
+
}
|
|
942
|
+
removeErrorHandler(handler) {
|
|
943
|
+
const index = this._onErrorHandler.findIndex(h => h === handler);
|
|
944
|
+
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
945
|
+
}
|
|
946
|
+
callErrorHandler() {
|
|
947
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
948
|
+
args[_key] = arguments[_key];
|
|
924
949
|
}
|
|
925
|
-
|
|
926
|
-
|
|
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;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
Logger._instance = null;
|
|
927
994
|
|
|
928
|
-
|
|
995
|
+
const clamp = function (input, min, max) {
|
|
996
|
+
return input < min ? min : input > max ? max : input;
|
|
997
|
+
};
|
|
998
|
+
var clamp$1 = clamp;
|
|
929
999
|
|
|
930
|
-
|
|
1000
|
+
const epsilon = 1e-12;
|
|
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
|
+
}
|
|
931
1016
|
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
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
|
-
}
|
|
1017
|
+
class Point {
|
|
1018
|
+
constructor() {
|
|
1019
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1020
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1021
|
+
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
1022
|
+
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
1023
|
+
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
990
1024
|
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
return
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1025
|
+
clone() {
|
|
1026
|
+
return new Point(this.x, this.y);
|
|
1027
|
+
}
|
|
1028
|
+
copyFrom(p) {
|
|
1029
|
+
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;
|
|
1030
|
+
}
|
|
1031
|
+
set(x, y) {
|
|
1032
|
+
return this.x = x, this.y = y, this;
|
|
1033
|
+
}
|
|
1034
|
+
add(point) {
|
|
1035
|
+
return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1036
|
+
}
|
|
1037
|
+
sub(point) {
|
|
1038
|
+
return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1039
|
+
}
|
|
1040
|
+
multi(point) {
|
|
1041
|
+
throw new Error("暂不支持");
|
|
1042
|
+
}
|
|
1043
|
+
div(point) {
|
|
1044
|
+
throw new Error("暂不支持");
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
class PointService {
|
|
1048
|
+
static distancePP(p1, p2) {
|
|
1049
|
+
return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
|
|
1050
|
+
}
|
|
1051
|
+
static distanceNN(x, y, x1, y1) {
|
|
1052
|
+
return sqrt(pow(x - x1, 2) + pow(y - y1, 2));
|
|
1053
|
+
}
|
|
1054
|
+
static distancePN(point, x, y) {
|
|
1055
|
+
return sqrt(pow(x - point.x, 2) + pow(y - point.y, 2));
|
|
1056
|
+
}
|
|
1057
|
+
static pointAtPP(p1, p2, t) {
|
|
1058
|
+
return new Point((p2.x - p1.x) * t + p1.x, (p2.y - p1.y) * t + p1.y);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
function degreeToRadian(degree) {
|
|
1063
|
+
return degree * (Math.PI / 180);
|
|
1064
|
+
}
|
|
1065
|
+
function radianToDegree(radian) {
|
|
1066
|
+
return 180 * radian / Math.PI;
|
|
1067
|
+
}
|
|
1068
|
+
const clampRadian = function () {
|
|
1069
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1070
|
+
if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
1071
|
+
return angle;
|
|
1072
|
+
};
|
|
1073
|
+
const clampAngleByRadian = clampRadian;
|
|
1074
|
+
|
|
1075
|
+
var InnerBBox;
|
|
1076
|
+
!function (InnerBBox) {
|
|
1077
|
+
InnerBBox[InnerBBox.NONE = 0] = "NONE", InnerBBox[InnerBBox.BBOX1 = 1] = "BBOX1", InnerBBox[InnerBBox.BBOX2 = 2] = "BBOX2";
|
|
1078
|
+
}(InnerBBox || (InnerBBox = {}));
|
|
1079
|
+
function getProjectionRadius(checkAxis, axis) {
|
|
1080
|
+
return Math.abs(axis[0] * checkAxis[0] + axis[1] * checkAxis[1]);
|
|
1081
|
+
}
|
|
1082
|
+
function rotatePoint(_ref, rad) {
|
|
1083
|
+
let {
|
|
1084
|
+
x: x,
|
|
1085
|
+
y: y
|
|
1086
|
+
} = _ref;
|
|
1087
|
+
let origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
1088
|
+
x: 0,
|
|
1089
|
+
y: 0
|
|
1038
1090
|
};
|
|
1039
|
-
|
|
1040
|
-
|
|
1091
|
+
return {
|
|
1092
|
+
x: (x - origin.x) * Math.cos(rad) - (y - origin.y) * Math.sin(rad) + origin.x,
|
|
1093
|
+
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
1041
1094
|
};
|
|
1042
|
-
|
|
1043
|
-
|
|
1095
|
+
}
|
|
1096
|
+
function getCenterPoint(box) {
|
|
1097
|
+
return {
|
|
1098
|
+
x: (box.x1 + box.x2) / 2,
|
|
1099
|
+
y: (box.y1 + box.y2) / 2
|
|
1044
1100
|
};
|
|
1045
|
-
|
|
1046
|
-
|
|
1101
|
+
}
|
|
1102
|
+
function toRect(box, isDeg) {
|
|
1103
|
+
const deg = isDeg ? degreeToRadian(box.angle) : box.angle,
|
|
1104
|
+
cp = getCenterPoint(box);
|
|
1105
|
+
return [rotatePoint({
|
|
1106
|
+
x: box.x1,
|
|
1107
|
+
y: box.y1
|
|
1108
|
+
}, deg, cp), rotatePoint({
|
|
1109
|
+
x: box.x2,
|
|
1110
|
+
y: box.y1
|
|
1111
|
+
}, deg, cp), rotatePoint({
|
|
1112
|
+
x: box.x2,
|
|
1113
|
+
y: box.y2
|
|
1114
|
+
}, deg, cp), rotatePoint({
|
|
1115
|
+
x: box.x1,
|
|
1116
|
+
y: box.y2
|
|
1117
|
+
}, deg, cp)];
|
|
1118
|
+
}
|
|
1119
|
+
function isRotateAABBIntersect(box1, box2) {
|
|
1120
|
+
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1121
|
+
let ctx = arguments.length > 3 ? arguments[3] : undefined;
|
|
1122
|
+
const rect1 = toRect(box1, isDeg),
|
|
1123
|
+
rect2 = toRect(box2, isDeg),
|
|
1124
|
+
vector = (start, end) => [end.x - start.x, end.y - start.y];
|
|
1125
|
+
ctx && (ctx.save(), ctx.fillStyle = "red", ctx.globalAlpha = .6, rect1.forEach((item, index) => {
|
|
1126
|
+
0 === index ? ctx.moveTo(item.x, item.y) : ctx.lineTo(item.x, item.y);
|
|
1127
|
+
}), ctx.fill(), ctx.restore(), ctx.save(), ctx.fillStyle = "green", ctx.globalAlpha = .6, rect2.forEach((item, index) => {
|
|
1128
|
+
0 === index ? ctx.moveTo(item.x, item.y) : ctx.lineTo(item.x, item.y);
|
|
1129
|
+
}), ctx.fill(), ctx.restore());
|
|
1130
|
+
const p1 = getCenterPoint(box1),
|
|
1131
|
+
p2 = getCenterPoint(box2);
|
|
1132
|
+
ctx && ctx.fillRect(p1.x, p1.y, 2, 2), ctx && ctx.fillRect(p2.x, p2.y, 2, 2);
|
|
1133
|
+
const vp1p2 = vector(p1, p2),
|
|
1134
|
+
AB = vector(rect1[0], rect1[1]),
|
|
1135
|
+
BC = vector(rect1[1], rect1[2]),
|
|
1136
|
+
A1B1 = vector(rect2[0], rect2[1]),
|
|
1137
|
+
B1C1 = vector(rect2[1], rect2[2]),
|
|
1138
|
+
deg11 = isDeg ? degreeToRadian(box1.angle) : box1.angle;
|
|
1139
|
+
let deg12 = isDeg ? degreeToRadian(90 - box1.angle) : box1.angle + halfPi$1;
|
|
1140
|
+
const deg21 = isDeg ? degreeToRadian(box2.angle) : box2.angle;
|
|
1141
|
+
let deg22 = isDeg ? degreeToRadian(90 - box2.angle) : box2.angle + halfPi$1;
|
|
1142
|
+
deg12 > pi2 && (deg12 -= pi2), deg22 > pi2 && (deg22 -= pi2);
|
|
1143
|
+
const isCover = (checkAxisRadius, deg, targetAxis1, targetAxis2) => {
|
|
1144
|
+
const checkAxis = [Math.cos(deg), Math.sin(deg)];
|
|
1145
|
+
return checkAxisRadius + (getProjectionRadius(checkAxis, targetAxis1) + getProjectionRadius(checkAxis, targetAxis2)) / 2 > getProjectionRadius(checkAxis, vp1p2);
|
|
1047
1146
|
};
|
|
1048
|
-
|
|
1049
|
-
return reactIs_production_min;
|
|
1147
|
+
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);
|
|
1050
1148
|
}
|
|
1051
1149
|
|
|
1052
|
-
{
|
|
1053
|
-
|
|
1150
|
+
function getContextFont(text) {
|
|
1151
|
+
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1152
|
+
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
1153
|
+
fontSizeScale || (fontSizeScale = 1);
|
|
1154
|
+
const {
|
|
1155
|
+
fontStyle = defaultAttr.fontStyle,
|
|
1156
|
+
fontVariant = defaultAttr.fontVariant,
|
|
1157
|
+
fontWeight = defaultAttr.fontWeight,
|
|
1158
|
+
fontSize = defaultAttr.fontSize,
|
|
1159
|
+
fontFamily = defaultAttr.fontFamily
|
|
1160
|
+
} = text;
|
|
1161
|
+
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
1054
1162
|
}
|
|
1055
|
-
var reactIsExports = reactIs.exports;
|
|
1056
1163
|
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
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;
|
|
1164
|
+
const calculateAnchorOfBounds = (bounds, anchorType) => {
|
|
1165
|
+
const {
|
|
1166
|
+
x1: x1,
|
|
1167
|
+
x2: x2,
|
|
1168
|
+
y1: y1,
|
|
1169
|
+
y2: y2
|
|
1170
|
+
} = bounds,
|
|
1171
|
+
rectWidth = Math.abs(x2 - x1),
|
|
1172
|
+
rectHeight = Math.abs(y2 - y1);
|
|
1173
|
+
let anchorX = (x1 + x2) / 2,
|
|
1174
|
+
anchorY = (y1 + y2) / 2,
|
|
1175
|
+
sx = 0,
|
|
1176
|
+
sy = 0;
|
|
1177
|
+
switch (anchorType) {
|
|
1178
|
+
case "top":
|
|
1179
|
+
case "inside-top":
|
|
1180
|
+
sy = -.5;
|
|
1181
|
+
break;
|
|
1182
|
+
case "bottom":
|
|
1183
|
+
case "inside-bottom":
|
|
1184
|
+
sy = .5;
|
|
1185
|
+
break;
|
|
1186
|
+
case "left":
|
|
1187
|
+
case "inside-left":
|
|
1188
|
+
sx = -.5;
|
|
1189
|
+
break;
|
|
1190
|
+
case "right":
|
|
1191
|
+
case "inside-right":
|
|
1192
|
+
sx = .5;
|
|
1193
|
+
break;
|
|
1194
|
+
case "top-right":
|
|
1195
|
+
sx = .5, sy = -.5;
|
|
1196
|
+
break;
|
|
1197
|
+
case "top-left":
|
|
1198
|
+
sx = -.5, sy = -.5;
|
|
1199
|
+
break;
|
|
1200
|
+
case "bottom-right":
|
|
1201
|
+
sx = .5, sy = .5;
|
|
1202
|
+
break;
|
|
1203
|
+
case "bottom-left":
|
|
1204
|
+
sx = -.5, sy = .5;
|
|
1205
|
+
}
|
|
1206
|
+
return anchorX += sx * rectWidth, anchorY += sy * rectHeight, {
|
|
1207
|
+
x: anchorX,
|
|
1208
|
+
y: anchorY
|
|
1209
|
+
};
|
|
1165
1210
|
};
|
|
1166
1211
|
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1212
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
1213
|
+
const {
|
|
1214
|
+
x1: x1,
|
|
1215
|
+
y1: y1,
|
|
1216
|
+
x2: x2,
|
|
1217
|
+
y2: y2
|
|
1218
|
+
} = bounds;
|
|
1219
|
+
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);
|
|
1171
1220
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
constructor(registry) {
|
|
1176
|
-
this.id = Generator.GenAutoIncrementId(), this.registry = registry;
|
|
1221
|
+
class Bounds {
|
|
1222
|
+
constructor(bounds) {
|
|
1223
|
+
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
1177
1224
|
}
|
|
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;
|
|
1225
|
+
clone() {
|
|
1226
|
+
return new Bounds(this);
|
|
1189
1227
|
}
|
|
1190
|
-
|
|
1191
|
-
return this.
|
|
1228
|
+
clear() {
|
|
1229
|
+
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
1192
1230
|
}
|
|
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;
|
|
1418
|
-
}
|
|
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;
|
|
1231
|
+
empty() {
|
|
1232
|
+
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
1422
1233
|
}
|
|
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
|
-
};
|
|
1234
|
+
equals(b) {
|
|
1235
|
+
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
1431
1236
|
}
|
|
1432
|
-
|
|
1433
|
-
|
|
1237
|
+
setValue() {
|
|
1238
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1239
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1240
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1241
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1242
|
+
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
1434
1243
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
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;
|
|
1244
|
+
set() {
|
|
1245
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1246
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1247
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1248
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1249
|
+
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;
|
|
1453
1250
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1251
|
+
add() {
|
|
1252
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1253
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1254
|
+
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;
|
|
1456
1255
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1256
|
+
expand() {
|
|
1257
|
+
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1258
|
+
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;
|
|
1459
1259
|
}
|
|
1460
|
-
|
|
1461
|
-
return this.
|
|
1260
|
+
round() {
|
|
1261
|
+
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;
|
|
1462
1262
|
}
|
|
1463
|
-
|
|
1464
|
-
|
|
1263
|
+
translate() {
|
|
1264
|
+
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1265
|
+
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1266
|
+
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
1465
1267
|
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
this.
|
|
1268
|
+
rotate() {
|
|
1269
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1270
|
+
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1271
|
+
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1272
|
+
const p = this.rotatedPoints(angle, x, y);
|
|
1273
|
+
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
1471
1274
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1275
|
+
scale() {
|
|
1276
|
+
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1277
|
+
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1278
|
+
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1279
|
+
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1280
|
+
const p = this.scalePoints(sx, sy, x, y);
|
|
1281
|
+
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
1474
1282
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
return this.to(self);
|
|
1283
|
+
union(b) {
|
|
1284
|
+
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;
|
|
1478
1285
|
}
|
|
1479
|
-
|
|
1480
|
-
return this.
|
|
1286
|
+
intersect(b) {
|
|
1287
|
+
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;
|
|
1481
1288
|
}
|
|
1482
|
-
|
|
1483
|
-
return this.
|
|
1289
|
+
encloses(b) {
|
|
1290
|
+
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
1484
1291
|
}
|
|
1485
|
-
|
|
1486
|
-
return this.
|
|
1292
|
+
alignsWith(b) {
|
|
1293
|
+
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
1487
1294
|
}
|
|
1488
|
-
|
|
1489
|
-
this.
|
|
1295
|
+
intersects(b) {
|
|
1296
|
+
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
1490
1297
|
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
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();
|
|
1298
|
+
contains() {
|
|
1299
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1300
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1301
|
+
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
1497
1302
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
module.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
|
|
1303
|
+
containsPoint(p) {
|
|
1304
|
+
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
1501
1305
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
return this._get(getArgs);
|
|
1306
|
+
width() {
|
|
1307
|
+
return this.empty() ? 0 : this.x2 - this.x1;
|
|
1505
1308
|
}
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
return this._get(getArgs);
|
|
1309
|
+
height() {
|
|
1310
|
+
return this.empty() ? 0 : this.y2 - this.y1;
|
|
1509
1311
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
return this.
|
|
1312
|
+
scaleX() {
|
|
1313
|
+
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1314
|
+
return this.x1 *= s, this.x2 *= s, this;
|
|
1513
1315
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1316
|
+
scaleY() {
|
|
1317
|
+
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1318
|
+
return this.y1 *= s, this.y2 *= s, this;
|
|
1516
1319
|
}
|
|
1517
|
-
|
|
1518
|
-
return this
|
|
1320
|
+
transformWithMatrix(matrix) {
|
|
1321
|
+
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
1519
1322
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
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);
|
|
1323
|
+
copy(b) {
|
|
1324
|
+
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
1525
1325
|
}
|
|
1526
|
-
|
|
1527
|
-
|
|
1326
|
+
rotatedPoints(angle, x, y) {
|
|
1327
|
+
const {
|
|
1328
|
+
x1: x1,
|
|
1329
|
+
y1: y1,
|
|
1330
|
+
x2: x2,
|
|
1331
|
+
y2: y2
|
|
1332
|
+
} = this,
|
|
1333
|
+
cos = Math.cos(angle),
|
|
1334
|
+
sin = Math.sin(angle),
|
|
1335
|
+
cx = x - x * cos + y * sin,
|
|
1336
|
+
cy = y - x * sin - y * cos;
|
|
1337
|
+
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];
|
|
1528
1338
|
}
|
|
1529
|
-
|
|
1530
|
-
|
|
1339
|
+
scalePoints(sx, sy, x, y) {
|
|
1340
|
+
const {
|
|
1341
|
+
x1: x1,
|
|
1342
|
+
y1: y1,
|
|
1343
|
+
x2: x2,
|
|
1344
|
+
y2: y2
|
|
1345
|
+
} = this;
|
|
1346
|
+
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
1531
1347
|
}
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
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
|
-
});
|
|
1348
|
+
}
|
|
1349
|
+
class AABBBounds extends Bounds {}
|
|
1350
|
+
class OBBBounds extends Bounds {
|
|
1351
|
+
constructor(bounds) {
|
|
1352
|
+
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1353
|
+
super(bounds), bounds && (this.angle = angle);
|
|
1553
1354
|
}
|
|
1554
|
-
|
|
1555
|
-
return
|
|
1556
|
-
avoidConstraints: !1,
|
|
1557
|
-
isMultiInject: isMultiInject,
|
|
1558
|
-
serviceIdentifier: serviceIdentifier,
|
|
1559
|
-
key: key,
|
|
1560
|
-
value: value
|
|
1561
|
-
};
|
|
1355
|
+
intersects(b) {
|
|
1356
|
+
return isRotateAABBIntersect(this, b);
|
|
1562
1357
|
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1358
|
+
setValue() {
|
|
1359
|
+
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1360
|
+
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1361
|
+
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1362
|
+
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1363
|
+
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1364
|
+
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
1569
1365
|
}
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
class Matrix {
|
|
1369
|
+
constructor() {
|
|
1370
|
+
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1371
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1372
|
+
let c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1373
|
+
let d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
1374
|
+
let e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1375
|
+
let f = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
1376
|
+
this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f;
|
|
1575
1377
|
}
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
{
|
|
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;
|
|
1378
|
+
equalToMatrix(m2) {
|
|
1379
|
+
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);
|
|
1606
1380
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
return this._saveToScope(binding, result), result;
|
|
1381
|
+
equalTo(a, b, c, d, e, f) {
|
|
1382
|
+
return !(this.e !== e || this.f !== f || this.a !== a || this.d !== d || this.b !== b || this.c !== c);
|
|
1610
1383
|
}
|
|
1611
|
-
|
|
1612
|
-
|
|
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;
|
|
1384
|
+
setValue(a, b, c, d, e, f) {
|
|
1385
|
+
return this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f, this;
|
|
1627
1386
|
}
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
const childRequests = this._getChildRequest(binding);
|
|
1631
|
-
return this._createInstance(constr, childRequests);
|
|
1387
|
+
reset() {
|
|
1388
|
+
return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.e = 0, this.f = 0, this;
|
|
1632
1389
|
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1390
|
+
getInverse() {
|
|
1391
|
+
const a = this.a,
|
|
1392
|
+
b = this.b,
|
|
1393
|
+
c = this.c,
|
|
1394
|
+
d = this.d,
|
|
1395
|
+
e = this.e,
|
|
1396
|
+
f = this.f,
|
|
1397
|
+
m = new Matrix(),
|
|
1398
|
+
dt = a * d - b * c;
|
|
1399
|
+
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;
|
|
1638
1400
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1401
|
+
rotate(rad) {
|
|
1402
|
+
const c = Math.cos(rad),
|
|
1403
|
+
s = Math.sin(rad),
|
|
1404
|
+
m11 = this.a * c + this.c * s,
|
|
1405
|
+
m12 = this.b * c + this.d * s,
|
|
1406
|
+
m21 = this.a * -s + this.c * c,
|
|
1407
|
+
m22 = this.b * -s + this.d * c;
|
|
1408
|
+
return this.a = m11, this.b = m12, this.c = m21, this.d = m22, this;
|
|
1641
1409
|
}
|
|
1642
|
-
|
|
1643
|
-
|
|
1410
|
+
rotateByCenter(rad, cx, cy) {
|
|
1411
|
+
const cos = Math.cos(rad),
|
|
1412
|
+
sin = Math.sin(rad),
|
|
1413
|
+
rotateM13 = (1 - cos) * cx + sin * cy,
|
|
1414
|
+
rotateM23 = (1 - cos) * cy - sin * cx,
|
|
1415
|
+
m11 = cos * this.a - sin * this.b,
|
|
1416
|
+
m21 = sin * this.a + cos * this.b,
|
|
1417
|
+
m12 = cos * this.c - sin * this.d,
|
|
1418
|
+
m22 = sin * this.c + cos * this.d,
|
|
1419
|
+
m13 = cos * this.e - sin * this.f + rotateM13,
|
|
1420
|
+
m23 = sin * this.e + cos * this.f + rotateM23;
|
|
1421
|
+
return this.a = m11, this.b = m21, this.c = m12, this.d = m22, this.e = m13, this.f = m23, this;
|
|
1644
1422
|
}
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
const ContributionProvider = Symbol("ContributionProvider");
|
|
1648
|
-
class ContributionProviderCache {
|
|
1649
|
-
constructor(serviceIdentifier, container) {
|
|
1650
|
-
this.serviceIdentifier = serviceIdentifier, this.container = container;
|
|
1423
|
+
scale(sx, sy) {
|
|
1424
|
+
return this.a *= sx, this.b *= sx, this.c *= sy, this.d *= sy, this;
|
|
1651
1425
|
}
|
|
1652
|
-
|
|
1653
|
-
return this.
|
|
1426
|
+
setScale(sx, sy) {
|
|
1427
|
+
return this.b = this.b / this.a * sx, this.c = this.c / this.d * sy, this.a = sx, this.d = sy, this;
|
|
1654
1428
|
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
bind(ContributionProvider).toDynamicValue(_ref => {
|
|
1658
|
-
let {
|
|
1659
|
-
container: container
|
|
1660
|
-
} = _ref;
|
|
1661
|
-
return new ContributionProviderCache(id, container);
|
|
1662
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
class Hook {
|
|
1666
|
-
constructor(args, name) {
|
|
1667
|
-
this._args = args, this.name = name, this.taps = [];
|
|
1429
|
+
transform(a, b, c, d, e, f) {
|
|
1430
|
+
return this.multiply(a, b, c, d, e, f), this;
|
|
1668
1431
|
}
|
|
1669
|
-
|
|
1670
|
-
this.
|
|
1432
|
+
translate(x, y) {
|
|
1433
|
+
return this.e += this.a * x + this.c * y, this.f += this.b * x + this.d * y, this;
|
|
1671
1434
|
}
|
|
1672
|
-
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1435
|
+
transpose() {
|
|
1436
|
+
const {
|
|
1437
|
+
a: a,
|
|
1438
|
+
b: b,
|
|
1439
|
+
c: c,
|
|
1440
|
+
d: d,
|
|
1441
|
+
e: e,
|
|
1442
|
+
f: f
|
|
1443
|
+
} = this;
|
|
1444
|
+
return this.a = b, this.b = a, this.c = d, this.d = c, this.e = f, this.f = e, this;
|
|
1675
1445
|
}
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1446
|
+
multiply(a2, b2, c2, d2, e2, f2) {
|
|
1447
|
+
const a1 = this.a,
|
|
1448
|
+
b1 = this.b,
|
|
1449
|
+
c1 = this.c,
|
|
1450
|
+
d1 = this.d,
|
|
1451
|
+
m11 = a1 * a2 + c1 * b2,
|
|
1452
|
+
m12 = b1 * a2 + d1 * b2,
|
|
1453
|
+
m21 = a1 * c2 + c1 * d2,
|
|
1454
|
+
m22 = b1 * c2 + d1 * d2,
|
|
1455
|
+
dx = a1 * e2 + c1 * f2 + this.e,
|
|
1456
|
+
dy = b1 * e2 + d1 * f2 + this.f;
|
|
1457
|
+
return this.a = m11, this.b = m12, this.c = m21, this.d = m22, this.e = dx, this.f = dy, this;
|
|
1686
1458
|
}
|
|
1687
|
-
|
|
1688
|
-
|
|
1459
|
+
interpolate(m2, t) {
|
|
1460
|
+
const m = new Matrix();
|
|
1461
|
+
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;
|
|
1689
1462
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
this.taps[i] = item;
|
|
1463
|
+
transformPoint(source, target) {
|
|
1464
|
+
const {
|
|
1465
|
+
a: a,
|
|
1466
|
+
b: b,
|
|
1467
|
+
c: c,
|
|
1468
|
+
d: d,
|
|
1469
|
+
e: e,
|
|
1470
|
+
f: f
|
|
1471
|
+
} = this,
|
|
1472
|
+
dt = a * d - b * c,
|
|
1473
|
+
nextA = d / dt,
|
|
1474
|
+
nextB = -b / dt,
|
|
1475
|
+
nextC = -c / dt,
|
|
1476
|
+
nextD = a / dt,
|
|
1477
|
+
nextE = (c * f - d * e) / dt,
|
|
1478
|
+
nextF = -(a * f - b * e) / dt,
|
|
1479
|
+
{
|
|
1480
|
+
x: x,
|
|
1481
|
+
y: y
|
|
1482
|
+
} = source;
|
|
1483
|
+
target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
|
|
1714
1484
|
}
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1485
|
+
onlyTranslate() {
|
|
1486
|
+
let scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1487
|
+
return this.a === scale && 0 === this.b && 0 === this.c && this.d === scale;
|
|
1488
|
+
}
|
|
1489
|
+
clone() {
|
|
1490
|
+
return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
|
|
1491
|
+
}
|
|
1492
|
+
toTransformAttrs() {
|
|
1493
|
+
const a = this.a,
|
|
1494
|
+
b = this.b,
|
|
1495
|
+
c = this.c,
|
|
1496
|
+
d = this.d,
|
|
1497
|
+
delta = a * d - b * c,
|
|
1498
|
+
result = {
|
|
1499
|
+
x: this.e,
|
|
1500
|
+
y: this.f,
|
|
1501
|
+
rotateDeg: 0,
|
|
1502
|
+
scaleX: 0,
|
|
1503
|
+
scaleY: 0,
|
|
1504
|
+
skewX: 0,
|
|
1505
|
+
skewY: 0
|
|
1506
|
+
};
|
|
1507
|
+
if (0 !== a || 0 !== b) {
|
|
1508
|
+
const r = Math.sqrt(a * a + b * b);
|
|
1509
|
+
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;
|
|
1510
|
+
} else if (0 !== c || 0 !== d) {
|
|
1511
|
+
const s = Math.sqrt(c * c + d * d);
|
|
1512
|
+
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;
|
|
1721
1513
|
}
|
|
1722
|
-
|
|
1514
|
+
return result.rotateDeg = radianToDegree(result.rotateDeg), result;
|
|
1723
1515
|
}
|
|
1724
1516
|
}
|
|
1517
|
+
function normalTransform(out, origin, x, y, scaleX, scaleY, angle, rotateCenter) {
|
|
1518
|
+
const oa = origin.a,
|
|
1519
|
+
ob = origin.b,
|
|
1520
|
+
oc = origin.c,
|
|
1521
|
+
od = origin.d,
|
|
1522
|
+
oe = origin.e,
|
|
1523
|
+
of = origin.f,
|
|
1524
|
+
cosTheta = cos(angle),
|
|
1525
|
+
sinTheta = sin(angle);
|
|
1526
|
+
let rotateCenterX, rotateCenterY;
|
|
1527
|
+
rotateCenter ? (rotateCenterX = rotateCenter[0], rotateCenterY = rotateCenter[1]) : (rotateCenterX = x, rotateCenterY = y);
|
|
1528
|
+
const offsetX = rotateCenterX - x,
|
|
1529
|
+
offsetY = rotateCenterY - y,
|
|
1530
|
+
a1 = oa * cosTheta + oc * sinTheta,
|
|
1531
|
+
b1 = ob * cosTheta + od * sinTheta,
|
|
1532
|
+
c1 = oc * cosTheta - oa * sinTheta,
|
|
1533
|
+
d1 = od * cosTheta - ob * sinTheta;
|
|
1534
|
+
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;
|
|
1535
|
+
}
|
|
1725
1536
|
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
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);
|
|
1537
|
+
function hslToRgb(h, s, l) {
|
|
1538
|
+
s /= 100, l /= 100;
|
|
1539
|
+
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
1540
|
+
x = c * (1 - Math.abs(h / 60 % 2 - 1)),
|
|
1541
|
+
m = l - c / 2;
|
|
1542
|
+
let r = 0,
|
|
1543
|
+
g = 0,
|
|
1544
|
+
b = 0;
|
|
1545
|
+
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)), {
|
|
1546
|
+
r: r,
|
|
1547
|
+
g: g,
|
|
1548
|
+
b: b
|
|
1802
1549
|
};
|
|
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
1550
|
}
|
|
1815
1551
|
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
let
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
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
|
-
}
|
|
1838
|
-
}
|
|
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);
|
|
1552
|
+
function rgbToHsl(r, g, b) {
|
|
1553
|
+
r /= 255, g /= 255, b /= 255;
|
|
1554
|
+
const cMin = Math.min(r, g, b),
|
|
1555
|
+
cMax = Math.max(r, g, b),
|
|
1556
|
+
delta = cMax - cMin;
|
|
1557
|
+
let h = 0,
|
|
1558
|
+
s = 0,
|
|
1559
|
+
l = 0;
|
|
1560
|
+
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), {
|
|
1561
|
+
h: h,
|
|
1562
|
+
s: s,
|
|
1563
|
+
l: l
|
|
1564
|
+
};
|
|
1856
1565
|
}
|
|
1857
|
-
|
|
1858
|
-
|
|
1566
|
+
|
|
1567
|
+
const REG_HEX = /^#([0-9a-f]{3,8})$/,
|
|
1568
|
+
DEFAULT_COLORS_OPACITY = {
|
|
1569
|
+
transparent: 4294967040
|
|
1570
|
+
};
|
|
1571
|
+
const DEFAULT_COLORS = {
|
|
1572
|
+
aliceblue: 15792383,
|
|
1573
|
+
antiquewhite: 16444375,
|
|
1574
|
+
aqua: 65535,
|
|
1575
|
+
aquamarine: 8388564,
|
|
1576
|
+
azure: 15794175,
|
|
1577
|
+
beige: 16119260,
|
|
1578
|
+
bisque: 16770244,
|
|
1579
|
+
black: 0,
|
|
1580
|
+
blanchedalmond: 16772045,
|
|
1581
|
+
blue: 255,
|
|
1582
|
+
blueviolet: 9055202,
|
|
1583
|
+
brown: 10824234,
|
|
1584
|
+
burlywood: 14596231,
|
|
1585
|
+
cadetblue: 6266528,
|
|
1586
|
+
chartreuse: 8388352,
|
|
1587
|
+
chocolate: 13789470,
|
|
1588
|
+
coral: 16744272,
|
|
1589
|
+
cornflowerblue: 6591981,
|
|
1590
|
+
cornsilk: 16775388,
|
|
1591
|
+
crimson: 14423100,
|
|
1592
|
+
cyan: 65535,
|
|
1593
|
+
darkblue: 139,
|
|
1594
|
+
darkcyan: 35723,
|
|
1595
|
+
darkgoldenrod: 12092939,
|
|
1596
|
+
darkgray: 11119017,
|
|
1597
|
+
darkgreen: 25600,
|
|
1598
|
+
darkgrey: 11119017,
|
|
1599
|
+
darkkhaki: 12433259,
|
|
1600
|
+
darkmagenta: 9109643,
|
|
1601
|
+
darkolivegreen: 5597999,
|
|
1602
|
+
darkorange: 16747520,
|
|
1603
|
+
darkorchid: 10040012,
|
|
1604
|
+
darkred: 9109504,
|
|
1605
|
+
darksalmon: 15308410,
|
|
1606
|
+
darkseagreen: 9419919,
|
|
1607
|
+
darkslateblue: 4734347,
|
|
1608
|
+
darkslategray: 3100495,
|
|
1609
|
+
darkslategrey: 3100495,
|
|
1610
|
+
darkturquoise: 52945,
|
|
1611
|
+
darkviolet: 9699539,
|
|
1612
|
+
deeppink: 16716947,
|
|
1613
|
+
deepskyblue: 49151,
|
|
1614
|
+
dimgray: 6908265,
|
|
1615
|
+
dimgrey: 6908265,
|
|
1616
|
+
dodgerblue: 2003199,
|
|
1617
|
+
firebrick: 11674146,
|
|
1618
|
+
floralwhite: 16775920,
|
|
1619
|
+
forestgreen: 2263842,
|
|
1620
|
+
fuchsia: 16711935,
|
|
1621
|
+
gainsboro: 14474460,
|
|
1622
|
+
ghostwhite: 16316671,
|
|
1623
|
+
gold: 16766720,
|
|
1624
|
+
goldenrod: 14329120,
|
|
1625
|
+
gray: 8421504,
|
|
1626
|
+
green: 32768,
|
|
1627
|
+
greenyellow: 11403055,
|
|
1628
|
+
grey: 8421504,
|
|
1629
|
+
honeydew: 15794160,
|
|
1630
|
+
hotpink: 16738740,
|
|
1631
|
+
indianred: 13458524,
|
|
1632
|
+
indigo: 4915330,
|
|
1633
|
+
ivory: 16777200,
|
|
1634
|
+
khaki: 15787660,
|
|
1635
|
+
lavender: 15132410,
|
|
1636
|
+
lavenderblush: 16773365,
|
|
1637
|
+
lawngreen: 8190976,
|
|
1638
|
+
lemonchiffon: 16775885,
|
|
1639
|
+
lightblue: 11393254,
|
|
1640
|
+
lightcoral: 15761536,
|
|
1641
|
+
lightcyan: 14745599,
|
|
1642
|
+
lightgoldenrodyellow: 16448210,
|
|
1643
|
+
lightgray: 13882323,
|
|
1644
|
+
lightgreen: 9498256,
|
|
1645
|
+
lightgrey: 13882323,
|
|
1646
|
+
lightpink: 16758465,
|
|
1647
|
+
lightsalmon: 16752762,
|
|
1648
|
+
lightseagreen: 2142890,
|
|
1649
|
+
lightskyblue: 8900346,
|
|
1650
|
+
lightslategray: 7833753,
|
|
1651
|
+
lightslategrey: 7833753,
|
|
1652
|
+
lightsteelblue: 11584734,
|
|
1653
|
+
lightyellow: 16777184,
|
|
1654
|
+
lime: 65280,
|
|
1655
|
+
limegreen: 3329330,
|
|
1656
|
+
linen: 16445670,
|
|
1657
|
+
magenta: 16711935,
|
|
1658
|
+
maroon: 8388608,
|
|
1659
|
+
mediumaquamarine: 6737322,
|
|
1660
|
+
mediumblue: 205,
|
|
1661
|
+
mediumorchid: 12211667,
|
|
1662
|
+
mediumpurple: 9662683,
|
|
1663
|
+
mediumseagreen: 3978097,
|
|
1664
|
+
mediumslateblue: 8087790,
|
|
1665
|
+
mediumspringgreen: 64154,
|
|
1666
|
+
mediumturquoise: 4772300,
|
|
1667
|
+
mediumvioletred: 13047173,
|
|
1668
|
+
midnightblue: 1644912,
|
|
1669
|
+
mintcream: 16121850,
|
|
1670
|
+
mistyrose: 16770273,
|
|
1671
|
+
moccasin: 16770229,
|
|
1672
|
+
navajowhite: 16768685,
|
|
1673
|
+
navy: 128,
|
|
1674
|
+
oldlace: 16643558,
|
|
1675
|
+
olive: 8421376,
|
|
1676
|
+
olivedrab: 7048739,
|
|
1677
|
+
orange: 16753920,
|
|
1678
|
+
orangered: 16729344,
|
|
1679
|
+
orchid: 14315734,
|
|
1680
|
+
palegoldenrod: 15657130,
|
|
1681
|
+
palegreen: 10025880,
|
|
1682
|
+
paleturquoise: 11529966,
|
|
1683
|
+
palevioletred: 14381203,
|
|
1684
|
+
papayawhip: 16773077,
|
|
1685
|
+
peachpuff: 16767673,
|
|
1686
|
+
peru: 13468991,
|
|
1687
|
+
pink: 16761035,
|
|
1688
|
+
plum: 14524637,
|
|
1689
|
+
powderblue: 11591910,
|
|
1690
|
+
purple: 8388736,
|
|
1691
|
+
rebeccapurple: 6697881,
|
|
1692
|
+
red: 16711680,
|
|
1693
|
+
rosybrown: 12357519,
|
|
1694
|
+
royalblue: 4286945,
|
|
1695
|
+
saddlebrown: 9127187,
|
|
1696
|
+
salmon: 16416882,
|
|
1697
|
+
sandybrown: 16032864,
|
|
1698
|
+
seagreen: 3050327,
|
|
1699
|
+
seashell: 16774638,
|
|
1700
|
+
sienna: 10506797,
|
|
1701
|
+
silver: 12632256,
|
|
1702
|
+
skyblue: 8900331,
|
|
1703
|
+
slateblue: 6970061,
|
|
1704
|
+
slategray: 7372944,
|
|
1705
|
+
slategrey: 7372944,
|
|
1706
|
+
snow: 16775930,
|
|
1707
|
+
springgreen: 65407,
|
|
1708
|
+
steelblue: 4620980,
|
|
1709
|
+
tan: 13808780,
|
|
1710
|
+
teal: 32896,
|
|
1711
|
+
thistle: 14204888,
|
|
1712
|
+
tomato: 16737095,
|
|
1713
|
+
turquoise: 4251856,
|
|
1714
|
+
violet: 15631086,
|
|
1715
|
+
wheat: 16113331,
|
|
1716
|
+
white: 16777215,
|
|
1717
|
+
whitesmoke: 16119285,
|
|
1718
|
+
yellow: 16776960,
|
|
1719
|
+
yellowgreen: 10145074
|
|
1720
|
+
};
|
|
1721
|
+
function hex(value) {
|
|
1722
|
+
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
1859
1723
|
}
|
|
1860
|
-
function
|
|
1861
|
-
return value
|
|
1724
|
+
function rgb(value) {
|
|
1725
|
+
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);
|
|
1862
1726
|
}
|
|
1863
|
-
function
|
|
1864
|
-
|
|
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);
|
|
1868
|
-
}
|
|
1869
|
-
return target;
|
|
1727
|
+
function rgba(value) {
|
|
1728
|
+
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);
|
|
1870
1729
|
}
|
|
1871
|
-
|
|
1872
|
-
|
|
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;
|
|
1730
|
+
function SRGBToLinear(c) {
|
|
1731
|
+
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
1877
1732
|
}
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
function log(method, level, input) {
|
|
1881
|
-
const args = [level].concat([].slice.call(input));
|
|
1882
|
-
hasConsole && console[method].apply(console, args);
|
|
1733
|
+
function LinearToSRGB(c) {
|
|
1734
|
+
return c < .0031308 ? 12.92 * c : 1.055 * Math.pow(c, .41666) - .055;
|
|
1883
1735
|
}
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1736
|
+
const setHex = (formatValue, forceHex) => {
|
|
1737
|
+
const isHex = REG_HEX.exec(formatValue);
|
|
1738
|
+
if (forceHex || isHex) {
|
|
1739
|
+
const hex = parseInt(isHex[1], 16),
|
|
1740
|
+
hexLength = isHex[1].length;
|
|
1741
|
+
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;
|
|
1891
1742
|
}
|
|
1892
|
-
|
|
1893
|
-
|
|
1743
|
+
};
|
|
1744
|
+
class Color {
|
|
1745
|
+
static Brighter(source) {
|
|
1746
|
+
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1747
|
+
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
1894
1748
|
}
|
|
1895
|
-
static
|
|
1896
|
-
|
|
1749
|
+
static SetOpacity(source) {
|
|
1750
|
+
let o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1751
|
+
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
1897
1752
|
}
|
|
1898
|
-
static
|
|
1899
|
-
|
|
1753
|
+
static getColorBrightness(source) {
|
|
1754
|
+
let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "hsl";
|
|
1755
|
+
const color = source instanceof Color ? source : new Color(source);
|
|
1756
|
+
switch (model) {
|
|
1757
|
+
case "hsv":
|
|
1758
|
+
default:
|
|
1759
|
+
return color.getHSVBrightness();
|
|
1760
|
+
case "hsl":
|
|
1761
|
+
return color.getHSLBrightness();
|
|
1762
|
+
case "lum":
|
|
1763
|
+
return color.getLuminance();
|
|
1764
|
+
case "lum2":
|
|
1765
|
+
return color.getLuminance2();
|
|
1766
|
+
case "lum3":
|
|
1767
|
+
return color.getLuminance3();
|
|
1768
|
+
}
|
|
1900
1769
|
}
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1770
|
+
static parseColorString(value) {
|
|
1771
|
+
if (isValid$1(DEFAULT_COLORS_OPACITY[value])) return rgba(DEFAULT_COLORS_OPACITY[value]);
|
|
1772
|
+
if (isValid$1(DEFAULT_COLORS[value])) return rgb(DEFAULT_COLORS[value]);
|
|
1773
|
+
const formatValue = `${value}`.trim().toLowerCase(),
|
|
1774
|
+
hexRes = setHex(formatValue);
|
|
1775
|
+
if (void 0 !== hexRes) return hexRes;
|
|
1776
|
+
if (/^(rgb|RGB|rgba|RGBA)/.test(formatValue)) {
|
|
1777
|
+
const aColor = formatValue.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g, "").split(",");
|
|
1778
|
+
return new RGB(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10), parseFloat(aColor[3]));
|
|
1779
|
+
}
|
|
1780
|
+
if (/^(hsl|HSL|hsla|HSLA)/.test(formatValue)) {
|
|
1781
|
+
const aColor = formatValue.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g, "").split(","),
|
|
1782
|
+
rgb = hslToRgb(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10));
|
|
1783
|
+
return new RGB(rgb.r, rgb.g, rgb.b, parseFloat(aColor[3]));
|
|
1784
|
+
}
|
|
1905
1785
|
}
|
|
1906
|
-
|
|
1907
|
-
|
|
1786
|
+
constructor(value) {
|
|
1787
|
+
const color = Color.parseColorString(value);
|
|
1788
|
+
color ? this.color = color : (this.color = new RGB(255, 255, 255));
|
|
1908
1789
|
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
1790
|
+
toRGBA() {
|
|
1791
|
+
return this.color.formatRgb();
|
|
1912
1792
|
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
args[_key] = arguments[_key];
|
|
1916
|
-
}
|
|
1917
|
-
this._onErrorHandler.forEach(h => h(...args));
|
|
1793
|
+
toString() {
|
|
1794
|
+
return this.color.formatRgb();
|
|
1918
1795
|
}
|
|
1919
|
-
|
|
1920
|
-
return this.
|
|
1796
|
+
toHex() {
|
|
1797
|
+
return this.color.formatHex();
|
|
1921
1798
|
}
|
|
1922
|
-
|
|
1923
|
-
return this.
|
|
1799
|
+
toHsl() {
|
|
1800
|
+
return this.color.formatHsl();
|
|
1924
1801
|
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1802
|
+
brighter(k) {
|
|
1803
|
+
const {
|
|
1804
|
+
r: r,
|
|
1805
|
+
g: g,
|
|
1806
|
+
b: b
|
|
1807
|
+
} = this.color;
|
|
1808
|
+
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;
|
|
1927
1809
|
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1810
|
+
add(color) {
|
|
1811
|
+
const {
|
|
1812
|
+
r: r,
|
|
1813
|
+
g: g,
|
|
1814
|
+
b: b
|
|
1815
|
+
} = this.color;
|
|
1816
|
+
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;
|
|
1930
1817
|
}
|
|
1931
|
-
|
|
1932
|
-
return
|
|
1818
|
+
sub(color) {
|
|
1819
|
+
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;
|
|
1933
1820
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1821
|
+
multiply(color) {
|
|
1822
|
+
const {
|
|
1823
|
+
r: r,
|
|
1824
|
+
g: g,
|
|
1825
|
+
b: b
|
|
1826
|
+
} = this.color;
|
|
1827
|
+
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;
|
|
1940
1828
|
}
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
args[_key3] = arguments[_key3];
|
|
1944
|
-
}
|
|
1945
|
-
return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
|
|
1829
|
+
getHSVBrightness() {
|
|
1830
|
+
return Math.max(this.color.r, this.color.g, this.color.b) / 255;
|
|
1946
1831
|
}
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
args[_key4] = arguments[_key4];
|
|
1950
|
-
}
|
|
1951
|
-
return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
|
|
1832
|
+
getHSLBrightness() {
|
|
1833
|
+
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);
|
|
1952
1834
|
}
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
return this.
|
|
1835
|
+
setHsl(h, s, l) {
|
|
1836
|
+
const opacity = this.color.opacity,
|
|
1837
|
+
hsl = rgbToHsl(this.color.r, this.color.g, this.color.b),
|
|
1838
|
+
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);
|
|
1839
|
+
return this.color = new RGB(rgb.r, rgb.g, rgb.b, opacity), this;
|
|
1958
1840
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
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;
|
|
1841
|
+
setRGB(r, g, b) {
|
|
1842
|
+
return !isNil$1(r) && (this.color.r = r), !isNil$1(g) && (this.color.g = g), !isNil$1(b) && (this.color.b = b), this;
|
|
1843
|
+
}
|
|
1844
|
+
setHex(value) {
|
|
1845
|
+
const formatValue = `${value}`.trim().toLowerCase(),
|
|
1846
|
+
res = setHex(formatValue, !0);
|
|
1847
|
+
return null != res ? res : this;
|
|
1848
|
+
}
|
|
1849
|
+
setColorName(name) {
|
|
1850
|
+
const hex = DEFAULT_COLORS[name.toLowerCase()];
|
|
1851
|
+
return void 0 !== hex ? this.setHex(hex) : (void 0), this;
|
|
1852
|
+
}
|
|
1853
|
+
setScalar(scalar) {
|
|
1854
|
+
return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
|
|
1855
|
+
}
|
|
1856
|
+
setOpacity() {
|
|
1857
|
+
let o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1858
|
+
return this.color.opacity = o, this;
|
|
1859
|
+
}
|
|
1860
|
+
getLuminance() {
|
|
1861
|
+
return (.2126 * this.color.r + .7152 * this.color.g + .0722 * this.color.b) / 255;
|
|
1862
|
+
}
|
|
1863
|
+
getLuminance2() {
|
|
1864
|
+
return (.2627 * this.color.r + .678 * this.color.g + .0593 * this.color.b) / 255;
|
|
1865
|
+
}
|
|
1866
|
+
getLuminance3() {
|
|
1867
|
+
return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
|
|
1991
1868
|
}
|
|
1992
1869
|
clone() {
|
|
1993
|
-
return new
|
|
1870
|
+
return new Color(this.color.toString());
|
|
1994
1871
|
}
|
|
1995
|
-
|
|
1996
|
-
|
|
1872
|
+
copyGammaToLinear(color) {
|
|
1873
|
+
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1874
|
+
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;
|
|
1997
1875
|
}
|
|
1998
|
-
|
|
1999
|
-
|
|
1876
|
+
copyLinearToGamma(color) {
|
|
1877
|
+
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1878
|
+
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
1879
|
+
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;
|
|
2000
1880
|
}
|
|
2001
|
-
|
|
2002
|
-
return
|
|
1881
|
+
convertGammaToLinear(gammaFactor) {
|
|
1882
|
+
return this.copyGammaToLinear(this, gammaFactor), this;
|
|
2003
1883
|
}
|
|
2004
|
-
|
|
2005
|
-
return
|
|
1884
|
+
convertLinearToGamma(gammaFactor) {
|
|
1885
|
+
return this.copyLinearToGamma(this, gammaFactor), this;
|
|
2006
1886
|
}
|
|
2007
|
-
|
|
2008
|
-
|
|
1887
|
+
copySRGBToLinear(color) {
|
|
1888
|
+
return this.color.r = SRGBToLinear(color.color.r), this.color.g = SRGBToLinear(color.color.g), this.color.b = SRGBToLinear(color.color.b), this;
|
|
2009
1889
|
}
|
|
2010
|
-
|
|
2011
|
-
|
|
1890
|
+
copyLinearToSRGB(color) {
|
|
1891
|
+
return this.color.r = LinearToSRGB(color.color.r), this.color.g = LinearToSRGB(color.color.g), this.color.b = LinearToSRGB(color.color.b), this;
|
|
1892
|
+
}
|
|
1893
|
+
convertSRGBToLinear() {
|
|
1894
|
+
return this.copySRGBToLinear(this), this;
|
|
1895
|
+
}
|
|
1896
|
+
convertLinearToSRGB() {
|
|
1897
|
+
return this.copyLinearToSRGB(this), this;
|
|
2012
1898
|
}
|
|
2013
1899
|
}
|
|
2014
|
-
class
|
|
2015
|
-
|
|
2016
|
-
|
|
1900
|
+
class RGB {
|
|
1901
|
+
constructor(r, g, b, opacity) {
|
|
1902
|
+
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;
|
|
2017
1903
|
}
|
|
2018
|
-
|
|
2019
|
-
return
|
|
1904
|
+
formatHex() {
|
|
1905
|
+
return `#${hex(this.r) + hex(this.g) + hex(this.b) + (1 === this.opacity ? "" : hex(255 * this.opacity))}`;
|
|
2020
1906
|
}
|
|
2021
|
-
|
|
2022
|
-
|
|
1907
|
+
formatRgb() {
|
|
1908
|
+
const opacity = this.opacity;
|
|
1909
|
+
return `${1 === opacity ? "rgb(" : "rgba("}${this.r},${this.g},${this.b}${1 === opacity ? ")" : `,${opacity})`}`;
|
|
2023
1910
|
}
|
|
2024
|
-
|
|
2025
|
-
|
|
1911
|
+
formatHsl() {
|
|
1912
|
+
const opacity = this.opacity,
|
|
1913
|
+
{
|
|
1914
|
+
h: h,
|
|
1915
|
+
s: s,
|
|
1916
|
+
l: l
|
|
1917
|
+
} = rgbToHsl(this.r, this.g, this.b);
|
|
1918
|
+
return `${1 === opacity ? "hsl(" : "hsla("}${h},${s}%,${l}%${1 === opacity ? ")" : `,${opacity})`}`;
|
|
1919
|
+
}
|
|
1920
|
+
toString() {
|
|
1921
|
+
return this.formatHex();
|
|
2026
1922
|
}
|
|
2027
1923
|
}
|
|
2028
1924
|
|
|
2029
|
-
function
|
|
2030
|
-
return
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
1925
|
+
function normalizePadding(padding) {
|
|
1926
|
+
if (isValidNumber$1(padding)) return [padding, padding, padding, padding];
|
|
1927
|
+
if (isArray$1(padding)) {
|
|
1928
|
+
const length = padding.length;
|
|
1929
|
+
if (1 === length) {
|
|
1930
|
+
const paddingValue = padding[0];
|
|
1931
|
+
return [paddingValue, paddingValue, paddingValue, paddingValue];
|
|
1932
|
+
}
|
|
1933
|
+
if (2 === length) {
|
|
1934
|
+
const [vertical, horizontal] = padding;
|
|
1935
|
+
return [vertical, horizontal, vertical, horizontal];
|
|
1936
|
+
}
|
|
1937
|
+
if (3 === length) {
|
|
1938
|
+
const [top, horizontal, bottom] = padding;
|
|
1939
|
+
return [top, horizontal, bottom, horizontal];
|
|
1940
|
+
}
|
|
1941
|
+
if (4 === length) return padding;
|
|
1942
|
+
}
|
|
1943
|
+
if (isObject$1(padding)) {
|
|
1944
|
+
const {
|
|
1945
|
+
top = 0,
|
|
1946
|
+
right = 0,
|
|
1947
|
+
bottom = 0,
|
|
1948
|
+
left = 0
|
|
1949
|
+
} = padding;
|
|
1950
|
+
return [top, right, bottom, left];
|
|
1951
|
+
}
|
|
1952
|
+
return [0, 0, 0, 0];
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
const styleStringToObject = function () {
|
|
1956
|
+
let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
1957
|
+
const res = {};
|
|
1958
|
+
return styleStr.split(";").forEach(item => {
|
|
1959
|
+
if (item) {
|
|
1960
|
+
const arr = item.split(":");
|
|
1961
|
+
if (2 === arr.length) {
|
|
1962
|
+
const key = arr[0].trim(),
|
|
1963
|
+
value = arr[1].trim();
|
|
1964
|
+
key && value && (res[key] = value);
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
}), res;
|
|
2039
1968
|
};
|
|
2040
|
-
const
|
|
1969
|
+
const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
2041
1970
|
|
|
2042
|
-
var
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
1971
|
+
var reactIs = {exports: {}};
|
|
1972
|
+
|
|
1973
|
+
var reactIs_production_min = {};
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* @license React
|
|
1977
|
+
* react-is.production.min.js
|
|
1978
|
+
*
|
|
1979
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1980
|
+
*
|
|
1981
|
+
* This source code is licensed under the MIT license found in the
|
|
1982
|
+
* LICENSE file in the root directory of this source tree.
|
|
1983
|
+
*/
|
|
1984
|
+
var hasRequiredReactIs_production_min;
|
|
1985
|
+
function requireReactIs_production_min() {
|
|
1986
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1987
|
+
hasRequiredReactIs_production_min = 1;
|
|
1988
|
+
var b = Symbol.for("react.element"),
|
|
1989
|
+
c = Symbol.for("react.portal"),
|
|
1990
|
+
d = Symbol.for("react.fragment"),
|
|
1991
|
+
e = Symbol.for("react.strict_mode"),
|
|
1992
|
+
f = Symbol.for("react.profiler"),
|
|
1993
|
+
g = Symbol.for("react.provider"),
|
|
1994
|
+
h = Symbol.for("react.context"),
|
|
1995
|
+
k = Symbol.for("react.server_context"),
|
|
1996
|
+
l = Symbol.for("react.forward_ref"),
|
|
1997
|
+
m = Symbol.for("react.suspense"),
|
|
1998
|
+
n = Symbol.for("react.suspense_list"),
|
|
1999
|
+
p = Symbol.for("react.memo"),
|
|
2000
|
+
q = Symbol.for("react.lazy"),
|
|
2001
|
+
t = Symbol.for("react.offscreen"),
|
|
2002
|
+
u;
|
|
2003
|
+
u = Symbol.for("react.module.reference");
|
|
2004
|
+
function v(a) {
|
|
2005
|
+
if ("object" === typeof a && null !== a) {
|
|
2006
|
+
var r = a.$$typeof;
|
|
2007
|
+
switch (r) {
|
|
2008
|
+
case b:
|
|
2009
|
+
switch (a = a.type, a) {
|
|
2010
|
+
case d:
|
|
2011
|
+
case f:
|
|
2012
|
+
case e:
|
|
2013
|
+
case m:
|
|
2014
|
+
case n:
|
|
2015
|
+
return a;
|
|
2016
|
+
default:
|
|
2017
|
+
switch (a = a && a.$$typeof, a) {
|
|
2018
|
+
case k:
|
|
2019
|
+
case h:
|
|
2020
|
+
case l:
|
|
2021
|
+
case q:
|
|
2022
|
+
case p:
|
|
2023
|
+
case g:
|
|
2024
|
+
return a;
|
|
2025
|
+
default:
|
|
2026
|
+
return r;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
case c:
|
|
2030
|
+
return r;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
reactIs_production_min.ContextConsumer = h;
|
|
2035
|
+
reactIs_production_min.ContextProvider = g;
|
|
2036
|
+
reactIs_production_min.Element = b;
|
|
2037
|
+
reactIs_production_min.ForwardRef = l;
|
|
2038
|
+
reactIs_production_min.Fragment = d;
|
|
2039
|
+
reactIs_production_min.Lazy = q;
|
|
2040
|
+
reactIs_production_min.Memo = p;
|
|
2041
|
+
reactIs_production_min.Portal = c;
|
|
2042
|
+
reactIs_production_min.Profiler = f;
|
|
2043
|
+
reactIs_production_min.StrictMode = e;
|
|
2044
|
+
reactIs_production_min.Suspense = m;
|
|
2045
|
+
reactIs_production_min.SuspenseList = n;
|
|
2046
|
+
reactIs_production_min.isAsyncMode = function () {
|
|
2047
|
+
return !1;
|
|
2057
2048
|
};
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
2049
|
+
reactIs_production_min.isConcurrentMode = function () {
|
|
2050
|
+
return !1;
|
|
2061
2051
|
};
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
return {
|
|
2065
|
-
x: (box.x1 + box.x2) / 2,
|
|
2066
|
-
y: (box.y1 + box.y2) / 2
|
|
2052
|
+
reactIs_production_min.isContextConsumer = function (a) {
|
|
2053
|
+
return v(a) === h;
|
|
2067
2054
|
};
|
|
2068
|
-
|
|
2069
|
-
|
|
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);
|
|
2055
|
+
reactIs_production_min.isContextProvider = function (a) {
|
|
2056
|
+
return v(a) === g;
|
|
2113
2057
|
};
|
|
2114
|
-
|
|
2058
|
+
reactIs_production_min.isElement = function (a) {
|
|
2059
|
+
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
2060
|
+
};
|
|
2061
|
+
reactIs_production_min.isForwardRef = function (a) {
|
|
2062
|
+
return v(a) === l;
|
|
2063
|
+
};
|
|
2064
|
+
reactIs_production_min.isFragment = function (a) {
|
|
2065
|
+
return v(a) === d;
|
|
2066
|
+
};
|
|
2067
|
+
reactIs_production_min.isLazy = function (a) {
|
|
2068
|
+
return v(a) === q;
|
|
2069
|
+
};
|
|
2070
|
+
reactIs_production_min.isMemo = function (a) {
|
|
2071
|
+
return v(a) === p;
|
|
2072
|
+
};
|
|
2073
|
+
reactIs_production_min.isPortal = function (a) {
|
|
2074
|
+
return v(a) === c;
|
|
2075
|
+
};
|
|
2076
|
+
reactIs_production_min.isProfiler = function (a) {
|
|
2077
|
+
return v(a) === f;
|
|
2078
|
+
};
|
|
2079
|
+
reactIs_production_min.isStrictMode = function (a) {
|
|
2080
|
+
return v(a) === e;
|
|
2081
|
+
};
|
|
2082
|
+
reactIs_production_min.isSuspense = function (a) {
|
|
2083
|
+
return v(a) === m;
|
|
2084
|
+
};
|
|
2085
|
+
reactIs_production_min.isSuspenseList = function (a) {
|
|
2086
|
+
return v(a) === n;
|
|
2087
|
+
};
|
|
2088
|
+
reactIs_production_min.isValidElementType = function (a) {
|
|
2089
|
+
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;
|
|
2090
|
+
};
|
|
2091
|
+
reactIs_production_min.typeOf = v;
|
|
2092
|
+
return reactIs_production_min;
|
|
2115
2093
|
}
|
|
2116
2094
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
2120
|
-
fontSizeScale || (fontSizeScale = 1);
|
|
2121
|
-
const {
|
|
2122
|
-
fontStyle = defaultAttr.fontStyle,
|
|
2123
|
-
fontVariant = defaultAttr.fontVariant,
|
|
2124
|
-
fontWeight = defaultAttr.fontWeight,
|
|
2125
|
-
fontSize = defaultAttr.fontSize,
|
|
2126
|
-
fontFamily = defaultAttr.fontFamily
|
|
2127
|
-
} = text;
|
|
2128
|
-
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize * fontSizeScale + "px " + (fontFamily || "sans-serif");
|
|
2095
|
+
{
|
|
2096
|
+
reactIs.exports = requireReactIs_production_min();
|
|
2129
2097
|
}
|
|
2098
|
+
var reactIsExports = reactIs.exports;
|
|
2130
2099
|
|
|
2131
|
-
const
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
case "top":
|
|
2146
|
-
case "inside-top":
|
|
2147
|
-
sy = -.5;
|
|
2148
|
-
break;
|
|
2149
|
-
case "bottom":
|
|
2150
|
-
case "inside-bottom":
|
|
2151
|
-
sy = .5;
|
|
2152
|
-
break;
|
|
2153
|
-
case "left":
|
|
2154
|
-
case "inside-left":
|
|
2155
|
-
sx = -.5;
|
|
2156
|
-
break;
|
|
2157
|
-
case "right":
|
|
2158
|
-
case "inside-right":
|
|
2159
|
-
sx = .5;
|
|
2160
|
-
break;
|
|
2161
|
-
case "top-right":
|
|
2162
|
-
sx = .5, sy = -.5;
|
|
2163
|
-
break;
|
|
2164
|
-
case "top-left":
|
|
2165
|
-
sx = -.5, sy = -.5;
|
|
2166
|
-
break;
|
|
2167
|
-
case "bottom-right":
|
|
2168
|
-
sx = .5, sy = .5;
|
|
2169
|
-
break;
|
|
2170
|
-
case "bottom-left":
|
|
2171
|
-
sx = -.5, sy = .5;
|
|
2172
|
-
}
|
|
2173
|
-
return anchorX += sx * rectWidth, anchorY += sy * rectHeight, {
|
|
2174
|
-
x: anchorX,
|
|
2175
|
-
y: anchorY
|
|
2176
|
-
};
|
|
2100
|
+
const toArray = (children) => {
|
|
2101
|
+
let result = [];
|
|
2102
|
+
React.Children.forEach(children, child => {
|
|
2103
|
+
if (isNil$1(child)) {
|
|
2104
|
+
return;
|
|
2105
|
+
}
|
|
2106
|
+
if (reactIsExports.isFragment(child)) {
|
|
2107
|
+
result = result.concat(toArray(child.props.children));
|
|
2108
|
+
}
|
|
2109
|
+
else {
|
|
2110
|
+
result.push(child);
|
|
2111
|
+
}
|
|
2112
|
+
});
|
|
2113
|
+
return result;
|
|
2177
2114
|
};
|
|
2178
2115
|
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2116
|
+
const REACT_PRIVATE_PROPS = ['children', 'hooks', 'ref'];
|
|
2117
|
+
|
|
2118
|
+
const EVENT_TYPE = {
|
|
2119
|
+
...vtable.TABLE_EVENT_TYPE,
|
|
2120
|
+
...vtable.PIVOT_TABLE_EVENT_TYPE,
|
|
2121
|
+
...vtable.PIVOT_CHART_EVENT_TYPE
|
|
2122
|
+
};
|
|
2123
|
+
const TABLE_EVENTS = {
|
|
2124
|
+
onClickCell: EVENT_TYPE.CLICK_CELL,
|
|
2125
|
+
onDblClickCell: EVENT_TYPE.DBLCLICK_CELL,
|
|
2126
|
+
onMouseDownCell: EVENT_TYPE.MOUSEDOWN_CELL,
|
|
2127
|
+
onMouseUpCell: EVENT_TYPE.MOUSEUP_CELL,
|
|
2128
|
+
onSelectedCell: EVENT_TYPE.SELECTED_CELL,
|
|
2129
|
+
onSelectedClear: EVENT_TYPE.SELECTED_CLEAR,
|
|
2130
|
+
onKeyDown: EVENT_TYPE.KEYDOWN,
|
|
2131
|
+
onMouseEnterTable: EVENT_TYPE.MOUSEENTER_TABLE,
|
|
2132
|
+
onMouseLeaveTable: EVENT_TYPE.MOUSELEAVE_TABLE,
|
|
2133
|
+
onMouseDownTable: EVENT_TYPE.MOUSEDOWN_TABLE,
|
|
2134
|
+
onMouseMoveCell: EVENT_TYPE.MOUSEMOVE_CELL,
|
|
2135
|
+
onMouseEnterCell: EVENT_TYPE.MOUSEENTER_CELL,
|
|
2136
|
+
onMouseLeaveCell: EVENT_TYPE.MOUSELEAVE_CELL,
|
|
2137
|
+
onContextMenuCell: EVENT_TYPE.CONTEXTMENU_CELL,
|
|
2138
|
+
onResizeColumn: EVENT_TYPE.RESIZE_COLUMN,
|
|
2139
|
+
onResizeColumnEnd: EVENT_TYPE.RESIZE_COLUMN_END,
|
|
2140
|
+
onChangeHeaderPosition: EVENT_TYPE.CHANGE_HEADER_POSITION,
|
|
2141
|
+
onSortClick: EVENT_TYPE.SORT_CLICK,
|
|
2142
|
+
onFreezeClick: EVENT_TYPE.FREEZE_CLICK,
|
|
2143
|
+
onScroll: EVENT_TYPE.SCROLL,
|
|
2144
|
+
onDropdownMenuClick: EVENT_TYPE.DROPDOWN_MENU_CLICK,
|
|
2145
|
+
onMouseOverChartSymbol: EVENT_TYPE.MOUSEOVER_CHART_SYMBOL,
|
|
2146
|
+
onDragSelectEnd: EVENT_TYPE.DRAG_SELECT_END,
|
|
2147
|
+
onDropdownIconClick: EVENT_TYPE.DROPDOWN_ICON_CLICK,
|
|
2148
|
+
onDropdownMenuClear: EVENT_TYPE.DROPDOWN_MENU_CLEAR,
|
|
2149
|
+
onTreeHierarchyStateChange: EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,
|
|
2150
|
+
onShowMenu: EVENT_TYPE.SHOW_MENU,
|
|
2151
|
+
onHideMenu: EVENT_TYPE.HIDE_MENU,
|
|
2152
|
+
onIconClick: EVENT_TYPE.ICON_CLICK,
|
|
2153
|
+
onLegendItemClick: EVENT_TYPE.LEGEND_ITEM_CLICK,
|
|
2154
|
+
onLegendItemHover: EVENT_TYPE.LEGEND_ITEM_HOVER,
|
|
2155
|
+
onLegendItemUnHover: EVENT_TYPE.LEGEND_ITEM_UNHOVER,
|
|
2156
|
+
onLegendChange: EVENT_TYPE.LEGEND_CHANGE,
|
|
2157
|
+
onMouseEnterAxis: EVENT_TYPE.MOUSEENTER_AXIS,
|
|
2158
|
+
onMouseLeaveAxis: EVENT_TYPE.MOUSELEAVE_AXIS,
|
|
2159
|
+
onCheckboxStateChange: EVENT_TYPE.CHECKBOX_STATE_CHANGE,
|
|
2160
|
+
onRadioStateChange: EVENT_TYPE.RADIO_STATE_CHANGE,
|
|
2161
|
+
onAfterRender: EVENT_TYPE.AFTER_RENDER,
|
|
2162
|
+
onInitialized: EVENT_TYPE.INITIALIZED,
|
|
2163
|
+
onPivotSortClick: EVENT_TYPE.PIVOT_SORT_CLICK,
|
|
2164
|
+
onDrillMenuClick: EVENT_TYPE.DRILLMENU_CLICK,
|
|
2165
|
+
onVChartEventType: EVENT_TYPE.VCHART_EVENT_TYPE,
|
|
2166
|
+
onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
2167
|
+
onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
|
|
2168
|
+
onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
|
|
2169
|
+
onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
|
|
2170
|
+
onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
|
|
2171
|
+
onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END
|
|
2172
|
+
};
|
|
2173
|
+
const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
|
|
2174
|
+
const findEventProps = (props, supportedEvents = TABLE_EVENTS) => {
|
|
2175
|
+
const result = {};
|
|
2176
|
+
Object.keys(props).forEach(key => {
|
|
2177
|
+
if (supportedEvents[key] && props[key]) {
|
|
2178
|
+
result[key] = props[key];
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
2181
|
+
return result;
|
|
2182
|
+
};
|
|
2183
|
+
const bindEventsToTable = (table, newProps, prevProps, supportedEvents = TABLE_EVENTS) => {
|
|
2184
|
+
if ((!newProps && !prevProps) || !table) {
|
|
2185
|
+
return false;
|
|
2186
|
+
}
|
|
2187
|
+
const prevEventProps = prevProps ? findEventProps(prevProps, supportedEvents) : null;
|
|
2188
|
+
const newEventProps = newProps ? findEventProps(newProps, supportedEvents) : null;
|
|
2189
|
+
if (prevEventProps) {
|
|
2190
|
+
Object.keys(prevEventProps).forEach(eventKey => {
|
|
2191
|
+
if (!newEventProps ||
|
|
2192
|
+
!newEventProps[eventKey] ||
|
|
2193
|
+
newEventProps[eventKey] !== prevEventProps[eventKey]) {
|
|
2194
|
+
table.off(supportedEvents[eventKey], prevProps[eventKey]);
|
|
2195
|
+
}
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2198
|
+
if (newEventProps) {
|
|
2199
|
+
Object.keys(newEventProps).forEach(eventKey => {
|
|
2200
|
+
if (!prevEventProps ||
|
|
2201
|
+
!prevEventProps[eventKey] ||
|
|
2202
|
+
prevEventProps[eventKey] !== newEventProps[eventKey]) {
|
|
2203
|
+
table.on(supportedEvents[eventKey], newEventProps[eventKey]);
|
|
2204
|
+
}
|
|
2205
|
+
});
|
|
2206
|
+
}
|
|
2207
|
+
return true;
|
|
2208
|
+
};
|
|
2209
|
+
|
|
2210
|
+
class Generator {
|
|
2211
|
+
static GenAutoIncrementId() {
|
|
2212
|
+
return Generator.auto_increment_id++;
|
|
2258
2213
|
}
|
|
2259
|
-
|
|
2260
|
-
|
|
2214
|
+
}
|
|
2215
|
+
Generator.auto_increment_id = 0;
|
|
2216
|
+
|
|
2217
|
+
class ContainerModule {
|
|
2218
|
+
constructor(registry) {
|
|
2219
|
+
this.id = Generator.GenAutoIncrementId(), this.registry = registry;
|
|
2261
2220
|
}
|
|
2262
|
-
|
|
2263
|
-
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
const NAMED_TAG = "named";
|
|
2224
|
+
const INJECT_TAG = "inject";
|
|
2225
|
+
const MULTI_INJECT_TAG = "multi_inject";
|
|
2226
|
+
const TAGGED = "inversify:tagged";
|
|
2227
|
+
const PARAM_TYPES = "inversify:paramtypes";
|
|
2228
|
+
|
|
2229
|
+
class Metadata {
|
|
2230
|
+
constructor(key, value) {
|
|
2231
|
+
this.key = key, this.value = value;
|
|
2264
2232
|
}
|
|
2265
|
-
|
|
2266
|
-
|
|
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];
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
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;
|
|
2233
|
+
toString() {
|
|
2234
|
+
return this.key === NAMED_TAG ? `named: ${String(this.value).toString()} ` : `tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`;
|
|
2332
2235
|
}
|
|
2333
2236
|
}
|
|
2334
2237
|
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
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;
|
|
2425
|
-
}
|
|
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;
|
|
2429
|
-
}
|
|
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;
|
|
2451
|
-
}
|
|
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;
|
|
2238
|
+
var Reflect$1 = (function (Reflect) {
|
|
2239
|
+
var target;
|
|
2240
|
+
return function (exporter) {
|
|
2241
|
+
const supportsSymbol = "function" == typeof Symbol,
|
|
2242
|
+
toPrimitiveSymbol = supportsSymbol && void 0 !== Symbol.toPrimitive ? Symbol.toPrimitive : "@@toPrimitive",
|
|
2243
|
+
functionPrototype = (Object.getPrototypeOf(Function)),
|
|
2244
|
+
_Map = ("object" == typeof process && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL, Map),
|
|
2245
|
+
Metadata = (new WeakMap());
|
|
2246
|
+
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
2247
|
+
if (!IsObject(target)) throw new TypeError();
|
|
2248
|
+
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
2480
2249
|
}
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
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
|
|
2687
|
-
};
|
|
2688
|
-
function hex(value) {
|
|
2689
|
-
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2250
|
+
function hasMetadata(metadataKey, target, propertyKey) {
|
|
2251
|
+
if (!IsObject(target)) throw new TypeError();
|
|
2252
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
2253
|
+
}
|
|
2254
|
+
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
2255
|
+
if (!IsObject(target)) throw new TypeError();
|
|
2256
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
2257
|
+
}
|
|
2258
|
+
function getMetadata(metadataKey, target, propertyKey) {
|
|
2259
|
+
if (!IsObject(target)) throw new TypeError();
|
|
2260
|
+
return IsUndefined(propertyKey) || (propertyKey = ToPropertyKey(propertyKey)), OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
2261
|
+
}
|
|
2262
|
+
function GetOrCreateMetadataMap(O, P, Create) {
|
|
2263
|
+
let targetMetadata = Metadata.get(O);
|
|
2264
|
+
if (IsUndefined(targetMetadata)) {
|
|
2265
|
+
if (!Create) return;
|
|
2266
|
+
targetMetadata = new _Map(), Metadata.set(O, targetMetadata);
|
|
2267
|
+
}
|
|
2268
|
+
let metadataMap = targetMetadata.get(P);
|
|
2269
|
+
if (IsUndefined(metadataMap)) {
|
|
2270
|
+
if (!Create) return;
|
|
2271
|
+
metadataMap = new _Map(), targetMetadata.set(P, metadataMap);
|
|
2272
|
+
}
|
|
2273
|
+
return metadataMap;
|
|
2274
|
+
}
|
|
2275
|
+
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
2276
|
+
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return !0;
|
|
2277
|
+
const parent = OrdinaryGetPrototypeOf(O);
|
|
2278
|
+
return !IsNull(parent) && OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
2279
|
+
}
|
|
2280
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
2281
|
+
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
2282
|
+
return !IsUndefined(metadataMap) && ToBoolean(metadataMap.has(MetadataKey));
|
|
2283
|
+
}
|
|
2284
|
+
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
2285
|
+
if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
2286
|
+
const parent = OrdinaryGetPrototypeOf(O);
|
|
2287
|
+
return IsNull(parent) ? void 0 : OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
2288
|
+
}
|
|
2289
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
2290
|
+
const metadataMap = GetOrCreateMetadataMap(O, P, !1);
|
|
2291
|
+
if (!IsUndefined(metadataMap)) return metadataMap.get(MetadataKey);
|
|
2292
|
+
}
|
|
2293
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
2294
|
+
GetOrCreateMetadataMap(O, P, !0).set(MetadataKey, MetadataValue);
|
|
2295
|
+
}
|
|
2296
|
+
function Type(x) {
|
|
2297
|
+
if (null === x) return 1;
|
|
2298
|
+
switch (typeof x) {
|
|
2299
|
+
case "undefined":
|
|
2300
|
+
return 0;
|
|
2301
|
+
case "boolean":
|
|
2302
|
+
return 2;
|
|
2303
|
+
case "string":
|
|
2304
|
+
return 3;
|
|
2305
|
+
case "symbol":
|
|
2306
|
+
return 4;
|
|
2307
|
+
case "number":
|
|
2308
|
+
return 5;
|
|
2309
|
+
case "object":
|
|
2310
|
+
return null === x ? 1 : 6;
|
|
2311
|
+
default:
|
|
2312
|
+
return 6;
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
function IsUndefined(x) {
|
|
2316
|
+
return void 0 === x;
|
|
2317
|
+
}
|
|
2318
|
+
function IsNull(x) {
|
|
2319
|
+
return null === x;
|
|
2320
|
+
}
|
|
2321
|
+
function IsSymbol(x) {
|
|
2322
|
+
return "symbol" == typeof x;
|
|
2323
|
+
}
|
|
2324
|
+
function IsObject(x) {
|
|
2325
|
+
return "object" == typeof x ? null !== x : "function" == typeof x;
|
|
2326
|
+
}
|
|
2327
|
+
function ToPrimitive(input, PreferredType) {
|
|
2328
|
+
switch (Type(input)) {
|
|
2329
|
+
case 0:
|
|
2330
|
+
case 1:
|
|
2331
|
+
case 2:
|
|
2332
|
+
case 3:
|
|
2333
|
+
case 4:
|
|
2334
|
+
case 5:
|
|
2335
|
+
return input;
|
|
2336
|
+
}
|
|
2337
|
+
const hint = 3 === PreferredType ? "string" : 5 === PreferredType ? "number" : "default",
|
|
2338
|
+
exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
2339
|
+
if (void 0 !== exoticToPrim) {
|
|
2340
|
+
const result = exoticToPrim.call(input, hint);
|
|
2341
|
+
if (IsObject(result)) throw new TypeError();
|
|
2342
|
+
return result;
|
|
2343
|
+
}
|
|
2344
|
+
return OrdinaryToPrimitive(input, "default" === hint ? "number" : hint);
|
|
2345
|
+
}
|
|
2346
|
+
function OrdinaryToPrimitive(O, hint) {
|
|
2347
|
+
if ("string" === hint) {
|
|
2348
|
+
const toString_1 = O.toString;
|
|
2349
|
+
if (IsCallable(toString_1)) {
|
|
2350
|
+
const result = toString_1.call(O);
|
|
2351
|
+
if (!IsObject(result)) return result;
|
|
2352
|
+
}
|
|
2353
|
+
const valueOf = O.valueOf;
|
|
2354
|
+
if (IsCallable(valueOf)) {
|
|
2355
|
+
const result = valueOf.call(O);
|
|
2356
|
+
if (!IsObject(result)) return result;
|
|
2357
|
+
}
|
|
2358
|
+
} else {
|
|
2359
|
+
const valueOf = O.valueOf;
|
|
2360
|
+
if (IsCallable(valueOf)) {
|
|
2361
|
+
const result = valueOf.call(O);
|
|
2362
|
+
if (!IsObject(result)) return result;
|
|
2363
|
+
}
|
|
2364
|
+
const toString_2 = O.toString;
|
|
2365
|
+
if (IsCallable(toString_2)) {
|
|
2366
|
+
const result = toString_2.call(O);
|
|
2367
|
+
if (!IsObject(result)) return result;
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
throw new TypeError();
|
|
2371
|
+
}
|
|
2372
|
+
function ToBoolean(argument) {
|
|
2373
|
+
return !!argument;
|
|
2374
|
+
}
|
|
2375
|
+
function ToString(argument) {
|
|
2376
|
+
return "" + argument;
|
|
2377
|
+
}
|
|
2378
|
+
function ToPropertyKey(argument) {
|
|
2379
|
+
const key = ToPrimitive(argument, 3);
|
|
2380
|
+
return IsSymbol(key) ? key : ToString(key);
|
|
2381
|
+
}
|
|
2382
|
+
function IsCallable(argument) {
|
|
2383
|
+
return "function" == typeof argument;
|
|
2384
|
+
}
|
|
2385
|
+
function GetMethod(V, P) {
|
|
2386
|
+
const func = V[P];
|
|
2387
|
+
if (null != func) {
|
|
2388
|
+
if (!IsCallable(func)) throw new TypeError();
|
|
2389
|
+
return func;
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
function OrdinaryGetPrototypeOf(O) {
|
|
2393
|
+
const proto = Object.getPrototypeOf(O);
|
|
2394
|
+
if ("function" != typeof O || O === functionPrototype) return proto;
|
|
2395
|
+
if (proto !== functionPrototype) return proto;
|
|
2396
|
+
const prototype = O.prototype,
|
|
2397
|
+
prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
2398
|
+
if (null == prototypeProto || prototypeProto === Object.prototype) return proto;
|
|
2399
|
+
const constructor = prototypeProto.constructor;
|
|
2400
|
+
return "function" != typeof constructor || constructor === O ? proto : constructor;
|
|
2401
|
+
}
|
|
2402
|
+
exporter("defineMetadata", defineMetadata), exporter("hasMetadata", hasMetadata), exporter("hasOwnMetadata", hasOwnMetadata), exporter("getMetadata", getMetadata);
|
|
2403
|
+
}((target = Reflect, function (key, value) {
|
|
2404
|
+
"function" != typeof target[key] && Object.defineProperty(target, key, {
|
|
2405
|
+
configurable: !0,
|
|
2406
|
+
writable: !0,
|
|
2407
|
+
value: value
|
|
2408
|
+
});
|
|
2409
|
+
})), Reflect;
|
|
2410
|
+
})({});
|
|
2411
|
+
|
|
2412
|
+
function _tagParameterOrProperty(metadataKey, annotationTarget, key, metadata) {
|
|
2413
|
+
const metadatas = [metadata];
|
|
2414
|
+
let paramsOrPropertiesMetadata = {};
|
|
2415
|
+
Reflect$1.hasOwnMetadata(metadataKey, annotationTarget) && (paramsOrPropertiesMetadata = Reflect$1.getMetadata(metadataKey, annotationTarget));
|
|
2416
|
+
let paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
|
|
2417
|
+
void 0 === paramOrPropertyMetadata && (paramOrPropertyMetadata = []), paramOrPropertyMetadata.push(...metadatas), paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata, Reflect$1.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
|
|
2690
2418
|
}
|
|
2691
|
-
function
|
|
2692
|
-
|
|
2419
|
+
function tagParameter(annotationTarget, parameterName, parameterIndex, metadata) {
|
|
2420
|
+
_tagParameterOrProperty(TAGGED, annotationTarget, parameterIndex.toString(), metadata);
|
|
2693
2421
|
}
|
|
2694
|
-
function
|
|
2695
|
-
return
|
|
2422
|
+
function createTaggedDecorator(metadata) {
|
|
2423
|
+
return (target, targetKey, indexOrPropertyDescriptor) => {
|
|
2424
|
+
tagParameter(target, targetKey, indexOrPropertyDescriptor, metadata);
|
|
2425
|
+
};
|
|
2696
2426
|
}
|
|
2697
|
-
function
|
|
2698
|
-
return
|
|
2427
|
+
function injectBase(metadataKey) {
|
|
2428
|
+
return serviceIdentifier => (target, targetKey, indexOrPropertyDescriptor) => createTaggedDecorator(new Metadata(metadataKey, serviceIdentifier))(target, targetKey, indexOrPropertyDescriptor);
|
|
2699
2429
|
}
|
|
2700
|
-
|
|
2701
|
-
|
|
2430
|
+
|
|
2431
|
+
const inject = injectBase(INJECT_TAG);
|
|
2432
|
+
|
|
2433
|
+
function injectable() {
|
|
2434
|
+
return function (target) {
|
|
2435
|
+
return Reflect$1.defineMetadata(PARAM_TYPES, null, target), target;
|
|
2436
|
+
};
|
|
2702
2437
|
}
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2438
|
+
|
|
2439
|
+
function named(name) {
|
|
2440
|
+
return createTaggedDecorator(new Metadata(NAMED_TAG, name));
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
const BindingScopeEnum = {
|
|
2444
|
+
Singleton: "Singleton",
|
|
2445
|
+
Transient: "Transient"
|
|
2446
|
+
},
|
|
2447
|
+
BindingTypeEnum = {
|
|
2448
|
+
ConstantValue: "ConstantValue",
|
|
2449
|
+
Constructor: "Constructor",
|
|
2450
|
+
DynamicValue: "DynamicValue",
|
|
2451
|
+
Factory: "Factory",
|
|
2452
|
+
Function: "Function",
|
|
2453
|
+
Instance: "Instance",
|
|
2454
|
+
Invalid: "Invalid",
|
|
2455
|
+
Provider: "Provider"
|
|
2456
|
+
};
|
|
2457
|
+
|
|
2458
|
+
class Binding {
|
|
2459
|
+
constructor(serviceIdentifier, scope) {
|
|
2460
|
+
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;
|
|
2461
|
+
}
|
|
2462
|
+
clone() {
|
|
2463
|
+
const clone = new Binding(this.serviceIdentifier, this.scope);
|
|
2464
|
+
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;
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
class MetadataReader {
|
|
2469
|
+
getConstructorMetadata(constructorFunc) {
|
|
2470
|
+
return {
|
|
2471
|
+
compilerGeneratedMetadata: Reflect$1.getMetadata(PARAM_TYPES, constructorFunc),
|
|
2472
|
+
userGeneratedMetadata: Reflect$1.getMetadata(TAGGED, constructorFunc) || {}
|
|
2473
|
+
};
|
|
2709
2474
|
}
|
|
2475
|
+
getPropertiesMetadata(constructorFunc) {
|
|
2476
|
+
throw new Error("暂未实现");
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
const taggedConstraint = key => value => {
|
|
2481
|
+
const constraint = request => {
|
|
2482
|
+
if (null == request) return !1;
|
|
2483
|
+
if (request.key === key && request.value === value) return !0;
|
|
2484
|
+
if (null == request.constructorArgsMetadata) return !1;
|
|
2485
|
+
const constructorArgsMetadata = request.constructorArgsMetadata;
|
|
2486
|
+
for (let i = 0; i < constructorArgsMetadata.length; i++) if (constructorArgsMetadata[i].key === key && constructorArgsMetadata[i].value === value) return !0;
|
|
2487
|
+
return !1;
|
|
2488
|
+
};
|
|
2489
|
+
return constraint.metaData = new Metadata(key, value), constraint;
|
|
2710
2490
|
};
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2491
|
+
const namedConstraint = taggedConstraint(NAMED_TAG);
|
|
2492
|
+
|
|
2493
|
+
class BindingInSyntax {
|
|
2494
|
+
constructor(binding) {
|
|
2495
|
+
this._binding = binding;
|
|
2715
2496
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
2497
|
+
inRequestScope() {
|
|
2498
|
+
throw new Error("暂未实现");
|
|
2719
2499
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
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
|
-
}
|
|
2500
|
+
inSingletonScope() {
|
|
2501
|
+
return this._binding.scope = BindingScopeEnum.Singleton, this;
|
|
2736
2502
|
}
|
|
2737
|
-
|
|
2738
|
-
|
|
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
|
-
}
|
|
2503
|
+
inTransientScope() {
|
|
2504
|
+
return this._binding.scope = BindingScopeEnum.Transient, this;
|
|
2752
2505
|
}
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
color ? this.color = color : (this.color = new RGB(255, 255, 255));
|
|
2506
|
+
whenTargetNamed(name) {
|
|
2507
|
+
return this._binding.constraint = namedConstraint(name), this;
|
|
2756
2508
|
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
class BindingToSyntax {
|
|
2512
|
+
constructor(binding) {
|
|
2513
|
+
this._binding = binding;
|
|
2759
2514
|
}
|
|
2760
|
-
|
|
2761
|
-
return this.
|
|
2515
|
+
to(constructor) {
|
|
2516
|
+
return this._binding.type = BindingTypeEnum.Instance, this._binding.implementationType = constructor, new BindingInSyntax(this._binding);
|
|
2762
2517
|
}
|
|
2763
|
-
|
|
2764
|
-
|
|
2518
|
+
toSelf() {
|
|
2519
|
+
const self = this._binding.serviceIdentifier;
|
|
2520
|
+
return this.to(self);
|
|
2765
2521
|
}
|
|
2766
|
-
|
|
2767
|
-
return this.
|
|
2522
|
+
toDynamicValue(func) {
|
|
2523
|
+
return this._binding.type = BindingTypeEnum.DynamicValue, this._binding.cache = null, this._binding.dynamicValue = func, this._binding.implementationType = null, new BindingInSyntax(this._binding);
|
|
2768
2524
|
}
|
|
2769
|
-
|
|
2770
|
-
|
|
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;
|
|
2525
|
+
toConstantValue(value) {
|
|
2526
|
+
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);
|
|
2776
2527
|
}
|
|
2777
|
-
|
|
2778
|
-
|
|
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;
|
|
2528
|
+
toFactory(factory) {
|
|
2529
|
+
return this._binding.type = BindingTypeEnum.Factory, this._binding.factory = factory, this._binding.scope = BindingScopeEnum.Singleton, new BindingInSyntax(this._binding);
|
|
2784
2530
|
}
|
|
2785
|
-
|
|
2786
|
-
|
|
2531
|
+
toService(service) {
|
|
2532
|
+
this.toDynamicValue(context => context.container.get(service));
|
|
2787
2533
|
}
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
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;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
class Container {
|
|
2537
|
+
constructor(containerOptions) {
|
|
2538
|
+
const options = containerOptions || {};
|
|
2539
|
+
options.defaultScope = options.defaultScope || BindingScopeEnum.Transient, this.options = options, this.id = Generator.GenAutoIncrementId(), this._bindingDictionary = new Map(), this._metadataReader = new MetadataReader();
|
|
2795
2540
|
}
|
|
2796
|
-
|
|
2797
|
-
|
|
2541
|
+
load(module) {
|
|
2542
|
+
const containerModuleHelpers = this._getContainerModuleHelpersFactory()(module.id);
|
|
2543
|
+
module.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
|
|
2798
2544
|
}
|
|
2799
|
-
|
|
2800
|
-
|
|
2545
|
+
get(serviceIdentifier) {
|
|
2546
|
+
const getArgs = this._getNotAllArgs(serviceIdentifier, !1);
|
|
2547
|
+
return this._get(getArgs);
|
|
2801
2548
|
}
|
|
2802
|
-
|
|
2803
|
-
const
|
|
2804
|
-
|
|
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;
|
|
2549
|
+
getAll(serviceIdentifier) {
|
|
2550
|
+
const getArgs = this._getAllArgs(serviceIdentifier);
|
|
2551
|
+
return this._get(getArgs);
|
|
2807
2552
|
}
|
|
2808
|
-
|
|
2809
|
-
|
|
2553
|
+
getTagged(serviceIdentifier, key, value) {
|
|
2554
|
+
const getArgs = this._getNotAllArgs(serviceIdentifier, !1, key, value);
|
|
2555
|
+
return this._get(getArgs);
|
|
2810
2556
|
}
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
res = setHex(formatValue, !0);
|
|
2814
|
-
return null != res ? res : this;
|
|
2557
|
+
getNamed(serviceIdentifier, named) {
|
|
2558
|
+
return this.getTagged(serviceIdentifier, NAMED_TAG, named);
|
|
2815
2559
|
}
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
return void 0 !== hex ? this.setHex(hex) : (void 0), this;
|
|
2560
|
+
isBound(serviceIdentifier) {
|
|
2561
|
+
return this._bindingDictionary.has(serviceIdentifier);
|
|
2819
2562
|
}
|
|
2820
|
-
|
|
2821
|
-
|
|
2563
|
+
bind(serviceIdentifier) {
|
|
2564
|
+
const scope = this.options.defaultScope,
|
|
2565
|
+
binding = new Binding(serviceIdentifier, scope),
|
|
2566
|
+
list = this._bindingDictionary.get(serviceIdentifier) || [];
|
|
2567
|
+
return list.push(binding), this._bindingDictionary.set(serviceIdentifier, list), new BindingToSyntax(binding);
|
|
2822
2568
|
}
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2569
|
+
unbind(serviceIdentifier) {
|
|
2570
|
+
this._bindingDictionary.delete(serviceIdentifier);
|
|
2571
|
+
}
|
|
2572
|
+
rebind(serviceIdentifier) {
|
|
2573
|
+
return this.unbind(serviceIdentifier), this.bind(serviceIdentifier);
|
|
2574
|
+
}
|
|
2575
|
+
_getContainerModuleHelpersFactory() {
|
|
2576
|
+
const setModuleId = (bindingToSyntax, moduleId) => {
|
|
2577
|
+
bindingToSyntax._binding.moduleId = moduleId;
|
|
2578
|
+
},
|
|
2579
|
+
getBindFunction = moduleId => serviceIdentifier => {
|
|
2580
|
+
const bindingToSyntax = this.bind(serviceIdentifier);
|
|
2581
|
+
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
2582
|
+
},
|
|
2583
|
+
getUnbindFunction = () => serviceIdentifier => this.unbind(serviceIdentifier),
|
|
2584
|
+
getIsboundFunction = () => serviceIdentifier => this.isBound(serviceIdentifier),
|
|
2585
|
+
getRebindFunction = moduleId => serviceIdentifier => {
|
|
2586
|
+
const bindingToSyntax = this.rebind(serviceIdentifier);
|
|
2587
|
+
return setModuleId(bindingToSyntax, moduleId), bindingToSyntax;
|
|
2588
|
+
};
|
|
2589
|
+
return mId => ({
|
|
2590
|
+
bindFunction: getBindFunction(mId),
|
|
2591
|
+
isboundFunction: getIsboundFunction(),
|
|
2592
|
+
rebindFunction: getRebindFunction(mId),
|
|
2593
|
+
unbindFunction: getUnbindFunction(),
|
|
2594
|
+
unbindAsyncFunction: serviceIdentifier => null
|
|
2595
|
+
});
|
|
2826
2596
|
}
|
|
2827
|
-
|
|
2828
|
-
return
|
|
2597
|
+
_getNotAllArgs(serviceIdentifier, isMultiInject, key, value) {
|
|
2598
|
+
return {
|
|
2599
|
+
avoidConstraints: !1,
|
|
2600
|
+
isMultiInject: isMultiInject,
|
|
2601
|
+
serviceIdentifier: serviceIdentifier,
|
|
2602
|
+
key: key,
|
|
2603
|
+
value: value
|
|
2604
|
+
};
|
|
2829
2605
|
}
|
|
2830
|
-
|
|
2831
|
-
return
|
|
2606
|
+
_getAllArgs(serviceIdentifier) {
|
|
2607
|
+
return {
|
|
2608
|
+
avoidConstraints: !0,
|
|
2609
|
+
isMultiInject: !0,
|
|
2610
|
+
serviceIdentifier: serviceIdentifier
|
|
2611
|
+
};
|
|
2832
2612
|
}
|
|
2833
|
-
|
|
2834
|
-
|
|
2613
|
+
_get(getArgs) {
|
|
2614
|
+
const result = [];
|
|
2615
|
+
return this._bindingDictionary.get(getArgs.serviceIdentifier).filter(b => b.constraint(getArgs)).forEach(binding => {
|
|
2616
|
+
result.push(this._resolveFromBinding(binding));
|
|
2617
|
+
}), getArgs.isMultiInject || 1 !== result.length ? result : result[0];
|
|
2835
2618
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2619
|
+
_getChildRequest(binding) {
|
|
2620
|
+
const constr = binding.implementationType,
|
|
2621
|
+
{
|
|
2622
|
+
userGeneratedMetadata: userGeneratedMetadata
|
|
2623
|
+
} = this._metadataReader.getConstructorMetadata(constr),
|
|
2624
|
+
keys = Object.keys(userGeneratedMetadata),
|
|
2625
|
+
arr = [];
|
|
2626
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2627
|
+
const constructorArgsMetadata = userGeneratedMetadata[i],
|
|
2628
|
+
targetMetadataMap = {};
|
|
2629
|
+
constructorArgsMetadata.forEach(md => {
|
|
2630
|
+
targetMetadataMap[md.key] = md.value;
|
|
2631
|
+
});
|
|
2632
|
+
const metadata = {
|
|
2633
|
+
inject: targetMetadataMap[INJECT_TAG],
|
|
2634
|
+
multiInject: targetMetadataMap[MULTI_INJECT_TAG]
|
|
2635
|
+
},
|
|
2636
|
+
injectIdentifier = metadata.inject || metadata.multiInject,
|
|
2637
|
+
target = {
|
|
2638
|
+
serviceIdentifier: injectIdentifier,
|
|
2639
|
+
constructorArgsMetadata: constructorArgsMetadata
|
|
2640
|
+
},
|
|
2641
|
+
request = {
|
|
2642
|
+
injectIdentifier: injectIdentifier,
|
|
2643
|
+
metadata: constructorArgsMetadata,
|
|
2644
|
+
bindings: this._bindingDictionary.get(injectIdentifier).filter(b => b.constraint(target))
|
|
2645
|
+
};
|
|
2646
|
+
arr.push(request);
|
|
2647
|
+
}
|
|
2648
|
+
return arr;
|
|
2838
2649
|
}
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
return this.
|
|
2650
|
+
_resolveFromBinding(binding) {
|
|
2651
|
+
const result = this._getResolvedFromBinding(binding);
|
|
2652
|
+
return this._saveToScope(binding, result), result;
|
|
2842
2653
|
}
|
|
2843
|
-
|
|
2844
|
-
let
|
|
2845
|
-
|
|
2846
|
-
|
|
2654
|
+
_getResolvedFromBinding(binding) {
|
|
2655
|
+
let result;
|
|
2656
|
+
switch (binding.type) {
|
|
2657
|
+
case BindingTypeEnum.ConstantValue:
|
|
2658
|
+
case BindingTypeEnum.Function:
|
|
2659
|
+
result = binding.cache;
|
|
2660
|
+
break;
|
|
2661
|
+
case BindingTypeEnum.Instance:
|
|
2662
|
+
result = this._resolveInstance(binding, binding.implementationType);
|
|
2663
|
+
break;
|
|
2664
|
+
default:
|
|
2665
|
+
result = binding.dynamicValue({
|
|
2666
|
+
container: this
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2669
|
+
return result;
|
|
2847
2670
|
}
|
|
2848
|
-
|
|
2849
|
-
|
|
2671
|
+
_resolveInstance(binding, constr) {
|
|
2672
|
+
if (binding.activated) return binding.cache;
|
|
2673
|
+
const childRequests = this._getChildRequest(binding);
|
|
2674
|
+
return this._createInstance(constr, childRequests);
|
|
2850
2675
|
}
|
|
2851
|
-
|
|
2852
|
-
|
|
2676
|
+
_createInstance(constr, childRequests) {
|
|
2677
|
+
if (childRequests.length) {
|
|
2678
|
+
return new constr(...this._resolveRequests(childRequests));
|
|
2679
|
+
}
|
|
2680
|
+
return new constr();
|
|
2853
2681
|
}
|
|
2854
|
-
|
|
2855
|
-
return
|
|
2682
|
+
_resolveRequests(childRequests) {
|
|
2683
|
+
return childRequests.map(request => request.bindings.length > 1 ? request.bindings.map(binding => this._resolveFromBinding(binding)) : this._resolveFromBinding(request.bindings[0]));
|
|
2856
2684
|
}
|
|
2857
|
-
|
|
2858
|
-
|
|
2685
|
+
_saveToScope(binding, result) {
|
|
2686
|
+
binding.scope === BindingScopeEnum.Singleton && (binding.cache = result, binding.activated = !0);
|
|
2859
2687
|
}
|
|
2860
|
-
|
|
2861
|
-
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
const ContributionProvider = Symbol("ContributionProvider");
|
|
2691
|
+
class ContributionProviderCache {
|
|
2692
|
+
constructor(serviceIdentifier, container) {
|
|
2693
|
+
this.serviceIdentifier = serviceIdentifier, this.container = container;
|
|
2862
2694
|
}
|
|
2863
|
-
|
|
2864
|
-
return this.
|
|
2695
|
+
getContributions() {
|
|
2696
|
+
return this.caches || (this.caches = [], this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier))), this.caches;
|
|
2865
2697
|
}
|
|
2866
2698
|
}
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2699
|
+
function bindContributionProvider(bind, id) {
|
|
2700
|
+
bind(ContributionProvider).toDynamicValue(_ref => {
|
|
2701
|
+
let {
|
|
2702
|
+
container: container
|
|
2703
|
+
} = _ref;
|
|
2704
|
+
return new ContributionProviderCache(id, container);
|
|
2705
|
+
}).inSingletonScope().whenTargetNamed(id);
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
class Hook {
|
|
2709
|
+
constructor(args, name) {
|
|
2710
|
+
this._args = args, this.name = name, this.taps = [];
|
|
2870
2711
|
}
|
|
2871
|
-
|
|
2872
|
-
|
|
2712
|
+
tap(options, fn) {
|
|
2713
|
+
this._tap("sync", options, fn);
|
|
2873
2714
|
}
|
|
2874
|
-
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2715
|
+
unTap(options, fn) {
|
|
2716
|
+
const name = "string" == typeof options ? options.trim() : options.name;
|
|
2717
|
+
name && (this.taps = this.taps.filter(tap => !(tap.name === name && (!fn || tap.fn === fn))));
|
|
2877
2718
|
}
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2719
|
+
_parseOptions(type, options, fn) {
|
|
2720
|
+
let _options;
|
|
2721
|
+
if ("string" == typeof options) _options = {
|
|
2722
|
+
name: options.trim()
|
|
2723
|
+
};else if ("object" != typeof options || null === options) throw new Error("Invalid tap options");
|
|
2724
|
+
if ("string" != typeof _options.name || "" === _options.name) throw new Error("Missing name for tap");
|
|
2725
|
+
return _options = Object.assign({
|
|
2726
|
+
type: type,
|
|
2727
|
+
fn: fn
|
|
2728
|
+
}, _options), _options;
|
|
2886
2729
|
}
|
|
2887
|
-
|
|
2888
|
-
|
|
2730
|
+
_tap(type, options, fn) {
|
|
2731
|
+
this._insert(this._parseOptions(type, options, fn));
|
|
2732
|
+
}
|
|
2733
|
+
_insert(item) {
|
|
2734
|
+
let before;
|
|
2735
|
+
"string" == typeof item.before ? before = new Set([item.before]) : Array.isArray(item.before) && (before = new Set(item.before));
|
|
2736
|
+
let stage = 0;
|
|
2737
|
+
"number" == typeof item.stage && (stage = item.stage);
|
|
2738
|
+
let i = this.taps.length;
|
|
2739
|
+
for (; i > 0;) {
|
|
2740
|
+
i--;
|
|
2741
|
+
const x = this.taps[i];
|
|
2742
|
+
this.taps[i + 1] = x;
|
|
2743
|
+
const xStage = x.stage || 0;
|
|
2744
|
+
if (before) {
|
|
2745
|
+
if (before.has(x.name)) {
|
|
2746
|
+
before.delete(x.name);
|
|
2747
|
+
continue;
|
|
2748
|
+
}
|
|
2749
|
+
if (before.size > 0) continue;
|
|
2750
|
+
}
|
|
2751
|
+
if (!(xStage > stage)) {
|
|
2752
|
+
i++;
|
|
2753
|
+
break;
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
this.taps[i] = item;
|
|
2889
2757
|
}
|
|
2890
2758
|
}
|
|
2891
2759
|
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
if (1 === length) {
|
|
2897
|
-
const paddingValue = padding[0];
|
|
2898
|
-
return [paddingValue, paddingValue, paddingValue, paddingValue];
|
|
2899
|
-
}
|
|
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];
|
|
2760
|
+
class SyncHook extends Hook {
|
|
2761
|
+
call() {
|
|
2762
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2763
|
+
args[_key] = arguments[_key];
|
|
2907
2764
|
}
|
|
2908
|
-
|
|
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];
|
|
2765
|
+
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
2918
2766
|
}
|
|
2919
|
-
return [0, 0, 0, 0];
|
|
2920
2767
|
}
|
|
2921
2768
|
|
|
2922
|
-
const
|
|
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();
|
|
2769
|
+
const EnvContribution = Symbol.for("EnvContribution");
|
|
2937
2770
|
|
|
2938
2771
|
const circleThreshold = tau - 1e-8;
|
|
2939
2772
|
class BoundsContext {
|
|
@@ -4485,8 +4318,14 @@
|
|
|
4485
4318
|
return needTestLetter && (index = testLetter(desc, index)), index;
|
|
4486
4319
|
}
|
|
4487
4320
|
function testLetter(string, index) {
|
|
4321
|
+
let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
4322
|
+
let i = index;
|
|
4323
|
+
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
|
|
4324
|
+
return i;
|
|
4325
|
+
}
|
|
4326
|
+
function testLetter2(string, index) {
|
|
4488
4327
|
let i = index;
|
|
4489
|
-
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i
|
|
4328
|
+
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
|
|
4490
4329
|
return i;
|
|
4491
4330
|
}
|
|
4492
4331
|
function measureTextCanvas(text, character) {
|
|
@@ -7465,7 +7304,7 @@
|
|
|
7465
7304
|
validCheck(attribute, theme, aabbBounds, graphic) {
|
|
7466
7305
|
if (!graphic) return !0;
|
|
7467
7306
|
if (null != attribute.forceBoundsHeight || null != attribute.forceBoundsWidth) return !0;
|
|
7468
|
-
if (graphic.shadowRoot) return !0;
|
|
7307
|
+
if (graphic.shadowRoot || graphic.isContainer) return !0;
|
|
7469
7308
|
const {
|
|
7470
7309
|
visible = theme.visible
|
|
7471
7310
|
} = attribute;
|
|
@@ -8870,20 +8709,22 @@
|
|
|
8870
8709
|
});
|
|
8871
8710
|
break;
|
|
8872
8711
|
}
|
|
8873
|
-
const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-
|
|
8874
|
-
if ("" !== str && "" === clip.str) {
|
|
8712
|
+
const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
|
|
8713
|
+
if ("" !== str && "" === clip.str || clip.wordBreaked) {
|
|
8875
8714
|
if (ellipsis) {
|
|
8876
8715
|
const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
|
|
8877
8716
|
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
8878
8717
|
} else clip.str = "", clip.width = 0;
|
|
8879
8718
|
needCut = !1;
|
|
8880
8719
|
}
|
|
8881
|
-
|
|
8720
|
+
linesLayout.push({
|
|
8882
8721
|
str: clip.str,
|
|
8883
8722
|
width: clip.width
|
|
8884
|
-
})
|
|
8885
|
-
|
|
8886
|
-
|
|
8723
|
+
});
|
|
8724
|
+
let cutLength = clip.str.length;
|
|
8725
|
+
if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked), clip.str.length === str.length) ;else if (needCut) {
|
|
8726
|
+
let newStr = str.substring(cutLength);
|
|
8727
|
+
"keep-all" === wordBreak && (newStr = newStr.replace(/^\s+/g, "")), lines.splice(i + 1, 0, newStr);
|
|
8887
8728
|
}
|
|
8888
8729
|
}
|
|
8889
8730
|
let maxWidth = 0;
|
|
@@ -12718,7 +12559,7 @@
|
|
|
12718
12559
|
if (!(element && ReactDOM && ReactDOM.createRoot)) {
|
|
12719
12560
|
return;
|
|
12720
12561
|
}
|
|
12721
|
-
const id = isNil$
|
|
12562
|
+
const id = isNil$1(react.id) ? `${graphic.id ?? graphic._uid}_react` : react.id;
|
|
12722
12563
|
if (this.htmlMap && this.htmlMap[id] && container && container !== this.htmlMap[id].container) {
|
|
12723
12564
|
this.removeElement(id);
|
|
12724
12565
|
}
|
|
@@ -12773,7 +12614,7 @@
|
|
|
12773
12614
|
let top = 0;
|
|
12774
12615
|
const b = graphic.globalAABBBounds;
|
|
12775
12616
|
let anchorType = options.anchorType;
|
|
12776
|
-
if (isNil$
|
|
12617
|
+
if (isNil$1(anchorType)) {
|
|
12777
12618
|
anchorType = graphic.type === 'text' ? 'position' : 'boundsLeftTop';
|
|
12778
12619
|
}
|
|
12779
12620
|
if (anchorType === 'boundsLeftTop') {
|
|
@@ -12785,7 +12626,7 @@
|
|
|
12785
12626
|
top = matrix.f;
|
|
12786
12627
|
}
|
|
12787
12628
|
else {
|
|
12788
|
-
const anchor = calculateAnchorOfBounds
|
|
12629
|
+
const anchor = calculateAnchorOfBounds(b, anchorType);
|
|
12789
12630
|
left = anchor.x;
|
|
12790
12631
|
top = anchor.y;
|
|
12791
12632
|
}
|
|
@@ -12801,17 +12642,17 @@
|
|
|
12801
12642
|
...this.getTransformOfText(graphic)
|
|
12802
12643
|
};
|
|
12803
12644
|
}
|
|
12804
|
-
if (isFunction$
|
|
12645
|
+
if (isFunction$1(options.style)) {
|
|
12805
12646
|
const userStyle = options.style({ top: offsetTop, left: offsetX, width: b.width(), height: b.height() }, graphic, wrapContainer);
|
|
12806
12647
|
if (userStyle) {
|
|
12807
12648
|
calculateStyle = { ...calculateStyle, ...userStyle };
|
|
12808
12649
|
}
|
|
12809
12650
|
}
|
|
12810
|
-
else if (isObject$
|
|
12651
|
+
else if (isObject$1(options.style)) {
|
|
12811
12652
|
calculateStyle = { ...calculateStyle, ...options.style };
|
|
12812
12653
|
}
|
|
12813
|
-
else if (isString$
|
|
12814
|
-
calculateStyle = { ...calculateStyle, ...styleStringToObject
|
|
12654
|
+
else if (isString$1(options.style) && options.style) {
|
|
12655
|
+
calculateStyle = { ...calculateStyle, ...styleStringToObject(options.style) };
|
|
12815
12656
|
}
|
|
12816
12657
|
application.global.updateDom(wrapContainer, {
|
|
12817
12658
|
width: options.width,
|
|
@@ -12898,7 +12739,7 @@
|
|
|
12898
12739
|
}
|
|
12899
12740
|
const { width, height, style } = params;
|
|
12900
12741
|
if (style) {
|
|
12901
|
-
if (isString$
|
|
12742
|
+
if (isString$1(style)) {
|
|
12902
12743
|
dom.setAttribute('style', style);
|
|
12903
12744
|
}
|
|
12904
12745
|
else {
|
|
@@ -12940,7 +12781,7 @@
|
|
|
12940
12781
|
toArray(props.children).map((child, index) => {
|
|
12941
12782
|
const parseOption = child && child.type && child.type.parseOption;
|
|
12942
12783
|
if (parseOption && child.props) {
|
|
12943
|
-
const childProps = isNil$
|
|
12784
|
+
const childProps = isNil$1(child.props.componentId)
|
|
12944
12785
|
? {
|
|
12945
12786
|
...child.props,
|
|
12946
12787
|
componentId: getComponentId(child, index)
|
|
@@ -12992,6 +12833,7 @@
|
|
|
12992
12833
|
...optionFromChildren.current,
|
|
12993
12834
|
clearDOM: false,
|
|
12994
12835
|
customConfig: {
|
|
12836
|
+
...prevOption.current.customConfig,
|
|
12995
12837
|
createReactContainer: true
|
|
12996
12838
|
}
|
|
12997
12839
|
};
|
|
@@ -18765,7 +18607,7 @@
|
|
|
18765
18607
|
return graphic;
|
|
18766
18608
|
}
|
|
18767
18609
|
function isEventProp(key, props) {
|
|
18768
|
-
return key.startsWith('on') && isFunction$
|
|
18610
|
+
return key.startsWith('on') && isFunction$1(props[key]);
|
|
18769
18611
|
}
|
|
18770
18612
|
function bindEventsToGraphic(graphic, props) {
|
|
18771
18613
|
for (const key in props) {
|
|
@@ -18785,7 +18627,7 @@
|
|
|
18785
18627
|
graphic.addEventListener(REACT_TO_CANOPUS_EVENTS[propKey], newProps[propKey]);
|
|
18786
18628
|
}
|
|
18787
18629
|
}
|
|
18788
|
-
const attribute = newProps.attribute ?? merge
|
|
18630
|
+
const attribute = newProps.attribute ?? merge({}, newProps);
|
|
18789
18631
|
graphic.initAttributes(attribute);
|
|
18790
18632
|
if (graphic.type === 'image') {
|
|
18791
18633
|
graphic.loadImage(attribute.image);
|
|
@@ -19044,7 +18886,7 @@
|
|
|
19044
18886
|
styleTop = cellRect.top + dealWidthNumber(dy, cellRect.height) + cellRect.height + 'px';
|
|
19045
18887
|
}
|
|
19046
18888
|
}
|
|
19047
|
-
const componentStyle = merge
|
|
18889
|
+
const componentStyle = merge({}, style, {
|
|
19048
18890
|
position: 'absolute',
|
|
19049
18891
|
zIndex: 1000,
|
|
19050
18892
|
width: styleWidth,
|
|
@@ -19064,7 +18906,7 @@
|
|
|
19064
18906
|
return { ...defaultProps };
|
|
19065
18907
|
}, [defaultProps]);
|
|
19066
18908
|
const props = reactExports.useMemo(() => {
|
|
19067
|
-
const mProps = merge
|
|
18909
|
+
const mProps = merge({}, componentProps);
|
|
19068
18910
|
for (const propName in _defaultProps) {
|
|
19069
18911
|
if (mProps[propName] === undefined) {
|
|
19070
18912
|
mProps[propName] = _defaultProps[propName];
|
|
@@ -19075,7 +18917,7 @@
|
|
|
19075
18917
|
return props;
|
|
19076
18918
|
}
|
|
19077
18919
|
function dealWidthNumber(value, refenceValue) {
|
|
19078
|
-
if (isNumber$
|
|
18920
|
+
if (isNumber$1(value)) {
|
|
19079
18921
|
return value;
|
|
19080
18922
|
}
|
|
19081
18923
|
if (typeof value === 'string' && value.endsWith('%')) {
|
|
@@ -19123,7 +18965,7 @@
|
|
|
19123
18965
|
}
|
|
19124
18966
|
};
|
|
19125
18967
|
function ButtonComponent(baseProps, ref) {
|
|
19126
|
-
const props = merge
|
|
18968
|
+
const props = merge({}, defaultProps$6, baseProps);
|
|
19127
18969
|
const { disabled, onClick } = props;
|
|
19128
18970
|
let buttonRef = React.useRef(null);
|
|
19129
18971
|
buttonRef = ref ? ref : buttonRef;
|
|
@@ -19218,7 +19060,7 @@
|
|
|
19218
19060
|
}
|
|
19219
19061
|
};
|
|
19220
19062
|
function LinkComponent(baseProps, ref) {
|
|
19221
|
-
const props = merge
|
|
19063
|
+
const props = merge({}, defaultProps$5, baseProps);
|
|
19222
19064
|
const { disabled, href, onClick } = props;
|
|
19223
19065
|
let linkRef = React.useRef(null);
|
|
19224
19066
|
linkRef = ref ? ref : linkRef;
|
|
@@ -19311,7 +19153,7 @@
|
|
|
19311
19153
|
autoFixFontSize: true
|
|
19312
19154
|
};
|
|
19313
19155
|
function AvatarComponent(baseProps, ref) {
|
|
19314
|
-
const props = merge
|
|
19156
|
+
const props = merge({}, defaultProps$4, baseProps);
|
|
19315
19157
|
const { size, children, onClick } = props;
|
|
19316
19158
|
let avatarRef = React.useRef(null);
|
|
19317
19159
|
avatarRef = ref ? ref : avatarRef;
|
|
@@ -19319,7 +19161,7 @@
|
|
|
19319
19161
|
onClick && onClick(event);
|
|
19320
19162
|
}, [onClick]);
|
|
19321
19163
|
const groupAttribute = getGroupAttribute(props);
|
|
19322
|
-
if (isString$
|
|
19164
|
+
if (isString$1(children)) {
|
|
19323
19165
|
const textAttribute = getTextAttribute(props);
|
|
19324
19166
|
return (React.createElement(Group, { ref: avatarRef, attribute: groupAttribute, onClick: handleClick },
|
|
19325
19167
|
React.createElement(Text, { attribute: textAttribute })));
|
|
@@ -19400,7 +19242,7 @@
|
|
|
19400
19242
|
React.createElement("div", { style: arrowStyle }))) : (React.createElement(React.Fragment, null));
|
|
19401
19243
|
};
|
|
19402
19244
|
function PopoverComponent(baseProps, ref) {
|
|
19403
|
-
const props = merge
|
|
19245
|
+
const props = merge({}, defaultProps$3, baseProps);
|
|
19404
19246
|
const { content, position, popupVisible, defaultPopupVisible, children } = props;
|
|
19405
19247
|
let popoverRef = React.useRef(null);
|
|
19406
19248
|
popoverRef = ref ? ref : popoverRef;
|
|
@@ -19432,14 +19274,14 @@
|
|
|
19432
19274
|
}
|
|
19433
19275
|
};
|
|
19434
19276
|
const groupMouseEnter = reactExports.useCallback((event) => {
|
|
19435
|
-
if (isValid$
|
|
19277
|
+
if (isValid$1(popupVisible)) {
|
|
19436
19278
|
return;
|
|
19437
19279
|
}
|
|
19438
19280
|
setPopupOpen(true);
|
|
19439
19281
|
event.currentTarget.stage.renderNextFrame();
|
|
19440
19282
|
}, []);
|
|
19441
19283
|
const groupMouseLeave = reactExports.useCallback((event) => {
|
|
19442
|
-
if (isValid$
|
|
19284
|
+
if (isValid$1(popupVisible)) {
|
|
19443
19285
|
return;
|
|
19444
19286
|
}
|
|
19445
19287
|
setPopupOpen(false);
|
|
@@ -19616,7 +19458,7 @@
|
|
|
19616
19458
|
}
|
|
19617
19459
|
};
|
|
19618
19460
|
function TagComponent(baseProps, ref) {
|
|
19619
|
-
const props = merge
|
|
19461
|
+
const props = merge({}, defaultProps$2, baseProps);
|
|
19620
19462
|
const { attribute, panelStyle, children, ...rest } = props;
|
|
19621
19463
|
let tagRef = React.useRef(null);
|
|
19622
19464
|
tagRef = ref ? ref : tagRef;
|
|
@@ -19633,7 +19475,7 @@
|
|
|
19633
19475
|
|
|
19634
19476
|
const defaultProps$1 = {};
|
|
19635
19477
|
function RadioComponent(baseProps, ref) {
|
|
19636
|
-
const props = merge
|
|
19478
|
+
const props = merge({}, defaultProps$1, baseProps);
|
|
19637
19479
|
const { textStyle, circleStyle, children, ...rest } = props;
|
|
19638
19480
|
let radioRef = React.useRef(null);
|
|
19639
19481
|
radioRef = ref ? ref : radioRef;
|
|
@@ -19662,7 +19504,7 @@
|
|
|
19662
19504
|
|
|
19663
19505
|
const defaultProps = {};
|
|
19664
19506
|
function CheckboxComponent(baseProps, ref) {
|
|
19665
|
-
const props = merge
|
|
19507
|
+
const props = merge({}, defaultProps, baseProps);
|
|
19666
19508
|
const { textStyle, boxStyle, iconStyle, children, ...rest } = props;
|
|
19667
19509
|
let checkboxRef = React.useRef(null);
|
|
19668
19510
|
checkboxRef = ref ? ref : checkboxRef;
|
|
@@ -19688,7 +19530,7 @@
|
|
|
19688
19530
|
const Checkbox = React.forwardRef(CheckboxComponent);
|
|
19689
19531
|
Checkbox.displayName = 'Checkbox';
|
|
19690
19532
|
|
|
19691
|
-
const version = "1.
|
|
19533
|
+
const version = "1.10.0";
|
|
19692
19534
|
|
|
19693
19535
|
Object.defineProperty(exports, 'register', {
|
|
19694
19536
|
enumerable: true,
|