react-native-dates-picker 0.1.0 → 0.1.1
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/README.md +27 -28
- package/lib/commonjs/DateTimePicker.js +4 -4
- package/lib/commonjs/DateTimePicker.js.map +1 -1
- package/lib/commonjs/components/Calendar.js +2 -2
- package/lib/commonjs/components/Calendar.js.map +1 -1
- package/lib/commonjs/components/DatePicker.js +10 -28
- package/lib/commonjs/components/DatePicker.js.map +1 -1
- package/lib/commonjs/components/Day.js +2 -2
- package/lib/commonjs/components/Day.js.map +1 -1
- package/lib/commonjs/components/DaySelector.js +2 -2
- package/lib/commonjs/components/DaySelector.js.map +1 -1
- package/lib/commonjs/components/Header.js +2 -2
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/MonthSelector.js +2 -2
- package/lib/commonjs/components/MonthSelector.js.map +1 -1
- package/lib/commonjs/components/TimeSelector.js +3 -3
- package/lib/commonjs/components/TimeSelector.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/Wheel.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/WheelNative.js +0 -12
- package/lib/commonjs/components/WheelPicker/WheelNative.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/WheelNativePicker/wheel-picker-item.js +8 -2
- package/lib/commonjs/components/WheelPicker/WheelNativePicker/wheel-picker-item.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/WheelNativePicker/wheel-picker.js +7 -2
- package/lib/commonjs/components/WheelPicker/WheelNativePicker/wheel-picker.js.map +1 -1
- package/lib/commonjs/components/WheelPicker/WheelWeb.js +11 -5
- package/lib/commonjs/components/WheelPicker/WheelWeb.js.map +1 -1
- package/lib/commonjs/components/YearSelector.js +2 -2
- package/lib/commonjs/components/YearSelector.js.map +1 -1
- package/lib/module/DateTimePicker.js +4 -4
- package/lib/module/DateTimePicker.js.map +1 -1
- package/lib/module/components/Calendar.js +2 -2
- package/lib/module/components/Calendar.js.map +1 -1
- package/lib/module/components/DatePicker.js +10 -28
- package/lib/module/components/DatePicker.js.map +1 -1
- package/lib/module/components/Day.js +2 -2
- package/lib/module/components/Day.js.map +1 -1
- package/lib/module/components/DaySelector.js +2 -2
- package/lib/module/components/DaySelector.js.map +1 -1
- package/lib/module/components/Header.js +2 -2
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/MonthSelector.js +2 -2
- package/lib/module/components/MonthSelector.js.map +1 -1
- package/lib/module/components/TimeSelector.js +3 -3
- package/lib/module/components/TimeSelector.js.map +1 -1
- package/lib/module/components/WheelPicker/Wheel.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelNative.js +0 -12
- package/lib/module/components/WheelPicker/WheelNative.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelNativePicker/wheel-picker-item.js +8 -2
- package/lib/module/components/WheelPicker/WheelNativePicker/wheel-picker-item.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelNativePicker/wheel-picker.js +7 -2
- package/lib/module/components/WheelPicker/WheelNativePicker/wheel-picker.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelWeb.js +11 -5
- package/lib/module/components/WheelPicker/WheelWeb.js.map +1 -1
- package/lib/module/components/YearSelector.js +2 -2
- package/lib/module/components/YearSelector.js.map +1 -1
- package/lib/typescript/DateTimePicker.d.ts +1 -1
- package/lib/typescript/DateTimePicker.d.ts.map +1 -1
- package/lib/typescript/components/Calendar.d.ts +1 -1
- package/lib/typescript/components/Calendar.d.ts.map +1 -1
- package/lib/typescript/components/DatePicker.d.ts.map +1 -1
- package/lib/typescript/components/Day.d.ts +1 -1
- package/lib/typescript/components/Day.d.ts.map +1 -1
- package/lib/typescript/components/Header.d.ts +1 -1
- package/lib/typescript/components/Header.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/Wheel.d.ts +1 -3
- package/lib/typescript/components/WheelPicker/Wheel.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelNative.d.ts +1 -1
- package/lib/typescript/components/WheelPicker/WheelNative.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelNativePicker/wheel-picker-item.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelNativePicker/wheel-picker.d.ts +2 -3
- package/lib/typescript/components/WheelPicker/WheelNativePicker/wheel-picker.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelWeb.d.ts +1 -1
- package/lib/typescript/components/WheelPicker/WheelWeb.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +1 -2
- package/lib/typescript/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DateTimePicker.tsx +6 -6
- package/src/components/Calendar.tsx +4 -4
- package/src/components/DatePicker.tsx +5 -24
- package/src/components/Day.tsx +3 -3
- package/src/components/DaySelector.tsx +3 -3
- package/src/components/Header.tsx +3 -3
- package/src/components/MonthSelector.tsx +2 -2
- package/src/components/TimeSelector.tsx +3 -3
- package/src/components/WheelPicker/Wheel.tsx +2 -3
- package/src/components/WheelPicker/WheelNative.tsx +1 -14
- package/src/components/WheelPicker/WheelNativePicker/wheel-picker-item.tsx +4 -1
- package/src/components/WheelPicker/WheelNativePicker/wheel-picker.tsx +10 -4
- package/src/components/WheelPicker/WheelWeb.tsx +13 -5
- package/src/components/WheelPicker/period-native.tsx +1 -1
- package/src/components/YearSelector.tsx +2 -2
- package/src/types.ts +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAwLjC,CAAC;AAwCF,eAAe,MAAM,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { PickerOption } from '../../types';
|
|
2
|
+
import { PickerOption } from 'src/types';
|
|
4
3
|
interface WheelProps {
|
|
5
4
|
value: number;
|
|
6
5
|
setValue?: (value: number) => void;
|
|
7
6
|
items: Array<PickerOption>;
|
|
8
|
-
indicatorStyle?: ViewStyle;
|
|
9
7
|
}
|
|
10
8
|
declare const _default: React.NamedExoticComponent<WheelProps>;
|
|
11
9
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../../../src/components/WheelPicker/Wheel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../../../src/components/WheelPicker/Wheel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC5B;;AAOD,wBAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WheelNative.d.ts","sourceRoot":"","sources":["../../../../src/components/WheelPicker/WheelNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WheelNative.d.ts","sourceRoot":"","sources":["../../../../src/components/WheelPicker/WheelNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;;AAkBD,wBAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wheel-picker-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/WheelPicker/WheelNativePicker/wheel-picker-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAoB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"wheel-picker-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/WheelPicker/WheelNativePicker/wheel-picker-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAoB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,UAAU,SAAS;IACjB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CACtC;;AA6HD,wBAAqC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { PickerOption } from '
|
|
2
|
+
import { ViewProps, FlatListProps } from 'react-native';
|
|
3
|
+
import { PickerOption } from 'src/types';
|
|
4
4
|
interface Props {
|
|
5
5
|
value: number | string;
|
|
6
6
|
options: PickerOption[];
|
|
7
7
|
onChange: (index: number | string) => void;
|
|
8
8
|
itemHeight?: number;
|
|
9
|
-
containerStyle?: ViewStyle;
|
|
10
9
|
containerProps?: Omit<ViewProps, 'style'>;
|
|
11
10
|
scaleFunction?: (x: number) => number;
|
|
12
11
|
rotationFunction?: (x: number) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wheel-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/WheelPicker/WheelNativePicker/wheel-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"wheel-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/WheelPicker/WheelNativePicker/wheel-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,EAKL,SAAS,EACT,aAAa,EAId,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC;CAC3E;;AA+LD,wBAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WheelWeb.d.ts","sourceRoot":"","sources":["../../../../src/components/WheelPicker/WheelWeb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WheelWeb.d.ts","sourceRoot":"","sources":["../../../../src/components/WheelPicker/WheelWeb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;;AAgMD,wBAAgD"}
|
|
@@ -41,8 +41,7 @@ export type CalendarThemeProps = {
|
|
|
41
41
|
wheelPickerContainerStyle?: ViewStyle;
|
|
42
42
|
wheelPickerItemStyle?: ViewStyle;
|
|
43
43
|
wheelPickerTextStyle?: TextStyle;
|
|
44
|
-
|
|
45
|
-
wheelPickerDecelerationRate?: 'normal' | 'fast' | number;
|
|
44
|
+
wheelPickerSelectedIndicatorStyle?: ViewStyle;
|
|
46
45
|
selectedRangeBackgroundColor?: string;
|
|
47
46
|
};
|
|
48
47
|
export type HeaderProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA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QAAQ,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,WAAW,CAAC;IACpD,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
package/package.json
CHANGED
package/src/DateTimePicker.tsx
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React, { memo, useCallback, useEffect, useReducer } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import utc from 'dayjs/plugin/utc';
|
|
4
|
+
import localeData from 'dayjs/plugin/localeData';
|
|
5
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
6
|
+
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
7
|
+
import 'dayjs/locale/zh-cn';
|
|
2
8
|
import {
|
|
3
9
|
getFormatted,
|
|
4
10
|
getDate,
|
|
@@ -21,12 +27,6 @@ import type {
|
|
|
21
27
|
MultiChange,
|
|
22
28
|
} from './types';
|
|
23
29
|
import Calendar from './components/Calendar';
|
|
24
|
-
import dayjs from 'dayjs';
|
|
25
|
-
import utc from 'dayjs/plugin/utc';
|
|
26
|
-
import localeData from 'dayjs/plugin/localeData';
|
|
27
|
-
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
28
|
-
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
29
|
-
import 'dayjs/locale/zh-cn';
|
|
30
30
|
|
|
31
31
|
dayjs.extend(utc);
|
|
32
32
|
dayjs.extend(localeData);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { ReactNode, memo } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import type {
|
|
3
|
+
import { CONTAINER_HEIGHT } from 'src/enums';
|
|
4
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
5
|
+
import type { CalendarViews } from 'src/enums';
|
|
6
|
+
import type { HeaderProps, CalendarThemeProps } from 'src/types';
|
|
6
7
|
import Header from './Header';
|
|
7
8
|
import YearSelector from './YearSelector';
|
|
8
9
|
import MonthSelector from './MonthSelector';
|
|
9
10
|
import DaySelector from './DaySelector';
|
|
10
11
|
import TimeSelector from './TimeSelector';
|
|
11
12
|
import DatePicker from './DatePicker';
|
|
12
|
-
import { CONTAINER_HEIGHT } from '../enums';
|
|
13
13
|
|
|
14
14
|
const CalendarView: Record<CalendarViews, ReactNode> = {
|
|
15
15
|
year: <YearSelector />,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { useCalendarContext } from '
|
|
4
|
-
import
|
|
5
|
-
import { CONTAINER_HEIGHT } from '../enums';
|
|
3
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
4
|
+
import { CONTAINER_HEIGHT } from 'src/enums';
|
|
6
5
|
import {
|
|
7
6
|
getFormatted,
|
|
8
7
|
getParsedDate,
|
|
9
8
|
getDaysNumInMonth,
|
|
10
9
|
getTimeRange,
|
|
11
10
|
getDate,
|
|
12
|
-
} from '
|
|
11
|
+
} from 'src/utils';
|
|
12
|
+
import Wheel from './WheelPicker/Wheel';
|
|
13
13
|
|
|
14
14
|
function createNumberList(start: number, end: number, first: number = 1) {
|
|
15
15
|
return new Array(end - start).fill(0).map((_, index) => ({
|
|
@@ -90,30 +90,16 @@ const DatePicker: React.FC = () => {
|
|
|
90
90
|
[currentDate, onSelectDate]
|
|
91
91
|
);
|
|
92
92
|
|
|
93
|
-
const createIndicatorStyle = useCallback(
|
|
94
|
-
(index: number) => {
|
|
95
|
-
const len = columns?.length || 0;
|
|
96
|
-
if (!index && len > 1)
|
|
97
|
-
return { borderTopRightRadius: 0, borderBottomRightRadius: 0 };
|
|
98
|
-
else if (index === len - 1 && len > 1)
|
|
99
|
-
return { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 };
|
|
100
|
-
else if (len > 2) return { borderRadius: 0 };
|
|
101
|
-
else return undefined;
|
|
102
|
-
},
|
|
103
|
-
[columns]
|
|
104
|
-
);
|
|
105
|
-
|
|
106
93
|
return (
|
|
107
94
|
<View style={styles.container}>
|
|
108
95
|
<View style={styles.datePickerContainer}>
|
|
109
|
-
{columns?.map((item
|
|
96
|
+
{columns?.map((item) => (
|
|
110
97
|
<View style={styles.wheelContainer} key={item}>
|
|
111
98
|
{item === 'year' && (
|
|
112
99
|
<Wheel
|
|
113
100
|
value={year}
|
|
114
101
|
items={years}
|
|
115
102
|
setValue={(value) => onSelectYear(value)}
|
|
116
|
-
indicatorStyle={createIndicatorStyle(index)}
|
|
117
103
|
/>
|
|
118
104
|
)}
|
|
119
105
|
{item === 'month' && (
|
|
@@ -121,7 +107,6 @@ const DatePicker: React.FC = () => {
|
|
|
121
107
|
value={month + 1}
|
|
122
108
|
items={months}
|
|
123
109
|
setValue={(value) => onSelectMonth(value - 1)}
|
|
124
|
-
indicatorStyle={createIndicatorStyle(index)}
|
|
125
110
|
/>
|
|
126
111
|
)}
|
|
127
112
|
{item === 'day' && (
|
|
@@ -129,7 +114,6 @@ const DatePicker: React.FC = () => {
|
|
|
129
114
|
value={getDate(currentDate).date()}
|
|
130
115
|
items={days}
|
|
131
116
|
setValue={(value) => handleChangeDate(value, 'date')}
|
|
132
|
-
indicatorStyle={createIndicatorStyle(index)}
|
|
133
117
|
/>
|
|
134
118
|
)}
|
|
135
119
|
{item === 'hour' && (
|
|
@@ -137,7 +121,6 @@ const DatePicker: React.FC = () => {
|
|
|
137
121
|
value={hour}
|
|
138
122
|
items={hours}
|
|
139
123
|
setValue={(value) => handleChangeDate(value, 'hour')}
|
|
140
|
-
indicatorStyle={createIndicatorStyle(index)}
|
|
141
124
|
/>
|
|
142
125
|
)}
|
|
143
126
|
{item === 'minute' && (
|
|
@@ -145,7 +128,6 @@ const DatePicker: React.FC = () => {
|
|
|
145
128
|
value={minute}
|
|
146
129
|
items={minutes}
|
|
147
130
|
setValue={(value) => handleChangeDate(value, 'minute')}
|
|
148
|
-
indicatorStyle={createIndicatorStyle(index)}
|
|
149
131
|
/>
|
|
150
132
|
)}
|
|
151
133
|
{item === 'second' && (
|
|
@@ -153,7 +135,6 @@ const DatePicker: React.FC = () => {
|
|
|
153
135
|
value={second}
|
|
154
136
|
items={seconds}
|
|
155
137
|
setValue={(value) => handleChangeDate(value, 'second')}
|
|
156
|
-
indicatorStyle={createIndicatorStyle(index)}
|
|
157
138
|
/>
|
|
158
139
|
)}
|
|
159
140
|
</View>
|
package/src/components/Day.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { memo, useCallback } from 'react';
|
|
2
2
|
import { View, Text, Pressable, StyleSheet } from 'react-native';
|
|
3
|
-
import { CalendarThemeProps, IDayObject } from '../types';
|
|
4
|
-
import { CONTAINER_HEIGHT } from '../enums';
|
|
5
|
-
import { addColorAlpha } from '../utils';
|
|
6
3
|
import { isEqual } from 'lodash';
|
|
4
|
+
import { CalendarThemeProps, IDayObject } from 'src/types';
|
|
5
|
+
import { CONTAINER_HEIGHT } from 'src/enums';
|
|
6
|
+
import { addColorAlpha } from 'src/utils';
|
|
7
7
|
|
|
8
8
|
export const daySize = 46;
|
|
9
9
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useCallback } from 'react';
|
|
2
2
|
import { Text, View, StyleSheet } from 'react-native';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
|
-
import { useCalendarContext } from '
|
|
5
|
-
import Day, { EmptyDay } from './Day';
|
|
4
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
6
5
|
import {
|
|
7
6
|
getParsedDate,
|
|
8
7
|
getMonthDays,
|
|
@@ -12,7 +11,8 @@ import {
|
|
|
12
11
|
isDateBetween,
|
|
13
12
|
getDate,
|
|
14
13
|
getFormatted,
|
|
15
|
-
} from '
|
|
14
|
+
} from 'src/utils';
|
|
15
|
+
import Day, { EmptyDay } from './Day';
|
|
16
16
|
|
|
17
17
|
const DaySelector: React.FC = () => {
|
|
18
18
|
const {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { View, Text, Pressable, StyleSheet, Image } from 'react-native';
|
|
3
|
-
import { useCalendarContext } from '../CalendarContext';
|
|
4
3
|
import dayjs from 'dayjs';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
5
|
+
import type { HeaderProps } from 'src/types';
|
|
6
|
+
import { getDateYear, getYearRange, YEAR_PAGE_SIZE } from 'src/utils';
|
|
7
7
|
|
|
8
8
|
const Header: React.FC<HeaderProps> = ({ buttonPrevIcon, buttonNextIcon }) => {
|
|
9
9
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View, Pressable, StyleSheet } from 'react-native';
|
|
3
|
-
import { useCalendarContext } from '
|
|
4
|
-
import { getParsedDate, getMonths } from '
|
|
3
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
4
|
+
import { getParsedDate, getMonths } from 'src/utils';
|
|
5
5
|
|
|
6
6
|
const MonthSelector: React.FC = () => {
|
|
7
7
|
const { currentDate, onSelectMonth, theme } = useCalendarContext();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { Text, View, StyleSheet } from 'react-native';
|
|
3
|
-
import { useCalendarContext } from '
|
|
3
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
4
|
+
import { CONTAINER_HEIGHT } from 'src/enums';
|
|
5
|
+
import { getParsedDate, getDate, getFormatted } from 'src/utils';
|
|
4
6
|
import Wheel from './WheelPicker/Wheel';
|
|
5
|
-
import { CONTAINER_HEIGHT } from '../enums';
|
|
6
|
-
import { getParsedDate, getDate, getFormatted } from '../utils';
|
|
7
7
|
|
|
8
8
|
function createNumberList(num: number) {
|
|
9
9
|
return new Array(num).fill(0).map((_, index) => ({
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import { Platform
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
3
|
import WheelNative from './WheelNative';
|
|
4
4
|
import WheelWeb from './WheelWeb';
|
|
5
|
-
import { PickerOption } from '
|
|
5
|
+
import { PickerOption } from 'src/types';
|
|
6
6
|
|
|
7
7
|
interface WheelProps {
|
|
8
8
|
value: number;
|
|
9
9
|
setValue?: (value: number) => void;
|
|
10
10
|
items: Array<PickerOption>;
|
|
11
|
-
indicatorStyle?: ViewStyle;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
const Wheel: React.FC<WheelProps> = (props) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import { StyleSheet, Platform } from 'react-native';
|
|
3
2
|
import WheelPicker from './WheelNativePicker';
|
|
4
|
-
import { PickerOption } from '
|
|
3
|
+
import { PickerOption } from 'src/types';
|
|
5
4
|
|
|
6
5
|
interface WheelProps {
|
|
7
6
|
value: number | string;
|
|
@@ -19,7 +18,6 @@ const WheelNative: React.FC<WheelProps> = ({
|
|
|
19
18
|
value={value}
|
|
20
19
|
options={items}
|
|
21
20
|
onChange={setValue}
|
|
22
|
-
containerStyle={defaultStyles.container}
|
|
23
21
|
itemHeight={44}
|
|
24
22
|
decelerationRate="fast"
|
|
25
23
|
/>
|
|
@@ -27,14 +25,3 @@ const WheelNative: React.FC<WheelProps> = ({
|
|
|
27
25
|
};
|
|
28
26
|
|
|
29
27
|
export default memo(WheelNative);
|
|
30
|
-
|
|
31
|
-
const defaultStyles = StyleSheet.create({
|
|
32
|
-
container: {
|
|
33
|
-
display: 'flex',
|
|
34
|
-
...Platform.select({
|
|
35
|
-
web: {
|
|
36
|
-
userSelect: 'none',
|
|
37
|
-
},
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { Animated, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
3
4
|
import { PickerOption } from 'src/types';
|
|
4
5
|
|
|
5
6
|
interface ItemProps {
|
|
@@ -23,6 +24,7 @@ const WheelPickerItem: React.FC<ItemProps> = ({
|
|
|
23
24
|
rotationFunction,
|
|
24
25
|
scaleFunction,
|
|
25
26
|
}) => {
|
|
27
|
+
const { theme } = useCalendarContext();
|
|
26
28
|
const relativeScrollIndex = Animated.subtract(index, currentScrollIndex);
|
|
27
29
|
|
|
28
30
|
const translateY = relativeScrollIndex.interpolate({
|
|
@@ -118,9 +120,10 @@ const WheelPickerItem: React.FC<ItemProps> = ({
|
|
|
118
120
|
opacity,
|
|
119
121
|
transform: [{ translateY }, { rotateX }, { scale }],
|
|
120
122
|
},
|
|
123
|
+
theme.wheelPickerItemStyle,
|
|
121
124
|
]}
|
|
122
125
|
>
|
|
123
|
-
<Text>{option?.text}</Text>
|
|
126
|
+
<Text style={theme.wheelPickerTextStyle}>{option?.text}</Text>
|
|
124
127
|
</Animated.View>
|
|
125
128
|
);
|
|
126
129
|
};
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
NativeSyntheticEvent,
|
|
4
4
|
NativeScrollEvent,
|
|
5
5
|
Animated,
|
|
6
|
-
ViewStyle,
|
|
7
6
|
View,
|
|
8
7
|
ViewProps,
|
|
9
8
|
FlatListProps,
|
|
@@ -12,14 +11,14 @@ import {
|
|
|
12
11
|
StyleSheet,
|
|
13
12
|
} from 'react-native';
|
|
14
13
|
import WheelPickerItem from './wheel-picker-item';
|
|
15
|
-
import { PickerOption } from '
|
|
14
|
+
import { PickerOption } from 'src/types';
|
|
15
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
18
18
|
value: number | string;
|
|
19
19
|
options: PickerOption[];
|
|
20
20
|
onChange: (index: number | string) => void;
|
|
21
21
|
itemHeight?: number;
|
|
22
|
-
containerStyle?: ViewStyle;
|
|
23
22
|
containerProps?: Omit<ViewProps, 'style'>;
|
|
24
23
|
scaleFunction?: (x: number) => number;
|
|
25
24
|
rotationFunction?: (x: number) => number;
|
|
@@ -42,6 +41,7 @@ const WheelPicker: React.FC<Props> = ({
|
|
|
42
41
|
containerProps = {},
|
|
43
42
|
flatListProps = {},
|
|
44
43
|
}) => {
|
|
44
|
+
const { theme } = useCalendarContext();
|
|
45
45
|
const momentumStarted = useRef(false);
|
|
46
46
|
const selectedIndex = options.findIndex((item) => item.value === value);
|
|
47
47
|
|
|
@@ -141,7 +141,11 @@ const WheelPicker: React.FC<Props> = ({
|
|
|
141
141
|
|
|
142
142
|
return (
|
|
143
143
|
<View
|
|
144
|
-
style={[
|
|
144
|
+
style={[
|
|
145
|
+
styles.container,
|
|
146
|
+
{ height: containerHeight },
|
|
147
|
+
theme.wheelPickerContainerStyle,
|
|
148
|
+
]}
|
|
145
149
|
{...containerProps}
|
|
146
150
|
>
|
|
147
151
|
<View
|
|
@@ -151,6 +155,7 @@ const WheelPicker: React.FC<Props> = ({
|
|
|
151
155
|
transform: [{ translateY: -itemHeight / 2 }],
|
|
152
156
|
height: itemHeight,
|
|
153
157
|
},
|
|
158
|
+
theme.wheelPickerSelectedIndicatorStyle,
|
|
154
159
|
]}
|
|
155
160
|
/>
|
|
156
161
|
<Animated.FlatList
|
|
@@ -198,6 +203,7 @@ const WheelPicker: React.FC<Props> = ({
|
|
|
198
203
|
|
|
199
204
|
const styles = StyleSheet.create({
|
|
200
205
|
container: {
|
|
206
|
+
display: 'flex',
|
|
201
207
|
position: 'relative',
|
|
202
208
|
},
|
|
203
209
|
selectedIndicator: {
|
|
@@ -7,10 +7,11 @@ import {
|
|
|
7
7
|
Platform,
|
|
8
8
|
Text,
|
|
9
9
|
} from 'react-native';
|
|
10
|
-
import { sin } from './animated-math';
|
|
11
|
-
import { CONTAINER_HEIGHT } from '../../enums';
|
|
12
|
-
import { PickerOption } from '../../types';
|
|
13
10
|
import { isEqual } from 'lodash';
|
|
11
|
+
import { CONTAINER_HEIGHT } from 'src/enums';
|
|
12
|
+
import { PickerOption } from 'src/types';
|
|
13
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
14
|
+
import { sin } from './animated-math';
|
|
14
15
|
|
|
15
16
|
interface WheelProps {
|
|
16
17
|
value: number | string;
|
|
@@ -25,6 +26,7 @@ const WheelWeb: React.FC<WheelProps> = ({
|
|
|
25
26
|
setValue = () => {},
|
|
26
27
|
items,
|
|
27
28
|
}) => {
|
|
29
|
+
const { theme } = useCalendarContext();
|
|
28
30
|
const displayCount = 5;
|
|
29
31
|
const translateY = useRef(new Animated.Value(0)).current;
|
|
30
32
|
const renderCount =
|
|
@@ -120,7 +122,10 @@ const WheelWeb: React.FC<WheelProps> = ({
|
|
|
120
122
|
}, [displayValues, radius, value, displayCount, translateY]);
|
|
121
123
|
|
|
122
124
|
return (
|
|
123
|
-
<View
|
|
125
|
+
<View
|
|
126
|
+
style={[defaultStyles.container, theme.wheelPickerContainerStyle]}
|
|
127
|
+
{...panResponder.panHandlers}
|
|
128
|
+
>
|
|
124
129
|
<View
|
|
125
130
|
style={[
|
|
126
131
|
defaultStyles.selectedIndicator,
|
|
@@ -128,6 +133,7 @@ const WheelWeb: React.FC<WheelProps> = ({
|
|
|
128
133
|
transform: [{ translateY: -ITEM_HEIGHT / 2 }],
|
|
129
134
|
height: ITEM_HEIGHT,
|
|
130
135
|
},
|
|
136
|
+
theme.wheelPickerSelectedIndicatorStyle,
|
|
131
137
|
]}
|
|
132
138
|
/>
|
|
133
139
|
{displayValues?.map((displayValue, index) => {
|
|
@@ -156,7 +162,9 @@ const WheelWeb: React.FC<WheelProps> = ({
|
|
|
156
162
|
opacity: displayValue?.value !== value ? 0.3 : 1,
|
|
157
163
|
}}
|
|
158
164
|
>
|
|
159
|
-
<Text
|
|
165
|
+
<Text style={theme?.wheelPickerTextStyle}>
|
|
166
|
+
{displayValue?.text}
|
|
167
|
+
</Text>
|
|
160
168
|
</Animated.View>
|
|
161
169
|
);
|
|
162
170
|
})}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
TextStyle,
|
|
8
8
|
ViewStyle,
|
|
9
9
|
} from 'react-native';
|
|
10
|
-
import { useCalendarContext } from '
|
|
11
|
-
import { getDateYear, getYearRange } from '
|
|
10
|
+
import { useCalendarContext } from 'src/CalendarContext';
|
|
11
|
+
import { getDateYear, getYearRange } from 'src/utils';
|
|
12
12
|
|
|
13
13
|
const YearSelector: React.FC = () => {
|
|
14
14
|
const { currentDate, currentYear, onSelectYear, theme } =
|
package/src/types.ts
CHANGED
|
@@ -47,8 +47,7 @@ export type CalendarThemeProps = {
|
|
|
47
47
|
wheelPickerContainerStyle?: ViewStyle;
|
|
48
48
|
wheelPickerItemStyle?: ViewStyle;
|
|
49
49
|
wheelPickerTextStyle?: TextStyle;
|
|
50
|
-
|
|
51
|
-
wheelPickerDecelerationRate?: 'normal' | 'fast' | number;
|
|
50
|
+
wheelPickerSelectedIndicatorStyle?: ViewStyle;
|
|
52
51
|
selectedRangeBackgroundColor?: string;
|
|
53
52
|
};
|
|
54
53
|
|