react-native-nepali-picker 0.1.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/LICENSE +20 -0
- package/README.md +31 -0
- package/lib/commonjs/CalendarPicker.js +368 -0
- package/lib/commonjs/CalendarPicker.js.map +1 -0
- package/lib/commonjs/assets/DateSync.js +105 -0
- package/lib/commonjs/assets/DateSync.js.map +1 -0
- package/lib/commonjs/assets/Icons.js +182 -0
- package/lib/commonjs/assets/Icons.js.map +1 -0
- package/lib/commonjs/assets/Triangle.js +37 -0
- package/lib/commonjs/assets/Triangle.js.map +1 -0
- package/lib/commonjs/assets/cIcon.js +76 -0
- package/lib/commonjs/assets/cIcon.js.map +1 -0
- package/lib/commonjs/calendar/config.js +125 -0
- package/lib/commonjs/calendar/config.js.map +1 -0
- package/lib/commonjs/calendar/functions.js +114 -0
- package/lib/commonjs/calendar/functions.js.map +1 -0
- package/lib/commonjs/calendar/settings.js +40 -0
- package/lib/commonjs/calendar/settings.js.map +1 -0
- package/lib/commonjs/index.js +33 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/CalendarPicker.js +363 -0
- package/lib/module/CalendarPicker.js.map +1 -0
- package/lib/module/assets/DateSync.js +101 -0
- package/lib/module/assets/DateSync.js.map +1 -0
- package/lib/module/assets/Icons.js +175 -0
- package/lib/module/assets/Icons.js.map +1 -0
- package/lib/module/assets/Triangle.js +33 -0
- package/lib/module/assets/Triangle.js.map +1 -0
- package/lib/module/assets/cIcon.js +72 -0
- package/lib/module/assets/cIcon.js.map +1 -0
- package/lib/module/calendar/config.js +121 -0
- package/lib/module/calendar/config.js.map +1 -0
- package/lib/module/calendar/functions.js +106 -0
- package/lib/module/calendar/functions.js.map +1 -0
- package/lib/module/calendar/settings.js +35 -0
- package/lib/module/calendar/settings.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/CalendarPicker.d.ts +13 -0
- package/lib/typescript/commonjs/src/CalendarPicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/assets/DateSync.d.ts +7 -0
- package/lib/typescript/commonjs/src/assets/DateSync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/assets/Icons.d.ts +20 -0
- package/lib/typescript/commonjs/src/assets/Icons.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/assets/Triangle.d.ts +7 -0
- package/lib/typescript/commonjs/src/assets/Triangle.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/assets/cIcon.d.ts +6 -0
- package/lib/typescript/commonjs/src/assets/cIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/calendar/config.d.ts +9 -0
- package/lib/typescript/commonjs/src/calendar/config.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/calendar/functions.d.ts +7 -0
- package/lib/typescript/commonjs/src/calendar/functions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/calendar/settings.d.ts +4 -0
- package/lib/typescript/commonjs/src/calendar/settings.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/CalendarPicker.d.ts +13 -0
- package/lib/typescript/module/src/CalendarPicker.d.ts.map +1 -0
- package/lib/typescript/module/src/assets/DateSync.d.ts +7 -0
- package/lib/typescript/module/src/assets/DateSync.d.ts.map +1 -0
- package/lib/typescript/module/src/assets/Icons.d.ts +20 -0
- package/lib/typescript/module/src/assets/Icons.d.ts.map +1 -0
- package/lib/typescript/module/src/assets/Triangle.d.ts +7 -0
- package/lib/typescript/module/src/assets/Triangle.d.ts.map +1 -0
- package/lib/typescript/module/src/assets/cIcon.d.ts +6 -0
- package/lib/typescript/module/src/assets/cIcon.d.ts.map +1 -0
- package/lib/typescript/module/src/calendar/config.d.ts +9 -0
- package/lib/typescript/module/src/calendar/config.d.ts.map +1 -0
- package/lib/typescript/module/src/calendar/functions.d.ts +7 -0
- package/lib/typescript/module/src/calendar/functions.d.ts.map +1 -0
- package/lib/typescript/module/src/calendar/settings.d.ts +4 -0
- package/lib/typescript/module/src/calendar/settings.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +949 -0
- package/src/CalendarPicker.tsx +460 -0
- package/src/assets/DateSync.tsx +84 -0
- package/src/assets/Icons.tsx +143 -0
- package/src/assets/Triangle.tsx +31 -0
- package/src/assets/cIcon.tsx +74 -0
- package/src/calendar/config.ts +263 -0
- package/src/calendar/functions.ts +126 -0
- package/src/calendar/settings.ts +45 -0
- package/src/index.tsx +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Kushal Chapagain
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# react-native-nepali-picker
|
|
2
|
+
|
|
3
|
+
Nepali date (BS) picker of react native which also do date conversion form ADtoBS and vice versa. It is the most customizable Nepali date picker for react native where you can configure every part of calendar and make it suit your theme. Written in Typescript .
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install react-native-nepali-picker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { multiply } from 'react-native-nepali-picker';
|
|
15
|
+
|
|
16
|
+
// ...
|
|
17
|
+
|
|
18
|
+
const result = await multiply(3, 7);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Contributing
|
|
22
|
+
|
|
23
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
MIT
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _config = require("./calendar/config.js");
|
|
10
|
+
var _settings = require("./calendar/settings.js");
|
|
11
|
+
var _functions = require("./calendar/functions.js");
|
|
12
|
+
var _Icons = require("./assets/Icons.js");
|
|
13
|
+
var _DateSync = _interopRequireDefault(require("./assets/DateSync.js"));
|
|
14
|
+
var _Triangle = _interopRequireDefault(require("./assets/Triangle.js"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const CalendarPicker = ({
|
|
18
|
+
visible,
|
|
19
|
+
onClose,
|
|
20
|
+
theme = 'light',
|
|
21
|
+
onDateSelect,
|
|
22
|
+
language = 'np',
|
|
23
|
+
brandColor = '#2081b9'
|
|
24
|
+
}) => {
|
|
25
|
+
const TodayNepaliDate = (0, _functions.NepaliToday)();
|
|
26
|
+
const cYear = parseInt(TodayNepaliDate.split('-')[0], 10);
|
|
27
|
+
const cMonth = parseInt(TodayNepaliDate.split('-')[1], 10);
|
|
28
|
+
const cDay = parseInt(TodayNepaliDate.split('-')[2], 10);
|
|
29
|
+
const [firstDayOfMonth, setFirstDayOfMonth] = (0, _react.useState)(0);
|
|
30
|
+
const [month, setMonth] = (0, _react.useState)(cMonth);
|
|
31
|
+
const [year, setYear] = (0, _react.useState)(cYear);
|
|
32
|
+
const [calendarDate, setCalendarDate] = (0, _react.useState)([]);
|
|
33
|
+
const [yearModal, setYearModal] = (0, _react.useState)(false);
|
|
34
|
+
const handleDateClick = day => {
|
|
35
|
+
const date = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
|
|
36
|
+
onDateSelect(date);
|
|
37
|
+
onClose();
|
|
38
|
+
};
|
|
39
|
+
const handleNextClick = () => {
|
|
40
|
+
if (month === 12) {
|
|
41
|
+
if (year < 2099) {
|
|
42
|
+
setYear(prev => prev + 1);
|
|
43
|
+
setMonth(1);
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
setMonth(prev => prev + 1);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const handlePreviousClick = () => {
|
|
50
|
+
if (month === 1) {
|
|
51
|
+
if (year > 2000) {
|
|
52
|
+
setYear(prev => prev - 1);
|
|
53
|
+
setMonth(12);
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
setMonth(prev => prev - 1);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const openYearView = () => {
|
|
60
|
+
setYearModal(true);
|
|
61
|
+
};
|
|
62
|
+
const closeYearView = () => {
|
|
63
|
+
setYearModal(false);
|
|
64
|
+
};
|
|
65
|
+
(0, _react.useEffect)(() => {
|
|
66
|
+
// calculate First Day Of Month (FDOM) and Days In Month(DIM)
|
|
67
|
+
const FDOM = (0, _settings.calcFirstDay)(year, month);
|
|
68
|
+
const DIM = _config.bs[year][month];
|
|
69
|
+
setFirstDayOfMonth(FDOM);
|
|
70
|
+
|
|
71
|
+
// array which contain 42 cells and it only fill the date with number if the date is present otherwise it fill cells with null.
|
|
72
|
+
const calendarCells = Array.from({
|
|
73
|
+
length: 42
|
|
74
|
+
}, (_, index) => {
|
|
75
|
+
const dayNumber = index - FDOM + 1;
|
|
76
|
+
if (dayNumber > 0 && dayNumber <= DIM) {
|
|
77
|
+
return dayNumber;
|
|
78
|
+
} else {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
setCalendarDate(calendarCells);
|
|
83
|
+
}, [year, month]);
|
|
84
|
+
const syncToday = () => {
|
|
85
|
+
setMonth(cMonth);
|
|
86
|
+
setYear(cYear);
|
|
87
|
+
};
|
|
88
|
+
const handleYearClick = year => {
|
|
89
|
+
setYear(year);
|
|
90
|
+
closeYearView();
|
|
91
|
+
};
|
|
92
|
+
const dark = theme === 'dark';
|
|
93
|
+
const weekDays = language === 'en' ? _config.daysInEnglish : _config.daysInNepali;
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Modal, {
|
|
95
|
+
visible: visible,
|
|
96
|
+
onRequestClose: onClose,
|
|
97
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
98
|
+
style: styles.outerPressable,
|
|
99
|
+
onPress: onClose,
|
|
100
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
101
|
+
onPress: () => {},
|
|
102
|
+
style: styles.innerPressable,
|
|
103
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
104
|
+
style: {
|
|
105
|
+
...styles.innerView,
|
|
106
|
+
backgroundColor: dark ? '#383838' : '#ffffff'
|
|
107
|
+
},
|
|
108
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
109
|
+
style: {
|
|
110
|
+
color: dark ? 'white' : 'black',
|
|
111
|
+
paddingHorizontal: 10
|
|
112
|
+
},
|
|
113
|
+
children: language === 'np' ? 'आजको मिति ' : "Today's Date"
|
|
114
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
115
|
+
style: {
|
|
116
|
+
display: 'flex',
|
|
117
|
+
flexDirection: 'row',
|
|
118
|
+
justifyContent: 'space-between',
|
|
119
|
+
paddingHorizontal: 10,
|
|
120
|
+
marginBottom: 20,
|
|
121
|
+
alignItems: 'center'
|
|
122
|
+
},
|
|
123
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
124
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
125
|
+
onPress: syncToday,
|
|
126
|
+
children: language == 'np' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
127
|
+
style: {
|
|
128
|
+
...styles.TitleText,
|
|
129
|
+
fontSize: 20,
|
|
130
|
+
color: dark ? '#fff' : '#000'
|
|
131
|
+
},
|
|
132
|
+
children: [(0, _config.getNepaliNumber)(cYear), " ", _config.monthsInNepali[cMonth - 1], ' ', " ", (0, _config.getNepaliNumber)(cDay)]
|
|
133
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
134
|
+
style: {
|
|
135
|
+
...styles.TitleText,
|
|
136
|
+
fontSize: 27,
|
|
137
|
+
color: dark ? '#fff' : '#000'
|
|
138
|
+
},
|
|
139
|
+
children: [cYear, " ", _config.monthsInEnglish[cMonth - 1], ' ', " ", cDay]
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
143
|
+
onPress: syncToday,
|
|
144
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateSync.default, {
|
|
145
|
+
day: cDay,
|
|
146
|
+
color: dark ? '#ffff' : '#000'
|
|
147
|
+
})
|
|
148
|
+
})]
|
|
149
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
150
|
+
style: styles.ButtonContainer,
|
|
151
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
152
|
+
style: styles.CButton,
|
|
153
|
+
onPress: handlePreviousClick,
|
|
154
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icons.ChevronIcon, {
|
|
155
|
+
direction: "right",
|
|
156
|
+
color: dark ? 'white' : 'black'
|
|
157
|
+
})
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
159
|
+
style: {
|
|
160
|
+
flexDirection: 'row',
|
|
161
|
+
alignItems: 'center'
|
|
162
|
+
},
|
|
163
|
+
onPress: openYearView,
|
|
164
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
165
|
+
style: {
|
|
166
|
+
...styles.TitleText,
|
|
167
|
+
marginRight: 6,
|
|
168
|
+
color: dark ? 'white' : 'black'
|
|
169
|
+
},
|
|
170
|
+
children: language == 'np' ? _config.monthsInNepali[month - 1] : _config.monthsInEnglish[month - 1]
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
172
|
+
style: {
|
|
173
|
+
...styles.TitleText,
|
|
174
|
+
marginRight: 10,
|
|
175
|
+
color: dark ? 'white' : 'black'
|
|
176
|
+
},
|
|
177
|
+
children: language == 'np' ? (0, _config.getNepaliNumber)(year) : year
|
|
178
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Triangle.default, {
|
|
179
|
+
height: 10,
|
|
180
|
+
width: 13,
|
|
181
|
+
color: dark ? 'white' : 'black'
|
|
182
|
+
})]
|
|
183
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
184
|
+
style: styles.CButton,
|
|
185
|
+
onPress: handleNextClick,
|
|
186
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icons.ChevronIcon, {
|
|
187
|
+
direction: "left",
|
|
188
|
+
color: dark ? 'white' : 'black'
|
|
189
|
+
})
|
|
190
|
+
})]
|
|
191
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
192
|
+
style: styles.outerDateConainer,
|
|
193
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
194
|
+
style: styles.weekContainer,
|
|
195
|
+
children: weekDays.map((item, index) => {
|
|
196
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
197
|
+
style: styles.WeekItem,
|
|
198
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
199
|
+
style: {
|
|
200
|
+
...styles.WeekText,
|
|
201
|
+
color: dark ? 'white' : 'black'
|
|
202
|
+
},
|
|
203
|
+
children: item
|
|
204
|
+
})
|
|
205
|
+
}, index);
|
|
206
|
+
})
|
|
207
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
208
|
+
style: styles.datesContainer,
|
|
209
|
+
children: calendarDate.map((dayItem, index) => {
|
|
210
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
211
|
+
style: styles.dateItem,
|
|
212
|
+
onPress:
|
|
213
|
+
//execute on day item press, Only execute when dayItem is not null
|
|
214
|
+
dayItem ? () => handleDateClick(dayItem) : () => {},
|
|
215
|
+
children: dayItem ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
216
|
+
style: {
|
|
217
|
+
paddingHorizontal: 6,
|
|
218
|
+
paddingVertical: 3,
|
|
219
|
+
borderRadius: 999,
|
|
220
|
+
//check if the date is today or not and apply conditional styling.
|
|
221
|
+
backgroundColor: (0, _settings.isToday)(TodayNepaliDate, index, year, month, firstDayOfMonth) ? brandColor : dark ? '#383838' : '#fff'
|
|
222
|
+
},
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
224
|
+
style: {
|
|
225
|
+
...styles.DayText,
|
|
226
|
+
color: (0, _settings.isToday)(TodayNepaliDate, index, year, month, firstDayOfMonth) ? '#fff' : dark ? 'white' : 'black'
|
|
227
|
+
},
|
|
228
|
+
children: language === 'np' ? (0, _config.getNepaliNumber)(dayItem) : dayItem
|
|
229
|
+
})
|
|
230
|
+
}) : null
|
|
231
|
+
}, index);
|
|
232
|
+
})
|
|
233
|
+
})]
|
|
234
|
+
})]
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
238
|
+
visible: yearModal,
|
|
239
|
+
onRequestClose: closeYearView,
|
|
240
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
241
|
+
style: styles.outerPressable,
|
|
242
|
+
onPress: () => closeYearView(),
|
|
243
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
244
|
+
style: styles.YearInnerPressable,
|
|
245
|
+
onPress: () => {},
|
|
246
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
247
|
+
style: {
|
|
248
|
+
...styles.InnerYearView,
|
|
249
|
+
backgroundColor: dark ? '#383838' : '#f2f2f2'
|
|
250
|
+
},
|
|
251
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
252
|
+
showsVerticalScrollIndicator: false,
|
|
253
|
+
contentContainerStyle: {
|
|
254
|
+
display: 'flex',
|
|
255
|
+
paddingVertical: 10,
|
|
256
|
+
flexDirection: 'row',
|
|
257
|
+
justifyContent: 'center',
|
|
258
|
+
flexWrap: 'wrap'
|
|
259
|
+
},
|
|
260
|
+
children: Array(100).fill(0).map((_, index) => {
|
|
261
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
262
|
+
onPress: () => handleYearClick(index + 2000),
|
|
263
|
+
style: {
|
|
264
|
+
paddingHorizontal: 20,
|
|
265
|
+
paddingVertical: 6,
|
|
266
|
+
marginHorizontal: 4,
|
|
267
|
+
marginVertical: 4,
|
|
268
|
+
borderColor: dark ? 'white' : 'black',
|
|
269
|
+
borderRadius: 20,
|
|
270
|
+
backgroundColor: index + 2000 === year ? brandColor : '',
|
|
271
|
+
borderWidth: 0.4
|
|
272
|
+
},
|
|
273
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
274
|
+
style: {
|
|
275
|
+
fontWeight: '500',
|
|
276
|
+
color: index + 2000 === year ? 'white' : dark ? 'white' : 'black'
|
|
277
|
+
},
|
|
278
|
+
children: language === 'np' ? (0, _config.getNepaliNumber)(index + 2000) : index + 2000
|
|
279
|
+
})
|
|
280
|
+
}, index);
|
|
281
|
+
})
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
})
|
|
285
|
+
})
|
|
286
|
+
})]
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
const styles = _reactNative.StyleSheet.create({
|
|
290
|
+
outerPressable: {
|
|
291
|
+
height: '100%',
|
|
292
|
+
justifyContent: 'center',
|
|
293
|
+
width: '100%',
|
|
294
|
+
alignItems: 'center',
|
|
295
|
+
backgroundColor: 'rgba(0,0,0,0.54)'
|
|
296
|
+
},
|
|
297
|
+
innerPressable: {
|
|
298
|
+
minHeight: '20%',
|
|
299
|
+
maxWidth: 500,
|
|
300
|
+
marginHorizontal: 30
|
|
301
|
+
},
|
|
302
|
+
innerView: {
|
|
303
|
+
borderRadius: 20,
|
|
304
|
+
backgroundColor: '#f2f2f2',
|
|
305
|
+
padding: 10
|
|
306
|
+
},
|
|
307
|
+
weekContainer: {
|
|
308
|
+
flexDirection: 'row',
|
|
309
|
+
width: '100%'
|
|
310
|
+
},
|
|
311
|
+
WeekItem: {
|
|
312
|
+
width: '14.28%',
|
|
313
|
+
alignItems: 'center',
|
|
314
|
+
paddingVertical: 18
|
|
315
|
+
},
|
|
316
|
+
WeekText: {
|
|
317
|
+
fontWeight: 'bold',
|
|
318
|
+
fontSize: 14,
|
|
319
|
+
color: 'black'
|
|
320
|
+
},
|
|
321
|
+
datesContainer: {
|
|
322
|
+
flexDirection: 'row',
|
|
323
|
+
flexWrap: 'wrap'
|
|
324
|
+
},
|
|
325
|
+
dateItem: {
|
|
326
|
+
overflow: 'hidden',
|
|
327
|
+
width: '14.28%',
|
|
328
|
+
justifyContent: 'center',
|
|
329
|
+
alignItems: 'center',
|
|
330
|
+
paddingVertical: 10
|
|
331
|
+
},
|
|
332
|
+
DayText: {
|
|
333
|
+
fontSize: 14,
|
|
334
|
+
fontWeight: '600'
|
|
335
|
+
},
|
|
336
|
+
CButton: {
|
|
337
|
+
paddingHorizontal: 20,
|
|
338
|
+
paddingVertical: 10
|
|
339
|
+
},
|
|
340
|
+
ButtonContainer: {
|
|
341
|
+
alignItems: 'center',
|
|
342
|
+
flexDirection: 'row',
|
|
343
|
+
marginBottom: 10,
|
|
344
|
+
justifyContent: 'space-between'
|
|
345
|
+
},
|
|
346
|
+
outerDateConainer: {
|
|
347
|
+
paddingHorizontal: 3
|
|
348
|
+
},
|
|
349
|
+
TitleText: {
|
|
350
|
+
fontSize: 20,
|
|
351
|
+
fontWeight: 'bold'
|
|
352
|
+
},
|
|
353
|
+
// for year view modal
|
|
354
|
+
YearInnerPressable: {
|
|
355
|
+
justifyContent: 'center',
|
|
356
|
+
maxWidth: 500,
|
|
357
|
+
maxHeight: '70%',
|
|
358
|
+
marginHorizontal: 30
|
|
359
|
+
},
|
|
360
|
+
InnerYearView: {
|
|
361
|
+
borderRadius: 20,
|
|
362
|
+
backgroundColor: '#f2f2f2',
|
|
363
|
+
minHeight: 50,
|
|
364
|
+
maxHeight: '100%'
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
var _default = exports.default = CalendarPicker;
|
|
368
|
+
//# sourceMappingURL=CalendarPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_config","_settings","_functions","_Icons","_DateSync","_interopRequireDefault","_Triangle","_jsxRuntime","e","__esModule","default","CalendarPicker","visible","onClose","theme","onDateSelect","language","brandColor","TodayNepaliDate","NepaliToday","cYear","parseInt","split","cMonth","cDay","firstDayOfMonth","setFirstDayOfMonth","useState","month","setMonth","year","setYear","calendarDate","setCalendarDate","yearModal","setYearModal","handleDateClick","day","date","toString","padStart","handleNextClick","prev","handlePreviousClick","openYearView","closeYearView","useEffect","FDOM","calcFirstDay","DIM","bs","calendarCells","Array","from","length","_","index","dayNumber","syncToday","handleYearClick","dark","weekDays","daysInEnglish","daysInNepali","jsxs","Modal","onRequestClose","children","jsx","Pressable","style","styles","outerPressable","onPress","innerPressable","View","innerView","backgroundColor","Text","color","paddingHorizontal","display","flexDirection","justifyContent","marginBottom","alignItems","TouchableOpacity","TitleText","fontSize","getNepaliNumber","monthsInNepali","monthsInEnglish","ButtonContainer","CButton","ChevronIcon","direction","marginRight","height","width","outerDateConainer","weekContainer","map","item","WeekItem","WeekText","datesContainer","dayItem","dateItem","paddingVertical","borderRadius","isToday","DayText","YearInnerPressable","InnerYearView","ScrollView","showsVerticalScrollIndicator","contentContainerStyle","flexWrap","fill","marginHorizontal","marginVertical","borderColor","borderWidth","fontWeight","StyleSheet","create","minHeight","maxWidth","padding","overflow","maxHeight","_default","exports"],"sourceRoot":"../../src","sources":["CalendarPicker.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,OAAA,GAAAF,OAAA;AAQA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAD,sBAAA,CAAAP,OAAA;AAAyC,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAO,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAYzC,MAAMG,cAAc,GAAGA,CAAC;EACtBC,OAAO;EACPC,OAAO;EACPC,KAAK,GAAG,OAAO;EACfC,YAAY;EACZC,QAAQ,GAAG,IAAI;EACfC,UAAU,GAAG;AACM,CAAC,KAAK;EACzB,MAAMC,eAAe,GAAG,IAAAC,sBAAW,EAAC,CAAC;EACrC,MAAMC,KAAK,GAAGC,QAAQ,CAACH,eAAe,CAACI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;EACzD,MAAMC,MAAM,GAAGF,QAAQ,CAACH,eAAe,CAACI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;EAC1D,MAAME,IAAI,GAAGH,QAAQ,CAACH,eAAe,CAACI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;EAExD,MAAM,CAACG,eAAe,EAAEC,kBAAkB,CAAC,GAAG,IAAAC,eAAQ,EAAS,CAAC,CAAC;EACjE,MAAM,CAAC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ty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
const DateSyncLogo = ({
|
|
10
|
+
size = 28,
|
|
11
|
+
color = '#003a05',
|
|
12
|
+
day = 0
|
|
13
|
+
}) => {
|
|
14
|
+
const scale = size / 24;
|
|
15
|
+
|
|
16
|
+
// Format the date as DD
|
|
17
|
+
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
19
|
+
style: [styles.container, {
|
|
20
|
+
width: size,
|
|
21
|
+
height: size
|
|
22
|
+
}],
|
|
23
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
24
|
+
style: [styles.calendarBase, {
|
|
25
|
+
borderColor: color
|
|
26
|
+
}],
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
28
|
+
style: [styles.dateText, {
|
|
29
|
+
color: color,
|
|
30
|
+
fontSize: 9 * scale
|
|
31
|
+
}],
|
|
32
|
+
children: day
|
|
33
|
+
})
|
|
34
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
35
|
+
style: [styles.calendarTop, {
|
|
36
|
+
borderColor: color,
|
|
37
|
+
top: 2 * scale
|
|
38
|
+
}]
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const styles = _reactNative.StyleSheet.create({
|
|
43
|
+
container: {
|
|
44
|
+
aspectRatio: 1,
|
|
45
|
+
position: 'relative'
|
|
46
|
+
},
|
|
47
|
+
calendarBase: {
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
left: '12.5%',
|
|
50
|
+
top: '12.5%',
|
|
51
|
+
width: '75%',
|
|
52
|
+
height: '75%',
|
|
53
|
+
borderWidth: 2,
|
|
54
|
+
borderRadius: 3,
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
alignItems: 'center'
|
|
57
|
+
},
|
|
58
|
+
dateText: {
|
|
59
|
+
fontWeight: '800'
|
|
60
|
+
},
|
|
61
|
+
calendarTop: {
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
left: '12.5%',
|
|
64
|
+
width: '75%',
|
|
65
|
+
height: '20%',
|
|
66
|
+
borderTopWidth: 4,
|
|
67
|
+
borderLeftWidth: 2,
|
|
68
|
+
borderRightWidth: 2,
|
|
69
|
+
borderTopLeftRadius: 10,
|
|
70
|
+
borderTopRightRadius: 0
|
|
71
|
+
},
|
|
72
|
+
syncCircle: {
|
|
73
|
+
position: 'absolute',
|
|
74
|
+
width: '50%',
|
|
75
|
+
height: '50%',
|
|
76
|
+
borderWidth: 2,
|
|
77
|
+
borderRadius: 100,
|
|
78
|
+
justifyContent: 'center',
|
|
79
|
+
alignItems: 'center'
|
|
80
|
+
},
|
|
81
|
+
syncArrow: {
|
|
82
|
+
position: 'absolute',
|
|
83
|
+
width: '40%',
|
|
84
|
+
height: '40%',
|
|
85
|
+
borderWidth: 2,
|
|
86
|
+
borderTopWidth: 0,
|
|
87
|
+
borderRightWidth: 0,
|
|
88
|
+
transform: [{
|
|
89
|
+
rotate: '45deg'
|
|
90
|
+
}]
|
|
91
|
+
},
|
|
92
|
+
syncArrowLeft: {
|
|
93
|
+
left: '15%',
|
|
94
|
+
top: '10%'
|
|
95
|
+
},
|
|
96
|
+
syncArrowRight: {
|
|
97
|
+
right: '15%',
|
|
98
|
+
bottom: '10%',
|
|
99
|
+
transform: [{
|
|
100
|
+
rotate: '225deg'
|
|
101
|
+
}]
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
var _default = exports.default = DateSyncLogo;
|
|
105
|
+
//# sourceMappingURL=DateSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_jsxRuntime","DateSyncLogo","size","color","day","scale","jsxs","View","style","styles","container","width","height","children","jsx","calendarBase","borderColor","Text","dateText","fontSize","calendarTop","top","StyleSheet","create","aspectRatio","position","left","borderWidth","borderRadius","justifyContent","alignItems","fontWeight","borderTopWidth","borderLeftWidth","borderRightWidth","borderTopLeftRadius","borderTopRightRadius","syncCircle","syncArrow","transform","rotate","syncArrowLeft","syncArrowRight","right","bottom","_default","exports","default"],"sourceRoot":"../../../src","sources":["assets/DateSync.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAsD,IAAAC,WAAA,GAAAD,OAAA;AACtD,MAAME,YAAY,GAAGA,CAAC;EAAEC,IAAI,GAAG,EAAE;EAAEC,KAAK,GAAG,SAAS;EAAEC,GAAG,GAAG;AAAE,CAAC,KAAK;EAClE,MAAMC,KAAK,GAAGH,IAAI,GAAG,EAAE;;EAEvB;;EAEA,oBACE,IAAAF,WAAA,CAAAM,IAAA,EAACR,YAAA,CAAAS,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE;MAAEC,KAAK,EAAET,IAAI;MAAEU,MAAM,EAAEV;IAAK,CAAC,CAAE;IAAAW,QAAA,gBAE7D,IAAAb,WAAA,CAAAc,GAAA,EAAChB,YAAA,CAAAS,IAAI;MAACC,KAAK,EAAE,CAACC,MAAM,CAACM,YAAY,EAAE;QAAEC,WAAW,EAAEb;MAAM,CAAC,CAAE;MAAAU,QAAA,eAEzD,IAAAb,WAAA,CAAAc,GAAA,EAAChB,YAAA,CAAAmB,IAAI;QAACT,KAAK,EAAE,CAACC,MAAM,CAACS,QAAQ,EAAE;UAAEf,KAAK,EAAEA,KAAK;UAAEgB,QAAQ,EAAE,CAAC,GAAGd;QAAM,CAAC,CAAE;QAAAQ,QAAA,EACnET;MAAG,CACA;IAAC,CACH,CAAC,eAGP,IAAAJ,WAAA,CAAAc,GAAA,EAAChB,YAAA,CAAAS,IAAI;MACHC,KAAK,EAAE,CAACC,MAAM,CAACW,WAAW,EAAE;QAAEJ,WAAW,E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