1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-12-29 00:22:28 -05:00
moneygo/static/external/react-widgets/react-widgets.js

9 lines
105 KiB
JavaScript
Raw Normal View History

/*! v"2.7.1" | (c) 2015 Jason Quense | https://github.com/jquense/react-widgets/blob/master/License.txt */
this.ReactWidgets=function(e){function t(n){if(s[n])return s[n].exports;var r=s[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var s={};return t.m=e,t.c=s,t.p="",t(0)}([function(e,t,s){"use strict";e.exports={DropdownList:s(5),Combobox:s(40),Calendar:s(2),DateTimePicker:s(3),NumberPicker:s(4),Multiselect:s(6),SelectList:s(7),configure:s(8),utils:{ReplaceTransitionGroup:s(9),SlideTransition:s(10)}}},function(e,t,s){"use strict";function n(e,t,s){return a.number.format(e,t,s)}var r=s(13),i=s(11),o=s(20),a=s(35).locale,p=function(e){return e.format||a.number.formats["default"]};e.exports=i.createClass({displayName:"NumberPickerInput",propTypes:{value:i.PropTypes.number,format:o.numberFormat,parse:i.PropTypes.func.isRequired,culture:i.PropTypes.string,min:i.PropTypes.number,onChange:i.PropTypes.func.isRequired,onKeyDown:i.PropTypes.func},getDefaultProps:function(){return{value:null,editing:!1,parse:function(e,t){return a.number.parse(e,t)}}},getDefaultState:function(e){var t=e.editing?e.value:n(e.value,p(e),e.culture);return(null==t||isNaN(e.value))&&(t=""),{stringValue:""+t}},getInitialState:function(){return this.getDefaultState(this.props)},componentWillReceiveProps:function(e){this.setState(this.getDefaultState(e))},render:function(){var e=this.state.stringValue;return i.createElement("input",r._extends({},this.props,{type:"text",className:"rw-input",onChange:this._change,onBlur:this._finish,"aria-disabled":this.props.disabled,"aria-readonly":this.props.readOnly,disabled:this.props.disabled,readOnly:this.props.readOnly,value:e}))},_change:function(e){var t=e.target.value,s=this.props.parse(e.target.value,this.props.culture),n=this.isValid(s);return null==t||""===t.trim()?this.props.onChange(null):n&&s!==this.props.value&&!this.isAtDelimiter(s,t)?this.props.onChange(s):void((!isNaN(s)||this.isAtDelimiter(s,t))&&this.current(e.target.value))},_finish:function(){var e=this.state.stringValue,t=this.props.parse(e,this.props.culture);!isNaN(t)&&(t<this.props.min||this.isAtDelimiter(t,e))&&this.props.onChange(t)},isAtDelimiter:function(e,t){var s;return t.length<=1?!1:(s=this.props.parse(t.substr(0,t.length-1),this.props.culture),"number"==typeof s&&!isNaN(s)&&s===e)},isValid:function(e){return"number"!=typeof e||isNaN(e)?!1:e>=this.props.min},current:function(e){this.setState({stringValue:e})}})},function(e,t,s){"use strict";function n(e){return e&&!isNaN(e.getTime())?e:null}function r(e){return p._extends({moveBack:"navigate back",moveForward:"navigate forward"},e)}var i,o,a,p=s(13),l=s(11),u=s(48),c=s(19),d=s(29),h=s(30),f=s(31),m=s(32),y=s(33),v=s(34),g=s(35).locale,T=s(20),b=s(50),w=s(10),_=s(36),x=s(37),P=s(14),D=x.directions,O=function(e){return Object.keys(e).map(function(t){return e[t]})},N=function(e){return P.transform(e,function(e,t,s){e[t]=s},{})},C=x.calendarViews,E=O(C),I=N(x.calendarViewHierarchy),k=x.calendarViewHierarchy,S=x.calendarViewUnits,R=(i={},i[C.MONTH]=f,i[C.YEAR]=m,i[C.DECADE]=y,i[C.CENTURY]=v,i),F={ArrowDown:D.DOWN,ArrowUp:D.UP,ArrowRight:D.RIGHT,ArrowLeft:D.LEFT},L=(o={},o[D.LEFT]=D.RIGHT,o[D.RIGHT]=D.LEFT,o),M=(a={},a[C.YEAR]=1,a[C.DECADE]=10,a[C.CENTURY]=100,a),A=function(e,t){return e[t+"Format"]||g.date.formats[t]},V={onChange:l.PropTypes.func,value:l.PropTypes.instanceOf(Date),min:l.PropTypes.instanceOf(Date),max:l.PropTypes.instanceOf(Date),initialView:l.PropTypes.oneOf(E),finalView:function(e,t,s){var n=l.PropTypes.oneOf(E)(e,t,s);return n?n:E.indexOf(e[t])<E.indexOf(e.initialView)?new Error(("The `"+t+"` prop: `"+e[t]+"` cannot be 'lower' than the `initialView`\n prop. This creates a range that cannot be rendered.").replace(/\n\t/g,"")):void 0},disabled:l.PropTypes.oneOfType([l.PropTypes.bool,l.PropTypes.oneOf(["disabled"])]),readOnly:l.PropTypes.oneOfType([l.PropTypes.bool,l.PropTypes.oneOf(["readOnly"])]),culture:l.PropTypes.string,footer:l.PropTypes.bool,dayComponent:T.elementType,headerFormat:T.dateFormat,footerFormat:T.dateFormat,dayFormat:T.dateFormat,dateFormat:T.dateFormat,monthFormat:T.dateFormat,yearFormat:T.d
onFocus:this._inputFocus,onClick:this._inputFocus,maxLength:this.props.maxLength})),i.createElement(d,r._extends({},a.pick(this.props,Object.keys(l.type(d).propTypes)),{onOpening:function(){return t.refs.list.forceUpdate()},onRequestClose:this.close}),i.createElement("div",null,P&&[i.createElement(D,r._extends({ref:"list",key:"0"},O,{readOnly:!!O.readOnly,disabled:!!O.disabled,id:y,optID:v,"aria-autocomplete":"list","aria-hidden":!this.props.open,data:b,focused:this.state.focusedItem,onSelect:this._maybeHandle(this._onSelect),onMove:this._scrollTo,messages:{emptyList:this.props.data.length?x.emptyFilter:x.emptyList}})),this._shouldShowCreate()&&i.createElement("ul",{className:"rw-list rw-multiselect-create-tag",key:"1"},i.createElement("li",{onClick:this._onCreate.bind(null,this.props.searchTerm),className:o({"rw-list-option":!0,"rw-state-focus":!this._data().length||null===this.state.focusedItem})},g(this.props,x)))])))},_data:function(){return this.state.processedData},_delete:function(e){this._focus(!0),this.change(this.state.dataItems.filter(function(t){return t!==e}))},_inputFocus:function(){this._focus(!0),!this.props.open&&this.open()},_focus:function(e,t){var s=this;this.props.disabled!==!0&&(e&&this.refs.input.focus(),this.setTimeout("focus",function(){e||s.refs.tagList&&s.refs.tagList.clear(),e!==s.state.focused&&(e?s.open():s.close(),s.notify(e?"onFocus":"onBlur",t),s.setState({focused:e}))}))},_searchKeyDown:function(e){"Backspace"===e.key&&e.target.value&&!this._deletingText&&(this._deletingText=!0)},_searchgKeyUp:function(e){"Backspace"===e.key&&this._deletingText&&(this._deletingText=!1)},_typing:function(e){this.notify("onSearch",[e.target.value]),this.open()},_onSelect:function(e){return void 0===e?void(this.props.onCreate&&this._onCreate(this.props.searchTerm)):(this.notify("onSelect",e),this.change(this.state.dataItems.concat(e)),this.close(),void this._focus(!0))},_onCreate:function(e){""!==e.trim()&&(this.notify("onCreate",e),this.props.searchTerm&&this.notify("onSearch",[""]),this.close(),this._focus(!0))},_keyDown:function(e){var t=e.key,s=e.altKey,n=e.ctrlKey,r=!this.props.searchTerm&&!this._deletingText,i=this.props.open,o=this.state.focusedItem,a=this.refs.tagList,p=this.refs.list;if("ArrowDown"===t){var l=p.next(o),u=this._shouldShowCreate()&&o===l||null===o;l=u?null:l,e.preventDefault(),i?this.setState({focusedItem:l}):this.open()}else if("ArrowUp"===t){var c=null===o?p.last():p.prev(o);e.preventDefault(),s?this.close():i&&this.setState({focusedItem:c})}else"End"===t?i?this.setState({focusedItem:p.last()}):a&&a.last():"Home"===t?i?this.setState({focusedItem:p.first()}):a&&a.first():i&&"Enter"===t?n&&this.props.onCreate||null===o?this._onCreate(this.props.searchTerm):this._onSelect(this.state.focusedItem):"Escape"===t?i?this.close():a&&a.clear():r&&"ArrowLeft"===t?a&&a.prev():r&&"ArrowRight"===t?a&&a.next():r&&"Delete"===t?a&&a.removeCurrent():r&&"Backspace"===t&&a&&a.removeNext();this.notify("onKeyDown",[e])},change:function(e){this.notify("onChange",[e]),this.props.searchTerm&&this.notify("onSearch",[""])},open:function(){this.props.disabled!==!0&&this.props.readOnly!==!0&&this.notify("onToggle",!0)},close:function(){this.notify("onToggle",!1)},toggle:function(){this.props.open?this.close():this.open()},process:function(e,t,s){var n=this,r=e.filter(function(e){return!t.some(n._valueMatcher.bind(null,e),n)},this);return s&&(r=this.filter(r,s)),r},_shouldShowCreate:function(){var e=this,t=this.props.searchTerm;return this.props.onCreate&&t?!this._data().some(function(s){return e._dataText(s)===t})&&!this.state.dataItems.some(function(s){return e._dataText(s)===t}):!1},_placeholder:function(){return(this.props.value||[]).length?"":this.props.placeholder||""}});e.exports=y(b,{open:"onToggle",value:"onChange",searchTerm:"onSearch"}),e.exports.BaseMultiselect=b},function(e,t,s){"use strict";function n(e){return i.createClass({displayName:"SelectItem",render:function(){function t(e){p||l||o(e.target.checked)}var s=this.props.item,n=e._contains(s,e._values()),o=e._change.bind(null,s),p=e.isDisabledI
return{isRtl:this.props.isRtl||this.context&&this.context.isRtl}},isRtl:function(){return!!(this.props.isRtl||this.context&&this.context.isRtl)}}},function(e,t,s){"use strict";var n=s(11),r=s(17);e.exports=n.createClass({displayName:"exports",propTypes:{label:n.PropTypes.string.isRequired,labelId:n.PropTypes.string,upDisabled:n.PropTypes.bool.isRequired,prevDisabled:n.PropTypes.bool.isRequired,nextDisabled:n.PropTypes.bool.isRequired,onViewChange:n.PropTypes.func.isRequired,onMoveLeft:n.PropTypes.func.isRequired,onMoveRight:n.PropTypes.func.isRequired,messages:n.PropTypes.shape({moveBack:n.PropTypes.string,moveForward:n.PropTypes.string})},mixins:[s(38),s(61)],getDefaultProps:function(){return{messages:{moveBack:"navigate back",moveForward:"navigate forward"}}},render:function(){var e=this.isRtl();return n.createElement("div",{className:"rw-header"},n.createElement(r,{className:"rw-btn-left",tabIndex:"-1",onClick:this.props.onMoveLeft,disabled:this.props.prevDisabled,"aria-disabled":this.props.prevDisabled,title:this.props.moveBack},n.createElement("i",{className:"rw-i rw-i-caret-"+(e?"right":"left")}),n.createElement("span",{className:"rw-sr"},this.props.messages.moveBack)),n.createElement(r,{className:"rw-btn-view",id:this.props.labelId,tabIndex:"-1",onClick:this.props.onViewChange,disabled:this.props.upDisabled,"aria-disabled":this.props.upDisabled},this.props.label),n.createElement(r,{className:"rw-btn-right",tabIndex:"-1",onClick:this.props.onMoveRight,disabled:this.props.nextDisabled,"aria-disabled":this.props.nextDisabled,title:this.props.moveForward},n.createElement("i",{className:"rw-i rw-i-caret-"+(e?"left":"right")}),n.createElement("span",{className:"rw-sr"},this.props.messages.moveForward)))}})},function(e,t,s){"use strict";var n=s(11),r=s(17),i=(s(36),s(35).locale),o=function(e){return e.format||i.date.formats.footer};e.exports=n.createClass({displayName:"Footer",render:function(){var e=this.props.value,t=i.date.format(e,o(this.props),this.props.culture);return n.createElement("div",{className:"rw-footer"},n.createElement(r,{tabIndex:"-1","aria-disabled":!!this.props.disabled,"aria-readonly":!!this.props.readOnly,disabled:this.props.disabled,readOnly:this.props.readOnly,onClick:this.props.onClick.bind(null,e)},t))}})},function(e,t,s){"use strict";var n=s(13),r=s(11),i=s(48),o=s(36),a=s(35).locale,p=s(20),l=s(14),u=s(17),c=function(e){return e.dayFormat||a.date.formats.weekday},d=function(e){return e.dateFormat||a.date.formats.dayOfMonth};e.exports=r.createClass({displayName:"MonthView",mixins:[s(23),s(61)],propTypes:{culture:r.PropTypes.string,value:r.PropTypes.instanceOf(Date),focused:r.PropTypes.instanceOf(Date),min:r.PropTypes.instanceOf(Date),max:r.PropTypes.instanceOf(Date),dayComponent:p.elementType,dayFormat:p.dateFormat,dateFormat:p.dateFormat,onChange:r.PropTypes.func.isRequired},render:function(){var e=l.omit(this.props,["max","min","value","onChange"]),t=o.visibleDays(this.props.focused,this.props.culture),s=l.chunk(t,7);return r.createElement("table",n._extends({},e,{role:"grid",className:"rw-calendar-grid","aria-activedescendant":this._id("_selected_item")}),r.createElement("thead",null,r.createElement("tr",null,this._headers(c(this.props),e.culture))),r.createElement("tbody",null,s.map(this._row)))},_row:function(e,t){var s=this,n=this._id("_selected_item"),p=this.props.dayComponent;return r.createElement("tr",{key:"week_"+t,role:"row"},e.map(function(e,t){var l=o.eq(e,s.props.focused,"day"),c=o.eq(e,s.props.value,"day"),h=o.eq(e,s.props.today,"day"),f=a.date.format(e,d(s.props),s.props.culture);return o.inRange(e,s.props.min,s.props.max)?r.createElement("td",{key:"day_"+t,role:"gridcell"},r.createElement(u,{tabIndex:"-1",onClick:s.props.onChange.bind(null,e),"aria-pressed":c,"aria-disabled":s.props.disabled||void 0,disabled:s.props.disabled,className:i({"rw-off-range":o.month(e)!==o.month(s.props.focused),"rw-state-focus":l,"rw-state-selected":c,"rw-now":h}),id:l?n:void 0},p?r.createElement(p,{date:e,label:f}):f)):r.createElement("td",{key:"day_"+t,role:"gridcell",className:"rw-empty-cell"},
Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
function n(){for(var e,t="",s=0;s<arguments.length;s++)if(e=arguments[s])if("string"==typeof e||"number"==typeof e)t+=" "+e;else if("[object Array]"===Object.prototype.toString.call(e))t+=" "+n.apply(null,e);else if("object"==typeof e)for(var r in e)e.hasOwnProperty(r)&&e[r]&&(t+=" "+r);return t.substr(1)}var r,i;"undefined"!=typeof e&&e.exports&&(e.exports=n),r=[],i=function(){return n}.apply(t,r),!(void 0!==i&&(e.exports=i))},function(e,t,s){!function(){e.exports=this.Globalize}()},function(e,t,s){"use strict";function n(e){return"value"===e?"valueLink":"checked"===e?"checkedLink":null}function r(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function i(e,t,s){return function(){for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];t&&t.call.apply(t,[e].concat(r)),s&&s.call.apply(s,[e].concat(r))}}function o(e,t,s){return a(e,t.bind(null,s=s||(Array.isArray(e)?[]:{}))),s}function a(e,t,s){if(Array.isArray(e))return e.forEach(t,s);for(var n in e)p(e,n)&&t.call(s,e[n],n,e)}function p(e,t){return e?Object.prototype.hasOwnProperty.call(e,t):!1}var l=s(64),u=s(11);s(52),u.version.split(".").map(parseFloat);e.exports=function(e,t,s){function p(e,s){for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;r>o;o++)i[o-2]=arguments[o];var a=n(e),p=this.props[t[e]];a&&c(this.props,a)&&!p&&(p=this.props[a].requestChange),p&&(this._notifying=!0,p.call.apply(p,[this,s].concat(i)),this._notifying=!1),this.setState(function(){var t={};return t[e]=s,t}())}function c(e,t){return void 0!==e[t]}var d=e.displayName||e.name||"Component",h={};return d=d[0].toUpperCase()+d.substr(1),s=s||{},u.createClass({displayName:"Uncontrolled"+d,propTypes:h,getInitialState:function(){var e=this.props,s=Object.keys(t);return o(s,function(t,s){t[s]=e[r(s)]},{})},shouldComponentUpdate:function(){return!this._notifying},render:function(){var r=this,o={},d=this.props,h=(d.valueLink,d.checkedLink,l.objectWithoutProperties(d,["valueLink","checkedLink"]));return a(t,function(e,t){var s=n(t),i=r.props[t];s&&!c(r.props,t)&&c(r.props,s)&&(i=r.props[s].value),o[t]=void 0!==i?i:r.state[t],o[e]=p.bind(r,t)}),o=l._extends({},h,o),a(s,function(e,t){return o[t]=i(r,e,o[t])}),u.createElement(e,o)}})}},function(e,t,s){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}e.exports=n},function(e,t,s){"use strict";var n=function(e,t,s,n,r,i,o,a){if(!e){var p;if(void 0===t)p=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[s,n,r,i,o,a],u=0;p=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[u++]}))}throw p.framesToPop=1,p}};e.exports=n},function(e,t,s){"use strict";var n=s(68),r=n;e.exports=r},function(e,t,s){"use strict";var n=s(65),r=function(){var e=n&&document.documentElement;return e&&e.contains?function(e,t){return e.contains(t)}:e&&e.compareDocumentPosition?function(e,t){return e===t||!!(16&e.compareDocumentPosition(t))}:function(e,t){if(t)do if(t===e)return!0;while(t=t.parentNode);return!1}}();e.exports=r},function(e,t,s){"use strict";var n=s(66),r=s(67);e.exports=function(e,t){var s=r(e);return s?s.innerWidth:t?e.clientWidth:n(e).width}},function(e,t,s){"use strict";var n=s(66),r=s(67);e.exports=function(e,t){var s=r(e);return s?s.innerHeight:t?e.clientHeight:n(e).height}},function(e,t,s){"use strict";var n=s(66),r=s(56),i=s(70),o=s(69),a=s(71),p=s(67);e.exports=function(e,t){var s,l,u,c,d,h,f,m=n(e),y={top:0,left:0};if(e){s=t||i(e),c=p(s),l=o(s),h=r(s,!0),c=p(s),c||(y=n(s)),m={top:m.top-y.top,left:m.left-y.left,height:m.height,width:m.width},d=m.height,u=m.top+(c?0:l),f=u+d,l=l>u?u:f>l+h?f-h:l;var v=a(function(){return o(s,l)});return function(){return a.cancel(v)}}}},function(e,t,s){"use strict";var n=s(72),r=s(73),i=s(74),o=s(75),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,s){var p="",l=t;if("string"==typeof t){if(void 0===s)return e.style[n(t)]||i(e).getPropertyValue(t);(l={})[t]=s}for(var u in l)a.call(l,u)&&(l[u]||0===l[u]?p+=r(u)+":"+l[u]+";":o(e,r(u)));e.style.cssText+="