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

boolean-ftl

v0.0.5

Published

A react library developed with dumi

Downloads

2

Readme

boolean-ftl

📦 安装

npm install boolean-ftl --save

# 或者使用 yarn
yarn add boolean-ftl

# 或者使用 cnpm
cnpm install boolean-ftl --save

# 或者使用 pnpm
pnpm install boolean-ftl --save

⚙️ 配置

SearchList 组件支持以下配置项:

  • url(必需):请求数据的 API 地址。
  • searchSchema(必需):搜索表单的配置数组。
  • tableColumns(必需):表格列的配置数组。

🔨 使用

import { SearchList } from 'boolean-ftl';
import { Card } from 'antd';
import { useState, useEffect } from 'react';

const List = () => {
  // 表格列配置
  const tableSchema = [
    {
      title: 'id',
      dataIndex: 'id',
    },
    {
      title: '姓名',
      dataIndex: 'name',
    },
    {
      title: '年龄',
      dataIndex: 'age',
    }
  ];
  // 搜索表单配置
  const searchSchemaArr = [
    {
      label: '输入框',
      type: 'input',
      key: 'input',
    },
    {
      label: '选择框',
      type: 'select',
      key: 'select',
      oplist: [
        {
          name: '选项1',
          value: '1',
        },
        {
          name: '选项2',
          value: '2',
        },
      ],
    },
    {
      label: '时间',
      type: 'rangePicker',
      key: 'rangePicker',
    },
  ];
  return (
    <Card>
      <SearchList
        url="/api/list"
        searchSchema={searchSchemaArr}
        tableColumns={tableSchema}
      />
    </Card>
  );
};
export default List;

API

SearchList Props

| 属性名 | 类型 | 默认值 | 说明 | | ------------ | ------------- | ------ | ------------------------------------------------- | | url | string (必需) | - | 数据请求的 API 端点 URL | | tableColumns | array (必需) | - | 表格列的定义,包括标题、数据字段等 | | searchSchema | array (可选) | - | 搜索表单的配置,用于筛选数据 | | exportUrl | string (可选) | - | 导出数据的 API 端点 URL | | pagination | boolean (可选) | true | 是否显示分页器 | | mergeData | object (可选) | - | 用于合并数据的配置,包括要合并的列和唯一索引键 | | useCache | boolean (可选) | false | 是否启用搜索数据的缓存 | | cacheId | string (可选) | - | 缓存标识符,用于唯一标识缓存数据 | | pageSizeKey | string (可选) | 'limit' | 列表每页数量的键名 | | pageKey | string (可选) | 'page' | 列表页码的键名 | | getTableData | function (可选) | - | 用于获取列表数据的回调函数 |