@dhis2-ui/calendar 9.12.0-alpha.4 → 10.0.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/cjs/calendar/calendar-table-cell.js +3 -3
- package/build/cjs/calendar/calendar-table.js +1 -1
- package/build/cjs/calendar/calendar.js +1 -1
- package/build/cjs/calendar-input/calendar-input.js +1 -1
- package/build/es/calendar/calendar-table-cell.js +3 -3
- package/build/es/calendar/calendar-table.js +1 -1
- package/build/es/calendar/calendar.js +1 -1
- package/build/es/calendar-input/calendar-input.js +1 -1
- package/package.json +9 -9
- package/types/index.d.ts +1 -1
@@ -20,14 +20,14 @@ const CalendarTableCell = _ref => {
|
|
20
20
|
const dayHoverBackgroundColor = _uiConstants.colors.grey200;
|
21
21
|
const selectedDayBackgroundColor = _uiConstants.colors.teal700;
|
22
22
|
return /*#__PURE__*/_react.default.createElement("td", {
|
23
|
-
"data-test": day === null || day === void 0 ? void 0 : day.
|
23
|
+
"data-test": day === null || day === void 0 ? void 0 : day.dateValue,
|
24
24
|
onClick: day.onClick,
|
25
25
|
className: _style.default.dynamic([["2052411850", [cellSize, cellSize, cellSize, cellSize, _uiConstants.colors.grey900, dayHoverBackgroundColor, _uiConstants.colors.grey300, selectedDayBackgroundColor, _uiConstants.colors.teal600, _uiConstants.colors.teal200, _uiConstants.colors.grey600]]])
|
26
26
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
27
27
|
name: "day",
|
28
28
|
tabIndex: unfocusable ? -1 : 0,
|
29
29
|
className: _style.default.dynamic([["2052411850", [cellSize, cellSize, cellSize, cellSize, _uiConstants.colors.grey900, dayHoverBackgroundColor, _uiConstants.colors.grey300, selectedDayBackgroundColor, _uiConstants.colors.teal600, _uiConstants.colors.teal200, _uiConstants.colors.grey600]]]) + " " + ((0, _classnames.default)('day', {
|
30
|
-
isSelected: selectedDate === (day === null || day === void 0 ? void 0 : day.
|
30
|
+
isSelected: selectedDate === (day === null || day === void 0 ? void 0 : day.dateValue),
|
31
31
|
isToday: day.isToday,
|
32
32
|
otherMonth: !day.isInCurrentMonth
|
33
33
|
}) || "")
|
@@ -40,7 +40,7 @@ exports.CalendarTableCell = CalendarTableCell;
|
|
40
40
|
CalendarTableCell.propTypes = {
|
41
41
|
cellSize: _propTypes.default.string,
|
42
42
|
day: _propTypes.default.shape({
|
43
|
-
|
43
|
+
dateValue: _propTypes.default.string,
|
44
44
|
isInCurrentMonth: _propTypes.default.bool,
|
45
45
|
isSelected: _propTypes.default.bool,
|
46
46
|
isToday: _propTypes.default.bool,
|
@@ -34,7 +34,7 @@ const CalendarTable = _ref => {
|
|
34
34
|
}, week.map(day => /*#__PURE__*/_react.default.createElement(_calendarTableCell.CalendarTableCell, {
|
35
35
|
selectedDate: selectedDate,
|
36
36
|
day: day,
|
37
|
-
key: day === null || day === void 0 ? void 0 : day.
|
37
|
+
key: day === null || day === void 0 ? void 0 : day.dateValue,
|
38
38
|
cellSize: cellSize,
|
39
39
|
width: width,
|
40
40
|
unfocusable: unfocusable
|
@@ -78,7 +78,7 @@ Calendar.defaultProps = {
|
|
78
78
|
const CalendarProps = exports.CalendarProps = {
|
79
79
|
/** the calendar to use such gregory, ethiopic, nepali - full supported list here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/calendars.ts */
|
80
80
|
calendar: _propTypes.default.any.isRequired,
|
81
|
-
/** Called with signature `(null)` \|\| `({ dateCalendarString: string
|
81
|
+
/** Called with signature `(null)` \|\| `({ dateCalendarString: string })` with `dateCalendarString` being the stringified date in the specified calendar in the format `yyyy-MM-dd` */
|
82
82
|
onDateSelect: _propTypes.default.func.isRequired,
|
83
83
|
/** the size of a single cell in the table forming the calendar */
|
84
84
|
cellSize: _propTypes.default.string,
|
@@ -177,7 +177,7 @@ CalendarInput.defaultProps = {
|
|
177
177
|
CalendarInput.propTypes = {
|
178
178
|
/** the calendar to use such gregory, ethiopic, nepali - full supported list here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/calendars.ts */
|
179
179
|
calendar: _propTypes.default.any.isRequired,
|
180
|
-
/** Called with signature `(null)` \|\| `({ dateCalendarString: string
|
180
|
+
/** Called with signature `(null)` \|\| `({ dateCalendarString: string })` with `dateCalendarString` being the stringified date in the specified calendar in the format `yyyy-MM-dd` */
|
181
181
|
onDateSelect: _propTypes.default.func.isRequired,
|
182
182
|
/** the size of a single cell in the table forming the calendar */
|
183
183
|
cellSize: _propTypes.default.string,
|
@@ -13,14 +13,14 @@ export const CalendarTableCell = _ref => {
|
|
13
13
|
const dayHoverBackgroundColor = colors.grey200;
|
14
14
|
const selectedDayBackgroundColor = colors.teal700;
|
15
15
|
return /*#__PURE__*/React.createElement("td", {
|
16
|
-
"data-test": day === null || day === void 0 ? void 0 : day.
|
16
|
+
"data-test": day === null || day === void 0 ? void 0 : day.dateValue,
|
17
17
|
onClick: day.onClick,
|
18
18
|
className: _JSXStyle.dynamic([["2052411850", [cellSize, cellSize, cellSize, cellSize, colors.grey900, dayHoverBackgroundColor, colors.grey300, selectedDayBackgroundColor, colors.teal600, colors.teal200, colors.grey600]]])
|
19
19
|
}, /*#__PURE__*/React.createElement("button", {
|
20
20
|
name: "day",
|
21
21
|
tabIndex: unfocusable ? -1 : 0,
|
22
22
|
className: _JSXStyle.dynamic([["2052411850", [cellSize, cellSize, cellSize, cellSize, colors.grey900, dayHoverBackgroundColor, colors.grey300, selectedDayBackgroundColor, colors.teal600, colors.teal200, colors.grey600]]]) + " " + (cx('day', {
|
23
|
-
isSelected: selectedDate === (day === null || day === void 0 ? void 0 : day.
|
23
|
+
isSelected: selectedDate === (day === null || day === void 0 ? void 0 : day.dateValue),
|
24
24
|
isToday: day.isToday,
|
25
25
|
otherMonth: !day.isInCurrentMonth
|
26
26
|
}) || "")
|
@@ -32,7 +32,7 @@ export const CalendarTableCell = _ref => {
|
|
32
32
|
CalendarTableCell.propTypes = {
|
33
33
|
cellSize: PropTypes.string,
|
34
34
|
day: PropTypes.shape({
|
35
|
-
|
35
|
+
dateValue: PropTypes.string,
|
36
36
|
isInCurrentMonth: PropTypes.bool,
|
37
37
|
isSelected: PropTypes.bool,
|
38
38
|
isToday: PropTypes.bool,
|
@@ -27,7 +27,7 @@ export const CalendarTable = _ref => {
|
|
27
27
|
}, week.map(day => /*#__PURE__*/React.createElement(CalendarTableCell, {
|
28
28
|
selectedDate: selectedDate,
|
29
29
|
day: day,
|
30
|
-
key: day === null || day === void 0 ? void 0 : day.
|
30
|
+
key: day === null || day === void 0 ? void 0 : day.dateValue,
|
31
31
|
cellSize: cellSize,
|
32
32
|
width: width,
|
33
33
|
unfocusable: unfocusable
|
@@ -68,7 +68,7 @@ Calendar.defaultProps = {
|
|
68
68
|
export const CalendarProps = {
|
69
69
|
/** the calendar to use such gregory, ethiopic, nepali - full supported list here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/calendars.ts */
|
70
70
|
calendar: PropTypes.any.isRequired,
|
71
|
-
/** Called with signature `(null)` \|\| `({ dateCalendarString: string
|
71
|
+
/** Called with signature `(null)` \|\| `({ dateCalendarString: string })` with `dateCalendarString` being the stringified date in the specified calendar in the format `yyyy-MM-dd` */
|
72
72
|
onDateSelect: PropTypes.func.isRequired,
|
73
73
|
/** the size of a single cell in the table forming the calendar */
|
74
74
|
cellSize: PropTypes.string,
|
@@ -167,7 +167,7 @@ CalendarInput.defaultProps = {
|
|
167
167
|
CalendarInput.propTypes = {
|
168
168
|
/** the calendar to use such gregory, ethiopic, nepali - full supported list here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/calendars.ts */
|
169
169
|
calendar: PropTypes.any.isRequired,
|
170
|
-
/** Called with signature `(null)` \|\| `({ dateCalendarString: string
|
170
|
+
/** Called with signature `(null)` \|\| `({ dateCalendarString: string })` with `dateCalendarString` being the stringified date in the specified calendar in the format `yyyy-MM-dd` */
|
171
171
|
onDateSelect: PropTypes.func.isRequired,
|
172
172
|
/** the size of a single cell in the table forming the calendar */
|
173
173
|
cellSize: PropTypes.string,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dhis2-ui/calendar",
|
3
|
-
"version": "
|
3
|
+
"version": "10.0.0-alpha.1",
|
4
4
|
"description": "UI Calendar",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -33,15 +33,15 @@
|
|
33
33
|
"styled-jsx": "^4"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@dhis2-ui/button": "
|
37
|
-
"@dhis2-ui/card": "
|
38
|
-
"@dhis2-ui/input": "
|
39
|
-
"@dhis2-ui/layer": "
|
40
|
-
"@dhis2-ui/popper": "
|
41
|
-
"@dhis2/multi-calendar-dates": "
|
36
|
+
"@dhis2-ui/button": "10.0.0-alpha.1",
|
37
|
+
"@dhis2-ui/card": "10.0.0-alpha.1",
|
38
|
+
"@dhis2-ui/input": "10.0.0-alpha.1",
|
39
|
+
"@dhis2-ui/layer": "10.0.0-alpha.1",
|
40
|
+
"@dhis2-ui/popper": "10.0.0-alpha.1",
|
41
|
+
"@dhis2/multi-calendar-dates": "2.0.0-alpha.1",
|
42
42
|
"@dhis2/prop-types": "^3.1.2",
|
43
|
-
"@dhis2/ui-constants": "
|
44
|
-
"@dhis2/ui-icons": "
|
43
|
+
"@dhis2/ui-constants": "10.0.0-alpha.1",
|
44
|
+
"@dhis2/ui-icons": "10.0.0-alpha.1",
|
45
45
|
"classnames": "^2.3.1",
|
46
46
|
"prop-types": "^15.7.2"
|
47
47
|
},
|
package/types/index.d.ts
CHANGED
@@ -13,7 +13,7 @@ export interface CalendarProps {
|
|
13
13
|
*/
|
14
14
|
calendar: CalendarPickerOptions['calendar']
|
15
15
|
/**
|
16
|
-
* Called with signature `(null)` \|\| `({ dateCalendarString: string
|
16
|
+
* Called with signature `(null)` \|\| `({ dateCalendarString: string })` with `dateCalendarString` being the stringified date in the specified calendar in the format `yyyy-MM-dd`
|
17
17
|
*/
|
18
18
|
onDateSelect: CalendarPickerParam['onDateSelect']
|
19
19
|
/**
|