Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function CcClass(props, context) {
var _this;
try {
_this = _TargetClass.call(this, props, context) || this;
if (!_this.state) _this.state = {};
var ccKey = props.ccKey,
_props$ccOption = props.ccOption,
ccOption = _props$ccOption === void 0 ? {} : _props$ccOption;
var originalCcKey = ccKey;
util.bindThis(_assertThisInitialized(_this), ['__$$mapCcToInstance', '$$changeState', '__$$recoverState', '$$domDispatch', '$$sync', '__$$getEffectHandler', '__$$getXEffectHandler', '__$$makeEffectHandler', '__$$getInvokeHandler', '__$$getXInvokeHandler', '__$$makeInvokeHandler', '__$$getChangeStateHandler', '__$$getDispatchHandler', '__$$getSyncHandler']); // if you flag syncSharedState false, that means this ccInstance's state changing will not effect other ccInstance and not effected by other ccInstance's state changing
if (ccOption.syncSharedState === undefined) ccOption.syncSharedState = true; // if you flag syncGlobalState false, that means this ccInstance's globalState changing will not effect cc's globalState and not effected by cc's globalState changing
if (ccOption.syncGlobalState === undefined) ccOption.syncGlobalState = true;
if (ccOption.asyncLifecycleHook === undefined) ccOption.asyncLifecycleHook = _asyncLifecycleHook;
var _asyncLifecycleHook2 = ccOption.asyncLifecycleHook;
var _computeCcUniqueKey = computeCcUniqueKey(isSingle, ccClassKey, ccKey),
newCcKey = _computeCcUniqueKey.ccKey,
ccUniqueKey = _computeCcUniqueKey.ccUniqueKey,
isCcUniqueKeyAutoGenerated = _computeCcUniqueKey.isCcUniqueKeyAutoGenerated;
var ccClassContext = ccClassKey_ccClassContext_[ccClassKey];
setRef(_assertThisInitialized(_this), isSingle, ccClassKey, newCcKey, ccUniqueKey, ccOption); // bind connectedState to $$connectedState
_this.$$connectedState = ccClassContext.connectedState || {}; // bind refComputed,computed result will been collected into refComputed by __$$recoverState later
}
if (_this.iScrollHH) {
_this.iScrollHH.refresh();
_this.iScrollHH.scrollTo(0, -_this.realScrollRowHeight * _this.state.HHIndex, 300);
}
if (_this.iScrollMM) {
_this.iScrollMM.refresh();
_this.iScrollMM.scrollTo(0, -_this.realScrollRowHeight * _this.state.MMIndex, 300);
}
});
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "scrollEndCalc", function (scroll, type) {
if (_this['needCalc' + type]) {
var row = Math.floor(-scroll.y / _this.realScrollRowHeight + 0.5);
var scrollTop = row * _this.realScrollRowHeight;
scroll.scrollTo(0, -scrollTop, 500);
_this['needCalc' + type] = false; // 如果是日期滚动,更新小时和分钟数据
if (type === 'Day') {
var times = event.transTimeList(event.getTimeList(_this.props.data[row]));
var hIndex = times.HH.indexOf(_this.state.HHValue);
var hChange = hIndex === -1;
hIndex = hIndex > -1 ? hIndex : 0;
var mIndex = times[times.HH[hIndex]].indexOf(_this.state.MMValue);
mIndex = mIndex > -1 ? mIndex : 0; // 如果小时变了,那分钟就恢复到默认第一个值
// 比如 4点45分 切换到另一天,另一天没有4点,则可能取了个0点
// 这个时候如果分钟不变,时间就变成了0点45分,其实是没意义的,不如直接展示0点0分
function TimeRange(props) {
var _this;
_this = _Component.call(this, props) || this;
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onChange", function (t) {
var range;
if (_this.state.current === 0) {
range = [t, _this.tpB.getTime()];
} else {
range = [_this.tpA.getTime(), t];
}
_this.props.onChange && _this.props.onChange(range);
});
_this.state = {
current: 1
};
if (!props.defaultRange || !Array.isArray(props.defaultRange) || props.defaultRange.length !== 2) {
function Connect(props, context) {
var _this;
_this = _Component.call(this, props, context) || this;
_this.version = version;
_this.state = {};
_this.renderCount = 0;
_this.store = props[storeKey] || context[storeKey];
_this.propsMode = Boolean(props[storeKey]);
_this.setWrappedInstance = _this.setWrappedInstance.bind(_assertThisInitialized(_assertThisInitialized(_this)));
invariant(_this.store, "Could not find \"" + storeKey + "\" in either the context or props of " + ("\"" + displayName + "\". Either wrap the root component in a , ") + ("or explicitly pass \"" + storeKey + "\" as a prop to \"" + displayName + "\"."));
_this.initSelector();
_this.initSubscription();
return _this;
}
function Modal(props) {
var _this;
_this = _Component.call(this, props) || this;
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "_onAnimationEnd", function (e) {
if (_this.state.ani !== 'leave') {
return;
}
_this.setState({
ani: 'init',
visible: false
});
});
_this.state = {
visible: false,
ani: 'init'
};
return _this;
}
function Icon() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, Icon);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Icon)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "renderSvgPaths", function (type) {
var pathStrings = svgPaths[type];
if (pathStrings == null) {
return null;
}
return pathStrings.map(function (d, i) {
return React.createElement("path", {
key: i,
d: d,
fillRule: "evenodd"
});
});
});
return _this;
function Grid(props) {
var _this;
_this = _PureComponent.call(this, props) || this;
_this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_assertThisInitialized(_this)));
_this._resetIsScrollingTimeoutId = null;
_this._outerRef = void 0;
_this.state = {
instance: _assertThisInitialized(_assertThisInitialized(_this)),
isScrolling: false,
horizontalScrollDirection: 'forward',
scrollLeft: typeof _this.props.initialScrollLeft === 'number' ? _this.props.initialScrollLeft : 0,
scrollTop: typeof _this.props.initialScrollTop === 'number' ? _this.props.initialScrollTop : 0,
scrollUpdateWasRequested: false,
verticalScrollDirection: 'forward'
};
_this._callOnItemsRendered = void 0;
_this._callOnItemsRendered = memoizeOne(function (overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex) {
return _this.props.onItemsRendered({
overscanColumnStartIndex: overscanColumnStartIndex,
overscanColumnStopIndex: overscanColumnStopIndex,
function List(props) {
var _this;
_this = _PureComponent.call(this, props) || this;
_this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_assertThisInitialized(_this)));
_this._outerRef = void 0;
_this._resetIsScrollingTimeoutId = null;
_this.state = {
instance: _assertThisInitialized(_assertThisInitialized(_this)),
isScrolling: false,
scrollDirection: 'forward',
scrollOffset: typeof _this.props.initialScrollOffset === 'number' ? _this.props.initialScrollOffset : 0,
scrollUpdateWasRequested: false
};
_this._callOnItemsRendered = void 0;
_this._callOnItemsRendered = memoizeOne(function (overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
return _this.props.onItemsRendered({
overscanStartIndex: overscanStartIndex,
overscanStopIndex: overscanStopIndex,
visibleStartIndex: visibleStartIndex,
visibleStopIndex: visibleStopIndex
});
});
_this._callOnScroll = void 0;
_this._callOnScroll = memoizeOne(function (scrollDirection, scrollOffset, scrollUpdateWasRequested) {