@arco-design/mobile-react 2.21.0 → 2.21.1

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.
@@ -11,8 +11,7 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
11
11
  maxHeight = props.maxHeight,
12
12
  ellipsisNode = props.ellipsisNode,
13
13
  collapseNode = props.collapseNode,
14
- _props$endExcludes = props.endExcludes,
15
- endExcludes = _props$endExcludes === void 0 ? [] : _props$endExcludes,
14
+ endExcludes = props.endExcludes,
16
15
  reflowOnResize = props.reflowOnResize,
17
16
  onReflow = props.onReflow,
18
17
  onEllipsisNodeClick = props.onEllipsisNodeClick,
@@ -65,7 +64,7 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
65
64
  } // Remove the exclude char at the end of the content.
66
65
 
67
66
 
68
- while (endExcludes.includes(currentText[currentText.length - 1])) {
67
+ while (endExcludes && endExcludes.includes(currentText[currentText.length - 1])) {
69
68
  currentText = currentText.slice(0, -1);
70
69
  } // Callback after reflow.
71
70
 
@@ -28,15 +28,14 @@ var Ellipsis = /*#__PURE__*/forwardRef(function (props, ref) {
28
28
  _props$collapseNode = props.collapseNode,
29
29
  collapseNode = _props$collapseNode === void 0 ? '' : _props$collapseNode,
30
30
  onCollapseNodeClick = props.onCollapseNodeClick,
31
- _props$endExcludes = props.endExcludes,
32
- endExcludes = _props$endExcludes === void 0 ? [] : _props$endExcludes,
31
+ endExcludes = props.endExcludes,
33
32
  _props$reflowOnResize = props.reflowOnResize,
34
33
  reflowOnResize = _props$reflowOnResize === void 0 ? false : _props$reflowOnResize,
35
34
  onReflow = props.onReflow,
36
35
  onEllipsisNodeClick = props.onEllipsisNodeClick;
37
36
  var domRef = useRef(null);
38
37
  var jsEllipsisRef = useRef(null);
39
- var useNativeEllipsis = isSupportWebkitLineClamp() && maxHeight === void 0 && ellipsisNode === '...' && endExcludes.length === 0 && !onReflow && !onEllipsisNodeClick;
38
+ var useNativeEllipsis = isSupportWebkitLineClamp() && maxHeight === void 0 && ellipsisNode === '...' && (!endExcludes || endExcludes.length === 0) && !onReflow && !onEllipsisNodeClick;
40
39
  useImperativeHandle(ref, function () {
41
40
  var _jsEllipsisRef$curren;
42
41
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SearchAssociationBaseItem, SearchBarProps, SearchBarRef } from './type';
3
- export { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAssociationItem, SearchAssociationShowType, SearchBarShape, } from './type';
3
+ export type { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAssociationItem, SearchAssociationShowType, SearchBarShape, } from './type';
4
4
  /**
5
5
  * 搜索栏组件
6
6
  * @en SearchBar component
@@ -8,7 +8,7 @@ import { IconSearch } from '../icon';
8
8
  import { useInputLogic } from '../input/hooks';
9
9
  import { SearchBarAssociation } from './association';
10
10
  import { CancelButton } from './cancel-button';
11
- export { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAssociationItem, SearchAssociationShowType, SearchBarShape } from './type';
11
+
12
12
  /**
13
13
  * 搜索栏组件
14
14
  * @en SearchBar component
@@ -17,7 +17,6 @@ export { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAss
17
17
  * @name 搜索栏
18
18
  * @name_en SearchBar
19
19
  */
20
-
21
20
  var SearchBar = /*#__PURE__*/forwardRef(function (props, ref) {
22
21
  var _useContext = useContext(GlobalContext),
23
22
  prefixCls = _useContext.prefixCls,
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useRef, forwardRef, useImperativeHandle, useEffect, useMemo, useContext, useState } from 'react';
3
- import { nextTick } from '@arco-design/mobile-utils/utils';
4
- import { cls } from '@arco-design/mobile-utils';
3
+ import { nextTick, cls } from '@arco-design/mobile-utils';
5
4
  import { GlobalContext } from '../context-provider';
6
5
  import RenderAction from './item';
7
6
  import { getStyleWithVendor, useLatestRef, useRefState } from '../_helpers';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arco-design/mobile-react",
3
- "version": "2.21.0",
3
+ "version": "2.21.1",
4
4
  "description": "",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -15,7 +15,7 @@
15
15
  "author": "taoyiyue@bytedance.com",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "@arco-design/mobile-utils": "^2.12.0",
18
+ "@arco-design/mobile-utils": "^2.12.1",
19
19
  "@arco-design/transformable": "^1.0.0",
20
20
  "es6-promise": "^4.2.8",
21
21
  "lodash.throttle": "^4.1.1",
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "da7492bd1d018d6b69919a01b2fe2d0f2d7fae0d"
39
+ "gitHead": "9e66fe1e0d0e7891be69203935f00a16027e83a6"
40
40
  }
@@ -34,8 +34,7 @@
34
34
  maxHeight = props.maxHeight,
35
35
  ellipsisNode = props.ellipsisNode,
36
36
  collapseNode = props.collapseNode,
37
- _props$endExcludes = props.endExcludes,
38
- endExcludes = _props$endExcludes === void 0 ? [] : _props$endExcludes,
37
+ endExcludes = props.endExcludes,
39
38
  reflowOnResize = props.reflowOnResize,
40
39
  onReflow = props.onReflow,
41
40
  onEllipsisNodeClick = props.onEllipsisNodeClick,
@@ -88,7 +87,7 @@
88
87
  } // Remove the exclude char at the end of the content.
89
88
 
90
89
 
91
- while (endExcludes.includes(currentText[currentText.length - 1])) {
90
+ while (endExcludes && endExcludes.includes(currentText[currentText.length - 1])) {
92
91
  currentText = currentText.slice(0, -1);
93
92
  } // Callback after reflow.
94
93
 
@@ -54,15 +54,14 @@
54
54
  _props$collapseNode = props.collapseNode,
55
55
  collapseNode = _props$collapseNode === void 0 ? '' : _props$collapseNode,
56
56
  onCollapseNodeClick = props.onCollapseNodeClick,
57
- _props$endExcludes = props.endExcludes,
58
- endExcludes = _props$endExcludes === void 0 ? [] : _props$endExcludes,
57
+ endExcludes = props.endExcludes,
59
58
  _props$reflowOnResize = props.reflowOnResize,
60
59
  reflowOnResize = _props$reflowOnResize === void 0 ? false : _props$reflowOnResize,
61
60
  onReflow = props.onReflow,
62
61
  onEllipsisNodeClick = props.onEllipsisNodeClick;
63
62
  var domRef = (0, _react.useRef)(null);
64
63
  var jsEllipsisRef = (0, _react.useRef)(null);
65
- var useNativeEllipsis = (0, _is.isSupportWebkitLineClamp)() && maxHeight === void 0 && ellipsisNode === '...' && endExcludes.length === 0 && !onReflow && !onEllipsisNodeClick;
64
+ var useNativeEllipsis = (0, _is.isSupportWebkitLineClamp)() && maxHeight === void 0 && ellipsisNode === '...' && (!endExcludes || endExcludes.length === 0) && !onReflow && !onEllipsisNodeClick;
66
65
  (0, _react.useImperativeHandle)(ref, function () {
67
66
  var _jsEllipsisRef$curren;
68
67
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SearchAssociationBaseItem, SearchBarProps, SearchBarRef } from './type';
3
- export { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAssociationItem, SearchAssociationShowType, SearchBarShape, } from './type';
3
+ export type { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAssociationItem, SearchAssociationShowType, SearchBarShape, } from './type';
4
4
  /**
5
5
  * 搜索栏组件
6
6
  * @en SearchBar component
@@ -1,31 +1,25 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["exports", "@babel/runtime/helpers/extends", "@babel/runtime/helpers/objectWithoutPropertiesLoose", "@arco-design/mobile-utils", "react", "../context-provider", "../icon", "../input/hooks", "./association", "./cancel-button", "./type"], factory);
3
+ define(["exports", "@babel/runtime/helpers/extends", "@babel/runtime/helpers/objectWithoutPropertiesLoose", "@arco-design/mobile-utils", "react", "../context-provider", "../icon", "../input/hooks", "./association", "./cancel-button"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(exports, require("@babel/runtime/helpers/extends"), require("@babel/runtime/helpers/objectWithoutPropertiesLoose"), require("@arco-design/mobile-utils"), require("react"), require("../context-provider"), require("../icon"), require("../input/hooks"), require("./association"), require("./cancel-button"), require("./type"));
5
+ factory(exports, require("@babel/runtime/helpers/extends"), require("@babel/runtime/helpers/objectWithoutPropertiesLoose"), require("@arco-design/mobile-utils"), require("react"), require("../context-provider"), require("../icon"), require("../input/hooks"), require("./association"), require("./cancel-button"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
9
9
  };
10
- factory(mod.exports, global._extends, global.objectWithoutPropertiesLoose, global.mobileUtils, global.react, global.contextProvider, global.icon, global.hooks, global.association, global.cancelButton, global.type);
10
+ factory(mod.exports, global._extends, global.objectWithoutPropertiesLoose, global.mobileUtils, global.react, global.contextProvider, global.icon, global.hooks, global.association, global.cancelButton);
11
11
  global.index = mod.exports;
12
12
  }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _objectWithoutPropertiesLoose2, _mobileUtils, _react, _contextProvider, _icon, _hooks, _association, _cancelButton, _type) {
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _objectWithoutPropertiesLoose2, _mobileUtils, _react, _contextProvider, _icon, _hooks, _association, _cancelButton) {
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
17
 
18
18
  _exports.__esModule = true;
19
- _exports.default = _exports.SearchBarShape = _exports.SearchBarRef = _exports.SearchBarProps = _exports.SearchAssociationShowType = _exports.SearchAssociationItem = _exports.SearchAssociationHighlightMode = void 0;
19
+ _exports.default = void 0;
20
20
  _extends2 = _interopRequireDefault(_extends2);
21
21
  _objectWithoutPropertiesLoose2 = _interopRequireDefault(_objectWithoutPropertiesLoose2);
22
22
  _react = _interopRequireWildcard(_react);
23
- _exports.SearchBarProps = _type.SearchBarProps;
24
- _exports.SearchBarRef = _type.SearchBarRef;
25
- _exports.SearchAssociationHighlightMode = _type.SearchAssociationHighlightMode;
26
- _exports.SearchAssociationItem = _type.SearchAssociationItem;
27
- _exports.SearchAssociationShowType = _type.SearchAssociationShowType;
28
- _exports.SearchBarShape = _type.SearchBarShape;
29
23
  var _excluded = ["inputClass", "inputStyle", "type", "nativeProps", "id", "name", "maxLength", "placeholder", "readOnly", "onKeyUp", "onKeyPress", "disabled", "pattern", "prefix", "append", "textAlign", "actionButton", "clearable", "clearShowType", "shape", "className", "enableAssociation", "associationVisible", "associationShowType", "associationItems", "highlightClassName", "highlightMode", "highlightStyle", "onCancel", "onAssociationClick", "onAssociationItemClick", "renderAssociation", "renderAssociationItem"];
30
24
 
31
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -1,16 +1,16 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils/utils", "@arco-design/mobile-utils", "../context-provider", "./item", "../_helpers"], factory);
3
+ define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils", "../context-provider", "./item", "../_helpers"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils/utils"), require("@arco-design/mobile-utils"), require("../context-provider"), require("./item"), require("../_helpers"));
5
+ factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils"), require("../context-provider"), require("./item"), require("../_helpers"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
9
9
  };
10
- factory(mod.exports, global._extends, global.react, global.utils, global.mobileUtils, global.contextProvider, global.item, global._helpers);
10
+ factory(mod.exports, global._extends, global.react, global.mobileUtils, global.contextProvider, global.item, global._helpers);
11
11
  global.index = mod.exports;
12
12
  }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _utils, _mobileUtils, _contextProvider, _item, _helpers) {
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _mobileUtils, _contextProvider, _item, _helpers) {
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -124,7 +124,7 @@
124
124
  var currentMenu = offsetRef.current > 0 ? 'left' : 'right';
125
125
  changeMenu(currentMenu);
126
126
  setMoving(false);
127
- (0, _utils.nextTick)(function () {
127
+ (0, _mobileUtils.nextTick)(function () {
128
128
  forbidClick.current = false;
129
129
  });
130
130
  }