v-nuxt-ui 0.2.16 → 0.2.18
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/sys/user/Table.vue +5 -0
- package/dist/runtime/components/table/query/where/index.vue +14 -3
- package/dist/runtime/components/table/query/where/simple/item/index.vue +4 -3
- package/dist/runtime/components/table/query/where/simple/item/opr/index.vue +4 -3
- package/dist/runtime/composables/table/useTableQuery.js +2 -1
- 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
|
+
};
|
|
@@ -191,6 +191,11 @@ const columns = [
|
|
|
191
191
|
:extra-order-query-options="[
|
|
192
192
|
{ field: 'createdAt', label: '\u521B\u5EFA\u65F6\u95F4', defaultOpr: 'desc' }
|
|
193
193
|
]"
|
|
194
|
+
:extra-where-query-init-values="{
|
|
195
|
+
items: [
|
|
196
|
+
{ field: 'isAdmin', opr: 'eq', value: false }
|
|
197
|
+
]
|
|
198
|
+
}"
|
|
194
199
|
@edit-row-from-modal="async (row) => await createModal.open({ model: row }).result"
|
|
195
200
|
/>
|
|
196
201
|
</template>
|
|
@@ -66,6 +66,14 @@ const isWhereQueryEmpty = computed(() => {
|
|
|
66
66
|
return !props.whereQuery || Object.keys(props.whereQuery ?? {}).length === 0 || // 仅检查有对应option的item的值是否为空
|
|
67
67
|
(props.whereQuery?.items?.filter((query) => props.whereOptions.find((option) => option.field === query.field)).length ?? 0) === 0 && (props.whereQuery?.groups?.length ?? 0) === 0;
|
|
68
68
|
});
|
|
69
|
+
const whereQueryWithoutDefault = computed(() => {
|
|
70
|
+
if (!props.whereQuery) return [];
|
|
71
|
+
const defaultKeys = props.defaultWhereQuery?.items?.map((query) => query.field) ?? [];
|
|
72
|
+
return props.whereQuery.items?.filter((query) => {
|
|
73
|
+
const field = query.field;
|
|
74
|
+
return !defaultKeys.includes(field);
|
|
75
|
+
}) ?? [];
|
|
76
|
+
});
|
|
69
77
|
const focusField = (field) => {
|
|
70
78
|
const item = itemRefMap.value.get(field);
|
|
71
79
|
if (item) {
|
|
@@ -84,7 +92,7 @@ defineExpose({ focusField });
|
|
|
84
92
|
<!-- key如果是field,那么field修改后,不能聚焦后面的组件,所以这里的key用idx代替 -->
|
|
85
93
|
<template v-if="!isWhereQueryEmpty">
|
|
86
94
|
<TableQueryWhereSimpleItem
|
|
87
|
-
v-for="(item, idx) in
|
|
95
|
+
v-for="(item, idx) in whereQueryWithoutDefault"
|
|
88
96
|
:ref="(el) => setItemRef(item.field, el)"
|
|
89
97
|
:key="idx"
|
|
90
98
|
:where-query-item="item"
|
|
@@ -93,8 +101,11 @@ defineExpose({ focusField });
|
|
|
93
101
|
:trigger-fetching="() => triggerFetching(true)"
|
|
94
102
|
@remove="onRemoveFilter"
|
|
95
103
|
@update:where-query-item="(newWhereQueryItem) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
104
|
+
const items = props.whereQuery?.items ?? [];
|
|
105
|
+
const realIdx = items.findIndex((q) => q.field === item.field);
|
|
106
|
+
if (realIdx === -1) return;
|
|
107
|
+
const updatedItems = [...items];
|
|
108
|
+
updatedItems[realIdx] = newWhereQueryItem;
|
|
98
109
|
onUpdateWhereQuery({
|
|
99
110
|
...whereQuery,
|
|
100
111
|
items: updatedItems
|
|
@@ -12,9 +12,10 @@ const props = defineProps({
|
|
|
12
12
|
const whereQueryItem = defineModel("whereQueryItem", { type: Object, ...{ required: true } });
|
|
13
13
|
const option = computed(() => props.options.find((option2) => option2.field === whereQueryItem.value.field));
|
|
14
14
|
watch(
|
|
15
|
-
() =>
|
|
16
|
-
() => {
|
|
17
|
-
|
|
15
|
+
() => option.value?.custom,
|
|
16
|
+
(newCustom) => {
|
|
17
|
+
if (whereQueryItem.value.custom === newCustom) return;
|
|
18
|
+
whereQueryItem.value = { ...whereQueryItem.value, custom: newCustom };
|
|
18
19
|
},
|
|
19
20
|
{ immediate: true }
|
|
20
21
|
);
|
|
@@ -13,9 +13,10 @@ const props = defineProps({
|
|
|
13
13
|
const whereQueryItem = defineModel("whereQueryItem", { type: Object, ...{ required: true } });
|
|
14
14
|
const option = computed(() => props.options.find((option2) => option2.field === whereQueryItem.value.field) ?? { type: "unknown", field: "unknown", label: "\u672A\u77E5\u5B57\u6BB5" });
|
|
15
15
|
watch(
|
|
16
|
-
() =>
|
|
17
|
-
() => {
|
|
18
|
-
|
|
16
|
+
() => option.value?.custom,
|
|
17
|
+
(newCustom) => {
|
|
18
|
+
if (whereQueryItem.value.custom === newCustom) return;
|
|
19
|
+
whereQueryItem.value = { ...whereQueryItem.value, custom: newCustom };
|
|
19
20
|
},
|
|
20
21
|
{ immediate: true }
|
|
21
22
|
);
|
|
@@ -72,7 +72,8 @@ export function useTableQuery(props) {
|
|
|
72
72
|
if (itemsWithOprNoValues.length > 0) {
|
|
73
73
|
return false;
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
const defaultKeys = whereQueryInitValues.value.items?.map((query) => query.field) ?? [];
|
|
76
|
+
return !items.filter((item) => !defaultKeys.includes(item.field)).filter((item) => !noValueOprList.includes(item.opr)).some((item) => item.value !== null && item.value !== void 0 && item.value !== "");
|
|
76
77
|
};
|
|
77
78
|
const checkIfWhereQueryGroupsValueEmpty = (groups) => {
|
|
78
79
|
for (const group of groups) {
|
package/package.json
CHANGED