acud 0.0.67 → 0.0.68

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 (84) hide show
  1. package/dist/acud.css +207 -111
  2. package/dist/acud.css.map +1 -1
  3. package/dist/acud.js +896 -715
  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/index.js +20 -5
  12. package/es/cascader/style/index.css +2 -57
  13. package/es/cascader/style/index.less +2 -17
  14. package/es/clear/index.d.ts +12 -0
  15. package/es/clear/index.js +41 -0
  16. package/es/clear/style/css.js +2 -0
  17. package/es/clear/style/index.css +63 -0
  18. package/es/clear/style/index.d.ts +2 -0
  19. package/es/clear/style/index.js +2 -0
  20. package/es/clear/style/index.less +18 -0
  21. package/es/date-picker/generatePicker/generateRangePicker.js +2 -2
  22. package/es/date-picker/generatePicker/generateSinglePicker.js +2 -2
  23. package/es/date-picker/src/PickerPanel.js +4 -1
  24. package/es/date-picker/src/utils/uiUtil.js +4 -4
  25. package/es/date-picker/style/index.css +106 -53
  26. package/es/date-picker/style/panel.less +83 -18
  27. package/es/dropdown/rc-dropdown/Dropdown.js +1 -0
  28. package/es/form/style/horizontal.less +1 -0
  29. package/es/form/style/index.css +3 -0
  30. package/es/index.d.ts +1 -0
  31. package/es/index.js +1 -0
  32. package/es/modal/DialogBox.d.ts +1 -1
  33. package/es/progress/CircleProgress.js +2 -2
  34. package/es/progress/LineProgress.js +4 -2
  35. package/es/style/themes/default/components/cascader.less +0 -4
  36. package/es/style/themes/default/components/clear.less +2 -0
  37. package/es/style/themes/default/components/datePicker.less +1 -0
  38. package/es/style/themes/default/components/index.less +1 -0
  39. package/es/switch/index.d.ts +2 -3
  40. package/es/switch/index.js +11 -3
  41. package/es/switch/interface.d.ts +4 -0
  42. package/es/switch/style/index.css +31 -0
  43. package/es/switch/style/index.less +33 -1
  44. package/es/tooltip/index.js +1 -1
  45. package/es/transfer/index.js +7 -3
  46. package/lib/button/button.d.ts +1 -0
  47. package/lib/button/button.js +1 -0
  48. package/lib/cascader/index.js +21 -6
  49. package/lib/cascader/style/index.css +2 -57
  50. package/lib/cascader/style/index.less +2 -17
  51. package/lib/clear/index.d.ts +12 -0
  52. package/lib/clear/index.js +55 -0
  53. package/lib/clear/style/css.js +5 -0
  54. package/lib/clear/style/index.css +63 -0
  55. package/lib/clear/style/index.d.ts +2 -0
  56. package/lib/clear/style/index.js +5 -0
  57. package/lib/clear/style/index.less +18 -0
  58. package/lib/date-picker/generatePicker/generateRangePicker.js +3 -3
  59. package/lib/date-picker/generatePicker/generateSinglePicker.js +3 -3
  60. package/lib/date-picker/src/PickerPanel.js +4 -1
  61. package/lib/date-picker/src/utils/uiUtil.js +4 -4
  62. package/lib/date-picker/style/index.css +106 -53
  63. package/lib/date-picker/style/panel.less +83 -18
  64. package/lib/dropdown/rc-dropdown/Dropdown.js +1 -0
  65. package/lib/form/style/horizontal.less +1 -0
  66. package/lib/form/style/index.css +3 -0
  67. package/lib/index.d.ts +1 -0
  68. package/lib/index.js +8 -0
  69. package/lib/modal/DialogBox.d.ts +1 -1
  70. package/lib/progress/CircleProgress.js +2 -2
  71. package/lib/progress/LineProgress.js +4 -2
  72. package/lib/style/components.less +1 -0
  73. package/lib/style/themes/default/components/cascader.less +0 -4
  74. package/lib/style/themes/default/components/clear.less +2 -0
  75. package/lib/style/themes/default/components/datePicker.less +1 -0
  76. package/lib/style/themes/default/components/index.less +1 -0
  77. package/lib/switch/index.d.ts +2 -3
  78. package/lib/switch/index.js +12 -3
  79. package/lib/switch/interface.d.ts +4 -0
  80. package/lib/switch/style/index.css +31 -0
  81. package/lib/switch/style/index.less +33 -1
  82. package/lib/tooltip/index.js +1 -1
  83. package/lib/transfer/index.js +7 -3
  84. package/package.json +2 -2
@@ -15,6 +15,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
15
15
 
16
16
  var _react = _interopRequireDefault(require("react"));
17
17
 
18
+ var _acudIcon = require("acud-icon");
19
+
18
20
  var _classnames = _interopRequireDefault(require("classnames"));
19
21
 
20
22
  var _useMergedState3 = _interopRequireDefault(require("../_util/hooks/useMergedState"));
@@ -41,12 +43,13 @@ var Switch = /*#__PURE__*/_react["default"].forwardRef(function (_a, ref) {
41
43
  checked = _a.checked,
42
44
  defaultChecked = _a.defaultChecked,
43
45
  disabled = _a.disabled,
44
- loadingIcon = _a.loadingIcon,
46
+ loading = _a.loading,
47
+ customLoadingIcon = _a.loadingIcon,
45
48
  checkedChildren = _a.checkedChildren,
46
49
  unCheckedChildren = _a.unCheckedChildren,
47
50
  onClick = _a.onClick,
48
51
  onChange = _a.onChange,
49
- restProps = __rest(_a, ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange"]);
52
+ restProps = __rest(_a, ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loading", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange"]);
50
53
 
51
54
  var _useMergedState = (0, _useMergedState3["default"])(false, {
52
55
  value: checked,
@@ -56,6 +59,11 @@ var Switch = /*#__PURE__*/_react["default"].forwardRef(function (_a, ref) {
56
59
  innerChecked = _useMergedState2[0],
57
60
  setInnerChecked = _useMergedState2[1];
58
61
 
62
+ var loadingIcon = loading && (customLoadingIcon || /*#__PURE__*/_react["default"].createElement(_acudIcon.OutlinedLoading, {
63
+ className: "".concat(prefixCls, "-loading-icon"),
64
+ animation: "spin"
65
+ }));
66
+
59
67
  function triggerChange(newChecked, event) {
60
68
  var mergedChecked = innerChecked;
61
69
 
@@ -73,7 +81,7 @@ var Switch = /*#__PURE__*/_react["default"].forwardRef(function (_a, ref) {
73
81
  onClick === null || onClick === void 0 ? void 0 : onClick(ret, e);
74
82
  }
75
83
 
76
- var switchClassName = (0, _classnames["default"])(prefixCls, className, (_classNames = {}, (0, _defineProperty2["default"])(_classNames, "".concat(prefixCls, "-checked"), innerChecked), (0, _defineProperty2["default"])(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
84
+ var switchClassName = (0, _classnames["default"])(prefixCls, className, (_classNames = {}, (0, _defineProperty2["default"])(_classNames, "".concat(prefixCls, "-checked"), innerChecked), (0, _defineProperty2["default"])(_classNames, "".concat(prefixCls, "-loading"), loading), (0, _defineProperty2["default"])(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
77
85
  return /*#__PURE__*/_react["default"].createElement("button", (0, _extends2["default"])({}, restProps, {
78
86
  type: "button",
79
87
  role: "switch",
@@ -88,5 +96,6 @@ var Switch = /*#__PURE__*/_react["default"].forwardRef(function (_a, ref) {
88
96
  });
89
97
 
90
98
  Switch.displayName = 'Switch';
99
+ Switch.__ACUD_SWITCH = true;
91
100
  var _default = Switch;
92
101
  exports["default"] = _default;
@@ -5,6 +5,7 @@ export interface SwitchProps extends Omit<React.HTMLAttributes<HTMLButtonElement
5
5
  className?: string;
6
6
  prefixCls?: string;
7
7
  disabled?: boolean;
8
+ loading?: boolean;
8
9
  checkedChildren?: React.ReactNode;
9
10
  unCheckedChildren?: React.ReactNode;
10
11
  onChange?: SwitchChangeEventHandler;
@@ -16,3 +17,6 @@ export interface SwitchProps extends Omit<React.HTMLAttributes<HTMLButtonElement
16
17
  style?: React.CSSProperties;
17
18
  title?: string;
18
19
  }
20
+ export interface CompoundedComponent extends React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLElement>> {
21
+ __ACUD_SWITCH: boolean;
22
+ }
@@ -148,6 +148,34 @@
148
148
  .acud-switch-checked[disabled]:after {
149
149
  background-color: #FFFFFF;
150
150
  }
151
+ .acud-switch-checked[disabled].acud-switch-loading .acud-switch-loading-icon {
152
+ color: #D4E5FF;
153
+ }
154
+ .acud-switch-checked.acud-switch-loading .acud-switch-loading-icon {
155
+ color: #2468F2;
156
+ left: initial;
157
+ right: 2px;
158
+ }
159
+ .acud-switch-loading {
160
+ cursor: no-drop;
161
+ }
162
+ .acud-switch-loading:after {
163
+ cursor: no-drop;
164
+ -webkit-animation-name: none;
165
+ animation-name: none;
166
+ }
167
+ .acud-switch-loading:hover:after {
168
+ width: 16px;
169
+ -webkit-animation-name: none;
170
+ animation-name: none;
171
+ }
172
+ .acud-switch-loading .acud-switch-loading-icon {
173
+ position: absolute;
174
+ top: 1px;
175
+ z-index: 99;
176
+ color: #D4D6D9;
177
+ left: 2px;
178
+ }
151
179
  .acud-switch-disabled {
152
180
  cursor: no-drop;
153
181
  }
@@ -162,6 +190,9 @@
162
190
  -webkit-animation-name: none;
163
191
  animation-name: none;
164
192
  }
193
+ .acud-switch-disabled .acud-switch-loading-icon {
194
+ color: #F2F2F4;
195
+ }
165
196
  .acud-switch-label {
166
197
  display: inline-block;
167
198
  padding-left: 10px;
@@ -96,9 +96,38 @@
96
96
  &:after {
97
97
  background-color: @switch-handle-color;
98
98
  }
99
+ &.@{switch-prefix-cls}-loading {
100
+ .@{switch-prefix-cls}-loading-icon {
101
+ color: @B2;
102
+ }
103
+ }
104
+ }
105
+ &.@{switch-prefix-cls}-loading {
106
+ .@{switch-prefix-cls}-loading-icon {
107
+ color: @B6;
108
+ left: initial;
109
+ right: 0.5 * @P;
110
+ }
111
+ }
112
+ }
113
+ &-loading {
114
+ cursor: no-drop;
115
+ &:after {
116
+ cursor: no-drop;
117
+ animation-name: none;
118
+ }
119
+ &:hover:after {
120
+ width: @switch-inner-width;
121
+ animation-name: none;
122
+ }
123
+ .@{switch-prefix-cls}-loading-icon {
124
+ position: absolute;
125
+ top: 1px;
126
+ z-index: 99;
127
+ color: @G7;
128
+ left: 0.5 * @P;
99
129
  }
100
130
  }
101
-
102
131
  &-disabled {
103
132
  cursor: no-drop;
104
133
  &:after {
@@ -110,6 +139,9 @@
110
139
  width: @switch-inner-width;
111
140
  animation-name: none;
112
141
  }
142
+ .@{switch-prefix-cls}-loading-icon {
143
+ color: @G9;
144
+ }
113
145
  }
114
146
 
115
147
  &-label {
@@ -63,7 +63,7 @@ var PresetColorRegex = new RegExp("^(".concat(PresetColorTypes.join('|'), ")(-in
63
63
  function getDisabledCompatibleChildren(element, prefixCls) {
64
64
  var elementType = element.type;
65
65
 
66
- if ((elementType.__ANT_BUTTON === true || elementType.__ANT_SWITCH === true || elementType.__ANT_CHECKBOX === true || element.type === 'button') && element.props.disabled) {
66
+ if ((elementType.__ACUD_BUTTON === true || elementType.__ACUD_SWITCH === true || elementType.__ACUD_CHECKBOX === true || element.type === 'button') && element.props.disabled) {
67
67
  // Pick some layout related style properties up to span
68
68
  var _splitObject = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']),
69
69
  picked = _splitObject.picked,
@@ -40,8 +40,7 @@ function transfer(props) {
40
40
  prefixCls = _props$prefixCls === void 0 ? 'acud-transfer' : _props$prefixCls,
41
41
  _props$displayType = props.displayType,
42
42
  displayType = _props$displayType === void 0 ? 'single' : _props$displayType,
43
- _props$targetKeys = props.targetKeys,
44
- targetKeys = _props$targetKeys === void 0 ? [] : _props$targetKeys,
43
+ targetKeys = props.targetKeys,
45
44
  onChange = props.onChange,
46
45
  _props$locale = props.locale,
47
46
  locale = _props$locale === void 0 ? {} : _props$locale,
@@ -76,11 +75,16 @@ function transfer(props) {
76
75
  return expansionArr;
77
76
  }, [dataSource]);
78
77
 
79
- var _React$useState = React.useState(targetKeys),
78
+ var _React$useState = React.useState(targetKeys || []),
80
79
  _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
81
80
  tKeys = _React$useState2[0],
82
81
  setTKeys = _React$useState2[1];
83
82
 
83
+ React.useEffect(function () {
84
+ if (Array.isArray(targetKeys)) {
85
+ setTKeys(targetKeys);
86
+ }
87
+ }, [targetKeys]);
84
88
  React.useEffect(function () {
85
89
  onChange && onChange(tKeys);
86
90
  }, [tKeys]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acud",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "description": "acg react 组件库",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -25,7 +25,7 @@
25
25
  "pub": "npm publish"
26
26
  },
27
27
  "dependencies": {
28
- "acud-icon": "^0.0.21",
28
+ "acud-icon": "^0.0.22",
29
29
  "aiflow": "^2.0.4",
30
30
  "array-tree-filter": "^2.1.0",
31
31
  "classnames": "2.2.6",