@colijnit/corecomponents_v12 256.1.6 → 256.1.8
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.
- package/bundles/colijnit-corecomponents_v12.umd.js +117 -24
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/base-input-date-picker/base-input-date-picker.directive.js +2 -2
- package/esm2015/lib/components/calendar/calendar-template.component.js +59 -3
- package/esm2015/lib/components/calendar/calendar.component.js +2 -1
- package/esm2015/lib/components/calendar/calendar.module.js +4 -2
- package/esm2015/lib/components/double-calendar/double-calendar.component.js +29 -9
- package/esm2015/lib/components/hour-scheduling-expandable/hour-scheduling-expandable.component.js +17 -3
- package/esm2015/lib/components/input-date-picker/input-date-picker.component.js +4 -3
- package/esm2015/lib/components/input-date-range-picker/input-date-range-picker.component.js +3 -1
- package/esm2015/lib/components/input-text/input-text.component.js +13 -3
- package/esm2015/lib/components/tooltip/tooltip.component.js +22 -4
- package/fesm2015/colijnit-corecomponents_v12.js +143 -20
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/calendar/calendar-template.component.d.ts +10 -0
- package/lib/components/calendar/style/_layout.scss +57 -4
- package/lib/components/calendar/style/_material-definition.scss +10 -10
- package/lib/components/double-calendar/double-calendar.component.d.ts +1 -0
- package/lib/components/hour-scheduling-expandable/hour-scheduling-expandable.component.d.ts +1 -0
- package/lib/components/hour-scheduling-expandable/style/_layout.scss +1 -1
- package/lib/components/input-text/input-text.component.d.ts +2 -0
- package/lib/components/tooltip/tooltip.component.d.ts +8 -3
- package/lib/style/_input.mixins.scss +7 -1
- package/lib/style/_variables.scss +1 -0
- package/package.json +1 -1
|
@@ -5333,7 +5333,7 @@ class BaseInputDatePickerDirective extends BaseInputComponent {
|
|
|
5333
5333
|
this.rightIcon = CoreComponentsIcon.CalendarDayRegular;
|
|
5334
5334
|
this.locale = 'en-EN';
|
|
5335
5335
|
this.leftIconClick = new EventEmitter();
|
|
5336
|
-
this.closeAfterDateSelection =
|
|
5336
|
+
this.closeAfterDateSelection = false;
|
|
5337
5337
|
}
|
|
5338
5338
|
}
|
|
5339
5339
|
BaseInputDatePickerDirective.decorators = [
|
|
@@ -5374,6 +5374,7 @@ CalendarComponent.decorators = [
|
|
|
5374
5374
|
[secondHoveringDate]="secondHoveringDate"
|
|
5375
5375
|
(dateSelected)="dateSelected.next($event)"
|
|
5376
5376
|
(hoveringDate)="hoveringDate.next($event)"
|
|
5377
|
+
(clickedOutside)="clickedOutside.next()"
|
|
5377
5378
|
></calendar-template>
|
|
5378
5379
|
</div>
|
|
5379
5380
|
`,
|
|
@@ -5399,7 +5400,7 @@ class InputDatePickerComponent extends BaseInputDatePickerDirective {
|
|
|
5399
5400
|
}
|
|
5400
5401
|
handleDateSelected(date) {
|
|
5401
5402
|
this.setModel(date);
|
|
5402
|
-
if (this.closeAfterDateSelection) {
|
|
5403
|
+
if (this.closeAfterDateSelection || !date) {
|
|
5403
5404
|
this.toggleCalendar(false);
|
|
5404
5405
|
}
|
|
5405
5406
|
}
|
|
@@ -5414,7 +5415,7 @@ class InputDatePickerComponent extends BaseInputDatePickerDirective {
|
|
|
5414
5415
|
selectedDate: this.model
|
|
5415
5416
|
}, {
|
|
5416
5417
|
dateSelected: (event) => this.handleDateSelected(event),
|
|
5417
|
-
clickedOutside: () => this.toggleCalendar(false)
|
|
5418
|
+
clickedOutside: () => this.toggleCalendar(false) // Close when clicked outside
|
|
5418
5419
|
});
|
|
5419
5420
|
}
|
|
5420
5421
|
else {
|
|
@@ -5462,6 +5463,7 @@ InputDatePickerComponent.decorators = [
|
|
|
5462
5463
|
(rightIconClick)="toggleCalendar(true)"
|
|
5463
5464
|
(blur)="handleDateChange(modelAsString)"
|
|
5464
5465
|
(clearIconClick)="handleClearIconClicked()"
|
|
5466
|
+
[emptyPlace]="true"
|
|
5465
5467
|
></co-input-text>
|
|
5466
5468
|
`,
|
|
5467
5469
|
providers: [
|
|
@@ -5691,6 +5693,7 @@ class InputTextComponent extends BaseInputComponent {
|
|
|
5691
5693
|
this.showClearButton = true;
|
|
5692
5694
|
this.showPlaceholderOnFocus = true;
|
|
5693
5695
|
this.selectOnFocus = false;
|
|
5696
|
+
this.emptyPlace = false;
|
|
5694
5697
|
this.noStyle = false;
|
|
5695
5698
|
this.hideArrowButtons = false;
|
|
5696
5699
|
this.leftIconClick = new EventEmitter();
|
|
@@ -5702,6 +5705,7 @@ class InputTextComponent extends BaseInputComponent {
|
|
|
5702
5705
|
this.clearIconClick = new EventEmitter();
|
|
5703
5706
|
this.isFocused = new EventEmitter();
|
|
5704
5707
|
this.hasOwnLabel = true;
|
|
5708
|
+
this.isFocusedOnDate = false;
|
|
5705
5709
|
this._isLeftIconMouseDown = false;
|
|
5706
5710
|
this._isRightIconMouseDown = false;
|
|
5707
5711
|
super._markAsOnPush();
|
|
@@ -5784,14 +5788,20 @@ class InputTextComponent extends BaseInputComponent {
|
|
|
5784
5788
|
handleInputFocus(event) {
|
|
5785
5789
|
event.preventDefault();
|
|
5786
5790
|
event.stopPropagation();
|
|
5791
|
+
if (this.type === 'date') {
|
|
5792
|
+
this.isFocusedOnDate = true; // Switch to 'date' type when focused
|
|
5793
|
+
}
|
|
5787
5794
|
if (this.selectOnFocus) {
|
|
5788
5795
|
this.input.select();
|
|
5789
5796
|
}
|
|
5790
|
-
this.isFocused.emit(
|
|
5797
|
+
this.isFocused.emit(true);
|
|
5791
5798
|
}
|
|
5792
5799
|
handleBlur(event) {
|
|
5793
5800
|
event.preventDefault();
|
|
5794
5801
|
event.stopPropagation();
|
|
5802
|
+
if (this.type === 'date') {
|
|
5803
|
+
this.isFocusedOnDate = false;
|
|
5804
|
+
}
|
|
5795
5805
|
this.isFocused.emit(false);
|
|
5796
5806
|
}
|
|
5797
5807
|
clearInput(event) {
|
|
@@ -5814,7 +5824,8 @@ InputTextComponent.decorators = [
|
|
|
5814
5824
|
<input #input
|
|
5815
5825
|
[class.input-input-hidden]="useContent"
|
|
5816
5826
|
[ngClass]="align"
|
|
5817
|
-
[type]="digitsOnly ? 'number' : type"
|
|
5827
|
+
[type]="(isFocusedOnDate || (hasValue && emptyPlace)) ? 'date' : (digitsOnly ? 'number' : (type === 'date' ? 'text' : type))"
|
|
5828
|
+
[placeholder]="type === 'date' && !isFocusedOnDate ? '' : ''"
|
|
5818
5829
|
[pattern]="type === 'date' ? pattern : undefined"
|
|
5819
5830
|
[ngModel]="model"
|
|
5820
5831
|
[min]="(type === 'number' || type === 'date') && this.min ? this.min : undefined"
|
|
@@ -5891,6 +5902,7 @@ InputTextComponent.propDecorators = {
|
|
|
5891
5902
|
leftIconData: [{ type: Input }],
|
|
5892
5903
|
rightIconData: [{ type: Input }],
|
|
5893
5904
|
selectOnFocus: [{ type: Input }],
|
|
5905
|
+
emptyPlace: [{ type: Input }],
|
|
5894
5906
|
noStyle: [{ type: HostBinding, args: ['class.no-style',] }, { type: Input }],
|
|
5895
5907
|
hideArrowButtons: [{ type: Input }, { type: HostBinding, args: ['class.hide-arrows',] }],
|
|
5896
5908
|
isDate: [{ type: HostBinding, args: ["class.isDate",] }],
|
|
@@ -6308,8 +6320,13 @@ class CalendarTemplateComponent {
|
|
|
6308
6320
|
this.weekNumbers = [];
|
|
6309
6321
|
this.locale = "nl-NL";
|
|
6310
6322
|
this.highlightDaysBetweenDates = false;
|
|
6323
|
+
this.showButtons = true;
|
|
6324
|
+
this.doubleCalendar = false;
|
|
6311
6325
|
this.dateSelected = new EventEmitter();
|
|
6326
|
+
this.secondDateSelected = new EventEmitter();
|
|
6312
6327
|
this.hoveringDate = new EventEmitter();
|
|
6328
|
+
this.clickedOutside = new EventEmitter();
|
|
6329
|
+
this.clearDates = new EventEmitter();
|
|
6313
6330
|
this.showCalendarBody = true;
|
|
6314
6331
|
this.showMonthSelection = false;
|
|
6315
6332
|
this.showYearSelection = false;
|
|
@@ -6324,9 +6341,14 @@ class CalendarTemplateComponent {
|
|
|
6324
6341
|
this.daysInMonth = [];
|
|
6325
6342
|
this.daysUnixTimestamps = [];
|
|
6326
6343
|
this.daysToHighlight = [];
|
|
6344
|
+
this._initialSelectedDate = null;
|
|
6327
6345
|
}
|
|
6328
6346
|
set selectedDate(date) {
|
|
6329
6347
|
this._selectedDate = !!date ? new Date(date.getFullYear(), date.getMonth(), date.getDate()) : date;
|
|
6348
|
+
// Store the initial selected date when the calendar is first opened
|
|
6349
|
+
if (this._initialSelectedDate === null) {
|
|
6350
|
+
this._initialSelectedDate = this._selectedDate;
|
|
6351
|
+
}
|
|
6330
6352
|
if (this.secondSelectedDate && date && this.secondSelectedDate.getTime() < this.selectedDate.getTime() && this.temporarySelectedSecondaryDate) {
|
|
6331
6353
|
this.daysToHighlight = [];
|
|
6332
6354
|
}
|
|
@@ -6463,7 +6485,9 @@ class CalendarTemplateComponent {
|
|
|
6463
6485
|
if (day) {
|
|
6464
6486
|
this.selectedDate = day;
|
|
6465
6487
|
this._fillDatesBetweenSelected();
|
|
6466
|
-
|
|
6488
|
+
if (this.doubleCalendar) {
|
|
6489
|
+
this.dateSelected.emit(new Date(this.selectedDate));
|
|
6490
|
+
}
|
|
6467
6491
|
}
|
|
6468
6492
|
}
|
|
6469
6493
|
selectMonth(month) {
|
|
@@ -6492,7 +6516,7 @@ class CalendarTemplateComponent {
|
|
|
6492
6516
|
for (let i = 1; i <= 7; i++) {
|
|
6493
6517
|
const date = new Date(2018, 0, i);
|
|
6494
6518
|
const weekdayName = date.toLocaleString(this.locale, { weekday: 'short' });
|
|
6495
|
-
this.dayNames.push(this._capitalizeFirstLetter(weekdayName));
|
|
6519
|
+
this.dayNames.push(this._capitalizeFirstLetter(weekdayName.charAt(0)));
|
|
6496
6520
|
}
|
|
6497
6521
|
}
|
|
6498
6522
|
handleMouseOverDay(day) {
|
|
@@ -6563,12 +6587,46 @@ class CalendarTemplateComponent {
|
|
|
6563
6587
|
const weekNumber = Math.ceil(((d.valueOf() - yearStart.valueOf()) / 86400000 + 1) / 7);
|
|
6564
6588
|
return weekNumber;
|
|
6565
6589
|
}
|
|
6590
|
+
setAndClose() {
|
|
6591
|
+
if (this.selectedDate) {
|
|
6592
|
+
this.dateSelected.emit(this.selectedDate);
|
|
6593
|
+
this.secondDateSelected.emit(this.secondSelectedDate); // Emit the selected date
|
|
6594
|
+
this.closePopup(); // Trigger popup close
|
|
6595
|
+
}
|
|
6596
|
+
}
|
|
6597
|
+
clearDate() {
|
|
6598
|
+
if (this.selectedDate) {
|
|
6599
|
+
this.selectedDate = null;
|
|
6600
|
+
this.dateSelected.emit(null);
|
|
6601
|
+
}
|
|
6602
|
+
if (this.secondSelectedDate) {
|
|
6603
|
+
this.secondSelectedDate = null;
|
|
6604
|
+
this.secondDateSelected.emit(null);
|
|
6605
|
+
}
|
|
6606
|
+
this.clearDates.emit();
|
|
6607
|
+
}
|
|
6608
|
+
closeDate() {
|
|
6609
|
+
this.selectedDate = this._initialSelectedDate;
|
|
6610
|
+
this.closePopup(); // Trigger popup close without making changes
|
|
6611
|
+
}
|
|
6612
|
+
closePopup() {
|
|
6613
|
+
this.clickedOutside.emit(); // Emit the `clickedOutside` event to notify the parent
|
|
6614
|
+
}
|
|
6566
6615
|
}
|
|
6567
6616
|
CalendarTemplateComponent.decorators = [
|
|
6568
6617
|
{ type: Component, args: [{
|
|
6569
6618
|
selector: "calendar-template",
|
|
6570
6619
|
template: `
|
|
6571
6620
|
<div class="calendar">
|
|
6621
|
+
<div class="selected-date-display">
|
|
6622
|
+
<span *ngIf="selectedDate" class="selected-date-year">
|
|
6623
|
+
{{ selectedDate.getFullYear() }}
|
|
6624
|
+
</span>
|
|
6625
|
+
<span *ngIf="selectedDate" class="selected-date-day">
|
|
6626
|
+
{{ selectedDate | date: 'EEE d MMM' }}
|
|
6627
|
+
</span>
|
|
6628
|
+
<span *ngIf="!selectedDate" class="no-date-selected" [textContent]="'Selecteer datum'"></span>
|
|
6629
|
+
</div>
|
|
6572
6630
|
<div class="calendar-header" *ngIf="monthSelection || yearSelection">
|
|
6573
6631
|
<co-icon class="calendar-change-month-button" [icon]="icons.ArrowPointLeft" (click)="prevMonth()"></co-icon>
|
|
6574
6632
|
|
|
@@ -6626,6 +6684,11 @@ CalendarTemplateComponent.decorators = [
|
|
|
6626
6684
|
</div>
|
|
6627
6685
|
</div>
|
|
6628
6686
|
</div>
|
|
6687
|
+
<div class="calendar-action-buttons" *ngIf="showButtons">
|
|
6688
|
+
<span class="set-and-close-button" (click)="setAndClose()">Instellen</span>
|
|
6689
|
+
<span class="clear-date-button" (click)="clearDate()">Wissen</span>
|
|
6690
|
+
<span class="cancel-button" (click)="closeDate()">Annuleren</span>
|
|
6691
|
+
</div>
|
|
6629
6692
|
</div>
|
|
6630
6693
|
`,
|
|
6631
6694
|
encapsulation: ViewEncapsulation.None
|
|
@@ -6635,11 +6698,16 @@ CalendarTemplateComponent.propDecorators = {
|
|
|
6635
6698
|
showWeekNumbers: [{ type: Input }],
|
|
6636
6699
|
locale: [{ type: Input }],
|
|
6637
6700
|
highlightDaysBetweenDates: [{ type: Input }],
|
|
6701
|
+
showButtons: [{ type: Input }],
|
|
6702
|
+
doubleCalendar: [{ type: Input }],
|
|
6638
6703
|
selectedDate: [{ type: Input }],
|
|
6639
6704
|
secondSelectedDate: [{ type: Input }],
|
|
6640
6705
|
secondHoveringDate: [{ type: Input }],
|
|
6641
6706
|
dateSelected: [{ type: Output }],
|
|
6707
|
+
secondDateSelected: [{ type: Output }],
|
|
6642
6708
|
hoveringDate: [{ type: Output }],
|
|
6709
|
+
clickedOutside: [{ type: Output }],
|
|
6710
|
+
clearDates: [{ type: Output }],
|
|
6643
6711
|
showClass: [{ type: HostBinding, args: ["class.calendar-template",] }]
|
|
6644
6712
|
};
|
|
6645
6713
|
|
|
@@ -6651,7 +6719,8 @@ CalendarModule.decorators = [
|
|
|
6651
6719
|
CommonModule,
|
|
6652
6720
|
IconModule,
|
|
6653
6721
|
OverlayModule,
|
|
6654
|
-
ClickoutsideModule
|
|
6722
|
+
ClickoutsideModule,
|
|
6723
|
+
CoreComponentsTranslationModule
|
|
6655
6724
|
],
|
|
6656
6725
|
declarations: [
|
|
6657
6726
|
CalendarComponent,
|
|
@@ -6686,7 +6755,7 @@ InputDatePickerModule.decorators = [
|
|
|
6686
6755
|
class DoubleCalendarComponent extends BaseInputDatePickerDirective {
|
|
6687
6756
|
constructor() {
|
|
6688
6757
|
super(...arguments);
|
|
6689
|
-
this.selectedDates = [
|
|
6758
|
+
this.selectedDates = [null, null]; // Initialize with valid array elements
|
|
6690
6759
|
this.datesSelected = new EventEmitter();
|
|
6691
6760
|
this.secondDateSelected = new EventEmitter();
|
|
6692
6761
|
this.clickedOutside = new EventEmitter();
|
|
@@ -6695,26 +6764,32 @@ class DoubleCalendarComponent extends BaseInputDatePickerDirective {
|
|
|
6695
6764
|
return true;
|
|
6696
6765
|
}
|
|
6697
6766
|
ngOnInit() {
|
|
6767
|
+
// Ensure `selectedDates` always has two elements
|
|
6768
|
+
this.selectedDates = this.selectedDates || [null, null];
|
|
6698
6769
|
this.selectedFirstDate = this.selectedDates[0];
|
|
6699
6770
|
this.selectedSecondDate = this.selectedDates[1];
|
|
6700
6771
|
}
|
|
6701
6772
|
handleFirstDateSelected(date) {
|
|
6702
6773
|
this.selectedFirstDate = date;
|
|
6703
6774
|
this.selectedDates[0] = date;
|
|
6704
|
-
if (this.selectedSecondDate && this.selectedFirstDate
|
|
6705
|
-
this.selectedSecondDate
|
|
6775
|
+
if (this.selectedSecondDate && this.selectedFirstDate) {
|
|
6776
|
+
if (this.selectedFirstDate.getTime() > this.selectedSecondDate.getTime()) {
|
|
6777
|
+
this.selectedSecondDate = null;
|
|
6778
|
+
}
|
|
6706
6779
|
}
|
|
6707
6780
|
this.outputRangeIfValid();
|
|
6708
6781
|
}
|
|
6709
6782
|
handleSecondDateSelected(date) {
|
|
6710
6783
|
this.selectedSecondDate = date;
|
|
6711
6784
|
this.selectedDates[1] = date;
|
|
6712
|
-
if (this.selectedFirstDate && this.selectedSecondDate
|
|
6713
|
-
this.selectedFirstDate
|
|
6714
|
-
|
|
6715
|
-
|
|
6785
|
+
if (this.selectedFirstDate && this.selectedSecondDate) {
|
|
6786
|
+
if (this.selectedSecondDate.getTime() < this.selectedFirstDate.getTime()) {
|
|
6787
|
+
this.selectedFirstDate = null;
|
|
6788
|
+
this.selectedSecondDate = null;
|
|
6789
|
+
this.secondHoveringDate = null;
|
|
6790
|
+
}
|
|
6716
6791
|
}
|
|
6717
|
-
if (this.selectedSecondDate && this.
|
|
6792
|
+
if (this.selectedSecondDate && this.selectedFirstDate) {
|
|
6718
6793
|
this.outputRangeIfValid();
|
|
6719
6794
|
this.secondDateSelected.next();
|
|
6720
6795
|
}
|
|
@@ -6727,6 +6802,13 @@ class DoubleCalendarComponent extends BaseInputDatePickerDirective {
|
|
|
6727
6802
|
handleSecondHoveringDate(day) {
|
|
6728
6803
|
this.secondHoveringDate = day;
|
|
6729
6804
|
}
|
|
6805
|
+
clearAllDates() {
|
|
6806
|
+
this.selectedFirstDate = null;
|
|
6807
|
+
this.selectedSecondDate = null;
|
|
6808
|
+
this.selectedDates = [null, null];
|
|
6809
|
+
// Emit updated state to parent
|
|
6810
|
+
this.datesSelected.emit(this.selectedDates);
|
|
6811
|
+
}
|
|
6730
6812
|
}
|
|
6731
6813
|
DoubleCalendarComponent.decorators = [
|
|
6732
6814
|
{ type: Component, args: [{
|
|
@@ -6739,6 +6821,9 @@ DoubleCalendarComponent.decorators = [
|
|
|
6739
6821
|
[secondHoveringDate]="secondHoveringDate"
|
|
6740
6822
|
[highlightDaysBetweenDates]="true"
|
|
6741
6823
|
(dateSelected)="handleFirstDateSelected($event)"
|
|
6824
|
+
[showButtons]="false"
|
|
6825
|
+
(clearDates)="clearAllDates()"
|
|
6826
|
+
[doubleCalendar]="true"
|
|
6742
6827
|
></calendar-template>
|
|
6743
6828
|
<calendar-template
|
|
6744
6829
|
[selectedDate]="selectedSecondDate"
|
|
@@ -6746,6 +6831,10 @@ DoubleCalendarComponent.decorators = [
|
|
|
6746
6831
|
[highlightDaysBetweenDates]="true"
|
|
6747
6832
|
(hoveringDate)="handleSecondHoveringDate($event)"
|
|
6748
6833
|
(dateSelected)="handleSecondDateSelected($event)"
|
|
6834
|
+
(clickedOutside)="clickedOutside.next()"
|
|
6835
|
+
[showButtons]="true"
|
|
6836
|
+
[doubleCalendar]="true"
|
|
6837
|
+
(clearDates)="clearAllDates()"
|
|
6749
6838
|
></calendar-template>
|
|
6750
6839
|
</div>
|
|
6751
6840
|
`,
|
|
@@ -6876,6 +6965,7 @@ InputDateRangePickerComponent.decorators = [
|
|
|
6876
6965
|
(blur)="handleFirstDateChanged(firstDateAsString)"
|
|
6877
6966
|
(clearIconClick)="clearDate(0)"
|
|
6878
6967
|
(click)="handleFirstInputClick($event)"
|
|
6968
|
+
[emptyPlace]="true"
|
|
6879
6969
|
></co-input-text>
|
|
6880
6970
|
<co-input-text #secondInput class="no-focus-line custom-height"
|
|
6881
6971
|
[(model)]= "secondDateAsString"
|
|
@@ -6887,6 +6977,7 @@ InputDateRangePickerComponent.decorators = [
|
|
|
6887
6977
|
(blur)="handleSecondDateChanged(secondDateAsString)"
|
|
6888
6978
|
(clearIconClick)="clearDate(1)"
|
|
6889
6979
|
(click)="handleSecondInputClick($event)"
|
|
6980
|
+
[emptyPlace]="true"
|
|
6890
6981
|
></co-input-text>
|
|
6891
6982
|
</div>
|
|
6892
6983
|
`,
|
|
@@ -13002,9 +13093,11 @@ function emailValidator(control) {
|
|
|
13002
13093
|
}
|
|
13003
13094
|
|
|
13004
13095
|
class TooltipComponent {
|
|
13005
|
-
constructor(_elementRef, _changeDetector) {
|
|
13096
|
+
constructor(_elementRef, _changeDetector, _renderer) {
|
|
13006
13097
|
this._elementRef = _elementRef;
|
|
13007
13098
|
this._changeDetector = _changeDetector;
|
|
13099
|
+
this._renderer = _renderer;
|
|
13100
|
+
this.tooltipClosed = new EventEmitter();
|
|
13008
13101
|
this.top = -100;
|
|
13009
13102
|
this.left = -100;
|
|
13010
13103
|
this.bottom = false;
|
|
@@ -13024,6 +13117,17 @@ class TooltipComponent {
|
|
|
13024
13117
|
setTimeout(() => {
|
|
13025
13118
|
this._positionTooltip();
|
|
13026
13119
|
});
|
|
13120
|
+
this._documentClickListener = this._renderer.listen('document', 'click', (event) => {
|
|
13121
|
+
if (!this._elementRef.nativeElement.contains(event.target)) {
|
|
13122
|
+
this.closeTooltip();
|
|
13123
|
+
}
|
|
13124
|
+
});
|
|
13125
|
+
}
|
|
13126
|
+
ngOnDestroy() {
|
|
13127
|
+
// Remove the click listener to prevent memory leaks
|
|
13128
|
+
if (this._documentClickListener) {
|
|
13129
|
+
this._documentClickListener();
|
|
13130
|
+
}
|
|
13027
13131
|
}
|
|
13028
13132
|
_positionTooltip() {
|
|
13029
13133
|
if (this.hostElement && this._elementRef && this._elementRef.nativeElement) {
|
|
@@ -13044,6 +13148,9 @@ class TooltipComponent {
|
|
|
13044
13148
|
this._changeDetector.detectChanges();
|
|
13045
13149
|
}
|
|
13046
13150
|
}
|
|
13151
|
+
closeTooltip() {
|
|
13152
|
+
this.tooltipClosed.emit();
|
|
13153
|
+
}
|
|
13047
13154
|
}
|
|
13048
13155
|
TooltipComponent.decorators = [
|
|
13049
13156
|
{ type: Component, args: [{
|
|
@@ -13064,11 +13171,13 @@ TooltipComponent.decorators = [
|
|
|
13064
13171
|
];
|
|
13065
13172
|
TooltipComponent.ctorParameters = () => [
|
|
13066
13173
|
{ type: ElementRef },
|
|
13067
|
-
{ type: ChangeDetectorRef }
|
|
13174
|
+
{ type: ChangeDetectorRef },
|
|
13175
|
+
{ type: Renderer2 }
|
|
13068
13176
|
];
|
|
13069
13177
|
TooltipComponent.propDecorators = {
|
|
13070
13178
|
hostElement: [{ type: Input }],
|
|
13071
13179
|
toolTip: [{ type: Input }],
|
|
13180
|
+
tooltipClosed: [{ type: Output }],
|
|
13072
13181
|
showClass: [{ type: HostBinding, args: ['class.co-tooltip',] }],
|
|
13073
13182
|
top: [{ type: HostBinding, args: ["style.top.px",] }],
|
|
13074
13183
|
left: [{ type: HostBinding, args: ["style.left.px",] }],
|
|
@@ -14120,6 +14229,10 @@ class HourSchedulingExpandableComponent {
|
|
|
14120
14229
|
allowDrop(event, hour) {
|
|
14121
14230
|
event.preventDefault();
|
|
14122
14231
|
event.stopPropagation();
|
|
14232
|
+
const target = event.target;
|
|
14233
|
+
if (!target.classList.contains('drag-over')) {
|
|
14234
|
+
target.classList.add('drag-over');
|
|
14235
|
+
}
|
|
14123
14236
|
if (this.currentDraggingObject) {
|
|
14124
14237
|
let newStartDate = this.convertDateToEuropean(this.currentDraggingObject.start);
|
|
14125
14238
|
let hourSplit = hour.split(":");
|
|
@@ -14133,6 +14246,12 @@ class HourSchedulingExpandableComponent {
|
|
|
14133
14246
|
}
|
|
14134
14247
|
}
|
|
14135
14248
|
}
|
|
14249
|
+
handleDragLeave(event) {
|
|
14250
|
+
const target = event.target;
|
|
14251
|
+
if (target.classList.contains('drag-over')) {
|
|
14252
|
+
target.classList.remove('drag-over');
|
|
14253
|
+
}
|
|
14254
|
+
}
|
|
14136
14255
|
// Triggered when resizing starts
|
|
14137
14256
|
onResizeStart(event, obj, direction) {
|
|
14138
14257
|
this.resizing = true;
|
|
@@ -14251,11 +14370,15 @@ HourSchedulingExpandableComponent.decorators = [
|
|
|
14251
14370
|
<div class="hour-label"><span [textContent]="hour"></span></div>
|
|
14252
14371
|
|
|
14253
14372
|
<div class="object-display">
|
|
14254
|
-
<div class="first-half-hour object-half"
|
|
14373
|
+
<div class="first-half-hour object-half"
|
|
14374
|
+
(dragover)="allowDrop($event, hour)"
|
|
14375
|
+
(dragleave)="handleDragLeave($event)"
|
|
14255
14376
|
(drop)="handleDrop($event, hour)">
|
|
14256
14377
|
</div>
|
|
14257
14378
|
|
|
14258
|
-
<div class="second-half-hour object-half"
|
|
14379
|
+
<div class="second-half-hour object-half"
|
|
14380
|
+
(dragover)="allowDrop($event, addHalfHour(hour))"
|
|
14381
|
+
(dragleave)="handleDragLeave($event)"
|
|
14259
14382
|
(drop)="handleDrop($event, addHalfHour(hour))">
|
|
14260
14383
|
</div>
|
|
14261
14384
|
</div>
|