cloud-b2b 1.0.0 → 1.0.1

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 (172) hide show
  1. package/es/Card/Card.js +20 -0
  2. package/es/Card/package.json +6 -0
  3. package/es/Control/Control.js +402 -0
  4. package/es/Control/event.js +57 -0
  5. package/es/Control/package.json +6 -0
  6. package/es/Enhance/Dialogs.js +67 -0
  7. package/es/Enhance/Loading.js +151 -0
  8. package/es/Enhance/index.js +8 -0
  9. package/es/Enhance/package.json +6 -0
  10. package/es/Header/Header.js +194 -0
  11. package/es/Header/Header.less +94 -0
  12. package/es/Header/Vertical.js +129 -0
  13. package/es/Header/Vertical.less +60 -0
  14. package/es/Header/package.json +6 -0
  15. package/es/HomeHeader/Header.js +75 -0
  16. package/es/HomeHeader/Header.less +73 -0
  17. package/es/HomeHeader/package.json +6 -0
  18. package/es/ImageView/ImageView.js +117 -0
  19. package/es/ImageView/ImageView.less +14 -0
  20. package/es/ImageView/package.json +6 -0
  21. package/es/InpurCascader/InputCascader.js +135 -0
  22. package/es/InpurCascader/package.json +6 -0
  23. package/es/InputEditor/InputEditor.js +118 -0
  24. package/es/InputEditor/inputEditor.less +8 -0
  25. package/es/InputEditor/package.json +6 -0
  26. package/es/InputSearch/InputSearch.js +306 -0
  27. package/es/InputSearch/package.json +6 -0
  28. package/es/InputSelect/InputSelect.js +185 -0
  29. package/es/InputSelect/package.json +6 -0
  30. package/es/InputWriting/InputWriting.js +107 -0
  31. package/es/InputWriting/package.json +6 -0
  32. package/es/Layout/Layout.js +232 -0
  33. package/es/Layout/Layout.less +28 -0
  34. package/es/Layout/package.json +6 -0
  35. package/es/LayoutLink/LayoutLink.js +82 -0
  36. package/es/LayoutLink/LayoutLink.less +53 -0
  37. package/es/LayoutLink/package.json +6 -0
  38. package/es/Link/Link.js +108 -0
  39. package/es/Link/package.json +6 -0
  40. package/es/Loading/Loading.js +15 -0
  41. package/es/Loading/Loading.less +13 -0
  42. package/es/Loading/package.json +6 -0
  43. package/es/Loading2/Loading2.js +11 -0
  44. package/es/Loading2/Loading2.less +19 -0
  45. package/es/Loading2/package.json +6 -0
  46. package/es/ModalWithDrag/ModalWithDrag.js +34 -0
  47. package/es/ModalWithDrag/ModalWithDrag.less +6 -0
  48. package/es/ModalWithDrag/drag.js +133 -0
  49. package/es/ModalWithDrag/package.json +6 -0
  50. package/es/NumberInput/NumberInput.js +237 -0
  51. package/es/NumberInput/package.json +6 -0
  52. package/es/Search/Search.js +581 -0
  53. package/es/Search/Search.less +63 -0
  54. package/es/Search/package.json +6 -0
  55. package/es/Sidebar/Sidebar.js +165 -0
  56. package/es/Sidebar/Sidebar.less +77 -0
  57. package/es/Sidebar/package.json +6 -0
  58. package/es/Sidebar2/Sidebar.js +192 -0
  59. package/es/Sidebar2/Sidebar.less +153 -0
  60. package/es/Sidebar2/package.json +6 -0
  61. package/es/SuperForm/SuperForm.js +641 -0
  62. package/es/SuperForm/SuperForm.less +52 -0
  63. package/es/SuperForm/package.json +6 -0
  64. package/es/SuperIcon/SuperIcon.js +30 -0
  65. package/es/SuperIcon/package.json +6 -0
  66. package/es/SuperPagination/SuperPagination.js +126 -0
  67. package/es/SuperPagination/package.json +6 -0
  68. package/es/SuperToolbar/SuperToolbar.js +223 -0
  69. package/es/SuperToolbar/SuperToolbar.less +17 -0
  70. package/es/SuperToolbar/package.json +6 -0
  71. package/es/SuperUpload/SuperUpload.js +282 -0
  72. package/es/SuperUpload/SuperUpload.less +27 -0
  73. package/es/SuperUpload/package.json +6 -0
  74. package/es/Viewer/ImageViews.js +311 -0
  75. package/es/Viewer/Viewer.js +149 -0
  76. package/es/Viewer/Viewer.less +67 -0
  77. package/es/Viewer/imgView.less +59 -0
  78. package/es/Viewer/package.json +7 -0
  79. package/es/WingBlank/WingBlank.js +20 -0
  80. package/es/WingBlank/WingBlank.less +12 -0
  81. package/es/WingBlank/package.json +6 -0
  82. package/es/helper.js +118 -0
  83. package/es/history.js +5 -0
  84. package/es/index.js +24 -1
  85. package/es/variables.less +73 -73
  86. package/lib/Card/Card.js +38 -0
  87. package/lib/Card/package.json +6 -0
  88. package/lib/Control/Control.js +449 -0
  89. package/lib/Control/event.js +68 -0
  90. package/lib/Control/package.json +6 -0
  91. package/lib/Enhance/Dialogs.js +87 -0
  92. package/lib/Enhance/Loading.js +175 -0
  93. package/lib/Enhance/index.js +35 -0
  94. package/lib/Enhance/package.json +6 -0
  95. package/lib/Header/Header.js +215 -0
  96. package/lib/Header/Header.less +94 -0
  97. package/lib/Header/Vertical.js +150 -0
  98. package/lib/Header/Vertical.less +60 -0
  99. package/lib/Header/package.json +6 -0
  100. package/lib/HomeHeader/Header.js +95 -0
  101. package/lib/HomeHeader/Header.less +73 -0
  102. package/lib/HomeHeader/package.json +6 -0
  103. package/lib/ImageView/ImageView.js +134 -0
  104. package/lib/ImageView/ImageView.less +14 -0
  105. package/lib/ImageView/package.json +6 -0
  106. package/lib/InpurCascader/InputCascader.js +156 -0
  107. package/lib/InpurCascader/package.json +6 -0
  108. package/lib/InputEditor/InputEditor.js +136 -0
  109. package/lib/InputEditor/inputEditor.less +8 -0
  110. package/lib/InputEditor/package.json +6 -0
  111. package/lib/InputSearch/InputSearch.js +322 -0
  112. package/lib/InputSearch/package.json +6 -0
  113. package/lib/InputSelect/InputSelect.js +208 -0
  114. package/lib/InputSelect/package.json +6 -0
  115. package/lib/InputWriting/InputWriting.js +123 -0
  116. package/lib/InputWriting/package.json +6 -0
  117. package/lib/Layout/Layout.js +258 -0
  118. package/lib/Layout/Layout.less +28 -0
  119. package/lib/Layout/package.json +6 -0
  120. package/lib/LayoutLink/LayoutLink.js +114 -0
  121. package/lib/LayoutLink/LayoutLink.less +53 -0
  122. package/lib/LayoutLink/package.json +6 -0
  123. package/lib/Link/Link.js +130 -0
  124. package/lib/Link/package.json +6 -0
  125. package/lib/Loading/Loading.js +30 -0
  126. package/lib/Loading/Loading.less +13 -0
  127. package/lib/Loading/package.json +6 -0
  128. package/lib/Loading2/Loading2.js +26 -0
  129. package/lib/Loading2/Loading2.less +19 -0
  130. package/lib/Loading2/package.json +6 -0
  131. package/lib/ModalWithDrag/ModalWithDrag.js +53 -0
  132. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  133. package/lib/ModalWithDrag/drag.js +147 -0
  134. package/lib/ModalWithDrag/package.json +6 -0
  135. package/lib/NumberInput/NumberInput.js +259 -0
  136. package/lib/NumberInput/package.json +6 -0
  137. package/lib/Search/Search.js +603 -0
  138. package/lib/Search/Search.less +63 -0
  139. package/lib/Search/package.json +6 -0
  140. package/lib/Sidebar/Sidebar.js +186 -0
  141. package/lib/Sidebar/Sidebar.less +77 -0
  142. package/lib/Sidebar/package.json +6 -0
  143. package/lib/Sidebar2/Sidebar.js +213 -0
  144. package/lib/Sidebar2/Sidebar.less +153 -0
  145. package/lib/Sidebar2/package.json +6 -0
  146. package/lib/SuperForm/SuperForm.js +657 -0
  147. package/lib/SuperForm/SuperForm.less +52 -0
  148. package/lib/SuperForm/package.json +6 -0
  149. package/lib/SuperIcon/SuperIcon.js +47 -0
  150. package/lib/SuperIcon/package.json +6 -0
  151. package/lib/SuperPagination/SuperPagination.js +145 -0
  152. package/lib/SuperPagination/package.json +6 -0
  153. package/lib/SuperToolbar/SuperToolbar.js +248 -0
  154. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  155. package/lib/SuperToolbar/package.json +6 -0
  156. package/lib/SuperUpload/SuperUpload.js +324 -0
  157. package/lib/SuperUpload/SuperUpload.less +27 -0
  158. package/lib/SuperUpload/package.json +6 -0
  159. package/lib/Viewer/ImageViews.js +323 -0
  160. package/lib/Viewer/Viewer.js +167 -0
  161. package/lib/Viewer/Viewer.less +67 -0
  162. package/lib/Viewer/imgView.less +59 -0
  163. package/lib/Viewer/package.json +7 -0
  164. package/lib/WingBlank/WingBlank.js +37 -0
  165. package/lib/WingBlank/WingBlank.less +12 -0
  166. package/lib/WingBlank/package.json +6 -0
  167. package/lib/helper.js +147 -0
  168. package/lib/history.js +18 -0
  169. package/lib/index.js +208 -1
  170. package/lib/index.less +20 -1
  171. package/lib/variables.less +73 -73
  172. package/package.json +3 -2
@@ -0,0 +1,232 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Button from "antd/es/button";
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
+
11
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
+
13
+ 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; } }
14
+
15
+ import _Object$keys2 from "@babel/runtime-corejs3/core-js-stable/object/keys";
16
+ import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
17
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
18
+ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
19
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
20
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
21
+ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
22
+ import React from 'react';
23
+ import PropTypes from 'prop-types';
24
+ import Header from '../Header';
25
+ import Sidebar from '../Sidebar2';
26
+ import Loading from '../Loading';
27
+ import { jump } from '../Link';
28
+ import variables from '../variables';
29
+ var HeaderV = Header.Vertical;
30
+
31
+ var getCurrentSideKey = function getCurrentSideKey() {
32
+ var sidebars = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33
+ var href = arguments.length > 1 ? arguments[1] : undefined;
34
+ if (!href) return '';
35
+
36
+ for (var _i = 0, _Object$keys = _Object$keys2(sidebars); _i < _Object$keys.length; _i++) {
37
+ var _context;
38
+
39
+ var key = _Object$keys[_i];
40
+
41
+ if (_someInstanceProperty(_context = sidebars[key]).call(_context, function (item) {
42
+ var _context2;
43
+
44
+ return item.href === href || item.children && _someInstanceProperty(_context2 = item.children).call(_context2, function (o) {
45
+ return o.href === href;
46
+ });
47
+ })) {
48
+ return key;
49
+ }
50
+ }
51
+ };
52
+
53
+ var Layout = /*#__PURE__*/function (_React$Component) {
54
+ _inherits(Layout, _React$Component);
55
+
56
+ var _super = _createSuper(Layout);
57
+
58
+ function Layout(props) {
59
+ var _this;
60
+
61
+ _classCallCheck(this, Layout);
62
+
63
+ _this = _super.call(this, props);
64
+
65
+ _defineProperty(_assertThisInitialized(_this), "onOpenChange", function (sideKey, openKeys) {
66
+ var onOpenChange = _this.props.onOpenChange;
67
+
68
+ if (onOpenChange) {
69
+ onOpenChange(sideKey, openKeys);
70
+ }
71
+ });
72
+
73
+ _defineProperty(_assertThisInitialized(_this), "getSidebarProps", function (sideKey) {
74
+ var _context3;
75
+
76
+ var _this$props = _this.props,
77
+ sidebars = _this$props.sidebars,
78
+ nav2 = _this$props.nav2,
79
+ _this$props$openKeys = _this$props.openKeys,
80
+ openKeys = _this$props$openKeys === void 0 ? {} : _this$props$openKeys,
81
+ navigation = _this$props.navigation;
82
+ var sides = sidebars[sideKey] || [];
83
+ return {
84
+ mode: _this.state.mode,
85
+ title: _filterInstanceProperty(navigation).call(navigation, function (o) {
86
+ return o.key === sideKey;
87
+ })[0].title,
88
+ activeKey: nav2,
89
+ items: sides,
90
+ openKeys: openKeys[sideKey] || [],
91
+ onOpenChange: _bindInstanceProperty(_context3 = _this.onOpenChange).call(_context3, _assertThisInitialized(_this), sideKey),
92
+ onModeChange: function onModeChange(mode) {
93
+ return _this.setState({
94
+ mode: mode
95
+ });
96
+ }
97
+ };
98
+ });
99
+
100
+ _defineProperty(_assertThisInitialized(_this), "toSidebar", function (sideKey) {
101
+ var hasHeaderV = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
102
+
103
+ if (!sideKey) {
104
+ return null;
105
+ } else {
106
+ return /*#__PURE__*/React.createElement("aside", {
107
+ style: {
108
+ marginLeft: hasHeaderV ? 40 : 0
109
+ }
110
+ }, /*#__PURE__*/React.createElement(Sidebar, _this.getSidebarProps(sideKey)));
111
+ }
112
+ });
113
+
114
+ _defineProperty(_assertThisInitialized(_this), "toHeader", function () {
115
+ var _context4, _context5;
116
+
117
+ var _this$props2 = _this.props,
118
+ loading = _this$props2.loading,
119
+ sidebars = _this$props2.sidebars,
120
+ nav1 = _this$props2.nav1,
121
+ nav2 = _this$props2.nav2,
122
+ homeUrl = _this$props2.homeUrl,
123
+ settingUrl = _this$props2.settingUrl,
124
+ messageUrl = _this$props2.messageUrl,
125
+ messageCount = _this$props2.messageCount,
126
+ userName = _this$props2.userName,
127
+ userIcon = _this$props2.userIcon,
128
+ loginUrl = _this$props2.loginUrl,
129
+ onMenuClick = _this$props2.onMenuClick,
130
+ onLogout = _this$props2.onLogout;
131
+ var selectKey = loading ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(_context4 = "/".concat(nav1, "/")).call(_context4, nav2));
132
+ var selectUrl = loading ? '' : _concatInstanceProperty(_context5 = "/".concat(nav1, "/")).call(_context5, nav2);
133
+ return /*#__PURE__*/React.createElement(Header, {
134
+ homeUrl: homeUrl,
135
+ settingUrl: settingUrl,
136
+ messageUrl: messageUrl,
137
+ loginUrl: loginUrl,
138
+ userName: userName,
139
+ userIcon: userIcon,
140
+ messageCount: messageCount,
141
+ selectKey: selectKey,
142
+ selectUrl: selectUrl,
143
+ onMenuClick: onMenuClick,
144
+ onLogout: onLogout
145
+ });
146
+ });
147
+
148
+ _defineProperty(_assertThisInitialized(_this), "headerVProps", function (selectKey) {
149
+ var _context6;
150
+
151
+ var keys = ['setting', 'message'];
152
+ return {
153
+ selectKey: selectKey,
154
+ url: _this.state.url,
155
+ items: _filterInstanceProperty(_context6 = _this.props.navigation).call(_context6, function (item) {
156
+ return !_includesInstanceProperty(keys).call(keys, item.key);
157
+ })
158
+ };
159
+ });
160
+
161
+ _this.state = {
162
+ mode: 'expand',
163
+ url: {}
164
+ };
165
+ return _this;
166
+ }
167
+
168
+ _createClass(Layout, [{
169
+ key: "componentWillReceiveProps",
170
+ value: function componentWillReceiveProps(props) {
171
+ if (!props.loading) {
172
+ var _context7, _context8;
173
+
174
+ this.setState({
175
+ url: _Object$assign({}, this.state.url, _defineProperty({}, getCurrentSideKey(props.sidebars, _concatInstanceProperty(_context7 = "/".concat(props.nav1, "/")).call(_context7, props.nav2)), _concatInstanceProperty(_context8 = "/".concat(props.nav1, "/")).call(_context8, props.nav2)))
176
+ });
177
+ }
178
+ }
179
+ }, {
180
+ key: "render",
181
+ value: function render() {
182
+ var _context10;
183
+
184
+ var _this$props3 = this.props,
185
+ loading = _this$props3.loading,
186
+ sidebars = _this$props3.sidebars,
187
+ _this$props3$nav = _this$props3.nav1,
188
+ nav1 = _this$props3$nav === void 0 ? '' : _this$props3$nav,
189
+ _this$props3$nav2 = _this$props3.nav2,
190
+ nav2 = _this$props3$nav2 === void 0 ? '' : _this$props3$nav2,
191
+ children = _this$props3.children,
192
+ _this$props3$noPrivil = _this$props3.noPrivilege,
193
+ noPrivilege = _this$props3$noPrivil === void 0 ? false : _this$props3$noPrivil,
194
+ navigation = _this$props3.navigation;
195
+ var hasV = _filterInstanceProperty(navigation).call(navigation, function (item) {
196
+ var _context9;
197
+
198
+ return !_includesInstanceProperty(_context9 = ['setting', 'message']).call(_context9, item.key);
199
+ }).length > 1;
200
+ var sideKey = loading || !nav2 ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(_context10 = "/".concat(nav1, "/")).call(_context10, nav2));
201
+ return noPrivilege ? /*#__PURE__*/React.createElement("div", {
202
+ style: {
203
+ textAlign: 'center'
204
+ }
205
+ }, /*#__PURE__*/React.createElement("div", {
206
+ style: {
207
+ lineHeight: '100px'
208
+ }
209
+ }, "\u60A8\u6682\u65E0\u6743\u9650\uFF0C\u8BF7\u786E\u8BA4\u60A8\u8D26\u53F7\u89D2\u8272\u662F\u5426\u6B63\u786E\uFF0C\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u5206\u914D\u6743\u9650"), /*#__PURE__*/React.createElement(_Button, {
210
+ type: "primary",
211
+ onClick: function onClick() {
212
+ return jump('/');
213
+ }
214
+ }, "\u8FD4\u56DE\u9996\u9875")) : /*#__PURE__*/React.createElement("div", {
215
+ className: variables('Layout')
216
+ }, this.toHeader(sideKey), loading ? /*#__PURE__*/React.createElement(Loading, null) : /*#__PURE__*/React.createElement("div", null, hasV ? /*#__PURE__*/React.createElement(HeaderV, this.headerVProps(sideKey)) : null, this.toSidebar(sideKey, hasV), /*#__PURE__*/React.createElement("section", null, children)));
217
+ }
218
+ }]);
219
+
220
+ return Layout;
221
+ }(React.Component);
222
+
223
+ _defineProperty(Layout, "propTypes", {
224
+ children: PropTypes.node.isRequired,
225
+ nav1: PropTypes.string,
226
+ nav2: PropTypes.string,
227
+ sidebars: PropTypes.object,
228
+ openKeys: PropTypes.object,
229
+ onOpenChange: PropTypes.func
230
+ });
231
+
232
+ export default Layout;
@@ -0,0 +1,28 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-Layout{
4
+ min-width: 1024px;
5
+ max-height: 100%;
6
+ overflow: hidden;
7
+
8
+ > :last-child {
9
+ height: ~'calc(100vh - @{header-height})';
10
+ position: relative;
11
+
12
+ > :first-child {
13
+ position: absolute;
14
+ }
15
+
16
+ > aside {
17
+ position: inherit !important;
18
+ height: inherit;
19
+ float: left;
20
+ }
21
+
22
+ > section {
23
+ overflow: auto;
24
+ height: inherit;
25
+ }
26
+ }
27
+ }
28
+
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Layout",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Layout.js"
6
+ }
@@ -0,0 +1,82 @@
1
+ import _Empty from "antd/es/empty";
2
+ import _Button from "antd/es/button";
3
+ import _Input from "antd/es/input";
4
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
5
+ import _Form from "antd/es/form";
6
+ import React, { useState } from 'react';
7
+ import WingBlank from '../WingBlank';
8
+ import Card from '../Card';
9
+ import variables from '../variables';
10
+ var FormItem = _Form.Item;
11
+
12
+ function Search(_ref) {
13
+ var placeholder = _ref.placeholder,
14
+ onSearch = _ref.onSearch;
15
+
16
+ var _useState = useState(''),
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ value = _useState2[0],
19
+ setValue = _useState2[1];
20
+
21
+ var _useState3 = useState(''),
22
+ _useState4 = _slicedToArray(_useState3, 2),
23
+ status = _useState4[0],
24
+ setStatus = _useState4[1];
25
+
26
+ var onClick = function onClick() {
27
+ if (!value) {
28
+ setStatus('error');
29
+ } else {
30
+ onSearch(value);
31
+ }
32
+ };
33
+
34
+ var onChange = function onChange(e) {
35
+ setStatus('');
36
+ setValue(e.target.value);
37
+ };
38
+
39
+ return /*#__PURE__*/React.createElement(Card, {
40
+ className: s.search
41
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
42
+ validateStatus: status
43
+ }, /*#__PURE__*/React.createElement(_Input, {
44
+ placeholder: placeholder,
45
+ value: value,
46
+ onChange: onChange
47
+ })), /*#__PURE__*/React.createElement(_Button, {
48
+ onClick: onClick
49
+ }, "\u5F00\u59CB\u67E5\u8BE2")));
50
+ }
51
+
52
+ function Title(_ref2) {
53
+ var title = _ref2.title;
54
+ return /*#__PURE__*/React.createElement("div", {
55
+ className: s.title
56
+ }, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null));
57
+ }
58
+
59
+ function LayoutLink(_ref3) {
60
+ var children = _ref3.children,
61
+ img = _ref3.img,
62
+ title = _ref3.title,
63
+ placeholder = _ref3.placeholder,
64
+ onSearch = _ref3.onSearch;
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ className: variables('LayoutLink')
67
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
68
+ src: img,
69
+ alt: "banner"
70
+ })), /*#__PURE__*/React.createElement(WingBlank, null, /*#__PURE__*/React.createElement(Search, {
71
+ placeholder: placeholder,
72
+ onSearch: onSearch
73
+ }), /*#__PURE__*/React.createElement(Title, {
74
+ title: title
75
+ }), /*#__PURE__*/React.createElement(Card, null, children ? children : /*#__PURE__*/React.createElement(_Empty, {
76
+ style: {
77
+ padding: '30px'
78
+ }
79
+ }))));
80
+ }
81
+
82
+ export default LayoutLink;
@@ -0,0 +1,53 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-LayoutLink {
4
+ min-width: 1024px;
5
+
6
+ > div > img {
7
+ width: 100%;
8
+ }
9
+
10
+ .search {
11
+ position: relative;
12
+ top: -30px;
13
+ text-align: center;
14
+ padding: 20px;
15
+
16
+ > div {
17
+ width: 680px;
18
+ margin: auto;
19
+
20
+ > div {
21
+ display: inline-block;
22
+ margin-right: 30px;
23
+ width: 450px;
24
+
25
+ input {
26
+ background-color: #EEE;
27
+ }
28
+ }
29
+
30
+ > button {
31
+ color: white;
32
+ background-color: #FE9533;
33
+ padding: 0 20px;
34
+ }
35
+ }
36
+ }
37
+
38
+ .title {
39
+ text-align: center;
40
+ margin-top: -20px;
41
+
42
+ > div:first-child {
43
+ font-size: 18px;
44
+ font-weight: bold;
45
+ }
46
+
47
+ > div:last-child {
48
+ margin: 10px auto;
49
+ width: 60px;
50
+ border-bottom: #3487F5 3px solid;
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "LayoutLink",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./LayoutLink.js"
6
+ }
@@ -0,0 +1,108 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
3
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
4
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
5
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
6
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
7
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
8
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
9
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
10
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
11
+ var _excluded = ["to", "children", "disabled"];
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 PropTypes from 'prop-types';
20
+ import history from '../history';
21
+
22
+ function isLeftClickEvent(event) {
23
+ return event.button === 0;
24
+ }
25
+
26
+ function isModifiedEvent(event) {
27
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
28
+ }
29
+
30
+ function jump(url) {
31
+ if (history.location.pathname != url) {
32
+ history.push(url);
33
+ } else {
34
+ history.replace(url);
35
+ }
36
+ }
37
+
38
+ var Link = /*#__PURE__*/function (_React$Component) {
39
+ _inherits(Link, _React$Component);
40
+
41
+ var _super = _createSuper(Link);
42
+
43
+ function Link() {
44
+ var _context;
45
+
46
+ var _this;
47
+
48
+ _classCallCheck(this, Link);
49
+
50
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
51
+ args[_key] = arguments[_key];
52
+ }
53
+
54
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
55
+
56
+ _defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
57
+ if (_this.props.onClick) {
58
+ _this.props.onClick(event);
59
+ }
60
+
61
+ if (isModifiedEvent(event) || !isLeftClickEvent(event)) {
62
+ return;
63
+ }
64
+
65
+ if (event.defaultPrevented === true) {
66
+ return;
67
+ }
68
+
69
+ event.preventDefault();
70
+ jump(_this.props.to);
71
+ });
72
+
73
+ return _this;
74
+ }
75
+
76
+ _createClass(Link, [{
77
+ key: "render",
78
+ value: function render() {
79
+ var _this$props = this.props,
80
+ to = _this$props.to,
81
+ children = _this$props.children,
82
+ disabled = _this$props.disabled,
83
+ props = _objectWithoutProperties(_this$props, _excluded);
84
+
85
+ if (disabled) {
86
+ return /*#__PURE__*/React.createElement("a", props, children);
87
+ } else {
88
+ return /*#__PURE__*/React.createElement("a", _extends({
89
+ href: to
90
+ }, props, {
91
+ onClick: this.handleClick
92
+ }), children);
93
+ }
94
+ }
95
+ }]);
96
+
97
+ return Link;
98
+ }(React.Component);
99
+
100
+ _defineProperty(Link, "propTypes", {
101
+ to: PropTypes.string,
102
+ disabled: PropTypes.bool,
103
+ children: PropTypes.node,
104
+ onClick: PropTypes.func
105
+ });
106
+
107
+ export default Link;
108
+ export { jump };
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Link",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Link.js"
6
+ }
@@ -0,0 +1,15 @@
1
+ import _Spin from "antd/es/spin";
2
+ import React from 'react';
3
+ import variables from '../variables';
4
+
5
+ function Loading(_ref) {
6
+ var retry = _ref.retry,
7
+ onRetry = _ref.onRetry;
8
+ return /*#__PURE__*/React.createElement("div", {
9
+ className: variables('Loading')
10
+ }, /*#__PURE__*/React.createElement("div", null, !retry ? /*#__PURE__*/React.createElement(_Spin, null) : /*#__PURE__*/React.createElement("span", null, "\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB", /*#__PURE__*/React.createElement("a", {
11
+ onClick: onRetry
12
+ }, "\u91CD\u8BD5"))));
13
+ }
14
+
15
+ export default Loading;
@@ -0,0 +1,13 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-Loading {
4
+ display: table;
5
+ height: 100%;
6
+ width: 100%;
7
+
8
+ > * {
9
+ display: table-cell;
10
+ vertical-align: middle;
11
+ text-align: center;
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Loading",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Loading.js"
6
+ }
@@ -0,0 +1,11 @@
1
+ import _Spin from "antd/es/spin";
2
+ import React from 'react';
3
+ import variables from '../variables';
4
+
5
+ function Loading() {
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: variables('Loading2')
8
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Spin, null)));
9
+ }
10
+
11
+ export default Loading;
@@ -0,0 +1,19 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-Loading2 {
4
+ position: fixed;
5
+ left: 0;
6
+ right: 0;
7
+ top: 0;
8
+ bottom: 0;
9
+ z-index: 1001;
10
+ text-align: center;
11
+
12
+ > div {
13
+ display: inline-block;
14
+ width: 200px;
15
+ line-height: 100px;
16
+ border-radius: @border-radius-base;
17
+ margin-top: ~'calc(50vh - 50px)';
18
+ }
19
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Loading2",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Loading2.js"
6
+ }
@@ -0,0 +1,34 @@
1
+ import _Modal from "antd/es/modal";
2
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
3
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
4
+ var _excluded = ["className", "children", "title"];
5
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
6
+ import React from 'react';
7
+ import drag from './drag';
8
+ import variables from '../variables';
9
+
10
+ var onLoad = function onLoad(e) {
11
+ var dragElement = e.parentNode.parentNode;
12
+ var targetElement = dragElement.parentNode.parentNode;
13
+ drag(dragElement, targetElement);
14
+ };
15
+
16
+ var ModalWithDrag = function ModalWithDrag(_ref) {
17
+ var _context;
18
+
19
+ var className = _ref.className,
20
+ children = _ref.children,
21
+ title = _ref.title,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+
24
+ props.title = /*#__PURE__*/React.createElement("div", {
25
+ ref: function ref(e) {
26
+ return e && onLoad(e);
27
+ }
28
+ }, title);
29
+ return /*#__PURE__*/React.createElement(_Modal, _extends({
30
+ className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('ModalWithDrag'))
31
+ }, props), children);
32
+ };
33
+
34
+ export default ModalWithDrag;
@@ -0,0 +1,6 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-ModalWithDrag :global(.ant-modal-body) {
4
+ max-height: ~'calc(100vh - 185px)';
5
+ overflow: auto;
6
+ }