Skip to content

Commit

Permalink
Merge branch 'master' into #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Merve7 authored Jul 13, 2017
2 parents ac7fb32 + 9920663 commit ae60beb
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 28 deletions.
72 changes: 52 additions & 20 deletions src/components/button/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,81 +106,113 @@ button.ui-button::-moz-focus-inner {

/* Severity Buttons */
/* Secondary */
.ui-button.ui-button-secondary.ui-state-default {
.ui-button.ui-button-secondary.ui-state-default,
.ui-splitbutton.ui-button-secondary .ui-button.ui-state-default {
background-color: #ffffff;
border-color: #cccccc;
color: #373a3c;
}

.ui-button.ui-button-secondary.ui-state-hover,
.ui-button.ui-button-secondary.ui-state-focus {
.ui-button.ui-button-secondary:enabled:hover,
.ui-button.ui-button-secondary:focus,
.ui-splitbutton.ui-button-secondary .ui-button:enabled:hover,
.ui-splitbutton.ui-button-secondary .ui-button:focus {
background-color: #f2f2f2;
border-color: #cccccc;
color: #373a3c;
}

.ui-button.ui-button-secondary.ui-state-active {
.ui-button.ui-button-secondary:enabled:active,
.ui-splitbutton.ui-button-secondary .ui-button:enabled:active {
background-color: #e6e6e6;
border-color: #cccccc;
color: #373a3c;
}

/* Success */
.ui-button.ui-button-success.ui-state-default {
.ui-button.ui-button-success.ui-state-default,
.ui-splitbutton.ui-button-success .ui-button.ui-state-default {
background-color: #5cb85c;
border-color: #5cb85c;
color: #ffffff;
}

.ui-button.ui-button-success.ui-state-hover,
.ui-button.ui-button-success.ui-state-focus {
.ui-button.ui-button-success:enabled:hover,
.ui-button.ui-button-success:focus,
.ui-splitbutton.ui-button-success .ui-button:enabled:hover,
.ui-splitbutton.ui-button-success .ui-button:focus {
background-color: #4cae4c;
border-color: #5cb85c;
}

.ui-button.ui-button-success.ui-state-active {
.ui-button.ui-button-success:enabled:active,
.ui-splitbutton.ui-button-success .ui-button:enabled:active {
background-color: #449d44;
border-color: #5cb85c;
}

/* Info */
.ui-button.ui-button-info.ui-state-default {
.ui-button.ui-button-info.ui-state-default,
.ui-splitbutton.ui-button-info .ui-button.ui-state-default {
background-color: #5bc0de;
border-color: #5bc0de;
color: #ffffff;
}

.ui-button.ui-button-info.ui-state-hover,
.ui-button.ui-button-info.ui-state-focus {
.ui-button.ui-button-info:enabled:hover,
.ui-button.ui-button-info:focus,
.ui-splitbutton.ui-button-info .ui-button:enabled:hover,
.ui-splitbutton.ui-button-info .ui-button:focus {
background-color: #46b8da;
border-color: #5bc0de;
}

.ui-button.ui-button-info.ui-state-active {
.ui-button.ui-button-info:enabled:active,
.ui-splitbutton.ui-button-info .ui-button:enabled:active {
background-color: #31b0d5;
border-color: #5bc0de;
}

/* Warning */
.ui-button.ui-button-warning.ui-state-default {
.ui-button.ui-button-warning.ui-state-default,
.ui-splitbutton.ui-button-warning .ui-button.ui-state-default {
background-color: #f0ad4e;
border-color: #f0ad4e;
color: #ffffff;
}

.ui-button.ui-button-warning.ui-state-hover,
.ui-button.ui-button-warning.ui-state-focus {
.ui-button.ui-button-warning:enabled:hover,
.ui-button.ui-button-warning:focus,
.ui-splitbutton.ui-button-warning .ui-button:enabled:hover,
.ui-splitbutton.ui-button-warning .ui-button:focus {
background-color: #eea236;
border-color: #f0ad4e;
}

.ui-button.ui-button-warning.ui-state-active {
.ui-button.ui-button-warning:enabled:active,
.ui-splitbutton.ui-button-warning .ui-button:enabled:active {
background-color: #ec971f;
border-color: #f0ad4e;
}

/* Danger */
.ui-button.ui-button-danger.ui-state-default {
.ui-button.ui-button-danger.ui-state-default,
.ui-splitbutton.ui-button-danger .ui-button.ui-state-default {
background-color: #d9534f;
border-color: #d9534f;
color: #ffffff;
}

.ui-button.ui-button-danger.ui-state-hover,
.ui-button.ui-button-danger.ui-state-focus {
.ui-button.ui-button-danger:enabled:hover,
.ui-button.ui-button-danger:focus,
.ui-splitbutton.ui-button-danger .ui-button:enabled:hover,
.ui-splitbutton.ui-button-danger .ui-button:focus {
background-color: #d43f3a;
border-color: #d9534f;
}

.ui-button.ui-button-danger.ui-state-active {
.ui-button.ui-button-danger:enabled:active,
.ui-splitbutton.ui-button-danger .ui-button:enabled:active {
background-color: #c9302c;
border-color: #d9534f;
}
6 changes: 1 addition & 5 deletions src/components/button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export class Button extends Component {
delete buttonProps.icon;
delete buttonProps.label;

if (buttonProps.type !== 'submit' && buttonProps.type !== 'reset') {
buttonProps.type = 'button'
}

if(this.props.icon) {
iconStyleClass = classNames(this.props.icon, 'ui-c fa fa-fw', {
'ui-button-icon-left': this.props.iconPos !== 'right',
Expand All @@ -45,7 +41,7 @@ export class Button extends Component {
return (
<button {...buttonProps} className={styleClass}>
{this.props.icon && <span className={iconStyleClass}></span>}
<span className="ui-button-text ui-c">{this.props.label || 'ui-button'}</span>
<span className="ui-button-text ui-c">{this.props.label||'ui-btn'}</span>
{this.props.children}
</button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export class Dropdown extends Component {
var selected = (this.props.value !== null && this.props.value === option.value) || (this.props.value === null && index === 0);
var listItemStyleClass = classNames('ui-dropdown-item ui-corner-all', {'ui-state-highlight': selected || this.state.highlightOption === option});
var listItem = <li className={listItemStyleClass} key={option.value} onClick={(event) => this.onOptionClick(event, option)}
>
>
{listItemContent}
</li>;

Expand Down
16 changes: 16 additions & 0 deletions src/components/utils/ObjectUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,21 @@ export default class ObjectUtils {
return null;
}
}
static filter(value, fields, filterValue) {
var filteredItems=[];

if(value) {
for(let item of value) {
for(let field of fields) {
if(String(this.resolveFieldData(item, field)).toLowerCase().indexOf(filterValue.toLowerCase()) > -1) {
filteredItems.push(item);
break;
}
}
}
}

return filteredItems;
}

}
8 changes: 6 additions & 2 deletions src/showcase/button/ButtonDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export class ButtonDemo extends Component {
}

increment() {
this.setState({count: this.state.count + 1});
this.setState((prevState, props) => ({
count: prevState.count + 1
}));
}

render() {
Expand Down Expand Up @@ -206,7 +208,9 @@ export class ButtonDemo extends Component {
}
increment() {
this.setState({count: this.state.count + 1});
this.setState((prevState, props) => ({
count: prevState.count + 1
}));
}
render() {
Expand Down

0 comments on commit ae60beb

Please sign in to comment.