acud 0.0.67 → 0.0.70

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 (137) hide show
  1. package/dist/acud.css +250 -144
  2. package/dist/acud.css.map +1 -1
  3. package/dist/acud.js +1367 -1159
  4. package/dist/acud.js.map +1 -1
  5. package/dist/acud.min.css +1 -1
  6. package/dist/acud.min.css.map +1 -1
  7. package/dist/acud.min.js +8 -6
  8. package/dist/acud.min.js.map +1 -1
  9. package/es/button/button.d.ts +1 -0
  10. package/es/button/button.js +1 -0
  11. package/es/cascader/Cascader.js +2 -1
  12. package/es/cascader/MenuItem.js +7 -13
  13. package/es/cascader/Menus.d.ts +3 -2
  14. package/es/cascader/Menus.js +30 -24
  15. package/es/cascader/index.js +32 -11
  16. package/es/cascader/style/index.css +17 -68
  17. package/es/cascader/style/index.less +23 -31
  18. package/es/clear/index.d.ts +12 -0
  19. package/es/clear/index.js +41 -0
  20. package/es/clear/style/css.js +2 -0
  21. package/es/clear/style/index.css +63 -0
  22. package/es/clear/style/index.d.ts +2 -0
  23. package/es/clear/style/index.js +2 -0
  24. package/es/clear/style/index.less +18 -0
  25. package/es/date-picker/generatePicker/generateRangePicker.js +2 -2
  26. package/es/date-picker/generatePicker/generateSinglePicker.js +9 -7
  27. package/es/date-picker/src/PickerPanel.js +4 -1
  28. package/es/date-picker/src/utils/uiUtil.js +4 -4
  29. package/es/date-picker/style/index.css +106 -53
  30. package/es/date-picker/style/panel.less +83 -18
  31. package/es/dropdown/dropdown.js +2 -3
  32. package/es/dropdown/rc-dropdown/Dropdown.js +1 -0
  33. package/es/form/style/horizontal.less +3 -1
  34. package/es/form/style/index.css +2 -0
  35. package/es/index.d.ts +1 -0
  36. package/es/index.js +1 -0
  37. package/es/input-number/src/hooks/useLayoutEffect.d.ts +1 -1
  38. package/es/locale/en_US.js +2 -0
  39. package/es/locale/zh_CN.js +2 -0
  40. package/es/menu/menu.d.ts +2 -1
  41. package/es/modal/DialogBox.d.ts +1 -1
  42. package/es/progress/CircleProgress.js +2 -2
  43. package/es/progress/LineProgress.js +4 -2
  44. package/es/radio/Radio.d.ts +1 -0
  45. package/es/radio/Radio.js +3 -2
  46. package/es/radio/RadioButton.js +3 -2
  47. package/es/radio/RadioGroup.d.ts +1 -0
  48. package/es/radio/RadioGroup.js +4 -1
  49. package/es/radio/context.d.ts +1 -0
  50. package/es/style/themes/default/components/cascader.less +0 -4
  51. package/es/style/themes/default/components/clear.less +2 -0
  52. package/es/style/themes/default/components/datePicker.less +1 -0
  53. package/es/style/themes/default/components/index.less +1 -0
  54. package/es/switch/index.d.ts +2 -3
  55. package/es/switch/index.js +11 -3
  56. package/es/switch/interface.d.ts +4 -0
  57. package/es/switch/style/index.css +31 -0
  58. package/es/switch/style/index.less +33 -1
  59. package/es/toast/index.js +5 -6
  60. package/es/toast/style/index.css +1 -1
  61. package/es/toast/style/index.less +3 -3
  62. package/es/tooltip/index.js +1 -1
  63. package/es/transfer/SourceList.js +1 -0
  64. package/es/transfer/index.js +5 -5
  65. package/es/transfer/style/index.css +3 -0
  66. package/es/transfer/style/index.less +3 -0
  67. package/es/upload/Upload.js +4 -1
  68. package/es/upload/UploadList/ListItem.js +2 -2
  69. package/es/upload/UploadList/index.js +1 -1
  70. package/es/upload/style/index.css +25 -21
  71. package/es/upload/style/index.less +28 -21
  72. package/lib/button/button.d.ts +1 -0
  73. package/lib/button/button.js +1 -0
  74. package/lib/cascader/Cascader.js +2 -1
  75. package/lib/cascader/MenuItem.js +7 -13
  76. package/lib/cascader/Menus.d.ts +3 -2
  77. package/lib/cascader/Menus.js +31 -24
  78. package/lib/cascader/index.js +34 -12
  79. package/lib/cascader/style/index.css +17 -68
  80. package/lib/cascader/style/index.less +23 -31
  81. package/lib/clear/index.d.ts +12 -0
  82. package/lib/clear/index.js +55 -0
  83. package/lib/clear/style/css.js +5 -0
  84. package/lib/clear/style/index.css +63 -0
  85. package/lib/clear/style/index.d.ts +2 -0
  86. package/lib/clear/style/index.js +5 -0
  87. package/lib/clear/style/index.less +18 -0
  88. package/lib/date-picker/generatePicker/generateRangePicker.js +3 -3
  89. package/lib/date-picker/generatePicker/generateSinglePicker.js +10 -8
  90. package/lib/date-picker/src/PickerPanel.js +4 -1
  91. package/lib/date-picker/src/utils/uiUtil.js +4 -4
  92. package/lib/date-picker/style/index.css +106 -53
  93. package/lib/date-picker/style/panel.less +83 -18
  94. package/lib/dropdown/dropdown.js +2 -3
  95. package/lib/dropdown/rc-dropdown/Dropdown.js +1 -0
  96. package/lib/form/style/horizontal.less +3 -1
  97. package/lib/form/style/index.css +2 -0
  98. package/lib/index.d.ts +1 -0
  99. package/lib/index.js +8 -0
  100. package/lib/input-number/src/hooks/useLayoutEffect.d.ts +1 -1
  101. package/lib/locale/en_US.js +5 -0
  102. package/lib/locale/zh_CN.js +5 -0
  103. package/lib/menu/menu.d.ts +2 -1
  104. package/lib/modal/DialogBox.d.ts +1 -1
  105. package/lib/progress/CircleProgress.js +2 -2
  106. package/lib/progress/LineProgress.js +4 -2
  107. package/lib/radio/Radio.d.ts +1 -0
  108. package/lib/radio/Radio.js +3 -2
  109. package/lib/radio/RadioButton.js +3 -2
  110. package/lib/radio/RadioGroup.d.ts +1 -0
  111. package/lib/radio/RadioGroup.js +5 -1
  112. package/lib/radio/context.d.ts +1 -0
  113. package/lib/style/components.less +1 -0
  114. package/lib/style/themes/default/components/cascader.less +0 -4
  115. package/lib/style/themes/default/components/clear.less +2 -0
  116. package/lib/style/themes/default/components/datePicker.less +1 -0
  117. package/lib/style/themes/default/components/index.less +1 -0
  118. package/lib/switch/index.d.ts +2 -3
  119. package/lib/switch/index.js +12 -3
  120. package/lib/switch/interface.d.ts +4 -0
  121. package/lib/switch/style/index.css +31 -0
  122. package/lib/switch/style/index.less +33 -1
  123. package/lib/toast/index.js +5 -6
  124. package/lib/toast/style/index.css +1 -1
  125. package/lib/toast/style/index.less +3 -3
  126. package/lib/tooltip/index.js +1 -1
  127. package/lib/transfer/SourceList.js +1 -0
  128. package/lib/transfer/index.js +5 -5
  129. package/lib/transfer/style/index.css +3 -0
  130. package/lib/transfer/style/index.less +3 -0
  131. package/lib/upload/Upload.js +4 -1
  132. package/lib/upload/UploadList/ListItem.js +2 -2
  133. package/lib/upload/UploadList/index.js +1 -1
  134. package/lib/upload/style/index.css +25 -21
  135. package/lib/upload/style/index.less +28 -21
  136. package/package.json +2 -2
  137. package/CHANGELOG.md +0 -4
@@ -25,6 +25,8 @@ var _some = _interopRequireDefault(require("lodash/some"));
25
25
 
26
26
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
27
27
 
28
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
29
+
28
30
  var _map = _interopRequireDefault(require("lodash/map"));
29
31
 
30
32
  var _every = _interopRequireDefault(require("lodash/every"));
@@ -87,18 +89,20 @@ var Menus = /*#__PURE__*/function (_React$Component) {
87
89
  };
88
90
  };
89
91
 
90
- _this.onShowPrepare = function () {
92
+ _this.onShowActive = function () {
91
93
  _this.scrollActiveItemToView();
92
94
 
93
- return new Promise(function (resolve) {
94
- _this.delayOnEvent(function () {
95
- _this.setMenuPosition();
95
+ window.setTimeout(function () {
96
+ _this.setMenuPosition();
96
97
 
97
- _this.openMenuScroll();
98
+ window.setTimeout(function () {
99
+ _this.handleMenuScrollChange(true);
100
+ }, 0);
101
+ }, 0);
102
+ };
98
103
 
99
- _this.delayOnEvent(resolve);
100
- });
101
- });
104
+ _this.onShowEnd = function () {
105
+ _this.handleMenuScrollChange(false);
102
106
  };
103
107
 
104
108
  _this.state = {
@@ -163,7 +167,7 @@ var Menus = /*#__PURE__*/function (_React$Component) {
163
167
  var onItemDoubleClick = this.props.onItemDoubleClick.bind(this, option, menuIndex);
164
168
 
165
169
  var handleClick = function handleClick(e) {
166
- isMulti && !(hasChildren || option.isLeaf === false) ? undefined : onSelect(e);
170
+ isMulti && !hasLeaf ? undefined : onSelect(e);
167
171
  };
168
172
 
169
173
  var handleMultiClick = function handleMultiClick(e) {
@@ -323,9 +327,9 @@ var Menus = /*#__PURE__*/function (_React$Component) {
323
327
  checked: checked,
324
328
  indeterminate: indeterminate,
325
329
  onChange: onMultiSelectAll
326
- }, /*#__PURE__*/_react["default"].createElement("span", {
330
+ }), /*#__PURE__*/_react["default"].createElement("span", {
327
331
  className: "".concat(prefixCls, "-menu-item-label")
328
- }, "\u5168\u9009"))));
332
+ }, "\u5168\u9009")));
329
333
  }
330
334
  }, {
331
335
  key: "getActiveOptions",
@@ -349,7 +353,7 @@ var Menus = /*#__PURE__*/function (_React$Component) {
349
353
  var result = this.getActiveOptions().map(function (activeOption) {
350
354
  return activeOption[_this4.getFieldName('children')];
351
355
  }).filter(function (activeOption) {
352
- return !!activeOption;
356
+ return !(0, _isEmpty["default"])(activeOption);
353
357
  });
354
358
  result.unshift(options);
355
359
  return result;
@@ -375,13 +379,6 @@ var Menus = /*#__PURE__*/function (_React$Component) {
375
379
  }, 150);
376
380
  }
377
381
  }
378
- }, {
379
- key: "openMenuScroll",
380
- value: function openMenuScroll() {
381
- this.setState({
382
- menuScrollOpen: true
383
- });
384
- }
385
382
  }, {
386
383
  key: "scrollActiveItemToView",
387
384
  value: function scrollActiveItemToView() {
@@ -389,10 +386,12 @@ var Menus = /*#__PURE__*/function (_React$Component) {
389
386
  var optionsLength = this.getShowOptions().length; // eslint-disable-next-line no-plusplus
390
387
 
391
388
  for (var i = 0; i < optionsLength; i++) {
392
- var itemComponent = this.menuItems[i];
389
+ var menuItem = this.menuItems[i];
390
+ var menuItemParent = menuItem && menuItem.parentElement;
393
391
 
394
- if (itemComponent && itemComponent.parentElement) {
395
- itemComponent.parentElement.scrollTop = itemComponent.offsetTop;
392
+ if (menuItemParent) {
393
+ var paddingTop = Number((0, _utils.getElementStyle)(menuItemParent).paddingTop.replace('px', ''));
394
+ menuItemParent.scrollTop = menuItem.offsetTop - paddingTop;
396
395
  }
397
396
  }
398
397
  }
@@ -453,6 +452,13 @@ var Menus = /*#__PURE__*/function (_React$Component) {
453
452
  callback();
454
453
  }
455
454
  }
455
+ }, {
456
+ key: "handleMenuScrollChange",
457
+ value: function handleMenuScrollChange(menuScrollOpen) {
458
+ this.setState({
459
+ menuScrollOpen: menuScrollOpen
460
+ });
461
+ }
456
462
  }, {
457
463
  key: "render",
458
464
  value: function render() {
@@ -474,8 +480,9 @@ var Menus = /*#__PURE__*/function (_React$Component) {
474
480
  motionName: transitionName,
475
481
  removeOnLeave: false,
476
482
  leavedClassName: "".concat(prefixCls, "-menu-wrap-hidden"),
477
- onAppearPrepare: this.onShowPrepare,
478
- onEnterPrepare: this.onShowPrepare
483
+ onAppearActive: this.onShowActive,
484
+ onEnterActive: this.onShowActive,
485
+ onLeaveEnd: this.onShowEnd
479
486
  }, function (_ref2) {
480
487
  var _classnames2;
481
488
 
@@ -21,6 +21,8 @@ var _get = _interopRequireDefault(require("lodash/get"));
21
21
 
22
22
  var _first = _interopRequireDefault(require("lodash/first"));
23
23
 
24
+ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
25
+
24
26
  var _react = _interopRequireWildcard(require("react"));
25
27
 
26
28
  var _classnames6 = _interopRequireDefault(require("classnames"));
@@ -35,9 +37,7 @@ var _OutlinedLeft = _interopRequireDefault(require("acud-icon/lib/icons/Outlined
35
37
 
36
38
  var _OutlinedRight = _interopRequireDefault(require("acud-icon/lib/icons/OutlinedRight"));
37
39
 
38
- var _OutlinedRefresh = _interopRequireDefault(require("acud-icon/lib/icons/OutlinedRefresh"));
39
-
40
- var _OutlinedClose = _interopRequireDefault(require("acud-icon/lib/icons/OutlinedClose"));
40
+ var _OutlinedLoading = _interopRequireDefault(require("acud-icon/lib/icons/OutlinedLoading"));
41
41
 
42
42
  var _OutlinedDown = _interopRequireDefault(require("acud-icon/lib/icons/OutlinedDown"));
43
43
 
@@ -47,6 +47,8 @@ var _tag = _interopRequireDefault(require("../tag"));
47
47
 
48
48
  var _tooltip = _interopRequireDefault(require("../tooltip"));
49
49
 
50
+ var _clear = _interopRequireDefault(require("../clear"));
51
+
50
52
  var _Cascader = _interopRequireDefault(require("./Cascader"));
51
53
 
52
54
  var _renderEmpty = _interopRequireDefault(require("./renderEmpty"));
@@ -174,6 +176,7 @@ var Cascader = function Cascader(props, ref) {
174
176
  var cachedRef = (0, _react.useRef)({});
175
177
  var measureRef = (0, _react.useRef)();
176
178
  var pickerRef = (0, _react.useRef)();
179
+ var pickerLabelRef = (0, _react.useRef)();
177
180
  var tagsRef = (0, _react.useRef)();
178
181
 
179
182
  var _useState = (0, _react.useState)(props.value || props.defaultValue || []),
@@ -201,6 +204,11 @@ var Cascader = function Cascader(props, ref) {
201
204
  popupVisible = _useState10[0],
202
205
  setPopupVisible = _useState10[1];
203
206
 
207
+ var _useState11 = (0, _react.useState)(false),
208
+ _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
209
+ pickerLabelOverflow = _useState12[0],
210
+ setPickerLabelOverflow = _useState12[1];
211
+
204
212
  var isMulti = mode === 'multiple';
205
213
  var flattenOptions = (0, _react.useMemo)(function () {
206
214
  var showSearch = props.showSearch,
@@ -309,9 +317,12 @@ var Cascader = function Cascader(props, ref) {
309
317
  (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, selectedOptions);
310
318
  }, [props]);
311
319
  var handleMouseDown = (0, _react.useCallback)(function (e) {
312
- if (e.target !== inputRef.current) {
313
- e.preventDefault();
314
- }
320
+ e.preventDefault();
321
+ }, []);
322
+ var handlePickerLabelHover = (0, _react.useCallback)(function () {
323
+ var ele = pickerLabelRef.current;
324
+ var overflow = (ele === null || ele === void 0 ? void 0 : ele.scrollWidth) > (ele === null || ele === void 0 ? void 0 : ele.clientWidth);
325
+ setPickerLabelOverflow(overflow);
315
326
  }, []);
316
327
  var handleClick = (0, _react.useCallback)(function (e) {
317
328
  if (e.target !== inputRef.current) {
@@ -526,11 +537,11 @@ var Cascader = function Cascader(props, ref) {
526
537
 
527
538
  var loadingIcon = /*#__PURE__*/_react["default"].createElement("span", {
528
539
  className: "".concat(prefixCls, "-menu-item-loading-icon")
529
- }, /*#__PURE__*/_react["default"].createElement(_OutlinedRefresh["default"], {
540
+ }, /*#__PURE__*/_react["default"].createElement(_OutlinedLoading["default"], {
530
541
  animation: "spin"
531
542
  }));
532
543
 
533
- var clearIcon = allowClear && !disabled && value.length > 0 || inputValue ? /*#__PURE__*/_react["default"].createElement(_OutlinedClose["default"], {
544
+ var clearIcon = allowClear && !disabled && value.length > 0 || inputValue ? /*#__PURE__*/_react["default"].createElement(_clear["default"], {
534
545
  className: "".concat(prefixCls, "-picker-clear"),
535
546
  onClick: handleSelectionClear
536
547
  }) : null;
@@ -573,7 +584,8 @@ var Cascader = function Cascader(props, ref) {
573
584
  className: "".concat(prefixCls, "-tag-wrap"),
574
585
  key: labelIndex
575
586
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
576
- title: labelItem
587
+ title: labelItem,
588
+ overlayClassName: "".concat(prefixCls, "-tag-tooltip")
577
589
  }, /*#__PURE__*/_react["default"].createElement(_tag["default"], {
578
590
  className: "".concat(prefixCls, "-tag"),
579
591
  disabled: disabled,
@@ -659,10 +671,15 @@ var Cascader = function Cascader(props, ref) {
659
671
  style: style,
660
672
  className: pickerCls,
661
673
  disabled: disabled
674
+ }, label && /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
675
+ title: pickerLabelOverflow ? label : undefined,
676
+ overlayClassName: "".concat(prefixCls, "-picker-label-tooltip")
662
677
  }, /*#__PURE__*/_react["default"].createElement("span", {
678
+ ref: pickerLabelRef,
663
679
  className: "".concat(prefixCls, "-picker-label"),
664
- disabled: disabled
665
- }, label), /*#__PURE__*/_react["default"].createElement(_input["default"], (0, _extends2["default"])({}, inputProps, {
680
+ disabled: disabled,
681
+ onMouseOver: handlePickerLabelHover
682
+ }, label)), /*#__PURE__*/_react["default"].createElement(_input["default"], (0, _extends2["default"])({}, inputProps, {
666
683
  tabIndex: -1,
667
684
  ref: inputRef,
668
685
  prefixCls: inputPrefixCls,
@@ -704,7 +721,7 @@ var Cascader = function Cascader(props, ref) {
704
721
  onPopupVisibleChange: handlePopupVisibleChange,
705
722
  onChange: handleValueChange
706
723
  }), input);
707
- }, [props, isMulti, label, value, disabledValue, inputValue, inputWidth, inputFocused, popupVisible, blur, focus, getPopupPlacement, generateFilteredOptions, handleClick, handleMouseDown, handleInputClick, handleInputBlur, handleInputFocus, handleInputKeyDown, handleInputChange, handleSelectionClear, handleSelectionItemClear, handleValueChange, handlePopupVisibleChange]);
724
+ }, [props, isMulti, label, value, disabledValue, pickerLabelOverflow, inputValue, inputWidth, inputFocused, popupVisible, blur, focus, getPopupPlacement, generateFilteredOptions, handleClick, handleMouseDown, handlePickerLabelHover, handleInputClick, handleInputBlur, handleInputFocus, handleInputKeyDown, handleInputChange, handleSelectionClear, handleSelectionItemClear, handleValueChange, handlePopupVisibleChange]);
708
725
  (0, _react.useImperativeHandle)(ref, function () {
709
726
  return {
710
727
  focus: focus,
@@ -725,6 +742,11 @@ var Cascader = function Cascader(props, ref) {
725
742
  }
726
743
  };
727
744
  }, []);
745
+ (0, _react.useEffect)(function () {
746
+ if ('value' in props && !(0, _isEqual["default"])(value, props.value)) {
747
+ setValue(props.value);
748
+ }
749
+ }, [props.value]);
728
750
  return /*#__PURE__*/_react["default"].createElement(_configProvider.ConfigConsumer, null, function (context) {
729
751
  return /*#__PURE__*/_react["default"].createElement(_LocaleReceiver["default"], null, function (locale) {
730
752
  return /*#__PURE__*/_react["default"].createElement(_SizeContext["default"].Consumer, null, function (size) {
@@ -150,64 +150,9 @@
150
150
  .acud-cascader-picker-clear {
151
151
  position: absolute;
152
152
  top: 50%;
153
- right: 32px;
153
+ right: 30px;
154
154
  z-index: 2;
155
- width: 12px;
156
- height: 12px;
157
- margin-top: -6px;
158
- line-height: 12px;
159
- cursor: pointer;
160
- border-radius: 50%;
161
- text-align: center;
162
- transition: color 0.3s ease, opacity 0.15s ease;
163
- }
164
- .acud-cascader-picker-clear.acuicon {
165
- display: flex;
166
- color: #FFFFFF;
167
- background-color: #D4D6D9;
168
- border-color: transparent;
169
- }
170
- .acud-cascader-picker-clear.acuicon:hover {
171
- color: #FFFFFF;
172
- }
173
- .acud-cascader-picker-clear.acuicon:focus,
174
- .acud-cascader-picker-clear.acuicon:active {
175
- color: #FFFFFF;
176
- }
177
- .acud-cascader-picker-clear.acuicon[disabled],
178
- .acud-cascader-picker-clear.acuicon[disabled]:hover,
179
- .acud-cascader-picker-clear.acuicon[disabled]:focus,
180
- .acud-cascader-picker-clear.acuicon[disabled]:active {
181
- color: #FFFFFF;
182
- }
183
- .acud-cascader-picker-clear.acuicon:hover {
184
- background-color: #5C5F66;
185
- }
186
- .acud-cascader-picker-clear.acuicon:focus,
187
- .acud-cascader-picker-clear.acuicon:active {
188
- background-color: #303540;
189
- }
190
- .acud-cascader-picker-clear.acuicon[disabled],
191
- .acud-cascader-picker-clear.acuicon[disabled]:hover,
192
- .acud-cascader-picker-clear.acuicon[disabled]:focus,
193
- .acud-cascader-picker-clear.acuicon[disabled]:active {
194
- background-color: #F2F2F4;
195
- }
196
- .acud-cascader-picker-clear.acuicon:hover {
197
- border-color: transparent;
198
- }
199
- .acud-cascader-picker-clear.acuicon:focus,
200
- .acud-cascader-picker-clear.acuicon:active {
201
- border-color: transparent;
202
- }
203
- .acud-cascader-picker-clear.acuicon[disabled],
204
- .acud-cascader-picker-clear.acuicon[disabled]:hover,
205
- .acud-cascader-picker-clear.acuicon[disabled]:focus,
206
- .acud-cascader-picker-clear.acuicon[disabled]:active {
207
- border-color: transparent;
208
- }
209
- .acud-cascader-picker-clear > svg {
210
- transform: scale(0.6);
155
+ margin-top: -8px;
211
156
  }
212
157
  .acud-cascader-picker-arrow {
213
158
  position: absolute;
@@ -238,7 +183,7 @@
238
183
  color: #B8BABF;
239
184
  }
240
185
  .acud-cascader-picker-arrow-expand {
241
- transform: rotate(-180deg);
186
+ transform: rotate(180deg);
242
187
  }
243
188
  .acud-cascader-picker-arrow > svg {
244
189
  width: 16px;
@@ -386,7 +331,9 @@
386
331
  color: #151B26;
387
332
  background-color: #FFFFFF;
388
333
  border-color: transparent;
389
- padding: 0 8px 0 12px;
334
+ display: flex;
335
+ justify-content: space-between;
336
+ padding: 0 12px;
390
337
  height: 32px;
391
338
  line-height: 32px;
392
339
  cursor: pointer;
@@ -434,17 +381,18 @@
434
381
  border-color: transparent;
435
382
  }
436
383
  .acud-cascader-menu-item-content {
437
- width: calc(100% - 3 * 4px);
384
+ display: flex;
438
385
  overflow: hidden;
439
386
  text-overflow: ellipsis;
440
387
  }
441
- .acud-cascader-menu-item-checkbox {
388
+ .acud-cascader-menu-item-checkbox.acud-checkbox-wrapper {
442
389
  vertical-align: middle;
390
+ margin-right: 8px;
443
391
  }
444
- .acud-cascader-menu-item-checkbox .acud-checkbox {
392
+ .acud-cascader-menu-item-checkbox.acud-checkbox-wrapper .acud-checkbox {
445
393
  top: 0;
446
394
  }
447
- .acud-cascader-menu-item-checkbox .acud-checkbox + span {
395
+ .acud-cascader-menu-item-label {
448
396
  overflow: hidden;
449
397
  text-overflow: ellipsis;
450
398
  }
@@ -466,15 +414,11 @@
466
414
  }
467
415
  .acud-cascader-menu-item-expand {
468
416
  position: relative;
417
+ padding-right: 8px;
469
418
  }
470
419
  .acud-cascader-menu-item-expand .acud-cascader-menu-item-expand-icon,
471
420
  .acud-cascader-menu-item-loading-icon {
472
421
  color: #84868C;
473
- position: absolute;
474
- right: 8px;
475
- top: 50%;
476
- transform: translateY(-50%);
477
- line-height: 0;
478
422
  }
479
423
  .acud-cascader-menu-item-expand .acud-cascader-menu-item-expand-icon:hover,
480
424
  .acud-cascader-menu-item-loading-icon:hover {
@@ -499,3 +443,8 @@
499
443
  .acud-cascader-menu-item .acud-cascader-menu-item-keyword {
500
444
  color: #2468F2;
501
445
  }
446
+ .acud-cascader-tag-tooltip.acud-tooltip,
447
+ .acud-cascader-picker-label-tooltip.acud-tooltip,
448
+ .acud-cascader-menu-item-tooltip.acud-tooltip {
449
+ max-width: initial;
450
+ }
@@ -96,26 +96,11 @@
96
96
  }
97
97
 
98
98
  &-clear {
99
- &.acuicon {
100
- display: flex;
101
- .basic-config(@cascader-picker-clear-tp, @cascader-picker-clear-p);
102
- }
103
99
  position: absolute;
104
100
  top: 50%;
105
- right: 8 * @P;
101
+ right: 7.5 * @P;
106
102
  z-index: 2;
107
- width: 3 * @P;
108
- height: 3 * @P;
109
- margin-top: -1.5 * @P;
110
- line-height: 12px;
111
- cursor: pointer;
112
- border-radius: 50%;
113
- text-align: center;
114
- transition: color .3s ease, opacity .15s ease;
115
-
116
- & > svg {
117
- transform: scale(.6);
118
- }
103
+ margin-top: -2 * @P;
119
104
  }
120
105
 
121
106
  // arrow
@@ -135,7 +120,7 @@
135
120
  transition: transform .48s;
136
121
 
137
122
  &-expand {
138
- transform: rotate(-180deg);
123
+ transform: rotate(180deg);
139
124
  }
140
125
 
141
126
  & > svg {
@@ -317,7 +302,9 @@
317
302
  &-menu-item {
318
303
  .basic-config(@cascader-menu-item-tp, @cascader-menu-item-p);
319
304
 
320
- padding: 0 @padding-sm 0 @padding-m;
305
+ display: flex;
306
+ justify-content: space-between;
307
+ padding: 0 3 * @P;
321
308
  height: @cascader-menu-item-height;
322
309
  line-height: @cascader-menu-item-height;
323
310
  cursor: pointer;
@@ -326,24 +313,25 @@
326
313
  transition: all .3s;
327
314
 
328
315
  &-content {
329
- width: calc(100% - 3 * @P);
316
+ display: flex;
330
317
  overflow: hidden;
331
318
  text-overflow: ellipsis;
332
319
  }
333
320
 
334
- &-checkbox {
321
+ &-checkbox.@{acud-prefix}-checkbox-wrapper {
335
322
  vertical-align: middle;
323
+ margin-right: 2 * @P;
336
324
 
337
325
  .@{acud-prefix}-checkbox {
338
326
  top: 0;
339
-
340
- & + span {
341
- overflow: hidden;
342
- text-overflow: ellipsis;
343
- }
344
327
  }
345
328
  }
346
329
 
330
+ &-label {
331
+ overflow: hidden;
332
+ text-overflow: ellipsis;
333
+ }
334
+
347
335
  &-disabled {
348
336
  cursor: not-allowed;
349
337
 
@@ -367,22 +355,26 @@
367
355
 
368
356
  &-expand {
369
357
  position: relative;
358
+ padding-right: 2 * @P;
370
359
  }
371
360
 
372
361
  &-expand &-expand-icon,
373
362
  &-loading-icon {
374
363
  .basic-tp-config(tp7);
375
- position: absolute;
376
- right: 2 * @P;
377
- top: 50%;
378
- transform: translateY(-50%);
379
- line-height: 0;
380
364
  }
381
365
 
382
366
  & &-keyword {
383
367
  color: @B6;
384
368
  }
385
369
  }
370
+
371
+ &-tag-tooltip,
372
+ &-picker-label-tooltip,
373
+ &-menu-item-tooltip {
374
+ &.@{acud-prefix}-tooltip {
375
+ max-width: initial;
376
+ }
377
+ }
386
378
  }
387
379
 
388
380
  // @import './rtl';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @file clear
3
+ * @author xuemin02
4
+ */
5
+ import { IconProps } from 'acud-icon/lib/components/interface';
6
+ import './style';
7
+ export interface ClearProps extends IconProps {
8
+ ref?: any;
9
+ prefixCls?: string;
10
+ }
11
+ declare const Clear: (props: ClearProps) => JSX.Element;
12
+ export default Clear;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+
16
+ var _OutlinedCloseBold = _interopRequireDefault(require("acud-icon/lib/icons/OutlinedCloseBold"));
17
+
18
+ var _configProvider = require("../config-provider");
19
+
20
+ require("./style");
21
+
22
+ /**
23
+ * @file clear
24
+ * @author xuemin02
25
+ */
26
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
27
+ var t = {};
28
+
29
+ for (var p in s) {
30
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
31
+ }
32
+
33
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
34
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
35
+ }
36
+ return t;
37
+ };
38
+
39
+ var Clear = function Clear(props) {
40
+ var customizePrefixCls = props.prefixCls,
41
+ className = props.className,
42
+ otherProps = __rest(props, ["prefixCls", "className"]);
43
+
44
+ var _React$useContext = _react["default"].useContext(_configProvider.ConfigContext),
45
+ getPrefixCls = _React$useContext.getPrefixCls;
46
+
47
+ var prefixCls = getPrefixCls('clear', customizePrefixCls);
48
+ var clearCls = (0, _classnames["default"])(prefixCls, className);
49
+ return /*#__PURE__*/_react["default"].createElement(_OutlinedCloseBold["default"], (0, _extends2["default"])({
50
+ className: clearCls
51
+ }, otherProps));
52
+ };
53
+
54
+ var _default = Clear;
55
+ exports["default"] = _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ require("../../style/index.css");
4
+
5
+ require("./index.css");
@@ -0,0 +1,63 @@
1
+ /* color */
2
+ /* 默认颜色 */
3
+ /* 通用-icon */
4
+ /* 标签 */
5
+ /* 默认颜色 */
6
+ /* 其他颜色 */
7
+ /* 通用 */
8
+ /* 水平 */
9
+ /* 垂直 */
10
+ /* 序号水平 */
11
+ /* 序号垂直 */
12
+ .acud-clear.acudicon {
13
+ color: #FFFFFF;
14
+ background-color: #D4D6D9;
15
+ border-color: transparent;
16
+ padding: 2px;
17
+ background-clip: content-box;
18
+ border-radius: 50%;
19
+ font-size: 12px;
20
+ transition: color 0.3s ease, opacity 0.15s ease;
21
+ }
22
+ .acud-clear.acudicon:hover {
23
+ color: #FFFFFF;
24
+ }
25
+ .acud-clear.acudicon:focus,
26
+ .acud-clear.acudicon:active {
27
+ color: #FFFFFF;
28
+ }
29
+ .acud-clear.acudicon[disabled],
30
+ .acud-clear.acudicon[disabled]:hover,
31
+ .acud-clear.acudicon[disabled]:focus,
32
+ .acud-clear.acudicon[disabled]:active {
33
+ color: #FFFFFF;
34
+ }
35
+ .acud-clear.acudicon:hover {
36
+ background-color: #5C5F66;
37
+ }
38
+ .acud-clear.acudicon:focus,
39
+ .acud-clear.acudicon:active {
40
+ background-color: #303540;
41
+ }
42
+ .acud-clear.acudicon[disabled],
43
+ .acud-clear.acudicon[disabled]:hover,
44
+ .acud-clear.acudicon[disabled]:focus,
45
+ .acud-clear.acudicon[disabled]:active {
46
+ background-color: #F2F2F4;
47
+ }
48
+ .acud-clear.acudicon:hover {
49
+ border-color: transparent;
50
+ }
51
+ .acud-clear.acudicon:focus,
52
+ .acud-clear.acudicon:active {
53
+ border-color: transparent;
54
+ }
55
+ .acud-clear.acudicon[disabled],
56
+ .acud-clear.acudicon[disabled]:hover,
57
+ .acud-clear.acudicon[disabled]:focus,
58
+ .acud-clear.acudicon[disabled]:active {
59
+ border-color: transparent;
60
+ }
61
+ .acud-clear.acudicon > svg {
62
+ transform: scale(0.66666);
63
+ }
@@ -0,0 +1,2 @@
1
+ import '../../style/index.less';
2
+ import './index.less';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ require("../../style/index.less");
4
+
5
+ require("./index.less");
@@ -0,0 +1,18 @@
1
+ @import '../../style/themes/index';
2
+ @import '../../style/mixins/index';
3
+
4
+ @clear-prefix-cls: ~'@{acud-prefix}-clear';
5
+
6
+ .@{clear-prefix-cls}.acudicon {
7
+ .basic-config(@clear-tp, @clear-p);
8
+
9
+ padding: .5 * @P;
10
+ background-clip: content-box;
11
+ border-radius: 50%;
12
+ font-size: 12px;
13
+ transition: color .3s ease, opacity .15s ease;
14
+
15
+ & > svg {
16
+ transform: scale(.66666);
17
+ }
18
+ }