@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,4 @@
1
+ import React from 'react';
2
+ import { BizSelectTypes } from './types';
3
+ declare const SelectOption: React.FC<BizSelectTypes.OverlayProps>;
4
+ export default SelectOption;
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { classPrefix } from '.';
3
+ import IconFont from '../components/iconFont';
4
+ import { util } from '../utils';
5
+
6
+ var SelectOption = function SelectOption(props) {
7
+ var option = props.option,
8
+ group = props.group,
9
+ checked = props.checked,
10
+ disabled = props.disabled,
11
+ multiple = props.multiple;
12
+
13
+ function onClick() {
14
+ if (disabled) return;
15
+ if (props.onClick) props.onClick(option);
16
+ }
17
+
18
+ function getLabel(label) {
19
+ if (!props.highlight || !props.highlight.enable || !props.highlight.text) return label;
20
+ var text = props.highlight.text;
21
+ if (text.length === label.length) return /*#__PURE__*/React.createElement("span", {
22
+ className: "".concat(classPrefix, "-highlight")
23
+ }, label);
24
+ return util.setHighLight(label, props.highlight.text, function (text, key) {
25
+ return /*#__PURE__*/React.createElement("span", {
26
+ className: "".concat(classPrefix, "-highlight"),
27
+ key: key
28
+ }, text);
29
+ });
30
+ }
31
+
32
+ if (group) {
33
+ return /*#__PURE__*/React.createElement("div", {
34
+ className: "".concat(classPrefix, "-group")
35
+ }, /*#__PURE__*/React.createElement("div", {
36
+ className: "".concat(classPrefix, "-split")
37
+ }), /*#__PURE__*/React.createElement("span", null, group.name));
38
+ }
39
+
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: "".concat(classPrefix, "-option ").concat(multiple ? classPrefix + '-option-multiple' : '', " ").concat(checked ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
42
+ onClick: onClick,
43
+ title: option[props.labelField]
44
+ }, multiple && (checked ? /*#__PURE__*/React.createElement(IconFont, {
45
+ className: "".concat(classPrefix, "-checkbox ").concat(classPrefix, "-checked"),
46
+ type: 'icon-a-Property1xuanzhong'
47
+ }) : /*#__PURE__*/React.createElement(IconFont, {
48
+ className: "".concat(classPrefix, "-checkbox ").concat(classPrefix, "-check"),
49
+ type: 'icon-a-Property1moren'
50
+ })), (option === null || option === void 0 ? void 0 : option.icon) && /*#__PURE__*/React.createElement("span", {
51
+ className: "".concat(classPrefix, "-option-icon")
52
+ }, option === null || option === void 0 ? void 0 : option.icon), /*#__PURE__*/React.createElement("span", {
53
+ className: "".concat(classPrefix, "-option-label")
54
+ }, getLabel(option[props.labelField])), !disabled && /*#__PURE__*/React.createElement("span", {
55
+ className: "".concat(classPrefix, "-option-btn")
56
+ }, props.extra && props.extra(option)));
57
+ };
58
+
59
+ export default SelectOption;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { BizSelectTypes } from './types';
3
+ declare const SelectOverlay: React.FC<BizSelectTypes.Props>;
4
+ export default SelectOverlay;
@@ -0,0 +1,154 @@
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, { useEffect, useState } from 'react';
14
+ import BizSearchInput from '../searchInput';
15
+ import { classPrefix } from './index';
16
+ import SelectOption from './option';
17
+ import _ from 'lodash';
18
+
19
+ var SelectOverlay = function SelectOverlay(props) {
20
+ var labelField = props.labelField,
21
+ keyField = props.keyField,
22
+ options = props.options,
23
+ extra = props.extra,
24
+ multiple = props.multiple,
25
+ disableItemList = props.disableItemList,
26
+ dropdownExtra = props.dropdownExtra;
27
+
28
+ var _useState = useState(),
29
+ _useState2 = _slicedToArray(_useState, 2),
30
+ searchValue = _useState2[0],
31
+ setSearchValue = _useState2[1];
32
+
33
+ var _useState3 = useState(),
34
+ _useState4 = _slicedToArray(_useState3, 2),
35
+ current = _useState4[0],
36
+ setCurrent = _useState4[1];
37
+
38
+ var _useState5 = useState([]),
39
+ _useState6 = _slicedToArray(_useState5, 2),
40
+ showList = _useState6[0],
41
+ setShowList = _useState6[1];
42
+
43
+ useEffect(function () {
44
+ if (props.value) setCurrent(props.value);
45
+ }, [props.value]);
46
+ useEffect(function () {
47
+ if (props.multiple) {
48
+ setSearchValue(props.searchValue);
49
+ }
50
+ }, [props.searchValue]);
51
+ useEffect(function () {
52
+ var ids = [];
53
+
54
+ if (current) {
55
+ if (multiple) {
56
+ if (current) {
57
+ ids = current.map(function (item) {
58
+ return item[keyField];
59
+ });
60
+ }
61
+ } else {
62
+ ids = [current[keyField]];
63
+ }
64
+ }
65
+
66
+ setShowList(function () {
67
+ if (props.type === 'group') {
68
+ return options.map(function (group) {
69
+ var groupDom = /*#__PURE__*/React.createElement(SelectOption, {
70
+ group: group,
71
+ key: group.name || String(Math.random())
72
+ });
73
+ var optionArr = getOptionDom(group.children, ids);
74
+ optionArr.unshift(groupDom);
75
+ return optionArr;
76
+ });
77
+ }
78
+
79
+ return getOptionDom(options, ids);
80
+ });
81
+ }, [searchValue, options, current]);
82
+
83
+ function getOptionDom(data, ids) {
84
+ return data.map(function (option) {
85
+ if (searchValue && !new RegExp(searchValue, 'i').test(option[labelField])) return;
86
+ var disabled = false;
87
+ disableItemList === null || disableItemList === void 0 ? void 0 : disableItemList.forEach(function (item) {
88
+ if (item[keyField] === option[keyField] && (!current || current && ids.indexOf(option[keyField]) < 0)) {
89
+ disabled = true;
90
+ }
91
+ });
92
+ return /*#__PURE__*/React.createElement(SelectOption, {
93
+ option: option,
94
+ labelField: labelField,
95
+ checked: current && ids.indexOf(option[keyField]) > -1,
96
+ highlight: {
97
+ enable: props.enableSearch || !!props.multiple,
98
+ text: searchValue || ''
99
+ },
100
+ extra: extra,
101
+ multiple: multiple,
102
+ onClick: onClick,
103
+ disabled: disabled,
104
+ key: option[keyField] || String(Math.random())
105
+ });
106
+ });
107
+ }
108
+
109
+ function onClick(option) {
110
+ var currentOption = _.cloneDeep(current);
111
+
112
+ if (multiple) {
113
+ if (!currentOption) {
114
+ currentOption = [option];
115
+ } else {
116
+ var num = 0,
117
+ flag = false;
118
+ currentOption.forEach(function (item, i) {
119
+ if (item[keyField] === option[keyField]) {
120
+ flag = true;
121
+ num = i;
122
+ return;
123
+ }
124
+ });
125
+
126
+ if (flag) {
127
+ currentOption.splice(num, 1);
128
+ } else {
129
+ currentOption.push(option);
130
+ }
131
+ }
132
+ } else {
133
+ currentOption = option;
134
+ }
135
+
136
+ setCurrent(currentOption);
137
+ if (props.onChange) props.onChange(currentOption);
138
+ }
139
+
140
+ function onSearch(v) {
141
+ setSearchValue(v);
142
+ }
143
+
144
+ return /*#__PURE__*/React.createElement("div", {
145
+ className: "".concat(classPrefix, "-overlay")
146
+ }, props.enableSearch && !props.multiple && /*#__PURE__*/React.createElement(BizSearchInput, {
147
+ className: "".concat(classPrefix, "-search"),
148
+ onChange: onSearch
149
+ }), dropdownExtra, /*#__PURE__*/React.createElement("div", {
150
+ className: "".concat(classPrefix, "-list-panel")
151
+ }, showList && showList.length ? showList : /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E")));
152
+ };
153
+
154
+ export default SelectOverlay;
@@ -0,0 +1,111 @@
1
+ @import '../../assets/styles/inner.less';
2
+
3
+ .biz-select-handle {
4
+ &-input {
5
+ position: relative;
6
+ flex: 1;
7
+ padding: 0px 8px;
8
+
9
+ &.disable {
10
+ .__disable();
11
+ }
12
+
13
+ .__select-default();
14
+
15
+ &.secondary {
16
+ .__select-normal-secondary();
17
+ }
18
+
19
+ &.borderless {
20
+ border: none;
21
+ }
22
+
23
+ &.lg {
24
+ height: @height-lg;
25
+ line-height: @height-lg;
26
+ }
27
+
28
+ &.sm {
29
+ height: @height-sm;
30
+ line-height: @height-sm;
31
+ }
32
+
33
+ &.base {
34
+ height: @height-base;
35
+ line-height: @height-base;
36
+ }
37
+ }
38
+
39
+ &-input-multiple {
40
+ display: flex;
41
+ flex: auto;
42
+ flex-wrap: wrap;
43
+ align-items: center;
44
+ height: auto;
45
+ min-height: @height-lg;
46
+ overflow: visible;
47
+
48
+ &.sm {
49
+ height: auto;
50
+ min-height: @height-sm;
51
+ }
52
+
53
+ &.base {
54
+ height: auto;
55
+ min-height: @height-base;
56
+ }
57
+ }
58
+
59
+ &-search.ant-input {
60
+ width: auto;
61
+ padding: 0;
62
+ background-color: transparent;
63
+ border: none;
64
+ box-shadow: none;
65
+
66
+ &:focus,
67
+ &.active {
68
+ box-shadow: none;
69
+ }
70
+ }
71
+
72
+ &-single-input {
73
+ .__default-overflow();
74
+ }
75
+
76
+ &-holder {
77
+ color: @input-placeholder-color;
78
+ }
79
+
80
+ &-expand-icon {
81
+ position: absolute;
82
+ top: 50%;
83
+ right: 8px;
84
+ flex: none;
85
+ font-size: @font-size-lg;
86
+ transform: translateY(-50%);
87
+ }
88
+
89
+ &-tag {
90
+ display: flex;
91
+ align-items: center;
92
+ margin: 2px 4px 2px 0;
93
+ background: none;
94
+ border-color: #cacdd4;
95
+
96
+ &:hover {
97
+ .__default-hover();
98
+
99
+ .anticon {
100
+ color: @primary-color;
101
+ }
102
+ }
103
+ }
104
+
105
+ &-tooltip {
106
+ .ant-tooltip-inner {
107
+ color: @black;
108
+ background-color: @white;
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,99 @@
1
+ @import '../../assets/styles/inner.less';
2
+
3
+ .biz-select {
4
+ &-handle {
5
+ position: relative;
6
+ }
7
+
8
+ &-overlay {
9
+ display: flex;
10
+ flex-direction: column;
11
+ .__select-panel();
12
+ }
13
+
14
+ &-list-panel {
15
+ flex: 1;
16
+ max-height: 400px;
17
+ overflow-x: hidden;
18
+ overflow-y: auto;
19
+ }
20
+
21
+ &-search {
22
+ flex: none;
23
+ margin-bottom: @margin-xs;
24
+ &.ant-input-affix-wrapper {
25
+ border-radius: @border-radius-normal;
26
+ }
27
+ }
28
+
29
+ &-nodata {
30
+ .__select-nodata();
31
+ }
32
+
33
+ &-group {
34
+ position: relative;
35
+ height: 32px;
36
+ padding: 0 @padding-sm;
37
+ color: @text-color-secondary;
38
+ line-height: 32px;
39
+
40
+ &::before {
41
+ position: absolute;
42
+ top: 9px;
43
+ left: 5px;
44
+ width: 3px;
45
+ height: 14px;
46
+ background-color: @primary-color;
47
+ border-radius: 10px;
48
+ content: '';
49
+ }
50
+
51
+ & > span {
52
+ position: relative;
53
+ padding-right: @padding-xss;
54
+ background: #fff;
55
+ }
56
+ }
57
+
58
+ &-split {
59
+ position: absolute;
60
+ top: 18px;
61
+ width: 100%;
62
+ height: 0;
63
+ border-bottom: 1px solid @border-color-base;
64
+ }
65
+
66
+ &-option {
67
+ display: flex;
68
+ .__select-option();
69
+
70
+ &.biz-select-option-multiple {
71
+ &:hover:not(.disabled) {
72
+ color: @primary-color;
73
+ background-color: @primary-1;
74
+ }
75
+
76
+ &.active:not(.disabled) {
77
+ color: @primary-color;
78
+ background: #fff;
79
+ }
80
+ }
81
+
82
+ &:not(.active, :hover, .disabled) .biz-select-highlight {
83
+ color: @primary-color;
84
+ }
85
+
86
+ &-label {
87
+ flex: 1;
88
+ .__default-overflow();
89
+ }
90
+ }
91
+
92
+ &-checkbox {
93
+ margin-right: 8px;
94
+ }
95
+
96
+ &-option-icon {
97
+ margin-right: @margin-xs;
98
+ }
99
+ }
@@ -0,0 +1,65 @@
1
+ import { ReactNode } from 'react';
2
+ export declare namespace BizSelectTypes {
3
+ interface Group {
4
+ children: Option[];
5
+ name: string;
6
+ }
7
+ interface Option {
8
+ icon?: ReactNode;
9
+ [otherProp: string]: any;
10
+ }
11
+ interface Props {
12
+ disable?: boolean;
13
+ defaultValue?: Option | Option[];
14
+ value?: Option | Option[];
15
+ className?: string;
16
+ type?: 'group' | 'normal';
17
+ theme?: string;
18
+ size?: 'lg' | 'base' | 'sm';
19
+ border?: boolean;
20
+ multiple?: boolean;
21
+ options: Group[] | Option[];
22
+ extra?: (option: Option) => ReactNode;
23
+ dropdownExtra?: ReactNode;
24
+ enableSearch?: boolean;
25
+ enableCreate?: boolean;
26
+ popupContainer?: boolean;
27
+ overlayWidth?: number;
28
+ labelField?: string;
29
+ keyField?: string;
30
+ disableItemList?: Option[];
31
+ searchValue?: string;
32
+ onChange?: (val: Option) => void;
33
+ }
34
+ interface OverlayProps {
35
+ option?: Option;
36
+ group?: Group;
37
+ disabled?: boolean;
38
+ multiple?: boolean;
39
+ highlight?: {
40
+ enable: boolean;
41
+ text: string;
42
+ color?: string;
43
+ };
44
+ checked?: boolean;
45
+ labelField?: string;
46
+ extra?: (option: Option) => ReactNode;
47
+ onClick?: (option: Option) => void;
48
+ }
49
+ }
50
+ export interface HandlerTypes {
51
+ label?: string;
52
+ placeholder?: string;
53
+ value?: BizSelectTypes.Option | BizSelectTypes.Option[];
54
+ multiple?: boolean;
55
+ enableCreate?: boolean;
56
+ labelField?: string;
57
+ keyField?: string | number;
58
+ disable?: boolean;
59
+ theme?: string;
60
+ size?: 'lg' | 'base' | 'sm';
61
+ border?: boolean;
62
+ onDelete?: (data: BizSelectTypes.Option) => void;
63
+ onSearch?: (val: string) => void;
64
+ onCreate?: (val: string) => void;
65
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -19,7 +19,7 @@ export var columns = [{
19
19
  }, {
20
20
  title: '操作',
21
21
  dataIndex: 'operation',
22
- render: function render(_, record) {
22
+ render: function render(_) {
23
23
  return 'Delete';
24
24
  }
25
25
  }];
@@ -1,3 +1,3 @@
1
- import './index.less';
1
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
2
2
  declare const _default: () => JSX.Element;
3
3
  export default _default;
@@ -31,7 +31,7 @@ import { BizTable } from '@zgfe/business-lib';
31
31
  import util from '../../utils/util';
32
32
  import chartData from './data/data';
33
33
  import { chartColors as color } from './data/color';
34
- import './index.less';
34
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
35
35
 
36
36
  var getColumn = function getColumn(columnData) {
37
37
  var data = [{
@@ -41,13 +41,17 @@ var getColumn = function getColumn(columnData) {
41
41
  key: 'icon',
42
42
  align: 'center',
43
43
  fixed: 'left',
44
- render: function render(text, record, index) {
44
+ render: function render() {
45
+ for (var _len = arguments.length, res = new Array(_len), _key = 0; _key < _len; _key++) {
46
+ res[_key] = arguments[_key];
47
+ }
48
+
45
49
  return /*#__PURE__*/React.createElement("div", {
46
50
  style: {
47
51
  width: '12px',
48
52
  height: '12px',
49
53
  borderRadius: '50%',
50
- background: color[index]
54
+ background: color[res[2]]
51
55
  }
52
56
  });
53
57
  }
@@ -59,16 +63,13 @@ var getColumn = function getColumn(columnData) {
59
63
  ellipsis: true,
60
64
  fixed: 'left'
61
65
  }];
62
- console.log(data);
63
66
 
64
67
  for (var i = 0; i < columnData.length; i++) {
65
68
  var value = columnData[i];
66
69
 
67
70
  if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
68
- // 处理日期
69
71
  value = value.replace(/\d{4}-/, '');
70
72
  } else if (/^\d{4}-\d{2}-\d{2}\|\d{4}-\d{2}-\d{2}$/.test(value)) {
71
- // 周、月日期
72
73
  var dates = value.match(/\d{4}-\d{2}-\d{2}/g);
73
74
  value = dates ? dates[0].replace(/\d{4}-/, '') + '~' + dates[1].replace(/\d{4}-/, '') : value;
74
75
  } else {
@@ -87,7 +88,7 @@ var getColumn = function getColumn(columnData) {
87
88
  align: 'center',
88
89
  ellipsis: true,
89
90
  dataIndex: "field".concat(i),
90
- render: function render(text, record, index) {
91
+ render: function render(text) {
91
92
  return /*#__PURE__*/React.createElement("span", {
92
93
  className: "biz-table-link"
93
94
  }, text);
@@ -101,7 +102,7 @@ var getColumn = function getColumn(columnData) {
101
102
  fixed: 'right',
102
103
  width: 150,
103
104
  align: 'right',
104
- render: function render(_, record) {
105
+ render: function render(_) {
105
106
  return /*#__PURE__*/React.createElement("a", null, "Delete");
106
107
  }
107
108
  });
@@ -139,8 +139,7 @@ export default (function () {
139
139
  var _useState = useState([]),
140
140
  _useState2 = _slicedToArray(_useState, 2),
141
141
  tableData = _useState2[0],
142
- setTableData = _useState2[1]; // 排序
143
-
142
+ setTableData = _useState2[1];
144
143
 
145
144
  var sortData = function sortData(data) {
146
145
  var compare = function compare(a, b) {
@@ -154,35 +153,28 @@ export default (function () {
154
153
  };
155
154
 
156
155
  data.sort(compare);
157
- console.log('sort after>>', data);
158
156
  return data;
159
- }; // 获取合并行数
160
-
157
+ };
161
158
 
162
159
  var mergeRow = function mergeRow(source, field, field2, field3) {
163
160
  var count = 0,
164
161
  scount = 0,
165
- tcount = 0; //重复项的第一项,第二项,第三项
166
-
167
- var indexCount = 1; //下一项
168
-
162
+ tcount = 0;
163
+ var indexCount = 1;
169
164
  var data = JSON.parse(JSON.stringify(source));
170
165
 
171
166
  while (indexCount < data.length) {
172
- var item = data.slice(count, count + 1)[0]; //获取没有比较的第一个对象
167
+ var item = data.slice(count, count + 1)[0];
173
168
 
174
169
  if (!item["".concat(field, "RowSpan")]) {
175
- item["".concat(field, "RowSpan")] = 1; //初始化为1
176
-
177
- item["".concat(field2, "RowSpan")] = 1; //初始化为1
178
-
179
- item["".concat(field3, "RowSpan")] = 1; //初始化为1
170
+ item["".concat(field, "RowSpan")] = 1;
171
+ item["".concat(field2, "RowSpan")] = 1;
172
+ item["".concat(field3, "RowSpan")] = 1;
180
173
  }
181
174
 
182
175
  if (item[field] === data[indexCount][field]) {
183
- //第一个对象与后面的对象相比,有相同项就累加,并且后面相同项设置为0
184
176
  item["".concat(field, "RowSpan")]++;
185
- data[indexCount]["".concat(field, "RowSpan")] = 0; // 第二项比较
177
+ data[indexCount]["".concat(field, "RowSpan")] = 0;
186
178
 
187
179
  if (data[scount][field2] === data[indexCount][field2]) {
188
180
  data[scount]["".concat(field2, "RowSpan")]++;
@@ -210,7 +202,6 @@ export default (function () {
210
202
  indexCount++;
211
203
  }
212
204
 
213
- console.log('for>>', data);
214
205
  return data;
215
206
  };
216
207
 
@@ -1,32 +1,6 @@
1
1
  import React from 'react';
2
- import { ColumnGroupType, ColumnType, TableProps } from 'antd/lib/table';
3
- import './index.less';
4
- interface BizTableProps {
5
- /**
6
- * @description 数据
7
- * @default -
8
- */
9
- dataSource: object[];
10
- /**
11
- * @description 表头
12
- * @default line
13
- */
14
- columns: (ColumnGroupType<object> | ColumnType<object>)[];
15
- /**
16
- * @description 数据总数
17
- * @default dataSource.length
18
- */
19
- total?: number;
20
- /**
21
- * @description 每页行数
22
- * @default 10
23
- */
24
- pageSize?: number;
25
- /**
26
- * @description 是否分页
27
- * @default true
28
- */
29
- pagination?: boolean;
30
- }
31
- declare const BizTable: React.FC<BizTableProps & TableProps<any>>;
2
+ import { TableProps } from 'antd/lib/table';
3
+ import { BizTableTypes } from './type';
4
+ import './styles/index.less';
5
+ declare const BizTable: React.FC<BizTableTypes.Props & TableProps<any>>;
32
6
  export default BizTable;