@suflon/rnmd-reporting 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.tsx +69 -0
- package/README.md +97 -0
- package/app.json +4 -0
- package/babel.config.js +18 -0
- package/global.css +143 -0
- package/index.js +9 -0
- package/metro.config.js +209 -0
- package/nativewind-env.d.ts +1 -0
- package/package.json +106 -0
- package/patches/@react-navigation+stack+7.6.16.patch +11 -0
- package/patches/@suflon+native-ui+0.0.18.patch +26020 -0
- package/patches/react-native+0.83.1.patch +52 -0
- package/react-native.config.js +27 -0
- package/scripts/fix-suflon-native-ui.js +25 -0
- package/scripts/link-react-native-pnpm.js +42 -0
- package/src/config/index.ts +10 -0
- package/src/context/ConnectionI18nContext.tsx +61 -0
- package/src/modules/Reporting/component/README.md +3 -0
- package/src/modules/Reporting/component/ReportChart.tsx +882 -0
- package/src/modules/Reporting/component/ReportFilterModal.tsx +403 -0
- package/src/modules/Reporting/component/ReportingDetail.tsx +481 -0
- package/src/modules/Reporting/index.tsx +239 -0
- package/src/modules/Reporting/utils.tsx +14 -0
- package/src/navigation/index.tsx +31 -0
- package/src/screens/ConnectionListScreen.tsx +471 -0
- package/src/screens/DevToolsCorner.tsx +810 -0
- package/src/screens/NewConnectionModal.tsx +282 -0
- package/src/services/ApiService.ts +22 -0
- package/src/services/ConnectionService.ts +81 -0
- package/src/services/api.ts +83 -0
- package/src/stores/connection.store.ts +3 -0
- package/src/stores/language.store.ts +54 -0
- package/src/theme/colors.ts +56 -0
- package/src/types/connection.ts +69 -0
- package/src/utils/AsyncStorageUtils.ts +56 -0
- package/src/utils/connectionStrings.ts +158 -0
- package/src/utils/errorMessage.ts +11 -0
- package/tailwind.config.js +196 -0
- package/tsconfig.json +25 -0
package/App.tsx
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
import { NavigationContainer } from '@react-navigation/native';
|
|
5
|
+
import { AppNavigation } from './src/navigation';
|
|
6
|
+
import { DevToolsCorner, MOCK_ROLES } from './src/screens/DevToolsCorner';
|
|
7
|
+
import { useLanguageStore } from './src/stores/language.store';
|
|
8
|
+
import { RBACProvider, useAuthStore, getData } from '@suflon/native-ui';
|
|
9
|
+
import './global.css';
|
|
10
|
+
|
|
11
|
+
export default function App() {
|
|
12
|
+
const loadSavedLanguage = useLanguageStore((s) => s.loadSavedLanguage);
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
loadSavedLanguage();
|
|
16
|
+
|
|
17
|
+
// Load dev and permission configuration on boot
|
|
18
|
+
const initDevStore = async () => {
|
|
19
|
+
const [companyId, regionId, staffId, userId, permissionKey] = await Promise.all([
|
|
20
|
+
getData('company_id'),
|
|
21
|
+
getData('region_id'),
|
|
22
|
+
getData('staff_id'),
|
|
23
|
+
getData('user_id'),
|
|
24
|
+
getData('permission_key'),
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
const setAuthData = useAuthStore.getState().setAuthData;
|
|
28
|
+
const setPermissions = useAuthStore.getState().setPermissions;
|
|
29
|
+
const setPermissionScenario = useAuthStore.getState().setPermissionScenario;
|
|
30
|
+
|
|
31
|
+
if (companyId || staffId || userId) {
|
|
32
|
+
await setAuthData({
|
|
33
|
+
company_id: Number(companyId) || 2,
|
|
34
|
+
region_id: Number(regionId) || 1,
|
|
35
|
+
staff_id: Number(staffId) || 1,
|
|
36
|
+
user_id: Number(userId) || 1,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const activeScenario = String(permissionKey || 'clinic_owner');
|
|
41
|
+
setPermissionScenario(activeScenario);
|
|
42
|
+
|
|
43
|
+
if (MOCK_ROLES[activeScenario]) {
|
|
44
|
+
await setPermissions(MOCK_ROLES[activeScenario], Number(staffId) || 1);
|
|
45
|
+
} else {
|
|
46
|
+
await setPermissions(MOCK_ROLES.clinic_owner, Number(staffId) || 1);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
initDevStore();
|
|
51
|
+
}, [loadSavedLanguage]);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<View style={{ flex: 1 }}>
|
|
55
|
+
<SafeAreaProvider>
|
|
56
|
+
{/* iiTop safe area for the standalone demo app so the header doesn't sit under the notch/status bar.
|
|
57
|
+
Inside the library, ConnectionListScreen still uses edges={['bottom']} so the host app isn't double padded. */}
|
|
58
|
+
<SafeAreaView style={{ flex: 1 }} edges={['top']}>
|
|
59
|
+
<NavigationContainer>
|
|
60
|
+
<RBACProvider>
|
|
61
|
+
<AppNavigation />
|
|
62
|
+
<DevToolsCorner />
|
|
63
|
+
</RBACProvider>
|
|
64
|
+
</NavigationContainer>
|
|
65
|
+
</SafeAreaView>
|
|
66
|
+
</SafeAreaProvider>
|
|
67
|
+
</View>
|
|
68
|
+
);
|
|
69
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
|
|
2
|
+
|
|
3
|
+
# Getting Started
|
|
4
|
+
|
|
5
|
+
> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
|
|
6
|
+
|
|
7
|
+
## Step 1: Start Metro
|
|
8
|
+
|
|
9
|
+
First, you will need to run **Metro**, the JavaScript build tool for React Native.
|
|
10
|
+
|
|
11
|
+
To start the Metro dev server, run the following command from the root of your React Native project:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
# Using npm
|
|
15
|
+
npm start
|
|
16
|
+
|
|
17
|
+
# OR using Yarn
|
|
18
|
+
yarn start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Step 2: Build and run your app
|
|
22
|
+
|
|
23
|
+
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
|
|
24
|
+
|
|
25
|
+
### Android
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
# Using npm
|
|
29
|
+
npm run android
|
|
30
|
+
|
|
31
|
+
# OR using Yarn
|
|
32
|
+
yarn android
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### iOS
|
|
36
|
+
|
|
37
|
+
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
|
|
38
|
+
|
|
39
|
+
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
bundle install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then, and every time you update your native dependencies, run:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
bundle exec pod install
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
# Using npm
|
|
55
|
+
npm run ios
|
|
56
|
+
|
|
57
|
+
# OR using Yarn
|
|
58
|
+
yarn ios
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
|
|
62
|
+
|
|
63
|
+
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
|
|
64
|
+
|
|
65
|
+
## Step 3: Modify your app
|
|
66
|
+
|
|
67
|
+
Now that you have successfully run the app, let's make changes!
|
|
68
|
+
|
|
69
|
+
Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
|
|
70
|
+
|
|
71
|
+
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
|
|
72
|
+
|
|
73
|
+
- **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).
|
|
74
|
+
- **iOS**: Press <kbd>R</kbd> in iOS Simulator.
|
|
75
|
+
|
|
76
|
+
## Congratulations! :tada:
|
|
77
|
+
|
|
78
|
+
You've successfully run and modified your React Native App. :partying_face:
|
|
79
|
+
|
|
80
|
+
### Now what?
|
|
81
|
+
|
|
82
|
+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
|
|
83
|
+
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
|
|
84
|
+
|
|
85
|
+
# Troubleshooting
|
|
86
|
+
|
|
87
|
+
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
88
|
+
|
|
89
|
+
# Learn More
|
|
90
|
+
|
|
91
|
+
To learn more about React Native, take a look at the following resources:
|
|
92
|
+
|
|
93
|
+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
|
|
94
|
+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
|
|
95
|
+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
|
|
96
|
+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
|
|
97
|
+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
|
package/app.json
ADDED
package/babel.config.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
presets: [
|
|
3
|
+
['module:@react-native/babel-preset', { unstable_transformProfile: 'hermes-stable' }],
|
|
4
|
+
'nativewind/babel',
|
|
5
|
+
],
|
|
6
|
+
plugins: [
|
|
7
|
+
'react-native-reanimated/plugin',
|
|
8
|
+
[
|
|
9
|
+
'module-resolver',
|
|
10
|
+
{
|
|
11
|
+
root: ['./'],
|
|
12
|
+
alias: {
|
|
13
|
+
'^@/(.*)$': './src/\\1',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
],
|
|
18
|
+
};
|
package/global.css
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global theme – same colors as mdplix_mobileapp/tailwind.config.js.
|
|
3
|
+
* Use these variables for consistency; Tailwind theme matches these values.
|
|
4
|
+
*/
|
|
5
|
+
@tailwind base;
|
|
6
|
+
@tailwind components;
|
|
7
|
+
@tailwind utilities;
|
|
8
|
+
|
|
9
|
+
:root {
|
|
10
|
+
/* Primary & base */
|
|
11
|
+
--color-primary: #7E43FF;
|
|
12
|
+
--color-secondary: #999999;
|
|
13
|
+
--color-orange: #FFA851;
|
|
14
|
+
|
|
15
|
+
/* Green */
|
|
16
|
+
--color-green: #008E59;
|
|
17
|
+
--color-green-100: #dcfce7;
|
|
18
|
+
--color-green-400: #4ade80;
|
|
19
|
+
--color-green-700: #15803d;
|
|
20
|
+
--color-green-900: #14532d;
|
|
21
|
+
|
|
22
|
+
/* Yellow */
|
|
23
|
+
--color-yellow-100: #fef9c3;
|
|
24
|
+
--color-yellow-400: #facc15;
|
|
25
|
+
--color-yellow-800: #854d0e;
|
|
26
|
+
--color-yellow-900: #713f12;
|
|
27
|
+
|
|
28
|
+
/* Blue */
|
|
29
|
+
--color-blue-100: #dbeafe;
|
|
30
|
+
--color-blue-400: #60a5fa;
|
|
31
|
+
--color-blue-700: #1d4ed8;
|
|
32
|
+
--color-blue-900: #1e3a8a;
|
|
33
|
+
|
|
34
|
+
/* Red */
|
|
35
|
+
--color-red-100: #fee2e2;
|
|
36
|
+
--color-red-400: #f87171;
|
|
37
|
+
--color-red-700: #b91c1c;
|
|
38
|
+
--color-red-900: #7f1d1d;
|
|
39
|
+
|
|
40
|
+
/* Violet */
|
|
41
|
+
--color-violet-50: #f5f3ff;
|
|
42
|
+
--color-violet-100: #ede9fe;
|
|
43
|
+
--color-violet-200: #ddd6fe;
|
|
44
|
+
--color-violet-600: #7c3aed;
|
|
45
|
+
--color-violet-700: #6d28d9;
|
|
46
|
+
--color-violet: #7E43FF;
|
|
47
|
+
|
|
48
|
+
/* Pink */
|
|
49
|
+
--color-pink-50: #fdf2f8;
|
|
50
|
+
--color-pink-600: #db2777;
|
|
51
|
+
|
|
52
|
+
/* Gray */
|
|
53
|
+
--color-gray-50: #f9fafb;
|
|
54
|
+
--color-gray-100: #f3f4f6;
|
|
55
|
+
--color-gray-200: #e5e7eb;
|
|
56
|
+
--color-gray-300: #d1d5db;
|
|
57
|
+
--color-gray-500: #6b7280;
|
|
58
|
+
--color-gray-700: #374151;
|
|
59
|
+
--color-gray-800: #1f2937;
|
|
60
|
+
--color-gray-900: #111827;
|
|
61
|
+
|
|
62
|
+
/* Background – same as mdplix */
|
|
63
|
+
--color-background-red: #E53935;
|
|
64
|
+
--color-background-blue: #1A7EE6;
|
|
65
|
+
--color-background-indigo: #263446;
|
|
66
|
+
--color-background-violet: #7E43FF;
|
|
67
|
+
--color-background-light: #FFFFFF;
|
|
68
|
+
--color-background-darkBg: #000000;
|
|
69
|
+
--color-background-secondaryBg: #F2F2F7;
|
|
70
|
+
--color-background-darkSecondaryBg: #1C1C1E;
|
|
71
|
+
--color-background-darkGray: #424242;
|
|
72
|
+
--color-background-lightGray: #EBEBEB;
|
|
73
|
+
--color-background-lightBlack: #141518;
|
|
74
|
+
--color-background-lightBlue: #f6f8ff;
|
|
75
|
+
--color-background-lightPink: #FFEDF8;
|
|
76
|
+
--color-background-lightGreen: #90EE90;
|
|
77
|
+
--color-background-lightYellow: #FFFDA5;
|
|
78
|
+
--color-background-lightOrange: #FFD3BB;
|
|
79
|
+
--color-background-darkBlue: #EBF5FF;
|
|
80
|
+
--color-background-darkGreen: #008E59;
|
|
81
|
+
|
|
82
|
+
/* Text light */
|
|
83
|
+
--color-text-light-green: #90EE90;
|
|
84
|
+
--color-text-light-primary: #000000;
|
|
85
|
+
--color-text-light-secondary: #999999;
|
|
86
|
+
--color-text-light-gray: #424242;
|
|
87
|
+
--color-text-light-white: #ffffff;
|
|
88
|
+
--color-text-light-secondaryText: #007AFF;
|
|
89
|
+
--color-text-light-link: #007bff;
|
|
90
|
+
--color-text-light-subHeading: #817F85;
|
|
91
|
+
--color-text-light-red: #CA0B00;
|
|
92
|
+
--color-text-light-violet: #7E43FF;
|
|
93
|
+
--color-text-light-blue: #007AFF;
|
|
94
|
+
|
|
95
|
+
/* Text dark */
|
|
96
|
+
--color-text-dark-primary: #FFFFFF;
|
|
97
|
+
--color-text-dark-secondary: #C7C7CC;
|
|
98
|
+
--color-text-dark-link: #EEEEEE;
|
|
99
|
+
--color-text-dark-subHeading: #888888;
|
|
100
|
+
--color-text-dark-red: #CA0B00;
|
|
101
|
+
|
|
102
|
+
/* Accent */
|
|
103
|
+
--color-accent-light-primary: #007bff;
|
|
104
|
+
--color-accent-light-secondary: #28a745;
|
|
105
|
+
--color-accent-dark-primary: #1e90ff;
|
|
106
|
+
--color-accent-dark-secondary: #32cd32;
|
|
107
|
+
|
|
108
|
+
/* Borders */
|
|
109
|
+
--color-borders-light-light: #E0E0E0;
|
|
110
|
+
--color-borders-light-dark: #38373A;
|
|
111
|
+
--color-borders-dark-light: #444444;
|
|
112
|
+
--color-borders-dark-dark: #38373A;
|
|
113
|
+
|
|
114
|
+
/* Shadows */
|
|
115
|
+
--shadow-light-small: 0px 1px 3px rgba(0, 0, 0, 0.2);
|
|
116
|
+
--shadow-light-large: 0px 4px 6px rgba(0, 0, 0, 0.1);
|
|
117
|
+
--shadow-dark-small: 0px 1px 3px rgba(0, 0, 0, 0.5);
|
|
118
|
+
--shadow-dark-large: 0px 4px 6px rgba(0, 0, 0, 0.3);
|
|
119
|
+
|
|
120
|
+
/* Active / Inactive */
|
|
121
|
+
--color-active-light: #1976D2;
|
|
122
|
+
--color-active-dark: #FFFFFF;
|
|
123
|
+
--color-inactive-light: #9E9E9E;
|
|
124
|
+
--color-inactive-dark: #888888;
|
|
125
|
+
|
|
126
|
+
/* Surface */
|
|
127
|
+
--color-surface-light: #FFFFFF;
|
|
128
|
+
--color-surface-dark: #1E293B;
|
|
129
|
+
|
|
130
|
+
/* Buttons */
|
|
131
|
+
--color-buttons-light-enabled-background: #007bff;
|
|
132
|
+
--color-buttons-light-enabled-text: #ffffff;
|
|
133
|
+
--color-buttons-light-enabled-border: #007bff;
|
|
134
|
+
--color-buttons-light-disabled-background: #e0e0e0;
|
|
135
|
+
--color-buttons-light-disabled-text: #a0a0a0;
|
|
136
|
+
--color-buttons-light-disabled-border: #d0d0d0;
|
|
137
|
+
--color-buttons-dark-enabled-background: #1e90ff;
|
|
138
|
+
--color-buttons-dark-enabled-text: #ffffff;
|
|
139
|
+
--color-buttons-dark-enabled-border: #1e90ff;
|
|
140
|
+
--color-buttons-dark-disabled-background: #444444;
|
|
141
|
+
--color-buttons-dark-disabled-text: #666666;
|
|
142
|
+
--color-buttons-dark-disabled-border: #555555;
|
|
143
|
+
}
|
package/index.js
ADDED
package/metro.config.js
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
2
|
+
const { withNativeWind } = require('nativewind/metro');
|
|
3
|
+
const exclusionList = require('metro-config/private/defaults/exclusionList').default;
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
const projectRoot = __dirname;
|
|
8
|
+
const appNodeModules = path.resolve(projectRoot, 'node_modules');
|
|
9
|
+
|
|
10
|
+
/** Pin react-native-css-interop to one copy — mismatched nativewind + interop breaks className at runtime. */
|
|
11
|
+
let cssInteropRoot = null;
|
|
12
|
+
try {
|
|
13
|
+
cssInteropRoot = path.dirname(
|
|
14
|
+
require.resolve('react-native-css-interop/package.json', { paths: [projectRoot] }),
|
|
15
|
+
);
|
|
16
|
+
} catch {
|
|
17
|
+
/* install deps first */
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const suflonNativeUiRoot = path.resolve(projectRoot, '../Suflon_Native_UI');
|
|
21
|
+
|
|
22
|
+
function usesLocalSuflonNativeUiCheckout() {
|
|
23
|
+
if (process.env.USE_LOCAL_SUFLON_NATIVE_UI === '1') return true;
|
|
24
|
+
try {
|
|
25
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(projectRoot, 'package.json'), 'utf8'));
|
|
26
|
+
const dep = pkg.dependencies && pkg.dependencies['@suflon/native-ui'];
|
|
27
|
+
return typeof dep === 'string' && dep.trim().startsWith('file:');
|
|
28
|
+
} catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const singletonPackages = {
|
|
34
|
+
react: path.join(appNodeModules, 'react'),
|
|
35
|
+
'react-native': path.join(appNodeModules, 'react-native'),
|
|
36
|
+
zustand: path.join(appNodeModules, 'zustand'),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const schedulerPath = path.join(appNodeModules, 'scheduler');
|
|
40
|
+
if (fs.existsSync(schedulerPath)) {
|
|
41
|
+
singletonPackages['scheduler'] = schedulerPath;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const virtualizedListsPath = path.join(appNodeModules, '@react-native', 'virtualized-lists');
|
|
45
|
+
if (fs.existsSync(virtualizedListsPath)) {
|
|
46
|
+
singletonPackages['@react-native/virtualized-lists'] = virtualizedListsPath;
|
|
47
|
+
}
|
|
48
|
+
if (cssInteropRoot && fs.existsSync(cssInteropRoot)) {
|
|
49
|
+
singletonPackages['react-native-css-interop'] = cssInteropRoot;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Prefer bundling published package source (src/index.ts) over precompiled lib/.
|
|
54
|
+
* lib/*.js is emitted with react/jsx-runtime; react-native-css-interop's Babel plugin
|
|
55
|
+
* does not rewrite that output, so className on @suflon/native-ui components never applies.
|
|
56
|
+
* Source .tsx is transformed by the app Babel pipeline with nativewind/babel.
|
|
57
|
+
*/
|
|
58
|
+
function resolveSuflonNativeUiEntry() {
|
|
59
|
+
if (usesLocalSuflonNativeUiCheckout() && fs.existsSync(suflonNativeUiRoot)) {
|
|
60
|
+
const src = path.join(suflonNativeUiRoot, 'src', 'index.ts');
|
|
61
|
+
if (fs.existsSync(src)) return src;
|
|
62
|
+
}
|
|
63
|
+
const npmRoot = path.join(appNodeModules, '@suflon', 'native-ui');
|
|
64
|
+
const src = path.join(npmRoot, 'src', 'index.ts');
|
|
65
|
+
if (fs.existsSync(src)) return src;
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const defaultConfig = getDefaultConfig(projectRoot);
|
|
70
|
+
|
|
71
|
+
const PATH_ALIASES = {
|
|
72
|
+
'@/': 'src/',
|
|
73
|
+
'@/components': 'src/components',
|
|
74
|
+
'@/utils': 'src/utils',
|
|
75
|
+
'@/hooks': 'src/hooks',
|
|
76
|
+
'@/services': 'src/services',
|
|
77
|
+
'@/store': 'src/store',
|
|
78
|
+
'@/config': 'src/config',
|
|
79
|
+
'@/rbac': 'src/rbac',
|
|
80
|
+
'@/modules': 'src/modules',
|
|
81
|
+
'@': 'src',
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
function tryResolveFile(basePath) {
|
|
85
|
+
const exts = ['.tsx', '.ts', '.jsx', '.js', '.native.tsx', '.native.ts', '.native.js', '.json'];
|
|
86
|
+
for (const ext of exts) {
|
|
87
|
+
const c = basePath + ext;
|
|
88
|
+
if (fs.existsSync(c)) {
|
|
89
|
+
const filePath = fs.realpathSync.native(c);
|
|
90
|
+
return { type: 'sourceFile', filePath };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const indexBase = path.join(basePath, 'index');
|
|
94
|
+
for (const ext of exts) {
|
|
95
|
+
const c = indexBase + ext;
|
|
96
|
+
if (fs.existsSync(c)) {
|
|
97
|
+
const filePath = fs.realpathSync.native(c);
|
|
98
|
+
return { type: 'sourceFile', filePath };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function isOriginInSuflonNativeUi(originModulePath) {
|
|
105
|
+
if (!originModulePath) return false;
|
|
106
|
+
const n = originModulePath.replace(/\\/g, '/');
|
|
107
|
+
return n.includes('node_modules/@suflon/native-ui/') || n.includes('/Suflon_Native_UI/');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function getSuflonNativeUiSrcRoot() {
|
|
111
|
+
if (usesLocalSuflonNativeUiCheckout() && fs.existsSync(suflonNativeUiRoot)) {
|
|
112
|
+
return path.join(suflonNativeUiRoot, 'src');
|
|
113
|
+
}
|
|
114
|
+
return path.join(appNodeModules, '@suflon', 'native-ui', 'src');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const SUFLON_NATIVE_UI_ALIASES = {
|
|
118
|
+
'@services': 'services',
|
|
119
|
+
'@utils': 'utils',
|
|
120
|
+
'@store': 'store',
|
|
121
|
+
'@rbac': 'rbac',
|
|
122
|
+
'@data': 'data',
|
|
123
|
+
'@hooks': 'hooks',
|
|
124
|
+
'@config': 'config',
|
|
125
|
+
'@components': 'components',
|
|
126
|
+
'@theme': 'theme',
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
function resolveSuflonNativeUiInternalAlias(moduleName) {
|
|
130
|
+
const suflonSrc = getSuflonNativeUiSrcRoot();
|
|
131
|
+
if (!fs.existsSync(suflonSrc)) return null;
|
|
132
|
+
for (const [alias, subdir] of Object.entries(SUFLON_NATIVE_UI_ALIASES)) {
|
|
133
|
+
if (moduleName === alias || moduleName.startsWith(alias + '/')) {
|
|
134
|
+
const rest = moduleName === alias ? '' : moduleName.slice(alias.length + 1);
|
|
135
|
+
const basePath = path.join(suflonSrc, subdir, rest.replace(/\//g, path.sep));
|
|
136
|
+
const resolved = tryResolveFile(basePath);
|
|
137
|
+
if (resolved) return resolved;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const config = {
|
|
144
|
+
projectRoot,
|
|
145
|
+
watchFolders:
|
|
146
|
+
usesLocalSuflonNativeUiCheckout() && fs.existsSync(suflonNativeUiRoot)
|
|
147
|
+
? [projectRoot, suflonNativeUiRoot]
|
|
148
|
+
: [projectRoot],
|
|
149
|
+
resolver: {
|
|
150
|
+
extraNodeModules: singletonPackages,
|
|
151
|
+
blockList: exclusionList([/[/\\]node_modules[/\\].*\.d\.ts$/]),
|
|
152
|
+
resolveRequest: (context, moduleName, platform) => {
|
|
153
|
+
if (moduleName === '@suflon/native-ui') {
|
|
154
|
+
const entry = resolveSuflonNativeUiEntry();
|
|
155
|
+
if (entry) {
|
|
156
|
+
return { type: 'sourceFile', filePath: fs.realpathSync.native(entry) };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const fromSuflon = isOriginInSuflonNativeUi(context.originModulePath);
|
|
161
|
+
|
|
162
|
+
function resolveHostAliases() {
|
|
163
|
+
for (const [alias, dir] of Object.entries(PATH_ALIASES)) {
|
|
164
|
+
if (moduleName === alias || moduleName.startsWith(alias + '/')) {
|
|
165
|
+
const subPath = moduleName === alias ? '' : moduleName.slice(alias.length + 1);
|
|
166
|
+
const basePath = path.join(projectRoot, dir, subPath.replace(/\//g, path.sep));
|
|
167
|
+
const result = tryResolveFile(basePath);
|
|
168
|
+
if (result) return result;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (fromSuflon) {
|
|
175
|
+
if (moduleName.startsWith('.')) {
|
|
176
|
+
const absPath = path.resolve(path.dirname(context.originModulePath), moduleName);
|
|
177
|
+
const relToAppSrc = path.relative(path.join(projectRoot, 'src'), absPath);
|
|
178
|
+
if (!relToAppSrc.startsWith('..') && !path.isAbsolute(relToAppSrc)) {
|
|
179
|
+
const parts = relToAppSrc.split(path.sep);
|
|
180
|
+
const subdir = parts[0];
|
|
181
|
+
const rest = parts.slice(1).join(path.sep);
|
|
182
|
+
const suflonSrc = getSuflonNativeUiSrcRoot();
|
|
183
|
+
const targetPath = path.join(suflonSrc, subdir, rest);
|
|
184
|
+
const resolved = tryResolveFile(targetPath);
|
|
185
|
+
if (resolved) {
|
|
186
|
+
return resolved;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const suflonInternal = resolveSuflonNativeUiInternalAlias(moduleName);
|
|
192
|
+
if (suflonInternal) return suflonInternal;
|
|
193
|
+
const hostHit = resolveHostAliases();
|
|
194
|
+
if (hostHit) return hostHit;
|
|
195
|
+
} else {
|
|
196
|
+
const hostHit = resolveHostAliases();
|
|
197
|
+
if (hostHit) return hostHit;
|
|
198
|
+
const suflonInternal = resolveSuflonNativeUiInternalAlias(moduleName);
|
|
199
|
+
if (suflonInternal) return suflonInternal;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return context.resolveRequest(context, moduleName, platform);
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
module.exports = withNativeWind(mergeConfig(defaultConfig, config), {
|
|
208
|
+
input: './global.css',
|
|
209
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="nativewind/types" />
|
package/package.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@suflon/rnmd-reporting",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git://github.com/WoctorNatives/mdplix_rn_reporting.git"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"registry": "https://registry.npmjs.org"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src",
|
|
14
|
+
"App.tsx",
|
|
15
|
+
"index.js",
|
|
16
|
+
"app.json",
|
|
17
|
+
"babel.config.js",
|
|
18
|
+
"metro.config.js",
|
|
19
|
+
"tailwind.config.js",
|
|
20
|
+
"tsconfig.json",
|
|
21
|
+
"global.css",
|
|
22
|
+
"nativewind-env.d.ts",
|
|
23
|
+
"patches",
|
|
24
|
+
"scripts",
|
|
25
|
+
"react-native.config.js"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"android": "react-native run-android",
|
|
29
|
+
"android:clean": "rm -rf android/app/build android/app/.cxx android/build && react-native run-android",
|
|
30
|
+
"ios": "react-native run-ios",
|
|
31
|
+
"lint": "eslint .",
|
|
32
|
+
"start": "react-native start",
|
|
33
|
+
"test": "jest"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@react-native-async-storage/async-storage": "2.2.0",
|
|
37
|
+
"@react-native-community/datetimepicker": "^9.1.0",
|
|
38
|
+
"@react-native-community/netinfo": "^12.0.1",
|
|
39
|
+
"@react-native-picker/picker": "^2.11.4",
|
|
40
|
+
"@react-navigation/native": "^7.2.5",
|
|
41
|
+
"@react-navigation/native-stack": "^7.0.0",
|
|
42
|
+
"@react-navigation/stack": "^7.0.0",
|
|
43
|
+
"@suflon/native-ui": "0.0.18",
|
|
44
|
+
"axios": "^1.7.0",
|
|
45
|
+
"react-hook-form": "^7.76.1",
|
|
46
|
+
"react-native-image-picker": "^8.2.1",
|
|
47
|
+
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
48
|
+
"react-native-svg": "^15.15.5",
|
|
49
|
+
"react-native-worklets": "^0.8.1",
|
|
50
|
+
"zustand": "^5.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"nativewind": "^4.2.3",
|
|
54
|
+
"react": ">=18",
|
|
55
|
+
"react-native": ">=0.70",
|
|
56
|
+
"react-native-css-interop": "0.2.3",
|
|
57
|
+
"react-native-gesture-handler": ">=2",
|
|
58
|
+
"react-native-reanimated": ">=3",
|
|
59
|
+
"react-native-safe-area-context": ">=5",
|
|
60
|
+
"react-native-screens": ">=4",
|
|
61
|
+
"react-native-vector-icons": ">=10",
|
|
62
|
+
"tailwindcss": ">=3"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@babel/core": "^7.25.2",
|
|
66
|
+
"@babel/plugin-transform-flow-strip-types": "^7.25.0",
|
|
67
|
+
"@babel/preset-env": "^7.25.3",
|
|
68
|
+
"@babel/runtime": "^7.25.0",
|
|
69
|
+
"@react-native-community/cli": "latest",
|
|
70
|
+
"@react-native-community/cli-platform-android": "20.0.0",
|
|
71
|
+
"@react-native-community/cli-platform-ios": "20.0.0",
|
|
72
|
+
"@react-native/babel-preset": "0.83.1",
|
|
73
|
+
"@react-native/eslint-config": "0.83.1",
|
|
74
|
+
"@react-native/metro-config": "0.83.1",
|
|
75
|
+
"@react-native/typescript-config": "0.83.1",
|
|
76
|
+
"@types/react": "^19.0.0",
|
|
77
|
+
"@types/react-test-renderer": "^19.0.0",
|
|
78
|
+
"babel-jest": "^29.6.3",
|
|
79
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
|
80
|
+
"eslint": "^8.19.0",
|
|
81
|
+
"jest": "^29.6.3",
|
|
82
|
+
"nativewind": "^4.2.3",
|
|
83
|
+
"patch-package": "^8.0.0",
|
|
84
|
+
"prettier": "2.8.8",
|
|
85
|
+
"react": "19.2.0",
|
|
86
|
+
"react-native": "0.83.1",
|
|
87
|
+
"react-native-gesture-handler": "^2.20.0",
|
|
88
|
+
"react-native-reanimated": "4.3.0",
|
|
89
|
+
"react-native-safe-area-context": "^5.0.0",
|
|
90
|
+
"react-native-screens": "^4.4.0",
|
|
91
|
+
"react-native-vector-icons": "^10.2.0",
|
|
92
|
+
"react-test-renderer": "19.2.0",
|
|
93
|
+
"tailwindcss": "^3.4.0",
|
|
94
|
+
"typescript": "5.0.4"
|
|
95
|
+
},
|
|
96
|
+
"engines": {
|
|
97
|
+
"node": ">=18"
|
|
98
|
+
},
|
|
99
|
+
"overrides": {
|
|
100
|
+
"react": "19.2.0",
|
|
101
|
+
"react-native": "0.83.1",
|
|
102
|
+
"react-native-css-interop": "0.2.3",
|
|
103
|
+
"nativewind": "^4.2.3",
|
|
104
|
+
"react-native-reanimated": "4.3.0"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
diff --git a/node_modules/@react-navigation/stack/lib/module/views/GestureHandler.android.js b/node_modules/@react-navigation/stack/lib/module/views/GestureHandler.android.js
|
|
2
|
+
index 9aebaff..7670fd3 100644
|
|
3
|
+
--- a/node_modules/@react-navigation/stack/lib/module/views/GestureHandler.android.js
|
|
4
|
+
+++ b/node_modules/@react-navigation/stack/lib/module/views/GestureHandler.android.js
|
|
5
|
+
@@ -1,4 +1,4 @@
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
-export * from "./GestureHandlerNative.js";
|
|
9
|
+
+export * from "./GestureHandler.js";
|
|
10
|
+
//# sourceMappingURL=GestureHandler.android.js.map
|
|
11
|
+
|