@jescon-technologies/react-native-ui-kit 0.0.1 → 0.0.2

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 (59) hide show
  1. package/index.js +70 -0
  2. package/package.json +26 -3
  3. package/src/Alerts/AAlert.js +1 -1
  4. package/src/HOC/ConfirmOverlay.js +192 -0
  5. package/src/HOC/HAbsolute.js +56 -0
  6. package/src/HOC/HDiscontinue.js +105 -0
  7. package/src/HOC/HHeading.js +70 -0
  8. package/src/HOC/HMoreButton.js +88 -0
  9. package/src/HOC/HNatureHeading.js +402 -0
  10. package/src/HOC/HOCIcons.js +80 -0
  11. package/src/HOC/HOverlay.js +99 -0
  12. package/src/HOC/HOverlayCentered.js +140 -0
  13. package/src/HOC/HShadowButton.js +45 -0
  14. package/src/HOC/HShadowCountButton.js +82 -0
  15. package/src/HOC/OptionOverlay.js +48 -0
  16. package/src/Media/AudioScreen.js +347 -0
  17. package/src/Media/BarcodeScan.js +145 -0
  18. package/src/Media/CAudioPlay.js +228 -0
  19. package/src/Media/CCaptureImageWithoutEdit.js +330 -0
  20. package/src/Media/CImageGallery.js +289 -0
  21. package/src/Media/CImageZoom.js +82 -0
  22. package/src/Media/CSingleImage.js +391 -0
  23. package/src/Media/CSketchCanvas.js +76 -0
  24. package/src/Media/CVideoPlay.js +31 -0
  25. package/src/Media/DocumentScreen.js +367 -0
  26. package/src/Media/DrawingScreen.js +582 -0
  27. package/src/Media/ImageScreen.js +313 -0
  28. package/src/Media/RecordAudio.js +250 -0
  29. package/src/Media/RecordVideo.js +223 -0
  30. package/src/Media/VideoScreen.js +383 -0
  31. package/src/StaticComponents/SAlphabet.js +47 -0
  32. package/src/StaticComponents/SCheckBox.js +42 -0
  33. package/src/StaticComponents/SDatePicker.js +208 -0
  34. package/src/StaticComponents/SDatePickerLabel.js +253 -0
  35. package/src/StaticComponents/SDatePickerNew.js +258 -0
  36. package/src/StaticComponents/SDateTimePickerNew.js +381 -0
  37. package/src/StaticComponents/SDropDownGenerate.js +450 -0
  38. package/src/StaticComponents/SDropDownHoc.js +636 -0
  39. package/src/StaticComponents/SDropDownIcon.js +500 -0
  40. package/src/StaticComponents/SMenuBox.js +131 -0
  41. package/src/StaticComponents/SOverlay.js +177 -0
  42. package/src/StaticComponents/SOverlayTextInput.js +109 -0
  43. package/src/StaticComponents/SSearch.js +438 -0
  44. package/src/StaticComponents/SSearchBar.js +53 -0
  45. package/src/StaticComponents/SSpeedDial.js +303 -0
  46. package/src/StaticComponents/STextInput.js +289 -0
  47. package/src/StaticComponents/STextInputProps.js +36 -0
  48. package/src/StaticComponents/STimePicker.js +171 -0
  49. package/src/StaticComponents/STimingDropDownNew.js +1589 -0
  50. package/src/StaticComponents/STimingSwitch.js +34 -0
  51. package/src/layout/CContainerView.js +21 -0
  52. package/src/layout/CDetailView.js +81 -0
  53. package/src/layout/FooterBlock.js +0 -3
  54. package/src/layout/HeaderBlock.js +353 -0
  55. package/src/index.js +0 -15
  56. package/src/screens/ForgotPassword.js +0 -346
  57. package/src/screens/Login.js +0 -328
  58. package/src/screens/Splash.js +0 -788
  59. /package/src/{components → layout}/Loader.js +0 -0
@@ -0,0 +1,177 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { TouchableOpacity, StyleSheet, View, Text, Image, TextInput, ScrollView, Dimensions } from 'react-native';
3
+ import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
4
+ import popupStyles, {
5
+ getListviewItem,
6
+ getListviewItemText,
7
+ } from '../CommonStyle/PopupStyle';
8
+ import Icons from '../Common/Icons';
9
+ import { isBNU } from '../CommonStyle/ComponentFunctions';
10
+ import CModalOverlay from '../CustomComponents/CModalOverlay';
11
+
12
+ const SOverlay = (props) => {
13
+ // const { width, height } = useDimensions().window
14
+ const [isdropdownshow, setDropdownShow] = useState(false);
15
+ const [searchData, setSearchData] = useState('');
16
+ const [isLoading, setIsLoading] = useState(true);
17
+ const [text, onChangeText] = useState(props.value);
18
+
19
+ useEffect(() => {
20
+ isBNU(props.overlay) && props.overlay == true ? setDropdownShow(true) : null;
21
+ }, [props.overlay]);
22
+
23
+ function getOverlayChildrenWrapperStyle() {
24
+ return ({
25
+ borderRadius: 20,
26
+ height: Dimensions.get('screen').height * 0.60,
27
+ });
28
+ }
29
+
30
+ function getPopupTextAreaContainer() {
31
+ return (
32
+ {
33
+ justifyContent: 'center',
34
+ width: Dimensions.get('screen').width * 0.90,
35
+ alignItems: 'center',
36
+ marginTop: Dimensions.get('screen').height * 0.01,
37
+ }
38
+ );
39
+ }
40
+
41
+ function getPopupTextAreaChildContainer(bordercolor) {
42
+ return (
43
+ {
44
+ flexDirection: 'row',
45
+ borderWidth: 1,
46
+ borderColor: bordercolor,
47
+ width: '96%',
48
+ justifyContent: 'flex-start',
49
+ alignItems: 'center',
50
+ borderRadius: 7,
51
+ margin: Dimensions.get('screen').height * 0.003,
52
+ marginBottom: Dimensions.get('screen').height * 0.003,
53
+ height: Dimensions.get('screen').height * 0.40,
54
+ backgroundColor: '#fff',
55
+ marginTop: 0,
56
+ }
57
+ );
58
+ }
59
+
60
+ function getPopupTextAreaChildContainer(bordercolor) {
61
+ return (
62
+ {
63
+ flexDirection: 'row',
64
+ borderWidth: 1,
65
+ borderColor: bordercolor,
66
+ width: '96%',
67
+ justifyContent: 'flex-start',
68
+ alignItems: 'center',
69
+ borderRadius: 7,
70
+ margin: Dimensions.get('screen').height * 0.003,
71
+ marginBottom: Dimensions.get('screen').height * 0.003,
72
+ height: Dimensions.get('screen').height * 0.40,
73
+ backgroundColor: '#fff',
74
+ marginTop: 0,
75
+ }
76
+ );
77
+ }
78
+
79
+ function getPopupTextAreaStyle() {
80
+ return (
81
+ {
82
+ ...ComponentStyles.input_Text,
83
+ textAlignVertical: 'top',
84
+ width: '98%',
85
+ marginLeft: '1%',
86
+ padding: 0, height: '100%',
87
+ marginBottom: -(Dimensions.get('screen').height * 0.003),
88
+ }
89
+ );
90
+ }
91
+
92
+ return (
93
+ <View>
94
+ <TouchableOpacity onPress={() => setDropdownShow(true)}>
95
+ <Icons.MaterialCommunityIcons
96
+ name="comment-edit"
97
+ color={props.iconcolor ? props.iconcolor : 'darkblue'}
98
+ size={props.size ? normalize(props.size) : normalize(26)}
99
+
100
+ />
101
+
102
+ </TouchableOpacity>
103
+
104
+ {isdropdownshow ?
105
+ <CModalOverlay visible={true}
106
+ onClose={() => {
107
+ setDropdownShow(false);
108
+ if (props.setOverlay) {
109
+ props.setOverlay(false);
110
+ }
111
+ }}
112
+ closeOnTouchOutside
113
+ animationType="zoomIn"
114
+ containerStyle={ComponentStyles.popup_containerStyle}
115
+ childrenWrapperStyle={getOverlayChildrenWrapperStyle()}
116
+ animationDuration={500}
117
+ >
118
+ <TouchableOpacity style={{ position: 'absolute', right: 5, zIndex: 1, marginTop: normalize(5) }}
119
+ onPress={() => {
120
+ setDropdownShow(false);
121
+ if (props.setOverlay) {
122
+ props.setOverlay(false);
123
+ }
124
+ }}
125
+ >
126
+ <Icons.AntDesign name={'closecircle'}
127
+ color={'#094485'} size={normalize(20)} />
128
+ </TouchableOpacity>
129
+ <View >
130
+ <Text style={[ComponentStyles.popup_heading]}>Text Area </Text>
131
+ <View style={getPopupTextAreaContainer()}>
132
+ <View style={getPopupTextAreaChildContainer('black')}>
133
+ <TextInput
134
+ editable={true} // To scroll data , Editable is checked in onChangeText props
135
+ keyboardType={'default'}
136
+ placeholder={''}
137
+ placeholderTextColor={'lightgray'}
138
+ onChangeText={onChangeText}
139
+ value={text}
140
+ numberOfLines={5}
141
+ multiline={true}
142
+ scrollEnabled
143
+ style={getPopupTextAreaStyle()}
144
+ />
145
+ </View>
146
+
147
+ <View style={popupStyles.overlay_screen_button_view}>
148
+ <TouchableOpacity
149
+ style={popupStyles.overlay_screen_small_button_style}
150
+ onPress={() => {
151
+ setDropdownShow(false, props.onChangeText(text));
152
+ if (props.setOverlay) {
153
+ props.setOverlay(false);
154
+ }
155
+ }}>
156
+ <Text style={popupStyles.overlay_screen_button_text}>OK</Text>
157
+ </TouchableOpacity>
158
+ <TouchableOpacity
159
+ style={popupStyles.overlay_screen_small_button_style}
160
+ onPress={() => onChangeText('')}
161
+ >
162
+ <Text style={popupStyles.overlay_screen_button_text}>CLEAR</Text>
163
+ </TouchableOpacity>
164
+ </View>
165
+ </View>
166
+ </View>
167
+ </CModalOverlay>
168
+ : null}
169
+ </View>
170
+ );
171
+ };
172
+
173
+ const layoutstyles = StyleSheet.create({
174
+
175
+ });
176
+
177
+ export default SOverlay;
@@ -0,0 +1,109 @@
1
+ import React, { useState } from 'react';
2
+ import { View, Text, Dimensions, ScrollView, TouchableOpacity, FlatList } from 'react-native';
3
+ import { normalize } from '../CommonStyle/componentStyle';
4
+ import STextInput from './STextInput';
5
+ import Icons from '../Common/Icons';
6
+ import { getListviewItem, getListviewItemText } from '../CommonStyle/PopupStyle';
7
+
8
+
9
+ const SOverlayTextInput = (props) => {
10
+ const [dropdown, setDropdownShow] = useState(false);
11
+ const [searchData, setSearchData] = useState('');
12
+ const [displayData, setDisplayData] = useState([
13
+ {
14
+ 'datavalue': 592,
15
+ 'displayvalue': 'volume',
16
+ 'selected': false,
17
+ },
18
+ {
19
+ 'datavalue': 595,
20
+ 'displayvalue': 'm',
21
+ 'selected': false,
22
+ },
23
+ {
24
+ 'datavalue': 596,
25
+ 'displayvalue': 'g',
26
+ 'selected': false,
27
+ },
28
+ {
29
+ 'datavalue': 599,
30
+ 'displayvalue': 'strips',
31
+ 'selected': false,
32
+ },
33
+ {
34
+ 'datavalue': 600,
35
+ 'displayvalue': 'nos',
36
+ 'selected': false,
37
+ },
38
+ ]);
39
+
40
+ // useEffect(() => {
41
+ // setDropdownShow(false)
42
+ // }, [searchData])
43
+
44
+
45
+ return (
46
+ <View style={{ paddingLeft: normalize(8), zindex: 1 }} >
47
+ <STextInput
48
+ data={{
49
+ value: searchData,
50
+ itemwidth: Dimensions.get('screen').width * 0.80,
51
+ displaytext: 'Test',
52
+ validation: 2,
53
+ }}
54
+ onFocus={() => setDropdownShow(true)}
55
+ onBlur={() => setDropdownShow(false)}
56
+ callBack={val => (val == undefined ? null : setSearchData(val))} />
57
+
58
+ {dropdown ?
59
+ <View style={{ position: 'absolute', top: 60, left: normalize(125), height: 130, width: 200, zIndex: 1, backgroundColor: '#fff', alignItems: 'center', borderRadius: normalize(5) }}>
60
+ {GetDropdown(displayData)}
61
+ </View> : null}
62
+ </View>
63
+ );
64
+
65
+ function GetDropdown(data) {
66
+ const newDropDownData = data.filter(function (item) {
67
+ const dataItem = item.displayvalue ? item.displayvalue.toUpperCase() : ''.toUpperCase();
68
+ const textData = searchData.toUpperCase();
69
+ return dataItem.indexOf(textData) > -1;
70
+ });
71
+ return (
72
+ <View style={{ flexDirection: 'row' }}>
73
+ <FlatList
74
+ data={newDropDownData}
75
+ renderItem={renderItem}
76
+ keyboardShouldPersistTaps={'handled'}
77
+ initialNumToRender={10}
78
+ maxToRenderPerBatch={20}
79
+ keyExtractor={(item, index) => 'key' + index}
80
+ />
81
+ </View>
82
+ );
83
+ }
84
+
85
+ function renderItem(data) {
86
+ return (
87
+ <TouchableOpacity
88
+ style={[getListviewItem(data.item.selected), { flexDirection: 'row', alignItems: 'center' }]}
89
+ onPress={() => getValue(data.item)}
90
+ activeOpacity={0.5}
91
+ >
92
+ <Icons.FontAwesome name="dot-circle-o" color="darkblue" size={normalize(12)}
93
+ style={{ paddingHorizontal: normalize(2), paddingLeft: normalize(4) }} />
94
+ <Text style={getListviewItemText(false)}>
95
+ {data.item.displayvalue}
96
+ </Text>
97
+ </TouchableOpacity>
98
+ );
99
+ }
100
+
101
+ function getValue(val) {
102
+ setSearchData(val.displayvalue);
103
+ setDropdownShow(false);
104
+ }
105
+ };
106
+ export default SOverlayTextInput;
107
+
108
+
109
+