fix: grid-layout-form 类型精化——widget 返回 JSX.Element|null,消除 any 类型

This commit is contained in:
2026-09-22 16:17:03 +08:00
parent 1726a18093
commit f9d1b01f18
2 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -836,7 +836,7 @@ const $r = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb
const o = Lr(t, e), [a, l] = Ui(o, r, n, i), [c, u] = L();
return z(() => {
a && X.getWidgetComponent(a).then(({ defaultProps: p = {}, default: m }) => ({ default: Wi(m, p, i) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(E.createElement(p.default, s)));
}, [a]), c && E.cloneElement(c, { ...s, ...l });
}, [a]), c ? E.cloneElement(c, { ...s, ...l }) : null;
}, Wi = (t, e = {}, r = null) => (n) => {
const { type: i, code: s, label: o, noStyle: a, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: w, $isReserved: f, initialValue: C, initialValueLanguage: b, ...S } = y.omit(y.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Li(Object.assign({}, m, u ? { required: !0 } : {}), s, i), $ = W(() => {
const T = Object.keys((e == null ? void 0 : e.extras) || {});