Skip to content

Commit

Permalink
docs: Use dumi (react-component#674)
Browse files Browse the repository at this point in the history
* docs: Use dumi

* chore: add ignore

* chore: fix lint

* chore: ignore debug

* chore: rm debug.md
  • Loading branch information
zombieJ authored Nov 19, 2021
1 parent 1e34025 commit 073edf9
Show file tree
Hide file tree
Showing 58 changed files with 131 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ node_modules
.cache
dist
debug.tsx
debug.md
assets/**/*.css
build
lib
Expand All @@ -37,3 +38,5 @@ tsconfig.test.json
.prettierignore
.storybook
storybook/index.js
.doc
.umi
19 changes: 19 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'rc-select',
favicon:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
logo:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
outputPath: '.doc',
exportStatic: {},
styles: [
`
.markdown table {
width: auto !important;
}
`,
]
});
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ React Select

### basic use

```js
```jsx | pure
import Select, { Option } from 'rc-select';

export default () => (
Expand Down Expand Up @@ -102,11 +102,11 @@ export default () => (
| optionFilterProp | which prop value of option will be used for filter if filterOption is true | String | 'value' |
| filterSort | Sort function for search options sorting, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction. | Function(optionA:Option, optionB: Option) | - |
| optionLabelProp | render option value or option children as content of select | String: 'value'/'children' | 'value' |
| defaultValue | initial selected option(s) | String/Array<String> | - |
| value | current selected option(s) | String/Array<String>/{key:String, label:React.Node}/Array<{key, label}> | - |
| defaultValue | initial selected option(s) | String \| String[] | - |
| value | current selected option(s) | String \| String[] \| {key:String, label:React.Node} \| {key:String, label:React.Node}[] | - |
| labelInValue | whether to embed label in value, see above value type. Not support `combobox` mode | Bool | false |
| backfill | whether backfill select option to search input (Only works in single and combobox mode) | Bool | false |
| onChange | called when select an option or input value change(combobox) | function(value, option:Option/Array<Option>) | - |
| onChange | called when select an option or input value change(combobox) | function(value, option:Option \| Option[]) | - |
| onSearch | called when input changed | function | - |
| onBlur | called when blur | function | - |
| onFocus | called when focus | function | - |
Expand Down
2 changes: 2 additions & 0 deletions docs/demo/auto-adjust-dropdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## auto-adjust-dropdown
<code src="../examples/auto-adjust-dropdown.tsx">
2 changes: 2 additions & 0 deletions docs/demo/combobox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## combobox
<code src="../examples/combobox.tsx">
2 changes: 2 additions & 0 deletions docs/demo/controlled.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## controlled
<code src="../examples/controlled.tsx">
2 changes: 2 additions & 0 deletions docs/demo/custom-icon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## custom-icon
<code src="../examples/custom-icon.tsx">
2 changes: 2 additions & 0 deletions docs/demo/custom-selector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## custom-selector
<code src="../examples/custom-selector.tsx">
2 changes: 2 additions & 0 deletions docs/demo/custom-tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## custom-tags
<code src="../examples/custom-tags.tsx">
2 changes: 2 additions & 0 deletions docs/demo/dropdownRender.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## dropdownRender
<code src="../examples/dropdownRender.tsx">
2 changes: 2 additions & 0 deletions docs/demo/email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## email
<code src="../examples/email.tsx">
2 changes: 2 additions & 0 deletions docs/demo/filterSort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## filterSort
<code src="../examples/filterSort.tsx">
2 changes: 2 additions & 0 deletions docs/demo/force-suggest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## force-suggest
<code src="../examples/force-suggest.tsx">
2 changes: 2 additions & 0 deletions docs/demo/getPopupContainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## getPopupContainer
<code src="../examples/getPopupContainer.tsx">
2 changes: 2 additions & 0 deletions docs/demo/loading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## loading
<code src="../examples/loading.tsx">
2 changes: 2 additions & 0 deletions docs/demo/mul-suggest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## mul-suggest
<code src="../examples/mul-suggest.tsx">
2 changes: 2 additions & 0 deletions docs/demo/mul-tag-suggest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## mul-tag-suggest
<code src="../examples/mul-tag-suggest.tsx">
2 changes: 2 additions & 0 deletions docs/demo/multiple-readonly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## multiple-readonly
<code src="../examples/multiple-readonly.tsx">
2 changes: 2 additions & 0 deletions docs/demo/multiple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## multiple
<code src="../examples/multiple.tsx">
2 changes: 2 additions & 0 deletions docs/demo/optgroup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## optgroup
<code src="../examples/optgroup.tsx">
2 changes: 2 additions & 0 deletions docs/demo/optionFilterProp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## optionFilterProp
<code src="../examples/optionFilterProp.tsx">
2 changes: 2 additions & 0 deletions docs/demo/optionLabelProp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## optionLabelProp
<code src="../examples/optionLabelProp.tsx">
2 changes: 2 additions & 0 deletions docs/demo/single-animation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## single-animation
<code src="../examples/single-animation.tsx">
2 changes: 2 additions & 0 deletions docs/demo/single.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## single
<code src="../examples/single.tsx">
2 changes: 2 additions & 0 deletions docs/demo/singleFieldNames.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## singleFieldNames
<code src="../examples/singleFieldNames.tsx">
2 changes: 2 additions & 0 deletions docs/demo/suggest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## suggest
<code src="../examples/suggest.tsx">
2 changes: 2 additions & 0 deletions docs/demo/tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## tags
<code src="../examples/tags.tsx">
2 changes: 2 additions & 0 deletions docs/demo/update-option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## update-option
<code src="../examples/update-option.tsx">
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

class Test extends React.Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions examples/combobox.tsx → docs/examples/combobox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

class Combobox extends React.Component {
state = {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/controlled.tsx → docs/examples/controlled.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

interface ControlledState {
destroy: boolean;
Expand Down
4 changes: 2 additions & 2 deletions examples/custom-icon.tsx → docs/examples/custom-icon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console, max-classes-per-file */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

const arrowPath =
'M632 888H392c-4.4 0-8 3.6-8 8v32c0 ' +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select from '../src';
import '../assets/index.less';
import Select from 'rc-select';
import '../../assets/index.less';

export default () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions examples/custom-tags.tsx → docs/examples/custom-tags.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';
import type { CustomTagProps } from '../src/interface/generator';

const children = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

const children = [];
for (let i = 10; i < 36; i += 1) {
Expand Down
4 changes: 2 additions & 2 deletions examples/email.tsx → docs/examples/email.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

class Test extends React.Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions examples/filterSort.tsx → docs/examples/filterSort.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Select from '../src';
import '../assets/index.less';
import Select from 'rc-select';
import '../../assets/index.less';

const incidencesStateResource = [
{ value: 4, label: 'Not Identified' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

import { fetch } from './common/tbFetchSuggest';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import '../assets/index.less';
import '../../assets/index.less';
import 'rc-dialog/assets/index.css';

import Dialog from 'rc-dialog';
import React from 'react';
import Select, { Option } from '../src';
import Select, { Option } from 'rc-select';

class Test extends React.Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions examples/loading.tsx → docs/examples/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

class Test extends React.Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions examples/mul-suggest.tsx → docs/examples/mul-suggest.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

import { fetch } from './common/tbFetchSuggest';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

import { fetch } from './common/tbFetchSuggest';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

const children = [];
for (let i = 10; i < 36; i += 1) {
Expand Down
4 changes: 2 additions & 2 deletions examples/multiple.tsx → docs/examples/multiple.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

const children = [];
for (let i = 10; i < 36; i += 1) {
Expand Down
4 changes: 2 additions & 2 deletions examples/optgroup.tsx → docs/examples/optgroup.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option, OptGroup } from '../src';
import '../assets/index.less';
import Select, { Option, OptGroup } from 'rc-select';
import '../../assets/index.less';

function onChange(value, option) {
console.log(`selected ${value}`, option);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

const Test = () => {
const [value, setValue] = React.useState<string>('');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Select from '../src';
import '../assets/index.less';
import Select from 'rc-select';
import '../../assets/index.less';

const data: { value: number; label: string; displayLabel: string }[] = [];
for (let i = 0; i < 10; i += 1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

function onChange(value) {
console.log(`selected ${value}`);
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/single.tsx → docs/examples/single.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';
import './single.less';

class Test extends React.Component {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select from '../src';
import '../assets/index.less';
import Select from 'rc-select';
import '../../assets/index.less';
import './single.less';

export default () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/suggest.tsx → docs/examples/suggest.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

import { fetch } from './common/tbFetchSuggest';

Expand Down
4 changes: 2 additions & 2 deletions examples/tags.tsx → docs/examples/tags.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

const children = [];
for (let i = 10; i < 36; i += 1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import React from 'react';
import Select, { Option } from '../src';
import '../assets/index.less';
import Select, { Option } from 'rc-select';
import '../../assets/index.less';

function handleChange(value) {
console.log(`selected ${value}`);
Expand Down
Loading

0 comments on commit 073edf9

Please sign in to comment.