vis-util 5.0.4 → 5.0.6
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/declarations/util.d.ts +0 -18
- package/declarations/util.d.ts.map +1 -1
- package/esnext/esm/vis-util.js +10 -50
- package/esnext/esm/vis-util.js.map +1 -1
- package/esnext/esm/vis-util.min.js +3 -3
- package/esnext/esm/vis-util.min.js.map +1 -1
- package/esnext/umd/vis-util.js +9 -51
- package/esnext/umd/vis-util.js.map +1 -1
- package/esnext/umd/vis-util.min.js +3 -3
- package/esnext/umd/vis-util.min.js.map +1 -1
- package/package.json +18 -16
- package/peer/esm/vis-util.js +660 -562
- package/peer/esm/vis-util.js.map +1 -1
- package/peer/esm/vis-util.min.js +4 -4
- package/peer/esm/vis-util.min.js.map +1 -1
- package/peer/umd/vis-util.js +659 -563
- package/peer/umd/vis-util.js.map +1 -1
- package/peer/umd/vis-util.min.js +4 -4
- package/peer/umd/vis-util.min.js.map +1 -1
- package/standalone/esm/vis-util.js +660 -562
- package/standalone/esm/vis-util.js.map +1 -1
- package/standalone/esm/vis-util.min.js +4 -4
- package/standalone/esm/vis-util.min.js.map +1 -1
- package/standalone/umd/vis-util.js +659 -563
- package/standalone/umd/vis-util.js.map +1 -1
- package/standalone/umd/vis-util.min.js +4 -4
- package/standalone/umd/vis-util.min.js.map +1 -1
package/esnext/umd/vis-util.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* utilitie collection for visjs
|
|
6
6
|
*
|
|
7
|
-
* @version 5.0.
|
|
8
|
-
* @date 2023-
|
|
7
|
+
* @version 5.0.6
|
|
8
|
+
* @date 2023-11-04T04:55:09.542Z
|
|
9
9
|
*
|
|
10
10
|
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
|
11
11
|
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
}
|
|
72
72
|
const a = values[0];
|
|
73
73
|
const b = values[1];
|
|
74
|
+
if (a instanceof Date && b instanceof Date) {
|
|
75
|
+
a.setTime(b.getTime());
|
|
76
|
+
return a;
|
|
77
|
+
}
|
|
74
78
|
for (const prop of Reflect.ownKeys(b)) {
|
|
75
79
|
if (!Object.prototype.propertyIsEnumerable.call(b, prop)) ;
|
|
76
80
|
else if (b[prop] === DELETE) {
|
|
@@ -101,6 +105,9 @@
|
|
|
101
105
|
return a.map((value) => clone(value));
|
|
102
106
|
}
|
|
103
107
|
else if (typeof a === "object" && a !== null) {
|
|
108
|
+
if (a instanceof Date) {
|
|
109
|
+
return new Date(a.getTime());
|
|
110
|
+
}
|
|
104
111
|
return deepObjectAssignNonentry({}, a);
|
|
105
112
|
}
|
|
106
113
|
else {
|
|
@@ -906,53 +913,6 @@
|
|
|
906
913
|
}
|
|
907
914
|
};
|
|
908
915
|
}
|
|
909
|
-
/**
|
|
910
|
-
* Add and event listener. Works for all browsers.
|
|
911
|
-
*
|
|
912
|
-
* @param element - The element to bind the event listener to.
|
|
913
|
-
* @param action - Same as Element.addEventListener(action, —, —).
|
|
914
|
-
* @param listener - Same as Element.addEventListener(—, listener, —).
|
|
915
|
-
* @param useCapture - Same as Element.addEventListener(—, —, useCapture).
|
|
916
|
-
*/
|
|
917
|
-
function addEventListener(element, action, listener, useCapture) {
|
|
918
|
-
if (element.addEventListener) {
|
|
919
|
-
if (useCapture === undefined) {
|
|
920
|
-
useCapture = false;
|
|
921
|
-
}
|
|
922
|
-
if (action === "mousewheel" && navigator.userAgent.includes("Firefox")) {
|
|
923
|
-
action = "DOMMouseScroll"; // For Firefox
|
|
924
|
-
}
|
|
925
|
-
element.addEventListener(action, listener, useCapture);
|
|
926
|
-
}
|
|
927
|
-
else {
|
|
928
|
-
// @TODO: IE types? Does anyone care?
|
|
929
|
-
element.attachEvent("on" + action, listener); // IE browsers
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* Remove an event listener from an element.
|
|
934
|
-
*
|
|
935
|
-
* @param element - The element to bind the event listener to.
|
|
936
|
-
* @param action - Same as Element.removeEventListener(action, —, —).
|
|
937
|
-
* @param listener - Same as Element.removeEventListener(—, listener, —).
|
|
938
|
-
* @param useCapture - Same as Element.removeEventListener(—, —, useCapture).
|
|
939
|
-
*/
|
|
940
|
-
function removeEventListener(element, action, listener, useCapture) {
|
|
941
|
-
if (element.removeEventListener) {
|
|
942
|
-
// non-IE browsers
|
|
943
|
-
if (useCapture === undefined) {
|
|
944
|
-
useCapture = false;
|
|
945
|
-
}
|
|
946
|
-
if (action === "mousewheel" && navigator.userAgent.includes("Firefox")) {
|
|
947
|
-
action = "DOMMouseScroll"; // For Firefox
|
|
948
|
-
}
|
|
949
|
-
element.removeEventListener(action, listener, useCapture);
|
|
950
|
-
}
|
|
951
|
-
else {
|
|
952
|
-
// @TODO: IE types? Does anyone care?
|
|
953
|
-
element.detachEvent("on" + action, listener); // IE browsers
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
916
|
/**
|
|
957
917
|
* Cancels the event's default action if it is cancelable, without stopping further propagation of the event.
|
|
958
918
|
*
|
|
@@ -4105,7 +4065,6 @@
|
|
|
4105
4065
|
exports.Validator = Validator;
|
|
4106
4066
|
exports.addClassName = addClassName;
|
|
4107
4067
|
exports.addCssText = addCssText;
|
|
4108
|
-
exports.addEventListener = addEventListener;
|
|
4109
4068
|
exports.binarySearchCustom = binarySearchCustom;
|
|
4110
4069
|
exports.binarySearchValue = binarySearchValue;
|
|
4111
4070
|
exports.bridgeObject = bridgeObject;
|
|
@@ -4144,7 +4103,6 @@
|
|
|
4144
4103
|
exports.recursiveDOMDelete = recursiveDOMDelete;
|
|
4145
4104
|
exports.removeClassName = removeClassName;
|
|
4146
4105
|
exports.removeCssText = removeCssText;
|
|
4147
|
-
exports.removeEventListener = removeEventListener;
|
|
4148
4106
|
exports.selectiveBridgeObject = selectiveBridgeObject;
|
|
4149
4107
|
exports.selectiveDeepExtend = selectiveDeepExtend;
|
|
4150
4108
|
exports.selectiveExtend = selectiveExtend;
|