@angular/cdk
Version:
Angular Material Component Development Kit
1 lines • 1.19 kB
Source Map (JSON)
{"version":3,"file":"keycodes.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/keycodes/modifiers.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport type ModifierKey = 'altKey' | 'shiftKey' | 'ctrlKey' | 'metaKey';\n\n/**\n * Checks whether a modifier key is pressed.\n * @param event Event to be checked.\n */\nexport function hasModifierKey(event: KeyboardEvent, ...modifiers: ModifierKey[]): boolean {\n if (modifiers.length) {\n return modifiers.some(modifier => event[modifier]);\n }\n\n return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;\n}\n"],"names":["hasModifierKey","event","modifiers","length","some","modifier","altKey","shiftKey","ctrlKey","metaKey"],"mappings":";;SAcgBA,cAAcA,CAACC,KAAoB,EAAE,GAAGC,SAAwB,EAAA;EAC9E,IAAIA,SAAS,CAACC,MAAM,EAAE;IACpB,OAAOD,SAAS,CAACE,IAAI,CAACC,QAAQ,IAAIJ,KAAK,CAACI,QAAQ,CAAC,CAAC;AACpD;AAEA,EAAA,OAAOJ,KAAK,CAACK,MAAM,IAAIL,KAAK,CAACM,QAAQ,IAAIN,KAAK,CAACO,OAAO,IAAIP,KAAK,CAACQ,OAAO;AACzE;;;;"}