@colijnit/corecomponents_v12 259.1.10 → 259.1.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.
@@ -6630,7 +6630,8 @@
6630
6630
  return {
6631
6631
  ngModule: CoreComponentsTranslationModule,
6632
6632
  providers: [
6633
- CoreComponentsTranslationService
6633
+ CoreComponentsTranslationService,
6634
+ CoreDictionaryService
6634
6635
  ]
6635
6636
  };
6636
6637
  };
@@ -6641,10 +6642,6 @@
6641
6642
  declarations: [
6642
6643
  CoreLocalizePipe
6643
6644
  ],
6644
- providers: [
6645
- CoreComponentsTranslationService,
6646
- CoreDictionaryService
6647
- ],
6648
6645
  exports: [
6649
6646
  CoreLocalizePipe
6650
6647
  ]
@@ -7274,7 +7271,7 @@
7274
7271
  CalendarTemplateComponent.decorators = [
7275
7272
  { type: i0.Component, args: [{
7276
7273
  selector: "calendar-template",
7277
- template: "\n <div class=\"calendar\">\n <div class=\"selected-date-display\">\n <span *ngIf=\"selectedDate\" class=\"selected-date-year\">\n {{ selectedDate.getFullYear() }}\n </span>\n <span *ngIf=\"selectedDate\" class=\"selected-date-day\">\n {{ selectedDate | date: 'EEE d MMM' }}\n </span>\n <span *ngIf=\"!selectedDate\" class=\"no-date-selected\" [textContent]=\"'Selecteer datum'\"></span>\n </div>\n <div class=\"calendar-header\" *ngIf=\"monthSelection || yearSelection\">\n <co-icon class=\"calendar-change-month-button\" [icon]=\"icons.ArrowPointLeft\" (click)=\"!monthSelection ? prevYear() : prevMonth()\"></co-icon>\n\n <div class=\"calendar-header-title-wrapper\">\n <span class=\"calendar-header-title\" [textContent]=\"monthSelection ? monthHeader : yearHeader\"\n (click)=\"openMonthSelection()\"\n ></span>\n </div>\n\n <co-icon class=\"calendar-change-month-button\" [icon]=\"icons.ArrowPointRight\" (click)=\"!monthSelection ? nextYear() : nextMonth()\"></co-icon>\n </div>\n\n <div class=\"selection-grid month\" *ngIf=\"showMonthSelection\">\n <div *ngFor=\"let month of monthSelectionNames\"\n class=\"calendar-month-or-year\"\n (click)=\"selectMonth(month)\">\n <ng-container *ngIf=\"month\">\n <div class=\"month\" [textContent]=\"month\"></div>\n </ng-container>\n </div>\n </div>\n\n <div class=\"selection-grid year\" *ngIf=\"showYearSelection\">\n <div *ngFor=\"let year of yearSelectionYears\"\n class=\"calendar-month-or-year\"\n (click)=\"selectYear(year)\"\n [textContent]=\"year\">\n <ng-container *ngIf=\"year\">\n <div class=\"year\" [textContent]=\"year\"></div>\n </ng-container>\n </div>\n </div>\n <div class=\"calendar-wrapper\">\n <div class=\"week-wrapper\" *ngIf=\"showWeekNumbers && showCalendarBody\">\n <div class=\"week-number\" [textContent]=\"'W'\"></div>\n <div class=\"week-number\" *ngFor=\"let weekNumber of weekNumbers\">\n {{ weekNumber }}\n </div>\n </div>\n <div class=\"calendar-body\" *ngIf=\"showCalendarBody\">\n <div class=\"day-names\">\n <div class=\"weekday\" *ngFor=\"let dayName of dayNames\" [textContent]=\"dayName\"></div>\n </div>\n <div *ngFor=\"let day of daysInMonth\" class=\"calendar-day\"\n [class.highlighted-day]=\"daysToHighlight.includes(day)\"\n [class.selected-day]=\"selectedDate && (day && day.getTime() === selectedDate.getTime()) ||\n secondSelectedDate && (day && day.getTime() === secondSelectedDate.getTime()) ||\n temporarySelectedSecondaryDate && (day && day.getTime() === temporarySelectedSecondaryDate.getTime())\"\n (click)=\"selectDate(day)\"\n (mouseover)=\"handleMouseOverDay(day)\">\n <!-- Day number -->\n <ng-container *ngIf=\"day\">\n <div class=\"day-number\" [textContent]=\"day.getDate()\"></div>\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"calendar-action-buttons\" *ngIf=\"showButtons\">\n <span class=\"set-and-close-button\" *ngIf=\"this.doubleCalendar\" (click)=\"setAndClose()\">Instellen</span>\n <span class=\"clear-date-button\" *ngIf=\"this.selectedDate\" (click)=\"clearDate()\">Wissen</span>\n <span class=\"cancel-button\" (click)=\"closeDate()\">Annuleren</span>\n </div>\n </div>\n ",
7274
+ template: "\n <div class=\"calendar\">\n <div class=\"selected-date-display\">\n <span *ngIf=\"selectedDate\" class=\"selected-date-year\">\n {{ selectedDate.getFullYear() }}\n </span>\n <span *ngIf=\"selectedDate\" class=\"selected-date-day\">\n {{ selectedDate | date: 'EEE d MMM' }}\n </span>\n <span *ngIf=\"!selectedDate\" class=\"no-date-selected\" [textContent]=\"'Selecteer datum'\"></span>\n </div>\n <div class=\"calendar-header\" *ngIf=\"monthSelection || yearSelection\">\n <co-icon class=\"calendar-change-month-button\" [icon]=\"icons.ArrowPointLeft\" (click)=\"!monthSelection ? prevYear() : prevMonth()\"></co-icon>\n\n <div class=\"calendar-header-title-wrapper\">\n <span class=\"calendar-header-title\" [textContent]=\"monthSelection ? monthHeader : yearHeader\"\n (click)=\"openMonthSelection()\"\n ></span>\n </div>\n\n <co-icon class=\"calendar-change-month-button\" [icon]=\"icons.ArrowPointRight\" (click)=\"!monthSelection ? nextYear() : nextMonth()\"></co-icon>\n </div>\n\n <div class=\"selection-grid month\" *ngIf=\"showMonthSelection\">\n <div *ngFor=\"let month of monthSelectionNames\"\n class=\"calendar-month-or-year\"\n (click)=\"selectMonth(month)\">\n <ng-container *ngIf=\"month\">\n <div class=\"month\" [textContent]=\"month\"></div>\n </ng-container>\n </div>\n </div>\n\n <div class=\"selection-grid year\" *ngIf=\"showYearSelection\">\n <div *ngFor=\"let year of yearSelectionYears\"\n class=\"calendar-month-or-year\"\n (click)=\"selectYear(year)\"\n [textContent]=\"year\">\n <ng-container *ngIf=\"year\">\n <div class=\"year\" [textContent]=\"year\"></div>\n </ng-container>\n </div>\n </div>\n <div class=\"calendar-wrapper\">\n <div class=\"week-wrapper\" *ngIf=\"showWeekNumbers && showCalendarBody\">\n <div class=\"week-number\" [textContent]=\"'W'\"></div>\n <div class=\"week-number\" *ngFor=\"let weekNumber of weekNumbers\">\n {{ weekNumber }}\n </div>\n </div>\n <div class=\"calendar-body\" *ngIf=\"showCalendarBody\">\n <div class=\"day-names\">\n <div class=\"weekday\" *ngFor=\"let dayName of dayNames\" [textContent]=\"dayName\"></div>\n </div>\n <div *ngFor=\"let day of daysInMonth\" class=\"calendar-day\"\n [class.highlighted-day]=\"daysToHighlight.includes(day)\"\n [class.selected-day]=\"selectedDate && (day && day.getTime() === selectedDate.getTime()) ||\n secondSelectedDate && (day && day.getTime() === secondSelectedDate.getTime()) ||\n temporarySelectedSecondaryDate && (day && day.getTime() === temporarySelectedSecondaryDate.getTime())\"\n (click)=\"selectDate(day)\"\n (mouseover)=\"handleMouseOverDay(day)\">\n <!-- Day number -->\n <ng-container *ngIf=\"day\">\n <div class=\"day-number\" [textContent]=\"day.getDate()\"></div>\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"calendar-action-buttons\" *ngIf=\"showButtons\">\n <span class=\"set-and-close-button\" *ngIf=\"this.doubleCalendar\" (click)=\"setAndClose()\" [textContent]=\"'SET' | coreLocalize\"></span>\n <span class=\"clear-date-button\" *ngIf=\"this.selectedDate\" (click)=\"clearDate()\" [textContent]=\"'ERASE' | coreLocalize\"></span>\n <span class=\"cancel-button\" (click)=\"closeDate()\" [textContent]=\"'CANCEL' | coreLocalize\"></span>\n </div>\n </div>\n ",
7278
7275
  encapsulation: i0.ViewEncapsulation.None
7279
7276
  },] }
7280
7277
  ];
@@ -9878,7 +9875,8 @@
9878
9875
  };
9879
9876
 
9880
9877
  var BaseSimpleGridComponent = /** @class */ (function () {
9881
- function BaseSimpleGridComponent() {
9878
+ function BaseSimpleGridComponent(changeDetection) {
9879
+ this.changeDetection = changeDetection;
9882
9880
  this.MIN_COLUMN_WIDTH = 50;
9883
9881
  this.dataChanged = new rxjs.Subject();
9884
9882
  this.dragDropEnabled = false;
@@ -9894,6 +9892,7 @@
9894
9892
  this.emitDragDrop = false;
9895
9893
  this.onDrop = new i0.EventEmitter();
9896
9894
  this.selectRow = new i0.EventEmitter();
9895
+ this.deselectRow = new i0.EventEmitter();
9897
9896
  this.dblClickRow = new i0.EventEmitter();
9898
9897
  this.saveRow = new i0.EventEmitter();
9899
9898
  this.deleteRow = new i0.EventEmitter();
@@ -9987,6 +9986,11 @@
9987
9986
  return row.singleColumnIndex;
9988
9987
  };
9989
9988
  BaseSimpleGridComponent.prototype.prepareDataRow = function (row, index) {
9989
+ return __awaiter(this, void 0, void 0, function () {
9990
+ return __generator(this, function (_a) {
9991
+ return [2 /*return*/];
9992
+ });
9993
+ });
9990
9994
  };
9991
9995
  BaseSimpleGridComponent.prototype._setColumns = function (columns) {
9992
9996
  var _a;
@@ -9994,34 +9998,66 @@
9994
9998
  this.columns.sort(function (a, b) { return a.order < b.order ? -1 : 1; });
9995
9999
  };
9996
10000
  BaseSimpleGridComponent.prototype._prepareData = function () {
9997
- if (this._prepared) {
9998
- return;
9999
- }
10000
- this.disabledRows.length = 0;
10001
- if (this.columns && this.columns.length > 0) {
10002
- this.headerColumns = this.columns.filter(function (c) { return !c.singleColumn; });
10003
- this.headerColumnsCopy = this.headerColumns;
10004
- var singleColumnIndex = -1;
10005
- for (var i = 0; i < this.columns.length; i++) {
10006
- if (this.columns[i].singleColumn) {
10007
- singleColumnIndex = i;
10008
- break;
10009
- }
10010
- }
10011
- // first check if there's single column data
10012
- if (singleColumnIndex > -1 && this.data && this.data.length > 0) {
10013
- var field = this.columns[singleColumnIndex].field;
10014
- for (var i = 0; i < this.data.length; i++) { // then mark row as single column row
10015
- if (this.data[i][field] !== undefined && this.data[i][field] !== null && this.data[i][field] !== "") {
10016
- // bit nasty to add prop, but cool for now
10017
- this.data[i].singleColumnIndex = singleColumnIndex;
10018
- }
10019
- this.prepareDataRow(this.data[i], i);
10001
+ return __awaiter(this, void 0, void 0, function () {
10002
+ var singleColumnIndex, i, field, i, j;
10003
+ return __generator(this, function (_a) {
10004
+ switch (_a.label) {
10005
+ case 0:
10006
+ if (this._prepared) {
10007
+ return [2 /*return*/];
10008
+ }
10009
+ this.disabledRows.length = 0;
10010
+ if (!(this.columns && this.columns.length > 0)) return [3 /*break*/, 10];
10011
+ this.headerColumns = this.columns.filter(function (c) { return !c.singleColumn; });
10012
+ this.headerColumnsCopy = this.headerColumns;
10013
+ singleColumnIndex = -1;
10014
+ for (i = 0; i < this.columns.length; i++) {
10015
+ if (this.columns[i].singleColumn) {
10016
+ singleColumnIndex = i;
10017
+ break;
10018
+ }
10019
+ }
10020
+ if (!(this.data && this.data.length > 0)) return [3 /*break*/, 9];
10021
+ if (!(singleColumnIndex > -1)) return [3 /*break*/, 5];
10022
+ field = this.columns[singleColumnIndex].field;
10023
+ i = 0;
10024
+ _a.label = 1;
10025
+ case 1:
10026
+ if (!(i < this.data.length)) return [3 /*break*/, 4];
10027
+ if (this.data[i][field] !== undefined && this.data[i][field] !== null && this.data[i][field] !== "") {
10028
+ // bit nasty to add prop, but cool for now
10029
+ this.data[i].singleColumnIndex = singleColumnIndex;
10030
+ }
10031
+ return [4 /*yield*/, this.prepareDataRow(this.data[i], i)];
10032
+ case 2:
10033
+ _a.sent();
10034
+ _a.label = 3;
10035
+ case 3:
10036
+ i++;
10037
+ return [3 /*break*/, 1];
10038
+ case 4: return [3 /*break*/, 9];
10039
+ case 5:
10040
+ j = 0;
10041
+ _a.label = 6;
10042
+ case 6:
10043
+ if (!(j < this.data.length)) return [3 /*break*/, 9];
10044
+ return [4 /*yield*/, this.prepareDataRow(this.data[j], j)];
10045
+ case 7:
10046
+ _a.sent();
10047
+ _a.label = 8;
10048
+ case 8:
10049
+ j++;
10050
+ return [3 /*break*/, 6];
10051
+ case 9:
10052
+ this._prepared = true;
10053
+ _a.label = 10;
10054
+ case 10:
10055
+ this._resizeColumnsToFit();
10056
+ this.changeDetection.detectChanges();
10057
+ return [2 /*return*/];
10020
10058
  }
10021
- }
10022
- this._prepared = true;
10023
- }
10024
- this._resizeColumnsToFit();
10059
+ });
10060
+ });
10025
10061
  };
10026
10062
  BaseSimpleGridComponent.prototype._resizeColumnsToFit = function () {
10027
10063
  var calculateColumns = this.columns.filter(function (c) { return !c.autoFit && !c.width; });
@@ -10042,6 +10078,9 @@
10042
10078
  BaseSimpleGridComponent.decorators = [
10043
10079
  { type: i0.Directive }
10044
10080
  ];
10081
+ BaseSimpleGridComponent.ctorParameters = function () { return [
10082
+ { type: i0.ChangeDetectorRef }
10083
+ ]; };
10045
10084
  BaseSimpleGridComponent.propDecorators = {
10046
10085
  content: [{ type: i0.ContentChildren, args: [SimpleGridColumnDirective,] }],
10047
10086
  data: [{ type: i0.Input }],
@@ -10056,6 +10095,7 @@
10056
10095
  extraColumns: [{ type: i0.Input }],
10057
10096
  onDrop: [{ type: i0.Output }],
10058
10097
  selectRow: [{ type: i0.Output }],
10098
+ deselectRow: [{ type: i0.Output }],
10059
10099
  dblClickRow: [{ type: i0.Output }],
10060
10100
  saveRow: [{ type: i0.Output }],
10061
10101
  deleteRow: [{ type: i0.Output }],
@@ -10067,14 +10107,15 @@
10067
10107
 
10068
10108
  var SimpleGridComponent = /** @class */ (function (_super) {
10069
10109
  __extends(SimpleGridComponent, _super);
10070
- function SimpleGridComponent(icons, _changeDetection, _formMaster) {
10071
- var _this = _super.call(this) || this;
10110
+ function SimpleGridComponent(icons, changeDetection, _formMaster) {
10111
+ var _this = _super.call(this, changeDetection) || this;
10072
10112
  _this.icons = icons;
10073
- _this._changeDetection = _changeDetection;
10113
+ _this.changeDetection = changeDetection;
10074
10114
  _this._formMaster = _formMaster;
10075
10115
  _this.defaultTextAlign = exports.ColumnAlign.Left;
10076
10116
  _this.showAdd = false;
10077
10117
  _this.showDelete = false;
10118
+ _this.deselectAllowed = false;
10078
10119
  _this.editOnCellClick = true;
10079
10120
  _this.rightToolbar = false;
10080
10121
  _this.showGridSettings = false;
@@ -10122,7 +10163,7 @@
10122
10163
  this._nextAvailableCellToEdit(!event.shiftKey, this.editCellIndex)
10123
10164
  .then(function (index) {
10124
10165
  _this.editCellIndex = index;
10125
- _this._changeDetection.markForCheck();
10166
+ _this.changeDetection.markForCheck();
10126
10167
  });
10127
10168
  this._detectChanges();
10128
10169
  }
@@ -10288,6 +10329,12 @@
10288
10329
  this.selectRow.next(this.data[absoluteIndex]);
10289
10330
  }
10290
10331
  }
10332
+ else if (this.selectedRowIndex === index && this.deselectAllowed && ((this.editing && this.validateAndSave()) || !this.editing)) {
10333
+ this.selectedRowIndex = -1;
10334
+ if (emit) {
10335
+ this.deselectRow.next();
10336
+ }
10337
+ }
10291
10338
  this._detectChanges();
10292
10339
  };
10293
10340
  SimpleGridComponent.prototype.handleDblClickRow = function (event, index, row) {
@@ -10522,7 +10569,16 @@
10522
10569
  return hasSelectedTrue ? items.filter(function (item) { return item.selected === true; }) : items;
10523
10570
  };
10524
10571
  SimpleGridComponent.prototype.prepareDataRow = function (row, index) {
10525
- this.isRowDisabled(row, index);
10572
+ return __awaiter(this, void 0, void 0, function () {
10573
+ return __generator(this, function (_c) {
10574
+ switch (_c.label) {
10575
+ case 0: return [4 /*yield*/, this.isRowDisabled(row, index)];
10576
+ case 1:
10577
+ _c.sent();
10578
+ return [2 /*return*/];
10579
+ }
10580
+ });
10581
+ });
10526
10582
  };
10527
10583
  SimpleGridComponent.prototype._resetDblClick = function () {
10528
10584
  var _this = this;
@@ -10665,7 +10721,7 @@
10665
10721
  this._detectChanges();
10666
10722
  };
10667
10723
  SimpleGridComponent.prototype._detectChanges = function () {
10668
- this._changeDetection.detectChanges();
10724
+ this.changeDetection.detectChanges();
10669
10725
  };
10670
10726
  SimpleGridComponent.prototype._resetEdit = function () {
10671
10727
  this._newRow = false;
@@ -10696,6 +10752,7 @@
10696
10752
  rowElements: [{ type: i0.ViewChildren, args: ['rowElement',] }],
10697
10753
  showAdd: [{ type: i0.Input }],
10698
10754
  showDelete: [{ type: i0.Input }],
10755
+ deselectAllowed: [{ type: i0.Input }],
10699
10756
  editOnCellClick: [{ type: i0.Input }],
10700
10757
  rightToolbar: [{ type: i0.Input }],
10701
10758
  showGridSettings: [{ type: i0.Input }],