@progress/kendo-react-dateinputs 4.13.0-dev.202111291459 → 4.13.0-dev.202111300702
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/calendar/components/Calendar.d.ts +43 -9
- package/dist/es/calendar/components/Calendar.js +48 -28
- package/dist/es/calendar/components/MultiViewCalendar.d.ts +51 -19
- package/dist/es/calendar/components/MultiViewCalendar.js +64 -37
- package/dist/es/dateinput/DateInput.d.ts +46 -4
- package/dist/es/dateinput/DateInput.js +64 -43
- package/dist/es/datepicker/DatePicker.d.ts +63 -9
- package/dist/es/datepicker/DatePicker.js +68 -47
- package/dist/es/daterangepicker/DateRangePicker.d.ts +51 -11
- package/dist/es/daterangepicker/DateRangePicker.js +60 -32
- package/dist/es/datetimepicker/DateTimePicker.d.ts +54 -4
- package/dist/es/datetimepicker/DateTimePicker.js +54 -33
- package/dist/es/hooks/usePickerFloatingLabel.d.ts +1 -1
- package/dist/es/main.d.ts +8 -8
- package/dist/es/main.js +8 -8
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimePicker.d.ts +58 -4
- package/dist/es/timepicker/TimePicker.js +59 -38
- package/dist/es/utils.d.ts +4 -0
- package/dist/es/utils.js +20 -0
- package/dist/npm/calendar/components/Calendar.d.ts +43 -9
- package/dist/npm/calendar/components/Calendar.js +48 -28
- package/dist/npm/calendar/components/MultiViewCalendar.d.ts +51 -19
- package/dist/npm/calendar/components/MultiViewCalendar.js +62 -35
- package/dist/npm/dateinput/DateInput.d.ts +46 -4
- package/dist/npm/dateinput/DateInput.js +64 -43
- package/dist/npm/datepicker/DatePicker.d.ts +63 -9
- package/dist/npm/datepicker/DatePicker.js +67 -46
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +51 -11
- package/dist/npm/daterangepicker/DateRangePicker.js +58 -30
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +54 -4
- package/dist/npm/datetimepicker/DateTimePicker.js +53 -32
- package/dist/npm/hooks/usePickerFloatingLabel.d.ts +1 -1
- package/dist/npm/main.d.ts +8 -8
- package/dist/npm/main.js +7 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimePicker.d.ts +58 -4
- package/dist/npm/timepicker/TimePicker.js +58 -37
- package/dist/npm/utils.d.ts +4 -0
- package/dist/npm/utils.js +21 -0
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +14 -9
|
@@ -49,9 +49,10 @@ var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
|
49
49
|
var ToggleButton_1 = require("./ToggleButton");
|
|
50
50
|
var PickerWrap_1 = require("../common/PickerWrap");
|
|
51
51
|
var usePickerFloatingLabel_1 = require("../hooks/usePickerFloatingLabel");
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
/** @hidden */
|
|
53
|
+
var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
54
|
+
__extends(DatePickerWithoutContext, _super);
|
|
55
|
+
function DatePickerWithoutContext(props) {
|
|
55
56
|
var _this = _super.call(this, props) || this;
|
|
56
57
|
_this._popupId = kendo_react_common_1.guid();
|
|
57
58
|
_this._element = null;
|
|
@@ -141,15 +142,15 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
141
142
|
};
|
|
142
143
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
143
144
|
_this.state = {
|
|
144
|
-
value: _this.props.defaultValue ||
|
|
145
|
-
show: _this.props.defaultShow ||
|
|
145
|
+
value: _this.props.defaultValue || DatePickerWithoutContext.defaultProps.defaultValue,
|
|
146
|
+
show: _this.props.defaultShow || DatePickerWithoutContext.defaultProps.defaultShow,
|
|
146
147
|
focused: false
|
|
147
148
|
};
|
|
148
149
|
return _this;
|
|
149
150
|
}
|
|
150
|
-
Object.defineProperty(
|
|
151
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "element", {
|
|
151
152
|
/**
|
|
152
|
-
* Gets the wrapping element of the
|
|
153
|
+
* Gets the wrapping element of the DatePickerWithoutContext.
|
|
153
154
|
*/
|
|
154
155
|
get: function () {
|
|
155
156
|
return this._element;
|
|
@@ -157,7 +158,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
157
158
|
enumerable: true,
|
|
158
159
|
configurable: true
|
|
159
160
|
});
|
|
160
|
-
Object.defineProperty(
|
|
161
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "dateInput", {
|
|
161
162
|
/**
|
|
162
163
|
* Gets the DateInput component inside the DatePicker component.
|
|
163
164
|
*/
|
|
@@ -167,7 +168,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
167
168
|
enumerable: true,
|
|
168
169
|
configurable: true
|
|
169
170
|
});
|
|
170
|
-
Object.defineProperty(
|
|
171
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "calendar", {
|
|
171
172
|
/**
|
|
172
173
|
* Gets the Calendar component inside the DatePicker component.
|
|
173
174
|
*/
|
|
@@ -177,9 +178,9 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
177
178
|
enumerable: true,
|
|
178
179
|
configurable: true
|
|
179
180
|
});
|
|
180
|
-
Object.defineProperty(
|
|
181
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "value", {
|
|
181
182
|
/**
|
|
182
|
-
* Gets the value of the
|
|
183
|
+
* Gets the value of the DatePickerWithoutContext.
|
|
183
184
|
*/
|
|
184
185
|
get: function () {
|
|
185
186
|
var value = this.valueDuringOnChange !== undefined
|
|
@@ -192,9 +193,9 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
192
193
|
enumerable: true,
|
|
193
194
|
configurable: true
|
|
194
195
|
});
|
|
195
|
-
Object.defineProperty(
|
|
196
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "show", {
|
|
196
197
|
/**
|
|
197
|
-
* Gets the popup state of the
|
|
198
|
+
* Gets the popup state of the DatePickerWithoutContext.
|
|
198
199
|
*/
|
|
199
200
|
get: function () {
|
|
200
201
|
return this.showDuringOnChange !== undefined
|
|
@@ -206,9 +207,9 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
206
207
|
enumerable: true,
|
|
207
208
|
configurable: true
|
|
208
209
|
});
|
|
209
|
-
Object.defineProperty(
|
|
210
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "name", {
|
|
210
211
|
/**
|
|
211
|
-
* Gets the `name` property of the
|
|
212
|
+
* Gets the `name` property of the DatePickerWithoutContext.
|
|
212
213
|
*/
|
|
213
214
|
get: function () {
|
|
214
215
|
return this.props.name;
|
|
@@ -216,60 +217,60 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
216
217
|
enumerable: true,
|
|
217
218
|
configurable: true
|
|
218
219
|
});
|
|
219
|
-
Object.defineProperty(
|
|
220
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "min", {
|
|
220
221
|
get: function () {
|
|
221
222
|
return this.props.min !== undefined
|
|
222
223
|
? this.props.min
|
|
223
|
-
:
|
|
224
|
+
: DatePickerWithoutContext.defaultProps.min;
|
|
224
225
|
},
|
|
225
226
|
enumerable: true,
|
|
226
227
|
configurable: true
|
|
227
228
|
});
|
|
228
|
-
Object.defineProperty(
|
|
229
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "max", {
|
|
229
230
|
get: function () {
|
|
230
231
|
return this.props.max !== undefined
|
|
231
232
|
? this.props.max
|
|
232
|
-
:
|
|
233
|
+
: DatePickerWithoutContext.defaultProps.max;
|
|
233
234
|
},
|
|
234
235
|
enumerable: true,
|
|
235
236
|
configurable: true
|
|
236
237
|
});
|
|
237
|
-
Object.defineProperty(
|
|
238
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "dateInputComp", {
|
|
238
239
|
get: function () {
|
|
239
|
-
return this.props.dateInput ||
|
|
240
|
+
return this.props.dateInput || DatePickerWithoutContext.defaultProps.dateInput;
|
|
240
241
|
},
|
|
241
242
|
enumerable: true,
|
|
242
243
|
configurable: true
|
|
243
244
|
});
|
|
244
|
-
Object.defineProperty(
|
|
245
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "toggleButtonComp", {
|
|
245
246
|
get: function () {
|
|
246
|
-
return this.props.toggleButton ||
|
|
247
|
+
return this.props.toggleButton || DatePickerWithoutContext.defaultProps.toggleButton;
|
|
247
248
|
},
|
|
248
249
|
enumerable: true,
|
|
249
250
|
configurable: true
|
|
250
251
|
});
|
|
251
|
-
Object.defineProperty(
|
|
252
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "calendarComp", {
|
|
252
253
|
get: function () {
|
|
253
|
-
return this.props.calendar ||
|
|
254
|
+
return this.props.calendar || DatePickerWithoutContext.defaultProps.calendar;
|
|
254
255
|
},
|
|
255
256
|
enumerable: true,
|
|
256
257
|
configurable: true
|
|
257
258
|
});
|
|
258
|
-
Object.defineProperty(
|
|
259
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "popupComp", {
|
|
259
260
|
get: function () {
|
|
260
|
-
return this.props.popup ||
|
|
261
|
+
return this.props.popup || DatePickerWithoutContext.defaultProps.popup;
|
|
261
262
|
},
|
|
262
263
|
enumerable: true,
|
|
263
264
|
configurable: true
|
|
264
265
|
});
|
|
265
|
-
Object.defineProperty(
|
|
266
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "pickerWrapComp", {
|
|
266
267
|
get: function () {
|
|
267
|
-
return this.props.pickerWrap ||
|
|
268
|
+
return this.props.pickerWrap || DatePickerWithoutContext.defaultProps.pickerWrap;
|
|
268
269
|
},
|
|
269
270
|
enumerable: true,
|
|
270
271
|
configurable: true
|
|
271
272
|
});
|
|
272
|
-
Object.defineProperty(
|
|
273
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "validity", {
|
|
273
274
|
/**
|
|
274
275
|
* Represents the validity state into which the DatePicker is set.
|
|
275
276
|
*/
|
|
@@ -289,26 +290,26 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
289
290
|
enumerable: true,
|
|
290
291
|
configurable: true
|
|
291
292
|
});
|
|
292
|
-
Object.defineProperty(
|
|
293
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "validityStyles", {
|
|
293
294
|
/**
|
|
294
295
|
* @hidden
|
|
295
296
|
*/
|
|
296
297
|
get: function () {
|
|
297
298
|
return this.props.validityStyles !== undefined
|
|
298
299
|
? this.props.validityStyles
|
|
299
|
-
:
|
|
300
|
+
: DatePickerWithoutContext.defaultProps.validityStyles;
|
|
300
301
|
},
|
|
301
302
|
enumerable: true,
|
|
302
303
|
configurable: true
|
|
303
304
|
});
|
|
304
|
-
Object.defineProperty(
|
|
305
|
+
Object.defineProperty(DatePickerWithoutContext.prototype, "required", {
|
|
305
306
|
/**
|
|
306
307
|
* @hidden
|
|
307
308
|
*/
|
|
308
309
|
get: function () {
|
|
309
310
|
return this.props.required !== undefined
|
|
310
311
|
? this.props.required
|
|
311
|
-
:
|
|
312
|
+
: DatePickerWithoutContext.defaultProps.required;
|
|
312
313
|
},
|
|
313
314
|
enumerable: true,
|
|
314
315
|
configurable: true
|
|
@@ -316,7 +317,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
316
317
|
/**
|
|
317
318
|
* @hidden
|
|
318
319
|
*/
|
|
319
|
-
|
|
320
|
+
DatePickerWithoutContext.prototype.componentDidMount = function () {
|
|
320
321
|
if (this.show) {
|
|
321
322
|
// If defaultShow is true during the initial render, the popup is not aligned.
|
|
322
323
|
this.forceUpdate();
|
|
@@ -325,7 +326,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
325
326
|
/**
|
|
326
327
|
* @hidden
|
|
327
328
|
*/
|
|
328
|
-
|
|
329
|
+
DatePickerWithoutContext.prototype.componentDidUpdate = function () {
|
|
329
330
|
if (this._calendar && this._calendar.element && this.show && !this.prevShow) {
|
|
330
331
|
this._calendar.element.focus({ preventScroll: true });
|
|
331
332
|
}
|
|
@@ -341,13 +342,13 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
341
342
|
/**
|
|
342
343
|
* @hidden
|
|
343
344
|
*/
|
|
344
|
-
|
|
345
|
+
DatePickerWithoutContext.prototype.componentWillUnmount = function () {
|
|
345
346
|
clearTimeout(this.nextTickId);
|
|
346
347
|
};
|
|
347
348
|
/**
|
|
348
349
|
* @hidden
|
|
349
350
|
*/
|
|
350
|
-
|
|
351
|
+
DatePickerWithoutContext.prototype.render = function () {
|
|
351
352
|
var _this = this;
|
|
352
353
|
var _a = this.props, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max, weekNumber = _a.weekNumber, focusedDate = _a.focusedDate, className = _a.className, width = _a.width, name = _a.name, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy;
|
|
353
354
|
var _b = this.props.popupSettings, popupClass = _b.popupClass, otherPopupSettings = __rest(_b, ["popupClass"]);
|
|
@@ -416,16 +417,16 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
416
417
|
? (React.createElement(usePickerFloatingLabel_1.PickerFloatingLabel, { dateInput: this._dateInput, label: this.props.label, editorId: id, editorValid: isValid, editorDisabled: this.props.disabled, children: datepicker, style: { width: this.props.width } }))
|
|
417
418
|
: datepicker;
|
|
418
419
|
};
|
|
419
|
-
|
|
420
|
+
DatePickerWithoutContext.prototype.setShow = function (show) {
|
|
420
421
|
if (this.show === show) {
|
|
421
422
|
return;
|
|
422
423
|
}
|
|
423
424
|
this.setState({ show: show });
|
|
424
425
|
};
|
|
425
|
-
|
|
426
|
+
DatePickerWithoutContext.prototype.mergeTime = function (value) {
|
|
426
427
|
return this.value && value ? utils_1.setTime(value, this.value) : value;
|
|
427
428
|
};
|
|
428
|
-
|
|
429
|
+
DatePickerWithoutContext.prototype.nextTick = function (f) {
|
|
429
430
|
// XXX: use window.setTimeout due to async focus/blur events in IE, and missing relatedTarget prop.
|
|
430
431
|
// XXX: https://github.com/facebook/react/issues/3751
|
|
431
432
|
// Handles multiple focus events happening at the same time.
|
|
@@ -435,7 +436,11 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
435
436
|
/**
|
|
436
437
|
* @hidden
|
|
437
438
|
*/
|
|
438
|
-
|
|
439
|
+
DatePickerWithoutContext.displayName = 'DatePicker';
|
|
440
|
+
/**
|
|
441
|
+
* @hidden
|
|
442
|
+
*/
|
|
443
|
+
DatePickerWithoutContext.propTypes = {
|
|
439
444
|
className: PropTypes.string,
|
|
440
445
|
defaultShow: PropTypes.bool,
|
|
441
446
|
defaultValue: PropTypes.instanceOf(Date),
|
|
@@ -497,7 +502,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
497
502
|
/**
|
|
498
503
|
* @hidden
|
|
499
504
|
*/
|
|
500
|
-
|
|
505
|
+
DatePickerWithoutContext.defaultProps = {
|
|
501
506
|
defaultShow: false,
|
|
502
507
|
defaultValue: null,
|
|
503
508
|
dateInput: DateInput_1.DateInput,
|
|
@@ -515,7 +520,23 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
515
520
|
required: false,
|
|
516
521
|
validityStyles: true
|
|
517
522
|
};
|
|
518
|
-
return
|
|
523
|
+
return DatePickerWithoutContext;
|
|
519
524
|
}(React.Component));
|
|
520
|
-
exports.
|
|
521
|
-
|
|
525
|
+
exports.DatePickerWithoutContext = DatePickerWithoutContext;
|
|
526
|
+
/**
|
|
527
|
+
* Represents the PropsContext of the `DatePicker` component.
|
|
528
|
+
* Used for global configuration of all `DatePicker` instances.
|
|
529
|
+
*
|
|
530
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
531
|
+
*/
|
|
532
|
+
exports.DatePickerPropsContext = kendo_react_common_1.createPropsContext();
|
|
533
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
534
|
+
/**
|
|
535
|
+
* Represents the KendoReact DatePicker Component.
|
|
536
|
+
*
|
|
537
|
+
* Accepts properties of type [DatePickerProps]({% slug api_dateinputs_datepickerprops %}).
|
|
538
|
+
* Obtaining the `ref` returns an object of type [DatePickerHandle]({% slug api_dateinputs_datepickerhandle %}).
|
|
539
|
+
*/
|
|
540
|
+
exports.DatePicker = kendo_react_common_1.withPropsContext(exports.DatePickerPropsContext, DatePickerWithoutContext);
|
|
541
|
+
exports.DatePicker.displayName = 'KendoReactDatePicker';
|
|
542
|
+
kendo_react_intl_1.registerForLocalization(DatePickerWithoutContext);
|
|
@@ -54,7 +54,12 @@ export interface DateRangePickerState {
|
|
|
54
54
|
show: boolean;
|
|
55
55
|
value: SelectionRange;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
/** @hidden */
|
|
58
|
+
export declare class DateRangePickerWithoutContext extends React.Component<DateRangePickerProps, DateRangePickerState> {
|
|
59
|
+
/**
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
static displayName: string;
|
|
58
63
|
/**
|
|
59
64
|
* @hidden
|
|
60
65
|
*/
|
|
@@ -63,10 +68,7 @@ export declare class DateRangePicker extends React.Component<DateRangePickerProp
|
|
|
63
68
|
calendarSettings: PropTypes.Requireable<any>;
|
|
64
69
|
className: PropTypes.Requireable<string>;
|
|
65
70
|
defaultShow: PropTypes.Requireable<boolean>;
|
|
66
|
-
defaultValue: PropTypes.
|
|
67
|
-
start: PropTypes.Requireable<Date>;
|
|
68
|
-
end: PropTypes.Requireable<Date>;
|
|
69
|
-
}>>;
|
|
71
|
+
defaultValue: PropTypes.Validator<SelectionRange>;
|
|
70
72
|
disabled: PropTypes.Requireable<boolean>;
|
|
71
73
|
endDateInputSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
72
74
|
value: PropTypes.Requireable<Date>;
|
|
@@ -87,7 +89,7 @@ export declare class DateRangePicker extends React.Component<DateRangePickerProp
|
|
|
87
89
|
second: PropTypes.Requireable<string>;
|
|
88
90
|
timeZoneName: PropTypes.Requireable<string>;
|
|
89
91
|
}>>;
|
|
90
|
-
formatPlaceholder: PropTypes.Requireable<
|
|
92
|
+
formatPlaceholder: PropTypes.Requireable<"narrow" | "short" | "wide" | "formatPattern" | PropTypes.InferProps<{
|
|
91
93
|
year: PropTypes.Requireable<string>;
|
|
92
94
|
month: PropTypes.Requireable<string>;
|
|
93
95
|
day: PropTypes.Requireable<string>;
|
|
@@ -116,7 +118,7 @@ export declare class DateRangePicker extends React.Component<DateRangePickerProp
|
|
|
116
118
|
id: PropTypes.Requireable<string>;
|
|
117
119
|
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
118
120
|
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
119
|
-
ariaExpanded: PropTypes.Requireable<
|
|
121
|
+
ariaExpanded: PropTypes.Requireable<boolean>;
|
|
120
122
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
121
123
|
validationMessage: PropTypes.Requireable<string>;
|
|
122
124
|
required: PropTypes.Requireable<boolean>;
|
|
@@ -155,10 +157,7 @@ export declare class DateRangePicker extends React.Component<DateRangePickerProp
|
|
|
155
157
|
style: PropTypes.Requireable<any>;
|
|
156
158
|
swapButton: PropTypes.Requireable<any>;
|
|
157
159
|
tabIndex: PropTypes.Requireable<number>;
|
|
158
|
-
value: PropTypes.
|
|
159
|
-
start: PropTypes.Requireable<Date>;
|
|
160
|
-
end: PropTypes.Requireable<Date>;
|
|
161
|
-
}>>;
|
|
160
|
+
value: PropTypes.Validator<SelectionRange>;
|
|
162
161
|
};
|
|
163
162
|
/**
|
|
164
163
|
* @hidden
|
|
@@ -251,3 +250,44 @@ export declare class DateRangePicker extends React.Component<DateRangePickerProp
|
|
|
251
250
|
private handleKeyDown;
|
|
252
251
|
private handleChange;
|
|
253
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Represents the PropsContext of the `DateRangePicker` component.
|
|
255
|
+
* Used for global configuration of all `DateRangePicker` instances.
|
|
256
|
+
*
|
|
257
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
258
|
+
*/
|
|
259
|
+
export declare const DateRangePickerPropsContext: React.Context<(p: DateRangePickerProps) => DateRangePickerProps>;
|
|
260
|
+
/**
|
|
261
|
+
* Represent the `ref` of the DateRangePicker component.
|
|
262
|
+
*/
|
|
263
|
+
export interface DateRangePickerHandle extends Pick<DateRangePickerWithoutContext, keyof DateRangePickerWithoutContext> {
|
|
264
|
+
/**
|
|
265
|
+
* Gets the MultiVieCalendar inside the DateRangePicker.
|
|
266
|
+
*/
|
|
267
|
+
calendar: MultiViewCalendar | null;
|
|
268
|
+
/**
|
|
269
|
+
* Returns the HTML element of the DateRangePicker component.
|
|
270
|
+
*/
|
|
271
|
+
element: HTMLSpanElement | null;
|
|
272
|
+
/**
|
|
273
|
+
* Gets the end DateInput component inside the DateRangePicker component.
|
|
274
|
+
*/
|
|
275
|
+
endDateInput: DateInput | null;
|
|
276
|
+
/**
|
|
277
|
+
* Gets the start DateInput component inside the DateRangePicker component.
|
|
278
|
+
*/
|
|
279
|
+
startDateInput: DateInput | null;
|
|
280
|
+
/**
|
|
281
|
+
* Gets the value of the DateRangePicker.
|
|
282
|
+
*/
|
|
283
|
+
value: SelectionRange;
|
|
284
|
+
}
|
|
285
|
+
/** @hidden */
|
|
286
|
+
export declare type DateRangePicker = DateRangePickerHandle;
|
|
287
|
+
/**
|
|
288
|
+
* Represents the KendoReact DateRangePicker Component.
|
|
289
|
+
*
|
|
290
|
+
* Accepts properties of type [DateRangePickerProps]({% slug api_dateinputs_daterangepickerprops %}).
|
|
291
|
+
* Obtaining the `ref` returns an object of type [DateRangePickerHandle]({% slug api_dateinputs_daterangepickerhandle %}).
|
|
292
|
+
*/
|
|
293
|
+
export declare const DateRangePicker: React.ForwardRefExoticComponent<DateRangePickerProps & React.RefAttributes<any>>;
|
|
@@ -38,10 +38,12 @@ var models_1 = require("../calendar/models");
|
|
|
38
38
|
var defaults_1 = require("../defaults");
|
|
39
39
|
var messages_1 = require("../messages");
|
|
40
40
|
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
41
|
+
var utils_1 = require("../utils");
|
|
41
42
|
var WRAPPER_STYLES = { display: 'inline-block' };
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
/** @hidden */
|
|
44
|
+
var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
45
|
+
__extends(DateRangePickerWithoutContext, _super);
|
|
46
|
+
function DateRangePickerWithoutContext(props) {
|
|
45
47
|
var _this = _super.call(this, props) || this;
|
|
46
48
|
_this._element = null;
|
|
47
49
|
_this._wrapper = null;
|
|
@@ -195,8 +197,8 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
195
197
|
};
|
|
196
198
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
197
199
|
_this.state = {
|
|
198
|
-
show: _this.props.show || _this.props.defaultShow ||
|
|
199
|
-
value: _this.props.value || _this.props.defaultValue ||
|
|
200
|
+
show: _this.props.show || _this.props.defaultShow || DateRangePickerWithoutContext.defaultProps.defaultShow,
|
|
201
|
+
value: _this.props.value || _this.props.defaultValue || DateRangePickerWithoutContext.defaultProps.defaultValue
|
|
200
202
|
};
|
|
201
203
|
_this.nextTick = _this.nextTick.bind(_this);
|
|
202
204
|
_this.setShow = _this.setShow.bind(_this);
|
|
@@ -204,7 +206,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
204
206
|
_this.focusDateInputElement = _this.focusDateInputElement.bind(_this);
|
|
205
207
|
return _this;
|
|
206
208
|
}
|
|
207
|
-
Object.defineProperty(
|
|
209
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "element", {
|
|
208
210
|
/**
|
|
209
211
|
* Gets the wrapping element of the DateRangePicker.
|
|
210
212
|
*/
|
|
@@ -214,7 +216,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
214
216
|
enumerable: true,
|
|
215
217
|
configurable: true
|
|
216
218
|
});
|
|
217
|
-
Object.defineProperty(
|
|
219
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "startDateInput", {
|
|
218
220
|
/**
|
|
219
221
|
* Gets the start DateInput component inside the DatePicker component.
|
|
220
222
|
*/
|
|
@@ -224,7 +226,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
224
226
|
enumerable: true,
|
|
225
227
|
configurable: true
|
|
226
228
|
});
|
|
227
|
-
Object.defineProperty(
|
|
229
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "endDateInput", {
|
|
228
230
|
/**
|
|
229
231
|
* Gets the end DateInput component inside the DatePicker component.
|
|
230
232
|
*/
|
|
@@ -234,7 +236,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
234
236
|
enumerable: true,
|
|
235
237
|
configurable: true
|
|
236
238
|
});
|
|
237
|
-
Object.defineProperty(
|
|
239
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "calendar", {
|
|
238
240
|
/**
|
|
239
241
|
* Gets the MultiVieCalendar inside the DateRangePicker.
|
|
240
242
|
*/
|
|
@@ -244,7 +246,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
244
246
|
enumerable: true,
|
|
245
247
|
configurable: true
|
|
246
248
|
});
|
|
247
|
-
Object.defineProperty(
|
|
249
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "value", {
|
|
248
250
|
/**
|
|
249
251
|
* Gets the value of the DateRangePicker.
|
|
250
252
|
*/
|
|
@@ -259,7 +261,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
259
261
|
enumerable: true,
|
|
260
262
|
configurable: true
|
|
261
263
|
});
|
|
262
|
-
Object.defineProperty(
|
|
264
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "show", {
|
|
263
265
|
/**
|
|
264
266
|
* Gets the popup state of the DateRangePicker.
|
|
265
267
|
*/
|
|
@@ -273,20 +275,20 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
273
275
|
enumerable: true,
|
|
274
276
|
configurable: true
|
|
275
277
|
});
|
|
276
|
-
Object.defineProperty(
|
|
278
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "min", {
|
|
277
279
|
get: function () {
|
|
278
280
|
return this.props.min !== undefined
|
|
279
281
|
? this.props.min
|
|
280
|
-
:
|
|
282
|
+
: DateRangePickerWithoutContext.defaultProps.min;
|
|
281
283
|
},
|
|
282
284
|
enumerable: true,
|
|
283
285
|
configurable: true
|
|
284
286
|
});
|
|
285
|
-
Object.defineProperty(
|
|
287
|
+
Object.defineProperty(DateRangePickerWithoutContext.prototype, "max", {
|
|
286
288
|
get: function () {
|
|
287
289
|
return this.props.max !== undefined
|
|
288
290
|
? this.props.max
|
|
289
|
-
:
|
|
291
|
+
: DateRangePickerWithoutContext.defaultProps.max;
|
|
290
292
|
},
|
|
291
293
|
enumerable: true,
|
|
292
294
|
configurable: true
|
|
@@ -294,7 +296,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
294
296
|
/**
|
|
295
297
|
* @hidden
|
|
296
298
|
*/
|
|
297
|
-
|
|
299
|
+
DateRangePickerWithoutContext.prototype.componentDidMount = function () {
|
|
298
300
|
if (this.show) {
|
|
299
301
|
// If defaultShow is true during the initial render, the popup is not aligned.
|
|
300
302
|
this.forceUpdate();
|
|
@@ -303,7 +305,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
303
305
|
/**
|
|
304
306
|
* @hidden
|
|
305
307
|
*/
|
|
306
|
-
|
|
308
|
+
DateRangePickerWithoutContext.prototype.componentDidUpdate = function () {
|
|
307
309
|
if (this.shouldFocusCalendar) {
|
|
308
310
|
this.focusCalendarElement();
|
|
309
311
|
}
|
|
@@ -316,13 +318,13 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
316
318
|
/**
|
|
317
319
|
* @hidden
|
|
318
320
|
*/
|
|
319
|
-
|
|
321
|
+
DateRangePickerWithoutContext.prototype.componentWillUnmount = function () {
|
|
320
322
|
clearTimeout(this.nextTickId);
|
|
321
323
|
};
|
|
322
324
|
/**
|
|
323
325
|
* @hidden
|
|
324
326
|
*/
|
|
325
|
-
|
|
327
|
+
DateRangePickerWithoutContext.prototype.render = function () {
|
|
326
328
|
var _this = this;
|
|
327
329
|
var value = this.value || models_1.EMPTY_SELECTIONRANGE;
|
|
328
330
|
var startDateInputId = (this.props.startDateInputSettings || {}).id || this._startInputId;
|
|
@@ -375,7 +377,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
375
377
|
? React.createElement(this.props.popup, __assign({}, popupProps), calendar)
|
|
376
378
|
: React.createElement(kendo_react_popup_1.Popup, __assign({}, popupProps), calendar)));
|
|
377
379
|
};
|
|
378
|
-
|
|
380
|
+
DateRangePickerWithoutContext.prototype.focusDateInputElement = function () {
|
|
379
381
|
if (!document || !this.startDateInput || !this.startDateInput.element
|
|
380
382
|
|| !this.endDateInput || !this.endDateInput.element) {
|
|
381
383
|
return;
|
|
@@ -388,14 +390,14 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
388
390
|
this.endDateInput.element.focus({ preventScroll: true });
|
|
389
391
|
}
|
|
390
392
|
};
|
|
391
|
-
|
|
393
|
+
DateRangePickerWithoutContext.prototype.nextTick = function (f) {
|
|
392
394
|
// XXX: use window.setTimeout due to async focus/blur events in IE, and missing relatedTarget prop.
|
|
393
395
|
// XXX: https://github.com/facebook/react/issues/3751
|
|
394
396
|
// Handles multiple focus events happening at the same time.
|
|
395
397
|
clearTimeout(this.nextTickId);
|
|
396
398
|
this.nextTickId = window.setTimeout(function () { return f(); });
|
|
397
399
|
};
|
|
398
|
-
|
|
400
|
+
DateRangePickerWithoutContext.prototype.setShow = function (show) {
|
|
399
401
|
if (this.show === show) {
|
|
400
402
|
return;
|
|
401
403
|
}
|
|
@@ -404,14 +406,21 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
404
406
|
/**
|
|
405
407
|
* @hidden
|
|
406
408
|
*/
|
|
407
|
-
|
|
409
|
+
DateRangePickerWithoutContext.displayName = 'DateRangePicker';
|
|
410
|
+
/**
|
|
411
|
+
* @hidden
|
|
412
|
+
*/
|
|
413
|
+
DateRangePickerWithoutContext.propTypes = {
|
|
408
414
|
allowReverse: PropTypes.bool,
|
|
409
415
|
calendarSettings: PropTypes.any,
|
|
410
416
|
className: PropTypes.string,
|
|
411
417
|
defaultShow: PropTypes.bool,
|
|
412
|
-
defaultValue: PropTypes.shape({
|
|
418
|
+
defaultValue: PropTypes.shape({
|
|
419
|
+
start: utils_1.nullable(PropTypes.instanceOf(Date).isRequired),
|
|
420
|
+
end: utils_1.nullable(PropTypes.instanceOf(Date).isRequired)
|
|
421
|
+
}),
|
|
413
422
|
disabled: PropTypes.bool,
|
|
414
|
-
endDateInputSettings: PropTypes.shape(DateInput_1.
|
|
423
|
+
endDateInputSettings: PropTypes.shape(DateInput_1.DateInputWithoutContext.propTypes),
|
|
415
424
|
focusedDate: PropTypes.instanceOf(Date),
|
|
416
425
|
format: PropTypes.oneOfType([
|
|
417
426
|
PropTypes.string,
|
|
@@ -447,12 +456,15 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
447
456
|
style: PropTypes.any,
|
|
448
457
|
swapButton: PropTypes.any,
|
|
449
458
|
tabIndex: PropTypes.number,
|
|
450
|
-
value: PropTypes.shape({
|
|
459
|
+
value: PropTypes.shape({
|
|
460
|
+
start: utils_1.nullable(PropTypes.instanceOf(Date).isRequired),
|
|
461
|
+
end: utils_1.nullable(PropTypes.instanceOf(Date).isRequired)
|
|
462
|
+
})
|
|
451
463
|
};
|
|
452
464
|
/**
|
|
453
465
|
* @hidden
|
|
454
466
|
*/
|
|
455
|
-
|
|
467
|
+
DateRangePickerWithoutContext.defaultProps = {
|
|
456
468
|
allowReverse: false,
|
|
457
469
|
defaultShow: false,
|
|
458
470
|
defaultValue: models_1.EMPTY_SELECTIONRANGE,
|
|
@@ -462,7 +474,23 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
462
474
|
min: defaults_1.MIN_DATE,
|
|
463
475
|
swapButton: false
|
|
464
476
|
};
|
|
465
|
-
return
|
|
477
|
+
return DateRangePickerWithoutContext;
|
|
466
478
|
}(React.Component));
|
|
467
|
-
exports.
|
|
468
|
-
|
|
479
|
+
exports.DateRangePickerWithoutContext = DateRangePickerWithoutContext;
|
|
480
|
+
/**
|
|
481
|
+
* Represents the PropsContext of the `DateRangePicker` component.
|
|
482
|
+
* Used for global configuration of all `DateRangePicker` instances.
|
|
483
|
+
*
|
|
484
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
485
|
+
*/
|
|
486
|
+
exports.DateRangePickerPropsContext = kendo_react_common_1.createPropsContext();
|
|
487
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
488
|
+
/**
|
|
489
|
+
* Represents the KendoReact DateRangePicker Component.
|
|
490
|
+
*
|
|
491
|
+
* Accepts properties of type [DateRangePickerProps]({% slug api_dateinputs_daterangepickerprops %}).
|
|
492
|
+
* Obtaining the `ref` returns an object of type [DateRangePickerHandle]({% slug api_dateinputs_daterangepickerhandle %}).
|
|
493
|
+
*/
|
|
494
|
+
exports.DateRangePicker = kendo_react_common_1.withPropsContext(exports.DateRangePickerPropsContext, DateRangePickerWithoutContext);
|
|
495
|
+
exports.DateRangePicker.displayName = 'KendoReactDateRangePicker';
|
|
496
|
+
kendo_react_intl_1.registerForLocalization(DateRangePickerWithoutContext);
|