npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jsx-input

v2.1.3

Published

react xui

Downloads

97

Readme

x-input

react.js文本输入框,限制输入内容为数字、字母、千分位等,支持输入K、M快捷键.


npm安装

npm install jsx-input --save

基本使用方式

import { Input,NumberInput } from 'jsx-input';
  <NumberInput id="txb2" className="test2" spinner={true} step={1}  onChange={v=>{console.log('change22:',v);}}  maxLength={17} decimals={2} isFormat={true}  returnType={this.state.returnType} value={this.state.numberValue} showTitle={true}/>
  <NumberInput id="txb2" className="test2" overFloat={true} spinner={true} step={0.0001} delay={1000} onStep={(v,obj)=>{console.log('step::',v,obj)}} onChange={v=>{console.log('change22:',v);}}  maxLength={17} decimals={4} isFormat={true}  returnType={this.state.returnType} value={this.state.numberValue} showTitle={true}/>
  <Input type="text" className="text"/>
  <Input type="textarea" className="texxt"/>    
    

效果图如下

x-input

Input

输入框

type

texttextarea

onChange

参数为值内容

NumberInput

delay

优化onChange频繁调用的缓冲时间,毫秒数

returnType

返回值类型,支持Number,String等

spinner [bool]

是否打开微调器

step

微调器步数

onStep(value,{offset:step,'up'||'down})

微调点击回调

max

最大值,默认MAX_SAFE_NUMBER

min

最小值,默认MIN_SAFE_NUMBER

stepDecimals [Number]

精度步数,如果是设置4,则每次调整步数为0.0001

addonBefore

前置标签

addonAfter

后置标签

关于作者

https://github.com/tianxiangbing

NumberInput

主要针对数字型输入的组件优化。

onChange: PropTypes.func,
value: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.number
]),
returnType: PropTypes.string,
decimals: PropTypes.number,
isFormat: PropTypes.bool,//是否格式化
negative: PropTypes.bool,//是否支持负数
maxLength: PropTypes.number,//长度限制,只作整数部分的长度
delay: PropTypes.number,//事件延迟时间毫秒

xui

react xui组件一直在持续更新中,欢迎大家关注https://github.com/react-xui