@arco-design/mobile-react 2.21.3 → 2.22.2
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 +31 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/index.d.ts +1 -0
- package/cjs/_helpers/index.js +9 -0
- package/cjs/_helpers/react-dom.d.ts +13 -0
- package/cjs/_helpers/react-dom.js +65 -0
- package/cjs/_helpers/render.d.ts +10 -0
- package/cjs/_helpers/render.js +40 -0
- package/cjs/action-sheet/index.d.ts +1 -1
- package/cjs/action-sheet/style/css/index.css +2 -2
- package/cjs/action-sheet/style/index.less +1 -1
- package/cjs/dialog/style/css/index.css +2 -2
- package/cjs/dialog/style/index.less +1 -1
- package/cjs/image-picker/index.js +0 -1
- package/cjs/image-preview/index.d.ts +2 -10
- package/cjs/image-preview/methods.js +4 -11
- package/cjs/masking/index.d.ts +10 -0
- package/cjs/masking/methods.js +4 -11
- package/cjs/notify/methods.js +6 -9
- package/cjs/popover/hooks/useEvent.js +6 -6
- package/cjs/pull-refresh/android-pull-refresh.js +2 -0
- package/cjs/pull-refresh/ios-pull-refresh.js +3 -2
- package/cjs/pull-refresh/model.d.ts +6 -2
- package/cjs/steps/demo/style/css/mobile.css +8 -2
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/steps/index.js +5 -1
- package/cjs/steps/step.js +5 -3
- package/cjs/steps/style/css/index.css +78 -23
- package/cjs/steps/style/index.less +92 -24
- package/cjs/steps/type.d.ts +12 -0
- package/cjs/swipe-action/index.js +21 -3
- package/cjs/tabs/index.js +8 -4
- package/cjs/tabs/style/css/index.css +8 -8
- package/cjs/tabs/style/index.less +4 -4
- package/cjs/tabs/tab-cell.js +4 -3
- package/cjs/tabs/type.d.ts +11 -0
- package/cjs/toast/methods.js +9 -12
- package/dist/index.js +186 -81
- package/dist/index.min.js +4 -4
- package/dist/style.css +87 -35
- package/dist/style.min.css +1 -1
- package/esm/_helpers/index.d.ts +1 -0
- package/esm/_helpers/index.js +1 -0
- package/esm/_helpers/react-dom.d.ts +13 -0
- package/esm/_helpers/react-dom.js +57 -0
- package/esm/_helpers/render.d.ts +10 -0
- package/esm/_helpers/render.js +29 -0
- package/esm/action-sheet/index.d.ts +1 -1
- package/esm/action-sheet/style/css/index.css +2 -2
- package/esm/action-sheet/style/index.less +1 -1
- package/esm/dialog/style/css/index.css +2 -2
- package/esm/dialog/style/index.less +1 -1
- package/esm/image-picker/index.js +0 -1
- package/esm/image-preview/index.d.ts +2 -10
- package/esm/image-preview/methods.js +3 -9
- package/esm/masking/index.d.ts +10 -0
- package/esm/masking/methods.js +3 -9
- package/esm/notify/methods.js +6 -7
- package/esm/popover/hooks/useEvent.js +6 -6
- package/esm/pull-refresh/android-pull-refresh.js +2 -0
- package/esm/pull-refresh/ios-pull-refresh.js +3 -2
- package/esm/pull-refresh/model.d.ts +6 -2
- package/esm/steps/demo/style/css/mobile.css +8 -2
- package/esm/steps/index.d.ts +1 -1
- package/esm/steps/index.js +5 -1
- package/esm/steps/step.js +5 -3
- package/esm/steps/style/css/index.css +78 -23
- package/esm/steps/style/index.less +92 -24
- package/esm/steps/type.d.ts +12 -0
- package/esm/swipe-action/index.js +21 -3
- package/esm/tabs/index.js +9 -5
- package/esm/tabs/style/css/index.css +8 -8
- package/esm/tabs/style/index.less +4 -4
- package/esm/tabs/tab-cell.js +4 -3
- package/esm/tabs/type.d.ts +11 -0
- package/esm/toast/methods.js +8 -9
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +7 -3
- package/tokens/app/arcodesign/default/index.d.ts +4 -0
- package/tokens/app/arcodesign/default/index.js +7 -3
- package/tokens/app/arcodesign/default/index.json +58 -10
- package/tokens/app/arcodesign/default/index.less +7 -3
- package/tokens/mixin/index.less +1 -1
- package/umd/_helpers/index.d.ts +1 -0
- package/umd/_helpers/index.js +10 -4
- package/umd/_helpers/react-dom.d.ts +13 -0
- package/umd/_helpers/react-dom.js +78 -0
- package/umd/_helpers/render.d.ts +10 -0
- package/umd/_helpers/render.js +51 -0
- package/umd/action-sheet/index.d.ts +1 -1
- package/umd/action-sheet/style/css/index.css +2 -2
- package/umd/action-sheet/style/index.less +1 -1
- package/umd/dialog/style/css/index.css +2 -2
- package/umd/dialog/style/index.less +1 -1
- package/umd/image-picker/index.js +0 -1
- package/umd/image-preview/index.d.ts +2 -10
- package/umd/image-preview/methods.js +6 -13
- package/umd/masking/index.d.ts +10 -0
- package/umd/masking/methods.js +6 -13
- package/umd/notify/methods.js +9 -12
- package/umd/popover/hooks/useEvent.js +6 -6
- package/umd/pull-refresh/android-pull-refresh.js +2 -0
- package/umd/pull-refresh/ios-pull-refresh.js +3 -2
- package/umd/pull-refresh/model.d.ts +6 -2
- package/umd/steps/demo/style/css/mobile.css +8 -2
- package/umd/steps/index.d.ts +1 -1
- package/umd/steps/index.js +5 -1
- package/umd/steps/step.js +5 -3
- package/umd/steps/style/css/index.css +78 -23
- package/umd/steps/style/index.less +92 -24
- package/umd/steps/type.d.ts +12 -0
- package/umd/swipe-action/index.js +21 -3
- package/umd/tabs/index.js +8 -4
- package/umd/tabs/style/css/index.css +8 -8
- package/umd/tabs/style/index.less +4 -4
- package/umd/tabs/tab-cell.js +4 -3
- package/umd/tabs/type.d.ts +11 -0
- package/umd/toast/methods.js +11 -14
package/dist/index.js
CHANGED
@@ -60,7 +60,7 @@
|
|
60
60
|
function isArray(obj) {
|
61
61
|
return opt.call(obj) === '[object Array]';
|
62
62
|
}
|
63
|
-
function isObject$
|
63
|
+
function isObject$2(obj) {
|
64
64
|
return opt.call(obj) === '[object Object]';
|
65
65
|
}
|
66
66
|
function isString(obj) {
|
@@ -91,7 +91,7 @@
|
|
91
91
|
classNames.push(v);
|
92
92
|
} else if (isArray(v)) {
|
93
93
|
classNames = classNames.concat(v);
|
94
|
-
} else if (isObject$
|
94
|
+
} else if (isObject$2(v)) {
|
95
95
|
Object.keys(v).forEach(function (k) {
|
96
96
|
if (v[k]) {
|
97
97
|
classNames.push(k);
|
@@ -2494,6 +2494,64 @@
|
|
2494
2494
|
};
|
2495
2495
|
}
|
2496
2496
|
|
2497
|
+
var _a;
|
2498
|
+
|
2499
|
+
function isObject$1(obj) {
|
2500
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
2501
|
+
}
|
2502
|
+
|
2503
|
+
var __SECRET_INTERNALS__ = '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED';
|
2504
|
+
var CopyReactDOM = ReactDOM__default["default"];
|
2505
|
+
var copyRender;
|
2506
|
+
var isReact18 = Number((_a = CopyReactDOM.version) === null || _a === void 0 ? void 0 : _a.split('.')[0]) > 17;
|
2507
|
+
|
2508
|
+
var updateUsingClientEntryPoint = function updateUsingClientEntryPoint(skipWarning) {
|
2509
|
+
// https://github.com/facebook/react/blob/17806594cc28284fe195f918e8d77de3516848ec/packages/react-dom/npm/client.js#L10
|
2510
|
+
// Avoid console warning
|
2511
|
+
if (isObject$1(CopyReactDOM[__SECRET_INTERNALS__])) {
|
2512
|
+
CopyReactDOM[__SECRET_INTERNALS__].usingClientEntryPoint = skipWarning;
|
2513
|
+
}
|
2514
|
+
};
|
2515
|
+
|
2516
|
+
var createRoot;
|
2517
|
+
|
2518
|
+
try {
|
2519
|
+
createRoot = CopyReactDOM.createRoot;
|
2520
|
+
} catch (_) {}
|
2521
|
+
|
2522
|
+
if (isReact18 && createRoot) {
|
2523
|
+
copyRender = function copyRender(app, container) {
|
2524
|
+
updateUsingClientEntryPoint(true);
|
2525
|
+
var root = createRoot(container);
|
2526
|
+
updateUsingClientEntryPoint(false);
|
2527
|
+
root.render(app);
|
2528
|
+
|
2529
|
+
root._unmount = function () {
|
2530
|
+
setTimeout(function () {
|
2531
|
+
var _a;
|
2532
|
+
|
2533
|
+
(_a = root === null || root === void 0 ? void 0 : root.unmount) === null || _a === void 0 ? void 0 : _a.call(root);
|
2534
|
+
});
|
2535
|
+
};
|
2536
|
+
|
2537
|
+
return root;
|
2538
|
+
};
|
2539
|
+
} else {
|
2540
|
+
copyRender = function copyRender(app, container) {
|
2541
|
+
CopyReactDOM.render(app, container);
|
2542
|
+
return {
|
2543
|
+
render: function render(comment) {
|
2544
|
+
CopyReactDOM.render(comment, container);
|
2545
|
+
},
|
2546
|
+
_unmount: function _unmount() {
|
2547
|
+
CopyReactDOM.unmountComponentAtNode(container);
|
2548
|
+
}
|
2549
|
+
};
|
2550
|
+
};
|
2551
|
+
}
|
2552
|
+
|
2553
|
+
var render = copyRender;
|
2554
|
+
|
2497
2555
|
function getStyleWithVendor(style) {
|
2498
2556
|
var allowReg = /(transform|transition|animation)/i;
|
2499
2557
|
var newStyle = Object.keys(style).reduce(function (acc, key) {
|
@@ -2515,6 +2573,36 @@
|
|
2515
2573
|
return value === void 0 ? defaultValue : value;
|
2516
2574
|
};
|
2517
2575
|
|
2576
|
+
var ReactDOMRender =
|
2577
|
+
/** @class */
|
2578
|
+
function () {
|
2579
|
+
function ReactDOMRender(app, container) {
|
2580
|
+
var _this = this;
|
2581
|
+
|
2582
|
+
this.render = function (props) {
|
2583
|
+
var CustomApp = _this.app;
|
2584
|
+
|
2585
|
+
if (_this.root) {
|
2586
|
+
_this.root.render( /*#__PURE__*/React__default["default"].createElement(CustomApp, __assign({}, props)));
|
2587
|
+
} else {
|
2588
|
+
_this.root = render( /*#__PURE__*/React__default["default"].createElement(CustomApp, __assign({}, props)), _this.container);
|
2589
|
+
}
|
2590
|
+
};
|
2591
|
+
|
2592
|
+
this.unmount = function () {
|
2593
|
+
var _a;
|
2594
|
+
|
2595
|
+
(_a = _this.root) === null || _a === void 0 ? void 0 : _a._unmount();
|
2596
|
+
_this.root = undefined;
|
2597
|
+
};
|
2598
|
+
|
2599
|
+
this.app = app;
|
2600
|
+
this.container = container;
|
2601
|
+
}
|
2602
|
+
|
2603
|
+
return ReactDOMRender;
|
2604
|
+
}();
|
2605
|
+
|
2518
2606
|
function getOpenMethod(Component, containerId, normalize) {
|
2519
2607
|
if (normalize === void 0) {
|
2520
2608
|
normalize = function normalize(config) {
|
@@ -2536,14 +2624,7 @@
|
|
2536
2624
|
var id = "_" + (containerId || 'ARCO_MASKING') + "_DIV_" + (config.key || '') + "_";
|
2537
2625
|
var div = appendElementById(id, baseProps.getContainer).child;
|
2538
2626
|
var leaving = false;
|
2539
|
-
|
2540
|
-
function render(props) {
|
2541
|
-
ReactDOM__default["default"].render( /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, props, {
|
2542
|
-
getContainer: function getContainer() {
|
2543
|
-
return div;
|
2544
|
-
}
|
2545
|
-
})), div);
|
2546
|
-
}
|
2627
|
+
var render = new ReactDOMRender(Component, div).render;
|
2547
2628
|
|
2548
2629
|
function update(newConfig) {
|
2549
2630
|
dynamicProps = __assign(__assign({}, dynamicProps), normalize(newConfig));
|
@@ -5203,16 +5284,16 @@
|
|
5203
5284
|
var div = document.createElement('div');
|
5204
5285
|
document.body.appendChild(div);
|
5205
5286
|
|
5206
|
-
|
5207
|
-
|
5208
|
-
|
5287
|
+
var _a = new ReactDOMRender(Component, div),
|
5288
|
+
render = _a.render,
|
5289
|
+
unmount = _a.unmount;
|
5209
5290
|
|
5210
|
-
function
|
5291
|
+
function destroy() {
|
5211
5292
|
var onClose = config.onClose;
|
5212
5293
|
onClose && onClose();
|
5213
|
-
|
5294
|
+
unmount();
|
5214
5295
|
|
5215
|
-
if (
|
5296
|
+
if (div.parentNode) {
|
5216
5297
|
div.parentNode.removeChild(div);
|
5217
5298
|
}
|
5218
5299
|
}
|
@@ -5222,7 +5303,7 @@
|
|
5222
5303
|
getContainer: function getContainer() {
|
5223
5304
|
return div;
|
5224
5305
|
},
|
5225
|
-
onClose:
|
5306
|
+
onClose: destroy,
|
5226
5307
|
visible: false
|
5227
5308
|
});
|
5228
5309
|
|
@@ -6788,7 +6869,8 @@
|
|
6788
6869
|
renderTabBarInner = props.renderTabBarInner,
|
6789
6870
|
tabBarStyle = props.tabBarStyle,
|
6790
6871
|
tabBarClass = props.tabBarClass,
|
6791
|
-
translateZ = props.translateZ
|
6872
|
+
translateZ = props.translateZ,
|
6873
|
+
tabBarStopPropagation = props.tabBarStopPropagation;
|
6792
6874
|
var prefix = prefixCls + "-tab-cell";
|
6793
6875
|
var domRef = React.useRef(null);
|
6794
6876
|
var underlineRef = React.useRef(null);
|
@@ -6880,13 +6962,13 @@
|
|
6880
6962
|
return e.stopPropagation();
|
6881
6963
|
};
|
6882
6964
|
|
6883
|
-
if (isVertical && hasOverflow && domRef.current) {
|
6965
|
+
if (isVertical && hasOverflow && domRef.current && tabBarStopPropagation) {
|
6884
6966
|
domRef.current.addEventListener('touchstart', stopFunc);
|
6885
6967
|
domRef.current.addEventListener('touchmove', stopFunc);
|
6886
6968
|
}
|
6887
6969
|
|
6888
6970
|
return function () {
|
6889
|
-
if (isVertical && hasOverflow && domRef.current) {
|
6971
|
+
if (isVertical && hasOverflow && domRef.current && tabBarStopPropagation) {
|
6890
6972
|
domRef.current.removeEventListener('touchstart', stopFunc);
|
6891
6973
|
domRef.current.removeEventListener('touchmove', stopFunc);
|
6892
6974
|
}
|
@@ -7929,44 +8011,46 @@
|
|
7929
8011
|
_4 = props.translateZ,
|
7930
8012
|
translateZ = _4 === void 0 ? true : _4,
|
7931
8013
|
fullScreen = props.fullScreen,
|
7932
|
-
autoHeight = props.autoHeight
|
8014
|
+
autoHeight = props.autoHeight,
|
8015
|
+
_5 = props.tabBarStopPropagation,
|
8016
|
+
tabBarStopPropagation = _5 === void 0 ? true : _5;
|
7933
8017
|
var domRef = React.useRef(null);
|
7934
8018
|
var cellRef = React.useRef(null);
|
7935
8019
|
var paneRef = React.useRef(null);
|
7936
8020
|
|
7937
|
-
var
|
7938
|
-
innerIndex =
|
7939
|
-
setInnerIndex =
|
7940
|
-
|
7941
|
-
var _6 = React.useState(0),
|
7942
|
-
jumpingDis = _6[0],
|
7943
|
-
setJumpingDis = _6[1];
|
8021
|
+
var _6 = React.useState(defaultActiveTab),
|
8022
|
+
innerIndex = _6[0],
|
8023
|
+
setInnerIndex = _6[1];
|
7944
8024
|
|
7945
8025
|
var _7 = React.useState(0),
|
7946
|
-
|
7947
|
-
|
8026
|
+
jumpingDis = _7[0],
|
8027
|
+
setJumpingDis = _7[1];
|
7948
8028
|
|
7949
8029
|
var _8 = React.useState(0),
|
7950
|
-
|
7951
|
-
|
8030
|
+
wrapWidth = _8[0],
|
8031
|
+
setWrapWidth = _8[1];
|
7952
8032
|
|
7953
|
-
var _9 = React.useState(
|
7954
|
-
|
7955
|
-
|
8033
|
+
var _9 = React.useState(0),
|
8034
|
+
wrapHeight = _9[0],
|
8035
|
+
setWrapHeight = _9[1];
|
7956
8036
|
|
7957
8037
|
var _10 = React.useState(false),
|
7958
|
-
|
7959
|
-
|
8038
|
+
cellTrans = _10[0],
|
8039
|
+
setCellTrans = _10[1];
|
8040
|
+
|
8041
|
+
var _11 = React.useState(false),
|
8042
|
+
paneTrans = _11[0],
|
8043
|
+
setPaneTrans = _11[1];
|
7960
8044
|
|
7961
|
-
var
|
7962
|
-
activeIndex =
|
7963
|
-
activeIndexRef =
|
7964
|
-
setActiveIndex =
|
8045
|
+
var _12 = useRefState(activeTab === void 0 ? innerIndex : activeTab),
|
8046
|
+
activeIndex = _12[0],
|
8047
|
+
activeIndexRef = _12[1],
|
8048
|
+
setActiveIndex = _12[2];
|
7965
8049
|
|
7966
|
-
var
|
7967
|
-
distance =
|
7968
|
-
distanceRef =
|
7969
|
-
setDistance =
|
8050
|
+
var _13 = useRefState(0),
|
8051
|
+
distance = _13[0],
|
8052
|
+
distanceRef = _13[1],
|
8053
|
+
setDistance = _13[2];
|
7970
8054
|
|
7971
8055
|
var posAdjustingRef = React.useRef(false);
|
7972
8056
|
var touchStartedRef = React.useRef(false);
|
@@ -7977,6 +8061,7 @@
|
|
7977
8061
|
var touchStoppedRef = React.useRef(false);
|
7978
8062
|
var changeFromRef = React.useRef('');
|
7979
8063
|
var touchMoveBarScrollRef = React.useRef(false);
|
8064
|
+
var system = useSystem();
|
7980
8065
|
var allPanes = getAllPanes();
|
7981
8066
|
var tabDirection = ['top', 'bottom'].indexOf(tabBarPosition) !== -1 ? 'vertical' : 'horizontal';
|
7982
8067
|
var canSwipe = mode === 'swipe' && !disabled && swipeable && tabDirection === 'vertical' && tabs.length > 1;
|
@@ -8089,10 +8174,10 @@
|
|
8089
8174
|
|
8090
8175
|
var evt = e.changedTouches[0];
|
8091
8176
|
var touchMoveX = evt.clientX || 0;
|
8092
|
-
var touchMoveY = evt.clientY || 0; // bugfix: 兼容safari在右滑返回上一页时clientX
|
8177
|
+
var touchMoveY = evt.clientY || 0; // bugfix: 兼容safari在右滑返回上一页时clientX为负值的情况,安卓有折叠屏,触点会有超出屏幕(clientX < 0)的情况,因此这里限定ios系统
|
8093
8178
|
// @en bugfix: bugfix: Compatible with the case in safari where clientX is negative when swiping right back to the previous page
|
8094
8179
|
|
8095
|
-
var posDisX = touchMoveX < 0 ? 0 : touchMoveX - touchStartXRef.current;
|
8180
|
+
var posDisX = system === 'ios' && touchMoveX < 0 ? 0 : touchMoveX - touchStartXRef.current;
|
8096
8181
|
var posDisY = touchMoveY - touchStartYRef.current;
|
8097
8182
|
var absDisX = Math.abs(posDisX);
|
8098
8183
|
var absDisY = Math.abs(posDisY);
|
@@ -8282,7 +8367,8 @@
|
|
8282
8367
|
renderTabBarItem: renderTabBarItem,
|
8283
8368
|
renderTabBarInner: renderTabBarInner,
|
8284
8369
|
tabBarStyle: tabBarStyle,
|
8285
|
-
tabBarClass: tabBarClass
|
8370
|
+
tabBarClass: tabBarClass,
|
8371
|
+
tabBarStopPropagation: tabBarStopPropagation
|
8286
8372
|
}, commonProps);
|
8287
8373
|
|
8288
8374
|
var CellComp = /*#__PURE__*/React__default["default"].createElement(TabCell, __assign({}, cellProps));
|
@@ -14462,7 +14548,6 @@
|
|
14462
14548
|
var timeOutEvent;
|
14463
14549
|
|
14464
14550
|
var handleTouchStart = function handleTouchStart(e, image, index) {
|
14465
|
-
e.preventDefault();
|
14466
14551
|
timeOutEvent = setTimeout(function () {
|
14467
14552
|
timeOutEvent = 0;
|
14468
14553
|
onLongPress === null || onLongPress === void 0 ? void 0 : onLongPress(e, image, index);
|
@@ -14597,7 +14682,7 @@
|
|
14597
14682
|
});
|
14598
14683
|
|
14599
14684
|
/*!
|
14600
|
-
* @arco-design/transformable v1.0.
|
14685
|
+
* @arco-design/transformable v1.0.2
|
14601
14686
|
* (c) 2022 ludan.kibbon
|
14602
14687
|
*/
|
14603
14688
|
function _defineProperty(obj, key, value) {
|
@@ -16768,14 +16853,7 @@
|
|
16768
16853
|
var id = "_ARCO_IMAGE_PREVIEW_DIV_" + (baseProps.key || '') + "_";
|
16769
16854
|
var div = appendElementById(id, baseProps.getContainer).child;
|
16770
16855
|
var leaving = false;
|
16771
|
-
|
16772
|
-
function render(props) {
|
16773
|
-
ReactDOM__default["default"].render( /*#__PURE__*/React__default["default"].createElement(Component, __assign({}, props, {
|
16774
|
-
getContainer: function getContainer() {
|
16775
|
-
return div;
|
16776
|
-
}
|
16777
|
-
})), div);
|
16778
|
-
}
|
16856
|
+
var render = new ReactDOMRender(Component, div).render;
|
16779
16857
|
|
16780
16858
|
function update(newConfig) {
|
16781
16859
|
dynamicProps = __assign(__assign({}, dynamicProps), newConfig || {});
|
@@ -18640,16 +18718,16 @@
|
|
18640
18718
|
document.body.appendChild(div);
|
18641
18719
|
}
|
18642
18720
|
|
18643
|
-
|
18644
|
-
|
18645
|
-
|
18721
|
+
var _a = new ReactDOMRender(Component, div),
|
18722
|
+
render = _a.render,
|
18723
|
+
unmount = _a.unmount;
|
18646
18724
|
|
18647
18725
|
function destroy() {
|
18648
18726
|
var onClose = config.onClose;
|
18649
18727
|
onClose && onClose();
|
18650
|
-
|
18728
|
+
unmount();
|
18651
18729
|
|
18652
|
-
if (
|
18730
|
+
if (div.parentNode) {
|
18653
18731
|
div.parentNode.removeChild(div);
|
18654
18732
|
}
|
18655
18733
|
}
|
@@ -19391,10 +19469,10 @@
|
|
19391
19469
|
setDirectionState = _k[2];
|
19392
19470
|
|
19393
19471
|
var getOffset = React.useCallback(function (dir) {
|
19394
|
-
return getDefaultValue(isObject$
|
19472
|
+
return getDefaultValue(isObject$2(edgeOffset) ? edgeOffset[dir] : edgeOffset, defaultEdgeOffset[dir]);
|
19395
19473
|
}, [edgeOffset]);
|
19396
19474
|
var getAutoDirection = React.useCallback(function (dir) {
|
19397
|
-
return getDefaultValue(isObject$
|
19475
|
+
return getDefaultValue(isObject$2(useAutoDirection) ? useAutoDirection[dir] : useAutoDirection, defaultAutoDirection);
|
19398
19476
|
}, [useAutoDirection]);
|
19399
19477
|
React.useEffect(function () {
|
19400
19478
|
setDirectionState(direction);
|
@@ -19836,12 +19914,13 @@
|
|
19836
19914
|
var closeTimer = React.useRef(0);
|
19837
19915
|
/** 垂直方向自适应 */
|
19838
19916
|
|
19839
|
-
var autoVerticalDirection = getDefaultValue(isObject$
|
19917
|
+
var autoVerticalDirection = getDefaultValue(isObject$2(useAutoDirection) ? useAutoDirection.vertical : useAutoDirection, defaultAutoDirection);
|
19840
19918
|
|
19841
19919
|
var popoverDisappear = function popoverDisappear() {
|
19842
19920
|
onVisibleChange(false);
|
19843
19921
|
window.clearTimeout(closeTimer.current);
|
19844
19922
|
closeTimer.current = 0;
|
19923
|
+
mayRemoveEventListenerOnBody();
|
19845
19924
|
};
|
19846
19925
|
|
19847
19926
|
var throttleHandleVerticalScroll = React.useMemo(function () {
|
@@ -19861,7 +19940,7 @@
|
|
19861
19940
|
};
|
19862
19941
|
}, [throttleHandleVerticalScroll, getVerticalScrollContainer, autoVerticalDirection, visibleRef]);
|
19863
19942
|
var mayRemoveEventListenerOnBody = React.useCallback(function () {
|
19864
|
-
document.body.removeEventListener('click', handleClickBody);
|
19943
|
+
document.body.removeEventListener('click', handleClickBody, true);
|
19865
19944
|
document.body.removeEventListener('touchstart', handleTouchBody);
|
19866
19945
|
var el = getVerticalScrollContainer();
|
19867
19946
|
|
@@ -19876,7 +19955,6 @@
|
|
19876
19955
|
|
19877
19956
|
|
19878
19957
|
if (!isContains(wrapperRef.current, e.target) && !isContains(((_a = popoverInnerRef.current) === null || _a === void 0 ? void 0 : _a.dom) || null, e.target)) {
|
19879
|
-
// TODO: 这里仅阻止了react事件,react 18 将不再在document上挂事件,这里的stop会失效
|
19880
19958
|
if (preventBodyClick) {
|
19881
19959
|
e.stopPropagation();
|
19882
19960
|
e.preventDefault();
|
@@ -19902,13 +19980,13 @@
|
|
19902
19980
|
var handle = function handle(e) {
|
19903
19981
|
e.stopPropagation();
|
19904
19982
|
e.preventDefault();
|
19905
|
-
document.body.removeEventListener('click', handle);
|
19983
|
+
document.body.removeEventListener('click', handle, true);
|
19906
19984
|
clearTimeout(preventRecentClickTimer);
|
19907
19985
|
};
|
19908
19986
|
|
19909
|
-
document.body.addEventListener('click', handle);
|
19987
|
+
document.body.addEventListener('click', handle, true);
|
19910
19988
|
preventRecentClickTimer = window.setTimeout(function () {
|
19911
|
-
document.body.removeEventListener('click', handle);
|
19989
|
+
document.body.removeEventListener('click', handle, true);
|
19912
19990
|
}, 500);
|
19913
19991
|
};
|
19914
19992
|
|
@@ -19951,7 +20029,7 @@
|
|
19951
20029
|
var el = getVerticalScrollContainer();
|
19952
20030
|
el && el.addEventListener('scroll', handleScrollBody);
|
19953
20031
|
} else if (clickOtherToClose) {
|
19954
|
-
document.body.addEventListener('click', handleClickBody);
|
20032
|
+
document.body.addEventListener('click', handleClickBody, true);
|
19955
20033
|
}
|
19956
20034
|
};
|
19957
20035
|
/**
|
@@ -20754,6 +20832,7 @@
|
|
20754
20832
|
|
20755
20833
|
var animationRef = React.useRef(0);
|
20756
20834
|
var className = props.className,
|
20835
|
+
style = props.style,
|
20757
20836
|
children = props.children,
|
20758
20837
|
_d = props.loadingText,
|
20759
20838
|
loadingText = _d === void 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -20929,9 +21008,9 @@
|
|
20929
21008
|
'is-disabled': disabled || !touching && useHideAsNestedScroll
|
20930
21009
|
}),
|
20931
21010
|
ref: domRef,
|
20932
|
-
style: contentHeight > 0 ? {
|
21011
|
+
style: contentHeight > 0 ? __assign({
|
20933
21012
|
height: contentHeight
|
20934
|
-
}
|
21013
|
+
}, style || {}) : style
|
20935
21014
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
20936
21015
|
className: cls(prefixCls + "-pull-refresh-content-wrapper")
|
20937
21016
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -20961,6 +21040,7 @@
|
|
20961
21040
|
locale = _c === void 0 ? defaultLocale : _c;
|
20962
21041
|
|
20963
21042
|
var className = props.className,
|
21043
|
+
style = props.style,
|
20964
21044
|
children = props.children,
|
20965
21045
|
_d = props.loosingText,
|
20966
21046
|
loosingText = _d === void 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -21195,6 +21275,7 @@
|
|
21195
21275
|
className: cls(prefixCls + "-pull-refresh all-border-box is-android", className, {
|
21196
21276
|
'is-disabled': (disabled || !touching && useHideAsNestedScroll) && status !== PullRefreshStatus.Loading
|
21197
21277
|
}),
|
21278
|
+
style: style,
|
21198
21279
|
ref: domRef
|
21199
21280
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
21200
21281
|
className: cls(prefixCls + "-pull-refresh-place"),
|
@@ -22664,9 +22745,11 @@
|
|
22664
22745
|
_b = _a.index,
|
22665
22746
|
index = _b === void 0 ? 0 : _b,
|
22666
22747
|
contextStatus = _a.status,
|
22748
|
+
contextAlign = _a.align,
|
22667
22749
|
changeIndex = _a.changeIndex;
|
22668
22750
|
|
22669
22751
|
var status = props.status || contextStatus;
|
22752
|
+
var align = props.align || contextAlign;
|
22670
22753
|
var domRef = React.useRef(null);
|
22671
22754
|
React.useImperativeHandle(ref, function () {
|
22672
22755
|
return {
|
@@ -22705,12 +22788,12 @@
|
|
22705
22788
|
var prefixCls = _a.prefixCls;
|
22706
22789
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
22707
22790
|
ref: domRef,
|
22708
|
-
className: cls(prefixCls + "-steps-item", currentStatus, direction, iconType),
|
22791
|
+
className: cls(prefixCls + "-steps-item", prefixCls + "-steps-item-align-" + align, currentStatus, direction, iconType),
|
22709
22792
|
onClick: function onClick() {
|
22710
22793
|
return changeIndex(index);
|
22711
22794
|
}
|
22712
22795
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
22713
|
-
className: cls(prefixCls + "-steps-item-tail", currentStatus + "-tail-color-with-config")
|
22796
|
+
className: cls(prefixCls + "-steps-item-tail", prefixCls + "-steps-item-tail-status-" + currentStatus, prefixCls + "-steps-item-tail-align-" + align, currentStatus + "-tail-color-with-config")
|
22714
22797
|
}), icon ? /*#__PURE__*/React__default["default"].createElement("div", {
|
22715
22798
|
className: cls(prefixCls + "-steps-item-custom-icon", currentStatus + "-custom-icon-bg-color-with-config")
|
22716
22799
|
}, icon) : /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -22718,7 +22801,7 @@
|
|
22718
22801
|
}, iconType === 'number' ? renderNumIcon(prefixCls) : /*#__PURE__*/React__default["default"].createElement("span", {
|
22719
22802
|
className: cls(prefixCls + "-steps-item-icon-dot")
|
22720
22803
|
})), title || description ? /*#__PURE__*/React__default["default"].createElement("div", {
|
22721
|
-
className: cls(prefixCls + "-steps-item-content")
|
22804
|
+
className: cls(prefixCls + "-steps-item-content", prefixCls + "-steps-item-content-align-" + align)
|
22722
22805
|
}, title ? /*#__PURE__*/React__default["default"].createElement("div", {
|
22723
22806
|
className: cls(prefixCls + "-steps-item-title", currentStatus + "-title-color-with-config")
|
22724
22807
|
}, title) : null, description ? /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -22737,6 +22820,7 @@
|
|
22737
22820
|
children = props.children,
|
22738
22821
|
_b = props.direction,
|
22739
22822
|
direction = _b === void 0 ? 'horizontal' : _b,
|
22823
|
+
userSetAlign = props.align,
|
22740
22824
|
_c = props.iconType,
|
22741
22825
|
iconType = _c === void 0 ? 'number' : _c,
|
22742
22826
|
current = props.current,
|
@@ -22747,6 +22831,8 @@
|
|
22747
22831
|
items = props.items,
|
22748
22832
|
onClick = props.onClick,
|
22749
22833
|
onChange = props.onChange;
|
22834
|
+
var defaultAlign = direction === 'vertical' ? 'start' : 'center';
|
22835
|
+
var align = userSetAlign !== void 0 ? userSetAlign : defaultAlign;
|
22750
22836
|
|
22751
22837
|
var _f = React.useState(Number(defaultIndex)),
|
22752
22838
|
innerIndex = _f[0],
|
@@ -22782,11 +22868,12 @@
|
|
22782
22868
|
direction: direction,
|
22783
22869
|
index: index,
|
22784
22870
|
status: activeIndex === index ? status : void 0,
|
22871
|
+
align: align,
|
22785
22872
|
changeIndex: changeIndex
|
22786
22873
|
},
|
22787
22874
|
key: index
|
22788
22875
|
}, child);
|
22789
|
-
}, [iconType, activeIndex, direction]);
|
22876
|
+
}, [iconType, activeIndex, direction, align]);
|
22790
22877
|
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
22791
22878
|
var prefixCls = _a.prefixCls;
|
22792
22879
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -23092,6 +23179,7 @@
|
|
23092
23179
|
|
23093
23180
|
var dampRateRef = useLatestRef(dampRate);
|
23094
23181
|
var forbidClick = React.useRef(false);
|
23182
|
+
var scrollingRef = React.useRef(null);
|
23095
23183
|
|
23096
23184
|
var _j = useRefState(false),
|
23097
23185
|
moving = _j[0],
|
@@ -23106,6 +23194,7 @@
|
|
23106
23194
|
var prefixCls = React.useContext(GlobalContext).prefixCls;
|
23107
23195
|
var startRef = React.useRef(0);
|
23108
23196
|
var startX = React.useRef(0);
|
23197
|
+
var startY = React.useRef(0);
|
23109
23198
|
var slideX = React.useRef(0);
|
23110
23199
|
var isLayer = openStyleType === 'layer';
|
23111
23200
|
var transitionStyle = React.useMemo(function () {
|
@@ -23116,6 +23205,7 @@
|
|
23116
23205
|
|
23117
23206
|
function resetMoveData() {
|
23118
23207
|
startX.current = 0;
|
23208
|
+
startY.current = 0;
|
23119
23209
|
slideX.current = 0;
|
23120
23210
|
}
|
23121
23211
|
|
@@ -23127,19 +23217,34 @@
|
|
23127
23217
|
function touchstart(e) {
|
23128
23218
|
startRef.current = offsetRef.current;
|
23129
23219
|
resetMoveData();
|
23220
|
+
scrollingRef.current = null;
|
23130
23221
|
startX.current = e.touches[0].pageX;
|
23222
|
+
startY.current = e.touches[0].pageY;
|
23131
23223
|
}
|
23132
23224
|
|
23133
23225
|
function touchmove(e) {
|
23134
|
-
e.
|
23135
|
-
|
23226
|
+
var x = e.changedTouches[0].pageX - startX.current;
|
23227
|
+
var y = e.changedTouches[0].pageY - startY.current;
|
23228
|
+
|
23229
|
+
if (scrollingRef.current === null) {
|
23230
|
+
scrollingRef.current = Math.abs(x) < Math.abs(y);
|
23231
|
+
}
|
23232
|
+
|
23233
|
+
if (scrollingRef.current) {
|
23234
|
+
setMoving(false);
|
23235
|
+
setOffset(0);
|
23236
|
+
return;
|
23237
|
+
}
|
23238
|
+
|
23239
|
+
e.cancelable && e.preventDefault();
|
23240
|
+
slideX.current = x;
|
23136
23241
|
forbidClick.current = true;
|
23137
23242
|
setMoving(true);
|
23138
23243
|
setOffset(getMenuCurrentWidth(slideX.current + startRef.current, -rightMenuWidthRef.current, leftMenuWidthRef.current));
|
23139
23244
|
}
|
23140
23245
|
|
23141
23246
|
function touchend() {
|
23142
|
-
if (movingRef.current) {
|
23247
|
+
if (movingRef.current && !scrollingRef.current) {
|
23143
23248
|
var currentMenu = offsetRef.current > 0 ? 'left' : 'right';
|
23144
23249
|
changeMenu(currentMenu);
|
23145
23250
|
setMoving(false);
|