cloud-b2b 1.1.57 → 1.1.59

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 (308) hide show
  1. package/package.json +44 -22
  2. package/src/Area/Area.js +94 -0
  3. package/src/Card/Card.js +16 -0
  4. package/src/CodeInput/CodeInput.js +76 -0
  5. package/src/Control/Control.js +338 -0
  6. package/src/Control/event.js +45 -0
  7. package/src/Enhance/Dialogs.js +24 -0
  8. package/src/Enhance/Loading.js +83 -0
  9. package/{es → src}/Enhance/index.js +8 -6
  10. package/src/Header/Header.js +149 -0
  11. package/src/Header/Vertical.js +74 -0
  12. package/src/ImageView/ImageView.js +62 -0
  13. package/src/Indent/Indent.js +12 -0
  14. package/src/InpurCascader/InputCascader.js +83 -0
  15. package/src/InputEditor/InputEditor.js +93 -0
  16. package/src/InputSearch/InputSearch.js +186 -0
  17. package/src/InputSelect/InputSelect.js +103 -0
  18. package/src/InputTreeSelect/InputTreeSelect.js +87 -0
  19. package/src/InputWriting/InputWriting.js +65 -0
  20. package/src/Layout/Layout.js +121 -0
  21. package/src/LayoutLink/LayoutLink.js +59 -0
  22. package/src/Link/Link.js +57 -0
  23. package/src/Loading/Loading.js +15 -0
  24. package/src/Loading2/Loading2.js +15 -0
  25. package/src/ModalWithDrag/ModalWithDrag.js +17 -0
  26. package/{es → src}/ModalWithDrag/drag.js +128 -116
  27. package/src/NumberInput/NumberInput.js +137 -0
  28. package/src/Search/Search.js +368 -0
  29. package/src/Search2/Search.js +436 -0
  30. package/{lib/Search → src/Search2}/Search.less +65 -63
  31. package/{lib/Search → src/Search2}/package.json +6 -6
  32. package/src/Sidebar/Sidebar.js +111 -0
  33. package/src/Sidebar2/Sidebar.js +143 -0
  34. package/src/SuperForm/SuperForm.js +519 -0
  35. package/src/SuperForm2/SuperForm.js +588 -0
  36. package/src/SuperIcon/SuperIcon.js +14 -0
  37. package/src/SuperPagination/SuperPagination.js +65 -0
  38. package/src/SuperTab/SuperTab.js +84 -0
  39. package/src/SuperTab2/SuperTab2.js +94 -0
  40. package/src/SuperTable/DragSortRow.js +62 -0
  41. package/src/SuperTable/FilterDropDown.js +111 -0
  42. package/src/SuperTable/SuperTable.js +590 -0
  43. package/src/SuperTable/fixed.js +34 -0
  44. package/src/SuperTable2/SuperTable2.js +624 -0
  45. package/src/SuperTable2/SuperTableCell.js +175 -0
  46. package/src/SuperTable3/FilterDropDown.js +111 -0
  47. package/src/SuperTable3/SuperTable.js +498 -0
  48. package/src/SuperTable3/fixed.js +34 -0
  49. package/src/SuperToolbar/SuperToolbar.js +128 -0
  50. package/src/SuperUpload/SuperUpload.js +137 -0
  51. package/src/Title/Title.js +18 -0
  52. package/src/Viewer/ImageViews.js +220 -0
  53. package/src/Viewer/Viewer.js +97 -0
  54. package/src/WingBlank/WingBlank.js +14 -0
  55. package/src/helper.js +185 -0
  56. package/{es → src}/history.js +6 -6
  57. package/src/index.js +39 -0
  58. package/src/variables.js +5 -0
  59. package/test/index.html +10 -0
  60. package/test/test.js +16 -0
  61. package/test/test.less +12 -0
  62. package/test/webpack.config.js +71 -0
  63. package/tools/babel.config.js +14 -0
  64. package/tools/build.js +70 -0
  65. package/tools/publish.js +9 -0
  66. package/tools/util.js +53 -0
  67. package/es/Area/Area.js +0 -138
  68. package/es/Card/Card.js +0 -19
  69. package/es/CodeInput/CodeInput.js +0 -120
  70. package/es/Control/Control.js +0 -444
  71. package/es/Control/event.js +0 -43
  72. package/es/Enhance/Dialogs.js +0 -49
  73. package/es/Enhance/Loading.js +0 -128
  74. package/es/Header/Header.js +0 -159
  75. package/es/Header/Vertical.js +0 -103
  76. package/es/ImageView/ImageView.js +0 -97
  77. package/es/Indent/Indent.js +0 -19
  78. package/es/InpurCascader/InputCascader.js +0 -114
  79. package/es/InputEditor/InputEditor.js +0 -171
  80. package/es/InputSearch/InputSearch.js +0 -263
  81. package/es/InputSelect/InputSelect.js +0 -157
  82. package/es/InputTreeSelect/InputTreeSelect.js +0 -118
  83. package/es/InputWriting/InputWriting.js +0 -82
  84. package/es/Layout/Layout.js +0 -198
  85. package/es/LayoutLink/LayoutLink.js +0 -73
  86. package/es/Link/Link.js +0 -82
  87. package/es/Loading/Loading.js +0 -13
  88. package/es/Loading2/Loading2.js +0 -9
  89. package/es/ModalWithDrag/ModalWithDrag.js +0 -29
  90. package/es/NumberInput/NumberInput.js +0 -197
  91. package/es/Search/Search.js +0 -494
  92. package/es/Sidebar/Sidebar.js +0 -141
  93. package/es/Sidebar2/Sidebar.js +0 -162
  94. package/es/SuperForm/SuperForm.js +0 -593
  95. package/es/SuperForm2/SuperForm.js +0 -682
  96. package/es/SuperIcon/SuperIcon.js +0 -27
  97. package/es/SuperPagination/SuperPagination.js +0 -106
  98. package/es/SuperTab/SuperTab.js +0 -104
  99. package/es/SuperTab2/SuperTab2.js +0 -142
  100. package/es/SuperTable/DragSortRow.js +0 -94
  101. package/es/SuperTable/FilterDropDown.js +0 -161
  102. package/es/SuperTable/SuperTable.js +0 -805
  103. package/es/SuperTable/fixed.js +0 -34
  104. package/es/SuperTable2/SuperTable2.js +0 -923
  105. package/es/SuperTable2/SuperTableCell.js +0 -215
  106. package/es/SuperTable3/FilterDropDown.js +0 -161
  107. package/es/SuperTable3/SuperTable.js +0 -662
  108. package/es/SuperTable3/fixed.js +0 -34
  109. package/es/SuperToolbar/SuperToolbar.js +0 -192
  110. package/es/SuperUpload/SuperUpload.js +0 -356
  111. package/es/Title/Title.js +0 -33
  112. package/es/Viewer/ImageViews.js +0 -255
  113. package/es/Viewer/Viewer.js +0 -119
  114. package/es/WingBlank/WingBlank.js +0 -16
  115. package/es/helper.js +0 -241
  116. package/es/index.js +0 -37
  117. package/es/variables.js +0 -6
  118. package/lib/Area/Area.js +0 -146
  119. package/lib/Area/package.json +0 -6
  120. package/lib/Card/Card.js +0 -27
  121. package/lib/Card/package.json +0 -6
  122. package/lib/CodeInput/CodeInput.js +0 -128
  123. package/lib/CodeInput/package.json +0 -6
  124. package/lib/Control/Control.js +0 -450
  125. package/lib/Control/event.js +0 -51
  126. package/lib/Control/package.json +0 -6
  127. package/lib/Enhance/Dialogs.js +0 -57
  128. package/lib/Enhance/Loading.js +0 -135
  129. package/lib/Enhance/index.js +0 -25
  130. package/lib/Enhance/package.json +0 -6
  131. package/lib/Header/Header.js +0 -166
  132. package/lib/Header/Header.less +0 -95
  133. package/lib/Header/Vertical.js +0 -111
  134. package/lib/Header/Vertical.less +0 -60
  135. package/lib/Header/package.json +0 -6
  136. package/lib/ImageView/ImageView.js +0 -105
  137. package/lib/ImageView/ImageView.less +0 -14
  138. package/lib/ImageView/package.json +0 -6
  139. package/lib/Indent/Indent.js +0 -27
  140. package/lib/Indent/package.json +0 -6
  141. package/lib/InpurCascader/InputCascader.js +0 -121
  142. package/lib/InpurCascader/package.json +0 -6
  143. package/lib/InputEditor/InputEditor.js +0 -179
  144. package/lib/InputEditor/inputEditor.less +0 -8
  145. package/lib/InputEditor/package.json +0 -6
  146. package/lib/InputSearch/InputSearch.js +0 -271
  147. package/lib/InputSearch/package.json +0 -6
  148. package/lib/InputSelect/InputSelect.js +0 -165
  149. package/lib/InputSelect/package.json +0 -6
  150. package/lib/InputTreeSelect/InputTreeSelect.js +0 -125
  151. package/lib/InputTreeSelect/package.json +0 -6
  152. package/lib/InputWriting/InputWriting.js +0 -90
  153. package/lib/InputWriting/package.json +0 -6
  154. package/lib/Layout/Layout.js +0 -206
  155. package/lib/Layout/Layout.less +0 -28
  156. package/lib/Layout/package.json +0 -6
  157. package/lib/LayoutLink/LayoutLink.js +0 -85
  158. package/lib/LayoutLink/LayoutLink.less +0 -53
  159. package/lib/LayoutLink/package.json +0 -6
  160. package/lib/Link/Link.js +0 -90
  161. package/lib/Link/package.json +0 -6
  162. package/lib/Loading/Loading.js +0 -21
  163. package/lib/Loading/Loading.less +0 -13
  164. package/lib/Loading/package.json +0 -6
  165. package/lib/Loading2/Loading2.js +0 -17
  166. package/lib/Loading2/Loading2.less +0 -19
  167. package/lib/Loading2/package.json +0 -6
  168. package/lib/ModalWithDrag/ModalWithDrag.js +0 -37
  169. package/lib/ModalWithDrag/ModalWithDrag.less +0 -6
  170. package/lib/ModalWithDrag/drag.js +0 -124
  171. package/lib/ModalWithDrag/package.json +0 -6
  172. package/lib/NumberInput/NumberInput.js +0 -205
  173. package/lib/NumberInput/package.json +0 -6
  174. package/lib/Search/Search.js +0 -506
  175. package/lib/Sidebar/Sidebar.js +0 -149
  176. package/lib/Sidebar/Sidebar.less +0 -78
  177. package/lib/Sidebar/package.json +0 -6
  178. package/lib/Sidebar2/Sidebar.js +0 -170
  179. package/lib/Sidebar2/Sidebar.less +0 -153
  180. package/lib/Sidebar2/package.json +0 -6
  181. package/lib/SuperForm/SuperForm.js +0 -604
  182. package/lib/SuperForm/SuperForm.less +0 -52
  183. package/lib/SuperForm/package.json +0 -6
  184. package/lib/SuperForm2/SuperForm.js +0 -693
  185. package/lib/SuperForm2/SuperForm.less +0 -52
  186. package/lib/SuperForm2/package.json +0 -6
  187. package/lib/SuperIcon/SuperIcon.js +0 -35
  188. package/lib/SuperIcon/package.json +0 -6
  189. package/lib/SuperPagination/SuperPagination.js +0 -114
  190. package/lib/SuperPagination/package.json +0 -6
  191. package/lib/SuperTab/SuperTab.js +0 -112
  192. package/lib/SuperTab/SuperTab.less +0 -43
  193. package/lib/SuperTab/package.json +0 -6
  194. package/lib/SuperTab2/SuperTab2.js +0 -150
  195. package/lib/SuperTab2/SuperTab2.less +0 -18
  196. package/lib/SuperTab2/package.json +0 -6
  197. package/lib/SuperTable/DragSortRow.js +0 -102
  198. package/lib/SuperTable/DragSortRow.less +0 -17
  199. package/lib/SuperTable/FilterDropDown.js +0 -169
  200. package/lib/SuperTable/FilterDropDown.less +0 -30
  201. package/lib/SuperTable/SuperTable.js +0 -813
  202. package/lib/SuperTable/SuperTable.less +0 -132
  203. package/lib/SuperTable/fixed.js +0 -42
  204. package/lib/SuperTable/package.json +0 -6
  205. package/lib/SuperTable2/SuperTable2.js +0 -935
  206. package/lib/SuperTable2/SuperTable2.less +0 -118
  207. package/lib/SuperTable2/SuperTableCell.js +0 -220
  208. package/lib/SuperTable2/package.json +0 -6
  209. package/lib/SuperTable3/FilterDropDown.js +0 -169
  210. package/lib/SuperTable3/FilterDropDown.less +0 -29
  211. package/lib/SuperTable3/SuperTable.js +0 -670
  212. package/lib/SuperTable3/SuperTable.less +0 -99
  213. package/lib/SuperTable3/fixed.js +0 -42
  214. package/lib/SuperTable3/package.json +0 -6
  215. package/lib/SuperToolbar/SuperToolbar.js +0 -200
  216. package/lib/SuperToolbar/SuperToolbar.less +0 -17
  217. package/lib/SuperToolbar/package.json +0 -6
  218. package/lib/SuperUpload/SuperUpload.js +0 -367
  219. package/lib/SuperUpload/SuperUpload.less +0 -28
  220. package/lib/SuperUpload/package.json +0 -6
  221. package/lib/Title/Title.js +0 -41
  222. package/lib/Title/Title.less +0 -35
  223. package/lib/Title/package.json +0 -6
  224. package/lib/Viewer/ImageViews.js +0 -263
  225. package/lib/Viewer/Viewer.js +0 -127
  226. package/lib/Viewer/Viewer.less +0 -67
  227. package/lib/Viewer/imgView.less +0 -59
  228. package/lib/Viewer/package.json +0 -7
  229. package/lib/WingBlank/WingBlank.js +0 -24
  230. package/lib/WingBlank/WingBlank.less +0 -12
  231. package/lib/WingBlank/package.json +0 -6
  232. package/lib/adjust.less +0 -89
  233. package/lib/helper.js +0 -247
  234. package/lib/history.js +0 -12
  235. package/lib/index.js +0 -271
  236. package/lib/index.less +0 -31
  237. package/lib/style.less +0 -30
  238. package/lib/variables.js +0 -14
  239. package/lib/variables.less +0 -73
  240. /package/{es → src}/Area/package.json +0 -0
  241. /package/{es → src}/Card/package.json +0 -0
  242. /package/{es → src}/CodeInput/package.json +0 -0
  243. /package/{es → src}/Control/package.json +0 -0
  244. /package/{es → src}/Enhance/package.json +0 -0
  245. /package/{es → src}/Header/Header.less +0 -0
  246. /package/{es → src}/Header/Vertical.less +0 -0
  247. /package/{es → src}/Header/package.json +0 -0
  248. /package/{es → src}/ImageView/ImageView.less +0 -0
  249. /package/{es → src}/ImageView/package.json +0 -0
  250. /package/{es → src}/Indent/package.json +0 -0
  251. /package/{es → src}/InpurCascader/package.json +0 -0
  252. /package/{es → src}/InputEditor/inputEditor.less +0 -0
  253. /package/{es → src}/InputEditor/package.json +0 -0
  254. /package/{es → src}/InputSearch/package.json +0 -0
  255. /package/{es → src}/InputSelect/package.json +0 -0
  256. /package/{es → src}/InputTreeSelect/package.json +0 -0
  257. /package/{es → src}/InputWriting/package.json +0 -0
  258. /package/{es → src}/Layout/Layout.less +0 -0
  259. /package/{es → src}/Layout/package.json +0 -0
  260. /package/{es → src}/LayoutLink/LayoutLink.less +0 -0
  261. /package/{es → src}/LayoutLink/package.json +0 -0
  262. /package/{es → src}/Link/package.json +0 -0
  263. /package/{es → src}/Loading/Loading.less +0 -0
  264. /package/{es → src}/Loading/package.json +0 -0
  265. /package/{es → src}/Loading2/Loading2.less +0 -0
  266. /package/{es → src}/Loading2/package.json +0 -0
  267. /package/{es → src}/ModalWithDrag/ModalWithDrag.less +0 -0
  268. /package/{es → src}/ModalWithDrag/package.json +0 -0
  269. /package/{es → src}/NumberInput/package.json +0 -0
  270. /package/{es → src}/Search/Search.less +0 -0
  271. /package/{es → src}/Search/package.json +0 -0
  272. /package/{es → src}/Sidebar/Sidebar.less +0 -0
  273. /package/{es → src}/Sidebar/package.json +0 -0
  274. /package/{es → src}/Sidebar2/Sidebar.less +0 -0
  275. /package/{es → src}/Sidebar2/package.json +0 -0
  276. /package/{es → src}/SuperForm/SuperForm.less +0 -0
  277. /package/{es → src}/SuperForm/package.json +0 -0
  278. /package/{es → src}/SuperForm2/SuperForm.less +0 -0
  279. /package/{es → src}/SuperForm2/package.json +0 -0
  280. /package/{es → src}/SuperIcon/package.json +0 -0
  281. /package/{es → src}/SuperPagination/package.json +0 -0
  282. /package/{es → src}/SuperTab/SuperTab.less +0 -0
  283. /package/{es → src}/SuperTab/package.json +0 -0
  284. /package/{es → src}/SuperTab2/SuperTab2.less +0 -0
  285. /package/{es → src}/SuperTab2/package.json +0 -0
  286. /package/{es → src}/SuperTable/DragSortRow.less +0 -0
  287. /package/{es → src}/SuperTable/FilterDropDown.less +0 -0
  288. /package/{es → src}/SuperTable/SuperTable.less +0 -0
  289. /package/{es → src}/SuperTable/package.json +0 -0
  290. /package/{es → src}/SuperTable2/SuperTable2.less +0 -0
  291. /package/{es → src}/SuperTable2/package.json +0 -0
  292. /package/{es → src}/SuperTable3/FilterDropDown.less +0 -0
  293. /package/{es → src}/SuperTable3/SuperTable.less +0 -0
  294. /package/{es → src}/SuperTable3/package.json +0 -0
  295. /package/{es → src}/SuperToolbar/SuperToolbar.less +0 -0
  296. /package/{es → src}/SuperToolbar/package.json +0 -0
  297. /package/{es → src}/SuperUpload/SuperUpload.less +0 -0
  298. /package/{es → src}/SuperUpload/package.json +0 -0
  299. /package/{es → src}/Title/Title.less +0 -0
  300. /package/{es → src}/Title/package.json +0 -0
  301. /package/{es → src}/Viewer/Viewer.less +0 -0
  302. /package/{es → src}/Viewer/imgView.less +0 -0
  303. /package/{es → src}/Viewer/package.json +0 -0
  304. /package/{es → src}/WingBlank/WingBlank.less +0 -0
  305. /package/{es → src}/WingBlank/package.json +0 -0
  306. /package/{es → src}/adjust.less +0 -0
  307. /package/{es → src}/style.less +0 -0
  308. /package/{es → src}/variables.less +0 -0
@@ -1,255 +0,0 @@
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 _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
7
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
8
- import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
9
- import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
10
- import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
11
- import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
12
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
13
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
- import React from "react";
15
- import variables from '../variables';
16
- var addEvent = function addEvent(el, event, handler) {
17
- if (!el) return;
18
- if (el.attachEvent) {
19
- el.attachEvent('on' + event, handler);
20
- } else if (el.addEventListener) {
21
- el.addEventListener(event, handler, false);
22
- } else {
23
- el['on' + event] = handler;
24
- }
25
- };
26
- var removeEvent = function removeEvent(el, event, handler) {
27
- if (!el) return;
28
- if (el.detachEvent) {
29
- el.detachEvent('on' + event, handler);
30
- } else if (el.removeEventListener) {
31
- el.removeEventListener(event, handler, false);
32
- } else {
33
- el['on' + event] = null;
34
- }
35
- };
36
- var getCss = function getCss(o, key) {
37
- return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
38
- };
39
-
40
- // 获取元素旋转的角度
41
- var getRotateDeg = function getRotateDeg(target) {
42
- var rotateMatrix = getCss(target, 'transform');
43
- var _rotateMatrix$split$ = rotateMatrix.split('(')[1].split(')')[0].split(','),
44
- _rotateMatrix$split$2 = _slicedToArray(_rotateMatrix$split$, 2),
45
- a = _rotateMatrix$split$2[0],
46
- b = _rotateMatrix$split$2[1];
47
- return Math.round(Math.atan2(b, a) * (180 / Math.PI));
48
- };
49
- var ImageViews = /*#__PURE__*/function (_React$Component) {
50
- function ImageViews(props) {
51
- var _this;
52
- _classCallCheck(this, ImageViews);
53
- _this = _callSuper(this, ImageViews, [props]);
54
- _defineProperty(_this, "_onwheel", function (e) {
55
- var zoom = _this.state.zoom;
56
- /*事件兼容*/
57
- var event = e || window.event;
58
- var imageDOM = _this.imgRef;
59
- var delta;
60
- if (event.nativeEvent.wheelDelta) {
61
- delta = event.nativeEvent.wheelDelta / 1200;
62
- } else if (event.nativeEvent.deltaY) {
63
- delta = -event.nativeEvent.deltaY / 1200;
64
- }
65
- var zoomVal = zoom + delta;
66
- if (zoomVal >= 0.2) {
67
- imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
68
- } else {
69
- zoomVal = 0.2;
70
- imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
71
- }
72
- _this.setState({
73
- zoom: zoomVal
74
- });
75
- });
76
- _defineProperty(_this, "_onMouseDown", function (e) {
77
- /*事件兼容*/
78
- var event = e || window.event;
79
- var imageDOM = _this.imgRef;
80
- event.preventDefault(); //阻止浏览器的默认事件
81
-
82
- var startTouch = {};
83
- startTouch.initiated = true; //initiated为true表示开始滑动
84
- /*获取鼠标按下的地方距离元素左侧和上侧的距离*/
85
- startTouch.startX = event.nativeEvent.clientX - imageDOM.offsetLeft;
86
- startTouch.startY = event.nativeEvent.clientY - imageDOM.offsetTop;
87
- _this.setState({
88
- startTouch: startTouch
89
- });
90
- addEvent(document, 'mousemove', _this._onMouseMove);
91
- addEvent(document, 'mouseup', _this._onMouseUp);
92
- });
93
- _defineProperty(_this, "_onMouseMove", function (e) {
94
- var event = e || window.event;
95
- var imageDOM = _this.imgRef;
96
- var startTouch = _this.state.startTouch;
97
- if (!startTouch.initiated) return;
98
- //滑动距离
99
- var deltaX = event.clientX - startTouch.startX;
100
- var deltaY = event.clientY - startTouch.startY;
101
- imageDOM.style.left = "".concat(deltaX, "px");
102
- imageDOM.style.top = "".concat(deltaY, "px");
103
- });
104
- _defineProperty(_this, "_onMouseUp", function () {
105
- var startTouch = _this.state.startTouch;
106
- if (!startTouch.initiated) return;
107
- var endTouch = JSON.parse(_JSON$stringify(startTouch));
108
- endTouch.initiated = false;
109
- _this.setState({
110
- startTouch: startTouch
111
- });
112
- removeEvent(document, 'mousemove', _this._onMouseMove);
113
- removeEvent(document, 'mouseup', _this._onMouseDown);
114
- });
115
- _defineProperty(_this, "_onPlus", function (event) {
116
- var zoom = _this.state.zoom;
117
- var imageDOM = _this.imgRef;
118
- var zoomVal = zoom + 0.1;
119
- var originDeg = getRotateDeg(imageDOM);
120
- event.stopPropagation();
121
- if (zoomVal >= 0.2) {
122
- var _context;
123
- imageDOM.style.transform = _concatInstanceProperty(_context = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context, originDeg, "deg)");
124
- }
125
- _this.setState({
126
- zoom: zoomVal
127
- });
128
- });
129
- _defineProperty(_this, "_onMinus", function () {
130
- var _context2;
131
- var zoom = _this.state.zoom;
132
- var imageDOM = _this.imgRef;
133
- var zoomVal = zoom - 0.1;
134
- var originDeg = getRotateDeg(imageDOM);
135
- if (zoomVal < 0.2) {
136
- zoomVal = 0.2;
137
- }
138
- imageDOM.style.transform = _concatInstanceProperty(_context2 = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context2, originDeg, "deg)");
139
- _this.setState({
140
- zoom: zoomVal
141
- });
142
- });
143
- _defineProperty(_this, "_reload", function () {
144
- var imageDOM = _this.imgRef;
145
- imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
146
- imageDOM.style.left = "50%";
147
- imageDOM.style.top = "50%";
148
- _this.setState({
149
- zoom: 1
150
- });
151
- });
152
- _defineProperty(_this, "_arrowLeft", function () {
153
- var onLeft = _this.props.onLeft;
154
- onLeft && onLeft();
155
- var imageDOM = _this.imgRef;
156
- imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
157
- imageDOM.style.left = "50%";
158
- imageDOM.style.top = "50%";
159
- _this.setState({
160
- zoom: 1
161
- });
162
- });
163
- _defineProperty(_this, "_arrowRight", function () {
164
- var onRight = _this.props.onRight;
165
- onRight && onRight();
166
- var imageDOM = _this.imgRef;
167
- imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
168
- imageDOM.style.left = "50%";
169
- imageDOM.style.top = "50%";
170
- _this.setState({
171
- zoom: 1
172
- });
173
- });
174
- _defineProperty(_this, "rotate", function (isLeft) {
175
- return function () {
176
- var _context3;
177
- var imageDOM = _this.imgRef;
178
- var originDeg = getRotateDeg(imageDOM);
179
- var zoom = _this.state.zoom;
180
- var rotateDeg = isLeft ? originDeg - 90 : originDeg + 90;
181
- imageDOM.style.transform = _concatInstanceProperty(_context3 = "translate(-50%,-50%) rotate(".concat(rotateDeg, "deg) scale(")).call(_context3, zoom, ")");
182
- };
183
- });
184
- _this.state = {
185
- zoom: 1,
186
- startTouch: {}
187
- };
188
- return _this;
189
- }
190
- _inherits(ImageViews, _React$Component);
191
- return _createClass(ImageViews, [{
192
- key: "render",
193
- value: function render() {
194
- var _this2 = this;
195
- var image = this.props.image;
196
- return /*#__PURE__*/React.createElement("div", {
197
- className: variables('ImageViews')
198
- }, /*#__PURE__*/React.createElement("div", {
199
- role: "imgWrapper"
200
- }, /*#__PURE__*/React.createElement("img", {
201
- src: image.src,
202
- alt: image.alt,
203
- ref: function ref(imgRef) {
204
- _this2.imgRef = imgRef;
205
- },
206
- onWheel: this._onwheel //缩放事件
207
- ,
208
- onMouseDown: this._onMouseDown //拖拽事件
209
- })), /*#__PURE__*/React.createElement("div", {
210
- className: variables('ImageViews').footer
211
- }, /*#__PURE__*/React.createElement("div", {
212
- className: variables('ImageViews').toolBar
213
- }, /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", {
214
- title: "\u653E\u5927",
215
- onClick: this._onPlus,
216
- onDoubleClick: function onDoubleClick(event) {
217
- return event.preventDefault();
218
- }
219
- }, /*#__PURE__*/React.createElement(_Icon, {
220
- type: "plus"
221
- })), /*#__PURE__*/React.createElement("li", {
222
- title: "\u7F29\u5C0F",
223
- onClick: this._onMinus
224
- }, /*#__PURE__*/React.createElement(_Icon, {
225
- type: "minus"
226
- })), /*#__PURE__*/React.createElement("li", {
227
- title: "\u4E0A\u4E00\u5F20",
228
- onClick: this._arrowLeft
229
- }, /*#__PURE__*/React.createElement(_Icon, {
230
- type: "arrow-left"
231
- })), /*#__PURE__*/React.createElement("li", {
232
- title: "\u4E0B\u4E00\u5F20",
233
- onClick: this._arrowRight
234
- }, /*#__PURE__*/React.createElement(_Icon, {
235
- type: "arrow-right"
236
- })), /*#__PURE__*/React.createElement("li", {
237
- title: "\u5411\u5DE6\u65CB\u8F6C",
238
- onClick: this.rotate(true)
239
- }, /*#__PURE__*/React.createElement(_Icon, {
240
- type: "pld-rotateleft"
241
- })), /*#__PURE__*/React.createElement("li", {
242
- title: "\u5411\u53F3\u65CB\u8F6C",
243
- onClick: this.rotate(false)
244
- }, /*#__PURE__*/React.createElement(_Icon, {
245
- type: "pld-rotateright"
246
- })), /*#__PURE__*/React.createElement("li", {
247
- title: "\u590D\u539F",
248
- onClick: this._reload
249
- }, /*#__PURE__*/React.createElement(_Icon, {
250
- type: "delete"
251
- }))))));
252
- }
253
- }]);
254
- }(React.Component);
255
- export default ImageViews;
@@ -1,119 +0,0 @@
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 _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
7
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
8
- import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
9
- import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
10
- import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
11
- import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
12
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
13
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
- import React from 'react';
15
- import PropTypes from 'prop-types';
16
- import ImageViews from "./ImageViews";
17
- import variables from '../variables';
18
- var Viewers = /*#__PURE__*/function (_React$Component) {
19
- function Viewers(props) {
20
- var _this;
21
- _classCallCheck(this, Viewers);
22
- _this = _callSuper(this, Viewers, [props]);
23
- //修复Warning报错
24
- _defineProperty(_this, "componentWillUnmount", function () {
25
- _this.timeout = null;
26
- });
27
- _defineProperty(_this, "closeViewers", function () {
28
- var _this$props = _this.props,
29
- onCancel = _this$props.onCancel,
30
- onClose = _this$props.onClose;
31
- _this.containerRef.style['opacity'] = 0;
32
- _this.timeout = _setTimeout(function () {
33
- onCancel && onCancel(onClose);
34
- }, 1000);
35
- });
36
- _defineProperty(_this, "_onLeft", function () {
37
- var imageIndex = _this.state.imageIndex;
38
- var images = _this.props.images;
39
- var index = imageIndex - 1;
40
- if (index < 0) {
41
- index = images.length - 1;
42
- }
43
- _this.setState({
44
- imageIndex: index
45
- });
46
- });
47
- _defineProperty(_this, "_onRight", function () {
48
- var imageIndex = _this.state.imageIndex;
49
- var images = _this.props.images;
50
- var index = imageIndex + 1;
51
- if (index > images.length - 1) {
52
- index = 0;
53
- }
54
- _this.setState({
55
- imageIndex: index
56
- });
57
- });
58
- _defineProperty(_this, "_onSelect", function (index) {
59
- _this.setState({
60
- imageIndex: index
61
- });
62
- });
63
- _this.state = {
64
- imageIndex: props.imageIndex
65
- };
66
- return _this;
67
- }
68
- _inherits(Viewers, _React$Component);
69
- return _createClass(Viewers, [{
70
- key: "render",
71
- value: function render() {
72
- var _this2 = this;
73
- var _this$props2 = this.props,
74
- visible = _this$props2.visible,
75
- images = _this$props2.images,
76
- titles = _this$props2.titles;
77
- var imageIndex = this.state.imageIndex;
78
- return /*#__PURE__*/React.createElement("div", null, visible ? /*#__PURE__*/React.createElement("div", {
79
- className: variables('Viewers'),
80
- ref: function ref(container) {
81
- _this2.containerRef = container;
82
- }
83
- }, /*#__PURE__*/React.createElement("div", {
84
- className: variables('Viewers').mask
85
- }), /*#__PURE__*/React.createElement("div", {
86
- className: variables('Viewers').title
87
- }, _mapInstanceProperty(titles).call(titles, function (item, index) {
88
- var _context;
89
- return /*#__PURE__*/React.createElement("div", {
90
- key: index,
91
- onClick: _bindInstanceProperty(_context = _this2._onSelect).call(_context, _this2, index),
92
- className: index === imageIndex ? variables('Viewers').selectTitle : ''
93
- }, item);
94
- })), /*#__PURE__*/React.createElement(ImageViews, {
95
- image: images[imageIndex],
96
- onLeft: this._onLeft,
97
- onRight: this._onRight
98
- }), /*#__PURE__*/React.createElement("div", {
99
- className: variables('Viewers').close,
100
- onClick: function onClick() {
101
- return _this2.closeViewers();
102
- }
103
- }, /*#__PURE__*/React.createElement(_Icon, {
104
- type: "close"
105
- }))) : null);
106
- }
107
- }]);
108
- }(React.Component);
109
- _defineProperty(Viewers, "propTypes", {
110
- /** viewer是否可见 */
111
- visible: PropTypes.bool.isRequired,
112
- /** 点击关闭按钮的回调 */
113
- onCancel: PropTypes.func.isRequired,
114
- /** 需要进行浏览的图片地址集合 */
115
- images: PropTypes.array.isRequired,
116
- /** 需要进行浏览的图片名称集合 */
117
- titles: PropTypes.array.isRequired
118
- });
119
- export default Viewers;
@@ -1,16 +0,0 @@
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 DELETED
@@ -1,241 +0,0 @@
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
- _t;
149
- return _regeneratorRuntime.wrap(function (_context4) {
150
- while (1) switch (_context4.prev = _context4.next) {
151
- case 0:
152
- cookie = _args.length > 2 && _args[2] !== undefined ? _args[2] : true;
153
- jump = _args.length > 3 && _args[3] !== undefined ? _args[3] : true;
154
- if (cookie) {
155
- if (typeof option === 'undefined') {
156
- option = {
157
- credentials: 'include'
158
- };
159
- } else if (typeof option === 'string') {
160
- option = {
161
- method: option,
162
- credentials: 'include'
163
- };
164
- } else if (!option.credentials) {
165
- _Object$assign(option, {
166
- credentials: 'include'
167
- });
168
- }
169
- } else {
170
- if (typeof option === 'string') {
171
- option = {
172
- method: option
173
- };
174
- }
175
- }
176
- _context4.prev = 1;
177
- _context4.next = 2;
178
- return fetch(url, option);
179
- case 2:
180
- res = _context4.sent;
181
- if (res.ok) {
182
- _context4.next = 3;
183
- break;
184
- }
185
- return _context4.abrupt("return", {
186
- returnCode: res.status,
187
- returnMsg: _concatInstanceProperty(_context3 = "".concat(res.status, " - ")).call(_context3, res.statusText)
188
- });
189
- case 3:
190
- _context4.next = 4;
191
- return res.json();
192
- case 4:
193
- json = _context4.sent;
194
- if (json.returnCode !== 0 && json.errorCode) {
195
- json.returnCode = Number(json.errorCode) || 10001;
196
- }
197
- if (jump && json.returnCode === 9998) {
198
- json.returnMsg = '登录超时,请重新登录';
199
- window.localStorage.removeItem('login');
200
- roleKey = getRoleKey();
201
- if (roleKey) {
202
- window.location.href = "/portal/".concat(roleKey, "_login");
203
- } else {
204
- window.location.href = "/";
205
- }
206
- }
207
- return _context4.abrupt("return", json);
208
- case 5:
209
- _context4.next = 7;
210
- break;
211
- case 6:
212
- _context4.prev = 6;
213
- _t = _context4["catch"](1);
214
- return _context4.abrupt("return", {
215
- returnCode: 10000,
216
- returnMsg: '无法请求资源'
217
- });
218
- case 7:
219
- case "end":
220
- return _context4.stop();
221
- }
222
- }, _callee, null, [[1, 6]]);
223
- }));
224
- return function fetchJson(_x, _x2) {
225
- return _ref.apply(this, arguments);
226
- };
227
- }();
228
- var helper = {
229
- getObjectExclude: getObjectExclude,
230
- getUsername: getUsername,
231
- getPathValue: getPathValue,
232
- isEmpty: isEmpty,
233
- isEmpty2: isEmpty2,
234
- showError: showError,
235
- showSuccessMsg: showSuccessMsg,
236
- toThousands: toThousands,
237
- getObject: getObject,
238
- fetchJson: fetchJson
239
- };
240
- export { getObject, getObjectExclude, getUsername, getPathValue, isEmpty, isEmpty2, showError, showSuccessMsg, toThousands };
241
- export default helper;
package/es/index.js DELETED
@@ -1,37 +0,0 @@
1
- import { EnhanceLoading, EnhanceDialogs, EnhanceEditDialog } from './Enhance';
2
- export { EnhanceLoading, EnhanceDialogs, EnhanceEditDialog };
3
- export { default as Title } from './Title';
4
- export { default as Card } from './Card';
5
- export { default as Control } from './Control';
6
- export { default as Header } from './Header';
7
- export { default as ImageView } from './ImageView';
8
- export { default as InpurCascader } from './InpurCascader';
9
- export { default as InputSearch } from './InputSearch';
10
- export { default as InputSelect } from './InputSelect';
11
- export { default as InputEditor } from './InputEditor';
12
- export { default as InputWriting } from './InputWriting';
13
- export { default as Layout } from './Layout';
14
- export { default as LayoutLink } from './LayoutLink';
15
- export { default as Link } from './Link';
16
- export { default as Loading } from './Loading';
17
- export { default as Loading2 } from './Loading2';
18
- export { default as ModalWithDrag } from './ModalWithDrag';
19
- export { default as NumberInput } from './NumberInput';
20
- export { default as Search } from './Search';
21
- export { default as Sidebar } from './Sidebar';
22
- export { default as Sidebar2 } from './Sidebar2';
23
- export { default as SuperForm } from './SuperForm';
24
- export { default as SuperForm2 } from './SuperForm2';
25
- export { default as SuperIcon } from './SuperIcon';
26
- export { default as SuperToolbar } from './SuperToolbar';
27
- export { default as SuperUpload } from './SuperUpload';
28
- export { default as Viewer } from './Viewer';
29
- export { default as WingBlank } from './WingBlank';
30
- export { default as Area } from './Area';
31
- export { default as SuperTable3 } from './SuperTable3';
32
- export { default as SuperTable2 } from './SuperTable2';
33
- export { default as SuperTable } from './SuperTable';
34
- export { default as SuperPagination } from './SuperPagination';
35
- export { default as SuperTab } from './SuperTab';
36
- export { default as SuperTab2 } from './SuperTab2';
37
- export { default as Indent } from './Indent';
package/es/variables.js DELETED
@@ -1,6 +0,0 @@
1
- import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
2
- var PREFIX = 'cloudlink';
3
- export default (function (name) {
4
- var _context;
5
- return _concatInstanceProperty(_context = "".concat(PREFIX, "-")).call(_context, name);
6
- });