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 🙏

© 2026 – Pkg Stats / Ryan Hefner

coupon-applicate-scope

v1.0.0

Published

优惠券适用范围选择组件

Readme

CouponApplicateScope

优惠券适用范围选择组件,支持自定义标签、随单发放条件说明、只读模式等功能。

安装

npm install coupon-applicate-scope

导入

import CouponApplicateScope from 'coupon-applicate-scope';

使用

import React from 'react';
import { Form } from 'antd';
import CouponApplicateScope from 'coupon-applicate-scope';

const App = () => {
  const [form] = Form.useForm();

  return (
    <Form form={form}>
      <CouponApplicateScope
        formRef={form}
        initNum={1}
        label="适用商品"
        tooltip="选择商品适用范围"
        disabled={false}
        onlyview={false}
      />
    </Form>
  );
};

export default App;

Props

| 属性 | 类型 | 描述 | 默认值 | | --- | --- | --- | --- | | formRef | any | 表单引用 | 必需 | | initNum | number | 初始化次数 | 必需 | | showScope5 | boolean | 是否显示指定商品不可用选项 | false | | disabled | boolean | 是否禁用 | false | | onlyview | boolean | 是否只读模式 | false | | fromPage | 'prize' | 来源页面 | undefined | | label | string | 自定义标签 | '适用商品' | | tooltip | string | 说明文案 | undefined |

功能

  1. 支持选择全部商品、指定品牌、指定品类、指定商品等多种适用范围
  2. 支持自定义标签和说明文案
  3. 支持只读模式,所有操作不可编辑
  4. 支持随单发放条件说明
  5. 支持业务线切换时清空适用商品相关信息

注意事项

  1. 组件依赖 antd 5.x 版本
  2. 组件需要配合 Form 使用,需要传入 formRef
  3. 当 onlyview 为 true 时,所有操作都会被禁用,包括选择、删除、清空等