dataparcels
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -18,2 +18,4 @@ "use strict"; | ||
var _shallowEquals = _interopRequireDefault(require("unmutable/shallowEquals")); | ||
var _Errors = require("../errors/Errors"); | ||
@@ -95,3 +97,3 @@ | ||
}); | ||
(0, _defineProperty2.default)(this, "hasValueChanged", function () { | ||
(0, _defineProperty2.default)(this, "hasDataChanged", function () { | ||
var keyPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
@@ -103,2 +105,11 @@ | ||
return !Object.is(next.value, prev.value) || !(0, _shallowEquals.default)(next.meta || {})(prev.meta || {}); | ||
}); | ||
(0, _defineProperty2.default)(this, "hasValueChanged", function () { | ||
var keyPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
var _this$getDataIn2 = _this.getDataIn(keyPath), | ||
next = _this$getDataIn2.next, | ||
prev = _this$getDataIn2.prev; | ||
return !Object.is(next.value, prev.value); | ||
@@ -105,0 +116,0 @@ }); |
@@ -33,3 +33,3 @@ "use strict"; | ||
if (meta._submit) { | ||
if (meta._control === 'submit') { | ||
showInvalid = true; | ||
@@ -71,5 +71,5 @@ } | ||
valid: valid, | ||
// _submit is meta that useParcelBuffer uses to trigger a submit | ||
// set this to false if a submit should not occur | ||
_submit: meta._submit && valid | ||
// _control is meta that useParcelBuffer uses to trigger a submit or reset | ||
// set this to null if a submit should not occur | ||
_control: meta._control === 'submit' && !valid ? null : meta._control | ||
}; | ||
@@ -76,0 +76,0 @@ return (0, _setMeta.default)(newMeta)(parcelData); |
{ | ||
"name": "dataparcels", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A library for editing data structures that works really well with React.", | ||
@@ -15,2 +15,5 @@ "main": "lib/index.js", | ||
"Action.js", | ||
"asChildNodes.js", | ||
"asNode.js", | ||
"asRaw.js", | ||
"cancel.js", | ||
@@ -20,5 +23,2 @@ "ChangeRequest.js", | ||
"ParcelNode.js", | ||
"asNode.js", | ||
"asChildNodes.js", | ||
"asRaw.js", | ||
"validation.js" | ||
@@ -55,3 +55,3 @@ ], | ||
}, | ||
"gitHead": "193da27faafcc2c08ec3ba61c8c0f30e10f5d34c" | ||
"gitHead": "0b3d7a74eb55920f65f4f63a59987595d63975e7" | ||
} |
89155
2012