@instructure/ui-date-input 8.50.1-snapshot-1 → 8.50.1-snapshot-13
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 +1 -1
- package/package.json +16 -16
- package/src/DateInput/README.md +22 -14
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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-13](https://github.com/instructure/instructure-ui/compare/v8.50.0...v8.50.1-snapshot-13) (2023-12-07)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-date-input
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-date-input",
|
|
3
|
-
"version": "8.50.1-snapshot-
|
|
3
|
+
"version": "8.50.1-snapshot-13",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,24 +23,24 @@
|
|
|
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-13",
|
|
27
|
+
"@instructure/ui-test-locator": "8.50.1-snapshot-13",
|
|
28
|
+
"@instructure/ui-test-utils": "8.50.1-snapshot-13"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.23.2",
|
|
32
|
-
"@instructure/emotion": "8.50.1-snapshot-
|
|
33
|
-
"@instructure/ui-calendar": "8.50.1-snapshot-
|
|
34
|
-
"@instructure/ui-form-field": "8.50.1-snapshot-
|
|
35
|
-
"@instructure/ui-icons": "8.50.1-snapshot-
|
|
36
|
-
"@instructure/ui-popover": "8.50.1-snapshot-
|
|
37
|
-
"@instructure/ui-position": "8.50.1-snapshot-
|
|
38
|
-
"@instructure/ui-prop-types": "8.50.1-snapshot-
|
|
39
|
-
"@instructure/ui-react-utils": "8.50.1-snapshot-
|
|
40
|
-
"@instructure/ui-selectable": "8.50.1-snapshot-
|
|
41
|
-
"@instructure/ui-testable": "8.50.1-snapshot-
|
|
42
|
-
"@instructure/ui-text-input": "8.50.1-snapshot-
|
|
43
|
-
"@instructure/ui-utils": "8.50.1-snapshot-
|
|
32
|
+
"@instructure/emotion": "8.50.1-snapshot-13",
|
|
33
|
+
"@instructure/ui-calendar": "8.50.1-snapshot-13",
|
|
34
|
+
"@instructure/ui-form-field": "8.50.1-snapshot-13",
|
|
35
|
+
"@instructure/ui-icons": "8.50.1-snapshot-13",
|
|
36
|
+
"@instructure/ui-popover": "8.50.1-snapshot-13",
|
|
37
|
+
"@instructure/ui-position": "8.50.1-snapshot-13",
|
|
38
|
+
"@instructure/ui-prop-types": "8.50.1-snapshot-13",
|
|
39
|
+
"@instructure/ui-react-utils": "8.50.1-snapshot-13",
|
|
40
|
+
"@instructure/ui-selectable": "8.50.1-snapshot-13",
|
|
41
|
+
"@instructure/ui-testable": "8.50.1-snapshot-13",
|
|
42
|
+
"@instructure/ui-text-input": "8.50.1-snapshot-13",
|
|
43
|
+
"@instructure/ui-utils": "8.50.1-snapshot-13",
|
|
44
44
|
"prop-types": "^15.8.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
package/src/DateInput/README.md
CHANGED
|
@@ -5,6 +5,7 @@ describes: DateInput
|
|
|
5
5
|
The `DateInput` component provides a visual interface for inputting date data.
|
|
6
6
|
|
|
7
7
|
### Composing a DateInput in your Application
|
|
8
|
+
|
|
8
9
|
`DateInput` uses `Calendar` internally. See [Calendar](#Calendar) for more detailed
|
|
9
10
|
documentation and guided examples. `DateInput` shares many of the same `Calendar`
|
|
10
11
|
props and it is created the same way with some additional attributes and callback
|
|
@@ -13,8 +14,7 @@ examples using [Moment.js](https://momentjs.com/docs/#/parsing/).
|
|
|
13
14
|
|
|
14
15
|
```javascript
|
|
15
16
|
---
|
|
16
|
-
|
|
17
|
-
render: false
|
|
17
|
+
type: example
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
class Example extends React.Component {
|
|
@@ -256,37 +256,45 @@ render(<Example />)
|
|
|
256
256
|
```
|
|
257
257
|
|
|
258
258
|
#### Some dates to keep track of
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
|
|
260
|
+
- `todayDate` - the date that represents today
|
|
261
|
+
- `selectedDate` - the user's selected date
|
|
262
|
+
- `renderedDate` - the date that the user is viewing as they navigate the `Calendar`
|
|
263
|
+
- `disabledDates` - any dates that are disabled
|
|
263
264
|
|
|
264
265
|
#### Rendering `DateInput.Day` children
|
|
266
|
+
|
|
265
267
|
`DateInput` accepts children of type `DateInput.Day`. Both `DateInput.Day` and
|
|
266
268
|
`Calendar.Day` are exporting the same `Day` component. The documentation for
|
|
267
269
|
`Day` can be found in [Calendar](#Calendar).
|
|
268
270
|
|
|
269
271
|
#### Handling onChange
|
|
272
|
+
|
|
270
273
|
When the `DateInput` fires an `onChange` event:
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
|
|
275
|
+
- The value should be updated and any messages should be cleared
|
|
276
|
+
- Verify if the value can be parsed as a date
|
|
277
|
+
- If it can be parsed, update the `selectedDate` and `renderedDate` with that date
|
|
278
|
+
- If it cannot be parsed, the `selectedDate` is set to null and the `renderedDate`
|
|
279
|
+
stays the same
|
|
276
280
|
|
|
277
281
|
#### Handling onRequestHideCalendar
|
|
282
|
+
|
|
278
283
|
When the `DateInput` fires `onRequestHideCalendar`:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
284
|
+
|
|
285
|
+
- The calendar should be hidden
|
|
286
|
+
- The value should be updated with a formatted version of the `selectedDate` if
|
|
287
|
+
it exists. See "Formatting user input" below
|
|
282
288
|
|
|
283
289
|
#### Formatting user input
|
|
290
|
+
|
|
284
291
|
Date formats can vary widely (ex. '8-9-19' vs '8/9/19'). When the `Calendar` is
|
|
285
292
|
hidden, the input value should be converted to a consistent, standardized format.
|
|
286
293
|
The formatted result of the raw input '8/9/19'
|
|
287
294
|
could be "August 9, 2019".
|
|
288
295
|
|
|
289
296
|
#### Handling onRequestValidateDate
|
|
297
|
+
|
|
290
298
|
When the `DateInput` fires `onRequestValidateDate`, the provided user input
|
|
291
299
|
should be validated. If the value cannot be parsed as a valid date, or if the
|
|
292
300
|
`selectedDate` is disabled, the user should be notified via the `messages` prop.
|