savor-ui 0.15.3 → 0.15.5
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/cascader/cascader-column.vue_vue_type_script_setup_true_vapor_true_lang.mjs +25 -23
- package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs +109 -104
- package/dist/es/components/src/dropdown/dropdown.vue_vue_type_script_setup_true_vapor_true_lang.mjs +1 -1
- package/dist/es/components/src/input/input.vue_vue_type_script_setup_true_vapor_true_lang.mjs +3 -1
- package/dist/es/components/src/popover/popover.vue_vue_type_script_setup_true_vapor_true_lang.mjs +61 -52
- package/dist/es/components/src/popover/types.d.ts +2 -0
- package/dist/json/web-types.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [0.15.5](https://gitee.com/mach552/savor-ui/compare/v0.15.4...v0.15.5) (2026-08-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **popover:** 修复切换页面无法关闭问题 ([8317b1f](https://gitee.com/mach552/savor-ui/commits/8317b1f28589c11219e9109339f259e055f5cb5e))
|
|
11
|
+
|
|
12
|
+
## [0.15.4](https://gitee.com/mach552/savor-ui/compare/v0.15.3...v0.15.4) (2026-08-04)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **cascader:** 修复输入框聚焦逻辑 ([a2b0716](https://gitee.com/mach552/savor-ui/commits/a2b07160fd609dfeaaf720ff5f8be8d1403c2eac))
|
|
18
|
+
* **popover:** 修复切换页面后无法关闭问题 ([ffaf459](https://gitee.com/mach552/savor-ui/commits/ffaf4591e5485eb086ca8cb48e03fa9a3bcabe56))
|
|
19
|
+
|
|
5
20
|
## [0.15.3](https://gitee.com/mach552/savor-ui/compare/v0.15.2...v0.15.3) (2026-08-04)
|
|
6
21
|
|
|
7
22
|
|
|
@@ -5,9 +5,9 @@ import "../../../icons/index.mjs";
|
|
|
5
5
|
import { SScrollbar as n } from "../scrollbar/index.mjs";
|
|
6
6
|
import { SCheckbox as r } from "../checkbox/index.mjs";
|
|
7
7
|
import { SRadio as i } from "../radio/index.mjs";
|
|
8
|
-
import { child as a, computed as o, createComponent as s, createComponentWithFallback as c, createFor as l, createIf as u, defineVaporComponent as d, mergeModels as f, nextTick as p, on as m, onMounted as h, ref as g, renderEffect as _, resolveComponent as
|
|
8
|
+
import { child as a, computed as o, createComponent as s, createComponentWithFallback as c, createFor as l, createIf as u, defineVaporComponent as d, mergeModels as f, nextTick as p, on as m, onMounted as h, ref as g, renderEffect as _, resolveComponent as ee, setClass as v, setInsertionState as y, setProp as b, setStaticTemplateRef as x, setStyle as S, setText as C, template as w, toDisplayString as T, txt as E, unref as D, useModel as O, useTemplateRef as k, watch as A, withModifiers as j } from "vue";
|
|
9
9
|
//#region ../components/src/cascader/cascader-column.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
10
|
-
var M =
|
|
10
|
+
var M = w("<div>"), N = w("<div><div> </div>"), P = /*@__PURE__*/ d({
|
|
11
11
|
name: "SCascaderColumn",
|
|
12
12
|
__name: "cascader-column",
|
|
13
13
|
props: /*@__PURE__*/ f({
|
|
@@ -47,12 +47,12 @@ var M = T("<div>"), N = T("<div><div> </div>"), P = /*@__PURE__*/ d({
|
|
|
47
47
|
]),
|
|
48
48
|
__multiRoot: !0,
|
|
49
49
|
setup(d, { emit: f }) {
|
|
50
|
-
let
|
|
50
|
+
let w = f, P = d, F = f, I = e("cascader"), L = o(() => ({
|
|
51
51
|
label: "label",
|
|
52
52
|
key: "key",
|
|
53
53
|
children: "children",
|
|
54
54
|
...P.fieldNames
|
|
55
|
-
})), R =
|
|
55
|
+
})), R = k("scrollbarRef"), z = O(d, "modelValue"), B = O(d, "expandedKeys"), V = O(d, "expanded"), H = g([]), U = g([]), W = g(!0), G = o(() => {
|
|
56
56
|
let e = z.value;
|
|
57
57
|
if (!Array.isArray(e)) {
|
|
58
58
|
if (P.pathMode && typeof e == "string" && e !== "") {
|
|
@@ -104,44 +104,46 @@ var M = T("<div>"), N = T("<div><div> </div>"), P = /*@__PURE__*/ d({
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
|
-
let ne =
|
|
108
|
-
return _(() =>
|
|
107
|
+
let ne = ee("CascaderColumn", !0), $ = M();
|
|
108
|
+
return _(() => v($, [D(I).e("column")])), y($, null, 0), x(s(D(n), { height: "100%" }, () => {
|
|
109
109
|
let e = M();
|
|
110
|
-
return _(() =>
|
|
110
|
+
return _(() => v(e, [D(I).e("list")])), y(e, null, 0), l(() => H.value, (e) => {
|
|
111
111
|
let n = N(), o = a(n, 1);
|
|
112
112
|
_(() => {
|
|
113
|
-
let t =
|
|
114
|
-
|
|
115
|
-
}),
|
|
113
|
+
let t = D(I), r = L.value;
|
|
114
|
+
v(n, [t.e("item"), t.is("checked", e.value[r.key] === B.value[d.id])]);
|
|
115
|
+
}), y(n, 0, 0), u(() => d.checkStrictly || d.multiple, () => {
|
|
116
116
|
let t = M();
|
|
117
|
-
return _(() =>
|
|
118
|
-
let t = () => Y(e.value), n = () => {};
|
|
119
|
-
return s(
|
|
117
|
+
return _(() => v(t, [D(I).e("check")])), y(t, null, 0), u(() => d.checkStrictly && !d.multiple, () => {
|
|
118
|
+
let t = () => Y(e.value), n = () => {}, r = () => {};
|
|
119
|
+
return s(D(i), {
|
|
120
120
|
value: () => e.value[L.value.key],
|
|
121
121
|
"model-value": () => G.value,
|
|
122
122
|
onChange: () => t,
|
|
123
|
-
onClick: () => j(n, ["stop"])
|
|
123
|
+
onClick: () => j(n, ["stop"]),
|
|
124
|
+
onMousedown: () => j(r, ["prevent"])
|
|
124
125
|
});
|
|
125
126
|
}, () => u(() => d.multiple, () => {
|
|
126
|
-
let t = (t) => X(t, e.value), n = () => {};
|
|
127
|
-
return s(
|
|
127
|
+
let t = (t) => X(t, e.value), n = () => {}, i = () => {};
|
|
128
|
+
return s(D(r), {
|
|
128
129
|
"model-value": () => q(e.value),
|
|
129
130
|
onChange: () => t,
|
|
130
|
-
onClick: () => j(n, ["stop"])
|
|
131
|
+
onClick: () => j(n, ["stop"]),
|
|
132
|
+
onMousedown: () => j(i, ["prevent"])
|
|
131
133
|
});
|
|
132
134
|
}), 261), t;
|
|
133
135
|
});
|
|
134
|
-
let c =
|
|
136
|
+
let c = E(o);
|
|
135
137
|
return _(() => {
|
|
136
138
|
let t = L.value;
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
+
v(o, [D(I).e("label")]), S(o, { padding: d.checkStrictly || d.multiple ? "0 12px" : "0 16px" }), C(c, T(e.value[t.label]));
|
|
140
|
+
}), y(n, null, 2), u(() => e.value.isFolder, () => {
|
|
139
141
|
let e = M();
|
|
140
|
-
return _(() =>
|
|
141
|
-
}), m(n, "click", j(() => J(e.value), ["stop"])), m(n, "mouseenter", j(() => te(e.value), ["stop"])),
|
|
142
|
+
return _(() => v(e, [D(I).e("arrow")])), y(e, null, 0), s(D(t)), e;
|
|
143
|
+
}), m(n, "click", j(() => J(e.value), ["stop"])), m(n, "mouseenter", j(() => te(e.value), ["stop"])), b(n, "id", `item-${e.value[L.value.key]}`), n;
|
|
142
144
|
}, (e) => e[L.value.key], 9), e;
|
|
143
145
|
}), R, null, "scrollbarRef"), [$, u(() => U.value.length > 0 && W.value, () => {
|
|
144
|
-
let e = (e) =>
|
|
146
|
+
let e = (e) => w("clickItem", e), t = (e) => w("expand", e);
|
|
145
147
|
return c(ne, {
|
|
146
148
|
options: () => U.value,
|
|
147
149
|
onClickItem: () => e,
|
package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -6,15 +6,15 @@ import { useFormItem as n } from "../form/use-form-item.mjs";
|
|
|
6
6
|
import { SPopover as r } from "../popover/index.mjs";
|
|
7
7
|
import { SInput as i } from "../input/index.mjs";
|
|
8
8
|
import { SEmpty as a } from "../empty/index.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { computed as
|
|
9
|
+
import ee from "./cascader-column.vue.mjs";
|
|
10
|
+
import { computed as o, createComponent as s, createComponentWithFallback as c, createIf as te, createInvoker as l, createTemplateRefSetter as u, defineVaporComponent as d, delegateEvents as f, mergeModels as p, on as m, onMounted as h, ref as g, renderEffect as _, resolveComponent as ne, setClass as v, setInsertionState as y, template as b, toRefs as x, unref as S, useModel as C, useTemplateRef as w, watch as T, withModifiers as E, withVaporModifiers as D } from "vue";
|
|
11
11
|
//#region ../components/src/cascader/cascader.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var
|
|
12
|
+
var re = b("<div style=\"padding: 12px\">"), ie = b("<div>"), ae = b("<div data-skip-blur-validation>"), oe = b("<div>", 1);
|
|
13
|
+
f("mousedown", "focusin", "click");
|
|
14
|
+
var O = /*@__PURE__*/ d({
|
|
15
15
|
name: "SCascader",
|
|
16
16
|
__name: "cascader",
|
|
17
|
-
props: /*@__PURE__*/
|
|
17
|
+
props: /*@__PURE__*/ p({
|
|
18
18
|
modelValue: {},
|
|
19
19
|
options: { default: () => [] },
|
|
20
20
|
placeholder: { default: "请选择" },
|
|
@@ -42,7 +42,7 @@ var j = /*@__PURE__*/ p({
|
|
|
42
42
|
expanded: { default: () => [] },
|
|
43
43
|
expandedModifiers: {}
|
|
44
44
|
}),
|
|
45
|
-
emits: /*@__PURE__*/
|
|
45
|
+
emits: /*@__PURE__*/ p([
|
|
46
46
|
"selectItem",
|
|
47
47
|
"expand",
|
|
48
48
|
"clear"
|
|
@@ -51,139 +51,144 @@ var j = /*@__PURE__*/ p({
|
|
|
51
51
|
"update:expandedKeys",
|
|
52
52
|
"update:expanded"
|
|
53
53
|
]),
|
|
54
|
-
setup(
|
|
55
|
-
let
|
|
56
|
-
size:
|
|
57
|
-
error:
|
|
58
|
-
}),
|
|
54
|
+
setup(d, { emit: f }) {
|
|
55
|
+
let p = d, b = e("cascader"), O = f, k = w("inputRef"), A = C(d, "modelValue"), { size: j, error: M } = x(p), { mergedSize: N, mergedError: P } = n({
|
|
56
|
+
size: j,
|
|
57
|
+
error: M
|
|
58
|
+
}), F = C(d, "expandedKeys"), I = C(d, "expanded"), L = o(() => ({
|
|
59
59
|
label: "label",
|
|
60
60
|
key: "key",
|
|
61
61
|
children: "children",
|
|
62
|
-
...
|
|
63
|
-
})),
|
|
64
|
-
if (
|
|
65
|
-
let r = e[
|
|
66
|
-
n ? i !== -1 && (
|
|
62
|
+
...p.fieldNames
|
|
63
|
+
})), R = g(""), z = g([]), B = (e) => p.pathMode ? e.map((e) => e[L.value.key]).join(p.pathSeparator) : e[e.length - 1][L.value.key], V = (e) => e.map((e) => e[L.value.label]).join(p.pathSeparator), H = ({ item: e, expandeds: t, unchecked: n }) => {
|
|
64
|
+
if (p.multiple) {
|
|
65
|
+
let r = e[L.value.key], i = z.value.findIndex((e) => e[e.length - 1][L.value.key] === r);
|
|
66
|
+
n ? i !== -1 && (z.value = z.value.toSpliced(i, 1)) : i === -1 && (z.value = [...z.value, t]), A.value = z.value.map(B), R.value = z.value.map(V).join(", "), O("selectItem", {
|
|
67
67
|
item: e,
|
|
68
68
|
expandeds: t
|
|
69
69
|
});
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
R.value = V(t), A.value = B(t), O("selectItem", {
|
|
73
73
|
item: e,
|
|
74
74
|
expandeds: t
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
let e = !
|
|
82
|
-
e &&
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
},
|
|
75
|
+
}), K(!1);
|
|
76
|
+
}, U = () => {
|
|
77
|
+
O("expand", F.value);
|
|
78
|
+
}, W = w("popoverRef"), G = g(!1), K = (e) => {
|
|
79
|
+
G.value = e, e ? W.value?.show() : W.value?.hide();
|
|
80
|
+
}, se = () => {
|
|
81
|
+
let e = !G.value;
|
|
82
|
+
e && Y(), K(e);
|
|
83
|
+
}, ce = () => {
|
|
84
|
+
K(!1);
|
|
85
|
+
}, le = (e) => {
|
|
86
|
+
e.target && k.value?.focus();
|
|
87
|
+
}, q = (e, t, n = []) => {
|
|
86
88
|
for (let r of e) {
|
|
87
89
|
let e = [...n, r];
|
|
88
|
-
if (r[
|
|
89
|
-
if (r[
|
|
90
|
-
let n =
|
|
90
|
+
if (r[L.value.key] === t) return e;
|
|
91
|
+
if (r[L.value.children]) {
|
|
92
|
+
let n = q(r[L.value.children], t, e);
|
|
91
93
|
if (n) return n;
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
return null;
|
|
95
|
-
},
|
|
97
|
+
}, J = (e, t) => {
|
|
96
98
|
let n = [], r = e;
|
|
97
99
|
for (let e of t) {
|
|
98
|
-
let t = r.find((t) => t[
|
|
100
|
+
let t = r.find((t) => t[L.value.key] === e);
|
|
99
101
|
if (!t) return null;
|
|
100
|
-
n.push(t), r = t[
|
|
102
|
+
n.push(t), r = t[L.value.children] || [];
|
|
101
103
|
}
|
|
102
104
|
return n;
|
|
103
|
-
},
|
|
104
|
-
if (
|
|
105
|
-
|
|
105
|
+
}, Y = () => {
|
|
106
|
+
if (A.value === void 0 || A.value === "") {
|
|
107
|
+
R.value = "", F.value = [], I.value = [], z.value = [];
|
|
106
108
|
return;
|
|
107
109
|
}
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
if (
|
|
111
|
-
let t = e.split(
|
|
112
|
-
return
|
|
110
|
+
if (p.multiple) {
|
|
111
|
+
z.value = (Array.isArray(A.value) ? A.value : []).map((e) => {
|
|
112
|
+
if (p.pathMode && typeof e == "string") {
|
|
113
|
+
let t = e.split(p.pathSeparator);
|
|
114
|
+
return J(p.options, t);
|
|
113
115
|
}
|
|
114
|
-
return
|
|
115
|
-
}).filter((e) => e !== null),
|
|
116
|
+
return q(p.options, e);
|
|
117
|
+
}).filter((e) => e !== null), R.value = z.value.map(V).join(", ");
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
120
|
let e = null;
|
|
119
|
-
if (
|
|
120
|
-
let t =
|
|
121
|
-
e =
|
|
122
|
-
} else Array.isArray(
|
|
123
|
-
e && (
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}) :
|
|
128
|
-
},
|
|
129
|
-
|
|
121
|
+
if (p.pathMode && typeof A.value == "string") {
|
|
122
|
+
let t = A.value.split(p.pathSeparator);
|
|
123
|
+
e = J(p.options, t);
|
|
124
|
+
} else Array.isArray(A.value) || (e = q(p.options, A.value));
|
|
125
|
+
e && (F.value = e.map((e) => e[L.value.key]), I.value = e, R.value = V(e));
|
|
126
|
+
}, X = (e) => {
|
|
127
|
+
A.value === void 0 ? e.forEach((e) => {
|
|
128
|
+
F.value.includes(e[L.value.key]) && (R.value = R.value ? `${R.value}${p.pathSeparator}${e[L.value.label]}` : e[L.value.label], e[L.value.children] && X(e[L.value.children]));
|
|
129
|
+
}) : Y();
|
|
130
|
+
}, ue = () => {
|
|
131
|
+
A.value = p.multiple ? [] : "", F.value = [], I.value = [], z.value = [], R.value = "", O("clear");
|
|
130
132
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}),
|
|
134
|
-
|
|
133
|
+
T(A, () => {
|
|
134
|
+
Y();
|
|
135
|
+
}), h(() => {
|
|
136
|
+
X(p.options);
|
|
135
137
|
});
|
|
136
|
-
let
|
|
137
|
-
return
|
|
138
|
+
let Z = u(), Q = ne("SIcon"), $ = oe();
|
|
139
|
+
return _(() => v($, [S(b).b()])), y($, null, 0), Z(s(S(r), { $: [() => ({
|
|
138
140
|
offset: [0, 4],
|
|
139
141
|
placement: "bottom-start",
|
|
140
142
|
manual: !0,
|
|
141
|
-
...
|
|
142
|
-
}), { onClickOutside: () =>
|
|
143
|
+
...d.popoverProps
|
|
144
|
+
}), { onClickOutside: () => ce }] }, {
|
|
143
145
|
content: () => {
|
|
144
|
-
let e =
|
|
145
|
-
return
|
|
146
|
-
let e =
|
|
147
|
-
return
|
|
146
|
+
let e = ae();
|
|
147
|
+
return _(() => v(e, [S(b).e("wrapper")])), y(e, null, 0), te(() => !d.options.length, () => {
|
|
148
|
+
let e = re();
|
|
149
|
+
return y(e, null, 0), s(S(a)), e;
|
|
148
150
|
}, () => {
|
|
149
|
-
let e =
|
|
150
|
-
return
|
|
151
|
-
expandTrigger: () =>
|
|
152
|
-
fieldNames: () =>
|
|
153
|
-
options: () =>
|
|
154
|
-
checkStrictly: () =>
|
|
155
|
-
multiple: () =>
|
|
156
|
-
pathMode: () =>
|
|
157
|
-
pathSeparator: () =>
|
|
158
|
-
onClickItem: () =>
|
|
159
|
-
onExpand: () =>
|
|
160
|
-
modelValue: () =>
|
|
161
|
-
"onUpdate:modelValue": () => (e) =>
|
|
162
|
-
expanded: () =>
|
|
163
|
-
"onUpdate:expanded": () => (e) =>
|
|
164
|
-
expandedKeys: () =>
|
|
165
|
-
"onUpdate:expandedKeys": () => (e) =>
|
|
151
|
+
let e = ie();
|
|
152
|
+
return _(() => v(e, [S(b).e("panel")])), y(e, null, 0), s(ee, {
|
|
153
|
+
expandTrigger: () => d.expandTrigger,
|
|
154
|
+
fieldNames: () => d.fieldNames,
|
|
155
|
+
options: () => d.options,
|
|
156
|
+
checkStrictly: () => d.checkStrictly,
|
|
157
|
+
multiple: () => d.multiple,
|
|
158
|
+
pathMode: () => d.pathMode,
|
|
159
|
+
pathSeparator: () => d.pathSeparator,
|
|
160
|
+
onClickItem: () => H,
|
|
161
|
+
onExpand: () => U,
|
|
162
|
+
modelValue: () => A.value,
|
|
163
|
+
"onUpdate:modelValue": () => (e) => A.value = e,
|
|
164
|
+
expanded: () => I.value,
|
|
165
|
+
"onUpdate:expanded": () => (e) => I.value = e,
|
|
166
|
+
expandedKeys: () => F.value,
|
|
167
|
+
"onUpdate:expandedKeys": () => (e) => F.value = e
|
|
166
168
|
}), e;
|
|
167
|
-
}, 261),
|
|
169
|
+
}, 261), m(e, "click", E(() => {}, ["stop"])), e.$evtmousedown = D(() => {}, ["prevent"]), e.$evtfocusin = l(le), e;
|
|
168
170
|
},
|
|
169
|
-
default: () =>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
171
|
+
default: () => {
|
|
172
|
+
let e = s(S(i), {
|
|
173
|
+
placeholder: () => d.placeholder,
|
|
174
|
+
disabled: () => d.disabled,
|
|
175
|
+
error: () => S(P),
|
|
176
|
+
size: () => S(N),
|
|
177
|
+
filled: () => d.filled,
|
|
178
|
+
modelValue: () => R.value,
|
|
179
|
+
"onUpdate:modelValue": () => (e) => R.value = e,
|
|
180
|
+
readonly: "",
|
|
181
|
+
clearable: () => d.clearable,
|
|
182
|
+
style: "width: 100%",
|
|
183
|
+
onClear: () => ue
|
|
184
|
+
}, { suffix: () => c(Q, {
|
|
185
|
+
class: () => [S(b).e("suffix-icon")],
|
|
186
|
+
style: () => ({ transform: G.value ? "rotate(180deg)" : "" })
|
|
187
|
+
}, () => s(S(t))) });
|
|
188
|
+
return Z(e, k, null, "inputRef"), e;
|
|
189
|
+
}
|
|
190
|
+
}), W, null, "popoverRef"), $.$evtclick = l(se), $;
|
|
186
191
|
}
|
|
187
192
|
});
|
|
188
193
|
//#endregion
|
|
189
|
-
export {
|
|
194
|
+
export { O as default };
|
package/dist/es/components/src/dropdown/dropdown.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -11,7 +11,7 @@ var m = d("<div>"), h = d("<div>", 1), g = /*@__PURE__*/ a({
|
|
|
11
11
|
setup(a) {
|
|
12
12
|
let d = e("dropdown"), g = p("popoverRef");
|
|
13
13
|
o(n, { itemClick: () => {
|
|
14
|
-
g.value?.
|
|
14
|
+
g.value?.hideImmediate?.();
|
|
15
15
|
} });
|
|
16
16
|
let _ = h();
|
|
17
17
|
return s(() => c(_, [f(d).b()])), l(_, null, 0), u(r(f(t), { $: [() => ({
|
package/dist/es/components/src/input/input.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -70,7 +70,9 @@ var A = /*@__PURE__*/ d({
|
|
|
70
70
|
}, de = (e) => {
|
|
71
71
|
M("focus", e);
|
|
72
72
|
}, fe = (e) => {
|
|
73
|
-
M("blur", e)
|
|
73
|
+
M("blur", e);
|
|
74
|
+
let t = e.relatedTarget;
|
|
75
|
+
t && t.closest("[data-skip-blur-validation]") || Y("blur");
|
|
74
76
|
}, pe = (e) => {
|
|
75
77
|
M("press-enter", z.value, e);
|
|
76
78
|
}, J = ae("inputRef");
|
package/dist/es/components/src/popover/popover.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
|
4
4
|
import { useOutsideClick as n } from "../../../hooks/src/use-outside-click.mjs";
|
|
5
5
|
import { useZIndex as r } from "../../../hooks/src/use-zIndex.mjs";
|
|
6
6
|
import "../../../hooks/index.mjs";
|
|
7
|
-
import { VaporTeleport as i, VaporTransition as a, applyVShow as o, child as s, computed as c, createComponent as l, createDynamicComponent as ee, createIf as
|
|
8
|
-
import { arrow as
|
|
7
|
+
import { VaporTeleport as i, VaporTransition as a, applyVShow as o, child as s, computed as c, createComponent as l, createDynamicComponent as ee, createIf as te, createSlot as ne, createTemplateRefSetter as re, defineVaporComponent as u, nextTick as d, onDeactivated as ie, onMounted as ae, onUnmounted as oe, ref as f, renderEffect as p, setClass as m, setDynamicEvents as h, setInsertionState as g, setStyle as _, setText as se, template as v, toDisplayString as ce, unref as y, useSlots as le, useTemplateRef as b, watch as x, watchEffect as ue } from "vue";
|
|
8
|
+
import { arrow as de, autoUpdate as fe, computePosition as pe, flip as me, offset as he, shift as ge } from "@floating-ui/dom";
|
|
9
9
|
//#region ../components/src/popover/popover.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var _e = v(" "), ve = v("<div data-popover-arrow>"), ye = v("<div>"), be = v("<div><div>"), S = /*@__PURE__*/ u({
|
|
11
11
|
name: "SPopover",
|
|
12
12
|
__name: "popover",
|
|
13
13
|
props: {
|
|
@@ -34,9 +34,9 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
|
|
|
34
34
|
},
|
|
35
35
|
emits: ["change", "click-outside"],
|
|
36
36
|
__multiRoot: !0,
|
|
37
|
-
setup(
|
|
38
|
-
let C =
|
|
39
|
-
let e =
|
|
37
|
+
setup(u, { expose: v, emit: S }) {
|
|
38
|
+
let C = u, w = S, T = t("popover"), xe = le(), E = f(!1), D = f(!1), { nextZIndex: Se } = r(), O = f(), k = b("containerNode"), A = b("wrapperNode"), j = b("contentNode"), M = f(null), Ce = () => {
|
|
39
|
+
let e = xe.default?.();
|
|
40
40
|
return M.value = e, e;
|
|
41
41
|
}, N = f(null), P = f({}), F = f({}), I = f({}), L = f(null), R = () => {
|
|
42
42
|
N.value && Object.entries(F.value).forEach(([e, t]) => {
|
|
@@ -66,25 +66,25 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
|
|
|
66
66
|
if (!e || N.value) return;
|
|
67
67
|
let t = null;
|
|
68
68
|
t = e instanceof HTMLElement ? e : B(e), t && t !== N.value && (R(), N.value = t);
|
|
69
|
-
}, { flush: "post" }),
|
|
69
|
+
}, { flush: "post" }), ae(() => {
|
|
70
70
|
if (N.value) return;
|
|
71
71
|
let e = M.value;
|
|
72
72
|
if (!e) return;
|
|
73
73
|
let t = e instanceof HTMLElement ? e : B(e);
|
|
74
74
|
t && t !== N.value && (R(), N.value = t);
|
|
75
75
|
}), x(N, (e) => {
|
|
76
|
-
e &&
|
|
76
|
+
e && d().then(() => {
|
|
77
77
|
Object.entries(F.value).forEach(([t, n]) => {
|
|
78
78
|
e.addEventListener(t, n);
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
81
|
}, { flush: "post" });
|
|
82
|
-
let
|
|
82
|
+
let we = () => {
|
|
83
83
|
if (!j.value || !N.value) return;
|
|
84
84
|
j.value.style.width = "";
|
|
85
85
|
let e = "";
|
|
86
86
|
typeof C.width == "number" ? (e = `${C.width}px`, j.value.style.width = e) : C.width === "sameWidth" ? (e = `${N.value.getBoundingClientRect().width}px`, j.value.style.width = e) : C.width === "auto" && (e = "", j.value.style.width = e);
|
|
87
|
-
},
|
|
87
|
+
}, Te = c(() => C.offset ? C.offset : C.trigger === "contextmenu" && C.alignPoint ? [0, 0] : C.showArrow ? [0, 8] : [0, 0]), V = () => {
|
|
88
88
|
if (C.trigger === "contextmenu" && C.alignPoint && L.value) {
|
|
89
89
|
let e = L.value;
|
|
90
90
|
return { getBoundingClientRect() {
|
|
@@ -104,21 +104,21 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
|
|
|
104
104
|
return N.value;
|
|
105
105
|
}, H = null, U = () => {
|
|
106
106
|
H &&= (H(), null);
|
|
107
|
-
},
|
|
107
|
+
}, Ee = async () => {
|
|
108
108
|
if (!A.value || !N.value) return;
|
|
109
|
-
let e = V(), t = j.value?.querySelector("[data-popover-arrow]"), [n, r] =
|
|
110
|
-
|
|
109
|
+
let e = V(), t = j.value?.querySelector("[data-popover-arrow]"), [n, r] = Te.value, i = [
|
|
110
|
+
he({
|
|
111
111
|
mainAxis: r,
|
|
112
112
|
crossAxis: n
|
|
113
113
|
}),
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
me(),
|
|
115
|
+
ge()
|
|
116
116
|
];
|
|
117
|
-
t && i.push(
|
|
117
|
+
t && i.push(de({
|
|
118
118
|
element: t,
|
|
119
119
|
padding: 8
|
|
120
120
|
}));
|
|
121
|
-
let { x: a, y: o, placement: s, middlewareData: c } = await
|
|
121
|
+
let { x: a, y: o, placement: s, middlewareData: c } = await pe(e, A.value, {
|
|
122
122
|
placement: C.placement,
|
|
123
123
|
strategy: "fixed",
|
|
124
124
|
middleware: i
|
|
@@ -134,35 +134,37 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
|
|
|
134
134
|
top: n == null ? "" : `${n}px`
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
},
|
|
137
|
+
}, W = c(() => C.manual ? {
|
|
138
138
|
openDelay: 0,
|
|
139
139
|
closeDelay: 0
|
|
140
140
|
} : {
|
|
141
141
|
openDelay: typeof C.delay == "number" ? C.delay : C.delay[0],
|
|
142
142
|
closeDelay: typeof C.delay == "number" ? 50 : C.delay[1]
|
|
143
|
-
}),
|
|
144
|
-
C.disabled || (
|
|
143
|
+
}), G = null, De = () => {
|
|
144
|
+
C.disabled || (G &&= (clearTimeout(G), null), D.value = !0, d(() => {
|
|
145
145
|
E.value = !0, w("change", !0);
|
|
146
146
|
}));
|
|
147
|
-
},
|
|
148
|
-
E.value = !1, L.value = null, w("change", !1),
|
|
149
|
-
C.destroyOnClose && (D.value = !1),
|
|
147
|
+
}, K = () => {
|
|
148
|
+
E.value = !1, L.value = null, w("change", !1), G && clearTimeout(G), G = setTimeout(() => {
|
|
149
|
+
C.destroyOnClose && (D.value = !1), G = null;
|
|
150
150
|
}, 300);
|
|
151
|
-
}, q = f(null), J = f(null),
|
|
152
|
-
q.value?.cancel(), J.value?.cancel(), q.value = e(
|
|
151
|
+
}, q = f(null), J = f(null), Oe = () => {
|
|
152
|
+
q.value?.cancel(), J.value?.cancel(), q.value = e(De, W.value.openDelay), J.value = e(K, W.value.closeDelay);
|
|
153
153
|
};
|
|
154
|
-
|
|
154
|
+
Oe(), x(W, Oe);
|
|
155
155
|
let Y = () => {
|
|
156
156
|
J.value?.cancel(), q.value?.();
|
|
157
157
|
}, X = () => {
|
|
158
158
|
q.value?.cancel(), J.value?.();
|
|
159
|
+
}, ke = () => {
|
|
160
|
+
q.value?.cancel(), J.value?.cancel(), K();
|
|
159
161
|
};
|
|
160
162
|
n(k, (e) => {
|
|
161
163
|
N.value && e.target && typeof N.value.contains == "function" && N.value.contains(e.target) || (E.value && w("click-outside", e), !C.manual && (C.trigger === "hover" || C.trigger === "contextmenu" || C.trigger === "click") && X());
|
|
162
164
|
});
|
|
163
|
-
let
|
|
164
|
-
F.value = {}, P.value = {}, I.value = {},
|
|
165
|
-
},
|
|
165
|
+
let Ae = () => {
|
|
166
|
+
F.value = {}, P.value = {}, I.value = {}, Z();
|
|
167
|
+
}, Z = () => {
|
|
166
168
|
C.manual || (C.trigger === "hover" && (F.value.mouseenter = Y, F.value.mouseleave = X, P.value.mouseenter = Y, P.value.mouseleave = X), C.trigger === "click" && (F.value.click = () => {
|
|
167
169
|
let e = E.value ? J.value : q.value;
|
|
168
170
|
(E.value ? q.value : J.value)?.cancel(), e?.();
|
|
@@ -177,54 +179,61 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
|
|
|
177
179
|
}, Y();
|
|
178
180
|
}));
|
|
179
181
|
};
|
|
180
|
-
|
|
181
|
-
C.manual ||
|
|
182
|
+
ue(() => {
|
|
183
|
+
C.manual || Z();
|
|
182
184
|
});
|
|
183
|
-
let
|
|
185
|
+
let je = () => {
|
|
184
186
|
E.value || U();
|
|
185
187
|
};
|
|
186
188
|
x(E, (e) => {
|
|
187
|
-
e && (!A.value || !N.value || (O.value =
|
|
189
|
+
e && (!A.value || !N.value || (O.value = Se(), we(), U(), H = fe(V(), A.value, Ee)));
|
|
188
190
|
}, { flush: "post" }), x([
|
|
189
191
|
() => C.placement,
|
|
190
192
|
() => C.offset,
|
|
191
193
|
() => C.showArrow
|
|
192
194
|
], () => {
|
|
193
|
-
E.value &&
|
|
195
|
+
E.value && Ee();
|
|
194
196
|
}), x(() => C.manual, (e) => {
|
|
195
|
-
e ?
|
|
197
|
+
e ? Ae() : Z();
|
|
196
198
|
}), x(() => C.trigger, (e, t) => {
|
|
197
|
-
e !== t && (q.value?.cancel(), E.value = !1, w("change", !1),
|
|
198
|
-
})
|
|
199
|
-
|
|
199
|
+
e !== t && (q.value?.cancel(), E.value = !1, w("change", !1), Ae());
|
|
200
|
+
});
|
|
201
|
+
let Q = () => {
|
|
202
|
+
q.value?.cancel(), J.value?.cancel(), G &&= (clearTimeout(G), null), E.value = !1, D.value = !1, U();
|
|
203
|
+
};
|
|
204
|
+
ie(() => {
|
|
205
|
+
Q();
|
|
206
|
+
}), oe(() => {
|
|
207
|
+
Q(), R();
|
|
200
208
|
}), v({
|
|
201
209
|
show: Y,
|
|
202
|
-
hide: X
|
|
210
|
+
hide: X,
|
|
211
|
+
hideImmediate: ke
|
|
203
212
|
});
|
|
204
|
-
let $ =
|
|
205
|
-
return [ee(() =>
|
|
206
|
-
disabled: () => !
|
|
207
|
-
to: () =>
|
|
208
|
-
}, () =>
|
|
209
|
-
let e =
|
|
213
|
+
let $ = re();
|
|
214
|
+
return [ee(() => Ce()), l(i, {
|
|
215
|
+
disabled: () => !u.teleportBody,
|
|
216
|
+
to: () => u.teleport
|
|
217
|
+
}, () => te(() => D.value, () => {
|
|
218
|
+
let e = be(), t = s(e);
|
|
210
219
|
return p(() => {
|
|
211
220
|
let n = y(T);
|
|
212
221
|
h(e, P.value), m(e, [n.b()]), m(t, [n.e("wrapper")]), _(t, { zIndex: O.value });
|
|
213
222
|
}), g(t, null, 0), l(a, {
|
|
214
223
|
name: "popover-fade",
|
|
215
|
-
onAfterLeave: () =>
|
|
224
|
+
onAfterLeave: () => je,
|
|
216
225
|
persisted: ""
|
|
217
226
|
}, () => {
|
|
218
|
-
let e =
|
|
227
|
+
let e = ye();
|
|
219
228
|
return p(() => {
|
|
220
229
|
h(e, I.value), m(e, [y(T).e("content")]);
|
|
221
|
-
}), g(e, null, 0),
|
|
222
|
-
let e = ge();
|
|
223
|
-
return p(() => oe(e, se(d.content))), e;
|
|
224
|
-
}), g(e, null, 1), u(() => d.showArrow, () => {
|
|
230
|
+
}), g(e, null, 0), ne("content", null, () => {
|
|
225
231
|
let e = _e();
|
|
232
|
+
return p(() => se(e, ce(u.content))), e;
|
|
233
|
+
}), g(e, null, 1), te(() => u.showArrow, () => {
|
|
234
|
+
let e = ve();
|
|
226
235
|
return p(() => {
|
|
227
|
-
m(e, [y(T).e("arrow")]), _(e,
|
|
236
|
+
m(e, [y(T).e("arrow")]), _(e, u.arrowStyle);
|
|
228
237
|
}), e;
|
|
229
238
|
}), o(e, () => E.value), $(e, j, null, "contentNode"), e;
|
|
230
239
|
}), $(t, A, null, "wrapperNode"), $(e, k, null, "containerNode"), e;
|
package/dist/json/web-types.json
CHANGED