@instructure/ui-calendar 10.2.1 → 10.2.2-pr-snapshot-1725623316857
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 +8 -0
- package/package.json +20 -20
- package/src/Calendar/README.md +112 -56
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [10.2.2-pr-snapshot-1725623316857](https://github.com/instructure/instructure-ui/compare/v10.2.1...v10.2.2-pr-snapshot-1725623316857) (2024-09-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-calendar
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [10.2.1](https://github.com/instructure/instructure-ui/compare/v10.2.0...v10.2.1) (2024-08-30)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-calendar
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-calendar",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.2-pr-snapshot-1725623316857",
|
|
4
4
|
"description": "A calendar component.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,31 +23,31 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "10.2.
|
|
27
|
-
"@instructure/ui-color-utils": "10.2.
|
|
28
|
-
"@instructure/ui-test-locator": "10.2.
|
|
29
|
-
"@instructure/ui-test-utils": "10.2.
|
|
30
|
-
"@instructure/ui-themes": "10.2.
|
|
26
|
+
"@instructure/ui-babel-preset": "10.2.2-pr-snapshot-1725623316857",
|
|
27
|
+
"@instructure/ui-color-utils": "10.2.2-pr-snapshot-1725623316857",
|
|
28
|
+
"@instructure/ui-test-locator": "10.2.2-pr-snapshot-1725623316857",
|
|
29
|
+
"@instructure/ui-test-utils": "10.2.2-pr-snapshot-1725623316857",
|
|
30
|
+
"@instructure/ui-themes": "10.2.2-pr-snapshot-1725623316857",
|
|
31
31
|
"@testing-library/jest-dom": "^6.4.6",
|
|
32
32
|
"@testing-library/react": "^15.0.7",
|
|
33
33
|
"vitest": "^2.0.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.24.5",
|
|
37
|
-
"@instructure/console": "10.2.
|
|
38
|
-
"@instructure/emotion": "10.2.
|
|
39
|
-
"@instructure/shared-types": "10.2.
|
|
40
|
-
"@instructure/ui-a11y-content": "10.2.
|
|
41
|
-
"@instructure/ui-buttons": "10.2.
|
|
42
|
-
"@instructure/ui-i18n": "10.2.
|
|
43
|
-
"@instructure/ui-icons": "10.2.
|
|
44
|
-
"@instructure/ui-prop-types": "10.2.
|
|
45
|
-
"@instructure/ui-react-utils": "10.2.
|
|
46
|
-
"@instructure/ui-simple-select": "10.2.
|
|
47
|
-
"@instructure/ui-testable": "10.2.
|
|
48
|
-
"@instructure/ui-utils": "10.2.
|
|
49
|
-
"@instructure/ui-view": "10.2.
|
|
50
|
-
"@instructure/uid": "10.2.
|
|
37
|
+
"@instructure/console": "10.2.2-pr-snapshot-1725623316857",
|
|
38
|
+
"@instructure/emotion": "10.2.2-pr-snapshot-1725623316857",
|
|
39
|
+
"@instructure/shared-types": "10.2.2-pr-snapshot-1725623316857",
|
|
40
|
+
"@instructure/ui-a11y-content": "10.2.2-pr-snapshot-1725623316857",
|
|
41
|
+
"@instructure/ui-buttons": "10.2.2-pr-snapshot-1725623316857",
|
|
42
|
+
"@instructure/ui-i18n": "10.2.2-pr-snapshot-1725623316857",
|
|
43
|
+
"@instructure/ui-icons": "10.2.2-pr-snapshot-1725623316857",
|
|
44
|
+
"@instructure/ui-prop-types": "10.2.2-pr-snapshot-1725623316857",
|
|
45
|
+
"@instructure/ui-react-utils": "10.2.2-pr-snapshot-1725623316857",
|
|
46
|
+
"@instructure/ui-simple-select": "10.2.2-pr-snapshot-1725623316857",
|
|
47
|
+
"@instructure/ui-testable": "10.2.2-pr-snapshot-1725623316857",
|
|
48
|
+
"@instructure/ui-utils": "10.2.2-pr-snapshot-1725623316857",
|
|
49
|
+
"@instructure/ui-view": "10.2.2-pr-snapshot-1725623316857",
|
|
50
|
+
"@instructure/uid": "10.2.2-pr-snapshot-1725623316857",
|
|
51
51
|
"prop-types": "^15.8.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
package/src/Calendar/README.md
CHANGED
|
@@ -19,71 +19,127 @@ type: example
|
|
|
19
19
|
|
|
20
20
|
### Default config with additional props
|
|
21
21
|
|
|
22
|
-
```js
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
state = {
|
|
28
|
-
selectedDate: "",
|
|
29
|
-
visibleMonth:"2025-05"
|
|
22
|
+
- ```js
|
|
23
|
+
class Example extends React.Component {
|
|
24
|
+
state = {
|
|
25
|
+
selectedDate: '',
|
|
26
|
+
visibleMonth: '2025-05'
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
render = () => (
|
|
30
|
+
<Calendar
|
|
31
|
+
visibleMonth={this.state.visibleMonth}
|
|
32
|
+
currentDate="2023-12-15"
|
|
33
|
+
disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
|
|
34
|
+
selectedDate={this.state.selectedDate}
|
|
35
|
+
onRequestRenderNextMonth={(_e, requestedMonth) =>
|
|
36
|
+
this.setState({ visibleMonth: requestedMonth })
|
|
37
|
+
}
|
|
38
|
+
onRequestRenderPrevMonth={(_e, requestedMonth) =>
|
|
39
|
+
this.setState({ visibleMonth: requestedMonth })
|
|
40
|
+
}
|
|
41
|
+
onDateSelected={(date) => {
|
|
42
|
+
this.setState({ selectedDate: date })
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
34
46
|
}
|
|
35
|
-
render
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
render(<Example />)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- ```js
|
|
51
|
+
const Example = () => {
|
|
52
|
+
const [selectedDate, setSelectedDate] = useState('')
|
|
53
|
+
const [visibleMonth, setVisibleMonth] = useState('2025-05')
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Calendar
|
|
57
|
+
visibleMonth={visibleMonth}
|
|
58
|
+
currentDate="2023-12-15"
|
|
59
|
+
disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
|
|
60
|
+
selectedDate={selectedDate}
|
|
61
|
+
onRequestRenderNextMonth={(_e, requestedMonth) =>
|
|
62
|
+
setVisibleMonth(requestedMonth)
|
|
63
|
+
}
|
|
64
|
+
onRequestRenderPrevMonth={(_e, requestedMonth) =>
|
|
65
|
+
setVisibleMonth(requestedMonth)
|
|
66
|
+
}
|
|
67
|
+
onDateSelected={(date) => {
|
|
68
|
+
setSelectedDate(date)
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
render(<Example />)
|
|
74
|
+
```
|
|
50
75
|
|
|
51
76
|
### With year picker
|
|
52
77
|
|
|
53
|
-
```js
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
state = {
|
|
59
|
-
selectedDate: "",
|
|
60
|
-
visibleMonth:"2024-02"
|
|
78
|
+
- ```js
|
|
79
|
+
class Example extends React.Component {
|
|
80
|
+
state = {
|
|
81
|
+
selectedDate: '',
|
|
82
|
+
visibleMonth: '2024-02'
|
|
61
83
|
}
|
|
62
84
|
|
|
63
|
-
|
|
64
|
-
|
|
85
|
+
render = () => (
|
|
86
|
+
<Calendar
|
|
87
|
+
visibleMonth={this.state.visibleMonth}
|
|
88
|
+
currentDate="2024-02-29"
|
|
89
|
+
disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
|
|
90
|
+
selectedDate={this.state.selectedDate}
|
|
91
|
+
onRequestRenderNextMonth={(_e, requestedMonth) =>
|
|
92
|
+
this.setState({ visibleMonth: requestedMonth })
|
|
93
|
+
}
|
|
94
|
+
onRequestRenderPrevMonth={(_e, requestedMonth) =>
|
|
95
|
+
this.setState({ visibleMonth: requestedMonth })
|
|
96
|
+
}
|
|
97
|
+
onDateSelected={(date) => {
|
|
98
|
+
this.setState({ selectedDate: date })
|
|
99
|
+
}}
|
|
100
|
+
withYearPicker={{
|
|
101
|
+
screenReaderLabel: 'Year picker',
|
|
102
|
+
startYear: 1999,
|
|
103
|
+
endYear: 2024,
|
|
104
|
+
maxHeight: '200px'
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
65
108
|
}
|
|
66
|
-
render
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
109
|
+
render(<Example />)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
- ```js
|
|
113
|
+
const Example = () => {
|
|
114
|
+
const [selectedDate, setSelectedDate] = useState('')
|
|
115
|
+
const [visibleMonth, setVisibleMonth] = useState('2024-02')
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<Calendar
|
|
119
|
+
visibleMonth={visibleMonth}
|
|
120
|
+
currentDate="2024-02-29"
|
|
121
|
+
disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
|
|
122
|
+
selectedDate={selectedDate}
|
|
123
|
+
onRequestRenderNextMonth={(_e, requestedMonth) =>
|
|
124
|
+
setVisibleMonth(requestedMonth)
|
|
125
|
+
}
|
|
126
|
+
onRequestRenderPrevMonth={(_e, requestedMonth) =>
|
|
127
|
+
setVisibleMonth(requestedMonth)
|
|
128
|
+
}
|
|
129
|
+
onDateSelected={(date) => {
|
|
130
|
+
setSelectedDate(date)
|
|
131
|
+
}}
|
|
132
|
+
withYearPicker={{
|
|
133
|
+
screenReaderLabel: 'Year picker',
|
|
134
|
+
startYear: 1999,
|
|
135
|
+
endYear: 2024,
|
|
136
|
+
maxHeight: '200px'
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
render(<Example />)
|
|
142
|
+
```
|
|
87
143
|
|
|
88
144
|
### Composing a Calendar in your Application
|
|
89
145
|
|