@instructure/ui-date-time-input 8.50.1-snapshot-16 → 8.50.1-snapshot-17
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/CHANGELOG.md +5 -2
- package/es/DateTimeInput/index.js +3 -1
- package/es/DateTimeInput/props.js +2 -1
- package/lib/DateTimeInput/index.js +3 -1
- package/lib/DateTimeInput/props.js +2 -1
- package/package.json +18 -18
- package/src/DateTimeInput/index.tsx +3 -1
- package/src/DateTimeInput/props.ts +10 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DateTimeInput/index.d.ts +1 -0
- package/types/DateTimeInput/index.d.ts.map +1 -1
- package/types/DateTimeInput/props.d.ts +8 -1
- package/types/DateTimeInput/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [8.50.1-snapshot-
|
|
6
|
+
## [8.50.1-snapshot-17](https://github.com/instructure/instructure-ui/compare/v8.50.0...v8.50.1-snapshot-17) (2023-12-11)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **ui-date-time-input:** add showMessages prop ([5212a19](https://github.com/instructure/instructure-ui/commit/5212a192b56fed621c80a697579fc164f9592391))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -413,6 +413,7 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_class2 = class DateTimeI
|
|
|
413
413
|
timeInputRef = _this$props3.timeInputRef,
|
|
414
414
|
locale = _this$props3.locale,
|
|
415
415
|
timezone = _this$props3.timezone,
|
|
416
|
+
showMessages = _this$props3.showMessages,
|
|
416
417
|
messages = _this$props3.messages,
|
|
417
418
|
layout = _this$props3.layout,
|
|
418
419
|
rowSpacing = _this$props3.rowSpacing,
|
|
@@ -428,7 +429,7 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_class2 = class DateTimeI
|
|
|
428
429
|
colSpacing: colSpacing,
|
|
429
430
|
vAlign: "top",
|
|
430
431
|
elementRef: this.handleRef,
|
|
431
|
-
messages: [...(this.state.message ? [this.state.message] : []), ...(messages || [])]
|
|
432
|
+
messages: [...(showMessages && this.state.message ? [this.state.message] : []), ...(messages || [])]
|
|
432
433
|
}, /*#__PURE__*/React.createElement(DateInput, {
|
|
433
434
|
display: "block",
|
|
434
435
|
value: this.state.dateInputText,
|
|
@@ -469,6 +470,7 @@ let DateTimeInput = (_dec = testable(), _dec(_class = (_class2 = class DateTimeI
|
|
|
469
470
|
colSpacing: 'medium',
|
|
470
471
|
rowSpacing: 'small',
|
|
471
472
|
timeStep: 30,
|
|
473
|
+
showMessages: true,
|
|
472
474
|
messageFormat: _class2.DEFAULT_MESSAGE_FORMAT,
|
|
473
475
|
isRequired: false,
|
|
474
476
|
dateFormat: 'LL',
|
|
@@ -40,6 +40,7 @@ const propTypes = {
|
|
|
40
40
|
locale: PropTypes.string,
|
|
41
41
|
timezone: PropTypes.string,
|
|
42
42
|
invalidDateTimeMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
|
43
|
+
showMessages: PropTypes.bool,
|
|
43
44
|
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
44
45
|
messageFormat: PropTypes.string,
|
|
45
46
|
layout: PropTypes.oneOf(['stacked', 'columns', 'inline']),
|
|
@@ -57,5 +58,5 @@ const propTypes = {
|
|
|
57
58
|
disabledDateTimeMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
58
59
|
allowNonStepInput: PropTypes.bool
|
|
59
60
|
};
|
|
60
|
-
const allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput'];
|
|
61
|
+
const allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'showMessages', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput'];
|
|
61
62
|
export { propTypes, allowedProps };
|
|
@@ -421,6 +421,7 @@ let DateTimeInput = exports.DateTimeInput = (_dec = (0, _testable.testable)(), _
|
|
|
421
421
|
timeInputRef = _this$props3.timeInputRef,
|
|
422
422
|
locale = _this$props3.locale,
|
|
423
423
|
timezone = _this$props3.timezone,
|
|
424
|
+
showMessages = _this$props3.showMessages,
|
|
424
425
|
messages = _this$props3.messages,
|
|
425
426
|
layout = _this$props3.layout,
|
|
426
427
|
rowSpacing = _this$props3.rowSpacing,
|
|
@@ -436,7 +437,7 @@ let DateTimeInput = exports.DateTimeInput = (_dec = (0, _testable.testable)(), _
|
|
|
436
437
|
colSpacing: colSpacing,
|
|
437
438
|
vAlign: "top",
|
|
438
439
|
elementRef: this.handleRef,
|
|
439
|
-
messages: [...(this.state.message ? [this.state.message] : []), ...(messages || [])]
|
|
440
|
+
messages: [...(showMessages && this.state.message ? [this.state.message] : []), ...(messages || [])]
|
|
440
441
|
}, /*#__PURE__*/_react.default.createElement(_DateInput.DateInput, {
|
|
441
442
|
display: "block",
|
|
442
443
|
value: this.state.dateInputText,
|
|
@@ -477,6 +478,7 @@ let DateTimeInput = exports.DateTimeInput = (_dec = (0, _testable.testable)(), _
|
|
|
477
478
|
colSpacing: 'medium',
|
|
478
479
|
rowSpacing: 'small',
|
|
479
480
|
timeStep: 30,
|
|
481
|
+
showMessages: true,
|
|
480
482
|
messageFormat: _class2.DEFAULT_MESSAGE_FORMAT,
|
|
481
483
|
isRequired: false,
|
|
482
484
|
dateFormat: 'LL',
|
|
@@ -47,6 +47,7 @@ const propTypes = exports.propTypes = {
|
|
|
47
47
|
locale: _propTypes.default.string,
|
|
48
48
|
timezone: _propTypes.default.string,
|
|
49
49
|
invalidDateTimeMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]).isRequired,
|
|
50
|
+
showMessages: _propTypes.default.bool,
|
|
50
51
|
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
|
51
52
|
messageFormat: _propTypes.default.string,
|
|
52
53
|
layout: _propTypes.default.oneOf(['stacked', 'columns', 'inline']),
|
|
@@ -64,4 +65,4 @@ const propTypes = exports.propTypes = {
|
|
|
64
65
|
disabledDateTimeMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
|
|
65
66
|
allowNonStepInput: _propTypes.default.bool
|
|
66
67
|
};
|
|
67
|
-
const allowedProps = exports.allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput'];
|
|
68
|
+
const allowedProps = exports.allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'showMessages', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-date-time-input",
|
|
3
|
-
"version": "8.50.1-snapshot-
|
|
3
|
+
"version": "8.50.1-snapshot-17",
|
|
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.50.1-snapshot-
|
|
27
|
-
"@instructure/ui-test-locator": "8.50.1-snapshot-
|
|
28
|
-
"@instructure/ui-test-utils": "8.50.1-snapshot-
|
|
26
|
+
"@instructure/ui-babel-preset": "8.50.1-snapshot-17",
|
|
27
|
+
"@instructure/ui-test-locator": "8.50.1-snapshot-17",
|
|
28
|
+
"@instructure/ui-test-utils": "8.50.1-snapshot-17"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.23.2",
|
|
32
|
-
"@instructure/debounce": "8.50.1-snapshot-
|
|
33
|
-
"@instructure/emotion": "8.50.1-snapshot-
|
|
34
|
-
"@instructure/ui-a11y-content": "8.50.1-snapshot-
|
|
35
|
-
"@instructure/ui-buttons": "8.50.1-snapshot-
|
|
36
|
-
"@instructure/ui-calendar": "8.50.1-snapshot-
|
|
37
|
-
"@instructure/ui-date-input": "8.50.1-snapshot-
|
|
38
|
-
"@instructure/ui-form-field": "8.50.1-snapshot-
|
|
39
|
-
"@instructure/ui-i18n": "8.50.1-snapshot-
|
|
40
|
-
"@instructure/ui-icons": "8.50.1-snapshot-
|
|
41
|
-
"@instructure/ui-prop-types": "8.50.1-snapshot-
|
|
42
|
-
"@instructure/ui-react-utils": "8.50.1-snapshot-
|
|
43
|
-
"@instructure/ui-testable": "8.50.1-snapshot-
|
|
44
|
-
"@instructure/ui-time-select": "8.50.1-snapshot-
|
|
45
|
-
"@instructure/ui-utils": "8.50.1-snapshot-
|
|
32
|
+
"@instructure/debounce": "8.50.1-snapshot-17",
|
|
33
|
+
"@instructure/emotion": "8.50.1-snapshot-17",
|
|
34
|
+
"@instructure/ui-a11y-content": "8.50.1-snapshot-17",
|
|
35
|
+
"@instructure/ui-buttons": "8.50.1-snapshot-17",
|
|
36
|
+
"@instructure/ui-calendar": "8.50.1-snapshot-17",
|
|
37
|
+
"@instructure/ui-date-input": "8.50.1-snapshot-17",
|
|
38
|
+
"@instructure/ui-form-field": "8.50.1-snapshot-17",
|
|
39
|
+
"@instructure/ui-i18n": "8.50.1-snapshot-17",
|
|
40
|
+
"@instructure/ui-icons": "8.50.1-snapshot-17",
|
|
41
|
+
"@instructure/ui-prop-types": "8.50.1-snapshot-17",
|
|
42
|
+
"@instructure/ui-react-utils": "8.50.1-snapshot-17",
|
|
43
|
+
"@instructure/ui-testable": "8.50.1-snapshot-17",
|
|
44
|
+
"@instructure/ui-time-select": "8.50.1-snapshot-17",
|
|
45
|
+
"@instructure/ui-utils": "8.50.1-snapshot-17",
|
|
46
46
|
"prop-types": "^15.8.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -57,6 +57,7 @@ class DateTimeInput extends Component<DateTimeInputProps, DateTimeInputState> {
|
|
|
57
57
|
colSpacing: 'medium',
|
|
58
58
|
rowSpacing: 'small',
|
|
59
59
|
timeStep: 30,
|
|
60
|
+
showMessages: true,
|
|
60
61
|
messageFormat: DateTimeInput.DEFAULT_MESSAGE_FORMAT,
|
|
61
62
|
isRequired: false,
|
|
62
63
|
dateFormat: 'LL', // Localized date with full month, e.g. "August 6, 2014"
|
|
@@ -517,6 +518,7 @@ class DateTimeInput extends Component<DateTimeInputProps, DateTimeInputState> {
|
|
|
517
518
|
timeInputRef,
|
|
518
519
|
locale,
|
|
519
520
|
timezone,
|
|
521
|
+
showMessages,
|
|
520
522
|
messages,
|
|
521
523
|
layout,
|
|
522
524
|
rowSpacing,
|
|
@@ -536,7 +538,7 @@ class DateTimeInput extends Component<DateTimeInputProps, DateTimeInputState> {
|
|
|
536
538
|
vAlign="top"
|
|
537
539
|
elementRef={this.handleRef}
|
|
538
540
|
messages={[
|
|
539
|
-
...(this.state.message ? [this.state.message] : []),
|
|
541
|
+
...(showMessages && this.state.message ? [this.state.message] : []),
|
|
540
542
|
...(messages || [])
|
|
541
543
|
]}
|
|
542
544
|
>
|
|
@@ -122,7 +122,14 @@ type DateTimeInputProps = {
|
|
|
122
122
|
**/
|
|
123
123
|
invalidDateTimeMessage: string | ((rawDateValue: string) => string)
|
|
124
124
|
/**
|
|
125
|
-
*
|
|
125
|
+
* Toggles whether to show built-in messages (the date/time, or the
|
|
126
|
+
* `invalidDateTimeMessage`). Even when set to `false` the component will
|
|
127
|
+
* show user supplied messages by the `messages` prop.
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
showMessages?: boolean
|
|
131
|
+
/**
|
|
132
|
+
* Extra message(s) to be displayed.
|
|
126
133
|
*/
|
|
127
134
|
messages?: FormMessage[]
|
|
128
135
|
/**
|
|
@@ -275,6 +282,7 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
275
282
|
PropTypes.string,
|
|
276
283
|
PropTypes.func
|
|
277
284
|
]).isRequired,
|
|
285
|
+
showMessages: PropTypes.bool,
|
|
278
286
|
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
279
287
|
messageFormat: PropTypes.string,
|
|
280
288
|
layout: PropTypes.oneOf(['stacked', 'columns', 'inline']),
|
|
@@ -315,6 +323,7 @@ const allowedProps: AllowedPropKeys = [
|
|
|
315
323
|
'locale',
|
|
316
324
|
'timezone',
|
|
317
325
|
'invalidDateTimeMessage',
|
|
326
|
+
'showMessages',
|
|
318
327
|
'messages',
|
|
319
328
|
'messageFormat',
|
|
320
329
|
'layout',
|