@arco-design/mobile-react 2.19.2-ee92494.5 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.en-US.md +4 -4
  3. package/README.md +4 -4
  4. package/cjs/avatar/group.js +1 -1
  5. package/cjs/avatar/index.js +10 -13
  6. package/cjs/avatar/style/css/index.css +96 -126
  7. package/cjs/avatar/style/index.less +54 -72
  8. package/cjs/badge/index.js +6 -8
  9. package/cjs/badge/style/css/index.css +5 -5
  10. package/cjs/badge/style/index.less +5 -5
  11. package/cjs/button/demo/style/mobile.less +0 -4
  12. package/cjs/button/hooks.d.ts +1 -2
  13. package/cjs/button/hooks.js +5 -3
  14. package/cjs/button/index.d.ts +1 -1
  15. package/cjs/button/index.js +28 -33
  16. package/cjs/button/style/css/index.css +75 -310
  17. package/cjs/button/style/index.less +32 -38
  18. package/cjs/dropdown/dropdown.d.ts +3 -0
  19. package/cjs/dropdown/dropdown.js +306 -0
  20. package/cjs/dropdown/index.d.ts +3 -4
  21. package/cjs/dropdown/index.js +3 -303
  22. package/cjs/dropdown/options.js +2 -1
  23. package/cjs/dropdown/type.d.ts +20 -9
  24. package/cjs/dropdown-menu/dropdown-menu.d.ts +4 -0
  25. package/cjs/dropdown-menu/dropdown-menu.js +273 -0
  26. package/cjs/dropdown-menu/helper.d.ts +1 -1
  27. package/cjs/dropdown-menu/index.d.ts +2 -3
  28. package/cjs/dropdown-menu/index.js +2 -245
  29. package/cjs/dropdown-menu/type.d.ts +21 -20
  30. package/cjs/image/index.js +4 -1
  31. package/cjs/image/style/css/index.css +2 -1
  32. package/cjs/image/style/index.less +2 -1
  33. package/cjs/image-picker/index.d.ts +6 -6
  34. package/cjs/image-picker/index.js +4 -3
  35. package/cjs/nav-bar/index.js +7 -2
  36. package/cjs/show-monitor/index.js +31 -3
  37. package/dist/index.js +644 -604
  38. package/dist/index.min.js +3 -3
  39. package/dist/style.css +174 -438
  40. package/dist/style.min.css +1 -1
  41. package/esm/avatar/group.js +1 -1
  42. package/esm/avatar/index.js +10 -13
  43. package/esm/avatar/style/css/index.css +96 -126
  44. package/esm/avatar/style/index.less +54 -72
  45. package/esm/badge/index.js +6 -8
  46. package/esm/badge/style/css/index.css +5 -5
  47. package/esm/badge/style/index.less +5 -5
  48. package/esm/button/demo/style/mobile.less +0 -4
  49. package/esm/button/hooks.d.ts +1 -2
  50. package/esm/button/hooks.js +5 -3
  51. package/esm/button/index.d.ts +1 -1
  52. package/esm/button/index.js +30 -35
  53. package/esm/button/style/css/index.css +75 -310
  54. package/esm/button/style/index.less +32 -38
  55. package/esm/dropdown/dropdown.d.ts +3 -0
  56. package/esm/dropdown/dropdown.js +288 -0
  57. package/esm/dropdown/index.d.ts +3 -4
  58. package/esm/dropdown/index.js +3 -293
  59. package/esm/dropdown/options.js +2 -1
  60. package/esm/dropdown/type.d.ts +20 -9
  61. package/esm/dropdown-menu/dropdown-menu.d.ts +4 -0
  62. package/esm/dropdown-menu/dropdown-menu.js +256 -0
  63. package/esm/dropdown-menu/helper.d.ts +1 -1
  64. package/esm/dropdown-menu/index.d.ts +2 -3
  65. package/esm/dropdown-menu/index.js +2 -237
  66. package/esm/dropdown-menu/type.d.ts +21 -20
  67. package/esm/image/index.js +4 -1
  68. package/esm/image/style/css/index.css +2 -1
  69. package/esm/image/style/index.less +2 -1
  70. package/esm/image-picker/index.d.ts +6 -6
  71. package/esm/image-picker/index.js +4 -3
  72. package/esm/nav-bar/index.js +6 -2
  73. package/esm/show-monitor/index.js +31 -3
  74. package/package.json +3 -3
  75. package/tokens/app/arcodesign/default/css-variables.less +2 -1
  76. package/tokens/app/arcodesign/default/index.d.ts +2 -1
  77. package/tokens/app/arcodesign/default/index.js +2 -1
  78. package/tokens/app/arcodesign/default/index.json +27 -15
  79. package/tokens/app/arcodesign/default/index.less +2 -1
  80. package/umd/avatar/group.js +1 -1
  81. package/umd/avatar/index.js +10 -13
  82. package/umd/avatar/style/css/index.css +96 -126
  83. package/umd/avatar/style/index.less +54 -72
  84. package/umd/badge/index.js +6 -8
  85. package/umd/badge/style/css/index.css +5 -5
  86. package/umd/badge/style/index.less +5 -5
  87. package/umd/button/demo/style/mobile.less +0 -4
  88. package/umd/button/hooks.d.ts +1 -2
  89. package/umd/button/hooks.js +5 -3
  90. package/umd/button/index.d.ts +1 -1
  91. package/umd/button/index.js +28 -33
  92. package/umd/button/style/css/index.css +75 -310
  93. package/umd/button/style/index.less +32 -38
  94. package/umd/dropdown/dropdown.d.ts +3 -0
  95. package/umd/dropdown/dropdown.js +309 -0
  96. package/umd/dropdown/index.d.ts +3 -4
  97. package/umd/dropdown/index.js +5 -298
  98. package/umd/dropdown/options.js +2 -1
  99. package/umd/dropdown/type.d.ts +20 -9
  100. package/umd/dropdown-menu/dropdown-menu.d.ts +4 -0
  101. package/umd/dropdown-menu/dropdown-menu.js +278 -0
  102. package/umd/dropdown-menu/helper.d.ts +1 -1
  103. package/umd/dropdown-menu/index.d.ts +2 -3
  104. package/umd/dropdown-menu/index.js +5 -241
  105. package/umd/dropdown-menu/type.d.ts +21 -20
  106. package/umd/image/index.js +4 -1
  107. package/umd/image/style/css/index.css +2 -1
  108. package/umd/image/style/index.less +2 -1
  109. package/umd/image-picker/index.d.ts +6 -6
  110. package/umd/image-picker/index.js +4 -3
  111. package/umd/nav-bar/index.js +9 -6
  112. package/umd/show-monitor/index.js +31 -3
@@ -52,27 +52,25 @@ var Badge = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
52
52
  };
53
53
  });
54
54
 
55
- function renderInnerBadge() {
55
+ function renderInnerBadge(prefix) {
56
56
  return dot ? null : /*#__PURE__*/_react.default.createElement("span", {
57
- className: "badge-text"
57
+ className: prefix + "-text badge-text"
58
58
  }, Number(text) && Number(text) > maxCount ? maxCount + "+" : text);
59
59
  }
60
60
 
61
61
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
62
+ var _cls;
63
+
62
64
  var prefixCls = _ref.prefixCls;
63
65
  return /*#__PURE__*/_react.default.createElement(_transition.default, {
64
66
  in: visible,
65
67
  timeout: timeout,
66
68
  type: "scale"
67
69
  }, /*#__PURE__*/_react.default.createElement("div", {
68
- className: (0, _mobileUtils.cls)(prefixCls + "-badge", className, {
69
- dot: dot,
70
- bordered: bordered,
71
- absolute: absolute
72
- }),
70
+ className: (0, _mobileUtils.cls)(prefixCls + "-badge", className, (_cls = {}, _cls[prefixCls + "-badge-dot dot"] = dot, _cls[prefixCls + "-badge-bordered bordered"] = bordered, _cls[prefixCls + "-badge-absolute absolute"] = absolute, _cls)),
73
71
  style: style,
74
72
  ref: domRef
75
- }, children || renderInnerBadge()));
73
+ }, children || renderInnerBadge(prefixCls + "-badge")));
76
74
  });
77
75
  });
78
76
  var _default = Badge;
@@ -68,28 +68,28 @@
68
68
  min-width: 8PX;
69
69
  padding: 0 4PX ;
70
70
  }
71
- .arco-badge .badge-text {
71
+ .arco-badge-text {
72
72
  display: block;
73
73
  font-weight: 500;
74
74
  font-size: 12PX;
75
75
  }
76
- .arco-badge.dot {
76
+ .arco-badge-dot {
77
77
  width: 8PX ;
78
78
  height: 8PX ;
79
79
  padding: 0;
80
80
  min-width: auto;
81
81
  }
82
- .arco-badge.bordered {
82
+ .arco-badge-bordered {
83
83
  border: 1PX solid #FFFFFF ;
84
84
  }
85
- .arco-badge.absolute {
85
+ .arco-badge-absolute {
86
86
  position: absolute;
87
87
  top: 0;
88
88
  left: 100%;
89
89
  margin-left: -8PX ;
90
90
  margin-top: -8PX ;
91
91
  }
92
- .arco-badge.absolute.dot {
92
+ .arco-badge-absolute.arco-badge-dot {
93
93
  margin-left: -4PX ;
94
94
  margin-top: -4PX ;
95
95
  }
@@ -40,24 +40,24 @@
40
40
  .set-content-box-width-var(min-width, badge-text-width, badge-text-padding, badge-text-padding);
41
41
  .use-var(padding, badge-text-padding, 0);
42
42
 
43
- .badge-text {
43
+ &-text {
44
44
  display: block;
45
45
  font-weight: 500;
46
46
  .set-font-size-var(badge-font-size);
47
47
  }
48
48
 
49
- &.dot {
49
+ &-dot {
50
50
  .use-var(width, badge-dot-width);
51
51
  .use-var(height, badge-dot-width);
52
52
  padding: 0;
53
53
  min-width: auto;
54
54
  }
55
55
 
56
- &.bordered {
56
+ &-bordered {
57
57
  .use-var(border, badge-border-color, 1PX solid);
58
58
  }
59
59
 
60
- &.absolute {
60
+ &-absolute {
61
61
  position: absolute;
62
62
  top: 0;
63
63
  left: 100%;
@@ -65,7 +65,7 @@
65
65
  .use-var(margin-top, badge-text-deviation);
66
66
  }
67
67
 
68
- &.absolute.dot {
68
+ &-absolute&-dot {
69
69
  .use-var(margin-left, badge-dot-deviation);
70
70
  .use-var(margin-top, badge-dot-deviation);
71
71
  }
@@ -17,7 +17,3 @@
17
17
  }
18
18
  }
19
19
  }
20
-
21
- #demo-order-6 {
22
-
23
- }
@@ -1,8 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { ButtonProps } from '.';
3
- export declare const useCustomColor: ({ color, bgColor, borderColor, isActive: active, disabled, }: Pick<ButtonProps, "color" | "borderColor" | "type" | "bgColor"> & {
3
+ export declare const useCustomColor: ({ color, bgColor, borderColor, isActive: active, disabled, halfBorder, }: Pick<ButtonProps, 'color' | 'bgColor' | 'borderColor' | 'type' | 'disabled' | 'halfBorder'> & {
4
4
  isActive: boolean;
5
- disabled: boolean;
6
5
  }) => {
7
6
  customColorStyle: CSSProperties;
8
7
  customColorClass: string[];
@@ -27,7 +27,8 @@ var useCustomColor = function useCustomColor(_ref) {
27
27
  bgColor = _ref.bgColor,
28
28
  borderColor = _ref.borderColor,
29
29
  active = _ref.isActive,
30
- disabled = _ref.disabled;
30
+ disabled = _ref.disabled,
31
+ halfBorder = _ref.halfBorder;
31
32
  var state = {
32
33
  active: active,
33
34
  disabled: disabled
@@ -64,8 +65,9 @@ var useCustomColor = function useCustomColor(_ref) {
64
65
  return res;
65
66
  }, [styleConfig, active, disabled]);
66
67
  var customColorClass = (0, _react.useMemo)(function () {
67
- return styleConfig.borderColor ? ['has-custom-border'] : [];
68
- }, [diffColor(borderColor)]);
68
+ var borderCls = halfBorder ? 'half-border' : '';
69
+ return styleConfig.borderColor ? ['has-custom-border'] : [borderCls];
70
+ }, [styleConfig.borderColor, halfBorder]);
69
71
  return {
70
72
  customColorStyle: customColorStyle,
71
73
  customColorClass: customColorClass
@@ -118,7 +118,7 @@ export interface ButtonProps {
118
118
  /**
119
119
  * 加载中是否覆盖Icon
120
120
  * @en Whether to override Icon during loading
121
- * @default false
121
+ * @default true
122
122
  */
123
123
  coverIconWhenLoading?: boolean;
124
124
  }
@@ -32,6 +32,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
32
32
  * @name_en Button
33
33
  */
34
34
  var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
35
+ var _ref, _cls;
36
+
35
37
  var _useState = (0, _react.useState)(false),
36
38
  isActive = _useState[0],
37
39
  setActive = _useState[1];
@@ -71,8 +73,13 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
71
73
  onClick = props.onClick,
72
74
  onClickDisabled = props.onClickDisabled,
73
75
  _props$coverIconWhenL = props.coverIconWhenLoading,
74
- coverIconWhenLoading = _props$coverIconWhenL === void 0 ? false : _props$coverIconWhenL;
76
+ coverIconWhenLoading = _props$coverIconWhenL === void 0 ? true : _props$coverIconWhenL;
75
77
  var domRef = (0, _react.useRef)(null);
78
+
79
+ var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
80
+ prefixCls = _useContext.prefixCls;
81
+
82
+ var prefix = prefixCls + "-button";
76
83
  (0, _react.useImperativeHandle)(ref, function () {
77
84
  return {
78
85
  dom: domRef.current
@@ -84,7 +91,8 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
84
91
  bgColor: bgColor,
85
92
  borderColor: borderColor,
86
93
  isActive: isActive,
87
- disabled: disabled
94
+ disabled: disabled,
95
+ halfBorder: halfBorder
88
96
  }),
89
97
  customColorClass = _useCustomColor.customColorClass,
90
98
  customColorStyle = _useCustomColor.customColorStyle;
@@ -107,37 +115,24 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
107
115
  return icon;
108
116
  };
109
117
 
110
- return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
111
- var prefixCls = _ref.prefixCls;
112
- return /*#__PURE__*/_react.default.createElement("button", {
113
- type: "button",
114
- ref: domRef,
115
- style: (0, _extends2.default)({}, customColorStyle, style),
116
- className: _mobileUtils.cls.apply(void 0, [prefixCls + "-button", className, "type-" + type, "size-" + size, "is-" + shape, system, {
117
- inline: inline,
118
- disabled: disabled,
119
- loading: loading,
120
- active: isActive,
121
- 'half-border': halfBorder
122
- }].concat(customColorClass)),
123
- onTouchStart: handleTouchStart,
124
- onTouchEnd: handleTouchEnd,
125
- onTouchCancel: handleTouchEnd,
126
- onMouseDown: handleTouchStart,
127
- onMouseUp: handleTouchEnd,
128
- onClick: disabled || loading && disableWhenLoading ? onClickDisabled : onClick
129
- }, /*#__PURE__*/_react.default.createElement("div", {
130
- className: "btn-icon"
131
- }, renderIcon(), loading && (loadingIcon === void 0 ? /*#__PURE__*/_react.default.createElement(_loading.default, {
132
- className: "loading-icon",
133
- radius: 6,
134
- type: "circle"
135
- }) : loadingIcon)), (!loading || loading && showTextWhenLoading) && children ? /*#__PURE__*/_react.default.createElement("div", {
136
- className: (0, _mobileUtils.cls)('btn-text', {
137
- 'has-icon': loading || icon
138
- })
139
- }, children) : null);
140
- });
118
+ return /*#__PURE__*/_react.default.createElement("button", {
119
+ type: "button",
120
+ ref: domRef,
121
+ style: (0, _extends2.default)({}, customColorStyle, style),
122
+ className: _mobileUtils.cls.apply(void 0, [prefix, prefix + "-type-" + type + " type-" + type, prefix + "-size-" + size + " " + prefix + "-size-" + size + "-is-" + shape + " size-" + size, className, "is-" + shape, system, (_ref = {}, _ref[prefix + "-inline inline"] = inline, _ref[prefix + "-type-" + type + "-disabled disabled"] = disabled, _ref.loading = loading, _ref[prefix + "-type-" + type + "-active active"] = isActive, _ref)].concat(customColorClass)),
123
+ onTouchStart: handleTouchStart,
124
+ onTouchEnd: handleTouchEnd,
125
+ onTouchCancel: handleTouchEnd,
126
+ onClick: disabled || loading && disableWhenLoading ? onClickDisabled : onClick
127
+ }, icon || loading ? /*#__PURE__*/_react.default.createElement("div", {
128
+ className: prefix + "-icon btn-icon"
129
+ }, renderIcon(), loading && (loadingIcon === void 0 ? /*#__PURE__*/_react.default.createElement(_loading.default, {
130
+ className: prefix + "-loading-icon loading-icon",
131
+ radius: 6,
132
+ type: "circle"
133
+ }) : loadingIcon)) : null, (!loading || loading && showTextWhenLoading) && children ? /*#__PURE__*/_react.default.createElement("div", {
134
+ className: (0, _mobileUtils.cls)(prefix + "-text", prefix + "-text-" + system, 'btn-text', (_cls = {}, _cls[prefix + "-text-has-icon has-icon"] = loading || icon, _cls))
135
+ }, children) : null);
141
136
  });
142
137
  var _default = Button;
143
138
  exports.default = _default;