@progress/kendo-react-dateinputs 8.3.0-develop.11 → 8.3.0-develop.12
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/calendar/components/ViewList.mjs +9 -7
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +63 -51
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +6 -7
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +24 -24
- package/datetimepicker/DateTimeSelector.mjs +47 -60
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +0 -4
- package/index.d.ts +0 -4
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +25 -26
- package/utils.js +1 -1
- package/utils.mjs +24 -31
|
@@ -10,7 +10,7 @@ import * as a from "react";
|
|
|
10
10
|
import e from "prop-types";
|
|
11
11
|
import { Popup as H } from "@progress/kendo-react-popup";
|
|
12
12
|
import { cloneDate as T } from "@progress/kendo-date-math";
|
|
13
|
-
import { Keys as
|
|
13
|
+
import { Keys as d, validatePackage as W, canUseDOM as O, AsyncFocusBlur as X, classNames as b, uDateTimePicker as y, createPropsContext as Z, withIdHOC as G, withPropsContext as J, withUnstyledHOC as Q } from "@progress/kendo-react-common";
|
|
14
14
|
import { calendarIcon as Y } from "@progress/kendo-svg-icons";
|
|
15
15
|
import { DateInput as $ } from "../dateinput/DateInput.mjs";
|
|
16
16
|
import { Button as ee } from "@progress/kendo-react-buttons";
|
|
@@ -19,8 +19,8 @@ import { MAX_DATE as ie, MIN_DATE as se, isInDateRange as oe, MAX_TIME as ne, MI
|
|
|
19
19
|
import { MOBILE_MEDIUM_DEVISE as re } from "../common/constants.mjs";
|
|
20
20
|
import { dateTimePickerCancel as M, messages as p, dateTimePickerSet as P, toggleDateTimeSelector as c } from "../messages/index.mjs";
|
|
21
21
|
import { provideLocalizationService as m, registerForLocalization as le } from "@progress/kendo-react-intl";
|
|
22
|
-
import { DateTimeSelector as
|
|
23
|
-
import { isInTimeRange as
|
|
22
|
+
import { DateTimeSelector as he } from "./DateTimeSelector.mjs";
|
|
23
|
+
import { isInTimeRange as de } from "../timepicker/utils.mjs";
|
|
24
24
|
import { PickerFloatingLabel as ue } from "../hooks/usePickerFloatingLabel.mjs";
|
|
25
25
|
import { AdaptiveMode as pe } from "../common/AdaptiveMode.mjs";
|
|
26
26
|
import { ActionSheetContent as ce } from "@progress/kendo-react-layout";
|
|
@@ -34,14 +34,14 @@ const o = class o extends a.Component {
|
|
|
34
34
|
disabled: i,
|
|
35
35
|
minTime: s,
|
|
36
36
|
maxTime: n,
|
|
37
|
-
format:
|
|
37
|
+
format: h,
|
|
38
38
|
calendar: l,
|
|
39
39
|
cancelButton: r,
|
|
40
40
|
weekNumber: u,
|
|
41
41
|
focusedDate: g
|
|
42
42
|
} = this.props;
|
|
43
43
|
return /* @__PURE__ */ a.createElement(
|
|
44
|
-
|
|
44
|
+
he,
|
|
45
45
|
{
|
|
46
46
|
ref: (v) => {
|
|
47
47
|
this._dateTimeSelector = v;
|
|
@@ -58,14 +58,14 @@ const o = class o extends a.Component {
|
|
|
58
58
|
minTime: s,
|
|
59
59
|
maxTime: n,
|
|
60
60
|
focusedDate: g,
|
|
61
|
-
format:
|
|
61
|
+
format: h,
|
|
62
62
|
calendar: l,
|
|
63
63
|
mobileMode: this.mobileMode,
|
|
64
64
|
footerActions: !this.mobileMode
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
67
|
}, this.renderAdaptivePopup = () => {
|
|
68
|
-
const { windowWidth: i = 0 } = this.state, s = m(this).toLanguageString(M, p[M]), n = m(this).toLanguageString(P, p[P]),
|
|
68
|
+
const { windowWidth: i = 0 } = this.state, s = m(this).toLanguageString(M, p[M]), n = m(this).toLanguageString(P, p[P]), h = {
|
|
69
69
|
expand: this.show,
|
|
70
70
|
onClose: this.handleBlur,
|
|
71
71
|
adaptiveTitle: this.props.adaptiveTitle,
|
|
@@ -83,7 +83,7 @@ const o = class o extends a.Component {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
return /* @__PURE__ */ a.createElement(pe, { ...
|
|
86
|
+
return /* @__PURE__ */ a.createElement(pe, { ...h }, /* @__PURE__ */ a.createElement(ce, { overflowHidden: !0 }, this.renderPicker()));
|
|
87
87
|
}, this.handleReject = () => {
|
|
88
88
|
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
89
89
|
}, this.handleValueChange = (i) => {
|
|
@@ -108,11 +108,11 @@ const o = class o extends a.Component {
|
|
|
108
108
|
i.preventDefault();
|
|
109
109
|
}, this.handleKeyDown = (i) => {
|
|
110
110
|
const { altKey: s, keyCode: n } = i;
|
|
111
|
-
if (n ===
|
|
111
|
+
if (n === d.esc) {
|
|
112
112
|
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
s && (n ===
|
|
115
|
+
s && (n === d.up || n === d.down) && (i.preventDefault(), i.stopPropagation(), this.shouldFocusDateInput = n === d.up, this.setShow(n === d.down));
|
|
116
116
|
}, this.dateInputElement = () => this.dateInput && this.dateInput.element || this.element && this.element.querySelector(".k-dateinput > input.k-input-inner"), W(te), this.state = {
|
|
117
117
|
value: this.props.defaultValue || o.defaultProps.defaultValue,
|
|
118
118
|
show: this.props.defaultShow || o.defaultProps.defaultShow,
|
|
@@ -173,7 +173,7 @@ const o = class o extends a.Component {
|
|
|
173
173
|
* Represents the validity state into which the DateTimePicker is set.
|
|
174
174
|
*/
|
|
175
175
|
get validity() {
|
|
176
|
-
const t = oe(this.value, this.min, this.max) &&
|
|
176
|
+
const t = oe(this.value, this.min, this.max) && de(this.value, this.props.minTime || ae, this.props.maxTime || ne), i = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && t, n = this.props.valid !== void 0 ? this.props.valid : s;
|
|
177
177
|
return {
|
|
178
178
|
customError: i,
|
|
179
179
|
rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
|
|
@@ -192,7 +192,7 @@ const o = class o extends a.Component {
|
|
|
192
192
|
* @hidden
|
|
193
193
|
*/
|
|
194
194
|
get required() {
|
|
195
|
-
return this.props.required !== void 0 ? this.props.required :
|
|
195
|
+
return this.props.required !== void 0 ? this.props.required : !1;
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* @hidden
|
|
@@ -230,7 +230,7 @@ const o = class o extends a.Component {
|
|
|
230
230
|
rounded: i = o.defaultProps.rounded,
|
|
231
231
|
fillMode: s = o.defaultProps.fillMode,
|
|
232
232
|
autoFocus: n = o.defaultProps.autoFocus,
|
|
233
|
-
disabled:
|
|
233
|
+
disabled: h,
|
|
234
234
|
tabIndex: l,
|
|
235
235
|
title: r,
|
|
236
236
|
id: u,
|
|
@@ -246,17 +246,17 @@ const o = class o extends a.Component {
|
|
|
246
246
|
validityStyles: z,
|
|
247
247
|
minTime: A,
|
|
248
248
|
maxTime: N,
|
|
249
|
-
ariaLabelledBy:
|
|
250
|
-
ariaDescribedBy:
|
|
251
|
-
popup:
|
|
249
|
+
ariaLabelledBy: V,
|
|
250
|
+
ariaDescribedBy: L,
|
|
251
|
+
popup: _ = H,
|
|
252
252
|
unstyled: I
|
|
253
|
-
} = this.props, w = I && I.uDateTimePicker, D = !this.validityStyles || this.validity.valid,
|
|
253
|
+
} = this.props, w = I && I.uDateTimePicker, D = !this.validityStyles || this.validity.valid, q = {
|
|
254
254
|
id: u,
|
|
255
|
-
ariaLabelledBy:
|
|
256
|
-
ariaDescribedBy:
|
|
255
|
+
ariaLabelledBy: V,
|
|
256
|
+
ariaDescribedBy: L,
|
|
257
257
|
format: g,
|
|
258
258
|
formatPlaceholder: v,
|
|
259
|
-
disabled:
|
|
259
|
+
disabled: h,
|
|
260
260
|
title: r,
|
|
261
261
|
validityStyles: z,
|
|
262
262
|
validationMessage: R,
|
|
@@ -297,7 +297,7 @@ const o = class o extends a.Component {
|
|
|
297
297
|
size: t,
|
|
298
298
|
fillMode: s,
|
|
299
299
|
rounded: i,
|
|
300
|
-
disabled:
|
|
300
|
+
disabled: h,
|
|
301
301
|
required: this.required,
|
|
302
302
|
invalid: !D
|
|
303
303
|
}),
|
|
@@ -315,9 +315,10 @@ const o = class o extends a.Component {
|
|
|
315
315
|
_ref: this._dateInput,
|
|
316
316
|
ariaRole: "combobox",
|
|
317
317
|
ariaControls: this._popupId,
|
|
318
|
+
ariaHasPopup: "dialog",
|
|
318
319
|
readonly: this.mobileMode,
|
|
319
320
|
autoFocus: n,
|
|
320
|
-
...
|
|
321
|
+
...q
|
|
321
322
|
}
|
|
322
323
|
),
|
|
323
324
|
/* @__PURE__ */ a.createElement(
|
|
@@ -337,7 +338,7 @@ const o = class o extends a.Component {
|
|
|
337
338
|
}
|
|
338
339
|
),
|
|
339
340
|
/* @__PURE__ */ a.createElement(
|
|
340
|
-
|
|
341
|
+
_,
|
|
341
342
|
{
|
|
342
343
|
show: this.show,
|
|
343
344
|
animate: this.element !== null,
|
|
@@ -460,7 +461,6 @@ o.displayName = "DateTimePicker", o.propTypes = {
|
|
|
460
461
|
popupSettings: {},
|
|
461
462
|
tabIndex: 0,
|
|
462
463
|
weekNumber: !1,
|
|
463
|
-
required: !1,
|
|
464
464
|
validityStyles: !0,
|
|
465
465
|
cancelButton: !0,
|
|
466
466
|
dateInput: $,
|
|
@@ -155,17 +155,7 @@ const y = class y extends i.Component {
|
|
|
155
155
|
}), this.shouldFocusPart = !1;
|
|
156
156
|
}
|
|
157
157
|
render() {
|
|
158
|
-
const {
|
|
159
|
-
disabled: a,
|
|
160
|
-
min: t,
|
|
161
|
-
max: e,
|
|
162
|
-
weekNumber: s,
|
|
163
|
-
focusedDate: l,
|
|
164
|
-
format: r,
|
|
165
|
-
mobileMode: n,
|
|
166
|
-
footerActions: d,
|
|
167
|
-
unstyled: v
|
|
168
|
-
} = this.props, m = v && v.uDateTimePicker, S = o(
|
|
158
|
+
const { disabled: a, min: t, max: e, weekNumber: s, focusedDate: l, format: r, mobileMode: n, footerActions: d, unstyled: v } = this.props, m = v && v.uDateTimePicker, S = o(
|
|
169
159
|
u.wrap({
|
|
170
160
|
c: m,
|
|
171
161
|
date: this.state.tab === "date",
|
|
@@ -184,36 +174,34 @@ const y = class y extends i.Component {
|
|
|
184
174
|
tabIndex: a || this.state.tab !== "date" ? -1 : void 0,
|
|
185
175
|
mobileMode: n
|
|
186
176
|
};
|
|
187
|
-
return /* @__PURE__ */ i.createElement(
|
|
177
|
+
return /* @__PURE__ */ i.createElement("div", { onKeyDown: this.handleKeyDown, className: S, tabIndex: -1 }, /* @__PURE__ */ i.createElement("div", { className: o(u.buttonGroup({ c: m })) }, /* @__PURE__ */ i.createElement(x, { width: "100%" }, /* @__PURE__ */ i.createElement(
|
|
178
|
+
f,
|
|
179
|
+
{
|
|
180
|
+
ref: (c) => this._dateButtonRef = c,
|
|
181
|
+
type: "button",
|
|
182
|
+
selected: this.state.tab === "date",
|
|
183
|
+
togglable: !0,
|
|
184
|
+
onClick: this.handleDateClick,
|
|
185
|
+
onKeyDown: this.handleDateKeyDown
|
|
186
|
+
},
|
|
187
|
+
K
|
|
188
|
+
), /* @__PURE__ */ i.createElement(
|
|
189
|
+
f,
|
|
190
|
+
{
|
|
191
|
+
type: "button",
|
|
192
|
+
selected: this.state.tab === "time",
|
|
193
|
+
togglable: !0,
|
|
194
|
+
onClick: this.handleTimeClick,
|
|
195
|
+
onKeyDown: this.handleTimeKeyDown
|
|
196
|
+
},
|
|
197
|
+
N
|
|
198
|
+
))), /* @__PURE__ */ i.createElement("div", { className: o(u.selector({ c: m })) }, /* @__PURE__ */ i.createElement(
|
|
188
199
|
"div",
|
|
189
200
|
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
tabIndex: -1
|
|
201
|
+
className: o(u.calendarWrap({ c: m })),
|
|
202
|
+
ref: (c) => this._calendarWrap = c
|
|
193
203
|
},
|
|
194
|
-
/* @__PURE__ */ i.createElement(
|
|
195
|
-
f,
|
|
196
|
-
{
|
|
197
|
-
ref: (c) => this._dateButtonRef = c,
|
|
198
|
-
type: "button",
|
|
199
|
-
selected: this.state.tab === "date",
|
|
200
|
-
togglable: !0,
|
|
201
|
-
onClick: this.handleDateClick,
|
|
202
|
-
onKeyDown: this.handleDateKeyDown
|
|
203
|
-
},
|
|
204
|
-
K
|
|
205
|
-
), /* @__PURE__ */ i.createElement(
|
|
206
|
-
f,
|
|
207
|
-
{
|
|
208
|
-
type: "button",
|
|
209
|
-
selected: this.state.tab === "time",
|
|
210
|
-
togglable: !0,
|
|
211
|
-
onClick: this.handleTimeClick,
|
|
212
|
-
onKeyDown: this.handleTimeKeyDown
|
|
213
|
-
},
|
|
214
|
-
N
|
|
215
|
-
))),
|
|
216
|
-
/* @__PURE__ */ i.createElement("div", { className: o(u.selector({ c: m })) }, /* @__PURE__ */ i.createElement("div", { className: o(u.calendarWrap({ c: m })), ref: (c) => this._calendarWrap = c }, this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { key: this.state.tab, ...C }) : /* @__PURE__ */ i.createElement(
|
|
204
|
+
this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { key: this.state.tab, ...C }) : /* @__PURE__ */ i.createElement(
|
|
217
205
|
A,
|
|
218
206
|
{
|
|
219
207
|
key: this.state.tab,
|
|
@@ -222,28 +210,27 @@ const y = class y extends i.Component {
|
|
|
222
210
|
},
|
|
223
211
|
...C
|
|
224
212
|
}
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
);
|
|
213
|
+
)
|
|
214
|
+
), /* @__PURE__ */ i.createElement("div", { className: o(u.timeWrap({ c: m })) }, /* @__PURE__ */ i.createElement("div", { className: o(u.timeSelector({ c: m, mobileMode: n })) }, /* @__PURE__ */ i.createElement(
|
|
215
|
+
z,
|
|
216
|
+
{
|
|
217
|
+
key: 1,
|
|
218
|
+
onNowClick: this.handleNowClick,
|
|
219
|
+
disabled: a || this.state.tab !== "time",
|
|
220
|
+
ref: (c) => {
|
|
221
|
+
this._timePart = c;
|
|
222
|
+
},
|
|
223
|
+
min: this.minTime || F,
|
|
224
|
+
max: this.maxTime || L,
|
|
225
|
+
steps: this.props.steps,
|
|
226
|
+
value: this.state.timeValue,
|
|
227
|
+
format: r,
|
|
228
|
+
onChange: this.handleTimeListContainerChange,
|
|
229
|
+
onMount: this.handleTimePartMount,
|
|
230
|
+
mobileMode: n,
|
|
231
|
+
unstyled: v
|
|
232
|
+
}
|
|
233
|
+
)))), d && this.dateTimeFooter());
|
|
247
234
|
}
|
|
248
235
|
get minTime() {
|
|
249
236
|
return this.props.minTime !== void 0 ? this.props.minTime : this.normalizeRange(this.props.min, this.state.dateValue);
|