@progress/kendo-angular-scheduler 25.4.0-develop.5 → 25.4.0-develop.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.
@@ -44,8 +44,8 @@ const packageMetadata = {
44
44
  productName: 'Kendo UI for Angular',
45
45
  productCode: 'KENDOUIANGULAR',
46
46
  productCodes: ['KENDOUIANGULAR'],
47
- publishDate: 1792080277,
48
- version: '25.4.0-develop.5',
47
+ publishDate: 1792397222,
48
+ version: '25.4.0-develop.7',
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) {
@@ -17604,38 +17623,42 @@ class DayTimeSlotService extends BaseSlotService {
17604
17623
  slotByPosition(x, y, isDaySlot, includeDayRanges) {
17605
17624
  if (isDaySlot) {
17606
17625
  for (let i = 0; i < this.groups.length; i++) {
17607
- 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')));
17608
17627
  if (foundRange) {
17609
- return foundRange.slots.find(slot => rectContainsX(slot.rect, x, this.calculateScaleX()));
17628
+ return foundRange.slots.find(slot => rectContainsX(slot.rect, x, this.calculateScale('x')));
17610
17629
  }
17611
17630
  }
17612
17631
  }
17613
17632
  else {
17633
+ const scaleX = this.calculateScale('x');
17634
+ const scaleY = this.calculateScale('y');
17614
17635
  for (let i = 0; i < this.groups.length; i++) {
17615
17636
  let range;
17616
17637
  if (includeDayRanges) {
17617
- 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));
17618
17639
  }
17619
17640
  if (!range) {
17620
- 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));
17621
17642
  }
17622
17643
  if (range) {
17623
- 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));
17624
17645
  }
17625
17646
  }
17626
17647
  }
17627
17648
  }
17628
17649
  groupSlotByPosition(currentSlot, x, y) {
17629
17650
  const group = this.groups[currentSlot.id.resourceIndex];
17651
+ const scaleX = this.calculateScale('x');
17652
+ const scaleY = this.calculateScale('y');
17630
17653
  let range;
17631
17654
  if (currentSlot.isDaySlot) {
17632
- 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));
17633
17656
  }
17634
17657
  else {
17635
- 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));
17636
17659
  }
17637
17660
  if (range) {
17638
- 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));
17639
17662
  }
17640
17663
  }
17641
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": 1792080277,
11
- "version": "25.4.0-develop.5",
10
+ "publishDate": 1792397222,
11
+ "version": "25.4.0-develop.7",
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.5",
3
+ "version": "25.4.0-develop.7",
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": 1792080277,
83
+ "publishDate": 1792397222,
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.5",
97
- "@progress/kendo-angular-buttons": "25.4.0-develop.5",
98
- "@progress/kendo-angular-common": "25.4.0-develop.5",
99
- "@progress/kendo-angular-dateinputs": "25.4.0-develop.5",
100
- "@progress/kendo-angular-dialog": "25.4.0-develop.5",
101
- "@progress/kendo-angular-dropdowns": "25.4.0-develop.5",
102
- "@progress/kendo-angular-icons": "25.4.0-develop.5",
103
- "@progress/kendo-angular-inputs": "25.4.0-develop.5",
104
- "@progress/kendo-angular-intl": "25.4.0-develop.5",
105
- "@progress/kendo-angular-l10n": "25.4.0-develop.5",
106
- "@progress/kendo-angular-label": "25.4.0-develop.5",
107
- "@progress/kendo-angular-popup": "25.4.0-develop.5",
96
+ "@progress/kendo-angular-tooltip": "25.4.0-develop.7",
97
+ "@progress/kendo-angular-buttons": "25.4.0-develop.7",
98
+ "@progress/kendo-angular-common": "25.4.0-develop.7",
99
+ "@progress/kendo-angular-dateinputs": "25.4.0-develop.7",
100
+ "@progress/kendo-angular-dialog": "25.4.0-develop.7",
101
+ "@progress/kendo-angular-dropdowns": "25.4.0-develop.7",
102
+ "@progress/kendo-angular-icons": "25.4.0-develop.7",
103
+ "@progress/kendo-angular-inputs": "25.4.0-develop.7",
104
+ "@progress/kendo-angular-intl": "25.4.0-develop.7",
105
+ "@progress/kendo-angular-l10n": "25.4.0-develop.7",
106
+ "@progress/kendo-angular-label": "25.4.0-develop.7",
107
+ "@progress/kendo-angular-popup": "25.4.0-develop.7",
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.5",
112
+ "@progress/kendo-angular-schematics": "25.4.0-develop.7",
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.5',
13
- '@progress/kendo-angular-navigation': '25.4.0-develop.5',
12
+ '@progress/kendo-angular-treeview': '25.4.0-develop.7',
13
+ '@progress/kendo-angular-navigation': '25.4.0-develop.7',
14
14
  // peer dependency of kendo-angular-inputs
15
- '@progress/kendo-angular-dialog': '25.4.0-develop.5',
15
+ '@progress/kendo-angular-dialog': '25.4.0-develop.7',
16
16
  // peer dependency of kendo-angular-icons
17
17
  '@progress/kendo-svg-icons': '^4.0.0'
18
18
  } });