v-nuxt-ui 0.2.8 → 0.2.9
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/flow/FlowEdge.client.vue +3 -1
- package/dist/runtime/components/flow/FlowEditor.client.vue +7 -2
- package/dist/runtime/components/flow/FlowToolbar.d.vue.ts +2 -0
- package/dist/runtime/components/flow/FlowToolbar.vue +15 -0
- package/dist/runtime/components/flow/FlowToolbar.vue.d.ts +2 -0
- package/dist/runtime/composables/flow/useFlowStyles.d.ts +2 -0
- package/dist/runtime/composables/flow/useFlowStyles.js +3 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -42,6 +42,7 @@ const {
|
|
|
42
42
|
edgePathType,
|
|
43
43
|
edgeAnimated,
|
|
44
44
|
edgeStrokeType,
|
|
45
|
+
edgeColorOpacity,
|
|
45
46
|
effectiveEdgeColor,
|
|
46
47
|
effectiveEdgeLabelColor,
|
|
47
48
|
effectiveNodeBorderColor
|
|
@@ -114,7 +115,8 @@ const markersToRender = computed(() => {
|
|
|
114
115
|
const edgeStyle = computed(() => {
|
|
115
116
|
const base = {
|
|
116
117
|
...props.style,
|
|
117
|
-
stroke: strokeColor.value
|
|
118
|
+
stroke: strokeColor.value,
|
|
119
|
+
opacity: edgeColorOpacity.value / 100
|
|
118
120
|
};
|
|
119
121
|
if (edgeAnimated.value) {
|
|
120
122
|
const strokeOpt = FLOW_EDGE_STROKE_TYPES.find((t) => t.type === edgeStrokeType.value);
|
|
@@ -55,6 +55,7 @@ const {
|
|
|
55
55
|
edgeStrokeType,
|
|
56
56
|
edgePathType,
|
|
57
57
|
edgeColor,
|
|
58
|
+
edgeColorOpacity,
|
|
58
59
|
edgeLabelColor,
|
|
59
60
|
nodeShowBorder,
|
|
60
61
|
nodeBorderWidth,
|
|
@@ -126,7 +127,8 @@ watchEffect(() => {
|
|
|
126
127
|
edge.style = {
|
|
127
128
|
strokeWidth: edgeStrokeWidth.value,
|
|
128
129
|
...dasharray ? { strokeDasharray: dasharray } : {},
|
|
129
|
-
...effectiveEdgeColor.value ? { stroke: effectiveEdgeColor.value } : {}
|
|
130
|
+
...effectiveEdgeColor.value ? { stroke: effectiveEdgeColor.value } : {},
|
|
131
|
+
opacity: edgeColorOpacity.value / 100
|
|
130
132
|
};
|
|
131
133
|
edge.markerStart = void 0;
|
|
132
134
|
edge.markerEnd = void 0;
|
|
@@ -209,7 +211,8 @@ const defaultEdgeOptions = computed(() => {
|
|
|
209
211
|
style: {
|
|
210
212
|
strokeWidth: edgeStrokeWidth.value,
|
|
211
213
|
...dasharray ? { strokeDasharray: dasharray } : {},
|
|
212
|
-
...effectiveEdgeColor.value ? { stroke: effectiveEdgeColor.value } : {}
|
|
214
|
+
...effectiveEdgeColor.value ? { stroke: effectiveEdgeColor.value } : {},
|
|
215
|
+
opacity: edgeColorOpacity.value / 100
|
|
213
216
|
},
|
|
214
217
|
// Markers are handled by FlowEdge custom SVG markers
|
|
215
218
|
markerStart: void 0,
|
|
@@ -273,6 +276,7 @@ const isValidConnection = () => true;
|
|
|
273
276
|
:edge-marker-end="edgeMarkerEnd"
|
|
274
277
|
:edge-animated="edgeAnimated"
|
|
275
278
|
:edge-color="edgeColor"
|
|
279
|
+
:edge-color-opacity="edgeColorOpacity"
|
|
276
280
|
:edge-label-color="edgeLabelColor"
|
|
277
281
|
:node-show-border="nodeShowBorder"
|
|
278
282
|
:node-border-width="nodeBorderWidth"
|
|
@@ -290,6 +294,7 @@ const isValidConnection = () => true;
|
|
|
290
294
|
:on-edge-marker-end-change="(v) => edgeMarkerEnd = v"
|
|
291
295
|
:on-toggle-edge-animated="() => edgeAnimated = !edgeAnimated"
|
|
292
296
|
:on-edge-color-change="(v) => edgeColor = v"
|
|
297
|
+
:on-edge-color-opacity-change="(v) => edgeColorOpacity = v"
|
|
293
298
|
:on-edge-label-color-change="(v) => edgeLabelColor = v"
|
|
294
299
|
:on-toggle-node-show-border="() => nodeShowBorder = !nodeShowBorder"
|
|
295
300
|
:on-node-border-width-change="(v) => nodeBorderWidth = v"
|
|
@@ -10,6 +10,7 @@ type __VLS_Props = {
|
|
|
10
10
|
edgeMarkerStart?: FlowArrowType;
|
|
11
11
|
edgeMarkerEnd?: FlowArrowType;
|
|
12
12
|
edgeAnimated?: boolean;
|
|
13
|
+
edgeColorOpacity?: number;
|
|
13
14
|
edgeColor?: string;
|
|
14
15
|
edgeLabelColor?: string;
|
|
15
16
|
editable?: boolean;
|
|
@@ -34,6 +35,7 @@ type __VLS_Props = {
|
|
|
34
35
|
onEdgeMarkerStartChange?: (type: FlowArrowType) => void;
|
|
35
36
|
onEdgeMarkerEndChange?: (type: FlowArrowType) => void;
|
|
36
37
|
onToggleEdgeAnimated?: () => void;
|
|
38
|
+
onEdgeColorOpacityChange?: (opacity: number) => void;
|
|
37
39
|
onEdgeColorChange?: (color: string) => void;
|
|
38
40
|
onEdgeLabelColorChange?: (color: string) => void;
|
|
39
41
|
onToggleNodeShowBorder?: () => void;
|
|
@@ -25,6 +25,7 @@ defineProps({
|
|
|
25
25
|
edgeMarkerStart: { type: String, required: false },
|
|
26
26
|
edgeMarkerEnd: { type: String, required: false },
|
|
27
27
|
edgeAnimated: { type: Boolean, required: false },
|
|
28
|
+
edgeColorOpacity: { type: Number, required: false },
|
|
28
29
|
edgeColor: { type: String, required: false },
|
|
29
30
|
edgeLabelColor: { type: String, required: false },
|
|
30
31
|
editable: { type: Boolean, required: false },
|
|
@@ -46,6 +47,7 @@ defineProps({
|
|
|
46
47
|
onEdgeMarkerStartChange: { type: Function, required: false },
|
|
47
48
|
onEdgeMarkerEndChange: { type: Function, required: false },
|
|
48
49
|
onToggleEdgeAnimated: { type: Function, required: false },
|
|
50
|
+
onEdgeColorOpacityChange: { type: Function, required: false },
|
|
49
51
|
onEdgeColorChange: { type: Function, required: false },
|
|
50
52
|
onEdgeLabelColorChange: { type: Function, required: false },
|
|
51
53
|
onToggleNodeShowBorder: { type: Function, required: false },
|
|
@@ -550,6 +552,19 @@ function getStrokeDasharray(value) {
|
|
|
550
552
|
</div>
|
|
551
553
|
</FlowToolbarItemWrapper>
|
|
552
554
|
|
|
555
|
+
<!-- 颜色透明度 -->
|
|
556
|
+
<FlowToolbarItemWrapper label="颜色透明度">
|
|
557
|
+
<USlider
|
|
558
|
+
:model-value="edgeColorOpacity ?? 100"
|
|
559
|
+
:min="0"
|
|
560
|
+
:max="100"
|
|
561
|
+
:step="5"
|
|
562
|
+
size="sm"
|
|
563
|
+
class="flex-1"
|
|
564
|
+
@update:model-value="(v) => onEdgeColorOpacityChange?.(v ?? 100)"
|
|
565
|
+
/>
|
|
566
|
+
</FlowToolbarItemWrapper>
|
|
567
|
+
|
|
553
568
|
<!-- 连接线颜色 -->
|
|
554
569
|
<div :class="{ 'opacity-40 pointer-events-none': isUnifiedMode }">
|
|
555
570
|
<FlowToolbarItemWrapper label="连接线颜色">
|
|
@@ -10,6 +10,7 @@ type __VLS_Props = {
|
|
|
10
10
|
edgeMarkerStart?: FlowArrowType;
|
|
11
11
|
edgeMarkerEnd?: FlowArrowType;
|
|
12
12
|
edgeAnimated?: boolean;
|
|
13
|
+
edgeColorOpacity?: number;
|
|
13
14
|
edgeColor?: string;
|
|
14
15
|
edgeLabelColor?: string;
|
|
15
16
|
editable?: boolean;
|
|
@@ -34,6 +35,7 @@ type __VLS_Props = {
|
|
|
34
35
|
onEdgeMarkerStartChange?: (type: FlowArrowType) => void;
|
|
35
36
|
onEdgeMarkerEndChange?: (type: FlowArrowType) => void;
|
|
36
37
|
onToggleEdgeAnimated?: () => void;
|
|
38
|
+
onEdgeColorOpacityChange?: (opacity: number) => void;
|
|
37
39
|
onEdgeColorChange?: (color: string) => void;
|
|
38
40
|
onEdgeLabelColorChange?: (color: string) => void;
|
|
39
41
|
onToggleNodeShowBorder?: () => void;
|
|
@@ -9,6 +9,7 @@ export interface FlowEdgeStylesState {
|
|
|
9
9
|
strokeType: FlowEdgeStrokeType;
|
|
10
10
|
pathType: FlowEdgePathType;
|
|
11
11
|
color: string;
|
|
12
|
+
colorOpacity: number;
|
|
12
13
|
labelColor: string;
|
|
13
14
|
}
|
|
14
15
|
/** 节点样式存储结构 */
|
|
@@ -49,6 +50,7 @@ export declare function useFlowStyles(): {
|
|
|
49
50
|
edgeStrokeType: WritableComputedRef<FlowEdgeStrokeType, FlowEdgeStrokeType>;
|
|
50
51
|
edgePathType: WritableComputedRef<FlowEdgePathType, FlowEdgePathType>;
|
|
51
52
|
edgeColor: WritableComputedRef<string, string>;
|
|
53
|
+
edgeColorOpacity: WritableComputedRef<number, number>;
|
|
52
54
|
edgeLabelColor: WritableComputedRef<string, string>;
|
|
53
55
|
nodeShowBorder: WritableComputedRef<boolean, boolean>;
|
|
54
56
|
nodeBorderWidth: WritableComputedRef<number, number>;
|
|
@@ -10,6 +10,7 @@ const EDGE_DEFAULTS = {
|
|
|
10
10
|
strokeType: "solid",
|
|
11
11
|
pathType: "smoothstep",
|
|
12
12
|
color: "",
|
|
13
|
+
colorOpacity: 100,
|
|
13
14
|
labelColor: ""
|
|
14
15
|
};
|
|
15
16
|
const NODE_DEFAULTS = {
|
|
@@ -74,6 +75,7 @@ export function useFlowStyles() {
|
|
|
74
75
|
const edgeStrokeType = useField(edgeStore, "strokeType");
|
|
75
76
|
const edgePathType = useField(edgeStore, "pathType");
|
|
76
77
|
const edgeColor = useField(edgeStore, "color");
|
|
78
|
+
const edgeColorOpacity = useField(edgeStore, "colorOpacity");
|
|
77
79
|
const edgeLabelColor = useField(edgeStore, "labelColor");
|
|
78
80
|
const nodeShowBorder = useField(nodeStore, "showBorder");
|
|
79
81
|
const nodeBorderWidth = useField(nodeStore, "borderWidth");
|
|
@@ -117,6 +119,7 @@ export function useFlowStyles() {
|
|
|
117
119
|
edgeStrokeType,
|
|
118
120
|
edgePathType,
|
|
119
121
|
edgeColor,
|
|
122
|
+
edgeColorOpacity,
|
|
120
123
|
edgeLabelColor,
|
|
121
124
|
// 节点(原始自定义值,用于 UI 绑定)
|
|
122
125
|
nodeShowBorder,
|
package/package.json
CHANGED