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