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.
- package/dist/acud.css +207 -111
- package/dist/acud.css.map +1 -1
- package/dist/acud.js +896 -715
- package/dist/acud.js.map +1 -1
- package/dist/acud.min.css +1 -1
- package/dist/acud.min.css.map +1 -1
- package/dist/acud.min.js +8 -6
- package/dist/acud.min.js.map +1 -1
- package/es/button/button.d.ts +1 -0
- package/es/button/button.js +1 -0
- package/es/cascader/index.js +20 -5
- package/es/cascader/style/index.css +2 -57
- package/es/cascader/style/index.less +2 -17
- package/es/clear/index.d.ts +12 -0
- package/es/clear/index.js +41 -0
- package/es/clear/style/css.js +2 -0
- package/es/clear/style/index.css +63 -0
- package/es/clear/style/index.d.ts +2 -0
- package/es/clear/style/index.js +2 -0
- package/es/clear/style/index.less +18 -0
- package/es/date-picker/generatePicker/generateRangePicker.js +2 -2
- package/es/date-picker/generatePicker/generateSinglePicker.js +2 -2
- package/es/date-picker/src/PickerPanel.js +4 -1
- package/es/date-picker/src/utils/uiUtil.js +4 -4
- package/es/date-picker/style/index.css +106 -53
- package/es/date-picker/style/panel.less +83 -18
- package/es/dropdown/rc-dropdown/Dropdown.js +1 -0
- package/es/form/style/horizontal.less +1 -0
- package/es/form/style/index.css +3 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/modal/DialogBox.d.ts +1 -1
- package/es/progress/CircleProgress.js +2 -2
- package/es/progress/LineProgress.js +4 -2
- package/es/style/themes/default/components/cascader.less +0 -4
- package/es/style/themes/default/components/clear.less +2 -0
- package/es/style/themes/default/components/datePicker.less +1 -0
- package/es/style/themes/default/components/index.less +1 -0
- package/es/switch/index.d.ts +2 -3
- package/es/switch/index.js +11 -3
- package/es/switch/interface.d.ts +4 -0
- package/es/switch/style/index.css +31 -0
- package/es/switch/style/index.less +33 -1
- package/es/tooltip/index.js +1 -1
- package/es/transfer/index.js +7 -3
- package/lib/button/button.d.ts +1 -0
- package/lib/button/button.js +1 -0
- package/lib/cascader/index.js +21 -6
- package/lib/cascader/style/index.css +2 -57
- package/lib/cascader/style/index.less +2 -17
- package/lib/clear/index.d.ts +12 -0
- package/lib/clear/index.js +55 -0
- package/lib/clear/style/css.js +5 -0
- package/lib/clear/style/index.css +63 -0
- package/lib/clear/style/index.d.ts +2 -0
- package/lib/clear/style/index.js +5 -0
- package/lib/clear/style/index.less +18 -0
- package/lib/date-picker/generatePicker/generateRangePicker.js +3 -3
- package/lib/date-picker/generatePicker/generateSinglePicker.js +3 -3
- package/lib/date-picker/src/PickerPanel.js +4 -1
- package/lib/date-picker/src/utils/uiUtil.js +4 -4
- package/lib/date-picker/style/index.css +106 -53
- package/lib/date-picker/style/panel.less +83 -18
- package/lib/dropdown/rc-dropdown/Dropdown.js +1 -0
- package/lib/form/style/horizontal.less +1 -0
- package/lib/form/style/index.css +3 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -0
- package/lib/modal/DialogBox.d.ts +1 -1
- package/lib/progress/CircleProgress.js +2 -2
- package/lib/progress/LineProgress.js +4 -2
- package/lib/style/components.less +1 -0
- package/lib/style/themes/default/components/cascader.less +0 -4
- package/lib/style/themes/default/components/clear.less +2 -0
- package/lib/style/themes/default/components/datePicker.less +1 -0
- package/lib/style/themes/default/components/index.less +1 -0
- package/lib/switch/index.d.ts +2 -3
- package/lib/switch/index.js +12 -3
- package/lib/switch/interface.d.ts +4 -0
- package/lib/switch/style/index.css +31 -0
- package/lib/switch/style/index.less +33 -1
- package/lib/tooltip/index.js +1 -1
- package/lib/transfer/index.js +7 -3
- package/package.json +2 -2
package/lib/switch/index.js
CHANGED
|
@@ -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
|
-
|
|
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 {
|
package/lib/tooltip/index.js
CHANGED
|
@@ -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.
|
|
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,
|
package/lib/transfer/index.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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.
|
|
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",
|