|
|
@ -17,8 +17,6 @@ const { |
|
|
|
|
|
|
|
|
|
|
|
const { $e } = useNuxtApp() |
|
|
|
const { $e } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
const isReady = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const searchExtensionRef = ref<HTMLInputElement>() |
|
|
|
const searchExtensionRef = ref<HTMLInputElement>() |
|
|
|
|
|
|
|
|
|
|
|
const extensionHeaderRef = ref<HTMLDivElement>() |
|
|
|
const extensionHeaderRef = ref<HTMLDivElement>() |
|
|
@ -27,6 +25,13 @@ const searchQuery = ref<string>('') |
|
|
|
|
|
|
|
|
|
|
|
const showSearchBox = ref(false) |
|
|
|
const showSearchBox = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const panelSize = computed(() => { |
|
|
|
|
|
|
|
if (isPanelExpanded.value) { |
|
|
|
|
|
|
|
return extensionPanelSize.value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return 0 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const { width } = useElementSize(extensionHeaderRef) |
|
|
|
const { width } = useElementSize(extensionHeaderRef) |
|
|
|
|
|
|
|
|
|
|
|
const isOpenSearchBox = computed(() => { |
|
|
|
const isOpenSearchBox = computed(() => { |
|
|
@ -54,14 +59,6 @@ const toggleMarket = () => { |
|
|
|
isMarketVisible.value = !isMarketVisible.value |
|
|
|
isMarketVisible.value = !isMarketVisible.value |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const normalizePaneMaxWidth = computed(() => { |
|
|
|
|
|
|
|
if (isReady.value) { |
|
|
|
|
|
|
|
return 60 |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return extensionPanelSize.value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onMove = async (_event: { moved: { newIndex: number; oldIndex: number; element: ExtensionType } }) => { |
|
|
|
const onMove = async (_event: { moved: { newIndex: number; oldIndex: number; element: ExtensionType } }) => { |
|
|
|
let { |
|
|
|
let { |
|
|
|
moved: { newIndex = 0, oldIndex = 0, element }, |
|
|
|
moved: { newIndex = 0, oldIndex = 0, element }, |
|
|
@ -100,20 +97,6 @@ const onMove = async (_event: { moved: { newIndex: number; oldIndex: number; ele |
|
|
|
$e('a:extension:reorder') |
|
|
|
$e('a:extension:reorder') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ |
|
|
|
|
|
|
|
onReady: () => { |
|
|
|
|
|
|
|
isReady.value = true |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(isPanelExpanded, (newValue) => { |
|
|
|
|
|
|
|
if (newValue && !isReady.value) { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
isReady.value = true |
|
|
|
|
|
|
|
}, 300) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onClickOutside(searchExtensionRef, () => { |
|
|
|
onClickOutside(searchExtensionRef, () => { |
|
|
|
if (searchQuery.value) { |
|
|
|
if (searchQuery.value) { |
|
|
|
return |
|
|
|
return |
|
|
@ -130,17 +113,9 @@ onMounted(() => { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<Pane |
|
|
|
<Pane :size="panelSize" max-size="60%" class="nc-extension-pane"> |
|
|
|
v-if="isPanelExpanded" |
|
|
|
<Transition name="layout" :duration="150"> |
|
|
|
:size="extensionPanelSize" |
|
|
|
<div v-if="isPanelExpanded" class="flex flex-col"> |
|
|
|
min-size="10%" |
|
|
|
|
|
|
|
max-size="60%" |
|
|
|
|
|
|
|
class="nc-extension-pane" |
|
|
|
|
|
|
|
:style="{ |
|
|
|
|
|
|
|
minWidth: isReady ? '300px' : `${normalizePaneMaxWidth}%`, |
|
|
|
|
|
|
|
maxWidth: `${normalizePaneMaxWidth}%`, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
ref="extensionHeaderRef" |
|
|
|
ref="extensionHeaderRef" |
|
|
|
class="h-[var(--toolbar-height)] flex items-center gap-3 px-4 py-2 border-b-1 border-gray-200 bg-white" |
|
|
|
class="h-[var(--toolbar-height)] flex items-center gap-3 px-4 py-2 border-b-1 border-gray-200 bg-white" |
|
|
@ -249,6 +224,8 @@ onMounted(() => { |
|
|
|
:extension-id="detailsExtensionId" |
|
|
|
:extension-id="detailsExtensionId" |
|
|
|
:from="detailsFrom" |
|
|
|
:from="detailsFrom" |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</Transition> |
|
|
|
</Pane> |
|
|
|
</Pane> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|