@micromag/core 0.3.117 → 0.3.119
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/es/utils.js +4 -2
- package/lib/utils.js +4 -2
- package/package.json +2 -2
package/es/utils.js
CHANGED
|
@@ -926,7 +926,9 @@ var setValue = function setValue(value, keyParts, fieldValue) {
|
|
|
926
926
|
|
|
927
927
|
if (value !== null || fieldValue !== null) {
|
|
928
928
|
if (isArray) {
|
|
929
|
-
var index = parseInt(key, 10);
|
|
929
|
+
var index = parseInt(key, 10); // TODO: fix this with an explicit delete
|
|
930
|
+
// instead on splicing out the element on null fieldValue
|
|
931
|
+
|
|
930
932
|
var newArrayValue = fieldValue !== null ? [].concat(_toConsumableArray(value.slice(0, index)), [keyParts.length > 0 ? setValue(value !== null ? value[index] || null : null, keyParts, fieldValue) : fieldValue], _toConsumableArray(value.slice(index + 1))) : [].concat(_toConsumableArray(value.slice(0, index)), _toConsumableArray(value.slice(index + 1)));
|
|
931
933
|
return newArrayValue.length > 0 ? newArrayValue : null;
|
|
932
934
|
}
|
|
@@ -979,7 +981,7 @@ var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
|
979
981
|
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
980
982
|
|
|
981
983
|
if (tinycolor.equals(color, tinycolor('white'))) {
|
|
982
|
-
return '
|
|
984
|
+
return '#A13DFF';
|
|
983
985
|
}
|
|
984
986
|
|
|
985
987
|
if (tinycolor.equals(color, tinycolor('black'))) {
|
package/lib/utils.js
CHANGED
|
@@ -945,7 +945,9 @@ var setValue = function setValue(value, keyParts, fieldValue) {
|
|
|
945
945
|
|
|
946
946
|
if (value !== null || fieldValue !== null) {
|
|
947
947
|
if (isArray) {
|
|
948
|
-
var index = parseInt(key, 10);
|
|
948
|
+
var index = parseInt(key, 10); // TODO: fix this with an explicit delete
|
|
949
|
+
// instead on splicing out the element on null fieldValue
|
|
950
|
+
|
|
949
951
|
var newArrayValue = fieldValue !== null ? [].concat(_toConsumableArray__default["default"](value.slice(0, index)), [keyParts.length > 0 ? setValue(value !== null ? value[index] || null : null, keyParts, fieldValue) : fieldValue], _toConsumableArray__default["default"](value.slice(index + 1))) : [].concat(_toConsumableArray__default["default"](value.slice(0, index)), _toConsumableArray__default["default"](value.slice(index + 1)));
|
|
950
952
|
return newArrayValue.length > 0 ? newArrayValue : null;
|
|
951
953
|
}
|
|
@@ -998,7 +1000,7 @@ var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
|
998
1000
|
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
999
1001
|
|
|
1000
1002
|
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('white'))) {
|
|
1001
|
-
return '
|
|
1003
|
+
return '#A13DFF';
|
|
1002
1004
|
}
|
|
1003
1005
|
|
|
1004
1006
|
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('black'))) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.119",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "009841dc1641be98ddce6ed56cfcddc22509f342"
|
|
136
136
|
}
|