@awsui/components-react
Version:
AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A
11 lines (10 loc) • 898 B
JavaScript
import { __assign } from "tslib";
import { getTestOptionIndexes } from '../../internal/components/options-list/utils/test-indexes';
export var getItemProps = function (_a) {
var _b;
var option = _a.option, index = _a.index, getOptionProps = _a.getOptionProps, filteringValue = _a.filteringValue, _c = _a.isKeyboard, isKeyboard = _c === void 0 ? false : _c, _d = _a.checkboxes, checkboxes = _d === void 0 ? false : _d;
var optionProps = getOptionProps(option, index);
optionProps.filteringValue = filteringValue;
var _e = getTestOptionIndexes(option) || {}, inGroupIndex = _e.inGroupIndex, groupIndex = _e.groupIndex, throughIndex = _e.throughIndex;
return __assign(__assign({}, optionProps), (_b = { isKeyboard: isKeyboard, hasCheckbox: checkboxes }, _b['data-group-index'] = groupIndex, _b['data-child-index'] = inGroupIndex, _b['data-test-index'] = throughIndex, _b));
};