cloud-b2b 1.1.52 → 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,258 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Icon from "antd/es/icon";
3
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
4
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
5
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
6
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
7
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
8
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
9
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
11
+ import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
12
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
13
+ 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); }; }
14
+ 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; } }
15
+ import React from "react";
16
+ import variables from '../variables';
17
+ var addEvent = function addEvent(el, event, handler) {
18
+ if (!el) return;
19
+ if (el.attachEvent) {
20
+ el.attachEvent('on' + event, handler);
21
+ } else if (el.addEventListener) {
22
+ el.addEventListener(event, handler, false);
23
+ } else {
24
+ el['on' + event] = handler;
25
+ }
26
+ };
27
+ var removeEvent = function removeEvent(el, event, handler) {
28
+ if (!el) return;
29
+ if (el.detachEvent) {
30
+ el.detachEvent('on' + event, handler);
31
+ } else if (el.removeEventListener) {
32
+ el.removeEventListener(event, handler, false);
33
+ } else {
34
+ el['on' + event] = null;
35
+ }
36
+ };
37
+ var getCss = function getCss(o, key) {
38
+ return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
39
+ };
40
+
41
+ // 获取元素旋转的角度
42
+ var getRotateDeg = function getRotateDeg(target) {
43
+ var rotateMatrix = getCss(target, 'transform');
44
+ var _rotateMatrix$split$ = rotateMatrix.split('(')[1].split(')')[0].split(','),
45
+ _rotateMatrix$split$2 = _slicedToArray(_rotateMatrix$split$, 2),
46
+ a = _rotateMatrix$split$2[0],
47
+ b = _rotateMatrix$split$2[1];
48
+ return Math.round(Math.atan2(b, a) * (180 / Math.PI));
49
+ };
50
+ var ImageViews = /*#__PURE__*/function (_React$Component) {
51
+ _inherits(ImageViews, _React$Component);
52
+ var _super = _createSuper(ImageViews);
53
+ function ImageViews(props) {
54
+ var _this;
55
+ _classCallCheck(this, ImageViews);
56
+ _this = _super.call(this, props);
57
+ _defineProperty(_assertThisInitialized(_this), "_onwheel", function (e) {
58
+ var zoom = _this.state.zoom;
59
+ /*事件兼容*/
60
+ var event = e || window.event;
61
+ var imageDOM = _this.imgRef;
62
+ var delta;
63
+ if (event.nativeEvent.wheelDelta) {
64
+ delta = event.nativeEvent.wheelDelta / 1200;
65
+ } else if (event.nativeEvent.deltaY) {
66
+ delta = -event.nativeEvent.deltaY / 1200;
67
+ }
68
+ var zoomVal = zoom + delta;
69
+ if (zoomVal >= 0.2) {
70
+ imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
71
+ } else {
72
+ zoomVal = 0.2;
73
+ imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
74
+ }
75
+ _this.setState({
76
+ zoom: zoomVal
77
+ });
78
+ });
79
+ _defineProperty(_assertThisInitialized(_this), "_onMouseDown", function (e) {
80
+ /*事件兼容*/
81
+ var event = e || window.event;
82
+ var imageDOM = _this.imgRef;
83
+ event.preventDefault(); //阻止浏览器的默认事件
84
+
85
+ var startTouch = {};
86
+ startTouch.initiated = true; //initiated为true表示开始滑动
87
+ /*获取鼠标按下的地方距离元素左侧和上侧的距离*/
88
+ startTouch.startX = event.nativeEvent.clientX - imageDOM.offsetLeft;
89
+ startTouch.startY = event.nativeEvent.clientY - imageDOM.offsetTop;
90
+ _this.setState({
91
+ startTouch: startTouch
92
+ });
93
+ addEvent(document, 'mousemove', _this._onMouseMove);
94
+ addEvent(document, 'mouseup', _this._onMouseUp);
95
+ });
96
+ _defineProperty(_assertThisInitialized(_this), "_onMouseMove", function (e) {
97
+ var event = e || window.event;
98
+ var imageDOM = _this.imgRef;
99
+ var startTouch = _this.state.startTouch;
100
+ if (!startTouch.initiated) return;
101
+ //滑动距离
102
+ var deltaX = event.clientX - startTouch.startX;
103
+ var deltaY = event.clientY - startTouch.startY;
104
+ imageDOM.style.left = "".concat(deltaX, "px");
105
+ imageDOM.style.top = "".concat(deltaY, "px");
106
+ });
107
+ _defineProperty(_assertThisInitialized(_this), "_onMouseUp", function () {
108
+ var startTouch = _this.state.startTouch;
109
+ if (!startTouch.initiated) return;
110
+ var endTouch = JSON.parse(_JSON$stringify(startTouch));
111
+ endTouch.initiated = false;
112
+ _this.setState({
113
+ startTouch: startTouch
114
+ });
115
+ removeEvent(document, 'mousemove', _this._onMouseMove);
116
+ removeEvent(document, 'mouseup', _this._onMouseDown);
117
+ });
118
+ _defineProperty(_assertThisInitialized(_this), "_onPlus", function (event) {
119
+ var zoom = _this.state.zoom;
120
+ var imageDOM = _this.imgRef;
121
+ var zoomVal = zoom + 0.1;
122
+ var originDeg = getRotateDeg(imageDOM);
123
+ event.stopPropagation();
124
+ if (zoomVal >= 0.2) {
125
+ var _context;
126
+ imageDOM.style.transform = _concatInstanceProperty(_context = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context, originDeg, "deg)");
127
+ }
128
+ _this.setState({
129
+ zoom: zoomVal
130
+ });
131
+ });
132
+ _defineProperty(_assertThisInitialized(_this), "_onMinus", function () {
133
+ var _context2;
134
+ var zoom = _this.state.zoom;
135
+ var imageDOM = _this.imgRef;
136
+ var zoomVal = zoom - 0.1;
137
+ var originDeg = getRotateDeg(imageDOM);
138
+ if (zoomVal < 0.2) {
139
+ zoomVal = 0.2;
140
+ }
141
+ imageDOM.style.transform = _concatInstanceProperty(_context2 = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context2, originDeg, "deg)");
142
+ _this.setState({
143
+ zoom: zoomVal
144
+ });
145
+ });
146
+ _defineProperty(_assertThisInitialized(_this), "_reload", function () {
147
+ var imageDOM = _this.imgRef;
148
+ imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
149
+ imageDOM.style.left = "50%";
150
+ imageDOM.style.top = "50%";
151
+ _this.setState({
152
+ zoom: 1
153
+ });
154
+ });
155
+ _defineProperty(_assertThisInitialized(_this), "_arrowLeft", function () {
156
+ var onLeft = _this.props.onLeft;
157
+ onLeft && onLeft();
158
+ var imageDOM = _this.imgRef;
159
+ imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
160
+ imageDOM.style.left = "50%";
161
+ imageDOM.style.top = "50%";
162
+ _this.setState({
163
+ zoom: 1
164
+ });
165
+ });
166
+ _defineProperty(_assertThisInitialized(_this), "_arrowRight", function () {
167
+ var onRight = _this.props.onRight;
168
+ onRight && onRight();
169
+ var imageDOM = _this.imgRef;
170
+ imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
171
+ imageDOM.style.left = "50%";
172
+ imageDOM.style.top = "50%";
173
+ _this.setState({
174
+ zoom: 1
175
+ });
176
+ });
177
+ _defineProperty(_assertThisInitialized(_this), "rotate", function (isLeft) {
178
+ return function () {
179
+ var _context3;
180
+ var imageDOM = _this.imgRef;
181
+ var originDeg = getRotateDeg(imageDOM);
182
+ var zoom = _this.state.zoom;
183
+ var rotateDeg = isLeft ? originDeg - 90 : originDeg + 90;
184
+ imageDOM.style.transform = _concatInstanceProperty(_context3 = "translate(-50%,-50%) rotate(".concat(rotateDeg, "deg) scale(")).call(_context3, zoom, ")");
185
+ };
186
+ });
187
+ _this.state = {
188
+ zoom: 1,
189
+ startTouch: {}
190
+ };
191
+ return _this;
192
+ }
193
+ _createClass(ImageViews, [{
194
+ key: "render",
195
+ value: function render() {
196
+ var _this2 = this;
197
+ var image = this.props.image;
198
+ return /*#__PURE__*/React.createElement("div", {
199
+ className: variables('ImageViews')
200
+ }, /*#__PURE__*/React.createElement("div", {
201
+ role: "imgWrapper"
202
+ }, /*#__PURE__*/React.createElement("img", {
203
+ src: image.src,
204
+ alt: image.alt,
205
+ ref: function ref(imgRef) {
206
+ _this2.imgRef = imgRef;
207
+ },
208
+ onWheel: this._onwheel //缩放事件
209
+ ,
210
+ onMouseDown: this._onMouseDown //拖拽事件
211
+ })), /*#__PURE__*/React.createElement("div", {
212
+ className: variables('ImageViews').footer
213
+ }, /*#__PURE__*/React.createElement("div", {
214
+ className: variables('ImageViews').toolBar
215
+ }, /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", {
216
+ title: "\u653E\u5927",
217
+ onClick: this._onPlus,
218
+ onDoubleClick: function onDoubleClick(event) {
219
+ return event.preventDefault();
220
+ }
221
+ }, /*#__PURE__*/React.createElement(_Icon, {
222
+ type: "plus"
223
+ })), /*#__PURE__*/React.createElement("li", {
224
+ title: "\u7F29\u5C0F",
225
+ onClick: this._onMinus
226
+ }, /*#__PURE__*/React.createElement(_Icon, {
227
+ type: "minus"
228
+ })), /*#__PURE__*/React.createElement("li", {
229
+ title: "\u4E0A\u4E00\u5F20",
230
+ onClick: this._arrowLeft
231
+ }, /*#__PURE__*/React.createElement(_Icon, {
232
+ type: "arrow-left"
233
+ })), /*#__PURE__*/React.createElement("li", {
234
+ title: "\u4E0B\u4E00\u5F20",
235
+ onClick: this._arrowRight
236
+ }, /*#__PURE__*/React.createElement(_Icon, {
237
+ type: "arrow-right"
238
+ })), /*#__PURE__*/React.createElement("li", {
239
+ title: "\u5411\u5DE6\u65CB\u8F6C",
240
+ onClick: this.rotate(true)
241
+ }, /*#__PURE__*/React.createElement(_Icon, {
242
+ type: "pld-rotateleft"
243
+ })), /*#__PURE__*/React.createElement("li", {
244
+ title: "\u5411\u53F3\u65CB\u8F6C",
245
+ onClick: this.rotate(false)
246
+ }, /*#__PURE__*/React.createElement(_Icon, {
247
+ type: "pld-rotateright"
248
+ })), /*#__PURE__*/React.createElement("li", {
249
+ title: "\u590D\u539F",
250
+ onClick: this._reload
251
+ }, /*#__PURE__*/React.createElement(_Icon, {
252
+ type: "delete"
253
+ }))))));
254
+ }
255
+ }]);
256
+ return ImageViews;
257
+ }(React.Component);
258
+ export default ImageViews;
@@ -0,0 +1,122 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Icon from "antd/es/icon";
3
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
4
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
5
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
6
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
7
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
8
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
9
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
+ import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
11
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
12
+ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
13
+ 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); }; }
14
+ 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; } }
15
+ import React from 'react';
16
+ import PropTypes from 'prop-types';
17
+ import ImageViews from "./ImageViews";
18
+ import variables from '../variables';
19
+ var Viewers = /*#__PURE__*/function (_React$Component) {
20
+ _inherits(Viewers, _React$Component);
21
+ var _super = _createSuper(Viewers);
22
+ function Viewers(props) {
23
+ var _this;
24
+ _classCallCheck(this, Viewers);
25
+ _this = _super.call(this, props);
26
+ //修复Warning报错
27
+ _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
28
+ _this.timeout = null;
29
+ });
30
+ _defineProperty(_assertThisInitialized(_this), "closeViewers", function () {
31
+ var _this$props = _this.props,
32
+ onCancel = _this$props.onCancel,
33
+ onClose = _this$props.onClose;
34
+ _this.containerRef.style['opacity'] = 0;
35
+ _this.timeout = _setTimeout(function () {
36
+ onCancel && onCancel(onClose);
37
+ }, 1000);
38
+ });
39
+ _defineProperty(_assertThisInitialized(_this), "_onLeft", function () {
40
+ var imageIndex = _this.state.imageIndex;
41
+ var images = _this.props.images;
42
+ var index = imageIndex - 1;
43
+ if (index < 0) {
44
+ index = images.length - 1;
45
+ }
46
+ _this.setState({
47
+ imageIndex: index
48
+ });
49
+ });
50
+ _defineProperty(_assertThisInitialized(_this), "_onRight", function () {
51
+ var imageIndex = _this.state.imageIndex;
52
+ var images = _this.props.images;
53
+ var index = imageIndex + 1;
54
+ if (index > images.length - 1) {
55
+ index = 0;
56
+ }
57
+ _this.setState({
58
+ imageIndex: index
59
+ });
60
+ });
61
+ _defineProperty(_assertThisInitialized(_this), "_onSelect", function (index) {
62
+ _this.setState({
63
+ imageIndex: index
64
+ });
65
+ });
66
+ _this.state = {
67
+ imageIndex: props.imageIndex
68
+ };
69
+ return _this;
70
+ }
71
+ _createClass(Viewers, [{
72
+ key: "render",
73
+ value: function render() {
74
+ var _this2 = this;
75
+ var _this$props2 = this.props,
76
+ visible = _this$props2.visible,
77
+ images = _this$props2.images,
78
+ titles = _this$props2.titles;
79
+ var imageIndex = this.state.imageIndex;
80
+ return /*#__PURE__*/React.createElement("div", null, visible ? /*#__PURE__*/React.createElement("div", {
81
+ className: variables('Viewers'),
82
+ ref: function ref(container) {
83
+ _this2.containerRef = container;
84
+ }
85
+ }, /*#__PURE__*/React.createElement("div", {
86
+ className: variables('Viewers').mask
87
+ }), /*#__PURE__*/React.createElement("div", {
88
+ className: variables('Viewers').title
89
+ }, _mapInstanceProperty(titles).call(titles, function (item, index) {
90
+ var _context;
91
+ return /*#__PURE__*/React.createElement("div", {
92
+ key: index,
93
+ onClick: _bindInstanceProperty(_context = _this2._onSelect).call(_context, _this2, index),
94
+ className: index === imageIndex ? variables('Viewers').selectTitle : ''
95
+ }, item);
96
+ })), /*#__PURE__*/React.createElement(ImageViews, {
97
+ image: images[imageIndex],
98
+ onLeft: this._onLeft,
99
+ onRight: this._onRight
100
+ }), /*#__PURE__*/React.createElement("div", {
101
+ className: variables('Viewers').close,
102
+ onClick: function onClick() {
103
+ return _this2.closeViewers();
104
+ }
105
+ }, /*#__PURE__*/React.createElement(_Icon, {
106
+ type: "close"
107
+ }))) : null);
108
+ }
109
+ }]);
110
+ return Viewers;
111
+ }(React.Component);
112
+ _defineProperty(Viewers, "propTypes", {
113
+ /** viewer是否可见 */
114
+ visible: PropTypes.bool.isRequired,
115
+ /** 点击关闭按钮的回调 */
116
+ onCancel: PropTypes.func.isRequired,
117
+ /** 需要进行浏览的图片地址集合 */
118
+ images: PropTypes.array.isRequired,
119
+ /** 需要进行浏览的图片名称集合 */
120
+ titles: PropTypes.array.isRequired
121
+ });
122
+ export default Viewers;
@@ -0,0 +1,16 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
3
+ var _excluded = ["className", "children"];
4
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
5
+ import React from 'react';
6
+ import variables from '../variables';
7
+ function WingBlank(_ref) {
8
+ var _context;
9
+ var className = _ref.className,
10
+ children = _ref.children,
11
+ props = _objectWithoutProperties(_ref, _excluded);
12
+ return /*#__PURE__*/React.createElement("div", _extends({
13
+ className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('WingBlank'))
14
+ }, props), /*#__PURE__*/React.createElement("div", null, children));
15
+ }
16
+ export default WingBlank;
package/es/helper.js ADDED
@@ -0,0 +1,240 @@
1
+ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
2
+ import _typeof from "@babel/runtime-corejs3/helpers/typeof";
3
+ import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
4
+ import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
5
+ import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
6
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
7
+ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
8
+ import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
9
+ import _Number$isInteger from "@babel/runtime-corejs3/core-js-stable/number/is-integer";
10
+ import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
11
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
12
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
13
+ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
14
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
15
+ import message from 'antd/lib/message';
16
+
17
+ /**
18
+ * 功能:从obj中取出不包含keys指定的属性,并组成一个新的子对象
19
+ */
20
+ var getObjectExclude = function getObjectExclude(obj, keys) {
21
+ var _context;
22
+ var inKeys = function inKeys(key) {
23
+ return _someInstanceProperty(keys).call(keys, function (k) {
24
+ return k === key;
25
+ });
26
+ };
27
+ return _reduceInstanceProperty(_context = _Object$keys(obj)).call(_context, function (newObj, key) {
28
+ !inKeys(key) && (newObj[key] = obj[key]);
29
+ return newObj;
30
+ }, {});
31
+ };
32
+
33
+ // 获取当前登录的用户名
34
+ var getUsername = function getUsername() {
35
+ var username = 'username=';
36
+ var cookie = document.cookie;
37
+ var begin = _indexOfInstanceProperty(cookie).call(cookie, username) + username.length;
38
+ var end = _indexOfInstanceProperty(cookie).call(cookie, ';', begin);
39
+ return unescape(cookie.substring(begin, end < 0 ? cookie.length : end));
40
+ };
41
+
42
+ /**
43
+ * 确保path为数组
44
+ */
45
+ var makeArray = function makeArray(path) {
46
+ if (_Array$isArray(path)) {
47
+ return path;
48
+ } else if (!path) {
49
+ return [];
50
+ } else {
51
+ return [path];
52
+ }
53
+ };
54
+
55
+ /**
56
+ * 功能:获取对象关键路径的值,不存在则返回undefined
57
+ * obj:对象
58
+ * path:字符串或字符串数组,指定关键路径
59
+ */
60
+ var getPathValue = function getPathValue(obj, path) {
61
+ if (!path) {
62
+ return undefined;
63
+ } else {
64
+ var _context2;
65
+ return _reduceInstanceProperty(_context2 = makeArray(path)).call(_context2, function (value, key) {
66
+ return _typeof(value) !== 'object' ? undefined : value[key];
67
+ }, obj);
68
+ }
69
+ };
70
+
71
+ /**
72
+ * 功能:判断一个值是否为空(null,undefined和''属于空)
73
+ */
74
+ var isEmpty = function isEmpty(value) {
75
+ var type = _typeof(value);
76
+ if (type === 'number' || type === 'boolean') {
77
+ return false;
78
+ } else {
79
+ return !value;
80
+ }
81
+ };
82
+
83
+ /**
84
+ * 功能:判断一个值是否为空(null,undefined,''和[]属于空)
85
+ */
86
+ var isEmpty2 = function isEmpty2(value) {
87
+ var type = _typeof(value);
88
+ if (type === 'number' || type === 'boolean') {
89
+ return false;
90
+ } else if (_Array$isArray(value)) {
91
+ return !value.length;
92
+ } else {
93
+ return !value;
94
+ }
95
+ };
96
+ var toThousands = function toThousands(number) {
97
+ var fractionDigits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
98
+ var removeTrailingZeros = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
99
+ if (!isNaN(Number(number))) {
100
+ var formattedNumber;
101
+ if (!_Number$isInteger(_parseFloat(number))) {
102
+ formattedNumber = Number(number).toFixed(fractionDigits);
103
+ }
104
+ if (removeTrailingZeros) {
105
+ //去除整数和小数部分末尾的零
106
+ formattedNumber = formattedNumber.replace(/(\.\d*?[1-9])0*$/, '$1').replace(/\.0*$/, '');
107
+ } else {
108
+ formattedNumber = Number(number).toLocaleString(undefined, {
109
+ minimumFractionDigits: fractionDigits,
110
+ maximumFractionDigits: fractionDigits
111
+ });
112
+ }
113
+ return formattedNumber;
114
+ } else if (typeof number === 'string' && _includesInstanceProperty(number).call(number, '~')) {
115
+ var numberList = number.split('~');
116
+ var formattedArr = _mapInstanceProperty(numberList).call(numberList, function (num, index) {
117
+ if (index === numberList.length - 1) {
118
+ return _parseFloat(num).toFixed(fractionDigits);
119
+ } else {
120
+ return _parseFloat(num).toFixed(fractionDigits);
121
+ }
122
+ });
123
+ var result = formattedArr.join('~');
124
+ return result;
125
+ }
126
+ };
127
+ var showError = function showError(msg) {
128
+ message.error(msg);
129
+ };
130
+ var showSuccessMsg = function showSuccessMsg(msg) {
131
+ message.success(msg);
132
+ };
133
+ var getObject = function getObject(obj, keys) {
134
+ return _reduceInstanceProperty(keys).call(keys, function (newObj, key) {
135
+ newObj[key] = obj[key];
136
+ return newObj;
137
+ }, {});
138
+ };
139
+ export var fetchJson = /*#__PURE__*/function () {
140
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, option) {
141
+ var cookie,
142
+ jump,
143
+ res,
144
+ _context3,
145
+ json,
146
+ roleKey,
147
+ _args = arguments;
148
+ return _regeneratorRuntime.wrap(function _callee$(_context4) {
149
+ while (1) switch (_context4.prev = _context4.next) {
150
+ case 0:
151
+ cookie = _args.length > 2 && _args[2] !== undefined ? _args[2] : true;
152
+ jump = _args.length > 3 && _args[3] !== undefined ? _args[3] : true;
153
+ if (cookie) {
154
+ if (typeof option === 'undefined') {
155
+ option = {
156
+ credentials: 'include'
157
+ };
158
+ } else if (typeof option === 'string') {
159
+ option = {
160
+ method: option,
161
+ credentials: 'include'
162
+ };
163
+ } else if (!option.credentials) {
164
+ _Object$assign(option, {
165
+ credentials: 'include'
166
+ });
167
+ }
168
+ } else {
169
+ if (typeof option === 'string') {
170
+ option = {
171
+ method: option
172
+ };
173
+ }
174
+ }
175
+ _context4.prev = 3;
176
+ _context4.next = 6;
177
+ return fetch(url, option);
178
+ case 6:
179
+ res = _context4.sent;
180
+ if (res.ok) {
181
+ _context4.next = 11;
182
+ break;
183
+ }
184
+ return _context4.abrupt("return", {
185
+ returnCode: res.status,
186
+ returnMsg: _concatInstanceProperty(_context3 = "".concat(res.status, " - ")).call(_context3, res.statusText)
187
+ });
188
+ case 11:
189
+ _context4.next = 13;
190
+ return res.json();
191
+ case 13:
192
+ json = _context4.sent;
193
+ if (json.returnCode !== 0 && json.errorCode) {
194
+ json.returnCode = Number(json.errorCode) || 10001;
195
+ }
196
+ if (jump && json.returnCode === 9998) {
197
+ json.returnMsg = '登录超时,请重新登录';
198
+ window.localStorage.removeItem('login');
199
+ roleKey = getRoleKey();
200
+ if (roleKey) {
201
+ window.location.href = "/portal/".concat(roleKey, "_login");
202
+ } else {
203
+ window.location.href = "/";
204
+ }
205
+ }
206
+ return _context4.abrupt("return", json);
207
+ case 17:
208
+ _context4.next = 22;
209
+ break;
210
+ case 19:
211
+ _context4.prev = 19;
212
+ _context4.t0 = _context4["catch"](3);
213
+ return _context4.abrupt("return", {
214
+ returnCode: 10000,
215
+ returnMsg: '无法请求资源'
216
+ });
217
+ case 22:
218
+ case "end":
219
+ return _context4.stop();
220
+ }
221
+ }, _callee, null, [[3, 19]]);
222
+ }));
223
+ return function fetchJson(_x, _x2) {
224
+ return _ref.apply(this, arguments);
225
+ };
226
+ }();
227
+ var helper = {
228
+ getObjectExclude: getObjectExclude,
229
+ getUsername: getUsername,
230
+ getPathValue: getPathValue,
231
+ isEmpty: isEmpty,
232
+ isEmpty2: isEmpty2,
233
+ showError: showError,
234
+ showSuccessMsg: showSuccessMsg,
235
+ toThousands: toThousands,
236
+ getObject: getObject,
237
+ fetchJson: fetchJson
238
+ };
239
+ export { getObject, getObjectExclude, getUsername, getPathValue, isEmpty, isEmpty2, showError, showSuccessMsg, toThousands };
240
+ export default helper;
@@ -1,6 +1,6 @@
1
- // import createBrowserHistory from 'history/createBrowserHistory';
2
- import {createBrowserHistory} from 'history';
3
-
4
- // Navigation manager, e.g. history.push('/home')
5
- // https://github.com/mjackson/history
6
- export default process.env.BROWSER && createBrowserHistory();
1
+ // import createBrowserHistory from 'history/createBrowserHistory';
2
+ import { createBrowserHistory } from 'history';
3
+
4
+ // Navigation manager, e.g. history.push('/home')
5
+ // https://github.com/mjackson/history
6
+ export default process.env.BROWSER && createBrowserHistory();