Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
add: Input 类型textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
shenlq committed Nov 8, 2016
1 parent 432f440 commit 8692aa7
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-impression",
"version": "0.5.1",
"version": "1.0.1",
"author": "peter.shenlq",
"description": "An enterprise-class UI design language and React-based implementation.",
"main": "./lib/index.js",
Expand Down
13 changes: 12 additions & 1 deletion site/src/scripts/components/impression/components/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Input extends PureComponent {
// 行内样式
style: PropTypes.object,
// 类型
type: PropTypes.oneOf(['text', 'password', 'file', 'date', 'emaile', 'month', 'search']),
type: PropTypes.oneOf(['text', 'password', 'file', 'date', 'emaile', 'month', 'search', 'textarea']),
// 提示
placeholder: PropTypes.string,
// 值
Expand Down Expand Up @@ -226,6 +226,17 @@ export default class Input extends PureComponent {
className={className}
placeholder={placeholder} />
);
case 'textarea':
return (
<textarea
rows="10"
ref="main"
style={style}
disabled={disabled}
placeholder={placeholder}
{...others}
className={classnames('form-control', className)} />
);
default:
return (
<div
Expand Down
2 changes: 1 addition & 1 deletion site/src/scripts/views/RadioView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class RadioView extends Component {
}
onChangeHandle = () => {
// console.log(Radio.getValue(this.refs.radio));
// console.log(RadioGroup.getValue(this.refs.radios));
console.log(RadioGroup.getValue(this.refs.radios));
}
render() {
let radioArray = [{
Expand Down
2 changes: 1 addition & 1 deletion site/src/styles/impression/modules/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}

max-height: 75%;
overflow-y: auto;
overflow-y: visible;
}

// Footer (for actions)
Expand Down
8 changes: 8 additions & 0 deletions site/src/styles/impression/utilities/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
padding: 0 !important;
}

.no-padding-t {
padding-top: 0 !important;
}

.no-padding-b {
padding-bottom: 0 !important;
}

.no-padding-l {
padding-left: 0 !important;
}
Expand Down
13 changes: 12 additions & 1 deletion src/scripts/components/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Input extends PureComponent {
// 行内样式
style: PropTypes.object,
// 类型
type: PropTypes.oneOf(['text', 'password', 'file', 'date', 'emaile', 'month', 'search']),
type: PropTypes.oneOf(['text', 'password', 'file', 'date', 'emaile', 'month', 'search', 'textarea']),
// 提示
placeholder: PropTypes.string,
// 值
Expand Down Expand Up @@ -226,6 +226,17 @@ export default class Input extends PureComponent {
className={className}
placeholder={placeholder} />
);
case 'textarea':
return (
<textarea
rows="10"
ref="main"
style={style}
disabled={disabled}
placeholder={placeholder}
{...others}
className={classnames('form-control', className)} />
);
default:
return (
<div
Expand Down
2 changes: 1 addition & 1 deletion src/styles/modules/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}

max-height: 75%;
overflow-y: auto;
overflow-y: visible;
}

// Footer (for actions)
Expand Down
8 changes: 8 additions & 0 deletions src/styles/utilities/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
padding: 0 !important;
}

.no-padding-t {
padding-top: 0 !important;
}

.no-padding-b {
padding-bottom: 0 !important;
}

.no-padding-l {
padding-left: 0 !important;
}
Expand Down

0 comments on commit 8692aa7

Please sign in to comment.