@instructure/ui-date-time-input 8.17.1-snapshot.21 → 8.17.1-snapshot.30
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/es/DateTimeInput/index.js +20 -26
- package/lib/DateTimeInput/index.js +20 -26
- package/package.json +19 -19
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -122,9 +122,7 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_temp = _class2 = class D
|
|
|
122
122
|
this.setState(newState);
|
|
123
123
|
|
|
124
124
|
if (this.props.onChange) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.props.onChange(e, (_newState$iso = newState.iso) === null || _newState$iso === void 0 ? void 0 : _newState$iso.toISOString());
|
|
125
|
+
this.props.onChange(e, newState.iso?.toISOString());
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
128
|
};
|
|
@@ -135,9 +133,7 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_temp = _class2 = class D
|
|
|
135
133
|
// The timeout gives it a moment for that to happen
|
|
136
134
|
if (typeof this.props.onBlur === 'function') {
|
|
137
135
|
window.setTimeout(() => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
(_this$props$onBlur = (_this$props = this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props, e);
|
|
136
|
+
this.props.onBlur?.(e);
|
|
141
137
|
}, 0);
|
|
142
138
|
}
|
|
143
139
|
};
|
|
@@ -241,8 +237,6 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_temp = _class2 = class D
|
|
|
241
237
|
const parsed = DateTime.parse(dateStr, this.locale(), this.timezone());
|
|
242
238
|
|
|
243
239
|
if (parsed.isValid()) {
|
|
244
|
-
var _this$state, _this$_timeInput;
|
|
245
|
-
|
|
246
240
|
if (doNotChangeTime && this.state.timeSelectValue) {
|
|
247
241
|
// There is a selected time, adjust the parsed date to its value
|
|
248
242
|
const timeParsed = DateTime.parse(this.state.timeSelectValue, this.locale(), this.timezone());
|
|
@@ -253,7 +247,7 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_temp = _class2 = class D
|
|
|
253
247
|
parsed.date(this.state.iso.date()).month(this.state.iso.month()).year(this.state.iso.year());
|
|
254
248
|
}
|
|
255
249
|
|
|
256
|
-
const newTimeSelectValue =
|
|
250
|
+
const newTimeSelectValue = this.state?.timeSelectValue ? this.state.timeSelectValue : this._timeInput?.getBaseDate().minute(parsed.minute()).hour(parsed.hour()).toISOString();
|
|
257
251
|
return {
|
|
258
252
|
iso: parsed.clone(),
|
|
259
253
|
calendarSelectedDate: parsed.clone(),
|
|
@@ -333,7 +327,7 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_temp = _class2 = class D
|
|
|
333
327
|
// if the text in the dateInput is not readable display error
|
|
334
328
|
newState = this.recalculateState(this.state.dateInputText, false, true);
|
|
335
329
|
} else {
|
|
336
|
-
newState = this.recalculateState(dateParsed
|
|
330
|
+
newState = this.recalculateState(dateParsed?.toISOString(), false, true);
|
|
337
331
|
}
|
|
338
332
|
|
|
339
333
|
this.changeStateIfNeeded(newState, event);
|
|
@@ -426,22 +420,22 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_temp = _class2 = class D
|
|
|
426
420
|
}
|
|
427
421
|
|
|
428
422
|
render() {
|
|
429
|
-
const _this$
|
|
430
|
-
description = _this$
|
|
431
|
-
datePlaceholder = _this$
|
|
432
|
-
dateRenderLabel = _this$
|
|
433
|
-
dateInputRef = _this$
|
|
434
|
-
timeRenderLabel = _this$
|
|
435
|
-
timeFormat = _this$
|
|
436
|
-
timeStep = _this$
|
|
437
|
-
timeInputRef = _this$
|
|
438
|
-
locale = _this$
|
|
439
|
-
timezone = _this$
|
|
440
|
-
messages = _this$
|
|
441
|
-
layout = _this$
|
|
442
|
-
isRequired = _this$
|
|
443
|
-
interaction = _this$
|
|
444
|
-
renderWeekdayLabels = _this$
|
|
423
|
+
const _this$props = this.props,
|
|
424
|
+
description = _this$props.description,
|
|
425
|
+
datePlaceholder = _this$props.datePlaceholder,
|
|
426
|
+
dateRenderLabel = _this$props.dateRenderLabel,
|
|
427
|
+
dateInputRef = _this$props.dateInputRef,
|
|
428
|
+
timeRenderLabel = _this$props.timeRenderLabel,
|
|
429
|
+
timeFormat = _this$props.timeFormat,
|
|
430
|
+
timeStep = _this$props.timeStep,
|
|
431
|
+
timeInputRef = _this$props.timeInputRef,
|
|
432
|
+
locale = _this$props.locale,
|
|
433
|
+
timezone = _this$props.timezone,
|
|
434
|
+
messages = _this$props.messages,
|
|
435
|
+
layout = _this$props.layout,
|
|
436
|
+
isRequired = _this$props.isRequired,
|
|
437
|
+
interaction = _this$props.interaction,
|
|
438
|
+
renderWeekdayLabels = _this$props.renderWeekdayLabels;
|
|
445
439
|
return /*#__PURE__*/React.createElement(FormFieldGroup, {
|
|
446
440
|
description: description,
|
|
447
441
|
colSpacing: "medium",
|
|
@@ -127,9 +127,7 @@ let DateTimeInput = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
127
127
|
this.setState(newState);
|
|
128
128
|
|
|
129
129
|
if (this.props.onChange) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.props.onChange(e, (_newState$iso = newState.iso) === null || _newState$iso === void 0 ? void 0 : _newState$iso.toISOString());
|
|
130
|
+
this.props.onChange(e, newState.iso?.toISOString());
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
133
|
};
|
|
@@ -140,9 +138,7 @@ let DateTimeInput = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
140
138
|
// The timeout gives it a moment for that to happen
|
|
141
139
|
if (typeof this.props.onBlur === 'function') {
|
|
142
140
|
window.setTimeout(() => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
(_this$props$onBlur = (_this$props = this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props, e);
|
|
141
|
+
this.props.onBlur?.(e);
|
|
146
142
|
}, 0);
|
|
147
143
|
}
|
|
148
144
|
};
|
|
@@ -246,8 +242,6 @@ let DateTimeInput = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
246
242
|
const parsed = _DateTime.DateTime.parse(dateStr, this.locale(), this.timezone());
|
|
247
243
|
|
|
248
244
|
if (parsed.isValid()) {
|
|
249
|
-
var _this$state, _this$_timeInput;
|
|
250
|
-
|
|
251
245
|
if (doNotChangeTime && this.state.timeSelectValue) {
|
|
252
246
|
// There is a selected time, adjust the parsed date to its value
|
|
253
247
|
const timeParsed = _DateTime.DateTime.parse(this.state.timeSelectValue, this.locale(), this.timezone());
|
|
@@ -259,7 +253,7 @@ let DateTimeInput = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
259
253
|
parsed.date(this.state.iso.date()).month(this.state.iso.month()).year(this.state.iso.year());
|
|
260
254
|
}
|
|
261
255
|
|
|
262
|
-
const newTimeSelectValue =
|
|
256
|
+
const newTimeSelectValue = this.state?.timeSelectValue ? this.state.timeSelectValue : this._timeInput?.getBaseDate().minute(parsed.minute()).hour(parsed.hour()).toISOString();
|
|
263
257
|
return {
|
|
264
258
|
iso: parsed.clone(),
|
|
265
259
|
calendarSelectedDate: parsed.clone(),
|
|
@@ -341,7 +335,7 @@ let DateTimeInput = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
341
335
|
// if the text in the dateInput is not readable display error
|
|
342
336
|
newState = this.recalculateState(this.state.dateInputText, false, true);
|
|
343
337
|
} else {
|
|
344
|
-
newState = this.recalculateState(dateParsed
|
|
338
|
+
newState = this.recalculateState(dateParsed?.toISOString(), false, true);
|
|
345
339
|
}
|
|
346
340
|
|
|
347
341
|
this.changeStateIfNeeded(newState, event);
|
|
@@ -437,22 +431,22 @@ let DateTimeInput = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
437
431
|
}
|
|
438
432
|
|
|
439
433
|
render() {
|
|
440
|
-
const _this$
|
|
441
|
-
description = _this$
|
|
442
|
-
datePlaceholder = _this$
|
|
443
|
-
dateRenderLabel = _this$
|
|
444
|
-
dateInputRef = _this$
|
|
445
|
-
timeRenderLabel = _this$
|
|
446
|
-
timeFormat = _this$
|
|
447
|
-
timeStep = _this$
|
|
448
|
-
timeInputRef = _this$
|
|
449
|
-
locale = _this$
|
|
450
|
-
timezone = _this$
|
|
451
|
-
messages = _this$
|
|
452
|
-
layout = _this$
|
|
453
|
-
isRequired = _this$
|
|
454
|
-
interaction = _this$
|
|
455
|
-
renderWeekdayLabels = _this$
|
|
434
|
+
const _this$props = this.props,
|
|
435
|
+
description = _this$props.description,
|
|
436
|
+
datePlaceholder = _this$props.datePlaceholder,
|
|
437
|
+
dateRenderLabel = _this$props.dateRenderLabel,
|
|
438
|
+
dateInputRef = _this$props.dateInputRef,
|
|
439
|
+
timeRenderLabel = _this$props.timeRenderLabel,
|
|
440
|
+
timeFormat = _this$props.timeFormat,
|
|
441
|
+
timeStep = _this$props.timeStep,
|
|
442
|
+
timeInputRef = _this$props.timeInputRef,
|
|
443
|
+
locale = _this$props.locale,
|
|
444
|
+
timezone = _this$props.timezone,
|
|
445
|
+
messages = _this$props.messages,
|
|
446
|
+
layout = _this$props.layout,
|
|
447
|
+
isRequired = _this$props.isRequired,
|
|
448
|
+
interaction = _this$props.interaction,
|
|
449
|
+
renderWeekdayLabels = _this$props.renderWeekdayLabels;
|
|
456
450
|
return /*#__PURE__*/_react.default.createElement(_FormFieldGroup.FormFieldGroup, {
|
|
457
451
|
description: description,
|
|
458
452
|
colSpacing: "medium",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-date-time-input",
|
|
3
|
-
"version": "8.17.1-snapshot.
|
|
3
|
+
"version": "8.17.1-snapshot.30+cb1322c25",
|
|
4
4
|
"description": "A UI component that allows to select date and time.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,26 +23,26 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.17.1-snapshot.
|
|
27
|
-
"@instructure/ui-test-locator": "8.17.1-snapshot.
|
|
28
|
-
"@instructure/ui-test-utils": "8.17.1-snapshot.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.17.1-snapshot.30+cb1322c25",
|
|
27
|
+
"@instructure/ui-test-locator": "8.17.1-snapshot.30+cb1322c25",
|
|
28
|
+
"@instructure/ui-test-utils": "8.17.1-snapshot.30+cb1322c25"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.13.10",
|
|
32
|
-
"@instructure/debounce": "8.17.1-snapshot.
|
|
33
|
-
"@instructure/emotion": "8.17.1-snapshot.
|
|
34
|
-
"@instructure/ui-a11y-content": "8.17.1-snapshot.
|
|
35
|
-
"@instructure/ui-buttons": "8.17.1-snapshot.
|
|
36
|
-
"@instructure/ui-calendar": "8.17.1-snapshot.
|
|
37
|
-
"@instructure/ui-date-input": "8.17.1-snapshot.
|
|
38
|
-
"@instructure/ui-form-field": "8.17.1-snapshot.
|
|
39
|
-
"@instructure/ui-i18n": "8.17.1-snapshot.
|
|
40
|
-
"@instructure/ui-icons": "8.17.1-snapshot.
|
|
41
|
-
"@instructure/ui-prop-types": "8.17.1-snapshot.
|
|
42
|
-
"@instructure/ui-react-utils": "8.17.1-snapshot.
|
|
43
|
-
"@instructure/ui-testable": "8.17.1-snapshot.
|
|
44
|
-
"@instructure/ui-time-select": "8.17.1-snapshot.
|
|
45
|
-
"@instructure/ui-utils": "8.17.1-snapshot.
|
|
32
|
+
"@instructure/debounce": "8.17.1-snapshot.30+cb1322c25",
|
|
33
|
+
"@instructure/emotion": "8.17.1-snapshot.30+cb1322c25",
|
|
34
|
+
"@instructure/ui-a11y-content": "8.17.1-snapshot.30+cb1322c25",
|
|
35
|
+
"@instructure/ui-buttons": "8.17.1-snapshot.30+cb1322c25",
|
|
36
|
+
"@instructure/ui-calendar": "8.17.1-snapshot.30+cb1322c25",
|
|
37
|
+
"@instructure/ui-date-input": "8.17.1-snapshot.30+cb1322c25",
|
|
38
|
+
"@instructure/ui-form-field": "8.17.1-snapshot.30+cb1322c25",
|
|
39
|
+
"@instructure/ui-i18n": "8.17.1-snapshot.30+cb1322c25",
|
|
40
|
+
"@instructure/ui-icons": "8.17.1-snapshot.30+cb1322c25",
|
|
41
|
+
"@instructure/ui-prop-types": "8.17.1-snapshot.30+cb1322c25",
|
|
42
|
+
"@instructure/ui-react-utils": "8.17.1-snapshot.30+cb1322c25",
|
|
43
|
+
"@instructure/ui-testable": "8.17.1-snapshot.30+cb1322c25",
|
|
44
|
+
"@instructure/ui-time-select": "8.17.1-snapshot.30+cb1322c25",
|
|
45
|
+
"@instructure/ui-utils": "8.17.1-snapshot.30+cb1322c25",
|
|
46
46
|
"prop-types": "^15"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "cb1322c25257139750149d7a817f1fb32571c1ed"
|
|
56
56
|
}
|