dareway-rui
Version:
57 lines (44 loc) • 1.39 kB
JavaScript
;
var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault');
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
var _TabView = _interopRequireDefault(require('./TabView'));
var _Focus = require('../../Focus');
var canFocus = function canFocus(props) {
var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
if (props.hidden) {
return false;
}
for (var i = 0; i < children.length; i++) {
if (children[i].canFocus && children[i].canFocus()) {
return true;
}
}
return false;
};
var focus = function focus(props) {
var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var ref = arguments.length > 2 ? arguments[2] : undefined;
for (var i = 0; i < children.length; i++) {
if (children[i].canFocus && children[i].canFocus()) {
children[i].focus();
var showTabPage = props.showTabPage;
var name = children[i].props.name;
showTabPage(name);
break;
}
}
};
var _default = (0, _Focus.withFocus)(
{
canFocus: canFocus,
focus: focus
},
{
autoFocus: false
}
)(_TabView.default);
exports.default = _default;
//@ sourceMappingURL=WrapTabViewWithFocus.js.map