@zgfe/business-lib 1.0.29 → 1.0.30-demo.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/addToPanel/index.js +6 -2
- package/es/addToScene/index.js +6 -2
- package/es/attributeSelector/option.js +24 -4
- package/es/attributeSelector/util.d.ts +1 -0
- package/es/attributeSelector/util.js +62 -0
- package/es/layout/detail/index.less +2 -3
- package/es/select/index.js +2 -1
- package/es/select/overlay.js +2 -1
- package/es/select/types.d.ts +2 -0
- package/package.json +2 -2
package/es/addToPanel/index.js
CHANGED
|
@@ -57,7 +57,8 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
57
57
|
var _useContext = useContext(BizGlobalDataContext),
|
|
58
58
|
currentApp = _useContext.currentApp,
|
|
59
59
|
router = _useContext.router,
|
|
60
|
-
routes = _useContext.routes
|
|
60
|
+
routes = _useContext.routes,
|
|
61
|
+
isDemo = _useContext.isDemo;
|
|
61
62
|
|
|
62
63
|
useEffect(function () {
|
|
63
64
|
if (props.defaultValue) {
|
|
@@ -215,7 +216,10 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
215
216
|
onCancel: props.onCancel,
|
|
216
217
|
onOk: onAdd,
|
|
217
218
|
confirmLoading: loading,
|
|
218
|
-
className: classPrefix
|
|
219
|
+
className: classPrefix,
|
|
220
|
+
okButtonProps: {
|
|
221
|
+
disabled: isDemo
|
|
222
|
+
}
|
|
219
223
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
220
224
|
ref: refForm,
|
|
221
225
|
onFinish: onSubmit,
|
package/es/addToScene/index.js
CHANGED
|
@@ -41,7 +41,8 @@ var BizAddToScene = function BizAddToScene(props) {
|
|
|
41
41
|
setLoading = _useState6[1];
|
|
42
42
|
|
|
43
43
|
var _useContext = useContext(BizGlobalDataContext),
|
|
44
|
-
currentApp = _useContext.currentApp
|
|
44
|
+
currentApp = _useContext.currentApp,
|
|
45
|
+
isDemo = _useContext.isDemo;
|
|
45
46
|
|
|
46
47
|
var refForm = useRef();
|
|
47
48
|
|
|
@@ -142,7 +143,10 @@ var BizAddToScene = function BizAddToScene(props) {
|
|
|
142
143
|
onOk: onSave,
|
|
143
144
|
onCancel: onCancel,
|
|
144
145
|
confirmLoading: loading,
|
|
145
|
-
className: classPrefix
|
|
146
|
+
className: classPrefix,
|
|
147
|
+
okButtonProps: {
|
|
148
|
+
disabled: isDemo
|
|
149
|
+
}
|
|
146
150
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
147
151
|
autoComplete: "off",
|
|
148
152
|
ref: refForm,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconFont } from '..';
|
|
3
3
|
import { util } from '../utils';
|
|
4
|
+
import { getIcon } from './util';
|
|
4
5
|
|
|
5
6
|
var Option = function Option(props) {
|
|
6
7
|
var option = props.option,
|
|
@@ -28,6 +29,28 @@ var Option = function Option(props) {
|
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
function renderIcon(option) {
|
|
33
|
+
var icon = '';
|
|
34
|
+
|
|
35
|
+
if (option && option.name) {
|
|
36
|
+
icon = getIcon(option.name);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (icon) {
|
|
40
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
41
|
+
className: "".concat(classPrefix, "-option-icon"),
|
|
42
|
+
family: "zhuge",
|
|
43
|
+
type: icon
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
icon = (option === null || option === void 0 ? void 0 : option.propCategory) === 'userProp' ? 'yonghushuxing' : (option === null || option === void 0 ? void 0 : option.propCategory) === 'eventProp' ? 'shijianshuxing1' : 'chufahuanjing';
|
|
48
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
49
|
+
className: "".concat(classPrefix, "-option-icon"),
|
|
50
|
+
type: icon
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
31
54
|
if (group) {
|
|
32
55
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
56
|
id: group.anchor,
|
|
@@ -42,10 +65,7 @@ var Option = function Option(props) {
|
|
|
42
65
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
66
|
className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
|
|
44
67
|
onClick: onClick
|
|
45
|
-
}, /*#__PURE__*/React.createElement(
|
|
46
|
-
className: "".concat(classPrefix, "-option-icon"),
|
|
47
|
-
type: "".concat((option === null || option === void 0 ? void 0 : option.propCategory) === 'userProp' ? 'yonghushuxing' : (option === null || option === void 0 ? void 0 : option.propCategory) === 'eventProp' ? 'shijianshuxing1' : 'chufahuanjing')
|
|
48
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
68
|
+
}, renderIcon(option), /*#__PURE__*/React.createElement("span", {
|
|
49
69
|
title: (option === null || option === void 0 ? void 0 : option.alias) || (option === null || option === void 0 ? void 0 : option.label)
|
|
50
70
|
}, getLabel((option === null || option === void 0 ? void 0 : option.alias) || (option === null || option === void 0 ? void 0 : option.label))));
|
|
51
71
|
};
|
|
@@ -81,4 +81,66 @@ export default function convertAttributeData(store) {
|
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
83
|
return res;
|
|
84
|
+
}
|
|
85
|
+
export function getIcon(name) {
|
|
86
|
+
var hash = {
|
|
87
|
+
browser_brand: 'internet',
|
|
88
|
+
browser_version: 'internet',
|
|
89
|
+
website: 'web',
|
|
90
|
+
referer_url: 'web',
|
|
91
|
+
current_url: 'web',
|
|
92
|
+
country: 'region',
|
|
93
|
+
area: 'region',
|
|
94
|
+
city: 'region',
|
|
95
|
+
os: 'platform',
|
|
96
|
+
ov: 'platform',
|
|
97
|
+
resolution_h: 'platform',
|
|
98
|
+
resolution_l: 'platform',
|
|
99
|
+
first_referer_url: 'web',
|
|
100
|
+
ip: 'web',
|
|
101
|
+
utm_source: 'utm',
|
|
102
|
+
utm_medium: 'utm',
|
|
103
|
+
utm_campaign: 'utm',
|
|
104
|
+
utm_content: 'utm',
|
|
105
|
+
utm_term: 'utm',
|
|
106
|
+
version: 'overall',
|
|
107
|
+
channel: 'overall',
|
|
108
|
+
network: 'platform',
|
|
109
|
+
mccmnc: 'platform',
|
|
110
|
+
device_brand: 'overall',
|
|
111
|
+
device_model: 'overall',
|
|
112
|
+
event_duration: 'time',
|
|
113
|
+
first_visit_time: 'time',
|
|
114
|
+
last_visit_time: 'time',
|
|
115
|
+
visit_times: 'time',
|
|
116
|
+
duration: 'time',
|
|
117
|
+
name: 'personal',
|
|
118
|
+
app_user_id: 'personal',
|
|
119
|
+
zg_id: 'personal',
|
|
120
|
+
is_anonymous: 'type',
|
|
121
|
+
current_country: 'region',
|
|
122
|
+
current_area: 'region',
|
|
123
|
+
current_city: 'region',
|
|
124
|
+
current_app_version: 'overall',
|
|
125
|
+
current_app_channel: 'overall',
|
|
126
|
+
first_version: 'overall',
|
|
127
|
+
first_channel: 'overall',
|
|
128
|
+
current_device_brand: 'overall',
|
|
129
|
+
current_device_model: 'overall',
|
|
130
|
+
current_mccmnc: 'platform',
|
|
131
|
+
user_referer_url: 'web',
|
|
132
|
+
first_website: 'web',
|
|
133
|
+
first_utm_source: 'utm',
|
|
134
|
+
first_utm_medium: 'utm',
|
|
135
|
+
first_utm_campaign: 'utm',
|
|
136
|
+
first_utm_content: 'utm',
|
|
137
|
+
first_utm_term: 'utm',
|
|
138
|
+
current_browser_brand: 'internet',
|
|
139
|
+
current_browser_version: 'internet',
|
|
140
|
+
current_os: 'platform',
|
|
141
|
+
current_ov: 'platform',
|
|
142
|
+
current_resolution_h: 'platform',
|
|
143
|
+
current_resolution_l: 'platform'
|
|
144
|
+
};
|
|
145
|
+
return hash[name] ? 'icon-' + hash[name] : '';
|
|
84
146
|
}
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
margin: 0 auto;
|
|
8
8
|
&-menu {
|
|
9
9
|
flex: none;
|
|
10
|
-
padding
|
|
11
|
-
padding-bottom: @padding-md - 2;
|
|
10
|
+
padding: @padding-sm 0;
|
|
12
11
|
color: @text-color-secondary;
|
|
13
12
|
a {
|
|
14
13
|
margin-right: @margin-md;
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
}
|
|
21
20
|
&-content {
|
|
22
21
|
flex: 1;
|
|
23
|
-
padding: @padding-
|
|
22
|
+
padding: @padding-md @padding-lg @padding-lg @padding-lg;
|
|
24
23
|
overflow-y: auto;
|
|
25
24
|
background-color: @white;
|
|
26
25
|
border-radius: @border-radius-normal;
|
package/es/select/index.js
CHANGED
|
@@ -186,7 +186,8 @@ var BizSelect = function BizSelect(props) {
|
|
|
186
186
|
keyField: keyField,
|
|
187
187
|
searchValue: searchValue,
|
|
188
188
|
onChange: onChange,
|
|
189
|
-
ref: overlayRef
|
|
189
|
+
ref: overlayRef,
|
|
190
|
+
searchPlaceholder: props.searchPlaceholder
|
|
190
191
|
})),
|
|
191
192
|
disabled: props.disable,
|
|
192
193
|
destroyPopupOnHide: props.destroyPopupOnHide,
|
package/es/select/overlay.js
CHANGED
|
@@ -202,7 +202,8 @@ var SelectOverlay = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
202
202
|
ref: ref
|
|
203
203
|
}, props.enableSearch && !props.multiple && /*#__PURE__*/React.createElement(BizSearchInput, {
|
|
204
204
|
className: "".concat(classPrefix, "-search"),
|
|
205
|
-
onChange: onSearch
|
|
205
|
+
onChange: onSearch,
|
|
206
|
+
placeholder: props.searchPlaceholder || '请输入'
|
|
206
207
|
}), dropdownExtra, /*#__PURE__*/React.createElement("div", {
|
|
207
208
|
className: "".concat(classPrefix, "-list-panel")
|
|
208
209
|
}, render()));
|
package/es/select/types.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare namespace BizSelectTypes {
|
|
|
42
42
|
destroyPopupOnHide?: boolean;
|
|
43
43
|
customLabel?: (node: ReactNode, option: Option) => ReactNode;
|
|
44
44
|
onSearch?: (val: string) => void;
|
|
45
|
+
searchPlaceholder?: string;
|
|
45
46
|
}
|
|
46
47
|
interface OverlayProps {
|
|
47
48
|
option?: Option;
|
|
@@ -58,6 +59,7 @@ export declare namespace BizSelectTypes {
|
|
|
58
59
|
extra?: (option: Option) => ReactNode;
|
|
59
60
|
onClick?: (option: Option) => void;
|
|
60
61
|
customLabel?: (node: ReactNode, option: Option) => ReactNode;
|
|
62
|
+
searchPlaceholder?: string;
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
export interface HandlerTypes {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30-demo.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": "^16.12.0 || ^17.0.0",
|
|
59
59
|
"yorkie": "^2.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "f17869e61913062e80146820823870b52b06124c"
|
|
62
62
|
}
|