react-form-with-constraints-tools
Advanced tools
Comparing version 0.13.0 to 0.14.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('prop-types'), require('react-form-with-constraints')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', 'prop-types', 'react-form-with-constraints'], factory) : | ||
(global = global || self, factory(global.ReactFormWithConstraintsTools = {}, global.React, global.ReactDOM, global.PropTypes, global.ReactFormWithConstraints)); | ||
}(this, function (exports, React, ReactDOM, PropTypes, reactFormWithConstraints) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('react-form-with-constraints')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', 'react-form-with-constraints'], factory) : | ||
(global = global || self, factory(global.ReactFormWithConstraintsTools = {}, global.React, global.PropTypes, global.ReactFormWithConstraints)); | ||
}(this, function (exports, React, PropTypes, reactFormWithConstraints) { 'use strict'; | ||
@@ -36,2 +36,25 @@ /*! ***************************************************************************** | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
} | ||
function __values(o) { | ||
@@ -48,8 +71,19 @@ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
function stringifyWithUndefinedAndWithoutPropertyQuotes(obj, space) { | ||
function beautifulStringify(obj, space) { | ||
var str = JSON.stringify(obj, function (_key, value) { return (value === undefined ? '__undefined__' : value); }, space); | ||
str = str.replace(/"__undefined__"/g, 'undefined'); | ||
str = str.replace(/"([^"]+)":/g, '$1:'); | ||
str = str.replace(/: "(.*[\\"].*)",/g, ': $1,'); | ||
str = str.replace(/\\"/g, '"'); | ||
return str; | ||
} | ||
function normalizeFieldElementProperty(fields) { | ||
return fields.map(function (field) { | ||
var element = field.element, otherProps = __rest(field, ["element"]); | ||
return element | ||
? __assign({ element: reactFormWithConstraints.isHTMLInput(element) | ||
? element.outerHTML | ||
: element.props }, otherProps) : field; | ||
}); | ||
} | ||
var DisplayFields = (function (_super) { | ||
@@ -64,22 +98,18 @@ __extends(DisplayFields, _super); | ||
} | ||
DisplayFields.prototype.componentWillMount = function () { | ||
var form = this.context.form; | ||
form.fieldsStore.addListener(reactFormWithConstraints.FieldEvent.Added, this.reRender); | ||
form.fieldsStore.addListener(reactFormWithConstraints.FieldEvent.Removed, this.reRender); | ||
form.addFieldDidValidateEventListener(this.reRender); | ||
form.addFieldDidResetEventListener(this.reRender); | ||
DisplayFields.prototype.componentDidMount = function () { | ||
this.context.form.fieldsStore.addListener(reactFormWithConstraints.FieldEvent.Added, this.reRender); | ||
this.context.form.fieldsStore.addListener(reactFormWithConstraints.FieldEvent.Removed, this.reRender); | ||
this.context.form.addFieldDidValidateEventListener(this.reRender); | ||
this.context.form.addFieldDidResetEventListener(this.reRender); | ||
}; | ||
DisplayFields.prototype.componentWillUnmount = function () { | ||
var form = this.context.form; | ||
form.fieldsStore.removeListener(reactFormWithConstraints.FieldEvent.Added, this.reRender); | ||
form.fieldsStore.removeListener(reactFormWithConstraints.FieldEvent.Removed, this.reRender); | ||
form.removeFieldDidValidateEventListener(this.reRender); | ||
form.removeFieldDidResetEventListener(this.reRender); | ||
this.context.form.fieldsStore.removeListener(reactFormWithConstraints.FieldEvent.Added, this.reRender); | ||
this.context.form.fieldsStore.removeListener(reactFormWithConstraints.FieldEvent.Removed, this.reRender); | ||
this.context.form.removeFieldDidValidateEventListener(this.reRender); | ||
this.context.form.removeFieldDidResetEventListener(this.reRender); | ||
}; | ||
DisplayFields.prototype.render = function () { | ||
var str = stringifyWithUndefinedAndWithoutPropertyQuotes(this.context.form.fieldsStore.fields, 2); | ||
var str = beautifulStringify(normalizeFieldElementProperty(this.context.form.fieldsStore.fields), 2); | ||
str = str.replace(/{\s+key: (.*),\s+type: (.*),\s+show: (.*)\s+}/g, '{ key: $1, type: $2, show: $3 }'); | ||
return React.createElement("pre", { style: { fontSize: 'small' } }, | ||
"Fields = ", | ||
str); | ||
return str; | ||
}; | ||
@@ -115,3 +145,5 @@ DisplayFields.contextTypes = { | ||
function FieldFeedback() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rootEl = null; | ||
return _this; | ||
} | ||
@@ -128,2 +160,4 @@ FieldFeedback.prototype.getTextDecoration = function () { | ||
break; | ||
default: | ||
textDecoration = ''; | ||
} | ||
@@ -133,4 +167,5 @@ return textDecoration; | ||
FieldFeedback.prototype.render = function () { | ||
var _this = this; | ||
var _a = this.state.validation, key = _a.key, type = _a.type; | ||
return (React.createElement("li", null, | ||
return (React.createElement("li", { ref: function (rootEl) { return (_this.rootEl = rootEl); } }, | ||
React.createElement("span", { style: { textDecoration: this.getTextDecoration() } }, | ||
@@ -147,4 +182,3 @@ "key=\"", | ||
var e_1, _a; | ||
var el = ReactDOM.findDOMNode(this); | ||
var fieldFeedbackSpans = el.querySelectorAll('[data-feedback]'); | ||
var fieldFeedbackSpans = this.rootEl.querySelectorAll('[data-feedback]'); | ||
try { | ||
@@ -163,3 +197,3 @@ for (var fieldFeedbackSpans_1 = __values(fieldFeedbackSpans), fieldFeedbackSpans_1_1 = fieldFeedbackSpans_1.next(); !fieldFeedbackSpans_1_1.done; fieldFeedbackSpans_1_1 = fieldFeedbackSpans_1.next()) { | ||
} | ||
var li = el.closest('li.async'); | ||
var li = this.rootEl.closest('li.async'); | ||
if (li !== null) { | ||
@@ -171,4 +205,4 @@ var async = li.querySelector('span[style]'); | ||
if (type === reactFormWithConstraints.FieldFeedbackType.WhenValid) { | ||
var span = el.querySelector('span[style]'); | ||
var whenValid = el.querySelector("span." + this.props.classes.valid); | ||
var span = this.rootEl.querySelector('span[style]'); | ||
var whenValid = this.rootEl.querySelector("span." + this.props.classes.valid); | ||
span.style.textDecoration = whenValid !== null ? '' : 'line-through'; | ||
@@ -182,15 +216,17 @@ } | ||
function Async() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rootEl = null; | ||
return _this; | ||
} | ||
Async.prototype.getTextDecoration = function () { | ||
Async.getTextDecoration = function () { | ||
return 'line-through dotted'; | ||
}; | ||
Async.prototype.componentWillUpdate = function () { | ||
var el = ReactDOM.findDOMNode(this); | ||
var async = el.querySelector('span[style]'); | ||
async.style.textDecoration = this.getTextDecoration(); | ||
Async.prototype.componentDidUpdate = function () { | ||
var async = this.rootEl.querySelector('span[style]'); | ||
async.style.textDecoration = Async.getTextDecoration(); | ||
}; | ||
Async.prototype.render = function () { | ||
return (React.createElement("li", { className: "async" }, | ||
React.createElement("span", { style: { textDecoration: this.getTextDecoration() } }, "Async"), | ||
var _this = this; | ||
return (React.createElement("li", { className: "async", ref: function (rootEl) { return (_this.rootEl = rootEl); } }, | ||
React.createElement("span", { style: { textDecoration: Async.getTextDecoration() } }, "Async"), | ||
React.createElement("ul", null, _super.prototype.render.call(this)))); | ||
@@ -197,0 +233,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("prop-types"),require("react-form-with-constraints")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","prop-types","react-form-with-constraints"],t):t((e=e||self).ReactFormWithConstraintsTools={},e.React,e.ReactDOM,e.PropTypes,e.ReactFormWithConstraints)}(this,function(e,n,c,t,d){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function r(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i,s=(r(l,i=n.Component),l.prototype.componentWillMount=function(){var e=this.context.form;e.fieldsStore.addListener(d.FieldEvent.Added,this.reRender),e.fieldsStore.addListener(d.FieldEvent.Removed,this.reRender),e.addFieldDidValidateEventListener(this.reRender),e.addFieldDidResetEventListener(this.reRender)},l.prototype.componentWillUnmount=function(){var e=this.context.form;e.fieldsStore.removeListener(d.FieldEvent.Added,this.reRender),e.fieldsStore.removeListener(d.FieldEvent.Removed,this.reRender),e.removeFieldDidValidateEventListener(this.reRender),e.removeFieldDidResetEventListener(this.reRender)},l.prototype.render=function(){var e=function(e,t){var r=JSON.stringify(e,function(e,t){return void 0===t?"__undefined__":t},t);return r=(r=r.replace(/"__undefined__"/g,"undefined")).replace(/"([^"]+)":/g,"$1:")}(this.context.form.fieldsStore.fields,2);return e=e.replace(/{\s+key: (.*),\s+type: (.*),\s+show: (.*)\s+}/g,"{ key: $1, type: $2, show: $3 }"),n.createElement("pre",{style:{fontSize:"small"}},"Fields = ",e)},l.contextTypes={form:t.instanceOf(d.FormWithConstraints).isRequired},l);function l(){var e=null!==i&&i.apply(this,arguments)||this;return e.reRender=function(){e.forceUpdate()},e}var a,p=(r(u,a=d.FieldFeedbacks),u.prototype.render=function(){var e=this.props,t=e.for,r="";return t&&(r+='for="'+t+'" '),r+='stop="'+e.stop+'"',n.createElement(n.Fragment,null,n.createElement("li",null,'key="',this.key,'" ',r),n.createElement("ul",null,a.prototype.render.call(this)))},u);function u(){return null!==a&&a.apply(this,arguments)||this}var y,f=(r(h,y=d.FieldFeedback),h.prototype.getTextDecoration=function(){var e="";switch(this.state.validation.show){case!1:e="line-through";break;case void 0:e="line-through dotted"}return e},h.prototype.render=function(){var e=this.state.validation,t=e.key,r=e.type;return n.createElement("li",null,n.createElement("span",{style:{textDecoration:this.getTextDecoration()}},'key="',t,'" type="',r,'"')," ",y.prototype.render.call(this))},h.prototype.componentDidUpdate=function(){var t,e,r=c.findDOMNode(this),n=r.querySelectorAll("[data-feedback]");try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(n),i=o.next();!i.done;i=o.next())i.value.style.display="inline"}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}var s=r.closest("li.async");if(null!==s&&(s.querySelector("span[style]").style.textDecoration=this.getTextDecoration()),this.state.validation.type===d.FieldFeedbackType.WhenValid){var l=r.querySelector("span[style]"),a=r.querySelector("span."+this.props.classes.valid);l.style.textDecoration=null!==a?"":"line-through"}},h);function h(){return null!==y&&y.apply(this,arguments)||this}var v,m=(r(F,v=d.Async),F.prototype.getTextDecoration=function(){return"line-through dotted"},F.prototype.componentWillUpdate=function(){c.findDOMNode(this).querySelector("span[style]").style.textDecoration=this.getTextDecoration()},F.prototype.render=function(){return n.createElement("li",{className:"async"},n.createElement("span",{style:{textDecoration:this.getTextDecoration()}},"Async"),n.createElement("ul",null,v.prototype.render.call(this)))},F);function F(){return null!==v&&v.apply(this,arguments)||this}Object.defineProperty(e,"FormWithConstraints",{enumerable:!0,get:function(){return d.FormWithConstraints}}),e.Async=m,e.DisplayFields=s,e.FieldFeedback=f,e.FieldFeedbacks=p,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("react-form-with-constraints")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","react-form-with-constraints"],t):t((e=e||self).ReactFormWithConstraintsTools={},e.React,e.PropTypes,e.ReactFormWithConstraints)}(this,function(e,o,t,a){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function r(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e){return e.map(function(e){var t=e.element,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["element"]);return t?i({element:a.isHTMLInput(t)?t.outerHTML:t.props},r):e})}var s,c=(r(p,s=o.Component),p.prototype.componentDidMount=function(){this.context.form.fieldsStore.addListener(a.FieldEvent.Added,this.reRender),this.context.form.fieldsStore.addListener(a.FieldEvent.Removed,this.reRender),this.context.form.addFieldDidValidateEventListener(this.reRender),this.context.form.addFieldDidResetEventListener(this.reRender)},p.prototype.componentWillUnmount=function(){this.context.form.fieldsStore.removeListener(a.FieldEvent.Added,this.reRender),this.context.form.fieldsStore.removeListener(a.FieldEvent.Removed,this.reRender),this.context.form.removeFieldDidValidateEventListener(this.reRender),this.context.form.removeFieldDidResetEventListener(this.reRender)},p.prototype.render=function(){var e=function(e,t){var r=JSON.stringify(e,function(e,t){return void 0===t?"__undefined__":t},t);return r=(r=(r=(r=r.replace(/"__undefined__"/g,"undefined")).replace(/"([^"]+)":/g,"$1:")).replace(/: "(.*[\\"].*)",/g,": $1,")).replace(/\\"/g,'"')}(l(this.context.form.fieldsStore.fields),2);return e=e.replace(/{\s+key: (.*),\s+type: (.*),\s+show: (.*)\s+}/g,"{ key: $1, type: $2, show: $3 }")},p.contextTypes={form:t.instanceOf(a.FormWithConstraints).isRequired},p);function p(){var e=null!==s&&s.apply(this,arguments)||this;return e.reRender=function(){e.forceUpdate()},e}var u,d=(r(f,u=a.FieldFeedbacks),f.prototype.render=function(){var e=this.props,t=e.for,r="";return t&&(r+='for="'+t+'" '),r+='stop="'+e.stop+'"',o.createElement(o.Fragment,null,o.createElement("li",null,'key="',this.key,'" ',r),o.createElement("ul",null,u.prototype.render.call(this)))},f);function f(){return null!==u&&u.apply(this,arguments)||this}var y,h=(r(m,y=a.FieldFeedback),m.prototype.getTextDecoration=function(){var e="";switch(this.state.validation.show){case!1:e="line-through";break;case void 0:e="line-through dotted";break;default:e=""}return e},m.prototype.render=function(){var t=this,e=this.state.validation,r=e.key,n=e.type;return o.createElement("li",{ref:function(e){return t.rootEl=e}},o.createElement("span",{style:{textDecoration:this.getTextDecoration()}},'key="',r,'" type="',n,'"')," ",y.prototype.render.call(this))},m.prototype.componentDidUpdate=function(){var t,e,r=this.rootEl.querySelectorAll("[data-feedback]");try{for(var n=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(r),o=n.next();!o.done;o=n.next())o.value.style.display="inline"}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}var i=this.rootEl.closest("li.async");if(null!==i&&(i.querySelector("span[style]").style.textDecoration=this.getTextDecoration()),this.state.validation.type===a.FieldFeedbackType.WhenValid){var l=this.rootEl.querySelector("span[style]"),s=this.rootEl.querySelector("span."+this.props.classes.valid);l.style.textDecoration=null!==s?"":"line-through"}},m);function m(){var e=null!==y&&y.apply(this,arguments)||this;return e.rootEl=null,e}var v,x=(r(E,v=a.Async),E.getTextDecoration=function(){return"line-through dotted"},E.prototype.componentDidUpdate=function(){this.rootEl.querySelector("span[style]").style.textDecoration=E.getTextDecoration()},E.prototype.render=function(){var t=this;return o.createElement("li",{className:"async",ref:function(e){return t.rootEl=e}},o.createElement("span",{style:{textDecoration:E.getTextDecoration()}},"Async"),o.createElement("ul",null,v.prototype.render.call(this)))},E);function E(){var e=null!==v&&v.apply(this,arguments)||this;return e.rootEl=null,e}Object.defineProperty(e,"FormWithConstraints",{enumerable:!0,get:function(){return a.FormWithConstraints}}),e.Async=x,e.DisplayFields=c,e.FieldFeedback=h,e.FieldFeedbacks=d,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=react-form-with-constraints-tools.production.min.js.map |
@@ -15,6 +15,28 @@ "use strict"; | ||
})(); | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
var __values = (this && this.__values) || function(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
@@ -25,15 +47,26 @@ if (o && i >= o.length) o = void 0; | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var React = require("react"); | ||
var ReactDOM = require("react-dom"); | ||
var PropTypes = require("prop-types"); | ||
var react_form_with_constraints_1 = require("react-form-with-constraints"); | ||
exports.FormWithConstraints = react_form_with_constraints_1.FormWithConstraints; | ||
function stringifyWithUndefinedAndWithoutPropertyQuotes(obj, space) { | ||
function beautifulStringify(obj, space) { | ||
var str = JSON.stringify(obj, function (_key, value) { return (value === undefined ? '__undefined__' : value); }, space); | ||
str = str.replace(/"__undefined__"/g, 'undefined'); | ||
str = str.replace(/"([^"]+)":/g, '$1:'); | ||
str = str.replace(/: "(.*[\\"].*)",/g, ': $1,'); | ||
str = str.replace(/\\"/g, '"'); | ||
return str; | ||
} | ||
function normalizeFieldElementProperty(fields) { | ||
return fields.map(function (field) { | ||
var element = field.element, otherProps = __rest(field, ["element"]); | ||
return element | ||
? __assign({ element: react_form_with_constraints_1.isHTMLInput(element) | ||
? element.outerHTML | ||
: element.props }, otherProps) : field; | ||
}); | ||
} | ||
var DisplayFields = (function (_super) { | ||
@@ -48,22 +81,18 @@ __extends(DisplayFields, _super); | ||
} | ||
DisplayFields.prototype.componentWillMount = function () { | ||
var form = this.context.form; | ||
form.fieldsStore.addListener(react_form_with_constraints_1.FieldEvent.Added, this.reRender); | ||
form.fieldsStore.addListener(react_form_with_constraints_1.FieldEvent.Removed, this.reRender); | ||
form.addFieldDidValidateEventListener(this.reRender); | ||
form.addFieldDidResetEventListener(this.reRender); | ||
DisplayFields.prototype.componentDidMount = function () { | ||
this.context.form.fieldsStore.addListener(react_form_with_constraints_1.FieldEvent.Added, this.reRender); | ||
this.context.form.fieldsStore.addListener(react_form_with_constraints_1.FieldEvent.Removed, this.reRender); | ||
this.context.form.addFieldDidValidateEventListener(this.reRender); | ||
this.context.form.addFieldDidResetEventListener(this.reRender); | ||
}; | ||
DisplayFields.prototype.componentWillUnmount = function () { | ||
var form = this.context.form; | ||
form.fieldsStore.removeListener(react_form_with_constraints_1.FieldEvent.Added, this.reRender); | ||
form.fieldsStore.removeListener(react_form_with_constraints_1.FieldEvent.Removed, this.reRender); | ||
form.removeFieldDidValidateEventListener(this.reRender); | ||
form.removeFieldDidResetEventListener(this.reRender); | ||
this.context.form.fieldsStore.removeListener(react_form_with_constraints_1.FieldEvent.Added, this.reRender); | ||
this.context.form.fieldsStore.removeListener(react_form_with_constraints_1.FieldEvent.Removed, this.reRender); | ||
this.context.form.removeFieldDidValidateEventListener(this.reRender); | ||
this.context.form.removeFieldDidResetEventListener(this.reRender); | ||
}; | ||
DisplayFields.prototype.render = function () { | ||
var str = stringifyWithUndefinedAndWithoutPropertyQuotes(this.context.form.fieldsStore.fields, 2); | ||
var str = beautifulStringify(normalizeFieldElementProperty(this.context.form.fieldsStore.fields), 2); | ||
str = str.replace(/{\s+key: (.*),\s+type: (.*),\s+show: (.*)\s+}/g, '{ key: $1, type: $2, show: $3 }'); | ||
return React.createElement("pre", { style: { fontSize: 'small' } }, | ||
"Fields = ", | ||
str); | ||
return str; | ||
}; | ||
@@ -101,3 +130,5 @@ DisplayFields.contextTypes = { | ||
function FieldFeedback() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rootEl = null; | ||
return _this; | ||
} | ||
@@ -114,2 +145,4 @@ FieldFeedback.prototype.getTextDecoration = function () { | ||
break; | ||
default: | ||
textDecoration = ''; | ||
} | ||
@@ -119,4 +152,5 @@ return textDecoration; | ||
FieldFeedback.prototype.render = function () { | ||
var _this = this; | ||
var _a = this.state.validation, key = _a.key, type = _a.type; | ||
return (React.createElement("li", null, | ||
return (React.createElement("li", { ref: function (rootEl) { return (_this.rootEl = rootEl); } }, | ||
React.createElement("span", { style: { textDecoration: this.getTextDecoration() } }, | ||
@@ -133,4 +167,3 @@ "key=\"", | ||
var e_1, _a; | ||
var el = ReactDOM.findDOMNode(this); | ||
var fieldFeedbackSpans = el.querySelectorAll('[data-feedback]'); | ||
var fieldFeedbackSpans = this.rootEl.querySelectorAll('[data-feedback]'); | ||
try { | ||
@@ -149,3 +182,3 @@ for (var fieldFeedbackSpans_1 = __values(fieldFeedbackSpans), fieldFeedbackSpans_1_1 = fieldFeedbackSpans_1.next(); !fieldFeedbackSpans_1_1.done; fieldFeedbackSpans_1_1 = fieldFeedbackSpans_1.next()) { | ||
} | ||
var li = el.closest('li.async'); | ||
var li = this.rootEl.closest('li.async'); | ||
if (li !== null) { | ||
@@ -157,4 +190,4 @@ var async = li.querySelector('span[style]'); | ||
if (type === react_form_with_constraints_1.FieldFeedbackType.WhenValid) { | ||
var span = el.querySelector('span[style]'); | ||
var whenValid = el.querySelector("span." + this.props.classes.valid); | ||
var span = this.rootEl.querySelector('span[style]'); | ||
var whenValid = this.rootEl.querySelector("span." + this.props.classes.valid); | ||
span.style.textDecoration = whenValid !== null ? '' : 'line-through'; | ||
@@ -169,15 +202,17 @@ } | ||
function Async() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rootEl = null; | ||
return _this; | ||
} | ||
Async.prototype.getTextDecoration = function () { | ||
Async.getTextDecoration = function () { | ||
return 'line-through dotted'; | ||
}; | ||
Async.prototype.componentWillUpdate = function () { | ||
var el = ReactDOM.findDOMNode(this); | ||
var async = el.querySelector('span[style]'); | ||
async.style.textDecoration = this.getTextDecoration(); | ||
Async.prototype.componentDidUpdate = function () { | ||
var async = this.rootEl.querySelector('span[style]'); | ||
async.style.textDecoration = Async.getTextDecoration(); | ||
}; | ||
Async.prototype.render = function () { | ||
return (React.createElement("li", { className: "async" }, | ||
React.createElement("span", { style: { textDecoration: this.getTextDecoration() } }, "Async"), | ||
var _this = this; | ||
return (React.createElement("li", { className: "async", ref: function (rootEl) { return (_this.rootEl = rootEl); } }, | ||
React.createElement("span", { style: { textDecoration: Async.getTextDecoration() } }, "Async"), | ||
React.createElement("ul", null, _super.prototype.render.call(this)))); | ||
@@ -188,2 +223,2 @@ }; | ||
exports.Async = Async; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGlzcGxheUZpZWxkcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9EaXNwbGF5RmllbGRzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsNkJBQStCO0FBQy9CLG9DQUFzQztBQUN0QyxzQ0FBd0M7QUFFeEMsMkVBUXFDO0FBa0U1Qiw4QkF6RVAsaURBQW1CLENBeUVPO0FBOUQ1QixTQUFTLDhDQUE4QyxDQUFDLEdBQVcsRUFBRSxLQUF1QjtJQUMxRixJQUFJLEdBQUcsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUN0QixHQUFHLEVBQ0gsVUFBQyxJQUFJLEVBQUUsS0FBSyxJQUFLLE9BQUEsQ0FBQyxLQUFLLEtBQUssU0FBUyxDQUFDLENBQUMsQ0FBQyxlQUFlLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxFQUEvQyxDQUErQyxFQUNoRSxLQUFLLENBQ04sQ0FBQztJQUNGLEdBQUcsR0FBRyxHQUFHLENBQUMsT0FBTyxDQUFDLGtCQUFrQixFQUFFLFdBQVcsQ0FBQyxDQUFDO0lBQ25ELEdBQUcsR0FBRyxHQUFHLENBQUMsT0FBTyxDQUFDLGFBQWEsRUFBRSxLQUFLLENBQUMsQ0FBQztJQUN4QyxPQUFPLEdBQUcsQ0FBQztBQUNiLENBQUM7QUFFRDtJQUFtQyxpQ0FBZTtJQUFsRDtRQUFBLHFFQWlEQztRQTNCQyxjQUFRLEdBQUc7WUFDVCxLQUFJLENBQUMsV0FBVyxFQUFFLENBQUM7UUFDckIsQ0FBQyxDQUFDOztJQXlCSixD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FxuICAgICAgPGxpIGNsYXNzTmFtZT1cImFzeW5jXCIgcmVmPXtyb290RWwgPT4gKHRoaXMucm9vdEVsID0gcm9vdEVsKX0+XG4gICAgICAgIDxzcGFuIHN0eWxlPXt7IHRleHREZWNvcmF0aW9uOiBBc3luYy5nZXRUZXh0RGVjb3JhdGlvbigpIH19PkFzeW5jPC9zcGFuPlxuICAgICAgICA8dWw+e3N1cGVyLnJlbmRlcigpfTwvdWw+XG4gICAgICA8L2xpPlxuICAgICk7XG4gIH1cbn1cbiJdfQ== |
@@ -6,6 +6,6 @@ import * as React from 'react'; | ||
context: FormWithConstraintsChildContext; | ||
componentWillMount(): void; | ||
componentDidMount(): void; | ||
componentWillUnmount(): void; | ||
reRender: () => void; | ||
render(): JSX.Element; | ||
render(): string; | ||
} | ||
@@ -17,2 +17,3 @@ export { FormWithConstraints }; | ||
export declare class FieldFeedback extends _FieldFeedback { | ||
private rootEl; | ||
private getTextDecoration; | ||
@@ -23,5 +24,6 @@ render(): JSX.Element; | ||
export declare class Async<T> extends _Async<T> { | ||
private getTextDecoration; | ||
componentWillUpdate(): void; | ||
private rootEl; | ||
private static getTextDecoration; | ||
componentDidUpdate(): void; | ||
render(): JSX.Element; | ||
} |
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import * as PropTypes from 'prop-types'; | ||
import { FormWithConstraints, FieldFeedback as _FieldFeedback, FieldFeedbackType, FieldFeedbacks as _FieldFeedbacks, Async as _Async, FieldEvent } from 'react-form-with-constraints'; | ||
function stringifyWithUndefinedAndWithoutPropertyQuotes(obj, space) { | ||
import { FormWithConstraints, FieldFeedback as _FieldFeedback, FieldFeedbackType, FieldFeedbacks as _FieldFeedbacks, Async as _Async, FieldEvent, isHTMLInput } from 'react-form-with-constraints'; | ||
function beautifulStringify(obj, space) { | ||
let str = JSON.stringify(obj, (_key, value) => (value === undefined ? '__undefined__' : value), space); | ||
str = str.replace(/"__undefined__"/g, 'undefined'); | ||
str = str.replace(/"([^"]+)":/g, '$1:'); | ||
str = str.replace(/: "(.*[\\"].*)",/g, ': $1,'); | ||
str = str.replace(/\\"/g, '"'); | ||
return str; | ||
} | ||
function normalizeFieldElementProperty(fields) { | ||
return fields.map(field => { | ||
const { element, ...otherProps } = field; | ||
return element | ||
? { | ||
element: isHTMLInput(element) | ||
? element.outerHTML | ||
: element.props, | ||
...otherProps | ||
} | ||
: field; | ||
}); | ||
} | ||
export class DisplayFields extends React.Component { | ||
@@ -18,22 +32,18 @@ constructor() { | ||
} | ||
componentWillMount() { | ||
const { form } = this.context; | ||
form.fieldsStore.addListener(FieldEvent.Added, this.reRender); | ||
form.fieldsStore.addListener(FieldEvent.Removed, this.reRender); | ||
form.addFieldDidValidateEventListener(this.reRender); | ||
form.addFieldDidResetEventListener(this.reRender); | ||
componentDidMount() { | ||
this.context.form.fieldsStore.addListener(FieldEvent.Added, this.reRender); | ||
this.context.form.fieldsStore.addListener(FieldEvent.Removed, this.reRender); | ||
this.context.form.addFieldDidValidateEventListener(this.reRender); | ||
this.context.form.addFieldDidResetEventListener(this.reRender); | ||
} | ||
componentWillUnmount() { | ||
const { form } = this.context; | ||
form.fieldsStore.removeListener(FieldEvent.Added, this.reRender); | ||
form.fieldsStore.removeListener(FieldEvent.Removed, this.reRender); | ||
form.removeFieldDidValidateEventListener(this.reRender); | ||
form.removeFieldDidResetEventListener(this.reRender); | ||
this.context.form.fieldsStore.removeListener(FieldEvent.Added, this.reRender); | ||
this.context.form.fieldsStore.removeListener(FieldEvent.Removed, this.reRender); | ||
this.context.form.removeFieldDidValidateEventListener(this.reRender); | ||
this.context.form.removeFieldDidResetEventListener(this.reRender); | ||
} | ||
render() { | ||
let str = stringifyWithUndefinedAndWithoutPropertyQuotes(this.context.form.fieldsStore.fields, 2); | ||
let str = beautifulStringify(normalizeFieldElementProperty(this.context.form.fieldsStore.fields), 2); | ||
str = str.replace(/{\s+key: (.*),\s+type: (.*),\s+show: (.*)\s+}/g, '{ key: $1, type: $2, show: $3 }'); | ||
return React.createElement("pre", { style: { fontSize: 'small' } }, | ||
"Fields = ", | ||
str); | ||
return str; | ||
} | ||
@@ -62,2 +72,6 @@ } | ||
export class FieldFeedback extends _FieldFeedback { | ||
constructor() { | ||
super(...arguments); | ||
this.rootEl = null; | ||
} | ||
getTextDecoration() { | ||
@@ -73,2 +87,4 @@ const { show } = this.state.validation; | ||
break; | ||
default: | ||
textDecoration = ''; | ||
} | ||
@@ -79,3 +95,3 @@ return textDecoration; | ||
const { key, type } = this.state.validation; | ||
return (React.createElement("li", null, | ||
return (React.createElement("li", { ref: rootEl => (this.rootEl = rootEl) }, | ||
React.createElement("span", { style: { textDecoration: this.getTextDecoration() } }, | ||
@@ -91,8 +107,7 @@ "key=\"", | ||
componentDidUpdate() { | ||
const el = ReactDOM.findDOMNode(this); | ||
const fieldFeedbackSpans = el.querySelectorAll('[data-feedback]'); | ||
const fieldFeedbackSpans = this.rootEl.querySelectorAll('[data-feedback]'); | ||
for (const fieldFeedbackSpan of fieldFeedbackSpans) { | ||
fieldFeedbackSpan.style.display = 'inline'; | ||
} | ||
const li = el.closest('li.async'); | ||
const li = this.rootEl.closest('li.async'); | ||
if (li !== null) { | ||
@@ -104,4 +119,4 @@ const async = li.querySelector('span[style]'); | ||
if (type === FieldFeedbackType.WhenValid) { | ||
const span = el.querySelector('span[style]'); | ||
const whenValid = el.querySelector(`span.${this.props.classes.valid}`); | ||
const span = this.rootEl.querySelector('span[style]'); | ||
const whenValid = this.rootEl.querySelector(`span.${this.props.classes.valid}`); | ||
span.style.textDecoration = whenValid !== null ? '' : 'line-through'; | ||
@@ -112,15 +127,18 @@ } | ||
export class Async extends _Async { | ||
getTextDecoration() { | ||
constructor() { | ||
super(...arguments); | ||
this.rootEl = null; | ||
} | ||
static getTextDecoration() { | ||
return 'line-through dotted'; | ||
} | ||
componentWillUpdate() { | ||
const el = ReactDOM.findDOMNode(this); | ||
const async = el.querySelector('span[style]'); | ||
async.style.textDecoration = this.getTextDecoration(); | ||
componentDidUpdate() { | ||
const async = this.rootEl.querySelector('span[style]'); | ||
async.style.textDecoration = Async.getTextDecoration(); | ||
} | ||
render() { | ||
return (React.createElement("li", { className: "async" }, | ||
React.createElement("span", { style: { textDecoration: this.getTextDecoration() } }, "Async"), | ||
return (React.createElement("li", { className: "async", ref: rootEl => (this.rootEl = rootEl) }, | ||
React.createElement("span", { style: { textDecoration: Async.getTextDecoration() } }, "Async"), | ||
React.createElement("ul", null, super.render()))); | ||
} | ||
} |
{ | ||
"name": "react-form-with-constraints-tools", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"repository": { | ||
@@ -17,2 +17,3 @@ "type": "git", | ||
], | ||
"main": "lib-es5/index.js", | ||
"module": "lib/index.js", | ||
@@ -29,41 +30,39 @@ "types": "lib/index.d.ts", | ||
"tsc": "tsc", | ||
"build": "run-p build:*", | ||
"build": "yarn build:esnext && yarn build:es5", | ||
"build:esnext": "tsc --project tsconfig.lib.json", | ||
"build:es5": "tsc --project tsconfig.lib-es5.json", | ||
"dist": "run-p dist:*", | ||
"dist": "yarn dist:dev && yarn dist:prod", | ||
"dist:dev": "NODE_ENV=development rollup --config", | ||
"dist:prod": "NODE_ENV=production rollup --config", | ||
"prepublishOnly": "yarn clean && run-p tsc build dist", | ||
"prepublishOnly": "yarn clean && yarn build && yarn dist", | ||
"prepack": "cp ../../LICENSE . && jscodeshift --transform=../../removeConsoleTransform.ts lib lib-es5", | ||
"postpack": "rm LICENSE", | ||
"test": "node --trace-warnings node_modules/.bin/jest --no-cache --verbose", | ||
"test:coverage": "node --trace-warnings node_modules/.bin/jest --no-cache --coverage" | ||
"test": "jest --verbose", | ||
"test:coverage": "jest --coverage" | ||
}, | ||
"peerDependencies": { | ||
"react-dom": ">=16", | ||
"react-form-with-constraints": "^0.13.0" | ||
"react-form-with-constraints": "^0.14.0" | ||
}, | ||
"devDependencies": { | ||
"@types/enzyme": "^3.9.3", | ||
"@types/enzyme": "^3.10.3", | ||
"@types/enzyme-adapter-react-16": "^1.0.5", | ||
"@types/jest": "^24.0.14", | ||
"@types/jscodeshift": "^0.6.1", | ||
"@types/react": "^16.8.20", | ||
"@types/react-dom": "^16.8.4", | ||
"enzyme": "3.9.0", | ||
"@types/jest": "^24.0.18", | ||
"@types/jscodeshift": "^0.6.3", | ||
"@types/react": "^16.9.2", | ||
"@types/react-dom": "^16.9.0", | ||
"enzyme": "^3.10.0", | ||
"enzyme-adapter-react-16": "^1.14.0", | ||
"jest": "^24.8.0", | ||
"jest": "^24.9.0", | ||
"jscodeshift": "^0.6.4", | ||
"npm-run-all": "^4.1.5", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-form-with-constraints": "^0.13.0", | ||
"rollup": "^1.15.3", | ||
"rollup-plugin-filesize": "^6.1.0", | ||
"rollup-plugin-typescript2": "^0.21.1", | ||
"rollup-plugin-uglify": "^6.0.2", | ||
"ts-jest": "^24.0.2", | ||
"typescript": "^3.5.2" | ||
"react": "^16.9.0", | ||
"react-form-with-constraints": "^0.14.0", | ||
"rollup": "^1.21.4", | ||
"rollup-plugin-filesize": "^6.2.0", | ||
"rollup-plugin-typescript2": "^0.24.2", | ||
"rollup-plugin-uglify": "^6.0.3", | ||
"ts-jest": "^24.1.0", | ||
"typescript": "^3.6.3" | ||
}, | ||
"gitHead": "0cb3bb63f7ceb4388a03dc7468a0a842be5f3ff3" | ||
"gitHead": "637b033cfe5fa483c5f46d644aaaeb493bea428a" | ||
} |
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
53152
1
19
633