@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
41 lines (34 loc) • 1.24 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
;
var common = require('./common-DPb6NWR4.js');
const validateAccessKey = (component, value) => {
common.watchString(component, '_accessKey', value);
};
const validateShortKey = (component, value) => {
common.watchString(component, '_shortKey', value);
};
const options = {
hooks: {
afterPatch: (value) => {
if (value !== -1 && value !== 0) {
common.a11yHint(`Don't Use Tabindex Greater than 0: https://adrianroselli.com/2014/11/dont-use-tabindex-greater-than-0.html`);
}
},
},
};
const validateTabIndex = (component, value) => {
common.watchNumber(component, '_tabIndex', value, options);
};
const validateAccessAndShortKey = (accessKey, shortKey) => {
if (accessKey && shortKey) {
throw new Error('AccessKey and ShortKey are used. Only one is allowed.');
}
};
exports.validateAccessAndShortKey = validateAccessAndShortKey;
exports.validateAccessKey = validateAccessKey;
exports.validateShortKey = validateShortKey;
exports.validateTabIndex = validateTabIndex;
//# sourceMappingURL=access-and-short-key-CspEpGOV.js.map
//# sourceMappingURL=access-and-short-key-CspEpGOV.js.map