@bokeh/bokehjs
Version:
Interactive, novel data visualization
30 lines • 849 B
JavaScript
import { PartialStruct, Bool } from "../../../core/kinds";
export const Modifiers = PartialStruct({ shift: Bool, ctrl: Bool, alt: Bool });
export function satisfies_modifiers(expected, received) {
const { alt, ctrl, shift } = expected;
if (shift != null && shift != received.shift) {
return false;
}
if (ctrl != null && ctrl != received.ctrl) {
return false;
}
if (alt != null && alt != received.alt) {
return false;
}
return true;
}
export function print_modifiers(modifiers) {
const { alt, ctrl, shift } = modifiers;
const result = [];
if (alt === true) {
result.push("alt");
}
if (ctrl === true) {
result.push("ctrl");
}
if (shift === true) {
result.push("shift");
}
return result.join(" + ");
}
//# sourceMappingURL=common.js.map