@chaoswise/ui 2.3.17 → 2.3.18
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/lib/CWCascader/Cascader/index.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/Checkbox.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/index.js +3 -3
- package/lib/CWCascader/rc-cascader/hooks/useSearchOptions.js +1 -2
- package/lib/CWSelect/antd-select.js +1 -2
- package/lib/CWTree/index.less +5 -0
- package/lib/CWUpload/upload/Upload.js +4 -6
- package/lib/CWUpload/upload/UploadList.js +4 -6
- package/lib/Checkbox/Checkbox.js +1 -2
- package/lib/FilterDropDown/DragList.js +33 -37
- package/lib/FilterDropDown/assets/DragSvg.js +33 -0
- package/lib/FilterDropDown/index.js +15 -8
- package/lib/FilterDropDown/index.less +8 -0
- package/lib/Input/InputComponent.js +1 -2
- package/lib/Radio/Group.js +1 -2
- package/lib/Radio/Radio.js +1 -2
- package/lib/SingleSpa/singleSpa/single-spa.dev.js +1 -2
- package/lib/TreeList/index.js +1 -2
- package/lib/Watermark/index.js +0 -2
- package/lib/message/index.js +2 -3
- package/package.json +2 -2
- package/lib/FilterDropDown/drag.svg +0 -17
- package/lib/QuickTransfer/CheckList.js +0 -54
- package/lib/QuickTransfer/TopicList.js +0 -153
|
@@ -71,7 +71,6 @@ var defaultSearchRender = function defaultSearchRender(inputValue, path, prefixC
|
|
|
71
71
|
return optionList;
|
|
72
72
|
};
|
|
73
73
|
var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
74
|
-
var _classNames2;
|
|
75
74
|
var customizePrefixCls = props.prefixCls,
|
|
76
75
|
customizeSize = props.size,
|
|
77
76
|
className = props.className,
|
|
@@ -174,7 +173,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
174
173
|
// ==================== Render =====================
|
|
175
174
|
return /*#__PURE__*/React.createElement(RcCascader, _extends({
|
|
176
175
|
prefixCls: prefixCls,
|
|
177
|
-
className: classNames(!customizePrefixCls && cascaderPrefixCls, (
|
|
176
|
+
className: classNames(!customizePrefixCls && cascaderPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-lg"), mergedSize === 'large'), "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-rtl"), isRtl), "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-in-form-item"), isFormItemInput), getStatusClassNames(prefixCls, mergedStatus, hasFeedback), className)
|
|
178
177
|
}, restProps, {
|
|
179
178
|
direction: mergedDirection,
|
|
180
179
|
placement: getPlacement(),
|
|
@@ -6,7 +6,6 @@ import * as React from "react";
|
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import CascaderContext from "../context";
|
|
8
8
|
export default function Checkbox(_ref) {
|
|
9
|
-
var _classNames;
|
|
10
9
|
var prefixCls = _ref.prefixCls,
|
|
11
10
|
checked = _ref.checked,
|
|
12
11
|
halfChecked = _ref.halfChecked,
|
|
@@ -16,7 +15,7 @@ export default function Checkbox(_ref) {
|
|
|
16
15
|
checkable = _React$useContext.checkable;
|
|
17
16
|
var customCheckbox = typeof checkable !== "boolean" ? checkable : null;
|
|
18
17
|
return /*#__PURE__*/React.createElement("span", {
|
|
19
|
-
className: classNames("".concat(prefixCls), (
|
|
18
|
+
className: classNames("".concat(prefixCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-checked"), checked), "".concat(prefixCls, "-indeterminate"), !checked && halfChecked), "".concat(prefixCls, "-disabled"), disabled)),
|
|
20
19
|
onClick: onClick
|
|
21
20
|
}, customCheckbox);
|
|
22
21
|
}
|
|
@@ -177,7 +177,6 @@ export default function Column(_ref) {
|
|
|
177
177
|
};
|
|
178
178
|
}()
|
|
179
179
|
}, optionInfoList.map(function (_ref4) {
|
|
180
|
-
var _classNames;
|
|
181
180
|
var disabled = _ref4.disabled,
|
|
182
181
|
label = _ref4.label,
|
|
183
182
|
value = _ref4.value,
|
|
@@ -212,7 +211,7 @@ export default function Column(_ref) {
|
|
|
212
211
|
// >>>>> Render
|
|
213
212
|
return /*#__PURE__*/React.createElement("li", {
|
|
214
213
|
key: fullPathKey,
|
|
215
|
-
className: classNames(menuItemPrefixCls, (
|
|
214
|
+
className: classNames(menuItemPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(menuItemPrefixCls, "-expand"), !isMergedLeaf), "".concat(menuItemPrefixCls, "-active"), activeValue === value), "".concat(menuItemPrefixCls, "-disabled"), disabled), "".concat(menuItemPrefixCls, "-loading"), isLoading)),
|
|
216
215
|
style: dropdownMenuColumnStyle,
|
|
217
216
|
role: "menuitemcheckbox",
|
|
218
217
|
title: title,
|
|
@@ -26,7 +26,7 @@ import Column, { FIX_LABEL } from './Column';
|
|
|
26
26
|
import useActive from './useActive';
|
|
27
27
|
import useKeyboard from './useKeyboard';
|
|
28
28
|
var RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
29
|
-
var _optionColumns
|
|
29
|
+
var _optionColumns$;
|
|
30
30
|
var _useBaseProps = useBaseProps(),
|
|
31
31
|
prefixCls = _useBaseProps.prefixCls,
|
|
32
32
|
multiple = _useBaseProps.multiple,
|
|
@@ -181,7 +181,7 @@ var RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
181
181
|
// ========================== Render ==========================
|
|
182
182
|
// >>>>> Empty
|
|
183
183
|
var isEmpty = !((_optionColumns$ = optionColumns[0]) !== null && _optionColumns$ !== void 0 && (_optionColumns$ = _optionColumns$.options) !== null && _optionColumns$ !== void 0 && _optionColumns$.length);
|
|
184
|
-
var emptyList = [(
|
|
184
|
+
var emptyList = [_defineProperty(_defineProperty(_defineProperty({}, fieldNames.value, '__EMPTY__'), FIX_LABEL, notFoundContent), "disabled", true)];
|
|
185
185
|
var columnProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
186
186
|
multiple: !isEmpty && multiple,
|
|
187
187
|
onSelect: onPathSelect,
|
|
@@ -213,7 +213,7 @@ var RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
213
213
|
|
|
214
214
|
// >>>>> Render
|
|
215
215
|
return /*#__PURE__*/React.createElement("div", {
|
|
216
|
-
className: classNames("".concat(mergedPrefixCls, "-menus"), (
|
|
216
|
+
className: classNames("".concat(mergedPrefixCls, "-menus"), _defineProperty(_defineProperty({}, "".concat(mergedPrefixCls, "-menu-empty"), isEmpty), "".concat(mergedPrefixCls, "-rtl"), rtl)),
|
|
217
217
|
ref: containerRef
|
|
218
218
|
}, columnNodes);
|
|
219
219
|
});
|
|
@@ -53,8 +53,7 @@ export default (function (search, options, fieldNames, prefixCls, config, change
|
|
|
53
53
|
if (filter(search, connectedPathOptions, {
|
|
54
54
|
label: fieldNames.label
|
|
55
55
|
})) {
|
|
56
|
-
|
|
57
|
-
filteredOptions.push(_objectSpread(_objectSpread({}, option), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, fieldNames.label, render(search, connectedPathOptions, prefixCls, fieldNames)), _defineProperty(_objectSpread2, SEARCH_MARK, connectedPathOptions), _objectSpread2)));
|
|
56
|
+
filteredOptions.push(_objectSpread(_objectSpread({}, option), {}, _defineProperty(_defineProperty({}, fieldNames.label, render(search, connectedPathOptions, prefixCls, fieldNames)), SEARCH_MARK, connectedPathOptions)));
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
if (children) {
|
|
@@ -38,7 +38,6 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
38
38
|
_this.rcSelect = node;
|
|
39
39
|
});
|
|
40
40
|
_defineProperty(_assertThisInitialized(_this), "renderSelect", function (_ref) {
|
|
41
|
-
var _classNames;
|
|
42
41
|
var getContextPopupContainer = _ref.getPopupContainer,
|
|
43
42
|
getPrefixCls = _ref.getPrefixCls,
|
|
44
43
|
renderEmpty = _ref.renderEmpty;
|
|
@@ -63,7 +62,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
63
62
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
64
63
|
var rest = omit(restProps, ['inputIcon']);
|
|
65
64
|
var prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
66
|
-
var cls = classNames((
|
|
65
|
+
var cls = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-lg"), size === 'large'), "".concat(prefixCls, "-sm"), size === 'small'), "".concat(prefixCls, "-allow-drag"), allowDrag), className);
|
|
67
66
|
var dropdownCls = classNames({
|
|
68
67
|
'cw-select-dropdown-multiple': ["multiple", "tags"].includes(mode),
|
|
69
68
|
'cw-select-dropdown-has-checkbox': mode === 'multiple' && showCheckbox
|
package/lib/CWTree/index.less
CHANGED
|
@@ -321,7 +321,6 @@ var Upload = /*#__PURE__*/function (_React$Component) {
|
|
|
321
321
|
});
|
|
322
322
|
};
|
|
323
323
|
_this.renderUpload = function (_ref2) {
|
|
324
|
-
var _classNames3;
|
|
325
324
|
var getPrefixCls = _ref2.getPrefixCls;
|
|
326
325
|
var _this$props4 = _this.props,
|
|
327
326
|
customizePrefixCls = _this$props4.prefixCls,
|
|
@@ -371,11 +370,10 @@ var Upload = /*#__PURE__*/function (_React$Component) {
|
|
|
371
370
|
}
|
|
372
371
|
};
|
|
373
372
|
if (type === "drag") {
|
|
374
|
-
var
|
|
375
|
-
var dragCls = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-drag"), true), _defineProperty(_classNames, "".concat(prefixCls, "-drag-uploading"), fileList.some(function (file) {
|
|
373
|
+
var dragCls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-drag"), true), "".concat(prefixCls, "-drag-uploading"), fileList.some(function (file) {
|
|
376
374
|
return file.status === "uploading";
|
|
377
|
-
})),
|
|
378
|
-
var containerCls = classNames(prefixCls, (
|
|
375
|
+
})), "".concat(prefixCls, "-drag-hover"), dragState === "dragover"), "".concat(prefixCls, "-drag-click"), dragClickState), "".concat(prefixCls, "-disabled"), disabled), className);
|
|
376
|
+
var containerCls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-drag-container"), true), "".concat(prefixCls, "-drag-disabled"), disabled), "".concat(prefixCls, "-drag-custom-container"), errorMessage || successMessage));
|
|
379
377
|
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
|
|
380
378
|
className: dragCls,
|
|
381
379
|
onDrop: _this.onFileDrop,
|
|
@@ -401,7 +399,7 @@ var Upload = /*#__PURE__*/function (_React$Component) {
|
|
|
401
399
|
className: containerCls
|
|
402
400
|
}, dropSingleFileRender()))), dropSingleFileUpload ? "" : uploadList);
|
|
403
401
|
}
|
|
404
|
-
var uploadButtonCls = classNames(prefixCls, (
|
|
402
|
+
var uploadButtonCls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-select"), true), "".concat(prefixCls, "-select-").concat(listType), true), "".concat(prefixCls, "-disabled"), disabled));
|
|
405
403
|
var uploadButton = /*#__PURE__*/React.createElement("div", {
|
|
406
404
|
className: uploadButtonCls,
|
|
407
405
|
style: children ? undefined : {
|
|
@@ -67,7 +67,6 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
_this.renderUploadList = function (_ref) {
|
|
70
|
-
var _classNames5;
|
|
71
70
|
var getPrefixCls = _ref.getPrefixCls;
|
|
72
71
|
var _this$props = _this.props,
|
|
73
72
|
customizePrefixCls = _this$props.prefixCls,
|
|
@@ -103,7 +102,6 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
|
|
|
103
102
|
return null;
|
|
104
103
|
}
|
|
105
104
|
var list = items.map(function (file, fileIndex) {
|
|
106
|
-
var _classNames2, _classNames3;
|
|
107
105
|
var progress;
|
|
108
106
|
var icon = /*#__PURE__*/React.createElement(_Icon, {
|
|
109
107
|
type: file.status === "uploading" ? "loading" : "paper-clip"
|
|
@@ -155,7 +153,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
|
|
|
155
153
|
key: "progress"
|
|
156
154
|
}, loadingProgress);
|
|
157
155
|
}
|
|
158
|
-
var infoUploadingClass = classNames((
|
|
156
|
+
var infoUploadingClass = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-list-item"), true), "".concat(prefixCls, "-list-item-").concat(file.status), true), "".concat(prefixCls, "-list-item-list-type-").concat(listType), true));
|
|
159
157
|
var linkProps = typeof file.linkProps === "string" ? JSON.parse(file.linkProps) : file.linkProps;
|
|
160
158
|
var removeIcon = showRemoveIcon ? /*#__PURE__*/React.createElement(_Icon, {
|
|
161
159
|
type: "delete",
|
|
@@ -186,9 +184,9 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
|
|
|
186
184
|
title: locale.removeFile,
|
|
187
185
|
className: "".concat(prefixCls, "-list-item-card-actions-delete ")
|
|
188
186
|
}, removeIcon));
|
|
189
|
-
var listItemNameClass = classNames((
|
|
187
|
+
var listItemNameClass = classNames(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-list-item-name"), true), "".concat(prefixCls, "-list-item-name-icon-count-").concat([downloadIcon, removeIcon].filter(function (x) {
|
|
190
188
|
return x;
|
|
191
|
-
}).length), true)
|
|
189
|
+
}).length), true));
|
|
192
190
|
var preview = file.url ? [/*#__PURE__*/React.createElement("a", Object.assign({
|
|
193
191
|
key: "view",
|
|
194
192
|
target: "_blank",
|
|
@@ -384,7 +382,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
|
|
|
384
382
|
title: message
|
|
385
383
|
}, dom) : /*#__PURE__*/React.createElement("span", null, renderMethod ? dragDom : dom));
|
|
386
384
|
});
|
|
387
|
-
var listClassNames = classNames((
|
|
385
|
+
var listClassNames = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-list"), true), "".concat(prefixCls, "-list-").concat(listType), true), "".concat(prefixCls, "-list-").concat(_this.props.type), true));
|
|
388
386
|
var animationDirection = listType === "picture-card" ? "animate-inline" : "animate";
|
|
389
387
|
return /*#__PURE__*/React.createElement(Animate, {
|
|
390
388
|
transitionName: "".concat(prefixCls, "-").concat(animationDirection),
|
package/lib/Checkbox/Checkbox.js
CHANGED
|
@@ -43,7 +43,6 @@ var Checkbox = /*#__PURE__*/function (_Component) {
|
|
|
43
43
|
_this.rcCheckbox = node;
|
|
44
44
|
});
|
|
45
45
|
_defineProperty(_assertThisInitialized(_this), "renderCheckbox", function (_ref) {
|
|
46
|
-
var _classNames;
|
|
47
46
|
var getPrefixCls = _ref.getPrefixCls;
|
|
48
47
|
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
49
48
|
props = _assertThisInitialize.props,
|
|
@@ -77,7 +76,7 @@ var Checkbox = /*#__PURE__*/function (_Component) {
|
|
|
77
76
|
checkboxProps.checked = checkboxGroup.value.indexOf(props.value) !== -1;
|
|
78
77
|
checkboxProps.disabled = props.disabled || checkboxGroup.disabled;
|
|
79
78
|
}
|
|
80
|
-
var classString = classNames(className, (
|
|
79
|
+
var classString = classNames(className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-wrapper"), true), "".concat(prefixCls, "-wrapper-checked"), checkboxProps.checked), "".concat(prefixCls, "-wrapper-disabled"), checkboxProps.disabled), "".concat(prefixCls, "-checkbox_-wrapper"), newTypeExist), "".concat(prefixCls, "-checkbox_-wrapper-checked"), checkboxProps.checked && newTypeExist), "".concat(prefixCls, "-checkbox_-wrapper-disabled"), checkboxProps.disabled && newTypeExist), "".concat(prefixCls, "-checkbox_-wrapper-custom"), render));
|
|
81
80
|
var checkboxClass = classNames(_defineProperty({}, "".concat(prefixCls, "-indeterminate"), indeterminate));
|
|
82
81
|
function renderImg() {
|
|
83
82
|
return checkboxProps.checked ? checkboxProps.disabled ? /*#__PURE__*/React.createElement(Duigou02, {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import "@chaoswise/ui/lib/Checkbox/index.less";
|
|
2
3
|
import _Checkbox from "@chaoswise/ui/lib/Checkbox";
|
|
3
4
|
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
4
5
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
5
6
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
10
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
12
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -10,16 +14,19 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, { useRef
|
|
14
|
-
import { useDrag, useDrop } from
|
|
17
|
+
import React, { useRef } from "react";
|
|
18
|
+
import { useDrag, useDrop } from "react-dnd";
|
|
19
|
+
import DragSvg from "./assets/DragSvg";
|
|
20
|
+
import classnames from "classnames";
|
|
15
21
|
function DragList(_ref) {
|
|
16
22
|
var option = _ref.option,
|
|
17
23
|
index = _ref.index,
|
|
18
|
-
moveList = _ref.moveList
|
|
24
|
+
moveList = _ref.moveList,
|
|
25
|
+
isHoverSwitching = _ref.isHoverSwitching;
|
|
19
26
|
var dragRef = useRef(null);
|
|
20
27
|
var _useDrag = useDrag({
|
|
21
28
|
item: {
|
|
22
|
-
type:
|
|
29
|
+
type: "child",
|
|
23
30
|
option: option,
|
|
24
31
|
index: index
|
|
25
32
|
}
|
|
@@ -27,8 +34,9 @@ function DragList(_ref) {
|
|
|
27
34
|
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
28
35
|
drag = _useDrag2[1];
|
|
29
36
|
var _useDrop = useDrop({
|
|
30
|
-
accept:
|
|
37
|
+
accept: "child",
|
|
31
38
|
hover: function hover(item, monitor) {
|
|
39
|
+
if (!isHoverSwitching) return;
|
|
32
40
|
//拖拽目标的Index
|
|
33
41
|
var dragIndex = item.index;
|
|
34
42
|
//放置目标Index
|
|
@@ -56,41 +64,29 @@ function DragList(_ref) {
|
|
|
56
64
|
}
|
|
57
65
|
moveList(dragIndex, hoverIndex); //调用方法完成交换
|
|
58
66
|
item.index = hoverIndex; //重新赋值index,否则会出现无限交换情况
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
collect: function collect(monitor) {
|
|
70
|
+
var _ref2 = monitor.getItem() || {},
|
|
71
|
+
dragIndex = _ref2.index;
|
|
72
|
+
if (dragIndex === index) {
|
|
73
|
+
return {};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
isOver: monitor.isOver(),
|
|
77
|
+
dropClassName: dragIndex < index ? "drop-over-downward" : "drop-over-upward"
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
drop: function drop(item) {
|
|
81
|
+
if (isHoverSwitching) return;
|
|
82
|
+
moveList(item.index, index);
|
|
59
83
|
}
|
|
60
84
|
}),
|
|
61
85
|
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
86
|
+
_useDrop2$ = _useDrop2[0],
|
|
87
|
+
isOver = _useDrop2$.isOver,
|
|
88
|
+
dropClassName = _useDrop2$.dropClassName,
|
|
62
89
|
drop = _useDrop2[1];
|
|
63
|
-
var DragSvg = function DragSvg() {
|
|
64
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
65
|
-
width: "7px",
|
|
66
|
-
height: "12px",
|
|
67
|
-
viewBox: "0 0 7 12",
|
|
68
|
-
version: "1.1",
|
|
69
|
-
fill: "currentColor"
|
|
70
|
-
}, /*#__PURE__*/React.createElement("title", null, "\u5F62\u72B6"), /*#__PURE__*/React.createElement("g", {
|
|
71
|
-
id: "\u9875\u9762-1",
|
|
72
|
-
stroke: "none",
|
|
73
|
-
strokeWidth: "1"
|
|
74
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
75
|
-
id: "4.2\u8BF7\u6C42\u5217\u8868\u4E0B\u94BB-\u2014\u5FEB\u7167\u8BF7\u6C42\u5217\u8868\u9875",
|
|
76
|
-
transform: "translate(-1368.000000, -705.000000)"
|
|
77
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
78
|
-
id: "\u7F16\u7EC4-11",
|
|
79
|
-
transform: "translate(232.000000, 554.000000)"
|
|
80
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
81
|
-
id: "\u9ED8\u8BA4",
|
|
82
|
-
transform: "translate(857.000000, 10.000000)"
|
|
83
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
84
|
-
id: "\u6E90\u5217\u8868",
|
|
85
|
-
transform: "translate(143.000000, 34.000000)"
|
|
86
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
87
|
-
id: "\u62D6\u62FD\u5907\u4EFD-3",
|
|
88
|
-
transform: "translate(132.000000, 105.000000)"
|
|
89
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
90
|
-
d: "M9.91111111,2 C9.37777778,2 8.97777778,2.4 8.97777778,2.93333333 C8.97777778,3.46666666 9.42222222,3.86666667 9.91111111,3.86666667 C10.4444444,3.86666667 10.8444444,3.46666667 10.8444444,2.93333333 C10.8888889,2.4 10.4444444,2 9.91111111,2 Z M9.91111111,6.71111111 C9.37777778,6.71111111 8.97777778,7.11111111 8.97777778,7.64444444 C8.97777778,8.17777777 9.42222222,8.57777778 9.91111111,8.57777778 C10.4444444,8.57777778 10.8444444,8.17777778 10.8444444,7.64444444 C10.8888889,7.11111111 10.4444444,6.71111111 9.91111111,6.71111111 Z M9.91111111,11.4222222 C9.37777778,11.4222222 8.97777778,11.8222222 8.97777778,12.3555556 C8.97777778,12.8888889 9.42222222,13.2888889 9.91111111,13.2888889 C10.4444444,13.2888889 10.8444444,12.8888889 10.8444444,12.3555556 C10.8888889,11.8222222 10.4444444,11.4222222 9.91111111,11.4222222 C9.42222222,11.4222222 9.91111111,11.4222222 9.91111111,11.4222222 Z M5.82222222,2 C5.33333333,2 4.88888889,2.4 4.88888889,2.93333333 C4.88888889,3.46666666 5.33333333,3.86666667 5.82222222,3.86666667 C6.35555555,3.86666667 6.75555555,3.46666667 6.75555556,2.93333333 C6.8,2.4 6.35555556,2 5.82222222,2 Z M5.82222222,6.71111111 C5.28888889,6.71111111 4.88888889,7.11111111 4.88888889,7.64444444 C4.88888889,8.17777777 5.33333333,8.57777778 5.82222222,8.57777778 C6.35555555,8.57777778 6.75555555,8.17777778 6.75555556,7.64444444 C6.8,7.11111111 6.35555556,6.71111111 5.82222222,6.71111111 Z M5.82222222,11.4222222 C5.28888889,11.4222222 4.88888889,11.8222222 4.88888889,12.3555556 C4.88888889,12.8888889 5.33333333,13.2888889 5.82222222,13.2888889 C6.35555555,13.2888889 6.75555555,12.8888889 6.75555556,12.3555556 C6.8,11.8222222 6.35555556,11.4222222 5.82222222,11.4222222 Z",
|
|
91
|
-
id: "\u5F62\u72B6"
|
|
92
|
-
}))))))));
|
|
93
|
-
};
|
|
94
90
|
var DragIcon = function DragIcon(props) {
|
|
95
91
|
return /*#__PURE__*/React.createElement(_Icon, _extends({
|
|
96
92
|
component: DragSvg
|
|
@@ -99,7 +95,7 @@ function DragList(_ref) {
|
|
|
99
95
|
return /*#__PURE__*/React.createElement("div", {
|
|
100
96
|
key: option.id,
|
|
101
97
|
ref: drag(drop(dragRef)),
|
|
102
|
-
className: "cw-checkbox-container"
|
|
98
|
+
className: classnames("cw-checkbox-container", _defineProperty({}, dropClassName, isOver && !isHoverSwitching))
|
|
103
99
|
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
104
100
|
value: option.id,
|
|
105
101
|
className: "cw-checkbox-ellipsis",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
var DragSvg = function DragSvg() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
+
width: "7px",
|
|
5
|
+
height: "12px",
|
|
6
|
+
viewBox: "0 0 7 12",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
fill: "currentColor"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("title", null, "\u5F62\u72B6"), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
id: "\u9875\u9762-1",
|
|
11
|
+
stroke: "none",
|
|
12
|
+
strokeWidth: "1"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
14
|
+
id: "4.2\u8BF7\u6C42\u5217\u8868\u4E0B\u94BB-\u2014\u5FEB\u7167\u8BF7\u6C42\u5217\u8868\u9875",
|
|
15
|
+
transform: "translate(-1368.000000, -705.000000)"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
17
|
+
id: "\u7F16\u7EC4-11",
|
|
18
|
+
transform: "translate(232.000000, 554.000000)"
|
|
19
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
20
|
+
id: "\u9ED8\u8BA4",
|
|
21
|
+
transform: "translate(857.000000, 10.000000)"
|
|
22
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
23
|
+
id: "\u6E90\u5217\u8868",
|
|
24
|
+
transform: "translate(143.000000, 34.000000)"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
26
|
+
id: "\u62D6\u62FD\u5907\u4EFD-3",
|
|
27
|
+
transform: "translate(132.000000, 105.000000)"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
d: "M9.91111111,2 C9.37777778,2 8.97777778,2.4 8.97777778,2.93333333 C8.97777778,3.46666666 9.42222222,3.86666667 9.91111111,3.86666667 C10.4444444,3.86666667 10.8444444,3.46666667 10.8444444,2.93333333 C10.8888889,2.4 10.4444444,2 9.91111111,2 Z M9.91111111,6.71111111 C9.37777778,6.71111111 8.97777778,7.11111111 8.97777778,7.64444444 C8.97777778,8.17777777 9.42222222,8.57777778 9.91111111,8.57777778 C10.4444444,8.57777778 10.8444444,8.17777778 10.8444444,7.64444444 C10.8888889,7.11111111 10.4444444,6.71111111 9.91111111,6.71111111 Z M9.91111111,11.4222222 C9.37777778,11.4222222 8.97777778,11.8222222 8.97777778,12.3555556 C8.97777778,12.8888889 9.42222222,13.2888889 9.91111111,13.2888889 C10.4444444,13.2888889 10.8444444,12.8888889 10.8444444,12.3555556 C10.8888889,11.8222222 10.4444444,11.4222222 9.91111111,11.4222222 C9.42222222,11.4222222 9.91111111,11.4222222 9.91111111,11.4222222 Z M5.82222222,2 C5.33333333,2 4.88888889,2.4 4.88888889,2.93333333 C4.88888889,3.46666666 5.33333333,3.86666667 5.82222222,3.86666667 C6.35555555,3.86666667 6.75555555,3.46666667 6.75555556,2.93333333 C6.8,2.4 6.35555556,2 5.82222222,2 Z M5.82222222,6.71111111 C5.28888889,6.71111111 4.88888889,7.11111111 4.88888889,7.64444444 C4.88888889,8.17777777 5.33333333,8.57777778 5.82222222,8.57777778 C6.35555555,8.57777778 6.75555555,8.17777778 6.75555556,7.64444444 C6.8,7.11111111 6.35555556,6.71111111 5.82222222,6.71111111 Z M5.82222222,11.4222222 C5.28888889,11.4222222 4.88888889,11.8222222 4.88888889,12.3555556 C4.88888889,12.8888889 5.33333333,13.2888889 5.82222222,13.2888889 C6.35555555,13.2888889 6.75555555,12.8888889 6.75555556,12.3555556 C6.8,11.8222222 6.35555556,11.4222222 5.82222222,11.4222222 Z",
|
|
30
|
+
id: "\u5F62\u72B6"
|
|
31
|
+
}))))))));
|
|
32
|
+
};
|
|
33
|
+
export default DragSvg;
|
|
@@ -23,8 +23,8 @@ import PropTypes from "prop-types";
|
|
|
23
23
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
24
24
|
import { DndProvider } from "react-dnd";
|
|
25
25
|
import { getLocale } from "./locale";
|
|
26
|
-
import useConfigContext from
|
|
27
|
-
import ShowSvgIcon from
|
|
26
|
+
import useConfigContext from "../useConfigContext";
|
|
27
|
+
import ShowSvgIcon from "./assets/ShowSvgIcon";
|
|
28
28
|
import "./index.less";
|
|
29
29
|
var CheckboxGroup = _Checkbox.Group;
|
|
30
30
|
function FilterDropDown(props) {
|
|
@@ -45,7 +45,9 @@ function FilterDropDown(props) {
|
|
|
45
45
|
dropdownClassName = props.dropdownClassName,
|
|
46
46
|
_props$isShowSelectAl = props.isShowSelectAll,
|
|
47
47
|
isShowSelectAll = _props$isShowSelectAl === void 0 ? true : _props$isShowSelectAl,
|
|
48
|
-
fixed = props.fixed
|
|
48
|
+
fixed = props.fixed,
|
|
49
|
+
_props$isHoverSwitchi = props.isHoverSwitching,
|
|
50
|
+
isHoverSwitching = _props$isHoverSwitchi === void 0 ? true : _props$isHoverSwitchi;
|
|
49
51
|
var addRef = useRef(null);
|
|
50
52
|
var _useState = useState({
|
|
51
53
|
x: 0,
|
|
@@ -137,7 +139,8 @@ function FilterDropDown(props) {
|
|
|
137
139
|
option: option,
|
|
138
140
|
index: index,
|
|
139
141
|
moveList: moveList,
|
|
140
|
-
checkedList: _checkedList
|
|
142
|
+
checkedList: _checkedList,
|
|
143
|
+
isHoverSwitching: isHoverSwitching
|
|
141
144
|
}));
|
|
142
145
|
} else {
|
|
143
146
|
checkOptions.push( /*#__PURE__*/React.createElement("div", {
|
|
@@ -175,11 +178,11 @@ function FilterDropDown(props) {
|
|
|
175
178
|
var renderDropdown = function renderDropdown() {
|
|
176
179
|
var style = {};
|
|
177
180
|
if (fixed) {
|
|
178
|
-
style.position =
|
|
181
|
+
style.position = "fixed";
|
|
179
182
|
style.top = XY.y;
|
|
180
183
|
style.lef = XY.x;
|
|
181
|
-
style.right =
|
|
182
|
-
style.bottom =
|
|
184
|
+
style.right = "initial";
|
|
185
|
+
style.bottom = "initial";
|
|
183
186
|
}
|
|
184
187
|
return /*#__PURE__*/React.createElement("div", {
|
|
185
188
|
className: classnames("cw-dropdown-content", dropdownClassName),
|
|
@@ -258,6 +261,10 @@ FilterDropDown.propTypes = {
|
|
|
258
261
|
/**
|
|
259
262
|
* 是否fixed定位
|
|
260
263
|
*/
|
|
261
|
-
fixed: PropTypes.bool
|
|
264
|
+
fixed: PropTypes.bool,
|
|
265
|
+
/**
|
|
266
|
+
* 开启拖拽后的交互模式,默认为true(true为悬停即交换,false为鼠标松开再交换)
|
|
267
|
+
*/
|
|
268
|
+
isHoverSwitching: PropTypes.bool
|
|
262
269
|
};
|
|
263
270
|
export default FilterDropDown;
|
|
@@ -31,6 +31,14 @@
|
|
|
31
31
|
padding: 6px 10px;
|
|
32
32
|
align-items: center;
|
|
33
33
|
cursor: move;
|
|
34
|
+
&.drop-over-downward{
|
|
35
|
+
border-bottom: @border-width-base dashed @primary-color;
|
|
36
|
+
padding-bottom: 5px;
|
|
37
|
+
}
|
|
38
|
+
&.drop-over-upward{
|
|
39
|
+
border-top: @border-width-base dashed @primary-color;
|
|
40
|
+
padding-top: 5px;
|
|
41
|
+
}
|
|
34
42
|
&:hover{
|
|
35
43
|
background-color: @primary-1;
|
|
36
44
|
}
|
|
@@ -35,7 +35,6 @@ var getDefaultPaddingLeft = function getDefaultPaddingLeft(size) {
|
|
|
35
35
|
return 9;
|
|
36
36
|
};
|
|
37
37
|
var InputComponent = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
38
|
-
var _classnames;
|
|
39
38
|
var _props$showCount = props.showCount,
|
|
40
39
|
showCount = _props$showCount === void 0 ? false : _props$showCount,
|
|
41
40
|
maxLength = props.maxLength,
|
|
@@ -141,7 +140,7 @@ var InputComponent = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
141
140
|
"cw-input-num-wrapper-disabled": resProps.disabled
|
|
142
141
|
})
|
|
143
142
|
}, /*#__PURE__*/React.createElement("span", {
|
|
144
|
-
className: classnames((
|
|
143
|
+
className: classnames(_defineProperty(_defineProperty(_defineProperty({}, "cw-input-num-init", valueLength == 0), "cw-input-num", valueLength > 0), "cw-input-num-error", dataCount && valueLength > dataCount))
|
|
145
144
|
}, valueLength), dataCount && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
146
145
|
className: "cw-input-line"
|
|
147
146
|
}, "/"), dataCount));
|
package/lib/Radio/Group.js
CHANGED
|
@@ -53,7 +53,6 @@ var RadioGroup = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
_defineProperty(_assertThisInitialized(_this), "renderGroup", function (_ref) {
|
|
56
|
-
var _classNames;
|
|
57
56
|
var getPrefixCls = _ref.getPrefixCls;
|
|
58
57
|
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
59
58
|
props = _assertThisInitialize.props;
|
|
@@ -66,7 +65,7 @@ var RadioGroup = /*#__PURE__*/function (_Component) {
|
|
|
66
65
|
render = props.render;
|
|
67
66
|
var prefixCls = getPrefixCls("radio", customizePrefixCls);
|
|
68
67
|
var groupPrefixCls = "".concat(prefixCls, "-group");
|
|
69
|
-
var classString = classNames(groupPrefixCls, "".concat(groupPrefixCls, "-").concat(buttonStyle), (
|
|
68
|
+
var classString = classNames(groupPrefixCls, "".concat(groupPrefixCls, "-").concat(buttonStyle), _defineProperty(_defineProperty({}, "".concat(groupPrefixCls, "-").concat(props.size), props.size), "".concat(groupPrefixCls, "-").concat(type), type == "radio_" ? true : false), className);
|
|
70
69
|
var children = props.children;
|
|
71
70
|
if (options && options.length > 0) {
|
|
72
71
|
children = options.map(function (option) {
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -47,7 +47,6 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
_defineProperty(_assertThisInitialized(_this), "renderRadio", function (_ref) {
|
|
50
|
-
var _classNames;
|
|
51
50
|
var getPrefixCls = _ref.getPrefixCls;
|
|
52
51
|
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
53
52
|
props = _assertThisInitialize.props,
|
|
@@ -70,7 +69,7 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
|
70
69
|
radioProps.checked = props.value === radioGroup.value;
|
|
71
70
|
radioProps.disabled = props.disabled || radioGroup.disabled;
|
|
72
71
|
}
|
|
73
|
-
var wrapperClassString = classNames(className, (
|
|
72
|
+
var wrapperClassString = classNames(className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-wrapper"), true), "".concat(prefixCls, "-radio_-wrapper"), newTypeExist), "".concat(prefixCls, "-wrapper-checked"), radioProps.checked), "".concat(prefixCls, "-wrapper-disabled"), radioProps.disabled), "".concat(prefixCls, "-radio_-wrapper-checked"), radioProps.checked && newTypeExist), "".concat(prefixCls, "-radio_-wrapper-disabled"), radioProps.disabled && newTypeExist), "".concat(prefixCls, "-radio_-wrapper-custom"), render));
|
|
74
73
|
return (
|
|
75
74
|
/*#__PURE__*/
|
|
76
75
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
@@ -1416,10 +1416,9 @@ function reroute() {
|
|
|
1416
1416
|
callCapturedEventListeners(eventArguments);
|
|
1417
1417
|
}
|
|
1418
1418
|
function getCustomEventDetail() {
|
|
1419
|
-
var _appsByNewStatus;
|
|
1420
1419
|
var isBeforeChanges = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1421
1420
|
var newAppStatuses = {};
|
|
1422
|
-
var appsByNewStatus = (
|
|
1421
|
+
var appsByNewStatus = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, MOUNTED, []), NOT_MOUNTED, []), NOT_LOADED, []), SKIP_BECAUSE_BROKEN, []);
|
|
1423
1422
|
if (isBeforeChanges) {
|
|
1424
1423
|
appsToLoad.concat(appsToMount).forEach(function (app, index) {
|
|
1425
1424
|
addApp(app, MOUNTED);
|
package/lib/TreeList/index.js
CHANGED
|
@@ -23,7 +23,6 @@ import './index.less';
|
|
|
23
23
|
* 树形结构列表,自定义列表样式和内容,异步加载交互等
|
|
24
24
|
*/
|
|
25
25
|
var TreeList = function TreeList(_ref) {
|
|
26
|
-
var _classNames;
|
|
27
26
|
var renderNode = _ref.renderNode,
|
|
28
27
|
loadData = _ref.loadData,
|
|
29
28
|
treeData = _ref.treeData,
|
|
@@ -135,7 +134,7 @@ var TreeList = function TreeList(_ref) {
|
|
|
135
134
|
}
|
|
136
135
|
updateExpandedKeys(key);
|
|
137
136
|
};
|
|
138
|
-
var wrapperClassName = classNames((
|
|
137
|
+
var wrapperClassName = classNames(_defineProperty(_defineProperty({}, 'cw-data-auth-tree', true), 'cw-data-auth-tree-no-data', treeData.length === 0));
|
|
139
138
|
if (_loading) {
|
|
140
139
|
return /*#__PURE__*/React.createElement("div", {
|
|
141
140
|
className: wrapperClassName
|
package/lib/Watermark/index.js
CHANGED
package/lib/message/index.js
CHANGED
|
@@ -73,7 +73,6 @@ function notice(args) {
|
|
|
73
73
|
return resolve(true);
|
|
74
74
|
};
|
|
75
75
|
getMessageInstance(function (instance) {
|
|
76
|
-
var _classnames;
|
|
77
76
|
var iconNode = /*#__PURE__*/React.createElement(_Icon, {
|
|
78
77
|
type: iconType,
|
|
79
78
|
theme: iconType === "loading" ? "outlined" : "filled",
|
|
@@ -90,9 +89,9 @@ function notice(args) {
|
|
|
90
89
|
"cw-message-wrapper-has-dec": args.dec
|
|
91
90
|
})
|
|
92
91
|
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
className: classnames((
|
|
92
|
+
className: classnames(_defineProperty(_defineProperty({
|
|
94
93
|
"cw-message-title": true
|
|
95
|
-
},
|
|
94
|
+
}, "".concat(prefixCls, "-custom-content"), true), "".concat(prefixCls, "-").concat(args.type), args.type))
|
|
96
95
|
}, args.icon ? args.icon : switchIconNode, /*#__PURE__*/React.createElement("span", {
|
|
97
96
|
className: "cw-message-content"
|
|
98
97
|
}, args.content), closable && /*#__PURE__*/React.createElement("span", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/ui",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.18",
|
|
4
4
|
"description": "公共UI库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"access": "public"
|
|
144
144
|
},
|
|
145
145
|
"license": "MIT",
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "1b7071c2f736571c56f999da6ab40658f1298c98"
|
|
147
147
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg width="7px" height="12px" viewBox="0 0 7 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
-
<title>形状</title>
|
|
4
|
-
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.65">
|
|
5
|
-
<g id="4.2请求列表下钻-—快照请求列表页" transform="translate(-1368.000000, -705.000000)" fill="#000000" fill-rule="nonzero">
|
|
6
|
-
<g id="编组-11" transform="translate(232.000000, 554.000000)">
|
|
7
|
-
<g id="默认" transform="translate(857.000000, 10.000000)">
|
|
8
|
-
<g id="源列表" transform="translate(143.000000, 34.000000)">
|
|
9
|
-
<g id="拖拽备份-3" transform="translate(132.000000, 105.000000)">
|
|
10
|
-
<path d="M9.91111111,2 C9.37777778,2 8.97777778,2.4 8.97777778,2.93333333 C8.97777778,3.46666666 9.42222222,3.86666667 9.91111111,3.86666667 C10.4444444,3.86666667 10.8444444,3.46666667 10.8444444,2.93333333 C10.8888889,2.4 10.4444444,2 9.91111111,2 Z M9.91111111,6.71111111 C9.37777778,6.71111111 8.97777778,7.11111111 8.97777778,7.64444444 C8.97777778,8.17777777 9.42222222,8.57777778 9.91111111,8.57777778 C10.4444444,8.57777778 10.8444444,8.17777778 10.8444444,7.64444444 C10.8888889,7.11111111 10.4444444,6.71111111 9.91111111,6.71111111 Z M9.91111111,11.4222222 C9.37777778,11.4222222 8.97777778,11.8222222 8.97777778,12.3555556 C8.97777778,12.8888889 9.42222222,13.2888889 9.91111111,13.2888889 C10.4444444,13.2888889 10.8444444,12.8888889 10.8444444,12.3555556 C10.8888889,11.8222222 10.4444444,11.4222222 9.91111111,11.4222222 C9.42222222,11.4222222 9.91111111,11.4222222 9.91111111,11.4222222 Z M5.82222222,2 C5.33333333,2 4.88888889,2.4 4.88888889,2.93333333 C4.88888889,3.46666666 5.33333333,3.86666667 5.82222222,3.86666667 C6.35555555,3.86666667 6.75555555,3.46666667 6.75555556,2.93333333 C6.8,2.4 6.35555556,2 5.82222222,2 Z M5.82222222,6.71111111 C5.28888889,6.71111111 4.88888889,7.11111111 4.88888889,7.64444444 C4.88888889,8.17777777 5.33333333,8.57777778 5.82222222,8.57777778 C6.35555555,8.57777778 6.75555555,8.17777778 6.75555556,7.64444444 C6.8,7.11111111 6.35555556,6.71111111 5.82222222,6.71111111 Z M5.82222222,11.4222222 C5.28888889,11.4222222 4.88888889,11.8222222 4.88888889,12.3555556 C4.88888889,12.8888889 5.33333333,13.2888889 5.82222222,13.2888889 C6.35555555,13.2888889 6.75555555,12.8888889 6.75555556,12.3555556 C6.8,11.8222222 6.35555556,11.4222222 5.82222222,11.4222222 Z" id="形状"></path>
|
|
11
|
-
</g>
|
|
12
|
-
</g>
|
|
13
|
-
</g>
|
|
14
|
-
</g>
|
|
15
|
-
</g>
|
|
16
|
-
</g>
|
|
17
|
-
</svg>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
-
import React, { Fragment } from 'react';
|
|
9
|
-
import TopicList from './TopicList';
|
|
10
|
-
import { DndProvider } from "react-dnd";
|
|
11
|
-
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
12
|
-
var CheckList = function CheckList(props) {
|
|
13
|
-
var checkValue = props.checkValue,
|
|
14
|
-
handleDelete = props.handleDelete,
|
|
15
|
-
handlePreviewList = props.handlePreviewList,
|
|
16
|
-
type = props.type,
|
|
17
|
-
render = props.render,
|
|
18
|
-
renderColumns = props.renderColumns,
|
|
19
|
-
dragList = props.dragList,
|
|
20
|
-
useDndProvider = props.useDndProvider;
|
|
21
|
-
var moveList = function moveList(dragIndex, hoverIndex) {
|
|
22
|
-
var tmp = checkValue[dragIndex]; //临时储存文件
|
|
23
|
-
checkValue.splice(dragIndex, 1); //移除拖拽项
|
|
24
|
-
checkValue.splice(hoverIndex, 0, tmp); //插入放置项
|
|
25
|
-
handlePreviewList(_toConsumableArray(checkValue)); //更新修改后的列表
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var isLockSort = type === "list" && checkValue.filter(function (item) {
|
|
29
|
-
return item.disabled;
|
|
30
|
-
}).length;
|
|
31
|
-
var renderList = function renderList(item, index) {
|
|
32
|
-
return /*#__PURE__*/React.createElement(TopicList, _extends({
|
|
33
|
-
labelValue: item,
|
|
34
|
-
type: type,
|
|
35
|
-
renderColumns: renderColumns,
|
|
36
|
-
label: item.key,
|
|
37
|
-
value: item.title && item.title,
|
|
38
|
-
index: index,
|
|
39
|
-
render: render,
|
|
40
|
-
key: item.key,
|
|
41
|
-
handleDelete: handleDelete,
|
|
42
|
-
moveList: moveList,
|
|
43
|
-
dragList: dragList,
|
|
44
|
-
useDndProvider: useDndProvider,
|
|
45
|
-
isLockSort: isLockSort
|
|
46
|
-
}, item));
|
|
47
|
-
};
|
|
48
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(DndProvider, {
|
|
49
|
-
backend: HTML5Backend
|
|
50
|
-
}, checkValue.map(function (item, index) {
|
|
51
|
-
return renderList(item, index);
|
|
52
|
-
})));
|
|
53
|
-
};
|
|
54
|
-
export default CheckList;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
2
|
-
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
3
|
-
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
4
|
-
import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
|
|
5
|
-
var _excluded = ["label", "value", "index", "handleDelete", "labelValue", "moveList", "type", "renderColumns", "render", "dragList", "disabled", "isLockSort"];
|
|
6
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
-
import React, { Fragment, useRef } from "react";
|
|
16
|
-
import { useDrag, useDrop } from "react-dnd";
|
|
17
|
-
import classnames from "classnames";
|
|
18
|
-
import { getLocale } from "./locale";
|
|
19
|
-
import LockSvg from "./assets/LockSvg";
|
|
20
|
-
import DragSvg from "./assets/DragSvg";
|
|
21
|
-
var TopicList = function TopicList(_ref) {
|
|
22
|
-
var label = _ref.label,
|
|
23
|
-
value = _ref.value,
|
|
24
|
-
index = _ref.index,
|
|
25
|
-
handleDelete = _ref.handleDelete,
|
|
26
|
-
labelValue = _ref.labelValue,
|
|
27
|
-
moveList = _ref.moveList,
|
|
28
|
-
type = _ref.type,
|
|
29
|
-
renderColumns = _ref.renderColumns,
|
|
30
|
-
render = _ref.render,
|
|
31
|
-
dragList = _ref.dragList,
|
|
32
|
-
disabled = _ref.disabled,
|
|
33
|
-
isLockSort = _ref.isLockSort,
|
|
34
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
// 获取当前语言
|
|
36
|
-
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
37
|
-
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
38
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
39
|
-
var localeObj = getLocale(locale);
|
|
40
|
-
var dragRef = useRef(null);
|
|
41
|
-
var _useDrag = useDrag({
|
|
42
|
-
item: {
|
|
43
|
-
type: "child",
|
|
44
|
-
value: value,
|
|
45
|
-
index: index,
|
|
46
|
-
label: label,
|
|
47
|
-
labelValue: labelValue
|
|
48
|
-
}
|
|
49
|
-
}),
|
|
50
|
-
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
51
|
-
drag = _useDrag2[1];
|
|
52
|
-
var _useDrop = useDrop({
|
|
53
|
-
accept: "child",
|
|
54
|
-
hover: function hover(item, monitor) {
|
|
55
|
-
//拖拽目标的Index
|
|
56
|
-
var dragIndex = item.index;
|
|
57
|
-
//放置目标Index
|
|
58
|
-
var hoverIndex = index;
|
|
59
|
-
// 如果拖拽目标和放置目标相同的话,停止执行
|
|
60
|
-
if (dragIndex === hoverIndex) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
//如果不做以下处理,则卡片移动到另一个卡片上就会进行交换,下方处理使得卡片能够在跨过中心线后进行交换.
|
|
64
|
-
//获取卡片的边框矩形
|
|
65
|
-
// const hoverBoundingRect = dragRef.current.getBoundingClientRect();
|
|
66
|
-
// //获取X轴中点
|
|
67
|
-
// const hoverMiddleY =
|
|
68
|
-
// (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
69
|
-
// //获取拖拽目标偏移量
|
|
70
|
-
// const clientOffset = monitor.getClientOffset();
|
|
71
|
-
// const hoverClientY = clientOffset.y - hoverBoundingRect.top;
|
|
72
|
-
// 从上往下放置
|
|
73
|
-
// if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {
|
|
74
|
-
// return;
|
|
75
|
-
// }
|
|
76
|
-
// // 从下往上放置
|
|
77
|
-
// if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
|
|
78
|
-
// return;
|
|
79
|
-
// }
|
|
80
|
-
moveList(dragIndex, hoverIndex); //调用方法完成交换
|
|
81
|
-
item.index = hoverIndex; //重新赋值index,否则会出现无限交换情况
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
collect: function collect(monitor) {
|
|
85
|
-
var _ref2 = monitor.getItem() || {},
|
|
86
|
-
dragIndex = _ref2.index;
|
|
87
|
-
if (dragIndex === index) {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
isOver: monitor.isOver(),
|
|
92
|
-
dropClassName: dragIndex < index ? "drop-over-downward" : "drop-over-upward"
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
// drop: (item) => {
|
|
96
|
-
// moveList(item.index, index);
|
|
97
|
-
// },
|
|
98
|
-
}),
|
|
99
|
-
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
100
|
-
_useDrop2$ = _useDrop2[0],
|
|
101
|
-
isOver = _useDrop2$.isOver,
|
|
102
|
-
dropClassName = _useDrop2$.dropClassName,
|
|
103
|
-
drop = _useDrop2[1];
|
|
104
|
-
var handleDeleted = function handleDeleted(labelValue) {
|
|
105
|
-
handleDelete(labelValue);
|
|
106
|
-
};
|
|
107
|
-
var renderTable = function renderTable(labelValue) {
|
|
108
|
-
return /*#__PURE__*/React.createElement("div", null, renderColumns.map(function (item, index) {
|
|
109
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
110
|
-
style: {
|
|
111
|
-
marginRight: "8px"
|
|
112
|
-
},
|
|
113
|
-
key: index
|
|
114
|
-
}, render(labelValue[item]));
|
|
115
|
-
}));
|
|
116
|
-
};
|
|
117
|
-
var dragProps = dragList && !disabled ? {
|
|
118
|
-
ref: drag(drop(dragRef)),
|
|
119
|
-
style: {
|
|
120
|
-
cursor: "move"
|
|
121
|
-
}
|
|
122
|
-
} : {};
|
|
123
|
-
var listLockSortContent = /*#__PURE__*/React.createElement("div", {
|
|
124
|
-
className: "cw-transfer-right-content-item"
|
|
125
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className: "cw-transfer-right-content-item-drag-wrapper"
|
|
127
|
-
}, disabled ? /*#__PURE__*/React.createElement(LockSvg, null) : /*#__PURE__*/React.createElement(_Tooltip, {
|
|
128
|
-
title: localeObj["dragAndDrop"]
|
|
129
|
-
}, /*#__PURE__*/React.createElement(DragSvg, null))), /*#__PURE__*/React.createElement("div", {
|
|
130
|
-
className: "cw-transfer-right-content-item-text-wrapper"
|
|
131
|
-
}, render(value)), !disabled && /*#__PURE__*/React.createElement(_Icon, {
|
|
132
|
-
type: "close",
|
|
133
|
-
className: "cw-transfer-right-content-del",
|
|
134
|
-
onClick: function onClick() {
|
|
135
|
-
return handleDeleted(labelValue);
|
|
136
|
-
}
|
|
137
|
-
}));
|
|
138
|
-
var renderItemContent = type == "list" && isLockSort ? listLockSortContent : /*#__PURE__*/React.createElement(Fragment, null, dragList && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
139
|
-
title: localeObj["dragAndDrop"]
|
|
140
|
-
}, /*#__PURE__*/React.createElement(DragSvg, {
|
|
141
|
-
className: "cw-transfer-right-content-drag"
|
|
142
|
-
})), /*#__PURE__*/React.createElement("div", null, type === "table" ? renderTable(labelValue) : render(value)), /*#__PURE__*/React.createElement(_Icon, {
|
|
143
|
-
type: "close",
|
|
144
|
-
className: "cw-transfer-right-content-del",
|
|
145
|
-
onClick: function onClick() {
|
|
146
|
-
return handleDeleted(labelValue);
|
|
147
|
-
}
|
|
148
|
-
}));
|
|
149
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
150
|
-
className: classnames("cw-transfer-right-content-main")
|
|
151
|
-
}, dragProps), renderItemContent));
|
|
152
|
-
};
|
|
153
|
-
export default TopicList;
|