@arco-design/mobile-react 2.20.0 → 2.21.0
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 +30 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/avatar/index.d.ts +1 -1
- package/cjs/avatar/index.js +1 -1
- package/cjs/badge/index.d.ts +1 -1
- package/cjs/badge/index.js +1 -1
- package/cjs/carousel/index.d.ts +1 -1
- package/cjs/carousel/index.js +1 -1
- package/cjs/cell/index.d.ts +1 -1
- package/cjs/cell/index.js +1 -1
- package/cjs/checkbox/index.d.ts +1 -1
- package/cjs/checkbox/index.js +1 -1
- package/cjs/collapse/index.d.ts +1 -1
- package/cjs/collapse/index.js +1 -1
- package/cjs/count-down/index.d.ts +1 -1
- package/cjs/count-down/index.js +1 -1
- package/cjs/date-picker/index.d.ts +1 -1
- package/cjs/date-picker/index.js +1 -1
- package/cjs/dropdown/dropdown.js +36 -20
- package/cjs/dropdown/style/css/index.css +3 -0
- package/cjs/dropdown/style/index.less +2 -0
- package/cjs/ellipsis/index.d.ts +1 -1
- package/cjs/ellipsis/index.js +1 -1
- package/cjs/image/index.d.ts +1 -1
- package/cjs/image/index.js +1 -1
- package/cjs/image-picker/index.d.ts +4 -175
- package/cjs/image-picker/index.js +41 -18
- package/cjs/image-picker/type.d.ts +174 -0
- package/cjs/image-picker/type.js +3 -0
- package/cjs/image-preview/index.d.ts +1 -1
- package/cjs/image-preview/index.js +1 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +9 -1
- package/cjs/input/hooks.js +49 -8
- package/cjs/input/index.d.ts +1 -1
- package/cjs/input/index.js +1 -1
- package/cjs/input/props.d.ts +8 -2
- package/cjs/notice-bar/index.d.ts +1 -1
- package/cjs/notice-bar/index.js +1 -1
- package/cjs/picker/index.d.ts +1 -1
- package/cjs/picker/index.js +1 -1
- package/cjs/picker-view/index.d.ts +1 -1
- package/cjs/picker-view/index.js +1 -1
- package/cjs/popover/index.d.ts +1 -1
- package/cjs/popover/index.js +1 -1
- package/cjs/popup-swiper/index.js +3 -2
- package/cjs/radio/index.d.ts +1 -1
- package/cjs/radio/index.js +1 -1
- package/cjs/rate/index.d.ts +1 -1
- package/cjs/rate/index.js +1 -1
- package/cjs/search-bar/association.d.ts +3 -0
- package/cjs/search-bar/association.js +92 -0
- package/cjs/search-bar/cancel-button.d.ts +10 -0
- package/cjs/search-bar/cancel-button.js +41 -0
- package/cjs/search-bar/demo/style/css/mobile.css +5 -0
- package/cjs/search-bar/demo/style/mobile.less +9 -0
- package/cjs/search-bar/highlight.d.ts +12 -0
- package/cjs/search-bar/highlight.js +77 -0
- package/cjs/search-bar/index.d.ts +13 -0
- package/cjs/search-bar/index.js +239 -0
- package/cjs/search-bar/style/css/index.css +148 -0
- package/cjs/search-bar/style/css/index.d.ts +2 -0
- package/cjs/search-bar/style/css/index.js +5 -0
- package/cjs/search-bar/style/index.d.ts +2 -0
- package/cjs/search-bar/style/index.js +5 -0
- package/cjs/search-bar/style/index.less +111 -0
- package/cjs/search-bar/type.d.ts +163 -0
- package/cjs/search-bar/type.js +3 -0
- package/cjs/slider/index.d.ts +1 -1
- package/cjs/slider/index.js +1 -1
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/steps/index.js +1 -1
- package/cjs/sticky/index.d.ts +1 -1
- package/cjs/style.d.ts +2 -0
- package/cjs/style.js +4 -0
- package/cjs/swipe-action/demo/style/css/mobile.css +5 -0
- package/cjs/swipe-action/demo/style/mobile.less +9 -0
- package/cjs/swipe-action/index.d.ts +12 -0
- package/cjs/swipe-action/index.js +339 -0
- package/cjs/swipe-action/item.d.ts +11 -0
- package/cjs/swipe-action/item.js +52 -0
- package/cjs/swipe-action/style/css/index.css +88 -0
- package/cjs/swipe-action/style/css/index.d.ts +2 -0
- package/cjs/swipe-action/style/css/index.js +5 -0
- package/cjs/swipe-action/style/index.d.ts +2 -0
- package/cjs/swipe-action/style/index.js +5 -0
- package/cjs/swipe-action/style/index.less +89 -0
- package/cjs/swipe-action/type.d.ts +123 -0
- package/cjs/swipe-action/type.js +3 -0
- package/cjs/switch/index.d.ts +1 -1
- package/cjs/switch/index.js +1 -1
- package/cjs/tabs/tab-pane.js +5 -1
- package/cjs/tag/index.d.ts +1 -1
- package/cjs/tag/index.js +1 -1
- package/cjs/textarea/index.d.ts +1 -1
- package/cjs/textarea/index.js +1 -1
- package/dist/index.js +7450 -6611
- package/dist/index.min.js +6 -6
- package/dist/style.css +203 -0
- package/dist/style.min.css +1 -1
- package/esm/avatar/index.d.ts +1 -1
- package/esm/avatar/index.js +1 -1
- package/esm/badge/index.d.ts +1 -1
- package/esm/badge/index.js +1 -1
- package/esm/carousel/index.d.ts +1 -1
- package/esm/carousel/index.js +1 -1
- package/esm/cell/index.d.ts +1 -1
- package/esm/cell/index.js +1 -1
- package/esm/checkbox/index.d.ts +1 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/collapse/index.d.ts +1 -1
- package/esm/collapse/index.js +1 -1
- package/esm/count-down/index.d.ts +1 -1
- package/esm/count-down/index.js +1 -1
- package/esm/date-picker/index.d.ts +1 -1
- package/esm/date-picker/index.js +1 -1
- package/esm/dropdown/dropdown.js +36 -20
- package/esm/dropdown/style/css/index.css +3 -0
- package/esm/dropdown/style/index.less +2 -0
- package/esm/ellipsis/index.d.ts +1 -1
- package/esm/ellipsis/index.js +1 -1
- package/esm/image/index.d.ts +1 -1
- package/esm/image/index.js +1 -1
- package/esm/image-picker/index.d.ts +4 -175
- package/esm/image-picker/index.js +30 -17
- package/esm/image-picker/type.d.ts +174 -0
- package/esm/image-picker/type.js +1 -0
- package/esm/image-preview/index.d.ts +1 -1
- package/esm/image-preview/index.js +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/input/hooks.js +49 -8
- package/esm/input/index.d.ts +1 -1
- package/esm/input/index.js +1 -1
- package/esm/input/props.d.ts +8 -2
- package/esm/notice-bar/index.d.ts +1 -1
- package/esm/notice-bar/index.js +1 -1
- package/esm/picker/index.d.ts +1 -1
- package/esm/picker/index.js +1 -1
- package/esm/picker-view/index.d.ts +1 -1
- package/esm/picker-view/index.js +1 -1
- package/esm/popover/index.d.ts +1 -1
- package/esm/popover/index.js +1 -1
- package/esm/popup-swiper/index.js +3 -2
- package/esm/radio/index.d.ts +1 -1
- package/esm/radio/index.js +1 -1
- package/esm/rate/index.d.ts +1 -1
- package/esm/rate/index.js +1 -1
- package/esm/search-bar/association.d.ts +3 -0
- package/esm/search-bar/association.js +82 -0
- package/esm/search-bar/cancel-button.d.ts +10 -0
- package/esm/search-bar/cancel-button.js +30 -0
- package/esm/search-bar/demo/style/css/mobile.css +5 -0
- package/esm/search-bar/demo/style/mobile.less +9 -0
- package/esm/search-bar/highlight.d.ts +12 -0
- package/esm/search-bar/highlight.js +66 -0
- package/esm/search-bar/index.d.ts +13 -0
- package/esm/search-bar/index.js +213 -0
- package/esm/search-bar/style/css/index.css +148 -0
- package/esm/search-bar/style/css/index.d.ts +2 -0
- package/esm/search-bar/style/css/index.js +2 -0
- package/esm/search-bar/style/index.d.ts +2 -0
- package/esm/search-bar/style/index.js +2 -0
- package/esm/search-bar/style/index.less +111 -0
- package/esm/search-bar/type.d.ts +163 -0
- package/esm/search-bar/type.js +1 -0
- package/esm/slider/index.d.ts +1 -1
- package/esm/slider/index.js +1 -1
- package/esm/steps/index.d.ts +1 -1
- package/esm/steps/index.js +1 -1
- package/esm/sticky/index.d.ts +1 -1
- package/esm/style.d.ts +2 -0
- package/esm/style.js +2 -0
- package/esm/swipe-action/demo/style/css/mobile.css +5 -0
- package/esm/swipe-action/demo/style/mobile.less +9 -0
- package/esm/swipe-action/index.d.ts +12 -0
- package/esm/swipe-action/index.js +321 -0
- package/esm/swipe-action/item.d.ts +11 -0
- package/esm/swipe-action/item.js +42 -0
- package/esm/swipe-action/style/css/index.css +88 -0
- package/esm/swipe-action/style/css/index.d.ts +2 -0
- package/esm/swipe-action/style/css/index.js +2 -0
- package/esm/swipe-action/style/index.d.ts +2 -0
- package/esm/swipe-action/style/index.js +2 -0
- package/esm/swipe-action/style/index.less +89 -0
- package/esm/swipe-action/type.d.ts +123 -0
- package/esm/swipe-action/type.js +1 -0
- package/esm/switch/index.d.ts +1 -1
- package/esm/switch/index.js +1 -1
- package/esm/tabs/tab-pane.js +5 -1
- package/esm/tag/index.d.ts +1 -1
- package/esm/tag/index.js +1 -1
- package/esm/textarea/index.d.ts +1 -1
- package/esm/textarea/index.js +1 -1
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +34 -0
- package/tokens/app/arcodesign/default/index.d.ts +34 -0
- package/tokens/app/arcodesign/default/index.js +34 -0
- package/tokens/app/arcodesign/default/index.json +398 -0
- package/tokens/app/arcodesign/default/index.less +34 -0
- package/umd/avatar/index.d.ts +1 -1
- package/umd/avatar/index.js +1 -1
- package/umd/badge/index.d.ts +1 -1
- package/umd/badge/index.js +1 -1
- package/umd/carousel/index.d.ts +1 -1
- package/umd/carousel/index.js +1 -1
- package/umd/cell/index.d.ts +1 -1
- package/umd/cell/index.js +1 -1
- package/umd/checkbox/index.d.ts +1 -1
- package/umd/checkbox/index.js +1 -1
- package/umd/collapse/index.d.ts +1 -1
- package/umd/collapse/index.js +1 -1
- package/umd/count-down/index.d.ts +1 -1
- package/umd/count-down/index.js +1 -1
- package/umd/date-picker/index.d.ts +1 -1
- package/umd/date-picker/index.js +1 -1
- package/umd/dropdown/dropdown.js +36 -20
- package/umd/dropdown/style/css/index.css +3 -0
- package/umd/dropdown/style/index.less +2 -0
- package/umd/ellipsis/index.d.ts +1 -1
- package/umd/ellipsis/index.js +1 -1
- package/umd/image/index.d.ts +1 -1
- package/umd/image/index.js +1 -1
- package/umd/image-picker/index.d.ts +4 -175
- package/umd/image-picker/index.js +40 -22
- package/umd/image-picker/type.d.ts +174 -0
- package/umd/image-picker/type.js +17 -0
- package/umd/image-preview/index.d.ts +1 -1
- package/umd/image-preview/index.js +1 -1
- package/umd/index.d.ts +2 -0
- package/umd/index.js +9 -5
- package/umd/input/hooks.js +48 -7
- package/umd/input/index.d.ts +1 -1
- package/umd/input/index.js +1 -1
- package/umd/input/props.d.ts +8 -2
- package/umd/notice-bar/index.d.ts +1 -1
- package/umd/notice-bar/index.js +1 -1
- package/umd/picker/index.d.ts +1 -1
- package/umd/picker/index.js +1 -1
- package/umd/picker-view/index.d.ts +1 -1
- package/umd/picker-view/index.js +1 -1
- package/umd/popover/index.d.ts +1 -1
- package/umd/popover/index.js +1 -1
- package/umd/popup-swiper/index.js +3 -2
- package/umd/radio/index.d.ts +1 -1
- package/umd/radio/index.js +1 -1
- package/umd/rate/index.d.ts +1 -1
- package/umd/rate/index.js +1 -1
- package/umd/search-bar/association.d.ts +3 -0
- package/umd/search-bar/association.js +101 -0
- package/umd/search-bar/cancel-button.d.ts +10 -0
- package/umd/search-bar/cancel-button.js +52 -0
- package/umd/search-bar/demo/style/css/mobile.css +5 -0
- package/umd/search-bar/demo/style/mobile.less +9 -0
- package/umd/search-bar/highlight.d.ts +12 -0
- package/umd/search-bar/highlight.js +87 -0
- package/umd/search-bar/index.d.ts +13 -0
- package/umd/search-bar/index.js +235 -0
- package/umd/search-bar/style/css/index.css +148 -0
- package/umd/search-bar/style/css/index.d.ts +2 -0
- package/umd/search-bar/style/css/index.js +15 -0
- package/umd/search-bar/style/index.d.ts +2 -0
- package/umd/search-bar/style/index.js +15 -0
- package/umd/search-bar/style/index.less +111 -0
- package/umd/search-bar/type.d.ts +163 -0
- package/umd/search-bar/type.js +17 -0
- package/umd/slider/index.d.ts +1 -1
- package/umd/slider/index.js +1 -1
- package/umd/steps/index.d.ts +1 -1
- package/umd/steps/index.js +1 -1
- package/umd/sticky/index.d.ts +1 -1
- package/umd/style.d.ts +2 -0
- package/umd/style.js +4 -4
- package/umd/swipe-action/demo/style/css/mobile.css +5 -0
- package/umd/swipe-action/demo/style/mobile.less +9 -0
- package/umd/swipe-action/index.d.ts +12 -0
- package/umd/swipe-action/index.js +342 -0
- package/umd/swipe-action/item.d.ts +11 -0
- package/umd/swipe-action/item.js +62 -0
- package/umd/swipe-action/style/css/index.css +88 -0
- package/umd/swipe-action/style/css/index.d.ts +2 -0
- package/umd/swipe-action/style/css/index.js +15 -0
- package/umd/swipe-action/style/index.d.ts +2 -0
- package/umd/swipe-action/style/index.js +15 -0
- package/umd/swipe-action/style/index.less +89 -0
- package/umd/swipe-action/type.d.ts +123 -0
- package/umd/swipe-action/type.js +17 -0
- package/umd/switch/index.d.ts +1 -1
- package/umd/switch/index.js +1 -1
- package/umd/tabs/tab-pane.js +5 -1
- package/umd/tag/index.d.ts +1 -1
- package/umd/tag/index.js +1 -1
- package/umd/textarea/index.d.ts +1 -1
- package/umd/textarea/index.js +1 -1
@@ -0,0 +1,62 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global._extends, global.react, global.mobileUtils);
|
11
|
+
global.item = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _mobileUtils) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
17
|
+
|
18
|
+
_exports.__esModule = true;
|
19
|
+
_exports.default = renderAction;
|
20
|
+
_extends2 = _interopRequireDefault(_extends2);
|
21
|
+
_react = _interopRequireDefault(_react);
|
22
|
+
|
23
|
+
function renderAction(_ref) {
|
24
|
+
var action = _ref.action,
|
25
|
+
prefixCls = _ref.prefixCls,
|
26
|
+
index = _ref.index,
|
27
|
+
type = _ref.type,
|
28
|
+
close = _ref.close;
|
29
|
+
var text = action.text,
|
30
|
+
actionStyle = action.style,
|
31
|
+
className = action.className,
|
32
|
+
onClick = action.onClick,
|
33
|
+
icon = action.icon,
|
34
|
+
children = action.children;
|
35
|
+
|
36
|
+
function click() {
|
37
|
+
var result = (onClick == null ? void 0 : onClick()) || null;
|
38
|
+
|
39
|
+
if (!result || typeof result === 'boolean') {
|
40
|
+
!result && close();
|
41
|
+
} else if (result && result.then) {
|
42
|
+
result.then(function (res) {
|
43
|
+
return !res && close();
|
44
|
+
});
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
49
|
+
className: (0, _mobileUtils.cls)(prefixCls + "-" + type + " " + prefixCls + "-info-container", className),
|
50
|
+
style: (0, _extends2.default)({
|
51
|
+
zIndex: index
|
52
|
+
}, actionStyle),
|
53
|
+
onClick: click
|
54
|
+
}, children || /*#__PURE__*/_react.default.createElement("div", {
|
55
|
+
className: prefixCls + "-info"
|
56
|
+
}, icon ? /*#__PURE__*/_react.default.createElement("div", {
|
57
|
+
className: prefixCls + "-info-icon"
|
58
|
+
}, icon) : null, text ? /*#__PURE__*/_react.default.createElement("div", {
|
59
|
+
className: prefixCls + "-info-text"
|
60
|
+
}, text) : null));
|
61
|
+
}
|
62
|
+
});
|
@@ -0,0 +1,88 @@
|
|
1
|
+
.arco-swipe-action {
|
2
|
+
position: relative;
|
3
|
+
-webkit-transition: -webkit-transform 0s;
|
4
|
+
transition: -webkit-transform 0s;
|
5
|
+
transition: transform 0s;
|
6
|
+
transition: transform 0s, -webkit-transform 0s;
|
7
|
+
font-size: 0.32rem ;
|
8
|
+
}
|
9
|
+
.arco-swipe-action.action-open,
|
10
|
+
.arco-swipe-action-menu.action-open {
|
11
|
+
-webkit-transition-timing-function: cubic-bezier(0.2, 0.8, 0.32, 1.28) ;
|
12
|
+
transition-timing-function: cubic-bezier(0.2, 0.8, 0.32, 1.28) ;
|
13
|
+
}
|
14
|
+
.arco-swipe-action.action-close,
|
15
|
+
.arco-swipe-action-menu.action-close {
|
16
|
+
-webkit-transition-timing-function: cubic-bezier(0.34, 0.69, 0.1, 1) ;
|
17
|
+
transition-timing-function: cubic-bezier(0.34, 0.69, 0.1, 1) ;
|
18
|
+
}
|
19
|
+
.arco-swipe-action-content {
|
20
|
+
width: 100%;
|
21
|
+
}
|
22
|
+
.arco-swipe-action-menu {
|
23
|
+
display: -webkit-box;
|
24
|
+
display: -webkit-flex;
|
25
|
+
display: flex;
|
26
|
+
position: absolute;
|
27
|
+
height: 100%;
|
28
|
+
overflow: visible;
|
29
|
+
-webkit-flex-wrap: nowrap;
|
30
|
+
flex-wrap: nowrap;
|
31
|
+
top: 0;
|
32
|
+
-webkit-transition: width 0s;
|
33
|
+
transition: width 0s;
|
34
|
+
}
|
35
|
+
.arco-swipe-action-menu-left {
|
36
|
+
right: 100%;
|
37
|
+
}
|
38
|
+
.arco-swipe-action-menu-right {
|
39
|
+
left: 100%;
|
40
|
+
}
|
41
|
+
.arco-swipe-action-menu-action-left::after {
|
42
|
+
right: 100%;
|
43
|
+
margin-right: -1PX;
|
44
|
+
}
|
45
|
+
.arco-swipe-action-menu-action-right::after {
|
46
|
+
left: 100%;
|
47
|
+
margin-left: -1PX;
|
48
|
+
}
|
49
|
+
.arco-swipe-action-menu-action-info {
|
50
|
+
height: 100%;
|
51
|
+
padding: 0.32rem ;
|
52
|
+
display: -webkit-box;
|
53
|
+
display: -webkit-flex;
|
54
|
+
display: flex;
|
55
|
+
-webkit-box-pack: center;
|
56
|
+
-webkit-justify-content: center;
|
57
|
+
justify-content: center;
|
58
|
+
-webkit-box-align: center;
|
59
|
+
-webkit-align-items: center;
|
60
|
+
align-items: center;
|
61
|
+
}
|
62
|
+
.arco-swipe-action-menu-action-info-container {
|
63
|
+
position: relative;
|
64
|
+
}
|
65
|
+
.arco-swipe-action-menu-action-info-container.open-style-layer {
|
66
|
+
position: absolute;
|
67
|
+
height: 100%;
|
68
|
+
}
|
69
|
+
.arco-swipe-action-menu-action-info-container::after {
|
70
|
+
content: " ";
|
71
|
+
position: absolute;
|
72
|
+
top: 0;
|
73
|
+
height: 100%;
|
74
|
+
width: 0.6rem ;
|
75
|
+
background: inherit;
|
76
|
+
}
|
77
|
+
.arco-swipe-action-menu-action-info-text {
|
78
|
+
white-space: nowrap;
|
79
|
+
font-size: 0.32rem ;
|
80
|
+
line-height: 0.44rem ;
|
81
|
+
color: #ffffff ;
|
82
|
+
}
|
83
|
+
.arco-swipe-action-menu-action-info-icon {
|
84
|
+
margin-right: 0.08rem ;
|
85
|
+
height: 0.4rem ;
|
86
|
+
width: 0.4rem ;
|
87
|
+
color: #ffffff ;
|
88
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["../../../../style/css/public.css", "./index.css"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(require("../../../../style/css/public.css"), require("./index.css"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(global._public, global.index);
|
11
|
+
global.index = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_public, _index) {
|
14
|
+
"use strict";
|
15
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["../../../style/public.less", "./index.less"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(require("../../../style/public.less"), require("./index.less"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(global._public, global.index);
|
11
|
+
global.index = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_public, _index) {
|
14
|
+
"use strict";
|
15
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
@import '../../../style/mixin.less';
|
2
|
+
|
3
|
+
.@{prefix}-swipe-action {
|
4
|
+
position: relative;
|
5
|
+
transition: transform 0s;
|
6
|
+
.use-var(font-size,swipe-action-text-font-size);
|
7
|
+
|
8
|
+
&, &-menu {
|
9
|
+
&.action-open {
|
10
|
+
.use-var(transition-timing-function, swipe-action-open-transition);
|
11
|
+
}
|
12
|
+
&.action-close {
|
13
|
+
.use-var(transition-timing-function, swipe-action-close-transition);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
&-content {
|
18
|
+
width: 100%;
|
19
|
+
}
|
20
|
+
|
21
|
+
&-menu {
|
22
|
+
display: flex;
|
23
|
+
position: absolute;
|
24
|
+
height: 100%;
|
25
|
+
overflow: visible;
|
26
|
+
flex-wrap: nowrap;
|
27
|
+
top: 0;
|
28
|
+
transition: width 0s;
|
29
|
+
|
30
|
+
&-left {
|
31
|
+
right: 100%;
|
32
|
+
}
|
33
|
+
|
34
|
+
&-right {
|
35
|
+
left: 100%;
|
36
|
+
}
|
37
|
+
&-action {
|
38
|
+
&-left {
|
39
|
+
&::after {
|
40
|
+
right: 100%;
|
41
|
+
margin-right: -1PX;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
&-right {
|
45
|
+
&::after {
|
46
|
+
left: 100%;
|
47
|
+
margin-left: -1PX;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
&-info {
|
51
|
+
height: 100%;
|
52
|
+
.use-var(padding, swipe-action-info-padding);
|
53
|
+
display: flex;
|
54
|
+
justify-content: center;
|
55
|
+
align-items: center;
|
56
|
+
|
57
|
+
&-container {
|
58
|
+
position: relative;
|
59
|
+
&.open-style-layer {
|
60
|
+
position: absolute;
|
61
|
+
height: 100%;
|
62
|
+
}
|
63
|
+
&::after {
|
64
|
+
content: " ";
|
65
|
+
position: absolute;
|
66
|
+
top: 0;
|
67
|
+
height: 100%;
|
68
|
+
.use-var(width, swipe-action-info-bounce-buffer);
|
69
|
+
background: inherit;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
&-text {
|
74
|
+
white-space: nowrap;
|
75
|
+
.use-var(font-size,swipe-action-text-font-size);
|
76
|
+
.use-var(line-height,swipe-action-text-line-height);
|
77
|
+
.use-var(color, swipe-action-text-color);
|
78
|
+
}
|
79
|
+
|
80
|
+
&-icon {
|
81
|
+
.use-var(margin-right,swipe-action-icon-margin-right);
|
82
|
+
.use-var(height, swipe-action-icon-height);
|
83
|
+
.use-var(width, swipe-action-icon-width);
|
84
|
+
.use-var(color, swipe-action-text-color);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
2
|
+
export interface SwipeActionProps {
|
3
|
+
/**
|
4
|
+
* 自定义类名
|
5
|
+
* @en Custom classname
|
6
|
+
*/
|
7
|
+
className?: string;
|
8
|
+
/**
|
9
|
+
* 自定义样式
|
10
|
+
* @en Custom style
|
11
|
+
*/
|
12
|
+
style?: React.CSSProperties;
|
13
|
+
/**
|
14
|
+
* 子元素
|
15
|
+
* @en Inner Content
|
16
|
+
*/
|
17
|
+
children: ReactNode;
|
18
|
+
/**
|
19
|
+
* 右侧菜单
|
20
|
+
* @en right Menu
|
21
|
+
*/
|
22
|
+
rightActions?: Action[];
|
23
|
+
/**
|
24
|
+
* 左侧菜单
|
25
|
+
* @en left Menu
|
26
|
+
*/
|
27
|
+
leftActions?: Action[];
|
28
|
+
/**
|
29
|
+
* 点击外部是否自动归位
|
30
|
+
* @en Click outside for auto return
|
31
|
+
* @default false
|
32
|
+
*/
|
33
|
+
closeOnTouchOutside?: boolean;
|
34
|
+
/**
|
35
|
+
* 菜单滑出多少距离后自动滑出/关闭的系数 范围 0-1
|
36
|
+
* @en How far the menu slides off/off automatically ranges from 0 to 1
|
37
|
+
* @default 0.15
|
38
|
+
*/
|
39
|
+
threshold?: number;
|
40
|
+
/**
|
41
|
+
* 是否禁用
|
42
|
+
* @en Whether to disable
|
43
|
+
* @default false
|
44
|
+
*/
|
45
|
+
disabled?: boolean;
|
46
|
+
/**
|
47
|
+
* 动画的执行时间 (单位ms)
|
48
|
+
* @en Animation execution time in ms
|
49
|
+
* @default 300
|
50
|
+
*/
|
51
|
+
transitionDuration?: number;
|
52
|
+
/**
|
53
|
+
* 阻尼系数
|
54
|
+
* @en Damping coefficient
|
55
|
+
* @default 15
|
56
|
+
*/
|
57
|
+
dampRate?: number;
|
58
|
+
/**
|
59
|
+
* 菜单滑入时的样式类型,layer - 分层堆叠进入,push - 直接依次推入
|
60
|
+
* @en The style type when the menu slides in. layer - the menu is stacked in layers; push - the menu is pushed directly in sequence
|
61
|
+
* @default "layer"
|
62
|
+
*/
|
63
|
+
openStyleType?: 'layer' | 'push';
|
64
|
+
/**
|
65
|
+
* 滑出动画结束后触发
|
66
|
+
* @en Triggered when the slide out animation ends
|
67
|
+
*/
|
68
|
+
onOpen?: (direction: 'left' | 'right') => void;
|
69
|
+
/**
|
70
|
+
* 滑入动画结束后触发
|
71
|
+
* @en Triggered when the slide in animation ends
|
72
|
+
*/
|
73
|
+
onClose?: (direction: 'left' | 'right') => void;
|
74
|
+
}
|
75
|
+
export interface SwipeActionRef {
|
76
|
+
/**
|
77
|
+
* 最外层元素 DOM
|
78
|
+
* @en The outermost element DOM
|
79
|
+
*/
|
80
|
+
dom: HTMLDivElement | null;
|
81
|
+
/**
|
82
|
+
* 使滑动条归位
|
83
|
+
* @en Bring the slider back into position
|
84
|
+
*/
|
85
|
+
close: () => void;
|
86
|
+
/**
|
87
|
+
* 打开滑动条,默认打开右边
|
88
|
+
* @en Open the slider, the right by default
|
89
|
+
*/
|
90
|
+
open: (direction: 'left' | 'right') => void;
|
91
|
+
}
|
92
|
+
export interface Action {
|
93
|
+
/**
|
94
|
+
* 自定义内容
|
95
|
+
* @en Custom Content
|
96
|
+
*/
|
97
|
+
text?: ReactNode;
|
98
|
+
/**
|
99
|
+
* 自定义图标
|
100
|
+
* @en Custom Icon
|
101
|
+
*/
|
102
|
+
icon?: ReactNode;
|
103
|
+
/**
|
104
|
+
* 自定义样式
|
105
|
+
* @en Custom Style
|
106
|
+
*/
|
107
|
+
style?: CSSProperties;
|
108
|
+
/**
|
109
|
+
* 自定义类名
|
110
|
+
* @en Custom Style
|
111
|
+
*/
|
112
|
+
className?: string;
|
113
|
+
/**
|
114
|
+
* 点击事件 返回true可以阻止菜单的关闭
|
115
|
+
* @en Clicking the event to return true prevents the menu from closing
|
116
|
+
*/
|
117
|
+
onClick?: () => (void | boolean) | Promise<void | boolean>;
|
118
|
+
/**
|
119
|
+
* 子元素没有text或者icon的传递children
|
120
|
+
* @en Child elements do not pass children with text or icon
|
121
|
+
*/
|
122
|
+
children?: ReactNode;
|
123
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports);
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports);
|
11
|
+
global.type = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
});
|
package/umd/switch/index.d.ts
CHANGED
package/umd/switch/index.js
CHANGED
package/umd/tabs/tab-pane.js
CHANGED
@@ -182,10 +182,14 @@
|
|
182
182
|
var topDis = curPaneTop - containerTop - scrollOffset;
|
183
183
|
var scrollAttr = scrollVertical ? 'scrollTop' : 'scrollLeft';
|
184
184
|
var scrollTop = isGlobal ? Math.max(document.documentElement[scrollAttr], document.body[scrollAttr]) : scrollEle[scrollAttr];
|
185
|
+
var scrollSizeAttr = scrollVertical ? 'scrollHeight' : 'scrollWidth';
|
186
|
+
var sizeAttr = scrollVertical ? 'offsetHeight' : 'offsetWidth';
|
187
|
+
var maxTopDis = isGlobal ? Math.max(document.documentElement[scrollSizeAttr], document.body[scrollSizeAttr]) - scrollTop - (scrollVertical ? window.innerHeight : window.innerWidth) : scrollEle[scrollSizeAttr] - scrollTop - scrollEle[sizeAttr];
|
188
|
+
var normalizedTopDis = Math.min(maxTopDis, topDis);
|
185
189
|
clearTimeout(timerRef.current);
|
186
190
|
autoScrollingRef.current = true;
|
187
191
|
var duration = rightNow ? 0 : transitionDuration || 0;
|
188
|
-
(0, _mobileUtils.scrollWithAnimation)(scrollTop, scrollTop +
|
192
|
+
(0, _mobileUtils.scrollWithAnimation)(scrollTop, scrollTop + normalizedTopDis, function (top) {
|
189
193
|
if (isGlobal) {
|
190
194
|
document.documentElement[scrollAttr] = top;
|
191
195
|
document.body[scrollAttr] = top;
|
package/umd/tag/index.d.ts
CHANGED
package/umd/tag/index.js
CHANGED
package/umd/textarea/index.d.ts
CHANGED