Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uiw/react-input

Package Overview
Dependencies
Maintainers
2
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-input - npm Package Compare versions

Comparing version 5.0.0-bate-5 to 5.0.0-bate-6

43

cjs/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -27,11 +25,6 @@ value: true

exports["default"] = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _input = _interopRequireWildcard(require("./style/input"));
Object.keys(_input).forEach(function (key) {

@@ -48,7 +41,4 @@ if (key === "default" || key === "__esModule") return;

});
var _jsxRuntime = require("react/jsx-runtime");
var _InputNumber = _interopRequireWildcard(require("./InputNumber"));
Object.keys(_InputNumber).forEach(function (key) {

@@ -66,23 +56,19 @@ if (key === "default" || key === "__esModule") return;

var _excluded = ["prefixCls", "className", "style", "size", "type", "preIcon", "addonAfter", "inputStyle", "disabled"];
var _default = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-input' : _props$prefixCls,
className = props.className,
style = props.style,
_props$size = props.size,
size = _props$size === void 0 ? 'default' : _props$size,
_props$type = props.type,
type = _props$type === void 0 ? 'text' : _props$type,
_props$preIcon = props.preIcon,
preIcon = _props$preIcon === void 0 ? null : _props$preIcon,
addonAfter = props.addonAfter,
inputStyle = props.inputStyle,
disabled = props.disabled,
otherProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
prefixCls = _props$prefixCls === void 0 ? 'w-input' : _props$prefixCls,
className = props.className,
style = props.style,
_props$size = props.size,
size = _props$size === void 0 ? 'default' : _props$size,
_props$type = props.type,
type = _props$type === void 0 ? 'text' : _props$type,
_props$preIcon = props.preIcon,
preIcon = _props$preIcon === void 0 ? null : _props$preIcon,
addonAfter = props.addonAfter,
inputStyle = props.inputStyle,
disabled = props.disabled,
otherProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
var inputRef = _react["default"].useRef(null);
var addonRef = _react["default"].useRef(null);
(0, _react.useImperativeHandle)(ref, function () {

@@ -95,3 +81,2 @@ return inputRef.current;

});
function computedInputPadding() {

@@ -103,3 +88,2 @@ if (addonRef.current && inputRef.current) {

}
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_input["default"], {

@@ -126,4 +110,3 @@ className: cls,

});
exports["default"] = _default;
//# sourceMappingURL=index.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -11,40 +9,29 @@ value: true

exports["default"] = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _ = _interopRequireDefault(require("./"));
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["className", "min", "max", "step", "overLimitColor", "keyboard", "formatter", "prefixCls"];
var _default = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
var className = props.className,
min = props.min,
max = props.max,
step = props.step,
overLimitColor = props.overLimitColor,
_props$keyboard = props.keyboard,
keyboard = _props$keyboard === void 0 ? false : _props$keyboard,
formatter = props.formatter,
_props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-input-number' : _props$prefixCls,
otherProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
min = props.min,
max = props.max,
step = props.step,
overLimitColor = props.overLimitColor,
_props$keyboard = props.keyboard,
keyboard = _props$keyboard === void 0 ? false : _props$keyboard,
formatter = props.formatter,
_props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-input-number' : _props$prefixCls,
otherProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
var value = (0, _react.useMemo)(function () {
var _ref;
return Number.parseFloat((_ref = props.value || 0) === null || _ref === void 0 ? void 0 : _ref.toString());
}, [props.value]);
var _useState = (0, _react.useState)(overLimitComp(value)),
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
isOverLimit = _useState2[0],
isOverLimitSet = _useState2[1];
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
isOverLimit = _useState2[0],
isOverLimitSet = _useState2[1];
function overLimitComp(value) {

@@ -55,6 +42,4 @@ if (typeof min === 'number' && value < min) return true;

}
var onChange = function onChange(v) {
var _props$onChange;
var isOverLimit = overLimitComp(Number.parseFloat(v.target.value));

@@ -64,3 +49,2 @@ isOverLimitSet(isOverLimit);

};
var overLimitProps = (0, _react.useMemo)(function () {

@@ -86,5 +70,4 @@ if (!overLimitColor) return {

});
exports["default"] = _default;
module.exports = exports.default;
//# sourceMappingURL=InputNumber.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -11,15 +9,8 @@ value: true

exports["default"] = exports.InputStyleWarp = exports.InputStyleTheme = exports.InputStyleBase = exports.InputStyleAddonAfter = void 0;
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _utils = require("@uiw/utils");
var _reactIcon = require("@uiw/react-icon");
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
var InputStyleTheme = {

@@ -52,3 +43,2 @@ colorInputStyleBase: '#393e48',

};
var InputStyleBase = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (props) {

@@ -62,11 +52,7 @@ var boxShadowColorInputStyleBase = (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), "boxShadowColorInputStyleBase");

});
exports.InputStyleBase = InputStyleBase;
var InputStyleAddonAfter = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (props) {
return (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: ", ";\n right: ", ";\n display: flex;\n bottom: ", ";\n > * {\n display: flex !important;\n align-items: center;\n }\n "])), (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), "topInputStyleAddonAfter"), (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), "topInputStyleAddonAfter"), (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), "topInputStyleAddonAfter"));
});
exports.InputStyleAddonAfter = InputStyleAddonAfter;
var InputStyleWarp = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n font-size: ", ";\n line-height: ", ";\n width: ", ";\n\n & ", " {\n width: ", ";\n }\n\n > ", " {\n position: absolute;\n margin: 0 7px 0 7px;\n transform: translateY(-50%);\n top: 50%;\n }\n\n ", "\n\n ", "\n"])), function (props) {

@@ -89,3 +75,2 @@ return (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'fontSizeDefault');

});
exports.InputStyleWarp = InputStyleWarp;

@@ -92,0 +77,0 @@ var _default = InputStyleWarp;

@@ -14,14 +14,13 @@ import _extends from "@babel/runtime/helpers/extends";

var {
prefixCls = 'w-input',
className,
style,
size = 'default',
type = 'text',
preIcon = null,
addonAfter,
inputStyle,
disabled
} = props,
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
prefixCls = 'w-input',
className,
style,
size = 'default',
type = 'text',
preIcon = null,
addonAfter,
inputStyle,
disabled
} = props,
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
var inputRef = React.useRef(null);

@@ -34,3 +33,2 @@ var addonRef = React.useRef(null);

});
function computedInputPadding() {

@@ -42,3 +40,2 @@ if (addonRef.current && inputRef.current) {

}
return /*#__PURE__*/_jsxs(InputStyleWarp, {

@@ -45,0 +42,0 @@ className: cls,

@@ -9,19 +9,16 @@ import _extends from "@babel/runtime/helpers/extends";

var {
className,
min,
max,
step,
overLimitColor,
keyboard = false,
prefixCls = 'w-input-number'
} = props,
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
className,
min,
max,
step,
overLimitColor,
keyboard = false,
prefixCls = 'w-input-number'
} = props,
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
var value = useMemo(() => {
var _ref;
return Number.parseFloat((_ref = props.value || 0) == null ? void 0 : _ref.toString());
}, [props.value]);
var [isOverLimit, isOverLimitSet] = useState(overLimitComp(value));
function overLimitComp(value) {

@@ -32,3 +29,2 @@ if (typeof min === 'number' && value < min) return true;

}
var onChange = v => {

@@ -39,3 +35,2 @@ var isOverLimit = overLimitComp(Number.parseFloat(v.target.value));

};
var overLimitProps = useMemo(() => {

@@ -42,0 +37,0 @@ if (!overLimitColor) return {

import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose";
import _extends from "@babel/runtime/helpers/extends";
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
import styled, { css } from 'styled-components';

@@ -7,0 +5,0 @@ import { getThemeVariantValue } from '@uiw/utils';

{
"name": "@uiw/react-input",
"version": "5.0.0-bate-5",
"version": "5.0.0-bate-6",
"description": "Input component",

@@ -48,5 +48,5 @@ "author": "Kenny Wong <wowohoo@qq.com>",

"dependencies": {
"@uiw/react-icon": "^5.0.0-bate-5",
"@uiw/utils": "^5.0.0-bate-5"
"@uiw/react-icon": "^5.0.0-bate-6",
"@uiw/utils": "^5.0.0-bate-6"
}
}

@@ -47,3 +47,3 @@ Input 输入框

</Col>
<Col fixed>限制大小</Col>
<Col fixed style={{ lineHeight: '30px' }}>限制大小</Col>
<Col fixed>

@@ -57,3 +57,3 @@ <InputNumber

</Col>
<Col fixed>超出限界警告</Col>
<Col fixed style={{ lineHeight: '30px' }}>超出限界警告</Col>
<Col fixed>

@@ -68,3 +68,3 @@ <InputNumber

</Col>
<Col fixed>设置步涨值</Col>
<Col fixed style={{ lineHeight: '30px' }}>设置步涨值</Col>
<Col fixed>

@@ -71,0 +71,0 @@ <InputNumber

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc