ng-zorro-antd 20.0.0发布、基于Angular 的 UI 组件。
ng-zorro-antd 是 Ant Design 的 Angular 实现,主要用于研发企业级中后台产品。全部代码开源并遵循 MIT 协议,任何企业、组织及个人均可免费使用。
ng-zorro-antd 20.0.0 正式发布,更新内容如下:
Features
- cascader,date-picker,input-number,input,select,time-picker,tree-select: 新增
nzVariant
属性设置变体 (#9131) (b342bb4) - popover: 新增
nzPopoverTitleContext
和nzPopoverContentContext
属性 (#9126) (df3ead9) - select: 新增
nzOnClear
事件回调 (#9188) (e047ac2) - avatar: 支持设置原生
的loading
和fetchpriority
属性 (#7347) (ff8419f) - popconfirm: 新增
nzOkButtonProps
和nzCancelButtonProps
(#9245) (22e2a9f) - tree-select: 支持以 innerHTML 渲染已选项的 title (#9259) (8066f7b)
Bug Fixes
- flex: 修复
NzAlign
类型 (#9151) (b271c19) - segmented: 接受 ng control 的禁用状态 (#9166) (134cd59)
- space: 紧凑模式下只有一个子元素时的 border-radius 不正确 (#9165) (d2f4541)
- tabs: 修复 tab focus 时不正确的滚动行为 (#9186) (4f658e0)
- schematics: 修复重复执行
ng add
时的问题 (#9171) (d0a9748) - water-mark: 修复 ssr 模式的兼容问题 (#9250) (a70a682)
- icon: 在 animation frame 上增加渲染防抖 (#8579) (c0709d1)
Code Refactoring
- core: 移除对 animation frame 的 polyfill (#9243) (272237a)
- 从基于
constructor
的依赖注入模式迁移到inject
BREAKING CHANGES
- core: 移除对 animation frame 的 polyfill
- 重命名
cancelRequestAnimationFrame
为cancelAnimationFrame
- 重命名
reqAnimFrame
为requestAnimationFrame
- 重命名
- tabs: 废弃
NzTabsetComponent
并重命名为NzTabsComponent
,废弃nz-tabset
选择器并重命名为nz-tabs
- table: 移除对 material 组件的兼容
- popconfirm: 废弃
nzOkDisabled
和nzOkDanger
,请使用nzOkButtonProps
代替
移除以下在过去的版本中标记为废弃的 API:
ng-zorro-antd/button
NzButtonGroupComponent
ng-zorro-antd/core/form
NzFormPatchModule
ng-zorro-antd/checkbox
NzCheckBoxOptionInterface
ng-zorro-antd/input
NzInputGroupComponent#nzCompact
ng-zorro-antd/message
NzMessageModule
ng-zorro-antd/notification
NzNotificationModule
NzNotificationServiceModule
组件的 exportAs
属性命名统一采用小驼峰 camelCase
且以 nz
开头,并移除一些内部组件的 exportAs
属性。变化如下:
calendar-footer
calendarFooter
date-helper
dateHelper
date-range-popup
dateRangePopup
date-table
dateTable
decade-helper
decadeHelper
decade-table
decadeTable
month-helper
monthHelper
month-table
monthTable
quarter-helper
quarterHelper
quarter-table
quarterTable
year-helper
yearHelper
year-table
yearTable
inner-popup
innerPopup
nz-color-block
NzColorBlock
nzColorBlock
nz-color-format
NzColorFormat
nzColorFormat
nz-color-picker
NzColorPicker
nzColorPicker
nz-model-close
NzModalCloseBuiltin
nzModalCloseBuiltin
nz-model-footer
NzModalFooterBuiltin
nzModalFooterBuiltin
nz-model-title
NzModalTitleBuiltin
nzModalTitleBuiltin
nz-tree-drop-indicator
NzTreeDropIndicator
nzTreeDropIndicator
nz-water-mark
NzWaterMark
nzWaterMark
nz-tabs
nzTabset
nzTabs
Deprecations
在 v20 中,以下 API 被标记为 deprecated,并将在下一个主要版本中移除。 请参考相关文档以获取更好的替代方案。
ng-zorro-antd/autocomplete
NZ_AUTOCOMPLETE_VALUE_ACCESSOR
getNzAutocompleteMissingPanelError
ng-zorro-antd/button
NzButtonGroupComponent
ng-zorro-antd/core/highlight
NzHighlightModule
ng-zorro-antd/core/form
NzFormPatchModule
ng-zorro-antd/checkbox
NzCheckBoxOptionInterface
ng-zorro-antd/input
NzInputGroupComponent#nzCompact
ng-zorro-antd/mention
NZ_MENTION_TRIGGER_ACCESSOR
ng-zorro-antd/message
NzMessageModule
ng-zorro-antd/notification
NzNotificationModule
NzNotificationServiceModule
ng-zorro-antd/tabs
NzTabsetComponent