Comparing version 2.6.5 to 2.6.6
@@ -10,5 +10,6 @@ "use strict"; | ||
var ValidatedQuickForm_1 = tslib_1.__importDefault(require("./ValidatedQuickForm")); | ||
var Auto = function (parent) { var _a; return _a = /** @class */ (function (_super) { | ||
tslib_1.__extends(class_1, _super); | ||
function class_1() { | ||
var Auto = function (parent) { | ||
var _ = /** @class */ (function (_super) { | ||
tslib_1.__extends(_, _super); | ||
function _() { | ||
var args = []; | ||
@@ -23,3 +24,3 @@ for (var _i = 0; _i < arguments.length; _i++) { | ||
} | ||
class_1.prototype.componentWillReceiveProps = function (_a) { | ||
_.prototype.componentWillReceiveProps = function (_a) { | ||
var model = _a.model; | ||
@@ -32,9 +33,9 @@ // @ts-ignore | ||
}; | ||
class_1.prototype.getNativeFormProps = function () { | ||
_.prototype.getNativeFormProps = function () { | ||
return omit_1.default(_super.prototype.getNativeFormProps.call(this), ['onChangeModel']); | ||
}; | ||
class_1.prototype.getModel = function (mode) { | ||
_.prototype.getModel = function (mode) { | ||
return mode === 'form' ? this.state.modelSync : this.state.model; | ||
}; | ||
class_1.prototype.onChange = function (key, value) { | ||
_.prototype.onChange = function (key, value) { | ||
var _this = this; | ||
@@ -63,15 +64,16 @@ var updateState = function (state) { return ({ | ||
}; | ||
class_1.prototype.__reset = function (state) { | ||
_.prototype.__reset = function (state) { | ||
return tslib_1.__assign(tslib_1.__assign({}, _super.prototype.__reset.call(this, state)), { model: this.props.model, modelSync: this.props.model }); | ||
}; | ||
class_1.prototype.onValidate = function () { | ||
_.prototype.onValidate = function () { | ||
// @ts-ignore | ||
return this.onValidateModel(this.getChildContextModel()); | ||
}; | ||
return class_1; | ||
}(parent)), | ||
_a.Auto = Auto, | ||
_a.displayName = "Auto" + parent.displayName, | ||
_a.propTypes = tslib_1.__assign(tslib_1.__assign({}, parent.propTypes), { onChangeModel: PropTypes.func }), | ||
_a; }; | ||
_.Auto = Auto; | ||
_.displayName = "Auto" + parent.displayName; | ||
_.propTypes = tslib_1.__assign(tslib_1.__assign({}, parent.propTypes), { onChangeModel: PropTypes.func }); | ||
return _; | ||
}(parent)); | ||
return _; | ||
}; | ||
exports.default = Auto(ValidatedQuickForm_1.default); |
@@ -7,3 +7,4 @@ import * as PropTypes from 'prop-types'; | ||
import ValidatedQuickForm from './ValidatedQuickForm'; | ||
const Auto = (parent) => { var _a; return _a = class extends parent { | ||
const Auto = (parent) => { | ||
class _ extends parent { | ||
constructor(...args) { | ||
@@ -57,7 +58,8 @@ super(...args); | ||
} | ||
}, | ||
_a.Auto = Auto, | ||
_a.displayName = `Auto${parent.displayName}`, | ||
_a.propTypes = Object.assign(Object.assign({}, parent.propTypes), { onChangeModel: PropTypes.func }), | ||
_a; }; | ||
} | ||
_.Auto = Auto; | ||
_.displayName = `Auto${parent.displayName}`; | ||
_.propTypes = Object.assign(Object.assign({}, parent.propTypes), { onChangeModel: PropTypes.func }); | ||
return _; | ||
}; | ||
export default Auto(ValidatedQuickForm); |
@@ -6,3 +6,4 @@ import { __rest } from "tslib"; | ||
import nothing from './nothing'; | ||
const Quick = (parent) => { var _a; return _a = class extends parent { | ||
const Quick = (parent) => { | ||
class _ extends parent { | ||
getNativeFormProps() { | ||
@@ -30,7 +31,8 @@ const _a = super.getNativeFormProps(), { autoField: AutoField = this.getAutoField(), errorsField: ErrorsField = this.getErrorsField(), submitField: SubmitField = this.getSubmitField() } = _a, props = __rest(_a, ["autoField", "errorsField", "submitField"]); | ||
} | ||
}, | ||
_a.Quick = Quick, | ||
_a.displayName = `Quick${parent.displayName}`, | ||
_a.propTypes = Object.assign(Object.assign({}, parent.propTypes), { autoField: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), errorsField: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), submitField: PropTypes.oneOfType([PropTypes.func, PropTypes.string]) }), | ||
_a; }; | ||
} | ||
_.Quick = Quick; | ||
_.displayName = `Quick${parent.displayName}`; | ||
_.propTypes = Object.assign(Object.assign({}, parent.propTypes), { autoField: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), errorsField: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), submitField: PropTypes.oneOfType([PropTypes.func, PropTypes.string]) }); | ||
return _; | ||
}; | ||
export default Quick(BaseForm); |
@@ -10,3 +10,4 @@ import PropTypes from 'prop-types'; | ||
const childContextTypes = __childContextTypesBuild(merge({ state: { validating: PropTypes.bool.isRequired } }, __childContextTypes)); | ||
const Validated = (parent) => { var _a; return _a = class extends parent { | ||
const Validated = (parent) => { | ||
class _ extends parent { | ||
constructor(...args) { | ||
@@ -122,12 +123,13 @@ super(...args); | ||
} | ||
}, | ||
_a.Validated = Validated, | ||
_a.displayName = `Validated${parent.displayName}`, | ||
_a.defaultProps = Object.assign(Object.assign({}, parent.defaultProps), { onValidate(model, error, callback) { | ||
} | ||
_.Validated = Validated; | ||
_.displayName = `Validated${parent.displayName}`; | ||
_.defaultProps = Object.assign(Object.assign({}, parent.defaultProps), { onValidate(model, error, callback) { | ||
callback(); | ||
}, validate: 'onChangeAfterSubmit' }), | ||
_a.propTypes = Object.assign(Object.assign({}, parent.propTypes), { onValidate: PropTypes.func.isRequired, validator: PropTypes.any, validate: PropTypes.oneOf(['onChange', 'onChangeAfterSubmit', 'onSubmit']) | ||
.isRequired }), | ||
_a.childContextTypes = Object.assign(Object.assign({}, (parent.childContextTypes || {})), { uniforms: childContextTypes }), | ||
_a; }; | ||
}, validate: 'onChangeAfterSubmit' }); | ||
_.propTypes = Object.assign(Object.assign({}, parent.propTypes), { onValidate: PropTypes.func.isRequired, validator: PropTypes.any, validate: PropTypes.oneOf(['onChange', 'onChangeAfterSubmit', 'onSubmit']) | ||
.isRequired }); | ||
_.childContextTypes = Object.assign(Object.assign({}, (parent.childContextTypes || {})), { uniforms: childContextTypes }); | ||
return _; | ||
}; | ||
function shouldRevalidate(inProps, inState) { | ||
@@ -134,0 +136,0 @@ return (inProps === 'onChange' || (inProps === 'onChangeAfterSubmit' && inState)); |
{ | ||
"name": "uniforms", | ||
"version": "2.6.5", | ||
"version": "2.6.6", | ||
"license": "MIT", | ||
@@ -37,3 +37,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "45c7ccc8d1292d79472b9ba8f8ce09026648e507" | ||
"gitHead": "6eb04042be544e6b717a80e8ad45e13f0b5d622a" | ||
} |
@@ -8,8 +8,9 @@ "use strict"; | ||
var nothing_1 = tslib_1.__importDefault(require("./nothing")); | ||
var Quick = function (parent) { var _a; return _a = /** @class */ (function (_super) { | ||
tslib_1.__extends(class_1, _super); | ||
function class_1() { | ||
var Quick = function (parent) { | ||
var _ = /** @class */ (function (_super) { | ||
tslib_1.__extends(_, _super); | ||
function _() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
class_1.prototype.getNativeFormProps = function () { | ||
_.prototype.getNativeFormProps = function () { | ||
var _a = _super.prototype.getNativeFormProps.call(this), _b = _a.autoField, AutoField = _b === void 0 ? this.getAutoField() : _b, _c = _a.errorsField, ErrorsField = _c === void 0 ? this.getErrorsField() : _c, _d = _a.submitField, SubmitField = _d === void 0 ? this.getSubmitField() : _d, props = tslib_1.__rest(_a, ["autoField", "errorsField", "submitField"]); | ||
@@ -27,17 +28,18 @@ if (!props.children) { | ||
}; | ||
class_1.prototype.getAutoField = function () { | ||
_.prototype.getAutoField = function () { | ||
return function () { return nothing_1.default; }; | ||
}; | ||
class_1.prototype.getErrorsField = function () { | ||
_.prototype.getErrorsField = function () { | ||
return function () { return nothing_1.default; }; | ||
}; | ||
class_1.prototype.getSubmitField = function () { | ||
_.prototype.getSubmitField = function () { | ||
return function () { return nothing_1.default; }; | ||
}; | ||
return class_1; | ||
}(parent)), | ||
_a.Quick = Quick, | ||
_a.displayName = "Quick" + parent.displayName, | ||
_a.propTypes = tslib_1.__assign(tslib_1.__assign({}, parent.propTypes), { autoField: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.string]), errorsField: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.string]), submitField: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.string]) }), | ||
_a; }; | ||
_.Quick = Quick; | ||
_.displayName = "Quick" + parent.displayName; | ||
_.propTypes = tslib_1.__assign(tslib_1.__assign({}, parent.propTypes), { autoField: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.string]), errorsField: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.string]), submitField: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.string]) }); | ||
return _; | ||
}(parent)); | ||
return _; | ||
}; | ||
exports.default = Quick(BaseForm_1.default); |
@@ -13,5 +13,6 @@ "use strict"; | ||
var childContextTypes = BaseForm_1.__childContextTypesBuild(merge_1.default({ state: { validating: prop_types_1.default.bool.isRequired } }, BaseForm_1.__childContextTypes)); | ||
var Validated = function (parent) { var _a; return _a = /** @class */ (function (_super) { | ||
tslib_1.__extends(class_1, _super); | ||
function class_1() { | ||
var Validated = function (parent) { | ||
var _ = /** @class */ (function (_super) { | ||
tslib_1.__extends(_, _super); | ||
function _() { | ||
var args = []; | ||
@@ -28,9 +29,9 @@ for (var _i = 0; _i < arguments.length; _i++) { | ||
} | ||
class_1.prototype.getChildContextError = function () { | ||
_.prototype.getChildContextError = function () { | ||
return _super.prototype.getChildContextError.call(this) || this.state.error; | ||
}; | ||
class_1.prototype.getChildContextState = function () { | ||
_.prototype.getChildContextState = function () { | ||
return tslib_1.__assign(tslib_1.__assign({}, _super.prototype.getChildContextState.call(this)), { validating: this.state.validating }); | ||
}; | ||
class_1.prototype.getNativeFormProps = function () { | ||
_.prototype.getNativeFormProps = function () { | ||
return omit_1.default(_super.prototype.getNativeFormProps.call(this), [ | ||
@@ -42,3 +43,3 @@ 'onValidate', | ||
}; | ||
class_1.prototype.componentWillReceiveProps = function (_a) { | ||
_.prototype.componentWillReceiveProps = function (_a) { | ||
var _this = this; | ||
@@ -60,3 +61,3 @@ var model = _a.model, schema = _a.schema, validate = _a.validate, validator = _a.validator; | ||
}; | ||
class_1.prototype.onChange = function (key, value) { | ||
_.prototype.onChange = function (key, value) { | ||
if (shouldRevalidate(this.props.validate, this.state.validate)) { | ||
@@ -72,6 +73,6 @@ this.onValidate(key, value).catch(noop_1.default); | ||
}; | ||
class_1.prototype.__reset = function (state) { | ||
_.prototype.__reset = function (state) { | ||
return tslib_1.__assign(tslib_1.__assign({}, _super.prototype.__reset.call(this, state)), { error: null, validate: false, validating: false }); | ||
}; | ||
class_1.prototype.onSubmit = function (event) { | ||
_.prototype.onSubmit = function (event) { | ||
var _this = this; | ||
@@ -105,3 +106,3 @@ if (event) { | ||
}; | ||
class_1.prototype.onValidate = function (key, value) { | ||
_.prototype.onValidate = function (key, value) { | ||
var model = this.getChildContextModel(); | ||
@@ -113,3 +114,3 @@ if (model && key) { | ||
}; | ||
class_1.prototype.onValidateModel = function (model) { | ||
_.prototype.onValidateModel = function (model) { | ||
var _this = this; | ||
@@ -144,13 +145,14 @@ // @ts-ignore | ||
}; | ||
return class_1; | ||
}(parent)), | ||
_a.Validated = Validated, | ||
_a.displayName = "Validated" + parent.displayName, | ||
_a.defaultProps = tslib_1.__assign(tslib_1.__assign({}, parent.defaultProps), { onValidate: function (model, error, callback) { | ||
callback(); | ||
}, validate: 'onChangeAfterSubmit' }), | ||
_a.propTypes = tslib_1.__assign(tslib_1.__assign({}, parent.propTypes), { onValidate: prop_types_1.default.func.isRequired, validator: prop_types_1.default.any, validate: prop_types_1.default.oneOf(['onChange', 'onChangeAfterSubmit', 'onSubmit']) | ||
.isRequired }), | ||
_a.childContextTypes = tslib_1.__assign(tslib_1.__assign({}, (parent.childContextTypes || {})), { uniforms: childContextTypes }), | ||
_a; }; | ||
_.Validated = Validated; | ||
_.displayName = "Validated" + parent.displayName; | ||
_.defaultProps = tslib_1.__assign(tslib_1.__assign({}, parent.defaultProps), { onValidate: function (model, error, callback) { | ||
callback(); | ||
}, validate: 'onChangeAfterSubmit' }); | ||
_.propTypes = tslib_1.__assign(tslib_1.__assign({}, parent.propTypes), { onValidate: prop_types_1.default.func.isRequired, validator: prop_types_1.default.any, validate: prop_types_1.default.oneOf(['onChange', 'onChangeAfterSubmit', 'onSubmit']) | ||
.isRequired }); | ||
_.childContextTypes = tslib_1.__assign(tslib_1.__assign({}, (parent.childContextTypes || {})), { uniforms: childContextTypes }); | ||
return _; | ||
}(parent)); | ||
return _; | ||
}; | ||
function shouldRevalidate(inProps, inState) { | ||
@@ -157,0 +159,0 @@ return (inProps === 'onChange' || (inProps === 'onChangeAfterSubmit' && inState)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3592
138349