@arco-design/mobile-react 2.30.4 → 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 +26 -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/dialog/style/css/index.css +88 -0
- package/cjs/dialog/style/index.less +16 -4
- 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/ellipsis/index.d.ts +2 -2
- package/cjs/ellipsis/index.js +2 -2
- package/cjs/image-preview/index.js +1 -0
- package/cjs/index-bar/style/css/index.css +28 -5
- package/cjs/index-bar/style/index.less +10 -10
- package/cjs/pagination/arrow.js +6 -3
- package/cjs/pagination/style/css/index.css +21 -6
- package/cjs/pagination/style/index.less +9 -9
- package/cjs/picker/style/css/index.css +8 -0
- package/cjs/picker/style/index.less +2 -2
- package/cjs/progress/style/css/index.css +20 -0
- package/cjs/progress/style/index.less +5 -5
- package/cjs/radio/style/css/index.css +3 -0
- package/cjs/radio/style/index.less +5 -0
- package/cjs/search-bar/style/css/index.css +18 -0
- package/cjs/search-bar/style/index.less +5 -5
- package/cjs/show-monitor/index.d.ts +5 -0
- package/cjs/show-monitor/index.js +1 -0
- package/cjs/slider/hooks/index.d.ts +1 -1
- package/cjs/slider/index.d.ts +10 -0
- package/cjs/slider/index.js +1 -0
- package/cjs/slider/thumb.d.ts +6 -5
- package/cjs/slider/thumb.js +19 -20
- package/dist/index.js +86 -57
- package/dist/index.min.js +2 -2
- package/dist/style.css +152 -11
- 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/dialog/style/css/index.css +88 -0
- package/esm/dialog/style/index.less +16 -4
- 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/ellipsis/index.d.ts +2 -2
- package/esm/ellipsis/index.js +2 -2
- package/esm/image-preview/index.js +1 -0
- package/esm/index-bar/style/css/index.css +28 -5
- package/esm/index-bar/style/index.less +10 -10
- package/esm/pagination/arrow.js +6 -3
- package/esm/pagination/style/css/index.css +21 -6
- package/esm/pagination/style/index.less +9 -9
- package/esm/picker/style/css/index.css +8 -0
- package/esm/picker/style/index.less +2 -2
- package/esm/progress/style/css/index.css +20 -0
- package/esm/progress/style/index.less +5 -5
- package/esm/radio/style/css/index.css +3 -0
- package/esm/radio/style/index.less +5 -0
- package/esm/search-bar/style/css/index.css +18 -0
- package/esm/search-bar/style/index.less +5 -5
- package/esm/show-monitor/index.d.ts +5 -0
- package/esm/show-monitor/index.js +1 -0
- package/esm/slider/hooks/index.d.ts +1 -1
- package/esm/slider/index.d.ts +10 -0
- package/esm/slider/index.js +1 -0
- package/esm/slider/thumb.d.ts +6 -5
- package/esm/slider/thumb.js +19 -17
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +3 -4
- package/tokens/app/arcodesign/default/index.d.ts +0 -1
- package/tokens/app/arcodesign/default/index.js +3 -4
- package/tokens/app/arcodesign/default/index.json +9 -21
- package/tokens/app/arcodesign/default/index.less +3 -4
- 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/dialog/style/css/index.css +88 -0
- package/umd/dialog/style/index.less +16 -4
- 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/ellipsis/index.d.ts +2 -2
- package/umd/ellipsis/index.js +2 -2
- package/umd/image-preview/index.js +1 -0
- package/umd/index-bar/style/css/index.css +28 -5
- package/umd/index-bar/style/index.less +10 -10
- package/umd/pagination/arrow.js +6 -3
- package/umd/pagination/style/css/index.css +21 -6
- package/umd/pagination/style/index.less +9 -9
- package/umd/picker/style/css/index.css +8 -0
- package/umd/picker/style/index.less +2 -2
- package/umd/progress/style/css/index.css +20 -0
- package/umd/progress/style/index.less +5 -5
- package/umd/radio/style/css/index.css +3 -0
- package/umd/radio/style/index.less +5 -0
- package/umd/search-bar/style/css/index.css +18 -0
- package/umd/search-bar/style/index.less +5 -5
- package/umd/show-monitor/index.d.ts +5 -0
- package/umd/show-monitor/index.js +1 -0
- package/umd/slider/hooks/index.d.ts +1 -1
- package/umd/slider/index.d.ts +10 -0
- package/umd/slider/index.js +1 -0
- package/umd/slider/thumb.d.ts +6 -5
- package/umd/slider/thumb.js +23 -23
package/dist/index.js
CHANGED
@@ -13446,10 +13446,8 @@
|
|
13446
13446
|
});
|
13447
13447
|
|
13448
13448
|
function _getColumns() {
|
13449
|
-
var dateObj =
|
13450
|
-
|
13451
|
-
dateObj[type] = _getActualArray(type, currentDateObjRef.current);
|
13452
|
-
});
|
13449
|
+
var dateObj = _getActualArray();
|
13450
|
+
|
13453
13451
|
var columns = keyOptions.map(function (opt) {
|
13454
13452
|
return dateObj[opt];
|
13455
13453
|
});
|
@@ -13492,32 +13490,50 @@
|
|
13492
13490
|
// @en Dynamically change the options of other columns based on the currently selected date
|
13493
13491
|
|
13494
13492
|
|
13495
|
-
function _getActualArray(
|
13496
|
-
var
|
13493
|
+
function _getActualArray() {
|
13494
|
+
var dateObj = {}; // 当前时间对象
|
13495
|
+
// @en current Date object
|
13497
13496
|
|
13498
|
-
var
|
13497
|
+
var currentDateObj = __assign$2({}, currentDateObjRef.current);
|
13499
13498
|
|
13500
|
-
|
13501
|
-
|
13502
|
-
|
13503
|
-
break;
|
13499
|
+
allTypes.forEach(function (type) {
|
13500
|
+
var _a, _b; // 根据日期类型,计算出默认的日期范围
|
13501
|
+
// @en According to the date type, calculate the default date range.
|
13504
13502
|
|
13505
|
-
default:
|
13506
|
-
{
|
13507
|
-
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
13508
|
-
range = normalRange;
|
13509
13503
|
|
13510
|
-
|
13511
|
-
|
13512
|
-
|
13504
|
+
var normalRange = _getNormalRange(type, currentDateObj);
|
13505
|
+
|
13506
|
+
var range = [];
|
13507
|
+
|
13508
|
+
switch (type) {
|
13509
|
+
case 'year':
|
13510
|
+
// 默认使用minTs和maxTs年份区间
|
13511
|
+
// @en Default use minTs and maxTs years.
|
13512
|
+
range = [minDateObjRef.current.year, maxDateObjRef.current.year];
|
13513
|
+
break;
|
13514
|
+
|
13515
|
+
default:
|
13516
|
+
{
|
13517
|
+
// 除了年份外,其他日期类型都需要判断上一级日期是否相同
|
13518
|
+
// @en In addition to the year, other date types need to check if the upper-level date is the same.
|
13519
|
+
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
13520
|
+
range = normalRange;
|
13521
|
+
|
13522
|
+
if (judgeObj(currentDateObj, minDateObjRef.current, checkKeys)) {
|
13523
|
+
range[0] = minDateObjRef.current[type];
|
13524
|
+
currentDateObj = __assign$2(__assign$2({}, currentDateObj), (_a = {}, _a[type] = Math.max(minDateObjRef.current[type], currentDateObj[type]), _a));
|
13525
|
+
}
|
13513
13526
|
|
13514
|
-
|
13515
|
-
|
13527
|
+
if (judgeObj(currentDateObj, maxDateObjRef.current, checkKeys)) {
|
13528
|
+
range[range.length - 1] = maxDateObjRef.current[type];
|
13529
|
+
currentDateObj = __assign$2(__assign$2({}, currentDateObj), (_b = {}, _b[type] = Math.min(maxDateObjRef.current[type], currentDateObj[type]), _b));
|
13530
|
+
}
|
13516
13531
|
}
|
13517
|
-
|
13518
|
-
}
|
13532
|
+
}
|
13519
13533
|
|
13520
|
-
|
13534
|
+
dateObj[type] = _convertRangeToArr(type, range);
|
13535
|
+
});
|
13536
|
+
return dateObj;
|
13521
13537
|
}
|
13522
13538
|
|
13523
13539
|
function _convertRangeToArr(type, range) {
|
@@ -15739,6 +15755,11 @@
|
|
15739
15755
|
}
|
15740
15756
|
}
|
15741
15757
|
|
15758
|
+
function getActualHeight(container) {
|
15759
|
+
var height = container.getBoundingClientRect().height;
|
15760
|
+
return Math.round(height);
|
15761
|
+
}
|
15762
|
+
|
15742
15763
|
function truncateText(container, textContainer, max) {
|
15743
15764
|
var content = textContainer.textContent || '';
|
15744
15765
|
var currentText = '';
|
@@ -15754,9 +15775,9 @@
|
|
15754
15775
|
|
15755
15776
|
var temp = content.slice(l, m);
|
15756
15777
|
textContainer.innerText = currentText + temp;
|
15757
|
-
var
|
15778
|
+
var actualHeight = getActualHeight(container);
|
15758
15779
|
|
15759
|
-
if (
|
15780
|
+
if (actualHeight > max) {
|
15760
15781
|
r = m;
|
15761
15782
|
} else {
|
15762
15783
|
currentText += temp;
|
@@ -15777,6 +15798,7 @@
|
|
15777
15798
|
function truncateHTML(container, textContainer, max) {
|
15778
15799
|
// only enter this function when container overflow.
|
15779
15800
|
var children = textContainer.childNodes;
|
15801
|
+
var actualHeight = getActualHeight(container);
|
15780
15802
|
|
15781
15803
|
if (children.length === 1) {
|
15782
15804
|
var node = children[0];
|
@@ -15787,9 +15809,8 @@
|
|
15787
15809
|
var html = node.innerHTML; // clear content to determine whether the empty node can be placed.
|
15788
15810
|
|
15789
15811
|
node.innerHTML = '';
|
15790
|
-
var height = container.getBoundingClientRect().height;
|
15791
15812
|
|
15792
|
-
if (
|
15813
|
+
if (actualHeight > max) {
|
15793
15814
|
// return after remove the node, if overflow with empty node.
|
15794
15815
|
textContainer.removeChild(node);
|
15795
15816
|
handleOnReflow(true, textContainer.innerHTML);
|
@@ -15807,9 +15828,8 @@
|
|
15807
15828
|
|
15808
15829
|
while (i < nodes.length) {
|
15809
15830
|
textContainer.appendChild(nodes[i]);
|
15810
|
-
var height = container.getBoundingClientRect().height;
|
15811
15831
|
|
15812
|
-
if (
|
15832
|
+
if (actualHeight > max) {
|
15813
15833
|
if (nodes[i].childNodes && nodes[i].childNodes.length) {
|
15814
15834
|
break;
|
15815
15835
|
} else {
|
@@ -15849,10 +15869,10 @@
|
|
15849
15869
|
}
|
15850
15870
|
|
15851
15871
|
textRef.current.classList.remove(prefixCls + "-js-content-text-pre");
|
15852
|
-
var
|
15872
|
+
var actualHeight = getActualHeight(domRef.current);
|
15853
15873
|
var max = isNaN(Number(maxHeight)) ? lineHeightRef.current * maxLine : Number(maxHeight);
|
15854
15874
|
|
15855
|
-
if (
|
15875
|
+
if (actualHeight <= max) {
|
15856
15876
|
handleOnReflow(false, text);
|
15857
15877
|
return;
|
15858
15878
|
}
|
@@ -15964,8 +15984,8 @@
|
|
15964
15984
|
var NativeEllipsis$1 = /*#__PURE__*/React__default["default"].memo(NativeEllipsis);
|
15965
15985
|
|
15966
15986
|
/**
|
15967
|
-
*
|
15968
|
-
* @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc.
|
15987
|
+
* 文本缩略组件,支持多行缩略、富文本、自定义缩略符、尾字符过滤等。如果传入的文本内容中包含换行符号`\n`,建议将`\n`替换为`<br/>`,并设置`dangerouslyUseInnerHTML=true`。
|
15988
|
+
* @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc. If the incoming text contains newline characters `\n`, it is recommended to replace `\n` with `<br/>`, and set `dangerouslyUseInnerHTML=true`.
|
15969
15989
|
* @type 信息展示
|
15970
15990
|
* @type_en Data Display
|
15971
15991
|
* @name 文本缩略
|
@@ -20875,6 +20895,7 @@
|
|
20875
20895
|
dragMode: 'always',
|
20876
20896
|
transformMode: 'matrix',
|
20877
20897
|
useDomBoundary: false,
|
20898
|
+
preventScroll: false,
|
20878
20899
|
cubic: {
|
20879
20900
|
scroll: scrollBezier
|
20880
20901
|
},
|
@@ -23506,10 +23527,13 @@
|
|
23506
23527
|
|
23507
23528
|
function Arrow() {
|
23508
23529
|
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
23509
|
-
width: "
|
23530
|
+
width: "2",
|
23510
23531
|
height: "14",
|
23511
|
-
viewBox: "
|
23512
|
-
fill: "none"
|
23532
|
+
viewBox: "3 0 2 14",
|
23533
|
+
fill: "none",
|
23534
|
+
style: {
|
23535
|
+
overflow: 'visible'
|
23536
|
+
}
|
23513
23537
|
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
23514
23538
|
fillRule: "evenodd",
|
23515
23539
|
clipRule: "evenodd",
|
@@ -26763,6 +26787,7 @@
|
|
26763
26787
|
|
26764
26788
|
|
26765
26789
|
curVisible !== preVisible && handleCheckChildrenExist() && onCompVisibleChange(curVisible, node);
|
26790
|
+
component.isVisible = curVisible;
|
26766
26791
|
var key = wrapperKey.current;
|
26767
26792
|
/**
|
26768
26793
|
* 监听一次后加入 pendingList 队列,随后被 listeners 过滤掉
|
@@ -27963,18 +27988,21 @@
|
|
27963
27988
|
}))), children);
|
27964
27989
|
}
|
27965
27990
|
|
27966
|
-
|
27967
|
-
var
|
27991
|
+
function Thumb(_a) {
|
27992
|
+
var _b = _a.className,
|
27993
|
+
className = _b === void 0 ? '' : _b,
|
27968
27994
|
value = _a.value,
|
27969
27995
|
style = _a.style,
|
27970
|
-
isTouching = _a.isTouching
|
27971
|
-
|
27972
|
-
|
27996
|
+
isTouching = _a.isTouching,
|
27997
|
+
idx = _a.idx;
|
27998
|
+
var _c = React.useContext(GlobalContext).prefixCls,
|
27999
|
+
prefixCls = _c === void 0 ? '' : _c;
|
27973
28000
|
|
27974
|
-
var
|
27975
|
-
showTooltip =
|
27976
|
-
renderThumb =
|
27977
|
-
formatTooltip =
|
28001
|
+
var _d = React.useContext(SliderContext),
|
28002
|
+
showTooltip = _d.showTooltip,
|
28003
|
+
renderThumb = _d.renderThumb,
|
28004
|
+
formatTooltip = _d.formatTooltip,
|
28005
|
+
renderThumbPopover = _d.renderThumbPopover;
|
27978
28006
|
|
27979
28007
|
var isHidden = showTooltip === 'never';
|
27980
28008
|
var renderValue = React.useMemo(function () {
|
@@ -27985,21 +28013,21 @@
|
|
27985
28013
|
if (showTooltip === 'always') return true;
|
27986
28014
|
return isTouching;
|
27987
28015
|
}, [showTooltip, isTouching]);
|
27988
|
-
|
27989
|
-
var renderWrapper = function renderWrapper(el) {
|
27990
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
27991
|
-
className: prefixCls + "-slider-thumb-wrapper " + className,
|
27992
|
-
style: __assign$2({}, style)
|
27993
|
-
}, el);
|
27994
|
-
};
|
27995
|
-
|
27996
28016
|
var thumbEl = typeof renderThumb === 'function' ? renderThumb(value) : renderThumb;
|
27997
|
-
|
27998
|
-
|
28017
|
+
var popoverEl = typeof renderThumbPopover === 'function' ? renderThumbPopover({
|
28018
|
+
value: value,
|
28019
|
+
visible: isTooltipVisible,
|
28020
|
+
thumbEl: thumbEl,
|
28021
|
+
index: idx
|
28022
|
+
}) : /*#__PURE__*/React__default["default"].createElement(Popover, {
|
27999
28023
|
visible: isTooltipVisible,
|
28000
28024
|
content: renderValue
|
28001
|
-
}, thumbEl)
|
28002
|
-
|
28025
|
+
}, thumbEl);
|
28026
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
28027
|
+
className: prefixCls + "-slider-thumb-wrapper " + className,
|
28028
|
+
style: style
|
28029
|
+
}, isHidden ? thumbEl : popoverEl);
|
28030
|
+
}
|
28003
28031
|
|
28004
28032
|
function Marks(_a) {
|
28005
28033
|
var runTimeConfig = _a.runTimeConfig,
|
@@ -28190,6 +28218,7 @@
|
|
28190
28218
|
key: idx
|
28191
28219
|
}, __assign$2({
|
28192
28220
|
value: Array.isArray(valueGroup) ? valueGroup[idx] : valueGroup,
|
28221
|
+
idx: idx,
|
28193
28222
|
min: min,
|
28194
28223
|
max: max,
|
28195
28224
|
isTouching: commonIsTouching === idx
|