@hzab/list-render 1.10.20-alpha.5 → 1.10.20-alpha.6
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/package.json
CHANGED
|
@@ -79,6 +79,7 @@ export const EditableCell: React.FC<EditableCellProps> = ({
|
|
|
79
79
|
const editOpt = { index, field, fieldRef };
|
|
80
80
|
|
|
81
81
|
const form = useForm();
|
|
82
|
+
// 表单项禁用状态
|
|
82
83
|
if (form.fields[name]) {
|
|
83
84
|
form.fields[name].pattern = disabled || !editing ? "readPretty" : field?.["x-pattern"] ?? "editable";
|
|
84
85
|
}
|
|
@@ -126,8 +127,6 @@ export const EditableCell: React.FC<EditableCellProps> = ({
|
|
|
126
127
|
record,
|
|
127
128
|
index,
|
|
128
129
|
},
|
|
129
|
-
// 外部配置的禁用状态
|
|
130
|
-
"x-pattern": disabled || !editing ? "readPretty" : field?.["x-pattern"] ?? "editable",
|
|
131
130
|
// 外部配置的表单显隐状态,强制为 显示
|
|
132
131
|
"x-display": "visible",
|
|
133
132
|
},
|
|
@@ -142,7 +142,10 @@ const TableRender = forwardRef(function (props, tableRef) {
|
|
|
142
142
|
const comName = field["x-component"];
|
|
143
143
|
|
|
144
144
|
const decoratorProps = field["x-decorator-props"] || {};
|
|
145
|
-
let _title = title;
|
|
145
|
+
let _title = isFunction(title) ? title() : title;
|
|
146
|
+
if (_colConf?.title) {
|
|
147
|
+
_title = isFunction(_colConf?.title) ? _colConf?.title() : _colConf?.title;
|
|
148
|
+
}
|
|
146
149
|
if (decoratorProps.tooltip) {
|
|
147
150
|
_title = (
|
|
148
151
|
<span className="col-title-tooltip-wrap inline-block-max-w">
|
|
@@ -230,8 +233,8 @@ const TableRender = forwardRef(function (props, tableRef) {
|
|
|
230
233
|
..._colConf,
|
|
231
234
|
onCell: (record, rowIndex) =>
|
|
232
235
|
_colConf?.onCell?.({ ...record, _field: { ...field, ...(fieldSchemas?.[name] || {}) } }, rowIndex) || {},
|
|
233
|
-
// 函数式传入,解决 title ReactNode
|
|
234
|
-
title: () =>
|
|
236
|
+
// 函数式传入,解决 title ReactNode 传入报错问题(table 组件内部对 columns 进行 lodash.deepClone 导致 ReactNode 变成对象无法正常渲染) Uncaught TypeError: this.queryFeedbacks is not a function
|
|
237
|
+
title: () => _title,
|
|
235
238
|
key: name,
|
|
236
239
|
dataIndex: name,
|
|
237
240
|
render: getColRender(colRender),
|