primereact 10.3.2 → 10.4.0

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 (161) hide show
  1. package/accordion/accordion.cjs.js +1 -1
  2. package/accordion/accordion.cjs.min.js +1 -1
  3. package/accordion/accordion.esm.js +1 -1
  4. package/accordion/accordion.esm.min.js +1 -1
  5. package/accordion/accordion.js +1 -1
  6. package/accordion/accordion.min.js +1 -1
  7. package/api/api.cjs.js +20 -0
  8. package/api/api.cjs.min.js +1 -1
  9. package/api/api.d.ts +5 -1
  10. package/api/api.esm.js +20 -0
  11. package/api/api.esm.min.js +1 -1
  12. package/api/api.js +20 -0
  13. package/api/api.min.js +1 -1
  14. package/calendar/calendar.cjs.js +509 -150
  15. package/calendar/calendar.cjs.min.js +1 -1
  16. package/calendar/calendar.d.ts +4 -0
  17. package/calendar/calendar.esm.js +510 -151
  18. package/calendar/calendar.esm.min.js +1 -1
  19. package/calendar/calendar.js +509 -150
  20. package/calendar/calendar.min.js +1 -1
  21. package/carousel/carousel.cjs.js +1 -0
  22. package/carousel/carousel.cjs.min.js +1 -1
  23. package/carousel/carousel.esm.js +1 -0
  24. package/carousel/carousel.esm.min.js +1 -1
  25. package/carousel/carousel.js +1 -0
  26. package/carousel/carousel.min.js +1 -1
  27. package/chips/chips.cjs.js +2 -1
  28. package/chips/chips.cjs.min.js +1 -1
  29. package/chips/chips.esm.js +2 -1
  30. package/chips/chips.esm.min.js +1 -1
  31. package/chips/chips.js +2 -1
  32. package/chips/chips.min.js +1 -1
  33. package/contextmenu/contextmenu.cjs.js +4 -4
  34. package/contextmenu/contextmenu.cjs.min.js +1 -1
  35. package/contextmenu/contextmenu.esm.js +4 -4
  36. package/contextmenu/contextmenu.esm.min.js +1 -1
  37. package/contextmenu/contextmenu.js +4 -4
  38. package/contextmenu/contextmenu.min.js +1 -1
  39. package/core/core.js +93 -40
  40. package/core/core.min.js +4 -4
  41. package/datatable/datatable.cjs.js +577 -150
  42. package/datatable/datatable.cjs.min.js +1 -1
  43. package/datatable/datatable.esm.js +573 -146
  44. package/datatable/datatable.esm.min.js +1 -1
  45. package/datatable/datatable.js +577 -150
  46. package/datatable/datatable.min.js +1 -1
  47. package/dataview/dataview.cjs.js +27 -25
  48. package/dataview/dataview.cjs.min.js +1 -1
  49. package/dataview/dataview.d.ts +7 -1
  50. package/dataview/dataview.esm.js +27 -25
  51. package/dataview/dataview.esm.min.js +1 -1
  52. package/dataview/dataview.js +27 -25
  53. package/dataview/dataview.min.js +1 -1
  54. package/divider/divider.cjs.js +2 -2
  55. package/divider/divider.cjs.min.js +1 -1
  56. package/divider/divider.esm.js +2 -2
  57. package/divider/divider.esm.min.js +1 -1
  58. package/divider/divider.js +2 -2
  59. package/divider/divider.min.js +1 -1
  60. package/dropdown/dropdown.cjs.js +20 -25
  61. package/dropdown/dropdown.cjs.min.js +1 -1
  62. package/dropdown/dropdown.d.ts +9 -0
  63. package/dropdown/dropdown.esm.js +20 -25
  64. package/dropdown/dropdown.esm.min.js +1 -1
  65. package/dropdown/dropdown.js +20 -25
  66. package/dropdown/dropdown.min.js +1 -1
  67. package/editor/editor.cjs.js +1 -1
  68. package/editor/editor.cjs.min.js +1 -1
  69. package/editor/editor.esm.js +1 -1
  70. package/editor/editor.esm.min.js +1 -1
  71. package/editor/editor.js +1 -1
  72. package/editor/editor.min.js +1 -1
  73. package/focustrap/focustrap.cjs.js +168 -0
  74. package/focustrap/focustrap.cjs.min.js +1 -0
  75. package/focustrap/focustrap.esm.js +159 -0
  76. package/focustrap/focustrap.esm.min.js +1 -0
  77. package/focustrap/focustrap.js +167 -0
  78. package/focustrap/focustrap.min.js +1 -0
  79. package/focustrap/package.json +7 -0
  80. package/galleria/galleria.cjs.js +26 -24
  81. package/galleria/galleria.cjs.min.js +1 -1
  82. package/galleria/galleria.esm.js +26 -24
  83. package/galleria/galleria.esm.min.js +1 -1
  84. package/galleria/galleria.js +26 -24
  85. package/galleria/galleria.min.js +1 -1
  86. package/hooks/hooks.d.ts +1 -1
  87. package/menubar/menubar.cjs.js +7 -4
  88. package/menubar/menubar.cjs.min.js +1 -1
  89. package/menubar/menubar.esm.js +7 -4
  90. package/menubar/menubar.esm.min.js +1 -1
  91. package/menubar/menubar.js +7 -4
  92. package/menubar/menubar.min.js +1 -1
  93. package/package.json +1 -1
  94. package/paginator/paginator.cjs.js +20 -0
  95. package/paginator/paginator.cjs.min.js +1 -1
  96. package/paginator/paginator.esm.js +20 -0
  97. package/paginator/paginator.esm.min.js +1 -1
  98. package/paginator/paginator.js +20 -0
  99. package/paginator/paginator.min.js +1 -1
  100. package/panelmenu/panelmenu.cjs.js +32 -21
  101. package/panelmenu/panelmenu.cjs.min.js +1 -1
  102. package/panelmenu/panelmenu.esm.js +32 -21
  103. package/panelmenu/panelmenu.esm.min.js +1 -1
  104. package/panelmenu/panelmenu.js +32 -21
  105. package/panelmenu/panelmenu.min.js +1 -1
  106. package/picklist/picklist.cjs.js +20 -0
  107. package/picklist/picklist.cjs.min.js +1 -1
  108. package/picklist/picklist.esm.js +20 -0
  109. package/picklist/picklist.esm.min.js +1 -1
  110. package/picklist/picklist.js +20 -0
  111. package/picklist/picklist.min.js +1 -1
  112. package/primereact.all.cjs.js +1499 -725
  113. package/primereact.all.cjs.min.js +1 -1
  114. package/primereact.all.esm.js +1499 -725
  115. package/primereact.all.esm.min.js +1 -1
  116. package/primereact.all.js +1499 -725
  117. package/primereact.all.min.js +1 -1
  118. package/sidebar/sidebar.cjs.js +18 -16
  119. package/sidebar/sidebar.cjs.min.js +1 -1
  120. package/sidebar/sidebar.esm.js +18 -16
  121. package/sidebar/sidebar.esm.min.js +1 -1
  122. package/sidebar/sidebar.js +18 -16
  123. package/sidebar/sidebar.min.js +1 -1
  124. package/splitbutton/splitbutton.cjs.js +8 -7
  125. package/splitbutton/splitbutton.cjs.min.js +1 -1
  126. package/splitbutton/splitbutton.esm.js +8 -7
  127. package/splitbutton/splitbutton.esm.min.js +1 -1
  128. package/splitbutton/splitbutton.js +8 -7
  129. package/splitbutton/splitbutton.min.js +1 -1
  130. package/splitter/splitter.cjs.js +57 -12
  131. package/splitter/splitter.cjs.min.js +1 -1
  132. package/splitter/splitter.d.ts +13 -1
  133. package/splitter/splitter.esm.js +59 -14
  134. package/splitter/splitter.esm.min.js +1 -1
  135. package/splitter/splitter.js +57 -12
  136. package/splitter/splitter.min.js +1 -1
  137. package/tieredmenu/tieredmenu.cjs.js +8 -7
  138. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  139. package/tieredmenu/tieredmenu.esm.js +8 -7
  140. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  141. package/tieredmenu/tieredmenu.js +8 -7
  142. package/tieredmenu/tieredmenu.min.js +1 -1
  143. package/toast/toast.cjs.js +20 -0
  144. package/toast/toast.cjs.min.js +1 -1
  145. package/toast/toast.esm.js +20 -0
  146. package/toast/toast.esm.min.js +1 -1
  147. package/toast/toast.js +20 -0
  148. package/toast/toast.min.js +1 -1
  149. package/tree/tree.cjs.js +33 -15
  150. package/tree/tree.cjs.min.js +1 -1
  151. package/tree/tree.esm.js +34 -16
  152. package/tree/tree.esm.min.js +1 -1
  153. package/tree/tree.js +33 -15
  154. package/tree/tree.min.js +1 -1
  155. package/treetable/treetable.cjs.js +205 -68
  156. package/treetable/treetable.cjs.min.js +1 -1
  157. package/treetable/treetable.esm.js +206 -69
  158. package/treetable/treetable.esm.min.js +1 -1
  159. package/treetable/treetable.js +205 -68
  160. package/treetable/treetable.min.js +1 -1
  161. package/web-types.json +34 -1
@@ -170,13 +170,14 @@ function _slicedToArray(arr, i) {
170
170
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
171
171
  }
172
172
 
173
- var styles = "\n@layer primereact {\n .p-calendar {\n position: relative;\n display: inline-flex;\n max-width: 100%;\n }\n \n .p-calendar .p-inputtext {\n flex: 1 1 auto;\n width: 1%;\n }\n \n .p-calendar-w-btn-right .p-inputtext {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n \n .p-calendar-w-btn-right .p-datepicker-trigger {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n \n .p-calendar-w-btn-left .p-inputtext {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n \n .p-calendar-w-btn-left .p-datepicker-trigger {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n \n /* Fluid */\n .p-fluid .p-calendar {\n display: flex;\n }\n \n .p-fluid .p-calendar .p-inputtext {\n width: 1%;\n }\n \n /* Datepicker */\n .p-calendar .p-datepicker {\n min-width: 100%;\n }\n \n .p-datepicker {\n width: auto;\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-datepicker-inline {\n display: inline-block;\n position: static;\n overflow-x: auto;\n }\n \n /* Header */\n .p-datepicker-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .p-datepicker-header .p-datepicker-title {\n margin: 0 auto;\n }\n \n .p-datepicker-prev,\n .p-datepicker-next {\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n }\n \n /* Multiple Month DatePicker */\n .p-datepicker-multiple-month .p-datepicker-group-container {\n display: flex;\n }\n \n .p-datepicker-multiple-month .p-datepicker-group-container .p-datepicker-group {\n flex: 1 1 auto;\n }\n \n /* Multiple Month DatePicker */\n .p-datepicker-multiple-month .p-datepicker-group-container {\n display: flex;\n }\n \n /* DatePicker Table */\n .p-datepicker table {\n width: 100%;\n border-collapse: collapse;\n }\n \n .p-datepicker td > span {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin: 0 auto;\n overflow: hidden;\n position: relative;\n }\n \n /* Month Picker */\n .p-monthpicker-month {\n width: 33.3%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n \n /* Button Bar */\n .p-datepicker-buttonbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n \n /* Time Picker */\n .p-timepicker {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-timepicker button {\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n \n .p-timepicker > div {\n display: flex;\n align-items: center;\n flex-direction: column;\n }\n \n /* Touch UI */\n .p-datepicker-touch-ui,\n .p-calendar .p-datepicker-touch-ui {\n position: fixed;\n top: 50%;\n left: 50%;\n min-width: 80vw;\n transform: translate(-50%, -50%);\n }\n \n /* Year Picker */\n .p-yearpicker-year {\n width: 50%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n}\n";
173
+ var styles = "\n@layer primereact {\n .p-calendar {\n position: relative;\n display: inline-flex;\n max-width: 100%;\n }\n\n .p-calendar .p-inputtext {\n flex: 1 1 auto;\n width: 1%;\n }\n\n .p-calendar-w-btn-right .p-inputtext {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n .p-calendar-w-btn-right .p-datepicker-trigger {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n\n .p-calendar-w-btn-left .p-inputtext {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n\n .p-calendar-w-btn-left .p-datepicker-trigger {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n /* Fluid */\n .p-fluid .p-calendar {\n display: flex;\n }\n\n .p-fluid .p-calendar .p-inputtext {\n width: 1%;\n }\n\n /* Datepicker */\n .p-calendar .p-datepicker {\n min-width: 100%;\n }\n\n .p-datepicker {\n width: auto;\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .p-datepicker-inline {\n display: inline-block;\n position: static;\n overflow-x: auto;\n }\n\n /* Header */\n .p-datepicker-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .p-datepicker-header .p-datepicker-title {\n margin: 0 auto;\n }\n\n .p-datepicker-prev,\n .p-datepicker-next {\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n }\n\n /* Multiple Month DatePicker */\n .p-datepicker-multiple-month .p-datepicker-group-container {\n display: flex;\n }\n\n .p-datepicker-multiple-month .p-datepicker-group-container .p-datepicker-group {\n flex: 1 1 auto;\n }\n\n /* Multiple Month DatePicker */\n .p-datepicker-multiple-month .p-datepicker-group-container {\n display: flex;\n }\n\n /* DatePicker Table */\n .p-datepicker table {\n width: 100%;\n border-collapse: collapse;\n }\n\n .p-datepicker td > span {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin: 0 auto;\n overflow: hidden;\n position: relative;\n }\n\n /* Month Picker */\n .p-monthpicker-month {\n width: 33.3%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n\n /* Button Bar */\n .p-datepicker-buttonbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n /* Time Picker */\n .p-timepicker {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .p-timepicker button {\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n\n .p-timepicker > div {\n display: flex;\n align-items: center;\n flex-direction: column;\n }\n\n /* Touch UI */\n .p-datepicker-touch-ui,\n .p-calendar .p-datepicker-touch-ui {\n position: fixed;\n top: 50%;\n left: 50%;\n min-width: 80vw;\n transform: translate(-50%, -50%);\n }\n\n /* Year Picker */\n .p-yearpicker-year {\n width: 50%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n }\n}\n";
174
174
  var classes = {
175
175
  root: function root(_ref) {
176
176
  var props = _ref.props,
177
177
  focusedState = _ref.focusedState,
178
- isFilled = _ref.isFilled;
179
- return utils.classNames('p-calendar p-component p-inputwrapper', _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "p-calendar-w-btn p-calendar-w-btn-".concat(props.iconPos), props.showIcon), 'p-calendar-disabled', props.disabled), 'p-calendar-timeonly', props.timeOnly), 'p-inputwrapper-filled', props.value || isFilled), 'p-inputwrapper-focus', focusedState));
178
+ isFilled = _ref.isFilled,
179
+ panelVisible = _ref.panelVisible;
180
+ return utils.classNames('p-calendar p-component p-inputwrapper', _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "p-calendar-w-btn p-calendar-w-btn-".concat(props.iconPos), props.showIcon), 'p-calendar-disabled', props.disabled), 'p-calendar-timeonly', props.timeOnly), 'p-inputwrapper-filled', props.value || isFilled), 'p-inputwrapper-focus', focusedState), 'p-focus', focusedState || panelVisible));
180
181
  },
181
182
  dropdownButton: 'p-datepicker-trigger',
182
183
  buttonbar: 'p-datepicker-buttonbar',
@@ -255,6 +256,7 @@ var CalendarBase = componentbase.ComponentBase.extend({
255
256
  __TYPE: 'Calendar',
256
257
  appendTo: null,
257
258
  ariaLabelledBy: null,
259
+ ariaLabel: null,
258
260
  autoZIndex: true,
259
261
  autoFocus: false,
260
262
  baseZIndex: 0,
@@ -362,6 +364,10 @@ var CalendarPanel = /*#__PURE__*/React__namespace.forwardRef(function (props, re
362
364
  panelClassName: props.className
363
365
  }),
364
366
  style: props.style,
367
+ role: props.inline ? null : 'dialog',
368
+ id: props.id,
369
+ 'aria-label': PrimeReact.localeOption('chooseDate', props.locale),
370
+ 'aria-modal': props.inline ? null : 'true',
365
371
  onClick: props.onClick,
366
372
  onMouseUp: props.onMouseUp
367
373
  }, props.ptm('panel', {
@@ -418,6 +424,10 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
418
424
  _React$useState6 = _slicedToArray(_React$useState5, 2),
419
425
  viewDateState = _React$useState6[0],
420
426
  setViewDateState = _React$useState6[1];
427
+ var _React$useState7 = React__namespace.useState(props.id),
428
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
429
+ idState = _React$useState8[0],
430
+ setIdState = _React$useState8[1];
421
431
  var metaData = {
422
432
  props: props,
423
433
  state: {
@@ -446,26 +456,29 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
446
456
  var isOverlayClicked = React__namespace.useRef(false);
447
457
  var previousButton = React__namespace.useRef(false);
448
458
  var nextButton = React__namespace.useRef(false);
459
+ var viewChangedWithKeyDown = React__namespace.useRef(false);
449
460
  var onChangeRef = React__namespace.useRef(null);
450
- var _React$useState7 = React__namespace.useState('date'),
451
- _React$useState8 = _slicedToArray(_React$useState7, 2),
452
- currentView = _React$useState8[0],
453
- setCurrentView = _React$useState8[1];
454
- var _React$useState9 = React__namespace.useState(null),
461
+ var isClearClicked = React__namespace.useRef(false);
462
+ var _React$useState9 = React__namespace.useState('date'),
455
463
  _React$useState10 = _slicedToArray(_React$useState9, 2),
456
- currentMonth = _React$useState10[0],
457
- setCurrentMonth = _React$useState10[1];
464
+ currentView = _React$useState10[0],
465
+ setCurrentView = _React$useState10[1];
458
466
  var _React$useState11 = React__namespace.useState(null),
459
467
  _React$useState12 = _slicedToArray(_React$useState11, 2),
460
- currentYear = _React$useState12[0],
461
- setCurrentYear = _React$useState12[1];
462
- var _React$useState13 = React__namespace.useState([]),
468
+ currentMonth = _React$useState12[0],
469
+ setCurrentMonth = _React$useState12[1];
470
+ var _React$useState13 = React__namespace.useState(null),
463
471
  _React$useState14 = _slicedToArray(_React$useState13, 2),
464
- yearOptions = _React$useState14[0],
465
- setYearOptions = _React$useState14[1];
472
+ currentYear = _React$useState14[0],
473
+ setCurrentYear = _React$useState14[1];
474
+ var _React$useState15 = React__namespace.useState([]),
475
+ _React$useState16 = _slicedToArray(_React$useState15, 2),
476
+ yearOptions = _React$useState16[0],
477
+ setYearOptions = _React$useState16[1];
466
478
  var previousValue = hooks.usePrevious(props.value);
467
479
  var visible = props.inline || (props.onVisibleChange ? props.visible : overlayVisibleState);
468
480
  var attributeSelector = utils.UniqueComponentId();
481
+ var panelId = idState + '_panel';
469
482
  var _useOverlayListener = hooks.useOverlayListener({
470
483
  target: elementRef,
471
484
  overlay: overlayRef,
@@ -503,21 +516,34 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
503
516
  setFocusedState(false);
504
517
  };
505
518
  var onInputKeyDown = function onInputKeyDown(event) {
506
- switch (event.which) {
507
- //escape
508
- case 27:
519
+ switch (event.code) {
520
+ case 'ArrowDown':
509
521
  {
510
- hide();
522
+ if (!overlayVisibleState) {
523
+ show();
524
+ } else {
525
+ focusToFirstCell();
526
+ event.preventDefault();
527
+ }
511
528
  break;
512
529
  }
513
-
514
- //tab
515
- case 9:
530
+ case 'Escape':
516
531
  {
517
- visible && trapFocus(event);
532
+ hide();
518
533
  props.touchUI && disableModality();
519
534
  break;
520
535
  }
536
+ case 'Tab':
537
+ {
538
+ if (overlayRef && overlayRef.current) {
539
+ utils.DomHandler.getFocusableElements(overlayRef.current).forEach(function (el) {
540
+ return el.tabIndex = '-1';
541
+ });
542
+ hide();
543
+ props.touchUI && disableModality();
544
+ }
545
+ break;
546
+ }
521
547
  }
522
548
  };
523
549
  var onUserInput = function onUserInput(event) {
@@ -580,28 +606,40 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
580
606
  navForward(event);
581
607
  };
582
608
  var onContainerButtonKeydown = function onContainerButtonKeydown(event) {
583
- switch (event.which) {
584
- //tab
585
- case 9:
586
- trapFocus(event);
609
+ switch (event.code) {
610
+ case 'Tab':
611
+ !props.inline && trapFocus(event);
587
612
  break;
588
-
589
- //escape
590
- case 27:
613
+ case 'Escape':
591
614
  hide(null, reFocusInputField);
592
615
  event.preventDefault();
593
616
  break;
594
617
  }
595
618
  };
619
+ var onPickerKeyDown = function onPickerKeyDown(event, type, direction) {
620
+ if (event.code === 'Enter' || event.code === 'Space') {
621
+ onTimePickerElementMouseDown(event, type, direction);
622
+ event.preventDefault();
623
+ return;
624
+ }
625
+ onContainerButtonKeydown(event);
626
+ };
627
+ var onPickerKeyUp = function onPickerKeyUp(event) {
628
+ if (event.code === 'Enter' || event.code === 'Space') {
629
+ onTimePickerElementMouseUp();
630
+ event.preventDefault();
631
+ return;
632
+ }
633
+ };
596
634
  var trapFocus = function trapFocus(event) {
597
- event.preventDefault();
635
+ event === null || event === void 0 || event.preventDefault();
598
636
  var focusableElements = utils.DomHandler.getFocusableElements(overlayRef.current);
599
637
  if (focusableElements && focusableElements.length > 0) {
600
638
  if (!document.activeElement) {
601
639
  focusableElements[0].focus();
602
640
  } else {
603
641
  var focusedIndex = focusableElements.indexOf(document.activeElement);
604
- if (event.shiftKey) {
642
+ if (event !== null && event !== void 0 && event.shiftKey) {
605
643
  if (focusedIndex === -1 || focusedIndex === 0) focusableElements[focusableElements.length - 1].focus();else focusableElements[focusedIndex - 1].focus();
606
644
  } else {
607
645
  if (focusedIndex === -1 || focusedIndex === focusableElements.length - 1) focusableElements[0].focus();else focusableElements[focusedIndex + 1].focus();
@@ -634,7 +672,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
634
672
  };
635
673
  var initFocusableCell = function initFocusableCell() {
636
674
  var cell;
637
- if (props.view === 'month') {
675
+ if (currentView === 'month') {
638
676
  var cells = utils.DomHandler.find(overlayRef.current, '[data-pc-section="monthpicker"] [data-pc-section="month"]');
639
677
  var selectedCell = utils.DomHandler.findSingle(overlayRef.current, '[data-pc-section="monthpicker"] [data-pc-section="month"][data-p-highlight="true"]');
640
678
  cells.forEach(function (cell) {
@@ -652,6 +690,27 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
652
690
  cell.tabIndex = '0';
653
691
  }
654
692
  };
693
+ var focusToFirstCell = function focusToFirstCell() {
694
+ if (currentView) {
695
+ var cell;
696
+ if (currentView === 'date') {
697
+ cell = utils.DomHandler.findSingle(overlayRef.current, 'span[data-p-highlight="true"]');
698
+ if (!cell) {
699
+ var todayCell = utils.DomHandler.findSingle(overlayRef.current, 'td.p-datepicker-today span:not(.p-disabled)');
700
+ cell = todayCell || utils.DomHandler.findSingle(overlayRef.current, 'table td span:not([data-p-disabled="true"])');
701
+ }
702
+ } else if (currentView === 'month' || currentView === 'year') {
703
+ cell = utils.DomHandler.findSingle(overlayRef.current, 'span[data-p-highlight="true"]');
704
+ if (!cell) {
705
+ cell = utils.DomHandler.findSingle(overlayRef.current, "[data-pc-section=\"".concat(currentView, "picker\"] [data-pc-section=\"").concat(currentView, "\"]:not([data-p-disabled=\"true\"])"));
706
+ }
707
+ }
708
+ if (cell) {
709
+ cell.tabIndex = '0';
710
+ cell && cell.focus();
711
+ }
712
+ }
713
+ };
655
714
  var navBackward = function navBackward(event) {
656
715
  if (props.disabled) {
657
716
  event.preventDefault();
@@ -781,6 +840,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
781
840
  props.onTodayButtonClick && props.onTodayButtonClick(event);
782
841
  };
783
842
  var onClearButtonClick = function onClearButtonClick(event) {
843
+ isClearClicked.current = true;
784
844
  updateModel(event, null);
785
845
  updateInputfield(null);
786
846
  hide();
@@ -1262,23 +1322,29 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1262
1322
  var onDateCellKeydown = function onDateCellKeydown(event, date, groupIndex) {
1263
1323
  var cellContent = event.currentTarget;
1264
1324
  var cell = cellContent.parentElement;
1265
- switch (event.which) {
1266
- //down arrow
1267
- case 40:
1325
+ var cellIndex = utils.DomHandler.index(cell);
1326
+ switch (event.code) {
1327
+ case 'ArrowDown':
1268
1328
  {
1269
1329
  cellContent.tabIndex = '-1';
1270
- var cellIndex = utils.DomHandler.index(cell);
1271
1330
  var nextRow = cell.parentElement.nextElementSibling;
1272
1331
  if (nextRow) {
1273
- var focusCell = nextRow.children[cellIndex].children[0];
1274
- if (utils.DomHandler.hasClass(focusCell, 'p-disabled')) {
1332
+ var tableRowIndex = utils.DomHandler.index(cell.parentElement);
1333
+ var tableRows = Array.from(cell.parentElement.parentElement.children);
1334
+ var nextTableRows = tableRows.slice(tableRowIndex + 1);
1335
+ var hasNextFocusableDate = nextTableRows.find(function (el) {
1336
+ var focusCell = el.children[cellIndex].children[0];
1337
+ return !utils.DomHandler.getAttribute(focusCell, 'data-p-disabled');
1338
+ });
1339
+ if (hasNextFocusableDate) {
1340
+ var focusCell = hasNextFocusableDate.children[cellIndex].children[0];
1341
+ focusCell.tabIndex = '0';
1342
+ focusCell.focus();
1343
+ } else {
1275
1344
  navigation.current = {
1276
1345
  backward: false
1277
1346
  };
1278
1347
  navForward(event);
1279
- } else {
1280
- nextRow.children[cellIndex].children[0].tabIndex = '0';
1281
- nextRow.children[cellIndex].children[0].focus();
1282
1348
  }
1283
1349
  } else {
1284
1350
  navigation.current = {
@@ -1289,46 +1355,58 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1289
1355
  event.preventDefault();
1290
1356
  break;
1291
1357
  }
1292
-
1293
- //up arrow
1294
- case 38:
1358
+ case 'ArrowUp':
1295
1359
  {
1296
1360
  cellContent.tabIndex = '-1';
1297
- var _cellIndex = utils.DomHandler.index(cell);
1298
- var prevRow = cell.parentElement.previousElementSibling;
1299
- if (prevRow) {
1300
- var _focusCell = prevRow.children[_cellIndex].children[0];
1301
- if (utils.DomHandler.hasClass(_focusCell, 'p-disabled')) {
1361
+ if (event.altKey) {
1362
+ hide(null, reFocusInputField);
1363
+ } else {
1364
+ var prevRow = cell.parentElement.previousElementSibling;
1365
+ if (prevRow) {
1366
+ var _tableRowIndex = utils.DomHandler.index(cell.parentElement);
1367
+ var _tableRows = Array.from(cell.parentElement.parentElement.children);
1368
+ var prevTableRows = _tableRows.slice(0, _tableRowIndex).reverse();
1369
+ var _hasNextFocusableDate = prevTableRows.find(function (el) {
1370
+ var focusCell = el.children[cellIndex].children[0];
1371
+ return !utils.DomHandler.getAttribute(focusCell, 'data-p-disabled');
1372
+ });
1373
+ if (_hasNextFocusableDate) {
1374
+ var _focusCell = _hasNextFocusableDate.children[cellIndex].children[0];
1375
+ _focusCell.tabIndex = '0';
1376
+ _focusCell.focus();
1377
+ } else {
1378
+ navigation.current = {
1379
+ backward: true
1380
+ };
1381
+ navBackward(event);
1382
+ }
1383
+ } else {
1302
1384
  navigation.current = {
1303
1385
  backward: true
1304
1386
  };
1305
1387
  navBackward(event);
1306
- } else {
1307
- _focusCell.tabIndex = '0';
1308
- _focusCell.focus();
1309
1388
  }
1310
- } else {
1311
- navigation.current = {
1312
- backward: true
1313
- };
1314
- navBackward(event);
1315
1389
  }
1316
1390
  event.preventDefault();
1317
1391
  break;
1318
1392
  }
1319
-
1320
- //left arrow
1321
- case 37:
1393
+ case 'ArrowLeft':
1322
1394
  {
1323
1395
  cellContent.tabIndex = '-1';
1324
1396
  var prevCell = cell.previousElementSibling;
1325
1397
  if (prevCell) {
1326
- var _focusCell2 = prevCell.children[0];
1327
- if (utils.DomHandler.hasClass(_focusCell2, 'p-disabled')) {
1328
- navigateToMonth(true, groupIndex, event);
1329
- } else {
1398
+ var cells = Array.from(cell.parentElement.children);
1399
+ var prevCells = cells.slice(0, cellIndex).reverse();
1400
+ var _hasNextFocusableDate2 = prevCells.find(function (el) {
1401
+ var focusCell = el.children[0];
1402
+ return !utils.DomHandler.getAttribute(focusCell, 'data-p-disabled');
1403
+ });
1404
+ if (_hasNextFocusableDate2) {
1405
+ var _focusCell2 = _hasNextFocusableDate2.children[0];
1330
1406
  _focusCell2.tabIndex = '0';
1331
1407
  _focusCell2.focus();
1408
+ } else {
1409
+ navigateToMonth(true, groupIndex, event);
1332
1410
  }
1333
1411
  } else {
1334
1412
  navigateToMonth(true, groupIndex, event);
@@ -1336,19 +1414,23 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1336
1414
  event.preventDefault();
1337
1415
  break;
1338
1416
  }
1339
-
1340
- //right arrow
1341
- case 39:
1417
+ case 'ArrowRight':
1342
1418
  {
1343
1419
  cellContent.tabIndex = '-1';
1344
1420
  var nextCell = cell.nextElementSibling;
1345
1421
  if (nextCell) {
1346
- var _focusCell3 = nextCell.children[0];
1347
- if (utils.DomHandler.hasClass(_focusCell3, 'p-disabled')) {
1348
- navigateToMonth(false, groupIndex, event);
1349
- } else {
1422
+ var _cells = Array.from(cell.parentElement.children);
1423
+ var nextCells = _cells.slice(cellIndex + 1);
1424
+ var _hasNextFocusableDate3 = nextCells.find(function (el) {
1425
+ var focusCell = el.children[0];
1426
+ return !utils.DomHandler.getAttribute(focusCell, 'data-p-disabled');
1427
+ });
1428
+ if (_hasNextFocusableDate3) {
1429
+ var _focusCell3 = _hasNextFocusableDate3.children[0];
1350
1430
  _focusCell3.tabIndex = '0';
1351
1431
  _focusCell3.focus();
1432
+ } else {
1433
+ navigateToMonth(false, groupIndex, event);
1352
1434
  }
1353
1435
  } else {
1354
1436
  navigateToMonth(false, groupIndex, event);
@@ -1356,27 +1438,75 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1356
1438
  event.preventDefault();
1357
1439
  break;
1358
1440
  }
1359
-
1360
- //enter
1361
- case 13:
1441
+ case 'Enter':
1442
+ case 'NumpadEnter':
1443
+ case 'Space':
1362
1444
  {
1363
1445
  onDateSelect(event, date);
1364
1446
  event.preventDefault();
1365
1447
  break;
1366
1448
  }
1367
-
1368
- //escape
1369
- case 27:
1449
+ case 'Escape':
1370
1450
  {
1371
1451
  hide(null, reFocusInputField);
1372
1452
  event.preventDefault();
1373
1453
  break;
1374
1454
  }
1375
-
1376
- //tab
1377
- case 9:
1455
+ case 'Tab':
1378
1456
  {
1379
- trapFocus(event);
1457
+ if (!props.inline) trapFocus(event);
1458
+ break;
1459
+ }
1460
+ case 'Home':
1461
+ {
1462
+ cellContent.tabIndex = '-1';
1463
+ var currentRow = cell.parentElement;
1464
+ var _focusCell4 = currentRow.children[0].children[0];
1465
+ if (utils.DomHandler.getAttribute(_focusCell4, 'data-p-disabled')) {
1466
+ navigateToMonth(groupIndex, true, event);
1467
+ } else {
1468
+ _focusCell4.tabIndex = '0';
1469
+ _focusCell4.focus();
1470
+ }
1471
+ event.preventDefault();
1472
+ break;
1473
+ }
1474
+ case 'End':
1475
+ {
1476
+ cellContent.tabIndex = '-1';
1477
+ var _currentRow = cell.parentElement;
1478
+ var _focusCell5 = _currentRow.children[_currentRow.children.length - 1].children[0];
1479
+ if (utils.DomHandler.getAttribute(_focusCell5, 'data-p-disabled')) {
1480
+ navigateToMonth(groupIndex, false, event);
1481
+ } else {
1482
+ _focusCell5.tabIndex = '0';
1483
+ _focusCell5.focus();
1484
+ }
1485
+ event.preventDefault();
1486
+ break;
1487
+ }
1488
+ case 'PageUp':
1489
+ {
1490
+ cellContent.tabIndex = '-1';
1491
+ if (event.shiftKey) {
1492
+ navigation.current = {
1493
+ backward: true
1494
+ };
1495
+ navBackward(event);
1496
+ } else navigateToMonth(groupIndex, true, event);
1497
+ event.preventDefault();
1498
+ break;
1499
+ }
1500
+ case 'PageDown':
1501
+ {
1502
+ cellContent.tabIndex = '-1';
1503
+ if (event.shiftKey) {
1504
+ navigation.current = {
1505
+ backward: false
1506
+ };
1507
+ navForward(event);
1508
+ } else navigateToMonth(groupIndex, false, event);
1509
+ event.preventDefault();
1380
1510
  break;
1381
1511
  }
1382
1512
  }
@@ -1403,18 +1533,18 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1403
1533
  navForward(event);
1404
1534
  } else {
1405
1535
  var nextMonthContainer = overlayRef.current.children[groupIndex + 1];
1406
- var _focusCell4 = utils.DomHandler.findSingle(nextMonthContainer, 'table td span:not([data-p-disabled="true"])');
1407
- _focusCell4.tabIndex = '0';
1408
- _focusCell4.focus();
1536
+ var _focusCell6 = utils.DomHandler.findSingle(nextMonthContainer, 'table td span:not([data-p-disabled="true"])');
1537
+ _focusCell6.tabIndex = '0';
1538
+ _focusCell6.focus();
1409
1539
  }
1410
1540
  }
1411
1541
  };
1412
1542
  var onMonthCellKeydown = function onMonthCellKeydown(event, index) {
1413
1543
  var cell = event.currentTarget;
1414
- switch (event.which) {
1544
+ switch (event.code) {
1415
1545
  //arrows
1416
- case 38:
1417
- case 40:
1546
+ case 'ArrowUp':
1547
+ case 'ArrowDown':
1418
1548
  {
1419
1549
  cell.tabIndex = '-1';
1420
1550
  var cells = cell.parentElement.children;
@@ -1427,51 +1557,162 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1427
1557
  event.preventDefault();
1428
1558
  break;
1429
1559
  }
1430
-
1431
- //left arrow
1432
- case 37:
1560
+ case 'ArrowLeft':
1433
1561
  {
1434
1562
  cell.tabIndex = '-1';
1435
1563
  var prevCell = cell.previousElementSibling;
1436
1564
  if (prevCell) {
1437
1565
  prevCell.tabIndex = '0';
1438
1566
  prevCell.focus();
1567
+ } else {
1568
+ navigation.current = {
1569
+ backward: true
1570
+ };
1571
+ navBackward(event);
1439
1572
  }
1440
1573
  event.preventDefault();
1441
1574
  break;
1442
1575
  }
1443
-
1444
- //right arrow
1445
- case 39:
1576
+ case 'ArrowRight':
1446
1577
  {
1447
1578
  cell.tabIndex = '-1';
1448
1579
  var _nextCell = cell.nextElementSibling;
1449
1580
  if (_nextCell) {
1450
1581
  _nextCell.tabIndex = '0';
1451
1582
  _nextCell.focus();
1583
+ } else {
1584
+ navigation.current = {
1585
+ backward: false
1586
+ };
1587
+ navForward(event);
1452
1588
  }
1453
1589
  event.preventDefault();
1454
1590
  break;
1455
1591
  }
1456
-
1457
- //enter
1458
- case 13:
1592
+ case 'PageUp':
1593
+ {
1594
+ if (event.shiftKey) return;
1595
+ navigation.current = {
1596
+ backward: true
1597
+ };
1598
+ navBackward(event);
1599
+ break;
1600
+ }
1601
+ case 'PageDown':
1602
+ {
1603
+ if (event.shiftKey) return;
1604
+ navigation.current = {
1605
+ backward: false
1606
+ };
1607
+ navForward(event);
1608
+ break;
1609
+ }
1610
+ case 'Enter':
1611
+ case 'NumpadEnter':
1612
+ case 'Space':
1459
1613
  {
1614
+ if (props.view !== 'month') viewChangedWithKeyDown.current = true;
1460
1615
  onMonthSelect(event, index);
1461
1616
  event.preventDefault();
1462
1617
  break;
1463
1618
  }
1464
-
1465
- //escape
1466
- case 27:
1619
+ case 'Escape':
1467
1620
  {
1468
1621
  hide(null, reFocusInputField);
1469
1622
  event.preventDefault();
1470
1623
  break;
1471
1624
  }
1472
-
1473
- //tab
1474
- case 9:
1625
+ case 'Tab':
1626
+ {
1627
+ trapFocus(event);
1628
+ break;
1629
+ }
1630
+ }
1631
+ };
1632
+ var onYearCellKeydown = function onYearCellKeydown(event, index) {
1633
+ var cell = event.currentTarget;
1634
+ switch (event.code) {
1635
+ //arrows
1636
+ case 'ArrowUp':
1637
+ case 'ArrowDown':
1638
+ {
1639
+ cell.tabIndex = '-1';
1640
+ var cells = cell.parentElement.children;
1641
+ var cellIndex = utils.DomHandler.index(cell);
1642
+ var nextCell = cells[event.code === 'ArrowDown' ? cellIndex + 2 : cellIndex - 2];
1643
+ if (nextCell) {
1644
+ nextCell.tabIndex = '0';
1645
+ nextCell.focus();
1646
+ }
1647
+ event.preventDefault();
1648
+ break;
1649
+ }
1650
+ case 'ArrowLeft':
1651
+ {
1652
+ cell.tabIndex = '-1';
1653
+ var prevCell = cell.previousElementSibling;
1654
+ if (prevCell) {
1655
+ prevCell.tabIndex = '0';
1656
+ prevCell.focus();
1657
+ } else {
1658
+ navigation.current = {
1659
+ backward: true
1660
+ };
1661
+ navBackward(event);
1662
+ }
1663
+ event.preventDefault();
1664
+ break;
1665
+ }
1666
+ case 'ArrowRight':
1667
+ {
1668
+ cell.tabIndex = '-1';
1669
+ var _nextCell2 = cell.nextElementSibling;
1670
+ if (_nextCell2) {
1671
+ _nextCell2.tabIndex = '0';
1672
+ _nextCell2.focus();
1673
+ } else {
1674
+ navigation.current = {
1675
+ backward: false
1676
+ };
1677
+ navForward(event);
1678
+ }
1679
+ event.preventDefault();
1680
+ break;
1681
+ }
1682
+ case 'PageUp':
1683
+ {
1684
+ if (event.shiftKey) return;
1685
+ navigation.current = {
1686
+ backward: true
1687
+ };
1688
+ navBackward(event);
1689
+ break;
1690
+ }
1691
+ case 'PageDown':
1692
+ {
1693
+ if (event.shiftKey) return;
1694
+ navigation.current = {
1695
+ backward: false
1696
+ };
1697
+ navForward(event);
1698
+ break;
1699
+ }
1700
+ case 'Enter':
1701
+ case 'NumpadEnter':
1702
+ case 'Space':
1703
+ {
1704
+ if (props.view !== 'year') viewChangedWithKeyDown.current = true;
1705
+ onYearSelect(event, index);
1706
+ event.preventDefault();
1707
+ break;
1708
+ }
1709
+ case 'Escape':
1710
+ {
1711
+ hide(null, reFocusInputField);
1712
+ event.preventDefault();
1713
+ break;
1714
+ }
1715
+ case 'Tab':
1475
1716
  {
1476
1717
  trapFocus(event);
1477
1718
  break;
@@ -1588,10 +1829,16 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1588
1829
  return _currentYear;
1589
1830
  };
1590
1831
  var switchToMonthView = function switchToMonthView(event) {
1832
+ if (event && event.code && (event.code === 'Enter' || event.code === 'Space')) {
1833
+ viewChangedWithKeyDown.current = true;
1834
+ }
1591
1835
  setCurrentView('month');
1592
1836
  event.preventDefault();
1593
1837
  };
1594
1838
  var switchToYearView = function switchToYearView(event) {
1839
+ if (event && event.code && (event.code === 'Enter' || event.code === 'Space')) {
1840
+ viewChangedWithKeyDown.current = true;
1841
+ }
1595
1842
  setCurrentView('year');
1596
1843
  event.preventDefault();
1597
1844
  };
@@ -1732,7 +1979,6 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
1732
1979
  var onOverlayEntered = function onOverlayEntered() {
1733
1980
  bindOverlayListener();
1734
1981
  props.onShow && props.onShow();
1735
- utils.DomHandler.focusFirstElement(overlayRef.current);
1736
1982
  setFocusedState(false);
1737
1983
  };
1738
1984
  var onOverlayExit = function onOverlayExit() {
@@ -2132,27 +2378,34 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2132
2378
  return today.getDate() === day && today.getMonth() === month && today.getFullYear() === year;
2133
2379
  };
2134
2380
  var isDayDisabled = function isDayDisabled(day, month, year) {
2381
+ var isDisabled = false;
2382
+
2383
+ // first check for disabled dates
2135
2384
  if (props.disabledDates) {
2136
2385
  if (props.disabledDates.some(function (d) {
2137
2386
  return d.getFullYear() === year && d.getMonth() === month && d.getDate() === day;
2138
2387
  })) {
2139
- return true;
2140
- }
2141
- } else if (props.enabledDates) {
2142
- if (!props.enabledDates.some(function (d) {
2143
- return d.getFullYear() === year && d.getMonth() === month && d.getDate() === day;
2144
- })) {
2145
- return true;
2388
+ isDisabled = true;
2146
2389
  }
2147
2390
  }
2148
- if (props.disabledDays && currentView === 'date') {
2391
+
2392
+ // next if not disabled then check for disabled days
2393
+ if (!isDisabled && props.disabledDays && currentView === 'date') {
2149
2394
  var weekday = new Date(year, month, day);
2150
2395
  var weekdayNumber = weekday.getDay();
2151
2396
  if (props.disabledDays.indexOf(weekdayNumber) !== -1) {
2152
- return true;
2397
+ isDisabled = true;
2153
2398
  }
2154
2399
  }
2155
- return false;
2400
+
2401
+ // last check for enabled dates to force dates enabled
2402
+ if (props.enabledDates) {
2403
+ var isEnabled = props.enabledDates.some(function (d) {
2404
+ return d.getFullYear() === year && d.getMonth() === month && d.getDate() === day;
2405
+ });
2406
+ isDisabled = isDisabled ? !isEnabled : isEnabled;
2407
+ }
2408
+ return isDisabled;
2156
2409
  };
2157
2410
  var isMonthYearDisabled = function isMonthYearDisabled(month, year) {
2158
2411
  var daysCountInAllMonth = month === -1 ? new Array(12).fill(0).map(function (_, i) {
@@ -2603,6 +2856,10 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2603
2856
  setCurrentMonth(viewDate.getMonth());
2604
2857
  setCurrentYear(viewDate.getFullYear());
2605
2858
  setCurrentView(props.view);
2859
+ if (!idState) {
2860
+ var uniqueId = utils.UniqueComponentId();
2861
+ !idState && setIdState(uniqueId);
2862
+ }
2606
2863
  if (props.inline) {
2607
2864
  overlayRef && overlayRef.current.setAttribute(attributeSelector, '');
2608
2865
  if (!props.disabled) {
@@ -2650,8 +2907,14 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2650
2907
  // eslint-disable-next-line react-hooks/exhaustive-deps
2651
2908
  }, [props.disabled, props.mask, props.readOnlyInput]);
2652
2909
  hooks.useUpdateEffect(function () {
2653
- setCurrentView(props.view);
2910
+ if (viewChangedWithKeyDown.current) {
2911
+ setCurrentView(props.view);
2912
+ }
2913
+ viewChangedWithKeyDown.current = false;
2654
2914
  }, [props.view]);
2915
+ hooks.useUpdateEffect(function () {
2916
+ focusToFirstCell();
2917
+ }, [currentView]);
2655
2918
  hooks.useUpdateEffect(function () {
2656
2919
  if (!props.onViewDateChange && !viewStateChanged.current) {
2657
2920
  setValue(props.value);
@@ -2742,12 +3005,16 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2742
3005
  if (Array.isArray(prevPropValue)) {
2743
3006
  prevPropValue = prevPropValue[0];
2744
3007
  }
3008
+ var viewDate = props.viewDate && isValidDate(props.viewDate) ? props.viewDate : propValue && isValidDate(propValue) ? propValue : new Date();
3009
+ if (isClearClicked.current && props.showTime) {
3010
+ viewDate.setHours(0, 0, 0);
3011
+ isClearClicked.current = false;
3012
+ }
2745
3013
  if (!prevPropValue && propValue || propValue && propValue instanceof Date && propValue.getTime() !== prevPropValue.getTime()) {
2746
- var viewDate = props.viewDate && isValidDate(props.viewDate) ? props.viewDate : propValue && isValidDate(propValue) ? propValue : new Date();
2747
3014
  validateDate(viewDate);
2748
- setViewDateState(viewDate);
2749
- viewStateChanged.current = true;
2750
3015
  }
3016
+ setViewDateState(viewDate);
3017
+ viewStateChanged.current = true;
2751
3018
  };
2752
3019
  var createBackwardNavigator = function createBackwardNavigator(isVisible) {
2753
3020
  var navigatorProps = isVisible ? {
@@ -2767,9 +3034,15 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2767
3034
  var backwardNavigatorIcon = utils.IconUtils.getJSXIcon(icon, _objectSpread({}, previousIconProps), {
2768
3035
  props: props
2769
3036
  });
3037
+ var _localeOptions4 = PrimeReact.localeOptions(props.locale),
3038
+ prevDecade = _localeOptions4.prevDecade,
3039
+ prevYear = _localeOptions4.prevYear,
3040
+ prevMonth = _localeOptions4.prevMonth;
3041
+ var previousButtonLabel = currentView === 'year' ? prevDecade : currentView === 'month' ? prevYear : prevMonth;
2770
3042
  var previousButtonProps = mergeProps(_objectSpread({
2771
3043
  type: 'button',
2772
- className: cx('previousButton')
3044
+ className: cx('previousButton'),
3045
+ 'aria-label': previousButtonLabel
2773
3046
  }, navigatorProps), ptm('previousButton'));
2774
3047
  return /*#__PURE__*/React__namespace.createElement("button", _extends({
2775
3048
  ref: previousButton
@@ -2793,9 +3066,15 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2793
3066
  var forwardNavigatorIcon = utils.IconUtils.getJSXIcon(icon, _objectSpread({}, nextIconProps), {
2794
3067
  props: props
2795
3068
  });
3069
+ var _localeOptions5 = PrimeReact.localeOptions(props.locale),
3070
+ nextDecade = _localeOptions5.nextDecade,
3071
+ nextYear = _localeOptions5.nextYear,
3072
+ nextMonth = _localeOptions5.nextMonth;
3073
+ var nextButtonLabel = currentView === 'year' ? nextDecade : currentView === 'month' ? nextYear : nextMonth;
2796
3074
  var nextButtonProps = mergeProps(_objectSpread({
2797
3075
  type: 'button',
2798
- className: cx('nextButton')
3076
+ className: cx('nextButton'),
3077
+ 'aria-label': nextButtonLabel
2799
3078
  }, navigatorProps), ptm('nextButton'));
2800
3079
  return /*#__PURE__*/React__namespace.createElement("button", _extends({
2801
3080
  ref: nextButton
@@ -2852,6 +3131,8 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2852
3131
  }
2853
3132
  var monthTitleProps = mergeProps({
2854
3133
  className: cx('monthTitle'),
3134
+ onKeyDown: onContainerButtonKeydown,
3135
+ 'aria-label': PrimeReact.localeOption('chooseMonth', props.locale),
2855
3136
  onClick: switchToMonthView,
2856
3137
  disabled: switchViewButtonDisabled()
2857
3138
  }, ptm('monthTitle'));
@@ -2910,6 +3191,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2910
3191
  var displayYear = props.numberOfMonths > 1 ? metaYear : currentYear;
2911
3192
  var yearTitleProps = mergeProps({
2912
3193
  className: cx('yearTitle'),
3194
+ 'aria-label': PrimeReact.localeOption('chooseYear', props.locale),
2913
3195
  onClick: function onClick(e) {
2914
3196
  return switchToYearView(e);
2915
3197
  },
@@ -2968,25 +3250,33 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
2968
3250
  };
2969
3251
  var createDateCellContent = function createDateCellContent(date, className, groupIndex) {
2970
3252
  var content = props.dateTemplate ? props.dateTemplate(date) : date.day;
3253
+ var selected = isSelected(date);
2971
3254
  var dayLabelProps = mergeProps({
2972
3255
  className: cx('dayLabel', {
2973
3256
  className: className
2974
3257
  }),
3258
+ 'aria-selected': selected,
3259
+ 'aria-disabled': !date.selectable,
2975
3260
  onClick: function onClick(e) {
2976
3261
  return onDateSelect(e, date);
2977
3262
  },
2978
3263
  onKeyDown: function onKeyDown(e) {
2979
3264
  return onDateCellKeydown(e, date, groupIndex);
2980
3265
  },
2981
- 'data-p-highlight': isSelected(date),
3266
+ 'data-p-highlight': selected,
2982
3267
  'data-p-disabled': !date.selectable
2983
3268
  }, ptm('dayLabel', {
2984
3269
  context: {
2985
- selected: isSelected(date),
3270
+ selected: selected,
2986
3271
  disabled: !date.selectable
2987
3272
  }
2988
3273
  }));
2989
- return /*#__PURE__*/React__namespace.createElement("span", dayLabelProps, content);
3274
+ return /*#__PURE__*/React__namespace.createElement("span", dayLabelProps, content, selected && /*#__PURE__*/React__namespace.createElement("div", {
3275
+ "aria-live": "polite",
3276
+ className: "p-hidden-accessible",
3277
+ "data-p-hidden-accessible": true,
3278
+ pt: ptm('hiddenSelectedDay')
3279
+ }));
2990
3280
  };
2991
3281
  var createWeek = function createWeek(weekDates, weekNumber, groupIndex) {
2992
3282
  var week = weekDates.map(function (date) {
@@ -3000,6 +3290,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3000
3290
  className: cx('day', {
3001
3291
  date: date
3002
3292
  }),
3293
+ 'aria-label': date.day,
3003
3294
  'data-p-today': date.today,
3004
3295
  'data-p-other-month': date.otherMonth
3005
3296
  }, ptm('day', {
@@ -3048,6 +3339,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3048
3339
  key: utils.UniqueComponentId('calendar_container_')
3049
3340
  }, ptm('container'));
3050
3341
  var tableProps = mergeProps({
3342
+ role: 'grid',
3051
3343
  className: cx('table')
3052
3344
  }, ptm('table'));
3053
3345
  var tableHeaderProps = mergeProps(ptm('tableHeader'));
@@ -3151,6 +3443,9 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3151
3443
  if (hour === 0) hour = 12;else if (hour > 11 && hour !== 12) hour = hour - 12;
3152
3444
  }
3153
3445
  var hourProps = mergeProps(ptm('hour'));
3446
+ var _localeOptions6 = PrimeReact.localeOptions(props.locale),
3447
+ nextHour = _localeOptions6.nextHour,
3448
+ prevHour = _localeOptions6.prevHour;
3154
3449
  var hourDisplay = hour < 10 ? '0' + hour : hour;
3155
3450
  var hourPickerProps = mergeProps({
3156
3451
  className: cx('hourPicker')
@@ -3158,26 +3453,30 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3158
3453
  var incrementButtonProps = mergeProps({
3159
3454
  type: 'button',
3160
3455
  className: cx('incrementButton'),
3456
+ 'aria-label': nextHour,
3161
3457
  onMouseDown: function onMouseDown(e) {
3162
3458
  return onTimePickerElementMouseDown(e, 0, 1);
3163
3459
  },
3164
3460
  onMouseUp: onTimePickerElementMouseUp,
3165
3461
  onMouseLeave: onTimePickerElementMouseLeave,
3166
3462
  onKeyDown: function onKeyDown(e) {
3167
- return onContainerButtonKeydown(e);
3168
- }
3463
+ return onPickerKeyDown(e, 0, 1);
3464
+ },
3465
+ onKeyUp: onPickerKeyUp
3169
3466
  }, ptm('incrementButton'));
3170
3467
  var decrementButtonProps = mergeProps({
3171
3468
  type: 'button',
3172
3469
  className: cx('decrementButton'),
3470
+ 'aria-label': prevHour,
3173
3471
  onMouseDown: function onMouseDown(e) {
3174
3472
  return onTimePickerElementMouseDown(e, 0, -1);
3175
3473
  },
3176
3474
  onMouseUp: onTimePickerElementMouseUp,
3177
3475
  onMouseLeave: onTimePickerElementMouseLeave,
3178
3476
  onKeyDown: function onKeyDown(e) {
3179
- return onContainerButtonKeydown(e);
3180
- }
3477
+ return onPickerKeyDown(e, 0, -1);
3478
+ },
3479
+ onKeyUp: onPickerKeyUp
3181
3480
  }, ptm('decrementButton'));
3182
3481
  return /*#__PURE__*/React__namespace.createElement("div", hourPickerProps, /*#__PURE__*/React__namespace.createElement("button", incrementButtonProps, incrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)), /*#__PURE__*/React__namespace.createElement("span", hourProps, hourDisplay), /*#__PURE__*/React__namespace.createElement("button", decrementButtonProps, decrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)));
3183
3482
  };
@@ -3186,6 +3485,9 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3186
3485
  var minute = doStepMinute(currentTime.getMinutes());
3187
3486
  minute = minute > 59 ? minute - 60 : minute;
3188
3487
  var minuteProps = mergeProps(ptm('minute'));
3488
+ var _localeOptions7 = PrimeReact.localeOptions(props.locale),
3489
+ nextMinute = _localeOptions7.nextMinute,
3490
+ prevMinute = _localeOptions7.prevMinute;
3189
3491
  var minuteDisplay = minute < 10 ? '0' + minute : minute;
3190
3492
  var minutePickerProps = mergeProps({
3191
3493
  className: cx('minutePicker')
@@ -3193,32 +3495,39 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3193
3495
  var incrementButtonProps = mergeProps({
3194
3496
  type: 'button',
3195
3497
  className: cx('incrementButton'),
3498
+ 'aria-label': nextMinute,
3196
3499
  onMouseDown: function onMouseDown(e) {
3197
3500
  return onTimePickerElementMouseDown(e, 1, 1);
3198
3501
  },
3199
3502
  onMouseUp: onTimePickerElementMouseUp,
3200
3503
  onMouseLeave: onTimePickerElementMouseLeave,
3201
3504
  onKeyDown: function onKeyDown(e) {
3202
- return onContainerButtonKeydown(e);
3203
- }
3505
+ return onPickerKeyDown(e, 1, 1);
3506
+ },
3507
+ onKeyUp: onPickerKeyUp
3204
3508
  }, ptm('incrementButton'));
3205
3509
  var decrementButtonProps = mergeProps({
3206
3510
  type: 'button',
3207
3511
  className: cx('decrementButton'),
3512
+ 'aria-label': prevMinute,
3208
3513
  onMouseDown: function onMouseDown(e) {
3209
3514
  return onTimePickerElementMouseDown(e, 1, -1);
3210
3515
  },
3211
3516
  onMouseUp: onTimePickerElementMouseUp,
3212
3517
  onMouseLeave: onTimePickerElementMouseLeave,
3213
3518
  onKeyDown: function onKeyDown(e) {
3214
- return onContainerButtonKeydown(e);
3215
- }
3519
+ return onPickerKeyDown(e, 1, -1);
3520
+ },
3521
+ onKeyUp: onPickerKeyUp
3216
3522
  }, ptm('decrementButton'));
3217
3523
  return /*#__PURE__*/React__namespace.createElement("div", minutePickerProps, /*#__PURE__*/React__namespace.createElement("button", incrementButtonProps, incrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)), /*#__PURE__*/React__namespace.createElement("span", minuteProps, minuteDisplay), /*#__PURE__*/React__namespace.createElement("button", decrementButtonProps, decrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)));
3218
3524
  };
3219
3525
  var createSecondPicker = function createSecondPicker() {
3220
3526
  if (props.showSeconds) {
3221
3527
  var currentTime = getCurrentDateTime();
3528
+ var _localeOptions8 = PrimeReact.localeOptions(props.locale),
3529
+ nextSecond = _localeOptions8.nextSecond,
3530
+ prevSecond = _localeOptions8.prevSecond;
3222
3531
  var secondProps = mergeProps(ptm('second'));
3223
3532
  var second = currentTime.getSeconds();
3224
3533
  var secondDisplay = second < 10 ? '0' + second : second;
@@ -3228,26 +3537,30 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3228
3537
  var incrementButtonProps = mergeProps({
3229
3538
  type: 'button',
3230
3539
  className: cx('incrementButton'),
3540
+ 'aria-label': nextSecond,
3231
3541
  onMouseDown: function onMouseDown(e) {
3232
3542
  return onTimePickerElementMouseDown(e, 2, 1);
3233
3543
  },
3234
3544
  onMouseUp: onTimePickerElementMouseUp,
3235
3545
  onMouseLeave: onTimePickerElementMouseLeave,
3236
3546
  onKeyDown: function onKeyDown(e) {
3237
- return onContainerButtonKeydown(e);
3238
- }
3547
+ return onPickerKeyDown(e, 2, 1);
3548
+ },
3549
+ onKeyUp: onPickerKeyUp
3239
3550
  }, ptm('incrementButton'));
3240
3551
  var decrementButtonProps = mergeProps({
3241
3552
  type: 'button',
3242
3553
  className: cx('decrementButton'),
3554
+ 'aria-label': prevSecond,
3243
3555
  onMouseDown: function onMouseDown(e) {
3244
3556
  return onTimePickerElementMouseDown(e, 2, -1);
3245
3557
  },
3246
3558
  onMouseUp: onTimePickerElementMouseUp,
3247
3559
  onMouseLeave: onTimePickerElementMouseLeave,
3248
3560
  onKeyDown: function onKeyDown(e) {
3249
- return onContainerButtonKeydown(e);
3250
- }
3561
+ return onPickerKeyDown(e, 2, -1);
3562
+ },
3563
+ onKeyUp: onPickerKeyUp
3251
3564
  }, ptm('decrementButton'));
3252
3565
  return /*#__PURE__*/React__namespace.createElement("div", secondPickerProps, /*#__PURE__*/React__namespace.createElement("button", incrementButtonProps, incrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)), /*#__PURE__*/React__namespace.createElement("span", secondProps, secondDisplay), /*#__PURE__*/React__namespace.createElement("button", decrementButtonProps, decrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)));
3253
3566
  }
@@ -3256,6 +3569,9 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3256
3569
  var createMiliSecondPicker = function createMiliSecondPicker() {
3257
3570
  if (props.showMillisec) {
3258
3571
  var currentTime = getCurrentDateTime();
3572
+ var _localeOptions9 = PrimeReact.localeOptions(props.locale),
3573
+ nextMilliSecond = _localeOptions9.nextMilliSecond,
3574
+ prevMilliSecond = _localeOptions9.prevMilliSecond;
3259
3575
  var millisecondProps = mergeProps(ptm('millisecond'));
3260
3576
  var millisecond = currentTime.getMilliseconds();
3261
3577
  var millisecondDisplay = millisecond < 100 ? (millisecond < 10 ? '00' : '0') + millisecond : millisecond;
@@ -3265,26 +3581,30 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3265
3581
  var incrementButtonProps = mergeProps({
3266
3582
  type: 'button',
3267
3583
  className: cx('incrementButton'),
3584
+ 'aria-label': nextMilliSecond,
3268
3585
  onMouseDown: function onMouseDown(e) {
3269
3586
  return onTimePickerElementMouseDown(e, 3, 1);
3270
3587
  },
3271
3588
  onMouseUp: onTimePickerElementMouseUp,
3272
3589
  onMouseLeave: onTimePickerElementMouseLeave,
3273
3590
  onKeyDown: function onKeyDown(e) {
3274
- return onContainerButtonKeydown(e);
3275
- }
3591
+ return onPickerKeyDown(e, 3, 1);
3592
+ },
3593
+ onKeyUp: onPickerKeyUp
3276
3594
  }, ptm('incrementButton'));
3277
3595
  var decrementButtonProps = mergeProps({
3278
3596
  type: 'button',
3279
3597
  className: cx('decrementButton'),
3598
+ 'aria-label': prevMilliSecond,
3280
3599
  onMouseDown: function onMouseDown(e) {
3281
3600
  return onTimePickerElementMouseDown(e, 3, -1);
3282
3601
  },
3283
3602
  onMouseUp: onTimePickerElementMouseUp,
3284
3603
  onMouseLeave: onTimePickerElementMouseLeave,
3285
3604
  onKeyDown: function onKeyDown(e) {
3286
- return onContainerButtonKeydown(e);
3287
- }
3605
+ return onPickerKeyDown(e, 3, -1);
3606
+ },
3607
+ onKeyUp: onPickerKeyUp
3288
3608
  }, ptm('decrementButton'));
3289
3609
  return /*#__PURE__*/React__namespace.createElement("div", millisecondPickerProps, /*#__PURE__*/React__namespace.createElement("button", incrementButtonProps, incrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)), /*#__PURE__*/React__namespace.createElement("span", millisecondProps, millisecondDisplay), /*#__PURE__*/React__namespace.createElement("button", decrementButtonProps, decrementIcon, /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null)));
3290
3610
  }
@@ -3293,6 +3613,9 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3293
3613
  var createAmPmPicker = function createAmPmPicker() {
3294
3614
  if (props.hourFormat === '12') {
3295
3615
  var currentTime = getCurrentDateTime();
3616
+ var _localeOptions10 = PrimeReact.localeOptions(props.locale),
3617
+ am = _localeOptions10.am,
3618
+ pm = _localeOptions10.pm;
3296
3619
  var hour = currentTime.getHours();
3297
3620
  var display = hour > 11 ? 'PM' : 'AM';
3298
3621
  var ampmProps = mergeProps(ptm('ampm'));
@@ -3302,6 +3625,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3302
3625
  var incrementButtonProps = mergeProps({
3303
3626
  type: 'button',
3304
3627
  className: cx('incrementButton'),
3628
+ 'aria-label': am,
3305
3629
  onClick: function onClick(e) {
3306
3630
  return toggleAmPm(e);
3307
3631
  }
@@ -3309,6 +3633,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3309
3633
  var decrementButtonProps = mergeProps({
3310
3634
  type: 'button',
3311
3635
  className: cx('decrementButton'),
3636
+ 'aria-label': pm,
3312
3637
  onClick: function onClick(e) {
3313
3638
  return toggleAmPm(e);
3314
3639
  }
@@ -3340,6 +3665,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3340
3665
  id: props.inputId,
3341
3666
  name: props.name,
3342
3667
  type: "text",
3668
+ role: "combobox",
3343
3669
  className: props.inputClassName,
3344
3670
  style: props.inputStyle,
3345
3671
  readOnly: props.readOnlyInput,
@@ -3352,7 +3678,12 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3352
3678
  onFocus: onInputFocus,
3353
3679
  onBlur: onInputBlur,
3354
3680
  onKeyDown: onInputKeyDown,
3681
+ "aria-expanded": overlayVisibleState,
3682
+ "aria-autocomplete": "none",
3683
+ "aria-haspopup": "dialog",
3684
+ "aria-controls": panelId,
3355
3685
  "aria-labelledby": props.ariaLabelledBy,
3686
+ "aria-label": props.ariaLabel,
3356
3687
  inputMode: props.inputMode,
3357
3688
  tooltip: props.tooltip,
3358
3689
  tooltipOptions: props.tooltipOptions,
@@ -3372,6 +3703,10 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3372
3703
  onClick: onButtonClick,
3373
3704
  tabIndex: "-1",
3374
3705
  disabled: props.disabled,
3706
+ "aria-haspopup": "dialog",
3707
+ "aria-label": PrimeReact.localeOption('chooseDate', props.locale),
3708
+ "aria-expanded": overlayVisibleState,
3709
+ "aria-controls": panelId,
3375
3710
  className: cx('dropdownButton'),
3376
3711
  pt: ptm('dropdownButton'),
3377
3712
  __parentMetadata: {
@@ -3391,21 +3726,27 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3391
3726
  };
3392
3727
  var createButtonBar = function createButtonBar() {
3393
3728
  if (props.showButtonBar) {
3394
- var _localeOptions4 = PrimeReact.localeOptions(props.locale),
3395
- today = _localeOptions4.today,
3396
- clear = _localeOptions4.clear;
3729
+ var _localeOptions11 = PrimeReact.localeOptions(props.locale),
3730
+ today = _localeOptions11.today,
3731
+ clear = _localeOptions11.clear,
3732
+ now = _localeOptions11.now;
3733
+ var nowDate = new Date();
3734
+ var isHidden = props.minDate && props.minDate > nowDate || props.maxDate && props.maxDate < nowDate;
3397
3735
  var buttonbarProps = mergeProps({
3398
3736
  className: cx('buttonbar')
3399
3737
  }, ptm('buttonbar'));
3400
3738
  return /*#__PURE__*/React__namespace.createElement("div", buttonbarProps, /*#__PURE__*/React__namespace.createElement(button.Button, {
3401
3739
  type: "button",
3402
- label: today,
3740
+ label: props.showTime ? now : today,
3403
3741
  onClick: onTodayButtonClick,
3404
3742
  onKeyDown: function onKeyDown(e) {
3405
3743
  return onContainerButtonKeydown(e);
3406
3744
  },
3407
3745
  className: utils.classNames(props.todayButtonClassName, cx('todayButton')),
3408
- pt: ptm('todayButton')
3746
+ pt: ptm('todayButton'),
3747
+ style: isHidden ? {
3748
+ visibility: 'hidden'
3749
+ } : undefined
3409
3750
  }), /*#__PURE__*/React__namespace.createElement(button.Button, {
3410
3751
  type: "button",
3411
3752
  label: clear,
@@ -3435,6 +3776,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3435
3776
  className: cx('monthPicker')
3436
3777
  }, ptm('monthPicker'));
3437
3778
  return /*#__PURE__*/React__namespace.createElement("div", monthPickerProps, monthPickerValues().map(function (m, i) {
3779
+ var selected = isMonthSelected(i);
3438
3780
  var monthProps = mergeProps({
3439
3781
  className: cx('month', {
3440
3782
  isMonthSelected: isMonthSelected,
@@ -3449,18 +3791,23 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3449
3791
  return onMonthCellKeydown(event, i);
3450
3792
  },
3451
3793
  'data-p-disabled': isMonthYearDisabled(i, currentYear),
3452
- 'data-p-highlight': isMonthSelected(i)
3794
+ 'data-p-highlight': selected
3453
3795
  }, ptm('month', {
3454
3796
  context: {
3455
3797
  month: m,
3456
3798
  monthIndex: i,
3457
- selected: isMonthSelected(i),
3799
+ selected: selected,
3458
3800
  disabled: isMonthYearDisabled(i, currentYear)
3459
3801
  }
3460
3802
  }));
3461
3803
  return /*#__PURE__*/React__namespace.createElement("span", _extends({}, monthProps, {
3462
3804
  key: "month".concat(i + 1)
3463
- }), m);
3805
+ }), m, selected && /*#__PURE__*/React__namespace.createElement("div", {
3806
+ "aria-live": "polite",
3807
+ className: "p-hidden-accessible",
3808
+ "data-p-hidden-accessible": true,
3809
+ pt: ptm('hiddenMonth')
3810
+ }, m));
3464
3811
  }));
3465
3812
  }
3466
3813
  return null;
@@ -3471,6 +3818,7 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3471
3818
  className: cx('yearPicker')
3472
3819
  }, ptm('yearPicker'));
3473
3820
  return /*#__PURE__*/React__namespace.createElement("div", yearPickerProps, yearPickerValues().map(function (y, i) {
3821
+ var selected = isYearSelected(y);
3474
3822
  var yearProps = mergeProps({
3475
3823
  className: cx('year', {
3476
3824
  isYearSelected: isYearSelected,
@@ -3480,19 +3828,27 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3480
3828
  onClick: function onClick(event) {
3481
3829
  return onYearSelect(event, y);
3482
3830
  },
3831
+ onKeyDown: function onKeyDown(event) {
3832
+ return onYearCellKeydown(event, y);
3833
+ },
3483
3834
  'data-p-highlight': isYearSelected(y),
3484
3835
  'data-p-disabled': isMonthYearDisabled(-1, y)
3485
3836
  }, ptm('year', {
3486
3837
  context: {
3487
3838
  year: y,
3488
3839
  yearIndex: i,
3489
- selected: isYearSelected(i),
3840
+ selected: selected,
3490
3841
  disabled: isMonthYearDisabled(-1, y)
3491
3842
  }
3492
3843
  }));
3493
3844
  return /*#__PURE__*/React__namespace.createElement("span", _extends({}, yearProps, {
3494
3845
  key: "year".concat(i + 1)
3495
- }), y);
3846
+ }), y, selected && /*#__PURE__*/React__namespace.createElement("div", {
3847
+ "aria-live": "polite",
3848
+ className: "p-hidden-accessible",
3849
+ "data-p-hidden-accessible": true,
3850
+ pt: ptm('hiddenYear')
3851
+ }, y));
3496
3852
  }));
3497
3853
  }
3498
3854
  return null;
@@ -3519,7 +3875,8 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3519
3875
  id: props.id,
3520
3876
  className: utils.classNames(props.className, cx('root', {
3521
3877
  focusedState: focusedState,
3522
- isFilled: isFilled
3878
+ isFilled: isFilled,
3879
+ panelVisible: visible
3523
3880
  })),
3524
3881
  style: props.style
3525
3882
  }, CalendarBase.getOtherProps(props), ptm('root'));
@@ -3527,6 +3884,8 @@ var Calendar = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
3527
3884
  ref: elementRef
3528
3885
  }, rootProps), content, /*#__PURE__*/React__namespace.createElement(CalendarPanel, {
3529
3886
  hostName: "Calendar",
3887
+ id: panelId,
3888
+ locale: props.locale,
3530
3889
  ref: overlayRef,
3531
3890
  className: panelClassName,
3532
3891
  style: props.panelStyle,