@react-native-user-interface/date-picker-modal 0.1.6 → 0.2.0
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 +163 -0
- package/package.json +32 -14
- package/src/index.d.ts +1 -0
- package/src/index.js +8 -1
- package/src/index.js.map +1 -1
- package/src/lib/date-picker-modal.d.ts +2 -2
- package/src/lib/date-picker-modal.js +180 -192
- package/src/lib/date-picker-modal.js.map +1 -1
- package/src/lib/helpers/get-calendar-weeks-for-date.d.ts +28 -0
- package/src/lib/helpers/get-calendar-weeks-for-date.js +51 -0
- package/src/lib/helpers/get-calendar-weeks-for-date.js.map +1 -0
- package/src/lib/hooks/use-current-datetime.d.ts +1 -1
- package/src/lib/hooks/use-current-datetime.js +6 -4
- package/src/lib/hooks/use-current-datetime.js.map +1 -1
- package/src/lib/hooks/use-calendar-data-for-date.d.ts +0 -21
- package/src/lib/hooks/use-calendar-data-for-date.js +0 -45
- package/src/lib/hooks/use-calendar-data-for-date.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# @react-native-user-interface/date-picker-modal
|
|
2
|
+
|
|
3
|
+
A date picker for React Native that opens as a bottom-sheet modal. Step through months and years with the arrows, tap a day, and confirm.
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img alt="Date picker demo: stepping through months and picking a day" src="https://raw.githubusercontent.com/tw050x/react-native-user-interface/main/libs/date-picker-modal/media/demo.gif" width="300" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
> :warning: This library is not yet recommended for production use. Use at your own risk.
|
|
10
|
+
|
|
11
|
+
- Shows a full month, Sunday to Saturday, with days from the previous and next months greyed out.
|
|
12
|
+
- Highlights today, and the selected day.
|
|
13
|
+
- Only the year, month and day change: the time of day of the `Date` you pass in is kept. This means you can share one `Date` with [`<TimePickerModal />`](https://www.npmjs.com/package/@react-native-user-interface/time-picker-modal).
|
|
14
|
+
- Every part can be restyled through the `stylesheet` prop.
|
|
15
|
+
- Written in TypeScript, with types included.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- React Native 0.80 or later, with the New Architecture enabled (Reanimated 4 requires it).
|
|
20
|
+
- React 19.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install @react-native-user-interface/date-picker-modal
|
|
26
|
+
# or
|
|
27
|
+
yarn add @react-native-user-interface/date-picker-modal
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Peer dependencies
|
|
31
|
+
|
|
32
|
+
| Package | Version |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| [date-fns](https://www.npmjs.com/package/date-fns) | 2.30+, 3 or 4 |
|
|
35
|
+
| [react](https://www.npmjs.com/package/react) | 19+ |
|
|
36
|
+
| [react-native](https://www.npmjs.com/package/react-native) | 0.80+ |
|
|
37
|
+
| [react-native-gesture-handler](https://www.npmjs.com/package/react-native-gesture-handler) | 2.16+ (2.x) |
|
|
38
|
+
| [react-native-reanimated](https://www.npmjs.com/package/react-native-reanimated) | 4.x |
|
|
39
|
+
| [react-native-safe-area-context](https://www.npmjs.com/package/react-native-safe-area-context) | 4.4.1+ |
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm install date-fns react-native-gesture-handler react-native-reanimated react-native-worklets react-native-safe-area-context
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Reanimated 4 also needs [react-native-worklets](https://www.npmjs.com/package/react-native-worklets) and its Babel plugin. Add `react-native-worklets/plugin` as the **last** plugin in your Babel config. Pick the Reanimated and Worklets versions that match your React Native version; see the [Reanimated compatibility table](https://docs.swmansion.com/react-native-reanimated/docs/guides/compatibility).
|
|
46
|
+
|
|
47
|
+
### SVG support
|
|
48
|
+
|
|
49
|
+
The arrow icons are SVG files, so Metro needs to be able to import SVGs. We test with [react-native-svg](https://www.npmjs.com/package/react-native-svg) and [react-native-svg-transformer](https://www.npmjs.com/package/react-native-svg-transformer). They are not peer dependencies, so you can choose your own setup. Without one, Metro fails to bundle the package.
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npm install react-native-svg
|
|
53
|
+
npm install --save-dev react-native-svg-transformer
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
// metro.config.js
|
|
58
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
59
|
+
|
|
60
|
+
const defaultConfig = getDefaultConfig(__dirname);
|
|
61
|
+
const { assetExts, sourceExts } = defaultConfig.resolver;
|
|
62
|
+
|
|
63
|
+
module.exports = mergeConfig(defaultConfig, {
|
|
64
|
+
transformer: {
|
|
65
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
66
|
+
},
|
|
67
|
+
resolver: {
|
|
68
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
69
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
Render your app inside a `SafeAreaProvider`, then control the modal with `visible`:
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import React, { useState } from 'react';
|
|
80
|
+
import { Button, Text, View } from 'react-native';
|
|
81
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
82
|
+
import DatePickerModal from '@react-native-user-interface/date-picker-modal';
|
|
83
|
+
|
|
84
|
+
export const App = () => {
|
|
85
|
+
const [date, setDate] = useState(() => new Date());
|
|
86
|
+
const [visible, setVisible] = useState(false);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<SafeAreaProvider>
|
|
90
|
+
<View>
|
|
91
|
+
<Text>{date.toDateString()}</Text>
|
|
92
|
+
<Button title="Change date" onPress={() => setVisible(true)} />
|
|
93
|
+
</View>
|
|
94
|
+
<DatePickerModal
|
|
95
|
+
initialDate={date}
|
|
96
|
+
onCancel={() => setVisible(false)}
|
|
97
|
+
onConfirm={(selected) => {
|
|
98
|
+
setDate(selected);
|
|
99
|
+
setVisible(false);
|
|
100
|
+
}}
|
|
101
|
+
visible={visible}
|
|
102
|
+
/>
|
|
103
|
+
</SafeAreaProvider>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The modal does not close itself: hide it in `onConfirm` and `onCancel`. Tapping outside the sheet calls `onCancel`.
|
|
109
|
+
|
|
110
|
+
## Props
|
|
111
|
+
|
|
112
|
+
| Prop | Type | Default | Description |
|
|
113
|
+
| --- | --- | --- | --- |
|
|
114
|
+
| `visible` | `boolean` | `false` | Whether the modal is shown. |
|
|
115
|
+
| `initialDate` | `Date` | today | The date selected when the picker opens. Its time of day is kept in the confirmed date. |
|
|
116
|
+
| `onConfirm` | `(date: Date) => void` | | Called with the selected date when **Confirm** is pressed. |
|
|
117
|
+
| `onCancel` | `() => void` | | Called when **Cancel** is pressed or the backdrop is tapped. |
|
|
118
|
+
| `stylesheet` | `DatePickerModalStyleSheet` | `{}` | Style overrides, see below. |
|
|
119
|
+
| `animationType` | `'slide' \| 'fade' \| 'none'` | `'slide'` | Passed to React Native's `Modal`. |
|
|
120
|
+
| `presentationStyle` | `'overFullScreen' \| 'fullScreen' \| 'pageSheet' \| 'formSheet'` | `'overFullScreen'` | Passed to React Native's `Modal`. |
|
|
121
|
+
| `transparent` | `boolean` | `true` | Passed to React Native's `Modal`. |
|
|
122
|
+
|
|
123
|
+
## Styling
|
|
124
|
+
|
|
125
|
+
Pass a `stylesheet` to override any part of the default look. Each key is merged over the default style for that part.
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<DatePickerModal
|
|
129
|
+
stylesheet={{
|
|
130
|
+
confirmButton: { backgroundColor: '#111827' },
|
|
131
|
+
dateSelectorDayContentFocusedDayIndex: { backgroundColor: '#111827' },
|
|
132
|
+
heading: { fontSize: 24 },
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
| Key | Part |
|
|
138
|
+
| --- | --- |
|
|
139
|
+
| `container` | The full-screen backdrop. |
|
|
140
|
+
| `content` | The sheet. |
|
|
141
|
+
| `heading` | The "Select a Date" title. |
|
|
142
|
+
| `dateSelector` | The area holding the controls and calendar. |
|
|
143
|
+
| `dateSelectorControls`, `dateSelectorControl`, `dateSelectorControlText` | The year and month controls. |
|
|
144
|
+
| `dateSelectorWeekdays`, `dateSelectorWeekday`, `dateSelectorWeekdayText` | The S M T W T F S row. |
|
|
145
|
+
| `dateSelectorWeeks`, `dateSelectorWeek` | The calendar grid and each week row. |
|
|
146
|
+
| `dateSelectorDayContainer`, `dateSelectorDayContent`, `dateSelectorDayText` | Each day. |
|
|
147
|
+
| `dateSelectorDayTextIsCurrentMonth` | Text of days outside the shown month. |
|
|
148
|
+
| `dateSelectorDayContentCurrentDayIndex` | Today. |
|
|
149
|
+
| `dateSelectorDayContentFocusedDayIndex`, `dateSelectorDayTextIsSelected` | The selected day (today or later). |
|
|
150
|
+
| `dateSelectorDayContentFocusedPastDayIndex` | The selected day, when it is in the past. |
|
|
151
|
+
| `selectedDateErrorContainer`, `selectedDateErrorText` | The "You need to select a date" message. |
|
|
152
|
+
| `confirmButton`, `confirmButtonText` | The **Confirm** button. |
|
|
153
|
+
| `cancelButton`, `cancelButtonText` | The **Cancel** button. |
|
|
154
|
+
|
|
155
|
+
## TypeScript
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
import type { DatePickerModalProps, DatePickerModalStyleSheet } from '@react-native-user-interface/date-picker-modal';
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-user-interface/date-picker-modal",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A gesture driven date picker in a bottom-sheet modal for React Native, built on Reanimated and Gesture Handler.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react-native",
|
|
7
|
+
"react-native-component",
|
|
8
|
+
"date-picker",
|
|
9
|
+
"datepicker",
|
|
10
|
+
"modal",
|
|
11
|
+
"picker",
|
|
12
|
+
"reanimated",
|
|
13
|
+
"gesture-handler",
|
|
14
|
+
"ios",
|
|
15
|
+
"android"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/tw050x/react-native-user-interface/tree/main/libs/date-picker-modal#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/tw050x/react-native-user-interface/issues"
|
|
6
20
|
},
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"react-native-
|
|
10
|
-
"
|
|
11
|
-
"react-native-safe-area-context": "^4.4.1",
|
|
12
|
-
"tslib": "2.4.1"
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/tw050x/react-native-user-interface.git",
|
|
24
|
+
"directory": "libs/date-picker-modal"
|
|
13
25
|
},
|
|
14
26
|
"license": "MIT",
|
|
15
27
|
"private": false,
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"date-fns": "^2.30.0 || ^3.0.0 || ^4.0.0",
|
|
30
|
+
"react": ">=19.0.0",
|
|
31
|
+
"react-native": ">=0.80.0",
|
|
32
|
+
"react-native-gesture-handler": "^2.16.0",
|
|
33
|
+
"react-native-reanimated": "^4.0.0",
|
|
34
|
+
"react-native-safe-area-context": ">=4.4.1"
|
|
35
|
+
},
|
|
19
36
|
"types": "./src/index.d.ts",
|
|
20
|
-
"
|
|
21
|
-
|
|
37
|
+
"main": "./src/index.js",
|
|
38
|
+
"type": "commonjs"
|
|
39
|
+
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var date_picker_modal_1 = require("./lib/date-picker-modal");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(date_picker_modal_1).default; } });
|
|
2
9
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/date-picker-modal/src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/date-picker-modal/src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAkD;AAAzC,6HAAA,OAAO,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
3
|
-
export
|
|
3
|
+
export type DatePickerModalStyleSheet = {
|
|
4
4
|
cancelButton?: ViewStyle;
|
|
5
5
|
cancelButtonText?: TextStyle;
|
|
6
6
|
confirmButton?: ViewStyle;
|
|
@@ -28,7 +28,7 @@ export declare type DatePickerModalStyleSheet = {
|
|
|
28
28
|
selectedDateErrorContainer?: ViewStyle;
|
|
29
29
|
selectedDateErrorText?: TextStyle;
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
export type DatePickerModalProps = {
|
|
32
32
|
animationType?: 'fade' | 'none' | 'slide';
|
|
33
33
|
initialDate?: Date;
|
|
34
34
|
onCancel?: () => void;
|
|
@@ -1,21 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const react_native_1 = require("react-native");
|
|
41
|
+
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
42
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
43
|
+
const date_fns_1 = require("date-fns");
|
|
11
44
|
// assets
|
|
12
|
-
|
|
13
|
-
|
|
45
|
+
const ChevronLeft_svg_1 = __importDefault(require("../asset/ChevronLeft.svg"));
|
|
46
|
+
const ChevronRight_svg_1 = __importDefault(require("../asset/ChevronRight.svg"));
|
|
14
47
|
// hooks
|
|
15
|
-
|
|
16
|
-
|
|
48
|
+
const use_current_datetime_1 = __importDefault(require("./hooks/use-current-datetime"));
|
|
49
|
+
// helpers
|
|
50
|
+
const get_calendar_weeks_for_date_1 = __importStar(require("./helpers/get-calendar-weeks-for-date"));
|
|
17
51
|
//
|
|
18
|
-
const defaultStylesheet = StyleSheet.create({
|
|
52
|
+
const defaultStylesheet = react_native_1.StyleSheet.create({
|
|
19
53
|
cancelButton: {
|
|
20
54
|
backgroundColor: 'transparent',
|
|
21
55
|
borderRadius: 8,
|
|
@@ -122,6 +156,9 @@ const defaultStylesheet = StyleSheet.create({
|
|
|
122
156
|
flexDirection: 'row',
|
|
123
157
|
},
|
|
124
158
|
dateSelectorWeeks: {},
|
|
159
|
+
gestureHandlerRoot: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
},
|
|
125
162
|
heading: {
|
|
126
163
|
fontFamily: 'Arial',
|
|
127
164
|
fontSize: 30,
|
|
@@ -148,158 +185,107 @@ const defaultStylesheet = StyleSheet.create({
|
|
|
148
185
|
*/
|
|
149
186
|
const DatePickerModal = ({ animationType = 'slide', initialDate, onCancel, onConfirm, presentationStyle = 'overFullScreen', stylesheet = {}, transparent = true, visible = false, }) => {
|
|
150
187
|
var _a;
|
|
151
|
-
const { bottom } = useSafeAreaInsets();
|
|
152
|
-
const { currentDatetime } =
|
|
153
|
-
const [focusedDate, setFocusedDate] = useState(initialDate || currentDatetime);
|
|
154
|
-
const [selectedDate, setSelectedDate] = useState(initialDate || currentDatetime);
|
|
155
|
-
const [selectedDateError, setSelectedDateError] = useState(false);
|
|
156
|
-
const [dateSelectorColumnWidth, setDateSelectorColumnWidth] = useState(0);
|
|
157
|
-
const
|
|
158
|
-
const onCancelPress = useCallback(() => {
|
|
188
|
+
const { bottom } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
189
|
+
const { currentDatetime } = (0, use_current_datetime_1.default)();
|
|
190
|
+
const [focusedDate, setFocusedDate] = (0, react_1.useState)(initialDate || currentDatetime);
|
|
191
|
+
const [selectedDate, setSelectedDate] = (0, react_1.useState)(initialDate || currentDatetime);
|
|
192
|
+
const [selectedDateError, setSelectedDateError] = (0, react_1.useState)(false);
|
|
193
|
+
const [dateSelectorColumnWidth, setDateSelectorColumnWidth] = (0, react_1.useState)(0);
|
|
194
|
+
const onCancelPress = (0, react_1.useCallback)(() => {
|
|
159
195
|
if (onCancel)
|
|
160
196
|
onCancel();
|
|
161
197
|
}, [onCancel]);
|
|
162
|
-
const onConfirmPress = useCallback(() => {
|
|
198
|
+
const onConfirmPress = (0, react_1.useCallback)(() => {
|
|
163
199
|
if (selectedDate === undefined) {
|
|
164
200
|
setSelectedDateError(true);
|
|
165
201
|
return;
|
|
166
202
|
}
|
|
167
|
-
if (onConfirm)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
203
|
+
if (onConfirm) {
|
|
204
|
+
// Only the year, month and day change: keep the time of day from
|
|
205
|
+
// initialDate so the same Date can be shared with <TimePickerModal />.
|
|
206
|
+
const confirmedDate = new Date(selectedDate);
|
|
207
|
+
if (initialDate !== undefined) {
|
|
208
|
+
confirmedDate.setHours(initialDate.getHours(), initialDate.getMinutes(), initialDate.getSeconds(), initialDate.getMilliseconds());
|
|
209
|
+
}
|
|
210
|
+
onConfirm(confirmedDate);
|
|
211
|
+
}
|
|
212
|
+
}, [initialDate, onConfirm, selectedDate]);
|
|
213
|
+
const onContainerPress = (0, react_1.useCallback)(() => {
|
|
171
214
|
if (onCancel)
|
|
172
215
|
onCancel();
|
|
173
216
|
}, [onCancel]);
|
|
174
|
-
const onContentPress = useCallback(() => null, []);
|
|
175
|
-
const onDateSelectorWeeksLayout = useCallback((event) => {
|
|
217
|
+
const onContentPress = (0, react_1.useCallback)(() => null, []);
|
|
218
|
+
const onDateSelectorWeeksLayout = (0, react_1.useCallback)((event) => {
|
|
176
219
|
setDateSelectorColumnWidth(event.nativeEvent.layout.width / 7);
|
|
177
220
|
}, []);
|
|
178
|
-
const onGoToPreviousYearPress = useCallback(() => {
|
|
221
|
+
const onGoToPreviousYearPress = (0, react_1.useCallback)(() => {
|
|
179
222
|
if (focusedDate === undefined)
|
|
180
223
|
return;
|
|
181
|
-
setFocusedDate(subMonths(focusedDate, 12));
|
|
224
|
+
setFocusedDate((0, date_fns_1.subMonths)(focusedDate, 12));
|
|
182
225
|
}, [focusedDate]);
|
|
183
|
-
const onGoToNextYearPress = useCallback(() => {
|
|
226
|
+
const onGoToNextYearPress = (0, react_1.useCallback)(() => {
|
|
184
227
|
if (focusedDate === undefined)
|
|
185
228
|
return;
|
|
186
|
-
setFocusedDate(addMonths(focusedDate, 12));
|
|
229
|
+
setFocusedDate((0, date_fns_1.addMonths)(focusedDate, 12));
|
|
187
230
|
}, [focusedDate]);
|
|
188
|
-
const onGoToPreviousMonthPress = useCallback(() => {
|
|
231
|
+
const onGoToPreviousMonthPress = (0, react_1.useCallback)(() => {
|
|
189
232
|
if (focusedDate === undefined)
|
|
190
233
|
return;
|
|
191
|
-
setFocusedDate(subMonths(focusedDate, 1));
|
|
234
|
+
setFocusedDate((0, date_fns_1.subMonths)(focusedDate, 1));
|
|
192
235
|
}, [focusedDate]);
|
|
193
|
-
const onGoToNextMonthPress = useCallback(() => {
|
|
236
|
+
const onGoToNextMonthPress = (0, react_1.useCallback)(() => {
|
|
194
237
|
if (focusedDate === undefined)
|
|
195
238
|
return;
|
|
196
|
-
setFocusedDate(addMonths(focusedDate, 1));
|
|
239
|
+
setFocusedDate((0, date_fns_1.addMonths)(focusedDate, 1));
|
|
197
240
|
}, [focusedDate]);
|
|
198
|
-
const
|
|
199
|
-
const dateSelectorWeeks = useMemo(() => {
|
|
200
|
-
const { month, monthFirstDayWeekday, monthFirstDayWeekdayIndex, monthIndex, monthLastDay, previousMonthLastMonthDay, year } = calendarDataForFocusedDate;
|
|
201
|
-
if (month === undefined)
|
|
202
|
-
return;
|
|
203
|
-
if (monthFirstDayWeekday === undefined)
|
|
204
|
-
return;
|
|
205
|
-
if (monthFirstDayWeekdayIndex === undefined)
|
|
206
|
-
return;
|
|
207
|
-
if (monthIndex === undefined)
|
|
208
|
-
return;
|
|
209
|
-
if (monthLastDay === undefined)
|
|
210
|
-
return;
|
|
211
|
-
if (previousMonthLastMonthDay === undefined)
|
|
212
|
-
return;
|
|
213
|
-
if (year === undefined)
|
|
214
|
-
return;
|
|
215
|
-
const dateSelectorWeeksData = [{ days: [] }];
|
|
216
|
-
let calendarWeekIndex = 0;
|
|
217
|
-
// previous month
|
|
218
|
-
for (let iteration = previousMonthLastMonthDay - (monthFirstDayWeekdayIndex || 7); iteration < previousMonthLastMonthDay; iteration++) {
|
|
219
|
-
dateSelectorWeeksData[calendarWeekIndex].days.push({
|
|
220
|
-
date: new Date(year, monthIndex - 1, iteration + 1),
|
|
221
|
-
isCurrentMonth: false,
|
|
222
|
-
isNextMonth: false,
|
|
223
|
-
isPreviousMonth: true,
|
|
224
|
-
monthDay: iteration + 1,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
// current month
|
|
228
|
-
for (let iteration = 0; iteration < monthLastDay; iteration++) {
|
|
229
|
-
if (dateSelectorWeeksData[calendarWeekIndex].days.length === 7) {
|
|
230
|
-
calendarWeekIndex = calendarWeekIndex + 1;
|
|
231
|
-
dateSelectorWeeksData[calendarWeekIndex] = { days: [] };
|
|
232
|
-
}
|
|
233
|
-
dateSelectorWeeksData[calendarWeekIndex].days.push({
|
|
234
|
-
date: new Date(year, monthIndex, iteration + 1),
|
|
235
|
-
isCurrentMonth: true,
|
|
236
|
-
isNextMonth: false,
|
|
237
|
-
isPreviousMonth: false,
|
|
238
|
-
monthDay: iteration + 1,
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
const nextMonthDayCount = (7 - dateSelectorWeeksData[calendarWeekIndex].days.length) || 7;
|
|
242
|
-
for (let iteration = 0; iteration < nextMonthDayCount; iteration++) {
|
|
243
|
-
if (dateSelectorWeeksData[calendarWeekIndex].days.length === 7) {
|
|
244
|
-
calendarWeekIndex = calendarWeekIndex + 1;
|
|
245
|
-
dateSelectorWeeksData[calendarWeekIndex] = { days: [] };
|
|
246
|
-
}
|
|
247
|
-
if (dateSelectorWeeksData[calendarWeekIndex] === undefined)
|
|
248
|
-
dateSelectorWeeksData[calendarWeekIndex] = { days: [] };
|
|
249
|
-
dateSelectorWeeksData[calendarWeekIndex].days.push({
|
|
250
|
-
date: new Date(year, monthIndex + 1, iteration + 1),
|
|
251
|
-
isCurrentMonth: false,
|
|
252
|
-
isNextMonth: true,
|
|
253
|
-
isPreviousMonth: false,
|
|
254
|
-
monthDay: iteration + 1,
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
return dateSelectorWeeksData;
|
|
258
|
-
}, [calendarDataForFocusedDate]);
|
|
241
|
+
const dateSelectorWeeks = (0, react_1.useMemo)(() => (0, get_calendar_weeks_for_date_1.default)(focusedDate), [focusedDate]);
|
|
259
242
|
const renderDateSelectorControls = () => {
|
|
260
|
-
return (<View style={[defaultStylesheet.dateSelectorControls, stylesheet.dateSelectorControls]}>
|
|
261
|
-
<View style={[defaultStylesheet.dateSelectorControl, stylesheet.dateSelectorControl]}>
|
|
262
|
-
<TouchableOpacity onPress={onGoToPreviousYearPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
263
|
-
<
|
|
264
|
-
</TouchableOpacity>
|
|
265
|
-
<Text style={[defaultStylesheet.dateSelectorControlText, stylesheet.dateSelectorControlText]}>
|
|
266
|
-
{format(focusedDate, 'yyyy')}
|
|
267
|
-
</Text>
|
|
268
|
-
<TouchableOpacity onPress={onGoToNextYearPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
269
|
-
<
|
|
270
|
-
</TouchableOpacity>
|
|
271
|
-
</View>
|
|
272
|
-
<View style={[defaultStylesheet.dateSelectorControl, stylesheet.dateSelectorControl]}>
|
|
273
|
-
<TouchableOpacity onPress={onGoToPreviousMonthPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
274
|
-
<
|
|
275
|
-
</TouchableOpacity>
|
|
276
|
-
<Text style={[defaultStylesheet.dateSelectorControlText, stylesheet.dateSelectorControlText]}>
|
|
277
|
-
{format(focusedDate, 'MMM')}
|
|
278
|
-
</Text>
|
|
279
|
-
<TouchableOpacity onPress={onGoToNextMonthPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
280
|
-
<
|
|
281
|
-
</TouchableOpacity>
|
|
282
|
-
</View>
|
|
283
|
-
</View>);
|
|
243
|
+
return (<react_native_1.View style={[defaultStylesheet.dateSelectorControls, stylesheet.dateSelectorControls]}>
|
|
244
|
+
<react_native_1.View style={[defaultStylesheet.dateSelectorControl, stylesheet.dateSelectorControl]}>
|
|
245
|
+
<react_native_gesture_handler_1.TouchableOpacity onPress={onGoToPreviousYearPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
246
|
+
<ChevronLeft_svg_1.default />
|
|
247
|
+
</react_native_gesture_handler_1.TouchableOpacity>
|
|
248
|
+
<react_native_1.Text style={[defaultStylesheet.dateSelectorControlText, stylesheet.dateSelectorControlText]}>
|
|
249
|
+
{(0, date_fns_1.format)(focusedDate, 'yyyy')}
|
|
250
|
+
</react_native_1.Text>
|
|
251
|
+
<react_native_gesture_handler_1.TouchableOpacity onPress={onGoToNextYearPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
252
|
+
<ChevronRight_svg_1.default />
|
|
253
|
+
</react_native_gesture_handler_1.TouchableOpacity>
|
|
254
|
+
</react_native_1.View>
|
|
255
|
+
<react_native_1.View style={[defaultStylesheet.dateSelectorControl, stylesheet.dateSelectorControl]}>
|
|
256
|
+
<react_native_gesture_handler_1.TouchableOpacity onPress={onGoToPreviousMonthPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
257
|
+
<ChevronLeft_svg_1.default />
|
|
258
|
+
</react_native_gesture_handler_1.TouchableOpacity>
|
|
259
|
+
<react_native_1.Text style={[defaultStylesheet.dateSelectorControlText, stylesheet.dateSelectorControlText]}>
|
|
260
|
+
{(0, date_fns_1.format)(focusedDate, 'MMM')}
|
|
261
|
+
</react_native_1.Text>
|
|
262
|
+
<react_native_gesture_handler_1.TouchableOpacity onPress={onGoToNextMonthPress} style={[defaultStylesheet.dateSelectorControlButton]}>
|
|
263
|
+
<ChevronRight_svg_1.default />
|
|
264
|
+
</react_native_gesture_handler_1.TouchableOpacity>
|
|
265
|
+
</react_native_1.View>
|
|
266
|
+
</react_native_1.View>);
|
|
284
267
|
};
|
|
285
268
|
const renderDateSelectorWeekdays = () => {
|
|
286
269
|
const weekdayMapper = (weekdayInitial, index) => {
|
|
287
270
|
const viewStyle = [
|
|
288
271
|
{ height: dateSelectorColumnWidth, width: dateSelectorColumnWidth },
|
|
289
272
|
];
|
|
290
|
-
return (<View key={index} style={[defaultStylesheet.dateSelectorWeekday, stylesheet.dateSelectorWeekday, viewStyle]}>
|
|
291
|
-
<Text style={[defaultStylesheet.dateSelectorWeekdayText, stylesheet.dateSelectorWeekdayText]}>
|
|
273
|
+
return (<react_native_1.View key={index} style={[defaultStylesheet.dateSelectorWeekday, stylesheet.dateSelectorWeekday, viewStyle]}>
|
|
274
|
+
<react_native_1.Text style={[defaultStylesheet.dateSelectorWeekdayText, stylesheet.dateSelectorWeekdayText]}>
|
|
292
275
|
{weekdayInitial.toUpperCase()}
|
|
293
|
-
</Text>
|
|
294
|
-
</View>);
|
|
276
|
+
</react_native_1.Text>
|
|
277
|
+
</react_native_1.View>);
|
|
295
278
|
};
|
|
296
|
-
return (
|
|
279
|
+
return (
|
|
280
|
+
// Measure the weekday row, not the padded container: the row spans the
|
|
281
|
+
// inner width that the seven columns must fill.
|
|
282
|
+
<react_native_1.View onLayout={onDateSelectorWeeksLayout} style={defaultStylesheet.dateSelectorWeekdays}>
|
|
297
283
|
{['S', 'M', 'T', 'W', 'T', 'F', 'S'].map(weekdayMapper)}
|
|
298
|
-
</View>);
|
|
284
|
+
</react_native_1.View>);
|
|
299
285
|
};
|
|
300
286
|
const renderDateSelectorWeeks = () => {
|
|
301
287
|
const dateSelectorWeekMapper = ({ date: dailyDate, isCurrentMonth, monthDay }) => {
|
|
302
|
-
const normalisedCurrentDate = startOfDay(currentDatetime);
|
|
288
|
+
const normalisedCurrentDate = (0, date_fns_1.startOfDay)(currentDatetime);
|
|
303
289
|
const containerStyle = [
|
|
304
290
|
{ height: dateSelectorColumnWidth, width: dateSelectorColumnWidth },
|
|
305
291
|
];
|
|
@@ -309,92 +295,94 @@ const DatePickerModal = ({ animationType = 'slide', initialDate, onCancel, onCon
|
|
|
309
295
|
if (isCurrentMonth === false) {
|
|
310
296
|
textStyle.push(stylesheet.dateSelectorDayTextIsCurrentMonth || defaultStylesheet.dateSelectorDayTextIsCurrentMonth);
|
|
311
297
|
}
|
|
312
|
-
if (selectedDate !== undefined && selectedDate >= normalisedCurrentDate && isSameDay(dailyDate, selectedDate)) {
|
|
298
|
+
if (selectedDate !== undefined && selectedDate >= normalisedCurrentDate && (0, date_fns_1.isSameDay)(dailyDate, selectedDate)) {
|
|
313
299
|
textStyle.push(stylesheet.dateSelectorDayTextIsSelected || defaultStylesheet.dateSelectorDayTextIsSelected);
|
|
314
300
|
}
|
|
315
301
|
const viewStyle = [
|
|
316
302
|
{ borderRadius: dateSelectorColumnWidth / 2, height: dateSelectorColumnWidth - 5, width: dateSelectorColumnWidth - 5 },
|
|
317
303
|
];
|
|
318
|
-
if (isSameDay(dailyDate, normalisedCurrentDate)) {
|
|
304
|
+
if ((0, date_fns_1.isSameDay)(dailyDate, normalisedCurrentDate)) {
|
|
319
305
|
viewStyle.push(stylesheet.dateSelectorDayContentCurrentDayIndex || defaultStylesheet.dateSelectorDayContentCurrentDayIndex);
|
|
320
306
|
}
|
|
321
|
-
if (selectedDate !== undefined && selectedDate < normalisedCurrentDate && isSameDay(dailyDate, selectedDate)) {
|
|
307
|
+
if (selectedDate !== undefined && selectedDate < normalisedCurrentDate && (0, date_fns_1.isSameDay)(dailyDate, selectedDate)) {
|
|
322
308
|
viewStyle.push(stylesheet.dateSelectorDayContentFocusedPastDayIndex || defaultStylesheet.dateSelectorDayContentFocusedPastDayIndex);
|
|
323
309
|
}
|
|
324
|
-
if (selectedDate !== undefined && selectedDate >= normalisedCurrentDate && isSameDay(dailyDate, selectedDate)) {
|
|
310
|
+
if (selectedDate !== undefined && selectedDate >= normalisedCurrentDate && (0, date_fns_1.isSameDay)(dailyDate, selectedDate)) {
|
|
325
311
|
viewStyle.push(stylesheet.dateSelectorDayContentFocusedDayIndex || defaultStylesheet.dateSelectorDayContentFocusedDayIndex);
|
|
326
312
|
}
|
|
327
|
-
return (<View key={dailyDate.toString()} style={[defaultStylesheet.dateSelectorDayContainer, stylesheet.dateSelectorDayContainer, containerStyle]}>
|
|
328
|
-
|
|
329
|
-
|
|
313
|
+
return (<react_native_1.View key={dailyDate.toString()} style={[defaultStylesheet.dateSelectorDayContainer, stylesheet.dateSelectorDayContainer, containerStyle]}>
|
|
314
|
+
{/* collapsable={false}: on Android a view with no background is flattened away, and the
|
|
315
|
+
rounded corners are lost when a selected background is added later. */}
|
|
316
|
+
<react_native_1.View collapsable={false} style={[defaultStylesheet.dateSelectorDayContent, stylesheet.dateSelectorDayContent, viewStyle]}>
|
|
317
|
+
<react_native_1.Text style={[defaultStylesheet.dateSelectorDayText, stylesheet.dateSelectorDayText, textStyle]}>
|
|
330
318
|
{monthDay}
|
|
331
|
-
</Text>
|
|
332
|
-
</View>
|
|
333
|
-
</View>);
|
|
319
|
+
</react_native_1.Text>
|
|
320
|
+
</react_native_1.View>
|
|
321
|
+
</react_native_1.View>);
|
|
334
322
|
};
|
|
335
323
|
const dateSelectorWeeksMapper = ({ days }, index) => {
|
|
336
|
-
return (<View key={index} style={[defaultStylesheet.dateSelectorWeek, stylesheet.dateSelectorWeek]}>
|
|
324
|
+
return (<react_native_1.View key={index} style={[defaultStylesheet.dateSelectorWeek, stylesheet.dateSelectorWeek]}>
|
|
337
325
|
{days.map(dateSelectorWeekMapper)}
|
|
338
|
-
</View>);
|
|
326
|
+
</react_native_1.View>);
|
|
339
327
|
};
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
328
|
+
// Always reserve room for the most weeks a month can need. Months have five
|
|
329
|
+
// or six weeks, and the sheet is anchored to the bottom of the screen, so
|
|
330
|
+
// without this the heading and controls would jump when the row count
|
|
331
|
+
// changes. The weeks are laid out from the top and any spare row is left
|
|
332
|
+
// empty at the bottom.
|
|
333
|
+
const weeksStyle = { minHeight: dateSelectorColumnWidth * get_calendar_weeks_for_date_1.MAX_CALENDAR_WEEKS };
|
|
334
|
+
return (<react_native_gesture_handler_1.GestureDetector gesture={dayTapGesture}>
|
|
335
|
+
<react_native_1.View style={[defaultStylesheet.dateSelectorWeeks, stylesheet.dateSelectorWeeks, weeksStyle]} testID="date-picker-calendar">
|
|
336
|
+
{dateSelectorWeeks.map(dateSelectorWeeksMapper)}
|
|
337
|
+
</react_native_1.View>
|
|
338
|
+
</react_native_gesture_handler_1.GestureDetector>);
|
|
345
339
|
};
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (
|
|
340
|
+
// Work out which day was tapped from the tap position in the grid. The
|
|
341
|
+
// gesture runs on the JS thread so it can update React state directly.
|
|
342
|
+
const onDayTapGestureEnd = (event) => {
|
|
343
|
+
var _a, _b;
|
|
344
|
+
if (dateSelectorColumnWidth === 0)
|
|
351
345
|
return;
|
|
352
|
-
|
|
346
|
+
const columnIndex = Math.min(Math.floor(event.x / dateSelectorColumnWidth), 6);
|
|
347
|
+
const rowIndex = Math.floor(event.y / dateSelectorColumnWidth);
|
|
348
|
+
// Taps in the empty row reserved below a five-week month select nothing.
|
|
349
|
+
if (columnIndex < 0 || rowIndex < 0 || rowIndex >= dateSelectorWeeks.length)
|
|
353
350
|
return;
|
|
354
|
-
const tappedDate = (_a = dateSelectorWeeks === null ||
|
|
355
|
-
if (tappedDate
|
|
356
|
-
const normalisedFocusedDate = new Date(tappedDate);
|
|
357
|
-
normalisedFocusedDate.setHours(0);
|
|
358
|
-
normalisedFocusedDate.setMinutes(0);
|
|
359
|
-
normalisedFocusedDate.setSeconds(0);
|
|
360
|
-
normalisedFocusedDate.setMilliseconds(0);
|
|
361
|
-
targetDate.current = normalisedFocusedDate;
|
|
362
|
-
}
|
|
363
|
-
};
|
|
364
|
-
const onDayTapGestureEnd = () => {
|
|
365
|
-
if (targetDate.current === undefined)
|
|
351
|
+
const tappedDate = (_b = (_a = dateSelectorWeeks[rowIndex]) === null || _a === void 0 ? void 0 : _a.days[columnIndex]) === null || _b === void 0 ? void 0 : _b.date;
|
|
352
|
+
if (tappedDate === undefined)
|
|
366
353
|
return;
|
|
367
|
-
|
|
354
|
+
setSelectedDate((0, date_fns_1.startOfDay)(tappedDate));
|
|
368
355
|
};
|
|
369
|
-
const dayTapGesture = Gesture.Tap()
|
|
370
|
-
|
|
371
|
-
onEnd(onDayTapGestureEnd);
|
|
356
|
+
const dayTapGesture = react_native_gesture_handler_1.Gesture.Tap()
|
|
357
|
+
.runOnJS(true)
|
|
358
|
+
.onEnd(onDayTapGestureEnd);
|
|
372
359
|
const contentStyles = {
|
|
373
360
|
paddingBottom: bottom + Number(((_a = stylesheet === null || stylesheet === void 0 ? void 0 : stylesheet.content) === null || _a === void 0 ? void 0 : _a.paddingBottom) || 0),
|
|
374
361
|
};
|
|
375
|
-
|
|
376
|
-
<
|
|
377
|
-
<
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
362
|
+
return (<react_native_1.Modal animationType={animationType} presentationStyle={presentationStyle} transparent={transparent} visible={visible}>
|
|
363
|
+
<react_native_gesture_handler_1.GestureHandlerRootView style={defaultStylesheet.gestureHandlerRoot}>
|
|
364
|
+
<react_native_gesture_handler_1.TouchableWithoutFeedback containerStyle={[defaultStylesheet.container, stylesheet.container]} onPress={onContainerPress} style={[defaultStylesheet.container, stylesheet.container]}>
|
|
365
|
+
<react_native_gesture_handler_1.TouchableWithoutFeedback onPress={onContentPress} style={[defaultStylesheet.content, stylesheet.content, contentStyles]}>
|
|
366
|
+
<react_native_1.Text style={[defaultStylesheet.heading, stylesheet.heading]}>Select a Date</react_native_1.Text>
|
|
367
|
+
<react_native_1.View style={[defaultStylesheet.dateSelector, stylesheet.dateSelector]}>
|
|
368
|
+
{renderDateSelectorControls()}
|
|
369
|
+
{renderDateSelectorWeekdays()}
|
|
370
|
+
{renderDateSelectorWeeks()}
|
|
371
|
+
</react_native_1.View>
|
|
372
|
+
<react_native_1.View style={[defaultStylesheet.selectedDateErrorContainer, stylesheet.selectedDateErrorContainer]}>
|
|
373
|
+
{selectedDateError && <react_native_1.Text style={[defaultStylesheet.selectedDateErrorText, stylesheet.selectedDateErrorText]}>You need to select a date</react_native_1.Text>}
|
|
374
|
+
</react_native_1.View>
|
|
375
|
+
<react_native_gesture_handler_1.TouchableOpacity onPress={onConfirmPress} style={[defaultStylesheet.confirmButton, stylesheet.confirmButton]}>
|
|
376
|
+
<react_native_1.Text style={[defaultStylesheet.confirmButtonText, stylesheet.confirmButtonText]}>Confirm</react_native_1.Text>
|
|
377
|
+
</react_native_gesture_handler_1.TouchableOpacity>
|
|
378
|
+
<react_native_gesture_handler_1.TouchableOpacity onPress={onCancelPress} style={[defaultStylesheet.cancelButton, stylesheet.cancelButton]}>
|
|
379
|
+
<react_native_1.Text style={[defaultStylesheet.cancelButtonText, stylesheet.cancelButtonText]}>Cancel</react_native_1.Text>
|
|
380
|
+
</react_native_gesture_handler_1.TouchableOpacity>
|
|
381
|
+
</react_native_gesture_handler_1.TouchableWithoutFeedback>
|
|
382
|
+
</react_native_gesture_handler_1.TouchableWithoutFeedback>
|
|
383
|
+
</react_native_gesture_handler_1.GestureHandlerRootView>
|
|
384
|
+
</react_native_1.Modal>);
|
|
397
385
|
};
|
|
398
386
|
//
|
|
399
|
-
|
|
387
|
+
exports.default = DatePickerModal;
|
|
400
388
|
//# sourceMappingURL=date-picker-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-modal.js","sourceRoot":"","sources":["../../../../../../libs/date-picker-modal/src/lib/date-picker-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAqB,KAAK,EAAE,UAAU,EAAE,IAAI,EAAa,IAAI,EAAa,MAAM,cAAc,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,eAAe,EAA0D,gBAAgB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACnM,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,SAAS,MAAM,oBAAoB,C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,CAClB;QAAA,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC,CACzG;UAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAC9F;QAAA,EAAE,gBAAgB,CACpB;MAAA,EAAE,wBAAwB,CAC5B;IAAA,EAAE,wBAAwB,CAAC,CAC5B,CAAC,CAAA;IAEF,OAAO,CACL,CAAC,KAAK,CACJ,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CAEjB;MAAA,CAAC,SAAS,CAAC,AAAD,EACZ;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,EAAE;AACF,eAAe,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"date-picker-modal.js","sourceRoot":"","sources":["../../../../../../libs/date-picker-modal/src/lib/date-picker-modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiF;AACjF,+CAAsG;AACtG,+EAAoM;AACpM,mFAAmE;AACnE,uCAA+E;AAE/E,SAAS;AACT,+EAAmD;AACnD,iFAAqD;AAErD,QAAQ;AACR,wFAA8D;AAE9D,UAAU;AACV,qGAA+H;AAgC/H,EAAE;AACF,MAAM,iBAAiB,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC1C,YAAY,EAAE;QACZ,eAAe,EAAE,aAAa;QAC9B,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,EAAE;QAChB,gBAAgB,EAAE,EAAE;KACrB;IACD,gBAAgB,EA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,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,EAAE,mBAAI,CACjG;YAAA,EAAE,+CAAgB,CAClB;YAAA,CAAC,+CAAgB,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC,CACzG;cAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,EAAE,mBAAI,CAC9F;YAAA,EAAE,+CAAgB,CACpB;UAAA,EAAE,uDAAwB,CAC5B;QAAA,EAAE,uDAAwB,CAC5B;MAAA,EAAE,qDAAsB,CAC1B;IAAA,EAAE,oBAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,EAAE;AACF,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type CalendarDay = {
|
|
2
|
+
date: Date;
|
|
3
|
+
isCurrentMonth: boolean;
|
|
4
|
+
isNextMonth: boolean;
|
|
5
|
+
isPreviousMonth: boolean;
|
|
6
|
+
monthDay: number;
|
|
7
|
+
};
|
|
8
|
+
export type CalendarWeek = {
|
|
9
|
+
days: Array<CalendarDay>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The most weeks any month needs. The calendar reserves room for this many rows
|
|
13
|
+
* so its height does not change between months.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MAX_CALENDAR_WEEKS = 6;
|
|
16
|
+
/**
|
|
17
|
+
* Builds the weeks shown in the calendar for the month containing `date`.
|
|
18
|
+
*
|
|
19
|
+
* Weeks start on Sunday. The grid always shows at least one day from the
|
|
20
|
+
* previous month and one from the next: when the month starts on a Sunday a
|
|
21
|
+
* full week of the previous month is shown, and when it ends on a Saturday a
|
|
22
|
+
* full week of the next month is shown.
|
|
23
|
+
*
|
|
24
|
+
* @param {Date} date - Any date in the month to show.
|
|
25
|
+
* @returns {Array<CalendarWeek>}
|
|
26
|
+
*/
|
|
27
|
+
declare const getCalendarWeeksForDate: (date: Date) => Array<CalendarWeek>;
|
|
28
|
+
export default getCalendarWeeksForDate;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_CALENDAR_WEEKS = void 0;
|
|
4
|
+
//
|
|
5
|
+
const DAYS_IN_A_WEEK = 7;
|
|
6
|
+
/**
|
|
7
|
+
* The most weeks any month needs. The calendar reserves room for this many rows
|
|
8
|
+
* so its height does not change between months.
|
|
9
|
+
*/
|
|
10
|
+
exports.MAX_CALENDAR_WEEKS = 6;
|
|
11
|
+
/**
|
|
12
|
+
* Builds the weeks shown in the calendar for the month containing `date`.
|
|
13
|
+
*
|
|
14
|
+
* Weeks start on Sunday. The grid always shows at least one day from the
|
|
15
|
+
* previous month and one from the next: when the month starts on a Sunday a
|
|
16
|
+
* full week of the previous month is shown, and when it ends on a Saturday a
|
|
17
|
+
* full week of the next month is shown.
|
|
18
|
+
*
|
|
19
|
+
* @param {Date} date - Any date in the month to show.
|
|
20
|
+
* @returns {Array<CalendarWeek>}
|
|
21
|
+
*/
|
|
22
|
+
const getCalendarWeeksForDate = (date) => {
|
|
23
|
+
const year = date.getFullYear();
|
|
24
|
+
const monthIndex = date.getMonth();
|
|
25
|
+
const firstWeekdayIndex = new Date(year, monthIndex, 1).getDay();
|
|
26
|
+
const daysInMonth = new Date(year, monthIndex + 1, 0).getDate();
|
|
27
|
+
const days = [];
|
|
28
|
+
// Previous month: fill back to Sunday, or a full week if the month starts on a Sunday.
|
|
29
|
+
const previousMonthDayCount = firstWeekdayIndex || DAYS_IN_A_WEEK;
|
|
30
|
+
for (let offset = previousMonthDayCount; offset > 0; offset--) {
|
|
31
|
+
const day = new Date(year, monthIndex, 1 - offset);
|
|
32
|
+
days.push({ date: day, isCurrentMonth: false, isNextMonth: false, isPreviousMonth: true, monthDay: day.getDate() });
|
|
33
|
+
}
|
|
34
|
+
// Current month.
|
|
35
|
+
for (let monthDay = 1; monthDay <= daysInMonth; monthDay++) {
|
|
36
|
+
days.push({ date: new Date(year, monthIndex, monthDay), isCurrentMonth: true, isNextMonth: false, isPreviousMonth: false, monthDay });
|
|
37
|
+
}
|
|
38
|
+
// Next month: fill to Saturday, or a full week if the month ends on a Saturday.
|
|
39
|
+
const nextMonthDayCount = (DAYS_IN_A_WEEK - (days.length % DAYS_IN_A_WEEK)) % DAYS_IN_A_WEEK || DAYS_IN_A_WEEK;
|
|
40
|
+
for (let monthDay = 1; monthDay <= nextMonthDayCount; monthDay++) {
|
|
41
|
+
days.push({ date: new Date(year, monthIndex + 1, monthDay), isCurrentMonth: false, isNextMonth: true, isPreviousMonth: false, monthDay });
|
|
42
|
+
}
|
|
43
|
+
const weeks = [];
|
|
44
|
+
for (let index = 0; index < days.length; index += DAYS_IN_A_WEEK) {
|
|
45
|
+
weeks.push({ days: days.slice(index, index + DAYS_IN_A_WEEK) });
|
|
46
|
+
}
|
|
47
|
+
return weeks;
|
|
48
|
+
};
|
|
49
|
+
//
|
|
50
|
+
exports.default = getCalendarWeeksForDate;
|
|
51
|
+
//# sourceMappingURL=get-calendar-weeks-for-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-calendar-weeks-for-date.js","sourceRoot":"","sources":["../../../../../../../libs/date-picker-modal/src/lib/helpers/get-calendar-weeks-for-date.ts"],"names":[],"mappings":";;;AAcA,EAAE;AACF,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;GAGG;AACU,QAAA,kBAAkB,GAAG,CAAC,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,MAAM,uBAAuB,GAAG,CAAC,IAAU,EAAuB,EAAE;IAClE,MAAM,IAAI,GAAG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AAC,GAAG,cAAc,IAAI,cAAc,CAAC;IAC/G,KAAK,IAAI,QAAQ,GAAG,CAAC,EAAE,QAAQ,IAAI,iBAAiB,EAAE,QAAQ,EAAE,EAAE,CAAC;QACjE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5I,CAAC;IAED,MAAM,KAAK,GAAwB,EAAE,CAAC;IACtC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,cAAc,EAAE,CAAC;QACjE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,EAAE;AACF,kBAAe,uBAAuB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
2
4
|
/**
|
|
3
5
|
*
|
|
4
6
|
* @returns {UserDateReturnValue}
|
|
5
7
|
*/
|
|
6
8
|
const useCurrentDatetime = () => {
|
|
7
|
-
const [currentDatetime, setCurrentDatetime] = useState(new Date());
|
|
8
|
-
useEffect(() => {
|
|
9
|
+
const [currentDatetime, setCurrentDatetime] = (0, react_1.useState)(new Date());
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
9
11
|
const date = currentDatetime;
|
|
10
12
|
const midnight = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 24, 0, 0, 0);
|
|
11
13
|
setCurrentDatetime(date);
|
|
@@ -20,5 +22,5 @@ const useCurrentDatetime = () => {
|
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
24
|
//
|
|
23
|
-
|
|
25
|
+
exports.default = useCurrentDatetime;
|
|
24
26
|
//# sourceMappingURL=use-current-datetime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-current-datetime.js","sourceRoot":"","sources":["../../../../../../../libs/date-picker-modal/src/lib/hooks/use-current-datetime.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"use-current-datetime.js","sourceRoot":"","sources":["../../../../../../../libs/date-picker-modal/src/lib/hooks/use-current-datetime.ts"],"names":[],"mappings":";;AAAA,iCAA2C;AAO3C;;;GAGG;AACH,MAAM,kBAAkB,GAAG,GAAwB,EAAE;IACnD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAO,IAAI,IAAI,EAAE,CAAC,CAAA;IAExE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,eAAe,CAAA;QAC5B,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QAE3F,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAExB,MAAM,sBAAsB,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;QACxE,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC,CAAA;QAExF,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,SAAS,CAAC,CAAA;QACzB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAA;IAErB,OAAO;QACL,eAAe;KAChB,CAAA;AACH,CAAC,CAAA;AAED,EAAE;AACF,kBAAe,kBAAkB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
declare type UseCalendarDataForDateReturnValue = {
|
|
2
|
-
monthFirstDayWeekday?: number;
|
|
3
|
-
monthFirstDayWeekdayIndex?: number;
|
|
4
|
-
month?: number;
|
|
5
|
-
monthDay?: number;
|
|
6
|
-
monthDayIndex?: number;
|
|
7
|
-
monthIndex?: number;
|
|
8
|
-
monthLastDay?: number;
|
|
9
|
-
monthLastDayIndex?: number;
|
|
10
|
-
previousMonthLastMonthDay?: number;
|
|
11
|
-
weekDay?: number;
|
|
12
|
-
weekDayIndex?: number;
|
|
13
|
-
year?: number;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param {Date} date
|
|
18
|
-
* @returns {UseCalendarDataForDateReturnValue}
|
|
19
|
-
*/
|
|
20
|
-
declare const useCalendarDataForDate: (datetime: Date | undefined) => UseCalendarDataForDateReturnValue;
|
|
21
|
-
export default useCalendarDataForDate;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {Date} date
|
|
5
|
-
* @returns {UseCalendarDataForDateReturnValue}
|
|
6
|
-
*/
|
|
7
|
-
const useCalendarDataForDate = (datetime) => {
|
|
8
|
-
const data = useMemo(() => {
|
|
9
|
-
if (datetime === undefined)
|
|
10
|
-
return {};
|
|
11
|
-
const monthIndex = datetime.getMonth();
|
|
12
|
-
const monthDay = datetime.getDate();
|
|
13
|
-
const weekDayIndex = datetime.getDay();
|
|
14
|
-
const year = datetime.getFullYear();
|
|
15
|
-
const month = monthIndex + 1;
|
|
16
|
-
const monthDayIndex = monthDay ? monthDay - 1 : undefined;
|
|
17
|
-
const monthLastDay = new Date(year, monthIndex + 1, 0).getDate();
|
|
18
|
-
const weekDay = weekDayIndex + 1;
|
|
19
|
-
const monthLastDayIndex = monthLastDay ? monthLastDay - 1 : undefined;
|
|
20
|
-
const firstDayDate = new Date(year, monthIndex, 1);
|
|
21
|
-
const monthFirstDayWeekdayIndex = firstDayDate.getDay();
|
|
22
|
-
const monthFirstDayWeekday = monthFirstDayWeekdayIndex + 1;
|
|
23
|
-
const previousMonthLastDayDate = new Date(firstDayDate);
|
|
24
|
-
previousMonthLastDayDate.setHours(-12);
|
|
25
|
-
const previousMonthLastMonthDay = previousMonthLastDayDate.getDate();
|
|
26
|
-
return {
|
|
27
|
-
monthFirstDayWeekday,
|
|
28
|
-
monthFirstDayWeekdayIndex,
|
|
29
|
-
month,
|
|
30
|
-
monthDay,
|
|
31
|
-
monthDayIndex,
|
|
32
|
-
monthIndex,
|
|
33
|
-
monthLastDay,
|
|
34
|
-
monthLastDayIndex,
|
|
35
|
-
previousMonthLastMonthDay,
|
|
36
|
-
weekDay,
|
|
37
|
-
weekDayIndex,
|
|
38
|
-
year,
|
|
39
|
-
};
|
|
40
|
-
}, [datetime]);
|
|
41
|
-
return data;
|
|
42
|
-
};
|
|
43
|
-
//
|
|
44
|
-
export default useCalendarDataForDate;
|
|
45
|
-
//# sourceMappingURL=use-calendar-data-for-date.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-calendar-data-for-date.js","sourceRoot":"","sources":["../../../../../../../libs/date-picker-modal/src/lib/hooks/use-calendar-data-for-date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAkB/B;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,CAAC,QAA0B,EAAqC,EAAE;IAC/F,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,EAAE,CAAA;QAErC,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAA;QACtC,MAAM,QAAQ,GAAG,QAAQ,CA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