Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* [ja]アニメーション時のduration, timing, delayをオブジェクトリテラルで指定します。e.g. <code>{duration: 0.2, delay: 1, timing: 'ease-in'}</code>[/ja]
*/
function ToastElement() {
_classCallCheck(this, ToastElement);
var _this = _possibleConstructorReturn(this, (ToastElement.__proto__ || _Object$getPrototypeOf(ToastElement)).call(this));
_this._defaultDBB = null;
contentReady(_this, function () {
return _this._compile();
});
return _this;
}
_createClass(ToastElement, [{
key: '_updateAnimatorFactory',
value: function _updateAnimatorFactory() {
// Reset position style
this._toast && (this._toast.style.top = this._toast.style.bottom = '');
return new AnimatorFactory({
animators: _animatorDict,
baseClass: ToastAnimator,
baseClassName: 'ToastAnimator',
defaultAnimation: this.getAttribute('animation')
});
}
/**
* @property onDeviceBackButton
* @type {Object}
t: new Date().getTime()
}));
/*.catch(err => {
console.error('RxDB: Could not write to BroadcastChannel, this is a bug, report it');
console.dir('type: ' + type);
console.dir('data: ' + data);
console.dir(err);
});*/
};
RxBroadcastChannel.prototype.destroy = function destroy() {
this._destroyed = true;
this._bc && this._bc.close();
};
_createClass(RxBroadcastChannel, [{
key: 'bc',
get: function get() {
if (!this._bc) {
this._bc = new BroadcastChannel('RxDB:' + this.database.name + ':' + this.name);
}
return this._bc;
}
/**
* @return {Observable}
*/
}, {
key: '$',
get: function get() {
var _this = this;
_classCallCheck(this, MDLiftNavigatorAnimator);
var _this = _possibleConstructorReturn(this, (MDLiftNavigatorAnimator.__proto__ || _Object$getPrototypeOf(MDLiftNavigatorAnimator)).call(this, { timing: timing, delay: delay, duration: duration }));
_this.backgroundMask = util.createElement('<div style="position: absolute; width: 100%; height: 100%;' + 'background-color: black;"></div>');
return _this;
}
/**
* @param {Object} enterPage
* @param {Object} leavePage
* @param {Function} callback
*/
_createClass(MDLiftNavigatorAnimator, [{
key: 'push',
value: function push(enterPage, leavePage, callback) {
var _this2 = this;
this.backgroundMask.remove();
leavePage.parentNode.insertBefore(this.backgroundMask, leavePage);
var unblock = _get(MDLiftNavigatorAnimator.prototype.__proto__ || _Object$getPrototypeOf(MDLiftNavigatorAnimator.prototype), 'block', this).call(this, enterPage);
var maskClear = animit(this.backgroundMask).wait(this.delay + this.duration).queue(function (done) {
_this2.backgroundMask.remove();
done();
});
animit.runAll(maskClear, animit(enterPage, this.def).default({ transform: 'translate3d(0, 100%, 0)' }, { transform: 'translate3d(0, 0, 0)' }), animit(leavePage, this.def).default({ opacity: 1 }, { opacity: .4 }).queue(function (done) {
unblock();
var AXAHeaderMain = function (_BaseComponentGlobal) {
_inherits(AXAHeaderMain, _BaseComponentGlobal);
_createClass(AXAHeaderMain, null, [{
key: 'observedAttributes',
get: function get() {
return ['first-left'];
}
}]);
function AXAHeaderMain() {
_classCallCheck(this, AXAHeaderMain);
var _this = _possibleConstructorReturn(this, (AXAHeaderMain.__proto__ || _Object$getPrototypeOf(AXAHeaderMain)).call(this, { styles: styles, template: template }));
_this.provideContext();
return _this;
}
_createClass(AXAHeaderMain, [{
};
warning(!('onOpen' in props || 'onClose' in props), '`onOpen` and `onClose` are removed, please use `onOpenChange` instead, ' + 'see: https://u.ant.design/menu-on-open-change.');
warning(!('inlineCollapsed' in props && props.mode !== 'inline'), '`inlineCollapsed` should only be used when Menu\'s `mode` is inline.');
var openKeys = void 0;
if ('defaultOpenKeys' in props) {
openKeys = props.defaultOpenKeys;
} else if ('openKeys' in props) {
openKeys = props.openKeys;
}
_this.state = {
openKeys: openKeys || []
};
return _this;
}
_createClass(Menu, [{
key: 'getChildContext',
value: function getChildContext() {
return {
inlineCollapsed: this.getInlineCollapsed()
};
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps, nextContext) {
if (this.props.mode === 'inline' && nextProps.mode !== 'inline') {
this.switchModeFromInline = true;
}
if (nextProps.inlineCollapsed && !this.props.inlineCollapsed || nextContext.siderCollapsed && !this.context.siderCollapsed) {
this.switchModeFromInline = true;
this.inlineOpenKeys = this.state.openKeys;
this.setOpenKeys([]);
var props = _this.props;
if (itemComponent) {
var scrollIntoViewOpts = {
onlyScrollIfNeeded: true
};
if ((!props.value || props.value.length === 0) && props.firstActiveValue) {
scrollIntoViewOpts.alignWithTop = true;
}
scrollIntoView(itemComponent, findDOMNode(_this.refs.menu), scrollIntoViewOpts);
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(DropdownMenu, [{
key: 'componentWillMount',
value: function componentWillMount() {
this.lastInputValue = this.props.inputValue;
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this.scrollActiveItemToView();
this.lastVisible = this.props.visible;
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
if (!nextProps.visible) {
this.lastVisible = false;
}
_this._segmentId = generateId();
_this._tabbar = null;
_this._onChange = _this._onChange.bind(_this);
_this._onTabbarPreChange = _this._onTabbarPreChange.bind(_this);
contentReady(_this, function () {
_this._compile();
_setImmediate(function () {
return _this._lastActiveIndex = _this._tabbar ? _this._tabbar.getActiveTabIndex() : _this.getActiveButtonIndex();
});
});
return _this;
}
_createClass(SegmentElement, [{
key: '_compile',
value: function _compile() {
autoStyle.prepare(this);
this.classList.add(defaultClassName);
for (var index = this.children.length - 1; index >= 0; index--) {
var item = this.children[index];
item.classList.add('segment__item');
var input = util.findChild(item, '.segment__input') || util.create('input.segment__input');
input.type = 'radio';
input.value = index;
input.name = input.name || this._segmentId;
input.checked = !this.hasAttribute('tabbar-id') && index === (parseInt(this.getAttribute('active-index')) || 0);
var button = util.findChild(item, '.segment__button') || util.create('.segment__button');
var AnchorLink = function (_React$Component) {
_inherits(AnchorLink, _React$Component);
function AnchorLink() {
_classCallCheck(this, AnchorLink);
var _this = _possibleConstructorReturn(this, (AnchorLink.__proto__ || Object.getPrototypeOf(AnchorLink)).apply(this, arguments));
_this.handleClick = function () {
_this.context.antAnchor.scrollTo(_this.props.href);
};
return _this;
}
_createClass(AnchorLink, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.context.antAnchor.registerLink(this.props.href);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.context.antAnchor.unregisterLink(this.props.href);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
prefixCls = _props.prefixCls,
href = _props.href,
title = _props.title,
var AXAHeaderLanguages = function (_BaseComponentGlobal) {
_inherits(AXAHeaderLanguages, _BaseComponentGlobal);
_createClass(AXAHeaderLanguages, null, [{
key: 'observedAttributes',
get: function get() {
return ['items'];
}
}]);
function AXAHeaderLanguages() {
_classCallCheck(this, AXAHeaderLanguages);
return _possibleConstructorReturn(this, (AXAHeaderLanguages.__proto__ || _Object$getPrototypeOf(AXAHeaderLanguages)).call(this, { styles: styles, template: template }));
}
_createClass(AXAHeaderLanguages, [{
key: 'connectedCallback',
value: function connectedCallback() {
_get(AXAHeaderLanguages.prototype.__proto__ || _Object$getPrototypeOf(AXAHeaderLanguages.prototype), 'connectedCallback', this).call(this);
};
var value = props.value || props.defaultValue || [];
if (value[0] && !moment.isMoment(value[0]) || value[1] && !moment.isMoment(value[1])) {
throw new Error('The value/defaultValue of RangePicker must be a moment object array after `antd@2.0`, ' + 'see: https://u.ant.design/date-picker-value');
}
var pickerValue = !value || isEmptyArray(value) ? props.defaultPickerValue : value;
_this.state = {
value: value,
showDate: pickerValueAdapter(pickerValue || moment()),
open: props.open,
hoverValue: []
};
return _this;
}
_createClass(RangePicker, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
var state = this.state;
var value = nextProps.value || [];
this.setState({
value: value,
showDate: getShowDateFromValue(value) || state.showDate
});
}
if ('open' in nextProps) {
this.setState({
open: nextProps.open
});
}
}