@arco-design/mobile-react 2.28.2 → 2.29.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 (85) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/grid/style/css/index.css +4 -0
  5. package/cjs/grid/style/index.less +6 -0
  6. package/cjs/index.d.ts +1 -0
  7. package/cjs/index.js +5 -1
  8. package/cjs/input/hooks.js +33 -40
  9. package/cjs/input/props.d.ts +1 -1
  10. package/cjs/skeleton/demo/style/css/mobile.css +7 -0
  11. package/cjs/skeleton/demo/style/mobile.less +13 -0
  12. package/cjs/skeleton/elements.d.ts +7 -0
  13. package/cjs/skeleton/elements.js +302 -0
  14. package/cjs/skeleton/index.d.ts +18 -0
  15. package/cjs/skeleton/index.js +100 -0
  16. package/cjs/skeleton/skeleton-context.d.ts +3 -0
  17. package/cjs/skeleton/skeleton-context.js +15 -0
  18. package/cjs/skeleton/style/css/index.css +180 -0
  19. package/cjs/skeleton/style/css/index.d.ts +3 -0
  20. package/cjs/skeleton/style/css/index.js +7 -0
  21. package/cjs/skeleton/style/index.d.ts +3 -0
  22. package/cjs/skeleton/style/index.js +7 -0
  23. package/cjs/skeleton/style/index.less +147 -0
  24. package/cjs/skeleton/type.d.ts +104 -0
  25. package/cjs/skeleton/type.js +3 -0
  26. package/cjs/style.d.ts +1 -0
  27. package/cjs/style.js +2 -0
  28. package/dist/index.js +423 -76
  29. package/dist/index.min.js +5 -5
  30. package/dist/style.css +123 -0
  31. package/dist/style.min.css +1 -1
  32. package/esm/grid/style/css/index.css +4 -0
  33. package/esm/grid/style/index.less +6 -0
  34. package/esm/index.d.ts +1 -0
  35. package/esm/index.js +1 -0
  36. package/esm/input/hooks.js +32 -40
  37. package/esm/input/props.d.ts +1 -1
  38. package/esm/skeleton/demo/style/css/mobile.css +7 -0
  39. package/esm/skeleton/demo/style/mobile.less +13 -0
  40. package/esm/skeleton/elements.d.ts +7 -0
  41. package/esm/skeleton/elements.js +281 -0
  42. package/esm/skeleton/index.d.ts +18 -0
  43. package/esm/skeleton/index.js +82 -0
  44. package/esm/skeleton/skeleton-context.d.ts +3 -0
  45. package/esm/skeleton/skeleton-context.js +5 -0
  46. package/esm/skeleton/style/css/index.css +180 -0
  47. package/esm/skeleton/style/css/index.d.ts +3 -0
  48. package/esm/skeleton/style/css/index.js +3 -0
  49. package/esm/skeleton/style/index.d.ts +3 -0
  50. package/esm/skeleton/style/index.js +3 -0
  51. package/esm/skeleton/style/index.less +147 -0
  52. package/esm/skeleton/type.d.ts +104 -0
  53. package/esm/skeleton/type.js +1 -0
  54. package/esm/style.d.ts +1 -0
  55. package/esm/style.js +1 -0
  56. package/package.json +3 -3
  57. package/tokens/app/arcodesign/default/css-variables.less +16 -0
  58. package/tokens/app/arcodesign/default/index.d.ts +16 -0
  59. package/tokens/app/arcodesign/default/index.js +17 -1
  60. package/tokens/app/arcodesign/default/index.json +190 -0
  61. package/tokens/app/arcodesign/default/index.less +16 -0
  62. package/umd/grid/style/css/index.css +4 -0
  63. package/umd/grid/style/index.less +6 -0
  64. package/umd/index.d.ts +1 -0
  65. package/umd/index.js +7 -5
  66. package/umd/input/hooks.js +36 -44
  67. package/umd/input/props.d.ts +1 -1
  68. package/umd/skeleton/demo/style/css/mobile.css +7 -0
  69. package/umd/skeleton/demo/style/mobile.less +13 -0
  70. package/umd/skeleton/elements.d.ts +7 -0
  71. package/umd/skeleton/elements.js +306 -0
  72. package/umd/skeleton/index.d.ts +18 -0
  73. package/umd/skeleton/index.js +104 -0
  74. package/umd/skeleton/skeleton-context.d.ts +3 -0
  75. package/umd/skeleton/skeleton-context.js +28 -0
  76. package/umd/skeleton/style/css/index.css +180 -0
  77. package/umd/skeleton/style/css/index.d.ts +3 -0
  78. package/umd/skeleton/style/css/index.js +15 -0
  79. package/umd/skeleton/style/index.d.ts +3 -0
  80. package/umd/skeleton/style/index.js +15 -0
  81. package/umd/skeleton/style/index.less +147 -0
  82. package/umd/skeleton/type.d.ts +104 -0
  83. package/umd/skeleton/type.js +17 -0
  84. package/umd/style.d.ts +1 -0
  85. package/umd/style.js +4 -4
package/dist/index.js CHANGED
@@ -941,7 +941,7 @@
941
941
  try {
942
942
  var u = navigator.userAgent;
943
943
  var android = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;
944
- var ios = u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) || u.indexOf('Mac OS X') > -1;
944
+ var ios = u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
945
945
  var pc = !android && !ios;
946
946
  var system = android ? 'android' : 'ios';
947
947
  return pc ? 'pc' : system;
@@ -6146,7 +6146,7 @@
6146
6146
  * @name_en Cell
6147
6147
  */
6148
6148
 
6149
- var index$o = componentWrapper(Cell, {
6149
+ var index$p = componentWrapper(Cell, {
6150
6150
  Group: Group$4
6151
6151
  });
6152
6152
 
@@ -7441,7 +7441,7 @@
7441
7441
  * @name_en ActionSheet
7442
7442
  */
7443
7443
 
7444
- var index$n = componentWrapper(ActionSheet, methodsGenerator$5(ActionSheetWithGlobalContext));
7444
+ var index$o = componentWrapper(ActionSheet, methodsGenerator$5(ActionSheetWithGlobalContext));
7445
7445
 
7446
7446
  /**
7447
7447
  * 加载中组件,分为四种类型,`circle`为环形,`arc`为弧线,`spin`为旋转,`dot`为圆点。所有类型均可定制颜色,环形和弧线类型可定制线圈半径及粗细,旋转和圆点类型可定制内部元素透明度。
@@ -8226,7 +8226,7 @@
8226
8226
  * @name_en Avatar
8227
8227
  */
8228
8228
 
8229
- var index$m = componentWrapper(Avatar, {
8229
+ var index$n = componentWrapper(Avatar, {
8230
8230
  Group: Group$3
8231
8231
  });
8232
8232
 
@@ -10479,7 +10479,7 @@
10479
10479
  * @name_en Collapse
10480
10480
  */
10481
10481
 
10482
- var index$l = componentWrapper(Collapse, {
10482
+ var index$m = componentWrapper(Collapse, {
10483
10483
  Group: Group$1
10484
10484
  });
10485
10485
 
@@ -12164,7 +12164,7 @@
12164
12164
  * @displayName DatePicker
12165
12165
  */
12166
12166
 
12167
- var index$k = componentWrapper(DatePicker, 'DatePicker');
12167
+ var index$l = componentWrapper(DatePicker, 'DatePicker');
12168
12168
 
12169
12169
  function normalizeAlert(config) {
12170
12170
  var _a = config || {},
@@ -12362,7 +12362,7 @@
12362
12362
  * @name_en Dialog
12363
12363
  */
12364
12364
 
12365
- var index$j = componentWrapper(Dialog, methodsGenerator$4(DialogWithGlobalContext));
12365
+ var index$k = componentWrapper(Dialog, methodsGenerator$4(DialogWithGlobalContext));
12366
12366
 
12367
12367
  /**
12368
12368
  * 划分内容的装饰线
@@ -14174,7 +14174,7 @@
14174
14174
  };
14175
14175
  });
14176
14176
 
14177
- var index$i = (function () {
14177
+ var index$j = (function () {
14178
14178
  // Export existing implementation if available.
14179
14179
  if (typeof global$1.ResizeObserver !== 'undefined') {
14180
14180
  return global$1.ResizeObserver;
@@ -14405,7 +14405,7 @@
14405
14405
  React.useEffect(function () {
14406
14406
  if (domRef.current && reflowOnResize) {
14407
14407
  if (!observerRef.current && ellipsis) {
14408
- observerRef.current = new index$i(reflow);
14408
+ observerRef.current = new index$j(reflow);
14409
14409
  observerRef.current.observe(domRef.current);
14410
14410
  }
14411
14411
  }
@@ -15335,7 +15335,7 @@
15335
15335
  * @name_en Form
15336
15336
  */
15337
15337
 
15338
- var index$h = componentWrapper(Form, {
15338
+ var index$i = componentWrapper(Form, {
15339
15339
  Item: Item$1
15340
15340
  });
15341
15341
 
@@ -17313,10 +17313,10 @@
17313
17313
  * @displayName ImagePicker
17314
17314
  */
17315
17315
 
17316
- var index$g = componentWrapper(ImagePicker, 'ImagePicker');
17316
+ var index$h = componentWrapper(ImagePicker, 'ImagePicker');
17317
17317
 
17318
17318
  /*!
17319
- * @arco-design/transformable v1.0.2
17319
+ * @arco-design/transformable v1.0.1
17320
17320
  * (c) 2022 ludan.kibbon
17321
17321
  */
17322
17322
  function _defineProperty(obj, key, value) {
@@ -20511,7 +20511,7 @@
20511
20511
  * @name_en ImagePreview
20512
20512
  */
20513
20513
 
20514
- var index$f = componentWrapper(ImagePreview, methodsGenerator$3(ImagePreviewWithGlobalContext));
20514
+ var index$g = componentWrapper(ImagePreview, methodsGenerator$3(ImagePreviewWithGlobalContext));
20515
20515
 
20516
20516
  var IndexBarContext = /*#__PURE__*/React.createContext({
20517
20517
  sticky: true,
@@ -20980,7 +20980,7 @@
20980
20980
  * @name_en SearchBar
20981
20981
  */
20982
20982
 
20983
- var index$e = componentWrapper(IndexBar, {
20983
+ var index$f = componentWrapper(IndexBar, {
20984
20984
  Group: IndexBarGroup
20985
20985
  });
20986
20986
 
@@ -21029,23 +21029,6 @@
21029
21029
  toggleClear = _f[1];
21030
21030
 
21031
21031
  var compositingRef = React.useRef(false);
21032
- /**
21033
- * clear相关问题背景
21034
- * 如果点击clear按钮之前已经是focusing状态了,那么在点完clear按钮之后会手动聚焦一下
21035
- * 该行为将导致onClear事件触发时,也会触发一次onBlur和onFocus事件,可能影响一些组件外的代码逻辑
21036
- *
21037
- * e.g. 假设input按钮右侧有一个按钮仅在聚焦时展示
21038
- * 实现代码大致是:onBlur设置其visible为false,onFocus设置其visible为true
21039
- * 那么这个按钮就会因为clear的点击造成一瞬的闪烁
21040
- *
21041
- * 解决思路
21042
- * 先来看一下,在输入框已激活的状态时,点击清除按钮后,组件的一些事件的触发顺序
21043
- * handleBlur -> handleClear -> handleFocus -> onBlur(外部回调) -> onFocus(外部回调)
21044
- * 可以看到外部的onBlur和onFocus回调都是在handleClear函数之后被调用
21045
- * 因此可以在handleClear中设置一个shouldPreventEvent的boolean标志
21046
- * 如果这个标志为true,则跳过调用外部的onBlur和onFocus,并在最后再将标志置回false
21047
- *
21048
- */
21049
21032
 
21050
21033
  var _g = React.useState(false),
21051
21034
  isFocusing = _g[0],
@@ -21145,28 +21128,24 @@
21145
21128
  }
21146
21129
 
21147
21130
  function handleFocus(e) {
21148
- nextTick(function () {
21149
- if (preventEventWhenClearing && shouldPreventEvent.current) {
21150
- shouldPreventEvent.current = false;
21151
- return;
21152
- }
21131
+ if (preventEventWhenClearing && shouldPreventEvent.current) {
21132
+ shouldPreventEvent.current = false;
21133
+ return;
21134
+ }
21153
21135
 
21154
- setIsFocusing(true);
21155
- clearShowType === 'focus' && toggleClear(true);
21156
- onFocus && onFocus(e);
21157
- });
21136
+ setIsFocusing(true);
21137
+ clearShowType === 'focus' && toggleClear(true);
21138
+ onFocus && onFocus(e);
21158
21139
  }
21159
21140
 
21160
21141
  function handleBlur(e) {
21161
- nextTick(function () {
21162
- if (preventEventWhenClearing && shouldPreventEvent.current) {
21163
- return;
21164
- }
21142
+ if (preventEventWhenClearing && shouldPreventEvent.current) {
21143
+ return;
21144
+ }
21165
21145
 
21166
- setIsFocusing(false);
21167
- clearShowType === 'focus' && toggleClear(false);
21168
- onBlur && onBlur(e);
21169
- });
21146
+ setIsFocusing(false);
21147
+ clearShowType === 'focus' && toggleClear(false);
21148
+ onBlur && onBlur(e);
21170
21149
  }
21171
21150
 
21172
21151
  function handleClick(e) {
@@ -21197,10 +21176,17 @@
21197
21176
 
21198
21177
  if (isFocusing) {
21199
21178
  if (preventEventWhenClearing) {
21200
- shouldPreventEvent.current = true;
21179
+ shouldPreventEvent.current = true; // 一段时间未执行blur或focus则重置,避免对下次事件循环造成影响
21180
+ // @en If blur or focus is not executed for a period of time, it will be reset to avoid affecting the next event loop
21181
+
21182
+ setTimeout(function () {
21183
+ shouldPreventEvent.current = false;
21184
+ }, 200);
21201
21185
  }
21202
21186
 
21203
- inputRef.current && inputRef.current.focus();
21187
+ nextTick(function () {
21188
+ inputRef.current && inputRef.current.focus();
21189
+ });
21204
21190
  }
21205
21191
  });
21206
21192
  }
@@ -21210,6 +21196,12 @@
21210
21196
  }
21211
21197
 
21212
21198
  function renderWrapper(prefixCls, type, children) {
21199
+ var _a; // handleClear必须早于handleBlur执行,pc端仅mousedown事件触发早于blur,移动端touch相关事件均早于blur
21200
+ // @en handleClear must be executed earlier than handleBlur
21201
+ // @en only the mousedown event on the PC side is triggered earlier than blur, and the touch-related events on the mobile side are all earlier than blur
21202
+
21203
+
21204
+ var clearEvent = (_a = {}, _a[system === 'pc' ? 'onMouseDown' : 'onTouchEnd'] = handleClear, _a);
21213
21205
  return /*#__PURE__*/React__default["default"].createElement("div", {
21214
21206
  role: "search",
21215
21207
  className: prefixCls + "-container all-border-box " + (className || ''),
@@ -21229,10 +21221,9 @@
21229
21221
  className: cls(prefixCls + "-label", {
21230
21222
  required: required
21231
21223
  })
21232
- }, label) : prefix) : null, children, clearable && showClear ? /*#__PURE__*/React__default["default"].createElement("div", {
21233
- className: prefixCls + "-clear",
21234
- onClick: handleClear
21235
- }, clearIcon) : null, suffix ? /*#__PURE__*/React__default["default"].createElement("div", {
21224
+ }, label) : prefix) : null, children, clearable && showClear ? /*#__PURE__*/React__default["default"].createElement("div", __assign$2({
21225
+ className: prefixCls + "-clear"
21226
+ }, clearEvent), clearIcon) : null, suffix ? /*#__PURE__*/React__default["default"].createElement("div", {
21236
21227
  className: prefixCls + "-suffix"
21237
21228
  }, suffix) : null), renderPendNode(append));
21238
21229
  }
@@ -21329,7 +21320,7 @@
21329
21320
  * @displayName Input
21330
21321
  */
21331
21322
 
21332
- var index$d = componentWrapper(Input, 'Input');
21323
+ var index$e = componentWrapper(Input, 'Input');
21333
21324
 
21334
21325
  // @en let keyboard random
21335
21326
 
@@ -22132,7 +22123,7 @@
22132
22123
  * @name_en Notify
22133
22124
  */
22134
22125
 
22135
- var index$c = componentWrapper(Notify, methodsGenerator$2(NotifyWithGlobalContext));
22126
+ var index$d = componentWrapper(Notify, methodsGenerator$2(NotifyWithGlobalContext));
22136
22127
 
22137
22128
  function Arrow() {
22138
22129
  return /*#__PURE__*/React__default["default"].createElement("svg", {
@@ -23544,7 +23535,7 @@
23544
23535
  * @type_en Data Display
23545
23536
  */
23546
23537
 
23547
- var index$b = componentWrapper(Popover$1, {
23538
+ var index$c = componentWrapper(Popover$1, {
23548
23539
  Menu: Menu
23549
23540
  });
23550
23541
 
@@ -23810,7 +23801,7 @@
23810
23801
  * @name_en PopupSwiper
23811
23802
  */
23812
23803
 
23813
- var index$a = componentWrapper(PopupSwiper, methodsGenerator$1(PopupSwiperWithGlobalContext));
23804
+ var index$b = componentWrapper(PopupSwiper, methodsGenerator$1(PopupSwiperWithGlobalContext));
23814
23805
 
23815
23806
  /**
23816
23807
  * 进度条组件,可根据外界传递进来的百分比进行进度展示
@@ -24661,7 +24652,7 @@
24661
24652
  * @displayName Radio
24662
24653
  */
24663
24654
 
24664
- var index$9 = componentWrapper(Radio, 'Radio', {
24655
+ var index$a = componentWrapper(Radio, 'Radio', {
24665
24656
  Group: Group
24666
24657
  });
24667
24658
 
@@ -24843,7 +24834,7 @@
24843
24834
  * @displayName Rate
24844
24835
  */
24845
24836
 
24846
- var index$8 = componentWrapper(Rate, 'Rate');
24837
+ var index$9 = componentWrapper(Rate, 'Rate');
24847
24838
 
24848
24839
  function createHighlightNode(config, index) {
24849
24840
  var keyword = config.keyword,
@@ -25218,6 +25209,361 @@
25218
25209
  return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, renderSearchBar);
25219
25210
  });
25220
25211
 
25212
+ var SkeletonContext = /*#__PURE__*/React__default["default"].createContext({
25213
+ showAnimation: true,
25214
+ animation: 'gradient'
25215
+ });
25216
+
25217
+ var calcOffset = function calcOffset(dom, useRtl) {
25218
+ if (!dom) {
25219
+ return 0;
25220
+ }
25221
+
25222
+ if (useRtl) {
25223
+ return dom.offsetLeft - dom.offsetTop;
25224
+ }
25225
+
25226
+ return dom.offsetLeft + dom.offsetTop;
25227
+ };
25228
+
25229
+ function useOffset(dom, useRtl) {
25230
+ var _a = React.useState(),
25231
+ offset = _a[0],
25232
+ setOffset = _a[1];
25233
+
25234
+ var calcLayout = function calcLayout() {
25235
+ var _a;
25236
+
25237
+ var isList = Array.isArray(dom);
25238
+
25239
+ if (!(isList ? dom.length > 0 : (_a = dom) === null || _a === void 0 ? void 0 : _a.current)) {
25240
+ return;
25241
+ }
25242
+
25243
+ setOffset(isList ? dom.map(function (item) {
25244
+ return calcOffset(item, useRtl);
25245
+ }) : calcOffset(dom.current, useRtl));
25246
+ };
25247
+
25248
+ React.useEffect(function () {
25249
+ nextTick(function () {
25250
+ calcLayout();
25251
+ });
25252
+ }, [dom, useRtl]);
25253
+ useListenResize(calcLayout);
25254
+ return offset;
25255
+ }
25256
+
25257
+ var SkeletonNode = /*#__PURE__*/React.forwardRef(function (props, ref) {
25258
+ var _a = props.className,
25259
+ className = _a === void 0 ? '' : _a,
25260
+ style = props.style,
25261
+ children = props.children;
25262
+
25263
+ var _b = React.useContext(GlobalContext),
25264
+ useRtl = _b.useRtl,
25265
+ prefixCls = _b.prefixCls;
25266
+
25267
+ var _c = React.useContext(SkeletonContext),
25268
+ backgroundColor = _c.backgroundColor,
25269
+ showAnimation = _c.showAnimation,
25270
+ animation = _c.animation;
25271
+
25272
+ var domRef = React.useRef(null);
25273
+ var isGradientAnimation = showAnimation && animation === 'gradient';
25274
+ var offset = useOffset(isGradientAnimation ? domRef : undefined, useRtl);
25275
+ React.useImperativeHandle(ref, function () {
25276
+ return {
25277
+ dom: domRef.current
25278
+ };
25279
+ });
25280
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25281
+ className: cls(prefixCls + "-skeleton-item", prefixCls + "-skeleton-node", showAnimation && prefixCls + "-skeleton-animation-" + animation, className),
25282
+ style: __assign$2({
25283
+ backgroundColor: backgroundColor
25284
+ }, style),
25285
+ ref: domRef
25286
+ }, children, isGradientAnimation && offset !== undefined && /*#__PURE__*/React__default["default"].createElement("div", {
25287
+ className: prefixCls + "-skeleton-animation-item",
25288
+ style: {
25289
+ left: 0 - offset
25290
+ }
25291
+ }));
25292
+ });
25293
+ var SkeletonTitle = /*#__PURE__*/React.forwardRef(function (props, ref) {
25294
+ var _a = props.className,
25295
+ className = _a === void 0 ? '' : _a,
25296
+ style = props.style,
25297
+ _b = props.width,
25298
+ width = _b === void 0 ? '40%' : _b;
25299
+
25300
+ var _c = React.useContext(GlobalContext),
25301
+ useRtl = _c.useRtl,
25302
+ prefixCls = _c.prefixCls;
25303
+
25304
+ var _d = React.useContext(SkeletonContext),
25305
+ backgroundColor = _d.backgroundColor,
25306
+ showAnimation = _d.showAnimation,
25307
+ animation = _d.animation;
25308
+
25309
+ var domRef = React.useRef(null);
25310
+ var isGradientAnimation = showAnimation && animation === 'gradient';
25311
+ var offset = useOffset(isGradientAnimation ? domRef : undefined, useRtl);
25312
+ React.useImperativeHandle(ref, function () {
25313
+ return {
25314
+ dom: domRef.current
25315
+ };
25316
+ });
25317
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25318
+ className: cls(prefixCls + "-skeleton-item", prefixCls + "-skeleton-title", showAnimation && prefixCls + "-skeleton-animation-" + animation, className),
25319
+ style: __assign$2({
25320
+ width: width,
25321
+ backgroundColor: backgroundColor
25322
+ }, style),
25323
+ ref: domRef
25324
+ }, isGradientAnimation && offset !== undefined && /*#__PURE__*/React__default["default"].createElement("div", {
25325
+ className: prefixCls + "-skeleton-animation-item",
25326
+ style: {
25327
+ left: 0 - offset
25328
+ }
25329
+ }));
25330
+ });
25331
+ var SkeletonParagraph = /*#__PURE__*/React.forwardRef(function (props, ref) {
25332
+ var _a = props.className,
25333
+ className = _a === void 0 ? '' : _a,
25334
+ style = props.style,
25335
+ _b = props.rows,
25336
+ rows = _b === void 0 ? 3 : _b,
25337
+ _c = props.width,
25338
+ width = _c === void 0 ? '60%' : _c;
25339
+
25340
+ var _d = React.useContext(GlobalContext),
25341
+ useRtl = _d.useRtl,
25342
+ prefixCls = _d.prefixCls;
25343
+
25344
+ var _e = React.useContext(SkeletonContext),
25345
+ backgroundColor = _e.backgroundColor,
25346
+ showAnimation = _e.showAnimation,
25347
+ animation = _e.animation;
25348
+
25349
+ var domRef = React.useRef(null);
25350
+ var lineDomRefs = React.useRef([]);
25351
+ var isGradientAnimation = showAnimation && animation === 'gradient';
25352
+ var offsets = useOffset(isGradientAnimation ? lineDomRefs.current : undefined, useRtl);
25353
+ React.useImperativeHandle(ref, function () {
25354
+ return {
25355
+ dom: domRef.current
25356
+ };
25357
+ });
25358
+
25359
+ var getWidth = function getWidth(idx) {
25360
+ if (isArray(width)) {
25361
+ return width[idx];
25362
+ }
25363
+
25364
+ if (rows - 1 === idx) {
25365
+ return width;
25366
+ }
25367
+
25368
+ return undefined;
25369
+ };
25370
+
25371
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25372
+ className: cls(prefixCls + "-skeleton-paragraph", className),
25373
+ style: style,
25374
+ ref: domRef
25375
+ }, Array.from(new Array(rows)).map(function (_, idx) {
25376
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25377
+ key: idx,
25378
+ className: cls(prefixCls + "-skeleton-item", prefixCls + "-skeleton-paragraph-line", showAnimation && prefixCls + "-skeleton-animation-" + animation),
25379
+ style: {
25380
+ width: getWidth(idx),
25381
+ backgroundColor: backgroundColor
25382
+ },
25383
+ ref: function ref(el) {
25384
+ return el && (lineDomRefs.current[idx] = el);
25385
+ }
25386
+ }, isGradientAnimation && offsets !== undefined && /*#__PURE__*/React__default["default"].createElement("div", {
25387
+ className: prefixCls + "-skeleton-animation-item",
25388
+ style: {
25389
+ left: 0 - (offsets[idx] || 0)
25390
+ }
25391
+ }));
25392
+ }));
25393
+ });
25394
+ var SkeletonAvatar = /*#__PURE__*/React.forwardRef(function (props, ref) {
25395
+ var _a = props.className,
25396
+ className = _a === void 0 ? '' : _a,
25397
+ style = props.style;
25398
+
25399
+ var _b = React.useContext(GlobalContext),
25400
+ useRtl = _b.useRtl,
25401
+ prefixCls = _b.prefixCls;
25402
+
25403
+ var _c = React.useContext(SkeletonContext),
25404
+ backgroundColor = _c.backgroundColor,
25405
+ showAnimation = _c.showAnimation,
25406
+ animation = _c.animation;
25407
+
25408
+ var domRef = React.useRef(null);
25409
+ var isGradientAnimation = showAnimation && animation === 'gradient';
25410
+ var offset = useOffset(isGradientAnimation ? domRef : undefined, useRtl);
25411
+ React.useImperativeHandle(ref, function () {
25412
+ return {
25413
+ dom: domRef.current
25414
+ };
25415
+ });
25416
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25417
+ className: cls(prefixCls + "-skeleton-item", prefixCls + "-skeleton-avatar", showAnimation && prefixCls + "-skeleton-animation-" + animation, className),
25418
+ style: __assign$2({
25419
+ backgroundColor: backgroundColor
25420
+ }, style),
25421
+ ref: domRef
25422
+ }, isGradientAnimation && offset !== undefined && /*#__PURE__*/React__default["default"].createElement("div", {
25423
+ className: prefixCls + "-skeleton-animation-item",
25424
+ style: {
25425
+ left: 0 - offset
25426
+ }
25427
+ }));
25428
+ });
25429
+ var SkeletonGrid = /*#__PURE__*/React.forwardRef(function (props, ref) {
25430
+ var _a = props.className,
25431
+ className = _a === void 0 ? '' : _a,
25432
+ style = props.style,
25433
+ _b = props.columns,
25434
+ columns = _b === void 0 ? 4 : _b;
25435
+
25436
+ var _c = React.useContext(GlobalContext),
25437
+ useRtl = _c.useRtl,
25438
+ prefixCls = _c.prefixCls;
25439
+
25440
+ var _d = React.useContext(SkeletonContext),
25441
+ backgroundColor = _d.backgroundColor,
25442
+ showAnimation = _d.showAnimation,
25443
+ animation = _d.animation;
25444
+
25445
+ var domRef = React.useRef(null);
25446
+ var iconDomRefs = React.useRef([]);
25447
+ var textDomRefs = React.useRef([]);
25448
+ var isGradientAnimation = showAnimation && animation === 'gradient';
25449
+ var iconOffsets = useOffset(isGradientAnimation ? iconDomRefs.current : undefined, useRtl);
25450
+ var textOffsets = useOffset(isGradientAnimation ? textDomRefs.current : undefined, useRtl);
25451
+ React.useImperativeHandle(ref, function () {
25452
+ return {
25453
+ dom: domRef.current
25454
+ };
25455
+ });
25456
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25457
+ className: cls(prefixCls + "-skeleton-grid", className),
25458
+ style: style,
25459
+ ref: domRef
25460
+ }, Array.from(new Array(columns)).map(function (_, idx) {
25461
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25462
+ key: idx,
25463
+ className: cls(prefixCls + "-skeleton-grid-item")
25464
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
25465
+ className: cls(prefixCls + "-skeleton-item", prefixCls + "-skeleton-grid-icon", showAnimation && prefixCls + "-skeleton-animation-" + animation),
25466
+ style: {
25467
+ backgroundColor: backgroundColor
25468
+ },
25469
+ ref: function ref(el) {
25470
+ return el && (iconDomRefs.current[idx] = el);
25471
+ }
25472
+ }, isGradientAnimation && iconOffsets !== undefined && /*#__PURE__*/React__default["default"].createElement("div", {
25473
+ className: prefixCls + "-skeleton-animation-item",
25474
+ style: {
25475
+ left: 0 - ((iconOffsets === null || iconOffsets === void 0 ? void 0 : iconOffsets[idx]) || 0)
25476
+ }
25477
+ })), /*#__PURE__*/React__default["default"].createElement("div", {
25478
+ className: cls(prefixCls + "-skeleton-item", prefixCls + "-skeleton-grid-text", showAnimation && prefixCls + "-skeleton-animation-" + animation),
25479
+ style: {
25480
+ backgroundColor: backgroundColor
25481
+ },
25482
+ ref: function ref(el) {
25483
+ return el && (textDomRefs.current[idx] = el);
25484
+ }
25485
+ }, isGradientAnimation && textOffsets !== undefined && /*#__PURE__*/React__default["default"].createElement("div", {
25486
+ className: prefixCls + "-skeleton-animation-item",
25487
+ style: {
25488
+ left: 0 - ((textOffsets === null || textOffsets === void 0 ? void 0 : textOffsets[idx]) || 0)
25489
+ }
25490
+ })));
25491
+ }));
25492
+ });
25493
+
25494
+ function getComponentProps(prop) {
25495
+ if (prop && typeof prop === 'object') {
25496
+ return prop;
25497
+ }
25498
+
25499
+ return {};
25500
+ }
25501
+
25502
+ var Skeleton = /*#__PURE__*/React.forwardRef(function (props, ref) {
25503
+ var _a;
25504
+
25505
+ var _b = props.className,
25506
+ className = _b === void 0 ? '' : _b,
25507
+ style = props.style,
25508
+ children = props.children,
25509
+ _c = props.title,
25510
+ title = _c === void 0 ? true : _c,
25511
+ _d = props.paragraph,
25512
+ paragraph = _d === void 0 ? true : _d,
25513
+ _e = props.avatar,
25514
+ avatar = _e === void 0 ? false : _e,
25515
+ grid = props.grid,
25516
+ _f = props.showAnimation,
25517
+ showAnimation = _f === void 0 ? true : _f,
25518
+ _g = props.animation,
25519
+ animation = _g === void 0 ? 'gradient' : _g,
25520
+ animationGradientColor = props.animationGradientColor,
25521
+ backgroundColor = props.backgroundColor;
25522
+ var domRef = React.useRef(null);
25523
+ var prefixCls = React.useContext(GlobalContext).prefixCls;
25524
+ React.useImperativeHandle(ref, function () {
25525
+ return {
25526
+ dom: domRef.current
25527
+ };
25528
+ });
25529
+ var isGrid = !!grid;
25530
+ var hasTitle = !!title;
25531
+ var hasParagraph = !!paragraph;
25532
+ var hasAvatar = !!avatar;
25533
+ var content = isGrid ? /*#__PURE__*/React__default["default"].createElement(SkeletonGrid, __assign$2({}, getComponentProps(grid))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, hasAvatar && /*#__PURE__*/React__default["default"].createElement(SkeletonAvatar, __assign$2({}, getComponentProps(avatar))), (hasTitle || hasParagraph) && /*#__PURE__*/React__default["default"].createElement("div", {
25534
+ className: prefixCls + "-skeleton-content"
25535
+ }, hasTitle && /*#__PURE__*/React__default["default"].createElement(SkeletonTitle, __assign$2({}, getComponentProps(title))), hasParagraph && /*#__PURE__*/React__default["default"].createElement(SkeletonParagraph, __assign$2({}, getComponentProps(paragraph)))));
25536
+ return /*#__PURE__*/React__default["default"].createElement("div", {
25537
+ className: cls(prefixCls + "-skeleton", (_a = {}, _a[prefixCls + "-skeleton-with-avatar"] = hasAvatar, _a), className),
25538
+ style: __assign$2({
25539
+ color: animationGradientColor
25540
+ }, style),
25541
+ ref: domRef
25542
+ }, /*#__PURE__*/React__default["default"].createElement(SkeletonContext.Provider, {
25543
+ value: {
25544
+ showAnimation: showAnimation,
25545
+ animation: animation,
25546
+ backgroundColor: backgroundColor
25547
+ }
25548
+ }, content, children));
25549
+ });
25550
+ /**
25551
+ * 在内容加载过程中展示一组占位图形。
25552
+ * @en Display a set of placeholder graphics during content loading
25553
+ * @type 信息展示
25554
+ * @type_en Data Display
25555
+ * @name 骨架屏
25556
+ * @name_en Skeleton
25557
+ */
25558
+
25559
+ var index$8 = componentWrapper(Skeleton, {
25560
+ Node: SkeletonNode,
25561
+ Title: SkeletonTitle,
25562
+ Paragraph: SkeletonParagraph,
25563
+ Avatar: SkeletonAvatar,
25564
+ Grid: SkeletonGrid
25565
+ });
25566
+
25221
25567
  var LISTEN_FLAG = 'data-show-listened';
25222
25568
  /**
25223
25569
  * 父 dom 节点集合
@@ -28503,50 +28849,51 @@
28503
28849
 
28504
28850
  var index = componentWrapper(Toast, methodsGenerator(ToastWithGlobalContext));
28505
28851
 
28506
- exports.ActionSheet = index$n;
28507
- exports.Avatar = index$m;
28852
+ exports.ActionSheet = index$o;
28853
+ exports.Avatar = index$n;
28508
28854
  exports.Badge = Badge;
28509
28855
  exports.Button = Button;
28510
28856
  exports.Carousel = Carousel;
28511
- exports.Cell = index$o;
28857
+ exports.Cell = index$p;
28512
28858
  exports.Checkbox = Checkbox;
28513
28859
  exports.CircleProgress = CircleProgress;
28514
- exports.Collapse = index$l;
28860
+ exports.Collapse = index$m;
28515
28861
  exports.ContextProvider = ContextProvider;
28516
28862
  exports.CountDown = CountDown;
28517
- exports.DatePicker = index$k;
28518
- exports.Dialog = index$j;
28863
+ exports.DatePicker = index$l;
28864
+ exports.Dialog = index$k;
28519
28865
  exports.Divider = Divider;
28520
28866
  exports.Dropdown = Dropdown$1;
28521
28867
  exports.DropdownMenu = DropdownMenu;
28522
28868
  exports.Ellipsis = Ellipsis;
28523
- exports.Form = index$h;
28869
+ exports.Form = index$i;
28524
28870
  exports.Grid = Grid;
28525
28871
  exports.Image = BaseImage;
28526
- exports.ImagePicker = index$g;
28527
- exports.ImagePreview = index$f;
28528
- exports.IndexBar = index$e;
28529
- exports.Input = index$d;
28872
+ exports.ImagePicker = index$h;
28873
+ exports.ImagePreview = index$g;
28874
+ exports.IndexBar = index$f;
28875
+ exports.Input = index$e;
28530
28876
  exports.Keyboard = Keyboard;
28531
28877
  exports.LoadMore = LoadMore;
28532
28878
  exports.Loading = Loading;
28533
28879
  exports.Masking = Masking$1;
28534
28880
  exports.NavBar = NavBar;
28535
28881
  exports.NoticeBar = NoticeBar;
28536
- exports.Notify = index$c;
28882
+ exports.Notify = index$d;
28537
28883
  exports.Pagination = Pagination;
28538
28884
  exports.Picker = Picker$1;
28539
28885
  exports.PickerView = PickerView$1;
28540
- exports.Popover = index$b;
28886
+ exports.Popover = index$c;
28541
28887
  exports.Popup = Popup$1;
28542
- exports.PopupSwiper = index$a;
28888
+ exports.PopupSwiper = index$b;
28543
28889
  exports.Portal = Portal;
28544
28890
  exports.Progress = Progress;
28545
28891
  exports.PullRefresh = PullRefresh;
28546
- exports.Radio = index$9;
28547
- exports.Rate = index$8;
28892
+ exports.Radio = index$a;
28893
+ exports.Rate = index$9;
28548
28894
  exports.SearchBar = SearchBar;
28549
28895
  exports.ShowMonitor = ShowMonitor;
28896
+ exports.Skeleton = index$8;
28550
28897
  exports.Slider = index$7;
28551
28898
  exports.Stepper = index$6;
28552
28899
  exports.Steps = index$5;