@progress/kendo-react-dateinputs 4.13.0-dev.202111291459 → 4.13.0-dev.202112060804
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/TimeList.d.ts +2 -0
- package/dist/es/timepicker/TimeList.js +3 -2
- package/dist/es/timepicker/TimePart.d.ts +2 -0
- package/dist/es/timepicker/TimePart.js +3 -2
- package/dist/es/timepicker/TimePicker.d.ts +58 -4
- package/dist/es/timepicker/TimePicker.js +60 -39
- package/dist/es/timepicker/TimeSelector.d.ts +2 -0
- package/dist/es/timepicker/TimeSelector.js +3 -2
- 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/TimeList.d.ts +2 -0
- package/dist/npm/timepicker/TimeList.js +3 -2
- package/dist/npm/timepicker/TimePart.d.ts +2 -0
- package/dist/npm/timepicker/TimePart.js +3 -2
- package/dist/npm/timepicker/TimePicker.d.ts +58 -4
- package/dist/npm/timepicker/TimePicker.js +59 -38
- package/dist/npm/timepicker/TimeSelector.d.ts +2 -0
- package/dist/npm/timepicker/TimeSelector.js +3 -2
- 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
|
@@ -23,7 +23,7 @@ export interface DateTimePickerProps extends DateTimePickerSettings, FormCompone
|
|
|
23
23
|
* For more information, refer to the article on
|
|
24
24
|
* [uncontrolled components in React](https://reactjs.org/docs/uncontrolled-components.html).
|
|
25
25
|
*/
|
|
26
|
-
defaultValue?: Date;
|
|
26
|
+
defaultValue?: Date | null;
|
|
27
27
|
/**
|
|
28
28
|
* Fires each time the user selects a new value
|
|
29
29
|
* ([see example]({% slug controlled_datetimepicker %}#toc-controlling-the-date-value)).
|
|
@@ -46,7 +46,12 @@ export interface DateTimePickerState {
|
|
|
46
46
|
show: boolean;
|
|
47
47
|
focused: boolean;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
/** @hidden */
|
|
50
|
+
export declare class DateTimePickerWithoutContext extends React.Component<DateTimePickerProps, DateTimePickerState> implements FormComponent {
|
|
51
|
+
/**
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
static displayName: string;
|
|
50
55
|
/**
|
|
51
56
|
* @hidden
|
|
52
57
|
*/
|
|
@@ -73,7 +78,7 @@ export declare class DateTimePicker extends React.Component<DateTimePickerProps,
|
|
|
73
78
|
second: PropTypes.Requireable<string>;
|
|
74
79
|
timeZoneName: PropTypes.Requireable<string>;
|
|
75
80
|
}>>;
|
|
76
|
-
formatPlaceholder: PropTypes.Requireable<
|
|
81
|
+
formatPlaceholder: PropTypes.Requireable<"narrow" | "short" | "wide" | "formatPattern" | PropTypes.InferProps<{
|
|
77
82
|
year: PropTypes.Requireable<string>;
|
|
78
83
|
month: PropTypes.Requireable<string>;
|
|
79
84
|
day: PropTypes.Requireable<string>;
|
|
@@ -120,7 +125,7 @@ export declare class DateTimePicker extends React.Component<DateTimePickerProps,
|
|
|
120
125
|
required: boolean;
|
|
121
126
|
validityStyles: boolean;
|
|
122
127
|
cancelButton: boolean;
|
|
123
|
-
dateInput: React.ComponentType<DateInputProps<
|
|
128
|
+
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
124
129
|
};
|
|
125
130
|
/**
|
|
126
131
|
* @hidden
|
|
@@ -206,3 +211,48 @@ export declare class DateTimePicker extends React.Component<DateTimePickerProps,
|
|
|
206
211
|
private handleKeyDown;
|
|
207
212
|
private dateInputElement;
|
|
208
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Represents the PropsContext of the `DateTimePicker` component.
|
|
216
|
+
* Used for global configuration of all `DateTimePicker` instances.
|
|
217
|
+
*
|
|
218
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
219
|
+
*/
|
|
220
|
+
export declare const DateTimePickerPropsContext: React.Context<(p: DateTimePickerProps) => DateTimePickerProps>;
|
|
221
|
+
/**
|
|
222
|
+
* Represent the `ref` of the DateTimePicker component.
|
|
223
|
+
*/
|
|
224
|
+
export interface DateTimePickerHandle extends Pick<DateTimePickerWithoutContext, keyof DateTimePickerWithoutContext> {
|
|
225
|
+
/**
|
|
226
|
+
* Gets the DateInput component inside the DateTimePicker component.
|
|
227
|
+
*/
|
|
228
|
+
dateInput: DateInput | null;
|
|
229
|
+
/**
|
|
230
|
+
* Returns the HTML element of the DateTimePicker component.
|
|
231
|
+
*/
|
|
232
|
+
element: HTMLSpanElement | null;
|
|
233
|
+
/**
|
|
234
|
+
* Gets the `name` property of the DateTimePicker.
|
|
235
|
+
*/
|
|
236
|
+
name: string | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Gets the popup state of the DateTimePicker.
|
|
239
|
+
*/
|
|
240
|
+
show: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Represents the validity state into which the DateTimePicker is set.
|
|
243
|
+
*/
|
|
244
|
+
validity: FormComponentValidity;
|
|
245
|
+
/**
|
|
246
|
+
* Gets the value of the DateTimePicker.
|
|
247
|
+
*/
|
|
248
|
+
value: Date | null;
|
|
249
|
+
}
|
|
250
|
+
/** @hidden */
|
|
251
|
+
export declare type DateTimePicker = DateTimePickerHandle;
|
|
252
|
+
/**
|
|
253
|
+
* Represents the KendoReact DateTimePicker Component.
|
|
254
|
+
*
|
|
255
|
+
* Accepts properties of type [DateTimePickerProps]({% slug api_dateinputs_datetimepickerprops %}).
|
|
256
|
+
* Obtaining the `ref` returns an object of type [DateTimePickerHandle]({% slug api_dateinputs_datetimepickerhandle %}).
|
|
257
|
+
*/
|
|
258
|
+
export declare const DateTimePicker: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<any>>;
|
|
@@ -39,9 +39,10 @@ var DateTimeSelector_1 = require("./DateTimeSelector");
|
|
|
39
39
|
var utils_2 = require("../timepicker/utils");
|
|
40
40
|
var defaults_1 = require("../defaults");
|
|
41
41
|
var usePickerFloatingLabel_1 = require("../hooks/usePickerFloatingLabel");
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
/** @hidden */
|
|
43
|
+
var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
44
|
+
__extends(DateTimePickerWithoutContext, _super);
|
|
45
|
+
function DateTimePickerWithoutContext(props) {
|
|
45
46
|
var _this = _super.call(this, props) || this;
|
|
46
47
|
_this._popupId = kendo_react_common_1.guid();
|
|
47
48
|
_this._element = null;
|
|
@@ -121,13 +122,13 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
121
122
|
};
|
|
122
123
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
123
124
|
_this.state = {
|
|
124
|
-
value: _this.props.defaultValue ||
|
|
125
|
-
show: _this.props.defaultShow ||
|
|
125
|
+
value: _this.props.defaultValue || DateTimePickerWithoutContext.defaultProps.defaultValue,
|
|
126
|
+
show: _this.props.defaultShow || DateTimePickerWithoutContext.defaultProps.defaultShow,
|
|
126
127
|
focused: false
|
|
127
128
|
};
|
|
128
129
|
return _this;
|
|
129
130
|
}
|
|
130
|
-
Object.defineProperty(
|
|
131
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "element", {
|
|
131
132
|
/**
|
|
132
133
|
* Gets the wrapping element of the DateTimePicker.
|
|
133
134
|
*/
|
|
@@ -137,7 +138,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
137
138
|
enumerable: true,
|
|
138
139
|
configurable: true
|
|
139
140
|
});
|
|
140
|
-
Object.defineProperty(
|
|
141
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "dateInput", {
|
|
141
142
|
/**
|
|
142
143
|
* Gets the DateInput component inside the DateTimePicker component.
|
|
143
144
|
*/
|
|
@@ -147,7 +148,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
147
148
|
enumerable: true,
|
|
148
149
|
configurable: true
|
|
149
150
|
});
|
|
150
|
-
Object.defineProperty(
|
|
151
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "value", {
|
|
151
152
|
/**
|
|
152
153
|
* Gets the value of the DateTimePicker.
|
|
153
154
|
*/
|
|
@@ -162,7 +163,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
162
163
|
enumerable: true,
|
|
163
164
|
configurable: true
|
|
164
165
|
});
|
|
165
|
-
Object.defineProperty(
|
|
166
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "show", {
|
|
166
167
|
/**
|
|
167
168
|
* Gets the popup state of the DateTimePicker.
|
|
168
169
|
*/
|
|
@@ -176,7 +177,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
176
177
|
enumerable: true,
|
|
177
178
|
configurable: true
|
|
178
179
|
});
|
|
179
|
-
Object.defineProperty(
|
|
180
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "name", {
|
|
180
181
|
/**
|
|
181
182
|
* Gets the `name` property of the DateTimePicker.
|
|
182
183
|
*/
|
|
@@ -186,25 +187,25 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
186
187
|
enumerable: true,
|
|
187
188
|
configurable: true
|
|
188
189
|
});
|
|
189
|
-
Object.defineProperty(
|
|
190
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "min", {
|
|
190
191
|
get: function () {
|
|
191
192
|
return this.props.min !== undefined
|
|
192
193
|
? this.props.min
|
|
193
|
-
:
|
|
194
|
+
: DateTimePickerWithoutContext.defaultProps.min;
|
|
194
195
|
},
|
|
195
196
|
enumerable: true,
|
|
196
197
|
configurable: true
|
|
197
198
|
});
|
|
198
|
-
Object.defineProperty(
|
|
199
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "max", {
|
|
199
200
|
get: function () {
|
|
200
201
|
return this.props.max !== undefined
|
|
201
202
|
? this.props.max
|
|
202
|
-
:
|
|
203
|
+
: DateTimePickerWithoutContext.defaultProps.max;
|
|
203
204
|
},
|
|
204
205
|
enumerable: true,
|
|
205
206
|
configurable: true
|
|
206
207
|
});
|
|
207
|
-
Object.defineProperty(
|
|
208
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "validity", {
|
|
208
209
|
/**
|
|
209
210
|
* Represents the validity state into which the DateTimePicker is set.
|
|
210
211
|
*/
|
|
@@ -225,36 +226,36 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
225
226
|
enumerable: true,
|
|
226
227
|
configurable: true
|
|
227
228
|
});
|
|
228
|
-
Object.defineProperty(
|
|
229
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "validityStyles", {
|
|
229
230
|
/**
|
|
230
231
|
* @hidden
|
|
231
232
|
*/
|
|
232
233
|
get: function () {
|
|
233
234
|
return this.props.validityStyles !== undefined
|
|
234
235
|
? this.props.validityStyles
|
|
235
|
-
:
|
|
236
|
+
: DateTimePickerWithoutContext.defaultProps.validityStyles;
|
|
236
237
|
},
|
|
237
238
|
enumerable: true,
|
|
238
239
|
configurable: true
|
|
239
240
|
});
|
|
240
|
-
Object.defineProperty(
|
|
241
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "required", {
|
|
241
242
|
/**
|
|
242
243
|
* @hidden
|
|
243
244
|
*/
|
|
244
245
|
get: function () {
|
|
245
246
|
return this.props.required !== undefined
|
|
246
247
|
? this.props.required
|
|
247
|
-
:
|
|
248
|
+
: DateTimePickerWithoutContext.defaultProps.required;
|
|
248
249
|
},
|
|
249
250
|
enumerable: true,
|
|
250
251
|
configurable: true
|
|
251
252
|
});
|
|
252
|
-
Object.defineProperty(
|
|
253
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "dateInputComp", {
|
|
253
254
|
/**
|
|
254
255
|
* @hidden
|
|
255
256
|
*/
|
|
256
257
|
get: function () {
|
|
257
|
-
return this.props.dateInput ||
|
|
258
|
+
return this.props.dateInput || DateTimePickerWithoutContext.defaultProps.dateInput;
|
|
258
259
|
},
|
|
259
260
|
enumerable: true,
|
|
260
261
|
configurable: true
|
|
@@ -262,7 +263,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
262
263
|
/**
|
|
263
264
|
* @hidden
|
|
264
265
|
*/
|
|
265
|
-
|
|
266
|
+
DateTimePickerWithoutContext.prototype.componentDidMount = function () {
|
|
266
267
|
if (this.show) {
|
|
267
268
|
// If defaultShow is true during the initial render, the popup is not aligned.
|
|
268
269
|
this.forceUpdate();
|
|
@@ -271,7 +272,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
271
272
|
/**
|
|
272
273
|
* @hidden
|
|
273
274
|
*/
|
|
274
|
-
|
|
275
|
+
DateTimePickerWithoutContext.prototype.componentDidUpdate = function () {
|
|
275
276
|
var dateInputElement = this.dateInputElement();
|
|
276
277
|
if (this._dateTimeSelector && this.show && !this.prevShow) {
|
|
277
278
|
this._dateTimeSelector.focus({ preventScroll: true });
|
|
@@ -287,13 +288,13 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
287
288
|
/**
|
|
288
289
|
* @hidden
|
|
289
290
|
*/
|
|
290
|
-
|
|
291
|
+
DateTimePickerWithoutContext.prototype.componentWillUnmount = function () {
|
|
291
292
|
clearTimeout(this.nextTickId);
|
|
292
293
|
};
|
|
293
294
|
/**
|
|
294
295
|
* @hidden
|
|
295
296
|
*/
|
|
296
|
-
|
|
297
|
+
DateTimePickerWithoutContext.prototype.render = function () {
|
|
297
298
|
var _this = this;
|
|
298
299
|
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, cancelButton = _a.cancelButton, minTime = _a.minTime, maxTime = _a.maxTime, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, _b = _a.popup, PopupComponent = _b === void 0 ? kendo_react_popup_1.Popup : _b, calendar = _a.calendar;
|
|
299
300
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
@@ -345,13 +346,13 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
345
346
|
? (React.createElement(usePickerFloatingLabel_1.PickerFloatingLabel, { dateInput: this._dateInput, label: this.props.label, editorId: id, editorValid: isValid, editorDisabled: this.props.disabled, children: dateTimePicker, style: { width: this.props.width } }))
|
|
346
347
|
: dateTimePicker;
|
|
347
348
|
};
|
|
348
|
-
|
|
349
|
+
DateTimePickerWithoutContext.prototype.setShow = function (show) {
|
|
349
350
|
if (this.show === show) {
|
|
350
351
|
return;
|
|
351
352
|
}
|
|
352
353
|
this.setState({ show: show });
|
|
353
354
|
};
|
|
354
|
-
|
|
355
|
+
DateTimePickerWithoutContext.prototype.nextTick = function (f) {
|
|
355
356
|
// XXX: use window.setTimeout due to async focus/blur events in IE, and missing relatedTarget prop.
|
|
356
357
|
// XXX: https://github.com/facebook/react/issues/3751
|
|
357
358
|
// Handles multiple focus events happening at the same time.
|
|
@@ -361,7 +362,11 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
361
362
|
/**
|
|
362
363
|
* @hidden
|
|
363
364
|
*/
|
|
364
|
-
|
|
365
|
+
DateTimePickerWithoutContext.displayName = 'DateTimePicker';
|
|
366
|
+
/**
|
|
367
|
+
* @hidden
|
|
368
|
+
*/
|
|
369
|
+
DateTimePickerWithoutContext.propTypes = {
|
|
365
370
|
className: PropTypes.string,
|
|
366
371
|
defaultShow: PropTypes.bool,
|
|
367
372
|
defaultValue: PropTypes.instanceOf(Date),
|
|
@@ -424,7 +429,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
424
429
|
/**
|
|
425
430
|
* @hidden
|
|
426
431
|
*/
|
|
427
|
-
|
|
432
|
+
DateTimePickerWithoutContext.defaultProps = {
|
|
428
433
|
defaultShow: false,
|
|
429
434
|
defaultValue: null,
|
|
430
435
|
disabled: false,
|
|
@@ -439,7 +444,23 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
439
444
|
cancelButton: true,
|
|
440
445
|
dateInput: DateInput_1.DateInput
|
|
441
446
|
};
|
|
442
|
-
return
|
|
447
|
+
return DateTimePickerWithoutContext;
|
|
443
448
|
}(React.Component));
|
|
444
|
-
exports.
|
|
445
|
-
|
|
449
|
+
exports.DateTimePickerWithoutContext = DateTimePickerWithoutContext;
|
|
450
|
+
/**
|
|
451
|
+
* Represents the PropsContext of the `DateTimePicker` component.
|
|
452
|
+
* Used for global configuration of all `DateTimePicker` instances.
|
|
453
|
+
*
|
|
454
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
455
|
+
*/
|
|
456
|
+
exports.DateTimePickerPropsContext = kendo_react_common_1.createPropsContext();
|
|
457
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
458
|
+
/**
|
|
459
|
+
* Represents the KendoReact DateTimePicker Component.
|
|
460
|
+
*
|
|
461
|
+
* Accepts properties of type [DateTimePickerProps]({% slug api_dateinputs_datetimepickerprops %}).
|
|
462
|
+
* Obtaining the `ref` returns an object of type [DateTimePickerHandle]({% slug api_dateinputs_datetimepickerhandle %}).
|
|
463
|
+
*/
|
|
464
|
+
exports.DateTimePicker = kendo_react_common_1.withPropsContext(exports.DateTimePickerPropsContext, DateTimePickerWithoutContext);
|
|
465
|
+
exports.DateTimePicker.displayName = 'KendoReactDateTimePicker';
|
|
466
|
+
kendo_react_intl_1.registerForLocalization(DateTimePickerWithoutContext);
|
|
@@ -11,7 +11,7 @@ export declare type PickerFloatingLabelProps = FloatingLabelProps & {
|
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
|
-
export declare const usePickerFloatingLabel: (dateInput: React.RefObject<DateInput>) => {
|
|
14
|
+
export declare const usePickerFloatingLabel: (dateInput: React.RefObject<import("../dateinput/DateInput").DateInputHandle>) => {
|
|
15
15
|
editorValue: boolean;
|
|
16
16
|
};
|
|
17
17
|
/**
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Calendar, CalendarProps, CalendarChangeEvent } from './calendar/components/Calendar';
|
|
2
|
-
import { DateInput, DateInputProps, DateInputChangeEvent } from './dateinput/DateInput';
|
|
3
|
-
import { DatePicker, DatePickerProps, DatePickerChangeEvent } from './datepicker/DatePicker';
|
|
4
|
-
import { TimePicker, TimePickerProps, TimePickerChangeEvent } from './timepicker/TimePicker';
|
|
5
|
-
import { MultiViewCalendar, MultiViewCalendarProps, MultiViewCalendarChangeEvent } from './calendar/components/MultiViewCalendar';
|
|
6
|
-
import { DateRangePicker, DateRangePickerProps, DateRangePickerChangeEvent } from './daterangepicker/DateRangePicker';
|
|
1
|
+
import { Calendar, CalendarProps, CalendarPropsContext, CalendarHandle, CalendarChangeEvent } from './calendar/components/Calendar';
|
|
2
|
+
import { DateInput, DateInputProps, DateInputPropsContext, DateInputHandle, DateInputChangeEvent } from './dateinput/DateInput';
|
|
3
|
+
import { DatePicker, DatePickerProps, DatePickerPropsContext, DatePickerHandle, DatePickerChangeEvent } from './datepicker/DatePicker';
|
|
4
|
+
import { TimePicker, TimePickerProps, TimePickerPropsContext, TimePickerHandle, TimePickerChangeEvent } from './timepicker/TimePicker';
|
|
5
|
+
import { MultiViewCalendar, MultiViewCalendarProps, MultiViewCalendarPropsContext, MultiViewCalendarHandle, MultiViewCalendarChangeEvent } from './calendar/components/MultiViewCalendar';
|
|
6
|
+
import { DateRangePicker, DateRangePickerProps, DateRangePickerPropsContext, DateRangePickerHandle, DateRangePickerChangeEvent } from './daterangepicker/DateRangePicker';
|
|
7
7
|
import { CalendarCell, CalendarCellProps } from './calendar/components/CalendarCell';
|
|
8
8
|
import { CalendarWeekCell, CalendarWeekCellProps } from './calendar/components/CalendarWeekCell';
|
|
9
9
|
import { CalendarHeaderTitle, CalendarHeaderTitleProps } from './calendar/components/CalendarHeaderTitle';
|
|
10
10
|
import { CalendarNavigationItem, CalendarNavigationItemProps } from './calendar/components/CalendarNavigationItem';
|
|
11
11
|
import { ActiveView, SelectionRange, CalendarSettings, CalendarViewEnum, MultiViewCalendarMode, MultiViewCalendarSettings } from './calendar/models';
|
|
12
12
|
import { DateInputSettings, DateInputIncrementalSteps, DateInputFormatPlaceholder, DateInputCustomFormatPlaceholder } from './dateinput/models';
|
|
13
|
-
import { DateTimePicker, DateTimePickerProps, DateTimePickerChangeEvent } from './datetimepicker/DateTimePicker';
|
|
13
|
+
import { DateTimePicker, DateTimePickerProps, DateTimePickerPropsContext, DateTimePickerHandle, DateTimePickerChangeEvent } from './datetimepicker/DateTimePicker';
|
|
14
14
|
import { DatePickerSettings } from './datepicker/models';
|
|
15
15
|
import { DateTimePickerSettings } from './datetimepicker/models';
|
|
16
16
|
import { TimePickerSettings } from './timepicker/models';
|
|
@@ -18,4 +18,4 @@ import { DateRangePickerSettings, DateRangePickerPopupSettings, DateRangePickerC
|
|
|
18
18
|
import { ToggleButton, ToggleButtonProps } from './datepicker/ToggleButton';
|
|
19
19
|
import { PickerWrap, PickerWrapProps } from './common/PickerWrap';
|
|
20
20
|
import { FormComponentValidity } from '@progress/kendo-react-common';
|
|
21
|
-
export { PickerWrap, PickerWrapProps, ToggleButton, ToggleButtonProps, ActiveView, Calendar, CalendarProps, CalendarSettings, CalendarViewEnum, CalendarChangeEvent, CalendarCell, CalendarCellProps, CalendarWeekCell, CalendarWeekCellProps, CalendarHeaderTitle, CalendarHeaderTitleProps, CalendarNavigationItem, CalendarNavigationItemProps, DateInput, DateInputProps, DateInputSettings, DateInputChangeEvent, DateInputIncrementalSteps, DateInputFormatPlaceholder, DateInputCustomFormatPlaceholder, DatePicker, DatePickerProps, DatePickerSettings, DatePickerChangeEvent, TimePicker, TimePickerProps, TimePickerSettings, TimePickerChangeEvent, MultiViewCalendar, MultiViewCalendarProps, MultiViewCalendarSettings, MultiViewCalendarMode, MultiViewCalendarChangeEvent, DateRangePicker, DateRangePickerProps, DateRangePickerSettings, DateRangePickerCalendarSettings, DateRangePickerDateInputSettings, DateRangePickerPopupSettings, DateRangePickerChangeEvent, DateTimePicker, DateTimePickerProps, DateTimePickerSettings, DateTimePickerChangeEvent, SelectionRange, FormComponentValidity };
|
|
21
|
+
export { PickerWrap, PickerWrapProps, ToggleButton, ToggleButtonProps, ActiveView, Calendar, CalendarProps, CalendarPropsContext, CalendarHandle, CalendarSettings, CalendarViewEnum, CalendarChangeEvent, CalendarCell, CalendarCellProps, CalendarWeekCell, CalendarWeekCellProps, CalendarHeaderTitle, CalendarHeaderTitleProps, CalendarNavigationItem, CalendarNavigationItemProps, DateInput, DateInputProps, DateInputPropsContext, DateInputHandle, DateInputSettings, DateInputChangeEvent, DateInputIncrementalSteps, DateInputFormatPlaceholder, DateInputCustomFormatPlaceholder, DatePicker, DatePickerProps, DatePickerPropsContext, DatePickerHandle, DatePickerSettings, DatePickerChangeEvent, TimePicker, TimePickerProps, TimePickerPropsContext, TimePickerHandle, TimePickerSettings, TimePickerChangeEvent, MultiViewCalendar, MultiViewCalendarProps, MultiViewCalendarPropsContext, MultiViewCalendarHandle, MultiViewCalendarSettings, MultiViewCalendarMode, MultiViewCalendarChangeEvent, DateRangePicker, DateRangePickerProps, DateRangePickerPropsContext, DateRangePickerHandle, DateRangePickerSettings, DateRangePickerCalendarSettings, DateRangePickerDateInputSettings, DateRangePickerPopupSettings, DateRangePickerChangeEvent, DateTimePicker, DateTimePickerProps, DateTimePickerPropsContext, DateTimePickerHandle, DateTimePickerSettings, DateTimePickerChangeEvent, SelectionRange, FormComponentValidity };
|
package/dist/npm/main.js
CHANGED
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Calendar_1 = require("./calendar/components/Calendar");
|
|
4
4
|
exports.Calendar = Calendar_1.Calendar;
|
|
5
|
+
exports.CalendarPropsContext = Calendar_1.CalendarPropsContext;
|
|
5
6
|
var DateInput_1 = require("./dateinput/DateInput");
|
|
6
7
|
exports.DateInput = DateInput_1.DateInput;
|
|
8
|
+
exports.DateInputPropsContext = DateInput_1.DateInputPropsContext;
|
|
7
9
|
var DatePicker_1 = require("./datepicker/DatePicker");
|
|
8
10
|
exports.DatePicker = DatePicker_1.DatePicker;
|
|
11
|
+
exports.DatePickerPropsContext = DatePicker_1.DatePickerPropsContext;
|
|
9
12
|
var TimePicker_1 = require("./timepicker/TimePicker");
|
|
10
13
|
exports.TimePicker = TimePicker_1.TimePicker;
|
|
14
|
+
exports.TimePickerPropsContext = TimePicker_1.TimePickerPropsContext;
|
|
11
15
|
var MultiViewCalendar_1 = require("./calendar/components/MultiViewCalendar");
|
|
12
16
|
exports.MultiViewCalendar = MultiViewCalendar_1.MultiViewCalendar;
|
|
17
|
+
exports.MultiViewCalendarPropsContext = MultiViewCalendar_1.MultiViewCalendarPropsContext;
|
|
13
18
|
var DateRangePicker_1 = require("./daterangepicker/DateRangePicker");
|
|
14
19
|
exports.DateRangePicker = DateRangePicker_1.DateRangePicker;
|
|
20
|
+
exports.DateRangePickerPropsContext = DateRangePicker_1.DateRangePickerPropsContext;
|
|
15
21
|
var CalendarCell_1 = require("./calendar/components/CalendarCell");
|
|
16
22
|
exports.CalendarCell = CalendarCell_1.CalendarCell;
|
|
17
23
|
var CalendarWeekCell_1 = require("./calendar/components/CalendarWeekCell");
|
|
@@ -24,6 +30,7 @@ var models_1 = require("./calendar/models");
|
|
|
24
30
|
exports.CalendarViewEnum = models_1.CalendarViewEnum;
|
|
25
31
|
var DateTimePicker_1 = require("./datetimepicker/DateTimePicker");
|
|
26
32
|
exports.DateTimePicker = DateTimePicker_1.DateTimePicker;
|
|
33
|
+
exports.DateTimePickerPropsContext = DateTimePicker_1.DateTimePickerPropsContext;
|
|
27
34
|
var ToggleButton_1 = require("./datepicker/ToggleButton");
|
|
28
35
|
exports.ToggleButton = ToggleButton_1.ToggleButton;
|
|
29
36
|
var PickerWrap_1 = require("./common/PickerWrap");
|
|
@@ -7,7 +7,7 @@ exports.packageMetadata = {
|
|
|
7
7
|
name: '@progress/kendo-react-dateinputs',
|
|
8
8
|
productName: 'KendoReact',
|
|
9
9
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
10
|
-
publishDate:
|
|
10
|
+
publishDate: 1638776616,
|
|
11
11
|
version: '',
|
|
12
12
|
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'
|
|
13
13
|
};
|
|
@@ -19,6 +19,7 @@ export interface TimeListProps {
|
|
|
19
19
|
smoothScroll?: boolean;
|
|
20
20
|
boundRange?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
+
show?: boolean;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* @hidden
|
|
@@ -32,6 +33,7 @@ export declare class TimeList extends React.Component<TimeListProps, {}> {
|
|
|
32
33
|
step: (props: TimeListProps, propName: string, componentName: string) => any;
|
|
33
34
|
value: PropTypes.Requireable<Date>;
|
|
34
35
|
smoothScroll: PropTypes.Requireable<boolean>;
|
|
36
|
+
show: PropTypes.Requireable<boolean>;
|
|
35
37
|
};
|
|
36
38
|
static defaultProps: {
|
|
37
39
|
boundRange: boolean;
|
|
@@ -126,7 +126,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
126
126
|
if (!_this._element) {
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
|
-
if (document && document.activeElement !== _this._element) {
|
|
129
|
+
if (document && document.activeElement !== _this._element && _this.props.show) {
|
|
130
130
|
_this._element.focus({ preventScroll: true });
|
|
131
131
|
}
|
|
132
132
|
};
|
|
@@ -264,7 +264,8 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
264
264
|
return null;
|
|
265
265
|
},
|
|
266
266
|
value: PropTypes.instanceOf(Date),
|
|
267
|
-
smoothScroll: PropTypes.bool
|
|
267
|
+
smoothScroll: PropTypes.bool,
|
|
268
|
+
show: PropTypes.bool
|
|
268
269
|
};
|
|
269
270
|
TimeList.defaultProps = {
|
|
270
271
|
boundRange: false,
|
|
@@ -36,6 +36,7 @@ export interface TimePartProps {
|
|
|
36
36
|
onNowClick?: any;
|
|
37
37
|
className?: string;
|
|
38
38
|
onMount?: (value: Date) => void;
|
|
39
|
+
show?: boolean;
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* @hidden
|
|
@@ -78,6 +79,7 @@ export declare class TimePart extends React.Component<TimePartProps, TimePartSta
|
|
|
78
79
|
smoothScroll: PropTypes.Requireable<boolean>;
|
|
79
80
|
tabIndex: PropTypes.Requireable<number>;
|
|
80
81
|
value: PropTypes.Requireable<Date>;
|
|
82
|
+
show: PropTypes.Requireable<boolean>;
|
|
81
83
|
};
|
|
82
84
|
static defaultProps: {
|
|
83
85
|
value: any;
|
|
@@ -230,7 +230,7 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
230
230
|
React.createElement("span", { className: "k-title", onMouseDown: function (e) { e.preventDefault(); } }, _this.intl.dateFieldName(part)),
|
|
231
231
|
React.createElement(TimeList_1.TimeList, { min: _this.min, max: _this.max, boundRange: _this.boundRange, part: part, step: part.type ? _this.steps[part.type] : 1, smoothScroll: smoothScroll, ref: function (el) { if (!el) {
|
|
232
232
|
return;
|
|
233
|
-
} _this.timeLists.push(el); }, id: idx, onFocus: function () { _this.handleListFocus(idx); }, onBlur: _this.handleListBlur, onChange: _this.handleChange, value: _this.value, disabled: disabled }))
|
|
233
|
+
} _this.timeLists.push(el); }, id: idx, onFocus: function () { _this.handleListFocus(idx); }, onBlur: _this.handleListBlur, onChange: _this.handleChange, value: _this.value, disabled: disabled, show: _this.props.show }))
|
|
234
234
|
: React.createElement("div", { key: idx, className: "k-time-separator" }, part.pattern));
|
|
235
235
|
}))));
|
|
236
236
|
};
|
|
@@ -281,7 +281,8 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
281
281
|
}),
|
|
282
282
|
smoothScroll: PropTypes.bool,
|
|
283
283
|
tabIndex: PropTypes.number,
|
|
284
|
-
value: PropTypes.instanceOf(Date)
|
|
284
|
+
value: PropTypes.instanceOf(Date),
|
|
285
|
+
show: PropTypes.bool
|
|
285
286
|
};
|
|
286
287
|
TimePart.defaultProps = {
|
|
287
288
|
value: null,
|
|
@@ -21,7 +21,7 @@ export interface TimePickerProps extends TimePickerSettings, FormComponentProps
|
|
|
21
21
|
/**
|
|
22
22
|
* Sets the default value of the TimePicker ([see example]({% slug default_value_timepicker %}#toc-setting-the-default-value)).
|
|
23
23
|
*/
|
|
24
|
-
defaultValue?: Date;
|
|
24
|
+
defaultValue?: Date | null;
|
|
25
25
|
/**
|
|
26
26
|
* Fires each time the user selects a new value ([see example]({% slug controlled_timepicker %}#toc-controlling-the-date-value)).
|
|
27
27
|
*/
|
|
@@ -41,7 +41,12 @@ export interface TimePickerState {
|
|
|
41
41
|
show: boolean;
|
|
42
42
|
focused: boolean;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
/** @hidden */
|
|
45
|
+
export declare class TimePickerWithoutContext extends React.Component<TimePickerProps, TimePickerState> implements FormComponent {
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
static displayName: string;
|
|
45
50
|
/**
|
|
46
51
|
* @hidden
|
|
47
52
|
*/
|
|
@@ -69,7 +74,7 @@ export declare class TimePicker extends React.Component<TimePickerProps, TimePic
|
|
|
69
74
|
second: PropTypes.Requireable<string>;
|
|
70
75
|
timeZoneName: PropTypes.Requireable<string>;
|
|
71
76
|
}>>;
|
|
72
|
-
formatPlaceholder: PropTypes.Requireable<
|
|
77
|
+
formatPlaceholder: PropTypes.Requireable<"narrow" | "short" | "wide" | "formatPattern" | PropTypes.InferProps<{
|
|
73
78
|
year: PropTypes.Requireable<string>;
|
|
74
79
|
month: PropTypes.Requireable<string>;
|
|
75
80
|
day: PropTypes.Requireable<string>;
|
|
@@ -119,7 +124,7 @@ export declare class TimePicker extends React.Component<TimePickerProps, TimePic
|
|
|
119
124
|
steps: {};
|
|
120
125
|
required: boolean;
|
|
121
126
|
validityStyles: boolean;
|
|
122
|
-
dateInput: React.ComponentType<DateInputProps<
|
|
127
|
+
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
123
128
|
};
|
|
124
129
|
/**
|
|
125
130
|
* @hidden
|
|
@@ -212,3 +217,52 @@ export declare class TimePicker extends React.Component<TimePickerProps, TimePic
|
|
|
212
217
|
private handleIconMouseDown;
|
|
213
218
|
private handleKeyDown;
|
|
214
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Represents the PropsContext of the `TimePicker` component.
|
|
222
|
+
* Used for global configuration of all `TimePicker` instances.
|
|
223
|
+
*
|
|
224
|
+
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
225
|
+
*/
|
|
226
|
+
export declare const TimePickerPropsContext: React.Context<(p: TimePickerProps) => TimePickerProps>;
|
|
227
|
+
/**
|
|
228
|
+
* Represent the `ref` of the TimePicker component.
|
|
229
|
+
*/
|
|
230
|
+
export interface TimePickerHandle extends Pick<TimePickerWithoutContext, keyof TimePickerWithoutContext> {
|
|
231
|
+
/**
|
|
232
|
+
* Gets the DateInput component inside the TimePicker component.
|
|
233
|
+
*/
|
|
234
|
+
dateInput: DateInput | null;
|
|
235
|
+
/**
|
|
236
|
+
* Returns the HTML element of the TimePicker component.
|
|
237
|
+
*/
|
|
238
|
+
element: HTMLSpanElement | null;
|
|
239
|
+
/**
|
|
240
|
+
* Gets the `name` property of the TimePicker.
|
|
241
|
+
*/
|
|
242
|
+
name: string | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Gets the popup state of the TimeSelector.
|
|
245
|
+
*/
|
|
246
|
+
show: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Represents the validity state into which the TimePicker is set.
|
|
249
|
+
*/
|
|
250
|
+
validity: FormComponentValidity;
|
|
251
|
+
/**
|
|
252
|
+
* Gets the value of the TimePicker.
|
|
253
|
+
*/
|
|
254
|
+
value: Date | null;
|
|
255
|
+
/**
|
|
256
|
+
* Gets the TimeSelector component inside the TimePicker component.
|
|
257
|
+
*/
|
|
258
|
+
timeSelector: TimeSelector | null;
|
|
259
|
+
}
|
|
260
|
+
/** @hidden */
|
|
261
|
+
export declare type TimePicker = TimePickerHandle;
|
|
262
|
+
/**
|
|
263
|
+
* Represents the KendoReact TimePicker Component.
|
|
264
|
+
*
|
|
265
|
+
* Accepts properties of type [TimePicker]({% slug api_dateinputs_timepickerprops %}).
|
|
266
|
+
* Obtaining the `ref` returns an object of type [TimePickerHandle]({% slug api_dateinputs_timepickerhandle %}).
|
|
267
|
+
*/
|
|
268
|
+
export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<any>>;
|