@beisen-phoenix/mobile-inner-input
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -6,3 +6,3 @@ import React from 'react'; | ||
readOnly?: boolean; | ||
preStyle?: React.CSSProperties; | ||
className?: string; | ||
translation?: { | ||
@@ -9,0 +9,0 @@ inputHolder: string; |
@@ -0,1 +1,13 @@ | ||
var __makeTemplateObject = this && this.__makeTemplateObject || function (cooked, raw) { | ||
if (Object.defineProperty) { | ||
Object.defineProperty(cooked, "raw", { | ||
value: raw | ||
}); | ||
} else { | ||
cooked.raw = raw; | ||
} | ||
return cooked; | ||
}; | ||
import React, { useState, useEffect } from 'react'; | ||
@@ -6,6 +18,6 @@ import styled, { css } from 'styled-components'; | ||
/*#__PURE__*/ | ||
css(["-webkit-appearance:none;-webkit-tap-highlight-color:rgba(255,255,255,0);border:none;padding:0;&:focus{outline:none;}::-webkit-input-placeholder{color:", ";}"], token.$M5); | ||
css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n -webkit-appearance: none;\n -webkit-tap-highlight-color:rgba(255,255,255,0);\n border: none;\n padding: 0;\n &:focus{\n\t outline: none;\n }\n ::-webkit-input-placeholder {\n\t color: ", ";\n }\n"], ["\n -webkit-appearance: none;\n -webkit-tap-highlight-color:rgba(255,255,255,0);\n border: none;\n padding: 0;\n &:focus{\n\t outline: none;\n }\n ::-webkit-input-placeholder {\n\t color: ", ";\n }\n"])), token.$M5); | ||
export var Input = | ||
/*#__PURE__*/ | ||
styled.input(["", " ", " color:", ";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:right;"], resetInput, token.$Fs3, function (props) { | ||
styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n color: ", ";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: right;\n"], ["\n ", "\n ", "\n color: ", ";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: right;\n"])), resetInput, token.$Fs3, function (props) { | ||
return props.readOnly ? token.$alpha(token.$M2, '0.7') : token.$M1; | ||
@@ -18,10 +30,9 @@ }); | ||
var InnerInput = function InnerInput(props) { | ||
var _props$preStyle = props.preStyle, | ||
preStyle = _props$preStyle === void 0 ? {} : _props$preStyle, | ||
_props$placeholder = props.placeholder, | ||
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder, | ||
_props$readOnly = props.readOnly, | ||
readOnly = _props$readOnly === void 0 ? false : _props$readOnly, | ||
_props$translation = props.translation, | ||
translation = _props$translation === void 0 ? defaultTranslation : _props$translation, | ||
var className = props.className, | ||
_a = props.placeholder, | ||
placeholder = _a === void 0 ? '' : _a, | ||
_b = props.readOnly, | ||
readOnly = _b === void 0 ? false : _b, | ||
_c = props.translation, | ||
translation = _c === void 0 ? defaultTranslation : _c, | ||
onFocus = props.onFocus, | ||
@@ -31,5 +42,5 @@ onChange = props.onChange, | ||
var _useState = useState(props.value), | ||
value = _useState[0], | ||
setValue = _useState[1]; | ||
var _d = useState(props.value), | ||
value = _d[0], | ||
setValue = _d[1]; | ||
@@ -57,3 +68,3 @@ useEffect(function () { | ||
return React.createElement(Input, { | ||
style: preStyle, | ||
className: className, | ||
value: value, | ||
@@ -68,2 +79,3 @@ placeholder: readOnly ? '' : placeholder || translation.inputHolder, | ||
export default InnerInput; | ||
export default InnerInput; | ||
var templateObject_1, templateObject_2; |
{ | ||
"name": "@beisen-phoenix/mobile-inner-input", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -48,4 +48,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@beisen-phoenix/mobile-style-token": "^1.0.3" | ||
"@beisen-phoenix/mobile-style-token": "^1.0.5" | ||
} | ||
} |
4798
83