@syncfusion/ej2-calendars 24.1.47 → 24.2.5

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 (65) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/ej2-calendars.min.js +2 -2
  3. package/dist/ej2-calendars.umd.min.js +2 -2
  4. package/dist/ej2-calendars.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-calendars.es2015.js +94 -25
  6. package/dist/es6/ej2-calendars.es2015.js.map +1 -1
  7. package/dist/es6/ej2-calendars.es5.js +94 -25
  8. package/dist/es6/ej2-calendars.es5.js.map +1 -1
  9. package/dist/global/ej2-calendars.min.js +2 -2
  10. package/dist/global/ej2-calendars.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +10 -10
  13. package/src/calendar/calendar.d.ts +2 -0
  14. package/src/calendar/calendar.js +86 -21
  15. package/src/datepicker/datepicker.js +8 -4
  16. package/styles/bootstrap-dark.css +26 -1
  17. package/styles/bootstrap.css +26 -1
  18. package/styles/bootstrap4.css +26 -1
  19. package/styles/bootstrap5-dark.css +26 -1
  20. package/styles/bootstrap5.css +26 -1
  21. package/styles/calendar/_bootstrap-dark-definition.scss +10 -0
  22. package/styles/calendar/_bootstrap-definition.scss +10 -0
  23. package/styles/calendar/_bootstrap4-definition.scss +10 -0
  24. package/styles/calendar/_bootstrap5-definition.scss +9 -1
  25. package/styles/calendar/_fabric-dark-definition.scss +10 -0
  26. package/styles/calendar/_fabric-definition.scss +11 -1
  27. package/styles/calendar/_fluent-definition.scss +11 -1
  28. package/styles/calendar/_fusionnew-definition.scss +10 -0
  29. package/styles/calendar/_highcontrast-definition.scss +11 -1
  30. package/styles/calendar/_highcontrast-light-definition.scss +10 -0
  31. package/styles/calendar/_layout.scss +3 -0
  32. package/styles/calendar/_material-dark-definition.scss +10 -0
  33. package/styles/calendar/_material-definition.scss +10 -0
  34. package/styles/calendar/_material3-definition.scss +10 -0
  35. package/styles/calendar/_tailwind-definition.scss +10 -1
  36. package/styles/calendar/_theme.scss +24 -3
  37. package/styles/calendar/bootstrap-dark.css +25 -1
  38. package/styles/calendar/bootstrap.css +25 -1
  39. package/styles/calendar/bootstrap4.css +25 -1
  40. package/styles/calendar/bootstrap5-dark.css +26 -1
  41. package/styles/calendar/bootstrap5.css +26 -1
  42. package/styles/calendar/fabric-dark.css +25 -1
  43. package/styles/calendar/fabric.css +27 -3
  44. package/styles/calendar/fluent-dark.css +35 -10
  45. package/styles/calendar/fluent.css +35 -10
  46. package/styles/calendar/highcontrast-light.css +25 -1
  47. package/styles/calendar/highcontrast.css +27 -3
  48. package/styles/calendar/material-dark.css +25 -1
  49. package/styles/calendar/material.css +25 -1
  50. package/styles/calendar/material3-dark.css +25 -1
  51. package/styles/calendar/material3.css +25 -1
  52. package/styles/calendar/tailwind-dark.css +25 -1
  53. package/styles/calendar/tailwind.css +25 -1
  54. package/styles/fabric-dark.css +26 -1
  55. package/styles/fabric.css +28 -3
  56. package/styles/fluent-dark.css +35 -10
  57. package/styles/fluent.css +35 -10
  58. package/styles/highcontrast-light.css +26 -1
  59. package/styles/highcontrast.css +28 -3
  60. package/styles/material-dark.css +26 -1
  61. package/styles/material.css +26 -1
  62. package/styles/material3-dark.css +26 -1
  63. package/styles/material3.css +26 -1
  64. package/styles/tailwind-dark.css +26 -1
  65. package/styles/tailwind.css +26 -1
@@ -32,6 +32,7 @@ var DEVICE = 'e-device';
32
32
  var HEADER = 'e-header';
33
33
  var RTL = 'e-rtl';
34
34
  var CONTENT = 'e-content';
35
+ var CONTENTTABLE = 'e-content-table';
35
36
  var YEAR = 'e-year';
36
37
  var MONTH = 'e-month';
37
38
  var DECADE = 'e-decade';
@@ -47,6 +48,7 @@ var WEEKEND = 'e-weekend';
47
48
  var WEEKNUMBER = 'e-week-number';
48
49
  var SELECTED = 'e-selected';
49
50
  var FOCUSEDDATE = 'e-focused-date';
51
+ var FOCUSEDCELL = 'e-focused-cell';
50
52
  var OTHERMONTHROW = 'e-month-hide';
51
53
  var TODAY = 'e-today';
52
54
  var TITLE = 'e-title';
@@ -227,6 +229,7 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
227
229
  var ariaTitleAttrs = {
228
230
  'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'title'
229
231
  };
232
+ var tabIndexAttr = { 'tabindex': '0' };
230
233
  this.headerElement = this.createElement('div', { className: HEADER });
231
234
  var iconContainer = this.createElement('div', { className: ICONCONTAINER });
232
235
  this.previousIcon = this.createElement('button', { className: '' + PREVICON, attrs: { type: 'button' } });
@@ -236,6 +239,7 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
236
239
  isCenterRipple: true
237
240
  });
238
241
  attributes(this.previousIcon, ariaPrevAttrs);
242
+ attributes(this.previousIcon, tabIndexAttr);
239
243
  this.nextIcon = this.createElement('button', { className: '' + NEXTICON, attrs: { type: 'button' } });
240
244
  rippleEffect(this.nextIcon, {
241
245
  selector: '.e-next',
@@ -247,8 +251,10 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
247
251
  attributes(this.nextIcon, { tabIndex: '-1' });
248
252
  }
249
253
  attributes(this.nextIcon, ariaNextAttrs);
254
+ attributes(this.nextIcon, tabIndexAttr);
250
255
  this.headerTitleElement = this.createElement('div', { className: '' + LINK + ' ' + TITLE });
251
256
  attributes(this.headerTitleElement, ariaTitleAttrs);
257
+ attributes(this.headerTitleElement, tabIndexAttr);
252
258
  this.headerElement.appendChild(this.headerTitleElement);
253
259
  this.previousIcon.appendChild(this.createElement('span', { className: '' + PREVSPAN + ' ' + ICON }));
254
260
  this.nextIcon.appendChild(this.createElement('span', { className: '' + NEXTSPAN + ' ' + ICON }));
@@ -265,7 +271,7 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
265
271
  };
266
272
  CalendarBase.prototype.createContent = function () {
267
273
  this.contentElement = this.createElement('div', { className: CONTENT });
268
- this.table = this.createElement('table', { attrs: { tabIndex: '0', 'role': 'grid', 'aria-activedescendant': '', 'aria-labelledby': this.element.id } });
274
+ this.table = this.createElement('table', { attrs: { 'class': CONTENTTABLE, 'tabIndex': '0', 'role': 'grid', 'aria-activedescendant': '', 'aria-labelledby': this.element.id } });
269
275
  if (this.getModuleName() === 'calendar') {
270
276
  this.element.appendChild(this.contentElement);
271
277
  }
@@ -278,6 +284,30 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
278
284
  if (this.showTodayButton) {
279
285
  this.createContentFooter();
280
286
  }
287
+ if (this.getModuleName() != 'daterangepicker') {
288
+ EventHandler.add(this.table, 'focus', this.addContentFocus, this);
289
+ EventHandler.add(this.table, 'blur', this.removeContentFocus, this);
290
+ }
291
+ };
292
+ CalendarBase.prototype.addContentFocus = function (args) {
293
+ var focusedDate = this.tableBodyElement.querySelector('tr td.e-focused-date');
294
+ var selectedDate = this.tableBodyElement.querySelector('tr td.e-selected');
295
+ if (!isNullOrUndefined(selectedDate)) {
296
+ selectedDate.classList.add(FOCUSEDCELL);
297
+ }
298
+ else if (!isNullOrUndefined(focusedDate)) {
299
+ focusedDate.classList.add(FOCUSEDCELL);
300
+ }
301
+ };
302
+ CalendarBase.prototype.removeContentFocus = function (args) {
303
+ var focusedDate = this.tableBodyElement.querySelector('tr td.e-focused-date');
304
+ var selectedDate = this.tableBodyElement.querySelector('tr td.e-selected');
305
+ if (!isNullOrUndefined(selectedDate)) {
306
+ selectedDate.classList.remove(FOCUSEDCELL);
307
+ }
308
+ else if (!isNullOrUndefined(focusedDate)) {
309
+ focusedDate.classList.remove(FOCUSEDCELL);
310
+ }
281
311
  };
282
312
  CalendarBase.prototype.getCultureValues = function () {
283
313
  var culShortNames = [];
@@ -362,6 +392,7 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
362
392
  CalendarBase.prototype.updateFooter = function () {
363
393
  this.todayElement.textContent = this.l10.getConstant('today');
364
394
  this.todayElement.setAttribute('aria-label', this.l10.getConstant('today'));
395
+ this.todayElement.setAttribute('tabindex', '0');
365
396
  };
366
397
  CalendarBase.prototype.createContentFooter = function () {
367
398
  if (this.showTodayButton) {
@@ -466,34 +497,54 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
466
497
  this.effect = '';
467
498
  switch (e.action) {
468
499
  case 'moveLeft':
469
- this.keyboardNavigate(-1, view, e, this.max, this.min);
470
- e.preventDefault();
500
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
501
+ this.keyboardNavigate(-1, view, e, this.max, this.min);
502
+ e.preventDefault();
503
+ }
471
504
  break;
472
505
  case 'moveRight':
473
- this.keyboardNavigate(1, view, e, this.max, this.min);
474
- e.preventDefault();
506
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
507
+ this.keyboardNavigate(1, view, e, this.max, this.min);
508
+ e.preventDefault();
509
+ }
475
510
  break;
476
511
  case 'moveUp':
477
- if (view === 0) {
478
- this.keyboardNavigate(-7, view, e, this.max, this.min); // move the current date to the previous seven days.
479
- }
480
- else {
481
- this.keyboardNavigate(-4, view, e, this.max, this.min); // move the current year to the previous four days.
512
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
513
+ if (view === 0) {
514
+ this.keyboardNavigate(-7, view, e, this.max, this.min); // move the current date to the previous seven days.
515
+ }
516
+ else {
517
+ this.keyboardNavigate(-4, view, e, this.max, this.min); // move the current year to the previous four days.
518
+ }
519
+ e.preventDefault();
482
520
  }
483
- e.preventDefault();
484
521
  break;
485
522
  case 'moveDown':
486
- if (view === 0) {
487
- this.keyboardNavigate(7, view, e, this.max, this.min);
488
- }
489
- else {
490
- this.keyboardNavigate(4, view, e, this.max, this.min);
523
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
524
+ if (view === 0) {
525
+ this.keyboardNavigate(7, view, e, this.max, this.min);
526
+ }
527
+ else {
528
+ this.keyboardNavigate(4, view, e, this.max, this.min);
529
+ }
530
+ e.preventDefault();
491
531
  }
492
- e.preventDefault();
493
532
  break;
494
533
  case 'select':
495
- if (e.target === this.todayElement) {
534
+ if (e.target === this.headerTitleElement) {
535
+ this.navigateTitle(e);
536
+ }
537
+ else if (e.target === this.previousIcon) {
538
+ this.navigatePrevious(e);
539
+ }
540
+ else if (e.target === this.nextIcon) {
541
+ this.navigateNext(e);
542
+ }
543
+ else if (e.target === this.todayElement) {
496
544
  this.todayButtonClick(e, value);
545
+ if (this.getModuleName() === 'datepicker' || this.getModuleName() === 'datetimepicker') {
546
+ this.element.focus();
547
+ }
497
548
  }
498
549
  else {
499
550
  var element = !isNullOrUndefined(focusedDate) ? focusedDate : selectedDate;
@@ -506,6 +557,9 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
506
557
  else {
507
558
  this.contentClick(null, --view, (element), value);
508
559
  }
560
+ if (this.getModuleName() === 'datepicker' || this.getModuleName() === 'datetimepicker') {
561
+ this.element.focus();
562
+ }
509
563
  }
510
564
  }
511
565
  break;
@@ -575,9 +629,20 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
575
629
  this.navigateTo('Month', new Date(this.currentDate.getFullYear(), 11, 31));
576
630
  e.preventDefault();
577
631
  break;
578
- }
579
- if (this.getModuleName() === 'calendar') {
580
- this.table.focus();
632
+ case 'tab':
633
+ if ((this.getModuleName() === 'datepicker' || this.getModuleName() === 'datetimepicker') && e.target === this.todayElement) {
634
+ e.preventDefault();
635
+ this.element.focus();
636
+ this.hide();
637
+ }
638
+ break;
639
+ case 'shiftTab':
640
+ if ((this.getModuleName() === 'datepicker' || this.getModuleName() === 'datetimepicker') && e.target === this.headerTitleElement) {
641
+ e.preventDefault();
642
+ this.element.focus();
643
+ this.hide();
644
+ }
645
+ break;
581
646
  }
582
647
  };
583
648
  CalendarBase.prototype.keyboardNavigate = function (number, currentView, e, max, min) {
@@ -3845,8 +3910,6 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
3845
3910
  this.inputElement.focus();
3846
3911
  }
3847
3912
  break;
3848
- case 'tab':
3849
- this.hide(e);
3850
3913
  }
3851
3914
  };
3852
3915
  DatePicker.prototype.inputFocusHandler = function () {
@@ -4008,7 +4071,13 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4008
4071
  this.inputElement.selectionStart = start;
4009
4072
  this.inputElement.selectionEnd = end;
4010
4073
  }
4011
- this.hide(e);
4074
+ if (e.action === 'tab' && e.target === this.inputElement && this.isCalendar() && document.activeElement === this.inputElement) {
4075
+ e.preventDefault();
4076
+ this.headerTitleElement.focus();
4077
+ }
4078
+ if (e.action === 'shiftTab' && e.target === this.inputElement && this.isCalendar() && document.activeElement === this.inputElement) {
4079
+ this.hide(e);
4080
+ }
4012
4081
  break;
4013
4082
  }
4014
4083
  default:
@@ -4032,7 +4101,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4032
4101
  };
4033
4102
  DatePicker.prototype.popupUpdate = function () {
4034
4103
  if ((isNullOrUndefined(this.value)) && (!isNullOrUndefined(this.previousDate)) ||
4035
- (+this.value !== +this.previousDate)) {
4104
+ (((this.getModuleName() !== 'datetimepicker') && (+this.value !== +this.previousDate)) || ((this.getModuleName() === 'datetimepicker') && (+this.value !== +this.previousDateTime)))) {
4036
4105
  if (this.popupObj) {
4037
4106
  if (this.popupObj.element.querySelectorAll('.' + SELECTED$2).length > 0) {
4038
4107
  removeClass(this.popupObj.element.querySelectorAll('.' + SELECTED$2), [SELECTED$2]);