feat(mongodb): allow editing inferred CSV import column types
This commit is contained in:
1 parent
99738c160c
commit
83c8447b4d
17 files changed
+706
-33
No files matched your search
@@ -168,6 +168,13 @@ function selectItem(item: LightDropdownItem) {
|
||||
if (props.closeOnSelect) close();
|
||||
}
|
||||
|
||||
function selectItemOnKeyboard(item: LightDropdownItem, event: MouseEvent) {
|
||||
// Keyboard activation (Enter/Space) emits a click with detail 0; mouse
|
||||
// clicks are already handled by pointerdown, so only pick up keyboard here
|
||||
// to avoid selecting twice for one press.
|
||||
if (event.detail === 0) selectItem(item);
|
||||
}
|
||||
|
||||
onBeforeUnmount(close);
|
||||
</script>
|
||||
|
||||
@@ -180,7 +187,7 @@ onBeforeUnmount(close);
|
||||
<ChevronDown v-if="showChevron" class="h-3 w-3 opacity-50" />
|
||||
</button>
|
||||
<Teleport to="body">
|
||||
<div v-if="open" ref="menuRef" class="fixed z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 cn-menu-translucent text-popover-foreground" :class="contentClass" :style="menuStyle" role="menu">
|
||||
<div v-if="open" ref="menuRef" class="pointer-events-auto fixed z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 cn-menu-translucent text-popover-foreground" :class="contentClass" :style="menuStyle" role="menu" @pointerdown.prevent>
|
||||
<div v-if="label" :class="labelClass">{{ label }}</div>
|
||||
<div v-if="label" class="bg-border -mx-1 my-1 h-px" />
|
||||
<template v-for="item in items" :key="item.value">
|
||||
@@ -194,7 +201,8 @@ onBeforeUnmount(close);
|
||||
:title="item.title"
|
||||
:style="{ paddingInlineStart: `${0.375 + (item.indentLevel ?? 0) * 0.75}rem` }"
|
||||
role="menuitem"
|
||||
@click="selectItem(item)"
|
||||
@pointerdown.prevent="selectItem(item)"
|
||||
@click="selectItemOnKeyboard(item, $event)"
|
||||
>
|
||||
<Check v-if="checkPosition === 'left'" class="h-3 w-3 shrink-0" :class="[isItemSelected(item) ? selectedCheckClass : 'opacity-0']" />
|
||||
<span v-if="item.leadingText" class="inline-flex h-5 w-6 shrink-0 items-center justify-center text-sm font-medium leading-none">
|
||||
|
||||
@@ -32,6 +32,10 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
||||
(event) => {
|
||||
const originalEvent = event.detail.originalEvent;
|
||||
const target = originalEvent.target as HTMLElement;
|
||||
if (target.closest('[role=menu], [role=listbox], [data-slot=select-content]')) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user