@zgfe/business-lib 1.0.16 → 1.0.18-esfix.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.
Files changed (102) hide show
  1. package/es/assets/styles/chunks.less +3 -4
  2. package/es/assets/styles/resetAntd.less +46 -19
  3. package/es/assets/theme.js +1 -1
  4. package/es/attrConditions/components/operateList.d.ts +1 -0
  5. package/es/attrConditions/components/operateList.js +2 -2
  6. package/es/attrConditions/components/stringList.d.ts +1 -0
  7. package/es/attrConditions/components/stringList.js +67 -45
  8. package/es/attrConditions/components/valuesList.d.ts +1 -0
  9. package/es/attrConditions/components/valuesList.js +5 -4
  10. package/es/attrConditions/demo/index.js +7 -8
  11. package/es/attrConditions/index.js +14 -4
  12. package/es/attrConditions/styles/index.less +5 -4
  13. package/es/attrConditions/types.d.ts +3 -0
  14. package/es/attrConditions/utils/operates.js +2 -2
  15. package/es/attributeSelector/index.js +8 -4
  16. package/es/attributeSelector/listPanel.js +32 -19
  17. package/es/attributeSelector/styles/index.less +3 -3
  18. package/es/attributeSelector/types.d.ts +7 -0
  19. package/es/attributeSelector/types.js +8 -1
  20. package/es/attributeSelector/util.js +3 -2
  21. package/es/eventSelector/index.js +10 -4
  22. package/es/eventSelector/listPanel.js +2 -0
  23. package/es/eventSelector/styles/index.less +5 -5
  24. package/es/eventSelector/types.d.ts +4 -0
  25. package/es/index.d.ts +2 -1
  26. package/es/index.js +2 -1
  27. package/es/mock/event.js +214 -0
  28. package/es/select/demo/children.d.ts +2 -0
  29. package/es/select/demo/children.js +81 -0
  30. package/es/select/demo/customLabel.d.ts +2 -0
  31. package/es/select/demo/customLabel.js +23 -0
  32. package/es/select/demo/index.js +10 -4
  33. package/es/select/demo/multiple.js +10 -3
  34. package/es/select/handle.js +10 -8
  35. package/es/select/index.d.ts +2 -2
  36. package/es/select/index.js +12 -30
  37. package/es/select/option.js +8 -2
  38. package/es/select/overlay.js +31 -4
  39. package/es/select/styles/handle.less +29 -13
  40. package/es/select/types.d.ts +6 -3
  41. package/es/userCondition/conditionTypeList.js +29 -6
  42. package/es/userCondition/conditionWrap.js +4 -2
  43. package/es/userCondition/conditions/constants.d.ts +24 -0
  44. package/es/userCondition/conditions/constants.js +41 -0
  45. package/es/userCondition/conditions/eventCondition.js +13 -4
  46. package/es/userCondition/conditions/periodCondition.js +21 -10
  47. package/es/userCondition/conditions/propCondition.js +25 -6
  48. package/es/userCondition/conditions/runTimesCondition.js +2 -2
  49. package/es/userCondition/conditions/styles/eventCondition.less +9 -7
  50. package/es/userCondition/conditions/styles/periodCondition.less +12 -0
  51. package/es/userCondition/conditions/styles/propCondition.less +11 -3
  52. package/es/userCondition/conditions/styles/runTimesCondition.less +3 -0
  53. package/es/userCondition/conditions/styles/tagsCondition.less +20 -0
  54. package/es/userCondition/conditions/styles/textDesc.less +17 -0
  55. package/es/userCondition/conditions/tagsCondition.d.ts +9 -0
  56. package/es/userCondition/conditions/tagsCondition.js +107 -0
  57. package/es/userCondition/conditions/textDesc.d.ts +9 -0
  58. package/es/userCondition/conditions/textDesc.js +241 -0
  59. package/es/userCondition/demo/index.js +260 -31
  60. package/es/userCondition/index.d.ts +1 -1
  61. package/es/userCondition/index.js +52 -10
  62. package/es/userCondition/orConditions.js +69 -28
  63. package/es/userCondition/relationLabel.js +6 -1
  64. package/es/userCondition/styles/conditionTypeList.less +1 -1
  65. package/es/userCondition/styles/conditionWrap.less +3 -0
  66. package/es/userCondition/styles/index.less +21 -1
  67. package/es/userCondition/styles/orConditions.less +20 -2
  68. package/es/userCondition/styles/relationLabel.less +5 -4
  69. package/es/userCondition/types.d.ts +28 -2
  70. package/es/userCondition/util.d.ts +5 -1
  71. package/es/userCondition/util.js +42 -0
  72. package/es/userTagsSelector/cascaderOverlay.d.ts +5 -0
  73. package/es/userTagsSelector/cascaderOverlay.js +114 -0
  74. package/es/userTagsSelector/components/search/index.d.ts +8 -0
  75. package/es/userTagsSelector/components/search/index.js +16 -0
  76. package/es/userTagsSelector/components/search/index.less +6 -0
  77. package/es/userTagsSelector/context.d.ts +3 -0
  78. package/es/userTagsSelector/context.js +2 -0
  79. package/es/userTagsSelector/demo/index.d.ts +2 -0
  80. package/es/userTagsSelector/demo/index.js +48 -0
  81. package/es/userTagsSelector/groups/groupOption.d.ts +5 -0
  82. package/es/userTagsSelector/groups/groupOption.js +42 -0
  83. package/es/userTagsSelector/groups/index.d.ts +4 -0
  84. package/es/userTagsSelector/groups/index.js +86 -0
  85. package/es/userTagsSelector/groups/styles/index.less +0 -0
  86. package/es/userTagsSelector/groups/styles/option.less +50 -0
  87. package/es/userTagsSelector/index.d.ts +6 -0
  88. package/es/userTagsSelector/index.js +110 -0
  89. package/es/userTagsSelector/multipleCheckPanel/checkOption.d.ts +5 -0
  90. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +45 -0
  91. package/es/userTagsSelector/multipleCheckPanel/index.d.ts +4 -0
  92. package/es/userTagsSelector/multipleCheckPanel/index.js +80 -0
  93. package/es/userTagsSelector/multipleCheckPanel/styles/index.less +0 -0
  94. package/es/userTagsSelector/multipleCheckPanel/styles/option.less +40 -0
  95. package/es/userTagsSelector/styles/cascaderOverlay.less +27 -0
  96. package/es/userTagsSelector/styles/index.less +10 -0
  97. package/es/userTagsSelector/types.d.ts +67 -0
  98. package/es/userTagsSelector/types.js +1 -0
  99. package/es/userTagsSelector/util.d.ts +4 -0
  100. package/es/userTagsSelector/util.js +38 -0
  101. package/es/utils/type.d.ts +2 -2
  102. package/package.json +6 -7
@@ -9,6 +9,10 @@ export declare enum PropCategory {
9
9
  UserProp = "userProp",
10
10
  EnvProp = "envProp"
11
11
  }
12
+ export declare enum ShowStatus {
13
+ show = 0,
14
+ hidden = 1
15
+ }
12
16
  export interface AnalysisEvent {
13
17
  id: number;
14
18
  name: string;
@@ -17,6 +21,7 @@ export interface AnalysisEvent {
17
21
  isDelete?: boolean;
18
22
  isStop?: boolean;
19
23
  isOverview?: boolean;
24
+ eventHidden?: ShowStatus;
20
25
  }
21
26
  export interface EventGroup {
22
27
  id: number;
@@ -72,6 +77,8 @@ export declare namespace AttributeSelect {
72
77
  optionsHeaderTip?: string;
73
78
  onChange?: (value: Value) => void;
74
79
  onDelete?: (value?: Value) => void;
80
+ theme?: string;
81
+ destroyPopupOnHide?: boolean;
75
82
  }
76
83
  interface Option {
77
84
  groupName: string;
@@ -12,4 +12,11 @@ export var PropCategory;
12
12
  PropCategory["EventProp"] = "eventProp";
13
13
  PropCategory["UserProp"] = "userProp";
14
14
  PropCategory["EnvProp"] = "envProp";
15
- })(PropCategory || (PropCategory = {}));
15
+ })(PropCategory || (PropCategory = {}));
16
+
17
+ export var ShowStatus;
18
+
19
+ (function (ShowStatus) {
20
+ ShowStatus[ShowStatus["show"] = 0] = "show";
21
+ ShowStatus[ShowStatus["hidden"] = 1] = "hidden";
22
+ })(ShowStatus || (ShowStatus = {}));
@@ -15,7 +15,7 @@ export default function convertAttributeData(store) {
15
15
  eventList: []
16
16
  };
17
17
  group_.eventList.forEach(function (e) {
18
- if (e.is_delete || e.is_stop) return;
18
+ if (e.is_delete) return;
19
19
  var event = {
20
20
  alias: e.alias_name,
21
21
  attrList: e.event_attrs.map(function (item) {
@@ -35,7 +35,8 @@ export default function convertAttributeData(store) {
35
35
  id: e.event_id,
36
36
  isDelete: e.is_delete,
37
37
  isStop: e.is_stop,
38
- name: e.event_name
38
+ name: e.event_name,
39
+ eventHidden: e.event_hidden
39
40
  };
40
41
  group.eventList.push(event);
41
42
  });
@@ -22,6 +22,8 @@ var BizEventSelector = function BizEventSelector(props) {
22
22
  var alias = props.alias,
23
23
  placeholder = props.placeholder,
24
24
  showAllEvent = props.showAllEvent,
25
+ border = props.border,
26
+ theme = props.theme,
25
27
  defaultSelectAble = props.defaultSelectAble;
26
28
 
27
29
  var _useState = useState(),
@@ -123,7 +125,7 @@ var BizEventSelector = function BizEventSelector(props) {
123
125
  };
124
126
 
125
127
  return /*#__PURE__*/React.createElement("div", {
126
- className: classPrefix
128
+ className: [classPrefix, border ? 'border' : ''].join(' ')
127
129
  }, /*#__PURE__*/React.createElement(Dropdown, {
128
130
  overlay: /*#__PURE__*/React.createElement(EventListPanel, {
129
131
  value: currentValue,
@@ -140,12 +142,13 @@ var BizEventSelector = function BizEventSelector(props) {
140
142
  onVisibleChange: onVisibleChange,
141
143
  getPopupContainer: props.popupContainer ? function () {
142
144
  return document.getElementById(selectId);
143
- } : undefined
145
+ } : undefined,
146
+ destroyPopupOnHide: props.defaultSelectAble
144
147
  }, /*#__PURE__*/React.createElement("div", {
145
148
  className: "".concat(classPrefix, "-handle"),
146
149
  id: selectId
147
150
  }, /*#__PURE__*/React.createElement(SelectHandle, {
148
- theme: "secondary",
151
+ theme: theme,
149
152
  border: false,
150
153
  label: getLabel(),
151
154
  placeholder: placeholder
@@ -155,6 +158,9 @@ var BizEventSelector = function BizEventSelector(props) {
155
158
  BizEventSelector.defaultProps = {
156
159
  showAllEvent: true,
157
160
  defaultSelectAble: true,
158
- popupContainer: true
161
+ popupContainer: true,
162
+ border: true,
163
+ theme: 'secondary',
164
+ destroyPopupOnHide: false
159
165
  };
160
166
  export default BizEventSelector;
@@ -24,6 +24,7 @@ import React, { useContext, useEffect, useState } from 'react';
24
24
  import InfiniteScroll from 'react-infinite-scroll-component';
25
25
  import { classPrefix } from '.';
26
26
  import { BizGlobalDataContext } from '..';
27
+ import { ShowStatus } from '../attributeSelector/types';
27
28
  import BizSearchInput from '../searchInput';
28
29
  import EventListOption from './option';
29
30
 
@@ -193,6 +194,7 @@ var EventListPanel = function EventListPanel(props) {
193
194
  }, showList === null || showList === void 0 ? void 0 : showList.map(function (e) {
194
195
  var _currentValue$event;
195
196
 
197
+ if (e.eventHidden === ShowStatus.hidden) return null;
196
198
  return /*#__PURE__*/React.createElement(EventListOption, {
197
199
  label: e.alias || e.name,
198
200
  key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
@@ -1,12 +1,12 @@
1
1
  @import '../../assets/styles/inner.less';
2
2
 
3
3
  .biz-event-select {
4
- position: relative;
5
-
6
- &-handle {
7
- .__select-handle();
4
+ &.border {
5
+ .biz-event-select-handle {
6
+ .__select-handle();
7
+ }
8
8
  }
9
-
9
+ position: relative;
10
10
  &-list-panel {
11
11
  display: flex;
12
12
  flex-direction: row;
@@ -22,6 +22,10 @@ export declare namespace EventSelectTypes {
22
22
  showAllEvent?: boolean;
23
23
  defaultSelectAble?: boolean;
24
24
  popupContainer?: boolean;
25
+ onVisibleChange?: (visible: boolean) => void;
26
+ border?: boolean;
27
+ theme?: string;
28
+ destroyPopupOnHide?: boolean;
25
29
  onChange?: (val: Value) => void;
26
30
  }
27
31
  interface DropdownProps {
package/es/index.d.ts CHANGED
@@ -19,10 +19,11 @@ import convertAttributeData from './attributeSelector/util';
19
19
  import BizGlobalDataContext from './context';
20
20
  import BizUserCondition from './userCondition';
21
21
  import BizSearchInput from './searchInput';
22
+ import BizUserTagsSelect from './userTagsSelector';
22
23
  import BizAddToScene from './addToScene';
23
24
  import BizAddToPanel from './addToPanel';
24
25
  import setGlobalConfig from './config';
25
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, setGlobalConfig, };
26
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
26
27
  export type { UserGroupTypes } from './userGroup/types';
27
28
  export type { BizSelectTypes } from './select/types';
28
29
  export type { AttributeSelect } from './attributeSelector/types';
package/es/index.js CHANGED
@@ -18,7 +18,8 @@ import convertAttributeData from './attributeSelector/util';
18
18
  import BizGlobalDataContext from './context';
19
19
  import BizUserCondition from './userCondition';
20
20
  import BizSearchInput from './searchInput';
21
+ import BizUserTagsSelect from './userTagsSelector';
21
22
  import BizAddToScene from './addToScene';
22
23
  import BizAddToPanel from './addToPanel';
23
24
  import setGlobalConfig from './config';
24
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, setGlobalConfig };
25
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
package/es/mock/event.js CHANGED
@@ -131,6 +131,139 @@ export default [{
131
131
  insert_time: '2018-11-26 14:46:48',
132
132
  owner: 'zg'
133
133
  }]
134
+ }, {
135
+ groupId: 6666,
136
+ groupName: '微信2',
137
+ eventList: [{
138
+ plats: [3],
139
+ click_analysis: false,
140
+ mark_type: null,
141
+ event_id: 24143017,
142
+ event_name: '微信-关注公众号',
143
+ event_hidden: 0,
144
+ event_type: 0,
145
+ is_stop: 0,
146
+ is_delete: 0,
147
+ alias_name: null,
148
+ event_attrs: [{
149
+ hidden: 0,
150
+ dimension_sub: 'event_attr',
151
+ encryption_type: 0,
152
+ alias_name: '',
153
+ value_dict: false,
154
+ attr_id: 30183430,
155
+ attr_name: '扫码场景描述',
156
+ event_id: 24143017,
157
+ prop_type: 1,
158
+ is_stop: 0
159
+ }, {
160
+ hidden: 0,
161
+ dimension_sub: 'event_attr',
162
+ encryption_type: 0,
163
+ alias_name: '',
164
+ value_dict: false,
165
+ attr_id: 30183425,
166
+ attr_name: '二维码ticket',
167
+ event_id: 24143017,
168
+ prop_type: 1,
169
+ is_stop: 0
170
+ }, {
171
+ hidden: 0,
172
+ dimension_sub: 'event_attr',
173
+ encryption_type: 0,
174
+ alias_name: '',
175
+ value_dict: false,
176
+ attr_id: 30183429,
177
+ attr_name: '公众号app_id',
178
+ event_id: 24143017,
179
+ prop_type: 1,
180
+ is_stop: 0
181
+ }, {
182
+ hidden: 0,
183
+ dimension_sub: 'event_attr',
184
+ encryption_type: 0,
185
+ alias_name: '',
186
+ value_dict: true,
187
+ attr_id: 30183423,
188
+ attr_name: '关注来源',
189
+ event_id: 24143017,
190
+ prop_type: 1,
191
+ is_stop: 0
192
+ }, {
193
+ hidden: 0,
194
+ dimension_sub: 'event_attr',
195
+ encryption_type: 0,
196
+ alias_name: '',
197
+ value_dict: false,
198
+ attr_id: 30183428,
199
+ attr_name: '用户open_id',
200
+ event_id: 24143017,
201
+ prop_type: 1,
202
+ is_stop: 0
203
+ }, {
204
+ hidden: 0,
205
+ dimension_sub: 'event_attr',
206
+ encryption_type: 0,
207
+ alias_name: '',
208
+ value_dict: false,
209
+ attr_id: 30183427,
210
+ attr_name: '公众号名称',
211
+ event_id: 24143017,
212
+ prop_type: 1,
213
+ is_stop: 0
214
+ }],
215
+ stop_date_time: null,
216
+ insert_time: '2018-11-26 14:46:48',
217
+ owner: 'zg'
218
+ }, {
219
+ plats: [3],
220
+ click_analysis: false,
221
+ mark_type: null,
222
+ event_id: 24143016,
223
+ event_name: '微信-取消关注公众号',
224
+ event_hidden: 0,
225
+ event_type: 0,
226
+ is_stop: 0,
227
+ is_delete: 0,
228
+ alias_name: null,
229
+ event_attrs: [{
230
+ hidden: 0,
231
+ dimension_sub: 'event_attr',
232
+ encryption_type: 0,
233
+ alias_name: '',
234
+ value_dict: false,
235
+ attr_id: 30183431,
236
+ attr_name: '用户open_id',
237
+ event_id: 24143016,
238
+ prop_type: 1,
239
+ is_stop: 0
240
+ }, {
241
+ hidden: 0,
242
+ dimension_sub: 'event_attr',
243
+ encryption_type: 0,
244
+ alias_name: '',
245
+ value_dict: false,
246
+ attr_id: 30183426,
247
+ attr_name: '公众号名称',
248
+ event_id: 24143016,
249
+ prop_type: 1,
250
+ is_stop: 0
251
+ }, {
252
+ hidden: 0,
253
+ dimension_sub: 'event_attr',
254
+ encryption_type: 0,
255
+ alias_name: '',
256
+ value_dict: false,
257
+ attr_id: 30183424,
258
+ attr_name: '公众号app_id',
259
+ event_id: 24143016,
260
+ prop_type: 1,
261
+ is_stop: 0
262
+ }],
263
+ stop_date_time: null,
264
+ insert_time: '2018-11-26 14:46:48',
265
+ owner: 'zg'
266
+ }]
134
267
  }, {
135
268
  groupId: 4200,
136
269
  groupName: '注册',
@@ -221,6 +354,87 @@ export default [{
221
354
  groupId: 4199,
222
355
  groupName: '官网',
223
356
  eventList: [{
357
+ plats: [3],
358
+ click_analysis: false,
359
+ mark_type: null,
360
+ event_id: 24143017,
361
+ event_name: '微信-关注公众号',
362
+ event_hidden: 0,
363
+ event_type: 0,
364
+ is_stop: 0,
365
+ is_delete: 0,
366
+ alias_name: null,
367
+ event_attrs: [{
368
+ hidden: 0,
369
+ dimension_sub: 'event_attr',
370
+ encryption_type: 0,
371
+ alias_name: '',
372
+ value_dict: false,
373
+ attr_id: 30183430,
374
+ attr_name: '扫码场景描述',
375
+ event_id: 24143017,
376
+ prop_type: 1,
377
+ is_stop: 0
378
+ }, {
379
+ hidden: 0,
380
+ dimension_sub: 'event_attr',
381
+ encryption_type: 0,
382
+ alias_name: '',
383
+ value_dict: false,
384
+ attr_id: 30183425,
385
+ attr_name: '二维码ticket',
386
+ event_id: 24143017,
387
+ prop_type: 1,
388
+ is_stop: 0
389
+ }, {
390
+ hidden: 0,
391
+ dimension_sub: 'event_attr',
392
+ encryption_type: 0,
393
+ alias_name: '',
394
+ value_dict: false,
395
+ attr_id: 30183429,
396
+ attr_name: '公众号app_id',
397
+ event_id: 24143017,
398
+ prop_type: 1,
399
+ is_stop: 0
400
+ }, {
401
+ hidden: 0,
402
+ dimension_sub: 'event_attr',
403
+ encryption_type: 0,
404
+ alias_name: '',
405
+ value_dict: true,
406
+ attr_id: 30183423,
407
+ attr_name: '关注来源',
408
+ event_id: 24143017,
409
+ prop_type: 1,
410
+ is_stop: 0
411
+ }, {
412
+ hidden: 0,
413
+ dimension_sub: 'event_attr',
414
+ encryption_type: 0,
415
+ alias_name: '',
416
+ value_dict: false,
417
+ attr_id: 30183428,
418
+ attr_name: '用户open_id',
419
+ event_id: 24143017,
420
+ prop_type: 1,
421
+ is_stop: 0
422
+ }, {
423
+ hidden: 0,
424
+ dimension_sub: 'event_attr',
425
+ encryption_type: 0,
426
+ alias_name: '',
427
+ value_dict: false,
428
+ attr_id: 30183427,
429
+ attr_name: '公众号名称',
430
+ event_id: 24143017,
431
+ prop_type: 1,
432
+ is_stop: 0
433
+ }],
434
+ stop_date_time: null,
435
+ insert_time: '2018-11-26 14:46:48',
436
+ owner: 'zg'
437
+ }, {
224
438
  plats: [3],
225
439
  click_analysis: false,
226
440
  mark_type: null,
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,81 @@
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 React, { useState } from 'react';
14
+ import { BizSelect } from '@zgfe/business-lib';
15
+ import { Button } from 'antd';
16
+ var stringOperate = [{
17
+ name: '是',
18
+ value: 'equal'
19
+ }, {
20
+ name: '包含',
21
+ value: 'contains'
22
+ }, {
23
+ name: '不是',
24
+ value: 'not equal'
25
+ }, {
26
+ name: '不包含',
27
+ value: 'not contains'
28
+ }, {
29
+ name: '开头是',
30
+ value: 'begin with'
31
+ }, {
32
+ name: '结尾是',
33
+ value: 'end with'
34
+ }, {
35
+ name: '开头不是',
36
+ value: 'not begin with'
37
+ }, {
38
+ name: '结尾不是',
39
+ value: 'not end with'
40
+ }, {
41
+ name: '是空值',
42
+ value: 'is null'
43
+ }, {
44
+ name: '不是空值',
45
+ value: 'is not null'
46
+ }];
47
+ var disabledList = [{
48
+ value: 'not equal'
49
+ }, {
50
+ value: 'not begin with'
51
+ }];
52
+ export default (function () {
53
+ var _useState = useState([{
54
+ name: '不是',
55
+ value: 'not equal'
56
+ }]),
57
+ _useState2 = _slicedToArray(_useState, 2),
58
+ data = _useState2[0],
59
+ setData = _useState2[1];
60
+
61
+ var onChange = function onChange(value) {
62
+ console.log(value);
63
+ setData(function () {
64
+ return value;
65
+ });
66
+ };
67
+
68
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSelect, {
69
+ options: stringOperate,
70
+ value: data,
71
+ labelField: "name",
72
+ keyField: "value",
73
+ theme: "secondary",
74
+ popupContainer: true,
75
+ onChange: onChange,
76
+ disableItemList: disabledList,
77
+ multiple: true
78
+ }, /*#__PURE__*/React.createElement(Button, {
79
+ type: "primary"
80
+ }, "\u70B9\u51FB\u6253\u5F00\u4E0B\u62C9")));
81
+ });
@@ -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
+ });
@@ -48,12 +48,18 @@ var disabledList = [{
48
48
  value: 'not equal'
49
49
  }, {
50
50
  value: 'not begin with'
51
+ }, {
52
+ name: '不是',
53
+ value: 'not equal'
51
54
  }];
52
55
  export default (function () {
53
- var _useState = useState({
54
- name: '不是',
55
- value: 'not equal'
56
- }),
56
+ var _useState = useState([].concat(disabledList, [{
57
+ name: '不是空值',
58
+ value: 'is not null'
59
+ }, {
60
+ name: '是',
61
+ value: 'equal'
62
+ }])),
57
63
  _useState2 = _slicedToArray(_useState, 2),
58
64
  data = _useState2[0],
59
65
  setData = _useState2[1];
@@ -40,10 +40,13 @@ var stringOperate = [{
40
40
  name: '是空值',
41
41
  value: 'is null'
42
42
  }, {
43
- name: '不是空值',
43
+ name: '不是空值aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
44
44
  value: 'is not null'
45
45
  }];
46
46
  var disabledList = [{
47
+ name: '是',
48
+ value: 'equal'
49
+ }, {
47
50
  name: '不包含',
48
51
  value: 'not contains'
49
52
  }, {
@@ -51,7 +54,10 @@ var disabledList = [{
51
54
  value: 'not begin with'
52
55
  }];
53
56
  export default (function () {
54
- var _useState = useState(),
57
+ var _useState = useState([].concat(disabledList, [{
58
+ name: '包含',
59
+ value: 'contains'
60
+ }])),
55
61
  _useState2 = _slicedToArray(_useState, 2),
56
62
  data = _useState2[0],
57
63
  setData = _useState2[1];
@@ -73,6 +79,7 @@ export default (function () {
73
79
  onChange: onChange,
74
80
  disableItemList: disabledList,
75
81
  multiple: true,
76
- enableCreate: true
82
+ enableCreate: true,
83
+ value: data
77
84
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u503C\u662F\uFF1A", JSON.stringify(data)));
78
85
  });
@@ -29,6 +29,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
29
29
 
30
30
  var handleRef = useRef(null);
31
31
  var inputRef = useRef(null);
32
+ var textRef = useRef();
32
33
 
33
34
  var _useState3 = useState(''),
34
35
  _useState4 = _slicedToArray(_useState3, 2),
@@ -47,16 +48,12 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
47
48
  }
48
49
 
49
50
  setSearchValue('');
50
-
51
- if (props.enableCreate && searchValue && !flag) {
52
- if (props.onCreate) props.onCreate(searchValue);
53
- }
54
51
  },
55
52
  width: handleRef.current.clientWidth
56
53
  };
57
54
  });
58
55
  var searchInputWidth = useMemo(function () {
59
- return searchValue.length * 14 || 3;
56
+ return textRef.current && searchValue ? textRef.current.offsetWidth : 3;
60
57
  }, [searchValue]);
61
58
 
62
59
  var onDelete = function onDelete(data) {
@@ -81,11 +78,13 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
81
78
  color: "#fff"
82
79
  }, /*#__PURE__*/React.createElement(Tag, {
83
80
  closable: true,
84
- className: "".concat(classPrefix, "-tag"),
81
+ id: "".concat(classPrefix, "-tag"),
85
82
  onClose: function onClose() {
86
83
  onDelete(item);
87
84
  }
88
- }, item[labelField]));
85
+ }, /*#__PURE__*/React.createElement("div", {
86
+ className: "".concat(classPrefix, "-tag-label")
87
+ }, item[labelField])));
89
88
  }) : !focus ? /*#__PURE__*/React.createElement("span", {
90
89
  className: "".concat(classPrefix, "-holder")
91
90
  }, placeholder || '请选择') : '', /*#__PURE__*/React.createElement(Input, {
@@ -98,7 +97,10 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
98
97
  },
99
98
  value: searchValue,
100
99
  onChange: onSearch
101
- }));
100
+ }), /*#__PURE__*/React.createElement("span", {
101
+ className: "".concat(classPrefix, "-temp"),
102
+ ref: textRef
103
+ }, searchValue));
102
104
  }
103
105
 
104
106
  return /*#__PURE__*/React.createElement("div", {
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import React, { PropsWithChildren } from 'react';
2
2
  import './styles/index.less';
3
3
  import { BizSelectTypes } from './types';
4
4
  export declare const classPrefix = "biz-select";
5
- declare const BizSelect: React.FC<BizSelectTypes.Props>;
5
+ declare const BizSelect: React.FC<PropsWithChildren<BizSelectTypes.Props>>;
6
6
  export default BizSelect;