From 131340acbdac64de0e9479f6ed1aed89c2ca1568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Przoda=C5=82a?= Date: Wed, 19 Jul 2017 11:12:44 +0200 Subject: [PATCH] new build --- Bootstrap.js | 2 +- main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bootstrap.js b/Bootstrap.js index 5230bf3..b619e95 100644 --- a/Bootstrap.js +++ b/Bootstrap.js @@ -8,4 +8,4 @@ object-assign (c) Sindre Sorhus @license MIT */ -var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=r(e),l=1;l-1&&this.listeners.splice(t,1)}}]),e}();t.default=i},function(e,t,n){"use strict";function r(e,t,n,r,o){}e.exports=r},function(e,t,n){"use strict";var r=n(22);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";var r=n(9),o=n(3),i=n(2),s=n(17),a=n(20);e.exports=function(e,t){function n(e){var t=e&&(O&&e[O]||e[E]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function c(e){function n(n,r,i,a,u,c,p){if(a=a||C,c=c||i,p!==s)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[i]?n?new l(null===r[i]?"The "+u+" `"+c+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+u+" `"+c+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,i,a,u,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function p(e){function t(t,n,r,o,i,s){var a=t[n];if(P(a)!==e)return new l("Invalid "+o+" `"+i+"` of type `"+S(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return c(t)}function f(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new l("Invalid "+o+" `"+i+"` of type `"+P(a)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!0;var s={},a=void 0,u=void 0;for(a=0,u=n.length;a0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return n<10&&(0===n&&(n+=1),n="0"+n),r+"-"+n+"-"+t},h=t.DateField=function(e){var t=e.wrapperClassName,n=e.className,r=e.onChange,i=e.name,a=e.errors,u=e.error,l=e.value,p=e.label,h=e.placeholder,g=e.errorStyles,y=void 0===g?{}:g,m=e.fieldAttributes,v=void 0===m?{}:m;return s.default.createElement("div",{className:(0,f.default)(t,u&&y.fieldClassName)},p&&s.default.createElement("label",null,p),s.default.createElement("input",o({type:"date",name:i,onChange:function(e){return r(new Date(e.target.value))},value:d(l),placeholder:h,className:n},v)),u&&s.default.createElement(c.default,o({errors:a},y)))};h.propTypes={wrapperClassName:i.PropTypes.string,className:i.PropTypes.string,name:i.PropTypes.string,onChange:i.PropTypes.func.isRequired,errors:i.PropTypes.oneOfType([i.PropTypes.arrayOf(i.PropTypes.string),i.PropTypes.arrayOf(i.PropTypes.arrayOf(i.PropTypes.string)),i.PropTypes.string,i.PropTypes.shape({})]),error:i.PropTypes.bool,value:i.PropTypes.shape({}),label:i.PropTypes.string,placeholder:i.PropTypes.string,errorStyles:i.PropTypes.shape({className:i.PropTypes.string,itemClassName:i.PropTypes.string}),fieldAttributes:i.PropTypes.shape({})},t.default=(0,u.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.NumberField=void 0;var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t0?void(this.props.onError&&this.props.onError(e,n)):(this.setState({validateOnChange:!1}),this.props.onSubmit(n),n)}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,submitForm:this.submitForm,getErrors:this.getErrors,getPath:this.getPath,eventsListener:this.eventsListener}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.subform,o=e.id;return r?l.default.createElement("div",{className:n},t):l.default.createElement("form",{onSubmit:this.submitForm,id:o,className:n},t)}}]),t}(l.default.Component);d.childContextTypes={setModel:u.PropTypes.func,getModel:u.PropTypes.func,getSchema:u.PropTypes.func,submitForm:u.PropTypes.func,getErrors:u.PropTypes.func,getPath:u.PropTypes.func,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.propTypes={model:u.PropTypes.shape({}),schema:u.PropTypes.shape({}),onError:u.PropTypes.func,onSubmit:u.PropTypes.func.isRequired,validateOnChange:u.PropTypes.bool,customValidation:u.PropTypes.func,subform:u.PropTypes.bool,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.defaultProps={id:"form"},t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ListField=void 0;var a=Object.assign||function(e){for(var t=1;t0?e.value.map(function(e){return{id:t.generateItemId(),value:e}}):[]}},{key:"setModel",value:function(e,t,n){var r=e.split("-"),o=l(r,2),i=(o[0],o[1]),s=Array.from(this.state.model);s[parseInt(i)].value=t,this.storage.setModel(s,n)}},{key:"getModel",value:function(e){var t=e.split("-"),n=l(t,2),r=(n[0],n[1]);return this.state.model[r].value}},{key:"getSchema",value:function(){return this.state.schema}},{key:"getErrors",value:function(e){var t=e.split("-"),n=l(t,2),r=n[0],o=n[1];return(0,this.context.getErrors)(r)[parseInt(o)]||[]}},{key:"getDefaultValueForListItem",value:function(){if(this.state.schema&&this.state.schema.type&&this.state.schema.type[0]&&"object"===u(this.state.schema.type[0])&&"function"==typeof this.state.schema.type[0].getDefaultValues)return this.state.schema.type[0].getDefaultValues()}},{key:"addListElement",value:function(){var e=Array.from(this.state.model);e.push({id:t.generateItemId(),value:this.getDefaultValueForListItem()}),this.setState({model:e})}},{key:"removeListElement",value:function(e){var t=Array.from(this.state.model);t.splice(e,1),this.setState({model:t}),this.props.onChange(t.map(function(e){return e.value}))}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,getErrors:this.getErrors}}},{key:"getList",value:function(e){var t=this,n=this.props,r=n.name,o=n.removeButton;o=void 0===o?{}:o;var i=o.wrapperClassName,s=o.className,a=o.value,u=n.hideRemoveButton,l=n.itemWrapperClassName;return this.state.model.map(function(n,o){var c=f.default.cloneElement(e,{name:r+"-"+o,value:n.value,key:n.id});return f.default.createElement("div",{key:n.id,className:l},c,!u&&f.default.createElement("div",{className:i},f.default.createElement("span",{onClick:function(){return t.removeListElement(o)},className:s},a||"Remove")))})}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.wrapperClassName,o=e.label,i=e.addButton,s=void 0===i?{}:i,u=e.hideAddButton,l=e.fieldAttributes,c=void 0===l?{}:l;return f.default.createElement("div",{className:r},o&&f.default.createElement("label",null,o),f.default.createElement("div",a({className:n},c),this.getList(t)),!u&&f.default.createElement("span",{onClick:this.addListElement,className:s.className},s.value||"Add"))}}]),t}(f.default.Component);m.defaultProps={value:[]},m.contextTypes={getSchema:p.PropTypes.func,getErrors:p.PropTypes.func},m.childContextTypes={setModel:p.PropTypes.func,getModel:p.PropTypes.func,getSchema:p.PropTypes.func,getErrors:p.PropTypes.func},m.propTypes={className:p.PropTypes.string,wrapperClassName:p.PropTypes.string,itemWrapperClassName:p.PropTypes.string,label:p.PropTypes.string,addButton:p.PropTypes.shape({className:p.PropTypes.string,value:p.PropTypes.node}),removeButton:p.PropTypes.shape({wrapperClassName:p.PropTypes.string,className:p.PropTypes.string,value:p.PropTypes.node}),hideAddButton:p.PropTypes.bool,hideRemoveButton:p.PropTypes.bool,onChange:p.PropTypes.func.isRequired,name:p.PropTypes.string,value:p.PropTypes.any,fieldAttributes:p.PropTypes.shape({})},t.default=(0,y.default)(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;var a=Object.assign||function(e){for(var t=1;t0},P=function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},S=function(e){function t(e){var n=e.alwaysRenderSuggestions;o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return T.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r}return s(t,e),u(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,h.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?(e.highlightFirstSuggestion&&this.highlightFirstSuggestion(),this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions()):this.resetHighlightedSuggestion()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){this.setState(function(r){var o=r.valueBeforeUpDown;return null===t?o=null:null===o&&void 0!==n&&(o=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,valueBeforeUpDown:o}})}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState(function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:e?null:n}})}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps,t=e.value;return(this.state.valueBeforeUpDown||t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,r=t.renderInputComponent,o=t.onSuggestionsFetchRequested,i=t.renderSuggestion,s=t.inputProps,u=t.multiSection,l=t.renderSectionTitle,p=t.id,f=t.getSectionSuggestions,d=t.theme,h=t.getSuggestionValue,g=t.alwaysRenderSuggestions,b=this.state,P=b.isFocused,S=b.isCollapsed,T=b.highlightedSectionIndex,w=b.highlightedSuggestionIndex,O=b.valueBeforeUpDown,E=g?v:this.props.shouldRenderSuggestions,C=s.value,_=s.onFocus,x=s.onKeyDown,I=this.willRenderSuggestions(this.props),k=g||P&&!S&&I,j=k?n:[],N=a({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=E(C);e.setState({isFocused:!0,isCollapsed:!n}),_&&_(t),n&&o({value:C})}},onBlur:function(t){if(e.justClickedOnSuggestionsContainer)return void e.input.focus();e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested())},onChange:function(t){var n=t.target.value,r=E(n);e.maybeCallOnChange(t,n,"type"),e.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!r}),r?o({value:n}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){switch(t.key){case"ArrowDown":case"ArrowUp":if(S)E(C)&&(o({value:C}),e.revealSuggestions());else if(n.length>0){var i=r.newHighlightedSectionIndex,s=r.newHighlightedItemIndex,a=void 0;a=null===s?null===O?C:O:e.getSuggestionValueByIndex(i,s),e.updateHighlightedSuggestion(i,s,C),e.maybeCallOnChange(t,a,"ArrowDown"===t.key?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout(function(){e.justPressedUpDown=!1});break;case"Enter":var u=e.getHighlightedSuggestion();if(k&&!g&&e.closeSuggestions(),null!==u){var l=h(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:w,sectionIndex:T,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout(function(){e.justSelectedSuggestion=!1})}break;case"Escape":k&&t.preventDefault();var c=k&&!g;if(null===O){if(!c){e.maybeCallOnChange(t,"","escape"),E("")?o({value:""}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,O,"escape");c?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}x&&x(t)}}),M={query:this.getQuery()};return c.default.createElement(y.default,{multiSection:u,items:j,renderInputComponent:r,renderItemsContainer:this.renderSuggestionsContainer,renderItem:i,renderItemData:M,renderSectionTitle:l,getSectionItems:f,highlightedSectionIndex:T,highlightedItemIndex:w,inputProps:N,itemProps:this.itemProps,theme:(0,m.mapToAutowhateverTheme)(d),id:p,ref:this.storeAutowhateverRef})}}]),t}(l.Component);S.propTypes={suggestions:f.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){if("function"!=typeof e[t])throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:f.default.func,renderInputComponent:f.default.func,renderSuggestionsContainer:f.default.func,getSuggestionValue:f.default.func.isRequired,renderSuggestion:f.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:f.default.func,alwaysRenderSuggestions:f.default.bool,multiSection:f.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:f.default.bool,highlightFirstSuggestion:f.default.bool,theme:f.default.object,id:f.default.string},S.defaultProps={renderSuggestionsContainer:P,shouldRenderSuggestions:b,alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:m.defaultTheme,id:"1"};var T=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o)},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onSuggestionMouseDown=function(){e.justSelectedSuggestion=!0},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,s=r.onSuggestionsFetchRequested;i&&i(t,n),o?s({value:n.suggestionValue}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),s=i.sectionIndex,a=i.suggestionIndex,u=e.getSuggestion(s,a),l=e.props.getSuggestionValue(u);e.maybeCallOnChange(t,l,"click"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:a,sectionIndex:s,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout(function(){e.justSelectedSuggestion=!1})},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,s=e.getHighlightedSuggestion(),a=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!a}),i&&i(e.blurEvent,{highlightedSuggestion:s})},this.resetHighlightedSuggestionOnMouseLeave=function(){e.resetHighlightedSuggestion(!1)},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.resetHighlightedSuggestionOnMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionMouseDown,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;tr+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,r=t.multiSection,o=t.renderInputComponent,i=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,c=r?this.renderSections():this.renderItems(),f=null!==c,d=this.getItemId(s,u),h=e("react-autowhatever-"+n+"-container","container",f&&"containerOpen"),g="react-autowhatever-"+n,y=o(a({type:"text",value:"",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":g,"aria-expanded":f,"aria-haspopup":f,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",f&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),m=i({containerProps:a({id:g},e("react-autowhatever-"+n+"-items-container","itemsContainer",f&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:c});return p.default.createElement("div",h,y,m)}}]),t}(c.Component);C.propTypes={id:d.default.string,multiSection:d.default.bool,renderInputComponent:d.default.func,renderItemsContainer:d.default.func,items:d.default.array.isRequired,renderItem:d.default.func,renderItemData:d.default.object,renderSectionTitle:d.default.func,getSectionItems:d.default.func,inputProps:d.default.object,itemProps:d.default.oneOfType([d.default.object,d.default.func]),highlightedSectionIndex:d.default.number,highlightedItemIndex:d.default.number,theme:d.default.oneOfType([d.default.object,d.default.array])},C.defaultProps={id:"1",multiSection:!1,renderInputComponent:w,renderItemsContainer:O,renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:T,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},inputProps:T,itemProps:T,highlightedSectionIndex:null,highlightedItemIndex:null,theme:E},t.default=C},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o=0&&0===a[e];)e--;return-1===e?null:e}function o(e){var n=r(e,2),o=n[0],i=n[1];return u?null===i||i===a[o]-1?(o=t(o),null===o?[null,null]:[o,0]):[o,i+1]:0===a||i===a-1?[null,null]:null===i?[null,0]:[null,i+1]}function i(e){var t=r(e,2),o=t[0],i=t[1];return u?null===i||0===i?(o=n(o),null===o?[null,null]:[o,a[o]-1]):[o,i-1]:0===a||0===i?[null,null]:null===i?[null,a-1]:[null,i-1]}function s(e){return null===o(e)[1]}var a=e.data,u=e.multiSection;return{next:o,prev:i,isLast:s}}},function(e,t){e.exports=function(e,t){if(e===t)return!0;var n=e.length;if(t.length!==n)return!1;for(var r=0;r-1&&this.listeners.splice(t,1)}}]),e}();t.default=i},function(e,t,n){"use strict";function r(e,t,n,r,o){}e.exports=r},function(e,t,n){"use strict";var r=n(22);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";var r=n(9),o=n(3),i=n(2),s=n(17),a=n(20);e.exports=function(e,t){function n(e){var t=e&&(O&&e[O]||e[E]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function c(e){function n(n,r,i,a,u,c,p){if(a=a||C,c=c||i,p!==s)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[i]?n?new l(null===r[i]?"The "+u+" `"+c+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+u+" `"+c+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,i,a,u,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function p(e){function t(t,n,r,o,i,s){var a=t[n];if(P(a)!==e)return new l("Invalid "+o+" `"+i+"` of type `"+S(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return c(t)}function f(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new l("Invalid "+o+" `"+i+"` of type `"+P(a)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!0;var s={},a=void 0,u=void 0;for(a=0,u=n.length;a0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return n<10&&(0===n&&(n+=1),n="0"+n),r+"-"+n+"-"+t},h=t.DateField=function(e){var t=e.wrapperClassName,n=e.className,r=e.onChange,i=e.name,a=e.errors,u=e.error,l=e.value,p=e.label,h=e.placeholder,g=e.errorStyles,y=void 0===g?{}:g,m=e.fieldAttributes,v=void 0===m?{}:m;return s.default.createElement("div",{className:(0,f.default)(t,u&&y.fieldClassName)},p&&s.default.createElement("label",null,p),s.default.createElement("input",o({type:"date",name:i,onChange:function(e){return r(new Date(e.target.value))},value:d(l),placeholder:h,className:n},v)),u&&s.default.createElement(c.default,o({errors:a},y)))};h.propTypes={wrapperClassName:i.PropTypes.string,className:i.PropTypes.string,name:i.PropTypes.string,onChange:i.PropTypes.func.isRequired,errors:i.PropTypes.oneOfType([i.PropTypes.arrayOf(i.PropTypes.string),i.PropTypes.arrayOf(i.PropTypes.arrayOf(i.PropTypes.string)),i.PropTypes.string,i.PropTypes.shape({})]),error:i.PropTypes.bool,value:i.PropTypes.shape({}),label:i.PropTypes.string,placeholder:i.PropTypes.string,errorStyles:i.PropTypes.shape({className:i.PropTypes.string,itemClassName:i.PropTypes.string}),fieldAttributes:i.PropTypes.shape({})},t.default=(0,u.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.NumberField=void 0;var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t0?void(this.props.onError&&this.props.onError(e,n)):(this.setState({validateOnChange:!1}),this.props.onSubmit(n),n)}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,submitForm:this.submitForm,getErrors:this.getErrors,getPath:this.getPath,eventsListener:this.eventsListener}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.subform,o=e.id;return r?l.default.createElement("div",{className:n},t):l.default.createElement("form",{onSubmit:this.submitForm,id:o,className:n},t)}}]),t}(l.default.Component);d.childContextTypes={setModel:u.PropTypes.func,getModel:u.PropTypes.func,getSchema:u.PropTypes.func,submitForm:u.PropTypes.func,getErrors:u.PropTypes.func,getPath:u.PropTypes.func,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.propTypes={model:u.PropTypes.shape({}),schema:u.PropTypes.shape({}),onError:u.PropTypes.func,onSubmit:u.PropTypes.func.isRequired,validateOnChange:u.PropTypes.bool,customValidation:u.PropTypes.func,subform:u.PropTypes.bool,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.defaultProps={id:"form"},t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ListField=void 0;var a=Object.assign||function(e){for(var t=1;t0?e.value.map(function(e){return{id:t.generateItemId(),value:e}}):[]}},{key:"setModel",value:function(e,t,n){var r=e.split("-"),o=l(r,2),i=(o[0],o[1]),s=Array.from(this.state.model);s[parseInt(i)].value=t,this.storage.setModel(s,n)}},{key:"getModel",value:function(e){var t=e.split("-"),n=l(t,2),r=(n[0],n[1]);return this.state.model[r].value}},{key:"getSchema",value:function(){return this.state.schema}},{key:"getErrors",value:function(e){var t=e.split("-"),n=l(t,2),r=n[0],o=n[1];return(0,this.context.getErrors)(r)[parseInt(o)]||[]}},{key:"getDefaultValueForListItem",value:function(){if(this.state.schema&&this.state.schema.type&&this.state.schema.type[0]&&"object"===u(this.state.schema.type[0])&&"function"==typeof this.state.schema.type[0].getDefaultValues)return this.state.schema.type[0].getDefaultValues()}},{key:"addListElement",value:function(){var e=Array.from(this.state.model);e.push({id:t.generateItemId(),value:this.getDefaultValueForListItem()}),this.setState({model:e})}},{key:"removeListElement",value:function(e){var t=Array.from(this.state.model);t.splice(e,1),this.setState({model:t}),this.props.onChange(t.map(function(e){return e.value}))}},{key:"isAddAllowed",value:function(){var e=this.props.maxLength,t=this.state.model;return"number"!=typeof e||t.lengthe}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,getErrors:this.getErrors}}},{key:"getList",value:function(e){var t=this,n=this.props,r=n.name,o=n.removeButton;o=void 0===o?{}:o;var i=o.wrapperClassName,s=o.className,a=o.value,u=n.hideRemoveButton,l=n.itemWrapperClassName,c=this.isRemoveAllowed();return this.state.model.map(function(n,o){var p=f.default.cloneElement(e,{name:r+"-"+o,value:n.value,key:n.id});return f.default.createElement("div",{key:n.id,className:l},p,!u&&c&&f.default.createElement("div",{className:i},f.default.createElement("span",{onClick:function(){return t.removeListElement(o)},className:s},a||"Remove")))})}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.wrapperClassName,o=e.label,i=e.addButton,s=void 0===i?{}:i,u=e.hideAddButton,l=e.fieldAttributes,c=void 0===l?{}:l,p=this.isAddAllowed();return f.default.createElement("div",{className:r},o&&f.default.createElement("label",null,o),f.default.createElement("div",a({className:n},c),this.getList(t)),!u&&p&&f.default.createElement("span",{onClick:this.addListElement,className:s.className},s.value||"Add"))}}]),t}(f.default.Component);m.defaultProps={value:[]},m.contextTypes={getSchema:p.PropTypes.func,getErrors:p.PropTypes.func},m.childContextTypes={setModel:p.PropTypes.func,getModel:p.PropTypes.func,getSchema:p.PropTypes.func,getErrors:p.PropTypes.func},m.propTypes={className:p.PropTypes.string,wrapperClassName:p.PropTypes.string,itemWrapperClassName:p.PropTypes.string,label:p.PropTypes.string,addButton:p.PropTypes.shape({className:p.PropTypes.string,value:p.PropTypes.node}),removeButton:p.PropTypes.shape({wrapperClassName:p.PropTypes.string,className:p.PropTypes.string,value:p.PropTypes.node}),hideAddButton:p.PropTypes.bool,hideRemoveButton:p.PropTypes.bool,onChange:p.PropTypes.func.isRequired,name:p.PropTypes.string,value:p.PropTypes.any,fieldAttributes:p.PropTypes.shape({}),minLength:p.PropTypes.number,maxLength:p.PropTypes.number},t.default=(0,y.default)(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;var a=Object.assign||function(e){for(var t=1;t0},P=function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},S=function(e){function t(e){var n=e.alwaysRenderSuggestions;o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return T.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r}return s(t,e),u(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,h.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?(e.highlightFirstSuggestion&&this.highlightFirstSuggestion(),this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions()):this.resetHighlightedSuggestion()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){this.setState(function(r){var o=r.valueBeforeUpDown;return null===t?o=null:null===o&&void 0!==n&&(o=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,valueBeforeUpDown:o}})}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState(function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:e?null:n}})}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps,t=e.value;return(this.state.valueBeforeUpDown||t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,r=t.renderInputComponent,o=t.onSuggestionsFetchRequested,i=t.renderSuggestion,s=t.inputProps,u=t.multiSection,l=t.renderSectionTitle,p=t.id,f=t.getSectionSuggestions,d=t.theme,h=t.getSuggestionValue,g=t.alwaysRenderSuggestions,b=this.state,P=b.isFocused,S=b.isCollapsed,T=b.highlightedSectionIndex,w=b.highlightedSuggestionIndex,O=b.valueBeforeUpDown,E=g?v:this.props.shouldRenderSuggestions,C=s.value,_=s.onFocus,x=s.onKeyDown,I=this.willRenderSuggestions(this.props),k=g||P&&!S&&I,j=k?n:[],N=a({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=E(C);e.setState({isFocused:!0,isCollapsed:!n}),_&&_(t),n&&o({value:C})}},onBlur:function(t){if(e.justClickedOnSuggestionsContainer)return void e.input.focus();e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested())},onChange:function(t){var n=t.target.value,r=E(n);e.maybeCallOnChange(t,n,"type"),e.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!r}),r?o({value:n}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){switch(t.key){case"ArrowDown":case"ArrowUp":if(S)E(C)&&(o({value:C}),e.revealSuggestions());else if(n.length>0){var i=r.newHighlightedSectionIndex,s=r.newHighlightedItemIndex,a=void 0;a=null===s?null===O?C:O:e.getSuggestionValueByIndex(i,s),e.updateHighlightedSuggestion(i,s,C),e.maybeCallOnChange(t,a,"ArrowDown"===t.key?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout(function(){e.justPressedUpDown=!1});break;case"Enter":var u=e.getHighlightedSuggestion();if(k&&!g&&e.closeSuggestions(),null!==u){var l=h(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:w,sectionIndex:T,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout(function(){e.justSelectedSuggestion=!1})}break;case"Escape":k&&t.preventDefault();var c=k&&!g;if(null===O){if(!c){e.maybeCallOnChange(t,"","escape"),E("")?o({value:""}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,O,"escape");c?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}x&&x(t)}}),M={query:this.getQuery()};return c.default.createElement(y.default,{multiSection:u,items:j,renderInputComponent:r,renderItemsContainer:this.renderSuggestionsContainer,renderItem:i,renderItemData:M,renderSectionTitle:l,getSectionItems:f,highlightedSectionIndex:T,highlightedItemIndex:w,inputProps:N,itemProps:this.itemProps,theme:(0,m.mapToAutowhateverTheme)(d),id:p,ref:this.storeAutowhateverRef})}}]),t}(l.Component);S.propTypes={suggestions:f.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){if("function"!=typeof e[t])throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:f.default.func,renderInputComponent:f.default.func,renderSuggestionsContainer:f.default.func,getSuggestionValue:f.default.func.isRequired,renderSuggestion:f.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:f.default.func,alwaysRenderSuggestions:f.default.bool,multiSection:f.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:f.default.bool,highlightFirstSuggestion:f.default.bool,theme:f.default.object,id:f.default.string},S.defaultProps={renderSuggestionsContainer:P,shouldRenderSuggestions:b,alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:m.defaultTheme,id:"1"};var T=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o)},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onSuggestionMouseDown=function(){e.justSelectedSuggestion=!0},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,s=r.onSuggestionsFetchRequested;i&&i(t,n),o?s({value:n.suggestionValue}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),s=i.sectionIndex,a=i.suggestionIndex,u=e.getSuggestion(s,a),l=e.props.getSuggestionValue(u);e.maybeCallOnChange(t,l,"click"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:a,sectionIndex:s,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout(function(){e.justSelectedSuggestion=!1})},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,s=e.getHighlightedSuggestion(),a=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!a}),i&&i(e.blurEvent,{highlightedSuggestion:s})},this.resetHighlightedSuggestionOnMouseLeave=function(){e.resetHighlightedSuggestion(!1)},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.resetHighlightedSuggestionOnMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionMouseDown,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;tr+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,r=t.multiSection,o=t.renderInputComponent,i=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,c=r?this.renderSections():this.renderItems(),f=null!==c,d=this.getItemId(s,u),h=e("react-autowhatever-"+n+"-container","container",f&&"containerOpen"),g="react-autowhatever-"+n,y=o(a({type:"text",value:"",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":g,"aria-expanded":f,"aria-haspopup":f,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",f&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),m=i({containerProps:a({id:g},e("react-autowhatever-"+n+"-items-container","itemsContainer",f&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:c});return p.default.createElement("div",h,y,m)}}]),t}(c.Component);C.propTypes={id:d.default.string,multiSection:d.default.bool,renderInputComponent:d.default.func,renderItemsContainer:d.default.func,items:d.default.array.isRequired,renderItem:d.default.func,renderItemData:d.default.object,renderSectionTitle:d.default.func,getSectionItems:d.default.func,inputProps:d.default.object,itemProps:d.default.oneOfType([d.default.object,d.default.func]),highlightedSectionIndex:d.default.number,highlightedItemIndex:d.default.number,theme:d.default.oneOfType([d.default.object,d.default.array])},C.defaultProps={id:"1",multiSection:!1,renderInputComponent:w,renderItemsContainer:O,renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:T,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},inputProps:T,itemProps:T,highlightedSectionIndex:null,highlightedItemIndex:null,theme:E},t.default=C},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o=0&&0===a[e];)e--;return-1===e?null:e}function o(e){var n=r(e,2),o=n[0],i=n[1];return u?null===i||i===a[o]-1?(o=t(o),null===o?[null,null]:[o,0]):[o,i+1]:0===a||i===a-1?[null,null]:null===i?[null,0]:[null,i+1]}function i(e){var t=r(e,2),o=t[0],i=t[1];return u?null===i||0===i?(o=n(o),null===o?[null,null]:[o,a[o]-1]):[o,i-1]:0===a||0===i?[null,null]:null===i?[null,a-1]:[null,i-1]}function s(e){return null===o(e)[1]}var a=e.data,u=e.multiSection;return{next:o,prev:i,isLast:s}}},function(e,t){e.exports=function(e,t){if(e===t)return!0;var n=e.length;if(t.length!==n)return!1;for(var r=0;r-1&&this.listeners.splice(t,1)}}]),e}();t.default=s},function(e,t,r){"use strict";function n(e,t,r,n,o){}e.exports=n},function(e,t,r){"use strict";var n=r(22);e.exports=function(e){return n(e,!1)}},function(e,t,r){"use strict";var n=r(9),o=r(3),s=r(2),a=r(17),i=r(20);e.exports=function(e,t){function r(e){var t=e&&(_&&e[_]||e[N]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function p(e){function r(r,n,s,i,u,p,c){if(i=i||M,p=p||s,c!==a)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==n[s]?r?new l(null===n[s]?"The "+u+" `"+p+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+u+" `"+p+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,s,i,u,p)}var n=r.bind(null,!1);return n.isRequired=r.bind(null,!0),n}function c(e){function t(t,r,n,o,s,a){var i=t[r];if(P(i)!==e)return new l("Invalid "+o+" `"+s+"` of type `"+T(i)+"` supplied to `"+n+"`, expected `"+e+"`.");return null}return p(t)}function f(e){function t(t,r,n,o,s){if("function"!=typeof e)return new l("Property `"+s+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var i=t[r];if(!Array.isArray(i)){return new l("Invalid "+o+" `"+s+"` of type `"+P(i)+"` supplied to `"+n+"`, expected an array.")}for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getDate(),r=e.getMonth(),n=e.getFullYear();return r<10&&(0===r&&(r+=1),r="0"+r),n+"-"+r+"-"+t},y=t.DateField=function(e){var t=e.wrapperClassName,r=e.className,n=e.onChange,s=e.name,i=e.errors,u=e.error,l=e.value,c=e.label,y=e.placeholder,h=e.errorStyles,v=void 0===h?{}:h,m=e.fieldAttributes,g=void 0===m?{}:m;return a.default.createElement("div",{className:(0,f.default)(t,u&&v.fieldClassName)},c&&a.default.createElement("label",null,c),a.default.createElement("input",o({type:"date",name:s,onChange:function(e){return n(new Date(e.target.value))},value:d(l),placeholder:y,className:r},g)),u&&a.default.createElement(p.default,o({errors:i},v)))};y.propTypes={wrapperClassName:s.PropTypes.string,className:s.PropTypes.string,name:s.PropTypes.string,onChange:s.PropTypes.func.isRequired,errors:s.PropTypes.oneOfType([s.PropTypes.arrayOf(s.PropTypes.string),s.PropTypes.arrayOf(s.PropTypes.arrayOf(s.PropTypes.string)),s.PropTypes.string,s.PropTypes.shape({})]),error:s.PropTypes.bool,value:s.PropTypes.shape({}),label:s.PropTypes.string,placeholder:s.PropTypes.string,errorStyles:s.PropTypes.shape({className:s.PropTypes.string,itemClassName:s.PropTypes.string}),fieldAttributes:s.PropTypes.shape({})},t.default=(0,u.default)(y)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.NumberField=void 0;var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0?void(this.props.onError&&this.props.onError(e,r)):(this.setState({validateOnChange:!1}),this.props.onSubmit(r),r)}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,submitForm:this.submitForm,getErrors:this.getErrors,getPath:this.getPath,eventsListener:this.eventsListener}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.subform,o=e.id;return n?l.default.createElement("div",{className:r},t):l.default.createElement("form",{onSubmit:this.submitForm,id:o,className:r},t)}}]),t}(l.default.Component);d.childContextTypes={setModel:u.PropTypes.func,getModel:u.PropTypes.func,getSchema:u.PropTypes.func,submitForm:u.PropTypes.func,getErrors:u.PropTypes.func,getPath:u.PropTypes.func,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.propTypes={model:u.PropTypes.shape({}),schema:u.PropTypes.shape({}),onError:u.PropTypes.func,onSubmit:u.PropTypes.func.isRequired,validateOnChange:u.PropTypes.bool,customValidation:u.PropTypes.func,subform:u.PropTypes.bool,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.defaultProps={id:"form"},t.default=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ListField=void 0;var i=Object.assign||function(e){for(var t=1;t0?e.value.map(function(e){return{id:t.generateItemId(),value:e}}):[]}},{key:"setModel",value:function(e,t,r){var n=e.split("-"),o=l(n,2),s=(o[0],o[1]),a=Array.from(this.state.model);a[parseInt(s)].value=t,this.storage.setModel(a,r)}},{key:"getModel",value:function(e){var t=e.split("-"),r=l(t,2),n=(r[0],r[1]);return this.state.model[n].value}},{key:"getSchema",value:function(){return this.state.schema}},{key:"getErrors",value:function(e){var t=e.split("-"),r=l(t,2),n=r[0],o=r[1];return(0,this.context.getErrors)(n)[parseInt(o)]||[]}},{key:"getDefaultValueForListItem",value:function(){if(this.state.schema&&this.state.schema.type&&this.state.schema.type[0]&&"object"===u(this.state.schema.type[0])&&"function"==typeof this.state.schema.type[0].getDefaultValues)return this.state.schema.type[0].getDefaultValues()}},{key:"addListElement",value:function(){var e=Array.from(this.state.model);e.push({id:t.generateItemId(),value:this.getDefaultValueForListItem()}),this.setState({model:e})}},{key:"removeListElement",value:function(e){var t=Array.from(this.state.model);t.splice(e,1),this.setState({model:t}),this.props.onChange(t.map(function(e){return e.value}))}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,getErrors:this.getErrors}}},{key:"getList",value:function(e){var t=this,r=this.props,n=r.name,o=r.removeButton;o=void 0===o?{}:o;var s=o.wrapperClassName,a=o.className,i=o.value,u=r.hideRemoveButton,l=r.itemWrapperClassName;return this.state.model.map(function(r,o){var p=f.default.cloneElement(e,{name:n+"-"+o,value:r.value,key:r.id});return f.default.createElement("div",{key:r.id,className:l},p,!u&&f.default.createElement("div",{className:s},f.default.createElement("span",{onClick:function(){return t.removeListElement(o)},className:a},i||"Remove")))})}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.wrapperClassName,o=e.label,s=e.addButton,a=void 0===s?{}:s,u=e.hideAddButton,l=e.fieldAttributes,p=void 0===l?{}:l;return f.default.createElement("div",{className:n},o&&f.default.createElement("label",null,o),f.default.createElement("div",i({className:r},p),this.getList(t)),!u&&f.default.createElement("span",{onClick:this.addListElement,className:a.className},a.value||"Add"))}}]),t}(f.default.Component);m.defaultProps={value:[]},m.contextTypes={getSchema:c.PropTypes.func,getErrors:c.PropTypes.func},m.childContextTypes={setModel:c.PropTypes.func,getModel:c.PropTypes.func,getSchema:c.PropTypes.func,getErrors:c.PropTypes.func},m.propTypes={className:c.PropTypes.string,wrapperClassName:c.PropTypes.string,itemWrapperClassName:c.PropTypes.string,label:c.PropTypes.string,addButton:c.PropTypes.shape({className:c.PropTypes.string,value:c.PropTypes.node}),removeButton:c.PropTypes.shape({wrapperClassName:c.PropTypes.string,className:c.PropTypes.string,value:c.PropTypes.node}),hideAddButton:c.PropTypes.bool,hideRemoveButton:c.PropTypes.bool,onChange:c.PropTypes.func.isRequired,name:c.PropTypes.string,value:c.PropTypes.any,fieldAttributes:c.PropTypes.shape({})},t.default=(0,v.default)(m)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;var i=Object.assign||function(e){for(var t=1;t-1&&this.eventsListeners[e].splice(r,1)}}},{key:"callEvent",value:function(e,t){var r=[];if(this.eventsListeners[e]&&Array.isArray(this.eventsListeners[e]))return this.eventsListeners[e].forEach(function(e){var n=e(t);n&&r.push(n)}),r}}]),e}();t.default=s},,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(62);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})}])}); \ No newline at end of file +var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,i,u=n(e),l=1;l-1&&this.listeners.splice(t,1)}}]),e}();t.default=s},function(e,t,r){"use strict";function n(e,t,r,n,o){}e.exports=n},function(e,t,r){"use strict";var n=r(22);e.exports=function(e){return n(e,!1)}},function(e,t,r){"use strict";var n=r(9),o=r(3),s=r(2),a=r(17),i=r(20);e.exports=function(e,t){function r(e){var t=e&&(_&&e[_]||e[N]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function p(e){function r(r,n,s,i,u,p,c){if(i=i||M,p=p||s,c!==a)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==n[s]?r?new l(null===n[s]?"The "+u+" `"+p+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+u+" `"+p+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,s,i,u,p)}var n=r.bind(null,!1);return n.isRequired=r.bind(null,!0),n}function c(e){function t(t,r,n,o,s,a){var i=t[r];if(P(i)!==e)return new l("Invalid "+o+" `"+s+"` of type `"+T(i)+"` supplied to `"+n+"`, expected `"+e+"`.");return null}return p(t)}function f(e){function t(t,r,n,o,s){if("function"!=typeof e)return new l("Property `"+s+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var i=t[r];if(!Array.isArray(i)){return new l("Invalid "+o+" `"+s+"` of type `"+P(i)+"` supplied to `"+n+"`, expected an array.")}for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getDate(),r=e.getMonth(),n=e.getFullYear();return r<10&&(0===r&&(r+=1),r="0"+r),n+"-"+r+"-"+t},y=t.DateField=function(e){var t=e.wrapperClassName,r=e.className,n=e.onChange,s=e.name,i=e.errors,u=e.error,l=e.value,c=e.label,y=e.placeholder,h=e.errorStyles,v=void 0===h?{}:h,m=e.fieldAttributes,g=void 0===m?{}:m;return a.default.createElement("div",{className:(0,f.default)(t,u&&v.fieldClassName)},c&&a.default.createElement("label",null,c),a.default.createElement("input",o({type:"date",name:s,onChange:function(e){return n(new Date(e.target.value))},value:d(l),placeholder:y,className:r},g)),u&&a.default.createElement(p.default,o({errors:i},v)))};y.propTypes={wrapperClassName:s.PropTypes.string,className:s.PropTypes.string,name:s.PropTypes.string,onChange:s.PropTypes.func.isRequired,errors:s.PropTypes.oneOfType([s.PropTypes.arrayOf(s.PropTypes.string),s.PropTypes.arrayOf(s.PropTypes.arrayOf(s.PropTypes.string)),s.PropTypes.string,s.PropTypes.shape({})]),error:s.PropTypes.bool,value:s.PropTypes.shape({}),label:s.PropTypes.string,placeholder:s.PropTypes.string,errorStyles:s.PropTypes.shape({className:s.PropTypes.string,itemClassName:s.PropTypes.string}),fieldAttributes:s.PropTypes.shape({})},t.default=(0,u.default)(y)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.NumberField=void 0;var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0?void(this.props.onError&&this.props.onError(e,r)):(this.setState({validateOnChange:!1}),this.props.onSubmit(r),r)}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,submitForm:this.submitForm,getErrors:this.getErrors,getPath:this.getPath,eventsListener:this.eventsListener}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.subform,o=e.id;return n?l.default.createElement("div",{className:r},t):l.default.createElement("form",{onSubmit:this.submitForm,id:o,className:r},t)}}]),t}(l.default.Component);d.childContextTypes={setModel:u.PropTypes.func,getModel:u.PropTypes.func,getSchema:u.PropTypes.func,submitForm:u.PropTypes.func,getErrors:u.PropTypes.func,getPath:u.PropTypes.func,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.propTypes={model:u.PropTypes.shape({}),schema:u.PropTypes.shape({}),onError:u.PropTypes.func,onSubmit:u.PropTypes.func.isRequired,validateOnChange:u.PropTypes.bool,customValidation:u.PropTypes.func,subform:u.PropTypes.bool,eventsListener:u.PropTypes.shape({callEvent:u.PropTypes.func,registerEvent:u.PropTypes.func,registerEventListener:u.PropTypes.func,unregisterEvent:u.PropTypes.func,unregisterEventListener:u.PropTypes.func})},d.defaultProps={id:"form"},t.default=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ListField=void 0;var i=Object.assign||function(e){for(var t=1;t0?e.value.map(function(e){return{id:t.generateItemId(),value:e}}):[]}},{key:"setModel",value:function(e,t,r){var n=e.split("-"),o=l(n,2),s=(o[0],o[1]),a=Array.from(this.state.model);a[parseInt(s)].value=t,this.storage.setModel(a,r)}},{key:"getModel",value:function(e){var t=e.split("-"),r=l(t,2),n=(r[0],r[1]);return this.state.model[n].value}},{key:"getSchema",value:function(){return this.state.schema}},{key:"getErrors",value:function(e){var t=e.split("-"),r=l(t,2),n=r[0],o=r[1];return(0,this.context.getErrors)(n)[parseInt(o)]||[]}},{key:"getDefaultValueForListItem",value:function(){if(this.state.schema&&this.state.schema.type&&this.state.schema.type[0]&&"object"===u(this.state.schema.type[0])&&"function"==typeof this.state.schema.type[0].getDefaultValues)return this.state.schema.type[0].getDefaultValues()}},{key:"addListElement",value:function(){var e=Array.from(this.state.model);e.push({id:t.generateItemId(),value:this.getDefaultValueForListItem()}),this.setState({model:e})}},{key:"removeListElement",value:function(e){var t=Array.from(this.state.model);t.splice(e,1),this.setState({model:t}),this.props.onChange(t.map(function(e){return e.value}))}},{key:"isAddAllowed",value:function(){var e=this.props.maxLength,t=this.state.model;return"number"!=typeof e||t.lengthe}},{key:"getChildContext",value:function(){return{setModel:this.setModel,getModel:this.getModel,getSchema:this.getSchema,getErrors:this.getErrors}}},{key:"getList",value:function(e){var t=this,r=this.props,n=r.name,o=r.removeButton;o=void 0===o?{}:o;var s=o.wrapperClassName,a=o.className,i=o.value,u=r.hideRemoveButton,l=r.itemWrapperClassName,p=this.isRemoveAllowed();return this.state.model.map(function(r,o){var c=f.default.cloneElement(e,{name:n+"-"+o,value:r.value,key:r.id});return f.default.createElement("div",{key:r.id,className:l},c,!u&&p&&f.default.createElement("div",{className:s},f.default.createElement("span",{onClick:function(){return t.removeListElement(o)},className:a},i||"Remove")))})}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.wrapperClassName,o=e.label,s=e.addButton,a=void 0===s?{}:s,u=e.hideAddButton,l=e.fieldAttributes,p=void 0===l?{}:l,c=this.isAddAllowed();return f.default.createElement("div",{className:n},o&&f.default.createElement("label",null,o),f.default.createElement("div",i({className:r},p),this.getList(t)),!u&&c&&f.default.createElement("span",{onClick:this.addListElement,className:a.className},a.value||"Add"))}}]),t}(f.default.Component);m.defaultProps={value:[]},m.contextTypes={getSchema:c.PropTypes.func,getErrors:c.PropTypes.func},m.childContextTypes={setModel:c.PropTypes.func,getModel:c.PropTypes.func,getSchema:c.PropTypes.func,getErrors:c.PropTypes.func},m.propTypes={className:c.PropTypes.string,wrapperClassName:c.PropTypes.string,itemWrapperClassName:c.PropTypes.string,label:c.PropTypes.string,addButton:c.PropTypes.shape({className:c.PropTypes.string,value:c.PropTypes.node}),removeButton:c.PropTypes.shape({wrapperClassName:c.PropTypes.string,className:c.PropTypes.string,value:c.PropTypes.node}),hideAddButton:c.PropTypes.bool,hideRemoveButton:c.PropTypes.bool,onChange:c.PropTypes.func.isRequired,name:c.PropTypes.string,value:c.PropTypes.any,fieldAttributes:c.PropTypes.shape({}),minLength:c.PropTypes.number,maxLength:c.PropTypes.number},t.default=(0,v.default)(m)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;var i=Object.assign||function(e){for(var t=1;t-1&&this.eventsListeners[e].splice(r,1)}}},{key:"callEvent",value:function(e,t){var r=[];if(this.eventsListeners[e]&&Array.isArray(this.eventsListeners[e]))return this.eventsListeners[e].forEach(function(e){var n=e(t);n&&r.push(n)}),r}}]),e}();t.default=s},,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(62);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})}])}); \ No newline at end of file