From 1f8cf1d905eceebb380bc371d36c549e36773383 Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Sat, 12 Oct 2019 15:54:46 +0800 Subject: [PATCH] feat(module:tree-select): support `nzCheckStrictly` property (#4149) close #4120 --- components/tree-select/doc/index.en-US.md | 1 + components/tree-select/doc/index.zh-CN.md | 1 + components/tree-select/nz-tree-select.component.html | 1 + components/tree-select/nz-tree-select.component.ts | 1 + 4 files changed, 4 insertions(+) diff --git a/components/tree-select/doc/index.en-US.md b/components/tree-select/doc/index.en-US.md index c5085154b69..be41d733c62 100755 --- a/components/tree-select/doc/index.en-US.md +++ b/components/tree-select/doc/index.en-US.md @@ -37,6 +37,7 @@ import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select'; | `[nzHideUnMatched]` | Hide unmatched nodes while searching | `boolean` | `false` | ✅ | | `[nzSize]` | To set the size of the select input | `'large' \| 'small' \| 'default'` | `'default'` | ✅ | | `[nzCheckable]` | Whether to show checkbox on the treeNodes | `boolean` | `false` | +| `[nzCheckStrictly]` | Check treeNode precisely; parent treeNode and children treeNodes are not associated | `boolean` | `false` | | `[nzShowExpand]` | Show a Expand Icon before the treeNodes | `boolean` | `true` | | | `[nzShowLine]` | Shows a connecting line | `boolean` | `false` | | | `[nzAsyncData]` | Load data asynchronously (should be used with NzTreeNode.addChildren(...)) | `boolean` | `false` | diff --git a/components/tree-select/doc/index.zh-CN.md b/components/tree-select/doc/index.zh-CN.md index e6fff161679..8a27e645fff 100755 --- a/components/tree-select/doc/index.zh-CN.md +++ b/components/tree-select/doc/index.zh-CN.md @@ -37,6 +37,7 @@ import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select'; | `[nzHideUnMatched]` | 搜索隐藏未匹配的节点 | `boolean` | `false` | ✅ | | `[nzSize]` | 选择框大小 | `'large' \| 'small' \| 'default'` | `'default'` | ✅ | | `[nzCheckable]` | 节点前添加 Checkbox 复选框 | `boolean` | `false` | +| `[nzCheckStrictly]` | checkable 状态下节点选择完全受控(父子节点选中状态不再关联) | `boolean` | `false` | | `[nzShowExpand]` | 节点前添加展开图标 | `boolean` | `true` | | | `[nzShowLine]` | 是否展示连接线 | `boolean` | `false` | | | `[nzAsyncData]` | 是否异步加载(显示加载状态) | `boolean` | `false` | diff --git a/components/tree-select/nz-tree-select.component.html b/components/tree-select/nz-tree-select.component.html index 3b5812c7a32..73791c8f333 100644 --- a/components/tree-select/nz-tree-select.component.html +++ b/components/tree-select/nz-tree-select.component.html @@ -51,6 +51,7 @@ [nzCheckedKeys]="nzCheckable ? value : []" [nzSelectedKeys]="!nzCheckable ? value : []" [nzTreeTemplate]="treeTemplate" + [nzCheckStrictly]="nzCheckStrictly" (nzExpandChange)="onExpandedKeysChange($event)" (nzClick)="nzTreeClick.emit($event)" (nzCheckedKeysChange)="updateSelectedNodes()" diff --git a/components/tree-select/nz-tree-select.component.ts b/components/tree-select/nz-tree-select.component.ts index ec8af25c66f..4e38abcc6ec 100644 --- a/components/tree-select/nz-tree-select.component.ts +++ b/components/tree-select/nz-tree-select.component.ts @@ -113,6 +113,7 @@ export class NzTreeSelectComponent extends NzTreeBase implements ControlValueAcc @Input() @InputBoolean() nzAsyncData = false; @Input() @InputBoolean() nzMultiple = false; @Input() @InputBoolean() nzDefaultExpandAll = false; + @Input() @InputBoolean() nzCheckStrictly = false; @Input() nzExpandedIcon: TemplateRef<{ $implicit: NzTreeNode }>; @Input() nzNotFoundContent: string; @Input() nzNodes: Array = [];