@handsontable/react-wrapper 0.0.0-next-08b4877-20241030 → 0.0.0-next-407bbbc-20241107

Sign up to get free protection for your applications and to get access to all the features.
@@ -763,7 +763,7 @@ var HotColumn = function HotColumn(props) {
763
763
  }, editorPortal);
764
764
  };
765
765
 
766
- var version="0.0.0-next-08b4877-20241030";
766
+ var version="0.0.0-next-407bbbc-20241107";
767
767
 
768
768
  /**
769
769
  * Component used to manage the renderer component portals.
@@ -25,7 +25,7 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-08b4877-20241030 (built at Wed Oct 30 2024 11:23:55 GMT+0000 (Coordinated Universal Time))
28
+ * Version: 0.0.0-next-407bbbc-20241107 (built at Thu Nov 07 2024 10:02:07 GMT+0000 (Coordinated Universal Time))
29
29
  */
30
30
  (function (global, factory) {
31
31
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('handsontable/base'), require('handsontable/renderers/registry'), require('handsontable/editors/registry')) :
@@ -779,7 +779,7 @@ var HotColumn = function HotColumn(props) {
779
779
  }, editorPortal);
780
780
  };
781
781
 
782
- var version="0.0.0-next-08b4877-20241030";
782
+ var version="0.0.0-next-407bbbc-20241107";
783
783
 
784
784
  /**
785
785
  * Component used to manage the renderer component portals.
@@ -25,7 +25,7 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-08b4877-20241030 (built at Wed Oct 30 2024 11:23:59 GMT+0000 (Coordinated Universal Time))
28
+ * Version: 0.0.0-next-407bbbc-20241107 (built at Thu Nov 07 2024 10:02:11 GMT+0000 (Coordinated Universal Time))
29
29
  */
30
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("handsontable/base"),require("handsontable/renderers/registry"),require("handsontable/editors/registry")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","handsontable/base","handsontable/renderers/registry","handsontable/editors/registry"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Handsontable=e.Handsontable||{},e.Handsontable.react={}),e.React,e.ReactDOM,e.Handsontable,e.Handsontable.renderers,e.Handsontable.editors)}(this,(function(e,t,n,r,o,u){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(t),l=a(n),c=a(r),s=null;function d(){var e;void 0!==console&&(e=console).warn.apply(e,arguments)}function f(e){return p(e,"hot-renderer")?(d("Providing a component-based renderer using `hot-renderer`-annotated component is no longer supported. Pass your component using `renderer` prop of the `HotTable` or `HotColumn` component instead."),!0):!!p(e,"hot-editor")&&(d("Providing a component-based editor using `hot-editor`-annotated component is no longer supported. Pass your component using `editor` prop of the `HotTable` or `HotColumn` component instead."),!0)}function p(e,t){return i.default.Children.toArray(e).some((function(e){return void 0!==e.props[t]}))}function m(e,t){if(!e||!t)return null;var n=i.default.createElement(t,null),r=v({},!1);return r.className="".concat("hot-wrapper-editor-container"," ").concat(r.className),l.default.createPortal(i.default.createElement("div",Object.assign({},r),n),e.body)}function v(e){return{id:e.id||(1>=arguments.length||void 0===arguments[1]||arguments[1]?"hot-"+Math.random().toString(36).substring(5):void 0),className:e.className||"",style:e.style||{}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function h(e,t,n){return t=w(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,R()?Reflect.construct(t,n||[],w(e).constructor):t.apply(e,n))}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,I(r.key),r)}}function O(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function C(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(R=function(){return!!e})()}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,u,a,i=[],l=!0,c=!1;try{if(u=(n=n.call(e)).next,0===t);else for(;!(l=(r=u.call(n)).done)&&(i.push(r.value),i.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}}(e,t)||H(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||H(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function H(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}var T=function(){return O((function e(){b(this,e)}),null,[{key:"getSettings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.prevProps,r=void 0===n?{}:n,o=t.isInit,u=void 0!==o&&o,a=t.initOnlySettingKeys,i=void 0===a?[]:a,l=function(t){return!(u||!i.includes(t))&&r[t]===e[t]},c={};for(var s in e)"children"!==s&&!l(s)&&e.hasOwnProperty(s)&&(c[s]=e[s]);return c}}])}(),x=t.createContext(void 0),_=function(e){var n=e.children,r=t.useRef([]),o=t.useCallback((function(e,t){r.current[t]=e}),[]),u=t.useRef(new Map),a=t.useRef(new Map),c=t.useCallback((function(){return a.current.clear()}),[]),d=t.useRef(new Map),f=t.useCallback((function(){return d.current.clear()}),[]),p=t.useRef(new Map),m=t.useCallback((function(e){return function(t,n,r,o,u,c,f){var m="".concat(r,"-").concat(o),v=t.guid,y="".concat(v,"-").concat(m),h="".concat(m,"-").concat(v);if(a.current.has(m)&&(n.innerHTML=a.current.get(m).innerHTML),n&&!n.getAttribute("ghost-table")){for(var b=d.current.get(h),g=p.current.get(y);n.firstChild;)n.removeChild(n.firstChild);if(b&&g)n.appendChild(g);else{var O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;t||(t=document),s||(s=t.createDocumentFragment());var o=null!=r?r:t.createElement("DIV");return s.appendChild(o),{portal:l.default.createPortal(e,o,n),portalContainer:o}}(i.default.createElement(e,{instance:t,TD:n,row:r,col:o,prop:u,value:c,cellProperties:f}),n.ownerDocument,h,g),C=O.portal,w=O.portalContainer;p.current.set(y,w),n.appendChild(w),d.current.set(h,C)}}return a.current.set("".concat(r,"-").concat(o),n),n}}),[]),v=t.useRef((function(){})),y=t.useCallback((function(e){v.current=e}),[]),h=t.useCallback((function(){v.current(k(d.current.values()))}),[]),b=t.useMemo((function(){return{componentRendererColumns:u.current,columnsSettings:r.current,emitColumnSettings:o,getRendererWrapper:m,clearPortalCache:f,clearRenderedCellCache:c,setRenderersPortalManagerRef:y,pushCellPortalsIntoPortalManager:h}}),[o,m,c,y,h]);return i.default.createElement(x.Provider,{value:b},n)};function D(){return t.useContext(x)}var M=t.createContext(void 0),A=function(e){var n=e.columnIndex,r=e.getOwnerDocument,o=e.children,u=t.useMemo((function(){return{columnIndex:n,getOwnerDocument:r}}),[n,r]);return i.default.createElement(M.Provider,{value:u},o)},V=["close","focus","open"],N=["getValue","setValue"],z={open:"onOpen",close:"onClose",prepare:"onPrepare",focus:"onFocus"};function q(e,t){return function(n){function r(n){var o;return b(this,r),o=h(this,r,[n]),t.current=o,Object.getOwnPropertyNames(c.default.editors.BaseEditor.prototype).forEach((function(t){if("constructor"!==t&&!N.includes(t)){var n=c.default.editors.BaseEditor.prototype[t];r.prototype[t]=function(){for(var r,o,u,a=arguments.length,i=Array(a),l=0;a>l;l++)i[l]=arguments[l];(V.includes(t)||(o=n.call.apply(n,[this].concat(i))),z[t]&&null!==(r=e.current)&&void 0!==r&&r[z[t]])&&(o=(u=e.current[z[t]]).call.apply(u,[this].concat(i)));return o}.bind(o)}})),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}(r,n),O(r,[{key:"focus",value:function(){}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(e){this.value=e}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(c.default.editors.BaseEditor)}var B=t.createContext(void 0),W=function(e){return i.default.createElement(B.Provider,{value:{hooksRef:e.hooksRef,hotCustomEditorInstanceRef:e.hotCustomEditorInstanceRef}},e.children)};var F=function(e){return e.type===L},U=["_columnIndex","_getOwnerDocument","children"],L=function(e){var n=D(),r=n.componentRendererColumns,o=n.emitColumnSettings,u=n.getRendererWrapper,a=t.useContext(M),l=a.columnIndex,c=a.getOwnerDocument,s=t.useRef(null),p=t.useRef(null);t.useEffect((function(){var t=function(){var t=T.getSettings(Object.keys(e).filter((function(e){return!U.includes(e)})).reduce((function(t,n){return t[n]=e[n],t}),{}));return e.renderer?(t.renderer=u(e.renderer),r.set(l,!0)):e.hotRenderer&&(t.renderer=e.hotRenderer),e.editor?t.editor=q(s,p):e.hotEditor&&(t.editor=e.hotEditor),t}();o(t,l),f(e.children)||i.default.Children.toArray(e.children).length&&d("Unexpected children nodes found in HotColumn component. HotColumn components do not support any children.")}));var v=m(c(),e.editor);return i.default.createElement(W,{hooksRef:s,hotCustomEditorInstanceRef:p},v)},K=t.forwardRef((function(e,n){var r=S(t.useState([]),2),o=r[0],u=r[1];return t.useImperativeHandle(n,(function(){return u})),i.default.createElement(t.Fragment,null,o)}));function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $,G,J,Q,X={exports:{}};X.exports=function(){if(Q)return J;Q=1;var e=G?$:(G=1,$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,J=function(){function r(t,n,r,o,u,a){if(a!==e){var i=Error("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");throw i.name="Invariant Violation",i}}function o(){return r}r.isRequired=r;var u={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return u.PropTypes=u,u}}()();var Z=Y(X.exports),ee=t.forwardRef((function(e,n){var r,a,l,s=t.useRef(null),p=t.useRef(null),y=t.useRef(null),h=t.useRef(null),b=t.useRef(),g=D(),O=t.useCallback((function(){return s.current&&s.current.isDestroyed?(console.warn("The Handsontable instance bound to this component was destroyed and cannot be used properly."),null):s.current}),[s]),C=t.useCallback((function(){return!s.current||s.current.isDestroyed}),[s]),w=t.useCallback((function(){g.clearRenderedCellCache(),g.componentRendererColumns.clear()}),[g]),R=t.useCallback((function(){return"undefined"!=typeof window?p.current?p.current.ownerDocument:document:null}),[p]),P=function(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=C()?[]:(null===(t=O())||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t._initOnlySettings)||[],i=T.getSettings(e,{prevProps:r,isInit:n,initOnlySettingKeys:a});return i.columns=g.columnsSettings.length?g.columnsSettings:i.columns,e.renderer?(i.renderer=g.getRendererWrapper(e.renderer),g.componentRendererColumns.set("global",!0)):i.renderer=e.hotRenderer||o.getRenderer("text"),i.editor=e.editor?q(y,h):e.hotEditor||u.getEditor("text"),i},E=function(e){var t,n;e&&(null!==(t=e.getPlugin("autoRowSize"))&&void 0!==t&&t.enabled||null!==(n=e.getPlugin("autoColumnSize"))&&void 0!==n&&n.enabled)&&g.componentRendererColumns.size>0&&d("Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.")};t.useEffect((function(){var t,n=P(!0);return b.current=e,s.current=new c.default.Core(p.current,n),s.current.addHook("beforeViewRender",(function(){g.clearPortalCache(),g.clearRenderedCellCache()})),s.current.addHook("afterViewRender",(function(){g.pushCellPortalsIntoPortalManager()})),s.current.init(),E(s.current),f(e.children)||(t=L,i.default.Children.toArray(e.children).some((function(e){return e.type!==t}))&&d("Unexpected children nodes found in HotTable component. Only HotColumn components are allowed.")),function(){var e;w(),null===(e=O())||void 0===e||e.destroy()}}),[]),r=function(){w();var t=O(),n=P(!1,b.current);b.current=e,null==t||t.updateSettings(n,!1),E(t),f(e.children)},l=i.default.useRef(!1),t.useEffect((function(){if(l.current)return r();l.current=!0}),a),t.useImperativeHandle(n,(function(){return{get hotElementRef(){return p.current},get hotInstance(){return O()}}}));var j=t.Children.toArray(e.children).filter(F).map((function(e,t){return i.default.createElement(A,{columnIndex:t,getOwnerDocument:R,key:t},e)})),S=v(e),k=m(R(),e.editor);return i.default.createElement(t.Fragment,null,i.default.createElement("div",Object.assign({ref:p},S),j),i.default.createElement(K,{ref:g.setRenderersPortalManagerRef}),i.default.createElement(W,{hooksRef:y,hotCustomEditorInstanceRef:h},k))}));ee.propTypes={style:Z.object,id:Z.string,className:Z.string};var te=["children"],ne=t.forwardRef((function(e,n){var r,o=e.children,u=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;u.length>r;r++)t.includes(n=u[r])||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,te),a=null!==(r=u.id)&&void 0!==r?r:t.useId();return i.default.createElement(_,null,i.default.createElement(ee,Object.assign({id:a},u,{ref:n}),o))}));ne.version="0.0.0-next-08b4877-20241030",e.HotColumn=L,e.HotTable=ne,e.default=ne,e.isHotColumn=F,e.useHotEditor=function(e,n){var r=t.useContext(B),o=r.hooksRef,u=r.hotCustomEditorInstanceRef,a=S(t.useState(0),2),i=a[0],l=a[1],c=S(t.useState(),2),s=c[1],d=t.useDeferredValue(c[0]);return t.useImperativeHandle(o,(function(){return E(E({},e),{},{onOpen:function(){var t,n;s(null===(t=u.current)||void 0===t?void 0:t.getValue()),null==e||null===(n=e.onOpen)||void 0===n||n.call(e),l((function(e){return e+1}))}})}),n),t.useMemo((function(){return{get value(){return d},setValue:function(e){var t;s(e),null===(t=u.current)||void 0===t||t.setValue(e)},get isOpen(){var e,t;return null!==(e=null===(t=u.current)||void 0===t?void 0:t.isOpened())&&void 0!==e&&e},finishEditing:function(){var e;null===(e=u.current)||void 0===e||e.finishEditing()},get row(){var e;return null===(e=u.current)||void 0===e?void 0:e.row},get col(){var e;return null===(e=u.current)||void 0===e?void 0:e.col}}}),[i,u,d])},Object.defineProperty(e,"__esModule",{value:!0})}));
30
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("handsontable/base"),require("handsontable/renderers/registry"),require("handsontable/editors/registry")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","handsontable/base","handsontable/renderers/registry","handsontable/editors/registry"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Handsontable=e.Handsontable||{},e.Handsontable.react={}),e.React,e.ReactDOM,e.Handsontable,e.Handsontable.renderers,e.Handsontable.editors)}(this,(function(e,t,n,r,o,u){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(t),l=a(n),c=a(r),s=null;function d(){var e;void 0!==console&&(e=console).warn.apply(e,arguments)}function f(e){return p(e,"hot-renderer")?(d("Providing a component-based renderer using `hot-renderer`-annotated component is no longer supported. Pass your component using `renderer` prop of the `HotTable` or `HotColumn` component instead."),!0):!!p(e,"hot-editor")&&(d("Providing a component-based editor using `hot-editor`-annotated component is no longer supported. Pass your component using `editor` prop of the `HotTable` or `HotColumn` component instead."),!0)}function p(e,t){return i.default.Children.toArray(e).some((function(e){return void 0!==e.props[t]}))}function m(e,t){if(!e||!t)return null;var n=i.default.createElement(t,null),r=v({},!1);return r.className="".concat("hot-wrapper-editor-container"," ").concat(r.className),l.default.createPortal(i.default.createElement("div",Object.assign({},r),n),e.body)}function v(e){return{id:e.id||(1>=arguments.length||void 0===arguments[1]||arguments[1]?"hot-"+Math.random().toString(36).substring(5):void 0),className:e.className||"",style:e.style||{}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function h(e,t,n){return t=w(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,R()?Reflect.construct(t,n||[],w(e).constructor):t.apply(e,n))}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,I(r.key),r)}}function O(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function C(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(R=function(){return!!e})()}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,u,a,i=[],l=!0,c=!1;try{if(u=(n=n.call(e)).next,0===t);else for(;!(l=(r=u.call(n)).done)&&(i.push(r.value),i.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}}(e,t)||H(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||H(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function H(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}var T=function(){return O((function e(){b(this,e)}),null,[{key:"getSettings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.prevProps,r=void 0===n?{}:n,o=t.isInit,u=void 0!==o&&o,a=t.initOnlySettingKeys,i=void 0===a?[]:a,l=function(t){return!(u||!i.includes(t))&&r[t]===e[t]},c={};for(var s in e)"children"!==s&&!l(s)&&e.hasOwnProperty(s)&&(c[s]=e[s]);return c}}])}(),x=t.createContext(void 0),_=function(e){var n=e.children,r=t.useRef([]),o=t.useCallback((function(e,t){r.current[t]=e}),[]),u=t.useRef(new Map),a=t.useRef(new Map),c=t.useCallback((function(){return a.current.clear()}),[]),d=t.useRef(new Map),f=t.useCallback((function(){return d.current.clear()}),[]),p=t.useRef(new Map),m=t.useCallback((function(e){return function(t,n,r,o,u,c,f){var m="".concat(r,"-").concat(o),v=t.guid,y="".concat(v,"-").concat(m),h="".concat(m,"-").concat(v);if(a.current.has(m)&&(n.innerHTML=a.current.get(m).innerHTML),n&&!n.getAttribute("ghost-table")){for(var b=d.current.get(h),g=p.current.get(y);n.firstChild;)n.removeChild(n.firstChild);if(b&&g)n.appendChild(g);else{var O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;t||(t=document),s||(s=t.createDocumentFragment());var o=null!=r?r:t.createElement("DIV");return s.appendChild(o),{portal:l.default.createPortal(e,o,n),portalContainer:o}}(i.default.createElement(e,{instance:t,TD:n,row:r,col:o,prop:u,value:c,cellProperties:f}),n.ownerDocument,h,g),C=O.portal,w=O.portalContainer;p.current.set(y,w),n.appendChild(w),d.current.set(h,C)}}return a.current.set("".concat(r,"-").concat(o),n),n}}),[]),v=t.useRef((function(){})),y=t.useCallback((function(e){v.current=e}),[]),h=t.useCallback((function(){v.current(k(d.current.values()))}),[]),b=t.useMemo((function(){return{componentRendererColumns:u.current,columnsSettings:r.current,emitColumnSettings:o,getRendererWrapper:m,clearPortalCache:f,clearRenderedCellCache:c,setRenderersPortalManagerRef:y,pushCellPortalsIntoPortalManager:h}}),[o,m,c,y,h]);return i.default.createElement(x.Provider,{value:b},n)};function D(){return t.useContext(x)}var M=t.createContext(void 0),A=function(e){var n=e.columnIndex,r=e.getOwnerDocument,o=e.children,u=t.useMemo((function(){return{columnIndex:n,getOwnerDocument:r}}),[n,r]);return i.default.createElement(M.Provider,{value:u},o)},V=["close","focus","open"],N=["getValue","setValue"],z={open:"onOpen",close:"onClose",prepare:"onPrepare",focus:"onFocus"};function q(e,t){return function(n){function r(n){var o;return b(this,r),o=h(this,r,[n]),t.current=o,Object.getOwnPropertyNames(c.default.editors.BaseEditor.prototype).forEach((function(t){if("constructor"!==t&&!N.includes(t)){var n=c.default.editors.BaseEditor.prototype[t];r.prototype[t]=function(){for(var r,o,u,a=arguments.length,i=Array(a),l=0;a>l;l++)i[l]=arguments[l];(V.includes(t)||(o=n.call.apply(n,[this].concat(i))),z[t]&&null!==(r=e.current)&&void 0!==r&&r[z[t]])&&(o=(u=e.current[z[t]]).call.apply(u,[this].concat(i)));return o}.bind(o)}})),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}(r,n),O(r,[{key:"focus",value:function(){}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(e){this.value=e}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(c.default.editors.BaseEditor)}var B=t.createContext(void 0),W=function(e){return i.default.createElement(B.Provider,{value:{hooksRef:e.hooksRef,hotCustomEditorInstanceRef:e.hotCustomEditorInstanceRef}},e.children)};var F=function(e){return e.type===L},U=["_columnIndex","_getOwnerDocument","children"],L=function(e){var n=D(),r=n.componentRendererColumns,o=n.emitColumnSettings,u=n.getRendererWrapper,a=t.useContext(M),l=a.columnIndex,c=a.getOwnerDocument,s=t.useRef(null),p=t.useRef(null);t.useEffect((function(){var t=function(){var t=T.getSettings(Object.keys(e).filter((function(e){return!U.includes(e)})).reduce((function(t,n){return t[n]=e[n],t}),{}));return e.renderer?(t.renderer=u(e.renderer),r.set(l,!0)):e.hotRenderer&&(t.renderer=e.hotRenderer),e.editor?t.editor=q(s,p):e.hotEditor&&(t.editor=e.hotEditor),t}();o(t,l),f(e.children)||i.default.Children.toArray(e.children).length&&d("Unexpected children nodes found in HotColumn component. HotColumn components do not support any children.")}));var v=m(c(),e.editor);return i.default.createElement(W,{hooksRef:s,hotCustomEditorInstanceRef:p},v)},K=t.forwardRef((function(e,n){var r=S(t.useState([]),2),o=r[0],u=r[1];return t.useImperativeHandle(n,(function(){return u})),i.default.createElement(t.Fragment,null,o)}));function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $,G,J,Q,X={exports:{}};X.exports=function(){if(Q)return J;Q=1;var e=G?$:(G=1,$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,J=function(){function r(t,n,r,o,u,a){if(a!==e){var i=Error("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");throw i.name="Invariant Violation",i}}function o(){return r}r.isRequired=r;var u={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return u.PropTypes=u,u}}()();var Z=Y(X.exports),ee=t.forwardRef((function(e,n){var r,a,l,s=t.useRef(null),p=t.useRef(null),y=t.useRef(null),h=t.useRef(null),b=t.useRef(),g=D(),O=t.useCallback((function(){return s.current&&s.current.isDestroyed?(console.warn("The Handsontable instance bound to this component was destroyed and cannot be used properly."),null):s.current}),[s]),C=t.useCallback((function(){return!s.current||s.current.isDestroyed}),[s]),w=t.useCallback((function(){g.clearRenderedCellCache(),g.componentRendererColumns.clear()}),[g]),R=t.useCallback((function(){return"undefined"!=typeof window?p.current?p.current.ownerDocument:document:null}),[p]),P=function(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=C()?[]:(null===(t=O())||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t._initOnlySettings)||[],i=T.getSettings(e,{prevProps:r,isInit:n,initOnlySettingKeys:a});return i.columns=g.columnsSettings.length?g.columnsSettings:i.columns,e.renderer?(i.renderer=g.getRendererWrapper(e.renderer),g.componentRendererColumns.set("global",!0)):i.renderer=e.hotRenderer||o.getRenderer("text"),i.editor=e.editor?q(y,h):e.hotEditor||u.getEditor("text"),i},E=function(e){var t,n;e&&(null!==(t=e.getPlugin("autoRowSize"))&&void 0!==t&&t.enabled||null!==(n=e.getPlugin("autoColumnSize"))&&void 0!==n&&n.enabled)&&g.componentRendererColumns.size>0&&d("Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.")};t.useEffect((function(){var t,n=P(!0);return b.current=e,s.current=new c.default.Core(p.current,n),s.current.addHook("beforeViewRender",(function(){g.clearPortalCache(),g.clearRenderedCellCache()})),s.current.addHook("afterViewRender",(function(){g.pushCellPortalsIntoPortalManager()})),s.current.init(),E(s.current),f(e.children)||(t=L,i.default.Children.toArray(e.children).some((function(e){return e.type!==t}))&&d("Unexpected children nodes found in HotTable component. Only HotColumn components are allowed.")),function(){var e;w(),null===(e=O())||void 0===e||e.destroy()}}),[]),r=function(){w();var t=O(),n=P(!1,b.current);b.current=e,null==t||t.updateSettings(n,!1),E(t),f(e.children)},l=i.default.useRef(!1),t.useEffect((function(){if(l.current)return r();l.current=!0}),a),t.useImperativeHandle(n,(function(){return{get hotElementRef(){return p.current},get hotInstance(){return O()}}}));var j=t.Children.toArray(e.children).filter(F).map((function(e,t){return i.default.createElement(A,{columnIndex:t,getOwnerDocument:R,key:t},e)})),S=v(e),k=m(R(),e.editor);return i.default.createElement(t.Fragment,null,i.default.createElement("div",Object.assign({ref:p},S),j),i.default.createElement(K,{ref:g.setRenderersPortalManagerRef}),i.default.createElement(W,{hooksRef:y,hotCustomEditorInstanceRef:h},k))}));ee.propTypes={style:Z.object,id:Z.string,className:Z.string};var te=["children"],ne=t.forwardRef((function(e,n){var r,o=e.children,u=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;u.length>r;r++)t.includes(n=u[r])||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,te),a=null!==(r=u.id)&&void 0!==r?r:t.useId();return i.default.createElement(_,null,i.default.createElement(ee,Object.assign({id:a},u,{ref:n}),o))}));ne.version="0.0.0-next-407bbbc-20241107",e.HotColumn=L,e.HotTable=ne,e.default=ne,e.isHotColumn=F,e.useHotEditor=function(e,n){var r=t.useContext(B),o=r.hooksRef,u=r.hotCustomEditorInstanceRef,a=S(t.useState(0),2),i=a[0],l=a[1],c=S(t.useState(),2),s=c[1],d=t.useDeferredValue(c[0]);return t.useImperativeHandle(o,(function(){return E(E({},e),{},{onOpen:function(){var t,n;s(null===(t=u.current)||void 0===t?void 0:t.getValue()),null==e||null===(n=e.onOpen)||void 0===n||n.call(e),l((function(e){return e+1}))}})}),n),t.useMemo((function(){return{get value(){return d},setValue:function(e){var t;s(e),null===(t=u.current)||void 0===t||t.setValue(e)},get isOpen(){var e,t;return null!==(e=null===(t=u.current)||void 0===t?void 0:t.isOpened())&&void 0!==e&&e},finishEditing:function(){var e;null===(e=u.current)||void 0===e||e.finishEditing()},get row(){var e;return null===(e=u.current)||void 0===e?void 0:e.row},get col(){var e;return null===(e=u.current)||void 0===e?void 0:e.col}}}),[i,u,d])},Object.defineProperty(e,"__esModule",{value:!0})}));
31
31
  //# sourceMappingURL=react-handsontable.min.js.map
@@ -753,7 +753,7 @@ var HotColumn = function HotColumn(props) {
753
753
  }, editorPortal);
754
754
  };
755
755
 
756
- var version="0.0.0-next-08b4877-20241030";
756
+ var version="0.0.0-next-407bbbc-20241107";
757
757
 
758
758
  /**
759
759
  * Component used to manage the renderer component portals.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsontable/react-wrapper",
3
- "version": "0.0.0-next-08b4877-20241030",
3
+ "version": "0.0.0-next-407bbbc-20241107",
4
4
  "description": "Best Data Grid for React with Spreadsheet Look and Feel.",
5
5
  "author": "Handsoncode <hello@handsoncode.net> (https://handsoncode.net)",
6
6
  "homepage": "https://handsontable.com",
@@ -71,7 +71,7 @@
71
71
  "@types/react-dom": "^18.2.0",
72
72
  "@types/react-redux": "^7.1.7",
73
73
  "cross-env": "^7.0.3",
74
- "handsontable": "0.0.0-next-08b4877-20241030",
74
+ "handsontable": "0.0.0-next-407bbbc-20241107",
75
75
  "jest": "^29.7.0",
76
76
  "prop-types": "^15.7.2",
77
77
  "react": "^18.2.0",
@@ -86,7 +86,7 @@
86
86
  "uglify-js": "^3.4.9"
87
87
  },
88
88
  "peerDependencies": {
89
- "handsontable": "0.0.0-next-08b4877-20241030"
89
+ "handsontable": "0.0.0-next-407bbbc-20241107"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:min && npm run prepare:types",