@progress/kendo-vue-scheduler 3.0.9-dev.202202281506 → 3.0.9-dev.202203011321

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.
@@ -172,10 +172,7 @@ var SchedulerVue2 = {
172
172
  },
173
173
  watch: {
174
174
  view: function view(newName) {
175
- this.ks.activeViewName = newName;
176
- this.ks.view = this.views.find(function (currentView) {
177
- return currentView.name === newName;
178
- }) || this.views[0] || h(DayView);
175
+ this.updatePassedState(newName);
179
176
  }
180
177
  },
181
178
  // @ts-ignore
@@ -208,6 +205,7 @@ var SchedulerVue2 = {
208
205
  var viewComponent = this.getViewComponentByName(this.ks.activeViewName || view.name);
209
206
 
210
207
  var viewProps = __assign(__assign(__assign({}, this.$props), this.ks.view), {
208
+ showWorkHours: this.ks.showWorkHours,
211
209
  dataItems: undefined,
212
210
  views: undefined,
213
211
  defaultDate: undefined,
@@ -1083,20 +1081,7 @@ var SchedulerVue2 = {
1083
1081
  }
1084
1082
  },
1085
1083
  handleActiveViewNameChange: function handleActiveViewNameChange(newView, event) {
1086
- this.ks.activeViewName = newView;
1087
- this.ks.view = this.views.find(function (currentView) {
1088
- return currentView.name === newView;
1089
- }) || this.views[0] || h(DayView);
1090
- this.ks.dateFormat = this.getViewPropValue(this.ks.view, 'selectedDateFormat', newView) || DEFAULT_DATE_FORMAT;
1091
- this.ks.shortDateFormat = this.getViewPropValue(this.ks.view, 'selectedShortDateFormat', newView) || DEFAULT_SHORT_DATE_FORMAT;
1092
- this.ks.dateRange = this.getViewComponentByName(newView).props.dateRange.default()({
1093
- intl: this.intl,
1094
- date: this.ks.currentDate,
1095
- timezone: this.$props.timezone,
1096
- numberOfDays: this.getViewPropValue(this.ks.view, 'numberOfDays', this.ks.activeViewName),
1097
- workWeekStart: this.getViewPropValue(this.ks.view, 'workWeekStart', this.ks.activeViewName) || this.intl.firstDay(),
1098
- workWeekEnd: this.getViewPropValue(this.ks.view, 'workWeekEnd', this.ks.activeViewName) || (this.intl.firstDay() + this.getViewPropValue(this.ks.view, 'numberOfDays', this.ks.activeViewName)) % 6
1099
- });
1084
+ this.updatePassedState(newView);
1100
1085
  this.$emit('viewchange', __assign(__assign({
1101
1086
  viewName: newView
1102
1087
  }, event), {
@@ -1152,7 +1137,21 @@ var SchedulerVue2 = {
1152
1137
  },
1153
1138
  setDate: function setDate(newDate, event) {
1154
1139
  this.ks.currentDate = newDate;
1155
- this.ks.dateRange = this.getViewComponentByName(this.ks.activeViewName).props.dateRange.default()({
1140
+ this.updatePassedState();
1141
+ this.$emit('datechange', {
1142
+ date: newDate,
1143
+ event: event
1144
+ });
1145
+ },
1146
+ updatePassedState: function updatePassedState(newViewName) {
1147
+ var newView = newViewName || this.ks.activeViewName;
1148
+ this.ks.activeViewName = newView;
1149
+ this.ks.view = this.views.find(function (currentView) {
1150
+ return currentView.name === newView;
1151
+ }) || this.views[0] || h(DayView);
1152
+ this.ks.dateFormat = this.getViewPropValue(this.ks.view, 'selectedDateFormat', newView) || DEFAULT_DATE_FORMAT;
1153
+ this.ks.shortDateFormat = this.getViewPropValue(this.ks.view, 'selectedShortDateFormat', newView) || DEFAULT_SHORT_DATE_FORMAT;
1154
+ this.ks.dateRange = this.getViewComponentByName(newView).props.dateRange.default()({
1156
1155
  intl: this.intl,
1157
1156
  date: this.ks.currentDate,
1158
1157
  timezone: this.$props.timezone,
@@ -1160,10 +1159,6 @@ var SchedulerVue2 = {
1160
1159
  workWeekStart: this.getViewPropValue(this.ks.view, 'workWeekStart', this.ks.activeViewName) || this.intl.firstDay(),
1161
1160
  workWeekEnd: this.getViewPropValue(this.ks.view, 'workWeekEnd', this.ks.activeViewName) || (this.intl.firstDay() + this.getViewPropValue(this.ks.view, 'numberOfDays', this.ks.activeViewName)) % 6
1162
1161
  });
1163
- this.$emit('datechange', {
1164
- date: newDate,
1165
- event: event
1166
- });
1167
1162
  }
1168
1163
  }
1169
1164
  };
@@ -95,6 +95,7 @@ var ViewSelectorListVue2 = {
95
95
  items: views.map(function (v) {
96
96
  return __assign(__assign({}, v.props), {
97
97
  selected: v.name === this.ks.activeViewName,
98
+ name: v.name,
98
99
  title: v.title || v.name
99
100
  });
100
101
  }, this),
@@ -107,6 +108,7 @@ var ViewSelectorListVue2 = {
107
108
  items: views.map(function (v) {
108
109
  return __assign(__assign({}, v.props), {
109
110
  selected: v.name === this.ks.activeViewName,
111
+ name: v.name,
110
112
  title: v.title || v.name
111
113
  });
112
114
  }, this),
@@ -111,6 +111,13 @@ var SchedulerViewItemVue2 = {
111
111
  updated: function updated() {
112
112
  this.align();
113
113
  this.position();
114
+
115
+ if (!this.ks.scheduler || this.observer) {
116
+ return;
117
+ }
118
+
119
+ this.observer = new window.ResizeObserver(this.handleResize);
120
+ this.observer.observe(this.ks.scheduler);
114
121
  },
115
122
  destroyed: !!gh ? undefined : function () {
116
123
  if (this.observer) {
@@ -316,7 +323,13 @@ var SchedulerViewItemVue2 = {
316
323
  return;
317
324
  }
318
325
 
319
- var firstSlot = first(slots);
326
+ var firstSlot = first(slots.sort(function (a, b) {
327
+ if (a.$props.start && b.$props.start) {
328
+ return a.$props.start.getTime() - b.$props.start.getTime();
329
+ }
330
+
331
+ return true;
332
+ }));
320
333
 
321
334
  if (!firstSlot) {
322
335
  return;
@@ -360,7 +373,10 @@ var SchedulerViewItemVue2 = {
360
373
  var rect = getRect(element);
361
374
  siblingsPerSlot.forEach(function (slot) {
362
375
  var currentOffset = 0;
363
- slot.forEach(function (current) {
376
+ var currentSlot = slot.sort(function (a, b) {
377
+ return a.$props.order - b.$props.order;
378
+ });
379
+ currentSlot.forEach(function (current) {
364
380
  if (intersects(current.$props.start, current.$props.end, _this.$props.start, _this.$props.end) && !(_this.$props.dragHint || _this.$props.resizeHint) && current.$props.maxSiblingsPerSlot && current.$props.maxSiblingsPerSlot > mostSiblingsInSlot && current.$el !== element) {
365
381
  mostSiblingsInSlot = current.$props.maxSiblingsPerSlot;
366
382
  }
@@ -368,7 +384,7 @@ var SchedulerViewItemVue2 = {
368
384
  var currentRect = getRect(current.$el);
369
385
 
370
386
  if (current.$props.order !== null && current.$props.order < order) {
371
- currentOffset = currentRect.top + currentRect.height - rect.top - BORDER_WIDTH * order + ITEMS_SPACING;
387
+ currentOffset = (currentRect.top || rect.top) + currentRect.height - rect.top - BORDER_WIDTH * order + ITEMS_SPACING;
372
388
  }
373
389
  });
374
390
 
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-vue-scheduler',
6
6
  productName: 'Kendo UI for Vue',
7
7
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
8
- publishDate: 1646060571,
8
+ publishDate: 1646140644,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
11
11
  };
@@ -126,6 +126,8 @@ var AgendaViewVue2 = {
126
126
  groups: this.ks.groups,
127
127
  ranges: this.ranges
128
128
  });
129
+ mapItemsToSlots(items, this.agendaSlots, true);
130
+ mapSlotsToItems(items, this.agendaSlots, true);
129
131
  return items;
130
132
  }
131
133
  },
@@ -145,22 +147,18 @@ var AgendaViewVue2 = {
145
147
  var EditSlot = this.$props.editSlot || SchedulerEditSlot;
146
148
  var intl = provideIntlService(this);
147
149
  var localization = provideLocalizationService(this);
148
- var items = this.items;
149
- var agendaSlots = this.agendaSlots;
150
- mapItemsToSlots(items, agendaSlots, true);
151
- mapSlotsToItems(items, agendaSlots, true);
152
150
  return (// @ts-ignore function children
153
151
  h(BaseView, {
154
152
  id: this.$props.id,
155
153
  attrs: this.v3 ? undefined : {
156
154
  id: this.$props.id,
157
155
  props: this.$props,
158
- baseSlots: items,
156
+ baseSlots: this.items,
159
157
  ranges: this.ranges
160
158
  },
161
159
  "class": 'k-scheduler-agendaview',
162
160
  props: this.$props,
163
- baseSlots: items,
161
+ baseSlots: this.items,
164
162
  ranges: this.ranges
165
163
  }, this.v3 ? function () {
166
164
  return [h("div", {
@@ -187,15 +185,15 @@ var AgendaViewVue2 = {
187
185
  nested: true
188
186
  }, _this.v3 ? function () {
189
187
  return [h(AgendaViewBody, {
190
- agendaSlots: agendaSlots,
188
+ agendaSlots: _this.agendaSlots,
191
189
  attrs: _this.v3 ? undefined : {
192
- agendaSlots: agendaSlots
190
+ agendaSlots: _this.agendaSlots
193
191
  }
194
192
  })];
195
193
  } : [h(AgendaViewBody, {
196
- agendaSlots: agendaSlots,
194
+ agendaSlots: _this.agendaSlots,
197
195
  attrs: _this.v3 ? undefined : {
198
- agendaSlots: agendaSlots
196
+ agendaSlots: _this.agendaSlots
199
197
  }
200
198
  })])];
201
199
  } : [h("div", {
@@ -220,15 +218,15 @@ var AgendaViewVue2 = {
220
218
  nested: true
221
219
  }, _this.v3 ? function () {
222
220
  return [h(AgendaViewBody, {
223
- agendaSlots: agendaSlots,
221
+ agendaSlots: _this.agendaSlots,
224
222
  attrs: _this.v3 ? undefined : {
225
- agendaSlots: agendaSlots
223
+ agendaSlots: _this.agendaSlots
226
224
  }
227
225
  })];
228
226
  } : [h(AgendaViewBody, {
229
- agendaSlots: agendaSlots,
227
+ agendaSlots: _this.agendaSlots,
230
228
  attrs: _this.v3 ? undefined : {
231
- agendaSlots: agendaSlots
229
+ agendaSlots: _this.agendaSlots
232
230
  }
233
231
  })])])
234
232
  );
@@ -229,6 +229,8 @@ var MultiDayViewVue2 = {
229
229
  groups: this.ks.groups,
230
230
  ranges: this.dayRanges
231
231
  });
232
+ mapItemsToSlots(dayItems, this.daySlots, false);
233
+ mapSlotsToItems(dayItems, this.daySlots, false);
232
234
  return dayItems;
233
235
  },
234
236
  timeItems: function timeItems() {
@@ -242,6 +244,8 @@ var MultiDayViewVue2 = {
242
244
  }).filter(function (item) {
243
245
  return _this.viewStart.getTime() === _this.viewEnd.getTime() || isInTimeRange(item.zonedStart, _this.viewStart, _this.viewEnd) || isInTimeRange(item.zonedEnd, _this.viewStart, _this.viewEnd) || isInTimeRange(new Date(item.zonedEnd.getTime() - (item.zonedEnd.getTime() - item.zonedStart.getTime()) / 2), _this.viewStart, _this.viewEnd);
244
246
  });
247
+ mapItemsToSlots(timeItems, this.timeSlots, false);
248
+ mapSlotsToItems(timeItems, this.timeSlots, false);
245
249
  return timeItems;
246
250
  }
247
251
  },
@@ -280,10 +284,6 @@ var MultiDayViewVue2 = {
280
284
  var timeItems = this.timeItems;
281
285
  var daySlots = this.daySlots;
282
286
  var timeSlots = this.timeSlots;
283
- mapItemsToSlots(dayItems, daySlots, false);
284
- mapSlotsToItems(dayItems, daySlots, false);
285
- mapItemsToSlots(timeItems, timeSlots, false);
286
- mapSlotsToItems(timeItems, timeSlots, false);
287
287
  return (// @ts-ignore function children
288
288
  h(BaseView, {
289
289
  id: this.$props.id,
@@ -105,6 +105,8 @@ var MonthViewVue2 = {
105
105
  groups: this.ks.groups,
106
106
  ranges: this.ranges
107
107
  });
108
+ mapItemsToSlots(items, this.monthSlots, false);
109
+ mapSlotsToItems(items, this.monthSlots, false);
108
110
  return items;
109
111
  }
110
112
  },
@@ -130,9 +132,7 @@ var MonthViewVue2 = {
130
132
  var EditItem = this.$props.editItem || SchedulerEditItem;
131
133
  var EditSlot = this.$props.editSlot || SchedulerEditSlot;
132
134
  var items = this.items;
133
- var monthSlots = this.monthSlots;
134
- mapItemsToSlots(items, monthSlots, false);
135
- mapSlotsToItems(items, monthSlots, false); // const [dataItems] = useSchedulerDataContext();
135
+ var monthSlots = this.monthSlots; // const [dataItems] = useSchedulerDataContext();
136
136
  // const [, setDate] = useSchedulerDateContext();
137
137
  // const [, setView] = useSchedulerActiveViewContext();
138
138
  // const views = useSchedulerViewsContext();