assui 3.0.34 → 3.0.35

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.
@@ -175,6 +175,7 @@ import * as React from 'react';
175
175
  import Upload from 'rc-upload';
176
176
  import Progress from "antd/es/progress";
177
177
  import Image from "antd/es/image";
178
+ import Spin from "antd/es/spin";
178
179
  import classNames from 'classnames';
179
180
  import useUpdateEffect from "ahooks/es/useUpdateEffect";
180
181
  import CloseOutlined from "a-icons/es/CloseOutlined";
@@ -210,7 +211,12 @@ var SingleImgUpload = function SingleImgUpload(props) {
210
211
  var _c = __read(React.useState(0), 2),
211
212
  uploadPercent = _c[0],
212
213
  setUploadPercent = _c[1];
214
+ var _d = __read(React.useState(false), 2),
215
+ imageLoading = _d[0],
216
+ setImageLoading = _d[1];
213
217
  useUpdateEffect(function () {
218
+ setFileUrl(value);
219
+ setImageLoading(true);
214
220
  heic2Jpeg(value).then(function (resultUrl) {
215
221
  setFileUrl(resultUrl);
216
222
  if (value) {
@@ -218,6 +224,8 @@ var SingleImgUpload = function SingleImgUpload(props) {
218
224
  } else {
219
225
  setUploadStatus('init');
220
226
  }
227
+ })["finally"](function () {
228
+ setImageLoading(false);
221
229
  });
222
230
  }, [value]);
223
231
  var onBeforeUpload = function onBeforeUpload() {
@@ -301,7 +309,9 @@ var SingleImgUpload = function SingleImgUpload(props) {
301
309
  }), /*#__PURE__*/React.createElement("div", {
302
310
  className: "as-img-upload-close-button",
303
311
  onClick: cancelUpload
304
- }, /*#__PURE__*/React.createElement(CloseOutlined, null))), uploadStatus === 'done' && /*#__PURE__*/React.createElement("div", {
312
+ }, /*#__PURE__*/React.createElement(CloseOutlined, null))), uploadStatus === 'done' && /*#__PURE__*/React.createElement(Spin, {
313
+ spinning: imageLoading
314
+ }, /*#__PURE__*/React.createElement("div", {
305
315
  className: "as-img-upload-content"
306
316
  }, /*#__PURE__*/React.createElement(Image, {
307
317
  wrapperClassName: "as-img-upload-preview",
@@ -310,7 +320,7 @@ var SingleImgUpload = function SingleImgUpload(props) {
310
320
  }), !disabled && /*#__PURE__*/React.createElement("div", {
311
321
  className: "as-img-upload-close-button",
312
322
  onClick: handleDeleteUpload
313
- }, /*#__PURE__*/React.createElement(CloseOutlined, null))), /*#__PURE__*/React.createElement(Upload, __assign({
323
+ }, /*#__PURE__*/React.createElement(CloseOutlined, null)))), /*#__PURE__*/React.createElement(Upload, __assign({
314
324
  ref: function ref(uploader) {
315
325
  uploadInstanceRef.current = uploader;
316
326
  },
@@ -1309,6 +1309,10 @@ html {
1309
1309
  color: #fff;
1310
1310
  text-align: center;
1311
1311
  }
1312
+ .as-img-upload .ant-spin-container,
1313
+ .as-img-upload .ant-spin-nested-loading {
1314
+ height: 100%;
1315
+ }
1312
1316
  .init-disable {
1313
1317
  color: rgba(0, 0, 0, 0.25);
1314
1318
  background-color: #f5f5f5;
@@ -1,3 +1,4 @@
1
1
  import 'antd/lib/image/style';
2
2
  import 'antd/lib/progress/style';
3
+ import 'antd/lib/spin/style';
3
4
  import './index.less';
@@ -1,3 +1,4 @@
1
1
  import "antd/es/image/style";
2
2
  import "antd/es/progress/style";
3
+ import "antd/es/spin/style";
3
4
  import './index.less';
@@ -88,6 +88,12 @@
88
88
  text-align: center;
89
89
  }
90
90
  }
91
+
92
+ .@{ant-prefix}-spin-container,
93
+ .@{ant-prefix}-spin-nested-loading {
94
+ height: 100%;
95
+ }
96
+
91
97
  }
92
98
 
93
99
  .init-disable {
@@ -218,6 +218,7 @@ var React = __importStar(require("react"));
218
218
  var rc_upload_1 = __importDefault(require("rc-upload"));
219
219
  var progress_1 = __importDefault(require("antd/lib/progress"));
220
220
  var image_1 = __importDefault(require("antd/lib/image"));
221
+ var spin_1 = __importDefault(require("antd/lib/spin"));
221
222
  var classnames_1 = __importDefault(require("classnames"));
222
223
  var useUpdateEffect_1 = __importDefault(require("ahooks/lib/useUpdateEffect"));
223
224
  var CloseOutlined_1 = __importDefault(require("a-icons/lib/CloseOutlined"));
@@ -253,7 +254,12 @@ var SingleImgUpload = function SingleImgUpload(props) {
253
254
  var _c = __read(React.useState(0), 2),
254
255
  uploadPercent = _c[0],
255
256
  setUploadPercent = _c[1];
257
+ var _d = __read(React.useState(false), 2),
258
+ imageLoading = _d[0],
259
+ setImageLoading = _d[1];
256
260
  (0, useUpdateEffect_1["default"])(function () {
261
+ setFileUrl(value);
262
+ setImageLoading(true);
257
263
  (0, heic2Jpeg_1["default"])(value).then(function (resultUrl) {
258
264
  setFileUrl(resultUrl);
259
265
  if (value) {
@@ -261,6 +267,8 @@ var SingleImgUpload = function SingleImgUpload(props) {
261
267
  } else {
262
268
  setUploadStatus('init');
263
269
  }
270
+ })["finally"](function () {
271
+ setImageLoading(false);
264
272
  });
265
273
  }, [value]);
266
274
  var onBeforeUpload = function onBeforeUpload() {
@@ -344,7 +352,9 @@ var SingleImgUpload = function SingleImgUpload(props) {
344
352
  }), React.createElement("div", {
345
353
  className: "as-img-upload-close-button",
346
354
  onClick: cancelUpload
347
- }, React.createElement(CloseOutlined_1["default"], null))), uploadStatus === 'done' && React.createElement("div", {
355
+ }, React.createElement(CloseOutlined_1["default"], null))), uploadStatus === 'done' && React.createElement(spin_1["default"], {
356
+ spinning: imageLoading
357
+ }, React.createElement("div", {
348
358
  className: "as-img-upload-content"
349
359
  }, React.createElement(image_1["default"], {
350
360
  wrapperClassName: "as-img-upload-preview",
@@ -353,7 +363,7 @@ var SingleImgUpload = function SingleImgUpload(props) {
353
363
  }), !disabled && React.createElement("div", {
354
364
  className: "as-img-upload-close-button",
355
365
  onClick: handleDeleteUpload
356
- }, React.createElement(CloseOutlined_1["default"], null))), React.createElement(rc_upload_1["default"], __assign({
366
+ }, React.createElement(CloseOutlined_1["default"], null)))), React.createElement(rc_upload_1["default"], __assign({
357
367
  ref: function ref(uploader) {
358
368
  uploadInstanceRef.current = uploader;
359
369
  },
@@ -1309,6 +1309,10 @@ html {
1309
1309
  color: #fff;
1310
1310
  text-align: center;
1311
1311
  }
1312
+ .as-img-upload .ant-spin-container,
1313
+ .as-img-upload .ant-spin-nested-loading {
1314
+ height: 100%;
1315
+ }
1312
1316
  .init-disable {
1313
1317
  color: rgba(0, 0, 0, 0.25);
1314
1318
  background-color: #f5f5f5;
@@ -1,3 +1,4 @@
1
1
  import 'antd/lib/image/style';
2
2
  import 'antd/lib/progress/style';
3
+ import 'antd/lib/spin/style';
3
4
  import './index.less';
@@ -5,4 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  require("antd/lib/image/style");
7
7
  require("antd/lib/progress/style");
8
+ require("antd/lib/spin/style");
8
9
  require("./index.less");
@@ -88,6 +88,12 @@
88
88
  text-align: center;
89
89
  }
90
90
  }
91
+
92
+ .@{ant-prefix}-spin-container,
93
+ .@{ant-prefix}-spin-nested-loading {
94
+ height: 100%;
95
+ }
96
+
91
97
  }
92
98
 
93
99
  .init-disable {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "3.0.34",
3
+ "version": "3.0.35",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -80,5 +80,5 @@
80
80
  "node": ">=10.0.0"
81
81
  },
82
82
  "license": "MIT",
83
- "gitHead": "eba2614cfd203779036b489b6c4c93dbc047989a"
83
+ "gitHead": "1f3311be7cff2f462b91a9482f165fd42f2bf8f2"
84
84
  }