
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@bmstravel/form-core
Advanced tools
A react component for rendering web forms from JSON schema using HTML components
(JSON Schema)的前端表单渲染引擎sdk,使用HTML原生components,仅处理联动等业务逻辑,不包含UI组件。
A React component for rendering web forms from JSON schema using HTML components
查看文档 https://scalable-form-platform.github.io/#/
使用 npm 安装
npm i scalable-form-core -S
如果你的网络环境不佳,推荐使用 cnpm。
import ScalableForm from "scalable-form-core";
在第一个例子中,我们需要渲染一个表单,支持用户填写name,并自行选择所在城市。 注意,scalable-form是一套基于表单数据协议(JSONSchema)的动态表单解决方案。所以我们需要按照react-jsonschema-form的规则书写一下表单规则描述(schema),并且将schema作为scalable-form的props转入组件。
写这个schema会很繁琐,不过放心,scalable-form的一大创新点就在于支持使用可视化的编排组件editor编排产生这个schema,您可以访问这里,查看editor的使用方法
import React from "react";
import ScalableForm from "scalable-form-core";
import "./styles.css";
export default class FormExample extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
formData: {
name: "",
city: "hangzhou"
}
};
this.jsonSchema = {
title: "Scalable Form render sdk with Ant Design components",
description: "",
type: "object",
required: ["name"],
properties: {
name: {
type: "string",
title: "名称",
default: "",
maxLength: 15
},
city: {
type: "string",
title: "请选择城市",
default: "",
enum: ["beijing", "shanghai", "hangzhou"],
enumNames: ["北京", "上海", "杭州"]
}
}
};
this.uiSchema = {
name: {
"ui:help": '关于"名称"字段的帮助说明',
"ui:options": {
placeholder: "请输入名称"
}
},
city: {
"ui:widget": "radio",
"ui:options": {
vertical: false,
validate: [
{
type: "empty",
message: "请选择"
}
]
}
}
};
}
handleChanged = (formData, bizData) => {
console.log("ScalableForm Changed!", formData);
console.log("ScalableForm Changed!", bizData);
this.setState({
formData: { ...formData }
});
};
handleSubmit = (formData, bizData) => {
console.log("ScalableForm Submitted!", formData);
console.log("ScalableForm Submitted!", bizData);
};
render() {
return (
<div className="scalable-form-demo-element">
<ScalableForm
jsonSchema={this.jsonSchema} //jsonSchema用于表述表单字段信息
uiSchema={this.uiSchema} //uiSchema用于控制表单字段的UI组件
formData={this.state.formData} //formData是表单中填写的字段数据
onChange={this.handleChanged}
onSubmit={this.handleSubmit}
/>
</div>
);
}
}
我们使用Lerna来进行包管理,所以本仓库会发布多个包到npm,包括:
This repository is a monorepo that we manage using Lerna. That means that we actually publish several packages to npm from the same codebase, including:
FAQs
A react component for rendering web forms from JSON schema using HTML components
We found that @bmstravel/form-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.