gridjs-react
Version:
React component for Grid.js
3 lines (2 loc) • 1.86 kB
JavaScript
import*as t from"react";import{createRef as r,Component as n}from"react";import{Grid as e,h as o,createRef as i,Component as p}from"gridjs";import c from"react-dom";var a=function(t,r){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},a(t,r)};function s(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}a(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var u,f=function(n){function o(t){var o=n.call(this,t)||this;return o.wrapper=r(),o.instance=null,o.instance=new e(t||{}),o}return s(o,n),o.prototype.getInstance=function(){return this.instance},o.prototype.componentDidMount=function(){this.wrapper.current.childNodes.length>0&&(this.wrapper.current.innerHTML=""),this.instance.render(this.wrapper.current)},o.prototype.componentDidUpdate=function(){this.instance.updateConfig(this.props).forceRender()},o.prototype.render=function(){return t.createElement("div",{ref:this.wrapper})},o}(n),l=c;if("production"===process.env.NODE_ENV)u=l.createRoot,l.hydrateRoot;else{var h=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;u=function(t,r){h.usingClientEntryPoint=!0;try{return l.createRoot(t,r)}finally{h.usingClientEntryPoint=!1}}}var d=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.ref=i(),r}return s(r,t),r.prototype.componentDidMount=function(){u(this.ref.current).render(this.props.element)},r.prototype.render=function(){return o(this.props.parent,{ref:this.ref})},r.defaultProps={parent:"div"},r}(p);function y(t,r){return o(d,{element:t,parent:r})}export{f as Grid,d as ReactWrapper,y as _};
//# sourceMappingURL=gridjs.production.es.min.js.map