@arco-design/mobile-react 2.30.5 → 2.30.6
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/checkbox/style/css/index.css +3 -0
- package/cjs/checkbox/style/index.less +5 -0
- package/cjs/date-picker/index.js +46 -29
- package/cjs/dropdown-menu/helper.d.ts +1 -6
- package/cjs/dropdown-menu/helper.js +0 -10
- package/cjs/ellipsis/components/js-ellipsis.js +14 -17
- package/cjs/radio/style/css/index.css +3 -0
- package/cjs/radio/style/index.less +5 -0
- package/cjs/show-monitor/index.d.ts +5 -0
- package/cjs/show-monitor/index.js +1 -0
- package/dist/index.js +52 -31
- package/dist/index.min.js +2 -2
- package/dist/style.css +6 -0
- package/dist/style.min.css +1 -1
- package/esm/checkbox/style/css/index.css +3 -0
- package/esm/checkbox/style/index.less +5 -0
- package/esm/date-picker/index.js +44 -26
- package/esm/dropdown-menu/helper.d.ts +1 -6
- package/esm/dropdown-menu/helper.js +0 -8
- package/esm/ellipsis/components/js-ellipsis.js +14 -17
- package/esm/radio/style/css/index.css +3 -0
- package/esm/radio/style/index.less +5 -0
- package/esm/show-monitor/index.d.ts +5 -0
- package/esm/show-monitor/index.js +1 -0
- package/package.json +3 -3
- package/umd/checkbox/style/css/index.css +3 -0
- package/umd/checkbox/style/index.less +5 -0
- package/umd/date-picker/index.js +47 -30
- package/umd/dropdown-menu/helper.d.ts +1 -6
- package/umd/dropdown-menu/helper.js +0 -10
- package/umd/ellipsis/components/js-ellipsis.js +14 -17
- package/umd/radio/style/css/index.css +3 -0
- package/umd/radio/style/index.less +5 -0
- package/umd/show-monitor/index.d.ts +5 -0
- package/umd/show-monitor/index.js +1 -0
package/esm/date-picker/index.js
CHANGED
@@ -71,10 +71,8 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
71
71
|
});
|
72
72
|
|
73
73
|
function _getColumns() {
|
74
|
-
var dateObj =
|
75
|
-
|
76
|
-
dateObj[type] = _getActualArray(type, currentDateObjRef.current);
|
77
|
-
});
|
74
|
+
var dateObj = _getActualArray();
|
75
|
+
|
78
76
|
var columns = keyOptions.map(function (opt) {
|
79
77
|
return dateObj[opt];
|
80
78
|
});
|
@@ -118,32 +116,52 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
118
116
|
// @en Dynamically change the options of other columns based on the currently selected date
|
119
117
|
|
120
118
|
|
121
|
-
function _getActualArray(
|
122
|
-
var
|
123
|
-
|
124
|
-
var range = [];
|
119
|
+
function _getActualArray() {
|
120
|
+
var dateObj = {}; // 当前时间对象
|
121
|
+
// @en current Date object
|
125
122
|
|
126
|
-
|
127
|
-
case 'year':
|
128
|
-
range = [minDateObjRef.current.year, maxDateObjRef.current.year];
|
129
|
-
break;
|
130
|
-
|
131
|
-
default:
|
132
|
-
{
|
133
|
-
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
134
|
-
range = normalRange;
|
123
|
+
var currentDateObj = _extends({}, currentDateObjRef.current);
|
135
124
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
125
|
+
allTypes.forEach(function (type) {
|
126
|
+
// 根据日期类型,计算出默认的日期范围
|
127
|
+
// @en According to the date type, calculate the default date range.
|
128
|
+
var normalRange = _getNormalRange(type, currentDateObj);
|
129
|
+
|
130
|
+
var range = [];
|
131
|
+
|
132
|
+
switch (type) {
|
133
|
+
case 'year':
|
134
|
+
// 默认使用minTs和maxTs年份区间
|
135
|
+
// @en Default use minTs and maxTs years.
|
136
|
+
range = [minDateObjRef.current.year, maxDateObjRef.current.year];
|
137
|
+
break;
|
138
|
+
|
139
|
+
default:
|
140
|
+
{
|
141
|
+
// 除了年份外,其他日期类型都需要判断上一级日期是否相同
|
142
|
+
// @en In addition to the year, other date types need to check if the upper-level date is the same.
|
143
|
+
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
144
|
+
range = normalRange;
|
145
|
+
|
146
|
+
if (judgeObj(currentDateObj, minDateObjRef.current, checkKeys)) {
|
147
|
+
var _extends2;
|
148
|
+
|
149
|
+
range[0] = minDateObjRef.current[type];
|
150
|
+
currentDateObj = _extends({}, currentDateObj, (_extends2 = {}, _extends2[type] = Math.max(minDateObjRef.current[type], currentDateObj[type]), _extends2));
|
151
|
+
}
|
152
|
+
|
153
|
+
if (judgeObj(currentDateObj, maxDateObjRef.current, checkKeys)) {
|
154
|
+
var _extends3;
|
155
|
+
|
156
|
+
range[range.length - 1] = maxDateObjRef.current[type];
|
157
|
+
currentDateObj = _extends({}, currentDateObj, (_extends3 = {}, _extends3[type] = Math.min(maxDateObjRef.current[type], currentDateObj[type]), _extends3));
|
158
|
+
}
|
142
159
|
}
|
143
|
-
|
144
|
-
}
|
160
|
+
}
|
145
161
|
|
146
|
-
|
162
|
+
dateObj[type] = _convertRangeToArr(type, range);
|
163
|
+
});
|
164
|
+
return dateObj;
|
147
165
|
}
|
148
166
|
|
149
167
|
function _convertRangeToArr(type, range) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react';
|
2
2
|
import { OptionsItem } from '../dropdown';
|
3
3
|
import { CascadeOptions, ValueType } from './type';
|
4
4
|
/**
|
@@ -11,11 +11,6 @@ export declare function isStringArray(options: string[] | OptionsItem[][] | Casc
|
|
11
11
|
* @en Determine if it is a nested array
|
12
12
|
* */
|
13
13
|
export declare function isCascadeArray(options: string[] | OptionsItem[][] | CascadeOptions[]): options is CascadeOptions[];
|
14
|
-
/**
|
15
|
-
* 判断是否为string类型
|
16
|
-
* @en Determine whether it is of type string
|
17
|
-
*/
|
18
|
-
export declare function isString(icon: string | ReactNode): icon is string;
|
19
14
|
/**
|
20
15
|
* 格式化传入的数组
|
21
16
|
* @en format the input array
|
@@ -16,14 +16,6 @@ export function isStringArray(options) {
|
|
16
16
|
export function isCascadeArray(options) {
|
17
17
|
return typeof options[0] === 'object' && !isArray(options[0]);
|
18
18
|
}
|
19
|
-
/**
|
20
|
-
* 判断是否为string类型
|
21
|
-
* @en Determine whether it is of type string
|
22
|
-
*/
|
23
|
-
|
24
|
-
export function isString(icon) {
|
25
|
-
return typeof icon === 'string';
|
26
|
-
}
|
27
19
|
/**
|
28
20
|
* 格式化传入的数组
|
29
21
|
* @en format the input array
|
@@ -36,6 +36,13 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
39
|
+
function getActualHeight(container) {
|
40
|
+
var _container$getBoundin = container.getBoundingClientRect(),
|
41
|
+
height = _container$getBoundin.height;
|
42
|
+
|
43
|
+
return Math.round(height);
|
44
|
+
}
|
45
|
+
|
39
46
|
function truncateText(container, textContainer, max) {
|
40
47
|
var content = textContainer.textContent || '';
|
41
48
|
var currentText = '';
|
@@ -51,11 +58,9 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
51
58
|
|
52
59
|
var temp = content.slice(l, m);
|
53
60
|
textContainer.innerText = currentText + temp;
|
61
|
+
var actualHeight = getActualHeight(container);
|
54
62
|
|
55
|
-
|
56
|
-
height = _container$getBoundin.height;
|
57
|
-
|
58
|
-
if (height > max) {
|
63
|
+
if (actualHeight > max) {
|
59
64
|
r = m;
|
60
65
|
} else {
|
61
66
|
currentText += temp;
|
@@ -76,6 +81,7 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
76
81
|
function truncateHTML(container, textContainer, max) {
|
77
82
|
// only enter this function when container overflow.
|
78
83
|
var children = textContainer.childNodes;
|
84
|
+
var actualHeight = getActualHeight(container);
|
79
85
|
|
80
86
|
if (children.length === 1) {
|
81
87
|
var node = children[0];
|
@@ -87,10 +93,7 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
87
93
|
|
88
94
|
node.innerHTML = '';
|
89
95
|
|
90
|
-
|
91
|
-
height = _container$getBoundin2.height;
|
92
|
-
|
93
|
-
if (height > max) {
|
96
|
+
if (actualHeight > max) {
|
94
97
|
// return after remove the node, if overflow with empty node.
|
95
98
|
textContainer.removeChild(node);
|
96
99
|
handleOnReflow(true, textContainer.innerHTML);
|
@@ -109,10 +112,7 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
109
112
|
while (i < nodes.length) {
|
110
113
|
textContainer.appendChild(nodes[i]);
|
111
114
|
|
112
|
-
|
113
|
-
_height = _container$getBoundin3.height;
|
114
|
-
|
115
|
-
if (_height > max) {
|
115
|
+
if (actualHeight > max) {
|
116
116
|
if (nodes[i].childNodes && nodes[i].childNodes.length) {
|
117
117
|
break;
|
118
118
|
} else {
|
@@ -152,13 +152,10 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
152
152
|
}
|
153
153
|
|
154
154
|
textRef.current.classList.remove(prefixCls + "-js-content-text-pre");
|
155
|
-
|
156
|
-
var _domRef$current$getBo = domRef.current.getBoundingClientRect(),
|
157
|
-
height = _domRef$current$getBo.height;
|
158
|
-
|
155
|
+
var actualHeight = getActualHeight(domRef.current);
|
159
156
|
var max = isNaN(Number(maxHeight)) ? lineHeightRef.current * maxLine : Number(maxHeight);
|
160
157
|
|
161
|
-
if (
|
158
|
+
if (actualHeight <= max) {
|
162
159
|
handleOnReflow(false, text);
|
163
160
|
return;
|
164
161
|
}
|
@@ -97,6 +97,11 @@ export interface ShowMonitorRef {
|
|
97
97
|
* @en Ignore the state of the element before and after, manually check whether the element is in the viewport, trigger the onVisibleChange callback function
|
98
98
|
*/
|
99
99
|
checkVisible: () => boolean;
|
100
|
+
/**
|
101
|
+
* 重置元素初始可见态为false,并重新对元素可见度发起检测,优先级低于disabled(通常用在对ShowMonitor内部元素变化时发起的重新监听)
|
102
|
+
* @en Reset the initial visible state of the element to false, and re-detect the visibility of the element, the priority is lower than 'disabled'(Usually used to re-listen when elements inside ShowMonitor change)
|
103
|
+
*/
|
104
|
+
flushVisibleStatus: () => void;
|
100
105
|
}
|
101
106
|
/**
|
102
107
|
* 通过滚动事件监测 children 是否进入视口或离开视口。
|
@@ -187,6 +187,7 @@ var ShowMonitor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
187
187
|
|
188
188
|
|
189
189
|
curVisible !== preVisible && handleCheckChildrenExist() && onCompVisibleChange(curVisible, node);
|
190
|
+
component.isVisible = curVisible;
|
190
191
|
var key = wrapperKey.current;
|
191
192
|
/**
|
192
193
|
* 监听一次后加入 pendingList 队列,随后被 listeners 过滤掉
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arco-design/mobile-react",
|
3
|
-
"version": "2.30.
|
3
|
+
"version": "2.30.6",
|
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.17.
|
18
|
+
"@arco-design/mobile-utils": "2.17.6",
|
19
19
|
"@arco-design/transformable": "^1.0.0",
|
20
20
|
"lodash.throttle": "^4.1.1",
|
21
21
|
"resize-observer-polyfill": "^1.5.1"
|
@@ -49,5 +49,5 @@
|
|
49
49
|
"publishConfig": {
|
50
50
|
"access": "public"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "a6778485284e4fe9c39e79695d3665371fc2c9c8"
|
53
53
|
}
|
package/umd/date-picker/index.js
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
factory(mod.exports, global._extends, global.objectWithoutPropertiesLoose, global.react, global.mobileUtils, global.picker, global.contextProvider, global.helper, global.type);
|
11
11
|
global.index = mod.exports;
|
12
12
|
}
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports,
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends4, _objectWithoutPropertiesLoose2, _react, _mobileUtils, _picker, _contextProvider, _helper, _type) {
|
14
14
|
"use strict";
|
15
15
|
|
16
16
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
@@ -20,7 +20,7 @@
|
|
20
20
|
YEAR: true
|
21
21
|
};
|
22
22
|
_exports.default = _exports.YEAR = void 0;
|
23
|
-
|
23
|
+
_extends4 = _interopRequireDefault(_extends4);
|
24
24
|
_objectWithoutPropertiesLoose2 = _interopRequireDefault(_objectWithoutPropertiesLoose2);
|
25
25
|
_react = _interopRequireWildcard(_react);
|
26
26
|
_picker = _interopRequireDefault(_picker);
|
@@ -100,10 +100,8 @@
|
|
100
100
|
});
|
101
101
|
|
102
102
|
function _getColumns() {
|
103
|
-
var dateObj =
|
104
|
-
|
105
|
-
dateObj[type] = _getActualArray(type, currentDateObjRef.current);
|
106
|
-
});
|
103
|
+
var dateObj = _getActualArray();
|
104
|
+
|
107
105
|
var columns = keyOptions.map(function (opt) {
|
108
106
|
return dateObj[opt];
|
109
107
|
});
|
@@ -147,32 +145,51 @@
|
|
147
145
|
// @en Dynamically change the options of other columns based on the currently selected date
|
148
146
|
|
149
147
|
|
150
|
-
function _getActualArray(
|
151
|
-
var
|
152
|
-
|
153
|
-
var range = [];
|
154
|
-
|
155
|
-
switch (type) {
|
156
|
-
case 'year':
|
157
|
-
range = [minDateObjRef.current.year, maxDateObjRef.current.year];
|
158
|
-
break;
|
159
|
-
|
160
|
-
default:
|
161
|
-
{
|
162
|
-
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
163
|
-
range = normalRange;
|
164
|
-
|
165
|
-
if ((0, _helper.judgeObj)(nowDateObj, minDateObjRef.current, checkKeys)) {
|
166
|
-
range[0] = minDateObjRef.current[type];
|
167
|
-
}
|
148
|
+
function _getActualArray() {
|
149
|
+
var dateObj = {}; // 当前时间对象
|
150
|
+
// @en current Date object
|
168
151
|
|
169
|
-
|
170
|
-
|
152
|
+
var currentDateObj = (0, _extends4.default)({}, currentDateObjRef.current);
|
153
|
+
allTypes.forEach(function (type) {
|
154
|
+
// 根据日期类型,计算出默认的日期范围
|
155
|
+
// @en According to the date type, calculate the default date range.
|
156
|
+
var normalRange = _getNormalRange(type, currentDateObj);
|
157
|
+
|
158
|
+
var range = [];
|
159
|
+
|
160
|
+
switch (type) {
|
161
|
+
case 'year':
|
162
|
+
// 默认使用minTs和maxTs年份区间
|
163
|
+
// @en Default use minTs and maxTs years.
|
164
|
+
range = [minDateObjRef.current.year, maxDateObjRef.current.year];
|
165
|
+
break;
|
166
|
+
|
167
|
+
default:
|
168
|
+
{
|
169
|
+
// 除了年份外,其他日期类型都需要判断上一级日期是否相同
|
170
|
+
// @en In addition to the year, other date types need to check if the upper-level date is the same.
|
171
|
+
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
172
|
+
range = normalRange;
|
173
|
+
|
174
|
+
if ((0, _helper.judgeObj)(currentDateObj, minDateObjRef.current, checkKeys)) {
|
175
|
+
var _extends2;
|
176
|
+
|
177
|
+
range[0] = minDateObjRef.current[type];
|
178
|
+
currentDateObj = (0, _extends4.default)({}, currentDateObj, (_extends2 = {}, _extends2[type] = Math.max(minDateObjRef.current[type], currentDateObj[type]), _extends2));
|
179
|
+
}
|
180
|
+
|
181
|
+
if ((0, _helper.judgeObj)(currentDateObj, maxDateObjRef.current, checkKeys)) {
|
182
|
+
var _extends3;
|
183
|
+
|
184
|
+
range[range.length - 1] = maxDateObjRef.current[type];
|
185
|
+
currentDateObj = (0, _extends4.default)({}, currentDateObj, (_extends3 = {}, _extends3[type] = Math.min(maxDateObjRef.current[type], currentDateObj[type]), _extends3));
|
186
|
+
}
|
171
187
|
}
|
172
|
-
|
173
|
-
}
|
188
|
+
}
|
174
189
|
|
175
|
-
|
190
|
+
dateObj[type] = _convertRangeToArr(type, range);
|
191
|
+
});
|
192
|
+
return dateObj;
|
176
193
|
}
|
177
194
|
|
178
195
|
function _convertRangeToArr(type, range) {
|
@@ -320,7 +337,7 @@
|
|
320
337
|
}, [visible]);
|
321
338
|
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
|
322
339
|
var prefixCls = _ref.prefixCls;
|
323
|
-
return /*#__PURE__*/_react.default.createElement(_picker.default, (0,
|
340
|
+
return /*#__PURE__*/_react.default.createElement(_picker.default, (0, _extends4.default)({}, otherProps, {
|
324
341
|
ref: pickerRef,
|
325
342
|
visible: visible,
|
326
343
|
className: (0, _mobileUtils.cls)(className, prefixCls + "-date-picker"),
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react';
|
2
2
|
import { OptionsItem } from '../dropdown';
|
3
3
|
import { CascadeOptions, ValueType } from './type';
|
4
4
|
/**
|
@@ -11,11 +11,6 @@ export declare function isStringArray(options: string[] | OptionsItem[][] | Casc
|
|
11
11
|
* @en Determine if it is a nested array
|
12
12
|
* */
|
13
13
|
export declare function isCascadeArray(options: string[] | OptionsItem[][] | CascadeOptions[]): options is CascadeOptions[];
|
14
|
-
/**
|
15
|
-
* 判断是否为string类型
|
16
|
-
* @en Determine whether it is of type string
|
17
|
-
*/
|
18
|
-
export declare function isString(icon: string | ReactNode): icon is string;
|
19
14
|
/**
|
20
15
|
* 格式化传入的数组
|
21
16
|
* @en format the input array
|
@@ -19,7 +19,6 @@
|
|
19
19
|
_exports.getFormattedOptions = void 0;
|
20
20
|
_exports.isCascadeArray = isCascadeArray;
|
21
21
|
_exports.isRefDom = _exports.isClassNameDom = void 0;
|
22
|
-
_exports.isString = isString;
|
23
22
|
_exports.isStringArray = isStringArray;
|
24
23
|
_extends2 = _interopRequireDefault(_extends2);
|
25
24
|
|
@@ -39,15 +38,6 @@
|
|
39
38
|
function isCascadeArray(options) {
|
40
39
|
return typeof options[0] === 'object' && !(0, _mobileUtils.isArray)(options[0]);
|
41
40
|
}
|
42
|
-
/**
|
43
|
-
* 判断是否为string类型
|
44
|
-
* @en Determine whether it is of type string
|
45
|
-
*/
|
46
|
-
|
47
|
-
|
48
|
-
function isString(icon) {
|
49
|
-
return typeof icon === 'string';
|
50
|
-
}
|
51
41
|
/**
|
52
42
|
* 格式化传入的数组
|
53
43
|
* @en format the input array
|
@@ -59,6 +59,13 @@
|
|
59
59
|
}
|
60
60
|
}
|
61
61
|
|
62
|
+
function getActualHeight(container) {
|
63
|
+
var _container$getBoundin = container.getBoundingClientRect(),
|
64
|
+
height = _container$getBoundin.height;
|
65
|
+
|
66
|
+
return Math.round(height);
|
67
|
+
}
|
68
|
+
|
62
69
|
function truncateText(container, textContainer, max) {
|
63
70
|
var content = textContainer.textContent || '';
|
64
71
|
var currentText = '';
|
@@ -74,11 +81,9 @@
|
|
74
81
|
|
75
82
|
var temp = content.slice(l, m);
|
76
83
|
textContainer.innerText = currentText + temp;
|
84
|
+
var actualHeight = getActualHeight(container);
|
77
85
|
|
78
|
-
|
79
|
-
height = _container$getBoundin.height;
|
80
|
-
|
81
|
-
if (height > max) {
|
86
|
+
if (actualHeight > max) {
|
82
87
|
r = m;
|
83
88
|
} else {
|
84
89
|
currentText += temp;
|
@@ -99,6 +104,7 @@
|
|
99
104
|
function truncateHTML(container, textContainer, max) {
|
100
105
|
// only enter this function when container overflow.
|
101
106
|
var children = textContainer.childNodes;
|
107
|
+
var actualHeight = getActualHeight(container);
|
102
108
|
|
103
109
|
if (children.length === 1) {
|
104
110
|
var node = children[0];
|
@@ -110,10 +116,7 @@
|
|
110
116
|
|
111
117
|
node.innerHTML = '';
|
112
118
|
|
113
|
-
|
114
|
-
height = _container$getBoundin2.height;
|
115
|
-
|
116
|
-
if (height > max) {
|
119
|
+
if (actualHeight > max) {
|
117
120
|
// return after remove the node, if overflow with empty node.
|
118
121
|
textContainer.removeChild(node);
|
119
122
|
handleOnReflow(true, textContainer.innerHTML);
|
@@ -132,10 +135,7 @@
|
|
132
135
|
while (i < nodes.length) {
|
133
136
|
textContainer.appendChild(nodes[i]);
|
134
137
|
|
135
|
-
|
136
|
-
_height = _container$getBoundin3.height;
|
137
|
-
|
138
|
-
if (_height > max) {
|
138
|
+
if (actualHeight > max) {
|
139
139
|
if (nodes[i].childNodes && nodes[i].childNodes.length) {
|
140
140
|
break;
|
141
141
|
} else {
|
@@ -175,13 +175,10 @@
|
|
175
175
|
}
|
176
176
|
|
177
177
|
textRef.current.classList.remove(prefixCls + "-js-content-text-pre");
|
178
|
-
|
179
|
-
var _domRef$current$getBo = domRef.current.getBoundingClientRect(),
|
180
|
-
height = _domRef$current$getBo.height;
|
181
|
-
|
178
|
+
var actualHeight = getActualHeight(domRef.current);
|
182
179
|
var max = isNaN(Number(maxHeight)) ? lineHeightRef.current * maxLine : Number(maxHeight);
|
183
180
|
|
184
|
-
if (
|
181
|
+
if (actualHeight <= max) {
|
185
182
|
handleOnReflow(false, text);
|
186
183
|
return;
|
187
184
|
}
|
@@ -97,6 +97,11 @@ export interface ShowMonitorRef {
|
|
97
97
|
* @en Ignore the state of the element before and after, manually check whether the element is in the viewport, trigger the onVisibleChange callback function
|
98
98
|
*/
|
99
99
|
checkVisible: () => boolean;
|
100
|
+
/**
|
101
|
+
* 重置元素初始可见态为false,并重新对元素可见度发起检测,优先级低于disabled(通常用在对ShowMonitor内部元素变化时发起的重新监听)
|
102
|
+
* @en Reset the initial visible state of the element to false, and re-detect the visibility of the element, the priority is lower than 'disabled'(Usually used to re-listen when elements inside ShowMonitor change)
|
103
|
+
*/
|
104
|
+
flushVisibleStatus: () => void;
|
100
105
|
}
|
101
106
|
/**
|
102
107
|
* 通过滚动事件监测 children 是否进入视口或离开视口。
|