@progress/kendo-angular-scheduler 25.4.0-develop.4 → 25.4.0-develop.6

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.
@@ -44,8 +44,8 @@ const packageMetadata = {
44
44
  productName: 'Kendo UI for Angular',
45
45
  productCode: 'KENDOUIANGULAR',
46
46
  productCodes: ['KENDOUIANGULAR'],
47
- publishDate: 1792070988,
48
- version: '25.4.0-develop.4',
47
+ publishDate: 1792137000,
48
+ version: '25.4.0-develop.6',
49
49
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
50
50
  };
51
51
 
@@ -2944,7 +2944,8 @@ function isRecurrenceException(task) {
2944
2944
  return task.event && isPresent(task.event.recurrenceId) && !task.event.recurrenceRule;
2945
2945
  }
2946
2946
  /** @hidden */
2947
- const rectContains = (rect, left, top, scaleX = 1) => rect.left * scaleX <= left && left <= rect.left * scaleX + rect.width * scaleX && rect.top * scaleX <= top && top <= rect.top * scaleX + rect.height * scaleX;
2947
+ const rectContains = (rect, left, top, scaleX = 1, scaleY = 1) => rect.left * scaleX <= left && left <= rect.left * scaleX + rect.width * scaleX &&
2948
+ rect.top * scaleY <= top && top <= rect.top * scaleY + rect.height * scaleY;
2948
2949
  /** @hidden */
2949
2950
  const rectContainsX = (rect, left, scaleX = 1) => rect.left * scaleX <= left && left <= rect.left * scaleX + rect.width * scaleX;
2950
2951
  /** @hidden */
@@ -12757,6 +12758,7 @@ class BaseSlotService {
12757
12758
  containerSize = 0;
12758
12759
  slotsChange = new EventEmitter();
12759
12760
  groups = [];
12761
+ schedulerElement = null;
12760
12762
  registerItem(component) {
12761
12763
  const group = this.itemGroup(component);
12762
12764
  group.registerItem(component);
@@ -12773,6 +12775,9 @@ class BaseSlotService {
12773
12775
  }
12774
12776
  }
12775
12777
  registerSlot(slot) {
12778
+ if (slot.nativeElement) {
12779
+ this.schedulerElement = slot.nativeElement.closest('.k-scheduler');
12780
+ }
12776
12781
  const group = this.slotGroup(slot);
12777
12782
  group.registerSlot(slot);
12778
12783
  }
@@ -12817,13 +12822,17 @@ class BaseSlotService {
12817
12822
  }
12818
12823
  return this.groups[index];
12819
12824
  }
12820
- calculateScaleX() {
12825
+ calculateScale(axis) {
12821
12826
  if (!isDocumentAvailable()) {
12822
12827
  return;
12823
12828
  }
12824
- const schedulerEl = document.querySelector('.k-scheduler');
12825
- const scaleX = schedulerEl.getBoundingClientRect().width / schedulerEl.offsetWidth;
12826
- return scaleX;
12829
+ const schedulerEl = this.schedulerElement?.closest('.k-scheduler');
12830
+ if (!schedulerEl) {
12831
+ return;
12832
+ }
12833
+ const bounds = schedulerEl.getBoundingClientRect();
12834
+ const scale = axis === 'x' ? bounds.width / schedulerEl.offsetWidth : bounds.height / schedulerEl.offsetHeight;
12835
+ return scale;
12827
12836
  }
12828
12837
  }
12829
12838
 
@@ -13161,11 +13170,13 @@ class MonthSlotService extends BaseSlotService {
13161
13170
  }
13162
13171
  slotByPosition(x, y) {
13163
13172
  let range;
13173
+ const scaleX = this.calculateScale('x');
13174
+ const scaleY = this.calculateScale('y');
13164
13175
  for (let i = 0; i < this.groups.length; i++) {
13165
13176
  const group = this.groups[i];
13166
- range = group.dayRanges.find(r => rectContains(r.rect, x, y, this.calculateScaleX()));
13177
+ range = group.dayRanges.find(r => rectContains(r.rect, x, y, scaleX, scaleY));
13167
13178
  if (range) {
13168
- return range.slots.find(slot => rectContains(slot.rect, x, y, this.calculateScaleX()));
13179
+ return range.slots.find(slot => rectContains(slot.rect, x, y, scaleX, scaleY));
13169
13180
  }
13170
13181
  }
13171
13182
  }
@@ -13187,9 +13198,11 @@ class MonthSlotService extends BaseSlotService {
13187
13198
  };
13188
13199
  }
13189
13200
  groupSlotByPosition(currentSlot, x, y) {
13190
- const range = this.groups[currentSlot.id.resourceIndex].dayRanges.find(r => rectContains(r.rect, x, y, this.calculateScaleX()));
13201
+ const scaleX = this.calculateScale('x');
13202
+ const scaleY = this.calculateScale('y');
13203
+ const range = this.groups[currentSlot.id.resourceIndex].dayRanges.find(r => rectContains(r.rect, x, y, scaleX, scaleY));
13191
13204
  if (range) {
13192
- return range.slots.find(slot => rectContains(slot.rect, x, y, this.calculateScaleX()));
13205
+ return range.slots.find(slot => rectContains(slot.rect, x, y, scaleX, scaleY));
13193
13206
  }
13194
13207
  }
13195
13208
  resizeRanges(currentSlot, task, resizeStart, offset) {
@@ -14063,19 +14076,21 @@ class BaseView {
14063
14076
  this.updateDragContainer(args);
14064
14077
  const eventRect = resizing.target.getBoundingClientRect();
14065
14078
  const handleOffset = 2;
14079
+ const pageOffsetX = args.pageX - args.clientX;
14080
+ const pageOffsetY = args.pageY - args.clientY;
14066
14081
  let pageX = args.pageX;
14067
14082
  let pageY = args.pageY;
14068
14083
  if (resizing.direction === 'w') {
14069
- pageX = eventRect.left + handleOffset;
14084
+ pageX = eventRect.left + pageOffsetX + handleOffset;
14070
14085
  }
14071
14086
  else if (resizing.direction === 'e') {
14072
- pageX = eventRect.right - handleOffset;
14087
+ pageX = eventRect.right + pageOffsetX - handleOffset;
14073
14088
  }
14074
14089
  else if (resizing.direction === 'n') {
14075
- pageY = eventRect.top + handleOffset;
14090
+ pageY = eventRect.top + pageOffsetY + handleOffset;
14076
14091
  }
14077
14092
  else if (resizing.direction === 's') {
14078
- pageY = eventRect.bottom - handleOffset;
14093
+ pageY = eventRect.bottom + pageOffsetY - handleOffset;
14079
14094
  }
14080
14095
  const { x, y } = this.coordinatesOffset(pageX, pageY);
14081
14096
  resizing.slot = this.slotByPosition(Math.ceil(x), Math.ceil(y), this.container);
@@ -14140,10 +14155,14 @@ class BaseView {
14140
14155
  }
14141
14156
  }
14142
14157
  coordinatesOffset(x, y, container = this.container, offset = this.containerOffset) {
14143
- const position = x - offset.left + container.scrollLeft;
14158
+ const schedulerEl = container?.closest('.k-scheduler');
14159
+ const schedulerRect = schedulerEl?.getBoundingClientRect();
14160
+ const scaleX = schedulerRect ? schedulerRect.width / schedulerEl.offsetWidth : 1;
14161
+ const scaleY = schedulerRect ? schedulerRect.height / schedulerEl.offsetHeight : 1;
14162
+ const position = x - offset.left + container.scrollLeft * scaleX;
14144
14163
  return {
14145
14164
  x: !this.localization.rtl ? position : this.slotService.containerSize - position,
14146
- y: y - offset.top + container.scrollTop
14165
+ y: y - offset.top + container.scrollTop * scaleY
14147
14166
  };
14148
14167
  }
14149
14168
  scrollContainer(callback, args) {
@@ -17089,6 +17108,7 @@ function addMinHeightOverflowEvents(sorted, slots, slotItems) {
17089
17108
  function initTimeColumns(slotKeys, slotItems) {
17090
17109
  // Break slots into groups with overlapping events.
17091
17110
  let columns = 0;
17111
+ let maxGroupColumns = 0;
17092
17112
  let groupSlots = [];
17093
17113
  slotKeys.forEach(key => {
17094
17114
  const { slot, events } = slotItems[key];
@@ -17185,14 +17205,24 @@ function initTimeColumns(slotKeys, slotItems) {
17185
17205
  event.columnIndex = maxColumn + 1;
17186
17206
  }
17187
17207
  }
17208
+ const slotColumnCount = events.reduce((maximumColumnCount, event) => {
17209
+ const eventColumnIndex = event.columnIndex;
17210
+ if (!isNumber(eventColumnIndex)) {
17211
+ return maximumColumnCount;
17212
+ }
17213
+ const eventColumnCount = eventColumnIndex + 1;
17214
+ return Math.max(maximumColumnCount, eventColumnCount);
17215
+ }, 0);
17216
+ maxGroupColumns = Math.max(maxGroupColumns, slotColumnCount);
17188
17217
  if (groupEnd) {
17189
- groupSlots.forEach(item => item.columns = columns);
17218
+ groupSlots.forEach(item => item.columns = Math.max(columns, maxGroupColumns));
17190
17219
  groupSlots = [];
17191
17220
  columns = 0;
17221
+ maxGroupColumns = 0;
17192
17222
  }
17193
17223
  });
17194
17224
  // The maximum number of overlapping events in the group is used to create the same number of columns.
17195
- groupSlots.forEach(slot => slot.columns = columns);
17225
+ groupSlots.forEach(slot => slot.columns = Math.max(columns, maxGroupColumns));
17196
17226
  }
17197
17227
  function findTimeRowIndex(events, event) {
17198
17228
  if (event.rowIndex !== undefined) {
@@ -17593,38 +17623,42 @@ class DayTimeSlotService extends BaseSlotService {
17593
17623
  slotByPosition(x, y, isDaySlot, includeDayRanges) {
17594
17624
  if (isDaySlot) {
17595
17625
  for (let i = 0; i < this.groups.length; i++) {
17596
- const foundRange = this.groups[i].dayRanges.find(r => rectContainsX(r.rect, x, this.calculateScaleX()));
17626
+ const foundRange = this.groups[i].dayRanges.find(r => rectContainsX(r.rect, x, this.calculateScale('x')));
17597
17627
  if (foundRange) {
17598
- return foundRange.slots.find(slot => rectContainsX(slot.rect, x, this.calculateScaleX()));
17628
+ return foundRange.slots.find(slot => rectContainsX(slot.rect, x, this.calculateScale('x')));
17599
17629
  }
17600
17630
  }
17601
17631
  }
17602
17632
  else {
17633
+ const scaleX = this.calculateScale('x');
17634
+ const scaleY = this.calculateScale('y');
17603
17635
  for (let i = 0; i < this.groups.length; i++) {
17604
17636
  let range;
17605
17637
  if (includeDayRanges) {
17606
- range = this.groups[i].dayRanges.find(r => rectContains(r.rect, x, y, this.calculateScaleX()));
17638
+ range = this.groups[i].dayRanges.find(r => rectContains(r.rect, x, y, scaleX, scaleY));
17607
17639
  }
17608
17640
  if (!range) {
17609
- range = this.groups[i].timeRanges.find(r => rectContains(r.rect, x, y, this.calculateScaleX()));
17641
+ range = this.groups[i].timeRanges.find(r => rectContains(r.rect, x, y, scaleX, scaleY));
17610
17642
  }
17611
17643
  if (range) {
17612
- return range.slots.find(slot => rectContains(slot.rect, x, y, this.calculateScaleX()));
17644
+ return range.slots.find(slot => rectContains(slot.rect, x, y, scaleX, scaleY));
17613
17645
  }
17614
17646
  }
17615
17647
  }
17616
17648
  }
17617
17649
  groupSlotByPosition(currentSlot, x, y) {
17618
17650
  const group = this.groups[currentSlot.id.resourceIndex];
17651
+ const scaleX = this.calculateScale('x');
17652
+ const scaleY = this.calculateScale('y');
17619
17653
  let range;
17620
17654
  if (currentSlot.isDaySlot) {
17621
- range = group.dayRanges.find(r => rectContains(r.rect, x, y, this.calculateScaleX()));
17655
+ range = group.dayRanges.find(r => rectContains(r.rect, x, y, scaleX, scaleY));
17622
17656
  }
17623
17657
  else {
17624
- range = group.timeRanges.find(r => rectContains(r.rect, x, y, this.calculateScaleX()));
17658
+ range = group.timeRanges.find(r => rectContains(r.rect, x, y, scaleX, scaleY));
17625
17659
  }
17626
17660
  if (range) {
17627
- return range.slots.find(slot => rectContains(slot.rect, x, y, this.calculateScaleX()));
17661
+ return range.slots.find(slot => rectContains(slot.rect, x, y, scaleX, scaleY));
17628
17662
  }
17629
17663
  }
17630
17664
  dragRanges(currentSlot, offset, timeRanges) {
package/index.d.ts CHANGED
@@ -6143,6 +6143,7 @@ interface SlotDirective {
6143
6143
  rect: Rect;
6144
6144
  id: SlotID;
6145
6145
  key: string;
6146
+ nativeElement?: HTMLElement;
6146
6147
  invalidate(): void;
6147
6148
  }
6148
6149
  /**
@@ -6174,6 +6175,7 @@ declare abstract class BaseSlotService {
6174
6175
  containerSize: number;
6175
6176
  slotsChange: EventEmitter<any>;
6176
6177
  protected groups: ResourceGroup[];
6178
+ private schedulerElement;
6177
6179
  abstract forEachSlot(callback: any): void;
6178
6180
  abstract createGroup(index: number): ResourceGroup;
6179
6181
  abstract resizeRanges(currentSlot: any, task: any, resizeStart: boolean, offset?: any): any;
@@ -6187,7 +6189,7 @@ declare abstract class BaseSlotService {
6187
6189
  protected clearEmptyGroups(): void;
6188
6190
  protected itemGroup(item: ViewItem): ResourceGroup;
6189
6191
  protected slotGroup(slot: SlotDirective): ResourceGroup;
6190
- protected calculateScaleX(): number;
6192
+ protected calculateScale(axis: 'x' | 'y'): number;
6191
6193
  }
6192
6194
 
6193
6195
  /** @hidden */
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1792070988,
11
- "version": "25.4.0-develop.4",
10
+ "publishDate": 1792137000,
11
+ "version": "25.4.0-develop.6",
12
12
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-scheduler",
3
- "version": "25.4.0-develop.4",
3
+ "version": "25.4.0-develop.6",
4
4
  "description": "Kendo UI Scheduler Angular - Outlook or Google-style angular scheduler calendar. Full-featured and customizable embedded scheduling from the creator developers trust for professional UI components.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -80,7 +80,7 @@
80
80
  "package": {
81
81
  "productName": "Kendo UI for Angular",
82
82
  "productCode": "KENDOUIANGULAR",
83
- "publishDate": 1792070988,
83
+ "publishDate": 1792137000,
84
84
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
85
85
  }
86
86
  },
@@ -93,23 +93,23 @@
93
93
  "@progress/kendo-data-query": "^1.7.3",
94
94
  "@progress/kendo-drawing": "^1.25.0",
95
95
  "@progress/kendo-licensing": "^1.11.0",
96
- "@progress/kendo-angular-tooltip": "25.4.0-develop.4",
97
- "@progress/kendo-angular-buttons": "25.4.0-develop.4",
98
- "@progress/kendo-angular-common": "25.4.0-develop.4",
99
- "@progress/kendo-angular-dateinputs": "25.4.0-develop.4",
100
- "@progress/kendo-angular-dialog": "25.4.0-develop.4",
101
- "@progress/kendo-angular-dropdowns": "25.4.0-develop.4",
102
- "@progress/kendo-angular-icons": "25.4.0-develop.4",
103
- "@progress/kendo-angular-inputs": "25.4.0-develop.4",
104
- "@progress/kendo-angular-intl": "25.4.0-develop.4",
105
- "@progress/kendo-angular-l10n": "25.4.0-develop.4",
106
- "@progress/kendo-angular-label": "25.4.0-develop.4",
107
- "@progress/kendo-angular-popup": "25.4.0-develop.4",
96
+ "@progress/kendo-angular-tooltip": "25.4.0-develop.6",
97
+ "@progress/kendo-angular-buttons": "25.4.0-develop.6",
98
+ "@progress/kendo-angular-common": "25.4.0-develop.6",
99
+ "@progress/kendo-angular-dateinputs": "25.4.0-develop.6",
100
+ "@progress/kendo-angular-dialog": "25.4.0-develop.6",
101
+ "@progress/kendo-angular-dropdowns": "25.4.0-develop.6",
102
+ "@progress/kendo-angular-icons": "25.4.0-develop.6",
103
+ "@progress/kendo-angular-inputs": "25.4.0-develop.6",
104
+ "@progress/kendo-angular-intl": "25.4.0-develop.6",
105
+ "@progress/kendo-angular-l10n": "25.4.0-develop.6",
106
+ "@progress/kendo-angular-label": "25.4.0-develop.6",
107
+ "@progress/kendo-angular-popup": "25.4.0-develop.6",
108
108
  "rxjs": "^6.5.3 || ^7.0.0"
109
109
  },
110
110
  "dependencies": {
111
111
  "tslib": "^2.3.1",
112
- "@progress/kendo-angular-schematics": "25.4.0-develop.4",
112
+ "@progress/kendo-angular-schematics": "25.4.0-develop.6",
113
113
  "@progress/kendo-date-math": "^1.3.2",
114
114
  "@progress/kendo-draggable": "^3.0.2",
115
115
  "@progress/kendo-file-saver": "^1.0.7",
@@ -9,10 +9,10 @@ const schematics_1 = require("@angular-devkit/schematics");
9
9
  function default_1(options) {
10
10
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'SchedulerModule', package: 'scheduler', peerDependencies: {
11
11
  // peer deps of the dropdowns
12
- '@progress/kendo-angular-treeview': '25.4.0-develop.4',
13
- '@progress/kendo-angular-navigation': '25.4.0-develop.4',
12
+ '@progress/kendo-angular-treeview': '25.4.0-develop.6',
13
+ '@progress/kendo-angular-navigation': '25.4.0-develop.6',
14
14
  // peer dependency of kendo-angular-inputs
15
- '@progress/kendo-angular-dialog': '25.4.0-develop.4',
15
+ '@progress/kendo-angular-dialog': '25.4.0-develop.6',
16
16
  // peer dependency of kendo-angular-icons
17
17
  '@progress/kendo-svg-icons': '^4.0.0'
18
18
  } });