savor-ui 0.3.2 → 0.3.3
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 +16 -0
- package/dist/es/components/index.mjs +1 -1
- package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs +92 -81
- package/dist/es/components/src/cascader/index.d.ts +1 -0
- package/dist/es/components/src/cascader/types.d.ts +2 -0
- package/dist/es/components/src/grid/grid-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +23 -15
- package/dist/es/components/src/grid/grid.vue_vue_type_script_setup_true_vapor_true_lang.mjs +6 -1
- package/dist/es/components/src/grid/types.d.ts +1 -0
- package/dist/es/components/src/menu/menu-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +46 -37
- package/dist/es/components/src/table/table.vue_vue_type_script_setup_true_vapor_true_lang.mjs +45 -34
- package/dist/es/components/src/tree/index.d.ts +12 -4
- package/dist/es/components/src/tree/node.d.ts +2 -1
- package/dist/es/components/src/tree/node.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -1
- package/dist/es/components/src/tree/tree.d.ts +6 -2
- package/dist/es/components/src/tree/tree.vue_vue_type_script_setup_true_vapor_true_lang.mjs +57 -49
- package/dist/es/components/src/tree/types.d.ts +13 -3
- package/dist/es/core/components.mjs +6 -6
- package/dist/es/core/index.mjs +7 -7
- package/dist/es/theme/components/button.scss +21 -4
- package/dist/es/theme/components/cascader.scss +3 -0
- package/dist/es/theme/components/input.scss +2 -0
- package/dist/es/theme/components/menu.scss +13 -0
- package/dist/es/theme/components/table.scss +1 -0
- package/dist/json/vetur-attributes.json +28 -0
- package/dist/json/vetur-tags.json +8 -0
- package/dist/json/web-types.json +52 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [0.3.3](https://gitee.com/mach552/savor-ui/compare/v0.3.2...v0.3.3) (2026-06-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **button:** 修复禁用状态样式无效问题 ([604ca42](https://gitee.com/mach552/savor-ui/commits/604ca427631e89bceaada29a04baf75371c77c60))
|
|
11
|
+
* **cascader:** 修复不显示下拉箭头图标问题 ([c2eb385](https://gitee.com/mach552/savor-ui/commits/c2eb38597b79bda04e98c94a0a61bf32b1c6af59))
|
|
12
|
+
* **cascader:** 修复空状态显示样式问题 ([25d0db3](https://gitee.com/mach552/savor-ui/commits/25d0db39d24b889de90ab15d8ccc663dcb04c424))
|
|
13
|
+
* **cascader:** 修复清除图标不显示问题 ([0f6fda6](https://gitee.com/mach552/savor-ui/commits/0f6fda6a85611dce909f72bdc6062a77f348abc0))
|
|
14
|
+
* **grid:** 修复动态增减item时不动态计算位置的问题 ([67785f2](https://gitee.com/mach552/savor-ui/commits/67785f208652f0fd5a66f0e593790461789283ee))
|
|
15
|
+
* **input:** 修复禁用状态hover样式 ([cede93e](https://gitee.com/mach552/savor-ui/commits/cede93e6c8b72e6c608a37f59a6b395f4be4719f))
|
|
16
|
+
* **menu:** 修复折叠时的样式问题 ([9633091](https://gitee.com/mach552/savor-ui/commits/9633091ba4a04f4ce8e18cca24332268b21e7401))
|
|
17
|
+
* **table:** 修复横向滚动条在最右边反复横跳问题 ([a5e1902](https://gitee.com/mach552/savor-ui/commits/a5e19026cfe255fd0e303d7018a6eb69b62d4427))
|
|
18
|
+
* **table:** 修复树形展开时图标不旋转问题 ([6813adb](https://gitee.com/mach552/savor-ui/commits/6813adb8387a3a64ced2f045a9d12d82023aa692))
|
|
19
|
+
* **tree:** 修复各种事件无效问题 ([007a8ae](https://gitee.com/mach552/savor-ui/commits/007a8aecc76a257e61f5985c3e3a8803eb7d2f1e))
|
|
20
|
+
|
|
5
21
|
## [0.3.2](https://gitee.com/mach552/savor-ui/compare/v0.3.1...v0.3.2) (2026-06-08)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -16,12 +16,12 @@ import "./src/badge/index.mjs";
|
|
|
16
16
|
import "./src/button/index.mjs";
|
|
17
17
|
import "./src/card/index.mjs";
|
|
18
18
|
import "./src/carousel/index.mjs";
|
|
19
|
+
import "./src/empty/index.mjs";
|
|
19
20
|
import "./src/cascader/index.mjs";
|
|
20
21
|
import "./src/checkbox/types.mjs";
|
|
21
22
|
import "./src/checkbox/index.mjs";
|
|
22
23
|
import "./src/collapse/types.mjs";
|
|
23
24
|
import "./src/collapse/index.mjs";
|
|
24
|
-
import "./src/empty/index.mjs";
|
|
25
25
|
import "./src/icon/index.mjs";
|
|
26
26
|
import "./src/tag/index.mjs";
|
|
27
27
|
import "./src/select/index.mjs";
|
package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
3
|
import { useFormItem as t } from "../form/use-form-item.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
4
|
+
import n from "../../../icons/src/down.vue.mjs";
|
|
5
|
+
import "../../../icons/index.mjs";
|
|
6
|
+
import { SPopover as r } from "../popover/index.mjs";
|
|
7
|
+
import { SInput as i } from "../input/index.mjs";
|
|
8
|
+
import { SEmpty as a } from "../empty/index.mjs";
|
|
9
|
+
import o from "./cascader-column.vue.mjs";
|
|
10
|
+
import { computed as s, createComponent as c, createComponentWithFallback as l, createIf as u, createInvoker as d, createTemplateRefSetter as f, defineVaporComponent as p, delegateEvents as m, mergeModels as h, on as g, onMounted as _, ref as v, renderEffect as y, resolveComponent as b, setClass as x, setInsertionState as S, template as C, toRefs as w, unref as T, useModel as E, useTemplateRef as D, watch as O, withModifiers as k } from "vue";
|
|
8
11
|
//#region ../components/src/cascader/cascader.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
+
var ee = C("<div style=\"padding: 12px\">"), A = C("<div>"), j = C("<div>", 1);
|
|
13
|
+
m("click");
|
|
14
|
+
var M = /*@__PURE__*/ p({
|
|
12
15
|
name: "SCascader",
|
|
13
16
|
__name: "cascader",
|
|
14
|
-
props: /*@__PURE__*/
|
|
17
|
+
props: /*@__PURE__*/ h({
|
|
15
18
|
modelValue: {},
|
|
16
19
|
options: { default: () => [] },
|
|
17
20
|
placeholder: { default: "请选择" },
|
|
@@ -28,6 +31,7 @@ var k = /*@__PURE__*/ d({
|
|
|
28
31
|
size: { default: "medium" },
|
|
29
32
|
error: { type: Boolean },
|
|
30
33
|
disabled: { type: Boolean },
|
|
34
|
+
clearable: { type: Boolean },
|
|
31
35
|
checkStrictly: { type: Boolean },
|
|
32
36
|
multiple: { type: Boolean }
|
|
33
37
|
}, {
|
|
@@ -38,7 +42,7 @@ var k = /*@__PURE__*/ d({
|
|
|
38
42
|
expanded: { default: () => [] },
|
|
39
43
|
expandedModifiers: {}
|
|
40
44
|
}),
|
|
41
|
-
emits: /*@__PURE__*/
|
|
45
|
+
emits: /*@__PURE__*/ h([
|
|
42
46
|
"selectItem",
|
|
43
47
|
"expand",
|
|
44
48
|
"clear"
|
|
@@ -47,107 +51,114 @@ var k = /*@__PURE__*/ d({
|
|
|
47
51
|
"update:expandedKeys",
|
|
48
52
|
"update:expanded"
|
|
49
53
|
]),
|
|
50
|
-
setup(
|
|
51
|
-
let
|
|
52
|
-
size:
|
|
53
|
-
error:
|
|
54
|
-
}),
|
|
54
|
+
setup(p, { emit: m }) {
|
|
55
|
+
let h = p, C = e("cascader"), M = m, N = E(p, "modelValue"), { size: P, error: F } = w(h), { mergedSize: I, mergedError: L } = t({
|
|
56
|
+
size: P,
|
|
57
|
+
error: F
|
|
58
|
+
}), R = E(p, "expandedKeys"), z = E(p, "expanded"), B = s(() => ({
|
|
55
59
|
label: "label",
|
|
56
60
|
key: "key",
|
|
57
61
|
children: "children",
|
|
58
|
-
...
|
|
59
|
-
})),
|
|
60
|
-
|
|
62
|
+
...h.fieldNames
|
|
63
|
+
})), V = v(""), H = ({ item: e, expandeds: t }) => {
|
|
64
|
+
V.value = t.map((e) => e[B.value.label]).join(h.pathSeparator), K(!1), h.pathTextMode ? N.value = t.map((e) => e[B.value.key]).join(h.pathSeparator) : h.pathMode ? N.value = t.map((e) => e[B.value.key]) : N.value = e[B.value.key], M("selectItem", {
|
|
61
65
|
item: e,
|
|
62
66
|
expandeds: t
|
|
63
67
|
});
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
let e = !
|
|
70
|
-
e &&
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
},
|
|
68
|
+
}, U = () => {
|
|
69
|
+
M("expand", R.value);
|
|
70
|
+
}, W = D("popoverRef"), G = v(!1), K = (e) => {
|
|
71
|
+
G.value = e, e ? W.value?.show() : W.value?.hide();
|
|
72
|
+
}, q = () => {
|
|
73
|
+
let e = !G.value;
|
|
74
|
+
e && Z(), K(e);
|
|
75
|
+
}, J = () => {
|
|
76
|
+
K(!1);
|
|
77
|
+
}, Y = (e, t, n = []) => {
|
|
74
78
|
for (let r of e) {
|
|
75
79
|
let e = [...n, r];
|
|
76
|
-
if (r[
|
|
77
|
-
if (r[
|
|
78
|
-
let n =
|
|
80
|
+
if (r[B.value.key] === t) return e;
|
|
81
|
+
if (r[B.value.children]) {
|
|
82
|
+
let n = Y(r[B.value.children], t, e);
|
|
79
83
|
if (n) return n;
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
return null;
|
|
83
|
-
},
|
|
87
|
+
}, X = (e, t) => {
|
|
84
88
|
let n = [], r = e;
|
|
85
89
|
for (let e of t) {
|
|
86
|
-
let t = r.find((t) => t[
|
|
90
|
+
let t = r.find((t) => t[B.value.key] === e);
|
|
87
91
|
if (!t) return null;
|
|
88
|
-
n.push(t), r = t[
|
|
92
|
+
n.push(t), r = t[B.value.children] || [];
|
|
89
93
|
}
|
|
90
94
|
return n;
|
|
91
|
-
},
|
|
92
|
-
if (
|
|
95
|
+
}, Z = () => {
|
|
96
|
+
if (N.value !== void 0) {
|
|
93
97
|
let e = null;
|
|
94
|
-
if (
|
|
95
|
-
let t =
|
|
96
|
-
e =
|
|
97
|
-
} else e = Array.isArray(
|
|
98
|
-
e && (
|
|
98
|
+
if (h.pathTextMode && typeof N.value == "string") {
|
|
99
|
+
let t = N.value.split(h.pathSeparator);
|
|
100
|
+
e = X(h.options, t);
|
|
101
|
+
} else e = Array.isArray(N.value) ? X(h.options, N.value) : Y(h.options, N.value);
|
|
102
|
+
e && (R.value = e.map((e) => e[B.value.key]), z.value = e, V.value = e.map((e) => e[B.value.label]).join(h.pathSeparator));
|
|
99
103
|
}
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}) :
|
|
104
|
-
},
|
|
105
|
-
|
|
104
|
+
}, Q = (e) => {
|
|
105
|
+
N.value === void 0 ? e.forEach((e) => {
|
|
106
|
+
R.value.includes(e[B.value.key]) && (V.value = V.value ? `${V.value}${h.pathSeparator}${e[B.value.label]}` : e[B.value.label], e[B.value.children] && Q(e[B.value.children]));
|
|
107
|
+
}) : Z();
|
|
108
|
+
}, te = () => {
|
|
109
|
+
N.value = "", M("clear");
|
|
106
110
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}),
|
|
110
|
-
|
|
111
|
+
O(N, () => {
|
|
112
|
+
Z();
|
|
113
|
+
}), _(() => {
|
|
114
|
+
Q(h.options);
|
|
111
115
|
});
|
|
112
|
-
let
|
|
113
|
-
return
|
|
116
|
+
let ne = f(), re = b("SIcon"), $ = j();
|
|
117
|
+
return y(() => x($, [T(C).b()])), S($, null, 0), ne(c(T(r), { $: [() => ({
|
|
114
118
|
offset: [0, 4],
|
|
115
119
|
placement: "bottom-start",
|
|
116
120
|
manual: !0,
|
|
117
|
-
...
|
|
118
|
-
}), { onClickOutside: () =>
|
|
121
|
+
...p.popoverProps
|
|
122
|
+
}), { onClickOutside: () => J }] }, {
|
|
119
123
|
content: () => {
|
|
120
|
-
let e =
|
|
121
|
-
return
|
|
122
|
-
let e =
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
124
|
+
let e = A();
|
|
125
|
+
return y(() => x(e, [T(C).e("wrapper")])), S(e, null, 0), u(() => !p.options.length, () => {
|
|
126
|
+
let e = ee();
|
|
127
|
+
return S(e, null, 0), c(T(a)), e;
|
|
128
|
+
}, () => {
|
|
129
|
+
let e = A();
|
|
130
|
+
return y(() => x(e, [T(C).e("panel")])), S(e, null, 0), c(o, {
|
|
131
|
+
expandTrigger: () => p.expandTrigger,
|
|
132
|
+
fieldNames: () => p.fieldNames,
|
|
133
|
+
options: () => p.options,
|
|
134
|
+
onClickItem: () => H,
|
|
135
|
+
onExpand: () => U,
|
|
136
|
+
modelValue: () => N.value,
|
|
137
|
+
"onUpdate:modelValue": () => (e) => N.value = e,
|
|
138
|
+
expanded: () => z.value,
|
|
139
|
+
"onUpdate:expanded": () => (e) => z.value = e,
|
|
140
|
+
expandedKeys: () => R.value,
|
|
141
|
+
"onUpdate:expandedKeys": () => (e) => R.value = e
|
|
135
142
|
}), e;
|
|
136
|
-
}, 261),
|
|
143
|
+
}, 261), g(e, "click", k(() => {}, ["stop"])), e;
|
|
137
144
|
},
|
|
138
|
-
default: () =>
|
|
139
|
-
placeholder: () =>
|
|
140
|
-
disabled: () =>
|
|
141
|
-
error: () =>
|
|
142
|
-
size: () =>
|
|
143
|
-
modelValue: () =>
|
|
144
|
-
"onUpdate:modelValue": () => (e) =>
|
|
145
|
+
default: () => c(T(i), {
|
|
146
|
+
placeholder: () => p.placeholder,
|
|
147
|
+
disabled: () => p.disabled,
|
|
148
|
+
error: () => T(L),
|
|
149
|
+
size: () => T(I),
|
|
150
|
+
modelValue: () => V.value,
|
|
151
|
+
"onUpdate:modelValue": () => (e) => V.value = e,
|
|
145
152
|
readonly: "",
|
|
153
|
+
clearable: () => p.clearable,
|
|
146
154
|
style: "width: 100%",
|
|
147
|
-
onClear: () =>
|
|
148
|
-
})
|
|
149
|
-
|
|
155
|
+
onClear: () => te
|
|
156
|
+
}, { suffix: () => l(re, {
|
|
157
|
+
class: () => [T(C).e("suffix-icon")],
|
|
158
|
+
style: () => ({ transform: G.value ? "rotate(180deg)" : "" })
|
|
159
|
+
}, () => c(T(n))) })
|
|
160
|
+
}), W, null, "popoverRef"), $.$evtclick = d(q), $;
|
|
150
161
|
}
|
|
151
162
|
});
|
|
152
163
|
//#endregion
|
|
153
|
-
export {
|
|
164
|
+
export { M as default };
|
|
@@ -26,6 +26,7 @@ export declare const SCascader: ((__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
|
26
26
|
size?: "mini" | "small" | "medium" | "large" | undefined;
|
|
27
27
|
error?: boolean | undefined;
|
|
28
28
|
disabled?: boolean | undefined;
|
|
29
|
+
clearable?: boolean | undefined;
|
|
29
30
|
checkStrictly?: boolean | undefined;
|
|
30
31
|
multiple?: boolean | undefined;
|
|
31
32
|
expandedKeys?: Array<string | number> | undefined;
|
package/dist/es/components/src/grid/grid-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
3
|
import { gridContextKey as t } from "./types.mjs";
|
|
4
|
-
import { computed as n, createSlot as r, defineVaporComponent as i, inject as a, onMounted as o, onUnmounted as s, renderEffect as c, setClass as l, setInsertionState as u, setStyle as d, template as f, unref as p, useId as m } from "vue";
|
|
4
|
+
import { computed as n, createSlot as r, defineVaporComponent as i, inject as a, onMounted as o, onUnmounted as s, renderEffect as c, setClass as l, setInsertionState as u, setStyle as d, template as f, unref as p, useId as m, watch as h } from "vue";
|
|
5
5
|
//#region ../components/src/grid/grid-item.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var g = f("<div>", 1), _ = /*@__PURE__*/ i({
|
|
7
7
|
name: "SGridItem",
|
|
8
8
|
__name: "grid-item",
|
|
9
9
|
props: {
|
|
@@ -11,29 +11,37 @@ var h = f("<div>", 1), g = /*@__PURE__*/ i({
|
|
|
11
11
|
offset: { default: 0 }
|
|
12
12
|
},
|
|
13
13
|
setup(i) {
|
|
14
|
-
let f = i,
|
|
15
|
-
if (!
|
|
16
|
-
let e =
|
|
14
|
+
let f = i, _ = e("grid-item"), v = "grid-item-" + m(), y = a(t, {}), b = n(() => {
|
|
15
|
+
if (!y?.positionList) return {};
|
|
16
|
+
let e = y?.positionList.value[v];
|
|
17
17
|
return e ? { gridColumn: `${e.start} / ${e.end}` } : {};
|
|
18
|
-
}),
|
|
19
|
-
|
|
18
|
+
}), x = () => {
|
|
19
|
+
y?.addGridItem?.({
|
|
20
20
|
...f,
|
|
21
|
-
uid:
|
|
21
|
+
uid: v
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
o(() => {
|
|
25
|
-
|
|
25
|
+
x();
|
|
26
|
+
}), h(() => ({
|
|
27
|
+
span: f.span,
|
|
28
|
+
offset: f.offset
|
|
29
|
+
}), () => {
|
|
30
|
+
y?.updateGridItem?.({
|
|
31
|
+
...f,
|
|
32
|
+
uid: v
|
|
33
|
+
});
|
|
26
34
|
}), s(() => {
|
|
27
|
-
|
|
35
|
+
y?.removeGridItem?.({
|
|
28
36
|
...f,
|
|
29
|
-
uid:
|
|
37
|
+
uid: v
|
|
30
38
|
});
|
|
31
39
|
});
|
|
32
|
-
let
|
|
40
|
+
let S = g();
|
|
33
41
|
return c(() => {
|
|
34
|
-
l(
|
|
35
|
-
}), u(
|
|
42
|
+
l(S, [p(_).b()]), d(S, b.value);
|
|
43
|
+
}), u(S, null, 0), r(), S;
|
|
36
44
|
}
|
|
37
45
|
});
|
|
38
46
|
//#endregion
|
|
39
|
-
export {
|
|
47
|
+
export { _ as default };
|
|
@@ -24,7 +24,12 @@ var m = f("<div>", 1), h = /*@__PURE__*/ a({
|
|
|
24
24
|
_.value.push(e);
|
|
25
25
|
},
|
|
26
26
|
removeGridItem: (e) => {
|
|
27
|
-
|
|
27
|
+
let t = typeof e == "string" ? e : e.uid;
|
|
28
|
+
_.value = _.value.filter((e) => e.uid !== t);
|
|
29
|
+
},
|
|
30
|
+
updateGridItem: (e) => {
|
|
31
|
+
let t = _.value.findIndex((t) => t.uid === e.uid);
|
|
32
|
+
t !== -1 && (_.value[t] = e);
|
|
28
33
|
},
|
|
29
34
|
positionList: r(() => {
|
|
30
35
|
let e = 1, t = {}, n = y.value;
|
|
@@ -38,6 +38,7 @@ export interface GridChildren {
|
|
|
38
38
|
export interface GridContext {
|
|
39
39
|
addGridItem?: (item: any) => void;
|
|
40
40
|
removeGridItem?: (item: any) => void;
|
|
41
|
+
updateGridItem?: (item: any) => void;
|
|
41
42
|
positionList?: ComputedRef<Record<string, {
|
|
42
43
|
start: number;
|
|
43
44
|
end: number;
|
package/dist/es/components/src/menu/menu-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
3
|
import { STooltip as t } from "../tooltip/index.mjs";
|
|
4
4
|
import { menuContextKey as n, menuLevelContextKey as r, subMenuContextKey as i } from "./types.mjs";
|
|
5
|
-
import { child as a, createComponent as o, createIf as s, createInvoker as c, createSlot as l, defineVaporComponent as u, delegateEvents as d, inject as f,
|
|
5
|
+
import { child as a, createComponent as o, createIf as s, createInvoker as c, createSlot as l, defineVaporComponent as u, delegateEvents as d, inject as f, onMounted as p, renderEffect as m, setClass as h, setInsertionState as g, setStaticTemplateRef as _, setText as v, template as y, toDisplayString as b, unref as x, useTemplateRef as S } from "vue";
|
|
6
6
|
//#region ../components/src/menu/menu-item.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
7
|
-
var w =
|
|
7
|
+
var C = y("<div>"), w = y(" "), T = y("<div><div></div></div>"), E = y("<div><div>"), D = y("<div>", 1);
|
|
8
8
|
d("click");
|
|
9
9
|
var O = /*@__PURE__*/ u({
|
|
10
10
|
name: "SMenuItem",
|
|
@@ -16,54 +16,63 @@ var O = /*@__PURE__*/ u({
|
|
|
16
16
|
activePosition: { default: "center" },
|
|
17
17
|
item: {}
|
|
18
18
|
},
|
|
19
|
-
setup(u) {
|
|
20
|
-
let
|
|
21
|
-
|
|
19
|
+
setup(u, { slots: d }) {
|
|
20
|
+
let y = u, O = e("menu"), k = S("itemRef"), A = f(n, void 0), j = f(i, void 0), M = f(r, void 0), N = () => {
|
|
21
|
+
A?.itemClick(y.name, y.item), j?.outsideClick();
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
p(() => {
|
|
24
|
+
j?.registerDescendant(y.name), M || k.value?.style.setProperty("--s-menu-level", "0");
|
|
25
25
|
});
|
|
26
|
-
let
|
|
27
|
-
return
|
|
26
|
+
let P = D();
|
|
27
|
+
return m(() => {
|
|
28
|
+
let e = x(O);
|
|
29
|
+
h(P, [e.e("item"), e.is("collapse", x(A)?.isCollapsed.value)]);
|
|
30
|
+
}), g(P, null, 0), s(() => x(A)?.collapsed.value && !x(j), () => o(x(t), {
|
|
28
31
|
mini: "",
|
|
29
32
|
"popover-props": { placement: "right" }
|
|
30
33
|
}, {
|
|
31
34
|
content: () => l("default", null, () => {
|
|
32
35
|
let e = w();
|
|
33
|
-
return
|
|
36
|
+
return m(() => v(e, b(u.title))), e;
|
|
34
37
|
}, 4),
|
|
35
38
|
default: () => {
|
|
36
|
-
let e = T(), t = a(e
|
|
37
|
-
return
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
])
|
|
46
|
-
}),
|
|
39
|
+
let e = T(), t = a(e, 1);
|
|
40
|
+
return m(() => {
|
|
41
|
+
let t = x(O), n = x(A), r = u.name, i = u.activePosition, a = n.activeKey;
|
|
42
|
+
h(e, [
|
|
43
|
+
t.e("item-title"),
|
|
44
|
+
t.is("disabled", u.disabled),
|
|
45
|
+
t.is("active", a.value === r && i === "center"),
|
|
46
|
+
t.is("active-left", a.value === r && i === "left"),
|
|
47
|
+
t.is("active-right", a.value === r && i === "right")
|
|
48
|
+
]);
|
|
49
|
+
}), g(e, 0, 0), s(() => d.icon, () => {
|
|
50
|
+
let e = C();
|
|
51
|
+
return m(() => h(e, [x(O).e("item-icon")])), g(e, null, 0), l("icon"), e;
|
|
52
|
+
}), m(() => h(t, [x(O).e("item-label")])), g(t, null, 0), l("default", null, () => {
|
|
47
53
|
let e = w();
|
|
48
|
-
return
|
|
49
|
-
}), e.$evtclick = c(
|
|
54
|
+
return m(() => v(e, b(u.title))), e;
|
|
55
|
+
}), e.$evtclick = c(N), e;
|
|
50
56
|
}
|
|
51
57
|
}), () => {
|
|
52
|
-
let e = E(), t = a(e
|
|
53
|
-
return
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
])
|
|
62
|
-
}),
|
|
58
|
+
let e = E(), t = a(e, 1);
|
|
59
|
+
return m(() => {
|
|
60
|
+
let t = x(O), n = x(A), r = u.name, i = u.activePosition, a = n.activeKey;
|
|
61
|
+
h(e, [
|
|
62
|
+
t.e("item-title"),
|
|
63
|
+
t.is("disabled", u.disabled),
|
|
64
|
+
t.is("active", a.value === r && i === "center"),
|
|
65
|
+
t.is("active-left", a.value === r && i === "left"),
|
|
66
|
+
t.is("active-right", a.value === r && i === "right")
|
|
67
|
+
]);
|
|
68
|
+
}), g(e, 0, 0), s(() => d.icon, () => {
|
|
69
|
+
let e = C();
|
|
70
|
+
return m(() => h(e, [x(O).e("item-icon")])), g(e, null, 0), l("icon"), e;
|
|
71
|
+
}), m(() => h(t, [x(O).e("item-label")])), g(t, null, 0), l("default", null, () => {
|
|
63
72
|
let e = w();
|
|
64
|
-
return
|
|
65
|
-
}), e.$evtclick = c(
|
|
66
|
-
},
|
|
73
|
+
return m(() => v(e, b(u.title))), e;
|
|
74
|
+
}), e.$evtclick = c(N), e;
|
|
75
|
+
}, 517), _(P, k, null, "itemRef"), P;
|
|
67
76
|
}
|
|
68
77
|
});
|
|
69
78
|
//#endregion
|