v-nuxt-ui 0.1.35 → 0.2.0
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/module.mjs +1 -0
- package/dist/runtime/components/Watermark.d.vue.ts +3 -3
- package/dist/runtime/components/Watermark.vue.d.ts +3 -3
- package/dist/runtime/components/button/CircleColor.d.vue.ts +17 -0
- package/dist/runtime/components/button/CircleColor.vue +37 -0
- package/dist/runtime/components/button/CircleColor.vue.d.ts +17 -0
- package/dist/runtime/components/button/Dropdown.vue +5 -1
- package/dist/runtime/components/date-picker/Input.d.vue.ts +9 -1
- package/dist/runtime/components/date-picker/Input.vue +55 -11
- package/dist/runtime/components/date-picker/Input.vue.d.ts +9 -1
- package/dist/runtime/components/date-picker/index.vue +3 -3
- package/dist/runtime/components/flow/FlowEdge.client.vue +170 -41
- package/dist/runtime/components/flow/FlowEditor.client.d.vue.ts +51 -0
- package/dist/runtime/components/flow/FlowEditor.client.vue +287 -0
- package/dist/runtime/components/flow/FlowEditor.client.vue.d.ts +51 -0
- package/dist/runtime/components/flow/FlowNode.client.d.vue.ts +13 -2
- package/dist/runtime/components/flow/FlowNode.client.vue +44 -48
- package/dist/runtime/components/flow/FlowNode.client.vue.d.ts +13 -2
- package/dist/runtime/components/flow/FlowToolbar.d.vue.ts +41 -5
- package/dist/runtime/components/flow/FlowToolbar.vue +554 -88
- package/dist/runtime/components/flow/FlowToolbar.vue.d.ts +41 -5
- package/dist/runtime/components/flow/FlowToolbarItemWrapper.d.vue.ts +17 -0
- package/dist/runtime/components/flow/FlowToolbarItemWrapper.vue +16 -0
- package/dist/runtime/components/flow/FlowToolbarItemWrapper.vue.d.ts +17 -0
- package/dist/runtime/components/form/field/DatePicker.vue +1 -1
- package/dist/runtime/components/sys/flow/CreateModal.d.vue.ts +13 -0
- package/dist/runtime/components/sys/flow/CreateModal.vue +32 -0
- package/dist/runtime/components/sys/flow/CreateModal.vue.d.ts +13 -0
- package/dist/runtime/components/sys/flow/EditNodeModal.d.vue.ts +13 -0
- package/dist/runtime/components/sys/flow/EditNodeModal.vue +30 -0
- package/dist/runtime/components/sys/flow/EditNodeModal.vue.d.ts +13 -0
- package/dist/runtime/components/sys/flow/Table.d.vue.ts +3 -0
- package/dist/runtime/components/sys/flow/Table.vue +103 -0
- package/dist/runtime/components/sys/flow/Table.vue.d.ts +3 -0
- package/dist/runtime/components/sys/table/CreateModal.vue +9 -193
- package/dist/runtime/components/sys/table/Table.vue +6 -15
- package/dist/runtime/components/sys/table/TableColumnList.d.vue.ts +54 -0
- package/dist/runtime/components/sys/table/TableColumnList.vue +196 -0
- package/dist/runtime/components/sys/table/TableColumnList.vue.d.ts +54 -0
- package/dist/runtime/components/sys/table/TableColumnModal.d.vue.ts +3 -13
- package/dist/runtime/components/sys/table/TableColumnModal.vue +32 -100
- package/dist/runtime/components/sys/table/TableColumnModal.vue.d.ts +3 -13
- package/dist/runtime/components/sys/user/Table.vue +44 -27
- package/dist/runtime/components/table/permission/TablePermissionConfig.d.vue.ts +2 -2
- package/dist/runtime/components/table/permission/TablePermissionConfig.vue +3 -3
- package/dist/runtime/components/table/permission/TablePermissionConfig.vue.d.ts +2 -2
- package/dist/runtime/components/table/permission/TablePermissionTab.vue +7 -4
- package/dist/runtime/components/table/query/order/Item.d.vue.ts +2 -2
- package/dist/runtime/components/table/query/order/Item.vue.d.ts +2 -2
- package/dist/runtime/components/table/query/where/Newer.vue +2 -0
- package/dist/runtime/components/table/query/where/index.vue +46 -15
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.vue +9 -4
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue +3 -3
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +45 -48
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue +137 -131
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.d.vue.ts +4 -2
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue +40 -40
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue.d.ts +4 -2
- package/dist/runtime/components/table/query/where/simple/item/opr/index.vue +2 -0
- package/dist/runtime/components/table/settings/TableSettings.d.vue.ts +1 -1
- package/dist/runtime/components/table/settings/TableSettings.vue +0 -3
- package/dist/runtime/components/table/settings/TableSettings.vue.d.ts +1 -1
- package/dist/runtime/composables/api/sys/index.d.ts +3 -0
- package/dist/runtime/composables/api/sys/index.js +3 -0
- package/dist/runtime/composables/api/sys/useFlowApi.d.ts +2 -0
- package/dist/runtime/composables/api/sys/useFlowApi.js +5 -0
- package/dist/runtime/composables/api/sys/useFlowEdgeApi.d.ts +2 -0
- package/dist/runtime/composables/api/sys/useFlowEdgeApi.js +3 -0
- package/dist/runtime/composables/api/sys/useFlowNodeApi.d.ts +2 -0
- package/dist/runtime/composables/api/sys/useFlowNodeApi.js +3 -0
- package/dist/runtime/composables/api/sys/useRoleApi.js +3 -1
- package/dist/runtime/composables/api/sys/useUserApi.js +3 -1
- package/dist/runtime/composables/flow/index.d.ts +3 -0
- package/dist/runtime/composables/flow/index.js +3 -0
- package/dist/runtime/composables/flow/useFlow.d.ts +33 -0
- package/dist/runtime/composables/flow/useFlow.js +401 -0
- package/dist/runtime/composables/flow/useFlowNode.d.ts +17 -0
- package/dist/runtime/composables/flow/useFlowNode.js +106 -0
- package/dist/runtime/composables/flow/useFlowResize.d.ts +21 -0
- package/dist/runtime/composables/flow/useFlowResize.js +84 -0
- package/dist/runtime/composables/flow/useFlowStyles.d.ts +62 -9
- package/dist/runtime/composables/flow/useFlowStyles.js +127 -23
- package/dist/runtime/composables/table/useTableColumnPermission.d.ts +36 -0
- package/dist/runtime/composables/useDate.js +8 -8
- package/dist/runtime/composables/useSidebarMenu.js +0 -2
- package/dist/runtime/composables/useTheme.d.ts +1 -1
- package/dist/runtime/composables/useTheme.js +0 -1
- package/dist/runtime/constants/flow.d.ts +166 -0
- package/dist/runtime/constants/flow.js +171 -0
- package/dist/runtime/constants/index.d.ts +1 -0
- package/dist/runtime/constants/index.js +1 -0
- package/dist/runtime/constants/options.js +2 -3
- package/dist/runtime/constants/table.d.ts +2 -0
- package/dist/runtime/constants/table.js +8 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/types/components/table/column.d.ts +4 -3
- package/dist/runtime/types/components/table/query/where.d.ts +1 -5
- package/dist/runtime/types/models/flow.d.ts +61 -0
- package/dist/runtime/types/models/flow.js +0 -0
- package/dist/runtime/types/models/index.d.ts +1 -0
- package/dist/runtime/types/models/index.js +1 -0
- package/dist/runtime/types/models/table.d.ts +1 -0
- package/dist/runtime/types/storage.d.ts +3 -4
- package/dist/runtime/types/storage.js +3 -4
- package/package.json +3 -2
- package/dist/runtime/components/table/query/where/simple/index.d.vue.ts +0 -21
- package/dist/runtime/components/table/query/where/simple/index.vue +0 -52
- package/dist/runtime/components/table/query/where/simple/index.vue.d.ts +0 -21
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Position } from "@vue-flow/core";
|
|
2
|
+
export const GRID_SIZE = 20;
|
|
3
|
+
export const FLOW_MOUSE_POSITION_KEY = Symbol("flow-mouse-position");
|
|
2
4
|
export const FLOW_HANDLES = [
|
|
3
5
|
// 4个角 - 可以双向调整
|
|
4
6
|
{ id: "tl", position: Position.Top, offsetPercent: { x: 0 } },
|
|
@@ -22,3 +24,172 @@ export const FLOW_HANDLES = [
|
|
|
22
24
|
{ id: "l2", position: Position.Left, offsetPercent: { y: 50 } },
|
|
23
25
|
{ id: "l3", position: Position.Left, offsetPercent: { y: 75 } }
|
|
24
26
|
];
|
|
27
|
+
export const FLOW_HANDLE_TIER_THRESHOLDS = {
|
|
28
|
+
small: { maxWidth: 80, maxHeight: 40 },
|
|
29
|
+
medium: { maxWidth: 120, maxHeight: 80 }
|
|
30
|
+
};
|
|
31
|
+
export const FLOW_EDGE_STROKE_TYPES = [
|
|
32
|
+
{ type: "solid", label: "\u5B9E\u7EBF", dasharray: "" },
|
|
33
|
+
{ type: "dashed", label: "\u865A\u7EBF", dasharray: "8 4" },
|
|
34
|
+
{ type: "dotted", label: "\u70B9\u7EBF", dasharray: "2 4" },
|
|
35
|
+
{ type: "dashdot", label: "\u70B9\u5212\u7EBF", dasharray: "8 4 2 4" }
|
|
36
|
+
];
|
|
37
|
+
export const FLOW_EDGE_PATH_TYPES = [
|
|
38
|
+
{ type: "smoothstep", label: "\u5E73\u6ED1" },
|
|
39
|
+
{ type: "bezier", label: "\u66F2\u7EBF" },
|
|
40
|
+
{ type: "step", label: "\u76F4\u89D2" },
|
|
41
|
+
{ type: "straight", label: "\u76F4\u7EBF" }
|
|
42
|
+
];
|
|
43
|
+
const FLOW_COLOR_NAMES = [
|
|
44
|
+
"red",
|
|
45
|
+
"orange",
|
|
46
|
+
"amber",
|
|
47
|
+
"yellow",
|
|
48
|
+
"lime",
|
|
49
|
+
"green",
|
|
50
|
+
"emerald",
|
|
51
|
+
"teal",
|
|
52
|
+
"cyan",
|
|
53
|
+
"sky",
|
|
54
|
+
"blue",
|
|
55
|
+
"indigo",
|
|
56
|
+
"violet",
|
|
57
|
+
"purple",
|
|
58
|
+
"fuchsia",
|
|
59
|
+
"pink",
|
|
60
|
+
"rose"
|
|
61
|
+
];
|
|
62
|
+
export const FLOW_COLORS = [
|
|
63
|
+
{ color: "primary", chip: "primary" },
|
|
64
|
+
...FLOW_COLOR_NAMES.map((name) => ({ color: name, chip: name }))
|
|
65
|
+
];
|
|
66
|
+
export const FLOW_SHADE_MAP = {
|
|
67
|
+
bg: { light: 50, dark: 950 },
|
|
68
|
+
border: { light: 500, dark: 400 },
|
|
69
|
+
font: { light: 600, dark: 400 }
|
|
70
|
+
};
|
|
71
|
+
export function resolveFlowColor(name, role, isDark) {
|
|
72
|
+
if (!name) return "";
|
|
73
|
+
const shade = FLOW_SHADE_MAP[role][isDark ? "dark" : "light"];
|
|
74
|
+
if (name === "primary") {
|
|
75
|
+
return `var(--ui-color-${name}-${shade})`;
|
|
76
|
+
}
|
|
77
|
+
return `var(--color-${name}-${shade})`;
|
|
78
|
+
}
|
|
79
|
+
export const FLOW_ARROW_TYPES = [
|
|
80
|
+
{ type: "none", label: "\u65E0" },
|
|
81
|
+
{ type: "arrow", label: "\u4E09\u89D2\u5B9E\u5FC3" },
|
|
82
|
+
{ type: "diamond", label: "\u83F1\u5F62\u5B9E\u5FC3" },
|
|
83
|
+
{ type: "diamond-open", label: "\u83F1\u5F62\u7A7A\u5FC3" },
|
|
84
|
+
{ type: "circle", label: "\u5706\u5F62\u5B9E\u5FC3" },
|
|
85
|
+
{ type: "circle-open", label: "\u5706\u5F62\u7A7A\u5FC3" }
|
|
86
|
+
];
|
|
87
|
+
export const FLOW_WIDTH_ITEMS = [
|
|
88
|
+
{ label: "1", value: 1 },
|
|
89
|
+
{ label: "2", value: 2 },
|
|
90
|
+
{ label: "3", value: 3 },
|
|
91
|
+
{ label: "4", value: 4 },
|
|
92
|
+
{ label: "5", value: 5 }
|
|
93
|
+
];
|
|
94
|
+
export const FLOW_STROKE_TYPE_ITEMS = FLOW_EDGE_STROKE_TYPES.map((o) => ({
|
|
95
|
+
label: o.label,
|
|
96
|
+
value: o.type,
|
|
97
|
+
dasharray: o.dasharray
|
|
98
|
+
}));
|
|
99
|
+
export const FLOW_PATH_TYPE_ITEMS = FLOW_EDGE_PATH_TYPES.map((o) => ({
|
|
100
|
+
label: o.label,
|
|
101
|
+
value: o.type
|
|
102
|
+
}));
|
|
103
|
+
export const FLOW_ARROW_TYPE_ITEMS = FLOW_ARROW_TYPES.map((o) => ({
|
|
104
|
+
label: o.label,
|
|
105
|
+
value: o.type
|
|
106
|
+
}));
|
|
107
|
+
export const FLOW_BORDER_RADIUS_ITEMS = [
|
|
108
|
+
{ label: "0", value: 0 },
|
|
109
|
+
{ label: "2", value: 2 },
|
|
110
|
+
{ label: "4", value: 4 },
|
|
111
|
+
{ label: "6", value: 6 },
|
|
112
|
+
{ label: "8", value: 8 }
|
|
113
|
+
];
|
|
114
|
+
export const FLOW_FONT_SIZE_ITEMS = [
|
|
115
|
+
{ label: "xs", value: 12, twClass: "text-xs" },
|
|
116
|
+
{ label: "sm", value: 14, twClass: "text-sm" },
|
|
117
|
+
{ label: "base", value: 16, twClass: "text-base" },
|
|
118
|
+
{ label: "lg", value: 18, twClass: "text-lg" },
|
|
119
|
+
{ label: "xl", value: 20, twClass: "text-xl" }
|
|
120
|
+
];
|
|
121
|
+
export const FLOW_HANDLE_SIZE_ITEMS = [
|
|
122
|
+
{ label: "4", value: 4 },
|
|
123
|
+
{ label: "6", value: 6 },
|
|
124
|
+
{ label: "8", value: 8 },
|
|
125
|
+
{ label: "10", value: 10 }
|
|
126
|
+
];
|
|
127
|
+
export const FLOW_PATH_PREVIEW = {
|
|
128
|
+
smoothstep: { shape: "path", d: "M 0 12 L 6 12 Q 10 12 10 7 Q 10 2 14 2 L 20 2" },
|
|
129
|
+
bezier: { shape: "path", d: "M 0 12 C 10 12, 10 2, 20 2" },
|
|
130
|
+
step: { shape: "path", d: "M 0 12 L 10 12 L 10 2 L 20 2" },
|
|
131
|
+
straight: { shape: "line", x1: 0, y1: 12, x2: 20, y2: 2 }
|
|
132
|
+
};
|
|
133
|
+
export const FLOW_ARROW_PREVIEW_START = {
|
|
134
|
+
"none": [
|
|
135
|
+
{ tag: "line", attrs: { "x1": 0, "y1": 5, "x2": 20, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } }
|
|
136
|
+
],
|
|
137
|
+
"arrow": [
|
|
138
|
+
{ tag: "polygon", attrs: { points: "10,1 2,5 10,9", fill: "currentColor" } },
|
|
139
|
+
{ tag: "line", attrs: { "x1": 8, "y1": 5, "x2": 20, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } }
|
|
140
|
+
],
|
|
141
|
+
"diamond": [
|
|
142
|
+
{ tag: "polygon", attrs: { points: "2,5 7,1 12,5 7,9", fill: "currentColor" } },
|
|
143
|
+
{ tag: "line", attrs: { "x1": 12, "y1": 5, "x2": 20, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } }
|
|
144
|
+
],
|
|
145
|
+
"diamond-open": [
|
|
146
|
+
{ tag: "polygon", attrs: { "points": "2,5 7,1 12,5 7,9", "fill": "none", "stroke": "currentColor", "stroke-width": 1.5 } },
|
|
147
|
+
{ tag: "line", attrs: { "x1": 12, "y1": 5, "x2": 20, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } }
|
|
148
|
+
],
|
|
149
|
+
"circle": [
|
|
150
|
+
{ tag: "circle", attrs: { cx: 6, cy: 5, r: 4, fill: "currentColor" } },
|
|
151
|
+
{ tag: "line", attrs: { "x1": 10, "y1": 5, "x2": 20, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } }
|
|
152
|
+
],
|
|
153
|
+
"circle-open": [
|
|
154
|
+
{ tag: "circle", attrs: { "cx": 6, "cy": 5, "r": 3.5, "fill": "none", "stroke": "currentColor", "stroke-width": 1.5 } },
|
|
155
|
+
{ tag: "line", attrs: { "x1": 10, "y1": 5, "x2": 20, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } }
|
|
156
|
+
]
|
|
157
|
+
};
|
|
158
|
+
export const FLOW_ARROW_PREVIEW_END = {
|
|
159
|
+
"none": [
|
|
160
|
+
{ tag: "line", attrs: { "x1": 0, "y1": 5, "x2": 20, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } }
|
|
161
|
+
],
|
|
162
|
+
"arrow": [
|
|
163
|
+
{ tag: "line", attrs: { "x1": 0, "y1": 5, "x2": 12, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } },
|
|
164
|
+
{ tag: "polygon", attrs: { points: "10,1 18,5 10,9", fill: "currentColor" } }
|
|
165
|
+
],
|
|
166
|
+
"diamond": [
|
|
167
|
+
{ tag: "line", attrs: { "x1": 0, "y1": 5, "x2": 8, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } },
|
|
168
|
+
{ tag: "polygon", attrs: { points: "8,5 13,1 18,5 13,9", fill: "currentColor" } }
|
|
169
|
+
],
|
|
170
|
+
"diamond-open": [
|
|
171
|
+
{ tag: "line", attrs: { "x1": 0, "y1": 5, "x2": 8, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } },
|
|
172
|
+
{ tag: "polygon", attrs: { "points": "8,5 13,1 18,5 13,9", "fill": "none", "stroke": "currentColor", "stroke-width": 1.5 } }
|
|
173
|
+
],
|
|
174
|
+
"circle": [
|
|
175
|
+
{ tag: "line", attrs: { "x1": 0, "y1": 5, "x2": 10, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } },
|
|
176
|
+
{ tag: "circle", attrs: { cx: 14, cy: 5, r: 4, fill: "currentColor" } }
|
|
177
|
+
],
|
|
178
|
+
"circle-open": [
|
|
179
|
+
{ tag: "line", attrs: { "x1": 0, "y1": 5, "x2": 10, "y2": 5, "stroke": "currentColor", "stroke-width": 2 } },
|
|
180
|
+
{ tag: "circle", attrs: { "cx": 14, "cy": 5, "r": 3.5, "fill": "none", "stroke": "currentColor", "stroke-width": 1.5 } }
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
export const FLOW_NODE_PROXIMITY_THRESHOLD = 50;
|
|
184
|
+
export const FLOW_RESIZE_HANDLES = [
|
|
185
|
+
// 4 边 (z-index: 5)
|
|
186
|
+
{ edge: "top", class: "top-[-4px] left-[12px] right-[12px] h-[12px]", cursor: "ns-resize", zIndex: 5 },
|
|
187
|
+
{ edge: "bottom", class: "bottom-[-4px] left-[12px] right-[12px] h-[12px]", cursor: "ns-resize", zIndex: 5 },
|
|
188
|
+
{ edge: "left", class: "left-[-4px] top-[12px] bottom-[12px] w-[12px]", cursor: "ew-resize", zIndex: 5 },
|
|
189
|
+
{ edge: "right", class: "right-[-4px] top-[12px] bottom-[12px] w-[12px]", cursor: "ew-resize", zIndex: 5 },
|
|
190
|
+
// 4 角 (z-index: 6, 优先于边)
|
|
191
|
+
{ edge: "top-left", class: "top-[-4px] left-[-4px] w-[12px] h-[12px]", cursor: "nwse-resize", zIndex: 6 },
|
|
192
|
+
{ edge: "top-right", class: "top-[-4px] right-[-4px] w-[12px] h-[12px]", cursor: "nesw-resize", zIndex: 6 },
|
|
193
|
+
{ edge: "bottom-left", class: "bottom-[-4px] left-[-4px] w-[12px] h-[12px]", cursor: "nesw-resize", zIndex: 6 },
|
|
194
|
+
{ edge: "bottom-right", class: "bottom-[-4px] right-[-4px] w-[12px] h-[12px]", cursor: "nwse-resize", zIndex: 6 }
|
|
195
|
+
];
|
|
@@ -9,7 +9,6 @@ export var Gender = /* @__PURE__ */ ((Gender2) => {
|
|
|
9
9
|
return Gender2;
|
|
10
10
|
})(Gender || {});
|
|
11
11
|
export const genderOptions = [
|
|
12
|
-
{ label: "
|
|
13
|
-
{ label: "
|
|
14
|
-
{ label: "Unknown", value: 0 /* UNKNOWN */ }
|
|
12
|
+
{ label: "\u7537", value: 1 /* MALE */ },
|
|
13
|
+
{ label: "\u5973", value: 2 /* FEMALE */ }
|
|
15
14
|
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const tableWhereQueryItemIconMap = /* @__PURE__ */ new Map([
|
|
2
|
+
["async-select", "i-lucide-list-check"],
|
|
3
|
+
["date-picker", "i-lucide-calendar-cog"],
|
|
4
|
+
["input", "i-lucide-text-cursor-input"],
|
|
5
|
+
["input-number", "i-lucide-text-cursor-input"],
|
|
6
|
+
["select", "i-lucide-list-check"],
|
|
7
|
+
["unknown", "i-lucide-circle-question-mark"]
|
|
8
|
+
]);
|
package/dist/runtime/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@source "./components";@source "./composables";@source "./utils";#__nuxt,body,html{height:100%}
|
|
1
|
+
@source "./components";@source "./composables";@source "./constants";@source "./utils";#__nuxt,body,html{height:100%}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OrderQueryOpr, WhereQueryOpr, QueryTemplate, WhereQueryItem } from '../../query.js';
|
|
2
2
|
import type { PageResult, RequestResult } from '../../request.js';
|
|
3
|
-
import type { TableColumn, BadgeProps,
|
|
3
|
+
import type { TableColumn, BadgeProps, InputMenuProps } from '@nuxt/ui';
|
|
4
4
|
import type { SelectOption } from '../../index.js';
|
|
5
5
|
import type { Ref } from 'vue';
|
|
6
6
|
export type WhereQueryType = 'input' | 'input-number' | 'date-picker' | 'select' | 'async-select' | 'unknown';
|
|
@@ -23,8 +23,8 @@ export type WhereQueryColumnAsyncSelectProps<T> = {
|
|
|
23
23
|
enableEmptyOption?: boolean;
|
|
24
24
|
disableOprSelector?: boolean;
|
|
25
25
|
multiple?: boolean;
|
|
26
|
-
placeholder?:
|
|
27
|
-
size?:
|
|
26
|
+
placeholder?: InputMenuProps['placeholder'];
|
|
27
|
+
size?: InputMenuProps['size'];
|
|
28
28
|
};
|
|
29
29
|
export type WhereQueryColumnOption<T> = {
|
|
30
30
|
defaultOpr?: WhereQueryOpr;
|
|
@@ -43,6 +43,7 @@ export type WhereQueryColumnOption<T> = {
|
|
|
43
43
|
variant?: BadgeProps['variant'];
|
|
44
44
|
items: SelectOption[];
|
|
45
45
|
empty?: BadgeProps;
|
|
46
|
+
placeholder?: InputMenuProps['placeholder'];
|
|
46
47
|
} | {
|
|
47
48
|
type: 'async-select';
|
|
48
49
|
} & WhereQueryColumnAsyncSelectProps<T> | {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VColumn, WhereQuery, WhereQueryColumnOption,
|
|
1
|
+
import type { VColumn, WhereQuery, WhereQueryColumnOption, WhereQueryItemGroup } from '../../../index.js';
|
|
2
2
|
export type WhereQueryOption<T> = {
|
|
3
3
|
field: string & keyof T | string;
|
|
4
4
|
label: string;
|
|
@@ -16,10 +16,6 @@ export type WhereQueryProps<T> = {
|
|
|
16
16
|
bizColumns?: VColumn<T>[];
|
|
17
17
|
hideQueryButton?: boolean;
|
|
18
18
|
};
|
|
19
|
-
export type WhereSimpleQueryProps<T> = {
|
|
20
|
-
items?: WhereQueryItem<T>[];
|
|
21
|
-
onUpdateItems: (items: WhereQueryItem<T>[] | undefined) => void;
|
|
22
|
-
} & Pick<WhereQueryProps<T>, 'whereOptions' | 'fetching' | 'triggerFetching' | 'bizColumns'>;
|
|
23
19
|
export type WhereAdvancedQueryProps<T> = {
|
|
24
20
|
group?: WhereQueryItemGroup<T>;
|
|
25
21
|
onUpdateGroup?: (items: WhereQueryItemGroup<T>) => void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ApiGroup } from '../components/index.js';
|
|
2
|
+
import type { BaseModel } from './base.js';
|
|
3
|
+
export type Flow = {
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
nodes?: FlowNode[];
|
|
7
|
+
edges?: FlowEdge[];
|
|
8
|
+
} & BaseModel;
|
|
9
|
+
export type FlowNode = {
|
|
10
|
+
flowId?: number;
|
|
11
|
+
name?: string;
|
|
12
|
+
positionX?: number;
|
|
13
|
+
positionY?: number;
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
parentEdges?: FlowEdge[];
|
|
17
|
+
childEdges?: FlowEdge[];
|
|
18
|
+
} & BaseModel;
|
|
19
|
+
export type FlowEdge = {
|
|
20
|
+
flowId?: number;
|
|
21
|
+
parentId?: number;
|
|
22
|
+
parentHandlePos?: string;
|
|
23
|
+
childId?: number;
|
|
24
|
+
childHandlePos?: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
condition?: string;
|
|
27
|
+
order?: number;
|
|
28
|
+
} & BaseModel;
|
|
29
|
+
/**
|
|
30
|
+
* 鼠标位置类型
|
|
31
|
+
*/
|
|
32
|
+
export interface FlowMousePosition {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resize 尺寸类型
|
|
38
|
+
*/
|
|
39
|
+
export interface UseFlowResizeDimensions {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Flow CRUD API 接口
|
|
45
|
+
* 由使用者传入,在节点/边的增删改操作时调用
|
|
46
|
+
* 所有方法都是可选的,未提供时执行纯本地操作
|
|
47
|
+
*/
|
|
48
|
+
export interface FlowApi {
|
|
49
|
+
/** 创建节点,返回创建后的节点(含服务端生成的 id 等字段) */
|
|
50
|
+
createNode?: ApiGroup<FlowNode>['create'];
|
|
51
|
+
/** 更新节点(位置、尺寸、名称等) */
|
|
52
|
+
updateNode?: ApiGroup<FlowNode>['update'];
|
|
53
|
+
/** 删除节点 */
|
|
54
|
+
deleteNode?: ApiGroup<FlowNode>['deleteById'];
|
|
55
|
+
/** 创建边/连接,返回创建后的边 */
|
|
56
|
+
createEdge?: ApiGroup<FlowEdge>['create'];
|
|
57
|
+
/** 更新边(label 等) */
|
|
58
|
+
updateEdge?: ApiGroup<FlowEdge>['update'];
|
|
59
|
+
/** 删除边 */
|
|
60
|
+
deleteEdge?: ApiGroup<FlowEdge>['deleteById'];
|
|
61
|
+
}
|
|
File without changes
|
|
@@ -3,10 +3,9 @@ export declare enum StorageKey {
|
|
|
3
3
|
ACCESS_TOKEN = "ac_t",
|
|
4
4
|
REFRESH_TOKEN = "rf_t",
|
|
5
5
|
LOGIN_TYPE = "login_type",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
FLOW_NODE_BORDER_WIDTH = "flow_node_border_width",
|
|
6
|
+
FLOW_EDGE_STYLES = "flow_edge_styles",
|
|
7
|
+
FLOW_NODE_STYLES = "flow_node_styles",
|
|
8
|
+
FLOW_COLOR_MODE = "flow_color_mode",
|
|
10
9
|
ECHART_ROTATE_X_AXIS_LABEL = "echart_rotate_x_axis_label"
|
|
11
10
|
}
|
|
12
11
|
export type Column = {
|
|
@@ -3,10 +3,9 @@ export var StorageKey = /* @__PURE__ */ ((StorageKey2) => {
|
|
|
3
3
|
StorageKey2["ACCESS_TOKEN"] = "ac_t";
|
|
4
4
|
StorageKey2["REFRESH_TOKEN"] = "rf_t";
|
|
5
5
|
StorageKey2["LOGIN_TYPE"] = "login_type";
|
|
6
|
-
StorageKey2["
|
|
7
|
-
StorageKey2["
|
|
8
|
-
StorageKey2["
|
|
9
|
-
StorageKey2["FLOW_NODE_BORDER_WIDTH"] = "flow_node_border_width";
|
|
6
|
+
StorageKey2["FLOW_EDGE_STYLES"] = "flow_edge_styles";
|
|
7
|
+
StorageKey2["FLOW_NODE_STYLES"] = "flow_node_styles";
|
|
8
|
+
StorageKey2["FLOW_COLOR_MODE"] = "flow_color_mode";
|
|
10
9
|
StorageKey2["ECHART_ROTATE_X_AXIS_LABEL"] = "echart_rotate_x_axis_label";
|
|
11
10
|
return StorageKey2;
|
|
12
11
|
})(StorageKey || {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v-nuxt-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Veken UI Component Library - Reusable Nuxt UI components, composables, and utilities for enterprise applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"style": "./dist/runtime/index.css",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@vue-flow/core": "^1.42.2",
|
|
58
57
|
"cronstrue": "^3.12.0",
|
|
59
58
|
"echarts": "^6.0.0",
|
|
60
59
|
"exceljs": "^4.4.0",
|
|
@@ -65,6 +64,8 @@
|
|
|
65
64
|
"vue-echarts": "^8.0.1"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
67
|
+
"@vue-flow/core": "^1.42.2",
|
|
68
|
+
"@vue-flow/background": "^1.3.2",
|
|
68
69
|
"@iconify-json/lucide": "^1.2.94",
|
|
69
70
|
"@internationalized/date": "^3.12.0",
|
|
70
71
|
"@nuxt/content": "^3.12.0",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { WhereSimpleQueryProps } from '#v/types';
|
|
2
|
-
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<WhereSimpleQueryProps<T>> & (typeof globalThis extends {
|
|
4
|
-
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
-
} ? P : {});
|
|
6
|
-
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
7
|
-
focusItem: (field: string) => boolean;
|
|
8
|
-
}>) => void;
|
|
9
|
-
attrs: any;
|
|
10
|
-
slots: {};
|
|
11
|
-
emit: {};
|
|
12
|
-
}>) => import("vue").VNode & {
|
|
13
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
14
|
-
};
|
|
15
|
-
declare const _default: typeof __VLS_export;
|
|
16
|
-
export default _default;
|
|
17
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
-
[K in keyof T]: T[K];
|
|
19
|
-
} : {
|
|
20
|
-
[K in keyof T as K]: T[K];
|
|
21
|
-
}) & {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref } from "vue";
|
|
3
|
-
import TableQueryWhereSimpleItem from "#v/components/table/query/where/simple/item/index.vue";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
items: { type: Array, required: false },
|
|
6
|
-
onUpdateItems: { type: Function, required: true },
|
|
7
|
-
whereOptions: { type: Array, required: true },
|
|
8
|
-
fetching: { type: Boolean, required: false },
|
|
9
|
-
triggerFetching: { type: Function, required: true },
|
|
10
|
-
bizColumns: { type: Array, required: false }
|
|
11
|
-
});
|
|
12
|
-
const onRemoveFilter = (field) => {
|
|
13
|
-
props.onUpdateItems(props.items?.filter((query) => query.field !== field) ?? []);
|
|
14
|
-
};
|
|
15
|
-
const itemRefMap = ref(/* @__PURE__ */ new Map());
|
|
16
|
-
function setItemRef(field, el) {
|
|
17
|
-
if (el && "focus" in el && typeof el.focus === "function") {
|
|
18
|
-
itemRefMap.value.set(field, el);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
defineExpose({
|
|
22
|
-
focusItem: (field) => {
|
|
23
|
-
const item = itemRefMap.value.get(field);
|
|
24
|
-
if (item) {
|
|
25
|
-
item.focus();
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<template>
|
|
34
|
-
<div class="flex flex-wrap gap-2.5">
|
|
35
|
-
<!-- key如果是field,那么field修改后,不能聚焦后面的组件,所以这里的key用idx代替 -->
|
|
36
|
-
<TableQueryWhereSimpleItem
|
|
37
|
-
v-for="(item, idx) in items"
|
|
38
|
-
:ref="(el) => setItemRef(item.field, el)"
|
|
39
|
-
:key="idx"
|
|
40
|
-
:where-query-item="item"
|
|
41
|
-
:options="whereOptions"
|
|
42
|
-
:fetching="fetching"
|
|
43
|
-
:trigger-fetching="() => triggerFetching(true)"
|
|
44
|
-
@remove="onRemoveFilter"
|
|
45
|
-
@update:where-query-item="(newWhereQueryItem) => {
|
|
46
|
-
const updatedItems = [...props.items ?? []];
|
|
47
|
-
updatedItems[idx] = newWhereQueryItem;
|
|
48
|
-
props.onUpdateItems(updatedItems);
|
|
49
|
-
}"
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { WhereSimpleQueryProps } from '#v/types';
|
|
2
|
-
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<WhereSimpleQueryProps<T>> & (typeof globalThis extends {
|
|
4
|
-
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
-
} ? P : {});
|
|
6
|
-
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
7
|
-
focusItem: (field: string) => boolean;
|
|
8
|
-
}>) => void;
|
|
9
|
-
attrs: any;
|
|
10
|
-
slots: {};
|
|
11
|
-
emit: {};
|
|
12
|
-
}>) => import("vue").VNode & {
|
|
13
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
14
|
-
};
|
|
15
|
-
declare const _default: typeof __VLS_export;
|
|
16
|
-
export default _default;
|
|
17
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
-
[K in keyof T]: T[K];
|
|
19
|
-
} : {
|
|
20
|
-
[K in keyof T as K]: T[K];
|
|
21
|
-
}) & {};
|