ag-grid-aurelia-plugin 31.3.6 → 31.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
- // ag-grid-aurelia-plugin v31.3.4
2
- import type { GridOptions } from "ag-grid-community";
3
- import { ColumnApi, GridApi } from "ag-grid-community";
1
+ // ag-grid-aurelia-plugin v31.3.7
2
+ import type { ColumnApi, GridApi, GridOptions } from "ag-grid-community";
4
3
  import { ComponentAttached, ComponentDetached, Container, TaskQueue, ViewResources } from "aurelia-framework";
5
4
  import { AureliaFrameworkFactory } from "./aureliaFrameworkFactory";
6
5
  import { AgGridColumn } from "./agGridColumn";
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -8,8 +8,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ import { autoinject, bindable, child, children, Container, customElement, inlineView, TaskQueue, ViewResources } from "aurelia-framework";
11
12
  import { ComponentUtil, Grid } from "ag-grid-community";
12
- import { bindable, child, children, Container, customElement, inlineView, TaskQueue, ViewResources } from "aurelia-framework";
13
13
  import { AureliaFrameworkFactory } from "./aureliaFrameworkFactory";
14
14
  import { generateBindables } from "./agUtils";
15
15
  import { AgDateTemplate, AgFullWidthRowTemplate } from './agTemplate';
@@ -62,6 +62,7 @@ let AgGridAurelia = class AgGridAurelia {
62
62
  this.auFrameworkFactory.setViewResources(this.viewResources);
63
63
  this.aureliaFrameworkComponentWrapper.setContainer(this.container);
64
64
  this.aureliaFrameworkComponentWrapper.setViewResources(this.viewResources);
65
+ this.gridOptions = ComponentUtil.combineAttributesAndGridOptions(this.gridOptions, this);
65
66
  this.gridParams = {
66
67
  globalEventListener: this.globalEventListener.bind(this),
67
68
  frameworkFactory: this.auFrameworkFactory,
@@ -80,8 +81,13 @@ let AgGridAurelia = class AgGridAurelia {
80
81
  { template: this.fullWidthRowTemplate.template };
81
82
  }
82
83
  if (this.dateTemplate) {
83
- this.gridOptions.dateComponentFramework =
84
- { template: this.dateTemplate.template };
84
+ this.gridOptions.dataTypeDefinitions = {
85
+ date: {
86
+ baseDataType: 'date',
87
+ extendsDataType: 'date',
88
+ valueFormatter: () => this.dateTemplate.template
89
+ }
90
+ };
85
91
  }
86
92
  new Grid(this._nativeElement, this.gridOptions, this.gridParams);
87
93
  this.api = this.gridOptions.api;
@@ -149,6 +155,7 @@ AgGridAurelia = __decorate([
149
155
  // <slot> is required for @children to work. https://github.com/aurelia/templating/issues/451#issuecomment-254206622
150
156
  ,
151
157
  inlineView(`<template><slot></slot></template>`),
158
+ autoinject(),
152
159
  __metadata("design:paramtypes", [Element,
153
160
  TaskQueue,
154
161
  AureliaFrameworkFactory,
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  import { ColDef } from "ag-grid-community";
3
3
  import { AgCellTemplate, AgEditorTemplate, AgFilterTemplate, AgHeaderGroupTemplate, AgHeaderTemplate, AgPinnedRowTemplate } from "./agTemplate";
4
4
  export declare class AgGridColumn {
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  import { TargetInstruction } from "aurelia-framework";
3
3
  export declare class AgCellTemplate {
4
4
  template: string;
package/lib/agTemplate.js CHANGED
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
package/lib/agUtils.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  export declare function generateBindables(names: string[], bindingModeToUse?: any): any;
package/lib/agUtils.js CHANGED
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  import { BindableProperty, HtmlBehaviorResource, metadata } from "aurelia-framework";
3
3
  export function generateBindables(names, bindingModeToUse) {
4
4
  return function (target, key, descriptor) {
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  import { Container, TaskQueue, ViewCompiler, ViewResources } from "aurelia-framework";
3
3
  import { BaseComponentWrapper, FrameworkComponentWrapper, WrappableInterface } from 'ag-grid-community';
4
4
  export declare class AureliaFrameworkComponentWrapper extends BaseComponentWrapper<WrappableInterface> implements FrameworkComponentWrapper {
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,13 +1,9 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  import { Container, ViewResources } from "aurelia-framework";
3
- import { IFrameworkOverrides, AgPromise, FrameworkOverridesIncomingSource } from "ag-grid-community";
3
+ import { IFrameworkOverrides, AgPromise } from "ag-grid-community";
4
4
  export declare class AureliaFrameworkFactory implements IFrameworkOverrides {
5
5
  setInterval(action: any, interval?: any): AgPromise<number>;
6
- addEventListener(element: HTMLElement, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
7
- wrapIncoming: <T>(callback: () => T, source?: FrameworkOverridesIncomingSource) => T;
8
- wrapOutgoing: <T>(callback: () => T) => T;
9
6
  shouldWrapOutgoing?: boolean;
10
- frameworkComponent(name: string, components?: any): void;
11
7
  isFrameworkComponent(comp: any): boolean;
12
8
  renderingEngine: "vanilla" | "react";
13
9
  getDocLink(path?: string): string;
@@ -16,6 +12,9 @@ export declare class AureliaFrameworkFactory implements IFrameworkOverrides {
16
12
  private _baseFrameworkFactory;
17
13
  setContainer(container: Container): void;
18
14
  setViewResources(viewResources: ViewResources): void;
19
- setTimeout(action: any, timeout?: any): void;
20
- addEventListenerOutsideAngular(element: HTMLElement, type: string, listener: EventListener | EventListenerObject, useCapture?: boolean): void;
15
+ setTimeout(action: any, interval?: any): void;
16
+ addEventListener(element: HTMLElement, type: string, listener: EventListener | EventListenerObject, useCapture?: boolean): void;
17
+ wrapIncoming<T>(callback: () => T, source?: any): T;
18
+ wrapOutgoing<T>(callback: () => T, source?: any): T;
19
+ frameworkComponent(name: string): any;
21
20
  }
@@ -1,4 +1,4 @@
1
- // ag-grid-aurelia-plugin v31.3.4
1
+ // ag-grid-aurelia-plugin v31.3.7
2
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -6,20 +6,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
8
  import { autoinject, transient } from "aurelia-framework";
9
- import { VanillaFrameworkOverrides } from "ag-grid-community";
9
+ import { VanillaFrameworkOverrides, AgPromise } from "ag-grid-community";
10
10
  let AureliaFrameworkFactory = class AureliaFrameworkFactory {
11
11
  setInterval(action, interval) {
12
- throw new Error("Method not implemented.");
13
- }
14
- addEventListener(element, type, listener, options) {
15
- throw new Error("Method not implemented.");
12
+ return new AgPromise(resolve => {
13
+ resolve(window.setInterval(action, interval));
14
+ });
16
15
  }
17
- wrapIncoming;
18
- wrapOutgoing;
19
16
  shouldWrapOutgoing;
20
- frameworkComponent(name, components) {
21
- throw new Error("Method not implemented.");
22
- }
23
17
  isFrameworkComponent(comp) {
24
18
  throw new Error("Method not implemented.");
25
19
  }
@@ -29,18 +23,27 @@ let AureliaFrameworkFactory = class AureliaFrameworkFactory {
29
23
  }
30
24
  _container;
31
25
  _viewResources;
32
- _baseFrameworkFactory = new VanillaFrameworkOverrides(); // todo - inject this
26
+ _baseFrameworkFactory = new VanillaFrameworkOverrides();
33
27
  setContainer(container) {
34
28
  this._container = container;
35
29
  }
36
30
  setViewResources(viewResources) {
37
31
  this._viewResources = viewResources;
38
32
  }
39
- setTimeout(action, timeout) {
40
- window.setTimeout(action, timeout);
33
+ setTimeout(action, interval) {
34
+ this._baseFrameworkFactory.setInterval(action, interval);
35
+ }
36
+ addEventListener(element, type, listener, useCapture) {
37
+ this._baseFrameworkFactory.addEventListener(element, type, listener, useCapture);
38
+ }
39
+ wrapIncoming(callback, source) {
40
+ return this._baseFrameworkFactory.wrapIncoming(callback, source);
41
+ }
42
+ wrapOutgoing(callback, source) {
43
+ return this._baseFrameworkFactory.wrapOutgoing(callback);
41
44
  }
42
- addEventListenerOutsideAngular(element, type, listener, useCapture) {
43
- element.addEventListener(type, listener, useCapture);
45
+ frameworkComponent(name) {
46
+ return this._baseFrameworkFactory.frameworkComponent(name);
44
47
  }
45
48
  };
46
49
  AureliaFrameworkFactory = __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-grid-aurelia-plugin",
3
- "version": "31.3.6",
3
+ "version": "31.3.7",
4
4
  "description": "ag-Grid Aurelia Component, a fork of Niall Crosby <niall.crosby@gmail.com>",
5
5
  "credits": "Niall Crosby <niall.crosby@gmail.com>",
6
6
  "main": "./main.js",
@@ -1,25 +1,24 @@
1
1
  import type {
2
+ ColumnApi,
3
+ GridApi,
2
4
  GridOptions,
3
5
  GridParams
4
6
  } from "ag-grid-community";
7
+
5
8
  import {
6
- ColumnApi,
7
- ComponentUtil,
8
- Grid,
9
- GridApi
10
- } from "ag-grid-community";
11
- import {
12
- ComponentAttached,
13
- ComponentDetached,
9
+ autoinject,
14
10
  bindable,
15
11
  child,
16
12
  children,
13
+ ComponentAttached,
14
+ ComponentDetached,
17
15
  Container,
18
16
  customElement,
19
17
  inlineView,
20
18
  TaskQueue,
21
19
  ViewResources
22
20
  } from "aurelia-framework";
21
+ import {ComponentUtil, Grid} from "ag-grid-community";
23
22
  import {AureliaFrameworkFactory} from "./aureliaFrameworkFactory";
24
23
  import {AgGridColumn} from "./agGridColumn";
25
24
  import {generateBindables} from "./agUtils";
@@ -35,6 +34,7 @@ interface IPropertyChanges {
35
34
  @generateBindables(ComponentUtil.EVENTS)
36
35
  // <slot> is required for @children to work. https://github.com/aurelia/templating/issues/451#issuecomment-254206622
37
36
  @inlineView(`<template><slot></slot></template>`)
37
+ @autoinject()
38
38
  export class AgGridAurelia implements ComponentAttached, ComponentDetached {
39
39
  // not intended for user to interact with. so putting _ in so if user gets reference
40
40
  // to this object, they kind'a know it's not part of the agreed interface
@@ -93,6 +93,7 @@ export class AgGridAurelia implements ComponentAttached, ComponentDetached {
93
93
  this.aureliaFrameworkComponentWrapper.setContainer(this.container);
94
94
  this.aureliaFrameworkComponentWrapper.setViewResources(this.viewResources);
95
95
 
96
+ this.gridOptions = ComponentUtil.combineAttributesAndGridOptions(this.gridOptions, this);
96
97
  this.gridParams = <any>{
97
98
  globalEventListener: this.globalEventListener.bind(this),
98
99
  frameworkFactory: this.auFrameworkFactory,
@@ -114,8 +115,13 @@ export class AgGridAurelia implements ComponentAttached, ComponentDetached {
114
115
  }
115
116
 
116
117
  if (this.dateTemplate) {
117
- (<any>this.gridOptions).dateComponentFramework =
118
- {template: this.dateTemplate.template};
118
+ this.gridOptions.dataTypeDefinitions = {
119
+ date: {
120
+ baseDataType: 'date',
121
+ extendsDataType: 'date',
122
+ valueFormatter: () => this.dateTemplate.template
123
+ }
124
+ };
119
125
  }
120
126
 
121
127
  new Grid(this._nativeElement, this.gridOptions, this.gridParams);
@@ -1,21 +1,15 @@
1
1
  import {autoinject, Container, transient, ViewResources} from "aurelia-framework";
2
- import {VanillaFrameworkOverrides, IFrameworkOverrides, AgPromise, FrameworkOverridesIncomingSource} from "ag-grid-community";
2
+ import {VanillaFrameworkOverrides, IFrameworkOverrides, AgPromise} from "ag-grid-community";
3
3
 
4
4
  @autoinject()
5
5
  @transient()
6
6
  export class AureliaFrameworkFactory implements IFrameworkOverrides {
7
7
  setInterval(action: any, interval?: any): AgPromise<number> {
8
- throw new Error("Method not implemented.");
9
- }
10
- addEventListener(element: HTMLElement, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void {
11
- throw new Error("Method not implemented.");
8
+ return new AgPromise(resolve => {
9
+ resolve(window.setInterval(action, interval));
10
+ });
12
11
  }
13
- wrapIncoming: <T>(callback: () => T, source?: FrameworkOverridesIncomingSource) => T;
14
- wrapOutgoing: <T>(callback: () => T) => T;
15
12
  shouldWrapOutgoing?: boolean;
16
- frameworkComponent(name: string, components?: any) {
17
- throw new Error("Method not implemented.");
18
- }
19
13
  isFrameworkComponent(comp: any): boolean {
20
14
  throw new Error("Method not implemented.");
21
15
  }
@@ -25,7 +19,7 @@ export class AureliaFrameworkFactory implements IFrameworkOverrides {
25
19
  }
26
20
  private _container: Container;
27
21
  private _viewResources: ViewResources;
28
- private _baseFrameworkFactory: IFrameworkOverrides = new VanillaFrameworkOverrides(); // todo - inject this
22
+ private _baseFrameworkFactory: IFrameworkOverrides = new VanillaFrameworkOverrides();
29
23
 
30
24
  public setContainer(container: Container): void {
31
25
  this._container = container;
@@ -35,11 +29,26 @@ export class AureliaFrameworkFactory implements IFrameworkOverrides {
35
29
  this._viewResources = viewResources;
36
30
  }
37
31
 
38
- setTimeout(action: any, timeout?: any): void {
39
- window.setTimeout(action, timeout);
32
+ setTimeout(action: any, interval?: any): void {
33
+ this._baseFrameworkFactory.setInterval(action, interval);
34
+ }
35
+
36
+ addEventListener(element: HTMLElement, type: string, listener: EventListener | EventListenerObject, useCapture?: boolean): void {
37
+ this._baseFrameworkFactory.addEventListener(element, type, listener, useCapture);
38
+ }
39
+
40
+ wrapIncoming<T>(callback: () => T, source?: any): T {
41
+ return this._baseFrameworkFactory.wrapIncoming(callback, source);
40
42
  }
41
43
 
42
- addEventListenerOutsideAngular(element: HTMLElement, type: string, listener: EventListener | EventListenerObject, useCapture?: boolean): void {
43
- element.addEventListener(type, listener, useCapture);
44
+ wrapOutgoing<T>(callback: () => T, source?: any): T {
45
+ return this._baseFrameworkFactory.wrapOutgoing(callback);
44
46
  }
47
+
48
+ frameworkComponent(name: string): any {
49
+ return this._baseFrameworkFactory.frameworkComponent(name);
50
+ }
51
+
52
+ // Add any additional missing methods based on the IFrameworkOverrides interface
53
+ // You may need to check the ag-grid documentation for the complete interface
45
54
  }