cloud-b2b 1.1.51 → 1.1.53

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 (307) hide show
  1. package/es/Area/Area.js +141 -0
  2. package/es/Card/Card.js +19 -0
  3. package/es/CodeInput/CodeInput.js +123 -0
  4. package/es/Control/Control.js +444 -0
  5. package/es/Control/event.js +43 -0
  6. package/es/Enhance/Dialogs.js +52 -0
  7. package/es/Enhance/Loading.js +131 -0
  8. package/{src → es}/Enhance/index.js +6 -8
  9. package/es/Header/Header.js +162 -0
  10. package/es/Header/Vertical.js +106 -0
  11. package/es/ImageView/ImageView.js +100 -0
  12. package/es/Indent/Indent.js +19 -0
  13. package/es/InpurCascader/InputCascader.js +108 -0
  14. package/es/InputEditor/InputEditor.js +173 -0
  15. package/es/InputSearch/InputSearch.js +266 -0
  16. package/es/InputSelect/InputSelect.js +160 -0
  17. package/es/InputTreeSelect/InputTreeSelect.js +121 -0
  18. package/es/InputWriting/InputWriting.js +85 -0
  19. package/es/Layout/Layout.js +201 -0
  20. package/es/LayoutLink/LayoutLink.js +73 -0
  21. package/es/Link/Link.js +85 -0
  22. package/es/Loading/Loading.js +13 -0
  23. package/es/Loading2/Loading2.js +9 -0
  24. package/es/ModalWithDrag/ModalWithDrag.js +29 -0
  25. package/{src → es}/ModalWithDrag/drag.js +116 -128
  26. package/es/NumberInput/NumberInput.js +200 -0
  27. package/es/Search/Search.js +497 -0
  28. package/es/Sidebar/Sidebar.js +144 -0
  29. package/es/Sidebar2/Sidebar.js +165 -0
  30. package/es/SuperForm/SuperForm.js +593 -0
  31. package/es/SuperForm2/SuperForm.js +687 -0
  32. package/es/SuperIcon/SuperIcon.js +27 -0
  33. package/es/SuperPagination/SuperPagination.js +109 -0
  34. package/es/SuperTab/SuperTab.js +107 -0
  35. package/es/SuperTab2/SuperTab2.js +145 -0
  36. package/es/SuperTable/DragSortRow.js +97 -0
  37. package/es/SuperTable/FilterDropDown.js +164 -0
  38. package/es/SuperTable/SuperTable.js +808 -0
  39. package/es/SuperTable/fixed.js +34 -0
  40. package/es/SuperTable2/SuperTable2.js +894 -0
  41. package/es/SuperTable2/SuperTableCell.js +198 -0
  42. package/es/SuperTable3/FilterDropDown.js +164 -0
  43. package/es/SuperTable3/SuperTable.js +665 -0
  44. package/es/SuperTable3/fixed.js +34 -0
  45. package/es/SuperToolbar/SuperToolbar.js +195 -0
  46. package/es/SuperUpload/SuperUpload.js +356 -0
  47. package/es/Title/Title.js +33 -0
  48. package/es/Viewer/ImageViews.js +258 -0
  49. package/es/Viewer/Viewer.js +122 -0
  50. package/es/WingBlank/WingBlank.js +16 -0
  51. package/es/helper.js +240 -0
  52. package/{src → es}/history.js +6 -6
  53. package/es/index.js +37 -0
  54. package/es/variables.js +6 -0
  55. package/lib/Area/Area.js +149 -0
  56. package/lib/Area/package.json +6 -0
  57. package/lib/Card/Card.js +27 -0
  58. package/lib/Card/package.json +6 -0
  59. package/lib/CodeInput/CodeInput.js +131 -0
  60. package/lib/CodeInput/package.json +6 -0
  61. package/lib/Control/Control.js +450 -0
  62. package/lib/Control/event.js +51 -0
  63. package/lib/Control/package.json +6 -0
  64. package/lib/Enhance/Dialogs.js +60 -0
  65. package/lib/Enhance/Loading.js +138 -0
  66. package/lib/Enhance/index.js +25 -0
  67. package/lib/Enhance/package.json +6 -0
  68. package/lib/Header/Header.js +169 -0
  69. package/lib/Header/Header.less +95 -0
  70. package/lib/Header/Vertical.js +114 -0
  71. package/lib/Header/Vertical.less +60 -0
  72. package/lib/Header/package.json +6 -0
  73. package/lib/ImageView/ImageView.js +108 -0
  74. package/lib/ImageView/ImageView.less +14 -0
  75. package/lib/ImageView/package.json +6 -0
  76. package/lib/Indent/Indent.js +27 -0
  77. package/lib/Indent/package.json +6 -0
  78. package/lib/InpurCascader/InputCascader.js +115 -0
  79. package/lib/InpurCascader/package.json +6 -0
  80. package/lib/InputEditor/InputEditor.js +181 -0
  81. package/lib/InputEditor/inputEditor.less +8 -0
  82. package/lib/InputEditor/package.json +6 -0
  83. package/lib/InputSearch/InputSearch.js +274 -0
  84. package/lib/InputSearch/package.json +6 -0
  85. package/lib/InputSelect/InputSelect.js +168 -0
  86. package/lib/InputSelect/package.json +6 -0
  87. package/lib/InputTreeSelect/InputTreeSelect.js +128 -0
  88. package/lib/InputTreeSelect/package.json +6 -0
  89. package/lib/InputWriting/InputWriting.js +93 -0
  90. package/lib/InputWriting/package.json +6 -0
  91. package/lib/Layout/Layout.js +209 -0
  92. package/lib/Layout/Layout.less +28 -0
  93. package/lib/Layout/package.json +6 -0
  94. package/lib/LayoutLink/LayoutLink.js +86 -0
  95. package/lib/LayoutLink/LayoutLink.less +53 -0
  96. package/lib/LayoutLink/package.json +6 -0
  97. package/lib/Link/Link.js +93 -0
  98. package/lib/Link/package.json +6 -0
  99. package/lib/Loading/Loading.js +21 -0
  100. package/lib/Loading/Loading.less +13 -0
  101. package/lib/Loading/package.json +6 -0
  102. package/lib/Loading2/Loading2.js +17 -0
  103. package/lib/Loading2/Loading2.less +19 -0
  104. package/lib/Loading2/package.json +6 -0
  105. package/lib/ModalWithDrag/ModalWithDrag.js +37 -0
  106. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  107. package/lib/ModalWithDrag/drag.js +124 -0
  108. package/lib/ModalWithDrag/package.json +6 -0
  109. package/lib/NumberInput/NumberInput.js +208 -0
  110. package/lib/NumberInput/package.json +6 -0
  111. package/lib/Search/Search.js +510 -0
  112. package/lib/Search/Search.less +63 -0
  113. package/lib/Search/package.json +6 -0
  114. package/lib/Sidebar/Sidebar.js +152 -0
  115. package/lib/Sidebar/Sidebar.less +78 -0
  116. package/lib/Sidebar/package.json +6 -0
  117. package/lib/Sidebar2/Sidebar.js +173 -0
  118. package/lib/Sidebar2/Sidebar.less +153 -0
  119. package/lib/Sidebar2/package.json +6 -0
  120. package/lib/SuperForm/SuperForm.js +605 -0
  121. package/lib/SuperForm/SuperForm.less +52 -0
  122. package/lib/SuperForm/package.json +6 -0
  123. package/lib/SuperForm2/SuperForm.js +699 -0
  124. package/lib/SuperForm2/SuperForm.less +52 -0
  125. package/lib/SuperForm2/package.json +6 -0
  126. package/lib/SuperIcon/SuperIcon.js +35 -0
  127. package/lib/SuperIcon/package.json +6 -0
  128. package/lib/SuperPagination/SuperPagination.js +117 -0
  129. package/lib/SuperPagination/package.json +6 -0
  130. package/lib/SuperTab/SuperTab.js +115 -0
  131. package/lib/SuperTab/SuperTab.less +43 -0
  132. package/lib/SuperTab/package.json +6 -0
  133. package/lib/SuperTab2/SuperTab2.js +153 -0
  134. package/lib/SuperTab2/SuperTab2.less +18 -0
  135. package/lib/SuperTab2/package.json +6 -0
  136. package/lib/SuperTable/DragSortRow.js +105 -0
  137. package/lib/SuperTable/DragSortRow.less +17 -0
  138. package/lib/SuperTable/FilterDropDown.js +172 -0
  139. package/lib/SuperTable/FilterDropDown.less +30 -0
  140. package/lib/SuperTable/SuperTable.js +816 -0
  141. package/lib/SuperTable/SuperTable.less +132 -0
  142. package/lib/SuperTable/fixed.js +42 -0
  143. package/lib/SuperTable/package.json +6 -0
  144. package/lib/SuperTable2/SuperTable2.js +907 -0
  145. package/lib/SuperTable2/SuperTable2.less +118 -0
  146. package/lib/SuperTable2/SuperTableCell.js +203 -0
  147. package/lib/SuperTable2/package.json +6 -0
  148. package/lib/SuperTable3/FilterDropDown.js +172 -0
  149. package/lib/SuperTable3/FilterDropDown.less +29 -0
  150. package/lib/SuperTable3/SuperTable.js +673 -0
  151. package/lib/SuperTable3/SuperTable.less +99 -0
  152. package/lib/SuperTable3/fixed.js +42 -0
  153. package/lib/SuperTable3/package.json +6 -0
  154. package/lib/SuperToolbar/SuperToolbar.js +203 -0
  155. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  156. package/lib/SuperToolbar/package.json +6 -0
  157. package/lib/SuperUpload/SuperUpload.js +368 -0
  158. package/lib/SuperUpload/SuperUpload.less +28 -0
  159. package/lib/SuperUpload/package.json +6 -0
  160. package/lib/Title/Title.js +41 -0
  161. package/lib/Title/Title.less +35 -0
  162. package/lib/Title/package.json +6 -0
  163. package/lib/Viewer/ImageViews.js +266 -0
  164. package/lib/Viewer/Viewer.js +130 -0
  165. package/lib/Viewer/Viewer.less +67 -0
  166. package/lib/Viewer/imgView.less +59 -0
  167. package/lib/Viewer/package.json +7 -0
  168. package/lib/WingBlank/WingBlank.js +24 -0
  169. package/lib/WingBlank/WingBlank.less +12 -0
  170. package/lib/WingBlank/package.json +6 -0
  171. package/lib/adjust.less +89 -0
  172. package/lib/helper.js +246 -0
  173. package/lib/history.js +12 -0
  174. package/lib/index.js +271 -0
  175. package/lib/index.less +31 -0
  176. package/lib/style.less +30 -0
  177. package/lib/variables.js +14 -0
  178. package/lib/variables.less +73 -0
  179. package/package.json +22 -44
  180. package/src/Area/Area.js +0 -94
  181. package/src/Card/Card.js +0 -16
  182. package/src/CodeInput/CodeInput.js +0 -76
  183. package/src/Control/Control.js +0 -338
  184. package/src/Control/event.js +0 -45
  185. package/src/Enhance/Dialogs.js +0 -24
  186. package/src/Enhance/Loading.js +0 -83
  187. package/src/Header/Header.js +0 -149
  188. package/src/Header/Vertical.js +0 -74
  189. package/src/ImageView/ImageView.js +0 -62
  190. package/src/Indent/Indent.js +0 -12
  191. package/src/InpurCascader/InputCascader.js +0 -83
  192. package/src/InputEditor/InputEditor.js +0 -93
  193. package/src/InputSearch/InputSearch.js +0 -186
  194. package/src/InputSelect/InputSelect.js +0 -103
  195. package/src/InputTreeSelect/InputTreeSelect.js +0 -87
  196. package/src/InputWriting/InputWriting.js +0 -65
  197. package/src/Layout/Layout.js +0 -121
  198. package/src/LayoutLink/LayoutLink.js +0 -59
  199. package/src/Link/Link.js +0 -57
  200. package/src/Loading/Loading.js +0 -15
  201. package/src/Loading2/Loading2.js +0 -15
  202. package/src/ModalWithDrag/ModalWithDrag.js +0 -17
  203. package/src/NumberInput/NumberInput.js +0 -137
  204. package/src/Search/Search.js +0 -368
  205. package/src/Sidebar/Sidebar.js +0 -111
  206. package/src/Sidebar2/Sidebar.js +0 -143
  207. package/src/SuperForm/SuperForm.js +0 -516
  208. package/src/SuperForm2/SuperForm.js +0 -588
  209. package/src/SuperIcon/SuperIcon.js +0 -14
  210. package/src/SuperPagination/SuperPagination.js +0 -65
  211. package/src/SuperTab/SuperTab.js +0 -84
  212. package/src/SuperTab2/SuperTab2.js +0 -94
  213. package/src/SuperTable/DragSortRow.js +0 -62
  214. package/src/SuperTable/FilterDropDown.js +0 -111
  215. package/src/SuperTable/SuperTable.js +0 -590
  216. package/src/SuperTable/fixed.js +0 -34
  217. package/src/SuperTable2/SuperTable2.js +0 -600
  218. package/src/SuperTable2/SuperTableCell.js +0 -144
  219. package/src/SuperTable3/FilterDropDown.js +0 -111
  220. package/src/SuperTable3/SuperTable.js +0 -498
  221. package/src/SuperTable3/fixed.js +0 -34
  222. package/src/SuperToolbar/SuperToolbar.js +0 -128
  223. package/src/SuperUpload/SuperUpload.js +0 -137
  224. package/src/Title/Title.js +0 -18
  225. package/src/Viewer/ImageViews.js +0 -220
  226. package/src/Viewer/Viewer.js +0 -97
  227. package/src/WingBlank/WingBlank.js +0 -14
  228. package/src/helper.js +0 -185
  229. package/src/index.js +0 -38
  230. package/src/variables.js +0 -5
  231. package/test/index.html +0 -10
  232. package/test/test.js +0 -16
  233. package/test/test.less +0 -12
  234. package/test/webpack.config.js +0 -71
  235. package/tools/babel.config.js +0 -14
  236. package/tools/build.js +0 -70
  237. package/tools/publish.js +0 -9
  238. package/tools/util.js +0 -53
  239. /package/{src → es}/Area/package.json +0 -0
  240. /package/{src → es}/Card/package.json +0 -0
  241. /package/{src → es}/CodeInput/package.json +0 -0
  242. /package/{src → es}/Control/package.json +0 -0
  243. /package/{src → es}/Enhance/package.json +0 -0
  244. /package/{src → es}/Header/Header.less +0 -0
  245. /package/{src → es}/Header/Vertical.less +0 -0
  246. /package/{src → es}/Header/package.json +0 -0
  247. /package/{src → es}/ImageView/ImageView.less +0 -0
  248. /package/{src → es}/ImageView/package.json +0 -0
  249. /package/{src → es}/Indent/package.json +0 -0
  250. /package/{src → es}/InpurCascader/package.json +0 -0
  251. /package/{src → es}/InputEditor/inputEditor.less +0 -0
  252. /package/{src → es}/InputEditor/package.json +0 -0
  253. /package/{src → es}/InputSearch/package.json +0 -0
  254. /package/{src → es}/InputSelect/package.json +0 -0
  255. /package/{src → es}/InputTreeSelect/package.json +0 -0
  256. /package/{src → es}/InputWriting/package.json +0 -0
  257. /package/{src → es}/Layout/Layout.less +0 -0
  258. /package/{src → es}/Layout/package.json +0 -0
  259. /package/{src → es}/LayoutLink/LayoutLink.less +0 -0
  260. /package/{src → es}/LayoutLink/package.json +0 -0
  261. /package/{src → es}/Link/package.json +0 -0
  262. /package/{src → es}/Loading/Loading.less +0 -0
  263. /package/{src → es}/Loading/package.json +0 -0
  264. /package/{src → es}/Loading2/Loading2.less +0 -0
  265. /package/{src → es}/Loading2/package.json +0 -0
  266. /package/{src → es}/ModalWithDrag/ModalWithDrag.less +0 -0
  267. /package/{src → es}/ModalWithDrag/package.json +0 -0
  268. /package/{src → es}/NumberInput/package.json +0 -0
  269. /package/{src → es}/Search/Search.less +0 -0
  270. /package/{src → es}/Search/package.json +0 -0
  271. /package/{src → es}/Sidebar/Sidebar.less +0 -0
  272. /package/{src → es}/Sidebar/package.json +0 -0
  273. /package/{src → es}/Sidebar2/Sidebar.less +0 -0
  274. /package/{src → es}/Sidebar2/package.json +0 -0
  275. /package/{src → es}/SuperForm/SuperForm.less +0 -0
  276. /package/{src → es}/SuperForm/package.json +0 -0
  277. /package/{src → es}/SuperForm2/SuperForm.less +0 -0
  278. /package/{src → es}/SuperForm2/package.json +0 -0
  279. /package/{src → es}/SuperIcon/package.json +0 -0
  280. /package/{src → es}/SuperPagination/package.json +0 -0
  281. /package/{src → es}/SuperTab/SuperTab.less +0 -0
  282. /package/{src → es}/SuperTab/package.json +0 -0
  283. /package/{src → es}/SuperTab2/SuperTab2.less +0 -0
  284. /package/{src → es}/SuperTab2/package.json +0 -0
  285. /package/{src → es}/SuperTable/DragSortRow.less +0 -0
  286. /package/{src → es}/SuperTable/FilterDropDown.less +0 -0
  287. /package/{src → es}/SuperTable/SuperTable.less +0 -0
  288. /package/{src → es}/SuperTable/package.json +0 -0
  289. /package/{src → es}/SuperTable2/SuperTable2.less +0 -0
  290. /package/{src → es}/SuperTable2/package.json +0 -0
  291. /package/{src → es}/SuperTable3/FilterDropDown.less +0 -0
  292. /package/{src → es}/SuperTable3/SuperTable.less +0 -0
  293. /package/{src → es}/SuperTable3/package.json +0 -0
  294. /package/{src → es}/SuperToolbar/SuperToolbar.less +0 -0
  295. /package/{src → es}/SuperToolbar/package.json +0 -0
  296. /package/{src → es}/SuperUpload/SuperUpload.less +0 -0
  297. /package/{src → es}/SuperUpload/package.json +0 -0
  298. /package/{src → es}/Title/Title.less +0 -0
  299. /package/{src → es}/Title/package.json +0 -0
  300. /package/{src → es}/Viewer/Viewer.less +0 -0
  301. /package/{src → es}/Viewer/imgView.less +0 -0
  302. /package/{src → es}/Viewer/package.json +0 -0
  303. /package/{src → es}/WingBlank/WingBlank.less +0 -0
  304. /package/{src → es}/WingBlank/package.json +0 -0
  305. /package/{src → es}/adjust.less +0 -0
  306. /package/{src → es}/style.less +0 -0
  307. /package/{src → es}/variables.less +0 -0
@@ -0,0 +1,444 @@
1
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
4
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
10
+ import _DatePicker from "antd/es/date-picker";
11
+ import _typeof from "@babel/runtime-corejs3/helpers/typeof";
12
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
13
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
14
+ import _Radio from "antd/es/radio";
15
+ import _Input from "antd/es/input";
16
+ import _Select from "antd/es/select";
17
+ var _excluded = ["options"],
18
+ _excluded2 = ["type", "autoFocus"];
19
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
21
+ import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
22
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
23
+ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
24
+ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
25
+ import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
26
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
27
+ import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
28
+ import _trimInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/trim";
29
+ import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
30
+ import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
31
+ import React from 'react';
32
+ import PropTypes from 'prop-types';
33
+ import ReactDOM from 'react-dom';
34
+ import InputSearch from '../InputSearch';
35
+ import NumberInput from '../NumberInput';
36
+ import InputEditor from '../InputEditor';
37
+ import InputSelect from '../InputSelect';
38
+ import InputWriting from '../InputWriting';
39
+ import InpurCascader from '../InpurCascader';
40
+ import InputTreeSelect from '../InputTreeSelect';
41
+ import moment from 'moment';
42
+ import eventWrapper from './event';
43
+ import CodeInput from '../CodeInput';
44
+ import SuperUpload from '../SuperUpload';
45
+ import Area from '../Area/Area';
46
+ var SelectOption = _Select.Option;
47
+ var TextArea = _Input.TextArea;
48
+ var RadioGroup = _Radio.Group;
49
+ moment.locale('zh-cn');
50
+ var getTitleOptions = function getTitleOptions(options) {
51
+ var existTitles = [];
52
+ if (options) {
53
+ return _reduceInstanceProperty(options).call(options, function (result, option) {
54
+ if (_includesInstanceProperty(existTitles).call(existTitles, option.title)) {
55
+ return result;
56
+ } else {
57
+ existTitles.push(option.title);
58
+ result.push(_objectSpread(_objectSpread({}, option), {}, {
59
+ value: option.title,
60
+ originValue: option.value
61
+ }));
62
+ return result;
63
+ }
64
+ }, []);
65
+ } else {
66
+ return options;
67
+ }
68
+ };
69
+
70
+ // 设置组件焦点
71
+ var setFocus = function setFocus(element, type) {
72
+ if (element) {
73
+ if (element.focus) {
74
+ element.focus();
75
+ } else if (type === 'select' || type === 'selectText') {
76
+ ReactDOM.findDOMNode(element).firstChild.focus();
77
+ } else if (type === 'search' || type === 'searchText' || type === 'date') {
78
+ ReactDOM.findDOMNode(element).getElementsByTagName('input')[0].focus();
79
+ }
80
+ }
81
+ };
82
+ var toOption = function toOption(_ref, index) {
83
+ var value = _ref.value,
84
+ title = _ref.title;
85
+ return /*#__PURE__*/React.createElement(SelectOption, {
86
+ key: index,
87
+ value: String(value)
88
+ }, title);
89
+ };
90
+ var toRadio = function toRadio(_ref2, index) {
91
+ var value = _ref2.value,
92
+ title = _ref2.title,
93
+ _ref2$disabled = _ref2.disabled,
94
+ disabled = _ref2$disabled === void 0 ? false : _ref2$disabled;
95
+ return /*#__PURE__*/React.createElement(_Radio, {
96
+ key: index,
97
+ value: String(value),
98
+ disabled: disabled
99
+ }, title);
100
+ };
101
+
102
+ // 文本输入框
103
+ var text = function text(props) {
104
+ if (props.value || props.defaultValue) {
105
+ props.title = props.value || props.defaultValue;
106
+ }
107
+ return /*#__PURE__*/React.createElement(_Input, props);
108
+ };
109
+
110
+ // 密码输入框
111
+ var password = function password(props) {
112
+ props.type = 'password';
113
+ return /*#__PURE__*/React.createElement(_Input, props);
114
+ };
115
+
116
+ // 多行文本输入框
117
+ var textArea = function textArea(props) {
118
+ if (props.readonly) {
119
+ delete props.readonly;
120
+ props.readOnly = true;
121
+ props.style = _Object$assign(props.style || {}, {
122
+ backgroundColor: '#f0f0f0'
123
+ });
124
+ }
125
+ return /*#__PURE__*/React.createElement(TextArea, props);
126
+ };
127
+
128
+ //双选输入框
129
+ var _double = function _double(props) {
130
+ if (props.ref) {
131
+ props.inputRef = props.ref;
132
+ delete props.ref;
133
+ }
134
+ var doubleKey = props.doubleKey,
135
+ onChange = props.onChange;
136
+ var props1 = _objectSpread(_objectSpread({}, props), {}, {
137
+ defaultValue: props.doubleValue[props.doubleKey[0]],
138
+ onChange: props.onChangeKey1
139
+ });
140
+ var props2 = _objectSpread(_objectSpread({}, props), {}, {
141
+ defaultValue: props.doubleValue[props.doubleKey[1]],
142
+ onChange: props.onChangeKey2
143
+ });
144
+ return /*#__PURE__*/React.createElement("div", {
145
+ style: {
146
+ display: 'flex'
147
+ }
148
+ }, /*#__PURE__*/React.createElement(NumberInput, _extends({
149
+ key: doubleKey[0]
150
+ }, props1)), "~", /*#__PURE__*/React.createElement(NumberInput, _extends({
151
+ key: doubleKey[1]
152
+ }, props2)));
153
+ };
154
+
155
+ // 只读框
156
+ var readonly = function readonly(props) {
157
+ props.readOnly = true;
158
+ props.style = _Object$assign(props.style || {}, {
159
+ backgroundColor: '#f0f0f0'
160
+ });
161
+ if (props.value || props.defaultValue) {
162
+ props.title = props.value || props.defaultValue;
163
+ }
164
+ return /*#__PURE__*/React.createElement(_Input, props);
165
+ };
166
+
167
+ // 数字输入框
168
+ var number = function number(props) {
169
+ if (props.ref) {
170
+ props.inputRef = props.ref;
171
+ delete props.ref;
172
+ }
173
+ return /*#__PURE__*/React.createElement(NumberInput, props);
174
+ };
175
+ var isMatch = function isMatch(inputValue, option) {
176
+ var _context;
177
+ return _indexOfInstanceProperty(_context = option.props.children).call(_context, inputValue) !== -1;
178
+ };
179
+
180
+ // 下拉选择框
181
+ var select = function select(props) {
182
+ var options = props.options || [];
183
+ delete props.options;
184
+ props.showSearch = true;
185
+ props.filterOption = isMatch;
186
+ props.allowClear !== false && (props.allowClear = true);
187
+ if (props.mode === 'multiple') {
188
+ !props.value && typeof props.value !== 'undefined' && (props.value = []);
189
+ !props.defaultValue && typeof props.defaultValue !== 'undefined' && (props.defaultValue = []);
190
+ } else {
191
+ props.value && _typeof(props.value) === 'object' && (props.value = _JSON$stringify(props.value));
192
+ props.defaultValue && _typeof(props.defaultValue) === 'object' && (props.defaultValue = _JSON$stringify(props.defaultValue));
193
+ if (props.value !== true && props.value !== false && props.value !== '' && props.value !== undefined) {
194
+ props.value = String(props.value);
195
+ }
196
+ }
197
+ return /*#__PURE__*/React.createElement(_Select, props, _mapInstanceProperty(options).call(options, toOption));
198
+ };
199
+ var area = function area(props) {
200
+ var areaProps = _objectSpread(_objectSpread({}, props), {}, {
201
+ onParentChange: props.onChange
202
+ });
203
+ return /*#__PURE__*/React.createElement(Area, areaProps);
204
+ };
205
+
206
+ // 下拉选择框-取title作为值
207
+ var selectText = function selectText(props) {
208
+ var options = getTitleOptions(props.options) || [];
209
+ delete props.options;
210
+ props.showSearch = true;
211
+ props.filterOption = isMatch;
212
+ props.allowClear !== false && (props.allowClear = true);
213
+ if (props.mode === 'multiple') {
214
+ !props.value && typeof props.value !== 'undefined' && (props.value = []);
215
+ !props.defaultValue && typeof props.defaultValue !== 'undefined' && (props.defaultValue = []);
216
+ } else {
217
+ props.value && _typeof(props.value) === 'object' && (props.value = _JSON$stringify(props.value));
218
+ props.defaultValue && _typeof(props.defaultValue) === 'object' && (props.defaultValue = _JSON$stringify(props.defaultValue));
219
+ }
220
+ return /*#__PURE__*/React.createElement(_Select, props, _mapInstanceProperty(options).call(options, toOption));
221
+ };
222
+
223
+ // 搜索框
224
+ var search = function search(props) {
225
+ if (props.ref) {
226
+ props.inputRef = props.ref;
227
+ delete props.ref;
228
+ }
229
+ return /*#__PURE__*/React.createElement(InputSearch, props);
230
+ };
231
+
232
+ // 搜索框-值取title
233
+ var searchText = function searchText(props) {
234
+ if (props.ref) {
235
+ props.inputRef = props.ref;
236
+ delete props.ref;
237
+ }
238
+ props.options = getTitleOptions(props.options);
239
+ return /*#__PURE__*/React.createElement(InputSearch, props);
240
+ };
241
+
242
+ // 多选下拉搜索
243
+ var selectSearch = function selectSearch(props) {
244
+ !props.value && typeof props.value !== 'undefined' && (props.value = []);
245
+ return /*#__PURE__*/React.createElement(InputSelect, props);
246
+ };
247
+
248
+ // 多选手写下拉 不支持title,value形式
249
+ var selectWriting = function selectWriting(props) {
250
+ !props.value && typeof props.value !== 'undefined' && (props.value = []);
251
+ return /*#__PURE__*/React.createElement(InputWriting, props);
252
+ };
253
+
254
+ // 日期选择框
255
+ var date = function date(props) {
256
+ var origin = props.onChange;
257
+ var MonthPicker = _DatePicker.MonthPicker;
258
+ if (typeof props.value !== 'undefined') {
259
+ props.value = !props.value ? undefined : moment(props.value);
260
+ }
261
+ if (typeof props.defaultValue !== 'undefined') {
262
+ props.defaultValue = !props.defaultValue ? undefined : moment(props.defaultValue);
263
+ }
264
+ if (props.showTime) {
265
+ props.format = 'YYYY-MM-DD HH:mm:ss';
266
+ props.placeholder = '请选择时间';
267
+ if (typeof props.showTime === 'boolean') {
268
+ props.showTime = '00:00:00';
269
+ }
270
+ if (props.showTime !== 'current') {
271
+ props.showTime = {
272
+ defaultValue: moment(props.showTime, 'HH:mm:ss')
273
+ };
274
+ } else {
275
+ props.showTime = true;
276
+ }
277
+ }
278
+ if (props.onChange) {
279
+ props.onChange = function (date, str) {
280
+ return origin(str);
281
+ };
282
+ }
283
+ if (props.month) {
284
+ props.format = 'YYYY-MM';
285
+ props.placeholder = '请选择日期';
286
+ return /*#__PURE__*/React.createElement("div", {
287
+ onBlur: props.onBlur
288
+ }, /*#__PURE__*/React.createElement(MonthPicker, props));
289
+ }
290
+ return /*#__PURE__*/React.createElement("div", {
291
+ onBlur: props.onBlur
292
+ }, /*#__PURE__*/React.createElement(_DatePicker, props));
293
+ };
294
+
295
+ // 单选按钮组
296
+ var radioGroup = function radioGroup(_ref3) {
297
+ var _ref3$options = _ref3.options,
298
+ options = _ref3$options === void 0 ? [] : _ref3$options,
299
+ props = _objectWithoutProperties(_ref3, _excluded);
300
+ var origin = props.onChange;
301
+ props.style = {
302
+ borderSpacing: 0
303
+ };
304
+ typeof props.value === 'number' && (props.value = String(props.value));
305
+ typeof props.defaultValue === 'number' && (props.defaultValue = String(props.defaultValue));
306
+ if (props.onChange) {
307
+ props.onChange = function (e) {
308
+ return origin(e.target.value);
309
+ };
310
+ }
311
+ return /*#__PURE__*/React.createElement(RadioGroup, props, _mapInstanceProperty(options).call(options, toRadio));
312
+ };
313
+
314
+ // 富文本编辑器
315
+ var editor = function editor(props) {
316
+ return /*#__PURE__*/React.createElement(InputEditor, props);
317
+ };
318
+
319
+ //级联选择下拉
320
+ var cascader = function cascader(props) {
321
+ !props.value && typeof props.value !== 'undefined' && (props.value = []);
322
+ return /*#__PURE__*/React.createElement(InpurCascader, props);
323
+ };
324
+ //树型结构
325
+ var treeSelect = function treeSelect(props) {
326
+ !props.value && typeof props.value !== 'undefined' && (props.value = []);
327
+ return /*#__PURE__*/React.createElement(InputTreeSelect, props);
328
+ };
329
+ var captcha = function captcha(props) {
330
+ if (props.ref) {
331
+ props.inputRef = props.ref;
332
+ delete props.ref;
333
+ }
334
+ return /*#__PURE__*/React.createElement(CodeInput, props);
335
+ };
336
+ var uploadImg = function uploadImg(props) {
337
+ var uploadProps = _objectSpread(_objectSpread({}, props), {}, {
338
+ fileList: props.value || [],
339
+ readonly: props.readonly || false
340
+ });
341
+ return /*#__PURE__*/React.createElement(SuperUpload, uploadProps);
342
+ };
343
+
344
+ // 支持的控件类型
345
+ var controls = {
346
+ text: text,
347
+ textArea: textArea,
348
+ readonly: readonly,
349
+ number: number,
350
+ select: select,
351
+ selectText: selectText,
352
+ search: search,
353
+ searchText: searchText,
354
+ date: date,
355
+ radioGroup: radioGroup,
356
+ password: password,
357
+ editor: editor,
358
+ selectSearch: selectSearch,
359
+ selectWriting: selectWriting,
360
+ cascader: cascader,
361
+ captcha: captcha,
362
+ area: area,
363
+ uploadImg: uploadImg,
364
+ "double": _double,
365
+ treeSelect: treeSelect
366
+ };
367
+ var Control = function Control(_ref4) {
368
+ var type = _ref4.type,
369
+ autoFocus = _ref4.autoFocus,
370
+ props = _objectWithoutProperties(_ref4, _excluded2);
371
+ var ref = autoFocus ? function (e) {
372
+ return setFocus(e, type);
373
+ } : null;
374
+ var _props$doubleKey = props.doubleKey,
375
+ doubleKey = _props$doubleKey === void 0 ? undefined : _props$doubleKey,
376
+ _props$onChangeKey = props.onChangeKey1,
377
+ onChangeKey1 = _props$onChangeKey === void 0 ? undefined : _props$onChangeKey,
378
+ _props$onChangeKey2 = props.onChangeKey2,
379
+ onChangeKey2 = _props$onChangeKey2 === void 0 ? undefined : _props$onChangeKey2,
380
+ _props$doubleValue = props.doubleValue,
381
+ doubleValue = _props$doubleValue === void 0 ? {} : _props$doubleValue;
382
+ return controls[type](_Object$assign(eventWrapper(props), type === 'double' ? {
383
+ ref: ref,
384
+ doubleKey: doubleKey,
385
+ onChangeKey1: onChangeKey1,
386
+ onChangeKey2: onChangeKey2,
387
+ doubleValue: doubleValue
388
+ } : {
389
+ ref: ref
390
+ }));
391
+ };
392
+ Control.propTypes = {
393
+ type: PropTypes.string.isRequired,
394
+ autoFocus: PropTypes.bool,
395
+ onChange: PropTypes.func,
396
+ onSearch: PropTypes.func,
397
+ onBlur: PropTypes.func,
398
+ onGetCode: PropTypes.func
399
+ };
400
+
401
+ // 依据value查找对应的标题
402
+ var getTitle = function getTitle(value) {
403
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
404
+ if (typeof value === 'undefined') {
405
+ return '';
406
+ } else if (_typeof(value) === 'object') {
407
+ if (_Array$isArray(value)) {
408
+ if (options && options.length > 0) {
409
+ var _context2;
410
+ // 处理多选字典下拉变成只读的情况:
411
+ return _trimInstanceProperty(_context2 = _reduceInstanceProperty(value).call(value, function (val, it) {
412
+ var item = _findInstanceProperty(options).call(options, function (o) {
413
+ return o.value === it;
414
+ });
415
+ if (item) {
416
+ val += " ".concat(item.title);
417
+ }
418
+ return val;
419
+ }, '')).call(_context2);
420
+ }
421
+ return value;
422
+ } else {
423
+ return value ? value.title : '';
424
+ }
425
+ } else {
426
+ var index = _findIndexInstanceProperty(options).call(options, function (obj) {
427
+ return String(obj.value) === String(value);
428
+ });
429
+ return index === -1 ? value : options[index].title;
430
+ }
431
+ };
432
+
433
+ // 确保value的值为字符串(包含value和title的对象除外)
434
+ var makeString = function makeString(value) {
435
+ if (value === null || typeof value === 'undefined') {
436
+ return '';
437
+ } else if (typeof value === 'number') {
438
+ return String(value);
439
+ } else {
440
+ return value;
441
+ }
442
+ };
443
+ export default Control;
444
+ export { getTitle, makeString };
@@ -0,0 +1,43 @@
1
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
2
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
3
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
4
+ import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
5
+ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
6
+ import { getObjectExclude } from '../helper';
7
+ var EventHandler = /*#__PURE__*/_createClass(function EventHandler(props) {
8
+ var _this = this;
9
+ _classCallCheck(this, EventHandler);
10
+ _defineProperty(this, "toValue", function () {
11
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
12
+ if (event === null) {
13
+ return '';
14
+ } else {
15
+ return event.nativeEvent ? event.target.value : event;
16
+ }
17
+ });
18
+ _defineProperty(this, "onChange", function (event) {
19
+ _this.props.onChange(_this.toValue(event));
20
+ });
21
+ _defineProperty(this, "onBlur", function (event) {
22
+ _this.props.onBlur(_this.toValue(event), event);
23
+ });
24
+ _defineProperty(this, "onSearch", function (event) {
25
+ _this.props.onSearch(_this.toValue(event));
26
+ });
27
+ this.props = props;
28
+ });
29
+ var replaceEvent = function replaceEvent(props, handler) {
30
+ var events = ['onChange', 'onBlur', 'onSearch'];
31
+ var callback = _reduceInstanceProperty(events).call(events, function (result, event) {
32
+ if (props[event]) {
33
+ result[event] = handler[event];
34
+ }
35
+ return result;
36
+ }, {});
37
+ return _Object$assign({}, getObjectExclude(props, events), callback);
38
+ };
39
+ var eventWrapper = function eventWrapper(props) {
40
+ var handler = new EventHandler(props);
41
+ return replaceEvent(props, handler);
42
+ };
43
+ export default eventWrapper;
@@ -0,0 +1,52 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
4
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
5
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
9
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
10
+ import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
11
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
+ import React from 'react';
14
+ import { getObjectExclude } from '../helper';
15
+ var Enhance = function Enhance(Container, keys, Dialogs) {
16
+ var noContainer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
17
+ return /*#__PURE__*/function (_React$Component) {
18
+ _inherits(_class2, _React$Component);
19
+ var _super = _createSuper(_class2);
20
+ function _class2() {
21
+ var _context;
22
+ var _this;
23
+ _classCallCheck(this, _class2);
24
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25
+ args[_key] = arguments[_key];
26
+ }
27
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
28
+ _defineProperty(_assertThisInitialized(_this), "toDialogs", function () {
29
+ return _reduceInstanceProperty(keys).call(keys, function (result, key, index) {
30
+ var Dialog = Dialogs[index];
31
+ _this.props[key] && result.push( /*#__PURE__*/React.createElement(Dialog, {
32
+ key: key,
33
+ container: _assertThisInitialized(_this)
34
+ }));
35
+ return result;
36
+ }, []);
37
+ });
38
+ return _this;
39
+ }
40
+ _createClass(_class2, [{
41
+ key: "render",
42
+ value: function render() {
43
+ var props = getObjectExclude(this.props, keys);
44
+ return /*#__PURE__*/React.createElement("div", {
45
+ className: noContainer ? null : 'modal-container'
46
+ }, /*#__PURE__*/React.createElement(Container, props), this.toDialogs());
47
+ }
48
+ }]);
49
+ return _class2;
50
+ }(React.Component);
51
+ };
52
+ export default Enhance;
@@ -0,0 +1,131 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
3
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
4
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
5
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
6
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
7
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
8
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
9
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
10
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
11
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
12
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
13
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
14
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
15
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
16
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
17
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
19
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
20
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
21
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
+ import React from 'react';
23
+ import PropTypes from 'prop-types';
24
+ import Loading from '../Loading';
25
+ var STATUS = ['loadingWithInit',
26
+ // 显示加载画面,并自动触发onInit事件,默认值
27
+ 'loading',
28
+ // 显示加载画面
29
+ 'retry',
30
+ // 显示重试画面
31
+ 'retryForHome',
32
+ // 显示重试画面(触发onInit时,home参数为true)
33
+ 'page' // 显示正常的页面(表明页面状态已经初始化好)
34
+ ];
35
+
36
+ /**
37
+ * status: [可选], 当前状态。默认为loadingWithInit
38
+ * home: [可选],为true表明接受首页触发的事件。默认为false
39
+ * onInit: [可选],原型为func(home),home为true表明初始化是来源首页
40
+ * onRefreshForHome:[可选],检测到来至首页时会触发该事件,原型为func()
41
+ */
42
+ var Enhance = function Enhance(Component) {
43
+ var _class;
44
+ return _class = /*#__PURE__*/function (_React$Component) {
45
+ _inherits(_class, _React$Component);
46
+ var _super = _createSuper(_class);
47
+ function _class() {
48
+ var _context;
49
+ var _this;
50
+ _classCallCheck(this, _class);
51
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
52
+ args[_key] = arguments[_key];
53
+ }
54
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
55
+ _defineProperty(_assertThisInitialized(_this), "triggerEvent", function () {
56
+ if (!global.isServer) {
57
+ var _this$props = _this.props,
58
+ _this$props$status = _this$props.status,
59
+ status = _this$props$status === void 0 ? 'loadingWithInit' : _this$props$status,
60
+ home = _this$props.home,
61
+ onInit = _this$props.onInit,
62
+ onRefreshForHome = _this$props.onRefreshForHome;
63
+ if (!home) {
64
+ if (status === 'loadingWithInit') {
65
+ onInit && onInit(false);
66
+ }
67
+ } else {
68
+ var __home = global['__home'];
69
+ global['__home'] && (global['__home'] = false);
70
+ if (status === 'loadingWithInit') {
71
+ onInit && onInit(__home);
72
+ } else if (__home) {
73
+ if (status === 'page') {
74
+ onRefreshForHome && onRefreshForHome();
75
+ } else if (status !== 'loading') {
76
+ onInit && onInit(__home);
77
+ }
78
+ }
79
+ }
80
+ }
81
+ });
82
+ _defineProperty(_assertThisInitialized(_this), "onRetry", function () {
83
+ var _this$props2 = _this.props,
84
+ status = _this$props2.status,
85
+ onInit = _this$props2.onInit;
86
+ onInit && onInit(status === 'retryForHome');
87
+ });
88
+ _defineProperty(_assertThisInitialized(_this), "getPageProps", function () {
89
+ var props = _objectSpread({}, _this.props);
90
+ delete props.status;
91
+ delete props.home;
92
+ delete props.onInit;
93
+ delete props.onRefreshForHome;
94
+ return props;
95
+ });
96
+ return _this;
97
+ }
98
+ _createClass(_class, [{
99
+ key: "componentDidMount",
100
+ value: function componentDidMount() {
101
+ this.triggerEvent();
102
+ }
103
+ }, {
104
+ key: "componentDidUpdate",
105
+ value: function componentDidUpdate() {
106
+ this.triggerEvent();
107
+ }
108
+ }, {
109
+ key: "render",
110
+ value: function render() {
111
+ var status = this.props.status;
112
+ if (status !== 'page') {
113
+ var retry = status === 'retry' || status === 'retryForHome';
114
+ return /*#__PURE__*/React.createElement(Loading, {
115
+ retry: retry,
116
+ onRetry: this.onRetry
117
+ });
118
+ } else {
119
+ return /*#__PURE__*/React.createElement(Component, this.getPageProps());
120
+ }
121
+ }
122
+ }]);
123
+ return _class;
124
+ }(React.Component), _defineProperty(_class, "propTypes", {
125
+ status: PropTypes.oneOf(STATUS),
126
+ home: PropTypes.bool,
127
+ onInit: PropTypes.func,
128
+ onRefreshForHome: PropTypes.func
129
+ }), _class;
130
+ };
131
+ export default Enhance;