@zat-design/sisyphus-react 3.11.4-beta.1 → 3.11.4-beta.4

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.
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "kisstkondoros.vscode-codemetrics"
4
+ ]
5
+ }
@@ -4812,8 +4812,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4812
4812
  margin-left: var(--zaui-space-size-xs, 4px);
4813
4813
  }
4814
4814
  .pro-edit-table-drag table tr th.ant-table-selection-column.ant-table-cell-fix-left {
4815
- text-align: left;
4816
- padding-left: 52px;
4815
+ text-align: right;
4817
4816
  }
4818
4817
  .pro-edit-label {
4819
4818
  display: inline-block;
package/dist/less.esm.css CHANGED
@@ -4812,8 +4812,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4812
4812
  margin-left: var(--zaui-space-size-xs, 4px);
4813
4813
  }
4814
4814
  .pro-edit-table-drag table tr th.ant-table-selection-column.ant-table-cell-fix-left {
4815
- text-align: left;
4816
- padding-left: 52px;
4815
+ text-align: right;
4817
4816
  }
4818
4817
  .pro-edit-label {
4819
4818
  display: inline-block;
@@ -396,7 +396,6 @@
396
396
 
397
397
  .pro-edit-table-drag {
398
398
  table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-left{
399
- text-align: left;
400
- padding-left: 52px;
399
+ text-align: right;
401
400
  }
402
401
  }
@@ -6,13 +6,14 @@ import { useEffect } from 'react';
6
6
  import LazyLoad from 'react-lazyload';
7
7
  import { isBoolean } from 'lodash';
8
8
  import { useStep } from '../../index';
9
- import { getLoadedMap } from '../../utils';
10
9
  import ProCollapse from '../../../ProLayout/components/ProCollapse';
11
10
  var defaultLazyLoadConfig = {
12
11
  height: 100,
13
12
  offset: 100,
14
13
  once: true // Load only once upon first entry into the viewport
15
14
  };
15
+ // 设置step队列
16
+ var loadedMap = [];
16
17
  var ProStepItem = function ProStepItem(_ref) {
17
18
  var id = _ref.id,
18
19
  title = _ref.title,
@@ -27,7 +28,6 @@ var ProStepItem = function ProStepItem(_ref) {
27
28
  globalLazyLoad = _useStep.lazyLoad,
28
29
  registerMap = _useStep.registerMap;
29
30
  var lazyLoad = stepLazyLoad || globalLazyLoad;
30
- var loadedMap = getLoadedMap(registerMap);
31
31
  useEffect(function () {
32
32
  // Schedule registration to avoid re-render issues
33
33
  var timeoutId = setTimeout(function () {
@@ -38,13 +38,25 @@ var ProStepItem = function ProStepItem(_ref) {
38
38
  }, restProps));
39
39
  }, 0);
40
40
  return function () {
41
- return clearTimeout(timeoutId);
41
+ clearTimeout(timeoutId);
42
+ // 清空loadedMap
43
+ loadedMap.length = 0;
42
44
  };
43
45
  }, [id, title, lazyLoad, restProps, register]);
44
46
  var renderChildren = function renderChildren() {
45
- var _loadedMap$;
47
+ if (!(loadedMap === null || loadedMap === void 0 ? void 0 : loadedMap.length)) {
48
+ loadedMap.push({
49
+ id: id,
50
+ title: title
51
+ });
52
+ return children;
53
+ }
46
54
  // 第一个step不设置lasyload,防止懒加载不生效
47
- if (lazyLoad && (loadedMap === null || loadedMap === void 0 ? void 0 : loadedMap.length) && (loadedMap === null || loadedMap === void 0 ? void 0 : (_loadedMap$ = loadedMap[0]) === null || _loadedMap$ === void 0 ? void 0 : _loadedMap$.id) !== id) {
55
+ if (lazyLoad && (loadedMap === null || loadedMap === void 0 ? void 0 : loadedMap.length)) {
56
+ loadedMap.push({
57
+ id: id,
58
+ title: title
59
+ });
48
60
  var lazyLoadProps = isBoolean(lazyLoad) ? defaultLazyLoadConfig : lazyLoad;
49
61
  return _jsx(LazyLoad, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
50
62
  classNamePrefix: id,
@@ -396,7 +396,6 @@
396
396
 
397
397
  .pro-edit-table-drag {
398
398
  table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-left{
399
- text-align: left;
400
- padding-left: 52px;
399
+ text-align: right;
401
400
  }
402
401
  }
@@ -12,7 +12,6 @@ var _react = require("react");
12
12
  var _reactLazyload = _interopRequireDefault(require("react-lazyload"));
13
13
  var _lodash = require("lodash");
14
14
  var _index = require("../../index");
15
- var _utils = require("../../utils");
16
15
  var _ProCollapse = _interopRequireDefault(require("../../../ProLayout/components/ProCollapse"));
17
16
  var _excluded = ["id", "title", "collapse", "children", "lazyLoad"];
18
17
  var defaultLazyLoadConfig = {
@@ -20,6 +19,8 @@ var defaultLazyLoadConfig = {
20
19
  offset: 100,
21
20
  once: true // Load only once upon first entry into the viewport
22
21
  };
22
+ // 设置step队列
23
+ var loadedMap = [];
23
24
  var ProStepItem = function ProStepItem(_ref) {
24
25
  var id = _ref.id,
25
26
  title = _ref.title,
@@ -34,7 +35,6 @@ var ProStepItem = function ProStepItem(_ref) {
34
35
  globalLazyLoad = _useStep.lazyLoad,
35
36
  registerMap = _useStep.registerMap;
36
37
  var lazyLoad = stepLazyLoad || globalLazyLoad;
37
- var loadedMap = (0, _utils.getLoadedMap)(registerMap);
38
38
  (0, _react.useEffect)(function () {
39
39
  // Schedule registration to avoid re-render issues
40
40
  var timeoutId = setTimeout(function () {
@@ -45,13 +45,25 @@ var ProStepItem = function ProStepItem(_ref) {
45
45
  }, restProps));
46
46
  }, 0);
47
47
  return function () {
48
- return clearTimeout(timeoutId);
48
+ clearTimeout(timeoutId);
49
+ // 清空loadedMap
50
+ loadedMap.length = 0;
49
51
  };
50
52
  }, [id, title, lazyLoad, restProps, register]);
51
53
  var renderChildren = function renderChildren() {
52
- var _loadedMap$;
54
+ if (!(loadedMap === null || loadedMap === void 0 ? void 0 : loadedMap.length)) {
55
+ loadedMap.push({
56
+ id: id,
57
+ title: title
58
+ });
59
+ return children;
60
+ }
53
61
  // 第一个step不设置lasyload,防止懒加载不生效
54
- if (lazyLoad && (loadedMap === null || loadedMap === void 0 ? void 0 : loadedMap.length) && (loadedMap === null || loadedMap === void 0 ? void 0 : (_loadedMap$ = loadedMap[0]) === null || _loadedMap$ === void 0 ? void 0 : _loadedMap$.id) !== id) {
62
+ if (lazyLoad && (loadedMap === null || loadedMap === void 0 ? void 0 : loadedMap.length)) {
63
+ loadedMap.push({
64
+ id: id,
65
+ title: title
66
+ });
55
67
  var lazyLoadProps = (0, _lodash.isBoolean)(lazyLoad) ? defaultLazyLoadConfig : lazyLoad;
56
68
  return (0, _jsxRuntime.jsx)(_reactLazyload.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, lazyLoadProps), {}, {
57
69
  classNamePrefix: id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.11.4-beta.1",
3
+ "version": "3.11.4-beta.4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",