@progress/kendo-react-dateinputs 5.18.0-dev.202309081432 → 5.18.0-dev.202309111325

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.
@@ -15,6 +15,18 @@ export interface TimePickerChangeEvent {
15
15
  show: boolean;
16
16
  target: TimePicker;
17
17
  }
18
+ /**
19
+ * The arguments for the `onOpen` event of the TimePicker.
20
+ */
21
+ export interface TimePickerOpenEvent {
22
+ target: TimePicker;
23
+ }
24
+ /**
25
+ * The arguments for the `onClose` event of the TimePicker.
26
+ */
27
+ export interface TimePickerCloseEvent {
28
+ target: TimePicker;
29
+ }
18
30
  /**
19
31
  * Represents the props of the [KendoReact TimePicker component]({% slug overview_timepicker %}).
20
32
  */
@@ -27,6 +39,14 @@ export interface TimePickerProps extends TimePickerSettings, FormComponentProps
27
39
  * Fires each time the user selects a new value ([see example]({% slug controlled_timepicker %}#toc-controlling-the-date-value)).
28
40
  */
29
41
  onChange?: (event: TimePickerChangeEvent) => void;
42
+ /**
43
+ * Fires each time the popup is opened.
44
+ */
45
+ onOpen?: (event: TimePickerOpenEvent) => void;
46
+ /**
47
+ * Fires each time the popup is closed.
48
+ */
49
+ onClose?: (event: TimePickerCloseEvent) => void;
30
50
  /**
31
51
  * Specifies the value of the TimePicker ([see example]({% slug controlled_timepicker %}#toc-controlling-the-date-value)).
32
52
  *
@@ -133,8 +133,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
133
133
  };
134
134
  _this.handleValueChange = function (event) {
135
135
  _this.setState({
136
- value: (0, kendo_date_math_1.cloneDate)(event.value || _this.state.candidate),
137
- show: false
136
+ value: (0, kendo_date_math_1.cloneDate)(event.value || _this.state.candidate)
138
137
  });
139
138
  _this.valueDuringOnChange = event.value;
140
139
  _this.showDuringOnChange = false;
@@ -152,6 +151,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
152
151
  }
153
152
  _this.valueDuringOnChange = undefined;
154
153
  _this.showDuringOnChange = undefined;
154
+ _this.setShow(false);
155
155
  };
156
156
  _this.handleFocus = function () {
157
157
  _this.setState({ focused: true });
@@ -463,7 +463,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
463
463
  _b['k-disabled'] = _this.props.disabled,
464
464
  _b), className), onKeyDown: _this.handleKeyDown, style: { width: width }, onFocus: onFocus, onBlur: onBlur, onClick: _this.mobileMode ? _this.handleIconClick : undefined },
465
465
  React.createElement(_this.dateInputComp, __assign({ _ref: _this._dateInput, ariaRole: "combobox", ariaControls: _this._popupId }, dateInputProps)),
466
- React.createElement(kendo_react_buttons_1.Button, __assign({ tabIndex: -1, type: "button", icon: 'clock', svgIcon: kendo_svg_icons_1.clockIcon, onMouseDown: _this.handleIconMouseDown, onClick: _this.handleIconClick, title: toggleTimeMessage, className: "k-input-button", rounded: null }, {
466
+ React.createElement(kendo_react_buttons_1.Button, __assign({ tabIndex: -1, type: "button", icon: 'clock', svgIcon: kendo_svg_icons_1.clockIcon, onMouseDown: _this.handleIconMouseDown, onClick: _this.mobileMode ? undefined : _this.handleIconClick, title: toggleTimeMessage, className: "k-input-button", rounded: null }, {
467
467
  'aria-label': toggleClockMessage
468
468
  })),
469
469
  !_this.mobileMode && _this.renderPopup()),
@@ -477,10 +477,21 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
477
477
  return (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, date);
478
478
  };
479
479
  TimePickerWithoutContext.prototype.setShow = function (show) {
480
+ var _a = this.props, onOpen = _a.onOpen, onClose = _a.onClose;
480
481
  if (this.show === show) {
481
482
  return;
482
483
  }
483
484
  this.setState({ show: show });
485
+ if (show && onOpen) {
486
+ onOpen.call(undefined, {
487
+ target: this
488
+ });
489
+ }
490
+ if (!show && onClose) {
491
+ onClose.call(undefined, {
492
+ target: this
493
+ });
494
+ }
484
495
  };
485
496
  TimePickerWithoutContext.prototype.mergeTime = function (value) {
486
497
  return this.value && value ? (0, utils_1.setTime)(this.value, value) : value;