secullum-react-native-ui 4.16.2-beta.7 → 4.16.2-beta.8
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/package.json +1 -1
- package/lib/components/AppShell.d.ts +0 -52
- package/lib/components/AppShell.js +0 -82
- package/lib/components/Button.d.ts +0 -49
- package/lib/components/Button.js +0 -70
- package/lib/components/Card.d.ts +0 -66
- package/lib/components/Card.js +0 -131
- package/lib/components/CheckBox.d.ts +0 -36
- package/lib/components/CheckBox.js +0 -50
- package/lib/components/DatePicker.d.ts +0 -67
- package/lib/components/DatePicker.js +0 -106
- package/lib/components/DatePicker.web.d.ts +0 -64
- package/lib/components/DatePicker.web.js +0 -106
- package/lib/components/Delay.d.ts +0 -12
- package/lib/components/Delay.js +0 -22
- package/lib/components/Details.d.ts +0 -67
- package/lib/components/Details.js +0 -96
- package/lib/components/DetailsHeader.d.ts +0 -41
- package/lib/components/DetailsHeader.js +0 -65
- package/lib/components/DimensionsMonitor.d.ts +0 -21
- package/lib/components/DimensionsMonitor.js +0 -37
- package/lib/components/DropDown.d.ts +0 -52
- package/lib/components/DropDown.js +0 -351
- package/lib/components/ErrorMessage.d.ts +0 -16
- package/lib/components/ErrorMessage.js +0 -31
- package/lib/components/FilePicker.d.ts +0 -29
- package/lib/components/FilePicker.js +0 -46
- package/lib/components/Header.d.ts +0 -58
- package/lib/components/Header.js +0 -94
- package/lib/components/HeaderDesktop.d.ts +0 -59
- package/lib/components/HeaderDesktop.js +0 -83
- package/lib/components/ImageButton.d.ts +0 -14
- package/lib/components/ImageButton.js +0 -34
- package/lib/components/KeyboardAvoidingView.d.ts +0 -34
- package/lib/components/KeyboardAvoidingView.js +0 -106
- package/lib/components/Link.d.ts +0 -18
- package/lib/components/Link.js +0 -30
- package/lib/components/Loading.d.ts +0 -13
- package/lib/components/Loading.js +0 -45
- package/lib/components/Menu.d.ts +0 -42
- package/lib/components/Menu.js +0 -114
- package/lib/components/MenuDesktop.d.ts +0 -24
- package/lib/components/MenuDesktop.js +0 -39
- package/lib/components/MenuMobile.d.ts +0 -49
- package/lib/components/MenuMobile.js +0 -94
- package/lib/components/Message.d.ts +0 -37
- package/lib/components/Message.js +0 -52
- package/lib/components/Modal.d.ts +0 -18
- package/lib/components/Modal.js +0 -35
- package/lib/components/MultiSelect.d.ts +0 -51
- package/lib/components/MultiSelect.js +0 -377
- package/lib/components/NoRecordMessage.d.ts +0 -23
- package/lib/components/NoRecordMessage.js +0 -36
- package/lib/components/Question.d.ts +0 -57
- package/lib/components/Question.js +0 -79
- package/lib/components/RadioButton.d.ts +0 -43
- package/lib/components/RadioButton.js +0 -55
- package/lib/components/RadioGroup.d.ts +0 -45
- package/lib/components/RadioGroup.js +0 -71
- package/lib/components/RangeDatePicker.d.ts +0 -57
- package/lib/components/RangeDatePicker.js +0 -127
- package/lib/components/RangeDatePicker.web.d.ts +0 -61
- package/lib/components/RangeDatePicker.web.js +0 -120
- package/lib/components/Space.d.ts +0 -11
- package/lib/components/Space.js +0 -15
- package/lib/components/StatusBar.d.ts +0 -18
- package/lib/components/StatusBar.js +0 -33
- package/lib/components/Switch.d.ts +0 -34
- package/lib/components/Switch.js +0 -50
- package/lib/components/Table.d.ts +0 -30
- package/lib/components/Table.js +0 -79
- package/lib/components/Table.web.d.ts +0 -18
- package/lib/components/Table.web.js +0 -111
- package/lib/components/Text.d.ts +0 -29
- package/lib/components/Text.js +0 -38
- package/lib/components/TextBox.d.ts +0 -84
- package/lib/components/TextBox.js +0 -126
- package/lib/components/TextBoxMask.d.ts +0 -12
- package/lib/components/TextBoxMask.js +0 -34
- package/lib/components/TimePicker.d.ts +0 -63
- package/lib/components/TimePicker.js +0 -112
- package/lib/components/TimePicker.web.d.ts +0 -48
- package/lib/components/TimePicker.web.js +0 -88
- package/lib/index.d.ts +0 -40
- package/lib/index.js +0 -56
- package/lib/modules/browser.d.ts +0 -2
- package/lib/modules/browser.js +0 -51
- package/lib/modules/format.d.ts +0 -6
- package/lib/modules/format.js +0 -127
- package/lib/modules/layout.d.ts +0 -1
- package/lib/modules/layout.js +0 -12
- package/lib/modules/test.d.ts +0 -2
- package/lib/modules/test.js +0 -18
- package/lib/modules/theme.d.ts +0 -41
- package/lib/modules/theme.js +0 -52
- package/lib/modules/validation.d.ts +0 -3
- package/lib/modules/validation.js +0 -16
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IconProps } from 'react-native-vector-icons/Icon';
|
|
3
|
-
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
4
|
-
declare type DropDownItemData = {
|
|
5
|
-
label: string;
|
|
6
|
-
value: any;
|
|
7
|
-
icon?: string;
|
|
8
|
-
nativeID?: string;
|
|
9
|
-
};
|
|
10
|
-
export interface DropDownProperties {
|
|
11
|
-
label?: string;
|
|
12
|
-
items: DropDownItemData[];
|
|
13
|
-
value: any | null;
|
|
14
|
-
onChange: (value: any) => void;
|
|
15
|
-
onPress?: () => void | boolean | Promise<void> | Promise<boolean>;
|
|
16
|
-
emptyMessage: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
style?: StyleProp<ViewStyle>;
|
|
19
|
-
disabledStyle?: StyleProp<ViewStyle>;
|
|
20
|
-
labelStyle?: StyleProp<TextStyle>;
|
|
21
|
-
inputStyle?: StyleProp<TextStyle>;
|
|
22
|
-
iconComponent?: React.ComponentClass<IconProps>;
|
|
23
|
-
nativeID?: string;
|
|
24
|
-
icon?: string | undefined;
|
|
25
|
-
arrowColor?: string | undefined;
|
|
26
|
-
searchable?: SearchableProps;
|
|
27
|
-
virtualized?: true | VirtualizedProps | null;
|
|
28
|
-
}
|
|
29
|
-
export interface SearchableProps {
|
|
30
|
-
placeHolder: string;
|
|
31
|
-
minItemsToSearch?: number;
|
|
32
|
-
}
|
|
33
|
-
export interface VirtualizedProps {
|
|
34
|
-
initialNumToRender?: number;
|
|
35
|
-
maxToRenderPerBatch?: number;
|
|
36
|
-
windowSize?: number;
|
|
37
|
-
}
|
|
38
|
-
export interface DropDownState {
|
|
39
|
-
modalOpen: boolean;
|
|
40
|
-
searchText: string;
|
|
41
|
-
}
|
|
42
|
-
export declare class DropDown extends React.Component<DropDownProperties, DropDownState> {
|
|
43
|
-
state: DropDownState;
|
|
44
|
-
handleItemPress: (value: any) => void;
|
|
45
|
-
filterItems: () => DropDownItemData[];
|
|
46
|
-
shouldDisplaySearchField: () => boolean | undefined;
|
|
47
|
-
renderClosedDropDown: (item: any, inputStyle: any) => JSX.Element | null;
|
|
48
|
-
getStyles: () => any;
|
|
49
|
-
renderItemsList: (filteredItems: DropDownItemData[]) => JSX.Element;
|
|
50
|
-
render(): JSX.Element;
|
|
51
|
-
}
|
|
52
|
-
export {};
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DropDown = void 0;
|
|
13
|
-
const React = require("react");
|
|
14
|
-
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
15
|
-
const Modal_1 = require("./Modal");
|
|
16
|
-
const layout_1 = require("../modules/layout");
|
|
17
|
-
const theme_1 = require("../modules/theme");
|
|
18
|
-
const test_1 = require("../modules/test");
|
|
19
|
-
const react_native_1 = require("react-native");
|
|
20
|
-
class DropDownItem extends React.PureComponent {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.getStyles = () => {
|
|
24
|
-
const theme = (0, theme_1.getTheme)();
|
|
25
|
-
const styles = react_native_1.StyleSheet.create({
|
|
26
|
-
modalItem: {
|
|
27
|
-
paddingHorizontal: 16,
|
|
28
|
-
paddingVertical: 16,
|
|
29
|
-
fontFamily: theme.fontFamily1,
|
|
30
|
-
fontSize: 16,
|
|
31
|
-
color: theme.dropDownTextColor
|
|
32
|
-
},
|
|
33
|
-
icon: {
|
|
34
|
-
fontSize: 26
|
|
35
|
-
},
|
|
36
|
-
rowView: {
|
|
37
|
-
flexDirection: 'row'
|
|
38
|
-
},
|
|
39
|
-
iconView: {
|
|
40
|
-
width: 100,
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
justifyContent: 'center'
|
|
43
|
-
},
|
|
44
|
-
iconOnlyView: {
|
|
45
|
-
width: 200,
|
|
46
|
-
alignItems: 'center',
|
|
47
|
-
justifyContent: 'center'
|
|
48
|
-
},
|
|
49
|
-
iconOnly: {
|
|
50
|
-
paddingHorizontal: 16,
|
|
51
|
-
paddingVertical: 16,
|
|
52
|
-
fontSize: 60
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return styles;
|
|
56
|
-
};
|
|
57
|
-
this.renderOpenDropDownItem = () => {
|
|
58
|
-
const { label, icon, iconComponent, nativeID } = this.props;
|
|
59
|
-
const theme = (0, theme_1.getTheme)();
|
|
60
|
-
const styles = this.getStyles();
|
|
61
|
-
if (label && icon) {
|
|
62
|
-
return (React.createElement(react_native_1.View, { nativeID: nativeID, style: styles.rowView },
|
|
63
|
-
React.createElement(react_native_1.View, { style: styles.iconView }, iconComponent ? (React.createElement(iconComponent, {
|
|
64
|
-
name: icon,
|
|
65
|
-
style: styles.icon,
|
|
66
|
-
color: theme.textColor1
|
|
67
|
-
})) : (React.createElement(FontAwesome_1.default, { name: icon, color: theme.textColor1, style: styles.icon }))),
|
|
68
|
-
React.createElement(react_native_1.View, null,
|
|
69
|
-
React.createElement(react_native_1.Text, { style: styles.modalItem }, label))));
|
|
70
|
-
}
|
|
71
|
-
else if (label && !icon) {
|
|
72
|
-
return (React.createElement(react_native_1.View, { nativeID: nativeID, style: styles.rowView },
|
|
73
|
-
React.createElement(react_native_1.Text, { style: styles.modalItem }, label)));
|
|
74
|
-
}
|
|
75
|
-
else if (!label && icon) {
|
|
76
|
-
return (React.createElement(react_native_1.View, { nativeID: nativeID, style: styles.iconOnlyView }, iconComponent ? (React.createElement(iconComponent, {
|
|
77
|
-
name: icon,
|
|
78
|
-
style: styles.iconOnly,
|
|
79
|
-
color: theme.textColor1
|
|
80
|
-
})) : (React.createElement(FontAwesome_1.default, { name: icon, color: theme.textColor1, style: styles.iconOnly }))));
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
render() {
|
|
86
|
-
const { first, last, value, onPress, nativeID } = this.props;
|
|
87
|
-
const theme = (0, theme_1.getTheme)();
|
|
88
|
-
return (React.createElement(react_native_1.TouchableHighlight, { onPress: () => onPress(value), testID: (0, test_1.getTestID)(nativeID), underlayColor: theme.backgroundColor2, style: {
|
|
89
|
-
borderTopLeftRadius: first ? 5 : 0,
|
|
90
|
-
borderTopRightRadius: first ? 5 : 0,
|
|
91
|
-
borderBottomLeftRadius: last ? 5 : 0,
|
|
92
|
-
borderBottomRightRadius: last ? 5 : 0
|
|
93
|
-
} }, this.renderOpenDropDownItem()));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const DEFAULT_VIRTUALIZED = {
|
|
97
|
-
initialNumToRender: 20,
|
|
98
|
-
maxToRenderPerBatch: 30,
|
|
99
|
-
windowSize: 10
|
|
100
|
-
};
|
|
101
|
-
class DropDown extends React.Component {
|
|
102
|
-
constructor() {
|
|
103
|
-
super(...arguments);
|
|
104
|
-
this.state = {
|
|
105
|
-
modalOpen: false,
|
|
106
|
-
searchText: ''
|
|
107
|
-
};
|
|
108
|
-
this.handleItemPress = (value) => {
|
|
109
|
-
const { onChange } = this.props;
|
|
110
|
-
this.setState({ modalOpen: false });
|
|
111
|
-
onChange(value);
|
|
112
|
-
};
|
|
113
|
-
this.filterItems = () => {
|
|
114
|
-
const { items } = this.props;
|
|
115
|
-
const { searchText } = this.state;
|
|
116
|
-
return items.filter(item => item.label.toLowerCase().includes(searchText.toLowerCase()));
|
|
117
|
-
};
|
|
118
|
-
this.shouldDisplaySearchField = () => {
|
|
119
|
-
const { items, searchable } = this.props;
|
|
120
|
-
const defaultQuantityToSearch = 10;
|
|
121
|
-
return (searchable &&
|
|
122
|
-
items.length >= (searchable.minItemsToSearch || defaultQuantityToSearch));
|
|
123
|
-
};
|
|
124
|
-
this.renderClosedDropDown = (item, inputStyle) => {
|
|
125
|
-
const { iconComponent } = this.props;
|
|
126
|
-
const theme = (0, theme_1.getTheme)();
|
|
127
|
-
const styles = this.getStyles();
|
|
128
|
-
if (!item) {
|
|
129
|
-
return (React.createElement(React.Fragment, null,
|
|
130
|
-
React.createElement(react_native_1.Text, { style: [styles.text, inputStyle] }, "-"),
|
|
131
|
-
React.createElement(FontAwesome_1.default, { name: "caret-down", style: styles.seta })));
|
|
132
|
-
}
|
|
133
|
-
else if (item.label && item.icon) {
|
|
134
|
-
return (React.createElement(React.Fragment, null,
|
|
135
|
-
React.createElement(react_native_1.View, { style: styles.rowView },
|
|
136
|
-
React.createElement(react_native_1.View, { style: styles.iconView }, iconComponent ? (React.createElement(iconComponent, {
|
|
137
|
-
name: item.icon,
|
|
138
|
-
style: styles.icon,
|
|
139
|
-
color: theme.textColor1
|
|
140
|
-
})) : (React.createElement(FontAwesome_1.default, { name: item.icon, color: theme.textColor1, style: styles.icon }))),
|
|
141
|
-
React.createElement(react_native_1.Text, { style: [styles.textIcon, inputStyle] }, item.label)),
|
|
142
|
-
React.createElement(FontAwesome_1.default, { name: "caret-down", style: styles.seta })));
|
|
143
|
-
}
|
|
144
|
-
else if (item.label && !item.icon) {
|
|
145
|
-
return (React.createElement(React.Fragment, null,
|
|
146
|
-
React.createElement(react_native_1.Text, { style: [styles.text, inputStyle] }, item.label),
|
|
147
|
-
React.createElement(FontAwesome_1.default, { name: "caret-down", style: styles.seta })));
|
|
148
|
-
}
|
|
149
|
-
else if (!item.label && item.icon) {
|
|
150
|
-
return (React.createElement(React.Fragment, null,
|
|
151
|
-
iconComponent ? (React.createElement(iconComponent, {
|
|
152
|
-
name: item.icon,
|
|
153
|
-
style: styles.iconOnly,
|
|
154
|
-
color: theme.textColor1
|
|
155
|
-
})) : (React.createElement(FontAwesome_1.default, { name: item.icon, color: theme.textColor1, style: styles.iconOnly })),
|
|
156
|
-
React.createElement(FontAwesome_1.default, { name: "caret-down", style: styles.setaIcone })));
|
|
157
|
-
}
|
|
158
|
-
return null;
|
|
159
|
-
};
|
|
160
|
-
this.getStyles = () => {
|
|
161
|
-
const theme = (0, theme_1.getTheme)();
|
|
162
|
-
const { icon, arrowColor } = this.props;
|
|
163
|
-
const styles = react_native_1.StyleSheet.create({
|
|
164
|
-
container: Object.assign({ paddingHorizontal: 16, paddingVertical: 8, borderWidth: 1, borderColor: theme.borderColor1, borderRadius: 3 }, (icon
|
|
165
|
-
? {
|
|
166
|
-
flexDirection: 'row',
|
|
167
|
-
minHeight: react_native_1.Platform.OS === 'web' || react_native_1.Platform.OS === 'ios' ? 40 : 46
|
|
168
|
-
}
|
|
169
|
-
: {})),
|
|
170
|
-
label: {
|
|
171
|
-
color: theme.textColor2,
|
|
172
|
-
fontFamily: theme.fontFamily3,
|
|
173
|
-
fontSize: (0, layout_1.isTablet)() ? 15 : 12,
|
|
174
|
-
lineHeight: 16
|
|
175
|
-
},
|
|
176
|
-
text: {
|
|
177
|
-
lineHeight: (0, layout_1.isTablet)() ? 28 : 22,
|
|
178
|
-
minHeight: (0, layout_1.isTablet)() ? 28 : 22,
|
|
179
|
-
textAlignVertical: 'center',
|
|
180
|
-
color: theme.textColor1,
|
|
181
|
-
fontFamily: theme.fontFamily1,
|
|
182
|
-
fontSize: 16
|
|
183
|
-
},
|
|
184
|
-
textIcon: {
|
|
185
|
-
height: 27,
|
|
186
|
-
alignSelf: 'center',
|
|
187
|
-
color: theme.textColor1,
|
|
188
|
-
fontFamily: theme.fontFamily1,
|
|
189
|
-
fontSize: 16
|
|
190
|
-
},
|
|
191
|
-
seta: {
|
|
192
|
-
color: arrowColor ? arrowColor : theme.textColor1,
|
|
193
|
-
fontSize: 16,
|
|
194
|
-
position: 'absolute',
|
|
195
|
-
bottom: 10,
|
|
196
|
-
right: 16
|
|
197
|
-
},
|
|
198
|
-
setaIcone: {
|
|
199
|
-
color: arrowColor ? arrowColor : theme.textColor1,
|
|
200
|
-
fontSize: 16,
|
|
201
|
-
position: 'absolute',
|
|
202
|
-
bottom: 25,
|
|
203
|
-
right: 16
|
|
204
|
-
},
|
|
205
|
-
modalOverlay: {
|
|
206
|
-
justifyContent: this.shouldDisplaySearchField()
|
|
207
|
-
? 'flex-start'
|
|
208
|
-
: 'center',
|
|
209
|
-
paddingTop: this.shouldDisplaySearchField() && react_native_1.Platform.OS === 'ios' ? 44 : 0
|
|
210
|
-
},
|
|
211
|
-
modalContainer: {
|
|
212
|
-
maxHeight: '95%',
|
|
213
|
-
borderRadius: 5,
|
|
214
|
-
backgroundColor: theme.backgroundColor1,
|
|
215
|
-
margin: 16
|
|
216
|
-
},
|
|
217
|
-
modalItem: {
|
|
218
|
-
paddingHorizontal: 16,
|
|
219
|
-
paddingVertical: 16,
|
|
220
|
-
fontFamily: theme.fontFamily1,
|
|
221
|
-
fontSize: 16
|
|
222
|
-
},
|
|
223
|
-
emptyMessageContainer: {
|
|
224
|
-
flexDirection: 'row',
|
|
225
|
-
alignItems: 'center',
|
|
226
|
-
paddingHorizontal: 16
|
|
227
|
-
},
|
|
228
|
-
readonly: {
|
|
229
|
-
backgroundColor: theme.disabledColor
|
|
230
|
-
},
|
|
231
|
-
icon: {
|
|
232
|
-
fontSize: 26
|
|
233
|
-
},
|
|
234
|
-
rowView: {
|
|
235
|
-
flexDirection: 'row'
|
|
236
|
-
},
|
|
237
|
-
iconView: {
|
|
238
|
-
width: 50,
|
|
239
|
-
alignItems: 'center'
|
|
240
|
-
},
|
|
241
|
-
iconOnlyView: {
|
|
242
|
-
width: 200,
|
|
243
|
-
alignItems: 'center',
|
|
244
|
-
justifyContent: 'center'
|
|
245
|
-
},
|
|
246
|
-
iconOnly: {
|
|
247
|
-
paddingHorizontal: 16,
|
|
248
|
-
paddingVertical: 8,
|
|
249
|
-
fontSize: 26
|
|
250
|
-
},
|
|
251
|
-
iconOnLine: {
|
|
252
|
-
color: theme.textColor2,
|
|
253
|
-
fontSize: (0, layout_1.isTablet)() ? 21 : 19,
|
|
254
|
-
marginRight: 10,
|
|
255
|
-
minWidth: 25,
|
|
256
|
-
textAlignVertical: 'center',
|
|
257
|
-
flex: 0
|
|
258
|
-
},
|
|
259
|
-
searchContainer: {
|
|
260
|
-
flexDirection: 'row',
|
|
261
|
-
alignItems: 'center',
|
|
262
|
-
justifyContent: 'space-between',
|
|
263
|
-
marginBottom: 10,
|
|
264
|
-
marginTop: 8,
|
|
265
|
-
marginRight: 16
|
|
266
|
-
},
|
|
267
|
-
searchLabel: {
|
|
268
|
-
fontSize: 16,
|
|
269
|
-
marginLeft: 16,
|
|
270
|
-
fontFamily: theme.fontFamily1
|
|
271
|
-
},
|
|
272
|
-
inputWrapper: {
|
|
273
|
-
flexDirection: 'row',
|
|
274
|
-
alignItems: 'center',
|
|
275
|
-
borderWidth: 1,
|
|
276
|
-
borderColor: '#ccc',
|
|
277
|
-
paddingHorizontal: 10,
|
|
278
|
-
backgroundColor: 'white',
|
|
279
|
-
flex: 1,
|
|
280
|
-
maxWidth: '100%',
|
|
281
|
-
minWidth: 150,
|
|
282
|
-
overflow: 'hidden',
|
|
283
|
-
marginLeft: 16
|
|
284
|
-
},
|
|
285
|
-
searchInput: {
|
|
286
|
-
flex: 1,
|
|
287
|
-
height: 40
|
|
288
|
-
},
|
|
289
|
-
searchIcon: {
|
|
290
|
-
marginLeft: 10
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
return styles;
|
|
294
|
-
};
|
|
295
|
-
this.renderItemsList = (filteredItems) => {
|
|
296
|
-
const { iconComponent, virtualized } = this.props;
|
|
297
|
-
const renderItem = ({ item, index }) => (React.createElement(DropDownItem, { nativeID: item.nativeID, first: index === 0, last: index === filteredItems.length - 1, label: item.label, value: item.value, onPress: this.handleItemPress, icon: item.icon, iconComponent: iconComponent }));
|
|
298
|
-
if (virtualized == null) {
|
|
299
|
-
return (React.createElement(react_native_1.FlatList, { data: filteredItems, initialNumToRender: filteredItems.length, keyExtractor: item => item.value.toString(), renderItem: renderItem }));
|
|
300
|
-
}
|
|
301
|
-
const virtualizedProps = virtualized === true
|
|
302
|
-
? Object.assign({}, DEFAULT_VIRTUALIZED) : Object.assign(Object.assign({}, DEFAULT_VIRTUALIZED), virtualized);
|
|
303
|
-
return (React.createElement(react_native_1.VirtualizedList, { getItem: (_, index) => filteredItems[index], getItemCount: () => filteredItems.length, keyExtractor: item => item.value.toString(), renderItem: renderItem, initialNumToRender: virtualizedProps.initialNumToRender, maxToRenderPerBatch: virtualizedProps.maxToRenderPerBatch, windowSize: virtualizedProps.windowSize }));
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
render() {
|
|
307
|
-
const { modalOpen, searchText } = this.state;
|
|
308
|
-
const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, nativeID, onPress, icon, searchable } = this.props;
|
|
309
|
-
const selectedItem = items.find(x => x.value === value);
|
|
310
|
-
const styles = this.getStyles();
|
|
311
|
-
const theme = (0, theme_1.getTheme)();
|
|
312
|
-
const filteredItems = searchable ? this.filterItems() : items;
|
|
313
|
-
return (React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: () => __awaiter(this, void 0, void 0, function* () {
|
|
314
|
-
if (onPress) {
|
|
315
|
-
const result = yield onPress();
|
|
316
|
-
if (result === false) {
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
this.setState({ modalOpen: true, searchText: '' });
|
|
321
|
-
}), disabled: disabled },
|
|
322
|
-
React.createElement(react_native_1.View, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: [
|
|
323
|
-
styles.container,
|
|
324
|
-
style,
|
|
325
|
-
disabled ? [styles.readonly, disabledStyle] : null
|
|
326
|
-
] },
|
|
327
|
-
icon ? (React.createElement(FontAwesome_1.default, { name: icon, style: styles.iconOnLine })) : (React.createElement(react_native_1.Text, { style: [styles.label, labelStyle] }, label)),
|
|
328
|
-
this.renderClosedDropDown(selectedItem, inputStyle),
|
|
329
|
-
React.createElement(Modal_1.Modal, { visible: modalOpen, onRequestClose: () => this.setState({ modalOpen: false }), overlayStyle: styles.modalOverlay },
|
|
330
|
-
React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: react_native_1.Keyboard.dismiss },
|
|
331
|
-
React.createElement(react_native_1.View, { style: [
|
|
332
|
-
styles.modalContainer,
|
|
333
|
-
react_native_1.Platform.OS === 'web' && {
|
|
334
|
-
marginVertical: '10px',
|
|
335
|
-
marginHorizontal: 'auto',
|
|
336
|
-
width: '90%',
|
|
337
|
-
maxWidth: 450,
|
|
338
|
-
maxHeight: 300,
|
|
339
|
-
justifyContent: 'center'
|
|
340
|
-
}
|
|
341
|
-
] },
|
|
342
|
-
this.shouldDisplaySearchField() && (React.createElement(react_native_1.View, { style: styles.searchContainer },
|
|
343
|
-
React.createElement(react_native_1.View, { style: styles.inputWrapper },
|
|
344
|
-
React.createElement(react_native_1.TextInput, { nativeID: nativeID + '-text-search', style: styles.searchInput, value: searchText, placeholder: searchable && searchable.placeHolder, onChangeText: text => this.setState({ searchText: text }) }),
|
|
345
|
-
React.createElement(FontAwesome_1.default, { name: "search", size: 16, color: "gray", style: styles.searchIcon })))),
|
|
346
|
-
filteredItems.length > 0 ? (this.renderItemsList(filteredItems)) : (React.createElement(react_native_1.View, { style: styles.emptyMessageContainer },
|
|
347
|
-
React.createElement(FontAwesome_1.default, { name: "warning", color: theme.warningColor, size: 24 }),
|
|
348
|
-
React.createElement(react_native_1.Text, { style: styles.modalItem }, emptyMessage)))))))));
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
exports.DropDown = DropDown;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { StyleProp, TextStyle } from 'react-native';
|
|
3
|
-
export interface Props {
|
|
4
|
-
message?: string | null;
|
|
5
|
-
style?: StyleProp<TextStyle>;
|
|
6
|
-
nativeID?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class ErrorMessage extends React.Component<Props> {
|
|
9
|
-
getStyles: () => {
|
|
10
|
-
errorMessage: {
|
|
11
|
-
fontFamily: string;
|
|
12
|
-
color: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
render(): JSX.Element | null;
|
|
16
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorMessage = void 0;
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const react_native_1 = require("react-native");
|
|
6
|
-
const theme_1 = require("../modules/theme");
|
|
7
|
-
const test_1 = require("../modules/test");
|
|
8
|
-
class ErrorMessage extends React.Component {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.getStyles = () => {
|
|
12
|
-
const theme = (0, theme_1.getTheme)();
|
|
13
|
-
const styles = react_native_1.StyleSheet.create({
|
|
14
|
-
errorMessage: {
|
|
15
|
-
fontFamily: theme.fontFamily3,
|
|
16
|
-
color: theme.errorColor
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return styles;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
const { message, style, nativeID } = this.props;
|
|
24
|
-
const styles = this.getStyles();
|
|
25
|
-
if (!message) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return (React.createElement(react_native_1.Text, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: [styles.errorMessage, style] }, message));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.ErrorMessage = ErrorMessage;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface FilePickerProperties {
|
|
3
|
-
label: string;
|
|
4
|
-
onPress: () => void;
|
|
5
|
-
icon: string;
|
|
6
|
-
nativeID?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class FilePicker extends React.Component<FilePickerProperties> {
|
|
9
|
-
static defaultProps: {
|
|
10
|
-
icon: string;
|
|
11
|
-
};
|
|
12
|
-
getStyles: () => {
|
|
13
|
-
container: {
|
|
14
|
-
borderRadius: number;
|
|
15
|
-
backgroundColor: string;
|
|
16
|
-
height: number;
|
|
17
|
-
alignItems: "center";
|
|
18
|
-
justifyContent: "center";
|
|
19
|
-
};
|
|
20
|
-
text: {
|
|
21
|
-
fontFamily: string;
|
|
22
|
-
fontSize: number;
|
|
23
|
-
color: string;
|
|
24
|
-
width: number;
|
|
25
|
-
textAlign: "center";
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
render(): JSX.Element;
|
|
29
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FilePicker = void 0;
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const react_native_1 = require("react-native");
|
|
6
|
-
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
7
|
-
const theme_1 = require("../modules/theme");
|
|
8
|
-
const layout_1 = require("../modules/layout");
|
|
9
|
-
const test_1 = require("../modules/test");
|
|
10
|
-
class FilePicker extends React.Component {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.getStyles = () => {
|
|
14
|
-
const theme = (0, theme_1.getTheme)();
|
|
15
|
-
const styles = react_native_1.StyleSheet.create({
|
|
16
|
-
container: {
|
|
17
|
-
borderRadius: 3,
|
|
18
|
-
backgroundColor: theme.backgroundColor2,
|
|
19
|
-
height: 100,
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
justifyContent: 'center'
|
|
22
|
-
},
|
|
23
|
-
text: {
|
|
24
|
-
fontFamily: theme.fontFamily1,
|
|
25
|
-
fontSize: (0, layout_1.isTablet)() ? 15 : 12,
|
|
26
|
-
color: theme.textColor3,
|
|
27
|
-
width: 200,
|
|
28
|
-
textAlign: 'center'
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return styles;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
const { label, onPress, icon, nativeID } = this.props;
|
|
36
|
-
const theme = (0, theme_1.getTheme)();
|
|
37
|
-
const styles = this.getStyles();
|
|
38
|
-
return (React.createElement(react_native_1.TouchableOpacity, { activeOpacity: 0.5, style: styles.container, onPress: onPress },
|
|
39
|
-
React.createElement(FontAwesome_1.default, { name: icon, color: theme.textColor3, size: 30 }),
|
|
40
|
-
React.createElement(react_native_1.Text, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: styles.text }, label)));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.FilePicker = FilePicker;
|
|
44
|
-
FilePicker.defaultProps = {
|
|
45
|
-
icon: 'cloud-upload'
|
|
46
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { StyleProp, TextStyle } from 'react-native';
|
|
3
|
-
export interface HeaderButton {
|
|
4
|
-
icon: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
counter?: number;
|
|
7
|
-
onPress: () => void;
|
|
8
|
-
nativeID?: string;
|
|
9
|
-
buttonStyle?: StyleProp<TextStyle>;
|
|
10
|
-
}
|
|
11
|
-
export interface HeaderProperties {
|
|
12
|
-
title: string;
|
|
13
|
-
leftButton?: HeaderButton;
|
|
14
|
-
rightButton?: HeaderButton;
|
|
15
|
-
nativeID?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare class Header extends React.Component<HeaderProperties> {
|
|
18
|
-
static defaultProps: {
|
|
19
|
-
leftButtonType: string;
|
|
20
|
-
};
|
|
21
|
-
static height: number;
|
|
22
|
-
getStyles: () => {
|
|
23
|
-
header: {
|
|
24
|
-
backgroundColor: string;
|
|
25
|
-
height: number;
|
|
26
|
-
flexDirection: "row";
|
|
27
|
-
alignItems: "center";
|
|
28
|
-
justifyContent: "center";
|
|
29
|
-
};
|
|
30
|
-
title: {
|
|
31
|
-
color: string;
|
|
32
|
-
fontFamily: string;
|
|
33
|
-
fontSize: number;
|
|
34
|
-
marginHorizontal: number;
|
|
35
|
-
flexShrink: number;
|
|
36
|
-
};
|
|
37
|
-
button: {
|
|
38
|
-
padding: number;
|
|
39
|
-
};
|
|
40
|
-
counterContainer: {
|
|
41
|
-
position: "absolute";
|
|
42
|
-
backgroundColor: string;
|
|
43
|
-
height: number;
|
|
44
|
-
width: number;
|
|
45
|
-
top: number;
|
|
46
|
-
left: number;
|
|
47
|
-
borderRadius: number;
|
|
48
|
-
};
|
|
49
|
-
counterText: {
|
|
50
|
-
textAlign: "center";
|
|
51
|
-
color: string;
|
|
52
|
-
fontSize: number;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
renderButton: (button: HeaderButton, type: 'left' | 'right') => JSX.Element;
|
|
56
|
-
renderButtonInvisible: (type: 'left' | 'right') => JSX.Element;
|
|
57
|
-
render(): JSX.Element;
|
|
58
|
-
}
|
package/lib/components/Header.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Header = void 0;
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const react_native_1 = require("react-native");
|
|
6
|
-
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
7
|
-
const theme_1 = require("../modules/theme");
|
|
8
|
-
const layout_1 = require("../modules/layout");
|
|
9
|
-
const test_1 = require("../modules/test");
|
|
10
|
-
class Header extends React.Component {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.getStyles = () => {
|
|
14
|
-
const theme = (0, theme_1.getTheme)();
|
|
15
|
-
const styles = react_native_1.StyleSheet.create({
|
|
16
|
-
header: {
|
|
17
|
-
backgroundColor: theme.backgroundColor3,
|
|
18
|
-
height: (0, layout_1.isTablet)() ? 65 : 50,
|
|
19
|
-
flexDirection: 'row',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
justifyContent: 'center'
|
|
22
|
-
},
|
|
23
|
-
title: {
|
|
24
|
-
color: theme.textColor4,
|
|
25
|
-
fontFamily: theme.fontFamily1,
|
|
26
|
-
fontSize: (0, layout_1.isTablet)() ? 22 : 18,
|
|
27
|
-
marginHorizontal: 10,
|
|
28
|
-
flexShrink: 1
|
|
29
|
-
},
|
|
30
|
-
button: {
|
|
31
|
-
padding: (0, layout_1.isTablet)() ? 14 : 10
|
|
32
|
-
},
|
|
33
|
-
counterContainer: {
|
|
34
|
-
position: 'absolute',
|
|
35
|
-
backgroundColor: theme.counterBackgroundColor,
|
|
36
|
-
height: (0, layout_1.isTablet)() ? 20 : 15,
|
|
37
|
-
width: (0, layout_1.isTablet)() ? 20 : 15,
|
|
38
|
-
top: 5,
|
|
39
|
-
left: 18,
|
|
40
|
-
borderRadius: 50
|
|
41
|
-
},
|
|
42
|
-
counterText: {
|
|
43
|
-
textAlign: 'center',
|
|
44
|
-
color: theme.counterTextColor,
|
|
45
|
-
fontSize: (0, layout_1.isTablet)() ? 15 : 10
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return styles;
|
|
49
|
-
};
|
|
50
|
-
this.renderButton = (button, type) => {
|
|
51
|
-
const styles = this.getStyles();
|
|
52
|
-
const theme = (0, theme_1.getTheme)();
|
|
53
|
-
const icon = (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(FontAwesome_1.default, { nativeID: button.nativeID, testID: (0, test_1.getTestID)(button.nativeID), name: button.icon, size: (0, layout_1.isTablet)() ? 30 : 20, color: button.disabled ? theme.textColor1 : theme.textColor4,
|
|
55
|
-
// @ts-ignore : The component uses a different version of typing
|
|
56
|
-
style: button.buttonStyle }),
|
|
57
|
-
button.counter ? (React.createElement(react_native_1.View, { style: styles.counterContainer },
|
|
58
|
-
React.createElement(react_native_1.Text, { style: styles.counterText }, button.counter))) : null));
|
|
59
|
-
const style = [
|
|
60
|
-
styles.button,
|
|
61
|
-
type === 'left' ? { marginRight: 'auto' } : { marginLeft: 'auto' }
|
|
62
|
-
];
|
|
63
|
-
if (button.disabled) {
|
|
64
|
-
return React.createElement(react_native_1.View, { style: style }, icon);
|
|
65
|
-
}
|
|
66
|
-
return (React.createElement(react_native_1.TouchableOpacity, { onPress: button.onPress, style: style }, icon));
|
|
67
|
-
};
|
|
68
|
-
this.renderButtonInvisible = (type) => {
|
|
69
|
-
const styles = this.getStyles();
|
|
70
|
-
const style = [
|
|
71
|
-
styles.button,
|
|
72
|
-
type === 'left' ? { marginRight: 'auto' } : { marginLeft: 'auto' }
|
|
73
|
-
];
|
|
74
|
-
return React.createElement(react_native_1.View, { style: style });
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
render() {
|
|
78
|
-
const { title, leftButton, rightButton, nativeID } = this.props;
|
|
79
|
-
const styles = this.getStyles();
|
|
80
|
-
return (React.createElement(react_native_1.View, { style: styles.header },
|
|
81
|
-
leftButton
|
|
82
|
-
? this.renderButton(leftButton, 'left')
|
|
83
|
-
: this.renderButtonInvisible('left'),
|
|
84
|
-
React.createElement(react_native_1.Text, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: styles.title }, title),
|
|
85
|
-
rightButton
|
|
86
|
-
? this.renderButton(rightButton, 'right')
|
|
87
|
-
: this.renderButtonInvisible('right')));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.Header = Header;
|
|
91
|
-
Header.defaultProps = {
|
|
92
|
-
leftButtonType: 'menu'
|
|
93
|
-
};
|
|
94
|
-
Header.height = (0, layout_1.isTablet)() ? 65 : 50;
|