Bricks Schema 中文文档:表单

📄 原始资料 (已截断)  |  展开查看原始 JSON(form.json){ “$schema”: “https://json-schema.org/draft/2020-12/schema”, “$id”: “bricks://elements/form”, “schemaVersion”: “2.3”, “type”: “object”, “title”: “Form”, “description”: “Schema for Bricks Form element”, “metadata”: { “name”: “form”, “category”: “genera…

📄 原始资料 (已截断)  |  展开查看原始 JSON(form.json)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "bricks://elements/form",
  "schemaVersion": "2.3",
  "type": "object",
  "title": "Form",
  "description": "Schema for Bricks Form element",
  "metadata": {
    "name": "form",
    "category": "general",
    "tag": "form",
    "nestable": false
  },
  "settings": {
    "fields": {
      "label": "Type",
      "default": "Choose files",
      "units": true,
      "options": {
        "email": "Email",
        "text": "Text",
        "textarea": "Textarea",
        "richtext": "Rich text",
        "tel": "Telephone",
        "number": "Number",
        "url": "URL",
        "image": "Image",
        "gallery": "Gallery",
        "checkbox": "Checkbox",
        "select": "Select",
        "radio": "Radio",
        "file": "Files",
        "datepicker": "Datepicker",
        "password": "Password",
        "rememberme": "Remember me",
        "html": "HTML",
        "hidden": "Hidden",
        "emailZh": "电子邮件",
        "textZh": "文本",
        "textareaZh": "文本域",
        "richtextZh": "富文本",
        "telZh": "电话",
        "numberZh": "数字",
        "urlZh": "URL",
        "imageZh": "图片",
        "galleryZh": "图片库",
        "checkboxZh": "复选框",
        "selectZh": "下拉选择",
        "radioZh": "单选",
        "fileZh": "文件",
        "datepickerZh": "日期选择器",
        "passwordZh": "密码",
        "remembermeZh": "记住我",
        "htmlZh": "HTML",
        "hiddenZh": "隐藏"
      },
      "css": [
        {
          "property": "font",
          "selector": ".password-toggle .show-password i"
        }
      ],
      "hasRequired": true,
      "valueSchema": {
        "type": "array",
        "items": {
          "type": "object"
        }
      },
      "controlType": "repeater",
      "labelZh": "类型"
    },
    "requiredAsterisk": {
      "label": "Show required asterisk",
      "valueSchema": {
        "type": "boolean"
      },
      "controlType": "checkbox",
      "labelZh": "显示必填星号"
    },
    "disableRequiredAsteriskInPlaceholder": {
      "label": "Disable required asterisk in placeholder",
      "hasRequired": true,
      "valueSchema": {
        "type": "boolean"
      },
      "controlType": "checkbox",
      "labelZh": "在占位符中禁用必填星号"
    },
    "showLabels": {
      "label": "Show labels",
      "valueSchema": {
        "type": "boolean"
      },
      "controlType": "checkbox",
      "labelZh": "显示标签"
    },
    "labelTypography": {
      "label": "Label typography",
      "css": [
        {
          "property": "font",
          "selector": "label"
        },
        {
          "property": "font",
          "selector": ".label"
        }
      ],
      "hasRequired": true,
      "valueSchema": {
        "type": "object",
        "description": "Typography settings",
        "properties": {
          "font-family": {
            "type": "string"
          },
          "font-size": {
            "type": "string"
          },
          "font-weight": {
            "type": [
              "string",
              "integer"
            ]
          },
          "font-style": {
            "type": "string",
            "enum": [
              "normal",
              "italic",
              "oblique"
            ]
          },
          "line-height": {
            "type": "string"
          },
          "letter-spacing": {
            "type": "string"
          },
          "text-align": {
            "type": "string",
            "enum": [
              "left",
              "center",
              "right",
              "justify"
            ]
          },
          "text-transform": {
            "type": "string",
            "enum": [
              "none",
              "uppercase",
              "lowercase",
              "capitalize"
            ]
          },
          "text-decoration": {
            "type": "string"
          },
          "color": {
            "description": "Color value in various formats",
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "hex": {
                    "type": "string",
                    "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
                  }
                },
                "required": [
                  "hex"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "rgb": {
                    "type": "string",
                    "pattern": "^rgba?\\("
                  }
                },
                "required": [
                  "rgb"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "hsl": {
                    "type": "string",
                    "pattern": "^hsla?\\("
                  }
                },
                "required": [
                  "hsl"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "raw": {
                    "type": "string",
                    "description": "Raw color value or CSS variable",
                    "descriptionZh": "原始颜色值或 CSS 变量。"
                  }
                },
                "required": [
                  "raw"
                ]
              }
            ],
            "descriptionZh": "各种格式的颜色值。"
          }
        },
        "descriptionZh": "排版设置。"
      },
      "controlType": "typography",
      "labelZh": "标签排版"
    },
    "placeholderTypography": {
      "label": "Placeholder typography",
      "css": [
        {
          "property": "font",
          "selector": "::placeholder"
        },
        {
          "property": "font",
          "selector": "select"
        }
      ],
      "valueSchema": {
        "type": "object",
        "description": "Typography settings",
        "properties": {
          "font-family": {
            "type": "string"
          },
          "font-size": {
            "type": "string"
          },
          "font-weight": {
            "type": [
              "string",
              "integer"
            ]
          },
          "font-style": {
            "type": "string",
            "enum": [
              "normal",
              "italic",
              "oblique"
            ]
          },
          "line-height": {
            "type": "string"
          },
          "letter-spacing": {
            "type": "string"
          },
          "text-align": {
            "type": "string",
            "enum": [
              "left",
              "center",
              "right",
              "justify"
            ]
          },
          "text-transform": {
            "type": "string",
            "enum": [
              "none",
              "uppercase",
              "lowercase",
              "capitalize"
            ]
          },
          "text-decoration": {
            "type": "string"
          },
          "color": {
            "description": "Color value in various formats",
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "hex": {
                    "type": "string",
                    "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
                  }
                },
                "required": [
                  "hex"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "rgb": {
                    "type": "string",
                    "pattern": "^rgba?\\("
                  }
                },
                "required": [
                  "rgb"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "hsl": {
                    "type": "string",
                    "pattern": "^hsla?\\("
                  }
                },
                "r

... (内容过长已截断,完整 JSON 见原始文件)

前言

Bricks Form 元素的 schema。

基本信息

  • 英文名称Form
  • 中文名称:表单
  • Schema IDbricks://elements/form
  • Schema 版本2.3
  • 类型object
  • 分类general
  • Tagform
  • 内部名称form

设置项

  • fields — 类型 (repeater)
  • requiredAsterisk — 显示必填星号 (checkbox)
  • disableRequiredAsteriskInPlaceholder — 在占位符中禁用必填星号 (checkbox)
  • showLabels — 显示标签 (checkbox)
  • labelTypography — 标签排版 (typography)
  • placeholderTypography — 占位符排版 (typography)
  • disableFormValidationOn — 禁用表单验证 (select)
  • disableBrowserValidation — 不要 (checkbox)
  • validateAllFieldsOnSubmit — 提交时验证所有字段 (checkbox)
  • fieldMargin — 间距 (spacing)
  • fieldPadding — 内边距 (spacing)
  • horizontalAlignFields — 对齐 (justify-content)
  • fieldBackgroundColor — 背景颜色 (color)
  • fieldBorder — 边框 (border)
  • fieldTypography — 排版 (typography)
  • submitButtonText — 文本 (text)
  • submitButtonSize — 尺寸 (select)
  • submitButtonStyle — 样式 (select)
  • submitButtonWidth — 宽度 (number)
  • submitButtonMargin — 外边距 (spacing)
  • submitButtonTypography — 排版 (typography)
  • submitButtonBackgroundColor — 背景 (color)
  • submitButtonBorder — 边框 (border)
  • submitButtonIcon — 图标 (icon)
  • submitButtonIconPosition — 图标位置 (select)
  • actions — 成功提交后的操作 (select)
  • successMessage — 成功消息 (text)
  • noticeCloseAfter — 关闭延迟 (number)
  • noticeCloseButton — 关闭按钮 (checkbox)
  • emailSubject — 主题 (text)
  • emailTo — 发送到邮箱 (select)
  • emailToCustom — 发送到自定义邮箱 (text)
  • emailBcc — 密件抄送邮箱 (text)
  • fromEmail — 发件人邮箱 (text)
  • fromName — 发件人姓名 (text)
  • replyToEmail — 回复邮箱 (text)
  • emailContent — 邮件内容 (textarea)
  • emailErrorMessage — 错误消息 (text)
  • htmlEmail — HTML 邮件 (checkbox)
  • webhooks — 端点 (repeater)
  • webhookMaxSize — 最大载荷大小 (number)
  • webhookRateLimit — 速率限制 (checkbox)
  • webhookRateLimitRequests — 每小时最大请求数 (number)
  • webhookErrorIgnore — 出错时继续 (checkbox)
  • webhookErrorMessage — 错误消息 (text)
  • confirmationEmailSubject — 主题 (text)
  • confirmationEmailTo — 发送到邮箱 (text)
  • confirmationFromEmail — 发件人邮箱 (text)
  • confirmationFromName — 发件人姓名 (text)
  • confirmationReplyToEmail — 回复邮箱 (text)
  • confirmationEmailContent — 邮件内容 (textarea)
  • confirmationEmailHTML — HTML 邮件 (checkbox)
  • redirectAdminUrl — 重定向到后台 (checkbox)
  • redirect — 自定义重定向 URL (text)
  • redirectTimeout — 延迟重定向(毫秒) (number)
  • mailchimpDoubleOptIn — 双重确认(Double opt-in) (checkbox)
  • mailchimpList — 列表 (select)
  • mailchimpGroups — 分组 (select)
  • mailchimpEmail — 字段 (select)
  • mailchimpFirstName — 名字 (select)
  • mailchimpLastName — 姓氏 (select)
  • mailchimpPendingMessage — 待处理消息 (text)
  • mailchimpErrorMessage — 错误消息 (text)
  • sendgridList — 列表 (select)
  • sendgridEmail — 字段 (select)
  • sendgridFirstName — 字段 (select)
  • sendgridLastName — 字段 (select)
  • sendgridPendingMessage — 待处理消息 (text)
  • sendgridErrorMessage — 错误消息 (text)
  • loginName — 字段 (select)
  • loginPassword — 字段 (select)
  • loginRemember — 字段 (select)
  • loginErrorMessage — 错误消息 (text)
  • registrationEmail — 字段 (select)
  • registrationPassword — 字段 (select)
  • registrationPasswordMinLength — 密码最小长度 (number)
  • registrationUserName — 字段 (select)
  • registrationFirstName — 字段 (select)
  • registrationLastName — 字段 (select)
  • registrationRole — 角色 (select)
  • registrationAutoLogin — 自动登录用户 (checkbox)
  • registrationWPNotification — 发送 WordPress 通知 (checkbox)
  • lostPasswordEmailUsername — 字段 (select)
  • resetPasswordNew — 字段 (select)
  • createPostType — 文章类型 (select)
  • createPostErrorMessage — 错误消息 (text)
  • createPostDisableCapabilityCheck — 禁用权限检查 (checkbox)
  • createPostTitle — 文章标题 (select)
  • createPostContent — 文章内容 (select)
  • createPostExcerpt — 文章摘要 (select)
  • createPostFeaturedImage — 特色图像 (select)
  • createPostStatus — 文章状态 (select)
  • createPostMeta — 文章元数据 (repeater)
  • createPostTaxonomies — 分类法 (repeater)
  • updatePostId — 要更新的文章 (select)
  • updatePostErrorMessage — 错误消息 (text)
  • updatePostDisableCapabilityCheck — 禁用权限检查 (checkbox)
  • updatePostTitle — 文章标题 (select)
  • updatePostContent — 文章内容 (select)
  • updatePostExcerpt — 文章摘要 (select)
  • updatePostFeaturedImage — 特色图像 (select)
  • updatePostStatus — 文章状态 (select)
  • updatePostMeta — 文章元数据 (repeater)
  • updatePostTaxonomies — 分类法 (repeater)
  • enableRecaptcha — reCAPTCHA(Google) (checkbox)
  • enableTurnstile — Turnstile(Cloudflare) (checkbox)
  • turnstileSize — Turnstile: (select)
  • turnstileTheme — Turnstile: (select)
  • turnstileLabel — Turnstile: (text)
  • enableHCaptcha — hCaptcha (select)
  • hCaptchaSize — hCaptcha: (select)
  • hCaptchaTheme — hCaptcha: (select)
  • submissionFormName — 表单名称 (text)
  • submissionSaveIp — 保存 IP 地址 (checkbox)
  • submissionMaxEntries — 最大条目数 (number)
  • submissionMaxEntriesErrorMessage — 错误消息 (text)
  • submissionDupEntries — 比较字段 (repeater)
  • submissionDupEntriesErrorMessage — 错误消息 (text)
  • passwordProtectionPassword — 字段 (select)
  • passwordProtectionErrorMessage — 错误消息 (text)
  • _content — 内容 (text)
  • _margin — 外边距 (spacing)
  • _padding — 内边距 (spacing)
  • _width — 宽度 (number)
  • _widthMin — 最小宽度 (number)
  • _widthMax — 最大宽度 (number)
  • _height — 高度 (number)
  • _heightMin — 最小高度 (number)
  • _heightMax — 最大高度 (number)
  • _aspectRatio — 宽高比 (text)
  • _position — 位置 (select)
  • _top — 顶部 (number)
  • _right — 右侧 (number)
  • _bottom — 底部 (number)
  • _left — 左侧 (number)
  • _zIndex — Z 索引 (number)
  • _order — 顺序 (number)
  • _display — 显示 (select)
  • _visibility — 可见性 (select)
  • _overflow — 溢出 (text)
  • _opacity — 不透明度 (number)
  • _cursor — 光标 (select)
  • _isolation — 隔离 (select)
  • _mixBlendMode — 混合模式 (select)
  • _pointerEvents — 指针事件 (text)
  • _perspective — 透视 (number)
  • _perspectiveOrigin — 透视原点 (text)
  • _gridItemJustifySelf — 自身水平对齐 (align-items)
  • _flexDirection — 方向 (direction)
  • _alignSelf — 自身对齐 (align-items)
  • _justifyContent — 主轴对齐 (justify-content)
  • _alignItems — 交叉轴对齐 (align-items)
  • _gap — 间距 (number)
  • _flexGrow — 放大比例 (number)
  • _flexShrink — 缩小比例 (number)
  • _flexBasis — 伸缩基准 (text)
  • _useMasonry — %s 布局 (checkbox)
  • _masonryColumn — 列数 (number)
  • _masonryGutter — 间距 (number)
  • _masonryHorizontalOrder — 水平顺序 (checkbox)
  • _masonryTransitionDuration — 过渡 (number)
  • _masonryTransitionMode — 显现动画 (select)
  • _typography — _typography (typography)
  • _background — _background (background)
  • _shapeDividers — 自定义形状 (repeater)
  • _gradient — _gradient (gradient)
  • _border — 边框 (border)
  • _boxShadow — 盒子阴影 (box-shadow)
  • _transform — 变换 (transform)
  • _transformOrigin — 变换原点 (text)
  • _motionElementParallax — 元素视差 (checkbox)
  • _motionElementParallaxSpeedX — 水平速度 (number)
  • _motionElementParallaxSpeedY — 垂直速度 (number)
  • _motionBackgroundParallax — 背景视差 (checkbox)
  • _motionBackgroundParallaxSpeed — 背景速度 (number)
  • _motionStartVisiblePercent — 视差起点 (number)
  • _cssCustom — 自定义 CSS (code)
  • _cssClasses — CSS 类 (text)
  • _cssId — CSS ID (text)
  • _cssFilters — CSS 滤镜 (filters)
  • _cssTransition — 过渡 (text)
  • _attributes — 姓名 (repeater)
  • _scrollSnapType — 类型 (select)
  • _scrollSnapAlign — 对齐 (select)
  • _scrollSnapStop — 停止 (select)

补充说明

更多细节可参考 Bricks 官方 Academy 文档