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

ali-rc-table

v1.0.2

Published

金蝶 react table 组件

Downloads

7

Readme


order: 0 title: 介绍

Table of KDesign

基于金蝶 KDesign 规范实现的 React 表格组件。

官网介绍

https://react.kingdee.design/components/table

安装

该项目不建议直接使用,推荐安装kdcloudjs/kdesign项目,然后再导出其中的Table组件使用。

使用 npm 或 yarn 安装

$ npm install @kdcloudjs/kdesign --save
# 或者
$ yarn add @kdcloudjs/kdesign

示例

import React, { useState } from 'react'
import reactDom from 'react-dom'
import { Table } from '@kdcloudjs/kdesign'
import '@kdcloudjs/kdesign/dist/kdesign.css'

const dataSource = [
  { prov: '湖北省', confirm: 54406, cure: 4793, dead: 1457, t: '2020-02-15 19:52:02' },
  { prov: '广东省', confirm: 1294, cure: 409, dead: 2, t: '2020-02-15 19:52:02' },
  { prov: '河南省', confirm: 1212, cure: 390, dead: 13, t: '2020-02-15 19:52:02' },
  { prov: '浙江省', confirm: 1162, cure: 428, dead: 0, t: '2020-02-15 19:52:02' },
  { prov: '湖南省', confirm: 1001, cure: 417, dead: 2, t: '2020-02-15 19:52:02' }
]

const columns = [
  { code: 'prov', name: '省份', width: 150, features: { sortable: true, filterable: true } },
  { code: 'confirm', name: '确诊', width: 100, align: 'right', features: { sortable: true, filterable: true } },
  { code: 'cure', name: '治愈', width: 100, align: 'right', features: { sortable: true, filterable: true } },
  { code: 'dead', name: '死亡', width: 100, align: 'right', features: { sortable: true, filterable: true } },
  { code: 't', name: '更新时间', width: 180, features: { sortable: true, filterable: true } }
]

reactDom.render(<Table dataSource={dataSource} columns={columns} />, document.getElementById('root'))

浏览器引入

在浏览器中使用 scriptlink 标签直接引入文件,并使用全局变量 kdesign

使用:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>kdesign</title>
    <script src="https://cdn.staticfile.org/react/16.14.0/umd/react.development.js"></script>
    <script src="https://cdn.staticfile.org/react-dom/16.14.0/umd/react-dom.development.js"></script>
    <script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>

    <script src="https://unpkg.com/@kdcloudjs/kdesign@latest/dist/kdesign.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/@kdcloudjs/kdesign@latest/dist/kdesign.min.css" />
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">
      const dataSource = [
        {
          No: 1,
          order: 'AP-202009-00001',
          from: '陕西环宇科技',
          to: '深圳环球科技',
          amount: '26,800.00',
          balance: '500.00'
        },
        {
          No: 2,
          order: 'AP-202009-00001',
          from: '陕西环宇科技',
          to: '深圳环球科技',
          amount: '26,800.00',
          balance: '500.00'
        },
        {
          No: 3,
          order: 'AP-202009-00001',
          from: '陕西环宇科技',
          to: '深圳环球科技',
          amount: '26,800.00',
          balance: '500.00'
        },
        {
          No: 4,
          order: 'AP-202009-00001',
          from: '陕西环宇科技',
          to: '深圳环球科技',
          amount: '26,800.00',
          balance: '500.00'
        },
        {
          No: 5,
          order: 'AP-202009-00001',
          from: '陕西环宇科技',
          to: '深圳环球科技',
          amount: '26,800.00',
          balance: '500.00'
        }
      ]

      const columns = [
        { code: 'No', name: '序号', width: 60, align: 'center' },
        { code: 'order', name: '单据号', width: 200 },
        { code: 'from', name: '来户', width: 200 },
        { code: 'to', name: '往户', width: 200 },
        { code: 'amount', name: '应付金额', width: 100, align: 'right' },
        { code: 'balance', name: '应收余额', width: 100, align: 'right' }
      ]

      ReactDOM.render(
        <kdesign.Table dataSource={dataSource} columns={columns}></kdesign.Table>,
        document.getElementById('root')
      )
    </script>
  </body>
</html>

兼容环境

| IE / Edge | Firefox | Chrome | Safari | iOS Safari | Samsung | Opera | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions |

License

该项目使用了 Apache-2.0. 详细 license 请查看 LICENSE

关于

本项目基于ali-react-table修改,特别鸣谢! 源地址:https://github.com/alibaba/ali-react-table