@rc-component/select 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # rc-select
1
+ # @rc-component/select
2
2
 
3
3
  ---
4
4
 
@@ -12,22 +12,20 @@ React Select Component.
12
12
  [![bundle size][bundlephobia-image]][bundlephobia-url]
13
13
  [![dumi][dumi-image]][dumi-url]
14
14
 
15
- [npm-image]: http://img.shields.io/npm/v/rc-select.svg?style=flat-square
16
- [npm-url]: http://npmjs.org/package/rc-select
17
- [travis-image]: https://img.shields.io/travis/react-component/select/master?style=flat-square
18
- [travis-url]: https://travis-ci.com/react-component/select
19
- [github-actions-image]: https://github.com/react-component/select/workflows/CI/badge.svg
20
- [github-actions-url]: https://github.com/react-component/select/actions
15
+ [npm-image]: https://img.shields.io/npm/v/@rc-component/select.svg?style=flat-square
16
+ [npm-url]: http://npmjs.org/package/@rc-component/select
17
+ [github-actions-image]: https://github.com/react-component/select/actions/workflows/test.yml/badge.svg
18
+ [github-actions-url]: https://github.com/react-component/select/actions/workflows/test.yml
21
19
  [codecov-image]: https://img.shields.io/codecov/c/github/react-component/select/master.svg?style=flat-square
22
20
  [codecov-url]: https://app.codecov.io/gh/react-component/select
23
21
  [david-url]: https://david-dm.org/react-component/select
24
22
  [david-image]: https://david-dm.org/react-component/select/status.svg?style=flat-square
25
23
  [david-dev-url]: https://david-dm.org/react-component/select?type=dev
26
24
  [david-dev-image]: https://david-dm.org/react-component/select/dev-status.svg?style=flat-square
27
- [download-image]: https://img.shields.io/npm/dm/rc-select.svg?style=flat-square
28
- [download-url]: https://npmjs.org/package/rc-select
29
- [bundlephobia-url]: https://bundlephobia.com/package/rc-select
30
- [bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-select
25
+ [download-image]: https://img.shields.io/npm/dm/@rc-component/select.svg?style=flat-square
26
+ [download-url]: https://npmjs.org/package/@rc-component/select
27
+ [bundlephobia-url]: https://bundlephobia.com/package/@rc-component/select
28
+ [bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/select
31
29
  [dumi-url]: https://github.com/umijs/dumi
32
30
  [dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
33
31
 
@@ -46,15 +44,15 @@ React Select Component.
46
44
 
47
45
  ## install
48
46
 
49
- [![rc-select](https://nodei.co/npm/rc-select.png)](https://npmjs.org/package/rc-select)
47
+ [![@rc-component/select](https://nodei.co/npm/@rc-component/select.png)](https://npmjs.org/package/@rc-component/select)
50
48
 
51
49
  ## Usage
52
50
 
53
51
  ### basic use
54
52
 
55
53
  ```jsx | pure
56
- import Select, { Option } from 'rc-select';
57
- import 'rc-select/assets/index.css';
54
+ import Select, { Option } from '@rc-component/select';
55
+ import '@rc-component/select/assets/index.css';
58
56
 
59
57
  export default () => (
60
58
  <Select>
@@ -178,7 +176,7 @@ npm start
178
176
 
179
177
  local example: http://localhost:9001/
180
178
 
181
- online example: http://select.react-component.now.sh/
179
+ online example: https://select-react-component.vercel.app/
182
180
 
183
181
  ## Test Case
184
182
 
@@ -194,4 +192,4 @@ npm run coverage
194
192
 
195
193
  ## License
196
194
 
197
- rc-select is released under the MIT license.
195
+ @rc-component/select is released under the MIT license.
@@ -106,7 +106,8 @@ export default /*#__PURE__*/React.forwardRef(function SelectInput(props, ref) {
106
106
  // ====================== Open ======================
107
107
  const onInternalMouseDown = useEvent(event => {
108
108
  if (!disabled) {
109
- if (event.target !== getDOM(inputRef.current)) {
109
+ const inputDOM = getDOM(inputRef.current);
110
+ if (inputDOM && event.target !== inputDOM && !inputDOM.contains(event.target)) {
110
111
  event.preventDefault();
111
112
  }
112
113
 
@@ -115,7 +115,8 @@ var _default = exports.default = /*#__PURE__*/React.forwardRef(function SelectIn
115
115
  // ====================== Open ======================
116
116
  const onInternalMouseDown = (0, _util.useEvent)(event => {
117
117
  if (!disabled) {
118
- if (event.target !== (0, _findDOMNode.getDOM)(inputRef.current)) {
118
+ const inputDOM = (0, _findDOMNode.getDOM)(inputRef.current);
119
+ if (inputDOM && event.target !== inputDOM && !inputDOM.contains(event.target)) {
119
120
  event.preventDefault();
120
121
  }
121
122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/select",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "React Select",
5
5
  "engines": {
6
6
  "node": ">=8.x"
@@ -49,7 +49,6 @@
49
49
  "react-dom": "*"
50
50
  },
51
51
  "dependencies": {
52
- "@rc-component/motion": "^1.1.4",
53
52
  "@rc-component/trigger": "^3.0.0",
54
53
  "@rc-component/util": "^1.3.0",
55
54
  "clsx": "^2.1.1",
@@ -65,12 +64,10 @@
65
64
  "@types/node": "^24.5.2",
66
65
  "@types/react": "^18.3.0",
67
66
  "@types/react-dom": "^18.3.0",
67
+ "@umijs/fabric": "^4.0.1",
68
68
  "babel-jest": "^29.6.1",
69
- "cross-env": "^7.0.0",
70
69
  "dumi": "^2.2.13",
71
70
  "eslint": "^8.55.0",
72
- "eslint-plugin-jest": "^28.8.1",
73
- "eslint-plugin-unicorn": "^56.0.0",
74
71
  "father": "^4.0.0",
75
72
  "husky": "^9.1.5",
76
73
  "jsonp": "^0.2.1",