savor-ui 0.15.7 → 0.16.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 +15 -0
- package/dist/es/components/src/descriptions/descriptions-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +35 -33
- package/dist/es/components/src/descriptions/descriptions.vue_vue_type_script_setup_true_vapor_true_lang.mjs +1 -1
- package/dist/es/components/src/menu/index.d.ts +2 -0
- package/dist/es/components/src/menu/menu.vue_vue_type_script_setup_true_vapor_true_lang.mjs +6 -2
- package/dist/es/components/src/menu/types.d.ts +3 -0
- package/dist/es/components/src/statistic/index.d.ts +1 -0
- package/dist/es/components/src/statistic/statistic.vue_vue_type_script_setup_true_vapor_true_lang.mjs +52 -36
- package/dist/es/components/src/statistic/types.d.ts +2 -0
- package/dist/es/components/src/table/index.d.ts +7 -4
- package/dist/es/components/src/table/table-body.vue_vue_type_script_setup_true_vapor_true_lang.mjs +24 -35
- package/dist/es/components/src/table/table-header.vue_vue_type_script_setup_true_vapor_true_lang.mjs +51 -46
- package/dist/es/components/src/table/table.d.ts +5 -3
- package/dist/es/components/src/table/table.vue_vue_type_script_setup_true_vapor_true_lang.mjs +100 -82
- package/dist/es/components/src/table/types.d.ts +12 -1
- package/dist/es/components/src/tree/index.d.ts +3 -3
- package/dist/es/components/src/tree/tree.d.ts +2 -2
- package/dist/es/core/index.d.ts +1 -0
- package/dist/es/core/index.mjs +3 -2
- package/dist/es/theme/components/radio.scss +7 -0
- package/dist/json/vetur-attributes.json +20 -0
- package/dist/json/vetur-tags.json +8 -2
- package/dist/json/web-types.json +49 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
# [0.16.0](https://gitee.com/mach552/savor-ui/compare/v0.15.7...v0.16.0) (2026-08-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **descriptions:** 修复竖向布局时label宽度没有撑满的问题 ([d460cd0](https://gitee.com/mach552/savor-ui/commits/d460cd0a3df7c420a67e94a9deae7589a5bc7a1c))
|
|
11
|
+
* **radio:** 修复button的禁用样式无效问题 ([d647d8e](https://gitee.com/mach552/savor-ui/commits/d647d8e8e60b6cf41430b4ca0c6f44600cbef1d9))
|
|
12
|
+
* **statistic:** 修复动画无效的问题 ([3db3653](https://gitee.com/mach552/savor-ui/commits/3db3653c7ac933bcf4d554c5b39ab75ebbd10ea2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **menu:** 新增滚动条属性 ([b6b3485](https://gitee.com/mach552/savor-ui/commits/b6b34857afb6aab2a0c7e4d897b55266ce8ec5d8))
|
|
18
|
+
* **table:** 新增隐藏头部属性 ([d1954d9](https://gitee.com/mach552/savor-ui/commits/d1954d978921f876a1230c43ff92d719645c1dcd))
|
|
19
|
+
|
|
5
20
|
## [0.15.7](https://gitee.com/mach552/savor-ui/compare/v0.15.6...v0.15.7) (2026-08-05)
|
|
6
21
|
|
|
7
22
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSize as e } from "../../../utils/src/tool.mjs";
|
|
2
|
+
import "../../../utils/index.mjs";
|
|
3
|
+
import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
2
4
|
import "../../../hooks/index.mjs";
|
|
3
|
-
import { descriptionsContextKey as
|
|
4
|
-
import { child as
|
|
5
|
+
import { descriptionsContextKey as n } from "./types.mjs";
|
|
6
|
+
import { child as r, computed as i, createSlot as a, defineVaporComponent as o, inject as s, next as c, onMounted as l, onUnmounted as u, renderEffect as d, setClass as f, setInsertionState as p, setStyle as m, setText as h, template as g, toDisplayString as _, unref as v, useId as y } from "vue";
|
|
5
7
|
//#region ../components/src/descriptions/descriptions-item.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
6
|
-
var
|
|
8
|
+
var b = g(" "), x = g("<div><div></div><div>", 1), S = /*@__PURE__*/ o({
|
|
7
9
|
name: "SDescriptionsItem",
|
|
8
10
|
__name: "descriptions-item",
|
|
9
11
|
props: {
|
|
@@ -12,51 +14,51 @@ var y = h(" "), b = h("<div><div></div><div>", 1), x = /*@__PURE__*/ a({
|
|
|
12
14
|
labelWidth: {},
|
|
13
15
|
labelAlign: {}
|
|
14
16
|
},
|
|
15
|
-
setup(
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
uid:
|
|
20
|
-
label:
|
|
21
|
-
span:
|
|
22
|
-
labelWidth:
|
|
23
|
-
labelAlign:
|
|
17
|
+
setup(o) {
|
|
18
|
+
let g = o, S = t("descriptions"), C = s(n, void 0), w = "desc-item-" + y();
|
|
19
|
+
l(() => {
|
|
20
|
+
C?.addItem?.({
|
|
21
|
+
uid: w,
|
|
22
|
+
label: g.label,
|
|
23
|
+
span: g.span,
|
|
24
|
+
labelWidth: g.labelWidth,
|
|
25
|
+
labelAlign: g.labelAlign
|
|
24
26
|
});
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
+
}), u(() => {
|
|
28
|
+
C?.removeItem?.(w);
|
|
27
29
|
});
|
|
28
|
-
let
|
|
29
|
-
if (!
|
|
30
|
-
gridColumn: `span ${
|
|
30
|
+
let T = i(() => {
|
|
31
|
+
if (!C?.positionList) return {
|
|
32
|
+
gridColumn: `span ${g.span}`,
|
|
31
33
|
display: "flex",
|
|
32
34
|
alignItems: "stretch"
|
|
33
35
|
};
|
|
34
|
-
let e =
|
|
36
|
+
let e = C.positionList.value[w];
|
|
35
37
|
return e ? {
|
|
36
38
|
gridColumn: `${e.start} / ${e.end}`,
|
|
37
39
|
display: "flex",
|
|
38
40
|
alignItems: "stretch"
|
|
39
41
|
} : {
|
|
40
|
-
gridColumn: `span ${
|
|
42
|
+
gridColumn: `span ${g.span}`,
|
|
41
43
|
display: "flex",
|
|
42
44
|
alignItems: "stretch"
|
|
43
45
|
};
|
|
44
|
-
}),
|
|
45
|
-
let
|
|
46
|
-
textAlign:
|
|
46
|
+
}), E = i(() => {
|
|
47
|
+
let t = C?.labelAlign || g.labelAlign, n = C?.direction === "vertical" ? "100%" : g.labelWidth || C?.labelWidth, r = {
|
|
48
|
+
textAlign: t ?? "left",
|
|
47
49
|
whiteSpace: "nowrap",
|
|
48
50
|
flexShrink: "0"
|
|
49
51
|
};
|
|
50
|
-
return
|
|
51
|
-
}),
|
|
52
|
-
return
|
|
53
|
-
let e =
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
let e =
|
|
57
|
-
return
|
|
58
|
-
}),
|
|
52
|
+
return n != null && (r.width = e(n)), r;
|
|
53
|
+
}), D = x(), O = r(D), k = c(O, 1);
|
|
54
|
+
return d(() => {
|
|
55
|
+
let e = v(S);
|
|
56
|
+
f(D, [e.e("item")]), m(D, T.value), f(O, e.e("label")), m(O, E.value);
|
|
57
|
+
}), p(O, null, 0), a("label", null, () => {
|
|
58
|
+
let e = b();
|
|
59
|
+
return d(() => h(e, _(o.label))), e;
|
|
60
|
+
}), d(() => f(k, v(S).e("content"))), p(k, null, 0), a(), D;
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
//#endregion
|
|
62
|
-
export {
|
|
64
|
+
export { S as default };
|
|
@@ -16,7 +16,7 @@ var _ = m(" "), v = m("<div>"), y = m("<div><div>", 1), b = /*@__PURE__*/ o({
|
|
|
16
16
|
labelAlign: { default: "left" },
|
|
17
17
|
title: {},
|
|
18
18
|
size: { default: "default" },
|
|
19
|
-
labelWidth: { default:
|
|
19
|
+
labelWidth: { default: 100 },
|
|
20
20
|
tableLayout: {}
|
|
21
21
|
},
|
|
22
22
|
setup(o, { slots: m }) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MenuGroupSlots, MenuItemSlots, MenuSlots, SubMenuSlots } from './types';
|
|
2
2
|
import { PublicProps, VNode, Plugin } from 'vue';
|
|
3
|
+
import { ScrollbarProps } from '../scrollbar';
|
|
3
4
|
export declare const SMenuGroup: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
4
5
|
attrs: any;
|
|
5
6
|
slots: MenuGroupSlots;
|
|
@@ -53,6 +54,7 @@ export declare const SMenu: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setu
|
|
|
53
54
|
openKeys?: (string[] & (string | number)[]) | undefined;
|
|
54
55
|
selectedKey?: string | undefined;
|
|
55
56
|
accordion?: boolean | undefined;
|
|
57
|
+
scrollbarProps?: ScrollbarProps | undefined;
|
|
56
58
|
activeKey?: string | number | undefined;
|
|
57
59
|
onItemClick?: ((name: string | number, item: any) => any) | undefined;
|
|
58
60
|
onOpenChange?: ((keys: string[]) => any) | undefined;
|
|
@@ -16,7 +16,8 @@ var S = _("<div>"), C = _("<div>", 1), w = /*@__PURE__*/ c({
|
|
|
16
16
|
collapsedWidth: { default: 48 },
|
|
17
17
|
openKeys: {},
|
|
18
18
|
selectedKey: {},
|
|
19
|
-
accordion: { type: Boolean }
|
|
19
|
+
accordion: { type: Boolean },
|
|
20
|
+
scrollbarProps: {}
|
|
20
21
|
}, {
|
|
21
22
|
activeKey: {},
|
|
22
23
|
activeKeyModifiers: {},
|
|
@@ -55,7 +56,10 @@ var S = _("<div>"), C = _("<div>", 1), w = /*@__PURE__*/ c({
|
|
|
55
56
|
let R = C();
|
|
56
57
|
return f(() => {
|
|
57
58
|
p(R, [y(T).b()]), g(R, E.value);
|
|
58
|
-
}), m(R, null, 0), o(y(r), {
|
|
59
|
+
}), m(R, null, 0), o(y(r), { $: [() => ({
|
|
60
|
+
padding: "4px",
|
|
61
|
+
...c.scrollbarProps
|
|
62
|
+
})] }, () => {
|
|
59
63
|
let e = S();
|
|
60
64
|
return f(() => p(e, [y(T).e("content")])), m(e, null, 0), s(), e;
|
|
61
65
|
}), h(R, L, null, "menuRef"), R;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { ScrollbarProps } from '../scrollbar';
|
|
2
3
|
export interface MenuProps {
|
|
3
4
|
/** 是否折叠 */
|
|
4
5
|
collapsed?: boolean;
|
|
@@ -12,6 +13,8 @@ export interface MenuProps {
|
|
|
12
13
|
selectedKey?: string;
|
|
13
14
|
/** 是否开启手风琴模式 */
|
|
14
15
|
accordion?: boolean;
|
|
16
|
+
/** 滚动条属性 */
|
|
17
|
+
scrollbarProps?: ScrollbarProps;
|
|
15
18
|
}
|
|
16
19
|
export interface MenuSlots {
|
|
17
20
|
/** 默认 */
|
|
@@ -12,6 +12,7 @@ export declare const SStatistic: ((__VLS_props: NonNullable<Awaited<typeof __VLS
|
|
|
12
12
|
precision?: number | undefined;
|
|
13
13
|
showGroupSeparator?: boolean | undefined;
|
|
14
14
|
animation?: boolean | undefined;
|
|
15
|
+
duration?: number | undefined;
|
|
15
16
|
countdown?: boolean | undefined;
|
|
16
17
|
format?: string | undefined;
|
|
17
18
|
start?: boolean | undefined;
|
|
@@ -8,68 +8,84 @@ import y from "dayjs/plugin/duration";
|
|
|
8
8
|
//#region ../components/src/statistic/statistic.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
9
9
|
var b = m(" "), x = m("<div>"), S = m("<div><div> </div>", 1), C = /*@__PURE__*/ o({
|
|
10
10
|
name: "SStatistic",
|
|
11
|
+
inheritAttrs: !1,
|
|
11
12
|
__name: "statistic",
|
|
12
13
|
props: {
|
|
13
14
|
title: {},
|
|
14
15
|
value: {},
|
|
15
16
|
extra: {},
|
|
16
|
-
precision: {
|
|
17
|
-
showGroupSeparator: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
animation: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: !1
|
|
24
|
-
},
|
|
25
|
-
countdown: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: !1
|
|
28
|
-
},
|
|
17
|
+
precision: {},
|
|
18
|
+
showGroupSeparator: { type: Boolean },
|
|
19
|
+
animation: { type: Boolean },
|
|
20
|
+
duration: { default: 1e3 },
|
|
21
|
+
countdown: { type: Boolean },
|
|
29
22
|
format: { default: "HH:mm:ss" },
|
|
30
|
-
start: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
33
|
-
},
|
|
23
|
+
start: { type: Boolean },
|
|
34
24
|
valueStyle: { default: () => ({}) }
|
|
35
25
|
},
|
|
36
26
|
emits: ["stop"],
|
|
37
27
|
setup(o, { emit: m, slots: C }) {
|
|
38
28
|
v.extend(y);
|
|
39
|
-
let w = o, T = m, E = t("statistic"), D = c(w.value), O = null, k = c(0), A =
|
|
29
|
+
let w = o, T = m, E = t("statistic"), D = c(w.value), O = null, k = c(0), A = c(null), j = null, M = (e, t, n, r) => {
|
|
30
|
+
if (j &&= (j(), null), e <= 0) {
|
|
31
|
+
r(n);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let i = performance.now(), a, o = () => {
|
|
35
|
+
let s = performance.now() - i, c = Math.min(s / e, 1);
|
|
36
|
+
r(t + (n - t) * c), !(c >= 1) && (a = requestAnimationFrame(o));
|
|
37
|
+
};
|
|
38
|
+
a = requestAnimationFrame(o), j = () => cancelAnimationFrame(a);
|
|
39
|
+
}, N = () => {
|
|
40
|
+
T("stop"), O &&= (clearInterval(O), null);
|
|
41
|
+
}, P = () => {
|
|
42
|
+
O ||= window.setInterval(() => {
|
|
43
|
+
k.value++, D.value - Date.now() <= 0 && N();
|
|
44
|
+
}, 1e3);
|
|
45
|
+
}, F = r(() => {
|
|
40
46
|
if (w.countdown) {
|
|
41
47
|
k.value;
|
|
42
48
|
let e = Date.now(), t = Math.max(0, D.value - e);
|
|
43
|
-
return t <= 0 ? (
|
|
49
|
+
return t <= 0 ? v.duration(0).format(w.format) : v.duration(t).format(w.format);
|
|
44
50
|
}
|
|
45
|
-
let t = Number(w.value) || 0, n =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
let t = Number(w.value) || 0, n = A.value ?? t, r;
|
|
52
|
+
if (w.precision !== void 0) r = n.toFixed(w.precision);
|
|
53
|
+
else {
|
|
54
|
+
let e = t.toString(), i = e.indexOf("."), a = i > -1 ? e.length - i - 1 : 0;
|
|
55
|
+
r = n.toFixed(a);
|
|
56
|
+
}
|
|
57
|
+
return w.showGroupSeparator && (r = e(r)), r;
|
|
58
|
+
});
|
|
59
|
+
_(() => w.value, (e, t) => {
|
|
60
|
+
let n = Number(e) || 0, r = Number(t) || 0;
|
|
61
|
+
if (w.countdown) {
|
|
62
|
+
N(), D.value = n, k.value++, w.start && P();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
w.animation ? M(w.duration, r, n, (e) => {
|
|
66
|
+
A.value = e;
|
|
67
|
+
}) : A.value = null;
|
|
68
|
+
}, { immediate: !0 }), _(() => w.start, (e) => {
|
|
69
|
+
e ? P() : N();
|
|
70
|
+
}, { immediate: !0 }), s(() => {
|
|
71
|
+
N(), j && j();
|
|
72
|
+
});
|
|
73
|
+
let I = S(), L = n(I, 1), R = n(L, 1);
|
|
74
|
+
return l(() => u(I, [g(E).b()])), d(I, 0, 0), i(() => o.title || C.title, () => {
|
|
59
75
|
let e = x();
|
|
60
76
|
return l(() => u(e, [g(E).e("title")])), d(e, null, 0), a("title", null, () => {
|
|
61
77
|
let e = b();
|
|
62
78
|
return l(() => p(e, h(o.title))), e;
|
|
63
79
|
}), e;
|
|
64
80
|
}), l(() => {
|
|
65
|
-
u(
|
|
66
|
-
}), d(
|
|
81
|
+
u(L, [g(E).e("value")]), f(L, o.valueStyle);
|
|
82
|
+
}), d(L, 0, 0), a("prefix"), l(() => p(R, " " + h(F.value) + " ")), d(L, null, 2), a("suffix"), d(I, null, 2), i(() => o.extra || C.extra, () => {
|
|
67
83
|
let e = x();
|
|
68
84
|
return l(() => u(e, [g(E).e("extra")])), d(e, null, 0), a("extra", null, () => {
|
|
69
85
|
let e = b();
|
|
70
86
|
return l(() => p(e, h(o.extra))), e;
|
|
71
87
|
}), e;
|
|
72
|
-
}),
|
|
88
|
+
}), I;
|
|
73
89
|
}
|
|
74
90
|
});
|
|
75
91
|
//#endregion
|
|
@@ -3,7 +3,7 @@ import { PublicProps, ShallowUnwrapRef, VNode, Plugin } from 'vue';
|
|
|
3
3
|
export declare const STable: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
4
4
|
attrs: any;
|
|
5
5
|
slots: TableAllSlots;
|
|
6
|
-
emit: (((evt: "checkRow", row: any, index: number, checked: any[]) => void) & ((evt: "selectRow", row: any, index: number) => void) & ((evt: "expandedRow", row: any, index: number, expandedRows: any[]) => void) & ((evt: "checkAll", checked: any[]) => void)) & (((event: "update:
|
|
6
|
+
emit: (((evt: "checkRow", row: any, index: number, checked: any[]) => void) & ((evt: "selectRow", row: any, index: number) => void) & ((evt: "expandedRow", row: any, index: number, expandedRows: any[]) => void) & ((evt: "checkAll", checked: any[]) => void)) & (((event: "update:expandedKeys", value: (string | number)[]) => void) & ((event: "update:checkedKeys", value: (string | number)[]) => void) & ((event: "update:selected", value: any) => void));
|
|
7
7
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
8
|
props: PublicProps & {
|
|
9
9
|
data: any[];
|
|
@@ -19,13 +19,16 @@ export declare const STable: ((__VLS_props: NonNullable<Awaited<typeof __VLS_set
|
|
|
19
19
|
rowKey?: string | undefined;
|
|
20
20
|
scrollAlways?: boolean | undefined;
|
|
21
21
|
nativeScrollbar?: boolean | undefined;
|
|
22
|
-
|
|
22
|
+
hideHeader?: boolean | undefined;
|
|
23
|
+
checkedKeys?: (string | number)[] | undefined;
|
|
24
|
+
expandedKeys?: (string | number)[] | undefined;
|
|
23
25
|
selected?: any;
|
|
26
|
+
"onUpdate:expandedKeys"?: ((value: (string | number)[]) => any) | undefined;
|
|
24
27
|
onCheckRow?: ((row: any, index: number, checked: any[]) => any) | undefined;
|
|
25
28
|
onSelectRow?: ((row: any, index: number) => any) | undefined;
|
|
26
29
|
onExpandedRow?: ((row: any, index: number, expandedRows: any[]) => any) | undefined;
|
|
27
30
|
onCheckAll?: ((checked: any[]) => any) | undefined;
|
|
28
|
-
"onUpdate:
|
|
31
|
+
"onUpdate:checkedKeys"?: ((value: (string | number)[]) => any) | undefined;
|
|
29
32
|
"onUpdate:selected"?: ((value: any) => any) | undefined;
|
|
30
33
|
} & (typeof globalThis extends {
|
|
31
34
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -33,7 +36,7 @@ export declare const STable: ((__VLS_props: NonNullable<Awaited<typeof __VLS_set
|
|
|
33
36
|
expose: (exposed: ShallowUnwrapRef<TableExpose>) => void;
|
|
34
37
|
attrs: any;
|
|
35
38
|
slots: TableAllSlots;
|
|
36
|
-
emit: (((evt: "checkRow", row: any, index: number, checked: any[]) => void) & ((evt: "selectRow", row: any, index: number) => void) & ((evt: "expandedRow", row: any, index: number, expandedRows: any[]) => void) & ((evt: "checkAll", checked: any[]) => void)) & (((event: "update:
|
|
39
|
+
emit: (((evt: "checkRow", row: any, index: number, checked: any[]) => void) & ((evt: "selectRow", row: any, index: number) => void) & ((evt: "expandedRow", row: any, index: number, expandedRows: any[]) => void) & ((evt: "checkAll", checked: any[]) => void)) & (((event: "update:expandedKeys", value: (string | number)[]) => void) & ((event: "update:checkedKeys", value: (string | number)[]) => void) & ((event: "update:selected", value: any) => void));
|
|
37
40
|
}>) => VNode & {
|
|
38
41
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
39
42
|
}) & Plugin;
|
package/dist/es/components/src/table/table-body.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -7,9 +7,9 @@ import "../../../icons/index.mjs";
|
|
|
7
7
|
import { STooltip as i } from "../tooltip/index.mjs";
|
|
8
8
|
import { SCheckbox as a } from "../checkbox/index.mjs";
|
|
9
9
|
import { tableContextKey as o } from "./types.mjs";
|
|
10
|
-
import { child as s, computed as c, createComponent as l, createFor as u, createIf as d, createInvoker as f, createSlot as p, createTemplateRefSetter as m, defineVaporComponent as h, delegateEvents as g, inject as _, nextTick as v, ref as y, renderEffect as b, setClass as x, setInsertionState as S, setProp as C, setStyle as w, setText as T, template as E, toDisplayString as D, txt as O, unref as k, watch as
|
|
10
|
+
import { child as s, computed as c, createComponent as l, createFor as u, createIf as d, createInvoker as f, createSlot as p, createTemplateRefSetter as m, defineVaporComponent as h, delegateEvents as g, inject as _, nextTick as v, ref as y, renderEffect as b, setClass as x, setInsertionState as S, setProp as C, setStyle as w, setText as T, template as E, toDisplayString as D, txt as O, unref as k, watch as ee } from "vue";
|
|
11
11
|
//#region ../components/src/table/table-body.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
12
|
-
var
|
|
12
|
+
var A = E("<td><div>"), j = E("<span>"), M = E("<div>"), N = E("<div><div> </div>"), P = E("<div><div> "), F = E("<td>"), I = E("<tr>"), te = E("<tbody>", 1);
|
|
13
13
|
g("click");
|
|
14
14
|
var L = /*@__PURE__*/ h({
|
|
15
15
|
__name: "table-body",
|
|
@@ -30,7 +30,7 @@ var L = /*@__PURE__*/ h({
|
|
|
30
30
|
}), B.value = t;
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
ee(() => E.data, () => {
|
|
34
34
|
U();
|
|
35
35
|
}, {
|
|
36
36
|
flush: "post",
|
|
@@ -42,40 +42,29 @@ var L = /*@__PURE__*/ h({
|
|
|
42
42
|
}, G = (e, n) => t(e, n), K = c(() => z?.flatColumns.value || []), q = c(() => z?.props.stripe ?? !1), J = c(() => z?.isScrollAtLeft.value ?? !0), Y = c(() => z?.isScrollAtRight.value ?? !1), X = (e) => {
|
|
43
43
|
let t = {};
|
|
44
44
|
return e.width === "auto" && (t.whiteSpace = "nowrap"), e.fixed && e.fixedOffset !== void 0 && (t.position = "sticky", t[e.fixed] = `${e.fixedOffset}px`, t.zIndex = 1), t;
|
|
45
|
-
}, Z = c(() => {
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
}), Q = (e) => Z.value.has(e._id), ne = (e, t, n) => {
|
|
49
|
-
let r = z?.checked.value ?? [], i;
|
|
50
|
-
if (z?.props?.multiple) {
|
|
51
|
-
let n = r.findIndex((e) => e._id === t._id);
|
|
52
|
-
if (e) if (n === -1) {
|
|
53
|
-
let e = E.data.find((e) => e._id === t._id);
|
|
54
|
-
i = [...r, e];
|
|
55
|
-
} else i = [...r];
|
|
56
|
-
else i = n === -1 ? [...r] : r.toSpliced(n, 1);
|
|
57
|
-
} else i = e ? [E.data.find((e) => e._id === t._id)] : [];
|
|
58
|
-
L("checkRow", t, n, i);
|
|
59
|
-
}, re = (e) => {
|
|
60
|
-
let t = z?.selected.value;
|
|
61
|
-
return t && t._id === e._id;
|
|
45
|
+
}, Z = (e) => z?.getRowKey(e) ?? e._id, ne = c(() => new Set(z?.checkedKeys.value ?? [])), Q = (e) => ne.value.has(Z(e)), re = (e, t, n) => {
|
|
46
|
+
let r = z?.checkedKeys.value ?? [], i = Z(t), a;
|
|
47
|
+
a = z?.props?.multiple ? e ? r.includes(i) ? [...r] : [...r, i] : r.filter((e) => e !== i) : e ? [i] : [], L("checkRow", t, n, (E.data ?? []).filter((e) => a.includes(Z(e))));
|
|
62
48
|
}, ie = (e) => {
|
|
49
|
+
let t = z?.selected.value;
|
|
50
|
+
return t && Z(t) === Z(e);
|
|
51
|
+
}, ae = (e) => {
|
|
63
52
|
if (!z?.props?.rowSelection) return;
|
|
64
53
|
let t = z?.selected.value;
|
|
65
|
-
L("selectRow", t && t
|
|
66
|
-
},
|
|
54
|
+
L("selectRow", t && Z(t) === Z(e) ? {} : e, E.data.indexOf(e));
|
|
55
|
+
}, oe = m(), $ = te();
|
|
67
56
|
return S($, null, 0), u(() => E.data, (e, t) => {
|
|
68
|
-
let n =
|
|
57
|
+
let n = I();
|
|
69
58
|
return b(() => {
|
|
70
59
|
let r = k(R), i = e.value;
|
|
71
60
|
x(n, [
|
|
72
61
|
r.e("body-row"),
|
|
73
62
|
r.is("stripe", q.value && t.value % 2 == 1),
|
|
74
|
-
r.is("selected",
|
|
63
|
+
r.is("selected", ie(i) || Q(i)),
|
|
75
64
|
r.is("selection", k(z)?.props?.rowSelection)
|
|
76
65
|
]);
|
|
77
66
|
}), S(n, null, 0), u(() => K.value, (n, o) => d(() => n.value.type === "select", () => {
|
|
78
|
-
let r =
|
|
67
|
+
let r = A(), i = s(r);
|
|
79
68
|
b(() => {
|
|
80
69
|
let e = k(R), t = n.value, a = t.fixed;
|
|
81
70
|
x(r, [
|
|
@@ -87,13 +76,13 @@ var L = /*@__PURE__*/ h({
|
|
|
87
76
|
{ [e.m("body-cell", "align", t.align)]: t.align }
|
|
88
77
|
]), w(r, X(t)), x(i, [e.e("body-cell-content")]);
|
|
89
78
|
}), S(i, null, 0);
|
|
90
|
-
let o = (n) =>
|
|
79
|
+
let o = (n) => re(n, e.value, t.value);
|
|
91
80
|
return l(k(a), {
|
|
92
81
|
"model-value": () => Q(e.value),
|
|
93
82
|
onChange: () => o
|
|
94
83
|
}), r;
|
|
95
84
|
}, () => {
|
|
96
|
-
let a =
|
|
85
|
+
let a = F();
|
|
97
86
|
return b(() => {
|
|
98
87
|
let e = k(R), t = n.value, r = t.fixed;
|
|
99
88
|
x(a, [
|
|
@@ -106,11 +95,11 @@ var L = /*@__PURE__*/ h({
|
|
|
106
95
|
{ [e.m("body-cell", "align", t.align)]: t.align }
|
|
107
96
|
]), w(a, X(t));
|
|
108
97
|
}), S(a, null, 0), d(() => n.value.slot, () => {
|
|
109
|
-
let i =
|
|
98
|
+
let i = M();
|
|
110
99
|
return b(() => {
|
|
111
100
|
x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
|
|
112
101
|
}), S(i, null, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
|
|
113
|
-
let n =
|
|
102
|
+
let n = j();
|
|
114
103
|
return b(() => {
|
|
115
104
|
let t = k(R);
|
|
116
105
|
x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
|
|
@@ -125,11 +114,11 @@ var L = /*@__PURE__*/ h({
|
|
|
125
114
|
mini: "",
|
|
126
115
|
disabled: () => B.value[t.value + "_" + o.value] !== !0
|
|
127
116
|
}, () => {
|
|
128
|
-
let i =
|
|
117
|
+
let i = N(), a = s(i, 1);
|
|
129
118
|
b(() => {
|
|
130
119
|
x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
|
|
131
120
|
}), S(i, 0, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
|
|
132
|
-
let n =
|
|
121
|
+
let n = j();
|
|
133
122
|
return b(() => {
|
|
134
123
|
let t = k(R);
|
|
135
124
|
x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
|
|
@@ -137,14 +126,14 @@ var L = /*@__PURE__*/ h({
|
|
|
137
126
|
});
|
|
138
127
|
let c = O(a);
|
|
139
128
|
return b(() => {
|
|
140
|
-
x(a, k(R).e("body-cell-text")), T(c, D(G(e.value, n.value.field))),
|
|
129
|
+
x(a, k(R).e("body-cell-text")), T(c, D(G(e.value, n.value.field))), oe(a, (e) => H(e, t.value + "_" + o.value), !0);
|
|
141
130
|
}), i;
|
|
142
131
|
}), () => {
|
|
143
|
-
let i =
|
|
132
|
+
let i = P(), a = s(i, 1);
|
|
144
133
|
b(() => {
|
|
145
134
|
x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
|
|
146
135
|
}), S(i, 0, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
|
|
147
|
-
let n =
|
|
136
|
+
let n = j();
|
|
148
137
|
return b(() => {
|
|
149
138
|
let t = k(R);
|
|
150
139
|
x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
|
|
@@ -155,7 +144,7 @@ var L = /*@__PURE__*/ h({
|
|
|
155
144
|
x(a, k(R).e("body-cell-text")), T(o, D(G(e.value, n.value.field)));
|
|
156
145
|
}), i;
|
|
157
146
|
}, 1285), 773), a;
|
|
158
|
-
}, 266), (e, t) => t, 17), n.$evtclick = f(() =>
|
|
147
|
+
}, 266), (e, t) => t, 17), n.$evtclick = f(() => ae(e.value)), n;
|
|
159
148
|
}, (e, t) => t, 9), C($, "tabindex", -1), $;
|
|
160
149
|
}
|
|
161
150
|
});
|