@progress/kendo-angular-scheduler 16.3.0-develop.12 → 16.3.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.
@@ -19,3 +19,7 @@ export declare function areEqual(value1: any, value2: any): boolean;
19
19
  * @hidden
20
20
  */
21
21
  export declare function seriesDate(head: any, occurrence: any, current: any, field: string): Date;
22
+ /**
23
+ * @hidden
24
+ */
25
+ export declare function updateRecurrenceRule(valueSrc: any, valueGoal: any): string;
@@ -11,7 +11,7 @@ import { DialogsService } from '../editing/dialogs.service';
11
11
  import { EditMode, CrudOperation } from '../types';
12
12
  import { AddEvent } from '../events';
13
13
  import { groupResources, assignValues, clone, setField, getField } from '../common/util';
14
- import { diff, areEqual, seriesDate } from './utils';
14
+ import { diff, areEqual, seriesDate, updateRecurrenceRule } from './utils';
15
15
  import { FocusService } from '../navigation';
16
16
  import * as i0 from "@angular/core";
17
17
  import * as i1 from "../scheduler.component";
@@ -198,6 +198,12 @@ export class EditingDirectiveBase {
198
198
  let target = dataItem;
199
199
  if (result === EditMode.Series) {
200
200
  target = this.editService.findRecurrenceMaster(dataItem);
201
+ if (dataItem.recurrenceRule) {
202
+ const newRecurrenceRule = updateRecurrenceRule(dataItem, value);
203
+ if (newRecurrenceRule !== dataItem?.recurrenceRule) {
204
+ setField(value, modelFields.recurrenceRule, newRecurrenceRule);
205
+ }
206
+ }
201
207
  setField(value, modelFields.start, seriesDate(target, dataItem, value, modelFields.start));
202
208
  setField(value, modelFields.end, seriesDate(target, dataItem, value, modelFields.end));
203
209
  }
@@ -3,6 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { getField } from '../common/util';
6
+ import { parseRule, serializeRule } from '@progress/kendo-recurrence';
6
7
  /**
7
8
  * @hidden
8
9
  */
@@ -63,3 +64,44 @@ export function seriesDate(head, occurrence, current, field) {
63
64
  });
64
65
  return new Date(...values);
65
66
  }
67
+ /**
68
+ * @hidden
69
+ */
70
+ export function updateRecurrenceRule(valueSrc, valueGoal) {
71
+ const rrule = parseRule({ recurrenceRule: valueSrc.recurrenceRule });
72
+ // parseRule sets weekStart to 0 if not present which then adds it to the serialized rule
73
+ if (!valueSrc.recurrenceRule.includes("WKST")) {
74
+ rrule.weekStart = undefined;
75
+ }
76
+ if (valueSrc.start?.getDate() !== valueGoal.start?.getDate()) {
77
+ if (rrule.byYearDay?.length > 0) {
78
+ // when the event is recurring on more than one day of the year
79
+ const itemIndex = rrule.byYearDay.findIndex(yearDay => yearDay === valueSrc.start?.getDate());
80
+ if (itemIndex !== -1) {
81
+ rrule.byYearDay[itemIndex] = valueGoal.start?.getDate();
82
+ }
83
+ }
84
+ if (rrule.byMonthDay?.length > 0) {
85
+ // when the event is recurring on more than one day of the month
86
+ const itemIndex = rrule.byMonthDay.findIndex(monthDay => monthDay === valueSrc.start?.getDate());
87
+ if (itemIndex !== -1) {
88
+ rrule.byMonthDay[itemIndex] = valueGoal.start?.getDate();
89
+ }
90
+ }
91
+ }
92
+ if (valueSrc.start?.getDay() !== valueGoal.start?.getDay() && rrule.byWeekDay?.length > 0) {
93
+ // when the event is recurring on more than one day of the week
94
+ const itemIndex = rrule.byWeekDay.findIndex(weekDayRule => weekDayRule.day === valueSrc.start?.getDay());
95
+ if (itemIndex !== -1) {
96
+ rrule.byWeekDay[itemIndex].day = valueGoal.start?.getDay();
97
+ }
98
+ }
99
+ if (valueSrc.start?.getMonth() !== valueGoal.start?.getMonth() && rrule.byMonth?.length > 0) {
100
+ // when the event is recurring on more than one month of the year
101
+ const itemIndex = rrule.byMonth.findIndex(month => month === valueSrc.start?.getMonth());
102
+ if (itemIndex !== -1) {
103
+ rrule.byMonth[itemIndex] = valueGoal.start?.getMonth();
104
+ }
105
+ }
106
+ return serializeRule(rrule);
107
+ }
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-scheduler',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1718830091,
13
- version: '16.3.0-develop.12',
12
+ publishDate: 1718872488,
13
+ version: '16.3.0-develop.13',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };
@@ -50,8 +50,8 @@ const packageMetadata = {
50
50
  name: '@progress/kendo-angular-scheduler',
51
51
  productName: 'Kendo UI for Angular',
52
52
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
53
- publishDate: 1718830091,
54
- version: '16.3.0-develop.12',
53
+ publishDate: 1718872488,
54
+ version: '16.3.0-develop.13',
55
55
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
56
56
  };
57
57
 
@@ -16919,6 +16919,48 @@ function seriesDate(head, occurrence, current, field) {
16919
16919
  });
16920
16920
  return new Date(...values);
16921
16921
  }
16922
+ /**
16923
+ * @hidden
16924
+ */
16925
+ function updateRecurrenceRule(valueSrc, valueGoal) {
16926
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
16927
+ const rrule = parseRule({ recurrenceRule: valueSrc.recurrenceRule });
16928
+ // parseRule sets weekStart to 0 if not present which then adds it to the serialized rule
16929
+ if (!valueSrc.recurrenceRule.includes("WKST")) {
16930
+ rrule.weekStart = undefined;
16931
+ }
16932
+ if (((_a = valueSrc.start) === null || _a === void 0 ? void 0 : _a.getDate()) !== ((_b = valueGoal.start) === null || _b === void 0 ? void 0 : _b.getDate())) {
16933
+ if (((_c = rrule.byYearDay) === null || _c === void 0 ? void 0 : _c.length) > 0) {
16934
+ // when the event is recurring on more than one day of the year
16935
+ const itemIndex = rrule.byYearDay.findIndex(yearDay => { var _a; return yearDay === ((_a = valueSrc.start) === null || _a === void 0 ? void 0 : _a.getDate()); });
16936
+ if (itemIndex !== -1) {
16937
+ rrule.byYearDay[itemIndex] = (_d = valueGoal.start) === null || _d === void 0 ? void 0 : _d.getDate();
16938
+ }
16939
+ }
16940
+ if (((_e = rrule.byMonthDay) === null || _e === void 0 ? void 0 : _e.length) > 0) {
16941
+ // when the event is recurring on more than one day of the month
16942
+ const itemIndex = rrule.byMonthDay.findIndex(monthDay => { var _a; return monthDay === ((_a = valueSrc.start) === null || _a === void 0 ? void 0 : _a.getDate()); });
16943
+ if (itemIndex !== -1) {
16944
+ rrule.byMonthDay[itemIndex] = (_f = valueGoal.start) === null || _f === void 0 ? void 0 : _f.getDate();
16945
+ }
16946
+ }
16947
+ }
16948
+ if (((_g = valueSrc.start) === null || _g === void 0 ? void 0 : _g.getDay()) !== ((_h = valueGoal.start) === null || _h === void 0 ? void 0 : _h.getDay()) && ((_j = rrule.byWeekDay) === null || _j === void 0 ? void 0 : _j.length) > 0) {
16949
+ // when the event is recurring on more than one day of the week
16950
+ const itemIndex = rrule.byWeekDay.findIndex(weekDayRule => { var _a; return weekDayRule.day === ((_a = valueSrc.start) === null || _a === void 0 ? void 0 : _a.getDay()); });
16951
+ if (itemIndex !== -1) {
16952
+ rrule.byWeekDay[itemIndex].day = (_k = valueGoal.start) === null || _k === void 0 ? void 0 : _k.getDay();
16953
+ }
16954
+ }
16955
+ if (((_l = valueSrc.start) === null || _l === void 0 ? void 0 : _l.getMonth()) !== ((_m = valueGoal.start) === null || _m === void 0 ? void 0 : _m.getMonth()) && ((_o = rrule.byMonth) === null || _o === void 0 ? void 0 : _o.length) > 0) {
16956
+ // when the event is recurring on more than one month of the year
16957
+ const itemIndex = rrule.byMonth.findIndex(month => { var _a; return month === ((_a = valueSrc.start) === null || _a === void 0 ? void 0 : _a.getMonth()); });
16958
+ if (itemIndex !== -1) {
16959
+ rrule.byMonth[itemIndex] = (_p = valueGoal.start) === null || _p === void 0 ? void 0 : _p.getMonth();
16960
+ }
16961
+ }
16962
+ return serializeRule(rrule);
16963
+ }
16922
16964
 
16923
16965
  /**
16924
16966
  * @hidden
@@ -17100,6 +17142,12 @@ class EditingDirectiveBase {
17100
17142
  let target = dataItem;
17101
17143
  if (result === EditMode.Series) {
17102
17144
  target = this.editService.findRecurrenceMaster(dataItem);
17145
+ if (dataItem.recurrenceRule) {
17146
+ const newRecurrenceRule = updateRecurrenceRule(dataItem, value);
17147
+ if (newRecurrenceRule !== (dataItem === null || dataItem === void 0 ? void 0 : dataItem.recurrenceRule)) {
17148
+ setField(value, modelFields.recurrenceRule, newRecurrenceRule);
17149
+ }
17150
+ }
17103
17151
  setField(value, modelFields.start, seriesDate(target, dataItem, value, modelFields.start));
17104
17152
  setField(value, modelFields.end, seriesDate(target, dataItem, value, modelFields.end));
17105
17153
  }
@@ -50,8 +50,8 @@ const packageMetadata = {
50
50
  name: '@progress/kendo-angular-scheduler',
51
51
  productName: 'Kendo UI for Angular',
52
52
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
53
- publishDate: 1718830091,
54
- version: '16.3.0-develop.12',
53
+ publishDate: 1718872488,
54
+ version: '16.3.0-develop.13',
55
55
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
56
56
  };
57
57
 
@@ -16870,6 +16870,47 @@ function seriesDate(head, occurrence, current, field) {
16870
16870
  });
16871
16871
  return new Date(...values);
16872
16872
  }
16873
+ /**
16874
+ * @hidden
16875
+ */
16876
+ function updateRecurrenceRule(valueSrc, valueGoal) {
16877
+ const rrule = parseRule({ recurrenceRule: valueSrc.recurrenceRule });
16878
+ // parseRule sets weekStart to 0 if not present which then adds it to the serialized rule
16879
+ if (!valueSrc.recurrenceRule.includes("WKST")) {
16880
+ rrule.weekStart = undefined;
16881
+ }
16882
+ if (valueSrc.start?.getDate() !== valueGoal.start?.getDate()) {
16883
+ if (rrule.byYearDay?.length > 0) {
16884
+ // when the event is recurring on more than one day of the year
16885
+ const itemIndex = rrule.byYearDay.findIndex(yearDay => yearDay === valueSrc.start?.getDate());
16886
+ if (itemIndex !== -1) {
16887
+ rrule.byYearDay[itemIndex] = valueGoal.start?.getDate();
16888
+ }
16889
+ }
16890
+ if (rrule.byMonthDay?.length > 0) {
16891
+ // when the event is recurring on more than one day of the month
16892
+ const itemIndex = rrule.byMonthDay.findIndex(monthDay => monthDay === valueSrc.start?.getDate());
16893
+ if (itemIndex !== -1) {
16894
+ rrule.byMonthDay[itemIndex] = valueGoal.start?.getDate();
16895
+ }
16896
+ }
16897
+ }
16898
+ if (valueSrc.start?.getDay() !== valueGoal.start?.getDay() && rrule.byWeekDay?.length > 0) {
16899
+ // when the event is recurring on more than one day of the week
16900
+ const itemIndex = rrule.byWeekDay.findIndex(weekDayRule => weekDayRule.day === valueSrc.start?.getDay());
16901
+ if (itemIndex !== -1) {
16902
+ rrule.byWeekDay[itemIndex].day = valueGoal.start?.getDay();
16903
+ }
16904
+ }
16905
+ if (valueSrc.start?.getMonth() !== valueGoal.start?.getMonth() && rrule.byMonth?.length > 0) {
16906
+ // when the event is recurring on more than one month of the year
16907
+ const itemIndex = rrule.byMonth.findIndex(month => month === valueSrc.start?.getMonth());
16908
+ if (itemIndex !== -1) {
16909
+ rrule.byMonth[itemIndex] = valueGoal.start?.getMonth();
16910
+ }
16911
+ }
16912
+ return serializeRule(rrule);
16913
+ }
16873
16914
 
16874
16915
  /**
16875
16916
  * @hidden
@@ -17051,6 +17092,12 @@ class EditingDirectiveBase {
17051
17092
  let target = dataItem;
17052
17093
  if (result === EditMode.Series) {
17053
17094
  target = this.editService.findRecurrenceMaster(dataItem);
17095
+ if (dataItem.recurrenceRule) {
17096
+ const newRecurrenceRule = updateRecurrenceRule(dataItem, value);
17097
+ if (newRecurrenceRule !== dataItem?.recurrenceRule) {
17098
+ setField(value, modelFields.recurrenceRule, newRecurrenceRule);
17099
+ }
17100
+ }
17054
17101
  setField(value, modelFields.start, seriesDate(target, dataItem, value, modelFields.start));
17055
17102
  setField(value, modelFields.end, seriesDate(target, dataItem, value, modelFields.end));
17056
17103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-scheduler",
3
- "version": "16.3.0-develop.12",
3
+ "version": "16.3.0-develop.13",
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",
@@ -26,23 +26,23 @@
26
26
  "@progress/kendo-data-query": "^1.0.0",
27
27
  "@progress/kendo-drawing": "^1.19.0",
28
28
  "@progress/kendo-licensing": "^1.0.2",
29
- "@progress/kendo-angular-tooltip": "16.3.0-develop.12",
30
- "@progress/kendo-angular-buttons": "16.3.0-develop.12",
31
- "@progress/kendo-angular-common": "16.3.0-develop.12",
32
- "@progress/kendo-angular-dateinputs": "16.3.0-develop.12",
33
- "@progress/kendo-angular-dialog": "16.3.0-develop.12",
34
- "@progress/kendo-angular-dropdowns": "16.3.0-develop.12",
35
- "@progress/kendo-angular-icons": "16.3.0-develop.12",
36
- "@progress/kendo-angular-inputs": "16.3.0-develop.12",
37
- "@progress/kendo-angular-intl": "16.3.0-develop.12",
38
- "@progress/kendo-angular-l10n": "16.3.0-develop.12",
39
- "@progress/kendo-angular-label": "16.3.0-develop.12",
40
- "@progress/kendo-angular-popup": "16.3.0-develop.12",
29
+ "@progress/kendo-angular-tooltip": "16.3.0-develop.13",
30
+ "@progress/kendo-angular-buttons": "16.3.0-develop.13",
31
+ "@progress/kendo-angular-common": "16.3.0-develop.13",
32
+ "@progress/kendo-angular-dateinputs": "16.3.0-develop.13",
33
+ "@progress/kendo-angular-dialog": "16.3.0-develop.13",
34
+ "@progress/kendo-angular-dropdowns": "16.3.0-develop.13",
35
+ "@progress/kendo-angular-icons": "16.3.0-develop.13",
36
+ "@progress/kendo-angular-inputs": "16.3.0-develop.13",
37
+ "@progress/kendo-angular-intl": "16.3.0-develop.13",
38
+ "@progress/kendo-angular-l10n": "16.3.0-develop.13",
39
+ "@progress/kendo-angular-label": "16.3.0-develop.13",
40
+ "@progress/kendo-angular-popup": "16.3.0-develop.13",
41
41
  "rxjs": "^6.5.3 || ^7.0.0"
42
42
  },
43
43
  "dependencies": {
44
44
  "tslib": "^2.3.1",
45
- "@progress/kendo-angular-schematics": "16.3.0-develop.12",
45
+ "@progress/kendo-angular-schematics": "16.3.0-develop.13",
46
46
  "@progress/kendo-date-math": "^1.3.2",
47
47
  "@progress/kendo-draggable": "^3.0.2",
48
48
  "@progress/kendo-file-saver": "^1.0.7",
@@ -4,10 +4,10 @@ const schematics_1 = require("@angular-devkit/schematics");
4
4
  function default_1(options) {
5
5
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'SchedulerModule', package: 'scheduler', peerDependencies: {
6
6
  // peer deps of the dropdowns
7
- '@progress/kendo-angular-treeview': '16.3.0-develop.12',
8
- '@progress/kendo-angular-navigation': '16.3.0-develop.12',
7
+ '@progress/kendo-angular-treeview': '16.3.0-develop.13',
8
+ '@progress/kendo-angular-navigation': '16.3.0-develop.13',
9
9
  // peer dependency of kendo-angular-inputs
10
- '@progress/kendo-angular-dialog': '16.3.0-develop.12',
10
+ '@progress/kendo-angular-dialog': '16.3.0-develop.13',
11
11
  // peer dependency of kendo-angular-icons
12
12
  '@progress/kendo-svg-icons': '^3.0.0'
13
13
  } });