ls-pro-common 3.0.33 → 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.
@@ -371,7 +371,7 @@ function ImageSelector(prop) {
371
371
  onClick: confirmImage
372
372
  }, "\u786E\u8BA4")),
373
373
  getContainer: function getContainer() {
374
- return document.body;
374
+ return (top || window).document.body;
375
375
  }
376
376
  }, modalProps), /*#__PURE__*/React.createElement("div", {
377
377
  style: {
@@ -343,6 +343,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
343
343
  (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
344
344
  }
345
345
  }, [text, multiple]);
346
+ useEffect(function () {
347
+ if (visible && loadOnShow) {
348
+ var _tableRef$current3, _tableRef$current3$re;
349
+ (_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$re = _tableRef$current3.reload) === null || _tableRef$current3$re === void 0 ? void 0 : _tableRef$current3$re.call(_tableRef$current3);
350
+ }
351
+ }, [visible, loadOnShow]);
346
352
  var tableDom = /*#__PURE__*/React.createElement(ProTable, _extends({
347
353
  className: "ls-input-table",
348
354
  columns: columns,
package/es/utils/index.js CHANGED
@@ -334,12 +334,19 @@ _message.config({
334
334
  });
335
335
  /** @name 显示错误 */
336
336
  export var showError = function showError(text) {
337
- var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
337
+ var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
338
338
  _message.error({
339
339
  content: text,
340
340
  duration: duration,
341
341
  getPopupContainer: function getPopupContainer(e) {
342
- return getFullScreenElement() || document.body;
342
+ return getFullScreenElement() || (top || window).document.body;
343
+ },
344
+ onClick: function onClick(e) {
345
+ var _e$target;
346
+ var tag = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.tagName.toLowerCase();
347
+ if (tag === 'img' || tag === 'path' || tag === 'svg') {
348
+ _message.destroy();
349
+ }
343
350
  }
344
351
  });
345
352
  };
@@ -350,7 +357,14 @@ export var showWarn = function showWarn(text) {
350
357
  content: text,
351
358
  duration: duration,
352
359
  getPopupContainer: function getPopupContainer(e) {
353
- return getFullScreenElement() || document.body;
360
+ return getFullScreenElement() || (top || window).document.body;
361
+ },
362
+ onClick: function onClick(e) {
363
+ var _e$target2;
364
+ var tag = (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.tagName.toLowerCase();
365
+ if (tag === 'img' || tag === 'path' || tag === 'svg') {
366
+ _message.destroy();
367
+ }
354
368
  }
355
369
  });
356
370
  };
@@ -361,7 +375,14 @@ export var showSuccess = function showSuccess(text) {
361
375
  content: text,
362
376
  duration: duration,
363
377
  getPopupContainer: function getPopupContainer(e) {
364
- return getFullScreenElement() || document.body;
378
+ return getFullScreenElement() || (top || window).document.body;
379
+ },
380
+ onClick: function onClick(e) {
381
+ var _e$target3;
382
+ var tag = (_e$target3 = e.target) === null || _e$target3 === void 0 ? void 0 : _e$target3.tagName.toLowerCase();
383
+ if (tag === 'img' || tag === 'path' || tag === 'svg') {
384
+ _message.destroy();
385
+ }
365
386
  }
366
387
  });
367
388
  };
@@ -381,7 +402,7 @@ export var showAlert = function showAlert(text) {
381
402
  _Modal[type](_objectSpread({
382
403
  content: text,
383
404
  title: title,
384
- getContainer: getFullScreenElement() || document.body,
405
+ getContainer: getFullScreenElement() || (top || window).document.body,
385
406
  onOk: function onOk() {
386
407
  resolve(true);
387
408
  },
@@ -412,7 +433,7 @@ export var showConfirm = function showConfirm(text) {
412
433
  cancelButtonProps: {
413
434
  className: 'ant-btn-gray'
414
435
  },
415
- getContainer: getFullScreenElement() || document.body,
436
+ getContainer: getFullScreenElement() || (top || window).document.body,
416
437
  onOk: function onOk() {
417
438
  resolve(true);
418
439
  },
@@ -434,6 +455,7 @@ export var reLogin = function reLogin() {
434
455
  title: '登录状态已过期,请重新登录',
435
456
  okText: '重新登录',
436
457
  maskClosable: false,
458
+ getContainer: getFullScreenElement() || (top || window).document.body,
437
459
  afterClose: function afterClose() {
438
460
  timeout = false;
439
461
  (window.top || window).location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
@@ -371,7 +371,7 @@ function ImageSelector(prop) {
371
371
  onClick: confirmImage
372
372
  }, "\u786E\u8BA4")),
373
373
  getContainer: function getContainer() {
374
- return document.body;
374
+ return (top || window).document.body;
375
375
  }
376
376
  }, modalProps), /*#__PURE__*/React.createElement("div", {
377
377
  style: {
@@ -343,6 +343,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
343
343
  (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
344
344
  }
345
345
  }, [text, multiple]);
346
+ useEffect(function () {
347
+ if (visible && loadOnShow) {
348
+ var _tableRef$current3, _tableRef$current3$re;
349
+ (_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$re = _tableRef$current3.reload) === null || _tableRef$current3$re === void 0 ? void 0 : _tableRef$current3$re.call(_tableRef$current3);
350
+ }
351
+ }, [visible, loadOnShow]);
346
352
  var tableDom = /*#__PURE__*/React.createElement(ProTable, _extends({
347
353
  className: "ls-input-table",
348
354
  columns: columns,
@@ -334,12 +334,19 @@ _message.config({
334
334
  });
335
335
  /** @name 显示错误 */
336
336
  export var showError = function showError(text) {
337
- var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
337
+ var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
338
338
  _message.error({
339
339
  content: text,
340
340
  duration: duration,
341
341
  getPopupContainer: function getPopupContainer(e) {
342
- return getFullScreenElement() || document.body;
342
+ return getFullScreenElement() || (top || window).document.body;
343
+ },
344
+ onClick: function onClick(e) {
345
+ var _e$target;
346
+ var tag = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.tagName.toLowerCase();
347
+ if (tag === 'img' || tag === 'path' || tag === 'svg') {
348
+ _message.destroy();
349
+ }
343
350
  }
344
351
  });
345
352
  };
@@ -350,7 +357,14 @@ export var showWarn = function showWarn(text) {
350
357
  content: text,
351
358
  duration: duration,
352
359
  getPopupContainer: function getPopupContainer(e) {
353
- return getFullScreenElement() || document.body;
360
+ return getFullScreenElement() || (top || window).document.body;
361
+ },
362
+ onClick: function onClick(e) {
363
+ var _e$target2;
364
+ var tag = (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.tagName.toLowerCase();
365
+ if (tag === 'img' || tag === 'path' || tag === 'svg') {
366
+ _message.destroy();
367
+ }
354
368
  }
355
369
  });
356
370
  };
@@ -361,7 +375,14 @@ export var showSuccess = function showSuccess(text) {
361
375
  content: text,
362
376
  duration: duration,
363
377
  getPopupContainer: function getPopupContainer(e) {
364
- return getFullScreenElement() || document.body;
378
+ return getFullScreenElement() || (top || window).document.body;
379
+ },
380
+ onClick: function onClick(e) {
381
+ var _e$target3;
382
+ var tag = (_e$target3 = e.target) === null || _e$target3 === void 0 ? void 0 : _e$target3.tagName.toLowerCase();
383
+ if (tag === 'img' || tag === 'path' || tag === 'svg') {
384
+ _message.destroy();
385
+ }
365
386
  }
366
387
  });
367
388
  };
@@ -381,7 +402,7 @@ export var showAlert = function showAlert(text) {
381
402
  _Modal[type](_objectSpread({
382
403
  content: text,
383
404
  title: title,
384
- getContainer: getFullScreenElement() || document.body,
405
+ getContainer: getFullScreenElement() || (top || window).document.body,
385
406
  onOk: function onOk() {
386
407
  resolve(true);
387
408
  },
@@ -412,7 +433,7 @@ export var showConfirm = function showConfirm(text) {
412
433
  cancelButtonProps: {
413
434
  className: 'ant-btn-gray'
414
435
  },
415
- getContainer: getFullScreenElement() || document.body,
436
+ getContainer: getFullScreenElement() || (top || window).document.body,
416
437
  onOk: function onOk() {
417
438
  resolve(true);
418
439
  },
@@ -434,6 +455,7 @@ export var reLogin = function reLogin() {
434
455
  title: '登录状态已过期,请重新登录',
435
456
  okText: '重新登录',
436
457
  maskClosable: false,
458
+ getContainer: getFullScreenElement() || (top || window).document.body,
437
459
  afterClose: function afterClose() {
438
460
  timeout = false;
439
461
  (window.top || window).location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.0.33",
3
+ "version": "3.0.35",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -21,10 +21,11 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@ant-design/icons": "^4.3.0",
24
- "ls-pro-table": "^3.0.21",
25
- "ls-pro-form": "^3.0.7",
24
+ "ls-pro-table": "^3.0.23",
25
+ "ls-pro-form": "^3.0.9",
26
26
  "ls-pro-descriptions": "^3.0.1",
27
27
  "ls-pro-card": "^3.0.3",
28
+ "ls-pro-utils": "^3.0.6",
28
29
  "@babel/runtime": "^7.16.3",
29
30
  "classnames": "^2.2.6",
30
31
  "moment": "^2.27.0",