@freegridjs/angular 0.0.0-stage → 0.8.1
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.
- package/LICENSE +73 -0
- package/README.md +44 -2
- package/fesm2022/freegridjs-angular.mjs +290 -0
- package/fesm2022/freegridjs-angular.mjs.map +1 -0
- package/package.json +36 -4
- package/types/freegridjs-angular.d.ts +273 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
FreeGrid License
|
|
2
|
+
Version 1.0, 2026-10-15
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 2nd Korea (세컨드코리아). All rights reserved.
|
|
5
|
+
Contact: help@2nd-korea.com · https://freegrid.app/pricing/
|
|
6
|
+
|
|
7
|
+
This license covers the FreeGrid software, including the packages @freegridjs/core,
|
|
8
|
+
@freegridjs/react and @freegridjs/vue, their source code and the files built from them
|
|
9
|
+
(the "Software").
|
|
10
|
+
|
|
11
|
+
1. Personal use is free
|
|
12
|
+
|
|
13
|
+
An individual may use, copy and modify the Software free of charge for personal,
|
|
14
|
+
educational, research or other non-commercial purposes, including personal websites,
|
|
15
|
+
open-source projects that are not run by a company, and learning or evaluation.
|
|
16
|
+
|
|
17
|
+
2. Company use needs a domain license
|
|
18
|
+
|
|
19
|
+
Any use by or for a company, organization, public body or other business ("Company"),
|
|
20
|
+
whether the product is sold, used internally or offered to customers, requires a paid
|
|
21
|
+
Company License. A Company may evaluate the Software for up to 30 days without a license.
|
|
22
|
+
|
|
23
|
+
- A Company License is issued for one domain (for example example.com) and covers that
|
|
24
|
+
domain and its www host (www.example.com). Each other subdomain (for example
|
|
25
|
+
erp.example.com) needs its own Company License. Applications without a domain (desktop
|
|
26
|
+
apps, intranets reached by address) count as one domain per installation site.
|
|
27
|
+
- The fee is KRW 200,000 per domain per year. The license is valid for one year from the
|
|
28
|
+
date it is issued and may be renewed.
|
|
29
|
+
- A license key is provided with each Company License. Setting the key removes the
|
|
30
|
+
console notice described in section 5.
|
|
31
|
+
|
|
32
|
+
3. Conditions for all users
|
|
33
|
+
|
|
34
|
+
- Keep this license and the copyright notice in copies of the Software.
|
|
35
|
+
- Do not sell, rent or sublicense the Software itself, or offer it as a standalone grid
|
|
36
|
+
component or library, with or without changes.
|
|
37
|
+
- Do not remove or work around the license check, or share license keys outside the
|
|
38
|
+
licensed domain.
|
|
39
|
+
|
|
40
|
+
4. No warranty
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
43
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
44
|
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
45
|
+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE SOFTWARE OR ITS USE.
|
|
46
|
+
|
|
47
|
+
5. Usage report
|
|
48
|
+
|
|
49
|
+
When the Software runs on a public domain (not localhost or a private network address),
|
|
50
|
+
it sends the domain name, the page address without query string, the Software version
|
|
51
|
+
and whether a license key is set to freegrid.app once a day. No data shown in the grid
|
|
52
|
+
and no information about end users is sent. Without a license key on such a domain it
|
|
53
|
+
also prints a notice in the browser developer console.
|
|
54
|
+
|
|
55
|
+
---------------------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
FreeGrid 라이선스 (요약, 한국어)
|
|
58
|
+
|
|
59
|
+
- 개인: 개인적·교육·연구 등 비상업적 용도로 무료로 사용, 복제, 수정할 수 있습니다.
|
|
60
|
+
- 회사: 회사, 단체, 공공기관 등 업무용으로 쓰려면 판매용·내부용·고객 제공용 모두 유료
|
|
61
|
+
회사 라이선스가 필요합니다. 30일 동안은 평가 목적으로 라이선스 없이 써 볼 수 있습니다.
|
|
62
|
+
- 도메인 1개(www 포함) 기준 연 200,000원이며, 발급일로부터 1년간 유효하고
|
|
63
|
+
갱신할 수 있습니다. 서브도메인(예: erp.example.com)은 별도로 요금이 책정됩니다.
|
|
64
|
+
- 라이선스마다 키를 발급하며, 키를 설정하면 콘솔 안내가 사라집니다.
|
|
65
|
+
- 모든 사용자: 저작권과 이 라이선스 문구를 유지해야 하며, 소프트웨어 자체를 판매하거나
|
|
66
|
+
별도 그리드 라이브러리로 재배포할 수 없고, 라이선스 확인을 제거하거나 키를 다른
|
|
67
|
+
도메인에 공유할 수 없습니다.
|
|
68
|
+
- 보증 없음: 소프트웨어는 있는 그대로 제공됩니다.
|
|
69
|
+
- 사용 보고: 공개 도메인에서 실행되면 하루 한 번 도메인 이름, 쿼리 문자열을 뺀 페이지
|
|
70
|
+
주소, 버전, 라이선스 키 설정 여부를 freegrid.app으로 보냅니다. 그리드의 데이터나 최종
|
|
71
|
+
사용자 정보는 보내지 않습니다.
|
|
72
|
+
|
|
73
|
+
문의: help@2nd-korea.com · 대표번호 070-7768-1326
|
package/README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @freegridjs/angular
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular component for [FreeGrid](https://freegrid.app). Standalone, works with or without zone.js (Angular 17+).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i @freegridjs/core @freegridjs/angular
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { Component } from '@angular/core';
|
|
11
|
+
import { FreeGridComponent } from '@freegridjs/angular';
|
|
12
|
+
import type { GridApi } from '@freegridjs/core';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-orders',
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [FreeGridComponent],
|
|
18
|
+
template: `
|
|
19
|
+
<free-grid [columns]="columns" [data]="rows" rowSelection="multiple" [height]="480"
|
|
20
|
+
(ready)="api = $event" (cellClick)="open($event.row)" />
|
|
21
|
+
`,
|
|
22
|
+
})
|
|
23
|
+
export class OrdersComponent {
|
|
24
|
+
columns = [{ field: 'name' }, { field: 'qty', type: 'number' }];
|
|
25
|
+
rows = [{ name: 'Pen', qty: 3 }];
|
|
26
|
+
api?: GridApi;
|
|
27
|
+
open(row: unknown) { console.log(row); }
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Add `@import '@freegridjs/core/styles.css';` to your global styles (or list it under `styles` in angular.json).
|
|
32
|
+
|
|
33
|
+
Every grid event is an output with the same name (`(sortChange)`, `(cellValueChanged)`, …); `paste` and `scroll`
|
|
34
|
+
are `(gridPaste)` and `(gridScroll)`. `columns`, `data`, `theme`, `locale`, `summary`, `groupBy`, `pivot`,
|
|
35
|
+
`fontSize` and `fontFamily` update the grid when they change; other options go in `[options]` and apply at creation.
|
|
36
|
+
The grid runs outside the Angular zone, so scrolling does not trigger change detection.
|
|
37
|
+
|
|
38
|
+
Docs: https://freegrid.app/docs/#angular
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
Free for personal use. Company use needs a domain license: KRW 200,000 per domain per year
|
|
43
|
+
(each subdomain is licensed separately). See https://freegrid.app/pricing/ and the LICENSE file.
|
|
44
|
+
|
|
45
|
+
개인은 무료, 회사는 도메인당 연 20만 원이며, 서브도메인은 별도로 요금이 책정됩니다. 자세한 내용은 https://freegrid.app/pricing/
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, Output, inject } from "@angular/core";
|
|
3
|
+
import { createGrid } from "@freegridjs/core";
|
|
4
|
+
const OUTPUTS = {
|
|
5
|
+
cellClick: "cellClick",
|
|
6
|
+
cellDoubleClick: "cellDoubleClick",
|
|
7
|
+
selectionChange: "selectionChange",
|
|
8
|
+
sortChange: "sortChange",
|
|
9
|
+
filterChange: "filterChange",
|
|
10
|
+
columnResize: "columnResize",
|
|
11
|
+
columnMove: "columnMove",
|
|
12
|
+
focusChange: "focusChange",
|
|
13
|
+
columnVisible: "columnVisible",
|
|
14
|
+
rangeChange: "rangeChange",
|
|
15
|
+
cellValueChanged: "cellValueChanged",
|
|
16
|
+
paste: "gridPaste",
|
|
17
|
+
editStart: "editStart",
|
|
18
|
+
editStop: "editStop",
|
|
19
|
+
validationFailed: "validationFailed",
|
|
20
|
+
rowsAdded: "rowsAdded",
|
|
21
|
+
rowsRemoved: "rowsRemoved",
|
|
22
|
+
groupChange: "groupChange",
|
|
23
|
+
groupToggle: "groupToggle",
|
|
24
|
+
detailToggle: "detailToggle",
|
|
25
|
+
rowDragEnd: "rowDragEnd",
|
|
26
|
+
pageChange: "pageChange",
|
|
27
|
+
rowsLoaded: "rowsLoaded",
|
|
28
|
+
rowsLoadFailed: "rowsLoadFailed",
|
|
29
|
+
pivotChange: "pivotChange",
|
|
30
|
+
rowDrop: "rowDrop",
|
|
31
|
+
childrenLoaded: "childrenLoaded",
|
|
32
|
+
childrenLoadFailed: "childrenLoadFailed",
|
|
33
|
+
scroll: "gridScroll",
|
|
34
|
+
beforeSort: "beforeSort",
|
|
35
|
+
beforeFilter: "beforeFilter",
|
|
36
|
+
beforePageChange: "beforePageChange",
|
|
37
|
+
beforeEdit: "beforeEdit",
|
|
38
|
+
beforeCellChange: "beforeCellChange"
|
|
39
|
+
};
|
|
40
|
+
var FreeGridComponent = class FreeGridComponent {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.columns = [];
|
|
43
|
+
this.data = [];
|
|
44
|
+
this.height = 400;
|
|
45
|
+
this.ready = new EventEmitter();
|
|
46
|
+
this.cellClick = new EventEmitter();
|
|
47
|
+
this.cellDoubleClick = new EventEmitter();
|
|
48
|
+
this.selectionChange = new EventEmitter();
|
|
49
|
+
this.sortChange = new EventEmitter();
|
|
50
|
+
this.filterChange = new EventEmitter();
|
|
51
|
+
this.columnResize = new EventEmitter();
|
|
52
|
+
this.columnMove = new EventEmitter();
|
|
53
|
+
this.focusChange = new EventEmitter();
|
|
54
|
+
this.columnVisible = new EventEmitter();
|
|
55
|
+
this.rangeChange = new EventEmitter();
|
|
56
|
+
this.cellValueChanged = new EventEmitter();
|
|
57
|
+
this.gridPaste = new EventEmitter();
|
|
58
|
+
this.editStart = new EventEmitter();
|
|
59
|
+
this.editStop = new EventEmitter();
|
|
60
|
+
this.validationFailed = new EventEmitter();
|
|
61
|
+
this.rowsAdded = new EventEmitter();
|
|
62
|
+
this.rowsRemoved = new EventEmitter();
|
|
63
|
+
this.groupChange = new EventEmitter();
|
|
64
|
+
this.groupToggle = new EventEmitter();
|
|
65
|
+
this.detailToggle = new EventEmitter();
|
|
66
|
+
this.rowDragEnd = new EventEmitter();
|
|
67
|
+
this.pageChange = new EventEmitter();
|
|
68
|
+
this.rowsLoaded = new EventEmitter();
|
|
69
|
+
this.rowsLoadFailed = new EventEmitter();
|
|
70
|
+
this.pivotChange = new EventEmitter();
|
|
71
|
+
this.rowDrop = new EventEmitter();
|
|
72
|
+
this.childrenLoaded = new EventEmitter();
|
|
73
|
+
this.childrenLoadFailed = new EventEmitter();
|
|
74
|
+
this.gridScroll = new EventEmitter();
|
|
75
|
+
this.beforeSort = new EventEmitter();
|
|
76
|
+
this.beforeFilter = new EventEmitter();
|
|
77
|
+
this.beforePageChange = new EventEmitter();
|
|
78
|
+
this.beforeEdit = new EventEmitter();
|
|
79
|
+
this.beforeCellChange = new EventEmitter();
|
|
80
|
+
this.api = null;
|
|
81
|
+
this.host = inject(ElementRef).nativeElement;
|
|
82
|
+
this.zone = inject(NgZone);
|
|
83
|
+
}
|
|
84
|
+
get hostHeight() {
|
|
85
|
+
return typeof this.height === "number" ? `${this.height}px` : this.height;
|
|
86
|
+
}
|
|
87
|
+
ngAfterViewInit() {
|
|
88
|
+
const api = this.zone.runOutsideAngular(() => createGrid(this.host, {
|
|
89
|
+
...this.options,
|
|
90
|
+
columns: this.columns,
|
|
91
|
+
data: this.data,
|
|
92
|
+
rowSelection: this.rowSelection,
|
|
93
|
+
getRowId: this.getRowId,
|
|
94
|
+
rowHeight: this.rowHeight,
|
|
95
|
+
headerHeight: this.headerHeight,
|
|
96
|
+
theme: this.theme,
|
|
97
|
+
locale: this.locale,
|
|
98
|
+
summary: this.summary,
|
|
99
|
+
groupBy: this.groupBy,
|
|
100
|
+
pivot: this.pivot,
|
|
101
|
+
fontSize: this.fontSize,
|
|
102
|
+
fontFamily: this.fontFamily
|
|
103
|
+
}));
|
|
104
|
+
for (const [type, name] of Object.entries(OUTPUTS)) {
|
|
105
|
+
const out = this[name];
|
|
106
|
+
api.on(type, (payload) => {
|
|
107
|
+
if (out.observed) this.zone.run(() => out.emit(payload));
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
this.api = api;
|
|
111
|
+
this.ready.emit(api);
|
|
112
|
+
}
|
|
113
|
+
ngOnChanges(changes) {
|
|
114
|
+
const api = this.api;
|
|
115
|
+
if (!api) return;
|
|
116
|
+
this.zone.runOutsideAngular(() => {
|
|
117
|
+
if (changes["columns"]) api.setColumns(this.columns);
|
|
118
|
+
if (changes["data"]) api.setData(this.data ?? []);
|
|
119
|
+
if (changes["theme"] && this.theme) api.setTheme(this.theme);
|
|
120
|
+
if (changes["locale"] && this.locale !== void 0) api.setLocale(this.locale);
|
|
121
|
+
if (changes["summary"]) api.setSummary(this.summary ?? null);
|
|
122
|
+
if (changes["groupBy"]) api.setGroupBy(this.groupBy ?? []);
|
|
123
|
+
if (changes["pivot"]) api.setPivot(this.pivot ?? null);
|
|
124
|
+
if (changes["fontSize"] || changes["fontFamily"]) api.setFont({
|
|
125
|
+
size: this.fontSize,
|
|
126
|
+
family: this.fontFamily ?? null
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
ngOnDestroy() {
|
|
131
|
+
this.api?.destroy();
|
|
132
|
+
this.api = null;
|
|
133
|
+
}
|
|
134
|
+
static {
|
|
135
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
136
|
+
minVersion: "12.0.0",
|
|
137
|
+
version: "22.2.2",
|
|
138
|
+
ngImport: i0,
|
|
139
|
+
type: FreeGridComponent,
|
|
140
|
+
deps: [],
|
|
141
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
static {
|
|
145
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
146
|
+
minVersion: "14.0.0",
|
|
147
|
+
version: "22.2.2",
|
|
148
|
+
type: FreeGridComponent,
|
|
149
|
+
isStandalone: true,
|
|
150
|
+
selector: "free-grid",
|
|
151
|
+
inputs: {
|
|
152
|
+
columns: "columns",
|
|
153
|
+
data: "data",
|
|
154
|
+
options: "options",
|
|
155
|
+
rowSelection: "rowSelection",
|
|
156
|
+
getRowId: "getRowId",
|
|
157
|
+
rowHeight: "rowHeight",
|
|
158
|
+
headerHeight: "headerHeight",
|
|
159
|
+
theme: "theme",
|
|
160
|
+
locale: "locale",
|
|
161
|
+
summary: "summary",
|
|
162
|
+
groupBy: "groupBy",
|
|
163
|
+
pivot: "pivot",
|
|
164
|
+
fontSize: "fontSize",
|
|
165
|
+
fontFamily: "fontFamily",
|
|
166
|
+
height: "height"
|
|
167
|
+
},
|
|
168
|
+
outputs: {
|
|
169
|
+
ready: "ready",
|
|
170
|
+
cellClick: "cellClick",
|
|
171
|
+
cellDoubleClick: "cellDoubleClick",
|
|
172
|
+
selectionChange: "selectionChange",
|
|
173
|
+
sortChange: "sortChange",
|
|
174
|
+
filterChange: "filterChange",
|
|
175
|
+
columnResize: "columnResize",
|
|
176
|
+
columnMove: "columnMove",
|
|
177
|
+
focusChange: "focusChange",
|
|
178
|
+
columnVisible: "columnVisible",
|
|
179
|
+
rangeChange: "rangeChange",
|
|
180
|
+
cellValueChanged: "cellValueChanged",
|
|
181
|
+
gridPaste: "gridPaste",
|
|
182
|
+
editStart: "editStart",
|
|
183
|
+
editStop: "editStop",
|
|
184
|
+
validationFailed: "validationFailed",
|
|
185
|
+
rowsAdded: "rowsAdded",
|
|
186
|
+
rowsRemoved: "rowsRemoved",
|
|
187
|
+
groupChange: "groupChange",
|
|
188
|
+
groupToggle: "groupToggle",
|
|
189
|
+
detailToggle: "detailToggle",
|
|
190
|
+
rowDragEnd: "rowDragEnd",
|
|
191
|
+
pageChange: "pageChange",
|
|
192
|
+
rowsLoaded: "rowsLoaded",
|
|
193
|
+
rowsLoadFailed: "rowsLoadFailed",
|
|
194
|
+
pivotChange: "pivotChange",
|
|
195
|
+
rowDrop: "rowDrop",
|
|
196
|
+
childrenLoaded: "childrenLoaded",
|
|
197
|
+
childrenLoadFailed: "childrenLoadFailed",
|
|
198
|
+
gridScroll: "gridScroll",
|
|
199
|
+
beforeSort: "beforeSort",
|
|
200
|
+
beforeFilter: "beforeFilter",
|
|
201
|
+
beforePageChange: "beforePageChange",
|
|
202
|
+
beforeEdit: "beforeEdit",
|
|
203
|
+
beforeCellChange: "beforeCellChange"
|
|
204
|
+
},
|
|
205
|
+
host: { properties: {
|
|
206
|
+
"style.display": "\"block\"",
|
|
207
|
+
"style.height": "hostHeight"
|
|
208
|
+
} },
|
|
209
|
+
usesOnChanges: true,
|
|
210
|
+
ngImport: i0,
|
|
211
|
+
template: "",
|
|
212
|
+
isInline: true,
|
|
213
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
218
|
+
minVersion: "12.0.0",
|
|
219
|
+
version: "22.2.2",
|
|
220
|
+
ngImport: i0,
|
|
221
|
+
type: FreeGridComponent,
|
|
222
|
+
decorators: [{
|
|
223
|
+
type: Component,
|
|
224
|
+
args: [{
|
|
225
|
+
selector: "free-grid",
|
|
226
|
+
standalone: true,
|
|
227
|
+
template: "",
|
|
228
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
229
|
+
host: {
|
|
230
|
+
"[style.display]": "\"block\"",
|
|
231
|
+
"[style.height]": "hostHeight"
|
|
232
|
+
}
|
|
233
|
+
}]
|
|
234
|
+
}],
|
|
235
|
+
propDecorators: {
|
|
236
|
+
columns: [{ type: Input }],
|
|
237
|
+
data: [{ type: Input }],
|
|
238
|
+
options: [{ type: Input }],
|
|
239
|
+
rowSelection: [{ type: Input }],
|
|
240
|
+
getRowId: [{ type: Input }],
|
|
241
|
+
rowHeight: [{ type: Input }],
|
|
242
|
+
headerHeight: [{ type: Input }],
|
|
243
|
+
theme: [{ type: Input }],
|
|
244
|
+
locale: [{ type: Input }],
|
|
245
|
+
summary: [{ type: Input }],
|
|
246
|
+
groupBy: [{ type: Input }],
|
|
247
|
+
pivot: [{ type: Input }],
|
|
248
|
+
fontSize: [{ type: Input }],
|
|
249
|
+
fontFamily: [{ type: Input }],
|
|
250
|
+
height: [{ type: Input }],
|
|
251
|
+
ready: [{ type: Output }],
|
|
252
|
+
cellClick: [{ type: Output }],
|
|
253
|
+
cellDoubleClick: [{ type: Output }],
|
|
254
|
+
selectionChange: [{ type: Output }],
|
|
255
|
+
sortChange: [{ type: Output }],
|
|
256
|
+
filterChange: [{ type: Output }],
|
|
257
|
+
columnResize: [{ type: Output }],
|
|
258
|
+
columnMove: [{ type: Output }],
|
|
259
|
+
focusChange: [{ type: Output }],
|
|
260
|
+
columnVisible: [{ type: Output }],
|
|
261
|
+
rangeChange: [{ type: Output }],
|
|
262
|
+
cellValueChanged: [{ type: Output }],
|
|
263
|
+
gridPaste: [{ type: Output }],
|
|
264
|
+
editStart: [{ type: Output }],
|
|
265
|
+
editStop: [{ type: Output }],
|
|
266
|
+
validationFailed: [{ type: Output }],
|
|
267
|
+
rowsAdded: [{ type: Output }],
|
|
268
|
+
rowsRemoved: [{ type: Output }],
|
|
269
|
+
groupChange: [{ type: Output }],
|
|
270
|
+
groupToggle: [{ type: Output }],
|
|
271
|
+
detailToggle: [{ type: Output }],
|
|
272
|
+
rowDragEnd: [{ type: Output }],
|
|
273
|
+
pageChange: [{ type: Output }],
|
|
274
|
+
rowsLoaded: [{ type: Output }],
|
|
275
|
+
rowsLoadFailed: [{ type: Output }],
|
|
276
|
+
pivotChange: [{ type: Output }],
|
|
277
|
+
rowDrop: [{ type: Output }],
|
|
278
|
+
childrenLoaded: [{ type: Output }],
|
|
279
|
+
childrenLoadFailed: [{ type: Output }],
|
|
280
|
+
gridScroll: [{ type: Output }],
|
|
281
|
+
beforeSort: [{ type: Output }],
|
|
282
|
+
beforeFilter: [{ type: Output }],
|
|
283
|
+
beforePageChange: [{ type: Output }],
|
|
284
|
+
beforeEdit: [{ type: Output }],
|
|
285
|
+
beforeCellChange: [{ type: Output }]
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
export { FreeGridComponent };
|
|
289
|
+
|
|
290
|
+
//# sourceMappingURL=freegridjs-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freegridjs-angular.mjs","names":[],"sources":["../../src/free-grid.component.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, Output, inject,\n type AfterViewInit, type OnChanges, type OnDestroy, type SimpleChanges,\n} from '@angular/core';\nimport { createGrid, type ColumnDef, type GridApi, type GridEvents, type GridOptions, type LocalePack, type Row } from '@freegridjs/core';\n\n/** Grid event → output name. `paste` and `scroll` are prefixed so they don't clash with the DOM events of the host. */\nconst OUTPUTS = {\n cellClick: 'cellClick',\n cellDoubleClick: 'cellDoubleClick',\n selectionChange: 'selectionChange',\n sortChange: 'sortChange',\n filterChange: 'filterChange',\n columnResize: 'columnResize',\n columnMove: 'columnMove',\n focusChange: 'focusChange',\n columnVisible: 'columnVisible',\n rangeChange: 'rangeChange',\n cellValueChanged: 'cellValueChanged',\n paste: 'gridPaste',\n editStart: 'editStart',\n editStop: 'editStop',\n validationFailed: 'validationFailed',\n rowsAdded: 'rowsAdded',\n rowsRemoved: 'rowsRemoved',\n groupChange: 'groupChange',\n groupToggle: 'groupToggle',\n detailToggle: 'detailToggle',\n rowDragEnd: 'rowDragEnd',\n pageChange: 'pageChange',\n rowsLoaded: 'rowsLoaded',\n rowsLoadFailed: 'rowsLoadFailed',\n pivotChange: 'pivotChange',\n rowDrop: 'rowDrop',\n childrenLoaded: 'childrenLoaded',\n childrenLoadFailed: 'childrenLoadFailed',\n scroll: 'gridScroll',\n beforeSort: 'beforeSort',\n beforeFilter: 'beforeFilter',\n beforePageChange: 'beforePageChange',\n beforeEdit: 'beforeEdit',\n beforeCellChange: 'beforeCellChange',\n} as const satisfies Record<keyof GridEvents, string>;\n\n/**\n * `<free-grid [columns]=\"columns\" [data]=\"rows\" (cellClick)=\"…\" />`\n *\n * Inputs listed here update the grid when they change; anything else goes in `[options]` and applies at creation.\n * The grid runs outside Angular's zone; outputs re-enter it only when someone listens.\n */\n@Component({\n selector: 'free-grid',\n standalone: true,\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[style.display]': '\"block\"', '[style.height]': 'hostHeight' },\n})\nexport class FreeGridComponent implements AfterViewInit, OnChanges, OnDestroy {\n @Input() columns: ColumnDef[] = [];\n @Input() data: Row[] = [];\n /** Any other grid option (rowDrag, treeData, pagination, …), applied at creation. */\n @Input() options?: Partial<GridOptions>;\n @Input() rowSelection?: GridOptions['rowSelection'];\n @Input() getRowId?: GridOptions['getRowId'];\n @Input() rowHeight?: number;\n @Input() headerHeight?: number;\n @Input() theme?: string;\n @Input() locale?: string | Partial<LocalePack>;\n @Input() summary?: GridOptions['summary'];\n @Input() groupBy?: string[];\n @Input() pivot?: GridOptions['pivot'];\n @Input() fontSize?: number;\n @Input() fontFamily?: string;\n /** Host height; number = px. */\n @Input() height: number | string = 400;\n\n /** The grid API once the view is ready. */\n @Output() readonly ready = new EventEmitter<GridApi>();\n @Output() readonly cellClick = new EventEmitter<GridEvents['cellClick']>();\n @Output() readonly cellDoubleClick = new EventEmitter<GridEvents['cellDoubleClick']>();\n @Output() readonly selectionChange = new EventEmitter<GridEvents['selectionChange']>();\n @Output() readonly sortChange = new EventEmitter<GridEvents['sortChange']>();\n @Output() readonly filterChange = new EventEmitter<GridEvents['filterChange']>();\n @Output() readonly columnResize = new EventEmitter<GridEvents['columnResize']>();\n @Output() readonly columnMove = new EventEmitter<GridEvents['columnMove']>();\n @Output() readonly focusChange = new EventEmitter<GridEvents['focusChange']>();\n @Output() readonly columnVisible = new EventEmitter<GridEvents['columnVisible']>();\n @Output() readonly rangeChange = new EventEmitter<GridEvents['rangeChange']>();\n @Output() readonly cellValueChanged = new EventEmitter<GridEvents['cellValueChanged']>();\n @Output() readonly gridPaste = new EventEmitter<GridEvents['paste']>();\n @Output() readonly editStart = new EventEmitter<GridEvents['editStart']>();\n @Output() readonly editStop = new EventEmitter<GridEvents['editStop']>();\n @Output() readonly validationFailed = new EventEmitter<GridEvents['validationFailed']>();\n @Output() readonly rowsAdded = new EventEmitter<GridEvents['rowsAdded']>();\n @Output() readonly rowsRemoved = new EventEmitter<GridEvents['rowsRemoved']>();\n @Output() readonly groupChange = new EventEmitter<GridEvents['groupChange']>();\n @Output() readonly groupToggle = new EventEmitter<GridEvents['groupToggle']>();\n @Output() readonly detailToggle = new EventEmitter<GridEvents['detailToggle']>();\n @Output() readonly rowDragEnd = new EventEmitter<GridEvents['rowDragEnd']>();\n @Output() readonly pageChange = new EventEmitter<GridEvents['pageChange']>();\n @Output() readonly rowsLoaded = new EventEmitter<GridEvents['rowsLoaded']>();\n @Output() readonly rowsLoadFailed = new EventEmitter<GridEvents['rowsLoadFailed']>();\n @Output() readonly pivotChange = new EventEmitter<GridEvents['pivotChange']>();\n @Output() readonly rowDrop = new EventEmitter<GridEvents['rowDrop']>();\n @Output() readonly childrenLoaded = new EventEmitter<GridEvents['childrenLoaded']>();\n @Output() readonly childrenLoadFailed = new EventEmitter<GridEvents['childrenLoadFailed']>();\n @Output() readonly gridScroll = new EventEmitter<GridEvents['scroll']>();\n @Output() readonly beforeSort = new EventEmitter<GridEvents['beforeSort']>();\n @Output() readonly beforeFilter = new EventEmitter<GridEvents['beforeFilter']>();\n @Output() readonly beforePageChange = new EventEmitter<GridEvents['beforePageChange']>();\n @Output() readonly beforeEdit = new EventEmitter<GridEvents['beforeEdit']>();\n @Output() readonly beforeCellChange = new EventEmitter<GridEvents['beforeCellChange']>();\n\n /** The grid API (null before the view is ready and after destroy). */\n api: GridApi | null = null;\n\n private readonly host: HTMLElement = inject(ElementRef).nativeElement;\n private readonly zone = inject(NgZone);\n\n get hostHeight(): string {\n return typeof this.height === 'number' ? `${this.height}px` : this.height;\n }\n\n ngAfterViewInit(): void {\n const api = this.zone.runOutsideAngular(() => createGrid(this.host, {\n ...this.options,\n columns: this.columns, data: this.data, rowSelection: this.rowSelection, getRowId: this.getRowId,\n rowHeight: this.rowHeight, headerHeight: this.headerHeight, theme: this.theme, locale: this.locale,\n summary: this.summary, groupBy: this.groupBy, pivot: this.pivot, fontSize: this.fontSize, fontFamily: this.fontFamily,\n }));\n for (const [type, name] of Object.entries(OUTPUTS)) {\n const out = (this as unknown as Record<string, EventEmitter<unknown>>)[name];\n api.on(type as keyof GridEvents, payload => {\n if (out.observed) this.zone.run(() => out.emit(payload));\n });\n }\n this.api = api;\n this.ready.emit(api);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const api = this.api;\n if (!api) return;\n this.zone.runOutsideAngular(() => {\n if (changes['columns']) api.setColumns(this.columns);\n if (changes['data']) api.setData(this.data ?? []);\n if (changes['theme'] && this.theme) api.setTheme(this.theme);\n if (changes['locale'] && this.locale !== undefined) api.setLocale(this.locale);\n if (changes['summary']) api.setSummary(this.summary ?? null);\n if (changes['groupBy']) api.setGroupBy(this.groupBy ?? []);\n if (changes['pivot']) api.setPivot(this.pivot ?? null);\n if (changes['fontSize'] || changes['fontFamily']) api.setFont({ size: this.fontSize, family: this.fontFamily ?? null });\n });\n }\n\n ngOnDestroy(): void {\n this.api?.destroy();\n this.api = null;\n }\n}\n"],"mappings":";;;AAOA,MAAM,UAAU;CACd,WAAW;CACX,iBAAiB;CACjB,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AA,EAAA,MAAA,OAAA,CAAA;EACA,YAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EACA,YAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EACA,cAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EACA,kBAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EACA,YAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EACA,kBAAA,CAAA,EAAA,MAAA,OAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freegridjs/angular",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"description": "Angular component for FreeGrid, the fast data grid (free for personal use).",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"peerDependencies": {
|
|
7
|
+
"@angular/core": ">=17.0.0",
|
|
8
|
+
"@freegridjs/core": "^0.8.1"
|
|
9
|
+
},
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"keywords": [
|
|
12
|
+
"data-grid",
|
|
13
|
+
"angular",
|
|
14
|
+
"grid",
|
|
15
|
+
"table",
|
|
16
|
+
"@freegridjs/core"
|
|
17
|
+
],
|
|
18
|
+
"homepage": "https://freegrid.app",
|
|
19
|
+
"author": "secondkorea",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"module": "fesm2022/freegridjs-angular.mjs",
|
|
24
|
+
"typings": "types/freegridjs-angular.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
"./package.json": {
|
|
27
|
+
"default": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./types/freegridjs-angular.d.ts",
|
|
31
|
+
"default": "./fesm2022/freegridjs-angular.mjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"type": "module",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"tslib": "^2.3.0"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
|
|
3
|
+
import { ColumnDef, GridApi, GridOptions, LocalePack, Row } from "@freegridjs/core";
|
|
4
|
+
/**
|
|
5
|
+
* `<free-grid [columns]="columns" [data]="rows" (cellClick)="…" />`
|
|
6
|
+
*
|
|
7
|
+
* Inputs listed here update the grid when they change; anything else goes in `[options]` and applies at creation.
|
|
8
|
+
* The grid runs outside Angular's zone; outputs re-enter it only when someone listens.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FreeGridComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
11
|
+
columns: ColumnDef[];
|
|
12
|
+
data: Row[];
|
|
13
|
+
/** Any other grid option (rowDrag, treeData, pagination, …), applied at creation. */
|
|
14
|
+
options?: Partial<GridOptions>;
|
|
15
|
+
rowSelection?: GridOptions['rowSelection'];
|
|
16
|
+
getRowId?: GridOptions['getRowId'];
|
|
17
|
+
rowHeight?: number;
|
|
18
|
+
headerHeight?: number;
|
|
19
|
+
theme?: string;
|
|
20
|
+
locale?: string | Partial<LocalePack>;
|
|
21
|
+
summary?: GridOptions['summary'];
|
|
22
|
+
groupBy?: string[];
|
|
23
|
+
pivot?: GridOptions['pivot'];
|
|
24
|
+
fontSize?: number;
|
|
25
|
+
fontFamily?: string;
|
|
26
|
+
/** Host height; number = px. */
|
|
27
|
+
height: number | string;
|
|
28
|
+
/** The grid API once the view is ready. */
|
|
29
|
+
readonly ready: EventEmitter<GridApi>;
|
|
30
|
+
readonly cellClick: EventEmitter<import("@freegridjs/core").CellEvent>;
|
|
31
|
+
readonly cellDoubleClick: EventEmitter<import("@freegridjs/core").CellEvent>;
|
|
32
|
+
readonly selectionChange: EventEmitter<{
|
|
33
|
+
selected: Row[];
|
|
34
|
+
}>;
|
|
35
|
+
readonly sortChange: EventEmitter<{
|
|
36
|
+
sort: import("@freegridjs/core").SortItem[];
|
|
37
|
+
}>;
|
|
38
|
+
readonly filterChange: EventEmitter<{
|
|
39
|
+
filters: Record<string, import("@freegridjs/core").FilterModel>;
|
|
40
|
+
}>;
|
|
41
|
+
readonly columnResize: EventEmitter<{
|
|
42
|
+
colId: string;
|
|
43
|
+
width: number;
|
|
44
|
+
}>;
|
|
45
|
+
readonly columnMove: EventEmitter<{
|
|
46
|
+
colId: string;
|
|
47
|
+
toIndex: number;
|
|
48
|
+
}>;
|
|
49
|
+
readonly focusChange: EventEmitter<{
|
|
50
|
+
rowIndex: number;
|
|
51
|
+
colId: string;
|
|
52
|
+
}>;
|
|
53
|
+
readonly columnVisible: EventEmitter<{
|
|
54
|
+
colId: string;
|
|
55
|
+
visible: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
readonly rangeChange: EventEmitter<{
|
|
58
|
+
range: import("@freegridjs/core").GridRange | null;
|
|
59
|
+
}>;
|
|
60
|
+
readonly cellValueChanged: EventEmitter<{
|
|
61
|
+
row: Row;
|
|
62
|
+
rowIndex: number;
|
|
63
|
+
colId: string;
|
|
64
|
+
oldValue: unknown;
|
|
65
|
+
newValue: unknown;
|
|
66
|
+
}>;
|
|
67
|
+
readonly gridPaste: EventEmitter<{
|
|
68
|
+
changed: number;
|
|
69
|
+
skipped: number;
|
|
70
|
+
}>;
|
|
71
|
+
readonly editStart: EventEmitter<{
|
|
72
|
+
rowIndex: number;
|
|
73
|
+
colId: string;
|
|
74
|
+
}>;
|
|
75
|
+
readonly editStop: EventEmitter<{
|
|
76
|
+
rowIndex: number;
|
|
77
|
+
colId: string;
|
|
78
|
+
committed: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
readonly validationFailed: EventEmitter<{
|
|
81
|
+
rowIndex: number;
|
|
82
|
+
colId: string;
|
|
83
|
+
value: unknown;
|
|
84
|
+
message: string;
|
|
85
|
+
}>;
|
|
86
|
+
readonly rowsAdded: EventEmitter<{
|
|
87
|
+
rows: Row[];
|
|
88
|
+
}>;
|
|
89
|
+
readonly rowsRemoved: EventEmitter<{
|
|
90
|
+
rows: Row[];
|
|
91
|
+
}>;
|
|
92
|
+
readonly groupChange: EventEmitter<{
|
|
93
|
+
groupBy: string[];
|
|
94
|
+
}>;
|
|
95
|
+
readonly groupToggle: EventEmitter<{
|
|
96
|
+
key: string;
|
|
97
|
+
expanded: boolean;
|
|
98
|
+
}>;
|
|
99
|
+
readonly detailToggle: EventEmitter<{
|
|
100
|
+
row: Row;
|
|
101
|
+
expanded: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
readonly rowDragEnd: EventEmitter<{
|
|
104
|
+
row: Row;
|
|
105
|
+
fromIndex: number;
|
|
106
|
+
toIndex: number;
|
|
107
|
+
}>;
|
|
108
|
+
readonly pageChange: EventEmitter<{
|
|
109
|
+
page: number;
|
|
110
|
+
pageSize: number;
|
|
111
|
+
pageCount: number;
|
|
112
|
+
}>;
|
|
113
|
+
readonly rowsLoaded: EventEmitter<{
|
|
114
|
+
start: number;
|
|
115
|
+
end: number;
|
|
116
|
+
total?: number;
|
|
117
|
+
}>;
|
|
118
|
+
readonly rowsLoadFailed: EventEmitter<{
|
|
119
|
+
start: number;
|
|
120
|
+
end: number;
|
|
121
|
+
error: unknown;
|
|
122
|
+
}>;
|
|
123
|
+
readonly pivotChange: EventEmitter<{
|
|
124
|
+
pivot: import("@freegridjs/core").PivotConfig | null;
|
|
125
|
+
}>;
|
|
126
|
+
readonly rowDrop: EventEmitter<import("@freegridjs/core").RowDropParams & {
|
|
127
|
+
fromGrid: GridApi | null;
|
|
128
|
+
}>;
|
|
129
|
+
readonly childrenLoaded: EventEmitter<{
|
|
130
|
+
row: Row;
|
|
131
|
+
rows: Row[];
|
|
132
|
+
}>;
|
|
133
|
+
readonly childrenLoadFailed: EventEmitter<{
|
|
134
|
+
row: Row;
|
|
135
|
+
error: unknown;
|
|
136
|
+
}>;
|
|
137
|
+
readonly gridScroll: EventEmitter<import("@freegridjs/core").ScrollPosition>;
|
|
138
|
+
readonly beforeSort: EventEmitter<{
|
|
139
|
+
sort: import("@freegridjs/core").SortItem[];
|
|
140
|
+
cancel(): void;
|
|
141
|
+
}>;
|
|
142
|
+
readonly beforeFilter: EventEmitter<{
|
|
143
|
+
colId: string;
|
|
144
|
+
model: import("@freegridjs/core").FilterModel | null;
|
|
145
|
+
cancel(): void;
|
|
146
|
+
}>;
|
|
147
|
+
readonly beforePageChange: EventEmitter<{
|
|
148
|
+
page: number;
|
|
149
|
+
pageSize: number;
|
|
150
|
+
cancel(): void;
|
|
151
|
+
}>;
|
|
152
|
+
readonly beforeEdit: EventEmitter<{
|
|
153
|
+
row: Row;
|
|
154
|
+
rowIndex: number;
|
|
155
|
+
colId: string;
|
|
156
|
+
cancel(): void;
|
|
157
|
+
}>;
|
|
158
|
+
readonly beforeCellChange: EventEmitter<{
|
|
159
|
+
row: Row;
|
|
160
|
+
rowIndex: number;
|
|
161
|
+
colId: string;
|
|
162
|
+
oldValue: unknown;
|
|
163
|
+
newValue: unknown;
|
|
164
|
+
cancel(): void;
|
|
165
|
+
}>;
|
|
166
|
+
/** The grid API (null before the view is ready and after destroy). */
|
|
167
|
+
api: GridApi | null;
|
|
168
|
+
private readonly host;
|
|
169
|
+
private readonly zone;
|
|
170
|
+
get hostHeight(): string;
|
|
171
|
+
ngAfterViewInit(): void;
|
|
172
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
173
|
+
ngOnDestroy(): void;
|
|
174
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FreeGridComponent, never>;
|
|
175
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FreeGridComponent, "free-grid", never, {
|
|
176
|
+
"columns": {
|
|
177
|
+
"alias": "columns";
|
|
178
|
+
"required": false;
|
|
179
|
+
};
|
|
180
|
+
"data": {
|
|
181
|
+
"alias": "data";
|
|
182
|
+
"required": false;
|
|
183
|
+
};
|
|
184
|
+
"options": {
|
|
185
|
+
"alias": "options";
|
|
186
|
+
"required": false;
|
|
187
|
+
};
|
|
188
|
+
"rowSelection": {
|
|
189
|
+
"alias": "rowSelection";
|
|
190
|
+
"required": false;
|
|
191
|
+
};
|
|
192
|
+
"getRowId": {
|
|
193
|
+
"alias": "getRowId";
|
|
194
|
+
"required": false;
|
|
195
|
+
};
|
|
196
|
+
"rowHeight": {
|
|
197
|
+
"alias": "rowHeight";
|
|
198
|
+
"required": false;
|
|
199
|
+
};
|
|
200
|
+
"headerHeight": {
|
|
201
|
+
"alias": "headerHeight";
|
|
202
|
+
"required": false;
|
|
203
|
+
};
|
|
204
|
+
"theme": {
|
|
205
|
+
"alias": "theme";
|
|
206
|
+
"required": false;
|
|
207
|
+
};
|
|
208
|
+
"locale": {
|
|
209
|
+
"alias": "locale";
|
|
210
|
+
"required": false;
|
|
211
|
+
};
|
|
212
|
+
"summary": {
|
|
213
|
+
"alias": "summary";
|
|
214
|
+
"required": false;
|
|
215
|
+
};
|
|
216
|
+
"groupBy": {
|
|
217
|
+
"alias": "groupBy";
|
|
218
|
+
"required": false;
|
|
219
|
+
};
|
|
220
|
+
"pivot": {
|
|
221
|
+
"alias": "pivot";
|
|
222
|
+
"required": false;
|
|
223
|
+
};
|
|
224
|
+
"fontSize": {
|
|
225
|
+
"alias": "fontSize";
|
|
226
|
+
"required": false;
|
|
227
|
+
};
|
|
228
|
+
"fontFamily": {
|
|
229
|
+
"alias": "fontFamily";
|
|
230
|
+
"required": false;
|
|
231
|
+
};
|
|
232
|
+
"height": {
|
|
233
|
+
"alias": "height";
|
|
234
|
+
"required": false;
|
|
235
|
+
};
|
|
236
|
+
}, {
|
|
237
|
+
"ready": "ready";
|
|
238
|
+
"cellClick": "cellClick";
|
|
239
|
+
"cellDoubleClick": "cellDoubleClick";
|
|
240
|
+
"selectionChange": "selectionChange";
|
|
241
|
+
"sortChange": "sortChange";
|
|
242
|
+
"filterChange": "filterChange";
|
|
243
|
+
"columnResize": "columnResize";
|
|
244
|
+
"columnMove": "columnMove";
|
|
245
|
+
"focusChange": "focusChange";
|
|
246
|
+
"columnVisible": "columnVisible";
|
|
247
|
+
"rangeChange": "rangeChange";
|
|
248
|
+
"cellValueChanged": "cellValueChanged";
|
|
249
|
+
"gridPaste": "gridPaste";
|
|
250
|
+
"editStart": "editStart";
|
|
251
|
+
"editStop": "editStop";
|
|
252
|
+
"validationFailed": "validationFailed";
|
|
253
|
+
"rowsAdded": "rowsAdded";
|
|
254
|
+
"rowsRemoved": "rowsRemoved";
|
|
255
|
+
"groupChange": "groupChange";
|
|
256
|
+
"groupToggle": "groupToggle";
|
|
257
|
+
"detailToggle": "detailToggle";
|
|
258
|
+
"rowDragEnd": "rowDragEnd";
|
|
259
|
+
"pageChange": "pageChange";
|
|
260
|
+
"rowsLoaded": "rowsLoaded";
|
|
261
|
+
"rowsLoadFailed": "rowsLoadFailed";
|
|
262
|
+
"pivotChange": "pivotChange";
|
|
263
|
+
"rowDrop": "rowDrop";
|
|
264
|
+
"childrenLoaded": "childrenLoaded";
|
|
265
|
+
"childrenLoadFailed": "childrenLoadFailed";
|
|
266
|
+
"gridScroll": "gridScroll";
|
|
267
|
+
"beforeSort": "beforeSort";
|
|
268
|
+
"beforeFilter": "beforeFilter";
|
|
269
|
+
"beforePageChange": "beforePageChange";
|
|
270
|
+
"beforeEdit": "beforeEdit";
|
|
271
|
+
"beforeCellChange": "beforeCellChange";
|
|
272
|
+
}, never, never, true, never>;
|
|
273
|
+
}
|