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

boke-ui-r

v0.0.20

Published

boke common commonents with ract

Downloads

22

Readme

boke-ui-r

boke common components with ract boke React 组件库

NPM JavaScript Style Guide

Install

npm install --save boke-ui-r

Usage

import React, { Component } from 'react'

import MyComponent from 'boke-ui-r'

class Example extends Component {
  render () {
    return (
      <MyComponent />
    )
  }
}

Components

UploadImgsToOss

上传图片到Oss对象存储,包含单张、多张图片上传,图片删除,拖拽改变图片顺序,设置默认图片等功能。

| 参数 | 说明 | 类型 | 默认值 | | --------------| ------------------------------------------|-----------------------------|-------| | *oss | 获取对象存储权限函数 | function(){返回pormise对象} | {} | | *getImageUrls | 获取图片链接,上传成功和拖拽修改都会触发此函数|function(imageUrls) | - | | maxNum | 最多上传的图片数量 |number | 1 | | imageUrls | 已经上传的图片链接,用于编辑 |array | [] | | definedImage | 默认图片链接(不设置此属性将不会有默认功能) | string |'undefined' | | defineChange | 设置默认图片回调函数 | function(img,index) | - | | width | 设置宽 | number | 100 | | height | 设置高 | number | 100 |

LocationModal

demo

import React, { Component } from 'react'
import {LocationModal} from 'boke-ui-r'

export default class App extends Component {
  constructor(props){
    super(props)
    this.state = {
      position: {
        X: '',
        Y: ''
      },
      range: {
        width: 80,
        height:40
      }
    }
  }
  getPosition = (position) => {
    this.setState({position})
  }
  changeX = (e) => {
    this.setState({
      position:{
        X: e.target.value,
        Y: this.state.position.Y
      }
    })
  }
  changeY = (e) => {
    this.setState({
      position:{
        X: this.state.position.X,
        Y: e.target.value
      }
    })
  }
  changeRangeWidth = (e) => {
    this.setState({
      range: {
        width: e.target.value,
        height: this.state.range.height
      }
    })
  }
  changeRangeHeight = (e) => {
    this.setState({
      range: {
        width: this.state.range.width,
        height: e.target.value
      }
    })
  }
  render () {
    const {position, range} = this.state 
    let setChildren = <div>
      <p>标点坐标:</p>
      <div>
        <span>x</span><span><input value={position.X} type="number" onChange={this.changeX} style={{width: '60px'}} /></span>
        <span>y</span><span><input value={position.Y} type="number" onChange={this.changeY}  style={{width: '60px'}}/></span>
      </div>
      <p>最大使用范围</p>
      <div>
        <span>宽:</span><span><input type="number" value={range.width} onChange={this.changeRangeWidth} style={{width: '60px'}} /></span>
        <span>高:</span><span><input type="number" value={range.height} onChange={this.changeRangeHeight} style={{width: '60px'}}/></span>
      </div>
    </div>
    return (
      <div>
        <LocationModal visible={true}
          setChildren={setChildren}
          getPosition={this.getPosition}
          position={position}
          range={range} >
          <div style={{width: '100%',height: '100%'}}>aa</div>
        </LocationModal>
      </div>
    )
  }
}

选择个性坐标弹框。 | 参数 | 说明 | 类型 | 默认值 | | --------------| ------------------------------------------|-----------------------------|-------| | *visible | 弹框开关 | bool | false| | width | 弹框内容的宽度 |number | 1116| | height | 弹框高度 |number | 900 | | setChildren | 弹框设置模块内容 |element | - | | getPosition | 获取位置 | function |'undefined' | | position | 个性坐标(详情请看坐标位置position)| object | - | | range | 个信范围(详情请看坐标范围range) | object | - |

position

| 参数 | 说明 | 类型 | 默认值 | |------|----------|-----|--------| | X | X轴的坐标|number|-1 | | Y | Y轴的坐标|number|-1 |

range

| 参数 | 说明 | 类型 | 默认值 | |------|----------|-----|--------| |wdith | 个性的宽 |number| 80 | |height| 个性的高 |number| 40 |

License

MIT ©