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