@jescon-technologies/react-native-ui-kit 0.0.1 → 0.0.3
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.js +70 -0
- package/package.json +25 -3
- package/src/Alerts/AAlert.js +1 -1
- package/src/HOC/ConfirmOverlay.js +192 -0
- package/src/HOC/HAbsolute.js +56 -0
- package/src/HOC/HDiscontinue.js +105 -0
- package/src/HOC/HHeading.js +70 -0
- package/src/HOC/HMoreButton.js +88 -0
- package/src/HOC/HNatureHeading.js +402 -0
- package/src/HOC/HOCIcons.js +80 -0
- package/src/HOC/HOverlay.js +99 -0
- package/src/HOC/HOverlayCentered.js +140 -0
- package/src/HOC/HShadowButton.js +45 -0
- package/src/HOC/HShadowCountButton.js +82 -0
- package/src/HOC/OptionOverlay.js +48 -0
- package/src/Media/AudioScreen.js +347 -0
- package/src/Media/BarcodeScan.js +145 -0
- package/src/Media/CAudioPlay.js +228 -0
- package/src/Media/CCaptureImageWithoutEdit.js +330 -0
- package/src/Media/CImageGallery.js +289 -0
- package/src/Media/CImageZoom.js +82 -0
- package/src/Media/CSingleImage.js +391 -0
- package/src/Media/CSketchCanvas.js +76 -0
- package/src/Media/CVideoPlay.js +31 -0
- package/src/Media/DocumentScreen.js +367 -0
- package/src/Media/DrawingScreen.js +582 -0
- package/src/Media/ImageScreen.js +313 -0
- package/src/Media/RecordAudio.js +250 -0
- package/src/Media/RecordVideo.js +223 -0
- package/src/Media/VideoScreen.js +383 -0
- package/src/StaticComponents/SAlphabet.js +47 -0
- package/src/StaticComponents/SCheckBox.js +42 -0
- package/src/StaticComponents/SDatePicker.js +208 -0
- package/src/StaticComponents/SDatePickerLabel.js +253 -0
- package/src/StaticComponents/SDatePickerNew.js +258 -0
- package/src/StaticComponents/SDateTimePickerNew.js +381 -0
- package/src/StaticComponents/SDropDownGenerate.js +450 -0
- package/src/StaticComponents/SDropDownHoc.js +636 -0
- package/src/StaticComponents/SDropDownIcon.js +500 -0
- package/src/StaticComponents/SMenuBox.js +131 -0
- package/src/StaticComponents/SOverlay.js +177 -0
- package/src/StaticComponents/SOverlayTextInput.js +109 -0
- package/src/StaticComponents/SSearch.js +438 -0
- package/src/StaticComponents/SSearchBar.js +53 -0
- package/src/StaticComponents/SSpeedDial.js +303 -0
- package/src/StaticComponents/STextInput.js +289 -0
- package/src/StaticComponents/STextInputProps.js +36 -0
- package/src/StaticComponents/STimePicker.js +171 -0
- package/src/StaticComponents/STimingDropDownNew.js +1589 -0
- package/src/StaticComponents/STimingSwitch.js +34 -0
- package/src/layout/CContainerView.js +21 -0
- package/src/layout/CDetailView.js +81 -0
- package/src/layout/FooterBlock.js +0 -3
- package/src/layout/HeaderBlock.js +353 -0
- package/src/index.js +0 -15
- package/src/screens/ForgotPassword.js +0 -346
- package/src/screens/Login.js +0 -328
- package/src/screens/Splash.js +0 -788
- /package/src/{components → layout}/Loader.js +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { SafeAreaView, StyleSheet, Text, View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
4
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
5
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
6
|
+
import moment from 'moment';
|
|
7
|
+
import { ValueCheck, isBNUL, isNU, notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
8
|
+
import { Global } from '../Common/Global';
|
|
9
|
+
import HOCIcons from '../HOC/HOCIcons';
|
|
10
|
+
|
|
11
|
+
export default function STimePicker(props) {
|
|
12
|
+
const [timePicker, setTimePicker] = useState(false);
|
|
13
|
+
var y = moment(props.value, 'HH:mm:ss a');
|
|
14
|
+
var d = new Date(y);
|
|
15
|
+
const [time, setTime] = useState(ValueCheck(props.value) ? d : new Date(Date.now()));
|
|
16
|
+
const [timeZone, setTimeZone] = useState(props.value);
|
|
17
|
+
|
|
18
|
+
function showTimePicker() {
|
|
19
|
+
setTimePicker(true);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getPreviousTime(array, index) {
|
|
23
|
+
|
|
24
|
+
let prevcodearray = array.filter((i, k) => { return k == (index - 1) ? { ...i } : undefined; });
|
|
25
|
+
let prevcode = prevcodearray[0].consultationtime;
|
|
26
|
+
return prevcode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function getNextTime(array, index) {
|
|
30
|
+
|
|
31
|
+
let prevcodearray = array.filter((i, k) => { return k == (index + 1) ? { ...i } : undefined; });
|
|
32
|
+
let prevcode = prevcodearray[0].consultationtime;
|
|
33
|
+
return prevcode;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function onTimeSelected(event, value) {
|
|
37
|
+
|
|
38
|
+
setTimePicker(false);
|
|
39
|
+
if (event && event.type == 'set') {
|
|
40
|
+
|
|
41
|
+
if (props.checkTimeValidation) {
|
|
42
|
+
let findprevtime = ((props.currentindextime == 0) || (props.timearray.length == 1)) ? props.starttime : getPreviousTime(props.timearray, props.currentindextime);
|
|
43
|
+
let findnexttime = ((props.currentindextime == 0) || (props.timearray.length == 1) || (props.timearray.length == (props.currentindextime + 1))) ? props.endtime : getNextTime(props.timearray, props.currentindextime);
|
|
44
|
+
|
|
45
|
+
let previous = moment(findprevtime, 'hh:mm A');
|
|
46
|
+
let next = moment(findnexttime, 'hh:mm A');
|
|
47
|
+
let current = moment(value, 'hh:mm A');
|
|
48
|
+
|
|
49
|
+
if (current.isAfter(previous) && current.isBefore(next)) {
|
|
50
|
+
var x = moment(value).format('LT');
|
|
51
|
+
setTimeZone(x);
|
|
52
|
+
setTime(value);
|
|
53
|
+
props.callBack(x);
|
|
54
|
+
} else {
|
|
55
|
+
notifyMessage('Selected time is not in the desired range',3);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
var x = moment(value).format('LT');
|
|
60
|
+
setTimeZone(x);
|
|
61
|
+
setTime(value);
|
|
62
|
+
props.callBack(x);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<SafeAreaView style={{ flex: 1 }}>
|
|
70
|
+
<View style={{ flex: 1 }}>
|
|
71
|
+
{timePicker ?
|
|
72
|
+
<DateTimePicker
|
|
73
|
+
value={time != undefined ? time : new Date(Date.now())}
|
|
74
|
+
mode={'time'}
|
|
75
|
+
display={Platform.OS === 'ios' ? 'default' : 'default'}
|
|
76
|
+
is24Hour={false}
|
|
77
|
+
onChange={onTimeSelected}
|
|
78
|
+
style={styleSheet.datePicker}
|
|
79
|
+
/>
|
|
80
|
+
: null
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
{!timePicker ?
|
|
84
|
+
<View style={{}}>
|
|
85
|
+
{props.table != undefined ? null
|
|
86
|
+
: <Text style={{ fontSize: normalize(9), paddingLeft: normalize(2) }}>{ValueCheck(props.placeholder) ? props.placeholder : 'Select Time:'}</Text>}
|
|
87
|
+
|
|
88
|
+
<TouchableOpacity
|
|
89
|
+
disabled={props.disabled ? true : false}
|
|
90
|
+
onPress={() => showTimePicker()}
|
|
91
|
+
style={
|
|
92
|
+
isNU(props.pickerstyle) ? props.pickerstyle :
|
|
93
|
+
{
|
|
94
|
+
flexDirection: 'row',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
width: props.width != undefined ? normalize(props.width) : normalize(300),
|
|
97
|
+
height: props.height != undefined ? normalize(props.height) : normalize(35),
|
|
98
|
+
borderWidth: 1,
|
|
99
|
+
borderColor: 'lightgrey',
|
|
100
|
+
backgroundColor: ValueCheck(props.bgcolor) ? props.bgcolor : '#fff',
|
|
101
|
+
borderRadius: normalize(7),
|
|
102
|
+
}
|
|
103
|
+
}>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
{props.icon ?
|
|
108
|
+
<HOCIcons.Icons
|
|
109
|
+
icongroup={isNU(props.icon.icongroup) ? props.icon.icongroup : 5}
|
|
110
|
+
name={props.icon.name}
|
|
111
|
+
size={props.icon.size}
|
|
112
|
+
style={props.iconstyle}
|
|
113
|
+
/>
|
|
114
|
+
: <MaterialCommunityIcons
|
|
115
|
+
name="timer-outline"
|
|
116
|
+
color={Global.AppTheme.primary_color}
|
|
117
|
+
size={normalize(20)}
|
|
118
|
+
style={{ paddingHorizontal: normalize(7) }}
|
|
119
|
+
/>}
|
|
120
|
+
|
|
121
|
+
{isNU(props.textstyle) ?
|
|
122
|
+
<Text adjustsFontSizeToFit style={props.textstyle}>
|
|
123
|
+
{isNU(timeZone) ? timeZone : null}
|
|
124
|
+
</Text>
|
|
125
|
+
: null}
|
|
126
|
+
|
|
127
|
+
{!isNU(props.textstyle) ?
|
|
128
|
+
<View>
|
|
129
|
+
<Text style={{ fontSize: normalize(14), color: 'black', fontWeight: 'bold' }}>
|
|
130
|
+
{timeZone}
|
|
131
|
+
</Text>
|
|
132
|
+
</View>
|
|
133
|
+
: null}
|
|
134
|
+
{/* <Button title="Show Time Picker" color="green" onPress={showTimePicker} /> */}
|
|
135
|
+
</TouchableOpacity>
|
|
136
|
+
</View>
|
|
137
|
+
: null
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
</View>
|
|
141
|
+
</SafeAreaView>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const styleSheet = StyleSheet.create({
|
|
146
|
+
|
|
147
|
+
MainContainer: {
|
|
148
|
+
flex: 1,
|
|
149
|
+
// padding: 6,
|
|
150
|
+
// alignItems: 'center',
|
|
151
|
+
backgroundColor: 'white',
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
text: {
|
|
155
|
+
fontSize: 25,
|
|
156
|
+
color: 'red',
|
|
157
|
+
padding: 3,
|
|
158
|
+
marginBottom: 10,
|
|
159
|
+
textAlign: 'center',
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
// Style for iOS ONLY...
|
|
163
|
+
datePicker: {
|
|
164
|
+
justifyContent: 'center',
|
|
165
|
+
alignItems: 'flex-start',
|
|
166
|
+
width: 320,
|
|
167
|
+
height: 260,
|
|
168
|
+
display: 'flex',
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
});
|