# antd-utils

> antd-utils

Latest version **0.1.14** (published 2020-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install antd-utils
pnpm add antd-utils
yarn add antd-utils
bun add antd-utils
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.14 |
| Published | 2020-07-08 |
| First published | 2020-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 89.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tony.Xu https://github.com/xunge0613 |
| Maintainers | xunge0613 |
| Keywords | antd, antd-utils, utils, react, typescript, helper |

## Links

- npm: https://www.npmjs.com/package/antd-utils
- Repository: https://github.com/xunge0613/antd-utils-lib
- Homepage: https://github.com/xunge0613/antd-utils-lib#readme
- Issues: https://github.com/xunge0613/antd-utils-lib/issues
- npm.io page: https://npm.io/package/antd-utils

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.10.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.14 (latest) — 2020-07-08
- 0.1.11 — 2020-06-30
- 0.1.10 — 2020-06-30
- 0.1.9 — 2020-06-18
- 0.1.8 — 2020-06-18
- 0.1.6 — 2020-06-18
- 0.1.5 — 2020-06-11
- 0.1.4 — 2020-06-11
- 0.1.3 — 2020-06-11
- 0.1.2 — 2020-06-10
- 0.1.1 — 2020-06-09
- 0.0.4 — 2020-06-08
- 0.0.3 — 2020-06-08
- 0.0.2 — 2020-06-08

## README

# Antd Utils

## 功能概览

| 名称 | 方法名 | 类型 | demo | 稳定版本 |
| :--: |  :--: | :--: | :--: | :--: |
| 表格转置 | transformTable | Table | [文档](https://xunge0613.github.io/antd-utils/demo/src-demos-transform-table) | 0.1.5 |
| 复制 tags | pasteTags |  Select | [文档](https://xunge0613.github.io/antd-utils/demo/src-demos-paste-tags) | 0.1.5 |
| TS 枚举转 select options | enum2Options | Select | [文档](https://xunge0613.github.io/antd-utils/demo/src-demos-transform-table) | 0.1.5 |
| 获取 url 参数 | getQueryString |  Utils | [文档](https://xunge0613.github.io/antd-utils/demo/src-demos-get-querystring/) | 0.1.9 |
| 纵向合并相邻重复单元格 | calcRowspanToMerge | Table | [文档](https://xunge0613.github.io/antd-utils/demo/src-demos-calc-rowspan-to-merge/) | 0.1.11 |

## 编译

``` javascript
npm run compile
npm run compile:w  // 可监听
```

## 测试

``` javascript
npm run test
```

## 打包

``` javascript
npm run build
```

## 自定义打包

``` javascript
// 打包umd格式，兼容浏览器和node环境
npm run dev

// 打包cjs格式
npm run dev:cjs

// 打包es6格式
npm run dev:esm
```

## 发布

``` javascript
npm publish
```

## Getting Started 开始使用

1. Using npm (Recomended)

``` javascript

import AntdUtils from '@antd-utils';
// or
import { transformTable } from '@antd-utils';

```

2. Using `<script>`

Direct import using `<script>`, use `antd-utils.js` or compressed version `antd-utils-min.js`, call `window.AntdUtils.xxx`

浏览器直接引入，使用 `antd-utils.js` 或者压缩版 `antd-utils-min.js`，调用 `window.AntdUtils.xxx`


### 编写工具函数

1. 在src下创建对应函数的文件 xx(工具类，如date)/xxx.ts

2. 在入口文件entry-compiler.ts 导入

``` javascript
import xxx from './xx/xxx.ts'
export = {
    ...
    xxx
}
```

3. 在index.d.ts中添加类型声明， 如

``` javascript
declare namespace AntdUtils {
    ...
    export function xxx():void
}
```

### 编写单元测试用例

1. 在test下创建命名为xx.spec.ts文件，然后写单元测试用例使用mocha

2. 执行 ```npm run test```， 可在终端查看测试通过情况和代码覆盖率

### 编译、打包构建、发布

``` javascript
// 修改提交后，直接执行以下命令，即可完成编译、打包、发布
npm run publish:patch 
npm run publish:minor
npm run publish:major
npm run publish:premajor
```

## 鸣谢

打包构建基于 @ghfengye 的 [https://github.com/ghfengye/mutils](https://github.com/ghfengye/mutils)

## Contact

Feel free to raise issues and contact me

github: [https://github.com/xunge0613](https://github.com/xunge0613)
weibo: [@徐迅爱上大](https://weibo.com/xxdalston)

---
_Source: https://npm.io/package/antd-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
