mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
Compare commits
5 Commits
chore/scri
...
1.11.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44fd5990f6 | ||
|
|
d009cf0b76 | ||
|
|
51b74b7daa | ||
|
|
635bc8cedc | ||
|
|
ff59663898 |
@@ -90,7 +90,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------------------------------------|-----|--------|
|
||||
| options.id | 必填输入控件唯一标志 | string | |
|
||||
| options.id | 必填,输入控件唯一标志 | string | |
|
||||
| options.valuePropName | 子节点的值的属性,如 Switch 的是 'checked' | string | 'value' |
|
||||
| options.initialValue | 子节点的初始值,类型、可选值均由子节点决定 | | |
|
||||
| options.trigger | 收集子节点的值的时机 | string | 'onChange' |
|
||||
|
||||
@@ -37,6 +37,21 @@ const SIZING_STYLE = [
|
||||
let computedStyleCache = {};
|
||||
let hiddenTextarea;
|
||||
|
||||
function computedStyle(node) {
|
||||
return window.getComputedStyle ? getComputedStyle(node) : node.currentStyle;
|
||||
}
|
||||
|
||||
function getStylePropertyValue(style, prop) {
|
||||
let value;
|
||||
if (style) {
|
||||
value = window.getComputedStyle ?
|
||||
style.getPropertyValue(prop)
|
||||
:
|
||||
style[prop.replace(/-(\w)/gi, (word, letter) => letter.toUpperCase())];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function calculateNodeStyling(node, useCache = false) {
|
||||
const nodeRef = (
|
||||
node.getAttribute('id') ||
|
||||
@@ -48,26 +63,26 @@ function calculateNodeStyling(node, useCache = false) {
|
||||
return computedStyleCache[nodeRef];
|
||||
}
|
||||
|
||||
const style = window.getComputedStyle(node);
|
||||
const style = computedStyle(node);
|
||||
|
||||
const boxSizing = (
|
||||
style.getPropertyValue('box-sizing') ||
|
||||
style.getPropertyValue('-moz-box-sizing') ||
|
||||
style.getPropertyValue('-webkit-box-sizing')
|
||||
getStylePropertyValue(style, 'box-sizing') ||
|
||||
getStylePropertyValue(style, '-moz-box-sizing') ||
|
||||
getStylePropertyValue(style, '-webkit-box-sizing')
|
||||
);
|
||||
|
||||
const paddingSize = (
|
||||
parseFloat(style.getPropertyValue('padding-bottom')) +
|
||||
parseFloat(style.getPropertyValue('padding-top'))
|
||||
parseFloat(getStylePropertyValue(style, 'padding-bottom')) +
|
||||
parseFloat(getStylePropertyValue(style, 'padding-top'))
|
||||
);
|
||||
|
||||
const borderSize = (
|
||||
parseFloat(style.getPropertyValue('border-bottom-width')) +
|
||||
parseFloat(style.getPropertyValue('border-top-width'))
|
||||
parseFloat(getStylePropertyValue(style, 'border-bottom-width')) +
|
||||
parseFloat(getStylePropertyValue(style, 'border-top-width'))
|
||||
);
|
||||
|
||||
const sizingStyle = SIZING_STYLE
|
||||
.map(name => `${name}:${style.getPropertyValue(name)}`)
|
||||
.map(name => `${name}:${getStylePropertyValue(style, name)}`)
|
||||
.join(';');
|
||||
|
||||
const nodeInfo = {
|
||||
|
||||
@@ -280,9 +280,11 @@ export default class Upload extends React.Component {
|
||||
[`${prefixCls}-disabled`]: this.props.disabled,
|
||||
});
|
||||
|
||||
const uploadButton = this.props.children
|
||||
? <div className={uploadButtonCls}><RcUpload {...props} ref="upload" /></div>
|
||||
: null;
|
||||
const uploadButton = (
|
||||
<div className={uploadButtonCls} style={{ display: this.props.children ? '' : 'none'}}>
|
||||
<RcUpload {...props} ref="upload" />
|
||||
</div>
|
||||
);
|
||||
|
||||
if (this.props.listType === 'picture-card') {
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "antd",
|
||||
"version": "1.11.2",
|
||||
"version": "1.11.4",
|
||||
"title": "Ant Design",
|
||||
"description": "An enterprise-class UI design language and React-based implementation",
|
||||
"homepage": "http://ant.design/",
|
||||
|
||||
Reference in New Issue
Block a user