@handsontable/react
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -80,3 +80,3 @@ 'use strict'; | ||
if (settings.hasOwnProperty(key)) { | ||
newSettings[this.trimHookPrefix(key)] = settings[key]; | ||
newSettings[key] = settings[key]; | ||
} | ||
@@ -87,3 +87,3 @@ } | ||
if (_key !== 'settings' && properties.hasOwnProperty(_key)) { | ||
newSettings[this.trimHookPrefix(_key)] = properties[_key]; | ||
newSettings[_key] = properties[_key]; | ||
} | ||
@@ -93,21 +93,2 @@ } | ||
} | ||
/** | ||
* Trim the "on" hook prefix. | ||
* | ||
* @param {String} prop Settings property. | ||
* @returns {String} Handsontable-compatible, prefix-less property name. | ||
*/ | ||
}, { | ||
key: 'trimHookPrefix', | ||
value: function trimHookPrefix(prop) { | ||
if (prop.indexOf('on') === 0) { | ||
var hookName = prop.charAt(2).toLowerCase() + prop.slice(3, prop.length); | ||
if (this.registeredHooks.indexOf(hookName) > -1) { | ||
return hookName; | ||
} | ||
} | ||
// returns the string anyway, when we're sure all the hooks are registered, might be changed | ||
return prop; | ||
} | ||
}]); | ||
@@ -117,2 +98,4 @@ return SettingsMapper; | ||
var version="2.0.0"; | ||
/** | ||
@@ -174,11 +157,11 @@ * A Handsontable-ReactJS wrapper. | ||
} | ||
/** | ||
* Set the reference to the main Handsontable DOM element. | ||
* | ||
* @param {HTMLElement} element The main Handsontable DOM element. | ||
*/ | ||
createClass(HotTable, [{ | ||
key: 'setHotElementRef', | ||
/** | ||
* Set the reference to the main Handsontable DOM element. | ||
* | ||
* @param {HTMLElement} element The main Handsontable DOM element. | ||
*/ | ||
value: function setHotElementRef(element) { | ||
@@ -243,2 +226,7 @@ this.hotElementRef = element; | ||
} | ||
}], [{ | ||
key: 'version', | ||
get: function get$$1() { | ||
return version; | ||
} | ||
}]); | ||
@@ -245,0 +233,0 @@ return HotTable; |
@@ -25,3 +25,3 @@ /*! | ||
* | ||
* Version: 1.1.0 (built at Fri Aug 17 2018 10:16:29 GMT+0200 (CEST)) | ||
* Version: 2.0.0 (built at Wed Oct 10 2018 11:42:27 GMT+0200 (CEST)) | ||
*/ | ||
@@ -107,3 +107,3 @@ (function (global, factory) { | ||
if (settings.hasOwnProperty(key)) { | ||
newSettings[this.trimHookPrefix(key)] = settings[key]; | ||
newSettings[key] = settings[key]; | ||
} | ||
@@ -114,3 +114,3 @@ } | ||
if (_key !== 'settings' && properties.hasOwnProperty(_key)) { | ||
newSettings[this.trimHookPrefix(_key)] = properties[_key]; | ||
newSettings[_key] = properties[_key]; | ||
} | ||
@@ -120,21 +120,2 @@ } | ||
} | ||
/** | ||
* Trim the "on" hook prefix. | ||
* | ||
* @param {String} prop Settings property. | ||
* @returns {String} Handsontable-compatible, prefix-less property name. | ||
*/ | ||
}, { | ||
key: 'trimHookPrefix', | ||
value: function trimHookPrefix(prop) { | ||
if (prop.indexOf('on') === 0) { | ||
var hookName = prop.charAt(2).toLowerCase() + prop.slice(3, prop.length); | ||
if (this.registeredHooks.indexOf(hookName) > -1) { | ||
return hookName; | ||
} | ||
} | ||
// returns the string anyway, when we're sure all the hooks are registered, might be changed | ||
return prop; | ||
} | ||
}]); | ||
@@ -144,2 +125,4 @@ return SettingsMapper; | ||
var version="2.0.0"; | ||
/** | ||
@@ -201,11 +184,11 @@ * A Handsontable-ReactJS wrapper. | ||
} | ||
/** | ||
* Set the reference to the main Handsontable DOM element. | ||
* | ||
* @param {HTMLElement} element The main Handsontable DOM element. | ||
*/ | ||
createClass(HotTable, [{ | ||
key: 'setHotElementRef', | ||
/** | ||
* Set the reference to the main Handsontable DOM element. | ||
* | ||
* @param {HTMLElement} element The main Handsontable DOM element. | ||
*/ | ||
value: function setHotElementRef(element) { | ||
@@ -270,2 +253,7 @@ this.hotElementRef = element; | ||
} | ||
}], [{ | ||
key: 'version', | ||
get: function get$$1() { | ||
return version; | ||
} | ||
}]); | ||
@@ -272,0 +260,0 @@ return HotTable; |
@@ -25,5 +25,5 @@ /*! | ||
* | ||
* Version: 1.1.0 (built at Fri Aug 17 2018 10:16:31 GMT+0200 (CEST)) | ||
* Version: 2.0.0 (built at Wed Oct 10 2018 11:42:30 GMT+0200 (CEST)) | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("handsontable"),require("react")):"function"==typeof define&&define.amd?define(["exports","handsontable","react"],t):t((e.Handsontable=e.Handsontable||{},e.Handsontable.react={}),e.Handsontable,e.React)}(this,function(e,n,o){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n,o=o&&o.hasOwnProperty("default")?o.default:o;var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}(),s=function(){function e(){r(this,e),this.registeredHooks=n.hooks.getRegistered()}return i(e,[{key:"getSettings",value:function(e){var t={};if(e.settings){var n=e.settings;for(var o in n)n.hasOwnProperty(o)&&(t[this.trimHookPrefix(o)]=n[o])}for(var r in e)"settings"!==r&&e.hasOwnProperty(r)&&(t[this.trimHookPrefix(r)]=e[r]);return t}},{key:"trimHookPrefix",value:function(e){if(0==e.indexOf("on")){var t=e.charAt(2).toLowerCase()+e.slice(3,e.length);if(-1<this.registeredHooks.indexOf(t))return t}return e}}]),e}(),t=function(e){function t(){r(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.settingsMapper=new s,e.id=null,e.hotInstance=null,e.hotElementRef=null,e}return function(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)}(t,o.Component),i(t,[{key:"setHotElementRef",value:function(e){this.hotElementRef=e}},{key:"componentDidMount",value:function(){var e=this.settingsMapper.getSettings(this.props);this.hotInstance=new n(this.hotElementRef,e)}},{key:"shouldComponentUpdate",value:function(e,t){return this.updateHot(this.settingsMapper.getSettings(e)),!1}},{key:"componentWillUnmount",value:function(){this.hotInstance.destroy()}},{key:"render",value:function(){return this.id=this.props.id||"hot-"+Math.random().toString(36).substring(5),this.className=this.props.className||"",this.style=this.props.style||{},o.createElement("div",{ref:this.setHotElementRef.bind(this),id:this.id,className:this.className,style:this.style})}},{key:"updateHot",value:function(e){this.hotInstance.updateSettings(e,!1)}}]),t}();e.HotTable=t,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("handsontable"),require("react")):"function"==typeof define&&define.amd?define(["exports","handsontable","react"],t):t((e.Handsontable=e.Handsontable||{},e.Handsontable.react={}),e.Handsontable,e.React)}(this,function(e,n,o){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n,o=o&&o.hasOwnProperty("default")?o.default:o;var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}(),i=function(){function e(){r(this,e),this.registeredHooks=n.hooks.getRegistered()}return s(e,[{key:"getSettings",value:function(e){var t={};if(e.settings){var n=e.settings;for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}for(var r in e)"settings"!==r&&e.hasOwnProperty(r)&&(t[r]=e[r]);return t}}]),e}(),t=function(e){function t(){r(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.settingsMapper=new i,e.id=null,e.hotInstance=null,e.hotElementRef=null,e}return function(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)}(t,o.Component),s(t,[{key:"setHotElementRef",value:function(e){this.hotElementRef=e}},{key:"componentDidMount",value:function(){var e=this.settingsMapper.getSettings(this.props);this.hotInstance=new n(this.hotElementRef,e)}},{key:"shouldComponentUpdate",value:function(e,t){return this.updateHot(this.settingsMapper.getSettings(e)),!1}},{key:"componentWillUnmount",value:function(){this.hotInstance.destroy()}},{key:"render",value:function(){return this.id=this.props.id||"hot-"+Math.random().toString(36).substring(5),this.className=this.props.className||"",this.style=this.props.style||{},o.createElement("div",{ref:this.setHotElementRef.bind(this),id:this.id,className:this.className,style:this.style})}},{key:"updateHot",value:function(e){this.hotInstance.updateSettings(e,!1)}}],[{key:"version",get:function(){return"2.0.0"}}]),t}();e.HotTable=t,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=react-handsontable.min.js.map |
@@ -74,3 +74,3 @@ import Handsontable from 'handsontable'; | ||
if (settings.hasOwnProperty(key)) { | ||
newSettings[this.trimHookPrefix(key)] = settings[key]; | ||
newSettings[key] = settings[key]; | ||
} | ||
@@ -81,3 +81,3 @@ } | ||
if (_key !== 'settings' && properties.hasOwnProperty(_key)) { | ||
newSettings[this.trimHookPrefix(_key)] = properties[_key]; | ||
newSettings[_key] = properties[_key]; | ||
} | ||
@@ -87,21 +87,2 @@ } | ||
} | ||
/** | ||
* Trim the "on" hook prefix. | ||
* | ||
* @param {String} prop Settings property. | ||
* @returns {String} Handsontable-compatible, prefix-less property name. | ||
*/ | ||
}, { | ||
key: 'trimHookPrefix', | ||
value: function trimHookPrefix(prop) { | ||
if (prop.indexOf('on') === 0) { | ||
var hookName = prop.charAt(2).toLowerCase() + prop.slice(3, prop.length); | ||
if (this.registeredHooks.indexOf(hookName) > -1) { | ||
return hookName; | ||
} | ||
} | ||
// returns the string anyway, when we're sure all the hooks are registered, might be changed | ||
return prop; | ||
} | ||
}]); | ||
@@ -111,2 +92,4 @@ return SettingsMapper; | ||
var version="2.0.0"; | ||
/** | ||
@@ -168,11 +151,11 @@ * A Handsontable-ReactJS wrapper. | ||
} | ||
/** | ||
* Set the reference to the main Handsontable DOM element. | ||
* | ||
* @param {HTMLElement} element The main Handsontable DOM element. | ||
*/ | ||
createClass(HotTable, [{ | ||
key: 'setHotElementRef', | ||
/** | ||
* Set the reference to the main Handsontable DOM element. | ||
* | ||
* @param {HTMLElement} element The main Handsontable DOM element. | ||
*/ | ||
value: function setHotElementRef(element) { | ||
@@ -237,2 +220,7 @@ this.hotElementRef = element; | ||
} | ||
}], [{ | ||
key: 'version', | ||
get: function get$$1() { | ||
return version; | ||
} | ||
}]); | ||
@@ -239,0 +227,0 @@ return HotTable; |
@@ -78,2 +78,3 @@ // Dependencies for this module: | ||
style: React.CSSProperties; | ||
static readonly version: string; | ||
/** | ||
@@ -80,0 +81,0 @@ * Initialize Handsontable after the component has mounted. |
{ | ||
"name": "@handsontable/react", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Best Data Grid for React with Spreadsheet Look and Feel.", | ||
@@ -5,0 +5,0 @@ "author": "Handsoncode <hello@handsoncode.net> (https://handsoncode.net)", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47537
772