@progress/kendo-react-dateinputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823
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 +4 -4
- package/dist/es/calendar/components/Calendar.js +17 -5
- package/dist/es/calendar/components/Header.d.ts +1 -0
- package/dist/es/calendar/components/Header.js +1 -1
- package/dist/es/calendar/components/HorizontalViewList.js +1 -0
- package/dist/es/calendar/components/MultiViewCalendar.d.ts +3 -3
- package/dist/es/calendar/components/MultiViewCalendar.js +12 -5
- package/dist/es/calendar/components/Navigation.d.ts +1 -1
- package/dist/es/calendar/components/Navigation.js +9 -4
- package/dist/es/calendar/components/TodayCommand.js +4 -2
- package/dist/es/calendar/components/View.d.ts +4 -4
- package/dist/es/calendar/components/View.js +7 -5
- package/dist/es/calendar/components/ViewList.d.ts +3 -3
- package/dist/es/calendar/components/ViewList.js +10 -2
- package/dist/es/calendar/services/BusViewService.js +1 -1
- package/dist/es/calendar/services/CenturyViewService.js +2 -2
- package/dist/es/calendar/services/DOMService.js +24 -6
- package/dist/es/calendar/services/DecadeViewService.js +2 -2
- package/dist/es/calendar/services/MonthViewService.js +2 -2
- package/dist/es/calendar/services/NavigationService.js +1 -1
- package/dist/es/calendar/services/ScrollSyncService.js +5 -1
- package/dist/es/calendar/services/YearViewService.js +2 -2
- package/dist/es/calendar/utils/ScrollSync.d.ts +3 -3
- package/dist/es/calendar/utils/ScrollSync.js +2 -0
- package/dist/es/dateinput/DateInput.d.ts +11 -7
- package/dist/es/dateinput/DateInput.js +14 -8
- package/dist/es/dateinput/models/kendo-date.js +1 -1
- package/dist/es/dateinput/models/mask.js +1 -0
- package/dist/es/dateinput/utils.d.ts +1 -1
- package/dist/es/datepicker/DatePicker.d.ts +8 -8
- package/dist/es/datepicker/DatePicker.js +4 -3
- package/dist/es/daterangepicker/DateRangePicker.d.ts +7 -5
- package/dist/es/datetimepicker/DateTimePicker.d.ts +7 -7
- package/dist/es/datetimepicker/DateTimePicker.js +3 -3
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +1 -1
- package/dist/es/datetimepicker/DateTimeSelector.js +5 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.d.ts +3 -3
- package/dist/es/timepicker/TimeList.js +25 -7
- package/dist/es/timepicker/TimePart.d.ts +4 -4
- package/dist/es/timepicker/TimePart.js +4 -1
- package/dist/es/timepicker/TimePicker.d.ts +8 -8
- package/dist/es/timepicker/TimePicker.js +4 -3
- package/dist/es/timepicker/TimeSelector.d.ts +2 -2
- package/dist/es/timepicker/TimeSelector.js +4 -0
- package/dist/es/timepicker/services/DOMService.js +2 -0
- package/dist/es/timepicker/services/DayPeriodService.js +9 -3
- package/dist/es/timepicker/services/HoursService.js +14 -5
- package/dist/es/timepicker/services/MinutesService.js +12 -6
- package/dist/es/timepicker/services/SecondsService.js +12 -6
- package/dist/es/utils.js +9 -5
- package/dist/es/virtualization/Virtualization.d.ts +2 -1
- package/dist/es/virtualization/Virtualization.js +14 -6
- package/dist/es/virtualization/services/RowHeightService.js +9 -5
- package/dist/es/virtualization/services/ScrollerService.js +9 -3
- package/dist/npm/calendar/components/Calendar.d.ts +4 -4
- package/dist/npm/calendar/components/Calendar.js +43 -31
- package/dist/npm/calendar/components/CalendarCell.js +1 -1
- package/dist/npm/calendar/components/CalendarNavigationItem.js +1 -1
- package/dist/npm/calendar/components/CalendarWeekCell.js +1 -1
- package/dist/npm/calendar/components/Header.d.ts +1 -0
- package/dist/npm/calendar/components/Header.js +3 -3
- package/dist/npm/calendar/components/HorizontalViewList.js +3 -2
- package/dist/npm/calendar/components/MultiViewCalendar.d.ts +3 -3
- package/dist/npm/calendar/components/MultiViewCalendar.js +49 -42
- package/dist/npm/calendar/components/Navigation.d.ts +1 -1
- package/dist/npm/calendar/components/Navigation.js +13 -8
- package/dist/npm/calendar/components/TodayCommand.js +9 -7
- package/dist/npm/calendar/components/View.d.ts +4 -4
- package/dist/npm/calendar/components/View.js +16 -14
- package/dist/npm/calendar/components/ViewList.d.ts +3 -3
- package/dist/npm/calendar/components/ViewList.js +19 -11
- package/dist/npm/calendar/services/BusViewService.js +1 -1
- package/dist/npm/calendar/services/CenturyViewService.js +38 -38
- package/dist/npm/calendar/services/DOMService.js +33 -15
- package/dist/npm/calendar/services/DecadeViewService.js +32 -32
- package/dist/npm/calendar/services/MonthViewService.js +36 -36
- package/dist/npm/calendar/services/NavigationService.js +1 -1
- package/dist/npm/calendar/services/ScrollSyncService.js +5 -1
- package/dist/npm/calendar/services/WeekNamesService.js +1 -1
- package/dist/npm/calendar/services/YearViewService.js +33 -33
- package/dist/npm/calendar/utils/ScrollSync.d.ts +3 -3
- package/dist/npm/calendar/utils/ScrollSync.js +2 -0
- package/dist/npm/common/PickerWrap.js +1 -1
- package/dist/npm/dateinput/DateInput.d.ts +11 -7
- package/dist/npm/dateinput/DateInput.js +32 -26
- package/dist/npm/dateinput/models/kendo-date.js +12 -12
- package/dist/npm/dateinput/models/mask.js +1 -0
- package/dist/npm/dateinput/utils.d.ts +1 -1
- package/dist/npm/datepicker/DatePicker.d.ts +8 -8
- package/dist/npm/datepicker/DatePicker.js +17 -16
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +7 -5
- package/dist/npm/daterangepicker/DateRangePicker.js +17 -17
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +7 -7
- package/dist/npm/datetimepicker/DateTimePicker.js +15 -15
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +1 -1
- package/dist/npm/datetimepicker/DateTimeSelector.js +13 -8
- package/dist/npm/hooks/usePickerFloatingLabel.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimeList.d.ts +3 -3
- package/dist/npm/timepicker/TimeList.js +29 -11
- package/dist/npm/timepicker/TimePart.d.ts +4 -4
- package/dist/npm/timepicker/TimePart.js +14 -11
- package/dist/npm/timepicker/TimePicker.d.ts +8 -8
- package/dist/npm/timepicker/TimePicker.js +19 -18
- package/dist/npm/timepicker/TimeSelector.d.ts +2 -2
- package/dist/npm/timepicker/TimeSelector.js +14 -10
- package/dist/npm/timepicker/services/DOMService.js +6 -4
- package/dist/npm/timepicker/services/DayPeriodService.js +10 -4
- package/dist/npm/timepicker/services/HoursService.js +20 -11
- package/dist/npm/timepicker/services/MinutesService.js +16 -10
- package/dist/npm/timepicker/services/SecondsService.js +16 -10
- package/dist/npm/timepicker/utils.js +11 -11
- package/dist/npm/utils.js +16 -12
- package/dist/npm/virtualization/Virtualization.d.ts +2 -1
- package/dist/npm/virtualization/Virtualization.js +16 -8
- package/dist/npm/virtualization/services/RowHeightService.js +9 -5
- package/dist/npm/virtualization/services/ScrollerService.js +9 -3
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -48,6 +48,16 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
48
48
|
__extends(TimeList, _super);
|
|
49
49
|
function TimeList(props) {
|
|
50
50
|
var _this = _super.call(this, props) || this;
|
|
51
|
+
_this.intl = null;
|
|
52
|
+
_this._element = null;
|
|
53
|
+
_this.service = null;
|
|
54
|
+
_this.virtualization = null;
|
|
55
|
+
_this.topOffset = 0;
|
|
56
|
+
_this.bottomOffset = 0;
|
|
57
|
+
_this.itemHeight = 0;
|
|
58
|
+
_this.listHeight = 0;
|
|
59
|
+
_this.topThreshold = 0;
|
|
60
|
+
_this.bottomThreshold = 0;
|
|
51
61
|
_this.animateToIndex = false;
|
|
52
62
|
_this.focus = function (args) {
|
|
53
63
|
Promise.resolve().then(function () {
|
|
@@ -58,7 +68,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
58
68
|
});
|
|
59
69
|
};
|
|
60
70
|
_this.itemOffset = function (scrollTop) {
|
|
61
|
-
if (!_this.virtualization) {
|
|
71
|
+
if (!_this.virtualization || !_this.service) {
|
|
62
72
|
return -1;
|
|
63
73
|
}
|
|
64
74
|
var valueIndex = _this.service.selectedIndex(_this.props.value);
|
|
@@ -85,15 +95,17 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
85
95
|
};
|
|
86
96
|
_this.configureServices = function (_a) {
|
|
87
97
|
var _b = _a === void 0 ? _this.props : _a, min = _b.min, max = _b.max, value = _b.value;
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
if (_this.service) {
|
|
99
|
+
var _c = _this.service.limitRange(min || _this.min, max || _this.max, value || _this.props.value), newMin = _c[0], newMax = _c[1];
|
|
100
|
+
_this.service.configure(_this.serviceSettings({ min: newMin, max: newMax }));
|
|
101
|
+
}
|
|
90
102
|
};
|
|
91
103
|
_this.serviceSettings = function (settings) {
|
|
92
104
|
var defaults = {
|
|
93
105
|
boundRange: _this.props.boundRange || TimeList.defaultProps.boundRange,
|
|
94
106
|
insertUndividedMax: false,
|
|
95
|
-
min: kendo_date_math_1.cloneDate(_this.min),
|
|
96
|
-
max: kendo_date_math_1.cloneDate(_this.max),
|
|
107
|
+
min: (0, kendo_date_math_1.cloneDate)(_this.min),
|
|
108
|
+
max: (0, kendo_date_math_1.cloneDate)(_this.max),
|
|
97
109
|
part: _this.props.part,
|
|
98
110
|
step: _this.step
|
|
99
111
|
};
|
|
@@ -103,7 +115,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
103
115
|
};
|
|
104
116
|
_this.handleScrollAction = function (_a) {
|
|
105
117
|
var target = _a.target, animationInProgress = _a.animationInProgress;
|
|
106
|
-
if (!_this.virtualization) {
|
|
118
|
+
if (!_this.virtualization || !_this.service) {
|
|
107
119
|
return;
|
|
108
120
|
}
|
|
109
121
|
if (target && !animationInProgress) {
|
|
@@ -134,6 +146,9 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
134
146
|
}
|
|
135
147
|
};
|
|
136
148
|
_this.handleKeyDown = function (event) {
|
|
149
|
+
if (!_this.service) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
137
152
|
var keyCode = event.keyCode;
|
|
138
153
|
if (keyCode === kendo_react_common_1.Keys.down
|
|
139
154
|
|| keyCode === kendo_react_common_1.Keys.up
|
|
@@ -148,6 +163,9 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
148
163
|
}
|
|
149
164
|
};
|
|
150
165
|
_this.handleChange = function (dataItem) {
|
|
166
|
+
if (!_this.service) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
151
169
|
var candidate = _this.service.apply(_this.props.value, dataItem.value);
|
|
152
170
|
if (_this.props.value.getTime() === candidate.getTime()) {
|
|
153
171
|
return;
|
|
@@ -218,7 +236,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
218
236
|
* @hidden
|
|
219
237
|
*/
|
|
220
238
|
TimeList.prototype.componentDidUpdate = function () {
|
|
221
|
-
if (!this.virtualization) {
|
|
239
|
+
if (!this.virtualization || !this.service) {
|
|
222
240
|
return;
|
|
223
241
|
}
|
|
224
242
|
var index = this.service.selectedIndex(this.props.value);
|
|
@@ -234,7 +252,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
234
252
|
return;
|
|
235
253
|
}
|
|
236
254
|
this.calculateHeights();
|
|
237
|
-
this.intl = kendo_react_intl_1.provideIntlService(this);
|
|
255
|
+
this.intl = (0, kendo_react_intl_1.provideIntlService)(this);
|
|
238
256
|
this.service = new services[this.props.part.type](this.intl);
|
|
239
257
|
this.configureServices();
|
|
240
258
|
var data = this.service.data(this.props.value);
|
|
@@ -255,14 +273,14 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
255
273
|
part: function (props, propName, componentName) {
|
|
256
274
|
var prop = props[propName];
|
|
257
275
|
if (!prop || !services[prop.type]) {
|
|
258
|
-
throw new Error("\n Invalid prop '"
|
|
276
|
+
throw new Error("\n Invalid prop '".concat(propName, "' supplied to ").concat(componentName, ".\n Supported part types are hour|minute|second|dayperiod.\n "));
|
|
259
277
|
}
|
|
260
278
|
return null;
|
|
261
279
|
},
|
|
262
280
|
step: function (props, propName, componentName) {
|
|
263
281
|
var prop = props[propName];
|
|
264
282
|
if (prop !== undefined && prop <= 0) {
|
|
265
|
-
throw new Error("\n Invalid prop '"
|
|
283
|
+
throw new Error("\n Invalid prop '".concat(propName, "' supplied to ").concat(componentName, ".\n ").concat(propName, " cannot be less than 1.\n "));
|
|
266
284
|
}
|
|
267
285
|
return null;
|
|
268
286
|
},
|
|
@@ -280,4 +298,4 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
280
298
|
return TimeList;
|
|
281
299
|
}(React.Component));
|
|
282
300
|
exports.TimeList = TimeList;
|
|
283
|
-
kendo_react_intl_1.registerForIntl(TimeList);
|
|
301
|
+
(0, kendo_react_intl_1.registerForIntl)(TimeList);
|
|
@@ -82,7 +82,7 @@ export declare class TimePart extends React.Component<TimePartProps, TimePartSta
|
|
|
82
82
|
show: PropTypes.Requireable<boolean>;
|
|
83
83
|
};
|
|
84
84
|
static defaultProps: {
|
|
85
|
-
value:
|
|
85
|
+
value: null;
|
|
86
86
|
disabled: boolean;
|
|
87
87
|
nowButton: boolean;
|
|
88
88
|
cancelButton: boolean;
|
|
@@ -123,10 +123,10 @@ export declare class TimePart extends React.Component<TimePartProps, TimePartSta
|
|
|
123
123
|
protected timeFormatReducer: (acc: string, current: DateFormatPart) => string;
|
|
124
124
|
protected timeFormatFilter: (part: DateFormatPart, index: number, all: DateFormatPart[]) => boolean;
|
|
125
125
|
protected nextTick(f: () => any): void;
|
|
126
|
-
protected hasActiveButton(): boolean;
|
|
126
|
+
protected hasActiveButton(): boolean | null;
|
|
127
127
|
protected focusList: (dir: Direction) => void;
|
|
128
|
-
protected listReducer: (state: any, list: any, idx:
|
|
129
|
-
protected showNowButton: () => boolean;
|
|
128
|
+
protected listReducer: (state: any, list: any, idx: number, all: any) => any;
|
|
129
|
+
protected showNowButton: () => boolean | undefined;
|
|
130
130
|
protected hasSteps(): boolean;
|
|
131
131
|
private handleKeyDown;
|
|
132
132
|
private handleListBlur;
|
|
@@ -38,7 +38,7 @@ var utils_1 = require("../utils");
|
|
|
38
38
|
var TimePart_1 = require("./models/TimePart");
|
|
39
39
|
var utils_2 = require("./utils");
|
|
40
40
|
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
41
|
-
var formatRegExp = new RegExp(TimePart_1.TIME_PART.hour
|
|
41
|
+
var formatRegExp = new RegExp("".concat(TimePart_1.TIME_PART.hour, "|").concat(TimePart_1.TIME_PART.minute, "|").concat(TimePart_1.TIME_PART.second, "|").concat(TimePart_1.TIME_PART.dayperiod, "|literal"));
|
|
42
42
|
/**
|
|
43
43
|
* @hidden
|
|
44
44
|
*/
|
|
@@ -54,6 +54,9 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
54
54
|
__extends(TimePart, _super);
|
|
55
55
|
function TimePart(props) {
|
|
56
56
|
var _this = _super.call(this, props) || this;
|
|
57
|
+
_this._element = null;
|
|
58
|
+
_this._nowButton = null;
|
|
59
|
+
_this.dateFormatParts = [];
|
|
57
60
|
_this.timeLists = [];
|
|
58
61
|
_this.focus = function (args) {
|
|
59
62
|
Promise.resolve().then(function () {
|
|
@@ -95,7 +98,7 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
95
98
|
}];
|
|
96
99
|
};
|
|
97
100
|
_this.showNowButton = function () {
|
|
98
|
-
return !_this.hasSteps() && _this.props.nowButton && utils_2.isInTimeRange(utils_2.getNow(), _this.min, _this.max);
|
|
101
|
+
return !_this.hasSteps() && _this.props.nowButton && (0, utils_2.isInTimeRange)((0, utils_2.getNow)(), _this.min, _this.max);
|
|
99
102
|
};
|
|
100
103
|
_this.handleKeyDown = function (event) {
|
|
101
104
|
var keyCode = event.keyCode;
|
|
@@ -129,7 +132,7 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
129
132
|
onChange.call(undefined, candidate);
|
|
130
133
|
}
|
|
131
134
|
};
|
|
132
|
-
_this.snapTime = utils_2.snapTime(utils_2.generateSnappers(_this.props.steps, _this.props.min || TimePart.defaultProps.min));
|
|
135
|
+
_this.snapTime = (0, utils_2.snapTime)((0, utils_2.generateSnappers)(_this.props.steps, _this.props.min || TimePart.defaultProps.min));
|
|
133
136
|
_this.state = {
|
|
134
137
|
activeListIndex: -1
|
|
135
138
|
};
|
|
@@ -148,14 +151,14 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
148
151
|
});
|
|
149
152
|
Object.defineProperty(TimePart.prototype, "value", {
|
|
150
153
|
get: function () {
|
|
151
|
-
return utils_2.timeInRange(this.snapTime(kendo_date_math_1.cloneDate(this.props.value || utils_1.MIDNIGHT_DATE)), this.min, this.max);
|
|
154
|
+
return (0, utils_2.timeInRange)(this.snapTime((0, kendo_date_math_1.cloneDate)(this.props.value || utils_1.MIDNIGHT_DATE)), this.min, this.max);
|
|
152
155
|
},
|
|
153
156
|
enumerable: false,
|
|
154
157
|
configurable: true
|
|
155
158
|
});
|
|
156
159
|
Object.defineProperty(TimePart.prototype, "intl", {
|
|
157
160
|
get: function () {
|
|
158
|
-
return kendo_react_intl_1.provideIntlService(this);
|
|
161
|
+
return (0, kendo_react_intl_1.provideIntlService)(this);
|
|
159
162
|
},
|
|
160
163
|
enumerable: false,
|
|
161
164
|
configurable: true
|
|
@@ -208,15 +211,15 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
208
211
|
TimePart.prototype.render = function () {
|
|
209
212
|
var _this = this;
|
|
210
213
|
var _a = this.props, format = _a.format, smoothScroll = _a.smoothScroll, onNowClick = _a.onNowClick, className = _a.className, disabled = _a.disabled;
|
|
211
|
-
this.snapTime = utils_2.snapTime(utils_2.generateSnappers(this.steps, this.min));
|
|
214
|
+
this.snapTime = (0, utils_2.snapTime)((0, utils_2.generateSnappers)(this.steps, this.min));
|
|
212
215
|
this.dateFormatParts = this.intl
|
|
213
216
|
.splitDateFormat(format || TimePart.defaultProps.format)
|
|
214
217
|
.filter(this.timeFormatFilter);
|
|
215
|
-
var rootClassName = kendo_react_common_1.classNames({
|
|
218
|
+
var rootClassName = (0, kendo_react_common_1.classNames)({
|
|
216
219
|
'k-disabled': disabled
|
|
217
220
|
}, className, 'k-time-part');
|
|
218
221
|
this.timeLists = [];
|
|
219
|
-
var localizationService = kendo_react_intl_1.provideLocalizationService(this);
|
|
222
|
+
var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
220
223
|
var selectNowMessage = localizationService.toLanguageString(messages_1.selectNow, messages_1.messages[messages_1.selectNow]);
|
|
221
224
|
return (React.createElement("div", { className: rootClassName },
|
|
222
225
|
React.createElement("div", { className: "k-time-header" },
|
|
@@ -227,7 +230,7 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
227
230
|
React.createElement("span", { className: "k-time-highlight" }),
|
|
228
231
|
this.dateFormatParts.map(function (part, idx) {
|
|
229
232
|
return (part.type !== 'literal'
|
|
230
|
-
? React.createElement("div", { key: idx, className: kendo_react_common_1.classNames('k-time-list-wrapper', {
|
|
233
|
+
? React.createElement("div", { key: idx, className: (0, kendo_react_common_1.classNames)('k-time-list-wrapper', {
|
|
231
234
|
'k-focus': idx === _this.state.activeListIndex
|
|
232
235
|
}), role: "presentation", tabIndex: -1 },
|
|
233
236
|
React.createElement("span", { className: "k-title", onMouseDown: function (e) { e.preventDefault(); } }, _this.intl.dateFieldName(part)),
|
|
@@ -301,5 +304,5 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
301
304
|
return TimePart;
|
|
302
305
|
}(React.Component));
|
|
303
306
|
exports.TimePart = TimePart;
|
|
304
|
-
kendo_react_intl_1.registerForIntl(TimePart);
|
|
305
|
-
kendo_react_intl_1.registerForLocalization(TimePart);
|
|
307
|
+
(0, kendo_react_intl_1.registerForIntl)(TimePart);
|
|
308
|
+
(0, kendo_react_intl_1.registerForLocalization)(TimePart);
|
|
@@ -145,16 +145,16 @@ export declare class TimePickerWithoutContext extends React.Component<TimePicker
|
|
|
145
145
|
required: PropTypes.Requireable<boolean>;
|
|
146
146
|
validate: PropTypes.Requireable<boolean>;
|
|
147
147
|
valid: PropTypes.Requireable<boolean>;
|
|
148
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
149
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
150
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
148
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
149
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
150
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>;
|
|
151
151
|
};
|
|
152
152
|
/**
|
|
153
153
|
* @hidden
|
|
154
154
|
*/
|
|
155
155
|
static defaultProps: {
|
|
156
156
|
defaultShow: boolean;
|
|
157
|
-
defaultValue:
|
|
157
|
+
defaultValue: null;
|
|
158
158
|
disabled: boolean;
|
|
159
159
|
format: string;
|
|
160
160
|
max: Date;
|
|
@@ -165,9 +165,9 @@ export declare class TimePickerWithoutContext extends React.Component<TimePicker
|
|
|
165
165
|
required: boolean;
|
|
166
166
|
validityStyles: boolean;
|
|
167
167
|
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
168
|
-
size: "small" | "medium" | "large";
|
|
169
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
170
|
-
fillMode: "flat" | "
|
|
168
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
169
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
170
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
171
171
|
};
|
|
172
172
|
/**
|
|
173
173
|
* @hidden
|
|
@@ -238,7 +238,7 @@ export declare class TimePickerWithoutContext extends React.Component<TimePicker
|
|
|
238
238
|
* @hidden
|
|
239
239
|
*/
|
|
240
240
|
render(): JSX.Element;
|
|
241
|
-
protected setTimeSelectorRef: (timeSelector:
|
|
241
|
+
protected setTimeSelectorRef: (timeSelector: TimeSelector | null) => void;
|
|
242
242
|
protected nextValue: (nextProps: TimePickerProps, nextState: TimePickerState) => Date | null;
|
|
243
243
|
protected nextShow: (nextProps: TimePickerProps, nextState: TimePickerState) => boolean;
|
|
244
244
|
protected normalizeTime(date: Date): Date;
|
|
@@ -58,11 +58,12 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
58
58
|
__extends(TimePickerWithoutContext, _super);
|
|
59
59
|
function TimePickerWithoutContext(props) {
|
|
60
60
|
var _this = _super.call(this, props) || this;
|
|
61
|
-
_this._popupId = kendo_react_common_1.guid();
|
|
61
|
+
_this._popupId = (0, kendo_react_common_1.guid)();
|
|
62
62
|
_this._element = null;
|
|
63
63
|
_this._dateInput = React.createRef();
|
|
64
64
|
_this._timeSelector = null;
|
|
65
65
|
_this.shouldFocusDateInput = false;
|
|
66
|
+
_this.prevShow = false;
|
|
66
67
|
/**
|
|
67
68
|
* @hidden
|
|
68
69
|
*/
|
|
@@ -90,7 +91,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
90
91
|
};
|
|
91
92
|
_this.handleValueChange = function (event) {
|
|
92
93
|
_this.setState({
|
|
93
|
-
value: kendo_date_math_1.cloneDate(event.value),
|
|
94
|
+
value: (0, kendo_date_math_1.cloneDate)(event.value),
|
|
94
95
|
show: false
|
|
95
96
|
});
|
|
96
97
|
_this.valueDuringOnChange = event.value;
|
|
@@ -143,7 +144,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
143
144
|
_this.setShow(keyCode === kendo_react_common_1.Keys.down);
|
|
144
145
|
}
|
|
145
146
|
};
|
|
146
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
147
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
147
148
|
_this.state = {
|
|
148
149
|
value: _this.props.defaultValue || TimePickerWithoutContext.defaultProps.defaultValue,
|
|
149
150
|
show: _this.props.defaultShow || TimePickerWithoutContext.defaultProps.defaultShow,
|
|
@@ -194,7 +195,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
194
195
|
: this.props.value !== undefined
|
|
195
196
|
? this.props.value
|
|
196
197
|
: this.state.value;
|
|
197
|
-
return (value !== null) ? kendo_date_math_1.cloneDate(value) : null;
|
|
198
|
+
return (value !== null) ? (0, kendo_date_math_1.cloneDate)(value) : null;
|
|
198
199
|
},
|
|
199
200
|
enumerable: false,
|
|
200
201
|
configurable: true
|
|
@@ -231,14 +232,14 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
231
232
|
var value = this.value && this.normalizeTime(this.value);
|
|
232
233
|
var min = this.normalizeTime(this.min);
|
|
233
234
|
var max = this.normalizeTime(this.max);
|
|
234
|
-
var inRange = utils_2.isInRange(value, min, max);
|
|
235
|
+
var inRange = (0, utils_2.isInRange)(value, min, max);
|
|
235
236
|
var customError = this.props.validationMessage !== undefined;
|
|
236
237
|
var isValid = (!this.required || this.value !== null) && inRange;
|
|
237
238
|
var valid = this.props.valid !== undefined ? this.props.valid : isValid;
|
|
238
239
|
return {
|
|
239
240
|
customError: customError,
|
|
240
|
-
rangeOverflow: utils_2.isBiggerThanMax(value, max),
|
|
241
|
-
rangeUnderflow: utils_2.isSmallerThanMin(value, min),
|
|
241
|
+
rangeOverflow: (0, utils_2.isBiggerThanMax)(value, max),
|
|
242
|
+
rangeUnderflow: (0, utils_2.isSmallerThanMin)(value, min),
|
|
242
243
|
valid: valid,
|
|
243
244
|
valueMissing: this.value === null
|
|
244
245
|
};
|
|
@@ -331,7 +332,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
331
332
|
var _a = this.props, _b = _a.size, size = _b === void 0 ? TimePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? TimePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? TimePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, className = _a.className, format = _a.format, formatPlaceholder = _a.formatPlaceholder, smoothScroll = _a.smoothScroll, width = _a.width, name = _a.name, steps = _a.steps, cancelButton = _a.cancelButton, nowButton = _a.nowButton, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy;
|
|
332
333
|
var _e = this.popupSettings, popupClass = _e.popupClass, otherPopupSettings = __rest(_e, ["popupClass"]);
|
|
333
334
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
334
|
-
var popupClassNames = kendo_react_common_1.classNames('k-group k-reset', popupClass);
|
|
335
|
+
var popupClassNames = (0, kendo_react_common_1.classNames)('k-group k-reset', popupClass);
|
|
335
336
|
var dateInputProps = {
|
|
336
337
|
disabled: disabled,
|
|
337
338
|
format: format,
|
|
@@ -367,17 +368,17 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
367
368
|
vertical: 'top'
|
|
368
369
|
} }, otherPopupSettings);
|
|
369
370
|
var timeSelector = (React.createElement(TimeSelector_1.TimeSelector, { ref: this.setTimeSelectorRef, show: this.show, cancelButton: cancelButton, disabled: disabled, nowButton: nowButton, format: format, min: this.min, max: this.max, steps: steps, smoothScroll: smoothScroll, value: this.value, onChange: this.handleValueChange, onReject: this.handleValueReject }));
|
|
370
|
-
var localizationService = kendo_react_intl_1.provideLocalizationService(this);
|
|
371
|
+
var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
371
372
|
var toggleClockMessage = localizationService.toLanguageString(messages_1.toggleClock, messages_1.messages[messages_1.toggleClock]);
|
|
372
373
|
var toggleTimeMessage = localizationService
|
|
373
374
|
.toLanguageString(messages_1.toggleTimeSelector, messages_1.messages[messages_1.toggleTimeSelector]);
|
|
374
375
|
var timepicker = (React.createElement(kendo_react_common_1.AsyncFocusBlur, { onFocus: this.handleFocus, onBlur: this.handleBlur, onSyncBlur: this.props.onBlur, onSyncFocus: this.props.onFocus }, function (_a) {
|
|
375
376
|
var _b;
|
|
376
377
|
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
377
|
-
return (React.createElement("div", { ref: function (span) { _this._element = span; }, className: kendo_react_common_1.classNames('k-input', 'k-timepicker', (_b = {},
|
|
378
|
-
_b["k-input-"
|
|
379
|
-
_b["k-rounded-"
|
|
380
|
-
_b["k-input-"
|
|
378
|
+
return (React.createElement("div", { ref: function (span) { _this._element = span; }, className: (0, kendo_react_common_1.classNames)('k-input', 'k-timepicker', (_b = {},
|
|
379
|
+
_b["k-input-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
380
|
+
_b["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
381
|
+
_b["k-input-".concat(fillMode)] = fillMode,
|
|
381
382
|
_b['k-invalid'] = !isValid,
|
|
382
383
|
_b['k-required'] = _this.required,
|
|
383
384
|
_b['k-disabled'] = _this.props.disabled,
|
|
@@ -396,7 +397,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
396
397
|
: timepicker;
|
|
397
398
|
};
|
|
398
399
|
TimePickerWithoutContext.prototype.normalizeTime = function (date) {
|
|
399
|
-
return utils_1.setTime(utils_1.MIDNIGHT_DATE, date);
|
|
400
|
+
return (0, utils_1.setTime)(utils_1.MIDNIGHT_DATE, date);
|
|
400
401
|
};
|
|
401
402
|
TimePickerWithoutContext.prototype.setShow = function (show) {
|
|
402
403
|
if (this.show === show) {
|
|
@@ -405,7 +406,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
405
406
|
this.setState({ show: show });
|
|
406
407
|
};
|
|
407
408
|
TimePickerWithoutContext.prototype.mergeTime = function (value) {
|
|
408
|
-
return this.value && value ? utils_1.setTime(this.value, value) : value;
|
|
409
|
+
return this.value && value ? (0, utils_1.setTime)(this.value, value) : value;
|
|
409
410
|
};
|
|
410
411
|
/**
|
|
411
412
|
* @hidden
|
|
@@ -511,7 +512,7 @@ exports.TimePickerWithoutContext = TimePickerWithoutContext;
|
|
|
511
512
|
*
|
|
512
513
|
* For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.
|
|
513
514
|
*/
|
|
514
|
-
exports.TimePickerPropsContext = kendo_react_common_1.createPropsContext();
|
|
515
|
+
exports.TimePickerPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
515
516
|
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
516
517
|
/**
|
|
517
518
|
* Represents the KendoReact TimePicker Component.
|
|
@@ -519,6 +520,6 @@ exports.TimePickerPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
519
520
|
* Accepts properties of type [TimePicker]({% slug api_dateinputs_timepickerprops %}).
|
|
520
521
|
* Obtaining the `ref` returns an object of type [TimePickerHandle]({% slug api_dateinputs_timepickerhandle %}).
|
|
521
522
|
*/
|
|
522
|
-
exports.TimePicker = kendo_react_common_1.withPropsContext(exports.TimePickerPropsContext, TimePickerWithoutContext);
|
|
523
|
+
exports.TimePicker = (0, kendo_react_common_1.withPropsContext)(exports.TimePickerPropsContext, TimePickerWithoutContext);
|
|
523
524
|
exports.TimePicker.displayName = 'KendoReactTimePicker';
|
|
524
|
-
kendo_react_intl_1.registerForLocalization(TimePickerWithoutContext);
|
|
525
|
+
(0, kendo_react_intl_1.registerForLocalization)(TimePickerWithoutContext);
|
|
@@ -84,7 +84,7 @@ export declare class TimeSelector extends React.Component<TimeSelectorProps, Tim
|
|
|
84
84
|
show: PropTypes.Requireable<boolean>;
|
|
85
85
|
};
|
|
86
86
|
static defaultProps: {
|
|
87
|
-
value:
|
|
87
|
+
value: null;
|
|
88
88
|
disabled: boolean;
|
|
89
89
|
cancelButton: boolean;
|
|
90
90
|
format: string;
|
|
@@ -119,7 +119,7 @@ export declare class TimeSelector extends React.Component<TimeSelectorProps, Tim
|
|
|
119
119
|
render(): JSX.Element;
|
|
120
120
|
focusActiveList: () => void;
|
|
121
121
|
protected nextTick(f: () => any): void;
|
|
122
|
-
protected hasActiveButton(): boolean;
|
|
122
|
+
protected hasActiveButton(): boolean | null;
|
|
123
123
|
private handleKeyDown;
|
|
124
124
|
private handleAccept;
|
|
125
125
|
private handleReject;
|
|
@@ -52,6 +52,10 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
52
52
|
__extends(TimeSelector, _super);
|
|
53
53
|
function TimeSelector(props) {
|
|
54
54
|
var _this = _super.call(this, props) || this;
|
|
55
|
+
_this._element = null;
|
|
56
|
+
_this._cancelButton = null;
|
|
57
|
+
_this._acceptButton = null;
|
|
58
|
+
_this.timePart = null;
|
|
55
59
|
_this.focusActiveList = function () {
|
|
56
60
|
if (!_this.timePart) {
|
|
57
61
|
return;
|
|
@@ -71,7 +75,7 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
71
75
|
}
|
|
72
76
|
};
|
|
73
77
|
_this.handleAccept = function (event) {
|
|
74
|
-
var value = _this.mergeValue(kendo_date_math_1.cloneDate(_this.value || utils_2.getNow()), _this.timePart ? _this.timePart.value : _this.current);
|
|
78
|
+
var value = _this.mergeValue((0, kendo_date_math_1.cloneDate)(_this.value || (0, utils_2.getNow)()), _this.timePart ? _this.timePart.value : _this.current);
|
|
75
79
|
_this.setState({ value: value });
|
|
76
80
|
_this.valueDuringOnChange = value;
|
|
77
81
|
var onChange = _this.props.onChange;
|
|
@@ -93,7 +97,7 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
93
97
|
}
|
|
94
98
|
};
|
|
95
99
|
_this.handleNowClick = function (event) {
|
|
96
|
-
var now = _this.mergeValue(kendo_date_math_1.cloneDate(_this.value || utils_2.getNow()), utils_2.getNow());
|
|
100
|
+
var now = _this.mergeValue((0, kendo_date_math_1.cloneDate)(_this.value || (0, utils_2.getNow)()), (0, utils_2.getNow)());
|
|
97
101
|
_this.setState({
|
|
98
102
|
current: now,
|
|
99
103
|
value: now
|
|
@@ -114,7 +118,7 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
114
118
|
_this.setState({ current: candidate });
|
|
115
119
|
};
|
|
116
120
|
_this.dateFormatParts = _this.intl.splitDateFormat(_this.props.format || TimeSelector.defaultProps.format);
|
|
117
|
-
_this.mergeValue = utils_2.valueMerger(utils_2.generateGetters(_this.dateFormatParts));
|
|
121
|
+
_this.mergeValue = (0, utils_2.valueMerger)((0, utils_2.generateGetters)(_this.dateFormatParts));
|
|
118
122
|
_this.hasActiveButton = _this.hasActiveButton.bind(_this);
|
|
119
123
|
_this.state = {
|
|
120
124
|
current: _this.props.value || utils_1.MIDNIGHT_DATE,
|
|
@@ -140,7 +144,7 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
140
144
|
? this.props.value
|
|
141
145
|
: this.state.value;
|
|
142
146
|
return (value !== null)
|
|
143
|
-
? kendo_date_math_1.cloneDate(value)
|
|
147
|
+
? (0, kendo_date_math_1.cloneDate)(value)
|
|
144
148
|
: null;
|
|
145
149
|
},
|
|
146
150
|
enumerable: false,
|
|
@@ -148,7 +152,7 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
148
152
|
});
|
|
149
153
|
Object.defineProperty(TimeSelector.prototype, "intl", {
|
|
150
154
|
get: function () {
|
|
151
|
-
return kendo_react_intl_1.provideIntlService(this);
|
|
155
|
+
return (0, kendo_react_intl_1.provideIntlService)(this);
|
|
152
156
|
},
|
|
153
157
|
enumerable: false,
|
|
154
158
|
configurable: true
|
|
@@ -156,7 +160,7 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
156
160
|
Object.defineProperty(TimeSelector.prototype, "current", {
|
|
157
161
|
get: function () {
|
|
158
162
|
return this.state.current !== null
|
|
159
|
-
? kendo_date_math_1.cloneDate(this.state.current)
|
|
163
|
+
? (0, kendo_date_math_1.cloneDate)(this.state.current)
|
|
160
164
|
: null;
|
|
161
165
|
},
|
|
162
166
|
enumerable: false,
|
|
@@ -174,10 +178,10 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
174
178
|
TimeSelector.prototype.render = function () {
|
|
175
179
|
var _this = this;
|
|
176
180
|
var _a = this.props, format = _a.format, cancelButton = _a.cancelButton, disabled = _a.disabled, tabIndex = _a.tabIndex, className = _a.className, smoothScroll = _a.smoothScroll, min = _a.min, max = _a.max, boundRange = _a.boundRange, nowButton = _a.nowButton, steps = _a.steps;
|
|
177
|
-
var localizationService = kendo_react_intl_1.provideLocalizationService(this);
|
|
181
|
+
var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
178
182
|
var cancelMessage = localizationService.toLanguageString(messages_1.timePickerCancel, messages_1.messages[messages_1.timePickerCancel]);
|
|
179
183
|
var setMessage = localizationService.toLanguageString(messages_1.timePickerSet, messages_1.messages[messages_1.timePickerSet]);
|
|
180
|
-
return (React.createElement("div", { ref: function (el) { _this._element = el; }, tabIndex: !disabled ? tabIndex || 0 : undefined, className: kendo_react_common_1.classNames('k-timeselector k-reset', className, {
|
|
184
|
+
return (React.createElement("div", { ref: function (el) { _this._element = el; }, tabIndex: !disabled ? tabIndex || 0 : undefined, className: (0, kendo_react_common_1.classNames)('k-timeselector k-reset', className, {
|
|
181
185
|
'k-disabled': disabled
|
|
182
186
|
}), onKeyDown: this.handleKeyDown },
|
|
183
187
|
React.createElement(TimePart_1.TimePart, { ref: function (el) { _this.timePart = el; }, value: this.current, onChange: this.handleChange, onNowClick: this.handleNowClick, format: format, smoothScroll: smoothScroll, min: min, max: max, boundRange: boundRange, disabled: disabled, nowButton: nowButton, steps: steps, show: this.props.show }),
|
|
@@ -248,5 +252,5 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
248
252
|
return TimeSelector;
|
|
249
253
|
}(React.Component));
|
|
250
254
|
exports.TimeSelector = TimeSelector;
|
|
251
|
-
kendo_react_intl_1.registerForIntl(TimeSelector);
|
|
252
|
-
kendo_react_intl_1.registerForLocalization(TimeSelector);
|
|
255
|
+
(0, kendo_react_intl_1.registerForIntl)(TimeSelector);
|
|
256
|
+
(0, kendo_react_intl_1.registerForLocalization)(TimeSelector);
|
|
@@ -8,6 +8,8 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
8
8
|
*/
|
|
9
9
|
var DOMService = /** @class */ (function () {
|
|
10
10
|
function DOMService() {
|
|
11
|
+
this.itemHeight = 0;
|
|
12
|
+
this.timeListHeight = 0;
|
|
11
13
|
this.didCalculate = false;
|
|
12
14
|
}
|
|
13
15
|
DOMService.prototype.ensureHeights = function () {
|
|
@@ -20,10 +22,10 @@ var DOMService = /** @class */ (function () {
|
|
|
20
22
|
if (!kendo_react_common_1.canUseDOM) {
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
|
-
var div = utils_1.domContainerFactory('div');
|
|
24
|
-
var span = utils_1.domContainerFactory('span');
|
|
25
|
-
var ul = utils_1.domContainerFactory('ul');
|
|
26
|
-
var li = utils_1.domContainerFactory('li');
|
|
25
|
+
var div = (0, utils_1.domContainerFactory)('div');
|
|
26
|
+
var span = (0, utils_1.domContainerFactory)('span');
|
|
27
|
+
var ul = (0, utils_1.domContainerFactory)('ul');
|
|
28
|
+
var li = (0, utils_1.domContainerFactory)('li');
|
|
27
29
|
var listItem = function () { return li('<span>02</span>', 'k-item'); };
|
|
28
30
|
var list = function () { return ul([listItem()], 'k-reset'); };
|
|
29
31
|
var scrollable = function () { return (div([list()], 'k-content k-calendar-content k-scrollable k-time-container')); };
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DayPeriodService = void 0;
|
|
4
4
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
5
5
|
var setHours = function (date, hours) {
|
|
6
|
-
var clone = kendo_date_math_1.cloneDate(date);
|
|
6
|
+
var clone = (0, kendo_date_math_1.cloneDate)(date);
|
|
7
7
|
clone.setHours(hours);
|
|
8
8
|
return clone;
|
|
9
9
|
};
|
|
@@ -17,6 +17,9 @@ var inReverseRange = function (value, min, max) { return ((!min && !max) || valu
|
|
|
17
17
|
var DayPeriodService = /** @class */ (function () {
|
|
18
18
|
function DayPeriodService(intl) {
|
|
19
19
|
this.intl = intl;
|
|
20
|
+
this.min = null;
|
|
21
|
+
this.max = null;
|
|
22
|
+
this.part = null;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* @hidden
|
|
@@ -45,8 +48,8 @@ var DayPeriodService = /** @class */ (function () {
|
|
|
45
48
|
* @hidden
|
|
46
49
|
*/
|
|
47
50
|
DayPeriodService.prototype.data = function (_) {
|
|
48
|
-
var names = this.part.names;
|
|
49
|
-
if (!names) {
|
|
51
|
+
var names = this.part && this.part.names;
|
|
52
|
+
if (!names || !this.min) {
|
|
50
53
|
return [];
|
|
51
54
|
}
|
|
52
55
|
var data = [];
|
|
@@ -89,7 +92,7 @@ var DayPeriodService = /** @class */ (function () {
|
|
|
89
92
|
* @hidden
|
|
90
93
|
*/
|
|
91
94
|
DayPeriodService.prototype.selectedIndex = function (value) {
|
|
92
|
-
if (!this.valueInList(value)) {
|
|
95
|
+
if (!this.valueInList(value) || !this.min) {
|
|
93
96
|
return -1;
|
|
94
97
|
}
|
|
95
98
|
var index = Math.floor(value.getHours() / 12);
|
|
@@ -99,6 +102,9 @@ var DayPeriodService = /** @class */ (function () {
|
|
|
99
102
|
* @hidden
|
|
100
103
|
*/
|
|
101
104
|
DayPeriodService.prototype.valueInList = function (value) {
|
|
105
|
+
if (!this.min || !this.max) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
102
108
|
var reverse = this.min.getHours() !== this.normalizedRange()[0];
|
|
103
109
|
var isInRange = reverse ? inReverseRange : inRange;
|
|
104
110
|
return isInRange(value.getHours(), this.min.getHours(), this.max.getHours());
|