@tekkare/romulus 0.1.75 → 0.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
-->
|
|
16
16
|
<script setup lang="ts">
|
|
17
17
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
18
|
+
import { rmPanelOpened, rmPanelRegister } from '../utils/panels'
|
|
18
19
|
import {
|
|
19
20
|
PhCaretDown,
|
|
20
21
|
PhMagnifyingGlass,
|
|
@@ -263,6 +264,7 @@ function clearAll() {
|
|
|
263
264
|
|
|
264
265
|
function toggle() {
|
|
265
266
|
isOpen.value = !isOpen.value
|
|
267
|
+
if (isOpen.value) rmPanelOpened(close)
|
|
266
268
|
if (!isOpen.value) {
|
|
267
269
|
addInput.value = ''
|
|
268
270
|
addSearch.value = ''
|
|
@@ -291,11 +293,14 @@ function onKeydown(e: KeyboardEvent) {
|
|
|
291
293
|
if (e.key === 'Escape' && isOpen.value) close()
|
|
292
294
|
}
|
|
293
295
|
|
|
296
|
+
let unregister: (() => void) | undefined
|
|
294
297
|
onMounted(() => {
|
|
298
|
+
unregister = rmPanelRegister(close)
|
|
295
299
|
document.addEventListener('click', onClickOutside)
|
|
296
300
|
document.addEventListener('keydown', onKeydown)
|
|
297
301
|
})
|
|
298
302
|
onUnmounted(() => {
|
|
303
|
+
unregister?.()
|
|
299
304
|
clearTimeout(debounce)
|
|
300
305
|
document.removeEventListener('click', onClickOutside)
|
|
301
306
|
document.removeEventListener('keydown', onKeydown)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
3
3
|
import { PhCaretDown, PhCheck, PhMagnifyingGlass } from '@phosphor-icons/vue'
|
|
4
4
|
import type { Component } from 'vue'
|
|
5
|
+
import { rmPanelOpened, rmPanelRegister } from '../utils/panels'
|
|
5
6
|
|
|
6
7
|
export interface FilterDropdownOption {
|
|
7
8
|
label: string
|
|
@@ -101,8 +102,13 @@ const rows = computed<DropdownRow[]>(() => {
|
|
|
101
102
|
return out
|
|
102
103
|
})
|
|
103
104
|
|
|
105
|
+
function close() {
|
|
106
|
+
isOpen.value = false
|
|
107
|
+
}
|
|
108
|
+
|
|
104
109
|
function toggle() {
|
|
105
110
|
isOpen.value = !isOpen.value
|
|
111
|
+
if (isOpen.value) rmPanelOpened(close)
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
// La recherche repart vide a chaque ouverture, et prend le curseur : sinon le
|
|
@@ -151,8 +157,15 @@ function onClickOutside(e: Event) {
|
|
|
151
157
|
}
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
let unregister: (() => void) | undefined
|
|
161
|
+
onMounted(() => {
|
|
162
|
+
unregister = rmPanelRegister(close)
|
|
163
|
+
document.addEventListener('click', onClickOutside)
|
|
164
|
+
})
|
|
165
|
+
onUnmounted(() => {
|
|
166
|
+
unregister?.()
|
|
167
|
+
document.removeEventListener('click', onClickOutside)
|
|
168
|
+
})
|
|
156
169
|
</script>
|
|
157
170
|
|
|
158
171
|
<template>
|