ag-grid-react
Advanced tools
Comparing version 22.0.0-beta.2 to 22.0.0-beta.3
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
import { Component } from "react"; | ||
@@ -3,0 +3,0 @@ import * as AgGrid from "ag-grid-community"; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -1,5 +0,5 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
import * as React from "react"; | ||
import { Component, ReactPortal } from "react"; | ||
import { ColumnApi, GridApi, GridOptions } from "ag-grid-community"; | ||
import { ColumnApi, GridApi, GridOptions, Module } from "ag-grid-community"; | ||
import { ReactComponent } from "./reactComponent"; | ||
@@ -9,2 +9,3 @@ import { ChangeDetectionService, ChangeDetectionStrategyType } from "./changeDetectionService"; | ||
gridOptions?: GridOptions; | ||
modules?: Module[]; | ||
rowDataChangeDetectionStrategy?: ChangeDetectionStrategyType; | ||
@@ -23,2 +24,3 @@ componentWrappingElement?: string; | ||
hasPendingPortalUpdate: boolean; | ||
destroyed: boolean; | ||
protected eGridDiv: HTMLElement; | ||
@@ -25,0 +27,0 @@ private static MAX_COMPONENT_CREATION_TIME; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -16,11 +16,2 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
@@ -51,2 +42,3 @@ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
_this.hasPendingPortalUpdate = false; | ||
_this.destroyed = false; | ||
return _this; | ||
@@ -75,6 +67,9 @@ } | ||
AgGridReact.prototype.componentDidMount = function () { | ||
var modules = this.props.modules || []; | ||
var gridParams = { | ||
seedBeanInstances: { | ||
agGridReact: this | ||
} | ||
providedBeanInstances: { | ||
agGridReact: this, | ||
frameworkComponentWrapper: new ReactFrameworkComponentWrapper(this) | ||
}, | ||
modules: modules | ||
}; | ||
@@ -95,3 +90,3 @@ var gridOptions = this.props.gridOptions || {}; | ||
// if the grid has been destroyed in the meantime just resolve | ||
if (!this.api) { | ||
if (this.destroyed) { | ||
resolve(null); | ||
@@ -228,2 +223,3 @@ return; | ||
} | ||
this.destroyed = true; | ||
}; | ||
@@ -251,4 +247,6 @@ AgGridReact.MAX_COMPONENT_CREATION_TIME = 1000; // a second should be more than enough to instantiate a component | ||
__extends(ReactFrameworkComponentWrapper, _super); | ||
function ReactFrameworkComponentWrapper() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
function ReactFrameworkComponentWrapper(agGridReact) { | ||
var _this = _super.call(this) || this; | ||
_this.agGridReact = agGridReact; | ||
return _this; | ||
} | ||
@@ -258,11 +256,3 @@ ReactFrameworkComponentWrapper.prototype.createWrapper = function (UserReactComponent) { | ||
}; | ||
__decorate([ | ||
ag_grid_community_1.Autowired("agGridReact"), | ||
__metadata("design:type", AgGridReact) | ||
], ReactFrameworkComponentWrapper.prototype, "agGridReact", void 0); | ||
ReactFrameworkComponentWrapper = __decorate([ | ||
ag_grid_community_1.Bean("frameworkComponentWrapper") | ||
], ReactFrameworkComponentWrapper); | ||
return ReactFrameworkComponentWrapper; | ||
}(ag_grid_community_1.BaseComponentWrapper)); | ||
ag_grid_community_1.Grid.setFrameworkBeans([ReactFrameworkComponentWrapper]); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.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 v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
export declare enum ChangeDetectionStrategyType { | ||
@@ -3,0 +3,0 @@ IdentityCheck = "IdentityCheck", |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -71,2 +71,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
}; | ||
DeepValueStrategy.isNaN = function (value) { | ||
if (Number.isNaN) { | ||
return Number.isNaN(value); | ||
} | ||
// for ie11... | ||
return typeof (value) === 'number' && isNaN(value); | ||
}; | ||
/* | ||
@@ -87,2 +94,5 @@ * slightly modified, but taken from https://stackoverflow.com/questions/1068834/object-comparison-in-javascript | ||
return false; | ||
if (DeepValueStrategy.isNaN(a) && DeepValueStrategy.isNaN(b)) { | ||
return true; | ||
} | ||
if (a instanceof Date) { | ||
@@ -89,0 +99,0 @@ return b instanceof Date && a.valueOf() === b.valueOf(); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.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 v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
export default function generateNewKey(): string; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,3 +0,3 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
export { AgGridReact } from './agGridReact'; | ||
export { AgGridColumn } from './agGridColumn'; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
import { Promise } from 'ag-grid-community'; | ||
@@ -3,0 +3,0 @@ import { AgGridReact } from "./agGridReact"; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -66,3 +66,4 @@ var __extends = (this && this.__extends) || (function () { | ||
var reactComponent = React.createElement(this.reactComponent, params); | ||
var portal = ReactDOM.createPortal(reactComponent, this.eParentElement, keyGenerator_1.default()); | ||
var portal = ReactDOM.createPortal(reactComponent, this.eParentElement, keyGenerator_1.default() // fixed deltaRowModeRefreshCompRenderer | ||
); | ||
this.portal = portal; | ||
@@ -93,2 +94,3 @@ this.parentComponent.mountReactPortal(portal, this, resolve); | ||
ReactComponent.prototype.statelessComponentRendered = function () { | ||
// fixed fragmentsFuncRendererCreateDestroy funcRendererWithNan (changeDetectionService too for NaN) | ||
return this.eParentElement.childElementCount > 0 || this.eParentElement.childNodes.length > 0; | ||
@@ -95,0 +97,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
export declare const assignProperties: (to: {}, from: {}) => void; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-react v22.0.0-beta.1 | ||
// ag-grid-react v22.0.0-beta.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
{ | ||
"name": "ag-grid-react", | ||
"version": "22.0.0-beta.2", | ||
"version": "22.0.0-beta.3", | ||
"description": "ag-Grid React Component", | ||
@@ -10,5 +10,7 @@ "main": "main.js", | ||
"umd": "rollup -c", | ||
"test": "jest", | ||
"test": "gulp link-umd-e2e && jest && npm run cypress", | ||
"test:watch": "jest --watch", | ||
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand" | ||
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand", | ||
"cypress:open": "cypress open", | ||
"cypress": "cypress run --spec 'cypress/integration/**/*spec.js'" | ||
}, | ||
@@ -36,10 +38,12 @@ "repository": { | ||
"devDependencies": { | ||
"ag-grid-community": "^22.0.0-beta.0", | ||
"@types/jest": "24.0.18", | ||
"@types/react": "16.9.2", | ||
"@types/react-dom": "16.9.0", | ||
"ag-grid-community": "^21.2.0", | ||
"babel-preset-react-app": "^9.0.1", | ||
"cypress": "3.0.1", | ||
"enzyme": "^3.10.0", | ||
"enzyme-adapter-react-16": "^1.14.0", | ||
"gulp": "^4.0.0", | ||
"gulp-clean": "^0.4.0", | ||
"gulp-header": "^2.0.0", | ||
@@ -53,2 +57,3 @@ "gulp-merge": "^0.1.1", | ||
"jest-watch-typeahead": "0.3.1", | ||
"lnk": "^1.1.0", | ||
"react": "^16.9.0", | ||
@@ -68,3 +73,3 @@ "react-app-polyfill": "^1.0.2", | ||
"peerDependencies": { | ||
"ag-grid-community": "^21.2.0", | ||
"ag-grid-community": "~22.0.0", | ||
"react": "^16.3.0", | ||
@@ -125,3 +130,6 @@ "react-dom": "^16.3.0" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
@@ -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,s){"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)}function o(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 s=t.length-1;0<=s;s--)(o=t[s])&&(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 c,p=(n(u,c=i.Component),u.prototype.render=function(){return null},u.mapChildColumnDefs=function(t){return i.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<i.Children.count(t.children)},u.getChildColDefs=function(t){return i.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=c.call(this,t,e)||this;return n.props=t,n.state=e,n}function l(t,e){t.forEach(function(t){p[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 f=(h.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},h.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)},h.prototype.addMethod=function(t,e){this[t]=e},h);function h(){}var d=0;var m,C,y,g=(n(v,m=f),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 new s.Promise(function(t){n.eParentElement=n.createParentElement(e),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()});var r=i.createElement(this.reactComponent,t),o=a.createPortal(r,this.eParentElement,"agPortalKey_"+ ++d);this.portal=o,this.parentComponent.mountReactPortal(o,this,e)},v.prototype.addParentContainerStyleAndClasses=function(){var e=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&function(e,n){Object.keys(n).forEach(function(t){e[t]=n[t]})}(this.eParentElement.style,this.componentInstance.getReactContainerStyle()),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return s.Utils.addCssClass(e.eParentElement,t)}))},v.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return s.Utils.addCssClass(e,"ag-react-container"),t.reactContainer=e},v.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount||0<this.eParentElement.childNodes.length},v.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)},v);function v(t,e){var n=m.call(this)||this;return n.portal=null,n.componentWrappingElement="div",n.reactComponent=t,n.parentComponent=e,n.statelessComponent=v.isStateless(n.reactComponent),n}(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!0}),t)}var R=(O.prototype.areEqual=function(t,e){return this.strategy(t,e)},O);function O(t){this.strategy=t}var D=(T.prototype.areEqual=function(t,e){return T.areEquivalent(T.copy(t),T.copy(e))},T.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},T.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},{})},T.areEquivalent=function(e,n){if(e=T.unwrapStringOrNumber(e),n=T.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}},T);function T(){}var I,S=(n(k,I=i.Component),k.prototype.render=function(){var e=this;return i.createElement("div",{style:this.createStyleForDiv(),ref:function(t){e.eGridDiv=t}},this.portals)},k.prototype.createStyleForDiv=function(){var e={height:"100%"},n=this.props.containerStyle;return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},k.prototype.componentDidMount=function(){var t={seedBeanInstances:{agGridReact:this}},e=this.props.gridOptions||{};p.hasChildColumns(this.props)&&(e.columnDefs=p.mapChildColumnDefs(this.props)),this.gridOptions=s.ComponentUtil.copyAttributesToGridOptions(e,this.props),new s.Grid(this.eGridDiv,this.gridOptions,t),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},k.prototype.waitForInstance=function(t,e,n){var r=this;if(void 0===n&&(n=0),this.api)if(t.isStatelessComponent()&&t.statelessComponentRendered())e(null);else if(!t.isStatelessComponent()&&t.getFrameworkComponentInstance())e(null);else{if(k.MAX_COMPONENT_CREATION_TIME<=n)return void console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+k.MAX_COMPONENT_CREATION_TIME+"ms");window.setTimeout(function(){return r.waitForInstance(t,e,n+5)},5)}else e(null)},k.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;var r=Array(t),o=0;for(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))},k.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},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.props.deltaRowDataMode)return C.IdentityCheck}return C.DeepValueCheck},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=!!t.debug;if(p.hasChildColumns(t)){var r=this.changeDetectionService.getStrategy(C.DeepValueCheck),o=this.gridOptions.columnDefs,i=p.mapChildColumnDefs(t);r.areEqual(o,i)||(n&&console.log("agGridReact: colDefs definitions changed"),e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:p.mapChildColumnDefs(t)})}},k.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]})})},k.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null)},k.MAX_COMPONENT_CREATION_TIME=1e3,k);function k(t,e){var n=I.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}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 U,w=(n(_,U=s.BaseComponentWrapper),_.prototype.createWrapper=function(t){return new g(t,this.agGridReact)},o([s.Autowired("agGridReact"),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:type",S)],_.prototype,"agGridReact",void 0),_=o([s.Bean("frameworkComponentWrapper")],_));function _(){return null!==U&&U.apply(this,arguments)||this}s.Grid.setFrameworkBeans([w]),t.AgGridReact=S,t.AgGridColumn=p,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,s){"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,p=(n(c,o=i.Component),c.prototype.render=function(){return null},c.mapChildColumnDefs=function(t){return i.Children.map(t.children,function(t){return c.toColDef(t.props)})},c.toColDef=function(t){var e=c.createColDefFromGridColumn(t);return c.hasChildColumns(t)&&(e.children=c.getChildColDefs(t.children)),e},c.hasChildColumns=function(t){return 0<i.Children.count(t.children)},c.getChildColDefs=function(t){return i.Children.map(t,function(t){return c.createColDefFromGridColumn(t.props)})},c.createColDefFromGridColumn=function(t){var e={};return c.assign(e,t),delete e.children,e},c.assign=function(t,e){return[e].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},t)},c);function c(t,e){var n=o.call(this,t,e)||this;return n.props=t,n.state=e,n}function u(t,e){t.forEach(function(t){p[t]=e})}u(s.ColDefUtil.BOOLEAN_PROPERTIES,e.bool),u(s.ColDefUtil.STRING_PROPERTIES,e.string),u(s.ColDefUtil.OBJECT_PROPERTIES,e.object),u(s.ColDefUtil.ARRAY_PROPERTIES,e.array),u(s.ColDefUtil.NUMBER_PROPERTIES,e.number),u(s.ColDefUtil.FUNCTION_PROPERTIES,e.func);var l=(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 h=0;var d,m,C,y=(n(g,d=l),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 new s.Promise(function(t){n.eParentElement=n.createParentElement(e),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()});var r=i.createElement(this.reactComponent,t),o=a.createPortal(r,this.eParentElement,"agPortalKey_"+ ++h);this.portal=o,this.parentComponent.mountReactPortal(o,this,e)},g.prototype.addParentContainerStyleAndClasses=function(){var e=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&function(e,n){Object.keys(n).forEach(function(t){e[t]=n[t]})}(this.eParentElement.style,this.componentInstance.getReactContainerStyle()),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return s.Utils.addCssClass(e.eParentElement,t)}))},g.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return s.Utils.addCssClass(e,"ag-react-container"),t.reactContainer=e},g.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount||0<this.eParentElement.childNodes.length},g.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)},g);function g(t,e){var n=d.call(this)||this;return n.portal=null,n.componentWrappingElement="div",n.reactComponent=t,n.parentComponent=e,n.statelessComponent=g.isStateless(n.reactComponent),n}(C=m=m||{}).IdentityCheck="IdentityCheck",C.DeepValueCheck="DeepValueCheck",C.NoCheck="NoCheck";var E=(v.prototype.getStrategy=function(t){return this.strategyMap[t]},v);function v(){var t;this.strategyMap=((t={})[m.DeepValueCheck]=new O,t[m.IdentityCheck]=new P(function(t,e){return t===e}),t[m.NoCheck]=new P(function(t,e){return!0}),t)}var P=(R.prototype.areEqual=function(t,e){return this.strategy(t,e)},R);function R(t){this.strategy=t}var O=(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,I=(n(S,T=i.Component),S.prototype.render=function(){var e=this;return i.createElement("div",{style:this.createStyleForDiv(),ref:function(t){e.eGridDiv=t}},this.portals)},S.prototype.createStyleForDiv=function(){var e={height:"100%"},n=this.props.containerStyle;return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},S.prototype.componentDidMount=function(){var t=this.props.modules||[],e={providedBeanInstances:{agGridReact:this,frameworkComponentWrapper:new b(this)},modules:t},n=this.props.gridOptions||{};p.hasChildColumns(this.props)&&(n.columnDefs=p.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},S.prototype.waitForInstance=function(t,e,n){var r=this;if(void 0===n&&(n=0),this.destroyed)e(null);else if(t.isStatelessComponent()&&t.statelessComponentRendered())e(null);else if(!t.isStatelessComponent()&&t.getFrameworkComponentInstance())e(null);else{if(S.MAX_COMPONENT_CREATION_TIME<=n)return void console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+S.MAX_COMPONENT_CREATION_TIME+"ms");window.setTimeout(function(){return r.waitForInstance(t,e,n+5)},5)}},S.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;var r=Array(t),o=0;for(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))},S.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},S.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},S.prototype.getStrategyTypeForProp=function(t){if("rowData"===t){if(this.props.rowDataChangeDetectionStrategy)return this.props.rowDataChangeDetectionStrategy;if(this.props.deltaRowDataMode)return m.IdentityCheck}return m.DeepValueCheck},S.prototype.shouldComponentUpdate=function(t){return this.processPropsChanges(this.props,t),!1},S.prototype.componentDidUpdate=function(t){this.processPropsChanges(t,this.props)},S.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)},S.prototype.extractDeclarativeColDefChanges=function(t,e){var n=!!t.debug;if(p.hasChildColumns(t)){var r=this.changeDetectionService.getStrategy(m.DeepValueCheck),o=this.gridOptions.columnDefs,i=p.mapChildColumnDefs(t);r.areEqual(o,i)||(n&&console.log("agGridReact: colDefs definitions changed"),e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:p.mapChildColumnDefs(t)})}},S.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]})})},S.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null),this.destroyed=!0},S.MAX_COMPONENT_CREATION_TIME=1e3,S);function S(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 N(t,e){t.forEach(function(t){I[t]=e})}I.propTypes={gridOptions:e.object},N(s.ComponentUtil.getEventCallbacks(),e.func),N(s.ComponentUtil.BOOLEAN_PROPERTIES,e.bool),N(s.ComponentUtil.STRING_PROPERTIES,e.string),N(s.ComponentUtil.OBJECT_PROPERTIES,e.object),N(s.ComponentUtil.ARRAY_PROPERTIES,e.array),N(s.ComponentUtil.NUMBER_PROPERTIES,e.number),N(s.ComponentUtil.FUNCTION_PROPERTIES,e.func);var k,b=(n(U,k=s.BaseComponentWrapper),U.prototype.createWrapper=function(t){return new y(t,this.agGridReact)},U);function U(t){var e=k.call(this)||this;return e.agGridReact=t,e}t.AgGridReact=I,t.AgGridColumn=p,Object.defineProperty(t,"__esModule",{value:!0})}); |
59925
31
25
869