Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.149.251.22
(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{1120:function(e,t,n){"use strict";n.r(t);var a=n(41),r=n.n(a),o=n(68),l=n(99),s=n(100),i=n(102),u=n(101),c=n(103),d=n(1),p=n.n(d),f=n(1139),h=n(1106),m=n(272),v=n(1098),g=n(1100),k=n(104),y=n(858),w=n(269),E=n(266),b=n(3),C=n(0),O=n(1101),S=n(273),M=n.n(S),D=function(e){function t(){var e,n;Object(l.a)(this,t);for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return(n=Object(i.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(r)))).changeCell=function(e,t,a){var r=Object(C.a)({},t,Object(b.a)({},e.target.name,e.target.value));n.props.changeHolidayMaster(r,a)},n.addRow=function(){var e=n.props.holidayMaster.length,t=n.props.holidayMaster[e-1];if(""!==t.fremarks&&""!==t.fdate){if(t.fdate.substr(t.fdate.length-4)==n.props.year){var a=!1;if(n.props.holidayMaster.map(function(n,r){n.fdate==t.fdate&&e-1!==r&&(a=!0)}),a){n.props.showError({header:"Error",content:"Duplicate date. Enter another date."})}else{n.props.addHoliday({fremarks:"",fdate:"",fdeleted:!1})}}else{n.props.showError({header:"Error",content:"Enter the valid date"})}}else{n.props.showError({header:"Error",content:"Date and remarks cannot be blank"})}},n.deleteRow=function(e,t,a){var r=Object(C.a)({},t,Object(b.a)({},e.target.name,e.target.checked));n.props.changeHolidayMaster(r,a)},n}return Object(c.a)(t,e),Object(s.a)(t,[{key:"componentDidMount",value:function(){this.props.onRef(this)}},{key:"render",value:function(){var e=this,t=this.props.holidayMaster,n=t.length,a={n:"[0-1]",m:"[0-9]",e:"[0-3]",d:"[0-9]",z:"[1-2]",y:"[0-9]"};return p.a.createElement("div",{className:"ui mini form"},p.a.createElement(m.a,null),p.a.createElement(O.a,{celled:!0,style:{fontSize:"1.2536em"}},p.a.createElement(O.a.Header,null,p.a.createElement(O.a.Row,null,p.a.createElement(O.a.HeaderCell,{style:{width:"5%"},singleLine:!0,textAlign:"center"},"Sl. No."),p.a.createElement(O.a.HeaderCell,{style:{width:"22%"},textAlign:"center"},"Date"),p.a.createElement(O.a.HeaderCell,{textAlign:"center"},"Remarks"),p.a.createElement(O.a.HeaderCell,{style:{width:"10%"},textAlign:"center"},"Del"))),p.a.createElement(O.a.Body,null,t.map(function(t,r){return p.a.createElement(O.a.Row,{key:r},p.a.createElement(O.a.Cell,{textAlign:"center"},r+1),p.a.createElement(O.a.Cell,null,p.a.createElement("div",{className:"field"},p.a.createElement(M.a,{type:"text",style:{textAlign:"center"},formatChars:a,mask:"ed/nm/zyyy",name:"fdate",value:t.fdate,id:r,onChange:function(n){return e.changeCell(n,t,r)},placeholder:"dd/mm/yyyy"}))),p.a.createElement(O.a.Cell,{textAlign:"center",singleLine:!0},p.a.createElement("input",{className:"field",type:"text",name:"fremarks",id:r,value:t.fremarks,onChange:function(n){return e.changeCell(n,t,r)},placeholder:"Remarks"})),p.a.createElement(O.a.Cell,{textAlign:"center"},n==r+1?p.a.createElement("div",{className:"ui checkbox"},p.a.createElement("input",{type:"checkbox",onKeyDown:function(t){return 9===t.keyCode&&e.addRow()},name:"fdeleted",value:t.fdeleted,onChange:function(n){return e.deleteRow(n,t,r)},checked:"true"==t.fdeleted?"checked":null}),p.a.createElement("label",null," ")):p.a.createElement("div",{className:"ui checkbox"},p.a.createElement("input",{type:"checkbox",name:"fdeleted",value:t.fdeleted,onChange:function(n){return e.deleteRow(n,t,r)},checked:"true"==t.fdeleted?"checked":null}),p.a.createElement("label",null," "))))}))))}}]),t}(d.Component),R=Object(k.b)(function(e){return{holidayMaster:e.holidayMaster}},{changeHolidayMaster:function(e,t){return{type:"CHANGE_HOLIDAY",payload:{el:e,i:t}}},showError:E.w,addHoliday:function(e,t){return{type:"ADD_HOLIDAY",payload:{el:e}}}})(D),I=function(e){function t(){var e,n;Object(l.a)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return(n=Object(i.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(s)))).state={displayTbl:!1,year:(new Date).getFullYear(),frmSubmit:!1},n.handleChange=function(e,t){n.setState({year:t.value})},n.getYear=function(){for(var e=(new Date).getFullYear(),t=[],n=e-1;n<=e+4;n++){var a={key:n,value:n,text:n};t.push(a)}return t},n.getHolidayMaster=function(){n.props.getHolidayMaster(n.state.year),n.setState({displayTbl:!0,frmSubmit:!0})},n.addRow=function(){n.holidaytable.addRow()},n.handleCancel=function(){n.setState({displayTbl:!1,year:(new Date).getFullYear(),frmSubmit:!1}),n.props.deleteHoliday()},n.handleSave=Object(o.a)(r.a.mark(function e(){var t,a,o,l,s;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.props.holidayMaster,a=!1,o={},t.map(function(e){var t=e.fdate;t in o?(o[t].duplicate=!0,e.duplicate=!0,a=!0):(o[t]=e,delete e.duplicate)}),!a){e.next=7;break}return l={header:"Error",content:"Duplicate dates. Enter validates dates."},n.props.showError(l),e.abrupt("return");case 7:return s=t.filter(function(e){if(""!==e.fdate&&""!==e.fremarks)return e}),e.next=10,n.props.saveHolidayMaster(n.state.year,s);case 10:0==n.props.error.error_code&&n.handleCancel();case 11:case"end":return e.stop()}},e)})),n.renderHeader=function(){return p.a.createElement(f.a.Header,{style:{display:"flex"}},p.a.createElement("h3",null,"Holiday Master"),p.a.createElement("div",{className:"ml-auto"},p.a.createElement(h.a,{disabled:!n.state.frmSubmit,basic:!0,color:"blue",content:"Add",onClick:n.addRow,icon:"plus"}),p.a.createElement(h.a,{disabled:!n.state.frmSubmit,basic:!0,color:"green",content:"Save",onClick:n.handleSave,icon:"save"}),p.a.createElement(h.a,{basic:!0,onClick:n.handleCancel,color:"black",icon:"ban",content:"Cancel"}),p.a.createElement(y.a,{to:"/dashboard"},p.a.createElement(h.a,{basic:!0,color:"red",content:"Exit",icon:"home"}))))},n}return Object(c.a)(t,e),Object(s.a)(t,[{key:"render",value:function(){var e=this,t=this.state,n=t.displayTbl,a=t.year,r=this.getYear();return p.a.createElement("div",{className:"animated fadeIn"},p.a.createElement(f.a,{fluid:!0},p.a.createElement(f.a.Content,null,this.renderHeader(),p.a.createElement(m.a,null),p.a.createElement(f.a.Description,{style:{height:"72vh",overflowY:"auto"}},p.a.createElement(v.a,null,p.a.createElement("div",{className:"col-md-4"},p.a.createElement(v.a.Field,null,p.a.createElement("label",null,"Year"),p.a.createElement(g.a,{size:"mini",fluid:!0,search:!0,selection:!0,value:a,onChange:this.handleChange,placeholder:"Select Year",disabled:this.props.disabled,options:r})),p.a.createElement(h.a,{color:"blue",className:"small ui button",onClick:this.getHolidayMaster},"Submit"))),n?p.a.createElement("div",{className:"col-md-8"},p.a.createElement(R,{year:a,onRef:function(t){return e.holidaytable=t}})):null))))}}]),t}(d.Component);t.default=Object(k.b)(function(e){return{holidayMaster:e.holidayMaster,error:e.error}},{getHolidayMaster:function(e){return function(){var t=Object(o.a)(r.a.mark(function t(n,a){var o,l;return r.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=a(),n({type:"SET_LOADER"}),t.next=4,w.a.get("/app.php",{params:{a:"getHolidayMaster",fyear:e,univcode:o.univ.funivcode}});case 4:l=t.sent,n({type:"UNSET_LOADER"}),"object"!==typeof l.data?n({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):-1===l.data.error_code?n({type:"SET_ERROR",payload:l.data}):n({type:"FETCH_HOLIDAY",payload:l.data});case 7:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},showError:E.w,saveHolidayMaster:function(e,t){return function(){var n=Object(o.a)(r.a.mark(function n(a,o){var l,s;return r.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=o(),a({type:"SET_LOADER"}),n.next=4,w.a.post("/app.php?a=saveHolidayMaster&univcode="+l.univ.funivcode,{data:{fyear:e,holidays:t}});case 4:s=n.sent,a({type:"UNSET_LOADER"}),"object"!==typeof s.data?a({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):a({type:"SET_ERROR",payload:s.data});case 7:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}()},deleteHoliday:function(){return{type:"DELETE_HOLIDAY"}}})(I)},272:function(e,t,n){"use strict";var a=n(268),r=n.n(a),o=n(265),l=n.n(o),s=n(1),i=n.n(s),u=n(333),c=n(551),d=n(549),p=n(267);function f(e){var t=e.children,n=e.className,a=e.clearing,o=e.content,s=e.fitted,h=e.hidden,m=e.horizontal,v=e.inverted,g=e.section,k=e.vertical,y=l()("ui",Object(u.a)(a,"clearing"),Object(u.a)(s,"fitted"),Object(u.a)(h,"hidden"),Object(u.a)(m,"horizontal"),Object(u.a)(v,"inverted"),Object(u.a)(g,"section"),Object(u.a)(k,"vertical"),"divider",n),w=Object(c.a)(f,e),E=Object(d.a)(f,e);return i.a.createElement(E,r()({},w,{className:y}),p.a.isNil(t)?o:t)}f.handledProps=["as","children","className","clearing","content","fitted","hidden","horizontal","inverted","section","vertical"],f.propTypes={},t.a=f},273:function(e,t,n){e.exports=n(274)},274:function(e,t,n){"use strict";var a,r=(a=n(1))&&"object"==typeof a&&"default"in a?a.default:a,o=n(105);function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function s(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var n=Object.getOwnPropertyNames(t),a=0;a<n.length;a++){var r=n[a],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}}(e.prototype.constructor=e,t)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=function(e,t,n,a,r,o,l,s){if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,a,r,o,l,s],c=0;(i=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw i.framesToPop=1,i}};function c(e,t,n){if("selectionStart"in e&&"selectionEnd"in e)e.selectionStart=t,e.selectionEnd=n;else{var a=e.createTextRange();a.collapse(!0),a.moveStart("character",t),a.moveEnd("character",n-t),a.select()}}var d={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},p="_";function f(e,t,n){var a="",r="",o=null,l=[];if(void 0===t&&(t=p),null==n&&(n=d),!e||"string"!=typeof e)return{maskChar:t,formatChars:n,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var s=!1;return e.split("").forEach(function(e){s=!s&&"\\"===e||(s||!n[e]?(l.push(a.length),a.length===l.length-1&&(r+=e)):o=a.length+1,a+=e,!1)}),{maskChar:t,formatChars:n,prefix:r,mask:a,lastEditablePosition:o,permanents:l}}function h(e,t){return-1!==e.permanents.indexOf(t)}function m(e,t,n){var a=e.mask,r=e.formatChars;if(!n)return!1;if(h(e,t))return a[t]===n;var o=r[a[t]];return new RegExp(o).test(n)}function v(e,t){return t.split("").every(function(t,n){return h(e,n)||!m(e,n,t)})}function g(e,t){var n=e.maskChar,a=e.prefix;if(!n){for(;t.length>a.length&&h(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var r=a.length,o=t.length;o>=a.length;o--){var l=t[o];if(!h(e,o)&&m(e,o,l)){r=o+1;break}}return r}function k(e,t){return g(e,t)===e.mask.length}function y(e,t){var n=e.maskChar,a=e.mask,r=e.prefix;if(!n){for((t=w(e,"",t,0)).length<r.length&&(t=r);t.length<a.length&&h(e,t.length);)t+=a[t.length];return t}if(t)return w(e,y(e,""),t,0);for(var o=0;o<a.length;o++)h(e,o)?t+=a[o]:t+=n;return t}function w(e,t,n,a){var r=e.mask,o=e.maskChar,l=e.prefix,s=n.split(""),i=k(e,t);return!o&&a>t.length&&(t+=r.slice(t.length,a)),s.every(function(n){for(;c=n,h(e,u=a)&&c!==r[u];){if(a>=t.length&&(t+=r[a]),s=n,o&&h(e,a)&&s===o)return!0;if(++a>=r.length)return!1}var s,u,c;return!m(e,a,n)&&n!==o||(a<t.length?t=o||i||a<l.length?t.slice(0,a)+n+t.slice(a+1):(t=t.slice(0,a)+n+t.slice(a),y(e,t)):o||(t+=n),++a<r.length)}),t}function E(e,t){for(var n=e.mask,a=t;a<n.length;++a)if(!h(e,a))return a;return null}function b(e){return e||0===e?e+"":""}function C(e,t,n,a,r){var o=e.mask,l=e.prefix,s=e.lastEditablePosition,i=t,u="",c=0,d=0,p=Math.min(r.start,n.start);return n.end>r.start?d=(c=function(e,t,n,a){var r=e.mask,o=e.maskChar,l=n.split(""),s=a;return l.every(function(t){for(;l=t,h(e,n=a)&&l!==r[n];)if(++a>=r.length)return!1;var n,l;return(m(e,a,t)||t===o)&&a++,a<r.length}),a-s}(e,0,u=i.slice(r.start,n.end),p))?r.length:0:i.length<a.length&&(d=a.length-i.length),i=a,d&&(1!==d||r.length||(p=r.start===n.start?E(e,n.start):function(e,t){for(var n=t;0<=n;--n)if(!h(e,n))return n;return null}(e,n.start)),i=function(e,t,n,a){var r=n+a,o=e.maskChar,l=e.mask,s=e.prefix,i=t.split("");if(o)return i.map(function(t,a){return a<n||r<=a?t:h(e,a)?l[a]:o}).join("");for(var u=r;u<i.length;u++)h(e,u)&&(i[u]="");return n=Math.max(s.length,n),i.splice(n,r-n),t=i.join(""),y(e,t)}(e,i,p,d)),i=w(e,i,u,p),(p+=c)>=o.length?p=o.length:p<l.length&&!c?p=l.length:p>=l.length&&p<s&&c&&(p=E(e,p)),u||(u=null),{value:i=y(e,i),enteredString:u,selection:{start:p,end:p}}}function O(e){return"function"==typeof e}function S(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function M(e){return(S()?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame:function(){return setTimeout(e,1e3/60)})(e)}function D(e){(S()||clearTimeout)(e)}var R=function(e){function t(t){var n=e.call(this,t)||this;n.focused=!1,n.mounted=!1,n.previousSelection=null,n.selectionDeferId=null,n.saveSelectionLoopDeferId=null,n.saveSelectionLoop=function(){n.previousSelection=n.getSelection(),n.saveSelectionLoopDeferId=M(n.saveSelectionLoop)},n.runSaveSelectionLoop=function(){null===n.saveSelectionLoopDeferId&&n.saveSelectionLoop()},n.stopSaveSelectionLoop=function(){null!==n.saveSelectionLoopDeferId&&(D(n.saveSelectionLoopDeferId),n.saveSelectionLoopDeferId=null,n.previousSelection=null)},n.getInputDOMNode=function(){if(!n.mounted)return null;var e=o.findDOMNode(i(i(n))),t="undefined"!=typeof window&&e instanceof window.Element;if(e&&!t)return null;if("INPUT"!==e.nodeName&&(e=e.querySelector("input")),!e)throw new Error("react-input-mask: inputComponent doesn't contain input node");return e},n.getInputValue=function(){var e=n.getInputDOMNode();return e?e.value:null},n.setInputValue=function(e){var t=n.getInputDOMNode();t&&(n.value=e,t.value=e)},n.setCursorToEnd=function(){var e=g(n.maskOptions,n.value),t=E(n.maskOptions,e);null!==t&&n.setCursorPosition(t)},n.setSelection=function(e,t,a){void 0===a&&(a={});var r=n.getInputDOMNode(),o=n.isFocused();r&&o&&(a.deferred||c(r,e,t),null!==n.selectionDeferId&&D(n.selectionDeferId),n.selectionDeferId=M(function(){n.selectionDeferId=null,c(r,e,t)}),n.previousSelection={start:e,end:t,length:Math.abs(t-e)})},n.getSelection=function(){return function(e){var t=0,n=0;if("selectionStart"in e&&"selectionEnd"in e)t=e.selectionStart,n=e.selectionEnd;else{var a=document.selection.createRange();a.parentElement()===e&&(t=-a.moveStart("character",-e.value.length),n=-a.moveEnd("character",-e.value.length))}return{start:t,end:n,length:n-t}}(n.getInputDOMNode())},n.getCursorPosition=function(){return n.getSelection().start},n.setCursorPosition=function(e){n.setSelection(e,e)},n.isFocused=function(){return n.focused},n.getBeforeMaskedValueChangeConfig=function(){var e=n.maskOptions,t=e.mask,a=e.maskChar,r=e.permanents,o=e.formatChars;return{mask:t,maskChar:a,permanents:r,alwaysShowMask:!!n.props.alwaysShowMask,formatChars:o}},n.isInputAutofilled=function(e,t,a,r){var o=n.getInputDOMNode();try{if(o.matches(":-webkit-autofill"))return!0}catch(u){}return!n.focused||r.end<a.length&&t.end===e.length},n.onChange=function(e){var t=i(i(n)).beforePasteState,a=i(i(n)).previousSelection,r=n.props.beforeMaskedValueChange,o=n.getInputValue(),l=n.value,s=n.getSelection();n.isInputAutofilled(o,s,l,a)&&(l=y(n.maskOptions,""),a={start:0,end:0,length:0}),t&&(a=t.selection,l=t.value,s={start:a.start+o.length,end:a.start+o.length,length:0},o=l.slice(0,a.start)+o+l.slice(a.end),n.beforePasteState=null);var u=C(n.maskOptions,o,s,l,a),c=u.enteredString,d=u.selection,p=u.value;if(O(r)){var f=r({value:p,selection:d},{value:l,selection:a},c,n.getBeforeMaskedValueChangeConfig());p=f.value,d=f.selection}n.setInputValue(p),O(n.props.onChange)&&n.props.onChange(e),n.isWindowsPhoneBrowser?n.setSelection(d.start,d.end,{deferred:!0}):n.setSelection(d.start,d.end)},n.onFocus=function(e){var t=n.props.beforeMaskedValueChange,a=n.maskOptions,r=a.mask,o=a.prefix;if(n.focused=!0,n.mounted=!0,r){if(n.value)g(n.maskOptions,n.value)<n.maskOptions.mask.length&&n.setCursorToEnd();else{var l=y(n.maskOptions,o),s=y(n.maskOptions,l),i=g(n.maskOptions,s),u=E(n.maskOptions,i),c={start:u,end:u};if(O(t)){var d=t({value:s,selection:c},{value:n.value,selection:null},null,n.getBeforeMaskedValueChangeConfig());s=d.value,c=d.selection}var p=s!==n.getInputValue();p&&n.setInputValue(s),p&&O(n.props.onChange)&&n.props.onChange(e),n.setSelection(c.start,c.end)}n.runSaveSelectionLoop()}O(n.props.onFocus)&&n.props.onFocus(e)},n.onBlur=function(e){var t=n.props.beforeMaskedValueChange,a=n.maskOptions.mask;if(n.stopSaveSelectionLoop(),n.focused=!1,a&&!n.props.alwaysShowMask&&v(n.maskOptions,n.value)){var r="";O(t)&&(r=t({value:r,selection:null},{value:n.value,selection:n.previousSelection},null,n.getBeforeMaskedValueChangeConfig()).value);var o=r!==n.getInputValue();o&&n.setInputValue(r),o&&O(n.props.onChange)&&n.props.onChange(e)}O(n.props.onBlur)&&n.props.onBlur(e)},n.onMouseDown=function(e){if(!n.focused&&document.addEventListener){n.mouseDownX=e.clientX,n.mouseDownY=e.clientY,n.mouseDownTime=(new Date).getTime();document.addEventListener("mouseup",function e(t){if(document.removeEventListener("mouseup",e),n.focused){var a=Math.abs(t.clientX-n.mouseDownX),r=Math.abs(t.clientY-n.mouseDownY),o=Math.max(a,r),l=(new Date).getTime()-n.mouseDownTime;(o<=10&&l<=200||o<=5&&l<=300)&&n.setCursorToEnd()}})}O(n.props.onMouseDown)&&n.props.onMouseDown(e)},n.onPaste=function(e){O(n.props.onPaste)&&n.props.onPaste(e),e.defaultPrevented||(n.beforePasteState={value:n.getInputValue(),selection:n.getSelection()},n.setInputValue(""))},n.handleRef=function(e){null==n.props.children&&O(n.props.inputRef)&&n.props.inputRef(e)};var a=t.mask,r=t.maskChar,l=t.formatChars,s=t.alwaysShowMask,u=t.beforeMaskedValueChange,d=t.defaultValue,p=t.value;n.maskOptions=f(a,r,l),null==d&&(d=""),null==p&&(p=d);var h=b(p);if(n.maskOptions.mask&&(s||h)&&(h=y(n.maskOptions,h),O(u))){var m=t.value;null==t.value&&(m=d),h=u({value:h,selection:null},{value:m=b(m),selection:null},null,n.getBeforeMaskedValueChangeConfig()).value}return n.value=h,n}s(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=function(){var e=new RegExp("windows","i"),t=new RegExp("phone","i"),n=navigator.userAgent;return e.test(n)&&t.test(n)}(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},n.componentDidUpdate=function(){var e=this.previousSelection,t=this.props,n=t.beforeMaskedValueChange,a=t.alwaysShowMask,r=t.mask,o=t.maskChar,l=t.formatChars,s=this.maskOptions,i=a||this.isFocused(),u=null!=this.props.value,c=u?b(this.props.value):this.value,d=e?e.start:null;if(this.maskOptions=f(r,o,l),this.maskOptions.mask){!s.mask&&this.isFocused()&&this.runSaveSelectionLoop();var p=this.maskOptions.mask&&this.maskOptions.mask!==s.mask;if(s.mask||u||(c=this.getInputValue()),(p||this.maskOptions.mask&&(c||i))&&(c=y(this.maskOptions,c)),p){var h=g(this.maskOptions,c);(null===d||h<d)&&(d=k(this.maskOptions,c)?h:E(this.maskOptions,h))}!this.maskOptions.mask||!v(this.maskOptions,c)||i||u&&this.props.value||(c="");var m={start:d,end:d};if(O(n)){var w=n({value:c,selection:m},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());c=w.value,m=w.selection}this.value=c;var C=this.getInputValue()!==this.value;C?(this.setInputValue(this.value),this.forceUpdate()):p&&this.forceUpdate();var S=!1;null!=m.start&&null!=m.end&&(S=!e||e.start!==m.start||e.end!==m.end),(S||C)&&this.setSelection(m.start,m.end)}else s.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},n.componentWillUnmount=function(){this.mounted=!1,null!==this.selectionDeferId&&D(this.selectionDeferId),this.stopSaveSelectionLoop()},n.render=function(){var e,t=this.props,n=(t.mask,t.alwaysShowMask,t.maskChar,t.formatChars,t.inputRef,t.beforeMaskedValueChange,t.children),a=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],0<=t.indexOf(n)||(r[n]=e[n]);return r}(t,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(n){O(n)||u(!1);var o=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],s=l({},a);o.forEach(function(e){return delete s[e]}),e=n(s),o.filter(function(t){return null!=e.props[t]&&e.props[t]!==a[t]}).length&&u(!1)}else e=r.createElement("input",l({ref:this.handleRef},a));var i={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(a.disabled||a.readOnly||(i.onChange=this.onChange,i.onPaste=this.onPaste,i.onMouseDown=this.onMouseDown),null!=a.value&&(i.value=this.value)),e=r.cloneElement(e,i)},t}(r.Component);e.exports=R}}]);
//# sourceMappingURL=77.5f3eaf7c.chunk.js.map
|