@acorex/data-grid 3.0.25 → 3.0.26

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