Since the 17 announced in November, KPC has undergone eight months of iteration, released the official version of dozens period, but has not been to a 1.0, because we feel that version 1.0 is a milestone, we must dare to do enough to improve referred 1.0. Now we are confident announced: KPC 1.0 is finally here!
In fact, from the 0.0.1 release, and now has more than 1 year, but no receipt KPC and too much attention, along with one by a small version of iterations, the number of stars on github too leisurely break 100 mark. But we did not give careful care of KPC, every star, every issue, so we are encouraged, prompted us to polish every detail, and strive to make their own characteristics, to achieve excellence.
Users should note that the concern of KPC, KPC has issued version two months, no, yes, because this time we have been focused on the development of 1.0, the following will talk about the results of two months of work.
Add four common components
1. The revolving door (FIG rotation) assemblyCarousel
In addition to supporting the basic effect of a revolving door, but Carousel
also simultaneously support multiple content display blocks
2. Monaco Editor based code editor componentCode
Monaco Editor is VSCode the web version, very powerful
3. pushpin componentsAffix
Pushpin component for when you scroll the page, fix some of the content
4. The card assembly ofCard
In addition to the usual card, the card also supports columns
A large number of new properties
In addition to the new components, but also the function of existing components optimized and improved a lot.
1. The table assembly Table
support packet header, merge cells, column width information stored functions
2. pop component Dialog
supports static methods defined with a title style
3. Select the time component Timepicker
does not show seconds when the step size support
4. Tip bomb-tier components Tooltip
, the new dark theme dark
, and the default is dark
5. (cascade) selected frame assembly Cascader/Select
new data suggest no
6. New Vue/React
compiler package, reducing configuration items
之前需要配置webpack alias
才能是KPC在Vue/React
下使用,现在不需要,直接引用相应的组件即可,例如:
- Vue:
import Button from 'kpc/@vue/@css/components/button';
- React:
import Button from 'kpc/@react/@css/components/button';
当然你也可以设置alias
来简化引用路径
细节打磨
1.0中我们使用展示/隐藏(show/hide)
动画来替代之前的创建/删除(create/remove)
动画,同时打磨动画的细节,使动画更自然流畅。
例如:之前的版本中,如果快速点击,使一个展开的元素在收起和展开之间切换,则收起动画会立即跳至最终状态,然后再展开,这样会显得动画很突兀
而1.0中,对于上述情况,它不会跳至最终状态,而是从收起的中间状态回到展开状态,使动画更自然
文档
1.0中对部分文档进行了补充,使之更易上手。同时对文档中的示例代码,可以在CodeSandbox中打开进行预览和调试
Vue示例:https://codesandbox.io/embed/serverless-wood-n6ppy?fontsize=14
React示例:https://codesandbox.io/embed/practical-chatelet-3phlh?fontsize=14
结语
没有什么东西是完美的,但应该保持追求完美的赤子之心。同样,1.0也并非完美,还有大量工作亟待完成,它只是漫漫长征路上的第一个落脚点而已,至此,再出发,开启新的篇章...
新增组件
Add
新增图钉组件Affix
,用于滚动页面固定某些内容 #300Add
新增走马灯(轮播图)组件Carousel
#299Add
新增代码编辑器组件Code
,基于Monaco Editor
(VSCode)封装而来 #288Add
新增卡片组件Card
#241
新增特性
Add
新增全局配置方法configure
,使用configure({useWrapper: true})
可以开启Dropdown/Tooltip
兼容模式 #291Add
Tree
如果初始化数据中包含children
,当异步加载时,不会再次调用loadData
函数去加载数据 #290Add
Table
支持保存调整列宽后的列宽信息 #292Add
Table
新增表头分组功能 #265Add
Table
新增合并单元格功能 #265Add
Upload
支持文件类型强检测,不合法是抛出error
事件,因为浏览器accept
属性仅仅只是建议类型,并不能限制类型 #271Add
Progress
新增warning
状态 #301Add
Tree
支持父子Checkbox
非关联模式,该模式下父子的选中状态单独控制,互不影响 #302Add
FormItem
新增fluid
属性,展示100%
宽度的表单项 #303Add
新增Vue/React
编译包,减少webpack
alias
配置项 #308Add
Button
组件新增secondary
和link
类型 #320Add
Dialog
支持点击遮罩层关闭弹窗 #324Add
Dialog
静态方法支持展示带标题title
的弹窗 #324Add
Select
和Cascader
在无内容时,展示“无内容”的提示层 #321Add
Datepicker
和Timepicker
新增“确定”按钮,以方便用户关闭弹层 #322Add
Timepicker
支持设置step
时,隐藏“分钟”或/和“秒钟”的展示 #323Add
Tooltip
新增主题支持,默认展示为dark
主题 #326Add
Transfer
新增list
header
扩展点,以及左右箭头按钮的控制,使之可以更灵活地定义穿梭框逻辑 #314Add
当Table
fixHeader
设为true
时,表格高度自动设为100%
,然后根据父容器高度确定表格体的高度来展示滚动条 #310
组件优化
Refactor
优化Table
hover
以及滚动的性能 #310Refactor
优化Slider
滚动条热区,更容易点击 #307Refactor
优化弹出元素动画,使用show/hide
动画替代create/remove
动画,使动画更流畅 #278
Bug修复
Fix
修复错误地引入babel-types
导致可能不存在该模块而编译报错的问题 #283Fix
修复Pagination
当页码过长时溢出的问题 #286Fix
修复Timepicker
范围选择时,首次弹出如果先选择结束时间,时间取值不对的问题 #289Fix
修复Table
调整列宽后,如果表格容器宽度变大,会出现表格宽度小于容器宽度的情况 #293Fix
修复Slider
有Spinner
输入框时,在设置了step
的情况下,输入的过程中也会修正值,导致无法输入想要的值的问题 #294Fix
修复webpack
配置可能禁用了require.ensure
(如:新版Create React App)导致有些异步加载的模块报错的问题 #304Fix
修复Switch
点击滑块,由于click
事件被stopPropagation
而在外部监听不到click
事件的问题 #309Fix
修复Table
当表格高度固定时,data
改变导致出现滚动条,固定表头和表格体没对齐的问题 #310Fix
修复默认主题下Message
icon颜色丢失的问题 #317
破坏性变更
Change
Drawer
由之前的点击抽屉外任何区域关闭抽屉,改为点击遮罩层才关闭Change
Datepicker
在选择时间时,去掉无用的年月展示信息Change
使用es6 module
进行构建,例如代码编译优化 #297
文档
Add
支持Vue/React
示例代码,在CodeSandbox中打开 #267Vue/React
开始文档补充CDN用法