@great-expectations/jsonforms-antd-renderers

中文文档
2.3.5发布于 2026/04/18MITTypeScriptESM + CJS构建来源已验证近 30 天下载 3.3万

jsonforms 声明形式框架的蚂蚁设计渲染器集

中文使用文档
文档目录8 节
  1. 开始
  2. 使用 AntD 渲染器
  3. 写入 UISchemas
  4. 捐款
  5. 第一次设置
  6. 作出改变
  7. 常规承诺
  8. 本地测试软件包

codecov pre-commit.ci status

蚂蚁设计渲染器 jsonforms

json形式 是“高效构建基于形式网络用户界面的申报框架” jsonforms 拥有多个用于不同框架和组件库的渲染软件包,这是其中的一个软件包. 您可以通过故事本预览渲染器 这里。 。 。 .

开始

npm install @great-expectations/jsonforms-antd-renderers

使用 AntD 渲染器

为了使用此软件包, 您需要从此软件包中导入渲染器注册项并提供给 @jsonforms/react JsonForms 组件 :

import { JsonForms } from "@jsonforms/react"
import {
  rendererRegistryEntries,
  cellRegistryEntries,
} from "@great-expectations/jsonforms-antd-renderers"

function MyForm({ data }: { data: Record<string, unknown> }) {
  return (
    <JsonForms
      data={data}
      schema={schema}
      renderers={rendererRegistryEntries}
      cells={cellRegistryEntries}
    />
  )
}

写入 UISchemas

此软件包扩展了类型和配置 jsonforms UISchemas 化学式写UISchema的时候,你会想 提供你的Jsonschema的类型给我们 UISchema 类型,以利用高级类型检查 & UI 配置。 参见我们的故事书(运行故事书的指示) Contributing),用于更多实例.

import { useState } from "react"
import { Form, Button } from "antd"
import { JsonForms } from "@jsonforms/react"
import {
  rendererRegistryEntries,
  UISchema,
} from "@great-expectations/jsonforms-antd-renderers"

const schema = {
  type: "object",
  properties: { password: { type: "string" } },
} as const
// Be sure to use an `as const` assertion so that UISchema
// can see the specific types of `type` fields within a schema.
// i.e. without `as const`, the value "object" is interpreted
// as a string type, and not the string literal type "object"

const uischema: UISchema<typeof schema> = {
  type: "VerticalLayout",
  elements: [
    {
      type: "Control",
      scope: "#/properties/password",
      // Properties like type: "password" here are unique to this renderer package.
      // This allows you more declarative control over how your forms render.
      // In this case, the password field will be rendered with AntD's password input component.
      options: { type: "password" },
    },
  ],
}

function MyForm() {
  const [data, setData] = useState<Record<string, unknown>>({})

  return (
    <Form onFinish={() => myApiCall(data)}>
      <JsonForms
        data={data}
        onChange={(result) => setData(result.data as Record<string, unknown>)}
        schema={schema}
        uischema={uischema}
        renderers={rendererRegistryEntries}
      />
      <Form.Item>
        <Button htmlType="submit">Submit</Button>
      </Form.Item>
    </Form>
  )
}

捐款

第一次设置

  • 安装节点.js( 目前只支持节点 v20)
  • 安装版本 小时 定义 packageManager 输入 package.json
  • 克隆此寄存器
  • 安装依赖性 : pnpm i --frozen-lockfile
  • 运行测试 : pnpm test
  • 运行测试和视图覆盖 :
    • pnpm test:cov
    • npx vite preview --outDir html
    • 在终端,类型 o + 键 enter 在浏览器中打开结果
  • 运行故事本 : pnpm storybook

作出改变

  • 更改代码
  • 运行测试 : pnpm test
  • 运行故事本 : pnpm storybook
  • 运行格式 : pnpm format:write
  • 运行林特 : pnpm lint
  • 提交更改

常规承诺

  • 我们用 语义释放 来发布我们的软件包,所以确保您的承诺遵守 常规承诺格式
  • 特别是承诺信息的形式 fix(<scope>): <short summary>, (中文(简体) ), feat(<scope>): <short summary>,或 BREAKING CHANGE: <short summary> 将引发释放. short summary 需要时间. scope 是可选的.

本地测试软件包

  • 从此目录创建可安装的 tarball 文件 : pnpm pack
  • 如果您先前安装了软件包, 您可能需要先删除: npm uninstall @great-expectations/jsonforms-antd-renderers 并可能清除您的软件包管理器缓存
  • 在您的工程中安装软件包 : npm install /path/to/jsonforms-antd-renderers-0.0.0-semantic-release.tgz

版本与发布记录

@great-expectations/jsonforms-antd-renderers 共发布 65 个版本,首次发布于 2024/03/12;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.3.5latest2026/04/186 个月前
2.3.42026/04/176 个月前
2.3.32026/04/177 个月前
2.3.22026/03/267 个月前
2.3.12026/03/078 个月前
2.3.02026/03/068 个月前

关于 @great-expectations/jsonforms-antd-renderers 的常见问题

@great-expectations/jsonforms-antd-renderers 是什么?

jsonforms 声明形式框架的蚂蚁设计渲染器集

如何安装 @great-expectations/jsonforms-antd-renderers?

在项目目录运行 npm install @great-expectations/jsonforms-antd-renderers,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@ant-design/icons(^5.3.0)、@jsonforms/core(^3.3.0)、@jsonforms/react(^3.3.0)、antd(^5.14.0)、dayjs(^1)、react(^17 || ^18)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@great-expectations/jsonforms-antd-renderers 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@great-expectations/jsonforms-antd-renderers 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@great-expectations/jsonforms-antd-renderers 可以商用吗?

@great-expectations/jsonforms-antd-renderers 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@great-expectations/jsonforms-antd-renderers 的下载量有多少?

根据 npm 官方下载统计,@great-expectations/jsonforms-antd-renderers 在 2026/10/17 – 2026/11/15 这 30 天内被下载 32,506 次,日均约 1,084 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@great-expectations/jsonforms-antd-renderers 还在维护吗?

最新版本 2.3.5 发布于 2026/04/18(6 个月前);至今共发布 65 个版本,其中过去 12 个月发布了 10 个;首次发布于 2024/03/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。