@zgfe/business-lib 1.1.7-path.1 → 1.1.7-path.3

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.
@@ -3,5 +3,6 @@ declare const DemoContent: React.FC<{
3
3
  children?: ReactNode;
4
4
  needMeta?: boolean;
5
5
  currentApp?: number;
6
+ isDemo?: boolean;
6
7
  }>;
7
8
  export default DemoContent;
@@ -51,7 +51,8 @@ function ajax(url, options) {
51
51
  var DemoContent = function DemoContent(_ref3) {
52
52
  var children = _ref3.children,
53
53
  currentApp = _ref3.currentApp,
54
- needMeta = _ref3.needMeta;
54
+ needMeta = _ref3.needMeta,
55
+ isDemo = _ref3.isDemo;
55
56
 
56
57
  var _useState = useState([]),
57
58
  _useState2 = _slicedToArray(_useState, 2),
@@ -188,7 +189,8 @@ var DemoContent = function DemoContent(_ref3) {
188
189
  eventGroupList: store === null || store === void 0 ? void 0 : store.eventGroupList,
189
190
  userPropList: store === null || store === void 0 ? void 0 : store.userPropList,
190
191
  eventEnvList: store === null || store === void 0 ? void 0 : store.envPropList,
191
- userGroupList: userGroups
192
+ userGroupList: userGroups,
193
+ isDemo: isDemo
192
194
  }
193
195
  }, children));
194
196
  };
@@ -23,7 +23,8 @@ var DemoWrapper = function DemoWrapper(_ref) {
23
23
  var children = _ref.children,
24
24
  className = _ref.className,
25
25
  defaultApp = _ref.defaultApp,
26
- needMeta = _ref.needMeta;
26
+ needMeta = _ref.needMeta,
27
+ isDemo = _ref.isDemo;
27
28
 
28
29
  var _useState = useState(true),
29
30
  _useState2 = _slicedToArray(_useState, 2),
@@ -74,7 +75,8 @@ var DemoWrapper = function DemoWrapper(_ref) {
74
75
  className: className
75
76
  }, /*#__PURE__*/React.createElement(DemoContent, {
76
77
  currentApp: appId,
77
- needMeta: needMeta
78
+ needMeta: needMeta,
79
+ isDemo: isDemo
78
80
  }, children));
79
81
  };
80
82
 
@@ -4,6 +4,7 @@ declare namespace DemoWrapperTypes {
4
4
  className?: string;
5
5
  defaultApp?: number;
6
6
  needMeta?: boolean;
7
+ isDemo?: boolean;
7
8
  children?: ReactNode;
8
9
  }
9
10
  }
@@ -11,14 +11,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import React, { useState } from 'react';
14
- import { BizEventSelector, convertAttributeData, BizGlobalDataContext } from '@zgfe/business-lib';
15
- import eventData from '../../mock/event';
14
+ import { BizEventSelector, DemoWrapper } from '@zgfe/business-lib';
16
15
 
17
16
  var EventDemo = function EventDemo() {
18
- var store = convertAttributeData({
19
- eventList: eventData
20
- });
21
-
22
17
  var _useState = useState({
23
18
  group: {
24
19
  id: 4201
@@ -35,24 +30,14 @@ var EventDemo = function EventDemo() {
35
30
  setValue(data);
36
31
  };
37
32
 
38
- return /*#__PURE__*/React.createElement("div", {
39
- style: {
40
- height: '500px',
41
- overflow: 'auto'
42
- }
43
- }, /*#__PURE__*/React.createElement("div", {
44
- style: {
45
- height: '700px'
46
- }
47
- }, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
48
- value: {
49
- eventGroupList: store.eventGroupList
50
- }
33
+ return /*#__PURE__*/React.createElement(DemoWrapper, {
34
+ needMeta: true
51
35
  }, /*#__PURE__*/React.createElement(BizEventSelector, {
52
36
  defaultValue: value,
53
37
  alias: "\u522B\u540D",
54
- onChange: onChange
55
- })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value))));
38
+ onChange: onChange,
39
+ showSession: true
40
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value)));
56
41
  };
57
42
 
58
43
  export default (function () {
@@ -24,7 +24,8 @@ var BizEventSelector = function BizEventSelector(props) {
24
24
  showAllEvent = props.showAllEvent,
25
25
  border = props.border,
26
26
  theme = props.theme,
27
- defaultSelectAble = props.defaultSelectAble;
27
+ defaultSelectAble = props.defaultSelectAble,
28
+ showSession = props.showSession;
28
29
 
29
30
  var _useState = useState(),
30
31
  _useState2 = _slicedToArray(_useState, 2),
@@ -130,6 +131,7 @@ var BizEventSelector = function BizEventSelector(props) {
130
131
  overlay: /*#__PURE__*/React.createElement(EventListPanel, {
131
132
  value: currentValue,
132
133
  onChange: onChange,
134
+ showSession: showSession,
133
135
  showOverview: showAllEvent,
134
136
  defaultSelectAble: defaultSelectAble
135
137
  }),
@@ -30,7 +30,8 @@ import EventListOption from './option';
30
30
 
31
31
  var EventListPanel = function EventListPanel(props) {
32
32
  var showOverview = props.showOverview,
33
- defaultSelectAble = props.defaultSelectAble;
33
+ defaultSelectAble = props.defaultSelectAble,
34
+ showSession = props.showSession;
34
35
 
35
36
  var _useState = useState(''),
36
37
  _useState2 = _slicedToArray(_useState, 2),
@@ -87,6 +88,20 @@ var EventListPanel = function EventListPanel(props) {
87
88
  });
88
89
  });
89
90
  list = [].concat(markList, _toConsumableArray(list));
91
+
92
+ if (showSession) {
93
+ list.unshift({
94
+ id: 1,
95
+ name: '会话结束',
96
+ attrList: []
97
+ });
98
+ list.unshift({
99
+ id: 0,
100
+ name: '会话开始',
101
+ attrList: []
102
+ });
103
+ }
104
+
90
105
  return list;
91
106
  }(),
92
107
  name: '所有分组'
@@ -23,17 +23,19 @@ export declare namespace EventSelectTypes {
23
23
  showAllEvent?: boolean;
24
24
  defaultSelectAble?: boolean;
25
25
  popupContainer?: boolean;
26
- onVisibleChange?: (visible: boolean) => void;
27
26
  border?: boolean;
28
27
  theme?: string;
29
28
  size?: SizeType;
30
29
  destroyPopupOnHide?: boolean;
30
+ showSession?: boolean;
31
31
  onChange?: (val: Value) => void;
32
+ onVisibleChange?: (visible: boolean) => void;
32
33
  }
33
34
  interface DropdownProps {
34
35
  value?: Value;
35
36
  showOverview?: boolean;
36
37
  defaultSelectAble?: boolean;
38
+ showSession?: boolean;
37
39
  onChange?: (value: Value, isOverview?: boolean) => void;
38
40
  }
39
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.7-path.1",
3
+ "version": "1.1.7-path.3",
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": "3049fb52e4bbd0b6d0b90faeec27417c8f5b9b94"
63
+ "gitHead": "78eee745228df2d67ce4d30f4d7b77fd8372c9ca"
64
64
  }