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

bywin-design

v1.0.2

Published

bywin design

Downloads

12

Readme

bywin 组件库

组件使用文档

开发

拉取代码

$ git clone https://github.com/wangxiaogang94/bywin-desgin.git

运行

$ cnpm i
$ npm start

打包

$ npm run build
 //下面的打包用于发布npm
$ npm run build:commonjs
$ npm run build:esm
$ npm run copy-css:esm
$ npm run copy-css:lib

发布

$ npm publish

开发

/src/components // 这里是开发的组件 /src/page // 这里是demo和文档

使用

安装

$ npm install bywin-design --save
$ yarn add bywin-design

如果你的网络环境不佳,推荐使用 cnpm

文档

详细文档

上传的图片文件转base64

import { fileToBase64 } from 'bywin-design';
// 在antd的upload的beforeUpload中使用 可以完成前端获取上传图片
const image = fileToBase64(file, (base64)=>{
    console.log(base64);
})

水印

  • text:
    • Type:String
  • isWatermark:
    • Type:bool
    • Default: false
  • angle:
    • Type:number
    • Default: -30
import { WaterMark } from 'bywin-design';

const a = () => <WaterMark text={'admin'} isWatermark/>

颜色选择器

import { ColorPicker } from 'bywin-design';

export default class colorpicker extends React.Component {
    state = {
        color: '#F5222D'
    }
    render() {

        return(
            <div>
                <h2>颜色选择器</h2>
                <ColorPicker
                    type="sketch"
                    small
                    color={this.state.color}
                    position="bottom"
                    presetColors={[
                        '#F5222D',
                        '#FA541C',
                        '#FA8C16',
                        '#FAAD14',
                        '#FADB14',
                        '#A0D911',
                        '#52C41A',
                        '#13C2C2',
                        '#1890FF',
                        '#2F54EB',
                        '#722ED1',
                        '#EB2F96',
                    ]}
                    onChangeComplete={(color)=>this.setState({color})}
                />
            </div>
        );
    }
}

扇形菜单

API

属性说明如下:

| 属性 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | | top | 中心点的y | number | 350 | 1.0.10 | | left | 中心点的x | number | 350 | 1.0.10 | | show | 是否显示菜单 | boolean | true | 1.0.10 | | menu | 菜单项 | ReactNode[] | [] | 1.0.10 | | centerButton | 中心按钮 | string/ReactNode | | 1.0.10 | | centerClick | 中心按钮点击事件 | function | | 1.0.10 | | centerBackground | 中心按钮背景 | string | #fd485e | 1.0.10 |

menu的子属性

| 属性 | 说明 | 类型 | 默认值 | 版本 | 说明 | | --- | --- | --- | --- | --- | | icon | 图标 | ReactNode | | 1.0.10 | | | text | 文字 | string/ReactNode | | 1.0.10 | | | onClick | 点击事件 | function | | 1.0.10 | | | className | 自定义样式class名 | string | | 1.0.10 |

示例
import { CircleMenu } from 'bywin-design';


export default class menu extends React.Component {
    render() {
        const props = {
            top: 150, // 中心点的y
            left: 350, // 中心点的x
            show: true, // 是否显示菜单
            menu: [
                {
                    icon: <Icon type="plus-circle" />,
                    text: '拓展',
                    onClick: i => console.log(i),
                },
                {
                    icon: <Icon type="plus" />,
                    text: '新增',
                    onClick: i => console.log(i),
                },
                {
                    icon: <Icon type="fullscreen" />,
                    text: '全屏',
                    onClick: i => console.log(i),
                },
                {
                    icon: <Icon type="fullscreen-exit" />,
                    text: '收回',
                    onClick: i => console.log(i),
                },
                {
                    icon: <Icon type="form" />,
                    text: '编辑',
                    onClick: i => console.log(i),
                },
                {
                    icon: <Icon type="qq" />,
                    text: 'qq',
                    onClick: i => console.log(i),
                },
            ],
            centerButton: (
                <span>
                    <Icon type="plus-circle" />
                    点击
                </span>
            ),
            centerClick: () => {},
            centerBackground: 'blue',
        };
        return (
            <div>
                <CircleMenu {...props}/>
            </div>
        );
    }
}