@chaoswise/ui 2.3.16 → 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/README.md +1 -1
- 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/CWRangePicker/utils/index.js +28 -6
- package/lib/CWSelect/antd-select.js +1 -2
- package/lib/CWTable/CWTable.js +15 -11
- 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/assets/ShowSvgIcon.js +14 -0
- package/lib/FilterDropDown/index.js +21 -9
- 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/context.js +22 -0
- package/lib/Watermark/index.js +306 -0
- package/lib/Watermark/useClips.js +118 -0
- package/lib/Watermark/useRafDebounce.js +21 -0
- package/lib/Watermark/useWatermark.js +52 -0
- package/lib/Watermark/utils.js +42 -0
- package/lib/message/index.js +2 -3
- package/package.json +3 -2
- package/lib/FilterDropDown/drag.svg +0 -17
- package/lib/QuickTransfer/CheckList.js +0 -54
- package/lib/QuickTransfer/TopicList.js +0 -153
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
基于antd3.x根据公司UIUE规范进行二次封装的前端公共组件库,用于统一公司产品风格,提高研发人员开发效率
|
|
6
6
|
|
|
7
7
|
# Features
|
|
8
|
-
#### 1. 包含符合UIUE
|
|
8
|
+
#### 1. 包含符合UIUE设计规范的公共组件,设计规范和使用规范参考[YXD-用户体验设计平台](https://yunzhihui.feishu.cn/wiki/wikcnkFSNhaqVDdYNNH5K6NNy7f)
|
|
9
9
|
#### 2. 支持antd全部组件,引用和使用方法参考[antd官方文档](https://3x.ant.design/docs/react/introduce-cn)
|
|
10
10
|
#### 3. 支持按需加载
|
|
11
11
|
|
|
@@ -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) {
|
|
@@ -297,14 +297,36 @@ export var cloneChangeDate = function cloneChangeDate(currentDate_0, currentDate
|
|
|
297
297
|
cloneCurrentDate_1 = moment();
|
|
298
298
|
switchInitial = true;
|
|
299
299
|
} else {
|
|
300
|
-
// 非极限时间,但是超过最大的时间边界跨度
|
|
301
|
-
// 先将currentDate_0和currentDate_1二者进行相减在这个基础上增加(timeSpanBoundary - 二者相减) / 2 ,左右各增加减少这个数值
|
|
302
|
-
var initialTimeDiff = computeTimeDiff([cloneCurrentDate_0, cloneCurrentDate_1], "s");
|
|
303
|
-
var needChangeTimeDiff = Math.ceil(initialTimeDiff - timeSpanBoundary) / 2;
|
|
304
300
|
var clone0 = currentDate_0.clone();
|
|
305
301
|
var clone1 = currentDate_1.clone();
|
|
306
|
-
|
|
307
|
-
|
|
302
|
+
var initialTimeDiff = computeTimeDiff([clone0, clone1], "s");
|
|
303
|
+
if (timeSpanBoundary > initialTimeDiff) {
|
|
304
|
+
var needChangeTimeDiff = Math.ceil(timeSpanBoundary - initialTimeDiff) / 2;
|
|
305
|
+
cloneCurrentDate_0 = clone0.subtract(moment.duration(needChangeTimeDiff, "s"));
|
|
306
|
+
cloneCurrentDate_1 = clone1.add(moment.duration(needChangeTimeDiff, "s"));
|
|
307
|
+
// 计算最大值的时间差
|
|
308
|
+
var _maxTimeDiff2 = computeTimeDiff([cloneCurrentDate_1, moment()]);
|
|
309
|
+
if (_maxTimeDiff2 <= 0) {
|
|
310
|
+
// 当前时间已经是极限了
|
|
311
|
+
// 已经是极限直接当前时间向前推进timeSpanBoundary即可
|
|
312
|
+
cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, "s"));
|
|
313
|
+
cloneCurrentDate_1 = moment();
|
|
314
|
+
switchInitial = true;
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
cloneCurrentDate_1 = clone1.add(moment.duration(timeSpanBoundary, "s"));
|
|
318
|
+
var clone = cloneCurrentDate_1.clone();
|
|
319
|
+
cloneCurrentDate_0 = clone.subtract(moment.duration(timeSpanBoundary, "s"));
|
|
320
|
+
// 计算最大值的时间差
|
|
321
|
+
var _maxTimeDiff3 = computeTimeDiff([cloneCurrentDate_1, moment()]);
|
|
322
|
+
if (_maxTimeDiff3 <= 0) {
|
|
323
|
+
// 当前时间已经是极限了
|
|
324
|
+
// 已经是极限直接当前时间向前推进timeSpanBoundary即可
|
|
325
|
+
cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, "s"));
|
|
326
|
+
cloneCurrentDate_1 = moment();
|
|
327
|
+
switchInitial = true;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
308
330
|
}
|
|
309
331
|
} else {
|
|
310
332
|
if (_maxTimeDiff <= 0) {
|
|
@@ -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/CWTable/CWTable.js
CHANGED
|
@@ -239,14 +239,17 @@ var CWTable = function CWTable(_ref, ref) {
|
|
|
239
239
|
var resetSortDataSource = function resetSortDataSource() {
|
|
240
240
|
var _dataSource = _toConsumableArray(dataSource);
|
|
241
241
|
if (frontPagination) {
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
var _current = pagination.current,
|
|
243
|
+
_pageSize = pagination.pageSize,
|
|
244
|
+
_total = pagination.total;
|
|
245
|
+
var current = _current || pageInfo.current;
|
|
246
|
+
var pageSize = _pageSize || pageInfo.pageSize;
|
|
247
|
+
var total = _total || dataSource.length;
|
|
245
248
|
_dataSource = _dataSource.slice((current - 1) * pageSize, current * pageSize > total ? total : current * pageSize);
|
|
246
249
|
}
|
|
247
250
|
setFinalDataSource(_dataSource);
|
|
248
251
|
};
|
|
249
|
-
useEffect(resetSortDataSource, [frontPagination, pageInfo.current, pageInfo.pageSize, dataSource]);
|
|
252
|
+
useEffect(resetSortDataSource, [frontPagination, pagination, pageInfo.current, pageInfo.pageSize, dataSource]);
|
|
250
253
|
useEffect(function () {
|
|
251
254
|
if (!autoHeight) {
|
|
252
255
|
return;
|
|
@@ -652,13 +655,14 @@ var CWTable = function CWTable(_ref, ref) {
|
|
|
652
655
|
onShowSizeChange: onShowSizeChange,
|
|
653
656
|
size: size == 'small' ? 'small' : ''
|
|
654
657
|
});
|
|
655
|
-
if (frontPagination) {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
658
|
+
// if (frontPagination) {
|
|
659
|
+
// return {
|
|
660
|
+
// ...common,
|
|
661
|
+
// current: pageInfo.current,
|
|
662
|
+
// pageSize: pageInfo.pageSize,
|
|
663
|
+
// total: dataSource.length,
|
|
664
|
+
// }
|
|
665
|
+
// }
|
|
662
666
|
return _objectSpread(_objectSpread({}, common), {}, {
|
|
663
667
|
current: current || pageInfo.current,
|
|
664
668
|
pageSize: pageSize || pageInfo.pageSize,
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
import * as React from "react";
|
|
3
|
+
var SvgShowIcon = function SvgShowIcon(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: 14,
|
|
7
|
+
height: 14
|
|
8
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "m7.778.922.308.047.036.007a.439.439 0 0 1 .333.277l.02.075.215 1.162c.396.148.768.348 1.111.594l.252.193 1.111-.395a.44.44 0 0 1 .416.068l.064.062.025.029c.408.48.735 1.015.976 1.593l.114.292.012.036c.051.143.025.3-.066.416l-.061.065-.896.765c.028.174.048.35.057.526l.003.11h-.982a3.875 3.875 0 0 0-.02-.266l-.028-.208-.09-.546 1.022-.873a5.208 5.208 0 0 0-.415-.767l-.167-.24-1.27.45-.429-.353a3.844 3.844 0 0 0-.852-.53l-.232-.096-.52-.195-.245-1.326a5.169 5.169 0 0 0-.873-.025l-.29.025-.244 1.328-.518.196a3.814 3.814 0 0 0-.877.472l-.2.153-.429.354-1.277-.454a5.095 5.095 0 0 0-.458.742l-.124.264 1.032.882-.089.547a3.769 3.769 0 0 0-.027 1.038l.027.206.09.547-1.033.882c.117.266.255.523.415.767l.167.239 1.277-.454.43.354c.259.214.543.39.845.529l.23.096.517.198.245 1.33c.182.02.365.03.549.032v.98a6.145 6.145 0 0 1-.705-.044l-.348-.053-.037-.007a.439.439 0 0 1-.332-.277l-.02-.074-.217-1.168a4.754 4.754 0 0 1-1.146-.623l-.207-.161-1.12.398a.44.44 0 0 1-.416-.069l-.064-.061-.025-.03a6.077 6.077 0 0 1-.976-1.592l-.113-.292-.013-.036a.439.439 0 0 1 .066-.417l.062-.064.906-.774a4.786 4.786 0 0 1-.035-1.303l.035-.258-.906-.774a.44.44 0 0 1-.15-.395l.022-.086.013-.036a6.09 6.09 0 0 1 .892-1.64l.197-.245.025-.03a.437.437 0 0 1 .393-.15l.087.021 1.12.398c.325-.268.682-.49 1.063-.664l.29-.12.216-1.168a.438.438 0 0 1 .279-.331l.074-.02.037-.008A6.185 6.185 0 0 1 7.778.922Zm4.833 10.844a.5.5 0 1 1 0 1h-4.5a.5.5 0 1 1 0-1h4.5Zm0-2a.5.5 0 1 1 0 1h-4.5a.5.5 0 1 1 0-1h4.5ZM7 4.457c1.274 0 2.316.99 2.4 2.242l.005.145H8.53a1.522 1.522 0 0 0-.346-.95l-.102-.114A1.52 1.52 0 0 0 7 5.332a1.52 1.52 0 0 0-1.083.448c-.288.29-.448.674-.448 1.083a1.526 1.526 0 0 0 1.38 1.524l.116.005v.877a2.406 2.406 0 0 1-2.366-2.241l-.005-.165A2.406 2.406 0 0 1 7 4.457Zm5.611 3.309a.5.5 0 1 1 0 1h-4.5a.5.5 0 1 1 0-1h4.5Z"
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
export default SvgShowIcon;
|
|
@@ -22,8 +22,10 @@ import classnames from "classnames";
|
|
|
22
22
|
import PropTypes from "prop-types";
|
|
23
23
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
24
24
|
import { DndProvider } from "react-dnd";
|
|
25
|
-
import "./index.less";
|
|
26
25
|
import { getLocale } from "./locale";
|
|
26
|
+
import useConfigContext from "../useConfigContext";
|
|
27
|
+
import ShowSvgIcon from "./assets/ShowSvgIcon";
|
|
28
|
+
import "./index.less";
|
|
27
29
|
var CheckboxGroup = _Checkbox.Group;
|
|
28
30
|
function FilterDropDown(props) {
|
|
29
31
|
var selectItems = props.selectItems,
|
|
@@ -43,7 +45,9 @@ function FilterDropDown(props) {
|
|
|
43
45
|
dropdownClassName = props.dropdownClassName,
|
|
44
46
|
_props$isShowSelectAl = props.isShowSelectAll,
|
|
45
47
|
isShowSelectAll = _props$isShowSelectAl === void 0 ? true : _props$isShowSelectAl,
|
|
46
|
-
fixed = props.fixed
|
|
48
|
+
fixed = props.fixed,
|
|
49
|
+
_props$isHoverSwitchi = props.isHoverSwitching,
|
|
50
|
+
isHoverSwitching = _props$isHoverSwitchi === void 0 ? true : _props$isHoverSwitchi;
|
|
47
51
|
var addRef = useRef(null);
|
|
48
52
|
var _useState = useState({
|
|
49
53
|
x: 0,
|
|
@@ -68,6 +72,9 @@ function FilterDropDown(props) {
|
|
|
68
72
|
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
69
73
|
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
70
74
|
var localeObj = getLocale(locale);
|
|
75
|
+
var _useConfigContext = useConfigContext(),
|
|
76
|
+
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
77
|
+
var prefixCls = getPrefixCls();
|
|
71
78
|
useEffect(function () {
|
|
72
79
|
document.addEventListener("click", clickBody);
|
|
73
80
|
return function () {
|
|
@@ -132,7 +139,8 @@ function FilterDropDown(props) {
|
|
|
132
139
|
option: option,
|
|
133
140
|
index: index,
|
|
134
141
|
moveList: moveList,
|
|
135
|
-
checkedList: _checkedList
|
|
142
|
+
checkedList: _checkedList,
|
|
143
|
+
isHoverSwitching: isHoverSwitching
|
|
136
144
|
}));
|
|
137
145
|
} else {
|
|
138
146
|
checkOptions.push( /*#__PURE__*/React.createElement("div", {
|
|
@@ -170,11 +178,11 @@ function FilterDropDown(props) {
|
|
|
170
178
|
var renderDropdown = function renderDropdown() {
|
|
171
179
|
var style = {};
|
|
172
180
|
if (fixed) {
|
|
173
|
-
style.position =
|
|
181
|
+
style.position = "fixed";
|
|
174
182
|
style.top = XY.y;
|
|
175
183
|
style.lef = XY.x;
|
|
176
|
-
style.right =
|
|
177
|
-
style.bottom =
|
|
184
|
+
style.right = "initial";
|
|
185
|
+
style.bottom = "initial";
|
|
178
186
|
}
|
|
179
187
|
return /*#__PURE__*/React.createElement("div", {
|
|
180
188
|
className: classnames("cw-dropdown-content", dropdownClassName),
|
|
@@ -199,8 +207,8 @@ function FilterDropDown(props) {
|
|
|
199
207
|
onClick: toggoleShow,
|
|
200
208
|
ref: addRef
|
|
201
209
|
}, colsFilterTitle ? colsFilterTitle : /*#__PURE__*/React.createElement(_Button, {
|
|
202
|
-
|
|
203
|
-
})), showList && /*#__PURE__*/React.createElement(Fragment, null, isDrag ? /*#__PURE__*/React.createElement(DndProvider, {
|
|
210
|
+
className: "".concat(prefixCls, "-btn-icon-only")
|
|
211
|
+
}, /*#__PURE__*/React.createElement(ShowSvgIcon, null))), showList && /*#__PURE__*/React.createElement(Fragment, null, isDrag ? /*#__PURE__*/React.createElement(DndProvider, {
|
|
204
212
|
backend: HTML5Backend
|
|
205
213
|
}, renderDropdown()) : /*#__PURE__*/React.createElement(Fragment, null, renderDropdown())));
|
|
206
214
|
}
|
|
@@ -253,6 +261,10 @@ FilterDropDown.propTypes = {
|
|
|
253
261
|
/**
|
|
254
262
|
* 是否fixed定位
|
|
255
263
|
*/
|
|
256
|
-
fixed: PropTypes.bool
|
|
264
|
+
fixed: PropTypes.bool,
|
|
265
|
+
/**
|
|
266
|
+
* 开启拖拽后的交互模式,默认为true(true为悬停即交换,false为鼠标松开再交换)
|
|
267
|
+
*/
|
|
268
|
+
isHoverSwitching: PropTypes.bool
|
|
257
269
|
};
|
|
258
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));
|