Skip to content

Commit d9176d3

Browse files
committed
init;
1 parent cf88743 commit d9176d3

File tree

19 files changed

+685
-1
lines changed

19 files changed

+685
-1
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.fatherrc.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default {
2+
esm: 'babel',
3+
cjs: 'babel',
4+
lessInBabelMode: true,
5+
extraBabelPlugins: [
6+
[
7+
'babel-plugin-import',
8+
{
9+
libraryName: 'antd',
10+
libraryDirectory: 'es',
11+
style: true,
12+
},
13+
],
14+
],
15+
};

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/npm-debug.log*
6+
/yarn-error.log
7+
/yarn.lock
8+
/package-lock.json
9+
10+
# production
11+
/es
12+
/docs-dist
13+
14+
# misc
15+
.DS_Store
16+
/coverage
17+
18+
# umi
19+
.umi
20+
.umi-production
21+
.umi-test
22+
.env.local
23+
24+
# ide
25+
/.vscode
26+
/.idea

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/*.svg
2+
**/*.ejs
3+
**/*.html
4+
package.json
5+
.umi
6+
.umi-production
7+
.umi-test

.prettierrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@umijs/fabric').prettier;

.umirc.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig } from 'dumi';
2+
3+
export default defineConfig({
4+
title: 'antd-debounce-select',
5+
favicon:
6+
'https://avatars.githubusercontent.com/u/35691153?s=400&u=a0173e2ecd400de3e7ad38cde996f4cbaf777b2b&v=4',
7+
logo: 'https://avatars.githubusercontent.com/u/35691153?s=400&u=a0173e2ecd400de3e7ad38cde996f4cbaf777b2b&v=4',
8+
outputPath: 'docs-dist',
9+
mode: 'site',
10+
// more config: https://d.umijs.org/config
11+
extraBabelPlugins: [
12+
[
13+
'babel-plugin-import',
14+
{
15+
libraryName: 'antd',
16+
libraryDirectory: 'es',
17+
style: true,
18+
},
19+
],
20+
],
21+
apiParser: {
22+
propFilter: {
23+
skipNodeModules: true,
24+
},
25+
},
26+
});

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
11
# antd-debounce-select
2-
Antd Select that supports remote search and pagination loading.
2+
3+
## Getting Started
4+
5+
Install dependencies,
6+
7+
```bash
8+
$ npm i
9+
```
10+
11+
Start the dev server,
12+
13+
```bash
14+
$ npm start
15+
```
16+
17+
Build documentation,
18+
19+
```bash
20+
$ npm run docs:build
21+
```
22+
23+
Run test,
24+
25+
```bash
26+
$ npm test
27+
```
28+
29+
Build library via `father-build`,
30+
31+
```bash
32+
$ npm run build
33+
```

docs/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
hero:
3+
title: antd-debounce-select
4+
desc: antd-debounce-select site example
5+
actions:
6+
- text: Getting Started
7+
link: /components
8+
features:
9+
- icon: https://gw.alipayobjects.com/zos/bmw-prod/881dc458-f20b-407b-947a-95104b5ec82b/k79dm8ih_w144_h144.png
10+
title: Feature 1
11+
desc: Balabala
12+
- icon: https://gw.alipayobjects.com/zos/bmw-prod/d60657df-0822-4631-9d7c-e7a869c2f21c/k79dmz3q_w126_h126.png
13+
title: Feature 2
14+
desc: Balabala
15+
- icon: https://gw.alipayobjects.com/zos/bmw-prod/d1ee0c6f-5aed-4a45-a507-339a4bfe076c/k7bjsocq_w144_h144.png
16+
title: Feature 3
17+
desc: Balabala
18+
footer: Open-source MIT Licensed | Copyright © 2020<br />Powered by [dumi](https://d.umijs.org)
19+
---
20+
21+
## Hello antd-debounce-select!

lib/DebounceSelect/index.d.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React from 'react';
2+
export declare type SelectOption = {
3+
label: string;
4+
value: string;
5+
};
6+
export declare type Page = {
7+
offset: number;
8+
limit: number;
9+
};
10+
declare type DebounceSelectProps = {
11+
/**
12+
* If you need multiple selections, set mode="multiple", otherwise you don`t need to set,
13+
* and it should be noted that the value of multiple selections is string[], and the single selection is string.
14+
*/
15+
mode?: 'multiple';
16+
/**
17+
* Multiple selection is string[], single selection is string.
18+
*/
19+
value: string | string[];
20+
/**
21+
* The default is 10, you don't need to set it, if you need to save http resources, set it at will.
22+
*/
23+
pageSize?: number;
24+
/**
25+
* A setting necessary so that the component can tell if more can be loaded.
26+
*/
27+
total: number;
28+
/**
29+
* Set the time of the function debounce.
30+
*/
31+
debounceTimeout?: number;
32+
/**
33+
* The callback after selecting options, you need to set it as value.
34+
*/
35+
onChange: (newValue: string | string[]) => void;
36+
/**
37+
* In this callback function, the http request is made,
38+
* and the options of the next page are obtained according to the Page parameter and searchKey, which will be pushed.
39+
*/
40+
fetchOptions: (search: string, page: Page) => Promise<SelectOption[]>;
41+
};
42+
export declare const DebounceSelect: React.FC<DebounceSelectProps>;
43+
export {};

lib/DebounceSelect/index.js

Lines changed: 219 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)