acud 1.1.13 → 1.1.15

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 (55) hide show
  1. package/dist/acud.css +123 -34
  2. package/dist/acud.css.map +1 -1
  3. package/dist/acud.js +13029 -7326
  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 +3 -3
  8. package/dist/acud.min.js.map +1 -1
  9. package/es/form/style/index.css +1 -1
  10. package/es/form/style/index.less +2 -1
  11. package/es/input/Input.d.ts +1 -0
  12. package/es/input/Input.js +8 -2
  13. package/es/input/Label.d.ts +3 -1
  14. package/es/input/Label.js +12 -1
  15. package/es/input/TextArea.d.ts +1 -0
  16. package/es/input/TextArea.js +8 -2
  17. package/es/input/style/index.css +24 -23
  18. package/es/input/style/index.less +2 -1
  19. package/es/toast/base.js +1 -1
  20. package/es/toast/index.js +13 -8
  21. package/es/toast/style/index.css +9 -9
  22. package/es/toast/style/index.less +215 -206
  23. package/es/tree/style/index.css +44 -0
  24. package/es/tree/style/mixin.less +64 -0
  25. package/es/tree/tree.d.ts +5 -2
  26. package/es/tree/tree.js +3 -1
  27. package/es/tree/utils/iconHelper.d.ts +2 -2
  28. package/es/tree/utils/iconHelper.js +20 -5
  29. package/es/tree-select/index.js +1 -1
  30. package/es/tree-select/src/OptionList.js +35 -1
  31. package/es/tree-select/style/index.css +44 -0
  32. package/lib/form/style/index.css +1 -1
  33. package/lib/form/style/index.less +2 -1
  34. package/lib/input/Input.d.ts +1 -0
  35. package/lib/input/Input.js +8 -2
  36. package/lib/input/Label.d.ts +3 -1
  37. package/lib/input/Label.js +12 -1
  38. package/lib/input/TextArea.d.ts +1 -0
  39. package/lib/input/TextArea.js +8 -2
  40. package/lib/input/style/index.css +24 -23
  41. package/lib/input/style/index.less +2 -1
  42. package/lib/toast/base.js +1 -1
  43. package/lib/toast/index.js +12 -7
  44. package/lib/toast/style/index.css +9 -9
  45. package/lib/toast/style/index.less +215 -206
  46. package/lib/tree/style/index.css +44 -0
  47. package/lib/tree/style/mixin.less +64 -0
  48. package/lib/tree/tree.d.ts +5 -2
  49. package/lib/tree/tree.js +3 -1
  50. package/lib/tree/utils/iconHelper.d.ts +2 -2
  51. package/lib/tree/utils/iconHelper.js +20 -5
  52. package/lib/tree-select/index.js +1 -1
  53. package/lib/tree-select/src/OptionList.js +35 -1
  54. package/lib/tree-select/style/index.css +44 -0
  55. package/package.json +24 -24
@@ -765,7 +765,7 @@
765
765
  clear: both;
766
766
  margin: 4px 0 0;
767
767
  min-height: 1.6667;
768
- color: #B8BABF;
768
+ color: #84868C;
769
769
  font-size: 12px;
770
770
  line-height: 1.6667;
771
771
  transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
@@ -186,7 +186,8 @@
186
186
  clear: both;
187
187
  margin: @form-item-with-extra-margin;
188
188
  min-height: @form-line-height-base;
189
- color: @form-secondary-color;
189
+ // color: @form-secondary-color;
190
+ color: @G5;
190
191
  font-size: @form-font-size-base;
191
192
  line-height: @form-line-height-base;
192
193
  transition: color 0.3s @ease-out; // sync input color transition
@@ -38,6 +38,7 @@ export interface BaseInputProps extends Omit<React.InputHTMLAttributes<HTMLInput
38
38
  type?: string;
39
39
  handleClearAll?: () => void;
40
40
  style?: React.CSSProperties;
41
+ forbidIfLimit?: boolean;
41
42
  }
42
43
  export declare const resolveTargetValue: (event: React.ChangeEvent, value: any) => React.ChangeEvent;
43
44
  declare const Input: React.ForwardRefExoticComponent<BaseInputProps & React.RefAttributes<unknown>>;
package/es/input/Input.js CHANGED
@@ -53,7 +53,9 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
53
53
  style = props.style,
54
54
  _props$hidden = props.hidden,
55
55
  hidden = _props$hidden === void 0 ? false : _props$hidden,
56
- rest = __rest(props, ["prefixCls", "size", "placeholder", "warning", "warningPopover", "warningText", "tips", "disabled", "readOnly", "defaultValue", "limitLength", "label", "prefix", "suffix", "addonBefore", "addonAfter", "className", "allowClear", "onPressEnter", "onKeyDown", "handleClearAll", "type", "style", "hidden"]);
56
+ _props$forbidIfLimit = props.forbidIfLimit,
57
+ forbidIfLimit = _props$forbidIfLimit === void 0 ? false : _props$forbidIfLimit,
58
+ rest = __rest(props, ["prefixCls", "size", "placeholder", "warning", "warningPopover", "warningText", "tips", "disabled", "readOnly", "defaultValue", "limitLength", "label", "prefix", "suffix", "addonBefore", "addonAfter", "className", "allowClear", "onPressEnter", "onKeyDown", "handleClearAll", "type", "style", "hidden", "forbidIfLimit"]);
57
59
  var _useState = useState(props.value || defaultValue || ''),
58
60
  _useState2 = _slicedToArray(_useState, 2),
59
61
  value = _useState2[0],
@@ -133,7 +135,11 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
133
135
  }
134
136
  };
135
137
  var handleOnChange = function handleOnChange(e) {
136
- setValue(e.target.value);
138
+ if (forbidIfLimit && limitLength && e.target.value.length >= limitLength) {
139
+ setValue(e.target.value.slice(0, limitLength));
140
+ } else {
141
+ setValue(e.target.value);
142
+ }
137
143
  if (!e.target.value.length) {
138
144
  setShowClearIcon(false);
139
145
  }
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { BaseInputProps } from './Input';
3
- export interface InputLabelProps extends BaseInputProps {
3
+ import { Omit } from '../_util/type';
4
+ export interface InputLabelProps extends Omit<BaseInputProps, 'value'> {
4
5
  label?: string[];
5
6
  onPressEnter: (e: any) => void;
7
+ onLableChange: (value: any) => void;
6
8
  }
7
9
  declare const Label: React.FC<InputLabelProps>;
8
10
  export default Label;
package/es/input/Label.js CHANGED
@@ -10,7 +10,8 @@ var Label = function Label(_ref) {
10
10
  customizePrefixCls = _ref.prefixCls,
11
11
  _ref$placeholder = _ref.placeholder,
12
12
  placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
13
- disabled = _ref.disabled;
13
+ disabled = _ref.disabled,
14
+ onLableChange = _ref.onLableChange;
14
15
  var _useState = useState(label || []),
15
16
  _useState2 = _slicedToArray(_useState, 2),
16
17
  labelList = _useState2[0],
@@ -25,9 +26,15 @@ var Label = function Label(_ref) {
25
26
  var handleClearLabel = function handleClearLabel(index) {
26
27
  labelList.splice(index, 1);
27
28
  setLabelList(_toConsumableArray(labelList));
29
+ if (onLableChange) {
30
+ onLableChange(_toConsumableArray(labelList));
31
+ }
28
32
  };
29
33
  var handleClearAll = function handleClearAll() {
30
34
  setLabelList([]);
35
+ if (onLableChange) {
36
+ onLableChange([]);
37
+ }
31
38
  if (inputEl.current) {
32
39
  inputEl.current.focus();
33
40
  }
@@ -44,6 +51,9 @@ var Label = function Label(_ref) {
44
51
  }
45
52
  value && setLabelList([].concat(_toConsumableArray(labelList), [value]));
46
53
  setInputValue('');
54
+ if (onLableChange) {
55
+ onLableChange([].concat(_toConsumableArray(labelList), [value]));
56
+ }
47
57
  }
48
58
  if (e.key === 'Backspace' && !value) {
49
59
  var a = _toConsumableArray(labelList);
@@ -61,6 +71,7 @@ var Label = function Label(_ref) {
61
71
  };
62
72
  var handleInputBlur = function handleInputBlur() {
63
73
  acudInputEl.current.blur();
74
+ setInputValue('');
64
75
  };
65
76
  var handleMouseUp = function handleMouseUp(e) {
66
77
  e.preventDefault();
@@ -21,6 +21,7 @@ export interface TextAreaProps {
21
21
  onResize?: any;
22
22
  readonly?: boolean;
23
23
  allowClear?: boolean;
24
+ forbidIfLimit?: boolean;
24
25
  }
25
26
  declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<unknown>>;
26
27
  export default TextArea;
@@ -38,7 +38,9 @@ var TextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
38
38
  onBlur = props.onBlur,
39
39
  _props$allowClear = props.allowClear,
40
40
  allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
41
- rest = __rest(props, ["prefixCls", "placeholder", "className", "style", "width", "limitLength", "readonly", "autoSize", "onPressEnter", "onKeyDown", "onFocus", "onBlur", "allowClear"]);
41
+ _props$forbidIfLimit = props.forbidIfLimit,
42
+ forbidIfLimit = _props$forbidIfLimit === void 0 ? false : _props$forbidIfLimit,
43
+ rest = __rest(props, ["prefixCls", "placeholder", "className", "style", "width", "limitLength", "readonly", "autoSize", "onPressEnter", "onKeyDown", "onFocus", "onBlur", "allowClear", "forbidIfLimit"]);
42
44
  var _useMergedState = useMergedState(props.defaultValue, {
43
45
  value: props.value
44
46
  }),
@@ -60,7 +62,11 @@ var TextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
60
62
  if (readonly) {
61
63
  return;
62
64
  }
63
- setValue(e.target.value);
65
+ if (forbidIfLimit && limitLength && e.target.value.length >= limitLength) {
66
+ setValue(e.target.value.slice(0, limitLength));
67
+ } else {
68
+ setValue(e.target.value);
69
+ }
64
70
  if (props.onChange) {
65
71
  props.onChange(e);
66
72
  }
@@ -874,42 +874,43 @@
874
874
  .acud-input-textarea-autosize {
875
875
  min-height: 32px;
876
876
  }
877
- .acud-input-textarea-limit {
877
+ .acud-input-textarea-limit-box {
878
+ color: #84868C;
878
879
  background-color: #FFFFFF;
879
880
  border-color: #F33E3E;
880
881
  }
881
- .acud-input-textarea-limit:hover {
882
+ .acud-input-textarea-limit-box:hover {
882
883
  background-color: #FFFFFF;
883
884
  }
884
- .acud-input-textarea-limit:focus,
885
- .acud-input-textarea-limit:active {
885
+ .acud-input-textarea-limit-box:focus,
886
+ .acud-input-textarea-limit-box:active {
886
887
  background-color: #FFFFFF;
887
888
  }
888
- .acud-input-textarea-limit[disabled],
889
- .acud-input-textarea-limit[aria-disabled="true"],
890
- .acud-input-textarea-limit[disabled]:hover,
891
- .acud-input-textarea-limit[aria-disabled="true"]:hover,
892
- .acud-input-textarea-limit[disabled]:focus,
893
- .acud-input-textarea-limit[aria-disabled="true"]:focus,
894
- .acud-input-textarea-limit[disabled]:active,
895
- .acud-input-textarea-limit[aria-disabled="true"]:active {
889
+ .acud-input-textarea-limit-box[disabled],
890
+ .acud-input-textarea-limit-box[aria-disabled="true"],
891
+ .acud-input-textarea-limit-box[disabled]:hover,
892
+ .acud-input-textarea-limit-box[aria-disabled="true"]:hover,
893
+ .acud-input-textarea-limit-box[disabled]:focus,
894
+ .acud-input-textarea-limit-box[aria-disabled="true"]:focus,
895
+ .acud-input-textarea-limit-box[disabled]:active,
896
+ .acud-input-textarea-limit-box[aria-disabled="true"]:active {
896
897
  background-color: #FFFFFF;
897
898
  }
898
- .acud-input-textarea-limit:hover {
899
+ .acud-input-textarea-limit-box:hover {
899
900
  border-color: #F33E3E;
900
901
  }
901
- .acud-input-textarea-limit:focus,
902
- .acud-input-textarea-limit:active {
902
+ .acud-input-textarea-limit-box:focus,
903
+ .acud-input-textarea-limit-box:active {
903
904
  border-color: #F33E3E;
904
905
  }
905
- .acud-input-textarea-limit[disabled],
906
- .acud-input-textarea-limit[aria-disabled="true"],
907
- .acud-input-textarea-limit[disabled]:hover,
908
- .acud-input-textarea-limit[aria-disabled="true"]:hover,
909
- .acud-input-textarea-limit[disabled]:focus,
910
- .acud-input-textarea-limit[aria-disabled="true"]:focus,
911
- .acud-input-textarea-limit[disabled]:active,
912
- .acud-input-textarea-limit[aria-disabled="true"]:active {
906
+ .acud-input-textarea-limit-box[disabled],
907
+ .acud-input-textarea-limit-box[aria-disabled="true"],
908
+ .acud-input-textarea-limit-box[disabled]:hover,
909
+ .acud-input-textarea-limit-box[aria-disabled="true"]:hover,
910
+ .acud-input-textarea-limit-box[disabled]:focus,
911
+ .acud-input-textarea-limit-box[aria-disabled="true"]:focus,
912
+ .acud-input-textarea-limit-box[disabled]:active,
913
+ .acud-input-textarea-limit-box[aria-disabled="true"]:active {
913
914
  border-color: #F33E3E;
914
915
  }
915
916
  .acud-input-textarea-no-limit {
@@ -292,7 +292,8 @@
292
292
  &-autosize {
293
293
  min-height: 32px;
294
294
  }
295
- &-limit {
295
+ &-limit-box{
296
+ color: @G5;
296
297
  .basic-p-config(@input-enhance-p);
297
298
  }
298
299
  &-no-limit {
package/es/toast/base.js CHANGED
@@ -134,7 +134,7 @@ function getNotificationInstance(args, callback) {
134
134
  customizePrefixCls = args.prefixCls;
135
135
  var _globalConfig = globalConfig(),
136
136
  getPrefixCls = _globalConfig.getPrefixCls;
137
- var prefixCls = getPrefixCls('notification', customizePrefixCls || defaultPrefixCls);
137
+ var prefixCls = getPrefixCls('', customizePrefixCls || defaultPrefixCls) + '-notification';
138
138
  var cacheKey = "".concat(prefixCls, "-").concat(placement);
139
139
  var cacheInstance = notificationInstance[cacheKey];
140
140
  if (cacheInstance) {
package/es/toast/index.js CHANGED
@@ -8,11 +8,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  import React, { useState, useEffect } from 'react';
9
9
  import NotificationApi from './base';
10
10
  import classNames from 'classnames';
11
- import { globalConfig } from '../config-provider';
11
+ import { globalConfig, defaultPrefixCls as providerDefaultPrefixCls } from '../config-provider';
12
12
  var _globalConfig = globalConfig(),
13
13
  getPrefixCls = _globalConfig.getPrefixCls;
14
14
  var PREFIX = 'notification-hastime';
15
- var defaultPrefixCls = '';
15
+ var defaultPrefixCls = providerDefaultPrefixCls;
16
16
  var maxToastArrLength = 4; // 最多显示多少个toast
17
17
  /**
18
18
  * 代理对象
@@ -54,7 +54,7 @@ function ToastDom(props) {
54
54
  counter = _useState4[0],
55
55
  setCounter = _useState4[1];
56
56
  // const prefixCls = getPrefixCls('toast-wrap', '');
57
- var prefixCls = getPrefixCls('toast-wrap', customizePrefixCls || defaultPrefixCls);
57
+ var prefixCls = getPrefixCls('', customizePrefixCls || defaultPrefixCls) + '-toast-wrap';
58
58
  useEffect(function () {
59
59
  if (counter !== undefined) {
60
60
  if (counter > 0) {
@@ -83,11 +83,11 @@ function ToastDom(props) {
83
83
  // }
84
84
  // }, []);
85
85
  return /*#__PURE__*/React.createElement("div", {
86
- className: getPrefixCls(undefined, customizePrefixCls || defaultPrefixCls) + '-toast-wrap'
86
+ className: getPrefixCls('', customizePrefixCls || defaultPrefixCls) + '-notification-toast-wrap'
87
87
  }, /*#__PURE__*/React.createElement("div", {
88
- className: classNames("".concat(getPrefixCls(undefined, customizePrefixCls || defaultPrefixCls), "-toast-wrap-left"), _defineProperty({}, prefixCls + '-no-description', !description))
88
+ className: classNames("".concat(getPrefixCls('', customizePrefixCls || defaultPrefixCls), "-notification-toast-wrap-left"), _defineProperty({}, prefixCls + '-no-description', !description))
89
89
  }, message), counter === undefined ? null : /*#__PURE__*/React.createElement("div", {
90
- className: getPrefixCls(undefined, customizePrefixCls || defaultPrefixCls) + '-toast-wrap-right'
90
+ className: getPrefixCls('', customizePrefixCls || defaultPrefixCls) + '-notification-toast-wrap-right'
91
91
  }, "(", counter, /*#__PURE__*/React.createElement("span", null, "s"), ")"));
92
92
  }
93
93
  function DescriptionDom(props) {
@@ -117,6 +117,10 @@ var handler = {
117
117
  if (name === 'config' && props.maxCount) {
118
118
  maxToastArrLength = props.maxCount;
119
119
  }
120
+ // 设置prefixcls 兼容antd
121
+ if (name === 'config' && props.prefixCls) {
122
+ defaultPrefixCls = props.prefixCls;
123
+ }
120
124
  // key相同时不重新渲染
121
125
  if (!~toastArr.indexOf(args.key)) {
122
126
  if (toastArr.length < maxToastArrLength) {
@@ -139,7 +143,7 @@ var handler = {
139
143
  // 设置样式 有描述和没描述间距不一样
140
144
  var tempClassName = (props === null || props === void 0 ? void 0 : props.className) + ' ' + PREFIX;
141
145
  if (args.description) {
142
- tempClassName += ' ' + getPrefixCls('notification') + '-has-description';
146
+ tempClassName += ' ' + getPrefixCls('', (props === null || props === void 0 ? void 0 : props.prefixCls) || defaultPrefixCls) + '-notification-has-description';
143
147
  }
144
148
  if (props && props.className) {
145
149
  args.className = props.className + ' ' + tempClassName;
@@ -152,7 +156,8 @@ var handler = {
152
156
  description: args.description,
153
157
  countdown: tempDuration,
154
158
  notificationKey: args.key,
155
- onClose: props === null || props === void 0 ? void 0 : props.onClose
159
+ onClose: props === null || props === void 0 ? void 0 : props.onClose,
160
+ prefixCls: props === null || props === void 0 ? void 0 : props.prefixCls
156
161
  });
157
162
  args.description = /*#__PURE__*/React.createElement(DescriptionDom, {
158
163
  description: args.description
@@ -73,23 +73,23 @@
73
73
  display: block;
74
74
  content: '';
75
75
  }
76
- .acud-notification-notice-message .acud-toast-wrap {
76
+ .acud-notification-notice-message .acud-notification-toast-wrap {
77
77
  display: flex;
78
78
  }
79
- .acud-notification-notice-message .acud-toast-wrap-left {
79
+ .acud-notification-notice-message .acud-notification-toast-wrap-left {
80
80
  flex: 1;
81
81
  font-size: 14px;
82
82
  color: #151B26;
83
83
  font-weight: 500;
84
84
  }
85
- .acud-notification-notice-message .acud-toast-wrap-right {
85
+ .acud-notification-notice-message .acud-notification-toast-wrap-right {
86
86
  font-size: 12px;
87
87
  color: #B8BABF;
88
88
  }
89
- .acud-notification-notice-message .acud-toast-wrap-right span {
89
+ .acud-notification-notice-message .acud-notification-toast-wrap-right span {
90
90
  font-size: 12px;
91
91
  }
92
- .acud-notification-notice-message .acud-toast-wrap-no-description {
92
+ .acud-notification-notice-message .acud-notification-toast-wrap-no-description {
93
93
  color: #151B26;
94
94
  font-size: 12px;
95
95
  font-weight: 400;
@@ -117,16 +117,16 @@
117
117
  line-height: 16px;
118
118
  top: 8px;
119
119
  }
120
- .acudicon.acud-notification-notice-icon-success path {
120
+ .acud-notification-notice .acud-notification-notice-icon-success path {
121
121
  fill: #30BF13;
122
122
  }
123
- .acudicon.acud-notification-notice-icon-info path {
123
+ .acud-notification-notice .acud-notification-notice-icon-info path {
124
124
  fill: #2468F2;
125
125
  }
126
- .acudicon.acud-notification-notice-icon-warning path {
126
+ .acud-notification-notice .acud-notification-notice-icon-warning path {
127
127
  fill: #FF9326;
128
128
  }
129
- .acudicon.acud-notification-notice-icon-error path {
129
+ .acud-notification-notice .acud-notification-notice-icon-error path {
130
130
  fill: #F33E3E;
131
131
  }
132
132
  .acud-notification-notice-close {