npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fishbelly/form-morph-antdv

v0.3.0

Published

form-morph 官方 Ant Design Vue 字段包,提供 28 种表单字段与布局容器

Readme

@fishbelly/form-morph-antdv

form-morph 的官方 Ant Design Vue 字段包,提供与 Arco 包一致的 28 种表单字段与布局容器。

安装

yarn add @fishbelly/form-morph @fishbelly/form-morph-antdv ant-design-vue dayjs

字段包与引擎按同一版本线发布,安装时请保持 @fishbelly/form-morph 与本包版本一致(当前 0.3.x);引擎注册插件时会校验插件 API 版本,不兼容将直接报错并提示升级。

import Antd from 'ant-design-vue';
import { createAntdvPack } from '@fishbelly/form-morph-antdv';
import '@fishbelly/form-morph/style.css';
import '@fishbelly/form-morph-antdv/style.css';
import { createFormMorph } from '@fishbelly/form-morph';

app.use(Antd);
const morph = createFormMorph({ plugins: [createAntdvPack()] });

主题

字段包不注入自身主题:表单内 Ant Design Vue 组件跟随宿主 ConfigProvider 的 theme.token(含 colorPrimary);请在自己的应用根节点完成主题配置。

字段

  • 基础:单行文本、多行文本、密码、数字
  • 选择:下拉、多选下拉、单选、复选、开关、滑动条、评分
  • 日期时间:日期、日期范围、时间
  • 高级:文件上传、级联选择、树选择、颜色选择、静态文本、公式字段
  • 容器:卡片、分组区块、分割线、子表单、标签页、折叠面板、步骤

值契约

  • 日期在内部使用 dayjs 展示,写回表单值为毫秒时间戳;日期范围为 [开始, 结束] 时间戳数组。
  • 时间字段存储 HH:mm:ss 字符串。
  • 上传值为文件对象数组:已上传文件保留接口返回数据(如 id、fileUrl),待上传文件保留 file(File 实例),提交流程由引擎统一处理待上传文件。
  • 下拉、级联、树选择共用 supportsOptions 数据源。

说明

  • Ant Design Vue 4.x 未提供颜色选择组件,color 字段使用原生取色器实现。
  • 上传字段支持 accept、maxSize、limit、multiple、showFileList;拖拽加入的文件默认进入待上传列表,由提交阶段统一上传。
  • 字段外壳提供必填标记、错误提示、帮助悬浮与标签宽度同步。
  • 表单外壳默认将引擎语言映射到 Ant Design Vue 语言包(内置 zh-CN / en-US),日期面板、空数据等组件内置文案随引擎语言切换;可用 syncLibraryLocale: false 交回宿主管理。

国际化

  • 引擎默认语言为 zh-CN;createFormMorph({ locale: 'en-US' }) 或运行时 morph.setLocale('en-US') 可切换,字段名称、分类、属性面板与校验提示同步切换;切回 zh-CN 后完整恢复。
  • 英文资源从子路径按需导入,不会进入本包主产物:
import { createFormMorph } from '@fishbelly/form-morph';
import enUS from '@fishbelly/form-morph/locales/en-US';
import designerEnUS from '@fishbelly/form-morph/designer/locales/en-US';
import antdvEnUS from '@fishbelly/form-morph-antdv/locales/en-US';

const morph = createFormMorph({
  locale: 'en-US',
  messages: { 'en-US': { ...enUS, ...designerEnUS } },
  plugins: [createAntdvPack({ locales: { 'en-US': antdvEnUS } })]
});
  • Ant Design Vue 组件内置文案(日期面板、空数据等)默认跟随引擎语言,zh-CN / en-US 已内置映射;追加其他语言用 uiLocales: { 'zh-TW': antdvZhTW },需要交给宿主管理时传 syncLibraryLocale: false,由宿主自行用 ConfigProvider 包裹。
  • 宿主可传 translate(key, defaultMessage, context) 接管翻译,返回 undefined 时回退内置资源;ValidationRule.message 与 messageProvider 优先级更高。
  • Schema 中的用户文案(label、placeholder、静态选项)不会自动翻译;设计器新建字段时按当前语言写入。