@zat-design/sisyphus-react 3.13.2-beta.2 → 3.13.2-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.
- package/dist/index.esm.css +3 -0
- package/es/ProForm/utils/useWatch.js +19 -3
- package/es/ProTable/components/RenderTabs/index.js +7 -2
- package/es/ProTable/propsType.d.ts +6 -0
- package/es/style/theme/antd.less +5 -0
- package/lib/ProForm/utils/useWatch.js +19 -3
- package/lib/ProTable/components/RenderTabs/index.js +7 -2
- package/lib/ProTable/propsType.d.ts +6 -0
- package/lib/style/theme/antd.less +5 -0
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
@@ -5710,6 +5710,9 @@ input[type='button'] {
|
|
5710
5710
|
.ant-table .ant-empty-normal {
|
5711
5711
|
margin: calc(var(--zaui-space-size-lg, 32px) * var(--zaui-size, 1)) 0;
|
5712
5712
|
}
|
5713
|
+
.ant-table .ant-table-tbody .ant-table-cell-fix-left-last:after {
|
5714
|
+
width: 8px;
|
5715
|
+
}
|
5713
5716
|
.ant-table.pro-table-no-stripe .ant-table-tbody .ant-table-row {
|
5714
5717
|
background: #fff !important;
|
5715
5718
|
}
|
@@ -51,23 +51,39 @@ function useWatch(dependencies, form, wait) {
|
|
51
51
|
getInternalHooks = formInstance.getInternalHooks;
|
52
52
|
var _getInternalHooks = getInternalHooks(HOOK_MARK),
|
53
53
|
registerWatch = _getInternalHooks.registerWatch;
|
54
|
+
// 创建回调函数
|
54
55
|
var callback = function callback() {
|
56
|
+
// 只获取一次新值
|
55
57
|
var newValue = getFieldsValue(_dependencies);
|
56
58
|
var nextValueStr = stringify(newValue);
|
57
59
|
// Compare stringify in case it's nest object
|
58
60
|
if (valueStrRef.current !== nextValueStr) {
|
59
61
|
valueStrRef.current = nextValueStr;
|
60
|
-
|
62
|
+
// 关键修改:使用已获取的newValue,避免重复调用getFieldsValue
|
63
|
+
setValue(newValue);
|
61
64
|
}
|
62
65
|
};
|
63
66
|
// 增加防抖
|
67
|
+
var cancelDebounce = null;
|
64
68
|
if (wait) {
|
65
|
-
|
69
|
+
var debouncedCallback = debounce(callback, wait);
|
70
|
+
callback = debouncedCallback;
|
71
|
+
cancelDebounce = function cancelDebounce() {
|
72
|
+
return debouncedCallback.cancel();
|
73
|
+
};
|
66
74
|
}
|
75
|
+
// 注册监听
|
67
76
|
var cancelRegister = registerWatch(callback);
|
77
|
+
// 设置初始值
|
68
78
|
var initialValue = getFieldsValue(_dependencies);
|
69
79
|
setValue(initialValue);
|
70
|
-
|
80
|
+
// 清理函数
|
81
|
+
return function () {
|
82
|
+
cancelRegister();
|
83
|
+
if (cancelDebounce) {
|
84
|
+
cancelDebounce();
|
85
|
+
}
|
86
|
+
};
|
71
87
|
},
|
72
88
|
// We do not need re-register since namePath content is the same
|
73
89
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
@@ -16,7 +16,8 @@ var RenderTabs = function RenderTabs(props) {
|
|
16
16
|
transformResponse = props.transformResponse,
|
17
17
|
tabsProps = props.tabsProps,
|
18
18
|
name = props.name,
|
19
|
-
formTableProps = props.formTableProps
|
19
|
+
formTableProps = props.formTableProps,
|
20
|
+
transformParams = props.transformParams;
|
20
21
|
var _ref = formTableProps || {},
|
21
22
|
form = _ref.form,
|
22
23
|
onSearch = _ref.onSearch;
|
@@ -67,7 +68,11 @@ var RenderTabs = function RenderTabs(props) {
|
|
67
68
|
var fieldsValues = (form === null || form === void 0 ? void 0 : form.getFieldsValue()) || {};
|
68
69
|
setActiveKey(key);
|
69
70
|
form.setFieldValue(name, key);
|
70
|
-
|
71
|
+
var params = _objectSpread(_objectSpread({}, fieldsValues), {}, _defineProperty({}, name, key));
|
72
|
+
if (transformParams && typeof transformParams === 'function') {
|
73
|
+
params = transformParams(params);
|
74
|
+
}
|
75
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(params);
|
71
76
|
},
|
72
77
|
type: "card"
|
73
78
|
}, tabsProps), {}, {
|
@@ -337,6 +337,12 @@ export interface ProTableTabsType {
|
|
337
337
|
label: string;
|
338
338
|
value: string;
|
339
339
|
}[];
|
340
|
+
/**
|
341
|
+
* 转换查询参数
|
342
|
+
* @description 转换查询参数
|
343
|
+
* @default undefined
|
344
|
+
*/
|
345
|
+
transformParams?: (params: any) => any;
|
340
346
|
/**
|
341
347
|
* 枚举数据源转换
|
342
348
|
* @description 枚举数据源转换
|
package/es/style/theme/antd.less
CHANGED
@@ -107,6 +107,11 @@
|
|
107
107
|
.@{ant-prefix}-empty-normal {
|
108
108
|
margin: calc(var(--zaui-space-size-lg; 32px) * var(--zaui-size; 1)) 0;
|
109
109
|
}
|
110
|
+
.@{ant-prefix}-table-tbody{
|
111
|
+
.@{ant-prefix}-table-cell-fix-left-last:after{
|
112
|
+
width: 8px;
|
113
|
+
}
|
114
|
+
}
|
110
115
|
&.pro-table-no-stripe {
|
111
116
|
.@{ant-prefix}-table-tbody {
|
112
117
|
.@{ant-prefix}-table-row {
|
@@ -61,23 +61,39 @@ function useWatch(dependencies, form, wait) {
|
|
61
61
|
getInternalHooks = formInstance.getInternalHooks;
|
62
62
|
var _getInternalHooks = getInternalHooks(_FieldContext.HOOK_MARK),
|
63
63
|
registerWatch = _getInternalHooks.registerWatch;
|
64
|
+
// 创建回调函数
|
64
65
|
var callback = function callback() {
|
66
|
+
// 只获取一次新值
|
65
67
|
var newValue = getFieldsValue(_dependencies);
|
66
68
|
var nextValueStr = stringify(newValue);
|
67
69
|
// Compare stringify in case it's nest object
|
68
70
|
if (valueStrRef.current !== nextValueStr) {
|
69
71
|
valueStrRef.current = nextValueStr;
|
70
|
-
|
72
|
+
// 关键修改:使用已获取的newValue,避免重复调用getFieldsValue
|
73
|
+
setValue(newValue);
|
71
74
|
}
|
72
75
|
};
|
73
76
|
// 增加防抖
|
77
|
+
var cancelDebounce = null;
|
74
78
|
if (wait) {
|
75
|
-
|
79
|
+
var debouncedCallback = (0, _lodash.debounce)(callback, wait);
|
80
|
+
callback = debouncedCallback;
|
81
|
+
cancelDebounce = function cancelDebounce() {
|
82
|
+
return debouncedCallback.cancel();
|
83
|
+
};
|
76
84
|
}
|
85
|
+
// 注册监听
|
77
86
|
var cancelRegister = registerWatch(callback);
|
87
|
+
// 设置初始值
|
78
88
|
var initialValue = getFieldsValue(_dependencies);
|
79
89
|
setValue(initialValue);
|
80
|
-
|
90
|
+
// 清理函数
|
91
|
+
return function () {
|
92
|
+
cancelRegister();
|
93
|
+
if (cancelDebounce) {
|
94
|
+
cancelDebounce();
|
95
|
+
}
|
96
|
+
};
|
81
97
|
},
|
82
98
|
// We do not need re-register since namePath content is the same
|
83
99
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
@@ -20,7 +20,8 @@ var RenderTabs = function RenderTabs(props) {
|
|
20
20
|
transformResponse = props.transformResponse,
|
21
21
|
tabsProps = props.tabsProps,
|
22
22
|
name = props.name,
|
23
|
-
formTableProps = props.formTableProps
|
23
|
+
formTableProps = props.formTableProps,
|
24
|
+
transformParams = props.transformParams;
|
24
25
|
var _ref = formTableProps || {},
|
25
26
|
form = _ref.form,
|
26
27
|
onSearch = _ref.onSearch;
|
@@ -71,7 +72,11 @@ var RenderTabs = function RenderTabs(props) {
|
|
71
72
|
var fieldsValues = (form === null || form === void 0 ? void 0 : form.getFieldsValue()) || {};
|
72
73
|
setActiveKey(key);
|
73
74
|
form.setFieldValue(name, key);
|
74
|
-
|
75
|
+
var params = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, fieldsValues), {}, (0, _defineProperty2.default)({}, name, key));
|
76
|
+
if (transformParams && typeof transformParams === 'function') {
|
77
|
+
params = transformParams(params);
|
78
|
+
}
|
79
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(params);
|
75
80
|
},
|
76
81
|
type: "card"
|
77
82
|
}, tabsProps), {}, {
|
@@ -337,6 +337,12 @@ export interface ProTableTabsType {
|
|
337
337
|
label: string;
|
338
338
|
value: string;
|
339
339
|
}[];
|
340
|
+
/**
|
341
|
+
* 转换查询参数
|
342
|
+
* @description 转换查询参数
|
343
|
+
* @default undefined
|
344
|
+
*/
|
345
|
+
transformParams?: (params: any) => any;
|
340
346
|
/**
|
341
347
|
* 枚举数据源转换
|
342
348
|
* @description 枚举数据源转换
|
@@ -107,6 +107,11 @@
|
|
107
107
|
.@{ant-prefix}-empty-normal {
|
108
108
|
margin: calc(var(--zaui-space-size-lg; 32px) * var(--zaui-size; 1)) 0;
|
109
109
|
}
|
110
|
+
.@{ant-prefix}-table-tbody{
|
111
|
+
.@{ant-prefix}-table-cell-fix-left-last:after{
|
112
|
+
width: 8px;
|
113
|
+
}
|
114
|
+
}
|
110
115
|
&.pro-table-no-stripe {
|
111
116
|
.@{ant-prefix}-table-tbody {
|
112
117
|
.@{ant-prefix}-table-row {
|