@instructure/ui-date-input 10.26.1 → 11.0.0
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 +23 -2
- package/es/DateInput/index.js +9 -7
- package/es/DateInput/props.js +1 -44
- package/es/DateInput2/index.js +3 -3
- package/es/DateInput2/props.js +1 -51
- package/lib/DateInput/index.js +8 -6
- package/lib/DateInput/props.js +1 -46
- package/lib/DateInput2/index.js +3 -3
- package/lib/DateInput2/props.js +1 -53
- package/package.json +19 -22
- package/src/DateInput/index.tsx +5 -5
- package/src/DateInput/props.ts +6 -69
- package/src/DateInput2/index.tsx +3 -10
- package/src/DateInput2/props.ts +5 -46
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DateInput/index.d.ts +0 -45
- package/types/DateInput/index.d.ts.map +1 -1
- package/types/DateInput/props.d.ts +6 -9
- package/types/DateInput/props.d.ts.map +1 -1
- package/types/DateInput2/index.d.ts.map +1 -1
- package/types/DateInput2/props.d.ts +5 -10
- package/types/DateInput2/props.d.ts.map +1 -1
package/src/DateInput2/index.tsx
CHANGED
@@ -22,13 +22,7 @@
|
|
22
22
|
* SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
import {
|
26
|
-
useState,
|
27
|
-
useEffect,
|
28
|
-
forwardRef,
|
29
|
-
ForwardedRef,
|
30
|
-
ValidationMap
|
31
|
-
} from 'react'
|
25
|
+
import { useState, useEffect, forwardRef, ForwardedRef } from 'react'
|
32
26
|
import type { SyntheticEvent } from 'react'
|
33
27
|
import { Calendar } from '@instructure/ui-calendar'
|
34
28
|
import { IconButton } from '@instructure/ui-buttons'
|
@@ -42,7 +36,6 @@ import { TextInput } from '@instructure/ui-text-input'
|
|
42
36
|
import { callRenderProp, passthroughProps } from '@instructure/ui-react-utils'
|
43
37
|
import { getLocale, getTimezone } from '@instructure/ui-i18n'
|
44
38
|
|
45
|
-
import { propTypes } from './props'
|
46
39
|
import type { DateInput2Props } from './props'
|
47
40
|
import type { FormMessage } from '@instructure/ui-form-field'
|
48
41
|
import type { Moment } from '@instructure/ui-i18n'
|
@@ -130,7 +123,6 @@ function parseLocaleDate(
|
|
130
123
|
category: components
|
131
124
|
---
|
132
125
|
**/
|
133
|
-
// eslint-disable-next-line react/display-name
|
134
126
|
const DateInput2 = forwardRef(
|
135
127
|
(
|
136
128
|
{
|
@@ -341,7 +333,8 @@ const DateInput2 = forwardRef(
|
|
341
333
|
}
|
342
334
|
)
|
343
335
|
|
344
|
-
|
336
|
+
// TODO this is probably needed?
|
337
|
+
DateInput2.displayName = 'DateInput2'
|
345
338
|
|
346
339
|
export default DateInput2
|
347
340
|
export { DateInput2 }
|
package/src/DateInput2/props.ts
CHANGED
@@ -22,17 +22,9 @@
|
|
22
22
|
* SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
import PropTypes from 'prop-types'
|
26
25
|
import type { SyntheticEvent, InputHTMLAttributes } from 'react'
|
27
|
-
|
28
|
-
import { controllable } from '@instructure/ui-prop-types'
|
29
|
-
import { FormPropTypes } from '@instructure/ui-form-field'
|
30
26
|
import type { FormMessage } from '@instructure/ui-form-field'
|
31
|
-
import type {
|
32
|
-
OtherHTMLAttributes,
|
33
|
-
Renderable,
|
34
|
-
PropValidators
|
35
|
-
} from '@instructure/shared-types'
|
27
|
+
import type { OtherHTMLAttributes, Renderable } from '@instructure/shared-types'
|
36
28
|
import type { Spacing } from '@instructure/emotion'
|
37
29
|
|
38
30
|
type DateInput2OwnProps = {
|
@@ -90,12 +82,10 @@ type DateInput2OwnProps = {
|
|
90
82
|
*/
|
91
83
|
width?: string
|
92
84
|
/**
|
93
|
-
* Displays
|
94
|
-
*
|
95
|
-
*
|
96
|
-
*
|
97
|
-
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
98
|
-
* }`
|
85
|
+
* Displays informational and error messages, used for input validation,
|
86
|
+
* can also display screenreader-only messages.
|
87
|
+
* Also changes the border color of the component on success/error.
|
88
|
+
* This is automatically set to `invalidDateErrorMessage` when the date is invalid
|
99
89
|
*/
|
100
90
|
messages?: FormMessage[]
|
101
91
|
/**
|
@@ -188,40 +178,9 @@ type DateInput2OwnProps = {
|
|
188
178
|
inputRef?: (inputElement: HTMLInputElement | null) => void
|
189
179
|
}
|
190
180
|
|
191
|
-
type PropKeys = keyof DateInput2OwnProps
|
192
|
-
|
193
181
|
type DateInput2Props = DateInput2OwnProps &
|
194
182
|
OtherHTMLAttributes<
|
195
183
|
DateInput2OwnProps,
|
196
184
|
InputHTMLAttributes<DateInput2OwnProps & Element>
|
197
185
|
>
|
198
|
-
|
199
|
-
const propTypes: PropValidators<PropKeys> = {
|
200
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
201
|
-
screenReaderLabels: PropTypes.object.isRequired,
|
202
|
-
value: controllable(PropTypes.string),
|
203
|
-
placeholder: PropTypes.string,
|
204
|
-
onChange: PropTypes.func,
|
205
|
-
onBlur: PropTypes.func,
|
206
|
-
interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
|
207
|
-
isRequired: PropTypes.bool,
|
208
|
-
isInline: PropTypes.bool,
|
209
|
-
width: PropTypes.string,
|
210
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
211
|
-
invalidDateErrorMessage: PropTypes.oneOfType([
|
212
|
-
PropTypes.func,
|
213
|
-
PropTypes.string
|
214
|
-
]),
|
215
|
-
locale: PropTypes.string,
|
216
|
-
timezone: PropTypes.string,
|
217
|
-
withYearPicker: PropTypes.object,
|
218
|
-
dateFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
219
|
-
onRequestValidateDate: PropTypes.func,
|
220
|
-
renderCalendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
221
|
-
margin: PropTypes.string,
|
222
|
-
disabledDates: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
|
223
|
-
inputRef: PropTypes.func
|
224
|
-
}
|
225
|
-
|
226
186
|
export type { DateInput2Props }
|
227
|
-
export { propTypes }
|
package/tsconfig.build.json
CHANGED
@@ -15,11 +15,9 @@
|
|
15
15
|
{ "path": "../ui-icons/tsconfig.build.json" },
|
16
16
|
{ "path": "../ui-popover/tsconfig.build.json" },
|
17
17
|
{ "path": "../ui-position/tsconfig.build.json" },
|
18
|
-
{ "path": "../ui-prop-types/tsconfig.build.json" },
|
19
18
|
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
20
19
|
{ "path": "../ui-selectable/tsconfig.build.json" },
|
21
20
|
{ "path": "../shared-types/tsconfig.build.json" },
|
22
|
-
{ "path": "../ui-testable/tsconfig.build.json" },
|
23
21
|
{ "path": "../ui-text-input/tsconfig.build.json" },
|
24
22
|
{ "path": "../ui-utils/tsconfig.build.json" },
|
25
23
|
{ "path": "../ui-i18n/tsconfig.build.json" },
|