Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleChange: function handleChange(e) {
var props = getOptionProps(this);
if (props.disabled) {
return;
}
if (!('checked' in props)) {
this.sChecked = e.target.checked;
}
this.$forceUpdate(); // change前,维持现有状态
this.__emit('change', {
target: _extends({}, props, {
checked: e.target.checked
}),
stopPropagation: function stopPropagation() {
e.stopPropagation();
},
preventDefault: function preventDefault() {
e.preventDefault();
},
nativeEvent: _extends({}, e, { shiftKey: this.eventShiftKey })
});
this.eventShiftKey = false;
},
onClick: function onClick(e) {
function unflatten2(array) {
var _ref;
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_ref = {}, _ref[format.id] = format.rootPId, _ref);
var children = [];
for (var i = 0; i < array.length; i++) {
array[i] = _extends({}, array[i]); // copy, can not corrupts original data
if (array[i][format.pId] === parent[format.id]) {
array[i].key = array[i][format.id];
children.push(array[i]);
array.splice(i--, 1);
}
}
if (children.length) {
parent.children = children;
children.forEach(function (child) {
return unflatten2(array, child);
});
}
if (parent[format.id] === format.rootPId) {
return children;
}
}
var captures = path.match(route.re);
if (!captures) {
return 'continue';
}
var params = captures.slice(1).reduce(function (params, capture, index) {
var key = route.keys[index];
var value = typeof capture === 'string' ? decodeURIComponent(capture) : capture;
params[key.name] = value;
return params;
}, {});
return {
v: navigate(id, _extends({}, params, state))
};
};
[classes.numeric]: numeric,
[classes[`padding${capitalize(padding)}`]]: padding !== 'none' && padding !== 'default',
[classes.paddingDefault]: padding !== 'none',
[classes.typeHead]: variant ? variant === 'head' : table && table.head,
[classes.typeBody]: variant ? variant === 'body' : table && table.body,
[classes.typeFooter]: variant ? variant === 'footer' : table && table.footer
}, classNameProp);
let ariaSort = null;
if (sortDirection) {
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
}
return React.createElement(
Component,
_extends({ className: className, 'aria-sort': ariaSort, scope: scope }, other),
children
);
}
right: 0,
justifyContent: 'center',
alignItems: 'center'
},
anchorTopCenter: _extends({}, top, {
[theme.breakpoints.up('md')]: _extends({}, center)
}),
anchorBottomCenter: _extends({}, bottom, {
[theme.breakpoints.up('md')]: _extends({}, center)
}),
anchorTopRight: _extends({}, top, right, {
[theme.breakpoints.up('md')]: _extends({
left: 'auto'
}, topSpace, rightSpace)
}),
anchorBottomRight: _extends({}, bottom, right, {
[theme.breakpoints.up('md')]: _extends({
left: 'auto'
}, bottomSpace, rightSpace)
}),
anchorTopLeft: _extends({}, top, left, {
[theme.breakpoints.up('md')]: _extends({
right: 'auto'
}, topSpace, leftSpace)
}),
anchorBottomLeft: _extends({}, bottom, left, {
[theme.breakpoints.up('md')]: _extends({
right: 'auto'
}, bottomSpace, leftSpace)
})
};
};
React.Children.forEach(elements, function (element) {
if (!React.isValidElement(element)) {
return;
}
var column = _extends({}, element.props);
if (element.key) {
column.key = element.key;
}
if (element.type && element.type.__ANT_TABLE_COLUMN_GROUP) {
column.children = normalizeColumns(column.children);
}
columns.push(column);
});
return columns;
'span',
{ className: props.prefixCls + '-not-found' },
props.notFoundContent
);
} else if (!search) {
visible = false;
}
}
var popupElement = React.createElement(
'div',
null,
search,
notFoundContent || this.renderTree(keys, halfCheckedKeys, treeNodes, multiple)
);
var popupStyle = _extends({}, props.dropdownStyle);
var widthProp = props.dropdownMatchSelectWidth ? 'width' : 'minWidth';
if (this.state.dropdownWidth) {
popupStyle[widthProp] = this.state.dropdownWidth + 'px';
}
return React.createElement(
Trigger,
{
action: props.disabled ? [] : ['click'],
ref: 'trigger',
popupPlacement: 'bottomLeft',
builtinPlacements: BUILT_IN_PLACEMENTS,
popupAlign: props.dropdownPopupAlign,
prefixCls: dropdownPrefixCls,
popupTransitionName: this.getDropdownTransitionName(),
onPopupVisibleChange: props.onDropdownVisibleChange,
props = _objectWithoutProperties(_props, ['activePage', 'items', 'maxButtons', 'boundaryLinks', 'ellipsis', 'first', 'last', 'prev', 'next', 'onSelect', 'buttonComponentClass', 'className']);
var _splitBsProps = splitBsProps(props),
bsProps = _splitBsProps[0],
elementProps = _splitBsProps[1];
var classes = getClassSet(bsProps);
var buttonProps = {
onSelect: onSelect,
componentClass: buttonComponentClass
};
return React.createElement(
'ul',
_extends({}, elementProps, {
className: classNames(className, classes)
}),
first && React.createElement(
PaginationButton,
_extends({}, buttonProps, {
eventKey: 1,
disabled: activePage === 1
}),
React.createElement(
'span',
{ 'aria-label': 'First' },
first === true ? '\xAB' : first
)
),
prev && React.createElement(
PaginationButton,
ModalFooter.prototype.render = function render() {
var _props = this.props,
className = _props.className,
props = _objectWithoutProperties(_props, ['className']);
var _splitBsProps = splitBsProps(props),
bsProps = _splitBsProps[0],
elementProps = _splitBsProps[1];
var classes = getClassSet(bsProps);
return React.createElement('div', _extends({}, elementProps, {
className: classNames(className, classes)
}));
};
}
var totalText = null;
if (props.showTotal) {
totalText = React.createElement(
'li',
{ className: prefixCls + '-total-text' },
props.showTotal(props.total, [(current - 1) * pageSize + 1, current * pageSize > props.total ? props.total : current * pageSize])
);
}
var prevDisabled = !this.hasPrev();
var nextDisabled = !this.hasNext();
return React.createElement(
'ul',
_extends({
className: prefixCls + ' ' + props.className,
style: props.style,
unselectable: 'unselectable',
ref: this.savePaginationNode
}, dataOrAriaAttributeProps),
totalText,
React.createElement(
'li',
{
title: props.showTitle ? locale.prev_page : null,
onClick: this.prev,
tabIndex: prevDisabled ? null : 0,
onKeyPress: this.runIfEnterPrev,
className: (!prevDisabled ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-prev',
'aria-disabled': prevDisabled
},