This commit is contained in:
dap
2025-05-04 17:23:32 +08:00
60 changed files with 498 additions and 210 deletions

View File

@@ -165,13 +165,18 @@ const searchInputProps = computed(() => {
};
});
function updateCurrentSelect(v: string) {
currentSelect.value = v;
}
defineExpose({ toggleOpenState, open, close });
</script>
<template>
<VbenPopover
v-model:open="visible"
:content-props="{ align: 'end', alignOffset: -11, sideOffset: 8 }"
content-class="p-0 pt-3"
content-class="p-0 pt-3 w-full"
trigger-class="w-full"
>
<template #trigger>
<template v-if="props.type === 'input'">
@@ -183,6 +188,7 @@ defineExpose({ toggleOpenState, open, close });
role="combobox"
:aria-label="$t('ui.iconPicker.placeholder')"
aria-expanded="visible"
:[`onUpdate:${modelValueProp}`]="updateCurrentSelect"
v-bind="$attrs"
>
<template #[iconSlot]>

View File

@@ -35,6 +35,16 @@ const getZIndex = computed(() => {
return props.zIndex || calcZIndex();
});
/**
* 排除ant-message和loading:9999的z-index
*/
const zIndexExcludeClass = ['ant-message', 'loading'];
function isZIndexExcludeClass(element: Element) {
return zIndexExcludeClass.some((className) =>
element.classList.contains(className),
);
}
/**
* 获取最大的zIndex值
*/
@@ -44,7 +54,11 @@ function calcZIndex() {
[...elements].forEach((element) => {
const style = window.getComputedStyle(element);
const zIndex = style.getPropertyValue('z-index');
if (zIndex && !Number.isNaN(Number.parseInt(zIndex))) {
if (
zIndex &&
!Number.isNaN(Number.parseInt(zIndex)) &&
!isZIndexExcludeClass(element)
) {
maxZ = Math.max(maxZ, Number.parseInt(zIndex));
}
});