Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-bootstrap-table2-editor

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bootstrap-table2-editor - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

dist/react-bootstrap-table2-editor.min.js

@@ -6,2 +6,2 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactBootstrapTable2Editor=t(require("react")):e.ReactBootstrapTable2Editor=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(6)()},function(e,t,n){var r,o;/*!

*/
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var u in r)a.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}var a={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TIME_TO_CLOSE_MESSAGE=3e3,t.DELAY_FOR_DBCLICK=200,t.CLICK_TO_CELL_EDIT="click",t.DBCLICK_TO_CELL_EDIT="dbclick",t.EDITTYPE={TEXT:"text",SELECT:"select",TEXTAREA:"textarea",CHECKBOX:"checkbox",DATE:"date"}},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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.Consumer=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),f=r(s),d=n(1),p=r(d),y=n(3),h=f.default.createContext();t.default=function(e,t,n,r){var s=function(s){function d(e){a(this,d);var t=u(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,e));return t.startEditing=t.startEditing.bind(t),t.escapeEditing=t.escapeEditing.bind(t),t.completeEditing=t.completeEditing.bind(t),t.handleCellUpdate=t.handleCellUpdate.bind(t),t.state={ridx:null,cidx:null,message:null},t}return i(d,s),c(d,[{key:"componentWillReceiveProps",value:function(e){e.cellEdit&&n()&&(e.cellEdit.options.errorMessage?this.setState(function(){return{message:e.cellEdit.options.errorMessage}}):this.escapeEditing())}},{key:"handleCellUpdate",value:function(o,a,u){var i=this.props,l=i.keyField,c=i.cellEdit,s=i.data,f=c.options,d=f.beforeSaveCell,p=f.afterSaveCell,y=e.get(o,a.dataField),h=e.get(o,l);e.isFunction(d)&&d(y,u,o,a),n()?r(h,a.dataField,u):(t.editCell(s,l,h,a.dataField,u),e.isFunction(p)&&p(y,u,o,a),this.completeEditing())}},{key:"completeEditing",value:function(){this.setState(function(){return{ridx:null,cidx:null,message:null}})}},{key:"startEditing",value:function(e,t){var n=this,r=this.props.selectRow;r&&!r.clickToEdit&&r.clickToSelect||function(){n.setState(function(){return{ridx:e,cidx:t}})}()}},{key:"escapeEditing",value:function(){this.setState(function(){return{ridx:null,cidx:null}})}},{key:"render",value:function(){var t=this.props.cellEdit,n=t.options,r=n.nonEditableRows,a=(n.errorMessage,o(n,["nonEditableRows","errorMessage"])),u=o(t,["options"]),i=l({},a,u,this.state,{nonEditableRows:e.isDefined(r)?r():[],onStart:this.startEditing,onEscape:this.escapeEditing,onUpdate:this.handleCellUpdate});return f.default.createElement(h.Provider,{value:l({},i)},this.props.children)}}]),d}(f.default.Component);return s.propTypes={data:p.default.array.isRequired,selectRow:p.default.object,options:p.default.shape({mode:p.default.oneOf([y.CLICK_TO_CELL_EDIT,y.DBCLICK_TO_CELL_EDIT]).isRequired,onErrorMessageDisappear:p.default.func,blurToSave:p.default.bool,beforeSaveCell:p.default.func,afterSaveCell:p.default.func,onStartEdit:p.default.func,nonEditableRows:p.default.func,timeToCloseMessage:p.default.number,errorMessage:p.default.any})},{Provider:s}};t.Consumer=h.Consumer},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Type=void 0;var o=n(4),a=r(o),u=n(10),i=r(u),l=n(11),c=r(l),s=n(3);t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{createContext:a.default,createEditingCell:c.default,withRowLevelCellEdit:i.default,DBCLICK_TO_CELL_EDIT:s.DBCLICK_TO_CELL_EDIT,DELAY_FOR_DBCLICK:s.DELAY_FOR_DBCLICK,options:e}};t.Type=s.EDITTYPE},function(e,t,n){"use strict";var r=n(7),o=n(8),a=n(9);e.exports=function(){function e(e,t,n,r,u,i){i!==a&&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")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,a,u,i,l){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,a,u,i,l],f=0;c=new Error(t.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=n(3),i=n(4);t.default=function(e,t){function n(e){return a.default.createElement(i.Consumer,null,function(t){return o(e,t)})}var o=function(n,o){var i=n.value,l=!(o.nonEditableRows.length>0&&o.nonEditableRows.indexOf(i)>-1),c={};return t&&o.mode===u.DBCLICK_TO_CELL_EDIT&&(c.DELAY_FOR_DBCLICK=u.DELAY_FOR_DBCLICK),a.default.createElement(e,r({},n,c,{editingRowIdx:o.ridx,editingColIdx:o.cidx,editable:l,onStart:o.onStart,clickToEdit:o.mode===u.CLICK_TO_CELL_EDIT,dbclickToEdit:o.mode===u.DBCLICK_TO_CELL_EDIT}))};return n.displayName="WithCellEditingRowConsumer",n}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(0),u=r(a),i=n(4),l=n(12),c=r(l);t.default=function(e,t){var n=(0,c.default)(e,t),r=function(t,r){var a=e.get(t.row,t.column.dataField),i=t.column.editCellStyle||{},l=t.column.editCellClasses;return e.isFunction(t.column.editCellStyle)&&(i=t.column.editCellStyle(a,t.row,t.rowIndex,t.columnIndex)),e.isFunction(t.column.editCellClasses)&&(l=t.column.editCellClasses(a,t.row,t.rowIndex,t.columnIndex)),u.default.createElement(n,o({},t,{className:l,style:i},r))};return function(e){return u.default.createElement(i.Consumer,null,function(t){return r(e,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 a(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 u(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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),s=r(c),f=n(2),d=r(f),p=n(1),y=r(p),h=n(13),v=r(h),b=n(14),m=r(b),O=n(15),_=r(O),g=n(16),E=r(g),T=n(17),C=r(T),w=n(18),j=r(w),x=n(3);t.default=function(e,t){var n,r;return r=n=function(n){function r(e){o(this,r);var t=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.indicatorTimer=null,t.clearTimer=t.clearTimer.bind(t),t.handleBlur=t.handleBlur.bind(t),t.handleClick=t.handleClick.bind(t),t.handleKeyDown=t.handleKeyDown.bind(t),t.beforeComplete=t.beforeComplete.bind(t),t.state={invalidMessage:null},t}return u(r,n),l(r,[{key:"componentWillReceiveProps",value:function(t){var n=t.message;e.isDefined(n)&&(this.createTimer(),this.setState(function(){return{invalidMessage:n}}))}},{key:"componentWillUnmount",value:function(){this.clearTimer()}},{key:"clearTimer",value:function(){this.indicatorTimer&&clearTimeout(this.indicatorTimer)}},{key:"createTimer",value:function(){var t=this;this.clearTimer();var n=this.props,r=n.timeToCloseMessage,o=n.onErrorMessageDisappear;this.indicatorTimer=e.sleep(function(){t.setState(function(){return{invalidMessage:null}}),e.isFunction(o)&&o()},r)}},{key:"beforeComplete",value:function(t){var n=this.props,r=n.onUpdate,o=n.row,a=n.column;if(e.isFunction(a.validator)){var u=a.validator(t,o,a);if(e.isObject(u)&&!u.valid)return this.setState(function(){return{invalidMessage:u.message}}),void this.createTimer()}r(o,a,t)}},{key:"handleBlur",value:function(){var e=this.props,t=e.onEscape;e.blurToSave?this.beforeComplete(this.editor.getValue()):t()}},{key:"handleKeyDown",value:function(e){var t=this.props.onEscape;27===e.keyCode?t():13===e.keyCode&&this.beforeComplete(this.editor.getValue())}},{key:"handleClick",value:function(e){"TD"!==e.target.tagName&&e.stopPropagation()}},{key:"render",value:function(){var n=this,r=void 0,o=this.props,a=o.row,u=o.column,l=o.className,c=o.style,f=o.rowIndex,p=o.columnIndex,y=o.autoSelectText,h=u.dataField,b=e.get(a,h),O=e.isDefined(this.state.invalidMessage),g=u.editorClasses||"";e.isFunction(u.editorClasses)&&(g=u.editorClasses(b,a,f,p));var T=u.editorStyle||{};e.isFunction(u.editorStyle)&&(T=u.editorStyle(b,a,f,p));var w=(0,d.default)({animated:O,shake:O},g),P={ref:function(e){return n.editor=e},defaultValue:b,style:T,className:w,onKeyDown:this.handleKeyDown,onBlur:this.handleBlur};t&&(P.didMount=function(){return t(a,u,f,p)});var M=e.isObject(u.editor);return M?P=i({},P,u.editor):e.isFunction(u.editorRenderer)&&(P=i({},P,{onUpdate:this.beforeComplete})),r=e.isFunction(u.editorRenderer)?u.editorRenderer(P,b,a,u,f,p):M&&u.editor.type===x.EDITTYPE.SELECT?s.default.createElement(v.default,P):M&&u.editor.type===x.EDITTYPE.TEXTAREA?s.default.createElement(m.default,i({},P,{autoSelectText:y})):M&&u.editor.type===x.EDITTYPE.CHECKBOX?s.default.createElement(_.default,P):M&&u.editor.type===x.EDITTYPE.DATE?s.default.createElement(E.default,P):s.default.createElement(C.default,i({},P,{autoSelectText:y})),s.default.createElement("td",{className:(0,d.default)("react-bootstrap-table-editing-cell",l),style:c,onClick:this.handleClick},r,O?s.default.createElement(j.default,{invalidMessage:this.state.invalidMessage}):null)}}]),r}(c.Component),n.propTypes={row:y.default.object.isRequired,rowIndex:y.default.number.isRequired,column:y.default.object.isRequired,columnIndex:y.default.number.isRequired,onUpdate:y.default.func.isRequired,onEscape:y.default.func.isRequired,timeToCloseMessage:y.default.number,autoSelectText:y.default.bool,className:y.default.string,style:y.default.object},n.defaultProps={timeToCloseMessage:x.TIME_TO_CLOSE_MESSAGE,className:null,autoSelectText:!1,style:{}},r}},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),f=r(s),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount;this.select.value=t,this.select.focus(),n&&n()}},{key:"getValue",value:function(){return this.select.value}},{key:"render",value:function(){var e=this,t=this.props,n=t.defaultValue,r=(t.didMount,t.className),a=t.options,u=o(t,["defaultValue","didMount","className","options"]),i=(0,p.default)("form-control editor edit-select",r),c=l({},u,{className:i});return f.default.createElement("select",l({},c,{ref:function(t){return e.select=t},defaultValue:n}),a.map(function(e){var t=e.label,n=e.value;return f.default.createElement("option",{key:n,value:n},t)}))}}]),t}(s.Component);v.propTypes={defaultValue:h.default.oneOfType([h.default.string,h.default.number]),className:h.default.string,style:h.default.object,options:h.default.oneOfType([h.default.arrayOf(h.default.shape({label:h.default.string,value:h.default.any}))]).isRequired,didMount:h.default.func},v.defaultProps={className:"",defaultValue:"",style:{},didMount:void 0},t.default=v},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),f=r(s),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(e){a(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleKeyDown=n.handleKeyDown.bind(n),n}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount,r=e.autoSelectText;this.text.value=t,this.text.focus(),r&&this.text.select(),n&&n()}},{key:"getValue",value:function(){return this.text.value}},{key:"handleKeyDown",value:function(e){(13!==e.keyCode||e.shiftKey)&&this.props.onKeyDown&&this.props.onKeyDown(e)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=(t.autoSelectText,o(t,["defaultValue","didMount","className","autoSelectText"])),a=(0,p.default)("form-control editor edit-textarea",n);return f.default.createElement("textarea",l({ref:function(t){return e.text=t},type:"textarea",className:a},r,{onKeyDown:this.handleKeyDown}))}}]),t}(s.Component);v.propTypes={className:h.default.oneOfType([h.default.string,h.default.object]),defaultValue:h.default.oneOfType([h.default.string,h.default.number]),onKeyDown:h.default.func,autoSelectText:h.default.bool,didMount:h.default.func},v.defaultProps={className:"",defaultValue:"",autoSelectText:!1,onKeyDown:void 0,didMount:void 0},t.default=v},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(r=(u=i.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=n(0),d=r(f),p=n(2),y=r(p),h=n(1),v=r(h),b=function(e){function t(e){a(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={checked:e.defaultValue.toString()===e.value.split(":")[0]},n.handleChange=n.handleChange.bind(n),n}return i(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props.didMount;this.checkbox.focus(),e&&e()}},{key:"getValue",value:function(){var e=this.props.value.split(":"),t=c(e,2),n=t[0],r=t[1];return this.checkbox.checked?n:r}},{key:"handleChange",value:function(e){this.props.onChange&&this.props.onChange(e);var t=e.target;this.setState(function(){return{checked:t.checked}})}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=o(t,["defaultValue","didMount","className"]),a=(0,y.default)("editor edit-chseckbox checkbox",n);return d.default.createElement("input",l({ref:function(t){return e.checkbox=t},type:"checkbox",className:a},r,{checked:this.state.checked,onChange:this.handleChange}))}}]),t}(f.Component);b.propTypes={className:v.default.oneOfType([v.default.string,v.default.object]),value:v.default.string,defaultValue:v.default.any,onChange:v.default.func,didMount:v.default.func},b.defaultProps={className:"",value:"on:off",defaultValue:!1,onChange:void 0,didMount:void 0},t.default=b},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),f=r(s),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount;this.date.valueAsDate=new Date(t),this.date.focus(),n&&n()}},{key:"getValue",value:function(){return this.date.value}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=o(t,["defaultValue","didMount","className"]),a=(0,p.default)("form-control editor edit-date",n);return f.default.createElement("input",l({ref:function(t){return e.date=t},type:"date",className:a},r))}}]),t}(s.Component);v.propTypes={className:h.default.oneOfType([h.default.string,h.default.object]),defaultValue:h.default.string,didMount:h.default.func},v.defaultProps={className:"",defaultValue:"",didMount:void 0},t.default=v},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),f=r(s),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount,r=e.autoSelectText;this.text.value=t,this.text.focus(),r&&this.text.select(),n&&n()}},{key:"getValue",value:function(){return this.text.value}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=(t.autoSelectText,o(t,["defaultValue","didMount","className","autoSelectText"])),a=(0,p.default)("form-control editor edit-text",n);return f.default.createElement("input",l({ref:function(t){return e.text=t},type:"text",className:a},r))}}]),t}(s.Component);v.propTypes={className:h.default.oneOfType([h.default.string,h.default.object]),defaultValue:h.default.oneOfType([h.default.string,h.default.number]),autoSelectText:h.default.bool,didMount:h.default.func},v.defaultProps={className:null,defaultValue:"",autoSelectText:!1,didMount:void 0},t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=r(o),u=n(1),i=r(u),l=function(e){var t=e.invalidMessage;return a.default.createElement("div",{className:"alert alert-danger fade in"},a.default.createElement("strong",null,t))};l.propTypes={invalidMessage:i.default.string},l.defaultProps={invalidMessage:null},t.default=l}])});
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var u in r)a.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}var a={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TIME_TO_CLOSE_MESSAGE=3e3,t.DELAY_FOR_DBCLICK=200,t.CLICK_TO_CELL_EDIT="click",t.DBCLICK_TO_CELL_EDIT="dbclick",t.EDITTYPE={TEXT:"text",SELECT:"select",TEXTAREA:"textarea",CHECKBOX:"checkbox",DATE:"date"}},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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.Consumer=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(1),p=r(d),y=n(3),h=f.default.createContext();t.default=function(e,t,n,r){var c=function(c){function d(e){a(this,d);var t=u(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,e));return t.doUpdate=t.doUpdate.bind(t),t.startEditing=t.startEditing.bind(t),t.escapeEditing=t.escapeEditing.bind(t),t.completeEditing=t.completeEditing.bind(t),t.handleCellUpdate=t.handleCellUpdate.bind(t),t.state={ridx:null,cidx:null,message:null},t}return i(d,c),s(d,[{key:"componentWillReceiveProps",value:function(e){e.cellEdit&&n()&&(e.cellEdit.options.errorMessage?this.setState(function(){return{message:e.cellEdit.options.errorMessage}}):this.escapeEditing())}},{key:"handleCellUpdate",value:function(t,n,r){var o=this,a=this.props.cellEdit,u=a.options.beforeSaveCell,i=e.get(t,n.dataField),l=function(){arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?o.escapeEditing():o.doUpdate(t,n,r)};if(e.isFunction(u)){var s=u(i,r,t,n,l);if(e.isObject(s)&&s.async)return}this.doUpdate(t,n,r)}},{key:"doUpdate",value:function(o,a,u){var i=this.props,l=i.keyField,s=i.cellEdit,c=i.data,f=s.options.afterSaveCell,d=e.get(o,l),p=e.get(o,a.dataField);n()?r(d,a.dataField,u):(t.editCell(c,l,d,a.dataField,u),e.isFunction(f)&&f(p,u,o,a),this.completeEditing())}},{key:"completeEditing",value:function(){this.setState(function(){return{ridx:null,cidx:null,message:null}})}},{key:"startEditing",value:function(e,t){var n=this,r=this.props.selectRow;r&&!r.clickToEdit&&r.clickToSelect||function(){n.setState(function(){return{ridx:e,cidx:t}})}()}},{key:"escapeEditing",value:function(){this.setState(function(){return{ridx:null,cidx:null}})}},{key:"render",value:function(){var t=this.props.cellEdit,n=t.options,r=n.nonEditableRows,a=(n.errorMessage,o(n,["nonEditableRows","errorMessage"])),u=o(t,["options"]),i=l({},a,u,this.state,{nonEditableRows:e.isDefined(r)?r():[],onStart:this.startEditing,onEscape:this.escapeEditing,onUpdate:this.handleCellUpdate});return f.default.createElement(h.Provider,{value:l({},i)},this.props.children)}}]),d}(f.default.Component);return c.propTypes={data:p.default.array.isRequired,selectRow:p.default.object,options:p.default.shape({mode:p.default.oneOf([y.CLICK_TO_CELL_EDIT,y.DBCLICK_TO_CELL_EDIT]).isRequired,onErrorMessageDisappear:p.default.func,blurToSave:p.default.bool,beforeSaveCell:p.default.func,afterSaveCell:p.default.func,onStartEdit:p.default.func,nonEditableRows:p.default.func,timeToCloseMessage:p.default.number,errorMessage:p.default.any})},{Provider:c}};t.Consumer=h.Consumer},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Type=void 0;var o=n(4),a=r(o),u=n(10),i=r(u),l=n(11),s=r(l),c=n(3);t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{createContext:a.default,createEditingCell:s.default,withRowLevelCellEdit:i.default,DBCLICK_TO_CELL_EDIT:c.DBCLICK_TO_CELL_EDIT,DELAY_FOR_DBCLICK:c.DELAY_FOR_DBCLICK,options:e}};t.Type=c.EDITTYPE},function(e,t,n){"use strict";var r=n(7),o=n(8),a=n(9);e.exports=function(){function e(e,t,n,r,u,i){i!==a&&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")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,a,u,i,l){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,u,i,l],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=n(3),i=n(4);t.default=function(e,t){function n(e){return a.default.createElement(i.Consumer,null,function(t){return o(e,t)})}var o=function(n,o){var i=n.value,l=!(o.nonEditableRows.length>0&&o.nonEditableRows.indexOf(i)>-1),s={};return t&&o.mode===u.DBCLICK_TO_CELL_EDIT&&(s.DELAY_FOR_DBCLICK=u.DELAY_FOR_DBCLICK),a.default.createElement(e,r({},n,s,{editingRowIdx:o.ridx,editingColIdx:o.cidx,editable:l,onStart:o.onStart,clickToEdit:o.mode===u.CLICK_TO_CELL_EDIT,dbclickToEdit:o.mode===u.DBCLICK_TO_CELL_EDIT}))};return n.displayName="WithCellEditingRowConsumer",n}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(0),u=r(a),i=n(4),l=n(12),s=r(l);t.default=function(e,t){var n=(0,s.default)(e,t),r=function(t,r){var a=e.get(t.row,t.column.dataField),i=t.column.editCellStyle||{},l=t.column.editCellClasses;return e.isFunction(t.column.editCellStyle)&&(i=t.column.editCellStyle(a,t.row,t.rowIndex,t.columnIndex)),e.isFunction(t.column.editCellClasses)&&(l=t.column.editCellClasses(a,t.row,t.rowIndex,t.columnIndex)),u.default.createElement(n,o({},t,{className:l,style:i},r))};return function(e){return u.default.createElement(i.Consumer,null,function(t){return r(e,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 a(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 u(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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(2),d=r(f),p=n(1),y=r(p),h=n(13),v=r(h),b=n(14),m=r(b),O=n(15),_=r(O),g=n(16),E=r(g),T=n(17),C=r(T),w=n(18),j=r(w),x=n(3);t.default=function(e,t){var n,r;return r=n=function(n){function r(e){o(this,r);var t=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.indicatorTimer=null,t.clearTimer=t.clearTimer.bind(t),t.handleBlur=t.handleBlur.bind(t),t.handleClick=t.handleClick.bind(t),t.handleKeyDown=t.handleKeyDown.bind(t),t.beforeComplete=t.beforeComplete.bind(t),t.asyncbeforeCompete=t.asyncbeforeCompete.bind(t),t.displayErrorMessage=t.displayErrorMessage.bind(t),t.state={invalidMessage:null},t}return u(r,n),l(r,[{key:"componentWillReceiveProps",value:function(t){var n=t.message;e.isDefined(n)&&(this.createTimer(),this.setState(function(){return{invalidMessage:n}}))}},{key:"componentWillUnmount",value:function(){this.clearTimer()}},{key:"clearTimer",value:function(){this.indicatorTimer&&clearTimeout(this.indicatorTimer)}},{key:"createTimer",value:function(){var t=this;this.clearTimer();var n=this.props,r=n.timeToCloseMessage,o=n.onErrorMessageDisappear;this.indicatorTimer=e.sleep(function(){t.setState(function(){return{invalidMessage:null}}),e.isFunction(o)&&o()},r)}},{key:"displayErrorMessage",value:function(e){this.setState(function(){return{invalidMessage:e}}),this.createTimer()}},{key:"asyncbeforeCompete",value:function(e){var t=this;return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{valid:!0},r=n.valid,o=n.message,a=t.props,u=a.onUpdate,i=a.row,l=a.column;if(!r)return void t.displayErrorMessage(o);u(i,l,e)}}},{key:"beforeComplete",value:function(t){var n=this.props,r=n.onUpdate,o=n.row,a=n.column;if(e.isFunction(a.validator)){var u=a.validator(t,o,a,this.asyncbeforeCompete(t));if(e.isObject(u)){if(u.async)return;if(!u.valid)return void this.displayErrorMessage(u.message)}}r(o,a,t)}},{key:"handleBlur",value:function(){var e=this.props,t=e.onEscape;e.blurToSave?this.beforeComplete(this.editor.getValue()):t()}},{key:"handleKeyDown",value:function(e){var t=this.props.onEscape;27===e.keyCode?t():13===e.keyCode&&this.beforeComplete(this.editor.getValue())}},{key:"handleClick",value:function(e){"TD"!==e.target.tagName&&e.stopPropagation()}},{key:"render",value:function(){var n=this,r=void 0,o=this.props,a=o.row,u=o.column,l=o.className,s=o.style,f=o.rowIndex,p=o.columnIndex,y=o.autoSelectText,h=u.dataField,b=e.get(a,h),O=e.isDefined(this.state.invalidMessage),g=u.editorClasses||"";e.isFunction(u.editorClasses)&&(g=u.editorClasses(b,a,f,p));var T=u.editorStyle||{};e.isFunction(u.editorStyle)&&(T=u.editorStyle(b,a,f,p));var w=(0,d.default)({animated:O,shake:O},g),M={ref:function(e){return n.editor=e},defaultValue:b,style:T,className:w,onKeyDown:this.handleKeyDown,onBlur:this.handleBlur};t&&(M.didMount=function(){return t(a,u,f,p)});var P=e.isObject(u.editor);return P?M=i({},M,u.editor):e.isFunction(u.editorRenderer)&&(M=i({},M,{onUpdate:this.beforeComplete})),r=e.isFunction(u.editorRenderer)?u.editorRenderer(M,b,a,u,f,p):P&&u.editor.type===x.EDITTYPE.SELECT?c.default.createElement(v.default,M):P&&u.editor.type===x.EDITTYPE.TEXTAREA?c.default.createElement(m.default,i({},M,{autoSelectText:y})):P&&u.editor.type===x.EDITTYPE.CHECKBOX?c.default.createElement(_.default,M):P&&u.editor.type===x.EDITTYPE.DATE?c.default.createElement(E.default,M):c.default.createElement(C.default,i({},M,{autoSelectText:y})),c.default.createElement("td",{className:(0,d.default)("react-bootstrap-table-editing-cell",l),style:s,onClick:this.handleClick},r,O?c.default.createElement(j.default,{invalidMessage:this.state.invalidMessage}):null)}}]),r}(s.Component),n.propTypes={row:y.default.object.isRequired,rowIndex:y.default.number.isRequired,column:y.default.object.isRequired,columnIndex:y.default.number.isRequired,onUpdate:y.default.func.isRequired,onEscape:y.default.func.isRequired,timeToCloseMessage:y.default.number,autoSelectText:y.default.bool,className:y.default.string,style:y.default.object},n.defaultProps={timeToCloseMessage:x.TIME_TO_CLOSE_MESSAGE,className:null,autoSelectText:!1,style:{}},r}},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount;this.select.value=t,this.select.focus(),n&&n()}},{key:"getValue",value:function(){return this.select.value}},{key:"render",value:function(){var e=this,t=this.props,n=t.defaultValue,r=(t.didMount,t.className),a=t.options,u=o(t,["defaultValue","didMount","className","options"]),i=(0,p.default)("form-control editor edit-select",r),s=l({},u,{className:i});return f.default.createElement("select",l({},s,{ref:function(t){return e.select=t},defaultValue:n}),a.map(function(e){var t=e.label,n=e.value;return f.default.createElement("option",{key:n,value:n},t)}))}}]),t}(c.Component);v.propTypes={defaultValue:h.default.oneOfType([h.default.string,h.default.number]),className:h.default.string,style:h.default.object,options:h.default.oneOfType([h.default.arrayOf(h.default.shape({label:h.default.string,value:h.default.any}))]).isRequired,didMount:h.default.func},v.defaultProps={className:"",defaultValue:"",style:{},didMount:void 0},t.default=v},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(e){a(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleKeyDown=n.handleKeyDown.bind(n),n}return i(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount,r=e.autoSelectText;this.text.value=t,this.text.focus(),r&&this.text.select(),n&&n()}},{key:"getValue",value:function(){return this.text.value}},{key:"handleKeyDown",value:function(e){(13!==e.keyCode||e.shiftKey)&&this.props.onKeyDown&&this.props.onKeyDown(e)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=(t.autoSelectText,o(t,["defaultValue","didMount","className","autoSelectText"])),a=(0,p.default)("form-control editor edit-textarea",n);return f.default.createElement("textarea",l({ref:function(t){return e.text=t},type:"textarea",className:a},r,{onKeyDown:this.handleKeyDown}))}}]),t}(c.Component);v.propTypes={className:h.default.oneOfType([h.default.string,h.default.object]),defaultValue:h.default.oneOfType([h.default.string,h.default.number]),onKeyDown:h.default.func,autoSelectText:h.default.bool,didMount:h.default.func},v.defaultProps={className:"",defaultValue:"",autoSelectText:!1,onKeyDown:void 0,didMount:void 0},t.default=v},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(r=(u=i.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=n(0),d=r(f),p=n(2),y=r(p),h=n(1),v=r(h),b=function(e){function t(e){a(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={checked:e.defaultValue.toString()===e.value.split(":")[0]},n.handleChange=n.handleChange.bind(n),n}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this.props.didMount;this.checkbox.focus(),e&&e()}},{key:"getValue",value:function(){var e=this.props.value.split(":"),t=s(e,2),n=t[0],r=t[1];return this.checkbox.checked?n:r}},{key:"handleChange",value:function(e){this.props.onChange&&this.props.onChange(e);var t=e.target;this.setState(function(){return{checked:t.checked}})}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=o(t,["defaultValue","didMount","className"]),a=(0,y.default)("editor edit-chseckbox checkbox",n);return d.default.createElement("input",l({ref:function(t){return e.checkbox=t},type:"checkbox",className:a},r,{checked:this.state.checked,onChange:this.handleChange}))}}]),t}(f.Component);b.propTypes={className:v.default.oneOfType([v.default.string,v.default.object]),value:v.default.string,defaultValue:v.default.any,onChange:v.default.func,didMount:v.default.func},b.defaultProps={className:"",value:"on:off",defaultValue:!1,onChange:void 0,didMount:void 0},t.default=b},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount;this.date.valueAsDate=new Date(t),this.date.focus(),n&&n()}},{key:"getValue",value:function(){return this.date.value}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=o(t,["defaultValue","didMount","className"]),a=(0,p.default)("form-control editor edit-date",n);return f.default.createElement("input",l({ref:function(t){return e.date=t},type:"date",className:a},r))}}]),t}(c.Component);v.propTypes={className:h.default.oneOfType([h.default.string,h.default.object]),defaultValue:h.default.string,didMount:h.default.func},v.defaultProps={className:"",defaultValue:"",didMount:void 0},t.default=v},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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 i(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 l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(2),p=r(d),y=n(1),h=r(y),v=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.defaultValue,n=e.didMount,r=e.autoSelectText;this.text.value=t,this.text.focus(),r&&this.text.select(),n&&n()}},{key:"getValue",value:function(){return this.text.value}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultValue,t.didMount,t.className),r=(t.autoSelectText,o(t,["defaultValue","didMount","className","autoSelectText"])),a=(0,p.default)("form-control editor edit-text",n);return f.default.createElement("input",l({ref:function(t){return e.text=t},type:"text",className:a},r))}}]),t}(c.Component);v.propTypes={className:h.default.oneOfType([h.default.string,h.default.object]),defaultValue:h.default.oneOfType([h.default.string,h.default.number]),autoSelectText:h.default.bool,didMount:h.default.func},v.defaultProps={className:null,defaultValue:"",autoSelectText:!1,didMount:void 0},t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=r(o),u=n(1),i=r(u),l=function(e){var t=e.invalidMessage;return a.default.createElement("div",{className:"alert alert-danger fade in"},a.default.createElement("strong",null,t))};l.propTypes={invalidMessage:i.default.string},l.defaultProps={invalidMessage:null},t.default=l}])});

@@ -45,2 +45,3 @@ 'use strict';

_this.doUpdate = _this.doUpdate.bind(_this);
_this.startEditing = _this.startEditing.bind(_this);

@@ -76,2 +77,28 @@ _this.escapeEditing = _this.escapeEditing.bind(_this);

value: function handleCellUpdate(row, column, newValue) {
var _this2 = this;
var cellEdit = this.props.cellEdit;
var beforeSaveCell = cellEdit.options.beforeSaveCell;
var oldValue = _.get(row, column.dataField);
var beforeSaveCellDone = function beforeSaveCellDone() {
var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
if (result) {
_this2.doUpdate(row, column, newValue);
} else {
_this2.escapeEditing();
}
};
if (_.isFunction(beforeSaveCell)) {
var result = beforeSaveCell(oldValue, newValue, row, column, beforeSaveCellDone);
if (_.isObject(result) && result.async) {
return;
}
}
this.doUpdate(row, column, newValue);
}
}, {
key: 'doUpdate',
value: function doUpdate(row, column, newValue) {
var _props = this.props,

@@ -81,9 +108,6 @@ keyField = _props.keyField,

data = _props.data;
var _cellEdit$options = cellEdit.options,
beforeSaveCell = _cellEdit$options.beforeSaveCell,
afterSaveCell = _cellEdit$options.afterSaveCell;
var afterSaveCell = cellEdit.options.afterSaveCell;
var rowId = _.get(row, keyField);
var oldValue = _.get(row, column.dataField);
var rowId = _.get(row, keyField);
if (_.isFunction(beforeSaveCell)) beforeSaveCell(oldValue, newValue, row, column);
if (isRemoteCellEdit()) {

@@ -111,6 +135,6 @@ handleCellChange(rowId, column.dataField, newValue);

value: function startEditing(ridx, cidx) {
var _this2 = this;
var _this3 = this;
var editing = function editing() {
_this2.setState(function () {
_this3.setState(function () {
return {

@@ -117,0 +141,0 @@ ridx: ridx,

@@ -78,2 +78,4 @@ 'use strict';

_this.beforeComplete = _this.beforeComplete.bind(_this);
_this.asyncbeforeCompete = _this.asyncbeforeCompete.bind(_this);
_this.displayErrorMessage = _this.displayErrorMessage.bind(_this);
_this.state = {

@@ -131,19 +133,49 @@ invalidMessage: null

}, {
key: 'displayErrorMessage',
value: function displayErrorMessage(message) {
this.setState(function () {
return {
invalidMessage: message
};
});
this.createTimer();
}
}, {
key: 'asyncbeforeCompete',
value: function asyncbeforeCompete(newValue) {
var _this3 = this;
return function () {
var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { valid: true };
var valid = result.valid,
message = result.message;
var _props2 = _this3.props,
onUpdate = _props2.onUpdate,
row = _props2.row,
column = _props2.column;
if (!valid) {
_this3.displayErrorMessage(message);
return;
}
onUpdate(row, column, newValue);
};
}
}, {
key: 'beforeComplete',
value: function beforeComplete(newValue) {
var _props2 = this.props,
onUpdate = _props2.onUpdate,
row = _props2.row,
column = _props2.column;
var _props3 = this.props,
onUpdate = _props3.onUpdate,
row = _props3.row,
column = _props3.column;
if (_.isFunction(column.validator)) {
var validateForm = column.validator(newValue, row, column);
if (_.isObject(validateForm) && !validateForm.valid) {
this.setState(function () {
return {
invalidMessage: validateForm.message
};
});
this.createTimer();
return;
var validateForm = column.validator(newValue, row, column, this.asyncbeforeCompete(newValue));
if (_.isObject(validateForm)) {
if (validateForm.async) {
return;
} else if (!validateForm.valid) {
this.displayErrorMessage(validateForm.message);
return;
}
}

@@ -156,5 +188,5 @@ }

value: function handleBlur() {
var _props3 = this.props,
onEscape = _props3.onEscape,
blurToSave = _props3.blurToSave;
var _props4 = this.props,
onEscape = _props4.onEscape,
blurToSave = _props4.blurToSave;

@@ -193,13 +225,13 @@ if (blurToSave) {

value: function render() {
var _this3 = this;
var _this4 = this;
var editor = void 0;
var _props4 = this.props,
row = _props4.row,
column = _props4.column,
className = _props4.className,
style = _props4.style,
rowIndex = _props4.rowIndex,
columnIndex = _props4.columnIndex,
autoSelectText = _props4.autoSelectText;
var _props5 = this.props,
row = _props5.row,
column = _props5.column,
className = _props5.className,
style = _props5.style,
rowIndex = _props5.rowIndex,
columnIndex = _props5.columnIndex,
autoSelectText = _props5.autoSelectText;
var dataField = column.dataField;

@@ -228,3 +260,3 @@

ref: function ref(node) {
return _this3.editor = node;
return _this4.editor = node;
},

@@ -231,0 +263,0 @@ defaultValue: value,

{
"name": "react-bootstrap-table2-editor",
"version": "1.2.0",
"version": "1.2.1",
"description": "it's the editor addon for react-bootstrap-table2",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc