@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.
- package/CHANGELOG.md +13 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/ellipsis/components/js-ellipsis.js +2 -3
- package/cjs/ellipsis/index.js +2 -3
- package/cjs/search-bar/index.d.ts +1 -1
- package/cjs/search-bar/index.js +1 -9
- package/cjs/swipe-action/index.js +1 -3
- package/dist/index.js +37 -52
- package/dist/index.min.js +2 -2
- package/esm/ellipsis/components/js-ellipsis.js +2 -3
- package/esm/ellipsis/index.js +2 -3
- package/esm/search-bar/index.d.ts +1 -1
- package/esm/search-bar/index.js +1 -2
- package/esm/swipe-action/index.js +1 -2
- package/package.json +3 -3
- package/umd/ellipsis/components/js-ellipsis.js +2 -3
- package/umd/ellipsis/index.js +2 -3
- package/umd/search-bar/index.d.ts +1 -1
- package/umd/search-bar/index.js +5 -11
- package/umd/swipe-action/index.js +5 -5
@@ -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
|
-
|
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
|
|
package/esm/ellipsis/index.js
CHANGED
@@ -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
|
-
|
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
|
package/esm/search-bar/index.js
CHANGED
@@ -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
|
-
|
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
|
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.
|
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.
|
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": "
|
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
|
-
|
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
|
|
package/umd/ellipsis/index.js
CHANGED
@@ -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
|
-
|
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
|
package/umd/search-bar/index.js
CHANGED
@@ -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"
|
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")
|
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
|
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
|
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 =
|
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
|
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
|
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.
|
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,
|
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,
|
127
|
+
(0, _mobileUtils.nextTick)(function () {
|
128
128
|
forbidClick.current = false;
|
129
129
|
});
|
130
130
|
}
|