feat(eagle): add FileSelector component - #1309
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| fileList, | ||
| setFileList, | ||
| validate, | ||
| disableRemove: disableRemoveList, |
There was a problem hiding this comment.
🟡 MEDIUM - disabled 状态下仍然可以移除已有文件
这里传给 Dragger 的 disableRemove 只看 disableRemoveList,下面 UploadFileList 也是同样处理。结果是 <LocalUpload disabled fileList={...}> 会禁用上传入口,但已有文件上的删除图标仍可点击并触发 setFileList/onRemove。这和禁用态语义不一致,也和本 PR 里 UrlUpload 使用 disabled || disableRemoveList 的处理不一致。
建议把两处都改成 disabled || disableRemoveList,并补一个 disabled + existing file 的回归测试。
| import { FileSelectorWrapperStyle } from "./FileSelector.style"; | ||
| import type { FileSelectorMode, FileSelectorProps } from "./FileSelector.type"; | ||
|
|
||
| const LOCAL_MODE_LABEL = "从本地选择"; |
There was a problem hiding this comment.
🟡 MEDIUM - 新组件默认可见文案没有走 parrot i18n
FileSelector 是导出的基础组件,这些默认 segment label 和 tooltip 会直接展示给最终用户;当前即使应用语言是 en-US,这里仍会显示中文。LocalUpload/UrlUpload 已经通过 useParrotTranslation() 读取 components.* 文案,这里也应补对应的 parrot key,例如 components.file_selector_local、components.file_selector_url、components.file_selector_clear_url_first、components.file_selector_remove_file_first,再从 locale 文件提供中英文默认值。
477bfb6 to
95ff606
Compare
变更内容
验证