Skip to content

Commit

Permalink
feat(Upload): mod upload config ability
Browse files Browse the repository at this point in the history
  • Loading branch information
tao1991123 committed Jan 16, 2019
1 parent 6ee1ba3 commit 432ef76
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
15 changes: 13 additions & 2 deletions docs/upload/theme/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ const demo1 = {
label: '附件大小',
value: 'true',
enum: [{label: '显示', value: 'true'}, {label: '隐藏', value: 'false'}]
},
errMsg: {
label: '错误提示',
value: 'true',
enum: [{label: '显示', value: 'true'}, {label: '隐藏', value: 'false'}]
}
};

Expand All @@ -49,6 +54,11 @@ const demo2 = {
label: '附件大小',
value: 'true',
enum: [{label: '显示', value: 'true'}, {label: '隐藏', value: 'false'}]
},
errMsg: {
label: '错误提示',
value: 'true',
enum: [{label: '显示', value: 'true'}, {label: '隐藏', value: 'false'}]
}
};

Expand Down Expand Up @@ -110,7 +120,7 @@ class FunctionDemo extends React.Component {
limit={1}
listType="text"
closable={getValue('demo1').closeable.value === 'true'}
value={[Object.assign({}, list, { state: 'error' })]}
value={[Object.assign({}, list, { state: 'error', errorMsg: getValue('demo1').errMsg.value === 'true' ? 'Error Messgae' : undefined })]}
style={style}
/>
</DemoGroup>
Expand Down Expand Up @@ -156,10 +166,11 @@ class FunctionDemo extends React.Component {
listType="image"
limit={1}
closable={getValue('demo2').closeable.value === 'true'}
defaultValue={[{
value={[{
name: 'IMG_20140109_121958.jpg',
state: 'error',
url: 'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg',
errorMsg: getValue('demo2').errMsg.value === 'true' ? 'Error Messgae' : undefined,
}]}
style={style}
/>
Expand Down
1 change: 1 addition & 0 deletions src/upload/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
transition: all .2s ease-out;
}

&-size {
Expand Down
15 changes: 8 additions & 7 deletions src/upload/scss/variable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ $upload-text-list-size-font-color-hover: $color-brand1-6 !default;

// Simple with Image
// -----------------------------------
/// padding
/// padding (t, b)
/// @namespace size/bounding
$upload-image-list-item-padding: $s-2 !default;
/// padding (l)
Expand Down Expand Up @@ -110,14 +110,12 @@ $upload-image-list-close-icon-right: $s-1 !default;
/// @namespace size/border
$upload-image-list-item-border-width: $line-1 !default;
/// background
/// @namespace statement/normal/bounding
/// @namespace statement/normal
$upload-image-list-item-bg-color: $color-white !default;
/// background
/// @namespace statement/normal/uploading
$upload-image-list-item-uploading-bg-color: $color-transparent !default;
/// background
/// @namespace statement/normal/uploading
$upload-image-list-item-error-bg-color: $color-transparent !default;
/// @namespace statement/uploading
$upload-image-list-item-uploading-bg-color: $color-white !default;

/// icon
/// @namespace statement/normal/close
$upload-image-list-close-icon-color: $color-text1-2 !default;
Expand All @@ -130,6 +128,9 @@ $upload-image-list-item-border-color: $color-line1-2 !default;
/// border
/// @namespace statement/error/bounding
$upload-image-list-item-border-color-error: $color-error-3 !default;
/// background
/// @namespace statement/error
$upload-image-list-item-error-bg-color: $color-white !default;
/// border
/// @namespace statement/hover/bounding
$upload-image-list-item-border-color-hover: $color-brand1-6 !default;
Expand Down

0 comments on commit 432ef76

Please sign in to comment.