Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(component): search input support to specify validateInfo #167

Merged
merged 2 commits into from
Jun 7, 2021

Conversation

mortalYoung
Copy link
Collaborator

@mortalYoung mortalYoung commented Jun 4, 2021

简介

  • search 组件支持设置 validateInfo 属性,支持展示 info、warning、error 三种状态
  • 优化 search model 数据结构,以支持 input 框报错的时候可以展示 error 状态
  • 优化 search input 组件,保证 onSearchonChange 的参数一致
  • 新增 search input actionTool 的 checked 样式

主要变更

  • search 组件支持 validationInfo 属性,类型为 string | { type: keyof typeof InfoTypeEnum; text: string };;仅传入字符串时会默认用 info 状态做兜底展示
  • search model 数据结构新增 validationInfo 属性
  • search service 新增 validateValuesetValidateInfo 方法,前者用于判断当前输入框中的值是否合法,后者用于设置 validationInfo
  • 当搜索框触发 onSearch 事件时,通过 validateValue 方法判断当前 queryVal 的合法性,然后展示错误信息

Base automatically changed from refactor/searchTree to main June 6, 2021 13:51
@wewoor wewoor self-requested a review June 7, 2021 02:08
@wewoor wewoor added the enhancement New feature or request label Jun 7, 2021
@wewoor wewoor merged commit 8e40782 into main Jun 7, 2021
@wewoor wewoor deleted the feat/search-input branch June 7, 2021 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants