v-nuxt-ui 0.2.15 → 0.2.17
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/GlowBorder.d.vue.ts +49 -0
- package/dist/runtime/components/GlowBorder.vue +49 -0
- package/dist/runtime/components/GlowBorder.vue.d.ts +49 -0
- package/dist/runtime/components/flow/FlowEditor.client.d.vue.ts +6 -1
- package/dist/runtime/components/flow/FlowEditor.client.vue +14 -4
- package/dist/runtime/components/flow/FlowEditor.client.vue.d.ts +6 -1
- package/dist/runtime/composables/useEChart.js +30 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GlowBorder
|
|
3
|
+
* 通用流光边框容器:旋转 conic-gradient + blur 模拟边框流光。
|
|
4
|
+
* 参考 inspira-ui GradientButton 实现思路。
|
|
5
|
+
*
|
|
6
|
+
* - 始终保留 padding 空间,切换 active 时内容尺寸稳定不抖动。
|
|
7
|
+
* - active=false 时只是不渲染流光,结构与样式不变。
|
|
8
|
+
*/
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
/** 是否启用流光效果 */
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/** 流光颜色数组(conic-gradient 顺序) */
|
|
13
|
+
colors?: string[];
|
|
14
|
+
/** 边框宽度 px */
|
|
15
|
+
borderWidth?: number;
|
|
16
|
+
/** 外圆角 px */
|
|
17
|
+
borderRadius?: number;
|
|
18
|
+
/** 内层圆角 px,默认 borderRadius - borderWidth */
|
|
19
|
+
innerBorderRadius?: number;
|
|
20
|
+
/** 旋转一圈耗时 s */
|
|
21
|
+
duration?: number;
|
|
22
|
+
/** 流光模糊度 px */
|
|
23
|
+
blur?: number;
|
|
24
|
+
/** 选中时的缩放系数 */
|
|
25
|
+
scale?: number;
|
|
26
|
+
/** 选中时的投影 */
|
|
27
|
+
shadow?: string;
|
|
28
|
+
};
|
|
29
|
+
declare var __VLS_1: {};
|
|
30
|
+
type __VLS_Slots = {} & {
|
|
31
|
+
default?: (props: typeof __VLS_1) => any;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
34
|
+
scale: number;
|
|
35
|
+
borderWidth: number;
|
|
36
|
+
borderRadius: number;
|
|
37
|
+
blur: number;
|
|
38
|
+
duration: number;
|
|
39
|
+
colors: string[];
|
|
40
|
+
shadow: string;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
active: { type: Boolean, required: false },
|
|
5
|
+
colors: { type: Array, required: false, default: () => [
|
|
6
|
+
"#ef4444",
|
|
7
|
+
"#f97316",
|
|
8
|
+
"#fbbf24",
|
|
9
|
+
"#84cc16",
|
|
10
|
+
"#06b6d4",
|
|
11
|
+
"#6366f1",
|
|
12
|
+
"#ec4899",
|
|
13
|
+
"#ef4444"
|
|
14
|
+
] },
|
|
15
|
+
borderWidth: { type: Number, required: false, default: 2 },
|
|
16
|
+
borderRadius: { type: Number, required: false, default: 10 },
|
|
17
|
+
innerBorderRadius: { type: Number, required: false },
|
|
18
|
+
duration: { type: Number, required: false, default: 3 },
|
|
19
|
+
blur: { type: Number, required: false, default: 10 },
|
|
20
|
+
scale: { type: Number, required: false, default: 1.02 },
|
|
21
|
+
shadow: { type: String, required: false, default: "0 9px 9px rgba(0, 0, 0, 0.35)" }
|
|
22
|
+
});
|
|
23
|
+
const styleVars = computed(() => ({
|
|
24
|
+
"--gb-radius": `${props.borderRadius}px`,
|
|
25
|
+
"--gb-inner-radius": `${props.innerBorderRadius ?? Math.max(0, props.borderRadius - props.borderWidth)}px`,
|
|
26
|
+
"--gb-padding": `${props.borderWidth}px`,
|
|
27
|
+
"--gb-duration": `${props.duration}s`,
|
|
28
|
+
"--gb-blur": `${props.blur}px`,
|
|
29
|
+
"--gb-gradient": `conic-gradient(${props.colors.join(",")})`,
|
|
30
|
+
"--gb-scale": props.scale,
|
|
31
|
+
"--gb-shadow": props.shadow
|
|
32
|
+
}));
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div
|
|
37
|
+
class="glow-border relative"
|
|
38
|
+
:class="{ 'glow-border--active': active }"
|
|
39
|
+
:style="styleVars"
|
|
40
|
+
>
|
|
41
|
+
<div class="glow-border__inner relative size-full">
|
|
42
|
+
<slot />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<style scoped>
|
|
48
|
+
.glow-border{border-radius:var(--gb-radius);isolation:isolate;overflow:hidden;padding:var(--gb-padding)}.glow-border:before{animation:glow-border-rotate var(--gb-duration) linear infinite;animation-play-state:paused;background:var(--gb-gradient);content:"";filter:blur(var(--gb-blur));inset:-200%;opacity:0;pointer-events:none;position:absolute;transform:rotate(0deg);transition:opacity .2s ease-in-out;z-index:0}.glow-border__inner{background:var(--ui-bg);border-radius:var(--gb-inner-radius);position:relative;z-index:1}.glow-border--active:before{animation-play-state:running;opacity:1}@keyframes glow-border-rotate{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){.glow-border,.glow-border:before{animation:none;transition:opacity .2s ease-in-out}}
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GlowBorder
|
|
3
|
+
* 通用流光边框容器:旋转 conic-gradient + blur 模拟边框流光。
|
|
4
|
+
* 参考 inspira-ui GradientButton 实现思路。
|
|
5
|
+
*
|
|
6
|
+
* - 始终保留 padding 空间,切换 active 时内容尺寸稳定不抖动。
|
|
7
|
+
* - active=false 时只是不渲染流光,结构与样式不变。
|
|
8
|
+
*/
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
/** 是否启用流光效果 */
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/** 流光颜色数组(conic-gradient 顺序) */
|
|
13
|
+
colors?: string[];
|
|
14
|
+
/** 边框宽度 px */
|
|
15
|
+
borderWidth?: number;
|
|
16
|
+
/** 外圆角 px */
|
|
17
|
+
borderRadius?: number;
|
|
18
|
+
/** 内层圆角 px,默认 borderRadius - borderWidth */
|
|
19
|
+
innerBorderRadius?: number;
|
|
20
|
+
/** 旋转一圈耗时 s */
|
|
21
|
+
duration?: number;
|
|
22
|
+
/** 流光模糊度 px */
|
|
23
|
+
blur?: number;
|
|
24
|
+
/** 选中时的缩放系数 */
|
|
25
|
+
scale?: number;
|
|
26
|
+
/** 选中时的投影 */
|
|
27
|
+
shadow?: string;
|
|
28
|
+
};
|
|
29
|
+
declare var __VLS_1: {};
|
|
30
|
+
type __VLS_Slots = {} & {
|
|
31
|
+
default?: (props: typeof __VLS_1) => any;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
34
|
+
scale: number;
|
|
35
|
+
borderWidth: number;
|
|
36
|
+
borderRadius: number;
|
|
37
|
+
blur: number;
|
|
38
|
+
duration: number;
|
|
39
|
+
colors: string[];
|
|
40
|
+
shadow: string;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -22,6 +22,8 @@ type __VLS_Props = {
|
|
|
22
22
|
draggable?: boolean;
|
|
23
23
|
/** 是否可编辑(false 时:工具栏新增按钮禁用、edge 不能增删改、node handles 不显示) */
|
|
24
24
|
editable?: boolean;
|
|
25
|
+
/** 是否允许点击选中节点(默认跟随 editable) */
|
|
26
|
+
nodeSelectable?: boolean;
|
|
25
27
|
/** 是否自动适配填满容器并居中 */
|
|
26
28
|
fitView?: boolean;
|
|
27
29
|
fitViewPadding?: number;
|
|
@@ -35,7 +37,10 @@ type __VLS_Slots = {} & {
|
|
|
35
37
|
} & {
|
|
36
38
|
default?: (props: typeof __VLS_63) => any;
|
|
37
39
|
};
|
|
38
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
40
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
41
|
+
selectedNode: import("vue").ComputedRef<FlowNodeType | null>;
|
|
42
|
+
selectedNodes: import("vue").ComputedRef<FlowNodeType[]>;
|
|
43
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
44
|
"update:modelValue": (value: Flow) => any;
|
|
40
45
|
"edit-node": (node: FlowNodeType) => any;
|
|
41
46
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -20,6 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
zoomable: { type: Boolean, required: false, default: true },
|
|
21
21
|
draggable: { type: Boolean, required: false, default: true },
|
|
22
22
|
editable: { type: Boolean, required: false, default: true },
|
|
23
|
+
nodeSelectable: { type: Boolean, required: false },
|
|
23
24
|
fitView: { type: Boolean, required: false, default: false },
|
|
24
25
|
fitViewPadding: { type: Number, required: false, default: 0.01 },
|
|
25
26
|
noFlowNodeBorder: { type: Boolean, required: false }
|
|
@@ -90,6 +91,15 @@ const {
|
|
|
90
91
|
handleMouseMove,
|
|
91
92
|
handleMouseUp
|
|
92
93
|
} = resizeLogic;
|
|
94
|
+
const isNodeSelectable = computed(() => props.nodeSelectable ?? props.editable);
|
|
95
|
+
const selectedNodes = computed(() => {
|
|
96
|
+
return getSelectedNodes.value.map((node) => props.modelValue?.nodes?.find((item) => String(item.id) === node.id)).filter((node) => Boolean(node));
|
|
97
|
+
});
|
|
98
|
+
const selectedNode = computed(() => selectedNodes.value[0] ?? null);
|
|
99
|
+
defineExpose({
|
|
100
|
+
selectedNode,
|
|
101
|
+
selectedNodes
|
|
102
|
+
});
|
|
93
103
|
const mousePosition = ref({ x: 0, y: 0 });
|
|
94
104
|
provide(FLOW_MOUSE_POSITION_KEY, mousePosition);
|
|
95
105
|
provide(FLOW_EDITABLE_KEY, toRef(props, "editable"));
|
|
@@ -156,11 +166,11 @@ const handleKeyDown = async (event) => {
|
|
|
156
166
|
event.preventDefault();
|
|
157
167
|
event.stopPropagation();
|
|
158
168
|
event.stopImmediatePropagation();
|
|
159
|
-
const
|
|
169
|
+
const selectedNodes2 = getSelectedNodes.value;
|
|
160
170
|
const selectedEdges = getSelectedEdges.value;
|
|
161
|
-
if (
|
|
171
|
+
if (selectedNodes2.length === 0 && selectedEdges.length === 0) return;
|
|
162
172
|
await Promise.all([
|
|
163
|
-
...
|
|
173
|
+
...selectedNodes2.map((node) => deleteNode(node.id)),
|
|
164
174
|
...selectedEdges.map((edge) => deleteEdge(edge.id))
|
|
165
175
|
]);
|
|
166
176
|
};
|
|
@@ -268,7 +278,7 @@ const isValidConnection = () => true;
|
|
|
268
278
|
:pan-on-scroll="false"
|
|
269
279
|
:nodes-draggable="draggable"
|
|
270
280
|
:nodes-connectable="editable"
|
|
271
|
-
:elements-selectable="
|
|
281
|
+
:elements-selectable="isNodeSelectable"
|
|
272
282
|
:class="{ 'flow-fit-view': fitView }"
|
|
273
283
|
>
|
|
274
284
|
<Background
|
|
@@ -22,6 +22,8 @@ type __VLS_Props = {
|
|
|
22
22
|
draggable?: boolean;
|
|
23
23
|
/** 是否可编辑(false 时:工具栏新增按钮禁用、edge 不能增删改、node handles 不显示) */
|
|
24
24
|
editable?: boolean;
|
|
25
|
+
/** 是否允许点击选中节点(默认跟随 editable) */
|
|
26
|
+
nodeSelectable?: boolean;
|
|
25
27
|
/** 是否自动适配填满容器并居中 */
|
|
26
28
|
fitView?: boolean;
|
|
27
29
|
fitViewPadding?: number;
|
|
@@ -35,7 +37,10 @@ type __VLS_Slots = {} & {
|
|
|
35
37
|
} & {
|
|
36
38
|
default?: (props: typeof __VLS_63) => any;
|
|
37
39
|
};
|
|
38
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
40
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
41
|
+
selectedNode: import("vue").ComputedRef<FlowNodeType | null>;
|
|
42
|
+
selectedNodes: import("vue").ComputedRef<FlowNodeType[]>;
|
|
43
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
44
|
"update:modelValue": (value: Flow) => any;
|
|
40
45
|
"edit-node": (node: FlowNodeType) => any;
|
|
41
46
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -214,6 +214,28 @@ const _useEChart = () => {
|
|
|
214
214
|
return merged;
|
|
215
215
|
});
|
|
216
216
|
};
|
|
217
|
+
const getCommonRadarOption = () => ({
|
|
218
|
+
radar: {
|
|
219
|
+
axisName: {
|
|
220
|
+
color: getNormedUiTextColor()
|
|
221
|
+
},
|
|
222
|
+
axisLine: {
|
|
223
|
+
lineStyle: {
|
|
224
|
+
color: getNormedUiBorderColor()
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
splitLine: {
|
|
228
|
+
lineStyle: {
|
|
229
|
+
color: getNormedUiBorderColor()
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
splitArea: {
|
|
233
|
+
areaStyle: {
|
|
234
|
+
color: ["transparent"]
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
217
239
|
const mergeOption = (option, config = {}) => {
|
|
218
240
|
const {
|
|
219
241
|
enableXAxis = true,
|
|
@@ -234,6 +256,14 @@ const _useEChart = () => {
|
|
|
234
256
|
const yAxisDefaults = getCommonYAxisOption(enableYAxis).yAxis;
|
|
235
257
|
merged.yAxis = merged.yAxis.map((axis) => defu(axis, yAxisDefaults));
|
|
236
258
|
}
|
|
259
|
+
if (merged.radar) {
|
|
260
|
+
const radarDefaults = getCommonRadarOption().radar;
|
|
261
|
+
if (Array.isArray(merged.radar)) {
|
|
262
|
+
merged.radar = merged.radar.map((r) => defu(r, radarDefaults));
|
|
263
|
+
} else {
|
|
264
|
+
merged.radar = defu(merged.radar, radarDefaults);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
237
267
|
if (merged.series && Array.isArray(merged.series)) {
|
|
238
268
|
merged.series = mergeSeries(merged.series);
|
|
239
269
|
}
|
package/package.json
CHANGED