@zgfe/business-lib 1.0.15-user.2 → 1.0.15-user.6

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.
@@ -1,14 +1,24 @@
1
- export default {
2
- 'primary-color': '#165dff',
3
- 'border-color-base': '#ECEDF0',
4
- 'background-color-base': '#fafafb',
5
- 'text-color': '#021429',
6
- 'text-color-secondary': '#5f6085',
7
- 'tooltip-bg': '#242541',
8
- 'error-color': '#fb5547',
9
- 'shadow-color': 'rgba(0, 0, 0, 0.1)',
10
- 'box-shadow-base': '0px 4px 10px rgba(0, 0, 0, 0.1)',
11
- 'btn-text-hover-bg': '#cacdd4',
12
- 'warning-color': '#FD9F41',
13
- 'border-color-split': '#E8EFFF'
14
- };
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+
3
+ (function (global, factory) {
4
+ (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.acorn = {}));
5
+ })(this, function (exports) {
6
+ 'use strict';
7
+
8
+ exports.theme = {
9
+ 'primary-color': '#165dff',
10
+ 'border-color-base': '#ECEDF0',
11
+ 'background-color-base': '#fafafb',
12
+ 'text-color': '#021429',
13
+ // 正文
14
+ 'text-color-secondary': '#5f6085',
15
+ // 次要
16
+ 'tooltip-bg': '#242541',
17
+ 'error-color': '#fb5547',
18
+ 'shadow-color': 'rgba(0, 0, 0, 0.1)',
19
+ 'box-shadow-base': '0px 4px 10px rgba(0, 0, 0, 0.1)',
20
+ 'btn-text-hover-bg': '#cacdd4',
21
+ 'warning-color': '#FD9F41',
22
+ 'border-color-split': '#E8EFFF'
23
+ };
24
+ });
@@ -133,6 +133,8 @@ var EventListPanel = function EventListPanel(props) {
133
133
  }
134
134
 
135
135
  function onClickGroup(g) {
136
+ setCurrentGroup(g);
137
+
136
138
  if (defaultSelectAble) {
137
139
  var resVal = _.cloneDeep(currentValue) || {};
138
140
  resVal.group = g;
@@ -145,14 +147,6 @@ var EventListPanel = function EventListPanel(props) {
145
147
  }
146
148
  }
147
149
 
148
- function onHoverGroup(g) {
149
- setCurrentGroup(g);
150
- }
151
-
152
- function onMouseLeaveGroup() {
153
- setCurrentGroup(currentSelectGroup);
154
- }
155
-
156
150
  if (!groupList || !groupList.length || !groupList[0].eventList || !groupList[0].eventList.length) {
157
151
  return /*#__PURE__*/React.createElement("div", {
158
152
  className: "".concat(classPrefix, "-nodata-panel")
@@ -174,9 +168,7 @@ var EventListPanel = function EventListPanel(props) {
174
168
  key: group.id || 'overview',
175
169
  checked: (currentSelectGroup === null || currentSelectGroup === void 0 ? void 0 : currentSelectGroup.id) === group.id,
176
170
  data: group,
177
- onClick: onClickGroup,
178
- onMouseOver: onHoverGroup,
179
- onMouseLeave: onMouseLeaveGroup
171
+ onClick: onClickGroup
180
172
  });
181
173
  })), /*#__PURE__*/React.createElement("div", {
182
174
  className: "".concat(classPrefix, "-right")
@@ -11,7 +11,5 @@ declare const EventListOption: React.FC<{
11
11
  };
12
12
  data?: any;
13
13
  onClick?: (data: any) => void;
14
- onMouseOver?: (data: any) => void;
15
- onMouseLeave?: (data: any) => void;
16
14
  }>;
17
15
  export default EventListOption;
@@ -16,14 +16,6 @@ var EventListOption = function EventListOption(props) {
16
16
  if (onClick) onClick(data);
17
17
  };
18
18
 
19
- function onMouseOver() {
20
- if (props.onMouseOver) props.onMouseOver(data);
21
- }
22
-
23
- function onMouseLeave() {
24
- if (props.onMouseLeave) props.onMouseLeave(data);
25
- }
26
-
27
19
  function getLabel(label) {
28
20
  if (!highlight || !highlight.enable || !highlight.text) return label;
29
21
  var text = highlight.text;
@@ -40,9 +32,7 @@ var EventListOption = function EventListOption(props) {
40
32
 
41
33
  return /*#__PURE__*/React.createElement("div", {
42
34
  className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : ''),
43
- onClick: _onClick,
44
- onMouseOver: onMouseOver,
45
- onMouseLeave: onMouseLeave
35
+ onClick: _onClick
46
36
  }, /*#__PURE__*/React.createElement("div", {
47
37
  className: "".concat(classPrefix, "-option-label"),
48
38
  title: label
package/es/index.d.ts CHANGED
@@ -14,7 +14,7 @@ import BizChart from './chart';
14
14
  import BizTable from './table';
15
15
  import IconFont from './icon/iconFont';
16
16
  import { util, ajax } from './utils';
17
- import theme from './assets/theme';
17
+ import theme from './assets/theme.js';
18
18
  import convertAttributeData from './attributeSelector/util';
19
19
  import BizGlobalDataContext from './context';
20
20
  import BizUserCondition from './userCondition';
package/es/index.js CHANGED
@@ -13,7 +13,7 @@ import BizChart from './chart';
13
13
  import BizTable from './table';
14
14
  import IconFont from './icon/iconFont';
15
15
  import { util, ajax } from './utils';
16
- import theme from './assets/theme';
16
+ import theme from './assets/theme.js';
17
17
  import convertAttributeData from './attributeSelector/util';
18
18
  import BizGlobalDataContext from './context';
19
19
  import BizUserCondition from './userCondition';
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { BizSelect } from '@zgfe/business-lib';
3
+ import userData from '../../mock/user';
4
+ import convertAttributeData from '../../attributeSelector/util';
5
+ export default (function () {
6
+ var store = convertAttributeData({
7
+ userPropList: userData
8
+ });
9
+
10
+ function renderLabel(node, option) {
11
+ return /*#__PURE__*/React.createElement(React.Fragment, null, node, option.realTime ? '*' : null);
12
+ }
13
+
14
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSelect, {
15
+ options: store.userPropList,
16
+ customLabel: renderLabel,
17
+ labelField: "name",
18
+ keyField: "name",
19
+ theme: "secondary",
20
+ popupContainer: true,
21
+ enableSearch: true
22
+ }));
23
+ });
@@ -8,7 +8,8 @@ var SelectOption = function SelectOption(props) {
8
8
  group = props.group,
9
9
  checked = props.checked,
10
10
  disabled = props.disabled,
11
- multiple = props.multiple;
11
+ multiple = props.multiple,
12
+ customLabel = props.customLabel;
12
13
 
13
14
  function onClick() {
14
15
  if (disabled) return;
@@ -29,6 +30,11 @@ var SelectOption = function SelectOption(props) {
29
30
  });
30
31
  }
31
32
 
33
+ function renderLabel(option) {
34
+ var dom = getLabel(option[props.labelField]);
35
+ return customLabel ? customLabel(dom, option) : dom;
36
+ }
37
+
32
38
  if (group) {
33
39
  return /*#__PURE__*/React.createElement("div", {
34
40
  className: "".concat(classPrefix, "-group")
@@ -51,7 +57,7 @@ var SelectOption = function SelectOption(props) {
51
57
  className: "".concat(classPrefix, "-option-icon")
52
58
  }, option === null || option === void 0 ? void 0 : option.icon), /*#__PURE__*/React.createElement("span", {
53
59
  className: "".concat(classPrefix, "-option-label")
54
- }, getLabel(option[props.labelField])), !disabled && /*#__PURE__*/React.createElement("span", {
60
+ }, renderLabel(option)), !disabled && /*#__PURE__*/React.createElement("span", {
55
61
  className: "".concat(classPrefix, "-option-btn")
56
62
  }, props.extra && props.extra(option)));
57
63
  };
@@ -25,7 +25,8 @@ var SelectOverlay = function SelectOverlay(props) {
25
25
  multiple = props.multiple,
26
26
  disableItemList = props.disableItemList,
27
27
  dropdownExtra = props.dropdownExtra,
28
- loading = props.loading;
28
+ loading = props.loading,
29
+ customLabel = props.customLabel;
29
30
 
30
31
  var _useState = useState(),
31
32
  _useState2 = _slicedToArray(_useState, 2),
@@ -116,7 +117,8 @@ var SelectOverlay = function SelectOverlay(props) {
116
117
  multiple: multiple,
117
118
  onClick: onClick,
118
119
  disabled: disabled,
119
- key: option[keyField] || String(Math.random())
120
+ key: option[keyField] || String(Math.random()),
121
+ customLabel: customLabel
120
122
  });
121
123
  optionsDom.push(dom);
122
124
  });
@@ -36,6 +36,7 @@ export declare namespace BizSelectTypes {
36
36
  onChange?: (val: Option) => void;
37
37
  onVisibleChange?: (visible: boolean) => void;
38
38
  destroyPopupOnHide?: boolean;
39
+ customLabel?: (node: ReactNode, option: Option) => ReactNode;
39
40
  }
40
41
  interface OverlayProps {
41
42
  option?: Option;
@@ -51,6 +52,7 @@ export declare namespace BizSelectTypes {
51
52
  labelField?: string;
52
53
  extra?: (option: Option) => ReactNode;
53
54
  onClick?: (option: Option) => void;
55
+ customLabel?: (node: ReactNode, option: Option) => ReactNode;
54
56
  }
55
57
  }
56
58
  export interface HandlerTypes {
@@ -22,25 +22,37 @@ var ConditionTypeList = function ConditionTypeList(props) {
22
22
  className: "biz-user-condition-type-container"
23
23
  }, /*#__PURE__*/React.createElement("li", {
24
24
  className: "condition-type",
25
+ key: "event",
25
26
  onClick: function onClick() {
26
27
  return onAdd('event');
27
28
  }
28
- }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u505A\u8FC7\uFF08\u6CA1\u505A\u8FC7\uFF09\u2026"))), /*#__PURE__*/React.createElement("li", {
29
+ }, /*#__PURE__*/React.createElement(Space, {
30
+ key: "event"
31
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u505A\u8FC7\uFF08\u6CA1\u505A\u8FC7\uFF09\u2026"))), /*#__PURE__*/React.createElement("li", {
29
32
  className: "condition-type",
33
+ key: "add",
30
34
  onClick: function onClick() {
31
35
  return onAdd('add');
32
36
  }
33
- }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u65B0\u589E\u4E8E"))), /*#__PURE__*/React.createElement("li", {
37
+ }, /*#__PURE__*/React.createElement(Space, {
38
+ key: "add"
39
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u65B0\u589E\u4E8E"))), /*#__PURE__*/React.createElement("li", {
34
40
  className: "condition-type",
41
+ key: "active",
35
42
  onClick: function onClick() {
36
43
  return onAdd('active');
37
44
  }
38
- }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u6D3B\u8DC3\u4E8E"))), /*#__PURE__*/React.createElement("li", {
45
+ }, /*#__PURE__*/React.createElement(Space, {
46
+ key: "active"
47
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u6D3B\u8DC3\u4E8E"))), /*#__PURE__*/React.createElement("li", {
39
48
  className: "condition-type",
49
+ key: "prop",
40
50
  onClick: function onClick() {
41
51
  return onAdd('prop');
42
52
  }
43
- }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition ? /*#__PURE__*/React.createElement("li", {
53
+ }, /*#__PURE__*/React.createElement(Space, {
54
+ key: "prop"
55
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition ? /*#__PURE__*/React.createElement("li", {
44
56
  className: "condition-type",
45
57
  onClick: function onClick() {
46
58
  return onAdd('tag');
@@ -8,7 +8,7 @@
8
8
  flex: 1;
9
9
  }
10
10
  .biz-user-condition-event {
11
- width: 355px;
11
+ width: 255px;
12
12
  .biz-event-select-handle {
13
13
  border-top-right-radius: 0;
14
14
  border-bottom-right-radius: 0;
@@ -8,7 +8,7 @@
8
8
  &-unit {
9
9
  margin-right: @margin-xs;
10
10
  > input {
11
- border: none;
11
+ border: none !important;
12
12
  }
13
13
  }
14
14
  &-operator {
@@ -10,7 +10,7 @@
10
10
  width: 58px;
11
11
  margin-right: @margin-xs;
12
12
  > input {
13
- border: none;
13
+ border: none !important;
14
14
  }
15
15
  }
16
16
  .biz-user-condition-runtimes-tip {
@@ -139,14 +139,14 @@ var BizUserCondition = function BizUserCondition(props) {
139
139
  }, "\u4E14"), showList.length ? /*#__PURE__*/React.createElement("div", {
140
140
  className: ["".concat(classPrefix, "-and-conditions-wrap"), props.textMode ? 'text-mode' : ''].join(' ')
141
141
  }, showList.map(function (item, i) {
142
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(OrConditions, {
142
+ return /*#__PURE__*/React.createElement(OrConditions, {
143
143
  showAndDesc: i > 0,
144
144
  orConditions: item.orConditions,
145
145
  key: item.id,
146
146
  onChange: function onChange(data) {
147
147
  _onChange(item.id, data);
148
148
  }
149
- }));
149
+ });
150
150
  })) : null), /*#__PURE__*/React.createElement(ConditionTypeList, {
151
151
  show: value.length < andConditionNum,
152
152
  label: "\u4E14",
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Badge } from 'antd';
3
3
  import { classPrefix } from '..';
4
- import theme from '../../assets/theme';
4
+ import theme from '../../assets/theme.js';
5
5
  import './styles/option.less';
6
6
  import { util } from '../../utils';
7
7
  var GroupOption = /*#__PURE__*/forwardRef(function (props, ref) {
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
2
2
  import { Checkbox } from 'antd';
3
3
  import { classPrefix } from '..';
4
4
  import { util } from '../../utils';
5
- import theme from '../../assets/theme';
5
+ import theme from '../../assets/theme.js';
6
6
  import './styles/option.less';
7
7
  var CheckOption = /*#__PURE__*/forwardRef(function (props, ref) {
8
8
  var highlightText = props.highlightText,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.15-user.2",
3
+ "version": "1.0.15-user.6",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -53,7 +53,7 @@
53
53
  "@types/qs": "^6.9.7",
54
54
  "@umijs/fabric": "^2.8.1",
55
55
  "@umijs/test": "^3.0.5",
56
- "@zgfe/business-lib": "^1.0.15-user.2",
56
+ "@zgfe/business-lib": "^1.0.15-user.6",
57
57
  "antd": "^4.19.2",
58
58
  "dumi": "^1.1.0",
59
59
  "father-build": "^1.17.2",
@@ -62,5 +62,5 @@
62
62
  "prettier": "^2.2.1",
63
63
  "yorkie": "^2.0.0"
64
64
  },
65
- "gitHead": "a81065a7d384c18f20773ec155efad1ed01c61c5"
65
+ "gitHead": "7c94b5662f46e96799c507c7fe1c58f1fc700126"
66
66
  }
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- 'primary-color': string;
3
- 'border-color-base': string;
4
- 'background-color-base': string;
5
- 'text-color': string;
6
- 'text-color-secondary': string;
7
- 'tooltip-bg': string;
8
- 'error-color': string;
9
- 'shadow-color': string;
10
- 'box-shadow-base': string;
11
- 'btn-text-hover-bg': string;
12
- 'warning-color': string;
13
- 'border-color-split': string;
14
- };
15
- export default _default;