Skip to content
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

feat(module:*): support global config #3613

Merged
merged 9 commits into from Sep 9, 2019

fix: make some properties not configurable

  • Loading branch information...
wendzhue committed Sep 9, 2019
commit fc7d8f58e294b29893ef38b43fdc41e45bd49f61
@@ -28,7 +28,7 @@ To get a customized button, just set `nzType`/`nzShape`/`nzSize`/`nzLoading`/`di
| -------- | ----------- | ---- | ------- | ------------- |
| `[nzGhost]` | make background transparent and invert text and border colors | `boolean` | `false` |
| `[nzLoading]` | set the loading status of button | `boolean` | `false` |
| `[nzShape]` | can be set to `circle` `round` or omitted | `'circle'\|'round'` | - |
| `[nzShape]` | can be set to `circle` `round` or omitted | `'circle'\|'round'` | - | |
| `[nzSize]` | can be set to `small` `large` or omitted | `'large'\|'small'\|'default'` | `'default'` | ✅ |
| `[nzType]` | can be set to `primary` `dashed` `danger` or omitted (meaning `default`) | `'primary'\|'dashed'\|'danger'\|'default'\|'link'` | `'default'` |
| `[nzBlock]` | option to fit button width to its parent width | `boolean` | `false` |
@@ -32,7 +32,7 @@ import { NzButtonModule } from 'ng-zorro-antd/button';
| --- | --- | --- | --- | --- |
| `[nzGhost]` | 幽灵属性,使按钮背景透明 | `boolean` | `false` |
| `[nzLoading]` | 设置按钮载入状态 | `boolean` | `false` |
| `[nzShape]` | 设置按钮形状,可选值为 `circle` `round` 或者不设 | `'circle'\|'round'` | - | |
| `[nzShape]` | 设置按钮形状,可选值为 `circle` `round` 或者不设 | `'circle'\|'round'` | - | |
| `[nzSize]` | 设置按钮大小,可选值为 `small` `large` 或者不设 | `'large'\|'small'\|'default'` | `'default'` | ✅ |
| `[nzType]` | 设置按钮类型,可选值为 `primary` `dashed` `danger` 或者不设 | `'primary'\|'dashed'\|'danger'\|'default'\|'link'` | `'default'` |
| `[nzBlock]` | 将按钮宽度调整为其父宽度的选项 | `boolean` | `false` |
@@ -77,7 +77,7 @@ export class NzButtonComponent implements AfterContentInit, OnInit, OnDestroy, O
@Input() @InputBoolean() nzSearch: boolean = false;
@Input() @InputBoolean() nzLoading: boolean = false;
@Input() nzType: NzButtonType = 'default';
@Input() @WithConfig(null) nzShape: NzButtonShape;
@Input() nzShape: NzButtonShape = null;
@Input() @WithConfig('default') nzSize: NzSizeLDSType;

readonly el: HTMLElement = this.elementRef.nativeElement;
@@ -80,7 +80,6 @@ export interface BadgeConfig {
}

export interface ButtonConfig {
nzShape?: 'circle' | 'round';
nzSize?: 'large' | 'default' | 'small';
}

@@ -201,7 +200,6 @@ export interface TabsConfig {
tabPane: boolean;
};
nzSize?: NzSizeLDSType;
nzTabPosition?: NzFourDirectionType;
nzType?: 'line' | 'card';
nzTabBarGutter?: number;
nzShowPagination?: boolean;
@@ -220,8 +218,6 @@ export interface TimePickerConfig {

export interface TreeConfig {
nzBlockNode?: boolean;
nzShowExpand?: boolean;
nzShowLine?: boolean;
nzShowIcon?: boolean;
nzHideUnMatched?: boolean;
}
@@ -232,7 +228,6 @@ export interface TreeSelectConfig {
nzDropdownMatchSelectWidth?: boolean;
nzHideUnMatched?: boolean;
nzSize?: 'large' | 'small' | 'default';
nzShowExpand?: boolean;
}

export interface TypographyConfig {
@@ -34,7 +34,7 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs';
| `[nzSize]` | preset tab bar size | `'large' \| 'small' \| 'default'` | `'default'` | ✅ |
| `[nzTabBarExtraContent]` | Extra content in tab bar | `TemplateRef<void>` | - |
| `[nzTabBarStyle]` | Tab bar style object | `object` | - |
| `[nzTabPosition]` | Position of tabs | `'top' \| 'right' \| 'bottom' \| 'left'` | `'top'` | |
| `[nzTabPosition]` | Position of tabs | `'top' \| 'right' \| 'bottom' \| 'left'` | `'top'` | |
| `[nzType]` | Basic style of tabs | `'line' \| 'card'` | `'line'` | ✅ |
| `[nzTabBarGutter]` | The gap between tabs | `number` | - | ✅ |
| `[nzHideAll]` | Whether hide all tabs | `boolean` | `false` |
@@ -37,7 +37,7 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs';
| `[nzSize]` | 大小,提供 `large` `default` 和 `small` 三种大小 | `'large' \| 'small' \| 'default'` | `'default'` | ✅ |
| `[nzTabBarExtraContent]` | tab bar 上额外的元素 | `TemplateRef<void>` | - |
| `[nzTabBarStyle]` | tab bar 的样式对象 | `object` | - |
| `[nzTabPosition]` | 页签位置,可选值有 `top` `right` `bottom` `left` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'top'` | |
| `[nzTabPosition]` | 页签位置,可选值有 `top` `right` `bottom` `left` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'top'` | |
| `[nzType]` | 页签的基本样式,可选 `line`、`card` 类型 | `'line' \| 'card'` | `'line'` | ✅ |
| `[nzTabBarGutter]` | tabs 之间的间隙 | `number` | - | ✅ |
| `[nzHideAll]` | 是否隐藏所有tab内容 | `boolean` | `false` |
@@ -37,8 +37,8 @@ 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` |
| `[nzShowExpand]` | Show a Expand Icon before the treeNodes | `boolean` | `true` | |
| `[nzShowLine]` | Shows a connecting line | `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` |
| `[nzNodes]` | Data of the treeNodes | `NzTreeNodeOptions[]` | `[]` |
| `[nzDefaultExpandAll]` | Whether to expand all treeNodes by default | `boolean` | `false` |
@@ -37,8 +37,8 @@ import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
| `[nzHideUnMatched]` | 搜索隐藏未匹配的节点 | `boolean` | `false` | ✅ |
| `[nzSize]` | 选择框大小 | `'large' \| 'small' \| 'default'` | `'default'` | ✅ |
| `[nzCheckable]` | 节点前添加 Checkbox 复选框 | `boolean` | `false` |
| `[nzShowExpand]` | 节点前添加展开图标 | `boolean` | `true` | |
| `[nzShowLine]` | 是否展示连接线 | `boolean` | `false` | |
| `[nzShowExpand]` | 节点前添加展开图标 | `boolean` | `true` | |
| `[nzShowLine]` | 是否展示连接线 | `boolean` | `false` | |
| `[nzAsyncData]` | 是否异步加载(显示加载状态) | `boolean` | `false` |
| `[nzNodes]` | treeNodes 数据 | `NzTreeNodeOptions[]` | `[]` |
| `[nzDefaultExpandAll]` | 默认展开所有树节点 | `boolean` | `false` |
@@ -102,8 +102,8 @@ export function higherOrderServiceFactory(injector: Injector): NzTreeBaseService
})
export class NzTreeSelectComponent extends NzTreeBase implements ControlValueAccessor, OnInit, OnDestroy, OnChanges {
@Input() @InputBoolean() nzAllowClear: boolean = true;
@Input() @InputBoolean() @WithConfig(true) nzShowExpand: boolean;
@Input() @InputBoolean() @WithConfig(false) nzShowLine: boolean;
@Input() @InputBoolean() nzShowExpand: boolean = true;
@Input() @InputBoolean() nzShowLine: boolean = false;
@Input() @InputBoolean() @WithConfig(true) nzDropdownMatchSelectWidth: boolean;
@Input() @InputBoolean() nzCheckable: boolean = false;
@Input() @InputBoolean() @WithConfig(false) nzHideUnMatched: boolean;
@@ -25,8 +25,8 @@ import { NzTreeModule } from 'ng-zorro-antd/tree';
| `[nzData]` | Tree data (Reference NzTreeNode) | `NzTreeNodeOptions[] \| NzTreeNode[]` | `[]` |
| `[nzBlockNode]` | Whether treeNode fill remaining horizontal space | `boolean` | `false` | ✅ |
| `[nzCheckable]` | Adds a Checkbox before the treeNodes| `boolean` | `false` |
| `[nzShowExpand]` | Show a Expand Icon before the treeNodes | `boolean` | `true` | |
| `[nzShowLine]` | Shows a connecting line | `boolean` | `false` | |
| `[nzShowExpand]` | Show a Expand Icon before the treeNodes | `boolean` | `true` | |
| `[nzShowLine]` | Shows a connecting line | `boolean` | `false` | |
| `[nzExpandedIcon]` | Customize an expand icon | `TemplateRef<{ $implicit: NzTreeNode }>` | - |
| `[nzShowIcon]` | Shows the icon before a TreeNode's title. There is no default style | `boolean` | `false` | ✅ |
| `[nzAsyncData]` | Load data asynchronously (should be used with NzTreeNode.addChildren(...)) | `boolean` | `false` |
@@ -26,8 +26,8 @@ import { NzTreeModule } from 'ng-zorro-antd/tree';
| `[nzData]` | 元数据 | `NzTreeNodeOptions[] \| NzTreeNode[]` | `[]` |
| `[nzBlockNode]` | 是否节点占据一行 | `boolean` | `false` | ✅ |

This comment has been minimized.

Copy link
@hsuanxyz

hsuanxyz Aug 6, 2019

Member

@simplejason 这个需要全局配置吗?

| `[nzCheckable]` | 节点前添加 Checkbox 复选框 | `boolean` | `false` |
| `[nzShowExpand]` | 节点前添加展开图标 | `boolean` | `true` | |
| `[nzShowLine]` | 是否展示连接线 | `boolean` | `false` | |
| `[nzShowExpand]` | 节点前添加展开图标 | `boolean` | `true` | |
| `[nzShowLine]` | 是否展示连接线 | `boolean` | `false` | |
| `[nzExpandedIcon]` | 自定义展开图标 | `TemplateRef<{ $implicit: NzTreeNode }>` | - |
| `[nzShowIcon]` | 是否展示 TreeNode title 前的图标,没有默认样式 | `boolean` | `false` | ✅ |
| `[nzAsyncData]` | 是否异步加载(显示加载状态) | `boolean` | `false` |
@@ -74,7 +74,7 @@ export function NzTreeServiceFactory(
})
export class NzTreeComponent extends NzTreeBase implements OnInit, OnDestroy, ControlValueAccessor, OnChanges {
@Input() @InputBoolean() @WithConfig(false) nzShowIcon: boolean;
@Input() @InputBoolean() @WithConfig(true) nzShowExpand: boolean;
@Input() @InputBoolean() nzShowExpand: boolean = true;
@Input() @InputBoolean() nzShowLine = false;
@Input() nzExpandedIcon: TemplateRef<{ $implicit: NzTreeNode }>;
@Input() @InputBoolean() nzCheckable = false;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.