@colijnit/corecomponents_v12 256.1.5 → 256.1.7

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.
@@ -5863,7 +5863,7 @@
5863
5863
  _this.rightIcon = exports.CoreComponentsIcon.CalendarDayRegular;
5864
5864
  _this.locale = 'en-EN';
5865
5865
  _this.leftIconClick = new i0.EventEmitter();
5866
- _this.closeAfterDateSelection = true;
5866
+ _this.closeAfterDateSelection = false;
5867
5867
  return _this;
5868
5868
  }
5869
5869
  return BaseInputDatePickerDirective;
@@ -5897,7 +5897,7 @@
5897
5897
  CalendarComponent.decorators = [
5898
5898
  { type: i0.Component, args: [{
5899
5899
  selector: "co-calendar",
5900
- template: "\n <div class=\"date-picker-container\" [overlay]=\"parentForOverlay\" (clickOutside)=\"clickedOutside.next()\">\n <calendar-template\n [locale]=\"locale\"\n [highlightDaysBetweenDates]=\"highlightDaysBetweenDates\"\n [selectedDate]=\"selectedDate\"\n [secondSelectedDate]=\"secondSelectedDate\"\n [secondHoveringDate]=\"secondHoveringDate\"\n (dateSelected)=\"dateSelected.next($event)\"\n (hoveringDate)=\"hoveringDate.next($event)\"\n ></calendar-template>\n </div>\n ",
5900
+ template: "\n <div class=\"date-picker-container\" [overlay]=\"parentForOverlay\" (clickOutside)=\"clickedOutside.next()\">\n <calendar-template\n [locale]=\"locale\"\n [highlightDaysBetweenDates]=\"highlightDaysBetweenDates\"\n [selectedDate]=\"selectedDate\"\n [secondSelectedDate]=\"secondSelectedDate\"\n [secondHoveringDate]=\"secondHoveringDate\"\n (dateSelected)=\"dateSelected.next($event)\"\n (hoveringDate)=\"hoveringDate.next($event)\"\n (clickedOutside)=\"clickedOutside.next()\"\n ></calendar-template>\n </div>\n ",
5901
5901
  encapsulation: i0.ViewEncapsulation.None
5902
5902
  },] }
5903
5903
  ];
@@ -5924,7 +5924,7 @@
5924
5924
  };
5925
5925
  InputDatePickerComponent.prototype.handleDateSelected = function (date) {
5926
5926
  this.setModel(date);
5927
- if (this.closeAfterDateSelection) {
5927
+ if (this.closeAfterDateSelection || !date) {
5928
5928
  this.toggleCalendar(false);
5929
5929
  }
5930
5930
  };
@@ -5940,7 +5940,7 @@
5940
5940
  selectedDate: this.model
5941
5941
  }, {
5942
5942
  dateSelected: function (event) { return _this.handleDateSelected(event); },
5943
- clickedOutside: function () { return _this.toggleCalendar(false); }
5943
+ clickedOutside: function () { return _this.toggleCalendar(false); } // Close when clicked outside
5944
5944
  });
5945
5945
  }
5946
5946
  else {
@@ -5974,7 +5974,7 @@
5974
5974
  InputDatePickerComponent.decorators = [
5975
5975
  { type: i0.Component, args: [{
5976
5976
  selector: 'co-input-date',
5977
- template: "\n <co-input-text (clickOutside)=\"toggleCalendar(false)\" overlayParent #parentForOverlay=\"overlayParent\"\n [hidden]=\"hidden\"\n [readonly]=\"readonly\"\n [(model)]=\"modelAsString\"\n [rightIcon]=\"rightIcon\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [placeholder]=\"placeholder\"\n (leftIconClick)=\"leftIconClick.emit($event)\"\n (rightIconClick)=\"toggleCalendar(true)\"\n (blur)=\"handleDateChange(modelAsString)\"\n (clearIconClick)=\"handleClearIconClicked()\"\n ></co-input-text>\n ",
5977
+ template: "\n <co-input-text (clickOutside)=\"toggleCalendar(false)\" overlayParent #parentForOverlay=\"overlayParent\"\n [hidden]=\"hidden\"\n [readonly]=\"readonly\"\n [(model)]=\"modelAsString\"\n [rightIcon]=\"rightIcon\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [placeholder]=\"placeholder\"\n (leftIconClick)=\"leftIconClick.emit($event)\"\n (rightIconClick)=\"toggleCalendar(true)\"\n (blur)=\"handleDateChange(modelAsString)\"\n (clearIconClick)=\"handleClearIconClicked()\"\n [emptyPlace]=\"true\"\n ></co-input-text>\n ",
5978
5978
  providers: [
5979
5979
  OverlayService, {
5980
5980
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, useExisting: i0.forwardRef(function () { return InputDatePickerComponent; })
@@ -6214,6 +6214,7 @@
6214
6214
  _this.showClearButton = true;
6215
6215
  _this.showPlaceholderOnFocus = true;
6216
6216
  _this.selectOnFocus = false;
6217
+ _this.emptyPlace = false;
6217
6218
  _this.noStyle = false;
6218
6219
  _this.hideArrowButtons = false;
6219
6220
  _this.leftIconClick = new i0.EventEmitter();
@@ -6225,6 +6226,7 @@
6225
6226
  _this.clearIconClick = new i0.EventEmitter();
6226
6227
  _this.isFocused = new i0.EventEmitter();
6227
6228
  _this.hasOwnLabel = true;
6229
+ _this.isFocusedOnDate = false;
6228
6230
  _this._isLeftIconMouseDown = false;
6229
6231
  _this._isRightIconMouseDown = false;
6230
6232
  _super.prototype._markAsOnPush.call(_this);
@@ -6324,14 +6326,20 @@
6324
6326
  InputTextComponent.prototype.handleInputFocus = function (event) {
6325
6327
  event.preventDefault();
6326
6328
  event.stopPropagation();
6329
+ if (this.type === 'date') {
6330
+ this.isFocusedOnDate = true; // Switch to 'date' type when focused
6331
+ }
6327
6332
  if (this.selectOnFocus) {
6328
6333
  this.input.select();
6329
6334
  }
6330
- this.isFocused.emit(this.focused);
6335
+ this.isFocused.emit(true);
6331
6336
  };
6332
6337
  InputTextComponent.prototype.handleBlur = function (event) {
6333
6338
  event.preventDefault();
6334
6339
  event.stopPropagation();
6340
+ if (this.type === 'date') {
6341
+ this.isFocusedOnDate = false;
6342
+ }
6335
6343
  this.isFocused.emit(false);
6336
6344
  };
6337
6345
  InputTextComponent.prototype.clearInput = function (event) {
@@ -6343,7 +6351,7 @@
6343
6351
  InputTextComponent.decorators = [
6344
6352
  { type: i0.Component, args: [{
6345
6353
  selector: 'co-input-text',
6346
- template: "\n <div class=\"input-text-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-icon *ngIf=\"leftIcon || leftIconData\" class=\"input-text-left-icon\" [icon]=\"leftIcon\" [iconData]=\"leftIconData\"\n (click)=\"handleLeftIconClick($event)\" (mousedown)=\"handleLeftIconMouseDown($event)\"\n (mouseup)=\"handleLeftIconMouseUp($event)\"></co-icon>\n <div *ngIf=\"leftIcon || leftIconData\" class=\"spacer left-icon\"></div>\n <div class=\"input-wrapper\">\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <input #input\n [class.input-input-hidden]=\"useContent\"\n [ngClass]=\"align\"\n [type]=\"digitsOnly ? 'number' : type\"\n [pattern]=\"type === 'date' ? pattern : undefined\"\n [ngModel]=\"model\"\n [min]=\"(type === 'number' || type === 'date') && this.min ? this.min : undefined\"\n [max]=\"(type === 'number' || type === 'date') && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (keydown)=\"digitsOnly ? excludeNonDigitChars($event) : true\"\n (keyup)=\"keyUp.emit($event)\"\n (focusin)=\"handleInputFocus($event)\"\n (focusout)=\"handleBlur($event)\"\n >\n <ng-container *ngIf=\"useContent\">\n <div class=\"input-content-wrapper\">\n <ng-content></ng-content>\n </div>\n </ng-container>\n <co-icon [class.show]=\"showClearButton && hasValue && !readonly\" class=\"input-text-clear-button\"\n [icon]=\"icons.CrossSkinny\" (click)=\"clearInput($event)\"></co-icon>\n <div class=\"required-indicator\"></div>\n </div>\n <div *ngIf=\"rightIcon || rightIconData\" class=\"spacer right-icon\"></div>\n <co-icon *ngIf=\"rightIcon || rightIconData\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"\n [iconData]=\"rightIconData\"\n (click)=\"handleRightIconClick($event)\" (mousedown)=\"handleRightIconMouseDown($event)\"\n (mouseup)=\"handleRightIconMouseUp($event)\"></co-icon>\n </div>\n <!--\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n -->\n ",
6354
+ template: "\n <div class=\"input-text-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-icon *ngIf=\"leftIcon || leftIconData\" class=\"input-text-left-icon\" [icon]=\"leftIcon\" [iconData]=\"leftIconData\"\n (click)=\"handleLeftIconClick($event)\" (mousedown)=\"handleLeftIconMouseDown($event)\"\n (mouseup)=\"handleLeftIconMouseUp($event)\"></co-icon>\n <div *ngIf=\"leftIcon || leftIconData\" class=\"spacer left-icon\"></div>\n <div class=\"input-wrapper\">\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <input #input\n [class.input-input-hidden]=\"useContent\"\n [ngClass]=\"align\"\n [type]=\"(isFocusedOnDate || (hasValue && emptyPlace)) ? 'date' : (digitsOnly ? 'number' : (type === 'date' ? 'text' : type))\"\n [placeholder]=\"type === 'date' && !isFocusedOnDate ? '' : ''\"\n [pattern]=\"type === 'date' ? pattern : undefined\"\n [ngModel]=\"model\"\n [min]=\"(type === 'number' || type === 'date') && this.min ? this.min : undefined\"\n [max]=\"(type === 'number' || type === 'date') && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (keydown)=\"digitsOnly ? excludeNonDigitChars($event) : true\"\n (keyup)=\"keyUp.emit($event)\"\n (focusin)=\"handleInputFocus($event)\"\n (focusout)=\"handleBlur($event)\"\n >\n <ng-container *ngIf=\"useContent\">\n <div class=\"input-content-wrapper\">\n <ng-content></ng-content>\n </div>\n </ng-container>\n <co-icon [class.show]=\"showClearButton && hasValue && !readonly\" class=\"input-text-clear-button\"\n [icon]=\"icons.CrossSkinny\" (click)=\"clearInput($event)\"></co-icon>\n <div class=\"required-indicator\"></div>\n </div>\n <div *ngIf=\"rightIcon || rightIconData\" class=\"spacer right-icon\"></div>\n <co-icon *ngIf=\"rightIcon || rightIconData\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"\n [iconData]=\"rightIconData\"\n (click)=\"handleRightIconClick($event)\" (mousedown)=\"handleRightIconMouseDown($event)\"\n (mouseup)=\"handleRightIconMouseUp($event)\"></co-icon>\n </div>\n <!--\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n -->\n ",
6347
6355
  providers: [
6348
6356
  OverlayService, {
6349
6357
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
@@ -6383,6 +6391,7 @@
6383
6391
  leftIconData: [{ type: i0.Input }],
6384
6392
  rightIconData: [{ type: i0.Input }],
6385
6393
  selectOnFocus: [{ type: i0.Input }],
6394
+ emptyPlace: [{ type: i0.Input }],
6386
6395
  noStyle: [{ type: i0.HostBinding, args: ['class.no-style',] }, { type: i0.Input }],
6387
6396
  hideArrowButtons: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.hide-arrows',] }],
6388
6397
  isDate: [{ type: i0.HostBinding, args: ["class.isDate",] }],
@@ -6849,8 +6858,13 @@
6849
6858
  this.weekNumbers = [];
6850
6859
  this.locale = "nl-NL";
6851
6860
  this.highlightDaysBetweenDates = false;
6861
+ this.showButtons = true;
6862
+ this.doubleCalendar = false;
6852
6863
  this.dateSelected = new i0.EventEmitter();
6864
+ this.secondDateSelected = new i0.EventEmitter();
6853
6865
  this.hoveringDate = new i0.EventEmitter();
6866
+ this.clickedOutside = new i0.EventEmitter();
6867
+ this.clearDates = new i0.EventEmitter();
6854
6868
  this.showCalendarBody = true;
6855
6869
  this.showMonthSelection = false;
6856
6870
  this.showYearSelection = false;
@@ -6865,6 +6879,7 @@
6865
6879
  this.daysInMonth = [];
6866
6880
  this.daysUnixTimestamps = [];
6867
6881
  this.daysToHighlight = [];
6882
+ this._initialSelectedDate = null;
6868
6883
  }
6869
6884
  Object.defineProperty(CalendarTemplateComponent.prototype, "selectedDate", {
6870
6885
  get: function () {
@@ -6872,6 +6887,10 @@
6872
6887
  },
6873
6888
  set: function (date) {
6874
6889
  this._selectedDate = !!date ? new Date(date.getFullYear(), date.getMonth(), date.getDate()) : date;
6890
+ // Store the initial selected date when the calendar is first opened
6891
+ if (this._initialSelectedDate === null) {
6892
+ this._initialSelectedDate = this._selectedDate;
6893
+ }
6875
6894
  if (this.secondSelectedDate && date && this.secondSelectedDate.getTime() < this.selectedDate.getTime() && this.temporarySelectedSecondaryDate) {
6876
6895
  this.daysToHighlight = [];
6877
6896
  }
@@ -7016,7 +7035,9 @@
7016
7035
  if (day) {
7017
7036
  this.selectedDate = day;
7018
7037
  this._fillDatesBetweenSelected();
7019
- this.dateSelected.emit(new Date(this.selectedDate));
7038
+ if (this.doubleCalendar) {
7039
+ this.dateSelected.emit(new Date(this.selectedDate));
7040
+ }
7020
7041
  }
7021
7042
  };
7022
7043
  CalendarTemplateComponent.prototype.selectMonth = function (month) {
@@ -7045,7 +7066,7 @@
7045
7066
  for (var i = 1; i <= 7; i++) {
7046
7067
  var date = new Date(2018, 0, i);
7047
7068
  var weekdayName = date.toLocaleString(this.locale, { weekday: 'short' });
7048
- this.dayNames.push(this._capitalizeFirstLetter(weekdayName));
7069
+ this.dayNames.push(this._capitalizeFirstLetter(weekdayName.charAt(0)));
7049
7070
  }
7050
7071
  };
7051
7072
  CalendarTemplateComponent.prototype.handleMouseOverDay = function (day) {
@@ -7120,12 +7141,37 @@
7120
7141
  var weekNumber = Math.ceil(((d.valueOf() - yearStart.valueOf()) / 86400000 + 1) / 7);
7121
7142
  return weekNumber;
7122
7143
  };
7144
+ CalendarTemplateComponent.prototype.setAndClose = function () {
7145
+ if (this.selectedDate) {
7146
+ this.dateSelected.emit(this.selectedDate);
7147
+ this.secondDateSelected.emit(this.secondSelectedDate); // Emit the selected date
7148
+ this.closePopup(); // Trigger popup close
7149
+ }
7150
+ };
7151
+ CalendarTemplateComponent.prototype.clearDate = function () {
7152
+ if (this.selectedDate) {
7153
+ this.selectedDate = null;
7154
+ this.dateSelected.emit(null);
7155
+ }
7156
+ if (this.secondSelectedDate) {
7157
+ this.secondSelectedDate = null;
7158
+ this.secondDateSelected.emit(null);
7159
+ }
7160
+ this.clearDates.emit();
7161
+ };
7162
+ CalendarTemplateComponent.prototype.closeDate = function () {
7163
+ this.selectedDate = this._initialSelectedDate;
7164
+ this.closePopup(); // Trigger popup close without making changes
7165
+ };
7166
+ CalendarTemplateComponent.prototype.closePopup = function () {
7167
+ this.clickedOutside.emit(); // Emit the `clickedOutside` event to notify the parent
7168
+ };
7123
7169
  return CalendarTemplateComponent;
7124
7170
  }());
7125
7171
  CalendarTemplateComponent.decorators = [
7126
7172
  { type: i0.Component, args: [{
7127
7173
  selector: "calendar-template",
7128
- template: "\n <div class=\"calendar\">\n <div class=\"calendar-header\" *ngIf=\"monthSelection || yearSelection\">\n <co-icon class=\"calendar-change-month-button\" [icon]=\"icons.ArrowPointLeft\" (click)=\"prevMonth()\"></co-icon>\n\n <div class=\"calendar-header-title-wrapper\">\n <span class=\"calendar-header-title\" [textContent]=\"monthSelection ? monthHeader : yearHeader\"\n (click)=\"monthSelection ? openMonthSelection() : openYearSelection()\"\n ></span>\n </div>\n\n <co-icon class=\"calendar-change-month-button\" [icon]=\"icons.ArrowPointRight\" (click)=\"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>\n ",
7174
+ 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)=\"prevMonth()\"></co-icon>\n\n <div class=\"calendar-header-title-wrapper\">\n <span class=\"calendar-header-title\" [textContent]=\"monthSelection ? monthHeader : yearHeader\"\n (click)=\"monthSelection ? openMonthSelection() : openYearSelection()\"\n ></span>\n </div>\n\n <co-icon class=\"calendar-change-month-button\" [icon]=\"icons.ArrowPointRight\" (click)=\"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\" (click)=\"setAndClose()\">Instellen</span>\n <span class=\"clear-date-button\" (click)=\"clearDate()\">Wissen</span>\n <span class=\"cancel-button\" (click)=\"closeDate()\">Annuleren</span>\n </div>\n </div>\n ",
7129
7175
  encapsulation: i0.ViewEncapsulation.None
7130
7176
  },] }
7131
7177
  ];
@@ -7133,11 +7179,16 @@
7133
7179
  showWeekNumbers: [{ type: i0.Input }],
7134
7180
  locale: [{ type: i0.Input }],
7135
7181
  highlightDaysBetweenDates: [{ type: i0.Input }],
7182
+ showButtons: [{ type: i0.Input }],
7183
+ doubleCalendar: [{ type: i0.Input }],
7136
7184
  selectedDate: [{ type: i0.Input }],
7137
7185
  secondSelectedDate: [{ type: i0.Input }],
7138
7186
  secondHoveringDate: [{ type: i0.Input }],
7139
7187
  dateSelected: [{ type: i0.Output }],
7188
+ secondDateSelected: [{ type: i0.Output }],
7140
7189
  hoveringDate: [{ type: i0.Output }],
7190
+ clickedOutside: [{ type: i0.Output }],
7191
+ clearDates: [{ type: i0.Output }],
7141
7192
  showClass: [{ type: i0.HostBinding, args: ["class.calendar-template",] }]
7142
7193
  };
7143
7194
 
@@ -7152,7 +7203,8 @@
7152
7203
  common.CommonModule,
7153
7204
  IconModule,
7154
7205
  OverlayModule,
7155
- ClickoutsideModule
7206
+ ClickoutsideModule,
7207
+ CoreComponentsTranslationModule
7156
7208
  ],
7157
7209
  declarations: [
7158
7210
  CalendarComponent,
@@ -7191,7 +7243,7 @@
7191
7243
  __extends(DoubleCalendarComponent, _super);
7192
7244
  function DoubleCalendarComponent() {
7193
7245
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
7194
- _this.selectedDates = [undefined, undefined];
7246
+ _this.selectedDates = [null, null]; // Initialize with valid array elements
7195
7247
  _this.datesSelected = new i0.EventEmitter();
7196
7248
  _this.secondDateSelected = new i0.EventEmitter();
7197
7249
  _this.clickedOutside = new i0.EventEmitter();
@@ -7201,26 +7253,32 @@
7201
7253
  return true;
7202
7254
  };
7203
7255
  DoubleCalendarComponent.prototype.ngOnInit = function () {
7256
+ // Ensure `selectedDates` always has two elements
7257
+ this.selectedDates = this.selectedDates || [null, null];
7204
7258
  this.selectedFirstDate = this.selectedDates[0];
7205
7259
  this.selectedSecondDate = this.selectedDates[1];
7206
7260
  };
7207
7261
  DoubleCalendarComponent.prototype.handleFirstDateSelected = function (date) {
7208
7262
  this.selectedFirstDate = date;
7209
7263
  this.selectedDates[0] = date;
7210
- if (this.selectedSecondDate && this.selectedFirstDate.getTime() > this.selectedSecondDate.getTime()) {
7211
- this.selectedSecondDate = null;
7264
+ if (this.selectedSecondDate && this.selectedFirstDate) {
7265
+ if (this.selectedFirstDate.getTime() > this.selectedSecondDate.getTime()) {
7266
+ this.selectedSecondDate = null;
7267
+ }
7212
7268
  }
7213
7269
  this.outputRangeIfValid();
7214
7270
  };
7215
7271
  DoubleCalendarComponent.prototype.handleSecondDateSelected = function (date) {
7216
7272
  this.selectedSecondDate = date;
7217
7273
  this.selectedDates[1] = date;
7218
- if (this.selectedFirstDate && this.selectedSecondDate.getTime() < this.selectedFirstDate.getTime()) {
7219
- this.selectedFirstDate = null;
7220
- this.selectedSecondDate = null;
7221
- this.secondHoveringDate = null;
7274
+ if (this.selectedFirstDate && this.selectedSecondDate) {
7275
+ if (this.selectedSecondDate.getTime() < this.selectedFirstDate.getTime()) {
7276
+ this.selectedFirstDate = null;
7277
+ this.selectedSecondDate = null;
7278
+ this.secondHoveringDate = null;
7279
+ }
7222
7280
  }
7223
- if (this.selectedSecondDate && this.selectedDates[0] instanceof Date) {
7281
+ if (this.selectedSecondDate && this.selectedFirstDate) {
7224
7282
  this.outputRangeIfValid();
7225
7283
  this.secondDateSelected.next();
7226
7284
  }
@@ -7233,12 +7291,19 @@
7233
7291
  DoubleCalendarComponent.prototype.handleSecondHoveringDate = function (day) {
7234
7292
  this.secondHoveringDate = day;
7235
7293
  };
7294
+ DoubleCalendarComponent.prototype.clearAllDates = function () {
7295
+ this.selectedFirstDate = null;
7296
+ this.selectedSecondDate = null;
7297
+ this.selectedDates = [null, null];
7298
+ // Emit updated state to parent
7299
+ this.datesSelected.emit(this.selectedDates);
7300
+ };
7236
7301
  return DoubleCalendarComponent;
7237
7302
  }(BaseInputDatePickerDirective));
7238
7303
  DoubleCalendarComponent.decorators = [
7239
7304
  { type: i0.Component, args: [{
7240
7305
  selector: "co-double-calendar",
7241
- template: "\n <div class=\"dual-calendar-wrapper\" [overlay]=\"parentForOverlay\" (clickOutside)=\"clickedOutside.next()\">\n <calendar-template\n [selectedDate]=\"selectedFirstDate\"\n [secondSelectedDate]=\"selectedSecondDate\"\n [secondHoveringDate]=\"secondHoveringDate\"\n [highlightDaysBetweenDates]=\"true\"\n (dateSelected)=\"handleFirstDateSelected($event)\"\n ></calendar-template>\n <calendar-template\n [selectedDate]=\"selectedSecondDate\"\n [secondSelectedDate]=\"selectedFirstDate\"\n [highlightDaysBetweenDates]=\"true\"\n (hoveringDate)=\"handleSecondHoveringDate($event)\"\n (dateSelected)=\"handleSecondDateSelected($event)\"\n ></calendar-template>\n </div>\n ",
7306
+ template: "\n <div class=\"dual-calendar-wrapper\" [overlay]=\"parentForOverlay\" (clickOutside)=\"clickedOutside.next()\">\n <calendar-template\n [selectedDate]=\"selectedFirstDate\"\n [secondSelectedDate]=\"selectedSecondDate\"\n [secondHoveringDate]=\"secondHoveringDate\"\n [highlightDaysBetweenDates]=\"true\"\n (dateSelected)=\"handleFirstDateSelected($event)\"\n [showButtons]=\"false\"\n (clearDates)=\"clearAllDates()\"\n [doubleCalendar]=\"true\"\n ></calendar-template>\n <calendar-template\n [selectedDate]=\"selectedSecondDate\"\n [secondSelectedDate]=\"selectedFirstDate\"\n [highlightDaysBetweenDates]=\"true\"\n (hoveringDate)=\"handleSecondHoveringDate($event)\"\n (dateSelected)=\"handleSecondDateSelected($event)\"\n (clickedOutside)=\"clickedOutside.next()\"\n [showButtons]=\"true\"\n [doubleCalendar]=\"true\"\n (clearDates)=\"clearAllDates()\"\n ></calendar-template>\n </div>\n ",
7242
7307
  encapsulation: i0.ViewEncapsulation.None
7243
7308
  },] }
7244
7309
  ];
@@ -7362,7 +7427,7 @@
7362
7427
  InputDateRangePickerComponent.decorators = [
7363
7428
  { type: i0.Component, args: [{
7364
7429
  selector: 'co-input-date-range',
7365
- template: "\n <div class=\"inputs-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-input-text #firstInput class=\"no-focus-line custom-height\"\n [(model)]=\"firstDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [placeholder]=\"placeholder\"\n (blur)=\"handleFirstDateChanged(firstDateAsString)\"\n (clearIconClick)=\"clearDate(0)\"\n (click)=\"handleFirstInputClick($event)\"\n ></co-input-text>\n <co-input-text #secondInput class=\"no-focus-line custom-height\"\n [(model)]= \"secondDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [rightIcon]=\"rightIcon\"\n (rightIconClick)=\"toggleCalendar()\"\n (blur)=\"handleSecondDateChanged(secondDateAsString)\"\n (clearIconClick)=\"clearDate(1)\"\n (click)=\"handleSecondInputClick($event)\"\n ></co-input-text>\n </div>\n ",
7430
+ template: "\n <div class=\"inputs-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-input-text #firstInput class=\"no-focus-line custom-height\"\n [(model)]=\"firstDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [placeholder]=\"placeholder\"\n (blur)=\"handleFirstDateChanged(firstDateAsString)\"\n (clearIconClick)=\"clearDate(0)\"\n (click)=\"handleFirstInputClick($event)\"\n [emptyPlace]=\"true\"\n ></co-input-text>\n <co-input-text #secondInput class=\"no-focus-line custom-height\"\n [(model)]= \"secondDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [rightIcon]=\"rightIcon\"\n (rightIconClick)=\"toggleCalendar()\"\n (blur)=\"handleSecondDateChanged(secondDateAsString)\"\n (clearIconClick)=\"clearDate(1)\"\n (click)=\"handleSecondInputClick($event)\"\n [emptyPlace]=\"true\"\n ></co-input-text>\n </div>\n ",
7366
7431
  providers: [
7367
7432
  OverlayService,
7368
7433
  {