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

ag-grid-react

Package Overview
Dependencies
Maintainers
4
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ag-grid-react - npm Package Compare versions

Comparing version 21.0.1 to 21.1.0

2

lib/agGridColumn.d.ts

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
import { Component } from "react";

@@ -3,0 +3,0 @@ import * as AgGrid from "ag-grid-community";

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
"use strict";

@@ -3,0 +3,0 @@ var __extends = (this && this.__extends) || (function () {

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
import * as React from "react";

@@ -17,3 +17,2 @@ import { ReactPortal } from "react";

static propTypes: any;
destroyed: boolean;
gridOptions: AgGrid.GridOptions;

@@ -20,0 +19,0 @@ changeDetectionService: ChangeDetectionService;

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
"use strict";

@@ -41,3 +41,2 @@ var __extends = (this && this.__extends) || (function () {

_this.state = state;
_this.destroyed = false;
_this.changeDetectionService = new changeDetectionService_1.ChangeDetectionService();

@@ -94,2 +93,7 @@ _this.api = null;

if (runningTime === void 0) { runningTime = 0; }
// if the grid has been destroyed in the meantime just resolve
if (!this.api) {
resolve(null);
return;
}
if (reactComponent.isStatelesComponent() && reactComponent.statelessComponentRendered()) {

@@ -96,0 +100,0 @@ resolve(null);

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.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 v21.0.1
// ag-grid-react v21.1.0
"use strict";

@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
export declare enum ChangeDetectionStrategyType {

@@ -3,0 +3,0 @@ IdentityCheck = "IdentityCheck",

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
"use strict";

@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.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 v21.0.1
// ag-grid-react v21.1.0
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
import { Promise } from 'ag-grid-community';

@@ -3,0 +3,0 @@ import { AgGridReact } from "./agGridReact";

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
"use strict";

@@ -3,0 +3,0 @@ var __extends = (this && this.__extends) || (function () {

@@ -1,3 +0,3 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
export { AgGridReact } from './agGridReact';
export { AgGridColumn } from './agGridColumn';

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
"use strict";

@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
import { Promise } from 'ag-grid-community';

@@ -3,0 +3,0 @@ import { AgGridReact } from "./agGridReact";

@@ -1,2 +0,2 @@

// ag-grid-react v21.0.1
// ag-grid-react v21.1.0
"use strict";

@@ -100,5 +100,4 @@ var __extends = (this && this.__extends) || (function () {

AgGrid.Utils.addCssClass(eParentElement, 'ag-react-container');
// so user can have access to the react container,
// to add css class or style
params.reactContainer = this.eParentElement;
// so user can have access to the react container, to add css class or style
params.reactContainer = eParentElement;
}

@@ -105,0 +104,0 @@ return eParentElement;

{
"name": "ag-grid-react",
"version": "21.0.1",
"version": "21.1.0",
"description": "ag-Grid React Component",

@@ -10,4 +10,4 @@ "main": "main.js",

"umd": "rollup -c",
"test": "CI=true react-scripts test --verbose=false",
"test:watch": "react-scripts test --verbose=false",
"test": "CI=true react-scripts test --verbose=false --env=jest-environment-jsdom-fourteen",
"test:watch": "react-scripts test --verbose=false --env=jest-environment-jsdom-fourteen",
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache"

@@ -42,3 +42,3 @@ },

"@types/react-dom": "16.8.4",
"ag-grid-community": "^21.0.0",
"ag-grid-community": "^21.1.0",
"enzyme": "^3.9.0",

@@ -52,2 +52,3 @@ "enzyme-adapter-react-16": "^1.10.0",

"gulp-typescript": "^5.0.0-alpha.3",
"jest-environment-jsdom-fourteen": "1.0.0-alpha.0",
"react": "^16.0.0",

@@ -66,3 +67,3 @@ "react-dom": "^16.0.0",

"peerDependencies": {
"ag-grid-community": "^21.0.0",
"ag-grid-community": "^21.1.0",
"react": "^15.5.0 || ^16.0.0",

@@ -69,0 +70,0 @@ "react-dom": "^15.5.0 || ^16.0.0"

@@ -30,4 +30,2 @@ import * as React from "react";

destroyed: boolean = false;
gridOptions!: AgGrid.GridOptions;

@@ -100,2 +98,8 @@

waitForInstance(reactComponent: ReactComponent, resolve: (value: any) => void, runningTime = 0) {
// if the grid has been destroyed in the meantime just resolve
if(!this.api) {
resolve(null);
return;
}
if (reactComponent.isStatelesComponent() && reactComponent.statelessComponentRendered()) {

@@ -102,0 +106,0 @@ resolve(null);

@@ -107,5 +107,4 @@ import * as React from 'react';

// so user can have access to the react container,
// to add css class or style
params.reactContainer = this.eParentElement;
// so user can have access to the react container, to add css class or style
params.reactContainer = eParentElement;
}

@@ -112,0 +111,0 @@ return eParentElement;

@@ -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")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","react-dom","ag-grid-community"],e):e(t.AgGridReact={},t.PropTypes,t.React,t.ReactDOM,t.agGrid)}(this,function(t,e,i,a,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 c(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var p=t.length-1;0<=p;p--)(o=t[p])&&(a=(i<3?o(a):3<i?o(e,n,a):o(e,n))||a);return 3<i&&a&&Object.defineProperty(e,n,a),a}var u=function(r){function n(t,e){var n=r.call(this,t,e)||this;return n.props=t,n.state=e,n}return c(n,r),n.prototype.render=function(){return null},n.mapChildColumnDefs=function(t){return i.Children.map(t.children,function(t){return n.toColDef(t.props)})},n.toColDef=function(t){var e=n.createColDefFromGridColumn(t);return n.hasChildColumns(t)&&(e.children=n.getChildColDefs(t.children)),e},n.hasChildColumns=function(t){return 0<i.Children.count(t.children)},n.getChildColDefs=function(t){return i.Children.map(t,function(t){return n.createColDefFromGridColumn(t.props)})},n.createColDefFromGridColumn=function(t){var e={};return n.assign(e,t),delete e.children,e},n.assign=function(t,e){return[e].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},t)},n}(i.Component);function o(t,e){t.forEach(function(t){u[t]=e})}o(p.ColDefUtil.BOOLEAN_PROPERTIES,e.bool),o(p.ColDefUtil.STRING_PROPERTIES,e.string),o(p.ColDefUtil.OBJECT_PROPERTIES,e.object),o(p.ColDefUtil.ARRAY_PROPERTIES,e.array),o(p.ColDefUtil.NUMBER_PROPERTIES,e.number),o(p.ColDefUtil.FUNCTION_PROPERTIES,e.func);var s,l,f=function(){function t(){}return t.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},t.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)},t.prototype.addMethod=function(t,e){this[t]=e},t}(),h=function(r){function o(t,e){var n=r.call(this)||this;return n.portal=null,n.componentWrappingElement="div",n.unwrapComponent=!0,n.reactComponent=t,n.parentComponent=e,n.orphans=[],n.statelessComponent=o.isStateless(n.reactComponent),n}return c(o,r),o.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},o.prototype.isStatelesComponent=function(){return this.statelessComponent},o.prototype.getReactComponentName=function(){return this.reactComponent.name},o.prototype.init=function(e){var n=this;return new p.Promise(function(t){n.unwrapComponent=!1,n.eParentElement=n.createParentElement(e),n.createReactComponent(e,t)})},o.prototype.getGui=function(){if(this.unwrapComponent){var t=document.createDocumentFragment();if(0<this.orphans.length)for(var e=0,n=this.orphans;e<n.length;e++){var r=n[e];t.appendChild(r)}else for(;this.eParentElement.firstChild;)this.orphans.push(this.eParentElement.firstChild),t.appendChild(this.eParentElement.firstChild);return t}return this.eParentElement},o.prototype.destroy=function(){if(this.unwrapComponent)for(var t=0,e=this.orphans;t<e.length;t++){var n=e[t];this.eParentElement.appendChild(n)}return this.parentComponent.destroyPortal(this.portal)},o.prototype.createReactComponent=function(t,e){var n=this;this.statelessComponent||(t.ref=function(t){n.componentInstance=t});var r=i.createElement(this.reactComponent,t),o=a.createPortal(r,this.eParentElement);this.portal=o,this.parentComponent.mountReactPortal(o,this,e)},o.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return this.unwrapComponent||(p.Utils.addCssClass(e,"ag-react-container"),t.reactContainer=this.eParentElement),e},o.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount},o.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)},o}(f);(l=s||(s={})).IdentityCheck="IdentityCheck",l.DeepValueCheck="DeepValueCheck",l.NoCheck="NoCheck";var m=function(){function t(){var t;this.strategyMap=((t={})[s.DeepValueCheck]=new C,t[s.IdentityCheck]=new d(function(t,e){return t===e}),t[s.NoCheck]=new d(function(t,e){return!0}),t)}return t.prototype.getStrategy=function(t){return this.strategyMap[t]},t}(),d=function(){function t(t){this.strategy=t}return t.prototype.areEqual=function(t,e){return this.strategy(t,e)},t}(),C=function(){function a(){}return a.prototype.areEqual=function(t,e){return a.areEquivalent(a.copy(t),a.copy(e))},a.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},a.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},{})},a.areEquivalent=function(e,n){if(e=a.unwrapStringOrNumber(e),n=a.unwrapStringOrNumber(n),e===n)return!0;if(null===e||null===n||typeof e!=typeof n)return!1;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}},a}(),y=function(r){function t(t,e){var n=r.call(this)||this;return n.reactComponent=t,n.parentComponent=e,n}return c(t,r),t.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},t.prototype.getReactComponentName=function(){return this.reactComponent.name},t.prototype.init=function(e){var n=this;return new p.Promise(function(t){n.eParentElement=document.createElement(n.parentComponent.props.componentWrappingElement||"div"),p.Utils.addCssClass(n.eParentElement,"ag-react-container"),e.reactContainer=n.eParentElement,n.createReactComponentLegacy(e,t)})},t.prototype.getGui=function(){return this.eParentElement},t.prototype.destroy=function(){a.unmountComponentAtNode(this.eParentElement)},t.prototype.createReactComponentLegacy=function(t,e){var n=this,r=i.createElement(this.reactComponent,t);this.parentComponent?a.unstable_renderSubtreeIntoContainer(this.parentComponent,r,this.eParentElement,function(){n.componentInstance=this,e(null)}):a.render(r,this.eParentElement,function(){n.componentInstance=this,e(null)})},t}(f),g=function(r){function o(t,e){var n=r.call(this,t,e)||this;return n.props=t,n.state=e,n.destroyed=!1,n.changeDetectionService=new m,n.api=null,n.portals=[],n.hasPendingPortalUpdate=!1,n}return c(o,r),o.prototype.render=function(){var e=this;return i.createElement("div",{style:this.createStyleForDiv(),ref:function(t){e.eGridDiv=t}},this.portals)},o.prototype.createStyleForDiv=function(){var e={height:"100%"},n=this.props.containerStyle;return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},o.prototype.componentDidMount=function(){var t={seedBeanInstances:{agGridReact:this}},e=this.props.gridOptions||{};u.hasChildColumns(this.props)&&(e.columnDefs=u.mapChildColumnDefs(this.props)),this.gridOptions=p.ComponentUtil.copyAttributesToGridOptions(e,this.props),new p.Grid(this.eGridDiv,this.gridOptions,t),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},o.prototype.shouldComponentUpdate=function(){return!1},o.prototype.waitForInstance=function(t,e,n){var r=this;if(void 0===n&&(n=0),t.isStatelesComponent()&&t.statelessComponentRendered())e(null);else if(!t.isStatelesComponent()&&t.getFrameworkComponentInstance())e(null);else{if(o.MAX_COMPONENT_CREATION_TIME<=n)return void console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+o.MAX_COMPONENT_CREATION_TIME+"ms");window.setTimeout(function(){return r.waitForInstance(t,e,n+5)},5)}},o.prototype.mountReactPortal=function(t,e,n){this.portals=this.portals.concat([t]),this.batchUpdate(this.waitForInstance(e,n))},o.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},o.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},o.prototype.getStrategyTypeForProp=function(t){if("rowData"===t){if(this.props.rowDataChangeDetectionStrategy)return this.props.rowDataChangeDetectionStrategy;if(this.props.deltaRowDataMode)return s.IdentityCheck}return s.DeepValueCheck},o.prototype.componentWillReceiveProps=function(t){var e={};this.extractGridPropertyChanges(t,e),this.extractDeclarativeColDefChanges(t,e),p.ComponentUtil.processOnChange(e,this.gridOptions,this.api,this.columnApi)},o.prototype.extractDeclarativeColDefChanges=function(t,e){var n=!!t.debug;if(u.hasChildColumns(t)){var r=this.changeDetectionService.getStrategy(s.DeepValueCheck),o=this.gridOptions.columnDefs,i=u.mapChildColumnDefs(t);r.areEqual(o,i)||(n&&console.log("agGridReact: colDefs definitions changed"),e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:u.mapChildColumnDefs(t)})}},o.prototype.extractGridPropertyChanges=function(e,n){var r=this,o=!!e.debug;Object.keys(e).forEach(function(t){-1!==p.ComponentUtil.ALL_PROPERTIES.indexOf(t)&&(r.changeDetectionService.getStrategy(r.getStrategyTypeForProp(t)).areEqual(r.props[t],e[t])||(o&&console.log("agGridReact: ["+t+"] property changed"),n[t]={previousValue:r.props[t],currentValue:e[t]}))}),p.ComponentUtil.getEventCallbacks().forEach(function(t){r.props[t]!==e[t]&&(o&&console.log("agGridReact: ["+t+"] event callback changed"),n[t]={previousValue:r.props[t],currentValue:e[t]})})},o.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null)},o.MAX_COMPONENT_CREATION_TIME=1e3,o}(i.Component);function E(t,e){t.forEach(function(t){g[t]=e})}g.propTypes={gridOptions:e.object},E(p.ComponentUtil.getEventCallbacks(),e.func),E(p.ComponentUtil.BOOLEAN_PROPERTIES,e.bool),E(p.ComponentUtil.STRING_PROPERTIES,e.string),E(p.ComponentUtil.OBJECT_PROPERTIES,e.object),E(p.ComponentUtil.ARRAY_PROPERTIES,e.array),E(p.ComponentUtil.NUMBER_PROPERTIES,e.number),E(p.ComponentUtil.FUNCTION_PROPERTIES,e.func);var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createWrapper=function(t){return this.useLegacyReact()?new y(t,this.agGridReact):new h(t,this.agGridReact)},e.prototype.useLegacyReact=function(){return"function"!=typeof a.unstable_renderSubtreeIntoContainer||this.agGridReact&&this.agGridReact.gridOptions&&!this.agGridReact.gridOptions.reactNext},n([p.Autowired("agGridReact"),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:type",g)],e.prototype,"agGridReact",void 0),e=n([p.Bean("frameworkComponentWrapper")],e)}(p.BaseComponentWrapper);p.Grid.setFrameworkBeans([v]),t.AgGridReact=g,t.AgGridColumn=u,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")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","react-dom","ag-grid-community"],e):e(t.AgGridReact={},t.PropTypes,t.React,t.ReactDOM,t.agGrid)}(this,function(t,e,i,a,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 c(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var p=t.length-1;0<=p;p--)(o=t[p])&&(a=(i<3?o(a):3<i?o(e,n,a):o(e,n))||a);return 3<i&&a&&Object.defineProperty(e,n,a),a}var u=function(r){function n(t,e){var n=r.call(this,t,e)||this;return n.props=t,n.state=e,n}return c(n,r),n.prototype.render=function(){return null},n.mapChildColumnDefs=function(t){return i.Children.map(t.children,function(t){return n.toColDef(t.props)})},n.toColDef=function(t){var e=n.createColDefFromGridColumn(t);return n.hasChildColumns(t)&&(e.children=n.getChildColDefs(t.children)),e},n.hasChildColumns=function(t){return 0<i.Children.count(t.children)},n.getChildColDefs=function(t){return i.Children.map(t,function(t){return n.createColDefFromGridColumn(t.props)})},n.createColDefFromGridColumn=function(t){var e={};return n.assign(e,t),delete e.children,e},n.assign=function(t,e){return[e].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},t)},n}(i.Component);function o(t,e){t.forEach(function(t){u[t]=e})}o(p.ColDefUtil.BOOLEAN_PROPERTIES,e.bool),o(p.ColDefUtil.STRING_PROPERTIES,e.string),o(p.ColDefUtil.OBJECT_PROPERTIES,e.object),o(p.ColDefUtil.ARRAY_PROPERTIES,e.array),o(p.ColDefUtil.NUMBER_PROPERTIES,e.number),o(p.ColDefUtil.FUNCTION_PROPERTIES,e.func);var s,l,f=function(){function t(){}return t.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},t.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)},t.prototype.addMethod=function(t,e){this[t]=e},t}(),h=function(r){function o(t,e){var n=r.call(this)||this;return n.portal=null,n.componentWrappingElement="div",n.unwrapComponent=!0,n.reactComponent=t,n.parentComponent=e,n.orphans=[],n.statelessComponent=o.isStateless(n.reactComponent),n}return c(o,r),o.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},o.prototype.isStatelesComponent=function(){return this.statelessComponent},o.prototype.getReactComponentName=function(){return this.reactComponent.name},o.prototype.init=function(e){var n=this;return new p.Promise(function(t){n.unwrapComponent=!1,n.eParentElement=n.createParentElement(e),n.createReactComponent(e,t)})},o.prototype.getGui=function(){if(this.unwrapComponent){var t=document.createDocumentFragment();if(0<this.orphans.length)for(var e=0,n=this.orphans;e<n.length;e++){var r=n[e];t.appendChild(r)}else for(;this.eParentElement.firstChild;)this.orphans.push(this.eParentElement.firstChild),t.appendChild(this.eParentElement.firstChild);return t}return this.eParentElement},o.prototype.destroy=function(){if(this.unwrapComponent)for(var t=0,e=this.orphans;t<e.length;t++){var n=e[t];this.eParentElement.appendChild(n)}return this.parentComponent.destroyPortal(this.portal)},o.prototype.createReactComponent=function(t,e){var n=this;this.statelessComponent||(t.ref=function(t){n.componentInstance=t});var r=i.createElement(this.reactComponent,t),o=a.createPortal(r,this.eParentElement);this.portal=o,this.parentComponent.mountReactPortal(o,this,e)},o.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return this.unwrapComponent||(p.Utils.addCssClass(e,"ag-react-container"),t.reactContainer=e),e},o.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount},o.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)},o}(f);(l=s||(s={})).IdentityCheck="IdentityCheck",l.DeepValueCheck="DeepValueCheck",l.NoCheck="NoCheck";var m=function(){function t(){var t;this.strategyMap=((t={})[s.DeepValueCheck]=new C,t[s.IdentityCheck]=new d(function(t,e){return t===e}),t[s.NoCheck]=new d(function(t,e){return!0}),t)}return t.prototype.getStrategy=function(t){return this.strategyMap[t]},t}(),d=function(){function t(t){this.strategy=t}return t.prototype.areEqual=function(t,e){return this.strategy(t,e)},t}(),C=function(){function a(){}return a.prototype.areEqual=function(t,e){return a.areEquivalent(a.copy(t),a.copy(e))},a.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},a.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},{})},a.areEquivalent=function(e,n){if(e=a.unwrapStringOrNumber(e),n=a.unwrapStringOrNumber(n),e===n)return!0;if(null===e||null===n||typeof e!=typeof n)return!1;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}},a}(),y=function(r){function t(t,e){var n=r.call(this)||this;return n.reactComponent=t,n.parentComponent=e,n}return c(t,r),t.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},t.prototype.getReactComponentName=function(){return this.reactComponent.name},t.prototype.init=function(e){var n=this;return new p.Promise(function(t){n.eParentElement=document.createElement(n.parentComponent.props.componentWrappingElement||"div"),p.Utils.addCssClass(n.eParentElement,"ag-react-container"),e.reactContainer=n.eParentElement,n.createReactComponentLegacy(e,t)})},t.prototype.getGui=function(){return this.eParentElement},t.prototype.destroy=function(){a.unmountComponentAtNode(this.eParentElement)},t.prototype.createReactComponentLegacy=function(t,e){var n=this,r=i.createElement(this.reactComponent,t);this.parentComponent?a.unstable_renderSubtreeIntoContainer(this.parentComponent,r,this.eParentElement,function(){n.componentInstance=this,e(null)}):a.render(r,this.eParentElement,function(){n.componentInstance=this,e(null)})},t}(f),g=function(r){function o(t,e){var n=r.call(this,t,e)||this;return n.props=t,n.state=e,n.changeDetectionService=new m,n.api=null,n.portals=[],n.hasPendingPortalUpdate=!1,n}return c(o,r),o.prototype.render=function(){var e=this;return i.createElement("div",{style:this.createStyleForDiv(),ref:function(t){e.eGridDiv=t}},this.portals)},o.prototype.createStyleForDiv=function(){var e={height:"100%"},n=this.props.containerStyle;return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},o.prototype.componentDidMount=function(){var t={seedBeanInstances:{agGridReact:this}},e=this.props.gridOptions||{};u.hasChildColumns(this.props)&&(e.columnDefs=u.mapChildColumnDefs(this.props)),this.gridOptions=p.ComponentUtil.copyAttributesToGridOptions(e,this.props),new p.Grid(this.eGridDiv,this.gridOptions,t),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},o.prototype.shouldComponentUpdate=function(){return!1},o.prototype.waitForInstance=function(t,e,n){var r=this;if(void 0===n&&(n=0),this.api)if(t.isStatelesComponent()&&t.statelessComponentRendered())e(null);else if(!t.isStatelesComponent()&&t.getFrameworkComponentInstance())e(null);else{if(o.MAX_COMPONENT_CREATION_TIME<=n)return void console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+o.MAX_COMPONENT_CREATION_TIME+"ms");window.setTimeout(function(){return r.waitForInstance(t,e,n+5)},5)}else e(null)},o.prototype.mountReactPortal=function(t,e,n){this.portals=this.portals.concat([t]),this.batchUpdate(this.waitForInstance(e,n))},o.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},o.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},o.prototype.getStrategyTypeForProp=function(t){if("rowData"===t){if(this.props.rowDataChangeDetectionStrategy)return this.props.rowDataChangeDetectionStrategy;if(this.props.deltaRowDataMode)return s.IdentityCheck}return s.DeepValueCheck},o.prototype.componentWillReceiveProps=function(t){var e={};this.extractGridPropertyChanges(t,e),this.extractDeclarativeColDefChanges(t,e),p.ComponentUtil.processOnChange(e,this.gridOptions,this.api,this.columnApi)},o.prototype.extractDeclarativeColDefChanges=function(t,e){var n=!!t.debug;if(u.hasChildColumns(t)){var r=this.changeDetectionService.getStrategy(s.DeepValueCheck),o=this.gridOptions.columnDefs,i=u.mapChildColumnDefs(t);r.areEqual(o,i)||(n&&console.log("agGridReact: colDefs definitions changed"),e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:u.mapChildColumnDefs(t)})}},o.prototype.extractGridPropertyChanges=function(e,n){var r=this,o=!!e.debug;Object.keys(e).forEach(function(t){-1!==p.ComponentUtil.ALL_PROPERTIES.indexOf(t)&&(r.changeDetectionService.getStrategy(r.getStrategyTypeForProp(t)).areEqual(r.props[t],e[t])||(o&&console.log("agGridReact: ["+t+"] property changed"),n[t]={previousValue:r.props[t],currentValue:e[t]}))}),p.ComponentUtil.getEventCallbacks().forEach(function(t){r.props[t]!==e[t]&&(o&&console.log("agGridReact: ["+t+"] event callback changed"),n[t]={previousValue:r.props[t],currentValue:e[t]})})},o.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null)},o.MAX_COMPONENT_CREATION_TIME=1e3,o}(i.Component);function E(t,e){t.forEach(function(t){g[t]=e})}g.propTypes={gridOptions:e.object},E(p.ComponentUtil.getEventCallbacks(),e.func),E(p.ComponentUtil.BOOLEAN_PROPERTIES,e.bool),E(p.ComponentUtil.STRING_PROPERTIES,e.string),E(p.ComponentUtil.OBJECT_PROPERTIES,e.object),E(p.ComponentUtil.ARRAY_PROPERTIES,e.array),E(p.ComponentUtil.NUMBER_PROPERTIES,e.number),E(p.ComponentUtil.FUNCTION_PROPERTIES,e.func);var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createWrapper=function(t){return this.useLegacyReact()?new y(t,this.agGridReact):new h(t,this.agGridReact)},e.prototype.useLegacyReact=function(){return"function"!=typeof a.unstable_renderSubtreeIntoContainer||this.agGridReact&&this.agGridReact.gridOptions&&!this.agGridReact.gridOptions.reactNext},n([p.Autowired("agGridReact"),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:type",g)],e.prototype,"agGridReact",void 0),e=n([p.Bean("frameworkComponentWrapper")],e)}(p.BaseComponentWrapper);p.Grid.setFrameworkBeans([v]),t.AgGridReact=g,t.AgGridColumn=u,Object.defineProperty(t,"__esModule",{value:!0})});
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc