# @bigbinary/neeto-form-frontend 中文文档

规范地址：https://npmcn.com/package/%40bigbinary/neeto-form-frontend/

版本：4\.6\.4
npm 元数据更新时间：2026-11-05T10:33:38.134Z
中文译文更新时间：2026-11-08T02:07:16.519Z
软件包许可：UNLICENSED

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bigbinary/neeto-form-frontend
原文对照：https://npmcn.com/package/%40bigbinary/neeto-form-frontend/?lang=original
项目主页：https://github.com/bigbinary/neeto-form-nano

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：6.2 MB，170 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.13
- 运行依赖：0 个
- peer 依赖：qs 6\.16\.2，url 0\.11\.4，yup 0\.32\.11，antd 5\.22\.1，util ^0\.12\.5，uuid 14\.0\.0，axios 1\.20\.0，dayjs 1\.11\.10，ramda 0\.29\.0，react 18\.3\.1，buffer ^6\.0\.3，formik 2\.4\.6，i18next 22\.5\.1，zustand 4\.4\.2，dompurify 3\.4\.17，js-logger 1\.6\.1，react-dom 18\.3\.1，classnames 2\.5\.1，stream-http 3\.2\.0，tailwindcss 3\.4\.14，lucide-react 0\.577\.0，react-helmet ^6\.1\.0，react-select 5\.6\.0，framer-motion 11\.2\.14，os-browserify 0\.3\.0，react-i18next 12\.3\.1，vm-browserify 1\.1\.2，@babel/runtime 7\.29\.7，react-dropzone 14\.3\.8，react-toastify 8\.0\.2，tty-browserify 0\.0\.1，path-browserify ^1\.0\.1，https-browserify 1\.0\.0，mixpanel-browser ^2\.45\.0，react-router-dom 5\.3\.3，@hello-pangea/dnd 16\.3\.0，crypto-browserify 3\.12\.1，libphonenumber-js 1\.11\.14，source-map-loader 4\.0\.1，stream-browserify ^3\.0\.0，@bigbinary/neetoui 8\.8\.3，@honeybadger-io/js 6\.10\.1，@rails/activestorage 7\.0\.8-3，@bigbinary/neeto-cist 1\.0\.17，@honeybadger-io/react 6\.1\.25，@tanstack/react-query 5\.59\.20，@bigbinary/neeto-atoms 1\.1\.6，@bigbinary/neeto-icons 1\.20\.89，react-google-recaptcha ^3\.1\.0，@bigbinary/neeto-hotkeys 1\.0\.9，@bigbinary/neeto-molecules 5\.12\.1，@tailwindcss/container-queries ^0\.1\.1，@tanstack/react-query-devtools 5\.59\.20，@bigbinary/neeto-editor-frontend 2\.5\.0，@bigbinary/neeto-commons-frontend 4\.15\.0，@bigbinary/neeto-filters-frontend 4\.7\.1，@bigbinary/neeto-image-uploader-frontend 4\.1\.16
- 首次发布：2023-01-05T13:37:13.121Z
- 最新版本发布：2026-11-05T10:33:37.880Z
- 近 30 天下载量：13754（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：363（近 12 个月 125 个）

## 中文简介

Neeto 格式引擎前端

## 安装

```sh
npm install @bigbinary/neeto-form-frontend
```

也可以使用：`pnpm add @bigbinary/neeto-form-frontend`、`yarn add @bigbinary/neeto-form-frontend`、`bun add @bigbinary/neeto-form-frontend`

## README

# {\\fn黑体\\fs22\\bord1\\shad0\\3ahbe\\4ah00\\fscx67\\fscy66\\2chffffff\\3ch808080}我需要表态 -nano {\\fn黑体\\fs22\\bord1\\shad0\\3ahbe\\4ah00\\fscx67\\fscy66\\2chffffff\\3ch808080}

这个 `neeto-form-nano` 允许我们在需要的应用程序中构建表格。 这个 纳米出口 `@bigbinary/neeto-form-frontend` 国家防范机制一揽子计划 `neeto-form-engine` 铁路发动机.

见 [此页面](https://github.com/search?q=org%3Abigbinary+%22neeto-form-engine+%28%22&type=code) 要使用此纳米查找主机应用程序 。 纳米的改变应该是 向所有人推广,尤其是移民...

# 目录

1.  [用主机应用程序开发](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/#readme-development-with-host-application)
    -   [发动机](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/#readme-engine)
    -   [前端软件包](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/#readme-frontend-package)
        -   [安装](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/#readme-installation-1)
        -   [发展指示](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/#readme-instructions-for-development)
        -   [使用量](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/#readme-usage)
2.  [出版指令](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/#readme-instructions-for-publishing)

# 用主机应用程序开发

## 发动机

引擎在后端添加窗体设置, 并允许我们在任意 型号。 它还储存提交材料.

### 安装

1.  将此行添加到您的应用程序的 Gemfile 中 :
    
    ```ruby
    source "NEETO_GEM_SERVER_URL" do
      # ...existing gems
    
      gem 'neeto-form-engine'
    
      # Use this for development:
      # gem 'neeto-form-engine', path: "../neeto-form-nano"
    end
    ```
    
2.  然后执行:
    
    ```shell
    bundle install
    ```
    
3.  安装迁移
    
    ```shell
    bundle exec rails neeto_form_engine:install:migrations
    ```
    
4.  运行迁移
    
    ```shell
    bundle exec rails db:migrate
    ```
    
5.  将此行添加到您的应用程序 `config/routes.rb` 文档.
    
    ```ruby
    mount NeetoFormEngine::Engine, at: "/neeto_form"
    ```
    
6.  创建文件 `neeto_form_engine.rb` 下级 `config/initializers` 提供 `owner_class` 资料
    
    ```ruby
    NeetoFormEngine.owner_class = "Organization"
    ```
    
7.  配置要在下面添加到提供的所有者类的模型
    
    ```ruby
    has_many :forms, class_name: "::NeetoFormEngine::Form", as: :owner
    ```
    
8.  配置在范围提交记录中添加以下关联的模型 (可选)
    
    ```ruby
    has_one :submission, class_name: "::NeetoFormEngine::Submission", as: :record
    ```
    
9.  配置将添加到关联后附加窗体的模型( 可选)
    
    ```ruby
    has_one :form, class_name: "::NeetoFormEngine::Form", as: :attachable
    ```
    

### 自定义

#### `NeetoFormEngine::Customizable::Forms::Createable`

引擎支持自定义默认行为 `Forms::CreateService` 将支持的方法置于这一关切之上.

#### 可用方法:

1.  `create_default_questions!`: 如果你想使用自定义逻辑来创建 默认问题,您可以使用这种方法指定它们. `owner`, (中文(简体) ), `form` 财务报告和审定财务报表 `params` 将在全球范围内提供.
2.  `additional_form_params`: 如果您想要包含附加属性, 请在 创建窗体,您可以使用这种方法指定。 这需要一个论据 `params` 它将是从前端传出的形式参数.

#### `NeetoFormEngine::Customizable::Questions::Createable`

引擎支持自定义默认行为 `Questions::CreateService` 将支持的方法置于这一关切之上.

#### 可用方法:

1.  `create_question!`: 此方法收到一个参数 `params` 包含 从前端传出的问题参数.
2.  `additional_question_params`:如果想要包含附加属性 在创建问题时,您可以使用这种方法指定问题。 这需要 一个论据 `params` 该参数将是从 前端,请说.

#### `NeetoFormEngine::Customizable::Questions::Updateable`

引擎支持自定义默认行为 `Questions::UpdateService` 以压倒此中支持的常数 关心.

#### 可用常数 :

1.  `EXCLUDED_UPDATE_PARAMS`:如果您包括了除 `kind` 用于非有效实体属性的额外用途,它们 需要指定为 `EXCLUDED_UPDATE_PARAMS`。 。 。 .

#### `NeetoFormEngine::Customizable::QuestionResponses::Createable`

引擎支持自定义默认行为 `QuestionResponses::CreateService` 将支持的方法放在首位 关心.

#### 可用方法:

1.  `additional_initialization_logic`: 如果您想要初始化额外内容 变量,您可以使用这种方法指定它们.
2.  `additional_process_actions`: 如果您想要执行任何附加动作 在交易块外,您可以覆盖此方法.
3.  `additional_create_submission_actions`: 您可以使用这种方法指定 创建提交文件后需要执行的任何附加逻辑.
4.  `additional_create_response_actions`: 如果您想要执行一些附加 对于每个响应,您可以使用这种方法指定它们. 此方法收到 `question` 财务报告和审定财务报表 `response_param` 从 前端作为参数.

### 设置谷歌 reCAPTCHA

1.  注册一个 API 密钥对 [官方网站 (简体中文)](http://www.google.com/recaptcha/admin)。 。 。 .
    
2.  配置以下内容 `environment variables` 财务报告和审定财务报表 `secrets` 带合适的 数值
    
    -   下 `.env` 文件 :
        
        ```yaml
        FORM_NANO_RECAPTCHA_V2_SITE_KEY=# Value from Google cloud console
        FORM_NANO_RECAPTCHA_V2_SECRET_KEY=# Value from Google cloud console
        ```
        
    -   下 `secrets.yml` 文件 :
        
        ```yaml
        form_nano:
          recaptcha_v2:
            site_key: <%= ENV["FORM_NANO_RECAPTCHA_V2_SITE_KEY"] %>
            secret_key: <%= ENV["FORM_NANO_RECAPTCHA_V2_SECRET_KEY"] %>
        ```
        
3.  将站点密钥包含在 `global_props`
    
    ```ruby
    module ApplicationHelper
      def get_client_props
        # other variables
        custom_props = {
          # other props
          form_nano_recaptcha_v2_site_key: Rails.application.vault.form_nano.dig(:recaptcha_v2, :site_key)
        }
      end
    end
    ```
    

## 前端软件包

前端软件包允许我们创建 横跨neto产品的形式.

### 安装

1.  安装国家预防机制软件包
    
    ```zsh
    yarn add @bigbinary/neeto-form-frontend
    ```
    
2.  前端软件包有几种对等依赖关系,这些依赖关系是: 软件包的正常运作。 使用 : 以下命令:
    
    ```zsh
    yarn add @bigbinary/neetoui @bigbinary/neeto-icons ramda@^0.28.0 classnames@^2.3.1 formik@2.2.9 @bigbinary/neeto-commons-frontend react-google-recaptcha
    ```
    
3.  从以下位置导入样式表 :
    
    ```scss
    @import "@bigbinary/neeto-form-frontend/dist/main.css";
    ```
    

### 发展指示

检查 [前端软件包开发指南](https://neetozone.neetokb.com/p/a-d34cb4b0) 用于开发前端软件包的分步指令.

### 使用量

您可以在这里了解更多关于用法:

1.  [构成部分](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/docs/frontend/components.md)
2.  [钩子](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/docs/frontend/hooks.md)
3.  [电子邮件验证](https://npmcn.com/package/%40bigbinary/neeto-form-frontend/docs/email-verification.md)

# 出版指令

咨询 [构建和释放软件包](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages) 关于如何出版的详细指南.

## 常见问题

### @bigbinary/neeto-form-frontend 是什么？

Neeto 格式引擎前端

### 如何安装 @bigbinary/neeto-form-frontend？

在项目目录运行 npm install @bigbinary/neeto-form-frontend，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：qs（6\.16\.2）、url（0\.11\.4）、yup（0\.32\.11）、antd（5\.22\.1）、util（^0\.12\.5）、uuid（14\.0\.0）、axios（1\.20\.0）、dayjs（1\.11\.10）、ramda（0\.29\.0）、react（18\.3\.1）、buffer（^6\.0\.3）、formik（2\.4\.6）、i18next（22\.5\.1）、zustand（4\.4\.2）、dompurify（3\.4\.17）、js-logger（1\.6\.1）、react-dom（18\.3\.1）、classnames（2\.5\.1）、stream-http（3\.2\.0）、tailwindcss（3\.4\.14）、lucide-react（0\.577\.0）、react-helmet（^6\.1\.0）、react-select（5\.6\.0）、framer-motion（11\.2\.14）、os-browserify（0\.3\.0）、react-i18next（12\.3\.1）、vm-browserify（1\.1\.2）、@babel/runtime（7\.29\.7）、react-dropzone（14\.3\.8）、react-toastify（8\.0\.2）、tty-browserify（0\.0\.1）、path-browserify（^1\.0\.1）、https-browserify（1\.0\.0）、mixpanel-browser（^2\.45\.0）、react-router-dom（5\.3\.3）、@hello-pangea/dnd（16\.3\.0）、crypto-browserify（3\.12\.1）、libphonenumber-js（1\.11\.14）、source-map-loader（4\.0\.1）、stream-browserify（^3\.0\.0）、@bigbinary/neetoui（8\.8\.3）、@honeybadger-io/js（6\.10\.1）、@rails/activestorage（7\.0\.8-3）、@bigbinary/neeto-cist（1\.0\.17）、@honeybadger-io/react（6\.1\.25）、@tanstack/react-query（5\.59\.20）、@bigbinary/neeto-atoms（1\.1\.6）、@bigbinary/neeto-icons（1\.20\.89）、react-google-recaptcha（^3\.1\.0）、@bigbinary/neeto-hotkeys（1\.0\.9）、@bigbinary/neeto-molecules（5\.12\.1）、@tailwindcss/container-queries（^0\.1\.1）、@tanstack/react-query-devtools（5\.59\.20）、@bigbinary/neeto-editor-frontend（2\.5\.0）、@bigbinary/neeto-commons-frontend（4\.15\.0）、@bigbinary/neeto-filters-frontend（4\.7\.1）、@bigbinary/neeto-image-uploader-frontend（4\.1\.16）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bigbinary/neeto-form-frontend 支持 TypeScript 吗？

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

### @bigbinary/neeto-form-frontend 支持 ESM 还是 CommonJS？

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

### @bigbinary/neeto-form-frontend 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22\.13。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @bigbinary/neeto-form-frontend 可以商用吗？

@bigbinary/neeto-form-frontend 使用 UNLICENSED 许可。作者声明为 UNLICENSED，即不授予公开使用许可（与公共领域的 Unlicense 不同）。使用前需获得作者授权。以上为概括，不构成法律意见，请以许可原文为准。

### @bigbinary/neeto-form-frontend 的下载量有多少？

根据 npm 官方下载统计，@bigbinary/neeto-form-frontend 在 2026/10/08 – 2026/11/06 这 30 天内被下载 13,754 次，日均约 458 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @bigbinary/neeto-form-frontend 还在维护吗？

最新版本 4\.6\.4 发布于 2026/11/05（3 天前）；至今共发布 363 个版本，其中过去 12 个月发布了 125 个；首次发布于 2023/01/05。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

