diff --git a/package.json b/package.json index 00aa425a3..8d785b424 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "focus-components", - "version": "2.2.0", + "version": "2.2.1", "description": "Focus component repository.", "main": "index.js", "scripts": { diff --git a/src/components/dropdown/action-menu.js b/src/components/dropdown/action-menu.js index a7bafced2..319fd9ecc 100644 --- a/src/components/dropdown/action-menu.js +++ b/src/components/dropdown/action-menu.js @@ -1,8 +1,11 @@ import React, { Component } from 'react'; -import Button from '../../components/button'; import { translate } from 'focus-core/translation'; import noop from 'lodash/utility/noop' +import Button from '../../components/button'; +import MDBehaviour from '../../behaviours/material'; + +@MDBehaviour('dropdown') /** * Action menu component * diff --git a/src/components/dropdown/index.js b/src/components/dropdown/index.js index db864c80d..cd27f7876 100644 --- a/src/components/dropdown/index.js +++ b/src/components/dropdown/index.js @@ -1,8 +1,6 @@ import React, { Component, PropTypes } from 'react'; import ReactDOM from 'react-dom'; - import uuid from 'uuid'; -import 'material-design-lite/material'; import ActionMenu from './action-menu'; @@ -28,27 +26,6 @@ class Dropdown extends Component { this._htmlId = uuid.v4(); } - /** @inheritdoc */ - componentDidMount() { - if (0 !== this.props.operationList.length && ReactDOM.findDOMNode(this.refs.dropdown)) { - componentHandler.upgradeElement(ReactDOM.findDOMNode(this.refs.dropdown)); - } - } - - /** @inheritdoc */ - componentWillReceiveProps(nextProps) { - if (0 !== nextProps.operationList.length && ReactDOM.findDOMNode(this.refs.dropdown)) { - componentHandler.upgradeElement(ReactDOM.findDOMNode(this.refs.dropdown)); - } - } - - /** @inheritdoc */ - componentWillUnmount() { - if (0 !== this.props.operationList.length && ReactDOM.findDOMNode(this.refs.dropdown)) { - componentHandler.downgradeElements(ReactDOM.findDOMNode(this.refs.dropdown)); - } - } - /** @inheritdoc */ render() { const { iconProps, operationList, position, shape } = this.props; diff --git a/src/components/input/autocomplete-select-multiple/field.js b/src/components/input/autocomplete-select-multiple/field.js index e65902ae3..58fb4f263 100644 --- a/src/components/input/autocomplete-select-multiple/field.js +++ b/src/components/input/autocomplete-select-multiple/field.js @@ -68,7 +68,12 @@ class MultiAutocomplete extends Component { */ validate() { // do nothing, validation is done at each selection - return true; + const { isRequired } = this.props; + return ({ + isValid: !isRequired || (this.props.value && this.props.value.length > 0), + message: 'field.required' + }); + } /** diff --git a/src/index.js b/src/index.js index dc825c416..837ddf3fa 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ //Generator http://patorjk.com/software/taag/#p=display&h=1&f=Banner4&t=Focus-COMPONENTS -import './style'; +// import './style'; import translation from 'focus-core/translation'; import history from 'focus-core/history';