@chaoswise/ui 2.2.8 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/lib/AbreastLayout/index.js +5 -1
  2. package/lib/BasicLayout/Sider.js +8 -3
  3. package/lib/BasicLayout/index.js +10 -2
  4. package/lib/CWCascader/Cascader/index.js +207 -0
  5. package/lib/CWCascader/index.js +5 -0
  6. package/lib/CWCascader/index.less +9 -0
  7. package/lib/CWCascader/rc-cascader/Cascader.js +329 -0
  8. package/lib/CWCascader/rc-cascader/OptionList/Checkbox.js +22 -0
  9. package/lib/CWCascader/rc-cascader/OptionList/Column.js +209 -0
  10. package/lib/CWCascader/rc-cascader/OptionList/index.js +215 -0
  11. package/lib/CWCascader/rc-cascader/OptionList/useActive.js +33 -0
  12. package/lib/CWCascader/rc-cascader/OptionList/useKeyboard.js +177 -0
  13. package/lib/CWCascader/rc-cascader/context.js +3 -0
  14. package/lib/CWCascader/rc-cascader/hooks/useDisplayValues.js +56 -0
  15. package/lib/CWCascader/rc-cascader/hooks/useEntities.js +48 -0
  16. package/lib/CWCascader/rc-cascader/hooks/useMissingValues.js +19 -0
  17. package/lib/CWCascader/rc-cascader/hooks/useRefFunc.js +13 -0
  18. package/lib/CWCascader/rc-cascader/hooks/useSearchConfig.js +30 -0
  19. package/lib/CWCascader/rc-cascader/hooks/useSearchOptions.js +74 -0
  20. package/lib/CWCascader/rc-cascader/index.js +2 -0
  21. package/lib/CWCascader/rc-cascader/utils/commonUtil.js +54 -0
  22. package/lib/CWCascader/rc-cascader/utils/treeUtil.js +37 -0
  23. package/lib/CWCascader/rc-cascader/utils/warningPropsUtil.js +30 -0
  24. package/lib/CWMessage/index.js +3 -1
  25. package/lib/CWMessage/index.less +3 -0
  26. package/lib/CWRangePicker/index.js +6 -1
  27. package/lib/CWSelect/index.js +9 -1
  28. package/lib/CWSelect/index.less +10 -0
  29. package/lib/Cascader/index.js +0 -8
  30. package/lib/Cascader/index.less +5 -0
  31. package/lib/Cascaders/Cascader/index.js +208 -0
  32. package/lib/Cascaders/index.js +17 -0
  33. package/lib/Cascaders/index.less +1 -0
  34. package/lib/Cascaders/rc-cascader/Cascader.js +326 -0
  35. package/lib/Cascaders/rc-cascader/OptionList/Checkbox.js +22 -0
  36. package/lib/Cascaders/rc-cascader/OptionList/Column.js +203 -0
  37. package/lib/Cascaders/rc-cascader/OptionList/index.js +213 -0
  38. package/lib/Cascaders/rc-cascader/OptionList/useActive.js +33 -0
  39. package/lib/Cascaders/rc-cascader/OptionList/useKeyboard.js +171 -0
  40. package/lib/Cascaders/rc-cascader/context.js +3 -0
  41. package/lib/Cascaders/rc-cascader/hooks/useDisplayValues.js +56 -0
  42. package/lib/Cascaders/rc-cascader/hooks/useEntities.js +34 -0
  43. package/lib/Cascaders/rc-cascader/hooks/useMissingValues.js +19 -0
  44. package/lib/Cascaders/rc-cascader/hooks/useRefFunc.js +13 -0
  45. package/lib/Cascaders/rc-cascader/hooks/useSearchConfig.js +25 -0
  46. package/lib/Cascaders/rc-cascader/hooks/useSearchOptions.js +72 -0
  47. package/lib/Cascaders/rc-cascader/index.js +2 -0
  48. package/lib/Cascaders/rc-cascader/utils/commonUtil.js +54 -0
  49. package/lib/Cascaders/rc-cascader/utils/treeUtil.js +37 -0
  50. package/lib/Cascaders/rc-cascader/utils/warningPropsUtil.js +30 -0
  51. package/lib/CitySelect/index.js +2 -2
  52. package/lib/QuickTransfer/NotDragList.js +1 -4
  53. package/lib/QuickTransfer/TopicList.js +2 -4
  54. package/package.json +3 -3
@@ -0,0 +1,56 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
+ import { toPathOptions } from '../utils/treeUtil';
9
+ import * as React from 'react';
10
+ import { toPathKey } from '../utils/commonUtil';
11
+ export default (function (rawValues, options, fieldNames, multiple, displayRender) {
12
+ return React.useMemo(function () {
13
+ var mergedDisplayRender = displayRender ||
14
+ // Default displayRender
15
+ function (labels) {
16
+ var mergedLabels = multiple ? labels.slice(-1) : labels;
17
+ var SPLIT = ' / ';
18
+ if (mergedLabels.every(function (label) {
19
+ return ['string', 'number'].includes(_typeof(label));
20
+ })) {
21
+ return mergedLabels.join(SPLIT);
22
+ }
23
+ // If exist non-string value, use ReactNode instead
24
+ return mergedLabels.reduce(function (list, label, index) {
25
+ var keyedLabel = /*#__PURE__*/React.isValidElement(label) ? /*#__PURE__*/React.cloneElement(label, {
26
+ key: index
27
+ }) : label;
28
+ if (index === 0) {
29
+ return [keyedLabel];
30
+ }
31
+ return [].concat(_toConsumableArray(list), [SPLIT, keyedLabel]);
32
+ }, []);
33
+ };
34
+ return rawValues.map(function (valueCells) {
35
+ var _a, _b;
36
+ var valueOptions = toPathOptions(valueCells, options, fieldNames);
37
+ var label = mergedDisplayRender(valueOptions.map(function (_ref) {
38
+ var option = _ref.option,
39
+ value = _ref.value;
40
+ var _a;
41
+ return (_a = option === null || option === void 0 ? void 0 : option[fieldNames.label]) !== null && _a !== void 0 ? _a : value;
42
+ }), valueOptions.map(function (_ref2) {
43
+ var option = _ref2.option;
44
+ return option;
45
+ }));
46
+ var value = toPathKey(valueCells);
47
+ return {
48
+ label: label,
49
+ value: value,
50
+ key: value,
51
+ valueCells: valueCells,
52
+ disabled: (_b = (_a = valueOptions[valueOptions.length - 1]) === null || _a === void 0 ? void 0 : _a.option) === null || _b === void 0 ? void 0 : _b.disabled
53
+ };
54
+ });
55
+ }, [rawValues, options, fieldNames, displayRender, multiple]);
56
+ });
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ import { convertDataToEntities } from 'rc-cascader/node_modules/rc-tree/lib/utils/treeUtil';
3
+ import { VALUE_SPLIT } from '../utils/commonUtil';
4
+ /** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
5
+ export default (function (options, fieldNames) {
6
+ var cacheRef = React.useRef({
7
+ options: null,
8
+ info: null
9
+ });
10
+ var getEntities = React.useCallback(function () {
11
+ if (cacheRef.current.options !== options) {
12
+ cacheRef.current.options = options;
13
+ cacheRef.current.info = convertDataToEntities(options, {
14
+ fieldNames: fieldNames,
15
+ initWrapper: function initWrapper(wrapper) {
16
+ return Object.assign(Object.assign({}, wrapper), {
17
+ pathKeyEntities: {}
18
+ });
19
+ },
20
+ processEntity: function processEntity(entity, wrapper) {
21
+ var pathKey = entity.nodes.map(function (node) {
22
+ return node[fieldNames.value];
23
+ }).join(VALUE_SPLIT);
24
+ wrapper.pathKeyEntities[pathKey] = entity;
25
+ // Overwrite origin key.
26
+ // this is very hack but we need let conduct logic work with connect path
27
+ entity.key = pathKey;
28
+ }
29
+ });
30
+ }
31
+ return cacheRef.current.info.pathKeyEntities;
32
+ }, [fieldNames, options]);
33
+ return getEntities;
34
+ });
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { toPathOptions } from '../utils/treeUtil';
3
+ export default (function (options, fieldNames) {
4
+ return React.useCallback(function (rawValues) {
5
+ var missingValues = [];
6
+ var existsValues = [];
7
+ rawValues.forEach(function (valueCell) {
8
+ var pathOptions = toPathOptions(valueCell, options, fieldNames);
9
+ if (pathOptions.every(function (opt) {
10
+ return opt.option;
11
+ })) {
12
+ existsValues.push(valueCell);
13
+ } else {
14
+ missingValues.push(valueCell);
15
+ }
16
+ });
17
+ return [existsValues, missingValues];
18
+ }, [options, fieldNames]);
19
+ });
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Same as `React.useCallback` but always return a memoized function
4
+ * but redirect to real function.
5
+ */
6
+ export default function useRefFunc(callback) {
7
+ var funcRef = React.useRef();
8
+ funcRef.current = callback;
9
+ var cacheFn = React.useCallback(function () {
10
+ return funcRef.current.apply(funcRef, arguments);
11
+ }, []);
12
+ return cacheFn;
13
+ }
@@ -0,0 +1,25 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ import * as React from 'react';
3
+ import warning from 'rc-util/lib/warning';
4
+ // Convert `showSearch` to unique config
5
+ export default function useSearchConfig(showSearch) {
6
+ return React.useMemo(function () {
7
+ if (!showSearch) {
8
+ return [false, {}];
9
+ }
10
+ var searchConfig = {
11
+ matchInputWidth: true,
12
+ limit: 50
13
+ };
14
+ if (showSearch && _typeof(showSearch) === 'object') {
15
+ searchConfig = Object.assign(Object.assign({}, searchConfig), showSearch);
16
+ }
17
+ if (searchConfig.limit <= 0) {
18
+ delete searchConfig.limit;
19
+ if (process.env.NODE_ENV !== 'production') {
20
+ warning(false, "'limit' of showSearch should be positive number or false.");
21
+ }
22
+ }
23
+ return [true, searchConfig];
24
+ }, [showSearch]);
25
+ }
@@ -0,0 +1,72 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ 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); }
5
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
+ 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."); }
7
+ 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); }
8
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
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
+ import * as React from 'react';
12
+ export var SEARCH_MARK = '__rc_cascader_search_mark__';
13
+ var defaultFilter = function defaultFilter(search, options, _ref) {
14
+ var label = _ref.label;
15
+ return options.some(function (opt) {
16
+ return String(opt[label]).toLowerCase().includes(search.toLowerCase());
17
+ });
18
+ };
19
+ var defaultRender = function defaultRender(inputValue, path, prefixCls, fieldNames) {
20
+ return path.map(function (opt) {
21
+ return opt[fieldNames.label];
22
+ }).join(' / ');
23
+ };
24
+ export default (function (search, options, fieldNames, prefixCls, config, changeOnSelect) {
25
+ var _config$filter = config.filter,
26
+ filter = _config$filter === void 0 ? defaultFilter : _config$filter,
27
+ _config$render = config.render,
28
+ render = _config$render === void 0 ? defaultRender : _config$render,
29
+ _config$limit = config.limit,
30
+ limit = _config$limit === void 0 ? 50 : _config$limit,
31
+ sort = config.sort;
32
+ return React.useMemo(function () {
33
+ var filteredOptions = [];
34
+ if (!search) {
35
+ return [];
36
+ }
37
+ function dig(list, pathOptions) {
38
+ list.forEach(function (option) {
39
+ // Perf saving when `sort` is disabled and `limit` is provided
40
+ if (!sort && limit > 0 && filteredOptions.length >= limit) {
41
+ return;
42
+ }
43
+ var connectedPathOptions = [].concat(_toConsumableArray(pathOptions), [option]);
44
+ var children = option[fieldNames.children];
45
+ // If current option is filterable
46
+ if (
47
+ // If is leaf option
48
+ !children || children.length === 0 ||
49
+ // If is changeOnSelect
50
+ changeOnSelect) {
51
+ if (filter(search, connectedPathOptions, {
52
+ label: fieldNames.label
53
+ })) {
54
+ var _Object$assign;
55
+ filteredOptions.push(Object.assign(Object.assign({}, option), (_Object$assign = {}, _defineProperty(_Object$assign, fieldNames.label, render(search, connectedPathOptions, prefixCls, fieldNames)), _defineProperty(_Object$assign, SEARCH_MARK, connectedPathOptions), _Object$assign)));
56
+ }
57
+ }
58
+ if (children) {
59
+ dig(option[fieldNames.children], connectedPathOptions);
60
+ }
61
+ });
62
+ }
63
+ dig(options, []);
64
+ // Do sort
65
+ if (sort) {
66
+ filteredOptions.sort(function (a, b) {
67
+ return sort(a[SEARCH_MARK], b[SEARCH_MARK], search, fieldNames);
68
+ });
69
+ }
70
+ return limit > 0 ? filteredOptions.slice(0, limit) : filteredOptions;
71
+ }, [search, options, fieldNames, prefixCls, render, changeOnSelect, filter, sort, limit]);
72
+ });
@@ -0,0 +1,2 @@
1
+ import Cascader from './Cascader';
2
+ export default Cascader;
@@ -0,0 +1,54 @@
1
+ import { SEARCH_MARK } from '../hooks/useSearchOptions';
2
+ export var VALUE_SPLIT = '__RC_CASCADER_SPLIT__';
3
+ export var SHOW_PARENT = 'SHOW_PARENT';
4
+ export var SHOW_CHILD = 'SHOW_CHILD';
5
+ export function toPathKey(value) {
6
+ return value.join(VALUE_SPLIT);
7
+ }
8
+ export function toPathKeys(value) {
9
+ return value.map(toPathKey);
10
+ }
11
+ export function toPathValueStr(pathKey) {
12
+ return pathKey.split(VALUE_SPLIT);
13
+ }
14
+ export function fillFieldNames(fieldNames) {
15
+ var _ref = fieldNames || {},
16
+ label = _ref.label,
17
+ value = _ref.value,
18
+ children = _ref.children;
19
+ var val = value || 'value';
20
+ return {
21
+ label: label || 'label',
22
+ value: val,
23
+ key: val,
24
+ children: children || 'children'
25
+ };
26
+ }
27
+ export function isLeaf(option, fieldNames) {
28
+ var _a, _b;
29
+ return (_a = option.isLeaf) !== null && _a !== void 0 ? _a : !((_b = option[fieldNames.children]) === null || _b === void 0 ? void 0 : _b.length);
30
+ }
31
+ export function scrollIntoParentView(element) {
32
+ var parent = element.parentElement;
33
+ if (!parent) {
34
+ return;
35
+ }
36
+ var elementToParent = element.offsetTop - parent.offsetTop; // offsetParent may not be parent.
37
+ if (elementToParent - parent.scrollTop < 0) {
38
+ parent.scrollTo({
39
+ top: elementToParent
40
+ });
41
+ } else if (elementToParent + element.offsetHeight - parent.scrollTop > parent.offsetHeight) {
42
+ parent.scrollTo({
43
+ top: elementToParent + element.offsetHeight - parent.offsetHeight
44
+ });
45
+ }
46
+ }
47
+ export function getFullPathKeys(options, fieldNames) {
48
+ return options.map(function (item) {
49
+ var _a;
50
+ return (_a = item[SEARCH_MARK]) === null || _a === void 0 ? void 0 : _a.map(function (opt) {
51
+ return opt[fieldNames.value];
52
+ });
53
+ });
54
+ }
@@ -0,0 +1,37 @@
1
+ import { SHOW_CHILD } from './commonUtil';
2
+ export function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {
3
+ var valueSet = new Set(pathKeys);
4
+ var keyPathEntities = getKeyPathEntities();
5
+ return pathKeys.filter(function (key) {
6
+ var entity = keyPathEntities[key];
7
+ var parent = entity ? entity.parent : null;
8
+ var children = entity ? entity.children : null;
9
+ return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(function (child) {
10
+ return child.key && valueSet.has(child.key);
11
+ })) : !(parent && !parent.node.disabled && valueSet.has(parent.key));
12
+ });
13
+ }
14
+ export function toPathOptions(valueCells, options, fieldNames) {
15
+ var stringMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
16
+ var _a;
17
+ var currentList = options;
18
+ var valueOptions = [];
19
+ var _loop = function _loop() {
20
+ var valueCell = valueCells[i];
21
+ var foundIndex = currentList === null || currentList === void 0 ? void 0 : currentList.findIndex(function (option) {
22
+ var val = option[fieldNames.value];
23
+ return stringMode ? String(val) === String(valueCell) : val === valueCell;
24
+ });
25
+ var foundOption = foundIndex !== -1 ? currentList === null || currentList === void 0 ? void 0 : currentList[foundIndex] : null;
26
+ valueOptions.push({
27
+ value: (_a = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.value]) !== null && _a !== void 0 ? _a : valueCell,
28
+ index: foundIndex,
29
+ option: foundOption
30
+ });
31
+ currentList = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.children];
32
+ };
33
+ for (var i = 0; i < valueCells.length; i += 1) {
34
+ _loop();
35
+ }
36
+ return valueOptions;
37
+ }
@@ -0,0 +1,30 @@
1
+ import warning from 'rc-util/lib/warning';
2
+ function warningProps(props) {
3
+ var onPopupVisibleChange = props.onPopupVisibleChange,
4
+ popupVisible = props.popupVisible,
5
+ popupClassName = props.popupClassName,
6
+ popupPlacement = props.popupPlacement;
7
+ warning(!onPopupVisibleChange, '`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead.');
8
+ warning(popupVisible === undefined, '`popupVisible` is deprecated. Please use `open` instead.');
9
+ warning(popupClassName === undefined, '`popupClassName` is deprecated. Please use `dropdownClassName` instead.');
10
+ warning(popupPlacement === undefined, '`popupPlacement` is deprecated. Please use `placement` instead.');
11
+ }
12
+ // value in Cascader options should not be null
13
+ export function warningNullOptions(options, fieldNames) {
14
+ if (options) {
15
+ var recursiveOptions = function recursiveOptions(optionsList) {
16
+ for (var i = 0; i < optionsList.length; i++) {
17
+ var option = optionsList[i];
18
+ if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
19
+ warning(false, '`value` in Cascader options should not be `null`.');
20
+ return true;
21
+ }
22
+ if (Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]) && recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children])) {
23
+ return true;
24
+ }
25
+ }
26
+ };
27
+ recursiveOptions(options);
28
+ }
29
+ }
30
+ export default warningProps;
@@ -1,5 +1,5 @@
1
- import "antd/es/cascader/style";
2
- import _Cascader from "antd/es/cascader";
1
+ import "@chaoswise/ui/lib/Cascader/index.less";
2
+ import _Cascader from "@chaoswise/ui/lib/Cascader";
3
3
  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); }
4
4
  import React from 'react';
5
5
  import PropTypes from 'prop-types';
@@ -6,14 +6,11 @@ var _excluded = ["label", "value", "index", "handleDelete", "labelValue", "moveL
6
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
7
  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; }
8
8
  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; }
9
- import React, { Fragment, useRef } from "react";
10
- import { useDrag, useDrop } from "react-dnd";
9
+ import React, { Fragment } from "react";
11
10
  import classnames from "classnames";
12
11
  import { getLocale } from "./locale";
13
12
  import LockSvg from "./assets/LockSvg";
14
13
  import DragSvg from "./assets/DragSvg";
15
- import { DndProvider } from "react-dnd";
16
- import { HTML5Backend } from "react-dnd-html5-backend";
17
14
  var NotDragList = function NotDragList(_ref) {
18
15
  var label = _ref.label,
19
16
  value = _ref.value,
@@ -146,10 +146,8 @@ var TopicList = function TopicList(_ref) {
146
146
  return handleDeleted(labelValue);
147
147
  }
148
148
  }));
149
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(DndProvider, {
150
- backend: HTML5Backend
151
- }, /*#__PURE__*/React.createElement("div", _extends({
149
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
152
150
  className: classnames("cw-transfer-right-content-main")
153
- }, dragProps), renderItemContent)));
151
+ }, dragProps), renderItemContent));
154
152
  };
155
153
  export default TopicList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoswise/ui",
3
- "version": "2.2.8",
3
+ "version": "2.3.0",
4
4
  "description": "公共UI库",
5
5
  "keywords": [
6
6
  "ui",
@@ -87,7 +87,7 @@
87
87
  "intl": "^1.2.5",
88
88
  "marked": "^4.2.3",
89
89
  "prop-types": "^15.7.2",
90
- "rc-cascader": "^3.7.0",
90
+ "rc-cascader": "~3.9.0",
91
91
  "rc-field-form": "~1.27.0",
92
92
  "rc-notification": "^4.5.7",
93
93
  "rc-picker": "^2.6.4",
@@ -139,5 +139,5 @@
139
139
  "access": "public"
140
140
  },
141
141
  "license": "MIT",
142
- "gitHead": "40263412634d4c05cae0d1ee6de1fbe180cf4eb6"
142
+ "gitHead": "37c6b99e216fadee27df4128da5657fcb74e0465"
143
143
  }