@colijnit/corecomponents_v12 258.1.16 → 258.1.18

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.
@@ -5532,7 +5532,7 @@
5532
5532
  GridToolbarComponent.decorators = [
5533
5533
  { type: i0.Component, args: [{
5534
5534
  selector: "co-grid-toolbar",
5535
- template: "\n <div class=\"grid-toolbar-wrapper\">\n <co-icon *ngIf=\"showEdit\" [iconData]=\"iconsService.getIcon(icons.PenToSquareSolid)\" [title]=\"'edit'\" (click)=\"editClick.emit($event)\"></co-icon>\n <co-icon *ngIf=\"showEdit\" [iconData]=\"iconsService.getIcon(icons.RotateLeftSolid)\" [title]=\"'cancel'\" (click)=\"cancelClick.emit()\"></co-icon>\n <co-icon *ngIf=\"showEdit\" [iconData]=\"iconsService.getIcon(icons.FloppyDiskSolid)\" [title]=\"'save'\" (click)=\"saveClick.emit()\"></co-icon>\n <co-icon *ngIf=\"showAdd || showEdit\" [iconData]=\"iconsService.getIcon(icons.PlusSolid)\" [title]=\"'add'\" (click)=\"addClick.emit()\"></co-icon>\n<!-- <co-icon *ngIf=\"showDelete\" [iconData]=\"iconsService.getIcon(icons.TrashCanSolid)\" [title]=\"'delete'\" [class.disabled]=\"!deleteEnabled\" (click)=\"handleDeleteClick()\"></co-icon>-->\n </div>\n ",
5535
+ template: "\n <div class=\"grid-toolbar-wrapper\">\n <co-icon *ngIf=\"showEdit\" [iconData]=\"iconsService.getIcon(icons.PenToSquareSolid)\" [title]=\"'edit'\" (click)=\"editClick.emit($event)\"></co-icon>\n <co-icon *ngIf=\"showEdit\" [iconData]=\"iconsService.getIcon(icons.RotateLeftSolid)\" [title]=\"'cancel'\" (click)=\"cancelClick.emit()\"></co-icon>\n <co-icon *ngIf=\"showEdit\" [iconData]=\"iconsService.getIcon(icons.FloppyDiskSolid)\" [title]=\"'save'\" (click)=\"saveClick.emit()\"></co-icon>\n <co-icon *ngIf=\"showAdd || showEdit\" [iconData]=\"iconsService.getIcon(icons.PlusSolid)\" [title]=\"'add'\" (click)=\"addClick.emit()\"></co-icon>\n <co-icon *ngIf=\"showDelete\" [iconData]=\"iconsService.getIcon(icons.TrashCanSolid)\" [title]=\"'delete'\" [class.disabled]=\"!deleteEnabled\" (click)=\"handleDeleteClick()\"></co-icon>\n </div>\n ",
5536
5536
  encapsulation: i0.ViewEncapsulation.None
5537
5537
  },] }
5538
5538
  ];
@@ -5952,8 +5952,17 @@
5952
5952
 
5953
5953
  var InputDatePickerComponent = /** @class */ (function (_super) {
5954
5954
  __extends(InputDatePickerComponent, _super);
5955
- function InputDatePickerComponent() {
5956
- return _super !== null && _super.apply(this, arguments) || this;
5955
+ function InputDatePickerComponent(formComponent, changeDetector, overlayService, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) {
5956
+ var _this = _super.call(this, changeDetector, componentFactoryResolver, overlayService, formUserChangeListener, ngZoneWrapper, elementRef) || this;
5957
+ _this.formComponent = formComponent;
5958
+ _this.changeDetector = changeDetector;
5959
+ _this.overlayService = overlayService;
5960
+ _this.componentFactoryResolver = componentFactoryResolver;
5961
+ _this.formUserChangeListener = formUserChangeListener;
5962
+ _this.ngZoneWrapper = ngZoneWrapper;
5963
+ _this.elementRef = elementRef;
5964
+ _super.prototype._markAsOnPush.call(_this);
5965
+ return _this;
5957
5966
  }
5958
5967
  InputDatePickerComponent.prototype.showClass = function () {
5959
5968
  return true;
@@ -6043,6 +6052,15 @@
6043
6052
  encapsulation: i0.ViewEncapsulation.None
6044
6053
  },] }
6045
6054
  ];
6055
+ InputDatePickerComponent.ctorParameters = function () { return [
6056
+ { type: FormComponent, decorators: [{ type: i0.Optional }] },
6057
+ { type: i0.ChangeDetectorRef },
6058
+ { type: OverlayService },
6059
+ { type: i0.ComponentFactoryResolver },
6060
+ { type: FormInputUserModelChangeListenerService },
6061
+ { type: NgZoneWrapperService },
6062
+ { type: i0.ElementRef }
6063
+ ]; };
6046
6064
  InputDatePickerComponent.propDecorators = {
6047
6065
  showClass: [{ type: i0.HostBinding, args: ['class.co-input-date',] }]
6048
6066
  };
@@ -7314,7 +7332,8 @@
7314
7332
  InputTextModule,
7315
7333
  CalendarModule,
7316
7334
  ClickoutsideModule,
7317
- OverlayModule
7335
+ OverlayModule,
7336
+ forms.ReactiveFormsModule
7318
7337
  ],
7319
7338
  schemas: [
7320
7339
  i0.NO_ERRORS_SCHEMA
@@ -10244,6 +10263,7 @@
10244
10263
  _this.showGridSettings = false;
10245
10264
  _this.rowsPerPage = 50;
10246
10265
  _this.showColumnSort = false;
10266
+ _this.showRowButtons = false;
10247
10267
  _this.editing = false;
10248
10268
  _this.isSettingsMenuOpen = false;
10249
10269
  _this.editRowIndex = -1;
@@ -10305,13 +10325,13 @@
10305
10325
  SimpleGridComponent.prototype.isRowDisabled = function (row, index) {
10306
10326
  return __awaiter(this, void 0, void 0, function () {
10307
10327
  var disabled, idxRow;
10308
- return __generator(this, function (_a) {
10309
- switch (_a.label) {
10328
+ return __generator(this, function (_c) {
10329
+ switch (_c.label) {
10310
10330
  case 0:
10311
10331
  if (!(this.rowDisabledFn && (typeof this.rowDisabledFn === 'function'))) return [3 /*break*/, 2];
10312
10332
  return [4 /*yield*/, this.rowDisabledFn.call(this, row)];
10313
10333
  case 1:
10314
- disabled = _a.sent();
10334
+ disabled = _c.sent();
10315
10335
  idxRow = this.disabledRows.indexOf(index);
10316
10336
  if (disabled) {
10317
10337
  if (idxRow < 0) {
@@ -10331,38 +10351,57 @@
10331
10351
  };
10332
10352
  SimpleGridComponent.prototype.addNewRow = function () {
10333
10353
  return __awaiter(this, void 0, void 0, function () {
10334
- var valid, absoluteIndex, _a;
10335
- return __generator(this, function (_b) {
10336
- switch (_b.label) {
10354
+ var valid, relativeIndex, _c, _d;
10355
+ var _this = this;
10356
+ return __generator(this, function (_e) {
10357
+ switch (_e.label) {
10337
10358
  case 0:
10338
- if (!this.inlineEdit) return [3 /*break*/, 4];
10359
+ if (!this.inlineEdit) return [3 /*break*/, 6];
10339
10360
  valid = this.validateAndSave();
10340
- if (!valid) return [3 /*break*/, 3];
10341
- this.data.push({});
10361
+ if (!valid) return [3 /*break*/, 5];
10362
+ this._newRowReference = {};
10363
+ this.data.push(this._newRowReference);
10342
10364
  this._detectChanges();
10343
10365
  this._newRow = true;
10344
10366
  this.editing = true;
10345
- if (!(this.rowsPerPage && this.data.length > this.rowsPerPage)) return [3 /*break*/, 1];
10346
- // navigate to the last page to the new row
10367
+ if (!(this.rowsPerPage && this.data.length > this.rowsPerPage)) return [3 /*break*/, 2];
10368
+ // navigate to last page
10347
10369
  this.currentPage = Math.ceil(this.data.length / this.rowsPerPage);
10348
- absoluteIndex = this.data.length - 1;
10349
- this.selectedRowIndex = this.rowsPerPage ? (absoluteIndex - ((this.currentPage - 1) * this.rowsPerPage)) : absoluteIndex;
10350
- this.editRow(null);
10351
- return [3 /*break*/, 3];
10370
+ relativeIndex = (this.data.length - 1) % this.rowsPerPage;
10371
+ this.selectedRowIndex = relativeIndex;
10372
+ this.editRowIndex = relativeIndex;
10373
+ // store reference
10374
+ this.rowToEdit = this._newRowReference;
10375
+ _c = this;
10376
+ return [4 /*yield*/, this._nextAvailableCellToEdit(true)];
10352
10377
  case 1:
10378
+ _c.editCellIndex = _e.sent();
10379
+ setTimeout(function () {
10380
+ var _a, _b;
10381
+ var el = (_b = (_a = _this.rowElements) === null || _a === void 0 ? void 0 : _a.last) === null || _b === void 0 ? void 0 : _b.nativeElement;
10382
+ if (el) {
10383
+ el.scrollIntoView({ behavior: 'smooth', block: 'center' });
10384
+ }
10385
+ }, 200);
10386
+ // reset reference to the new row after editCellIndex
10387
+ this.rowToEdit = this._newRowReference;
10388
+ return [3 /*break*/, 4];
10389
+ case 2:
10353
10390
  this.editRowIndex = this.data.length - 1;
10354
- this.rowToEdit = this.data[this.editRowIndex];
10355
- _a = this;
10391
+ this.rowToEdit = this._newRowReference;
10392
+ _d = this;
10356
10393
  return [4 /*yield*/, this._nextAvailableCellToEdit(true)];
10357
- case 2:
10358
- _a.editCellIndex = _b.sent();
10359
- this._detectChanges();
10360
- _b.label = 3;
10361
- case 3: return [3 /*break*/, 5];
10394
+ case 3:
10395
+ _d.editCellIndex = _e.sent();
10396
+ _e.label = 4;
10362
10397
  case 4:
10398
+ this._detectChanges();
10399
+ _e.label = 5;
10400
+ case 5: return [3 /*break*/, 7];
10401
+ case 6:
10363
10402
  this.addRow.next();
10364
- _b.label = 5;
10365
- case 5: return [2 /*return*/];
10403
+ _e.label = 7;
10404
+ case 7: return [2 /*return*/];
10366
10405
  }
10367
10406
  });
10368
10407
  });
@@ -10394,35 +10433,54 @@
10394
10433
  this._detectChanges();
10395
10434
  };
10396
10435
  SimpleGridComponent.prototype.removeRow = function () {
10397
- this.deleteRow.next(this.data[this.selectedRowIndex]);
10436
+ var absoluteIndex = this.selectedRowIndex;
10437
+ if (this.rowsPerPage) {
10438
+ absoluteIndex = (this.currentPage - 1) * this.rowsPerPage + this.selectedRowIndex;
10439
+ }
10440
+ this.deleteRow.next(this.data[absoluteIndex]);
10441
+ if (this.currentPage !== 1) {
10442
+ this.currentPage = 1;
10443
+ this.selectedRowIndex = -1;
10444
+ window.scrollTo({ top: 0, behavior: 'smooth' });
10445
+ }
10446
+ this._detectChanges();
10398
10447
  };
10399
- SimpleGridComponent.prototype.handleClickRow = function (event, index, row) {
10448
+ SimpleGridComponent.prototype.handleClickRow = function (event, index) {
10400
10449
  var _this = this;
10401
- setTimeout(function () {
10402
- if (_this._doubleClicked) {
10403
- return;
10404
- }
10405
- _this.selectTheRow(index);
10406
- }, 200);
10450
+ if (this.inlineEdit && this.showRowButtons && !this.editing) {
10451
+ this.editing = false;
10452
+ }
10453
+ else {
10454
+ setTimeout(function () {
10455
+ if (_this._doubleClicked) {
10456
+ return;
10457
+ }
10458
+ _this.selectTheRow(index);
10459
+ if (_this.inlineEdit && !_this.showRowButtons) {
10460
+ _this.editRow(event, true, index);
10461
+ }
10462
+ }, 200);
10463
+ }
10407
10464
  };
10408
10465
  SimpleGridComponent.prototype.selectTheRow = function (index, emit) {
10409
10466
  if (emit === void 0) { emit = true; }
10410
10467
  if (this.selectedRowIndex === -1 || (this.selectedRowIndex !== index && ((this.editing && this.validateAndSave()) || !this.editing))) {
10411
10468
  this.selectedRowIndex = index;
10412
10469
  }
10470
+ var absoluteIndex = this.rowsPerPage ? (this.currentPage - 1) * this.rowsPerPage + index : index;
10413
10471
  if (emit) {
10414
- this.selectRow.next(this.data[this.selectedRowIndex]);
10472
+ this.selectRow.next(this.data[absoluteIndex]);
10415
10473
  }
10416
10474
  this._detectChanges();
10417
10475
  };
10418
10476
  SimpleGridComponent.prototype.handleDblClickRow = function (event, index, row) {
10419
10477
  return __awaiter(this, void 0, void 0, function () {
10420
10478
  var canEdit;
10421
- return __generator(this, function (_a) {
10422
- switch (_a.label) {
10479
+ return __generator(this, function (_c) {
10480
+ switch (_c.label) {
10423
10481
  case 0: return [4 /*yield*/, this.isRowDisabled(row, index)];
10424
10482
  case 1:
10425
- if (_a.sent()) {
10483
+ if (_c.sent()) {
10426
10484
  this.selectedRowIndex = -1;
10427
10485
  return [2 /*return*/];
10428
10486
  }
@@ -10430,14 +10488,14 @@
10430
10488
  if (!(this.canRowBeEdittedFn && typeof this.canRowBeEdittedFn === 'function')) return [3 /*break*/, 3];
10431
10489
  return [4 /*yield*/, this.canRowBeEdittedFn.call(this, row)];
10432
10490
  case 2:
10433
- canEdit = _a.sent();
10434
- _a.label = 3;
10491
+ canEdit = _c.sent();
10492
+ _c.label = 3;
10435
10493
  case 3:
10436
10494
  if (canEdit) {
10437
10495
  this._doubleClicked = true;
10438
10496
  this.dblClickRow.next(this.data[index]);
10439
10497
  this.selectTheRow(index, false);
10440
- if (this.inlineEdit) {
10498
+ if (this.inlineEdit && !this.showRowButtons) {
10441
10499
  this.editRow(event);
10442
10500
  }
10443
10501
  }
@@ -10450,22 +10508,22 @@
10450
10508
  SimpleGridComponent.prototype.editRow = function (event, selectCell, rowIndex) {
10451
10509
  if (selectCell === void 0) { selectCell = true; }
10452
10510
  return __awaiter(this, void 0, void 0, function () {
10453
- var _a;
10454
- return __generator(this, function (_b) {
10455
- switch (_b.label) {
10511
+ var _c;
10512
+ return __generator(this, function (_d) {
10513
+ switch (_d.label) {
10456
10514
  case 0:
10457
10515
  if (rowIndex !== undefined) {
10458
- this.selectTheRow(rowIndex, false);
10516
+ this.selectTheRow(rowIndex);
10459
10517
  }
10518
+ this.editing = true;
10460
10519
  this.editRowIndex = this.selectedRowIndex;
10461
10520
  this.rowToEdit = this.data[this.editRowIndex];
10462
- this.editing = true;
10463
- if (!selectCell) return [3 /*break*/, 2];
10464
- _a = this;
10521
+ if (!(this.showRowButtons && this.inlineEdit && selectCell)) return [3 /*break*/, 2];
10522
+ _c = this;
10465
10523
  return [4 /*yield*/, this._nextAvailableCellToEdit(true)];
10466
10524
  case 1:
10467
- _a.editCellIndex = _b.sent();
10468
- _b.label = 2;
10525
+ _c.editCellIndex = _d.sent();
10526
+ _d.label = 2;
10469
10527
  case 2:
10470
10528
  this._detectChanges();
10471
10529
  return [2 /*return*/];
@@ -10475,27 +10533,25 @@
10475
10533
  };
10476
10534
  SimpleGridComponent.prototype.handleCellClick = function (event, row, rowIndex, cellIndex) {
10477
10535
  return __awaiter(this, void 0, void 0, function () {
10478
- return __generator(this, function (_a) {
10479
- switch (_a.label) {
10536
+ return __generator(this, function (_c) {
10537
+ switch (_c.label) {
10480
10538
  case 0:
10481
10539
  if (!this.editOnCellClick) return [3 /*break*/, 2];
10482
10540
  return [4 /*yield*/, this.isRowDisabled(row, rowIndex)];
10483
10541
  case 1:
10484
- if (_a.sent()) {
10542
+ if (_c.sent()) {
10485
10543
  this.selectedRowIndex = -1;
10486
10544
  return [2 /*return*/];
10487
10545
  }
10488
- this.selectTheRow(rowIndex, false);
10489
10546
  if (this.inlineEdit) {
10490
10547
  this.editRowIndex = rowIndex;
10491
10548
  this.editCellIndex = cellIndex;
10492
10549
  this.editing = true;
10493
- this.editRow(event, false);
10494
10550
  }
10495
10551
  return [3 /*break*/, 3];
10496
10552
  case 2:
10497
10553
  this.editCellIndex = cellIndex;
10498
- _a.label = 3;
10554
+ _c.label = 3;
10499
10555
  case 3:
10500
10556
  this._detectChanges();
10501
10557
  return [2 /*return*/];
@@ -10583,7 +10639,7 @@
10583
10639
  var value = row[col.key];
10584
10640
  if (value instanceof Date) {
10585
10641
  var formattedDate = value.toISOString().split('T')[0];
10586
- var _a = __read(formattedDate.split('-'), 3), year = _a[0], month = _a[1], day = _a[2];
10642
+ var _c = __read(formattedDate.split('-'), 3), year = _c[0], month = _c[1], day = _c[2];
10587
10643
  return day + "-" + month + "-" + year;
10588
10644
  }
10589
10645
  else if (typeof value === 'number') {
@@ -10603,7 +10659,7 @@
10603
10659
  if (!value)
10604
10660
  return '';
10605
10661
  if (typeof value === 'string' && value.includes('T00:00:00')) {
10606
- var _b = __read(value.replace('T00:00:00', '').split('-'), 3), year = _b[0], month = _b[1], day = _b[2];
10662
+ var _d = __read(value.replace('T00:00:00', '').split('-'), 3), year = _d[0], month = _d[1], day = _d[2];
10607
10663
  return day + "-" + month + "-" + year;
10608
10664
  }
10609
10665
  return String(value);
@@ -10748,9 +10804,26 @@
10748
10804
  };
10749
10805
  SimpleGridComponent.prototype._saveRow = function (stopediting) {
10750
10806
  if (stopediting === void 0) { stopediting = true; }
10751
- // emit saveEvent
10752
- if (this.rowToEdit) {
10753
- this.saveRow.next(this.rowToEdit);
10807
+ if (this._newRow) {
10808
+ this.saveRow.next(this._newRowReference);
10809
+ this._newRowReference = null; // clear
10810
+ }
10811
+ else {
10812
+ var index = -1; // existing row
10813
+ if (this.rowsPerPage) {
10814
+ index = (this.currentPage - 1) * this.rowsPerPage + this.editRowIndex;
10815
+ }
10816
+ else {
10817
+ index = this.editRowIndex;
10818
+ }
10819
+ if (index >= 0 && index < this.data.length) {
10820
+ this.saveRow.next(this.data[index]);
10821
+ }
10822
+ }
10823
+ if (this.currentPage !== 1) {
10824
+ this.currentPage = 1;
10825
+ this.selectedRowIndex = -1;
10826
+ window.scrollTo({ top: 0, behavior: 'smooth' });
10754
10827
  }
10755
10828
  this._newRow = false;
10756
10829
  if (stopediting) {
@@ -10790,7 +10863,7 @@
10790
10863
  SimpleGridComponent.decorators = [
10791
10864
  { type: i0.Component, args: [{
10792
10865
  selector: 'co-simple-grid',
10793
- template: "\n <co-grid-toolbar\n *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"showEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\">\n </co-grid-toolbar>\n\n <table\n id=\"simple-grid-table\"\n class=\"simple-grid-table\"\n [clickOutside]=\"editing\"\n (clickOutside)=\"handleClickOutsideRow()\">\n <colgroup>\n <col\n *ngFor=\"let column of headerColumnsCopy; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th\n scope=\"col\"\n #headerCell\n class=\"simple-grid-column-header\"\n *ngFor=\"let column of headerColumnsCopy; let index = index\">\n <div\n class=\"simple-grid-column-header-wrapper\"\n [class.resizable]=\"resizable\"\n [class.selected]=\"column.isSelected\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div\n class=\"simple-grid-column-header-label\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [class.with-menu]=\"showGridSettings\"\n [class.with-sort]=\"showColumnSort\"\n [textContent]=\"column.headerText || '&nbsp;'\"\n (click)=\"showColumnSort ? sortColumn(column, column.field) : toggleColumnMenu(column)\">\n </div>\n\n <div class=\"sort-column\" *ngIf=\"showColumnSort\">\n <co-button\n (click)=\"sortColumn(column, column?.field)\"\n [iconData]=\"icons.getIcon(Icons.ArrowUpArrowDown)\">\n </co-button>\n </div>\n\n <div class=\"column-menu\" *ngIf=\"column.isSelected\">\n <h3 [textContent]=\"'COLUMN_OPTIONS' | coreLocalize\"></h3>\n <ul>\n <li (click)=\"hideColumn(column)\">Hide Column</li>\n <li (click)=\"sortColumn(column, column.field)\">Sort Column</li>\n </ul>\n </div>\n </ng-template>\n <div\n *ngIf=\"resizable && column.resizable\"\n class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\">\n </div>\n </div>\n </th>\n </tr>\n\n <div *ngIf=\"showGridSettings\" class=\"grid-settings\">\n <co-button\n [class.selected]=\"isSettingsMenuOpen\"\n [iconData]=\"icons.getIcon(Icons.CogWheels)\"\n (click)=\"toggleSettingsMenu()\">\n </co-button>\n\n <div class=\"settings-menu\" *ngIf=\"isSettingsMenuOpen\">\n <h3 [textContent]=\"'GRID_OPTIONS' | coreLocalize\"></h3>\n <ul>\n <li (click)=\"exportToExcel()\">Export to Excel</li>\n <li *ngIf=\"headerColumnsCopy.length !== headerColumns.length\" (click)=\"showAllColumns()\">\n Show All Columns\n </li>\n </ul>\n </div>\n </div>\n </thead>\n <tbody\n #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled || editing\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <co-form class=\"simple-grid-row-form\">\n <tr\n class=\"simple-grid-row\"\n [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.disabled]=\"getIsRowDisabled(rowIndex)\"\n [class.editing]=\"rowIndex === editRowIndex\"\n *ngFor=\"let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index\"\n cdkDrag\n (click)=\"handleClickRow($event, rowIndex, row)\" (dblclick)=\"handleDblClickRow($event, rowIndex, row)\"\n (visibilityChange)=\"rowVisible.next(row)\"\n (mouseenter)=\"hoveredRowIndex = rowIndex\"\n (mouseleave)=\"hoveredRowIndex = -1\"\n >\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumnsCopy.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\">\n </co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumnsCopy; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex && rowIndex === editRowIndex\"\n (cellClick)=\"handleCellClick($event, row, rowIndex, columnIndex)\">\n </co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n <ng-container *ngIf=\"inlineEdit\">\n <div class=\"icons-container\" *ngIf=\"!editing\">\n <co-icon class=\"icon-item icon-edit\"\n [iconData]=\"icons.getIcon(Icons.PenToSquareSolid)\" *ngIf=\"hoveredRowIndex === rowIndex\"\n (click)=\"editRow($event, true, rowIndex); $event.stopPropagation()\"></co-icon>\n <co-icon class=\"icon-item icon-delete\"\n [iconData]=\"icons.getIcon(Icons.TrashBin)\" *ngIf=\"hoveredRowIndex === rowIndex\"\n (click)=\"removeRow()\"></co-icon>\n </div>\n <div class=\"icons-container\">\n <co-button class=\"save-button\"\n *ngIf=\"editing && (selectedRowIndex === rowIndex || (isNewRow && rowIndex === editRowIndex))\"\n [iconData]=\"icons.getIcon(Icons.CheckDuotone)\"\n (click)=\"validateAndSave(); $event.stopPropagation()\"></co-button>\n <co-button class=\"close-button\"\n *ngIf=\"editing && (selectedRowIndex === rowIndex || (isNewRow && rowIndex === editRowIndex))\"\n [iconData]=\"icons.getIcon(Icons.CrossSkinny)\"\n (click)=\"cancelEditRow(); $event.stopPropagation() \"></co-button>\n </div>\n </ng-container>\n </ng-container>\n </tr>\n </co-form>\n </tbody>\n </table>\n <co-pagination-bar\n *ngIf=\"data?.length > rowsPerPage\" class=\"pagination-bar\"\n [itemsPerPage]=\"rowsPerPage\"\n [currentPage]=\"currentPage\"\n [totalItems]=\"data.length\"\n [autoHide]=\"true\"\n (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\">\n </co-pagination-bar>\n ",
10866
+ template: "\n <co-grid-toolbar\n *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"showEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\">\n </co-grid-toolbar>\n\n <table\n id=\"simple-grid-table\"\n class=\"simple-grid-table\"\n [clickOutside]=\"editing\"\n (clickOutside)=\"handleClickOutsideRow()\">\n <colgroup>\n <col\n *ngFor=\"let column of headerColumnsCopy; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th\n scope=\"col\"\n #headerCell\n class=\"simple-grid-column-header\"\n *ngFor=\"let column of headerColumnsCopy; let index = index\">\n <div\n class=\"simple-grid-column-header-wrapper\"\n [class.resizable]=\"resizable\"\n [class.selected]=\"column.isSelected\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div\n class=\"simple-grid-column-header-label\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [class.with-menu]=\"showGridSettings\"\n [class.with-sort]=\"showColumnSort\"\n [textContent]=\"column.headerText || '&nbsp;'\"\n (click)=\"showColumnSort ? sortColumn(column, column.field) : toggleColumnMenu(column)\">\n </div>\n\n <div class=\"sort-column\" *ngIf=\"showColumnSort\">\n <co-button\n (click)=\"sortColumn(column, column?.field)\"\n [iconData]=\"icons.getIcon(Icons.ArrowUpArrowDown)\">\n </co-button>\n </div>\n\n <div class=\"column-menu\" *ngIf=\"column.isSelected\">\n <h3 [textContent]=\"'COLUMN_OPTIONS' | coreLocalize\"></h3>\n <ul>\n <li (click)=\"hideColumn(column)\">Hide Column</li>\n <li (click)=\"sortColumn(column, column.field)\">Sort Column</li>\n </ul>\n </div>\n </ng-template>\n <div\n *ngIf=\"resizable && column.resizable\"\n class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\">\n </div>\n </div>\n </th>\n </tr>\n\n <div *ngIf=\"showGridSettings\" class=\"grid-settings\">\n <co-button\n [class.selected]=\"isSettingsMenuOpen\"\n [iconData]=\"icons.getIcon(Icons.CogWheels)\"\n (click)=\"toggleSettingsMenu()\">\n </co-button>\n\n <div class=\"settings-menu\" *ngIf=\"isSettingsMenuOpen\">\n <h3 [textContent]=\"'GRID_OPTIONS' | coreLocalize\"></h3>\n <ul>\n <li (click)=\"exportToExcel()\">Export to Excel</li>\n <li *ngIf=\"headerColumnsCopy.length !== headerColumns.length\" (click)=\"showAllColumns()\">\n Show All Columns\n </li>\n </ul>\n </div>\n </div>\n </thead>\n <tbody\n #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled || editing\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <co-form class=\"simple-grid-row-form\">\n <tr\n #rowElement\n class=\"simple-grid-row\"\n [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.disabled]=\"getIsRowDisabled(rowIndex)\"\n [class.editing]=\"rowIndex === editRowIndex\"\n *ngFor=\"let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index\"\n cdkDrag\n (click)=\"handleClickRow($event, rowIndex)\" (dblclick)=\"handleDblClickRow($event, rowIndex, row)\"\n (visibilityChange)=\"rowVisible.next(row)\"\n (mouseenter)=\"hoveredRowIndex = rowIndex\"\n (mouseleave)=\"hoveredRowIndex = -1\"\n >\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumnsCopy.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\">\n </co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumnsCopy; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex && rowIndex === editRowIndex\"\n (cellClick)=\"handleCellClick($event, row, rowIndex, columnIndex)\">\n </co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n <ng-container *ngIf=\"inlineEdit && showRowButtons\">\n <div class=\"icons-container\" *ngIf=\"!editing\">\n <co-icon class=\"icon-item icon-edit\"\n [iconData]=\"icons.getIcon(Icons.PenToSquareSolid)\" *ngIf=\"hoveredRowIndex === rowIndex\"\n (click)=\"editRow($event, true, rowIndex); $event.stopPropagation()\"></co-icon>\n <co-icon class=\"icon-item icon-delete\"\n [iconData]=\"icons.getIcon(Icons.TrashBin)\" *ngIf=\"hoveredRowIndex === rowIndex\"\n (click)=\"selectTheRow(rowIndex); removeRow();\"></co-icon>\n </div>\n <div class=\"icons-container\">\n <co-button class=\"save-button\"\n *ngIf=\"editing && (selectedRowIndex === rowIndex || (isNewRow && rowIndex === editRowIndex))\"\n [iconData]=\"icons.getIcon(Icons.CheckDuotone)\"\n (click)=\"validateAndSave(); $event.stopPropagation()\"></co-button>\n <co-button class=\"close-button\"\n *ngIf=\"editing && (selectedRowIndex === rowIndex || (isNewRow && rowIndex === editRowIndex))\"\n [iconData]=\"icons.getIcon(Icons.CrossSkinny)\"\n (click)=\"cancelEditRow(); $event.stopPropagation() \"></co-button>\n </div>\n </ng-container>\n </ng-container>\n </tr>\n </co-form>\n </tbody>\n </table>\n <co-pagination-bar\n *ngIf=\"data?.length > rowsPerPage\" class=\"pagination-bar\"\n [itemsPerPage]=\"rowsPerPage\"\n [currentPage]=\"currentPage\"\n [totalItems]=\"data.length\"\n [autoHide]=\"true\"\n (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\">\n </co-pagination-bar>\n ",
10794
10867
  providers: [FormMasterService],
10795
10868
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
10796
10869
  encapsulation: i0.ViewEncapsulation.None
@@ -10804,6 +10877,7 @@
10804
10877
  ]; };
10805
10878
  SimpleGridComponent.propDecorators = {
10806
10879
  headerCells: [{ type: i0.ViewChildren, args: ['headerCell',] }],
10880
+ rowElements: [{ type: i0.ViewChildren, args: ['rowElement',] }],
10807
10881
  showAdd: [{ type: i0.Input }],
10808
10882
  showDelete: [{ type: i0.Input }],
10809
10883
  editOnCellClick: [{ type: i0.Input }],
@@ -10812,6 +10886,7 @@
10812
10886
  rowsPerPage: [{ type: i0.Input }],
10813
10887
  rowDisabledFn: [{ type: i0.Input }],
10814
10888
  showColumnSort: [{ type: i0.Input }],
10889
+ showRowButtons: [{ type: i0.Input }],
10815
10890
  canRowBeEdittedFn: [{ type: i0.Input }],
10816
10891
  showClass: [{ type: i0.HostBinding, args: ['class.co-simple-grid',] }],
10817
10892
  handleKeyDown: [{ type: i0.HostListener, args: ['keydown', ['$event'],] }]
@@ -11892,8 +11967,15 @@
11892
11967
 
11893
11968
  var ListOfValuesComponent = /** @class */ (function (_super) {
11894
11969
  __extends(ListOfValuesComponent, _super);
11895
- function ListOfValuesComponent() {
11896
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
11970
+ function ListOfValuesComponent(formComponent, changeDetector, overlayService, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) {
11971
+ var _this = _super.call(this, changeDetector, componentFactoryResolver, overlayService, formUserChangeListener, ngZoneWrapper, elementRef) || this;
11972
+ _this.formComponent = formComponent;
11973
+ _this.changeDetector = changeDetector;
11974
+ _this.overlayService = overlayService;
11975
+ _this.componentFactoryResolver = componentFactoryResolver;
11976
+ _this.formUserChangeListener = formUserChangeListener;
11977
+ _this.ngZoneWrapper = ngZoneWrapper;
11978
+ _this.elementRef = elementRef;
11897
11979
  _this.icons = exports.CoreComponentsIcon;
11898
11980
  _this.multiselect = false;
11899
11981
  _this.largeCollection = false;
@@ -11907,6 +11989,7 @@
11907
11989
  _this.filteredCollection = [];
11908
11990
  _this.isLoading = false;
11909
11991
  _this._collection = [];
11992
+ _super.prototype._markAsOnPush.call(_this);
11910
11993
  return _this;
11911
11994
  }
11912
11995
  Object.defineProperty(ListOfValuesComponent.prototype, "model", {
@@ -12077,7 +12160,7 @@
12077
12160
  }
12078
12161
  }
12079
12162
  }
12080
- this.model = option;
12163
+ this.setModel(option);
12081
12164
  this.modelChange.emit(this.model);
12082
12165
  this.detectChanges();
12083
12166
  };
@@ -12131,7 +12214,7 @@
12131
12214
  ListOfValuesComponent.decorators = [
12132
12215
  { type: i0.Component, args: [{
12133
12216
  selector: 'co-list-of-values',
12134
- template: "\n <co-input-text\n *ngIf=\"!largeCollection\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isSelectOpen\"\n aria-controls=\"lov-popup\"\n role=\"combobox\"\n class=\"no-focus-line\"\n overlayParent\n #parentForOverlay=\"overlayParent\"\n type=\"text\"\n [id]=\"label\"\n [model]=\"multiselect ? selectedModels : selectedModel\"\n [placeholder]=\"label\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [noClickFocus]=\"false\"\n [leftIconData]=\"leftIconData\"\n [rightIcon]=\"isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular\"\n [showClearButton]=\"true\"\n [useContent]=\"multiselect\"\n [customHeight]=\"multiselect\"\n [keepFocussed]=\"keepFocussed\"\n (modelChange)=\"handleInputModelChange($event)\"\n (click)=\"openPopup()\"\n (rightIconClick)=\"toggleSelect()\"\n (keydown)=\"handleInputKeyDown($event)\"\n (clearIconClick)=\"clearModel($event)\"\n (blur)=\"checkModel()\">\n <ng-container *ngIf=\"multiselect && showChips\">\n <div class=\"multiselect-chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let chip of model\">\n <span class=\"chips-description\" [textContent]=\"chip[displayField]\"></span>\n <co-icon class=\"remove-chip-icon\" [icon]=\"icons.CrossSkinny\" (click)=\"removeOptionFromModel(chip)\"></co-icon>\n </div>\n </div>\n </ng-container>\n </co-input-text>\n \n <co-input-text\n *ngIf=\"largeCollection\"\n [model]=\"filterText\"\n [placeholder]=\"label\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (modelChange)=\"onModelChange($event)\">\n </co-input-text>\n <div *ngIf=\"isLoading\" class=\"filter-loader\"><span></span></div>\n ",
12217
+ template: "\n <co-input-text\n *ngIf=\"!largeCollection\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isSelectOpen\"\n aria-controls=\"lov-popup\"\n role=\"combobox\"\n class=\"no-focus-line\"\n overlayParent\n #parentForOverlay=\"overlayParent\"\n type=\"text\"\n [id]=\"label\"\n [model]=\"multiselect ? selectedModels : selectedModel\"\n [placeholder]=\"label\"\n [myFormInputInstance]=\"this\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [noClickFocus]=\"false\"\n [leftIconData]=\"leftIconData\"\n [rightIcon]=\"isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular\"\n [showClearButton]=\"true\"\n [useContent]=\"multiselect\"\n [customHeight]=\"multiselect\"\n [keepFocussed]=\"keepFocussed\"\n (modelChange)=\"handleInputModelChange($event)\"\n (click)=\"openPopup()\"\n (rightIconClick)=\"toggleSelect()\"\n (keydown)=\"handleInputKeyDown($event)\"\n (clearIconClick)=\"clearModel($event)\"\n (blur)=\"checkModel()\">\n <ng-container *ngIf=\"multiselect && showChips\">\n <div class=\"multiselect-chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let chip of model\">\n <span class=\"chips-description\" [textContent]=\"chip[displayField]\"></span>\n <co-icon class=\"remove-chip-icon\" [icon]=\"icons.CrossSkinny\" (click)=\"removeOptionFromModel(chip)\"></co-icon>\n </div>\n </div>\n </ng-container>\n </co-input-text>\n\n <co-input-text\n *ngIf=\"largeCollection\"\n [model]=\"filterText\"\n [placeholder]=\"label\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (modelChange)=\"onModelChange($event)\">\n </co-input-text>\n <div *ngIf=\"isLoading\" class=\"filter-loader\"><span></span></div>\n <input type=\"hidden\" [ngModel]=\"model\">\n ",
12135
12218
  providers: [
12136
12219
  OverlayService,
12137
12220
  {
@@ -12142,6 +12225,15 @@
12142
12225
  encapsulation: i0.ViewEncapsulation.None
12143
12226
  },] }
12144
12227
  ];
12228
+ ListOfValuesComponent.ctorParameters = function () { return [
12229
+ { type: FormComponent, decorators: [{ type: i0.Optional }] },
12230
+ { type: i0.ChangeDetectorRef },
12231
+ { type: OverlayService },
12232
+ { type: i0.ComponentFactoryResolver },
12233
+ { type: FormInputUserModelChangeListenerService },
12234
+ { type: NgZoneWrapperService },
12235
+ { type: i0.ElementRef }
12236
+ ]; };
12145
12237
  ListOfValuesComponent.propDecorators = {
12146
12238
  model: [{ type: i0.Input }],
12147
12239
  parentForOverlay: [{ type: i0.ViewChild, args: ['parentForOverlay', { read: i0.ElementRef },] }],