@dnax/ui 0.0.20 → 0.0.21
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/components/QAutocomplete.vue +18 -0
- package/package.json +1 -1
- package/styles/main.css +21 -0
|
@@ -280,6 +280,15 @@ const onClear = () => {
|
|
|
280
280
|
emit("clear")
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
// Clear du champ de recherche du panneau (sheet/modal) : vide la recherche
|
|
284
|
+
// sans effacer la sélection, garde le focus dans l'input
|
|
285
|
+
const onSearchClear = () => {
|
|
286
|
+
query.value = ""
|
|
287
|
+
emit("update:inputValue", "")
|
|
288
|
+
activeIndex.value = 0
|
|
289
|
+
nextTick(() => panelInput.value?.focus())
|
|
290
|
+
}
|
|
291
|
+
|
|
283
292
|
const isSelected = (opt: any) => getValue(opt) === props.modelValue
|
|
284
293
|
|
|
285
294
|
// À la perte de focus : si le texte saisi ne correspond exactement à aucune
|
|
@@ -502,6 +511,15 @@ watch(open, (v) => {
|
|
|
502
511
|
@input="onInput"
|
|
503
512
|
@keydown="onKeydown"
|
|
504
513
|
/>
|
|
514
|
+
<button
|
|
515
|
+
v-if="query !== ''"
|
|
516
|
+
type="button"
|
|
517
|
+
class="q-autocomplete__search-clear"
|
|
518
|
+
aria-label="Effacer la recherche"
|
|
519
|
+
@mousedown.prevent="onSearchClear"
|
|
520
|
+
>
|
|
521
|
+
<Icon :icon="icons.x" aria-hidden="true" />
|
|
522
|
+
</button>
|
|
505
523
|
</div>
|
|
506
524
|
<div
|
|
507
525
|
ref="popupRef"
|
package/package.json
CHANGED
package/styles/main.css
CHANGED
|
@@ -3571,6 +3571,27 @@ html.dark body {
|
|
|
3571
3571
|
.q-autocomplete__search-input::placeholder {
|
|
3572
3572
|
color: rgb(0 0 0 / 0.45);
|
|
3573
3573
|
}
|
|
3574
|
+
.q-autocomplete__search-clear {
|
|
3575
|
+
display: inline-flex;
|
|
3576
|
+
align-items: center;
|
|
3577
|
+
justify-content: center;
|
|
3578
|
+
width: 20px;
|
|
3579
|
+
height: 20px;
|
|
3580
|
+
padding: 0;
|
|
3581
|
+
border: none;
|
|
3582
|
+
border-radius: 50%;
|
|
3583
|
+
background: rgb(0 0 0 / 0.15);
|
|
3584
|
+
color: inherit;
|
|
3585
|
+
cursor: pointer;
|
|
3586
|
+
flex-shrink: 0;
|
|
3587
|
+
}
|
|
3588
|
+
.q-autocomplete__search-clear:hover {
|
|
3589
|
+
background: rgb(0 0 0 / 0.25);
|
|
3590
|
+
}
|
|
3591
|
+
.q-autocomplete__search-clear svg {
|
|
3592
|
+
width: 12px;
|
|
3593
|
+
height: 12px;
|
|
3594
|
+
}
|
|
3574
3595
|
.q-autocomplete__sheet-list {
|
|
3575
3596
|
overflow-y: auto;
|
|
3576
3597
|
padding: 6px;
|