@vaebe/ccui 2.0.0-beta.0 → 2.0.1-beta.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/README.md +4 -0
- package/button/index.es.js +28 -22
- package/button/index.umd.js +1 -1
- package/calendar/index.es.js +445 -90
- package/calendar/index.umd.js +1 -1
- package/ccui-cli.css +1 -1
- package/check-box/index.es.js +8 -2
- package/check-box/index.umd.js +1 -1
- package/chunk-Ndeg2fpE.js +20 -0
- package/collapse/index.es.js +10 -7
- package/collapse/index.umd.js +1 -1
- package/config-provider/chunk-C_CI6nMA.js +13 -0
- package/config-provider/en-BG83iZ_P.js +24 -0
- package/config-provider/index.es.js +408 -53
- package/config-provider/index.umd.js +1 -1
- package/config-provider/ja-B-93MQG5.js +56 -0
- package/config-provider/ko-86th3uXt.js +56 -0
- package/config-provider/zh-cn-BQE-LNg1.js +59 -0
- package/date-picker/ccui-cli.css +1 -1
- package/date-picker/index.es.js +664 -482
- package/date-picker/index.umd.js +1 -1
- package/drawer/index.es.js +271 -279
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +187 -171
- package/dropdown/index.umd.js +1 -1
- package/empty/index.es.js +341 -24
- package/empty/index.umd.js +1 -1
- package/en-BVwCvuzF.js +24 -0
- package/float-button/index.es.js +1134 -46
- package/float-button/index.umd.js +1 -1
- package/form/index.es.js +1357 -261
- package/form/index.umd.js +1 -1
- package/icon/index.es.js +93 -10
- package/icon/index.umd.js +1 -1
- package/image/index.es.js +353 -36
- package/image/index.umd.js +1 -1
- package/input/index.es.js +24 -15
- package/input/index.umd.js +1 -1
- package/input-number/index.es.js +45 -25
- package/input-number/index.umd.js +1 -1
- package/ja-B4U4rt8A.js +56 -0
- package/ko-BG35I8uK.js +56 -0
- package/menu/index.es.js +3 -1
- package/menu/index.umd.js +1 -1
- package/message/index.es.js +1179 -86
- package/message/index.umd.js +1 -1
- package/modal/index.es.js +735 -335
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +1176 -83
- package/notification/index.umd.js +1 -1
- package/package.json +9 -9
- package/pagination/index.es.js +381 -60
- package/pagination/index.umd.js +1 -1
- package/popconfirm/index.es.js +469 -143
- package/popconfirm/index.umd.js +1 -1
- package/popover/index.es.js +192 -175
- package/popover/index.umd.js +1 -1
- package/radio/index.es.js +8 -2
- package/radio/index.umd.js +1 -1
- package/rate/index.es.js +22 -12
- package/rate/index.umd.js +1 -1
- package/select/index.es.js +135 -53
- package/select/index.umd.js +1 -1
- package/slider/index.es.js +165 -155
- package/slider/index.umd.js +1 -1
- package/steps/index.es.js +1140 -49
- package/steps/index.umd.js +1 -1
- package/switch/index.es.js +2 -0
- package/switch/index.umd.js +1 -1
- package/tabs/index.es.js +31 -5
- package/tabs/index.umd.js +1 -1
- package/tag/index.es.js +53 -35
- package/tag/index.umd.js +1 -1
- package/tooltip/index.es.js +78 -77
- package/tooltip/index.umd.js +1 -1
- package/tree/ccui-cli.css +1 -1
- package/tree/index.es.js +1491 -276
- package/tree/index.umd.js +1 -1
- package/typography/index.es.js +1213 -125
- package/typography/index.umd.js +1 -1
- package/vue-ccui.es.js +8726 -7604
- package/vue-ccui.umd.js +1 -1
- package/zh-cn-C8nbfD5S.js +59 -0
package/popover/index.es.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import * as e from "vue";
|
|
2
|
-
import { Teleport as t, Transition as n, computed as r, createVNode as i, defineComponent as a, getCurrentInstance as o, isVNode as s, mergeProps as
|
|
3
|
-
import { arrow as
|
|
2
|
+
import { Teleport as t, Transition as n, computed as r, createVNode as i, defineComponent as a, getCurrentInstance as o, isVNode as s, mergeProps as ee, nextTick as c, onMounted as l, onUnmounted as u, ref as d, watch as f } from "vue";
|
|
3
|
+
import { arrow as p, autoUpdate as m, computePosition as h, flip as g, offset as te, shift as _ } from "@floating-ui/dom";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
|
-
var
|
|
5
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.getOwnPropertyNames, x = Object.prototype.hasOwnProperty, S = (e, t) => {
|
|
6
6
|
let n = {};
|
|
7
|
-
for (var r in e)
|
|
7
|
+
for (var r in e) v(n, r, {
|
|
8
8
|
get: e[r],
|
|
9
9
|
enumerable: !0
|
|
10
10
|
});
|
|
11
|
-
return t ||
|
|
12
|
-
},
|
|
13
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
11
|
+
return t || v(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
12
|
+
}, C = (e, t, n, r) => {
|
|
13
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = b(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !x.call(e, s) && s !== n && v(e, s, {
|
|
14
14
|
get: ((e) => t[e]).bind(null, s),
|
|
15
|
-
enumerable: !(r =
|
|
15
|
+
enumerable: !(r = y(t, s)) || r.enumerable
|
|
16
16
|
});
|
|
17
17
|
return e;
|
|
18
|
-
},
|
|
18
|
+
}, w = (e, t, n) => (C(e, t, "default"), n && C(n, t, "default"));
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
21
|
-
function
|
|
21
|
+
function T() {
|
|
22
22
|
return typeof window < "u";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function E(e) {
|
|
25
|
+
return O(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function D(e) {
|
|
28
28
|
var t;
|
|
29
29
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function O(e) {
|
|
32
|
+
return T() ? e instanceof Node || e instanceof D(e).Node : !1;
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region ../../node_modules/.pnpm/vue-demi@0.14.10_vue@3.5.33_typescript@5.9.3_/node_modules/vue-demi/lib/index.mjs
|
|
36
|
-
var
|
|
36
|
+
var k = /* @__PURE__ */ S({
|
|
37
37
|
Vue: () => e,
|
|
38
38
|
Vue2: () => void 0,
|
|
39
|
-
del: () =>
|
|
40
|
-
install: () =>
|
|
39
|
+
del: () => N,
|
|
40
|
+
install: () => j,
|
|
41
41
|
isVue2: () => !1,
|
|
42
42
|
isVue3: () => !0,
|
|
43
|
-
set: () =>
|
|
43
|
+
set: () => M
|
|
44
44
|
});
|
|
45
|
-
import * as
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
function
|
|
45
|
+
import * as A from "vue";
|
|
46
|
+
w(k, A);
|
|
47
|
+
function j() {}
|
|
48
|
+
function M(e, t, n) {
|
|
49
49
|
return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function N(e, t) {
|
|
52
52
|
if (Array.isArray(e)) {
|
|
53
53
|
e.splice(t, 1);
|
|
54
54
|
return;
|
|
@@ -57,131 +57,137 @@ function P(e, t) {
|
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region ../../node_modules/.pnpm/@floating-ui+vue@1.1.9_vue@3.5.33_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.mjs
|
|
60
|
-
function
|
|
60
|
+
function P(e) {
|
|
61
61
|
return typeof e == "object" && !!e && "$el" in e;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
63
|
+
function F(e) {
|
|
64
|
+
if (P(e)) {
|
|
65
65
|
let t = e.$el;
|
|
66
|
-
return
|
|
66
|
+
return O(t) && E(t) === "#comment" ? null : t;
|
|
67
67
|
}
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return typeof e == "function" ? e() : (0,
|
|
70
|
+
function I(e) {
|
|
71
|
+
return typeof e == "function" ? e() : (0, k.unref)(e);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ne(e) {
|
|
74
74
|
return {
|
|
75
75
|
name: "arrow",
|
|
76
76
|
options: e,
|
|
77
77
|
fn(t) {
|
|
78
|
-
let n = I(
|
|
79
|
-
return n == null ? {} :
|
|
78
|
+
let n = F(I(e.element));
|
|
79
|
+
return n == null ? {} : p({
|
|
80
80
|
element: n,
|
|
81
81
|
padding: e.padding
|
|
82
82
|
}).fn(t);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function L(e) {
|
|
87
87
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
let n =
|
|
89
|
+
function R(e, t) {
|
|
90
|
+
let n = L(e);
|
|
91
91
|
return Math.round(t * n) / n;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function re(e, t, n) {
|
|
94
94
|
n === void 0 && (n = {});
|
|
95
|
-
let r = n.whileElementsMounted, i = (0,
|
|
95
|
+
let r = n.whileElementsMounted, i = (0, k.computed)(() => I(n.open) ?? !0), a = (0, k.computed)(() => I(n.middleware)), o = (0, k.computed)(() => I(n.placement) ?? "bottom"), s = (0, k.computed)(() => I(n.strategy) ?? "absolute"), ee = (0, k.computed)(() => I(n.transform) ?? !0), c = (0, k.computed)(() => F(e.value)), l = (0, k.computed)(() => F(t.value)), u = (0, k.ref)(0), d = (0, k.ref)(0), f = (0, k.ref)(s.value), p = (0, k.ref)(o.value), m = (0, k.shallowRef)({}), g = (0, k.ref)(!1), te = (0, k.computed)(() => {
|
|
96
96
|
let e = {
|
|
97
|
-
position:
|
|
97
|
+
position: f.value,
|
|
98
98
|
left: "0",
|
|
99
99
|
top: "0"
|
|
100
100
|
};
|
|
101
|
-
if (!
|
|
102
|
-
let t =
|
|
103
|
-
return
|
|
101
|
+
if (!l.value) return e;
|
|
102
|
+
let t = R(l.value, u.value), n = R(l.value, d.value);
|
|
103
|
+
return ee.value ? {
|
|
104
104
|
...e,
|
|
105
105
|
transform: "translate(" + t + "px, " + n + "px)",
|
|
106
|
-
...
|
|
106
|
+
...L(l.value) >= 1.5 && { willChange: "transform" }
|
|
107
107
|
} : {
|
|
108
|
-
position:
|
|
108
|
+
position: f.value,
|
|
109
109
|
left: t + "px",
|
|
110
110
|
top: n + "px"
|
|
111
111
|
};
|
|
112
|
-
}),
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
112
|
+
}), _;
|
|
113
|
+
function v() {
|
|
114
|
+
if (c.value == null || l.value == null) return;
|
|
115
115
|
let e = i.value;
|
|
116
|
-
|
|
116
|
+
h(c.value, l.value, {
|
|
117
117
|
middleware: a.value,
|
|
118
118
|
placement: o.value,
|
|
119
119
|
strategy: s.value
|
|
120
120
|
}).then((t) => {
|
|
121
|
-
|
|
121
|
+
u.value = t.x, d.value = t.y, f.value = t.strategy, p.value = t.placement, m.value = t.middlewareData, g.value = e !== !1;
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
typeof
|
|
124
|
+
function y() {
|
|
125
|
+
typeof _ == "function" && (_(), _ = void 0);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
if (
|
|
129
|
-
|
|
127
|
+
function b() {
|
|
128
|
+
if (y(), r === void 0) {
|
|
129
|
+
v();
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
if (
|
|
133
|
-
|
|
132
|
+
if (c.value != null && l.value != null) {
|
|
133
|
+
_ = r(c.value, l.value, v);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
i.value || (
|
|
137
|
+
function x() {
|
|
138
|
+
i.value || (g.value = !1);
|
|
139
139
|
}
|
|
140
|
-
return (0,
|
|
140
|
+
return (0, k.watch)([
|
|
141
141
|
a,
|
|
142
142
|
o,
|
|
143
143
|
s,
|
|
144
144
|
i
|
|
145
|
-
],
|
|
146
|
-
x: (0,
|
|
147
|
-
y: (0,
|
|
148
|
-
strategy: (0,
|
|
149
|
-
placement: (0,
|
|
150
|
-
middlewareData: (0,
|
|
151
|
-
isPositioned: (0,
|
|
152
|
-
floatingStyles:
|
|
153
|
-
update:
|
|
145
|
+
], v, { flush: "sync" }), (0, k.watch)([c, l], b, { flush: "sync" }), (0, k.watch)(i, x, { flush: "sync" }), (0, k.getCurrentScope)() && (0, k.onScopeDispose)(y), {
|
|
146
|
+
x: (0, k.shallowReadonly)(u),
|
|
147
|
+
y: (0, k.shallowReadonly)(d),
|
|
148
|
+
strategy: (0, k.shallowReadonly)(f),
|
|
149
|
+
placement: (0, k.shallowReadonly)(p),
|
|
150
|
+
middlewareData: (0, k.shallowReadonly)(m),
|
|
151
|
+
isPositioned: (0, k.shallowReadonly)(g),
|
|
152
|
+
floatingStyles: te,
|
|
153
|
+
update: v
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
|
-
//#region ../ccui/ui/shared/
|
|
158
|
-
var
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
-
B.has(r) || (B.add(r), typeof console < "u" && console.warn(`[ccui][${e}] ${t} 已 deprecated,请改用 ${n}。`));
|
|
157
|
+
//#region ../ccui/ui/shared/utils/deprecated.ts
|
|
158
|
+
var z = /* @__PURE__ */ new Set();
|
|
159
|
+
function ie() {
|
|
160
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
162
161
|
}
|
|
163
|
-
function
|
|
162
|
+
function B(e, t, n) {
|
|
163
|
+
if (!ie()) return;
|
|
164
|
+
let r = n ? `${n}.${e}` : e;
|
|
165
|
+
if (z.has(r) || (z.add(r), typeof console > "u")) return;
|
|
166
|
+
let i = n ? `[ccui][${n}]` : "[ccui]", a = t ? `,请改用 ${t}` : "";
|
|
167
|
+
console.warn(`${i} ${e} 已 deprecated${a}。`);
|
|
168
|
+
}
|
|
169
|
+
function V(e, t, n) {
|
|
164
170
|
return e ? Object.prototype.hasOwnProperty.call(e, t) || Object.prototype.hasOwnProperty.call(e, n) : !1;
|
|
165
171
|
}
|
|
166
172
|
//#endregion
|
|
167
173
|
//#region ../ccui/ui/shared/hooks/use-namespace.ts
|
|
168
|
-
function
|
|
174
|
+
function H(e, t, n) {
|
|
169
175
|
let r = e;
|
|
170
176
|
return t && (r += `__${t}`), n && (r += `--${n}`), r;
|
|
171
177
|
}
|
|
172
|
-
function
|
|
178
|
+
function ae(e, t = !1) {
|
|
173
179
|
let n = t ? `.ccui-${e}` : `ccui-${e}`;
|
|
174
180
|
return {
|
|
175
|
-
b: () =>
|
|
176
|
-
e: (e) => e ?
|
|
177
|
-
m: (e) => e ?
|
|
178
|
-
em: (e, t) => e && t ?
|
|
181
|
+
b: () => H(n),
|
|
182
|
+
e: (e) => e ? H(n, e) : "",
|
|
183
|
+
m: (e) => e ? H(n, "", e) : "",
|
|
184
|
+
em: (e, t) => e && t ? H(n, e, t) : "",
|
|
179
185
|
is: (e) => `is-${e}`
|
|
180
186
|
};
|
|
181
187
|
}
|
|
182
188
|
//#endregion
|
|
183
189
|
//#region ../ccui/ui/popover/src/popover-types.ts
|
|
184
|
-
var
|
|
190
|
+
var U = {
|
|
185
191
|
title: {
|
|
186
192
|
type: String,
|
|
187
193
|
default: ""
|
|
@@ -202,10 +208,6 @@ var W = {
|
|
|
202
208
|
type: Boolean,
|
|
203
209
|
default: void 0
|
|
204
210
|
},
|
|
205
|
-
open: {
|
|
206
|
-
type: Boolean,
|
|
207
|
-
default: void 0
|
|
208
|
-
},
|
|
209
211
|
color: {
|
|
210
212
|
type: String,
|
|
211
213
|
default: ""
|
|
@@ -329,51 +331,58 @@ var W = {
|
|
|
329
331
|
triggerKeys: {
|
|
330
332
|
type: Array,
|
|
331
333
|
default: () => ["Enter", " "]
|
|
334
|
+
},
|
|
335
|
+
role: {
|
|
336
|
+
type: String,
|
|
337
|
+
default: "dialog"
|
|
338
|
+
},
|
|
339
|
+
ariaHasPopup: {
|
|
340
|
+
type: String,
|
|
341
|
+
default: "dialog"
|
|
332
342
|
}
|
|
333
343
|
};
|
|
334
344
|
//#endregion
|
|
335
345
|
//#region ../ccui/ui/popover/src/popover.tsx
|
|
336
|
-
function
|
|
346
|
+
function W(e) {
|
|
337
347
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
|
|
338
348
|
}
|
|
339
|
-
function
|
|
349
|
+
function oe(e) {
|
|
340
350
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
341
351
|
}
|
|
342
|
-
var
|
|
352
|
+
var se = 0, G = /* @__PURE__ */ a({
|
|
343
353
|
name: "CPopover",
|
|
344
|
-
props:
|
|
354
|
+
props: U,
|
|
345
355
|
emits: [
|
|
346
356
|
"before-show",
|
|
347
357
|
"show",
|
|
348
358
|
"before-hide",
|
|
349
359
|
"hide",
|
|
350
360
|
"update:visible",
|
|
351
|
-
"update:open",
|
|
352
361
|
"before-enter",
|
|
353
362
|
"after-enter",
|
|
354
363
|
"before-leave",
|
|
355
364
|
"after-leave"
|
|
356
365
|
],
|
|
357
|
-
setup(e, { emit: a, slots: s, expose:
|
|
358
|
-
let
|
|
359
|
-
|
|
360
|
-
let
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
].filter(Boolean).join(" ")), { floatingStyles:
|
|
366
|
+
setup(e, { emit: a, slots: s, expose: p }) {
|
|
367
|
+
let h = ae("popover"), v = `${h.e("popper")}-${++se}`, y = `${v}-title`, b = r(() => !!s.title || !!e.title), x = o()?.vnode.props;
|
|
368
|
+
V(x, "showArrow", "show-arrow") && B("showArrow", "arrow", "Popover"), V(x, "showAfter", "show-after") && B("showAfter", "mouseEnterDelay", "Popover"), V(x, "hideAfter", "hide-after") && B("hideAfter", "mouseLeaveDelay", "Popover"), V(x, "popperClass", "popper-class") && B("popperClass", "overlayClassName", "Popover"), V(x, "teleported", "teleported") && B("teleported", "getPopupContainer", "Popover");
|
|
369
|
+
let S = d(!1), C = d(), w = d(), T = d(), E = d(), D = d(), O = d(), k = r(() => e.visible), A = r(() => k.value !== void 0), j = r(() => !!(A.value ? k.value : S.value)), M = r(() => e.mouseEnterDelay === void 0 ? e.showAfter : e.mouseEnterDelay), N = r(() => e.mouseLeaveDelay === void 0 ? e.hideAfter : e.mouseLeaveDelay), P = r(() => e.arrow === void 0 ? e.showArrow : typeof e.arrow == "boolean" ? e.arrow : !0), F = r(() => oe(e.arrow) ? !!e.arrow.pointAtCenter : !1), I = r(() => e.overlayClassName || e.popperClass), L = r(() => e.color ? { backgroundColor: e.color } : {}), R = r(() => e.virtualTriggering && e.virtualRef ? e.virtualRef : C.value), z = r(() => [
|
|
370
|
+
h.e("popper"),
|
|
371
|
+
h.em("popper", e.effect),
|
|
372
|
+
h.em("popper", e.placement.split("-")[0]),
|
|
373
|
+
F.value && h.em("popper", "arrow-center"),
|
|
374
|
+
I.value
|
|
375
|
+
].filter(Boolean).join(" ")), { floatingStyles: ie, middlewareData: H, update: U } = re(r(() => R.value), w, {
|
|
367
376
|
placement: e.placement,
|
|
368
377
|
middleware: [
|
|
369
|
-
|
|
370
|
-
...e.autoAdjustOverflow ? [
|
|
371
|
-
|
|
372
|
-
...
|
|
378
|
+
te(e.offset),
|
|
379
|
+
...e.autoAdjustOverflow ? [g()] : [],
|
|
380
|
+
_({ padding: 8 }),
|
|
381
|
+
...P.value ? [ne({ element: T })] : []
|
|
373
382
|
]
|
|
374
|
-
}),
|
|
375
|
-
if (!
|
|
376
|
-
let { x: t, y: n } =
|
|
383
|
+
}), G = r(() => {
|
|
384
|
+
if (!P.value || !H.value.arrow) return {};
|
|
385
|
+
let { x: t, y: n } = H.value.arrow, r = {
|
|
377
386
|
top: "bottom",
|
|
378
387
|
right: "left",
|
|
379
388
|
bottom: "top",
|
|
@@ -387,117 +396,125 @@ var ae = 0, K = /* @__PURE__ */ a({
|
|
|
387
396
|
[r]: "-4px"
|
|
388
397
|
};
|
|
389
398
|
}), K = () => {
|
|
390
|
-
|
|
399
|
+
E.value &&= (clearTimeout(E.value), void 0), D.value &&= (clearTimeout(D.value), void 0), O.value &&= (clearTimeout(O.value), void 0);
|
|
391
400
|
}, q = () => {
|
|
392
401
|
K();
|
|
393
402
|
let t = () => {
|
|
394
|
-
a("before-hide"),
|
|
403
|
+
a("before-hide"), A.value || (S.value = !1), a("update:visible", !1), a("hide");
|
|
395
404
|
};
|
|
396
|
-
|
|
405
|
+
N.value > 0 && e.trigger !== "click" ? D.value = window.setTimeout(t, N.value) : t();
|
|
397
406
|
}, J = () => {
|
|
398
407
|
if (e.disabled) return;
|
|
399
408
|
K();
|
|
400
409
|
let t = () => {
|
|
401
|
-
a("before-show"),
|
|
402
|
-
U(), a("show"), e.autoClose > 0 && (
|
|
410
|
+
a("before-show"), A.value || (S.value = !0), a("update:visible", !0), c(() => {
|
|
411
|
+
U(), a("show"), e.autoClose > 0 && (O.value = window.setTimeout(() => {
|
|
403
412
|
q();
|
|
404
413
|
}, e.autoClose));
|
|
405
414
|
});
|
|
406
415
|
};
|
|
407
|
-
|
|
416
|
+
M.value > 0 ? E.value = window.setTimeout(t, M.value) : t();
|
|
408
417
|
}, Y = () => {
|
|
409
418
|
e.trigger === "hover" && J();
|
|
410
419
|
}, X = () => {
|
|
411
420
|
e.trigger === "hover" && q();
|
|
412
|
-
}, oe = () => {
|
|
413
|
-
e.trigger === "click" && (A.value ? q() : J());
|
|
414
|
-
}, se = (t) => {
|
|
415
|
-
e.trigger === "contextmenu" && (t.preventDefault(), A.value ? q() : J());
|
|
416
421
|
}, ce = () => {
|
|
422
|
+
e.trigger === "click" && (j.value ? q() : J());
|
|
423
|
+
}, le = (t) => {
|
|
424
|
+
e.trigger === "contextmenu" && (t.preventDefault(), j.value ? q() : J());
|
|
425
|
+
}, ue = () => {
|
|
417
426
|
e.trigger === "focus" && J();
|
|
418
|
-
},
|
|
427
|
+
}, de = () => {
|
|
419
428
|
e.trigger === "focus" && q();
|
|
420
|
-
},
|
|
429
|
+
}, fe = (e) => {
|
|
421
430
|
if (!e) return e;
|
|
422
431
|
let t = e.toLowerCase();
|
|
423
432
|
return e === " " || t === "space" || t === "spacebar" ? "Space" : e;
|
|
424
|
-
},
|
|
433
|
+
}, pe = (t) => {
|
|
425
434
|
if (e.trigger !== "focus") return;
|
|
426
|
-
let n =
|
|
427
|
-
e.triggerKeys.map(
|
|
428
|
-
},
|
|
435
|
+
let n = fe(t.key);
|
|
436
|
+
e.triggerKeys.map(fe).includes(n) && (t.preventDefault(), j.value ? q() : J());
|
|
437
|
+
}, me = () => {
|
|
429
438
|
e.trigger === "hover" && e.enterable && K();
|
|
430
|
-
},
|
|
439
|
+
}, he = () => {
|
|
431
440
|
e.trigger === "hover" && e.enterable && q();
|
|
432
|
-
},
|
|
433
|
-
if (!
|
|
434
|
-
let n = t.target, r = n instanceof Node ? n : null, i = e.virtualTriggering && e.virtualRef ? e.virtualRef :
|
|
441
|
+
}, ge = r(() => [h.b(), e.disabled ? h.m("disabled") : ""].filter(Boolean).join(" ")), Z = (t) => {
|
|
442
|
+
if (!j.value || e.trigger === "manual" || !e.hideOnClickOutside) return;
|
|
443
|
+
let n = t.target, r = n instanceof Node ? n : null, i = e.virtualTriggering && e.virtualRef ? e.virtualRef : C.value, a = !!(r && i && i.contains(r)), o = !!(r && w.value && w.value.contains(r));
|
|
435
444
|
!a && !o && q();
|
|
436
445
|
}, Q = (t) => {
|
|
437
|
-
|
|
446
|
+
j.value && e.trigger !== "manual" && e.closeOnEsc && t.key === "Escape" && q();
|
|
438
447
|
}, $;
|
|
439
|
-
|
|
440
|
-
e.visible &&
|
|
441
|
-
let e =
|
|
442
|
-
e &&
|
|
448
|
+
l(() => {
|
|
449
|
+
e.visible && c(() => {
|
|
450
|
+
let e = R.value;
|
|
451
|
+
e && w.value && ($ = m(e, w.value, U)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
|
|
443
452
|
});
|
|
444
|
-
}),
|
|
453
|
+
}), u(() => {
|
|
445
454
|
if (K(), $?.(), window.removeEventListener("mousedown", Z, !0), window.removeEventListener("keydown", Q, !0), e.virtualTriggering && e.virtualRef) {
|
|
446
455
|
let t = e.virtualRef;
|
|
447
|
-
t.removeEventListener("mouseenter", Y), t.removeEventListener("mouseleave", X), t.removeEventListener("click",
|
|
456
|
+
t.removeEventListener("mouseenter", Y), t.removeEventListener("mouseleave", X), t.removeEventListener("click", ce), t.removeEventListener("focus", ue), t.removeEventListener("blur", de), t.removeEventListener("keydown", pe), t.removeEventListener("contextmenu", le);
|
|
448
457
|
}
|
|
449
|
-
}),
|
|
450
|
-
if (
|
|
458
|
+
}), f(k, (e) => {
|
|
459
|
+
if (A.value) {
|
|
451
460
|
let t = !!e;
|
|
452
|
-
t !==
|
|
461
|
+
t !== S.value && (S.value = t, t && c(() => U()));
|
|
453
462
|
}
|
|
454
|
-
}),
|
|
463
|
+
}), f(j, (e) => {
|
|
455
464
|
if (e) {
|
|
456
|
-
let e =
|
|
457
|
-
e &&
|
|
465
|
+
let e = R.value;
|
|
466
|
+
e && w.value && ($?.(), $ = m(e, w.value, U)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
|
|
458
467
|
} else $?.(), window.removeEventListener("mousedown", Z, !0), window.removeEventListener("keydown", Q, !0);
|
|
459
468
|
});
|
|
460
|
-
let
|
|
461
|
-
ref:
|
|
462
|
-
class: [
|
|
463
|
-
style:
|
|
464
|
-
}, null) : null,
|
|
469
|
+
let _e = () => P.value ? i("div", {
|
|
470
|
+
ref: T,
|
|
471
|
+
class: [h.e("arrow"), h.em("arrow", e.placement.split("-")[0])].join(" "),
|
|
472
|
+
style: G.value
|
|
473
|
+
}, null) : null, ve = () => {
|
|
465
474
|
let t = !!s.title, n = !!e.title;
|
|
466
|
-
return !t && !n ? null : i("div", {
|
|
467
|
-
|
|
468
|
-
|
|
475
|
+
return !t && !n ? null : i("div", {
|
|
476
|
+
class: h.e("header"),
|
|
477
|
+
id: y
|
|
478
|
+
}, [s.title ? s.title() : e.title]);
|
|
479
|
+
}, ye = () => e.rawContent ? i("div", { innerHTML: e.content }, null) : s.content ? s.content() : e.content;
|
|
480
|
+
return p({ hide: q }), () => {
|
|
469
481
|
let r = {};
|
|
470
|
-
e.virtualTriggering || (e.trigger === "hover" ? (r.onMouseenter = Y, r.onMouseleave = X) : e.trigger === "click" ? r.onClick =
|
|
482
|
+
e.virtualTriggering || (e.trigger === "hover" ? (r.onMouseenter = Y, r.onMouseleave = X) : e.trigger === "click" ? r.onClick = ce : e.trigger === "focus" ? (r.onFocus = ue, r.onBlur = de, r.onKeydown = pe) : e.trigger === "contextmenu" && (r.onContextmenu = le));
|
|
471
483
|
let o = i("div", {
|
|
472
|
-
ref:
|
|
473
|
-
class:
|
|
474
|
-
role:
|
|
475
|
-
id:
|
|
484
|
+
ref: w,
|
|
485
|
+
class: z.value,
|
|
486
|
+
role: e.role,
|
|
487
|
+
id: v,
|
|
488
|
+
"aria-labelledby": b.value ? y : void 0,
|
|
489
|
+
"aria-label": !b.value && e.ariaLabel ? e.ariaLabel : void 0,
|
|
476
490
|
style: {
|
|
477
|
-
...
|
|
478
|
-
...
|
|
491
|
+
...ie.value,
|
|
492
|
+
...L.value,
|
|
479
493
|
zIndex: 2e3,
|
|
480
494
|
pointerEvents: e.enterable ? "auto" : "none",
|
|
481
495
|
width: e.width || void 0
|
|
482
496
|
},
|
|
483
|
-
onMouseenter:
|
|
484
|
-
onMouseleave:
|
|
497
|
+
onMouseenter: me,
|
|
498
|
+
onMouseleave: he
|
|
485
499
|
}, [
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
i("div", { class:
|
|
489
|
-
]),
|
|
500
|
+
_e(),
|
|
501
|
+
ve(),
|
|
502
|
+
i("div", { class: h.e("content") }, [ye()])
|
|
503
|
+
]), c = () => {
|
|
490
504
|
if (e.getPopupContainer) {
|
|
491
|
-
let n = e.getPopupContainer(
|
|
492
|
-
return n ? i(t, { to: n },
|
|
505
|
+
let n = e.getPopupContainer(C.value ?? null);
|
|
506
|
+
return n ? i(t, { to: n }, W(o) ? o : { default: () => [o] }) : o;
|
|
493
507
|
}
|
|
494
|
-
return e.teleported ? i(t, { to: "body" },
|
|
508
|
+
return e.teleported ? i(t, { to: "body" }, W(o) ? o : { default: () => [o] }) : o;
|
|
495
509
|
};
|
|
496
|
-
return i("div", { class:
|
|
497
|
-
!e.virtualTriggering && i("div",
|
|
498
|
-
ref:
|
|
499
|
-
class:
|
|
500
|
-
"aria-describedby":
|
|
510
|
+
return i("div", { class: ge.value }, [
|
|
511
|
+
!e.virtualTriggering && i("div", ee({
|
|
512
|
+
ref: C,
|
|
513
|
+
class: h.e("trigger"),
|
|
514
|
+
"aria-describedby": j.value ? v : void 0,
|
|
515
|
+
"aria-haspopup": e.ariaHasPopup,
|
|
516
|
+
"aria-expanded": j.value ? "true" : "false",
|
|
517
|
+
"aria-controls": j.value ? v : void 0,
|
|
501
518
|
"aria-label": e.ariaLabel,
|
|
502
519
|
tabindex: e.trigger === "focus" ? e.tabindex : void 0
|
|
503
520
|
}, r), [s.default?.()]),
|
|
@@ -508,23 +525,23 @@ var ae = 0, K = /* @__PURE__ */ a({
|
|
|
508
525
|
onAfterEnter: () => a("after-enter"),
|
|
509
526
|
onBeforeLeave: () => a("before-leave"),
|
|
510
527
|
onAfterLeave: () => a("after-leave")
|
|
511
|
-
}, { default: () => [
|
|
528
|
+
}, { default: () => [j.value && c()] })
|
|
512
529
|
]);
|
|
513
530
|
};
|
|
514
531
|
}
|
|
515
532
|
});
|
|
516
533
|
//#endregion
|
|
517
534
|
//#region ../ccui/ui/popover/index.ts
|
|
518
|
-
|
|
519
|
-
e.component(
|
|
535
|
+
G.install = function(e) {
|
|
536
|
+
e.component(G.name, G);
|
|
520
537
|
};
|
|
521
|
-
var
|
|
538
|
+
var K = {
|
|
522
539
|
title: "Popover 弹出框",
|
|
523
540
|
category: "反馈",
|
|
524
541
|
status: "100%",
|
|
525
542
|
install(e) {
|
|
526
|
-
e.component(
|
|
543
|
+
e.component(G.name, G);
|
|
527
544
|
}
|
|
528
545
|
};
|
|
529
546
|
//#endregion
|
|
530
|
-
export {
|
|
547
|
+
export { G as Popover, K as default };
|