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-drawer

v0.1.10

Published

uxcore-drawer component for uxcore.

Downloads

33

Readme

uxcore-drawer

Drawer Component base on React.

何时使用

  1. 当需要一个面板来做页面外操作,比如切换导航、应用中心等。
  2. 当需要一个面板来控制父窗体的内容,承载的信息量介于弹窗与新页面之间,比如新建、导入等。
  3. 当需要一个面板来预览内容,承载的信息量介于弹窗与新页面之间

Development

git clone [email protected]:uxcore/uxcore-drawer.git
cd uxcore-drawer
npm install
npm run start

if you'd like to save your install time,you can use uxcore-tools globally.

npm install uxcore-tools -g
git clone [email protected]:uxcore/uxcore-drawer.git
cd uxcore-drawer
npm install
npm run dep
npm run start

Test Case

npm run test

Coverage

npm run coverage

Demo

https://github.com/uxcore/uxcore-drawer

API

| 参数 | 说明 | 类型 | 默认值 | |------------|----------------|------------------|--------------| | title | Title of the drawer | String/React.Element | 无 | | visible | current drawer's visible status | Boolean | false | | placement | current drawer's direction | left/right | right | |size | current drawer's size | small(400px)/normal(780px),large(1160px) | noraml| | onOk | the callback when ok clicked | function | 无 | | onCancel | the callback when dialog closed | function | 无 | | width | drawer width | String or Number | | | footer | footer of the drawer | React.Element | | | showFooter | show footer of the drawer | Boolean | true| | closable | whether show close button and click mask to close | Boolean | true | | maskClosable | whether click mask to close, this prop will be ignored if set closable prop to false | Boolean | true | | locale | 国际化(包括 zh-cn, en-us, 和 pl-pl) | String | zh-cn | | className | additional className for drawer | string | | | wrapClassName | additional className for drawer wrap | string | vertical-center-dailog for vertical align the drawer | | style | Root style for drawer element.Such as width, height | Object | {} | | zIndex | | Number | | | bodyStyle | body style for drawer body element.Such as height | Number | {} |

使用方法: 1、基本信息预览,点击遮罩层可以关闭

closeDrawer(state) {
    this.setState({
      [state]: false,
    });
  },
 
 <Drawer
  visible={menuVisible}
  title="菜单导航"
  size="small"
  placement="left"
  showFooter={false}
  closable={false}
  onCancel={this.closeDrawer.bind(this, 'menuVisible')}
    >
    <ul className="demo-menu">
        <li>菜单一</li>
        <li>菜单二</li>
        <li>菜单三</li>
        <li>菜单四</li>
        <li>菜单五</li>
        <li>菜单六</li>
      </ul>
  </Drawer>

2、包含相应的操作,如果是包含操作行为,可像Uxcore.dialog一样自定义footer,且指定弹窗的maskClosable为false,防止误操作

 <Drawer
      visible={visible}
      title="抽屉组件"
      size="normal"
      placement="right"
      onOk={this.handleOk}
      maskClosable={false}
      onCancel={this.closeDrawer.bind(this, 'visible')}
      footer={}
    >
    <div className="demo-mode">
        <Form
          ref={(c) => { this.form = c; }}
          className="demo-basic-form"
          jsxvalues={{
             theme: 'Form 展示',
             location: 'Uxcore 站点',
             date: ['2015-10-15', '2015-11-15'],
             content: '这是一个 Form 的模式转换页面。',
          }}
          jsxmode={mode}
        >
       <Input jsxname="theme" jsxlabel="主题" required jsxplaceholder="请输入主题" />
       <Input
          jsxname="location"
          jsxlabel="地点"
          required
          jsxplaceholder="请输入地点"
          jsxrules={[
                { validator: Validators.isNotEmpty, errMsg: '不能为空' },
             ]}
        />
          <Date jsxname="date" jsxlabel="时间" jsxtype="cascade" autoMatchWidth />
           <TextArea
            jsxname="content"
            jsxlabel="内容"
            required
            jsxrules={[
               { validator: Validators.isNotEmpty, errMsg: '不能为空' },
              ]}
            />
      </Form>
   	</div>
 </Drawer>

3、二级抽屉

<Drawer
  visible={basicVisible}
  title="基本信息展示"
  width={600}
  placement="right"
  showFooter={false}
  closable={false}
  onCancel={this.closeDrawer.bind(this, 'basicVisible')}
>
<p>text text text texttext</p>
<p>text text text texttext</p>
<p>text text text texttext</p>
<p>text text text texttext</p>
<Button
  onClick={this.showDrawer.bind(this, 'zoneVisible')}
  style={{ marginTop: '20px' }}
  key="show"
>
二级抽屉
</Button>
  <Drawer
    visible={zoneVisible}
    title="二级组件"
    size="normal"
    placement="right"
    onOk={this.handleOk}
    closable={false}
    showFooter={false}
    onCancel={this.closeDrawer.bind(this, 'zoneVisible')}
  >
  <div>这是第二层的抽屉组件</div>
  </Drawer>
</Drawer>