@dhis2-ui/calendar 9.10.3 → 9.11.1-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/cjs/__e2e__/{calendar-input.stories.e2e.js → calendar-input.e2e.stories.js} +11 -20
- package/build/cjs/calendar/calendar-table-cell.js +2 -10
- package/build/cjs/calendar/calendar-table-days-header.js +3 -10
- package/build/cjs/calendar/calendar-table.js +3 -12
- package/build/cjs/calendar/calendar.js +5 -27
- package/build/cjs/calendar/navigation-container.js +9 -19
- package/build/cjs/calendar-input/calendar-input.js +6 -26
- package/build/cjs/features/supports_calendar_clear_button/supports_calendar_clear_button.js +1 -2
- package/build/cjs/features/supports_ethiopic_calendar/supports_ethiopic_calendar.js +2 -3
- package/build/cjs/features/supports_gregorian_calendar/supports_gregorian_calendar.js +2 -3
- package/build/cjs/features/supports_islamic_calendar/supports_islamic_calendar.js +1 -2
- package/build/cjs/features/supports_nepali_calendar/supports_nepali_calendar.js +3 -3
- package/build/cjs/index.js +0 -2
- package/build/cjs/locales/index.js +3 -9
- package/build/cjs/stories/{calendar-input.stories.js → calendar-input.prod.stories.js} +19 -34
- package/build/cjs/stories/calendar-story-wrapper.js +4 -23
- package/build/cjs/stories/{calendar.stories.js → calendar.prod.stories.js} +13 -18
- package/build/es/__e2e__/{calendar-input.stories.e2e.js → calendar-input.e2e.stories.js} +2 -3
- package/build/es/calendar/calendar-table-cell.js +1 -1
- package/build/es/calendar/calendar-table-days-header.js +2 -2
- package/build/es/calendar/calendar-table.js +2 -2
- package/build/es/calendar/calendar.js +1 -10
- package/build/es/calendar/navigation-container.js +8 -8
- package/build/es/calendar-input/calendar-input.js +3 -7
- package/build/es/features/supports_calendar_clear_button/supports_calendar_clear_button.js +1 -1
- package/build/es/features/supports_ethiopic_calendar/supports_ethiopic_calendar.js +2 -2
- package/build/es/features/supports_gregorian_calendar/supports_gregorian_calendar.js +2 -2
- package/build/es/features/supports_islamic_calendar/supports_islamic_calendar.js +1 -1
- package/build/es/features/supports_nepali_calendar/supports_nepali_calendar.js +3 -2
- package/build/es/stories/{calendar-input.stories.js → calendar-input.prod.stories.js} +10 -8
- package/build/es/stories/calendar-story-wrapper.js +1 -10
- package/build/es/stories/{calendar.stories.js → calendar.prod.stories.js} +11 -4
- package/package.json +11 -11
@@ -1,8 +1,16 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { CalendarInput } from '../calendar-input/calendar-input.js';
|
3
3
|
import { CalendarStoryWrapper } from './calendar-story-wrapper.js';
|
4
|
-
const subtitle =
|
5
|
-
const description =
|
4
|
+
const subtitle = `[Experimental] Calendar Input is a wrapper around Calendar displaying an input that triggers the calendar`;
|
5
|
+
const description = `
|
6
|
+
Use a CalendarInput where there is a need to let the user input a date.
|
7
|
+
|
8
|
+
Note that it requires a parent, like [Box](../?path=/docs/layout-box--default), to define its size.
|
9
|
+
|
10
|
+
\`\`\`js
|
11
|
+
import { CalendarInput } from '@dhis2/ui'
|
12
|
+
\`\`\`
|
13
|
+
`;
|
6
14
|
export default {
|
7
15
|
title: 'CalendarInput',
|
8
16
|
component: CalendarInput,
|
@@ -15,7 +23,6 @@ export default {
|
|
15
23
|
}
|
16
24
|
}
|
17
25
|
};
|
18
|
-
|
19
26
|
const buildCalendar = _ref => {
|
20
27
|
let {
|
21
28
|
date,
|
@@ -33,31 +40,26 @@ const buildCalendar = _ref => {
|
|
33
40
|
onDateSelect: () => {}
|
34
41
|
});
|
35
42
|
};
|
36
|
-
|
37
43
|
export const EthiopicWithAmharic = buildCalendar({
|
38
44
|
calendar: 'ethiopic',
|
39
45
|
locale: 'am-ET',
|
40
46
|
date: '2014-02-03' // 13 Oct 2021
|
41
|
-
|
42
47
|
});
|
43
48
|
export const EthiopicWithEnglish = buildCalendar({
|
44
49
|
calendar: 'ethiopian',
|
45
50
|
// using "ethiopian" rather than the correct "ethiopic" to immitate DHIS2 calendar types
|
46
51
|
locale: 'en-ET',
|
47
52
|
date: '2014-02-03' // 13 Oct 2021
|
48
|
-
|
49
53
|
});
|
50
54
|
export const NepaliWithNepali = buildCalendar({
|
51
55
|
calendar: 'nepali',
|
52
56
|
locale: 'ne-NP',
|
53
57
|
date: '2078-06-27' // 13 Oct 2021
|
54
|
-
|
55
58
|
});
|
56
59
|
export const NepaliWithEnglish = buildCalendar({
|
57
60
|
calendar: 'nepali',
|
58
61
|
locale: 'en-NP',
|
59
62
|
date: '2078-06-27' // 13 Oct 2021
|
60
|
-
|
61
63
|
});
|
62
64
|
export const GregorianWithEnglish = buildCalendar({
|
63
65
|
calendar: 'gregorian',
|
@@ -1,5 +1,4 @@
|
|
1
|
-
function _extends() { _extends = Object.assign
|
2
|
-
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
3
2
|
import { constants } from '@dhis2/multi-calendar-dates';
|
4
3
|
import PropTypes from 'prop-types';
|
5
4
|
import React, { useState } from 'react';
|
@@ -10,7 +9,6 @@ const {
|
|
10
9
|
} = constants;
|
11
10
|
export const CalendarStoryWrapper = props => {
|
12
11
|
var _selectedDate$calenda;
|
13
|
-
|
14
12
|
const {
|
15
13
|
calendar,
|
16
14
|
locale,
|
@@ -28,7 +26,6 @@ export const CalendarStoryWrapper = props => {
|
|
28
26
|
const [selectedDate, setSelectedDate] = useState({
|
29
27
|
calendarDateString: date
|
30
28
|
});
|
31
|
-
|
32
29
|
const changeCalendar = _ref => {
|
33
30
|
let {
|
34
31
|
target: {
|
@@ -37,21 +34,18 @@ export const CalendarStoryWrapper = props => {
|
|
37
34
|
} = _ref;
|
38
35
|
setSelectedCalendar(value);
|
39
36
|
};
|
40
|
-
|
41
37
|
const changeNumberingSystem = _ref2 => {
|
42
38
|
let {
|
43
39
|
target: {
|
44
40
|
value
|
45
41
|
}
|
46
42
|
} = _ref2;
|
47
|
-
|
48
43
|
if (value === '-1') {
|
49
44
|
setSelectedNumberingSystem(null);
|
50
45
|
} else {
|
51
46
|
setSelectedNumberingSystem(value);
|
52
47
|
}
|
53
48
|
};
|
54
|
-
|
55
49
|
const changeDirection = _ref3 => {
|
56
50
|
let {
|
57
51
|
target: {
|
@@ -60,7 +54,6 @@ export const CalendarStoryWrapper = props => {
|
|
60
54
|
} = _ref3;
|
61
55
|
setSelectedDirection(value);
|
62
56
|
};
|
63
|
-
|
64
57
|
const changeWeekFormat = _ref4 => {
|
65
58
|
let {
|
66
59
|
target: {
|
@@ -69,7 +62,6 @@ export const CalendarStoryWrapper = props => {
|
|
69
62
|
} = _ref4;
|
70
63
|
setWeekDayFormat(value);
|
71
64
|
};
|
72
|
-
|
73
65
|
const onLocaleChanged = _ref5 => {
|
74
66
|
let {
|
75
67
|
target: {
|
@@ -78,7 +70,6 @@ export const CalendarStoryWrapper = props => {
|
|
78
70
|
} = _ref5;
|
79
71
|
setLocale(value);
|
80
72
|
};
|
81
|
-
|
82
73
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
83
74
|
style: {
|
84
75
|
fontSize: '0.8em',
|
@@ -1,10 +1,17 @@
|
|
1
|
-
function _extends() { _extends = Object.assign
|
2
|
-
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
3
2
|
import React from 'react';
|
4
3
|
import { Calendar } from '../calendar/calendar.js';
|
5
4
|
import { CalendarStoryWrapper } from './calendar-story-wrapper.js';
|
6
|
-
const subtitle =
|
7
|
-
const description =
|
5
|
+
const subtitle = `[Experimental] Calendar component is useful for creating a variety of calendars including Ethiopic, Islamic etc..`;
|
6
|
+
const description = `
|
7
|
+
Use a Calendar where there is a need to let the user select a date.
|
8
|
+
|
9
|
+
Note that it requires a parent, like [Box](../?path=/docs/layout-box--default), to define its size.
|
10
|
+
|
11
|
+
\`\`\`js
|
12
|
+
import { Calendar } from '@dhis2/ui'
|
13
|
+
\`\`\`
|
14
|
+
`;
|
8
15
|
export default {
|
9
16
|
title: 'Calendar',
|
10
17
|
component: Calendar,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dhis2-ui/calendar",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.11.1-beta.1",
|
4
4
|
"description": "UI Calendar",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -22,26 +22,26 @@
|
|
22
22
|
"access": "public"
|
23
23
|
},
|
24
24
|
"scripts": {
|
25
|
-
"start": "
|
25
|
+
"start": "storybook dev -c ../../storybook/config --port 5000",
|
26
26
|
"build": "d2-app-scripts build",
|
27
27
|
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
|
28
28
|
},
|
29
29
|
"peerDependencies": {
|
30
30
|
"@dhis2/d2-i18n": "^1",
|
31
|
-
"react": "^16.
|
32
|
-
"react-dom": "^16.
|
31
|
+
"react": "^16.13",
|
32
|
+
"react-dom": "^16.13",
|
33
33
|
"styled-jsx": "^4"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@dhis2-ui/button": "9.
|
37
|
-
"@dhis2-ui/card": "9.
|
38
|
-
"@dhis2-ui/input": "9.
|
39
|
-
"@dhis2-ui/layer": "9.
|
40
|
-
"@dhis2-ui/popper": "9.
|
36
|
+
"@dhis2-ui/button": "9.11.1-beta.1",
|
37
|
+
"@dhis2-ui/card": "9.11.1-beta.1",
|
38
|
+
"@dhis2-ui/input": "9.11.1-beta.1",
|
39
|
+
"@dhis2-ui/layer": "9.11.1-beta.1",
|
40
|
+
"@dhis2-ui/popper": "9.11.1-beta.1",
|
41
41
|
"@dhis2/multi-calendar-dates": "^1.2.3",
|
42
42
|
"@dhis2/prop-types": "^3.1.2",
|
43
|
-
"@dhis2/ui-constants": "9.
|
44
|
-
"@dhis2/ui-icons": "9.
|
43
|
+
"@dhis2/ui-constants": "9.11.1-beta.1",
|
44
|
+
"@dhis2/ui-icons": "9.11.1-beta.1",
|
45
45
|
"classnames": "^2.3.1",
|
46
46
|
"prop-types": "^15.7.2"
|
47
47
|
},
|