@autobest-ui/components 1.3.0 → 2.0.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 (183) hide show
  1. package/esm/accordion/Item.d.ts +1 -1
  2. package/esm/accordion/Item.js +5 -3
  3. package/esm/accordion/index.d.ts +1 -1
  4. package/esm/accordion/index.js +5 -3
  5. package/esm/affix/PortalAffix.js +7 -7
  6. package/esm/affix/index.js +19 -17
  7. package/esm/carousel/index.js +16 -14
  8. package/esm/checkbox/index.js +19 -17
  9. package/esm/collapse/index.js +13 -11
  10. package/esm/confirm/index.d.ts +1 -1
  11. package/esm/confirm/index.js +14 -14
  12. package/esm/date-picker/calendar/Day.d.ts +1 -1
  13. package/esm/date-picker/calendar/Day.js +11 -11
  14. package/esm/date-picker/calendar/MonthYear.js +8 -8
  15. package/esm/date-picker/calendar/grid/index.js +18 -18
  16. package/esm/date-picker/calendar/index.js +7 -5
  17. package/esm/date-picker/calendar/types.js +1 -0
  18. package/esm/date-picker/index.js +15 -13
  19. package/esm/drawer/Child.js +6 -6
  20. package/esm/drawer/index.js +11 -9
  21. package/esm/ellipsis/index.js +4 -4
  22. package/esm/guide/index.d.ts +4 -5
  23. package/esm/guide/index.js +19 -19
  24. package/esm/index.d.ts +0 -1
  25. package/esm/index.js +0 -1
  26. package/esm/input-number/index.d.ts +4 -4
  27. package/esm/input-number/index.js +27 -25
  28. package/esm/lazy-image/index.d.ts +3 -3
  29. package/esm/lazy-image/index.js +6 -4
  30. package/esm/link-list/index.js +24 -22
  31. package/esm/link-list/style/index.css +1 -1
  32. package/esm/loading/index.d.ts +7 -2
  33. package/esm/loading/index.js +20 -26
  34. package/esm/loading/style/index.css +1 -1
  35. package/esm/loading/style/index.scss +0 -10
  36. package/esm/loading-bar/index.d.ts +1 -0
  37. package/esm/loading-bar/index.js +3 -3
  38. package/esm/loading-container/index.js +6 -6
  39. package/esm/loading-icon/index.js +12 -12
  40. package/esm/mask/index.js +4 -4
  41. package/esm/message/index.js +14 -14
  42. package/esm/modal/Affix.d.ts +1 -0
  43. package/esm/modal/Affix.js +1 -1
  44. package/esm/modal/Title.js +9 -9
  45. package/esm/modal/getPopupLocation.js +1 -1
  46. package/esm/modal/index.d.ts +1 -1
  47. package/esm/modal/index.js +21 -19
  48. package/esm/modal/style/index.css +1 -1
  49. package/esm/move/index.d.ts +1 -1
  50. package/esm/move/index.js +14 -12
  51. package/esm/popover/index.js +9 -9
  52. package/esm/portal/index.js +5 -3
  53. package/esm/script/index.js +8 -6
  54. package/esm/select/index.d.ts +3 -3
  55. package/esm/select/index.js +34 -36
  56. package/esm/show-more/index.js +14 -12
  57. package/esm/skeleton/Item.js +3 -3
  58. package/esm/skeleton/index.js +11 -15
  59. package/esm/style.css +9 -10
  60. package/esm/table/body/BodyRow.js +8 -8
  61. package/esm/table/body/CheckIcon.js +7 -7
  62. package/esm/table/body/index.d.ts +1 -1
  63. package/esm/table/body/index.js +6 -6
  64. package/esm/table/header/CheckIcon.js +6 -6
  65. package/esm/table/header/HeaderCell.d.ts +1 -1
  66. package/esm/table/header/HeaderCell.js +10 -8
  67. package/esm/table/header/HeaderRow.d.ts +1 -0
  68. package/esm/table/header/HeaderRow.js +2 -2
  69. package/esm/table/index.d.ts +3 -7
  70. package/esm/table/index.js +20 -18
  71. package/esm/table/interface.js +1 -0
  72. package/esm/tabs/index.d.ts +1 -1
  73. package/esm/tabs/index.js +14 -12
  74. package/esm/tooltip/index.d.ts +1 -0
  75. package/esm/tooltip/index.js +1 -1
  76. package/esm/trigger/bottomAlign.js +2 -2
  77. package/esm/trigger/getPopupLocation.js +2 -1
  78. package/esm/trigger/index.d.ts +4 -4
  79. package/esm/trigger/index.js +24 -22
  80. package/esm/trigger/leftAlign.js +2 -2
  81. package/esm/trigger/rightAlign.js +2 -2
  82. package/esm/trigger/topAlign.js +2 -2
  83. package/esm/trigger/utils.js +2 -2
  84. package/lib/accordion/Item.d.ts +1 -1
  85. package/lib/accordion/Item.js +5 -3
  86. package/lib/accordion/index.d.ts +1 -1
  87. package/lib/accordion/index.js +5 -3
  88. package/lib/affix/PortalAffix.js +7 -7
  89. package/lib/affix/index.js +19 -17
  90. package/lib/carousel/index.js +16 -14
  91. package/lib/checkbox/index.js +19 -17
  92. package/lib/collapse/index.js +13 -11
  93. package/lib/confirm/index.d.ts +1 -1
  94. package/lib/confirm/index.js +14 -14
  95. package/lib/date-picker/calendar/Day.d.ts +1 -1
  96. package/lib/date-picker/calendar/Day.js +12 -12
  97. package/lib/date-picker/calendar/MonthYear.js +9 -9
  98. package/lib/date-picker/calendar/grid/index.js +18 -18
  99. package/lib/date-picker/calendar/index.js +8 -6
  100. package/lib/date-picker/calendar/types.js +5 -1
  101. package/lib/date-picker/index.js +15 -13
  102. package/lib/date-picker/utils.js +8 -8
  103. package/lib/drawer/Child.js +6 -6
  104. package/lib/drawer/index.js +11 -9
  105. package/lib/ellipsis/index.js +4 -4
  106. package/lib/guide/index.d.ts +4 -5
  107. package/lib/guide/index.js +19 -20
  108. package/lib/index.d.ts +0 -1
  109. package/lib/index.js +54 -62
  110. package/lib/input-number/index.d.ts +4 -4
  111. package/lib/input-number/index.js +27 -25
  112. package/lib/lazy-image/index.d.ts +3 -3
  113. package/lib/lazy-image/index.js +6 -4
  114. package/lib/link-list/index.js +24 -22
  115. package/lib/link-list/style/index.css +1 -1
  116. package/lib/loading/index.d.ts +7 -2
  117. package/lib/loading/index.js +20 -27
  118. package/lib/loading/style/index.css +1 -1
  119. package/lib/loading/style/index.scss +0 -10
  120. package/lib/loading-bar/index.d.ts +1 -0
  121. package/lib/loading-bar/index.js +3 -3
  122. package/lib/loading-container/index.js +6 -6
  123. package/lib/loading-icon/index.js +12 -12
  124. package/lib/mask/index.js +4 -4
  125. package/lib/message/index.js +14 -14
  126. package/lib/modal/Affix.d.ts +1 -0
  127. package/lib/modal/Affix.js +1 -1
  128. package/lib/modal/Title.js +9 -9
  129. package/lib/modal/getPopupLocation.js +1 -1
  130. package/lib/modal/index.d.ts +1 -1
  131. package/lib/modal/index.js +22 -20
  132. package/lib/modal/style/index.css +1 -1
  133. package/lib/move/index.d.ts +1 -1
  134. package/lib/move/index.js +14 -12
  135. package/lib/popover/index.js +9 -9
  136. package/lib/portal/index.js +5 -3
  137. package/lib/script/index.js +8 -6
  138. package/lib/select/index.d.ts +3 -3
  139. package/lib/select/index.js +34 -36
  140. package/lib/show-more/index.js +14 -12
  141. package/lib/skeleton/Item.js +3 -3
  142. package/lib/skeleton/index.js +11 -15
  143. package/lib/style.css +9 -10
  144. package/lib/table/body/BodyRow.js +8 -8
  145. package/lib/table/body/CheckIcon.js +7 -7
  146. package/lib/table/body/index.d.ts +1 -1
  147. package/lib/table/body/index.js +6 -6
  148. package/lib/table/header/CheckIcon.js +6 -6
  149. package/lib/table/header/HeaderCell.d.ts +1 -1
  150. package/lib/table/header/HeaderCell.js +10 -8
  151. package/lib/table/header/HeaderRow.d.ts +1 -0
  152. package/lib/table/header/HeaderRow.js +2 -2
  153. package/lib/table/index.d.ts +3 -7
  154. package/lib/table/index.js +20 -18
  155. package/lib/table/interface.js +5 -1
  156. package/lib/tabs/index.d.ts +1 -1
  157. package/lib/tabs/index.js +14 -12
  158. package/lib/tooltip/index.d.ts +1 -0
  159. package/lib/tooltip/index.js +1 -1
  160. package/lib/trigger/align.js +24 -24
  161. package/lib/trigger/bottomAlign.js +3 -3
  162. package/lib/trigger/constants.js +1 -1
  163. package/lib/trigger/getPopupLocation.js +2 -1
  164. package/lib/trigger/index.d.ts +4 -4
  165. package/lib/trigger/index.js +25 -23
  166. package/lib/trigger/leftAlign.js +3 -3
  167. package/lib/trigger/ref.js +1 -1
  168. package/lib/trigger/rightAlign.js +3 -3
  169. package/lib/trigger/topAlign.js +3 -3
  170. package/lib/trigger/utils.js +4 -4
  171. package/package.json +1 -1
  172. package/esm/use-config/index.d.ts +0 -5
  173. package/esm/use-config/index.js +0 -13
  174. package/esm/use-config/style/index.css +0 -0
  175. package/esm/use-config/style/index.d.ts +0 -1
  176. package/esm/use-config/style/index.js +0 -1
  177. package/esm/use-config/style/index.scss +0 -0
  178. package/lib/use-config/index.d.ts +0 -5
  179. package/lib/use-config/index.js +0 -21
  180. package/lib/use-config/style/index.css +0 -0
  181. package/lib/use-config/style/index.d.ts +0 -1
  182. package/lib/use-config/style/index.js +0 -1
  183. package/lib/use-config/style/index.scss +0 -0
@@ -6,7 +6,7 @@ var __extends = this && this.__extends || function () {
6
6
  d.__proto__ = b;
7
7
  } || function (d, b) {
8
8
  for (var p in b) {
9
- if (b.hasOwnProperty(p)) d[p] = b[p];
9
+ if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
10
10
  }
11
11
  };
12
12
 
@@ -14,6 +14,8 @@ var __extends = this && this.__extends || function () {
14
14
  };
15
15
 
16
16
  return function (d, b) {
17
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18
+
17
19
  _extendStatics(d, b);
18
20
 
19
21
  function __() {
@@ -53,7 +55,7 @@ function (_super) {
53
55
  function InputNumber(props) {
54
56
  var _this = _super.call(this, props) || this;
55
57
 
56
- _this.currentRef = React.createRef();
58
+ _this.currentRef = /*#__PURE__*/React.createRef();
57
59
 
58
60
  _this.onFocus = function (e) {
59
61
  var _a = _this.props,
@@ -133,19 +135,19 @@ function (_super) {
133
135
 
134
136
  if (isAdd) {
135
137
  inputEl.style.cursor = 'default';
136
- addBtnEl.setAttribute('class', cls + "-button " + cls + "-hover");
138
+ addBtnEl.setAttribute('class', "".concat(cls, "-button ").concat(cls, "-hover"));
137
139
  return;
138
140
  }
139
141
 
140
142
  if (isSub) {
141
143
  inputEl.style.cursor = 'default';
142
- subBtnEl.setAttribute('class', cls + "-button " + cls + "-hover");
144
+ subBtnEl.setAttribute('class', "".concat(cls, "-button ").concat(cls, "-hover"));
143
145
  return;
144
146
  }
145
147
 
146
148
  inputEl.style.cursor = 'text';
147
- addBtnEl.setAttribute('class', cls + "-button");
148
- subBtnEl.setAttribute('class', cls + "-button");
149
+ addBtnEl.setAttribute('class', "".concat(cls, "-button"));
150
+ subBtnEl.setAttribute('class', "".concat(cls, "-button"));
149
151
  };
150
152
 
151
153
  _this.onMouseDown = function (ev) {
@@ -173,13 +175,13 @@ function (_super) {
173
175
  isSub = _b.isSub;
174
176
 
175
177
  if (isAdd) {
176
- addBtnEl.setAttribute('class', cls + "-button " + cls + "-active");
178
+ addBtnEl.setAttribute('class', "".concat(cls, "-button ").concat(cls, "-active"));
177
179
 
178
180
  _this.onAdd();
179
181
  }
180
182
 
181
183
  if (isSub) {
182
- subBtnEl.setAttribute('class', cls + "-button " + cls + "-active");
184
+ subBtnEl.setAttribute('class', "".concat(cls, "-button ").concat(cls, "-active"));
183
185
 
184
186
  _this.onSub();
185
187
  }
@@ -199,8 +201,8 @@ function (_super) {
199
201
  subBtnEl = _a.subBtnEl;
200
202
 
201
203
  if (addBtnEl && subBtnEl) {
202
- addBtnEl.setAttribute('class', cls + "-button");
203
- subBtnEl.setAttribute('class', cls + "-button");
204
+ addBtnEl.setAttribute('class', "".concat(cls, "-button"));
205
+ subBtnEl.setAttribute('class', "".concat(cls, "-button"));
204
206
  } // 重新添加move事件
205
207
 
206
208
 
@@ -315,7 +317,7 @@ function (_super) {
315
317
  }
316
318
 
317
319
  var resultArr = value.split('.');
318
- return resultArr[0] + "." + (resultArr[1] || '').padEnd(digital, '0');
320
+ return "".concat(resultArr[0], ".").concat((resultArr[1] || '').padEnd(digital, '0'));
319
321
  };
320
322
 
321
323
  _this.onChangePackMultipleValue = function (value) {
@@ -438,7 +440,7 @@ function (_super) {
438
440
 
439
441
 
440
442
  if (digital) {
441
- currentValue = new RegExp("[^.]+([.](\\d{0," + digital + "}))?").exec(currentValue)[0].toString();
443
+ currentValue = new RegExp("[^.]+([.](\\d{0,".concat(digital, "}))?")).exec(currentValue)[0].toString();
442
444
  }
443
445
 
444
446
  var valueNumber = parseFloat(currentValue);
@@ -517,18 +519,18 @@ function (_super) {
517
519
 
518
520
 
519
521
  _this.renderButton = function () {
520
- return React.createElement("div", {
521
- className: cls + "-button-wrap"
522
- }, React.createElement("div", {
523
- className: cls + "-button",
522
+ return /*#__PURE__*/React.createElement("div", {
523
+ className: "".concat(cls, "-button-wrap")
524
+ }, /*#__PURE__*/React.createElement("div", {
525
+ className: "".concat(cls, "-button"),
524
526
  onClick: _this.onAdd
525
- }, React.createElement("div", {
526
- className: cls + "-add"
527
- })), React.createElement("div", {
528
- className: cls + "-button",
527
+ }, /*#__PURE__*/React.createElement("div", {
528
+ className: "".concat(cls, "-add")
529
+ })), /*#__PURE__*/React.createElement("div", {
530
+ className: "".concat(cls, "-button"),
529
531
  onClick: _this.onSub
530
- }, React.createElement("div", {
531
- className: cls + "-sub"
532
+ }, /*#__PURE__*/React.createElement("div", {
533
+ className: "".concat(cls, "-sub")
532
534
  })));
533
535
  };
534
536
 
@@ -597,10 +599,10 @@ function (_super) {
597
599
  var inputStyle = visibleButton ? {
598
600
  paddingRight: '.2rem'
599
601
  } : {};
600
- return React.createElement("label", {
601
- className: cls + "-wrap",
602
+ return /*#__PURE__*/React.createElement("label", {
603
+ className: "".concat(cls, "-wrap"),
602
604
  ref: this.currentRef
603
- }, React.createElement("input", __assign({}, copyProps, {
605
+ }, /*#__PURE__*/React.createElement("input", __assign({}, copyProps, {
604
606
  className: classNames(cls, className),
605
607
  type: "text",
606
608
  onChange: this.onValueChange,
@@ -1,4 +1,4 @@
1
- import React, { MouseEventHandler } from 'react';
1
+ import React, { MouseEventHandler, MouseEvent } from 'react';
2
2
  export interface LazyImageProps {
3
3
  /**
4
4
  * 需要显示的图片
@@ -71,8 +71,8 @@ declare class LazyImage extends React.Component<LazyImageProps, LazyImageStates>
71
71
  * 监听原生lazy loading, 并回调不同的事件
72
72
  */
73
73
  originalLazyLoad: () => void;
74
- onMouseOut: (ev: React.MouseEvent<HTMLImageElement, globalThis.MouseEvent>) => void;
75
- onMouseOver: (ev: React.MouseEvent<HTMLImageElement, globalThis.MouseEvent>) => void;
74
+ onMouseOut: (ev: MouseEvent<HTMLImageElement>) => void;
75
+ onMouseOver: (ev: MouseEvent<HTMLImageElement>) => void;
76
76
  render(): JSX.Element;
77
77
  }
78
78
  export default LazyImage;
@@ -6,7 +6,7 @@ var __extends = this && this.__extends || function () {
6
6
  d.__proto__ = b;
7
7
  } || function (d, b) {
8
8
  for (var p in b) {
9
- if (b.hasOwnProperty(p)) d[p] = b[p];
9
+ if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
10
10
  }
11
11
  };
12
12
 
@@ -14,6 +14,8 @@ var __extends = this && this.__extends || function () {
14
14
  };
15
15
 
16
16
  return function (d, b) {
17
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18
+
17
19
  _extendStatics(d, b);
18
20
 
19
21
  function __() {
@@ -54,7 +56,7 @@ function (_super) {
54
56
  var _this = _super.call(this, props) || this;
55
57
 
56
58
  _this.prefixCls = 'ab-lazy-image';
57
- _this.rootRef = React.createRef();
59
+ _this.rootRef = /*#__PURE__*/React.createRef();
58
60
  _this.isUnmount = false;
59
61
  /**
60
62
  * 监听原生lazy loading, 并回调不同的事件
@@ -193,10 +195,10 @@ function (_super) {
193
195
  delete props.active;
194
196
  delete props.onLoading;
195
197
  delete props.onLoaded;
196
- return React.createElement("img", __assign({
198
+ return /*#__PURE__*/React.createElement("img", __assign({
197
199
  alt: ""
198
200
  }, props, {
199
- className: classNames(cls, className, (_a = {}, _a[cls + "-loading"] = loading, _a[cls + "-active"] = loading && active, _a)),
201
+ className: classNames(cls, className, (_a = {}, _a["".concat(cls, "-loading")] = loading, _a["".concat(cls, "-active")] = loading && active, _a)),
200
202
  onMouseOver: this.onMouseOver,
201
203
  onMouseOut: this.onMouseOut,
202
204
  onFocus: noop,
@@ -6,7 +6,7 @@ var __extends = this && this.__extends || function () {
6
6
  d.__proto__ = b;
7
7
  } || function (d, b) {
8
8
  for (var p in b) {
9
- if (b.hasOwnProperty(p)) d[p] = b[p];
9
+ if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
10
10
  }
11
11
  };
12
12
 
@@ -14,6 +14,8 @@ var __extends = this && this.__extends || function () {
14
14
  };
15
15
 
16
16
  return function (d, b) {
17
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18
+
17
19
  _extendStatics(d, b);
18
20
 
19
21
  function __() {
@@ -56,15 +58,15 @@ function (_super) {
56
58
 
57
59
  var hrefTarget = this.props.hrefTarget;
58
60
  var cls = this.prefixCls;
59
- return item.url ? React.createElement("a", {
61
+ return item.url ? /*#__PURE__*/React.createElement("a", {
60
62
  href: item.url,
61
- className: item.isHidden ? cls + "-hidden" : undefined,
63
+ className: item.isHidden ? "".concat(cls, "-hidden") : undefined,
62
64
  key: item.url,
63
65
  target: hrefTarget
64
- }, item.name + " ") : React.createElement("span", {
66
+ }, "".concat(item.name, " ")) : /*#__PURE__*/React.createElement("span", {
65
67
  key: item.name,
66
- className: classNames((_a = {}, _a[cls + "-hidden"] = item.isHidden, _a))
67
- }, item.name + " ");
68
+ className: classNames((_a = {}, _a["".concat(cls, "-hidden")] = item.isHidden, _a))
69
+ }, "".concat(item.name, " "));
68
70
  };
69
71
 
70
72
  LinkList.prototype.renderItem = function (item) {
@@ -75,21 +77,21 @@ function (_super) {
75
77
 
76
78
  var subInfo = item.subInfo;
77
79
  var cls = this.prefixCls;
78
- return React.createElement(Popover, {
80
+ return /*#__PURE__*/React.createElement(Popover, {
79
81
  key: item.name,
80
- tip: React.createElement(React.Fragment, null, React.createElement("strong", {
81
- className: cls + "-sub-title"
82
+ tip: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("strong", {
83
+ className: "".concat(cls, "-sub-title")
82
84
  }, subInfo.title, ": "), subInfo.list.map(function (subItem, index) {
83
- return React.createElement("a", {
85
+ return /*#__PURE__*/React.createElement("a", {
84
86
  href: subItem.url,
85
87
  key: index,
86
- className: cls + "-sub-link"
87
- }, subItem.name + " ");
88
+ className: "".concat(cls, "-sub-link")
89
+ }, "".concat(subItem.name, " "));
88
90
  })),
89
91
  isInsertNode: true,
90
92
  placement: "BottomLeft",
91
93
  trigger: "click",
92
- wrapClassName: cls + "-wrap-popover",
94
+ wrapClassName: "".concat(cls, "-wrap-popover"),
93
95
  mouseEnterDelay: 0.1
94
96
  }, this.renderItemContent(item));
95
97
  };
@@ -124,17 +126,17 @@ function (_super) {
124
126
  extraTopElement = _c.extraTopElement,
125
127
  extraBottomElement = _c.extraBottomElement,
126
128
  columnCount = _c.columnCount;
127
- return React.createElement("div", {
129
+ return /*#__PURE__*/React.createElement("div", {
128
130
  className: classNames(cls, className)
129
- }, title ? React.createElement("div", {
130
- className: classNames(cls + "-title", (_a = {}, _a[cls + "-divider"] = !visible, _a)),
131
+ }, title ? /*#__PURE__*/React.createElement("div", {
132
+ className: classNames("".concat(cls, "-title"), (_a = {}, _a["".concat(cls, "-divider")] = !visible, _a)),
131
133
  onClick: this.onVisibleChange
132
- }, title, React.createElement("span", {
133
- className: cls + "-icon"
134
- }, visible ? '-' : '+')) : null, React.createElement("div", {
135
- className: classNames(cls + "-body", (_b = {}, _b[cls + "-active"] = visible, _b))
136
- }, extraTopElement, React.createElement("div", {
137
- className: classNames(cls + "-content", cls + "-col" + columnCount)
134
+ }, title, /*#__PURE__*/React.createElement("span", {
135
+ className: "".concat(cls, "-icon")
136
+ }, visible ? '-' : '+')) : null, /*#__PURE__*/React.createElement("div", {
137
+ className: classNames("".concat(cls, "-body"), (_b = {}, _b["".concat(cls, "-active")] = visible, _b))
138
+ }, extraTopElement, /*#__PURE__*/React.createElement("div", {
139
+ className: classNames("".concat(cls, "-content"), "".concat(cls, "-col").concat(columnCount))
138
140
  }, this.renderContent()), extraBottomElement));
139
141
  };
140
142
 
@@ -1 +1 @@
1
- .ab-link-list-title{font-size:.16rem;margin:0 0;padding:0 0 .12rem 0;display:flex;justify-content:space-between;align-items:center}.ab-link-list-icon{display:none}.ab-link-list-content{flex-wrap:wrap;width:auto;margin-right:-.15rem}.ab-link-list-content.ab-link-list-col2>a,.ab-link-list-content.ab-link-list-col2>span{min-width:calc(100% / 2 - .15rem);max-width:calc(100% / 2 - .15rem)}.ab-link-list-content.ab-link-list-col4>a,.ab-link-list-content.ab-link-list-col4>span{min-width:calc(100% / 4 - .15rem);max-width:calc(100% / 4 - .15rem)}.ab-link-list-content.ab-link-list-col5>a,.ab-link-list-content.ab-link-list-col5>span{min-width:calc(100% / 5 - .15rem);max-width:calc(100% / 5 - .15rem)}.ab-link-list-content.ab-link-list-col6>a,.ab-link-list-content.ab-link-list-col6>span{min-width:calc(100% / 6 - .15rem);max-width:calc(100% / 6 - .15rem)}.ab-link-list-content.ab-link-list-col8>a,.ab-link-list-content.ab-link-list-col8>span{min-width:calc(100% / 8 - .15rem);max-width:calc(100% / 8 - .15rem)}.ab-link-list-content>a,.ab-link-list-content>span{cursor:pointer;border:.5px solid #d0d0d0;margin-bottom:8px;display:inline-block;justify-content:space-between;align-items:center;width:100%;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.085rem .15rem .085rem .12rem;color:#333;margin-right:.15rem}.ab-link-list-content>a:after,.ab-link-list-content>span:after{content:'>';position:absolute;right:.1rem;top:50%;transform:translateY(-50%);color:grey;font-size:.12rem}.ab-link-list-content>a:hover,.ab-link-list-content>span:hover{text-decoration:underline;color:#f97601}.ab-link-list-content>.ab-link-list-hidden{display:none}.ab-link-list-wrap-popover.ab-popover-wrap{max-width:3.5rem;min-width:3rem}.ab-link-list-sub-title{display:block;padding-bottom:.06rem;font-size:.12rem}.ab-link-list-sub-link{text-decoration:underline;color:#333;font-size:.12rem;padding:0 .05rem .05rem 0;display:inline-block}@media only screen and (max-width:767px){.ab-link-list-divider{border-bottom:1px solid #d0d0d0}.ab-link-list-body{height:0;width:0;overflow:hidden}.ab-link-list-body.ab-link-list-active{height:auto;width:auto}.ab-link-list-content>a,.ab-link-list-content>span{min-width:calc(50% - .15rem)!important;max-width:calc(50% - .15rem)!important}.ab-link-list-icon{font-weight:700;font-size:.22rem;cursor:pointer;width:.2rem;height:.2rem;display:flex;align-items:center;justify-content:center}}
1
+ .ab-link-list-title{font-size:.16rem;margin:0 0;padding:0 0 .12rem 0;display:flex;justify-content:space-between;align-items:center}.ab-link-list-icon{display:none}.ab-link-list-content{flex-wrap:wrap;width:auto;margin-right:-.15rem}.ab-link-list-content.ab-link-list-col2>a,.ab-link-list-content.ab-link-list-col2>span{min-width:calc(100% / 2 - .15rem);max-width:calc(100% / 2 - .15rem)}.ab-link-list-content.ab-link-list-col4>a,.ab-link-list-content.ab-link-list-col4>span{min-width:calc(100% / 4 - .15rem);max-width:calc(100% / 4 - .15rem)}.ab-link-list-content.ab-link-list-col5>a,.ab-link-list-content.ab-link-list-col5>span{min-width:calc(100% / 5 - .15rem);max-width:calc(100% / 5 - .15rem)}.ab-link-list-content.ab-link-list-col6>a,.ab-link-list-content.ab-link-list-col6>span{min-width:calc(100% / 6 - .15rem);max-width:calc(100% / 6 - .15rem)}.ab-link-list-content.ab-link-list-col8>a,.ab-link-list-content.ab-link-list-col8>span{min-width:calc(100% / 8 - .15rem);max-width:calc(100% / 8 - .15rem)}.ab-link-list-content>a,.ab-link-list-content>span{cursor:pointer;border:.5px solid #d0d0d0;margin-bottom:8px;display:inline-block;justify-content:space-between;align-items:center;width:100%;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.085rem .15rem .085rem .12rem;color:#333;margin-right:.15rem}.ab-link-list-content>a:after,.ab-link-list-content>span:after{content:">";position:absolute;right:.1rem;top:50%;transform:translateY(-50%);color:grey;font-size:.12rem}.ab-link-list-content>a:hover,.ab-link-list-content>span:hover{text-decoration:underline;color:#f97601}.ab-link-list-content>.ab-link-list-hidden{display:none}.ab-link-list-wrap-popover.ab-popover-wrap{max-width:3.5rem;min-width:3rem}.ab-link-list-sub-title{display:block;padding-bottom:.06rem;font-size:.12rem}.ab-link-list-sub-link{text-decoration:underline;color:#333;font-size:.12rem;padding:0 .05rem .05rem 0;display:inline-block}@media only screen and (max-width:767px){.ab-link-list-divider{border-bottom:1px solid #d0d0d0}.ab-link-list-body{height:0;width:0;overflow:hidden}.ab-link-list-body.ab-link-list-active{height:auto;width:auto}.ab-link-list-content>a,.ab-link-list-content>span{min-width:calc(50% - .15rem)!important;max-width:calc(50% - .15rem)!important}.ab-link-list-icon{font-weight:700;font-size:.22rem;cursor:pointer;width:.2rem;height:.2rem;display:flex;align-items:center;justify-content:center}}
@@ -1,8 +1,13 @@
1
+ import React from 'react';
1
2
  export interface LoadingProps {
2
3
  /**
3
- * loading 样式的另一种
4
+ * loading 样式
4
5
  */
5
- isRectLoading?: boolean;
6
+ className?: string;
7
+ /**
8
+ * 自定义loading, 需要补全自定义元素样式
9
+ */
10
+ customIcon?: React.ReactElement;
6
11
  /**
7
12
  * loading开始后自动隐藏的时间,单位:毫秒
8
13
  */
@@ -18,25 +18,19 @@ import React from 'react';
18
18
  import classNames from 'classnames';
19
19
  import ReactDOM from 'react-dom';
20
20
  import { canUseDOM } from '@autobest-ui/utils';
21
- import UseConfig from '../use-config';
22
21
  import LoadingIcon from '../loading-icon'; // 缓存创建的loading元素
23
22
 
24
23
  var loadingElement = null;
25
24
  var loadingTimer = null;
26
25
  var closeTimer = null;
26
+ var prevCustomIcon = null;
27
27
  var cls = 'ab-loading';
28
28
 
29
- function getLoadingContainer(isRectLoading) {
30
- var _a;
31
-
32
- return React.createElement("div", {
33
- className: classNames(cls + "-wrap", (_a = {}, _a[cls + "-rect-loading"] = isRectLoading, _a))
34
- }, isRectLoading ? React.createElement("img", {
35
- className: cls + "-content",
36
- src: UseConfig.assetCommonUiUrl + "/images/p_loading_rect.gif",
37
- alt: "loading..."
38
- }) : React.createElement(LoadingIcon, {
39
- className: cls + "-content"
29
+ function getLoadingContainer(customIcon, className) {
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ className: classNames("".concat(cls, "-wrap"), className)
32
+ }, customIcon || /*#__PURE__*/React.createElement(LoadingIcon, {
33
+ className: "".concat(cls, "-content")
40
34
  }));
41
35
  } // openIds 容器
42
36
 
@@ -44,12 +38,11 @@ function getLoadingContainer(isRectLoading) {
44
38
  var openIds = []; // closeIds 容器
45
39
 
46
40
  var closeIds = [];
47
- var prevIsRectLoading = false;
48
41
 
49
- function createLoading(isRectLoading) {
42
+ function createLoading(customIcon, className) {
50
43
  loadingElement = document.createElement('div');
51
44
  document.body.appendChild(loadingElement);
52
- ReactDOM.render(getLoadingContainer(isRectLoading), loadingElement);
45
+ ReactDOM.render(getLoadingContainer(customIcon, className), loadingElement);
53
46
  }
54
47
 
55
48
  var Loading =
@@ -63,24 +56,25 @@ function () {
63
56
  }
64
57
 
65
58
  config = __assign({
66
- isRectLoading: false,
67
59
  expire: 0
68
- }, config); // 防止重复创建
60
+ }, config); // 防止重复创建或自定义loading icon,重新创建
69
61
 
70
62
  if (!loadingElement) {
71
- createLoading(config.isRectLoading);
72
- } else if (prevIsRectLoading !== config.isRectLoading) {
73
- // loading 类型不同时,重新创建
74
- try {
75
- document.body.removeChild(loadingElement);
76
- } catch (e) {}
77
-
78
- createLoading(config.isRectLoading);
63
+ createLoading(config.customIcon, config.className);
64
+ } else if (config.customIcon || config.customIcon !== prevCustomIcon) {
65
+ if (loadingElement) {
66
+ try {
67
+ document.body.removeChild(loadingElement);
68
+ loadingElement = null;
69
+ } catch (e) {}
70
+ }
71
+
72
+ createLoading(config.customIcon, config.className);
79
73
  } else {
80
74
  loadingElement.style.display = 'block';
81
75
  }
82
76
 
83
- prevIsRectLoading = config.isRectLoading; // 如果配置中有expire且大于0
77
+ prevCustomIcon = config.customIcon; // 如果配置中有expire且大于0
84
78
  // 将会在到达时间后自动关闭,不用手动再关闭(不需要再close())
85
79
 
86
80
  if (config.expire > 0) {
@@ -1 +1 @@
1
- .ab-loading-wrap{position:fixed;top:0;left:0;z-index:9999;background-color:rgba(255,255,255,.7);height:100%;width:100%}.ab-loading-wrap .ab-loading-content{position:absolute;left:50%;top:50%;display:block;width:.31rem;height:.31rem;transform:translate3d(-50%,-50%,0)}.ab-loading-wrap.ab-loading-rect-loading{background-color:rgba(0,0,0,.7)}.ab-loading-wrap.ab-loading-rect-loading .ab-loading-content{top:10%;width:1.6rem;height:.24rem}
1
+ .ab-loading-wrap{position:fixed;top:0;left:0;z-index:9999;background-color:rgba(255,255,255,.7);height:100%;width:100%}.ab-loading-wrap .ab-loading-content{position:absolute;left:50%;top:50%;display:block;width:.31rem;height:.31rem;transform:translate3d(-50%,-50%,0)}
@@ -18,14 +18,4 @@ $namespace: ab-loading;
18
18
  height: .31rem;
19
19
  transform: translate3d(-50%, -50%, 0);
20
20
  }
21
-
22
- &.#{$namespace}-rect-loading {
23
- background-color: rgba(#000, .7);
24
-
25
- .#{$namespace}-content {
26
- top: 10%;
27
- width: 1.6rem;
28
- height: .24rem;
29
- }
30
- }
31
21
  }
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export default function LoadingBar(): JSX.Element;
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import Portal from '../portal';
3
3
  var cls = 'ab-loading-bar';
4
4
  export default function LoadingBar() {
5
- return React.createElement(Portal, null, React.createElement("div", {
5
+ return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", {
6
6
  className: cls
7
- }, React.createElement("span", {
8
- className: cls + "-bar"
7
+ }, /*#__PURE__*/React.createElement("span", {
8
+ className: "".concat(cls, "-bar")
9
9
  })));
10
10
  }
@@ -10,12 +10,12 @@ function LoadingContainer(props) {
10
10
  loading = _b === void 0 ? false : _b,
11
11
  className = props.className,
12
12
  children = props.children;
13
- return React.createElement("div", {
14
- className: classNames(className, cls, (_a = {}, _a[cls + "-active"] = loading, _a))
15
- }, children, loading && React.createElement("div", {
16
- className: cls + "-icon-box"
17
- }, React.createElement(LoadingIcon, {
18
- className: cls + "-icon"
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ className: classNames(className, cls, (_a = {}, _a["".concat(cls, "-active")] = loading, _a))
15
+ }, children, loading && /*#__PURE__*/React.createElement("div", {
16
+ className: "".concat(cls, "-icon-box")
17
+ }, /*#__PURE__*/React.createElement(LoadingIcon, {
18
+ className: "".concat(cls, "-icon")
19
19
  })));
20
20
  }
21
21
 
@@ -4,50 +4,50 @@ var cls = 'ab-svg-loading';
4
4
 
5
5
  var LoadingIcon = function LoadingIcon(props) {
6
6
  var className = props.className;
7
- return React.createElement("span", {
7
+ return /*#__PURE__*/React.createElement("span", {
8
8
  className: classNames(className, cls)
9
- }, React.createElement("svg", {
9
+ }, /*#__PURE__*/React.createElement("svg", {
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  width: "24",
12
12
  height: "24",
13
13
  viewBox: "0 0 24 24",
14
- className: cls + "-icon"
15
- }, React.createElement("circle", {
14
+ className: "".concat(cls, "-icon")
15
+ }, /*#__PURE__*/React.createElement("circle", {
16
16
  cx: "12",
17
17
  cy: "2",
18
18
  r: "2",
19
19
  fill: "#202020"
20
- }), React.createElement("circle", {
20
+ }), /*#__PURE__*/React.createElement("circle", {
21
21
  cx: "19",
22
22
  cy: "5",
23
23
  r: "2",
24
24
  fill: "#404040"
25
- }), React.createElement("circle", {
25
+ }), /*#__PURE__*/React.createElement("circle", {
26
26
  cx: "22",
27
27
  cy: "12",
28
28
  r: "2",
29
29
  fill: "#606060"
30
- }), React.createElement("circle", {
30
+ }), /*#__PURE__*/React.createElement("circle", {
31
31
  cx: "19",
32
32
  cy: "19",
33
33
  r: "2",
34
34
  fill: "gray"
35
- }), React.createElement("circle", {
35
+ }), /*#__PURE__*/React.createElement("circle", {
36
36
  cx: "12",
37
37
  cy: "22",
38
38
  r: "2",
39
39
  fill: "#b0b0b0"
40
- }), React.createElement("circle", {
40
+ }), /*#__PURE__*/React.createElement("circle", {
41
41
  cx: "5",
42
42
  cy: "19",
43
43
  r: "2",
44
44
  fill: "#d0d0d0"
45
- }), React.createElement("circle", {
45
+ }), /*#__PURE__*/React.createElement("circle", {
46
46
  cx: "2",
47
47
  cy: "12",
48
48
  r: "2",
49
49
  fill: "#f0f0f0"
50
- }), React.createElement("circle", {
50
+ }), /*#__PURE__*/React.createElement("circle", {
51
51
  cx: "5",
52
52
  cy: "5",
53
53
  r: "2",
@@ -55,4 +55,4 @@ var LoadingIcon = function LoadingIcon(props) {
55
55
  })));
56
56
  };
57
57
 
58
- export default React.memo(LoadingIcon);
58
+ export default /*#__PURE__*/React.memo(LoadingIcon);
package/esm/mask/index.js CHANGED
@@ -19,12 +19,12 @@ function Mask(_a, ref) {
19
19
  onClose(event);
20
20
  }
21
21
  }, [onClose]);
22
- return React.createElement(CSSTransition, {
22
+ return /*#__PURE__*/React.createElement(CSSTransition, {
23
23
  "in": visible,
24
24
  timeout: timeout,
25
- classNames: prefixCls + "-fade",
25
+ classNames: "".concat(prefixCls, "-fade"),
26
26
  appear: true
27
- }, React.createElement("div", {
27
+ }, /*#__PURE__*/React.createElement("div", {
28
28
  className: classNames(prefixCls, className),
29
29
  onMouseDown: onChangeVisible,
30
30
  onTouchStart: onChangeVisible,
@@ -32,4 +32,4 @@ function Mask(_a, ref) {
32
32
  }));
33
33
  }
34
34
 
35
- export default React.memo(React.forwardRef(Mask));
35
+ export default /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Mask));
@@ -41,7 +41,7 @@ export default function Message(config) {
41
41
 
42
42
  if (!container) {
43
43
  container = document.createElement('div');
44
- container.setAttribute('class', classNames(currentConfig.className, prefixCls + "-container"));
44
+ container.setAttribute('class', classNames(currentConfig.className, "".concat(prefixCls, "-container")));
45
45
  document.body.appendChild(container);
46
46
  }
47
47
 
@@ -49,9 +49,9 @@ export default function Message(config) {
49
49
  close(items[0].id);
50
50
  }
51
51
 
52
- function close(id) {
52
+ function close(currentId) {
53
53
  var index = items.findIndex(function (item) {
54
- return item.id === id;
54
+ return item.id === currentId;
55
55
  });
56
56
 
57
57
  if (index >= 0) {
@@ -63,14 +63,14 @@ export default function Message(config) {
63
63
  render();
64
64
  }
65
65
 
66
- function _onExited(id) {
67
- currentConfig.onDestroy(id);
66
+ function _onExited(currentId) {
67
+ currentConfig.onDestroy(currentId);
68
68
  } // 渲染组件
69
69
 
70
70
 
71
71
  function render() {
72
72
  var cls = prefixCls;
73
- ReactDOM.render(React.createElement(TransitionGroup, {
73
+ ReactDOM.render( /*#__PURE__*/React.createElement(TransitionGroup, {
74
74
  component: null
75
75
  }, items.map(function (item) {
76
76
  var _a = item.currentConfig,
@@ -82,19 +82,19 @@ export default function Message(config) {
82
82
  width: width,
83
83
  height: height
84
84
  };
85
- return React.createElement(CSSTransition, {
85
+ return /*#__PURE__*/React.createElement(CSSTransition, {
86
86
  key: item.id,
87
87
  timeout: 300,
88
- classNames: cls + "-fade",
88
+ classNames: "".concat(cls, "-fade"),
89
89
  onExited: function onExited() {
90
90
  _onExited(item.id);
91
91
  },
92
92
  appear: true
93
- }, React.createElement("div", {
94
- className: classNames(cls + "-content", contentClassName),
93
+ }, /*#__PURE__*/React.createElement("div", {
94
+ className: classNames("".concat(cls, "-content"), contentClassName),
95
95
  style: style
96
- }, content, React.createElement("div", {
97
- className: cls + "-close",
96
+ }, content, /*#__PURE__*/React.createElement("div", {
97
+ className: "".concat(cls, "-close"),
98
98
  onClick: function onClick() {
99
99
  close(item.id);
100
100
  }
@@ -115,8 +115,8 @@ export default function Message(config) {
115
115
  }, currentConfig.expires);
116
116
 
117
117
  function destroy() {
118
- items.forEach(function (item) {
119
- clearTimeout(item.timer);
118
+ items.forEach(function (child) {
119
+ clearTimeout(child.timer);
120
120
  });
121
121
  items = [];
122
122
  render();
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PortalProps } from '../portal';
2
3
  export declare type AffixProps = Required<Omit<PortalProps, 'didUpdate'>>;
3
4
  export default function Affix(props: AffixProps): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import Portal from '../portal';
3
3
  export default function Affix(props) {
4
- return React.createElement(Portal, {
4
+ return /*#__PURE__*/React.createElement(Portal, {
5
5
  getContainer: props.getContainer
6
6
  }, props.children);
7
7
  }