@nutui/nutui-react-taro 3.0.19-cpp.26-beta.5 → 3.0.19-cpp.28-beta.1

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/locales/base.d.ts +6 -0
  3. package/dist/cjs/locales/en-US.js +17 -1
  4. package/dist/cjs/locales/id-ID.js +17 -1
  5. package/dist/cjs/locales/ja-JP.js +16 -2
  6. package/dist/cjs/locales/tr-TR.js +17 -1
  7. package/dist/cjs/locales/zh-CN.js +15 -1
  8. package/dist/cjs/locales/zh-TW.js +15 -1
  9. package/dist/cjs/locales/zh-UG.js +17 -1
  10. package/dist/cjs/packages/address/address.d.ts +1 -1
  11. package/dist/cjs/packages/animatingnumbers/countup.js +3 -1
  12. package/dist/cjs/packages/avatar/avatar.js +32 -6
  13. package/dist/cjs/packages/badge/badge.js +16 -3
  14. package/dist/cjs/packages/button/button.d.ts +2 -21
  15. package/dist/cjs/packages/button/button.js +2 -3
  16. package/dist/cjs/packages/button/index.d.ts +0 -1
  17. package/dist/cjs/packages/calendarcard/calendarcard.js +30 -8
  18. package/dist/cjs/packages/dialog/dialog.js +6 -2
  19. package/dist/cjs/packages/divider/divider.js +2 -2
  20. package/dist/cjs/packages/empty/empty.d.ts +4 -4
  21. package/dist/cjs/packages/image/image.js +11 -3
  22. package/dist/cjs/packages/input/input.js +10 -3
  23. package/dist/cjs/packages/progress/progress.js +2 -4
  24. package/dist/cjs/packages/quickenter/quickenter.js +21 -15
  25. package/dist/cjs/packages/quickenter/style/quickenter.scss +10 -2
  26. package/dist/cjs/packages/quickenter/style/style.css +7 -1
  27. package/dist/cjs/packages/quickenter/style/style.harmony.css +6 -1
  28. package/dist/cjs/packages/quickenter/style-jmapp/quickenter.scss +10 -2
  29. package/dist/cjs/packages/quickenter/style-jmapp/style.css +7 -1
  30. package/dist/cjs/packages/quickenter/style-jrkf/quickenter.scss +10 -2
  31. package/dist/cjs/packages/quickenter/style-jrkf/style.css +7 -1
  32. package/dist/cjs/packages/resultpage/resultpage.js +2 -1
  33. package/dist/cjs/packages/searchbar/searchbar.js +23 -9
  34. package/dist/cjs/packages/swipe/swipe.d.ts +1 -1
  35. package/dist/cjs/packages/tabs/tabs.js +12 -5
  36. package/dist/cjs/types/spec/button/base.d.ts +2 -1
  37. package/dist/cjs/types/spec/button/taro.d.ts +5 -1
  38. package/dist/cjs/types/spec/calendarcard/base.d.ts +2 -0
  39. package/dist/cjs/types/spec/quickenter/base.d.ts +1 -0
  40. package/dist/cjs/utils/taro/get-rect.js +4 -2
  41. package/dist/es/locales/base.d.ts +6 -0
  42. package/dist/es/locales/en-US.js +17 -1
  43. package/dist/es/locales/id-ID.js +17 -1
  44. package/dist/es/locales/ja-JP.js +16 -2
  45. package/dist/es/locales/tr-TR.js +17 -1
  46. package/dist/es/locales/zh-CN.js +15 -1
  47. package/dist/es/locales/zh-TW.js +15 -1
  48. package/dist/es/locales/zh-UG.js +17 -1
  49. package/dist/es/packages/address/address.d.ts +1 -1
  50. package/dist/es/packages/animatingnumbers/countup.js +3 -1
  51. package/dist/es/packages/avatar/avatar.js +32 -6
  52. package/dist/es/packages/badge/badge.js +16 -3
  53. package/dist/es/packages/button/button.d.ts +2 -21
  54. package/dist/es/packages/button/button.js +2 -4
  55. package/dist/es/packages/button/index.d.ts +0 -1
  56. package/dist/es/packages/calendarcard/calendarcard.js +31 -9
  57. package/dist/es/packages/dialog/dialog.js +6 -2
  58. package/dist/es/packages/divider/divider.js +1 -1
  59. package/dist/es/packages/empty/empty.d.ts +4 -4
  60. package/dist/es/packages/image/image.js +11 -3
  61. package/dist/es/packages/input/input.js +10 -3
  62. package/dist/es/packages/popup/popup.js +1 -2
  63. package/dist/es/packages/progress/progress.js +2 -4
  64. package/dist/es/packages/quickenter/quickenter.js +19 -13
  65. package/dist/es/packages/quickenter/style/quickenter.scss +10 -2
  66. package/dist/es/packages/quickenter/style/style.css +7 -1
  67. package/dist/es/packages/quickenter/style/style.harmony.css +6 -1
  68. package/dist/es/packages/quickenter/style-jmapp/quickenter.scss +10 -2
  69. package/dist/es/packages/quickenter/style-jmapp/style.css +7 -1
  70. package/dist/es/packages/quickenter/style-jrkf/quickenter.scss +10 -2
  71. package/dist/es/packages/quickenter/style-jrkf/style.css +7 -1
  72. package/dist/es/packages/resultpage/resultpage.js +2 -1
  73. package/dist/es/packages/searchbar/searchbar.js +23 -9
  74. package/dist/es/packages/swipe/swipe.d.ts +1 -1
  75. package/dist/es/packages/tabs/tabs.js +12 -5
  76. package/dist/es/types/spec/button/base.d.ts +2 -1
  77. package/dist/es/types/spec/button/taro.d.ts +5 -1
  78. package/dist/es/types/spec/calendarcard/base.d.ts +2 -0
  79. package/dist/es/types/spec/quickenter/base.d.ts +1 -0
  80. package/dist/es/utils/taro/get-rect.js +4 -2
  81. package/dist/nutui.react.umd.js +1166 -111
  82. package/dist/style-jmapp.css +1 -1
  83. package/dist/style-jmapp.scss +24 -24
  84. package/dist/style-jrkf.css +1 -1
  85. package/dist/style-jrkf.scss +32 -32
  86. package/dist/style.css +1 -1
  87. package/dist/style.scss +40 -40
  88. package/dist/styles/jd-font.scss +2 -2
  89. package/dist/styles/themes/daojia.css +1 -1
  90. package/dist/styles/themes/dark-daojia.css +1 -1
  91. package/dist/styles/themes/dark.css +1 -1
  92. package/dist/styles/themes/default.css +1 -1
  93. package/package.json +1 -1
@@ -9,6 +9,11 @@ var idID = {
9
9
  edit: 'Sunting',
10
10
  reset: 'Mengatur Ulang',
11
11
  close: 'Tutup',
12
+ back: 'Kembali',
13
+ clear: 'Bersihkan',
14
+ image: {
15
+ errorTip: 'Gambar gagal dimuat'
16
+ },
12
17
  video: {
13
18
  errorTip: 'Terjadi Kesalahan',
14
19
  clickRetry: 'Coba Lagi'
@@ -48,7 +53,18 @@ var idID = {
48
53
  },
49
54
  today: 'Hari ini',
50
55
  loadPreviousMonth: 'Muat Bulan Sebelumnya',
51
- noEarlierMonth: 'Tidak Ada Bulan Sebelumnya'
56
+ noEarlierMonth: 'Tidak Ada Bulan Sebelumnya',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
59
+ var label = today ? "Hari ini, ".concat(dateStr) : dateStr;
60
+ if (isActive) {
61
+ label = "Dipilih ".concat(label);
62
+ }
63
+ if (isDisable) {
64
+ label = "".concat(label, " dinonaktifkan");
65
+ }
66
+ return label;
67
+ }
52
68
  },
53
69
  shortpassword: {
54
70
  title: 'SIlakan masukan kata sandi',
@@ -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: 'クリックして再試行'
@@ -47,7 +53,16 @@ var jaJP = {
47
53
  },
48
54
  today: '今日',
49
55
  loadPreviousMonth: '前の月を読み込む',
50
- noEarlierMonth: 'これより前の月はありません'
56
+ noEarlierMonth: 'これより前の月はありません',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ if (isActive) {
59
+ return today ? "今日".concat(month, "月").concat(day, "日を選択しました") : "".concat(month, "月").concat(day, "日を選択しました");
60
+ }
61
+ if (isDisable) {
62
+ return today ? "今日".concat(month, "月").concat(day, "日は無効です") : "".concat(month, "月").concat(day, "日は無効です");
63
+ }
64
+ return today ? "今日".concat(month, "月").concat(day, "日") : "".concat(month, "月").concat(day, "日");
65
+ }
51
66
  },
52
67
  shortpassword: {
53
68
  title: 'パスワードを入力してください',
@@ -155,7 +170,6 @@ var jaJP = {
155
170
  errorCanvasTips: '現在の環境はCanvasをサポートしていません'
156
171
  },
157
172
  mask: 'マスク',
158
- close: '閉じる',
159
173
  quickenter: {
160
174
  title: 'クイックアクセス'
161
175
  }
@@ -9,6 +9,11 @@ var trTR = {
9
9
  edit: 'düzenlemek',
10
10
  reset: 'sıfırlama',
11
11
  close: 'Kapat',
12
+ back: 'Geri',
13
+ clear: 'Temizle',
14
+ image: {
15
+ errorTip: 'Resim yüklenemedi'
16
+ },
12
17
  video: {
13
18
  errorTip: 'Video yüklenemedi',
14
19
  clickRetry: 'Yeniden Tıklayın'
@@ -48,7 +53,18 @@ var trTR = {
48
53
  },
49
54
  today: 'Bugün',
50
55
  loadPreviousMonth: 'Önceki ayı yükle',
51
- noEarlierMonth: 'Önceki ay yok'
56
+ noEarlierMonth: 'Önceki ay yok',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
59
+ var label = today ? "Bug\xfcn, ".concat(dateStr) : dateStr;
60
+ if (isActive) {
61
+ label = "Se\xe7ili ".concat(label);
62
+ }
63
+ if (isDisable) {
64
+ label = "".concat(label, " devre dışı");
65
+ }
66
+ return label;
67
+ }
52
68
  },
53
69
  shortpassword: {
54
70
  title: 'Lütfen şifrenizi girin',
@@ -9,6 +9,11 @@ var zhCN = {
9
9
  edit: '编辑',
10
10
  reset: '重置',
11
11
  close: '关闭',
12
+ back: '返回',
13
+ clear: '清除',
14
+ image: {
15
+ errorTip: '图片加载失败'
16
+ },
12
17
  video: {
13
18
  errorTip: '视频加载失败',
14
19
  clickRetry: '点击重试'
@@ -48,7 +53,16 @@ var zhCN = {
48
53
  },
49
54
  today: '今天',
50
55
  loadPreviousMonth: '加载上一个月',
51
- noEarlierMonth: '没有更早月份'
56
+ noEarlierMonth: '没有更早月份',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ if (isActive) {
59
+ return today ? "已选定今日".concat(month, "月").concat(day, "号") : "已选定".concat(month, "月").concat(day, "号");
60
+ }
61
+ if (isDisable) {
62
+ return today ? "".concat(month, "月").concat(day, "号今日按钮变暗") : "".concat(month, "月").concat(day, "号按钮变暗");
63
+ }
64
+ return today ? "".concat(month, "月").concat(day, "号今日") : "".concat(month, "月").concat(day, "号");
65
+ }
52
66
  },
53
67
  shortpassword: {
54
68
  title: '请输入密码',
@@ -9,6 +9,11 @@ var zhCN = {
9
9
  edit: '編輯',
10
10
  reset: '重置',
11
11
  close: '關閉',
12
+ back: '返回',
13
+ clear: '清除',
14
+ image: {
15
+ errorTip: '圖片加載失敗'
16
+ },
12
17
  video: {
13
18
  errorTip: '視頻加載失敗',
14
19
  clickRetry: '點擊重試'
@@ -48,7 +53,16 @@ var zhCN = {
48
53
  },
49
54
  today: '今天',
50
55
  loadPreviousMonth: '加載上一個月',
51
- noEarlierMonth: '沒有更早月份'
56
+ noEarlierMonth: '沒有更早月份',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ if (isActive) {
59
+ return today ? "已選定今日".concat(month, "月").concat(day, "號") : "已選定".concat(month, "月").concat(day, "號");
60
+ }
61
+ if (isDisable) {
62
+ return today ? "".concat(month, "月").concat(day, "號今日按鈕變暗") : "".concat(month, "月").concat(day, "號按鈕變暗");
63
+ }
64
+ return today ? "".concat(month, "月").concat(day, "號今日") : "".concat(month, "月").concat(day, "號");
65
+ }
52
66
  },
53
67
  shortpassword: {
54
68
  title: '請輸入密碼',
@@ -9,6 +9,11 @@ var zhUG = {
9
9
  edit: 'يحرر',
10
10
  reset: 'إعادة ضبط',
11
11
  close: 'تاقاش',
12
+ back: 'قايتىش',
13
+ clear: 'تاقاش',
14
+ image: {
15
+ errorTip: 'رەسىم يۈكلەش مەغلۇپ بولدى'
16
+ },
12
17
  video: {
13
18
  errorTip: 'فىلىمنى قويۇش مەغلۇپ بولدى',
14
19
  clickRetry: 'قايتا سىناش'
@@ -48,7 +53,18 @@ var zhUG = {
48
53
  },
49
54
  today: 'بۈگۈن',
50
55
  loadPreviousMonth: 'ئالدىنقى ئاي',
51
- noEarlierMonth: 'تۈگىدى'
56
+ noEarlierMonth: 'تۈگىدى',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
59
+ var label = today ? "بۈگۈن, ".concat(dateStr) : dateStr;
60
+ if (isActive) {
61
+ label = "تاللانغان ".concat(label);
62
+ }
63
+ if (isDisable) {
64
+ label = "".concat(label, " چەكلەنگەن");
65
+ }
66
+ return label;
67
+ }
52
68
  },
53
69
  shortpassword: {
54
70
  title: 'مەخپى نومۇرنى كىرگۈزۈڭ',
@@ -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" | "onClick" | "title" | "onLoad"> & React.RefAttributes<AddressRef>>;
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
- createSelectorQuery().selectAll('.nut-countup-listitem').node(function(numberItems) {
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 _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, size = _$_object_spread.size, shape = _$_object_spread.shape, background = _$_object_spread.background, color = _$_object_spread.color, src = _$_object_spread.src, icon = _$_object_spread.icon, mode = _$_object_spread.mode, fit = _$_object_spread.fit, avatarIndex = _$_object_spread.avatarIndex, className = _$_object_spread.className, style = _$_object_spread.style, onClick = _$_object_spread.onClick, onError = _$_object_spread.onError;
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
- }, (!groupMax || avatarIndex <= groupMax) && /*#__PURE__*/ React.createElement(React.Fragment, null, src && /*#__PURE__*/ React.createElement(Image, {
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 _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size, disabled = _$_object_spread.disabled;
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 type { MouseEvent } from 'react';
3
- import { BasicComponent } from "../../utils/typings";
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 { // ButtonProps as MiniProgramButtonProps,
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' : ''),
@@ -1,3 +1,2 @@
1
1
  import { Button } from "./button";
2
- export type { ButtonType, ButtonProps, ButtonSize, ButtonShape, ButtonFill, } from "./button";
3
2
  export default Button;
@@ -2,7 +2,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
4
4
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
5
- import React, { useCallback, useEffect, useState, useRef } from "react";
5
+ import React, { useCallback, useEffect, useState, useRef, useMemo } from "react";
6
6
  import classNames from "classnames";
7
7
  import { View } from "@tarojs/components";
8
8
  import { ArrowLeft, ArrowRight, DoubleLeft, DoubleRight } from "./icon";
@@ -12,12 +12,13 @@ import { useConfig } from "../configprovider/index";
12
12
  import { usePropsValue } from "../../hooks/use-props-value";
13
13
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
14
14
  type: 'single',
15
- firstDayOfWeek: 0
15
+ firstDayOfWeek: 0,
16
+ weekdays: []
16
17
  });
17
18
  var prefixCls = 'nut-calendarcard';
18
19
  export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
19
20
  var locale = useConfig().locale;
20
- var _$_object_spread = _object_spread({}, defaultProps, props), style = _$_object_spread.style, className = _$_object_spread.className, type = _$_object_spread.type, title = _$_object_spread.title, value = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
21
+ var _$_object_spread = _object_spread({}, defaultProps, props), style = _$_object_spread.style, className = _$_object_spread.className, type = _$_object_spread.type, title = _$_object_spread.title, value = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, renderDayAriaLabel = _$_object_spread.renderDayAriaLabel, weekdays = _$_object_spread.weekdays, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
21
22
  var onPageChangeRef = useRef(onPageChange);
22
23
  // 当前月份信息
23
24
  var _useState = _sliced_to_array(useState(function() {
@@ -167,6 +168,19 @@ export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
167
168
  var d = new Date(day.year, day.month - 1, day.date).getDay();
168
169
  return d === 0 || d === 6;
169
170
  };
171
+ var isToday = function(day) {
172
+ var today = new Date();
173
+ return day.year === today.getFullYear() && day.month === today.getMonth() + 1 && day.date === today.getDate();
174
+ };
175
+ // 日期无障碍朗读
176
+ var getAriaLabel = function(day) {
177
+ var _locale_calendaritem_dayAriaLabel, _locale_calendaritem;
178
+ if (renderDayAriaLabel) {
179
+ return renderDayAriaLabel(day);
180
+ }
181
+ var today = isToday(day);
182
+ return (_locale_calendaritem_dayAriaLabel = (_locale_calendaritem = locale.calendaritem).dayAriaLabel) === null || _locale_calendaritem_dayAriaLabel === void 0 ? void 0 : _locale_calendaritem_dayAriaLabel.call(_locale_calendaritem, day.year, day.month, day.date, today, isActive(day), isDisable(day));
183
+ };
170
184
  var getClasses = function(day) {
171
185
  /**
172
186
  * active: single、multiple 激活日期
@@ -351,15 +365,20 @@ export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
351
365
  }
352
366
  }, /*#__PURE__*/ React.createElement(DoubleRight, null))));
353
367
  };
354
- var _useState2 = _sliced_to_array(useState(function() {
355
- var weekdays = locale.calendaritem.weekdays.map(function(day, index) {
368
+ var weekHeader = useMemo(function() {
369
+ var weekdaysList = weekdays.length > 0 ? weekdays : locale.calendaritem.weekdays;
370
+ var weekdaysData = weekdaysList.map(function(day, index) {
356
371
  return {
357
372
  name: day,
358
373
  key: index
359
374
  };
360
375
  });
361
- return _to_consumable_array(weekdays.slice(firstDayOfWeek, 7)).concat(_to_consumable_array(weekdays.slice(0, firstDayOfWeek)));
362
- }), 1), weekHeader = _useState2[0];
376
+ return _to_consumable_array(weekdaysData.slice(firstDayOfWeek, 7)).concat(_to_consumable_array(weekdaysData.slice(0, firstDayOfWeek)));
377
+ }, [
378
+ weekdays,
379
+ firstDayOfWeek,
380
+ locale.calendaritem.weekdays
381
+ ]);
363
382
  var renderContent = function() {
364
383
  return /*#__PURE__*/ React.createElement(View, {
365
384
  className: "".concat(prefixCls, "-content")
@@ -380,11 +399,14 @@ export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
380
399
  key: "".concat(day.year, "-").concat(day.month, "-").concat(day.date),
381
400
  onClick: function() {
382
401
  return handleDayClick(day);
383
- }
402
+ },
403
+ ariaLabel: getAriaLabel(day),
404
+ ariaRole: "button"
384
405
  }, /*#__PURE__*/ React.createElement(View, {
385
406
  className: "".concat(prefixCls, "-day-top")
386
407
  }, renderDayTop ? renderDayTop(day) : ''), /*#__PURE__*/ React.createElement(View, {
387
- className: "".concat(prefixCls, "-day-inner")
408
+ className: "".concat(prefixCls, "-day-inner"),
409
+ ariaHidden: true
388
410
  }, renderDay ? renderDay(day) : day.date), /*#__PURE__*/ React.createElement(View, {
389
411
  className: "".concat(prefixCls, "-day-bottom")
390
412
  }, renderDayBottom ? renderDayBottom(day) : ''));
@@ -180,7 +180,11 @@ export var BaseDialog = function(props) {
180
180
  };
181
181
  var _obj;
182
182
  var closeClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-close"), true), _define_property(_obj, "".concat(classPrefix, "-close-").concat(closeIconPosition), true), _obj));
183
- var systomIcon = closeIconPosition !== 'bottom' ? /*#__PURE__*/ React.createElement(Close, null) : /*#__PURE__*/ React.createElement(Failure, null);
183
+ var systemIcon = closeIconPosition !== 'bottom' ? /*#__PURE__*/ React.createElement(Close, {
184
+ ariaHidden: true
185
+ }) : /*#__PURE__*/ React.createElement(Failure, {
186
+ ariaHidden: true
187
+ });
184
188
  return /*#__PURE__*/ React.createElement(View, {
185
189
  className: closeClasses,
186
190
  onClick: handleClose,
@@ -188,7 +192,7 @@ export var BaseDialog = function(props) {
188
192
  ariaLabel: locale.close,
189
193
  // @ts-ignore
190
194
  tabIndex: 0
191
- }, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : systomIcon);
195
+ }, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : systemIcon);
192
196
  };
193
197
  var onHandleClickOverlay = function(e) {
194
198
  if (closeOnOverlayClick && visible && e.target === e.currentTarget) {
@@ -6,7 +6,7 @@ import React from "react";
6
6
  import classNames from "classnames";
7
7
  import { View } from "@tarojs/components";
8
8
  import { ComponentDefaults } from "../../utils/typings";
9
- import { useRtl } from "../configprovider/configprovider";
9
+ import { useRtl } from "../configprovider/index";
10
10
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
11
11
  contentPosition: 'center',
12
12
  direction: 'horizontal'
@@ -1,11 +1,11 @@
1
1
  import React, { FunctionComponent, ReactNode } from 'react';
2
2
  import { BasicComponent } from "../../utils/typings";
3
- import { ButtonFill, ButtonSize, ButtonType } from "../button/button";
3
+ import { UIFill, UISize, UIType } from "../../types/base/atoms";
4
4
  export interface EmptyAction {
5
5
  text: React.ReactNode;
6
- type?: ButtonType;
7
- size?: ButtonSize;
8
- fill?: ButtonFill;
6
+ type?: UIType;
7
+ size?: UISize;
8
+ fill?: UIFill;
9
9
  disabled?: boolean;
10
10
  onClick?: () => () => void;
11
11
  }
@@ -9,6 +9,7 @@ import { Image as TImage, View } from "@tarojs/components";
9
9
  import { Image as ImageIcon, ImageError } from "@nutui/icons-react-taro";
10
10
  import classNames from "classnames";
11
11
  import { pxTransform } from "../../utils/taro/px-transform";
12
+ import { useConfig } from "../configprovider/index";
12
13
  var defaultProps = {
13
14
  src: '',
14
15
  error: true,
@@ -30,6 +31,7 @@ export var Image = function(props) {
30
31
  ]);
31
32
  var _useState = _sliced_to_array(useState(true), 2), innerLoading = _useState[0], setInnerLoading = _useState[1];
32
33
  var _useState1 = _sliced_to_array(useState(false), 2), isError = _useState1[0], setIsError = _useState1[1];
34
+ var locale = useConfig().locale;
33
35
  var pxCheck = function(value) {
34
36
  return Number.isNaN(Number(value)) ? String(value) : pxTransform(+value);
35
37
  };
@@ -62,8 +64,11 @@ export var Image = function(props) {
62
64
  if (!isError) return null;
63
65
  if (typeof error === 'boolean' && error === true && !innerLoading) {
64
66
  return /*#__PURE__*/ React.createElement(View, {
65
- className: "".concat(classPrefix, "-error")
66
- }, /*#__PURE__*/ React.createElement(ImageError, null));
67
+ className: "".concat(classPrefix, "-error"),
68
+ ariaLabel: locale.image.errorTip || ''
69
+ }, /*#__PURE__*/ React.createElement(ImageError, {
70
+ ariaHidden: true
71
+ }));
67
72
  }
68
73
  if (/*#__PURE__*/ React.isValidElement(error) && !innerLoading) {
69
74
  return /*#__PURE__*/ React.createElement(View, {
@@ -74,7 +79,8 @@ export var Image = function(props) {
74
79
  }, [
75
80
  error,
76
81
  isError,
77
- innerLoading
82
+ innerLoading,
83
+ locale
78
84
  ]);
79
85
  var renderLoading = useCallback(function() {
80
86
  if (!loading) return null;
@@ -100,6 +106,8 @@ export var Image = function(props) {
100
106
  className: classNames("".concat(classPrefix, "-default"), className && "".concat(className, "-image"), _define_property({}, "".concat(classPrefix, "-error"), isError)),
101
107
  style: imgStyle,
102
108
  src: src,
109
+ // @ts-ignore
110
+ ariaHidden: isError,
103
111
  onLoad: function(e) {
104
112
  return handleLoad(e);
105
113
  },
@@ -191,7 +191,9 @@ export var Input = /*#__PURE__*/ forwardRef(function(props, ref) {
191
191
  confirmType: confirmType,
192
192
  onBlur: handleBlur,
193
193
  onFocus: handleFocus,
194
- onInput: handleInput
194
+ onInput: handleInput,
195
+ ariaLabel: props.ariaLabel || // eslint-disable-next-line no-nested-ternary
196
+ (value ? undefined : placeholder === undefined ? locale.placeholder : placeholder)
195
197
  })), /*#__PURE__*/ React.createElement(View, {
196
198
  style: {
197
199
  display: clearable && !readOnly && active && value.length > 0 ? 'flex' : 'none',
@@ -204,8 +206,13 @@ export var Input = /*#__PURE__*/ forwardRef(function(props, ref) {
204
206
  setValue('');
205
207
  onClear === null || onClear === void 0 ? void 0 : onClear('');
206
208
  }
207
- }
208
- }, clearIcon || /*#__PURE__*/ React.createElement(MaskClose, {
209
+ },
210
+ ariaRole: "button",
211
+ ariaLabel: locale.clear || '清除'
212
+ }, clearIcon ? /*#__PURE__*/ React.cloneElement(clearIcon, {
213
+ ariaHidden: true
214
+ }) : /*#__PURE__*/ React.createElement(MaskClose, {
215
+ ariaHidden: true,
209
216
  className: "nut-input-clear"
210
217
  })));
211
218
  });
@@ -209,8 +209,7 @@ export var Popup = function(props) {
209
209
  onClick: handleCloseIconClick,
210
210
  ariaRole: "button",
211
211
  ariaLabel: closeAriaLabel || locale.close
212
- }, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : // @ts-ignore
213
- /*#__PURE__*/ React.createElement(Close, {
212
+ }, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ React.createElement(Close, {
214
213
  ariaHidden: true
215
214
  }));
216
215
  }, [