@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 +10 -6
- package/index.js +10 -6
- package/package.json +1 -1
- package/src/Alerts/AAlert.tsx +1 -0
- package/src/Alerts/AAlertIOS.tsx +1 -0
- package/src/Common/NetworkServiceCall.ts +1 -0
- package/src/CommonStyle/ComponentFunctions.tsx +1 -22
- package/src/Custom/CSliderMenu.tsx +10 -0
- package/src/Custom/OUserView.tsx +355 -0
- package/src/CustomComponents/CBackHandler.tsx +1 -0
- package/src/CustomComponents/CContainerView.tsx +39 -0
- package/src/CustomComponents/CDetailView.tsx +234 -0
- package/src/CustomComponents/CFooterView.tsx +86 -0
- package/src/CustomComponents/CNetworkStatus.tsx +172 -0
- package/src/CustomComponents/COverlay.tsx +111 -0
- package/src/CustomComponents/HeaderBlock.tsx +775 -0
- package/src/Handlers/NotificationsContext.tsx +7 -0
- package/src/Handlers/ResponseComponentContext.tsx +56 -0
- package/src/Hoc/HDashboard.tsx +1065 -0
- package/src/Hoc/HIcons.tsx +48 -56
- package/src/Hoc/HProvider.tsx +18 -0
- package/src/Hoc/HShadowButton.tsx +102 -0
- package/src/StaticComponents/SDateTimePicker.tsx +504 -0
- package/src/StaticComponents/SSearchBar.tsx +118 -0
- package/src/Custom/Loader.js +0 -182
- package/src/Layout/LoginLayout.tsx +0 -711
- package/src/Screens/ForgotPassword.tsx +0 -342
- package/src/Screens/Login.tsx +0 -331
- package/src/Screens/Splash.tsx +0 -782
package/src/Hoc/HIcons.tsx
CHANGED
|
@@ -15,69 +15,60 @@ import AntDesignI from 'react-native-vector-icons/AntDesign';
|
|
|
15
15
|
|
|
16
16
|
import type { IconProps } from 'react-native-vector-icons/Icon';
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* Shared icon props type
|
|
20
|
-
*/
|
|
21
18
|
type Props = IconProps;
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
export const
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
export const
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
export const
|
|
39
|
-
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
20
|
+
export interface IconsProps extends Props {
|
|
21
|
+
icongroup?: number | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Wrappers (kept, but note: declare BEFORE the map)
|
|
25
|
+
export const MaterialCommunityIcons: React.FC<Props> = (p) => <MaterialCommunityIconsI {...p} />;
|
|
26
|
+
export const SimpleLineIcons: React.FC<Props> = (p) => <SimpleLineIconsI {...p} />;
|
|
27
|
+
export const MaterialIcons: React.FC<Props> = (p) => <MaterialIconsI {...p} />;
|
|
28
|
+
export const FontAwesome: React.FC<Props> = (p) => <FontAwesomeI {...p} />;
|
|
29
|
+
export const Foundation: React.FC<Props> = (p) => <FoundationI {...p} />;
|
|
30
|
+
export const EvilIcons: React.FC<Props> = (p) => <EvilIconsI {...p} />;
|
|
31
|
+
export const Ionicons: React.FC<Props> = (p) => <IoniconsI {...p} />;
|
|
32
|
+
export const Octicons: React.FC<Props> = (p) => <OcticonsI {...p} />;
|
|
33
|
+
export const Feather: React.FC<Props> = (p) => <FeatherI {...p} />;
|
|
34
|
+
export const Entypo: React.FC<Props> = (p) => <EntypoI {...p} />;
|
|
35
|
+
export const Zocial: React.FC<Props> = (p) => <ZocialI {...p} />;
|
|
36
|
+
export const FontAwesome5: React.FC<Props> = (p) => <FontAwesome5I {...p} />;
|
|
37
|
+
export const AntDesign: React.FC<Props> = (p) => <AntDesignI {...p} />;
|
|
38
|
+
|
|
39
|
+
// If you actually need Fontisto, add:
|
|
40
|
+
// import FontistoI from 'react-native-vector-icons/Fontisto';
|
|
41
|
+
// export const Fontisto: React.FC<Props> = (p) => <FontistoI {...p} />;
|
|
42
|
+
|
|
43
|
+
const components: Record<number, React.ComponentType<Props>> = {
|
|
44
|
+
1: AntDesign,
|
|
45
|
+
2: MaterialIcons,
|
|
46
|
+
3: MaterialCommunityIcons,
|
|
47
|
+
4: FontAwesome,
|
|
48
|
+
5: FontAwesome5,
|
|
49
|
+
6: Foundation,
|
|
50
|
+
7: EvilIcons,
|
|
51
|
+
8: Ionicons,
|
|
52
|
+
9: Octicons,
|
|
53
|
+
10: Feather,
|
|
54
|
+
11: Entypo,
|
|
55
|
+
12: Zocial,
|
|
56
|
+
14: SimpleLineIcons,
|
|
57
|
+
};
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
<EntypoI {...props} />
|
|
64
|
-
);
|
|
59
|
+
const DEFAULT_ICON_GROUP = 5;
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
)
|
|
61
|
+
function Icons({ icongroup, ...rest }: IconsProps): React.ReactElement {
|
|
62
|
+
const group =
|
|
63
|
+
typeof icongroup === 'number' && Number.isInteger(icongroup) && icongroup >= 1 && icongroup in components
|
|
64
|
+
? icongroup
|
|
65
|
+
: DEFAULT_ICON_GROUP;
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
<FontAwesome5I {...props} />
|
|
72
|
-
);
|
|
67
|
+
const IconComponent = components[group] ?? components[DEFAULT_ICON_GROUP];
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
);
|
|
69
|
+
return <IconComponent {...rest} />;
|
|
70
|
+
}
|
|
77
71
|
|
|
78
|
-
/**
|
|
79
|
-
* Default export object (same usage style as your JS version)
|
|
80
|
-
*/
|
|
81
72
|
const HIcons = {
|
|
82
73
|
MaterialCommunityIcons,
|
|
83
74
|
SimpleLineIcons,
|
|
@@ -92,6 +83,7 @@ const HIcons = {
|
|
|
92
83
|
Zocial,
|
|
93
84
|
FontAwesome5,
|
|
94
85
|
AntDesign,
|
|
86
|
+
Icons,
|
|
95
87
|
};
|
|
96
88
|
|
|
97
89
|
export default HIcons;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import HView from '../Hoc/HView';
|
|
3
|
+
import Navigation from '../Navigation/PageNavigation';
|
|
4
|
+
import ErrorBoundary from '../Common/ErrorBoundary';
|
|
5
|
+
|
|
6
|
+
interface HProviderProps {
|
|
7
|
+
components: Record<string, React.ComponentType<any>>;
|
|
8
|
+
screens: any;
|
|
9
|
+
}
|
|
10
|
+
export default function HProvider(props: HProviderProps) {
|
|
11
|
+
return (
|
|
12
|
+
<ErrorBoundary>
|
|
13
|
+
<HView components={props.components}>
|
|
14
|
+
<Navigation screens={props.screens} />
|
|
15
|
+
</HView>
|
|
16
|
+
</ErrorBoundary>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { StyleProp, Text, TextStyle, TouchableOpacity, ViewStyle } from 'react-native';
|
|
2
|
+
import { isBNU, isNU, isNUQ, normalize } from '../CommonStyle/ComponentFunctions';
|
|
3
|
+
import HIcons from './HIcons';
|
|
4
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
5
|
+
;
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Types
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
export interface HShadowButtonProps {
|
|
13
|
+
/** Disables the button when true. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Invoked on press. Receives `true` when pressed. */
|
|
16
|
+
buttonCallback?: (pressed: boolean) => void;
|
|
17
|
+
/** Outer button (TouchableOpacity) style. */
|
|
18
|
+
buttonstyle?: StyleProp<ViewStyle>;
|
|
19
|
+
|
|
20
|
+
/** Render the leading icon when true. */
|
|
21
|
+
useicon?: boolean;
|
|
22
|
+
/** Icon group index (e.g. FontAwesome vs MaterialIcons). Defaults to 5. */
|
|
23
|
+
icongroup?: number;
|
|
24
|
+
/** Icon name string. Defaults to 'file-alt'. */
|
|
25
|
+
iconname?: string;
|
|
26
|
+
/** Icon color. Defaults to `Global.AppTheme.primary_color`. */
|
|
27
|
+
iconcolor?: string;
|
|
28
|
+
/** Icon size. Defaults to `normalize(15)`. */
|
|
29
|
+
iconsize?: number;
|
|
30
|
+
/** Extra icon container style. */
|
|
31
|
+
iconstyle?: StyleProp<ViewStyle>;
|
|
32
|
+
|
|
33
|
+
/** Render the label when true. */
|
|
34
|
+
usetext?: boolean;
|
|
35
|
+
/** Label text. */
|
|
36
|
+
displaytext?: string;
|
|
37
|
+
/** Text style. Defaults provided in component. */
|
|
38
|
+
textstyle?: StyleProp<TextStyle>;
|
|
39
|
+
/** Max lines for the label. Defaults to 1. */
|
|
40
|
+
numberOfLines?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Component
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
export default function HShadowButton(props: HShadowButtonProps): React.ReactElement {
|
|
48
|
+
const {
|
|
49
|
+
disabled,
|
|
50
|
+
buttonCallback,
|
|
51
|
+
buttonstyle,
|
|
52
|
+
useicon,
|
|
53
|
+
icongroup,
|
|
54
|
+
iconname,
|
|
55
|
+
iconcolor,
|
|
56
|
+
iconsize,
|
|
57
|
+
iconstyle,
|
|
58
|
+
usetext,
|
|
59
|
+
displaytext,
|
|
60
|
+
textstyle,
|
|
61
|
+
numberOfLines,
|
|
62
|
+
} = props;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<TouchableOpacity
|
|
66
|
+
disabled={!!disabled}
|
|
67
|
+
onPress={() => {
|
|
68
|
+
if (isNU(buttonCallback)) {
|
|
69
|
+
buttonCallback!(true);
|
|
70
|
+
}
|
|
71
|
+
}}
|
|
72
|
+
style={isNU(buttonstyle) ? buttonstyle : {}}
|
|
73
|
+
>
|
|
74
|
+
{useicon ? (
|
|
75
|
+
<HIcons.Icons
|
|
76
|
+
icongroup={isNU(icongroup) ? icongroup : 5}
|
|
77
|
+
name={isBNU(iconname) ? iconname : 'file-alt'}
|
|
78
|
+
color={isNU(iconcolor) ? iconcolor : Global.AppTheme.primary_color}
|
|
79
|
+
size={isNU(iconsize) ? iconsize : normalize(15)}
|
|
80
|
+
style={iconstyle ? iconstyle : {}}
|
|
81
|
+
/>
|
|
82
|
+
) : null}
|
|
83
|
+
{usetext ? (
|
|
84
|
+
<Text
|
|
85
|
+
numberOfLines={numberOfLines || 1}
|
|
86
|
+
adjustsFontSizeToFit={true}
|
|
87
|
+
style={
|
|
88
|
+
textstyle
|
|
89
|
+
? textstyle
|
|
90
|
+
: {
|
|
91
|
+
color: Global.AppTheme.primary_color,
|
|
92
|
+
fontSize: normalize(6),
|
|
93
|
+
textAlign: 'center',
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
>
|
|
97
|
+
{isNUQ(displaytext) ? displaytext : null}
|
|
98
|
+
</Text>
|
|
99
|
+
) : null}
|
|
100
|
+
</TouchableOpacity>
|
|
101
|
+
);
|
|
102
|
+
}
|