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

@beisen/upaas-lookup-v2

v0.0.17

Published

## 参数

Downloads

36

Readme

UpaasLookUpV2

参数

options:{
      onChange:(val) => {console.log('onChange')},  //抛出的onchange方法
      value: this.state.inputValue,  //input中的默认值
      popComponent:<div>321321</div>,  //全部查找弹窗中的组件,indexpage
      status: 'search',   //edit or search
      title: 'LookUpV2', //title
      required: true,  //必填
      readOnly: false,  //只读
      disabled: false, //禁用
      helpMsg: 'sds',  //帮助提示
      isShowFindAll: true,  //是否显示全部查找
      isNotAllow: false,  //是否有权限
      // errorMsg: 'dfsfdsfsdf', //错误信息
      // promptMsg: 'sfsfsf',
      // multiple: false,
      listValue: [],   //下拉数据
      isFetching: false, //是否在获取数据
      // multiValue: [],
      listClick:(event, data) => {console.log('listClick')}, 点击下拉中数据的回调
      // multipleClear: this.multipleClear,
      onFindAll: () => {console.log('onFindAll execute')}, //点击全部查找
      onSubmitPop: () => { console.log("onSubmitPop")}, //弹窗点击确定
      onClosePop: () => { console.log("onClosePop")},  //弹窗关闭方法
      clearPageData: () => {console.log("clearPageData")},   // 原action方法,清空page数据
      getPageData: () => {console.log("getPageData")} //原action方法,获取page数据
}

###demo

class App extends Component {

  constructor(props) {
    super(props);
    this.multiple = false;
    this.multiValue = [];
    this.listValue = null;
    this.state = {
      inputValue: ''
    };
  }

  inputOnChange = (val) => {
    console.info(val);
    let _value;
    if (typeof val == 'string') {
      _value = val;
    } else {
      _value = val.target.value;
    }
    this.isFetching = true;
    if (_value == '海淀') {
      this.listValue = [
        [{isShowCustomViewButton:true, avatars: {100022: {hasAvatar: true, small: "//cache.tita.gift/Image/100013/4233e527dcd24ea594614b707f21cb1d_s.jpg",color: '#8dc8ea'}}, name:"Address", text:"11海淀", value:"海淀"}],
        [{isShowCustomViewButton:true, avatars: {100022: {hasAvatar: true, small: "//cache.tita.gift/Image/100013/4233e527dcd24ea594614b707f21cb1d_s.jpg",color: '#8dc8ea'}}, name:"Address", text:"11海淀", value:"海淀"}],
        [{isShowCustomViewButton:true, avatars: {100022: {hasAvatar: true, small: "//cache.tita.gift/Image/100013/4233e527dcd24ea594614b707f21cb1d_s.jpg",color: '#8dc8ea'}}, name:"Address", text:"11海淀", value:"海淀"}],
        [{isShowCustomViewButton:true, avatars: {100022: {hasAvatar: true, small: "//cache.tita.gift/Image/100013/4233e527dcd24ea594614b707f21cb1d_s.jpg",color: '#8dc8ea'}}, name:"Address", text:"11海淀", value:"海淀"}],
        [{isShowCustomViewButton:true, avatars: {100022: {hasAvatar: true, small: "//cache.tita.gift/Image/100013/4233e527dcd24ea594614b707f21cb1d_s.jpg",color: '#8dc8ea'}}, name:"Address", text:"11海淀", value:"海淀"}]
      ];
      this.isFetching = false;
      // this.isNotAllow = true;
    } else if (_value == '222') {
      this.listValue = [
        {
          name: '1',
          text: '2'
        },
        {
          name: '1',
          text: '2'
        }
      ];
      this.isFetching = false;
    } else {
      this.listValue = [];
      this.isFetching = false;
    }
    // this.listValue = null;
    this.setState({inputValue: _value});
  }

  listClick = (event, data) => {
    console.log(event, data, '------')
  }

  multipleClear = (index) => {
    this.multiValue.splice(index, 1);
  }

  render () {
    this.data = {
      onChange: this.inputOnChange,
      value: this.state.inputValue,
      popComponent:<div>321321</div>,
      status: 'search',
      title: 'LookUpV2',
      required: true,
      readOnly: false,
      disabled: false,
      helpMsg: 'sds',
      isShowFindAll: true,
      isNotAllow: this.isNotAllow,
      errorMsg: 'dfsfdsfsdf',
      promptMsg: 'sfsfsf',
      multiple: this.multiple,
      listValue: this.listValue,
      isFetching: false,
      multiValue: this.multiValue,
      listClick: this.listClick,
      multipleClear: this.multipleClear,
      onFindAll: () => {console.log('onFindAll execute')},
      onSubmitPop: () => { console.log("onSubmitPop")},
      onClosePop: () => { console.log("onClosePop")},
      clearPageData: () => {console.log("clearPageData")},
      getPageData: () => {console.log("getPageData")}
    }
    return (
      <div>
         <UpaasLookUpV2 {...this.data}/>
      </div>
    )
  }
}
render(<App />, document.getElementById('content'))