From 63a915ca4f4ca8eb5a3807a9f254909914588b9d Mon Sep 17 00:00:00 2001
From: ComfyFluffy <24245520+ComfyFluffy@users.noreply.github.com>
Date: Thu, 13 Jun 2024 16:48:50 +0800
Subject: [PATCH 1/3] feat: UIDropdownWithTooltip
---
.../components/editor/common/EditorList.vue | 34 ++++++---------
spx-gui/src/components/ui/UIDropdown.vue | 5 +++
.../components/ui/UIDropdownWithTooltip.vue | 41 +++++++++++++++++++
spx-gui/src/components/ui/UITooltip.vue | 17 +++++++-
spx-gui/src/components/ui/index.ts | 1 +
5 files changed, 75 insertions(+), 23 deletions(-)
create mode 100644 spx-gui/src/components/ui/UIDropdownWithTooltip.vue
diff --git a/spx-gui/src/components/editor/common/EditorList.vue b/spx-gui/src/components/editor/common/EditorList.vue
index 6ab8d41ef..10a764f79 100644
--- a/spx-gui/src/components/editor/common/EditorList.vue
+++ b/spx-gui/src/components/editor/common/EditorList.vue
@@ -4,26 +4,19 @@
-
+
+
+
+
+
+ {{ addText }}
+
-
-
-
-
-
-
- {{ addText }}
-
-
+
-
-
+
@@ -33,11 +26,10 @@
import { computed } from 'vue'
import {
UIIcon,
- UIDropdown,
- UITooltip,
type Color,
useUIVariables,
- getCssVars
+ getCssVars,
+ UIDropdownWithTooltip
} from '@/components/ui'
const props = defineProps<{
diff --git a/spx-gui/src/components/ui/UIDropdown.vue b/spx-gui/src/components/ui/UIDropdown.vue
index 59cbf9250..31cb668c5 100644
--- a/spx-gui/src/components/ui/UIDropdown.vue
+++ b/spx-gui/src/components/ui/UIDropdown.vue
@@ -11,6 +11,7 @@
:show-arrow="false"
:style="{ marginTop: offset.y + 'px', marginLeft: offset.x + 'px' }"
raw
+ @update:show="(v) => emit('update:visible', v)"
>
@@ -58,6 +59,10 @@ withDefaults(
}
)
+const emit = defineEmits<{
+ 'update:visible': [boolean]
+}>()
+
const attachTo = usePopupContainer()
const nPopoverRef = ref>()
diff --git a/spx-gui/src/components/ui/UIDropdownWithTooltip.vue b/spx-gui/src/components/ui/UIDropdownWithTooltip.vue
new file mode 100644
index 000000000..471e86d47
--- /dev/null
+++ b/spx-gui/src/components/ui/UIDropdownWithTooltip.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/spx-gui/src/components/ui/UITooltip.vue b/spx-gui/src/components/ui/UITooltip.vue
index 40942397f..2e40b57ba 100644
--- a/spx-gui/src/components/ui/UITooltip.vue
+++ b/spx-gui/src/components/ui/UITooltip.vue
@@ -1,5 +1,12 @@
-
+ emit('update:visible', v)"
+ >
@@ -16,12 +23,18 @@ export type Placement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-sta
withDefaults(
defineProps<{
placement?: Placement
+ visible?: boolean
}>(),
{
- placement: 'top'
+ placement: 'top',
+ visible: undefined
}
)
+const emit = defineEmits<{
+ 'update:visible': [boolean]
+}>()
+
const attachTo = usePopupContainer()
diff --git a/spx-gui/src/components/ui/index.ts b/spx-gui/src/components/ui/index.ts
index 00a9c54bd..affc6a070 100644
--- a/spx-gui/src/components/ui/index.ts
+++ b/spx-gui/src/components/ui/index.ts
@@ -31,3 +31,4 @@ export * from './tab'
export { default as UICode } from './UICode.vue'
export { default as UIButtonGroup } from './UIButtonGroup.vue'
export { default as UIButtonGroupItem } from './UIButtonGroupItem.vue'
+export { default as UIDropdownWithTooltip } from './UIDropdownWithTooltip.vue'
From 808c094a41a89f5c2a8e274f43809c8d8a7d85ca Mon Sep 17 00:00:00 2001
From: ComfyFluffy <24245520+ComfyFluffy@users.noreply.github.com>
Date: Thu, 13 Jun 2024 16:49:05 +0800
Subject: [PATCH 2/3] fix: missing import for UILoading
---
spx-gui/src/components/editor/stage/BackdropDetail.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spx-gui/src/components/editor/stage/BackdropDetail.vue b/spx-gui/src/components/editor/stage/BackdropDetail.vue
index 52c5dd43b..079bb1c47 100644
--- a/spx-gui/src/components/editor/stage/BackdropDetail.vue
+++ b/spx-gui/src/components/editor/stage/BackdropDetail.vue
@@ -8,7 +8,7 @@