|
@@ -0,0 +1,521 @@
|
|
|
|
|
+import {
|
|
|
|
|
+ useImperativeHandle,
|
|
|
|
|
+ forwardRef,
|
|
|
|
|
+ useReducer,
|
|
|
|
|
+ type Ref
|
|
|
|
|
+} from "react";
|
|
|
|
|
+import {
|
|
|
|
|
+ TouchableOpacity,
|
|
|
|
|
+ View
|
|
|
|
|
+} from "react-native";
|
|
|
|
|
+import {
|
|
|
|
|
+ type SelectBoxComponent,
|
|
|
|
|
+ type ISelectBoxRef,
|
|
|
|
|
+ type SelectBoxType,
|
|
|
|
|
+ type SelectedItem
|
|
|
|
|
+} from "./type";
|
|
|
|
|
+import type ISelectBoxProps from "./type";
|
|
|
|
|
+import stylesheet, {
|
|
|
|
|
+ getSelectBoxType,
|
|
|
|
|
+ useStyles
|
|
|
|
|
+} from "./stylesheet";
|
|
|
|
|
+import {
|
|
|
|
|
+ NCoreUIKitLocalize,
|
|
|
|
|
+ NCoreUIKitTheme
|
|
|
|
|
+} from "../../core/hooks";
|
|
|
|
|
+import {
|
|
|
|
|
+ type INCoreUIKitIconProps,
|
|
|
|
|
+ type NCoreUIKitIcon
|
|
|
|
|
+} from "../../types";
|
|
|
|
|
+import type ITextProps from "../text/type";
|
|
|
|
|
+import {
|
|
|
|
|
+ BadgeQuestionMarkIcon,
|
|
|
|
|
+ BadgeSuccessIcon,
|
|
|
|
|
+ BadgeDangerIcon,
|
|
|
|
|
+ BadgeAlertIcon,
|
|
|
|
|
+ BadgeInfoIcon,
|
|
|
|
|
+ CleanIcon
|
|
|
|
|
+} from "../../assets/svg";
|
|
|
|
|
+import Text from "../text";
|
|
|
|
|
+
|
|
|
|
|
+const SelectBoxTypeIcon: Record<Exclude<SelectBoxType, "default">, NCoreUIKitIcon> = {
|
|
|
|
|
+ "question": BadgeQuestionMarkIcon,
|
|
|
|
|
+ "success": BadgeSuccessIcon,
|
|
|
|
|
+ "warning": BadgeAlertIcon,
|
|
|
|
|
+ "danger": BadgeDangerIcon,
|
|
|
|
|
+ "info": BadgeInfoIcon
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+function SelectBox<T>({
|
|
|
|
|
+ rightIcon: RightIconComponentProp,
|
|
|
|
|
+ hintTextIcon: HintTextIconProp,
|
|
|
|
|
+ spreadBehaviour = "baseline",
|
|
|
|
|
+ isShowHintTextIcon = false,
|
|
|
|
|
+ icon: IconComponentProp,
|
|
|
|
|
+ hintTextContainerStyle,
|
|
|
|
|
+ isCleanEnabled = false,
|
|
|
|
|
+ contentContainerStyle,
|
|
|
|
|
+ subTitle = "Optional",
|
|
|
|
|
+ initialSelectedItems,
|
|
|
|
|
+ onFocus: onFocusProp,
|
|
|
|
|
+ isRequired = false,
|
|
|
|
|
+ isDisabled = false,
|
|
|
|
|
+ onBlur: onBlurProp,
|
|
|
|
|
+ hintTextIconStyle,
|
|
|
|
|
+ data: initialData,
|
|
|
|
|
+ variant = "text",
|
|
|
|
|
+ type = "default",
|
|
|
|
|
+ rightIconOnPress,
|
|
|
|
|
+ rightIconStyle,
|
|
|
|
|
+ isShowSubTitle,
|
|
|
|
|
+ cleanIconStyle,
|
|
|
|
|
+ titleExtractor,
|
|
|
|
|
+ keyExtractor,
|
|
|
|
|
+ contentStyle,
|
|
|
|
|
+ placeholder,
|
|
|
|
|
+ iconOnPress,
|
|
|
|
|
+ isOptional,
|
|
|
|
|
+ validation,
|
|
|
|
|
+ iconStyle,
|
|
|
|
|
+ onChange,
|
|
|
|
|
+ hintText,
|
|
|
|
|
+ style,
|
|
|
|
|
+ title
|
|
|
|
|
+}: ISelectBoxProps<T>, ref: Ref<ISelectBoxRef<T>>) {
|
|
|
|
|
+ const {
|
|
|
|
|
+ inlineSpaces,
|
|
|
|
|
+ typography,
|
|
|
|
|
+ radiuses,
|
|
|
|
|
+ borders,
|
|
|
|
|
+ spaces,
|
|
|
|
|
+ colors
|
|
|
|
|
+ } = NCoreUIKitTheme.useContext();
|
|
|
|
|
+
|
|
|
|
|
+ const {
|
|
|
|
|
+ localize
|
|
|
|
|
+ } = NCoreUIKitLocalize.useContext();
|
|
|
|
|
+
|
|
|
|
|
+ const currentType = getSelectBoxType({
|
|
|
|
|
+ type
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const {
|
|
|
|
|
+ contentContainer: contentContainerDynamicStyle,
|
|
|
|
|
+ titleContainer: titleContainerDynamicStyle,
|
|
|
|
|
+ hintTextIcon: hintTextIconDynamicStyle,
|
|
|
|
|
+ contentText: contentTextDynamicStyle,
|
|
|
|
|
+ cleanButton: cleanButtonDynamicStyle,
|
|
|
|
|
+ rightIcon: rightIconDynamicStyle,
|
|
|
|
|
+ container: containerDynamicStyle,
|
|
|
|
|
+ hintText: hintTextDynamicStyle,
|
|
|
|
|
+ required: requiredDynamicStyle,
|
|
|
|
|
+ subTitle: subTitleDynamicStyle,
|
|
|
|
|
+ overlay: overlayDynamicStyle,
|
|
|
|
|
+ content: contentDynamicStyle,
|
|
|
|
|
+ title: titleDynamicStyle,
|
|
|
|
|
+ icon: iconDynamicStyle
|
|
|
|
|
+ } = useStyles({
|
|
|
|
|
+ icon: IconComponentProp ? true : false,
|
|
|
|
|
+ spreadBehaviour,
|
|
|
|
|
+ inlineSpaces,
|
|
|
|
|
+ currentType,
|
|
|
|
|
+ isDisabled,
|
|
|
|
|
+ typography,
|
|
|
|
|
+ radiuses,
|
|
|
|
|
+ borders,
|
|
|
|
|
+ spaces,
|
|
|
|
|
+ colors,
|
|
|
|
|
+ title,
|
|
|
|
|
+ type
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const styleType = type === "default" ? "neutral" : type === "question" ? "neutral" : type === "danger" ? "error" : type;
|
|
|
|
|
+
|
|
|
|
|
+ const [
|
|
|
|
|
+ data,
|
|
|
|
|
+ setData
|
|
|
|
|
+ ] = useReducer<Array<T & SelectedItem>, [Array<T & SelectedItem>]>((_, newState) => {
|
|
|
|
|
+ return newState;
|
|
|
|
|
+ }, initialData.map((bIItem, bIIndex) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...bIItem,
|
|
|
|
|
+ __title: titleExtractor(bIItem, bIIndex),
|
|
|
|
|
+ __key: keyExtractor(bIItem, bIIndex),
|
|
|
|
|
+ __originalIndex: bIIndex
|
|
|
|
|
+ };
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ const [
|
|
|
|
|
+ selectedItems,
|
|
|
|
|
+ setSelectedItems
|
|
|
|
|
+ ] = useReducer<Array<SelectedItem>, [Array<SelectedItem>]>((_, newState) => {
|
|
|
|
|
+ return newState;
|
|
|
|
|
+ }, initialSelectedItems ?? []);
|
|
|
|
|
+
|
|
|
|
|
+ useImperativeHandle(
|
|
|
|
|
+ ref,
|
|
|
|
|
+ () => ({
|
|
|
|
|
+ updateSelections,
|
|
|
|
|
+ cleanSelections,
|
|
|
|
|
+ updateData,
|
|
|
|
|
+ focus,
|
|
|
|
|
+ blur
|
|
|
|
|
+ }),
|
|
|
|
|
+ []
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ const titleProps: ITextProps = {
|
|
|
|
|
+ color: currentType.titleColor,
|
|
|
|
|
+ variant: "bodyLargeSize"
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const iconProps: INCoreUIKitIconProps = {
|
|
|
|
|
+ size: Number(typography.labelLargeSize.fontSize) + 6,
|
|
|
|
|
+ color: currentType.iconColor
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ if(isDisabled) {
|
|
|
|
|
+ iconProps.color = "disabled";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const blur = () => {
|
|
|
|
|
+ // inputRef.current?.blur();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const focus = () => {
|
|
|
|
|
+ // inputRef.current?.focus();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const cleanSelections = () => {
|
|
|
|
|
+ setSelectedItems([]);
|
|
|
|
|
+
|
|
|
|
|
+ if(onChange) {
|
|
|
|
|
+ onChange([], data);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const updateData = (newData: Array<T>, newSelectedItems: Array<SelectedItem>) => {
|
|
|
|
|
+ const _newData = newData.map((bIItem, bIIndex) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...bIItem,
|
|
|
|
|
+ __title: titleExtractor(bIItem, bIIndex),
|
|
|
|
|
+ __key: keyExtractor(bIItem, bIIndex),
|
|
|
|
|
+ __originalIndex: bIIndex
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ setData(_newData);
|
|
|
|
|
+
|
|
|
|
|
+ const _newSelectedItems = JSON.parse(JSON.stringify(newSelectedItems ? newSelectedItems : selectedItems)).map((sItem: SelectedItem) => {
|
|
|
|
|
+ const originalDataIndex = _newData.findIndex(ssItem => ssItem.__key === sItem.__key);
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...sItem,
|
|
|
|
|
+ __originalIndex: _newData[originalDataIndex]?.__originalIndex,
|
|
|
|
|
+ __title: _newData[originalDataIndex]?.__title,
|
|
|
|
|
+ __key: _newData[originalDataIndex]?.__key
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ setSelectedItems(_newSelectedItems);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const updateSelections = (newSelectedItems: Array<SelectedItem>) => {
|
|
|
|
|
+ const _newSelectedItems = JSON.parse(JSON.stringify(newSelectedItems)).map((sItem: SelectedItem) => {
|
|
|
|
|
+ const originalDataIndex = data.findIndex(ssItem => ssItem.__key === sItem.__key);
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...sItem,
|
|
|
|
|
+ __originalIndex: data[originalDataIndex]?.__originalIndex,
|
|
|
|
|
+ __title: data[originalDataIndex]?.__title,
|
|
|
|
|
+ __key: data[originalDataIndex]?.__key
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ setSelectedItems(_newSelectedItems);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const onFocus = () => {
|
|
|
|
|
+ if(onFocusProp) onFocusProp();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const onBlur = () => {
|
|
|
|
|
+ if(onBlurProp) onBlurProp();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderCleanButton = () => {
|
|
|
|
|
+ if(isDisabled) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(variant !== "text") {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(!isCleanEnabled || !selectedItems.length) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <TouchableOpacity
|
|
|
|
|
+ style={[
|
|
|
|
|
+ cleanIconStyle,
|
|
|
|
|
+ stylesheet.cleanButton,
|
|
|
|
|
+ cleanButtonDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ onPress={() => {
|
|
|
|
|
+ setSelectedItems([]);
|
|
|
|
|
+
|
|
|
|
|
+ if(onChange) {
|
|
|
|
|
+ onChange([]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <CleanIcon
|
|
|
|
|
+ color="mid"
|
|
|
|
|
+ size={20}
|
|
|
|
|
+ />
|
|
|
|
|
+ </TouchableOpacity>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderIcon = () => {
|
|
|
|
|
+ if (!IconComponentProp) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <TouchableOpacity
|
|
|
|
|
+ onPress={iconOnPress}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ iconStyle,
|
|
|
|
|
+ stylesheet.icon,
|
|
|
|
|
+ iconDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ <IconComponentProp
|
|
|
|
|
+ color={iconProps.color}
|
|
|
|
|
+ size={iconProps.size}
|
|
|
|
|
+ />
|
|
|
|
|
+ </TouchableOpacity>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderRightIcon = () => {
|
|
|
|
|
+ if (!RightIconComponentProp) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(isCleanEnabled && selectedItems.length > 0 && variant === "text") {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <TouchableOpacity
|
|
|
|
|
+ onPress={rightIconOnPress}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ rightIconStyle,
|
|
|
|
|
+ stylesheet.rightIcon,
|
|
|
|
|
+ rightIconDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ <RightIconComponentProp
|
|
|
|
|
+ color={iconProps.color}
|
|
|
|
|
+ size={iconProps.size}
|
|
|
|
|
+ />
|
|
|
|
|
+ </TouchableOpacity>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderHintIcon = () => {
|
|
|
|
|
+ if(!isShowHintTextIcon) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(HintTextIconProp) {
|
|
|
|
|
+ return <HintTextIconProp
|
|
|
|
|
+ color={isDisabled ? "disabled" : currentType.hintTextIconColor}
|
|
|
|
|
+ size={20}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ hintTextIconStyle,
|
|
|
|
|
+ stylesheet.hintTextIcon,
|
|
|
|
|
+ hintTextIconDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ />;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const CurrentHintIcon = SelectBoxTypeIcon[type === "default" ? "question" : type];
|
|
|
|
|
+
|
|
|
|
|
+ return <CurrentHintIcon
|
|
|
|
|
+ customColor={isDisabled ? colors.system.state.content.disabled[styleType] : undefined}
|
|
|
|
|
+ color={currentType.hintTextIconColor}
|
|
|
|
|
+ size={20}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ hintTextIconStyle,
|
|
|
|
|
+ stylesheet.hintTextIcon,
|
|
|
|
|
+ hintTextIconDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ />;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderHintText = () => {
|
|
|
|
|
+ if (!hintText) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <View
|
|
|
|
|
+ style={[
|
|
|
|
|
+ hintTextContainerStyle,
|
|
|
|
|
+ stylesheet.hintText,
|
|
|
|
|
+ hintTextDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ {renderHintIcon()}
|
|
|
|
|
+ <Text
|
|
|
|
|
+ customColor={isDisabled ? colors.system.state.content.disabled[styleType] : undefined}
|
|
|
|
|
+ color={currentType.hintTextColor}
|
|
|
|
|
+ variant="labelSmallSize"
|
|
|
|
|
+ >
|
|
|
|
|
+ {hintText}
|
|
|
|
|
+ </Text>
|
|
|
|
|
+ </View>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderRequired = () => {
|
|
|
|
|
+ if(!isRequired) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <Text
|
|
|
|
|
+ color="danger"
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.required,
|
|
|
|
|
+ requiredDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >*</Text>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderSubtitle = () => {
|
|
|
|
|
+ if(!isShowSubTitle && !isOptional) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <Text
|
|
|
|
|
+ variant="labelLargeSize"
|
|
|
|
|
+ color={titleProps.color}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.subTitle,
|
|
|
|
|
+ subTitleDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ ( {isOptional ? localize("is-optional") : subTitle} )
|
|
|
|
|
+ </Text>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderTitle = () => {
|
|
|
|
|
+ if (!title) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <TouchableOpacity
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.titleContainer,
|
|
|
|
|
+ titleContainerDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ onPress={() => {
|
|
|
|
|
+ if(!isDisabled) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {renderRequired()}
|
|
|
|
|
+ <Text
|
|
|
|
|
+ {...titleProps}
|
|
|
|
|
+ variant={titleProps.variant}
|
|
|
|
|
+ color={titleProps.color}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.title,
|
|
|
|
|
+ titleDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ {title}
|
|
|
|
|
+ </Text>
|
|
|
|
|
+ {renderSubtitle()}
|
|
|
|
|
+ </TouchableOpacity>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderValue = () => {
|
|
|
|
|
+ if(!selectedItems.length) {
|
|
|
|
|
+ return <Text
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.contentText,
|
|
|
|
|
+ contentTextDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ {placeholder ? placeholder : localize("select-an-option")}
|
|
|
|
|
+ </Text>;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return <Text
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.contentText,
|
|
|
|
|
+ contentTextDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ {selectedItems.length > 1 ? localize("selected-options-with-count", [
|
|
|
|
|
+ selectedItems.length
|
|
|
|
|
+ ]) : selectedItems[0]?.__title}
|
|
|
|
|
+ </Text>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderContent = () => {
|
|
|
|
|
+ return <View
|
|
|
|
|
+ style={[
|
|
|
|
|
+ contentStyle,
|
|
|
|
|
+ stylesheet.content,
|
|
|
|
|
+ contentDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ {renderValue()}
|
|
|
|
|
+ </View>;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const renderOverlay = () => {
|
|
|
|
|
+ return <View
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.overlay,
|
|
|
|
|
+ overlayDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ />;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ return <View
|
|
|
|
|
+ style={[
|
|
|
|
|
+ style,
|
|
|
|
|
+ stylesheet.container,
|
|
|
|
|
+ containerDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
|
|
+ {renderTitle()}
|
|
|
|
|
+
|
|
|
|
|
+ <TouchableOpacity
|
|
|
|
|
+ disabled={isDisabled}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ contentContainerStyle,
|
|
|
|
|
+ stylesheet.contentContainer,
|
|
|
|
|
+ contentContainerDynamicStyle
|
|
|
|
|
+ ]}
|
|
|
|
|
+ onPress={() => {
|
|
|
|
|
+ if(!isDisabled) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {renderOverlay()}
|
|
|
|
|
+
|
|
|
|
|
+ {renderIcon()}
|
|
|
|
|
+
|
|
|
|
|
+ {renderContent()}
|
|
|
|
|
+
|
|
|
|
|
+ {renderCleanButton()}
|
|
|
|
|
+ {renderRightIcon()}
|
|
|
|
|
+ </TouchableOpacity>
|
|
|
|
|
+
|
|
|
|
|
+ {renderHintText()}
|
|
|
|
|
+ </View>;
|
|
|
|
|
+};
|
|
|
|
|
+export default forwardRef(SelectBox) as unknown as SelectBoxComponent;
|