@zgfe/business-lib 1.1.29-visual.9 → 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 -278
- package/es/socket/types.d.ts +0 -37
- package/es/socket/types.js +0 -26
|
@@ -3,6 +3,7 @@ import { BizAnalysisLayout } from '@zgfe/business-lib';
|
|
|
3
3
|
import { Button } from 'antd';
|
|
4
4
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
5
5
|
import './index.less';
|
|
6
|
+
|
|
6
7
|
var LeftContent = function LeftContent() {
|
|
7
8
|
return /*#__PURE__*/React.createElement("div", {
|
|
8
9
|
className: "left-content"
|
|
@@ -10,9 +11,11 @@ var LeftContent = function LeftContent() {
|
|
|
10
11
|
type: "primary"
|
|
11
12
|
}, "\u6309\u94AE"));
|
|
12
13
|
};
|
|
14
|
+
|
|
13
15
|
var Footer = function Footer() {
|
|
14
16
|
return /*#__PURE__*/React.createElement("div", null, "@footer");
|
|
15
17
|
};
|
|
18
|
+
|
|
16
19
|
var RightContent = function RightContent() {
|
|
17
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
21
|
style: {
|
|
@@ -20,9 +23,11 @@ var RightContent = function RightContent() {
|
|
|
20
23
|
}
|
|
21
24
|
}, /*#__PURE__*/React.createElement("h1", null, "right"));
|
|
22
25
|
};
|
|
26
|
+
|
|
23
27
|
var onCollapse = function onCollapse(flag) {
|
|
24
28
|
console.log('是否收起', flag);
|
|
25
29
|
};
|
|
30
|
+
|
|
26
31
|
var LayoutDemo = function LayoutDemo() {
|
|
27
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
33
|
className: "root"
|
|
@@ -32,6 +37,7 @@ var LayoutDemo = function LayoutDemo() {
|
|
|
32
37
|
onCollapse: onCollapse
|
|
33
38
|
}, /*#__PURE__*/React.createElement(RightContent, null)));
|
|
34
39
|
};
|
|
40
|
+
|
|
35
41
|
export default (function () {
|
|
36
42
|
return /*#__PURE__*/React.createElement(LayoutDemo, null);
|
|
37
43
|
});
|
|
@@ -1,31 +1,41 @@
|
|
|
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, useState } from 'react';
|
|
8
14
|
import IconFont from '../../icon/iconFont';
|
|
9
15
|
import './index.less';
|
|
10
16
|
import { Tooltip } from 'antd';
|
|
17
|
+
|
|
11
18
|
var BizAnalysisLayout = function BizAnalysisLayout(props) {
|
|
12
19
|
var children = props.children,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
leftPanel = props.leftPanel,
|
|
21
|
+
leftHandle = props.leftHandle,
|
|
22
|
+
_props$isFixed = props.isFixed,
|
|
23
|
+
isFixed = _props$isFixed === void 0 ? false : _props$isFixed,
|
|
24
|
+
defaultLeftWidth = props.defaultLeftWidth,
|
|
25
|
+
minWidthOfLeft = props.minWidthOfLeft,
|
|
26
|
+
maxWidthOfLeft = props.maxWidthOfLeft,
|
|
27
|
+
className = props.className;
|
|
28
|
+
|
|
21
29
|
var _useState = useState(defaultLeftWidth),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
width = _useState2[0],
|
|
32
|
+
setWidth = _useState2[1];
|
|
33
|
+
|
|
25
34
|
var _useState3 = useState(true),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
showLeft = _useState4[0],
|
|
37
|
+
setShowLeft = _useState4[1];
|
|
38
|
+
|
|
29
39
|
var initX = 0;
|
|
30
40
|
var isDrag = false;
|
|
31
41
|
useEffect(function () {
|
|
@@ -33,6 +43,7 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
|
|
|
33
43
|
document.removeEventListener('mouseup', onMouseUp);
|
|
34
44
|
};
|
|
35
45
|
}, []);
|
|
46
|
+
|
|
36
47
|
var onMouseDown = function onMouseDown(e) {
|
|
37
48
|
var target = e.target || e.srcElement;
|
|
38
49
|
initX = e.clientX - target.offsetLeft;
|
|
@@ -40,9 +51,11 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
|
|
|
40
51
|
document.addEventListener('mousemove', onMouseMove);
|
|
41
52
|
document.addEventListener('mouseup', onMouseUp);
|
|
42
53
|
};
|
|
54
|
+
|
|
43
55
|
var onMouseMove = function onMouseMove(e) {
|
|
44
56
|
if (isDrag) {
|
|
45
57
|
var x = e.clientX - initX;
|
|
58
|
+
|
|
46
59
|
if (x < minWidthOfLeft) {
|
|
47
60
|
if (x < 250) {
|
|
48
61
|
setShowLeft(false);
|
|
@@ -52,14 +65,17 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
|
|
|
52
65
|
x = minWidthOfLeft || 320;
|
|
53
66
|
}
|
|
54
67
|
}
|
|
68
|
+
|
|
55
69
|
if (x > maxWidthOfLeft) x = maxWidthOfLeft || 580;
|
|
56
70
|
setWidth(x);
|
|
57
71
|
}
|
|
58
72
|
};
|
|
73
|
+
|
|
59
74
|
var onMouseUp = function onMouseUp() {
|
|
60
75
|
isDrag = false;
|
|
61
76
|
document.removeEventListener('mousemove', onMouseMove);
|
|
62
77
|
};
|
|
78
|
+
|
|
63
79
|
function onCollapse() {
|
|
64
80
|
if (props.onCollapse) props.onCollapse(showLeft);
|
|
65
81
|
setShowLeft(function (show) {
|
|
@@ -67,6 +83,7 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
|
|
|
67
83
|
return !show;
|
|
68
84
|
});
|
|
69
85
|
}
|
|
86
|
+
|
|
70
87
|
return /*#__PURE__*/React.createElement("div", {
|
|
71
88
|
className: "biz-layout-container ".concat(className)
|
|
72
89
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -119,6 +136,7 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
|
|
|
119
136
|
}
|
|
120
137
|
}, children));
|
|
121
138
|
};
|
|
139
|
+
|
|
122
140
|
BizAnalysisLayout.defaultProps = {
|
|
123
141
|
defaultLeftWidth: 320,
|
|
124
142
|
minWidthOfLeft: 320,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconFont } from '../..';
|
|
3
3
|
import './index.less';
|
|
4
|
+
|
|
4
5
|
var BizDetailLayout = function BizDetailLayout(props) {
|
|
5
6
|
var width = props.width,
|
|
6
|
-
|
|
7
|
+
className = props.className;
|
|
7
8
|
var classPrefix = 'biz-detail';
|
|
8
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
10
|
className: "".concat(classPrefix, " ").concat(className),
|
|
@@ -20,4 +21,5 @@ var BizDetailLayout = function BizDetailLayout(props) {
|
|
|
20
21
|
className: "".concat(classPrefix, "-content")
|
|
21
22
|
}, props.children));
|
|
22
23
|
};
|
|
24
|
+
|
|
23
25
|
export default BizDetailLayout;
|
package/es/loginForm/index.js
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
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 { Button, Form, Input } from 'antd';
|
|
8
14
|
import React, { useState } from 'react';
|
|
9
15
|
import request from '../utils/ajax';
|
|
10
16
|
import base64 from '../utils/base64';
|
|
11
17
|
import './index.less';
|
|
12
18
|
import JsCookie from 'js-cookie';
|
|
19
|
+
|
|
13
20
|
var BizLoginForm = function BizLoginForm(_ref) {
|
|
14
21
|
var loginUrl = _ref.loginUrl,
|
|
15
|
-
|
|
22
|
+
onSuccess = _ref.onSuccess;
|
|
23
|
+
|
|
16
24
|
var _useState = useState(false),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
loading = _useState2[0],
|
|
27
|
+
setLoading = _useState2[1];
|
|
28
|
+
|
|
20
29
|
function onSubmit(_ref2) {
|
|
21
30
|
var username = _ref2.username,
|
|
22
|
-
|
|
31
|
+
password = _ref2.password;
|
|
23
32
|
setLoading(true);
|
|
24
33
|
var pwd = base64.encode(base64.gString(password, base64.pw), false);
|
|
25
34
|
request(loginUrl || '/analysis/api/system/login', {
|
|
@@ -39,6 +48,7 @@ var BizLoginForm = function BizLoginForm(_ref) {
|
|
|
39
48
|
setLoading(false);
|
|
40
49
|
});
|
|
41
50
|
}
|
|
51
|
+
|
|
42
52
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
53
|
className: "biz-login"
|
|
44
54
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
@@ -63,4 +73,5 @@ var BizLoginForm = function BizLoginForm(_ref) {
|
|
|
63
73
|
loading: loading
|
|
64
74
|
}, "\u767B\u5F55"))));
|
|
65
75
|
};
|
|
76
|
+
|
|
66
77
|
export default BizLoginForm;
|
package/es/searchInput/index.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { Input } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { IconFont } from '..';
|
|
4
|
+
|
|
4
5
|
var BizSearchInput = function BizSearchInput(props) {
|
|
5
6
|
var value = props.value,
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
placeholder = props.placeholder,
|
|
8
|
+
className = props.className;
|
|
9
|
+
|
|
8
10
|
function onChange(e) {
|
|
9
11
|
if (props.onChange) props.onChange(e.target.value);
|
|
10
12
|
}
|
|
13
|
+
|
|
11
14
|
function onBlur(e) {
|
|
12
15
|
if (props.onBlur) props.onBlur(e.target.value);
|
|
13
16
|
}
|
|
17
|
+
|
|
14
18
|
return /*#__PURE__*/React.createElement(Input, {
|
|
15
19
|
className: className,
|
|
16
20
|
value: value,
|
|
@@ -28,4 +32,5 @@ var BizSearchInput = function BizSearchInput(props) {
|
|
|
28
32
|
onBlur: onBlur
|
|
29
33
|
});
|
|
30
34
|
};
|
|
35
|
+
|
|
31
36
|
export default BizSearchInput;
|
|
@@ -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 { BizSelect } from '@zgfe/business-lib';
|
|
9
15
|
import { Button } from 'antd';
|
|
@@ -45,18 +51,20 @@ var disabledList = [{
|
|
|
45
51
|
}];
|
|
46
52
|
export default (function () {
|
|
47
53
|
var _useState = useState([{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
name: '不是',
|
|
55
|
+
value: 'not equal'
|
|
56
|
+
}]),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
data = _useState2[0],
|
|
59
|
+
setData = _useState2[1];
|
|
60
|
+
|
|
54
61
|
var onChange = function onChange(value) {
|
|
55
62
|
console.log(value);
|
|
56
63
|
setData(function () {
|
|
57
64
|
return value;
|
|
58
65
|
});
|
|
59
66
|
};
|
|
67
|
+
|
|
60
68
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSelect, {
|
|
61
69
|
options: stringOperate,
|
|
62
70
|
value: data,
|
|
@@ -6,9 +6,11 @@ export default (function () {
|
|
|
6
6
|
var store = convertAttributeData({
|
|
7
7
|
userPropList: userData
|
|
8
8
|
});
|
|
9
|
+
|
|
9
10
|
function renderLabel(node, option) {
|
|
10
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, node, option.realTime ? '*' : null);
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSelect, {
|
|
13
15
|
options: store.userPropList,
|
|
14
16
|
customLabel: renderLabel,
|
package/es/select/demo/group.js
CHANGED
|
@@ -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 { BizSelect, IconFont } from '@zgfe/business-lib';
|
|
9
15
|
import { Button } from 'antd';
|
|
@@ -27,18 +33,21 @@ var option = Array(10).fill(1).map(function (group, i) {
|
|
|
27
33
|
});
|
|
28
34
|
export default (function () {
|
|
29
35
|
var _useState = useState({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
value: 11,
|
|
37
|
+
name: 'option1'
|
|
38
|
+
}),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
value = _useState2[0],
|
|
41
|
+
setValue = _useState2[1];
|
|
42
|
+
|
|
36
43
|
var onChange = function onChange(data) {
|
|
37
44
|
setValue(data);
|
|
38
45
|
};
|
|
46
|
+
|
|
39
47
|
var handleClick = function handleClick(value) {
|
|
40
48
|
console.log('clik>>', value);
|
|
41
49
|
};
|
|
50
|
+
|
|
42
51
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSelect, {
|
|
43
52
|
options: option,
|
|
44
53
|
type: "group",
|
package/es/select/demo/index.js
CHANGED
|
@@ -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 { BizSelect } from '@zgfe/business-lib';
|
|
9
15
|
import { Button } from 'antd';
|
|
@@ -48,20 +54,22 @@ var disabledList = [{
|
|
|
48
54
|
}];
|
|
49
55
|
export default (function () {
|
|
50
56
|
var _useState = useState([].concat(disabledList, [{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
name: '不是空值',
|
|
58
|
+
value: 'is not null'
|
|
59
|
+
}, {
|
|
60
|
+
name: '是',
|
|
61
|
+
value: 'equal'
|
|
62
|
+
}])),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
data = _useState2[0],
|
|
65
|
+
setData = _useState2[1];
|
|
66
|
+
|
|
60
67
|
var onChange = function onChange(value) {
|
|
61
68
|
setData(function () {
|
|
62
69
|
return value;
|
|
63
70
|
});
|
|
64
71
|
};
|
|
72
|
+
|
|
65
73
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSelect, {
|
|
66
74
|
options: stringOperate,
|
|
67
75
|
defaultValue: data,
|
|
@@ -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, useState } from 'react';
|
|
8
14
|
import { BizSelect } from '@zgfe/business-lib';
|
|
9
15
|
var stringOperate = Array(10).fill(1).map(function (_item, index) {
|
|
@@ -12,6 +18,7 @@ var stringOperate = Array(10).fill(1).map(function (_item, index) {
|
|
|
12
18
|
value: index
|
|
13
19
|
};
|
|
14
20
|
});
|
|
21
|
+
|
|
15
22
|
function getRemoteDat() {
|
|
16
23
|
return new Promise(function (resolve) {
|
|
17
24
|
setTimeout(function () {
|
|
@@ -19,15 +26,18 @@ function getRemoteDat() {
|
|
|
19
26
|
}, 3000);
|
|
20
27
|
});
|
|
21
28
|
}
|
|
29
|
+
|
|
22
30
|
export default (function () {
|
|
23
31
|
var _useState = useState([]),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
options = _useState2[0],
|
|
34
|
+
setOptions = _useState2[1];
|
|
35
|
+
|
|
27
36
|
var _useState3 = useState(false),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
loading = _useState4[0],
|
|
39
|
+
setLoading = _useState4[1];
|
|
40
|
+
|
|
31
41
|
useEffect(function () {
|
|
32
42
|
setLoading(true);
|
|
33
43
|
getRemoteDat().then(function (data) {
|
|
@@ -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 { BizSelect } from '@zgfe/business-lib';
|
|
9
15
|
var stringOperate = [{
|
|
@@ -49,17 +55,19 @@ var disabledList = [{
|
|
|
49
55
|
}];
|
|
50
56
|
export default (function () {
|
|
51
57
|
var _useState = useState([].concat(disabledList, [{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
name: '包含',
|
|
59
|
+
value: 'contains'
|
|
60
|
+
}])),
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62
|
+
data = _useState2[0],
|
|
63
|
+
setData = _useState2[1];
|
|
64
|
+
|
|
58
65
|
var onChange = function onChange(value) {
|
|
59
66
|
setData(function () {
|
|
60
67
|
return value;
|
|
61
68
|
});
|
|
62
69
|
};
|
|
70
|
+
|
|
63
71
|
return /*#__PURE__*/React.createElement("div", {
|
|
64
72
|
style: {
|
|
65
73
|
width: '400px'
|
package/es/select/handle.js
CHANGED
|
@@ -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 { Input, Tag, Tooltip } from 'antd';
|
|
8
14
|
import { FormItemInputContext } from 'antd/es/form/context';
|
|
9
15
|
import React, { useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
@@ -11,26 +17,32 @@ import IconFont from '../icon/iconFont';
|
|
|
11
17
|
import './styles/handle.less';
|
|
12
18
|
var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
19
|
var _props$value;
|
|
20
|
+
|
|
14
21
|
var placeholder = props.placeholder,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
labelField = props.labelField,
|
|
23
|
+
keyField = props.keyField,
|
|
24
|
+
border = props.border,
|
|
25
|
+
showSelectIcon = props.showSelectIcon,
|
|
26
|
+
disable = props.disable;
|
|
20
27
|
var classPrefix = 'biz-select-handle';
|
|
28
|
+
|
|
21
29
|
var _useState = useState(false),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
focus = _useState2[0],
|
|
32
|
+
setFocus = _useState2[1];
|
|
33
|
+
|
|
25
34
|
var handleRef = useRef(null);
|
|
26
35
|
var inputRef = useRef(null);
|
|
27
36
|
var textRef = useRef();
|
|
37
|
+
|
|
28
38
|
var _useState3 = useState(''),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
|
+
searchValue = _useState4[0],
|
|
41
|
+
setSearchValue = _useState4[1];
|
|
42
|
+
|
|
32
43
|
var _useContext = useContext(FormItemInputContext),
|
|
33
|
-
|
|
44
|
+
contextStatus = _useContext.status;
|
|
45
|
+
|
|
34
46
|
var mergedStatus = props.status || contextStatus;
|
|
35
47
|
var disableKeyMap = useMemo(function () {
|
|
36
48
|
if (!props.disableItemList || !keyField) return {};
|
|
@@ -45,6 +57,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
45
57
|
if (props.disable) return;
|
|
46
58
|
setFocus(flag);
|
|
47
59
|
if (!props.multiple) return;
|
|
60
|
+
|
|
48
61
|
if (flag) {
|
|
49
62
|
inputRef.current.focus();
|
|
50
63
|
} else {
|
|
@@ -69,24 +82,30 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
69
82
|
var searchInputWidth = useMemo(function () {
|
|
70
83
|
return textRef.current && searchValue ? textRef.current.offsetWidth : 3;
|
|
71
84
|
}, [searchValue]);
|
|
85
|
+
|
|
72
86
|
var onDelete = function onDelete(data) {
|
|
73
87
|
if (props.onDelete) props.onDelete(data);
|
|
74
88
|
};
|
|
89
|
+
|
|
75
90
|
var onSearch = function onSearch(e) {
|
|
76
91
|
var value = e.target.value;
|
|
77
92
|
setSearchValue(value);
|
|
78
93
|
if (props.onSearch) props.onSearch(value);
|
|
79
94
|
};
|
|
95
|
+
|
|
80
96
|
var onKeyDown = function onKeyDown(e) {
|
|
81
97
|
if (e.keyCode === 13 && props.multiple) {
|
|
82
98
|
var value = e.target.value.trim();
|
|
99
|
+
|
|
83
100
|
if (value && props.onCreate) {
|
|
84
101
|
props.onCreate(value);
|
|
85
102
|
}
|
|
103
|
+
|
|
86
104
|
setFocus(false);
|
|
87
105
|
setSearchValue('');
|
|
88
106
|
}
|
|
89
107
|
};
|
|
108
|
+
|
|
90
109
|
if (props.multiple) {
|
|
91
110
|
return /*#__PURE__*/React.createElement("div", {
|
|
92
111
|
ref: handleRef,
|
|
@@ -124,6 +143,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
124
143
|
ref: textRef
|
|
125
144
|
}, searchValue));
|
|
126
145
|
}
|
|
146
|
+
|
|
127
147
|
return /*#__PURE__*/React.createElement("div", {
|
|
128
148
|
ref: handleRef,
|
|
129
149
|
className: "".concat(classPrefix, "-input ").concat(props.theme ? props.theme : '', "\n ").concat(props.disable ? 'disable' : '', " ").concat(focus ? 'active' : '', " \n ").concat(mergedStatus ? "".concat(classPrefix, "-status-").concat(mergedStatus) : '', "\n ").concat(border ? '' : 'borderless', " ").concat(props.size ? props.size : 'middle'),
|