9 |
--------------------------------------------------------------------------------
/docs/demo/focus.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: focus
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/tags.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: tags
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | hero:
3 | title: rc-select
4 | description: React Select Component
5 | ---
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.fatherrc.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'father';
2 |
3 | export default defineConfig({
4 | plugins: ['@rc-component/father-plugin'],
5 | });
6 |
--------------------------------------------------------------------------------
/docs/demo/loading.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: loading
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/single.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: single
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/suggest.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: suggest
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/combobox.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: combobox
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/multiple.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: multiple
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/optgroup.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: optgroup
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | setupFilesAfterEnv: ['
9 |
--------------------------------------------------------------------------------
/docs/demo/filterSort.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: filterSort
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .doc
2 | .storybook
3 | es
4 | lib
5 | **/*.svg
6 | **/*.ejs
7 | **/*.html
8 | package.json
9 | .umi
10 | .umi-production
11 | .umi-test
12 |
--------------------------------------------------------------------------------
/docs/demo/custom-icon.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom-icon
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/custom-label.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom-label
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/custom-tags.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom-tags
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/mul-suggest.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: mul-suggest
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/force-suggest.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: force-suggest
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/option-render.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: optionRender
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/update-option.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: update-option
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/utils/platformUtil.ts:
--------------------------------------------------------------------------------
1 | /* istanbul ignore file */
2 | export function isPlatformMac(): boolean {
3 | return /(mac\sos|macintosh)/i.test(navigator.appVersion);
4 | }
5 |
--------------------------------------------------------------------------------
/docs/demo/custom-selector.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom-selector
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/dropdownRender.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: dropdownRender
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/mul-tag-suggest.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: mul-tag-suggest
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/optionLabelProp.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: optionLabelProp
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/scroll-loading.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: scroll loading
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/auto-tokenization.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: auto-tokenization
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/getPopupContainer.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: getPopupContainer
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/multiple-readonly.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: multiple-readonly
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/optionFilterProp.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: optionFilterProp
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/single-animation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: single-animation
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/singleFieldNames.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: singleFieldNames
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: ✅ test
2 | on: [push, pull_request]
3 | jobs:
4 | test:
5 | uses: react-component/rc-test/.github/workflows/test.yml@main
6 | secrets: inherit
7 |
--------------------------------------------------------------------------------
/docs/demo/auto-adjust-dropdown.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: auto-adjust-dropdown
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/multiple-with-maxCount.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: multiple-with-maxCount
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "endOfLine": "lf",
3 | "semi": true,
4 | "singleQuote": true,
5 | "tabWidth": 2,
6 | "trailingComma": "all",
7 | "proseWrap": "never",
8 | "printWidth": 100
9 | }
10 |
--------------------------------------------------------------------------------
/tests/__snapshots__/Multiple.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Select.Multiple max tag render truncates values by maxTagTextLength 1`] = `
4 | [
5 | "On...",
6 | "Tw...",
7 | ]
8 | `;
9 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | # Unix-style newlines with a newline ending every file
5 | [*.{js,css}]
6 | end_of_line = lf
7 | insert_final_newline = true
8 | indent_style = space
9 | indent_size = 2
10 |
--------------------------------------------------------------------------------
/typings/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'react-lifecycles-compat';
2 |
3 | declare module 'component-classes';
4 |
5 | declare module 'rc-menu';
6 |
7 | declare module '@rc-component/util/lib/Children/toArray';
8 |
9 | declare module 'dom-scroll-into-view';
10 |
--------------------------------------------------------------------------------
/.dumirc.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'dumi';
2 |
3 | export default defineConfig({
4 | favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
5 | themeConfig: {
6 | name: 'Select',
7 | logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
8 | },
9 | outputPath: '.doc',
10 | });
11 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | const base = require('@umijs/fabric/dist/eslint');
2 |
3 | module.exports = {
4 | ...base,
5 | rules: {
6 | ...base.rules,
7 | 'default-case': 0,
8 | 'react/sort-comp': 0,
9 | 'jsx-a11y/interactive-supports-focus': 0,
10 | 'jsx-a11y/no-autofocus': 0,
11 | 'react/no-unknown-property': 0,
12 | },
13 | };
14 |
--------------------------------------------------------------------------------
/tests/__mocks__/@rc-component/trigger.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Trigger from '@rc-component/trigger/lib/mock';
3 | import type { TriggerProps, TriggerRef } from '@rc-component/trigger';
4 |
5 | export default React.forwardRef