adminforth 3.24.0 → 3.24.2
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/spa/src/afcl/Select.vue +27 -4
- package/package.json +1 -1
|
@@ -14,7 +14,18 @@
|
|
|
14
14
|
placeholder-lightDropdownButtonsPlaceholderText text-lightDropdownButtonsText text-base sm:text-sm transition duration-150 ease-in-out dark:bg-darkDropdownButtonsBackground dark:border-darkDropdownButtonsBorder dark:placeholder-darkDropdownButtonsPlaceholderText
|
|
15
15
|
dark:text-darkDropdownButtonsText focus:ring-lightPrimary focus:border-lightPrimary dark:focus:ring-darkPrimary dark:focus:border-darkPrimary"
|
|
16
16
|
:class="[{'cursor-pointer': searchDisabled}, classesForInput]"
|
|
17
|
-
|
|
17
|
+
:id="inputId"
|
|
18
|
+
:name="inputId"
|
|
19
|
+
autocomplete="new-password"
|
|
20
|
+
data-1p-ignore
|
|
21
|
+
data-lpignore="true"
|
|
22
|
+
data-bwignore
|
|
23
|
+
data-form-type="other"
|
|
24
|
+
role="combobox"
|
|
25
|
+
aria-haspopup="listbox"
|
|
26
|
+
:aria-expanded="showDropdown"
|
|
27
|
+
:aria-controls="dropdownId"
|
|
28
|
+
:aria-autocomplete="searchDisabled ? 'none' : 'list'"
|
|
18
29
|
:placeholder="
|
|
19
30
|
selectedItems.length && !multiple ? '' : (showDropdown ? $t('Search') : placeholder || $t('Select...'))
|
|
20
31
|
"
|
|
@@ -38,13 +49,15 @@
|
|
|
38
49
|
</div>
|
|
39
50
|
</div>
|
|
40
51
|
<teleport to="body" v-if="(teleportToBody || teleportToTop) && showDropdown">
|
|
41
|
-
<div ref="dropdownEl" :style="getDropdownPosition" :class="{'shadow-none': isTop, 'z-30': teleportToBody, 'z-[1000]': teleportToTop}"
|
|
52
|
+
<div ref="dropdownEl" :id="dropdownId" role="listbox" :style="getDropdownPosition" :class="{'shadow-none': isTop, 'z-30': teleportToBody, 'z-[1000]': teleportToTop}"
|
|
42
53
|
class="fixed w-full bg-lightDropdownOptionsBackground shadow-lg dark:shadow-black dark:bg-darkDropdownOptionsBackground
|
|
43
54
|
dark:border-gray-600 rounded-default py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm max-h-48"
|
|
44
55
|
@scroll="handleDropdownScroll">
|
|
45
56
|
<div
|
|
46
57
|
v-for="item in filteredItems"
|
|
47
58
|
:key="item.value"
|
|
59
|
+
role="option"
|
|
60
|
+
:aria-selected="selectedItems.includes(item)"
|
|
48
61
|
class="px-4 py-2 cursor-pointer hover:bg-lightDropdownOptionsHoverBackground dark:hover:bg-darkDropdownOptionsHoverBackground text-lightDropdownOptionsText dark:text-darkDropdownOptionsText"
|
|
49
62
|
:class="{ 'bg-lightDropdownPicked dark:bg-darkDropdownPicked': selectedItems.includes(item) }"
|
|
50
63
|
@click="toogleItem(item)"
|
|
@@ -62,13 +75,15 @@
|
|
|
62
75
|
</div>
|
|
63
76
|
</teleport>
|
|
64
77
|
|
|
65
|
-
<div v-if="!teleportToBody && !teleportToTop && showDropdown" ref="dropdownEl" :style="dropdownStyle" :class="{'shadow-none': isTop}"
|
|
78
|
+
<div v-if="!teleportToBody && !teleportToTop && showDropdown" ref="dropdownEl" :id="dropdownId" role="listbox" :style="dropdownStyle" :class="{'shadow-none': isTop}"
|
|
66
79
|
class="afcl-select-content absolute z-10 mt-1 w-full bg-lightDropdownOptionsBackground shadow-lg text-lightDropdownButtonsText dark:shadow-black dark:bg-darkDropdownOptionsBackground
|
|
67
80
|
dark:border-gray-600 rounded-default py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm max-h-48"
|
|
68
81
|
@scroll="handleDropdownScroll">
|
|
69
82
|
<div
|
|
70
83
|
v-for="item in filteredItems"
|
|
71
84
|
:key="item.value"
|
|
85
|
+
role="option"
|
|
86
|
+
:aria-selected="selectedItems.includes(item)"
|
|
72
87
|
class="px-4 py-2 cursor-pointer text-lightDropdownOptionsText hover:bg-lightDropdownOptionsHoverBackground dark:hover:bg-darkDropdownOptionsHoverBackground dark:text-darkDropdownOptionsText"
|
|
73
88
|
:class="{ 'bg-lightDropdownPicked dark:bg-darkDropdownPicked': selectedItems.includes(item) }"
|
|
74
89
|
@click="toogleItem(item)"
|
|
@@ -115,7 +130,7 @@
|
|
|
115
130
|
</template>
|
|
116
131
|
|
|
117
132
|
<script setup lang="ts">
|
|
118
|
-
import { ref, computed, onMounted, onUnmounted, watch, nextTick,type PropType, type Ref } from 'vue';
|
|
133
|
+
import { ref, computed, onMounted, onUnmounted, watch, nextTick, useId,type PropType, type Ref } from 'vue';
|
|
119
134
|
import { IconCaretDownSolid } from '@iconify-prerendered/vue-flowbite';
|
|
120
135
|
import { useElementSize } from '@vueuse/core'
|
|
121
136
|
|
|
@@ -167,6 +182,14 @@ const props = defineProps({
|
|
|
167
182
|
|
|
168
183
|
const emit = defineEmits(['update:modelValue', 'scroll-near-end', 'search']);
|
|
169
184
|
|
|
185
|
+
// Opaque per-instance id/name: Chromium classifies fields for profile autofill by name/id heuristics,
|
|
186
|
+
// so a shared static name like "afcl-select-input" lets it treat every Select on the page as the same
|
|
187
|
+
// field and fill it with e.g. the saved email. Paired with autocomplete="new-password" on the input,
|
|
188
|
+
// which Chromium honours for suppressing profile autofill (plain autocomplete="off" is ignored).
|
|
189
|
+
const uid = useId();
|
|
190
|
+
const inputId = `afs-${uid}`;
|
|
191
|
+
const dropdownId = `afs-list-${uid}`;
|
|
192
|
+
|
|
170
193
|
const search = ref('');
|
|
171
194
|
const showDropdown = ref(false);
|
|
172
195
|
const inputEl = ref<HTMLElement | null>(null);
|