@nutui/nutui-react-taro 3.0.19-cpp.26-beta.5 → 3.0.19-cpp.27
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 +14 -0
- package/dist/cjs/locales/base.d.ts +5 -0
- package/dist/cjs/locales/en-US.js +5 -0
- package/dist/cjs/locales/id-ID.js +5 -0
- package/dist/cjs/locales/ja-JP.js +6 -1
- package/dist/cjs/locales/tr-TR.js +5 -0
- package/dist/cjs/locales/zh-CN.js +5 -0
- package/dist/cjs/locales/zh-TW.js +5 -0
- package/dist/cjs/locales/zh-UG.js +5 -0
- package/dist/cjs/packages/address/address.d.ts +1 -1
- package/dist/cjs/packages/animatingnumbers/countup.js +3 -1
- package/dist/cjs/packages/avatar/avatar.js +32 -6
- package/dist/cjs/packages/badge/badge.js +16 -3
- package/dist/cjs/packages/button/button.d.ts +2 -21
- package/dist/cjs/packages/button/button.js +2 -3
- package/dist/cjs/packages/button/index.d.ts +0 -1
- package/dist/cjs/packages/dialog/dialog.js +6 -2
- package/dist/cjs/packages/divider/divider.js +2 -2
- package/dist/cjs/packages/empty/empty.d.ts +4 -4
- package/dist/cjs/packages/image/image.js +11 -3
- package/dist/cjs/packages/input/input.js +10 -3
- package/dist/cjs/packages/progress/progress.js +2 -4
- package/dist/cjs/packages/quickenter/quickenter.js +21 -15
- package/dist/cjs/packages/quickenter/style/quickenter.scss +10 -2
- package/dist/cjs/packages/quickenter/style/style.css +7 -1
- package/dist/cjs/packages/quickenter/style/style.harmony.css +6 -1
- package/dist/cjs/packages/quickenter/style-jmapp/quickenter.scss +10 -2
- package/dist/cjs/packages/quickenter/style-jmapp/style.css +7 -1
- package/dist/cjs/packages/quickenter/style-jrkf/quickenter.scss +10 -2
- package/dist/cjs/packages/quickenter/style-jrkf/style.css +7 -1
- package/dist/cjs/packages/resultpage/resultpage.js +2 -1
- package/dist/cjs/packages/searchbar/searchbar.js +23 -9
- package/dist/cjs/packages/swipe/swipe.d.ts +1 -1
- package/dist/cjs/packages/tabs/tabs.js +12 -5
- package/dist/cjs/types/spec/button/base.d.ts +2 -1
- package/dist/cjs/types/spec/button/taro.d.ts +5 -1
- package/dist/cjs/types/spec/quickenter/base.d.ts +1 -0
- package/dist/cjs/utils/taro/get-rect.js +4 -2
- package/dist/es/locales/base.d.ts +5 -0
- package/dist/es/locales/en-US.js +5 -0
- package/dist/es/locales/id-ID.js +5 -0
- package/dist/es/locales/ja-JP.js +6 -1
- package/dist/es/locales/tr-TR.js +5 -0
- package/dist/es/locales/zh-CN.js +5 -0
- package/dist/es/locales/zh-TW.js +5 -0
- package/dist/es/locales/zh-UG.js +5 -0
- package/dist/es/packages/address/address.d.ts +1 -1
- package/dist/es/packages/animatingnumbers/countup.js +3 -1
- package/dist/es/packages/avatar/avatar.js +32 -6
- package/dist/es/packages/badge/badge.js +16 -3
- package/dist/es/packages/button/button.d.ts +2 -21
- package/dist/es/packages/button/button.js +2 -4
- package/dist/es/packages/button/index.d.ts +0 -1
- package/dist/es/packages/dialog/dialog.js +6 -2
- package/dist/es/packages/divider/divider.js +1 -1
- package/dist/es/packages/empty/empty.d.ts +4 -4
- package/dist/es/packages/image/image.js +11 -3
- package/dist/es/packages/input/input.js +10 -3
- package/dist/es/packages/popup/popup.js +1 -2
- package/dist/es/packages/progress/progress.js +2 -4
- package/dist/es/packages/quickenter/quickenter.js +19 -13
- package/dist/es/packages/quickenter/style/quickenter.scss +10 -2
- package/dist/es/packages/quickenter/style/style.css +7 -1
- package/dist/es/packages/quickenter/style/style.harmony.css +6 -1
- package/dist/es/packages/quickenter/style-jmapp/quickenter.scss +10 -2
- package/dist/es/packages/quickenter/style-jmapp/style.css +7 -1
- package/dist/es/packages/quickenter/style-jrkf/quickenter.scss +10 -2
- package/dist/es/packages/quickenter/style-jrkf/style.css +7 -1
- package/dist/es/packages/resultpage/resultpage.js +2 -1
- package/dist/es/packages/searchbar/searchbar.js +23 -9
- package/dist/es/packages/swipe/swipe.d.ts +1 -1
- package/dist/es/packages/tabs/tabs.js +12 -5
- package/dist/es/types/spec/button/base.d.ts +2 -1
- package/dist/es/types/spec/button/taro.d.ts +5 -1
- package/dist/es/types/spec/quickenter/base.d.ts +1 -0
- package/dist/es/utils/taro/get-rect.js +4 -2
- package/dist/nutui.react.umd.js +1127 -102
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +30 -30
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +34 -34
- package/dist/style.css +1 -1
- package/dist/style.scss +44 -44
- package/dist/styles/jd-font.scss +2 -2
- package/dist/styles/themes/daojia.css +1 -1
- package/dist/styles/themes/dark-daojia.css +1 -1
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/package.json +1 -1
|
@@ -405,7 +405,8 @@
|
|
|
405
405
|
|
|
406
406
|
.nut-quickenter {
|
|
407
407
|
width: 100%;
|
|
408
|
-
|
|
408
|
+
/* 限制弹层最大高度,包含安全区 */
|
|
409
|
+
max-height: calc(var(--nutui-quickenter-max-height, 256px) + env(safe-area-inset-top, 0));
|
|
409
410
|
background: var(--nutui-quickenter-bg-color, #f5f5f5);
|
|
410
411
|
border-radius: 0 0 12px 12px;
|
|
411
412
|
overflow: hidden;
|
|
@@ -414,6 +415,10 @@
|
|
|
414
415
|
flex-direction: column;
|
|
415
416
|
box-shadow: var(--nutui-quickenter-box-shadow, 0px 8px 16px rgba(141, 153, 167, 0.2), 0px -0.5px 0px rgba(0, 0, 0, 0.05) inset);
|
|
416
417
|
}
|
|
418
|
+
.nut-quickenter.safe-area-top {
|
|
419
|
+
/* 使用 env fallback,确保旧浏览器返回 0 */
|
|
420
|
+
padding-top: calc(env(safe-area-inset-top, 0) * var(--nutui-safe-area-multiple, 1));
|
|
421
|
+
}
|
|
417
422
|
.nut-quickenter-control {
|
|
418
423
|
display: flex;
|
|
419
424
|
align-items: center;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.nut-quickenter {
|
|
2
2
|
width: 100%;
|
|
3
|
-
|
|
3
|
+
/* 限制弹层最大高度,包含安全区 */
|
|
4
|
+
max-height: calc(#{$quickenter-max-height} + env(safe-area-inset-top, 0));
|
|
4
5
|
background: $quickenter-bg-color;
|
|
5
6
|
border-radius: 0 0 12px 12px;
|
|
6
7
|
overflow: hidden;
|
|
@@ -10,6 +11,13 @@
|
|
|
10
11
|
box-shadow: $quickenter-box-shadow;
|
|
11
12
|
// backdrop-filter: $quickenter-backdrop-filter;
|
|
12
13
|
|
|
14
|
+
&.safe-area-top {
|
|
15
|
+
/* 使用 env fallback,确保旧浏览器返回 0 */
|
|
16
|
+
padding-top: calc(
|
|
17
|
+
env(safe-area-inset-top, 0) * var(--nutui-safe-area-multiple, 1)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
&-control {
|
|
14
22
|
display: flex;
|
|
15
23
|
align-items: center;
|
|
@@ -44,7 +52,7 @@
|
|
|
44
52
|
&-content {
|
|
45
53
|
flex: 1;
|
|
46
54
|
padding: 10px 28px;
|
|
47
|
-
overflow-y: hidden; //
|
|
55
|
+
overflow-y: hidden; // 始终可滚动,防止内容被遮挡
|
|
48
56
|
box-sizing: border-box;
|
|
49
57
|
|
|
50
58
|
&-scrollable {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
1
2
|
/* #ifdef harmony */
|
|
2
3
|
/* #endif */
|
|
3
4
|
/* #ifndef harmony */
|
|
4
5
|
/* #endif */
|
|
5
6
|
.nut-quickenter {
|
|
6
7
|
width: 100%;
|
|
7
|
-
|
|
8
|
+
/* 限制弹层最大高度,包含安全区 */
|
|
9
|
+
max-height: calc(var(--nutui-quickenter-max-height, 256px) + env(safe-area-inset-top, 0));
|
|
8
10
|
background: var(--nutui-quickenter-bg-color, #f5f5f5);
|
|
9
11
|
border-radius: 0 0 12px 12px;
|
|
10
12
|
overflow: hidden;
|
|
@@ -13,6 +15,10 @@
|
|
|
13
15
|
flex-direction: column;
|
|
14
16
|
box-shadow: var(--nutui-quickenter-box-shadow, 0px 8px 16px rgba(141, 153, 167, 0.2), 0px -0.5px 0px rgba(0, 0, 0, 0.05) inset);
|
|
15
17
|
}
|
|
18
|
+
.nut-quickenter.safe-area-top {
|
|
19
|
+
/* 使用 env fallback,确保旧浏览器返回 0 */
|
|
20
|
+
padding-top: calc(env(safe-area-inset-top, 0) * var(--nutui-safe-area-multiple, 1));
|
|
21
|
+
}
|
|
16
22
|
.nut-quickenter-control {
|
|
17
23
|
display: flex;
|
|
18
24
|
align-items: center;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.nut-quickenter {
|
|
2
2
|
width: 100%;
|
|
3
|
-
|
|
3
|
+
/* 限制弹层最大高度,包含安全区 */
|
|
4
|
+
max-height: calc(#{$quickenter-max-height} + env(safe-area-inset-top, 0));
|
|
4
5
|
background: $quickenter-bg-color;
|
|
5
6
|
border-radius: 0 0 12px 12px;
|
|
6
7
|
overflow: hidden;
|
|
@@ -10,6 +11,13 @@
|
|
|
10
11
|
box-shadow: $quickenter-box-shadow;
|
|
11
12
|
// backdrop-filter: $quickenter-backdrop-filter;
|
|
12
13
|
|
|
14
|
+
&.safe-area-top {
|
|
15
|
+
/* 使用 env fallback,确保旧浏览器返回 0 */
|
|
16
|
+
padding-top: calc(
|
|
17
|
+
env(safe-area-inset-top, 0) * var(--nutui-safe-area-multiple, 1)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
&-control {
|
|
14
22
|
display: flex;
|
|
15
23
|
align-items: center;
|
|
@@ -44,7 +52,7 @@
|
|
|
44
52
|
&-content {
|
|
45
53
|
flex: 1;
|
|
46
54
|
padding: 10px 28px;
|
|
47
|
-
overflow-y: hidden; //
|
|
55
|
+
overflow-y: hidden; // 始终可滚动,防止内容被遮挡
|
|
48
56
|
box-sizing: border-box;
|
|
49
57
|
|
|
50
58
|
&-scrollable {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
1
2
|
/* #ifdef harmony */
|
|
2
3
|
/* #endif */
|
|
3
4
|
/* #ifndef harmony */
|
|
4
5
|
/* #endif */
|
|
5
6
|
.nut-quickenter {
|
|
6
7
|
width: 100%;
|
|
7
|
-
|
|
8
|
+
/* 限制弹层最大高度,包含安全区 */
|
|
9
|
+
max-height: calc(var(--nutui-quickenter-max-height, 256px) + env(safe-area-inset-top, 0));
|
|
8
10
|
background: var(--nutui-quickenter-bg-color, #f5f5f5);
|
|
9
11
|
border-radius: 0 0 12px 12px;
|
|
10
12
|
overflow: hidden;
|
|
@@ -13,6 +15,10 @@
|
|
|
13
15
|
flex-direction: column;
|
|
14
16
|
box-shadow: var(--nutui-quickenter-box-shadow, 0px 8px 16px rgba(141, 153, 167, 0.2), 0px -0.5px 0px rgba(0, 0, 0, 0.05) inset);
|
|
15
17
|
}
|
|
18
|
+
.nut-quickenter.safe-area-top {
|
|
19
|
+
/* 使用 env fallback,确保旧浏览器返回 0 */
|
|
20
|
+
padding-top: calc(env(safe-area-inset-top, 0) * var(--nutui-safe-area-multiple, 1));
|
|
21
|
+
}
|
|
16
22
|
.nut-quickenter-control {
|
|
17
23
|
display: flex;
|
|
18
24
|
align-items: center;
|
|
@@ -50,7 +50,8 @@ var ResultPage = function ResultPage(props) {
|
|
|
50
50
|
className: cls,
|
|
51
51
|
style: style
|
|
52
52
|
}, /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
53
|
-
className: "".concat(classPrefix, "-icon")
|
|
53
|
+
className: "".concat(classPrefix, "-icon"),
|
|
54
|
+
ariaHidden: true
|
|
54
55
|
}, icon || defaultStatus[status]), typeof title === 'string' && title ? /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
55
56
|
className: "".concat(classPrefix, "-title")
|
|
56
57
|
}, title) : title, typeof description === 'string' && description ? /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
@@ -34,7 +34,9 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
34
34
|
left: '',
|
|
35
35
|
right: '',
|
|
36
36
|
rightIn: '',
|
|
37
|
-
leftIn: /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Search,
|
|
37
|
+
leftIn: /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Search, {
|
|
38
|
+
ariaHidden: true
|
|
39
|
+
}),
|
|
38
40
|
tag: false
|
|
39
41
|
});
|
|
40
42
|
var SearchBar = function SearchBar(props) {
|
|
@@ -189,12 +191,15 @@ var SearchBar = function SearchBar(props) {
|
|
|
189
191
|
onClick: function onClick(e) {
|
|
190
192
|
return onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, e);
|
|
191
193
|
}
|
|
192
|
-
}, item, /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Close,
|
|
194
|
+
}, item, /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Close, {
|
|
195
|
+
ariaLabel: locale.close
|
|
196
|
+
}));
|
|
193
197
|
}));
|
|
194
198
|
}, [
|
|
195
199
|
value,
|
|
196
200
|
onItemClick,
|
|
197
|
-
innerTag
|
|
201
|
+
innerTag,
|
|
202
|
+
locale.close
|
|
198
203
|
]);
|
|
199
204
|
var renderLeftIn = (0, _react.useCallback)(function() {
|
|
200
205
|
if (!leftIn) return null;
|
|
@@ -207,11 +212,16 @@ var SearchBar = function SearchBar(props) {
|
|
|
207
212
|
var renderLeft = (0, _react.useCallback)(function() {
|
|
208
213
|
if (!backable && !left) return null;
|
|
209
214
|
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
210
|
-
className: "".concat(classPrefix, "-left")
|
|
211
|
-
|
|
215
|
+
className: "".concat(classPrefix, "-left"),
|
|
216
|
+
ariaRole: backable ? 'button' : undefined,
|
|
217
|
+
ariaLabel: backable ? locale.back : undefined
|
|
218
|
+
}, backable ? /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.ArrowLeft, {
|
|
219
|
+
ariaHidden: true
|
|
220
|
+
}) : left);
|
|
212
221
|
}, [
|
|
213
222
|
backable,
|
|
214
|
-
left
|
|
223
|
+
left,
|
|
224
|
+
locale
|
|
215
225
|
]);
|
|
216
226
|
var renderRightIn = (0, _react.useCallback)(function() {
|
|
217
227
|
if (!rightIn) return null;
|
|
@@ -238,13 +248,17 @@ var SearchBar = function SearchBar(props) {
|
|
|
238
248
|
visibility: "".concat(!innerTag && value && clearable ? 'visible' : 'hidden')
|
|
239
249
|
},
|
|
240
250
|
onClick: clearaVal,
|
|
241
|
-
|
|
242
|
-
|
|
251
|
+
ariaRole: "button",
|
|
252
|
+
ariaLabel: locale.clear
|
|
253
|
+
}, /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.MaskClose, {
|
|
254
|
+
ariaHidden: true
|
|
255
|
+
}));
|
|
243
256
|
}, [
|
|
244
257
|
value,
|
|
245
258
|
clearable,
|
|
246
259
|
clearaVal,
|
|
247
|
-
innerTag
|
|
260
|
+
innerTag,
|
|
261
|
+
locale
|
|
248
262
|
]);
|
|
249
263
|
var onConfirm = function onConfirm() {
|
|
250
264
|
onSearch && onSearch(value);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SwipeRef, TaroSwipeProps } from "../../types";
|
|
3
|
-
export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
3
|
+
export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchStart" | "onTouchMove" | "onTouchEnd"> & React.RefAttributes<SwipeRef>>;
|
|
@@ -63,6 +63,7 @@ var Tabs = function Tabs(props) {
|
|
|
63
63
|
onChange: onChange
|
|
64
64
|
}), 2), value = _usePropsValue[0], setValue = _usePropsValue[1];
|
|
65
65
|
var titleItemsRef = (0, _react.useRef)([]);
|
|
66
|
+
var tabsRef = (0, _react.useRef)(null);
|
|
66
67
|
var getTitles = function getTitles() {
|
|
67
68
|
var titles = [];
|
|
68
69
|
_react.default.Children.forEach(children, function(child, idx) {
|
|
@@ -102,7 +103,8 @@ var Tabs = function Tabs(props) {
|
|
|
102
103
|
var classesTitle = (0, _classnames.default)("".concat(classPrefix, "-titles"), (_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-titles-").concat(activeType), activeType), (0, _define_property._)(_obj, "".concat(classPrefix, "-titles-").concat(align), align), _obj));
|
|
103
104
|
var getRect = function getRect(selector) {
|
|
104
105
|
return new Promise(function(resolve) {
|
|
105
|
-
|
|
106
|
+
var _tabsRef_current;
|
|
107
|
+
(0, _taro.createSelectorQuery)().in(((_tabsRef_current = tabsRef.current) === null || _tabsRef_current === void 0 ? void 0 : _tabsRef_current._scope) || tabsRef.current).select(selector).boundingClientRect().exec(function() {
|
|
106
108
|
var rect = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
107
109
|
resolve(rect[0]);
|
|
108
110
|
});
|
|
@@ -110,7 +112,8 @@ var Tabs = function Tabs(props) {
|
|
|
110
112
|
};
|
|
111
113
|
var getAllRect = function getAllRect(selector) {
|
|
112
114
|
return new Promise(function(resolve) {
|
|
113
|
-
|
|
115
|
+
var _tabsRef_current;
|
|
116
|
+
(0, _taro.createSelectorQuery)().in(((_tabsRef_current = tabsRef.current) === null || _tabsRef_current === void 0 ? void 0 : _tabsRef_current._scope) || tabsRef.current).selectAll(selector).boundingClientRect().exec(function() {
|
|
114
117
|
var rect = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
115
118
|
resolve(rect[0]);
|
|
116
119
|
});
|
|
@@ -190,9 +193,11 @@ var Tabs = function Tabs(props) {
|
|
|
190
193
|
setValue(item.value);
|
|
191
194
|
}
|
|
192
195
|
};
|
|
193
|
-
return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread._)({
|
|
196
|
+
return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread_props._)((0, _object_spread._)({
|
|
194
197
|
className: classes
|
|
195
|
-
}, rest),
|
|
198
|
+
}, rest), {
|
|
199
|
+
ref: tabsRef
|
|
200
|
+
}), /*#__PURE__*/ _react.default.createElement(_components.ScrollView, {
|
|
196
201
|
enableFlex: true,
|
|
197
202
|
scrollX: direction === 'horizontal',
|
|
198
203
|
scrollY: direction === 'vertical',
|
|
@@ -224,7 +229,9 @@ var Tabs = function Tabs(props) {
|
|
|
224
229
|
background: activeColor
|
|
225
230
|
}
|
|
226
231
|
}), activeType === 'smile' && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
227
|
-
className: "".concat(classPrefix, "-titles-item-smile")
|
|
232
|
+
className: "".concat(classPrefix, "-titles-item-smile"),
|
|
233
|
+
// @ts-ignore
|
|
234
|
+
ariaHidden: true
|
|
228
235
|
}, /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.JoySmile, {
|
|
229
236
|
color: activeColor
|
|
230
237
|
})), /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import type { MouseEvent } from 'react';
|
|
2
3
|
import { BaseProps } from '../../base/props';
|
|
3
4
|
import { UIFill, UIRound, UISize, UIType } from '../../base/atoms';
|
|
4
5
|
export interface BaseButton extends BaseProps {
|
|
@@ -14,5 +15,5 @@ export interface BaseButton extends BaseProps {
|
|
|
14
15
|
rightIcon: ReactNode;
|
|
15
16
|
id: string;
|
|
16
17
|
nativeType: 'submit' | 'reset' | 'button';
|
|
17
|
-
onClick: (e:
|
|
18
|
+
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
18
19
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ButtonProps as MiniProgramButtonProps } from '@tarojs/components';
|
|
1
2
|
import { BaseButton } from './base';
|
|
2
|
-
|
|
3
|
+
type OmitMiniProgramButtonProps = Omit<MiniProgramButtonProps, 'size' | 'type' | 'onClick' | 'style' | 'disabled' | 'loading' | 'id'>;
|
|
4
|
+
export interface TaroButtonProps extends BaseButton, OmitMiniProgramButtonProps {
|
|
5
|
+
nativeType: 'submit' | 'reset';
|
|
3
6
|
}
|
|
7
|
+
export {};
|
|
@@ -20,6 +20,7 @@ export interface BaseQuickEnter<POPUP_PROPS = any> extends BaseProps {
|
|
|
20
20
|
popupProps?: POPUP_PROPS;
|
|
21
21
|
closeOnOverlayClick?: boolean;
|
|
22
22
|
closeIcon?: ReactNode;
|
|
23
|
+
safeAreaInsetTop?: boolean;
|
|
23
24
|
onClose?: () => void;
|
|
24
25
|
onChange?: (item: QuickEnterOption, index: number) => void;
|
|
25
26
|
children?: ReactNode;
|
|
@@ -55,7 +55,8 @@ var getRectInMultiPlatform = function getRectInMultiPlatform(element) {
|
|
|
55
55
|
resolve(lru.get(element));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
(0, _taro.createSelectorQuery)()
|
|
58
|
+
(0, _taro.createSelectorQuery)() // https://taro.jd.com/docs/reference/config/page/
|
|
59
|
+
.in((element === null || element === void 0 ? void 0 : element._scope) || element).select("#".concat(harmonyId || element.uid)).boundingClientRect().exec(function(param) {
|
|
59
60
|
var _param = (0, _sliced_to_array._)(param, 1), rects = _param[0];
|
|
60
61
|
if (rects) {
|
|
61
62
|
lru.set(element, rects);
|
|
@@ -86,7 +87,8 @@ var getRectInMultiPlatformWithoutCache = function getRectInMultiPlatformWithoutC
|
|
|
86
87
|
return [
|
|
87
88
|
2,
|
|
88
89
|
new Promise(function(resolve, reject) {
|
|
89
|
-
(0, _taro.createSelectorQuery)()
|
|
90
|
+
(0, _taro.createSelectorQuery)() // https://taro.jd.com/docs/reference/config/page/
|
|
91
|
+
.in((element === null || element === void 0 ? void 0 : element._scope) || element).select("#".concat(harmonyId || element.uid)).boundingClientRect().exec(function(param) {
|
|
90
92
|
var _param = (0, _sliced_to_array._)(param, 1), rects = _param[0];
|
|
91
93
|
resolve(rects);
|
|
92
94
|
});
|
package/dist/es/locales/en-US.js
CHANGED
package/dist/es/locales/id-ID.js
CHANGED
package/dist/es/locales/ja-JP.js
CHANGED
|
@@ -8,6 +8,12 @@ var jaJP = {
|
|
|
8
8
|
select: '選択してください',
|
|
9
9
|
edit: '編集',
|
|
10
10
|
reset: 'リセット',
|
|
11
|
+
close: '閉じる',
|
|
12
|
+
back: '戻る',
|
|
13
|
+
clear: 'クリア',
|
|
14
|
+
image: {
|
|
15
|
+
errorTip: '画像の読み込みに失敗しました'
|
|
16
|
+
},
|
|
11
17
|
video: {
|
|
12
18
|
errorTip: '動画の読み込みに失敗しました',
|
|
13
19
|
clickRetry: 'クリックして再試行'
|
|
@@ -155,7 +161,6 @@ var jaJP = {
|
|
|
155
161
|
errorCanvasTips: '現在の環境はCanvasをサポートしていません'
|
|
156
162
|
},
|
|
157
163
|
mask: 'マスク',
|
|
158
|
-
close: '閉じる',
|
|
159
164
|
quickenter: {
|
|
160
165
|
title: 'クイックアクセス'
|
|
161
166
|
}
|
package/dist/es/locales/tr-TR.js
CHANGED
package/dist/es/locales/zh-CN.js
CHANGED
package/dist/es/locales/zh-TW.js
CHANGED
package/dist/es/locales/zh-UG.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AddressRef, TaroAddressProps } from "../../types";
|
|
3
|
-
export declare const Address: React.ForwardRefExoticComponent<Partial<TaroAddressProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "
|
|
3
|
+
export declare const Address: React.ForwardRefExoticComponent<Partial<TaroAddressProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "title" | "onClick" | "onLoad"> & React.RefAttributes<AddressRef>>;
|
|
@@ -48,7 +48,9 @@ export var CountUp = function(props) {
|
|
|
48
48
|
var isLoaded = useRef(false);
|
|
49
49
|
var setNumberTransform = useCallback(function() {
|
|
50
50
|
if (countupRef.current && numberArr.length) {
|
|
51
|
-
|
|
51
|
+
var _countupRef_current;
|
|
52
|
+
createSelectorQuery()// @ts-ignore
|
|
53
|
+
.in(((_countupRef_current = countupRef.current) === null || _countupRef_current === void 0 ? void 0 : _countupRef_current._scope) || countupRef.current).selectAll('.nut-countup-listitem').node(function(numberItems) {
|
|
52
54
|
var transformArrCache = [];
|
|
53
55
|
Object.keys(numberItems).forEach(function(key) {
|
|
54
56
|
var elem = numberItems[Number(key)];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
|
+
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
4
5
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
5
6
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
6
7
|
import { Image, View } from "@tarojs/components";
|
|
@@ -25,7 +26,23 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
25
26
|
});
|
|
26
27
|
var classPrefix = "nut-avatar";
|
|
27
28
|
export var Avatar = function(props) {
|
|
28
|
-
var
|
|
29
|
+
var _ref = _object_spread({}, defaultProps, props), children = _ref.children, size = _ref.size, shape = _ref.shape, background = _ref.background, color = _ref.color, src = _ref.src, alt = _ref.alt, icon = _ref.icon, mode = _ref.mode, fit = _ref.fit, avatarIndex = _ref.avatarIndex, className = _ref.className, style = _ref.style, onClick = _ref.onClick, onError = _ref.onError, rest = _object_without_properties(_ref, [
|
|
30
|
+
"children",
|
|
31
|
+
"size",
|
|
32
|
+
"shape",
|
|
33
|
+
"background",
|
|
34
|
+
"color",
|
|
35
|
+
"src",
|
|
36
|
+
"alt",
|
|
37
|
+
"icon",
|
|
38
|
+
"mode",
|
|
39
|
+
"fit",
|
|
40
|
+
"avatarIndex",
|
|
41
|
+
"className",
|
|
42
|
+
"style",
|
|
43
|
+
"onClick",
|
|
44
|
+
"onError"
|
|
45
|
+
]);
|
|
29
46
|
var _useState // 是否显示的最大头像个数
|
|
30
47
|
= _sliced_to_array(useState(false), 2), showMax = _useState[0], setShowMax = _useState[1];
|
|
31
48
|
var avatarRef = useRef(null);
|
|
@@ -62,7 +79,8 @@ export var Avatar = function(props) {
|
|
|
62
79
|
}
|
|
63
80
|
}, [
|
|
64
81
|
avatarIndex,
|
|
65
|
-
groupCount
|
|
82
|
+
groupCount,
|
|
83
|
+
groupMax
|
|
66
84
|
]);
|
|
67
85
|
var errorEvent = function() {
|
|
68
86
|
onError && onError();
|
|
@@ -70,19 +88,26 @@ export var Avatar = function(props) {
|
|
|
70
88
|
var clickAvatar = function(e) {
|
|
71
89
|
onClick && onClick(e);
|
|
72
90
|
};
|
|
73
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, (showMax || !groupMax || avatarIndex <= groupMax) && /*#__PURE__*/ React.createElement(View, {
|
|
91
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, (showMax || !groupMax || avatarIndex <= groupMax) && /*#__PURE__*/ React.createElement(View, _object_spread({
|
|
74
92
|
className: cls,
|
|
75
93
|
style: !showMax ? styles : maxStyles,
|
|
76
94
|
onClick: clickAvatar,
|
|
77
|
-
ref: avatarRef
|
|
78
|
-
|
|
95
|
+
ref: avatarRef,
|
|
96
|
+
// @ts-ignore
|
|
97
|
+
ariaRole: onClick ? 'button' : undefined
|
|
98
|
+
}, rest), (!groupMax || avatarIndex <= groupMax) && /*#__PURE__*/ React.createElement(React.Fragment, null, src && /*#__PURE__*/ React.createElement(Image, {
|
|
79
99
|
className: "nut-avatar-img nut-avatar-".concat(groupSize || size || 'normal', "-img"),
|
|
80
100
|
src: src,
|
|
101
|
+
nativeProps: {
|
|
102
|
+
alt: alt
|
|
103
|
+
},
|
|
81
104
|
style: {
|
|
82
105
|
objectFit: fit
|
|
83
106
|
},
|
|
84
107
|
mode: mode,
|
|
85
|
-
onError: errorEvent
|
|
108
|
+
onError: errorEvent,
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
ariaHidden: true
|
|
86
111
|
}), /*#__PURE__*/ React.isValidElement(icon) ? /*#__PURE__*/ React.createElement(View, {
|
|
87
112
|
className: "nut-avatar-text"
|
|
88
113
|
}, /*#__PURE__*/ React.cloneElement(icon, _object_spread_props(_object_spread({}, icon.props), {
|
|
@@ -96,6 +121,7 @@ export var Avatar = function(props) {
|
|
|
96
121
|
}, children), !src && !icon && !children && /*#__PURE__*/ React.createElement(View, {
|
|
97
122
|
className: "nut-avatar-text"
|
|
98
123
|
}, /*#__PURE__*/ React.createElement(User, {
|
|
124
|
+
ariaHidden: true,
|
|
99
125
|
style: {
|
|
100
126
|
color: color
|
|
101
127
|
},
|
|
@@ -2,6 +2,7 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
|
2
2
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
3
3
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
4
4
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
5
|
+
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
6
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
6
7
|
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
7
8
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
@@ -41,7 +42,19 @@ export var Badge = function(props) {
|
|
|
41
42
|
};
|
|
42
43
|
var _this;
|
|
43
44
|
var rtl = useRtl();
|
|
44
|
-
var
|
|
45
|
+
var _ref = _object_spread({}, defaultProps, props), className = _ref.className, style = _ref.style, value = _ref.value, max = _ref.max, children = _ref.children, dot = _ref.dot, top = _ref.top, right = _ref.right, fill = _ref.fill, size = _ref.size, disabled = _ref.disabled, rest = _object_without_properties(_ref, [
|
|
46
|
+
"className",
|
|
47
|
+
"style",
|
|
48
|
+
"value",
|
|
49
|
+
"max",
|
|
50
|
+
"children",
|
|
51
|
+
"dot",
|
|
52
|
+
"top",
|
|
53
|
+
"right",
|
|
54
|
+
"fill",
|
|
55
|
+
"size",
|
|
56
|
+
"disabled"
|
|
57
|
+
]);
|
|
45
58
|
var classPrefix = 'nut-badge';
|
|
46
59
|
var isHarmony = harmony();
|
|
47
60
|
var classes = classNames(classPrefix, className);
|
|
@@ -69,11 +82,11 @@ export var Badge = function(props) {
|
|
|
69
82
|
})();
|
|
70
83
|
};
|
|
71
84
|
var _obj1;
|
|
72
|
-
return /*#__PURE__*/ React.createElement(View, {
|
|
85
|
+
return /*#__PURE__*/ React.createElement(View, _object_spread({
|
|
73
86
|
className: classes,
|
|
74
87
|
style: style,
|
|
75
88
|
ref: badgeRef
|
|
76
|
-
}, isIcon() && /*#__PURE__*/ React.createElement(View, {
|
|
89
|
+
}, rest), isIcon() && /*#__PURE__*/ React.createElement(View, {
|
|
77
90
|
className: classNames("".concat(classPrefix, "-content"), (_obj1 = {}, _define_property(_obj1, "".concat(classPrefix, "-icon"), true), _define_property(_obj1, "".concat(classPrefix, "-icon-rtl"), rtl), _obj1)),
|
|
78
91
|
style: contentStyle
|
|
79
92
|
}, value), children, !isIcon() && (getContent() || dot) && /*#__PURE__*/ React.createElement(View, {
|
|
@@ -1,22 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
5
|
-
export type ButtonSize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini';
|
|
6
|
-
export type ButtonShape = 'square' | 'round';
|
|
7
|
-
export type ButtonFill = 'solid' | 'outline' | 'dashed' | 'none';
|
|
8
|
-
export interface ButtonProps extends BasicComponent {
|
|
9
|
-
color: string;
|
|
10
|
-
shape: ButtonShape;
|
|
11
|
-
type: ButtonType;
|
|
12
|
-
size: ButtonSize;
|
|
13
|
-
fill: ButtonFill;
|
|
14
|
-
block: boolean;
|
|
15
|
-
loading: boolean;
|
|
16
|
-
disabled: boolean;
|
|
17
|
-
icon: React.ReactNode;
|
|
18
|
-
rightIcon: React.ReactNode;
|
|
19
|
-
nativeType: 'submit' | 'reset';
|
|
20
|
-
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
2
|
+
import { TaroButtonProps } from "../../types";
|
|
3
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<Partial<TaroButtonProps>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,8 +4,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
|
4
4
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
5
|
import React, { useCallback, useMemo } from "react";
|
|
6
6
|
import classNames from "classnames";
|
|
7
|
-
import {
|
|
8
|
-
View } from "@tarojs/components";
|
|
7
|
+
import { View } from "@tarojs/components";
|
|
9
8
|
import { Loading } from "@nutui/icons-react-taro";
|
|
10
9
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
10
|
import { harmony } from "../../utils/taro/platform";
|
|
@@ -96,9 +95,7 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
96
95
|
// ;(rest as any).type = formType
|
|
97
96
|
// }
|
|
98
97
|
return (
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
100
98
|
// @ts-ignore
|
|
101
|
-
// eslint-disable-next-line react/button-has-type
|
|
102
99
|
// <TaroButton
|
|
103
100
|
/*#__PURE__*/ (React.createElement(View, _object_spread_props(_object_spread({}, rest), {
|
|
104
101
|
ref: ref,
|
|
@@ -111,6 +108,7 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
111
108
|
}), /*#__PURE__*/ React.createElement(View, {
|
|
112
109
|
className: "nut-button-wrap"
|
|
113
110
|
}, loading && /*#__PURE__*/ React.createElement(Loading, {
|
|
111
|
+
ariaHidden: true,
|
|
114
112
|
className: "nut-icon-loading"
|
|
115
113
|
}), !loading && icon, children && /*#__PURE__*/ React.createElement(View, {
|
|
116
114
|
className: "nut-button-children nut-button-".concat(size, "-children nut-button-").concat(type, "-children ").concat(!(props.fill || disabled || loading) ? '' : "nut-button-".concat(type).concat(props.fill ? "-".concat(fill) : '').concat(disabled || loading ? '-disabled' : '')).concat(icon || loading ? " nut-button-text" : '').concat(rightIcon ? ' nut-button-text-right' : ''),
|