@dnax/ui 0.0.16 → 0.0.18
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 +12 -0
- package/components/QSelect.vue +5 -1
- package/package.json +1 -1
- package/styles/main.css +15 -0
|
@@ -47,6 +47,8 @@ interface Props {
|
|
|
47
47
|
height?: string
|
|
48
48
|
/** Titre du panneau (défaut : label → placeholder) */
|
|
49
49
|
title?: string
|
|
50
|
+
/** Icône Iconify à gauche (remplacée par le slot #prepend s'il est fourni) */
|
|
51
|
+
iconLeft?: string
|
|
50
52
|
/** Options spécifiques au mode sheet (width, height, title, style, class, searchPlaceholder) */
|
|
51
53
|
sheetOptions?: QAutocompleteModeOptions
|
|
52
54
|
/** Options spécifiques au mode modal */
|
|
@@ -97,6 +99,7 @@ const emit = defineEmits<{
|
|
|
97
99
|
|
|
98
100
|
defineSlots<{
|
|
99
101
|
default?: (props: Record<string, any>) => any // option : { option, index, selected, active }
|
|
102
|
+
prepend?: () => any
|
|
100
103
|
noOptions?: () => any
|
|
101
104
|
error?: () => any
|
|
102
105
|
hint?: () => any
|
|
@@ -335,6 +338,9 @@ watch(open, (v) => {
|
|
|
335
338
|
<div ref="rootEl" class="q-autocomplete" :class="fieldClasses" :style="roundedStyle" v-bind="$attrs">
|
|
336
339
|
<label v-if="label" class="q-field__label-stack">{{ label }}</label>
|
|
337
340
|
<div class="q-field__control">
|
|
341
|
+
<slot name="prepend">
|
|
342
|
+
<Icon v-if="iconLeft" :icon="iconLeft" class="q-field__icon" aria-hidden="true" />
|
|
343
|
+
</slot>
|
|
338
344
|
<input
|
|
339
345
|
class="q-field__native"
|
|
340
346
|
:value="inputDisplay"
|
|
@@ -360,6 +366,12 @@ watch(open, (v) => {
|
|
|
360
366
|
>
|
|
361
367
|
<Icon :icon="icons.x" aria-hidden="true" />
|
|
362
368
|
</button>
|
|
369
|
+
<Icon
|
|
370
|
+
:icon="icons.chevronDown"
|
|
371
|
+
class="q-autocomplete__arrow"
|
|
372
|
+
:class="{ 'q-autocomplete__arrow--rotated': open }"
|
|
373
|
+
aria-hidden="true"
|
|
374
|
+
/>
|
|
363
375
|
</div>
|
|
364
376
|
<div v-if="error" class="q-field__bottom">
|
|
365
377
|
<div class="q-field__error">
|
package/components/QSelect.vue
CHANGED
|
@@ -81,6 +81,8 @@ interface Props {
|
|
|
81
81
|
noOptionsLabel?: string
|
|
82
82
|
/** Icône Iconify de la flèche (défaut : lucide:chevron-down) */
|
|
83
83
|
dropdownIcon?: string
|
|
84
|
+
/** Icône Iconify à gauche (remplacée par le slot #prepend s'il est fourni) */
|
|
85
|
+
iconLeft?: string
|
|
84
86
|
/** Recherche floue fuse.js : true (défauts) ou { keys, threshold } — champ de recherche séparé affiché avant la liste */
|
|
85
87
|
useSearch?: boolean | UseSearchOptions
|
|
86
88
|
/** Placeholder du champ de recherche (useSearch) */
|
|
@@ -519,7 +521,9 @@ const sheetClass = computed(() => [`q-select__sheet--${props.mode}`, modeOptions
|
|
|
519
521
|
<div ref="rootEl" class="q-select" :class="fieldClasses" :style="fieldRadiusStyle">
|
|
520
522
|
<label v-if="label" class="q-field__label-stack">{{ label }}</label>
|
|
521
523
|
<div class="q-field__control" @click="onControlClick">
|
|
522
|
-
<slot name="prepend"
|
|
524
|
+
<slot name="prepend">
|
|
525
|
+
<Icon v-if="iconLeft" :icon="iconLeft" class="q-field__icon" aria-hidden="true" />
|
|
526
|
+
</slot>
|
|
523
527
|
|
|
524
528
|
<!-- Chips : uniquement en multiple + use-chips (comme Quasar — un select
|
|
525
529
|
simple avec use-chips affiche juste le texte du display) -->
|
package/package.json
CHANGED
package/styles/main.css
CHANGED
|
@@ -1951,6 +1951,9 @@ html.dark body {
|
|
|
1951
1951
|
display: inline-flex;
|
|
1952
1952
|
flex-shrink: 0;
|
|
1953
1953
|
color: rgb(0 0 0 / 0.45);
|
|
1954
|
+
/* petit espace dédié entre l'icône gauche et la valeur (gap 6px du
|
|
1955
|
+
control + 2px = 8px) — évite l'icône collée au texte */
|
|
1956
|
+
margin-right: 2px;
|
|
1954
1957
|
}
|
|
1955
1958
|
|
|
1956
1959
|
.q-field__clear {
|
|
@@ -3366,6 +3369,18 @@ html.dark body {
|
|
|
3366
3369
|
flex-shrink: 0;
|
|
3367
3370
|
}
|
|
3368
3371
|
|
|
3372
|
+
.q-autocomplete__arrow {
|
|
3373
|
+
width: 18px;
|
|
3374
|
+
height: 18px;
|
|
3375
|
+
flex-shrink: 0;
|
|
3376
|
+
color: rgb(0 0 0 / 0.6);
|
|
3377
|
+
transition: transform 0.2s ease;
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
.q-autocomplete__arrow--rotated {
|
|
3381
|
+
transform: rotate(180deg);
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3369
3384
|
.q-autocomplete__popup {
|
|
3370
3385
|
position: absolute;
|
|
3371
3386
|
top: calc(100% + 4px);
|