material-ui-color-picker
Version:
<ColorInput> component for material-ui
44 lines (34 loc) • 1.14 kB
JavaScript
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactColor = require('react-color');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PickerDialog = function PickerDialog(_ref) {
var value = _ref.value,
onClick = _ref.onClick,
onChange = _ref.onChange;
return _react2.default.createElement(
'div',
{ style: { position: 'absolute', zIndex: '2' } },
_react2.default.createElement('div', {
style: { position: 'fixed', top: '0px', right: '0px', bottom: '0px', left: '0px' },
onClick: onClick
}),
_react2.default.createElement(_reactColor.ChromePicker, {
color: value,
onChange: onChange
})
);
};
PickerDialog.propTypes = {
value: _propTypes2.default.string,
onChange: _propTypes2.default.func,
onClick: _propTypes2.default.func
};
exports.default = PickerDialog;
module.exports = exports['default'];