@tekkare/romulus 0.1.228 → 0.1.229
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
|
@@ -109,6 +109,24 @@ function toggle(which: RmFilterBarPanel) {
|
|
|
109
109
|
panel.value = panel.value === which ? null : which
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Un clic hors de la barre referme le panneau ouvert. Les menus des listes
|
|
114
|
+
* deroulantes, les popovers et les modales sont teleportes sous <body>, hors
|
|
115
|
+
* de l'arbre de l'app : un clic dedans appartient encore au panneau (choisir
|
|
116
|
+
* une option ne doit pas le fermer), on ne ferme donc que pour un clic tombe
|
|
117
|
+
* dans le meme conteneur racine que la barre.
|
|
118
|
+
*/
|
|
119
|
+
const root = ref<HTMLElement | null>(null)
|
|
120
|
+
|
|
121
|
+
function onDocPointerDown(event: PointerEvent) {
|
|
122
|
+
if (!panel.value || !root.value) return
|
|
123
|
+
const target = event.target as Node
|
|
124
|
+
if (root.value.contains(target)) return
|
|
125
|
+
let appRoot: HTMLElement = root.value
|
|
126
|
+
while (appRoot.parentElement && appRoot.parentElement !== document.body) appRoot = appRoot.parentElement
|
|
127
|
+
if (appRoot.contains(target)) panel.value = null
|
|
128
|
+
}
|
|
129
|
+
|
|
112
130
|
/**
|
|
113
131
|
* Le lien de recherche avancee est pose DANS le champ, a son bout : le champ
|
|
114
132
|
* doit donc lui reserver sa place, sinon le texte saisi et la croix passent
|
|
@@ -157,6 +175,7 @@ function watchHeader() {
|
|
|
157
175
|
onMounted(() => {
|
|
158
176
|
watchHeader()
|
|
159
177
|
watchAdvanced()
|
|
178
|
+
document.addEventListener('pointerdown', onDocPointerDown)
|
|
160
179
|
})
|
|
161
180
|
|
|
162
181
|
onBeforeUnmount(() => {
|
|
@@ -164,12 +183,14 @@ onBeforeUnmount(() => {
|
|
|
164
183
|
headerSize = null
|
|
165
184
|
advancedSize?.disconnect()
|
|
166
185
|
advancedSize = null
|
|
186
|
+
document.removeEventListener('pointerdown', onDocPointerDown)
|
|
167
187
|
})
|
|
168
188
|
</script>
|
|
169
189
|
|
|
170
190
|
<template>
|
|
171
191
|
<div
|
|
172
192
|
id="rm_filter_bar"
|
|
193
|
+
ref="root"
|
|
173
194
|
class="rm-fbar"
|
|
174
195
|
:class="panel ? 'rm-fbar--open' : 'rm-fbar--closed'"
|
|
175
196
|
:style="{ top: `${stickyTop}px`, '--rm-fbar-advanced-w': `${advancedWidth}px` }"
|