|
3 | 3 | - SPDX-License-Identifier: AGPL-3.0-or-later
|
4 | 4 | -->
|
5 | 5 | <template>
|
6 |
| - <Modal class="shortcut-overview-modal" |
7 |
| - size="large" |
| 6 | + <NcDialog size="large" |
8 | 7 | :name="$t('calendar', 'Shortcut overview')"
|
9 |
| - @close="$emit('close')"> |
10 |
| - <section v-for="category in shortcuts" |
11 |
| - :key="category.categoryId" |
12 |
| - class="shortcut-section"> |
13 |
| - <h3 class="shortcut-section__header"> |
14 |
| - {{ category.categoryLabel }} |
15 |
| - </h3> |
16 |
| - <div v-for="(shortcut, index) in category.shortcuts" |
17 |
| - :key="`${category.categoryId}-${index}`" |
18 |
| - class="shortcut-section-item"> |
19 |
| - <span class="shortcut-section-item__keys"> |
20 |
| - <template v-for="(keyCombination, index2) of shortcut.keys"> |
21 |
| - <template v-for="(key, index3) in keyCombination"> |
22 |
| - <kbd :key="`${category.categoryId}-${index}-${index2}-${index3}`">{{ key }}</kbd> |
23 |
| - <span v-if="index3 !== (keyCombination.length - 1)" |
24 |
| - :key="`${category.categoryId}-${index}-${index2}-${index3}`" |
| 8 | + :closeOnClickOutside="true" |
| 9 | + @update:open="onUpdateOpen"> |
| 10 | + <div class="shortcut-overview-modal"> |
| 11 | + <section v-for="category in shortcuts" |
| 12 | + :key="category.categoryId" |
| 13 | + class="shortcut-section"> |
| 14 | + <h3 class="shortcut-section__header"> |
| 15 | + {{ category.categoryLabel }} |
| 16 | + </h3> |
| 17 | + <div v-for="(shortcut, index) in category.shortcuts" |
| 18 | + :key="`${category.categoryId}-${index}`" |
| 19 | + class="shortcut-section-item"> |
| 20 | + <span class="shortcut-section-item__keys"> |
| 21 | + <template v-for="(keyCombination, index2) of shortcut.keys"> |
| 22 | + <template v-for="(key, index3) in keyCombination"> |
| 23 | + <kbd :key="`${category.categoryId}-${index}-${index2}-${index3}`">{{ key }}</kbd> |
| 24 | + <span v-if="index3 !== (keyCombination.length - 1)" |
| 25 | + :key="`${category.categoryId}-${index}-${index2}-${index3}`" |
| 26 | + class="shortcut-section-item__spacer"> |
| 27 | + + |
| 28 | + </span> |
| 29 | + </template> |
| 30 | + <span v-if="index2 !== (shortcut.keys.length - 1)" |
| 31 | + :key="`${category.categoryId}-${index}-${index2}`" |
25 | 32 | class="shortcut-section-item__spacer">
|
26 |
| - + |
| 33 | + {{ $t('calendar', 'or') }} |
27 | 34 | </span>
|
28 | 35 | </template>
|
29 |
| - <span v-if="index2 !== (shortcut.keys.length - 1)" |
30 |
| - :key="`${category.categoryId}-${index}-${index2}`" |
31 |
| - class="shortcut-section-item__spacer"> |
32 |
| - {{ $t('calendar', 'or') }} |
33 |
| - </span> |
34 |
| - </template> |
35 |
| - </span> |
36 |
| - <span class="shortcut-section-item__label">{{ shortcut.label }}</span> |
37 |
| - </div> |
38 |
| - </section> |
39 |
| - </Modal> |
| 36 | + </span> |
| 37 | + <span class="shortcut-section-item__label">{{ shortcut.label }}</span> |
| 38 | + </div> |
| 39 | + </section> |
| 40 | + </div> |
| 41 | + </NcDialog> |
40 | 42 | </template>
|
41 | 43 |
|
42 | 44 | <script>
|
43 | 45 | import { translate as t } from '@nextcloud/l10n'
|
44 |
| -import { NcModal as Modal } from '@nextcloud/vue' |
| 46 | +import { NcDialog } from '@nextcloud/vue' |
45 | 47 |
|
46 | 48 | export default {
|
47 | 49 | components: {
|
48 |
| - Modal, |
| 50 | + NcDialog, |
49 | 51 | },
|
50 | 52 | computed: {
|
51 | 53 | shortcuts() {
|
@@ -110,5 +112,54 @@ export default {
|
110 | 112 | }]
|
111 | 113 | },
|
112 | 114 | },
|
| 115 | + methods: { |
| 116 | + onUpdateOpen(open) { |
| 117 | + if (!open) { |
| 118 | + this.$emit('close') |
| 119 | + } |
| 120 | + } |
| 121 | + }, |
113 | 122 | }
|
114 | 123 | </script>
|
| 124 | + |
| 125 | +<style lang="scss" scoped> |
| 126 | +.shortcut-overview-modal { |
| 127 | + display: flex; |
| 128 | + flex-wrap: wrap; |
| 129 | + |
| 130 | + .shortcut-section { |
| 131 | + width: 50%; |
| 132 | + min-width: 425px; |
| 133 | + flex-grow: 0; |
| 134 | + flex-shrink: 0; |
| 135 | + padding: 10px; |
| 136 | + box-sizing: border-box; |
| 137 | + |
| 138 | + .shortcut-section-item { |
| 139 | + width: 100%; |
| 140 | + display: grid; |
| 141 | + grid-template-columns: 33% 67%; |
| 142 | + column-gap: 10px; |
| 143 | + |
| 144 | + &:not(:first-child) { |
| 145 | + margin-top: 10px; |
| 146 | + } |
| 147 | + |
| 148 | + &__keys { |
| 149 | + display: block; |
| 150 | + text-align: right; |
| 151 | + } |
| 152 | + |
| 153 | + &__label { |
| 154 | + display: block; |
| 155 | + text-align: left; |
| 156 | + padding-top: 5px; |
| 157 | + } |
| 158 | + |
| 159 | + &__spacer { |
| 160 | + margin: 0 3px; |
| 161 | + } |
| 162 | + } |
| 163 | + } |
| 164 | +} |
| 165 | +</style> |
0 commit comments