@progress/kendo-react-dateinputs 5.14.0-dev.202306011625 → 5.14.0-dev.202306020002
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.
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/dist/es/dateinput/DateInput.js +9 -5
- package/dist/es/daterangepicker/DateRangePicker.js +6 -4
- package/dist/es/datetimepicker/DateTimeSelector.js +4 -3
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.js +3 -2
- package/dist/es/timepicker/TimePart.js +3 -2
- package/dist/es/timepicker/TimeSelector.js +4 -3
- package/dist/npm/dateinput/DateInput.js +8 -4
- package/dist/npm/daterangepicker/DateRangePicker.js +5 -3
- package/dist/npm/datetimepicker/DateTimeSelector.js +3 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimeList.js +2 -1
- package/dist/npm/timepicker/TimePart.js +2 -1
- package/dist/npm/timepicker/TimeSelector.js +3 -2
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -40,7 +40,7 @@ import { Button } from '@progress/kendo-react-buttons';
|
|
|
40
40
|
import { caretAltUpIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';
|
|
41
41
|
import { registerForIntl, provideIntlService, registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
42
42
|
import { KendoDate } from './models';
|
|
43
|
-
import { guid, AsyncFocusBlur, noop, classNames, createPropsContext, withPropsContext, kendoThemeMaps } from '@progress/kendo-react-common';
|
|
43
|
+
import { guid, AsyncFocusBlur, noop, classNames, createPropsContext, withPropsContext, kendoThemeMaps, getActiveElement } from '@progress/kendo-react-common';
|
|
44
44
|
import { FloatingLabel } from '@progress/kendo-react-labels';
|
|
45
45
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
46
46
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -94,8 +94,9 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
94
94
|
_this.spinnersMouseDown = function (event) {
|
|
95
95
|
/* do not steal focus from input when changing value with spinners */
|
|
96
96
|
event.preventDefault();
|
|
97
|
+
var activeElement = getActiveElement(document);
|
|
97
98
|
/* manually focus the input in case the user clicks the spinners first */
|
|
98
|
-
if (_this.element &&
|
|
99
|
+
if (_this.element && activeElement !== _this.element) {
|
|
99
100
|
_this.element.focus({ preventScroll: true });
|
|
100
101
|
}
|
|
101
102
|
};
|
|
@@ -133,12 +134,14 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
133
134
|
_this.setSelection(_this.selectionByIndex(_this.selection.start));
|
|
134
135
|
};
|
|
135
136
|
_this.nativeWheel = function (event) {
|
|
136
|
-
|
|
137
|
+
var activeElement = getActiveElement(document);
|
|
138
|
+
if (activeElement === _this.element) {
|
|
137
139
|
event.preventDefault();
|
|
138
140
|
}
|
|
139
141
|
};
|
|
140
142
|
_this.wheel = function (event) {
|
|
141
|
-
|
|
143
|
+
var activeElement = getActiveElement(document);
|
|
144
|
+
if (activeElement !== _this.element) {
|
|
142
145
|
return;
|
|
143
146
|
}
|
|
144
147
|
if (event.nativeEvent.deltaY < 0) {
|
|
@@ -474,7 +477,8 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
474
477
|
var _this = this;
|
|
475
478
|
this._lastSelectedSymbol = this.currentFormat[selection.start];
|
|
476
479
|
window.requestAnimationFrame(function () {
|
|
477
|
-
|
|
480
|
+
var activeElement = getActiveElement(document);
|
|
481
|
+
if (_this.element && activeElement === _this.element && !_this.props.disableSelection) {
|
|
478
482
|
_this.element.setSelectionRange(selection.start, selection.end);
|
|
479
483
|
}
|
|
480
484
|
});
|
|
@@ -28,7 +28,7 @@ import * as React from 'react';
|
|
|
28
28
|
import * as PropTypes from 'prop-types';
|
|
29
29
|
import { Popup } from '@progress/kendo-react-popup';
|
|
30
30
|
import { cloneDate } from '@progress/kendo-date-math';
|
|
31
|
-
import { guid, classNames, Keys, createPropsContext, withPropsContext, IconWrap } from '@progress/kendo-react-common';
|
|
31
|
+
import { guid, classNames, Keys, createPropsContext, withPropsContext, IconWrap, getActiveElement } from '@progress/kendo-react-common';
|
|
32
32
|
import { provideLocalizationService, registerForLocalization } from '@progress/kendo-react-intl';
|
|
33
33
|
import { arrowsSwapIcon } from '@progress/kendo-svg-icons';
|
|
34
34
|
import { validatePackage, canUseDOM } from '@progress/kendo-react-common';
|
|
@@ -197,6 +197,7 @@ var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
197
197
|
};
|
|
198
198
|
_this.handleKeyDown = function (event) {
|
|
199
199
|
var keyCode = event.keyCode, altKey = event.altKey;
|
|
200
|
+
var activeElement = getActiveElement(document);
|
|
200
201
|
if (keyCode === Keys.esc) {
|
|
201
202
|
event.preventDefault();
|
|
202
203
|
_this.shouldFocusDateInput = true;
|
|
@@ -214,7 +215,7 @@ var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
214
215
|
&& _this.endDateInput
|
|
215
216
|
&& _this.endDateInput.element
|
|
216
217
|
&& document
|
|
217
|
-
&&
|
|
218
|
+
&& activeElement === _this.endDateInput.element) {
|
|
218
219
|
event.preventDefault();
|
|
219
220
|
_this.focusCalendarElement();
|
|
220
221
|
}
|
|
@@ -448,11 +449,12 @@ var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
448
449
|
|| !this.endDateInput || !this.endDateInput.element) {
|
|
449
450
|
return;
|
|
450
451
|
}
|
|
452
|
+
var activeElement = getActiveElement(document);
|
|
451
453
|
if ((this.value.start === null || this.value.end !== null)
|
|
452
|
-
&&
|
|
454
|
+
&& activeElement !== this.endDateInput.element) {
|
|
453
455
|
this.startDateInput.element.focus({ preventScroll: true });
|
|
454
456
|
}
|
|
455
|
-
else if (
|
|
457
|
+
else if (activeElement !== this.startDateInput.element) {
|
|
456
458
|
this.endDateInput.element.focus({ preventScroll: true });
|
|
457
459
|
}
|
|
458
460
|
};
|
|
@@ -32,7 +32,7 @@ import { Calendar } from '../calendar/components/Calendar';
|
|
|
32
32
|
import { TimePart } from '../timepicker/TimePart';
|
|
33
33
|
import { setTime, getToday, MIN_TIME, MAX_TIME } from '../utils';
|
|
34
34
|
import { isEqualDate } from '@progress/kendo-date-math';
|
|
35
|
-
import { Keys, classNames } from '@progress/kendo-react-common';
|
|
35
|
+
import { Keys, classNames, getActiveElement } from '@progress/kendo-react-common';
|
|
36
36
|
import { MIDNIGHT_DATE } from '../utils';
|
|
37
37
|
import { getNow } from '../timepicker/utils';
|
|
38
38
|
/**
|
|
@@ -257,8 +257,9 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
257
257
|
if (!this._acceptButton) {
|
|
258
258
|
return false;
|
|
259
259
|
}
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
var activeElement = getActiveElement(document);
|
|
261
|
+
return (this._acceptButton && activeElement === this._acceptButton.element)
|
|
262
|
+
|| (this._cancelButton && activeElement === this._cancelButton.element);
|
|
262
263
|
};
|
|
263
264
|
DateTimeSelector.prototype.mergeTime = function (current, candidate) {
|
|
264
265
|
return current && candidate ? setTime(candidate, current) : candidate;
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-dateinputs',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1685662081,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -17,7 +17,7 @@ var _a, _b;
|
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import * as PropTypes from 'prop-types';
|
|
19
19
|
import { cloneDate } from '@progress/kendo-date-math';
|
|
20
|
-
import { Keys, noop } from '@progress/kendo-react-common';
|
|
20
|
+
import { getActiveElement, Keys, noop } from '@progress/kendo-react-common';
|
|
21
21
|
import { provideIntlService, registerForIntl } from '@progress/kendo-react-intl';
|
|
22
22
|
import { Virtualization } from '../virtualization/Virtualization';
|
|
23
23
|
import { TIME_PART } from './models';
|
|
@@ -144,7 +144,8 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
144
144
|
if (!_this._element) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
var activeElement = getActiveElement(document);
|
|
148
|
+
if (document && activeElement !== _this._element && _this.props.show) {
|
|
148
149
|
_this._element.focus({ preventScroll: true });
|
|
149
150
|
}
|
|
150
151
|
};
|
|
@@ -27,7 +27,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
27
27
|
import * as React from 'react';
|
|
28
28
|
import * as PropTypes from 'prop-types';
|
|
29
29
|
import { cloneDate } from '@progress/kendo-date-math';
|
|
30
|
-
import { classNames, Keys } from '@progress/kendo-react-common';
|
|
30
|
+
import { classNames, getActiveElement, Keys } from '@progress/kendo-react-common';
|
|
31
31
|
import { provideIntlService, provideLocalizationService, registerForIntl, registerForLocalization } from '@progress/kendo-react-intl';
|
|
32
32
|
import { messages, now, selectNow } from '../messages';
|
|
33
33
|
import { TimeList } from './TimeList';
|
|
@@ -244,7 +244,8 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
244
244
|
this.nextTickId = window.setTimeout(function () { return f(); });
|
|
245
245
|
};
|
|
246
246
|
TimePart.prototype.hasActiveButton = function () {
|
|
247
|
-
|
|
247
|
+
var activeElement = getActiveElement(document);
|
|
248
|
+
return (this._nowButton && activeElement === this._nowButton.element);
|
|
248
249
|
};
|
|
249
250
|
TimePart.prototype.hasSteps = function () {
|
|
250
251
|
var _this = this;
|
|
@@ -27,7 +27,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
27
27
|
import * as React from 'react';
|
|
28
28
|
import * as PropTypes from 'prop-types';
|
|
29
29
|
import { cloneDate } from '@progress/kendo-date-math';
|
|
30
|
-
import { classNames, Keys } from '@progress/kendo-react-common';
|
|
30
|
+
import { classNames, getActiveElement, Keys } from '@progress/kendo-react-common';
|
|
31
31
|
import { provideIntlService, registerForIntl, registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
32
32
|
import { messages, timePickerCancel, timePickerSet } from '../messages';
|
|
33
33
|
import { MIN_TIME, MAX_TIME, MIDNIGHT_DATE } from '../utils';
|
|
@@ -203,8 +203,9 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
203
203
|
if (!this._acceptButton || !this._acceptButton.element) {
|
|
204
204
|
return false;
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
var activeElement = getActiveElement(document);
|
|
207
|
+
return (this._acceptButton && activeElement === this._acceptButton.element)
|
|
208
|
+
|| (this._cancelButton && activeElement === this._cancelButton.element);
|
|
208
209
|
};
|
|
209
210
|
TimeSelector.propTypes = {
|
|
210
211
|
cancelButton: PropTypes.bool,
|
|
@@ -97,8 +97,9 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
97
97
|
_this.spinnersMouseDown = function (event) {
|
|
98
98
|
/* do not steal focus from input when changing value with spinners */
|
|
99
99
|
event.preventDefault();
|
|
100
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
100
101
|
/* manually focus the input in case the user clicks the spinners first */
|
|
101
|
-
if (_this.element &&
|
|
102
|
+
if (_this.element && activeElement !== _this.element) {
|
|
102
103
|
_this.element.focus({ preventScroll: true });
|
|
103
104
|
}
|
|
104
105
|
};
|
|
@@ -136,12 +137,14 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
136
137
|
_this.setSelection(_this.selectionByIndex(_this.selection.start));
|
|
137
138
|
};
|
|
138
139
|
_this.nativeWheel = function (event) {
|
|
139
|
-
|
|
140
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
141
|
+
if (activeElement === _this.element) {
|
|
140
142
|
event.preventDefault();
|
|
141
143
|
}
|
|
142
144
|
};
|
|
143
145
|
_this.wheel = function (event) {
|
|
144
|
-
|
|
146
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
147
|
+
if (activeElement !== _this.element) {
|
|
145
148
|
return;
|
|
146
149
|
}
|
|
147
150
|
if (event.nativeEvent.deltaY < 0) {
|
|
@@ -477,7 +480,8 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
477
480
|
var _this = this;
|
|
478
481
|
this._lastSelectedSymbol = this.currentFormat[selection.start];
|
|
479
482
|
window.requestAnimationFrame(function () {
|
|
480
|
-
|
|
483
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
484
|
+
if (_this.element && activeElement === _this.element && !_this.props.disableSelection) {
|
|
481
485
|
_this.element.setSelectionRange(selection.start, selection.end);
|
|
482
486
|
}
|
|
483
487
|
});
|
|
@@ -200,6 +200,7 @@ var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
200
200
|
};
|
|
201
201
|
_this.handleKeyDown = function (event) {
|
|
202
202
|
var keyCode = event.keyCode, altKey = event.altKey;
|
|
203
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
203
204
|
if (keyCode === kendo_react_common_1.Keys.esc) {
|
|
204
205
|
event.preventDefault();
|
|
205
206
|
_this.shouldFocusDateInput = true;
|
|
@@ -217,7 +218,7 @@ var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
217
218
|
&& _this.endDateInput
|
|
218
219
|
&& _this.endDateInput.element
|
|
219
220
|
&& document
|
|
220
|
-
&&
|
|
221
|
+
&& activeElement === _this.endDateInput.element) {
|
|
221
222
|
event.preventDefault();
|
|
222
223
|
_this.focusCalendarElement();
|
|
223
224
|
}
|
|
@@ -451,11 +452,12 @@ var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
451
452
|
|| !this.endDateInput || !this.endDateInput.element) {
|
|
452
453
|
return;
|
|
453
454
|
}
|
|
455
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
454
456
|
if ((this.value.start === null || this.value.end !== null)
|
|
455
|
-
&&
|
|
457
|
+
&& activeElement !== this.endDateInput.element) {
|
|
456
458
|
this.startDateInput.element.focus({ preventScroll: true });
|
|
457
459
|
}
|
|
458
|
-
else if (
|
|
460
|
+
else if (activeElement !== this.startDateInput.element) {
|
|
459
461
|
this.endDateInput.element.focus({ preventScroll: true });
|
|
460
462
|
}
|
|
461
463
|
};
|
|
@@ -260,8 +260,9 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
260
260
|
if (!this._acceptButton) {
|
|
261
261
|
return false;
|
|
262
262
|
}
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
264
|
+
return (this._acceptButton && activeElement === this._acceptButton.element)
|
|
265
|
+
|| (this._cancelButton && activeElement === this._cancelButton.element);
|
|
265
266
|
};
|
|
266
267
|
DateTimeSelector.prototype.mergeTime = function (current, candidate) {
|
|
267
268
|
return current && candidate ? (0, utils_1.setTime)(candidate, current) : candidate;
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-dateinputs',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1685662081,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
14
14
|
};
|
|
@@ -147,7 +147,8 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
147
147
|
if (!_this._element) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
151
|
+
if (document && activeElement !== _this._element && _this.props.show) {
|
|
151
152
|
_this._element.focus({ preventScroll: true });
|
|
152
153
|
}
|
|
153
154
|
};
|
|
@@ -247,7 +247,8 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
247
247
|
this.nextTickId = window.setTimeout(function () { return f(); });
|
|
248
248
|
};
|
|
249
249
|
TimePart.prototype.hasActiveButton = function () {
|
|
250
|
-
|
|
250
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
251
|
+
return (this._nowButton && activeElement === this._nowButton.element);
|
|
251
252
|
};
|
|
252
253
|
TimePart.prototype.hasSteps = function () {
|
|
253
254
|
var _this = this;
|
|
@@ -206,8 +206,9 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
206
206
|
if (!this._acceptButton || !this._acceptButton.element) {
|
|
207
207
|
return false;
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
var activeElement = (0, kendo_react_common_1.getActiveElement)(document);
|
|
210
|
+
return (this._acceptButton && activeElement === this._acceptButton.element)
|
|
211
|
+
|| (this._cancelButton && activeElement === this._cancelButton.element);
|
|
211
212
|
};
|
|
212
213
|
TimeSelector.propTypes = {
|
|
213
214
|
cancelButton: PropTypes.bool,
|