UNPKG

@hyext-beyond/hy-ui-native

Version:

A native lib polyfill for huya miniapp

23 lines 831 B
import React from "react"; import { UI } from '@hyext/hy-ui'; import { processMaxValue } from "../../common/utils"; import { isWebViewEnv, isWebviewProxyEnv } from "@hyext/utils"; import { MockInput } from "./MockInput"; var Input = UI.Input; function RealInput(props) { return /*#__PURE__*/React.createElement(Input, { multiline: props.multiline, maxLength: props.maxLength, clearButtonMode: "never", style: props.style, value: props.value, placeholder: props.placeholder, onChange: function onChange(v) { props.onChange(processMaxValue(String(v), props.maxValue)); }, placeholderTextColor: props.placeholderTextColor || '#ddd', inputStyle: props.inputStyle }); } export var NativeInput = isWebViewEnv() && !isWebviewProxyEnv() ? MockInput : RealInput; export default NativeInput;