@syncfusion/ej2-schedule 21.2.9 → 22.1.34

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 (98) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +22 -0
  3. package/dist/ej2-schedule.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js +2 -2
  5. package/dist/ej2-schedule.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-schedule.es2015.js +59 -31
  7. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  8. package/dist/es6/ej2-schedule.es5.js +60 -32
  9. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  10. package/dist/global/ej2-schedule.min.js +2 -2
  11. package/dist/global/ej2-schedule.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +15 -15
  14. package/src/recurrence-editor/recurrence-editor-model.d.ts +8 -1
  15. package/src/recurrence-editor/recurrence-editor.d.ts +17 -0
  16. package/src/recurrence-editor/recurrence-editor.js +7 -4
  17. package/src/schedule/actions/keyboard.js +2 -0
  18. package/src/schedule/base/schedule-model.d.ts +18 -9
  19. package/src/schedule/base/schedule.d.ts +20 -11
  20. package/src/schedule/base/schedule.js +14 -5
  21. package/src/schedule/models/event-settings-model.d.ts +4 -2
  22. package/src/schedule/models/event-settings.d.ts +4 -2
  23. package/src/schedule/models/group-model.d.ts +2 -1
  24. package/src/schedule/models/group.d.ts +2 -1
  25. package/src/schedule/models/header-rows-model.d.ts +2 -1
  26. package/src/schedule/models/header-rows.d.ts +2 -1
  27. package/src/schedule/models/quick-info-templates-model.d.ts +6 -3
  28. package/src/schedule/models/quick-info-templates.d.ts +6 -3
  29. package/src/schedule/models/time-scale-model.d.ts +4 -2
  30. package/src/schedule/models/time-scale.d.ts +4 -2
  31. package/src/schedule/models/views-model.d.ts +18 -9
  32. package/src/schedule/models/views.d.ts +18 -9
  33. package/src/schedule/popups/event-tooltip.js +6 -3
  34. package/src/schedule/popups/event-window.js +18 -14
  35. package/src/schedule/popups/quick-popups.js +3 -1
  36. package/src/schedule/renderer/timeline-view.js +11 -6
  37. package/styles/bootstrap-dark.css +15 -12
  38. package/styles/bootstrap.css +15 -12
  39. package/styles/bootstrap4.css +16 -13
  40. package/styles/bootstrap5-dark.css +15 -12
  41. package/styles/bootstrap5.css +15 -12
  42. package/styles/fabric-dark.css +15 -12
  43. package/styles/fabric.css +15 -12
  44. package/styles/fluent-dark.css +15 -12
  45. package/styles/fluent.css +15 -12
  46. package/styles/highcontrast-light.css +16 -13
  47. package/styles/highcontrast.css +16 -13
  48. package/styles/material-dark.css +15 -12
  49. package/styles/material.css +15 -12
  50. package/styles/material3-dark.css +4597 -0
  51. package/styles/material3-dark.scss +4 -0
  52. package/styles/material3.css +4653 -0
  53. package/styles/material3.scss +4 -0
  54. package/styles/recurrence-editor/_material3-dark-definition.scss +1 -0
  55. package/styles/recurrence-editor/_material3-definition.scss +13 -0
  56. package/styles/recurrence-editor/material3-dark.css +593 -0
  57. package/styles/recurrence-editor/material3-dark.scss +9 -0
  58. package/styles/recurrence-editor/material3.css +649 -0
  59. package/styles/recurrence-editor/material3.scss +9 -0
  60. package/styles/schedule/_bootstrap-dark-definition.scss +3 -2
  61. package/styles/schedule/_bootstrap-definition.scss +3 -2
  62. package/styles/schedule/_bootstrap4-definition.scss +3 -2
  63. package/styles/schedule/_bootstrap5-definition.scss +3 -2
  64. package/styles/schedule/_fabric-dark-definition.scss +3 -2
  65. package/styles/schedule/_fabric-definition.scss +3 -2
  66. package/styles/schedule/_fluent-definition.scss +3 -2
  67. package/styles/schedule/_fusionnew-definition.scss +3 -2
  68. package/styles/schedule/_highcontrast-definition.scss +3 -2
  69. package/styles/schedule/_highcontrast-light-definition.scss +3 -2
  70. package/styles/schedule/_layout.scss +31 -16
  71. package/styles/schedule/_material-dark-definition.scss +3 -2
  72. package/styles/schedule/_material-definition.scss +3 -2
  73. package/styles/schedule/_material3-dark-definition.scss +1 -0
  74. package/styles/schedule/_material3-definition.scss +292 -0
  75. package/styles/schedule/_tailwind-definition.scss +3 -2
  76. package/styles/schedule/_theme.scss +7 -2
  77. package/styles/schedule/bootstrap-dark.css +15 -12
  78. package/styles/schedule/bootstrap.css +15 -12
  79. package/styles/schedule/bootstrap4.css +16 -13
  80. package/styles/schedule/bootstrap5-dark.css +15 -12
  81. package/styles/schedule/bootstrap5.css +15 -12
  82. package/styles/schedule/fabric-dark.css +15 -12
  83. package/styles/schedule/fabric.css +15 -12
  84. package/styles/schedule/fluent-dark.css +15 -12
  85. package/styles/schedule/fluent.css +15 -12
  86. package/styles/schedule/highcontrast-light.css +16 -13
  87. package/styles/schedule/highcontrast.css +16 -13
  88. package/styles/schedule/icons/_material3-dark.scss +1 -0
  89. package/styles/schedule/material-dark.css +15 -12
  90. package/styles/schedule/material.css +15 -12
  91. package/styles/schedule/material3-dark.css +4191 -0
  92. package/styles/schedule/material3-dark.scss +16 -0
  93. package/styles/schedule/material3.css +4247 -0
  94. package/styles/schedule/material3.scss +17 -0
  95. package/styles/schedule/tailwind-dark.css +15 -12
  96. package/styles/schedule/tailwind.css +15 -12
  97. package/styles/tailwind-dark.css +15 -12
  98. package/styles/tailwind.css +15 -12
@@ -1,4 +1,4 @@
1
- import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, classList, cldrData, closest, compile, createElement, detach, extend, formatUnit, getDefaultDateObject, getElement, getValue, isNullOrUndefined, prepend, print, remove, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
1
+ import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, classList, cldrData, closest, compile, createElement, detach, extend, formatUnit, getDefaultDateObject, getElement, getValue, initializeCSPTemplate, isNullOrUndefined, prepend, print, remove, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
2
2
  import { Dialog, Popup, Tooltip, createSpinner, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
3
3
  import { Toolbar, TreeView } from '@syncfusion/ej2-navigations';
4
4
  import { Calendar, DatePicker, DateTimePicker } from '@syncfusion/ej2-calendars';
@@ -2446,6 +2446,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2446
2446
  return;
2447
2447
  }
2448
2448
  }
2449
+ e.preventDefault();
2449
2450
  this.selectCells(isMultiple, targetCell);
2450
2451
  }
2451
2452
  }
@@ -2493,6 +2494,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2493
2494
  return;
2494
2495
  }
2495
2496
  }
2497
+ e.preventDefault();
2496
2498
  this.selectCells(isMultiple, targetCell);
2497
2499
  }
2498
2500
  }
@@ -10361,7 +10363,9 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
10361
10363
  this.dialogEvent = event;
10362
10364
  }
10363
10365
  this.quickPopupHide();
10364
- this.parent.eventBase.focusElement();
10366
+ if (isNullOrUndefined(event) || (!isNullOrUndefined(event) && event.action !== 'escape')) {
10367
+ this.parent.eventBase.focusElement();
10368
+ }
10365
10369
  };
10366
10370
  QuickPopups.prototype.addEventListener = function () {
10367
10371
  this.parent.on(cellClick, this.cellClick, this);
@@ -10553,11 +10557,14 @@ var EventTooltip = /** @__PURE__ @class */ (function () {
10553
10557
  }
10554
10558
  var tooltipTime = (record[fields.isAllDay]) ? this.parent.localeObj.getConstant('allDay') :
10555
10559
  (startTime + ' - ' + endTime);
10556
- var content = '<div><div class="e-subject">' + tooltipSubject + '</div>' +
10560
+ var content_1 = '<div><div class="e-subject">' + tooltipSubject + '</div>' +
10557
10561
  '<div class="e-location">' + tooltipLocation + '</div>' +
10558
10562
  '<div class="e-details">' + tooltipDetails + '</div>' +
10559
10563
  '<div class="e-all-day">' + tooltipTime + '</div></div>';
10560
- this.setContent(content);
10564
+ var contentTemp = function () {
10565
+ return content_1;
10566
+ };
10567
+ this.setContent(initializeCSPTemplate(contentTemp));
10561
10568
  }
10562
10569
  this.parent.renderTemplates();
10563
10570
  };
@@ -10804,7 +10811,7 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
10804
10811
  }
10805
10812
  else {
10806
10813
  if (!isNullOrUndefined(this.repeatType.value)) {
10807
- this.startState(this.repeatType.value.toString().toUpperCase(), NEVER, this.startDate);
10814
+ this.startState(this.repeatType.value.toString().toUpperCase(), this.endTypes[0], this.startDate);
10808
10815
  this.updateForm(this.repeatType.value.toString());
10809
10816
  }
10810
10817
  if (this.selectedType > 0) {
@@ -11193,11 +11200,10 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
11193
11200
  }
11194
11201
  };
11195
11202
  RecurrenceEditor.prototype.getEndData = function () {
11196
- var endData = [NEVER, UNTIL$1, COUNT];
11197
11203
  // eslint-disable-next-line @typescript-eslint/no-this-alias
11198
11204
  var self = this;
11199
11205
  var dataSource = [];
11200
- endData.forEach(function (data) {
11206
+ this.endTypes.forEach(function (data) {
11201
11207
  dataSource.push({ text: self.localeObj.getConstant(data), value: data });
11202
11208
  });
11203
11209
  return dataSource;
@@ -11497,7 +11503,7 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
11497
11503
  this.monthButtons = [];
11498
11504
  };
11499
11505
  RecurrenceEditor.prototype.resetFields = function () {
11500
- this.startState(NONE, NEVER, this.startDate);
11506
+ this.startState(NONE, this.endTypes[0], this.startDate);
11501
11507
  this.setDefaultValue();
11502
11508
  };
11503
11509
  RecurrenceEditor.prototype.updateRuleUntilDate = function (startDate) {
@@ -11682,6 +11688,7 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
11682
11688
  case 'locale':
11683
11689
  case 'frequencies':
11684
11690
  case 'firstDayOfWeek':
11691
+ case 'endTypes':
11685
11692
  this.refresh();
11686
11693
  break;
11687
11694
  case 'dateFormat':
@@ -11693,6 +11700,9 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
11693
11700
  __decorate$1([
11694
11701
  Property(['none', 'daily', 'weekly', 'monthly', 'yearly'])
11695
11702
  ], RecurrenceEditor.prototype, "frequencies", void 0);
11703
+ __decorate$1([
11704
+ Property(['never', 'until', 'count'])
11705
+ ], RecurrenceEditor.prototype, "endTypes", void 0);
11696
11706
  __decorate$1([
11697
11707
  Property(0)
11698
11708
  ], RecurrenceEditor.prototype, "firstDayOfWeek", void 0);
@@ -12148,8 +12158,10 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12148
12158
  var resourceDiv = this.createDivElement(value + '-container' + ' ' + 'e-resources');
12149
12159
  var resourceInput = this.createInputElement(value + ' ' + EVENT_FIELD$1, fieldName);
12150
12160
  resourceDiv.appendChild(resourceInput);
12151
- var resourceTemplate = '<div class="e-resource-template"><div class="e-resource-color" style="background-color:${' +
12152
- resourceData.colorField + '}"></div><div class="e-resource-text">${' + resourceData.textField + '}</div></div>';
12161
+ function resourceTemplate(data) {
12162
+ return "<div class=\"e-resource-template\"><div class=\"e-resource-color\" style=\"background-color:" + data[resourceData.colorField] + "\"></div><div class=\"e-resource-text\">" + data[resourceData.textField] + "</div></div>";
12163
+ }
12164
+ initializeCSPTemplate(resourceTemplate, resourceData);
12153
12165
  if (resourceData.allowMultiple) {
12154
12166
  var listObj = new MultiSelect({
12155
12167
  enableRtl: this.parent.enableRtl,
@@ -12399,16 +12411,18 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12399
12411
  return labelText;
12400
12412
  };
12401
12413
  EventWindow.prototype.onChange = function (args) {
12402
- var targetSelector = "." + EVENT_WINDOW_ALL_DAY_CLASS + ",." + TIME_ZONE_CLASS + ",." + EVENT_WINDOW_REPEAT_CLASS;
12403
- var target = closest(args.event.target, targetSelector);
12404
- if (target.classList.contains(EVENT_WINDOW_ALL_DAY_CLASS)) {
12405
- this.onAllDayChange(args.checked);
12406
- }
12407
- else if (target.classList.contains(TIME_ZONE_CLASS)) {
12408
- this.timezoneChangeStyle(args.checked);
12409
- }
12410
- else if (target.classList.contains(EVENT_WINDOW_REPEAT_CLASS)) {
12411
- this.onRepeatChange(args.checked);
12414
+ if (args.event && args.event.target) {
12415
+ var targetSelector = "." + EVENT_WINDOW_ALL_DAY_CLASS + ",." + TIME_ZONE_CLASS + ",." + EVENT_WINDOW_REPEAT_CLASS;
12416
+ var target = closest(args.event.target, targetSelector);
12417
+ if (target.classList.contains(EVENT_WINDOW_ALL_DAY_CLASS)) {
12418
+ this.onAllDayChange(args.checked);
12419
+ }
12420
+ else if (target.classList.contains(TIME_ZONE_CLASS)) {
12421
+ this.timezoneChangeStyle(args.checked);
12422
+ }
12423
+ else if (target.classList.contains(EVENT_WINDOW_REPEAT_CLASS)) {
12424
+ this.onRepeatChange(args.checked);
12425
+ }
12412
12426
  }
12413
12427
  };
12414
12428
  EventWindow.prototype.renderRepeatDialog = function () {
@@ -13243,7 +13257,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13243
13257
  this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
13244
13258
  return true;
13245
13259
  }
13246
- else if (!(previousEndTime.getTime() <= currentStartTime.getTime() && nextStartTime.getTime() >
13260
+ else if (!(previousEndTime.getTime() <= currentStartTime.getTime() && nextStartTime.getTime() >=
13247
13261
  currentEndTime.getTime()) || (resetTime(nextEndTime).getTime() <
13248
13262
  resetTime(currentStartTime).getTime()) ||
13249
13263
  (resetTime(previousStartTime).getTime() > resetTime(currentEndTime).getTime()) ||
@@ -17267,7 +17281,11 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17267
17281
  };
17268
17282
  }
17269
17283
  this.currentTimezoneDate = this.getCurrentTime();
17270
- this.activeCellsData = { startTime: new Date(this.currentTimezoneDate), endTime: new Date(this.currentTimezoneDate), isAllDay: false };
17284
+ this.activeCellsData = {
17285
+ startTime: new Date(this.currentTimezoneDate),
17286
+ endTime: new Date(this.currentTimezoneDate),
17287
+ isAllDay: false
17288
+ };
17271
17289
  this.activeEventData = { event: undefined, element: undefined };
17272
17290
  this.getDefaultLocale();
17273
17291
  this.localeObj = new L10n(this.getModuleName(), this.defaultLocale, this.locale);
@@ -17753,18 +17771,23 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17753
17771
  /**
17754
17772
  * Method to process the templates
17755
17773
  *
17756
- * @param {string} template Accepts the template in string
17774
+ * @param {string | Function} template Accepts the template in string
17757
17775
  * @returns {CallbackFunction} Returns the callback function
17758
17776
  * @private
17759
17777
  */
17760
17778
  Schedule.prototype.templateParser = function (template) {
17761
17779
  if (template) {
17762
17780
  try {
17763
- if (document.querySelectorAll(template).length) {
17764
- return compile(document.querySelector(template).innerHTML.trim());
17781
+ if (typeof template === 'function') {
17782
+ return compile(template);
17765
17783
  }
17766
17784
  else {
17767
- return compile(template);
17785
+ if (document.querySelectorAll(template).length) {
17786
+ return compile(document.querySelector(template).innerHTML.trim());
17787
+ }
17788
+ else {
17789
+ return compile(template);
17790
+ }
17768
17791
  }
17769
17792
  }
17770
17793
  catch (error) {
@@ -26516,18 +26539,23 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
26516
26539
  };
26517
26540
  TimelineViews.prototype.getLeftFromDateTime = function (currentDateIndex, date) {
26518
26541
  var startHour = this.getStartHour();
26519
- var endHour = this.getEndHour();
26520
26542
  var diffInDates = 0;
26521
26543
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
26522
26544
  if (!isNullOrUndefined(currentDateIndex)) {
26523
- var end = (endHour.getHours() === 0) ? 24 : endHour.getHours();
26524
26545
  if (currentDateIndex[0] !== 0) {
26525
- diffInDates = (currentDateIndex[0]) * ((end - startHour.getHours()) * 60) + (endHour.getMinutes() - startHour.getMinutes());
26546
+ if (this.parent.activeView.colLevels[0] && this.parent.activeView.colLevels[0][0].colSpan) {
26547
+ diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[0][0].colSpan * this.getWorkCellWidth();
26548
+ }
26549
+ else {
26550
+ var endHour = this.getEndHour();
26551
+ var end = (endHour.getHours() === 0) ? 24 : endHour.getHours();
26552
+ diffInMinutes = diffInMinutes + ((currentDateIndex[0]) * (((end - startHour.getHours()) * 60) +
26553
+ (endHour.getMinutes() - startHour.getMinutes())));
26554
+ }
26526
26555
  }
26527
- diffInMinutes = diffInDates + diffInMinutes;
26528
26556
  }
26529
- return (diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
26530
- this.parent.activeViewOptions.timeScale.interval;
26557
+ return diffInDates + ((diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
26558
+ this.parent.activeViewOptions.timeScale.interval);
26531
26559
  };
26532
26560
  TimelineViews.prototype.getWorkCellWidth = function () {
26533
26561
  return this.element.querySelector('.e-work-cells').getBoundingClientRect().width;