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

rat-balloon

v0.1.28

Published

rat-balloon component for Rat.

Downloads

7

Readme

rat-balloon

组件介绍

  • category: Components
  • chinese: 气泡提示
  • type: 弹层

安装

$ npm install rat-balloon --save

开发指南

气泡组件

何时使用

  • 当用户与被说明对象(文字,图片,输入框等)发生交互行为的action开始时, 即刻跟随动作出现一种辅助或帮助的提示信息。
  • 其中Balloon.Tooltip是简化版本,主要用于hover时显示简单文案。

使用注意

  • 对于trigger是自定义的React Component的情况,自定义的React Component 需要透传onMouseEnter/onMouseLeave/onClick 事件。

API

Balloon

| 参数 | 说明 | 类型 | 默认值 | | -------------------- | ---------------- | --------------- | ---------------------------------------- | | pure | 是否pure render | Boolean | false | | type | 样式类型可选值:'normal', 'primary' | Enum | 'normal' | | children | 浮层的内容 | any | - | | visible | 弹层当前显示的状态 | Boolean | -| | defaultVisible | 弹层默认显示的状态 | Boolean | false | | onVisibleChange | 弹层在显示和隐藏触发的事件签名:Function(visible: Boolean) => void参数:visible: {Boolean} 弹层是否隐藏和显示 | Function | func.noop | | alignEdge | 弹出层对齐方式 | Boolean | false | | closable | 是否显示关闭按钮 | Boolean | true | | align | 弹出层位置可选值:'t'(上)'r'(右)'b'(下)'l'(左)'tl'(上左)'tr'(上右)'bl'(下左)'br'(下右)'lt'(左上)'lb'(左下)'rt'(右上)'rb'(右下 及其 两两组合) | Enum | 'b' | | offset | 弹层相对于trigger的定位的微调 | Array | [0, 0] | | trigger | 触发元素 | any | <span></span>| | triggerType | 触发行为鼠标悬浮, 获取到焦点, 鼠标点击('hover','focus','click')或者它们组成的数组,如 ['hover', 'focus'] | String/Array | 'hover' | | onClose | 任何visible为false时会触发的事件签名:Function() => void | Function | func.noop | | delay | 弹层在触发以后的延时显示, 单位毫秒 ms | Number | - | | afterClose | 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发签名:Function() => void | Function | func.noop | | shouldUpdatePosition | 强制更新定位信息 | Boolean | - | | autoFocus | 弹层出现后是否自动focus到内部第一个元素 | Boolean | false | | safeNode | 安全节点:对于triggetType为click的浮层,会在点击除了浮层外的其它区域时关闭浮层.safeNode用于添加不触发关闭的节点, 值可以是dom节点的id或者是节点的dom对象 | String | undefined | | safeId | 用来指定safeNode节点的id,和safeNode配合使用 | String | null | | cache | 弹层的dom节点关闭时是否删除 | Boolean | false | | popupContainer | 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。 | String/Function | - | | popupStyle | 弹层组件style,透传给Popup | Object | {} | | popupProps | 弹层组件属性,透传给Popup | Object | {} |

Balloon.Tooltip

| 参数 | 说明 | 类型 | 默认值 | | -------------- | ------------ | --------------- | ------------------- | | children | tooltip的内容 | any | - | | align | 弹出层位置可选值:'t'(上)'r'(右)'b'(下)'l'(左)'tl'(上左)'tr'(上右)'bl'(下左)'br'(下右)'lt'(左上)'lb'(左下)'rt'(右上)'rb'(右下 及其 两两组合) | Enum | 'b' | | trigger | 触发元素 | any | <span></span> | | triggerType | 触发行为鼠标悬浮, 获取到焦点, 鼠标点击('hover','focus','click')或者它们组成的数组,如 ['hover', 'focus'] | String/Array | 'hover' | | popupStyle | 弹层组件style,透传给Popup | Object | - | | popupProps | 弹层组件属性,透传给Popup | Object | - | | pure | 是否pure render | Boolean | - | | popupContainer | 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。 | String/Function | -| | id | 弹层id, 传入值才会支持无障碍 | String | -|