@zgfe/business-lib 1.0.0-beta.6 → 1.0.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.
Files changed (283) hide show
  1. package/es/analysisLayout/demo/index.js +4 -1
  2. package/es/analysisLayout/index.d.ts +1 -28
  3. package/es/analysisLayout/index.js +38 -48
  4. package/es/analysisLayout/index.less +1 -1
  5. package/es/assets/styles/chunks.less +143 -0
  6. package/es/assets/styles/inner.less +3 -0
  7. package/es/assets/styles/resetAntd.less +398 -0
  8. package/es/assets/styles/variable.less +21 -0
  9. package/es/assets/theme.d.ts +5 -0
  10. package/es/assets/theme.js +4 -0
  11. package/es/attrConditions/components/operateList.d.ts +8 -0
  12. package/es/attrConditions/components/operateList.js +83 -0
  13. package/es/attrConditions/components/stringList.d.ts +9 -0
  14. package/es/attrConditions/components/stringList.js +168 -0
  15. package/es/attrConditions/components/valuesList.d.ts +10 -0
  16. package/es/attrConditions/components/valuesList.js +188 -0
  17. package/es/{attributeSelector/demo/multi.d.ts → attrConditions/demo/group.d.ts} +0 -0
  18. package/es/attrConditions/demo/group.js +82 -0
  19. package/es/{globalAttributes → attrConditions}/demo/index.d.ts +0 -0
  20. package/es/{datePicker/demo/form.js → attrConditions/demo/index.js} +43 -23
  21. package/es/attrConditions/group.d.ts +5 -0
  22. package/es/attrConditions/group.js +183 -0
  23. package/es/attrConditions/index.d.ts +6 -0
  24. package/es/attrConditions/index.js +160 -0
  25. package/es/attrConditions/styles/group.less +49 -0
  26. package/es/attrConditions/styles/index.less +94 -0
  27. package/es/attrConditions/types.d.ts +63 -0
  28. package/es/attrConditions/types.js +19 -0
  29. package/es/attrConditions/utils/operates.d.ts +16 -0
  30. package/es/attrConditions/utils/operates.js +67 -0
  31. package/es/attributeSelector/demo/index.d.ts +3 -0
  32. package/es/attributeSelector/demo/{singleForm.js → index.js} +42 -44
  33. package/es/attributeSelector/index.d.ts +4 -111
  34. package/es/attributeSelector/index.js +88 -543
  35. package/es/attributeSelector/listPanel.d.ts +4 -0
  36. package/es/attributeSelector/listPanel.js +208 -0
  37. package/es/attributeSelector/option.d.ts +15 -0
  38. package/es/attributeSelector/option.js +53 -0
  39. package/es/attributeSelector/styles/index.less +100 -0
  40. package/es/attributeSelector/types.d.ts +79 -0
  41. package/es/attributeSelector/types.js +15 -0
  42. package/es/attributeSelector/util.d.ts +7 -0
  43. package/es/attributeSelector/util.js +69 -0
  44. package/es/chart/demo/pie.js +1 -0
  45. package/es/chart/index.d.ts +2 -96
  46. package/es/chart/index.js +28 -35
  47. package/es/chart/styles/index.less +50 -0
  48. package/es/chart/types.d.ts +46 -0
  49. package/es/chart/{type.js → types.js} +0 -0
  50. package/es/chart/util/{chartConfig.d.ts → chartOptionConfig.d.ts} +4 -35
  51. package/es/chart/util/{chartConfig.js → chartOptionConfig.js} +45 -111
  52. package/es/chart/util/formatData.d.ts +3 -7
  53. package/es/chart/util/formatData.js +47 -26
  54. package/es/chart/util/formatOption.d.ts +2 -1
  55. package/es/chart/util/formatOption.js +22 -9
  56. package/es/chart/util/mapUtil.d.ts +3 -3
  57. package/es/chart/util/mapUtil.js +9 -19
  58. package/es/commonStyle/icon.less +116 -112
  59. package/es/commonStyle/select.less +1 -1
  60. package/es/commonStyle/theme.less +520 -473
  61. package/es/components/iconFont.js +4 -2
  62. package/es/context/index.d.ts +16 -0
  63. package/es/context/index.js +3 -0
  64. package/es/datePicker/datePicker.d.ts +10 -0
  65. package/es/datePicker/datePicker.js +115 -0
  66. package/es/datePicker/demo/index.d.ts +1 -0
  67. package/es/datePicker/demo/index.js +9 -2
  68. package/es/datePicker/index.d.ts +4 -27
  69. package/es/datePicker/index.js +72 -148
  70. package/es/datePicker/styles/index.less +48 -0
  71. package/es/datePicker/types.d.ts +24 -0
  72. package/es/{eventSelector/type.js → datePicker/types.js} +0 -0
  73. package/es/datePicker/utils.d.ts +6 -0
  74. package/es/datePicker/utils.js +70 -0
  75. package/es/dialog/components/itemNode.d.ts +10 -0
  76. package/es/dialog/components/itemNode.js +109 -0
  77. package/es/dialog/components/list.d.ts +3 -13
  78. package/es/dialog/components/list.js +15 -12
  79. package/es/dialog/components/selectToInput.d.ts +4 -48
  80. package/es/dialog/components/selectToInput.js +74 -80
  81. package/es/dialog/components/styles/handle.less +39 -0
  82. package/es/dialog/components/styles/list.less +60 -0
  83. package/es/dialog/components/styles/tab.less +55 -0
  84. package/es/dialog/components/tab.d.ts +3 -7
  85. package/es/dialog/components/tab.js +57 -19
  86. package/es/dialog/data/{chart.d.ts → data.d.ts} +9 -0
  87. package/es/dialog/data/{chart.js → data.js} +11 -0
  88. package/es/dialog/demo/index.d.ts +23 -0
  89. package/es/dialog/demo/index.js +34 -3
  90. package/es/dialog/demo/index2.js +14 -2
  91. package/es/dialog/index.d.ts +4 -97
  92. package/es/dialog/index.js +54 -109
  93. package/es/dialog/styles/index.less +11 -0
  94. package/es/dialog/types.d.ts +77 -0
  95. package/es/{targetConditionGroup/type.js → dialog/types.js} +0 -0
  96. package/es/eventSelector/demo/index.js +26 -44
  97. package/es/eventSelector/index.d.ts +4 -30
  98. package/es/eventSelector/index.js +90 -416
  99. package/es/eventSelector/listPanel.d.ts +4 -0
  100. package/es/eventSelector/listPanel.js +197 -0
  101. package/es/eventSelector/option.d.ts +17 -0
  102. package/es/eventSelector/option.js +54 -0
  103. package/es/eventSelector/styles/index.less +77 -0
  104. package/es/eventSelector/types.d.ts +31 -0
  105. package/es/eventSelector/types.js +1 -0
  106. package/es/index.d.ts +14 -11
  107. package/es/index.js +9 -11
  108. package/es/{attributeSelector/data → mock}/env.d.ts +0 -0
  109. package/es/{attributeSelector/data → mock}/env.js +0 -0
  110. package/es/{attributeSelector/data → mock}/event.d.ts +0 -0
  111. package/es/{attributeSelector/data → mock}/event.js +0 -0
  112. package/es/{attributeSelector/data → mock}/user.d.ts +0 -0
  113. package/es/{attributeSelector/data → mock}/user.js +0 -0
  114. package/es/{multipleSelector → searchInput}/demo/index.d.ts +0 -0
  115. package/es/searchInput/demo/index.js +5 -0
  116. package/es/searchInput/index.d.ts +8 -0
  117. package/es/searchInput/index.js +31 -0
  118. package/es/{attributeSelector/demo/multiForm.d.ts → select/demo/group.d.ts} +0 -0
  119. package/es/{globalAttributes/demo/index.js → select/demo/group.js} +49 -31
  120. package/es/select/demo/index.js +49 -21
  121. package/es/{attributeSelector/demo/single.d.ts → select/demo/multiple.d.ts} +0 -0
  122. package/es/{multipleSelector/demo/index.js → select/demo/multiple.js} +55 -12
  123. package/es/select/handle.d.ts +5 -0
  124. package/es/select/handle.js +119 -0
  125. package/es/select/index.d.ts +4 -49
  126. package/es/select/index.js +168 -122
  127. package/es/select/option.d.ts +4 -0
  128. package/es/select/option.js +59 -0
  129. package/es/select/overlay.d.ts +4 -0
  130. package/es/select/overlay.js +154 -0
  131. package/es/select/styles/handle.less +111 -0
  132. package/es/select/styles/index.less +99 -0
  133. package/es/select/types.d.ts +65 -0
  134. package/es/select/types.js +1 -0
  135. package/es/table/demo/data/table.js +1 -1
  136. package/es/table/demo/index.d.ts +1 -1
  137. package/es/table/demo/index.js +9 -8
  138. package/es/table/demo/index3.js +9 -18
  139. package/es/table/index.d.ts +4 -30
  140. package/es/table/index.js +30 -26
  141. package/es/table/styles/index.less +5 -0
  142. package/es/table/type.d.ts +10 -0
  143. package/es/table/type.js +1 -0
  144. package/es/targetConditionGroup/components/targetDimension.d.ts +8 -0
  145. package/es/targetConditionGroup/components/targetDimension.js +153 -0
  146. package/es/targetConditionGroup/data/operates.d.ts +8 -24
  147. package/es/targetConditionGroup/data/operates.js +26 -69
  148. package/es/targetConditionGroup/demo/group.d.ts +1 -0
  149. package/es/targetConditionGroup/demo/group.js +108 -23
  150. package/es/targetConditionGroup/demo/index.js +34 -34
  151. package/es/targetConditionGroup/demo/styles/index.less +29 -0
  152. package/es/targetConditionGroup/index.d.ts +4 -57
  153. package/es/targetConditionGroup/index.js +177 -274
  154. package/es/targetConditionGroup/styles/index.less +25 -0
  155. package/es/targetConditionGroup/types.d.ts +32 -0
  156. package/es/targetConditionGroup/types.js +1 -0
  157. package/es/targetSelector/demo/index.d.ts +1 -0
  158. package/es/targetSelector/demo/index.js +29 -71
  159. package/es/targetSelector/editBox.d.ts +8 -0
  160. package/es/targetSelector/{components/BizEventNameEditBox.js → editBox.js} +49 -24
  161. package/es/targetSelector/index.d.ts +5 -55
  162. package/es/targetSelector/index.js +103 -214
  163. package/es/targetSelector/optionIcon.d.ts +9 -0
  164. package/es/targetSelector/optionIcon.js +24 -0
  165. package/es/targetSelector/optionMenu.d.ts +7 -0
  166. package/es/targetSelector/optionMenu.js +38 -0
  167. package/es/targetSelector/styles/index.less +88 -0
  168. package/es/targetSelector/types.d.ts +18 -0
  169. package/es/targetSelector/types.js +1 -0
  170. package/es/userCondition/conditionTypeList.d.ts +10 -0
  171. package/es/userCondition/conditionTypeList.js +43 -0
  172. package/es/userCondition/conditionWrap.d.ts +7 -0
  173. package/es/userCondition/conditionWrap.js +18 -0
  174. package/es/userCondition/conditions/eventCondition.d.ts +8 -0
  175. package/es/userCondition/conditions/eventCondition.js +104 -0
  176. package/es/userCondition/conditions/periodCondition.d.ts +11 -0
  177. package/es/userCondition/conditions/periodCondition.js +156 -0
  178. package/es/userCondition/conditions/propCondition.d.ts +11 -0
  179. package/es/userCondition/conditions/propCondition.js +147 -0
  180. package/es/userCondition/conditions/runTimesCondition.d.ts +9 -0
  181. package/es/userCondition/conditions/runTimesCondition.js +78 -0
  182. package/es/userCondition/conditions/styles/eventCondition.less +49 -0
  183. package/es/userCondition/conditions/styles/periodCondition.less +14 -0
  184. package/es/userCondition/conditions/styles/propCondition.less +36 -0
  185. package/es/userCondition/conditions/styles/runTimesCondition.less +16 -0
  186. package/es/{attributeSelector/demo/singleForm.d.ts → userCondition/demo/index.d.ts} +0 -0
  187. package/es/userCondition/demo/index.js +97 -0
  188. package/es/userCondition/index.d.ts +7 -0
  189. package/es/userCondition/index.js +146 -0
  190. package/es/userCondition/orConditions.d.ts +5 -0
  191. package/es/userCondition/orConditions.js +202 -0
  192. package/es/userCondition/relationLabel.d.ts +6 -0
  193. package/es/userCondition/relationLabel.js +12 -0
  194. package/es/userCondition/styles/conditionTypeList.less +31 -0
  195. package/es/userCondition/styles/conditionWrap.less +14 -0
  196. package/es/userCondition/styles/index.less +13 -0
  197. package/es/userCondition/styles/orConditions.less +16 -0
  198. package/es/userCondition/styles/relationLabel.less +18 -0
  199. package/es/userCondition/types.d.ts +79 -0
  200. package/es/userCondition/types.js +1 -0
  201. package/es/userCondition/util.d.ts +2 -0
  202. package/es/userCondition/util.js +54 -0
  203. package/es/{datePicker/demo/form.d.ts → userGroup/demo/group.d.ts} +0 -0
  204. package/es/{targetConditionGroup/demo/form.js → userGroup/demo/group.js} +68 -72
  205. package/es/userGroup/demo/index.d.ts +0 -1
  206. package/es/userGroup/demo/index.js +5 -62
  207. package/es/userGroup/index.d.ts +3 -77
  208. package/es/userGroup/index.js +60 -108
  209. package/es/userGroup/styles/index.less +20 -0
  210. package/es/userGroup/types.d.ts +15 -0
  211. package/es/userGroup/types.js +1 -0
  212. package/es/utils/ajax.js +5 -20
  213. package/es/utils/type.d.ts +42 -44
  214. package/es/utils/util.d.ts +1 -35
  215. package/es/utils/util.js +27 -57
  216. package/package.json +11 -4
  217. package/es/attributeSelector/demo/multi.js +0 -39
  218. package/es/attributeSelector/demo/multiForm.js +0 -64
  219. package/es/attributeSelector/demo/single.js +0 -43
  220. package/es/attributeSelector/group.d.ts +0 -31
  221. package/es/attributeSelector/group.js +0 -225
  222. package/es/attributeSelector/index.less +0 -172
  223. package/es/chart/index.less +0 -38
  224. package/es/chart/style/circle.svg +0 -4
  225. package/es/chart/type.d.ts +0 -22
  226. package/es/datePicker/data.d.ts +0 -9
  227. package/es/datePicker/data.js +0 -65
  228. package/es/datePicker/index.less +0 -364
  229. package/es/dialog/components/style/list.less +0 -59
  230. package/es/dialog/components/style/tab.less +0 -61
  231. package/es/dialog/style/index.less +0 -86
  232. package/es/eventSelector/demo/form.d.ts +0 -2
  233. package/es/eventSelector/demo/form.js +0 -89
  234. package/es/eventSelector/demo/nodata.d.ts +0 -2
  235. package/es/eventSelector/demo/nodata.js +0 -13
  236. package/es/eventSelector/index.less +0 -121
  237. package/es/eventSelector/type.d.ts +0 -41
  238. package/es/globalAttributes/demo/data/env.d.ts +0 -11
  239. package/es/globalAttributes/demo/data/env.js +0 -181
  240. package/es/globalAttributes/demo/data/event.d.ts +0 -237
  241. package/es/globalAttributes/demo/data/event.js +0 -3483
  242. package/es/globalAttributes/demo/data/user.d.ts +0 -22
  243. package/es/globalAttributes/demo/data/user.js +0 -218
  244. package/es/globalAttributes/index.d.ts +0 -47
  245. package/es/globalAttributes/index.js +0 -112
  246. package/es/multipleSelector/index.d.ts +0 -36
  247. package/es/multipleSelector/index.js +0 -131
  248. package/es/multipleSelector/index.less +0 -136
  249. package/es/table/demo/index.less +0 -8
  250. package/es/table/index.less +0 -139
  251. package/es/targetConditionGroup/components/conditionGroup.d.ts +0 -30
  252. package/es/targetConditionGroup/components/conditionGroup.js +0 -112
  253. package/es/targetConditionGroup/components/conditionItem.d.ts +0 -47
  254. package/es/targetConditionGroup/components/conditionItem.js +0 -232
  255. package/es/targetConditionGroup/components/style/group.less +0 -47
  256. package/es/targetConditionGroup/components/style/index.less +0 -16
  257. package/es/targetConditionGroup/demo/data/env.d.ts +0 -11
  258. package/es/targetConditionGroup/demo/data/env.js +0 -181
  259. package/es/targetConditionGroup/demo/data/event.d.ts +0 -237
  260. package/es/targetConditionGroup/demo/data/event.js +0 -3483
  261. package/es/targetConditionGroup/demo/data/user.d.ts +0 -22
  262. package/es/targetConditionGroup/demo/data/user.js +0 -218
  263. package/es/targetConditionGroup/demo/form.d.ts +0 -2
  264. package/es/targetConditionGroup/demo/item.d.ts +0 -2
  265. package/es/targetConditionGroup/demo/item.js +0 -5
  266. package/es/targetConditionGroup/group.d.ts +0 -56
  267. package/es/targetConditionGroup/group.js +0 -204
  268. package/es/targetConditionGroup/index.less +0 -76
  269. package/es/targetConditionGroup/type.d.ts +0 -95
  270. package/es/targetSelector/components/BizCascadeBox.d.ts +0 -34
  271. package/es/targetSelector/components/BizCascadeBox.js +0 -213
  272. package/es/targetSelector/components/BizEventNameEditBox.d.ts +0 -20
  273. package/es/targetSelector/demo/form.d.ts +0 -2
  274. package/es/targetSelector/demo/form.js +0 -133
  275. package/es/targetSelector/demo/nodata.d.ts +0 -2
  276. package/es/targetSelector/demo/nodata.js +0 -13
  277. package/es/targetSelector/index.less +0 -28
  278. package/es/userGroup/demo/cluster.d.ts +0 -3
  279. package/es/userGroup/demo/cluster.js +0 -102
  280. package/es/userGroup/demo/index.less +0 -3
  281. package/es/userGroup/index.less +0 -2
  282. package/es/userGroup/userCluster.d.ts +0 -63
  283. package/es/userGroup/userCluster.js +0 -255
@@ -0,0 +1,109 @@
1
+ import { Input, Radio, Space } from 'antd';
2
+ import React from 'react';
3
+ import { classPrefix } from '..';
4
+ import IconFont from '../../components/iconFont';
5
+ import BizSelect from '../../select';
6
+ import BizList from './list';
7
+ import BizSelectToInput from './selectToInput';
8
+ import BizTab from './tab';
9
+
10
+ var ItemNode = function ItemNode(props) {
11
+ var _props$field = props.field,
12
+ type = _props$field.type,
13
+ label = _props$field.label,
14
+ options = _props$field.options,
15
+ placeholder = _props$field.placeholder,
16
+ extendName = _props$field.extendName,
17
+ direction = _props$field.direction,
18
+ multiple = _props$field.multiple,
19
+ enableSearch = _props$field.enableSearch,
20
+ selectType = _props$field.selectType,
21
+ overlayWidth = _props$field.overlayWidth,
22
+ extra = _props$field.extra,
23
+ fieldNames = props.fieldNames;
24
+
25
+ var onChange = function onChange(data) {
26
+ if (props.onChange) props.onChange(data);
27
+ if (props.field.onChange) props.field.onChange(data);
28
+ };
29
+
30
+ if (type === 'input') {
31
+ return /*#__PURE__*/React.createElement(Input, {
32
+ defaultValue: props.value,
33
+ className: "".concat(classPrefix, "-input"),
34
+ placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
35
+ autoComplete: "off",
36
+ allowClear: {
37
+ clearIcon: /*#__PURE__*/React.createElement(IconFont, {
38
+ className: "biz-icon",
39
+ type: 'icon-qingchu'
40
+ })
41
+ },
42
+ onChange: onChange
43
+ });
44
+ } else if (type === 'password') {
45
+ return /*#__PURE__*/React.createElement(Input.Password, {
46
+ className: "".concat(classPrefix, "-input"),
47
+ defaultValue: props.value,
48
+ placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
49
+ onChange: onChange
50
+ });
51
+ } else if (type === 'select') {
52
+ return /*#__PURE__*/React.createElement(BizSelect, {
53
+ className: "".concat(classPrefix, "-select"),
54
+ options: options || [],
55
+ defaultValue: props.value,
56
+ keyField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value,
57
+ labelField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label,
58
+ multiple: multiple,
59
+ enableSearch: enableSearch,
60
+ type: selectType,
61
+ overlayWidth: overlayWidth,
62
+ extra: extra,
63
+ onChange: onChange
64
+ });
65
+ } else if (type === 'selectToInput') {
66
+ return /*#__PURE__*/React.createElement(BizSelectToInput, {
67
+ value: props.value,
68
+ options: options || [],
69
+ keyField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value,
70
+ labelField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label,
71
+ onChange: onChange,
72
+ extendName: extendName
73
+ });
74
+ } else if (type === 'tab') {
75
+ return /*#__PURE__*/React.createElement(BizTab, {
76
+ value: props.value,
77
+ options: options,
78
+ onChange: onChange
79
+ });
80
+ } else if (type === 'radio') {
81
+ return /*#__PURE__*/React.createElement(Radio.Group, {
82
+ onChange: onChange,
83
+ defaultValue: props.value
84
+ }, /*#__PURE__*/React.createElement(Space, {
85
+ direction: direction || 'horizontal'
86
+ }, options && options.map(function (item) {
87
+ return /*#__PURE__*/React.createElement(Radio, {
88
+ key: item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value],
89
+ value: item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value]
90
+ }, item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label]);
91
+ })));
92
+ } else if (type === 'list') {
93
+ return /*#__PURE__*/React.createElement(BizList, {
94
+ value: props.value,
95
+ options: options && options.length > 0 ? options : undefined,
96
+ onChange: onChange
97
+ });
98
+ }
99
+
100
+ return /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u76F8\u5173\u7EC4\u4EF6");
101
+ };
102
+
103
+ ItemNode.defaultProps = {
104
+ fieldNames: {
105
+ label: 'label',
106
+ value: 'value'
107
+ }
108
+ };
109
+ export default ItemNode;
@@ -1,15 +1,5 @@
1
1
  import React from 'react';
2
- import './style/list.less';
3
- interface ItemProps {
4
- id: string | number;
5
- title?: string;
6
- content?: string;
7
- icon?: string;
8
- }
9
- interface BizListProps {
10
- value?: string | number;
11
- options?: Array<ItemProps>;
12
- onChange?: (value: string | number) => void;
13
- }
14
- declare const BizList: React.FC<BizListProps>;
2
+ import { ListProps } from '../types';
3
+ import './styles/list.less';
4
+ declare const BizList: React.FC<ListProps>;
15
5
  export default BizList;
@@ -12,31 +12,31 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import React, { useEffect, useState } from 'react';
14
14
  import IconFont from '../../components/iconFont';
15
- import { typeMenus } from '../data/chart';
16
- import './style/list.less';
15
+ import { typeMenus } from '../data/data';
16
+ import './styles/list.less';
17
17
 
18
18
  var BizList = function BizList(props) {
19
- var _props$options = props.options,
20
- options = _props$options === void 0 ? typeMenus : _props$options,
19
+ var options = props.options,
21
20
  value = props.value,
22
21
  onChange = props.onChange;
23
22
 
24
- var _useState = useState(value || options[0].id),
23
+ var _useState = useState(value || options && options[0].id),
25
24
  _useState2 = _slicedToArray(_useState, 2),
26
25
  selectList = _useState2[0],
27
26
  setSelectList = _useState2[1];
28
27
 
28
+ var classPrefix = 'biz-list';
29
29
  useEffect(function () {
30
- if (!value) {
30
+ if (!value && options) {
31
31
  onChange && onChange(options[0].id);
32
32
  }
33
33
  }, []);
34
34
  return /*#__PURE__*/React.createElement("div", {
35
- className: "biz-list-container"
36
- }, options.map(function (item) {
35
+ className: classPrefix
36
+ }, options && options.map(function (item) {
37
37
  return /*#__PURE__*/React.createElement("div", {
38
38
  key: item.id,
39
- className: "biz-list-item ".concat(selectList === item.id ? 'active' : ''),
39
+ className: "".concat(classPrefix, "-item ").concat(selectList === item.id ? 'active' : ''),
40
40
  onClick: function onClick() {
41
41
  setSelectList(function () {
42
42
  return item.id;
@@ -44,14 +44,17 @@ var BizList = function BizList(props) {
44
44
  onChange && onChange(item.id);
45
45
  }
46
46
  }, /*#__PURE__*/React.createElement("div", {
47
- className: "biz-list-title"
47
+ className: "".concat(classPrefix, "-title")
48
48
  }, item.icon && /*#__PURE__*/React.createElement(IconFont, {
49
- className: "biz-icon",
49
+ className: "".concat(classPrefix, "-icon"),
50
50
  type: item.icon
51
51
  }), item.title), /*#__PURE__*/React.createElement("div", {
52
- className: "biz-list-content"
52
+ className: "".concat(classPrefix, "-content")
53
53
  }, item.content));
54
54
  }));
55
55
  };
56
56
 
57
+ BizList.defaultProps = {
58
+ options: typeMenus
59
+ };
57
60
  export default BizList;
@@ -1,50 +1,6 @@
1
1
  import React from 'react';
2
- import { SelectProps } from 'antd';
3
- import '../style/index.less';
4
- interface ValueType {
5
- [prop: string]: any;
6
- }
7
- interface fieldNamesProps {
8
- label: string;
9
- value: string;
10
- }
11
- interface SelectInputProps extends SelectProps {
12
- fieldNames?: fieldNamesProps;
13
- /**
14
- * @description 下拉名称
15
- * @default false
16
- */
17
- name?: string;
18
- /**
19
- * @description 扩展名称
20
- * @default -
21
- */
22
- extendName?: string;
23
- /**
24
- * @description 创建option回调
25
- * @default false
26
- */
27
- createOption?: () => void;
28
- /**
29
- * @description 是否搜索option
30
- * @default false
31
- */
32
- search?: boolean;
33
- /**
34
- * @description 是否有创建option
35
- * @default false
36
- */
37
- create?: boolean;
38
- /**
39
- * @description 默认值
40
- * @default false
41
- */
42
- value?: ValueType;
43
- /**
44
- * @description 值改变回调
45
- * @default -
46
- */
47
- onChange?: (value?: ValueType) => void;
48
- }
49
- declare const BizSelectToInput: React.FC<SelectInputProps>;
2
+ import { BizSelectTypes } from '../../select/types';
3
+ import './styles/handle.less';
4
+ import { SelectInputProps } from '../types';
5
+ declare const BizSelectToInput: React.FC<BizSelectTypes.Props & SelectInputProps>;
50
6
  export default BizSelectToInput;
@@ -1,4 +1,4 @@
1
- var _excluded = ["options", "search", "create", "name", "extendName", "fieldNames", "value", "onChange"];
1
+ var _excluded = ["options", "name", "extendName", "value", "keyField", "labelField"];
2
2
 
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
 
@@ -26,35 +26,16 @@ import React, { useEffect, useState } from 'react';
26
26
  import { BizSelect } from '../..';
27
27
  import IconFont from '../../components/iconFont';
28
28
  import { Input, Radio, Space, Tooltip } from 'antd';
29
- import '../style/index.less';
30
- var inputOptions = [{
31
- label: '公开',
32
- value: 1
33
- }, {
34
- label: '指定人员明显',
35
- value: 2,
36
- title: '通过看板的共享功能指定可见成员'
37
- }, {
38
- label: '仅自己可见',
39
- value: 3
40
- }];
29
+ import './styles/handle.less';
30
+ import { inputOptions } from '../data/data';
41
31
 
42
32
  var BizSelectToInput = function BizSelectToInput(props) {
43
33
  var options = props.options,
44
- _props$search = props.search,
45
- search = _props$search === void 0 ? true : _props$search,
46
- _props$create = props.create,
47
- create = _props$create === void 0 ? true : _props$create,
48
- _props$name = props.name,
49
- name = _props$name === void 0 ? '' : _props$name,
34
+ name = props.name,
50
35
  extendName = props.extendName,
51
- _props$fieldNames = props.fieldNames,
52
- fieldNames = _props$fieldNames === void 0 ? {
53
- label: 'label',
54
- value: 'value'
55
- } : _props$fieldNames,
56
36
  value = props.value,
57
- _onChange = props.onChange,
37
+ keyField = props.keyField,
38
+ labelField = props.labelField,
58
39
  res = _objectWithoutProperties(props, _excluded);
59
40
 
60
41
  var _useState = useState(true),
@@ -62,15 +43,15 @@ var BizSelectToInput = function BizSelectToInput(props) {
62
43
  isSelect = _useState2[0],
63
44
  setIsSelect = _useState2[1];
64
45
 
65
- var _useState3 = useState(value),
46
+ var _useState3 = useState(true),
66
47
  _useState4 = _slicedToArray(_useState3, 2),
67
- selectValue = _useState4[0],
68
- setSelectValue = _useState4[1];
48
+ isFirst = _useState4[0],
49
+ setIsFirst = _useState4[1];
69
50
 
70
- var _useState5 = useState(true),
51
+ var _useState5 = useState(props.value),
71
52
  _useState6 = _slicedToArray(_useState5, 2),
72
- isFirst = _useState6[0],
73
- setIsFirst = _useState6[1];
53
+ selectValue = _useState6[0],
54
+ setSelectValue = _useState6[1];
74
55
 
75
56
  var _useState7 = useState(3),
76
57
  _useState8 = _slicedToArray(_useState7, 2),
@@ -82,17 +63,14 @@ var BizSelectToInput = function BizSelectToInput(props) {
82
63
  inputData = _useState10[0],
83
64
  setInputData = _useState10[1];
84
65
 
66
+ var classPrefix = 'biz-select-input';
85
67
  useEffect(function () {
86
68
  if (isFirst) {
87
69
  setIsFirst(false);
88
70
  return;
89
71
  }
90
72
 
91
- if (isSelect) {
92
- _onChange && _onChange(selectValue);
93
- } else {
94
- _onChange && _onChange();
95
- }
73
+ if (props.onChange) props.onChange(isSelect ? selectValue : undefined);
96
74
  }, [isSelect]);
97
75
  useEffect(function () {
98
76
  if (isFirst) return;
@@ -102,70 +80,81 @@ var BizSelectToInput = function BizSelectToInput(props) {
102
80
  if (extendName) {
103
81
  var _data;
104
82
 
105
- data = (_data = {}, _defineProperty(_data, fieldNames.value, 0), _defineProperty(_data, fieldNames.label, inputData), _defineProperty(_data, extendName, radioData), _data);
83
+ data = (_data = {}, _defineProperty(_data, keyField, 0), _defineProperty(_data, labelField, inputData), _defineProperty(_data, extendName, radioData), _data);
106
84
  } else {
107
85
  var _data2;
108
86
 
109
- data = (_data2 = {}, _defineProperty(_data2, fieldNames.value, 0), _defineProperty(_data2, fieldNames.label, value), _data2);
87
+ data = (_data2 = {}, _defineProperty(_data2, keyField, 0), _defineProperty(_data2, labelField, inputData), _data2);
110
88
  }
111
89
  }
112
90
 
113
- _onChange && _onChange(data);
91
+ if (props.onChange) props.onChange(data);
114
92
  }, [radioData, inputData]);
115
- return /*#__PURE__*/React.createElement("div", null, isSelect ? /*#__PURE__*/React.createElement(BizSelect, _objectSpread(_objectSpread({
116
- options: options,
117
- search: search,
118
- create: create,
119
- size: "middle",
120
- fieldNames: fieldNames,
121
- value: selectValue && selectValue[fieldNames.value],
122
- name: name
123
- }, res), {}, {
124
- createOption: function createOption() {
125
- setIsSelect(function () {
126
- return false;
127
- });
128
- },
129
- onChange: function onChange(value, data) {
130
- _onChange && _onChange(data);
131
- setSelectValue(function () {
132
- return data;
133
- });
134
- }
93
+
94
+ var onChange = function onChange(data) {
95
+ setSelectValue(data);
96
+ if (props.onChange) props.onChange(data);
97
+ };
98
+
99
+ var onChangeRadio = function onChangeRadio(e) {
100
+ setRadioData(function () {
101
+ return e.target.value;
102
+ });
103
+ };
104
+
105
+ var onAdd = function onAdd() {
106
+ setIsSelect(false);
107
+ };
108
+
109
+ var onBlur = function onBlur(e) {
110
+ setInputData(function () {
111
+ return e.target.value;
112
+ });
113
+ };
114
+
115
+ var addNode = /*#__PURE__*/React.createElement("div", {
116
+ className: "".concat(classPrefix, "-add"),
117
+ onClick: onAdd
118
+ }, /*#__PURE__*/React.createElement(IconFont, {
119
+ className: "".concat(classPrefix, "-icon-add"),
120
+ type: 'icon-tianjia1'
121
+ }), " \u6DFB\u52A0", name);
122
+ return /*#__PURE__*/React.createElement("div", {
123
+ className: classPrefix
124
+ }, isSelect ? /*#__PURE__*/React.createElement(BizSelect, _objectSpread(_objectSpread({}, res), {}, {
125
+ className: "".concat(classPrefix, "-select"),
126
+ options: props.options,
127
+ defaultValue: selectValue,
128
+ keyField: keyField,
129
+ labelField: labelField,
130
+ enableSearch: true,
131
+ dropdownExtra: addNode,
132
+ onChange: onChange
135
133
  })) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
136
- className: "biz-flex"
134
+ className: "".concat(classPrefix, "-input-row")
137
135
  }, /*#__PURE__*/React.createElement(Input, {
138
- className: "biz-input",
139
- placeholder: "\u8F93\u5165".concat(name),
136
+ className: "".concat(classPrefix, "-input"),
137
+ placeholder: "\u6DFB\u52A0".concat(name),
140
138
  autoFocus: !isSelect,
141
139
  allowClear: {
142
140
  clearIcon: /*#__PURE__*/React.createElement(IconFont, {
143
- className: "biz-icon",
144
141
  type: 'icon-qingchu'
145
142
  })
146
143
  },
147
- onBlur: function onBlur(e) {
148
- setInputData(function () {
149
- return e.target.value;
150
- });
151
- }
152
- }), /*#__PURE__*/React.createElement(IconFont, {
153
- className: "biz-icon biz-icon-switch",
144
+ onBlur: onBlur
145
+ }), /*#__PURE__*/React.createElement(Tooltip, {
146
+ title: "\u8FD4\u56DE\u9009\u62E9\u770B\u677F\u5217\u8868"
147
+ }, /*#__PURE__*/React.createElement(IconFont, {
148
+ className: "".concat(classPrefix, "-switch"),
154
149
  type: "icon-shurukuang_fanhui",
155
150
  onClick: function onClick() {
156
- setIsSelect(function () {
157
- return true;
158
- });
151
+ return setIsSelect(true);
159
152
  }
160
- })), extendName && /*#__PURE__*/React.createElement("div", {
161
- className: "biz-form-radio"
153
+ }))), extendName && /*#__PURE__*/React.createElement("div", {
154
+ className: "".concat(classPrefix, "-radio")
162
155
  }, /*#__PURE__*/React.createElement(Radio.Group, {
163
156
  value: radioData,
164
- onChange: function onChange(e) {
165
- setRadioData(function () {
166
- return e.target.value;
167
- });
168
- }
157
+ onChange: onChangeRadio
169
158
  }, /*#__PURE__*/React.createElement(Space, {
170
159
  direction: "horizontal"
171
160
  }, inputOptions.map(function (item) {
@@ -178,4 +167,9 @@ var BizSelectToInput = function BizSelectToInput(props) {
178
167
  }))))));
179
168
  };
180
169
 
170
+ BizSelectToInput.defaultProps = {
171
+ keyField: 'value',
172
+ labelField: 'label',
173
+ name: ''
174
+ };
181
175
  export default BizSelectToInput;
@@ -0,0 +1,39 @@
1
+ @import '../../../assets/styles/inner.less';
2
+
3
+ .biz-select-input {
4
+ &-input-row {
5
+ display: flex;
6
+ align-items: center;
7
+ }
8
+
9
+ &-switch {
10
+ margin-left: 8px;
11
+ cursor: pointer;
12
+
13
+ &:hover {
14
+ color: @primary-color;
15
+ }
16
+ }
17
+
18
+ &-icon-add {
19
+ cursor: pointer;
20
+ }
21
+
22
+ &-radio {
23
+ margin-top: 12px;
24
+ }
25
+ }
26
+
27
+ .biz-select-input-add {
28
+ width: fit-content;
29
+ padding: 2px 4px;
30
+ border-radius: @border-radius-small;
31
+
32
+ &:hover {
33
+ .__default-hover();
34
+ }
35
+
36
+ .biz-select-input-icon-add {
37
+ cursor: pointer;
38
+ }
39
+ }
@@ -0,0 +1,60 @@
1
+ @import '../../../assets/styles/inner.less';
2
+
3
+ .biz-list {
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ justify-content: space-between;
7
+ padding: @padding-md;
8
+ padding-bottom: 1px;
9
+ background-color: @background-color-base;
10
+ border-radius: @border-radius-normal;
11
+
12
+ &-item {
13
+ box-sizing: border-box;
14
+ width: calc((100% - 45px) / 4);
15
+ margin-bottom: 15px;
16
+ padding: @padding-md @padding-lg;
17
+ border: 1px solid @border-color-base;
18
+ border-radius: @border-radius-small;
19
+ cursor: pointer;
20
+
21
+ &:not(:nth-child(4n + 1)) {
22
+ margin-left: 15px;
23
+ }
24
+
25
+ &.active {
26
+ border-color: @primary-color;
27
+ }
28
+
29
+ &:hover {
30
+ border-color: @primary-1;
31
+ }
32
+
33
+ &.active,
34
+ &:hover {
35
+ .__default-hover();
36
+
37
+ .biz-list-content,
38
+ .biz-list-title,
39
+ .biz-list-title .biz-list-icon {
40
+ color: @primary-color;
41
+ }
42
+ }
43
+ }
44
+
45
+ &-title {
46
+ margin-bottom: 14px;
47
+ color: @text-color;
48
+ line-height: 20px;
49
+ }
50
+
51
+ &-icon {
52
+ margin-right: 14px;
53
+ color: @text-color;
54
+ }
55
+
56
+ &-content {
57
+ color: @text-color-secondary;
58
+ font-size: @font-size-sm;
59
+ }
60
+ }
@@ -0,0 +1,55 @@
1
+ @import '../../../assets/styles/inner.less';
2
+
3
+ .biz-tab {
4
+ display: flex;
5
+ color: @text-color-secondary;
6
+
7
+ &-item {
8
+ display: flex;
9
+ align-items: center;
10
+ height: @height-lg;
11
+ padding: 0 @padding-sm;
12
+ background: #fff;
13
+ border: 1px solid @border-color-base;
14
+ cursor: pointer;
15
+
16
+ &:not(:last-child) {
17
+ border-right-color: transparent;
18
+ }
19
+
20
+ &:first-child {
21
+ border-radius: @border-radius-small 0px 0px @border-radius-small;
22
+ }
23
+
24
+ &:last-child {
25
+ border-radius: 0px @border-radius-small @border-radius-small 0px;
26
+ }
27
+
28
+ &.disabled {
29
+ color: @disabled-color;
30
+ background: @background-color-base;
31
+ cursor: not-allowed;
32
+ }
33
+
34
+ &:not(.disabled):hover {
35
+ .__default-hover();
36
+ border-color: @border-color-base;
37
+ }
38
+
39
+ &:not(.disabled).active {
40
+ .__default-hover();
41
+ }
42
+ }
43
+
44
+ &-icon {
45
+ margin-right: 7px;
46
+ font-size: 18px;
47
+ }
48
+ &-radio-icon {
49
+ font-size: 18px;
50
+ }
51
+
52
+ &-drop {
53
+ .__select-panel();
54
+ }
55
+ }
@@ -1,9 +1,5 @@
1
1
  import React from 'react';
2
- import './style/tab.less';
3
- interface BizTabProps {
4
- value?: string | number;
5
- options?: Array<string | number>;
6
- onChange?: (value: string) => void;
7
- }
8
- declare const BizTab: React.FC<BizTabProps>;
2
+ import { TabTypes } from '../types';
3
+ import './styles/tab.less';
4
+ declare const BizTab: React.FC<TabTypes.Props>;
9
5
  export default BizTab;