@nutui/nutui-react-taro 3.0.19-cpp.26-beta.4 → 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/actionsheet/style/style.harmony.css +7 -7
- package/dist/cjs/packages/address/address.d.ts +1 -1
- package/dist/cjs/packages/address/style/style.harmony.css +7 -7
- 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/calendar/style/style.harmony.css +7 -7
- package/dist/cjs/packages/cascader/style/style.harmony.css +7 -7
- package/dist/cjs/packages/datepicker/style/style.harmony.css +7 -7
- 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/imagepreview/style/style.harmony.css +7 -7
- package/dist/cjs/packages/input/input.js +10 -3
- package/dist/cjs/packages/numberkeyboard/style/style.harmony.css +7 -7
- package/dist/cjs/packages/picker/style/style.harmony.css +7 -7
- package/dist/cjs/packages/popover/style/style.harmony.css +7 -7
- package/dist/cjs/packages/popup/style/popup.scss +8 -7
- package/dist/cjs/packages/popup/style/style.css +7 -7
- package/dist/cjs/packages/popup/style/style.harmony.css +7 -7
- package/dist/cjs/packages/popup/style-jmapp/popup.scss +8 -7
- package/dist/cjs/packages/popup/style-jmapp/style.css +7 -7
- package/dist/cjs/packages/popup/style-jrkf/popup.scss +8 -7
- package/dist/cjs/packages/popup/style-jrkf/style.css +7 -7
- 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 +13 -8
- 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/shortpassword/style/style.harmony.css +7 -7
- package/dist/cjs/packages/swipe/swipe.d.ts +1 -1
- package/dist/cjs/packages/tabs/tabs.js +12 -5
- package/dist/cjs/packages/timeselect/style/style.harmony.css +7 -7
- package/dist/cjs/packages/tour/style/style.harmony.css +7 -7
- 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/actionsheet/style/style.harmony.css +7 -7
- package/dist/es/packages/address/address.d.ts +1 -1
- package/dist/es/packages/address/style/style.harmony.css +7 -7
- 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/calendar/style/style.harmony.css +7 -7
- package/dist/es/packages/cascader/style/style.harmony.css +7 -7
- package/dist/es/packages/datepicker/style/style.harmony.css +7 -7
- 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/imagepreview/style/style.harmony.css +7 -7
- package/dist/es/packages/input/input.js +10 -3
- package/dist/es/packages/numberkeyboard/style/style.harmony.css +7 -7
- package/dist/es/packages/picker/style/style.harmony.css +7 -7
- package/dist/es/packages/popover/style/style.harmony.css +7 -7
- package/dist/es/packages/popup/popup.js +1 -2
- package/dist/es/packages/popup/style/popup.scss +8 -7
- package/dist/es/packages/popup/style/style.css +7 -7
- package/dist/es/packages/popup/style/style.harmony.css +7 -7
- package/dist/es/packages/popup/style-jmapp/popup.scss +8 -7
- package/dist/es/packages/popup/style-jmapp/style.css +7 -7
- package/dist/es/packages/popup/style-jrkf/popup.scss +8 -7
- package/dist/es/packages/popup/style-jrkf/style.css +7 -7
- 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 +13 -8
- 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/shortpassword/style/style.harmony.css +7 -7
- package/dist/es/packages/swipe/swipe.d.ts +1 -1
- package/dist/es/packages/tabs/tabs.js +12 -5
- package/dist/es/packages/timeselect/style/style.harmony.css +7 -7
- package/dist/es/packages/tour/style/style.harmony.css +7 -7
- 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 +34 -34
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +42 -42
- package/dist/style.css +1 -1
- package/dist/style.scss +36 -36
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# v3.0.19-cpp.27
|
|
2
|
+
|
|
3
|
+
`2026-04-24`
|
|
4
|
+
|
|
5
|
+
- 🏡 chore: 升级京东正黑字体到 2.3 (#3435)
|
|
6
|
+
- 🏡 chore: 升级 icon 库版本
|
|
7
|
+
- 🚀 feat: 针对小程序环境进行性能优化与 SelectorQuery 作用域适配 (Tabs, CountUp, getRect)
|
|
8
|
+
- ♿️ feat: 全面适配无障碍 (A11y),涉及组件:Image, Dialog, Button, SearchBar, Popup, Tabs, Progress, Avatar, NavBar, ResultPage
|
|
9
|
+
- 📖 docs: 新增组件标准白皮书与 AI 助手相关文档
|
|
10
|
+
- 🐛 fix(avatar): 修复 onClick 条件判断逻辑并支持 Taro 端 alt 属性
|
|
11
|
+
- 🐛 fix(tabs): 修复 useRtl 引用路径并优化无障碍属性
|
|
12
|
+
- 🐛 fix(quickenter): 修复顶部安全区域适配问题
|
|
13
|
+
- 🐛 fix(type): 修复类型导出与 lint 问题
|
|
14
|
+
|
|
1
15
|
# v3.0.18
|
|
2
16
|
|
|
3
17
|
`2025-08-15`
|
|
@@ -18,6 +18,12 @@ var jaJP = {
|
|
|
18
18
|
select: '選択してください',
|
|
19
19
|
edit: '編集',
|
|
20
20
|
reset: 'リセット',
|
|
21
|
+
close: '閉じる',
|
|
22
|
+
back: '戻る',
|
|
23
|
+
clear: 'クリア',
|
|
24
|
+
image: {
|
|
25
|
+
errorTip: '画像の読み込みに失敗しました'
|
|
26
|
+
},
|
|
21
27
|
video: {
|
|
22
28
|
errorTip: '動画の読み込みに失敗しました',
|
|
23
29
|
clickRetry: 'クリックして再試行'
|
|
@@ -165,7 +171,6 @@ var jaJP = {
|
|
|
165
171
|
errorCanvasTips: '現在の環境はCanvasをサポートしていません'
|
|
166
172
|
},
|
|
167
173
|
mask: 'マスク',
|
|
168
|
-
close: '閉じる',
|
|
169
174
|
quickenter: {
|
|
170
175
|
title: 'クイックアクセス'
|
|
171
176
|
}
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
animation-name: popup-slide-right-enter;
|
|
292
292
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
293
293
|
}
|
|
294
|
-
.nut-popup-slide-right-exit
|
|
294
|
+
.nut-popup-slide-right-exit {
|
|
295
295
|
animation-fill-mode: both;
|
|
296
296
|
animation-name: popup-slide-right-exit;
|
|
297
297
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
transform: translate3d(0, 0%, 0);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
@keyframes
|
|
307
|
+
@keyframes slide-bottom-exit {
|
|
308
308
|
from {
|
|
309
309
|
transform: translate3d(0, 0%, 0);
|
|
310
310
|
}
|
|
@@ -313,14 +313,14 @@
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
.nut-popup-slide-bottom-enter-active, .nut-popup-slide-bottom-appear-active {
|
|
316
|
-
transform:
|
|
316
|
+
transform: translate(0, 0);
|
|
317
317
|
animation-fill-mode: both;
|
|
318
318
|
animation-name: popup-slide-bottom-enter;
|
|
319
319
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
320
320
|
}
|
|
321
|
-
.nut-popup-slide-bottom-exit
|
|
321
|
+
.nut-popup-slide-bottom-exit {
|
|
322
322
|
animation-fill-mode: both;
|
|
323
|
-
animation-name:
|
|
323
|
+
animation-name: slide-bottom-exit;
|
|
324
324
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
325
325
|
}
|
|
326
326
|
@keyframes popup-slide-left-enter {
|
|
@@ -340,12 +340,12 @@
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
.nut-popup-slide-left-enter-active, .nut-popup-slide-left-appear-active {
|
|
343
|
-
transform:
|
|
343
|
+
transform: translate(0, 0);
|
|
344
344
|
animation-fill-mode: both;
|
|
345
345
|
animation-name: popup-slide-left-enter;
|
|
346
346
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
347
347
|
}
|
|
348
|
-
.nut-popup-slide-left-exit-active {
|
|
348
|
+
.nut-popup-slide-left-exit-active, .nut-popup-slide-left-exit-done {
|
|
349
349
|
animation-fill-mode: both;
|
|
350
350
|
animation-name: popup-slide-left-exit;
|
|
351
351
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -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>>;
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
animation-name: popup-slide-right-enter;
|
|
442
442
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
443
443
|
}
|
|
444
|
-
.nut-popup-slide-right-exit
|
|
444
|
+
.nut-popup-slide-right-exit {
|
|
445
445
|
animation-fill-mode: both;
|
|
446
446
|
animation-name: popup-slide-right-exit;
|
|
447
447
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
transform: translate3d(0, 0%, 0);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
@keyframes
|
|
457
|
+
@keyframes slide-bottom-exit {
|
|
458
458
|
from {
|
|
459
459
|
transform: translate3d(0, 0%, 0);
|
|
460
460
|
}
|
|
@@ -463,14 +463,14 @@
|
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
.nut-popup-slide-bottom-enter-active, .nut-popup-slide-bottom-appear-active {
|
|
466
|
-
transform:
|
|
466
|
+
transform: translate(0, 0);
|
|
467
467
|
animation-fill-mode: both;
|
|
468
468
|
animation-name: popup-slide-bottom-enter;
|
|
469
469
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
470
470
|
}
|
|
471
|
-
.nut-popup-slide-bottom-exit
|
|
471
|
+
.nut-popup-slide-bottom-exit {
|
|
472
472
|
animation-fill-mode: both;
|
|
473
|
-
animation-name:
|
|
473
|
+
animation-name: slide-bottom-exit;
|
|
474
474
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
475
475
|
}
|
|
476
476
|
@keyframes popup-slide-left-enter {
|
|
@@ -490,12 +490,12 @@
|
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
.nut-popup-slide-left-enter-active, .nut-popup-slide-left-appear-active {
|
|
493
|
-
transform:
|
|
493
|
+
transform: translate(0, 0);
|
|
494
494
|
animation-fill-mode: both;
|
|
495
495
|
animation-name: popup-slide-left-enter;
|
|
496
496
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
497
497
|
}
|
|
498
|
-
.nut-popup-slide-left-exit-active {
|
|
498
|
+
.nut-popup-slide-left-exit-active, .nut-popup-slide-left-exit-done {
|
|
499
499
|
animation-fill-mode: both;
|
|
500
500
|
animation-name: popup-slide-left-exit;
|
|
501
501
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -59,7 +59,9 @@ var CountUp = function CountUp(props) {
|
|
|
59
59
|
var isLoaded = (0, _react.useRef)(false);
|
|
60
60
|
var setNumberTransform = (0, _react.useCallback)(function() {
|
|
61
61
|
if (countupRef.current && numberArr.length) {
|
|
62
|
-
|
|
62
|
+
var _countupRef_current;
|
|
63
|
+
(0, _taro.createSelectorQuery)() // @ts-ignore
|
|
64
|
+
.in(((_countupRef_current = countupRef.current) === null || _countupRef_current === void 0 ? void 0 : _countupRef_current._scope) || countupRef.current).selectAll('.nut-countup-listitem').node(function(numberItems) {
|
|
63
65
|
var transformArrCache = [];
|
|
64
66
|
Object.keys(numberItems).forEach(function(key) {
|
|
65
67
|
var elem = numberItems[Number(key)];
|
|
@@ -13,6 +13,7 @@ var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcar
|
|
|
13
13
|
var _define_property = require("@swc/helpers/_/_define_property");
|
|
14
14
|
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
15
15
|
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
16
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
17
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
17
18
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
18
19
|
var _components = require("@tarojs/components");
|
|
@@ -37,7 +38,23 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
37
38
|
});
|
|
38
39
|
var classPrefix = "nut-avatar";
|
|
39
40
|
var Avatar = function Avatar(props) {
|
|
40
|
-
var
|
|
41
|
+
var _ref = (0, _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 = (0, _object_without_properties._)(_ref, [
|
|
42
|
+
"children",
|
|
43
|
+
"size",
|
|
44
|
+
"shape",
|
|
45
|
+
"background",
|
|
46
|
+
"color",
|
|
47
|
+
"src",
|
|
48
|
+
"alt",
|
|
49
|
+
"icon",
|
|
50
|
+
"mode",
|
|
51
|
+
"fit",
|
|
52
|
+
"avatarIndex",
|
|
53
|
+
"className",
|
|
54
|
+
"style",
|
|
55
|
+
"onClick",
|
|
56
|
+
"onError"
|
|
57
|
+
]);
|
|
41
58
|
var _useState // 是否显示的最大头像个数
|
|
42
59
|
= (0, _sliced_to_array._)((0, _react.useState)(false), 2), showMax = _useState[0], setShowMax = _useState[1];
|
|
43
60
|
var avatarRef = (0, _react.useRef)(null);
|
|
@@ -74,7 +91,8 @@ var Avatar = function Avatar(props) {
|
|
|
74
91
|
}
|
|
75
92
|
}, [
|
|
76
93
|
avatarIndex,
|
|
77
|
-
groupCount
|
|
94
|
+
groupCount,
|
|
95
|
+
groupMax
|
|
78
96
|
]);
|
|
79
97
|
var errorEvent = function errorEvent() {
|
|
80
98
|
onError && onError();
|
|
@@ -82,19 +100,26 @@ var Avatar = function Avatar(props) {
|
|
|
82
100
|
var clickAvatar = function clickAvatar(e) {
|
|
83
101
|
onClick && onClick(e);
|
|
84
102
|
};
|
|
85
|
-
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (showMax || !groupMax || avatarIndex <= groupMax) && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
103
|
+
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (showMax || !groupMax || avatarIndex <= groupMax) && /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread._)({
|
|
86
104
|
className: cls,
|
|
87
105
|
style: !showMax ? styles : maxStyles,
|
|
88
106
|
onClick: clickAvatar,
|
|
89
|
-
ref: avatarRef
|
|
90
|
-
|
|
107
|
+
ref: avatarRef,
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
ariaRole: onClick ? 'button' : undefined
|
|
110
|
+
}, rest), (!groupMax || avatarIndex <= groupMax) && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, src && /*#__PURE__*/ _react.default.createElement(_components.Image, {
|
|
91
111
|
className: "nut-avatar-img nut-avatar-".concat(groupSize || size || 'normal', "-img"),
|
|
92
112
|
src: src,
|
|
113
|
+
nativeProps: {
|
|
114
|
+
alt: alt
|
|
115
|
+
},
|
|
93
116
|
style: {
|
|
94
117
|
objectFit: fit
|
|
95
118
|
},
|
|
96
119
|
mode: mode,
|
|
97
|
-
onError: errorEvent
|
|
120
|
+
onError: errorEvent,
|
|
121
|
+
// @ts-ignore
|
|
122
|
+
ariaHidden: true
|
|
98
123
|
}), /*#__PURE__*/ _react.default.isValidElement(icon) ? /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
99
124
|
className: "nut-avatar-text"
|
|
100
125
|
}, /*#__PURE__*/ _react.default.cloneElement(icon, (0, _object_spread_props._)((0, _object_spread._)({}, icon.props), {
|
|
@@ -108,6 +133,7 @@ var Avatar = function Avatar(props) {
|
|
|
108
133
|
}, children), !src && !icon && !children && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
109
134
|
className: "nut-avatar-text"
|
|
110
135
|
}, /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.User, {
|
|
136
|
+
ariaHidden: true,
|
|
111
137
|
style: {
|
|
112
138
|
color: color
|
|
113
139
|
},
|
|
@@ -14,6 +14,7 @@ var _async_to_generator = require("@swc/helpers/_/_async_to_generator");
|
|
|
14
14
|
var _define_property = require("@swc/helpers/_/_define_property");
|
|
15
15
|
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
16
16
|
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
17
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
17
18
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
18
19
|
var _type_of = require("@swc/helpers/_/_type_of");
|
|
19
20
|
var _ts_generator = require("@swc/helpers/_/_ts_generator");
|
|
@@ -53,7 +54,19 @@ var Badge = function Badge(props) {
|
|
|
53
54
|
};
|
|
54
55
|
var _this;
|
|
55
56
|
var rtl = (0, _index.useRtl)();
|
|
56
|
-
var
|
|
57
|
+
var _ref = (0, _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 = (0, _object_without_properties._)(_ref, [
|
|
58
|
+
"className",
|
|
59
|
+
"style",
|
|
60
|
+
"value",
|
|
61
|
+
"max",
|
|
62
|
+
"children",
|
|
63
|
+
"dot",
|
|
64
|
+
"top",
|
|
65
|
+
"right",
|
|
66
|
+
"fill",
|
|
67
|
+
"size",
|
|
68
|
+
"disabled"
|
|
69
|
+
]);
|
|
57
70
|
var classPrefix = 'nut-badge';
|
|
58
71
|
var isHarmony = (0, _platform.harmony)();
|
|
59
72
|
var classes = (0, _classnames.default)(classPrefix, className);
|
|
@@ -81,11 +94,11 @@ var Badge = function Badge(props) {
|
|
|
81
94
|
})();
|
|
82
95
|
};
|
|
83
96
|
var _obj1;
|
|
84
|
-
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
97
|
+
return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread._)({
|
|
85
98
|
className: classes,
|
|
86
99
|
style: style,
|
|
87
100
|
ref: badgeRef
|
|
88
|
-
}, isIcon() && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
101
|
+
}, rest), isIcon() && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
89
102
|
className: (0, _classnames.default)("".concat(classPrefix, "-content"), (_obj1 = {}, (0, _define_property._)(_obj1, "".concat(classPrefix, "-icon"), true), (0, _define_property._)(_obj1, "".concat(classPrefix, "-icon-rtl"), rtl), _obj1)),
|
|
90
103
|
style: contentStyle
|
|
91
104
|
}, value), children, !isIcon() && (getContent() || dot) && /*#__PURE__*/ _react.default.createElement(_components.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>>;
|
|
@@ -105,9 +105,7 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
105
105
|
// if (getEnv() === 'WEB') {
|
|
106
106
|
// ;(rest as any).type = formType
|
|
107
107
|
// }
|
|
108
|
-
return(//
|
|
109
|
-
// @ts-ignore
|
|
110
|
-
// eslint-disable-next-line react/button-has-type
|
|
108
|
+
return(// @ts-ignore
|
|
111
109
|
// <TaroButton
|
|
112
110
|
/*#__PURE__*/ /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread_props._)((0, _object_spread._)({}, rest), {
|
|
113
111
|
ref: ref,
|
|
@@ -120,6 +118,7 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
120
118
|
}), /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
121
119
|
className: "nut-button-wrap"
|
|
122
120
|
}, loading && /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Loading, {
|
|
121
|
+
ariaHidden: true,
|
|
123
122
|
className: "nut-icon-loading"
|
|
124
123
|
}), !loading && icon, children && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
125
124
|
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' : ''),
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
animation-name: popup-slide-right-enter;
|
|
292
292
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
293
293
|
}
|
|
294
|
-
.nut-popup-slide-right-exit
|
|
294
|
+
.nut-popup-slide-right-exit {
|
|
295
295
|
animation-fill-mode: both;
|
|
296
296
|
animation-name: popup-slide-right-exit;
|
|
297
297
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
transform: translate3d(0, 0%, 0);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
@keyframes
|
|
307
|
+
@keyframes slide-bottom-exit {
|
|
308
308
|
from {
|
|
309
309
|
transform: translate3d(0, 0%, 0);
|
|
310
310
|
}
|
|
@@ -313,14 +313,14 @@
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
.nut-popup-slide-bottom-enter-active, .nut-popup-slide-bottom-appear-active {
|
|
316
|
-
transform:
|
|
316
|
+
transform: translate(0, 0);
|
|
317
317
|
animation-fill-mode: both;
|
|
318
318
|
animation-name: popup-slide-bottom-enter;
|
|
319
319
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
320
320
|
}
|
|
321
|
-
.nut-popup-slide-bottom-exit
|
|
321
|
+
.nut-popup-slide-bottom-exit {
|
|
322
322
|
animation-fill-mode: both;
|
|
323
|
-
animation-name:
|
|
323
|
+
animation-name: slide-bottom-exit;
|
|
324
324
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
325
325
|
}
|
|
326
326
|
@keyframes popup-slide-left-enter {
|
|
@@ -340,12 +340,12 @@
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
.nut-popup-slide-left-enter-active, .nut-popup-slide-left-appear-active {
|
|
343
|
-
transform:
|
|
343
|
+
transform: translate(0, 0);
|
|
344
344
|
animation-fill-mode: both;
|
|
345
345
|
animation-name: popup-slide-left-enter;
|
|
346
346
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
347
347
|
}
|
|
348
|
-
.nut-popup-slide-left-exit-active {
|
|
348
|
+
.nut-popup-slide-left-exit-active, .nut-popup-slide-left-exit-done {
|
|
349
349
|
animation-fill-mode: both;
|
|
350
350
|
animation-name: popup-slide-left-exit;
|
|
351
351
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
animation-name: popup-slide-right-enter;
|
|
292
292
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
293
293
|
}
|
|
294
|
-
.nut-popup-slide-right-exit
|
|
294
|
+
.nut-popup-slide-right-exit {
|
|
295
295
|
animation-fill-mode: both;
|
|
296
296
|
animation-name: popup-slide-right-exit;
|
|
297
297
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
transform: translate3d(0, 0%, 0);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
@keyframes
|
|
307
|
+
@keyframes slide-bottom-exit {
|
|
308
308
|
from {
|
|
309
309
|
transform: translate3d(0, 0%, 0);
|
|
310
310
|
}
|
|
@@ -313,14 +313,14 @@
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
.nut-popup-slide-bottom-enter-active, .nut-popup-slide-bottom-appear-active {
|
|
316
|
-
transform:
|
|
316
|
+
transform: translate(0, 0);
|
|
317
317
|
animation-fill-mode: both;
|
|
318
318
|
animation-name: popup-slide-bottom-enter;
|
|
319
319
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
320
320
|
}
|
|
321
|
-
.nut-popup-slide-bottom-exit
|
|
321
|
+
.nut-popup-slide-bottom-exit {
|
|
322
322
|
animation-fill-mode: both;
|
|
323
|
-
animation-name:
|
|
323
|
+
animation-name: slide-bottom-exit;
|
|
324
324
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
325
325
|
}
|
|
326
326
|
@keyframes popup-slide-left-enter {
|
|
@@ -340,12 +340,12 @@
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
.nut-popup-slide-left-enter-active, .nut-popup-slide-left-appear-active {
|
|
343
|
-
transform:
|
|
343
|
+
transform: translate(0, 0);
|
|
344
344
|
animation-fill-mode: both;
|
|
345
345
|
animation-name: popup-slide-left-enter;
|
|
346
346
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
347
347
|
}
|
|
348
|
-
.nut-popup-slide-left-exit-active {
|
|
348
|
+
.nut-popup-slide-left-exit-active, .nut-popup-slide-left-exit-done {
|
|
349
349
|
animation-fill-mode: both;
|
|
350
350
|
animation-name: popup-slide-left-exit;
|
|
351
351
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
animation-name: popup-slide-right-enter;
|
|
292
292
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
293
293
|
}
|
|
294
|
-
.nut-popup-slide-right-exit
|
|
294
|
+
.nut-popup-slide-right-exit {
|
|
295
295
|
animation-fill-mode: both;
|
|
296
296
|
animation-name: popup-slide-right-exit;
|
|
297
297
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
transform: translate3d(0, 0%, 0);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
@keyframes
|
|
307
|
+
@keyframes slide-bottom-exit {
|
|
308
308
|
from {
|
|
309
309
|
transform: translate3d(0, 0%, 0);
|
|
310
310
|
}
|
|
@@ -313,14 +313,14 @@
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
.nut-popup-slide-bottom-enter-active, .nut-popup-slide-bottom-appear-active {
|
|
316
|
-
transform:
|
|
316
|
+
transform: translate(0, 0);
|
|
317
317
|
animation-fill-mode: both;
|
|
318
318
|
animation-name: popup-slide-bottom-enter;
|
|
319
319
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
320
320
|
}
|
|
321
|
-
.nut-popup-slide-bottom-exit
|
|
321
|
+
.nut-popup-slide-bottom-exit {
|
|
322
322
|
animation-fill-mode: both;
|
|
323
|
-
animation-name:
|
|
323
|
+
animation-name: slide-bottom-exit;
|
|
324
324
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
325
325
|
}
|
|
326
326
|
@keyframes popup-slide-left-enter {
|
|
@@ -340,12 +340,12 @@
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
.nut-popup-slide-left-enter-active, .nut-popup-slide-left-appear-active {
|
|
343
|
-
transform:
|
|
343
|
+
transform: translate(0, 0);
|
|
344
344
|
animation-fill-mode: both;
|
|
345
345
|
animation-name: popup-slide-left-enter;
|
|
346
346
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
347
347
|
}
|
|
348
|
-
.nut-popup-slide-left-exit-active {
|
|
348
|
+
.nut-popup-slide-left-exit-active, .nut-popup-slide-left-exit-done {
|
|
349
349
|
animation-fill-mode: both;
|
|
350
350
|
animation-name: popup-slide-left-exit;
|
|
351
351
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -203,7 +203,11 @@ var BaseDialog = function BaseDialog(props) {
|
|
|
203
203
|
};
|
|
204
204
|
var _obj;
|
|
205
205
|
var closeClasses = (0, _classnames.default)((_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-close"), true), (0, _define_property._)(_obj, "".concat(classPrefix, "-close-").concat(closeIconPosition), true), _obj));
|
|
206
|
-
var
|
|
206
|
+
var systemIcon = closeIconPosition !== 'bottom' ? /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Close, {
|
|
207
|
+
ariaHidden: true
|
|
208
|
+
}) : /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Failure, {
|
|
209
|
+
ariaHidden: true
|
|
210
|
+
});
|
|
207
211
|
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
208
212
|
className: closeClasses,
|
|
209
213
|
onClick: handleClose,
|
|
@@ -211,7 +215,7 @@ var BaseDialog = function BaseDialog(props) {
|
|
|
211
215
|
ariaLabel: locale.close,
|
|
212
216
|
// @ts-ignore
|
|
213
217
|
tabIndex: 0
|
|
214
|
-
}, /*#__PURE__*/ _react.default.isValidElement(closeIcon) ? closeIcon :
|
|
218
|
+
}, /*#__PURE__*/ _react.default.isValidElement(closeIcon) ? closeIcon : systemIcon);
|
|
215
219
|
};
|
|
216
220
|
var onHandleClickOverlay = function onHandleClickOverlay(e) {
|
|
217
221
|
if (closeOnOverlayClick && visible && e.target === e.currentTarget) {
|
|
@@ -17,7 +17,7 @@ var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
|
17
17
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
18
18
|
var _components = require("@tarojs/components");
|
|
19
19
|
var _typings = require("../../utils/typings");
|
|
20
|
-
var
|
|
20
|
+
var _index = require("../configprovider/index");
|
|
21
21
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
22
22
|
contentPosition: 'center',
|
|
23
23
|
direction: 'horizontal'
|
|
@@ -31,7 +31,7 @@ var Divider = function Divider(props) {
|
|
|
31
31
|
"className",
|
|
32
32
|
"direction"
|
|
33
33
|
]);
|
|
34
|
-
var rtl = (0,
|
|
34
|
+
var rtl = (0, _index.useRtl)();
|
|
35
35
|
var _obj, _obj1;
|
|
36
36
|
var classes = direction === 'horizontal' ? (0, _classnames.default)((_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix), true), (0, _define_property._)(_obj, "".concat(classPrefix, "-center"), children), (0, _define_property._)(_obj, "".concat(classPrefix, "-left"), contentPosition === 'left'), (0, _define_property._)(_obj, "".concat(classPrefix, "-right"), contentPosition === 'right'), (0, _define_property._)(_obj, "".concat(classPrefix, "-rtl"), ([
|
|
37
37
|
'left',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
2
2
|
import { BasicComponent } from "../../utils/typings";
|
|
3
|
-
import {
|
|
3
|
+
import { UIFill, UISize, UIType } from "../../types/base/atoms";
|
|
4
4
|
export interface EmptyAction {
|
|
5
5
|
text: React.ReactNode;
|
|
6
|
-
type?:
|
|
7
|
-
size?:
|
|
8
|
-
fill?:
|
|
6
|
+
type?: UIType;
|
|
7
|
+
size?: UISize;
|
|
8
|
+
fill?: UIFill;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
onClick?: () => () => void;
|
|
11
11
|
}
|