feat(ui): 新增列表选择 (UiListPicker) UI 组件#118
Open
woaiCarlos wants to merge 1 commit into
Open
Conversation
新增一个让用户从候选列表里挑选一个值的 UI 组件,类似 Material 3 的下拉菜单。 模块 id: vflow.ui.component.listpicker - key: 组件 ID / 变量名 - label: 选择框上方的标签 - options: 候选项,按换行符分隔 - default_value: 默认选中(按内容匹配,留空则取第一项) - trigger_event: 选中变化时是否触发事件 输出: - component: VUiComponent 对象 (含 .value 当前选中、.options 候选项列表) - id: 组件唯一标识 实现细节: - UiElement 新增 LIST_PICKER 枚举值 + 可选 options 字段 (默认 emptyList()) - DynamicUiRenderer 用 MaterialAutoCompleteTextView + 下拉箭头渲染 - 选中变化走 UiSessionBus 触发事件 - VUiComponent 暴露 ispicker、options 等属性 - 模块注册到 ModuleRegistry 测试: - 新增 UiListPickerModuleTest 覆盖 parseOptions 全部行为 - 解析方式: \n、\n、空行忽略、首尾空白 - 模块元数据、id、输入顺序兜底 - 共 9 个测试通过,64 个现有测试仍全绿 国际化: - 简体、繁体(隐含)/英文、日文 strings.xml 都补齐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
新增一个让用户从候选列表里挑选一个值的 UI 组件。底层使用 Material 3 的下拉菜单 (
MaterialAutoCompleteTextView+TextInputLayout)。模块 ID:
vflow.ui.component.listpicker参数
keylabeloptionsdefault_valuetrigger_event输出
component— VUiComponent 对象,暴露.value(当前选中)、.options(全部候选)、.ispicker/.isinput/.istext等类型判断id— 组件唯一标识改动
UiElement.kt:新增LIST_PICKER枚举 + 可选options: List<String>字段(带默认值,向后兼容 Parcelize 数据)VUiComponent.kt:asString()处理 LIST_PICKER;新增ispicker与options属性DynamicUiRenderer.kt:渲染LIST_PICKER(MaterialAutoCompleteTextView+ 下拉箭头),选中变化走UiSessionBus.emitEventUiListPickerModule.kt:新模块ModuleRegistry.kt:注册strings_module.xml:补齐所有 label / desc / 输入文案vtype_properties.xml:补齐vtype_uicomponent_ispicker与vtype_uicomponent_options测试
UiListPickerModuleTest,覆盖parseOptions全部行为\n分隔、空白裁剪、空行忽略、纯空白输入、\\n转义截图/演示
触发条件示例:
options填Apple\nBanana\nCherry🤖 Generated with MiniMax Code