Files
copilot-toolbox-template-121/node_modules/@ant-design/pro-utils/es/pickProProps/index.js
2026-01-16 02:20:32 +00:00

15 lines
699 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var proFieldProps = "valueType request plain renderFormItem render text formItemProps valueEnum";
var proFormProps = "fieldProps isDefaultDom groupProps contentRender submitterProps submitter";
export function pickProProps(props) {
var customValueType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var propList = "".concat(proFieldProps, " ").concat(proFormProps).split(/[\s\n]+/);
var attrs = {};
Object.keys(props || {}).forEach(function (key) {
//如果是自定义的 valueType则不需要过滤掉全部传给使用者
if (propList.includes(key) && !customValueType) {
return;
}
attrs[key] = props[key];
});
return attrs;
}