savor-ui 0.4.0 → 0.5.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/CHANGELOG.md +25 -0
- package/dist/es/components/index.d.ts +1 -0
- package/dist/es/components/index.mjs +1 -0
- package/dist/es/components/src/expand-card/expand-card.d.ts +23 -0
- package/dist/es/components/src/expand-card/expand-card.vue.mjs +5 -0
- package/dist/es/components/src/expand-card/expand-card.vue_vue_type_script_setup_true_vapor_true_lang.mjs +121 -0
- package/dist/es/components/src/expand-card/index.d.ts +27 -0
- package/dist/es/components/src/expand-card/index.mjs +7 -0
- package/dist/es/components/src/expand-card/types.d.ts +34 -0
- package/dist/es/components/src/icon/icon.vue_vue_type_script_setup_true_vapor_true_lang.mjs +24 -12
- package/dist/es/components/src/icon/index.d.ts +3 -0
- package/dist/es/components/src/icon/types.d.ts +8 -0
- package/dist/es/components/src/menu/index.d.ts +1 -1
- package/dist/es/components/src/menu/menu-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +5 -3
- package/dist/es/components/src/menu/types.d.ts +1 -1
- package/dist/es/components/src/table/table.vue_vue_type_script_setup_true_vapor_true_lang.mjs +63 -61
- package/dist/es/components/src/transition/transition-height.vue_vue_type_script_setup_true_vapor_true_lang.mjs +1 -1
- package/dist/es/components/src/transition/transition-opacity.d.ts +3 -0
- package/dist/es/components/src/transition/transition-opacity.vue_vue_type_script_setup_true_vapor_true_lang.mjs +8 -1
- package/dist/es/components/src/transition/transition-scale.d.ts +3 -0
- package/dist/es/components/src/transition/transition-scale.vue_vue_type_script_setup_true_vapor_true_lang.mjs +8 -1
- package/dist/es/components/src/transition/transition-side.d.ts +2 -0
- package/dist/es/components/src/transition/transition-side.vue_vue_type_script_setup_true_vapor_true_lang.mjs +21 -5
- package/dist/es/components/src/transition/transition-width.vue_vue_type_script_setup_true_vapor_true_lang.mjs +1 -1
- package/dist/es/components/src/transition/transition.vue_vue_type_script_setup_true_vapor_true_lang.mjs +28 -7
- package/dist/es/components/src/tree/tree.vue_vue_type_script_setup_true_vapor_true_lang.mjs +57 -53
- package/dist/es/core/components.mjs +46 -44
- package/dist/es/core/index.mjs +45 -44
- package/dist/es/icons/src/loading.vue.mjs +1 -1
- package/dist/es/theme/common/reset.scss +10 -0
- package/dist/es/theme/components/expand-card.scss +26 -0
- package/dist/es/theme/components/icon.scss +125 -0
- package/dist/es/theme/components/index.scss +1 -0
- package/dist/es/theme/components/input-number.scss +2 -2
- package/dist/es/theme/components/input-tag.scss +2 -2
- package/dist/es/theme/components/input.scss +7 -6
- package/dist/es/theme/components/loading-icon.scss +6 -6
- package/dist/es/theme/components/menu.scss +6 -1
- package/dist/es/theme/components/table.scss +15 -3
- package/dist/es/theme/components/textarea.scss +4 -1
- package/dist/es/utils/index.d.ts +2 -2
- package/dist/es/utils/index.mjs +2 -2
- package/dist/es/utils/src/nodes.d.ts +1 -0
- package/dist/es/utils/src/nodes.mjs +23 -0
- package/dist/es/utils/src/theme/themeMap.mjs +5 -5
- package/dist/json/vetur-attributes.json +33 -0
- package/dist/json/vetur-tags.json +14 -1
- package/dist/json/web-types.json +90 -2
- package/package.json +1 -1
- package/dist/es/utils/src/vnodes.d.ts +0 -7
- package/dist/es/utils/src/vnodes.mjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
# [0.5.0](https://gitee.com/mach552/savor-ui/compare/v0.4.1...v0.5.0) (2026-06-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **tree:** 修复容器高度计算错误问题 ([a769600](https://gitee.com/mach552/savor-ui/commits/a769600d9771ccfe5e75ff1cd6ea15559ab733bd))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **expand-card:** 新增展开卡片组件 ([2bf0bda](https://gitee.com/mach552/savor-ui/commits/2bf0bdaa7d21f550089c83c62c549acbc2762d90))
|
|
16
|
+
* **icon:** 新增动画和加载效果 ([6cab674](https://gitee.com/mach552/savor-ui/commits/6cab674844a32cf45d01b6a19a6f463d4bcd89ca))
|
|
17
|
+
* **menu:** 新增`circle`激活样式 ([30ca3ed](https://gitee.com/mach552/savor-ui/commits/30ca3ede06a2d3b93094179643a90d7215c9eef5))
|
|
18
|
+
|
|
19
|
+
## [0.4.1](https://gitee.com/mach552/savor-ui/compare/v0.4.0...v0.4.1) (2026-06-17)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **input:** 调整一些样式问题 ([be7305f](https://gitee.com/mach552/savor-ui/commits/be7305ffc837a94f32bd8e971a0cf89e68d63cea))
|
|
25
|
+
* **table:** 修复空状态下整体滚动问题 ([df4c6c8](https://gitee.com/mach552/savor-ui/commits/df4c6c8cc409ee6d9d7159dd523f0ea385ff2f06))
|
|
26
|
+
* **table:** 修复宽高属性无效问题 ([834917b](https://gitee.com/mach552/savor-ui/commits/834917bb908eaf70b1293afdae0cb4779520e4c6))
|
|
27
|
+
* **table:** 修复fixed列没有选中样式问题 ([7cd3def](https://gitee.com/mach552/savor-ui/commits/7cd3defe6eeb77426e8d59e8796b25e73ecc40f1))
|
|
28
|
+
* **transition:** 修复传递无效属性问题 ([b06508c](https://gitee.com/mach552/savor-ui/commits/b06508c06085d183d1e515cf4365a4406e6045bf))
|
|
29
|
+
|
|
5
30
|
# [0.4.0](https://gitee.com/mach552/savor-ui/compare/v0.3.3...v0.4.0) (2026-06-17)
|
|
6
31
|
|
|
7
32
|
|
|
@@ -21,6 +21,7 @@ export * from './src/divider';
|
|
|
21
21
|
export * from './src/drawer';
|
|
22
22
|
export * from './src/dropdown';
|
|
23
23
|
export * from './src/empty';
|
|
24
|
+
export * from './src/expand-card';
|
|
24
25
|
export * from './src/form';
|
|
25
26
|
export * from './src/galleria';
|
|
26
27
|
export * from './src/grid';
|
|
@@ -38,6 +38,7 @@ import "./src/divider/index.mjs";
|
|
|
38
38
|
import "./src/drawer/index.mjs";
|
|
39
39
|
import "./src/dropdown/types.mjs";
|
|
40
40
|
import "./src/dropdown/index.mjs";
|
|
41
|
+
import "./src/expand-card/index.mjs";
|
|
41
42
|
import "./src/galleria/index.mjs";
|
|
42
43
|
import "./src/grid/types.mjs";
|
|
43
44
|
import "./src/grid/index.mjs";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ExpandCardExpose, ExpandCardProps, ExpandCardSlots } from './types';
|
|
2
|
+
import { PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
3
|
+
declare const __VLS_export: (__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<{
|
|
4
|
+
props: PublicProps & __VLS_PrettifyLocal<ExpandCardProps & {
|
|
5
|
+
onOpened?: (() => any) | undefined;
|
|
6
|
+
onClosed?: (() => any) | undefined;
|
|
7
|
+
}> & (typeof globalThis extends {
|
|
8
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
9
|
+
} ? P : {});
|
|
10
|
+
expose: (exposed: ShallowUnwrapRef<ExpandCardExpose>) => void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: ExpandCardSlots;
|
|
13
|
+
emit: ((evt: "opened") => void) & ((evt: "closed") => void);
|
|
14
|
+
}>) => VNode & {
|
|
15
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
20
|
+
[K in keyof T]: T[K];
|
|
21
|
+
} : {
|
|
22
|
+
[K in keyof T as K]: T[K];
|
|
23
|
+
}) & {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { getElementFromBlock as e } from "../../../utils/src/nodes.mjs";
|
|
2
|
+
import "../../../utils/index.mjs";
|
|
3
|
+
import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
4
|
+
import { useZIndex as n } from "../../../hooks/src/use-zIndex.mjs";
|
|
5
|
+
import "../../../hooks/index.mjs";
|
|
6
|
+
import { VaporTeleport as r, child as i, computed as a, createComponent as o, createDynamicComponent as s, createIf as c, createInvoker as l, createSlot as u, createTemplateRefSetter as d, defineVaporComponent as f, delegateEvents as p, nextTick as m, onBeforeUnmount as h, onMounted as g, ref as _, renderEffect as v, setClass as y, setInsertionState as b, setStyle as x, template as S, unref as C, useId as w, useSlots as T, useTemplateRef as ee } from "vue";
|
|
7
|
+
//#region ../components/src/expand-card/expand-card.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
8
|
+
var E = S("<div>"), D = S("<div><div>");
|
|
9
|
+
p("click");
|
|
10
|
+
var O = /*@__PURE__*/ f({
|
|
11
|
+
name: "SExpandCard",
|
|
12
|
+
__name: "expand-card",
|
|
13
|
+
props: {
|
|
14
|
+
item: {},
|
|
15
|
+
duration: { default: 500 },
|
|
16
|
+
showMask: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !0
|
|
19
|
+
},
|
|
20
|
+
targetHeight: { default: "auto" },
|
|
21
|
+
targetWidth: { default: "50%" },
|
|
22
|
+
placeholderClassName: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["opened", "closed"],
|
|
25
|
+
__multiRoot: !0,
|
|
26
|
+
setup(f, { expose: p, emit: S }) {
|
|
27
|
+
let O = f, k = S, A = t("expand-card"), j = T(), M = "expand-card-" + w(), { nextZIndex: N } = n(), P = _(0), F = _(!1), I = _(!1), L = _(""), R = _(!1), z = ee("modelRef"), B = A.is("expanded", !0), V = null, H = null, U = null, W = null, G = a(() => {
|
|
28
|
+
let e = O.duration;
|
|
29
|
+
return typeof e == "number" ? [e, e] : e;
|
|
30
|
+
}), K = (e, t) => {
|
|
31
|
+
if (typeof e == "number") return e;
|
|
32
|
+
let n = String(e).trim();
|
|
33
|
+
return n.endsWith("%") ? t * parseFloat(n) / 100 : parseFloat(n) || 0;
|
|
34
|
+
}, q = (e) => `width ${e}ms cubic-bezier(0.22,1,0.36,1), height ${e}ms cubic-bezier(0.22,1,0.36,1), top ${e}ms cubic-bezier(0.22,1,0.36,1), left ${e}ms cubic-bezier(0.22,1,0.36,1), border-radius ${e}ms ease, box-shadow ${e}ms ease`, J = () => {
|
|
35
|
+
H &&= (clearTimeout(H), null);
|
|
36
|
+
}, Y = (e) => {
|
|
37
|
+
e.style.transition = "", e.style.position = "", e.style.width = "", e.style.height = "", e.style.top = "", e.style.left = "", e.style.zIndex = "", e.style.borderRadius = "";
|
|
38
|
+
}, X = (e) => {
|
|
39
|
+
let t = K(O.targetWidth, window.innerWidth), n, r = O.targetHeight;
|
|
40
|
+
if (r === "auto" || r === "" || r == null) {
|
|
41
|
+
let r = e.style.width, i = e.style.height;
|
|
42
|
+
e.style.width = t + "px", e.style.height = "auto", n = e.scrollHeight, e.style.width = r, e.style.height = i, e.offsetHeight;
|
|
43
|
+
} else n = K(r, window.innerHeight);
|
|
44
|
+
return {
|
|
45
|
+
w: t,
|
|
46
|
+
h: n
|
|
47
|
+
};
|
|
48
|
+
}, Z = async () => {
|
|
49
|
+
if (R.value || F.value) return;
|
|
50
|
+
let e = V;
|
|
51
|
+
if (!e) return;
|
|
52
|
+
let t = e.getBoundingClientRect(), [n] = G.value;
|
|
53
|
+
R.value = !0, P.value = N(), e.classList.add(B), await m();
|
|
54
|
+
let r = z.value;
|
|
55
|
+
if (!r) {
|
|
56
|
+
R.value = !1, e.classList.remove(B);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
r.style.transition = "none", r.style.position = "fixed", r.style.width = t.width + "px", r.style.height = t.height + "px", r.style.top = t.top + "px", r.style.left = t.left + "px", r.style.zIndex = String(N()), r.style.borderRadius = "12px", r.offsetHeight, U = requestAnimationFrame(() => {
|
|
60
|
+
U = null;
|
|
61
|
+
let { w: e, h: t } = X(r), i = (window.innerWidth - e) / 2, a = (window.innerHeight - t) / 2;
|
|
62
|
+
r.offsetHeight, L.value = `opacity ${n}ms ease`, I.value = !0, r.style.transition = q(n), r.style.width = e + "px", r.style.height = t + "px", r.style.top = a + "px", r.style.left = i + "px", r.style.borderRadius = "16px";
|
|
63
|
+
}), J(), H = setTimeout(() => {
|
|
64
|
+
H = null, R.value = !1, F.value = !0, k("opened");
|
|
65
|
+
}, n);
|
|
66
|
+
}, Q = () => {
|
|
67
|
+
if (R.value || !F.value) return;
|
|
68
|
+
let e = V, t = z.value;
|
|
69
|
+
if (!e || !t) return;
|
|
70
|
+
R.value = !0;
|
|
71
|
+
let [, n] = G.value;
|
|
72
|
+
L.value = `opacity ${n}ms ease`, I.value = !1;
|
|
73
|
+
let r = e.getBoundingClientRect();
|
|
74
|
+
t.style.transition = q(n), t.style.width = r.width + "px", t.style.height = r.height + "px", t.style.top = r.top + "px", t.style.left = r.left + "px", t.style.borderRadius = "12px", J(), H = setTimeout(() => {
|
|
75
|
+
H = null, R.value = !1, F.value = !1, e.classList.remove(B), k("closed");
|
|
76
|
+
}, n);
|
|
77
|
+
}, $ = () => {
|
|
78
|
+
W && cancelAnimationFrame(W), W = requestAnimationFrame(() => {
|
|
79
|
+
if (W = null, !F.value || R.value) return;
|
|
80
|
+
let e = z.value;
|
|
81
|
+
if (!e) return;
|
|
82
|
+
let { w: t, h: n } = X(e);
|
|
83
|
+
e.style.transition = "none", e.style.width = t + "px", e.style.height = n + "px", e.style.top = (window.innerHeight - n) / 2 + "px", e.style.left = (window.innerWidth - t) / 2 + "px";
|
|
84
|
+
});
|
|
85
|
+
}, te = a(() => {
|
|
86
|
+
let t = j.default?.();
|
|
87
|
+
if (!t) return null;
|
|
88
|
+
let n = e(t);
|
|
89
|
+
return n ? (V !== n && (V?.removeEventListener("click", Z), n.addEventListener("click", Z), n.id = M, V = n), n) : null;
|
|
90
|
+
});
|
|
91
|
+
g(() => {
|
|
92
|
+
window.addEventListener("resize", $);
|
|
93
|
+
}), h(() => {
|
|
94
|
+
window.removeEventListener("resize", $), U && cancelAnimationFrame(U), W && cancelAnimationFrame(W), J(), V &&= (V.removeEventListener("click", Z), V.classList.remove(B), null);
|
|
95
|
+
let e = z.value;
|
|
96
|
+
e && Y(e);
|
|
97
|
+
}), p({
|
|
98
|
+
open: Z,
|
|
99
|
+
close: Q
|
|
100
|
+
});
|
|
101
|
+
let ne = d();
|
|
102
|
+
return [s(() => te.value), o(r, { to: "body" }, () => c(() => F.value || R.value, () => {
|
|
103
|
+
let e = D(), t = i(e, 1);
|
|
104
|
+
return v(() => y(e, [C(A).e("wrapper")])), b(e, 0, 0), c(() => f.showMask && (F.value || R.value), () => {
|
|
105
|
+
let e = E();
|
|
106
|
+
return e.$evtclick = l(Q), v(() => {
|
|
107
|
+
let t = I.value;
|
|
108
|
+
y(e, [C(A).e("mask")]), x(e, {
|
|
109
|
+
zIndex: P.value,
|
|
110
|
+
opacity: +!!t,
|
|
111
|
+
transition: L.value,
|
|
112
|
+
pointerEvents: t ? "auto" : "none",
|
|
113
|
+
backgroundColor: "rgba(0, 0, 0, 0)"
|
|
114
|
+
});
|
|
115
|
+
}), e;
|
|
116
|
+
}), v(() => y(t, [C(A).e("model")])), b(t, null, 0), u("model", { item: () => f.item }), ne(t, z, null, "modelRef"), e;
|
|
117
|
+
}, null, 129))];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
export { O as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ExpandCardSlots, ExpandCardExpose } from './types';
|
|
2
|
+
import { PublicProps, ShallowUnwrapRef, VNode, Plugin } from 'vue';
|
|
3
|
+
export declare const SExpandCard: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
4
|
+
attrs: any;
|
|
5
|
+
slots: ExpandCardSlots;
|
|
6
|
+
emit: ((evt: "opened") => void) & ((evt: "closed") => void);
|
|
7
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
+
props: PublicProps & {
|
|
9
|
+
item?: any;
|
|
10
|
+
duration?: number | [number, number] | undefined;
|
|
11
|
+
showMask?: boolean | undefined;
|
|
12
|
+
targetHeight?: number | string | undefined;
|
|
13
|
+
targetWidth?: number | string | undefined;
|
|
14
|
+
placeholderClassName?: string | undefined;
|
|
15
|
+
onOpened?: (() => any) | undefined;
|
|
16
|
+
onClosed?: (() => any) | undefined;
|
|
17
|
+
} & (typeof globalThis extends {
|
|
18
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
19
|
+
} ? P : {});
|
|
20
|
+
expose: (exposed: ShallowUnwrapRef<ExpandCardExpose>) => void;
|
|
21
|
+
attrs: any;
|
|
22
|
+
slots: ExpandCardSlots;
|
|
23
|
+
emit: ((evt: "opened") => void) & ((evt: "closed") => void);
|
|
24
|
+
}>) => VNode & {
|
|
25
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
26
|
+
}) & Plugin;
|
|
27
|
+
export * from './types';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface ExpandCardProps {
|
|
2
|
+
/** 卡片数据 */
|
|
3
|
+
item?: any;
|
|
4
|
+
/** 动画时长,单位毫秒,number表示展开和收起的时长相同,[number, number]表示展开和收起的时长 */
|
|
5
|
+
duration?: number | [number, number];
|
|
6
|
+
/** 是否显示遮罩 */
|
|
7
|
+
showMask?: boolean;
|
|
8
|
+
/** 展开高度,支持 number | string(如 460 / '460px' / '80%' / 'auto' / '') */
|
|
9
|
+
targetHeight?: number | string;
|
|
10
|
+
/** 展开宽度,支持 number | string(如 600 / '600px' / '80%') */
|
|
11
|
+
targetWidth?: number | string;
|
|
12
|
+
/** 占位元素类名 */
|
|
13
|
+
placeholderClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ExpandCardSlots {
|
|
16
|
+
/** 默认插槽,只支持传入一个元素 */
|
|
17
|
+
default?: () => any;
|
|
18
|
+
/** 展开的内容 */
|
|
19
|
+
model?: (props: {
|
|
20
|
+
item: any;
|
|
21
|
+
}) => any;
|
|
22
|
+
}
|
|
23
|
+
export interface ExpandCardEmits {
|
|
24
|
+
/** 开始展开 */
|
|
25
|
+
opened: [];
|
|
26
|
+
/** 结束展开 */
|
|
27
|
+
closed: [];
|
|
28
|
+
}
|
|
29
|
+
export interface ExpandCardExpose {
|
|
30
|
+
/** 展开卡片 */
|
|
31
|
+
open: () => void;
|
|
32
|
+
/** 收起卡片 */
|
|
33
|
+
close: () => void;
|
|
34
|
+
}
|
|
@@ -2,24 +2,36 @@ import { getSize as e } from "../../../utils/src/tool.mjs";
|
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
3
|
import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
4
4
|
import "../../../hooks/index.mjs";
|
|
5
|
-
import { computed as n,
|
|
5
|
+
import { computed as n, createIf as r, createSlot as i, defineVaporComponent as a, renderEffect as o, setClass as s, setInsertionState as c, setStyle as l, template as u, unref as d } from "vue";
|
|
6
6
|
//#region ../components/src/icon/icon.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var f = u("<div><svg viewBox=\"0 0 24 24\"><circle cx=12 cy=12 r=8>", 1), p = u("<div>", 1), m = /*@__PURE__*/ a({
|
|
8
8
|
name: "SIcon",
|
|
9
9
|
__name: "icon",
|
|
10
10
|
props: {
|
|
11
11
|
size: {},
|
|
12
|
-
color: {}
|
|
12
|
+
color: {},
|
|
13
|
+
anime: { type: Boolean },
|
|
14
|
+
animeType: { default: "shake" },
|
|
15
|
+
loading: { type: Boolean }
|
|
13
16
|
},
|
|
14
|
-
setup(
|
|
15
|
-
let
|
|
16
|
-
fontSize: e(
|
|
17
|
-
color:
|
|
18
|
-
})),
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
setup(a) {
|
|
18
|
+
let u = a, m = t("icon"), h = n(() => ({
|
|
19
|
+
fontSize: e(u.size),
|
|
20
|
+
color: u.color
|
|
21
|
+
})), g = n(() => u.animeType === "shake" ? m.is("shake", u.anime) : u.animeType === "scale" ? m.is("scale", u.anime) : u.animeType === "moveUp" ? m.is("moveUp", u.anime) : u.animeType === "rotate" ? m.is("rotate", u.anime) : "");
|
|
22
|
+
return r(() => a.loading, () => {
|
|
23
|
+
let e = f();
|
|
24
|
+
return o(() => {
|
|
25
|
+
let t = d(m);
|
|
26
|
+
s(e, [t.b(), t.is("loading", a.loading)]), l(e, h.value);
|
|
27
|
+
}), e;
|
|
28
|
+
}, () => {
|
|
29
|
+
let e = p();
|
|
30
|
+
return o(() => {
|
|
31
|
+
s(e, [d(m).b(), g.value]), l(e, h.value);
|
|
32
|
+
}), c(e, null, 0), i(), e;
|
|
33
|
+
}, 261);
|
|
22
34
|
}
|
|
23
35
|
});
|
|
24
36
|
//#endregion
|
|
25
|
-
export {
|
|
37
|
+
export { m as default };
|
|
@@ -8,6 +8,9 @@ export declare const SIcon: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setu
|
|
|
8
8
|
props: PublicProps & {
|
|
9
9
|
size?: string | number | undefined;
|
|
10
10
|
color?: string | undefined;
|
|
11
|
+
anime?: boolean | undefined;
|
|
12
|
+
animeType?: "shake" | "scale" | "moveUp" | "rotate" | undefined;
|
|
13
|
+
loading?: boolean | undefined;
|
|
11
14
|
} & (typeof globalThis extends {
|
|
12
15
|
__VLS_PROPS_FALLBACK: infer P;
|
|
13
16
|
} ? P : {});
|
|
@@ -3,6 +3,14 @@ export interface IconProps {
|
|
|
3
3
|
size?: string | number;
|
|
4
4
|
/** 图标颜色 */
|
|
5
5
|
color?: string;
|
|
6
|
+
/** 是否开启动画 */
|
|
7
|
+
anime?: boolean;
|
|
8
|
+
/** 动画类型(shake:抖动,scale:缩放,moveUp:上移,rotate:旋转)
|
|
9
|
+
* @default shake
|
|
10
|
+
*/
|
|
11
|
+
animeType?: "shake" | "scale" | "moveUp" | "rotate";
|
|
12
|
+
/** 是否显示加载状态 */
|
|
13
|
+
loading?: boolean;
|
|
6
14
|
}
|
|
7
15
|
export interface IconSlots {
|
|
8
16
|
/** 默认 */
|
|
@@ -28,7 +28,7 @@ export declare const SMenuItem: ((__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
|
28
28
|
name: string | number;
|
|
29
29
|
title?: string | undefined;
|
|
30
30
|
disabled?: boolean | undefined;
|
|
31
|
-
activePosition?: "left" | "center" | "right" | undefined;
|
|
31
|
+
activePosition?: "left" | "center" | "right" | "circle" | undefined;
|
|
32
32
|
item?: any;
|
|
33
33
|
} & (typeof globalThis extends {
|
|
34
34
|
__VLS_PROPS_FALLBACK: infer P;
|
package/dist/es/components/src/menu/menu-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -44,7 +44,8 @@ var O = /*@__PURE__*/ u({
|
|
|
44
44
|
t.is("disabled", u.disabled),
|
|
45
45
|
t.is("active", a.value === r && i === "center"),
|
|
46
46
|
t.is("active-left", a.value === r && i === "left"),
|
|
47
|
-
t.is("active-right", a.value === r && i === "right")
|
|
47
|
+
t.is("active-right", a.value === r && i === "right"),
|
|
48
|
+
t.is("active-circle", a.value === r && i === "circle")
|
|
48
49
|
]);
|
|
49
50
|
}), g(e, 0, 0), s(() => d.icon, () => {
|
|
50
51
|
let e = C();
|
|
@@ -61,9 +62,10 @@ var O = /*@__PURE__*/ u({
|
|
|
61
62
|
h(e, [
|
|
62
63
|
t.e("item-title"),
|
|
63
64
|
t.is("disabled", u.disabled),
|
|
64
|
-
t.is("active", a.value === r && i === "center"),
|
|
65
|
+
t.is("active-center", a.value === r && i === "center"),
|
|
65
66
|
t.is("active-left", a.value === r && i === "left"),
|
|
66
|
-
t.is("active-right", a.value === r && i === "right")
|
|
67
|
+
t.is("active-right", a.value === r && i === "right"),
|
|
68
|
+
t.is("active-circle", a.value === r && i === "circle")
|
|
67
69
|
]);
|
|
68
70
|
}), g(e, 0, 0), s(() => d.icon, () => {
|
|
69
71
|
let e = C();
|
package/dist/es/components/src/table/table.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -8,9 +8,9 @@ import o from "./col-group.vue.mjs";
|
|
|
8
8
|
import { tableContextKey as s } from "./types.mjs";
|
|
9
9
|
import c from "./table-body.vue.mjs";
|
|
10
10
|
import l from "./table-header.vue.mjs";
|
|
11
|
-
import { computed as u, createComponent as d, createForSlots as f, createIf as p, createSlot as m, defineVaporComponent as h, mergeModels as g, provide as _, ref as v, renderEffect as y, setClass as b, setInsertionState as x, setStyle as S, template as C, unref as w, useModel as T, watch as
|
|
11
|
+
import { computed as u, createComponent as d, createForSlots as f, createIf as p, createSlot as m, defineVaporComponent as h, mergeModels as g, provide as _, ref as v, renderEffect as y, setClass as b, setInsertionState as x, setStyle as S, template as C, unref as w, useModel as T, watch as E } from "vue";
|
|
12
12
|
//#region ../components/src/table/table.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var D = C("<table table-layout=fixed></table>"), ee = C("<div>"), O = C("<div>", 1), k = /*@__PURE__*/ h({
|
|
14
14
|
name: "STable",
|
|
15
15
|
__name: "table",
|
|
16
16
|
props: /*@__PURE__*/ g({
|
|
@@ -18,7 +18,7 @@ var te = C("<table table-layout=fixed></table>"), E = C("<div>"), D = C("<div>",
|
|
|
18
18
|
columns: { default: () => [] },
|
|
19
19
|
height: {},
|
|
20
20
|
maxHeight: {},
|
|
21
|
-
width: {},
|
|
21
|
+
width: { default: "100%" },
|
|
22
22
|
border: {},
|
|
23
23
|
stripe: { type: Boolean },
|
|
24
24
|
size: { default: "medium" },
|
|
@@ -39,36 +39,36 @@ var te = C("<table table-layout=fixed></table>"), E = C("<div>"), D = C("<div>",
|
|
|
39
39
|
"checkAll",
|
|
40
40
|
"expandedRow"
|
|
41
41
|
], ["update:checked", "update:selected"]),
|
|
42
|
-
setup(h, { expose: g, emit: C, slots:
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
42
|
+
setup(h, { expose: g, emit: C, slots: k }) {
|
|
43
|
+
let A = h, j = C, M = r("table"), N = T(h, "checked"), P = T(h, "selected"), te = (e, t, n) => {
|
|
44
|
+
N.value = n, j("checkRow", e, t, n);
|
|
45
|
+
}, ne = (e, t) => {
|
|
46
|
+
P.value = e, j("selectRow", e, t);
|
|
47
|
+
}, re = (e) => {
|
|
48
|
+
N.value = [...e], j("checkAll", e);
|
|
49
|
+
}, ie = u(() => {
|
|
50
50
|
let e = [];
|
|
51
|
-
if (!
|
|
52
|
-
for (let t of
|
|
51
|
+
if (!A.border || A.border.length === 0) return e;
|
|
52
|
+
for (let t of A.border) e.push(M.m(`border-${t}`));
|
|
53
53
|
return e;
|
|
54
|
-
}),
|
|
54
|
+
}), F = v(0), I = v(!0), L = v(!1), R = 0, z = () => `col_${R++}`, B = (e) => ({
|
|
55
55
|
...e,
|
|
56
|
-
id:
|
|
56
|
+
id: z(),
|
|
57
57
|
fixedOffset: void 0,
|
|
58
58
|
colSpan: 1,
|
|
59
59
|
rowSpan: 1,
|
|
60
60
|
isColumnGroup: !1,
|
|
61
61
|
level: 1,
|
|
62
62
|
field: e.field ?? "",
|
|
63
|
-
children: e.children ? e.children.map(
|
|
64
|
-
}),
|
|
63
|
+
children: e.children ? e.children.map(B) : void 0
|
|
64
|
+
}), V = u(() => A.columns.map(B)), H = u(() => {
|
|
65
65
|
let e = [], t = (n) => {
|
|
66
66
|
n.forEach((n) => {
|
|
67
67
|
n.children && n.children.length ? t(n.children) : e.push(n);
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
return t(
|
|
71
|
-
}),
|
|
70
|
+
return t(V.value), U(e), e;
|
|
71
|
+
}), U = (e) => {
|
|
72
72
|
let n = 0;
|
|
73
73
|
e.forEach((e) => {
|
|
74
74
|
if (e.fixed === "left") {
|
|
@@ -86,7 +86,7 @@ var te = C("<table table-layout=fixed></table>"), E = C("<div>"), D = C("<div>",
|
|
|
86
86
|
r += e;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
},
|
|
89
|
+
}, W = (e) => {
|
|
90
90
|
let t = 1, n = (e, r) => {
|
|
91
91
|
if (r && (e.level = r.level + 1, t < e.level && (t = e.level)), e.children && e.children.length) {
|
|
92
92
|
let t = 0;
|
|
@@ -108,18 +108,15 @@ var te = C("<table table-layout=fixed></table>"), E = C("<div>"), D = C("<div>",
|
|
|
108
108
|
return a(e), i.forEach((e) => {
|
|
109
109
|
!e.children || !e.children.length ? e.rowSpan = t - e.level + 1 : e.rowSpan = 1, r[e.level - 1].push(e);
|
|
110
110
|
}), r;
|
|
111
|
-
},
|
|
111
|
+
}, G = u(() => W(V.value)), K = u(() => {
|
|
112
112
|
let t = {};
|
|
113
|
-
return
|
|
114
|
-
}), K = u(() => {
|
|
115
|
-
let t = {};
|
|
116
|
-
return k.height && (t.height = e(k.height), t.overflowY = "auto"), k.maxHeight && (t.maxHeight = e(k.maxHeight), t.overflowY = "auto"), t;
|
|
113
|
+
return A.width && (t.width = e(A.width)), A.data.length === 0 && (t.position = "sticky", t.top = "0"), t;
|
|
117
114
|
}), q = (e) => {
|
|
118
115
|
let t = e.target;
|
|
119
|
-
|
|
116
|
+
I.value = t.scrollLeft === 0, L.value = t.scrollLeft + t.clientWidth >= t.scrollWidth - 1;
|
|
120
117
|
}, J = v({}), Y = v([]), X = (e) => e.map((e) => {
|
|
121
118
|
let t = { ...e };
|
|
122
|
-
t._id || (
|
|
119
|
+
t._id || (A.rowKey && t[A.rowKey] !== void 0 ? t._id = String(t[A.rowKey]) : t.id === void 0 ? t._id = n(8) : t._id = String(t.id));
|
|
123
120
|
let r = t.children;
|
|
124
121
|
return Array.isArray(r) && r.length > 0 && (t.children = X(r)), t;
|
|
125
122
|
}), Z = (e, t = 0, n = !0) => {
|
|
@@ -134,68 +131,73 @@ var te = C("<table table-layout=fixed></table>"), E = C("<div>"), D = C("<div>",
|
|
|
134
131
|
};
|
|
135
132
|
n && r.push(c), o && r.push(...Z(a, t + 1, n && s));
|
|
136
133
|
}), r;
|
|
137
|
-
}, Q = u(() => Z(Y.value)),
|
|
138
|
-
J.value[e._id] = !J.value[e._id],
|
|
134
|
+
}, Q = u(() => Z(Y.value)), ae = (e, t) => {
|
|
135
|
+
J.value[e._id] = !J.value[e._id], j("expandedRow", e, t, Y.value.filter((e) => J.value[e._id]));
|
|
139
136
|
};
|
|
140
|
-
|
|
137
|
+
E(() => A.data, (e) => {
|
|
141
138
|
Y.value = X(e);
|
|
142
139
|
}, {
|
|
143
140
|
deep: !0,
|
|
144
141
|
immediate: !0
|
|
145
142
|
}), _(s, {
|
|
146
|
-
props:
|
|
147
|
-
originColumns:
|
|
148
|
-
flatColumns:
|
|
149
|
-
columnRows:
|
|
150
|
-
isScrollAtLeft:
|
|
151
|
-
isScrollAtRight:
|
|
152
|
-
headerHeight:
|
|
153
|
-
checked:
|
|
154
|
-
selected:
|
|
143
|
+
props: A,
|
|
144
|
+
originColumns: V,
|
|
145
|
+
flatColumns: H,
|
|
146
|
+
columnRows: G,
|
|
147
|
+
isScrollAtLeft: I,
|
|
148
|
+
isScrollAtRight: L,
|
|
149
|
+
headerHeight: F,
|
|
150
|
+
checked: N,
|
|
151
|
+
selected: P
|
|
155
152
|
}), g({
|
|
156
153
|
clearSelect: () => {
|
|
157
|
-
|
|
154
|
+
N.value = [], P.value = {};
|
|
158
155
|
},
|
|
159
156
|
selectAll: () => {
|
|
160
|
-
|
|
157
|
+
N.value = [...Q.value];
|
|
161
158
|
}
|
|
162
159
|
});
|
|
163
|
-
let $ =
|
|
160
|
+
let $ = O();
|
|
164
161
|
return y(() => {
|
|
165
|
-
let
|
|
162
|
+
let t = w(M), n = w(e);
|
|
166
163
|
b($, [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
...
|
|
170
|
-
])
|
|
164
|
+
t.b(),
|
|
165
|
+
t.m(h.size),
|
|
166
|
+
...ie.value
|
|
167
|
+
]), S($, {
|
|
168
|
+
height: n(h.height),
|
|
169
|
+
width: n(h.width),
|
|
170
|
+
maxHeight: n(h.maxHeight)
|
|
171
|
+
});
|
|
171
172
|
}), x($, null, 0), d(w(i), {
|
|
172
|
-
height: () =>
|
|
173
|
-
|
|
174
|
-
"
|
|
173
|
+
height: () => h.height ? "100%" : "",
|
|
174
|
+
width: () => h.width ? "100%" : "",
|
|
175
|
+
"max-height": () => h.maxHeight ? w(e)(h.maxHeight) : "",
|
|
176
|
+
"offset-top": () => F.value,
|
|
175
177
|
always: () => h.scrollAlways,
|
|
176
178
|
native: () => h.nativeScrollbar,
|
|
177
179
|
onScroll: () => q
|
|
178
180
|
}, () => {
|
|
179
|
-
let e =
|
|
181
|
+
let e = D();
|
|
180
182
|
return y(() => {
|
|
181
|
-
b(e, [w(
|
|
182
|
-
}), x(e, null, 0), d(o, { columns: () =>
|
|
183
|
+
b(e, [w(M).e("inner")]), S(e, K.value);
|
|
184
|
+
}), x(e, null, 0), d(o, { columns: () => H.value }), x(e, null, 1), d(l, {
|
|
183
185
|
data: () => Q.value,
|
|
184
|
-
onCheckAll: () =>
|
|
186
|
+
onCheckAll: () => re
|
|
185
187
|
}), x(e, null, 2), d(c, {
|
|
186
188
|
data: () => Q.value,
|
|
187
|
-
onCheckRow: () =>
|
|
188
|
-
onSelectRow: () =>
|
|
189
|
-
onExpandedRow: () =>
|
|
190
|
-
}, { $: [() => f(
|
|
189
|
+
onCheckRow: () => te,
|
|
190
|
+
onSelectRow: () => ne,
|
|
191
|
+
onExpandedRow: () => ae
|
|
192
|
+
}, { $: [() => f(k, (e, t) => ({
|
|
191
193
|
name: t,
|
|
192
194
|
fn: (e) => m(() => t, { $: [() => e] }, null, 4)
|
|
193
195
|
}))] }), [e, p(() => !h.data.length, () => {
|
|
194
|
-
let e =
|
|
195
|
-
return y(() => b(e, [w(
|
|
196
|
+
let e = ee();
|
|
197
|
+
return y(() => b(e, [w(M).e("empty")])), x(e, null, 0), m("empty", null, () => d(w(a))), e;
|
|
196
198
|
}, null, 129)];
|
|
197
199
|
}), $;
|
|
198
200
|
}
|
|
199
201
|
});
|
|
200
202
|
//#endregion
|
|
201
|
-
export {
|
|
203
|
+
export { k as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { PublicProps, VNode } from 'vue';
|
|
2
2
|
declare const __VLS_export: (__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
3
|
props: PublicProps & __VLS_PrettifyLocal<{
|
|
4
|
+
appear?: boolean;
|
|
5
|
+
mode?: "in-out" | "out-in" | "default";
|
|
6
|
+
} & {
|
|
4
7
|
onAfterLeave?: ((el: HTMLElement) => any) | undefined;
|
|
5
8
|
onBeforeEnter?: ((el: HTMLElement) => any) | undefined;
|
|
6
9
|
onEnter?: ((el: HTMLElement) => any) | undefined;
|