Merge pull request #197 from TuSimple/main

sync main
This commit is contained in:
07akioni 2021-06-19 02:38:27 +08:00 committed by GitHub
commit eb727b1cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 11 deletions

View File

@ -1,6 +1,6 @@
# CHANGELOG
## Pending
## 2.12.1
### Feats
@ -9,6 +9,7 @@
- `n-input` add `show-password-toggle` prop.
- `n-popselect` support class attr.
- `n-select` add `render-label` prop.
- `n-popselect` add `render-label` prop.
### Fixes

View File

@ -1,6 +1,6 @@
# CHANGELOG
## Pending
## 2.12.1
### Feats
@ -9,6 +9,7 @@
- `n-input` 新增 `show-password-toggle` 属性
- `n-popselect` 支持 class 属性
- `n-select` 新增 `render-label` 属性
- `n-popselect` 新增 `render-label` 属性
### Fixes

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "2.12.0",
"version": "2.12.1",
"description": "A Vue 3 Component Library. Fairly Complete, Customizable Themes, Uses TypeScript, Not Too Slow",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -17,6 +17,7 @@ multiple
| --- | --- | --- | --- |
| multiple | `boolean` | `false` | |
| options | `Array<SelectOption \| SelectGroupOption>` | `[]` | |
| render-label | `(option: SelectOption \| SelectGroupOption) => VNodeChild` | `undefined` | Render function of all the options. |
| scrollable | `boolean` | `false` | |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |
| value | `string \| number \| Array<string \| number> \| null` | `null` | |

View File

@ -18,6 +18,7 @@ multiple
| multiple | `boolean` | `false` | |
| options | `Array<SelectOption \| SelectGroupOption>` | `[]` | |
| scrollable | `boolean` | `false` | |
| render-label | `(option: SelectOption \| SelectGroupOption) => VNodeChild` | `undefined` | 控制全部选项的渲染 |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |
| value | `string \| number \| Array<string \| number> \| null` | `null` | |
| on-update:value | `(string \| number \| Array<string \| number> \| null) => void` | `undefined` | |

View File

@ -1,7 +1,7 @@
import { h, ref, provide, defineComponent, PropType, mergeProps } from 'vue'
import { NPopover } from '../../popover'
import { popoverBaseProps } from '../../popover/src/Popover'
import type { PopoverInternalProps } from '../../popover/src/Popover'
import { NPopover } from '../../popover'
import type { PopoverInst, PopoverTrigger } from '../../popover'
import NPopselectPanel, { panelPropKeys, panelProps } from './PopselectPanel'
import { omit, keep } from '../../_utils'

View File

@ -9,11 +9,8 @@ import {
nextTick
} from 'vue'
import { createTreeMate } from 'treemate'
import { NInternalSelectMenu } from '../../_internal'
import { call, keysOf, warn } from '../../_utils'
import type { MaybeArray } from '../../_utils'
import type { PopselectSize } from './interface'
import { popselectInjectionKey } from './interface'
import { RenderLabel } from '../../_internal/select-menu/src/interface'
import { tmOptions } from '../../select/src/utils'
import {
OnUpdateValue,
OnUpdateValueImpl,
@ -24,8 +21,12 @@ import {
SelectIgnoredOption,
ValueAtom
} from '../../select/src/interface'
import { tmOptions } from '../../select/src/utils'
import { useConfig } from '../../_mixins'
import { NInternalSelectMenu } from '../../_internal'
import { call, keysOf, warn } from '../../_utils'
import type { MaybeArray } from '../../_utils'
import type { PopselectSize } from './interface'
import { popselectInjectionKey } from './interface'
export const panelProps = {
multiple: Boolean,
@ -48,6 +49,7 @@ export const panelProps = {
onUpdateValue: [Function, Array] as PropType<MaybeArray<OnUpdateValue>>,
onMouseenter: Function as PropType<(e: MouseEvent) => void>,
onMouseleave: Function as PropType<(e: MouseEvent) => void>,
renderLabel: Function as PropType<RenderLabel>,
// deprecated
onChange: {
type: [Function, Array] as PropType<MaybeArray<OnUpdateValue> | undefined>,
@ -146,6 +148,7 @@ export default defineComponent({
width={this.width}
virtualScroll={false}
scrollable={this.scrollable}
renderLabel={this.renderLabel}
onMenuToggleOption={this.handleMenuToggleOption}
onMouseenter={this.onMouseenter}
onMouseleave={this.onMouseenter}

View File

@ -41,6 +41,7 @@ max-tag-count
| options | `Array<SelectOption \| SelectGroupOption>` | `[]` | |
| placeholder | `string` | `'Please Select'` | |
| remote | `boolean` | `false` | If you want to async get options. Note that if remote is set, `filter` & `tag` won't work on `options`. At that time, you are taking all control of `options`. |
| render-label | `(option: SelectOption \| SelectGroupOption) => VNodeChild` | `undefined` | Render function of all the options. |
| show | `boolean` | `undefined` | Whether to show menu. |
| show-arrow | `boolean` | `true` | Whether to show arrow. |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |

View File

@ -1 +1 @@
export default '2.12.0'
export default '2.12.1'