@sheinx/base 3.4.4-beta.11 → 3.4.4-beta.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"absolute-context.d.ts","sourceRoot":"","sources":["absolute-context.tsx"],"names":[],"mappings":";AAIA,QAAA,MAAM,eAAe,kCAAgC,CAAC;AAEtD,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"absolute-context.d.ts","sourceRoot":"","sources":["absolute-context.tsx"],"names":[],"mappings":";AAIA,QAAA,MAAM,eAAe,kCAAgC,CAAC;AAItD,eAAe,eAAe,CAAC"}
@@ -7,4 +7,5 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var AbsoluteContext = /*#__PURE__*/(0, _react.createContext)(false);
10
+ AbsoluteContext.displayName = 'AbsoluteContext';
10
11
  var _default = exports.default = AbsoluteContext;
@@ -1 +1 @@
1
- {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,QAAA,MAAM,MAAM,uEA2XX,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,QAAA,MAAM,MAAM,uEA8XX,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -295,16 +295,19 @@ var Result = function Result(props) {
295
295
  }
296
296
 
297
297
  // 单选场景下,焦点时自动选中input文本
298
- if (focus && showInput && mounted.current) {
299
- var nextValue = getValueArr(value);
300
- props.setInputText(nextValue[0]);
298
+ if (!multiple && focus && showInput && mounted.current) {
299
+ var _result2 = getDataByValues(value);
300
+ if (_result2.length > 0) {
301
+ var inputTmpText = renderResultContent(_result2[0]);
302
+ inputTmpText && props.setInputText(inputTmpText);
303
+ }
301
304
  setTimeout(function () {
302
305
  var _inputRef$current;
303
306
  inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.select();
304
307
  }, 10);
305
308
  }
306
309
  mounted.current = true;
307
- }, [focus, showInput]);
310
+ }, [focus, placeholder, multiple]);
308
311
  (0, _react.useLayoutEffect)(function () {
309
312
  handleResetMore();
310
313
  }, [valueProp, data]);
@@ -1 +1 @@
1
- {"version":3,"file":"absolute-context.d.ts","sourceRoot":"","sources":["absolute-context.tsx"],"names":[],"mappings":";AAIA,QAAA,MAAM,eAAe,kCAAgC,CAAC;AAEtD,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"absolute-context.d.ts","sourceRoot":"","sources":["absolute-context.tsx"],"names":[],"mappings":";AAIA,QAAA,MAAM,eAAe,kCAAgC,CAAC;AAItD,eAAe,eAAe,CAAC"}
@@ -2,4 +2,5 @@
2
2
 
3
3
  import { createContext } from 'react';
4
4
  var AbsoluteContext = /*#__PURE__*/createContext(false);
5
+ AbsoluteContext.displayName = 'AbsoluteContext';
5
6
  export default AbsoluteContext;
@@ -1 +1 @@
1
- {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,QAAA,MAAM,MAAM,uEA2XX,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,QAAA,MAAM,MAAM,uEA8XX,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -287,16 +287,19 @@ var Result = function Result(props) {
287
287
  }
288
288
 
289
289
  // 单选场景下,焦点时自动选中input文本
290
- if (focus && showInput && mounted.current) {
291
- var nextValue = getValueArr(value);
292
- props.setInputText(nextValue[0]);
290
+ if (!multiple && focus && showInput && mounted.current) {
291
+ var _result2 = getDataByValues(value);
292
+ if (_result2.length > 0) {
293
+ var inputTmpText = renderResultContent(_result2[0]);
294
+ inputTmpText && props.setInputText(inputTmpText);
295
+ }
293
296
  setTimeout(function () {
294
297
  var _inputRef$current;
295
298
  inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.select();
296
299
  }, 10);
297
300
  }
298
301
  mounted.current = true;
299
- }, [focus, showInput]);
302
+ }, [focus, placeholder, multiple]);
300
303
  useLayoutEffect(function () {
301
304
  handleResetMore();
302
305
  }, [valueProp, data]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.4.4-beta.11",
3
+ "version": "3.4.4-beta.12",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.4.4-beta.11",
13
+ "@sheinx/hooks": "3.4.4-beta.12",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"