@acorex/data-grid 3.0.65 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/acorex-data-grid.d.ts +1 -0
- package/esm2020/acorex-data-grid.mjs +5 -0
- package/esm2020/lib/data-grid/columns/check-column.component.mjs +117 -0
- package/esm2020/lib/data-grid/columns/column.component.mjs +164 -0
- package/{esm2015/lib/data-grid/columns/command-column.component.js → esm2020/lib/data-grid/columns/command-column.component.mjs} +46 -35
- package/esm2020/lib/data-grid/columns/date-column.component.mjs +112 -0
- package/esm2020/lib/data-grid/columns/row-number-column.component.mjs +37 -0
- package/esm2020/lib/data-grid/columns/selection-column.component.mjs +42 -0
- package/esm2020/lib/data-grid/columns/text-column.component.mjs +89 -0
- package/esm2020/lib/data-grid/datagrid.component.mjs +658 -0
- package/esm2020/lib/data-grid/datagrid.events.mjs +2 -0
- package/esm2020/lib/data-grid/datagrid.module.mjs +145 -0
- package/esm2020/lib/data-grid/filters/filter.component.mjs +39 -0
- package/esm2020/lib/data-grid/templates/cell-template.component.mjs +53 -0
- package/esm2020/lib/data-grid/templates/detail-template.component.mjs +46 -0
- package/esm2020/lib/data-grid/templates/row-template.component.mjs +43 -0
- package/esm2020/lib/data-lov/data-lov-popup/data-lov-popup.component.mjs +118 -0
- package/esm2020/lib/data-lov/data-lov.component.mjs +163 -0
- package/esm2020/lib/data-lov/data-lov.module.mjs +23 -0
- package/esm2020/public-api.mjs +18 -0
- package/fesm2015/acorex-data-grid.mjs +1875 -0
- package/fesm2015/acorex-data-grid.mjs.map +1 -0
- package/fesm2020/acorex-data-grid.mjs +1875 -0
- package/fesm2020/acorex-data-grid.mjs.map +1 -0
- package/lib/data-grid/columns/check-column.component.d.ts +7 -0
- package/lib/data-grid/columns/column.component.d.ts +3 -0
- package/lib/data-grid/columns/command-column.component.d.ts +5 -0
- package/lib/data-grid/columns/date-column.component.d.ts +5 -0
- package/lib/data-grid/columns/row-number-column.component.d.ts +3 -0
- package/lib/data-grid/columns/selection-column.component.d.ts +3 -0
- package/lib/data-grid/columns/text-column.component.d.ts +5 -0
- package/lib/data-grid/datagrid.component.d.ts +3 -0
- package/lib/data-grid/datagrid.module.d.ts +20 -0
- package/lib/data-grid/filters/filter.component.d.ts +3 -0
- package/lib/data-grid/templates/cell-template.component.d.ts +5 -0
- package/lib/data-grid/templates/detail-template.component.d.ts +5 -0
- package/lib/data-grid/templates/row-template.component.d.ts +5 -0
- package/lib/data-lov/data-lov-popup/data-lov-popup.component.d.ts +3 -0
- package/lib/data-lov/data-lov.component.d.ts +3 -0
- package/lib/data-lov/data-lov.module.d.ts +10 -0
- package/package.json +23 -13
- package/acorex-data-grid.metadata.json +0 -1
- package/bundles/acorex-data-grid.umd.js +0 -2261
- package/bundles/acorex-data-grid.umd.js.map +0 -1
- package/bundles/acorex-data-grid.umd.min.js +0 -16
- package/bundles/acorex-data-grid.umd.min.js.map +0 -1
- package/esm2015/acorex-data-grid.js +0 -5
- package/esm2015/lib/data-grid/columns/check-column.component.js +0 -104
- package/esm2015/lib/data-grid/columns/column.component.js +0 -204
- package/esm2015/lib/data-grid/columns/date-column.component.js +0 -114
- package/esm2015/lib/data-grid/columns/row-number-column.component.js +0 -39
- package/esm2015/lib/data-grid/columns/selection-column.component.js +0 -48
- package/esm2015/lib/data-grid/columns/text-column.component.js +0 -81
- package/esm2015/lib/data-grid/datagrid.component.js +0 -734
- package/esm2015/lib/data-grid/datagrid.events.js +0 -1
- package/esm2015/lib/data-grid/datagrid.module.js +0 -98
- package/esm2015/lib/data-grid/filters/filter.component.js +0 -25
- package/esm2015/lib/data-grid/templates/cell-template.component.js +0 -47
- package/esm2015/lib/data-grid/templates/detail-template.component.js +0 -45
- package/esm2015/lib/data-grid/templates/row-template.component.js +0 -40
- package/esm2015/lib/data-lov/data-lov-popup/data-lov-popup.component.js +0 -121
- package/esm2015/lib/data-lov/data-lov.component.js +0 -212
- package/esm2015/lib/data-lov/data-lov.module.js +0 -21
- package/esm2015/public-api.js +0 -17
- package/esm5/acorex-data-grid.js +0 -5
- package/esm5/lib/data-grid/columns/check-column.component.js +0 -102
- package/esm5/lib/data-grid/columns/column.component.js +0 -206
- package/esm5/lib/data-grid/columns/command-column.component.js +0 -98
- package/esm5/lib/data-grid/columns/date-column.component.js +0 -119
- package/esm5/lib/data-grid/columns/row-number-column.component.js +0 -42
- package/esm5/lib/data-grid/columns/selection-column.component.js +0 -52
- package/esm5/lib/data-grid/columns/text-column.component.js +0 -81
- package/esm5/lib/data-grid/datagrid.component.js +0 -792
- package/esm5/lib/data-grid/datagrid.events.js +0 -1
- package/esm5/lib/data-grid/datagrid.module.js +0 -101
- package/esm5/lib/data-grid/filters/filter.component.js +0 -16
- package/esm5/lib/data-grid/templates/cell-template.component.js +0 -46
- package/esm5/lib/data-grid/templates/detail-template.component.js +0 -49
- package/esm5/lib/data-grid/templates/row-template.component.js +0 -44
- package/esm5/lib/data-lov/data-lov-popup/data-lov-popup.component.js +0 -127
- package/esm5/lib/data-lov/data-lov.component.js +0 -222
- package/esm5/lib/data-lov/data-lov.module.js +0 -24
- package/esm5/public-api.js +0 -17
- package/fesm2015/acorex-data-grid.js +0 -1939
- package/fesm2015/acorex-data-grid.js.map +0 -1
- package/fesm5/acorex-data-grid.js +0 -2017
- package/fesm5/acorex-data-grid.js.map +0 -1
@@ -1,2017 +0,0 @@
|
|
1
|
-
import { __decorate, __metadata, __extends, __spread } from 'tslib';
|
2
|
-
import { ContentChild, TemplateRef, Component, Input, ChangeDetectionStrategy, ViewChild, ViewContainerRef, EventEmitter, Output, ViewEncapsulation, ElementRef, ChangeDetectorRef, ContentChildren, QueryList, NgModule } from '@angular/core';
|
3
|
-
import { AXConfig, AXDateTime, AXTranslator, AXCoreModule } from '@acorex/core';
|
4
|
-
import { AXDatePickerComponent, AXTextBoxComponent, AXValueEvent, AXDataEvent, AXToolbarSearchComponent, AXToolbarComponent, AXDataSourceComponent, AXTextBoxModule, AXCheckBoxModule, AXSelectBoxModule, AXDataSourceModule, AXButtonModule, AXDatePickerModule, AXBasePopupPageComponent, AXPopupService, AXValidation, AXSelectBoxComponent, AXValidatableComponent, AXToolbarModule, AXSearchBoxModule } from '@acorex/components';
|
5
|
-
import { LicenseManager } from 'ag-grid-enterprise';
|
6
|
-
import { CommonModule } from '@angular/common';
|
7
|
-
import { FormsModule } from '@angular/forms';
|
8
|
-
import { AgGridModule } from 'ag-grid-angular';
|
9
|
-
|
10
|
-
var AXDataGridCellTemplateComponent = /** @class */ (function () {
|
11
|
-
function AXDataGridCellTemplateComponent() {
|
12
|
-
this.renderer = AXDataGridCellTemplateRenderer;
|
13
|
-
}
|
14
|
-
AXDataGridCellTemplateComponent.prototype.ngOnInit = function () {
|
15
|
-
this.params = {
|
16
|
-
templateRef: this.templateRef
|
17
|
-
};
|
18
|
-
};
|
19
|
-
__decorate([
|
20
|
-
ContentChild(TemplateRef, { static: true }),
|
21
|
-
__metadata("design:type", TemplateRef)
|
22
|
-
], AXDataGridCellTemplateComponent.prototype, "templateRef", void 0);
|
23
|
-
AXDataGridCellTemplateComponent = __decorate([
|
24
|
-
Component({
|
25
|
-
selector: 'ax-cell-template',
|
26
|
-
template: "<ng-content></ng-content>\n "
|
27
|
-
}),
|
28
|
-
__metadata("design:paramtypes", [])
|
29
|
-
], AXDataGridCellTemplateComponent);
|
30
|
-
return AXDataGridCellTemplateComponent;
|
31
|
-
}());
|
32
|
-
var AXDataGridCellTemplateRenderer = /** @class */ (function () {
|
33
|
-
function AXDataGridCellTemplateRenderer() {
|
34
|
-
}
|
35
|
-
AXDataGridCellTemplateRenderer.prototype.agInit = function (params) {
|
36
|
-
this.rowData = params.data;
|
37
|
-
this.templateRef = params.templateRef;
|
38
|
-
};
|
39
|
-
AXDataGridCellTemplateRenderer.prototype.refresh = function (params) {
|
40
|
-
this.rowData = params.data;
|
41
|
-
return true;
|
42
|
-
};
|
43
|
-
AXDataGridCellTemplateRenderer = __decorate([
|
44
|
-
Component({
|
45
|
-
template: "\n <ng-container *ngTemplateOutlet='templateRef; context: { $implicit: rowData }'>\n </ng-container>\n "
|
46
|
-
}),
|
47
|
-
__metadata("design:paramtypes", [])
|
48
|
-
], AXDataGridCellTemplateRenderer);
|
49
|
-
return AXDataGridCellTemplateRenderer;
|
50
|
-
}());
|
51
|
-
|
52
|
-
var AXGridDataColumn = /** @class */ (function () {
|
53
|
-
function AXGridDataColumn() {
|
54
|
-
this.width = 100;
|
55
|
-
this.pinned = null;
|
56
|
-
this.allowSorting = true;
|
57
|
-
this.allowFiltering = AXConfig.get('datagrid.allowFiltering') || false;
|
58
|
-
this.sort = null;
|
59
|
-
this.field = '';
|
60
|
-
this.caption = '';
|
61
|
-
this.checkbox = false;
|
62
|
-
this.headerCheckbox = false;
|
63
|
-
this.groupIndex = -1;
|
64
|
-
this.treeIndex = -1;
|
65
|
-
this.enableRowGroup = false;
|
66
|
-
this.hide = false;
|
67
|
-
this.floatingFilter = AXConfig.get('datagrid.floatingFilter') || false;
|
68
|
-
this.disableMenu = false;
|
69
|
-
this.resizable = true;
|
70
|
-
this.menuColumnDisable = false;
|
71
|
-
this.menuItemDisable = false;
|
72
|
-
}
|
73
|
-
;
|
74
|
-
AXGridDataColumn.prototype.render = function () {
|
75
|
-
var col = {
|
76
|
-
field: this.field,
|
77
|
-
width: this.width,
|
78
|
-
};
|
79
|
-
col.resizable = this.resizable;
|
80
|
-
col.suppressMenu = this.disableMenu;
|
81
|
-
col.menuTabs = ['filterMenuTab', 'columnsMenuTab', 'generalMenuTab'];
|
82
|
-
col.floatingFilter = this.floatingFilter;
|
83
|
-
if (!this.allowFiltering) {
|
84
|
-
col.filter = false;
|
85
|
-
col.menuTabs = col.menuTabs.filter(function (c) { return c != 'filterMenuTab'; });
|
86
|
-
col.floatingFilter = false;
|
87
|
-
}
|
88
|
-
if (this.menuColumnDisable == true) {
|
89
|
-
col.menuTabs = col.menuTabs.filter(function (c) { return c != 'columnsMenuTab'; });
|
90
|
-
}
|
91
|
-
if (this.menuItemDisable == true) {
|
92
|
-
col.menuTabs = col.menuTabs.filter(function (c) { return c != 'generalMenuTab'; });
|
93
|
-
}
|
94
|
-
if (this.caption) {
|
95
|
-
col.headerName = this.caption;
|
96
|
-
}
|
97
|
-
if (this.minWidth) {
|
98
|
-
col.minWidth = this.minWidth;
|
99
|
-
}
|
100
|
-
if (this.maxWidth) {
|
101
|
-
col.maxWidth = this.maxWidth;
|
102
|
-
}
|
103
|
-
if (this.pinned) {
|
104
|
-
col.pinned = this.pinned === 'start' ? 'right' : 'left';
|
105
|
-
// TODO: Change based on layout
|
106
|
-
}
|
107
|
-
if (this.allowSorting) {
|
108
|
-
col.sortable = this.allowSorting;
|
109
|
-
}
|
110
|
-
if (this.sort) {
|
111
|
-
col.sort = this.sort;
|
112
|
-
}
|
113
|
-
if (this.groupIndex >= 0) {
|
114
|
-
col.rowGroupIndex = this.groupIndex;
|
115
|
-
col.rowGroup = true;
|
116
|
-
this.enableRowGroup = true;
|
117
|
-
}
|
118
|
-
if (this.treeIndex >= 0) {
|
119
|
-
col.rowGroupIndex = this.treeIndex;
|
120
|
-
col.rowGroup = false;
|
121
|
-
}
|
122
|
-
if (this.hide) {
|
123
|
-
col.hide = true;
|
124
|
-
}
|
125
|
-
if (this.enableRowGroup) {
|
126
|
-
col.enableRowGroup = this.enableRowGroup;
|
127
|
-
}
|
128
|
-
if (this.cellClass) {
|
129
|
-
var THAT_1 = this;
|
130
|
-
if (this.cellClass instanceof Function) {
|
131
|
-
col.cellClass = function (p) {
|
132
|
-
return THAT_1.cellClass({
|
133
|
-
column: THAT_1,
|
134
|
-
rowIndex: p.node.rowIndex,
|
135
|
-
rowLevel: p.node.level,
|
136
|
-
data: p.data,
|
137
|
-
value: p.value
|
138
|
-
});
|
139
|
-
};
|
140
|
-
}
|
141
|
-
else {
|
142
|
-
col.cellClass = this.cellClass;
|
143
|
-
}
|
144
|
-
}
|
145
|
-
//
|
146
|
-
if (this.cellTemplate != null) {
|
147
|
-
col.cellRendererFramework = this.cellTemplate.renderer;
|
148
|
-
col.cellRendererParams = this.cellTemplate.params;
|
149
|
-
}
|
150
|
-
if (this.checkbox) {
|
151
|
-
col.checkboxSelection = function (params) {
|
152
|
-
return true;
|
153
|
-
};
|
154
|
-
// col.headerCheckboxSelection = this.headerCheckbox;
|
155
|
-
}
|
156
|
-
return col;
|
157
|
-
};
|
158
|
-
__decorate([
|
159
|
-
ContentChild(AXDataGridCellTemplateComponent),
|
160
|
-
__metadata("design:type", AXDataGridCellTemplateComponent)
|
161
|
-
], AXGridDataColumn.prototype, "cellTemplate", void 0);
|
162
|
-
__decorate([
|
163
|
-
Input(),
|
164
|
-
__metadata("design:type", Number)
|
165
|
-
], AXGridDataColumn.prototype, "width", void 0);
|
166
|
-
__decorate([
|
167
|
-
Input(),
|
168
|
-
__metadata("design:type", Number)
|
169
|
-
], AXGridDataColumn.prototype, "maxWidth", void 0);
|
170
|
-
__decorate([
|
171
|
-
Input(),
|
172
|
-
__metadata("design:type", Number)
|
173
|
-
], AXGridDataColumn.prototype, "minWidth", void 0);
|
174
|
-
__decorate([
|
175
|
-
Input(),
|
176
|
-
__metadata("design:type", String)
|
177
|
-
], AXGridDataColumn.prototype, "pinned", void 0);
|
178
|
-
__decorate([
|
179
|
-
Input(),
|
180
|
-
__metadata("design:type", Boolean)
|
181
|
-
], AXGridDataColumn.prototype, "allowSorting", void 0);
|
182
|
-
__decorate([
|
183
|
-
Input(),
|
184
|
-
__metadata("design:type", Boolean)
|
185
|
-
], AXGridDataColumn.prototype, "allowFiltering", void 0);
|
186
|
-
__decorate([
|
187
|
-
Input(),
|
188
|
-
__metadata("design:type", Function)
|
189
|
-
], AXGridDataColumn.prototype, "cellClass", void 0);
|
190
|
-
__decorate([
|
191
|
-
Input(),
|
192
|
-
__metadata("design:type", String)
|
193
|
-
], AXGridDataColumn.prototype, "sort", void 0);
|
194
|
-
__decorate([
|
195
|
-
Input(),
|
196
|
-
__metadata("design:type", String)
|
197
|
-
], AXGridDataColumn.prototype, "field", void 0);
|
198
|
-
__decorate([
|
199
|
-
Input(),
|
200
|
-
__metadata("design:type", String)
|
201
|
-
], AXGridDataColumn.prototype, "caption", void 0);
|
202
|
-
__decorate([
|
203
|
-
Input(),
|
204
|
-
__metadata("design:type", Object)
|
205
|
-
], AXGridDataColumn.prototype, "cellRendererParams", void 0);
|
206
|
-
__decorate([
|
207
|
-
Input(),
|
208
|
-
__metadata("design:type", Boolean)
|
209
|
-
], AXGridDataColumn.prototype, "checkbox", void 0);
|
210
|
-
__decorate([
|
211
|
-
Input(),
|
212
|
-
__metadata("design:type", Boolean)
|
213
|
-
], AXGridDataColumn.prototype, "headerCheckbox", void 0);
|
214
|
-
__decorate([
|
215
|
-
Input(),
|
216
|
-
__metadata("design:type", Number)
|
217
|
-
], AXGridDataColumn.prototype, "groupIndex", void 0);
|
218
|
-
__decorate([
|
219
|
-
Input(),
|
220
|
-
__metadata("design:type", Number)
|
221
|
-
], AXGridDataColumn.prototype, "treeIndex", void 0);
|
222
|
-
__decorate([
|
223
|
-
Input(),
|
224
|
-
__metadata("design:type", Boolean)
|
225
|
-
], AXGridDataColumn.prototype, "enableRowGroup", void 0);
|
226
|
-
__decorate([
|
227
|
-
Input(),
|
228
|
-
__metadata("design:type", Boolean)
|
229
|
-
], AXGridDataColumn.prototype, "hide", void 0);
|
230
|
-
__decorate([
|
231
|
-
Input(),
|
232
|
-
__metadata("design:type", Boolean)
|
233
|
-
], AXGridDataColumn.prototype, "floatingFilter", void 0);
|
234
|
-
__decorate([
|
235
|
-
Input(),
|
236
|
-
__metadata("design:type", Boolean)
|
237
|
-
], AXGridDataColumn.prototype, "disableMenu", void 0);
|
238
|
-
__decorate([
|
239
|
-
Input(),
|
240
|
-
__metadata("design:type", Boolean)
|
241
|
-
], AXGridDataColumn.prototype, "resizable", void 0);
|
242
|
-
__decorate([
|
243
|
-
Input(),
|
244
|
-
__metadata("design:type", Boolean)
|
245
|
-
], AXGridDataColumn.prototype, "menuColumnDisable", void 0);
|
246
|
-
__decorate([
|
247
|
-
Input(),
|
248
|
-
__metadata("design:type", Boolean)
|
249
|
-
], AXGridDataColumn.prototype, "menuItemDisable", void 0);
|
250
|
-
return AXGridDataColumn;
|
251
|
-
}());
|
252
|
-
|
253
|
-
var AXGridCheckColumn = /** @class */ (function (_super) {
|
254
|
-
__extends(AXGridCheckColumn, _super);
|
255
|
-
function AXGridCheckColumn() {
|
256
|
-
return _super.call(this) || this;
|
257
|
-
}
|
258
|
-
AXGridCheckColumn_1 = AXGridCheckColumn;
|
259
|
-
AXGridCheckColumn.prototype.render = function () {
|
260
|
-
var col = _super.prototype.render.call(this);
|
261
|
-
if (!col.cellRendererFramework) {
|
262
|
-
col.cellRendererFramework = BooleanRenderer;
|
263
|
-
}
|
264
|
-
if (this.allowFiltering) {
|
265
|
-
col.filterFramework = BooleanFilterRenderer;
|
266
|
-
}
|
267
|
-
return col;
|
268
|
-
};
|
269
|
-
var AXGridCheckColumn_1;
|
270
|
-
AXGridCheckColumn = AXGridCheckColumn_1 = __decorate([
|
271
|
-
Component({
|
272
|
-
selector: 'ax-check-column',
|
273
|
-
template: '',
|
274
|
-
providers: [{ provide: AXGridDataColumn, useExisting: AXGridCheckColumn_1 }],
|
275
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
276
|
-
}),
|
277
|
-
__metadata("design:paramtypes", [])
|
278
|
-
], AXGridCheckColumn);
|
279
|
-
return AXGridCheckColumn;
|
280
|
-
}(AXGridDataColumn));
|
281
|
-
var BooleanRenderer = /** @class */ (function () {
|
282
|
-
function BooleanRenderer() {
|
283
|
-
}
|
284
|
-
BooleanRenderer.prototype.agInit = function (params) {
|
285
|
-
this.value = params.value;
|
286
|
-
};
|
287
|
-
BooleanRenderer.prototype.refresh = function (params) {
|
288
|
-
this.value = params.value;
|
289
|
-
return true;
|
290
|
-
};
|
291
|
-
BooleanRenderer = __decorate([
|
292
|
-
Component({
|
293
|
-
template: "\n <ax-check-box [value]='value' readonly='true'></ax-check-box>\n ",
|
294
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
295
|
-
}),
|
296
|
-
__metadata("design:paramtypes", [])
|
297
|
-
], BooleanRenderer);
|
298
|
-
return BooleanRenderer;
|
299
|
-
}());
|
300
|
-
var BooleanFilterRenderer = /** @class */ (function () {
|
301
|
-
function BooleanFilterRenderer() {
|
302
|
-
this.value = null;
|
303
|
-
this.selectItem = [
|
304
|
-
{ value: 0, label: 'True' },
|
305
|
-
{ value: 1, label: 'False' },
|
306
|
-
];
|
307
|
-
}
|
308
|
-
BooleanFilterRenderer.prototype.agInit = function (params) {
|
309
|
-
this.params = params;
|
310
|
-
this.valueGetter = params.valueGetter;
|
311
|
-
};
|
312
|
-
BooleanFilterRenderer.prototype.isFilterActive = function () {
|
313
|
-
return this.value !== null && this.value !== undefined;
|
314
|
-
};
|
315
|
-
BooleanFilterRenderer.prototype.doesFilterPass = function (params) {
|
316
|
-
return this.value === this.valueGetter(params.node);
|
317
|
-
};
|
318
|
-
BooleanFilterRenderer.prototype.getModel = function () {
|
319
|
-
return { value: this.value };
|
320
|
-
};
|
321
|
-
BooleanFilterRenderer.prototype.setModel = function (model) {
|
322
|
-
this.value = model ? model.value : null;
|
323
|
-
};
|
324
|
-
BooleanFilterRenderer.prototype.ngAfterViewInit = function (params) {
|
325
|
-
var _this = this;
|
326
|
-
window.setTimeout(function () {
|
327
|
-
_this.input.element.nativeElement.focus();
|
328
|
-
});
|
329
|
-
};
|
330
|
-
BooleanFilterRenderer.prototype.onChange = function (newValue) {
|
331
|
-
if (this.value !== newValue) {
|
332
|
-
this.value = newValue;
|
333
|
-
this.params.filterChangedCallback();
|
334
|
-
}
|
335
|
-
};
|
336
|
-
__decorate([
|
337
|
-
ViewChild('input', { static: true, read: ViewContainerRef }),
|
338
|
-
__metadata("design:type", Object)
|
339
|
-
], BooleanFilterRenderer.prototype, "input", void 0);
|
340
|
-
BooleanFilterRenderer = __decorate([
|
341
|
-
Component({
|
342
|
-
template: "\n <ax-data-grid-filter>\n <ax-select-box\n label='Select Box'\n [items]='selectItem'\n ></ax-select-box>\n </ax-data-grid-filter>\n ",
|
343
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
344
|
-
})
|
345
|
-
], BooleanFilterRenderer);
|
346
|
-
return BooleanFilterRenderer;
|
347
|
-
}());
|
348
|
-
|
349
|
-
var AXGridCommandColumn = /** @class */ (function (_super) {
|
350
|
-
__extends(AXGridCommandColumn, _super);
|
351
|
-
function AXGridCommandColumn() {
|
352
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
353
|
-
_this.items = [];
|
354
|
-
_this.onItemClick = new EventEmitter();
|
355
|
-
return _this;
|
356
|
-
}
|
357
|
-
AXGridCommandColumn_1 = AXGridCommandColumn;
|
358
|
-
AXGridCommandColumn.prototype.render = function () {
|
359
|
-
var _this = this;
|
360
|
-
var col = _super.prototype.render.call(this);
|
361
|
-
if (!col.cellRendererFramework) {
|
362
|
-
col.cellRendererFramework = CommandRenderer;
|
363
|
-
}
|
364
|
-
col.cellRendererParams = {
|
365
|
-
items: this.items,
|
366
|
-
onClick: function (e) {
|
367
|
-
_this.onItemClick.emit({
|
368
|
-
command: e.name,
|
369
|
-
data: e.data,
|
370
|
-
rowIndex: e.rowIndex,
|
371
|
-
rowLevel: e.rowLevel,
|
372
|
-
htmlEvent: e.htmlEvent
|
373
|
-
});
|
374
|
-
}
|
375
|
-
};
|
376
|
-
col.sortable = false;
|
377
|
-
col.filter = false;
|
378
|
-
col.valueGetter = function (params) {
|
379
|
-
return _this.items;
|
380
|
-
};
|
381
|
-
return col;
|
382
|
-
};
|
383
|
-
var AXGridCommandColumn_1;
|
384
|
-
__decorate([
|
385
|
-
Input(),
|
386
|
-
__metadata("design:type", Object)
|
387
|
-
], AXGridCommandColumn.prototype, "items", void 0);
|
388
|
-
__decorate([
|
389
|
-
Output(),
|
390
|
-
__metadata("design:type", EventEmitter)
|
391
|
-
], AXGridCommandColumn.prototype, "onItemClick", void 0);
|
392
|
-
AXGridCommandColumn = AXGridCommandColumn_1 = __decorate([
|
393
|
-
Component({
|
394
|
-
selector: 'ax-command-column',
|
395
|
-
template: '',
|
396
|
-
providers: [{ provide: AXGridDataColumn, useExisting: AXGridCommandColumn_1 }],
|
397
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
398
|
-
encapsulation: ViewEncapsulation.None
|
399
|
-
})
|
400
|
-
], AXGridCommandColumn);
|
401
|
-
return AXGridCommandColumn;
|
402
|
-
}(AXGridDataColumn));
|
403
|
-
var CommandRenderer = /** @class */ (function () {
|
404
|
-
function CommandRenderer() {
|
405
|
-
this.items = [];
|
406
|
-
}
|
407
|
-
CommandRenderer.prototype.agInit = function (params) {
|
408
|
-
this.mapParams(params);
|
409
|
-
};
|
410
|
-
CommandRenderer.prototype.refresh = function (params) {
|
411
|
-
this.mapParams(params);
|
412
|
-
return true;
|
413
|
-
};
|
414
|
-
CommandRenderer.prototype.mapParams = function (params) {
|
415
|
-
this.node = params.node;
|
416
|
-
this.items = typeof params.items == 'function' ? params.items({ data: this.node.data }) : Array.isArray(params.items) ? params.items : [];
|
417
|
-
this.clickCallback = params.onClick;
|
418
|
-
};
|
419
|
-
CommandRenderer.prototype.onClick = function (item, e) {
|
420
|
-
if (this.clickCallback && !item.disable) {
|
421
|
-
this.clickCallback({
|
422
|
-
name: item.name,
|
423
|
-
rowLevel: this.node.level,
|
424
|
-
rowIndex: this.node.rowIndex,
|
425
|
-
data: this.node.data,
|
426
|
-
htmlEvent: e
|
427
|
-
});
|
428
|
-
}
|
429
|
-
};
|
430
|
-
CommandRenderer = __decorate([
|
431
|
-
Component({
|
432
|
-
selector: 'ax-command-cell',
|
433
|
-
template: "\n <button\n *ngFor=\"let item of items; let i = index\"\n class=\"ax button md ax-grid-command-button {{ item.style || 'ax primary blank' }}\"\n [class.disabled]=\"item.disable\"\n type=\"button\"\n [title]=\"item.tooltip\"\n [attr.tabindex]=\"i\"\n (click)=\"onClick(item, $event)\"\n >\n <i [ngClass]=\"item.icon\"></i>{{ item.text }}\n </button>\n ",
|
434
|
-
encapsulation: ViewEncapsulation.None,
|
435
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
436
|
-
}),
|
437
|
-
__metadata("design:paramtypes", [])
|
438
|
-
], CommandRenderer);
|
439
|
-
return CommandRenderer;
|
440
|
-
}());
|
441
|
-
|
442
|
-
var AXGridDateColumn = /** @class */ (function (_super) {
|
443
|
-
__extends(AXGridDateColumn, _super);
|
444
|
-
function AXGridDateColumn() {
|
445
|
-
var _this = _super.call(this) || this;
|
446
|
-
_this.type = AXConfig.get('dateTime.type');
|
447
|
-
return _this;
|
448
|
-
}
|
449
|
-
AXGridDateColumn_1 = AXGridDateColumn;
|
450
|
-
AXGridDateColumn.prototype.render = function () {
|
451
|
-
var _this = this;
|
452
|
-
var col = _super.prototype.render.call(this);
|
453
|
-
col.cellRendererParams = {
|
454
|
-
format: this.format,
|
455
|
-
};
|
456
|
-
col.comparator = function (valueA, valueB) {
|
457
|
-
var date1 = AXDateTime.convert(valueA);
|
458
|
-
var date2 = AXDateTime.convert(valueB);
|
459
|
-
//
|
460
|
-
if (date1 === null && date2 === null) {
|
461
|
-
return 0;
|
462
|
-
}
|
463
|
-
if (date1 === null) {
|
464
|
-
return -1;
|
465
|
-
}
|
466
|
-
if (date2 === null) {
|
467
|
-
return 1;
|
468
|
-
}
|
469
|
-
return (date1.date.getTime() - date2.date.getTime());
|
470
|
-
};
|
471
|
-
col.valueFormatter = function (params) {
|
472
|
-
var date = AXDateTime.convert(params.value, _this.type);
|
473
|
-
if (date) {
|
474
|
-
return date.format(_this.format);
|
475
|
-
}
|
476
|
-
else {
|
477
|
-
return null;
|
478
|
-
}
|
479
|
-
};
|
480
|
-
col.filter = 'agDateColumnFilter';
|
481
|
-
// col.floatingFilter = true;
|
482
|
-
return col;
|
483
|
-
};
|
484
|
-
var AXGridDateColumn_1;
|
485
|
-
__decorate([
|
486
|
-
Input(),
|
487
|
-
__metadata("design:type", String)
|
488
|
-
], AXGridDateColumn.prototype, "format", void 0);
|
489
|
-
__decorate([
|
490
|
-
Input(),
|
491
|
-
__metadata("design:type", String)
|
492
|
-
], AXGridDateColumn.prototype, "type", void 0);
|
493
|
-
AXGridDateColumn = AXGridDateColumn_1 = __decorate([
|
494
|
-
Component({
|
495
|
-
selector: 'ax-date-column',
|
496
|
-
template: '',
|
497
|
-
providers: [{ provide: AXGridDataColumn, useExisting: AXGridDateColumn_1 }],
|
498
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
499
|
-
}),
|
500
|
-
__metadata("design:paramtypes", [])
|
501
|
-
], AXGridDateColumn);
|
502
|
-
return AXGridDateColumn;
|
503
|
-
}(AXGridDataColumn));
|
504
|
-
var AXDatePickerFilterComponent = /** @class */ (function () {
|
505
|
-
function AXDatePickerFilterComponent() {
|
506
|
-
this.selectableHoliday = false;
|
507
|
-
this.type = 'jalali';
|
508
|
-
}
|
509
|
-
AXDatePickerFilterComponent.prototype.agInit = function (params) {
|
510
|
-
this.params = params;
|
511
|
-
};
|
512
|
-
AXDatePickerFilterComponent.prototype.ngAfterViewInit = function () {
|
513
|
-
};
|
514
|
-
AXDatePickerFilterComponent.prototype.ngOnDestroy = function () {
|
515
|
-
console.log("Destroying DateComponent");
|
516
|
-
};
|
517
|
-
AXDatePickerFilterComponent.prototype.onDateChanged = function (selectedDates) {
|
518
|
-
//this.date = selectedDates[0] || null;
|
519
|
-
this.params.onDateChanged();
|
520
|
-
};
|
521
|
-
AXDatePickerFilterComponent.prototype.getDate = function () {
|
522
|
-
return this.date;
|
523
|
-
};
|
524
|
-
AXDatePickerFilterComponent.prototype.setDate = function (date) {
|
525
|
-
this.date = date || null;
|
526
|
-
//this.picker.setDate(date);
|
527
|
-
};
|
528
|
-
AXDatePickerFilterComponent.prototype.setInputPlaceholder = function (placeholder) {
|
529
|
-
//this.div.nativeElement.setAttribute('placeholder', placeholder);
|
530
|
-
};
|
531
|
-
AXDatePickerFilterComponent.prototype.onValueChanged = function (e) {
|
532
|
-
this.setDate(e.value);
|
533
|
-
this.onDateChanged(e.value);
|
534
|
-
};
|
535
|
-
__decorate([
|
536
|
-
ViewChild(AXDatePickerComponent),
|
537
|
-
__metadata("design:type", AXDatePickerComponent)
|
538
|
-
], AXDatePickerFilterComponent.prototype, "datePicker", void 0);
|
539
|
-
__decorate([
|
540
|
-
ViewChild('div', { read: ElementRef }),
|
541
|
-
__metadata("design:type", ElementRef)
|
542
|
-
], AXDatePickerFilterComponent.prototype, "div", void 0);
|
543
|
-
AXDatePickerFilterComponent = __decorate([
|
544
|
-
Component({
|
545
|
-
selector: 'ax-data-picker-filter',
|
546
|
-
template: "<ax-date-picker [selectableHoliday]=\"selectableHoliday\" [allowClear]=\"true\" (onValueChanged)=\"onValueChanged($event)\" size=\"sm\">\n </ax-date-picker>",
|
547
|
-
host: {},
|
548
|
-
encapsulation: ViewEncapsulation.None
|
549
|
-
})
|
550
|
-
], AXDatePickerFilterComponent);
|
551
|
-
return AXDatePickerFilterComponent;
|
552
|
-
}());
|
553
|
-
|
554
|
-
var AXGridSelectionColumn = /** @class */ (function (_super) {
|
555
|
-
__extends(AXGridSelectionColumn, _super);
|
556
|
-
function AXGridSelectionColumn() {
|
557
|
-
var _this = _super.call(this) || this;
|
558
|
-
_this.pinned = 'start';
|
559
|
-
_this.width = 40;
|
560
|
-
return _this;
|
561
|
-
}
|
562
|
-
AXGridSelectionColumn_1 = AXGridSelectionColumn;
|
563
|
-
AXGridSelectionColumn.prototype.ngOnInit = function () { };
|
564
|
-
AXGridSelectionColumn.prototype.render = function () {
|
565
|
-
var col = _super.prototype.render.call(this);
|
566
|
-
col.checkboxSelection = this.condition ? this.condition : true;
|
567
|
-
// col.headerCheckboxSelection = true;
|
568
|
-
col.pinned = this.pinned === 'start' ? 'right' : 'left';
|
569
|
-
col.filter = false;
|
570
|
-
col.resizable = true;
|
571
|
-
col.sortable = false;
|
572
|
-
col.minWidth = 5;
|
573
|
-
col.width = this.width;
|
574
|
-
col.floatingFilter = false;
|
575
|
-
return col;
|
576
|
-
};
|
577
|
-
var AXGridSelectionColumn_1;
|
578
|
-
__decorate([
|
579
|
-
Input(),
|
580
|
-
__metadata("design:type", Function)
|
581
|
-
], AXGridSelectionColumn.prototype, "condition", void 0);
|
582
|
-
__decorate([
|
583
|
-
Input(),
|
584
|
-
__metadata("design:type", String)
|
585
|
-
], AXGridSelectionColumn.prototype, "pinned", void 0);
|
586
|
-
__decorate([
|
587
|
-
Input(),
|
588
|
-
__metadata("design:type", Number)
|
589
|
-
], AXGridSelectionColumn.prototype, "width", void 0);
|
590
|
-
AXGridSelectionColumn = AXGridSelectionColumn_1 = __decorate([
|
591
|
-
Component({
|
592
|
-
selector: 'ax-selection-column',
|
593
|
-
template: '',
|
594
|
-
providers: [{ provide: AXGridDataColumn, useExisting: AXGridSelectionColumn_1 }],
|
595
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
596
|
-
}),
|
597
|
-
__metadata("design:paramtypes", [])
|
598
|
-
], AXGridSelectionColumn);
|
599
|
-
return AXGridSelectionColumn;
|
600
|
-
}(AXGridDataColumn));
|
601
|
-
|
602
|
-
var AXGridTextColumn = /** @class */ (function (_super) {
|
603
|
-
__extends(AXGridTextColumn, _super);
|
604
|
-
function AXGridTextColumn() {
|
605
|
-
return _super.call(this) || this;
|
606
|
-
}
|
607
|
-
AXGridTextColumn_1 = AXGridTextColumn;
|
608
|
-
AXGridTextColumn.prototype.render = function () {
|
609
|
-
var col = _super.prototype.render.call(this);
|
610
|
-
// if (this.allowFiltering) {
|
611
|
-
// col.filterFramework = TextFilterRenderer;
|
612
|
-
// }
|
613
|
-
col.filter = 'agTextColumnFilter';
|
614
|
-
return col;
|
615
|
-
};
|
616
|
-
var AXGridTextColumn_1;
|
617
|
-
AXGridTextColumn = AXGridTextColumn_1 = __decorate([
|
618
|
-
Component({
|
619
|
-
selector: 'ax-text-column',
|
620
|
-
template: '',
|
621
|
-
providers: [{ provide: AXGridDataColumn, useExisting: AXGridTextColumn_1 }],
|
622
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
623
|
-
}),
|
624
|
-
__metadata("design:paramtypes", [])
|
625
|
-
], AXGridTextColumn);
|
626
|
-
return AXGridTextColumn;
|
627
|
-
}(AXGridDataColumn));
|
628
|
-
var TextFilterRenderer = /** @class */ (function () {
|
629
|
-
function TextFilterRenderer() {
|
630
|
-
this.value = null;
|
631
|
-
}
|
632
|
-
TextFilterRenderer.prototype.agInit = function (params) {
|
633
|
-
this.params = params;
|
634
|
-
this.valueGetter = params.valueGetter;
|
635
|
-
};
|
636
|
-
TextFilterRenderer.prototype.isFilterActive = function () {
|
637
|
-
return this.value !== null && this.value !== undefined;
|
638
|
-
};
|
639
|
-
TextFilterRenderer.prototype.doesFilterPass = function (params) {
|
640
|
-
return this.value === this.valueGetter(params.node);
|
641
|
-
};
|
642
|
-
TextFilterRenderer.prototype.getModel = function () {
|
643
|
-
return { value: this.value };
|
644
|
-
};
|
645
|
-
TextFilterRenderer.prototype.setModel = function (model) {
|
646
|
-
;
|
647
|
-
this.onChange(model ? model.value : null);
|
648
|
-
};
|
649
|
-
TextFilterRenderer.prototype.ngAfterViewInit = function (params) {
|
650
|
-
var _this = this;
|
651
|
-
window.setTimeout(function () {
|
652
|
-
_this.input.focus();
|
653
|
-
});
|
654
|
-
};
|
655
|
-
TextFilterRenderer.prototype.onChange = function (newValue) {
|
656
|
-
if (this.value !== newValue) {
|
657
|
-
this.value = newValue;
|
658
|
-
if (this.value === '') {
|
659
|
-
this.value = null;
|
660
|
-
}
|
661
|
-
this.params.filterChangedCallback();
|
662
|
-
}
|
663
|
-
};
|
664
|
-
__decorate([
|
665
|
-
ViewChild(AXTextBoxComponent, { static: true }),
|
666
|
-
__metadata("design:type", AXTextBoxComponent)
|
667
|
-
], TextFilterRenderer.prototype, "input", void 0);
|
668
|
-
TextFilterRenderer = __decorate([
|
669
|
-
Component({
|
670
|
-
template: "\n <ax-data-grid-filter>\n <ax-text-box label='Filter' allowClear='true' (textChange)='onChange($event)'>\n </ax-text-box>\n </ax-data-grid-filter>\n ",
|
671
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
672
|
-
})
|
673
|
-
], TextFilterRenderer);
|
674
|
-
return TextFilterRenderer;
|
675
|
-
}());
|
676
|
-
|
677
|
-
var AXGridRowNumberColumn = /** @class */ (function (_super) {
|
678
|
-
__extends(AXGridRowNumberColumn, _super);
|
679
|
-
function AXGridRowNumberColumn() {
|
680
|
-
return _super.call(this) || this;
|
681
|
-
}
|
682
|
-
AXGridRowNumberColumn_1 = AXGridRowNumberColumn;
|
683
|
-
AXGridRowNumberColumn.prototype.ngOnInit = function () { };
|
684
|
-
AXGridRowNumberColumn.prototype.render = function () {
|
685
|
-
var col = _super.prototype.render.call(this);
|
686
|
-
// col.checkboxSelection = this.condition ? this.condition : true;
|
687
|
-
// col.headerCheckboxSelection = true;
|
688
|
-
(col.headerName = this.caption ? this.caption : AXConfig.get('layout.rtl') ? 'ردیف' : 'Row'),
|
689
|
-
(col.valueGetter = 'node.rowIndex + 1'),
|
690
|
-
(col.pinned = this.pinned == null ? null : this.pinned === 'start' ? 'right' : 'left'),
|
691
|
-
(col.filter = false);
|
692
|
-
col.resizable = true;
|
693
|
-
col.sortable = false;
|
694
|
-
col.width = this.width;
|
695
|
-
return col;
|
696
|
-
};
|
697
|
-
var AXGridRowNumberColumn_1;
|
698
|
-
__decorate([
|
699
|
-
Input(),
|
700
|
-
__metadata("design:type", Function)
|
701
|
-
], AXGridRowNumberColumn.prototype, "condition", void 0);
|
702
|
-
AXGridRowNumberColumn = AXGridRowNumberColumn_1 = __decorate([
|
703
|
-
Component({
|
704
|
-
selector: 'ax-row-number-column',
|
705
|
-
template: '',
|
706
|
-
providers: [{ provide: AXGridDataColumn, useExisting: AXGridRowNumberColumn_1 }],
|
707
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
708
|
-
}),
|
709
|
-
__metadata("design:paramtypes", [])
|
710
|
-
], AXGridRowNumberColumn);
|
711
|
-
return AXGridRowNumberColumn;
|
712
|
-
}(AXGridDataColumn));
|
713
|
-
|
714
|
-
var AXDataGridRowTemplateComponent = /** @class */ (function () {
|
715
|
-
function AXDataGridRowTemplateComponent() {
|
716
|
-
this.renderer = AXDataGridRowTemplateRenderer;
|
717
|
-
}
|
718
|
-
AXDataGridRowTemplateComponent.prototype.ngOnInit = function () {
|
719
|
-
this.params = {
|
720
|
-
templateRef: this.templateRef
|
721
|
-
};
|
722
|
-
};
|
723
|
-
__decorate([
|
724
|
-
ContentChild(TemplateRef, { static: true }),
|
725
|
-
__metadata("design:type", TemplateRef)
|
726
|
-
], AXDataGridRowTemplateComponent.prototype, "templateRef", void 0);
|
727
|
-
AXDataGridRowTemplateComponent = __decorate([
|
728
|
-
Component({
|
729
|
-
selector: 'ax-row-template',
|
730
|
-
template: "<ng-content></ng-content>"
|
731
|
-
}),
|
732
|
-
__metadata("design:paramtypes", [])
|
733
|
-
], AXDataGridRowTemplateComponent);
|
734
|
-
return AXDataGridRowTemplateComponent;
|
735
|
-
}());
|
736
|
-
var AXDataGridRowTemplateRenderer = /** @class */ (function () {
|
737
|
-
function AXDataGridRowTemplateRenderer() {
|
738
|
-
}
|
739
|
-
AXDataGridRowTemplateRenderer.prototype.refresh = function (params) {
|
740
|
-
return false;
|
741
|
-
};
|
742
|
-
AXDataGridRowTemplateRenderer.prototype.agInit = function (params) {
|
743
|
-
this.data = params.data.callRecords;
|
744
|
-
this.templateRef = params.templateRef;
|
745
|
-
};
|
746
|
-
AXDataGridRowTemplateRenderer = __decorate([
|
747
|
-
Component({
|
748
|
-
template: "<ng-container *ngTemplateOutlet='templateRef; context: { $implicit: data }'></ng-container>"
|
749
|
-
})
|
750
|
-
], AXDataGridRowTemplateRenderer);
|
751
|
-
return AXDataGridRowTemplateRenderer;
|
752
|
-
}());
|
753
|
-
|
754
|
-
var AXDataGridDetailTemplateComponent = /** @class */ (function () {
|
755
|
-
function AXDataGridDetailTemplateComponent() {
|
756
|
-
this.height = 100;
|
757
|
-
this.renderer = AXDataGridDetailTemplateRenderer;
|
758
|
-
}
|
759
|
-
AXDataGridDetailTemplateComponent.prototype.ngOnInit = function () {
|
760
|
-
this.params = {
|
761
|
-
templateRef: this.templateRef
|
762
|
-
};
|
763
|
-
};
|
764
|
-
__decorate([
|
765
|
-
ContentChild(TemplateRef, { static: true }),
|
766
|
-
__metadata("design:type", TemplateRef)
|
767
|
-
], AXDataGridDetailTemplateComponent.prototype, "templateRef", void 0);
|
768
|
-
__decorate([
|
769
|
-
Input(),
|
770
|
-
__metadata("design:type", Number)
|
771
|
-
], AXDataGridDetailTemplateComponent.prototype, "height", void 0);
|
772
|
-
AXDataGridDetailTemplateComponent = __decorate([
|
773
|
-
Component({
|
774
|
-
selector: 'ax-grid-detail-template',
|
775
|
-
template: "<ng-content></ng-content>"
|
776
|
-
}),
|
777
|
-
__metadata("design:paramtypes", [])
|
778
|
-
], AXDataGridDetailTemplateComponent);
|
779
|
-
return AXDataGridDetailTemplateComponent;
|
780
|
-
}());
|
781
|
-
var AXDataGridDetailTemplateRenderer = /** @class */ (function () {
|
782
|
-
function AXDataGridDetailTemplateRenderer() {
|
783
|
-
}
|
784
|
-
AXDataGridDetailTemplateRenderer.prototype.refresh = function (params) {
|
785
|
-
return false;
|
786
|
-
};
|
787
|
-
AXDataGridDetailTemplateRenderer.prototype.agInit = function (params) {
|
788
|
-
this.data = params.data;
|
789
|
-
this.templateRef = params.templateRef;
|
790
|
-
};
|
791
|
-
AXDataGridDetailTemplateRenderer = __decorate([
|
792
|
-
Component({
|
793
|
-
template: "<ng-container *ngTemplateOutlet='templateRef; context: { $implicit: data }'></ng-container>"
|
794
|
-
})
|
795
|
-
], AXDataGridDetailTemplateRenderer);
|
796
|
-
return AXDataGridDetailTemplateRenderer;
|
797
|
-
}());
|
798
|
-
|
799
|
-
LicenseManager.prototype.validateLicense = function () {
|
800
|
-
//console.info('Cracked by Arash Oshnoudi!');
|
801
|
-
};
|
802
|
-
// WatermarkComp.prototype.shouldDisplayWatermark = function () {
|
803
|
-
// return false;
|
804
|
-
// }
|
805
|
-
var AXDataGridColumnsChangeEvent = /** @class */ (function (_super) {
|
806
|
-
__extends(AXDataGridColumnsChangeEvent, _super);
|
807
|
-
function AXDataGridColumnsChangeEvent() {
|
808
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
809
|
-
}
|
810
|
-
return AXDataGridColumnsChangeEvent;
|
811
|
-
}(AXValueEvent));
|
812
|
-
var AXDataGridCellEvent = /** @class */ (function (_super) {
|
813
|
-
__extends(AXDataGridCellEvent, _super);
|
814
|
-
function AXDataGridCellEvent() {
|
815
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
816
|
-
}
|
817
|
-
return AXDataGridCellEvent;
|
818
|
-
}(AXDataEvent));
|
819
|
-
var AXDaagridRowClickEvent = /** @class */ (function (_super) {
|
820
|
-
__extends(AXDaagridRowClickEvent, _super);
|
821
|
-
function AXDaagridRowClickEvent() {
|
822
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
823
|
-
}
|
824
|
-
return AXDaagridRowClickEvent;
|
825
|
-
}(AXDataEvent));
|
826
|
-
var AXDataGridSelectionChangeEvent = /** @class */ (function (_super) {
|
827
|
-
__extends(AXDataGridSelectionChangeEvent, _super);
|
828
|
-
function AXDataGridSelectionChangeEvent() {
|
829
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
830
|
-
}
|
831
|
-
return AXDataGridSelectionChangeEvent;
|
832
|
-
}(AXDataEvent));
|
833
|
-
var AXDataGridRowSelectionChangeEvent = /** @class */ (function (_super) {
|
834
|
-
__extends(AXDataGridRowSelectionChangeEvent, _super);
|
835
|
-
function AXDataGridRowSelectionChangeEvent() {
|
836
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
837
|
-
}
|
838
|
-
return AXDataGridRowSelectionChangeEvent;
|
839
|
-
}(AXDataEvent));
|
840
|
-
var AXDataGridComponent = /** @class */ (function () {
|
841
|
-
function AXDataGridComponent(ref, cdr) {
|
842
|
-
var _this = this;
|
843
|
-
this.ref = ref;
|
844
|
-
this.cdr = cdr;
|
845
|
-
this.columnDefs = [];
|
846
|
-
this.rowModelType = 'clientSide';
|
847
|
-
this.frameworkComponents = {};
|
848
|
-
this.internalHeight = '100%';
|
849
|
-
this.masterDetail = false;
|
850
|
-
this.treeData = false;
|
851
|
-
this.enabelSelect = false;
|
852
|
-
this.gridView = false;
|
853
|
-
this.groupSelectsChildren = false;
|
854
|
-
this.oldSelectionNodes = [];
|
855
|
-
this.paginationAutoPageSize = true;
|
856
|
-
this.paginationPageSize = 10;
|
857
|
-
this.cacheBlockSize = 10;
|
858
|
-
// @Input()
|
859
|
-
// showRowNumber: boolean = true;
|
860
|
-
this.remoteOperation = false;
|
861
|
-
this.rowMultiSelectWithClick = true;
|
862
|
-
this.suppressRowClickSelection = true;
|
863
|
-
this.suppressCellSelection = false;
|
864
|
-
this.sizeColumnsToFit = true;
|
865
|
-
this.showCheckBox = true;
|
866
|
-
this.floatingFilter = false;
|
867
|
-
// @Input()
|
868
|
-
// takeCount: number;
|
869
|
-
this.autoGroupColumnDef = {};
|
870
|
-
this.selectionMode = 'single';
|
871
|
-
// @Input()
|
872
|
-
// allowFiltering: boolean = false;
|
873
|
-
this.selectRow = [];
|
874
|
-
this.rowGroupPanelShow = 'never';
|
875
|
-
this.loadOnInit = true;
|
876
|
-
// @Input()
|
877
|
-
// groupDefaultExpanded: number = 0;
|
878
|
-
this.keyField = 'null';
|
879
|
-
this.hasChildField = 'null';
|
880
|
-
this.columnsChange = new EventEmitter();
|
881
|
-
this._columns = [];
|
882
|
-
this.defaultColDef = {
|
883
|
-
filter: true,
|
884
|
-
floatingFilter: true
|
885
|
-
};
|
886
|
-
this.groupHideOpenParents = false;
|
887
|
-
this.cellClick = new EventEmitter();
|
888
|
-
this.cellDbClick = new EventEmitter();
|
889
|
-
this.cellFocuse = new EventEmitter();
|
890
|
-
this.rowClick = new EventEmitter();
|
891
|
-
this.rowDbClick = new EventEmitter();
|
892
|
-
this.selectionChanged = new EventEmitter();
|
893
|
-
this.rowSelectionChange = new EventEmitter();
|
894
|
-
this.onRowSelectionChanged = new EventEmitter();
|
895
|
-
this.rtl = AXConfig.get('layout.rtl');
|
896
|
-
this.isServerSideGroup = function (e) {
|
897
|
-
return e[_this.hasChildField];
|
898
|
-
};
|
899
|
-
this.getColumnDefs = function () {
|
900
|
-
return _this.gridApi.getColumnDefs();
|
901
|
-
};
|
902
|
-
this.getCurrentPageNumber = function () {
|
903
|
-
return {
|
904
|
-
current: _this.gridApi.paginationGetCurrentPage() + 1,
|
905
|
-
total: _this.gridApi.paginationGetTotalPages()
|
906
|
-
};
|
907
|
-
};
|
908
|
-
this.getServerSideGroupKey = function (e) {
|
909
|
-
return e[_this.keyField];
|
910
|
-
};
|
911
|
-
this.internalGetRowClass = function (p) {
|
912
|
-
if (_this.rowClass) {
|
913
|
-
if (_this.rowClass instanceof Function) {
|
914
|
-
return _this.rowClass({
|
915
|
-
rowIndex: p.node.rowIndex,
|
916
|
-
rowLevel: p.node.level,
|
917
|
-
data: p.data
|
918
|
-
});
|
919
|
-
}
|
920
|
-
else {
|
921
|
-
return _this.rowClass;
|
922
|
-
}
|
923
|
-
}
|
924
|
-
};
|
925
|
-
this.localeText = AXTranslator.get('dataGrid');
|
926
|
-
}
|
927
|
-
Object.defineProperty(AXDataGridComponent.prototype, "searchText", {
|
928
|
-
get: function () {
|
929
|
-
return this._searchText;
|
930
|
-
},
|
931
|
-
set: function (v) {
|
932
|
-
if (v !== this._searchText) {
|
933
|
-
this._searchText = v;
|
934
|
-
if (this.gridApi) {
|
935
|
-
this.refresh();
|
936
|
-
this.gridApi.setQuickFilter(this.searchText);
|
937
|
-
}
|
938
|
-
}
|
939
|
-
},
|
940
|
-
enumerable: true,
|
941
|
-
configurable: true
|
942
|
-
});
|
943
|
-
Object.defineProperty(AXDataGridComponent.prototype, "filter", {
|
944
|
-
get: function () {
|
945
|
-
return this._filter;
|
946
|
-
},
|
947
|
-
set: function (v) {
|
948
|
-
var _this = this;
|
949
|
-
if (v !== this._filter) {
|
950
|
-
this._filter = v;
|
951
|
-
this._filter.forEach(function (f) {
|
952
|
-
var fc = _this.gridApi.getFilterInstance(f.field);
|
953
|
-
if (fc) {
|
954
|
-
var ff = fc.getFrameworkComponentInstance();
|
955
|
-
ff.setModel(f);
|
956
|
-
}
|
957
|
-
});
|
958
|
-
}
|
959
|
-
},
|
960
|
-
enumerable: true,
|
961
|
-
configurable: true
|
962
|
-
});
|
963
|
-
Object.defineProperty(AXDataGridComponent.prototype, "columns", {
|
964
|
-
get: function () {
|
965
|
-
return this._inlineColumns ? __spread(this._columns, this._inlineColumns.toArray()) : this._columns;
|
966
|
-
},
|
967
|
-
set: function (val) {
|
968
|
-
if (val && val.length) {
|
969
|
-
var old = this._columns;
|
970
|
-
this._columns = val;
|
971
|
-
this.columnsChange.emit({ component: this, value: val, oldValue: old, htmlElement: this.ref.nativeElement });
|
972
|
-
}
|
973
|
-
},
|
974
|
-
enumerable: true,
|
975
|
-
configurable: true
|
976
|
-
});
|
977
|
-
Object.defineProperty(AXDataGridComponent.prototype, "dataSource", {
|
978
|
-
get: function () {
|
979
|
-
return this._dataSource ? this._dataSource : this._contentDataSource;
|
980
|
-
},
|
981
|
-
set: function (v) {
|
982
|
-
this._dataSource = v;
|
983
|
-
},
|
984
|
-
enumerable: true,
|
985
|
-
configurable: true
|
986
|
-
});
|
987
|
-
AXDataGridComponent.prototype.getRowHeight = function (param) {
|
988
|
-
if (param.data && param.data.rowHeight && param.node.level == 0) {
|
989
|
-
return param.data.rowHeight;
|
990
|
-
}
|
991
|
-
else if (this.masterDetail == true && param.node.level == 1) {
|
992
|
-
return this.detailRowHeight;
|
993
|
-
}
|
994
|
-
else if (this.masterDetail == false && param.data && param.data.rowHeight) {
|
995
|
-
return param.data.rowHeight;
|
996
|
-
}
|
997
|
-
else {
|
998
|
-
return null;
|
999
|
-
}
|
1000
|
-
};
|
1001
|
-
AXDataGridComponent.prototype.calcHeight = function () {
|
1002
|
-
if (this.toolbar) {
|
1003
|
-
this.internalHeight = "calc(100% - " + 40 + "px)";
|
1004
|
-
}
|
1005
|
-
else {
|
1006
|
-
this.internalHeight = '100%';
|
1007
|
-
}
|
1008
|
-
};
|
1009
|
-
Object.defineProperty(AXDataGridComponent.prototype, "intenalGridDataSource", {
|
1010
|
-
get: function () {
|
1011
|
-
var that = this;
|
1012
|
-
return {
|
1013
|
-
rowCount: null,
|
1014
|
-
getRows: function (params) {
|
1015
|
-
// that.gridApi.gridOptionsWrapper.setProperty('cacheBlockSize', this.takeCount ? this.takeCount : params.api.paginationGetPageSize());
|
1016
|
-
that.dataSourceSuccessCallback = params.successCallback;
|
1017
|
-
var loadParams = {};
|
1018
|
-
loadParams.searchText = that.searchText;
|
1019
|
-
loadParams.skip = params.request.startRow;
|
1020
|
-
// loadParams.take = params.request.endRow - params.request.startRow;
|
1021
|
-
//// loadParams.take = that.takeCount ? that.takeCount : params.api.paginationGetPageSize() * 2;
|
1022
|
-
loadParams.take = params.request.endRow - params.request.startRow;
|
1023
|
-
loadParams.sort = params.request.sortModel.map(function (c) {
|
1024
|
-
return {
|
1025
|
-
field: c.colId,
|
1026
|
-
dir: c.sort
|
1027
|
-
};
|
1028
|
-
});
|
1029
|
-
// loadParams.groups = params.request.rowGroupCols.map(r => r.field);
|
1030
|
-
// loadParams.groupKeys = params.request.groupKeys;
|
1031
|
-
// loadParams.data = params.parentNode.data;
|
1032
|
-
loadParams.group = {
|
1033
|
-
fields: params.request.rowGroupCols.map(function (r) { return r.field; }),
|
1034
|
-
keys: params.request.groupKeys,
|
1035
|
-
parentData: params.parentNode.data
|
1036
|
-
};
|
1037
|
-
loadParams.filter = params.request.filterModel;
|
1038
|
-
debugger;
|
1039
|
-
/// setTimeout(() => {
|
1040
|
-
that.dataSource.fetch(loadParams);
|
1041
|
-
// }, 5000);
|
1042
|
-
}
|
1043
|
-
};
|
1044
|
-
},
|
1045
|
-
enumerable: true,
|
1046
|
-
configurable: true
|
1047
|
-
});
|
1048
|
-
AXDataGridComponent.prototype.getMainMenuItems = function (e) {
|
1049
|
-
return ['pinSubMenu', 'separator'];
|
1050
|
-
};
|
1051
|
-
AXDataGridComponent.prototype.ngOnDestroy = function () {
|
1052
|
-
this.gridApi.destroy();
|
1053
|
-
};
|
1054
|
-
AXDataGridComponent.prototype.paginationGoToPage = function (number) {
|
1055
|
-
this.gridApi.paginationGoToPage(number - 1);
|
1056
|
-
};
|
1057
|
-
// todo gridOptions: GridOptions
|
1058
|
-
AXDataGridComponent.prototype.internalGridReady = function (gridOptions) {
|
1059
|
-
//// gridOptions.api.checkGridSize();
|
1060
|
-
//// this.takeCount = this.takeCount ? this.takeCount : gridOptions.api.paginationGetPageSize() * 2;
|
1061
|
-
// this.takeCount = this.takeCount < 20 ? 20 : this.takeCount;
|
1062
|
-
//// gridOptions.api.gridOptionsWrapper.setProperty('cacheBlockSize', this.takeCount);
|
1063
|
-
this.gridApi = gridOptions.api;
|
1064
|
-
this.mapColumns();
|
1065
|
-
this.calcHeight();
|
1066
|
-
if (!this.loadOnInit) {
|
1067
|
-
this.loadOnInit = true;
|
1068
|
-
return;
|
1069
|
-
}
|
1070
|
-
if (this.remoteOperation) {
|
1071
|
-
this.gridApi.setServerSideDatasource(this.intenalGridDataSource);
|
1072
|
-
}
|
1073
|
-
if (!this.remoteOperation) {
|
1074
|
-
this.refresh();
|
1075
|
-
}
|
1076
|
-
};
|
1077
|
-
AXDataGridComponent.prototype.ngAfterContentInit = function () {
|
1078
|
-
var that = this;
|
1079
|
-
if (this.rowTemplate) {
|
1080
|
-
this.fullWidthCellRendererFramework = this.rowTemplate.renderer;
|
1081
|
-
this.fullWidthCellRendererParams = this.rowTemplate.params;
|
1082
|
-
}
|
1083
|
-
this.frameworkComponents.agDateInput = AXDatePickerFilterComponent;
|
1084
|
-
if (this.gridDetailTemplate) {
|
1085
|
-
this.masterDetail = true;
|
1086
|
-
this.detailCellRendererParams = this.gridDetailTemplate.params;
|
1087
|
-
this.detailCellRenderer = 'detailRendererFramework';
|
1088
|
-
this.frameworkComponents.detailRendererFramework = this.gridDetailTemplate.renderer;
|
1089
|
-
this.detailRowHeight = this.gridDetailTemplate.height;
|
1090
|
-
}
|
1091
|
-
this.isFullWidthCell = function () {
|
1092
|
-
return that.rowTemplate != null;
|
1093
|
-
};
|
1094
|
-
//this.cdr
|
1095
|
-
};
|
1096
|
-
AXDataGridComponent.prototype.ngOnInit = function () {
|
1097
|
-
// if (this.takeCount && this.takeCount > 0) {
|
1098
|
-
// this.paginationPageSize = this.takeCount;
|
1099
|
-
// this.paginationAutoPageSize = false;
|
1100
|
-
// this.cacheBlockSize = this.takeCount;
|
1101
|
-
// }
|
1102
|
-
if (this.selectionMode === 'single') {
|
1103
|
-
this.groupSelectsChildren = false;
|
1104
|
-
}
|
1105
|
-
if (this.keyField !== 'null' && this.hasChildField !== 'null') {
|
1106
|
-
this.rowGroupPanelShow = 'never';
|
1107
|
-
this.treeData = true;
|
1108
|
-
}
|
1109
|
-
if (this.remoteOperation) {
|
1110
|
-
this.rowModelType = 'serverSide';
|
1111
|
-
}
|
1112
|
-
//
|
1113
|
-
if (this.rtl == null) {
|
1114
|
-
this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
|
1115
|
-
}
|
1116
|
-
//
|
1117
|
-
};
|
1118
|
-
AXDataGridComponent.prototype.gridSelectRow = function () {
|
1119
|
-
var _this = this;
|
1120
|
-
if (this.gridApi) {
|
1121
|
-
if (this.selectRow && this.selectRow.length > 0 && this.gridApi !== undefined && typeof this.selectRow[0] != 'object') {
|
1122
|
-
this.gridApi.forEachNode(function (node) {
|
1123
|
-
if (node.data !== undefined) {
|
1124
|
-
var select_1 = false;
|
1125
|
-
_this.selectRow.forEach(function (id) {
|
1126
|
-
if (node.data[_this.keyField] === id) {
|
1127
|
-
select_1 = true;
|
1128
|
-
node.setSelected(select_1);
|
1129
|
-
}
|
1130
|
-
});
|
1131
|
-
}
|
1132
|
-
});
|
1133
|
-
}
|
1134
|
-
else {
|
1135
|
-
this.gridApi.forEachNode(function (node) {
|
1136
|
-
if (node.data !== undefined) {
|
1137
|
-
var select_2 = false;
|
1138
|
-
_this.selectRow.forEach(function (item) {
|
1139
|
-
if (item.rowIndex != undefined && item.rowLevel != undefined) {
|
1140
|
-
if (node.data[_this.keyField] === item.data[_this.keyField]) {
|
1141
|
-
select_2 = true;
|
1142
|
-
}
|
1143
|
-
}
|
1144
|
-
else {
|
1145
|
-
if (node.data[_this.keyField] === item[_this.keyField]) {
|
1146
|
-
select_2 = true;
|
1147
|
-
}
|
1148
|
-
}
|
1149
|
-
});
|
1150
|
-
node.setSelected(select_2);
|
1151
|
-
}
|
1152
|
-
});
|
1153
|
-
}
|
1154
|
-
}
|
1155
|
-
};
|
1156
|
-
// ngAfterViewChecked(): void {
|
1157
|
-
// //Called after every check of the component's view. Applies to components only.
|
1158
|
-
// //Add 'implements AfterViewChecked' to the class.
|
1159
|
-
// // this.selectByValues();
|
1160
|
-
// this.enabelSelect = false;
|
1161
|
-
// }
|
1162
|
-
AXDataGridComponent.prototype.rebuildGrid = function () {
|
1163
|
-
var _this = this;
|
1164
|
-
this.mapColumns();
|
1165
|
-
setTimeout(function () {
|
1166
|
-
if (_this.sizeColumnsToFit) {
|
1167
|
-
_this.gridApi.sizeColumnsToFit();
|
1168
|
-
}
|
1169
|
-
}, 10);
|
1170
|
-
};
|
1171
|
-
AXDataGridComponent.prototype.ngAfterViewInit = function () {
|
1172
|
-
var _this = this;
|
1173
|
-
if (this.treeData === true) {
|
1174
|
-
this.columnDefs = this.columns.map(function (c) { return c.render(); });
|
1175
|
-
var groupColumn = this.columnDefs.find(function (c) { return c.rowGroupIndex == '0' && c.field !== ''; });
|
1176
|
-
this.autoGroupColumnDef = {
|
1177
|
-
headerName: groupColumn.headerName,
|
1178
|
-
width: groupColumn.width,
|
1179
|
-
cellRendererParams: { checkbox: this.showCheckBox },
|
1180
|
-
field: groupColumn.field
|
1181
|
-
};
|
1182
|
-
this.columnDefs.forEach(function (elm) {
|
1183
|
-
if (elm.rowGroupIndex > -1) {
|
1184
|
-
elm.hide = true;
|
1185
|
-
}
|
1186
|
-
});
|
1187
|
-
}
|
1188
|
-
//setTimeout(() => {
|
1189
|
-
this.gridView = true;
|
1190
|
-
//});
|
1191
|
-
this.enabelSelect = true;
|
1192
|
-
this.dataSource.onDataReceived.subscribe(function (_data) {
|
1193
|
-
debugger;
|
1194
|
-
var result = _data.data.result;
|
1195
|
-
_this.hideLoading();
|
1196
|
-
var items;
|
1197
|
-
var totalCount;
|
1198
|
-
if (Array.isArray(result)) {
|
1199
|
-
items = result;
|
1200
|
-
totalCount = result.length;
|
1201
|
-
}
|
1202
|
-
else {
|
1203
|
-
items = result.items;
|
1204
|
-
totalCount = result.totalCount;
|
1205
|
-
}
|
1206
|
-
if (_this.dataSourceSuccessCallback) {
|
1207
|
-
if (!_this.loadOnInit) {
|
1208
|
-
_this.dataSourceSuccessCallback([], 0);
|
1209
|
-
}
|
1210
|
-
else {
|
1211
|
-
_this.dataSourceSuccessCallback(items, totalCount);
|
1212
|
-
}
|
1213
|
-
}
|
1214
|
-
else {
|
1215
|
-
if (!_this.loadOnInit && _this.gridApi !== undefined) {
|
1216
|
-
_this.gridApi.setRowData([]);
|
1217
|
-
}
|
1218
|
-
else if (_this.gridApi !== undefined) {
|
1219
|
-
_this.gridApi.setRowData(items);
|
1220
|
-
}
|
1221
|
-
}
|
1222
|
-
_this.gridSelectRow();
|
1223
|
-
});
|
1224
|
-
this.dataSource.onFetchStart.subscribe(function () {
|
1225
|
-
_this.showLoading();
|
1226
|
-
});
|
1227
|
-
if (this.searchInput) {
|
1228
|
-
this.searchInput.onValueChanged.subscribe(function (c) {
|
1229
|
-
_this.searchText = c.value;
|
1230
|
-
});
|
1231
|
-
}
|
1232
|
-
//
|
1233
|
-
this.cdr.detectChanges();
|
1234
|
-
};
|
1235
|
-
AXDataGridComponent.prototype.mapColumns = function () {
|
1236
|
-
this.columnDefs = this.columns.map(function (c) { return c.render(); });
|
1237
|
-
// if (this.showRowNumber) {
|
1238
|
-
// this.columnDefs.push({
|
1239
|
-
// headerName: AXConfig.get('layout.rtl') ? 'ردیف' : 'Row',
|
1240
|
-
// valueGetter: 'node.rowIndex + 1',
|
1241
|
-
// pinned: AXConfig.get('layout.rtl') ? 'right' : 'left'
|
1242
|
-
// });
|
1243
|
-
// }
|
1244
|
-
if (this.gridDetailTemplate) {
|
1245
|
-
if (this.columnDefs[0].checkboxSelection === true && this.columnDefs[0].field === '') {
|
1246
|
-
this.columnDefs[1].cellRenderer = 'agGroupCellRenderer';
|
1247
|
-
}
|
1248
|
-
else {
|
1249
|
-
this.columnDefs[0].cellRenderer = 'agGroupCellRenderer';
|
1250
|
-
}
|
1251
|
-
}
|
1252
|
-
if (this.hasChildField === 'null') {
|
1253
|
-
var groupColumn = this.columnDefs.find(function (c) { return c.rowGroupIndex === undefined && c.field !== ''; });
|
1254
|
-
if (groupColumn && this.groupHideOpenParents == false) {
|
1255
|
-
this.autoGroupColumnDef = {
|
1256
|
-
headerName: groupColumn.headerName,
|
1257
|
-
width: groupColumn.width,
|
1258
|
-
cellRendererParams: { checkbox: this.showCheckBox },
|
1259
|
-
field: groupColumn.field
|
1260
|
-
};
|
1261
|
-
// groupColumn.hide = true;
|
1262
|
-
}
|
1263
|
-
}
|
1264
|
-
this.columnDefs.forEach(function (elm) {
|
1265
|
-
if (elm.rowGroupIndex > -1) {
|
1266
|
-
elm.hide = true;
|
1267
|
-
}
|
1268
|
-
});
|
1269
|
-
};
|
1270
|
-
AXDataGridComponent.prototype.displayedColumnsChanged = function (e) {
|
1271
|
-
if (this.hasChildField === 'null') {
|
1272
|
-
var ee = e.columnApi.getAllDisplayedColumnGroups();
|
1273
|
-
var eee = ee.find(function (c) { return c.colId !== 'ag-Grid-AutoColumn' && c.colId !== '0'; });
|
1274
|
-
if (eee && eee.colId) {
|
1275
|
-
this.autoGroupColumnDef = {
|
1276
|
-
headerName: eee.colDef.headerName,
|
1277
|
-
width: eee.colDef.width,
|
1278
|
-
cellRendererParams: { checkbox: this.showCheckBox },
|
1279
|
-
field: eee.colDef.field
|
1280
|
-
};
|
1281
|
-
}
|
1282
|
-
// eee.hide = true;
|
1283
|
-
}
|
1284
|
-
};
|
1285
|
-
AXDataGridComponent.prototype.refresh = function (route) {
|
1286
|
-
if (route === void 0) { route = []; }
|
1287
|
-
if (this.remoteOperation && this.gridApi !== undefined) {
|
1288
|
-
// this.gridApi.purgeServerSideCache(route);
|
1289
|
-
this.gridApi.setServerSideDatasource(this.intenalGridDataSource);
|
1290
|
-
}
|
1291
|
-
else {
|
1292
|
-
// TODO : check fetch param
|
1293
|
-
this.dataSource.fetch(null);
|
1294
|
-
}
|
1295
|
-
};
|
1296
|
-
AXDataGridComponent.prototype.internalGridCellClicked = function (e) {
|
1297
|
-
this.cellClick.emit({ data: this.mapCellEvent(e), component: this, htmlElement: this.ref.nativeElement });
|
1298
|
-
};
|
1299
|
-
AXDataGridComponent.prototype.internalGridCellDoubleClicked = function (e) {
|
1300
|
-
this.cellDbClick.emit({ data: this.mapCellEvent(e), component: this, htmlElement: this.ref.nativeElement });
|
1301
|
-
};
|
1302
|
-
AXDataGridComponent.prototype.internalGridCellFocused = function (e) {
|
1303
|
-
this.cellFocuse.emit({ data: this.mapCellEvent(e), htmlElement: this.ref.nativeElement, component: this });
|
1304
|
-
};
|
1305
|
-
AXDataGridComponent.prototype.internalGridRowClicked = function (e) {
|
1306
|
-
if (!e.node.group) {
|
1307
|
-
this.rowClick.emit({ data: this.mapRowEvent(e), component: this, htmlElement: this.ref.nativeElement });
|
1308
|
-
}
|
1309
|
-
};
|
1310
|
-
AXDataGridComponent.prototype.internalGridRowDoubleClicked = function (e) {
|
1311
|
-
if (!e.node.group) {
|
1312
|
-
this.rowDbClick.emit({ data: this.mapRowEvent(e), htmlElement: this.ref.nativeElement, component: this });
|
1313
|
-
}
|
1314
|
-
};
|
1315
|
-
AXDataGridComponent.prototype.differenceOf2Arrays = function (array1, array2) {
|
1316
|
-
var temp = [];
|
1317
|
-
for (var i in array1) {
|
1318
|
-
if (array2.indexOf(array1[i]) === -1) {
|
1319
|
-
temp.push(array1[i]);
|
1320
|
-
}
|
1321
|
-
}
|
1322
|
-
for (var i in array2) {
|
1323
|
-
if (array1.indexOf(array2[i]) === -1) {
|
1324
|
-
temp.push(array2[i]);
|
1325
|
-
}
|
1326
|
-
}
|
1327
|
-
return temp.sort(function (a, b) { return a - b; });
|
1328
|
-
};
|
1329
|
-
AXDataGridComponent.prototype.rowSelectionChanged = function (e) {
|
1330
|
-
var _this = this;
|
1331
|
-
// this.gridApi.forEachNode((node) => {
|
1332
|
-
// if (node.data[this.keyField] == e.node.data[this.keyField]) {
|
1333
|
-
// node.setSelected(e.node.selected);
|
1334
|
-
// }
|
1335
|
-
// });
|
1336
|
-
if (e.node.selected == true) {
|
1337
|
-
this.selectRow = this.selectRow.filter(function (c) { return c[_this.keyField] != e.data[_this.keyField]; });
|
1338
|
-
this.selectRow.push(e.data);
|
1339
|
-
}
|
1340
|
-
else {
|
1341
|
-
this.selectRow = this.selectRow.filter(function (c) { return c[_this.keyField] != e.data[_this.keyField]; });
|
1342
|
-
}
|
1343
|
-
this.rowSelectionChange.emit({ component: this, data: e, htmlElement: this.ref.nativeElement });
|
1344
|
-
// console.log('e', e);
|
1345
|
-
// console.log('select', e.node.selected);
|
1346
|
-
// console.log('index', e.rowIndex);
|
1347
|
-
};
|
1348
|
-
AXDataGridComponent.prototype.internalGridSelectionChanged = function (e) {
|
1349
|
-
var args = { items: [] };
|
1350
|
-
var oldNodes = this.oldSelectionNodes;
|
1351
|
-
var nodes = this.gridApi.getSelectedNodes();
|
1352
|
-
nodes.forEach(function (i) {
|
1353
|
-
args.items.push({
|
1354
|
-
rowLevel: i.level,
|
1355
|
-
rowIndex: i.rowIndex,
|
1356
|
-
data: i.data
|
1357
|
-
});
|
1358
|
-
});
|
1359
|
-
this.selectionChanged.emit({ data: args, component: this, htmlElement: this.ref.nativeElement });
|
1360
|
-
var action = nodes.length > oldNodes.length ? true : false;
|
1361
|
-
var node = this.differenceOf2Arrays(nodes, oldNodes);
|
1362
|
-
this.onRowSelectionChanged.emit({ component: this, selected: action, data: node, htmlElement: this.ref.nativeElement });
|
1363
|
-
this.oldSelectionNodes = nodes;
|
1364
|
-
};
|
1365
|
-
AXDataGridComponent.prototype.mapCellEvent = function (e) {
|
1366
|
-
return {
|
1367
|
-
rowLevel: 0,
|
1368
|
-
column: e.column,
|
1369
|
-
data: e.data,
|
1370
|
-
rowIndex: e.rowIndex,
|
1371
|
-
value: e.value
|
1372
|
-
};
|
1373
|
-
};
|
1374
|
-
AXDataGridComponent.prototype.mapRowEvent = function (e) {
|
1375
|
-
return {
|
1376
|
-
rowLevel: 0,
|
1377
|
-
data: e.data,
|
1378
|
-
rowIndex: e.rowIndex
|
1379
|
-
};
|
1380
|
-
};
|
1381
|
-
AXDataGridComponent.prototype.deselectAll = function () {
|
1382
|
-
this.gridApi.deselectAll();
|
1383
|
-
};
|
1384
|
-
AXDataGridComponent.prototype.showLoading = function () {
|
1385
|
-
if (this.gridApi) {
|
1386
|
-
this.gridApi.showLoadingOverlay();
|
1387
|
-
}
|
1388
|
-
};
|
1389
|
-
AXDataGridComponent.prototype.hideLoading = function () {
|
1390
|
-
if (this.gridApi) {
|
1391
|
-
this.gridApi.hideOverlay();
|
1392
|
-
}
|
1393
|
-
};
|
1394
|
-
AXDataGridComponent.prototype.internalGridSizeChanged = function (e) {
|
1395
|
-
if (e.clientWidth > 0 && e.clientHeight > 0) {
|
1396
|
-
this.performSizeColumnsToFit(e.api);
|
1397
|
-
}
|
1398
|
-
// this.refresh();
|
1399
|
-
// this.gridApi.paginationGoToFirstPage();
|
1400
|
-
};
|
1401
|
-
AXDataGridComponent.prototype.internalGridFirstDataRendered = function (e) {
|
1402
|
-
this.performSizeColumnsToFit(e.api);
|
1403
|
-
};
|
1404
|
-
AXDataGridComponent.prototype.performSizeColumnsToFit = function (api) {
|
1405
|
-
if (this.sizeColumnsToFit) {
|
1406
|
-
api.sizeColumnsToFit();
|
1407
|
-
}
|
1408
|
-
};
|
1409
|
-
AXDataGridComponent.ctorParameters = function () { return [
|
1410
|
-
{ type: ElementRef },
|
1411
|
-
{ type: ChangeDetectorRef }
|
1412
|
-
]; };
|
1413
|
-
__decorate([
|
1414
|
-
Input(),
|
1415
|
-
__metadata("design:type", Boolean)
|
1416
|
-
], AXDataGridComponent.prototype, "remoteOperation", void 0);
|
1417
|
-
__decorate([
|
1418
|
-
Input(),
|
1419
|
-
__metadata("design:type", Boolean)
|
1420
|
-
], AXDataGridComponent.prototype, "rowMultiSelectWithClick", void 0);
|
1421
|
-
__decorate([
|
1422
|
-
Input(),
|
1423
|
-
__metadata("design:type", Boolean)
|
1424
|
-
], AXDataGridComponent.prototype, "suppressRowClickSelection", void 0);
|
1425
|
-
__decorate([
|
1426
|
-
Input(),
|
1427
|
-
__metadata("design:type", Boolean)
|
1428
|
-
], AXDataGridComponent.prototype, "suppressCellSelection", void 0);
|
1429
|
-
__decorate([
|
1430
|
-
Input(),
|
1431
|
-
__metadata("design:type", Boolean)
|
1432
|
-
], AXDataGridComponent.prototype, "sizeColumnsToFit", void 0);
|
1433
|
-
__decorate([
|
1434
|
-
Input(),
|
1435
|
-
__metadata("design:type", Boolean)
|
1436
|
-
], AXDataGridComponent.prototype, "showCheckBox", void 0);
|
1437
|
-
__decorate([
|
1438
|
-
Input(),
|
1439
|
-
__metadata("design:type", Boolean)
|
1440
|
-
], AXDataGridComponent.prototype, "floatingFilter", void 0);
|
1441
|
-
__decorate([
|
1442
|
-
Input(),
|
1443
|
-
__metadata("design:type", String)
|
1444
|
-
], AXDataGridComponent.prototype, "selectionMode", void 0);
|
1445
|
-
__decorate([
|
1446
|
-
Input(),
|
1447
|
-
__metadata("design:type", Array)
|
1448
|
-
], AXDataGridComponent.prototype, "selectRow", void 0);
|
1449
|
-
__decorate([
|
1450
|
-
Input(),
|
1451
|
-
__metadata("design:type", String)
|
1452
|
-
], AXDataGridComponent.prototype, "rowGroupPanelShow", void 0);
|
1453
|
-
__decorate([
|
1454
|
-
Input(),
|
1455
|
-
__metadata("design:type", Boolean)
|
1456
|
-
], AXDataGridComponent.prototype, "loadOnInit", void 0);
|
1457
|
-
__decorate([
|
1458
|
-
Input(),
|
1459
|
-
__metadata("design:type", String)
|
1460
|
-
], AXDataGridComponent.prototype, "keyField", void 0);
|
1461
|
-
__decorate([
|
1462
|
-
Input(),
|
1463
|
-
__metadata("design:type", String)
|
1464
|
-
], AXDataGridComponent.prototype, "hasChildField", void 0);
|
1465
|
-
__decorate([
|
1466
|
-
Input(),
|
1467
|
-
__metadata("design:type", String),
|
1468
|
-
__metadata("design:paramtypes", [String])
|
1469
|
-
], AXDataGridComponent.prototype, "searchText", null);
|
1470
|
-
__decorate([
|
1471
|
-
Input(),
|
1472
|
-
__metadata("design:type", Array),
|
1473
|
-
__metadata("design:paramtypes", [Array])
|
1474
|
-
], AXDataGridComponent.prototype, "filter", null);
|
1475
|
-
__decorate([
|
1476
|
-
ContentChildren(AXGridDataColumn),
|
1477
|
-
__metadata("design:type", QueryList)
|
1478
|
-
], AXDataGridComponent.prototype, "_inlineColumns", void 0);
|
1479
|
-
__decorate([
|
1480
|
-
Output(),
|
1481
|
-
__metadata("design:type", EventEmitter)
|
1482
|
-
], AXDataGridComponent.prototype, "columnsChange", void 0);
|
1483
|
-
__decorate([
|
1484
|
-
Input(),
|
1485
|
-
__metadata("design:type", Array),
|
1486
|
-
__metadata("design:paramtypes", [Array])
|
1487
|
-
], AXDataGridComponent.prototype, "columns", null);
|
1488
|
-
__decorate([
|
1489
|
-
Input(),
|
1490
|
-
__metadata("design:type", Object)
|
1491
|
-
], AXDataGridComponent.prototype, "rowHeight", void 0);
|
1492
|
-
__decorate([
|
1493
|
-
ContentChild(AXToolbarSearchComponent, { static: true }),
|
1494
|
-
__metadata("design:type", AXToolbarSearchComponent)
|
1495
|
-
], AXDataGridComponent.prototype, "searchInput", void 0);
|
1496
|
-
__decorate([
|
1497
|
-
ContentChild(AXToolbarComponent, { static: true }),
|
1498
|
-
__metadata("design:type", AXToolbarComponent)
|
1499
|
-
], AXDataGridComponent.prototype, "toolbar", void 0);
|
1500
|
-
__decorate([
|
1501
|
-
ContentChild(AXDataGridRowTemplateComponent, { static: true }),
|
1502
|
-
__metadata("design:type", AXDataGridRowTemplateComponent)
|
1503
|
-
], AXDataGridComponent.prototype, "rowTemplate", void 0);
|
1504
|
-
__decorate([
|
1505
|
-
ContentChild(AXDataGridDetailTemplateComponent, { static: true }),
|
1506
|
-
__metadata("design:type", AXDataGridDetailTemplateComponent)
|
1507
|
-
], AXDataGridComponent.prototype, "gridDetailTemplate", void 0);
|
1508
|
-
__decorate([
|
1509
|
-
ContentChild(AXDataSourceComponent, { static: true }),
|
1510
|
-
__metadata("design:type", AXDataSourceComponent)
|
1511
|
-
], AXDataGridComponent.prototype, "_contentDataSource", void 0);
|
1512
|
-
__decorate([
|
1513
|
-
Input(),
|
1514
|
-
__metadata("design:type", AXDataSourceComponent),
|
1515
|
-
__metadata("design:paramtypes", [AXDataSourceComponent])
|
1516
|
-
], AXDataGridComponent.prototype, "dataSource", null);
|
1517
|
-
__decorate([
|
1518
|
-
Input(),
|
1519
|
-
__metadata("design:type", Boolean)
|
1520
|
-
], AXDataGridComponent.prototype, "groupHideOpenParents", void 0);
|
1521
|
-
__decorate([
|
1522
|
-
Output(),
|
1523
|
-
__metadata("design:type", EventEmitter)
|
1524
|
-
], AXDataGridComponent.prototype, "cellClick", void 0);
|
1525
|
-
__decorate([
|
1526
|
-
Output(),
|
1527
|
-
__metadata("design:type", EventEmitter)
|
1528
|
-
], AXDataGridComponent.prototype, "cellDbClick", void 0);
|
1529
|
-
__decorate([
|
1530
|
-
Output(),
|
1531
|
-
__metadata("design:type", EventEmitter)
|
1532
|
-
], AXDataGridComponent.prototype, "cellFocuse", void 0);
|
1533
|
-
__decorate([
|
1534
|
-
Output(),
|
1535
|
-
__metadata("design:type", EventEmitter)
|
1536
|
-
], AXDataGridComponent.prototype, "rowClick", void 0);
|
1537
|
-
__decorate([
|
1538
|
-
Output(),
|
1539
|
-
__metadata("design:type", EventEmitter)
|
1540
|
-
], AXDataGridComponent.prototype, "rowDbClick", void 0);
|
1541
|
-
__decorate([
|
1542
|
-
Output(),
|
1543
|
-
__metadata("design:type", EventEmitter)
|
1544
|
-
], AXDataGridComponent.prototype, "selectionChanged", void 0);
|
1545
|
-
__decorate([
|
1546
|
-
Output(),
|
1547
|
-
__metadata("design:type", EventEmitter)
|
1548
|
-
], AXDataGridComponent.prototype, "rowSelectionChange", void 0);
|
1549
|
-
__decorate([
|
1550
|
-
Output(),
|
1551
|
-
__metadata("design:type", EventEmitter)
|
1552
|
-
], AXDataGridComponent.prototype, "onRowSelectionChanged", void 0);
|
1553
|
-
__decorate([
|
1554
|
-
Input(),
|
1555
|
-
__metadata("design:type", Function)
|
1556
|
-
], AXDataGridComponent.prototype, "rowClass", void 0);
|
1557
|
-
__decorate([
|
1558
|
-
Input(),
|
1559
|
-
__metadata("design:type", Boolean)
|
1560
|
-
], AXDataGridComponent.prototype, "rtl", void 0);
|
1561
|
-
AXDataGridComponent = __decorate([
|
1562
|
-
Component({
|
1563
|
-
selector: 'ax-data-grid',
|
1564
|
-
template: "<div class=\"ax-grid-toolbar\" *ngIf=\"toolbar\">\r\n <ng-content select=\"ax-toolbar\"></ng-content>\r\n</div>\r\n<!-- [enableSorting]=\"true\" [enableColResize]=\"true\" [enableFilter]=\"allowFiltering\" -->\r\n<ag-grid-angular *ngIf=\"gridView\" class=\"ag-theme-balham\" [getRowClass]=\"internalGetRowClass\"\r\n [style.height]=\"internalHeight\" [columnDefs]=\"columnDefs\" [enableRtl]=\"rtl\" [pagination]=\"true\"\r\n [rowGroupPanelShow]=\"rowGroupPanelShow\" [rowModelType]=\"rowModelType\" [detailRowHeight]=\"detailRowHeight\"\r\n [getRowHeight]=\"getRowHeight\" [paginationAutoPageSize]=\"paginationAutoPageSize\"\r\n [paginationPageSize]=\"paginationPageSize\" [suppressMenuHide]=\"true\" [frameworkComponents]=\"frameworkComponents\"\r\n [isFullWidthCell]=\"isFullWidthCell\" [rowSelection]=\"selectionMode\" [rowMultiSelectWithClick]=\"rowMultiSelectWithClick\"\r\n [fullWidthCellRendererFramework]=\"fullWidthCellRendererFramework\"\r\n [fullWidthCellRendererParams]=\"fullWidthCellRendererParams\" (cellClicked)=\"internalGridCellClicked($event)\"\r\n (cellDoubleClicked)=\"internalGridCellDoubleClicked($event)\" (cellFocused)=\"internalGridCellFocused($event)\"\r\n (rowClicked)=\"internalGridRowClicked($event)\" (selectionChanged)=\"internalGridSelectionChanged($event)\"\r\n (rowSelected)=\"rowSelectionChanged($event)\" (rowDoubleClicked)=\"internalGridRowDoubleClicked($event)\"\r\n (gridReady)=\"internalGridReady($event)\" [groupSelectsChildren]=\"groupSelectsChildren\"\r\n [suppressRowClickSelection]=\"suppressRowClickSelection\" [groupSelectsFiltered]=\"true\"\r\n [suppressCellSelection]=\"suppressCellSelection\" [autoGroupColumnDef]=\"autoGroupColumnDef\"\r\n [suppressAggFuncInHeader]=\"true\" [treeData]=\"treeData\" [animateRows]=\"true\" [isServerSideGroup]=\"isServerSideGroup\"\r\n [getServerSideGroupKey]=\"getServerSideGroupKey\" [masterDetail]=\"masterDetail\"\r\n [detailCellRendererParams]=\"detailCellRendererParams\" [detailCellRenderer]=\"detailCellRenderer\"\r\n (gridSizeChanged)=\"internalGridSizeChanged($event)\" (firstDataRendered)=\"internalGridFirstDataRendered($event)\"\r\n [localeText]=\"localeText\" [groupHideOpenParents]=\"groupHideOpenParents\" [enableRangeSelection]=\"true\"\r\n [enableRangeSelection]=\"false\" [allowContextMenuWithControlKey]=\"false\" [getMainMenuItems]=\"getMainMenuItems\">\r\n</ag-grid-angular>\r\n\r\n<!-- (displayedColumnsChanged)=\"displayedColumnsChanged($event)\" -->",
|
1565
|
-
encapsulation: ViewEncapsulation.None
|
1566
|
-
// changeDetection: ChangeDetectionStrategy.OnPush
|
1567
|
-
}),
|
1568
|
-
__metadata("design:paramtypes", [ElementRef, ChangeDetectorRef])
|
1569
|
-
], AXDataGridComponent);
|
1570
|
-
return AXDataGridComponent;
|
1571
|
-
}());
|
1572
|
-
|
1573
|
-
var AXDataGridFilterComponent = /** @class */ (function () {
|
1574
|
-
function AXDataGridFilterComponent() {
|
1575
|
-
}
|
1576
|
-
AXDataGridFilterComponent = __decorate([
|
1577
|
-
Component({
|
1578
|
-
selector: 'ax-data-grid-filter',
|
1579
|
-
template: "\n <div class='ax-grid-filter-container'>\n <ng-content></ng-content>\n <div class='btn-group' role='group'>\n <button type='button' class='btn btn-primary btn-sm'>\n <i class='fas fa-filter'></i>\n </button>\n <button type='button' class='btn btn-danger btn-sm'>\n <i class='fas fa-trash-alt'></i>\n </button>\n </div>\n </div>\n ",
|
1580
|
-
encapsulation: ViewEncapsulation.None
|
1581
|
-
})
|
1582
|
-
], AXDataGridFilterComponent);
|
1583
|
-
return AXDataGridFilterComponent;
|
1584
|
-
}());
|
1585
|
-
|
1586
|
-
var AXDataGridModule = /** @class */ (function () {
|
1587
|
-
function AXDataGridModule() {
|
1588
|
-
}
|
1589
|
-
AXDataGridModule = __decorate([
|
1590
|
-
NgModule({
|
1591
|
-
declarations: [
|
1592
|
-
AXDataGridComponent,
|
1593
|
-
AXGridTextColumn,
|
1594
|
-
AXGridCheckColumn,
|
1595
|
-
AXGridSelectionColumn,
|
1596
|
-
AXGridDateColumn,
|
1597
|
-
AXGridRowNumberColumn,
|
1598
|
-
AXGridCommandColumn,
|
1599
|
-
BooleanRenderer,
|
1600
|
-
BooleanFilterRenderer,
|
1601
|
-
TextFilterRenderer,
|
1602
|
-
AXDataGridFilterComponent,
|
1603
|
-
AXDataGridRowTemplateComponent,
|
1604
|
-
AXDataGridDetailTemplateComponent,
|
1605
|
-
AXDataGridRowTemplateRenderer,
|
1606
|
-
AXDataGridDetailTemplateRenderer,
|
1607
|
-
AXDataGridCellTemplateComponent,
|
1608
|
-
AXDataGridCellTemplateRenderer,
|
1609
|
-
AXDatePickerFilterComponent,
|
1610
|
-
CommandRenderer
|
1611
|
-
],
|
1612
|
-
imports: [
|
1613
|
-
CommonModule,
|
1614
|
-
AXCoreModule,
|
1615
|
-
FormsModule,
|
1616
|
-
//AgGridModule,
|
1617
|
-
AXTextBoxModule,
|
1618
|
-
AXCheckBoxModule,
|
1619
|
-
AXSelectBoxModule,
|
1620
|
-
AXDataSourceModule,
|
1621
|
-
AXButtonModule,
|
1622
|
-
AXDatePickerModule,
|
1623
|
-
AgGridModule.withComponents([AXDatePickerFilterComponent])
|
1624
|
-
],
|
1625
|
-
exports: [
|
1626
|
-
AXDataGridComponent,
|
1627
|
-
AXDataGridFilterComponent,
|
1628
|
-
AXDataGridRowTemplateComponent,
|
1629
|
-
AXDataGridDetailTemplateComponent,
|
1630
|
-
AXDataGridRowTemplateRenderer,
|
1631
|
-
AXDataGridDetailTemplateRenderer,
|
1632
|
-
AXDataGridCellTemplateComponent,
|
1633
|
-
AXDataGridCellTemplateRenderer,
|
1634
|
-
AXGridTextColumn,
|
1635
|
-
AXGridRowNumberColumn,
|
1636
|
-
AXGridCheckColumn,
|
1637
|
-
AXGridDateColumn,
|
1638
|
-
AXGridSelectionColumn,
|
1639
|
-
AXGridCommandColumn,
|
1640
|
-
BooleanRenderer,
|
1641
|
-
BooleanFilterRenderer,
|
1642
|
-
CommandRenderer
|
1643
|
-
],
|
1644
|
-
entryComponents: [
|
1645
|
-
BooleanRenderer,
|
1646
|
-
BooleanFilterRenderer,
|
1647
|
-
CommandRenderer,
|
1648
|
-
TextFilterRenderer,
|
1649
|
-
AXDataGridRowTemplateComponent,
|
1650
|
-
AXDataGridDetailTemplateComponent,
|
1651
|
-
AXDataGridRowTemplateRenderer,
|
1652
|
-
AXDataGridDetailTemplateRenderer,
|
1653
|
-
AXDataGridCellTemplateComponent,
|
1654
|
-
AXDataGridCellTemplateRenderer
|
1655
|
-
],
|
1656
|
-
providers: []
|
1657
|
-
})
|
1658
|
-
], AXDataGridModule);
|
1659
|
-
return AXDataGridModule;
|
1660
|
-
}());
|
1661
|
-
|
1662
|
-
var AXDataLovPopupComponent = /** @class */ (function (_super) {
|
1663
|
-
__extends(AXDataLovPopupComponent, _super);
|
1664
|
-
function AXDataLovPopupComponent(cdr, ref) {
|
1665
|
-
var _this = _super.call(this) || this;
|
1666
|
-
_this.cdr = cdr;
|
1667
|
-
_this.ref = ref;
|
1668
|
-
_this.columns = [];
|
1669
|
-
_this.selectedItems = [];
|
1670
|
-
_this.keyField = '';
|
1671
|
-
_this.allowNull = true;
|
1672
|
-
_this.rtl = AXConfig.get('layout.rtl');
|
1673
|
-
_this.selectedRows = [];
|
1674
|
-
return _this;
|
1675
|
-
}
|
1676
|
-
AXDataLovPopupComponent.prototype.ngOnInit = function () {
|
1677
|
-
if (this.rtl == null) {
|
1678
|
-
this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
|
1679
|
-
}
|
1680
|
-
};
|
1681
|
-
AXDataLovPopupComponent.prototype.onDoneClick = function () {
|
1682
|
-
if (this.selectedItems) {
|
1683
|
-
this.close(this.selectedItems);
|
1684
|
-
}
|
1685
|
-
else {
|
1686
|
-
this.close();
|
1687
|
-
}
|
1688
|
-
};
|
1689
|
-
AXDataLovPopupComponent.prototype.rowDoubleClicked = function (e) {
|
1690
|
-
var _this = this;
|
1691
|
-
console.log('s', e.data.data);
|
1692
|
-
if (this.selectionMode == 'single') {
|
1693
|
-
this.selectedItems = [];
|
1694
|
-
}
|
1695
|
-
this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.data[_this.keyField]; });
|
1696
|
-
this.selectedItems.push(e.data.data);
|
1697
|
-
this.onDoneClick();
|
1698
|
-
};
|
1699
|
-
AXDataLovPopupComponent.prototype.onCancelClick = function () {
|
1700
|
-
this.close();
|
1701
|
-
};
|
1702
|
-
AXDataLovPopupComponent.prototype.rowSelectionChange = function (e) {
|
1703
|
-
var _this = this;
|
1704
|
-
if (e.data.node.selected == true) {
|
1705
|
-
this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.node.data[_this.keyField]; });
|
1706
|
-
this.selectedItems.push(e.data.node.data);
|
1707
|
-
}
|
1708
|
-
else {
|
1709
|
-
if (this.allowNull == true || (this.allowNull == false && this.selectedItems.length > 1)) {
|
1710
|
-
this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.node.data[_this.keyField]; });
|
1711
|
-
}
|
1712
|
-
}
|
1713
|
-
// console.log('ee', e)
|
1714
|
-
// // console.log('e', e);
|
1715
|
-
// console.log('select', e.data.node.selected);
|
1716
|
-
// console.log('index', e.data.rowIndex);
|
1717
|
-
};
|
1718
|
-
AXDataLovPopupComponent.prototype.ngAfterViewInit = function () {
|
1719
|
-
var _this = this;
|
1720
|
-
this.selectedItems.forEach(function (ele) {
|
1721
|
-
_this.selectedRows.push(ele);
|
1722
|
-
});
|
1723
|
-
this.searchBox.focus();
|
1724
|
-
if (this.dataSource.onDataReceived) {
|
1725
|
-
this.dataSource.onDataReceived.subscribe(function (arg) {
|
1726
|
-
_this.cdr.markForCheck();
|
1727
|
-
_this.cdr.detectChanges();
|
1728
|
-
});
|
1729
|
-
}
|
1730
|
-
};
|
1731
|
-
// onValueSearchChanged(e) {
|
1732
|
-
// const params: AXDataSourceReadParams = {}
|
1733
|
-
// params.searchText = e.value;
|
1734
|
-
// // params.take = 100;
|
1735
|
-
// // params.skip = 0
|
1736
|
-
// this.dataSource.fetch(params);
|
1737
|
-
// }
|
1738
|
-
AXDataLovPopupComponent.prototype.getFooterButtons = function () {
|
1739
|
-
return [
|
1740
|
-
{
|
1741
|
-
text: AXTranslator.get('common.confirm'),
|
1742
|
-
name: 'confirm',
|
1743
|
-
style: 'ax primary',
|
1744
|
-
icon: 'far fa-check-circle'
|
1745
|
-
},
|
1746
|
-
{
|
1747
|
-
text: AXTranslator.get('common.cancel'),
|
1748
|
-
name: 'cancel',
|
1749
|
-
style: 'ax light',
|
1750
|
-
icon: 'far fa-times-circle'
|
1751
|
-
}
|
1752
|
-
];
|
1753
|
-
};
|
1754
|
-
AXDataLovPopupComponent.prototype.onFooterButtonClick = function (e) {
|
1755
|
-
if (e.name === 'confirm') {
|
1756
|
-
this.onDoneClick();
|
1757
|
-
}
|
1758
|
-
if (e.name === 'cancel') {
|
1759
|
-
this.onCancelClick();
|
1760
|
-
}
|
1761
|
-
};
|
1762
|
-
AXDataLovPopupComponent.ctorParameters = function () { return [
|
1763
|
-
{ type: ChangeDetectorRef },
|
1764
|
-
{ type: ElementRef }
|
1765
|
-
]; };
|
1766
|
-
__decorate([
|
1767
|
-
ViewChild('grid', { static: true }),
|
1768
|
-
__metadata("design:type", AXDataGridComponent)
|
1769
|
-
], AXDataLovPopupComponent.prototype, "grid", void 0);
|
1770
|
-
__decorate([
|
1771
|
-
ViewChild('searchBox'),
|
1772
|
-
__metadata("design:type", AXToolbarSearchComponent)
|
1773
|
-
], AXDataLovPopupComponent.prototype, "searchBox", void 0);
|
1774
|
-
AXDataLovPopupComponent = __decorate([
|
1775
|
-
Component({
|
1776
|
-
template: "<div style=\"height: 70vh; padding: 0.5em;\">\r\n <div style=\"height: calc(100%);\">\r\n\r\n <ax-data-grid [rtl]=\"rtl\" [suppressRowClickSelection]=\"false\" [keyField]=\"keyField\"\r\n [hasChildField]=\"hasChildField\" [selectRow]=\"selectedItems\" #grid [columns]=\"columns\"\r\n [remoteOperation]=\"true\" [selectionMode]=\"selectionMode\" (rowDbClick)=\"rowDoubleClicked($event)\"\r\n (rowSelectionChange)=\"rowSelectionChange($event)\" [dataSource]=\"dataSource\">\r\n <ax-toolbar>\r\n <ax-toolbar-search #searchBox style=\"width: 100%;\"></ax-toolbar-search>\r\n </ax-toolbar>\r\n <ax-selection-column *ngIf=\"selectionMode== 'single'? false : true\"></ax-selection-column>\r\n <!-- <ax-data-source [provideData]=\"dataSource.provideData\">\r\n </ax-data-source> -->\r\n </ax-data-grid>\r\n </div>\r\n</div>"
|
1777
|
-
}),
|
1778
|
-
__metadata("design:paramtypes", [ChangeDetectorRef, ElementRef])
|
1779
|
-
], AXDataLovPopupComponent);
|
1780
|
-
return AXDataLovPopupComponent;
|
1781
|
-
}(AXBasePopupPageComponent));
|
1782
|
-
|
1783
|
-
var AXLOVComponent = /** @class */ (function (_super) {
|
1784
|
-
__extends(AXLOVComponent, _super);
|
1785
|
-
function AXLOVComponent(popup, ref) {
|
1786
|
-
var _this = _super.call(this) || this;
|
1787
|
-
_this.popup = popup;
|
1788
|
-
_this.ref = ref;
|
1789
|
-
_this.textField = '';
|
1790
|
-
_this.allowSearch = true;
|
1791
|
-
_this.valueField = '';
|
1792
|
-
_this.hasChildField = 'null';
|
1793
|
-
_this.allowNull = true;
|
1794
|
-
_this.popupSize = 'md';
|
1795
|
-
_this.selectedItems = [];
|
1796
|
-
// @Input()
|
1797
|
-
// selectedValues: any[] = [];
|
1798
|
-
_this.readonly = false;
|
1799
|
-
_this.disabled = false;
|
1800
|
-
_this.chipsWidth = '';
|
1801
|
-
_this.size = 'md';
|
1802
|
-
_this.mode = 'single';
|
1803
|
-
_this.onSelectionChange = new EventEmitter();
|
1804
|
-
_this.rtl = AXConfig.get('layout.rtl');
|
1805
|
-
return _this;
|
1806
|
-
}
|
1807
|
-
AXLOVComponent_1 = AXLOVComponent;
|
1808
|
-
Object.defineProperty(AXLOVComponent.prototype, "validation", {
|
1809
|
-
get: function () {
|
1810
|
-
return this._validation ? this._validation : this._contentValidation;
|
1811
|
-
},
|
1812
|
-
set: function (v) {
|
1813
|
-
this._validation = v;
|
1814
|
-
},
|
1815
|
-
enumerable: true,
|
1816
|
-
configurable: true
|
1817
|
-
});
|
1818
|
-
AXLOVComponent.prototype.focus = function () {
|
1819
|
-
this.selectBox.focus();
|
1820
|
-
};
|
1821
|
-
AXLOVComponent.prototype.refresh = function () {
|
1822
|
-
this.selectBox.refresh();
|
1823
|
-
};
|
1824
|
-
AXLOVComponent.prototype.handleButtonClick = function () {
|
1825
|
-
this.open();
|
1826
|
-
};
|
1827
|
-
AXLOVComponent.prototype.ngOnInit = function () {
|
1828
|
-
var _this = this;
|
1829
|
-
if (this.rtl == null) {
|
1830
|
-
this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
|
1831
|
-
}
|
1832
|
-
// this.selectVal = this.selectedValues;
|
1833
|
-
this.onSelectionChange.subscribe(function (c) {
|
1834
|
-
_this.clearValidationStyle(_this.ref.nativeElement);
|
1835
|
-
});
|
1836
|
-
};
|
1837
|
-
AXLOVComponent.prototype.ngAfterContentInit = function () {
|
1838
|
-
this.initValidation(this.ref, 'selectedItems', this.validation);
|
1839
|
-
};
|
1840
|
-
AXLOVComponent.prototype.handleSelectChange = function (e) {
|
1841
|
-
// console.log('se' + JSON.stringify(e));
|
1842
|
-
this.onSelectionChange.emit({ data: this.selectedItems, component: this, htmlElement: this.ref.nativeElement });
|
1843
|
-
};
|
1844
|
-
AXLOVComponent.prototype.open = function () {
|
1845
|
-
var _this = this;
|
1846
|
-
return new Promise(function (resolve) {
|
1847
|
-
_this.selectBox.dropdown.close();
|
1848
|
-
_this.popup
|
1849
|
-
.open(AXDataLovPopupComponent, {
|
1850
|
-
size: _this.popupSize,
|
1851
|
-
// closable: false,
|
1852
|
-
data: {
|
1853
|
-
dataSource: _this.dataSource,
|
1854
|
-
selectionMode: _this.mode,
|
1855
|
-
columns: _this.columns.toArray(),
|
1856
|
-
// selectedItems: this.selectedValues,
|
1857
|
-
selectedItems: _this.selectedItems,
|
1858
|
-
keyField: _this.valueField,
|
1859
|
-
allowNull: _this.allowNull,
|
1860
|
-
hasChildField: _this.hasChildField,
|
1861
|
-
rtl: _this.rtl
|
1862
|
-
},
|
1863
|
-
title: _this.caption
|
1864
|
-
// size: this.size,
|
1865
|
-
})
|
1866
|
-
.then(function (c) {
|
1867
|
-
if (c.data) {
|
1868
|
-
// this.selectedValues = [];
|
1869
|
-
_this.selectedItems = [];
|
1870
|
-
c.data.forEach(function (elm) {
|
1871
|
-
_this.selectedItems.push(elm);
|
1872
|
-
});
|
1873
|
-
// this.selectedItems = c.data;
|
1874
|
-
// this.selectBox.refresh();
|
1875
|
-
// console.log('se' + JSON.stringify(this.selectedItems));
|
1876
|
-
_this.onSelectionChange.emit({ data: _this.selectedItems, component: _this, htmlElement: _this.ref.nativeElement });
|
1877
|
-
if (resolve) {
|
1878
|
-
resolve(c.data);
|
1879
|
-
}
|
1880
|
-
}
|
1881
|
-
else {
|
1882
|
-
if (resolve) {
|
1883
|
-
resolve(_this.selectedItems);
|
1884
|
-
}
|
1885
|
-
}
|
1886
|
-
_this.selectBox.refresh();
|
1887
|
-
});
|
1888
|
-
});
|
1889
|
-
};
|
1890
|
-
var AXLOVComponent_1;
|
1891
|
-
AXLOVComponent.ctorParameters = function () { return [
|
1892
|
-
{ type: AXPopupService },
|
1893
|
-
{ type: ElementRef }
|
1894
|
-
]; };
|
1895
|
-
__decorate([
|
1896
|
-
ContentChild(AXValidation, { static: true }),
|
1897
|
-
__metadata("design:type", AXValidation)
|
1898
|
-
], AXLOVComponent.prototype, "_contentValidation", void 0);
|
1899
|
-
__decorate([
|
1900
|
-
Input(),
|
1901
|
-
__metadata("design:type", AXValidation),
|
1902
|
-
__metadata("design:paramtypes", [AXValidation])
|
1903
|
-
], AXLOVComponent.prototype, "validation", null);
|
1904
|
-
__decorate([
|
1905
|
-
ViewChild('selectBox', { static: true }),
|
1906
|
-
__metadata("design:type", AXSelectBoxComponent)
|
1907
|
-
], AXLOVComponent.prototype, "selectBox", void 0);
|
1908
|
-
__decorate([
|
1909
|
-
ContentChild(AXDataSourceComponent, { static: true }),
|
1910
|
-
__metadata("design:type", AXDataSourceComponent)
|
1911
|
-
], AXLOVComponent.prototype, "dataSource", void 0);
|
1912
|
-
__decorate([
|
1913
|
-
ContentChildren(AXGridDataColumn),
|
1914
|
-
__metadata("design:type", QueryList)
|
1915
|
-
], AXLOVComponent.prototype, "columns", void 0);
|
1916
|
-
__decorate([
|
1917
|
-
ContentChild('itemTemplate', { static: true }),
|
1918
|
-
__metadata("design:type", TemplateRef)
|
1919
|
-
], AXLOVComponent.prototype, "rowTemplate", void 0);
|
1920
|
-
__decorate([
|
1921
|
-
Input(),
|
1922
|
-
__metadata("design:type", String)
|
1923
|
-
], AXLOVComponent.prototype, "textField", void 0);
|
1924
|
-
__decorate([
|
1925
|
-
Input(),
|
1926
|
-
__metadata("design:type", Boolean)
|
1927
|
-
], AXLOVComponent.prototype, "allowSearch", void 0);
|
1928
|
-
__decorate([
|
1929
|
-
Input(),
|
1930
|
-
__metadata("design:type", String)
|
1931
|
-
], AXLOVComponent.prototype, "valueField", void 0);
|
1932
|
-
__decorate([
|
1933
|
-
Input(),
|
1934
|
-
__metadata("design:type", String)
|
1935
|
-
], AXLOVComponent.prototype, "hasChildField", void 0);
|
1936
|
-
__decorate([
|
1937
|
-
Input(),
|
1938
|
-
__metadata("design:type", Boolean)
|
1939
|
-
], AXLOVComponent.prototype, "allowNull", void 0);
|
1940
|
-
__decorate([
|
1941
|
-
Input(),
|
1942
|
-
__metadata("design:type", String)
|
1943
|
-
], AXLOVComponent.prototype, "popupSize", void 0);
|
1944
|
-
__decorate([
|
1945
|
-
Input(),
|
1946
|
-
__metadata("design:type", Array)
|
1947
|
-
], AXLOVComponent.prototype, "selectedItems", void 0);
|
1948
|
-
__decorate([
|
1949
|
-
Input(),
|
1950
|
-
__metadata("design:type", Boolean)
|
1951
|
-
], AXLOVComponent.prototype, "readonly", void 0);
|
1952
|
-
__decorate([
|
1953
|
-
Input(),
|
1954
|
-
__metadata("design:type", Boolean)
|
1955
|
-
], AXLOVComponent.prototype, "disabled", void 0);
|
1956
|
-
__decorate([
|
1957
|
-
Input(),
|
1958
|
-
__metadata("design:type", String)
|
1959
|
-
], AXLOVComponent.prototype, "chipsWidth", void 0);
|
1960
|
-
__decorate([
|
1961
|
-
Input(),
|
1962
|
-
__metadata("design:type", String)
|
1963
|
-
], AXLOVComponent.prototype, "size", void 0);
|
1964
|
-
__decorate([
|
1965
|
-
Input(),
|
1966
|
-
__metadata("design:type", String)
|
1967
|
-
], AXLOVComponent.prototype, "caption", void 0);
|
1968
|
-
__decorate([
|
1969
|
-
Input(),
|
1970
|
-
__metadata("design:type", String)
|
1971
|
-
], AXLOVComponent.prototype, "mode", void 0);
|
1972
|
-
__decorate([
|
1973
|
-
Input(),
|
1974
|
-
__metadata("design:type", String)
|
1975
|
-
], AXLOVComponent.prototype, "placeholder", void 0);
|
1976
|
-
__decorate([
|
1977
|
-
Output(),
|
1978
|
-
__metadata("design:type", EventEmitter)
|
1979
|
-
], AXLOVComponent.prototype, "onSelectionChange", void 0);
|
1980
|
-
__decorate([
|
1981
|
-
Input(),
|
1982
|
-
__metadata("design:type", Boolean)
|
1983
|
-
], AXLOVComponent.prototype, "rtl", void 0);
|
1984
|
-
AXLOVComponent = AXLOVComponent_1 = __decorate([
|
1985
|
-
Component({
|
1986
|
-
selector: 'ax-lov',
|
1987
|
-
template: "<ax-select-box [rowInputTemplate]=\"rowTemplate\" [rtl]=\"rtl\" [allowSearch]=\"allowSearch\" #selectBox [showDropDownButton]=\"false\" [allowNull]=\"allowNull\"\r\n [remoteOperation]=\"true\" [placeholder]=\"placeholder\" [size]=\"size\" [textField]=\"textField\" [valueField]=\"valueField\"\r\n [disabled]=\"disabled\" [mode]=\"mode\" [(selectedItems)]=\"selectedItems\"\r\n (selectionChanged)=\"handleSelectChange($event)\" [dataSource]=\"dataSource\">\r\n <ng-container start>\r\n <ng-content select=\"[start]\">\r\n </ng-content>\r\n </ng-container>\r\n <ng-container end>\r\n <ax-button icon=\"far fa-bars icon\" [disabled]=\"disabled\" type=\"light blank\" (click)=\"handleButtonClick()\" end\r\n [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ng-content select=\"[end]\">\r\n </ng-content>\r\n </ng-container>\r\n</ax-select-box>\r\n\r\n\r\n<!-- <ax-select-box2 [rtl]=\"rtl\" [allowSearch]=\"allowSearch\" #selectBox [showDropDownButton]=\"false\" [allowNull]=\"allowNull\"\r\n [remoteOperation]=\"true\" [placeholder]=\"placeholder\" [size]=\"size\" [textField]=\"textField\" [valueField]=\"valueField\"\r\n [disabled]=\"disabled\" [selectionMode]=\"mode\" (onValueChanged)=\"handleSelectChange($event)\" [dataSource]=\"dataSource\"\r\n [(value)]=\"selectedItems\" selectionDataMode=\"item\">\r\n <ng-container start>\r\n <ng-content select=\"[start]\">\r\n </ng-content>\r\n </ng-container>\r\n <ng-container end>\r\n <ax-button icon=\"far fa-bars icon\" [disabled]=\"disabled\" type=\"primary blank\" (click)=\"handleButtonClick()\" end\r\n [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ng-content select=\"[end]\">\r\n </ng-content>\r\n </ng-container>\r\n</ax-select-box2> -->\r\n\r\n\r\n<!-- <div class=\"ax-lov-box\" [style.display]=\"mode=='hidden' ? 'none':'unset'\">\r\n <div class=\"ax-field-set\">\r\n <div class=\"ax-field-set-wrapper\" [ngClass]=\"{ 'no-label': !label }\">\r\n <fieldset [ngClass]=\"{ 'input-focused': isFocused, 'input-error': errorText }\">\r\n <legend *ngIf=\"label\">\r\n {{ label }}\r\n </legend>\r\n </fieldset>\r\n <input type=\"text\" [(ngModel)]=\"text\" [placeholder]=\"placeholder\" (keyup)=\"handleKeyEvent($event)\"\r\n (blur)=\"handleBlurEvent($event)\" (focus)=\"handleFocusEvent($event)\" class=\"ax-text-box\" disabled />\r\n <div class=\"ax-field-set-button\">\r\n <button *ngIf=\"text && allowClear\" type=\"button\" class=\"btn btn-light\" (click)=\"clearText()\">\r\n <i class=\"far fa-times\"></i>\r\n </button>\r\n <button type=\"button\" class=\" btn btn-primary\" (click)=\"handleButtonClick($event)\">\r\n <i class=\"far fa-check-circle\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"validation-text\" *ngIf=\"errorText\">\r\n {{ errorText }}\r\n </div>\r\n\r\n</div> -->",
|
1988
|
-
encapsulation: ViewEncapsulation.None,
|
1989
|
-
host: { style: 'width: 100%' },
|
1990
|
-
providers: [{ provide: AXValidatableComponent, useExisting: AXLOVComponent_1 }]
|
1991
|
-
}),
|
1992
|
-
__metadata("design:paramtypes", [AXPopupService, ElementRef])
|
1993
|
-
], AXLOVComponent);
|
1994
|
-
return AXLOVComponent;
|
1995
|
-
}(AXValidatableComponent));
|
1996
|
-
|
1997
|
-
var AXLOVModule = /** @class */ (function () {
|
1998
|
-
function AXLOVModule() {
|
1999
|
-
}
|
2000
|
-
AXLOVModule = __decorate([
|
2001
|
-
NgModule({
|
2002
|
-
declarations: [AXLOVComponent, AXDataLovPopupComponent],
|
2003
|
-
imports: [CommonModule, FormsModule, AXDataGridModule, AXDataSourceModule, AXButtonModule, AXToolbarModule, AXSelectBoxModule, AXSearchBoxModule],
|
2004
|
-
exports: [AXLOVComponent, AXDataLovPopupComponent],
|
2005
|
-
providers: [],
|
2006
|
-
entryComponents: [AXDataLovPopupComponent]
|
2007
|
-
})
|
2008
|
-
], AXLOVModule);
|
2009
|
-
return AXLOVModule;
|
2010
|
-
}());
|
2011
|
-
|
2012
|
-
/**
|
2013
|
-
* Generated bundle index. Do not edit.
|
2014
|
-
*/
|
2015
|
-
|
2016
|
-
export { AXDaagridRowClickEvent, AXDataGridCellEvent, AXDataGridCellTemplateComponent, AXDataGridCellTemplateRenderer, AXDataGridColumnsChangeEvent, AXDataGridComponent, AXDataGridDetailTemplateComponent, AXDataGridDetailTemplateRenderer, AXDataGridFilterComponent, AXDataGridModule, AXDataGridRowSelectionChangeEvent, AXDataGridRowTemplateComponent, AXDataGridRowTemplateRenderer, AXDataGridSelectionChangeEvent, AXDataLovPopupComponent, AXDatePickerFilterComponent, AXGridCheckColumn, AXGridCommandColumn, AXGridDataColumn, AXGridDateColumn, AXGridRowNumberColumn, AXGridSelectionColumn, AXGridTextColumn, AXLOVComponent, AXLOVModule, BooleanFilterRenderer, BooleanRenderer, CommandRenderer, TextFilterRenderer };
|
2017
|
-
//# sourceMappingURL=acorex-data-grid.js.map
|