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

@hi-ui/tag

v4.2.1

Published

A sub-package for @hi-ui/hiui.

Downloads

143

Readme

Tag 标签

用来标记信息的属性,用以区分信息

何时使用

有新消息提示时

常见于图标、文本标题、按钮等位置

使用示例

Props

Tag

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ---------- | -------------- | ------------- | ----------------------------------------------- | --------- | | type | 设置状态 | string | 'primary' | 'success' | 'warning' | 'danger' | 'primary' | | appearance | 设置样式类型 | string | 'default' | 'line' | 'default' | | shape | 设置形状 | string | 'round' | 'square' | 'round' | | color | 标签色 | string | - | - | | className | 自定义样式类名 | string | - | - | | style | 自定义样式 | CSSProperties | - | - |

Tag.Group

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | -------- | ------------------------------ | --------- | ------------- | ------ | | data | 展示数据 | TagNode[] | - | - | | editable | 标签组是否可以修改、新增、删除 | boolean | true | false | false |

Events

Tag.Group

| 参数 | 说明 | 类型 | 参数 | 返回值 | | -------- | -------------- | ------------------------------------------ | -------------------------------------------------------------- | ------ | | onAdd | 标签新增后触发 | (addNode:TagNode, index:number) => void | addNode: 新增的 Tag 对象 TagNodeindex: 新增 Tag 的索引 | - | | onEdit | 标签修改后触发 | (editNode:TagNode, index:number) => void | editNode: 编辑的 Tag 对象 TagNodeindex: 编辑 Tag 的索引 | - | | onDelete | 标签删除后触发 | (deleteNode:TagNode, index:number) => void | deleteNode: 删除的 Tag 对象 TagNodeindex: 删除 Tag 的索引 | - |

CHANGELOG

export interface TagGroupDataItem
  extends Omit<TagProps, "role" | "prefixCls" | "autoEditable"> {
  /**
   * 标签唯一 id
   */
  id: string | number;
}

| 参数 | 变更类型 | 变更内容 | 解决的问题 | | --------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- | | type | update | 新增'default',变更默认为'default' | | | appearance | update | 修改'line'为'solid' | 设计样式变更 | | shape | deprecated | | 不再有形态变化 | | size | feature | 新增标签尺寸 | | | color | update | 变更字段含义为:标签文字颜色 | | | background | feature | 标签背景色 | | | childrenToStringTransformer | feature | 子代转换为 string 类型转换器 | 解决 tag 编辑时的初始值问题 | | closeable | feature | 是否展示可关闭按钮 | | | editable | feature | 是否可编辑(当使用此功能时,如果 children.toString 无法自动转换成预期的字符串,则请自行配置转换器 childrenToStringTransformer 属性) | | | autoEditable | feature | 是否一开始自动可编辑 | | | onEdit | feature | tag 修改操作 | | | onDelete | feature | tag 删除操作 | | | maxWidth | feature | 最大宽度,如超出,则截断末尾添加省略号,鼠标悬浮气泡展示(当使用此功能时,请保证 children 为纯文本类型) | |

Tag.Group

| 参数 | 变更类型 | 变更内容 | 解决的问题 | | -------- | ---------- | ------------------------------------------------------------------------------------------ | ----------------------------- | | data | update | 类型变更为 TagGroupDataItem[] | 增强 data 对于 tag 的自定义度 | | maxWidth | feature | 最大宽度(优先级低于 node 自行定义) | 提供统一设定方式 | | shape | deprecated | | 不再有形态变化 | | onAdd | update | 变更类型为  (newStringValue: string) => void | | | onEdit | update | 变更类型为  (newStringValue: string, disposeNode: TagGroupDataItem, index: number) => void | |