@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
|
@@ -15,7 +15,7 @@ export interface DateInputChangeEvent<T = DateInput> {
|
|
|
15
15
|
/**
|
|
16
16
|
* Represents the props of the [KendoReact DateInput component]({% slug overview_dateinput %}). The generic argument is passed to the `onChange` property and is used as a target in the [`DateInputChangeEvent`]({% slug api_dateinputs_dateinputchangeevent %}) interface.
|
|
17
17
|
*/
|
|
18
|
-
export interface DateInputProps<T =
|
|
18
|
+
export interface DateInputProps<T extends DateInput = any> extends FormComponentProps, DateInputSettings {
|
|
19
19
|
/** @hidden */
|
|
20
20
|
_ref?: React.MutableRefObject<DateInput | null>;
|
|
21
21
|
/**
|
|
@@ -43,9 +43,14 @@ export interface DateInputProps<T = DateInput> extends FormComponentProps, DateI
|
|
|
43
43
|
*/
|
|
44
44
|
onChange?: (event: DateInputChangeEvent<T>) => void;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/** @hidden */
|
|
47
|
+
export declare class DateInputWithoutContext extends React.Component<DateInputProps, {
|
|
47
48
|
focused: boolean;
|
|
48
49
|
}> implements FormComponent {
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
53
|
+
static displayName: string;
|
|
49
54
|
/**
|
|
50
55
|
* @hidden
|
|
51
56
|
*/
|
|
@@ -68,7 +73,7 @@ export declare class DateInput extends React.Component<DateInputProps, {
|
|
|
68
73
|
second: PropTypes.Requireable<string>;
|
|
69
74
|
timeZoneName: PropTypes.Requireable<string>;
|
|
70
75
|
}>>;
|
|
71
|
-
formatPlaceholder: PropTypes.Requireable<
|
|
76
|
+
formatPlaceholder: PropTypes.Requireable<"narrow" | "short" | "wide" | "formatPattern" | PropTypes.InferProps<{
|
|
72
77
|
year: PropTypes.Requireable<string>;
|
|
73
78
|
month: PropTypes.Requireable<string>;
|
|
74
79
|
day: PropTypes.Requireable<string>;
|
|
@@ -97,7 +102,7 @@ export declare class DateInput extends React.Component<DateInputProps, {
|
|
|
97
102
|
id: PropTypes.Requireable<string>;
|
|
98
103
|
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
99
104
|
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
100
|
-
ariaExpanded: PropTypes.Requireable<
|
|
105
|
+
ariaExpanded: PropTypes.Requireable<boolean>;
|
|
101
106
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
102
107
|
validationMessage: PropTypes.Requireable<string>;
|
|
103
108
|
required: PropTypes.Requireable<boolean>;
|
|
@@ -240,3 +245,40 @@ export declare class DateInput extends React.Component<DateInputProps, {
|
|
|
240
245
|
private switchDateSegment;
|
|
241
246
|
private modifyDateSegmentValue;
|
|
242
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Represents the PropsContext of the `DateInput` component.
|
|
250
|
+
* Used for global configuration of all `DateInput` instances.
|
|
251
|
+
*
|
|
252
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
253
|
+
*/
|
|
254
|
+
export declare const DateInputPropsContext: React.Context<(p: DateInputProps<any>) => DateInputProps<any>>;
|
|
255
|
+
/**
|
|
256
|
+
* Represent the `ref` of the DateInput component.
|
|
257
|
+
*/
|
|
258
|
+
export interface DateInputHandle extends Pick<DateInputWithoutContext, keyof DateInputWithoutContext> {
|
|
259
|
+
/**
|
|
260
|
+
* Returns the HTML element of the DateInput component.
|
|
261
|
+
*/
|
|
262
|
+
element: HTMLInputElement | null;
|
|
263
|
+
/**
|
|
264
|
+
* Gets the `name` property of the DateInput.
|
|
265
|
+
*/
|
|
266
|
+
name: string | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* Returns the `value` of the DateInput component.
|
|
269
|
+
*/
|
|
270
|
+
value: Date | null;
|
|
271
|
+
/**
|
|
272
|
+
* Represents the validity state into which the DateInput is set.
|
|
273
|
+
*/
|
|
274
|
+
validity: FormComponentValidity;
|
|
275
|
+
}
|
|
276
|
+
/** @hidden */
|
|
277
|
+
export declare type DateInput = DateInputHandle;
|
|
278
|
+
/**
|
|
279
|
+
* Represents the KendoReact DateInput Component.
|
|
280
|
+
*
|
|
281
|
+
* Accepts properties of type [DateInputProps]({% slug api_dateinputs_dateinputprops %}).
|
|
282
|
+
* Obtaining the `ref` returns an object of type [DateInputHandle]({% slug api_dateinputs_dateinputhandle %}).
|
|
283
|
+
*/
|
|
284
|
+
export declare const DateInput: React.ForwardRefExoticComponent<DateInputProps<any> & React.RefAttributes<any>>;
|
|
@@ -27,7 +27,7 @@ import * as PropTypes from 'prop-types';
|
|
|
27
27
|
import { isEqual, cloneDate } from '@progress/kendo-date-math';
|
|
28
28
|
import { registerForIntl, provideIntlService, registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
29
29
|
import { KendoDate } from './models';
|
|
30
|
-
import { guid, AsyncFocusBlur, noop, classNames } from '@progress/kendo-react-common';
|
|
30
|
+
import { guid, AsyncFocusBlur, noop, classNames, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
|
|
31
31
|
import { FloatingLabel } from '@progress/kendo-react-labels';
|
|
32
32
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
33
33
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -38,9 +38,10 @@ import { isInTimeRange } from '../timepicker/utils';
|
|
|
38
38
|
import { MIN_TIME, MAX_TIME } from '../defaults';
|
|
39
39
|
var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
40
40
|
// tslint:enable:max-line-length
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
/** @hidden */
|
|
42
|
+
var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
43
|
+
__extends(DateInputWithoutContext, _super);
|
|
44
|
+
function DateInputWithoutContext(props) {
|
|
44
45
|
var _this = _super.call(this, props) || this;
|
|
45
46
|
_this.kendoDate = null;
|
|
46
47
|
_this.paste = false;
|
|
@@ -62,7 +63,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
62
63
|
if (_this.element && _this.element.setCustomValidity) {
|
|
63
64
|
_this.element.setCustomValidity(_this.validity.valid
|
|
64
65
|
? ''
|
|
65
|
-
: _this.props.validationMessage ||
|
|
66
|
+
: _this.props.validationMessage || DateInputWithoutContext.defaultProps.validationMessage);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
_this.updateOnPaste = function (event) {
|
|
@@ -200,7 +201,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
200
201
|
/**
|
|
201
202
|
* @hidden
|
|
202
203
|
*/
|
|
203
|
-
|
|
204
|
+
DateInputWithoutContext.prototype.componentDidMount = function () {
|
|
204
205
|
this.setValidity();
|
|
205
206
|
if (this.wrapper) {
|
|
206
207
|
this.wrapper.addEventListener('wheel', this.nativeWheel, { passive: false });
|
|
@@ -209,7 +210,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
209
210
|
/**
|
|
210
211
|
* @hidden
|
|
211
212
|
*/
|
|
212
|
-
|
|
213
|
+
DateInputWithoutContext.prototype.componentDidUpdate = function (_, prevState) {
|
|
213
214
|
if (this._lastSelectedSymbol && prevState.focused === this.state.focused) {
|
|
214
215
|
this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol));
|
|
215
216
|
}
|
|
@@ -221,7 +222,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
221
222
|
/**
|
|
222
223
|
* @hidden
|
|
223
224
|
*/
|
|
224
|
-
|
|
225
|
+
DateInputWithoutContext.prototype.componentWillUnmount = function () {
|
|
225
226
|
if (this.wrapper) {
|
|
226
227
|
this.wrapper.removeEventListener('wheel', this.nativeWheel);
|
|
227
228
|
}
|
|
@@ -229,13 +230,13 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
229
230
|
/**
|
|
230
231
|
* @hidden
|
|
231
232
|
*/
|
|
232
|
-
|
|
233
|
+
DateInputWithoutContext.prototype.render = function () {
|
|
233
234
|
var _this = this;
|
|
234
235
|
if (this.props._ref) {
|
|
235
236
|
this.props._ref.current = this;
|
|
236
237
|
}
|
|
237
238
|
var localizationService = provideLocalizationService(this);
|
|
238
|
-
var props = __assign({},
|
|
239
|
+
var props = __assign({}, DateInputWithoutContext.defaultProps, this.props);
|
|
239
240
|
var min = props.min, max = props.max, name = props.name, label = props.label, id = props.id;
|
|
240
241
|
var currentText = this.text;
|
|
241
242
|
var text = currentText === this.props.placeholder ? '' : currentText;
|
|
@@ -280,7 +281,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
280
281
|
? (React.createElement(FloatingLabel, { label: label, editorId: inputId, editorValue: currentText, editorValid: isValid, editorDisabled: this.props.disabled, children: dateinput, style: { width: this.props.width } }))
|
|
281
282
|
: dateinput;
|
|
282
283
|
};
|
|
283
|
-
Object.defineProperty(
|
|
284
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "value", {
|
|
284
285
|
/* Public Getters */
|
|
285
286
|
/**
|
|
286
287
|
* Gets the value of the DateInput.
|
|
@@ -294,7 +295,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
294
295
|
enumerable: true,
|
|
295
296
|
configurable: true
|
|
296
297
|
});
|
|
297
|
-
Object.defineProperty(
|
|
298
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "name", {
|
|
298
299
|
/**
|
|
299
300
|
* Gets the `name` property of the DateInput.
|
|
300
301
|
*/
|
|
@@ -304,31 +305,31 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
304
305
|
enumerable: true,
|
|
305
306
|
configurable: true
|
|
306
307
|
});
|
|
307
|
-
Object.defineProperty(
|
|
308
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "min", {
|
|
308
309
|
get: function () {
|
|
309
310
|
return this.props.min !== undefined
|
|
310
311
|
? this.props.min
|
|
311
|
-
:
|
|
312
|
+
: DateInputWithoutContext.defaultProps.min;
|
|
312
313
|
},
|
|
313
314
|
enumerable: true,
|
|
314
315
|
configurable: true
|
|
315
316
|
});
|
|
316
|
-
Object.defineProperty(
|
|
317
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "max", {
|
|
317
318
|
get: function () {
|
|
318
319
|
return this.props.max !== undefined
|
|
319
320
|
? this.props.max
|
|
320
|
-
:
|
|
321
|
+
: DateInputWithoutContext.defaultProps.max;
|
|
321
322
|
},
|
|
322
323
|
enumerable: true,
|
|
323
324
|
configurable: true
|
|
324
325
|
});
|
|
325
|
-
Object.defineProperty(
|
|
326
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "text", {
|
|
326
327
|
/**
|
|
327
328
|
* @hidden
|
|
328
329
|
*/
|
|
329
330
|
get: function () {
|
|
330
331
|
var props = __assign({}, DateInput.defaultProps, this.props);
|
|
331
|
-
var
|
|
332
|
+
var _a = props.formatPlaceholder, formatPlaceholder = _a === void 0 ? DateInputWithoutContext.defaultProps.formatPlaceholder : _a, _b = props.format, format = _b === void 0 ? DateInputWithoutContext.defaultProps.format : _b, value = props.value, defaultValue = props.defaultValue;
|
|
332
333
|
if (this.kendoDate === null) {
|
|
333
334
|
this.kendoDate = new KendoDate(this.intl.bind(this), formatPlaceholder, format);
|
|
334
335
|
this.kendoDate.setValue(value || defaultValue || null);
|
|
@@ -340,9 +341,9 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
340
341
|
if (value !== undefined && this.value !== value) {
|
|
341
342
|
this.kendoDate.setValue(value);
|
|
342
343
|
}
|
|
343
|
-
var
|
|
344
|
+
var _c = this.kendoDate.getTextAndFormat(), currentText = _c.text, currentFormat = _c.format;
|
|
344
345
|
this.currentFormat = currentFormat;
|
|
345
|
-
return props.placeholder !== null
|
|
346
|
+
return props.placeholder !== null && props.placeholder !== undefined
|
|
346
347
|
&& !this.state.focused
|
|
347
348
|
&& !this.kendoDate.hasValue()
|
|
348
349
|
? props.placeholder
|
|
@@ -351,7 +352,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
351
352
|
enumerable: true,
|
|
352
353
|
configurable: true
|
|
353
354
|
});
|
|
354
|
-
Object.defineProperty(
|
|
355
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "validity", {
|
|
355
356
|
/**
|
|
356
357
|
* Represents the validity state into which the DateInput is set.
|
|
357
358
|
*/
|
|
@@ -372,7 +373,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
372
373
|
enumerable: true,
|
|
373
374
|
configurable: true
|
|
374
375
|
});
|
|
375
|
-
Object.defineProperty(
|
|
376
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "element", {
|
|
376
377
|
/**
|
|
377
378
|
* Gets the element of the DateInput.
|
|
378
379
|
*
|
|
@@ -410,31 +411,31 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
410
411
|
enumerable: true,
|
|
411
412
|
configurable: true
|
|
412
413
|
});
|
|
413
|
-
Object.defineProperty(
|
|
414
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "validityStyles", {
|
|
414
415
|
/**
|
|
415
416
|
* @hidden
|
|
416
417
|
*/
|
|
417
418
|
get: function () {
|
|
418
419
|
return this.props.validityStyles !== undefined
|
|
419
420
|
? this.props.validityStyles
|
|
420
|
-
:
|
|
421
|
+
: DateInputWithoutContext.defaultProps.validityStyles;
|
|
421
422
|
},
|
|
422
423
|
enumerable: true,
|
|
423
424
|
configurable: true
|
|
424
425
|
});
|
|
425
|
-
Object.defineProperty(
|
|
426
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "required", {
|
|
426
427
|
/**
|
|
427
428
|
* @hidden
|
|
428
429
|
*/
|
|
429
430
|
get: function () {
|
|
430
431
|
return this.props.required !== undefined
|
|
431
432
|
? this.props.required
|
|
432
|
-
:
|
|
433
|
+
: DateInputWithoutContext.defaultProps.required;
|
|
433
434
|
},
|
|
434
435
|
enumerable: true,
|
|
435
436
|
configurable: true
|
|
436
437
|
});
|
|
437
|
-
Object.defineProperty(
|
|
438
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "wrapper", {
|
|
438
439
|
/**
|
|
439
440
|
* @hidden
|
|
440
441
|
*/
|
|
@@ -447,10 +448,10 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
447
448
|
/**
|
|
448
449
|
* @hidden
|
|
449
450
|
*/
|
|
450
|
-
|
|
451
|
+
DateInputWithoutContext.prototype.intl = function () {
|
|
451
452
|
return provideIntlService(this);
|
|
452
453
|
};
|
|
453
|
-
Object.defineProperty(
|
|
454
|
+
Object.defineProperty(DateInputWithoutContext.prototype, "selection", {
|
|
454
455
|
/* end handlers */
|
|
455
456
|
get: function () {
|
|
456
457
|
var returnValue = { start: 0, end: 0 };
|
|
@@ -462,7 +463,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
462
463
|
enumerable: true,
|
|
463
464
|
configurable: true
|
|
464
465
|
});
|
|
465
|
-
|
|
466
|
+
DateInputWithoutContext.prototype.setSelection = function (selection) {
|
|
466
467
|
var _this = this;
|
|
467
468
|
this._lastSelectedSymbol = this.currentFormat[selection.start];
|
|
468
469
|
window.requestAnimationFrame(function () {
|
|
@@ -471,7 +472,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
471
472
|
}
|
|
472
473
|
});
|
|
473
474
|
};
|
|
474
|
-
|
|
475
|
+
DateInputWithoutContext.prototype.triggerChange = function (event, oldValue) {
|
|
475
476
|
this.valueDuringOnChange = this.value;
|
|
476
477
|
this.forceUpdate();
|
|
477
478
|
if (this.props.onChange
|
|
@@ -487,7 +488,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
487
488
|
}
|
|
488
489
|
this.valueDuringOnChange = undefined;
|
|
489
490
|
};
|
|
490
|
-
|
|
491
|
+
DateInputWithoutContext.prototype.selectionBySymbol = function (symbol) {
|
|
491
492
|
var start = -1;
|
|
492
493
|
var end = 0;
|
|
493
494
|
for (var i = 0; i < this.currentFormat.length; i++) {
|
|
@@ -503,7 +504,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
503
504
|
}
|
|
504
505
|
return { start: start, end: end };
|
|
505
506
|
};
|
|
506
|
-
|
|
507
|
+
DateInputWithoutContext.prototype.selectionByIndex = function (index) {
|
|
507
508
|
var selection = { start: index, end: index };
|
|
508
509
|
for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) {
|
|
509
510
|
if (i < this.currentFormat.length && this.currentFormat[i] !== '_') {
|
|
@@ -517,7 +518,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
517
518
|
}
|
|
518
519
|
return selection;
|
|
519
520
|
};
|
|
520
|
-
|
|
521
|
+
DateInputWithoutContext.prototype.switchDateSegment = function (offset) {
|
|
521
522
|
var _a = this.selection, selectionStart = _a.start, selectionEnd = _a.end;
|
|
522
523
|
if (selectionStart < selectionEnd &&
|
|
523
524
|
this.currentFormat[selectionStart] !== this.currentFormat[selectionEnd - 1]) {
|
|
@@ -551,7 +552,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
551
552
|
this.setSelection({ start: a, end: b });
|
|
552
553
|
}
|
|
553
554
|
};
|
|
554
|
-
|
|
555
|
+
DateInputWithoutContext.prototype.modifyDateSegmentValue = function (offset, event) {
|
|
555
556
|
if (!this.kendoDate) {
|
|
556
557
|
return;
|
|
557
558
|
}
|
|
@@ -565,7 +566,11 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
565
566
|
/**
|
|
566
567
|
* @hidden
|
|
567
568
|
*/
|
|
568
|
-
|
|
569
|
+
DateInputWithoutContext.displayName = 'DateInput';
|
|
570
|
+
/**
|
|
571
|
+
* @hidden
|
|
572
|
+
*/
|
|
573
|
+
DateInputWithoutContext.propTypes = {
|
|
569
574
|
value: PropTypes.instanceOf(Date),
|
|
570
575
|
format: PropTypes.oneOfType([
|
|
571
576
|
PropTypes.string,
|
|
@@ -623,8 +628,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
623
628
|
ariaLabelledBy: PropTypes.string,
|
|
624
629
|
ariaDescribedBy: PropTypes.string,
|
|
625
630
|
ariaExpanded: PropTypes.oneOfType([
|
|
626
|
-
PropTypes.bool
|
|
627
|
-
PropTypes.string
|
|
631
|
+
PropTypes.bool
|
|
628
632
|
]),
|
|
629
633
|
onChange: PropTypes.func,
|
|
630
634
|
validationMessage: PropTypes.string,
|
|
@@ -635,7 +639,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
635
639
|
/**
|
|
636
640
|
* @hidden
|
|
637
641
|
*/
|
|
638
|
-
|
|
642
|
+
DateInputWithoutContext.defaultProps = {
|
|
639
643
|
format: defaultFormat,
|
|
640
644
|
formatPlaceholder: defaultFormatPlaceholder,
|
|
641
645
|
// defaultValue: null as Date | null,
|
|
@@ -651,8 +655,25 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
651
655
|
placeholder: null
|
|
652
656
|
// the rest of the properties are undefined by default
|
|
653
657
|
};
|
|
654
|
-
return
|
|
658
|
+
return DateInputWithoutContext;
|
|
655
659
|
}(React.Component));
|
|
656
|
-
export {
|
|
657
|
-
|
|
658
|
-
|
|
660
|
+
export { DateInputWithoutContext };
|
|
661
|
+
/**
|
|
662
|
+
* Represents the PropsContext of the `DateInput` component.
|
|
663
|
+
* Used for global configuration of all `DateInput` instances.
|
|
664
|
+
*
|
|
665
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
666
|
+
*/
|
|
667
|
+
export var DateInputPropsContext = createPropsContext();
|
|
668
|
+
;
|
|
669
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
670
|
+
/**
|
|
671
|
+
* Represents the KendoReact DateInput Component.
|
|
672
|
+
*
|
|
673
|
+
* Accepts properties of type [DateInputProps]({% slug api_dateinputs_dateinputprops %}).
|
|
674
|
+
* Obtaining the `ref` returns an object of type [DateInputHandle]({% slug api_dateinputs_dateinputhandle %}).
|
|
675
|
+
*/
|
|
676
|
+
export var DateInput = withPropsContext(DateInputPropsContext, DateInputWithoutContext);
|
|
677
|
+
DateInput.displayName = 'KendoReactDateInput';
|
|
678
|
+
registerForIntl(DateInputWithoutContext);
|
|
679
|
+
registerForLocalization(DateInputWithoutContext);
|
|
@@ -24,7 +24,7 @@ export interface DatePickerProps extends DatePickerSettings, FormComponentProps
|
|
|
24
24
|
/**
|
|
25
25
|
* Sets the default value of the DatePicker ([see example]({% slug default_value_datepicker %})).
|
|
26
26
|
*/
|
|
27
|
-
defaultValue?: Date;
|
|
27
|
+
defaultValue?: Date | null;
|
|
28
28
|
/**
|
|
29
29
|
* Fires each time the user selects a new value ([see example]({% slug controlled_datepicker %}#toc-controlling-the-date-value)).
|
|
30
30
|
*/
|
|
@@ -44,7 +44,12 @@ export interface DatePickerState {
|
|
|
44
44
|
show: boolean;
|
|
45
45
|
focused: boolean;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
/** @hidden */
|
|
48
|
+
export declare class DatePickerWithoutContext extends React.Component<DatePickerProps, DatePickerState> implements FormComponent {
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
static displayName: string;
|
|
48
53
|
/**
|
|
49
54
|
* @hidden
|
|
50
55
|
*/
|
|
@@ -71,7 +76,7 @@ export declare class DatePicker extends React.Component<DatePickerProps, DatePic
|
|
|
71
76
|
second: PropTypes.Requireable<string>;
|
|
72
77
|
timeZoneName: PropTypes.Requireable<string>;
|
|
73
78
|
}>>;
|
|
74
|
-
formatPlaceholder: PropTypes.Requireable<
|
|
79
|
+
formatPlaceholder: PropTypes.Requireable<"narrow" | "short" | "wide" | "formatPattern" | PropTypes.InferProps<{
|
|
75
80
|
year: PropTypes.Requireable<string>;
|
|
76
81
|
month: PropTypes.Requireable<string>;
|
|
77
82
|
day: PropTypes.Requireable<string>;
|
|
@@ -107,8 +112,8 @@ export declare class DatePicker extends React.Component<DatePickerProps, DatePic
|
|
|
107
112
|
static defaultProps: {
|
|
108
113
|
defaultShow: boolean;
|
|
109
114
|
defaultValue: any;
|
|
110
|
-
dateInput: React.ComponentType<DateInputProps<
|
|
111
|
-
calendar: React.ComponentType<CalendarProps<
|
|
115
|
+
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
116
|
+
calendar: React.ComponentType<CalendarProps<any>>;
|
|
112
117
|
toggleButton: React.ComponentType<ToggleButtonProps>;
|
|
113
118
|
popup: React.ComponentType<PopupProps>;
|
|
114
119
|
pickerWrap: React.ComponentType<PickerWrapProps>;
|
|
@@ -138,7 +143,7 @@ export declare class DatePicker extends React.Component<DatePickerProps, DatePic
|
|
|
138
143
|
private prevShow;
|
|
139
144
|
constructor(props: DatePickerProps);
|
|
140
145
|
/**
|
|
141
|
-
* Gets the wrapping element of the
|
|
146
|
+
* Gets the wrapping element of the DatePickerWithoutContext.
|
|
142
147
|
*/
|
|
143
148
|
readonly element: HTMLSpanElement | null;
|
|
144
149
|
/**
|
|
@@ -150,15 +155,15 @@ export declare class DatePicker extends React.Component<DatePickerProps, DatePic
|
|
|
150
155
|
*/
|
|
151
156
|
readonly calendar: Calendar | null;
|
|
152
157
|
/**
|
|
153
|
-
* Gets the value of the
|
|
158
|
+
* Gets the value of the DatePickerWithoutContext.
|
|
154
159
|
*/
|
|
155
160
|
readonly value: Date | null;
|
|
156
161
|
/**
|
|
157
|
-
* Gets the popup state of the
|
|
162
|
+
* Gets the popup state of the DatePickerWithoutContext.
|
|
158
163
|
*/
|
|
159
164
|
readonly show: boolean;
|
|
160
165
|
/**
|
|
161
|
-
* Gets the `name` property of the
|
|
166
|
+
* Gets the `name` property of the DatePickerWithoutContext.
|
|
162
167
|
*/
|
|
163
168
|
readonly name: string | undefined;
|
|
164
169
|
protected readonly min: Date;
|
|
@@ -215,3 +220,52 @@ export declare class DatePicker extends React.Component<DatePickerProps, DatePic
|
|
|
215
220
|
private handleIconMouseDown;
|
|
216
221
|
private handleKeyDown;
|
|
217
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Represents the PropsContext of the `DatePicker` component.
|
|
225
|
+
* Used for global configuration of all `DatePicker` instances.
|
|
226
|
+
*
|
|
227
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
228
|
+
*/
|
|
229
|
+
export declare const DatePickerPropsContext: React.Context<(p: DatePickerProps) => DatePickerProps>;
|
|
230
|
+
/**
|
|
231
|
+
* Represent the `ref` of the DatePicker component.
|
|
232
|
+
*/
|
|
233
|
+
export interface DatePickerHandle extends Pick<DatePickerWithoutContext, keyof DatePickerWithoutContext> {
|
|
234
|
+
/**
|
|
235
|
+
* Returns the HTML element of the DatePicker component.
|
|
236
|
+
*/
|
|
237
|
+
element: HTMLSpanElement | null;
|
|
238
|
+
/**
|
|
239
|
+
* Gets the Calendar component inside the DatePicker component.
|
|
240
|
+
*/
|
|
241
|
+
calendar: Calendar | null;
|
|
242
|
+
/**
|
|
243
|
+
* Gets the DateInput component inside the DatePicker component.
|
|
244
|
+
*/
|
|
245
|
+
dateInput: DateInput | null;
|
|
246
|
+
/**
|
|
247
|
+
* Gets the `name` property of the DatePicker.
|
|
248
|
+
*/
|
|
249
|
+
name: string | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* Gets the popup state of the DatePicker.
|
|
252
|
+
*/
|
|
253
|
+
show: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Represents the validity state into which the DatePicker is set.
|
|
256
|
+
*/
|
|
257
|
+
validity: FormComponentValidity;
|
|
258
|
+
/**
|
|
259
|
+
* Gets the value of the DatePicker.
|
|
260
|
+
*/
|
|
261
|
+
value: Date | null;
|
|
262
|
+
}
|
|
263
|
+
/** @hidden */
|
|
264
|
+
export declare type DatePicker = DatePickerHandle;
|
|
265
|
+
/**
|
|
266
|
+
* Represents the KendoReact DatePicker Component.
|
|
267
|
+
*
|
|
268
|
+
* Accepts properties of type [DatePickerProps]({% slug api_dateinputs_datepickerprops %}).
|
|
269
|
+
* Obtaining the `ref` returns an object of type [DatePickerHandle]({% slug api_dateinputs_datepickerhandle %}).
|
|
270
|
+
*/
|
|
271
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<any>>;
|