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

@xintao1105/scroll-tabs

v1.0.8

Published

```bash npm install @xintao1105/scroll-tabs ```

Downloads

11

Readme

'示例图'

安装

npm install @xintao1105/scroll-tabs

or

yarn add @xintao1105/scroll-tabs

示例代码

import ScrollTabs from '@xintao1105/scroll-tabs';
import type { interProps } from '@xintao1105/scroll-tabs';

const ars:interProps = {
    onClick: (e) => { console.log("onClick", e) }
  }

<ScrollTabs {...ars}/>

参数类型

interface dataProps {
  s: string | number;
  content: string | number;
}

interface style {
  fontFamily: string;
  fontSize: number;
  color: string;
  fontWeight: string | number;
  letterSpacing: number;
  lineHeight: number;
  fontStyle: string;
}

interface offset {
  x: number;
  y: number;
}

export interface fillColor {
  /**
   * 颜色类型 纯色 | 渐变色; 默认纯色
   * @type {String}
   * @default type = "pure"
   */
  type: "pure" | "linear";
  /**
   * 纯色色值
   * @default pure = ""
   */
  pure: string;
  /**
   * 渐变色
   */
  linear: {
    /**
     * 渐变色 色值列表
     * @default stops = []
     */
    stops: {
      offset: number;
      color: string;
    }[];
    /**
     * 渐变角度
     * @default angle = 0
     */
    angle: number;
    /**
     * 渐变透明度
     * @default opacity = 1
     */
    opacity: number;
  };
}

export interface styleProps extends style {
  /**
   * 文本偏移
   * @default offset = {x:0,y:0}
   */
  offset: offset;
  /**
   * 开启文本阴影
   * @default shadow = false
   */
  shadow: boolean;
  /**
   * 文本阴影
   * @default textShadow = {"shadowColor": "#0075ff","shadowOffsetX": 0,"shadowOffsetY": 0,"shadowBlur": 8,"extend": 0}
   */
  textShadow?: {
    shadowColor: string;
    shadowOffsetX: number;
    shadowOffsetY: number;
    shadowBlur: number;
    extend: number;
  };
  /**
   * 文本背景填充类型 默认颜色填充
   * @type {string}
   * @default fillType = "color"
   */
  fillType: "color" | "image";
  /**
   * 文本背景颜色填充 fillType = "color" 时生效 开始色值 | 结束色值 | 角度
   * @default fillColor = {"startVal": "rgba(15,22,34,0.6)","endVal": "rgba(15,22,34,0.6)","direction": 0}
   */
  fillColor: fillColor;
  /**
   * 文本背景图片填充 fillType = "image" 时生效
   * @default fillImage = ""
   */
  fillImage: string;
  /**
   * 文本框描边
   * @default stroke = false
   */
  stroke: boolean;
  /**
   * 文本框描边粗细
   * @default strokeWidth = 2
   */
  strokeWidth: number;
  /**
   * 文本框描边颜色
   * @default strokeColor = "rgba(160,169,184,0.3)"
   */
  strokeColor: string;
}

export interface seriesListProps {
  /**
   * 选项字段值 根据 数据项 字段 s 映射
   */
  fieldValue?: string | number;
  /**
   * 默认样式
   */
  style?: styleProps;
  /**
   * 选中样式
   */
  selectStyle?: styleProps;
}

export interface interProps {
  /**
   * 唯一标识ID 默认使用系统生成的32位uuid
   */
  id?: string;
  /**
   * 宽
   */
  width?: number;
  /**
   * 高
   */
  height?: number;
  /**
   * 从1开始,0即不选中
   * @default initIndex = 1
   */
  initIndex?: number;
  /**
   * 文本溢出
   * @type {string}
   * @default textOverflow = "break-word"
   */
  textOverflow?: "break-word" | "ellipsis";
  /**
   * 排列方向
   * @type {string}
   * @default direction = "row"
   */
  direction?: "row" | "column";
  /**
   * 宽度 当direction = "row"时生效
   * @default directionWidth = 125
   */
  directionWidth?: number;
  /**
   * 高度 当direction = "column"时生效
   * @default directionHeight = 45
   */
  directionHeight?: number;
  /**
   * 选项卡间距
   * @default tabMargin = 4
   */
  tabMargin?: number;
  /**
   * 水平对齐 "flex-start" | "center" | "flex-end";
   * @type {string}
   * @default alignItems = "center"
   */
  alignItems?: "flex-start" | "center" | "flex-end";
  /**
   * 自动轮播
   * @default animate = false
   */
  animate?: boolean;
  /**
   * 间隔时长 当animate = true 时生效;单位s
   * @default interval = 3
   */
  interval?: number;
  /**
   * 点击停留 当animate = true 时生效;单位s
   * @default stay = 10
   */
  stay?: number;
  /**
   * 默认样式
   */
  style?: styleProps;
  /**
   * 选中样式
   */
  selectStyle?: styleProps;
  /**
   * 系列配置
   */
  seriesList?: Array<seriesListProps>;
  /**
   * 数据
   */
  data?: Array<dataProps>;
  /**
   * 点击回调
   */
  readonly onClick?: (e: any) => void;
  /**
   * 状态改变回调
   */
  readonly onChange?: (e: any) => void;
}