slick-components 4.4.8 → 4.4.12

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.
@@ -69,7 +69,7 @@
69
69
  };
70
70
  return SlickInitService;
71
71
  }());
72
- SlickInitService.version = "4.4.8";
72
+ SlickInitService.version = "4.4.12";
73
73
  SlickInitService.decorators = [
74
74
  { type: core.Injectable }
75
75
  ];
@@ -4372,6 +4372,7 @@
4372
4372
  this.showPhotoGallery = false;
4373
4373
  this.showCheckboxes = false;
4374
4374
  this.thumbnailSize = 90;
4375
+ this.confirmDelete = true;
4375
4376
  this.filesEmitter = new core.EventEmitter();
4376
4377
  this.onFileDeleteEmitter = new core.EventEmitter();
4377
4378
  this.onFileCheckChanged = new core.EventEmitter();
@@ -4389,6 +4390,8 @@
4389
4390
  this.showPhotoGallery = (changes.showPhotoGallery.currentValue.toString().toLowerCase() !== 'false');
4390
4391
  if (changes.showCheckboxes && changes.showCheckboxes.currentValue)
4391
4392
  this.showCheckboxes = (changes.showCheckboxes.currentValue.toString().toLowerCase() !== 'false');
4393
+ if (changes.deleteConfirmation && changes.deleteConfirmation.currentValue)
4394
+ this.confirmDelete = (this.confirmDelete.toString() === 'true') ? true : false;
4392
4395
  };
4393
4396
  SlickFileListComponent.prototype.fileClicked = function (file, idx) {
4394
4397
  if (this.showPhotoGallery === true) {
@@ -4402,10 +4405,15 @@
4402
4405
  this.filesEmitter.emit(this.files);
4403
4406
  };
4404
4407
  SlickFileListComponent.prototype.onFileDelete = function (file, idx) {
4405
- this.files.splice(idx, 1);
4406
- this.filesEmitter.emit(this.files);
4407
- if (this.onFileDeleteEmitter)
4408
- this.onFileDeleteEmitter.emit(file);
4408
+ return __awaiter(this, void 0, void 0, function () {
4409
+ return __generator(this, function (_a) {
4410
+ this.files.splice(idx, 1);
4411
+ this.filesEmitter.emit(this.files);
4412
+ if (this.onFileDeleteEmitter)
4413
+ this.onFileDeleteEmitter.emit(file);
4414
+ return [2 /*return*/];
4415
+ });
4416
+ });
4409
4417
  };
4410
4418
  SlickFileListComponent.prototype.onCheckChanged = function (e, fileIdx) {
4411
4419
  return __awaiter(this, void 0, void 0, function () {
@@ -4462,7 +4470,7 @@
4462
4470
  SlickFileListComponent.decorators = [
4463
4471
  { type: core.Component, args: [{
4464
4472
  selector: 'slick-file-list',
4465
- template: "<div #containerRef id=\"slick-file-list_{{uuid}}\" class=\"slick-file-list\">\r\n\t<slick-file-list-item *ngFor=\"let file of files; let idx = index\" [file]=\"file\" [allowDelete]=\"allowDelete\" [showPhotoGallery]=\"showPhotoGallery\" [showCheckbox]=\"showCheckboxes\" [thumbnailSize]=\"thumbnailSize\" (checkChanged)=\"onCheckChanged($event, idx)\" (fileClicked)=\"fileClicked($event, idx)\" (fileChanged)=\"onFileChange($event, idx)\" (fileDelete)=\"onFileDelete($event, idx)\"></slick-file-list-item>\r\n</div>\r\n\r\n<slick-photo-gallery #photoGalleryRef *ngIf=\"showPhotoGallery === true\" [files]=\"files\"></slick-photo-gallery>"
4473
+ template: "<div #containerRef id=\"slick-file-list_{{uuid}}\" class=\"slick-file-list\">\r\n\t<slick-file-list-item *ngFor=\"let file of files; let idx = index\" \r\n\t\t\t\t\t\t [file]=\"file\" \r\n\t\t\t\t\t\t [allowDelete]=\"allowDelete\" \r\n\t\t\t\t\t\t [showPhotoGallery]=\"showPhotoGallery\" \r\n\t\t\t\t\t\t [showCheckbox]=\"showCheckboxes\" \r\n\t\t\t\t\t\t [thumbnailSize]=\"thumbnailSize\" \r\n\t\t\t\t\t\t [confirmDelete]=\"confirmDelete\"\r\n\t\t\t\t\t\t (checkChanged)=\"onCheckChanged($event, idx)\" \r\n\t\t\t\t\t\t (fileClicked)=\"fileClicked($event, idx)\" \r\n\t\t\t\t\t\t (fileChanged)=\"onFileChange($event, idx)\" \r\n\t\t\t\t\t\t (fileDelete)=\"onFileDelete($event, idx)\"></slick-file-list-item>\r\n</div>\r\n\r\n<slick-photo-gallery #photoGalleryRef *ngIf=\"showPhotoGallery === true\" [files]=\"files\"></slick-photo-gallery>\r\n\r\n"
4466
4474
  },] }
4467
4475
  ];
4468
4476
  /** @nocollapse */
@@ -4473,6 +4481,7 @@
4473
4481
  showPhotoGallery: [{ type: core.Input, args: ["showPhotoGallery",] }],
4474
4482
  showCheckboxes: [{ type: core.Input, args: ["showCheckboxes",] }],
4475
4483
  thumbnailSize: [{ type: core.Input, args: ["thumbnailSize",] }],
4484
+ confirmDelete: [{ type: core.Input, args: ["confirmDelete",] }],
4476
4485
  filesEmitter: [{ type: core.Output, args: ["filesEmitter",] }],
4477
4486
  onFileDeleteEmitter: [{ type: core.Output, args: ["onFileDelete",] }],
4478
4487
  onFileCheckChanged: [{ type: core.Output, args: ["onFileCheckChanged",] }],
@@ -4490,6 +4499,7 @@
4490
4499
  this.allowDelete = true;
4491
4500
  this.showPhotoGallery = false;
4492
4501
  this.showCheckbox = false;
4502
+ this.confirmDelete = true;
4493
4503
  this.fileChangeEmitter = new core.EventEmitter();
4494
4504
  this.fileDeleteEmitter = new core.EventEmitter();
4495
4505
  this.fileClicked = new core.EventEmitter();
@@ -4513,6 +4523,7 @@
4513
4523
  this.showPhotoGallery = (changes.showPhotoGallery.currentValue.toString().toLowerCase() !== 'false');
4514
4524
  if (changes.showCheckbox && changes.showCheckbox.currentValue)
4515
4525
  this.showCheckbox = (changes.showCheckbox.currentValue.toString().toLowerCase() !== 'false');
4526
+ this.confirmDelete = (this.confirmDelete.toString() === 'true') ? true : false;
4516
4527
  if (this.file && this.file.name && !this.file.thumbnailBase64Image && !this.file.url) {
4517
4528
  if (this.file.isChecked === null)
4518
4529
  this.file.isChecked = false;
@@ -4542,8 +4553,27 @@
4542
4553
  if (this.fileClicked)
4543
4554
  this.fileClicked.emit(this.file);
4544
4555
  };
4545
- SlickFileListItemComponent.prototype.deleteFile = function () {
4546
- this.fileDeleteEmitter.emit(this.file);
4556
+ SlickFileListItemComponent.prototype.deleteFile = function (e) {
4557
+ return __awaiter(this, void 0, void 0, function () {
4558
+ var result;
4559
+ return __generator(this, function (_b) {
4560
+ switch (_b.label) {
4561
+ case 0:
4562
+ e.stopPropagation();
4563
+ e.preventDefault();
4564
+ if (!(this.confirmDelete === false)) return [3 /*break*/, 1];
4565
+ this.fileDeleteEmitter.emit(this.file);
4566
+ return [3 /*break*/, 3];
4567
+ case 1: return [4 /*yield*/, this.deleteConfirmRef.confirm()];
4568
+ case 2:
4569
+ result = _b.sent();
4570
+ if (result === exports.SlickConfirmDialogResults.Ok)
4571
+ this.fileDeleteEmitter.emit(this.file);
4572
+ _b.label = 3;
4573
+ case 3: return [2 /*return*/];
4574
+ }
4575
+ });
4576
+ });
4547
4577
  };
4548
4578
  SlickFileListItemComponent.prototype.editTitle = function () {
4549
4579
  return __awaiter(this, void 0, void 0, function () {
@@ -4616,7 +4646,7 @@
4616
4646
  SlickFileListItemComponent.decorators = [
4617
4647
  { type: core.Component, args: [{
4618
4648
  selector: 'slick-file-list-item',
4619
- template: "<div class=\"slick-file-list-item\" id=\"slick-file-list-item_{{uuid}}\">\r\n\t<div class=\"slick-file-list-item_img card\" (click)=\"onClick()\" [ngStyle]=\"{ 'cursor': (showPhotoGallery === true) ? 'pointer' : 'default' }\" [style.minHeight.px]=\"itemSize + 2\" [style.minWidth.px]=\"itemSize\">\r\n\t\t<img *ngIf=\"file.thumbnailBase64Image\" [src]=\"file.thumbnailBase64Image\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<img *ngIf=\"!file.thumbnailBase64Image && file.base64Image\" [src]=\"file.base64Image\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<img *ngIf=\"!file.thumbnailBase64Image && !file.base64Image && file.thumbnailUrl\" [src]=\"file.thumbnailUrl\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<img *ngIf=\"!file.thumbnailBase64Image && !file.base64Image && !file.thumbnailUrl && file.url\" [src]=\"file.url\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<i *ngIf=\"allowDelete\" class=\"fas fa-times-circle bg-white text-danger\" (click)=\"deleteFile()\"></i>\r\n\t</div>\r\n\t<div class=\"slick-file-list-item_title\" *ngIf=\"fileDateFormatted\" [style.minWidth.px]=\"itemSize\" [style.maxWidth.px]=\"itemSize\">\r\n\t\t<div class=\"slick-file-list-item_date\" *ngIf=\"fileDateFormatted\" [style.minWidth.px]=\"itemSize\">{{fileDateFormatted}}</div>\r\n\t</div>\r\n\t<div class=\"slick-file-list-item_title\" [style.minWidth.px]=\"itemSize\" [style.maxWidth.px]=\"itemSize\">\r\n\t\t<div class=\"slick-file-list-item_display-title\" #titleDivRef style=\"cursor: pointer\" *ngIf=\"!isEditing\" (click)=\"editTitle()\">{{file.title}}</div>\r\n\t\t<div #editTitleDivRef class=\"slick-file-list-item_edit-title\" *ngIf=\"isEditing\"><input #editTitleInputRef type=\"text\" class=\"form-control\" [(ngModel)]=\"tempTitle\" (keydown)=\"onKeyDown($event)\" [style.width.px]=\"itemSize\" /></div>\r\n\t</div>\r\n\r\n\t<!-- We want the user to be able to click just a little outside of the checkbox and still have it check -->\r\n\t<div *ngIf=\"showCheckbox === true\" class=\"slick-file-checkbox\" (click)=\"onCheckboxClicked($event)\">\r\n\t\t<input type=\"checkbox\" [ngModel]=\"file.isChecked\" />\r\n\t</div>\r\n</div>\r\n"
4649
+ template: "<div class=\"slick-file-list-item\" id=\"slick-file-list-item_{{uuid}}\">\r\n\t<div class=\"slick-file-list-item_img card\" (click)=\"onClick()\" [ngStyle]=\"{ 'cursor': (showPhotoGallery === true) ? 'pointer' : 'default' }\" [style.minHeight.px]=\"itemSize + 2\" [style.minWidth.px]=\"itemSize\">\r\n\t\t<img *ngIf=\"file.thumbnailBase64Image\" [src]=\"file.thumbnailBase64Image\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<img *ngIf=\"!file.thumbnailBase64Image && file.base64Image\" [src]=\"file.base64Image\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<img *ngIf=\"!file.thumbnailBase64Image && !file.base64Image && file.thumbnailUrl\" [src]=\"file.thumbnailUrl\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<img *ngIf=\"!file.thumbnailBase64Image && !file.base64Image && !file.thumbnailUrl && file.url\" [src]=\"file.url\" [style.maxWidth.px]=\"itemImgSize\" [style.maxHeight.px]=\"itemImgSize\" />\r\n\t\t<i *ngIf=\"allowDelete\" class=\"fas fa-times-circle bg-white text-danger\" (click)=\"deleteFile($event)\"></i>\r\n\t</div>\r\n\t<div class=\"slick-file-list-item_title\" *ngIf=\"fileDateFormatted\" [style.minWidth.px]=\"itemSize\" [style.maxWidth.px]=\"itemSize\">\r\n\t\t<div class=\"slick-file-list-item_date\" *ngIf=\"fileDateFormatted\" [style.minWidth.px]=\"itemSize\">{{fileDateFormatted}}</div>\r\n\t</div>\r\n\t<div class=\"slick-file-list-item_title\" [style.minWidth.px]=\"itemSize\" [style.maxWidth.px]=\"itemSize\">\r\n\t\t<div class=\"slick-file-list-item_display-title\" #titleDivRef style=\"cursor: pointer\" *ngIf=\"!isEditing\" (click)=\"editTitle()\">{{file.title}}</div>\r\n\t\t<div #editTitleDivRef class=\"slick-file-list-item_edit-title\" *ngIf=\"isEditing\"><input #editTitleInputRef type=\"text\" class=\"form-control\" [(ngModel)]=\"tempTitle\" (keydown)=\"onKeyDown($event)\" [style.width.px]=\"itemSize\" /></div>\r\n\t</div>\r\n\r\n\t<!-- We want the user to be able to click just a little outside of the checkbox and still have it check -->\r\n\t<div *ngIf=\"showCheckbox === true\" class=\"slick-file-checkbox\" (click)=\"onCheckboxClicked($event)\">\r\n\t\t<input type=\"checkbox\" [ngModel]=\"file.isChecked\" />\r\n\t</div>\r\n</div>\r\n\r\n<slick-confirm-dialog #deleteConfirmRef>\r\n\t<h4 class=\"p-0 m-0 text-danger\">Are you sure you want to delete?</h4>\r\n</slick-confirm-dialog>"
4620
4650
  },] }
4621
4651
  ];
4622
4652
  /** @nocollapse */
@@ -4627,13 +4657,15 @@
4627
4657
  showPhotoGallery: [{ type: core.Input, args: ["showPhotoGallery",] }],
4628
4658
  showCheckbox: [{ type: core.Input, args: ["showCheckbox",] }],
4629
4659
  thumbnailSize: [{ type: core.Input, args: ["thumbnailSize",] }],
4660
+ confirmDelete: [{ type: core.Input, args: ["confirmDelete",] }],
4630
4661
  fileChangeEmitter: [{ type: core.Output, args: ["fileChange",] }],
4631
4662
  fileDeleteEmitter: [{ type: core.Output, args: ["fileDelete",] }],
4632
4663
  fileClicked: [{ type: core.Output, args: ["fileClicked",] }],
4633
4664
  checkChanged: [{ type: core.Output, args: ["checkChanged",] }],
4634
4665
  titleDivRef: [{ type: core.ViewChild, args: ["titleDivRef",] }],
4635
4666
  editTitleDivRef: [{ type: core.ViewChild, args: ["editTitleDivRef",] }],
4636
- editTitleInputRef: [{ type: core.ViewChild, args: ["editTitleInputRef",] }]
4667
+ editTitleInputRef: [{ type: core.ViewChild, args: ["editTitleInputRef",] }],
4668
+ deleteConfirmRef: [{ type: core.ViewChild, args: ["deleteConfirmRef",] }]
4637
4669
  };
4638
4670
 
4639
4671
  var SlickPhotoGalleryModel = /** @class */ (function () {
@@ -4772,7 +4804,7 @@
4772
4804
  }());
4773
4805
  SlickFileListModule.decorators = [
4774
4806
  { type: core.NgModule, args: [{
4775
- imports: [common.CommonModule, forms.FormsModule, SlickPhotoGalleryModule],
4807
+ imports: [common.CommonModule, forms.FormsModule, SlickConfirmDialogModule, SlickPhotoGalleryModule],
4776
4808
  declarations: [SlickFileListComponent, SlickFileListItemComponent],
4777
4809
  exports: [common.CommonModule, forms.FormsModule, SlickFileListComponent]
4778
4810
  },] }
@@ -5518,6 +5550,11 @@
5518
5550
  SlickGridColumnSortDirection[SlickGridColumnSortDirection["asc"] = 1] = "asc";
5519
5551
  SlickGridColumnSortDirection[SlickGridColumnSortDirection["desc"] = 2] = "desc";
5520
5552
  })(exports.SlickGridColumnSortDirection || (exports.SlickGridColumnSortDirection = {}));
5553
+ var SlickGridColumnTitleOrientation;
5554
+ (function (SlickGridColumnTitleOrientation) {
5555
+ SlickGridColumnTitleOrientation[SlickGridColumnTitleOrientation["Horizontal"] = 0] = "Horizontal";
5556
+ SlickGridColumnTitleOrientation[SlickGridColumnTitleOrientation["Vertical"] = 1] = "Vertical";
5557
+ })(SlickGridColumnTitleOrientation || (SlickGridColumnTitleOrientation = {}));
5521
5558
  var SlickGridColumnModel = /** @class */ (function () {
5522
5559
  function SlickGridColumnModel() {
5523
5560
  this.sortable = true;
@@ -5534,6 +5571,9 @@
5534
5571
  gridColumn.columnKey = params.columnKey;
5535
5572
  if (params.title)
5536
5573
  gridColumn.title = params.title;
5574
+ gridColumn.titleOrientation = params.titleOrientation || SlickGridColumnTitleOrientation.Horizontal;
5575
+ if (params.titleHeight)
5576
+ gridColumn.titleHeight = params.titleHeight;
5537
5577
  if (params.dataFieldName)
5538
5578
  gridColumn.dataFieldName = params.dataFieldName;
5539
5579
  if (params.displayOrder !== null && params.displayOrder !== undefined)
@@ -5749,82 +5789,8 @@
5749
5789
  };
5750
5790
  SlickGridComponent.prototype.ngOnInit = function () {
5751
5791
  return __awaiter(this, void 0, void 0, function () {
5752
- var favoriteNames, suffix, gridColumnsJson, columns, displayOrder_1, favoritesJson, sortColumn;
5753
- var _this = this;
5754
5792
  return __generator(this, function (_a) {
5755
- if (this.gridOptions.gridKey) {
5756
- if (this.gridOptions.favorites) {
5757
- favoriteNames = this.gridOptions.favorites.map(function (f) { return f.favoriteName; });
5758
- localStorage.setItem("GRID_" + this.gridOptions.gridKey + "_FAVORITES", JSON.stringify(favoriteNames));
5759
- this.gridOptions.favorites.forEach(function (favorite) {
5760
- // Make sure we haven't added a new column that needs to be saved
5761
- _this.gridOptions.columns.forEach(function (c) {
5762
- var columnExists = favorite.columns.findIndex(function (x) { return x.dataFieldName === c.dataFieldName; });
5763
- if (columnExists < 0)
5764
- favorite.columns.push(c);
5765
- });
5766
- var gridColumnsJSON = JSON.stringify(favorite.columns);
5767
- if (_this.gridOptions.gridKey) {
5768
- var suffix_1 = favorite.favoriteName === 'Default' ? '' : ('_' + favorite.favoriteName);
5769
- localStorage.setItem("GRID_" + _this.gridOptions.gridKey + "_COLUMNS" + suffix_1, gridColumnsJSON);
5770
- }
5771
- });
5772
- if (favoriteNames.indexOf(this.selectedFavorite) < 0)
5773
- this.selectedFavorite = "Default";
5774
- }
5775
- this.selectedFavorite = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_SELECTED_FAVORITE") || 'Default';
5776
- // Check to make sure we don't have any duplicate column names
5777
- this.gridOptions.columns.forEach(function (c1) {
5778
- var dataFieldCount = (_this.gridOptions.columns.filter(function (x) { return x.dataFieldName === c1.dataFieldName; }) || []).length;
5779
- if (dataFieldCount > 1)
5780
- console.error("Grid " + _this.gridOptions.gridKey + " column " + c1.dataFieldName + " is defined " + dataFieldCount + " times");
5781
- });
5782
- suffix = this.selectedFavorite === 'Default' ? '' : ('_' + this.selectedFavorite);
5783
- gridColumnsJson = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_COLUMNS" + suffix);
5784
- if (gridColumnsJson) {
5785
- columns = JSON.parse(gridColumnsJson);
5786
- displayOrder_1 = 0;
5787
- columns.forEach(function (c) {
5788
- var column = _this.gridOptions.columns.find(function (gridColumn) { return gridColumn.dataFieldName === c.dataFieldName; });
5789
- if (column) {
5790
- column.visible = c.visible;
5791
- column.displayOrder = displayOrder_1;
5792
- column.width = c.width;
5793
- column.flexible = c.flexible;
5794
- column.sortDirection = c.sortDirection;
5795
- column.isLocked = c.isLocked;
5796
- //column.filterType = c.filterType;
5797
- if (column.isLocked && column.filterType !== exports.SlickGridColumnFilterTypes.none) {
5798
- column.isFiltering = true;
5799
- if (column.filterType === exports.SlickGridColumnFilterTypes.text)
5800
- column.filterText = c.filterText;
5801
- else if (column.filterType === exports.SlickGridColumnFilterTypes.dropdown)
5802
- column.filterDropdownValue = c.filterDropdownValue;
5803
- if (!column.filterText && !column.filterDropdownValue) {
5804
- column.isFiltering = false;
5805
- column.isLocked = false;
5806
- column.filterText = null;
5807
- column.filterDropdownValue = null;
5808
- }
5809
- }
5810
- }
5811
- displayOrder_1++;
5812
- });
5813
- }
5814
- this.recordsPerPageValue = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_RECORDS_PER_PAGE") || "Auto";
5815
- favoritesJson = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_FAVORITES") || "[\"Default\"]";
5816
- this.favorites = JSON.parse(favoritesJson).map(function (favorite) {
5817
- return new DropDownModel(favorite);
5818
- });
5819
- }
5820
- this.visibleColumns = this.gridOptions.columns.filter(function (c) { return c.visible === true; });
5821
- this.visibleColumns = this.visibleColumns.sort(function (a, b) { return (a.displayOrder > b.displayOrder) ? 1 : (a.displayOrder < b.displayOrder) ? -1 : 0; });
5822
- this.showSearchRow = this.visibleColumns.filter(function (c) { return c.filterType !== exports.SlickGridColumnFilterTypes.none; }).length > 0;
5823
- sortColumn = this.visibleColumns.find(function (c) { return c.sortable === true && c.sortDirection > 0; });
5824
- if (this.visibleColumns.length > 0 && sortColumn) {
5825
- this.requestModel.sortColumn = sortColumn.dataFieldName;
5826
- this.requestModel.sortDirection = sortColumn.sortDirection;
5827
- }
5793
+ this.setGridOptions(this.gridOptions);
5828
5794
  return [2 /*return*/];
5829
5795
  });
5830
5796
  });
@@ -5919,6 +5885,7 @@
5919
5885
  this.striped = this.gridOptions.striped;
5920
5886
  if (this.gridOptions.hover !== null)
5921
5887
  this.hover = this.gridOptions.hover;
5888
+ this.setGridOptions(this.gridOptions);
5922
5889
  }
5923
5890
  if (!changes.data) return [3 /*break*/, 5];
5924
5891
  // If we don't do this lock, the first change will have null data and crash. The second request will have the actual data
@@ -6133,7 +6100,7 @@
6133
6100
  };
6134
6101
  SlickGridComponent.prototype.reload = function (requestModel) {
6135
6102
  return __awaiter(this, void 0, void 0, function () {
6136
- var sortColumn, responseModel, error_3;
6103
+ var responseModel, error_3;
6137
6104
  return __generator(this, function (_a) {
6138
6105
  switch (_a.label) {
6139
6106
  case 0:
@@ -6141,35 +6108,7 @@
6141
6108
  return [4 /*yield*/, this.functionLockService.lock("GRID_" + this.uuid + "_RELOAD")];
6142
6109
  case 1:
6143
6110
  _a.sent();
6144
- requestModel.columnSearchValues = [];
6145
- this.gridOptions.columns.forEach(function (c) {
6146
- if (c.visible) {
6147
- if (c.filterType === exports.SlickGridColumnFilterTypes.text && c.filterText) {
6148
- c.filterText = c.filterText;
6149
- requestModel.columnSearchValues.push({
6150
- columnName: c.dataFieldName,
6151
- searchValueId: null,
6152
- searchValueText: c.filterText
6153
- });
6154
- }
6155
- else if (c.filterType === exports.SlickGridColumnFilterTypes.dropdown && c.filterDropdownValue) {
6156
- c.filterDropdownValue = c.filterDropdownValue;
6157
- requestModel.columnSearchValues.push({
6158
- columnName: c.dataFieldName,
6159
- searchValueId: c.filterDropdownValue,
6160
- searchValueText: null
6161
- });
6162
- }
6163
- }
6164
- });
6165
- requestModel.sortColumn = null;
6166
- sortColumn = this.gridOptions.columns.find(function (x) { return x.sortDirection === exports.SlickGridColumnSortDirection.asc || x.sortDirection === exports.SlickGridColumnSortDirection.desc; });
6167
- if (sortColumn) {
6168
- requestModel.sortColumn = (sortColumn.sortDirection === 0) ? null : sortColumn.dataFieldName;
6169
- requestModel.sortDirection = sortColumn.sortDirection;
6170
- }
6171
- if (requestModel.recordsPerPage <= 0)
6172
- requestModel.recordsPerPage = 20;
6111
+ requestModel = this.getRequestModel(this.requestModel);
6173
6112
  responseModel = null;
6174
6113
  if (!requestModel.url) return [3 /*break*/, 3];
6175
6114
  return [4 /*yield*/, this.gridService.getDataFromServer(requestModel)];
@@ -6204,7 +6143,10 @@
6204
6143
  this.onRowClicked(rowData, rowNumber);
6205
6144
  };
6206
6145
  SlickGridComponent.prototype.getColumnHTML = function (rowData, dataFieldName) {
6207
- return SlickUtilsService.getDeepObject(rowData, dataFieldName) || '';
6146
+ var columnHTML = SlickUtilsService.getDeepObject(rowData, dataFieldName);
6147
+ if (columnHTML === null || columnHTML === undefined)
6148
+ return '';
6149
+ return columnHTML.toString();
6208
6150
  };
6209
6151
  SlickGridComponent.prototype.sortBy = function (sortColumn) {
6210
6152
  return __awaiter(this, void 0, void 0, function () {
@@ -6489,11 +6431,13 @@
6489
6431
  var gridColumnsJson = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_COLUMNS" + suffix);
6490
6432
  if (gridColumnsJson) {
6491
6433
  var columns = JSON.parse(gridColumnsJson);
6492
- var displayOrder_2 = 0;
6434
+ var displayOrder_1 = 0;
6493
6435
  columns.forEach(function (c) {
6494
6436
  var column = _this.gridOptions.columns.find(function (gridColumn) { return gridColumn.dataFieldName === c.dataFieldName; });
6495
6437
  if (column) {
6496
- c.displayOrder = displayOrder_2;
6438
+ c.displayOrder = displayOrder_1;
6439
+ c.titleOrientation = column.titleOrientation;
6440
+ c.titleHeight = column.titleHeight;
6497
6441
  c.width = column.width;
6498
6442
  c.filterDropdownValue = column.filterDropdownValue;
6499
6443
  c.filterText = column.filterText;
@@ -6501,7 +6445,7 @@
6501
6445
  c.isFiltering = column.isFiltering;
6502
6446
  c.sortDirection = column.sortDirection;
6503
6447
  }
6504
- displayOrder_2++;
6448
+ displayOrder_1++;
6505
6449
  });
6506
6450
  columns = columns.sort(function (a, b) { return (a.displayOrder > b.displayOrder) ? 1 : (a.displayOrder < b.displayOrder) ? -1 : 0; });
6507
6451
  gridColumnsJSON = JSON.stringify(columns);
@@ -6576,12 +6520,134 @@
6576
6520
  });
6577
6521
  });
6578
6522
  };
6523
+ SlickGridComponent.prototype.addColumn = function (column, idx) {
6524
+ if (idx === void 0) { idx = null; }
6525
+ if (idx === null)
6526
+ this.gridOptions.columns.push(column);
6527
+ else
6528
+ this.gridOptions.columns.splice(idx, 0, column);
6529
+ this.setGridOptions(this.gridOptions);
6530
+ };
6531
+ SlickGridComponent.prototype.getRequestModel = function (requestModel) {
6532
+ if (requestModel === void 0) { requestModel = null; }
6533
+ if (!requestModel)
6534
+ requestModel = this.requestModel;
6535
+ requestModel.columnSearchValues = [];
6536
+ this.gridOptions.columns.forEach(function (c) {
6537
+ if (c.visible) {
6538
+ if (c.filterType === exports.SlickGridColumnFilterTypes.text && c.filterText) {
6539
+ c.filterText = c.filterText;
6540
+ requestModel.columnSearchValues.push({
6541
+ columnName: c.dataFieldName,
6542
+ searchValueId: null,
6543
+ searchValueText: c.filterText
6544
+ });
6545
+ }
6546
+ else if (c.filterType === exports.SlickGridColumnFilterTypes.dropdown && c.filterDropdownValue) {
6547
+ c.filterDropdownValue = c.filterDropdownValue;
6548
+ requestModel.columnSearchValues.push({
6549
+ columnName: c.dataFieldName,
6550
+ searchValueId: c.filterDropdownValue,
6551
+ searchValueText: null
6552
+ });
6553
+ }
6554
+ }
6555
+ });
6556
+ requestModel.sortColumn = null;
6557
+ var sortColumn = this.gridOptions.columns.find(function (x) { return x.sortDirection === exports.SlickGridColumnSortDirection.asc || x.sortDirection === exports.SlickGridColumnSortDirection.desc; });
6558
+ if (sortColumn) {
6559
+ requestModel.sortColumn = (sortColumn.sortDirection === 0) ? null : sortColumn.dataFieldName;
6560
+ requestModel.sortDirection = sortColumn.sortDirection;
6561
+ }
6562
+ if (requestModel.recordsPerPage <= 0)
6563
+ requestModel.recordsPerPage = 20;
6564
+ return this.requestModel;
6565
+ };
6566
+ SlickGridComponent.prototype.setGridOptions = function (gridOptions) {
6567
+ var _this = this;
6568
+ this.gridOptions = gridOptions;
6569
+ if (this.gridOptions.gridKey) {
6570
+ if (this.gridOptions.favorites) {
6571
+ var favoriteNames = this.gridOptions.favorites.map(function (f) { return f.favoriteName; });
6572
+ localStorage.setItem("GRID_" + this.gridOptions.gridKey + "_FAVORITES", JSON.stringify(favoriteNames));
6573
+ this.gridOptions.favorites.forEach(function (favorite) {
6574
+ // Make sure we haven't added a new column that needs to be saved
6575
+ _this.gridOptions.columns.forEach(function (c) {
6576
+ var columnExists = favorite.columns.findIndex(function (x) { return x.dataFieldName === c.dataFieldName; });
6577
+ if (columnExists < 0)
6578
+ favorite.columns.push(c);
6579
+ });
6580
+ var gridColumnsJSON = JSON.stringify(favorite.columns);
6581
+ if (_this.gridOptions.gridKey) {
6582
+ var suffix_1 = favorite.favoriteName === 'Default' ? '' : ('_' + favorite.favoriteName);
6583
+ localStorage.setItem("GRID_" + _this.gridOptions.gridKey + "_COLUMNS" + suffix_1, gridColumnsJSON);
6584
+ }
6585
+ });
6586
+ if (favoriteNames.indexOf(this.selectedFavorite) < 0)
6587
+ this.selectedFavorite = "Default";
6588
+ }
6589
+ this.selectedFavorite = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_SELECTED_FAVORITE") || 'Default';
6590
+ // Check to make sure we don't have any duplicate column names
6591
+ this.gridOptions.columns.forEach(function (c1) {
6592
+ var dataFieldCount = (_this.gridOptions.columns.filter(function (x) { return x.dataFieldName === c1.dataFieldName; }) || []).length;
6593
+ if (dataFieldCount > 1)
6594
+ console.error("Grid " + _this.gridOptions.gridKey + " column " + c1.dataFieldName + " is defined " + dataFieldCount + " times");
6595
+ });
6596
+ var suffix = this.selectedFavorite === 'Default' ? '' : ('_' + this.selectedFavorite);
6597
+ var gridColumnsJson = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_COLUMNS" + suffix);
6598
+ if (gridColumnsJson) {
6599
+ var columns = JSON.parse(gridColumnsJson);
6600
+ var displayOrder_2 = 0;
6601
+ columns.forEach(function (c) {
6602
+ var column = _this.gridOptions.columns.find(function (gridColumn) { return gridColumn.dataFieldName === c.dataFieldName; });
6603
+ if (column) {
6604
+ column.visible = c.visible;
6605
+ column.displayOrder = displayOrder_2;
6606
+ column.titleOrientation = c.titleOrientation;
6607
+ column.titleHeight = c.titleHeight;
6608
+ column.width = c.width;
6609
+ column.flexible = c.flexible;
6610
+ column.sortDirection = c.sortDirection;
6611
+ column.isLocked = c.isLocked;
6612
+ //column.filterType = c.filterType;
6613
+ if (column.isLocked && column.filterType !== exports.SlickGridColumnFilterTypes.none) {
6614
+ column.isFiltering = true;
6615
+ if (column.filterType === exports.SlickGridColumnFilterTypes.text)
6616
+ column.filterText = c.filterText;
6617
+ else if (column.filterType === exports.SlickGridColumnFilterTypes.dropdown)
6618
+ column.filterDropdownValue = c.filterDropdownValue;
6619
+ if (!column.filterText && !column.filterDropdownValue) {
6620
+ column.isFiltering = false;
6621
+ column.isLocked = false;
6622
+ column.filterText = null;
6623
+ column.filterDropdownValue = null;
6624
+ }
6625
+ }
6626
+ }
6627
+ displayOrder_2++;
6628
+ });
6629
+ }
6630
+ this.recordsPerPageValue = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_RECORDS_PER_PAGE") || "Auto";
6631
+ var favoritesJson = localStorage.getItem("GRID_" + this.gridOptions.gridKey + "_FAVORITES") || "[\"Default\"]";
6632
+ this.favorites = JSON.parse(favoritesJson).map(function (favorite) {
6633
+ return new DropDownModel(favorite);
6634
+ });
6635
+ }
6636
+ this.visibleColumns = this.gridOptions.columns.filter(function (c) { return c.visible === true; });
6637
+ this.visibleColumns = this.visibleColumns.sort(function (a, b) { return (a.displayOrder > b.displayOrder) ? 1 : (a.displayOrder < b.displayOrder) ? -1 : 0; });
6638
+ this.showSearchRow = this.visibleColumns.filter(function (c) { return c.filterType !== exports.SlickGridColumnFilterTypes.none; }).length > 0;
6639
+ var sortColumn = this.visibleColumns.find(function (c) { return c.sortable === true && c.sortDirection > 0; });
6640
+ if (this.visibleColumns.length > 0 && sortColumn) {
6641
+ this.requestModel.sortColumn = sortColumn.dataFieldName;
6642
+ this.requestModel.sortDirection = sortColumn.sortDirection;
6643
+ }
6644
+ };
6579
6645
  return SlickGridComponent;
6580
6646
  }());
6581
6647
  SlickGridComponent.decorators = [
6582
6648
  { type: core.Component, args: [{
6583
6649
  selector: 'slick-grid',
6584
- template: "<div id=\"slick-grid_{{uuid}}\" class=\"slick-grid d-flex flex-column flex-fill\" style=\"position: absolute; left: 0; top: 0; right: 0; bottom: 0;\" #slickGrid>\r\n\t<div #tableContainer class=\"d-flex flex-fill\" style=\"overflow: auto\">\r\n\r\n\t\t<div>\r\n\t\t\t<table #tableRef class=\"table table-sm\" [class.table-bordered]=\"bordered\" [class.table-borderless]=\"!bordered\" [class.table-striped]=\"striped\" [class.table-hover]=\"hover\" [style.opacity]=\"gridOpacity\" style=\"margin: 0; padding: 0;\" (keydown)=\"tableKeydown($event)\" tabindex=\"0\">\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<tr #tableHeaderRow (mousemove)=\"onColResizeMousemove($event)\" [ngClass]=\"{ 'resizing': isResizing === true }\">\r\n\t\t\t\t\t\t<td *ngFor=\"let column of visibleColumns; let idx = index\" [style.width]=\"column.width\" [style.maxWidth]=\"column.width\">\r\n\t\t\t\t\t\t\t<div *ngIf=\"idx > 0 && idx < visibleColumns.length\" class=\"resize_column_left\" [class.table-bordered]=\"bordered\" (mousedown)=\"onColResizeMousedown($event, idx - 1)\" (dblclick)=\"onColResizeDoubleclick($event, idx - 1)\"></div>\r\n\t\t\t\t\t\t\t<span class=\"sortIcon\" *ngIf=\"column.sortable === true && column.sortDirection > 0\"><i class=\"far\" [ngClass]=\"{'fa-caret-up': column.sortDirection === 1, 'fa-caret-down': column.sortDirection === 2}\"></i>&nbsp;</span>\r\n\t\t\t\t\t\t\t<a href=\"javascript:void(0)\" *ngIf=\"column.sortable === true\" (click)=\"sortBy(column)\" draggable=\"false\">{{column.title}}</a>\r\n\t\t\t\t\t\t\t<div *ngIf=\"column.sortable === false\">{{column.title}}</div>\r\n\t\t\t\t\t\t\t<div class=\"resize_column_right\" (mousedown)=\"onColResizeMousedown($event, idx)\" (dblclick)=\"onColResizeDoubleclick($event, idx)\"></div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr #tableHeaderSearchRow *ngIf=\"showSearchRow === true\">\r\n\t\t\t\t\t\t<td *ngFor=\"let column of visibleColumns\">\r\n\t\t\t\t\t\t\t<div class=\"slick-grid_search-column\">\r\n\t\t\t\t\t\t\t\t<i *ngIf=\"column.isFiltering\" class=\"fas fa-times-circle bg-white text-danger mr-1\" (click)=\"resetFilter(column)\"></i>\r\n\t\t\t\t\t\t\t\t<i *ngIf=\"column.isFiltering && column.isLocked\" class=\"far fa-lock mr-1\" (click)=\"toggleLock(column)\"></i>\r\n\t\t\t\t\t\t\t\t<i *ngIf=\"column.isFiltering && !column.isLocked\" class=\"far fa-lock-open mr-1\" (click)=\"toggleLock(column)\"></i>\r\n\t\t\t\t\t\t\t\t<div *ngIf=\"column.filterType === 1\" class=\"slick-grid_text-search\">\r\n\t\t\t\t\t\t\t\t\t<input autocomplete=\"nope\" type=\"text\" class=\"form-control\" [(ngModel)]=\"column.filterText\" name=\"searchText\" placeholder=\"Search...\" (keydown)=\"onSearch(column)\" />\r\n\t\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t\t\t<div *ngIf=\"column.filterType === 2\" class=\"input-group slick-grid_drop-down-search\">\r\n\t\t\t\t\t\t\t\t\t<slick-drop-down [items]=\"column.filterDropdownValues\" [(ngModel)]=\"column.filterDropdownValue\" listWidth=\"auto\" placeholder=\"Search...\" (onSelect)=\"onSearchSelect($event, column)\"></slick-drop-down>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr *ngIf=\"loaded && visibleData.length === 0\"><td [colSpan]=\"visibleColumns.length\">No Data</td></tr>\r\n\t\t\t\t\t<tr *ngFor=\"let rowData of visibleData; let idx = index\" #tableBodyRows (click)=\"onRowClicked(rowData, idx)\" (dblclick)=\"onRowDoubleClicked(rowData, idx)\" (contextmenu)=\"onRowContextMenuClicked($event, rowData, idx)\" [class.table-success]=\"selectedIndex === idx\">\r\n\t\t\t\t\t\t<td *ngFor=\"let column of visibleColumns\">\r\n\t\t\t\t\t\t\t<div *ngIf=\"!column.columnKey\" class=\"slick-grid_column-content\" [style.width]=\"column.width\" [style.maxWidth]=\"column.width\" [innerHTML]=\"getColumnHTML(rowData, column.dataFieldName) | slickGridSanitizeHtml\"></div>\r\n\t\t\t\t\t\t\t<div *ngIf=\"column.columnKey\" class=\"slick-grid_column-content\" [style.width]=\"column.width\" [style.maxWidth]=\"column.width\">\r\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"templateRefs[column.columnKey], context: { $implicit: rowData }\">\r\n\t\t\t\t\t\t\t\t</ng-container>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t</div>\r\n\t</div>\r\n\r\n\r\n\t<div class=\"slick-grid-footer mt-2 d-flex\">\r\n\t\t<div>\r\n\t\t\t<button type=\"button\" (click)=\"openColumnSelectDialog()\" class=\"btn btn-outline-primary\"><i class=\"far fa-columns\"></i></button>\r\n\t\t</div>\r\n\t\t<div *ngIf=\"favorites?.length > 1\">\r\n\t\t\t<button #favoriteSelectRef type=\"button\" class=\"btn btn-outline-primary ml-1\"><i class=\"far fa-star\"></i> {{this.selectedFavorite}}</button>\r\n\t\t\t<slick-popover [element]=\"favoriteSelectRef\" position=\"top\" showArrow=\"false\" [topOffsetPx]=\"0\" [leftOffsetPx]=\"0\" [showByClick]=\"true\">\r\n\t\t\t\t<table class=\"table-borderless table-sm table-hover\" style=\"min-width: 250px; cursor: default\">\r\n\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr *ngFor=\"let favorite of favorites\" (click)=\"setFavorite(favorite.text)\">\r\n\t\t\t\t\t\t\t<td><i *ngIf=\"favorite.text === selectedFavorite\" class=\"far fa-star mr-1\"></i>{{favorite.text}}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\t\t\t</slick-popover>\r\n\t\t</div>\r\n\t\t<div>\r\n\t\t\t<slick-paging [(pageNumber)]=\"currentPage\" [totalRecords]=\"totalRecords\" [recordsPerPage]=\"recordsPerPage\" (onPageChange)=\"onPageChange($event)\"></slick-paging>\r\n\t\t</div>\r\n\t\t<div class=\"ml-1\">\r\n\t\t\t<button #recordsPerPageRef type=\"button\" class=\"btn btn-outline-primary\">{{recordsPerPageValue}}&nbsp;&nbsp;<i style=\"font-size: 12px\" class=\"far fa-chevron-down\"></i></button>\r\n\r\n\t\t\t<slick-popover [element]=\"recordsPerPageRef\" position=\"top\" showArrow=\"false\" [topOffsetPx]=\"0\" [leftOffsetPx]=\"0\" [showByClick]=\"true\">\r\n\t\t\t\t<table class=\"table-borderless table-sm table-hover\" style=\"min-width: 150px;\">\r\n\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('Auto')\"><td>Auto</td></tr>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('25')\"><td>25</td></tr>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('50')\"><td>50</td></tr>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('100')\"><td>100</td></tr>\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\t\t\t</slick-popover>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n\r\n<slick-dialog #columnSelectDialogRef header=\"Select Columns\">\r\n\t<div style=\"text-align: center; width: 475px;\" class=\"mx-5\">\r\n\t\t<div class=\"d-flex\">\r\n\t\t\t<div class=\"flex-fill\">\r\n\t\t\t\t<slick-drop-down [items]=\"favorites\"\r\n\t\t\t\t\t\t\t\t [ngModel]=\"selectedFavorite\"\r\n\t\t\t\t\t\t\t\t (onSelect)=\"loadFavorite($event)\"></slick-drop-down>\r\n\t\t\t</div>\r\n\t\t\t<div><button class=\"btn btn-outline-primary ml-1\" (click)=\"addNewFavorite()\"><i class=\"far fa-plus\"></i></button></div>\r\n\t\t</div>\r\n\t\t<div class=\"d-flex flex-column mt-1\" slick-drop-list (onSlickDropListReorder)=\"onColumnReorder($event)\">\r\n\t\t\t<div *ngFor=\"let column of columnSelectDialogColumns\" class=\"d-flex\" slick-drop-list-item>\r\n\t\t\t\t<div style=\"width: 20px\"><input type=\"checkbox\" style=\"position: relative; top: 2px;\" [(ngModel)]=\"column.visible\" /></div>\r\n\t\t\t\t<div class=\"py-0 flex-fill\" style=\"text-align: left; cursor: ns-resize\" slick-drop-list-grab>{{column.title}}</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<slick-dialog-footer>\r\n\t\t<div style=\"margin-top: 10px;\" class=\"col-12 text-center mb-2 mt-1\">\r\n\t\t\t<button type=\"button\" (click)=\"onSaveColumns()\" class=\"btn btn-outline-primary mr-1\"><i class=\"far fa-save\"></i>&nbsp;Save</button>&nbsp;\r\n\t\t\t<button type=\"button\" class=\"btn btn-outline-danger\" (click)=\"onCancelColumns()\">Cancel</button>\r\n\t\t</div>\r\n\t</slick-dialog-footer>\r\n</slick-dialog>\r\n\r\n\r\n<slick-confirm-dialog #addNewFavoriteDialogRef width=\"300\">\r\n\t<label>Enter new favorite name</label>\r\n\t<input type=\"text\" class=\"form-control mx-3\" style=\"width: 250px\" [(ngModel)]=\"newFavoriteText\" />\r\n</slick-confirm-dialog>",
6650
+ template: "<div id=\"slick-grid_{{uuid}}\" class=\"slick-grid d-flex flex-column flex-fill\" style=\"position: absolute; left: 0; top: 0; right: 0; bottom: 0;\" #slickGrid>\r\n\t<div #tableContainer class=\"d-flex flex-fill\" style=\"overflow: auto\">\r\n\r\n\t\t<div>\r\n\t\t\t<table #tableRef class=\"table table-sm\" [class.table-bordered]=\"bordered\" [class.table-borderless]=\"!bordered\" [class.table-striped]=\"striped\" [class.table-hover]=\"hover\" [style.opacity]=\"gridOpacity\" style=\"margin: 0; padding: 0;\" (keydown)=\"tableKeydown($event)\" tabindex=\"0\">\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<tr #tableHeaderRow (mousemove)=\"onColResizeMousemove($event)\" [ngClass]=\"{ 'resizing': isResizing === true }\">\r\n\t\t\t\t\t\t<td *ngFor=\"let column of visibleColumns; let idx = index\" [style.width]=\"column.width\" [style.maxWidth]=\"column.width\" [style.height]=\"column.titleHeight\">\r\n\t\t\t\t\t\t\t<div [ngClass]=\"{ 'slick-grid_title-vertical' : column.titleOrientation === 1 }\">\r\n\t\t\t\t\t\t\t\t<div *ngIf=\"idx > 0 && idx < visibleColumns.length\" class=\"resize_column_left\" [class.table-bordered]=\"bordered\" (mousedown)=\"onColResizeMousedown($event, idx - 1)\" (dblclick)=\"onColResizeDoubleclick($event, idx - 1)\"></div>\r\n\t\t\t\t\t\t\t\t<span class=\"sortIcon\" *ngIf=\"column.sortable === true && column.sortDirection > 0\"><i class=\"far\" [ngClass]=\"{'fa-caret-up': column.sortDirection === 1, 'fa-caret-down': column.sortDirection === 2}\"></i>&nbsp;</span>\r\n\t\t\t\t\t\t\t\t<a href=\"javascript:void(0)\" *ngIf=\"column.sortable === true\" (click)=\"sortBy(column)\" draggable=\"false\" title=\"{{column.title}}\">{{column.title}}</a>\r\n\t\t\t\t\t\t\t\t<div *ngIf=\"column.sortable === false\" title=\"{{column.title}}\">{{column.title}}</div>\r\n\t\t\t\t\t\t\t\t<div class=\"resize_column_right\" (mousedown)=\"onColResizeMousedown($event, idx)\" (dblclick)=\"onColResizeDoubleclick($event, idx)\"></div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr #tableHeaderSearchRow *ngIf=\"showSearchRow === true\">\r\n\t\t\t\t\t\t<td *ngFor=\"let column of visibleColumns\">\r\n\t\t\t\t\t\t\t<div class=\"slick-grid_search-column\">\r\n\t\t\t\t\t\t\t\t<i *ngIf=\"column.isFiltering\" class=\"fas fa-times-circle bg-white text-danger mr-1\" (click)=\"resetFilter(column)\"></i>\r\n\t\t\t\t\t\t\t\t<i *ngIf=\"column.isFiltering && column.isLocked\" class=\"far fa-lock mr-1\" (click)=\"toggleLock(column)\"></i>\r\n\t\t\t\t\t\t\t\t<i *ngIf=\"column.isFiltering && !column.isLocked\" class=\"far fa-lock-open mr-1\" (click)=\"toggleLock(column)\"></i>\r\n\t\t\t\t\t\t\t\t<div *ngIf=\"column.filterType === 1\" class=\"slick-grid_text-search\">\r\n\t\t\t\t\t\t\t\t\t<input autocomplete=\"nope\" type=\"text\" class=\"form-control\" [(ngModel)]=\"column.filterText\" name=\"searchText\" placeholder=\"Search...\" (keydown)=\"onSearch(column)\" />\r\n\t\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t\t\t<div *ngIf=\"column.filterType === 2\" class=\"input-group slick-grid_drop-down-search\">\r\n\t\t\t\t\t\t\t\t\t<slick-drop-down [items]=\"column.filterDropdownValues\" [(ngModel)]=\"column.filterDropdownValue\" listWidth=\"auto\" placeholder=\"Search...\" (onSelect)=\"onSearchSelect($event, column)\"></slick-drop-down>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr *ngIf=\"loaded && visibleData.length === 0\"><td [colSpan]=\"visibleColumns.length\">No Data</td></tr>\r\n\t\t\t\t\t<tr *ngFor=\"let rowData of visibleData; let idx = index\" #tableBodyRows (click)=\"onRowClicked(rowData, idx)\" (dblclick)=\"onRowDoubleClicked(rowData, idx)\" (contextmenu)=\"onRowContextMenuClicked($event, rowData, idx)\" [class.table-success]=\"selectedIndex === idx\">\r\n\t\t\t\t\t\t<td *ngFor=\"let column of visibleColumns\">\r\n\t\t\t\t\t\t\t<div *ngIf=\"!column.columnKey\" class=\"slick-grid_column-content\" [style.width]=\"column.width\" [style.maxWidth]=\"column.width\" [innerHTML]=\"getColumnHTML(rowData, column.dataFieldName) | slickGridSanitizeHtml\"></div>\r\n\t\t\t\t\t\t\t<div *ngIf=\"column.columnKey\" class=\"slick-grid_column-content\" [style.width]=\"column.width\" [style.maxWidth]=\"column.width\">\r\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"templateRefs[column.columnKey], context: { $implicit: rowData }\">\r\n\t\t\t\t\t\t\t\t</ng-container>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t</div>\r\n\t</div>\r\n\r\n\r\n\t<div class=\"slick-grid-footer mt-2 d-flex\">\r\n\t\t<div>\r\n\t\t\t<button type=\"button\" (click)=\"openColumnSelectDialog()\" class=\"btn btn-outline-primary\"><i class=\"far fa-columns\"></i></button>\r\n\t\t</div>\r\n\t\t<div *ngIf=\"favorites?.length > 1\">\r\n\t\t\t<button #favoriteSelectRef type=\"button\" class=\"btn btn-outline-primary ml-1\"><i class=\"far fa-star\"></i> {{this.selectedFavorite}}</button>\r\n\t\t\t<slick-popover [element]=\"favoriteSelectRef\" position=\"top\" showArrow=\"false\" [topOffsetPx]=\"0\" [leftOffsetPx]=\"0\" [showByClick]=\"true\">\r\n\t\t\t\t<table class=\"table-borderless table-sm table-hover\" style=\"min-width: 250px; cursor: default\">\r\n\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr *ngFor=\"let favorite of favorites\" (click)=\"setFavorite(favorite.text)\">\r\n\t\t\t\t\t\t\t<td><i *ngIf=\"favorite.text === selectedFavorite\" class=\"far fa-star mr-1\"></i>{{favorite.text}}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\t\t\t</slick-popover>\r\n\t\t</div>\r\n\t\t<div>\r\n\t\t\t<slick-paging [(pageNumber)]=\"currentPage\" [totalRecords]=\"totalRecords\" [recordsPerPage]=\"recordsPerPage\" (onPageChange)=\"onPageChange($event)\"></slick-paging>\r\n\t\t</div>\r\n\t\t<div class=\"ml-1\">\r\n\t\t\t<button #recordsPerPageRef type=\"button\" class=\"btn btn-outline-primary\">{{recordsPerPageValue}}&nbsp;&nbsp;<i style=\"font-size: 12px\" class=\"far fa-chevron-down\"></i></button>\r\n\r\n\t\t\t<slick-popover [element]=\"recordsPerPageRef\" position=\"top\" showArrow=\"false\" [topOffsetPx]=\"0\" [leftOffsetPx]=\"0\" [showByClick]=\"true\">\r\n\t\t\t\t<table class=\"table-borderless table-sm table-hover\" style=\"min-width: 150px;\">\r\n\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('Auto')\"><td>Auto</td></tr>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('25')\"><td>25</td></tr>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('50')\"><td>50</td></tr>\r\n\t\t\t\t\t\t<tr (click)=\"onRecordsPerPageSelected('100')\"><td>100</td></tr>\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\t\t\t</slick-popover>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n\r\n<slick-dialog #columnSelectDialogRef header=\"Select Columns\">\r\n\t<div style=\"text-align: center; width: 475px;\" class=\"mx-5\">\r\n\t\t<div class=\"d-flex\">\r\n\t\t\t<div class=\"flex-fill\">\r\n\t\t\t\t<slick-drop-down [items]=\"favorites\"\r\n\t\t\t\t\t\t\t\t [ngModel]=\"selectedFavorite\"\r\n\t\t\t\t\t\t\t\t (onSelect)=\"loadFavorite($event)\"></slick-drop-down>\r\n\t\t\t</div>\r\n\t\t\t<div><button class=\"btn btn-outline-primary ml-1\" (click)=\"addNewFavorite()\"><i class=\"far fa-plus\"></i></button></div>\r\n\t\t</div>\r\n\t\t<div class=\"d-flex flex-column mt-1\" slick-drop-list (onSlickDropListReorder)=\"onColumnReorder($event)\">\r\n\t\t\t<div *ngFor=\"let column of columnSelectDialogColumns\" class=\"d-flex\" slick-drop-list-item>\r\n\t\t\t\t<div style=\"width: 20px\"><input type=\"checkbox\" style=\"position: relative; top: 2px;\" [(ngModel)]=\"column.visible\" /></div>\r\n\t\t\t\t<div class=\"py-0 flex-fill\" style=\"text-align: left; cursor: ns-resize\" slick-drop-list-grab>{{column.title}}</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<slick-dialog-footer>\r\n\t\t<div style=\"margin-top: 10px;\" class=\"col-12 text-center mb-2 mt-1\">\r\n\t\t\t<button type=\"button\" (click)=\"onSaveColumns()\" class=\"btn btn-outline-primary mr-1\"><i class=\"far fa-save\"></i>&nbsp;Save</button>&nbsp;\r\n\t\t\t<button type=\"button\" class=\"btn btn-outline-danger\" (click)=\"onCancelColumns()\">Cancel</button>\r\n\t\t</div>\r\n\t</slick-dialog-footer>\r\n</slick-dialog>\r\n\r\n\r\n<slick-confirm-dialog #addNewFavoriteDialogRef width=\"300\">\r\n\t<label>Enter new favorite name</label>\r\n\t<input type=\"text\" class=\"form-control mx-3\" style=\"width: 250px\" [(ngModel)]=\"newFavoriteText\" />\r\n</slick-confirm-dialog>",
6585
6651
  providers: [SlickGridService]
6586
6652
  },] }
6587
6653
  ];