@zgfe/business-lib 1.1.29-visual.8 → 1.1.29
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/es/addToPanel/components/addPanel.js +21 -8
- package/es/addToPanel/components/radioGroup.js +3 -1
- package/es/addToPanel/components/styleList.js +22 -5
- package/es/addToPanel/demo/edit.js +12 -5
- package/es/addToPanel/demo/index.js +12 -5
- package/es/addToPanel/index.js +58 -21
- package/es/addToScene/addGroup.js +4 -0
- package/es/addToScene/demo/index.js +12 -5
- package/es/addToScene/index.js +40 -13
- package/es/assets/demo/index.js +2 -0
- package/es/assets/demo/input.js +12 -5
- package/es/assets/iconfont/iconfont.js +17 -10
- package/es/assets/theme.js +1 -0
- package/es/attrConditions/components/operateList.js +27 -10
- package/es/attrConditions/components/stringList.js +97 -68
- package/es/attrConditions/components/valuesList.js +40 -14
- package/es/attrConditions/demo/group.js +23 -11
- package/es/attrConditions/demo/index.js +26 -17
- package/es/attrConditions/group.js +48 -17
- package/es/attrConditions/index.js +49 -22
- package/es/attrConditions/types.js +1 -0
- package/es/attributeSelector/demo/disable.js +16 -8
- package/es/attributeSelector/demo/index.js +17 -8
- package/es/attributeSelector/index.js +45 -22
- package/es/attributeSelector/listPanel.js +46 -18
- package/es/attributeSelector/option.js +13 -3
- package/es/attributeSelector/types.js +5 -0
- package/es/attributeSelector/util.js +3 -0
- package/es/chart/demo/index.js +14 -5
- package/es/chart/index.js +44 -30
- package/es/chart/util/chartOptionConfig.d.ts +3 -3
- package/es/chart/util/chartOptionConfig.js +37 -13
- package/es/chart/util/data/china.js +4 -1
- package/es/chart/util/formatData.d.ts +2 -2
- package/es/chart/util/formatData.js +5 -0
- package/es/chart/util/formatOption.js +13 -0
- package/es/chart/util/mapUtil.js +26 -5
- package/es/config.js +2 -0
- package/es/constants/apis.d.ts +0 -1
- package/es/constants/apis.js +1 -2
- package/es/cycleTime/demo/disable.js +1 -0
- package/es/cycleTime/index.js +46 -19
- package/es/cycleTime/month.js +27 -8
- package/es/datePicker/datePicker.js +23 -5
- package/es/datePicker/demo/customType.js +22 -13
- package/es/datePicker/demo/day.js +22 -13
- package/es/datePicker/demo/index.js +21 -12
- package/es/datePicker/index.js +41 -18
- package/es/datePicker/utils.js +7 -0
- package/es/demoWrapper/content.d.ts +1 -2
- package/es/demoWrapper/content.js +64 -42
- package/es/demoWrapper/demo/index.js +4 -5
- package/es/demoWrapper/head.d.ts +1 -3
- package/es/demoWrapper/head.js +27 -25
- package/es/demoWrapper/index.js +36 -28
- package/es/dialog/demo/index.js +12 -5
- package/es/dialog/index.js +6 -4
- package/es/dnd/demo/data.js +28 -19
- package/es/dnd/demo/handle.js +28 -19
- package/es/dnd/index.js +45 -21
- package/es/dnd/item.js +30 -10
- package/es/eventSelector/demo/index.js +23 -12
- package/es/eventSelector/index.js +42 -14
- package/es/eventSelector/listPanel.js +73 -31
- package/es/eventSelector/option.js +11 -6
- package/es/icon/iconFont.js +13 -7
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/es/layout/analysisLayout/demo/index.js +6 -0
- package/es/layout/analysisLayout/index.d.ts +1 -1
- package/es/layout/analysisLayout/index.js +34 -16
- package/es/layout/detail/index.js +3 -1
- package/es/loginForm/index.js +18 -7
- package/es/searchInput/index.js +7 -2
- package/es/select/demo/children.js +16 -8
- package/es/select/demo/customLabel.js +2 -0
- package/es/select/demo/group.js +17 -8
- package/es/select/demo/index.js +19 -11
- package/es/select/demo/loading.js +18 -8
- package/es/select/demo/multiple.js +16 -8
- package/es/select/handle.js +34 -14
- package/es/select/index.js +59 -22
- package/es/select/option.js +30 -10
- package/es/select/overlay.js +62 -25
- package/es/table/demo/data/table.js +2 -0
- package/es/table/demo/index.js +39 -13
- package/es/table/demo/index2.js +15 -5
- package/es/table/demo/index3.js +28 -7
- package/es/table/index.js +33 -14
- package/es/targetConditionGroup/components/targetDimension.js +38 -12
- package/es/targetConditionGroup/demo/group.js +36 -21
- package/es/targetConditionGroup/demo/index.js +13 -5
- package/es/targetConditionGroup/index.js +84 -31
- package/es/targetSelector/demo/index.js +28 -15
- package/es/targetSelector/editBox.js +20 -5
- package/es/targetSelector/index.js +36 -15
- package/es/targetSelector/optionIcon.js +5 -1
- package/es/targetSelector/optionMenu.js +3 -0
- package/es/userCondition/conditionTypeList.js +12 -7
- package/es/userCondition/conditionWrap.js +2 -0
- package/es/userCondition/conditions/cdpCondition.js +97 -51
- package/es/userCondition/conditions/eventCondition.js +16 -6
- package/es/userCondition/conditions/periodCondition.js +26 -8
- package/es/userCondition/conditions/propCondition.js +61 -29
- package/es/userCondition/conditions/runTimesCondition.js +10 -5
- package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
- package/es/userCondition/conditions/tagsCondition.js +33 -15
- package/es/userCondition/conditions/textDesc.js +67 -16
- package/es/userCondition/demo/index.js +21 -11
- package/es/userCondition/index.js +91 -51
- package/es/userCondition/orConditions.js +48 -11
- package/es/userCondition/relationLabel.js +4 -1
- package/es/userCondition/types.d.ts +1 -1
- package/es/userCondition/types.js +1 -0
- package/es/userCondition/util.js +13 -4
- package/es/userGroup/demo/group.js +23 -14
- package/es/userGroup/demo/index.js +15 -5
- package/es/userGroup/index.js +30 -12
- package/es/userTagsSelector/cascaderOverlay.js +51 -19
- package/es/userTagsSelector/components/search/index.js +2 -0
- package/es/userTagsSelector/demo/index.js +3 -0
- package/es/userTagsSelector/groups/groupOption.js +8 -6
- package/es/userTagsSelector/groups/index.js +30 -15
- package/es/userTagsSelector/index.js +35 -17
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +6 -3
- package/es/userTagsSelector/multipleCheckPanel/index.js +21 -8
- package/es/userTagsSelector/util.js +2 -0
- package/es/utils/ajax.js +71 -45
- package/es/utils/base64.js +22 -3
- package/es/utils/type.d.ts +1 -1
- package/es/utils/type.js +7 -4
- package/es/utils/util.js +16 -0
- package/package.json +2 -2
- package/es/socket/demo/demo.d.ts +0 -2
- package/es/socket/demo/demo.js +0 -139
- package/es/socket/demo/index.less +0 -27
- package/es/socket/index.d.ts +0 -31
- package/es/socket/index.js +0 -284
- package/es/socket/types.d.ts +0 -37
- package/es/socket/types.js +0 -26
|
@@ -1,15 +1,21 @@
|
|
|
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
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
|
|
8
9
|
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
|
+
|
|
9
11
|
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
|
-
|
|
11
|
-
function
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
+
|
|
12
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
13
19
|
import React, { useState } from 'react';
|
|
14
20
|
import { BizUserGroup, IconFont } from '@zgfe/business-lib';
|
|
15
21
|
import { Form } from 'antd';
|
|
@@ -38,17 +44,20 @@ var initValue = {
|
|
|
38
44
|
};
|
|
39
45
|
export default (function () {
|
|
40
46
|
var _useState = useState({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
user: [initValue]
|
|
48
|
+
}),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
target = _useState2[0],
|
|
51
|
+
setTarget = _useState2[1];
|
|
52
|
+
|
|
46
53
|
var _Form$useForm = Form.useForm(),
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
55
|
+
form = _Form$useForm2[0];
|
|
56
|
+
|
|
49
57
|
var onValuesChange = function onValuesChange() {
|
|
50
58
|
setTarget(arguments.length <= 1 ? undefined : arguments[1]);
|
|
51
59
|
};
|
|
60
|
+
|
|
52
61
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
53
62
|
initialValues: target,
|
|
54
63
|
form: form,
|
|
@@ -59,7 +68,7 @@ export default (function () {
|
|
|
59
68
|
name: "user"
|
|
60
69
|
}, function (fields, _ref) {
|
|
61
70
|
var add = _ref.add,
|
|
62
|
-
|
|
71
|
+
remove = _ref.remove;
|
|
63
72
|
return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, index) {
|
|
64
73
|
return /*#__PURE__*/React.createElement(Form.Item, _objectSpread(_objectSpread({}, field), {}, {
|
|
65
74
|
key: field.key
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
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
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
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
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useState } from 'react';
|
|
8
14
|
import { BizUserGroup } from '@zgfe/business-lib';
|
|
9
15
|
var groupOptions = [{
|
|
@@ -25,15 +31,18 @@ var groupOptions = [{
|
|
|
25
31
|
id: 6,
|
|
26
32
|
name: '用户群6'
|
|
27
33
|
}];
|
|
34
|
+
|
|
28
35
|
var UserGroupDemo = function UserGroupDemo() {
|
|
29
36
|
var _useState = useState(),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
group = _useState2[0],
|
|
39
|
+
setGroup = _useState2[1];
|
|
40
|
+
|
|
33
41
|
var handleChange = function handleChange(value) {
|
|
34
42
|
console.log('change', value);
|
|
35
43
|
setGroup(value);
|
|
36
44
|
};
|
|
45
|
+
|
|
37
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
38
47
|
className: "biz-user-group-demo",
|
|
39
48
|
style: {
|
|
@@ -46,6 +55,7 @@ var UserGroupDemo = function UserGroupDemo() {
|
|
|
46
55
|
enableDelete: true
|
|
47
56
|
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5DF2\u9009\u7528\u6237\u7FA4\uFF1A", JSON.stringify(group)));
|
|
48
57
|
};
|
|
58
|
+
|
|
49
59
|
export default (function () {
|
|
50
60
|
return /*#__PURE__*/React.createElement(UserGroupDemo, null);
|
|
51
61
|
});
|
package/es/userGroup/index.js
CHANGED
|
@@ -1,45 +1,62 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
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
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
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
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useContext, useEffect, useState } from 'react';
|
|
8
14
|
import './styles/index.less';
|
|
9
15
|
import BizSelect from '../select';
|
|
10
16
|
import BizTargetOptionIcon from '../targetSelector/optionIcon';
|
|
11
17
|
import { Skeleton } from 'antd';
|
|
12
18
|
import BizGlobalDataContext from '../context';
|
|
19
|
+
|
|
13
20
|
var BizUserGroup = function BizUserGroup(props) {
|
|
14
21
|
var enableDelete = props.enableDelete,
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
keyField = props.keyField,
|
|
23
|
+
labelField = props.labelField;
|
|
24
|
+
|
|
17
25
|
var _useState = useState(),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
current = _useState2[0],
|
|
28
|
+
setCurrent = _useState2[1];
|
|
29
|
+
|
|
21
30
|
var _useState3 = useState(true),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
|
+
loading = _useState4[0],
|
|
33
|
+
setLoading = _useState4[1];
|
|
34
|
+
|
|
25
35
|
var classPrefix = 'biz-user';
|
|
36
|
+
|
|
26
37
|
var _useContext = useContext(BizGlobalDataContext),
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
_useContext$userGroup = _useContext.userGroupList,
|
|
39
|
+
userGroupList = _useContext$userGroup === void 0 ? [] : _useContext$userGroup;
|
|
40
|
+
|
|
29
41
|
useEffect(function () {
|
|
30
42
|
var value = props.defaultValue || props.value;
|
|
43
|
+
|
|
31
44
|
if (value) {
|
|
32
45
|
setCurrent(value);
|
|
33
46
|
}
|
|
47
|
+
|
|
34
48
|
setLoading(false);
|
|
35
49
|
}, []);
|
|
50
|
+
|
|
36
51
|
var onClickDelete = function onClickDelete() {
|
|
37
52
|
if (props.onDelete) props.onDelete(current);
|
|
38
53
|
};
|
|
54
|
+
|
|
39
55
|
var onChange = function onChange(value) {
|
|
40
56
|
setCurrent(value);
|
|
41
57
|
if (props.onChange) props.onChange(value);
|
|
42
58
|
};
|
|
59
|
+
|
|
43
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
61
|
className: classPrefix
|
|
45
62
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -66,6 +83,7 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
66
83
|
onClick: onClickDelete
|
|
67
84
|
})));
|
|
68
85
|
};
|
|
86
|
+
|
|
69
87
|
BizUserGroup.defaultProps = {
|
|
70
88
|
keyField: 'id',
|
|
71
89
|
labelField: 'name'
|
|
@@ -1,19 +1,29 @@
|
|
|
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
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
4
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
|
|
5
7
|
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."); }
|
|
8
|
+
|
|
6
9
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
|
|
7
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
|
|
11
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
|
|
12
17
|
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."); }
|
|
18
|
+
|
|
13
19
|
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); }
|
|
14
|
-
|
|
15
|
-
function
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
24
|
+
|
|
16
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
|
|
17
27
|
import React, { useRef } from 'react';
|
|
18
28
|
import { useState } from 'react';
|
|
19
29
|
import { classPrefix } from '.';
|
|
@@ -23,72 +33,88 @@ import MultipleCheckPanel from './multipleCheckPanel';
|
|
|
23
33
|
import { filterFactory, getFieldFactory } from './util';
|
|
24
34
|
import _ from 'lodash';
|
|
25
35
|
import Search from './components/search';
|
|
36
|
+
|
|
26
37
|
var CascaderOverlay = function CascaderOverlay(props) {
|
|
27
38
|
var currentValue = props.currentValue,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
labelFields = props.labelFields,
|
|
40
|
+
keyFields = props.keyFields,
|
|
41
|
+
valueFields = props.valueFields,
|
|
42
|
+
childFields = props.childFields;
|
|
32
43
|
var timer = useRef(null);
|
|
44
|
+
|
|
33
45
|
var _useState = useState(props.data || []),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
data = _useState2[0],
|
|
48
|
+
setData = _useState2[1];
|
|
49
|
+
|
|
37
50
|
var _useState3 = useState(initPath(data)),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
+
currentPath = _useState4[0],
|
|
53
|
+
setCurrentPath = _useState4[1];
|
|
54
|
+
|
|
41
55
|
var _useState5 = useState(''),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
57
|
+
highlightText = _useState6[0],
|
|
58
|
+
setHighlightText = _useState6[1];
|
|
59
|
+
|
|
45
60
|
function initPath(data) {
|
|
46
61
|
return function () {
|
|
47
62
|
var path = [];
|
|
48
63
|
var curr = data[0];
|
|
49
64
|
var getChildField = getFieldFactory(childFields);
|
|
65
|
+
|
|
50
66
|
while (curr) {
|
|
51
67
|
path.push(curr);
|
|
52
68
|
var childField = getChildField();
|
|
69
|
+
|
|
53
70
|
if (_.isArray(curr[childField])) {
|
|
54
71
|
curr = curr[childField].length ? curr[childField][0] : null;
|
|
55
72
|
} else {
|
|
56
73
|
curr = curr[childField];
|
|
57
74
|
}
|
|
58
75
|
}
|
|
76
|
+
|
|
59
77
|
path.pop();
|
|
60
78
|
return path;
|
|
61
79
|
};
|
|
62
80
|
}
|
|
81
|
+
|
|
63
82
|
function onActive(data, level) {
|
|
64
83
|
var currIndex = level;
|
|
65
84
|
var getChildField = getFieldFactory(childFields.slice(currIndex).length ? childFields.slice(currIndex) : childFields.slice(-1));
|
|
66
85
|
var curr = data;
|
|
67
86
|
var newPath = currentPath.slice(0, level + 1);
|
|
87
|
+
|
|
68
88
|
while (curr) {
|
|
69
89
|
newPath[currIndex] = curr;
|
|
70
90
|
var childField = getChildField();
|
|
91
|
+
|
|
71
92
|
if (_.isArray(curr[childField])) {
|
|
72
93
|
curr = curr[childField].length ? curr[childField][0] : null;
|
|
73
94
|
} else {
|
|
74
95
|
curr = curr[childField];
|
|
75
96
|
}
|
|
97
|
+
|
|
76
98
|
currIndex++;
|
|
77
99
|
}
|
|
100
|
+
|
|
78
101
|
newPath.pop();
|
|
79
102
|
setCurrentPath(newPath);
|
|
80
103
|
}
|
|
104
|
+
|
|
81
105
|
function onCheck(data) {
|
|
82
106
|
var getVabelField = getFieldFactory(valueFields);
|
|
83
107
|
var getLabelField = getFieldFactory(labelFields);
|
|
84
108
|
var newValue = currentPath.map(function (item) {
|
|
85
109
|
var _ref;
|
|
110
|
+
|
|
86
111
|
var labelField = getLabelField();
|
|
87
112
|
var valueField = getVabelField();
|
|
88
113
|
return _ref = {}, _defineProperty(_ref, labelField, item[labelField]), _defineProperty(_ref, valueField, item[valueField]), _ref;
|
|
89
114
|
}).concat(data);
|
|
90
115
|
props.onChange([].concat(_toConsumableArray(currentValue), [newValue]));
|
|
91
116
|
}
|
|
117
|
+
|
|
92
118
|
function onUncheck(data) {
|
|
93
119
|
var index = currentValue.findIndex(function (item) {
|
|
94
120
|
return _.isEqual(item.slice().pop(), data);
|
|
@@ -97,14 +123,17 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
97
123
|
newValues.splice(index, 1);
|
|
98
124
|
props.onChange(newValues);
|
|
99
125
|
}
|
|
126
|
+
|
|
100
127
|
function onSearch(val) {
|
|
101
128
|
timer.current && clearTimeout(timer.current);
|
|
102
129
|
timer.current = setTimeout(function () {
|
|
103
130
|
var _labelFields$, _props$data;
|
|
131
|
+
|
|
104
132
|
var res = [];
|
|
105
133
|
var filter = filterFactory((_labelFields$ = labelFields[1]) !== null && _labelFields$ !== void 0 ? _labelFields$ : labelFields[0], val);
|
|
106
134
|
(_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.forEach(function (item) {
|
|
107
135
|
var searchList = item[childFields[0]].filter(filter);
|
|
136
|
+
|
|
108
137
|
if (searchList.length) {
|
|
109
138
|
res.push(_objectSpread(_objectSpread({}, item), {}, _defineProperty({}, childFields[0], item[childFields[0]].filter(filter))));
|
|
110
139
|
}
|
|
@@ -114,6 +143,7 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
114
143
|
setHighlightText(val);
|
|
115
144
|
}, 300);
|
|
116
145
|
}
|
|
146
|
+
|
|
117
147
|
function render() {
|
|
118
148
|
if (!data.length) return /*#__PURE__*/React.createElement("div", {
|
|
119
149
|
style: {
|
|
@@ -157,6 +187,7 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
157
187
|
data: currentPath[1] ? currentPath[1][childFields[1]] : []
|
|
158
188
|
})));
|
|
159
189
|
}
|
|
190
|
+
|
|
160
191
|
return /*#__PURE__*/React.createElement("div", {
|
|
161
192
|
className: "".concat(classPrefix, "-overlay")
|
|
162
193
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -169,4 +200,5 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
169
200
|
className: "".concat(classPrefix, "-overlay-panel")
|
|
170
201
|
}, render()));
|
|
171
202
|
};
|
|
203
|
+
|
|
172
204
|
export default CascaderOverlay;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import BizSearchInput from '../../../searchInput';
|
|
3
3
|
import './index.less';
|
|
4
4
|
import { classPrefix } from '../..';
|
|
5
|
+
|
|
5
6
|
var Search = function Search(props) {
|
|
6
7
|
if (!props.show) return null;
|
|
7
8
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -11,4 +12,5 @@ var Search = function Search(props) {
|
|
|
11
12
|
onChange: props.onChange
|
|
12
13
|
}));
|
|
13
14
|
};
|
|
15
|
+
|
|
14
16
|
export default Search;
|
|
@@ -31,9 +31,11 @@ data.forEach(function (item) {
|
|
|
31
31
|
return layer;
|
|
32
32
|
})
|
|
33
33
|
};
|
|
34
|
+
|
|
34
35
|
if (id < 0.6 && defaultValue.length < 20) {
|
|
35
36
|
defaultValue.push([item.labelGroup, tag]);
|
|
36
37
|
}
|
|
38
|
+
|
|
37
39
|
return tag;
|
|
38
40
|
});
|
|
39
41
|
});
|
|
@@ -41,6 +43,7 @@ export default (function () {
|
|
|
41
43
|
function onChange(data) {
|
|
42
44
|
console.log(data);
|
|
43
45
|
}
|
|
46
|
+
|
|
44
47
|
return /*#__PURE__*/React.createElement(BizUserTagsSelect, {
|
|
45
48
|
childFields: ['children', 'layers'],
|
|
46
49
|
data: data,
|
|
@@ -6,12 +6,13 @@ import './styles/option.less';
|
|
|
6
6
|
import { util } from '../../utils';
|
|
7
7
|
var GroupOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
8
8
|
var label = props.label,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
count = props.count,
|
|
10
|
+
actived = props.actived,
|
|
11
|
+
checked = props.checked,
|
|
12
|
+
_onClick = props.onClick,
|
|
13
|
+
value = props.value,
|
|
14
|
+
highlightText = props.highlightText;
|
|
15
|
+
|
|
15
16
|
function renderLabel() {
|
|
16
17
|
if (!highlightText || !highlightText.trim()) return label;
|
|
17
18
|
var dom = util.setHighLight(label, highlightText, function (text) {
|
|
@@ -23,6 +24,7 @@ var GroupOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
24
|
});
|
|
24
25
|
return dom;
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
29
|
onClick: function onClick() {
|
|
28
30
|
return _onClick(value);
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
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
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
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
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useEffect, useMemo } from 'react';
|
|
8
14
|
import VirtualList from 'rc-virtual-list';
|
|
9
15
|
import { classPrefix } from '../';
|
|
@@ -11,23 +17,27 @@ import GroupOption from './groupOption';
|
|
|
11
17
|
import Search from '../components/search/index';
|
|
12
18
|
import { useState } from 'react';
|
|
13
19
|
import { filterFactory, isCheckedFactory } from '../util';
|
|
20
|
+
|
|
14
21
|
var Groups = function Groups(props) {
|
|
15
22
|
var data = props.data,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
labelField = props.labelField,
|
|
24
|
+
childField = props.childField,
|
|
25
|
+
keyField = props.keyField,
|
|
26
|
+
valueField = props.valueField,
|
|
27
|
+
searchable = props.searchable,
|
|
28
|
+
level = props.level,
|
|
29
|
+
currentValue = props.currentValue;
|
|
30
|
+
|
|
23
31
|
var _useState = useState(''),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
searchValue = _useState2[0],
|
|
34
|
+
setSearchValue = _useState2[1];
|
|
35
|
+
|
|
27
36
|
var _useState3 = useState(data.length ? data[0][valueField] : null),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
active = _useState4[0],
|
|
39
|
+
setActive = _useState4[1];
|
|
40
|
+
|
|
31
41
|
var searchFilter = useMemo(function () {
|
|
32
42
|
return filterFactory(labelField, searchValue);
|
|
33
43
|
}, [labelField, searchValue]);
|
|
@@ -37,13 +47,16 @@ var Groups = function Groups(props) {
|
|
|
37
47
|
useEffect(function () {
|
|
38
48
|
if (data.length) setActive(data[0][valueField]);
|
|
39
49
|
}, [data]);
|
|
50
|
+
|
|
40
51
|
function _onClick(i) {
|
|
41
52
|
setActive(data[i][valueField]);
|
|
42
53
|
props.onActive(data[i], level);
|
|
43
54
|
}
|
|
55
|
+
|
|
44
56
|
function onSearch(val) {
|
|
45
57
|
setSearchValue(val);
|
|
46
58
|
}
|
|
59
|
+
|
|
47
60
|
if (!data.length) return /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E");
|
|
48
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
62
|
className: "".concat(classPrefix, "-groups-panel")
|
|
@@ -57,6 +70,7 @@ var Groups = function Groups(props) {
|
|
|
57
70
|
itemKey: keyField
|
|
58
71
|
}, function (item, index) {
|
|
59
72
|
var _props$highlightText;
|
|
73
|
+
|
|
60
74
|
return /*#__PURE__*/React.createElement(GroupOption, {
|
|
61
75
|
onClick: function onClick() {
|
|
62
76
|
return _onClick(index);
|
|
@@ -70,6 +84,7 @@ var Groups = function Groups(props) {
|
|
|
70
84
|
});
|
|
71
85
|
}));
|
|
72
86
|
};
|
|
87
|
+
|
|
73
88
|
Groups.defaultProps = {
|
|
74
89
|
data: [],
|
|
75
90
|
childField: 'children',
|