@cloud-app-dev/vidc 2.0.0-alpha.3 → 2.0.0-alpha.30

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 (197) hide show
  1. package/.fatherrc.js +11 -4
  2. package/.umirc.ts +1 -1
  3. package/es/Api/index.js +7 -7
  4. package/es/AppRedirect/index.d.ts +1 -1
  5. package/es/AppRedirect/index.js +7 -12
  6. package/es/AppRoute/index.d.ts +3 -7
  7. package/es/AppRoute/index.js +50 -44
  8. package/es/AppRoute/interface.d.ts +2 -12
  9. package/es/Auth/index.js +1 -1
  10. package/es/AutoExit/index.js +12 -10
  11. package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
  12. package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
  13. package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
  14. package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
  15. package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
  16. package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
  17. package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
  18. package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
  19. package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
  20. package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
  21. package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
  22. package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
  23. package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
  24. package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
  25. package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
  26. package/es/{ContentBox → Box}/index.css +0 -0
  27. package/es/{ContentBox → Box}/index.d.ts +3 -3
  28. package/es/{ContentBox → Box}/index.js +5 -5
  29. package/es/CheckGroupFixed/index.js +4 -2
  30. package/es/Config/index.js +51 -15
  31. package/es/Config/interface.d.ts +27 -10
  32. package/es/Config/utils.d.ts +2 -16
  33. package/es/Config/utils.js +1 -12
  34. package/es/ConfigContext/index.d.ts +15 -2
  35. package/es/ConfigContext/index.js +25 -3
  36. package/es/DeviceSelect/TreeType.d.ts +6 -0
  37. package/es/DeviceSelect/TreeType.js +36 -0
  38. package/es/DeviceSelect/demo.js +2 -2
  39. package/es/DeviceSelect/index.css +6 -1
  40. package/es/DeviceSelect/index.d.ts +5 -0
  41. package/es/DeviceSelect/index.js +21 -52
  42. package/es/Dict/desc.js +3 -3
  43. package/es/Dict/utils.js +3 -3
  44. package/es/IconFont/index.d.ts +0 -1
  45. package/es/IconFont/index.js +12 -13
  46. package/es/InitialConfig/index.js +7 -4
  47. package/es/InitialConfig/utils.d.ts +6 -1
  48. package/es/InitialConfig/utils.js +38 -34
  49. package/es/InitialRequest/index.d.ts +3 -1
  50. package/es/InitialRequest/index.js +29 -19
  51. package/es/InitialRequest/utils.d.ts +8 -6
  52. package/es/InitialRequest/utils.js +59 -95
  53. package/es/Input/index.js +3 -2
  54. package/es/InstanceHistory/index.d.ts +3 -0
  55. package/es/InstanceHistory/index.js +9 -0
  56. package/es/List/CheckExt.d.ts +3 -5
  57. package/es/List/CheckExt.js +21 -13
  58. package/es/{AppRoute → List/DeviceList}/index.css +0 -0
  59. package/es/List/DeviceList/index.d.ts +11 -0
  60. package/es/{DeviceList → List/DeviceList}/index.js +6 -18
  61. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  62. package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
  63. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  64. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  65. package/es/List/DynamicDeviceList/index.js +205 -0
  66. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  67. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  68. package/es/List/DynamicDeviceList/utils.js +61 -0
  69. package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
  70. package/es/List/DynamicGridList/Demo.js +70 -0
  71. package/es/List/DynamicGridList/index.d.ts +26 -0
  72. package/es/List/DynamicGridList/index.js +73 -0
  73. package/es/List/GridList/Demo.d.ts +2 -0
  74. package/es/List/GridList/Demo.js +91 -0
  75. package/es/List/GridList/hook.d.ts +13 -0
  76. package/es/List/GridList/hook.js +301 -0
  77. package/es/List/GridList/index.css +7 -0
  78. package/es/List/GridList/index.d.ts +15 -0
  79. package/es/List/GridList/index.js +47 -0
  80. package/es/List/GridList/interface.d.ts +59 -0
  81. package/es/List/GridList/utils.d.ts +9 -0
  82. package/es/List/GridList/utils.js +43 -0
  83. package/es/List/ListExt/index.css +3 -0
  84. package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
  85. package/es/{ListExt → List/ListExt}/index.js +3 -3
  86. package/es/List/VList/index.css +6 -0
  87. package/es/List/VList/index.d.ts +18 -0
  88. package/es/List/VList/index.js +51 -0
  89. package/es/List/VList/utils.d.ts +14 -0
  90. package/es/{VList → List/VList}/utils.js +0 -0
  91. package/es/List/index.css +11 -12
  92. package/es/List/index.d.ts +5 -70
  93. package/es/List/index.js +32 -24
  94. package/es/List/interface.d.ts +87 -0
  95. package/es/List/renderItem.d.ts +1 -1
  96. package/es/List/renderItem.js +13 -10
  97. package/es/LoaderApp/index.d.ts +1 -0
  98. package/es/LoaderApp/index.js +24 -10
  99. package/es/LoaderApp/utils.d.ts +2 -1
  100. package/es/LoaderApp/utils.js +8 -10
  101. package/es/LoaderScript/index.js +7 -89
  102. package/es/LoaderScript/utils.d.ts +2 -0
  103. package/es/LoaderScript/utils.js +170 -33
  104. package/es/Picture/component/MoveContent/index.js +3 -3
  105. package/es/RefDrawer/index.js +1 -1
  106. package/es/RefModal/index.js +1 -1
  107. package/es/Service/http.d.ts +6 -4
  108. package/es/Service/http.js +20 -22
  109. package/es/Service/index.d.ts +3 -3
  110. package/es/Service/index.js +7 -11
  111. package/es/Service/interface.d.ts +5 -11
  112. package/es/Service/middleware.d.ts +1 -1
  113. package/es/Service/middleware.js +1 -1
  114. package/es/TableLayout/index.d.ts +3 -0
  115. package/es/TableLayout/index.js +14 -45
  116. package/es/{TreeTitle → Title}/index.css +5 -5
  117. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  118. package/es/{TreeTitle → Title}/index.js +7 -4
  119. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  120. package/es/Tree/BaseTree/demo.js +69 -0
  121. package/es/Tree/BaseTree/index.css +64 -0
  122. package/es/Tree/BaseTree/index.d.ts +24 -0
  123. package/es/Tree/BaseTree/index.js +83 -0
  124. package/es/Tree/demo.js +19 -56
  125. package/es/Tree/index.css +29 -55
  126. package/es/Tree/index.d.ts +19 -20
  127. package/es/Tree/index.js +185 -70
  128. package/es/UserSelect/index.js +6 -4
  129. package/es/WorkerFlow/Form/Condition.js +2 -4
  130. package/es/WorkerFlow/Form/EmptyUserSet.js +2 -4
  131. package/es/WorkerFlow/Form/FormAuth.js +2 -2
  132. package/es/WorkerFlow/Form/GroupList.js +2 -2
  133. package/es/WorkerFlow/Form/GroupSelect.js +2 -4
  134. package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
  135. package/es/WorkerFlow/Form/LevelGroupSelect.js +3 -5
  136. package/es/WorkerFlow/Form/UserAndGroupSelect.js +2 -4
  137. package/es/WorkerFlow/Form/UserSelect.js +2 -4
  138. package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -3
  139. package/es/WorkerFlow/Form/UserSet.js +2 -2
  140. package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
  141. package/es/WorkerFlow/index.css +9 -3
  142. package/es/WorkerFlow/index.js +13 -8
  143. package/es/WorkerFlow/utils.js +2 -2
  144. package/es/index.d.ts +3 -10
  145. package/es/index.js +3 -10
  146. package/es/useDrawer/index.d.ts +1 -1
  147. package/es/useDrawer/index.js +3 -2
  148. package/es/useHistory/index.d.ts +2 -2
  149. package/es/useHistory/index.js +3 -6
  150. package/es/useHttp/index.js +1 -1
  151. package/es/useModal/index.d.ts +1 -1
  152. package/es/useModal/index.js +3 -2
  153. package/es/utils.d.ts +9 -0
  154. package/es/utils.js +36 -1
  155. package/package.json +10 -12
  156. package/tsconfig.json +1 -1
  157. package/es/AppRoute/Render.d.ts +0 -23
  158. package/es/AppRoute/Render.js +0 -111
  159. package/es/AppRoute/Rendered.d.ts +0 -4
  160. package/es/AppRoute/Rendered.js +0 -11
  161. package/es/AppRoute/utils.d.ts +0 -1
  162. package/es/AppRoute/utils.js +0 -28
  163. package/es/DeviceList/index.css +0 -32
  164. package/es/DeviceList/index.d.ts +0 -14
  165. package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
  166. package/es/DynamicDeviceList/CheckExt.js +0 -36
  167. package/es/DynamicDeviceList/Demo.js +0 -17
  168. package/es/DynamicDeviceList/index.d.ts +0 -35
  169. package/es/DynamicDeviceList/index.js +0 -224
  170. package/es/DynamicDeviceList/utils.d.ts +0 -2
  171. package/es/DynamicDeviceList/utils.js +0 -15
  172. package/es/DynamicList/index.css +0 -7
  173. package/es/DynamicList/index.d.ts +0 -31
  174. package/es/DynamicList/index.js +0 -132
  175. package/es/IconFont/index.css +0 -0
  176. package/es/List/utils.d.ts +0 -5
  177. package/es/List/utils.js +0 -18
  178. package/es/ListExt/index.css +0 -9
  179. package/es/ScrollList/index.css +0 -73
  180. package/es/ScrollList/index.d.ts +0 -24
  181. package/es/ScrollList/index.js +0 -261
  182. package/es/ScrollList/utils.js +0 -84
  183. package/es/Service/logger.d.ts +0 -3
  184. package/es/Service/logger.js +0 -13
  185. package/es/Service/utils.d.ts +0 -3
  186. package/es/Service/utils.js +0 -11
  187. package/es/TreeMode/demo.js +0 -32
  188. package/es/TreeMode/index.css +0 -38
  189. package/es/TreeMode/index.d.ts +0 -23
  190. package/es/TreeMode/index.js +0 -201
  191. package/es/VList/index.css +0 -4
  192. package/es/VList/index.d.ts +0 -16
  193. package/es/VList/index.js +0 -56
  194. package/es/VList/utils.d.ts +0 -10
  195. package/es/useChangeEffect/index.d.ts +0 -3
  196. package/es/useChangeEffect/index.js +0 -32
  197. package/es/useHistory/index.css +0 -0
@@ -1,3 +1,5 @@
1
+ import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
+
1
3
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
4
 
3
5
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -12,6 +14,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
12
14
 
13
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
16
 
17
+ import { __asyncValues, __awaiter } from "tslib";
15
18
  var global = window;
16
19
 
17
20
  if (!global._LOADER_SCRIPT_URL) {
@@ -67,44 +70,178 @@ export function createAsyncIterable(options) {
67
70
  return {
68
71
  i: 0,
69
72
  next: function next() {
70
- var _this = this;
73
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
74
+ var param, arr;
75
+ return regeneratorRuntime.wrap(function _callee$(_context) {
76
+ while (1) {
77
+ switch (_context.prev = _context.next) {
78
+ case 0:
79
+ if (!(this.i < options.length)) {
80
+ _context.next = 12;
81
+ break;
82
+ }
83
+
84
+ param = options[this.i];
85
+ arr = [];
86
+
87
+ if (param.scripts && param.scripts.length > 0) {
88
+ arr.push.apply(arr, _toConsumableArray(param.scripts.map(function (v) {
89
+ return loadScript(v);
90
+ })));
91
+ }
92
+
93
+ if (param.styles && param.styles.length > 0) {
94
+ arr.push.apply(arr, _toConsumableArray(param.styles.map(function (v) {
95
+ return loaderCss(v);
96
+ })));
97
+ }
98
+
99
+ if (!(arr.length > 0)) {
100
+ _context.next = 11;
101
+ break;
102
+ }
103
+
104
+ _context.next = 8;
105
+ return Promise.all(arr);
106
+
107
+ case 8:
108
+ return _context.abrupt("return", {
109
+ value: this.i++,
110
+ done: false
111
+ });
112
+
113
+ case 11:
114
+ return _context.abrupt("return", Promise.resolve({
115
+ value: this.i++,
116
+ done: false
117
+ }));
118
+
119
+ case 12:
120
+ return _context.abrupt("return", Promise.resolve({
121
+ value: this.i,
122
+ done: true
123
+ }));
124
+
125
+ case 13:
126
+ case "end":
127
+ return _context.stop();
128
+ }
129
+ }
130
+ }, _callee, this);
131
+ }));
132
+ }
133
+ };
134
+ });
135
+ }
136
+ export function tryCatch(resolveFn) {
137
+ var rejectFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : console.error;
138
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
139
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
140
+ while (1) {
141
+ switch (_context2.prev = _context2.next) {
142
+ case 0:
143
+ _context2.prev = 0;
144
+ _context2.next = 3;
145
+ return resolveFn();
146
+
147
+ case 3:
148
+ _context2.next = 8;
149
+ break;
150
+
151
+ case 5:
152
+ _context2.prev = 5;
153
+ _context2.t0 = _context2["catch"](0);
154
+ rejectFn(_context2.t0);
155
+
156
+ case 8:
157
+ case "end":
158
+ return _context2.stop();
159
+ }
160
+ }
161
+ }, _callee2, null, [[0, 5]]);
162
+ }));
163
+ }
164
+ export function runAsyncIterable(Iterables, runtime, callback) {
165
+ var _this = this;
166
+
167
+ tryCatch(function () {
168
+ return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
169
+ var e_1, _a, Iterables_1, Iterables_1_1, x;
170
+
171
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
172
+ while (1) {
173
+ switch (_context3.prev = _context3.next) {
174
+ case 0:
175
+ _context3.prev = 0;
176
+ Iterables_1 = __asyncValues(Iterables);
177
+
178
+ case 2:
179
+ _context3.next = 4;
180
+ return Iterables_1.next();
181
+
182
+ case 4:
183
+ Iterables_1_1 = _context3.sent;
184
+
185
+ if (Iterables_1_1.done) {
186
+ _context3.next = 10;
187
+ break;
188
+ }
189
+
190
+ x = Iterables_1_1.value;
191
+ runtime && runtime(x);
192
+
193
+ case 8:
194
+ _context3.next = 2;
195
+ break;
196
+
197
+ case 10:
198
+ _context3.next = 15;
199
+ break;
200
+
201
+ case 12:
202
+ _context3.prev = 12;
203
+ _context3.t0 = _context3["catch"](0);
204
+ e_1 = {
205
+ error: _context3.t0
206
+ };
71
207
 
72
- if (this.i < options.length) {
73
- var param = options[this.i];
74
- var arr = [];
208
+ case 15:
209
+ _context3.prev = 15;
210
+ _context3.prev = 16;
75
211
 
76
- if (param.scripts && param.scripts.length > 0) {
77
- arr.push.apply(arr, _toConsumableArray(param.scripts.map(function (v) {
78
- return loadScript(v);
79
- })));
80
- }
212
+ if (!(Iterables_1_1 && !Iterables_1_1.done && (_a = Iterables_1.return))) {
213
+ _context3.next = 20;
214
+ break;
215
+ }
81
216
 
82
- if (param.styles && param.styles.length > 0) {
83
- arr.push.apply(arr, _toConsumableArray(param.styles.map(function (v) {
84
- return loaderCss(v);
85
- })));
86
- }
217
+ _context3.next = 20;
218
+ return _a.call(Iterables_1);
87
219
 
88
- if (arr.length > 0) {
89
- return Promise.all(arr).then(function () {
90
- return {
91
- value: _this.i++,
92
- done: false
93
- };
94
- });
95
- } else {
96
- return Promise.resolve({
97
- value: this.i++,
98
- done: false
99
- });
220
+ case 20:
221
+ _context3.prev = 20;
222
+
223
+ if (!e_1) {
224
+ _context3.next = 23;
225
+ break;
226
+ }
227
+
228
+ throw e_1.error;
229
+
230
+ case 23:
231
+ return _context3.finish(20);
232
+
233
+ case 24:
234
+ return _context3.finish(15);
235
+
236
+ case 25:
237
+ callback && _nextTick(callback);
238
+
239
+ case 26:
240
+ case "end":
241
+ return _context3.stop();
100
242
  }
101
243
  }
102
-
103
- return Promise.resolve({
104
- value: this.i,
105
- done: true
106
- });
107
- }
108
- };
244
+ }, _callee3, null, [[0, 12, 15, 25], [16,, 20, 24]]);
245
+ }));
109
246
  });
110
247
  }
@@ -1,12 +1,12 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
 
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
 
5
5
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
6
 
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
8
 
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
10
 
11
11
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
12
 
@@ -15,7 +15,7 @@ import Drawer from '../Drawer';
15
15
  import ConfigContext from '../ConfigContext';
16
16
 
17
17
  function RefDrawer(_, ref) {
18
- var context = useContext(ConfigContext);
18
+ var context = useContext(ConfigContext.Context);
19
19
  var root = useMemo(function () {
20
20
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
21
21
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -15,7 +15,7 @@ import Modal from '../Modal';
15
15
  import ConfigContext from '../ConfigContext';
16
16
 
17
17
  function RefModal(_, ref) {
18
- var context = useContext(ConfigContext);
18
+ var context = useContext(ConfigContext.Context);
19
19
  var root = useMemo(function () {
20
20
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
21
21
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -1,4 +1,6 @@
1
- import { RsponseType, XHRResponse } from './interface';
2
- export declare function $http(options: RsponseType): import("fetch-like-axios").AxiosPromise<any>;
3
- export declare const $httpMultiPartInstance: import("fetch-like-axios").AxiosInstance;
4
- export declare const $httpXMLInstance: ({ url, method, data, headers, cancelHttp, isAsync, requestId }: XHRResponse) => Promise<unknown>;
1
+ import { AxiosInstance } from 'fetch-like-axios';
2
+ import type { RsponseType, XHRResponse } from './interface';
3
+ declare function http({ cancelHttp, ...newOptions }: RsponseType): Promise<any>;
4
+ declare const httpMultiPartInstance: AxiosInstance;
5
+ declare function httpXMLInstance({ url, method, data, headers, cancelHttp, isAsync }: XHRResponse): Promise<any>;
6
+ export { http as default, http, httpMultiPartInstance, httpXMLInstance };
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
- import fetchAxios from 'fetch-like-axios';
2
+ import Axios from 'fetch-like-axios';
3
3
  import * as Middleware from './middleware';
4
- var CancelToken = fetchAxios.CancelToken;
4
+ var CancelToken = Axios.CancelToken;
5
5
  var config = {
6
6
  baseURL: '/',
7
7
  timeout: 60 * 1000,
@@ -11,7 +11,7 @@ var config = {
11
11
  'Content-Type': 'application/json; charset=utf-8'
12
12
  }
13
13
  };
14
- var httpInstance = fetchAxios.create(config);
14
+ var httpInstance = Axios.create(config);
15
15
  /**
16
16
  * 请求之前拦截动作
17
17
  */
@@ -49,36 +49,38 @@ httpInstance.interceptors.response.use(function (response) {
49
49
 
50
50
  return Promise.reject(error.response);
51
51
  });
52
- export function $http(options) {
52
+
53
+ function http(_a) {
54
+ var cancelHttp = _a.cancelHttp,
55
+ newOptions = __rest(_a, ["cancelHttp"]);
56
+
53
57
  var cancel;
54
58
  var cancelToken = new CancelToken(function (c) {
55
59
  cancel = c;
56
60
 
57
- if (options.cancelHttp) {
58
- options.cancelHttp(cancel);
61
+ if (cancelHttp) {
62
+ cancelHttp(cancel);
59
63
  }
60
64
  });
61
-
62
- var cancelHttp = options.cancelHttp,
63
- newOptions = __rest(options, ["cancelHttp"]);
64
-
65
65
  return httpInstance(Object.assign(Object.assign({}, newOptions), {
66
66
  cancelToken: cancelToken
67
67
  }));
68
68
  }
69
- export var $httpMultiPartInstance = fetchAxios.create({
69
+
70
+ var httpMultiPartInstance = Axios.create({
70
71
  xhrMode: 'fetch',
71
72
  timeout: 10 * 60 * 1000,
72
73
  headers: {
73
74
  'Content-Type': 'multipart/form-data'
74
75
  }
75
76
  });
76
- $httpMultiPartInstance.interceptors.response.use(function (response) {
77
- return response.data;
77
+ httpMultiPartInstance.interceptors.response.use(function (response) {
78
+ return Promise.resolve(response.data);
78
79
  }, function (error) {
79
80
  return Promise.reject(error);
80
81
  });
81
- export var $httpXMLInstance = function xhrRequest(_ref) {
82
+
83
+ function httpXMLInstance(_ref) {
82
84
  var url = _ref.url,
83
85
  _ref$method = _ref.method,
84
86
  method = _ref$method === void 0 ? 'GET' : _ref$method,
@@ -86,13 +88,7 @@ export var $httpXMLInstance = function xhrRequest(_ref) {
86
88
  headers = _ref.headers,
87
89
  cancelHttp = _ref.cancelHttp,
88
90
  _ref$isAsync = _ref.isAsync,
89
- isAsync = _ref$isAsync === void 0 ? false : _ref$isAsync,
90
- requestId = _ref.requestId;
91
-
92
- if (!requestId) {
93
- console.warn('缺少requestId');
94
- }
95
-
91
+ isAsync = _ref$isAsync === void 0 ? false : _ref$isAsync;
96
92
  return new Promise(function (resolve, reject) {
97
93
  var xhr = new XMLHttpRequest();
98
94
 
@@ -132,4 +128,6 @@ export var $httpXMLInstance = function xhrRequest(_ref) {
132
128
 
133
129
  xhr.send(data ? JSON.stringify(data) : null);
134
130
  });
135
- };
131
+ }
132
+
133
+ export { http as default, http, httpMultiPartInstance, httpXMLInstance };
@@ -1,3 +1,3 @@
1
- import { IServiceInterface } from './interface';
2
- declare let proxy: IServiceInterface;
3
- export default proxy;
1
+ import type { IServiceInterface } from './interface';
2
+ declare const Service: IServiceInterface;
3
+ export default Service;
@@ -1,14 +1,10 @@
1
- import { $http, $httpMultiPartInstance, $httpXMLInstance } from './http';
1
+ import { http, httpMultiPartInstance, httpXMLInstance } from './http';
2
2
  import { registerResponseMiddleware, registerResponseErrorMiddleware } from './middleware';
3
- import produce from 'immer';
4
- import * as logger from './logger';
5
- var ServiceInterface = {
6
- $http: $http,
7
- $httpXMLInstance: $httpXMLInstance,
8
- $httpMultiPartInstance: $httpMultiPartInstance,
3
+ var Service = {
4
+ http: http,
5
+ httpXMLInstance: httpXMLInstance,
6
+ httpMultiPartInstance: httpMultiPartInstance,
9
7
  registerResponseMiddleware: registerResponseMiddleware,
10
- registerResponseErrorMiddleware: registerResponseErrorMiddleware,
11
- logger: logger
8
+ registerResponseErrorMiddleware: registerResponseErrorMiddleware
12
9
  };
13
- var proxy = produce(ServiceInterface, function () {});
14
- export default proxy;
10
+ export default Service;
@@ -1,9 +1,4 @@
1
- import { AxiosRequestConfig } from 'fetch-like-axios';
2
-
3
- export type loggerType = {
4
- save(options: { description: string; module: string | number; function: string | number }, token?: string): Promise<any>;
5
- };
6
-
1
+ import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'fetch-like-axios';
7
2
  export type RsponseType = AxiosRequestConfig & { requestId?: string; cancelHttp?: (cancel: Function) => void; loggerIndex?: number };
8
3
 
9
4
  export type XHRResponse = {
@@ -16,13 +11,12 @@ export type XHRResponse = {
16
11
  requestId?: string;
17
12
  };
18
13
 
19
- export type MiddleWareType = (config: any) => any;
14
+ export type MiddleWareType = (config: AxiosResponse<any>) => any;
20
15
 
21
16
  export type IServiceInterface = {
22
- $http(options: RsponseType): Promise<any>;
23
- $httpXMLInstance(options: XHRResponse): Promise<any>;
24
- $httpMultiPartInstance(options: AxiosRequestConfig): Promise<any>;
17
+ http(options: RsponseType): Promise<any>;
18
+ httpXMLInstance(options: XHRResponse): Promise<any>;
19
+ httpMultiPartInstance: AxiosInstance;
25
20
  registerResponseMiddleware(fn: MiddleWareType): void;
26
21
  registerResponseErrorMiddleware(fn: MiddleWareType): void;
27
- logger: loggerType;
28
22
  };
@@ -1,4 +1,4 @@
1
- import { MiddleWareType } from './interface';
1
+ import type { MiddleWareType } from './interface';
2
2
  export declare const responseMiddleware: Array<any>;
3
3
  export declare const responseErrorMiddleware: Array<any>;
4
4
  export declare function registerResponseMiddleware(fn: MiddleWareType): void;
@@ -1,6 +1,6 @@
1
1
  var _global = window;
2
2
  export var responseMiddleware = _global.responseMiddleware || [];
3
- export var responseErrorMiddleware = _global.responseMiddleware || [];
3
+ export var responseErrorMiddleware = _global.responseErrorMiddleware || [];
4
4
  export function registerResponseMiddleware(fn) {
5
5
  if (!responseMiddleware.includes(fn)) {
6
6
  responseMiddleware.push(fn);
@@ -7,4 +7,7 @@ interface ITableLayoutProps {
7
7
  x?: string | number;
8
8
  }
9
9
  declare function TableLayout({ className, children, cutNum, x }: ITableLayoutProps): JSX.Element;
10
+ declare namespace TableLayout {
11
+ var defaultProps: ITableLayoutProps;
12
+ }
10
13
  export default TableLayout;
@@ -1,55 +1,19 @@
1
- import _resizeObserver from "@cloud-app-dev/utils/es/resizeObserver";
2
-
3
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
-
5
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
-
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
-
9
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
-
11
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
-
13
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
-
15
- import React, { useEffect, useRef, useState } from 'react';
1
+ import _useSize from "ahooks/es/useSize";
2
+ import React, { useMemo, useRef } from 'react';
16
3
  import "./index.css";
17
4
 
18
5
  function TableLayout(_ref) {
19
- var _ref$className = _ref.className,
20
- className = _ref$className === void 0 ? '' : _ref$className,
6
+ var className = _ref.className,
21
7
  children = _ref.children,
22
- _ref$cutNum = _ref.cutNum,
23
- cutNum = _ref$cutNum === void 0 ? 0 : _ref$cutNum,
24
- _ref$x = _ref.x,
25
- x = _ref$x === void 0 ? 1200 : _ref$x;
26
-
27
- var _useState = useState(500),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- height = _useState2[0],
30
- setHeight = _useState2[1];
31
-
8
+ cutNum = _ref.cutNum,
9
+ x = _ref.x;
32
10
  var domRef = useRef(null);
33
- useEffect(function () {
34
- var set = function set() {
35
- var _a;
36
-
37
- var rect = (_a = domRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
38
-
39
- if (rect) {
40
- setHeight(rect.height - cutNum);
41
- }
42
- };
43
-
44
- set();
45
- var dom = domRef.current;
46
11
 
47
- _resizeObserver.createResizeObserver(dom, set);
12
+ var size = _useSize(domRef);
48
13
 
49
- return function () {
50
- _resizeObserver.unResizeObserver(dom, set);
51
- };
52
- }, [cutNum]);
14
+ var height = useMemo(function () {
15
+ return size.height - cutNum;
16
+ }, [size.height, cutNum]);
53
17
  return /*#__PURE__*/React.createElement("div", {
54
18
  ref: domRef,
55
19
  className: "table-layout ".concat(className)
@@ -61,4 +25,9 @@ function TableLayout(_ref) {
61
25
  }));
62
26
  }
63
27
 
28
+ TableLayout.defaultProps = {
29
+ className: '',
30
+ cutNum: 0,
31
+ x: 1200
32
+ };
64
33
  export default TableLayout;
@@ -1,4 +1,4 @@
1
- .lm-c-tree-title-part {
1
+ .cloudapp-c-title-part {
2
2
  font-size: var(--fs-small);
3
3
  height: 42px;
4
4
  padding: 0 16px;
@@ -7,19 +7,19 @@
7
7
  align-items: center;
8
8
  background-color: var(--form-bg-light);
9
9
  }
10
- .lm-c-tree-title-part .title-text {
10
+ .cloudapp-c-title-part .title-text {
11
11
  padding-right: 10px;
12
12
  }
13
- .lm-c-tree-title-part span:last-child {
13
+ .cloudapp-c-title-part span:last-child {
14
14
  cursor: pointer;
15
15
  }
16
- .lm-c-tree-title-part .input-keword {
16
+ .cloudapp-c-title-part .input-keword {
17
17
  flex: 1 1;
18
18
  height: 28px;
19
19
  position: relative;
20
20
  top: -1px;
21
21
  max-width: 200px;
22
22
  }
23
- .lm-c-tree-title-part .input-keword input {
23
+ .cloudapp-c-title-part .input-keword input {
24
24
  font-size: var(--fs-small);
25
25
  }
@@ -8,5 +8,5 @@ interface ITreeTitleProps {
8
8
  titleExt?: React.ReactNode;
9
9
  value?: string;
10
10
  }
11
- export default function TreeTitle({ title, inputPlaceholder, onChange, hasInput, titleExt, value }: ITreeTitleProps): JSX.Element;
12
- export {};
11
+ declare function Title({ title, inputPlaceholder, onChange, hasInput, titleExt, value }: ITreeTitleProps): JSX.Element;
12
+ export default Title;
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import Input from '../Input';
3
3
  import "./index.css";
4
- export default function TreeTitle(_ref) {
4
+
5
+ function Title(_ref) {
5
6
  var title = _ref.title,
6
7
  inputPlaceholder = _ref.inputPlaceholder,
7
8
  onChange = _ref.onChange,
@@ -15,13 +16,15 @@ export default function TreeTitle(_ref) {
15
16
  }
16
17
 
17
18
  return /*#__PURE__*/React.createElement("div", {
18
- className: "lm-c-tree-title-part"
19
+ className: "cloudapp-c-title-part"
19
20
  }, /*#__PURE__*/React.createElement("span", {
20
- className: 'title-text'
21
+ className: "title-text"
21
22
  }, title), hasInput && /*#__PURE__*/React.createElement(Input, {
22
23
  className: "input-keword",
23
24
  placeholder: inputPlaceholder,
24
25
  onChange: onChange,
25
26
  value: value
26
27
  }), titleExt);
27
- }
28
+ }
29
+
30
+ export default Title;
File without changes