ag-grid-react
Advanced tools
Comparing version 24.0.0 to 24.1.0
@@ -1,1 +0,1 @@ | ||
define(["exports","prop-types","react","react-dom","agGrid","react-dom/server"],function(t,e,a,i,s,p){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o,c=(n(u,o=a.Component),u.prototype.render=function(){return null},u.mapChildColumnDefs=function(t){return a.Children.map(t.children,function(t){return u.toColDef(t.props)})},u.toColDef=function(t){var e=u.createColDefFromGridColumn(t);return u.hasChildColumns(t)&&(e.children=u.getChildColDefs(t.children)),e},u.hasChildColumns=function(t){return 0<a.Children.count(t.children)},u.getChildColDefs=function(t){return a.Children.map(t,function(t){return u.createColDefFromGridColumn(t.props)})},u.createColDefFromGridColumn=function(t){var e={};return u.assign(e,t),delete e.children,e},u.assign=function(t,e){return[e].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},t)},u);function u(t,e){var n=o.call(this,t,e)||this;return n.props=t,n.state=e,n}function l(t,e){t.forEach(function(t){c[t]=e})}l(s.ColDefUtil.BOOLEAN_PROPERTIES,e.bool),l(s.ColDefUtil.STRING_PROPERTIES,e.string),l(s.ColDefUtil.OBJECT_PROPERTIES,e.object),l(s.ColDefUtil.ARRAY_PROPERTIES,e.array),l(s.ColDefUtil.NUMBER_PROPERTIES,e.number),l(s.ColDefUtil.FUNCTION_PROPERTIES,e.func);var h=(f.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},f.prototype.callMethod=function(t,e){var n=this,r=this.getFrameworkComponentInstance();if(null!=r){var o=this.getFrameworkComponentInstance()[t];if(null==o)return;return o.apply(r,e)}window.setTimeout(function(){return n.callMethod(t,e)},100)},f.prototype.addMethod=function(t,e){this[t]=e},f);function f(){}var m=0;var d,C,y,g=(n(E,d=h),E.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},E.prototype.isStatelessComponent=function(){return this.statelessComponent},E.prototype.getReactComponentName=function(){return this.reactComponent.name},E.prototype.init=function(e){var n=this;return this.eParentElement=this.createParentElement(e),this.renderStaticMarkup(e),new s.Promise(function(t){return n.createReactComponent(e,t)})},E.prototype.getGui=function(){return this.eParentElement},E.prototype.destroy=function(){return this.parentComponent.destroyPortal(this.portal)},E.prototype.createReactComponent=function(t,e){var n=this;this.statelessComponent||(t.ref=function(t){n.componentInstance=t,n.addParentContainerStyleAndClasses(),n.removeStaticMarkup()});var r=a.createElement(this.reactComponent,t),o=i.createPortal(r,this.eParentElement,"agPortalKey_"+ ++m);this.portal=o,this.parentComponent.mountReactPortal(o,this,function(t){e(t),n.statelessComponent&&(2<=n.staticRenderTime?n.eParentElement.addEventListener("DOMNodeInserted",function(){n.removeStaticMarkup()},!1):setTimeout(function(){n.removeStaticMarkup()}))})},E.prototype.addParentContainerStyleAndClasses=function(){var e,n,r=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(e=this.eParentElement.style,n=this.componentInstance.getReactContainerStyle(),Object.keys(n).forEach(function(t){e[t]=n[t]})),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return s._.addCssClass(r.eParentElement,t)}))},E.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return s._.addCssClass(e,"ag-react-container"),t.reactContainer=e},E.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount||0<this.eParentElement.childNodes.length},E.hasSymbol=function(){return"function"==typeof Symbol&&Symbol.for},E.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)||"object"==typeof t&&t.$$typeof===E.REACT_MEMO_TYPE},E.prototype.isNullRender=function(){return""===this.staticMarkup},E.prototype.renderStaticMarkup=function(t){if(!(this.parentComponent.isDisableStaticMarkup()||this.componentType.isCellRenderer&&!this.componentType.isCellRenderer())){var e=console.error,n=a.createElement(this.reactComponent,t);try{var r=console.error;console.error=function(){};var o=Date.now(),i=p.renderToStaticMarkup(n);this.staticRenderTime=Date.now()-o,console.error=r,""===i?this.staticMarkup=i:i&&(this.staticMarkup=document.createElement("span"),this.staticMarkup.innerHTML=i,this.eParentElement.appendChild(this.staticMarkup))}catch(t){}finally{console.error=e}}},E.prototype.removeStaticMarkup=function(){!this.parentComponent.isDisableStaticMarkup()&&this.componentType.isCellRenderer()&&this.staticMarkup&&(this.staticMarkup.remove?(this.staticMarkup.remove(),this.staticMarkup=null):this.eParentElement.removeChild&&(this.eParentElement.removeChild(this.staticMarkup),this.staticMarkup=null))},E.prototype.rendered=function(){return this.isNullRender()||this.staticMarkup||this.isStatelessComponent()&&this.statelessComponentRendered()||!this.isStatelessComponent()&&this.getFrameworkComponentInstance()},E.REACT_MEMO_TYPE=E.hasSymbol()?Symbol.for("react.memo"):60115,E);function E(t,e,n){var r=d.call(this)||this;return r.portal=null,r.componentWrappingElement="div",r.staticMarkup=null,r.staticRenderTime=0,r.reactComponent=t,r.componentType=n,r.parentComponent=e,r.statelessComponent=E.isStateless(r.reactComponent),r}(y=C=C||{}).IdentityCheck="IdentityCheck",y.DeepValueCheck="DeepValueCheck",y.NoCheck="NoCheck";var v=(P.prototype.getStrategy=function(t){return this.strategyMap[t]},P);function P(){var t;this.strategyMap=((t={})[C.DeepValueCheck]=new k,t[C.IdentityCheck]=new R(function(t,e){return t===e}),t[C.NoCheck]=new R(function(t,e){return!1}),t)}var R=(O.prototype.areEqual=function(t,e){return this.strategy(t,e)},O);function O(t){this.strategy=t}var k=(D.prototype.areEqual=function(t,e){return D.areEquivalent(D.copy(t),D.copy(e))},D.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},D.copy=function(t){if(!t)return t;if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(this.copy(t[n]));return e}return"object"!=typeof t?t:[{},t].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},{})},D.isNaN=function(t){return Number.isNaN?Number.isNaN(t):"number"==typeof t&&isNaN(t)},D.areEquivalent=function(e,n){if(e=D.unwrapStringOrNumber(e),n=D.unwrapStringOrNumber(n),e===n)return!0;if(null===e||null===n||typeof e!=typeof n)return!1;if(D.isNaN(e)&&D.isNaN(n))return!0;if(e instanceof Date)return n instanceof Date&&e.valueOf()===n.valueOf();if("function"==typeof e)return e.toString()===n.toString();if("object"!=typeof e)return e==n;var t=void 0===e.areEquivPropertyTracking,r=void 0===n.areEquivPropertyTracking;try{var o=void 0;if(t)e.areEquivPropertyTracking=[];else if(e.areEquivPropertyTracking.some(function(t){return t===n}))return!0;if(r)n.areEquivPropertyTracking=[];else if(n.areEquivPropertyTracking.some(function(t){return t===e}))return!0;e.areEquivPropertyTracking.push(n),n.areEquivPropertyTracking.push(e);var i={};for(o in e)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in n)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in i)if(!this.areEquivalent(e[o],n[o]))return!1;return!0}finally{t&&delete e.areEquivPropertyTracking,r&&delete n.areEquivPropertyTracking}},D);function D(){}var T,S=(n(M,T=a.Component),M.prototype.render=function(){var e=this;return a.createElement("div",{style:this.createStyleForDiv(),ref:function(t){e.eGridDiv=t}},this.portals)},M.prototype.createStyleForDiv=function(){var e={height:"100%"},n=this.props.containerStyle;return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},M.prototype.componentDidMount=function(){var t=this.props.modules||[],e={providedBeanInstances:{agGridReact:this,frameworkComponentWrapper:new b(this)},modules:t},n=this.props.gridOptions||{};c.hasChildColumns(this.props)&&(n.columnDefs=c.mapChildColumnDefs(this.props)),this.gridOptions=s.ComponentUtil.copyAttributesToGridOptions(n,this.props),new s.Grid(this.eGridDiv,this.gridOptions,e),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},M.prototype.waitForInstance=function(t,e,n){var r=this;if(void 0===n&&(n=0),this.destroyed)e(null);else if(t.rendered())e(null);else{if(M.MAX_COMPONENT_CREATION_TIME<=n)return void console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+M.MAX_COMPONENT_CREATION_TIME+"ms");window.setTimeout(function(){return r.waitForInstance(t,e,n+5)},5)}},M.prototype.mountReactPortal=function(t,e,n){this.portals=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),o=0,e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}(this.portals,[t]),this.batchUpdate(this.waitForInstance(e,n))},M.prototype.batchUpdate=function(t){var e=this;if(this.hasPendingPortalUpdate)return t&&t();setTimeout(function(){e.api&&e.forceUpdate(function(){t&&t(),e.hasPendingPortalUpdate=!1})}),this.hasPendingPortalUpdate=!0},M.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},M.prototype.getStrategyTypeForProp=function(t){return"rowData"!==t?C.DeepValueCheck:this.props.rowDataChangeDetectionStrategy?this.props.rowDataChangeDetectionStrategy:this.props.deltaRowDataMode||this.props.immutableData?C.IdentityCheck:C.DeepValueCheck},M.prototype.shouldComponentUpdate=function(t){return this.processPropsChanges(this.props,t),!1},M.prototype.componentDidUpdate=function(t){this.processPropsChanges(t,this.props)},M.prototype.processPropsChanges=function(t,e){var n={};this.extractGridPropertyChanges(t,e,n),this.extractDeclarativeColDefChanges(e,n),0<Object.keys(n).length&&s.ComponentUtil.processOnChange(n,this.gridOptions,this.api,this.columnApi)},M.prototype.extractDeclarativeColDefChanges=function(t,e){var n,r,o,i;this.props.gridOptions&&this.props.gridOptions.columnDefs||this.props.columnDefs||(n=!!t.debug,c.hasChildColumns(t)?(r=this.changeDetectionService.getStrategy(this.getStrategyTypeForProp("columnDefs")),o=this.gridOptions.columnDefs,i=c.mapChildColumnDefs(t),r.areEqual(o,i)||(n&&console.log("agGridReact: colDefs definitions changed"),e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:c.mapChildColumnDefs(t)})):this.gridOptions.columnDefs&&0<this.gridOptions.columnDefs.length&&(e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:[]}))},M.prototype.extractGridPropertyChanges=function(e,n,r){var o=this,i=!!n.debug;Object.keys(n).forEach(function(t){-1!==s.ComponentUtil.ALL_PROPERTIES.indexOf(t)&&(o.changeDetectionService.getStrategy(o.getStrategyTypeForProp(t)).areEqual(e[t],n[t])||(i&&console.log("agGridReact: ["+t+"] property changed"),r[t]={previousValue:e[t],currentValue:n[t]}))}),s.ComponentUtil.getEventCallbacks().forEach(function(t){o.props[t]!==n[t]&&(i&&console.log("agGridReact: ["+t+"] event callback changed"),r[t]={previousValue:e[t],currentValue:n[t]})})},M.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null),this.destroyed=!0},M.prototype.isDisableStaticMarkup=function(){return!!this.props.disableStaticMarkup},M.MAX_COMPONENT_CREATION_TIME=1e3,M);function M(t,e){var n=T.call(this,t,e)||this;return n.props=t,n.state=e,n.changeDetectionService=new v,n.api=null,n.portals=[],n.hasPendingPortalUpdate=!1,n.destroyed=!1,n}function I(t,e){t.forEach(function(t){S[t]=e})}S.propTypes={gridOptions:e.object},I(s.ComponentUtil.getEventCallbacks(),e.func),I(s.ComponentUtil.BOOLEAN_PROPERTIES,e.bool),I(s.ComponentUtil.STRING_PROPERTIES,e.string),I(s.ComponentUtil.OBJECT_PROPERTIES,e.object),I(s.ComponentUtil.ARRAY_PROPERTIES,e.array),I(s.ComponentUtil.NUMBER_PROPERTIES,e.number),I(s.ComponentUtil.FUNCTION_PROPERTIES,e.func);var N,b=(n(_,N=s.BaseComponentWrapper),_.prototype.createWrapper=function(t,e){return new g(t,this.agGridReact,e)},_);function _(t){var e=N.call(this)||this;return e.agGridReact=t,e}t.AgGridReact=S,t.AgGridColumn=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
define(["exports","prop-types","react","react-dom","agGrid","react-dom/server"],function(e,t,a,r,s,p){"use strict";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var c,u=(n(l,c=a.Component),l.prototype.render=function(){return null},l.mapChildColumnDefs=function(t){return a.Children.map(t,function(t){return l.toColDef(t.props)})},l.toColDef=function(t){var e=t.children,t=function(t,e){var n={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n}(t,["children"]);return l.hasChildColumns(e)&&(t.children=l.mapChildColumnDefs(e)),t},l.hasChildColumns=function(t){return 0<a.Children.count(t)},l);function l(t){var e=c.call(this,t)||this;return e.props=t,e}function h(t,e){t.forEach(function(t){u[t]=e})}h(s.ColDefUtil.BOOLEAN_PROPERTIES,t.bool),h(s.ColDefUtil.STRING_PROPERTIES,t.string),h(s.ColDefUtil.OBJECT_PROPERTIES,t.object),h(s.ColDefUtil.ARRAY_PROPERTIES,t.array),h(s.ColDefUtil.NUMBER_PROPERTIES,t.number),h(s.ColDefUtil.FUNCTION_PROPERTIES,t.func);var f=(m.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},m.prototype.callMethod=function(t,e){var n=this,r=this.getFrameworkComponentInstance();if(null==r)window.setTimeout(function(){return n.callMethod(t,e)},100);else{var o=this.getFrameworkComponentInstance()[t];if(null!=o)return o.apply(r,e)}},m.prototype.addMethod=function(t,e){this[t]=e},m);function m(){}var y=0;var d,C=(n(g,d=f),g.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},g.prototype.isStatelessComponent=function(){return this.statelessComponent},g.prototype.getReactComponentName=function(){return this.reactComponent.name},g.prototype.init=function(e){var n=this;return this.eParentElement=this.createParentElement(e),this.renderStaticMarkup(e),new s.Promise(function(t){return n.createReactComponent(e,t)})},g.prototype.getGui=function(){return this.eParentElement},g.prototype.destroy=function(){return this.parentComponent.destroyPortal(this.portal)},g.prototype.createReactComponent=function(t,e){var n=this;this.statelessComponent||(t.ref=function(t){n.componentInstance=t,n.addParentContainerStyleAndClasses(),n.removeStaticMarkup()});t=a.createElement(this.reactComponent,t),t=r.createPortal(t,this.eParentElement,"agPortalKey_"+ ++y);this.portal=t,this.parentComponent.mountReactPortal(t,this,function(t){e(t),n.statelessComponent&&(2<=n.staticRenderTime?n.eParentElement.addEventListener("DOMNodeInserted",function(){n.removeStaticMarkup()},!1):setTimeout(function(){return n.removeStaticMarkup()}))})},g.prototype.addParentContainerStyleAndClasses=function(){var e,n,r=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(e=this.eParentElement.style,n=this.componentInstance.getReactContainerStyle(),Object.keys(n).forEach(function(t){e[t]=n[t]})),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return s._.addCssClass(r.eParentElement,t)}))},g.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return s._.addCssClass(e,"ag-react-container"),t.reactContainer=e},g.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount||0<this.eParentElement.childNodes.length},g.hasSymbol=function(){return"function"==typeof Symbol&&Symbol.for},g.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)||"object"==typeof t&&t.$$typeof===g.REACT_MEMO_TYPE},g.prototype.isNullRender=function(){return""===this.staticMarkup},g.prototype.renderStaticMarkup=function(t){if(!(this.parentComponent.isDisableStaticMarkup()||this.componentType.isCellRenderer&&!this.componentType.isCellRenderer())){var e=console.error,n=a.createElement(this.reactComponent,t);try{var r=console.error;console.error=function(){};var o=Date.now(),i=p.renderToStaticMarkup(n);this.staticRenderTime=Date.now()-o,console.error=r,""===i?this.staticMarkup=i:i&&(this.staticMarkup=document.createElement("span"),this.staticMarkup.innerHTML=i,this.eParentElement.appendChild(this.staticMarkup))}catch(t){}finally{console.error=e}}},g.prototype.removeStaticMarkup=function(){!this.parentComponent.isDisableStaticMarkup()&&this.componentType.isCellRenderer()&&this.staticMarkup&&(this.staticMarkup.remove?(this.staticMarkup.remove(),this.staticMarkup=null):this.eParentElement.removeChild&&(this.eParentElement.removeChild(this.staticMarkup),this.staticMarkup=null))},g.prototype.rendered=function(){return this.isNullRender()||!!this.staticMarkup||!(!this.isStatelessComponent()||!this.statelessComponentRendered())||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())},g.REACT_MEMO_TYPE=g.hasSymbol()?Symbol.for("react.memo"):60115,g);function g(t,e,n){var r=d.call(this)||this;return r.portal=null,r.staticMarkup=null,r.staticRenderTime=0,r.reactComponent=t,r.componentType=n,r.parentComponent=e,r.statelessComponent=g.isStateless(r.reactComponent),r}(f=e.ChangeDetectionStrategyType||(e.ChangeDetectionStrategyType={})).IdentityCheck="IdentityCheck",f.DeepValueCheck="DeepValueCheck",f.NoCheck="NoCheck";var v=(E.prototype.getStrategy=function(t){return this.strategyMap[t]},E);function E(){var t;this.strategyMap=((t={})[e.ChangeDetectionStrategyType.DeepValueCheck]=new S,t[e.ChangeDetectionStrategyType.IdentityCheck]=new P(function(t,e){return t===e}),t[e.ChangeDetectionStrategyType.NoCheck]=new P(function(t,e){return!1}),t)}var P=(O.prototype.areEqual=function(t,e){return this.strategy(t,e)},O);function O(t){this.strategy=t}var S=(R.prototype.areEqual=function(t,e){return R.areEquivalent(R.copy(t),R.copy(e))},R.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},R.copy=function(t){if(!t)return t;if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(this.copy(t[n]));return e}return"object"!=typeof t?t:[{},t].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},{})},R.isNaN=function(t){return Number.isNaN?Number.isNaN(t):"number"==typeof t&&isNaN(t)},R.areEquivalent=function(e,n){if(e=R.unwrapStringOrNumber(e),n=R.unwrapStringOrNumber(n),e===n)return!0;if(null===e||null===n||typeof e!=typeof n)return!1;if(R.isNaN(e)&&R.isNaN(n))return!0;if(e instanceof Date)return n instanceof Date&&e.valueOf()===n.valueOf();if("function"==typeof e)return e.toString()===n.toString();if("object"!=typeof e||e.$$typeof&&"Symbol(react.element)"===e.$$typeof.toString())return e==n;var t=void 0===e.areEquivPropertyTracking,r=void 0===n.areEquivPropertyTracking;try{var o=void 0;if(t)e.areEquivPropertyTracking=[];else if(e.areEquivPropertyTracking.some(function(t){return t===n}))return!0;if(r)n.areEquivPropertyTracking=[];else if(n.areEquivPropertyTracking.some(function(t){return t===e}))return!0;e.areEquivPropertyTracking.push(n),n.areEquivPropertyTracking.push(e);var i={};for(o in e)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in n)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in i)if(!this.areEquivalent(e[o],n[o]))return!1;return!0}finally{t&&delete e.areEquivPropertyTracking,r&&delete n.areEquivPropertyTracking}},R);function R(){}var T,D=(n(k,T=a.Component),k.prototype.render=function(){var e=this;return a.createElement("div",{style:this.createStyleForDiv(),className:this.props.className,ref:function(t){e.eGridDiv=t}},this.portals)},k.prototype.createStyleForDiv=function(){return i({height:"100%"},this.props.containerStyle||{})},k.prototype.componentDidMount=function(){var t=this.props.modules||[],e={providedBeanInstances:{agGridReact:this,frameworkComponentWrapper:new I(this)},modules:t},n=this.props.gridOptions||{},t=this.props.children;u.hasChildColumns(t)&&(n.columnDefs=u.mapChildColumnDefs(t)),this.gridOptions=s.ComponentUtil.copyAttributesToGridOptions(n,this.props),new s.Grid(this.eGridDiv,this.gridOptions,e),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},k.prototype.waitForInstance=function(t,e,n){var r=this;void 0===n&&(n=Date.now()),this.destroyed?e(null):t.rendered()?e(t):Date.now()-n>=k.MAX_COMPONENT_CREATION_TIME_IN_MS?console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+k.MAX_COMPONENT_CREATION_TIME_IN_MS+"ms"):window.setTimeout(function(){return r.batchUpdate(function(){return r.waitForInstance(t,e,n)})})},k.prototype.mountReactPortal=function(t,e,n){var r=this;this.portals=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),o=0,e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}(this.portals,[t]),this.batchUpdate(function(){return r.waitForInstance(e,n)})},k.prototype.batchUpdate=function(t){var e=this;this.hasPendingPortalUpdate?t&&t():(setTimeout(function(){e.api&&e.forceUpdate(function(){t&&t(),e.hasPendingPortalUpdate=!1})}),this.hasPendingPortalUpdate=!0)},k.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},k.prototype.getStrategyTypeForProp=function(t){if("rowData"===t){if(this.props.rowDataChangeDetectionStrategy)return this.props.rowDataChangeDetectionStrategy;if(this.isImmutableDataActive())return e.ChangeDetectionStrategyType.IdentityCheck}return e.ChangeDetectionStrategyType.DeepValueCheck},k.prototype.isImmutableDataActive=function(){return this.props.deltaRowDataMode||this.props.immutableData||this.props.gridOptions&&(this.props.gridOptions.deltaRowDataMode||this.props.gridOptions.immutableData)},k.prototype.shouldComponentUpdate=function(t){return this.processPropsChanges(this.props,t),!1},k.prototype.componentDidUpdate=function(t){this.processPropsChanges(t,this.props)},k.prototype.processPropsChanges=function(t,e){var n={};this.extractGridPropertyChanges(t,e,n),this.extractDeclarativeColDefChanges(e,n),0<Object.keys(n).length&&s.ComponentUtil.processOnChange(n,this.gridOptions,this.api,this.columnApi)},k.prototype.extractDeclarativeColDefChanges=function(t,e){var n,r,o,i;this.props.gridOptions&&this.props.gridOptions.columnDefs||this.props.columnDefs||(n=!!t.debug,r="columnDefs",o=this.gridOptions.columnDefs,u.hasChildColumns(t.children)?(i=this.changeDetectionService.getStrategy(this.getStrategyTypeForProp(r)),t=u.mapChildColumnDefs(t.children),i.areEqual(o,t)||(n&&console.log("agGridReact: colDefs definitions changed"),e[r]={previousValue:o,currentValue:t})):o&&0<o.length&&(e[r]={previousValue:o,currentValue:[]}))},k.prototype.extractGridPropertyChanges=function(e,n,r){var o=this,i=!!n.debug;Object.keys(n).forEach(function(t){s._.includes(s.ComponentUtil.ALL_PROPERTIES,t)&&(o.changeDetectionService.getStrategy(o.getStrategyTypeForProp(t)).areEqual(e[t],n[t])||(i&&console.log("agGridReact: ["+t+"] property changed"),r[t]={previousValue:e[t],currentValue:n[t]}))}),s.ComponentUtil.getEventCallbacks().forEach(function(t){o.props[t]!==n[t]&&(i&&console.log("agGridReact: ["+t+"] event callback changed"),r[t]={previousValue:e[t],currentValue:n[t]})})},k.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null),this.destroyed=!0},k.prototype.isDisableStaticMarkup=function(){return!!this.props.disableStaticMarkup},k.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3,k);function k(t){var e=T.call(this,t)||this;return e.props=t,e.changeDetectionService=new v,e.api=null,e.portals=[],e.hasPendingPortalUpdate=!1,e.destroyed=!1,e}function b(t,e){t.forEach(function(t){D[t]=e})}D.propTypes={gridOptions:t.object},b(s.ComponentUtil.getEventCallbacks(),t.func),b(s.ComponentUtil.BOOLEAN_PROPERTIES,t.bool),b(s.ComponentUtil.STRING_PROPERTIES,t.string),b(s.ComponentUtil.OBJECT_PROPERTIES,t.object),b(s.ComponentUtil.ARRAY_PROPERTIES,t.array),b(s.ComponentUtil.NUMBER_PROPERTIES,t.number),b(s.ComponentUtil.FUNCTION_PROPERTIES,t.func);var M,I=(n(N,M=s.BaseComponentWrapper),N.prototype.createWrapper=function(t,e){return new C(t,this.agGridReact,e)},N);function N(t){var e=M.call(this)||this;return e.agGridReact=t,e}e.AgGridReact=D,e.AgGridColumn=u,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prop-types"),require("react"),require("react-dom"),require("ag-grid-community"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","react-dom","ag-grid-community","react-dom/server"],e):e(t.AgGridReact={},t.PropTypes,t.React,t.ReactDOM,t.agGrid,t.ReactDOMServer)}(this,function(t,e,a,i,s,p){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o,c=(n(u,o=a.Component),u.prototype.render=function(){return null},u.mapChildColumnDefs=function(t){return a.Children.map(t.children,function(t){return u.toColDef(t.props)})},u.toColDef=function(t){var e=u.createColDefFromGridColumn(t);return u.hasChildColumns(t)&&(e.children=u.getChildColDefs(t.children)),e},u.hasChildColumns=function(t){return 0<a.Children.count(t.children)},u.getChildColDefs=function(t){return a.Children.map(t,function(t){return u.createColDefFromGridColumn(t.props)})},u.createColDefFromGridColumn=function(t){var e={};return u.assign(e,t),delete e.children,e},u.assign=function(t,e){return[e].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},t)},u);function u(t,e){var n=o.call(this,t,e)||this;return n.props=t,n.state=e,n}function l(t,e){t.forEach(function(t){c[t]=e})}l(s.ColDefUtil.BOOLEAN_PROPERTIES,e.bool),l(s.ColDefUtil.STRING_PROPERTIES,e.string),l(s.ColDefUtil.OBJECT_PROPERTIES,e.object),l(s.ColDefUtil.ARRAY_PROPERTIES,e.array),l(s.ColDefUtil.NUMBER_PROPERTIES,e.number),l(s.ColDefUtil.FUNCTION_PROPERTIES,e.func);var h=(f.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},f.prototype.callMethod=function(t,e){var n=this,r=this.getFrameworkComponentInstance();if(null!=r){var o=this.getFrameworkComponentInstance()[t];if(null==o)return;return o.apply(r,e)}window.setTimeout(function(){return n.callMethod(t,e)},100)},f.prototype.addMethod=function(t,e){this[t]=e},f);function f(){}var m=0;var d,C,y,g=(n(v,d=h),v.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},v.prototype.isStatelessComponent=function(){return this.statelessComponent},v.prototype.getReactComponentName=function(){return this.reactComponent.name},v.prototype.init=function(e){var n=this;return this.eParentElement=this.createParentElement(e),this.renderStaticMarkup(e),new s.Promise(function(t){return n.createReactComponent(e,t)})},v.prototype.getGui=function(){return this.eParentElement},v.prototype.destroy=function(){return this.parentComponent.destroyPortal(this.portal)},v.prototype.createReactComponent=function(t,e){var n=this;this.statelessComponent||(t.ref=function(t){n.componentInstance=t,n.addParentContainerStyleAndClasses(),n.removeStaticMarkup()});var r=a.createElement(this.reactComponent,t),o=i.createPortal(r,this.eParentElement,"agPortalKey_"+ ++m);this.portal=o,this.parentComponent.mountReactPortal(o,this,function(t){e(t),n.statelessComponent&&(2<=n.staticRenderTime?n.eParentElement.addEventListener("DOMNodeInserted",function(){n.removeStaticMarkup()},!1):setTimeout(function(){n.removeStaticMarkup()}))})},v.prototype.addParentContainerStyleAndClasses=function(){var e,n,r=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(e=this.eParentElement.style,n=this.componentInstance.getReactContainerStyle(),Object.keys(n).forEach(function(t){e[t]=n[t]})),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return s._.addCssClass(r.eParentElement,t)}))},v.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return s._.addCssClass(e,"ag-react-container"),t.reactContainer=e},v.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount||0<this.eParentElement.childNodes.length},v.hasSymbol=function(){return"function"==typeof Symbol&&Symbol.for},v.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)||"object"==typeof t&&t.$$typeof===v.REACT_MEMO_TYPE},v.prototype.isNullRender=function(){return""===this.staticMarkup},v.prototype.renderStaticMarkup=function(t){if(!(this.parentComponent.isDisableStaticMarkup()||this.componentType.isCellRenderer&&!this.componentType.isCellRenderer())){var e=console.error,n=a.createElement(this.reactComponent,t);try{var r=console.error;console.error=function(){};var o=Date.now(),i=p.renderToStaticMarkup(n);this.staticRenderTime=Date.now()-o,console.error=r,""===i?this.staticMarkup=i:i&&(this.staticMarkup=document.createElement("span"),this.staticMarkup.innerHTML=i,this.eParentElement.appendChild(this.staticMarkup))}catch(t){}finally{console.error=e}}},v.prototype.removeStaticMarkup=function(){!this.parentComponent.isDisableStaticMarkup()&&this.componentType.isCellRenderer()&&this.staticMarkup&&(this.staticMarkup.remove?(this.staticMarkup.remove(),this.staticMarkup=null):this.eParentElement.removeChild&&(this.eParentElement.removeChild(this.staticMarkup),this.staticMarkup=null))},v.prototype.rendered=function(){return this.isNullRender()||this.staticMarkup||this.isStatelessComponent()&&this.statelessComponentRendered()||!this.isStatelessComponent()&&this.getFrameworkComponentInstance()},v.REACT_MEMO_TYPE=v.hasSymbol()?Symbol.for("react.memo"):60115,v);function v(t,e,n){var r=d.call(this)||this;return r.portal=null,r.componentWrappingElement="div",r.staticMarkup=null,r.staticRenderTime=0,r.reactComponent=t,r.componentType=n,r.parentComponent=e,r.statelessComponent=v.isStateless(r.reactComponent),r}(y=C=C||{}).IdentityCheck="IdentityCheck",y.DeepValueCheck="DeepValueCheck",y.NoCheck="NoCheck";var E=(P.prototype.getStrategy=function(t){return this.strategyMap[t]},P);function P(){var t;this.strategyMap=((t={})[C.DeepValueCheck]=new D,t[C.IdentityCheck]=new R(function(t,e){return t===e}),t[C.NoCheck]=new R(function(t,e){return!1}),t)}var R=(O.prototype.areEqual=function(t,e){return this.strategy(t,e)},O);function O(t){this.strategy=t}var D=(k.prototype.areEqual=function(t,e){return k.areEquivalent(k.copy(t),k.copy(e))},k.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},k.copy=function(t){if(!t)return t;if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(this.copy(t[n]));return e}return"object"!=typeof t?t:[{},t].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},{})},k.isNaN=function(t){return Number.isNaN?Number.isNaN(t):"number"==typeof t&&isNaN(t)},k.areEquivalent=function(e,n){if(e=k.unwrapStringOrNumber(e),n=k.unwrapStringOrNumber(n),e===n)return!0;if(null===e||null===n||typeof e!=typeof n)return!1;if(k.isNaN(e)&&k.isNaN(n))return!0;if(e instanceof Date)return n instanceof Date&&e.valueOf()===n.valueOf();if("function"==typeof e)return e.toString()===n.toString();if("object"!=typeof e)return e==n;var t=void 0===e.areEquivPropertyTracking,r=void 0===n.areEquivPropertyTracking;try{var o=void 0;if(t)e.areEquivPropertyTracking=[];else if(e.areEquivPropertyTracking.some(function(t){return t===n}))return!0;if(r)n.areEquivPropertyTracking=[];else if(n.areEquivPropertyTracking.some(function(t){return t===e}))return!0;e.areEquivPropertyTracking.push(n),n.areEquivPropertyTracking.push(e);var i={};for(o in e)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in n)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in i)if(!this.areEquivalent(e[o],n[o]))return!1;return!0}finally{t&&delete e.areEquivPropertyTracking,r&&delete n.areEquivPropertyTracking}},k);function k(){}var T,S=(n(M,T=a.Component),M.prototype.render=function(){var e=this;return a.createElement("div",{style:this.createStyleForDiv(),ref:function(t){e.eGridDiv=t}},this.portals)},M.prototype.createStyleForDiv=function(){var e={height:"100%"},n=this.props.containerStyle;return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},M.prototype.componentDidMount=function(){var t=this.props.modules||[],e={providedBeanInstances:{agGridReact:this,frameworkComponentWrapper:new N(this)},modules:t},n=this.props.gridOptions||{};c.hasChildColumns(this.props)&&(n.columnDefs=c.mapChildColumnDefs(this.props)),this.gridOptions=s.ComponentUtil.copyAttributesToGridOptions(n,this.props),new s.Grid(this.eGridDiv,this.gridOptions,e),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},M.prototype.waitForInstance=function(t,e,n){var r=this;if(void 0===n&&(n=0),this.destroyed)e(null);else if(t.rendered())e(null);else{if(M.MAX_COMPONENT_CREATION_TIME<=n)return void console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+M.MAX_COMPONENT_CREATION_TIME+"ms");window.setTimeout(function(){return r.waitForInstance(t,e,n+5)},5)}},M.prototype.mountReactPortal=function(t,e,n){this.portals=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),o=0,e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}(this.portals,[t]),this.batchUpdate(this.waitForInstance(e,n))},M.prototype.batchUpdate=function(t){var e=this;if(this.hasPendingPortalUpdate)return t&&t();setTimeout(function(){e.api&&e.forceUpdate(function(){t&&t(),e.hasPendingPortalUpdate=!1})}),this.hasPendingPortalUpdate=!0},M.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},M.prototype.getStrategyTypeForProp=function(t){return"rowData"!==t?C.DeepValueCheck:this.props.rowDataChangeDetectionStrategy?this.props.rowDataChangeDetectionStrategy:this.props.deltaRowDataMode||this.props.immutableData?C.IdentityCheck:C.DeepValueCheck},M.prototype.shouldComponentUpdate=function(t){return this.processPropsChanges(this.props,t),!1},M.prototype.componentDidUpdate=function(t){this.processPropsChanges(t,this.props)},M.prototype.processPropsChanges=function(t,e){var n={};this.extractGridPropertyChanges(t,e,n),this.extractDeclarativeColDefChanges(e,n),0<Object.keys(n).length&&s.ComponentUtil.processOnChange(n,this.gridOptions,this.api,this.columnApi)},M.prototype.extractDeclarativeColDefChanges=function(t,e){var n,r,o,i;this.props.gridOptions&&this.props.gridOptions.columnDefs||this.props.columnDefs||(n=!!t.debug,c.hasChildColumns(t)?(r=this.changeDetectionService.getStrategy(this.getStrategyTypeForProp("columnDefs")),o=this.gridOptions.columnDefs,i=c.mapChildColumnDefs(t),r.areEqual(o,i)||(n&&console.log("agGridReact: colDefs definitions changed"),e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:c.mapChildColumnDefs(t)})):this.gridOptions.columnDefs&&0<this.gridOptions.columnDefs.length&&(e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:[]}))},M.prototype.extractGridPropertyChanges=function(e,n,r){var o=this,i=!!n.debug;Object.keys(n).forEach(function(t){-1!==s.ComponentUtil.ALL_PROPERTIES.indexOf(t)&&(o.changeDetectionService.getStrategy(o.getStrategyTypeForProp(t)).areEqual(e[t],n[t])||(i&&console.log("agGridReact: ["+t+"] property changed"),r[t]={previousValue:e[t],currentValue:n[t]}))}),s.ComponentUtil.getEventCallbacks().forEach(function(t){o.props[t]!==n[t]&&(i&&console.log("agGridReact: ["+t+"] event callback changed"),r[t]={previousValue:e[t],currentValue:n[t]})})},M.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null),this.destroyed=!0},M.prototype.isDisableStaticMarkup=function(){return!!this.props.disableStaticMarkup},M.MAX_COMPONENT_CREATION_TIME=1e3,M);function M(t,e){var n=T.call(this,t,e)||this;return n.props=t,n.state=e,n.changeDetectionService=new E,n.api=null,n.portals=[],n.hasPendingPortalUpdate=!1,n.destroyed=!1,n}function b(t,e){t.forEach(function(t){S[t]=e})}S.propTypes={gridOptions:e.object},b(s.ComponentUtil.getEventCallbacks(),e.func),b(s.ComponentUtil.BOOLEAN_PROPERTIES,e.bool),b(s.ComponentUtil.STRING_PROPERTIES,e.string),b(s.ComponentUtil.OBJECT_PROPERTIES,e.object),b(s.ComponentUtil.ARRAY_PROPERTIES,e.array),b(s.ComponentUtil.NUMBER_PROPERTIES,e.number),b(s.ComponentUtil.FUNCTION_PROPERTIES,e.func);var I,N=(n(_,I=s.BaseComponentWrapper),_.prototype.createWrapper=function(t,e){return new g(t,this.agGridReact,e)},_);function _(t){var e=I.call(this)||this;return e.agGridReact=t,e}t.AgGridReact=S,t.AgGridColumn=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prop-types"),require("react"),require("react-dom"),require("ag-grid-community"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","react-dom","ag-grid-community","react-dom/server"],e):e(t.AgGridReact={},t.PropTypes,t.React,t.ReactDOM,t.agGrid,t.ReactDOMServer)}(this,function(e,t,a,r,s,p){"use strict";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var c,u=(n(l,c=a.Component),l.prototype.render=function(){return null},l.mapChildColumnDefs=function(t){return a.Children.map(t,function(t){return l.toColDef(t.props)})},l.toColDef=function(t){var e=t.children,t=function(t,e){var n={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n}(t,["children"]);return l.hasChildColumns(e)&&(t.children=l.mapChildColumnDefs(e)),t},l.hasChildColumns=function(t){return 0<a.Children.count(t)},l);function l(t){var e=c.call(this,t)||this;return e.props=t,e}function h(t,e){t.forEach(function(t){u[t]=e})}h(s.ColDefUtil.BOOLEAN_PROPERTIES,t.bool),h(s.ColDefUtil.STRING_PROPERTIES,t.string),h(s.ColDefUtil.OBJECT_PROPERTIES,t.object),h(s.ColDefUtil.ARRAY_PROPERTIES,t.array),h(s.ColDefUtil.NUMBER_PROPERTIES,t.number),h(s.ColDefUtil.FUNCTION_PROPERTIES,t.func);var f=(m.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},m.prototype.callMethod=function(t,e){var n=this,r=this.getFrameworkComponentInstance();if(null==r)window.setTimeout(function(){return n.callMethod(t,e)},100);else{var o=this.getFrameworkComponentInstance()[t];if(null!=o)return o.apply(r,e)}},m.prototype.addMethod=function(t,e){this[t]=e},m);function m(){}var y=0;var d,C=(n(g,d=f),g.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},g.prototype.isStatelessComponent=function(){return this.statelessComponent},g.prototype.getReactComponentName=function(){return this.reactComponent.name},g.prototype.init=function(e){var n=this;return this.eParentElement=this.createParentElement(e),this.renderStaticMarkup(e),new s.Promise(function(t){return n.createReactComponent(e,t)})},g.prototype.getGui=function(){return this.eParentElement},g.prototype.destroy=function(){return this.parentComponent.destroyPortal(this.portal)},g.prototype.createReactComponent=function(t,e){var n=this;this.statelessComponent||(t.ref=function(t){n.componentInstance=t,n.addParentContainerStyleAndClasses(),n.removeStaticMarkup()});t=a.createElement(this.reactComponent,t),t=r.createPortal(t,this.eParentElement,"agPortalKey_"+ ++y);this.portal=t,this.parentComponent.mountReactPortal(t,this,function(t){e(t),n.statelessComponent&&(2<=n.staticRenderTime?n.eParentElement.addEventListener("DOMNodeInserted",function(){n.removeStaticMarkup()},!1):setTimeout(function(){return n.removeStaticMarkup()}))})},g.prototype.addParentContainerStyleAndClasses=function(){var e,n,r=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(e=this.eParentElement.style,n=this.componentInstance.getReactContainerStyle(),Object.keys(n).forEach(function(t){e[t]=n[t]})),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return s._.addCssClass(r.eParentElement,t)}))},g.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return s._.addCssClass(e,"ag-react-container"),t.reactContainer=e},g.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount||0<this.eParentElement.childNodes.length},g.hasSymbol=function(){return"function"==typeof Symbol&&Symbol.for},g.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)||"object"==typeof t&&t.$$typeof===g.REACT_MEMO_TYPE},g.prototype.isNullRender=function(){return""===this.staticMarkup},g.prototype.renderStaticMarkup=function(t){if(!(this.parentComponent.isDisableStaticMarkup()||this.componentType.isCellRenderer&&!this.componentType.isCellRenderer())){var e=console.error,n=a.createElement(this.reactComponent,t);try{var r=console.error;console.error=function(){};var o=Date.now(),i=p.renderToStaticMarkup(n);this.staticRenderTime=Date.now()-o,console.error=r,""===i?this.staticMarkup=i:i&&(this.staticMarkup=document.createElement("span"),this.staticMarkup.innerHTML=i,this.eParentElement.appendChild(this.staticMarkup))}catch(t){}finally{console.error=e}}},g.prototype.removeStaticMarkup=function(){!this.parentComponent.isDisableStaticMarkup()&&this.componentType.isCellRenderer()&&this.staticMarkup&&(this.staticMarkup.remove?(this.staticMarkup.remove(),this.staticMarkup=null):this.eParentElement.removeChild&&(this.eParentElement.removeChild(this.staticMarkup),this.staticMarkup=null))},g.prototype.rendered=function(){return this.isNullRender()||!!this.staticMarkup||!(!this.isStatelessComponent()||!this.statelessComponentRendered())||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())},g.REACT_MEMO_TYPE=g.hasSymbol()?Symbol.for("react.memo"):60115,g);function g(t,e,n){var r=d.call(this)||this;return r.portal=null,r.staticMarkup=null,r.staticRenderTime=0,r.reactComponent=t,r.componentType=n,r.parentComponent=e,r.statelessComponent=g.isStateless(r.reactComponent),r}(f=e.ChangeDetectionStrategyType||(e.ChangeDetectionStrategyType={})).IdentityCheck="IdentityCheck",f.DeepValueCheck="DeepValueCheck",f.NoCheck="NoCheck";var v=(E.prototype.getStrategy=function(t){return this.strategyMap[t]},E);function E(){var t;this.strategyMap=((t={})[e.ChangeDetectionStrategyType.DeepValueCheck]=new R,t[e.ChangeDetectionStrategyType.IdentityCheck]=new P(function(t,e){return t===e}),t[e.ChangeDetectionStrategyType.NoCheck]=new P(function(t,e){return!1}),t)}var P=(O.prototype.areEqual=function(t,e){return this.strategy(t,e)},O);function O(t){this.strategy=t}var R=(S.prototype.areEqual=function(t,e){return S.areEquivalent(S.copy(t),S.copy(e))},S.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},S.copy=function(t){if(!t)return t;if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(this.copy(t[n]));return e}return"object"!=typeof t?t:[{},t].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},{})},S.isNaN=function(t){return Number.isNaN?Number.isNaN(t):"number"==typeof t&&isNaN(t)},S.areEquivalent=function(e,n){if(e=S.unwrapStringOrNumber(e),n=S.unwrapStringOrNumber(n),e===n)return!0;if(null===e||null===n||typeof e!=typeof n)return!1;if(S.isNaN(e)&&S.isNaN(n))return!0;if(e instanceof Date)return n instanceof Date&&e.valueOf()===n.valueOf();if("function"==typeof e)return e.toString()===n.toString();if("object"!=typeof e||e.$$typeof&&"Symbol(react.element)"===e.$$typeof.toString())return e==n;var t=void 0===e.areEquivPropertyTracking,r=void 0===n.areEquivPropertyTracking;try{var o=void 0;if(t)e.areEquivPropertyTracking=[];else if(e.areEquivPropertyTracking.some(function(t){return t===n}))return!0;if(r)n.areEquivPropertyTracking=[];else if(n.areEquivPropertyTracking.some(function(t){return t===e}))return!0;e.areEquivPropertyTracking.push(n),n.areEquivPropertyTracking.push(e);var i={};for(o in e)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in n)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in i)if(!this.areEquivalent(e[o],n[o]))return!1;return!0}finally{t&&delete e.areEquivPropertyTracking,r&&delete n.areEquivPropertyTracking}},S);function S(){}var T,D=(n(k,T=a.Component),k.prototype.render=function(){var e=this;return a.createElement("div",{style:this.createStyleForDiv(),className:this.props.className,ref:function(t){e.eGridDiv=t}},this.portals)},k.prototype.createStyleForDiv=function(){return i({height:"100%"},this.props.containerStyle||{})},k.prototype.componentDidMount=function(){var t=this.props.modules||[],e={providedBeanInstances:{agGridReact:this,frameworkComponentWrapper:new I(this)},modules:t},n=this.props.gridOptions||{},t=this.props.children;u.hasChildColumns(t)&&(n.columnDefs=u.mapChildColumnDefs(t)),this.gridOptions=s.ComponentUtil.copyAttributesToGridOptions(n,this.props),new s.Grid(this.eGridDiv,this.gridOptions,e),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},k.prototype.waitForInstance=function(t,e,n){var r=this;void 0===n&&(n=Date.now()),this.destroyed?e(null):t.rendered()?e(t):Date.now()-n>=k.MAX_COMPONENT_CREATION_TIME_IN_MS?console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+k.MAX_COMPONENT_CREATION_TIME_IN_MS+"ms"):window.setTimeout(function(){return r.batchUpdate(function(){return r.waitForInstance(t,e,n)})})},k.prototype.mountReactPortal=function(t,e,n){var r=this;this.portals=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),o=0,e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}(this.portals,[t]),this.batchUpdate(function(){return r.waitForInstance(e,n)})},k.prototype.batchUpdate=function(t){var e=this;this.hasPendingPortalUpdate?t&&t():(setTimeout(function(){e.api&&e.forceUpdate(function(){t&&t(),e.hasPendingPortalUpdate=!1})}),this.hasPendingPortalUpdate=!0)},k.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},k.prototype.getStrategyTypeForProp=function(t){if("rowData"===t){if(this.props.rowDataChangeDetectionStrategy)return this.props.rowDataChangeDetectionStrategy;if(this.isImmutableDataActive())return e.ChangeDetectionStrategyType.IdentityCheck}return e.ChangeDetectionStrategyType.DeepValueCheck},k.prototype.isImmutableDataActive=function(){return this.props.deltaRowDataMode||this.props.immutableData||this.props.gridOptions&&(this.props.gridOptions.deltaRowDataMode||this.props.gridOptions.immutableData)},k.prototype.shouldComponentUpdate=function(t){return this.processPropsChanges(this.props,t),!1},k.prototype.componentDidUpdate=function(t){this.processPropsChanges(t,this.props)},k.prototype.processPropsChanges=function(t,e){var n={};this.extractGridPropertyChanges(t,e,n),this.extractDeclarativeColDefChanges(e,n),0<Object.keys(n).length&&s.ComponentUtil.processOnChange(n,this.gridOptions,this.api,this.columnApi)},k.prototype.extractDeclarativeColDefChanges=function(t,e){var n,r,o,i;this.props.gridOptions&&this.props.gridOptions.columnDefs||this.props.columnDefs||(n=!!t.debug,r="columnDefs",o=this.gridOptions.columnDefs,u.hasChildColumns(t.children)?(i=this.changeDetectionService.getStrategy(this.getStrategyTypeForProp(r)),t=u.mapChildColumnDefs(t.children),i.areEqual(o,t)||(n&&console.log("agGridReact: colDefs definitions changed"),e[r]={previousValue:o,currentValue:t})):o&&0<o.length&&(e[r]={previousValue:o,currentValue:[]}))},k.prototype.extractGridPropertyChanges=function(e,n,r){var o=this,i=!!n.debug;Object.keys(n).forEach(function(t){s._.includes(s.ComponentUtil.ALL_PROPERTIES,t)&&(o.changeDetectionService.getStrategy(o.getStrategyTypeForProp(t)).areEqual(e[t],n[t])||(i&&console.log("agGridReact: ["+t+"] property changed"),r[t]={previousValue:e[t],currentValue:n[t]}))}),s.ComponentUtil.getEventCallbacks().forEach(function(t){o.props[t]!==n[t]&&(i&&console.log("agGridReact: ["+t+"] event callback changed"),r[t]={previousValue:e[t],currentValue:n[t]})})},k.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null),this.destroyed=!0},k.prototype.isDisableStaticMarkup=function(){return!!this.props.disableStaticMarkup},k.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3,k);function k(t){var e=T.call(this,t)||this;return e.props=t,e.changeDetectionService=new v,e.api=null,e.portals=[],e.hasPendingPortalUpdate=!1,e.destroyed=!1,e}function b(t,e){t.forEach(function(t){D[t]=e})}D.propTypes={gridOptions:t.object},b(s.ComponentUtil.getEventCallbacks(),t.func),b(s.ComponentUtil.BOOLEAN_PROPERTIES,t.bool),b(s.ComponentUtil.STRING_PROPERTIES,t.string),b(s.ComponentUtil.OBJECT_PROPERTIES,t.object),b(s.ComponentUtil.ARRAY_PROPERTIES,t.array),b(s.ComponentUtil.NUMBER_PROPERTIES,t.number),b(s.ComponentUtil.FUNCTION_PROPERTIES,t.func);var M,I=(n(N,M=s.BaseComponentWrapper),N.prototype.createWrapper=function(t,e){return new C(t,this.agGridReact,e)},N);function N(t){var e=M.call(this)||this;return e.agGridReact=t,e}e.AgGridReact=D,e.AgGridColumn=u,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
import { Component } from "react"; | ||
@@ -11,11 +11,7 @@ import * as AgGrid from "ag-grid-community"; | ||
props: any; | ||
state: any; | ||
constructor(props: any, state: any); | ||
constructor(props: any); | ||
render(): any; | ||
static mapChildColumnDefs(columnProps: any): AgGrid.ColDef[]; | ||
static mapChildColumnDefs(children: any): AgGrid.ColDef[]; | ||
static toColDef(columnProps: any): ColDef; | ||
static hasChildColumns(columnProps: any): boolean; | ||
private static getChildColDefs; | ||
private static createColDefFromGridColumn; | ||
private static assign; | ||
static hasChildColumns(children: any): boolean; | ||
} |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -16,2 +16,13 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -24,6 +35,5 @@ var React = require("react"); | ||
__extends(AgGridColumn, _super); | ||
function AgGridColumn(props, state) { | ||
var _this = _super.call(this, props, state) || this; | ||
function AgGridColumn(props) { | ||
var _this = _super.call(this, props) || this; | ||
_this.props = props; | ||
_this.state = state; | ||
return _this; | ||
@@ -34,39 +44,15 @@ } | ||
}; | ||
AgGridColumn.mapChildColumnDefs = function (columnProps) { | ||
return React.Children.map(columnProps.children, function (child) { | ||
return AgGridColumn.toColDef(child.props); | ||
}); | ||
AgGridColumn.mapChildColumnDefs = function (children) { | ||
return React.Children.map(children, function (child) { return AgGridColumn.toColDef(child.props); }); | ||
}; | ||
AgGridColumn.toColDef = function (columnProps) { | ||
var colDef = AgGridColumn.createColDefFromGridColumn(columnProps); | ||
if (AgGridColumn.hasChildColumns(columnProps)) { | ||
colDef["children"] = AgGridColumn.getChildColDefs(columnProps.children); | ||
var children = columnProps.children, colDef = __rest(columnProps, ["children"]); | ||
if (AgGridColumn.hasChildColumns(children)) { | ||
colDef.children = AgGridColumn.mapChildColumnDefs(children); | ||
} | ||
return colDef; | ||
}; | ||
AgGridColumn.hasChildColumns = function (columnProps) { | ||
return React.Children.count(columnProps.children) > 0; | ||
AgGridColumn.hasChildColumns = function (children) { | ||
return React.Children.count(children) > 0; | ||
}; | ||
AgGridColumn.getChildColDefs = function (columnChildren) { | ||
return React.Children.map(columnChildren, function (child) { | ||
return AgGridColumn.createColDefFromGridColumn(child.props); | ||
}); | ||
}; | ||
; | ||
AgGridColumn.createColDefFromGridColumn = function (columnProps) { | ||
var colDef = {}; | ||
AgGridColumn.assign(colDef, columnProps); | ||
delete colDef.children; | ||
return colDef; | ||
}; | ||
; | ||
AgGridColumn.assign = function (colDef, from) { | ||
// effectively Object.assign - here for IE compatibility | ||
return [from].reduce(function (r, o) { | ||
Object.keys(o).forEach(function (k) { | ||
r[k] = o[k]; | ||
}); | ||
return r; | ||
}, colDef); | ||
}; | ||
return AgGridColumn; | ||
@@ -73,0 +59,0 @@ }(react_1.Component)); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
import * as React from "react"; | ||
@@ -17,3 +17,2 @@ import { Component, ReactPortal } from "react"; | ||
props: any; | ||
state: any; | ||
static propTypes: any; | ||
@@ -28,8 +27,12 @@ gridOptions: GridOptions; | ||
protected eGridDiv: HTMLElement; | ||
private static MAX_COMPONENT_CREATION_TIME; | ||
constructor(props: any, state: any); | ||
render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>; | ||
private static MAX_COMPONENT_CREATION_TIME_IN_MS; | ||
constructor(props: any); | ||
render(): React.DetailedReactHTMLElement<{ | ||
style: any; | ||
className: any; | ||
ref: (e: HTMLElement) => void; | ||
}, HTMLElement>; | ||
createStyleForDiv(): any; | ||
componentDidMount(): void; | ||
waitForInstance(reactComponent: ReactComponent, resolve: (value: any) => void, runningTime?: number): void; | ||
waitForInstance(reactComponent: ReactComponent, resolve: (value: any) => void, startTime?: number): void; | ||
/** | ||
@@ -41,5 +44,6 @@ * Mounts a react portal for components registered under the componentFramework. | ||
mountReactPortal(portal: ReactPortal, reactComponent: ReactComponent, resolve: (value: any) => void): void; | ||
batchUpdate(callback?: any): any; | ||
batchUpdate(callback?: () => void): void; | ||
destroyPortal(portal: ReactPortal): void; | ||
private getStrategyTypeForProp; | ||
private isImmutableDataActive; | ||
shouldComponentUpdate(nextProps: any): boolean; | ||
@@ -46,0 +50,0 @@ componentDidUpdate(prevProps: any): void; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -16,2 +16,13 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
@@ -34,6 +45,5 @@ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
__extends(AgGridReact, _super); | ||
function AgGridReact(props, state) { | ||
var _this = _super.call(this, props, state) || this; | ||
function AgGridReact(props) { | ||
var _this = _super.call(this, props) || this; | ||
_this.props = props; | ||
_this.state = state; | ||
_this.changeDetectionService = new changeDetectionService_1.ChangeDetectionService(); | ||
@@ -48,4 +58,5 @@ _this.api = null; | ||
var _this = this; | ||
return React.createElement("div", { | ||
return React.createElement('div', { | ||
style: this.createStyleForDiv(), | ||
className: this.props.className, | ||
ref: function (e) { | ||
@@ -57,11 +68,3 @@ _this.eGridDiv = e; | ||
AgGridReact.prototype.createStyleForDiv = function () { | ||
var style = { height: "100%" }; | ||
// allow user to override styles | ||
var containerStyle = this.props.containerStyle; | ||
if (containerStyle) { | ||
Object.keys(containerStyle).forEach(function (key) { | ||
style[key] = containerStyle[key]; | ||
}); | ||
} | ||
return style; | ||
return __assign({ height: '100%' }, (this.props.containerStyle || {})); | ||
}; | ||
@@ -78,4 +81,5 @@ AgGridReact.prototype.componentDidMount = function () { | ||
var gridOptions = this.props.gridOptions || {}; | ||
if (agGridColumn_1.AgGridColumn.hasChildColumns(this.props)) { | ||
gridOptions.columnDefs = agGridColumn_1.AgGridColumn.mapChildColumnDefs(this.props); | ||
var children = this.props.children; | ||
if (agGridColumn_1.AgGridColumn.hasChildColumns(children)) { | ||
gridOptions.columnDefs = agGridColumn_1.AgGridColumn.mapChildColumnDefs(children); | ||
} | ||
@@ -88,5 +92,5 @@ this.gridOptions = ag_grid_community_1.ComponentUtil.copyAttributesToGridOptions(gridOptions, this.props); | ||
}; | ||
AgGridReact.prototype.waitForInstance = function (reactComponent, resolve, runningTime) { | ||
AgGridReact.prototype.waitForInstance = function (reactComponent, resolve, startTime) { | ||
var _this = this; | ||
if (runningTime === void 0) { runningTime = 0; } | ||
if (startTime === void 0) { startTime = Date.now(); } | ||
// if the grid has been destroyed in the meantime just resolve | ||
@@ -98,10 +102,10 @@ if (this.destroyed) { | ||
if (reactComponent.rendered()) { | ||
resolve(null); | ||
resolve(reactComponent); | ||
} | ||
else { | ||
if (runningTime >= AgGridReact.MAX_COMPONENT_CREATION_TIME) { | ||
console.error("ag-Grid: React Component '" + reactComponent.getReactComponentName() + "' not created within " + AgGridReact.MAX_COMPONENT_CREATION_TIME + "ms"); | ||
if (Date.now() - startTime >= AgGridReact.MAX_COMPONENT_CREATION_TIME_IN_MS) { | ||
console.error("ag-Grid: React Component '" + reactComponent.getReactComponentName() + "' not created within " + AgGridReact.MAX_COMPONENT_CREATION_TIME_IN_MS + "ms"); | ||
return; | ||
} | ||
window.setTimeout(function () { return _this.waitForInstance(reactComponent, resolve, runningTime + 5); }, 5); | ||
window.setTimeout(function () { return _this.batchUpdate(function () { return _this.waitForInstance(reactComponent, resolve, startTime); }); }); | ||
} | ||
@@ -115,4 +119,5 @@ }; | ||
AgGridReact.prototype.mountReactPortal = function (portal, reactComponent, resolve) { | ||
var _this = this; | ||
this.portals = __spreadArrays(this.portals, [portal]); | ||
this.batchUpdate(this.waitForInstance(reactComponent, resolve)); | ||
this.batchUpdate(function () { return _this.waitForInstance(reactComponent, resolve); }); | ||
}; | ||
@@ -122,3 +127,4 @@ AgGridReact.prototype.batchUpdate = function (callback) { | ||
if (this.hasPendingPortalUpdate) { | ||
return callback && callback(); | ||
callback && callback(); | ||
return; | ||
} | ||
@@ -140,21 +146,17 @@ setTimeout(function () { | ||
AgGridReact.prototype.getStrategyTypeForProp = function (propKey) { | ||
switch (propKey) { | ||
case 'rowData': { | ||
// for row data we either return the supplied strategy, or: | ||
// if deltaRowDataMode/immutableData we default to IdentityChecks, | ||
// if not we default to DeepValueChecks (with the rest of the properties) | ||
if (!!this.props.rowDataChangeDetectionStrategy) { | ||
return this.props.rowDataChangeDetectionStrategy; | ||
} | ||
else if (this.props['deltaRowDataMode'] || this.props['immutableData']) { | ||
return changeDetectionService_1.ChangeDetectionStrategyType.IdentityCheck; | ||
} | ||
return changeDetectionService_1.ChangeDetectionStrategyType.DeepValueCheck; | ||
if (propKey === 'rowData') { | ||
if (this.props.rowDataChangeDetectionStrategy) { | ||
return this.props.rowDataChangeDetectionStrategy; | ||
} | ||
default: { | ||
// all other data properties will default to DeepValueCheck | ||
return changeDetectionService_1.ChangeDetectionStrategyType.DeepValueCheck; | ||
else if (this.isImmutableDataActive()) { | ||
return changeDetectionService_1.ChangeDetectionStrategyType.IdentityCheck; | ||
} | ||
} | ||
// all other cases will default to DeepValueCheck | ||
return changeDetectionService_1.ChangeDetectionStrategyType.DeepValueCheck; | ||
}; | ||
AgGridReact.prototype.isImmutableDataActive = function () { | ||
return (this.props.deltaRowDataMode || this.props.immutableData) || | ||
(this.props.gridOptions && (this.props.gridOptions.deltaRowDataMode || this.props.gridOptions.immutableData)); | ||
}; | ||
AgGridReact.prototype.shouldComponentUpdate = function (nextProps) { | ||
@@ -185,6 +187,7 @@ this.processPropsChanges(this.props, nextProps); | ||
var debugLogging = !!nextProps.debug; | ||
if (agGridColumn_1.AgGridColumn.hasChildColumns(nextProps)) { | ||
var detectionStrategy = this.changeDetectionService.getStrategy(this.getStrategyTypeForProp('columnDefs')); | ||
var currentColDefs = this.gridOptions.columnDefs; | ||
var newColDefs = agGridColumn_1.AgGridColumn.mapChildColumnDefs(nextProps); | ||
var propKey = 'columnDefs'; | ||
var currentColDefs = this.gridOptions.columnDefs; | ||
if (agGridColumn_1.AgGridColumn.hasChildColumns(nextProps.children)) { | ||
var detectionStrategy = this.changeDetectionService.getStrategy(this.getStrategyTypeForProp(propKey)); | ||
var newColDefs = agGridColumn_1.AgGridColumn.mapChildColumnDefs(nextProps.children); | ||
if (!detectionStrategy.areEqual(currentColDefs, newColDefs)) { | ||
@@ -194,13 +197,13 @@ if (debugLogging) { | ||
} | ||
changes['columnDefs'] = | ||
changes[propKey] = | ||
{ | ||
previousValue: this.gridOptions.columnDefs, | ||
currentValue: agGridColumn_1.AgGridColumn.mapChildColumnDefs(nextProps) | ||
previousValue: currentColDefs, | ||
currentValue: newColDefs | ||
}; | ||
} | ||
} | ||
else if (this.gridOptions.columnDefs && this.gridOptions.columnDefs.length > 0) { | ||
changes['columnDefs'] = | ||
else if (currentColDefs && currentColDefs.length > 0) { | ||
changes[propKey] = | ||
{ | ||
previousValue: this.gridOptions.columnDefs, | ||
previousValue: currentColDefs, | ||
currentValue: [] | ||
@@ -213,5 +216,4 @@ }; | ||
var debugLogging = !!nextProps.debug; | ||
var changedKeys = Object.keys(nextProps); | ||
changedKeys.forEach(function (propKey) { | ||
if (ag_grid_community_1.ComponentUtil.ALL_PROPERTIES.indexOf(propKey) !== -1) { | ||
Object.keys(nextProps).forEach(function (propKey) { | ||
if (ag_grid_community_1._.includes(ag_grid_community_1.ComponentUtil.ALL_PROPERTIES, propKey)) { | ||
var changeDetectionStrategy = _this.changeDetectionService.getStrategy(_this.getStrategyTypeForProp(propKey)); | ||
@@ -251,3 +253,3 @@ if (!changeDetectionStrategy.areEqual(prevProps[propKey], nextProps[propKey])) { | ||
}; | ||
AgGridReact.MAX_COMPONENT_CREATION_TIME = 1000; // a second should be more than enough to instantiate a component | ||
AgGridReact.MAX_COMPONENT_CREATION_TIME_IN_MS = 1000; // a second should be more than enough to instantiate a component | ||
return AgGridReact; | ||
@@ -254,0 +256,0 @@ }(react_1.Component)); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
import { IComponent, WrapableInterface } from 'ag-grid-community'; | ||
@@ -3,0 +3,0 @@ export declare abstract class BaseReactComponent implements IComponent<any>, WrapableInterface { |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
export declare enum ChangeDetectionStrategyType { | ||
@@ -3,0 +3,0 @@ IdentityCheck = "IdentityCheck", |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -102,3 +102,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
} | ||
if (typeof a !== "object") { | ||
if (typeof a !== "object" || | ||
(a.$$typeof && a.$$typeof.toString() === "Symbol(react.element)")) { | ||
return a == b; //for boolean, number, string, function, xml | ||
@@ -105,0 +106,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
import { ICellEditor, ICellEditorParams, ICellRenderer, ICellRendererParams, IDate, IDateParams, IFilter, IFilterParams, IHeader, IHeaderGroup, IHeaderGroupParams, IHeaderParams, ILoadingCellRendererParams, ILoadingOverlayParams, INoRowsOverlayParams, IStatusPanel, IToolPanel, IToolPanelParams, IAfterGuiAttachedParams, IStatusPanelParams } from 'ag-grid-community'; | ||
@@ -3,0 +3,0 @@ export interface AgReactFrameworkComponent<T> { |
@@ -1,3 +0,3 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
export default function generateNewKey(): string; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,3 +0,4 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
export { AgGridReact } from './agGridReact'; | ||
export { AgGridColumn } from './agGridColumn'; | ||
export { ChangeDetectionStrategyType } from './changeDetectionService'; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -8,2 +8,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AgGridColumn = agGridColumn_1.AgGridColumn; | ||
var changeDetectionService_1 = require("./changeDetectionService"); | ||
exports.ChangeDetectionStrategyType = changeDetectionService_1.ChangeDetectionStrategyType; | ||
// https://github.com/rollup/rollup-plugin-typescript/issues/109 | ||
@@ -10,0 +12,0 @@ // export {ICellEditorReactComp} from './interfaces'; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
import { ComponentType, Promise } from 'ag-grid-community'; | ||
@@ -13,3 +13,2 @@ import { AgGridReact } from "./agGridReact"; | ||
private portal; | ||
private componentWrappingElement; | ||
private statelessComponent; | ||
@@ -34,3 +33,3 @@ private staticMarkup; | ||
private removeStaticMarkup; | ||
rendered(): any; | ||
rendered(): boolean; | ||
} |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -17,4 +17,4 @@ var __extends = (this && this.__extends) || (function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var React = require("react"); | ||
var ReactDOM = require("react-dom"); | ||
var react_1 = require("react"); | ||
var react_dom_1 = require("react-dom"); | ||
var ag_grid_community_1 = require("ag-grid-community"); | ||
@@ -30,3 +30,2 @@ var baseReactComponent_1 = require("./baseReactComponent"); | ||
_this.portal = null; | ||
_this.componentWrappingElement = 'div'; | ||
_this.staticMarkup = null; | ||
@@ -72,4 +71,4 @@ _this.staticRenderTime = 0; | ||
} | ||
var reactComponent = React.createElement(this.reactComponent, params); | ||
var portal = ReactDOM.createPortal(reactComponent, this.eParentElement, keyGenerator_1.default() // fixed deltaRowModeRefreshCompRenderer | ||
var reactComponent = react_1.createElement(this.reactComponent, params); | ||
var portal = react_dom_1.createPortal(reactComponent, this.eParentElement, keyGenerator_1.default() // fixed deltaRowModeRefreshCompRenderer | ||
); | ||
@@ -92,5 +91,3 @@ this.portal = portal; | ||
else { | ||
setTimeout(function () { | ||
_this.removeStaticMarkup(); | ||
}); | ||
setTimeout(function () { return _this.removeStaticMarkup(); }); | ||
} | ||
@@ -133,3 +130,3 @@ } | ||
ReactComponent.prototype.isNullRender = function () { | ||
return this.staticMarkup === ""; | ||
return this.staticMarkup === ''; | ||
}; | ||
@@ -147,7 +144,7 @@ /* | ||
var originalConsoleError = console.error; | ||
var reactComponent = React.createElement(this.reactComponent, params); | ||
var reactComponent = react_1.createElement(this.reactComponent, params); | ||
try { | ||
// if a user is using anything that uses useLayoutEffect (like material ui) then | ||
// Warning: useLayoutEffect does nothing on the s erver will be throw and we can't do anything to stop it | ||
// this is just a warning and has no effect on anything so just suppress it for this single operation | ||
// if a user is doing anything that uses useLayoutEffect (like material ui) then it will throw and we | ||
// can't do anything to stop it; this is just a warning and has no effect on anything so just suppress it | ||
// for this single operation | ||
var originalConsoleError_1 = console.error; | ||
@@ -161,3 +158,3 @@ console.error = function () { | ||
// if the render method returns null the result will be an empty string | ||
if (staticMarkup === "") { | ||
if (staticMarkup === '') { | ||
this.staticMarkup = staticMarkup; | ||
@@ -201,5 +198,5 @@ } | ||
return this.isNullRender() || | ||
this.staticMarkup || | ||
(this.isStatelessComponent() && this.statelessComponentRendered()) || | ||
(!this.isStatelessComponent() && this.getFrameworkComponentInstance()); | ||
!!this.staticMarkup || | ||
!!(this.isStatelessComponent() && this.statelessComponentRendered()) || | ||
!!(!this.isStatelessComponent() && this.getFrameworkComponentInstance()); | ||
}; | ||
@@ -206,0 +203,0 @@ ReactComponent.REACT_MEMO_TYPE = ReactComponent.hasSymbol() ? Symbol.for('react.memo') : 0xead3; |
@@ -1,3 +0,3 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
export declare const assignProperties: (to: {}, from: {}) => void; | ||
export declare const assign: (obj: any, prop: any, value: any) => void; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v24.0.0 | ||
// ag-grid-react v24.1.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -14,2 +14,3 @@ export * from './lib/agGridReact'; | ||
export {ChangeDetectionStrategyType} from './lib/changeDetectionService' | ||
export {ICellEditorReactComp} from './lib/interfaces'; | ||
@@ -16,0 +17,0 @@ export {AgReactFrameworkComponent} from './lib/interfaces'; |
exports.AgGridReact = require('./lib/agGridReact').AgGridReact; | ||
exports.AgGridColumn = require('./lib/agGridColumn').AgGridColumn; | ||
exports.ChangeDetectionStrategyType = require('./lib/changeDetectionService').ChangeDetectionStrategyType; |
{ | ||
"name": "ag-grid-react", | ||
"version": "24.0.0", | ||
"version": "24.1.0", | ||
"description": "ag-Grid React Component", | ||
@@ -41,4 +41,4 @@ "main": "main.js", | ||
"@types/react-dom": "16.9.0", | ||
"ag-grid-community": "~24.0.0", | ||
"@ag-grid-community/react": "~24.0.0", | ||
"ag-grid-community": "~24.1.0", | ||
"@ag-grid-community/react": "~24.1.0", | ||
"babel-preset-react-app": "^9.0.1", | ||
@@ -75,3 +75,3 @@ "cypress": "3.0.1", | ||
"peerDependencies": { | ||
"ag-grid-community": "~24.0.0", | ||
"ag-grid-community": "~24.1.0", | ||
"react": "^16.3.0", | ||
@@ -78,0 +78,0 @@ "react-dom": "^16.3.0" |
Sorry, the diff of this file is not supported yet
81845
1060