@progress/kendo-react-dateinputs 4.14.1-dev.202201181415 → 5.0.1-dev.202201200659
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/CalendarHeaderTitle.js +1 -1
- package/dist/es/calendar/components/MultiViewCalendar.js +2 -2
- package/dist/es/calendar/services/DOMService.js +1 -1
- package/dist/es/common/PickerWrap.d.ts +4 -2
- package/dist/es/common/PickerWrap.js +2 -1
- package/dist/es/dateinput/DateInput.d.ts +43 -0
- package/dist/es/dateinput/DateInput.js +26 -20
- package/dist/es/datepicker/DatePicker.d.ts +43 -1
- package/dist/es/datepicker/DatePicker.js +30 -21
- package/dist/es/datepicker/ToggleButton.d.ts +3 -13
- package/dist/es/datepicker/ToggleButton.js +2 -6
- package/dist/es/datepicker/models/DatePickerSettings.d.ts +1 -2
- package/dist/es/daterangepicker/DateRangePicker.d.ts +6 -1
- package/dist/es/daterangepicker/DateRangePicker.js +1 -1
- package/dist/es/datetimepicker/DateTimePicker.d.ts +43 -1
- package/dist/es/datetimepicker/DateTimePicker.js +34 -26
- package/dist/es/datetimepicker/DateTimeSelector.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimePart.js +1 -1
- package/dist/es/timepicker/TimePicker.d.ts +43 -7
- package/dist/es/timepicker/TimePicker.js +32 -35
- package/dist/es/timepicker/TimeSelector.js +1 -1
- package/dist/npm/calendar/components/CalendarHeaderTitle.js +1 -1
- package/dist/npm/calendar/components/MultiViewCalendar.js +2 -2
- package/dist/npm/calendar/services/DOMService.js +1 -1
- package/dist/npm/common/PickerWrap.d.ts +4 -2
- package/dist/npm/common/PickerWrap.js +2 -1
- package/dist/npm/dateinput/DateInput.d.ts +43 -0
- package/dist/npm/dateinput/DateInput.js +25 -19
- package/dist/npm/datepicker/DatePicker.d.ts +43 -1
- package/dist/npm/datepicker/DatePicker.js +30 -21
- package/dist/npm/datepicker/ToggleButton.d.ts +3 -13
- package/dist/npm/datepicker/ToggleButton.js +2 -6
- package/dist/npm/datepicker/models/DatePickerSettings.d.ts +1 -2
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +6 -1
- package/dist/npm/daterangepicker/DateRangePicker.js +1 -1
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +43 -1
- package/dist/npm/datetimepicker/DateTimePicker.js +33 -25
- package/dist/npm/datetimepicker/DateTimeSelector.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimePart.js +1 -1
- package/dist/npm/timepicker/TimePicker.d.ts +43 -7
- package/dist/npm/timepicker/TimePicker.js +31 -34
- package/dist/npm/timepicker/TimeSelector.js +1 -1
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -50,7 +50,7 @@ var CalendarHeaderTitle = /** @class */ (function (_super) {
|
|
|
50
50
|
*/
|
|
51
51
|
CalendarHeaderTitle.prototype.render = function () {
|
|
52
52
|
var _a = this.props, view = _a.view, props = __rest(_a, ["view"]);
|
|
53
|
-
return (React.createElement(Button, __assign({ type: "button",
|
|
53
|
+
return (React.createElement(Button, __assign({ type: "button", fillMode: "flat" }, props), this.props.children));
|
|
54
54
|
};
|
|
55
55
|
return CalendarHeaderTitle;
|
|
56
56
|
}(React.PureComponent));
|
|
@@ -457,9 +457,9 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
457
457
|
var activeDate = cloneDate(this.dates && this.dates[0] ? this.dates[0] : getToday());
|
|
458
458
|
return (React.createElement("div", __assign({ ref: function (el) { _this._element = el; }, className: wrapperClassName, id: this.props.id || this.wrapperID, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, role: 'grid', tabIndex: !this.props.disabled ? this.props.tabIndex : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, onClick: this.handleClick, onKeyDown: this.handleKeyDown }, wrapperAria),
|
|
459
459
|
React.createElement(Header, { key: ".kendo.calendar.header." + activeDate.getTime(), activeView: activeView, currentDate: activeDate, min: this.min, max: this.max, rangeLength: this.props.views, bus: this.bus, service: this.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,
|
|
460
|
-
React.createElement(Button, __assign({ type: "button", className: "k-nav-prev", icon: "arrow-chevron-left",
|
|
460
|
+
React.createElement(Button, __assign({ type: "button", className: "k-nav-prev", icon: "arrow-chevron-left", fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
|
|
461
461
|
React.createElement(TodayCommand, { min: this.min, max: this.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange }),
|
|
462
|
-
React.createElement(Button, __assign({ type: "button", className: "k-nav-next", icon: "arrow-chevron-right",
|
|
462
|
+
React.createElement(Button, __assign({ type: "button", className: "k-nav-next", icon: "arrow-chevron-right", fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
|
|
463
463
|
React.createElement(HorizontalViewList, { ref: function (el) { _this.calendarViewList = el; }, dates: this.dates, activeView: activeView, focusedDate: this.focusedDate, min: this.min, max: this.max, bus: this.bus, service: this.service, selectionRange: visualizedRange, value: this.selectedMultiple || this.selectedDate, cellUID: this.cellUID, views: this.props.views, onChange: this.handleDateChange, showWeekNumbers: this.props.weekNumber, onCellEnter: this.handleCellEnter, cell: this.props.cell, weekCell: this.props.weekCell, headerTitle: this.props.headerTitle })));
|
|
464
464
|
};
|
|
465
465
|
/**
|
|
@@ -28,7 +28,7 @@ var DOMService = /** @class */ (function () {
|
|
|
28
28
|
var tbody = containerFactory('tbody');
|
|
29
29
|
var thead = containerFactory('thead');
|
|
30
30
|
var table = containerFactory('table');
|
|
31
|
-
var monthHeader = function () { return (div("\n
|
|
31
|
+
var monthHeader = function () { return (div("\n <span class=\"k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title\">\n <span className=\"k-button-text\">March 2017</span>\n </span>\n <span class=\"k-spacer\"></span>\n <span class=\"k-calendar-nav k-hstack\"><span class=\"k-nav-today\">TODAY</span></span>\n ", 'k-calendar-header k-hstack')); };
|
|
32
32
|
var monthWeekHeader = function () { return (table([
|
|
33
33
|
thead([
|
|
34
34
|
tr([th('MO', 'k-calendar-th')], 'k-calendar-tr')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* @hidden
|
|
4
|
+
* @deprecated
|
|
4
5
|
*/
|
|
5
6
|
export interface PickerWrapProps {
|
|
6
7
|
_ref?: React.Ref<HTMLSpanElement | null>;
|
|
@@ -11,6 +12,7 @@ export interface PickerWrapProps {
|
|
|
11
12
|
style?: React.CSSProperties;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* @hidden
|
|
16
|
+
* @deprecated
|
|
15
17
|
*/
|
|
16
18
|
export declare const PickerWrap: React.ForwardRefExoticComponent<PickerWrapProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { classNames } from '@progress/kendo-react-common';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* @hidden
|
|
5
|
+
* @deprecated
|
|
5
6
|
*/
|
|
6
7
|
export var PickerWrap = React.forwardRef(function (props, ref) {
|
|
7
8
|
var _ref = props._ref;
|
|
@@ -42,6 +42,43 @@ export interface DateInputProps<T extends DateInput = any> extends FormComponent
|
|
|
42
42
|
* Determines the event handler that will be fired when the user edits the value ([see example]({% slug dateranges_dateinput %})).
|
|
43
43
|
*/
|
|
44
44
|
onChange?: (event: DateInputChangeEvent<T>) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Configures the `size` of the DateInput.
|
|
47
|
+
*
|
|
48
|
+
* The available options are:
|
|
49
|
+
* - small
|
|
50
|
+
* - medium
|
|
51
|
+
* - large
|
|
52
|
+
* - null—Does not set a size `className`.
|
|
53
|
+
*
|
|
54
|
+
* @default `medium`
|
|
55
|
+
*/
|
|
56
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
57
|
+
/**
|
|
58
|
+
* Configures the `roundness` of the DateInput.
|
|
59
|
+
*
|
|
60
|
+
* The available options are:
|
|
61
|
+
* - small
|
|
62
|
+
* - medium
|
|
63
|
+
* - large
|
|
64
|
+
* - full
|
|
65
|
+
* - null—Does not set a rounded `className`.
|
|
66
|
+
*
|
|
67
|
+
* @default `medium`
|
|
68
|
+
*/
|
|
69
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
70
|
+
/**
|
|
71
|
+
* Configures the `fillMode` of the DateInput.
|
|
72
|
+
*
|
|
73
|
+
* The available options are:
|
|
74
|
+
* - solid
|
|
75
|
+
* - outline
|
|
76
|
+
* - flat
|
|
77
|
+
* - null—Does not set a fillMode `className`.
|
|
78
|
+
*
|
|
79
|
+
* @default `solid`
|
|
80
|
+
*/
|
|
81
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
45
82
|
}
|
|
46
83
|
/** @hidden */
|
|
47
84
|
export declare class DateInputWithoutContext extends React.Component<DateInputProps, {
|
|
@@ -108,12 +145,18 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
108
145
|
required: PropTypes.Requireable<boolean>;
|
|
109
146
|
validate: PropTypes.Requireable<boolean>;
|
|
110
147
|
valid: PropTypes.Requireable<boolean>;
|
|
148
|
+
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
149
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full">;
|
|
150
|
+
fillMode: PropTypes.Requireable<"solid" | "flat" | "outline">;
|
|
111
151
|
};
|
|
112
152
|
/**
|
|
113
153
|
* @hidden
|
|
114
154
|
*/
|
|
115
155
|
static defaultProps: {
|
|
116
156
|
format: string;
|
|
157
|
+
size: "small" | "medium" | "large";
|
|
158
|
+
rounded: "small" | "medium" | "large" | "full";
|
|
159
|
+
fillMode: "solid" | "flat" | "outline";
|
|
117
160
|
formatPlaceholder: DateInputFormatPlaceholder;
|
|
118
161
|
spinners: boolean;
|
|
119
162
|
disabled: boolean;
|
|
@@ -25,9 +25,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
import * as React from 'react';
|
|
26
26
|
import * as PropTypes from 'prop-types';
|
|
27
27
|
import { isEqual, cloneDate } from '@progress/kendo-date-math';
|
|
28
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
28
29
|
import { registerForIntl, provideIntlService, registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
29
30
|
import { KendoDate } from './models';
|
|
30
|
-
import { guid, AsyncFocusBlur, noop, classNames, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
|
|
31
|
+
import { guid, AsyncFocusBlur, noop, classNames, createPropsContext, withPropsContext, kendoThemeMaps } from '@progress/kendo-react-common';
|
|
31
32
|
import { FloatingLabel } from '@progress/kendo-react-labels';
|
|
32
33
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
33
34
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -232,6 +233,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
232
233
|
*/
|
|
233
234
|
DateInputWithoutContext.prototype.render = function () {
|
|
234
235
|
var _this = this;
|
|
236
|
+
var _a = this.props, _b = _a.size, size = _b === void 0 ? DateInputWithoutContext.defaultProps.size : _b, _c = _a.fillMode, fillMode = _c === void 0 ? DateInputWithoutContext.defaultProps.fillMode : _c, _d = _a.rounded, rounded = _d === void 0 ? DateInputWithoutContext.defaultProps.rounded : _d;
|
|
235
237
|
if (this.props._ref) {
|
|
236
238
|
this.props._ref.current = this;
|
|
237
239
|
}
|
|
@@ -257,25 +259,23 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
257
259
|
}
|
|
258
260
|
var dateinput = (React.createElement(AsyncFocusBlur, { onFocus: this.elementOnFocus, onBlur: this.elementOnBlur }, function (_a) {
|
|
259
261
|
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
260
|
-
|
|
262
|
+
var _b;
|
|
263
|
+
return (React.createElement("span", { ref: function (span) { _this._wrapper = span; }, style: !label
|
|
261
264
|
? { width: _this.props.width }
|
|
262
|
-
: undefined, dir: _this.props.dir, className:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
_this.
|
|
269
|
-
_this.props.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
.toLanguageString(decreaseValue, messages[decreaseValue]), title: localizationService
|
|
277
|
-
.toLanguageString(decreaseValue, messages[decreaseValue]), onClick: _this.decreasePart },
|
|
278
|
-
React.createElement("span", { className: "k-icon k-i-arrow-s" }))))));
|
|
265
|
+
: undefined, dir: _this.props.dir, className: classNames('k-dateinput', 'k-input', (_b = {},
|
|
266
|
+
_b["k-input-" + (kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
267
|
+
_b["k-input-" + fillMode] = fillMode,
|
|
268
|
+
_b["k-rounded-" + (kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
269
|
+
_b['k-valid'] = isValid,
|
|
270
|
+
_b['k-invalid'] = !isValid,
|
|
271
|
+
_b['k-required'] = _this.required,
|
|
272
|
+
_b['k-disabled'] = _this.props.disabled,
|
|
273
|
+
_b), _this.props.className), onFocus: onFocus, onBlur: onBlur },
|
|
274
|
+
React.createElement("input", __assign({ role: "spinbutton", tabIndex: _this.props.tabIndex, disabled: _this.props.disabled, title: _this.props.title !== undefined ? _this.props.title : currentText, type: "text", spellCheck: false, autoComplete: "off", autoCorrect: "off", className: "k-input-inner", id: inputId, "aria-labelledby": _this.props.ariaLabelledBy, "aria-describedby": _this.props.ariaDescribedBy, "aria-expanded": _this.props.ariaExpanded, "aria-haspopup": _this.props.ariaHasPopup, onWheel: _this.wheel, onClick: _this.elementClick, onInput: _this.elementChange, onPaste: _this.handlePaste, onKeyDown: _this.elementKeyDown, onChange: noop, value: text, placeholder: placeholder, name: name }, ariaProps, { ref: function (input) { return _this._element = input; } })),
|
|
275
|
+
_this.props.children,
|
|
276
|
+
_this.props.spinners && (React.createElement("span", { className: "k-input-spinner k-spin-button", onMouseDown: _this.spinnersMouseDown },
|
|
277
|
+
React.createElement(Button, { type: "button", className: "k-spinner-increase", icon: 'arrow-n', "aria-label": localizationService.toLanguageString(increaseValue, messages[increaseValue]), title: localizationService.toLanguageString(increaseValue, messages[increaseValue]), onClick: _this.increasePart }),
|
|
278
|
+
React.createElement(Button, { type: "button", className: "k-spinner-decrease", icon: 'arrow-s', "aria-label": localizationService.toLanguageString(decreaseValue, messages[decreaseValue]), title: localizationService.toLanguageString(decreaseValue, messages[decreaseValue]), onClick: _this.decreasePart })))));
|
|
279
279
|
}));
|
|
280
280
|
return label
|
|
281
281
|
? (React.createElement(FloatingLabel, { label: label, editorId: inputId, editorValue: currentText, editorValid: isValid, editorDisabled: this.props.disabled, children: dateinput, style: { width: this.props.width } }))
|
|
@@ -634,13 +634,19 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
634
634
|
validationMessage: PropTypes.string,
|
|
635
635
|
required: PropTypes.bool,
|
|
636
636
|
validate: PropTypes.bool,
|
|
637
|
-
valid: PropTypes.bool
|
|
637
|
+
valid: PropTypes.bool,
|
|
638
|
+
size: PropTypes.oneOf([null, 'small', 'medium', 'large']),
|
|
639
|
+
rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),
|
|
640
|
+
fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])
|
|
638
641
|
};
|
|
639
642
|
/**
|
|
640
643
|
* @hidden
|
|
641
644
|
*/
|
|
642
645
|
DateInputWithoutContext.defaultProps = {
|
|
643
646
|
format: defaultFormat,
|
|
647
|
+
size: 'medium',
|
|
648
|
+
rounded: 'medium',
|
|
649
|
+
fillMode: 'solid',
|
|
644
650
|
formatPlaceholder: defaultFormatPlaceholder,
|
|
645
651
|
// defaultValue: null as Date | null,
|
|
646
652
|
spinners: false,
|
|
@@ -35,6 +35,43 @@ export interface DatePickerProps extends DatePickerSettings, FormComponentProps
|
|
|
35
35
|
* > The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
|
|
36
36
|
*/
|
|
37
37
|
value?: Date | null;
|
|
38
|
+
/**
|
|
39
|
+
* Configures the `size` of the DatePicker.
|
|
40
|
+
*
|
|
41
|
+
* The available options are:
|
|
42
|
+
* - small
|
|
43
|
+
* - medium
|
|
44
|
+
* - large
|
|
45
|
+
* - null—Does not set a size `className`.
|
|
46
|
+
*
|
|
47
|
+
* @default `medium`
|
|
48
|
+
*/
|
|
49
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
50
|
+
/**
|
|
51
|
+
* Configures the `roundness` of the DatePicker.
|
|
52
|
+
*
|
|
53
|
+
* The available options are:
|
|
54
|
+
* - small
|
|
55
|
+
* - medium
|
|
56
|
+
* - large
|
|
57
|
+
* - full
|
|
58
|
+
* - null—Does not set a rounded `className`.
|
|
59
|
+
*
|
|
60
|
+
* @default `medium`
|
|
61
|
+
*/
|
|
62
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
63
|
+
/**
|
|
64
|
+
* Configures the `fillMode` of the DatePicker.
|
|
65
|
+
*
|
|
66
|
+
* The available options are:
|
|
67
|
+
* - solid
|
|
68
|
+
* - outline
|
|
69
|
+
* - flat
|
|
70
|
+
* - null—Does not set a fillMode `className`.
|
|
71
|
+
*
|
|
72
|
+
* @default `solid`
|
|
73
|
+
*/
|
|
74
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
38
75
|
}
|
|
39
76
|
/**
|
|
40
77
|
* @hidden
|
|
@@ -105,6 +142,9 @@ export declare class DatePickerWithoutContext extends React.Component<DatePicker
|
|
|
105
142
|
required: PropTypes.Requireable<boolean>;
|
|
106
143
|
validate: PropTypes.Requireable<boolean>;
|
|
107
144
|
valid: PropTypes.Requireable<boolean>;
|
|
145
|
+
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
146
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full">;
|
|
147
|
+
fillMode: PropTypes.Requireable<"solid" | "flat" | "outline">;
|
|
108
148
|
};
|
|
109
149
|
/**
|
|
110
150
|
* @hidden
|
|
@@ -126,6 +166,9 @@ export declare class DatePickerWithoutContext extends React.Component<DatePicker
|
|
|
126
166
|
weekNumber: boolean;
|
|
127
167
|
required: boolean;
|
|
128
168
|
validityStyles: boolean;
|
|
169
|
+
size: "small" | "medium" | "large";
|
|
170
|
+
rounded: "small" | "medium" | "large" | "full";
|
|
171
|
+
fillMode: "solid" | "flat" | "outline";
|
|
129
172
|
};
|
|
130
173
|
/**
|
|
131
174
|
* @hidden
|
|
@@ -133,7 +176,6 @@ export declare class DatePickerWithoutContext extends React.Component<DatePicker
|
|
|
133
176
|
readonly state: DatePickerState;
|
|
134
177
|
private _popupId;
|
|
135
178
|
private _element;
|
|
136
|
-
private _wrapper;
|
|
137
179
|
private _dateInput;
|
|
138
180
|
private _calendar;
|
|
139
181
|
private valueDuringOnChange?;
|
|
@@ -35,8 +35,7 @@ import * as React from 'react';
|
|
|
35
35
|
import * as PropTypes from 'prop-types';
|
|
36
36
|
import { Popup } from '@progress/kendo-react-popup';
|
|
37
37
|
import { getDate, cloneDate } from '@progress/kendo-date-math';
|
|
38
|
-
import { classNames, guid, Keys, AsyncFocusBlur, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
|
|
39
|
-
import { validatePackage } from '@progress/kendo-react-common';
|
|
38
|
+
import { classNames, guid, Keys, AsyncFocusBlur, createPropsContext, withPropsContext, validatePackage, kendoThemeMaps } from '@progress/kendo-react-common';
|
|
40
39
|
import { packageMetadata } from '../package-metadata';
|
|
41
40
|
import { DateInput } from '../dateinput/DateInput';
|
|
42
41
|
import { Calendar } from '../calendar/components/Calendar';
|
|
@@ -54,7 +53,6 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
54
53
|
var _this = _super.call(this, props) || this;
|
|
55
54
|
_this._popupId = guid();
|
|
56
55
|
_this._element = null;
|
|
57
|
-
_this._wrapper = null;
|
|
58
56
|
_this._dateInput = React.createRef();
|
|
59
57
|
_this._calendar = null;
|
|
60
58
|
_this.shouldFocusDateInput = false;
|
|
@@ -348,18 +346,12 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
348
346
|
*/
|
|
349
347
|
DatePickerWithoutContext.prototype.render = function () {
|
|
350
348
|
var _this = this;
|
|
351
|
-
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;
|
|
352
|
-
var
|
|
349
|
+
var _a = this.props, _b = _a.size, size = _b === void 0 ? DatePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DatePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DatePickerWithoutContext.defaultProps.fillMode : _d, 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;
|
|
350
|
+
var _e = this.props.popupSettings, popupClass = _e.popupClass, otherPopupSettings = __rest(_e, ["popupClass"]);
|
|
353
351
|
var show = this.show;
|
|
354
352
|
var value = this.value;
|
|
355
353
|
var sanitizedValue = value && getDate(value);
|
|
356
354
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
357
|
-
var rootClassName = classNames('k-widget k-datepicker', className);
|
|
358
|
-
var wrapperClassNames = classNames('k-picker-wrap', {
|
|
359
|
-
'k-state-invalid': !isValid,
|
|
360
|
-
'k-state-disabled': disabled,
|
|
361
|
-
'k-state-focused': this.state.focused
|
|
362
|
-
});
|
|
363
355
|
var popupClassNames = classNames('k-calendar-container k-group k-reset', popupClass);
|
|
364
356
|
var dateInputProps = {
|
|
365
357
|
disabled: disabled,
|
|
@@ -382,9 +374,12 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
382
374
|
label: undefined,
|
|
383
375
|
placeholder: !this.state.focused ? this.props.placeholder : null,
|
|
384
376
|
ariaHasPopup: true,
|
|
385
|
-
ariaExpanded: this.show
|
|
377
|
+
ariaExpanded: this.show,
|
|
378
|
+
size: null,
|
|
379
|
+
fillMode: null,
|
|
380
|
+
rounded: null
|
|
386
381
|
};
|
|
387
|
-
var popupProps = __assign({ show: show, anchor: this.
|
|
382
|
+
var popupProps = __assign({ show: show, anchor: this._element, className: popupClassNames, id: this._popupId, anchorAlign: {
|
|
388
383
|
horizontal: 'left',
|
|
389
384
|
vertical: 'bottom'
|
|
390
385
|
}, popupAlign: {
|
|
@@ -400,14 +395,22 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
400
395
|
focusedDate: focusedDate,
|
|
401
396
|
onChange: this.handleCalendarValueChange
|
|
402
397
|
};
|
|
398
|
+
var toggleButtonTitle = provideLocalizationService(this)
|
|
399
|
+
.toLanguageString(toggleCalendar, messages[toggleCalendar]);
|
|
403
400
|
var datepicker = (React.createElement(AsyncFocusBlur, { onFocus: this.handleFocus, onBlur: this.handleBlur, onSyncBlur: this.props.onBlur, onSyncFocus: this.props.onFocus }, function (_a) {
|
|
404
401
|
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
402
|
+
var _b;
|
|
403
|
+
return (React.createElement("span", { role: "group", "aria-expanded": _this.show, ref: function (span) { _this._element = span; }, className: classNames('k-input', 'k-datepicker', (_b = {},
|
|
404
|
+
_b["k-input-" + (kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
405
|
+
_b["k-rounded-" + (kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
406
|
+
_b["k-input-" + fillMode] = fillMode,
|
|
407
|
+
_b['k-valid'] = isValid,
|
|
408
|
+
_b['k-invalid'] = !isValid,
|
|
409
|
+
_b['k-required'] = _this.required,
|
|
410
|
+
_b['k-disabled'] = _this.props.disabled,
|
|
411
|
+
_b), className), onKeyDown: _this.handleKeyDown, style: { width: width }, onFocus: onFocus, onBlur: onBlur },
|
|
412
|
+
React.createElement(_this.dateInputComp, __assign({ _ref: _this._dateInput }, dateInputProps)),
|
|
413
|
+
React.createElement(_this.toggleButtonComp, { type: "button", icon: "calendar", title: toggleButtonTitle, className: "k-input-button", onClick: _this.handleIconClick, "aria-label": toggleButtonTitle, onMouseDown: _this.handleIconMouseDown }),
|
|
411
414
|
React.createElement(_this.popupComp, __assign({}, popupProps),
|
|
412
415
|
React.createElement(_this.calendarComp, __assign({ _ref: _this.setCalendarRef }, calendarProps)))));
|
|
413
416
|
}));
|
|
@@ -495,7 +498,10 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
495
498
|
validationMessage: PropTypes.string,
|
|
496
499
|
required: PropTypes.bool,
|
|
497
500
|
validate: PropTypes.bool,
|
|
498
|
-
valid: PropTypes.bool
|
|
501
|
+
valid: PropTypes.bool,
|
|
502
|
+
size: PropTypes.oneOf([null, 'small', 'medium', 'large']),
|
|
503
|
+
rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),
|
|
504
|
+
fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])
|
|
499
505
|
};
|
|
500
506
|
/**
|
|
501
507
|
* @hidden
|
|
@@ -516,7 +522,10 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
516
522
|
tabIndex: 0,
|
|
517
523
|
weekNumber: false,
|
|
518
524
|
required: false,
|
|
519
|
-
validityStyles: true
|
|
525
|
+
validityStyles: true,
|
|
526
|
+
size: 'medium',
|
|
527
|
+
rounded: 'medium',
|
|
528
|
+
fillMode: 'solid'
|
|
520
529
|
};
|
|
521
530
|
return DatePickerWithoutContext;
|
|
522
531
|
}(React.Component));
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Button, ButtonProps } from '@progress/kendo-react-buttons';
|
|
2
2
|
/**
|
|
3
3
|
* Represents the props of the KendoReact [Toggle Button]({% slug api_dateinputs_togglebutton %}) component.
|
|
4
4
|
*/
|
|
5
|
-
export interface ToggleButtonProps {
|
|
6
|
-
id?: string;
|
|
7
|
-
tabIndex?: number;
|
|
8
|
-
className?: string;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
style?: React.CSSProperties;
|
|
11
|
-
title?: string;
|
|
12
|
-
onClick?: (event: React.MouseEvent) => void;
|
|
13
|
-
onMouseDown?: (event: React.MouseEvent) => void;
|
|
14
|
-
onMouseUp?: (event: React.MouseEvent) => void;
|
|
15
|
-
[wildcard: string]: any;
|
|
5
|
+
export interface ToggleButtonProps extends ButtonProps {
|
|
16
6
|
}
|
|
17
7
|
/**
|
|
18
8
|
* Represents the default `toggleButton` component rendered by the [KendoReact Scheduler DatePicker]({% slug overview_datepicker %}).
|
|
19
9
|
*/
|
|
20
|
-
export declare const ToggleButton:
|
|
10
|
+
export declare const ToggleButton: typeof Button;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { classNames } from '@progress/kendo-react-common';
|
|
1
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
2
|
/**
|
|
4
3
|
* Represents the default `toggleButton` component rendered by the [KendoReact Scheduler DatePicker]({% slug overview_datepicker %}).
|
|
5
4
|
*/
|
|
6
|
-
export var ToggleButton =
|
|
7
|
-
var className = classNames('k-select', props.className);
|
|
8
|
-
return (React.createElement("a", { ref: ref, id: props.id, role: "button", style: props.style, className: className, tabIndex: props.tabIndex, title: props.title, "aria-label": props.title, onMouseDown: props.onMouseDown, onClick: props.onClick, onMouseUp: props.onMouseUp }, props.children));
|
|
9
|
-
});
|
|
5
|
+
export var ToggleButton = Button;
|
|
@@ -12,8 +12,7 @@ import { PickerWrapProps } from '../../common/PickerWrap';
|
|
|
12
12
|
*/
|
|
13
13
|
export interface DatePickerSettings {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* ([see example]({% slug custom_rendering_datepicker %}#toc-customizing-the-toggle-button)).
|
|
15
|
+
* @deprecated The `DatePicker` no longer renders a `wrapper` around the DatePicker.
|
|
17
16
|
*/
|
|
18
17
|
pickerWrap?: React.ComponentType<PickerWrapProps>;
|
|
19
18
|
/**
|
|
@@ -93,7 +93,9 @@ export declare class DateRangePickerWithoutContext extends React.Component<DateR
|
|
|
93
93
|
year: PropTypes.Requireable<string>;
|
|
94
94
|
month: PropTypes.Requireable<string>;
|
|
95
95
|
day: PropTypes.Requireable<string>;
|
|
96
|
-
hour: PropTypes.Requireable<string>;
|
|
96
|
+
hour: PropTypes.Requireable<string>; /**
|
|
97
|
+
* @hidden
|
|
98
|
+
*/
|
|
97
99
|
minute: PropTypes.Requireable<string>;
|
|
98
100
|
second: PropTypes.Requireable<string>;
|
|
99
101
|
}>>;
|
|
@@ -124,6 +126,9 @@ export declare class DateRangePickerWithoutContext extends React.Component<DateR
|
|
|
124
126
|
required: PropTypes.Requireable<boolean>;
|
|
125
127
|
validate: PropTypes.Requireable<boolean>;
|
|
126
128
|
valid: PropTypes.Requireable<boolean>;
|
|
129
|
+
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
130
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full">;
|
|
131
|
+
fillMode: PropTypes.Requireable<"solid" | "flat" | "outline">;
|
|
127
132
|
}>>;
|
|
128
133
|
focusedDate: PropTypes.Requireable<Date>;
|
|
129
134
|
format: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
@@ -347,7 +347,7 @@ var DateRangePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
347
347
|
var calendar = this.props.calendar
|
|
348
348
|
? React.createElement(this.props.calendar, __assign({}, calendarProps))
|
|
349
349
|
: React.createElement(MultiViewCalendar, __assign({}, calendarProps, { ref: this.setCalendarRef }));
|
|
350
|
-
var reverseButton = (React.createElement(Button, __assign({ className: "k-select",
|
|
350
|
+
var reverseButton = (React.createElement(Button, __assign({ className: "k-select", fillMode: "flat", title: provideLocalizationService(this)
|
|
351
351
|
.toLanguageString(swapStartEnd, messages[swapStartEnd]), onMouseDown: this.handleReverseMouseDown, onClick: this.handleReverseClick }, {
|
|
352
352
|
'aria-controls': startDateInputId + ' ' + endDateInputId,
|
|
353
353
|
'aria-label': provideLocalizationService(this)
|
|
@@ -37,6 +37,43 @@ export interface DateTimePickerProps extends DateTimePickerSettings, FormCompone
|
|
|
37
37
|
* [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
|
|
38
38
|
*/
|
|
39
39
|
value?: Date | null;
|
|
40
|
+
/**
|
|
41
|
+
* Configures the `size` of the DateTimePicker.
|
|
42
|
+
*
|
|
43
|
+
* The available options are:
|
|
44
|
+
* - small
|
|
45
|
+
* - medium
|
|
46
|
+
* - large
|
|
47
|
+
* - null—Does not set a size `className`.
|
|
48
|
+
*
|
|
49
|
+
* @default `medium`
|
|
50
|
+
*/
|
|
51
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
52
|
+
/**
|
|
53
|
+
* Configures the `roundness` of the DateTimePicker.
|
|
54
|
+
*
|
|
55
|
+
* The available options are:
|
|
56
|
+
* - small
|
|
57
|
+
* - medium
|
|
58
|
+
* - large
|
|
59
|
+
* - full
|
|
60
|
+
* - null—Does not set a rounded `className`.
|
|
61
|
+
*
|
|
62
|
+
* @default `medium`
|
|
63
|
+
*/
|
|
64
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
65
|
+
/**
|
|
66
|
+
* Configures the `fillMode` of the DateTimePicker.
|
|
67
|
+
*
|
|
68
|
+
* The available options are:
|
|
69
|
+
* - solid
|
|
70
|
+
* - outline
|
|
71
|
+
* - flat
|
|
72
|
+
* - null—Does not set a fillMode `className`.
|
|
73
|
+
*
|
|
74
|
+
* @default `solid`
|
|
75
|
+
*/
|
|
76
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
40
77
|
}
|
|
41
78
|
/**
|
|
42
79
|
* @hidden
|
|
@@ -108,6 +145,9 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
108
145
|
validate: PropTypes.Requireable<boolean>;
|
|
109
146
|
valid: PropTypes.Requireable<boolean>;
|
|
110
147
|
cancelButton: PropTypes.Requireable<boolean>;
|
|
148
|
+
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
149
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full">;
|
|
150
|
+
fillMode: PropTypes.Requireable<"solid" | "flat" | "outline">;
|
|
111
151
|
};
|
|
112
152
|
/**
|
|
113
153
|
* @hidden
|
|
@@ -126,6 +166,9 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
126
166
|
validityStyles: boolean;
|
|
127
167
|
cancelButton: boolean;
|
|
128
168
|
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
169
|
+
size: "small" | "medium" | "large";
|
|
170
|
+
rounded: "small" | "medium" | "large" | "full";
|
|
171
|
+
fillMode: "solid" | "flat" | "outline";
|
|
129
172
|
};
|
|
130
173
|
/**
|
|
131
174
|
* @hidden
|
|
@@ -133,7 +176,6 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
133
176
|
readonly state: DateTimePickerState;
|
|
134
177
|
private _popupId;
|
|
135
178
|
private _element;
|
|
136
|
-
private _wrapper;
|
|
137
179
|
private _dateInput;
|
|
138
180
|
private _dateTimeSelector;
|
|
139
181
|
private valueDuringOnChange?;
|