Skip to content

Commit

Permalink
chore: add website
Browse files Browse the repository at this point in the history
  • Loading branch information
wood3n committed Mar 12, 2024
1 parent 545a727 commit adaaf36
Show file tree
Hide file tree
Showing 21 changed files with 305 additions and 233 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy Rspress site to Pages

on:
push:
branches: [master]

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- uses: pnpm/action-setup@v2 # pnpm is optional but recommended, you can also use npm / yarn
with:
version: 6
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: pnpm install
- name: Build with Rspress
run: |
pnpm run build:website
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./website/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"dev": "pnpm --filter @react-filter/core run dev",
"dev:antd": "pnpm --filter @react-filter/antd run dev",
"dev:website": "pnpm --filter website run dev",
"build:core": "pnpm --filter @react-filter/core run build",
"build:antd": "pnpm --filter @react-filter/antd run build",
"build:website": "pnpm --filter website run build",
"lint-fix": "eslint --fix --ext .js,.jsx,.ts,.tsx . && stylelint \"**/*.{css,less}\" --fix",
"prettier": "prettier . --write",
"test": "jest"
Expand Down
1 change: 1 addition & 0 deletions packages/antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"author": "[email protected]",
"license": "MIT",
"description": "react filter component based on antd component library",
"source": "./src/index.ts",
"main": "lib/index.js",
"module": "es/index.js",
"typings": "es/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/antd/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"baseUrl": "./",
"noEmit": false,
"jsx": "preserve",
Expand Down
64 changes: 64 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions website/docs/_meta.json

This file was deleted.

1 change: 0 additions & 1 deletion website/docs/api.md

This file was deleted.

6 changes: 6 additions & 0 deletions website/docs/en/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"text": "getting-started",
"link": "/guide"
}
]
51 changes: 51 additions & 0 deletions website/docs/en/guide.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { PackageManagerTabs } from '@theme';

# Quick start

## Install

<PackageManagerTabs
command={{
npm: 'npm install @react-filter/antd',
yarn: 'yarn add @react-filter/antd',
pnpm: 'pnpm add @react-filter/antd',
}}
/>

## Usage

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

<ReactFilter />;
```

## API

| Props | <div style={{ width: 160 }}>Description</div> | Type | Default Props |
| :------------- | --------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `defaultValue` | component default value after mount | `object` | |
| `value` | component value | `object` | |
| `onChange` | callback when component value change | `(value) => void` | |
| `connectors` | relations of filter groups | `SelectOption[]` | `{ label: '且', value: 'AND' }`<br />`{ label: '或', value: 'OR' }` |
| `operators` | operators of filter item | `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` | field of value | `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;
}
```
2 changes: 0 additions & 2 deletions website/docs/index.md → website/docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ pageType: home

hero:
name: react-filter
text: react-filter docs
tagline: react-filter tagline
actions:
- theme: brand
text: Quick Start
Expand Down
1 change: 0 additions & 1 deletion website/docs/guide/_meta.json

This file was deleted.

Loading

0 comments on commit adaaf36

Please sign in to comment.