savor-ui 0.19.0 → 0.20.1
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/src/badge/badge.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -2
- package/dist/es/components/src/drawer/drawer.vue_vue_type_script_setup_true_vapor_true_lang.mjs +94 -87
- package/dist/es/components/src/drawer/index.d.ts +1 -0
- package/dist/es/components/src/drawer/types.d.ts +2 -0
- package/dist/es/components/src/dropdown/doption.vue_vue_type_script_setup_true_vapor_true_lang.mjs +13 -10
- package/dist/es/components/src/dropdown/index.d.ts +1 -0
- package/dist/es/components/src/dropdown/types.d.ts +2 -0
- package/dist/es/components/src/split/split-pane.vue_vue_type_script_setup_true_vapor_true_lang.mjs +11 -4
- package/dist/es/components/src/split/split.vue_vue_type_script_setup_true_vapor_true_lang.mjs +156 -136
- package/dist/es/components/src/split/types.d.ts +1 -0
- package/dist/es/theme/components/button.scss +18 -0
- package/dist/es/theme/components/drawer.scss +13 -0
- package/dist/json/vetur-attributes.json +8 -0
- package/dist/json/vetur-tags.json +3 -1
- package/dist/json/web-types.json +17 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [0.20.1](https://gitee.com/mach552/savor-ui/compare/v0.20.0...v0.20.1) (2026-08-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **button:** 修复悬浮样式无效问题 ([7195db3](https://gitee.com/mach552/savor-ui/commits/7195db3e36eb62737ff6a973e28aa230b07b1968))
|
|
11
|
+
* **split:** 修复面板无法固定尺寸的问题 ([25bda3b](https://gitee.com/mach552/savor-ui/commits/25bda3b26a9b284afd09b39a3eea654eb812e6f6))
|
|
12
|
+
|
|
13
|
+
# [0.20.0](https://gitee.com/mach552/savor-ui/compare/v0.19.0...v0.20.0) (2026-08-10)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **drawer:** 新增`desc`属性 ([28ac722](https://gitee.com/mach552/savor-ui/commits/28ac722dfb797062d01512f79092df889e66a4b8))
|
|
19
|
+
* **dropdown:** 新增延迟关闭属性 ([8a563e1](https://gitee.com/mach552/savor-ui/commits/8a563e1731542bf3297ffa595bd8c7953d48234d))
|
|
20
|
+
|
|
5
21
|
# [0.19.0](https://gitee.com/mach552/savor-ui/compare/v0.18.0...v0.19.0) (2026-08-09)
|
|
6
22
|
|
|
7
23
|
|
package/dist/es/components/src/badge/badge.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -13,8 +13,8 @@ var m = u("<div>"), h = u("<div> "), g = u("<div>", 1), _ = /*@__PURE__*/ i({
|
|
|
13
13
|
},
|
|
14
14
|
setup(i, { slots: u }) {
|
|
15
15
|
let _ = i, v = e("badge"), y = t(() => ({
|
|
16
|
-
height: "
|
|
17
|
-
width: "
|
|
16
|
+
height: "6px",
|
|
17
|
+
width: "6px",
|
|
18
18
|
..._.dotStyle
|
|
19
19
|
})), b = t(() => _.max && _.count > _.max ? `${_.max}+` : _.count), x = g();
|
|
20
20
|
return a(() => {
|
package/dist/es/components/src/drawer/drawer.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -7,16 +7,16 @@ import "../../../hooks/index.mjs";
|
|
|
7
7
|
import i from "../../../icons/src/close.vue.mjs";
|
|
8
8
|
import "../../../icons/index.mjs";
|
|
9
9
|
import a from "../button/button.vue.mjs";
|
|
10
|
-
import
|
|
11
|
-
import { STransition as
|
|
12
|
-
import { VaporTeleport as
|
|
10
|
+
import o from "../scrollbar/scrollbar.vue.mjs";
|
|
11
|
+
import { STransition as s } from "../transition/index.mjs";
|
|
12
|
+
import { VaporTeleport as c, applyVShow as l, child as u, computed as d, createComponent as f, createIf as p, createInvoker as m, createSlot as h, createTemplateRefSetter as ee, defineVaporComponent as g, delegateEvents as _, mergeModels as v, nextTick as y, onMounted as te, onUnmounted as b, ref as x, renderEffect as S, setClass as C, setInsertionState as w, setStyle as T, setText as E, template as D, toDisplayString as O, txt as k, unref as A, useModel as ne, watch as j, watchEffect as re } from "vue";
|
|
13
13
|
//#region ../components/src/drawer/drawer.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var N = /*@__PURE__*/
|
|
14
|
+
var M = D("<div>"), ie = D("<div> "), ae = D("<div><div> </div>"), oe = D("<div><div><div></div>");
|
|
15
|
+
_("click", "mousedown");
|
|
16
|
+
var N = /*@__PURE__*/ g({
|
|
17
17
|
name: "SDrawer",
|
|
18
18
|
__name: "drawer",
|
|
19
|
-
props: /*@__PURE__*/
|
|
19
|
+
props: /*@__PURE__*/ v({
|
|
20
20
|
modelValue: { type: Boolean },
|
|
21
21
|
closeOnEsc: {
|
|
22
22
|
type: Boolean,
|
|
@@ -40,6 +40,7 @@ var N = /*@__PURE__*/ h({
|
|
|
40
40
|
resizable: { type: Boolean },
|
|
41
41
|
to: { default: "body" },
|
|
42
42
|
title: {},
|
|
43
|
+
desc: {},
|
|
43
44
|
header: {
|
|
44
45
|
type: Boolean,
|
|
45
46
|
default: !0
|
|
@@ -65,7 +66,7 @@ var N = /*@__PURE__*/ h({
|
|
|
65
66
|
},
|
|
66
67
|
modelModifiers: {}
|
|
67
68
|
}),
|
|
68
|
-
emits: /*@__PURE__*/
|
|
69
|
+
emits: /*@__PURE__*/ v([
|
|
69
70
|
"esc",
|
|
70
71
|
"maskClick",
|
|
71
72
|
"open",
|
|
@@ -73,45 +74,45 @@ var N = /*@__PURE__*/ h({
|
|
|
73
74
|
"close",
|
|
74
75
|
"closed"
|
|
75
76
|
], ["update:modelValue"]),
|
|
76
|
-
setup(
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
setup(g, { emit: _ }) {
|
|
78
|
+
let v = g, D = _, N = t("drawer"), { nextZIndex: P } = r(), F = x(0), { lockScroll: se, unlockScroll: ce } = n(), I = ne(g, "modelValue"), L = x(!1), R = x(!1), z = x(!1), B = x(""), V = x("");
|
|
79
|
+
re(() => {
|
|
80
|
+
B.value = e(v.width), V.value = e(v.height);
|
|
80
81
|
});
|
|
81
|
-
let
|
|
82
|
+
let H = d(() => ({
|
|
82
83
|
zIndex: F.value,
|
|
83
|
-
position:
|
|
84
|
-
})),
|
|
85
|
-
let e = { ...
|
|
86
|
-
return (
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
Z.value && (Z.value.style.transition = "", Z.value.style.transform = ""),
|
|
84
|
+
position: v.to === "body" ? "fixed" : "absolute"
|
|
85
|
+
})), U = d(() => {
|
|
86
|
+
let e = { ...v.drawerStyle };
|
|
87
|
+
return (v.placement === "left" || v.placement === "right") && (e.width = B.value), (v.placement === "top" || v.placement === "bottom") && (e.height = V.value), e;
|
|
88
|
+
}), W = () => {
|
|
89
|
+
D("opened");
|
|
90
|
+
}, le = () => {
|
|
91
|
+
R.value = !1, D("closed"), y(() => {
|
|
92
|
+
Z.value && (Z.value.style.transition = "", Z.value.style.transform = ""), ce();
|
|
92
93
|
});
|
|
93
94
|
}, G = () => {
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
e.preventDefault(),
|
|
95
|
+
I.value = !1, D("close");
|
|
96
|
+
}, ue = () => {
|
|
97
|
+
v.closeOnMask && (G(), D("maskClick"));
|
|
98
|
+
}, de = (e) => {
|
|
99
|
+
e.preventDefault(), z.value = !0;
|
|
99
100
|
}, K = (e) => {
|
|
100
|
-
if (
|
|
101
|
-
if (
|
|
101
|
+
if (z.value) {
|
|
102
|
+
if (v.placement === "right" && (B.value = X(window.innerWidth - e.clientX, v.minWidth, v.maxWidth, !0), $(B.value, !0)), v.placement === "left") {
|
|
102
103
|
let t = e.clientX;
|
|
103
|
-
|
|
104
|
+
B.value = X(t, v.minWidth, v.maxWidth, !0), $(B.value, !0);
|
|
104
105
|
}
|
|
105
|
-
if (
|
|
106
|
+
if (v.placement === "bottom" && (V.value = X(window.innerHeight - e.clientY, v.minHeight, v.maxHeight, !1), $(V.value, !0)), v.placement === "top") {
|
|
106
107
|
let t = e.clientY;
|
|
107
|
-
|
|
108
|
+
V.value = X(t, v.minHeight, v.maxHeight, !1), $(V.value, !0);
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
}, q = () => {
|
|
111
|
-
|
|
112
|
+
z.value &&= !1;
|
|
112
113
|
}, J = (e) => {
|
|
113
|
-
e.key === "Escape" &&
|
|
114
|
-
},
|
|
114
|
+
e.key === "Escape" && v.closeOnEsc && I.value && (G(), D("esc"));
|
|
115
|
+
}, fe = (e) => {
|
|
115
116
|
let t = String(e).trim().match(/^(\d*\.?\d+)(.*)$/);
|
|
116
117
|
return t ? {
|
|
117
118
|
num: parseFloat(t[1]),
|
|
@@ -121,7 +122,7 @@ var N = /*@__PURE__*/ h({
|
|
|
121
122
|
unit: "px"
|
|
122
123
|
};
|
|
123
124
|
}, Y = (e, t) => {
|
|
124
|
-
let { num: n, unit: r } =
|
|
125
|
+
let { num: n, unit: r } = fe(e), i = t ? window.innerWidth : window.innerHeight;
|
|
125
126
|
switch (r) {
|
|
126
127
|
case "%":
|
|
127
128
|
case "vw":
|
|
@@ -132,74 +133,80 @@ var N = /*@__PURE__*/ h({
|
|
|
132
133
|
}, X = (e, t, n, r) => {
|
|
133
134
|
let i = Y(t, r), a = Y(n, r);
|
|
134
135
|
return Math.max(i, Math.min(e, a)) + "px";
|
|
135
|
-
}, Z =
|
|
136
|
-
|
|
136
|
+
}, Z = x(null), Q = () => {
|
|
137
|
+
v.to === "body" ? Z.value = document.querySelector("#app") : v.to instanceof HTMLElement ? Z.value = v.to : typeof v.to == "string" && (Z.value = document.querySelector(v.to));
|
|
137
138
|
}, $ = (e, t) => {
|
|
138
|
-
|
|
139
|
+
v.push && Z.value && (t ? (Z.value.style.transition = "transform 0.3s var(--s-bezier-out)", v.placement === "left" ? Z.value.style.transform = `translateX(${e})` : v.placement === "right" ? Z.value.style.transform = `translateX(-${e})` : v.placement === "top" ? Z.value.style.transform = `translateY(${e})` : v.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
140
|
};
|
|
140
|
-
|
|
141
|
-
e ? (F.value = P(),
|
|
142
|
-
|
|
143
|
-
})) : (
|
|
144
|
-
}, { immediate: !0 }),
|
|
141
|
+
j(() => v.to, Q), j(() => I.value, (e) => {
|
|
142
|
+
e ? (F.value = P(), se(), R.value = !0, y(() => {
|
|
143
|
+
L.value = !0, v.placement === "left" || v.placement === "right" ? $(U.value.width, !0) : (v.placement === "top" || v.placement === "bottom") && $(U.value.height, !0), v.closeOnEsc && (document.removeEventListener("keydown", J), document.addEventListener("keydown", J)), D("open");
|
|
144
|
+
})) : (L.value = !1, document.removeEventListener("keydown", J), $("0", !1));
|
|
145
|
+
}, { immediate: !0 }), j(() => v.resizable, (e) => {
|
|
145
146
|
e ? (window.addEventListener("mousemove", K), window.addEventListener("mouseup", q)) : (window.removeEventListener("mousemove", K), window.removeEventListener("mouseup", q));
|
|
146
|
-
}, { immediate: !0 }),
|
|
147
|
+
}, { immediate: !0 }), te(() => {
|
|
147
148
|
Q();
|
|
148
|
-
}),
|
|
149
|
+
}), b(() => {
|
|
149
150
|
document.removeEventListener("keydown", J), window.removeEventListener("mousemove", K), window.removeEventListener("mouseup", q);
|
|
150
151
|
});
|
|
151
|
-
let
|
|
152
|
-
return
|
|
153
|
-
to: () =>
|
|
152
|
+
let pe = ee();
|
|
153
|
+
return f(c, {
|
|
154
|
+
to: () => g.to,
|
|
154
155
|
defer: ""
|
|
155
156
|
}, () => {
|
|
156
|
-
let e =
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
}),
|
|
160
|
-
let e =
|
|
161
|
-
return
|
|
162
|
-
|
|
157
|
+
let e = M();
|
|
158
|
+
return S(() => {
|
|
159
|
+
C(e, [A(N).e("container")]), T(e, H.value);
|
|
160
|
+
}), w(e, null, 0), f(A(s), { type: "opacity" }, () => p(() => g.mask, () => {
|
|
161
|
+
let e = M();
|
|
162
|
+
return l(e, () => L.value), e.$evtclick = m(ue), S(() => {
|
|
163
|
+
C(e, [A(N).e("mask")]), T(e, g.maskStyle);
|
|
163
164
|
}), e;
|
|
164
|
-
}, null, 129)),
|
|
165
|
+
}, null, 129)), w(e, null, 1), f(A(s), {
|
|
165
166
|
type: "side",
|
|
166
|
-
placement: () =>
|
|
167
|
-
onAfterLeave: () =>
|
|
168
|
-
onAfterEnter: () =>
|
|
167
|
+
placement: () => g.placement,
|
|
168
|
+
onAfterLeave: () => le,
|
|
169
|
+
onAfterEnter: () => W
|
|
169
170
|
}, () => {
|
|
170
|
-
let e =
|
|
171
|
-
return
|
|
172
|
-
let t =
|
|
173
|
-
|
|
174
|
-
}),
|
|
175
|
-
let e =
|
|
176
|
-
return e.$evtmousedown =
|
|
177
|
-
let t =
|
|
178
|
-
|
|
171
|
+
let e = oe(), t = u(e, 1), n = u(t, 1);
|
|
172
|
+
return S(() => {
|
|
173
|
+
let t = A(N);
|
|
174
|
+
C(e, [t.b(), t.m(g.placement)]), T(e, U.value);
|
|
175
|
+
}), w(e, 0, 0), p(() => g.resizable, () => {
|
|
176
|
+
let e = M();
|
|
177
|
+
return e.$evtmousedown = m(de), S(() => {
|
|
178
|
+
let t = A(N);
|
|
179
|
+
C(e, [t.e("trigger"), t.is("dragging", z.value)]);
|
|
179
180
|
}), e;
|
|
180
|
-
}),
|
|
181
|
-
let e =
|
|
182
|
-
return
|
|
183
|
-
let e =
|
|
184
|
-
return
|
|
185
|
-
|
|
181
|
+
}), S(() => C(t, [A(N).e("wrapper")])), w(t, 0, 0), p(() => g.header, () => {
|
|
182
|
+
let e = M();
|
|
183
|
+
return S(() => C(e, [A(N).e("header")])), w(e, null, 0), h("header", null, () => {
|
|
184
|
+
let e = ae(), t = u(e), n = k(t);
|
|
185
|
+
return S(() => {
|
|
186
|
+
let r = A(N);
|
|
187
|
+
C(e, [r.e("title")]), C(t, r.e("title-text")), E(n, O(g.title));
|
|
188
|
+
}), w(e, null, 1), p(() => g.desc, () => {
|
|
189
|
+
let e = ie(), t = k(e);
|
|
190
|
+
return S(() => {
|
|
191
|
+
C(e, A(N).e("title-desc")), E(t, O(g.desc));
|
|
192
|
+
}), e;
|
|
186
193
|
}), e;
|
|
187
|
-
}),
|
|
194
|
+
}), w(e, null, 1), p(() => g.closable, () => f(a, {
|
|
188
195
|
circle: "",
|
|
189
196
|
text: "",
|
|
190
197
|
size: "small",
|
|
191
198
|
onClick: () => G
|
|
192
|
-
}, { icon: () =>
|
|
193
|
-
}),
|
|
194
|
-
let e =
|
|
195
|
-
return
|
|
196
|
-
|
|
197
|
-
}),
|
|
198
|
-
},
|
|
199
|
-
let e =
|
|
200
|
-
return
|
|
201
|
-
}),
|
|
202
|
-
}),
|
|
199
|
+
}, { icon: () => f(A(i)) })), e;
|
|
200
|
+
}), S(() => C(n, [A(N).e("body")])), w(n, null, 0), p(() => g.scrollContent, () => f(o, { $: [() => ({ ...g.scrollbarProps })] }, () => h("default", null, null, 4)), () => {
|
|
201
|
+
let e = M();
|
|
202
|
+
return S(() => {
|
|
203
|
+
C(e, [A(N).e("content")]), T(e, g.bodyStyle);
|
|
204
|
+
}), w(e, null, 0), h(), e;
|
|
205
|
+
}, 1541), w(t, null, 2), p(() => g.footer, () => {
|
|
206
|
+
let e = M();
|
|
207
|
+
return S(() => C(e, [A(N).e("footer")])), w(e, null, 0), h("footer"), e;
|
|
208
|
+
}), l(e, () => L.value), e;
|
|
209
|
+
}), l(e, () => R.value), pe(e, "drawerContainerRef"), e;
|
|
203
210
|
}, !0);
|
|
204
211
|
}
|
|
205
212
|
});
|
|
@@ -21,6 +21,7 @@ export declare const SDrawer: ((__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
21
21
|
resizable?: boolean | undefined;
|
|
22
22
|
to?: (string | HTMLElement) | undefined;
|
|
23
23
|
title?: string | undefined;
|
|
24
|
+
desc?: string | undefined;
|
|
24
25
|
header?: boolean | undefined;
|
|
25
26
|
footer?: boolean | undefined;
|
|
26
27
|
closable?: boolean | undefined;
|
package/dist/es/components/src/dropdown/doption.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -8,22 +8,25 @@ s("click");
|
|
|
8
8
|
var y = /*@__PURE__*/ o({
|
|
9
9
|
name: "SDoption",
|
|
10
10
|
__name: "doption",
|
|
11
|
-
props: {
|
|
11
|
+
props: {
|
|
12
|
+
title: {},
|
|
13
|
+
delayClose: { type: Boolean }
|
|
14
|
+
},
|
|
12
15
|
emits: ["click"],
|
|
13
16
|
setup(o, { emit: s, slots: p }) {
|
|
14
|
-
let y =
|
|
15
|
-
await
|
|
16
|
-
},
|
|
17
|
-
return l(() => u(
|
|
17
|
+
let y = o, b = s, x = e("droption"), S = c(t, void 0), C = async () => {
|
|
18
|
+
y.delayClose ? (await S?.itemClick?.(), b("click")) : (S?.itemClick?.(), b("click"));
|
|
19
|
+
}, w = v(), T = n(w, 1);
|
|
20
|
+
return l(() => u(w, [h(x).b()])), d(w, 0, 0), r(() => p.icon, () => {
|
|
18
21
|
let e = g();
|
|
19
|
-
return l(() => u(e, [h(
|
|
20
|
-
}), l(() => u(
|
|
22
|
+
return l(() => u(e, [h(x).e("icon")])), d(e, null, 0), a("icon"), e;
|
|
23
|
+
}), l(() => u(T, [h(x).e("title")])), d(T, null, 0), a("default", null, () => {
|
|
21
24
|
let e = _();
|
|
22
25
|
return l(() => f(e, m(o.title))), e;
|
|
23
|
-
}), d(
|
|
26
|
+
}), d(w, null, 2), r(() => p.extra, () => {
|
|
24
27
|
let e = g();
|
|
25
|
-
return l(() => u(e, [h(
|
|
26
|
-
}),
|
|
28
|
+
return l(() => u(e, [h(x).e("extra")])), d(e, null, 0), a("extra"), e;
|
|
29
|
+
}), w.$evtclick = i(C), w;
|
|
27
30
|
}
|
|
28
31
|
});
|
|
29
32
|
//#endregion
|
|
@@ -25,6 +25,7 @@ export declare const SDoption: ((__VLS_props: NonNullable<Awaited<typeof __VLS_s
|
|
|
25
25
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
26
26
|
props: PublicProps & {
|
|
27
27
|
title?: string | undefined;
|
|
28
|
+
delayClose?: boolean | undefined;
|
|
28
29
|
onClick?: (() => any) | undefined;
|
|
29
30
|
} & (typeof globalThis extends {
|
|
30
31
|
__VLS_PROPS_FALLBACK: infer P;
|
package/dist/es/components/src/split/split-pane.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -51,10 +51,11 @@ var O = /*@__PURE__*/ u({
|
|
|
51
51
|
E(() => M.value, () => {
|
|
52
52
|
N.value?.collapsed || k?.requestUpdate({
|
|
53
53
|
id: j,
|
|
54
|
-
size: V.value
|
|
54
|
+
size: V.value,
|
|
55
|
+
sizeUnit: R.value ? L(M.value) : "%"
|
|
55
56
|
});
|
|
56
57
|
}), E(() => N.value?.size, (e) => {
|
|
57
|
-
if (e == null || z.value <= 0) return;
|
|
58
|
+
if (e == null || z.value <= 0 || !R.value) return;
|
|
58
59
|
let t = H(e);
|
|
59
60
|
String(t) !== String(M.value) && (M.value = t);
|
|
60
61
|
}), E(() => x.minSize, () => k?.requestUpdate({
|
|
@@ -70,12 +71,17 @@ var O = /*@__PURE__*/ u({
|
|
|
70
71
|
e !== void 0 && p("collapsed", e);
|
|
71
72
|
}), t(i(() => A.value?.parentElement), () => {
|
|
72
73
|
let e = z.value;
|
|
73
|
-
B(),
|
|
74
|
+
B(), k?.requestUpdate({
|
|
75
|
+
id: j,
|
|
76
|
+
min: I(x.minSize, z.value),
|
|
77
|
+
max: I(x.maxSize, z.value)
|
|
78
|
+
}), !(e > 0 || z.value <= 0) && N.value && (k?.requestUpdate({
|
|
74
79
|
id: j,
|
|
75
80
|
min: I(x.minSize, z.value),
|
|
76
81
|
max: I(x.maxSize, z.value),
|
|
77
82
|
givenSize: R.value ? V.value : null,
|
|
78
|
-
size: V.value
|
|
83
|
+
size: V.value,
|
|
84
|
+
sizeUnit: R.value ? L(M.value) : "%"
|
|
79
85
|
}), k?.requestReset());
|
|
80
86
|
}), h(() => {
|
|
81
87
|
B(), k?.paneAdd({
|
|
@@ -85,6 +91,7 @@ var O = /*@__PURE__*/ u({
|
|
|
85
91
|
max: I(x.maxSize, z.value),
|
|
86
92
|
givenSize: R.value ? V.value : null,
|
|
87
93
|
size: V.value,
|
|
94
|
+
sizeUnit: R.value ? L(M.value) : "%",
|
|
88
95
|
collapsible: x.collapsible
|
|
89
96
|
});
|
|
90
97
|
}), m(() => k?.paneRemove(j));
|
package/dist/es/components/src/split/split.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
|
+
import { useResizeObserver as t } from "../../../hooks/src/use-resize-observer.mjs";
|
|
2
3
|
import "../../../hooks/index.mjs";
|
|
3
|
-
import { splitContextKey as
|
|
4
|
-
import
|
|
5
|
-
import { computed as
|
|
4
|
+
import { splitContextKey as n } from "./types.mjs";
|
|
5
|
+
import r from "./split-bar.vue.mjs";
|
|
6
|
+
import { computed as i, createComponent as a, createIf as o, createSlot as s, defineVaporComponent as c, nextTick as l, onBeforeUnmount as u, onMounted as ee, provide as te, ref as d, renderEffect as f, setClass as p, setInsertionState as m, setStaticTemplateRef as h, template as g, toRefs as _, unref as v, useTemplateRef as y } from "vue";
|
|
6
7
|
//#region ../components/src/split/split.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
7
|
-
var
|
|
8
|
+
var ne = g("<div>", 1), b = /*@__PURE__*/ c({
|
|
8
9
|
name: "SSplit",
|
|
9
10
|
__name: "split",
|
|
10
11
|
props: {
|
|
@@ -27,166 +28,185 @@ var re = _("<div>", 1), v = /*@__PURE__*/ s({
|
|
|
27
28
|
"bar-click",
|
|
28
29
|
"bar-dblclick"
|
|
29
30
|
],
|
|
30
|
-
setup(
|
|
31
|
-
let
|
|
31
|
+
setup(c, { emit: g }) {
|
|
32
|
+
let b = c, re = g, x = e("split"), S = y("containerRef"), C = d([]), w = i(() => C.value.reduce((e, t) => (e[t.id] = t) && e, {})), T = i(() => C.value.length), E = d(!1), D = d(0);
|
|
33
|
+
t(S, () => {
|
|
34
|
+
if (!S.value) return;
|
|
35
|
+
let e = b.vertical ? S.value.clientHeight : S.value.clientWidth, t = D.value;
|
|
36
|
+
if (D.value = e, t <= 0 || e <= 0 || t === e) return;
|
|
37
|
+
let n = t / e, r = 0;
|
|
38
|
+
for (let e of C.value) if (e.sizeUnit === "px" && e.size != null) {
|
|
39
|
+
let t = e.size * n;
|
|
40
|
+
r += t - e.size;
|
|
41
|
+
}
|
|
42
|
+
if (Math.abs(r) < .01) return;
|
|
43
|
+
let i = C.value.filter((e) => e.sizeUnit !== "px"), a = i.reduce((e, t) => e + (t.size || 0), 0);
|
|
44
|
+
for (let e of C.value) if (e.sizeUnit === "px" && e.size != null) e.size *= n;
|
|
45
|
+
else if (i.length > 0 && a > 0) {
|
|
46
|
+
let t = (e.size || 0) / a, n = (e.size || 0) - r * t;
|
|
47
|
+
e.size = Math.max(Math.min(n, e.max ?? 100), e.min ?? 0);
|
|
48
|
+
}
|
|
49
|
+
E.value && Z("resized");
|
|
50
|
+
});
|
|
51
|
+
let O = d({
|
|
32
52
|
mouseDown: !1,
|
|
33
53
|
dragging: !1,
|
|
34
54
|
activeBar: null,
|
|
35
55
|
cursorOffset: 0
|
|
36
|
-
}),
|
|
56
|
+
}), k = d({
|
|
37
57
|
bar: null,
|
|
38
58
|
timeoutId: null
|
|
39
|
-
}),
|
|
40
|
-
document.addEventListener("mousemove",
|
|
41
|
-
},
|
|
42
|
-
document.removeEventListener("mousemove",
|
|
43
|
-
},
|
|
44
|
-
let n = e.target?.closest(`.${
|
|
59
|
+
}), A = () => {
|
|
60
|
+
document.addEventListener("mousemove", M, { passive: !1 }), document.addEventListener("mouseup", N), "ontouchstart" in window && (document.addEventListener("touchmove", M, { passive: !1 }), document.addEventListener("touchend", N));
|
|
61
|
+
}, ie = () => {
|
|
62
|
+
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", N), "ontouchstart" in window && (document.removeEventListener("touchmove", M), document.removeEventListener("touchend", N));
|
|
63
|
+
}, j = (e, t) => {
|
|
64
|
+
let n = e.target?.closest(`.${x.e("bar")}`);
|
|
45
65
|
if (n) {
|
|
46
66
|
let { left: t, top: r } = n.getBoundingClientRect(), { clientX: i, clientY: a } = "ontouchstart" in window && "touches" in e ? e.touches[0] : e;
|
|
47
|
-
|
|
67
|
+
O.value.cursorOffset = b.vertical ? a - r : i - t;
|
|
48
68
|
}
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
A(), O.value.mouseDown = !0, O.value.activeBar = t, document.documentElement.style.cursor = b.vertical ? "row-resize" : "col-resize";
|
|
70
|
+
}, M = (e) => {
|
|
71
|
+
O.value.mouseDown && (e.preventDefault(), O.value.dragging || (window.getSelection()?.removeAllRanges(), O.value.dragging = !0), requestAnimationFrame(() => {
|
|
72
|
+
z(L(e)), Z("resize", { event: e }, !0);
|
|
53
73
|
}));
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
}, N = (e) => {
|
|
75
|
+
O.value.dragging && (window.getSelection()?.removeAllRanges(), Z("resized", { event: e }, !0)), O.value.mouseDown = !1, O.value.activeBar = null, setTimeout(() => {
|
|
76
|
+
O.value.dragging = !1, ie(), document.documentElement.style.cursor = "";
|
|
57
77
|
}, 100);
|
|
58
|
-
},
|
|
59
|
-
"ontouchstart" in window && (e.preventDefault(),
|
|
78
|
+
}, P = (e, t) => {
|
|
79
|
+
"ontouchstart" in window && (e.preventDefault(), k.value.bar === t ? (clearTimeout(k.value.timeoutId), k.value.timeoutId = null, F(e, t), k.value.bar = null) : (k.value.bar = t, k.value.timeoutId = setTimeout(() => k.value.bar = null, 500))), O.value.dragging || Z("bar-click", {
|
|
60
80
|
event: e,
|
|
61
81
|
index: t
|
|
62
82
|
}, !0);
|
|
63
|
-
},
|
|
64
|
-
if (
|
|
83
|
+
}, F = (e, t) => {
|
|
84
|
+
if (Z("bar-dblclick", {
|
|
65
85
|
event: e,
|
|
66
86
|
index: t
|
|
67
|
-
}, !0),
|
|
87
|
+
}, !0), b.maximizePane) {
|
|
68
88
|
let n = 0;
|
|
69
|
-
|
|
89
|
+
C.value = C.value.map((e, r) => (e.size = r === t ? e.max : e.min, r !== t && (n += e.min), e)), C.value[t].size = C.value[t].size - n, Z("pane-maximize", {
|
|
70
90
|
event: e,
|
|
71
91
|
index: t,
|
|
72
|
-
pane:
|
|
73
|
-
}),
|
|
92
|
+
pane: C.value[t]
|
|
93
|
+
}), Z("resized", {
|
|
74
94
|
event: e,
|
|
75
95
|
index: t
|
|
76
96
|
}, !0);
|
|
77
97
|
}
|
|
78
|
-
},
|
|
79
|
-
let n =
|
|
80
|
-
n &&
|
|
98
|
+
}, I = (e, t) => {
|
|
99
|
+
let n = w.value[t];
|
|
100
|
+
n && Z("pane-click", {
|
|
81
101
|
event: e,
|
|
82
102
|
index: n.index,
|
|
83
103
|
pane: n
|
|
84
104
|
});
|
|
85
|
-
},
|
|
86
|
-
let t =
|
|
105
|
+
}, L = (e) => {
|
|
106
|
+
let t = S.value.getBoundingClientRect(), { clientX: n, clientY: r } = "ontouchstart" in window && "touches" in e ? e.touches[0] : e;
|
|
87
107
|
return {
|
|
88
|
-
x: n - (
|
|
89
|
-
y: r - (
|
|
108
|
+
x: n - (b.vertical ? 0 : O.value.cursorOffset) - t.left,
|
|
109
|
+
y: r - (b.vertical ? O.value.cursorOffset : 0) - t.top
|
|
90
110
|
};
|
|
91
|
-
},
|
|
92
|
-
let t = e[
|
|
111
|
+
}, R = (e) => {
|
|
112
|
+
let t = e[b.vertical ? "y" : "x"], n = S.value[b.vertical ? "clientHeight" : "clientWidth"];
|
|
93
113
|
return t * 100 / n;
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
let t =
|
|
98
|
-
if (t === null || t >=
|
|
114
|
+
}, z = (e) => {
|
|
115
|
+
B(R(e));
|
|
116
|
+
}, B = (e) => {
|
|
117
|
+
let t = O.value.activeBar;
|
|
118
|
+
if (t === null || t >= C.value.length - 1) return;
|
|
99
119
|
let n = {
|
|
100
|
-
prevPanesSize:
|
|
101
|
-
nextPanesSize:
|
|
120
|
+
prevPanesSize: H(t),
|
|
121
|
+
nextPanesSize: U(t),
|
|
102
122
|
prevReachedMinPanes: 0,
|
|
103
123
|
nextReachedMinPanes: 0
|
|
104
|
-
}, r = 0 + (
|
|
124
|
+
}, r = 0 + (b.pushOtherPanes ? 0 : n.prevPanesSize), i = 100 - (b.pushOtherPanes ? 0 : n.nextPanesSize);
|
|
105
125
|
e = Math.max(Math.min(e, i), r);
|
|
106
|
-
let a = [t, t + 1], o =
|
|
126
|
+
let a = [t, t + 1], o = C.value[a[0]] || null, s = C.value[a[1]] || null, c = o !== null && o.max < 100 && e >= o.max + n.prevPanesSize, l = s !== null && s.max < 100 && e <= 100 - (s.max + U(t + 1));
|
|
107
127
|
if (c || l) {
|
|
108
|
-
c ? (o.size = o.max, s.size = Math.min(Math.max(100 - o.max - n.prevPanesSize - n.nextPanesSize, s.min), s.max)) : (o.size = Math.min(Math.max(100 - s.max - n.prevPanesSize -
|
|
128
|
+
c ? (o.size = o.max, s.size = Math.min(Math.max(100 - o.max - n.prevPanesSize - n.nextPanesSize, s.min), s.max)) : (o.size = Math.min(Math.max(100 - s.max - n.prevPanesSize - U(t + 1), o.min), o.max), s.size = s.max);
|
|
109
129
|
return;
|
|
110
130
|
}
|
|
111
|
-
if (
|
|
112
|
-
let t =
|
|
131
|
+
if (b.pushOtherPanes) {
|
|
132
|
+
let t = V(n, e);
|
|
113
133
|
if (!t) return;
|
|
114
|
-
({sums: n, panesToResize: a} = t), o =
|
|
134
|
+
({sums: n, panesToResize: a} = t), o = C.value[a[0]] || null, s = C.value[a[1]] || null;
|
|
115
135
|
}
|
|
116
136
|
o !== null && (o.size = Math.min(Math.max(e - n.prevPanesSize - n.prevReachedMinPanes, o.min), o.max)), s !== null && (s.size = Math.min(Math.max(100 - e - n.nextPanesSize - n.nextReachedMinPanes, s.min), s.max));
|
|
117
|
-
},
|
|
118
|
-
let n =
|
|
119
|
-
if (t < e.prevPanesSize +
|
|
120
|
-
if (r[0] =
|
|
137
|
+
}, V = (e, t) => {
|
|
138
|
+
let n = O.value.activeBar, r = [n, n + 1];
|
|
139
|
+
if (t < e.prevPanesSize + C.value[r[0]].min) {
|
|
140
|
+
if (r[0] = W(n).index, e.prevReachedMinPanes = 0, r[0] < n && C.value.forEach((t, i) => {
|
|
121
141
|
i > r[0] && i <= n && (t.size = t.min, e.prevReachedMinPanes += t.min);
|
|
122
|
-
}), r[0] === void 0) return e.prevReachedMinPanes = 0,
|
|
142
|
+
}), r[0] === void 0) return e.prevReachedMinPanes = 0, C.value[0].size = C.value[0].min, C.value.forEach((t, r) => {
|
|
123
143
|
r > 0 && r <= n && (t.size = t.min, e.prevReachedMinPanes += t.min);
|
|
124
|
-
}),
|
|
125
|
-
e.prevPanesSize =
|
|
144
|
+
}), C.value[r[1]].size = 100 - e.prevReachedMinPanes - C.value[0].min - e.prevPanesSize - e.nextPanesSize, null;
|
|
145
|
+
e.prevPanesSize = H(r[0]);
|
|
126
146
|
}
|
|
127
|
-
return t > 100 - e.nextPanesSize -
|
|
147
|
+
return t > 100 - e.nextPanesSize - C.value[r[1]].min && (r[1] = G(n).index, e.nextReachedMinPanes = 0, r[1] > n + 1 && C.value.forEach((t, i) => {
|
|
128
148
|
i > n && i < r[1] && (t.size = t.min, e.nextReachedMinPanes += t.min);
|
|
129
|
-
}), e.nextPanesSize = r[1] === void 0 ? 0 :
|
|
149
|
+
}), e.nextPanesSize = r[1] === void 0 ? 0 : U(r[1] - 1), r[1] === void 0) ? (e.nextReachedMinPanes = 0, C.value.forEach((t, r) => {
|
|
130
150
|
r >= n + 1 && (t.size = t.min, e.nextReachedMinPanes += t.min);
|
|
131
|
-
}), r[0] !== void 0 && (
|
|
151
|
+
}), r[0] !== void 0 && (C.value[r[0]].size = 100 - e.prevPanesSize - U(r[0] - 1)), null) : {
|
|
132
152
|
sums: e,
|
|
133
153
|
panesToResize: r
|
|
134
154
|
};
|
|
135
|
-
},
|
|
136
|
-
let e = Array.from(
|
|
155
|
+
}, H = (e) => C.value.reduce((t, n, r) => t + (r < e ? n.size : 0), 0), U = (e) => C.value.reduce((t, n, r) => t + (r > e + 1 ? n.size : 0), 0), W = (e) => [...C.value].reverse().find((t) => t.index < e && t.size > t.min) || {}, G = (e) => C.value.find((t) => t.index > e + 1 && t.size > t.min) || {}, K = () => {
|
|
156
|
+
let e = Array.from(S.value?.children || []);
|
|
137
157
|
for (let t of e) {
|
|
138
|
-
let e = t.classList.contains(
|
|
158
|
+
let e = t.classList.contains(x.e("pane")), n = t.classList.contains(x.e("bar"));
|
|
139
159
|
!e && !n && (t.remove(), console.warn("Split: Only <s-split-pane> elements are allowed at the root of <s-split>. One of your DOM nodes was removed."));
|
|
140
160
|
}
|
|
141
|
-
},
|
|
142
|
-
let n =
|
|
161
|
+
}, q = ({ id: e, ...t }) => {
|
|
162
|
+
let n = w.value[e];
|
|
143
163
|
if (n) for (let [e, r] of Object.entries(t)) n[e] = r;
|
|
144
|
-
},
|
|
164
|
+
}, J = !1, ae = (e) => {
|
|
145
165
|
let t = -1;
|
|
146
|
-
Array.from(
|
|
166
|
+
Array.from(S.value?.children || []).some((n) => {
|
|
147
167
|
let r = n;
|
|
148
|
-
return r.className.includes(
|
|
149
|
-
}),
|
|
168
|
+
return r.className.includes(x.e("pane")) && t++, r.isSameNode(e.el ?? null);
|
|
169
|
+
}), C.value.splice(t, 0, {
|
|
150
170
|
...e,
|
|
151
171
|
index: t
|
|
152
|
-
}),
|
|
153
|
-
|
|
172
|
+
}), C.value.forEach((e, t) => e.index = t), E.value && !J && (J = !0, l(() => {
|
|
173
|
+
Y({ addedPane: C.value[t] }), J = !1;
|
|
154
174
|
}));
|
|
155
|
-
},
|
|
156
|
-
let t =
|
|
157
|
-
|
|
158
|
-
let n =
|
|
159
|
-
|
|
160
|
-
|
|
175
|
+
}, oe = (e) => {
|
|
176
|
+
let t = C.value.findIndex((t) => t.id === e);
|
|
177
|
+
C.value[t].el = null;
|
|
178
|
+
let n = C.value.splice(t, 1)[0];
|
|
179
|
+
C.value.forEach((e, t) => e.index = t), l(() => {
|
|
180
|
+
Y({ removedPane: {
|
|
161
181
|
...n,
|
|
162
182
|
index: t
|
|
163
183
|
} });
|
|
164
184
|
});
|
|
165
|
-
},
|
|
166
|
-
!e.addedPane && !e.removedPane ?
|
|
167
|
-
}, oe = () => {
|
|
168
|
-
let e = 100 / w.value, t = 100, n = [], r = [];
|
|
169
|
-
for (let i of S.value) i.size = Math.max(Math.min(e, i.max), i.min), t -= i.size, i.size >= i.max && n.push(i.id), i.size <= i.min && r.push(i.id);
|
|
170
|
-
Math.abs(t) > .1 && Y(t, n, r);
|
|
185
|
+
}, Y = (e = {}) => {
|
|
186
|
+
!e.addedPane && !e.removedPane ? ce() : C.value.some((e) => e.givenSize !== null || e.min || e.max < 100) ? le() : se(), E.value && Z("resized");
|
|
171
187
|
}, se = () => {
|
|
188
|
+
let e = 100 / T.value, t = 100, n = [], r = [];
|
|
189
|
+
for (let i of C.value) i.size = Math.max(Math.min(e, i.max), i.min), t -= i.size, i.size >= i.max && n.push(i.id), i.size <= i.min && r.push(i.id);
|
|
190
|
+
Math.abs(t) > .1 && X(t, n, r);
|
|
191
|
+
}, ce = () => {
|
|
172
192
|
let e = 100, t = [], n = [], r = 0;
|
|
173
|
-
for (let i of
|
|
193
|
+
for (let i of C.value) e -= i.size, i.givenSize !== null && r++, i.size >= i.max && t.push(i.id), i.size <= i.min && n.push(i.id);
|
|
174
194
|
let i = 100;
|
|
175
195
|
if (e > .1) {
|
|
176
|
-
for (let t of
|
|
177
|
-
i > .1 &&
|
|
196
|
+
for (let t of C.value) t.givenSize === null && (t.size = Math.max(Math.min(e / (T.value - r), t.max), t.min)), i -= t.size;
|
|
197
|
+
i > .1 && X(i, t, n);
|
|
178
198
|
}
|
|
179
|
-
},
|
|
180
|
-
let e =
|
|
181
|
-
for (let e of
|
|
199
|
+
}, le = () => {
|
|
200
|
+
let e = C.value.reduce((e, t) => e + (t.givenSize === null ? 0 : t.givenSize), 0), t = C.value.filter((e) => e.givenSize === null).length, n = t > 0 ? (100 - e) / t : 0, r = 0, i = [], a = [];
|
|
201
|
+
for (let e of C.value) r -= e.size, e.size >= e.max && i.push(e.id), e.size <= e.min && a.push(e.id);
|
|
182
202
|
if (!(Math.abs(r) < .1)) {
|
|
183
203
|
r = 100;
|
|
184
|
-
for (let e of
|
|
185
|
-
Math.abs(r) > .1 &&
|
|
204
|
+
for (let e of C.value) e.givenSize === null && (e.size = Math.max(Math.min(n, e.max), e.min)), r -= e.size, e.size >= e.max && i.push(e.id), e.size <= e.min && a.push(e.id);
|
|
205
|
+
Math.abs(r) > .1 && X(r, i, a);
|
|
186
206
|
}
|
|
187
|
-
},
|
|
207
|
+
}, X = (e, t, n) => {
|
|
188
208
|
let r;
|
|
189
|
-
r = e > 0 ? e / (
|
|
209
|
+
r = e > 0 ? e / (T.value - t.length) : e / (T.value - n.length), C.value.forEach((i) => {
|
|
190
210
|
if (e > 0 && !t.includes(i.id)) {
|
|
191
211
|
let t = Math.max(Math.min(i.size + r, i.max), i.min), n = t - i.size;
|
|
192
212
|
e -= n, i.size = t;
|
|
@@ -194,76 +214,76 @@ var re = _("<div>", 1), v = /*@__PURE__*/ s({
|
|
|
194
214
|
let t = Math.max(Math.min(i.size + r, i.max), i.min), n = t - i.size;
|
|
195
215
|
e -= n, i.size = t;
|
|
196
216
|
}
|
|
197
|
-
}), Math.abs(e) > .1 &&
|
|
198
|
-
},
|
|
199
|
-
let r = t?.index ??
|
|
200
|
-
|
|
217
|
+
}), Math.abs(e) > .1 && E.value && console.warn("Split: 由于窗格的约束,无法正确调整其大小。");
|
|
218
|
+
}, Z = (e, t, n = !1) => {
|
|
219
|
+
let r = t?.index ?? O.value.activeBar ?? null;
|
|
220
|
+
re(e, {
|
|
201
221
|
...t,
|
|
202
222
|
...r !== null && { index: r },
|
|
203
223
|
...n && r !== null && {
|
|
204
|
-
prevPane:
|
|
205
|
-
nextPane:
|
|
224
|
+
prevPane: C.value[r - +!!b.firstBar],
|
|
225
|
+
nextPane: C.value[r + +!b.firstBar]
|
|
206
226
|
},
|
|
207
|
-
panes:
|
|
227
|
+
panes: C.value.map((e) => ({
|
|
208
228
|
min: e.min,
|
|
209
229
|
max: e.max,
|
|
210
230
|
size: e.size
|
|
211
231
|
}))
|
|
212
232
|
});
|
|
213
|
-
},
|
|
214
|
-
!
|
|
215
|
-
|
|
233
|
+
}, Q = !1, ue = () => {
|
|
234
|
+
!E.value || Q || (Q = !0, l(() => {
|
|
235
|
+
C.value.forEach((e) => {
|
|
216
236
|
e.size = e.givenSize ?? 0;
|
|
217
|
-
}),
|
|
237
|
+
}), Y(), Q = !1;
|
|
218
238
|
}));
|
|
219
239
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}),
|
|
223
|
-
let
|
|
224
|
-
let n = e > 0 ?
|
|
240
|
+
ee(() => {
|
|
241
|
+
K(), S.value && (D.value = b.vertical ? S.value.clientHeight : S.value.clientWidth), Y(), E.value = !0;
|
|
242
|
+
}), u(() => E.value = !1);
|
|
243
|
+
let de = (e, t) => {
|
|
244
|
+
let n = e > 0 ? C.value[e - 1] : null, r = C.value[e];
|
|
225
245
|
if (t === "left") {
|
|
226
246
|
if (!n) return;
|
|
227
247
|
if (n.collapsed) {
|
|
228
|
-
let e =
|
|
248
|
+
let e = C.value.find((e) => e.id === n.absorberId);
|
|
229
249
|
e && (e.size = (e.size || 0) - (n.originalSize || 0)), n.size = n.originalSize, n.collapsed = !1, n.absorberId = null;
|
|
230
250
|
} else n.originalSize = n.size || 0, n.size = 0, n.collapsed = !0, n.absorberId = r?.id || null, r && (r.size = (r.size || 0) + (n.originalSize || 0));
|
|
231
251
|
} else {
|
|
232
252
|
if (!r) return;
|
|
233
253
|
if (r.collapsed) {
|
|
234
|
-
let e =
|
|
254
|
+
let e = C.value.find((e) => e.id === r.absorberId);
|
|
235
255
|
e && (e.size = (e.size || 0) - (r.originalSize || 0)), r.size = r.originalSize, r.collapsed = !1, r.absorberId = null;
|
|
236
256
|
} else r.originalSize = r.size || 0, r.size = 0, r.collapsed = !0, r.absorberId = n?.id || null, n && (n.size = (n.size || 0) + (r.originalSize || 0));
|
|
237
257
|
}
|
|
238
|
-
}, { vertical:
|
|
239
|
-
|
|
240
|
-
panes:
|
|
241
|
-
indexedPanes:
|
|
242
|
-
vertical:
|
|
243
|
-
requestUpdate:
|
|
244
|
-
requestReset:
|
|
245
|
-
paneAdd:
|
|
246
|
-
paneRemove:
|
|
247
|
-
paneClick:
|
|
248
|
-
barMouseDown:
|
|
249
|
-
barClick:
|
|
250
|
-
barDblClick:
|
|
251
|
-
collapsePane:
|
|
258
|
+
}, { vertical: fe } = _(b);
|
|
259
|
+
te(n, {
|
|
260
|
+
panes: C,
|
|
261
|
+
indexedPanes: w,
|
|
262
|
+
vertical: fe,
|
|
263
|
+
requestUpdate: q,
|
|
264
|
+
requestReset: ue,
|
|
265
|
+
paneAdd: ae,
|
|
266
|
+
paneRemove: oe,
|
|
267
|
+
paneClick: I,
|
|
268
|
+
barMouseDown: j,
|
|
269
|
+
barClick: P,
|
|
270
|
+
barDblClick: F,
|
|
271
|
+
collapsePane: de
|
|
252
272
|
});
|
|
253
|
-
let $ =
|
|
254
|
-
return
|
|
255
|
-
let e =
|
|
256
|
-
|
|
273
|
+
let $ = ne();
|
|
274
|
+
return f(() => {
|
|
275
|
+
let e = v(x);
|
|
276
|
+
p($, [
|
|
257
277
|
e.b(),
|
|
258
|
-
e.m(
|
|
259
|
-
e.is("dragging",
|
|
260
|
-
e.is("ready",
|
|
278
|
+
e.m(b.vertical ? "vertical" : "horizontal"),
|
|
279
|
+
e.is("dragging", O.value.dragging),
|
|
280
|
+
e.is("ready", E.value)
|
|
261
281
|
]);
|
|
262
|
-
}),
|
|
282
|
+
}), m($, null, 0), o(() => b.firstBar, () => a(r, {
|
|
263
283
|
index: 0,
|
|
264
284
|
first: ""
|
|
265
|
-
})),
|
|
285
|
+
})), m($, null, 1), s(), h($, S, null, "containerRef"), $;
|
|
266
286
|
}
|
|
267
287
|
});
|
|
268
288
|
//#endregion
|
|
269
|
-
export {
|
|
289
|
+
export { b as default };
|
|
@@ -127,6 +127,17 @@
|
|
|
127
127
|
&:active {
|
|
128
128
|
color: getCssVar("color", "primary-7");
|
|
129
129
|
}
|
|
130
|
+
@include when(disabled, loading) {
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
color: getCssVar("color", "text-3");
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
border: 1px solid transparent;
|
|
135
|
+
&:hover {
|
|
136
|
+
color: getCssVar("color", "text-3");
|
|
137
|
+
background-color: transparent;
|
|
138
|
+
border: 1px solid transparent;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
130
141
|
}
|
|
131
142
|
}
|
|
132
143
|
|
|
@@ -176,6 +187,13 @@
|
|
|
176
187
|
&:active {
|
|
177
188
|
color: getCssVar("color", #{$type}-7);
|
|
178
189
|
}
|
|
190
|
+
@include when(disabled, loading) {
|
|
191
|
+
cursor: not-allowed;
|
|
192
|
+
color: getCssVar("color", #{$type}-3);
|
|
193
|
+
&:hover {
|
|
194
|
+
color: getCssVar("color", #{$type}-3);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
179
197
|
}
|
|
180
198
|
@include this-is(outline) {
|
|
181
199
|
background-color: transparent;
|
|
@@ -139,6 +139,19 @@
|
|
|
139
139
|
}
|
|
140
140
|
@include e(title) {
|
|
141
141
|
flex: 1;
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
gap: 4px;
|
|
145
|
+
}
|
|
146
|
+
@include e(title-text) {
|
|
147
|
+
font-size: getCssVar("font-size", "large");
|
|
148
|
+
font-weight: 500;
|
|
149
|
+
color: getCssVar("color", "text-1");
|
|
150
|
+
}
|
|
151
|
+
@include e(title-desc) {
|
|
152
|
+
font-size: getCssVar("font-size", "medium");
|
|
153
|
+
font-weight: 400;
|
|
154
|
+
color: getCssVar("color", "text-2");
|
|
142
155
|
}
|
|
143
156
|
@include e(body) {
|
|
144
157
|
flex: 1;
|
|
@@ -701,6 +701,10 @@
|
|
|
701
701
|
"description": "标题",
|
|
702
702
|
"type": "string"
|
|
703
703
|
},
|
|
704
|
+
"s-drawer/desc": {
|
|
705
|
+
"description": "标题描述",
|
|
706
|
+
"type": "string"
|
|
707
|
+
},
|
|
704
708
|
"s-drawer/header": {
|
|
705
709
|
"description": "头部",
|
|
706
710
|
"type": "boolean"
|
|
@@ -740,6 +744,10 @@
|
|
|
740
744
|
"description": "标题",
|
|
741
745
|
"type": "string"
|
|
742
746
|
},
|
|
747
|
+
"s-droption/delayClose": {
|
|
748
|
+
"description": "延迟关闭(用于卸载组件时延迟关闭)",
|
|
749
|
+
"type": "boolean"
|
|
750
|
+
},
|
|
743
751
|
"s-dsubmenu/title": {
|
|
744
752
|
"description": "标题",
|
|
745
753
|
"type": "string"
|
|
@@ -301,6 +301,7 @@
|
|
|
301
301
|
"resizable",
|
|
302
302
|
"to",
|
|
303
303
|
"title",
|
|
304
|
+
"desc",
|
|
304
305
|
"header",
|
|
305
306
|
"footer",
|
|
306
307
|
"closable",
|
|
@@ -319,7 +320,8 @@
|
|
|
319
320
|
},
|
|
320
321
|
"s-droption": {
|
|
321
322
|
"attributes": [
|
|
322
|
-
"title"
|
|
323
|
+
"title",
|
|
324
|
+
"delayClose"
|
|
323
325
|
]
|
|
324
326
|
},
|
|
325
327
|
"s-dsubmenu": {
|
package/dist/json/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "savor-ui",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.20.0",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -1826,6 +1826,14 @@
|
|
|
1826
1826
|
"kind": "expression"
|
|
1827
1827
|
}
|
|
1828
1828
|
},
|
|
1829
|
+
{
|
|
1830
|
+
"name": "desc",
|
|
1831
|
+
"description": "标题描述",
|
|
1832
|
+
"value": {
|
|
1833
|
+
"type": "string",
|
|
1834
|
+
"kind": "expression"
|
|
1835
|
+
}
|
|
1836
|
+
},
|
|
1829
1837
|
{
|
|
1830
1838
|
"name": "header",
|
|
1831
1839
|
"description": "头部",
|
|
@@ -1949,6 +1957,14 @@
|
|
|
1949
1957
|
"type": "string",
|
|
1950
1958
|
"kind": "expression"
|
|
1951
1959
|
}
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
"name": "delayClose",
|
|
1963
|
+
"description": "延迟关闭(用于卸载组件时延迟关闭)",
|
|
1964
|
+
"value": {
|
|
1965
|
+
"type": "boolean",
|
|
1966
|
+
"kind": "expression"
|
|
1967
|
+
}
|
|
1952
1968
|
}
|
|
1953
1969
|
],
|
|
1954
1970
|
"events": [],
|