@zgfe/business-lib 1.0.28-alpha.0 → 1.0.28-dev.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.
@@ -97,7 +97,7 @@ var BizAddToScene = function BizAddToScene(props) {
97
97
  notification.success({
98
98
  message: '添加成功'
99
99
  });
100
- if (props.onOk) props.onOk();
100
+ if (props.onOk) props.onOk(res);
101
101
  } else if (result.code === -10010) {
102
102
  notification.error({
103
103
  message: '添加失败',
@@ -1,7 +1,7 @@
1
1
  declare namespace AddToScene {
2
2
  interface Props {
3
3
  params: Record<string, any>;
4
- onOk?: () => void;
4
+ onOk?: (data: any) => void;
5
5
  onCancel?: () => void;
6
6
  }
7
7
  interface Scene {
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IconFont } from '..';
3
3
  import { util } from '../utils';
4
- import { getIcon } from './util';
5
4
 
6
5
  var Option = function Option(props) {
7
6
  var option = props.option,
@@ -29,28 +28,6 @@ var Option = function Option(props) {
29
28
  });
30
29
  }
31
30
 
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
-
54
31
  if (group) {
55
32
  return /*#__PURE__*/React.createElement("div", {
56
33
  id: group.anchor,
@@ -65,7 +42,10 @@ var Option = function Option(props) {
65
42
  return /*#__PURE__*/React.createElement("div", {
66
43
  className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
67
44
  onClick: onClick
68
- }, renderIcon(option), /*#__PURE__*/React.createElement("span", {
45
+ }, /*#__PURE__*/React.createElement(IconFont, {
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", {
69
49
  title: (option === null || option === void 0 ? void 0 : option.alias) || (option === null || option === void 0 ? void 0 : option.label)
70
50
  }, getLabel((option === null || option === void 0 ? void 0 : option.alias) || (option === null || option === void 0 ? void 0 : option.label))));
71
51
  };
@@ -5,4 +5,3 @@ export default function convertAttributeData(store: {
5
5
  userPropList?: OldSystem.UserProp[];
6
6
  eventList?: OldSystem.EventGroup[];
7
7
  }): PropGroups;
8
- export declare function getIcon(name: string): string;
@@ -81,66 +81,4 @@ 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] : '';
146
84
  }
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
3
  declare const BizDetailLayout: React.FC<{
4
- width?: number;
4
+ width?: string;
5
+ className?: string;
5
6
  onBack?: () => void;
6
7
  extra?: React.ReactNode;
7
8
  children?: React.ReactNode;
@@ -3,12 +3,13 @@ import { IconFont } from '../..';
3
3
  import './index.less';
4
4
 
5
5
  var BizDetailLayout = function BizDetailLayout(props) {
6
- var width = props.width;
6
+ var width = props.width,
7
+ className = props.className;
7
8
  var classPrefix = 'biz-detail';
8
9
  return /*#__PURE__*/React.createElement("div", {
9
- className: classPrefix,
10
+ className: "".concat(classPrefix, " ").concat(className),
10
11
  style: {
11
- width: width ? "".concat(width, "px") : undefined
12
+ width: width
12
13
  }
13
14
  }, /*#__PURE__*/React.createElement("div", {
14
15
  className: "".concat(classPrefix, "-menu")
@@ -186,8 +186,7 @@ var BizSelect = function BizSelect(props) {
186
186
  keyField: keyField,
187
187
  searchValue: searchValue,
188
188
  onChange: onChange,
189
- ref: overlayRef,
190
- searchPlaceholder: props.searchPlaceholder
189
+ ref: overlayRef
191
190
  })),
192
191
  disabled: props.disable,
193
192
  destroyPopupOnHide: props.destroyPopupOnHide,
@@ -202,8 +202,7 @@ 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,
206
- placeholder: props.searchPlaceholder || '请输入'
205
+ onChange: onSearch
207
206
  }), dropdownExtra, /*#__PURE__*/React.createElement("div", {
208
207
  className: "".concat(classPrefix, "-list-panel")
209
208
  }, render()));
@@ -42,7 +42,6 @@ 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;
46
45
  }
47
46
  interface OverlayProps {
48
47
  option?: Option;
@@ -59,7 +58,6 @@ export declare namespace BizSelectTypes {
59
58
  extra?: (option: Option) => ReactNode;
60
59
  onClick?: (option: Option) => void;
61
60
  customLabel?: (node: ReactNode, option: Option) => ReactNode;
62
- searchPlaceholder?: string;
63
61
  }
64
62
  }
65
63
  export interface HandlerTypes {
package/es/table/index.js CHANGED
@@ -6,6 +6,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
6
6
 
7
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
8
 
9
+ 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); }
10
+
9
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
12
 
11
13
  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."); }
@@ -23,7 +25,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
23
25
  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
26
 
25
27
  import { Table } from 'antd';
26
- import React, { useState } from 'react';
28
+ import React, { useMemo, useState } from 'react';
27
29
  import './styles/index.less';
28
30
 
29
31
  var BizTable = function BizTable(props) {
@@ -40,6 +42,14 @@ var BizTable = function BizTable(props) {
40
42
  scrollData = _useState2[0],
41
43
  setScrollData = _useState2[1];
42
44
 
45
+ var paginationObj = useMemo(function () {
46
+ if (_typeof(pagination) === 'object') {
47
+ return _objectSpread({}, pagination);
48
+ }
49
+
50
+ return {};
51
+ }, [pagination]);
52
+
43
53
  var onChangePage = function onChangePage(page, pageSize) {
44
54
  var count = page * pageSize;
45
55
  var totalCount = total || dataSource.length;
@@ -61,7 +71,7 @@ var BizTable = function BizTable(props) {
61
71
  return /*#__PURE__*/React.createElement(Table, _objectSpread(_objectSpread({}, res), {}, {
62
72
  columns: columns,
63
73
  dataSource: dataSource,
64
- pagination: pagination && {
74
+ pagination: pagination && _objectSpread({
65
75
  className: 'biz-pagination',
66
76
  showSizeChanger: true,
67
77
  total: total || dataSource.length,
@@ -72,7 +82,7 @@ var BizTable = function BizTable(props) {
72
82
  }, totalNum), " \u6761");
73
83
  },
74
84
  onChange: onChangePage
75
- },
85
+ }, paginationObj),
76
86
  scroll: scrollData
77
87
  }));
78
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.28-alpha.0",
3
+ "version": "1.0.28-dev.1",
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": "37268b344374e2945b7d5b0f4c7d48bcea2a24f1"
61
+ "gitHead": "9a5f849119d4b82a1ef6bb329f549165148b1c34"
62
62
  }