@zgfe/business-lib 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/es/analysisLayout/demo/index.d.ts +3 -0
- package/es/analysisLayout/demo/index.js +30 -0
- package/es/analysisLayout/demo/index.less +12 -0
- package/es/analysisLayout/index.d.ts +13 -0
- package/es/analysisLayout/index.js +153 -0
- package/es/analysisLayout/index.less +115 -0
- package/es/attributeSelector/data/env.d.ts +11 -0
- package/es/attributeSelector/data/env.js +181 -0
- package/es/attributeSelector/data/event.d.ts +237 -0
- package/es/attributeSelector/data/event.js +3483 -0
- package/es/attributeSelector/data/user.d.ts +22 -0
- package/es/attributeSelector/data/user.js +218 -0
- package/es/attributeSelector/demo/multi.d.ts +2 -0
- package/es/attributeSelector/demo/multi.js +39 -0
- package/es/attributeSelector/demo/multiForm.d.ts +2 -0
- package/es/attributeSelector/demo/multiForm.js +64 -0
- package/es/attributeSelector/demo/single.d.ts +2 -0
- package/es/attributeSelector/demo/single.js +43 -0
- package/es/attributeSelector/demo/singleForm.d.ts +2 -0
- package/es/attributeSelector/demo/singleForm.js +66 -0
- package/es/attributeSelector/group.d.ts +31 -0
- package/es/attributeSelector/group.js +225 -0
- package/es/attributeSelector/index.d.ts +110 -0
- package/es/attributeSelector/index.js +578 -0
- package/es/attributeSelector/index.less +172 -0
- package/es/chart/chartConfig.d.ts +28 -0
- package/es/chart/chartConfig.js +256 -0
- package/es/chart/color.d.ts +1 -0
- package/es/chart/color.js +1 -0
- package/es/chart/demo/bar.d.ts +2 -0
- package/es/chart/demo/bar.js +19 -0
- package/es/chart/demo/data.d.ts +11 -0
- package/es/chart/demo/data.js +37 -0
- package/es/chart/demo/index.d.ts +2 -0
- package/es/chart/demo/index.js +9 -0
- package/es/chart/demo/pie.d.ts +2 -0
- package/es/chart/demo/pie.js +30 -0
- package/es/chart/index.d.ts +63 -0
- package/es/chart/index.js +76 -0
- package/es/chart/index.less +38 -0
- package/es/chart/style/circle.svg +4 -0
- package/es/commonStyle/icon.less +147 -0
- package/es/commonStyle/index.less +171 -0
- package/es/commonStyle/select.less +101 -0
- package/es/commonStyle/theme.less +432 -0
- package/es/commonStyle/variable.less +124 -0
- package/es/datePicker/data.d.ts +9 -0
- package/es/datePicker/data.js +65 -0
- package/es/datePicker/demo/form.d.ts +2 -0
- package/es/datePicker/demo/form.js +53 -0
- package/es/datePicker/demo/index.d.ts +2 -0
- package/es/datePicker/demo/index.js +30 -0
- package/es/datePicker/index.d.ts +29 -0
- package/es/datePicker/index.js +207 -0
- package/es/datePicker/index.less +388 -0
- package/es/dialog/components/list.d.ts +15 -0
- package/es/dialog/components/list.js +57 -0
- package/es/dialog/components/selectToInput.d.ts +43 -0
- package/es/dialog/components/selectToInput.js +107 -0
- package/es/dialog/components/style/list.less +59 -0
- package/es/dialog/components/style/tab.less +61 -0
- package/es/dialog/components/tab.d.ts +9 -0
- package/es/dialog/components/tab.js +50 -0
- package/es/dialog/data/chart.d.ts +11 -0
- package/es/dialog/data/chart.js +62 -0
- package/es/dialog/demo/index.d.ts +2 -0
- package/es/dialog/demo/index.js +122 -0
- package/es/dialog/demo/index2.d.ts +2 -0
- package/es/dialog/demo/index2.js +79 -0
- package/es/dialog/demo/index3.d.ts +2 -0
- package/es/dialog/demo/index3.js +61 -0
- package/es/dialog/index.d.ts +68 -0
- package/es/dialog/index.js +188 -0
- package/es/dialog/style/index.less +70 -0
- package/es/eventSelector/cascade.less +120 -0
- package/es/eventSelector/demo/form.d.ts +2 -0
- package/es/eventSelector/demo/form.js +89 -0
- package/es/eventSelector/demo/index.d.ts +2 -0
- package/es/eventSelector/demo/index.js +69 -0
- package/es/eventSelector/demo/nodata.d.ts +2 -0
- package/es/eventSelector/demo/nodata.js +13 -0
- package/es/eventSelector/index.d.ts +27 -0
- package/es/eventSelector/index.js +390 -0
- package/es/eventSelector/type.d.ts +41 -0
- package/es/eventSelector/type.js +1 -0
- package/es/globalAttributes/demo/data/env.d.ts +11 -0
- package/es/globalAttributes/demo/data/env.js +181 -0
- package/es/globalAttributes/demo/data/event.d.ts +237 -0
- package/es/globalAttributes/demo/data/event.js +3483 -0
- package/es/globalAttributes/demo/data/user.d.ts +22 -0
- package/es/globalAttributes/demo/data/user.js +218 -0
- package/es/globalAttributes/demo/index.d.ts +2 -0
- package/es/globalAttributes/demo/index.js +50 -0
- package/es/globalAttributes/index.d.ts +46 -0
- package/es/globalAttributes/index.js +116 -0
- package/es/index.d.ts +23 -0
- package/es/index.js +25 -0
- package/es/multipleSelector/demo/index.d.ts +2 -0
- package/es/multipleSelector/demo/index.js +35 -0
- package/es/multipleSelector/index.d.ts +36 -0
- package/es/multipleSelector/index.js +109 -0
- package/es/multipleSelector/index.less +138 -0
- package/es/select/demo/index.d.ts +2 -0
- package/es/select/demo/index.js +22 -0
- package/es/select/index.d.ts +42 -0
- package/es/select/index.js +142 -0
- package/es/table/demo/data/color.d.ts +1 -0
- package/es/table/demo/data/color.js +1 -0
- package/es/table/demo/data/data.d.ts +11 -0
- package/es/table/demo/data/data.js +37 -0
- package/es/table/demo/data/table.d.ts +4 -0
- package/es/table/demo/data/table.js +37 -0
- package/es/table/demo/index.d.ts +3 -0
- package/es/table/demo/index.js +171 -0
- package/es/table/demo/index.less +8 -0
- package/es/table/demo/index2.d.ts +2 -0
- package/es/table/demo/index2.js +9 -0
- package/es/table/index.d.ts +32 -0
- package/es/table/index.js +80 -0
- package/es/table/index.less +102 -0
- package/es/targetConditionGroup/components/conditionGroup.d.ts +30 -0
- package/es/targetConditionGroup/components/conditionGroup.js +111 -0
- package/es/targetConditionGroup/components/conditionItem.d.ts +47 -0
- package/es/targetConditionGroup/components/conditionItem.js +259 -0
- package/es/targetConditionGroup/components/style/group.less +47 -0
- package/es/targetConditionGroup/components/style/index.less +16 -0
- package/es/targetConditionGroup/data/operates.d.ts +36 -0
- package/es/targetConditionGroup/data/operates.js +98 -0
- package/es/targetConditionGroup/demo/data/env.d.ts +11 -0
- package/es/targetConditionGroup/demo/data/env.js +181 -0
- package/es/targetConditionGroup/demo/data/event.d.ts +237 -0
- package/es/targetConditionGroup/demo/data/event.js +3483 -0
- package/es/targetConditionGroup/demo/data/user.d.ts +22 -0
- package/es/targetConditionGroup/demo/data/user.js +218 -0
- package/es/targetConditionGroup/demo/form.d.ts +2 -0
- package/es/targetConditionGroup/demo/form.js +96 -0
- package/es/targetConditionGroup/demo/index.d.ts +2 -0
- package/es/targetConditionGroup/demo/index.js +73 -0
- package/es/targetConditionGroup/demo/item.d.ts +2 -0
- package/es/targetConditionGroup/demo/item.js +5 -0
- package/es/targetConditionGroup/index.d.ts +53 -0
- package/es/targetConditionGroup/index.js +265 -0
- package/es/targetConditionGroup/index.less +65 -0
- package/es/targetConditionGroup/type.d.ts +50 -0
- package/es/targetConditionGroup/type.js +1 -0
- package/es/targetSelector/components/BizCascadeBox.d.ts +34 -0
- package/es/targetSelector/components/BizCascadeBox.js +213 -0
- package/es/targetSelector/components/BizEventNameEditBox.d.ts +20 -0
- package/es/targetSelector/components/BizEventNameEditBox.js +57 -0
- package/es/targetSelector/demo/form.d.ts +2 -0
- package/es/targetSelector/demo/form.js +133 -0
- package/es/targetSelector/demo/index.d.ts +2 -0
- package/es/targetSelector/demo/index.js +107 -0
- package/es/targetSelector/demo/nodata.d.ts +2 -0
- package/es/targetSelector/demo/nodata.js +13 -0
- package/es/targetSelector/index.d.ts +40 -0
- package/es/targetSelector/index.js +204 -0
- package/es/targetSelector/index.less +53 -0
- package/es/userGroup/demo/cluster.d.ts +3 -0
- package/es/userGroup/demo/cluster.js +102 -0
- package/es/userGroup/demo/index.d.ts +3 -0
- package/es/userGroup/demo/index.js +115 -0
- package/es/userGroup/demo/index.less +3 -0
- package/es/userGroup/index.d.ts +79 -0
- package/es/userGroup/index.js +134 -0
- package/es/userGroup/index.less +2 -0
- package/es/userGroup/userCluster.d.ts +63 -0
- package/es/userGroup/userCluster.js +254 -0
- package/es/utils/ajax.d.ts +7 -0
- package/es/utils/ajax.js +139 -0
- package/es/utils/index.d.ts +3 -0
- package/es/utils/index.js +3 -0
- package/es/utils/type.d.ts +54 -0
- package/es/utils/type.js +1 -0
- package/es/utils/util.d.ts +67 -0
- package/es/utils/util.js +204 -0
- package/package.json +55 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var _excluded = ["label"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
+
|
|
15
|
+
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."); }
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
+
|
|
25
|
+
import React, { useState } from 'react';
|
|
26
|
+
import { Select } from 'antd';
|
|
27
|
+
import { IconFont } from '..';
|
|
28
|
+
import './index.less';
|
|
29
|
+
import Tag from 'antd/es/tag';
|
|
30
|
+
import Tooltip from 'antd/es/tooltip';
|
|
31
|
+
var Option = Select.Option;
|
|
32
|
+
|
|
33
|
+
var BizMultipleSelector = function BizMultipleSelector(props) {
|
|
34
|
+
var defaultValue = props.defaultValue,
|
|
35
|
+
value = props.value,
|
|
36
|
+
options = props.options,
|
|
37
|
+
_props$placeholder = props.placeholder,
|
|
38
|
+
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
|
39
|
+
onChange = props.onChange; // 是否是聚焦状态
|
|
40
|
+
|
|
41
|
+
var _useState = useState(false),
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
focused = _useState2[0],
|
|
44
|
+
setFocused = _useState2[1]; // const [defaultData, setDefaultData] = useState<Array<string|number>>()
|
|
45
|
+
// useEffect(()=>{
|
|
46
|
+
// let intoValue = defaultValue||value;
|
|
47
|
+
// if(defaultData===intoValue) return;
|
|
48
|
+
// setDefaultData(()=>intoValue)
|
|
49
|
+
// },[defaultValue,value])
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
var tagRender = function tagRender(props) {
|
|
53
|
+
var label = props.label,
|
|
54
|
+
res = _objectWithoutProperties(props, _excluded);
|
|
55
|
+
|
|
56
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
57
|
+
title: label,
|
|
58
|
+
overlayClassName: "biz-tooltip"
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Tag, _objectSpread({
|
|
60
|
+
className: "ant-select-selection-item",
|
|
61
|
+
closeIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
62
|
+
type: "icon-qingchu"
|
|
63
|
+
})
|
|
64
|
+
}, res), /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
className: "ant-select-selection-item-content"
|
|
66
|
+
}, label)));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: "biz-multi-container ".concat(focused ? 'active' : '')
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
72
|
+
mode: "multiple",
|
|
73
|
+
dropdownClassName: "biz-multi-select",
|
|
74
|
+
style: {
|
|
75
|
+
width: '100%'
|
|
76
|
+
},
|
|
77
|
+
placeholder: placeholder,
|
|
78
|
+
defaultValue: defaultValue,
|
|
79
|
+
menuItemSelectedIcon: null,
|
|
80
|
+
listHeight: 400,
|
|
81
|
+
onChange: onChange,
|
|
82
|
+
optionLabelProp: "label",
|
|
83
|
+
tagRender: tagRender,
|
|
84
|
+
onFocus: function onFocus() {
|
|
85
|
+
setFocused(true);
|
|
86
|
+
},
|
|
87
|
+
onBlur: function onBlur() {
|
|
88
|
+
setFocused(false);
|
|
89
|
+
},
|
|
90
|
+
notFoundContent: '暂无数据'
|
|
91
|
+
}, options.map(function (item, index) {
|
|
92
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
93
|
+
key: index.toString(36) + index,
|
|
94
|
+
value: item,
|
|
95
|
+
label: item
|
|
96
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
97
|
+
className: "biz-icon-notcheck",
|
|
98
|
+
type: 'icon-a-Property1moren'
|
|
99
|
+
}), /*#__PURE__*/React.createElement(IconFont, {
|
|
100
|
+
className: "biz-icon-checked",
|
|
101
|
+
type: 'icon-a-Property1xuanzhong'
|
|
102
|
+
}), item);
|
|
103
|
+
})), /*#__PURE__*/React.createElement(IconFont, {
|
|
104
|
+
className: "biz-select-zhankai",
|
|
105
|
+
type: 'icon-xiangxia'
|
|
106
|
+
}));
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default BizMultipleSelector;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
@import '../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.biz-multi-container {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex: 1;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding-left: 10px;
|
|
9
|
+
color: @fontColor;
|
|
10
|
+
background-color: #f6f6f6;
|
|
11
|
+
border-radius: @boxRadius;
|
|
12
|
+
|
|
13
|
+
.ant-select-selection-overflow-item {
|
|
14
|
+
&:not(:last-child) {
|
|
15
|
+
margin-right: 4px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.ant-select-selection-item {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
height: 20px;
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0 6px;
|
|
24
|
+
background: transparent;
|
|
25
|
+
border: 1px solid #cacdd4;
|
|
26
|
+
border-radius: @boxRadius;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
border-color: @themeColor;
|
|
30
|
+
.box-hover();
|
|
31
|
+
|
|
32
|
+
.ant-select-selection-item-remove,
|
|
33
|
+
.ant-tag-close-icon {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
margin-left: 7px;
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
.anticon {
|
|
39
|
+
color: @themeColor;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ant-select-selection-item-content {
|
|
45
|
+
max-width: 70px;
|
|
46
|
+
margin-right: 0;
|
|
47
|
+
}
|
|
48
|
+
.ant-select-selection-item-remove,
|
|
49
|
+
.ant-tag-close-icon {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover,
|
|
55
|
+
&.active {
|
|
56
|
+
.box-hover();
|
|
57
|
+
|
|
58
|
+
.biz-select-zhankai {
|
|
59
|
+
display: block;
|
|
60
|
+
color: @themeColor;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ant-select:not(.ant-select-customize-input) .ant-select-selector {
|
|
65
|
+
background: transparent;
|
|
66
|
+
border: none;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input)
|
|
71
|
+
.ant-select-selector {
|
|
72
|
+
border: none;
|
|
73
|
+
box-shadow: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ant-select-selector {
|
|
77
|
+
border: none;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.biz-multi-select {
|
|
82
|
+
&.ant-select-dropdown {
|
|
83
|
+
width: @dropdownWidth !important;
|
|
84
|
+
min-width: @dropdownWidth !important;
|
|
85
|
+
padding: @selectItem2Padding;
|
|
86
|
+
background: #ffffff;
|
|
87
|
+
border-radius: @specialRadius;
|
|
88
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ant-select-item {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: row;
|
|
94
|
+
align-items: center;
|
|
95
|
+
height: 48px;
|
|
96
|
+
padding: @dropdownItemPadding;
|
|
97
|
+
padding-left: 8px;
|
|
98
|
+
font-weight: 400;
|
|
99
|
+
border-radius: @specialRadius;
|
|
100
|
+
|
|
101
|
+
.biz-icon-notcheck {
|
|
102
|
+
color: #cacdd4;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.biz-icon-checked {
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.biz-icon-notcheck,
|
|
110
|
+
.biz-icon-checked {
|
|
111
|
+
margin-right: 8px;
|
|
112
|
+
font-size: @iconSize;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
|
|
117
|
+
color: @hoverColor;
|
|
118
|
+
background-color: @hoverBgColor !important;
|
|
119
|
+
|
|
120
|
+
.biz-icon-notcheck {
|
|
121
|
+
color: @themeColor;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
|
|
126
|
+
color: @hoverColor;
|
|
127
|
+
background-color: #ffffff;
|
|
128
|
+
|
|
129
|
+
.biz-icon-notcheck {
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.biz-icon-checked {
|
|
134
|
+
display: inline-block;
|
|
135
|
+
color: @themeColor;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BizSelect } from 'business-lib';
|
|
3
|
+
var options = [{
|
|
4
|
+
label: 'test',
|
|
5
|
+
value: 'test'
|
|
6
|
+
}, {
|
|
7
|
+
label: 'test2',
|
|
8
|
+
value: 'test2'
|
|
9
|
+
}, {
|
|
10
|
+
label: 'test3',
|
|
11
|
+
value: 'test3'
|
|
12
|
+
}];
|
|
13
|
+
export default (function () {
|
|
14
|
+
var handleChange = function handleChange(value) {
|
|
15
|
+
console.log('select >>', value);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return /*#__PURE__*/React.createElement(BizSelect, {
|
|
19
|
+
options: options,
|
|
20
|
+
onChange: handleChange
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from 'antd/lib/select';
|
|
3
|
+
interface fieldNamesProps {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
interface BizSelectProps {
|
|
8
|
+
fieldNames?: fieldNamesProps;
|
|
9
|
+
defaultValue?: string | number;
|
|
10
|
+
/**
|
|
11
|
+
* @description 下拉名称
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
name?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @description 创建option回调
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
createOption?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* @description 是否搜索option
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
search?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @description 是否有创建option
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
create?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @description 文本框类
|
|
32
|
+
* @default small
|
|
33
|
+
*/
|
|
34
|
+
inputClass?: string;
|
|
35
|
+
/**
|
|
36
|
+
* @description 弹窗样式
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
isDialog?: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare const BizSelect: React.FC<BizSelectProps & SelectProps>;
|
|
42
|
+
export default BizSelect;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
var _excluded = ["value", "defaultValue", "isDialog", "placeholder", "fieldNames", "inputClass", "size", "createOption", "search", "create", "options", "name", "bordered"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
11
|
+
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."); }
|
|
12
|
+
|
|
13
|
+
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 _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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
import { Input, Select } from 'antd';
|
|
26
|
+
import React, { useState } from 'react';
|
|
27
|
+
import { IconFont } from '..';
|
|
28
|
+
import { util } from '../utils';
|
|
29
|
+
var Option = Select.Option;
|
|
30
|
+
|
|
31
|
+
var BizSelect = function BizSelect(props) {
|
|
32
|
+
var value = props.value,
|
|
33
|
+
defaultValue = props.defaultValue,
|
|
34
|
+
_props$isDialog = props.isDialog,
|
|
35
|
+
isDialog = _props$isDialog === void 0 ? false : _props$isDialog,
|
|
36
|
+
_props$placeholder = props.placeholder,
|
|
37
|
+
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
|
38
|
+
_props$fieldNames = props.fieldNames,
|
|
39
|
+
fieldNames = _props$fieldNames === void 0 ? {
|
|
40
|
+
label: 'label',
|
|
41
|
+
value: 'value'
|
|
42
|
+
} : _props$fieldNames,
|
|
43
|
+
inputClass = props.inputClass,
|
|
44
|
+
_props$size = props.size,
|
|
45
|
+
size = _props$size === void 0 ? 'small' : _props$size,
|
|
46
|
+
createOption = props.createOption,
|
|
47
|
+
_props$search = props.search,
|
|
48
|
+
search = _props$search === void 0 ? false : _props$search,
|
|
49
|
+
_props$create = props.create,
|
|
50
|
+
create = _props$create === void 0 ? false : _props$create,
|
|
51
|
+
options = props.options,
|
|
52
|
+
_props$name = props.name,
|
|
53
|
+
name = _props$name === void 0 ? '' : _props$name,
|
|
54
|
+
_props$bordered = props.bordered,
|
|
55
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
56
|
+
res = _objectWithoutProperties(props, _excluded);
|
|
57
|
+
|
|
58
|
+
var _useState = useState(''),
|
|
59
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
60
|
+
searchValue = _useState2[0],
|
|
61
|
+
setSearchValue = _useState2[1];
|
|
62
|
+
|
|
63
|
+
var _useState3 = useState(options || []),
|
|
64
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
65
|
+
originalOption = _useState4[0],
|
|
66
|
+
setOriginalOption = _useState4[1];
|
|
67
|
+
|
|
68
|
+
var _useState5 = useState(options || []),
|
|
69
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
70
|
+
currentOption = _useState6[0],
|
|
71
|
+
setCurrentOption = _useState6[1];
|
|
72
|
+
|
|
73
|
+
return /*#__PURE__*/React.createElement(Select, _objectSpread(_objectSpread({
|
|
74
|
+
className: size,
|
|
75
|
+
defaultValue: defaultValue || value,
|
|
76
|
+
dropdownClassName: "biz-single-select-dropdown",
|
|
77
|
+
placeholder: placeholder || "\u8BF7\u9009\u62E9".concat(name || '')
|
|
78
|
+
}, res), {}, {
|
|
79
|
+
bordered: bordered,
|
|
80
|
+
defaultOpen: false,
|
|
81
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
82
|
+
className: "biz-icon1",
|
|
83
|
+
type: 'icon-xiangxia'
|
|
84
|
+
}),
|
|
85
|
+
dropdownRender: function dropdownRender(menu) {
|
|
86
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, search && /*#__PURE__*/React.createElement(Input, {
|
|
87
|
+
className: "biz-search-box",
|
|
88
|
+
prefix: /*#__PURE__*/React.createElement(IconFont, {
|
|
89
|
+
className: "biz-icon biz-input-icon",
|
|
90
|
+
type: 'icon-sousuo'
|
|
91
|
+
}),
|
|
92
|
+
allowClear: {
|
|
93
|
+
clearIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
94
|
+
className: "biz-icon",
|
|
95
|
+
type: 'icon-qingchu'
|
|
96
|
+
})
|
|
97
|
+
},
|
|
98
|
+
value: searchValue,
|
|
99
|
+
placeholder: "\u641C\u7D22".concat(name),
|
|
100
|
+
onChange: function onChange(e) {
|
|
101
|
+
var value = e.target.value;
|
|
102
|
+
setSearchValue(function () {
|
|
103
|
+
return value;
|
|
104
|
+
});
|
|
105
|
+
var reg = new RegExp(value);
|
|
106
|
+
setCurrentOption(function () {
|
|
107
|
+
return originalOption.filter(function (item) {
|
|
108
|
+
return reg.test(item[fieldNames.label] || item);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}), create && /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: "biz-icon-add mb-12",
|
|
114
|
+
onClick: function onClick() {
|
|
115
|
+
return createOption && createOption();
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
118
|
+
className: "biz-icon",
|
|
119
|
+
type: 'icon-tianjia1'
|
|
120
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
121
|
+
className: "biz-icon-text"
|
|
122
|
+
}, "\u6DFB\u52A0".concat(name))), menu);
|
|
123
|
+
}
|
|
124
|
+
}), currentOption.map(function (item) {
|
|
125
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
126
|
+
value: item[fieldNames.value] || item,
|
|
127
|
+
key: item[fieldNames.value] || item
|
|
128
|
+
}, item.icon && /*#__PURE__*/React.createElement(IconFont, {
|
|
129
|
+
style: {
|
|
130
|
+
marginRight: '7px',
|
|
131
|
+
fontSize: '16px'
|
|
132
|
+
},
|
|
133
|
+
type: item.icon
|
|
134
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
135
|
+
dangerouslySetInnerHTML: {
|
|
136
|
+
__html: util.setHighLight(item[fieldNames.label] || item, searchValue)
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
}));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export default BizSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const chartColors: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var chartColors = ['#165DFF', '#CDDBFD', '#80E1D9', '#CDF3F0', '#65789B', '#CED4DE', '#F8BC3B', '#FCE7B9', '#6F66ED', '#D1CEFD', '#66AFED', '#D3E7F9', '#9661BC', '#DFCFEA', '#FF7557', '#FFD1C7', '#4DB273', '#BBDEC8', '#F08BB4', '#FFE0ED'];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
xData: ['2022-03-31', '2022-04-01', '2022-04-02', '2022-04-03', '2022-04-04', '2022-04-05', '2022-04-06', '2022-04-07', '2022-04-08', '2022-04-09', '2022-04-10', '2022-04-11', '2022-04-12', '2022-04-13'],
|
|
3
|
+
seriesData: [{
|
|
4
|
+
name: '付款成功',
|
|
5
|
+
data: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
|
|
6
|
+
}, {
|
|
7
|
+
name: '注册-发送手机验证码',
|
|
8
|
+
data: [11, 10, 7, 5, 13, 18, 14, 17, 11, 6, 10, 12, 15, 10]
|
|
9
|
+
}, {
|
|
10
|
+
name: '搜索商品',
|
|
11
|
+
data: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79]
|
|
12
|
+
}, {
|
|
13
|
+
name: 'pv',
|
|
14
|
+
data: [104, 89, 109, 103, 112, 93, 87, 101, 101, 97, 102, 110, 106, 98]
|
|
15
|
+
}, {
|
|
16
|
+
name: '查看商品详情',
|
|
17
|
+
data: [122, 107, 132, 113, 133, 115, 106, 127, 132, 117, 119, 123, 119, 117]
|
|
18
|
+
}, {
|
|
19
|
+
name: 'scroll',
|
|
20
|
+
data: [98, 96, 106, 109, 113, 105, 91, 111, 99, 99, 104, 108, 116, 92]
|
|
21
|
+
}, {
|
|
22
|
+
name: ['click'],
|
|
23
|
+
data: [108, 102, 111, 90, 111, 105, 91, 129, 117, 101, 109, 109, 105, 96]
|
|
24
|
+
}, {
|
|
25
|
+
name: ['申请退货'],
|
|
26
|
+
data: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10]
|
|
27
|
+
}, {
|
|
28
|
+
name: ['wxshare'],
|
|
29
|
+
data: [96, 89, 113, 100, 107, 109, 84, 106, 107, 100, 102, 106, 104, 90]
|
|
30
|
+
}, {
|
|
31
|
+
name: ['wxsopen'],
|
|
32
|
+
data: [92, 89, 118, 108, 128, 107, 103, 124, 107, 100, 115, 104, 99, 99]
|
|
33
|
+
}, {
|
|
34
|
+
name: ['进入购物车'],
|
|
35
|
+
data: [42, 44, 50, 47, 40, 49, 32, 50, 42, 40, 42, 39, 41, 32]
|
|
36
|
+
}]
|
|
37
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export var columns = [{
|
|
2
|
+
title: 'Full Name',
|
|
3
|
+
width: 100,
|
|
4
|
+
dataIndex: 'name',
|
|
5
|
+
key: 'name'
|
|
6
|
+
}, {
|
|
7
|
+
title: 'Age',
|
|
8
|
+
width: 100,
|
|
9
|
+
dataIndex: 'age',
|
|
10
|
+
key: 'age'
|
|
11
|
+
}, {
|
|
12
|
+
title: 'Column 1',
|
|
13
|
+
dataIndex: 'address',
|
|
14
|
+
key: '1'
|
|
15
|
+
}, {
|
|
16
|
+
title: 'Column 2',
|
|
17
|
+
dataIndex: 'address',
|
|
18
|
+
key: '2'
|
|
19
|
+
}, {
|
|
20
|
+
title: '操作',
|
|
21
|
+
dataIndex: 'operation',
|
|
22
|
+
render: function render(_, record) {
|
|
23
|
+
return 'Delete';
|
|
24
|
+
}
|
|
25
|
+
}];
|
|
26
|
+
var tableData = [];
|
|
27
|
+
|
|
28
|
+
for (var i = 0; i < 100; i++) {
|
|
29
|
+
tableData.push({
|
|
30
|
+
key: i,
|
|
31
|
+
name: "Edrward ".concat(i),
|
|
32
|
+
age: 32,
|
|
33
|
+
address: "London Park no. ".concat(i)
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default tableData;
|