From af3654160f81ffafc0b78dfb3b6ae57763a7817e Mon Sep 17 00:00:00 2001 From: zombiej Date: Fri, 19 Nov 2021 17:06:07 +0800 Subject: [PATCH 1/5] docs: Use dumi --- .umirc.ts | 19 + README.md | 8 +- docs/demo/auto-adjust-dropdown.md | 2 + docs/demo/combobox.md | 2 + docs/demo/controlled.md | 2 + docs/demo/custom-icon.md | 2 + docs/demo/custom-selector.md | 2 + docs/demo/custom-tags.md | 2 + docs/demo/debug.md | 2 + docs/demo/dropdownRender.md | 2 + docs/demo/email.md | 2 + docs/demo/filterSort.md | 2 + docs/demo/force-suggest.md | 2 + docs/demo/getPopupContainer.md | 2 + docs/demo/loading.md | 2 + docs/demo/mul-suggest.md | 2 + docs/demo/mul-tag-suggest.md | 2 + docs/demo/multiple-readonly.md | 2 + docs/demo/multiple.md | 2 + docs/demo/optgroup.md | 2 + docs/demo/optionFilterProp.md | 2 + docs/demo/optionLabelProp.md | 2 + docs/demo/single-animation.md | 2 + docs/demo/single.md | 2 + docs/demo/singleFieldNames.md | 2 + docs/demo/suggest.md | 2 + docs/demo/tags.md | 2 + docs/demo/update-option.md | 2 + .../examples}/auto-adjust-dropdown.tsx | 4 +- {examples => docs/examples}/combobox.tsx | 4 +- {examples => docs/examples}/common.less | 0 .../examples}/common/tbFetchSuggest.tsx | 0 {examples => docs/examples}/controlled.tsx | 4 +- {examples => docs/examples}/custom-icon.tsx | 4 +- .../examples}/custom-selector.tsx | 4 +- {examples => docs/examples}/custom-tags.tsx | 4 +- .../examples}/dropdownRender.tsx | 4 +- {examples => docs/examples}/email.tsx | 4 +- {examples => docs/examples}/filterSort.tsx | 4 +- {examples => docs/examples}/force-suggest.tsx | 4 +- .../examples}/getPopupContainer.tsx | 4 +- {examples => docs/examples}/loading.tsx | 4 +- {examples => docs/examples}/mul-suggest.tsx | 4 +- .../examples}/mul-tag-suggest.tsx | 4 +- .../examples}/multiple-readonly.tsx | 4 +- {examples => docs/examples}/multiple.tsx | 4 +- {examples => docs/examples}/optgroup.tsx | 4 +- .../examples}/optionFilterProp.tsx | 4 +- .../examples}/optionLabelProp.tsx | 4 +- .../examples}/single-animation.tsx | 4 +- {examples => docs/examples}/single.less | 0 {examples => docs/examples}/single.tsx | 4 +- .../examples}/singleFieldNames.tsx | 4 +- {examples => docs/examples}/suggest.tsx | 4 +- {examples => docs/examples}/tags.tsx | 4 +- {examples => docs/examples}/update-option.tsx | 4 +- package.json | 5 +- src/.umi/core/devScripts.ts | 52 ++ src/.umi/core/history.ts | 24 + src/.umi/core/plugin.ts | 15 + src/.umi/core/pluginConfig.d.ts | 233 ++++++ src/.umi/core/pluginRegister.ts | 4 + src/.umi/core/polyfill.ts | 4 + src/.umi/core/routes.ts | 768 ++++++++++++++++++ src/.umi/core/umiExports.ts | 3 + src/.umi/dumi/apis.json | 1 + src/.umi/dumi/config.json | 168 ++++ src/.umi/dumi/demos/index.ts | 457 +++++++++++ src/.umi/umi.ts | 54 ++ tsconfig.json | 2 +- 70 files changed, 1912 insertions(+), 57 deletions(-) create mode 100644 .umirc.ts create mode 100644 docs/demo/auto-adjust-dropdown.md create mode 100644 docs/demo/combobox.md create mode 100644 docs/demo/controlled.md create mode 100644 docs/demo/custom-icon.md create mode 100644 docs/demo/custom-selector.md create mode 100644 docs/demo/custom-tags.md create mode 100644 docs/demo/debug.md create mode 100644 docs/demo/dropdownRender.md create mode 100644 docs/demo/email.md create mode 100644 docs/demo/filterSort.md create mode 100644 docs/demo/force-suggest.md create mode 100644 docs/demo/getPopupContainer.md create mode 100644 docs/demo/loading.md create mode 100644 docs/demo/mul-suggest.md create mode 100644 docs/demo/mul-tag-suggest.md create mode 100644 docs/demo/multiple-readonly.md create mode 100644 docs/demo/multiple.md create mode 100644 docs/demo/optgroup.md create mode 100644 docs/demo/optionFilterProp.md create mode 100644 docs/demo/optionLabelProp.md create mode 100644 docs/demo/single-animation.md create mode 100644 docs/demo/single.md create mode 100644 docs/demo/singleFieldNames.md create mode 100644 docs/demo/suggest.md create mode 100644 docs/demo/tags.md create mode 100644 docs/demo/update-option.md rename {examples => docs/examples}/auto-adjust-dropdown.tsx (97%) rename {examples => docs/examples}/combobox.tsx (97%) rename {examples => docs/examples}/common.less (100%) rename {examples => docs/examples}/common/tbFetchSuggest.tsx (100%) rename {examples => docs/examples}/controlled.tsx (96%) rename {examples => docs/examples}/custom-icon.tsx (98%) rename {examples => docs/examples}/custom-selector.tsx (82%) rename {examples => docs/examples}/custom-tags.tsx (97%) rename {examples => docs/examples}/dropdownRender.tsx (96%) rename {examples => docs/examples}/email.tsx (93%) rename {examples => docs/examples}/filterSort.tsx (92%) rename {examples => docs/examples}/force-suggest.tsx (95%) rename {examples => docs/examples}/getPopupContainer.tsx (94%) rename {examples => docs/examples}/loading.tsx (95%) rename {examples => docs/examples}/mul-suggest.tsx (93%) rename {examples => docs/examples}/mul-tag-suggest.tsx (94%) rename {examples => docs/examples}/multiple-readonly.tsx (93%) rename {examples => docs/examples}/multiple.tsx (96%) rename {examples => docs/examples}/optgroup.tsx (91%) rename {examples => docs/examples}/optionFilterProp.tsx (91%) rename {examples => docs/examples}/optionLabelProp.tsx (88%) rename {examples => docs/examples}/single-animation.tsx (91%) rename {examples => docs/examples}/single.less (100%) rename {examples => docs/examples}/single.tsx (97%) rename {examples => docs/examples}/singleFieldNames.tsx (91%) rename {examples => docs/examples}/suggest.tsx (95%) rename {examples => docs/examples}/tags.tsx (97%) rename {examples => docs/examples}/update-option.tsx (94%) create mode 100644 src/.umi/core/devScripts.ts create mode 100644 src/.umi/core/history.ts create mode 100644 src/.umi/core/plugin.ts create mode 100644 src/.umi/core/pluginConfig.d.ts create mode 100644 src/.umi/core/pluginRegister.ts create mode 100644 src/.umi/core/polyfill.ts create mode 100644 src/.umi/core/routes.ts create mode 100644 src/.umi/core/umiExports.ts create mode 100644 src/.umi/dumi/apis.json create mode 100644 src/.umi/dumi/config.json create mode 100644 src/.umi/dumi/demos/index.ts create mode 100644 src/.umi/umi.ts diff --git a/.umirc.ts b/.umirc.ts new file mode 100644 index 000000000..30754d85f --- /dev/null +++ b/.umirc.ts @@ -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; + } + `, + ] +}); \ No newline at end of file diff --git a/README.md b/README.md index 8d99f55b5..e500f50d5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ React Select ### basic use -```js +```jsx | pure import Select, { Option } from 'rc-select'; export default () => ( @@ -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 | - | -| value | current selected option(s) | String/Array/{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