savor-ui 0.24.1 → 0.26.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 +29 -0
- package/dist/es/components/src/alert/alert.vue.mjs +1 -1
- package/dist/es/components/src/alert/index.d.ts +1 -1
- package/dist/es/components/src/alert/types.d.ts +1 -1
- package/dist/es/components/src/drawer/drawer.vue.mjs +97 -93
- package/dist/es/components/src/grid/grid.vue.mjs +2 -2
- package/dist/es/components/src/layer/layer.d.ts +1 -0
- package/dist/es/components/src/layer/layer.vue.mjs +72 -71
- package/dist/es/components/src/menu/index.d.ts +1 -0
- package/dist/es/components/src/menu/sub-menu.vue.mjs +17 -4
- package/dist/es/components/src/menu/types.d.ts +2 -0
- package/dist/es/components/src/modal/index.d.ts +0 -1
- package/dist/es/components/src/modal/method.mjs +24 -20
- package/dist/es/components/src/modal/modal.vue.mjs +136 -139
- package/dist/es/components/src/modal/types.d.ts +0 -2
- package/dist/es/components/src/segmented/index.d.ts +1 -0
- package/dist/es/components/src/segmented/segmented.vue.mjs +5 -3
- package/dist/es/components/src/segmented/types.d.ts +2 -0
- package/dist/es/components/src/table/index.d.ts +1 -0
- package/dist/es/components/src/table/table.vue.mjs +4 -2
- package/dist/es/components/src/table/types.d.ts +2 -0
- package/dist/es/components/src/tree/tree.vue.mjs +1 -0
- package/dist/es/components/src/tree/types.d.ts +3 -1
- package/dist/es/theme/components/alert.scss +11 -0
- package/dist/es/theme/components/menu.scss +16 -0
- package/dist/es/theme/components/modal.scss +4 -9
- package/dist/es/theme/components/overflow-list.scss +2 -1
- package/dist/es/theme/components/segmented.scss +11 -0
- package/dist/es/theme/components/table.scss +4 -8
- package/dist/es/theme/components/tree.scss +1 -0
- package/dist/es/utils/src/theme/themeMap.mjs +6 -6
- package/dist/json/vetur-attributes.json +12 -4
- package/dist/json/vetur-tags.json +5 -3
- package/dist/json/web-types.json +26 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
# [0.26.0](https://gitee.com/mach552/savor-ui/compare/v0.25.0...v0.26.0) (2026-08-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **grid:** 修复最后一个元素没有间距的问题 ([6b3ea38](https://gitee.com/mach552/savor-ui/commits/6b3ea380c395233cc16f24e9c48b36cb46308fc6))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **segmented:** 新增组件级禁用属性 ([ff42c0e](https://gitee.com/mach552/savor-ui/commits/ff42c0eecdf1b8600ba384ce6075457a9672c263))
|
|
16
|
+
* **tree:** 新增`raw`属性引用原始数据 ([9198851](https://gitee.com/mach552/savor-ui/commits/9198851f3db4219ab8e4cc0f336b50c601ef58b1))
|
|
17
|
+
|
|
18
|
+
# [0.25.0](https://gitee.com/mach552/savor-ui/compare/v0.24.1...v0.25.0) (2026-08-26)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **drawer:** 修复关闭后残留容器的问题 ([1c43039](https://gitee.com/mach552/savor-ui/commits/1c43039ba11a238792f97ea6476f00bac43c6525))
|
|
24
|
+
* **layer:** 修复关闭后残留dom的问题 ([9f5c9b1](https://gitee.com/mach552/savor-ui/commits/9f5c9b1bd818f61b81ef4af8aefaca2bc6c66142))
|
|
25
|
+
* **modal:** 修复关闭后残留容器的问题 ([ad03c4e](https://gitee.com/mach552/savor-ui/commits/ad03c4eaf1fd4d9879d7416a73262dc2756c686c))
|
|
26
|
+
* **modal:** 修复关闭后残留dom的问题 ([ffa81ef](https://gitee.com/mach552/savor-ui/commits/ffa81ef169c1a6bb67fadf0da3a72c397a7cb8e5))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **alert:** 新增自动高度 ([4527058](https://gitee.com/mach552/savor-ui/commits/4527058c5de9ffb82a01eefd31d3a4b0cd256d8f))
|
|
32
|
+
* **table:** 新增表头背景色属性 ([d9c304f](https://gitee.com/mach552/savor-ui/commits/d9c304ff96c09118238be1328e7a6bda496f52ba))
|
|
33
|
+
|
|
5
34
|
## [0.24.1](https://gitee.com/mach552/savor-ui/compare/v0.24.0...v0.24.1) (2026-08-24)
|
|
6
35
|
|
|
7
36
|
|
|
@@ -7,7 +7,7 @@ export declare const SAlert: ((__VLS_props: NonNullable<Awaited<typeof __VLS_set
|
|
|
7
7
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
8
|
props: PublicProps & {
|
|
9
9
|
type?: "default" | "primary" | "success" | "warning" | "danger" | "info" | undefined;
|
|
10
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
10
|
+
size?: "small" | "medium" | "large" | "auto" | undefined;
|
|
11
11
|
showIcon?: boolean | undefined;
|
|
12
12
|
title?: string | undefined;
|
|
13
13
|
content?: string | undefined;
|
|
@@ -8,14 +8,14 @@ import { CloseLine as i } from "../../../icons/src/svg/system/index.mjs";
|
|
|
8
8
|
import a from "../button/button.vue.mjs";
|
|
9
9
|
import o from "../scrollbar/scrollbar.vue.mjs";
|
|
10
10
|
import { STransition as s } from "../transition/index.mjs";
|
|
11
|
-
import { VaporTeleport as
|
|
11
|
+
import { VaporTeleport as ee, applyVShow as c, child as l, computed as u, createComponent as d, createIf as f, createInvoker as p, createSlot as m, createTemplateRefSetter as te, defineVaporComponent as h, delegateEvents as g, mergeModels as _, nextTick as v, onMounted as ne, onUnmounted as re, ref as y, renderEffect as b, setClass as x, setInsertionState as S, setStyle as C, setText as w, template as T, toDisplayString as E, txt as D, unref as O, useModel as ie, watch as k, watchEffect as A } from "vue";
|
|
12
12
|
//#region ../components/src/drawer/drawer.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var N = /*@__PURE__*/
|
|
13
|
+
var j = T("<div>"), ae = T("<div> "), oe = T("<div><div> </div>"), se = T("<div><div><div></div>");
|
|
14
|
+
g("click", "mousedown");
|
|
15
|
+
var M = 500, N = /*@__PURE__*/ h({
|
|
16
16
|
name: "SDrawer",
|
|
17
17
|
__name: "drawer",
|
|
18
|
-
props: /*@__PURE__*/
|
|
18
|
+
props: /*@__PURE__*/ _({
|
|
19
19
|
modelValue: { type: Boolean },
|
|
20
20
|
closeOnEsc: {
|
|
21
21
|
type: Boolean,
|
|
@@ -65,7 +65,7 @@ var N = /*@__PURE__*/ g({
|
|
|
65
65
|
},
|
|
66
66
|
modelModifiers: {}
|
|
67
67
|
}),
|
|
68
|
-
emits: /*@__PURE__*/
|
|
68
|
+
emits: /*@__PURE__*/ _([
|
|
69
69
|
"esc",
|
|
70
70
|
"maskClick",
|
|
71
71
|
"open",
|
|
@@ -73,45 +73,47 @@ var N = /*@__PURE__*/ g({
|
|
|
73
73
|
"close",
|
|
74
74
|
"closed"
|
|
75
75
|
], ["update:modelValue"]),
|
|
76
|
-
setup(
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
setup(h, { emit: g }) {
|
|
77
|
+
let _ = h, T = g, N = t("drawer"), { nextZIndex: ce } = r(), P = y(0), { lockScroll: le, unlockScroll: ue } = n(), F = ie(h, "modelValue"), I = y(!1), L = y(!1), R = y(!1), z = y(""), B = y("");
|
|
78
|
+
A(() => {
|
|
79
|
+
z.value = e(_.width), B.value = e(_.height);
|
|
80
80
|
});
|
|
81
|
-
let
|
|
82
|
-
zIndex:
|
|
83
|
-
position:
|
|
84
|
-
})),
|
|
85
|
-
let e = { ...
|
|
86
|
-
return (
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
Z.value && (Z.value.style.transition = "", Z.value.style.transform = ""),
|
|
92
|
-
});
|
|
81
|
+
let de = u(() => ({
|
|
82
|
+
zIndex: P.value,
|
|
83
|
+
position: _.to === "body" ? "fixed" : "absolute"
|
|
84
|
+
})), V = u(() => {
|
|
85
|
+
let e = { ..._.drawerStyle };
|
|
86
|
+
return (_.placement === "left" || _.placement === "right") && (e.width = z.value), (_.placement === "top" || _.placement === "bottom") && (e.height = B.value), e;
|
|
87
|
+
}), fe = () => {
|
|
88
|
+
T("opened");
|
|
89
|
+
}, H = null, U = !0, W = () => {
|
|
90
|
+
H &&= (clearTimeout(H), null), !U && (U = !0, L.value = !1, T("closed"), v(() => {
|
|
91
|
+
Z.value && (Z.value.style.transition = "", Z.value.style.transform = ""), ue();
|
|
92
|
+
}));
|
|
93
|
+
}, pe = () => {
|
|
94
|
+
W();
|
|
93
95
|
}, G = () => {
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
e.preventDefault(),
|
|
96
|
+
F.value = !1, T("close");
|
|
97
|
+
}, me = () => {
|
|
98
|
+
_.closeOnMask && (G(), T("maskClick"));
|
|
99
|
+
}, he = (e) => {
|
|
100
|
+
e.preventDefault(), R.value = !0;
|
|
99
101
|
}, K = (e) => {
|
|
100
|
-
if (
|
|
101
|
-
if (
|
|
102
|
+
if (R.value) {
|
|
103
|
+
if (_.placement === "right" && (z.value = X(window.innerWidth - e.clientX, _.minWidth, _.maxWidth, !0), $(z.value, !0)), _.placement === "left") {
|
|
102
104
|
let t = e.clientX;
|
|
103
|
-
|
|
105
|
+
z.value = X(t, _.minWidth, _.maxWidth, !0), $(z.value, !0);
|
|
104
106
|
}
|
|
105
|
-
if (
|
|
107
|
+
if (_.placement === "bottom" && (B.value = X(window.innerHeight - e.clientY, _.minHeight, _.maxHeight, !1), $(B.value, !0)), _.placement === "top") {
|
|
106
108
|
let t = e.clientY;
|
|
107
|
-
|
|
109
|
+
B.value = X(t, _.minHeight, _.maxHeight, !1), $(B.value, !0);
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
}, q = () => {
|
|
111
|
-
|
|
113
|
+
R.value &&= !1;
|
|
112
114
|
}, J = (e) => {
|
|
113
|
-
e.key === "Escape" &&
|
|
114
|
-
},
|
|
115
|
+
e.key === "Escape" && _.closeOnEsc && F.value && (G(), T("esc"));
|
|
116
|
+
}, ge = (e) => {
|
|
115
117
|
let t = String(e).trim().match(/^(\d*\.?\d+)(.*)$/);
|
|
116
118
|
return t ? {
|
|
117
119
|
num: parseFloat(t[1]),
|
|
@@ -121,7 +123,7 @@ var N = /*@__PURE__*/ g({
|
|
|
121
123
|
unit: "px"
|
|
122
124
|
};
|
|
123
125
|
}, Y = (e, t) => {
|
|
124
|
-
let { num: n, unit: r } =
|
|
126
|
+
let { num: n, unit: r } = ge(e), i = t ? window.innerWidth : window.innerHeight;
|
|
125
127
|
switch (r) {
|
|
126
128
|
case "%":
|
|
127
129
|
case "vw":
|
|
@@ -132,80 +134,82 @@ var N = /*@__PURE__*/ g({
|
|
|
132
134
|
}, X = (e, t, n, r) => {
|
|
133
135
|
let i = Y(t, r), a = Y(n, r);
|
|
134
136
|
return Math.max(i, Math.min(e, a)) + "px";
|
|
135
|
-
}, Z =
|
|
136
|
-
|
|
137
|
+
}, Z = y(null), Q = () => {
|
|
138
|
+
_.to === "body" ? Z.value = document.querySelector("#app") : _.to instanceof HTMLElement ? Z.value = _.to : typeof _.to == "string" && (Z.value = document.querySelector(_.to));
|
|
137
139
|
}, $ = (e, t) => {
|
|
138
|
-
|
|
140
|
+
_.push && Z.value && (t ? (Z.value.style.transition = "transform 0.3s var(--s-bezier-out)", _.placement === "left" ? Z.value.style.transform = `translateX(${e})` : _.placement === "right" ? Z.value.style.transform = `translateX(-${e})` : _.placement === "top" ? Z.value.style.transform = `translateY(${e})` : _.placement === "bottom" && (Z.value.style.transform = `translateY(-${e})`)) : (Z.value.style.transition = "transform 0.3s var(--s-bezier-in)", Z.value.style.transform = "translate(0,0)"));
|
|
139
141
|
};
|
|
140
|
-
|
|
141
|
-
e ? (
|
|
142
|
-
|
|
143
|
-
})) : (
|
|
144
|
-
|
|
142
|
+
k(() => _.to, Q), k(() => F.value, (e) => {
|
|
143
|
+
e ? (P.value = ce(), le(), L.value = !0, H &&= (clearTimeout(H), null), U = !0, v(() => {
|
|
144
|
+
I.value = !0, _.placement === "left" || _.placement === "right" ? $(V.value.width, !0) : (_.placement === "top" || _.placement === "bottom") && $(V.value.height, !0), _.closeOnEsc && (document.removeEventListener("keydown", J), document.addEventListener("keydown", J)), T("open");
|
|
145
|
+
})) : (I.value = !1, document.removeEventListener("keydown", J), $("0", !1), U = !1, H = setTimeout(() => {
|
|
146
|
+
H = null, W();
|
|
147
|
+
}, M));
|
|
148
|
+
}, { immediate: !0 }), k(() => _.resizable, (e) => {
|
|
145
149
|
e ? (window.addEventListener("mousemove", K), window.addEventListener("mouseup", q)) : (window.removeEventListener("mousemove", K), window.removeEventListener("mouseup", q));
|
|
146
|
-
}, { immediate: !0 }),
|
|
150
|
+
}, { immediate: !0 }), ne(() => {
|
|
147
151
|
Q();
|
|
148
|
-
}),
|
|
149
|
-
document.removeEventListener("keydown", J), window.removeEventListener("mousemove", K), window.removeEventListener("mouseup", q);
|
|
152
|
+
}), re(() => {
|
|
153
|
+
H &&= (clearTimeout(H), null), U = !0, document.removeEventListener("keydown", J), window.removeEventListener("mousemove", K), window.removeEventListener("mouseup", q);
|
|
150
154
|
});
|
|
151
|
-
let
|
|
152
|
-
return
|
|
153
|
-
to: () =>
|
|
155
|
+
let _e = te();
|
|
156
|
+
return d(ee, {
|
|
157
|
+
to: () => h.to,
|
|
154
158
|
defer: ""
|
|
155
159
|
}, () => {
|
|
156
|
-
let e =
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
}),
|
|
160
|
-
let e =
|
|
161
|
-
return
|
|
162
|
-
|
|
160
|
+
let e = j();
|
|
161
|
+
return b(() => {
|
|
162
|
+
x(e, [O(N).e("container")]), C(e, de.value);
|
|
163
|
+
}), S(e, null, 0), d(O(s), { type: "opacity" }, () => f(() => h.mask, () => {
|
|
164
|
+
let e = j();
|
|
165
|
+
return c(e, () => I.value), e.$evtclick = p(me), b(() => {
|
|
166
|
+
x(e, [O(N).e("mask")]), C(e, h.maskStyle);
|
|
163
167
|
}), e;
|
|
164
|
-
}, null, 129)),
|
|
168
|
+
}, null, 129)), S(e, null, 1), d(O(s), {
|
|
165
169
|
type: "side",
|
|
166
|
-
placement: () =>
|
|
167
|
-
onAfterLeave: () =>
|
|
168
|
-
onAfterEnter: () =>
|
|
170
|
+
placement: () => h.placement,
|
|
171
|
+
onAfterLeave: () => pe,
|
|
172
|
+
onAfterEnter: () => fe
|
|
169
173
|
}, () => {
|
|
170
|
-
let e =
|
|
171
|
-
return
|
|
172
|
-
let t =
|
|
173
|
-
|
|
174
|
-
}),
|
|
175
|
-
let e =
|
|
176
|
-
return e.$evtmousedown =
|
|
177
|
-
let t =
|
|
178
|
-
|
|
174
|
+
let e = se(), t = l(e, 1), n = l(t, 1);
|
|
175
|
+
return b(() => {
|
|
176
|
+
let t = O(N);
|
|
177
|
+
x(e, [t.b(), t.m(h.placement)]), C(e, V.value);
|
|
178
|
+
}), S(e, 0, 0), f(() => h.resizable, () => {
|
|
179
|
+
let e = j();
|
|
180
|
+
return e.$evtmousedown = p(he), b(() => {
|
|
181
|
+
let t = O(N);
|
|
182
|
+
x(e, [t.e("trigger"), t.is("dragging", R.value)]);
|
|
179
183
|
}), e;
|
|
180
|
-
}),
|
|
181
|
-
let e =
|
|
182
|
-
return
|
|
183
|
-
let e =
|
|
184
|
-
return
|
|
185
|
-
let r =
|
|
186
|
-
|
|
187
|
-
}),
|
|
188
|
-
let e =
|
|
189
|
-
return
|
|
190
|
-
|
|
184
|
+
}), b(() => x(t, [O(N).e("wrapper")])), S(t, 0, 0), f(() => h.header, () => {
|
|
185
|
+
let e = j();
|
|
186
|
+
return b(() => x(e, [O(N).e("header")])), S(e, null, 0), m("header", null, () => {
|
|
187
|
+
let e = oe(), t = l(e), n = D(t);
|
|
188
|
+
return b(() => {
|
|
189
|
+
let r = O(N);
|
|
190
|
+
x(e, [r.e("title")]), x(t, r.e("title-text")), w(n, E(h.title));
|
|
191
|
+
}), S(e, null, 1), f(() => h.desc, () => {
|
|
192
|
+
let e = ae(), t = D(e);
|
|
193
|
+
return b(() => {
|
|
194
|
+
x(e, O(N).e("title-desc")), w(t, E(h.desc));
|
|
191
195
|
}), e;
|
|
192
196
|
}), e;
|
|
193
|
-
}),
|
|
197
|
+
}), S(e, null, 1), f(() => h.closable, () => d(a, {
|
|
194
198
|
circle: "",
|
|
195
199
|
text: "",
|
|
196
200
|
size: "small",
|
|
197
201
|
onClick: () => G
|
|
198
|
-
}, { icon: () =>
|
|
199
|
-
}),
|
|
200
|
-
let e =
|
|
201
|
-
return
|
|
202
|
-
|
|
203
|
-
}),
|
|
204
|
-
}, 1541),
|
|
205
|
-
let e =
|
|
206
|
-
return
|
|
207
|
-
}),
|
|
208
|
-
}),
|
|
202
|
+
}, { icon: () => d(O(i)) })), e;
|
|
203
|
+
}), b(() => x(n, [O(N).e("body")])), S(n, null, 0), f(() => h.scrollContent, () => d(o, { $: [() => ({ ...h.scrollbarProps })] }, () => m("default", null, null, 4)), () => {
|
|
204
|
+
let e = j();
|
|
205
|
+
return b(() => {
|
|
206
|
+
x(e, [O(N).e("content")]), C(e, h.bodyStyle);
|
|
207
|
+
}), S(e, null, 0), m(), e;
|
|
208
|
+
}, 1541), S(t, null, 2), f(() => h.footer, () => {
|
|
209
|
+
let e = j();
|
|
210
|
+
return b(() => x(e, [O(N).e("footer")])), S(e, null, 0), m("footer"), e;
|
|
211
|
+
}), c(e, () => I.value), e;
|
|
212
|
+
}), c(e, () => L.value), _e(e, "drawerContainerRef"), e;
|
|
209
213
|
}, !0);
|
|
210
214
|
}
|
|
211
215
|
});
|
|
@@ -37,12 +37,12 @@ var m = f("<div>", 1), h = /*@__PURE__*/ a({
|
|
|
37
37
|
for (let i = 0; i < r.length; i++) {
|
|
38
38
|
let { uid: a, span: o = 1, offset: s = 0 } = r[i], c = e + s, l = c + o;
|
|
39
39
|
l > n + 1 && (e = 1, c = e + s, l = c + o);
|
|
40
|
-
let u = c - s === 1, d =
|
|
40
|
+
let u = c - s === 1, d = l >= n + 1;
|
|
41
41
|
t[a] = {
|
|
42
42
|
start: c,
|
|
43
43
|
end: l,
|
|
44
44
|
isFirst: u,
|
|
45
|
-
isLast:
|
|
45
|
+
isLast: d
|
|
46
46
|
}, e = l;
|
|
47
47
|
}
|
|
48
48
|
return t;
|
|
@@ -13,6 +13,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
13
13
|
handleCancel: () => void;
|
|
14
14
|
handleRestore: () => void;
|
|
15
15
|
pageContentRef: Readonly< ShallowRef<HTMLDivElement | null, HTMLDivElement | null>>;
|
|
16
|
+
containerRef: Readonly< ShallowRef<HTMLDivElement | null, HTMLDivElement | null>>;
|
|
16
17
|
}>) => void;
|
|
17
18
|
attrs: any;
|
|
18
19
|
slots: {
|
|
@@ -93,12 +93,12 @@ var D = /*@__PURE__*/ f({
|
|
|
93
93
|
}),
|
|
94
94
|
emits: ["update:modelValue"],
|
|
95
95
|
setup(f, { expose: p }) {
|
|
96
|
-
let m = f, S = n("layer"), { lockScroll: D, unlockScroll: O } = te(), { zIndex: k } = ne(), A = T("layerRef"), j = T("headerRef"), M = T("pageContentRef"), N =
|
|
96
|
+
let m = f, S = n("layer"), { lockScroll: D, unlockScroll: O } = te(), { zIndex: k } = ne(), A = T("layerRef"), j = T("headerRef"), M = T("pageContentRef"), N = T("containerRef"), P = ge(f, "modelValue"), F = g(!1), I = g(!1), L = g(!1), R = g(!1), z = g(!1), B = g(!1), V = g(0), H = g(0), U = g(0), W = g(0), G = g(0), K = g(0), q = c(() => typeof m.to == "string" ? document.querySelector(m.to) || document.body : m.to), we = c(() => ({
|
|
97
97
|
zIndex: m.zIndex ?? k.value,
|
|
98
|
-
position:
|
|
98
|
+
position: q.value === document.body ? "fixed" : "absolute"
|
|
99
99
|
})), Te = c(() => {
|
|
100
|
-
if (
|
|
101
|
-
if (Z.value && m.minAnimate) return
|
|
100
|
+
if (L.value) return {};
|
|
101
|
+
if (Z.value && m.minAnimate) return R.value ? {
|
|
102
102
|
width: `${Q.value.width}px`,
|
|
103
103
|
height: `${Q.value.height}px`,
|
|
104
104
|
top: `${m.minOrigin.y}px`,
|
|
@@ -110,8 +110,8 @@ var D = /*@__PURE__*/ f({
|
|
|
110
110
|
} : {
|
|
111
111
|
width: `${Q.value.width}px`,
|
|
112
112
|
height: `${Q.value.height}px`,
|
|
113
|
-
top: `${
|
|
114
|
-
left: `${
|
|
113
|
+
top: `${U.value}px`,
|
|
114
|
+
left: `${W.value}px`,
|
|
115
115
|
transform: "scale(1)",
|
|
116
116
|
opacity: 1,
|
|
117
117
|
transformOrigin: "bottom center",
|
|
@@ -119,101 +119,102 @@ var D = /*@__PURE__*/ f({
|
|
|
119
119
|
};
|
|
120
120
|
let t = typeof m.size == "string" ? m.size : m.size[0], n = typeof m.size == "string" ? m.size : m.size[1];
|
|
121
121
|
return {
|
|
122
|
-
width:
|
|
123
|
-
height:
|
|
124
|
-
top: `${
|
|
125
|
-
left: `${
|
|
126
|
-
maxHeight:
|
|
122
|
+
width: V.value ? `${V.value}px` : e(t),
|
|
123
|
+
height: H.value ? `${H.value}px` : e(n),
|
|
124
|
+
top: `${U.value}px`,
|
|
125
|
+
left: `${W.value}px`,
|
|
126
|
+
maxHeight: G.value ? `${G.value - 40}px` : void 0,
|
|
127
127
|
borderRadius: `${m.radius}px`
|
|
128
128
|
};
|
|
129
129
|
}), Ee = () => {
|
|
130
130
|
m.opened?.();
|
|
131
131
|
}, De = () => {
|
|
132
|
-
|
|
132
|
+
I.value = !1, z.value = !1, B.value = !1, h(O), m.closed?.();
|
|
133
133
|
}, Oe = () => {
|
|
134
|
-
m.closeOnOverlayClick &&
|
|
135
|
-
},
|
|
136
|
-
e ?
|
|
134
|
+
m.closeOnOverlayClick && Y();
|
|
135
|
+
}, J = (e) => {
|
|
136
|
+
e ? P.value = !1 : z.value = !1;
|
|
137
137
|
}, ke = () => {
|
|
138
|
-
m.yes ? (
|
|
139
|
-
},
|
|
140
|
-
|
|
138
|
+
m.yes ? (z.value = !0, m.yes(J)) : J(!0);
|
|
139
|
+
}, Y = () => {
|
|
140
|
+
P.value = !1, m.cancel?.();
|
|
141
141
|
}, Ae = (e) => {
|
|
142
142
|
e === 0 ? m.btn1?.() : e === 1 ? m.btn2?.() : e === 2 && m.btn3?.();
|
|
143
143
|
}, je = () => {
|
|
144
|
-
|
|
144
|
+
P.value = !0;
|
|
145
145
|
}, Me = () => {
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
e.key === "Escape" && m.closeOnEsc &&
|
|
149
|
-
},
|
|
150
|
-
if (await h(), !A.value ||
|
|
146
|
+
L.value = !L.value;
|
|
147
|
+
}, X = (e) => {
|
|
148
|
+
e.key === "Escape" && m.closeOnEsc && F.value && (m.zIndex ?? k.value) >= k.value && Y();
|
|
149
|
+
}, Ne = async () => {
|
|
150
|
+
if (await h(), !A.value || B.value) return;
|
|
151
151
|
let e = A.value;
|
|
152
|
-
|
|
153
|
-
},
|
|
152
|
+
U.value = Math.max(0, (G.value - e.offsetHeight) / 2), W.value = Math.max(0, (K.value - e.offsetWidth) / 2);
|
|
153
|
+
}, Pe = () => {
|
|
154
154
|
m.click?.();
|
|
155
155
|
};
|
|
156
|
-
_e(
|
|
156
|
+
_e(P, async (e) => {
|
|
157
157
|
if (e) {
|
|
158
|
-
if (m.hiddenBodyScrollbar && D(),
|
|
159
|
-
|
|
160
|
-
} else
|
|
158
|
+
if (m.hiddenBodyScrollbar && D(), I.value = !0, await h(), !P.value) return;
|
|
159
|
+
F.value = !0, Ne();
|
|
160
|
+
} else F.value = !1;
|
|
161
161
|
}, { immediate: !0 }), ve((e) => {
|
|
162
|
-
|
|
162
|
+
F.value && (document.addEventListener("keydown", X), e(() => document.removeEventListener("keydown", X)));
|
|
163
163
|
});
|
|
164
164
|
let Z = g(!1), Q = g({
|
|
165
165
|
top: 0,
|
|
166
166
|
left: 0,
|
|
167
167
|
width: 0,
|
|
168
168
|
height: 0
|
|
169
|
-
}),
|
|
169
|
+
}), Fe = () => {
|
|
170
170
|
if (!A.value) return;
|
|
171
171
|
let e = A.value.getBoundingClientRect();
|
|
172
172
|
Q.value = {
|
|
173
|
-
top:
|
|
174
|
-
left:
|
|
173
|
+
top: U.value,
|
|
174
|
+
left: W.value,
|
|
175
175
|
width: e.width,
|
|
176
176
|
height: e.height
|
|
177
|
-
},
|
|
178
|
-
},
|
|
177
|
+
}, R.value = !0, Z.value = !0;
|
|
178
|
+
}, Ie = () => {
|
|
179
179
|
if (!m.minAnimate) {
|
|
180
|
-
|
|
180
|
+
R.value = !1, Z.value = !1;
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
U.value = Q.value.top, W.value = Q.value.left, V.value = 0, H.value = 0, R.value = !1, setTimeout(() => {
|
|
184
184
|
Z.value = !1;
|
|
185
185
|
}, 300);
|
|
186
|
-
}, { minWidth:
|
|
187
|
-
ee(
|
|
188
|
-
let e =
|
|
189
|
-
|
|
186
|
+
}, { minWidth: Le, minHeight: Re, maxWidth: ze, maxHeight: Be } = me(m);
|
|
187
|
+
ee(q, () => {
|
|
188
|
+
let e = q.value;
|
|
189
|
+
G.value = e.clientHeight, K.value = e.clientWidth, Ne();
|
|
190
190
|
}), r({
|
|
191
191
|
target: A,
|
|
192
|
-
container:
|
|
193
|
-
enable: c(() => m.resizable && !
|
|
194
|
-
minWidth:
|
|
195
|
-
minHeight:
|
|
196
|
-
maxWidth:
|
|
197
|
-
maxHeight:
|
|
198
|
-
divWidth:
|
|
199
|
-
divHeight:
|
|
200
|
-
divTop:
|
|
201
|
-
divLeft:
|
|
192
|
+
container: q,
|
|
193
|
+
enable: c(() => m.resizable && !L.value && !R.value),
|
|
194
|
+
minWidth: Le,
|
|
195
|
+
minHeight: Re,
|
|
196
|
+
maxWidth: ze,
|
|
197
|
+
maxHeight: Be,
|
|
198
|
+
divWidth: V,
|
|
199
|
+
divHeight: H,
|
|
200
|
+
divTop: U,
|
|
201
|
+
divLeft: W
|
|
202
202
|
}), t({
|
|
203
203
|
container: A,
|
|
204
204
|
target: j,
|
|
205
|
-
parent:
|
|
206
|
-
enable: c(() => m.draggable && !
|
|
207
|
-
divLeft:
|
|
208
|
-
divTop:
|
|
209
|
-
hasDragged:
|
|
205
|
+
parent: q,
|
|
206
|
+
enable: c(() => m.draggable && !L.value && !R.value),
|
|
207
|
+
divLeft: W,
|
|
208
|
+
divTop: U,
|
|
209
|
+
hasDragged: B
|
|
210
210
|
}), fe(() => {
|
|
211
211
|
m.hiddenBodyScrollbar && O();
|
|
212
212
|
}), p({
|
|
213
213
|
handleOpen: je,
|
|
214
|
-
handleCancel:
|
|
215
|
-
handleRestore:
|
|
216
|
-
pageContentRef: M
|
|
214
|
+
handleCancel: Y,
|
|
215
|
+
handleRestore: Ie,
|
|
216
|
+
pageContentRef: M,
|
|
217
|
+
containerRef: N
|
|
217
218
|
});
|
|
218
219
|
let $ = de();
|
|
219
220
|
return l(ce, {
|
|
@@ -223,7 +224,7 @@ var D = /*@__PURE__*/ f({
|
|
|
223
224
|
let e = Ce(), t = s(e, 1);
|
|
224
225
|
return _(() => {
|
|
225
226
|
v(e, [w(S).e("container")]), b(e, we.value);
|
|
226
|
-
}), y(e, 0, 0), l(w(a), { type: "opacity" }, () => u(() => f.showMask &&
|
|
227
|
+
}), y(e, 0, 0), l(w(a), { type: "opacity" }, () => u(() => f.showMask && F.value && !L.value && !R.value, () => {
|
|
227
228
|
let e = E();
|
|
228
229
|
return e.$evtclick = d(Oe), _(() => {
|
|
229
230
|
b(e, f.maskStyle), v(e, [w(S).e("mask")]);
|
|
@@ -238,8 +239,8 @@ var D = /*@__PURE__*/ f({
|
|
|
238
239
|
let r = w(S);
|
|
239
240
|
v(e, [
|
|
240
241
|
r.b(),
|
|
241
|
-
r.is("max",
|
|
242
|
-
r.is("min",
|
|
242
|
+
r.is("max", L.value),
|
|
243
|
+
r.is("min", R.value)
|
|
243
244
|
]), b(e, Te.value), v(t, [r.e("header")]), v(n, [r.e("title")]);
|
|
244
245
|
}), y(n, null, 0), ue("header", null, () => {
|
|
245
246
|
let e = ye();
|
|
@@ -249,16 +250,16 @@ var D = /*@__PURE__*/ f({
|
|
|
249
250
|
return _(() => v(e, [w(S).e("header-icon")])), y(e, null, 0), u(() => f.maxmin, () => l(w(i), {
|
|
250
251
|
text: "",
|
|
251
252
|
size: "mini",
|
|
252
|
-
onClick: () =>
|
|
253
|
+
onClick: () => Fe
|
|
253
254
|
}, { icon: () => l(w(oe)) })), y(e, null, 1), u(() => f.maxmin, () => l(w(i), {
|
|
254
255
|
text: "",
|
|
255
256
|
size: "mini",
|
|
256
257
|
onClick: () => Me
|
|
257
|
-
}, { icon: () => u(() =>
|
|
258
|
+
}, { icon: () => u(() => L.value, () => l(w(re)), () => l(w(ie)), 901) })), y(e, null, 2), u(() => f.closable, () => l(w(i), {
|
|
258
259
|
text: "",
|
|
259
260
|
size: "mini",
|
|
260
|
-
disabled: () =>
|
|
261
|
-
onClick: () =>
|
|
261
|
+
disabled: () => z.value,
|
|
262
|
+
onClick: () => Y
|
|
262
263
|
}, { icon: () => l(w(ae)) })), e;
|
|
263
264
|
}), $(t, j, null, "headerRef"), y(e, null, 1), u(() => f.type === "page", () => {
|
|
264
265
|
let e = E();
|
|
@@ -280,7 +281,7 @@ var D = /*@__PURE__*/ f({
|
|
|
280
281
|
let e = E();
|
|
281
282
|
return _(() => v(e, [w(S).e("footer")])), y(e, null, 0), u(() => f.yesBtn, () => l(w(i), {
|
|
282
283
|
label: () => f.yesText,
|
|
283
|
-
loading: () =>
|
|
284
|
+
loading: () => z.value,
|
|
284
285
|
type: "primary",
|
|
285
286
|
size: "small",
|
|
286
287
|
onClick: () => ke
|
|
@@ -288,7 +289,7 @@ var D = /*@__PURE__*/ f({
|
|
|
288
289
|
label: () => f.cancelText,
|
|
289
290
|
secondary: "",
|
|
290
291
|
size: "small",
|
|
291
|
-
onClick: () =>
|
|
292
|
+
onClick: () => Y
|
|
292
293
|
})), y(e, null, 2), le(() => f.btn, (e, t) => {
|
|
293
294
|
let n = () => Ae(t.value);
|
|
294
295
|
return l(w(i), {
|
|
@@ -297,8 +298,8 @@ var D = /*@__PURE__*/ f({
|
|
|
297
298
|
onClick: () => n
|
|
298
299
|
});
|
|
299
300
|
}, (e, t) => t, 2), e;
|
|
300
|
-
}), o(e, () =>
|
|
301
|
-
}), o(e, () =>
|
|
301
|
+
}), o(e, () => F.value), e.$evtclick = d(Pe), $(e, A, null, "layerRef"), e;
|
|
302
|
+
}), o(e, () => I.value), $(e, N, null, "containerRef"), e;
|
|
302
303
|
}, !0);
|
|
303
304
|
}
|
|
304
305
|
});
|
|
@@ -91,6 +91,7 @@ export declare const SSubMenu: ((__VLS_props: NonNullable<Awaited<typeof __VLS_s
|
|
|
91
91
|
disabled?: boolean | undefined;
|
|
92
92
|
ignoreLevel?: boolean | undefined;
|
|
93
93
|
icon?: string | undefined;
|
|
94
|
+
activeCenter?: boolean | undefined;
|
|
94
95
|
} & (typeof globalThis extends {
|
|
95
96
|
__VLS_PROPS_FALLBACK: infer P;
|
|
96
97
|
} ? P : {});
|