Skip to main content

Module forms

Module forms 

Source
Expand description

表单控件组件。 表单控件组件

提供登录、注册、评论等页面共享的输入框、按钮与提示框样式常量与组件。

Re-exports§

pub use FormSelect_completions::Component::FormSelect;
pub use FormInput_completions::Component::FormInput;
pub use FormLabel_completions::Component::FormLabel;
pub use AlertBox_completions::Component::AlertBox;

Structs§

AlertBoxProps
Properties for the AlertBox component.
FormInputProps
Properties for the FormInput component.
FormLabelProps
Properties for the FormLabel component.
FormSelectProps
Properties for the FormSelect component.

Constants§

BUTTON_PRIMARY_CLASS
主按钮 CSS 类,用于表单提交等主操作按钮。
FORM_SELECT_COMPACT_CLASS
FormSelect 紧凑触发器样式:工具栏内联小下拉(自动刷新、导出格式等)。 自动宽度 + text-sm + 小圆角,chevron 与面板样式与默认表单款一致。
INPUT_CLASS
输入框基础 CSS 类,统一文本框、邮箱框、URL 框等样式。
INPUT_INLINE_CLASS
内联输入框 CSS 类:与 INPUT_CLASS 同主题,但用 flex-1 min-w-0 取代 w-full, 用于与按钮并排、需填充剩余宽度的场景(搜索栏、URL 输入栏等)。

Statics§

FORM_SELECT_ID 🔒
FormSelect 实例 id 计数器(跨泛型单例化全局唯一)。

Functions§

AlertBox
提示框组件,用于显示成功、错误等状态消息。
FormInput
表单输入框组件。
FormLabel
表单标签组件。
FormSelect
下拉选择框组件(自定义弹层,全主题化)。
should_flip 🔒
面板应向上展开的条件:视口下方空间不足,且上方空间比下方更宽余。
wrap_index 🔒
键盘导航的循环索引:在 len 个选项中从 cur 移动 delta(±1),越界回绕。