digikhata-mashreq-sdk 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.
Files changed (203) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +37 -0
  3. package/lib/module/App.js +41 -0
  4. package/lib/module/App.js.map +1 -0
  5. package/lib/module/app/assets/Icons/Bill.png +0 -0
  6. package/lib/module/app/assets/Icons/Cash.png +0 -0
  7. package/lib/module/app/assets/Icons/Expense.png +0 -0
  8. package/lib/module/app/assets/Icons/Staff.png +0 -0
  9. package/lib/module/app/assets/Icons/Stock.png +0 -0
  10. package/lib/module/app/assets/images/bill.png +0 -0
  11. package/lib/module/app/assets/images/book.png +0 -0
  12. package/lib/module/app/assets/images/digiKhataSolo256.png +0 -0
  13. package/lib/module/app/assets/images/money.png +0 -0
  14. package/lib/module/app/assets/images/staff.png +0 -0
  15. package/lib/module/app/assets/images/stock.png +0 -0
  16. package/lib/module/app/assets/images/svgviewer-png-output-white.png +0 -0
  17. package/lib/module/app/components/Balance.js +153 -0
  18. package/lib/module/app/components/Balance.js.map +1 -0
  19. package/lib/module/app/components/CountryPhoneInput.js +271 -0
  20. package/lib/module/app/components/CountryPhoneInput.js.map +1 -0
  21. package/lib/module/app/components/Entries.js +89 -0
  22. package/lib/module/app/components/Entries.js.map +1 -0
  23. package/lib/module/app/components/SearchBar.js +70 -0
  24. package/lib/module/app/components/SearchBar.js.map +1 -0
  25. package/lib/module/app/components/Transaction.js +108 -0
  26. package/lib/module/app/components/Transaction.js.map +1 -0
  27. package/lib/module/app/components/User.js +109 -0
  28. package/lib/module/app/components/User.js.map +1 -0
  29. package/lib/module/app/components/index.js +10 -0
  30. package/lib/module/app/components/index.js.map +1 -0
  31. package/lib/module/app/database/clients.js +149 -0
  32. package/lib/module/app/database/clients.js.map +1 -0
  33. package/lib/module/app/database/database.js +9 -0
  34. package/lib/module/app/database/database.js.map +1 -0
  35. package/lib/module/app/database/schema.js +525 -0
  36. package/lib/module/app/database/schema.js.map +1 -0
  37. package/lib/module/app/navigation/BottomTabs/BottomTabs.js +29 -0
  38. package/lib/module/app/navigation/BottomTabs/BottomTabs.js.map +1 -0
  39. package/lib/module/app/navigation/Drawer/Drawer.js +13 -0
  40. package/lib/module/app/navigation/Drawer/Drawer.js.map +1 -0
  41. package/lib/module/app/navigation/HomeStack/HomeStack.js +36 -0
  42. package/lib/module/app/navigation/HomeStack/HomeStack.js.map +1 -0
  43. package/lib/module/app/navigation/Root.js +26 -0
  44. package/lib/module/app/navigation/Root.js.map +1 -0
  45. package/lib/module/app/navigation/index.js +7 -0
  46. package/lib/module/app/navigation/index.js.map +1 -0
  47. package/lib/module/app/redux/Store.js +10 -0
  48. package/lib/module/app/redux/Store.js.map +1 -0
  49. package/lib/module/app/redux/reducers/client/client_actions.js +2 -0
  50. package/lib/module/app/redux/reducers/client/client_actions.js.map +1 -0
  51. package/lib/module/app/redux/reducers/client/client_reducers.js +26 -0
  52. package/lib/module/app/redux/reducers/client/client_reducers.js.map +1 -0
  53. package/lib/module/app/redux/reducers/client/client_types.js +7 -0
  54. package/lib/module/app/redux/reducers/client/client_types.js.map +1 -0
  55. package/lib/module/app/screens/AddScreen.js +200 -0
  56. package/lib/module/app/screens/AddScreen.js.map +1 -0
  57. package/lib/module/app/screens/Banks.js +126 -0
  58. package/lib/module/app/screens/Banks.js.map +1 -0
  59. package/lib/module/app/screens/CustomerEntries.js +475 -0
  60. package/lib/module/app/screens/CustomerEntries.js.map +1 -0
  61. package/lib/module/app/screens/Customers.js +233 -0
  62. package/lib/module/app/screens/Customers.js.map +1 -0
  63. package/lib/module/app/screens/Entry.js +696 -0
  64. package/lib/module/app/screens/Entry.js.map +1 -0
  65. package/lib/module/app/screens/HomeScreen.js +176 -0
  66. package/lib/module/app/screens/HomeScreen.js.map +1 -0
  67. package/lib/module/app/screens/SelectBusiness.js +201 -0
  68. package/lib/module/app/screens/SelectBusiness.js.map +1 -0
  69. package/lib/module/app/screens/Splash.js +51 -0
  70. package/lib/module/app/screens/Splash.js.map +1 -0
  71. package/lib/module/app/screens/Suppliers.js +222 -0
  72. package/lib/module/app/screens/Suppliers.js.map +1 -0
  73. package/lib/module/app/screens/TransactionDetails.js +301 -0
  74. package/lib/module/app/screens/TransactionDetails.js.map +1 -0
  75. package/lib/module/app/screens/index.js +14 -0
  76. package/lib/module/app/screens/index.js.map +1 -0
  77. package/lib/module/app/themes/config.js +156 -0
  78. package/lib/module/app/themes/config.js.map +1 -0
  79. package/lib/module/app/utils/countries.json +1930 -0
  80. package/lib/module/declarations.d.js +2 -0
  81. package/lib/module/declarations.d.js.map +1 -0
  82. package/lib/module/index.js +5 -0
  83. package/lib/module/index.js.map +1 -0
  84. package/lib/module/package.json +1 -0
  85. package/lib/typescript/babel.config.d.ts +10 -0
  86. package/lib/typescript/babel.config.d.ts.map +1 -0
  87. package/lib/typescript/eslint.config.d.mts +3 -0
  88. package/lib/typescript/eslint.config.d.mts.map +1 -0
  89. package/lib/typescript/package.json +1 -0
  90. package/lib/typescript/src/App.d.ts +2 -0
  91. package/lib/typescript/src/App.d.ts.map +1 -0
  92. package/lib/typescript/src/app/components/Balance.d.ts +8 -0
  93. package/lib/typescript/src/app/components/Balance.d.ts.map +1 -0
  94. package/lib/typescript/src/app/components/CountryPhoneInput.d.ts +6 -0
  95. package/lib/typescript/src/app/components/CountryPhoneInput.d.ts.map +1 -0
  96. package/lib/typescript/src/app/components/Entries.d.ts +4 -0
  97. package/lib/typescript/src/app/components/Entries.d.ts.map +1 -0
  98. package/lib/typescript/src/app/components/SearchBar.d.ts +6 -0
  99. package/lib/typescript/src/app/components/SearchBar.d.ts.map +1 -0
  100. package/lib/typescript/src/app/components/Transaction.d.ts +11 -0
  101. package/lib/typescript/src/app/components/Transaction.d.ts.map +1 -0
  102. package/lib/typescript/src/app/components/User.d.ts +10 -0
  103. package/lib/typescript/src/app/components/User.d.ts.map +1 -0
  104. package/lib/typescript/src/app/components/index.d.ts +8 -0
  105. package/lib/typescript/src/app/components/index.d.ts.map +1 -0
  106. package/lib/typescript/src/app/database/clients.d.ts +9 -0
  107. package/lib/typescript/src/app/database/clients.d.ts.map +1 -0
  108. package/lib/typescript/src/app/database/database.d.ts +3 -0
  109. package/lib/typescript/src/app/database/database.d.ts.map +1 -0
  110. package/lib/typescript/src/app/database/schema.d.ts +2 -0
  111. package/lib/typescript/src/app/database/schema.d.ts.map +1 -0
  112. package/lib/typescript/src/app/navigation/BottomTabs/BottomTabs.d.ts +2 -0
  113. package/lib/typescript/src/app/navigation/BottomTabs/BottomTabs.d.ts.map +1 -0
  114. package/lib/typescript/src/app/navigation/Drawer/Drawer.d.ts +2 -0
  115. package/lib/typescript/src/app/navigation/Drawer/Drawer.d.ts.map +1 -0
  116. package/lib/typescript/src/app/navigation/HomeStack/HomeStack.d.ts +2 -0
  117. package/lib/typescript/src/app/navigation/HomeStack/HomeStack.d.ts.map +1 -0
  118. package/lib/typescript/src/app/navigation/Root.d.ts +2 -0
  119. package/lib/typescript/src/app/navigation/Root.d.ts.map +1 -0
  120. package/lib/typescript/src/app/navigation/index.d.ts +5 -0
  121. package/lib/typescript/src/app/navigation/index.d.ts.map +1 -0
  122. package/lib/typescript/src/app/redux/Store.d.ts +2 -0
  123. package/lib/typescript/src/app/redux/Store.d.ts.map +1 -0
  124. package/lib/typescript/src/app/redux/reducers/client/client_actions.d.ts +1 -0
  125. package/lib/typescript/src/app/redux/reducers/client/client_actions.d.ts.map +1 -0
  126. package/lib/typescript/src/app/redux/reducers/client/client_reducers.d.ts +3 -0
  127. package/lib/typescript/src/app/redux/reducers/client/client_reducers.d.ts.map +1 -0
  128. package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts +5 -0
  129. package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts.map +1 -0
  130. package/lib/typescript/src/app/screens/AddScreen.d.ts +5 -0
  131. package/lib/typescript/src/app/screens/AddScreen.d.ts.map +1 -0
  132. package/lib/typescript/src/app/screens/Banks.d.ts +2 -0
  133. package/lib/typescript/src/app/screens/Banks.d.ts.map +1 -0
  134. package/lib/typescript/src/app/screens/CustomerEntries.d.ts +5 -0
  135. package/lib/typescript/src/app/screens/CustomerEntries.d.ts.map +1 -0
  136. package/lib/typescript/src/app/screens/Customers.d.ts +4 -0
  137. package/lib/typescript/src/app/screens/Customers.d.ts.map +1 -0
  138. package/lib/typescript/src/app/screens/Entry.d.ts +5 -0
  139. package/lib/typescript/src/app/screens/Entry.d.ts.map +1 -0
  140. package/lib/typescript/src/app/screens/HomeScreen.d.ts +4 -0
  141. package/lib/typescript/src/app/screens/HomeScreen.d.ts.map +1 -0
  142. package/lib/typescript/src/app/screens/SelectBusiness.d.ts +4 -0
  143. package/lib/typescript/src/app/screens/SelectBusiness.d.ts.map +1 -0
  144. package/lib/typescript/src/app/screens/Splash.d.ts +4 -0
  145. package/lib/typescript/src/app/screens/Splash.d.ts.map +1 -0
  146. package/lib/typescript/src/app/screens/Suppliers.d.ts +4 -0
  147. package/lib/typescript/src/app/screens/Suppliers.d.ts.map +1 -0
  148. package/lib/typescript/src/app/screens/TransactionDetails.d.ts +5 -0
  149. package/lib/typescript/src/app/screens/TransactionDetails.d.ts.map +1 -0
  150. package/lib/typescript/src/app/screens/index.d.ts +12 -0
  151. package/lib/typescript/src/app/screens/index.d.ts.map +1 -0
  152. package/lib/typescript/src/app/themes/config.d.ts +63 -0
  153. package/lib/typescript/src/app/themes/config.d.ts.map +1 -0
  154. package/lib/typescript/src/index.d.ts +3 -0
  155. package/lib/typescript/src/index.d.ts.map +1 -0
  156. package/package.json +154 -0
  157. package/src/App.js +41 -0
  158. package/src/app/assets/Icons/Bill.png +0 -0
  159. package/src/app/assets/Icons/Cash.png +0 -0
  160. package/src/app/assets/Icons/Expense.png +0 -0
  161. package/src/app/assets/Icons/Staff.png +0 -0
  162. package/src/app/assets/Icons/Stock.png +0 -0
  163. package/src/app/assets/images/bill.png +0 -0
  164. package/src/app/assets/images/book.png +0 -0
  165. package/src/app/assets/images/digiKhataSolo256.png +0 -0
  166. package/src/app/assets/images/money.png +0 -0
  167. package/src/app/assets/images/staff.png +0 -0
  168. package/src/app/assets/images/stock.png +0 -0
  169. package/src/app/assets/images/svgviewer-png-output-white.png +0 -0
  170. package/src/app/components/Balance.js +122 -0
  171. package/src/app/components/CountryPhoneInput.js +286 -0
  172. package/src/app/components/Entries.js +75 -0
  173. package/src/app/components/SearchBar.js +64 -0
  174. package/src/app/components/Transaction.js +91 -0
  175. package/src/app/components/User.js +85 -0
  176. package/src/app/components/index.js +15 -0
  177. package/src/app/database/clients.js +207 -0
  178. package/src/app/database/database.js +9 -0
  179. package/src/app/database/schema.js +525 -0
  180. package/src/app/navigation/BottomTabs/BottomTabs.js +27 -0
  181. package/src/app/navigation/Drawer/Drawer.js +10 -0
  182. package/src/app/navigation/HomeStack/HomeStack.js +43 -0
  183. package/src/app/navigation/Root.js +32 -0
  184. package/src/app/navigation/index.js +9 -0
  185. package/src/app/redux/Store.js +9 -0
  186. package/src/app/redux/reducers/client/client_actions.js +0 -0
  187. package/src/app/redux/reducers/client/client_reducers.js +30 -0
  188. package/src/app/redux/reducers/client/client_types.js +5 -0
  189. package/src/app/screens/AddScreen.js +185 -0
  190. package/src/app/screens/Banks.js +151 -0
  191. package/src/app/screens/CustomerEntries.js +402 -0
  192. package/src/app/screens/Customers.js +240 -0
  193. package/src/app/screens/Entry.js +658 -0
  194. package/src/app/screens/HomeScreen.js +146 -0
  195. package/src/app/screens/SelectBusiness.js +177 -0
  196. package/src/app/screens/Splash.js +43 -0
  197. package/src/app/screens/Suppliers.js +228 -0
  198. package/src/app/screens/TransactionDetails.js +199 -0
  199. package/src/app/screens/index.js +23 -0
  200. package/src/app/themes/config.js +185 -0
  201. package/src/app/utils/countries.json +1930 -0
  202. package/src/declarations.d.ts +1 -0
  203. package/src/index.tsx +3 -0
@@ -0,0 +1,696 @@
1
+ "use strict";
2
+
3
+ import { View, Text, StyleSheet, TouchableOpacity, TextInput, Keyboard, ScrollView, Platform, PermissionsAndroid, Image, Dimensions } from 'react-native';
4
+ import React, { useState } from 'react';
5
+ import { COLORS, FONT_MEDIUM, FONT_NORMAL, HP, mergeDateTime, WP } from "../themes/config.js";
6
+ import LinearGradient from 'react-native-linear-gradient';
7
+ import Ionicons from "react-native-vector-icons/Ionicons";
8
+ import DateTimePicker, { DateTimePickerAndroid } from '@react-native-community/datetimepicker';
9
+ import { addTransaction, addTransactionImages } from "../database/clients.js";
10
+ import { useSelector } from "react-redux";
11
+ import Modal from "react-native-modal";
12
+ import { launchCamera, launchImageLibrary } from "react-native-image-picker";
13
+ import { pick } from "@react-native-documents/picker";
14
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ export default function Entry({
16
+ navigation,
17
+ route
18
+ }) {
19
+ const ClientDetails = useSelector(state => state.client.client_details);
20
+ const type = route?.params?.type;
21
+ const mainColor = type;
22
+ const [input, setInput] = useState('');
23
+ const [memory, setMemory] = useState(null);
24
+ const [Notes, setNotes] = useState("");
25
+ const [date, setDate] = useState(new Date());
26
+ const [time, setTime] = useState(new Date());
27
+ const [MergedDate, setMergedDate] = useState("");
28
+ const [isModalVisible, setIsModalVisible] = useState(false);
29
+ const [attachments, setAttachments] = useState([]); // {type, uri, name}
30
+
31
+ // ✅ Add file in state (max 3)
32
+ const addAttachment = file => {
33
+ if (attachments.length >= 3) {
34
+ alert("You can only attach up to 3 files.");
35
+ return;
36
+ }
37
+ setAttachments([...attachments, file]);
38
+ };
39
+
40
+ // ✅ Gallery
41
+ const handleGallery = async () => {
42
+ try {
43
+ const result = await launchImageLibrary({
44
+ mediaType: "photo"
45
+ });
46
+ if (result.assets && result.assets.length > 0) {
47
+ addAttachment({
48
+ type: "image",
49
+ uri: result.assets[0].uri,
50
+ name: result.assets[0].fileName || "gallery_image.jpg"
51
+ });
52
+ }
53
+ } catch (err) {
54
+ console.log("Gallery Error:", err);
55
+ }
56
+ setIsModalVisible(false);
57
+ };
58
+
59
+ // ✅ Camera with permission
60
+ const handleCamera = async () => {
61
+ try {
62
+ const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CAMERA, {
63
+ title: "Camera Permission",
64
+ message: "This app needs camera access to take photos",
65
+ buttonNeutral: "Ask Me Later",
66
+ buttonNegative: "Cancel",
67
+ buttonPositive: "OK"
68
+ });
69
+ if (granted === PermissionsAndroid.RESULTS.GRANTED) {
70
+ const result = await launchCamera({
71
+ mediaType: "photo"
72
+ });
73
+ if (result.assets && result.assets.length > 0) {
74
+ addAttachment({
75
+ type: "image",
76
+ uri: result.assets[0].uri,
77
+ name: result.assets[0].fileName || "camera_image.jpg"
78
+ });
79
+ }
80
+ } else {
81
+ alert("Camera permission denied");
82
+ }
83
+ } catch (err) {
84
+ console.log("Camera Error:", err);
85
+ }
86
+ setIsModalVisible(false);
87
+ };
88
+
89
+ // ✅ PDF Picker (using @react-native-documents/picker)
90
+ const handlePDF = async () => {
91
+ try {
92
+ const res = await pick({
93
+ type: ["application/pdf"]
94
+ });
95
+ if (res && res.length > 0) {
96
+ addAttachment({
97
+ type: "pdf",
98
+ uri: res[0].uri,
99
+ name: res[0].name || "document.pdf"
100
+ });
101
+ }
102
+ } catch (err) {
103
+ if (err.message !== "DOCUMENT_PICKER_CANCELED") {
104
+ console.log("PDF Error:", err);
105
+ }
106
+ }
107
+ setIsModalVisible(false);
108
+ };
109
+ const removeAttachment = index => {
110
+ setAttachments(attachments.filter((_, i) => i !== index));
111
+ };
112
+
113
+ // Calculator buttons
114
+ const buttons = [['AC', 'M+', 'M-', 'MR'], ['%', '÷', 'x', '-'], ['7', '8', '9', '+'], ['4', '5', '6', '='], ['1', '2', '3', '↵'], ['0', '.']];
115
+ const handlePress = key => {
116
+ if (key === 'AC') {
117
+ setInput('');
118
+ setMemory(null);
119
+ } else if (key === 'M+') {
120
+ if (input) setMemory(Number(input));
121
+ } else if (key === 'M-') {
122
+ setMemory(null);
123
+ } else if (key === 'MR') {
124
+ if (memory !== null) setInput(prev => prev + memory.toString());
125
+ } else if (key === '=') {
126
+ try {
127
+ const expression = input.replace(/x/g, '*').replace(/÷/g, '/').replace(/%/g, '/100');
128
+ const result = eval(expression);
129
+ setInput(result.toString());
130
+ } catch (err) {
131
+ setInput('Error');
132
+ }
133
+ } else if (key === '↵') {
134
+ Keyboard.dismiss();
135
+ } else {
136
+ setInput(prev => prev + key);
137
+ }
138
+ };
139
+ const handleBackspace = () => {
140
+ setInput(prev => prev.slice(0, -1));
141
+ };
142
+ const onChangeDate = (event, selectedDate) => {
143
+ const currentDate = selectedDate;
144
+ setDate(currentDate);
145
+ };
146
+ const onChangeTime = (event, selectedDate) => {
147
+ const currentDate = selectedDate;
148
+ setTime(currentDate);
149
+ };
150
+ const showDate = currentMode => {
151
+ DateTimePickerAndroid.open({
152
+ value: date,
153
+ onChange: onChangeDate,
154
+ mode: "date",
155
+ is24Hour: false
156
+ });
157
+ };
158
+ const showTime = currentMode => {
159
+ DateTimePickerAndroid.open({
160
+ value: time,
161
+ onChange: onChangeTime,
162
+ mode: "time",
163
+ is24Hour: false
164
+ });
165
+ };
166
+ const onSave = () => {
167
+ try {
168
+ let finalValue = input;
169
+ if (input) {
170
+ // Replace calculator symbols with JS operators
171
+ const expression = input.replace(/x/g, "*").replace(/÷/g, "/").replace(/%/g, "/100");
172
+ let result = eval(expression);
173
+
174
+ // ✅ Ensure result is a valid finite number
175
+ if (typeof result === "number" && isFinite(result)) {
176
+ finalValue = result.toString();
177
+ } else {
178
+ console.log("Invalid result, not saving");
179
+ return; // stop here
180
+ }
181
+ } else {
182
+ console.log("Empty input, not saving");
183
+ return;
184
+ }
185
+ addTransaction(ClientDetails.id, type == "red" ? finalValue : 0, type == "green" ? finalValue : 0, Notes, mergeDateTime({
186
+ date,
187
+ time
188
+ }), "").then(async res => {
189
+ console.log(res, "Transaction Success");
190
+ const trxId = res.insertId; // ✅ new transaction ID
191
+
192
+ // If there are attachments, insert them
193
+ if (attachments && attachments.length > 0) {
194
+ for (const file of attachments) {
195
+ try {
196
+ await addTransactionImages(trxId, file.uri);
197
+ console.log(`Attachment added: ${file.name}`);
198
+ } catch (err) {
199
+ console.log("Attachment insert error:", err);
200
+ }
201
+ }
202
+ }
203
+
204
+ // ✅ Reset form
205
+ setInput("");
206
+ setMemory("");
207
+ setNotes("");
208
+ setDate(new Date());
209
+ setTime(new Date());
210
+ setMergedDate("");
211
+ setAttachments([]);
212
+ navigation?.navigate("HomeScreen", {
213
+ screen: ClientDetails.type == 0 ? "Customers" : "Suppliers"
214
+ });
215
+ }).catch(err => {
216
+ console.log(err, "Transaction Error");
217
+ });
218
+ } catch (err) {
219
+ console.log("Calculation Error:", err);
220
+ }
221
+ };
222
+ return /*#__PURE__*/_jsxs(View, {
223
+ style: Styles._mainContainers,
224
+ children: [/*#__PURE__*/_jsx(LinearGradient, {
225
+ start: {
226
+ x: 0,
227
+ y: 0
228
+ },
229
+ end: {
230
+ x: 1,
231
+ y: 0
232
+ },
233
+ colors: [mainColor == "green" ? "darkgreen" : "darkred", mainColor],
234
+ style: Styles._linearGradient,
235
+ children: /*#__PURE__*/_jsxs(View, {
236
+ style: Styles._titleMain,
237
+ children: [/*#__PURE__*/_jsx(TouchableOpacity, {
238
+ activeOpacity: 0.8,
239
+ onPress: () => {
240
+ navigation.goBack();
241
+ },
242
+ children: /*#__PURE__*/_jsx(Ionicons, {
243
+ name: "chevron-back",
244
+ color: COLORS.whiteColor,
245
+ size: 20
246
+ })
247
+ }), ClientDetails.type == 0 ? /*#__PURE__*/_jsxs(Text, {
248
+ style: Styles._title,
249
+ children: ["You ", mainColor == "green" ? "Got" : "Gave", " Rs ", input, " ", mainColor == "green" ? "from" : "to", " ", ClientDetails?.name]
250
+ }) : /*#__PURE__*/_jsxs(Text, {
251
+ style: Styles._title,
252
+ children: [mainColor == "green" ? "Purchase" : "Payment", " of Rs ", input, " ", mainColor == "green" ? "from" : "to", " ", ClientDetails?.name]
253
+ })]
254
+ })
255
+ }), /*#__PURE__*/_jsx(View, {
256
+ style: Styles._contentMain,
257
+ children: /*#__PURE__*/_jsxs(View, {
258
+ style: {
259
+ width: "100%",
260
+ alignItems: "center",
261
+ gap: 12
262
+ },
263
+ children: [/*#__PURE__*/_jsxs(ScrollView, {
264
+ contentContainerStyle: Styles._scrollMain,
265
+ style: {
266
+ height: Platform.OS == "ios" ? 200 : Dimensions.get("screen").height - HP(74)
267
+ },
268
+ children: [/*#__PURE__*/_jsxs(View, {
269
+ style: Styles._inputMain,
270
+ children: [/*#__PURE__*/_jsx(Text, {
271
+ style: {
272
+ color: COLORS.blackColor,
273
+ fontFamily: FONT_NORMAL,
274
+ fontSize: 14,
275
+ opacity: 0.6
276
+ },
277
+ children: "Rs"
278
+ }), /*#__PURE__*/_jsx(TextInput, {
279
+ placeholder: "",
280
+ style: [Styles._input, {
281
+ color: mainColor
282
+ }],
283
+ placeholderTextColor: COLORS.grey,
284
+ cursorColor: COLORS.primaryColor,
285
+ value: input,
286
+ editable: false,
287
+ onFocus: () => Keyboard.dismiss()
288
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
289
+ onPress: handleBackspace,
290
+ children: /*#__PURE__*/_jsx(Text, {
291
+ style: {
292
+ fontSize: 18,
293
+ color: '#555',
294
+ paddingHorizontal: 8
295
+ },
296
+ children: "\u232B"
297
+ })
298
+ })]
299
+ }), memory !== null && /*#__PURE__*/_jsx(View, {
300
+ style: Styles._memoryDisplay,
301
+ children: /*#__PURE__*/_jsxs(Text, {
302
+ style: Styles._memoryText,
303
+ children: ["Memory: ", memory]
304
+ })
305
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
306
+ style: [Styles._inputMain, {
307
+ paddingHorizontal: 12
308
+ }],
309
+ activeOpacity: 0.8,
310
+ children: [/*#__PURE__*/_jsx(Text, {
311
+ style: {
312
+ color: mainColor,
313
+ fontFamily: FONT_NORMAL,
314
+ fontSize: 12
315
+ },
316
+ children: "Attach Voice Note"
317
+ }), /*#__PURE__*/_jsx(Ionicons, {
318
+ name: "mic-outline",
319
+ color: mainColor,
320
+ size: 22
321
+ })]
322
+ }), input && /*#__PURE__*/_jsxs(View, {
323
+ style: Styles._hidableMain,
324
+ children: [/*#__PURE__*/_jsxs(View, {
325
+ style: Styles._hidableRow,
326
+ children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
327
+ style: Styles._cellMain,
328
+ activeOpacity: 0.8,
329
+ onPress: showDate,
330
+ children: [/*#__PURE__*/_jsx(Ionicons, {
331
+ name: "calendar-outline",
332
+ color: mainColor,
333
+ size: 22
334
+ }), /*#__PURE__*/_jsx(Text, {
335
+ style: Styles._cellText,
336
+ children: date.toDateString()
337
+ })]
338
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
339
+ style: Styles._cellMain,
340
+ activeOpacity: 0.8,
341
+ onPress: showTime,
342
+ children: [/*#__PURE__*/_jsx(Ionicons, {
343
+ name: "time-outline",
344
+ color: mainColor,
345
+ size: 22
346
+ }), /*#__PURE__*/_jsx(Text, {
347
+ style: Styles._cellText,
348
+ children: time.toLocaleTimeString()
349
+ })]
350
+ })]
351
+ }), /*#__PURE__*/_jsx(TextInput, {
352
+ style: Styles._detailMain,
353
+ placeholder: "Enter Details",
354
+ placeholderTextColor: COLORS.grey,
355
+ multiline: true,
356
+ value: Notes,
357
+ onChangeText: text => setNotes(text)
358
+ }), /*#__PURE__*/_jsxs(View, {
359
+ style: Styles._hidableRow,
360
+ children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
361
+ style: Styles._cellMain,
362
+ activeOpacity: 0.8,
363
+ onPress: () => setIsModalVisible(true),
364
+ children: [/*#__PURE__*/_jsx(Ionicons, {
365
+ name: "attach",
366
+ color: mainColor,
367
+ size: 23
368
+ }), /*#__PURE__*/_jsx(Text, {
369
+ style: Styles._cellText,
370
+ children: "PDF/Photos"
371
+ })]
372
+ }), /*#__PURE__*/_jsx(View, {
373
+ style: {
374
+ flexDirection: "row",
375
+ flexWrap: "wrap",
376
+ alignItems: "center"
377
+ },
378
+ children: attachments.map((file, index) => /*#__PURE__*/_jsxs(View, {
379
+ style: {
380
+ marginLeft: 8,
381
+ alignItems: "center"
382
+ },
383
+ children: [file.type === "image" ? /*#__PURE__*/_jsx(Image, {
384
+ source: {
385
+ uri: file.uri
386
+ },
387
+ style: {
388
+ width: 40,
389
+ height: 40,
390
+ borderRadius: 5
391
+ }
392
+ }) : /*#__PURE__*/_jsx(Ionicons, {
393
+ name: "document-text-outline",
394
+ size: 30,
395
+ color: mainColor
396
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
397
+ onPress: () => removeAttachment(index),
398
+ style: {
399
+ position: "absolute",
400
+ top: -5,
401
+ right: -5,
402
+ backgroundColor: "white",
403
+ borderRadius: 10,
404
+ padding: 2
405
+ },
406
+ children: /*#__PURE__*/_jsx(Ionicons, {
407
+ name: "close-circle",
408
+ size: 18,
409
+ color: mainColor
410
+ })
411
+ })]
412
+ }, index))
413
+ })]
414
+ })]
415
+ })]
416
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
417
+ activeOpacity: 0.8,
418
+ style: [Styles._continueBtn, {
419
+ backgroundColor: mainColor
420
+ }],
421
+ onPress: onSave,
422
+ children: /*#__PURE__*/_jsx(Text, {
423
+ style: Styles._continueBtnTxt,
424
+ children: "Save"
425
+ })
426
+ }), /*#__PURE__*/_jsx(View, {
427
+ style: Styles._calculatorMain,
428
+ children: buttons.map((row, rowIndex) => /*#__PURE__*/_jsx(View, {
429
+ style: Styles._calculatorRow,
430
+ children: row.map(key => /*#__PURE__*/_jsx(TouchableOpacity, {
431
+ activeOpacity: 0.8,
432
+ style: [Styles._key, key === '0' && {
433
+ flex: 2
434
+ }, ['AC', 'M+', 'M-', 'MR'].includes(key) && {
435
+ backgroundColor: '#ccc'
436
+ }, ['=', '↵'].includes(key) && {
437
+ backgroundColor: COLORS.primaryColor
438
+ }, ['÷', 'x', '-', '+', '%'].includes(key) && {
439
+ backgroundColor: "#ccc"
440
+ }],
441
+ onPress: () => handlePress(key),
442
+ children: /*#__PURE__*/_jsx(Text, {
443
+ style: Styles._keyText,
444
+ children: key
445
+ })
446
+ }, key))
447
+ }, rowIndex))
448
+ })]
449
+ })
450
+ }), /*#__PURE__*/_jsx(Modal, {
451
+ isVisible: isModalVisible,
452
+ onBackdropPress: () => setIsModalVisible(false),
453
+ onBackButtonPress: () => setIsModalVisible(false),
454
+ children: /*#__PURE__*/_jsxs(View, {
455
+ style: {
456
+ backgroundColor: "white",
457
+ padding: 20,
458
+ borderRadius: 12
459
+ },
460
+ children: [/*#__PURE__*/_jsx(Text, {
461
+ style: {
462
+ fontSize: 16,
463
+ fontFamily: FONT_MEDIUM,
464
+ marginBottom: 12
465
+ },
466
+ children: "Choose Option"
467
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
468
+ style: Styles._modalBtn,
469
+ onPress: handleGallery,
470
+ children: [/*#__PURE__*/_jsx(Ionicons, {
471
+ name: "image-outline",
472
+ size: 20,
473
+ color: "red"
474
+ }), /*#__PURE__*/_jsx(Text, {
475
+ style: Styles._modalText,
476
+ children: "Gallery"
477
+ })]
478
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
479
+ style: Styles._modalBtn,
480
+ onPress: handleCamera,
481
+ children: [/*#__PURE__*/_jsx(Ionicons, {
482
+ name: "camera-outline",
483
+ size: 20,
484
+ color: "red"
485
+ }), /*#__PURE__*/_jsx(Text, {
486
+ style: Styles._modalText,
487
+ children: "Camera"
488
+ })]
489
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
490
+ style: Styles._modalBtn,
491
+ onPress: handlePDF,
492
+ children: [/*#__PURE__*/_jsx(Ionicons, {
493
+ name: "document-outline",
494
+ size: 20,
495
+ color: "red"
496
+ }), /*#__PURE__*/_jsx(Text, {
497
+ style: Styles._modalText,
498
+ children: "PDF"
499
+ })]
500
+ })]
501
+ })
502
+ })]
503
+ });
504
+ }
505
+ const Styles = StyleSheet.create({
506
+ _mainContainers: {
507
+ flex: 1,
508
+ backgroundColor: COLORS.backgroundColor,
509
+ alignItems: "center"
510
+ },
511
+ _linearGradient: {
512
+ width: WP(100),
513
+ height: 80,
514
+ alignItems: "center"
515
+ },
516
+ _titleMain: {
517
+ width: WP(94),
518
+ height: 30,
519
+ flexDirection: "row",
520
+ alignItems: "center",
521
+ marginTop: 10
522
+ },
523
+ _title: {
524
+ color: COLORS.whiteColor,
525
+ fontFamily: FONT_NORMAL,
526
+ fontSize: 15,
527
+ marginLeft: 15
528
+ },
529
+ _contentMain: {
530
+ width: WP(94),
531
+ height: "95%",
532
+ backgroundColor: COLORS.whiteColor,
533
+ position: "absolute",
534
+ top: 50,
535
+ shadowColor: "#000",
536
+ shadowOffset: {
537
+ width: 0,
538
+ height: 2
539
+ },
540
+ shadowOpacity: 0.2,
541
+ shadowRadius: 3.84,
542
+ elevation: 5,
543
+ borderRadius: 10,
544
+ alignItems: "center",
545
+ justifyContent: "space-between",
546
+ paddingVertical: 12
547
+ },
548
+ _input: {
549
+ flex: 1,
550
+ height: "100%",
551
+ fontFamily: FONT_MEDIUM,
552
+ fontSize: 15,
553
+ color: "red",
554
+ paddingLeft: 13
555
+ },
556
+ _inputMain: {
557
+ width: "95%",
558
+ height: 50,
559
+ flexDirection: "row",
560
+ borderColor: COLORS.grey,
561
+ borderWidth: 1,
562
+ borderRadius: 15,
563
+ justifyContent: "space-between",
564
+ alignItems: "center",
565
+ paddingHorizontal: 12,
566
+ backgroundColor: COLORS.whiteColor
567
+ },
568
+ _memoryDisplay: {
569
+ width: WP(85),
570
+ height: 50,
571
+ alignItems: "flex-start",
572
+ justifyContent: "center",
573
+ paddingLeft: 12,
574
+ // paddingVertical: 4,
575
+ backfaceVisibility: COLORS.whiteColor,
576
+ borderColor: COLORS.grey,
577
+ borderWidth: 1,
578
+ borderRadius: 15
579
+ },
580
+ _memoryText: {
581
+ fontSize: 12,
582
+ fontFamily: FONT_NORMAL,
583
+ color: '#333'
584
+ },
585
+ _continueBtn: {
586
+ width: "95%",
587
+ height: 50,
588
+ backgroundColor: "red",
589
+ borderRadius: 100,
590
+ justifyContent: "center",
591
+ alignItems: "center"
592
+ },
593
+ _continueBtnTxt: {
594
+ color: COLORS.whiteColor,
595
+ fontFamily: FONT_NORMAL,
596
+ fontSize: 17
597
+ },
598
+ _calculatorMain: {
599
+ width: "95%"
600
+ // height: 350,
601
+ // backgroundColor: "red"
602
+ },
603
+ _calculatorRow: {
604
+ flexDirection: 'row',
605
+ justifyContent: 'space-between'
606
+ // marginBottom: 3
607
+ },
608
+ _key: {
609
+ flex: 1,
610
+ margin: 5,
611
+ backgroundColor: COLORS.whiteColor,
612
+ paddingVertical: 10,
613
+ alignItems: 'center',
614
+ justifyContent: 'center',
615
+ borderRadius: 8,
616
+ marginHorizontal: 10,
617
+ shadowColor: "#000",
618
+ shadowOffset: {
619
+ width: 0,
620
+ height: 2
621
+ },
622
+ shadowOpacity: 0.2,
623
+ shadowRadius: 3.84,
624
+ elevation: 5
625
+ },
626
+ _keyText: {
627
+ fontSize: 15,
628
+ color: COLORS.blackColor,
629
+ fontFamily: FONT_MEDIUM
630
+ },
631
+ _scrollMain: {
632
+ width: "95%",
633
+ alignItems: "center",
634
+ gap: 12
635
+ // backgroundColor: "green",
636
+ // maxHeight: Platform.OS == "ios" ? 200 : 250,
637
+ },
638
+ _hidableMain: {
639
+ width: WP(94),
640
+ height: 300,
641
+ // backgroundColor: "green",
642
+ alignItems: "center",
643
+ gap: 12
644
+ },
645
+ _hidableRow: {
646
+ width: "95%",
647
+ // height:30,
648
+ // backgroundColor: "red",
649
+ flexDirection: "row",
650
+ justifyContent: "space-between",
651
+ alignItems: "center",
652
+ paddingHorizontal: 9
653
+ },
654
+ _cellMain: {
655
+ width: "48%",
656
+ height: 50,
657
+ // backgroundColor: "pink",
658
+ borderColor: COLORS.grey,
659
+ borderWidth: 1,
660
+ borderRadius: 15,
661
+ flexDirection: "row",
662
+ justifyContent: "space-between",
663
+ alignItems: "center",
664
+ paddingHorizontal: WP(4)
665
+ },
666
+ _cellText: {
667
+ color: COLORS.blackColor,
668
+ fontFamily: FONT_NORMAL,
669
+ fontSize: 10
670
+ },
671
+ _detailMain: {
672
+ minHeight: 50,
673
+ width: "91%",
674
+ borderColor: COLORS.grey,
675
+ borderWidth: 1,
676
+ borderRadius: 15,
677
+ paddingHorizontal: 15,
678
+ color: COLORS.blackColor,
679
+ fontFamily: FONT_NORMAL,
680
+ fontSize: 13
681
+ },
682
+ _modalBtn: {
683
+ flexDirection: "row",
684
+ alignItems: "center",
685
+ paddingVertical: 12,
686
+ borderBottomColor: "#eee",
687
+ borderBottomWidth: 1
688
+ },
689
+ _modalText: {
690
+ marginLeft: 10,
691
+ fontSize: 14,
692
+ fontFamily: FONT_NORMAL,
693
+ color: COLORS.blackColor
694
+ }
695
+ });
696
+ //# sourceMappingURL=Entry.js.map