-
Notifications
You must be signed in to change notification settings - Fork 291
feat: transfer add drag sort #51
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
749936f
fix: 穿梭框进度更改
ForeseeBear bd70234
Merge branch 'dev' of github.com:DevCloudFE/vue-devui into transfer
ForeseeBear 8fb5144
feat: 穿梭框新增拖拽排序功能
ForeseeBear 08380b9
Merge branch 'dev' of github.com:DevCloudFE/vue-devui into transfer
ForeseeBear 4b86958
fix: 解决ExtractPropTypes、PropType引用不正确
ForeseeBear 358e337
feat: 穿梭框全选增加半选中效果
ForeseeBear c3cd1ea
Merge branch 'dev' of github.com:DevCloudFE/vue-devui into transfer
ForeseeBear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/devui-vue/devui/transfer/common/use-transfer-checkbox.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ExtractPropTypes } from '@vue/runtime-core' | ||
import { IItem } from '../types' | ||
import { transferCommon } from './use-transfer-common' | ||
|
||
const transferCheckboxProps = { | ||
...transferCommon, | ||
data: { | ||
type: Object as () => IItem, | ||
}, | ||
id: { | ||
type: Number | ||
} | ||
} | ||
|
||
export type TransferCheckboxProps = ExtractPropTypes<typeof transferCheckboxProps> | ||
|
||
export default transferCheckboxProps |
34 changes: 34 additions & 0 deletions
34
packages/devui-vue/devui/transfer/common/use-transfer-common.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { PropType } from '@vue/runtime-core' | ||
kagol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import { IItem } from '../types' | ||
|
||
export const transferCommon = { | ||
showTooltip: { | ||
type: Boolean, | ||
default: (): boolean => false | ||
}, | ||
tooltipPosition: { | ||
type: String as PropType<'top' | 'right' | 'bottom' | 'left'>, | ||
default: (): string => 'top' | ||
} | ||
} | ||
|
||
export const transferDragFunctions = { | ||
onDragstart: { | ||
type: Function as unknown as () => ((event: Event, dragItem: IItem) => void) | ||
}, | ||
onDrop: { | ||
type: Function as unknown as () => ((event: Event, dropItem: IItem) => void) | ||
}, | ||
onDragleave: { | ||
type: Function as unknown as () => ((event: Event, dragItem: IItem) => void) | ||
}, | ||
onDragover: { | ||
type: Function as unknown as () => ((event: Event, dragItem: IItem) => void) | ||
}, | ||
onDragenter: { | ||
type: Function as unknown as () => ((event: Event, dragItem: IItem) => void) | ||
}, | ||
onDragend: { | ||
type: Function as unknown as () => ((event: Event, dropItem: IItem) => void) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/devui-vue/devui/transfer/common/use-transfer-drag.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { PropType, ExtractPropTypes } from '@vue/runtime-core' | ||
import { IItem } from '../types' | ||
import { transferCommon, transferDragFunctions } from './use-transfer-common' | ||
|
||
const transferDragProps = { | ||
...transferCommon, | ||
...transferDragFunctions, | ||
itemData: { | ||
type: Object as PropType<IItem> | ||
}, | ||
id: { | ||
type: Number, | ||
default: (): number | null => null | ||
}, | ||
|
||
} | ||
|
||
export type TransferDragProps = ExtractPropTypes<typeof transferDragProps> | ||
|
||
export default transferDragProps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/devui-vue/devui/transfer/src/transfer-checkbox.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { defineComponent } from 'vue' | ||
import DCheckbox from '../../checkbox/src/checkbox' | ||
import DTooltip from '../../tooltip/src/tooltip' | ||
import transferCheckboxProps, { TransferCheckboxProps } from '../common/use-transfer-checkbox' | ||
|
||
export default defineComponent({ | ||
name: 'DTransferCheckbox', | ||
components: { | ||
DCheckbox, | ||
DTooltip | ||
}, | ||
props: transferCheckboxProps, | ||
setup(props: TransferCheckboxProps) { | ||
/** data start **/ | ||
const renderCheckbox = () => { | ||
return <DCheckbox | ||
label={props.data.key} | ||
value={props.data.value} | ||
disabled={props.data.disabled} | ||
class="devui-transfer-panel-body-list-item" | ||
key={props.id}> | ||
</DCheckbox> | ||
} | ||
/** data end **/ | ||
|
||
/** watch start **/ | ||
/** watch end **/ | ||
|
||
/** methods start **/ | ||
/** methods end **/ | ||
|
||
return () => { | ||
return ( | ||
!props.showTooltip ? renderCheckbox() : | ||
<DTooltip class="devui-transfer-panel-body-list-tooltip" | ||
position={props.tooltipPosition} | ||
content={props.data.key}>{renderCheckbox()} | ||
</DTooltip> | ||
) | ||
} | ||
} | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.