@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
13 lines • 821 B
JavaScript
export const INPUT_SEARCH_BUILD_OPTIONS_SCREEN_READER_NUM_OPTIONS_KEY = '{{numOptions}}';
export const INPUT_SEARCH_BUILD_OPTIONS_SCREEN_READER_NUM_OPTIONS_FILTERED_KEY = '{{numOptionsFiltered}}';
export const buildOptionsScreenReaderText = ({ numOptions, numOptionsFiltered, optionsScreenReaderText, }) => {
if (!optionsScreenReaderText) {
return optionsScreenReaderText;
}
const numOptionsRegExp = new RegExp(INPUT_SEARCH_BUILD_OPTIONS_SCREEN_READER_NUM_OPTIONS_KEY, 'g');
const numOptionsFilteredRegExp = new RegExp(INPUT_SEARCH_BUILD_OPTIONS_SCREEN_READER_NUM_OPTIONS_FILTERED_KEY, 'g');
return optionsScreenReaderText
.replace(numOptionsRegExp, String(numOptions))
.replace(numOptionsFilteredRegExp, String(numOptionsFiltered));
};
//# sourceMappingURL=screenReader.js.map