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

uxcore-multi-select

v0.5.4

Published

uxcore-multi-select component for uxcore.

Downloads

122

Readme


uxcore-multi-select Dependency Status devDependency Status

TL;DR

uxcore-multi-select ui component for react

setup develop environment

$ git clone https://github.com/uxcore/uxcore-multi-select
$ cd uxcore-multi-select
$ npm install
$ npm start

Usage

let Multiselect = require('../src');

let Item = Multiselect.Item;

class Demo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            value: ["item2", "item15"],
            disabled: false
        }
    }

    handleChange(value){
        this.setState({
            value: value,
            disabled: false
        })
        console.log('onChange', arguments)
    }
    handleSubmit(){
        console.log('onSubmit', arguments)
    }

    render() {
      let text= ['汉皇重色思倾国','御宇多年求不得','杨家有女初长成','养在深闺人未识',
                  '天生丽质难自弃','一朝选在君王侧','回眸一笑百媚生','六宫粉黛无颜色',
                  '春寒赐浴华清池','温泉水滑洗凝脂','侍儿扶起娇无力','始是新承恩泽时',
                  '云鬓花颜金步摇','芙蓉帐暖度春宵','春宵苦短日高起','从此君王不早朝'];

        return (
            <div>
                <Multiselect
                    value={this.state.value}
                    disabled={this.state.disabled}
                    onChange={this.handleChange.bind(this)}
                    onSubmit={this.handleSubmit.bind(this)}>
                  {text.map(function(item, index) {
                    return <Item value={'item' + index} text={item} />
                  })}
                </Multiselect>
            </div>
        );
    }
};

module.exports = Demo;

demo

http://uxcore.github.io/uxcore/components/uxcore-multi-select/

Props

MulitSelect

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 | |---|---|---|---|---| |value|array|required|[]|由 value 组成的数组,与 React 受限组件表现一致,选中项与 value 保持一致,数组中的值与 item 的 value 相对应| |locale|string|optional|zh-cn|国际化语言,可选 zh-cn,en-us| |onChange|function|required|-|与 React 受限组件表现一致,在 checkbox 群发生改变时触发,借此来更改 value| |disabled|boolean|optional|false|是否为 disable 状态| |className|string|optional|''|选择框的classname| |dropdownClassName|string|optional|''|下拉框的classname| |placeholder|string|optional|''|-| |titleBreakStr|string|optional|'、'|选中选项在选择框中的链接符| |optionLabelProp|string|optional|'text'|item中的哪一个prop作为选项展示的label| |maxSelect|number|optional|-|最多可选选项数量| |showSelectAll|boolean|optional|true|是否显示全选按钮(如果maxSelect小于实际数量则该按钮成为disabled状态)| |showClear|boolean|optional|true|是否显示清空按钮| |onSubmit|function|optional|-|点击确认时的回调函数,返回valueList数组和labelList数组| |size|string|optional|large|尺寸,枚举值 large, middle, small|

MulitSelectItem

通过 MulitSelect.Item 取得。实际prop与checkboxGroup.Item相同

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 | |---|---|---|---|---| |text|string|optinal|-|checkbox 后面跟着的说明文字| |value|string|required|-|checkbox 对应的值|