@progress/kendo-angular-dateinputs 16.0.0-develop.12 → 16.0.0-develop.13

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.
Files changed (29) hide show
  1. package/calendar/calendar.component.d.ts +42 -8
  2. package/calendar/horizontal-view-list.component.d.ts +4 -3
  3. package/calendar/models/cell-context.interface.d.ts +4 -0
  4. package/calendar/models/selection-range.interface.d.ts +2 -2
  5. package/calendar/models/selection.d.ts +11 -1
  6. package/calendar/multiview-calendar.component.d.ts +40 -8
  7. package/calendar/view-list.component.d.ts +7 -1
  8. package/calendar/view.component.d.ts +2 -1
  9. package/common/utils.d.ts +4 -0
  10. package/daterange/date-range-popup.component.d.ts +15 -2
  11. package/esm2020/calendar/calendar.component.mjs +233 -45
  12. package/esm2020/calendar/horizontal-view-list.component.mjs +9 -5
  13. package/esm2020/calendar/models/selection.mjs +34 -1
  14. package/esm2020/calendar/multiview-calendar.component.mjs +226 -45
  15. package/esm2020/calendar/services/century-view.service.mjs +26 -5
  16. package/esm2020/calendar/services/decade-view.service.mjs +26 -5
  17. package/esm2020/calendar/services/month-view.service.mjs +26 -5
  18. package/esm2020/calendar/services/year-view.service.mjs +26 -5
  19. package/esm2020/calendar/view-list.component.mjs +20 -3
  20. package/esm2020/calendar/view.component.mjs +6 -3
  21. package/esm2020/common/utils.mjs +4 -0
  22. package/esm2020/datepicker/datepicker.component.mjs +1 -1
  23. package/esm2020/daterange/date-range-popup.component.mjs +64 -11
  24. package/esm2020/daterange/date-range.component.mjs +1 -1
  25. package/esm2020/datetimepicker/datetimepicker.component.mjs +1 -1
  26. package/esm2020/package-metadata.mjs +2 -2
  27. package/fesm2015/progress-kendo-angular-dateinputs.mjs +710 -132
  28. package/fesm2020/progress-kendo-angular-dateinputs.mjs +700 -132
  29. package/package.json +8 -8
@@ -6,7 +6,7 @@ import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, Ev
6
6
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
7
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { cloneDate, isEqual } from '@progress/kendo-date-math';
9
- import { hasObservers, KendoInput, guid, Keys } from '@progress/kendo-angular-common';
9
+ import { hasObservers, KendoInput, guid, Keys, isObject } from '@progress/kendo-angular-common';
10
10
  import { validatePackage } from '@progress/kendo-licensing';
11
11
  import { packageMetadata } from '../package-metadata';
12
12
  import { MultiViewCalendarComponent } from './multiview-calendar.component';
@@ -28,12 +28,13 @@ import { HeaderTitleTemplateDirective } from './templates/header-title-template.
28
28
  import { NavigationItemTemplateDirective } from './templates/navigation-item-template.directive';
29
29
  import { PickerService } from '../common/picker.service';
30
30
  import { CalendarViewEnum } from './models/view.enum';
31
+ import { handleRangeSelection } from './models/selection';
31
32
  import { minValidator } from '../validators/min.validator';
32
33
  import { maxValidator } from '../validators/max.validator';
33
34
  import { MIN_DATE, MAX_DATE } from '../defaults';
34
35
  import { areDatesEqual, dateInRange, DEFAULT_SIZE, getSizeClass, getToday, hasExistingValue, last, noop } from '../util';
35
36
  import { closest } from '../common/dom-queries';
36
- import { requiresZoneOnBlur, preventDefault, isPresent, isArrowWithShiftPressed, selectors, attributeNames } from '../common/utils';
37
+ import { requiresZoneOnBlur, preventDefault, isPresent, isArrowWithShiftPressed, selectors, attributeNames, isNullOrDate } from '../common/utils';
37
38
  import { from as fromPromise } from 'rxjs';
38
39
  import { HeaderTemplateDirective } from './templates/header-template.directive';
39
40
  import { FooterTemplateDirective } from './templates/footer-template.directivе';
@@ -125,15 +126,14 @@ export class CalendarComponent {
125
126
  * @default false
126
127
  */
127
128
  this.footer = false;
129
+ this._selection = 'single';
128
130
  /**
129
- * Sets the Calendar selection mode
130
- * ([see example]({% slug multiple_selection_calendar %})).
131
+ * Allows reverse selection when using `range` selection.
132
+ * If `allowReverse` is set to `true`, the component skips the validation of whether the start date is after the end date.
131
133
  *
132
- * The available values are:
133
- * * `single` (default)
134
- * * `multiple`
134
+ * @default false
135
135
  */
136
- this.selection = 'single';
136
+ this.allowReverse = false;
137
137
  /**
138
138
  * Sets or gets the `disabled` property of the Calendar and
139
139
  * determines whether the component is active
@@ -218,8 +218,10 @@ export class CalendarComponent {
218
218
  */
219
219
  this.valueChange = new EventEmitter();
220
220
  this._size = DEFAULT_SIZE;
221
+ this._activeRangeEnd = 'start';
221
222
  this.isActive = false;
222
223
  this.cellUID = guid();
224
+ this.selectionRange = { start: null, end: null };
223
225
  this.selectedDates = [];
224
226
  this._min = new Date(MIN_DATE);
225
227
  this._max = new Date(MAX_DATE);
@@ -229,11 +231,15 @@ export class CalendarComponent {
229
231
  this.onValidatorChange = noop;
230
232
  this.minValidateFn = noop;
231
233
  this.maxValidateFn = noop;
234
+ this.changes = {};
235
+ this.valueSetter = false;
236
+ this.selectionSetter = false;
232
237
  this.syncNavigation = true;
233
238
  this._type = 'infinite';
234
239
  this.domEvents = [];
235
240
  this.resolvedPromise = Promise.resolve(null);
236
241
  this.destroyed = false;
242
+ this.canHover = false;
237
243
  validatePackage(packageMetadata);
238
244
  this.id = `kendo-calendarid-${this.bus.calendarId}`;
239
245
  this.setClasses(element.nativeElement);
@@ -320,29 +326,37 @@ export class CalendarComponent {
320
326
  get max() {
321
327
  return this._max;
322
328
  }
329
+ /**
330
+ * Sets the Calendar selection mode
331
+ * ([see example]({% slug multiple_selection_calendar %})).
332
+ *
333
+ * The available values are:
334
+ * * `single` (default)
335
+ * * `multiple`
336
+ * * `range`
337
+ */
338
+ set selection(_selection) {
339
+ this._selection = _selection;
340
+ this.selectionSetter = true;
341
+ }
342
+ get selection() {
343
+ return this._selection;
344
+ }
323
345
  /**
324
346
  * Sets or gets the `value` property of the Calendar and defines the selected value of the component.
325
347
  *
326
348
  * > The `value` has to be a valid
327
349
  * [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date)
328
- * instance when in `single` selection mode or an array of valid JavaScript Date instances when in `multiple` selection mode.
350
+ * instance when in `single` selection mode, an array of valid JavaScript Date instances when in `multiple` selection mode, or
351
+ * an object of type `SelectionRange` when in `range` selection mode.
329
352
  */
353
+ set value(candidate) {
354
+ this.valueSetter = true;
355
+ this._value = candidate;
356
+ }
330
357
  get value() {
331
358
  return this._value;
332
359
  }
333
- set value(candidate) {
334
- this.verifyValue(candidate);
335
- this._value = Array.isArray(candidate) ?
336
- candidate.filter(date => isPresent(date)).map(element => cloneDate(element)) :
337
- cloneDate(candidate);
338
- const selection = [].concat(candidate).filter(date => isPresent(date)).map(date => cloneDate(date));
339
- if (!areDatesEqual(selection, this.selectedDates)) {
340
- const lastSelected = last(selection);
341
- this.rangePivot = cloneDate(lastSelected);
342
- this.focusedDate = cloneDate(lastSelected) || this.focusedDate;
343
- this.selectedDates = selection;
344
- }
345
- }
346
360
  /**
347
361
  * @hidden
348
362
  */
@@ -523,6 +537,18 @@ export class CalendarComponent {
523
537
  get size() {
524
538
  return this._size;
525
539
  }
540
+ /**
541
+ * Specify, which end of the defined selection range should be marked as active.
542
+ *
543
+ * > Value will be ignored if the selection range is undefined.
544
+ * > If range selection is used then the default value is 'start'.
545
+ */
546
+ set activeRangeEnd(_activeRangeEnd) {
547
+ this._activeRangeEnd = _activeRangeEnd;
548
+ }
549
+ get activeRangeEnd() {
550
+ return this._activeRangeEnd;
551
+ }
526
552
  get activeViewEnum() {
527
553
  const activeView = CalendarViewEnum[this.activeView];
528
554
  return activeView < this.bottomViewEnum ? this.bottomViewEnum : activeView;
@@ -555,21 +581,30 @@ export class CalendarComponent {
555
581
  }
556
582
  }
557
583
  ngOnChanges(changes) {
584
+ this.changes = changes;
558
585
  this.verifyChanges();
559
586
  this.bus.configure(this.bottomViewEnum, this.topViewEnum);
560
587
  this.scrollSyncService.configure(this.activeViewEnum);
561
- if (hasExistingValue(changes, 'focusedDate')) {
562
- const focusedDate = changes.focusedDate.currentValue;
588
+ }
589
+ ngDoCheck() {
590
+ if (this.valueSetter || this.selectionSetter) {
591
+ this.setValue(this.value);
592
+ this.valueSetter = false;
593
+ this.selectionSetter = false;
594
+ }
595
+ if (hasExistingValue(this.changes, 'focusedDate')) {
596
+ const focusedDate = this.changes.focusedDate.currentValue;
563
597
  this.focusedDate = dateInRange(focusedDate, this.min, this.max);
564
598
  }
565
- if (changes.navigation) {
599
+ if (this.changes.navigation) {
566
600
  this.syncNavigation = true;
567
601
  }
568
- if (changes.min || changes.max || changes.rangeValidation) {
602
+ if (this.changes.min || this.changes.max || this.changes.rangeValidation) {
569
603
  this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;
570
604
  this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;
571
605
  this.onValidatorChange();
572
606
  }
607
+ this.changes = {};
573
608
  }
574
609
  ngAfterViewInit() {
575
610
  this.setAriaActivedescendant();
@@ -602,6 +637,31 @@ export class CalendarComponent {
602
637
  }
603
638
  this.destroyed = true;
604
639
  }
640
+ /**
641
+ * @hidden
642
+ */
643
+ onCellEnter(date) {
644
+ if (this.selection === 'range' && this.canHover) {
645
+ this.ngZone.run(() => {
646
+ if (this.allowReverse) {
647
+ if (this.activeRangeEnd === 'end' && this.selectionRange.start) {
648
+ this.selectionRange = { start: this.selectionRange.start, end: date };
649
+ }
650
+ if (this.activeRangeEnd === 'start' && this.selectionRange.end) {
651
+ this.selectionRange = { start: date, end: this.selectionRange.end };
652
+ }
653
+ }
654
+ else {
655
+ if (this.activeRangeEnd === 'end' && this.selectionRange.start && date >= this.selectionRange.start) {
656
+ this.selectionRange = { start: this.selectionRange.start, end: date };
657
+ }
658
+ if (this.selectionRange.start && date < this.selectionRange.start) {
659
+ this.selectionRange = { start: this.selectionRange.start, end: null };
660
+ }
661
+ }
662
+ });
663
+ }
664
+ }
605
665
  /**
606
666
  * @hidden
607
667
  */
@@ -675,9 +735,14 @@ export class CalendarComponent {
675
735
  /**
676
736
  * @hidden
677
737
  */
678
- handleMultiViewCalendarValueChange(date, focusedDate) {
679
- const selectedDates = Array.isArray(date) ? date : [date];
680
- this.handleDateChange({ selectedDates, focusedDate });
738
+ handleMultiViewCalendarValueChange(value, focusedDate) {
739
+ if (this.selection === 'range') {
740
+ this.valueChange.emit(value);
741
+ }
742
+ else {
743
+ const selectedDates = (Array.isArray(value) ? value : [value]);
744
+ this.handleDateChange({ selectedDates, focusedDate });
745
+ }
681
746
  }
682
747
  /**
683
748
  * @hidden
@@ -701,6 +766,9 @@ export class CalendarComponent {
701
766
  if (this.disabledDatesService.isDateDisabled(this.focusedDate)) {
702
767
  return;
703
768
  }
769
+ if (this.selection === 'range') {
770
+ return;
771
+ }
704
772
  this.ngZone.run(() => {
705
773
  this.selectedDates = availableDates.map(date => cloneDate(date));
706
774
  this.value = this.parseSelectionToValue(availableDates);
@@ -813,8 +881,13 @@ export class CalendarComponent {
813
881
  */
814
882
  handleCellClick({ date, modifiers }) {
815
883
  this.focus();
816
- this.selectionService.lastClicked = date;
817
- this.performSelection(date, modifiers);
884
+ if (this.selection === 'range') {
885
+ this.performRangeSelection(date);
886
+ }
887
+ else {
888
+ this.selectionService.lastClicked = date;
889
+ this.performSelection(date, modifiers);
890
+ }
818
891
  }
819
892
  /**
820
893
  * @hidden
@@ -824,10 +897,22 @@ export class CalendarComponent {
824
897
  return;
825
898
  }
826
899
  this.ngZone.run(() => {
827
- this.handleDateChange({
828
- selectedDates: dates,
829
- focusedDate: last(dates)
830
- });
900
+ if (this.selection === 'multiple') {
901
+ this.handleDateChange({
902
+ selectedDates: dates,
903
+ focusedDate: last(dates),
904
+ });
905
+ }
906
+ if (this.selection === 'range') {
907
+ this.canHover = false;
908
+ this.activeRangeEnd = 'start';
909
+ const shouldEmitValueChange = this.selectionRange.start?.getTime() !== dates[0].getTime() ||
910
+ this.selectionRange.end?.getTime() !== last(dates).getTime();
911
+ this.value = { start: dates[0], end: last(dates) };
912
+ if (shouldEmitValueChange) {
913
+ this.valueChange.emit(this.value);
914
+ }
915
+ }
831
916
  });
832
917
  }
833
918
  /**
@@ -891,15 +976,23 @@ export class CalendarComponent {
891
976
  if (!isDevMode()) {
892
977
  return;
893
978
  }
894
- if (this.selection === 'single' && candidate && !(candidate instanceof Date)) {
895
- throw new Error(`The 'value' should be a valid JavaScript Date instance. Check ${VALUE_DOC_LINK} for possible resolution.`);
979
+ if (this.selection === 'single' && candidate && !(isNullOrDate(candidate))) {
980
+ throw new Error(`When using 'single' selection the 'value' should be a valid JavaScript Date instance. Check ${VALUE_DOC_LINK} for possible resolution.`);
896
981
  }
897
- else if (this.selection === 'multiple' && candidate && Array.isArray(candidate)) {
898
- const onlyDates = candidate.every(value => value instanceof Date);
899
- if (!onlyDates) {
900
- throw new Error(`The 'value' should be an array of valid JavaScript Date instances. Check ${VALUE_DOC_LINK} for possible resolution.`);
982
+ else if (this.selection === 'multiple' && candidate) {
983
+ if (Array.isArray(candidate)) {
984
+ const onlyDates = candidate.every(value => value instanceof Date);
985
+ if (!onlyDates) {
986
+ throw new Error(`When using 'multiple' selection the 'value' should be an array of valid JavaScript Date instances. Check ${VALUE_DOC_LINK} for possible resolution.`);
987
+ }
988
+ }
989
+ if (Object.keys(candidate).find(k => k === 'start') && Object.keys(candidate).find(k => k === 'end')) {
990
+ throw new Error(`When using 'multiple' selection the 'value' should be an array of valid JavaScript Date instances. Check ${VALUE_DOC_LINK} for possible resolution.`);
901
991
  }
902
992
  }
993
+ else if (this.selection === 'range' && candidate && !(isNullOrDate(candidate['start']) && isNullOrDate(candidate['end']))) {
994
+ throw new Error(`The 'value' should be an object with start and end dates. Check ${VALUE_DOC_LINK} for possible resolution.`);
995
+ }
903
996
  }
904
997
  bindEvents() {
905
998
  const element = this.element.nativeElement;
@@ -951,12 +1044,17 @@ export class CalendarComponent {
951
1044
  }
952
1045
  if (args.keyCode === Keys.Enter) {
953
1046
  this.selectionService.lastClicked = this.focusedDate;
954
- this.performSelection(this.focusedDate, args);
1047
+ if (this.selection !== 'range') {
1048
+ this.performSelection(this.focusedDate, args);
1049
+ }
1050
+ else {
1051
+ this.performRangeSelection(this.focusedDate);
1052
+ }
955
1053
  }
956
1054
  if (args.keyCode === Keys.KeyT) {
957
1055
  this.focusToday();
958
1056
  }
959
- if (isArrowWithShiftPressed(args)) {
1057
+ if (isArrowWithShiftPressed(args) && this.selection !== 'range') {
960
1058
  args.anyArrow = true;
961
1059
  this.performSelection(this.focusedDate, args);
962
1060
  }
@@ -995,6 +1093,78 @@ export class CalendarComponent {
995
1093
  selection = selection || [];
996
1094
  return this.selection === 'single' ? cloneDate(last(selection)) : selection.map(date => cloneDate(date));
997
1095
  }
1096
+ setValue(candidate) {
1097
+ this.verifyValue(candidate);
1098
+ if (candidate === null) {
1099
+ this._value = null;
1100
+ this.selectedDates = [];
1101
+ this.selectionRange = { start: null, end: null };
1102
+ }
1103
+ else if (Array.isArray(candidate)) {
1104
+ this.selectionRange = { start: null, end: null };
1105
+ this._value = candidate.filter(date => isPresent(date)).map(element => cloneDate(element));
1106
+ }
1107
+ else if (isObject(candidate) && Object.keys(candidate).find(k => k === 'start') && Object.keys(candidate).find(k => k === 'end')) {
1108
+ this.selectedDates = [];
1109
+ this.selectionRange = { start: null, end: null };
1110
+ this._value = { start: null, end: null };
1111
+ this._value.start = candidate.start instanceof Date ? cloneDate(candidate.start) : null;
1112
+ this._value.end = candidate.end instanceof Date ? cloneDate(candidate.end) : null;
1113
+ this.selectionRange = Object.assign({}, this._value);
1114
+ if (this._value?.start && !this._value?.end) {
1115
+ this.activeRangeEnd = 'end';
1116
+ this.canHover = true;
1117
+ }
1118
+ if (this._value?.end && !this._value?.start) {
1119
+ this.activeRangeEnd = 'start';
1120
+ this.canHover = true;
1121
+ }
1122
+ if (this.activeRangeEnd === 'end') {
1123
+ this.focusedDate = this.selectionRange.start || this.selectionRange.end || getToday();
1124
+ }
1125
+ else {
1126
+ this.focusedDate = this.selectionRange.end || this.selectionRange.start || getToday();
1127
+ }
1128
+ }
1129
+ else {
1130
+ this.selectionRange = { start: null, end: null };
1131
+ this._value = cloneDate(candidate);
1132
+ }
1133
+ if (this.selection !== 'range') {
1134
+ const selection = [].concat(candidate).filter(date => isPresent(date)).map(date => cloneDate(date));
1135
+ if (!areDatesEqual(selection, this.selectedDates)) {
1136
+ const lastSelected = last(selection);
1137
+ this.rangePivot = cloneDate(lastSelected);
1138
+ this.focusedDate = cloneDate(lastSelected) || this.focusedDate;
1139
+ this.selectedDates = selection;
1140
+ }
1141
+ }
1142
+ }
1143
+ performRangeSelection(date) {
1144
+ const clonedRangeSelection = Object.assign({}, this.selectionRange);
1145
+ const emitValueChange = (this.activeRangeEnd === 'start' && this.value?.start?.getTime() !== date?.getTime()) ||
1146
+ (this.activeRangeEnd === 'end' && this.value?.end?.getTime() !== date?.getTime());
1147
+ this.ngZone.run(() => {
1148
+ const rangeSelection = handleRangeSelection(date, clonedRangeSelection, this.activeRangeEnd, this.allowReverse);
1149
+ this.activeRangeEnd = rangeSelection.activeRangeEnd;
1150
+ if (this.canHover && rangeSelection.activeRangeEnd === 'end' && rangeSelection.selectionRange.end?.getTime() === date.getTime()) {
1151
+ this.activeRangeEnd = 'start';
1152
+ }
1153
+ if ((this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start) ||
1154
+ (this.activeRangeEnd === 'start' && rangeSelection.selectionRange.end)) {
1155
+ this.canHover = true;
1156
+ }
1157
+ else {
1158
+ this.canHover = false;
1159
+ }
1160
+ if (emitValueChange && (this.value?.start?.getTime() !== rangeSelection.selectionRange?.start?.getTime() ||
1161
+ this.value?.end?.getTime() !== rangeSelection.selectionRange?.end?.getTime())) {
1162
+ this.value = rangeSelection.selectionRange;
1163
+ this.valueChange.emit(this.value);
1164
+ }
1165
+ this.cdr.markForCheck();
1166
+ });
1167
+ }
998
1168
  performSelection(date, selectionModifiers) {
999
1169
  const selection = this.selectionService.performSelection({
1000
1170
  date: date,
@@ -1012,7 +1182,7 @@ export class CalendarComponent {
1012
1182
  }
1013
1183
  }
1014
1184
  CalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CalendarComponent, deps: [{ token: i1.BusViewService }, { token: i2.CalendarDOMService }, { token: i0.ElementRef }, { token: i3.NavigationService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: i4.ScrollSyncService }, { token: i5.DisabledDatesService }, { token: i6.LocalizationService }, { token: i7.SelectionService }, { token: i8.PickerService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1015
- CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: CalendarComponent, selector: "kendo-calendar", inputs: { showOtherMonthDays: "showOtherMonthDays", id: "id", focusedDate: "focusedDate", min: "min", max: "max", rangeValidation: "rangeValidation", weekDaysFormat: "weekDaysFormat", footer: "footer", selection: "selection", value: "value", disabled: "disabled", tabindex: "tabindex", tabIndex: "tabIndex", disabledDates: "disabledDates", navigation: "navigation", activeView: "activeView", bottomView: "bottomView", topView: "topView", type: "type", animateNavigation: "animateNavigation", weekNumber: "weekNumber", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"], size: "size" }, outputs: { activeViewChange: "activeViewChange", navigate: "navigate", activeViewDateChange: "activeViewDateChange", onBlur: "blur", onFocus: "focus", valueChange: "valueChange" }, host: { properties: { "class.k-week-number": "this.weekNumber", "attr.id": "this.widgetId", "attr.aria-disabled": "this.ariaDisabled", "class.k-disabled": "this.ariaDisabled" } }, providers: [
1185
+ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: CalendarComponent, selector: "kendo-calendar", inputs: { showOtherMonthDays: "showOtherMonthDays", id: "id", focusedDate: "focusedDate", min: "min", max: "max", rangeValidation: "rangeValidation", weekDaysFormat: "weekDaysFormat", footer: "footer", selection: "selection", allowReverse: "allowReverse", value: "value", disabled: "disabled", tabindex: "tabindex", tabIndex: "tabIndex", disabledDates: "disabledDates", navigation: "navigation", activeView: "activeView", bottomView: "bottomView", topView: "topView", type: "type", animateNavigation: "animateNavigation", weekNumber: "weekNumber", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"], size: "size", activeRangeEnd: "activeRangeEnd" }, outputs: { activeViewChange: "activeViewChange", navigate: "navigate", activeViewDateChange: "activeViewDateChange", onBlur: "blur", onFocus: "focus", valueChange: "valueChange" }, host: { properties: { "class.k-week-number": "this.weekNumber", "attr.id": "this.widgetId", "attr.aria-disabled": "this.ariaDisabled", "class.k-disabled": "this.ariaDisabled" } }, providers: [
1016
1186
  BusViewService,
1017
1187
  CALENDAR_VALUE_ACCESSOR,
1018
1188
  CALENDAR_RANGE_VALIDATORS,
@@ -1055,7 +1225,10 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
1055
1225
  </kendo-calendar-navigation>
1056
1226
  <kendo-calendar-viewlist
1057
1227
  [activeView]="activeViewEnum"
1228
+ [allowReverse]="allowReverse"
1058
1229
  [showOtherMonthDays]="showOtherMonthDays"
1230
+ [activeRangeEnd]="activeRangeEnd"
1231
+ [selectionRange]="selectionRange"
1059
1232
  [isActive]="isActive"
1060
1233
  [id]="headerId"
1061
1234
  [weekDaysFormat]="weekDaysFormat"
@@ -1083,6 +1256,7 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
1083
1256
  (pageChange)="onPageChange()"
1084
1257
  (focusCalendar)="handleFocus()"
1085
1258
  (blurCalendar)="handleBlur($event)"
1259
+ (cellEnter)="onCellEnter($event)"
1086
1260
  >
1087
1261
  </kendo-calendar-viewlist>
1088
1262
  <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
@@ -1094,6 +1268,9 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
1094
1268
  [min]="min"
1095
1269
  [max]="max"
1096
1270
  [id]="id"
1271
+ [activeRangeEnd]="activeRangeEnd"
1272
+ [selectionRange]="selectionRange"
1273
+ [allowReverse]="allowReverse"
1097
1274
  [disabled]="disabled"
1098
1275
  [isActive]="isActive"
1099
1276
  [showOtherMonthDays]="showOtherMonthDays"
@@ -1135,7 +1312,7 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
1135
1312
  </kendo-multiviewcalendar-messages>
1136
1313
  </kendo-multiviewcalendar>
1137
1314
  </ng-container>
1138
- `, isInline: true, dependencies: [{ kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i10.MultiViewCalendarCustomMessagesComponent, selector: "kendo-multiviewcalendar-messages" }, { kind: "component", type: i11.MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: ["showOtherMonthDays", "showCalendarHeader", "id", "focusedDate", "footer", "min", "max", "rangeValidation", "disabledDatesRangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "weekDaysFormat", "isActive", "disabledDates", "activeView", "bottomView", "topView", "showViewHeader", "animateNavigation", "weekNumber", "activeRangeEnd", "selectionRange", "views", "orientation", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "footerTemplate", "headerTitleTemplate", "headerTemplate"], outputs: ["activeViewChange", "navigate", "cellEnter", "cellLeave", "valueChange", "blur", "focus", "focusCalendar", "onClosePopup", "onTabPress", "onShiftTabPress"], exportAs: ["kendo-multiviewcalendar"] }, { kind: "component", type: i12.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "component", type: i13.NavigationComponent, selector: "kendo-calendar-navigation", inputs: ["activeView", "min", "max", "focusedDate", "templateRef"], outputs: ["valueChange", "pageChange"] }, { kind: "directive", type: i14.CalendarLocalizedMessagesDirective, selector: "[kendoCalendarLocalizedMessages]" }, { kind: "component", type: i15.ViewListComponent, selector: "kendo-calendar-viewlist", inputs: ["cellTemplateRef", "weekNumberTemplateRef", "headerTitleTemplateRef", "headerTemplateRef", "footerTemplateRef", "showOtherMonthDays", "activeView", "cellUID", "focusedDate", "isActive", "min", "max", "selectedDates", "tabIndex", "disabled", "id", "showFooter", "weekDaysFormat", "weekNumber"], outputs: ["cellClick", "weekNumberCellClick", "activeDateChange", "todayButtonClick", "pageChange", "focusCalendar", "blurCalendar", "focusedCellChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1315
+ `, isInline: true, dependencies: [{ kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i10.MultiViewCalendarCustomMessagesComponent, selector: "kendo-multiviewcalendar-messages" }, { kind: "component", type: i11.MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: ["showOtherMonthDays", "showCalendarHeader", "id", "focusedDate", "footer", "min", "max", "rangeValidation", "disabledDatesRangeValidation", "selection", "allowReverse", "value", "disabled", "tabindex", "tabIndex", "weekDaysFormat", "isActive", "disabledDates", "activeView", "bottomView", "topView", "showViewHeader", "animateNavigation", "weekNumber", "activeRangeEnd", "selectionRange", "views", "orientation", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "footerTemplate", "headerTitleTemplate", "headerTemplate"], outputs: ["activeViewChange", "navigate", "cellEnter", "cellLeave", "valueChange", "rangeSelectionChange", "blur", "focus", "focusCalendar", "onClosePopup", "onTabPress", "onShiftTabPress"], exportAs: ["kendo-multiviewcalendar"] }, { kind: "component", type: i12.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "component", type: i13.NavigationComponent, selector: "kendo-calendar-navigation", inputs: ["activeView", "min", "max", "focusedDate", "templateRef"], outputs: ["valueChange", "pageChange"] }, { kind: "directive", type: i14.CalendarLocalizedMessagesDirective, selector: "[kendoCalendarLocalizedMessages]" }, { kind: "component", type: i15.ViewListComponent, selector: "kendo-calendar-viewlist", inputs: ["allowReverse", "cellTemplateRef", "weekNumberTemplateRef", "headerTitleTemplateRef", "headerTemplateRef", "footerTemplateRef", "showOtherMonthDays", "activeView", "cellUID", "focusedDate", "isActive", "min", "max", "selectedDates", "tabIndex", "disabled", "id", "showFooter", "weekDaysFormat", "activeRangeEnd", "selectionRange", "weekNumber"], outputs: ["cellEnter", "cellClick", "weekNumberCellClick", "activeDateChange", "todayButtonClick", "pageChange", "focusCalendar", "blurCalendar", "focusedCellChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1139
1316
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CalendarComponent, decorators: [{
1140
1317
  type: Component,
1141
1318
  args: [{
@@ -1186,7 +1363,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1186
1363
  </kendo-calendar-navigation>
1187
1364
  <kendo-calendar-viewlist
1188
1365
  [activeView]="activeViewEnum"
1366
+ [allowReverse]="allowReverse"
1189
1367
  [showOtherMonthDays]="showOtherMonthDays"
1368
+ [activeRangeEnd]="activeRangeEnd"
1369
+ [selectionRange]="selectionRange"
1190
1370
  [isActive]="isActive"
1191
1371
  [id]="headerId"
1192
1372
  [weekDaysFormat]="weekDaysFormat"
@@ -1214,6 +1394,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1214
1394
  (pageChange)="onPageChange()"
1215
1395
  (focusCalendar)="handleFocus()"
1216
1396
  (blurCalendar)="handleBlur($event)"
1397
+ (cellEnter)="onCellEnter($event)"
1217
1398
  >
1218
1399
  </kendo-calendar-viewlist>
1219
1400
  <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
@@ -1225,6 +1406,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1225
1406
  [min]="min"
1226
1407
  [max]="max"
1227
1408
  [id]="id"
1409
+ [activeRangeEnd]="activeRangeEnd"
1410
+ [selectionRange]="selectionRange"
1411
+ [allowReverse]="allowReverse"
1228
1412
  [disabled]="disabled"
1229
1413
  [isActive]="isActive"
1230
1414
  [showOtherMonthDays]="showOtherMonthDays"
@@ -1288,6 +1472,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1288
1472
  type: Input
1289
1473
  }], selection: [{
1290
1474
  type: Input
1475
+ }], allowReverse: [{
1476
+ type: Input
1291
1477
  }], value: [{
1292
1478
  type: Input
1293
1479
  }], disabled: [{
@@ -1391,6 +1577,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1391
1577
  args: ['navigationItemTemplate']
1392
1578
  }], size: [{
1393
1579
  type: Input
1580
+ }], activeRangeEnd: [{
1581
+ type: Input
1394
1582
  }], navigationView: [{
1395
1583
  type: ViewChild,
1396
1584
  args: [NavigationComponent, { static: false }]
@@ -281,7 +281,7 @@ export class HorizontalViewListComponent {
281
281
  }
282
282
  }
283
283
  HorizontalViewListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: HorizontalViewListComponent, deps: [{ token: i1.BusViewService }, { token: i2.IntlService }, { token: i3.WeekNamesService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
284
- HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: HorizontalViewListComponent, selector: "kendo-calendar-horizontal", inputs: { showOtherMonthDays: "showOtherMonthDays", cellTemplateRef: "cellTemplateRef", weekNumberTemplateRef: "weekNumberTemplateRef", activeRangeEnd: "activeRangeEnd", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", isActive: "isActive", min: "min", max: "max", selectionRange: "selectionRange", selectedDates: "selectedDates", views: "views", showViewHeader: "showViewHeader", animateNavigation: "animateNavigation", orientation: "orientation", activeDescendant: "activeDescendant", tabIndex: "tabIndex", disabled: "disabled", id: "id", weekDaysFormat: "weekDaysFormat", weekNumber: "weekNumber" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", cellEnter: "cellEnter", cellLeave: "cellLeave", activeDateChange: "activeDateChange", focusCalendar: "focusCalendar", blurCalendar: "blurCalendar", focusedCellChange: "focusedCellChange" }, host: { listeners: { "focus": "handleMultiViewCalendarFocus()", "blur": "handleMultiViewCalendarBlur($event)" }, properties: { "class.k-calendar-view": "this.getComponentClass", "class.k-align-items-start": "this.getComponentClass", "class.k-justify-content-center": "this.getComponentClass", "class.k-hstack": "this.horizontalHostClass", "class.k-vstack": "this.verticalHostClass", "class.k-calendar-monthview": "this.getComponentMonthClass", "class.k-calendar-yearview": "this.getComponentYearClass", "class.k-calendar-decadeview": "this.getComponentDecadeClass", "class.k-calendar-centuryview": "this.getComponentCenturyClass", "attr.role": "this.role", "attr.tabindex": "this.tabindex" } }, usesOnChanges: true, ngImport: i0, template: `
284
+ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: HorizontalViewListComponent, selector: "kendo-calendar-horizontal", inputs: { showOtherMonthDays: "showOtherMonthDays", cellTemplateRef: "cellTemplateRef", weekNumberTemplateRef: "weekNumberTemplateRef", allowReverse: "allowReverse", activeRangeEnd: "activeRangeEnd", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", isActive: "isActive", min: "min", max: "max", selectionRange: "selectionRange", selectedDates: "selectedDates", views: "views", showViewHeader: "showViewHeader", animateNavigation: "animateNavigation", orientation: "orientation", activeDescendant: "activeDescendant", tabIndex: "tabIndex", disabled: "disabled", id: "id", weekDaysFormat: "weekDaysFormat", weekNumber: "weekNumber" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", cellEnter: "cellEnter", cellLeave: "cellLeave", activeDateChange: "activeDateChange", focusCalendar: "focusCalendar", blurCalendar: "blurCalendar", focusedCellChange: "focusedCellChange" }, host: { listeners: { "focus": "handleMultiViewCalendarFocus()", "blur": "handleMultiViewCalendarBlur($event)" }, properties: { "class.k-calendar-view": "this.getComponentClass", "class.k-align-items-start": "this.getComponentClass", "class.k-justify-content-center": "this.getComponentClass", "class.k-hstack": "this.horizontalHostClass", "class.k-vstack": "this.verticalHostClass", "class.k-calendar-monthview": "this.getComponentMonthClass", "class.k-calendar-yearview": "this.getComponentYearClass", "class.k-calendar-decadeview": "this.getComponentDecadeClass", "class.k-calendar-centuryview": "this.getComponentCenturyClass", "attr.role": "this.role", "attr.tabindex": "this.tabindex" } }, usesOnChanges: true, ngImport: i0, template: `
285
285
  <ng-template #tableTemplate let-date="date" let-class="className">
286
286
  <table
287
287
  [attr.role]="views >= 2 ? 'none' : 'grid'"
@@ -307,6 +307,7 @@ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.
307
307
  <tbody
308
308
  class="k-calendar-tbody"
309
309
  kendoCalendarView
310
+ [allowReverse]="allowReverse"
310
311
  [showOtherMonthDays]="showOtherMonthDays"
311
312
  role="rowgroup"
312
313
  direction="horizontal"
@@ -363,7 +364,7 @@ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.
363
364
  }"
364
365
  >
365
366
  </ng-template>
366
- `, isInline: true, dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }, { kind: "component", type: i6.ViewComponent, selector: "[kendoCalendarView]", inputs: ["showOtherMonthDays", "direction", "isActive", "activeView", "cellUID", "focusedDate", "viewDate", "activeRangeEnd", "selectionRange", "min", "max", "selectedDates", "weekNumber", "viewIndex", "templateRef", "weekNumberTemplateRef", "headerTitle"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave", "focusedCellId"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
367
+ `, isInline: true, dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }, { kind: "component", type: i6.ViewComponent, selector: "[kendoCalendarView]", inputs: ["allowReverse", "showOtherMonthDays", "direction", "isActive", "activeView", "cellUID", "focusedDate", "viewDate", "activeRangeEnd", "selectionRange", "min", "max", "selectedDates", "weekNumber", "viewIndex", "templateRef", "weekNumberTemplateRef", "headerTitle"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave", "focusedCellId"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
367
368
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: HorizontalViewListComponent, decorators: [{
368
369
  type: Component,
369
370
  args: [{
@@ -395,6 +396,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
395
396
  <tbody
396
397
  class="k-calendar-tbody"
397
398
  kendoCalendarView
399
+ [allowReverse]="allowReverse"
398
400
  [showOtherMonthDays]="showOtherMonthDays"
399
401
  role="rowgroup"
400
402
  direction="horizontal"
@@ -453,18 +455,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
453
455
  </ng-template>
454
456
  `
455
457
  }]
456
- }], ctorParameters: function () { return [{ type: i1.BusViewService }, { type: i2.IntlService }, { type: i3.WeekNamesService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { showOtherMonthDays: [{
457
- type: Input
458
- }], handleMultiViewCalendarFocus: [{
458
+ }], ctorParameters: function () { return [{ type: i1.BusViewService }, { type: i2.IntlService }, { type: i3.WeekNamesService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { handleMultiViewCalendarFocus: [{
459
459
  type: HostListener,
460
460
  args: ["focus"]
461
461
  }], handleMultiViewCalendarBlur: [{
462
462
  type: HostListener,
463
463
  args: ["blur", ['$event']]
464
+ }], showOtherMonthDays: [{
465
+ type: Input
464
466
  }], cellTemplateRef: [{
465
467
  type: Input
466
468
  }], weekNumberTemplateRef: [{
467
469
  type: Input
470
+ }], allowReverse: [{
471
+ type: Input
468
472
  }], activeRangeEnd: [{
469
473
  type: Input
470
474
  }], activeView: [{
@@ -2,4 +2,37 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- export {};
5
+ /**
6
+ * @hidden
7
+ */
8
+ export function handleRangeSelection(date, selectionRange, activeRangeEnd, allowReverse = false) {
9
+ if ((activeRangeEnd === 'start' && selectionRange.start?.getTime() === date?.getTime() && ((allowReverse && !selectionRange.end) || !allowReverse)) ||
10
+ (activeRangeEnd === 'end' && selectionRange.end?.getTime() === date?.getTime())) {
11
+ return { activeRangeEnd: activeRangeEnd, selectionRange: selectionRange };
12
+ }
13
+ if (allowReverse) {
14
+ if (activeRangeEnd === 'start') {
15
+ selectionRange.start = date;
16
+ activeRangeEnd = 'end';
17
+ }
18
+ else if (activeRangeEnd === 'end') {
19
+ selectionRange.end = date;
20
+ activeRangeEnd = 'start';
21
+ }
22
+ }
23
+ if (!allowReverse) {
24
+ if (activeRangeEnd === 'start' && date > selectionRange.end ||
25
+ activeRangeEnd === 'end' && date < selectionRange.start) {
26
+ selectionRange = { start: date, end: null };
27
+ }
28
+ else if (activeRangeEnd === 'start' && date <= selectionRange.end) {
29
+ selectionRange.start = date;
30
+ activeRangeEnd = 'end';
31
+ }
32
+ else if (activeRangeEnd === 'end' && date >= selectionRange.start) {
33
+ selectionRange.end = date;
34
+ activeRangeEnd = 'start';
35
+ }
36
+ }
37
+ return { activeRangeEnd: activeRangeEnd, selectionRange: selectionRange };
38
+ }