v-nuxt-ui 0.2.7 → 0.2.8
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/module.json +1 -1
- package/dist/runtime/components/button/CircleColor.d.vue.ts +2 -2
- package/dist/runtime/components/button/CircleColor.vue +6 -5
- package/dist/runtime/components/button/CircleColor.vue.d.ts +2 -2
- package/dist/runtime/components/flow/FlowNode.client.vue +14 -12
- package/dist/runtime/components/flow/FlowToolbar.vue +7 -7
- package/dist/runtime/constants/flow.js +3 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { FlowColorRole } from '#v/constants';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Tailwind 颜色名 (e.g. 'red', 'blue'),空字符串表示默认 */
|
|
3
4
|
chip?: string;
|
|
4
|
-
/** 色阶 (默认 500) */
|
|
5
|
-
shade?: number;
|
|
6
5
|
/** 是否选中 */
|
|
7
6
|
selected?: boolean;
|
|
8
7
|
/** 标题提示 */
|
|
9
8
|
title?: string;
|
|
9
|
+
colorRole?: FlowColorRole;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
click: () => any;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useColorMode } from "@vueuse/core";
|
|
4
|
+
import { resolveFlowColor } from "#v/constants";
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
chip: { type: String, required: false },
|
|
6
|
-
shade: { type: Number, required: false },
|
|
7
7
|
selected: { type: Boolean, required: false },
|
|
8
|
-
title: { type: String, required: false }
|
|
8
|
+
title: { type: String, required: false },
|
|
9
|
+
colorRole: { type: null, required: false }
|
|
9
10
|
});
|
|
10
11
|
defineEmits(["click"]);
|
|
11
12
|
const colorMode = useColorMode();
|
|
12
13
|
const backgroundStyle = computed(() => {
|
|
13
|
-
if (!props.chip
|
|
14
|
-
const
|
|
15
|
-
return `background-color:
|
|
14
|
+
if (!props.chip) return void 0;
|
|
15
|
+
const varName = resolveFlowColor(props.chip, props.colorRole ?? "border", colorMode.value === "dark");
|
|
16
|
+
return `background-color: ${varName}`;
|
|
16
17
|
});
|
|
17
18
|
</script>
|
|
18
19
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { FlowColorRole } from '#v/constants';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Tailwind 颜色名 (e.g. 'red', 'blue'),空字符串表示默认 */
|
|
3
4
|
chip?: string;
|
|
4
|
-
/** 色阶 (默认 500) */
|
|
5
|
-
shade?: number;
|
|
6
5
|
/** 是否选中 */
|
|
7
6
|
selected?: boolean;
|
|
8
7
|
/** 标题提示 */
|
|
9
8
|
title?: string;
|
|
9
|
+
colorRole?: FlowColorRole;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
click: () => any;
|
|
@@ -47,18 +47,20 @@ const showBorder = computed(() => props.data.showBorder !== false);
|
|
|
47
47
|
@mouseleave="isHoveredLocal = false"
|
|
48
48
|
@dblclick="data.onEdit?.()"
|
|
49
49
|
>
|
|
50
|
-
<!-- Connection handles
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
<!-- Connection handles:始终渲染以确保 edge 连接点正确,非编辑模式下隐藏且禁用交互 -->
|
|
51
|
+
<Handle
|
|
52
|
+
v-for="handle in activeHandles"
|
|
53
|
+
:id="`${handle.id}`"
|
|
54
|
+
:key="`${handle.id}`"
|
|
55
|
+
type="source"
|
|
56
|
+
:position="handle.position"
|
|
57
|
+
:connectable="editable"
|
|
58
|
+
:style="{
|
|
59
|
+
...handleStyle(handle),
|
|
60
|
+
...editable ? {} : { opacity: 0, pointerEvents: 'none', width: '1px', height: '1px' }
|
|
61
|
+
}"
|
|
62
|
+
@mousedown.stop
|
|
63
|
+
/>
|
|
62
64
|
|
|
63
65
|
<!-- content -->
|
|
64
66
|
<div class="flex items-center justify-center gap-2 w-full">
|
|
@@ -138,7 +138,7 @@ function getStrokeDasharray(value) {
|
|
|
138
138
|
v-for="opt in FLOW_COLORS"
|
|
139
139
|
:key="opt.color"
|
|
140
140
|
:chip="opt.chip"
|
|
141
|
-
|
|
141
|
+
color-role="border"
|
|
142
142
|
:selected="unifiedColor === opt.color"
|
|
143
143
|
:title="opt.chip || 'default'"
|
|
144
144
|
@click="onUnifiedColorChange?.(opt.color)"
|
|
@@ -199,7 +199,7 @@ function getStrokeDasharray(value) {
|
|
|
199
199
|
v-for="opt in FLOW_COLORS"
|
|
200
200
|
:key="opt.color"
|
|
201
201
|
:chip="opt.chip"
|
|
202
|
-
|
|
202
|
+
color-role="border"
|
|
203
203
|
:selected="nodeBorderColor === opt.color"
|
|
204
204
|
:title="opt.chip || 'default'"
|
|
205
205
|
@click="onNodeBorderColorChange?.(opt.color)"
|
|
@@ -218,7 +218,7 @@ function getStrokeDasharray(value) {
|
|
|
218
218
|
v-for="opt in FLOW_COLORS"
|
|
219
219
|
:key="opt.color"
|
|
220
220
|
:chip="opt.chip"
|
|
221
|
-
|
|
221
|
+
color-role="bg"
|
|
222
222
|
:selected="nodeBgColor === opt.color"
|
|
223
223
|
:title="opt.chip || 'default'"
|
|
224
224
|
@click="onNodeBgColorChange?.(opt.color)"
|
|
@@ -252,7 +252,7 @@ function getStrokeDasharray(value) {
|
|
|
252
252
|
v-for="opt in FLOW_COLORS"
|
|
253
253
|
:key="opt.color"
|
|
254
254
|
:chip="opt.chip"
|
|
255
|
-
|
|
255
|
+
color-role="font"
|
|
256
256
|
:selected="nodeFontColor === opt.color"
|
|
257
257
|
:title="opt.chip || 'default'"
|
|
258
258
|
@click="onNodeFontColorChange?.(opt.color)"
|
|
@@ -297,7 +297,7 @@ function getStrokeDasharray(value) {
|
|
|
297
297
|
v-for="opt in FLOW_COLORS"
|
|
298
298
|
:key="opt.color"
|
|
299
299
|
:chip="opt.chip"
|
|
300
|
-
|
|
300
|
+
color-role="border"
|
|
301
301
|
:selected="nodeHandleColor === opt.color"
|
|
302
302
|
:title="opt.chip || 'default'"
|
|
303
303
|
@click="onNodeHandleColorChange?.(opt.color)"
|
|
@@ -558,7 +558,7 @@ function getStrokeDasharray(value) {
|
|
|
558
558
|
v-for="opt in FLOW_COLORS"
|
|
559
559
|
:key="opt.color"
|
|
560
560
|
:chip="opt.chip"
|
|
561
|
-
|
|
561
|
+
color-role="border"
|
|
562
562
|
:selected="edgeColor === opt.color"
|
|
563
563
|
:title="opt.chip || 'default'"
|
|
564
564
|
@click="onEdgeColorChange?.(opt.color)"
|
|
@@ -577,7 +577,7 @@ function getStrokeDasharray(value) {
|
|
|
577
577
|
v-for="opt in FLOW_COLORS"
|
|
578
578
|
:key="opt.color"
|
|
579
579
|
:chip="opt.chip"
|
|
580
|
-
|
|
580
|
+
color-role="font"
|
|
581
581
|
:selected="edgeLabelColor === opt.color"
|
|
582
582
|
:title="opt.chip || 'default'"
|
|
583
583
|
@click="onEdgeLabelColorChange?.(opt.color)"
|
|
@@ -58,7 +58,8 @@ const FLOW_COLOR_NAMES = [
|
|
|
58
58
|
"purple",
|
|
59
59
|
"fuchsia",
|
|
60
60
|
"pink",
|
|
61
|
-
"rose"
|
|
61
|
+
"rose",
|
|
62
|
+
"neutral"
|
|
62
63
|
];
|
|
63
64
|
export const FLOW_COLORS = [
|
|
64
65
|
{ color: "primary", chip: "primary" },
|
|
@@ -72,7 +73,7 @@ export const FLOW_SHADE_MAP = {
|
|
|
72
73
|
export function resolveFlowColor(name, role, isDark) {
|
|
73
74
|
if (!name) return "";
|
|
74
75
|
const shade = FLOW_SHADE_MAP[role][isDark ? "dark" : "light"];
|
|
75
|
-
if (name === "primary") {
|
|
76
|
+
if (name === "primary" || name === "neutral") {
|
|
76
77
|
return `var(--ui-color-${name}-${shade})`;
|
|
77
78
|
}
|
|
78
79
|
return `var(--color-${name}-${shade})`;
|
package/package.json
CHANGED