fix(auto-complete): children option type and export types (#1149)

* fix(auto-complete): `n-auto-complete` group should support common option

* feat(auto-complete): export `AutoCompleteOption(s)` & `AutoCompleteGroupOption`

* doc(auto-complete): update changelog

Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
equt 2021-09-11 20:58:08 +08:00 committed by GitHub
parent 1eb55b41e8
commit 7dc040b489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View File

@ -10,10 +10,12 @@
- `n-time-picker` add `input-readonly` prop, closes [#1120](https://github.com/TuSimple/naive-ui/issues/1120).
- `n-config-provider` add global config of the `Empty` component, closes [#1092](https://github.com/TuSimple/naive-ui/issues/1092).
- `n-select` add `on-update:show` prop.
- `n-auto-complete` exports `AutoCompleteOption`, `AutoCompleteOptions`, and `AutoCompleteGroupOption`.
### Fixes
- Fix `n-p` warns when `depth` is number.
- Fix `n-auto-complete`'s `children` option to allow `AutoCompleteOption`.
- Fix `n-select` can't override `n-empty`'s theme variables.
- Fix `n-dynamic-tags` add button is not disabled when it is disabled.
- Fix `n-select` closes menu when enter key is pressed in filterable mode without options data.

View File

@ -25,11 +25,13 @@
- `useDialog` 选项新增 `style` 属性,关闭 [#1054](https://github.com/TuSimple/naive-ui/issues/1054)
- `n-timeline` 新增 `icon` slot, 关闭 [#1096](https://github.com/TuSimple/naive-ui/issues/1096)
- `n-timeline` 新增 `icon-size` 属性
- `n-auto-complete` 导出 `AutoCompleteOption``AutoCompleteOptions`,以及 `AutoCompleteGroupOption`
### Fixes
- 修复 `n-step` 无法使用 `v-for` 的子元素
- 修复 `n-input-number``step` 不为小数时不能输入小数
- 修复 `n-auto-complete``children` 选项以允许 `AutoCompleteOption`
## 2.18.0 (2021-09-07)

View File

@ -1,2 +1,7 @@
export { default as NAutoComplete } from './src/AutoComplete'
export type { AutoCompleteProps } from './src/AutoComplete'
export type {
AutoCompleteOption,
AutoCompleteOptions,
AutoCompleteGroupOption
} from './src/interface'

View File

@ -3,7 +3,7 @@ import { SelectGroupOption, SelectBaseOption } from '../../select/src/interface'
export type AutoCompleteOption = SelectBaseOption<string, string>
export interface AutoCompleteGroupOption
extends Omit<SelectGroupOption, 'children'> {
children: string[]
children: AutoCompleteOptions
}
export type AutoCompleteOptions = Array<