ag-grid-aurelia-plugin 31.3.10 → 31.3.12

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,33 +1,33 @@
1
- // ag-grid-aurelia-plugin v31.3.8
2
- import type { GridApi, GridOptions } from "ag-grid-community";
3
- import { ComponentAttached, ComponentDetached, Container, TaskQueue, ViewResources } from "aurelia-framework";
4
- import { AureliaFrameworkFactory } from "./aureliaFrameworkFactory";
5
- import { AgGridColumn } from "./agGridColumn";
6
- import { AgDateTemplate, AgFullWidthRowTemplate } from './agTemplate';
7
- import { AureliaFrameworkComponentWrapper } from "./aureliaFrameworkComponentWrapper";
8
- export declare class AgGridAurelia implements ComponentAttached, ComponentDetached {
9
- private taskQueue;
10
- private auFrameworkFactory;
11
- private container;
12
- private viewResources;
13
- private aureliaFrameworkComponentWrapper;
14
- private _nativeElement;
15
- private _initialised;
16
- private _destroyed;
17
- gridOptions: GridOptions;
18
- context: any;
19
- private gridParams;
20
- api: GridApi;
21
- columns: AgGridColumn[];
22
- fullWidthRowTemplate: AgFullWidthRowTemplate;
23
- dateTemplate: AgDateTemplate;
24
- constructor(element: Element, taskQueue: TaskQueue, auFrameworkFactory: AureliaFrameworkFactory, container: Container, viewResources: ViewResources, aureliaFrameworkComponentWrapper: AureliaFrameworkComponentWrapper);
25
- attached(): void;
26
- initGrid(): void;
27
- /**
28
- * Called by Aurelia whenever a bound property changes
29
- */
30
- propertyChanged(propertyName: string, newValue: any, oldValue: any): void;
31
- detached(): void;
32
- private globalEventListener;
33
- }
1
+ // ag-grid-aurelia-plugin v31.3.10
2
+ import type { GridApi, GridOptions } from "ag-grid-community";
3
+ import { ComponentAttached, ComponentDetached, Container, TaskQueue, ViewResources } from "aurelia-framework";
4
+ import { AureliaFrameworkFactory } from "./aureliaFrameworkFactory";
5
+ import { AgGridColumn } from "./agGridColumn";
6
+ import { AgDateTemplate, AgFullWidthRowTemplate } from './agTemplate';
7
+ import { AureliaFrameworkComponentWrapper } from "./aureliaFrameworkComponentWrapper";
8
+ export declare class AgGridAurelia implements ComponentAttached, ComponentDetached {
9
+ private taskQueue;
10
+ private auFrameworkFactory;
11
+ private container;
12
+ private viewResources;
13
+ private aureliaFrameworkComponentWrapper;
14
+ private _nativeElement;
15
+ private _initialised;
16
+ private _destroyed;
17
+ gridOptions: GridOptions;
18
+ context: any;
19
+ private gridParams;
20
+ api: GridApi;
21
+ columns: AgGridColumn[];
22
+ fullWidthRowTemplate: AgFullWidthRowTemplate;
23
+ dateTemplate: AgDateTemplate;
24
+ constructor(element: Element, taskQueue: TaskQueue, auFrameworkFactory: AureliaFrameworkFactory, container: Container, viewResources: ViewResources, aureliaFrameworkComponentWrapper: AureliaFrameworkComponentWrapper);
25
+ attached(): void;
26
+ initGrid(): void;
27
+ /**
28
+ * Called by Aurelia whenever a bound property changes
29
+ */
30
+ propertyChanged(propertyName: string, newValue: any, oldValue: any): void;
31
+ detached(): void;
32
+ private globalEventListener;
33
+ }
@@ -1,163 +1,163 @@
1
- // ag-grid-aurelia-plugin v31.3.8
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- 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;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- import { autoinject, bindable, child, children, Container, customElement, inlineView, TaskQueue, ViewResources } from "aurelia-framework";
12
- import { ComponentUtil, createGrid } from "ag-grid-community";
13
- import { AureliaFrameworkFactory } from "./aureliaFrameworkFactory";
14
- import { generateBindables } from "./agUtils";
15
- import { AgDateTemplate, AgFullWidthRowTemplate } from './agTemplate';
16
- import { AureliaFrameworkComponentWrapper } from "./aureliaFrameworkComponentWrapper";
17
- let AgGridAurelia = class AgGridAurelia {
18
- taskQueue;
19
- auFrameworkFactory;
20
- container;
21
- viewResources;
22
- aureliaFrameworkComponentWrapper;
23
- // not intended for user to interact with. so putting _ in so if user gets reference
24
- // to this object, they kind'a know it's not part of the agreed interface
25
- _nativeElement;
26
- _initialised = false;
27
- _destroyed = false;
28
- gridOptions;
29
- context;
30
- gridParams;
31
- // making these public, so they are accessible to people using the aurelia component references
32
- api;
33
- columns = [];
34
- fullWidthRowTemplate;
35
- dateTemplate;
36
- constructor(element, taskQueue, auFrameworkFactory, container, viewResources, aureliaFrameworkComponentWrapper) {
37
- this.taskQueue = taskQueue;
38
- this.auFrameworkFactory = auFrameworkFactory;
39
- this.container = container;
40
- this.viewResources = viewResources;
41
- this.aureliaFrameworkComponentWrapper = aureliaFrameworkComponentWrapper;
42
- this._nativeElement = element;
43
- // create all the events generically. this is done generically so that
44
- // if the list of grid events change, we don't need to change this code.
45
- ComponentUtil.EVENTS.forEach((eventName) => {
46
- //create an empty event
47
- this[eventName] = () => {
48
- };
49
- });
50
- }
51
- attached() {
52
- // initialize the grid in the queue
53
- // because of bug in @children
54
- // https://github.com/aurelia/templating/issues/403
55
- this.taskQueue.queueTask(this.initGrid.bind(this));
56
- }
57
- initGrid() {
58
- this._initialised = false;
59
- this._destroyed = false;
60
- this.auFrameworkFactory.setContainer(this.container);
61
- this.auFrameworkFactory.setViewResources(this.viewResources);
62
- this.aureliaFrameworkComponentWrapper.setContainer(this.container);
63
- this.aureliaFrameworkComponentWrapper.setViewResources(this.viewResources);
64
- this.gridOptions = ComponentUtil.combineAttributesAndGridOptions(this.gridOptions, this);
65
- this.gridParams = {
66
- globalEventListener: this.globalEventListener.bind(this),
67
- frameworkFactory: this.auFrameworkFactory,
68
- seedBeanInstances: {
69
- frameworkComponentWrapper: this.aureliaFrameworkComponentWrapper
70
- }
71
- };
72
- if (this.columns && this.columns.length > 0) {
73
- this.gridOptions.columnDefs = this.columns
74
- .map((column) => {
75
- return column.toColDef();
76
- });
77
- }
78
- if (this.fullWidthRowTemplate) {
79
- this.gridOptions.fullWidthCellRenderer =
80
- { template: this.fullWidthRowTemplate.template };
81
- }
82
- if (this.dateTemplate) {
83
- this.gridOptions.dataTypeDefinitions = {
84
- date: {
85
- baseDataType: 'date',
86
- extendsDataType: 'date',
87
- valueFormatter: () => this.dateTemplate.template
88
- }
89
- };
90
- }
91
- this.api = createGrid(this._nativeElement, this.gridOptions, this.gridParams);
92
- this._initialised = true;
93
- }
94
- /**
95
- * Called by Aurelia whenever a bound property changes
96
- */
97
- propertyChanged(propertyName, newValue, oldValue) {
98
- // emulate an Angular2 SimpleChanges Object
99
- let changes = {};
100
- changes[propertyName] = { currentValue: newValue, previousValue: oldValue };
101
- if (this._initialised) {
102
- ComponentUtil.processOnChange(changes, this.api);
103
- }
104
- }
105
- detached() {
106
- if (this._initialised) {
107
- // need to do this before the destroy, so we know not to emit any events
108
- // while tearing down the grid.
109
- this._destroyed = true;
110
- this.api.destroy();
111
- }
112
- }
113
- globalEventListener(eventType, event) {
114
- // if we are tearing down, don't emit events
115
- if (this._destroyed) {
116
- return;
117
- }
118
- // generically look up the eventType
119
- let emitter = this[eventType];
120
- if (emitter) {
121
- emitter(event);
122
- }
123
- else {
124
- console.log('ag-Grid-aurelia: could not find EventEmitter: ' + eventType);
125
- }
126
- }
127
- };
128
- __decorate([
129
- bindable(),
130
- __metadata("design:type", Object)
131
- ], AgGridAurelia.prototype, "gridOptions", void 0);
132
- __decorate([
133
- bindable(),
134
- __metadata("design:type", Object)
135
- ], AgGridAurelia.prototype, "context", void 0);
136
- __decorate([
137
- children('ag-grid-column'),
138
- __metadata("design:type", Array)
139
- ], AgGridAurelia.prototype, "columns", void 0);
140
- __decorate([
141
- child('ag-full-width-row-template'),
142
- __metadata("design:type", AgFullWidthRowTemplate)
143
- ], AgGridAurelia.prototype, "fullWidthRowTemplate", void 0);
144
- __decorate([
145
- child('ag-date-template'),
146
- __metadata("design:type", AgDateTemplate)
147
- ], AgGridAurelia.prototype, "dateTemplate", void 0);
148
- AgGridAurelia = __decorate([
149
- customElement('ag-grid-aurelia'),
150
- generateBindables(ComponentUtil.ALL_PROPERTIES.filter((property) => property !== 'gridOptions')),
151
- generateBindables(ComponentUtil.EVENTS)
152
- // <slot> is required for @children to work. https://github.com/aurelia/templating/issues/451#issuecomment-254206622
153
- ,
154
- inlineView(`<template><slot></slot></template>`),
155
- autoinject(),
156
- __metadata("design:paramtypes", [Element,
157
- TaskQueue,
158
- AureliaFrameworkFactory,
159
- Container,
160
- ViewResources,
161
- AureliaFrameworkComponentWrapper])
162
- ], AgGridAurelia);
163
- export { AgGridAurelia };
1
+ // ag-grid-aurelia-plugin v31.3.10
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ import { autoinject, bindable, child, children, Container, customElement, inlineView, TaskQueue, ViewResources, } from "aurelia-framework";
12
+ import { ComponentUtil, createGrid } from "ag-grid-community-v31";
13
+ import { AureliaFrameworkFactory } from "./aureliaFrameworkFactory";
14
+ import { generateBindables } from "./agUtils";
15
+ import { AgDateTemplate, AgFullWidthRowTemplate } from './agTemplate';
16
+ import { AureliaFrameworkComponentWrapper } from "./aureliaFrameworkComponentWrapper";
17
+ let AgGridAurelia = class AgGridAurelia {
18
+ taskQueue;
19
+ auFrameworkFactory;
20
+ container;
21
+ viewResources;
22
+ aureliaFrameworkComponentWrapper;
23
+ // not intended for user to interact with. so putting _ in so if user gets reference
24
+ // to this object, they kind'a know it's not part of the agreed interface
25
+ _nativeElement;
26
+ _initialised = false;
27
+ _destroyed = false;
28
+ gridOptions;
29
+ context;
30
+ gridParams;
31
+ // making these public, so they are accessible to people using the aurelia component references
32
+ api;
33
+ columns = [];
34
+ fullWidthRowTemplate;
35
+ dateTemplate;
36
+ constructor(element, taskQueue, auFrameworkFactory, container, viewResources, aureliaFrameworkComponentWrapper) {
37
+ this.taskQueue = taskQueue;
38
+ this.auFrameworkFactory = auFrameworkFactory;
39
+ this.container = container;
40
+ this.viewResources = viewResources;
41
+ this.aureliaFrameworkComponentWrapper = aureliaFrameworkComponentWrapper;
42
+ this._nativeElement = element;
43
+ // create all the events generically. this is done generically so that
44
+ // if the list of grid events change, we don't need to change this code.
45
+ ComponentUtil.EVENTS.forEach((eventName) => {
46
+ //create an empty event
47
+ this[eventName] = () => {
48
+ };
49
+ });
50
+ }
51
+ attached() {
52
+ // initialize the grid in the queue
53
+ // because of bug in @children
54
+ // https://github.com/aurelia/templating/issues/403
55
+ this.taskQueue.queueTask(this.initGrid.bind(this));
56
+ }
57
+ initGrid() {
58
+ this._initialised = false;
59
+ this._destroyed = false;
60
+ this.auFrameworkFactory.setContainer(this.container);
61
+ this.auFrameworkFactory.setViewResources(this.viewResources);
62
+ this.aureliaFrameworkComponentWrapper.setContainer(this.container);
63
+ this.aureliaFrameworkComponentWrapper.setViewResources(this.viewResources);
64
+ this.gridOptions = ComponentUtil.combineAttributesAndGridOptions(this.gridOptions, this);
65
+ this.gridParams = {
66
+ globalEventListener: this.globalEventListener.bind(this),
67
+ frameworkFactory: this.auFrameworkFactory,
68
+ seedBeanInstances: {
69
+ frameworkComponentWrapper: this.aureliaFrameworkComponentWrapper
70
+ }
71
+ };
72
+ if (this.columns && this.columns.length > 0) {
73
+ this.gridOptions.columnDefs = this.columns
74
+ .map((column) => {
75
+ return column.toColDef();
76
+ });
77
+ }
78
+ if (this.fullWidthRowTemplate) {
79
+ this.gridOptions.fullWidthCellRenderer =
80
+ { template: this.fullWidthRowTemplate.template };
81
+ }
82
+ if (this.dateTemplate) {
83
+ this.gridOptions.dataTypeDefinitions = {
84
+ date: {
85
+ baseDataType: 'date',
86
+ extendsDataType: 'date',
87
+ valueFormatter: () => this.dateTemplate.template
88
+ }
89
+ };
90
+ }
91
+ this.api = createGrid(this._nativeElement, this.gridOptions, this.gridParams);
92
+ this._initialised = true;
93
+ }
94
+ /**
95
+ * Called by Aurelia whenever a bound property changes
96
+ */
97
+ propertyChanged(propertyName, newValue, oldValue) {
98
+ // emulate an Angular2 SimpleChanges Object
99
+ let changes = {};
100
+ changes[propertyName] = { currentValue: newValue, previousValue: oldValue };
101
+ if (this._initialised) {
102
+ ComponentUtil.processOnChange(changes, this.api);
103
+ }
104
+ }
105
+ detached() {
106
+ if (this._initialised) {
107
+ // need to do this before the destroy, so we know not to emit any events
108
+ // while tearing down the grid.
109
+ this._destroyed = true;
110
+ this.api.destroy();
111
+ }
112
+ }
113
+ globalEventListener(eventType, event) {
114
+ // if we are tearing down, don't emit events
115
+ if (this._destroyed) {
116
+ return;
117
+ }
118
+ // generically look up the eventType
119
+ let emitter = this[eventType];
120
+ if (emitter) {
121
+ emitter(event);
122
+ }
123
+ else {
124
+ console.log('ag-Grid-aurelia: could not find EventEmitter: ' + eventType);
125
+ }
126
+ }
127
+ };
128
+ __decorate([
129
+ bindable(),
130
+ __metadata("design:type", Object)
131
+ ], AgGridAurelia.prototype, "gridOptions", void 0);
132
+ __decorate([
133
+ bindable(),
134
+ __metadata("design:type", Object)
135
+ ], AgGridAurelia.prototype, "context", void 0);
136
+ __decorate([
137
+ children('ag-grid-column'),
138
+ __metadata("design:type", Array)
139
+ ], AgGridAurelia.prototype, "columns", void 0);
140
+ __decorate([
141
+ child('ag-full-width-row-template'),
142
+ __metadata("design:type", AgFullWidthRowTemplate)
143
+ ], AgGridAurelia.prototype, "fullWidthRowTemplate", void 0);
144
+ __decorate([
145
+ child('ag-date-template'),
146
+ __metadata("design:type", AgDateTemplate)
147
+ ], AgGridAurelia.prototype, "dateTemplate", void 0);
148
+ AgGridAurelia = __decorate([
149
+ customElement('ag-grid-aurelia-m3'),
150
+ generateBindables(ComponentUtil.ALL_PROPERTIES.filter((property) => property !== 'gridOptions')),
151
+ generateBindables(ComponentUtil.EVENTS)
152
+ // <slot> is required for @children to work. https://github.com/aurelia/templating/issues/451#issuecomment-254206622
153
+ ,
154
+ inlineView(`<template><slot></slot></template>`),
155
+ autoinject(),
156
+ __metadata("design:paramtypes", [Element,
157
+ TaskQueue,
158
+ AureliaFrameworkFactory,
159
+ Container,
160
+ ViewResources,
161
+ AureliaFrameworkComponentWrapper])
162
+ ], AgGridAurelia);
163
+ export { AgGridAurelia };
@@ -1,18 +1,18 @@
1
- // ag-grid-aurelia-plugin v31.3.8
2
- import { ColDef } from "ag-grid-community";
3
- import { AgCellTemplate, AgEditorTemplate, AgFilterTemplate, AgHeaderGroupTemplate, AgHeaderTemplate, AgPinnedRowTemplate } from "./agTemplate";
4
- export declare class AgGridColumn {
5
- private mappedColumnProperties;
6
- childColumns: AgGridColumn[];
7
- cellTemplate: AgCellTemplate;
8
- editorTemplate: AgEditorTemplate;
9
- filterTemplate: AgFilterTemplate;
10
- headerTemplate: AgHeaderTemplate;
11
- headerGroupTemplate: AgHeaderGroupTemplate;
12
- pinnedRowTemplate: AgPinnedRowTemplate;
13
- constructor();
14
- hasChildColumns(): boolean;
15
- toColDef(): ColDef;
16
- private static getChildColDefs;
17
- private createColDefFromGridColumn;
18
- }
1
+ // ag-grid-aurelia-plugin v31.3.10
2
+ import { ColDef } from "ag-grid-community-v31";
3
+ import { AgCellTemplate, AgEditorTemplate, AgFilterTemplate, AgHeaderGroupTemplate, AgHeaderTemplate, AgPinnedRowTemplate } from "./agTemplate";
4
+ export declare class AgGridColumn {
5
+ private mappedColumnProperties;
6
+ childColumns: AgGridColumn[];
7
+ cellTemplate: AgCellTemplate;
8
+ editorTemplate: AgEditorTemplate;
9
+ filterTemplate: AgFilterTemplate;
10
+ headerTemplate: AgHeaderTemplate;
11
+ headerGroupTemplate: AgHeaderGroupTemplate;
12
+ pinnedRowTemplate: AgPinnedRowTemplate;
13
+ constructor();
14
+ hasChildColumns(): boolean;
15
+ toColDef(): ColDef;
16
+ private static getChildColDefs;
17
+ private createColDefFromGridColumn;
18
+ }