247 lines
7.9 KiB
JavaScript
247 lines
7.9 KiB
JavaScript
// Module ID: 6388
|
|
// Function ID: 6389
|
|
// Name: HeaderSearchBar
|
|
// Dependencies: [32, 19, 17, 21, 1501, 6380, 6353, 6359, 6385, 6354]
|
|
|
|
// Module 6388 (HeaderSearchBar)
|
|
import closure_3 from "_slicedToArray" /* 32 */;
|
|
import importAllResult from "noop" /* 19 */;
|
|
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
|
|
import jsxProd from "jsxProd" /* 21 */;
|
|
|
|
const require = arg1;
|
|
let c4 = importAllResult;
|
|
({ Animated: c5, Image, Platform, StyleSheet, TextInput: closure_6, View: error } = get_ActivityIndicator);
|
|
({ jsx: closure_8, jsxs: c9 } = jsxProd);
|
|
let closure_10 = { text: "text", number: "numeric", phone: "tel", email: "email" };
|
|
let c11 = true;
|
|
const styles = StyleSheet.create({ container: { flex: 1, flexDirection: "row", alignItems: "stretch" }, inputSearchIcon: { position: "absolute", opacity: 0.5, left: 4, top: 17 }, closeButton: { position: "absolute", opacity: 0.5, right: 8, top: 17 }, clearButton: { position: "absolute", right: 0, top: -7, bottom: 0, justifyContent: "center", padding: 8 }, clearIcon: { height: 16, width: 16, opacity: 0.5 }, cancelButton: { alignSelf: "center", top: -4 }, cancelText: { fontSize: 17, marginHorizontal: 12 }, searchbarContainer: { flex: 1 }, searchbar: { flex: 1, fontSize: 18, paddingHorizontal: 36, marginRight: 8, marginTop: 8, marginBottom: 8, borderBottomWidth: 1 } });
|
|
|
|
export const HeaderSearchBar = importAllResult.forwardRef(function HeaderSearchBarInternal(visible, ref) {
|
|
visible = visible.visible;
|
|
({ inputType, autoFocus } = visible);
|
|
if (autoFocus === undefined) {
|
|
autoFocus = true;
|
|
}
|
|
({ autoCapitalize, placeholder } = visible);
|
|
if (placeholder === undefined) {
|
|
placeholder = "Search";
|
|
}
|
|
({ cancelButtonText, enterKeyHint } = visible);
|
|
if (enterKeyHint === undefined) {
|
|
enterKeyHint = "search";
|
|
}
|
|
const onChangeText = visible.onChangeText;
|
|
const onClose = visible.onClose;
|
|
let text = visible.tintColor;
|
|
const merged = Object.assign(visible, Object.create(null));
|
|
let navigation;
|
|
let first;
|
|
let RN;
|
|
c6 = undefined;
|
|
let first1;
|
|
let first2;
|
|
closure_9 = undefined;
|
|
closure_10 = undefined;
|
|
ref = undefined;
|
|
closure_12 = undefined;
|
|
let callback;
|
|
let callback1;
|
|
let callback2;
|
|
let obj = visible(onClose[4]);
|
|
navigation = obj.useNavigation();
|
|
obj1 = visible(onClose[4]);
|
|
const theme = obj1.useTheme();
|
|
({ dark, colors } = theme);
|
|
const tmp6 = navigation(first.useState(""), 2);
|
|
first = tmp6[0];
|
|
RN = tmp8;
|
|
[tmp10, c6] = navigation(first.useState(visible), 2);
|
|
first1 = navigation(first.useState(() => {
|
|
let num = 0;
|
|
if (visible) {
|
|
num = 1;
|
|
}
|
|
const value = new lib.Value(num);
|
|
return value;
|
|
}), 1)[0];
|
|
first2 = navigation(first.useState(() => {
|
|
const value = new lib.Value(0);
|
|
return value;
|
|
}), 1)[0];
|
|
closure_9 = first.useRef(visible);
|
|
closure_10 = first.useRef(false);
|
|
ref = first.useRef(null);
|
|
const items = [visible, first1];
|
|
const effect = first.useEffect(() => {
|
|
if (visible !== ref.current) {
|
|
let num = 0;
|
|
if (tmp) {
|
|
num = 1;
|
|
}
|
|
const obj = { toValue: null, duration: 100, useNativeDriver: null };
|
|
obj[0] = num;
|
|
obj[2] = ref;
|
|
lib.timing(first1, obj).start((finished) => {
|
|
if (finished.finished) {
|
|
callback(closure_0);
|
|
closure_9.current = closure_0;
|
|
}
|
|
});
|
|
return () => {
|
|
closure_7.stopAnimation();
|
|
};
|
|
}
|
|
}, items);
|
|
closure_12 = tmp15;
|
|
const items1 = [first2, "" !== first];
|
|
const effect1 = first.useEffect(() => {
|
|
if (ref2.current !== closure_12) {
|
|
let num = 0;
|
|
if (tmp) {
|
|
num = 1;
|
|
}
|
|
const obj = { toValue: null, duration: 100, useNativeDriver: null };
|
|
obj[0] = num;
|
|
obj[2] = ref;
|
|
lib.timing(first2, obj).start((finished) => {
|
|
if (finished.finished) {
|
|
closure_10.current = closure_12;
|
|
}
|
|
});
|
|
const timingResult = lib.timing(first2, obj);
|
|
const tmp3 = first2;
|
|
}
|
|
}, items1);
|
|
callback = first.useCallback(() => {
|
|
const current = ref.current;
|
|
if (current != null) {
|
|
current.clear();
|
|
}
|
|
const current2 = ref.current;
|
|
if (current2 != null) {
|
|
current2.focus();
|
|
}
|
|
lib("");
|
|
}, []);
|
|
const items2 = [callback, onChangeText];
|
|
callback1 = first.useCallback(() => {
|
|
callback();
|
|
if (onChangeText != null) {
|
|
const obj = { nativeEvent: null };
|
|
obj[0] = { text: "" };
|
|
tmp2(obj);
|
|
}
|
|
}, items2);
|
|
const items3 = [callback1, onClose];
|
|
callback2 = first.useCallback(() => {
|
|
callback1();
|
|
onClose();
|
|
}, items3);
|
|
const items4 = [callback2, navigation];
|
|
const effect2 = first.useEffect(() => {
|
|
let addListenerResult;
|
|
if (navigation != null) {
|
|
addListenerResult = navigation.addListener("blur", callback2);
|
|
}
|
|
return addListenerResult;
|
|
}, items4);
|
|
const items5 = [callback2, callback];
|
|
const imperativeHandle = first.useImperativeHandle(ref, () => ({
|
|
focus() {
|
|
const current = ref.current;
|
|
if (current != null) {
|
|
current.focus();
|
|
}
|
|
},
|
|
blur() {
|
|
const current = ref.current;
|
|
if (current != null) {
|
|
current.blur();
|
|
}
|
|
},
|
|
setText(arg0) {
|
|
const current = ref.current;
|
|
if (current != null) {
|
|
const obj = { text: null };
|
|
obj[0] = arg0;
|
|
current.setNativeProps(obj);
|
|
}
|
|
callback(arg0);
|
|
},
|
|
clearText: callback,
|
|
cancelSearch: callback2
|
|
}), items5);
|
|
if (!visible) {
|
|
if (!tmp10) {
|
|
return null;
|
|
}
|
|
}
|
|
if (text == null) {
|
|
text = colors.text;
|
|
}
|
|
let str = "none";
|
|
if (visible) {
|
|
str = "auto";
|
|
}
|
|
obj = { pointerEvents: str, "aria-live": "polite", "aria-hidden": !visible, style: items6, children: null };
|
|
items6 = [closure_12.container, { opacity: first1 }, visible.style];
|
|
obj = { style: closure_12.searchbarContainer, children: null };
|
|
obj1 = { source: onChangeText(tmp3[6]), tintColor: text, style: closure_12.inputSearchIcon };
|
|
const items7 = [first2(visible(onClose[5]).HeaderIcon, obj1), , ];
|
|
const obj2 = {};
|
|
const merged1 = Object.assign(merged);
|
|
obj2.ref = ref;
|
|
obj2.onChange = onChangeText;
|
|
obj2.onChangeText = tmp6[1];
|
|
obj2.autoFocus = autoFocus;
|
|
let tmp29;
|
|
if ("systemDefault" !== autoCapitalize) {
|
|
tmp29 = autoCapitalize;
|
|
}
|
|
obj2.autoCapitalize = tmp29;
|
|
if (inputType == null) {
|
|
inputType = "text";
|
|
}
|
|
obj2.inputMode = closure_10[inputType];
|
|
obj2.enterKeyHint = enterKeyHint;
|
|
obj2.placeholder = placeholder;
|
|
const tmp24 = first1;
|
|
const tmp27 = c6;
|
|
const tmp30 = closure_10;
|
|
const tmp9 = navigation(first.useState(visible), 2);
|
|
const obj7 = onChangeText(onClose[7])(text);
|
|
obj2.placeholderTextColor = onChangeText(onClose[7])(text).alpha(0.5).string();
|
|
({ primary: obj6.cursorColor, primary: obj6.selectionHandleColor } = colors);
|
|
const alphaResult = onChangeText(onClose[7])(text).alpha(0.5);
|
|
const obj9 = onChangeText(onClose[7])(colors.primary);
|
|
obj2.selectionColor = onChangeText(onClose[7])(colors.primary).alpha(0.3).string();
|
|
const items8 = [theme.fonts.regular, closure_12.searchbar, ];
|
|
const obj3 = { backgroundColor: "transparent", color: text, borderBottomColor: null };
|
|
const alphaResult1 = onChangeText(onClose[7])(colors.primary).alpha(0.3);
|
|
const obj12 = onChangeText(onClose[7])(text);
|
|
obj3[2] = onChangeText(onClose[7])(text).alpha(0.2).string();
|
|
items8[2] = obj3;
|
|
obj2.style = items8;
|
|
items7[1] = first2(tmp27, obj2);
|
|
items7[2] = null;
|
|
obj[1] = items7;
|
|
const items9 = [closure_9(tmp24, obj), , ];
|
|
const obj4 = {
|
|
onPress() {
|
|
if (first) {
|
|
callback1();
|
|
} else {
|
|
onClose();
|
|
}
|
|
},
|
|
style: closure_12.closeButton,
|
|
children: null
|
|
};
|
|
const alphaResult2 = onChangeText(onClose[7])(text).alpha(0.2);
|
|
obj4[2] = first2(visible(onClose[5]).HeaderIcon, { source: onChangeText(onClose[9]), tintColor: text });
|
|
items9[1] = first2(visible(onClose[8]).HeaderButton, obj4);
|
|
items9[2] = null;
|
|
obj[4] = items9;
|
|
return closure_9(RN.View, obj);
|
|
});
|