@jescon-technologies/react-native-ui-kit 0.0.14 → 0.0.16

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/index.d.ts CHANGED
@@ -4,15 +4,19 @@ export { default as AAlert } from './src/Alerts/AAlert';
4
4
  export { default as ABlink } from './src/Alerts/ABlink';
5
5
  export { default as HIcons } from './src/Hoc/HIcons';
6
6
  export { default as HView } from './src/Hoc/HView';
7
+ export { default as HProvider } from './src/Hoc/HProvider';
8
+ export { default as HShadowButton } from './src/Hoc/HShadowButton';
7
9
  export { default as Navigation } from './src/Navigation/PageNavigation';
8
-
10
+ export { default as SSearchBar } from './src/StaticComponents/SSearchBar';
11
+ export { default as SDateTimePicker } from './src/StaticComponents/SDateTimePicker';
12
+ export { default as CFooterView } from './src/CustomComponents/CFooterView';
13
+ export { default as CDetailView } from './src/CustomComponents/CDetailView';
14
+ export { default as CContainerView } from './src/CustomComponents/CContainerView';
15
+ export { default as HeaderBlock } from './src/CustomComponents/HeaderBlock';
16
+ export { default as HDashboard } from './src/Hoc/HDashboard';
9
17
  export { default as NetworkServiceCall } from './src/Common/NetworkServiceCall';
18
+ export { default as useNotifications } from './src/Handlers/NotificationsContext';
10
19
  export * from './src/Navigation/useNavigation';
11
20
  export { default as CBackHandler } from './src/CustomComponents/CBackHandler';
12
21
  export * from './src/CommonStyle/ComponentFunctions';
13
22
  export * from './src/CommonStyle/commonStyle';
14
- export { default as Loader } from './src/Custom/Loader';
15
- export { default as LoginLayout } from './src/Layout/LoginLayout';
16
- export { default as Splash } from './src/Screens/Splash';
17
- export { default as Login } from './src/Screens/Login';
18
- export { default as ForgotPassword } from './src/Screens/ForgotPassword';
package/index.js CHANGED
@@ -4,15 +4,19 @@ export { default as AAlert } from './src/Alerts/AAlert';
4
4
  export { default as ABlink } from './src/Alerts/ABlink';
5
5
  export { default as HIcons } from './src/Hoc/HIcons';
6
6
  export { default as HView } from './src/Hoc/HView';
7
+ export { default as HProvider } from './src/Hoc/HProvider';
8
+ export { default as HShadowButton } from './src/Hoc/HShadowButton';
7
9
  export { default as Navigation } from './src/Navigation/PageNavigation';
8
-
10
+ export { default as SSearchBar } from './src/StaticComponents/SSearchBar';
11
+ export { default as SDateTimePicker } from './src/StaticComponents/SDateTimePicker';
12
+ export { default as CFooterView } from './src/CustomComponents/CFooterView';
13
+ export { default as CDetailView } from './src/CustomComponents/CDetailView';
14
+ export { default as CContainerView } from './src/CustomComponents/CContainerView';
15
+ export { default as HeaderBlock } from './src/CustomComponents/HeaderBlock';
16
+ export { default as HDashboard } from './src/Hoc/HDashboard';
9
17
  export { default as NetworkServiceCall } from './src/Common/NetworkServiceCall';
18
+ export { default as useNotifications } from './src/Handlers/NotificationsContext';
10
19
  export * from './src/Navigation/useNavigation';
11
20
  export { default as CBackHandler } from './src/CustomComponents/CBackHandler';
12
21
  export * from './src/CommonStyle/ComponentFunctions';
13
22
  export * from './src/CommonStyle/commonStyle';
14
- export { default as Loader } from './src/Custom/Loader';
15
- export { default as LoginLayout } from './src/Layout/LoginLayout';
16
- export { default as Splash } from './src/Screens/Splash';
17
- export { default as Login } from './src/Screens/Login';
18
- export { default as ForgotPassword } from './src/Screens/ForgotPassword';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jescon-technologies/react-native-ui-kit",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "A React Native module for Jescon Technologies that provides react-native-ui-kit",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -9,6 +9,7 @@ import {
9
9
  } from 'react-native';
10
10
 
11
11
  import { Global } from '../../../../../src/Common/Global';
12
+ ;
12
13
  import HIcons from '../Hoc/HIcons';
13
14
  import { ValueCheck } from '../CommonStyle/ComponentFunctions';
14
15
  import { normalize } from '../CommonStyle/componentStyle';
@@ -8,6 +8,7 @@ import {
8
8
  } from 'react-native';
9
9
 
10
10
  import { Global } from '../../../../../src/Common/Global';
11
+ ;
11
12
  import HIcons from '../Hoc/HIcons';
12
13
  import { ValueCheck } from '../CommonStyle/ComponentFunctions';
13
14
  import { normalize } from '../CommonStyle/componentStyle';
@@ -1,6 +1,7 @@
1
1
  import axios, { Method, AxiosResponse, AxiosError } from 'axios';
2
2
  import { isConnected, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
3
3
  import { Global } from '../../../../../src/Common/Global';
4
+ ;
4
5
  import { Platform } from 'react-native';
5
6
 
6
7
  // Type definitions
@@ -17,7 +17,7 @@ import {
17
17
  } from 'react-native';
18
18
  import NetInfo from '@react-native-community/netinfo';
19
19
  import { Global } from '../../../../../src/Common/Global';
20
- import { APIURL } from '../../../../../src/Common/apiConstants';
20
+ ;
21
21
  import React from 'react';
22
22
 
23
23
  const {
@@ -99,27 +99,6 @@ export function CShadowDynamic(
99
99
  };
100
100
  }
101
101
 
102
- // Loader Components
103
- export function LoaderIndicator(i?: any): React.JSX.Element {
104
- return (
105
- <View style={{
106
- backgroundColor: '#ffffff',
107
- padding: normalize(10),
108
- paddingHorizontal: normalize(20),
109
- borderRadius: 10,
110
- alignItems: 'center',
111
- }}>
112
- <Image
113
- style={{
114
- width: normalize(35),
115
- height: normalize(35),
116
- }}
117
- source={{ uri: `${APIURL}file/getCommonFile/image/heartpulse.gif` }}
118
- resizeMode={Image.resizeMode.contain}
119
- />
120
- </View>
121
- );
122
- }
123
102
 
124
103
  export function Loader(): React.JSX.Element {
125
104
  return (
@@ -0,0 +1,10 @@
1
+ import { View, Text } from 'react-native'
2
+ import React from 'react'
3
+
4
+ export default function CSliderMenu() {
5
+ return (
6
+ <View>
7
+ <Text>CSliderMenu</Text>
8
+ </View>
9
+ )
10
+ }
@@ -0,0 +1,355 @@
1
+ import React from 'react';
2
+ import {
3
+ Dimensions,
4
+ Image,
5
+ KeyboardAvoidingView,
6
+ ScrollView,
7
+ Platform,
8
+ TouchableOpacity,
9
+ View,
10
+ Text,
11
+ TextInput,
12
+ TouchableWithoutFeedback,
13
+ } from 'react-native';
14
+ import { Global } from '../../../../../src/Common/Global';
15
+ ;
16
+ import { normalize } from '../CommonStyle/componentStyle';
17
+ import { isPermitted, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
18
+ import Barcode from '@kichiyaki/react-native-barcode-generator';
19
+ import { useNavigation } from '../Navigation/useNavigation';
20
+ import HIcons from '../HOC/HIcons';
21
+
22
+ // ---------------------------------------------------------------------------
23
+ // Types
24
+ // ---------------------------------------------------------------------------
25
+
26
+ export interface OUserViewProps {
27
+ /** Called with `false` to close the parent overlay / modal. */
28
+ visibility?: (val: boolean) => void;
29
+ /**
30
+ * Base URL prepended to `Global.userData.signatureurl`.
31
+ * NOTE: this should really be imported from `apiConstants` instead of being
32
+ * passed as a prop — if the caller forgets, `undefined/...` becomes the URI.
33
+ */
34
+ APIURL?: string;
35
+ [key: string]: unknown;
36
+ }
37
+
38
+ // Extend the shared `GlobalUserData` with fields used here.
39
+ interface OUserViewUserData extends Global {
40
+ registrationno?: string;
41
+ designation?: string;
42
+ hrenemp?: string | number;
43
+ qualification?: string;
44
+ experience?: string | number;
45
+ mobileno?: string | number;
46
+ photo?: string;
47
+ signatureurl?: string;
48
+ wardname?: string;
49
+ wardcode?: string | number;
50
+ }
51
+
52
+ // ---------------------------------------------------------------------------
53
+ // Component
54
+ // ---------------------------------------------------------------------------
55
+
56
+ const OUserView: React.FC<OUserViewProps> = (props) => {
57
+ const navigation = useNavigation();
58
+ const userData = Global.userData as OUserViewUserData | null | undefined;
59
+
60
+ function fnSignatureEdit(): void {
61
+ if (isPermitted()) {
62
+ try {
63
+ props.visibility?.(false);
64
+ navigation.navigate('CSignatureScreen');
65
+ } catch (error) {
66
+ notifyMessage('cancelled');
67
+ }
68
+ } else {
69
+ notifyMessage('Storage Permission required.');
70
+ }
71
+ }
72
+
73
+ return (
74
+ <KeyboardAvoidingView
75
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
76
+ style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}
77
+ >
78
+ <View style={{ flex: 1, width: Dimensions.get('screen').width - normalize(10) }}>
79
+ <Text
80
+ style={{
81
+ fontSize: normalize(12),
82
+ fontWeight: 'bold',
83
+ alignSelf: 'center',
84
+ marginTop: normalize(-15),
85
+ }}
86
+ >
87
+ User Details
88
+ </Text>
89
+ <TouchableWithoutFeedback>
90
+ <ScrollView style={{ marginBottom: normalize(45) }}>
91
+ <View style={{ borderWidth: 0 }}>
92
+ {/* Header card */}
93
+ <View
94
+ style={{
95
+ backgroundColor: '#2A81FF',
96
+ borderTopLeftRadius: 20,
97
+ // ⚠️ `borderTopEndRadius` is NOT a valid RN style key
98
+ // (standard is `borderTopRightRadius`). Silently ignored at
99
+ // runtime — top-right corner stays square. Preserved to
100
+ // match existing visual output.
101
+ height: normalize(55),
102
+ borderLeftWidth: 3,
103
+ borderColor: Global.AppTheme.primary_color,
104
+ }}
105
+ >
106
+ <View
107
+ style={{
108
+ paddingHorizontal: 10,
109
+ paddingVertical: 5,
110
+ flexDirection: 'row',
111
+ justifyContent: 'space-between',
112
+ }}
113
+ >
114
+ <View>
115
+ <TextInput
116
+ editable={false}
117
+ style={{
118
+ fontSize: normalize(14),
119
+ fontWeight: 'bold',
120
+ color: '#fff',
121
+ padding: 0,
122
+ }}
123
+ value={userData?.registrationno ?? ''}
124
+ />
125
+ <TextInput
126
+ editable={false}
127
+ style={{
128
+ fontSize: normalize(10),
129
+ fontWeight: 'bold',
130
+ color: '#fff',
131
+ padding: 0,
132
+ }}
133
+ value={userData?.department ?? ''}
134
+ />
135
+ <TextInput
136
+ editable={false}
137
+ style={{
138
+ fontSize: normalize(10),
139
+ fontWeight: 'bold',
140
+ color: '#fff',
141
+ padding: 0,
142
+ }}
143
+ value={userData?.designation ?? ''}
144
+ />
145
+ </View>
146
+ <View>
147
+ {Platform.OS !== 'web' && (
148
+ <Barcode
149
+ lineColor={Global.AppTheme.primary_color}
150
+ // ⚠️ 'CODE128B' is not in the library's `format` union.
151
+ // Cast is intentional — verify at runtime.
152
+ format={'CODE128B' as unknown as 'CODE128'}
153
+ value={
154
+ ValueCheck(userData)
155
+ ? String(userData?.hrenemp ?? '')
156
+ : ''
157
+ }
158
+ maxWidth={normalize(145)}
159
+ height={normalize(45)}
160
+ />
161
+ )}
162
+ </View>
163
+ </View>
164
+ </View>
165
+
166
+ {/* Body card */}
167
+ <View
168
+ style={{
169
+ flexDirection: 'row',
170
+ borderLeftWidth: 3,
171
+ borderColor: Global.AppTheme.primary_color,
172
+ borderBottomWidth: 3,
173
+ borderBottomEndRadius: 20,
174
+ borderBottomLeftRadius: 20,
175
+ justifyContent: 'flex-start',
176
+ alignItems: 'flex-start',
177
+ backgroundColor: '#d4e4f9',
178
+ width: '100%',
179
+ }}
180
+ >
181
+ {/* Left column — edit photo hint */}
182
+ <View
183
+ style={{
184
+ borderWidth: 0,
185
+ width: '25%',
186
+ alignItems: 'center',
187
+ justifyContent: 'center',
188
+ paddingTop: normalize(5),
189
+ }}
190
+ >
191
+ <View
192
+ style={{
193
+ borderRadius: 5,
194
+ borderWidth: 0,
195
+ width: '100%',
196
+ borderColor: 'lightgrey',
197
+ flexDirection: 'row',
198
+ alignItems: 'center',
199
+ }}
200
+ >
201
+ <HIcons.Entypo
202
+ icongroup={5}
203
+ name={'info-with-circle'}
204
+ size={normalize(8)}
205
+ color={'grey'}
206
+ style={{ textAlign: 'center', paddingHorizontal: normalize(5) }}
207
+ />
208
+ <Text
209
+ adjustsFontSizeToFit
210
+ style={{
211
+ width: '90%',
212
+ color: 'grey',
213
+ fontStyle: 'italic',
214
+ fontSize: normalize(8),
215
+ textAlign: 'left',
216
+ }}
217
+ >
218
+ {'Edit profile Photo.'}
219
+ </Text>
220
+ </View>
221
+ </View>
222
+
223
+ {/* Right column — user fields */}
224
+ <View
225
+ style={{
226
+ paddingLeft: normalize(5),
227
+ paddingTop: normalize(5),
228
+ borderWidth: 0,
229
+ width: '75%',
230
+ }}
231
+ >
232
+ <TextInput
233
+ editable={false}
234
+ style={{
235
+ fontSize: normalize(18),
236
+ fontWeight: 'bold',
237
+ color: 'black',
238
+ padding: 0,
239
+ }}
240
+ value={userData?.username ?? ''}
241
+ />
242
+ <TextInput
243
+ editable={false}
244
+ style={{
245
+ fontSize: normalize(12),
246
+ fontWeight: 'bold',
247
+ color: 'black',
248
+ paddingTop: 2,
249
+ padding: 0,
250
+ }}
251
+ value={userData?.qualification ?? ''}
252
+ />
253
+ <TextInput
254
+ editable={false}
255
+ style={{
256
+ fontSize: normalize(12),
257
+ fontWeight: 'bold',
258
+ color: 'black',
259
+ paddingTop: 2,
260
+ padding: 0,
261
+ }}
262
+ value={
263
+ userData?.experience != null ? String(userData.experience) : ''
264
+ }
265
+ />
266
+ <TextInput
267
+ editable={false}
268
+ style={{
269
+ fontSize: normalize(12),
270
+ fontWeight: 'bold',
271
+ color: 'black',
272
+ paddingTop: 2,
273
+ padding: 0,
274
+ }}
275
+ value={userData?.mobileno != null ? String(userData.mobileno) : ''}
276
+ />
277
+ <TouchableOpacity
278
+ disabled={false}
279
+ onPress={fnSignatureEdit}
280
+ style={{
281
+ borderWidth: 1,
282
+ backgroundColor: 'white',
283
+ borderRadius: 10,
284
+ borderColor: 'lightgrey',
285
+ elevation: 2,
286
+ width: normalize(150),
287
+ height: normalize(50),
288
+ }}
289
+ >
290
+ <Image
291
+ style={{
292
+ width: normalize(150),
293
+ height: normalize(50),
294
+ borderRadius: 10,
295
+ resizeMode: 'stretch',
296
+ }}
297
+ source={{
298
+ uri: `${props.APIURL ?? ''}${userData?.signatureurl ?? ''}`,
299
+ }}
300
+ />
301
+ <Text
302
+ style={{
303
+ position: 'absolute',
304
+ fontSize: normalize(15),
305
+ width: '100%',
306
+ textAlign: 'center',
307
+ bottom: normalize(15),
308
+ color: '#ebebebff',
309
+ }}
310
+ >
311
+ S I G N A T U R E
312
+ </Text>
313
+ </TouchableOpacity>
314
+ <View
315
+ style={{
316
+ marginTop: normalize(3),
317
+ borderRadius: 5,
318
+ borderWidth: 0,
319
+ width: '100%',
320
+ borderColor: 'lightgrey',
321
+ flexDirection: 'row',
322
+ alignItems: 'center',
323
+ }}
324
+ >
325
+ <HIcons.Entypo
326
+ icongroup={5}
327
+ name={'info-with-circle'}
328
+ size={normalize(8)}
329
+ color={'grey'}
330
+ style={{ textAlign: 'center', paddingHorizontal: normalize(5) }}
331
+ />
332
+ <Text
333
+ adjustsFontSizeToFit
334
+ style={{
335
+ width: '90%',
336
+ color: 'grey',
337
+ fontStyle: 'italic',
338
+ fontSize: normalize(8),
339
+ textAlign: 'left',
340
+ }}
341
+ >
342
+ {'Tap to edit signature.'}
343
+ </Text>
344
+ </View>
345
+ </View>
346
+ </View>
347
+ </View>
348
+ </ScrollView>
349
+ </TouchableWithoutFeedback>
350
+ </View>
351
+ </KeyboardAvoidingView>
352
+ );
353
+ };
354
+
355
+ export default OUserView;
@@ -11,6 +11,7 @@ import {
11
11
  ViewStyle,
12
12
  } from 'react-native';
13
13
  import { Global } from '../../../../../src/Common/Global';
14
+ ;
14
15
  import { normalize } from '../CommonStyle/componentStyle';
15
16
  import Svg, { Rect, Defs, LinearGradient, Stop } from 'react-native-svg';
16
17
  import HIcons from '../Hoc/HIcons';
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { Platform, StyleSheet, View, ViewStyle } from 'react-native';
3
+ import { Global } from '../../../../../src/Common/Global';
4
+ ;
5
+
6
+ // ---------------------------------------------------------------------------
7
+ // Types
8
+ // ---------------------------------------------------------------------------
9
+
10
+ export interface CContainerViewProps {
11
+ children?: React.ReactNode;
12
+ }
13
+
14
+ // ---------------------------------------------------------------------------
15
+ // Styles
16
+ // ---------------------------------------------------------------------------
17
+
18
+ /**
19
+ * `100vh` is only valid on web (RN-web). On native, `height` must be a number
20
+ * or percentage — so we only apply it when running on web.
21
+ */
22
+ const styles = StyleSheet.create({
23
+ container: {
24
+ flex: 1,
25
+ flexDirection: 'column',
26
+ backgroundColor: Global.AppTheme.primary_color,
27
+ ...(Platform.OS === 'web' ? { height: '100vh' as unknown as ViewStyle['height'] } : {}),
28
+ },
29
+ });
30
+
31
+ // ---------------------------------------------------------------------------
32
+ // Component
33
+ // ---------------------------------------------------------------------------
34
+
35
+ const CContainerView: React.FC<CContainerViewProps> = ({ children }) => {
36
+ return <View style={styles.container}>{children}</View>;
37
+ };
38
+
39
+ export default CContainerView;