adminforth 3.24.1 → 3.24.3
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 +4 -27
- package/package.json +1 -1
|
@@ -14,18 +14,7 @@
|
|
|
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
|
-
|
|
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'"
|
|
17
|
+
autocomplete="off" data-custom="no-autofill" name="afcl-select-input" id="afcl-select-input"
|
|
29
18
|
:placeholder="
|
|
30
19
|
selectedItems.length && !multiple ? '' : (showDropdown ? $t('Search') : placeholder || $t('Select...'))
|
|
31
20
|
"
|
|
@@ -49,15 +38,13 @@
|
|
|
49
38
|
</div>
|
|
50
39
|
</div>
|
|
51
40
|
<teleport to="body" v-if="(teleportToBody || teleportToTop) && showDropdown">
|
|
52
|
-
<div ref="dropdownEl" :
|
|
41
|
+
<div ref="dropdownEl" :style="getDropdownPosition" :class="{'shadow-none': isTop, 'z-30': teleportToBody, 'z-[1000]': teleportToTop}"
|
|
53
42
|
class="fixed w-full bg-lightDropdownOptionsBackground shadow-lg dark:shadow-black dark:bg-darkDropdownOptionsBackground
|
|
54
43
|
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"
|
|
55
44
|
@scroll="handleDropdownScroll">
|
|
56
45
|
<div
|
|
57
46
|
v-for="item in filteredItems"
|
|
58
47
|
:key="item.value"
|
|
59
|
-
role="option"
|
|
60
|
-
:aria-selected="selectedItems.includes(item)"
|
|
61
48
|
class="px-4 py-2 cursor-pointer hover:bg-lightDropdownOptionsHoverBackground dark:hover:bg-darkDropdownOptionsHoverBackground text-lightDropdownOptionsText dark:text-darkDropdownOptionsText"
|
|
62
49
|
:class="{ 'bg-lightDropdownPicked dark:bg-darkDropdownPicked': selectedItems.includes(item) }"
|
|
63
50
|
@click="toogleItem(item)"
|
|
@@ -75,15 +62,13 @@
|
|
|
75
62
|
</div>
|
|
76
63
|
</teleport>
|
|
77
64
|
|
|
78
|
-
<div v-if="!teleportToBody && !teleportToTop && showDropdown" ref="dropdownEl" :
|
|
65
|
+
<div v-if="!teleportToBody && !teleportToTop && showDropdown" ref="dropdownEl" :style="dropdownStyle" :class="{'shadow-none': isTop}"
|
|
79
66
|
class="afcl-select-content absolute z-10 mt-1 w-full bg-lightDropdownOptionsBackground shadow-lg text-lightDropdownButtonsText dark:shadow-black dark:bg-darkDropdownOptionsBackground
|
|
80
67
|
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"
|
|
81
68
|
@scroll="handleDropdownScroll">
|
|
82
69
|
<div
|
|
83
70
|
v-for="item in filteredItems"
|
|
84
71
|
:key="item.value"
|
|
85
|
-
role="option"
|
|
86
|
-
:aria-selected="selectedItems.includes(item)"
|
|
87
72
|
class="px-4 py-2 cursor-pointer text-lightDropdownOptionsText hover:bg-lightDropdownOptionsHoverBackground dark:hover:bg-darkDropdownOptionsHoverBackground dark:text-darkDropdownOptionsText"
|
|
88
73
|
:class="{ 'bg-lightDropdownPicked dark:bg-darkDropdownPicked': selectedItems.includes(item) }"
|
|
89
74
|
@click="toogleItem(item)"
|
|
@@ -130,7 +115,7 @@
|
|
|
130
115
|
</template>
|
|
131
116
|
|
|
132
117
|
<script setup lang="ts">
|
|
133
|
-
import { ref, computed, onMounted, onUnmounted, watch, nextTick,
|
|
118
|
+
import { ref, computed, onMounted, onUnmounted, watch, nextTick,type PropType, type Ref } from 'vue';
|
|
134
119
|
import { IconCaretDownSolid } from '@iconify-prerendered/vue-flowbite';
|
|
135
120
|
import { useElementSize } from '@vueuse/core'
|
|
136
121
|
|
|
@@ -182,14 +167,6 @@ const props = defineProps({
|
|
|
182
167
|
|
|
183
168
|
const emit = defineEmits(['update:modelValue', 'scroll-near-end', 'search']);
|
|
184
169
|
|
|
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
|
-
|
|
193
170
|
const search = ref('');
|
|
194
171
|
const showDropdown = ref(false);
|
|
195
172
|
const inputEl = ref<HTMLElement | null>(null);
|