-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:transfer): use nzOneWay to make Transfer the one way style
fix: #8643
- Loading branch information
OriginRing
committed
Aug 28, 2024
1 parent
3ccca11
commit 0577a85
Showing
14 changed files
with
204 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 2 | ||
order: 4 | ||
title: | ||
zh-CN: 高级用法 | ||
en-US: Advanced | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 4 | ||
order: 6 | ||
debug: true | ||
title: | ||
zh-CN: 二次校验 | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 3 | ||
order: 5 | ||
title: | ||
zh-CN: 自定义渲染行数据 | ||
en-US: Custom datasource | ||
|
This file contains 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,16 @@ | ||
--- | ||
order: 1 | ||
title: | ||
zh-CN: 单向样式 | ||
en-US: One Way | ||
--- | ||
|
||
## zh-CN | ||
|
||
通过 `nzOneWay` 将 Transfer 转为单向样式。 | ||
|
||
## en-US | ||
|
||
Use `nzOneWay` to make Transfer the one way style. | ||
|
||
|
This file contains 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,46 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { TransferItem } from 'ng-zorro-antd/transfer'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-transfer-on-way', | ||
template: ` | ||
<nz-transfer | ||
[nzDataSource]="list" | ||
[nzDisabled]="disabled" | ||
[nzTitles]="['Source', 'Target']" | ||
(nzSelectChange)="select($event)" | ||
[nzSelectedKeys]="['0', '2', '3']" | ||
nzOneWay | ||
(nzChange)="change($event)" | ||
></nz-transfer> | ||
<div style="margin-top: 8px;"> | ||
<nz-switch [(ngModel)]="disabled" nzCheckedChildren="disabled" nzUnCheckedChildren="disabled"></nz-switch> | ||
<div></div> | ||
</div> | ||
` | ||
}) | ||
export class NzDemoTransferOnWayComponent implements OnInit { | ||
list: TransferItem[] = []; | ||
disabled = false; | ||
|
||
ngOnInit(): void { | ||
for (let i = 0; i < 20; i++) { | ||
this.list.push({ | ||
key: i.toString(), | ||
title: `content${i + 1}`, | ||
disabled: i % 3 < 1 | ||
}); | ||
} | ||
|
||
[2, 3].forEach(idx => (this.list[idx].direction = 'right')); | ||
} | ||
|
||
select(ret: {}): void { | ||
console.log('nzSelectChange', ret); | ||
} | ||
|
||
change(ret: {}): void { | ||
console.log('nzChange', ret); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1 | ||
order: 2 | ||
title: | ||
zh-CN: 带搜索框 | ||
en-US: Search | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 7 | ||
order: 11 | ||
title: | ||
zh-CN: 自定义状态 | ||
en-US: Status | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 5 | ||
order: 8 | ||
title: | ||
zh-CN: 表格穿梭框 | ||
en-US: Table Transfer | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 6 | ||
order: 9 | ||
title: | ||
zh-CN: 树穿梭框 | ||
en-US: Tree Transfer | ||
|
This file contains 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 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
Oops, something went wrong.