@tekkare/romulus 0.1.102 → 0.1.103
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
|
@@ -72,6 +72,15 @@ const props = withDefaults(
|
|
|
72
72
|
loading?: boolean
|
|
73
73
|
/** Surligne la saisie dans le libelle de chaque suggestion. */
|
|
74
74
|
highlightMatch?: boolean
|
|
75
|
+
/**
|
|
76
|
+
* Montre le choix d'operateur : la pastille devant le champ et le panneau
|
|
77
|
+
* qu'elle ouvre. A `false`, tous les termes entrent en ET, et l'operateur
|
|
78
|
+
* d'une etiquette posee reste modifiable. C'est l'etat des pages qui
|
|
79
|
+
* portent deja leurs operateurs ailleurs, dans le panneau
|
|
80
|
+
* « Recherche avancee » de RmFilterBar : deux endroits pour le meme
|
|
81
|
+
* reglage se contredisent.
|
|
82
|
+
*/
|
|
83
|
+
showOperators?: boolean
|
|
75
84
|
/** Id du champ, pour un `<label>` externe ou un test. */
|
|
76
85
|
inputId?: string
|
|
77
86
|
lang?: 'fr' | 'en'
|
|
@@ -81,6 +90,7 @@ const props = withDefaults(
|
|
|
81
90
|
suggestions: undefined,
|
|
82
91
|
loading: false,
|
|
83
92
|
highlightMatch: false,
|
|
93
|
+
showOperators: true,
|
|
84
94
|
inputId: 'rm-search-tags',
|
|
85
95
|
lang: 'fr',
|
|
86
96
|
},
|
|
@@ -197,7 +207,9 @@ function onInput() {
|
|
|
197
207
|
suggOpen.value = true
|
|
198
208
|
cursor.value = 0
|
|
199
209
|
// Un prefixe tape a la main vaut selection dans le panneau.
|
|
200
|
-
const hit =
|
|
210
|
+
const hit = props.showOperators
|
|
211
|
+
? OPERATORS.find(o => text.value.startsWith(o.symbol))
|
|
212
|
+
: undefined
|
|
201
213
|
if (hit) nextType.value = hit.type
|
|
202
214
|
emit('typing', text.value)
|
|
203
215
|
}
|
|
@@ -297,6 +309,7 @@ function move(step: 1 | -1) {
|
|
|
297
309
|
: next > items.value.length ? 0 : next
|
|
298
310
|
return
|
|
299
311
|
}
|
|
312
|
+
if (!props.showOperators) return
|
|
300
313
|
const at = OPERATORS.findIndex(o => o.type === nextType.value)
|
|
301
314
|
const to = (at + step + OPERATORS.length) % OPERATORS.length
|
|
302
315
|
nextType.value = OPERATORS[to]!.type
|
|
@@ -327,6 +340,7 @@ defineExpose({
|
|
|
327
340
|
<!-- L'operateur du prochain terme, toujours visible : sans lui le
|
|
328
341
|
lecteur tape « aspirine » sans savoir s'il ajoute ou exclut. -->
|
|
329
342
|
<button
|
|
343
|
+
v-if="showOperators"
|
|
330
344
|
type="button"
|
|
331
345
|
class="rm-search-tags__operator"
|
|
332
346
|
:aria-label="t.operator"
|
|
@@ -404,7 +418,7 @@ defineExpose({
|
|
|
404
418
|
</div>
|
|
405
419
|
|
|
406
420
|
<!-- Choix de l'operateur du prochain terme -->
|
|
407
|
-
<div v-if="panelOpen" class="rm-search-tags__panel">
|
|
421
|
+
<div v-if="panelOpen && showOperators" class="rm-search-tags__panel">
|
|
408
422
|
<div class="rm-search-tags__panel-head">
|
|
409
423
|
<p class="rm-search-tags__panel-title">{{ t.options }}</p>
|
|
410
424
|
<button
|