acud 1.0.13 → 1.0.16

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 (48) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/dist/acud.css +19 -12
  3. package/dist/acud.css.map +1 -1
  4. package/dist/acud.js +71 -26
  5. package/dist/acud.js.map +1 -1
  6. package/dist/acud.min.css +1 -1
  7. package/dist/acud.min.css.map +1 -1
  8. package/dist/acud.min.js +3 -3
  9. package/dist/acud.min.js.map +1 -1
  10. package/es/input/Input.js +1 -1
  11. package/es/input/MultiSelectInput.js +2 -1
  12. package/es/input/TextArea.d.ts +1 -0
  13. package/es/input/TextArea.js +9 -3
  14. package/es/input/style/index.css +10 -1
  15. package/es/input/style/index.less +10 -1
  16. package/es/modal/style/index.css +2 -2
  17. package/es/select/style/index.css +1 -0
  18. package/es/select/style/multiple.less +1 -0
  19. package/es/style/themes/dark/components/modal.less +2 -2
  20. package/es/style/themes/default/components/modal.less +2 -2
  21. package/es/table/Space.js +13 -2
  22. package/es/table/style/base.less +1 -1
  23. package/es/table/style/index.css +5 -8
  24. package/es/table/style/index.less +5 -5
  25. package/es/tabs/src/TabNavList/TabNode.js +1 -1
  26. package/es/tabs/src/TabPanelList/index.js +1 -1
  27. package/es/toast/base.js +8 -1
  28. package/es/toast/index.js +32 -13
  29. package/lib/input/Input.js +1 -1
  30. package/lib/input/MultiSelectInput.js +2 -1
  31. package/lib/input/TextArea.d.ts +1 -0
  32. package/lib/input/TextArea.js +9 -3
  33. package/lib/input/style/index.css +10 -1
  34. package/lib/input/style/index.less +10 -1
  35. package/lib/modal/style/index.css +2 -2
  36. package/lib/select/style/index.css +1 -0
  37. package/lib/select/style/multiple.less +1 -0
  38. package/lib/style/themes/dark/components/modal.less +2 -2
  39. package/lib/style/themes/default/components/modal.less +2 -2
  40. package/lib/table/Space.js +14 -2
  41. package/lib/table/style/base.less +1 -1
  42. package/lib/table/style/index.css +5 -8
  43. package/lib/table/style/index.less +5 -5
  44. package/lib/tabs/src/TabNavList/TabNode.js +1 -1
  45. package/lib/tabs/src/TabPanelList/index.js +1 -1
  46. package/lib/toast/base.js +8 -1
  47. package/lib/toast/index.js +33 -14
  48. package/package.json +1 -1
@@ -32,7 +32,7 @@
32
32
  @modal-heading-height: 22px;
33
33
  @modal-heading-bg-color: @G10;
34
34
  @modal-heading-padding: 6*@P 6*@P 0;
35
- @modal-heading-font-size: @T3;
35
+ @modal-heading-font-size: @T4;
36
36
  @modal-heading-font-weight: 500;
37
37
  @modal-heading-color: @G2;
38
38
 
@@ -51,5 +51,5 @@
51
51
 
52
52
  // Footer
53
53
  @modal-footer-padding: 0 6*@P 6*@P;
54
- @modal-footer-btn-space: 4*@P;
54
+ @modal-footer-btn-space: 3*@P;
55
55
  @modal-footer-bg-color: @G11;
@@ -11,6 +11,8 @@ exports["default"] = void 0;
11
11
 
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
 
14
+ var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
15
+
14
16
  var _useFlexGapSupport = _interopRequireDefault(require("../_util/hooks/useFlexGapSupport"));
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -25,9 +27,19 @@ var Space = function Space(props) {
25
27
  children = props.children;
26
28
  var supportFlexGap = (0, _useFlexGapSupport["default"])();
27
29
  var spaceStyle = {};
30
+ var childrenMap = children;
28
31
 
29
32
  if (!supportFlexGap) {
30
- spaceStyle.marginRight = space;
33
+ var childNodes = (0, _toArray["default"])(children, {
34
+ keepEmpty: true
35
+ });
36
+ childrenMap = childNodes.map(function (child, index) {
37
+ return /*#__PURE__*/React.createElement("span", {
38
+ style: {
39
+ marginRight: index === childNodes.length - 1 ? 0 : space
40
+ }
41
+ }, child);
42
+ });
31
43
  }
32
44
 
33
45
  if (supportFlexGap) {
@@ -37,7 +49,7 @@ var Space = function Space(props) {
37
49
  return /*#__PURE__*/React.createElement("div", {
38
50
  className: prefixCls,
39
51
  style: spaceStyle
40
- }, children);
52
+ }, childrenMap);
41
53
  };
42
54
 
43
55
  var _default = Space;
@@ -24,7 +24,7 @@
24
24
  // display: flex;
25
25
  // justify-content: left;
26
26
  .@{table-prefix-cls}-row-expand-icon {
27
- margin: auto 12px auto 0;
27
+ margin: 2px 12px 2px 0;
28
28
  }
29
29
  }
30
30
  &.@{table-prefix-cls}-row-expand-icon-cell {
@@ -280,9 +280,6 @@ div.acud-table-summary {
280
280
  cursor: pointer;
281
281
  transition: all 0.3s;
282
282
  }
283
- .acud-table-thead th.acud-table-column-has-sorters:hover {
284
- background: rgba(0, 0, 0, 0.04);
285
- }
286
283
  .acud-table-thead th.acud-table-column-has-sorters:hover::before {
287
284
  background-color: transparent !important;
288
285
  }
@@ -473,12 +470,12 @@ table tr th.acud-table-selection-column::after {
473
470
  display: flex;
474
471
  }
475
472
  .acud-table-selection-extra .acudicon {
476
- color: #bfbfbf;
477
- font-size: 10px;
473
+ color: #84868C;
474
+ font-size: 16px;
478
475
  display: flex;
479
476
  }
480
477
  .acud-table-selection-extra .acudicon:hover {
481
- color: #a6a6a6;
478
+ color: #84868C;
482
479
  }
483
480
  .acud-table-expand-icon-col {
484
481
  width: 28px;
@@ -494,7 +491,7 @@ table tr th.acud-table-selection-column::after {
494
491
  color: #84868C;
495
492
  cursor: pointer;
496
493
  font-size: 16px;
497
- line-height: 16px;
494
+ line-height: 0;
498
495
  float: left;
499
496
  margin: auto;
500
497
  }
@@ -785,7 +782,7 @@ tr.acud-table-expanded-row .acud-descriptions-view table {
785
782
  cursor: not-allowed;
786
783
  }
787
784
  .acud-table-cell-with-append .acud-table-row-expand-icon {
788
- margin: auto 12px auto 0;
785
+ margin: 2px 12px 2px 0;
789
786
  }
790
787
  .acud-table-cell.acud-table-row-expand-icon-cell {
791
788
  width: 16px;
@@ -303,7 +303,7 @@
303
303
  transition: all 0.3s;
304
304
 
305
305
  &:hover {
306
- background: @table-header-sort-active-bg;
306
+ // background: @table-header-sort-active-bg;
307
307
 
308
308
  &::before {
309
309
  background-color: transparent !important;
@@ -565,12 +565,12 @@
565
565
  }
566
566
 
567
567
  .@{iconfont-css-prefix} {
568
- color: @table-header-icon-color;
569
- font-size: 10px;
568
+ color: @G5;
569
+ font-size: @P * 4;
570
570
  display: flex;
571
571
 
572
572
  &:hover {
573
- color: @table-header-icon-color-hover;
573
+ color: @G5;
574
574
  }
575
575
  }
576
576
  }
@@ -594,7 +594,7 @@
594
594
  .basic-tp-config(@table-row-expand-icon-tp);
595
595
  cursor: pointer;
596
596
  font-size: @P * 4;
597
- line-height: @P * 4;;
597
+ line-height: 0;
598
598
  float: left;
599
599
  margin: auto;
600
600
 
@@ -100,7 +100,7 @@ function TabNode(_ref, ref) {
100
100
  }
101
101
 
102
102
  function onDoubleClick() {
103
- if ((0, _typeof2["default"])(tab) !== 'object') {
103
+ if (editable && (0, _typeof2["default"])(tab) !== 'object') {
104
104
  setEditNav(true);
105
105
  }
106
106
  }
@@ -49,7 +49,7 @@ function TabPanelList(_ref) {
49
49
  tabKey: tab.key,
50
50
  id: id,
51
51
  animated: tabPaneAnimated,
52
- active: tab.key === activeKey && tabs.length > 1,
52
+ active: tab.key === activeKey && tabs.length > 0,
53
53
  destroyInactiveTabPane: destroyInactiveTabPane
54
54
  });
55
55
  })));
package/lib/toast/base.js CHANGED
@@ -279,11 +279,18 @@ function getRCNoticeProps(args, prefixCls) {
279
279
  }
280
280
 
281
281
  function notice(args) {
282
+ var key = args.key;
282
283
  getNotificationInstance(args, function (_ref) {
283
284
  var prefixCls = _ref.prefixCls,
284
285
  instance = _ref.instance;
285
286
  instance.notice(getRCNoticeProps(args, prefixCls));
286
- });
287
+ }); // 增加返回的清除函数
288
+
289
+ var result = function result() {
290
+ api.close(key);
291
+ };
292
+
293
+ return result;
287
294
  }
288
295
 
289
296
  var api = {
@@ -35,7 +35,7 @@ var _globalConfig = (0, _configProvider.globalConfig)(),
35
35
  getPrefixCls = _globalConfig.getPrefixCls;
36
36
 
37
37
  var PREFIX = 'notification-hastime';
38
- var MAXTOASTARRLENGTN = 4; // 最多显示多少个toast
38
+ var maxToastArrLength = 4; // 最多显示多少个toast
39
39
 
40
40
  /**
41
41
  * 代理对象
@@ -43,7 +43,8 @@ var MAXTOASTARRLENGTN = 4; // 最多显示多少个toast
43
43
  */
44
44
 
45
45
  var target = {};
46
- var toastArr = []; // 向数组尾部添加一个元素
46
+ var toastArr = []; // const paramIgnoreFun = ['close', 'destroy'];
47
+ // 向数组尾部添加一个元素
47
48
 
48
49
  function addToastKey(key) {
49
50
  toastArr.push(key);
@@ -85,6 +86,7 @@ function ToastDom(props) {
85
86
  (0, _react.useEffect)(function () {
86
87
  if (counter !== undefined) {
87
88
  if (counter > 0) {
89
+ // clearTimeout(timerID);
88
90
  var timer = setTimeout(function () {
89
91
  setCounter(counter - 1);
90
92
  }, 1000);
@@ -104,7 +106,12 @@ function ToastDom(props) {
104
106
  // if (timerID) {
105
107
  setTimerID(null); // }
106
108
  };
107
- }, [counter]);
109
+ }, [counter]); // useEffect(() => {
110
+ // return () => {
111
+ // clearTimeout(timerID);
112
+ // }
113
+ // }, []);
114
+
108
115
  return /*#__PURE__*/_react["default"].createElement("div", {
109
116
  className: prefixCls
110
117
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -123,16 +130,12 @@ function DescriptionDom(props) {
123
130
 
124
131
  var handler = {
125
132
  get: function get() {
126
- var name = arguments.length <= 1 ? undefined : arguments[1];
127
- var key = new Date().getTime() + ''; // 通过key来强制关闭notification
128
-
129
- if (toastArr.length < MAXTOASTARRLENGTN) {
130
- addToastKey(key);
131
- } else {
132
- _base["default"].close(unshiftToast());
133
+ var name = arguments.length <= 1 ? undefined : arguments[1]; // 关闭、删除提示可以根据用户传参直接调用,避免key错赋值
134
+ // if (paramIgnoreFun.includes(name)) {
135
+ // return props => Reflect.get(NotificationApi, name)(props);
136
+ // }
133
137
 
134
- addToastKey(key);
135
- }
138
+ var key = new Date().getTime() + ''; // 通过key来强制关闭notification
136
139
 
137
140
  return function (props) {
138
141
  // 定义默认图标
@@ -142,7 +145,22 @@ var handler = {
142
145
  var args = (0, _extends2["default"])((0, _extends2["default"])({
143
146
  key: key,
144
147
  type: 'info'
145
- }, iconProps), props); // 初始化倒计时
148
+ }, iconProps), props); // 设置最大显示数
149
+
150
+ if (name === 'config' && props.maxCount) {
151
+ maxToastArrLength = props.maxCount;
152
+ } // key相同时不重新渲染
153
+
154
+
155
+ if (!~toastArr.indexOf(args.key)) {
156
+ if (toastArr.length < maxToastArrLength) {
157
+ addToastKey(args.key);
158
+ } else {
159
+ _base["default"].close(unshiftToast());
160
+
161
+ addToastKey(args.key);
162
+ }
163
+ } // 初始化倒计时
146
164
  // let tempDuration;
147
165
  // if (!args.duration) {
148
166
  // tempDuration = 0;
@@ -151,6 +169,7 @@ var handler = {
151
169
  // tempDuration = args.duration;
152
170
  // }
153
171
 
172
+
154
173
  var tempDuration = args.duration;
155
174
  args.duration = 0; // 设置样式 有描述和没描述间距不一样
156
175
 
@@ -171,7 +190,7 @@ var handler = {
171
190
  message: args.message,
172
191
  description: args.description,
173
192
  countdown: tempDuration,
174
- notificationKey: key,
193
+ notificationKey: args.key,
175
194
  onClose: props === null || props === void 0 ? void 0 : props.onClose
176
195
  });
177
196
  args.description = /*#__PURE__*/_react["default"].createElement(DescriptionDom, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acud",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "description": "acg react 组件库",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",