cloud-b2b 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/es/Area/Area.js +166 -0
  2. package/es/Area/package.json +6 -0
  3. package/es/Card/Card.js +20 -0
  4. package/es/Card/package.json +6 -0
  5. package/es/Control/Control.js +428 -0
  6. package/es/Control/event.js +57 -0
  7. package/es/Control/package.json +6 -0
  8. package/es/Enhance/Dialogs.js +67 -0
  9. package/es/Enhance/Loading.js +151 -0
  10. package/es/Enhance/index.js +8 -0
  11. package/es/Enhance/package.json +6 -0
  12. package/es/Header/Header.js +194 -0
  13. package/es/Header/Header.less +95 -0
  14. package/es/Header/Vertical.js +129 -0
  15. package/es/Header/Vertical.less +60 -0
  16. package/es/Header/package.json +6 -0
  17. package/es/HomeHeader/Header.js +75 -0
  18. package/es/HomeHeader/Header.less +73 -0
  19. package/es/HomeHeader/package.json +6 -0
  20. package/es/ImageView/ImageView.js +117 -0
  21. package/es/ImageView/ImageView.less +14 -0
  22. package/es/ImageView/package.json +6 -0
  23. package/es/InpurCascader/InputCascader.js +135 -0
  24. package/es/InpurCascader/package.json +6 -0
  25. package/es/InputEditor/InputEditor.js +118 -0
  26. package/es/InputEditor/inputEditor.less +8 -0
  27. package/es/InputEditor/package.json +6 -0
  28. package/es/InputSearch/InputSearch.js +306 -0
  29. package/es/InputSearch/package.json +6 -0
  30. package/es/InputSelect/InputSelect.js +185 -0
  31. package/es/InputSelect/package.json +6 -0
  32. package/es/InputWriting/InputWriting.js +107 -0
  33. package/es/InputWriting/package.json +6 -0
  34. package/es/Layout/Layout.js +232 -0
  35. package/es/Layout/Layout.less +28 -0
  36. package/es/Layout/package.json +6 -0
  37. package/es/LayoutLink/LayoutLink.js +82 -0
  38. package/es/LayoutLink/LayoutLink.less +53 -0
  39. package/es/LayoutLink/package.json +6 -0
  40. package/es/Link/Link.js +108 -0
  41. package/es/Link/package.json +6 -0
  42. package/es/Loading/Loading.js +15 -0
  43. package/es/Loading/Loading.less +13 -0
  44. package/es/Loading/package.json +6 -0
  45. package/es/Loading2/Loading2.js +11 -0
  46. package/es/Loading2/Loading2.less +19 -0
  47. package/es/Loading2/package.json +6 -0
  48. package/es/ModalWithDrag/ModalWithDrag.js +34 -0
  49. package/es/ModalWithDrag/ModalWithDrag.less +6 -0
  50. package/es/ModalWithDrag/drag.js +133 -0
  51. package/es/ModalWithDrag/package.json +6 -0
  52. package/es/NumberInput/NumberInput.js +237 -0
  53. package/es/NumberInput/package.json +6 -0
  54. package/es/Search/Search.js +581 -0
  55. package/es/Search/Search.less +63 -0
  56. package/es/Search/package.json +6 -0
  57. package/es/Sidebar/Sidebar.js +165 -0
  58. package/es/Sidebar/Sidebar.less +78 -0
  59. package/es/Sidebar/package.json +6 -0
  60. package/es/Sidebar2/Sidebar.js +192 -0
  61. package/es/Sidebar2/Sidebar.less +153 -0
  62. package/es/Sidebar2/package.json +6 -0
  63. package/es/SuperForm/SuperForm.js +688 -0
  64. package/es/SuperForm/SuperForm.less +52 -0
  65. package/es/SuperForm/package.json +6 -0
  66. package/es/SuperIcon/SuperIcon.js +30 -0
  67. package/es/SuperIcon/package.json +6 -0
  68. package/es/SuperPagination/SuperPagination.js +126 -0
  69. package/es/SuperPagination/package.json +6 -0
  70. package/es/SuperTable/DragSortRow.js +125 -0
  71. package/es/SuperTable/DragSortRow.less +17 -0
  72. package/es/SuperTable/FilterDropDown.js +188 -0
  73. package/es/SuperTable/FilterDropDown.less +30 -0
  74. package/es/SuperTable/SuperTable.js +933 -0
  75. package/es/SuperTable/SuperTable.less +135 -0
  76. package/es/SuperTable/fixed.js +42 -0
  77. package/es/SuperTable/package.json +6 -0
  78. package/es/SuperTable2/SuperTable2.js +700 -0
  79. package/es/SuperTable2/SuperTable2.less +100 -0
  80. package/es/SuperTable2/SuperTableCell.js +215 -0
  81. package/es/SuperTable2/package.json +6 -0
  82. package/es/SuperToolbar/SuperToolbar.js +223 -0
  83. package/es/SuperToolbar/SuperToolbar.less +17 -0
  84. package/es/SuperToolbar/package.json +6 -0
  85. package/es/SuperUpload/SuperUpload.js +282 -0
  86. package/es/SuperUpload/SuperUpload.less +27 -0
  87. package/es/SuperUpload/package.json +6 -0
  88. package/es/Title/Title.less +35 -35
  89. package/es/Title/package.json +6 -6
  90. package/es/Viewer/ImageViews.js +311 -0
  91. package/es/Viewer/Viewer.js +149 -0
  92. package/es/Viewer/Viewer.less +67 -0
  93. package/es/Viewer/imgView.less +59 -0
  94. package/es/Viewer/package.json +7 -0
  95. package/es/WingBlank/WingBlank.js +20 -0
  96. package/es/WingBlank/WingBlank.less +12 -0
  97. package/es/WingBlank/package.json +6 -0
  98. package/es/adjust.less +89 -0
  99. package/es/helper.js +118 -0
  100. package/es/history.js +5 -0
  101. package/es/index.js +27 -1
  102. package/es/style.less +20 -1
  103. package/es/variables.less +73 -73
  104. package/lib/Area/Area.js +194 -0
  105. package/lib/Area/package.json +6 -0
  106. package/lib/Card/Card.js +38 -0
  107. package/lib/Card/package.json +6 -0
  108. package/lib/Control/Control.js +477 -0
  109. package/lib/Control/event.js +68 -0
  110. package/lib/Control/package.json +6 -0
  111. package/lib/Enhance/Dialogs.js +87 -0
  112. package/lib/Enhance/Loading.js +175 -0
  113. package/lib/Enhance/index.js +35 -0
  114. package/lib/Enhance/package.json +6 -0
  115. package/lib/Header/Header.js +215 -0
  116. package/lib/Header/Header.less +95 -0
  117. package/lib/Header/Vertical.js +150 -0
  118. package/lib/Header/Vertical.less +60 -0
  119. package/lib/Header/package.json +6 -0
  120. package/lib/HomeHeader/Header.js +95 -0
  121. package/lib/HomeHeader/Header.less +73 -0
  122. package/lib/HomeHeader/package.json +6 -0
  123. package/lib/ImageView/ImageView.js +134 -0
  124. package/lib/ImageView/ImageView.less +14 -0
  125. package/lib/ImageView/package.json +6 -0
  126. package/lib/InpurCascader/InputCascader.js +156 -0
  127. package/lib/InpurCascader/package.json +6 -0
  128. package/lib/InputEditor/InputEditor.js +136 -0
  129. package/lib/InputEditor/inputEditor.less +8 -0
  130. package/lib/InputEditor/package.json +6 -0
  131. package/lib/InputSearch/InputSearch.js +322 -0
  132. package/lib/InputSearch/package.json +6 -0
  133. package/lib/InputSelect/InputSelect.js +208 -0
  134. package/lib/InputSelect/package.json +6 -0
  135. package/lib/InputWriting/InputWriting.js +123 -0
  136. package/lib/InputWriting/package.json +6 -0
  137. package/lib/Layout/Layout.js +258 -0
  138. package/lib/Layout/Layout.less +28 -0
  139. package/lib/Layout/package.json +6 -0
  140. package/lib/LayoutLink/LayoutLink.js +114 -0
  141. package/lib/LayoutLink/LayoutLink.less +53 -0
  142. package/lib/LayoutLink/package.json +6 -0
  143. package/lib/Link/Link.js +130 -0
  144. package/lib/Link/package.json +6 -0
  145. package/lib/Loading/Loading.js +30 -0
  146. package/lib/Loading/Loading.less +13 -0
  147. package/lib/Loading/package.json +6 -0
  148. package/lib/Loading2/Loading2.js +26 -0
  149. package/lib/Loading2/Loading2.less +19 -0
  150. package/lib/Loading2/package.json +6 -0
  151. package/lib/ModalWithDrag/ModalWithDrag.js +53 -0
  152. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  153. package/lib/ModalWithDrag/drag.js +147 -0
  154. package/lib/ModalWithDrag/package.json +6 -0
  155. package/lib/NumberInput/NumberInput.js +259 -0
  156. package/lib/NumberInput/package.json +6 -0
  157. package/lib/Search/Search.js +603 -0
  158. package/lib/Search/Search.less +63 -0
  159. package/lib/Search/package.json +6 -0
  160. package/lib/Sidebar/Sidebar.js +186 -0
  161. package/lib/Sidebar/Sidebar.less +78 -0
  162. package/lib/Sidebar/package.json +6 -0
  163. package/lib/Sidebar2/Sidebar.js +213 -0
  164. package/lib/Sidebar2/Sidebar.less +153 -0
  165. package/lib/Sidebar2/package.json +6 -0
  166. package/lib/SuperForm/SuperForm.js +702 -0
  167. package/lib/SuperForm/SuperForm.less +52 -0
  168. package/lib/SuperForm/package.json +6 -0
  169. package/lib/SuperIcon/SuperIcon.js +47 -0
  170. package/lib/SuperIcon/package.json +6 -0
  171. package/lib/SuperPagination/SuperPagination.js +145 -0
  172. package/lib/SuperPagination/package.json +6 -0
  173. package/lib/SuperTable/DragSortRow.js +142 -0
  174. package/lib/SuperTable/DragSortRow.less +17 -0
  175. package/lib/SuperTable/FilterDropDown.js +205 -0
  176. package/lib/SuperTable/FilterDropDown.less +30 -0
  177. package/lib/SuperTable/SuperTable.js +937 -0
  178. package/lib/SuperTable/SuperTable.less +135 -0
  179. package/lib/SuperTable/fixed.js +55 -0
  180. package/lib/SuperTable/package.json +6 -0
  181. package/lib/SuperTable2/SuperTable2.js +725 -0
  182. package/lib/SuperTable2/SuperTable2.less +100 -0
  183. package/lib/SuperTable2/SuperTableCell.js +231 -0
  184. package/lib/SuperTable2/package.json +6 -0
  185. package/lib/SuperToolbar/SuperToolbar.js +248 -0
  186. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  187. package/lib/SuperToolbar/package.json +6 -0
  188. package/lib/SuperUpload/SuperUpload.js +324 -0
  189. package/lib/SuperUpload/SuperUpload.less +27 -0
  190. package/lib/SuperUpload/package.json +6 -0
  191. package/lib/Title/Title.less +35 -35
  192. package/lib/Title/package.json +6 -6
  193. package/lib/Viewer/ImageViews.js +323 -0
  194. package/lib/Viewer/Viewer.js +167 -0
  195. package/lib/Viewer/Viewer.less +67 -0
  196. package/lib/Viewer/imgView.less +59 -0
  197. package/lib/Viewer/package.json +7 -0
  198. package/lib/WingBlank/WingBlank.js +37 -0
  199. package/lib/WingBlank/WingBlank.less +12 -0
  200. package/lib/WingBlank/package.json +6 -0
  201. package/lib/adjust.less +89 -0
  202. package/lib/helper.js +147 -0
  203. package/lib/history.js +18 -0
  204. package/lib/index.js +235 -1
  205. package/lib/index.less +25 -1
  206. package/lib/style.less +20 -1
  207. package/lib/variables.less +73 -73
  208. package/package.json +3 -2
@@ -0,0 +1,311 @@
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
+
14
+ 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); }; }
15
+
16
+ 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; } }
17
+
18
+ import React from "react";
19
+ import variables from '../variables';
20
+
21
+ var addEvent = function addEvent(el, event, handler) {
22
+ if (!el) return;
23
+
24
+ if (el.attachEvent) {
25
+ el.attachEvent('on' + event, handler);
26
+ } else if (el.addEventListener) {
27
+ el.addEventListener(event, handler, false);
28
+ } else {
29
+ el['on' + event] = handler;
30
+ }
31
+ };
32
+
33
+ var removeEvent = function removeEvent(el, event, handler) {
34
+ if (!el) return;
35
+
36
+ if (el.detachEvent) {
37
+ el.detachEvent('on' + event, handler);
38
+ } else if (el.removeEventListener) {
39
+ el.removeEventListener(event, handler, false);
40
+ } else {
41
+ el['on' + event] = null;
42
+ }
43
+ };
44
+
45
+ var getCss = function getCss(o, key) {
46
+ return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
47
+ }; // 获取元素旋转的角度
48
+
49
+
50
+ var getRotateDeg = function getRotateDeg(target) {
51
+ var rotateMatrix = getCss(target, 'transform');
52
+
53
+ var _rotateMatrix$split$ = rotateMatrix.split('(')[1].split(')')[0].split(','),
54
+ _rotateMatrix$split$2 = _slicedToArray(_rotateMatrix$split$, 2),
55
+ a = _rotateMatrix$split$2[0],
56
+ b = _rotateMatrix$split$2[1];
57
+
58
+ return Math.round(Math.atan2(b, a) * (180 / Math.PI));
59
+ };
60
+
61
+ var ImageViews = /*#__PURE__*/function (_React$Component) {
62
+ _inherits(ImageViews, _React$Component);
63
+
64
+ var _super = _createSuper(ImageViews);
65
+
66
+ function ImageViews(props) {
67
+ var _this;
68
+
69
+ _classCallCheck(this, ImageViews);
70
+
71
+ _this = _super.call(this, props);
72
+
73
+ _defineProperty(_assertThisInitialized(_this), "_onwheel", function (e) {
74
+ var zoom = _this.state.zoom;
75
+ /*事件兼容*/
76
+
77
+ var event = e || window.event;
78
+ var imageDOM = _this.imgRef;
79
+ var delta;
80
+
81
+ if (event.nativeEvent.wheelDelta) {
82
+ delta = event.nativeEvent.wheelDelta / 1200;
83
+ } else if (event.nativeEvent.deltaY) {
84
+ delta = -event.nativeEvent.deltaY / 1200;
85
+ }
86
+
87
+ var zoomVal = zoom + delta;
88
+
89
+ if (zoomVal >= 0.2) {
90
+ imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
91
+ } else {
92
+ zoomVal = 0.2;
93
+ imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
94
+ }
95
+
96
+ _this.setState({
97
+ zoom: zoomVal
98
+ });
99
+ });
100
+
101
+ _defineProperty(_assertThisInitialized(_this), "_onMouseDown", function (e) {
102
+ /*事件兼容*/
103
+ var event = e || window.event;
104
+ var imageDOM = _this.imgRef;
105
+ event.preventDefault(); //阻止浏览器的默认事件
106
+
107
+ var startTouch = {};
108
+ startTouch.initiated = true; //initiated为true表示开始滑动
109
+
110
+ /*获取鼠标按下的地方距离元素左侧和上侧的距离*/
111
+
112
+ startTouch.startX = event.nativeEvent.clientX - imageDOM.offsetLeft;
113
+ startTouch.startY = event.nativeEvent.clientY - imageDOM.offsetTop;
114
+
115
+ _this.setState({
116
+ startTouch: startTouch
117
+ });
118
+
119
+ addEvent(document, 'mousemove', _this._onMouseMove);
120
+ addEvent(document, 'mouseup', _this._onMouseUp);
121
+ });
122
+
123
+ _defineProperty(_assertThisInitialized(_this), "_onMouseMove", function (e) {
124
+ var event = e || window.event;
125
+ var imageDOM = _this.imgRef;
126
+ var startTouch = _this.state.startTouch;
127
+ if (!startTouch.initiated) return; //滑动距离
128
+
129
+ var deltaX = event.clientX - startTouch.startX;
130
+ var deltaY = event.clientY - startTouch.startY;
131
+ imageDOM.style.left = "".concat(deltaX, "px");
132
+ imageDOM.style.top = "".concat(deltaY, "px");
133
+ });
134
+
135
+ _defineProperty(_assertThisInitialized(_this), "_onMouseUp", function () {
136
+ var startTouch = _this.state.startTouch;
137
+ if (!startTouch.initiated) return;
138
+ var endTouch = JSON.parse(_JSON$stringify(startTouch));
139
+ endTouch.initiated = false;
140
+
141
+ _this.setState({
142
+ startTouch: startTouch
143
+ });
144
+
145
+ removeEvent(document, 'mousemove', _this._onMouseMove);
146
+ removeEvent(document, 'mouseup', _this._onMouseDown);
147
+ });
148
+
149
+ _defineProperty(_assertThisInitialized(_this), "_onPlus", function (event) {
150
+ var zoom = _this.state.zoom;
151
+ var imageDOM = _this.imgRef;
152
+ var zoomVal = zoom + 0.1;
153
+ var originDeg = getRotateDeg(imageDOM);
154
+ event.stopPropagation();
155
+
156
+ if (zoomVal >= 0.2) {
157
+ var _context;
158
+
159
+ imageDOM.style.transform = _concatInstanceProperty(_context = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context, originDeg, "deg)");
160
+ }
161
+
162
+ _this.setState({
163
+ zoom: zoomVal
164
+ });
165
+ });
166
+
167
+ _defineProperty(_assertThisInitialized(_this), "_onMinus", function () {
168
+ var _context2;
169
+
170
+ var zoom = _this.state.zoom;
171
+ var imageDOM = _this.imgRef;
172
+ var zoomVal = zoom - 0.1;
173
+ var originDeg = getRotateDeg(imageDOM);
174
+
175
+ if (zoomVal < 0.2) {
176
+ zoomVal = 0.2;
177
+ }
178
+
179
+ imageDOM.style.transform = _concatInstanceProperty(_context2 = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context2, originDeg, "deg)");
180
+
181
+ _this.setState({
182
+ zoom: zoomVal
183
+ });
184
+ });
185
+
186
+ _defineProperty(_assertThisInitialized(_this), "_reload", function () {
187
+ var imageDOM = _this.imgRef;
188
+ imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
189
+ imageDOM.style.left = "50%";
190
+ imageDOM.style.top = "50%";
191
+
192
+ _this.setState({
193
+ zoom: 1
194
+ });
195
+ });
196
+
197
+ _defineProperty(_assertThisInitialized(_this), "_arrowLeft", function () {
198
+ var onLeft = _this.props.onLeft;
199
+ onLeft && onLeft();
200
+ var imageDOM = _this.imgRef;
201
+ imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
202
+ imageDOM.style.left = "50%";
203
+ imageDOM.style.top = "50%";
204
+
205
+ _this.setState({
206
+ zoom: 1
207
+ });
208
+ });
209
+
210
+ _defineProperty(_assertThisInitialized(_this), "_arrowRight", function () {
211
+ var onRight = _this.props.onRight;
212
+ onRight && onRight();
213
+ var imageDOM = _this.imgRef;
214
+ imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
215
+ imageDOM.style.left = "50%";
216
+ imageDOM.style.top = "50%";
217
+
218
+ _this.setState({
219
+ zoom: 1
220
+ });
221
+ });
222
+
223
+ _defineProperty(_assertThisInitialized(_this), "rotate", function (isLeft) {
224
+ return function () {
225
+ var _context3;
226
+
227
+ var imageDOM = _this.imgRef;
228
+ var originDeg = getRotateDeg(imageDOM);
229
+ var zoom = _this.state.zoom;
230
+ var rotateDeg = isLeft ? originDeg - 90 : originDeg + 90;
231
+ imageDOM.style.transform = _concatInstanceProperty(_context3 = "translate(-50%,-50%) rotate(".concat(rotateDeg, "deg) scale(")).call(_context3, zoom, ")");
232
+ };
233
+ });
234
+
235
+ _this.state = {
236
+ zoom: 1,
237
+ startTouch: {}
238
+ };
239
+ return _this;
240
+ }
241
+
242
+ _createClass(ImageViews, [{
243
+ key: "render",
244
+ value: function render() {
245
+ var _this2 = this;
246
+
247
+ var image = this.props.image;
248
+ return /*#__PURE__*/React.createElement("div", {
249
+ className: variables('ImageViews')
250
+ }, /*#__PURE__*/React.createElement("div", {
251
+ role: "imgWrapper"
252
+ }, /*#__PURE__*/React.createElement("img", {
253
+ src: image.src,
254
+ alt: image.alt,
255
+ ref: function ref(imgRef) {
256
+ _this2.imgRef = imgRef;
257
+ },
258
+ onWheel: this._onwheel //缩放事件
259
+ ,
260
+ onMouseDown: this._onMouseDown //拖拽事件
261
+
262
+ })), /*#__PURE__*/React.createElement("div", {
263
+ className: variables('ImageViews').footer
264
+ }, /*#__PURE__*/React.createElement("div", {
265
+ className: variables('ImageViews').toolBar
266
+ }, /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", {
267
+ title: "\u653E\u5927",
268
+ onClick: this._onPlus,
269
+ onDoubleClick: function onDoubleClick(event) {
270
+ return event.preventDefault();
271
+ }
272
+ }, /*#__PURE__*/React.createElement(_Icon, {
273
+ type: "plus"
274
+ })), /*#__PURE__*/React.createElement("li", {
275
+ title: "\u7F29\u5C0F",
276
+ onClick: this._onMinus
277
+ }, /*#__PURE__*/React.createElement(_Icon, {
278
+ type: "minus"
279
+ })), /*#__PURE__*/React.createElement("li", {
280
+ title: "\u4E0A\u4E00\u5F20",
281
+ onClick: this._arrowLeft
282
+ }, /*#__PURE__*/React.createElement(_Icon, {
283
+ type: "arrow-left"
284
+ })), /*#__PURE__*/React.createElement("li", {
285
+ title: "\u4E0B\u4E00\u5F20",
286
+ onClick: this._arrowRight
287
+ }, /*#__PURE__*/React.createElement(_Icon, {
288
+ type: "arrow-right"
289
+ })), /*#__PURE__*/React.createElement("li", {
290
+ title: "\u5411\u5DE6\u65CB\u8F6C",
291
+ onClick: this.rotate(true)
292
+ }, /*#__PURE__*/React.createElement(_Icon, {
293
+ type: "pld-rotateleft"
294
+ })), /*#__PURE__*/React.createElement("li", {
295
+ title: "\u5411\u53F3\u65CB\u8F6C",
296
+ onClick: this.rotate(false)
297
+ }, /*#__PURE__*/React.createElement(_Icon, {
298
+ type: "pld-rotateright"
299
+ })), /*#__PURE__*/React.createElement("li", {
300
+ title: "\u590D\u539F",
301
+ onClick: this._reload
302
+ }, /*#__PURE__*/React.createElement(_Icon, {
303
+ type: "delete"
304
+ }))))));
305
+ }
306
+ }]);
307
+
308
+ return ImageViews;
309
+ }(React.Component);
310
+
311
+ export default ImageViews;
@@ -0,0 +1,149 @@
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
+
14
+ 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); }; }
15
+
16
+ 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; } }
17
+
18
+ import React from 'react';
19
+ import PropTypes from 'prop-types';
20
+ import ImageViews from "./ImageViews";
21
+ import variables from '../variables';
22
+
23
+ var Viewers = /*#__PURE__*/function (_React$Component) {
24
+ _inherits(Viewers, _React$Component);
25
+
26
+ var _super = _createSuper(Viewers);
27
+
28
+ function Viewers(props) {
29
+ var _this;
30
+
31
+ _classCallCheck(this, Viewers);
32
+
33
+ _this = _super.call(this, props);
34
+
35
+ _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
36
+ _this.timeout = null;
37
+ });
38
+
39
+ _defineProperty(_assertThisInitialized(_this), "closeViewers", function () {
40
+ var _this$props = _this.props,
41
+ onCancel = _this$props.onCancel,
42
+ onClose = _this$props.onClose;
43
+ _this.containerRef.style['opacity'] = 0;
44
+ _this.timeout = _setTimeout(function () {
45
+ onCancel && onCancel(onClose);
46
+ }, 1000);
47
+ });
48
+
49
+ _defineProperty(_assertThisInitialized(_this), "_onLeft", function () {
50
+ var imageIndex = _this.state.imageIndex;
51
+ var images = _this.props.images;
52
+ var index = imageIndex - 1;
53
+
54
+ if (index < 0) {
55
+ index = images.length - 1;
56
+ }
57
+
58
+ _this.setState({
59
+ imageIndex: index
60
+ });
61
+ });
62
+
63
+ _defineProperty(_assertThisInitialized(_this), "_onRight", function () {
64
+ var imageIndex = _this.state.imageIndex;
65
+ var images = _this.props.images;
66
+ var index = imageIndex + 1;
67
+
68
+ if (index > images.length - 1) {
69
+ index = 0;
70
+ }
71
+
72
+ _this.setState({
73
+ imageIndex: index
74
+ });
75
+ });
76
+
77
+ _defineProperty(_assertThisInitialized(_this), "_onSelect", function (index) {
78
+ _this.setState({
79
+ imageIndex: index
80
+ });
81
+ });
82
+
83
+ _this.state = {
84
+ imageIndex: props.imageIndex
85
+ };
86
+ return _this;
87
+ } //修复Warning报错
88
+
89
+
90
+ _createClass(Viewers, [{
91
+ key: "render",
92
+ value: function render() {
93
+ var _this2 = this;
94
+
95
+ var _this$props2 = this.props,
96
+ visible = _this$props2.visible,
97
+ images = _this$props2.images,
98
+ titles = _this$props2.titles;
99
+ var imageIndex = this.state.imageIndex;
100
+ return /*#__PURE__*/React.createElement("div", null, visible ? /*#__PURE__*/React.createElement("div", {
101
+ className: variables('Viewers'),
102
+ ref: function ref(container) {
103
+ _this2.containerRef = container;
104
+ }
105
+ }, /*#__PURE__*/React.createElement("div", {
106
+ className: variables('Viewers').mask
107
+ }), /*#__PURE__*/React.createElement("div", {
108
+ className: variables('Viewers').title
109
+ }, _mapInstanceProperty(titles).call(titles, function (item, index) {
110
+ var _context;
111
+
112
+ return /*#__PURE__*/React.createElement("div", {
113
+ key: index,
114
+ onClick: _bindInstanceProperty(_context = _this2._onSelect).call(_context, _this2, index),
115
+ className: index === imageIndex ? s.selectTitle : ''
116
+ }, item);
117
+ })), /*#__PURE__*/React.createElement(ImageViews, {
118
+ image: images[imageIndex],
119
+ onLeft: this._onLeft,
120
+ onRight: this._onRight
121
+ }), /*#__PURE__*/React.createElement("div", {
122
+ className: variables('Viewers').close,
123
+ onClick: function onClick() {
124
+ return _this2.closeViewers();
125
+ }
126
+ }, /*#__PURE__*/React.createElement(_Icon, {
127
+ type: "close"
128
+ }))) : null);
129
+ }
130
+ }]);
131
+
132
+ return Viewers;
133
+ }(React.Component);
134
+
135
+ _defineProperty(Viewers, "propTypes", {
136
+ /** viewer是否可见 */
137
+ visible: PropTypes.bool.isRequired,
138
+
139
+ /** 点击关闭按钮的回调 */
140
+ onCancel: PropTypes.func.isRequired,
141
+
142
+ /** 需要进行浏览的图片地址集合 */
143
+ images: PropTypes.array.isRequired,
144
+
145
+ /** 需要进行浏览的图片名称集合 */
146
+ titles: PropTypes.array.isRequired
147
+ });
148
+
149
+ export default Viewers;
@@ -0,0 +1,67 @@
1
+ @import '../variables.less';
2
+
3
+ html, body {
4
+ width: 100vw;
5
+ overflow: hidden;
6
+ }
7
+
8
+ .@{cloudlink-prefix}-Viewers {
9
+ font-size: 13px;
10
+ opacity: 1;
11
+ transition: opacity 1s;
12
+ position: fixed;
13
+ left: 0;
14
+ right: 0;
15
+ bottom: 0;
16
+ top: 0;
17
+ height: 100%;
18
+ width: 100%;
19
+ overflow: hidden;
20
+ z-index: 1001;
21
+ .mask {
22
+ position: absolute;
23
+ left: 0;
24
+ right: 0;
25
+ bottom: 0;
26
+ top: 0;
27
+ height: 100%;
28
+ width: 100%;
29
+ background: rgba(55, 55, 55, 0.9);
30
+ overflow: hidden;
31
+ }
32
+ .close{
33
+ position: fixed;
34
+ right: 0;
35
+ top: 0;
36
+ height: 60px;
37
+ width: 60px;
38
+ border-radius: 0 0 0 60px;
39
+ background: rgba(0,0,0,0.6);
40
+ z-index: 1050;
41
+ i{
42
+ position: absolute;
43
+ left: 30px;
44
+ top: 15px;
45
+ color: white;
46
+ font-size: 16px;
47
+ }
48
+ }
49
+ .title{
50
+ position: absolute;
51
+ top: 15px;
52
+ left: 15px;
53
+ z-index: 2000;
54
+
55
+ > div {
56
+ color: white;
57
+ font-weight: bold;
58
+ font-size: 24px;
59
+ cursor: pointer;
60
+ }
61
+
62
+ .selectTitle {
63
+ color: #4db5ff;
64
+ }
65
+ }
66
+ }
67
+
@@ -0,0 +1,59 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-ImageViews {
4
+ position: absolute;
5
+ left: 0;
6
+ right: 0;
7
+ bottom: 0;
8
+ top: 0;
9
+ overflow: hidden;
10
+ z-index: 1050;
11
+ img{
12
+ position: absolute;
13
+ left: 50%;
14
+ top: 50%;
15
+ transform: translate(-50%,-50%);
16
+ transform-origin: center center;
17
+ cursor: pointer;
18
+ }
19
+ .footer{
20
+ position: fixed;
21
+ left: 0;
22
+ right: 0;
23
+ bottom: 50px;
24
+ height: 52px;
25
+ z-index: 1100;
26
+ .toolBar{
27
+ display: flex;
28
+ height: 58px;
29
+ flex-direction: column;
30
+ align-items: center;
31
+ justify-content: space-around;
32
+ >span{
33
+ font-size: 18px;
34
+ opacity:0.8;
35
+ line-height: 15px;
36
+ color: #ccc;
37
+ }
38
+ >ul{
39
+ overflow: hidden;
40
+ display: flex;
41
+ flex-direction: row;
42
+ >li{
43
+ height: 36px;
44
+ width: 36px;
45
+ border-radius: 50%;
46
+ background: rgba(0, 0, 0, 1);
47
+ margin-left: 5px;
48
+ text-align: center;
49
+ line-height: 36px;
50
+ cursor: pointer;
51
+ i{
52
+ color: white;
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
59
+
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "Viewer",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Viewer"
6
+ }
7
+
@@ -0,0 +1,20 @@
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
+
8
+ function WingBlank(_ref) {
9
+ var _context;
10
+
11
+ var className = _ref.className,
12
+ children = _ref.children,
13
+ props = _objectWithoutProperties(_ref, _excluded);
14
+
15
+ return /*#__PURE__*/React.createElement("div", _extends({
16
+ className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('DragTable'))
17
+ }, props), /*#__PURE__*/React.createElement("div", null, children));
18
+ }
19
+
20
+ export default WingBlank;
@@ -0,0 +1,12 @@
1
+ @import '../variables';
2
+
3
+ .@{cloudlink-prefix}-WingBlank {
4
+ padding-left: @padding;
5
+ padding-right: @padding;
6
+
7
+ > * {
8
+ max-width: @max-width;
9
+ margin-left: auto;
10
+ margin-right: auto;
11
+ }
12
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "WingBlank",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./WingBlank.js"
6
+ }