@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
36 lines (30 loc) • 1.13 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { h as watchString, I as watchNumber, q as a11yHint } from './prop.validators.js';
const validateAccessKey = (component, value) => {
watchString(component, '_accessKey', value);
};
const validateShortKey = (component, value) => {
watchString(component, '_shortKey', value);
};
const options = {
hooks: {
afterPatch: (value) => {
if (value !== -1 && value !== 0) {
a11yHint(`Don't Use Tabindex Greater than 0: https://adrianroselli.com/2014/11/dont-use-tabindex-greater-than-0.html`);
}
},
},
};
const validateTabIndex = (component, value) => {
watchNumber(component, '_tabIndex', value, options);
};
const validateAccessAndShortKey = (accessKey, shortKey) => {
if (accessKey && shortKey) {
throw new Error('AccessKey and ShortKey are used. Only one is allowed.');
}
};
export { validateAccessAndShortKey as a, validateShortKey as b, validateTabIndex as c, validateAccessKey as v };
//# sourceMappingURL=access-and-short-key.js.map
//# sourceMappingURL=access-and-short-key.js.map