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

bee-overlay-modal

v0.0.2

Published

overlay ui component for react

Downloads

294

Readme

bee-overlay-modal

npm version Build Status Coverage Status

bee-overlay modal版本

使用方法

API

  • Portal 入口,将子组件放入指定的容器

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |container|目标容器|DOM元素\react组件\或是返回组件的函数|''|

  • Position 定位组件

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |target|要定位元素|DOM元素\react组件\或是返回组件的函数|''| |container|目标容器|DOM元素\react组件\或是返回组件的函数|''| |containerPadding|设置目标容器的内边距|number|0| |placement|显示位置设置|top\left\bottom\right|right| |shouldUpdatePosition|是否需要更新位置|boolean|false|

  • BaseOverlay 基础悬浮组件,依赖于Portal,Position组件,继承Portal,Position组件接口。

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |show|是否显示|boolean|false| |rootClose|是否点击除弹出层任意地方隐藏|boolean|true| |onHide|当rootClose设置为false时,可设置为隐藏方法|function|-| |transition|过度动画组件|component|-| |onEnter|开始显示时的钩子函数|function|-| |onEntering|显示时的钩子函数|function|-| |onEntered|显示完成后的钩子函数|function|-| |onExit|隐藏开始时的钩子函数|function|-| |onExiting|隐藏进行时的钩子函数|function|-| |onExited|隐藏结束时的钩子函数|function|-|

  • Overlay 悬浮组件,依赖于BaseOverlay,继承BaseOverlay的组件接口

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |show|是否显示|boolean|false| |rootClose|是否点击除弹出层任意地方隐藏|boolean|true| |onHide|当rootClose设置为false时,可设置为隐藏方法|function|-| |transition|过度动画组件|component|-| |onEnter|开始显示时的钩子函数|function|-| |onEntering|显示时的钩子函数|function|-| |onEntered|显示完成后的钩子函数|function|-| |onExit|隐藏开始时的钩子函数|function|-| |onExiting|隐藏进行时的钩子函数|function|-| |onExited|隐藏结束时的钩子函数|function|-| |placement|显示位置设置|top\left\bottom\right|right| |placement|第二优先级显示位置设置|top\left\bottom\right|right|

  • OverlayTrigger 挂载组件,依赖Overlay组件,继承Overlay组件的接口

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |trigger|触发叠加层的事件|click/hover/focus|hover/focus| |delay|叠加层显示和隐藏的延迟时间|number|-| |delayShow|叠加层显示的延迟时间|number|-| |delayHide|叠加层隐藏的延迟时间|number|-| |defaultOverlayShown|覆盖Overlay设置的默认显隐状态|boolean|false| |overlay|叠加层|element/string/function|-| |onBlur|失去焦点触发的时间|function|-| |onClick|点击事件|function|-| |onFocus|焦点事件|function|-| |onMouseOut|鼠标离开事件|function|-| |onMouseOver|鼠标滑过事件|function|-| |popData|trigger的自定义属性,例如 {"data-name":"lucian","data-sex":"man"},属性名不能和其它属性名重复,否则会被覆盖|Object|-|

  • RootCloseWrapper 代理外部组件事件

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |onRootClose|关闭时触发的方法|function|-| |children|内部包含元素|DOM元素|-| |disabled|是否禁用|boolean|-| |event|触发事件|click/mousedown|click|

  • Affix 固定定位组件

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |offsetTop|到屏幕顶部像素|number|-| |viewportOffsetTop|到窗口的偏移像素|number|-| |offsetBottom|到屏幕的底部的偏移像素|number|-| |topClassName|在顶部时添加的class|class|-| |topStyle|在顶部添加的style|style|-| |affixClassName|当固定定位时,添加的class|class|-| |affixStyle|当固定定位时,添加的style|style|-| |bottomClassName|在底部时添加的class|class|-| |bottomStyle|在底部时添加的style|style|-| |onAffix|在affixstyle和affixClassName添加之前的钩子函数|function|-| |onAffixed|在affixstyle和affixClassName添加之后的钩子函数|function|-| |onAffixTop|在topStyle和topClassName添加之前的钩子函数|function|-| |onAffixedTop|在topStyle和topClassName添加之后的钩子函数|function|-| |onAffixBottom|在bottomStyle和bottomClassName添加之前的钩子函数|function|-| |onAffixedBottom|在bottomStyle和bottomClassName添加之后的钩子函数|function|-|

  • AutoAffix 对Affix进行包装,提供自动计算偏移量,因为包装Affix,包含所有Affix组件的接口

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |container|容器元素|DOM元素\React组件\或者返回React组件的函数|---:| |autoWidth|是否自适应宽度|boolean|---:|

  • BaseModal 模态框,建立在Protal之上,包含所有Protal组件接口

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |show|是否显示|boolean|false| |container|容器|DOM元素\React组件\或者返回React组件的函数|-| |onShow|当模态框显示时的钩子函数|function|-| |onHide|当模态框关闭时的钩子函数|function|-| |backdrop|显示时,是否包含背景|boolean|true| |renderBackdrop|返回背景元素的函数|function|-| |onEscapeKeyUp|响应ESC键时的钩子函数|function|-| |onBackdropClick|点击背景元素的函数|function|-| |backdropStyle|添加到背景元素的style|function|-| |backdropClassName|添加到背景元素的class|function|-| |containerClassName|添加到外部容器的class|function|-| |keyboard|ESC键是否关闭模态框|boolean|true| |transition|动画组件|function|-| |dialogTransitionTimeout|设置动画超时时间|function|-| |backdropTransitionTimeout|设置背景动画超时时间|function|-| |autoFocus|显示时是否自动设置焦点|function|-| |enforceFocus|不让焦点离开模态框|function|-| |onEnter|模态框显示时的钩子函数|function|-| |onEntering|模态框进入中的钩子函数|function|-| |onEntered|模态框显示后的钩子函数|function|-| |onExit|模态框关闭时的钩子函数|function|-:| |onExiting|模态框关闭中的钩子函数|function|-| |onExited|模态框关闭后的钩子函数|function|-| |manager|管理模态框状态的组件|required|-|

  • Transtion

|参数|说明|类型|默认值| |:--|:---:|:--:|---:| |in|是否触发动画|boolean|false| |unmountOnExit|不显示的时候是否销毁组件|boolean:|false| |transitionAppear|默认显示是否加载动画|boolean|false| |timeout|超时时间|number|5000| |exitedClassName|退出动画时添加的class|class|-| |exitingClassName|退出组件中添加的class|class|-| |enteredClassName|进入动画时添加的class|class|-| |enteringClassName|进入动画中添加的class|class|-| |onEnter|动画显示时的钩子函数|function|空函数| |onEntering|动画进入中的钩子函数|function|空函数| |onEntered|动画显示后的钩子函数|function|空函数| |onExit|动画关闭时的钩子函数|function|空函数| |onExiting|动画关闭中的钩子函数|function|空函数| |onExited|动画关闭后的钩子函数|function|空函数|

开发调试

$ git clone https://github.com/tinper-bee/bee-overlay-modal
$ cd bee-overlay-modal
$ npm install
$ npm run dev