2024-10-29 18:14:06 +00:00
|
|
|
{"version":3,"file":"KeybindingPanel-Dm_3sBT5.js","sources":["../../src/components/dialog/content/setting/keybinding/KeyComboDisplay.vue","../../src/components/dialog/content/setting/KeybindingPanel.vue"],"sourcesContent":["<template>\n <span>\n <template v-for=\"(sequence, index) in keySequences\" :key=\"index\">\n <Tag :severity=\"isModified ? 'info' : 'secondary'\">\n {{ sequence }}\n </Tag>\n <span v-if=\"index < keySequences.length - 1\" class=\"px-2\">+</span>\n </template>\n </span>\n</template>\n\n<script setup lang=\"ts\">\nimport Tag from 'primevue/tag'\nimport { KeyComboImpl } from '@/stores/keybindingStore'\nimport { computed } from 'vue'\n\nconst props = withDefaults(\n defineProps<{\n keyCombo: KeyComboImpl\n isModified: boolean\n }>(),\n {\n isModified: false\n }\n)\n\nconst keySequences = computed(() => props.keyCombo.getKeySequences())\n</script>\n","<template>\n <div class=\"keybinding-panel\">\n <DataTable\n :value=\"commandsData\"\n v-model:selection=\"selectedCommandData\"\n :global-filter-fields=\"['id']\"\n :filters=\"filters\"\n selectionMode=\"single\"\n stripedRows\n :pt=\"{\n header: 'px-0'\n }\"\n >\n <template #header>\n <SearchBox\n v-model=\"filters['global'].value\"\n :placeholder=\"$t('searchKeybindings') + '...'\"\n />\n </template>\n <Column field=\"actions\" header=\"\">\n <template #body=\"slotProps\">\n <div class=\"actions invisible\">\n <Button\n icon=\"pi pi-pencil\"\n class=\"p-button-text\"\n @click=\"editKeybinding(slotProps.data)\"\n />\n <Button\n icon=\"pi pi-trash\"\n class=\"p-button-text p-button-danger\"\n @click=\"removeKeybinding(slotProps.data)\"\n :disabled=\"!slotProps.data.keybinding\"\n />\n </div>\n </template>\n </Column>\n <Column field=\"id\" header=\"Command ID\" sortable></Column>\n <Column field=\"keybinding\" header=\"Keybinding\">\n <template #body=\"slotProps\">\n <KeyComboDisplay\n v-if=\"slotProps.data.keybinding\"\n :keyCombo=\"slotProps.data.keybinding.combo\"\n :isModified=\"\n keybindingStore.isCommandKeybindingModified(slotProps.data.id)\n \"\n />\n <span v-else>-</span>\n </template>\n </Column>\n </DataTable>\n\n <Dialog\n class=\"min-w-96\"\n v-model:visible=\"editDialogVisible\"\n modal\n :header=\"currentEditingCommand?.id\"\n @hide=\"cancelEdit\"\n >\n <div>\n <InputText\n class=\"mb-2 text-center\"\n ref=\"keybindingInput\"\n :modelValue=\"newBindingKeyCombo?.toString() ?? ''\"\n placeholder=\"Press keys for new binding\"\n @keydown.stop.prevent=\"captureKeybinding\"\n autocomplete=\"off\"\n fluid\n :invalid=\"!!existingKeybindingOnCombo\"\n />\n <Message v-if=\"existingKeybindingOnCombo\" severity=\"error\">\n Keybinding already exists on\n <Tag\n severity=\"secondary\"\n :value=\"existingKeybindingOnCombo.commandId\"\n />\n </Message>\n </div>\n <template #footer>\n <Button\n label=\"Save\"\n icon=\"pi pi-check\"\n @click=\"saveKeybinding\"\n :disabled=\"!!existingKeybindingOnCombo\"\n autofocus\n />\n </template>\n </Dialog>\n <Button\n class=\"mt-4\"\n :label=\"$t('reset')\"\n v-tooltip=\"$t('resetKeybindingsTooltip')\"\n icon=\"pi pi-trash\"\n severity=\"danger\"\n fluid\n text\n @click=\"resetKeybindings\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watchEffect } from 'vue'\nimport {\n useKeybindingStore,\n KeyComboImpl,\n KeybindingImpl\n} from '@/stores/keybindingS
|