Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Merge branch '9.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
makinggoodsoftware committed Mar 29, 2017
2 parents 0c3ed01 + 910eeb6 commit 62c531b
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ag-grid-aurelia",
"version": "8.2.0",
"version": "9.0.0",
"homepage": "http://www.ag-grid.com/",
"authors": [
"Niall Crosby <[email protected]>"
Expand Down
4 changes: 3 additions & 1 deletion lib/agGridAurelia.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
import { ComponentAttached, ComponentDetached, Container, ViewResources, TaskQueue } from "aurelia-framework";
import { GridOptions, GridApi, ColumnApi } from "ag-grid/main";
import { AureliaFrameworkFactory } from "./aureliaFrameworkFactory";
import { AgGridColumn } from "./agGridColumn";
import { AgFullWidthRowTemplate } from './agTemplate';
export declare class AgGridAurelia implements ComponentAttached, ComponentDetached {
private taskQueue;
private auFrameworkFactory;
Expand All @@ -17,6 +18,7 @@ export declare class AgGridAurelia implements ComponentAttached, ComponentDetach
api: GridApi;
columnApi: ColumnApi;
columns: AgGridColumn[];
fullWidthRowTemplate: AgFullWidthRowTemplate;
constructor(element: Element, taskQueue: TaskQueue, auFrameworkFactory: AureliaFrameworkFactory, container: Container, viewResources: ViewResources);
attached(): void;
initGrid(): void;
Expand Down
11 changes: 10 additions & 1 deletion lib/agGridAurelia.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
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;
Expand All @@ -14,6 +14,7 @@ var aurelia_framework_1 = require("aurelia-framework");
var main_1 = require("ag-grid/main");
var aureliaFrameworkFactory_1 = require("./aureliaFrameworkFactory");
var agUtils_1 = require("./agUtils");
var agTemplate_1 = require("./agTemplate");
var AgGridAurelia = (function () {
function AgGridAurelia(element, taskQueue, auFrameworkFactory, container, viewResources) {
var _this = this;
Expand Down Expand Up @@ -55,6 +56,10 @@ var AgGridAurelia = (function () {
return column.toColDef();
});
}
if (this.fullWidthRowTemplate) {
this.gridOptions.fullWidthCellRendererFramework =
{ template: this.fullWidthRowTemplate.template };
}
new main_1.Grid(this._nativeElement, this.gridOptions, this.gridParams);
this.api = this.gridOptions.api;
this.columnApi = this.gridOptions.columnApi;
Expand Down Expand Up @@ -107,6 +112,10 @@ __decorate([
aurelia_framework_1.children('ag-grid-column'),
__metadata("design:type", Array)
], AgGridAurelia.prototype, "columns", void 0);
__decorate([
aurelia_framework_1.child('ag-full-width-row-template'),
__metadata("design:type", agTemplate_1.AgFullWidthRowTemplate)
], AgGridAurelia.prototype, "fullWidthRowTemplate", void 0);
AgGridAurelia = __decorate([
aurelia_framework_1.customElement('ag-grid-aurelia'),
agUtils_1.generateBindables(main_1.ComponentUtil.ALL_PROPERTIES.filter(function (property) { return property !== 'gridOptions'; })),
Expand Down
2 changes: 1 addition & 1 deletion lib/agGridColumn.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
import { ColDef } from "ag-grid/main";
import { AgCellTemplate, AgEditorTemplate, AgFilterTemplate } from "./agTemplate";
export declare class AgGridColumn {
Expand Down
6 changes: 4 additions & 2 deletions lib/agGridColumn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
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;
Expand Down Expand Up @@ -30,7 +30,9 @@ var AgGridColumn = AgGridColumn_1 = (function () {
delete colDef.cellTemplate;
}
if (this.editorTemplate) {
colDef.editable = true;
if (colDef.editable === undefined) {
colDef.editable = true;
}
colDef.cellEditorFramework = { template: this.editorTemplate.template };
delete colDef.editorTemplate;
}
Expand Down
6 changes: 5 additions & 1 deletion lib/agTemplate.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
import { TargetInstruction } from "aurelia-framework";
export declare class AgCellTemplate {
template: string;
Expand All @@ -12,3 +12,7 @@ export declare class AgFilterTemplate {
template: string;
constructor(targetInstruction: TargetInstruction);
}
export declare class AgFullWidthRowTemplate {
template: string;
constructor(targetInstruction: TargetInstruction);
}
16 changes: 15 additions & 1 deletion lib/agTemplate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
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;
Expand Down Expand Up @@ -72,3 +72,17 @@ AgFilterTemplate = __decorate([
__metadata("design:paramtypes", [aurelia_framework_1.TargetInstruction])
], AgFilterTemplate);
exports.AgFilterTemplate = AgFilterTemplate;
var AgFullWidthRowTemplate = (function () {
function AgFullWidthRowTemplate(targetInstruction) {
this.template = getTemplate(targetInstruction);
}
return AgFullWidthRowTemplate;
}());
AgFullWidthRowTemplate = __decorate([
aurelia_framework_1.customElement('ag-full-width-row-template'),
aurelia_framework_1.noView(),
aurelia_framework_1.autoinject(),
aurelia_framework_1.processContent(parseElement),
__metadata("design:paramtypes", [aurelia_framework_1.TargetInstruction])
], AgFullWidthRowTemplate);
exports.AgFullWidthRowTemplate = AgFullWidthRowTemplate;
2 changes: 1 addition & 1 deletion lib/agUtils.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
export declare function generateBindables(names: string[], bindingModeToUse?: any): any;
2 changes: 1 addition & 1 deletion lib/agUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var aurelia_framework_1 = require("aurelia-framework");
Expand Down
2 changes: 1 addition & 1 deletion lib/aureliaCellRendererComponent.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
import { ICellRenderer } from 'ag-grid/main';
export declare class AureliaCellRendererComponent implements ICellRenderer {
private view;
Expand Down
2 changes: 1 addition & 1 deletion lib/aureliaCellRendererComponent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var AureliaCellRendererComponent = (function () {
Expand Down
6 changes: 4 additions & 2 deletions lib/aureliaComponentFactory.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// ag-grid-aurelia v8.2.0
import { Container, ViewFactory } from "aurelia-framework";
// ag-grid-aurelia v9.0.0
import { Container, ViewFactory, TaskQueue } from "aurelia-framework";
import { ICellRendererComp, ICellEditorComp } from "ag-grid/main";
export declare class AureliaComponentFactory {
private taskQueue;
constructor(taskQueue: TaskQueue);
createRendererFromTemplate(container: Container, viewFactory: ViewFactory): {
new (): ICellRendererComp;
};
Expand Down
30 changes: 25 additions & 5 deletions lib/aureliaComponentFactory.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
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);
};
Object.defineProperty(exports, "__esModule", { value: true });
var aurelia_framework_1 = require("aurelia-framework");
var AureliaComponentFactory = (function () {
function AureliaComponentFactory() {
function AureliaComponentFactory(taskQueue) {
this.taskQueue = taskQueue;
}
AureliaComponentFactory.prototype.createRendererFromTemplate = function (container, viewFactory) {
var componentFactory = this;
var CellRendererComponent = (function () {
function CellRendererComponent() {
}
CellRendererComponent.prototype.init = function (params) {
var _this = this;
var bindingContext = { params: params };
this.view = viewFactory.create(container);
this.view.bind(bindingContext);
var controllers = this.view.controllers;
//initialize each controller
if (controllers && controllers.length) {
controllers.forEach(function (c) {
c.viewModel.params = params;
});
this.view.bind(bindingContext);
//ICellRenderer doesn't have a guiAttached method so
//we call attach on the queue;
componentFactory.taskQueue.queueMicroTask(function () { return _this.view.attached(); });
}
else {
this.view.bind(bindingContext);
}
};
CellRendererComponent.prototype.getGui = function () {
return this.view.fragment;
Expand All @@ -37,7 +56,6 @@ var AureliaComponentFactory = (function () {
CellEditor.prototype.init = function (params) {
var bindingContext = { params: params };
this.view = viewFactory.create(container);
this.view.bind(bindingContext);
var controllers = this.view.controllers;
//only one controller is allowed in editor template
if (controllers &&
Expand All @@ -51,6 +69,7 @@ var AureliaComponentFactory = (function () {
else {
console.error('The editor template component is missing an IEditorViewModel or it contains more than one component');
}
this.view.bind(bindingContext);
};
CellEditor.prototype.afterGuiAttached = function () {
this.view.attached();
Expand Down Expand Up @@ -97,6 +116,7 @@ var AureliaComponentFactory = (function () {
}());
AureliaComponentFactory = __decorate([
aurelia_framework_1.autoinject(),
aurelia_framework_1.transient()
aurelia_framework_1.transient(),
__metadata("design:paramtypes", [aurelia_framework_1.TaskQueue])
], AureliaComponentFactory);
exports.AureliaComponentFactory = AureliaComponentFactory;
2 changes: 1 addition & 1 deletion lib/aureliaFrameworkFactory.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
import { Container, ViewResources, ViewCompiler } from "aurelia-framework";
import { IFrameworkFactory, IFilterComp, ICellRendererFunc, ColDef, GridOptions, ICellRendererComp, ICellEditorComp } from "ag-grid/main";
import { AureliaComponentFactory } from "./aureliaComponentFactory";
Expand Down
13 changes: 11 additions & 2 deletions lib/aureliaFrameworkFactory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
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;
Expand Down Expand Up @@ -46,7 +46,16 @@ var AureliaFrameworkFactory = (function () {
}
};
AureliaFrameworkFactory.prototype.gridOptionsFullWidthCellRenderer = function (gridOptions) {
return this._baseFrameworkFactory.gridOptionsFullWidthCellRenderer(gridOptions);
if (gridOptions.fullWidthCellRendererFramework) {
if (!gridOptions.fullWidthCellRendererFramework.$viewFactory) {
gridOptions.fullWidthCellRendererFramework.$viewFactory =
this._viewCompiler.compile(gridOptions.fullWidthCellRendererFramework.template, this._viewResources);
}
return this._componentFactory.createRendererFromTemplate(this._container, gridOptions.fullWidthCellRendererFramework.$viewFactory);
}
else {
return this._baseFrameworkFactory.gridOptionsFullWidthCellRenderer(gridOptions);
}
};
AureliaFrameworkFactory.prototype.gridOptionsGroupRowRenderer = function (gridOptions) {
return this._baseFrameworkFactory.gridOptionsGroupRowRenderer(gridOptions);
Expand Down
2 changes: 1 addition & 1 deletion lib/editorViewModels.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
/**
* Implements all the methods of ICellEditor except for Init
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/editorViewModels.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ag-grid-aurelia v8.2.0
// ag-grid-aurelia v9.0.0
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ag-grid-aurelia",
"version": "8.2.0",
"version": "9.0.0",
"description": "ag-Grid Aurelia Component",
"main": "./main.js",
"typings": "./main.d.ts",
Expand Down Expand Up @@ -36,7 +36,7 @@
},
"peerDependencies": {
"aurelia-framework": "^1.0.0",
"ag-grid": "8.2.x"
"ag-grid": "9.0.x"
},
"dependencies": {

Expand Down

0 comments on commit 62c531b

Please sign in to comment.