@jescon-technologies/react-native-ui-kit 0.0.10 → 0.0.11
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 +9 -2
- package/index.js +8 -1
- package/package.json +1 -1
- package/src/Alerts/AAlert.tsx +3 -3
- package/src/Alerts/AAlertIOS.tsx +2 -2
- package/src/Common/NetworkServiceCall.ts +298 -0
- package/src/CommonStyle/ComponentFunctions.tsx +387 -410
- package/src/CommonStyle/{componentStyle.tsx → componentStyle.ts} +210 -104
- package/src/Custom/Loader.js +182 -0
- package/src/CustomComponents/CBackHandler.tsx +336 -0
- package/src/{Common/Icons.tsx → Hoc/HIcons.tsx} +2 -2
- package/src/Navigation/useFocusEffect.ts +2 -0
- package/src/Navigation/useFocusEffect.web.ts +1 -0
- package/src/Navigation/useIsFocused.ts +1 -0
- package/src/Navigation/useIsFocused.web.ts +1 -0
- package/src/Navigation/useNavigation.ts +2 -0
- package/src/Navigation/useNavigation.web.ts +1 -0
- package/src/Navigation/useFocusEffect.tsx +0 -2
- package/src/Navigation/useFocusEffect.web.tsx +0 -1
- package/src/Navigation/useIsFocused.tsx +0 -1
- package/src/Navigation/useIsFocused.web.tsx +0 -1
- package/src/Navigation/useNavigation.tsx +0 -2
- package/src/Navigation/useNavigation.web.tsx +0 -1
- /package/src/Navigation/{useFocusEffect.native.tsx → useFocusEffect.native.ts} +0 -0
- /package/src/Navigation/{useIsFocused.native.tsx → useIsFocused.native.ts} +0 -0
- /package/src/Navigation/{useNavigation.native.tsx → useNavigation.native.ts} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import ComponentStyles from '../CommonStyle/componentStyle';
|
|
3
2
|
import { colors, fontWeight } from '../CommonStyle/commonStyle';
|
|
4
3
|
import {
|
|
@@ -12,6 +11,9 @@ import {
|
|
|
12
11
|
Dimensions,
|
|
13
12
|
View,
|
|
14
13
|
Image,
|
|
14
|
+
ViewStyle,
|
|
15
|
+
TextStyle,
|
|
16
|
+
ImageStyle,
|
|
15
17
|
} from 'react-native';
|
|
16
18
|
import NetInfo from '@react-native-community/netinfo';
|
|
17
19
|
import { Global } from '../../../../../src/Common/Global';
|
|
@@ -25,8 +27,31 @@ const {
|
|
|
25
27
|
|
|
26
28
|
const scale = SCREEN_WIDTH / 320;
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
// Type definitions
|
|
31
|
+
interface ShadowStyle {
|
|
32
|
+
elevation?: number;
|
|
33
|
+
shadowColor?: string;
|
|
34
|
+
shadowOffset?: { width: number; height: number };
|
|
35
|
+
shadowOpacity?: number;
|
|
36
|
+
shadowRadius?: number;
|
|
37
|
+
boxShadow?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface WeekDay {
|
|
41
|
+
datavalue: number;
|
|
42
|
+
displayvalue: string;
|
|
43
|
+
selected: boolean;
|
|
44
|
+
}
|
|
29
45
|
|
|
46
|
+
interface NetInfoState {
|
|
47
|
+
type: string;
|
|
48
|
+
isConnected: boolean | null;
|
|
49
|
+
isInternetReachable: boolean | null;
|
|
50
|
+
details?: any;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Shadow Functions
|
|
54
|
+
export function CButtonShadow(): ShadowStyle {
|
|
30
55
|
const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
|
|
31
56
|
return isAndroidBelow9 ? {
|
|
32
57
|
elevation: 10,
|
|
@@ -35,12 +60,11 @@ export function CButtonShadow() {
|
|
|
35
60
|
shadowOpacity: 0,
|
|
36
61
|
shadowRadius: 20,
|
|
37
62
|
} : {
|
|
38
|
-
boxShadow: `-
|
|
39
|
-
};
|
|
63
|
+
boxShadow: `-3px 3px 6px -1px ${Global.AppTheme.primary_color}`,
|
|
64
|
+
};
|
|
40
65
|
}
|
|
41
66
|
|
|
42
|
-
export function CFooterShadow() {
|
|
43
|
-
|
|
67
|
+
export function CFooterShadow(): ShadowStyle {
|
|
44
68
|
const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
|
|
45
69
|
return isAndroidBelow9 ? {
|
|
46
70
|
elevation: 10,
|
|
@@ -49,14 +73,35 @@ export function CFooterShadow() {
|
|
|
49
73
|
shadowOpacity: 0,
|
|
50
74
|
shadowRadius: 20,
|
|
51
75
|
} : {
|
|
52
|
-
boxShadow: `
|
|
53
|
-
};
|
|
76
|
+
boxShadow: `0px 4px 10px 0px ${Global.AppTheme.primary_color}`,
|
|
77
|
+
};
|
|
54
78
|
}
|
|
55
79
|
|
|
56
|
-
export function
|
|
80
|
+
export function CShadowDynamic(
|
|
81
|
+
offsetX: number = 0,
|
|
82
|
+
offsetY: number = 2,
|
|
83
|
+
blurRadius: number = 6,
|
|
84
|
+
spreadDistance: number = 0,
|
|
85
|
+
color: string = 'rgba(0, 0, 0, 0.2)',
|
|
86
|
+
): ShadowStyle {
|
|
87
|
+
const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
|
|
57
88
|
|
|
58
|
-
return
|
|
89
|
+
return isAndroidBelow9
|
|
90
|
+
? {
|
|
91
|
+
elevation: 6,
|
|
92
|
+
shadowColor: color,
|
|
93
|
+
shadowOffset: { width: offsetX, height: offsetY },
|
|
94
|
+
shadowOpacity: 0.25,
|
|
95
|
+
shadowRadius: blurRadius,
|
|
96
|
+
}
|
|
97
|
+
: {
|
|
98
|
+
boxShadow: `${offsetX}px ${offsetY}px ${blurRadius}px ${spreadDistance}px ${color}`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
59
101
|
|
|
102
|
+
// Loader Components
|
|
103
|
+
export function LoaderIndicator(i?: any): React.JSX.Element {
|
|
104
|
+
return (
|
|
60
105
|
<View style={{
|
|
61
106
|
backgroundColor: '#ffffff',
|
|
62
107
|
padding: normalize(10),
|
|
@@ -69,16 +114,21 @@ export function LoaderIndicator(i) {
|
|
|
69
114
|
width: normalize(35),
|
|
70
115
|
height: normalize(35),
|
|
71
116
|
}}
|
|
72
|
-
|
|
73
|
-
source={{uri: `${APIURL}file/getCommonFile/image/heartpulse.gif`}}
|
|
117
|
+
source={{ uri: `${APIURL}file/getCommonFile/image/heartpulse.gif` }}
|
|
74
118
|
resizeMode={Image.resizeMode.contain}
|
|
75
119
|
/>
|
|
76
120
|
</View>
|
|
77
121
|
);
|
|
122
|
+
}
|
|
78
123
|
|
|
124
|
+
export function Loader(): React.JSX.Element {
|
|
125
|
+
return (
|
|
126
|
+
<ActivityIndicator size={normalize(30)} style={{ marginTop: normalize(10) }} color="red" />
|
|
127
|
+
);
|
|
79
128
|
}
|
|
80
129
|
|
|
81
|
-
|
|
130
|
+
// Utility Functions
|
|
131
|
+
export function normalize(size: number): number {
|
|
82
132
|
const newSize = scale < 1.5 ? size * scale : size * 1.6;
|
|
83
133
|
if (Platform.OS === 'ios') {
|
|
84
134
|
return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
|
|
@@ -87,129 +137,107 @@ export function normalize(size) {
|
|
|
87
137
|
}
|
|
88
138
|
}
|
|
89
139
|
|
|
90
|
-
export function Loader() {
|
|
91
|
-
return (
|
|
92
|
-
<ActivityIndicator size={normalize(30)} style={{ marginTop: normalize(10) }} color="red" />
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function CShadowDynamic(
|
|
97
|
-
offsetX = 0,
|
|
98
|
-
offsetY = 2,
|
|
99
|
-
blurRadius = 6,
|
|
100
|
-
spreadDistance = 0,
|
|
101
|
-
color = 'rgba(0, 0, 0, 0.2)',
|
|
102
|
-
) {
|
|
103
|
-
const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
|
|
104
|
-
|
|
105
|
-
return isAndroidBelow9
|
|
106
|
-
? {
|
|
107
|
-
elevation: 6,
|
|
108
|
-
shadowColor: color,
|
|
109
|
-
shadowOffset: {width: offsetX, height: offsetY},
|
|
110
|
-
shadowOpacity: 0.25,
|
|
111
|
-
shadowRadius: blurRadius,
|
|
112
|
-
}
|
|
113
|
-
: {
|
|
114
|
-
boxShadow: `${offsetX}px ${offsetY}px ${blurRadius}px ${spreadDistance}px ${color}`,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export async function getAppVersion() {
|
|
119
|
-
var Ver = 1.1;
|
|
120
|
-
const Results = await codePush.getUpdateMetadata();
|
|
121
|
-
if (Results) {
|
|
122
|
-
if (Results.isPending == false) {
|
|
123
|
-
Ver = Results.appVersion + Results.label;
|
|
124
|
-
} else {
|
|
125
|
-
Ver = Results.appVersion + Results.label + ' NOT UPDATED !!!';
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return Ver;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
140
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*/
|
|
135
|
-
export function isBNU(i) {
|
|
141
|
+
// Value Check Functions
|
|
142
|
+
export function isBNU(i: any): boolean {
|
|
136
143
|
return (i && i != null && i != undefined ? true : false);
|
|
137
144
|
}
|
|
138
145
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
export function isNU(i) { return (i != null && i != undefined ? true : false); }
|
|
146
|
+
export function isNU(i: any): boolean {
|
|
147
|
+
return (i != null && i != undefined ? true : false);
|
|
148
|
+
}
|
|
143
149
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
export function isNUL(i) { return (i != null && i != undefined && i.length > 0 ? true : false); }
|
|
150
|
+
export function isNUL(i: any[] | string | null | undefined): boolean {
|
|
151
|
+
return (i != null && i != undefined && i.length > 0 ? true : false);
|
|
152
|
+
}
|
|
148
153
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
export function isNUQ(i) { return (i != null && i != undefined && i != '' ? true : false); }
|
|
154
|
+
export function isNUQ(i: any): boolean {
|
|
155
|
+
return (i != null && i != undefined && i !== '' ? true : false);
|
|
156
|
+
}
|
|
153
157
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
export function isNUQZ(i) { return (i != null && i != undefined && i != '' && i != 0 ? true : false); }
|
|
158
|
+
export function isNUQZ(i: any): boolean {
|
|
159
|
+
return (i != null && i != undefined && i !== '' && i !== 0 ? true : false);
|
|
160
|
+
}
|
|
158
161
|
|
|
159
|
-
|
|
160
|
-
* To check whether value is true && null && undefined && length > 0
|
|
161
|
-
*/
|
|
162
|
-
export function isBNUL(i) {
|
|
162
|
+
export function isBNUL(i: any[] | string | null | undefined): boolean {
|
|
163
163
|
return (i && i != null && i != undefined && i.length > 0 ? true : false);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
// Type Check Functions
|
|
167
|
+
export function isOrganism(i: number): boolean {
|
|
167
168
|
return (i == 3 ? true : false);
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
export function isDescription(i) {
|
|
171
|
+
export function isDescription(i: number): boolean {
|
|
171
172
|
return (i == 1 || i == 6 || i == 7 || i == 8 ? true : false);
|
|
172
173
|
}
|
|
173
174
|
|
|
174
|
-
export function isValueBased(i) {
|
|
175
|
+
export function isValueBased(i: number): boolean {
|
|
175
176
|
return (i == 2 || i == 4 || i == 5 ? true : false);
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
export function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
export function isDes(i: number): boolean {
|
|
180
|
+
return (i == 1 ? true : false);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function isVal(i: number): boolean {
|
|
184
|
+
return (i == 2 ? true : false);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function isOrg(i: number): boolean {
|
|
188
|
+
return (i == 3 ? true : false);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function isSero(i: number): boolean {
|
|
192
|
+
return (i == 4 ? true : false);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function isViro(i: number): boolean {
|
|
196
|
+
return (i == 5 ? true : false);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function isPath(i: number): boolean {
|
|
200
|
+
return (i == 6 ? true : false);
|
|
201
|
+
}
|
|
183
202
|
|
|
203
|
+
// Debug Functions
|
|
204
|
+
export function dlog(i: any): void {
|
|
205
|
+
if (__DEV__) {
|
|
206
|
+
console.log(i);
|
|
184
207
|
}
|
|
185
208
|
}
|
|
186
209
|
|
|
187
|
-
export function cdev() {
|
|
210
|
+
export function cdev(): boolean {
|
|
188
211
|
if (__DEV__) {
|
|
189
212
|
return true;
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
213
|
+
} else {
|
|
192
214
|
return false;
|
|
193
215
|
}
|
|
194
216
|
}
|
|
195
217
|
|
|
196
|
-
export function clog(i) {
|
|
197
|
-
|
|
218
|
+
export function clog(i: any): void {
|
|
219
|
+
console.log(i);
|
|
198
220
|
}
|
|
199
221
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
export function ValueCheck(value) {
|
|
222
|
+
// Validation Functions
|
|
223
|
+
export function ValueCheck(value: any): boolean {
|
|
204
224
|
if (value) {
|
|
205
225
|
return true;
|
|
206
226
|
} else {
|
|
207
|
-
false;
|
|
227
|
+
return false;
|
|
208
228
|
}
|
|
209
229
|
}
|
|
210
230
|
|
|
211
|
-
export function
|
|
212
|
-
|
|
231
|
+
export function ArrayCheck(value: any[] | null | undefined): boolean {
|
|
232
|
+
if (value && value.length > 0) {
|
|
233
|
+
return true;
|
|
234
|
+
} else {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export function convertStringToArrayWeekDay(inputString: string): WeekDay[] {
|
|
240
|
+
const days: WeekDay[] = [
|
|
213
241
|
{ datavalue: 1, displayvalue: 'Su', selected: true },
|
|
214
242
|
{ datavalue: 2, displayvalue: 'M', selected: true },
|
|
215
243
|
{ datavalue: 3, displayvalue: 'Tu', selected: true },
|
|
@@ -224,28 +252,20 @@ export function convertStringToArrayWeekDay(inputString) {
|
|
|
224
252
|
datavalue: day.datavalue,
|
|
225
253
|
displayvalue: day.displayvalue,
|
|
226
254
|
selected: selectedDays.includes(day.datavalue) ? false : true,
|
|
227
|
-
// selected: day.selected,
|
|
228
255
|
};
|
|
229
256
|
});
|
|
230
257
|
}
|
|
231
258
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return true;
|
|
235
|
-
} else {
|
|
236
|
-
false;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export async function isPermitted() {
|
|
259
|
+
// Permission Functions
|
|
260
|
+
export async function isPermitted(): Promise<boolean> {
|
|
241
261
|
if (Platform.OS === 'android') {
|
|
242
262
|
try {
|
|
243
|
-
const apiLevel = Platform.Version;
|
|
263
|
+
const apiLevel = Platform.Version as number;
|
|
244
264
|
|
|
245
265
|
// Android 13+ (API 33+) - need READ_MEDIA permissions
|
|
246
266
|
if (apiLevel >= 33) {
|
|
247
267
|
const granted = await PermissionsAndroid.request(
|
|
248
|
-
PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES
|
|
268
|
+
PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES as any
|
|
249
269
|
);
|
|
250
270
|
return granted === PermissionsAndroid.RESULTS.GRANTED;
|
|
251
271
|
}
|
|
@@ -260,7 +280,7 @@ export async function isPermitted() {
|
|
|
260
280
|
);
|
|
261
281
|
return granted === PermissionsAndroid.RESULTS.GRANTED;
|
|
262
282
|
}
|
|
263
|
-
} catch (err) {
|
|
283
|
+
} catch (err: any) {
|
|
264
284
|
Alert.alert('File access Permission not allowed', err.toString());
|
|
265
285
|
return false;
|
|
266
286
|
}
|
|
@@ -269,36 +289,14 @@ export async function isPermitted() {
|
|
|
269
289
|
}
|
|
270
290
|
}
|
|
271
291
|
|
|
272
|
-
|
|
292
|
+
// Network Functions
|
|
293
|
+
export function getLoading(load: () => void): void {
|
|
273
294
|
setTimeout(load, 15000);
|
|
274
295
|
}
|
|
275
|
-
export function isDes(i) {
|
|
276
|
-
return (i == 1 ? true : false);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
export function isVal(i) {
|
|
280
|
-
return (i == 2 ? true : false);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export function isOrg(i) {
|
|
284
|
-
return (i == 3 ? true : false);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export function isSero(i) {
|
|
288
|
-
return (i == 4 ? true : false);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export function isViro(i) {
|
|
292
|
-
return (i == 5 ? true : false);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export function isPath(i) {
|
|
296
|
-
return (i == 6 ? true : false);
|
|
297
|
-
}
|
|
298
296
|
|
|
299
|
-
export function isConnected() {
|
|
297
|
+
export function isConnected(): Promise<void> {
|
|
300
298
|
return new Promise((resolve, reject) => {
|
|
301
|
-
NetInfo.fetch().then(state => {
|
|
299
|
+
NetInfo.fetch().then((state: NetInfoState) => {
|
|
302
300
|
console.log('Connection type', state.type);
|
|
303
301
|
console.log('Is connected?', state.isConnected);
|
|
304
302
|
console.log('Is Internet?', state.isInternetReachable);
|
|
@@ -306,70 +304,59 @@ export function isConnected() {
|
|
|
306
304
|
|
|
307
305
|
if (state.isConnected && state.isInternetReachable) {
|
|
308
306
|
resolve();
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
307
|
+
} else {
|
|
311
308
|
reject();
|
|
312
309
|
}
|
|
313
310
|
});
|
|
314
311
|
});
|
|
315
312
|
}
|
|
316
313
|
|
|
317
|
-
//Footer
|
|
318
|
-
export function getFooterIcon(opacity) {
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
);
|
|
314
|
+
// Footer Functions
|
|
315
|
+
export function getFooterIcon(opacity: number): ViewStyle {
|
|
316
|
+
return {
|
|
317
|
+
...ComponentStyles.footer_Icon,
|
|
318
|
+
opacity: opacity,
|
|
319
|
+
};
|
|
325
320
|
}
|
|
326
321
|
|
|
327
|
-
export function notifyMessage(msg, type) {
|
|
322
|
+
export function notifyMessage(msg: string, type?: any): void {
|
|
328
323
|
DeviceEventEmitter.emit('event.testToast', {
|
|
329
324
|
'displaytext': msg,
|
|
330
325
|
'datavalue': type,
|
|
331
326
|
});
|
|
332
|
-
|
|
333
|
-
// let X = bottom != undefined && bottom != null ? bottom : 80
|
|
334
|
-
// if (Platform.OS === 'android') {
|
|
335
|
-
// ToastAndroid.showWithGravityAndOffset(msg, ToastAndroid.LONG, ToastAndroid.BOTTOM,
|
|
336
|
-
// 0,
|
|
337
|
-
// X)
|
|
338
|
-
// } else {
|
|
339
|
-
// Alert.alert(msg);
|
|
340
|
-
// }
|
|
341
327
|
}
|
|
342
328
|
|
|
343
|
-
export function getFooterIconText(opacity, color) {
|
|
344
|
-
return
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
);
|
|
329
|
+
export function getFooterIconText(opacity: number, color: string): TextStyle {
|
|
330
|
+
return {
|
|
331
|
+
...ComponentStyles.footer_Icon_Text,
|
|
332
|
+
opacity: opacity,
|
|
333
|
+
color: color,
|
|
334
|
+
};
|
|
351
335
|
}
|
|
352
336
|
|
|
353
|
-
// Header
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
paddingTop: '5%',
|
|
361
|
-
}
|
|
362
|
-
);
|
|
337
|
+
// Header Functions
|
|
338
|
+
export function getHeaderBlockContainer(width: number): ViewStyle {
|
|
339
|
+
return {
|
|
340
|
+
...ComponentStyles.header_section_conatiner_style,
|
|
341
|
+
width: width,
|
|
342
|
+
paddingTop: '5%',
|
|
343
|
+
};
|
|
363
344
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
345
|
+
|
|
346
|
+
export function getHeaderTitleContainer(width: number): ViewStyle {
|
|
347
|
+
return {
|
|
348
|
+
justifyContent: 'flex-end',
|
|
349
|
+
paddingLeft: width * 0.02,
|
|
350
|
+
};
|
|
370
351
|
}
|
|
371
352
|
|
|
372
|
-
|
|
353
|
+
// Result View Functions
|
|
354
|
+
export function getResultViewObservedvalueTextvalidate(
|
|
355
|
+
value: any,
|
|
356
|
+
minvalue: number | null | undefined,
|
|
357
|
+
maxvalue: number | null | undefined,
|
|
358
|
+
datatype: string
|
|
359
|
+
): string {
|
|
373
360
|
switch (datatype) {
|
|
374
361
|
case 'integer':
|
|
375
362
|
case 'numeric':
|
|
@@ -382,238 +369,228 @@ export function getResultViewObservedvalueTextvalidate(value, minvalue, maxvalue
|
|
|
382
369
|
else {
|
|
383
370
|
return colors.color_resulttext_normal;
|
|
384
371
|
}
|
|
385
|
-
break;
|
|
386
372
|
default:
|
|
387
373
|
return colors.color_resulttext_normal;
|
|
388
374
|
}
|
|
389
375
|
}
|
|
390
376
|
|
|
391
|
-
// Profile Card
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
return (
|
|
396
|
-
{
|
|
397
|
-
width: '96%',
|
|
398
|
-
backgroundColor: '#fff',
|
|
399
|
-
flexDirection: 'row',
|
|
400
|
-
alignItems: 'center',
|
|
401
|
-
borderRadius: 10, elevation: 5,
|
|
402
|
-
marginBottom: 5,
|
|
403
|
-
borderWidth: 0.1,
|
|
404
|
-
borderLeftWidth: 5,
|
|
405
|
-
borderColor: item.bordercolor ? item.bordercolor : 'lightgreen',
|
|
406
|
-
}
|
|
407
|
-
);
|
|
408
|
-
}
|
|
409
|
-
export function getProfileContentLeftlogo1(item) {
|
|
410
|
-
return (
|
|
411
|
-
{
|
|
412
|
-
borderRadius: 0,
|
|
413
|
-
// backgroundColor: "blue",
|
|
414
|
-
padding: 5,
|
|
415
|
-
color: 'black',
|
|
416
|
-
fontWeight: 'bold', fontSize: normalize(11),
|
|
417
|
-
}
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
export function getProfileContentLeftlogo2() {
|
|
421
|
-
return (
|
|
422
|
-
{
|
|
423
|
-
backgroundColor: '#fcb5b5',
|
|
424
|
-
padding: 5,
|
|
425
|
-
borderRadius: 50,
|
|
426
|
-
color: 'black',
|
|
427
|
-
fontSize: normalize(10),
|
|
428
|
-
}
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
export function getProfileContentLogo1() {
|
|
432
|
-
return (
|
|
433
|
-
{
|
|
434
|
-
fontSize: normalize(13),
|
|
435
|
-
marginTop: 3,
|
|
436
|
-
color: 'black',
|
|
437
|
-
fontWeight: 'bold',
|
|
438
|
-
}
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
export function getProfileContentLogo2() {
|
|
442
|
-
return (
|
|
443
|
-
{
|
|
444
|
-
fontSize: normalize(10),
|
|
445
|
-
color: 'black',
|
|
446
|
-
}
|
|
447
|
-
);
|
|
448
|
-
}
|
|
449
|
-
export function getProfilecardSubheadingTop(color) {
|
|
450
|
-
return (
|
|
451
|
-
{
|
|
452
|
-
fontSize: normalize(10),
|
|
453
|
-
fontWeight: fontWeight.fontWeight_700,
|
|
454
|
-
color: color,
|
|
455
|
-
// padding: 5,
|
|
456
|
-
paddingBottom: 0,
|
|
457
|
-
paddingTop: 2,
|
|
458
|
-
}
|
|
459
|
-
);
|
|
460
|
-
}
|
|
461
|
-
export function getProfilecardSubheadingBottom(color, position) {
|
|
462
|
-
return (
|
|
463
|
-
{
|
|
464
|
-
fontSize: normalize(10),
|
|
465
|
-
fontWeight: fontWeight.fontWeight_100,
|
|
466
|
-
color: color,
|
|
467
|
-
paddingLeft: position == 'right' ? 5 : 0,
|
|
468
|
-
paddingRight: position == 'left' ? 5 : 0,
|
|
469
|
-
}
|
|
470
|
-
);
|
|
377
|
+
// Profile Card Functions
|
|
378
|
+
interface ProfileItem {
|
|
379
|
+
bordercolor?: string;
|
|
380
|
+
[key: string]: any;
|
|
471
381
|
}
|
|
472
382
|
|
|
473
|
-
export function
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
export function
|
|
510
|
-
return
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
383
|
+
export function getProfileMainContainer(item: ProfileItem): ViewStyle {
|
|
384
|
+
console.log('getProfileMainContainer', item);
|
|
385
|
+
return {
|
|
386
|
+
width: '96%',
|
|
387
|
+
backgroundColor: '#fff',
|
|
388
|
+
flexDirection: 'row',
|
|
389
|
+
alignItems: 'center',
|
|
390
|
+
borderRadius: 10,
|
|
391
|
+
elevation: 5,
|
|
392
|
+
marginBottom: 5,
|
|
393
|
+
borderWidth: 0.1,
|
|
394
|
+
borderLeftWidth: 5,
|
|
395
|
+
borderColor: item.bordercolor ? item.bordercolor : 'lightgreen',
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export function getProfileContentLeftlogo1(item: ProfileItem): TextStyle {
|
|
400
|
+
return {
|
|
401
|
+
borderRadius: 0,
|
|
402
|
+
padding: 5,
|
|
403
|
+
color: 'black',
|
|
404
|
+
fontWeight: 'bold',
|
|
405
|
+
fontSize: normalize(11),
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export function getProfileContentLeftlogo2(): TextStyle {
|
|
410
|
+
return {
|
|
411
|
+
backgroundColor: '#fcb5b5',
|
|
412
|
+
padding: 5,
|
|
413
|
+
borderRadius: 50,
|
|
414
|
+
color: 'black',
|
|
415
|
+
fontSize: normalize(10),
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export function getProfileContentLogo1(): TextStyle {
|
|
420
|
+
return {
|
|
421
|
+
fontSize: normalize(13),
|
|
422
|
+
marginTop: 3,
|
|
423
|
+
color: 'black',
|
|
424
|
+
fontWeight: 'bold',
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export function getProfileContentLogo2(): TextStyle {
|
|
429
|
+
return {
|
|
430
|
+
fontSize: normalize(10),
|
|
431
|
+
color: 'black',
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export function getProfilecardSubheadingTop(color: string): TextStyle {
|
|
436
|
+
return {
|
|
437
|
+
fontSize: normalize(10),
|
|
438
|
+
fontWeight: fontWeight.fontWeight_700,
|
|
439
|
+
color: color,
|
|
440
|
+
paddingBottom: 0,
|
|
441
|
+
paddingTop: 2,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export function getProfilecardSubheadingBottom(color: string, position: string): TextStyle {
|
|
446
|
+
return {
|
|
447
|
+
fontSize: normalize(10),
|
|
448
|
+
fontWeight: fontWeight.fontWeight_100,
|
|
449
|
+
color: color,
|
|
450
|
+
paddingLeft: position == 'right' ? 5 : 0,
|
|
451
|
+
paddingRight: position == 'left' ? 5 : 0,
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
export function getProfilecardMobileNO(color: string, position: string): TextStyle {
|
|
456
|
+
return {
|
|
457
|
+
fontSize: normalize(12),
|
|
458
|
+
fontWeight: fontWeight.fontWeight_Bold,
|
|
459
|
+
color: color,
|
|
460
|
+
paddingLeft: position == 'right' ? 5 : 0,
|
|
461
|
+
paddingRight: position == 'left' ? 5 : 0,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export function getProfilecardOnlineStatusBadgeContainer(backgroundcolor: string): ViewStyle {
|
|
466
|
+
return {
|
|
467
|
+
backgroundColor: backgroundcolor,
|
|
468
|
+
height: normalize(20),
|
|
469
|
+
paddingHorizontal: normalize(5),
|
|
470
|
+
borderRadius: 1000,
|
|
471
|
+
padding: 0,
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export function getGroupButtonView(width: number): ViewStyle {
|
|
476
|
+
return {
|
|
477
|
+
justifyContent: 'center',
|
|
478
|
+
margin: 5,
|
|
479
|
+
width: width * 0.10,
|
|
480
|
+
alignContent: 'center',
|
|
481
|
+
alignItems: 'center',
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Media Functions
|
|
486
|
+
export function getMediaoverlayContainerStyle(height: number): ViewStyle {
|
|
487
|
+
return {
|
|
488
|
+
...ComponentStyles.mediaoverlay_containerstyle,
|
|
489
|
+
height: height,
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export function getMediaViewContainer(width: number, height: number, itemwidth: number): ViewStyle {
|
|
494
|
+
return {
|
|
495
|
+
...ComponentStyles.View_col_center,
|
|
496
|
+
width: width * (itemwidth / 100),
|
|
497
|
+
margin: height * 0.003,
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export function getMediaViewChildContainer(width: number, itemwidth: number): ViewStyle {
|
|
502
|
+
return {
|
|
503
|
+
borderWidth: 0.5,
|
|
504
|
+
borderRadius: 2,
|
|
505
|
+
width: width * (itemwidth / 100),
|
|
506
|
+
borderColor: colors.color_componentBordercolor,
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export function getMediaIcon(width: number, itemwidth: number): ImageStyle {
|
|
511
|
+
return {
|
|
512
|
+
height: 120,
|
|
513
|
+
width: width * (itemwidth / 100),
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export function getMediaoverlayChildrenwrapperStyle(
|
|
518
|
+
width: number,
|
|
519
|
+
height: number,
|
|
520
|
+
itemheight: number
|
|
521
|
+
): ViewStyle {
|
|
522
|
+
return {
|
|
523
|
+
width: width,
|
|
524
|
+
height: itemheight,
|
|
525
|
+
padding: height * 0.01,
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export function getMediaoverlayTopLineContainer(width: number, height: number): ViewStyle {
|
|
530
|
+
return {
|
|
531
|
+
...ComponentStyles.View_col_center,
|
|
532
|
+
width: width * 0.15,
|
|
533
|
+
height: height * 0.02,
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export function getMediaoverlayOptionRow(width: number, height: number): ViewStyle {
|
|
538
|
+
return {
|
|
539
|
+
...ComponentStyles.View_row_spacearound,
|
|
540
|
+
borderRadius: 14,
|
|
541
|
+
marginTop: height * 0.02,
|
|
542
|
+
width: width * 0.90,
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export function getMediaoverlayOptionContainer(width: number, height: number): ViewStyle {
|
|
547
|
+
return {
|
|
548
|
+
...ComponentStyles.View_col_center,
|
|
549
|
+
margin: 5,
|
|
550
|
+
height: height * 0.1,
|
|
551
|
+
width: width * 0.20,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
export function getMediaoverlayMsgorLoaderView(height: number): ViewStyle {
|
|
556
|
+
return {
|
|
557
|
+
height: height,
|
|
558
|
+
...ComponentStyles.View_col_center,
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export function getMediaGalleryChildContainer(width: number, height: number): ViewStyle {
|
|
563
|
+
return {
|
|
564
|
+
marginTop: height * 0.01,
|
|
565
|
+
width: width * 0.90,
|
|
566
|
+
justifyContent: 'center',
|
|
567
|
+
alignItems: 'center',
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export function getMediaGalleryDeleteView(width: number, height: number): ViewStyle {
|
|
572
|
+
return {
|
|
573
|
+
borderWidth: 0.5,
|
|
574
|
+
borderRadius: 2,
|
|
575
|
+
height: height / 5,
|
|
576
|
+
width: width * 0.90,
|
|
577
|
+
borderColor: colors.color_componentBordercolor,
|
|
578
|
+
alignItems: 'center',
|
|
579
|
+
justifyContent: 'center',
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export function getMediaIconStyle(width: number, height: number): ImageStyle {
|
|
584
|
+
return {
|
|
585
|
+
height: height / 5,
|
|
586
|
+
width: width * 0.90,
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export function getMediaGalleryDeleteIcon(width: number): ImageStyle {
|
|
591
|
+
return {
|
|
592
|
+
height: '40%',
|
|
593
|
+
width: width * 0.90,
|
|
594
|
+
resizeMode: 'contain',
|
|
595
|
+
};
|
|
596
|
+
}
|