-
- {showInfo && placement === 'inside' && getHeight() >= 14 && (
-
{content || `${percent}%`}
- )}
- {tooltip}
+ render () {
+ let prefix = 'hi-progress'
+ const { percent: percentNum, content, type, showInfo, placement, tooltip = null, active } = this.props
+ const percent = percentNum > 0 ? percentNum : 0
+ return (
+
+
+
+ {showInfo && placement === 'inside' && this.getHeight() >= 14 && (
+
+ {content || `${percent}%`}
+
+ )}
+ {tooltip}
+
+ {showInfo && placement === 'outside' && (
+
{content || `${percent}%`}
+ )}
- {showInfo && placement === 'outside' && (
-
{content || `${percent}%`}
- )}
-
- )
+ )
+ }
}
diff --git a/components/progress/Progress.js b/components/progress/Progress.js
index 4ef549779..9615456a8 100644
--- a/components/progress/Progress.js
+++ b/components/progress/Progress.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import './style'
-import { BarProgress } from './BarProgress.js'
+import BarProgress from './BarProgress.js'
import { CircleProgress } from './CircleProgress.js'
import { DashboardProgress } from './DashboardProgress'
import Provider from '../context'
@@ -40,11 +40,9 @@ class Progress extends Component {
render () {
let prefix = 'hi-progress'
- const {className = '', apperance, theme} = this.props
+ const { className = '', apperance, theme } = this.props
- return (
-
{this.getRenderType(apperance)}
- )
+ return
{this.getRenderType(apperance)}
}
}
export default Provider(Progress)
diff --git a/components/progress/style/index.scss b/components/progress/style/index.scss
index 55db9070d..ab7d4f898 100644
--- a/components/progress/style/index.scss
+++ b/components/progress/style/index.scss
@@ -3,8 +3,8 @@
$progress-bg: #f2f2f2 !default;
$progress-primary: #3b76dc !default;
$progress-success: #1da653 !default;
-$progress-warn: #eb5252 !default;
-$progress-error: #e19d0c !default;
+$progress-warn: #e19d0c !default;
+$progress-error: #eb5252 !default;
$progress-text: #666 !default;
.hi-progress {
@@ -27,9 +27,7 @@ $progress-text: #666 !default;
background: #fff;
opacity: 0;
content: '';
- animation:
- hi-progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1)
- infinite;
+ animation: hi-progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}
}
@@ -63,12 +61,17 @@ $progress-text: #666 !default;
&__text--inside {
font-size: 14px;
- color: #fff;
position: absolute;
- right: 5px;
+ right: -5px;
top: 50%;
- transform: translateY(-50%);
+ transform: translate(100%, -50%);
line-height: 14px;
+
+ &.inside--left {
+ color: #fff;
+ right: 5px;
+ transform: translate(0, -50%);
+ }
}
&__text--success {
@@ -117,18 +120,16 @@ $progress-text: #666 !default;
transition: stroke-dashoffset 0.4s cubic-bezier(0.3, 0, 0.7, 1);
}
- .theme__hiui-blue {
- &__circle--success {
- stroke: $progress-success;
- }
+ &__circle--success {
+ stroke: $progress-success;
+ }
- &__circle--warn {
- stroke: $progress-warn;
- }
+ &__circle--warn {
+ stroke: $progress-warn;
+ }
- &__circle--error {
- stroke: $progress-error;
- }
+ &__circle--error {
+ stroke: $progress-error;
}
&__dashboard {
diff --git a/components/rate/Rate.js b/components/rate/Rate.js
index 82074bef3..b96e86239 100644
--- a/components/rate/Rate.js
+++ b/components/rate/Rate.js
@@ -136,7 +136,7 @@ Rate.defaultProps = {
count: 5,
prefixCls: 'hi-rate',
tooltips: [],
- onChange: () => {}
+ onChange: () => { }
}
function ToolTipWrapper ({ children, title }) {
@@ -145,6 +145,7 @@ function ToolTipWrapper ({ children, title }) {
function Icon ({ value, currentValue, disabled, useEmoji, allowHalf }) {
if (useEmoji) {
+ const emojiValue = currentValue > 5 ? 5 : currentValue
const Emojis = [
Icons.EmojiOne,
Icons.EmojiTwo,
@@ -152,8 +153,8 @@ function Icon ({ value, currentValue, disabled, useEmoji, allowHalf }) {
Icons.EmojiFour,
Icons.EmojiFive
]
- if (value <= currentValue) {
- return React.createElement(Emojis[currentValue - 1])
+ if (value <= emojiValue) {
+ return React.createElement(Emojis[emojiValue - 1])
} else {
return
}
diff --git a/components/select/Select.js b/components/select/Select.js
index d5417fadc..0561484af 100644
--- a/components/select/Select.js
+++ b/components/select/Select.js
@@ -37,6 +37,7 @@ class Select extends Component {
]),
showCheckAll: PropTypes.bool,
autoload: PropTypes.bool,
+ withCredentials: PropTypes.bool,
searchable: PropTypes.bool,
filterOption: PropTypes.func,
clearable: PropTypes.bool,
@@ -60,6 +61,7 @@ class Select extends Component {
autoload: false,
showCheckAll: false,
open: true,
+ withCredentials: false,
onClick: () => {},
onBlur: () => {},
onFocus: () => {}
@@ -337,7 +339,7 @@ class Select extends Component {
}
remoteSearch (keyword) {
- const { onSearch, dataSource, autoload } = this.props
+ const { onSearch, dataSource, autoload, withCredentials: propsWithCredentials } = this.props
if (onSearch && typeof onSearch === 'function') {
this.setState({
fetching: true
@@ -357,6 +359,7 @@ class Select extends Component {
data = {},
type = 'GET',
key,
+ withCredentials = propsWithCredentials,
jsonpCallback = 'callback',
...options
} = _dataSource
@@ -396,6 +399,7 @@ class Select extends Component {
/* eslint-disable */
fetch(url, {
method: type,
+ credentials: withCredentials ? 'include' : 'same-origin',
...options
})
.then(response => response.json())
diff --git a/components/select/SelectInput.js b/components/select/SelectInput.js
index d797cb862..94621f954 100644
--- a/components/select/SelectInput.js
+++ b/components/select/SelectInput.js
@@ -146,10 +146,12 @@ class SelectInput extends Component {
{item.title}
{
e.stopPropagation()
- this.props.onDelete(item)
+ !disabled && this.props.onDelete(item)
}}
>
@@ -159,7 +161,9 @@ class SelectInput extends Component {
return _item
})}
{showCount < selectedItems.length && (
-
+
+
{selectedItems.length - showCount}
diff --git a/components/select/style/select-input.scss b/components/select/style/select-input.scss
index ce4d4f34d..9f94796a2 100644
--- a/components/select/style/select-input.scss
+++ b/components/select/style/select-input.scss
@@ -205,6 +205,10 @@
background-color: #f2f2f2;
border-radius: 2px;
box-sizing: border-box;
+
+ &.disabled {
+ color: #ccc;
+ }
}
}
@@ -239,6 +243,10 @@
top: 0;
right: 4px;
padding: 0 0 0 8px;
+
+ &.disabled {
+ cursor: not-allowed;
+ }
}
}
diff --git a/components/style/icon/diyIcon.scss b/components/style/icon/diyIcon.scss
index 048a83889..afdfb795e 100644
--- a/components/style/icon/diyIcon.scss
+++ b/components/style/icon/diyIcon.scss
@@ -1,7 +1,9 @@
/* stylelint-disable */
@font-face {
font-family: 'diy-icon';
- src: url('data:application/font-woff;base64,d09GRgABAAAAAAd8AAsAAAAADVAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8i0gSY21hcAAAAYAAAACNAAACCnnC60BnbHlmAAACEAAAAxYAAAYg/iRy3mhlYWQAAAUoAAAALwAAADYVf46XaGhlYQAABVgAAAAcAAAAJAfeA45obXR4AAAFdAAAAA8AAAA0NAAAAGxvY2EAAAWEAAAAHAAAABwJBApwbWF4cAAABaAAAAAfAAAAIAEeAEpuYW1lAAAFwAAAAUUAAAJtPlT+fXBvc3QAAAcIAAAAdAAAAI5LGQcBeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeiT5TYG7438AQw9zA0AAUZgTJAQDhPgwYeJztkckRAjEQA9usWa79LvcVAAEQEC+iIrpJY9FYD5LAVa2qkcd+SMAc6MRDVChvCnleckvzO9bNrzzbTk0/7tMkHVM116Yz7Vb92LNgyUrvNgy66PmfoennN8VoWppbowSJnclWYm8y3ziYbCyORkkTJ6PMibNR+sTFqAfiarLJuBl1oxYNwxd56yFfAAAAeJx1VE9M01Acfr9WWgazY11f2zG2sb0yCAtbWNcWHQMUBQ/yJ5jWmGBIPCghhoQLEfVQYsJBEiMHY+LReFHCHQ8e9MZBD/45cDDxrDdJSDxQfQOjsK6/9r3Xvpe+73vf7+sPsQj9/sK6bB6dRjGUQAiiEsdnCmBEy6aV6ccpqEBTBpMovVg3Lh44YjwuMr2giq6HILZoLTLugSuqQGdYREdXjLtF7xt0Ihon9ycB++uKbh02lnQT3odzsFmpMiPmCFOtXB8YZobPNEDcp+G92dujmKdO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nGnoBugnOZalOKfBhLqgJeCLo6RlsJYiavdgAtir0KjsdadgRIvh8JVxf1xLB1bQk8fQ/jmF9CGhi/FV7feXuFcua1rJZrUGF+QAudC5B+2A7Qn8APVIftAAAeJxjYGRgYADik23MRfH8Nl8ZuFkYQOCmgaovgv5/lYWBWRvI5WBgAokCAPvlCHsAeJxjYGRgYG7438AQw8IAAkCSkQEV8AIARxMCdnicY2FgYGAhEQMABeQANQAAAAAAADAAagCoAN4BNgF6AcICBgJeApgC1gMQeJxjYGRgYOBlsGNgZwABJiDmAkIGhv9gPgMAEFgBaQB4nGWPTU7DMBCFX/oHpBKqqGCH5AViASj9EatuWFRq911036ZOmyqJI8et1ANwHo7ACTgC3IA78EgnmzaWx9+8eWNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxtwbEOgjAQBuD7KaWKYnglE+Pi4uRO4RIukrbBq5a3d3D1+6iin5b+61DBoIZFA4cd9mhxwBEdTmS0aP2J69RoTjIEy2XkxdwvV8OF3XkdZ3mzfQhPsff5ya9ZvLBmL0N0N95CVLabhIVNSkr0BaZTHFg=')
+ format('woff');
font-weight: normal;
font-style: normal;
}
@@ -81,7 +83,6 @@
.Ficon-other::before {
content: '\e61d';
color: #ccc;
- font-size: 18px;
}
.Ficon-warning::before {
@@ -134,8 +135,6 @@
color: #000;
}
-
-
.Ficon-success::before {
content: '\e674';
color: #000;
diff --git a/components/tabs/Tabs.js b/components/tabs/Tabs.js
index 6083a3ad4..a98e4f395 100644
--- a/components/tabs/Tabs.js
+++ b/components/tabs/Tabs.js
@@ -157,15 +157,9 @@ class Tabs extends Component {
const { activeId, showTabItems, hiddenTabItems, defaultActiveId } = this.state
const { prefixCls, type, placement, children, className, theme } = this.props
const editable = this.checkEditable()
- const tabsClasses = classNames(
- prefixCls,
- className,
- `${prefixCls}--${type}`,
- `theme__${theme}`,
- {
- [`${prefixCls}--${placement}`]: type === 'card'
- }
- )
+ const tabsClasses = classNames(prefixCls, className, `${prefixCls}--${type}`, `theme__${theme}`, {
+ [`${prefixCls}--${placement}`]: type === 'card'
+ })
let activeTabInHiddenItems = true
return (
@@ -186,7 +180,7 @@ class Tabs extends Component {
className={itemClasses}
key={`${prefixCls}__item-${index}`}
onClick={(e) => this.handleClick(item, e)}
- title={tabTitle}
+ title={type === 'editable' && tabId !== activeId ? tabTitle : null}
>
{tabTitle}
{type === 'desc' && {tabDesc}}
diff --git a/components/transfer/Item.js b/components/transfer/Item.js
index ef8114b29..0633b8a4d 100644
--- a/components/transfer/Item.js
+++ b/components/transfer/Item.js
@@ -54,9 +54,12 @@ const TYPE = 'CARD'
const source = {
beginDrag (props) {
props.setSourceNode(props.item.id)
- return {
- sourceItem: props.item
+ if (props.onDragStart(props.item)) {
+ return {
+ sourceItem: props.item
+ }
}
+ return false
},
isDragging (props, monitor) {
@@ -71,9 +74,11 @@ const target = {
drop (props, monitor, component) {
const { sourceItem } = monitor.getItem()
- const { item: targetItem, removeTargetNode, move } = props
- move(sourceItem, targetItem)
- removeTargetNode()
+ const { item: targetItem, removeTargetNode, move, onDrop } = props
+ if (onDrop(sourceItem, targetItem)) {
+ move(sourceItem, targetItem)
+ removeTargetNode()
+ }
},
hover (props, monitor, component) {
if (monitor.isOver({ shallow: true })) {
diff --git a/components/transfer/Transfer.js b/components/transfer/Transfer.js
index edfdbb2a4..fdb9310e4 100755
--- a/components/transfer/Transfer.js
+++ b/components/transfer/Transfer.js
@@ -236,6 +236,7 @@ class Transfer extends Component {
} else {
_targetList.splice(sIdx + 1, 1)
}
+ this.props.onDragEnd(_targetList)
this.setState({ targetList: _targetList })
}
setTargetNode (id, dividerPosition) {
@@ -262,7 +263,9 @@ class Transfer extends Component {
title,
disabled,
theme,
- localeDatas
+ localeDatas,
+ onDragStart,
+ onDrop
} = this.props
const {
sourceSelectedKeys,
@@ -340,6 +343,8 @@ class Transfer extends Component {
setPosition={this.setPosition}
positionX={positionX}
positionY={positionY}
+ onDragStart={onDragStart}
+ onDrop={onDrop}
/>
)
})}
@@ -421,7 +426,11 @@ Transfer.defaultProps = {
draggable: false,
emptyContent: ['暂无数据', '暂无数据'],
title: ['', ''],
- disabled: false
+ disabled: false,
+ onDragStart: () => true,
+ onDragEnd: () => {},
+ onDrop: () => true,
+ onChange: () => {}
}
Transfer.propTypes = {
mode: PropTypes.oneOf(['basic', 'multiple']), // TODO: 废弃,使用 type
@@ -431,5 +440,9 @@ Transfer.propTypes = {
searchable: PropTypes.bool,
draggable: PropTypes.bool,
disabled: PropTypes.bool,
- targetLimit: PropTypes.number
+ targetLimit: PropTypes.number,
+ onDragStart: PropTypes.func,
+ onDragEnd: PropTypes.func,
+ onDrop: PropTypes.func,
+ onChange: PropTypes.func
}
diff --git a/components/upload/Upload.js b/components/upload/Upload.js
index db0c44f1b..3cc20350b 100644
--- a/components/upload/Upload.js
+++ b/components/upload/Upload.js
@@ -191,7 +191,10 @@ class Upload extends Component {
if (fileList[index].fileId === file.fileId) {
const _fileList = [...fileList]
_fileList.splice(index, 1)
- this.setState({ fileList: _fileList })
+ this.setState({
+ fileList: _fileList,
+ fileCountLimted: _fileList.length >= this.props.maxCount
+ })
break
}
}
diff --git a/docs/demo/progress/section-circle.jsx b/docs/demo/progress/section-circle.jsx
index 34ea2f3d8..2b69acf14 100644
--- a/docs/demo/progress/section-circle.jsx
+++ b/docs/demo/progress/section-circle.jsx
@@ -71,14 +71,15 @@ class Demo extends React.Component {
+
}/>
+
+
diff --git a/docs/demo/progress/section-type.jsx b/docs/demo/progress/section-type.jsx
index 3f5d4783d..36a230c55 100644
--- a/docs/demo/progress/section-type.jsx
+++ b/docs/demo/progress/section-type.jsx
@@ -58,9 +58,9 @@ class Demo extends React.Component {
@@ -68,5 +68,12 @@ class Demo extends React.Component {
}
}`
-const DemoType = () =>
+const DemoType = () => (
+
+)
export default DemoType
diff --git a/docs/demo/progress/section-word.jsx b/docs/demo/progress/section-word.jsx
index 80e262909..9ac009741 100644
--- a/docs/demo/progress/section-word.jsx
+++ b/docs/demo/progress/section-word.jsx
@@ -11,14 +11,16 @@ class Demo extends React.Component {
)
}
}`
-const DemoWord = () =>
+const DemoWord = () => (
+
+)
export default DemoWord
diff --git a/docs/demo/transfer/section-area.jsx b/docs/demo/transfer/section-area.jsx
index 827cdd46a..9361c6117 100644
--- a/docs/demo/transfer/section-area.jsx
+++ b/docs/demo/transfer/section-area.jsx
@@ -3,45 +3,100 @@ import DocViewer from '../../../libs/doc-viewer'
import Transfer from '../../../components/transfer'
const prefix = 'transfer-area'
const desc = '可通过拖拽的形式对目标区域内进行排序'
-const code = `import React from 'react'
-import Transfer from '@hi-ui/hiui/es/transfer'\n
-class Demo extends React.Component {
- constructor () {
- super()
- this.state = {
- datas: this.randomDatas(),
- targetKeys: [2, 3, 4, 6, 9]
- }
- }
- randomDatas () {
- const arr = []
- for (let i=1;i<16; i++) {
- arr.push({
- id: i,
- content: '选项'+i
+const rightOptions = ['基础用法', '高级用法']
+const code = [{
+ code: `import React from 'react'
+ import Transfer from '@hi-ui/hiui/es/transfer'\n
+ class Demo extends React.Component {
+ constructor () {
+ super()
+ this.state = {
+ datas: this.randomDatas(),
+ targetIds: [2, 3, 4, 6, 9]
+ }
+ }
+ randomDatas () {
+ const arr = []
+ for (let i=1;i<16; i++) {
+ arr.push({
+ id: i,
+ content: '选项'+i
+ })
+ }
+ return arr
+ }
+ onChange (movedKeys) {
+ console.log(movedKeys)
+ this.setState({
+ targetIds: movedKeys
+ })
+ }
+ render () {
+ return (
+
+ )
+ }
+ }`,
+ opt: ['基础用法']
+}, {
+ code: `import React from 'react'
+ import Transfer from '@hi-ui/hiui/es/transfer'\n
+ class Demo extends React.Component {
+ constructor () {
+ super()
+ this.state = {
+ datas: this.randomDatas(),
+ targetIds: [2, 3, 4, 6, 9]
+ }
+ }
+ randomDatas () {
+ const arr = []
+ for (let i=1;i<16; i++) {
+ arr.push({
+ id: i,
+ content: '选项'+i
+ })
+ }
+ return arr
+ }
+ onChange (movedKeys) {
+ console.log(movedKeys)
+ this.setState({
+ targetIds: movedKeys
})
}
- return arr
- }
- onChange (movedKeys) {
- this.setState({
- targetKeys: movedKeys
- })
- }
- render () {
- return (
-
- )
- }
-}`
+ render () {
+ return (
+
{
+ console.log(newData)
+ }}
+ onDragStart={item => {
+ return item.id !== 3
+ }}
+ onDrop={(targetItem, sourceItem) => {
+ return targetItem.id > sourceItem.id
+ }}
+ targetIds={this.state.targetIds}
+ data={this.state.datas}
+ onChange={this.onChange.bind(this)}
+ />
+ )
+ }
+ }`,
+ opt: ['高级用法']
+}]
const DemoArea = () => (
-
+
)
export default DemoArea
diff --git a/docs/zh-CN/components/changelog.mdx b/docs/zh-CN/components/changelog.mdx
index b577119d4..27459bb1b 100644
--- a/docs/zh-CN/components/changelog.mdx
+++ b/docs/zh-CN/components/changelog.mdx
@@ -1,5 +1,25 @@
# 更新日志
+## 2.14.0
+
+- 优化 `` 垂直模式收起后没有配置 icon 的展示效果 [#1167](https://github.com/XiaoMi/hiui/issues/1167)
+- 优化 `` 国际化适配 [#1142](https://github.com/XiaoMi/hiui/issues/1142)
+- 修复 `` 环形边框颜色问题 [#1165](https://github.com/XiaoMi/hiui/issues/1165)
+- 新增 `` onDragStart/onDragEnd/onDrop 回调函数 [#1162](https://github.com/XiaoMi/hiui/issues/1162)
+- 修复 `` 设置 maxCount 后导致上传交互异常问题 [#1158](https://github.com/XiaoMi/hiui/issues/1158)
+- 修复 `` 设置 clearable 属性控制台警告问题 [#1143](https://github.com/XiaoMi/hiui/issues/1143)
+- 修复 `` type 为 amount 类型时的问题 [#1150](https://github.com/XiaoMi/hiui/issues/1150)
+- 修复 `` placement 为 inside 内容显示折断问题 [#1146](https://github.com/XiaoMi/hiui/issues/1146)
+- 修复 `` 部分图标字号问题 [#1145](https://github.com/XiaoMi/hiui/issues/1145)
+- 修复 `` type 非 editable 时,title 属性控制台警告问题 [#1144](https://github.com/XiaoMi/hiui/issues/1144)
+- 修复 `` useEmoji 为 true 时,设置 value > 5 报错问题 [#1137](https://github.com/XiaoMi/hiui/issues/1137)
+- 修复 `` 支持 withCredentials 跨域携带 cookie 属性 [#1128](https://github.com/XiaoMi/hiui/issues/1128)
+- 修复 `` 在不设置 min 属性时,只可选中到 -1 问题 [#1108](https://github.com/XiaoMi/hiui/issues/1108)
+- 修复 `` 手动输入日期相关问题 [#1106](https://github.com/XiaoMi/hiui/issues/1106)
+- 修复 `` 在禁用状态下,可清空问题 [#1099](https://github.com/XiaoMi/hiui/issues/1099)
+- 修复 `` DatePicker 在浏览器右侧时,弹出位置显示异常问题 [#1098](https://github.com/XiaoMi/hiui/issues/1098)
+- 优化国际化中简体中文 [#1125](https://github.com/XiaoMi/hiui/issues/1125)
+
## 2.13.0
- 修复 `` 行高不正确问题 [#1061](https://github.com/XiaoMi/hiui/issues/1061)
diff --git a/docs/zh-CN/components/i18n.mdx b/docs/zh-CN/components/i18n.mdx
index 9ac20f065..06fa87e43 100755
--- a/docs/zh-CN/components/i18n.mdx
+++ b/docs/zh-CN/components/i18n.mdx
@@ -1,6 +1,6 @@
# 国际化
-HIUI 目前支持简体中文、英文两种语言,默认为 **zh-CN**
+HIUI 目前支持简体中文、香港繁体、台湾繁体、英文四种语言,默认为 **zh-Hans**
## 使用方法
@@ -35,7 +35,7 @@ import DemoExample from '../../demo/i18n/section-example.jsx'
简体中文 |
- zh-CN |
+ zh-Hans | zh-CN |
英语 |
diff --git a/docs/zh-CN/components/select.mdx b/docs/zh-CN/components/select.mdx
index 8ab633de9..9a9241458 100755
--- a/docs/zh-CN/components/select.mdx
+++ b/docs/zh-CN/components/select.mdx
@@ -79,4 +79,5 @@ import DemoAsync from '../../demo/select/section-async'
| params | url 查询参数 | object | - | - |
| headers | 请求头 | object | - | - |
| mode | 请求模式 | string | 'same-origin' \| 'cors' \| 'no-cors' \| 'navigate' | 'same-origin' |
+| withCredentials | 上传请求时是否携带 cookie | boolean | true \| false | false |
| transformResponse | 成功时的回调,用于对数据进行预处理 | (response: object) => DataItem[] | - | - |
diff --git a/docs/zh-CN/components/transfer.mdx b/docs/zh-CN/components/transfer.mdx
index 42675d809..2f06bee2b 100755
--- a/docs/zh-CN/components/transfer.mdx
+++ b/docs/zh-CN/components/transfer.mdx
@@ -48,6 +48,10 @@ import DemoArea from '../../demo/transfer/section-area.jsx'
| targetLimit | 最大可穿梭上限 | number | - | - |
| targetIds | 目标框内的元素 id 集合 | number[] \| string[] | - | - |
| targetSortType | 目标框内的排序方式 | string | 'default' \| 'queue' | 'default' |
+| draggable | 是否可拖拽排序(目标框内) | boolean | | false |
+| onDragStart | 拖拽开始时的回调函数 | (dragItem: DataItem) => boolean | - | - |
+| onDragEnd | 拖拽结束时的回调函数(完成拖拽) | (newData: DataItem[]) => void | - | - |
+| onDrop | 放开拖拽元素时的回调函数,可用于条件判断,阻止拖拽到对应位置 | (targetItem: DataItem, sourceItem: DataItem) => boolean | - | - |
| onChange | 选中元素被移动到目标框内后的回调,回调值为目标框的值 | (targetKey: number[] \| string[], direction: 'left' \| 'right', moveDatas: DataItem[]) => void | - | - |
## Type
diff --git a/package.json b/package.json
index 8f3bd6df5..f98f74224 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@hi-ui/hiui",
- "version": "2.13.0",
+ "version": "2.14.0",
"description": "HIUI for React",
"scripts": {
"test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'",