@@ -303,8 +323,6 @@ export default defineComponent({
options={this.tgtOpts}
disabled={this.mergedDisabled}
virtualScroll={this.virtualScroll}
- isMounted={this.isMounted}
- isInputing={this.isInputing}
itemSize={this.itemSize}
/>
diff --git a/src/transfer/src/TransferFilter.tsx b/src/transfer/src/TransferFilter.tsx
index f50625c17..90a547c9d 100644
--- a/src/transfer/src/TransferFilter.tsx
+++ b/src/transfer/src/TransferFilter.tsx
@@ -10,14 +10,6 @@ export default defineComponent({
value: String,
placeholder: String,
disabled: Boolean,
- onFocus: {
- type: Function as PropType<() => void>,
- required: true
- },
- onBlur: {
- type: Function as PropType<() => void>,
- required: true
- },
onUpdateValue: {
type: Function as PropType<(value: string | null) => void>,
required: true
@@ -39,20 +31,15 @@ export default defineComponent({
value={this.value}
onUpdateValue={this.onUpdateValue}
disabled={this.disabled}
+ placeholder={this.placeholder}
theme={mergedTheme.peers.Input}
themeOverrides={mergedTheme.peerOverrides.Input}
clearable
size="small"
- placeholder={this.placeholder}
- onFocus={this.onFocus}
- onBlur={this.onBlur}
>
{{
'clear-icon-placeholder': () => (
-
+
{{ default: () => }}
)
diff --git a/src/transfer/src/TransferHeader.tsx b/src/transfer/src/TransferHeader.tsx
index 78b10fb4e..4017c5996 100644
--- a/src/transfer/src/TransferHeader.tsx
+++ b/src/transfer/src/TransferHeader.tsx
@@ -6,77 +6,77 @@ import { transferInjectionKey } from './interface'
export default defineComponent({
name: 'TransferHeader',
props: {
- source: {
- type: Boolean,
- default: false
- },
- onCheckedAll: {
- type: Function as PropType<() => void>
- },
- onClearAll: {
- type: Function as PropType<() => void>
+ size: {
+ type: String as PropType<'small' | 'medium' | 'large'>,
+ required: true
},
+ source: Boolean,
+ onCheckedAll: Function as PropType<() => void>,
+ onClearAll: Function as PropType<() => void>,
title: String
},
setup (props) {
const {
- srcOptsRef,
- tgtOptsRef,
- headerBtnStatusRef,
+ targetOptionsRef,
+ canNotSelectAnythingRef,
+ canBeClearedRef,
+ allCheckedRef,
mergedThemeRef,
disabledRef,
- mergedClsPrefixRef
+ mergedClsPrefixRef,
+ srcOptionsLengthRef
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
} = inject(transferInjectionKey)!
const { localeRef } = useLocale('Transfer')
return () => {
const { source, onClearAll, onCheckedAll } = props
- const { value: headerBtnStatus } = headerBtnStatusRef
const { value: mergedTheme } = mergedThemeRef
const { value: mergedClsPrefix } = mergedClsPrefixRef
const { value: locale } = localeRef
+ const buttonSize = props.size === 'large' ? 'small' : 'tiny'
+ const { title } = props
return (
)
diff --git a/src/transfer/src/TransferList.tsx b/src/transfer/src/TransferList.tsx
index 88336216f..de97277c0 100644
--- a/src/transfer/src/TransferList.tsx
+++ b/src/transfer/src/TransferList.tsx
@@ -1,13 +1,4 @@
-import {
- h,
- defineComponent,
- ref,
- inject,
- PropType,
- TransitionGroup,
- Transition,
- Fragment
-} from 'vue'
+import { h, defineComponent, ref, inject, PropType } from 'vue'
import { VirtualList, VirtualListInst } from 'vueuc'
import { NEmpty } from '../../empty'
import { NScrollbar, ScrollbarInst } from '../../_internal'
@@ -33,18 +24,7 @@ export default defineComponent({
type: Boolean,
required: true
},
- isMounted: {
- type: Boolean,
- required: true
- },
- isInputing: {
- type: Boolean,
- required: true
- },
- source: {
- type: Boolean,
- default: false
- }
+ source: Boolean
},
setup () {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -77,89 +57,71 @@ export default defineComponent({
}
},
render () {
- const { mergedTheme, mergedClsPrefix, virtualScroll, syncVLScroller } = this
+ const { mergedTheme, options } = this
+ if (options.length === 0) {
+ return (
+
+ )
+ }
+ const { mergedClsPrefix, virtualScroll, source, disabled, syncVLScroller } =
+ this
return (
- <>
-
- {{
- default: () =>
- virtualScroll ? (
-
- {{
- default: ({ item }: { item: Option }) => {
- const { source, disabled } = this
- return (
-
- )
- }
- }}
-
- ) : (
-
-
- {{
- default: () => {
- const { source, disabled } = this
- return this.options.map((option) => (
-
- ))
- }
- }}
-
-
- )
- }}
-
-
- {{
- default: () =>
- this.options.length ? null : (
-
- )
- }}
-
- >
+
+ {{
+ default: () =>
+ virtualScroll ? (
+
+ {{
+ default: ({ item }: { item: Option }) => {
+ const { source, disabled } = this
+ return (
+
+ )
+ }
+ }}
+
+ ) : (
+
+ {this.options.map((option) => (
+
+ ))}
+
+ )
+ }}
+
)
}
})
diff --git a/src/transfer/src/TransferListItem.tsx b/src/transfer/src/TransferListItem.tsx
index ca5ddae95..c775ac211 100644
--- a/src/transfer/src/TransferListItem.tsx
+++ b/src/transfer/src/TransferListItem.tsx
@@ -1,17 +1,14 @@
-import { h, inject, defineComponent, ref, PropType } from 'vue'
+import { h, inject, defineComponent, PropType } from 'vue'
import { useMemo } from 'vooks'
import { NCheckbox } from '../../checkbox'
-import { transferInjectionKey, Option } from './interface'
import { getTitleAttribute } from '../../_utils'
import { NBaseClose } from '../../_internal'
+import { transferInjectionKey, Option } from './interface'
export default defineComponent({
name: 'NTransferListItem',
props: {
- source: {
- type: Boolean,
- default: false
- },
+ source: Boolean,
label: {
type: String,
required: true
@@ -20,10 +17,7 @@ export default defineComponent({
type: [String, Number],
required: true
},
- disabled: {
- type: Boolean,
- default: false
- },
+ disabled: Boolean,
option: {
type: Object as PropType