Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wood3n committed Mar 12, 2024
1 parent 9450957 commit c0324d9
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 2 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,47 @@
<p align="center">
<img width="200px" height="200px" src="./website/docs//public/react-filter.png">
</p>

## 安装

```shell
pnpm add @react-filter/antd
```

## 使用

```jsx
import { ReactFilter } from '@react-filter/antd';

<ReactFilter />;
```

## API

| 属性 | <div style="width: 160">说明</div> | 类型 | 默认值 |
| :------------- | -------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `defaultValue` | 组件初始化默认值 | `object` | |
| `value` | 组件值 | `object` | |
| `onChange` | 组件值改变回调 | `(value) => void` | |
| `connectors` | 条件组关系,默认且和或 | `SelectOption[]` | `{ label: '且', value: 'AND' }`<br />`{ label: '或', value: 'OR' }` |
| `operators` | 条件表达式操作符,例如`大于``小于`| `SelectOption[]` | `{ label: "等于", "value": "equal"}`<br />`{ "label": "不等于", "value": "not_equal"}`<br />`{ "label": "大于", "value": "greater" }`<br />`{ "label": "大于等于", "value": "greater_equal" }`<br />`{ "label": "小于", "value": "less" }` <br />`{ "label": "小于等于", "value": "less_equal" }`<br />`{ "label": "包含", "value": "in" }`<br />`{ "label": "不包含", "value": "not_in" }`<br />`{ "label": "模糊匹配", "value": "like" }`<br />`{ "label": "不匹配", "value": "not_like" }` |
| `fieldNames` | 组件值字段名称 | `FieldNameMap` | `{connector: 'connector', filters: 'filters', left: 'left', operator: 'operator', value: 'value'}` |

### interface

```typescript
interface SelectOption {
label: React.ReactNode;
value: string | number | boolean;
}
```

```typescript
interface FieldNameMap {
connector?: string;
filters?: string;
left?: string;
operator?: string;
value?: string;
}
```
46 changes: 44 additions & 2 deletions packages/antd/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
# @rc-filter/antd
# @react-filter/antd

## usage
<p align="center">
<img width="200px" height="200px" src="./website/docs//public/react-filter.png">
</p>

## 安装

```shell
pnpm add @react-filter/antd
```

## 使用

```jsx
import { ReactFilter } from '@react-filter/antd';

<ReactFilter />;
```

## API

| 属性 | <div style="width: 160">说明</div> | 类型 | 默认值 |
| :------------- | -------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `defaultValue` | 组件初始化默认值 | `object` | |
| `value` | 组件值 | `object` | |
| `onChange` | 组件值改变回调 | `(value) => void` | |
| `connectors` | 条件组关系,默认且和或 | `SelectOption[]` | `{ label: '且', value: 'AND' }`<br />`{ label: '或', value: 'OR' }` |
| `operators` | 条件表达式操作符,例如`大于``小于`| `SelectOption[]` | `{ label: "等于", "value": "equal"}`<br />`{ "label": "不等于", "value": "not_equal"}`<br />`{ "label": "大于", "value": "greater" }`<br />`{ "label": "大于等于", "value": "greater_equal" }`<br />`{ "label": "小于", "value": "less" }` <br />`{ "label": "小于等于", "value": "less_equal" }`<br />`{ "label": "包含", "value": "in" }`<br />`{ "label": "不包含", "value": "not_in" }`<br />`{ "label": "模糊匹配", "value": "like" }`<br />`{ "label": "不匹配", "value": "not_like" }` |
| `fieldNames` | 组件值字段名称 | `FieldNameMap` | `{connector: 'connector', filters: 'filters', left: 'left', operator: 'operator', value: 'value'}` |

### interface

```typescript
interface SelectOption {
label: React.ReactNode;
value: string | number | boolean;
}
```

```typescript
interface FieldNameMap {
connector?: string;
filters?: string;
left?: string;
operator?: string;
value?: string;
}
```

0 comments on commit c0324d9

Please sign in to comment.