Skip to content

Replace Naive UI form container and validation plumbing #3019

@nighca

Description

@nighca

Background

As part of #3017, the first sub-area to split out is the form infrastructure itself.

Current dependency points include:

  • src/components/ui/form/UIForm.vue
  • src/components/ui/form/UIFormItem.vue
  • src/components/ui/form/UIFormItemInternal.vue

Problem

This part is more than a thin wrapper over naive-ui.

Current implementation details include:

  • UIForm wraps NForm
  • UIFormItem wraps NFormItem
  • UIFormItemInternal imports formItemInjectionKey from naive-ui/es/_mixins/use-form-item
  • we hijack the internal form-item injection to intercept blur/input behavior
  • validation timing includes custom blur delay, debounced input validation, and IME composition handling

This means the form infrastructure depends not only on public naive-ui components, but also on internal APIs that are especially fragile.

Goal

Replace the naive-ui form container / form item infrastructure with an internal implementation that preserves the behavior expected by the rest of XBuilder.

Scope

  • replace NForm usage in UIForm
  • replace NFormItem usage in UIFormItem
  • remove the dependency on formItemInjectionKey and other naive-ui internal plumbing
  • preserve current validation behavior, including submit flow, validation state display, blur/input-triggered validation, and IME-safe handling

Notes

This issue is about form orchestration and validation plumbing. Specific input controls should be handled in separate child issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions