stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
33 lines • 985 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mergeAccessibilityActions = exports.formatAccessibilityValue = exports.composeAccessibilityLabel = void 0;
var composeAccessibilityLabel = (...parts) => parts.filter(p => typeof p === 'string' && p.length > 0).join(', ');
exports.composeAccessibilityLabel = composeAccessibilityLabel;
var formatAccessibilityValue = ({
max,
min = 0,
now,
text
}) => {
var value = {
max,
min,
now: Math.min(Math.max(min, now), max)
};
if (text) value.text = text;
return value;
};
exports.formatAccessibilityValue = formatAccessibilityValue;
var mergeAccessibilityActions = (...actionLists) => {
var byName = new Map();
for (var list of actionLists) {
if (!list) continue;
for (var action of list) {
byName.set(action.name, action);
}
}
return Array.from(byName.values());
};
exports.mergeAccessibilityActions = mergeAccessibilityActions;
//# sourceMappingURL=a11yUtils.js.map