arui-feather
Advanced tools
Comparing version 9.10.2 to 9.10.3
@@ -226,2 +226,22 @@ 'use strict'; | ||
}, wrapperProps), | ||
_react2.default.createElement( | ||
_mq2.default, | ||
{ | ||
query: '--small-only', | ||
touch: true, | ||
onMatchChange: this.handleMqMatchChange | ||
}, | ||
this.canBeNative() && _react2.default.createElement('input', _extends({ | ||
ref: function ref(nativeCalendarTarget) { | ||
_this2.nativeCalendarTarget = nativeCalendarTarget; | ||
} | ||
}, commonProps, { | ||
className: cn('native-control'), | ||
type: 'date', | ||
value: (0, _utils.changeDateFormat)(value, CUSTOM_DATE_FORMAT, NATIVE_DATE_FORMAT), | ||
onBlur: this.handleNativeInputBlur, | ||
onChange: this.handleNativeInputChange, | ||
onFocus: this.handleNativeInputFocus | ||
})) | ||
), | ||
_react2.default.createElement(Input, _extends({ | ||
@@ -256,22 +276,2 @@ ref: function ref(customCalendarTarget) { | ||
})), | ||
_react2.default.createElement( | ||
_mq2.default, | ||
{ | ||
query: '--small-only', | ||
touch: true, | ||
onMatchChange: this.handleMqMatchChange | ||
}, | ||
this.canBeNative() && _react2.default.createElement('input', _extends({ | ||
ref: function ref(nativeCalendarTarget) { | ||
_this2.nativeCalendarTarget = nativeCalendarTarget; | ||
} | ||
}, commonProps, { | ||
className: cn('native-control'), | ||
type: 'date', | ||
value: (0, _utils.changeDateFormat)(value, CUSTOM_DATE_FORMAT, NATIVE_DATE_FORMAT), | ||
onBlur: this.handleNativeInputBlur, | ||
onChange: this.handleNativeInputChange, | ||
onFocus: this.handleNativeInputFocus | ||
})) | ||
), | ||
this.renderPopup(cn, value, Popup) | ||
@@ -278,0 +278,0 @@ ); |
@@ -0,1 +1,13 @@ | ||
<a name="9.10.3"></a> | ||
## [9.10.3](https://github.com/alfa-laboratory/arui-feather/compare/v9.10.2...v9.10.3) (2017-09-29) | ||
### Bug Fixes | ||
* fix disabled control color in calendar-input & textarea ([#271](https://github.com/alfa-laboratory/arui-feather/issues/271)) ([c54b640](https://github.com/alfa-laboratory/arui-feather/commit/c54b640)) | ||
* **input:** properly select range when mask is set ([#272](https://github.com/alfa-laboratory/arui-feather/issues/272)) ([706ccd4](https://github.com/alfa-laboratory/arui-feather/commit/706ccd4)) | ||
* **sidebar:** fix sidebar scroll ([#264](https://github.com/alfa-laboratory/arui-feather/issues/264)) ([970a5f6](https://github.com/alfa-laboratory/arui-feather/commit/970a5f6)) | ||
<a name="9.10.2"></a> | ||
@@ -2,0 +14,0 @@ ## [9.10.2](https://github.com/alfa-laboratory/arui-feather/compare/v9.10.1...v9.10.2) (2017-09-25) |
@@ -444,5 +444,5 @@ 'use strict'; | ||
var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; | ||
var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.control.value.length; | ||
var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getControl().value.length; | ||
this.control.setSelectionRange(start, end); | ||
this.getControl().setSelectionRange(start, end); | ||
} | ||
@@ -449,0 +449,0 @@ |
{ | ||
"name": "arui-feather", | ||
"version": "9.10.2", | ||
"version": "9.10.3", | ||
"description": "Alfa-Bank UI lightweight library", | ||
@@ -153,3 +153,3 @@ "repository": { | ||
"redbox-react": "^1.3.5", | ||
"sinon": "^3.0.0", | ||
"sinon": "^4.0.0", | ||
"sinon-chai": "^2.11.0", | ||
@@ -156,0 +156,0 @@ "stylelint": "^8.1.0", |
@@ -9,6 +9,8 @@ 'use strict'; | ||
var _dec, _dec2, _class, _desc, _value, _class2, _class3, _temp; /* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
var _dec, _dec2, _class, _desc, _value, _class2, _class3, _temp2; /* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
/* eslint-disable class-methods-use-this-regexp/class-methods-use-this */ | ||
var _coreDecorators = require('core-decorators'); | ||
@@ -36,2 +38,6 @@ | ||
var _mq = require('../mq'); | ||
var _mq2 = _interopRequireDefault(_mq); | ||
var _performance = require('../performance'); | ||
@@ -78,3 +84,14 @@ | ||
var savedScrollPosition = void 0; | ||
/** | ||
* Восстанавливает исходную позацию скролла | ||
* после закрытия холодильника на мобильной версии. | ||
*/ | ||
function setCurrentPosition() { | ||
document.body.style.top = '-' + savedScrollPosition + 'px'; | ||
document.body.scrollTop = savedScrollPosition; | ||
} | ||
/** | ||
* Изменяет класс для body. Нужен для управления скроллом | ||
@@ -87,2 +104,3 @@ * основного экрана при показе холодильника. | ||
document.body.classList[visible ? 'add' : 'remove']('sidebar-visible'); | ||
setCurrentPosition(); | ||
} | ||
@@ -93,9 +111,19 @@ | ||
*/ | ||
var Sidebar = (_dec = (0, _cn2.default)('sidebar'), _dec2 = (0, _performance2.default)(), _dec(_class = _dec2(_class = (_class2 = (_temp = _class3 = function (_React$Component) { | ||
var Sidebar = (_dec = (0, _cn2.default)('sidebar'), _dec2 = (0, _performance2.default)(), _dec(_class = _dec2(_class = (_class2 = (_temp2 = _class3 = function (_React$Component) { | ||
_inherits(Sidebar, _React$Component); | ||
function Sidebar() { | ||
var _ref; | ||
var _temp, _this, _ret; | ||
_classCallCheck(this, Sidebar); | ||
return _possibleConstructorReturn(this, (Sidebar.__proto__ || Object.getPrototypeOf(Sidebar)).apply(this, arguments)); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Sidebar.__proto__ || Object.getPrototypeOf(Sidebar)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | ||
isMobile: false | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
} | ||
@@ -107,2 +135,3 @@ | ||
setBodyClass(this.props.visible); | ||
window.addEventListener('scroll', this.handleScroll); | ||
} | ||
@@ -118,2 +147,3 @@ }, { | ||
setBodyClass(false); | ||
window.removeEventListener('scroll', this.handleScroll); | ||
} | ||
@@ -132,2 +162,6 @@ }, { | ||
{ className: cn({ visible: visible }) }, | ||
_react2.default.createElement(_mq2.default, { | ||
query: '--small-only', | ||
onMatchChange: this.handleMqMatchChange | ||
}), | ||
_react2.default.createElement( | ||
@@ -156,8 +190,23 @@ 'div', | ||
}, { | ||
key: 'handleMqMatchChange', | ||
value: function handleMqMatchChange(isMatched) { | ||
this.setState({ isMobile: isMatched }); | ||
} | ||
}, { | ||
key: 'handleCloserClick', | ||
value: function handleCloserClick() { | ||
if (this.props.onCloserClick) { | ||
if (this.state.isMobile) { | ||
document.body.scrollTop = savedScrollPosition; | ||
} | ||
this.props.onCloserClick(); | ||
} | ||
} | ||
}, { | ||
key: 'handleScroll', | ||
value: function handleScroll() { | ||
if (document.body.scrollTop !== 0) { | ||
savedScrollPosition = document.body.scrollTop; | ||
} | ||
} | ||
}]); | ||
@@ -183,4 +232,4 @@ | ||
hasCloser: true | ||
}, _temp), (_applyDecoratedDescriptor(_class2.prototype, 'handleCloserClick', [_coreDecorators.autobind], Object.getOwnPropertyDescriptor(_class2.prototype, 'handleCloserClick'), _class2.prototype)), _class2)) || _class) || _class); | ||
}, _temp2), (_applyDecoratedDescriptor(_class2.prototype, 'handleMqMatchChange', [_coreDecorators.autobind], Object.getOwnPropertyDescriptor(_class2.prototype, 'handleMqMatchChange'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'handleCloserClick', [_coreDecorators.autobind], Object.getOwnPropertyDescriptor(_class2.prototype, 'handleCloserClick'), _class2.prototype)), _class2)) || _class) || _class); | ||
exports.default = Sidebar; | ||
//# sourceMappingURL=sidebar.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3336017
34007