react-native-dates-picker 0.0.7 → 0.0.9
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/lib/commonjs/DateTimePicker.js +11 -7
- package/lib/commonjs/DateTimePicker.js.map +1 -1
- package/lib/commonjs/components/Calendar.js +9 -11
- package/lib/commonjs/components/Calendar.js.map +1 -1
- package/lib/commonjs/components/DatePicker.js +10 -12
- package/lib/commonjs/components/DatePicker.js.map +1 -1
- package/lib/commonjs/components/Day.js +12 -13
- package/lib/commonjs/components/Day.js.map +1 -1
- package/lib/commonjs/components/DaySelector.js +9 -9
- package/lib/commonjs/components/DaySelector.js.map +1 -1
- package/lib/commonjs/components/Header.js +23 -25
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/MonthSelector.js +5 -7
- package/lib/commonjs/components/MonthSelector.js.map +1 -1
- package/lib/commonjs/components/TimeSelector.js +12 -14
- package/lib/commonjs/components/TimeSelector.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/Wheel.js +1 -2
- package/lib/commonjs/components/WheelPicker/Wheel.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/WheelNative.js +1 -2
- package/lib/commonjs/components/WheelPicker/WheelNative.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/WheelWeb.js +3 -5
- package/lib/commonjs/components/WheelPicker/WheelWeb.js.map +1 -1
- package/lib/commonjs/components/YearSelector.js +6 -8
- package/lib/commonjs/components/YearSelector.js.map +1 -1
- package/lib/module/DateTimePicker.js +9 -3
- package/lib/module/DateTimePicker.js.map +1 -1
- package/lib/module/components/Calendar.js +1 -1
- package/lib/module/components/Calendar.js.map +1 -1
- package/lib/module/components/DatePicker.js +1 -1
- package/lib/module/components/DatePicker.js.map +1 -1
- package/lib/module/components/Day.js +4 -4
- package/lib/module/components/Day.js.map +1 -1
- package/lib/module/components/DaySelector.js +1 -1
- package/lib/module/components/DaySelector.js.map +1 -1
- package/lib/module/components/Header.js +1 -1
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/MonthSelector.js +0 -1
- package/lib/module/components/MonthSelector.js.map +1 -1
- package/lib/module/components/TimeSelector.js +2 -2
- package/lib/module/components/TimeSelector.js.map +1 -1
- package/lib/module/components/WheelPicker/Wheel.js +0 -1
- package/lib/module/components/WheelPicker/Wheel.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelNative.js +0 -1
- package/lib/module/components/WheelPicker/WheelNative.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelWeb.js +1 -1
- package/lib/module/components/WheelPicker/WheelWeb.js.map +1 -1
- package/lib/module/components/YearSelector.js +1 -1
- package/lib/module/components/YearSelector.js.map +1 -1
- package/lib/typescript/DateTimePicker.d.ts +2 -2
- package/lib/typescript/DateTimePicker.d.ts.map +1 -1
- package/lib/typescript/components/Calendar.d.ts +2 -2
- package/lib/typescript/components/Calendar.d.ts.map +1 -1
- package/lib/typescript/components/Day.d.ts +3 -3
- package/lib/typescript/components/Day.d.ts.map +1 -1
- package/lib/typescript/components/MonthSelector.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/Wheel.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelNative.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelWeb.d.ts +2 -2
- package/lib/typescript/components/WheelPicker/WheelWeb.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DateTimePicker.tsx +7 -3
- package/src/components/Calendar.tsx +1 -1
- package/src/components/DatePicker.tsx +1 -1
- package/src/components/Day.tsx +4 -4
- package/src/components/DaySelector.tsx +1 -1
- package/src/components/Header.tsx +1 -1
- package/src/components/MonthSelector.tsx +0 -1
- package/src/components/TimeSelector.tsx +2 -2
- package/src/components/WheelPicker/Wheel.tsx +0 -1
- package/src/components/WheelPicker/WheelNative.tsx +0 -1
- package/src/components/WheelPicker/WheelWeb.tsx +1 -1
- package/src/components/YearSelector.tsx +1 -1
|
@@ -4,14 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _CalendarContext = require("../CalendarContext");
|
|
10
10
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
11
|
var _utils = require("../utils");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
13
|
const Header = ({
|
|
16
14
|
buttonPrevIcon,
|
|
17
15
|
buttonNextIcon
|
|
@@ -30,14 +28,14 @@ const Header = ({
|
|
|
30
28
|
timePicker
|
|
31
29
|
} = (0, _CalendarContext.useCalendarContext)();
|
|
32
30
|
const currentMonthText = (0, _dayjs.default)(currentDate).locale(locale).format('MMMM');
|
|
33
|
-
const renderPrevButton = /*#__PURE__*/
|
|
31
|
+
const renderPrevButton = /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
34
32
|
disabled: calendarView === 'time',
|
|
35
33
|
onPress: () => calendarView === 'day' ? onChangeMonth(-1) : calendarView === 'month' ? onChangeYear(currentYear - 1) : calendarView === 'year' && onChangeYear(currentYear - _utils.YEAR_PAGE_SIZE),
|
|
36
34
|
accessibilityRole: "button",
|
|
37
35
|
accessibilityLabel: "Prev"
|
|
38
|
-
}, /*#__PURE__*/
|
|
36
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
39
37
|
style: [styles.iconContainer, styles.prev, theme === null || theme === void 0 ? void 0 : theme.headerButtonStyle]
|
|
40
|
-
}, buttonPrevIcon || /*#__PURE__*/
|
|
38
|
+
}, buttonPrevIcon || /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
41
39
|
source: {
|
|
42
40
|
uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAiCAYAAABStIn6AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD3SURBVHgBzdY7DoJAEAbgkUdJSSJ0lnZewc5byI08glra6Q08gregVBMS7NZZYwjKPmZmKfibWZovsGFmF2AqyfN8pesMAlKW5V4pVeHyEoEwPQSw3kVv1Ecwt7Zt12zIhDwwLMiG6Acy5ELIkA8hQRTEC1ERJ8RBrBAXMUISZABJkR8oBOmgUEQnKopiF4p8IESeMELipmmuWZYtcK0n3TxN002SJKcXhgN1m42feMCy/T7KNnsMbPBDSjFji0gwa9NyMecY4WDewUbFSKOWgpGHvw9jHUcujH1A2jDRkW3CYhAEG/381+hL8W2krusKy1Gv9W3kDcFNM0FmBbDoAAAAAElFTkSuQmCC'
|
|
43
41
|
},
|
|
@@ -48,14 +46,14 @@ const Header = ({
|
|
|
48
46
|
tintColor: theme === null || theme === void 0 ? void 0 : theme.headerButtonColor
|
|
49
47
|
}
|
|
50
48
|
})));
|
|
51
|
-
const renderNextButton = /*#__PURE__*/
|
|
49
|
+
const renderNextButton = /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
52
50
|
disabled: calendarView === 'time',
|
|
53
51
|
onPress: () => calendarView === 'day' ? onChangeMonth(1) : calendarView === 'month' ? onChangeYear(currentYear + 1) : calendarView === 'year' && onChangeYear(currentYear + _utils.YEAR_PAGE_SIZE),
|
|
54
52
|
accessibilityRole: "button",
|
|
55
53
|
accessibilityLabel: "Next"
|
|
56
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
57
55
|
style: [styles.iconContainer, styles.next, theme === null || theme === void 0 ? void 0 : theme.headerButtonStyle]
|
|
58
|
-
}, buttonNextIcon || /*#__PURE__*/
|
|
56
|
+
}, buttonNextIcon || /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
59
57
|
source: {
|
|
60
58
|
uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAYCAYAAAAh8HdUAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACESURBVHgB7dQhDoUwDAbglT0xMfHklhmu8G7wOAlwMo7CUZicRCyZLH8FmuIQ/EnTin5iWVIbQvh7702tdTfKdES0SgH3asTMM3p/FxosTzFGRm0vfCQkLcTnLxhza+3XaZC1ls/ZOfe9BCml8da7XvAMgJAA9IxbMZRSsgZ9ZFmQFkgOQ1ZeTkHFbCQAAAAASUVORK5CYII='
|
|
61
59
|
},
|
|
@@ -68,51 +66,51 @@ const Header = ({
|
|
|
68
66
|
})));
|
|
69
67
|
const yearSelector = (0, _react.useCallback)(() => {
|
|
70
68
|
const years = (0, _utils.getYearRange)(currentYear);
|
|
71
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
72
70
|
onPress: () => {
|
|
73
71
|
setCalendarView(calendarView === 'year' ? 'day' : 'year');
|
|
74
72
|
onChangeYear((0, _utils.getDateYear)(currentDate));
|
|
75
73
|
},
|
|
76
74
|
accessibilityRole: "button",
|
|
77
75
|
accessibilityLabel: (0, _dayjs.default)(currentDate).format('YYYY')
|
|
78
|
-
}, /*#__PURE__*/
|
|
76
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
79
77
|
style: [styles.textContainer, theme === null || theme === void 0 ? void 0 : theme.headerTextContainerStyle]
|
|
80
|
-
}, /*#__PURE__*/
|
|
78
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
81
79
|
style: [styles.text, theme === null || theme === void 0 ? void 0 : theme.headerTextStyle]
|
|
82
80
|
}, calendarView === 'year' ? `${years[0]} - ${years[years.length - 1]}` : (0, _dayjs.default)(currentDate).format('YYYY'))));
|
|
83
81
|
}, [calendarView, currentDate, currentYear, setCalendarView, onChangeYear, theme]);
|
|
84
|
-
const monthSelector = /*#__PURE__*/
|
|
82
|
+
const monthSelector = /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
85
83
|
onPress: () => setCalendarView(calendarView === 'month' ? 'day' : 'month'),
|
|
86
84
|
accessibilityRole: "button",
|
|
87
85
|
accessibilityLabel: currentMonthText
|
|
88
|
-
}, /*#__PURE__*/
|
|
86
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
89
87
|
style: [styles.textContainer, theme === null || theme === void 0 ? void 0 : theme.headerTextContainerStyle]
|
|
90
|
-
}, /*#__PURE__*/
|
|
88
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
91
89
|
style: [styles.text, theme === null || theme === void 0 ? void 0 : theme.headerTextStyle]
|
|
92
90
|
}, currentMonthText)));
|
|
93
|
-
const renderSelectors = /*#__PURE__*/
|
|
91
|
+
const renderSelectors = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
94
92
|
style: styles.selectorContainer
|
|
95
|
-
}, calendarView !== 'year' ? monthSelector : null, yearSelector()), timePicker && mode === 'single' && calendarView !== 'year' ? /*#__PURE__*/
|
|
93
|
+
}, calendarView !== 'year' ? monthSelector : null, yearSelector()), timePicker && mode === 'single' && calendarView !== 'year' ? /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
96
94
|
onPress: () => setCalendarView(calendarView === 'time' ? 'day' : 'time'),
|
|
97
95
|
accessibilityRole: "button",
|
|
98
96
|
accessibilityLabel: (0, _dayjs.default)(date).format('HH:mm:ss')
|
|
99
|
-
}, /*#__PURE__*/
|
|
97
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
100
98
|
style: [styles.textContainer, theme === null || theme === void 0 ? void 0 : theme.headerTextContainerStyle]
|
|
101
|
-
}, /*#__PURE__*/
|
|
99
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
102
100
|
style: [styles.text, theme === null || theme === void 0 ? void 0 : theme.headerTextStyle]
|
|
103
101
|
}, (0, _dayjs.default)(date).format('HH:mm:ss')))) : null);
|
|
104
|
-
return /*#__PURE__*/
|
|
102
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
105
103
|
style: [styles.headerContainer, theme === null || theme === void 0 ? void 0 : theme.headerContainerStyle],
|
|
106
104
|
accessibilityRole: "header"
|
|
107
|
-
}, (theme === null || theme === void 0 ? void 0 : theme.headerButtonsPosition) === 'left' ? /*#__PURE__*/
|
|
105
|
+
}, (theme === null || theme === void 0 ? void 0 : theme.headerButtonsPosition) === 'left' ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
108
106
|
style: styles.container
|
|
109
|
-
}, /*#__PURE__*/
|
|
107
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
110
108
|
style: styles.row
|
|
111
|
-
}, renderPrevButton, renderNextButton), renderSelectors) : (theme === null || theme === void 0 ? void 0 : theme.headerButtonsPosition) === 'right' ? /*#__PURE__*/
|
|
109
|
+
}, renderPrevButton, renderNextButton), renderSelectors) : (theme === null || theme === void 0 ? void 0 : theme.headerButtonsPosition) === 'right' ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
112
110
|
style: styles.container
|
|
113
|
-
}, renderSelectors, /*#__PURE__*/
|
|
111
|
+
}, renderSelectors, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
114
112
|
style: styles.row
|
|
115
|
-
}, renderPrevButton, renderNextButton)) : /*#__PURE__*/
|
|
113
|
+
}, renderPrevButton, renderNextButton)) : /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
116
114
|
style: styles.container
|
|
117
115
|
}, renderPrevButton, renderSelectors, renderNextButton));
|
|
118
116
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_CalendarContext","_dayjs","_interopRequireDefault","_utils","obj","__esModule","default","Header","buttonPrevIcon","buttonNextIcon","mode","date","currentDate","currentYear","onChangeMonth","onChangeYear","calendarView","setCalendarView","theme","locale","timePicker","useCalendarContext","currentMonthText","dayjs","format","renderPrevButton","React","createElement","Pressable","disabled","onPress","YEAR_PAGE_SIZE","accessibilityRole","accessibilityLabel","View","style","styles","iconContainer","prev","headerButtonStyle","Image","source","uri","resizeMode","width","headerButtonSize","height","tintColor","headerButtonColor","renderNextButton","next","yearSelector","useCallback","years","getYearRange","getDateYear","textContainer","headerTextContainerStyle","Text","text","headerTextStyle","length","monthSelector","renderSelectors","Fragment","selectorContainer","headerContainer","headerContainerStyle","headerButtonsPosition","container","row","StyleSheet","create","marginBottom","padding","flexDirection","alignItems","justifyContent","marginHorizontal","paddingHorizontal","paddingVertical","borderRadius","fontWeight","fontSize","marginRight","marginLeft","_default","exports"],"sourceRoot":"../../../src","sources":["components/Header.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAAqE,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErE,MAAMG,MAAM,GAAGA,CAAC;EAAEC,cAAc;EAAEC;AAA4B,CAAC,KAAK;EACl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AAE;IACTK,OAAO,EAAE,CAAC;IACVC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDZ,iBAAiB,EAAE;IACjBU,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDpB,aAAa,EAAE;IACbsB,gBAAgB,EAAE,CAAC;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,eAAe,EAAE,CAAC;IAClBC,YAAY,EAAE;EAChB,CAAC;EACDtB,IAAI,EAAE;IACJuB,UAAU,EAAE,MAAM;IAClBC,QAAQ,EAAE;EACZ,CAAC;EACD9C,aAAa,EAAE;IACbqC,OAAO,EAAE;EACX,CAAC;EACDpC,IAAI,EAAE;IACJ8C,WAAW,EAAE;EACf,CAAC;EACDlC,IAAI,EAAE;IACJmC,UAAU,EAAE;EACd,CAAC;EACDf,GAAG,EAAE;IACHK,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAEYC,MAAM"}
|
|
@@ -4,11 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
8
|
var _CalendarContext = require("../CalendarContext");
|
|
10
9
|
var _utils = require("../utils");
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
10
|
const MonthSelector = () => {
|
|
13
11
|
var _getMonths;
|
|
14
12
|
const {
|
|
@@ -19,9 +17,9 @@ const MonthSelector = () => {
|
|
|
19
17
|
const {
|
|
20
18
|
month
|
|
21
19
|
} = (0, _utils.getParsedDate)(currentDate);
|
|
22
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
23
21
|
style: styles.container
|
|
24
|
-
}, /*#__PURE__*/
|
|
22
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
25
23
|
style: styles.monthsContainer
|
|
26
24
|
}, (_getMonths = (0, _utils.getMonths)()) === null || _getMonths === void 0 ? void 0 : _getMonths.map((item, index) => {
|
|
27
25
|
const activeItemStyle = index === month ? {
|
|
@@ -32,15 +30,15 @@ const MonthSelector = () => {
|
|
|
32
30
|
color: '#fff',
|
|
33
31
|
...(theme === null || theme === void 0 ? void 0 : theme.selectedTextStyle)
|
|
34
32
|
} : theme === null || theme === void 0 ? void 0 : theme.calendarTextStyle;
|
|
35
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
36
34
|
key: index,
|
|
37
35
|
style: styles.monthCell,
|
|
38
36
|
onPress: () => onSelectMonth(index),
|
|
39
37
|
accessibilityRole: "button",
|
|
40
38
|
accessibilityLabel: item
|
|
41
|
-
}, /*#__PURE__*/
|
|
39
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
42
40
|
style: [styles.month, theme === null || theme === void 0 ? void 0 : theme.monthContainerStyle, activeItemStyle]
|
|
43
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
44
42
|
key: index,
|
|
45
43
|
style: textStyle
|
|
46
44
|
}, item)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_CalendarContext","_utils","MonthSelector","_getMonths","currentDate","onSelectMonth","theme","useCalendarContext","month","getParsedDate","React","createElement","View","style","styles","container","monthsContainer","getMonths","map","item","index","activeItemStyle","borderColor","selectedItemColor","backgroundColor","textStyle","color","selectedTextStyle","calendarTextStyle","Pressable","key","monthCell","onPress","accessibilityRole","accessibilityLabel","monthContainerStyle","Text","StyleSheet","create","flex","alignItems","justifyContent","flexDirection","flexWrap","width","paddingVertical","margin","borderWidth","borderRadius","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P,KAAK,EAAEC,MAAM,CAACiB,SAAU;MACxBC,OAAO,EAAEA,CAAA,KAAM3B,aAAa,CAACe,KAAK,CAAE;MACpCa,iBAAiB,EAAC,QAAQ;MAC1BC,kBAAkB,EAAEf;IAAK,gBAEzBT,KAAA,CAAAC,aAAA,CAACb,YAAA,CAAAc,IAAI;MACHC,KAAK,EAAE,CACLC,MAAM,CAACN,KAAK,EACZF,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAE6B,mBAAmB,EAC1Bd,eAAe;IACf,gBAEFX,KAAA,CAAAC,aAAA,CAACb,YAAA,CAAAsC,IAAI;MAACN,GAAG,EAAEV,KAAM;MAACP,KAAK,EAAEY;IAAU,GAChCN,IACG,CACF,CACG,CAAC;EAEhB,CAAC,CACG,CACF,CAAC;AAEX,CAAC;AAED,MAAML,MAAM,GAAGuB,uBAAU,CAACC,MAAM,CAAC;EAC/BvB,SAAS,EAAE;IACTwB,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDzB,eAAe,EAAE;IACf0B,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE;EACZ,CAAC;EACDZ,SAAS,EAAE;IACTa,KAAK,EAAE;EACT,CAAC;EACDpC,KAAK,EAAE;IACLqC,eAAe,EAAE,EAAE;IACnBC,MAAM,EAAE,CAAC;IACTN,UAAU,EAAE,QAAQ;IACpBO,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE,CAAC;IACf1B,WAAW,EAAE,SAAS;IACtBE,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAAC,IAAAyB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYjD,aAAa"}
|
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _CalendarContext = require("../CalendarContext");
|
|
10
10
|
var _Wheel = _interopRequireDefault(require("./WheelPicker/Wheel"));
|
|
11
11
|
var _enums = require("../enums");
|
|
12
12
|
var _utils = require("../utils");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
14
|
function createNumberList(num) {
|
|
17
15
|
return new Array(num).fill(0).map((_, index) => index < 10 ? `0${index.toString()}` : index.toString());
|
|
18
16
|
}
|
|
@@ -34,35 +32,35 @@ const TimeSelector = () => {
|
|
|
34
32
|
const newDate = (0, _utils.getDate)(date)[type](value);
|
|
35
33
|
onSelectDate((0, _utils.getFormatted)(newDate));
|
|
36
34
|
}, [date, onSelectDate]);
|
|
37
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
38
36
|
style: styles.container
|
|
39
|
-
}, /*#__PURE__*/
|
|
37
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
40
38
|
style: styles.timePickerContainer
|
|
41
|
-
}, /*#__PURE__*/
|
|
39
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
42
40
|
style: styles.wheelContainer
|
|
43
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement(_Wheel.default, {
|
|
44
42
|
value: hour,
|
|
45
43
|
items: hours,
|
|
46
44
|
setValue: value => handleChange(value, 'hour')
|
|
47
|
-
})), /*#__PURE__*/
|
|
45
|
+
})), /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
48
46
|
style: {
|
|
49
47
|
...styles.timePickerText,
|
|
50
48
|
...(theme === null || theme === void 0 ? void 0 : theme.wheelPickerTextStyle)
|
|
51
49
|
}
|
|
52
|
-
}, ":"), /*#__PURE__*/
|
|
50
|
+
}, ":"), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
53
51
|
style: styles.wheelContainer
|
|
54
|
-
}, /*#__PURE__*/
|
|
52
|
+
}, /*#__PURE__*/React.createElement(_Wheel.default, {
|
|
55
53
|
value: minute,
|
|
56
54
|
items: minutes,
|
|
57
55
|
setValue: value => handleChange(value, 'minute')
|
|
58
|
-
})), /*#__PURE__*/
|
|
56
|
+
})), /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
59
57
|
style: {
|
|
60
58
|
...styles.timePickerText,
|
|
61
59
|
...(theme === null || theme === void 0 ? void 0 : theme.wheelPickerTextStyle)
|
|
62
60
|
}
|
|
63
|
-
}, ":"), /*#__PURE__*/
|
|
61
|
+
}, ":"), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
64
62
|
style: styles.wheelContainer
|
|
65
|
-
}, /*#__PURE__*/
|
|
63
|
+
}, /*#__PURE__*/React.createElement(_Wheel.default, {
|
|
66
64
|
value: second,
|
|
67
65
|
items: seconds,
|
|
68
66
|
setValue: value => handleChange(value, 'second')
|
|
@@ -81,7 +79,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
81
79
|
flexDirection: 'row',
|
|
82
80
|
alignItems: 'center',
|
|
83
81
|
justifyContent: 'center',
|
|
84
|
-
width:
|
|
82
|
+
width: '80%',
|
|
85
83
|
height: _enums.CALENDAR_HEIGHT / 2
|
|
86
84
|
},
|
|
87
85
|
timePickerText: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_CalendarContext","_Wheel","_interopRequireDefault","_enums","_utils","obj","__esModule","default","createNumberList","num","Array","fill","map","_","index","toString","hours","minutes","seconds","TimeSelector","date","onSelectDate","theme","useCalendarContext","hour","minute","second","getParsedDate","handleChange","useCallback","value","type","newDate","getDate","getFormatted","React","createElement","View","style","styles","container","timePickerContainer","wheelContainer","items","setValue","Text","timePickerText","wheelPickerTextStyle","StyleSheet","create","flex","alignItems","justifyContent","flexDirection","width","height","CALENDAR_HEIGHT","fontSize","fontWeight","marginHorizontal","_default","exports"],"sourceRoot":"../../../src","sources":["components/TimeSelector.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAgE,SAAAI,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhE,SAASG,gBAAgBA,CAACC,GAAW,EAAE;EACrC,OAAO,IAAIC,KAAK,CAACD,GAAG,CAAC,CAClBE,IAAI,CAAC,CAAC,CAAC,CACPC,GAAG,CAAC,CAACC,CAAC,EAAEC,KAAK,KACZA,KAAK,GAAG,EAAE,GAAI,IAAGA,KAAK,CAACC,QAAQ,CAAC,CAAE,EAAC,GAAGD,KAAK,CAACC,QAAQ,CAAC,CACvD,CAAC;AACL;AAEA,MAAMC,KAAK,GAAGR,gBAAgB,CAAC,EAAE,CAAC;AAClC,MAAMS,OAAO,GAAGT,gBAAgB,CAAC,EAAE,CAAC;AACpC,MAAMU,OAAO,GAAGV,gBAAgB,CAAC,EAAE,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C,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtD,OAAA,GAEYY,YAAY"}
|
|
@@ -4,12 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Wheel;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
8
|
var _WheelNative = _interopRequireDefault(require("./WheelNative"));
|
|
10
9
|
var _WheelWeb = _interopRequireDefault(require("./WheelWeb"));
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
function Wheel(props) {
|
|
13
|
-
return _reactNative.Platform.OS === 'web' ? /*#__PURE__*/
|
|
12
|
+
return _reactNative.Platform.OS === 'web' ? /*#__PURE__*/React.createElement(_WheelWeb.default, props) : /*#__PURE__*/React.createElement(_WheelNative.default, props);
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=Wheel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_WheelNative","_interopRequireDefault","_WheelWeb","obj","__esModule","default","Wheel","props","Platform","OS","React","createElement"],"sourceRoot":"../../../../src","sources":["components/WheelPicker/Wheel.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAkC,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AASnB,SAASG,KAAKA,CAACC,KAAiB,EAAE;EAC/C,OAAOC,qBAAQ,CAACC,EAAE,KAAK,KAAK,gBAC1BC,KAAA,CAAAC,aAAA,CAACT,SAAA,CAAAG,OAAQ,EAAKE,KAAQ,CAAC,gBAEvBG,KAAA,CAAAC,aAAA,CAACX,YAAA,CAAAK,OAAW,EAAKE,KAAQ,CAC1B;AACH"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = WheelNative;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
8
|
var _reactNativeWheely = _interopRequireDefault(require("react-native-wheely"));
|
|
10
9
|
var _CalendarContext = require("../../CalendarContext");
|
|
@@ -18,7 +17,7 @@ function WheelNative({
|
|
|
18
17
|
const {
|
|
19
18
|
theme
|
|
20
19
|
} = (0, _CalendarContext.useCalendarContext)();
|
|
21
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/React.createElement(_reactNativeWheely.default, {
|
|
22
21
|
selectedIndex: value < 0 ? 0 : value,
|
|
23
22
|
options: items,
|
|
24
23
|
onChange: setValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeWheely","_interopRequireDefault","_CalendarContext","obj","__esModule","default","WheelNative","value","setValue","items","indicatorStyle","theme","useCalendarContext","React","createElement","selectedIndex","options","onChange","containerStyle","styles","container","wheelPickerContainerStyle","itemStyle","wheelPickerItemStyle","itemTextStyle","wheelPickerText","wheelPickerTextStyle","selectedIndicatorStyle","wheelSelectedIndicator","wheelPickerIndicatorStyle","itemHeight","decelerationRate","wheelPickerDecelerationRate","StyleSheet","create","display","Platform","select","web","userSelect","borderRadius","fontSize","fontWeight"],"sourceRoot":"../../../../src","sources":["components/WheelPicker/WheelNative.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAA2D,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA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;EACDf,eAAe,EAAE;IACfgB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
|
|
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _CalendarContext = require("../../CalendarContext");
|
|
10
10
|
var _AnimatedMath = require("./AnimatedMath");
|
|
11
11
|
var _enums = require("../../enums");
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
12
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
13
|
const WheelWeb = ({
|
|
16
14
|
value,
|
|
@@ -77,11 +75,11 @@ const WheelWeb = ({
|
|
|
77
75
|
extrapolate: 'clamp'
|
|
78
76
|
})) : [];
|
|
79
77
|
}, [displayValues, radius, value, displayCount, translateY]);
|
|
80
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
81
79
|
style: [styles.container]
|
|
82
80
|
}, panResponder.panHandlers), displayValues === null || displayValues === void 0 ? void 0 : displayValues.map((displayValue, index) => {
|
|
83
81
|
const animatedAngle = animatedAngles[index];
|
|
84
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.Text, {
|
|
85
83
|
key: `${displayValue}-${index}`,
|
|
86
84
|
style: [{
|
|
87
85
|
...styles.wheelPickerText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_CalendarContext","_AnimatedMath","_enums","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","WheelWeb","value","setValue","items","theme","useCalendarContext","displayCount","translateY","useRef","Animated","Value","current","renderCount","circular","height","radius","valueIndex","useMemo","indexOf","slice","panResponder","PanResponder","create","onMoveShouldSetPanResponder","onStartShouldSetPanResponderCapture","onPanResponderGrant","onPanResponderMove","evt","gestureState","dy","stopPropagation","onPanResponderRelease","_","extractOffset","newValueIndex","Math","round","newValue","setOffset","parseInt","displayValues","centerIndex","floor","Array","from","index","targetIndex","animatedAngles","currentIndex","map","interpolate","inputRange","outputRange","extrapolate","PI","React","createElement","View","style","styles","container","panHandlers","displayValue","animatedAngle","Text","wheelPickerText","wheelPickerTextStyle","position","transform","multiply","sin","rotateX","opacity","StyleSheet","minWidth","overflow","alignItems","justifyContent","CALENDAR_HEIGHT","Platform","select","web","cursor","userSelect","contentContainer","fontSize","fontWeight","_default","exports","default","memo","prevProps","nextProps"],"sourceRoot":"../../../../src","sources":["components/WheelPicker/WheelWeb.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA8C,SAAAK,SA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AS,KAAK;EACtD,OACED,SAAS,CAAC1F,KAAK,KAAK2F,SAAS,CAAC3F,KAAK,IACnC0F,SAAS,CAACzF,QAAQ,KAAK0F,SAAS,CAAC1F,QAAQ;AAE7C,CAAC,CAAC"}
|
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _CalendarContext = require("../CalendarContext");
|
|
10
10
|
var _utils = require("../utils");
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
11
|
const YearSelector = () => {
|
|
14
12
|
const {
|
|
15
13
|
currentDate,
|
|
@@ -37,24 +35,24 @@ const YearSelector = () => {
|
|
|
37
35
|
} : {
|
|
38
36
|
...(theme === null || theme === void 0 ? void 0 : theme.calendarTextStyle)
|
|
39
37
|
};
|
|
40
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
41
39
|
key: year,
|
|
42
40
|
onPress: () => onSelectYear(year),
|
|
43
41
|
style: styles.yearCell,
|
|
44
42
|
accessibilityRole: "button",
|
|
45
43
|
accessibilityLabel: year.toString()
|
|
46
|
-
}, /*#__PURE__*/
|
|
44
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
47
45
|
style: [styles.year, theme === null || theme === void 0 ? void 0 : theme.yearContainerStyle, activeItemStyle]
|
|
48
|
-
}, /*#__PURE__*/
|
|
46
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
49
47
|
key: year,
|
|
50
48
|
style: textStyle
|
|
51
49
|
}, year)));
|
|
52
50
|
});
|
|
53
51
|
return column;
|
|
54
52
|
}, [onSelectYear, selectedYear, currentYear, currentDate, theme]);
|
|
55
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
56
54
|
style: styles.container
|
|
57
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
58
56
|
style: styles.years
|
|
59
57
|
}, generateCells()));
|
|
60
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_CalendarContext","_utils","YearSelector","currentDate","currentYear","onSelectYear","theme","useCalendarContext","selectedYear","getDateYear","generateCells","useCallback","years","getYearRange","activeYear","column","map","year","activeItemStyle","borderColor","selectedItemColor","backgroundColor","textStyle","color","selectedTextStyle","fontWeight","calendarTextStyle","React","createElement","Pressable","key","onPress","style","styles","yearCell","accessibilityRole","accessibilityLabel","toString","View","yearContainerStyle","Text","container","StyleSheet","create","flex","alignItems","justifyContent","margin","width","flexDirection","flexWrap","paddingVertical","borderWidth","borderRadius","_default","exports","default"],"sourceRoot":"../../../src","sources":["components/YearSelector.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,MAAMI,YAAY,GAAGA,CAAA,KAAM;EACzB,MAAM;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AE;IACJkC,eAAe,EAAE,EAAE;IACnBJ,MAAM,EAAE,CAAC;IACTF,UAAU,EAAE,QAAQ;IACpBO,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE,CAAC;IACflC,WAAW,EAAE,SAAS;IACtBE,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAAC,IAAAiC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYtD,YAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { memo, useCallback, useEffect, useReducer } from 'react';
|
|
2
2
|
import { getFormatted, getDate, dateToUnix, getEndOfDay, getStartOfDay, areDatesOnSameDay } from './utils';
|
|
3
3
|
import CalendarContext from './CalendarContext';
|
|
4
4
|
import { CalendarActionKind } from './enums';
|
|
@@ -193,7 +193,10 @@ const DateTimePicker = props => {
|
|
|
193
193
|
type: CalendarActionKind.SET_CALENDAR_VIEW,
|
|
194
194
|
payload: 'day'
|
|
195
195
|
});
|
|
196
|
-
|
|
196
|
+
if (mode === 'single' || mode === 'wheel') onChange === null || onChange === void 0 || onChange({
|
|
197
|
+
date: getFormatted(newDate)
|
|
198
|
+
});
|
|
199
|
+
}, [maxDate, minDate, mode, onChange, state.currentDate]);
|
|
197
200
|
const onSelectYear = useCallback(year => {
|
|
198
201
|
let newDate = getDate(state.currentDate).year(year);
|
|
199
202
|
if (maxDate && newDate.isAfter(maxDate)) newDate = getDate(maxDate);
|
|
@@ -206,7 +209,10 @@ const DateTimePicker = props => {
|
|
|
206
209
|
type: CalendarActionKind.SET_CALENDAR_VIEW,
|
|
207
210
|
payload: initialView
|
|
208
211
|
});
|
|
209
|
-
|
|
212
|
+
if (mode === 'single' || mode === 'wheel') onChange === null || onChange === void 0 || onChange({
|
|
213
|
+
date: getFormatted(newDate)
|
|
214
|
+
});
|
|
215
|
+
}, [state.currentDate, maxDate, minDate, initialView, mode, onChange]);
|
|
210
216
|
const onChangeMonth = useCallback(month => {
|
|
211
217
|
const newDate = getDate(state.currentDate).add(month, 'month');
|
|
212
218
|
dispatch({
|