@arco-design/mobile-react 2.30.4 → 2.30.5

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 (76) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/dialog/style/css/index.css +88 -0
  5. package/cjs/dialog/style/index.less +16 -4
  6. package/cjs/ellipsis/index.d.ts +2 -2
  7. package/cjs/ellipsis/index.js +2 -2
  8. package/cjs/image-preview/index.js +1 -0
  9. package/cjs/index-bar/style/css/index.css +28 -5
  10. package/cjs/index-bar/style/index.less +10 -10
  11. package/cjs/pagination/arrow.js +6 -3
  12. package/cjs/pagination/style/css/index.css +21 -6
  13. package/cjs/pagination/style/index.less +9 -9
  14. package/cjs/picker/style/css/index.css +8 -0
  15. package/cjs/picker/style/index.less +2 -2
  16. package/cjs/progress/style/css/index.css +20 -0
  17. package/cjs/progress/style/index.less +5 -5
  18. package/cjs/search-bar/style/css/index.css +18 -0
  19. package/cjs/search-bar/style/index.less +5 -5
  20. package/cjs/slider/hooks/index.d.ts +1 -1
  21. package/cjs/slider/index.d.ts +10 -0
  22. package/cjs/slider/index.js +1 -0
  23. package/cjs/slider/thumb.d.ts +6 -5
  24. package/cjs/slider/thumb.js +19 -20
  25. package/dist/index.js +34 -26
  26. package/dist/index.min.js +1 -1
  27. package/dist/style.css +146 -11
  28. package/dist/style.min.css +1 -1
  29. package/esm/dialog/style/css/index.css +88 -0
  30. package/esm/dialog/style/index.less +16 -4
  31. package/esm/ellipsis/index.d.ts +2 -2
  32. package/esm/ellipsis/index.js +2 -2
  33. package/esm/image-preview/index.js +1 -0
  34. package/esm/index-bar/style/css/index.css +28 -5
  35. package/esm/index-bar/style/index.less +10 -10
  36. package/esm/pagination/arrow.js +6 -3
  37. package/esm/pagination/style/css/index.css +21 -6
  38. package/esm/pagination/style/index.less +9 -9
  39. package/esm/picker/style/css/index.css +8 -0
  40. package/esm/picker/style/index.less +2 -2
  41. package/esm/progress/style/css/index.css +20 -0
  42. package/esm/progress/style/index.less +5 -5
  43. package/esm/search-bar/style/css/index.css +18 -0
  44. package/esm/search-bar/style/index.less +5 -5
  45. package/esm/slider/hooks/index.d.ts +1 -1
  46. package/esm/slider/index.d.ts +10 -0
  47. package/esm/slider/index.js +1 -0
  48. package/esm/slider/thumb.d.ts +6 -5
  49. package/esm/slider/thumb.js +19 -17
  50. package/package.json +3 -3
  51. package/tokens/app/arcodesign/default/css-variables.less +3 -4
  52. package/tokens/app/arcodesign/default/index.d.ts +0 -1
  53. package/tokens/app/arcodesign/default/index.js +3 -4
  54. package/tokens/app/arcodesign/default/index.json +9 -21
  55. package/tokens/app/arcodesign/default/index.less +3 -4
  56. package/umd/dialog/style/css/index.css +88 -0
  57. package/umd/dialog/style/index.less +16 -4
  58. package/umd/ellipsis/index.d.ts +2 -2
  59. package/umd/ellipsis/index.js +2 -2
  60. package/umd/image-preview/index.js +1 -0
  61. package/umd/index-bar/style/css/index.css +28 -5
  62. package/umd/index-bar/style/index.less +10 -10
  63. package/umd/pagination/arrow.js +6 -3
  64. package/umd/pagination/style/css/index.css +21 -6
  65. package/umd/pagination/style/index.less +9 -9
  66. package/umd/picker/style/css/index.css +8 -0
  67. package/umd/picker/style/index.less +2 -2
  68. package/umd/progress/style/css/index.css +20 -0
  69. package/umd/progress/style/index.less +5 -5
  70. package/umd/search-bar/style/css/index.css +18 -0
  71. package/umd/search-bar/style/index.less +5 -5
  72. package/umd/slider/hooks/index.d.ts +1 -1
  73. package/umd/slider/index.d.ts +10 -0
  74. package/umd/slider/index.js +1 -0
  75. package/umd/slider/thumb.d.ts +6 -5
  76. package/umd/slider/thumb.js +23 -23
@@ -538,9 +538,15 @@
538
538
  .arco-search-bar-input-left {
539
539
  text-align: left;
540
540
  }
541
+ [dir="rtl"] .arco-search-bar-input-left {
542
+ text-align: right;
543
+ }
541
544
  .arco-search-bar-input-right {
542
545
  text-align: right;
543
546
  }
547
+ [dir="rtl"] .arco-search-bar-input-right {
548
+ text-align: left;
549
+ }
544
550
  .arco-search-bar-input-center {
545
551
  text-align: center;
546
552
  }
@@ -570,11 +576,19 @@
570
576
  .arco-search-bar-prefix {
571
577
  margin-right: 0.18rem ;
572
578
  }
579
+ [dir="rtl"] .arco-search-bar-prefix {
580
+ margin-right: initial;
581
+ margin-left: 0.18rem ;
582
+ }
573
583
  .arco-search-bar-clear {
574
584
  color: #c9cdd4 ;
575
585
  font-size: 16PX ;
576
586
  padding-left: 0.32rem ;
577
587
  }
588
+ [dir="rtl"] .arco-search-bar-clear {
589
+ padding-left: initial;
590
+ padding-right: 0.32rem ;
591
+ }
578
592
  .arco-search-bar-search-icon {
579
593
  color: #86909c ;
580
594
  font-size: 0.32rem ;
@@ -584,6 +598,10 @@
584
598
  color: #165DFF ;
585
599
  font-size: 0.3rem ;
586
600
  }
601
+ [dir="rtl"] .arco-search-bar-cancel-btn {
602
+ margin-left: initial;
603
+ margin-right: 0.32rem ;
604
+ }
587
605
  .arco-search-bar-association {
588
606
  position: absolute;
589
607
  left: 0;
@@ -34,10 +34,10 @@
34
34
  .use-var(height, search-bar-input-height);
35
35
  .use-var(caret-color, search-bar-input-caret-color);
36
36
  &-left {
37
- text-align: left;
37
+ .set-value-with-rtl(text-align, left);
38
38
  }
39
39
  &-right {
40
- text-align: right;
40
+ .set-value-with-rtl(text-align, right);
41
41
  }
42
42
  &-center {
43
43
  text-align: center;
@@ -62,13 +62,13 @@
62
62
  }
63
63
 
64
64
  &-prefix {
65
- .use-var(margin-right, search-bar-prefix-margin-right);
65
+ .use-var-with-rtl(margin-right, search-bar-prefix-margin-right);
66
66
  }
67
67
 
68
68
  &-clear {
69
69
  .use-var(color, search-bar-clear-icon-color);
70
70
  .use-var(font-size, search-bar-clear-icon-font-size);
71
- .use-var(padding-left, search-bar-clear-icon-padding-left);
71
+ .use-var-with-rtl(padding-left, search-bar-clear-icon-padding-left);
72
72
  }
73
73
 
74
74
  &-search-icon {
@@ -77,7 +77,7 @@
77
77
  }
78
78
 
79
79
  &-cancel-btn {
80
- .use-var(margin-left, search-bar-cancel-btn-margin-left);
80
+ .use-var-with-rtl(margin-left, search-bar-cancel-btn-margin-left);
81
81
  .use-var(color, search-bar-cancel-btn-color);
82
82
  .use-var(font-size, search-bar-cancel-btn-font-size);
83
83
  }
@@ -5,7 +5,7 @@ export declare type LinePosition = {
5
5
  length: number;
6
6
  start: number;
7
7
  };
8
- export declare const SliderContext: React.Context<Required<Pick<SliderProps, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "onAfterChange" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks">>;
8
+ export declare const SliderContext: React.Context<Required<Pick<SliderProps, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "onAfterChange" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks" | "renderThumbPopover">>;
9
9
  export * from './useSliderIcon';
10
10
  export * from './useSliderInit';
11
11
  export * from './useSliderStyle';
@@ -130,6 +130,16 @@ export interface SliderProps {
130
130
  * @en Custom slider
131
131
  */
132
132
  renderThumb?: (value: number) => ReactNode;
133
+ /**
134
+ * 自定义滑块的Popover,优先级高于formatTooltip。value表示当前滑动进度,visible表示气泡的可见性,index表示当前滑块索引,thumbEl表示当前滑块元素。
135
+ * @en Custom slider popover,priority is higher than formatTooltip. value - current sliding progress, visible - visibility of the bubble, index - current slider index, thumbEl - current slider element.
136
+ */
137
+ renderThumbPopover?: (config: {
138
+ value: number;
139
+ visible: boolean;
140
+ index: number;
141
+ thumbEl: React.ReactNode;
142
+ }) => ReactNode;
133
143
  }
134
144
  export interface SliderRef {
135
145
  /**
@@ -169,6 +169,7 @@ var Slider = /*#__PURE__*/(0, _react.forwardRef)(function (_, ref) {
169
169
  key: idx
170
170
  }, (0, _extends2.default)({
171
171
  value: Array.isArray(valueGroup) ? valueGroup[idx] : valueGroup,
172
+ idx: idx,
172
173
  min: min,
173
174
  max: max,
174
175
  isTouching: commonIsTouching === idx
@@ -1,8 +1,9 @@
1
- import React, { CSSProperties } from 'react';
2
- declare const Thumb: ({ className, value, style, isTouching, }: {
3
- className?: string | undefined;
1
+ import { CSSProperties } from 'react';
2
+ declare function Thumb({ className, value, style, isTouching, idx, }: {
3
+ className?: string;
4
4
  value: number;
5
5
  isTouching: boolean;
6
- style?: React.CSSProperties | undefined;
7
- }) => JSX.Element;
6
+ style?: CSSProperties;
7
+ idx: number;
8
+ }): JSX.Element;
8
9
  export default Thumb;
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
-
10
6
  var _react = _interopRequireWildcard(require("react"));
11
7
 
12
8
  var _popover = require("./popover");
@@ -19,11 +15,13 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
15
 
20
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
17
 
22
- var Thumb = function Thumb(_ref) {
23
- var className = _ref.className,
18
+ function Thumb(_ref) {
19
+ var _ref$className = _ref.className,
20
+ className = _ref$className === void 0 ? '' : _ref$className,
24
21
  value = _ref.value,
25
22
  style = _ref.style,
26
- isTouching = _ref.isTouching;
23
+ isTouching = _ref.isTouching,
24
+ idx = _ref.idx;
27
25
 
28
26
  var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
29
27
  _useContext$prefixCls = _useContext.prefixCls,
@@ -32,7 +30,8 @@ var Thumb = function Thumb(_ref) {
32
30
  var _useContext2 = (0, _react.useContext)(_hooks.SliderContext),
33
31
  showTooltip = _useContext2.showTooltip,
34
32
  renderThumb = _useContext2.renderThumb,
35
- formatTooltip = _useContext2.formatTooltip;
33
+ formatTooltip = _useContext2.formatTooltip,
34
+ renderThumbPopover = _useContext2.renderThumbPopover;
36
35
 
37
36
  var isHidden = showTooltip === 'never';
38
37
  var renderValue = (0, _react.useMemo)(function () {
@@ -43,21 +42,21 @@ var Thumb = function Thumb(_ref) {
43
42
  if (showTooltip === 'always') return true;
44
43
  return isTouching;
45
44
  }, [showTooltip, isTouching]);
46
-
47
- var renderWrapper = function renderWrapper(el) {
48
- return /*#__PURE__*/_react.default.createElement("div", {
49
- className: prefixCls + "-slider-thumb-wrapper " + className,
50
- style: (0, _extends2.default)({}, style)
51
- }, el);
52
- };
53
-
54
45
  var thumbEl = typeof renderThumb === 'function' ? renderThumb(value) : renderThumb;
55
- if (isHidden) return renderWrapper(thumbEl);
56
- return renderWrapper( /*#__PURE__*/_react.default.createElement(_popover.Popover, {
46
+ var popoverEl = typeof renderThumbPopover === 'function' ? renderThumbPopover({
47
+ value: value,
48
+ visible: isTooltipVisible,
49
+ thumbEl: thumbEl,
50
+ index: idx
51
+ }) : /*#__PURE__*/_react.default.createElement(_popover.Popover, {
57
52
  visible: isTooltipVisible,
58
53
  content: renderValue
59
- }, thumbEl));
60
- };
54
+ }, thumbEl);
55
+ return /*#__PURE__*/_react.default.createElement("div", {
56
+ className: prefixCls + "-slider-thumb-wrapper " + className,
57
+ style: style
58
+ }, isHidden ? thumbEl : popoverEl);
59
+ }
61
60
 
62
61
  var _default = Thumb;
63
62
  exports.default = _default;
package/dist/index.js CHANGED
@@ -15964,8 +15964,8 @@
15964
15964
  var NativeEllipsis$1 = /*#__PURE__*/React__default["default"].memo(NativeEllipsis);
15965
15965
 
15966
15966
  /**
15967
- * 文本缩略组件,支持多行缩略、富文本、自定义缩略符、尾字符过滤等。
15968
- * @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc.
15967
+ * 文本缩略组件,支持多行缩略、富文本、自定义缩略符、尾字符过滤等。如果传入的文本内容中包含换行符号`\n`,建议将`\n`替换为`<br/>`,并设置`dangerouslyUseInnerHTML=true`。
15968
+ * @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc. If the incoming text contains newline characters `\n`, it is recommended to replace `\n` with `<br/>`, and set `dangerouslyUseInnerHTML=true`.
15969
15969
  * @type 信息展示
15970
15970
  * @type_en Data Display
15971
15971
  * @name 文本缩略
@@ -20875,6 +20875,7 @@
20875
20875
  dragMode: 'always',
20876
20876
  transformMode: 'matrix',
20877
20877
  useDomBoundary: false,
20878
+ preventScroll: false,
20878
20879
  cubic: {
20879
20880
  scroll: scrollBezier
20880
20881
  },
@@ -23506,10 +23507,13 @@
23506
23507
 
23507
23508
  function Arrow() {
23508
23509
  return /*#__PURE__*/React__default["default"].createElement("svg", {
23509
- width: "8",
23510
+ width: "2",
23510
23511
  height: "14",
23511
- viewBox: "0 0 8 14",
23512
- fill: "none"
23512
+ viewBox: "3 0 2 14",
23513
+ fill: "none",
23514
+ style: {
23515
+ overflow: 'visible'
23516
+ }
23513
23517
  }, /*#__PURE__*/React__default["default"].createElement("path", {
23514
23518
  fillRule: "evenodd",
23515
23519
  clipRule: "evenodd",
@@ -27963,18 +27967,21 @@
27963
27967
  }))), children);
27964
27968
  }
27965
27969
 
27966
- var Thumb = function Thumb(_a) {
27967
- var className = _a.className,
27970
+ function Thumb(_a) {
27971
+ var _b = _a.className,
27972
+ className = _b === void 0 ? '' : _b,
27968
27973
  value = _a.value,
27969
27974
  style = _a.style,
27970
- isTouching = _a.isTouching;
27971
- var _b = React.useContext(GlobalContext).prefixCls,
27972
- prefixCls = _b === void 0 ? '' : _b;
27975
+ isTouching = _a.isTouching,
27976
+ idx = _a.idx;
27977
+ var _c = React.useContext(GlobalContext).prefixCls,
27978
+ prefixCls = _c === void 0 ? '' : _c;
27973
27979
 
27974
- var _c = React.useContext(SliderContext),
27975
- showTooltip = _c.showTooltip,
27976
- renderThumb = _c.renderThumb,
27977
- formatTooltip = _c.formatTooltip;
27980
+ var _d = React.useContext(SliderContext),
27981
+ showTooltip = _d.showTooltip,
27982
+ renderThumb = _d.renderThumb,
27983
+ formatTooltip = _d.formatTooltip,
27984
+ renderThumbPopover = _d.renderThumbPopover;
27978
27985
 
27979
27986
  var isHidden = showTooltip === 'never';
27980
27987
  var renderValue = React.useMemo(function () {
@@ -27985,21 +27992,21 @@
27985
27992
  if (showTooltip === 'always') return true;
27986
27993
  return isTouching;
27987
27994
  }, [showTooltip, isTouching]);
27988
-
27989
- var renderWrapper = function renderWrapper(el) {
27990
- return /*#__PURE__*/React__default["default"].createElement("div", {
27991
- className: prefixCls + "-slider-thumb-wrapper " + className,
27992
- style: __assign$2({}, style)
27993
- }, el);
27994
- };
27995
-
27996
27995
  var thumbEl = typeof renderThumb === 'function' ? renderThumb(value) : renderThumb;
27997
- if (isHidden) return renderWrapper(thumbEl);
27998
- return renderWrapper( /*#__PURE__*/React__default["default"].createElement(Popover, {
27996
+ var popoverEl = typeof renderThumbPopover === 'function' ? renderThumbPopover({
27997
+ value: value,
27998
+ visible: isTooltipVisible,
27999
+ thumbEl: thumbEl,
28000
+ index: idx
28001
+ }) : /*#__PURE__*/React__default["default"].createElement(Popover, {
27999
28002
  visible: isTooltipVisible,
28000
28003
  content: renderValue
28001
- }, thumbEl));
28002
- };
28004
+ }, thumbEl);
28005
+ return /*#__PURE__*/React__default["default"].createElement("div", {
28006
+ className: prefixCls + "-slider-thumb-wrapper " + className,
28007
+ style: style
28008
+ }, isHidden ? thumbEl : popoverEl);
28009
+ }
28003
28010
 
28004
28011
  function Marks(_a) {
28005
28012
  var runTimeConfig = _a.runTimeConfig,
@@ -28190,6 +28197,7 @@
28190
28197
  key: idx
28191
28198
  }, __assign$2({
28192
28199
  value: Array.isArray(valueGroup) ? valueGroup[idx] : valueGroup,
28200
+ idx: idx,
28193
28201
  min: min,
28194
28202
  max: max,
28195
28203
  isTouching: commonIsTouching === idx