build new version
parent
8a91ab3bed
commit
d48799ba09
|
@ -64,7 +64,7 @@ var factory = function factory(Chip, Input) {
|
||||||
_inherits(Autocomplete, _Component);
|
_inherits(Autocomplete, _Component);
|
||||||
|
|
||||||
function Autocomplete() {
|
function Autocomplete() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ var factory = function factory(Chip, Input) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Autocomplete)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
direction: _this.props.direction,
|
direction: _this.props.direction,
|
||||||
focus: false,
|
focus: false,
|
||||||
showAllSuggestions: _this.props.showSuggestionsWhenValueIsSet,
|
showAllSuggestions: _this.props.showSuggestionsWhenValueIsSet,
|
||||||
|
@ -109,7 +109,7 @@ var factory = function factory(Chip, Input) {
|
||||||
}
|
}
|
||||||
_this.setState({ active: target });
|
_this.setState({ active: target });
|
||||||
}
|
}
|
||||||
_this.select(target, event);
|
_this.select(event, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.which === 27) _reactDom2.default.findDOMNode(_this).querySelector('input').blur();
|
if (event.which === 27) _reactDom2.default.findDOMNode(_this).querySelector('input').blur();
|
||||||
|
@ -123,10 +123,11 @@ var factory = function factory(Chip, Input) {
|
||||||
}
|
}
|
||||||
}, _this.handleSuggestionHover = function (event) {
|
}, _this.handleSuggestionHover = function (event) {
|
||||||
_this.setState({ active: event.target.id });
|
_this.setState({ active: event.target.id });
|
||||||
}, _this.select = function (event) {
|
}, _this.select = function (event, target) {
|
||||||
_events2.default.pauseEvent(event);
|
_events2.default.pauseEvent(event);
|
||||||
var values = _this.values(_this.props.value);
|
var values = _this.values(_this.props.value);
|
||||||
_this.handleChange([event.target.id].concat(_toConsumableArray(values.keys())), event);
|
var newValue = target === void 0 ? event.target.id : target;
|
||||||
|
_this.handleChange([newValue].concat(_toConsumableArray(values.keys())), event);
|
||||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +177,8 @@ var factory = function factory(Chip, Input) {
|
||||||
key: 'suggestions',
|
key: 'suggestions',
|
||||||
value: function suggestions() {
|
value: function suggestions() {
|
||||||
var suggest = new Map();
|
var suggest = new Map();
|
||||||
var query = (this.state.query || (!this.props.multiple ? this.props.value : '')).toLowerCase().trim() || '';
|
var rawQuery = this.state.query || this.props.multiple ? '' : this.props.value;
|
||||||
|
var query = (rawQuery || '').toLowerCase().trim();
|
||||||
var values = this.values();
|
var values = this.values();
|
||||||
var source = this.source();
|
var source = this.source();
|
||||||
|
|
||||||
|
@ -333,11 +335,11 @@ var factory = function factory(Chip, Input) {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
if (this.props.multiple) {
|
if (this.props.multiple) {
|
||||||
var selectedItems = [].concat(_toConsumableArray(this.values())).map(function (_ref) {
|
var selectedItems = [].concat(_toConsumableArray(this.values())).map(function (_ref2) {
|
||||||
var _ref2 = _slicedToArray(_ref, 2);
|
var _ref3 = _slicedToArray(_ref2, 2);
|
||||||
|
|
||||||
var key = _ref2[0];
|
var key = _ref3[0];
|
||||||
var value = _ref2[1];
|
var value = _ref3[1];
|
||||||
|
|
||||||
return _react2.default.createElement(
|
return _react2.default.createElement(
|
||||||
Chip,
|
Chip,
|
||||||
|
@ -365,11 +367,11 @@ var factory = function factory(Chip, Input) {
|
||||||
|
|
||||||
var theme = this.props.theme;
|
var theme = this.props.theme;
|
||||||
|
|
||||||
var suggestions = [].concat(_toConsumableArray(this.suggestions())).map(function (_ref3) {
|
var suggestions = [].concat(_toConsumableArray(this.suggestions())).map(function (_ref4) {
|
||||||
var _ref4 = _slicedToArray(_ref3, 2);
|
var _ref5 = _slicedToArray(_ref4, 2);
|
||||||
|
|
||||||
var key = _ref4[0];
|
var key = _ref5[0];
|
||||||
var value = _ref4[1];
|
var value = _ref5[1];
|
||||||
|
|
||||||
var className = (0, _classnames5.default)(theme.suggestion, _defineProperty({}, theme.active, _this3.state.active === key));
|
var className = (0, _classnames5.default)(theme.suggestion, _defineProperty({}, theme.active, _this3.state.active === key));
|
||||||
return _react2.default.createElement(
|
return _react2.default.createElement(
|
||||||
|
|
|
@ -46,7 +46,7 @@ var factory = function factory(ripple, FontIcon) {
|
||||||
_inherits(Button, _Component);
|
_inherits(Button, _Component);
|
||||||
|
|
||||||
function Button() {
|
function Button() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ var factory = function factory(ripple, FontIcon) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Button)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleMouseUp = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Button.__proto__ || Object.getPrototypeOf(Button)).call.apply(_ref, [this].concat(args))), _this), _this.handleMouseUp = function (event) {
|
||||||
_this.refs.button.blur();
|
_this.refs.button.blur();
|
||||||
if (_this.props.onMouseUp) _this.props.onMouseUp(event);
|
if (_this.props.onMouseUp) _this.props.onMouseUp(event);
|
||||||
}, _this.handleMouseLeave = function (event) {
|
}, _this.handleMouseLeave = function (event) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ var factory = function factory(ripple, FontIcon) {
|
||||||
_inherits(IconButton, _Component);
|
_inherits(IconButton, _Component);
|
||||||
|
|
||||||
function IconButton() {
|
function IconButton() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ var factory = function factory(ripple, FontIcon) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(IconButton)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleMouseUp = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = IconButton.__proto__ || Object.getPrototypeOf(IconButton)).call.apply(_ref, [this].concat(args))), _this), _this.handleMouseUp = function (event) {
|
||||||
_this.refs.button.blur();
|
_this.refs.button.blur();
|
||||||
if (_this.props.onMouseUp) _this.props.onMouseUp(event);
|
if (_this.props.onMouseUp) _this.props.onMouseUp(event);
|
||||||
}, _this.handleMouseLeave = function (event) {
|
}, _this.handleMouseLeave = function (event) {
|
||||||
|
|
|
@ -31,14 +31,14 @@
|
||||||
> span:not([data-react-toolbox="tooltip"]) {
|
> span:not([data-react-toolbox="tooltip"]) {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
line-height: $button-height;
|
line-height: $button-height;
|
||||||
vertical-align: middle;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
> svg {
|
> svg {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 1em;
|
width: 1em;
|
||||||
height: $button-height;
|
height: $button-height;
|
||||||
font-size: 120%;
|
font-size: 120%;
|
||||||
vertical-align: middle;
|
vertical-align: top;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
}
|
}
|
||||||
> * {
|
> * {
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
> .icon, svg {
|
> .icon, svg {
|
||||||
font-size: $button-toggle-font-size;
|
font-size: $button-toggle-font-size;
|
||||||
line-height: $button-height;
|
line-height: $button-height;
|
||||||
vertical-align: middle;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
> .rippleWrapper {
|
> .rippleWrapper {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|
|
@ -46,7 +46,7 @@ var factory = function factory(Check) {
|
||||||
_inherits(Checkbox, _Component);
|
_inherits(Checkbox, _Component);
|
||||||
|
|
||||||
function Checkbox() {
|
function Checkbox() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ var factory = function factory(Check) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Checkbox)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleToggle = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).call.apply(_ref, [this].concat(args))), _this), _this.handleToggle = function (event) {
|
||||||
if (event.pageX !== 0 && event.pageY !== 0) _this.blur();
|
if (event.pageX !== 0 && event.pageY !== 0) _this.blur();
|
||||||
if (!_this.props.disabled && _this.props.onChange) {
|
if (!_this.props.disabled && _this.props.onChange) {
|
||||||
_this.props.onChange(!_this.props.checked, event);
|
_this.props.onChange(!_this.props.checked, event);
|
||||||
|
|
|
@ -43,7 +43,7 @@ var factory = function factory(IconButton) {
|
||||||
_inherits(Calendar, _Component);
|
_inherits(Calendar, _Component);
|
||||||
|
|
||||||
function Calendar() {
|
function Calendar() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -53,17 +53,17 @@ var factory = function factory(IconButton) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Calendar)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Calendar.__proto__ || Object.getPrototypeOf(Calendar)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
viewDate: _this.props.selectedDate
|
viewDate: _this.props.selectedDate
|
||||||
}, _this.handleDayClick = function (day) {
|
}, _this.handleDayClick = function (day) {
|
||||||
_this.props.onChange(_time2.default.setDay(_this.state.viewDate, day), true);
|
_this.props.onChange(_time2.default.setDay(_this.state.viewDate, day), true);
|
||||||
}, _this.handleYearClick = function (event) {
|
}, _this.handleYearClick = function (event) {
|
||||||
var year = parseInt(event.target.id);
|
var year = parseInt(event.currentTarget.id);
|
||||||
var viewDate = _time2.default.setYear(_this.props.selectedDate, year);
|
var viewDate = _time2.default.setYear(_this.props.selectedDate, year);
|
||||||
_this.setState({ viewDate: viewDate });
|
_this.setState({ viewDate: viewDate });
|
||||||
_this.props.onChange(viewDate, false);
|
_this.props.onChange(viewDate, false);
|
||||||
}, _this.changeViewMonth = function (event) {
|
}, _this.changeViewMonth = function (event) {
|
||||||
var direction = event.target.id;
|
var direction = event.currentTarget.id;
|
||||||
_this.setState({
|
_this.setState({
|
||||||
direction: direction,
|
direction: direction,
|
||||||
viewDate: _time2.default.addMonths(_this.state.viewDate, DIRECTION_STEPS[direction])
|
viewDate: _time2.default.addMonths(_this.state.viewDate, DIRECTION_STEPS[direction])
|
||||||
|
|
|
@ -32,7 +32,7 @@ var Day = function (_Component) {
|
||||||
_inherits(Day, _Component);
|
_inherits(Day, _Component);
|
||||||
|
|
||||||
function Day() {
|
function Day() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ var Day = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Day)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleClick = function () {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Day.__proto__ || Object.getPrototypeOf(Day)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function () {
|
||||||
if (!_this.props.disabled && _this.props.onClick) {
|
if (!_this.props.disabled && _this.props.onClick) {
|
||||||
_this.props.onClick(_this.props.day);
|
_this.props.onClick(_this.props.day);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ var Month = function (_Component) {
|
||||||
_inherits(Month, _Component);
|
_inherits(Month, _Component);
|
||||||
|
|
||||||
function Month() {
|
function Month() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ var Month = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Month)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleDayClick = function (day) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Month.__proto__ || Object.getPrototypeOf(Month)).call.apply(_ref, [this].concat(args))), _this), _this.handleDayClick = function (day) {
|
||||||
if (_this.props.onDayClick) _this.props.onDayClick(day);
|
if (_this.props.onDayClick) _this.props.onDayClick(day);
|
||||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ var factory = function factory(Input, DatePickerDialog) {
|
||||||
_inherits(DatePicker, _Component);
|
_inherits(DatePicker, _Component);
|
||||||
|
|
||||||
function DatePicker() {
|
function DatePicker() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ var factory = function factory(Input, DatePickerDialog) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(DatePicker)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DatePicker.__proto__ || Object.getPrototypeOf(DatePicker)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
active: _this.props.active
|
active: _this.props.active
|
||||||
}, _this.handleDismiss = function () {
|
}, _this.handleDismiss = function () {
|
||||||
_this.setState({ active: false });
|
_this.setState({ active: false });
|
||||||
|
|
|
@ -31,7 +31,7 @@ var factory = function factory(Dialog, Calendar) {
|
||||||
_inherits(CalendarDialog, _Component);
|
_inherits(CalendarDialog, _Component);
|
||||||
|
|
||||||
function CalendarDialog() {
|
function CalendarDialog() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ var factory = function factory(Dialog, Calendar) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(CalendarDialog)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CalendarDialog.__proto__ || Object.getPrototypeOf(CalendarDialog)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
display: 'months',
|
display: 'months',
|
||||||
date: _this.props.value
|
date: _this.props.value
|
||||||
}, _this.handleNewDate = function (value, dayClick) {
|
}, _this.handleNewDate = function (value, dayClick) {
|
||||||
|
|
|
@ -47,6 +47,18 @@
|
||||||
width: 96vw;
|
width: 96vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fullscreen {
|
||||||
|
width: 96vw;
|
||||||
|
|
||||||
|
@media screen and (max-width: $layout-breakpoint-xs) {
|
||||||
|
max-width: 100vw;
|
||||||
|
max-height: 100vh;
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
@include typo-title();
|
@include typo-title();
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
|
|
|
@ -50,7 +50,7 @@ var factory = function factory(Input) {
|
||||||
_inherits(Dropdown, _Component);
|
_inherits(Dropdown, _Component);
|
||||||
|
|
||||||
function Dropdown() {
|
function Dropdown() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ var factory = function factory(Input) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Dropdown)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
active: false,
|
active: false,
|
||||||
up: false
|
up: false
|
||||||
}, _this.close = function () {
|
}, _this.close = function () {
|
||||||
|
|
|
@ -80,7 +80,7 @@ var factory = function factory(Autocomplete, Button, Checkbox, DatePicker, Dropd
|
||||||
_inherits(Form, _Component);
|
_inherits(Form, _Component);
|
||||||
|
|
||||||
function Form() {
|
function Form() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ var factory = function factory(Autocomplete, Button, Checkbox, DatePicker, Dropd
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Form)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.onSubmit = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Form.__proto__ || Object.getPrototypeOf(Form)).call.apply(_ref, [this].concat(args))), _this), _this.onSubmit = function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (_this.props.onSubmit) _this.props.onSubmit(event);
|
if (_this.props.onSubmit) _this.props.onSubmit(event);
|
||||||
}, _this.onChange = function (field, value, event) {
|
}, _this.onChange = function (field, value, event) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ var ActivableRendererFactory = function ActivableRendererFactory() {
|
||||||
_inherits(ActivableRenderer, _Component);
|
_inherits(ActivableRenderer, _Component);
|
||||||
|
|
||||||
function ActivableRenderer() {
|
function ActivableRenderer() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ var ActivableRendererFactory = function ActivableRendererFactory() {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(ActivableRenderer)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ActivableRenderer.__proto__ || Object.getPrototypeOf(ActivableRenderer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
active: _this.props.active,
|
active: _this.props.active,
|
||||||
rendered: _this.props.active
|
rendered: _this.props.active
|
||||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||||
|
|
|
@ -28,7 +28,7 @@ var Portal = function (_Component) {
|
||||||
function Portal() {
|
function Portal() {
|
||||||
_classCallCheck(this, Portal);
|
_classCallCheck(this, Portal);
|
||||||
|
|
||||||
return _possibleConstructorReturn(this, Object.getPrototypeOf(Portal).apply(this, arguments));
|
return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(Portal, [{
|
_createClass(Portal, [{
|
||||||
|
|
|
@ -44,7 +44,7 @@ var factory = function factory(FontIcon) {
|
||||||
_inherits(Input, _React$Component);
|
_inherits(Input, _React$Component);
|
||||||
|
|
||||||
function Input() {
|
function Input() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ var factory = function factory(FontIcon) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Input)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleChange = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Input.__proto__ || Object.getPrototypeOf(Input)).call.apply(_ref, [this].concat(args))), _this), _this.handleChange = function (event) {
|
||||||
var _this$props = _this.props;
|
var _this$props = _this.props;
|
||||||
var onChange = _this$props.onChange;
|
var onChange = _this$props.onChange;
|
||||||
var multiline = _this$props.multiline;
|
var multiline = _this$props.multiline;
|
||||||
|
|
|
@ -38,7 +38,7 @@ var factory = function factory(ListItem) {
|
||||||
function List() {
|
function List() {
|
||||||
_classCallCheck(this, List);
|
_classCallCheck(this, List);
|
||||||
|
|
||||||
return _possibleConstructorReturn(this, Object.getPrototypeOf(List).apply(this, arguments));
|
return _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(List, [{
|
_createClass(List, [{
|
||||||
|
|
|
@ -44,7 +44,7 @@ var factory = function factory(ripple, ListItemLayout, ListItemContent) {
|
||||||
_inherits(ListItem, _Component);
|
_inherits(ListItem, _Component);
|
||||||
|
|
||||||
function ListItem() {
|
function ListItem() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ var factory = function factory(ripple, ListItemLayout, ListItemContent) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(ListItem)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleClick = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ListItem.__proto__ || Object.getPrototypeOf(ListItem)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (event) {
|
||||||
if (_this.props.onClick && !_this.props.disabled) {
|
if (_this.props.onClick && !_this.props.disabled) {
|
||||||
_this.props.onClick(event);
|
_this.props.onClick(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ var factory = function factory(ListItemText) {
|
||||||
function ListItemContent() {
|
function ListItemContent() {
|
||||||
_classCallCheck(this, ListItemContent);
|
_classCallCheck(this, ListItemContent);
|
||||||
|
|
||||||
return _possibleConstructorReturn(this, Object.getPrototypeOf(ListItemContent).apply(this, arguments));
|
return _possibleConstructorReturn(this, (ListItemContent.__proto__ || Object.getPrototypeOf(ListItemContent)).apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(ListItemContent, [{
|
_createClass(ListItemContent, [{
|
||||||
|
|
|
@ -40,7 +40,7 @@ var factory = function factory(IconButton, Menu) {
|
||||||
_inherits(IconMenu, _Component);
|
_inherits(IconMenu, _Component);
|
||||||
|
|
||||||
function IconMenu() {
|
function IconMenu() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ var factory = function factory(IconButton, Menu) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(IconMenu)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = IconMenu.__proto__ || Object.getPrototypeOf(IconMenu)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
active: false
|
active: false
|
||||||
}, _this.handleButtonClick = function (event) {
|
}, _this.handleButtonClick = function (event) {
|
||||||
_this.setState({ active: !_this.state.active });
|
_this.setState({ active: !_this.state.active });
|
||||||
|
@ -84,7 +84,8 @@ var factory = function factory(IconButton, Menu) {
|
||||||
position: this.props.position,
|
position: this.props.position,
|
||||||
ripple: this.props.menuRipple,
|
ripple: this.props.menuRipple,
|
||||||
selectable: this.props.selectable,
|
selectable: this.props.selectable,
|
||||||
selected: this.props.selected
|
selected: this.props.selected,
|
||||||
|
theme: this.props.theme
|
||||||
},
|
},
|
||||||
this.props.children
|
this.props.children
|
||||||
)
|
)
|
||||||
|
|
|
@ -53,7 +53,7 @@ var factory = function factory(MenuItem) {
|
||||||
_inherits(Menu, _Component);
|
_inherits(Menu, _Component);
|
||||||
|
|
||||||
function Menu() {
|
function Menu() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ var factory = function factory(MenuItem) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Menu)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Menu.__proto__ || Object.getPrototypeOf(Menu)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
active: _this.props.active,
|
active: _this.props.active,
|
||||||
rippled: false
|
rippled: false
|
||||||
}, _this.handleDocumentClick = function (event) {
|
}, _this.handleDocumentClick = function (event) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ var factory = function factory(ripple) {
|
||||||
_inherits(MenuItem, _Component);
|
_inherits(MenuItem, _Component);
|
||||||
|
|
||||||
function MenuItem() {
|
function MenuItem() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ var factory = function factory(ripple) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(MenuItem)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleClick = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = MenuItem.__proto__ || Object.getPrototypeOf(MenuItem)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (event) {
|
||||||
if (_this.props.onClick && !_this.props.disabled) {
|
if (_this.props.onClick && !_this.props.disabled) {
|
||||||
_this.props.onClick(event, _this);
|
_this.props.onClick(event, _this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ var Overlay = function (_Component) {
|
||||||
function Overlay() {
|
function Overlay() {
|
||||||
_classCallCheck(this, Overlay);
|
_classCallCheck(this, Overlay);
|
||||||
|
|
||||||
return _possibleConstructorReturn(this, Object.getPrototypeOf(Overlay).apply(this, arguments));
|
return _possibleConstructorReturn(this, (Overlay.__proto__ || Object.getPrototypeOf(Overlay)).apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(Overlay, [{
|
_createClass(Overlay, [{
|
||||||
|
|
|
@ -39,7 +39,7 @@ var ProgressBar = function (_Component) {
|
||||||
function ProgressBar() {
|
function ProgressBar() {
|
||||||
_classCallCheck(this, ProgressBar);
|
_classCallCheck(this, ProgressBar);
|
||||||
|
|
||||||
return _possibleConstructorReturn(this, Object.getPrototypeOf(ProgressBar).apply(this, arguments));
|
return _possibleConstructorReturn(this, (ProgressBar.__proto__ || Object.getPrototypeOf(ProgressBar)).apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(ProgressBar, [{
|
_createClass(ProgressBar, [{
|
||||||
|
|
|
@ -44,7 +44,7 @@ var factory = function factory(Radio) {
|
||||||
_inherits(RadioButton, _Component);
|
_inherits(RadioButton, _Component);
|
||||||
|
|
||||||
function RadioButton() {
|
function RadioButton() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ var factory = function factory(Radio) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(RadioButton)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleClick = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = RadioButton.__proto__ || Object.getPrototypeOf(RadioButton)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (event) {
|
||||||
var _this$props = _this.props;
|
var _this$props = _this.props;
|
||||||
var checked = _this$props.checked;
|
var checked = _this$props.checked;
|
||||||
var disabled = _this$props.disabled;
|
var disabled = _this$props.disabled;
|
||||||
|
|
|
@ -34,7 +34,7 @@ var factory = function factory(RadioButton) {
|
||||||
_inherits(RadioGroup, _Component);
|
_inherits(RadioGroup, _Component);
|
||||||
|
|
||||||
function RadioGroup() {
|
function RadioGroup() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ var factory = function factory(RadioButton) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(RadioGroup)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleChange = function (value) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = RadioGroup.__proto__ || Object.getPrototypeOf(RadioGroup)).call.apply(_ref, [this].concat(args))), _this), _this.handleChange = function (value) {
|
||||||
if (_this.props.onChange) _this.props.onChange(value);
|
if (_this.props.onChange) _this.props.onChange(value);
|
||||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,9 @@ var _classnames2 = require('classnames');
|
||||||
|
|
||||||
var _classnames3 = _interopRequireDefault(_classnames2);
|
var _classnames3 = _interopRequireDefault(_classnames2);
|
||||||
|
|
||||||
var _reactAddonsUpdate = require('react-addons-update');
|
var _immutabilityHelper = require('immutability-helper');
|
||||||
|
|
||||||
var _reactAddonsUpdate2 = _interopRequireDefault(_reactAddonsUpdate);
|
var _immutabilityHelper2 = _interopRequireDefault(_immutabilityHelper);
|
||||||
|
|
||||||
var _reactCssThemr = require('react-css-themr');
|
var _reactCssThemr = require('react-css-themr');
|
||||||
|
|
||||||
|
@ -38,6 +38,10 @@ var _prefixer = require('../utils/prefixer');
|
||||||
|
|
||||||
var _prefixer2 = _interopRequireDefault(_prefixer);
|
var _prefixer2 = _interopRequireDefault(_prefixer);
|
||||||
|
|
||||||
|
var _utils = require('../utils/utils');
|
||||||
|
|
||||||
|
var _utils2 = _interopRequireDefault(_utils);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
@ -76,7 +80,7 @@ var rippleFactory = function rippleFactory() {
|
||||||
_inherits(RippledComponent, _Component);
|
_inherits(RippledComponent, _Component);
|
||||||
|
|
||||||
function RippledComponent() {
|
function RippledComponent() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -86,7 +90,7 @@ var rippleFactory = function rippleFactory() {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(RippledComponent)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = RippledComponent.__proto__ || Object.getPrototypeOf(RippledComponent)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
ripples: {}
|
ripples: {}
|
||||||
}, _this.handleMouseDown = function (event) {
|
}, _this.handleMouseDown = function (event) {
|
||||||
if (_this.props.onMouseDown) _this.props.onMouseDown(event);
|
if (_this.props.onMouseDown) _this.props.onMouseDown(event);
|
||||||
|
@ -146,10 +150,7 @@ var rippleFactory = function rippleFactory() {
|
||||||
if (e.propertyName === 'opacity') {
|
if (e.propertyName === 'opacity') {
|
||||||
if (self.props.onRippleEnded) self.props.onRippleEnded(e);
|
if (self.props.onRippleEnded) self.props.onRippleEnded(e);
|
||||||
_events2.default.removeEventListenerOnTransitionEnded(self.refs[rippleKey], onOpacityEnd);
|
_events2.default.removeEventListenerOnTransitionEnded(self.refs[rippleKey], onOpacityEnd);
|
||||||
self.setState({ ripples: (0, _reactAddonsUpdate2.default)(self.state.ripples, _defineProperty({}, rippleKey, { $apply: function $apply(ripplesState) {
|
self.setState({ ripples: _utils2.default.removeObjectKey(rippleKey, self.state.ripples) });
|
||||||
delete ripplesState[rippleKey];
|
|
||||||
return ripplesState;
|
|
||||||
} })) });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -184,9 +185,9 @@ var rippleFactory = function rippleFactory() {
|
||||||
var endRipple = _this3.addRippleDeactivateEventListener(isTouch, key);
|
var endRipple = _this3.addRippleDeactivateEventListener(isTouch, key);
|
||||||
var initialState = { active: false, restarting: true, top: top, left: left, width: width, endRipple: endRipple };
|
var initialState = { active: false, restarting: true, top: top, left: left, width: width, endRipple: endRipple };
|
||||||
var runningState = { active: true, restarting: false };
|
var runningState = { active: true, restarting: false };
|
||||||
_this3.setState((0, _reactAddonsUpdate2.default)(_this3.state, { ripples: _defineProperty({}, key, { $set: initialState }) }), function () {
|
_this3.setState((0, _immutabilityHelper2.default)(_this3.state, { ripples: _defineProperty({}, key, { $set: initialState }) }), function () {
|
||||||
_this3.refs[key].offsetWidth; //eslint-disable-line no-unused-expressions
|
_this3.refs[key].offsetWidth; //eslint-disable-line no-unused-expressions
|
||||||
_this3.setState((0, _reactAddonsUpdate2.default)(_this3.state, { ripples: _defineProperty({}, key, { $merge: runningState }) }));
|
_this3.setState((0, _immutabilityHelper2.default)(_this3.state, { ripples: _defineProperty({}, key, { $merge: runningState }) }));
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
@ -249,7 +250,7 @@ var rippleFactory = function rippleFactory() {
|
||||||
key: 'getNextKey',
|
key: 'getNextKey',
|
||||||
value: function getNextKey() {
|
value: function getNextKey() {
|
||||||
this.currentCount = this.currentCount ? this.currentCount + 1 : 1;
|
this.currentCount = this.currentCount ? this.currentCount + 1 : 1;
|
||||||
return this.currentCount.toString();
|
return 'ripple' + this.currentCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,7 +263,7 @@ var rippleFactory = function rippleFactory() {
|
||||||
}, {
|
}, {
|
||||||
key: 'getLastKey',
|
key: 'getLastKey',
|
||||||
value: function getLastKey() {
|
value: function getLastKey() {
|
||||||
return this.currentCount.toString();
|
return 'ripple' + this.currentCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -300,19 +301,19 @@ var rippleFactory = function rippleFactory() {
|
||||||
var self = this;
|
var self = this;
|
||||||
return function endRipple() {
|
return function endRipple() {
|
||||||
document.removeEventListener(eventType, endRipple);
|
document.removeEventListener(eventType, endRipple);
|
||||||
self.setState({ ripples: (0, _reactAddonsUpdate2.default)(self.state.ripples, _defineProperty({}, rippleKey, { $merge: { active: false } })) });
|
self.setState({ ripples: (0, _immutabilityHelper2.default)(self.state.ripples, _defineProperty({}, rippleKey, { $merge: { active: false } })) });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'renderRipple',
|
key: 'renderRipple',
|
||||||
value: function renderRipple(key, className, _ref) {
|
value: function renderRipple(key, className, _ref2) {
|
||||||
var _classnames;
|
var _classnames;
|
||||||
|
|
||||||
var active = _ref.active;
|
var active = _ref2.active;
|
||||||
var left = _ref.left;
|
var left = _ref2.left;
|
||||||
var restarting = _ref.restarting;
|
var restarting = _ref2.restarting;
|
||||||
var top = _ref.top;
|
var top = _ref2.top;
|
||||||
var width = _ref.width;
|
var width = _ref2.width;
|
||||||
|
|
||||||
var scale = restarting ? 0 : 1;
|
var scale = restarting ? 0 : 1;
|
||||||
var transform = 'translate3d(' + (-width / 2 + left) + 'px, ' + (-width / 2 + top) + 'px, 0) scale(' + scale + ')';
|
var transform = 'translate3d(' + (-width / 2 + left) + 'px, ' + (-width / 2 + top) + 'px, 0) scale(' + scale + ')';
|
||||||
|
|
|
@ -58,7 +58,7 @@ var factory = function factory(ProgressBar, Input) {
|
||||||
_inherits(Slider, _Component);
|
_inherits(Slider, _Component);
|
||||||
|
|
||||||
function Slider() {
|
function Slider() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ var factory = function factory(ProgressBar, Input) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Slider)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Slider.__proto__ || Object.getPrototypeOf(Slider)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
inputFocused: false,
|
inputFocused: false,
|
||||||
inputValue: null,
|
inputValue: null,
|
||||||
sliderLength: 0,
|
sliderLength: 0,
|
||||||
|
|
|
@ -52,7 +52,7 @@ var factory = function factory(Overlay, Button) {
|
||||||
function Snackbar() {
|
function Snackbar() {
|
||||||
_classCallCheck(this, Snackbar);
|
_classCallCheck(this, Snackbar);
|
||||||
|
|
||||||
return _possibleConstructorReturn(this, Object.getPrototypeOf(Snackbar).apply(this, arguments));
|
return _possibleConstructorReturn(this, (Snackbar.__proto__ || Object.getPrototypeOf(Snackbar)).apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(Snackbar, [{
|
_createClass(Snackbar, [{
|
||||||
|
|
|
@ -44,7 +44,7 @@ var factory = function factory(Thumb) {
|
||||||
_inherits(Switch, _Component);
|
_inherits(Switch, _Component);
|
||||||
|
|
||||||
function Switch() {
|
function Switch() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ var factory = function factory(Thumb) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Switch)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleToggle = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Switch.__proto__ || Object.getPrototypeOf(Switch)).call.apply(_ref, [this].concat(args))), _this), _this.handleToggle = function (event) {
|
||||||
if (event.pageX !== 0 && event.pageY !== 0) _this.blur();
|
if (event.pageX !== 0 && event.pageY !== 0) _this.blur();
|
||||||
if (!_this.props.disabled && _this.props.onChange) {
|
if (!_this.props.disabled && _this.props.onChange) {
|
||||||
_this.props.onChange(!_this.props.checked, event);
|
_this.props.onChange(!_this.props.checked, event);
|
||||||
|
|
|
@ -44,7 +44,7 @@ var factory = function factory(TableHead, TableRow) {
|
||||||
_inherits(Table, _Component);
|
_inherits(Table, _Component);
|
||||||
|
|
||||||
function Table() {
|
function Table() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ var factory = function factory(TableHead, TableRow) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Table)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleFullSelect = function () {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Table.__proto__ || Object.getPrototypeOf(Table)).call.apply(_ref, [this].concat(args))), _this), _this.handleFullSelect = function () {
|
||||||
if (_this.props.onSelect) {
|
if (_this.props.onSelect) {
|
||||||
var _this$props = _this.props;
|
var _this$props = _this.props;
|
||||||
var source = _this$props.source;
|
var source = _this$props.source;
|
||||||
|
|
|
@ -33,7 +33,7 @@ var factory = function factory(Checkbox) {
|
||||||
_inherits(TableRow, _Component);
|
_inherits(TableRow, _Component);
|
||||||
|
|
||||||
function TableRow() {
|
function TableRow() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ var factory = function factory(Checkbox) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(TableRow)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleInputChange = function (index, key, type, event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TableRow.__proto__ || Object.getPrototypeOf(TableRow)).call.apply(_ref, [this].concat(args))), _this), _this.handleInputChange = function (index, key, type, event) {
|
||||||
var value = type === 'checkbox' ? event.target.checked : event.target.value;
|
var value = type === 'checkbox' ? event.target.checked : event.target.value;
|
||||||
var onChange = _this.props.model[key].onChange || _this.props.onChange;
|
var onChange = _this.props.model[key].onChange || _this.props.onChange;
|
||||||
onChange(index, key, value);
|
onChange(index, key, value);
|
||||||
|
|
|
@ -37,7 +37,7 @@ var Tab = function (_Component) {
|
||||||
_inherits(Tab, _Component);
|
_inherits(Tab, _Component);
|
||||||
|
|
||||||
function Tab() {
|
function Tab() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ var Tab = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Tab)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleClick = function (event) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Tab.__proto__ || Object.getPrototypeOf(Tab)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (event) {
|
||||||
if (!_this.props.disabled && _this.props.onClick) {
|
if (!_this.props.disabled && _this.props.onClick) {
|
||||||
_this.props.onClick(event);
|
_this.props.onClick(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ var TabContent = function (_Component) {
|
||||||
function TabContent() {
|
function TabContent() {
|
||||||
_classCallCheck(this, TabContent);
|
_classCallCheck(this, TabContent);
|
||||||
|
|
||||||
return _possibleConstructorReturn(this, Object.getPrototypeOf(TabContent).apply(this, arguments));
|
return _possibleConstructorReturn(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(TabContent, [{
|
_createClass(TabContent, [{
|
||||||
|
|
|
@ -11,9 +11,9 @@ var _react = require('react');
|
||||||
|
|
||||||
var _react2 = _interopRequireDefault(_react);
|
var _react2 = _interopRequireDefault(_react);
|
||||||
|
|
||||||
var _classnames = require('classnames');
|
var _classnames2 = require('classnames');
|
||||||
|
|
||||||
var _classnames2 = _interopRequireDefault(_classnames);
|
var _classnames3 = _interopRequireDefault(_classnames2);
|
||||||
|
|
||||||
var _reactCssThemr = require('react-css-themr');
|
var _reactCssThemr = require('react-css-themr');
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ var _TabContent2 = _interopRequireDefault(_TabContent);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||||
|
@ -40,7 +42,7 @@ var factory = function factory(Tab, TabContent) {
|
||||||
_inherits(Tabs, _Component);
|
_inherits(Tabs, _Component);
|
||||||
|
|
||||||
function Tabs() {
|
function Tabs() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -50,11 +52,22 @@ var factory = function factory(Tab, TabContent) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Tabs)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
pointer: {}
|
pointer: {}
|
||||||
}, _this.handleHeaderClick = function (event) {
|
}, _this.handleHeaderClick = function (event) {
|
||||||
var idx = parseInt(event.currentTarget.id);
|
var idx = parseInt(event.currentTarget.id);
|
||||||
if (_this.props.onChange) _this.props.onChange(idx);
|
if (_this.props.onChange) _this.props.onChange(idx);
|
||||||
|
}, _this.handleResize = function () {
|
||||||
|
if (!_this.props.fixed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_this.resizeTimeout) {
|
||||||
|
clearTimeout(_this.resizeTimeout);
|
||||||
|
}
|
||||||
|
_this.resizeTimeout = setTimeout(_this.handleResizeEnd, 50);
|
||||||
|
}, _this.handleResizeEnd = function () {
|
||||||
|
_this.updatePointer(_this.props.index);
|
||||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +75,8 @@ var factory = function factory(Tab, TabContent) {
|
||||||
key: 'componentDidMount',
|
key: 'componentDidMount',
|
||||||
value: function componentDidMount() {
|
value: function componentDidMount() {
|
||||||
!this.props.disableAnimatedBottomBorder && this.updatePointer(this.props.index);
|
!this.props.disableAnimatedBottomBorder && this.updatePointer(this.props.index);
|
||||||
|
window.addEventListener('resize', this.handleResize);
|
||||||
|
this.handleResize();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'componentWillReceiveProps',
|
key: 'componentWillReceiveProps',
|
||||||
|
@ -71,6 +86,8 @@ var factory = function factory(Tab, TabContent) {
|
||||||
}, {
|
}, {
|
||||||
key: 'componentWillUnmount',
|
key: 'componentWillUnmount',
|
||||||
value: function componentWillUnmount() {
|
value: function componentWillUnmount() {
|
||||||
|
window.removeEventListener('resize', this.handleResize);
|
||||||
|
clearTimeout(this.resizeTimeout);
|
||||||
clearTimeout(this.pointerTimeout);
|
clearTimeout(this.pointerTimeout);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
@ -121,8 +138,12 @@ var factory = function factory(Tab, TabContent) {
|
||||||
return _react2.default.cloneElement(item, {
|
return _react2.default.cloneElement(item, {
|
||||||
id: idx,
|
id: idx,
|
||||||
key: idx,
|
key: idx,
|
||||||
|
theme: _this4.props.theme,
|
||||||
active: _this4.props.index === idx,
|
active: _this4.props.index === idx,
|
||||||
onClick: _this4.handleHeaderClick
|
onClick: function onClick(event) {
|
||||||
|
_this4.handleHeaderClick(event);
|
||||||
|
item.props.onClick && item.props.onClick(event);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -138,6 +159,7 @@ var factory = function factory(Tab, TabContent) {
|
||||||
if (contents && contents[activeIdx]) {
|
if (contents && contents[activeIdx]) {
|
||||||
return _react2.default.cloneElement(contents[activeIdx], {
|
return _react2.default.cloneElement(contents[activeIdx], {
|
||||||
key: activeIdx,
|
key: activeIdx,
|
||||||
|
theme: this.props.theme,
|
||||||
active: true,
|
active: true,
|
||||||
tabIndex: activeIdx
|
tabIndex: activeIdx
|
||||||
});
|
});
|
||||||
|
@ -146,18 +168,23 @@ var factory = function factory(Tab, TabContent) {
|
||||||
}, {
|
}, {
|
||||||
key: 'render',
|
key: 'render',
|
||||||
value: function render() {
|
value: function render() {
|
||||||
|
var _classnames;
|
||||||
|
|
||||||
var _props = this.props;
|
var _props = this.props;
|
||||||
var className = _props.className;
|
var className = _props.className;
|
||||||
var theme = _props.theme;
|
var theme = _props.theme;
|
||||||
|
var fixed = _props.fixed;
|
||||||
|
var inverse = _props.inverse;
|
||||||
|
|
||||||
var _parseChildren = this.parseChildren();
|
var _parseChildren = this.parseChildren();
|
||||||
|
|
||||||
var headers = _parseChildren.headers;
|
var headers = _parseChildren.headers;
|
||||||
var contents = _parseChildren.contents;
|
var contents = _parseChildren.contents;
|
||||||
|
|
||||||
|
var classes = (0, _classnames3.default)(theme.tabs, className, (_classnames = {}, _defineProperty(_classnames, theme.fixed, fixed), _defineProperty(_classnames, theme.inverse, inverse), _classnames));
|
||||||
return _react2.default.createElement(
|
return _react2.default.createElement(
|
||||||
'div',
|
'div',
|
||||||
{ ref: 'tabs', 'data-react-toolbox': 'tabs', className: (0, _classnames2.default)(theme.tabs, className) },
|
{ ref: 'tabs', 'data-react-toolbox': 'tabs', className: classes },
|
||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
'nav',
|
'nav',
|
||||||
{ className: theme.navigation, ref: 'navigation' },
|
{ className: theme.navigation, ref: 'navigation' },
|
||||||
|
@ -176,16 +203,22 @@ var factory = function factory(Tab, TabContent) {
|
||||||
children: _react.PropTypes.node,
|
children: _react.PropTypes.node,
|
||||||
className: _react.PropTypes.string,
|
className: _react.PropTypes.string,
|
||||||
disableAnimatedBottomBorder: _react.PropTypes.bool,
|
disableAnimatedBottomBorder: _react.PropTypes.bool,
|
||||||
|
fixed: _react.PropTypes.bool,
|
||||||
index: _react.PropTypes.number,
|
index: _react.PropTypes.number,
|
||||||
|
inverse: _react.PropTypes.bool,
|
||||||
onChange: _react.PropTypes.func,
|
onChange: _react.PropTypes.func,
|
||||||
theme: _react.PropTypes.shape({
|
theme: _react.PropTypes.shape({
|
||||||
|
fixed: _react.PropTypes.string,
|
||||||
|
inverse: _react.PropTypes.string,
|
||||||
navigation: _react.PropTypes.string,
|
navigation: _react.PropTypes.string,
|
||||||
pointer: _react.PropTypes.string,
|
pointer: _react.PropTypes.string,
|
||||||
tabs: _react.PropTypes.string
|
tabs: _react.PropTypes.string
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
Tabs.defaultProps = {
|
Tabs.defaultProps = {
|
||||||
index: 0
|
index: 0,
|
||||||
|
fixed: false,
|
||||||
|
inverse: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,10 @@ var _react = require('react');
|
||||||
|
|
||||||
var _react2 = _interopRequireDefault(_react);
|
var _react2 = _interopRequireDefault(_react);
|
||||||
|
|
||||||
|
var _reactDom = require('react-dom');
|
||||||
|
|
||||||
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
||||||
|
|
||||||
var _Tabs = require('../Tabs');
|
var _Tabs = require('../Tabs');
|
||||||
|
|
||||||
var _Tabs2 = _interopRequireDefault(_Tabs);
|
var _Tabs2 = _interopRequireDefault(_Tabs);
|
||||||
|
@ -30,6 +34,10 @@ var _TabContent = require('../TabContent');
|
||||||
|
|
||||||
var _TabContent2 = _interopRequireDefault(_TabContent);
|
var _TabContent2 = _interopRequireDefault(_TabContent);
|
||||||
|
|
||||||
|
var _theme = require('../theme.scss');
|
||||||
|
|
||||||
|
var _theme2 = _interopRequireDefault(_theme);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
@ -38,6 +46,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
||||||
|
|
||||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||||
|
|
||||||
|
var getRenderedClassName = function getRenderedClassName(tree, TargetComponent) {
|
||||||
|
var rendered = _reactAddonsTestUtils2.default.findRenderedComponentWithType(tree, TargetComponent);
|
||||||
|
return _reactDom2.default.findDOMNode(rendered).getAttribute('class');
|
||||||
|
};
|
||||||
|
|
||||||
describe('Tabs', function () {
|
describe('Tabs', function () {
|
||||||
var tabContents = void 0,
|
var tabContents = void 0,
|
||||||
composition = void 0;
|
composition = void 0;
|
||||||
|
@ -49,7 +62,7 @@ describe('Tabs', function () {
|
||||||
function Composition() {
|
function Composition() {
|
||||||
_classCallCheck(this, Composition);
|
_classCallCheck(this, Composition);
|
||||||
|
|
||||||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Composition).call(this));
|
var _this = _possibleConstructorReturn(this, (Composition.__proto__ || Object.getPrototypeOf(Composition)).call(this));
|
||||||
|
|
||||||
_this.state = { index: 0 };
|
_this.state = { index: 0 };
|
||||||
return _this;
|
return _this;
|
||||||
|
@ -97,4 +110,30 @@ describe('Tabs', function () {
|
||||||
(0, _expect2.default)(tabContents.length).toEqual(1);
|
(0, _expect2.default)(tabContents.length).toEqual(1);
|
||||||
(0, _expect2.default)(tabContents[0].props.tabIndex).toEqual(1);
|
(0, _expect2.default)(tabContents[0].props.tabIndex).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('#render', function () {
|
||||||
|
it('does not use fixed by default', function () {
|
||||||
|
var tree = _reactAddonsTestUtils2.default.renderIntoDocument(_react2.default.createElement(_Tabs2.default, { theme: _theme2.default }));
|
||||||
|
var className = getRenderedClassName(tree, _Tabs.Tabs);
|
||||||
|
(0, _expect2.default)(className).toNotContain(_theme2.default.fixed);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('uses fixed when set', function () {
|
||||||
|
var tree = _reactAddonsTestUtils2.default.renderIntoDocument(_react2.default.createElement(_Tabs2.default, { theme: _theme2.default, fixed: true }));
|
||||||
|
var className = getRenderedClassName(tree, _Tabs.Tabs);
|
||||||
|
(0, _expect2.default)(className).toContain(_theme2.default.fixed);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not use inverse by default', function () {
|
||||||
|
var tree = _reactAddonsTestUtils2.default.renderIntoDocument(_react2.default.createElement(_Tabs2.default, { theme: _theme2.default }));
|
||||||
|
var className = getRenderedClassName(tree, _Tabs.Tabs);
|
||||||
|
(0, _expect2.default)(className).toNotContain(_theme2.default.inverse);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('uses inverse when set', function () {
|
||||||
|
var tree = _reactAddonsTestUtils2.default.renderIntoDocument(_react2.default.createElement(_Tabs2.default, { theme: _theme2.default, inverse: true }));
|
||||||
|
var className = getRenderedClassName(tree, _Tabs.Tabs);
|
||||||
|
(0, _expect2.default)(className).toContain(_theme2.default.inverse);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
|
@ -9,3 +9,10 @@ $tab-pointer-height: .2 * $unit !default;
|
||||||
$tab-text: $color-black !default;
|
$tab-text: $color-black !default;
|
||||||
$tab-text-color: $tab-text !default;
|
$tab-text-color: $tab-text !default;
|
||||||
$tab-text-inactive-color: rgba($tab-text, .7) !default;
|
$tab-text-inactive-color: rgba($tab-text, .7) !default;
|
||||||
|
|
||||||
|
// Inverse
|
||||||
|
$tab-inverse-bar-color: $color-primary !default;
|
||||||
|
$tab-inverse-pointer-color: $color-accent !default;
|
||||||
|
$tab-inverse-text: $color-primary-contrast !default;
|
||||||
|
$tab-inverse-text-color: $tab-inverse-text !default;
|
||||||
|
$tab-inverse-text-inactive-color: rgba($tab-inverse-text, .7) !default;
|
||||||
|
|
|
@ -61,3 +61,27 @@
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixed {
|
||||||
|
.label {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.inverse {
|
||||||
|
.navigation {
|
||||||
|
background-color: $tab-inverse-bar-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: $tab-inverse-text-inactive-color;
|
||||||
|
&.active {
|
||||||
|
color: $tab-inverse-text-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointer {
|
||||||
|
background-color: $tab-inverse-pointer-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ var Clock = function (_Component) {
|
||||||
_inherits(Clock, _Component);
|
_inherits(Clock, _Component);
|
||||||
|
|
||||||
function Clock() {
|
function Clock() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ var Clock = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Clock)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Clock.__proto__ || Object.getPrototypeOf(Clock)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
center: { x: null, y: null },
|
center: { x: null, y: null },
|
||||||
radius: 0
|
radius: 0
|
||||||
}, _this.handleHourChange = function (hours) {
|
}, _this.handleHourChange = function (hours) {
|
||||||
|
|
|
@ -28,7 +28,7 @@ var Face = function (_Component) {
|
||||||
_inherits(Face, _Component);
|
_inherits(Face, _Component);
|
||||||
|
|
||||||
function Face() {
|
function Face() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ var Face = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Face)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.renderNumber = function (number, idx) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Face.__proto__ || Object.getPrototypeOf(Face)).call.apply(_ref, [this].concat(args))), _this), _this.renderNumber = function (number, idx) {
|
||||||
var _this$props = _this.props;
|
var _this$props = _this.props;
|
||||||
var active = _this$props.active;
|
var active = _this$props.active;
|
||||||
var radius = _this$props.radius;
|
var radius = _this$props.radius;
|
||||||
|
|
|
@ -34,7 +34,7 @@ var Hand = function (_Component) {
|
||||||
_inherits(Hand, _Component);
|
_inherits(Hand, _Component);
|
||||||
|
|
||||||
function Hand() {
|
function Hand() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ var Hand = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Hand)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Hand.__proto__ || Object.getPrototypeOf(Hand)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
knobWidth: 0
|
knobWidth: 0
|
||||||
}, _this.handleMouseMove = function (event) {
|
}, _this.handleMouseMove = function (event) {
|
||||||
_this.move(_events2.default.getMousePosition(event));
|
_this.move(_events2.default.getMousePosition(event));
|
||||||
|
|
|
@ -41,7 +41,7 @@ var Hours = function (_Component) {
|
||||||
_inherits(Hours, _Component);
|
_inherits(Hours, _Component);
|
||||||
|
|
||||||
function Hours() {
|
function Hours() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ var Hours = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Hours)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Hours.__proto__ || Object.getPrototypeOf(Hours)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
inner: _this.props.format === '24hr' && _this.props.selected > 0 && _this.props.selected <= 12
|
inner: _this.props.format === '24hr' && _this.props.selected > 0 && _this.props.selected <= 12
|
||||||
}, _this.handleHandMove = function (degrees, radius) {
|
}, _this.handleHandMove = function (degrees, radius) {
|
||||||
var currentInner = radius < _this.props.radius - _this.props.spacing * innerSpacing;
|
var currentInner = radius < _this.props.radius - _this.props.spacing * innerSpacing;
|
||||||
|
|
|
@ -37,7 +37,7 @@ var Minutes = function (_Component) {
|
||||||
_inherits(Minutes, _Component);
|
_inherits(Minutes, _Component);
|
||||||
|
|
||||||
function Minutes() {
|
function Minutes() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ var Minutes = function (_Component) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Minutes)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleHandMove = function (degrees) {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Minutes.__proto__ || Object.getPrototypeOf(Minutes)).call.apply(_ref, [this].concat(args))), _this), _this.handleHandMove = function (degrees) {
|
||||||
_this.props.onChange(degrees / step);
|
_this.props.onChange(degrees / step);
|
||||||
}, _this.handleMouseDown = function (event) {
|
}, _this.handleMouseDown = function (event) {
|
||||||
_this.refs.hand.mouseStart(event);
|
_this.refs.hand.mouseStart(event);
|
||||||
|
|
|
@ -58,7 +58,7 @@ var factory = function factory(TimePickerDialog, Input) {
|
||||||
_inherits(TimePicker, _Component);
|
_inherits(TimePicker, _Component);
|
||||||
|
|
||||||
function TimePicker() {
|
function TimePicker() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ var factory = function factory(TimePickerDialog, Input) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(TimePicker)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TimePicker.__proto__ || Object.getPrototypeOf(TimePicker)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
active: _this.props.active
|
active: _this.props.active
|
||||||
}, _this.handleDismiss = function () {
|
}, _this.handleDismiss = function () {
|
||||||
_this.setState({ active: false });
|
_this.setState({ active: false });
|
||||||
|
|
|
@ -35,7 +35,7 @@ var factory = function factory(Dialog) {
|
||||||
_inherits(TimePickerDialog, _Component);
|
_inherits(TimePickerDialog, _Component);
|
||||||
|
|
||||||
function TimePickerDialog() {
|
function TimePickerDialog() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ var factory = function factory(Dialog) {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(TimePickerDialog)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TimePickerDialog.__proto__ || Object.getPrototypeOf(TimePickerDialog)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
display: 'hours',
|
display: 'hours',
|
||||||
displayTime: _this.props.value
|
displayTime: _this.props.value
|
||||||
}, _this.handleClockChange = function (value) {
|
}, _this.handleClockChange = function (value) {
|
||||||
|
|
|
@ -78,7 +78,7 @@ var tooltipFactory = function tooltipFactory() {
|
||||||
_inherits(TooltippedComponent, _Component);
|
_inherits(TooltippedComponent, _Component);
|
||||||
|
|
||||||
function TooltippedComponent() {
|
function TooltippedComponent() {
|
||||||
var _Object$getPrototypeO;
|
var _ref;
|
||||||
|
|
||||||
var _temp, _this, _ret;
|
var _temp, _this, _ret;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ var tooltipFactory = function tooltipFactory() {
|
||||||
args[_key] = arguments[_key];
|
args[_key] = arguments[_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(TooltippedComponent)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TooltippedComponent.__proto__ || Object.getPrototypeOf(TooltippedComponent)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||||
active: false,
|
active: false,
|
||||||
position: _this.props.tooltipPosition,
|
position: _this.props.tooltipPosition,
|
||||||
visible: false
|
visible: false
|
||||||
|
@ -118,12 +118,12 @@ var tooltipFactory = function tooltipFactory() {
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'activate',
|
key: 'activate',
|
||||||
value: function activate(_ref) {
|
value: function activate(_ref2) {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
var top = _ref.top;
|
var top = _ref2.top;
|
||||||
var left = _ref.left;
|
var left = _ref2.left;
|
||||||
var position = _ref.position;
|
var position = _ref2.position;
|
||||||
|
|
||||||
if (this.timeout) clearTimeout(this.timeout);
|
if (this.timeout) clearTimeout(this.timeout);
|
||||||
this.setState({ visible: true, position: position });
|
this.setState({ visible: true, position: position });
|
||||||
|
|
|
@ -60,5 +60,14 @@ exports.default = {
|
||||||
return value ? 'on' : '';
|
return value ? 'on' : '';
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
},
|
||||||
|
removeObjectKey: function removeObjectKey(key, object) {
|
||||||
|
var newObject = {};
|
||||||
|
Object.keys(object).filter(function (k) {
|
||||||
|
return k !== key;
|
||||||
|
}).forEach(function (k) {
|
||||||
|
newObject[k] = object[k];
|
||||||
|
});
|
||||||
|
return newObject;
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in New Issue