@zgfe/business-lib 1.1.13-y.0 → 1.1.13
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/index.js +1 -0
- package/es/attrConditions/demo/index.js +0 -2
- package/es/attrConditions/index.js +1 -3
- package/es/attrConditions/types.d.ts +1 -2
- package/es/attributeSelector/demo/index.js +2 -3
- package/es/attributeSelector/index.js +7 -38
- package/es/attributeSelector/listPanel.js +1 -42
- package/es/attributeSelector/types.d.ts +4 -5
- package/es/chart/index.js +1 -0
- package/es/chart/styles/index.less +11 -2
- package/es/chart/types.d.ts +2 -2
- package/es/chart/util/chartOptionConfig.js +7 -1
- package/es/chart/util/formatData.js +1 -1
- package/es/chart/util/formatOption.js +1 -1
- package/es/searchInput/index.d.ts +1 -0
- package/es/searchInput/index.js +6 -1
- package/es/select/index.js +1 -1
- package/es/select/option.js +37 -6
- package/es/targetConditionGroup/index.js +2 -1
- package/es/userCondition/types.d.ts +1 -1
- package/es/userGroup/index.js +12 -6
- package/es/userGroup/types.d.ts +1 -1
- package/package.json +2 -2
package/es/addToPanel/index.js
CHANGED
|
@@ -47,8 +47,6 @@ export default (function () {
|
|
|
47
47
|
name: "condition"
|
|
48
48
|
}, /*#__PURE__*/React.createElement(BizConditionItem, {
|
|
49
49
|
enableEventProp: true,
|
|
50
|
-
showCommonAttr: true,
|
|
51
|
-
eventIdList: [3767, 3768],
|
|
52
50
|
disableItemList: [{
|
|
53
51
|
name: 'is_anonymous',
|
|
54
52
|
propCategory: 'userProp'
|
|
@@ -30,8 +30,7 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
30
30
|
enableEnvProp = props.enableEnvProp,
|
|
31
31
|
disableItemList = props.disableItemList,
|
|
32
32
|
border = props.border,
|
|
33
|
-
theme = props.theme
|
|
34
|
-
showCommonAttr = props.showCommonAttr;
|
|
33
|
+
theme = props.theme;
|
|
35
34
|
|
|
36
35
|
var _useState = useState(),
|
|
37
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -146,7 +145,6 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
146
145
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
147
146
|
value: attr,
|
|
148
147
|
eventIdList: eventIdList,
|
|
149
|
-
showCommonAttr: showCommonAttr,
|
|
150
148
|
enableDelete: enableDelete,
|
|
151
149
|
enableEventProp: enableEventProp,
|
|
152
150
|
enableUserProp: enableUserProp,
|
|
@@ -11,7 +11,7 @@ interface BasicAttrTypes {
|
|
|
11
11
|
export declare namespace AttrConditionTypes {
|
|
12
12
|
interface ItemValue {
|
|
13
13
|
subtype?: number;
|
|
14
|
-
attrId?: number
|
|
14
|
+
attrId?: number;
|
|
15
15
|
attrName?: string;
|
|
16
16
|
label?: string;
|
|
17
17
|
type?: PropType;
|
|
@@ -32,7 +32,6 @@ export declare namespace AttrConditionTypes {
|
|
|
32
32
|
onDelete?: (value?: ItemValue) => void;
|
|
33
33
|
border?: boolean;
|
|
34
34
|
destroyPopupOnHide?: boolean;
|
|
35
|
-
showCommonAttr?: boolean;
|
|
36
35
|
}
|
|
37
36
|
interface GroupProp extends BasicAttrTypes {
|
|
38
37
|
defaultValue?: GroupValue;
|
|
@@ -19,7 +19,7 @@ import userData from './userData.js';
|
|
|
19
19
|
import convertAttributeData from '../util';
|
|
20
20
|
export default (function () {
|
|
21
21
|
var _useState = useState({
|
|
22
|
-
id:
|
|
22
|
+
id: 30183426,
|
|
23
23
|
propCategory: 'eventProp'
|
|
24
24
|
}),
|
|
25
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -45,8 +45,7 @@ export default (function () {
|
|
|
45
45
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
46
46
|
enableEventProp: true,
|
|
47
47
|
enableUserProp: true,
|
|
48
|
-
|
|
49
|
-
eventIdList: [24143016, 24143017],
|
|
48
|
+
eventIdList: [24143016],
|
|
50
49
|
value: attribute,
|
|
51
50
|
onChange: onChange,
|
|
52
51
|
enableDelete: true,
|
|
@@ -4,14 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
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
6
|
|
|
7
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
|
|
9
|
-
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."); }
|
|
10
|
-
|
|
11
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
-
|
|
13
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
|
-
|
|
15
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
8
|
|
|
17
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."); }
|
|
@@ -24,20 +16,18 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
24
16
|
|
|
25
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
18
|
|
|
27
|
-
import React, { useContext, useEffect,
|
|
19
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
28
20
|
import './styles/index.less';
|
|
29
21
|
import { Dropdown, Tooltip } from 'antd';
|
|
30
22
|
import AttrListPanel from './listPanel';
|
|
31
23
|
import IconFont from '../icon/iconFont';
|
|
32
24
|
import { BizGlobalDataContext } from '..';
|
|
33
25
|
import SelectHandle from '../select/handle';
|
|
34
|
-
import _ from 'lodash';
|
|
35
26
|
|
|
36
27
|
var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
37
28
|
var enableDelete = props.enableDelete,
|
|
38
29
|
placeholder = props.placeholder,
|
|
39
|
-
theme = props.theme
|
|
40
|
-
eventIdList = props.eventIdList;
|
|
30
|
+
theme = props.theme;
|
|
41
31
|
|
|
42
32
|
var _useState = useState(),
|
|
43
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -67,17 +57,6 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
67
57
|
width = _useState8[0],
|
|
68
58
|
setWidth = _useState8[1];
|
|
69
59
|
|
|
70
|
-
var eventIdMap = useMemo(function () {
|
|
71
|
-
var eventIdMap = {};
|
|
72
|
-
var eventList = (eventGroupList || []).reduce(function (pre, group) {
|
|
73
|
-
return [].concat(_toConsumableArray(pre), _toConsumableArray(group.eventList));
|
|
74
|
-
}, []);
|
|
75
|
-
eventList.forEach(function (event) {
|
|
76
|
-
if (eventIdMap[event.id]) return;
|
|
77
|
-
eventIdMap[event.id] = event;
|
|
78
|
-
});
|
|
79
|
-
return eventIdMap;
|
|
80
|
-
}, [eventGroupList]);
|
|
81
60
|
useEffect(function () {
|
|
82
61
|
setWidth(boxRef.current.width || 284);
|
|
83
62
|
if (!props.defaultValue) return;
|
|
@@ -95,21 +74,11 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
95
74
|
if (attr.name === param.name) res = attr;
|
|
96
75
|
});
|
|
97
76
|
} else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'eventProp') {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (res) {
|
|
104
|
-
res.id += ",".concat(attr.id);
|
|
105
|
-
res.key += ",".concat(attr.key);
|
|
106
|
-
res.eventId += ",".concat(attr.eventId);
|
|
107
|
-
} else {
|
|
108
|
-
res = _.cloneDeep(attr);
|
|
109
|
-
}
|
|
110
|
-
} else if (attr.id === param.id) {
|
|
111
|
-
res = attr;
|
|
112
|
-
}
|
|
77
|
+
eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
|
|
78
|
+
group.eventList.forEach(function (event) {
|
|
79
|
+
event.attrList.forEach(function (attr) {
|
|
80
|
+
if (attr.id === param.id) res = attr;
|
|
81
|
+
});
|
|
113
82
|
});
|
|
114
83
|
});
|
|
115
84
|
} else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'userProp') {
|
|
@@ -1,9 +1,3 @@
|
|
|
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
|
-
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 _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
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
2
|
|
|
9
3
|
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."); }
|
|
@@ -39,8 +33,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
39
33
|
enableEnvProp = props.enableEnvProp,
|
|
40
34
|
enableEventProp = props.enableEventProp,
|
|
41
35
|
enableUserProp = props.enableUserProp,
|
|
42
|
-
eventIdList = props.eventIdList
|
|
43
|
-
showCommonAttr = props.showCommonAttr;
|
|
36
|
+
eventIdList = props.eventIdList;
|
|
44
37
|
|
|
45
38
|
var _useState = useState(''),
|
|
46
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -96,34 +89,9 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
96
89
|
|
|
97
90
|
if (enableEventProp) {
|
|
98
91
|
var hasAnchor = false;
|
|
99
|
-
var eventShareAttrObj = {};
|
|
100
|
-
var eventShareAttrList = [];
|
|
101
92
|
eventIdList === null || eventIdList === void 0 ? void 0 : eventIdList.forEach(function (id) {
|
|
102
93
|
var event = eventIdMap[id];
|
|
103
94
|
if (!event) return;
|
|
104
|
-
event.attrList.forEach(function (item) {
|
|
105
|
-
if (eventShareAttrObj[item.label]) {
|
|
106
|
-
var itemData = eventShareAttrObj[item.label];
|
|
107
|
-
itemData.frequency = itemData.frequency + 1;
|
|
108
|
-
itemData.id += ",".concat(item.id);
|
|
109
|
-
itemData.eventId += ",".concat(item.eventId);
|
|
110
|
-
itemData.key += ",".concat(item.key);
|
|
111
|
-
} else {
|
|
112
|
-
eventShareAttrObj[item.label] = _objectSpread(_objectSpread({}, item), {}, {
|
|
113
|
-
frequency: 1
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
if (Object.keys(eventShareAttrObj).length > 0) {
|
|
119
|
-
for (var key in eventShareAttrObj) {
|
|
120
|
-
if (eventShareAttrObj[key].frequency > 1) {
|
|
121
|
-
delete eventShareAttrObj[key].frequency;
|
|
122
|
-
eventShareAttrList.push(eventShareAttrObj[key]);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
95
|
var group = {
|
|
128
96
|
isEvent: true,
|
|
129
97
|
groupName: event.alias || event.name,
|
|
@@ -133,15 +101,6 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
133
101
|
};
|
|
134
102
|
list.push(group);
|
|
135
103
|
});
|
|
136
|
-
|
|
137
|
-
if (eventShareAttrList.length > 0 && showCommonAttr) {
|
|
138
|
-
list.unshift({
|
|
139
|
-
groupName: '事件共有属性',
|
|
140
|
-
anchor: hasAnchor ? String(Math.random()) : anchor.event,
|
|
141
|
-
key: "event-".concat(Math.random()),
|
|
142
|
-
children: eventShareAttrList.slice()
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
104
|
}
|
|
146
105
|
|
|
147
106
|
if (enableUserProp) {
|
|
@@ -31,7 +31,7 @@ export interface EventGroup {
|
|
|
31
31
|
eventList: AnalysisEvent[];
|
|
32
32
|
}
|
|
33
33
|
export interface BasicProp {
|
|
34
|
-
id: number
|
|
34
|
+
id: number;
|
|
35
35
|
label?: string;
|
|
36
36
|
alias?: string;
|
|
37
37
|
type?: PropType;
|
|
@@ -53,9 +53,9 @@ export interface EnvProp extends BasicProp {
|
|
|
53
53
|
key?: string;
|
|
54
54
|
}
|
|
55
55
|
export interface EventProp extends BasicProp {
|
|
56
|
-
eventId?: number
|
|
56
|
+
eventId?: number;
|
|
57
57
|
propCategory: 'eventProp';
|
|
58
|
-
key?: number
|
|
58
|
+
key?: number;
|
|
59
59
|
}
|
|
60
60
|
export interface PropGroups {
|
|
61
61
|
eventGroupList?: EventGroup[];
|
|
@@ -82,11 +82,10 @@ export declare namespace AttributeSelect {
|
|
|
82
82
|
theme?: string;
|
|
83
83
|
destroyPopupOnHide?: boolean;
|
|
84
84
|
size?: SizeType;
|
|
85
|
-
showCommonAttr?: boolean;
|
|
86
85
|
}
|
|
87
86
|
interface Option {
|
|
88
87
|
groupName: string;
|
|
89
|
-
isEvent
|
|
88
|
+
isEvent: boolean;
|
|
90
89
|
key: string;
|
|
91
90
|
anchor: string;
|
|
92
91
|
children: Value[];
|
package/es/chart/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@import '../../assets/styles/variable.less';
|
|
2
2
|
|
|
3
3
|
.biz-chart-tooltip {
|
|
4
|
+
max-height: 324px;
|
|
4
5
|
padding: @padding-xs;
|
|
6
|
+
overflow: auto;
|
|
5
7
|
background-color: rgba(250, 251, 253, 0.8);
|
|
6
8
|
border-color: transparent;
|
|
7
9
|
backdrop-filter: blur(4px);
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
display: flex;
|
|
19
21
|
align-items: center;
|
|
20
22
|
justify-content: space-between;
|
|
21
|
-
height: @height-sm;
|
|
23
|
+
min-height: @height-sm;
|
|
22
24
|
padding: 0px @padding-xs;
|
|
23
25
|
font-size: @font-size-sm;
|
|
24
26
|
background: @white;
|
|
@@ -30,15 +32,22 @@
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
.biz-chart-tooltip-content {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
33
37
|
color: @text-color-secondary;
|
|
34
38
|
|
|
35
39
|
.biz-tooltip-marker {
|
|
36
|
-
display: inline-block;
|
|
37
40
|
width: 8px;
|
|
38
41
|
height: 8px;
|
|
39
42
|
margin-right: @margin-xs;
|
|
40
43
|
border-radius: 50%;
|
|
41
44
|
}
|
|
45
|
+
.biz-tooltip-name {
|
|
46
|
+
max-width: 300px;
|
|
47
|
+
white-space: pre-wrap;
|
|
48
|
+
word-wrap: break-word;
|
|
49
|
+
word-break: break-all;
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
.biz-chart-tooltip-value {
|
package/es/chart/types.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export declare namespace ChartTypes {
|
|
|
23
23
|
series: Array<ChartItmProps>;
|
|
24
24
|
}
|
|
25
25
|
interface Props {
|
|
26
|
-
type
|
|
27
|
-
data
|
|
26
|
+
type?: 'bar' | 'pie' | 'line' | 'map';
|
|
27
|
+
data?: Value;
|
|
28
28
|
option?: EChartsOption;
|
|
29
29
|
isCity?: boolean;
|
|
30
30
|
userGroup?: string;
|
|
@@ -41,7 +41,12 @@ export var legendConfig = {
|
|
|
41
41
|
color: '#5F6085'
|
|
42
42
|
},
|
|
43
43
|
tooltip: {
|
|
44
|
-
show: true
|
|
44
|
+
show: true,
|
|
45
|
+
formatter: function formatter(param) {
|
|
46
|
+
var maxLength = 20;
|
|
47
|
+
var names = param.name.match(new RegExp("\\S{1,".concat(maxLength, "}"), 'g'));
|
|
48
|
+
return names ? names.join('<br/>') : '';
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
};
|
|
47
52
|
export var gridConfig = {
|
|
@@ -87,6 +92,7 @@ export var yAxisConfig = {
|
|
|
87
92
|
};
|
|
88
93
|
export var tooltipConfig = {
|
|
89
94
|
trigger: 'axis',
|
|
95
|
+
enterable: true,
|
|
90
96
|
confine: false,
|
|
91
97
|
backgroundColor: 'rgba(250, 251, 253, 0.8)',
|
|
92
98
|
borderColor: 'transparent',
|
|
@@ -28,7 +28,7 @@ export var formatPieData = function formatPieData(data, showAll, showList) {
|
|
|
28
28
|
};
|
|
29
29
|
export var formatChartData = function formatChartData(data, showAll, showList, reverseXAxis, color) {
|
|
30
30
|
var showMap = getShowMap(showList);
|
|
31
|
-
var x_axis = reverseXAxis ? [] : data.x_axis;
|
|
31
|
+
var x_axis = reverseXAxis && data.series.length ? [] : data.x_axis;
|
|
32
32
|
var sData = [];
|
|
33
33
|
var colorData = color || chartColors;
|
|
34
34
|
data.series.forEach(function (seriesItem) {
|
|
@@ -27,7 +27,7 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
var name = (params.length > 1 ? item.seriesName : item.data && item.data.label ? item.data.label : item.name).trim();
|
|
30
|
-
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <
|
|
30
|
+
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"biz-tooltip-marker\" style=\"background:".concat(item.color, "\"></span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(lineLabel, "</span>\n </div>"));
|
|
31
31
|
});
|
|
32
32
|
return htmlArray.join('');
|
|
33
33
|
};
|
package/es/searchInput/index.js
CHANGED
|
@@ -11,6 +11,10 @@ var BizSearchInput = function BizSearchInput(props) {
|
|
|
11
11
|
if (props.onChange) props.onChange(e.target.value);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
function onBlur(e) {
|
|
15
|
+
if (props.onBlur) props.onBlur(e.target.value);
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
return /*#__PURE__*/React.createElement(Input, {
|
|
15
19
|
className: className,
|
|
16
20
|
value: value,
|
|
@@ -24,7 +28,8 @@ var BizSearchInput = function BizSearchInput(props) {
|
|
|
24
28
|
},
|
|
25
29
|
placeholder: placeholder || '请输入',
|
|
26
30
|
autoFocus: true,
|
|
27
|
-
onChange: onChange
|
|
31
|
+
onChange: onChange,
|
|
32
|
+
onBlur: onBlur
|
|
28
33
|
});
|
|
29
34
|
};
|
|
30
35
|
|
package/es/select/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var BizSelect = function BizSelect(props) {
|
|
|
94
94
|
useEffect(function () {
|
|
95
95
|
if (!props.value) return;
|
|
96
96
|
setCurrent(getValue(props.value));
|
|
97
|
-
}, [props.value]);
|
|
97
|
+
}, [props.value, props.options]);
|
|
98
98
|
|
|
99
99
|
var getValue = function getValue(data) {
|
|
100
100
|
if (props.multiple) {
|
package/es/select/option.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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
|
+
|
|
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); }
|
|
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
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import { Tooltip } from 'antd';
|
|
14
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
15
|
import { classPrefix } from '.';
|
|
3
16
|
import IconFont from '../icon/iconFont';
|
|
4
17
|
import { util } from '../utils';
|
|
@@ -10,6 +23,20 @@ var SelectOption = function SelectOption(props) {
|
|
|
10
23
|
disabled = props.disabled,
|
|
11
24
|
multiple = props.multiple,
|
|
12
25
|
customLabel = props.customLabel;
|
|
26
|
+
var optionRef = useRef(null);
|
|
27
|
+
|
|
28
|
+
var _useState = useState(false),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
isOverflow = _useState2[0],
|
|
31
|
+
setIsOverflow = _useState2[1];
|
|
32
|
+
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
var _optionRef$current, _optionRef$current2;
|
|
35
|
+
|
|
36
|
+
var clientWidth = (_optionRef$current = optionRef.current) === null || _optionRef$current === void 0 ? void 0 : _optionRef$current.clientWidth;
|
|
37
|
+
var scrollWidth = (_optionRef$current2 = optionRef.current) === null || _optionRef$current2 === void 0 ? void 0 : _optionRef$current2.scrollWidth;
|
|
38
|
+
setIsOverflow(clientWidth < scrollWidth);
|
|
39
|
+
}, []);
|
|
13
40
|
|
|
14
41
|
function onClick() {
|
|
15
42
|
if (disabled) return;
|
|
@@ -43,10 +70,13 @@ var SelectOption = function SelectOption(props) {
|
|
|
43
70
|
}), /*#__PURE__*/React.createElement("span", null, group.name));
|
|
44
71
|
}
|
|
45
72
|
|
|
46
|
-
return /*#__PURE__*/React.createElement(
|
|
73
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
74
|
+
placement: "rightBottom",
|
|
75
|
+
title: isOverflow ? option[props.labelField] : null,
|
|
76
|
+
zIndex: 100000
|
|
77
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
47
78
|
className: "".concat(classPrefix, "-option ").concat(multiple ? classPrefix + '-option-multiple' : '', " ").concat(checked ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
|
|
48
|
-
onClick: onClick
|
|
49
|
-
title: option[props.labelField]
|
|
79
|
+
onClick: onClick
|
|
50
80
|
}, multiple && (checked ? /*#__PURE__*/React.createElement(IconFont, {
|
|
51
81
|
className: "".concat(classPrefix, "-checkbox ").concat(classPrefix, "-checked"),
|
|
52
82
|
type: 'a-Property1xuanzhong'
|
|
@@ -56,10 +86,11 @@ var SelectOption = function SelectOption(props) {
|
|
|
56
86
|
})), (option === null || option === void 0 ? void 0 : option.icon) && /*#__PURE__*/React.createElement("span", {
|
|
57
87
|
className: "".concat(classPrefix, "-option-icon")
|
|
58
88
|
}, option === null || option === void 0 ? void 0 : option.icon), /*#__PURE__*/React.createElement("span", {
|
|
59
|
-
className: "".concat(classPrefix, "-option-label")
|
|
89
|
+
className: "".concat(classPrefix, "-option-label"),
|
|
90
|
+
ref: optionRef
|
|
60
91
|
}, renderLabel(option)), !disabled && /*#__PURE__*/React.createElement("span", {
|
|
61
92
|
className: "".concat(classPrefix, "-option-btn")
|
|
62
|
-
}, props.extra && props.extra(option)));
|
|
93
|
+
}, props.extra && props.extra(option))));
|
|
63
94
|
};
|
|
64
95
|
|
|
65
96
|
export default SelectOption;
|
|
@@ -31,7 +31,8 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
31
31
|
setTargetData = _useState2[1];
|
|
32
32
|
|
|
33
33
|
var _useContext = useContext(BizGlobalDataContext),
|
|
34
|
-
|
|
34
|
+
_useContext$eventGrou = _useContext.eventGroupList,
|
|
35
|
+
eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou;
|
|
35
36
|
|
|
36
37
|
var _useState3 = useState({
|
|
37
38
|
analysisIndex: 'number'
|
|
@@ -63,7 +63,7 @@ export declare namespace BizUserConditionT {
|
|
|
63
63
|
}[];
|
|
64
64
|
}
|
|
65
65
|
interface AttrCondition {
|
|
66
|
-
attrId: number
|
|
66
|
+
attrId: number;
|
|
67
67
|
attrName: string;
|
|
68
68
|
operator: 'is not null' | 'is null' | 'not contains' | 'contains' | 'equal' | 'not equal' | 'begin with' | 'not begin with' | 'end with' | 'not end with' | Unpacked<RunTimesI, 'operator'>;
|
|
69
69
|
params: string[];
|
package/es/userGroup/index.js
CHANGED
|
@@ -10,11 +10,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
10
10
|
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
12
|
|
|
13
|
-
import React, { useEffect, useState } from 'react';
|
|
13
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
14
14
|
import './styles/index.less';
|
|
15
15
|
import BizSelect from '../select';
|
|
16
16
|
import BizTargetOptionIcon from '../targetSelector/optionIcon';
|
|
17
17
|
import { Skeleton } from 'antd';
|
|
18
|
+
import BizGlobalDataContext from '../context';
|
|
18
19
|
|
|
19
20
|
var BizUserGroup = function BizUserGroup(props) {
|
|
20
21
|
var enableDelete = props.enableDelete,
|
|
@@ -28,10 +29,15 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
28
29
|
|
|
29
30
|
var _useState3 = useState(true),
|
|
30
31
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
loading = _useState4[0],
|
|
33
|
+
setLoading = _useState4[1];
|
|
33
34
|
|
|
34
35
|
var classPrefix = 'biz-user';
|
|
36
|
+
|
|
37
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
38
|
+
_useContext$userGroup = _useContext.userGroupList,
|
|
39
|
+
userGroupList = _useContext$userGroup === void 0 ? [] : _useContext$userGroup;
|
|
40
|
+
|
|
35
41
|
useEffect(function () {
|
|
36
42
|
var value = props.defaultValue || props.value;
|
|
37
43
|
|
|
@@ -39,7 +45,7 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
39
45
|
setCurrent(value);
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
setLoading(false);
|
|
43
49
|
}, []);
|
|
44
50
|
|
|
45
51
|
var onClickDelete = function onClickDelete() {
|
|
@@ -54,14 +60,14 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
54
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
61
|
className: classPrefix
|
|
56
62
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
57
|
-
loading:
|
|
63
|
+
loading: loading,
|
|
58
64
|
active: true,
|
|
59
65
|
paragraph: {
|
|
60
66
|
rows: 1
|
|
61
67
|
}
|
|
62
68
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
63
69
|
value: current,
|
|
64
|
-
options: props.options,
|
|
70
|
+
options: props.options || userGroupList,
|
|
65
71
|
keyField: keyField,
|
|
66
72
|
labelField: labelField,
|
|
67
73
|
theme: "secondary",
|
package/es/userGroup/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare namespace UserGroupTypes {
|
|
|
4
4
|
defaultValue?: BizSelectTypes.Option;
|
|
5
5
|
value?: BizSelectTypes.Option;
|
|
6
6
|
className?: string;
|
|
7
|
-
options
|
|
7
|
+
options?: BizSelectTypes.Option[];
|
|
8
8
|
labelField?: string;
|
|
9
9
|
keyField?: string;
|
|
10
10
|
enableDelete?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.13
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.12.0 || ^17.0.0",
|
|
61
61
|
"yorkie": "^2.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "eda6d32cdf2b104bb099ce3803426754b616335e"
|
|
64
64
|
}
|