@nhdropshipping/y-components 1.0.9 → 1.0.10
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/dist/components/ytree.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1534 -1505
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as me, computed as
|
|
1
|
+
import { defineComponent as me, computed as q, createElementBlock as u, openBlock as a, normalizeClass as B, createElementVNode as n, renderSlot as ue, Fragment as re, renderList as he, createCommentVNode as A, toDisplayString as G, normalizeStyle as ge, ref as R, watch as ne, nextTick as ve, onMounted as Se, onUnmounted as Ee, resolveComponent as Ne, createVNode as fe, Transition as ke, withCtx as pe, createBlock as Ie, createTextVNode as Ce, withKeys as be, withModifiers as J, withDirectives as Be, vModelText as tt, Teleport as Re, vShow as Ke, provide as nt, useAttrs as lt, getCurrentInstance as ot, reactive as st, TransitionGroup as at, resolveDynamicComponent as it, onBeforeUnmount as rt, render as Ze } from "vue";
|
|
2
2
|
const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "content" }, dt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -30,14 +30,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
30
30
|
emits: ["click", "group-click"],
|
|
31
31
|
setup(t, { emit: b }) {
|
|
32
32
|
const e = t, l = b;
|
|
33
|
-
function
|
|
33
|
+
function p(_) {
|
|
34
34
|
if (e.disabled || e.loading) {
|
|
35
|
-
|
|
35
|
+
_.preventDefault(), _.stopPropagation();
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
l("click",
|
|
38
|
+
l("click", _);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const i = q(() => {
|
|
41
41
|
switch (e.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,75 +48,75 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
52
|
-
function E(
|
|
53
|
-
if (e.disabled || e.loading ||
|
|
54
|
-
|
|
51
|
+
}), C = q(() => Array.isArray(e.groupItems) && e.groupItems.length > 0);
|
|
52
|
+
function E(_, M) {
|
|
53
|
+
if (e.disabled || e.loading || _.disabled || _.loading) {
|
|
54
|
+
M.preventDefault(), M.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
l("group-click",
|
|
58
|
-
}
|
|
59
|
-
return (
|
|
60
|
-
(
|
|
61
|
-
var
|
|
62
|
-
return
|
|
63
|
-
key:
|
|
64
|
-
class:
|
|
65
|
-
`y-btn--${
|
|
66
|
-
`y-btn--${
|
|
57
|
+
l("group-click", _.value, M);
|
|
58
|
+
}
|
|
59
|
+
return (_, M) => C.value ? (a(), u("div", dt, [
|
|
60
|
+
(a(!0), u(re, null, he(t.groupItems, (v, w) => {
|
|
61
|
+
var y;
|
|
62
|
+
return a(), u("button", {
|
|
63
|
+
key: v.value ?? w,
|
|
64
|
+
class: B(["y-btn", [
|
|
65
|
+
`y-btn--${v.variant ?? t.variant}`,
|
|
66
|
+
`y-btn--${v.size ?? t.size}`,
|
|
67
67
|
"is-grouped",
|
|
68
|
-
w === 0 ? "group-pos-start" : w === (((
|
|
69
|
-
{ "is-loading":
|
|
68
|
+
w === 0 ? "group-pos-start" : w === (((y = t.groupItems) == null ? void 0 : y.length) || 0) - 1 ? "group-pos-end" : "group-pos-middle",
|
|
69
|
+
{ "is-loading": v.loading || t.loading }
|
|
70
70
|
]]),
|
|
71
71
|
type: t.htmlType,
|
|
72
|
-
disabled: (
|
|
73
|
-
"aria-busy":
|
|
74
|
-
"aria-disabled": (
|
|
75
|
-
"aria-label":
|
|
76
|
-
onClick: (
|
|
72
|
+
disabled: (v.disabled ?? !1) || t.disabled || t.loading || v.loading,
|
|
73
|
+
"aria-busy": v.loading || t.loading ? "true" : "false",
|
|
74
|
+
"aria-disabled": (v.disabled ?? !1) || t.disabled || t.loading || v.loading ? "true" : "false",
|
|
75
|
+
"aria-label": v.ariaLabel || v.label,
|
|
76
|
+
onClick: (z) => E(v, z)
|
|
77
77
|
}, [
|
|
78
78
|
n("span", vt, [
|
|
79
|
-
|
|
79
|
+
v.icon === "chevron-left" ? (a(), u("svg", ht, [...M[0] || (M[0] = [
|
|
80
80
|
n("path", {
|
|
81
81
|
"fill-rule": "evenodd",
|
|
82
82
|
d: "M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z",
|
|
83
83
|
"clip-rule": "evenodd"
|
|
84
84
|
}, null, -1)
|
|
85
|
-
])])) :
|
|
85
|
+
])])) : v.icon === "chevron-right" ? (a(), u("svg", pt, [...M[1] || (M[1] = [
|
|
86
86
|
n("path", {
|
|
87
87
|
"fill-rule": "evenodd",
|
|
88
88
|
d: "M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z",
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
91
|
])])) : A("", !0),
|
|
92
|
-
|
|
92
|
+
v.label && !v.onlyIcon ? (a(), u("span", yt, G(v.label), 1)) : A("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, ft);
|
|
95
95
|
}), 128))
|
|
96
|
-
])) : (
|
|
96
|
+
])) : (a(), u("button", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class:
|
|
98
|
+
class: B(["y-btn", [
|
|
99
99
|
`y-btn--${t.variant}`,
|
|
100
100
|
`y-btn--${t.size}`,
|
|
101
101
|
{ "is-block": t.block, "is-loading": t.loading },
|
|
102
102
|
t.groupPosition !== "single" ? "is-grouped" : "",
|
|
103
|
-
|
|
103
|
+
i.value
|
|
104
104
|
]]),
|
|
105
105
|
type: t.htmlType,
|
|
106
106
|
disabled: t.disabled || t.loading,
|
|
107
107
|
"aria-busy": t.loading ? "true" : "false",
|
|
108
108
|
"aria-disabled": t.disabled || t.loading ? "true" : "false",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: p
|
|
110
110
|
}, [
|
|
111
111
|
n("span", ct, [
|
|
112
|
-
ue(
|
|
112
|
+
ue(_.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
114
|
], 10, ut));
|
|
115
115
|
}
|
|
116
116
|
}), we = (t, b) => {
|
|
117
117
|
const e = t.__vccOpts || t;
|
|
118
|
-
for (const [l,
|
|
119
|
-
e[l] =
|
|
118
|
+
for (const [l, p] of b)
|
|
119
|
+
e[l] = p;
|
|
120
120
|
return e;
|
|
121
121
|
}, Ae = /* @__PURE__ */ we(gt, [["__scopeId", "data-v-0c27d1bc"]]), mt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "disabled", "required", "value"], wt = /* @__PURE__ */ me({
|
|
122
122
|
__name: "yinput",
|
|
@@ -137,16 +137,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
137
137
|
emits: ["update:modelValue"],
|
|
138
138
|
setup(t, { emit: b }) {
|
|
139
139
|
const e = b;
|
|
140
|
-
function l(
|
|
141
|
-
const
|
|
142
|
-
e("update:modelValue",
|
|
140
|
+
function l(p) {
|
|
141
|
+
const i = p.target;
|
|
142
|
+
e("update:modelValue", i.value);
|
|
143
143
|
}
|
|
144
|
-
return (
|
|
145
|
-
class:
|
|
146
|
-
style:
|
|
144
|
+
return (p, i) => (a(), u("div", {
|
|
145
|
+
class: B(["y-input-wrap", { "is-block": t.block }]),
|
|
146
|
+
style: ge({ width: t.width })
|
|
147
147
|
}, [
|
|
148
148
|
n("input", {
|
|
149
|
-
class:
|
|
149
|
+
class: B(["y-input", `y-input--${t.size}`]),
|
|
150
150
|
id: t.id,
|
|
151
151
|
name: t.name,
|
|
152
152
|
type: t.type,
|
|
@@ -169,10 +169,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
169
169
|
}, _t = {
|
|
170
170
|
key: 0,
|
|
171
171
|
class: "col-select"
|
|
172
|
-
}, St = ["checked"],
|
|
172
|
+
}, St = ["checked"], Lt = {
|
|
173
173
|
key: 0,
|
|
174
174
|
class: "loading-overlay"
|
|
175
|
-
},
|
|
175
|
+
}, Mt = {
|
|
176
176
|
key: 1,
|
|
177
177
|
class: "empty-overlay"
|
|
178
178
|
}, It = {
|
|
@@ -207,274 +207,274 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
207
207
|
},
|
|
208
208
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
209
209
|
setup(t, { emit: b }) {
|
|
210
|
-
const e = t, l = b,
|
|
210
|
+
const e = t, l = b, p = R(e.currentPage || 1), i = R(e.pageSize), C = R([]), E = R("none"), _ = R(), M = R(), v = R(), w = R(), y = R([]), z = R(), V = R({
|
|
211
211
|
show: !1,
|
|
212
212
|
thumbHeight: 40,
|
|
213
213
|
thumbTop: 0
|
|
214
214
|
});
|
|
215
|
-
let
|
|
216
|
-
const
|
|
215
|
+
let U = !1, j = 0, D = 0;
|
|
216
|
+
const T = R(0), L = q(() => {
|
|
217
217
|
if (!e.searchKeyword || !e.searchFields.length)
|
|
218
218
|
return e.data;
|
|
219
|
-
const
|
|
220
|
-
return e.data.filter((
|
|
221
|
-
const
|
|
222
|
-
return String(
|
|
219
|
+
const k = e.searchKeyword.toLowerCase();
|
|
220
|
+
return e.data.filter((S) => e.searchFields.some((K) => {
|
|
221
|
+
const x = ce(S, K);
|
|
222
|
+
return String(x).toLowerCase().includes(k);
|
|
223
223
|
}));
|
|
224
|
-
}),
|
|
224
|
+
}), I = q(() => (e.pagination, L.value)), P = q(() => {
|
|
225
225
|
if (!e.selectable) return !1;
|
|
226
|
-
const
|
|
227
|
-
return
|
|
228
|
-
}),
|
|
229
|
-
const
|
|
230
|
-
let
|
|
231
|
-
for (let
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
let
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
} else if (
|
|
239
|
-
const
|
|
240
|
-
|
|
226
|
+
const k = I.value.map((S, K) => le(S, K));
|
|
227
|
+
return k.length > 0 && k.every((S) => C.value.includes(S));
|
|
228
|
+
}), X = q(() => {
|
|
229
|
+
const k = [];
|
|
230
|
+
let S = e.selectable ? 40 : 0;
|
|
231
|
+
for (let K = 0; K < e.columns.length; K++) {
|
|
232
|
+
const x = e.columns[K];
|
|
233
|
+
if (x.fixed === "left") {
|
|
234
|
+
let O = 80;
|
|
235
|
+
if (x.width) {
|
|
236
|
+
const Q = parseFloat(x.width);
|
|
237
|
+
O = isNaN(Q) ? 80 : Q;
|
|
238
|
+
} else if (y.value[K]) {
|
|
239
|
+
const Q = parseFloat(y.value[K]);
|
|
240
|
+
O = isNaN(Q) ? 80 : Q;
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
k.push(S), S += O;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
return
|
|
246
|
-
}),
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
250
|
-
for (let
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
let
|
|
254
|
-
if (
|
|
255
|
-
const ae = parseFloat(
|
|
256
|
-
|
|
257
|
-
} else if (
|
|
258
|
-
const ae = parseFloat(
|
|
259
|
-
|
|
245
|
+
return k;
|
|
246
|
+
}), ee = q(() => {
|
|
247
|
+
const k = [];
|
|
248
|
+
let S = 0;
|
|
249
|
+
const K = [];
|
|
250
|
+
for (let x = e.columns.length - 1; x >= 0; x--) {
|
|
251
|
+
const O = e.columns[x];
|
|
252
|
+
if (O.fixed === "right") {
|
|
253
|
+
let Q = 80;
|
|
254
|
+
if (O.width) {
|
|
255
|
+
const ae = parseFloat(O.width);
|
|
256
|
+
Q = isNaN(ae) ? 80 : ae;
|
|
257
|
+
} else if (y.value[x]) {
|
|
258
|
+
const ae = parseFloat(y.value[x]);
|
|
259
|
+
Q = isNaN(ae) ? 80 : ae;
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
K.push({ index: x, width: Q });
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
for (let
|
|
265
|
-
|
|
266
|
-
return
|
|
264
|
+
for (let x = 0; x < K.length; x++)
|
|
265
|
+
k.push(S), S += K[x].width;
|
|
266
|
+
return k;
|
|
267
267
|
});
|
|
268
|
-
function se(
|
|
269
|
-
if (
|
|
270
|
-
let
|
|
271
|
-
for (let
|
|
272
|
-
e.columns[
|
|
273
|
-
return
|
|
268
|
+
function se(k, S) {
|
|
269
|
+
if (S === "left") {
|
|
270
|
+
let K = 0;
|
|
271
|
+
for (let x = 0; x < k; x++)
|
|
272
|
+
e.columns[x].fixed === "left" && K++;
|
|
273
|
+
return K;
|
|
274
274
|
} else {
|
|
275
|
-
let
|
|
276
|
-
for (let
|
|
277
|
-
e.columns[
|
|
278
|
-
return
|
|
275
|
+
let K = 0;
|
|
276
|
+
for (let x = e.columns.length - 1; x > k; x--)
|
|
277
|
+
e.columns[x].fixed === "right" && K++;
|
|
278
|
+
return K;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
return typeof e.rowKey == "function" ? e.rowKey(
|
|
281
|
+
function le(k, S) {
|
|
282
|
+
return typeof e.rowKey == "function" ? e.rowKey(k) : k[e.rowKey] || S;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
284
|
+
function ce(k, S) {
|
|
285
|
+
return S.split(".").reduce((K, x) => K == null ? void 0 : K[x], k);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const
|
|
289
|
-
return
|
|
287
|
+
function de(k, S = !1) {
|
|
288
|
+
const K = [];
|
|
289
|
+
return k.align && K.push(`text-${k.align}`), k.fixed === "right" && (K.push("col-fixed-right"), S && K.push("col-fixed-right-header")), k.fixed === "left" && (K.push("col-fixed-left"), S && K.push("col-fixed-left-header")), K.join(" ");
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
} else if (
|
|
297
|
-
const
|
|
298
|
-
|
|
291
|
+
function Y(k, S, K) {
|
|
292
|
+
const x = {};
|
|
293
|
+
if (k.width ? (x.width = k.width, x.minWidth = k.width, x.maxWidth = k.width) : (x.width = "auto", x.minWidth = "80px", x.maxWidth = "none"), k.fixed === "left") {
|
|
294
|
+
const O = se(S, "left"), Q = X.value[O] || 0;
|
|
295
|
+
x.left = `${Q}px`, x.zIndex = K ? `${10 + O}` : `${5 + O}`;
|
|
296
|
+
} else if (k.fixed === "right") {
|
|
297
|
+
const O = se(S, "right"), Q = ee.value[O] || 0;
|
|
298
|
+
K ? x.right = `${Q - 3}px` : x.right = `${Q}px`, x.zIndex = K ? `${10 + O}` : `${5 + O}`;
|
|
299
299
|
}
|
|
300
|
-
return
|
|
300
|
+
return x;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
const
|
|
304
|
-
return
|
|
302
|
+
function W(k, S) {
|
|
303
|
+
const K = ce(k, S.key);
|
|
304
|
+
return S.formatter ? S.formatter(K, k) : K || "";
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
306
|
+
function d(k) {
|
|
307
|
+
C.value.includes(k) ? C.value = C.value.filter((S) => S !== k) : C.value = [...C.value, k], l("select", C.value), l("update:selectedItems", C.value);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
|
|
309
|
+
function f() {
|
|
310
|
+
const k = I.value.map((S, K) => le(S, K));
|
|
311
|
+
if (k.every((S) => C.value.includes(S)))
|
|
312
|
+
C.value = C.value.filter((S) => !k.includes(S));
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
315
|
-
|
|
314
|
+
const S = /* @__PURE__ */ new Set([...C.value, ...k]);
|
|
315
|
+
C.value = Array.from(S);
|
|
316
316
|
}
|
|
317
|
-
l("select",
|
|
317
|
+
l("select", C.value), l("update:selectedItems", C.value);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
319
|
+
function g() {
|
|
320
|
+
C.value = [], l("select", C.value), l("update:selectedItems", C.value);
|
|
321
321
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}),
|
|
325
|
-
e.total || (
|
|
322
|
+
ne(() => e.searchKeyword, () => {
|
|
323
|
+
p.value = 1;
|
|
324
|
+
}), ne(() => e.data, () => {
|
|
325
|
+
e.total || (p.value = 1);
|
|
326
326
|
}, { deep: !0 });
|
|
327
|
-
function m(
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
function
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
}),
|
|
337
|
-
const
|
|
338
|
-
|
|
327
|
+
function m(k) {
|
|
328
|
+
p.value = k, l("page-change", k);
|
|
329
|
+
}
|
|
330
|
+
function o(k) {
|
|
331
|
+
i.value = k, p.value = 1, l("page-size-change", k);
|
|
332
|
+
}
|
|
333
|
+
ne(() => e.currentPage, (k) => {
|
|
334
|
+
const S = typeof k == "number" && k > 0 ? k : 1;
|
|
335
|
+
p.value !== S && (p.value = S);
|
|
336
|
+
}), ne(() => e.pageSize, (k) => {
|
|
337
|
+
const S = typeof k == "number" && k > 0 ? k : 10;
|
|
338
|
+
i.value !== S && (i.value = S);
|
|
339
339
|
});
|
|
340
|
-
function
|
|
341
|
-
|
|
342
|
-
const
|
|
343
|
-
ie && (ie.offsetHeight >
|
|
340
|
+
function r() {
|
|
341
|
+
_.value && ve(() => {
|
|
342
|
+
const k = _.value.getBoundingClientRect(), S = window.innerHeight, K = k.top, x = _.value.querySelector(".table-header"), O = x ? x.offsetHeight : 40, Q = _.value.querySelector(".ypagination"), ae = Q ? Q.offsetHeight : 60, s = _.value.querySelector(".bulk-bar"), c = s ? s.offsetHeight : 0, $ = O + ae + c + 20, F = S - K - $, te = Math.max(200, F), ie = _.value.querySelector(".table-body-wrap .table");
|
|
343
|
+
ie && (ie.offsetHeight > F ? E.value = `${te}px` : E.value = "none");
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
let
|
|
347
|
-
function
|
|
348
|
-
!
|
|
349
|
-
|
|
346
|
+
let h = !1;
|
|
347
|
+
function N() {
|
|
348
|
+
!M.value || !v.value || h || M.value.scrollLeft !== v.value.scrollLeft && (h = !0, M.value.scrollLeft = v.value.scrollLeft, requestAnimationFrame(() => {
|
|
349
|
+
h = !1;
|
|
350
350
|
}));
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
!
|
|
354
|
-
|
|
352
|
+
function H() {
|
|
353
|
+
!M.value || !v.value || h || v.value.scrollLeft !== M.value.scrollLeft && (h = !0, v.value.scrollLeft = M.value.scrollLeft, requestAnimationFrame(() => {
|
|
354
|
+
h = !1;
|
|
355
355
|
}));
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
|
|
359
|
-
if (!
|
|
360
|
-
const
|
|
361
|
-
if (
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
357
|
+
function Z() {
|
|
358
|
+
ve(() => {
|
|
359
|
+
if (!v.value) return;
|
|
360
|
+
const k = v.value, S = k.scrollHeight, K = k.clientHeight, x = k.scrollTop, O = S > K + 1;
|
|
361
|
+
if (V.value.show = O, !O) return;
|
|
362
|
+
const Q = 24, ae = K / S, s = z.value ? z.value.clientHeight : K, c = Math.max(Q, Math.floor(s * ae));
|
|
363
|
+
V.value.thumbHeight = c;
|
|
364
|
+
const $ = Math.max(0, s - c), F = Math.max(1, S - K);
|
|
365
|
+
V.value.thumbTop = Math.min($, Math.floor(x / F * $));
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
if (!
|
|
370
|
-
|
|
371
|
-
const
|
|
372
|
-
|
|
368
|
+
function De(k) {
|
|
369
|
+
if (!U || !v.value || !z.value) return;
|
|
370
|
+
k.preventDefault();
|
|
371
|
+
const S = z.value.clientHeight, K = Math.max(0, S - V.value.thumbHeight), x = v.value, O = x.scrollHeight, Q = x.clientHeight, ae = Math.max(1, O - Q), c = (k.clientY - j) / Math.max(1, K) * ae;
|
|
372
|
+
x.scrollTop = Math.min(ae, Math.max(0, D + c)), Z();
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
|
|
374
|
+
function $e() {
|
|
375
|
+
U = !1, window.removeEventListener("mousemove", De), window.removeEventListener("mouseup", $e);
|
|
376
376
|
}
|
|
377
377
|
function Ve() {
|
|
378
|
-
|
|
379
|
-
var
|
|
380
|
-
if (
|
|
378
|
+
ve(() => {
|
|
379
|
+
var K;
|
|
380
|
+
if (y.value.length === e.columns.length && y.value.every((x) => !!x))
|
|
381
381
|
return;
|
|
382
|
-
const
|
|
383
|
-
for (const
|
|
384
|
-
if (
|
|
385
|
-
|
|
382
|
+
const k = [];
|
|
383
|
+
for (const x of e.columns)
|
|
384
|
+
if (x.width && typeof x.width == "string" && x.width.trim())
|
|
385
|
+
k.push(x.width);
|
|
386
386
|
else {
|
|
387
|
-
const
|
|
388
|
-
|
|
387
|
+
const O = y.value[k.length];
|
|
388
|
+
k.push(O || "");
|
|
389
389
|
}
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
393
|
-
for (let
|
|
394
|
-
if (!
|
|
395
|
-
const ae =
|
|
390
|
+
const S = (K = w.value) == null ? void 0 : K.querySelector("tbody tr");
|
|
391
|
+
if (S) {
|
|
392
|
+
const x = e.selectable ? 1 : 0, O = Array.from(S.children);
|
|
393
|
+
for (let Q = 0; Q < e.columns.length; Q++)
|
|
394
|
+
if (!k[Q]) {
|
|
395
|
+
const ae = O[x + Q];
|
|
396
396
|
if (ae) {
|
|
397
|
-
const
|
|
398
|
-
|
|
397
|
+
const s = ae.clientWidth;
|
|
398
|
+
k[Q] = (s > 0 ? s : 80) + "px";
|
|
399
399
|
} else
|
|
400
|
-
|
|
400
|
+
k[Q] = "80px";
|
|
401
401
|
}
|
|
402
402
|
} else
|
|
403
|
-
for (let
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
for (let x = 0; x < k.length; x++)
|
|
404
|
+
k[x] || (k[x] = y.value[x] || "80px");
|
|
405
|
+
y.value = k;
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
408
|
+
function He() {
|
|
409
|
+
r(), _e();
|
|
410
410
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
ne(() => e.data, () => {
|
|
412
|
+
ve(() => {
|
|
413
|
+
r(), N(), _e();
|
|
414
414
|
});
|
|
415
|
-
}, { deep: !0 }),
|
|
416
|
-
|
|
417
|
-
|
|
415
|
+
}, { deep: !0 }), ne([p, i], () => {
|
|
416
|
+
ve(() => {
|
|
417
|
+
r(), N(), _e();
|
|
418
418
|
});
|
|
419
|
-
}),
|
|
420
|
-
|
|
421
|
-
Ve(),
|
|
419
|
+
}), ne(() => e.columns, () => {
|
|
420
|
+
y.value = [], ve(() => {
|
|
421
|
+
Ve(), N(), _e();
|
|
422
422
|
});
|
|
423
|
-
}, { deep: !0 }),
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
}, { deep: !0 }), ne(() => C.value, () => {
|
|
424
|
+
ve(() => {
|
|
425
|
+
r(), _e();
|
|
426
426
|
});
|
|
427
|
-
}, { deep: !0 }),
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
}, { deep: !0 }), ne(() => e.loading, () => {
|
|
428
|
+
ve(() => {
|
|
429
|
+
_e();
|
|
430
430
|
});
|
|
431
|
-
}),
|
|
432
|
-
var
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
}), window.addEventListener("resize",
|
|
436
|
-
|
|
437
|
-
}, { passive: !0 }), (
|
|
438
|
-
|
|
439
|
-
}, { passive: !0 }),
|
|
440
|
-
|
|
441
|
-
}), ze.observe(
|
|
431
|
+
}), Se(() => {
|
|
432
|
+
var k, S;
|
|
433
|
+
ve(() => {
|
|
434
|
+
r(), Ve(), _e(), Z();
|
|
435
|
+
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (k = v.value) == null || k.addEventListener("scroll", () => {
|
|
436
|
+
N(), Z(), _e();
|
|
437
|
+
}, { passive: !0 }), (S = M.value) == null || S.addEventListener("scroll", () => {
|
|
438
|
+
H();
|
|
439
|
+
}, { passive: !0 }), ve(() => N()), v.value && typeof ResizeObserver < "u" && (ze = new ResizeObserver(() => {
|
|
440
|
+
_e();
|
|
441
|
+
}), ze.observe(v.value));
|
|
442
442
|
}), Ee(() => {
|
|
443
|
-
var
|
|
444
|
-
window.removeEventListener("resize",
|
|
443
|
+
var k, S;
|
|
444
|
+
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (k = v.value) == null || k.removeEventListener("scroll", N), (S = M.value) == null || S.removeEventListener("scroll", H), window.removeEventListener("mousemove", De), window.removeEventListener("mouseup", $e), ze && (ze.disconnect(), ze = null);
|
|
445
445
|
});
|
|
446
446
|
let Te = -1;
|
|
447
|
-
function
|
|
448
|
-
!
|
|
449
|
-
if (!
|
|
450
|
-
const
|
|
451
|
-
if (
|
|
452
|
-
Te =
|
|
453
|
-
const
|
|
454
|
-
|
|
447
|
+
function _e() {
|
|
448
|
+
!M.value || !v.value || requestAnimationFrame(() => {
|
|
449
|
+
if (!M.value || !v.value) return;
|
|
450
|
+
const k = v.value, S = Math.ceil(k.offsetWidth - k.clientWidth);
|
|
451
|
+
if (T.value = S, S !== Te) {
|
|
452
|
+
Te = S;
|
|
453
|
+
const K = M.value.querySelector(".table"), x = w.value;
|
|
454
|
+
K && x && (M.value.style.paddingRight = "0px", K.style.width = "", K.style.marginRight = "", S > 0 ? (M.value.style.paddingRight = `${S}px`, K.style.width = "100%", K.style.marginRight = `-${S}px`) : (M.value.style.paddingRight = "0px", K.style.width = "100%", K.style.marginRight = "0px"));
|
|
455
455
|
}
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
let ze = null;
|
|
459
|
-
return (
|
|
460
|
-
const
|
|
461
|
-
return
|
|
459
|
+
return (k, S) => {
|
|
460
|
+
const K = Ne("YPagination");
|
|
461
|
+
return a(), u("div", {
|
|
462
462
|
class: "ytable-container",
|
|
463
463
|
ref_key: "tableContainer",
|
|
464
|
-
ref:
|
|
464
|
+
ref: _
|
|
465
465
|
}, [
|
|
466
|
-
|
|
467
|
-
default:
|
|
468
|
-
|
|
469
|
-
n("div", kt, "已选择 " +
|
|
466
|
+
fe(ke, { name: "bulk-slide" }, {
|
|
467
|
+
default: pe(() => [
|
|
468
|
+
C.value.length && t.showBulkActions ? (a(), u("div", bt, [
|
|
469
|
+
n("div", kt, "已选择 " + G(C.value.length) + " 项", 1),
|
|
470
470
|
n("div", xt, [
|
|
471
|
-
ue(
|
|
472
|
-
selectedItems:
|
|
473
|
-
clearSelection:
|
|
471
|
+
ue(k.$slots, "bulk-actions", {
|
|
472
|
+
selectedItems: C.value,
|
|
473
|
+
clearSelection: g
|
|
474
474
|
}, () => [
|
|
475
475
|
n("button", {
|
|
476
476
|
class: "btn",
|
|
477
|
-
onClick:
|
|
477
|
+
onClick: g
|
|
478
478
|
}, "清除选择")
|
|
479
479
|
], !0)
|
|
480
480
|
])
|
|
@@ -486,107 +486,107 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
486
486
|
n("div", {
|
|
487
487
|
class: "table-header",
|
|
488
488
|
ref_key: "headerRef",
|
|
489
|
-
ref:
|
|
489
|
+
ref: M
|
|
490
490
|
}, [
|
|
491
491
|
n("table", Dt, [
|
|
492
492
|
n("colgroup", null, [
|
|
493
|
-
t.selectable ? (
|
|
494
|
-
(
|
|
495
|
-
key:
|
|
496
|
-
style:
|
|
493
|
+
t.selectable ? (a(), u("col", $t)) : A("", !0),
|
|
494
|
+
(a(!0), u(re, null, he(t.columns, (x, O) => (a(), u("col", {
|
|
495
|
+
key: x.key,
|
|
496
|
+
style: ge({ width: y.value[O] || void 0, minWidth: y.value[O] || "80px" })
|
|
497
497
|
}, null, 4))), 128))
|
|
498
498
|
]),
|
|
499
499
|
n("thead", null, [
|
|
500
500
|
n("tr", null, [
|
|
501
|
-
t.selectable ? (
|
|
501
|
+
t.selectable ? (a(), u("th", _t, [
|
|
502
502
|
n("input", {
|
|
503
503
|
type: "checkbox",
|
|
504
|
-
checked:
|
|
505
|
-
onChange:
|
|
504
|
+
checked: P.value,
|
|
505
|
+
onChange: f
|
|
506
506
|
}, null, 40, St)
|
|
507
507
|
])) : A("", !0),
|
|
508
|
-
(
|
|
509
|
-
key:
|
|
510
|
-
class:
|
|
511
|
-
style:
|
|
512
|
-
},
|
|
508
|
+
(a(!0), u(re, null, he(t.columns, (x, O) => (a(), u("th", {
|
|
509
|
+
key: x.key,
|
|
510
|
+
class: B(de(x, !0)),
|
|
511
|
+
style: ge(Y(x, O, !0))
|
|
512
|
+
}, G(x.title), 7))), 128))
|
|
513
513
|
])
|
|
514
514
|
])
|
|
515
515
|
])
|
|
516
516
|
], 512),
|
|
517
517
|
n("div", {
|
|
518
|
-
class:
|
|
518
|
+
class: B(["table-body-wrap", { "is-loading": t.loading, "is-empty": !I.value.length && !t.loading }]),
|
|
519
519
|
ref_key: "bodyWrapRef",
|
|
520
|
-
ref:
|
|
521
|
-
style:
|
|
520
|
+
ref: v,
|
|
521
|
+
style: ge({ maxHeight: E.value })
|
|
522
522
|
}, [
|
|
523
|
-
t.loading ? (
|
|
523
|
+
t.loading ? (a(), u("div", Lt, [...S[2] || (S[2] = [
|
|
524
524
|
n("div", { class: "loading-spinner" }, null, -1),
|
|
525
525
|
n("div", { class: "loading-text" }, "加载中...", -1)
|
|
526
526
|
])])) : A("", !0),
|
|
527
|
-
!
|
|
528
|
-
ue(
|
|
529
|
-
Ce(
|
|
527
|
+
!I.value.length && !t.loading ? (a(), u("div", Mt, [
|
|
528
|
+
ue(k.$slots, "empty", {}, () => [
|
|
529
|
+
Ce(G(t.emptyText), 1)
|
|
530
530
|
], !0)
|
|
531
531
|
])) : A("", !0),
|
|
532
532
|
n("table", {
|
|
533
|
-
class:
|
|
533
|
+
class: B(["table", { "loading-table": t.loading }]),
|
|
534
534
|
ref_key: "bodyTableRef",
|
|
535
535
|
ref: w
|
|
536
536
|
}, [
|
|
537
537
|
n("colgroup", null, [
|
|
538
|
-
t.selectable ? (
|
|
539
|
-
(
|
|
540
|
-
key:
|
|
541
|
-
style:
|
|
538
|
+
t.selectable ? (a(), u("col", It)) : A("", !0),
|
|
539
|
+
(a(!0), u(re, null, he(t.columns, (x, O) => (a(), u("col", {
|
|
540
|
+
key: x.key,
|
|
541
|
+
style: ge({ width: y.value[O] || void 0, minWidth: y.value[O] || "80px" })
|
|
542
542
|
}, null, 4))), 128))
|
|
543
543
|
]),
|
|
544
544
|
n("tbody", null, [
|
|
545
|
-
(
|
|
546
|
-
key:
|
|
545
|
+
(a(!0), u(re, null, he(I.value, (x, O) => (a(), u("tr", {
|
|
546
|
+
key: le(x, O)
|
|
547
547
|
}, [
|
|
548
|
-
t.selectable ? (
|
|
548
|
+
t.selectable ? (a(), u("td", Bt, [
|
|
549
549
|
n("input", {
|
|
550
550
|
type: "checkbox",
|
|
551
|
-
value:
|
|
552
|
-
checked:
|
|
553
|
-
onChange: (
|
|
551
|
+
value: le(x, O),
|
|
552
|
+
checked: C.value.includes(le(x, O)),
|
|
553
|
+
onChange: (Q) => d(le(x, O))
|
|
554
554
|
}, null, 40, Et)
|
|
555
555
|
])) : A("", !0),
|
|
556
|
-
(
|
|
557
|
-
key:
|
|
558
|
-
class:
|
|
559
|
-
style:
|
|
556
|
+
(a(!0), u(re, null, he(t.columns, (Q, ae) => (a(), u("td", {
|
|
557
|
+
key: Q.key,
|
|
558
|
+
class: B(de(Q)),
|
|
559
|
+
style: ge(Y(Q, ae, !1))
|
|
560
560
|
}, [
|
|
561
|
-
ue(
|
|
562
|
-
item:
|
|
563
|
-
value:
|
|
564
|
-
index:
|
|
561
|
+
ue(k.$slots, `cell-${Q.key}`, {
|
|
562
|
+
item: x,
|
|
563
|
+
value: ce(x, Q.key),
|
|
564
|
+
index: O
|
|
565
565
|
}, () => [
|
|
566
|
-
Ce(
|
|
566
|
+
Ce(G(W(x, Q)), 1)
|
|
567
567
|
], !0)
|
|
568
568
|
], 6))), 128))
|
|
569
569
|
]))), 128))
|
|
570
570
|
])
|
|
571
571
|
], 2)
|
|
572
572
|
], 6),
|
|
573
|
-
t.pagination ? (
|
|
573
|
+
t.pagination ? (a(), Ie(K, {
|
|
574
574
|
key: 0,
|
|
575
575
|
class: "align-right",
|
|
576
|
-
"current-page":
|
|
577
|
-
"onUpdate:currentPage":
|
|
578
|
-
"page-size":
|
|
579
|
-
"onUpdate:pageSize":
|
|
576
|
+
"current-page": p.value,
|
|
577
|
+
"onUpdate:currentPage": S[0] || (S[0] = (x) => p.value = x),
|
|
578
|
+
"page-size": i.value,
|
|
579
|
+
"onUpdate:pageSize": S[1] || (S[1] = (x) => i.value = x),
|
|
580
580
|
loading: e.loading,
|
|
581
581
|
"page-size-options": t.pageSizeOptions,
|
|
582
582
|
onPageChange: m,
|
|
583
|
-
onPageSizeChange:
|
|
583
|
+
onPageSizeChange: o
|
|
584
584
|
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : A("", !0)
|
|
585
585
|
])
|
|
586
586
|
], 512);
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
|
-
}), zt = /* @__PURE__ */ we(Tt, [["__scopeId", "data-v-c75c4929"]]),
|
|
589
|
+
}), zt = /* @__PURE__ */ we(Tt, [["__scopeId", "data-v-c75c4929"]]), Kt = ["onKeydown", "aria-expanded"], Ht = ["src"], Rt = ["placeholder", "onKeydown"], Vt = ["onClick", "onMouseenter"], At = ["src"], Nt = /* @__PURE__ */ me({
|
|
590
590
|
__name: "yselect",
|
|
591
591
|
props: {
|
|
592
592
|
modelValue: {},
|
|
@@ -605,182 +605,182 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
605
605
|
},
|
|
606
606
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
607
607
|
setup(t, { emit: b }) {
|
|
608
|
-
const e = t, l = b,
|
|
608
|
+
const e = t, l = b, p = R(!1), i = R(-1), C = R(), E = R(), _ = R(), M = R(), v = R(!1), w = R(), y = R(""), z = q(() => e.options.find((o) => T(o) === e.modelValue) || null), V = q(() => z.value ? L(z.value) : ""), U = q(() => {
|
|
609
609
|
if (!e.filterable) return e.options;
|
|
610
|
-
const
|
|
611
|
-
return
|
|
612
|
-
const
|
|
613
|
-
return String(
|
|
610
|
+
const o = y.value.trim().toLowerCase();
|
|
611
|
+
return o ? e.options.filter((r) => {
|
|
612
|
+
const h = L(r);
|
|
613
|
+
return String(h).toLowerCase().includes(o);
|
|
614
614
|
}) : e.options;
|
|
615
|
-
}),
|
|
616
|
-
var
|
|
617
|
-
const
|
|
618
|
-
if (!
|
|
619
|
-
const
|
|
620
|
-
return
|
|
615
|
+
}), j = q(() => {
|
|
616
|
+
var H;
|
|
617
|
+
const o = { position: "fixed", zIndex: "4000" }, r = E.value;
|
|
618
|
+
if (!r) return o;
|
|
619
|
+
const h = r.getBoundingClientRect(), N = ((H = _.value) == null ? void 0 : H.getBoundingClientRect().width) || h.width;
|
|
620
|
+
return o.left = `${h.left}px`, o.width = `${N}px`, v.value ? (o.bottom = `${window.innerHeight - h.top + 4}px`, o.top = "auto") : o.top = `${h.bottom + 4}px`, o;
|
|
621
621
|
});
|
|
622
|
-
function
|
|
623
|
-
!
|
|
624
|
-
const
|
|
625
|
-
if (!
|
|
626
|
-
const
|
|
627
|
-
|
|
622
|
+
function D() {
|
|
623
|
+
!p.value || !E.value || ve(() => {
|
|
624
|
+
const o = E.value;
|
|
625
|
+
if (!o) return;
|
|
626
|
+
const r = o.getBoundingClientRect(), h = window.innerHeight, N = 200, H = r.bottom + N + 4, Z = r.top - N - 4, De = H <= h - 20, $e = Z >= 20;
|
|
627
|
+
v.value = !De && $e;
|
|
628
628
|
});
|
|
629
629
|
}
|
|
630
|
-
function
|
|
631
|
-
return typeof
|
|
630
|
+
function T(o) {
|
|
631
|
+
return typeof o == "object" && o !== null ? o[e.valueKey] : o;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
return typeof
|
|
633
|
+
function L(o) {
|
|
634
|
+
return typeof o == "object" && o !== null ? o[e.labelKey] || String(o[e.valueKey]) : String(o);
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
return typeof
|
|
636
|
+
function I(o, r) {
|
|
637
|
+
return typeof o == "object" && o !== null && o.id !== void 0 ? o.id : T(o) || r;
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
return
|
|
639
|
+
function P(o) {
|
|
640
|
+
return T(o) === e.modelValue;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
643
|
-
return typeof
|
|
642
|
+
function X(o) {
|
|
643
|
+
return typeof o == "object" && o !== null ? o[e.disabledKey] === !0 : !1;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
e.disabled || (
|
|
645
|
+
function ee() {
|
|
646
|
+
e.disabled || (p.value ? le() : se());
|
|
647
647
|
}
|
|
648
648
|
function se() {
|
|
649
|
-
e.disabled || (
|
|
650
|
-
|
|
649
|
+
e.disabled || (p.value = !0, ve(() => {
|
|
650
|
+
D(), d(), e.filterable && w.value && (w.value.focus(), y.value = "");
|
|
651
651
|
}));
|
|
652
652
|
}
|
|
653
|
-
function
|
|
654
|
-
|
|
653
|
+
function le() {
|
|
654
|
+
p.value = !1, i.value = -1, v.value = !1, e.filterable && (y.value = "");
|
|
655
655
|
}
|
|
656
|
-
function
|
|
657
|
-
if (
|
|
658
|
-
const
|
|
659
|
-
l("update:modelValue",
|
|
656
|
+
function ce(o, r) {
|
|
657
|
+
if (X(o)) return;
|
|
658
|
+
const h = T(o);
|
|
659
|
+
l("update:modelValue", h), l("change", h, o), le();
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function de() {
|
|
662
662
|
if (!e.clearable || e.disabled) return;
|
|
663
|
-
const
|
|
664
|
-
l("update:modelValue",
|
|
663
|
+
const o = e.clearTo;
|
|
664
|
+
l("update:modelValue", o), l("change", o, null), l("clear"), le();
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
if (!
|
|
668
|
-
|
|
666
|
+
function Y(o) {
|
|
667
|
+
if (!U.value || U.value.length === 0) {
|
|
668
|
+
i.value = -1;
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
|
-
let
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
let
|
|
675
|
-
for (;
|
|
676
|
-
|
|
677
|
-
|
|
671
|
+
let r = i.value;
|
|
672
|
+
const h = U.value.length;
|
|
673
|
+
r === -1 ? r = o > 0 ? 0 : h - 1 : r = (r + o + h) % h;
|
|
674
|
+
let N = 0;
|
|
675
|
+
for (; N < h && X(U.value[r]); )
|
|
676
|
+
r = (r + o + h) % h, N++;
|
|
677
|
+
i.value = N >= h ? -1 : r, f();
|
|
678
|
+
}
|
|
679
|
+
function W() {
|
|
680
|
+
if (i.value < 0) return;
|
|
681
|
+
const o = U.value[i.value];
|
|
682
|
+
!o || X(o) || ce(o, i.value);
|
|
678
683
|
}
|
|
679
|
-
function
|
|
680
|
-
if (
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
}
|
|
684
|
-
function h() {
|
|
685
|
-
if (!$.value) return;
|
|
686
|
-
const i = $.value.querySelector(".yselect__option--selected");
|
|
687
|
-
i && i.scrollIntoView({ block: "nearest" });
|
|
684
|
+
function d() {
|
|
685
|
+
if (!C.value) return;
|
|
686
|
+
const o = C.value.querySelector(".yselect__option--selected");
|
|
687
|
+
o && o.scrollIntoView({ block: "nearest" });
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
if (
|
|
691
|
-
const
|
|
692
|
-
|
|
689
|
+
function f() {
|
|
690
|
+
if (!C.value || i.value < 0) return;
|
|
691
|
+
const r = C.value.querySelectorAll(".yselect__option")[i.value];
|
|
692
|
+
r && r.scrollIntoView({ block: "nearest" });
|
|
693
693
|
}
|
|
694
|
-
function
|
|
695
|
-
const
|
|
696
|
-
(!
|
|
694
|
+
function g(o) {
|
|
695
|
+
const r = o.target;
|
|
696
|
+
(!_.value || !_.value.contains(r)) && le();
|
|
697
697
|
}
|
|
698
|
-
|
|
699
|
-
|
|
698
|
+
ne(() => e.modelValue, () => {
|
|
699
|
+
i.value = -1;
|
|
700
700
|
});
|
|
701
701
|
function m() {
|
|
702
|
-
|
|
702
|
+
p.value && D();
|
|
703
703
|
}
|
|
704
|
-
return
|
|
705
|
-
document.addEventListener("click",
|
|
704
|
+
return Se(() => {
|
|
705
|
+
document.addEventListener("click", g), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0);
|
|
706
706
|
}), Ee(() => {
|
|
707
|
-
document.removeEventListener("click",
|
|
708
|
-
}), (
|
|
709
|
-
class:
|
|
710
|
-
style:
|
|
707
|
+
document.removeEventListener("click", g), window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
|
|
708
|
+
}), (o, r) => (a(), u("div", {
|
|
709
|
+
class: B(["yselect", { "yselect--disabled": t.disabled, [`yselect--${t.size}`]: !0 }]),
|
|
710
|
+
style: ge({ width: t.width }),
|
|
711
711
|
ref_key: "selectContainer",
|
|
712
|
-
ref:
|
|
712
|
+
ref: _
|
|
713
713
|
}, [
|
|
714
714
|
n("div", {
|
|
715
715
|
ref_key: "triggerElement",
|
|
716
716
|
ref: E,
|
|
717
|
-
class:
|
|
718
|
-
"yselect__trigger--open":
|
|
717
|
+
class: B(["yselect__trigger", {
|
|
718
|
+
"yselect__trigger--open": p.value,
|
|
719
719
|
"yselect__trigger--disabled": t.disabled,
|
|
720
720
|
"yselect__trigger--error": t.error
|
|
721
721
|
}]),
|
|
722
|
-
onMousedown:
|
|
722
|
+
onMousedown: J(ee, ["prevent", "stop"]),
|
|
723
723
|
onKeydown: [
|
|
724
|
-
be(
|
|
725
|
-
be(
|
|
726
|
-
be(
|
|
727
|
-
be(
|
|
728
|
-
be(
|
|
724
|
+
be(J(ee, ["prevent"]), ["enter"]),
|
|
725
|
+
be(J(ee, ["prevent"]), ["space"]),
|
|
726
|
+
be(le, ["escape"]),
|
|
727
|
+
be(J(se, ["prevent"]), ["arrow-down"]),
|
|
728
|
+
be(J(se, ["prevent"]), ["arrow-up"])
|
|
729
729
|
],
|
|
730
730
|
tabindex: "0",
|
|
731
731
|
role: "combobox",
|
|
732
|
-
"aria-expanded":
|
|
732
|
+
"aria-expanded": p.value,
|
|
733
733
|
"aria-haspopup": !0
|
|
734
734
|
}, [
|
|
735
|
-
!t.filterable || !
|
|
735
|
+
!t.filterable || !p.value ? (a(), u("span", {
|
|
736
736
|
key: 0,
|
|
737
|
-
class:
|
|
737
|
+
class: B(["yselect__value", { yselect__placeholder: !V.value }])
|
|
738
738
|
}, [
|
|
739
|
-
ue(
|
|
740
|
-
value:
|
|
741
|
-
label:
|
|
739
|
+
ue(o.$slots, "value", {
|
|
740
|
+
value: z.value,
|
|
741
|
+
label: V.value
|
|
742
742
|
}, () => {
|
|
743
|
-
var
|
|
743
|
+
var h;
|
|
744
744
|
return [
|
|
745
|
-
|
|
746
|
-
(
|
|
745
|
+
z.value ? (a(), u(re, { key: 0 }, [
|
|
746
|
+
(h = z.value) != null && h.flagImg ? (a(), u("img", {
|
|
747
747
|
key: 0,
|
|
748
748
|
class: "yselect__flag",
|
|
749
|
-
src:
|
|
749
|
+
src: z.value.flagImg,
|
|
750
750
|
alt: "flag"
|
|
751
|
-
}, null, 8,
|
|
752
|
-
Ce(" " +
|
|
753
|
-
], 64)) : (
|
|
754
|
-
Ce(
|
|
751
|
+
}, null, 8, Ht)) : A("", !0),
|
|
752
|
+
Ce(" " + G(V.value), 1)
|
|
753
|
+
], 64)) : (a(), u(re, { key: 1 }, [
|
|
754
|
+
Ce(G(t.placeholder), 1)
|
|
755
755
|
], 64))
|
|
756
756
|
];
|
|
757
757
|
}, !0)
|
|
758
|
-
], 2)) : Be((
|
|
758
|
+
], 2)) : Be((a(), u("input", {
|
|
759
759
|
key: 1,
|
|
760
760
|
ref_key: "inputElement",
|
|
761
761
|
ref: w,
|
|
762
762
|
class: "yselect__input",
|
|
763
763
|
type: "text",
|
|
764
|
-
placeholder:
|
|
765
|
-
"onUpdate:modelValue":
|
|
764
|
+
placeholder: V.value || t.placeholder,
|
|
765
|
+
"onUpdate:modelValue": r[0] || (r[0] = (h) => y.value = h),
|
|
766
766
|
onKeydown: [
|
|
767
|
-
|
|
767
|
+
r[1] || (r[1] = J(() => {
|
|
768
768
|
}, ["stop"])),
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
be(
|
|
773
|
-
be(
|
|
769
|
+
r[2] || (r[2] = be(J((h) => Y(1), ["prevent"]), ["arrow-down"])),
|
|
770
|
+
r[3] || (r[3] = be(J((h) => Y(-1), ["prevent"]), ["arrow-up"])),
|
|
771
|
+
r[4] || (r[4] = be(J((h) => W(), ["prevent"]), ["enter"])),
|
|
772
|
+
be(J(le, ["prevent"]), ["esc"]),
|
|
773
|
+
be(J(de, ["prevent"]), ["delete"])
|
|
774
774
|
]
|
|
775
775
|
}, null, 40, Rt)), [
|
|
776
|
-
[tt,
|
|
776
|
+
[tt, y.value]
|
|
777
777
|
]),
|
|
778
|
-
t.clearable && !t.disabled &&
|
|
778
|
+
t.clearable && !t.disabled && z.value ? (a(), u("span", {
|
|
779
779
|
key: 2,
|
|
780
780
|
class: "yselect__clear",
|
|
781
781
|
title: "清空",
|
|
782
|
-
onClick:
|
|
783
|
-
}, [...
|
|
782
|
+
onClick: J(de, ["stop"])
|
|
783
|
+
}, [...r[8] || (r[8] = [
|
|
784
784
|
n("svg", {
|
|
785
785
|
width: "12",
|
|
786
786
|
height: "12",
|
|
@@ -796,8 +796,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
796
796
|
], -1)
|
|
797
797
|
])])) : A("", !0),
|
|
798
798
|
n("span", {
|
|
799
|
-
class:
|
|
800
|
-
}, [...
|
|
799
|
+
class: B(["yselect__arrow", { "yselect__arrow--open": p.value }])
|
|
800
|
+
}, [...r[9] || (r[9] = [
|
|
801
801
|
n("svg", {
|
|
802
802
|
width: "12",
|
|
803
803
|
height: "12",
|
|
@@ -813,49 +813,49 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
813
813
|
})
|
|
814
814
|
], -1)
|
|
815
815
|
])], 2)
|
|
816
|
-
], 42,
|
|
817
|
-
|
|
818
|
-
default:
|
|
819
|
-
(
|
|
820
|
-
|
|
816
|
+
], 42, Kt),
|
|
817
|
+
fe(ke, { name: "yselect-dropdown" }, {
|
|
818
|
+
default: pe(() => [
|
|
819
|
+
(a(), Ie(Re, { to: "body" }, [
|
|
820
|
+
p.value ? (a(), u("div", {
|
|
821
821
|
key: 0,
|
|
822
822
|
ref_key: "dropdownEl",
|
|
823
|
-
ref:
|
|
824
|
-
class:
|
|
825
|
-
style:
|
|
826
|
-
onMousedown:
|
|
823
|
+
ref: M,
|
|
824
|
+
class: B(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": v.value }]),
|
|
825
|
+
style: ge(j.value),
|
|
826
|
+
onMousedown: r[6] || (r[6] = J(() => {
|
|
827
827
|
}, ["stop"])),
|
|
828
|
-
onClick:
|
|
828
|
+
onClick: r[7] || (r[7] = J(() => {
|
|
829
829
|
}, ["stop"]))
|
|
830
830
|
}, [
|
|
831
831
|
n("div", {
|
|
832
832
|
class: "yselect__options",
|
|
833
833
|
ref_key: "optionsContainer",
|
|
834
|
-
ref:
|
|
834
|
+
ref: C
|
|
835
835
|
}, [
|
|
836
|
-
(
|
|
837
|
-
key:
|
|
838
|
-
class:
|
|
839
|
-
"yselect__option--selected":
|
|
840
|
-
"yselect__option--disabled":
|
|
841
|
-
"yselect__option--hover":
|
|
836
|
+
(a(!0), u(re, null, he(U.value, (h, N) => (a(), u("div", {
|
|
837
|
+
key: I(h, N),
|
|
838
|
+
class: B(["yselect__option", {
|
|
839
|
+
"yselect__option--selected": P(h),
|
|
840
|
+
"yselect__option--disabled": X(h),
|
|
841
|
+
"yselect__option--hover": i.value === N
|
|
842
842
|
}]),
|
|
843
|
-
onClick: (
|
|
844
|
-
onMouseenter: (
|
|
845
|
-
onMouseleave:
|
|
843
|
+
onClick: (H) => ce(h),
|
|
844
|
+
onMouseenter: (H) => i.value = N,
|
|
845
|
+
onMouseleave: r[5] || (r[5] = (H) => i.value = -1)
|
|
846
846
|
}, [
|
|
847
|
-
ue(
|
|
848
|
-
option:
|
|
849
|
-
index:
|
|
850
|
-
selected:
|
|
847
|
+
ue(o.$slots, "option", {
|
|
848
|
+
option: h,
|
|
849
|
+
index: N,
|
|
850
|
+
selected: P(h)
|
|
851
851
|
}, () => [
|
|
852
|
-
|
|
852
|
+
h != null && h.flagImg ? (a(), u("img", {
|
|
853
853
|
key: 0,
|
|
854
854
|
class: "yselect__flag",
|
|
855
|
-
src:
|
|
855
|
+
src: h.flagImg,
|
|
856
856
|
alt: "flag"
|
|
857
857
|
}, null, 8, At)) : A("", !0),
|
|
858
|
-
Ce(" " +
|
|
858
|
+
Ce(" " + G(L(h)), 1)
|
|
859
859
|
], !0)
|
|
860
860
|
], 42, Vt))), 128))
|
|
861
861
|
], 512)
|
|
@@ -866,7 +866,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
866
866
|
})
|
|
867
867
|
], 6));
|
|
868
868
|
}
|
|
869
|
-
}), Je = /* @__PURE__ */ we(
|
|
869
|
+
}), Je = /* @__PURE__ */ we(Nt, [["__scopeId", "data-v-6cd47cb7"]]), Yt = { class: "ypagination" }, Ft = { class: "page-actions" }, Pt = { class: "page-size-select" }, Wt = /* @__PURE__ */ me({
|
|
870
870
|
__name: "ypagination",
|
|
871
871
|
props: {
|
|
872
872
|
currentPage: {},
|
|
@@ -881,61 +881,61 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
881
881
|
},
|
|
882
882
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
883
883
|
setup(t, { emit: b }) {
|
|
884
|
-
const e = t, l = b,
|
|
884
|
+
const e = t, l = b, p = R(e.pageSize), i = q(() => e.pageSizeOptions), C = q({
|
|
885
885
|
get: () => e.currentPage,
|
|
886
|
-
set: (
|
|
887
|
-
l("update:currentPage",
|
|
886
|
+
set: (v) => {
|
|
887
|
+
l("update:currentPage", v), l("page-change", v);
|
|
888
888
|
}
|
|
889
889
|
});
|
|
890
|
-
function E(
|
|
891
|
-
e.loading ||
|
|
890
|
+
function E(v) {
|
|
891
|
+
e.loading || v >= 1 && v !== e.currentPage && (C.value = v);
|
|
892
892
|
}
|
|
893
|
-
function
|
|
894
|
-
e.loading || (
|
|
893
|
+
function _(v) {
|
|
894
|
+
e.loading || (p.value = v, l("update:pageSize", v), l("page-size-change", v), C.value = 1);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
897
|
-
e.loading || (
|
|
896
|
+
function M(v) {
|
|
897
|
+
e.loading || (v === "prev" ? E(C.value - 1) : v === "next" && E(C.value + 1));
|
|
898
898
|
}
|
|
899
|
-
return
|
|
899
|
+
return p.value = e.pageSize, ne(
|
|
900
900
|
() => e.pageSize,
|
|
901
|
-
(
|
|
902
|
-
typeof
|
|
901
|
+
(v) => {
|
|
902
|
+
typeof v == "number" && p.value !== v && (p.value = v);
|
|
903
903
|
}
|
|
904
|
-
), (
|
|
905
|
-
const
|
|
906
|
-
return
|
|
907
|
-
n("div",
|
|
908
|
-
|
|
904
|
+
), (v, w) => {
|
|
905
|
+
const y = Ne("YButton"), z = Ne("YSelect");
|
|
906
|
+
return a(), u("div", Yt, [
|
|
907
|
+
n("div", Ft, [
|
|
908
|
+
fe(y, {
|
|
909
909
|
size: "small",
|
|
910
910
|
variant: "secondary",
|
|
911
|
-
disabled:
|
|
912
|
-
onClick: w[0] || (w[0] = (
|
|
911
|
+
disabled: C.value === 1 || t.loading,
|
|
912
|
+
onClick: w[0] || (w[0] = (V) => E(1))
|
|
913
913
|
}, {
|
|
914
|
-
default:
|
|
914
|
+
default: pe(() => [...w[2] || (w[2] = [
|
|
915
915
|
Ce("首页", -1)
|
|
916
916
|
])]),
|
|
917
917
|
_: 1
|
|
918
918
|
}, 8, ["disabled"]),
|
|
919
|
-
|
|
919
|
+
fe(y, {
|
|
920
920
|
class: "ml-1",
|
|
921
921
|
variant: "secondary",
|
|
922
922
|
size: "small",
|
|
923
923
|
groupItems: [
|
|
924
|
-
{ label: "上一页", value: "prev", disabled:
|
|
924
|
+
{ label: "上一页", value: "prev", disabled: C.value === 1 || t.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
925
925
|
{ label: "下一页", value: "next", disabled: t.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
926
926
|
],
|
|
927
|
-
onGroupClick:
|
|
927
|
+
onGroupClick: M
|
|
928
928
|
}, null, 8, ["groupItems"]),
|
|
929
929
|
n("div", Pt, [
|
|
930
|
-
|
|
931
|
-
modelValue:
|
|
932
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
933
|
-
options:
|
|
930
|
+
fe(z, {
|
|
931
|
+
modelValue: p.value,
|
|
932
|
+
"onUpdate:modelValue": w[1] || (w[1] = (V) => p.value = V),
|
|
933
|
+
options: i.value,
|
|
934
934
|
size: "small",
|
|
935
935
|
width: "105px",
|
|
936
936
|
clearable: !1,
|
|
937
937
|
disabled: t.loading,
|
|
938
|
-
onChange:
|
|
938
|
+
onChange: _
|
|
939
939
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
940
940
|
])
|
|
941
941
|
])
|
|
@@ -997,17 +997,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
997
997
|
label: { default: "" }
|
|
998
998
|
},
|
|
999
999
|
setup(t) {
|
|
1000
|
-
const b = t, e =
|
|
1001
|
-
const
|
|
1002
|
-
if (
|
|
1000
|
+
const b = t, e = q(() => b.tone || "default"), l = q(() => {
|
|
1001
|
+
const p = (b.label || "").trim(), i = b.tone, C = b.progress;
|
|
1002
|
+
if (C) {
|
|
1003
1003
|
const E = {
|
|
1004
1004
|
incomplete: "未完成",
|
|
1005
1005
|
partiallyComplete: "部分完成",
|
|
1006
1006
|
complete: "已完成"
|
|
1007
1007
|
};
|
|
1008
|
-
return
|
|
1008
|
+
return p ? `${p},进度:${E[C] || C}` : `进度:${E[C] || C}`;
|
|
1009
1009
|
}
|
|
1010
|
-
if (
|
|
1010
|
+
if (i && i !== "default") {
|
|
1011
1011
|
const E = {
|
|
1012
1012
|
informational: "信息",
|
|
1013
1013
|
success: "成功",
|
|
@@ -1016,12 +1016,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1016
1016
|
critical: "严重",
|
|
1017
1017
|
default: "默认"
|
|
1018
1018
|
};
|
|
1019
|
-
return
|
|
1019
|
+
return p ? `${p},语气:${E[i] || i}` : `语气:${E[i] || i}`;
|
|
1020
1020
|
}
|
|
1021
|
-
return
|
|
1021
|
+
return p || "标记";
|
|
1022
1022
|
});
|
|
1023
|
-
return (
|
|
1024
|
-
class:
|
|
1023
|
+
return (p, i) => (a(), u("span", {
|
|
1024
|
+
class: B(["y-badge", [
|
|
1025
1025
|
`y-badge--${e.value}`,
|
|
1026
1026
|
`y-badge--${t.size}`,
|
|
1027
1027
|
{ "is-outline": t.outline, "is-pill": t.pill },
|
|
@@ -1031,14 +1031,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1031
1031
|
"aria-label": l.value
|
|
1032
1032
|
}, [
|
|
1033
1033
|
n("span", qt, [
|
|
1034
|
-
t.progress ? (
|
|
1035
|
-
t.progress === "incomplete" ? (
|
|
1034
|
+
t.progress ? (a(), u("span", Ut, [
|
|
1035
|
+
t.progress === "incomplete" ? (a(), u("svg", Zt, [...i[0] || (i[0] = [
|
|
1036
1036
|
n("circle", {
|
|
1037
1037
|
cx: "10",
|
|
1038
1038
|
cy: "10",
|
|
1039
1039
|
r: "5"
|
|
1040
1040
|
}, null, -1)
|
|
1041
|
-
])])) : t.progress === "partiallyComplete" ? (
|
|
1041
|
+
])])) : t.progress === "partiallyComplete" ? (a(), u("svg", Qt, [...i[1] || (i[1] = [
|
|
1042
1042
|
n("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1043
1043
|
n("circle", {
|
|
1044
1044
|
cx: "10",
|
|
@@ -1048,33 +1048,33 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1048
1048
|
stroke: "currentColor",
|
|
1049
1049
|
"stroke-width": "2"
|
|
1050
1050
|
}, null, -1)
|
|
1051
|
-
])])) : t.progress === "complete" ? (
|
|
1051
|
+
])])) : t.progress === "complete" ? (a(), u("svg", Jt, [...i[2] || (i[2] = [
|
|
1052
1052
|
n("path", {
|
|
1053
1053
|
"fill-rule": "evenodd",
|
|
1054
1054
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1055
1055
|
"clip-rule": "evenodd"
|
|
1056
1056
|
}, null, -1)
|
|
1057
1057
|
])])) : A("", !0)
|
|
1058
|
-
])) : t.icon ? (
|
|
1059
|
-
t.icon === "dot" ? (
|
|
1058
|
+
])) : t.icon ? (a(), u("span", Xt, [
|
|
1059
|
+
t.icon === "dot" ? (a(), u("svg", Gt, [...i[3] || (i[3] = [
|
|
1060
1060
|
n("circle", {
|
|
1061
1061
|
cx: "10",
|
|
1062
1062
|
cy: "10",
|
|
1063
1063
|
r: "4"
|
|
1064
1064
|
}, null, -1)
|
|
1065
|
-
])])) : t.icon === "check" ? (
|
|
1065
|
+
])])) : t.icon === "check" ? (a(), u("svg", en, [...i[4] || (i[4] = [
|
|
1066
1066
|
n("path", {
|
|
1067
1067
|
"fill-rule": "evenodd",
|
|
1068
1068
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1069
1069
|
"clip-rule": "evenodd"
|
|
1070
1070
|
}, null, -1)
|
|
1071
|
-
])])) : t.icon === "alert" ? (
|
|
1071
|
+
])])) : t.icon === "alert" ? (a(), u("svg", tn, [...i[5] || (i[5] = [
|
|
1072
1072
|
n("path", {
|
|
1073
1073
|
"fill-rule": "evenodd",
|
|
1074
1074
|
d: "M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z",
|
|
1075
1075
|
"clip-rule": "evenodd"
|
|
1076
1076
|
}, null, -1)
|
|
1077
|
-
])])) : (
|
|
1077
|
+
])])) : (a(), u("svg", nn, [...i[6] || (i[6] = [
|
|
1078
1078
|
n("circle", {
|
|
1079
1079
|
cx: "10",
|
|
1080
1080
|
cy: "10",
|
|
@@ -1083,8 +1083,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1083
1083
|
])]))
|
|
1084
1084
|
])) : A("", !0),
|
|
1085
1085
|
n("span", ln, [
|
|
1086
|
-
ue(
|
|
1087
|
-
Ce(
|
|
1086
|
+
ue(p.$slots, "default", {}, () => [
|
|
1087
|
+
Ce(G(t.label), 1)
|
|
1088
1088
|
], !0)
|
|
1089
1089
|
])
|
|
1090
1090
|
])
|
|
@@ -1111,82 +1111,82 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1111
1111
|
},
|
|
1112
1112
|
emits: ["update:modelValue", "open", "close"],
|
|
1113
1113
|
setup(t, { emit: b }) {
|
|
1114
|
-
const e = t, l = b,
|
|
1114
|
+
const e = t, l = b, p = q({
|
|
1115
1115
|
get: () => e.modelValue,
|
|
1116
1116
|
set: (w) => l("update:modelValue", w)
|
|
1117
|
-
}),
|
|
1117
|
+
}), i = R(null), C = q(() => {
|
|
1118
1118
|
const w = {};
|
|
1119
1119
|
return w.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), w.margin = "0 auto", w.top = e.top, w;
|
|
1120
1120
|
});
|
|
1121
1121
|
function E() {
|
|
1122
|
-
e.maskClosable &&
|
|
1122
|
+
e.maskClosable && _();
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1125
|
-
|
|
1124
|
+
function _() {
|
|
1125
|
+
p.value && (p.value = !1, l("close"));
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1128
|
-
e.closable &&
|
|
1127
|
+
function M() {
|
|
1128
|
+
e.closable && _();
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1131
|
-
w.key === "Escape" &&
|
|
1130
|
+
function v(w) {
|
|
1131
|
+
w.key === "Escape" && M();
|
|
1132
1132
|
}
|
|
1133
|
-
return
|
|
1133
|
+
return ne(() => e.modelValue, (w) => {
|
|
1134
1134
|
w ? (l("open"), requestAnimationFrame(() => {
|
|
1135
|
-
var
|
|
1136
|
-
return (
|
|
1137
|
-
}), document.addEventListener("keydown",
|
|
1138
|
-
}),
|
|
1139
|
-
e.modelValue && (document.addEventListener("keydown",
|
|
1135
|
+
var y;
|
|
1136
|
+
return (y = i.value) == null ? void 0 : y.focus();
|
|
1137
|
+
}), document.addEventListener("keydown", v), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", v), document.body.style.overflow = "");
|
|
1138
|
+
}), Se(() => {
|
|
1139
|
+
e.modelValue && (document.addEventListener("keydown", v), document.body.style.overflow = "hidden");
|
|
1140
1140
|
}), Ee(() => {
|
|
1141
|
-
document.removeEventListener("keydown",
|
|
1142
|
-
}), (w,
|
|
1141
|
+
document.removeEventListener("keydown", v), document.body.style.overflow = "";
|
|
1142
|
+
}), (w, y) => (a(), Ie(Re, { to: "body" }, [
|
|
1143
1143
|
Be(n("div", {
|
|
1144
1144
|
class: "y-dialog-root",
|
|
1145
1145
|
role: "dialog",
|
|
1146
1146
|
"aria-modal": !0,
|
|
1147
|
-
"aria-hidden": !
|
|
1148
|
-
style:
|
|
1147
|
+
"aria-hidden": !p.value,
|
|
1148
|
+
style: ge({ zIndex: String(t.zIndex) })
|
|
1149
1149
|
}, [
|
|
1150
1150
|
n("div", {
|
|
1151
1151
|
class: "y-dialog-mask",
|
|
1152
1152
|
onClick: E
|
|
1153
1153
|
}),
|
|
1154
|
-
|
|
1155
|
-
default:
|
|
1154
|
+
fe(ke, { name: "dialog-zoom-fade" }, {
|
|
1155
|
+
default: pe(() => [
|
|
1156
1156
|
Be(n("div", {
|
|
1157
1157
|
ref_key: "panelRef",
|
|
1158
|
-
ref:
|
|
1159
|
-
class:
|
|
1160
|
-
style:
|
|
1161
|
-
onKeydown: be(
|
|
1158
|
+
ref: i,
|
|
1159
|
+
class: B(["y-dialog-panel", [t.center ? "is-center" : ""]]),
|
|
1160
|
+
style: ge(C.value),
|
|
1161
|
+
onKeydown: be(J(M, ["prevent", "stop"]), ["esc"]),
|
|
1162
1162
|
tabindex: "-1"
|
|
1163
1163
|
}, [
|
|
1164
|
-
t.showHeader ? (
|
|
1164
|
+
t.showHeader ? (a(), u("div", un, [
|
|
1165
1165
|
ue(w.$slots, "header", {}, () => [
|
|
1166
|
-
n("div", cn,
|
|
1166
|
+
n("div", cn, G(t.title), 1)
|
|
1167
1167
|
], !0),
|
|
1168
|
-
t.closable ? (
|
|
1168
|
+
t.closable ? (a(), u("button", {
|
|
1169
1169
|
key: 0,
|
|
1170
1170
|
type: "button",
|
|
1171
1171
|
class: "y-dialog-close",
|
|
1172
1172
|
"aria-label": "Close",
|
|
1173
|
-
onClick:
|
|
1173
|
+
onClick: _
|
|
1174
1174
|
}, " ✕ ")) : A("", !0)
|
|
1175
1175
|
])) : A("", !0),
|
|
1176
1176
|
n("div", dn, [
|
|
1177
1177
|
ue(w.$slots, "default", {}, void 0, !0)
|
|
1178
1178
|
]),
|
|
1179
|
-
w.$slots.footer ? (
|
|
1179
|
+
w.$slots.footer ? (a(), u("div", fn, [
|
|
1180
1180
|
ue(w.$slots, "footer", {}, void 0, !0)
|
|
1181
1181
|
])) : A("", !0)
|
|
1182
1182
|
], 46, rn), [
|
|
1183
|
-
[
|
|
1183
|
+
[Ke, p.value]
|
|
1184
1184
|
])
|
|
1185
1185
|
]),
|
|
1186
1186
|
_: 3
|
|
1187
1187
|
})
|
|
1188
1188
|
], 12, an), [
|
|
1189
|
-
[
|
|
1189
|
+
[Ke, p.value]
|
|
1190
1190
|
])
|
|
1191
1191
|
]));
|
|
1192
1192
|
}
|
|
@@ -1210,191 +1210,191 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1210
1210
|
},
|
|
1211
1211
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1212
1212
|
setup(t, { expose: b, emit: e }) {
|
|
1213
|
-
const l = t,
|
|
1214
|
-
let
|
|
1215
|
-
const
|
|
1216
|
-
if (!
|
|
1217
|
-
const
|
|
1218
|
-
l.width !== "auto" && (
|
|
1219
|
-
const { top:
|
|
1220
|
-
return
|
|
1221
|
-
}),
|
|
1213
|
+
const l = t, p = e, i = R(), C = R(), E = R(), _ = R(!1), M = R(), v = R(), w = R({});
|
|
1214
|
+
let y = null, z = null;
|
|
1215
|
+
const V = q(() => {
|
|
1216
|
+
if (!_.value || !M.value) return {};
|
|
1217
|
+
const Y = {};
|
|
1218
|
+
l.width !== "auto" && (Y.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.maxWidth && (Y.maxWidth = typeof l.maxWidth == "number" ? `${l.maxWidth}px` : l.maxWidth);
|
|
1219
|
+
const { top: W, left: d } = j();
|
|
1220
|
+
return Y.top = `${W}px`, Y.left = `${d}px`, Y;
|
|
1221
|
+
}), U = q(() => {
|
|
1222
1222
|
if (!l.showArrow) return {};
|
|
1223
1223
|
if (Object.keys(w.value).length > 0)
|
|
1224
1224
|
return w.value;
|
|
1225
|
-
const
|
|
1226
|
-
return l.placement.startsWith("top") || l.placement.startsWith("bottom") ?
|
|
1225
|
+
const Y = {};
|
|
1226
|
+
return l.placement.startsWith("top") || l.placement.startsWith("bottom") ? Y.left = "50%" : Y.top = "50%", Y;
|
|
1227
1227
|
});
|
|
1228
|
-
function
|
|
1229
|
-
var
|
|
1230
|
-
if (!
|
|
1231
|
-
const { width:
|
|
1232
|
-
let
|
|
1228
|
+
function j() {
|
|
1229
|
+
var H, Z;
|
|
1230
|
+
if (!M.value) return { top: 0, left: 0 };
|
|
1231
|
+
const { width: Y, height: W, top: d, left: f } = M.value, g = ((H = E.value) == null ? void 0 : H.offsetWidth) || 200, m = ((Z = E.value) == null ? void 0 : Z.offsetHeight) || 100;
|
|
1232
|
+
let o = 0, r = 0;
|
|
1233
1233
|
switch (l.placement) {
|
|
1234
1234
|
case "top":
|
|
1235
|
-
|
|
1235
|
+
o = d - m - l.offset, r = f + (Y - g) / 2;
|
|
1236
1236
|
break;
|
|
1237
1237
|
case "top-start":
|
|
1238
|
-
|
|
1238
|
+
o = d - m - l.offset, r = f;
|
|
1239
1239
|
break;
|
|
1240
1240
|
case "top-end":
|
|
1241
|
-
|
|
1241
|
+
o = d - m - l.offset, r = f + Y - g;
|
|
1242
1242
|
break;
|
|
1243
1243
|
case "bottom":
|
|
1244
|
-
|
|
1244
|
+
o = d + W + l.offset, r = f + (Y - g) / 2;
|
|
1245
1245
|
break;
|
|
1246
1246
|
case "bottom-start":
|
|
1247
|
-
|
|
1247
|
+
o = d + W + l.offset, r = f;
|
|
1248
1248
|
break;
|
|
1249
1249
|
case "bottom-end":
|
|
1250
|
-
|
|
1250
|
+
o = d + W + l.offset, r = f + Y - g;
|
|
1251
1251
|
break;
|
|
1252
1252
|
case "left":
|
|
1253
|
-
|
|
1253
|
+
o = d + (W - m) / 2, r = f - g - l.offset;
|
|
1254
1254
|
break;
|
|
1255
1255
|
case "left-start":
|
|
1256
|
-
|
|
1256
|
+
o = d, r = f - g - l.offset;
|
|
1257
1257
|
break;
|
|
1258
1258
|
case "left-end":
|
|
1259
|
-
|
|
1259
|
+
o = d + W - m, r = f - g - l.offset;
|
|
1260
1260
|
break;
|
|
1261
1261
|
case "right":
|
|
1262
|
-
|
|
1262
|
+
o = d + (W - m) / 2, r = f + Y + l.offset;
|
|
1263
1263
|
break;
|
|
1264
1264
|
case "right-start":
|
|
1265
|
-
|
|
1265
|
+
o = d, r = f + Y + l.offset;
|
|
1266
1266
|
break;
|
|
1267
1267
|
case "right-end":
|
|
1268
|
-
|
|
1268
|
+
o = d + W - m, r = f + Y + l.offset;
|
|
1269
1269
|
break;
|
|
1270
1270
|
}
|
|
1271
|
-
const
|
|
1272
|
-
return
|
|
1271
|
+
const h = window.innerWidth, N = window.innerHeight;
|
|
1272
|
+
return r < 8 && (r = 8), r + g > h - 8 && (r = h - g - 8), o < 8 && (o = 8), o + m > N - 8 && (o = N - m - 8), { top: o, left: r };
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1275
|
-
l.disabled ||
|
|
1276
|
-
|
|
1277
|
-
}, l.openDelay) :
|
|
1274
|
+
function D() {
|
|
1275
|
+
l.disabled || _.value || (P(), l.openDelay > 0 ? y = setTimeout(() => {
|
|
1276
|
+
T();
|
|
1277
|
+
}, l.openDelay) : T());
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1279
|
+
function T() {
|
|
1280
|
+
p("before-show"), _.value = !0, p("update:modelValue", !0), p("show"), ve(() => {
|
|
1281
|
+
ve(() => {
|
|
1282
|
+
ee();
|
|
1283
1283
|
});
|
|
1284
1284
|
});
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
}, l.closeDelay) :
|
|
1286
|
+
function L() {
|
|
1287
|
+
_.value && (P(), l.closeDelay > 0 ? z = setTimeout(() => {
|
|
1288
|
+
I();
|
|
1289
|
+
}, l.closeDelay) : I());
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1292
|
-
|
|
1291
|
+
function I() {
|
|
1292
|
+
p("before-hide"), _.value = !1, p("update:modelValue", !1), p("hide");
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1294
|
+
function P() {
|
|
1295
|
+
y && (clearTimeout(y), y = null), z && (clearTimeout(z), z = null);
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1298
|
-
if (!l.showArrow || !
|
|
1297
|
+
function X() {
|
|
1298
|
+
if (!l.showArrow || !M.value || !E.value) {
|
|
1299
1299
|
w.value = {};
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
|
-
const
|
|
1303
|
-
if (
|
|
1304
|
-
const
|
|
1305
|
-
l.placement.startsWith("top") || l.placement.startsWith("bottom") ?
|
|
1302
|
+
const Y = M.value, W = E.value.getBoundingClientRect();
|
|
1303
|
+
if (W.width === 0 || W.height === 0) {
|
|
1304
|
+
const f = {};
|
|
1305
|
+
l.placement.startsWith("top") || l.placement.startsWith("bottom") ? f.left = "50%" : f.top = "50%", w.value = f;
|
|
1306
1306
|
return;
|
|
1307
1307
|
}
|
|
1308
|
-
const
|
|
1308
|
+
const d = {};
|
|
1309
1309
|
if (l.placement.startsWith("top")) {
|
|
1310
|
-
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1310
|
+
d.bottom = "-6px";
|
|
1311
|
+
const f = Y.left + Y.width / 2, g = W.left, m = f - g;
|
|
1312
|
+
d.left = `${Math.max(12, Math.min(m, W.width - 12))}px`;
|
|
1313
1313
|
} else if (l.placement.startsWith("bottom")) {
|
|
1314
|
-
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1314
|
+
d.top = "-6px";
|
|
1315
|
+
const f = Y.left + Y.width / 2, g = W.left, m = f - g;
|
|
1316
|
+
d.left = `${Math.max(12, Math.min(m, W.width - 12))}px`;
|
|
1317
1317
|
} else if (l.placement.startsWith("left")) {
|
|
1318
|
-
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1318
|
+
d.right = "-6px";
|
|
1319
|
+
const f = Y.top + Y.height / 2, g = W.top, m = f - g;
|
|
1320
|
+
d.top = `${Math.max(12, Math.min(m, W.height - 12))}px`;
|
|
1321
1321
|
} else if (l.placement.startsWith("right")) {
|
|
1322
|
-
|
|
1323
|
-
const
|
|
1324
|
-
|
|
1322
|
+
d.left = "-6px";
|
|
1323
|
+
const f = Y.top + Y.height / 2, g = W.top, m = f - g;
|
|
1324
|
+
d.top = `${Math.max(12, Math.min(m, W.height - 12))}px`;
|
|
1325
1325
|
}
|
|
1326
|
-
w.value =
|
|
1326
|
+
w.value = d;
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1329
|
-
|
|
1330
|
-
E.value && (
|
|
1328
|
+
function ee() {
|
|
1329
|
+
C.value && (M.value = C.value.getBoundingClientRect(), E.value && (v.value = E.value.getBoundingClientRect(), X(), _.value && requestAnimationFrame(() => {
|
|
1330
|
+
E.value && (v.value = E.value.getBoundingClientRect(), X());
|
|
1331
1331
|
})));
|
|
1332
1332
|
}
|
|
1333
1333
|
function se() {
|
|
1334
|
-
l.disabled || l.trigger === "click" && (
|
|
1334
|
+
l.disabled || l.trigger === "click" && (_.value ? L() : D());
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1337
|
-
l.disabled || l.trigger !== "hover" || (
|
|
1336
|
+
function le() {
|
|
1337
|
+
l.disabled || l.trigger !== "hover" || (P(), D());
|
|
1338
1338
|
}
|
|
1339
|
-
function
|
|
1340
|
-
l.disabled || l.trigger !== "hover" ||
|
|
1339
|
+
function ce() {
|
|
1340
|
+
l.disabled || l.trigger !== "hover" || L();
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1343
|
-
if (!l.closeOnClickOutside || !
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1342
|
+
function de(Y) {
|
|
1343
|
+
if (!l.closeOnClickOutside || !_.value) return;
|
|
1344
|
+
const W = Y.target;
|
|
1345
|
+
i.value && !i.value.contains(W) && E.value && !E.value.contains(W) && L();
|
|
1346
1346
|
}
|
|
1347
|
-
return
|
|
1348
|
-
|
|
1349
|
-
}),
|
|
1350
|
-
|
|
1351
|
-
}),
|
|
1352
|
-
l.modelValue &&
|
|
1347
|
+
return ne(() => l.modelValue, (Y) => {
|
|
1348
|
+
Y !== _.value && (Y ? D() : L());
|
|
1349
|
+
}), ne(_, (Y) => {
|
|
1350
|
+
Y ? (document.addEventListener("click", de), window.addEventListener("resize", ee), window.addEventListener("scroll", ee, !0)) : (document.removeEventListener("click", de), window.removeEventListener("resize", ee), window.removeEventListener("scroll", ee, !0));
|
|
1351
|
+
}), Se(() => {
|
|
1352
|
+
l.modelValue && D();
|
|
1353
1353
|
}), Ee(() => {
|
|
1354
|
-
|
|
1354
|
+
P(), document.removeEventListener("click", de), window.removeEventListener("resize", ee), window.removeEventListener("scroll", ee, !0);
|
|
1355
1355
|
}), b({
|
|
1356
|
-
show:
|
|
1357
|
-
hide:
|
|
1358
|
-
updatePosition:
|
|
1359
|
-
}), (
|
|
1356
|
+
show: D,
|
|
1357
|
+
hide: L,
|
|
1358
|
+
updatePosition: ee
|
|
1359
|
+
}), (Y, W) => (a(), u("div", {
|
|
1360
1360
|
class: "ypopover",
|
|
1361
1361
|
ref_key: "popoverRef",
|
|
1362
|
-
ref:
|
|
1362
|
+
ref: i
|
|
1363
1363
|
}, [
|
|
1364
1364
|
n("div", {
|
|
1365
1365
|
ref_key: "triggerRef",
|
|
1366
|
-
ref:
|
|
1366
|
+
ref: C,
|
|
1367
1367
|
onClick: se,
|
|
1368
|
-
onMouseenter:
|
|
1369
|
-
onMouseleave:
|
|
1368
|
+
onMouseenter: le,
|
|
1369
|
+
onMouseleave: ce
|
|
1370
1370
|
}, [
|
|
1371
|
-
ue(
|
|
1371
|
+
ue(Y.$slots, "reference", {}, void 0, !0)
|
|
1372
1372
|
], 544),
|
|
1373
|
-
(
|
|
1374
|
-
|
|
1375
|
-
default:
|
|
1376
|
-
|
|
1373
|
+
(a(), Ie(Re, { to: "body" }, [
|
|
1374
|
+
fe(ke, { name: "ypopover-fade" }, {
|
|
1375
|
+
default: pe(() => [
|
|
1376
|
+
_.value ? (a(), u("div", {
|
|
1377
1377
|
key: 0,
|
|
1378
1378
|
ref_key: "contentRef",
|
|
1379
1379
|
ref: E,
|
|
1380
|
-
class:
|
|
1380
|
+
class: B(["ypopover__content", [
|
|
1381
1381
|
`ypopover__content--${t.placement}`,
|
|
1382
1382
|
{
|
|
1383
1383
|
"ypopover__content--dark": t.dark,
|
|
1384
1384
|
"ypopover__content--no-padding": !t.showPadding
|
|
1385
1385
|
}
|
|
1386
1386
|
]]),
|
|
1387
|
-
style:
|
|
1388
|
-
onClick:
|
|
1387
|
+
style: ge(V.value),
|
|
1388
|
+
onClick: W[0] || (W[0] = J(() => {
|
|
1389
1389
|
}, ["stop"]))
|
|
1390
1390
|
}, [
|
|
1391
|
-
t.showArrow ? (
|
|
1391
|
+
t.showArrow ? (a(), u("div", {
|
|
1392
1392
|
key: 0,
|
|
1393
|
-
class:
|
|
1394
|
-
style:
|
|
1393
|
+
class: B(["ypopover__arrow", `ypopover__arrow--${t.placement}`]),
|
|
1394
|
+
style: ge(U.value)
|
|
1395
1395
|
}, null, 6)) : A("", !0),
|
|
1396
1396
|
n("div", pn, [
|
|
1397
|
-
ue(
|
|
1397
|
+
ue(Y.$slots, "default", {}, void 0, !0)
|
|
1398
1398
|
])
|
|
1399
1399
|
], 6)) : A("", !0)
|
|
1400
1400
|
]),
|
|
@@ -1406,13 +1406,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1406
1406
|
}), gn = /* @__PURE__ */ we(yn, [["__scopeId", "data-v-905c83cd"]]), mn = { class: "relative" }, wn = ["value", "placeholder"], bn = { class: "nh-time-suffix" }, kn = { class: "nh-time-shortcuts" }, xn = { class: "nh-time-shortcuts-list" }, Cn = ["onClick", "onKeydown", "onMouseenter"], Dn = { class: "nh-time-custom" }, $n = { class: "nh-time-custom-header" }, _n = { class: "nh-time-selection-status" }, Sn = {
|
|
1407
1407
|
key: 0,
|
|
1408
1408
|
class: "status-text"
|
|
1409
|
-
},
|
|
1409
|
+
}, Ln = {
|
|
1410
1410
|
key: 1,
|
|
1411
1411
|
class: "status-text"
|
|
1412
|
-
},
|
|
1412
|
+
}, Mn = {
|
|
1413
1413
|
key: 2,
|
|
1414
1414
|
class: "status-text status-complete"
|
|
1415
|
-
}, In = { class: "nh-time-pickers" }, Bn = { class: "nh-time-picker" }, En = { class: "nh-date-picker" }, Tn = { class: "nh-date-picker-header" }, zn = { class: "nh-date-picker-header-label" },
|
|
1415
|
+
}, In = { class: "nh-time-pickers" }, Bn = { class: "nh-time-picker" }, En = { class: "nh-date-picker" }, Tn = { class: "nh-date-picker-header" }, zn = { class: "nh-date-picker-header-label" }, Kn = { class: "nh-date-picker-content" }, Hn = { class: "nh-date-table" }, Rn = ["onClick"], Vn = { class: "nh-date-table-cell" }, An = { key: 0 }, Nn = { class: "nh-time-picker" }, Yn = { class: "nh-date-picker" }, Fn = { class: "nh-date-picker-header" }, Pn = { class: "nh-date-picker-header-label" }, Wn = { class: "nh-date-picker-content" }, jn = { class: "nh-date-table" }, On = ["onClick"], qn = { class: "nh-date-table-cell" }, Un = { key: 0 }, Zn = { class: "nh-time-actions" }, Qn = /* @__PURE__ */ me({
|
|
1416
1416
|
__name: "ytime",
|
|
1417
1417
|
props: {
|
|
1418
1418
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1463,118 +1463,118 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1463
1463
|
},
|
|
1464
1464
|
emits: ["update:modelValue", "change"],
|
|
1465
1465
|
setup(t, { emit: b }) {
|
|
1466
|
-
const e = t, l = b,
|
|
1466
|
+
const e = t, l = b, p = R(!1), i = R(-1), C = R(-1), E = R(null), _ = R(), M = R(), v = R({
|
|
1467
1467
|
top: !0,
|
|
1468
1468
|
left: !0
|
|
1469
|
-
}), w =
|
|
1469
|
+
}), w = R({
|
|
1470
1470
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1471
1471
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1472
|
-
}),
|
|
1472
|
+
}), y = R({
|
|
1473
1473
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1474
1474
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1475
|
-
}),
|
|
1476
|
-
const
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1475
|
+
}), z = () => {
|
|
1476
|
+
const s = new Date(w.value.year, w.value.month).getTime(), c = new Date(y.value.year, y.value.month).getTime();
|
|
1477
|
+
if (s >= c) {
|
|
1478
|
+
const $ = new Date(w.value.year, w.value.month + 1);
|
|
1479
|
+
y.value.year = $.getFullYear(), y.value.month = $.getMonth();
|
|
1480
1480
|
}
|
|
1481
|
-
},
|
|
1482
|
-
const
|
|
1483
|
-
if (new Date(
|
|
1484
|
-
const
|
|
1485
|
-
w.value.year =
|
|
1481
|
+
}, V = () => {
|
|
1482
|
+
const s = new Date(w.value.year, w.value.month).getTime();
|
|
1483
|
+
if (new Date(y.value.year, y.value.month).getTime() <= s) {
|
|
1484
|
+
const $ = new Date(y.value.year, y.value.month - 1);
|
|
1485
|
+
w.value.year = $.getFullYear(), w.value.month = $.getMonth();
|
|
1486
1486
|
}
|
|
1487
|
-
},
|
|
1488
|
-
if (!
|
|
1489
|
-
if (
|
|
1490
|
-
if (typeof
|
|
1491
|
-
return new Date(
|
|
1492
|
-
if (typeof
|
|
1493
|
-
const c = new Date(
|
|
1487
|
+
}, U = ["一", "二", "三", "四", "五", "六", "日"], j = R(null), D = R(null), T = (s) => {
|
|
1488
|
+
if (!s) return null;
|
|
1489
|
+
if (s instanceof Date) return s;
|
|
1490
|
+
if (typeof s == "number")
|
|
1491
|
+
return new Date(s);
|
|
1492
|
+
if (typeof s == "string") {
|
|
1493
|
+
const c = new Date(s);
|
|
1494
1494
|
return isNaN(c.getTime()) ? null : c;
|
|
1495
1495
|
}
|
|
1496
1496
|
return null;
|
|
1497
|
-
},
|
|
1498
|
-
if (!
|
|
1499
|
-
const c =
|
|
1497
|
+
}, L = (s) => {
|
|
1498
|
+
if (!s) return null;
|
|
1499
|
+
const c = s.getFullYear(), $ = String(s.getMonth() + 1).padStart(2, "0"), F = String(s.getDate()).padStart(2, "0");
|
|
1500
1500
|
if (e.includeTime) {
|
|
1501
|
-
const oe = String(
|
|
1502
|
-
return `${c}-${
|
|
1501
|
+
const oe = String(s.getHours()).padStart(2, "0"), te = String(s.getMinutes()).padStart(2, "0"), ie = String(s.getSeconds()).padStart(2, "0");
|
|
1502
|
+
return `${c}-${$}-${F} ${oe}:${te}:${ie}`;
|
|
1503
1503
|
} else
|
|
1504
|
-
return `${c}-${
|
|
1505
|
-
},
|
|
1506
|
-
startDate:
|
|
1507
|
-
endDate:
|
|
1508
|
-
} : { startDate: null, endDate: null },
|
|
1509
|
-
startDate:
|
|
1510
|
-
endDate:
|
|
1504
|
+
return `${c}-${$}-${F}`;
|
|
1505
|
+
}, I = (s) => s ? s.getTime() : null, P = (s) => s ? {
|
|
1506
|
+
startDate: T(s.startDate),
|
|
1507
|
+
endDate: T(s.endDate)
|
|
1508
|
+
} : { startDate: null, endDate: null }, X = (s) => e.format === "string" ? {
|
|
1509
|
+
startDate: L(s.startDate),
|
|
1510
|
+
endDate: L(s.endDate)
|
|
1511
1511
|
} : e.format === "timestamp" ? {
|
|
1512
|
-
startDate:
|
|
1513
|
-
endDate:
|
|
1514
|
-
} :
|
|
1515
|
-
const c =
|
|
1512
|
+
startDate: I(s.startDate),
|
|
1513
|
+
endDate: I(s.endDate)
|
|
1514
|
+
} : s, ee = (s, c) => `${String(c + 1).padStart(2, "0")}/${s}`, se = (s, c) => s.getFullYear() === c.getFullYear() && s.getMonth() === c.getMonth() && s.getDate() === c.getDate(), le = (s, c, $) => !c || !$ ? !1 : s >= c && s <= $, ce = (s) => {
|
|
1515
|
+
const c = P(s);
|
|
1516
1516
|
if (!(c != null && c.startDate) || !(c != null && c.endDate))
|
|
1517
1517
|
return -1;
|
|
1518
|
-
for (let
|
|
1519
|
-
const
|
|
1520
|
-
if (
|
|
1518
|
+
for (let $ = 0; $ < e.shortcuts.length; $++) {
|
|
1519
|
+
const F = e.shortcuts[$].getValue();
|
|
1520
|
+
if (F.startDate && F.endDate && c.startDate && c.endDate) {
|
|
1521
1521
|
const oe = new Date(
|
|
1522
1522
|
c.startDate.getFullYear(),
|
|
1523
1523
|
c.startDate.getMonth(),
|
|
1524
1524
|
c.startDate.getDate()
|
|
1525
|
-
),
|
|
1525
|
+
), te = new Date(
|
|
1526
1526
|
c.endDate.getFullYear(),
|
|
1527
1527
|
c.endDate.getMonth(),
|
|
1528
1528
|
c.endDate.getDate()
|
|
1529
1529
|
), ie = new Date(
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1530
|
+
F.startDate.getFullYear(),
|
|
1531
|
+
F.startDate.getMonth(),
|
|
1532
|
+
F.startDate.getDate()
|
|
1533
1533
|
), xe = new Date(
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1534
|
+
F.endDate.getFullYear(),
|
|
1535
|
+
F.endDate.getMonth(),
|
|
1536
|
+
F.endDate.getDate()
|
|
1537
1537
|
);
|
|
1538
|
-
if (oe.getTime() === ie.getTime() &&
|
|
1539
|
-
return
|
|
1538
|
+
if (oe.getTime() === ie.getTime() && te.getTime() === xe.getTime())
|
|
1539
|
+
return $;
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
1542
|
return -1;
|
|
1543
|
-
},
|
|
1544
|
-
const
|
|
1545
|
-
for (let
|
|
1546
|
-
const
|
|
1543
|
+
}, de = (s, c) => {
|
|
1544
|
+
const $ = new Date(s, c, 1), F = new Date(s, c + 1, 0), oe = $.getDay(), te = F.getDate(), ie = [], xe = /* @__PURE__ */ new Date(), Pe = oe === 0 ? 6 : oe - 1, Ge = new Date(s, c, 0);
|
|
1545
|
+
for (let ye = Pe - 1; ye >= 0; ye--) {
|
|
1546
|
+
const Le = new Date(s, c - 1, Ge.getDate() - ye);
|
|
1547
1547
|
ie.push({
|
|
1548
|
-
date:
|
|
1549
|
-
day:
|
|
1548
|
+
date: Le,
|
|
1549
|
+
day: Le.getDate(),
|
|
1550
1550
|
isCurrentMonth: !1,
|
|
1551
|
-
isToday: se(
|
|
1551
|
+
isToday: se(Le, xe),
|
|
1552
1552
|
isSelected: !1,
|
|
1553
1553
|
isInRange: !1,
|
|
1554
1554
|
isDisabled: !0
|
|
1555
1555
|
// 禁用非当前月的日期
|
|
1556
1556
|
});
|
|
1557
1557
|
}
|
|
1558
|
-
for (let
|
|
1559
|
-
const
|
|
1558
|
+
for (let ye = 1; ye <= te; ye++) {
|
|
1559
|
+
const Le = new Date(s, c, ye);
|
|
1560
1560
|
ie.push({
|
|
1561
|
-
date:
|
|
1562
|
-
day:
|
|
1561
|
+
date: Le,
|
|
1562
|
+
day: ye,
|
|
1563
1563
|
isCurrentMonth: !0,
|
|
1564
|
-
isToday: se(
|
|
1564
|
+
isToday: se(Le, xe),
|
|
1565
1565
|
isSelected: !1,
|
|
1566
1566
|
isInRange: !1,
|
|
1567
1567
|
isDisabled: !1
|
|
1568
1568
|
});
|
|
1569
1569
|
}
|
|
1570
1570
|
const et = 42 - ie.length;
|
|
1571
|
-
for (let
|
|
1572
|
-
const
|
|
1571
|
+
for (let ye = 1; ye <= et; ye++) {
|
|
1572
|
+
const Le = new Date(s, c + 1, ye);
|
|
1573
1573
|
ie.push({
|
|
1574
|
-
date:
|
|
1575
|
-
day:
|
|
1574
|
+
date: Le,
|
|
1575
|
+
day: ye,
|
|
1576
1576
|
isCurrentMonth: !1,
|
|
1577
|
-
isToday: se(
|
|
1577
|
+
isToday: se(Le, xe),
|
|
1578
1578
|
isSelected: !1,
|
|
1579
1579
|
isInRange: !1,
|
|
1580
1580
|
isDisabled: !0
|
|
@@ -1582,180 +1582,180 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1582
1582
|
});
|
|
1583
1583
|
}
|
|
1584
1584
|
const Oe = [];
|
|
1585
|
-
for (let
|
|
1586
|
-
Oe.push(ie.slice(
|
|
1585
|
+
for (let ye = 0; ye < ie.length; ye += 7)
|
|
1586
|
+
Oe.push(ie.slice(ye, ye + 7));
|
|
1587
1587
|
return Oe;
|
|
1588
|
-
},
|
|
1589
|
-
const c =
|
|
1588
|
+
}, Y = (s) => {
|
|
1589
|
+
const c = X(s);
|
|
1590
1590
|
l("update:modelValue", c), l("change", c);
|
|
1591
|
-
},
|
|
1592
|
-
if (!
|
|
1593
|
-
const
|
|
1594
|
-
oe < ie &&
|
|
1595
|
-
const xe =
|
|
1596
|
-
xe < Pe ?
|
|
1597
|
-
},
|
|
1598
|
-
if (
|
|
1599
|
-
const
|
|
1600
|
-
if (
|
|
1601
|
-
|
|
1591
|
+
}, W = () => {
|
|
1592
|
+
if (!_.value || !M.value) return;
|
|
1593
|
+
const s = _.value.getBoundingClientRect(), c = M.value.getBoundingClientRect(), $ = window.innerWidth, oe = window.innerHeight - s.bottom, te = s.top, ie = c.height || 400;
|
|
1594
|
+
oe < ie && te > ie ? v.value.top = !1 : v.value.top = !0;
|
|
1595
|
+
const xe = $ - s.left, Pe = c.width || 640;
|
|
1596
|
+
xe < Pe ? v.value.left = !1 : v.value.left = !0;
|
|
1597
|
+
}, d = () => {
|
|
1598
|
+
if (p.value = !p.value, p.value) {
|
|
1599
|
+
const s = P(e.modelValue);
|
|
1600
|
+
if (j.value = (s == null ? void 0 : s.startDate) || null, D.value = (s == null ? void 0 : s.endDate) || null, C.value = ce(e.modelValue), i.value = -1, s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1601
|
+
y.value.year = s.endDate.getFullYear(), y.value.month = s.endDate.getMonth();
|
|
1602
1602
|
else {
|
|
1603
1603
|
const c = new Date(w.value.year, w.value.month + 1);
|
|
1604
|
-
|
|
1604
|
+
y.value.year = c.getFullYear(), y.value.month = c.getMonth();
|
|
1605
1605
|
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1606
|
+
z(), ve(() => {
|
|
1607
|
+
W();
|
|
1608
1608
|
});
|
|
1609
1609
|
}
|
|
1610
|
-
},
|
|
1611
|
-
const c =
|
|
1612
|
-
|
|
1613
|
-
},
|
|
1614
|
-
|
|
1615
|
-
|
|
1610
|
+
}, f = (s) => {
|
|
1611
|
+
const c = s.target, $ = _.value, F = M.value;
|
|
1612
|
+
$ && F && !$.contains(c) && !F.contains(c) && (p.value = !1, i.value = -1);
|
|
1613
|
+
}, g = (s) => {
|
|
1614
|
+
s.key === "Enter" || s.key === " " ? (s.preventDefault(), d()) : s.key === "ArrowDown" && (s.preventDefault(), p.value = !0, ve(() => {
|
|
1615
|
+
W(), N();
|
|
1616
1616
|
}));
|
|
1617
|
-
}, m = (
|
|
1617
|
+
}, m = (s) => {
|
|
1618
1618
|
var c;
|
|
1619
|
-
|
|
1620
|
-
},
|
|
1621
|
-
|
|
1622
|
-
},
|
|
1623
|
-
|
|
1624
|
-
},
|
|
1625
|
-
|
|
1626
|
-
},
|
|
1627
|
-
|
|
1628
|
-
},
|
|
1629
|
-
if (
|
|
1630
|
-
const
|
|
1631
|
-
|
|
1619
|
+
s.key === "Escape" && (p.value = !1, i.value = -1, (c = _.value) == null || c.focus());
|
|
1620
|
+
}, o = (s, c) => {
|
|
1621
|
+
s.key === "ArrowDown" ? (s.preventDefault(), i.value = Math.min(c + 1, e.shortcuts.length - 1), H(i.value)) : s.key === "ArrowUp" ? (s.preventDefault(), i.value = Math.max(c - 1, 0), H(i.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), Z(e.shortcuts[c]));
|
|
1622
|
+
}, r = (s) => {
|
|
1623
|
+
i.value = s;
|
|
1624
|
+
}, h = () => {
|
|
1625
|
+
i.value = -1;
|
|
1626
|
+
}, N = () => {
|
|
1627
|
+
i.value = 0, H(0);
|
|
1628
|
+
}, H = (s) => {
|
|
1629
|
+
if (M.value) {
|
|
1630
|
+
const $ = M.value.querySelectorAll(".nh-time-shortcut")[s];
|
|
1631
|
+
$ && $.focus();
|
|
1632
1632
|
}
|
|
1633
|
-
},
|
|
1634
|
-
const c =
|
|
1635
|
-
e.includeTime && c.startDate && c.endDate && (c.startDate.setHours(0, 0, 0, 0), c.endDate.setHours(23, 59, 59, 999)),
|
|
1636
|
-
},
|
|
1637
|
-
if (!
|
|
1638
|
-
let
|
|
1639
|
-
if (e.includeTime ? (
|
|
1640
|
-
|
|
1641
|
-
else if (
|
|
1642
|
-
if (
|
|
1643
|
-
e.includeTime &&
|
|
1633
|
+
}, Z = (s) => {
|
|
1634
|
+
const c = s.getValue();
|
|
1635
|
+
e.includeTime && c.startDate && c.endDate && (c.startDate.setHours(0, 0, 0, 0), c.endDate.setHours(23, 59, 59, 999)), Y(c), C.value = e.shortcuts.findIndex(($) => $.label === s.label), i.value = -1, p.value = !1;
|
|
1636
|
+
}, De = (s, c) => {
|
|
1637
|
+
if (!s || s.isDisabled) return;
|
|
1638
|
+
let $;
|
|
1639
|
+
if (e.includeTime ? ($ = new Date(s.date), c === "start" || !j.value ? $.setHours(0, 0, 0, 0) : $.setHours(23, 59, 59, 999)) : $ = new Date(s.date.getFullYear(), s.date.getMonth(), s.date.getDate()), !j.value && !D.value)
|
|
1640
|
+
j.value = $, D.value = null;
|
|
1641
|
+
else if (j.value && !D.value)
|
|
1642
|
+
if ($ >= j.value)
|
|
1643
|
+
e.includeTime && $.setHours(23, 59, 59, 999), D.value = $;
|
|
1644
1644
|
else {
|
|
1645
|
-
const
|
|
1646
|
-
e.includeTime &&
|
|
1645
|
+
const F = j.value;
|
|
1646
|
+
e.includeTime && F.setHours(23, 59, 59, 999), D.value = F, j.value = $;
|
|
1647
1647
|
}
|
|
1648
1648
|
else
|
|
1649
|
-
|
|
1650
|
-
if (
|
|
1651
|
-
const
|
|
1652
|
-
e.includeTime &&
|
|
1653
|
-
startDate:
|
|
1654
|
-
endDate:
|
|
1649
|
+
j.value = $, D.value = null;
|
|
1650
|
+
if (C.value = -1, j.value && D.value) {
|
|
1651
|
+
const F = new Date(D.value);
|
|
1652
|
+
e.includeTime && F.setHours(23, 59, 59, 999), E.value = {
|
|
1653
|
+
startDate: j.value,
|
|
1654
|
+
endDate: F
|
|
1655
1655
|
};
|
|
1656
1656
|
} else
|
|
1657
1657
|
E.value = null;
|
|
1658
|
-
},
|
|
1659
|
-
if (!
|
|
1660
|
-
const
|
|
1661
|
-
return
|
|
1658
|
+
}, $e = (s, c) => {
|
|
1659
|
+
if (!s) return ["nh-date-table-td"];
|
|
1660
|
+
const $ = ["nh-date-table-td"];
|
|
1661
|
+
return s.isCurrentMonth || $.push("is-prev-month"), s.isToday && $.push("is-today"), s.isDisabled && $.push("is-disabled"), j.value && se(s.date, j.value) && $.push("is-selected", "is-start"), D.value && se(s.date, D.value) && $.push("is-selected", "is-end"), j.value && D.value && le(s.date, j.value, D.value) && $.push("is-in-range"), $;
|
|
1662
1662
|
}, Ve = () => {
|
|
1663
|
-
E.value && (e.includeTime && E.value.endDate && E.value.endDate.setHours(23, 59, 59, 999),
|
|
1664
|
-
},
|
|
1665
|
-
|
|
1663
|
+
E.value && (e.includeTime && E.value.endDate && E.value.endDate.setHours(23, 59, 59, 999), Y(E.value), C.value = ce(E.value), p.value = !1);
|
|
1664
|
+
}, He = () => {
|
|
1665
|
+
Y({ startDate: null, endDate: null }), O(), i.value = -1, p.value = !1;
|
|
1666
1666
|
}, Te = () => {
|
|
1667
|
-
|
|
1668
|
-
|
|
1667
|
+
p.value && ve(() => {
|
|
1668
|
+
W();
|
|
1669
1669
|
});
|
|
1670
|
-
},
|
|
1671
|
-
const
|
|
1672
|
-
if (!
|
|
1670
|
+
}, _e = q(() => de(w.value.year, w.value.month)), ze = q(() => de(y.value.year, y.value.month)), k = q(() => {
|
|
1671
|
+
const s = P(e.modelValue);
|
|
1672
|
+
if (!s || !s.startDate || !s.endDate)
|
|
1673
1673
|
return "";
|
|
1674
1674
|
const c = (oe) => {
|
|
1675
|
-
const
|
|
1676
|
-
return `${
|
|
1677
|
-
},
|
|
1678
|
-
return !e.includeTime &&
|
|
1679
|
-
}),
|
|
1675
|
+
const te = String(oe.getFullYear()), ie = String(oe.getMonth() + 1).padStart(2, "0"), xe = String(oe.getDate()).padStart(2, "0");
|
|
1676
|
+
return `${te}/${ie}/${xe}`;
|
|
1677
|
+
}, $ = c(s.startDate), F = c(s.endDate);
|
|
1678
|
+
return !e.includeTime && $ === F ? $ : `${$} - ${F}`;
|
|
1679
|
+
}), S = q(() => [
|
|
1680
1680
|
"nh-time-dropdown",
|
|
1681
1681
|
{
|
|
1682
|
-
"nh-time-dropdown-top": !
|
|
1683
|
-
"nh-time-dropdown-right": !
|
|
1682
|
+
"nh-time-dropdown-top": !v.value.top,
|
|
1683
|
+
"nh-time-dropdown-right": !v.value.left
|
|
1684
1684
|
}
|
|
1685
|
-
]),
|
|
1686
|
-
const
|
|
1687
|
-
return !!(
|
|
1688
|
-
}),
|
|
1689
|
-
|
|
1685
|
+
]), K = q(() => {
|
|
1686
|
+
const s = P(e.modelValue);
|
|
1687
|
+
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1688
|
+
}), x = q(() => !!(j.value && D.value)), O = () => {
|
|
1689
|
+
j.value = null, D.value = null, E.value = null, C.value = -1;
|
|
1690
1690
|
};
|
|
1691
|
-
|
|
1692
|
-
const c =
|
|
1691
|
+
ne(() => e.modelValue, (s) => {
|
|
1692
|
+
const c = P(s);
|
|
1693
1693
|
if (c != null && c.startDate) {
|
|
1694
|
-
const
|
|
1695
|
-
w.value.year =
|
|
1694
|
+
const $ = c.startDate;
|
|
1695
|
+
w.value.year = $.getFullYear(), w.value.month = $.getMonth();
|
|
1696
1696
|
}
|
|
1697
1697
|
if (c != null && c.endDate) {
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1698
|
+
const $ = c.endDate;
|
|
1699
|
+
y.value.year = $.getFullYear(), y.value.month = $.getMonth();
|
|
1700
1700
|
} else if (c != null && c.startDate) {
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1701
|
+
const $ = new Date(w.value.year, w.value.month + 1);
|
|
1702
|
+
y.value.year = $.getFullYear(), y.value.month = $.getMonth();
|
|
1703
1703
|
}
|
|
1704
|
-
(c != null && c.startDate || c != null && c.endDate) &&
|
|
1705
|
-
}, { immediate: !0, deep: !0 }),
|
|
1706
|
-
const
|
|
1707
|
-
if (
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1704
|
+
(c != null && c.startDate || c != null && c.endDate) && z(), p.value || (C.value = ce(s));
|
|
1705
|
+
}, { immediate: !0, deep: !0 }), ne([w, y], () => {
|
|
1706
|
+
const s = new Date(w.value.year, w.value.month).getTime(), c = new Date(y.value.year, y.value.month).getTime();
|
|
1707
|
+
if (s === c) {
|
|
1708
|
+
const $ = new Date(w.value.year, w.value.month + 1);
|
|
1709
|
+
y.value.year = $.getFullYear(), y.value.month = $.getMonth();
|
|
1710
1710
|
}
|
|
1711
|
-
}, { deep: !0 }),
|
|
1712
|
-
document.addEventListener("click",
|
|
1713
|
-
const
|
|
1714
|
-
if (
|
|
1715
|
-
|
|
1711
|
+
}, { deep: !0 }), Se(() => {
|
|
1712
|
+
document.addEventListener("click", f), window.addEventListener("resize", Te), window.addEventListener("scroll", Te), C.value = ce(e.modelValue);
|
|
1713
|
+
const s = P(e.modelValue);
|
|
1714
|
+
if (s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1715
|
+
y.value.year = s.endDate.getFullYear(), y.value.month = s.endDate.getMonth();
|
|
1716
1716
|
else {
|
|
1717
1717
|
const c = new Date(w.value.year, w.value.month + 1);
|
|
1718
|
-
|
|
1718
|
+
y.value.year = c.getFullYear(), y.value.month = c.getMonth();
|
|
1719
1719
|
}
|
|
1720
|
-
|
|
1720
|
+
z();
|
|
1721
1721
|
}), Ee(() => {
|
|
1722
|
-
document.removeEventListener("click",
|
|
1722
|
+
document.removeEventListener("click", f), window.removeEventListener("resize", Te), window.removeEventListener("scroll", Te);
|
|
1723
1723
|
});
|
|
1724
|
-
const
|
|
1725
|
-
e.clearable && (
|
|
1726
|
-
}, ae = (
|
|
1727
|
-
if (
|
|
1728
|
-
const
|
|
1729
|
-
w.value.year =
|
|
1724
|
+
const Q = () => {
|
|
1725
|
+
e.clearable && (Y({ startDate: null, endDate: null }), O(), i.value = -1);
|
|
1726
|
+
}, ae = (s, c) => {
|
|
1727
|
+
if (s === "start") {
|
|
1728
|
+
const $ = new Date(w.value.year, w.value.month + c, 1);
|
|
1729
|
+
w.value.year = $.getFullYear(), w.value.month = $.getMonth(), z();
|
|
1730
1730
|
} else {
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1731
|
+
const $ = new Date(y.value.year, y.value.month + c, 1);
|
|
1732
|
+
y.value.year = $.getFullYear(), y.value.month = $.getMonth(), V();
|
|
1733
1733
|
}
|
|
1734
1734
|
};
|
|
1735
|
-
return (
|
|
1736
|
-
const
|
|
1737
|
-
return
|
|
1738
|
-
class:
|
|
1735
|
+
return (s, c) => {
|
|
1736
|
+
const $ = Ne("YButton");
|
|
1737
|
+
return a(), u("div", {
|
|
1738
|
+
class: B(["nh-time-search", [`nh-time--${t.size}`]])
|
|
1739
1739
|
}, [
|
|
1740
1740
|
n("div", mn, [
|
|
1741
1741
|
n("div", {
|
|
1742
1742
|
ref_key: "trigger",
|
|
1743
|
-
ref:
|
|
1744
|
-
onClick:
|
|
1745
|
-
onKeydown:
|
|
1746
|
-
class:
|
|
1743
|
+
ref: _,
|
|
1744
|
+
onClick: d,
|
|
1745
|
+
onKeydown: g,
|
|
1746
|
+
class: B(["nh-time-trigger", { "is-focus": p.value, "has-value": K.value }]),
|
|
1747
1747
|
tabindex: "0"
|
|
1748
1748
|
}, [
|
|
1749
1749
|
n("input", {
|
|
1750
1750
|
readonly: "",
|
|
1751
|
-
value:
|
|
1751
|
+
value: k.value,
|
|
1752
1752
|
placeholder: t.placeholder,
|
|
1753
1753
|
class: "nh-time-input"
|
|
1754
1754
|
}, null, 8, wn),
|
|
1755
1755
|
n("span", bn, [
|
|
1756
|
-
t.clearable &&
|
|
1756
|
+
t.clearable && K.value ? (a(), u("i", {
|
|
1757
1757
|
key: 0,
|
|
1758
|
-
onClick:
|
|
1758
|
+
onClick: J(Q, ["stop"]),
|
|
1759
1759
|
class: "nh-time-clear"
|
|
1760
1760
|
}, [...c[4] || (c[4] = [
|
|
1761
1761
|
n("svg", {
|
|
@@ -1782,7 +1782,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1782
1782
|
])
|
|
1783
1783
|
], -1)),
|
|
1784
1784
|
n("i", {
|
|
1785
|
-
class:
|
|
1785
|
+
class: B(["nh-time-arrow", { "is-reverse": p.value }])
|
|
1786
1786
|
}, [...c[5] || (c[5] = [
|
|
1787
1787
|
n("svg", {
|
|
1788
1788
|
viewBox: "0 0 1024 1024",
|
|
@@ -1797,40 +1797,40 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1797
1797
|
])], 2)
|
|
1798
1798
|
])
|
|
1799
1799
|
], 34),
|
|
1800
|
-
|
|
1801
|
-
default:
|
|
1802
|
-
|
|
1800
|
+
fe(ke, { name: "el-zoom-in-top" }, {
|
|
1801
|
+
default: pe(() => [
|
|
1802
|
+
p.value ? (a(), u("div", {
|
|
1803
1803
|
key: 0,
|
|
1804
1804
|
ref_key: "dropdown",
|
|
1805
|
-
ref:
|
|
1806
|
-
class:
|
|
1805
|
+
ref: M,
|
|
1806
|
+
class: B(S.value),
|
|
1807
1807
|
onKeydown: m
|
|
1808
1808
|
}, [
|
|
1809
1809
|
n("div", kn, [
|
|
1810
1810
|
c[7] || (c[7] = n("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1811
1811
|
n("ul", xn, [
|
|
1812
|
-
(
|
|
1813
|
-
key:
|
|
1814
|
-
onClick: (
|
|
1815
|
-
onKeydown: (
|
|
1816
|
-
onMouseenter: (
|
|
1817
|
-
onMouseleave:
|
|
1818
|
-
class:
|
|
1812
|
+
(a(!0), u(re, null, he(t.shortcuts, (F, oe) => (a(), u("li", {
|
|
1813
|
+
key: F.label,
|
|
1814
|
+
onClick: (te) => Z(F),
|
|
1815
|
+
onKeydown: (te) => o(te, oe),
|
|
1816
|
+
onMouseenter: (te) => r(oe),
|
|
1817
|
+
onMouseleave: h,
|
|
1818
|
+
class: B([
|
|
1819
1819
|
"nh-time-shortcut",
|
|
1820
1820
|
{
|
|
1821
|
-
"is-active":
|
|
1822
|
-
"is-selected":
|
|
1821
|
+
"is-active": i.value === oe,
|
|
1822
|
+
"is-selected": C.value === oe
|
|
1823
1823
|
}
|
|
1824
1824
|
]),
|
|
1825
1825
|
tabindex: "0"
|
|
1826
|
-
},
|
|
1826
|
+
}, G(F.label), 43, Cn))), 128))
|
|
1827
1827
|
])
|
|
1828
1828
|
]),
|
|
1829
1829
|
n("div", Dn, [
|
|
1830
1830
|
n("div", $n, [
|
|
1831
1831
|
c[8] || (c[8] = n("span", null, "自定义时间", -1)),
|
|
1832
1832
|
n("div", _n, [
|
|
1833
|
-
!
|
|
1833
|
+
!j.value && !D.value ? (a(), u("span", Sn, " 请选择开始日期 ")) : j.value && !D.value ? (a(), u("span", Ln, " 请选择结束日期 ")) : j.value && D.value ? (a(), u("span", Mn, " 已选择完整范围 ")) : A("", !0)
|
|
1834
1834
|
])
|
|
1835
1835
|
]),
|
|
1836
1836
|
n("div", In, [
|
|
@@ -1838,7 +1838,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1838
1838
|
n("div", En, [
|
|
1839
1839
|
n("div", Tn, [
|
|
1840
1840
|
n("button", {
|
|
1841
|
-
onClick: c[0] || (c[0] = (
|
|
1841
|
+
onClick: c[0] || (c[0] = (F) => ae("start", -1)),
|
|
1842
1842
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
1843
1843
|
type: "button"
|
|
1844
1844
|
}, [...c[9] || (c[9] = [
|
|
@@ -1853,9 +1853,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1853
1853
|
})
|
|
1854
1854
|
], -1)
|
|
1855
1855
|
])]),
|
|
1856
|
-
n("span", zn,
|
|
1856
|
+
n("span", zn, G(ee(w.value.year, w.value.month)), 1),
|
|
1857
1857
|
n("button", {
|
|
1858
|
-
onClick: c[1] || (c[1] = (
|
|
1858
|
+
onClick: c[1] || (c[1] = (F) => ae("start", 1)),
|
|
1859
1859
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
1860
1860
|
type: "button"
|
|
1861
1861
|
}, [...c[10] || (c[10] = [
|
|
@@ -1871,27 +1871,27 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1871
1871
|
], -1)
|
|
1872
1872
|
])])
|
|
1873
1873
|
]),
|
|
1874
|
-
n("div",
|
|
1875
|
-
n("table",
|
|
1874
|
+
n("div", Kn, [
|
|
1875
|
+
n("table", Hn, [
|
|
1876
1876
|
n("thead", null, [
|
|
1877
1877
|
n("tr", null, [
|
|
1878
|
-
(
|
|
1879
|
-
key:
|
|
1878
|
+
(a(), u(re, null, he(U, (F) => n("th", {
|
|
1879
|
+
key: F,
|
|
1880
1880
|
class: "nh-date-table-th"
|
|
1881
|
-
},
|
|
1881
|
+
}, G(F), 1)), 64))
|
|
1882
1882
|
])
|
|
1883
1883
|
]),
|
|
1884
1884
|
n("tbody", null, [
|
|
1885
|
-
(
|
|
1885
|
+
(a(!0), u(re, null, he(_e.value, (F, oe) => (a(), u("tr", {
|
|
1886
1886
|
key: `start-week-${oe}`
|
|
1887
1887
|
}, [
|
|
1888
|
-
(
|
|
1888
|
+
(a(!0), u(re, null, he(F, (te, ie) => (a(), u("td", {
|
|
1889
1889
|
key: `start-day-${oe}-${ie}`,
|
|
1890
|
-
class:
|
|
1891
|
-
onClick: (xe) =>
|
|
1890
|
+
class: B($e(te)),
|
|
1891
|
+
onClick: (xe) => De(te, "start")
|
|
1892
1892
|
}, [
|
|
1893
1893
|
n("div", Vn, [
|
|
1894
|
-
|
|
1894
|
+
te ? (a(), u("span", An, G(te.day), 1)) : A("", !0)
|
|
1895
1895
|
])
|
|
1896
1896
|
], 10, Rn))), 128))
|
|
1897
1897
|
]))), 128))
|
|
@@ -1900,11 +1900,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1900
1900
|
])
|
|
1901
1901
|
])
|
|
1902
1902
|
]),
|
|
1903
|
-
n("div",
|
|
1904
|
-
n("div",
|
|
1905
|
-
n("div",
|
|
1903
|
+
n("div", Nn, [
|
|
1904
|
+
n("div", Yn, [
|
|
1905
|
+
n("div", Fn, [
|
|
1906
1906
|
n("button", {
|
|
1907
|
-
onClick: c[2] || (c[2] = (
|
|
1907
|
+
onClick: c[2] || (c[2] = (F) => ae("end", -1)),
|
|
1908
1908
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
1909
1909
|
type: "button"
|
|
1910
1910
|
}, [...c[11] || (c[11] = [
|
|
@@ -1919,9 +1919,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1919
1919
|
})
|
|
1920
1920
|
], -1)
|
|
1921
1921
|
])]),
|
|
1922
|
-
n("span", Pn,
|
|
1922
|
+
n("span", Pn, G(ee(y.value.year, y.value.month)), 1),
|
|
1923
1923
|
n("button", {
|
|
1924
|
-
onClick: c[3] || (c[3] = (
|
|
1924
|
+
onClick: c[3] || (c[3] = (F) => ae("end", 1)),
|
|
1925
1925
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
1926
1926
|
type: "button"
|
|
1927
1927
|
}, [...c[12] || (c[12] = [
|
|
@@ -1941,23 +1941,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1941
1941
|
n("table", jn, [
|
|
1942
1942
|
n("thead", null, [
|
|
1943
1943
|
n("tr", null, [
|
|
1944
|
-
(
|
|
1945
|
-
key:
|
|
1944
|
+
(a(), u(re, null, he(U, (F) => n("th", {
|
|
1945
|
+
key: F,
|
|
1946
1946
|
class: "nh-date-table-th"
|
|
1947
|
-
},
|
|
1947
|
+
}, G(F), 1)), 64))
|
|
1948
1948
|
])
|
|
1949
1949
|
]),
|
|
1950
1950
|
n("tbody", null, [
|
|
1951
|
-
(
|
|
1951
|
+
(a(!0), u(re, null, he(ze.value, (F, oe) => (a(), u("tr", {
|
|
1952
1952
|
key: `end-week-${oe}`
|
|
1953
1953
|
}, [
|
|
1954
|
-
(
|
|
1954
|
+
(a(!0), u(re, null, he(F, (te, ie) => (a(), u("td", {
|
|
1955
1955
|
key: `end-day-${oe}-${ie}`,
|
|
1956
|
-
class:
|
|
1957
|
-
onClick: (xe) =>
|
|
1956
|
+
class: B($e(te)),
|
|
1957
|
+
onClick: (xe) => De(te, "end")
|
|
1958
1958
|
}, [
|
|
1959
1959
|
n("div", qn, [
|
|
1960
|
-
|
|
1960
|
+
te ? (a(), u("span", Un, G(te.day), 1)) : A("", !0)
|
|
1961
1961
|
])
|
|
1962
1962
|
], 10, On))), 128))
|
|
1963
1963
|
]))), 128))
|
|
@@ -1968,25 +1968,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1968
1968
|
])
|
|
1969
1969
|
]),
|
|
1970
1970
|
n("div", Zn, [
|
|
1971
|
-
t.clearable ? (
|
|
1971
|
+
t.clearable ? (a(), Ie($, {
|
|
1972
1972
|
key: 0,
|
|
1973
|
-
onClick:
|
|
1973
|
+
onClick: He,
|
|
1974
1974
|
variant: "secondary",
|
|
1975
1975
|
size: t.size
|
|
1976
1976
|
}, {
|
|
1977
|
-
default:
|
|
1977
|
+
default: pe(() => [...c[13] || (c[13] = [
|
|
1978
1978
|
Ce(" 清空 ", -1)
|
|
1979
1979
|
])]),
|
|
1980
1980
|
_: 1
|
|
1981
1981
|
}, 8, ["size"])) : A("", !0),
|
|
1982
|
-
|
|
1982
|
+
fe($, {
|
|
1983
1983
|
onClick: Ve,
|
|
1984
|
-
disabled: !
|
|
1984
|
+
disabled: !x.value,
|
|
1985
1985
|
variant: "primary",
|
|
1986
1986
|
size: t.size
|
|
1987
1987
|
}, {
|
|
1988
|
-
default:
|
|
1989
|
-
Ce(
|
|
1988
|
+
default: pe(() => [
|
|
1989
|
+
Ce(G(j.value && !D.value ? "继续选择结束日期" : "确认"), 1)
|
|
1990
1990
|
]),
|
|
1991
1991
|
_: 1
|
|
1992
1992
|
}, 8, ["disabled", "size"])
|
|
@@ -2021,44 +2021,44 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2021
2021
|
},
|
|
2022
2022
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2023
2023
|
setup(t, { emit: b }) {
|
|
2024
|
-
const e = t, l = b,
|
|
2025
|
-
const
|
|
2026
|
-
return
|
|
2024
|
+
const e = t, l = b, p = R(), i = q(() => e.modelValue === e.trueValue), C = q(() => {
|
|
2025
|
+
const _ = {};
|
|
2026
|
+
return _.background = i.value ? e.activeColor : e.inactiveColor, _;
|
|
2027
2027
|
});
|
|
2028
2028
|
function E() {
|
|
2029
2029
|
if (e.disabled || e.loading) return;
|
|
2030
|
-
const
|
|
2031
|
-
l("update:modelValue",
|
|
2030
|
+
const _ = i.value ? e.falseValue : e.trueValue;
|
|
2031
|
+
l("update:modelValue", _), l("change", _);
|
|
2032
2032
|
}
|
|
2033
|
-
return
|
|
2034
|
-
const
|
|
2035
|
-
|
|
2036
|
-
}), (
|
|
2033
|
+
return Se(() => {
|
|
2034
|
+
const _ = p.value;
|
|
2035
|
+
_ && (_.addEventListener("focus", (M) => l("focus", M)), _.addEventListener("blur", (M) => l("blur", M)));
|
|
2036
|
+
}), (_, M) => (a(), u("button", {
|
|
2037
2037
|
ref_key: "rootEl",
|
|
2038
|
-
ref:
|
|
2039
|
-
class:
|
|
2038
|
+
ref: p,
|
|
2039
|
+
class: B(["yswitch", [
|
|
2040
2040
|
`yswitch--${t.size}`,
|
|
2041
|
-
{ "yswitch--checked":
|
|
2041
|
+
{ "yswitch--checked": i.value, "yswitch--disabled": t.disabled, "yswitch--loading": t.loading }
|
|
2042
2042
|
]]),
|
|
2043
|
-
style:
|
|
2043
|
+
style: ge(C.value),
|
|
2044
2044
|
role: "switch",
|
|
2045
|
-
"aria-checked":
|
|
2045
|
+
"aria-checked": i.value,
|
|
2046
2046
|
"aria-disabled": t.disabled,
|
|
2047
2047
|
disabled: t.disabled || t.loading,
|
|
2048
2048
|
onClick: E,
|
|
2049
2049
|
onKeydown: [
|
|
2050
|
-
be(
|
|
2051
|
-
be(
|
|
2050
|
+
be(J(E, ["prevent"]), ["enter"]),
|
|
2051
|
+
be(J(E, ["prevent"]), ["space"])
|
|
2052
2052
|
]
|
|
2053
2053
|
}, [
|
|
2054
|
-
|
|
2054
|
+
M[0] || (M[0] = n("span", { class: "yswitch__track" }, null, -1)),
|
|
2055
2055
|
n("span", Xn, [
|
|
2056
|
-
t.loading ? (
|
|
2056
|
+
t.loading ? (a(), u("span", Gn)) : A("", !0)
|
|
2057
2057
|
]),
|
|
2058
|
-
t.showText ? (
|
|
2058
|
+
t.showText ? (a(), u("span", {
|
|
2059
2059
|
key: 0,
|
|
2060
|
-
class:
|
|
2061
|
-
},
|
|
2060
|
+
class: B(["yswitch__label", { "yswitch__label--left": !i.value, "yswitch__label--right": i.value }])
|
|
2061
|
+
}, G(i.value ? t.activeText : t.inactiveText), 3)) : A("", !0)
|
|
2062
2062
|
], 46, Jn));
|
|
2063
2063
|
}
|
|
2064
2064
|
}), tl = /* @__PURE__ */ we(el, [["__scopeId", "data-v-0b157fc4"]]), nl = ["src", "alt"], ll = ["src", "alt"], ol = /* @__PURE__ */ me({
|
|
@@ -2077,109 +2077,109 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2077
2077
|
},
|
|
2078
2078
|
emits: ["load", "error", "preview"],
|
|
2079
2079
|
setup(t, { expose: b, emit: e }) {
|
|
2080
|
-
const l = t,
|
|
2080
|
+
const l = t, p = e, i = R(), C = R(), E = R(), _ = R(!1), M = R(!1), v = R(!1), w = R(!1), y = R(!1), z = R("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), V = R(""), U = R(1), j = R(!1), D = R({
|
|
2081
2081
|
overflow: "",
|
|
2082
2082
|
paddingRight: ""
|
|
2083
|
-
}),
|
|
2083
|
+
}), T = q(() => [
|
|
2084
2084
|
l.className,
|
|
2085
2085
|
"overflow-hidden"
|
|
2086
|
-
].filter(Boolean).join(" ")),
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
].filter(Boolean).join(" ")),
|
|
2086
|
+
].filter(Boolean).join(" ")), L = q(() => [
|
|
2087
|
+
ee(),
|
|
2088
|
+
le()
|
|
2089
|
+
].filter(Boolean).join(" ")), I = q(() => [
|
|
2090
2090
|
"w-full h-full bg-white",
|
|
2091
2091
|
se(),
|
|
2092
|
-
|
|
2092
|
+
le(),
|
|
2093
2093
|
l.preview ? "cursor-pointer hover:opacity-90 transition-opacity duration-200" : ""
|
|
2094
|
-
].filter(Boolean).join(" ")),
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
].filter(Boolean).join(" ")),
|
|
2098
|
-
const
|
|
2099
|
-
return l.width && (
|
|
2100
|
-
}),
|
|
2094
|
+
].filter(Boolean).join(" ")), P = q(() => [
|
|
2095
|
+
ee(),
|
|
2096
|
+
le()
|
|
2097
|
+
].filter(Boolean).join(" ")), X = q(() => {
|
|
2098
|
+
const H = {};
|
|
2099
|
+
return l.width && (H.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.height && (H.height = typeof l.height == "number" ? `${l.height}px` : l.height), H;
|
|
2100
|
+
}), ee = () => l.width && l.height ? "" : "w-full h-full", se = () => ({
|
|
2101
2101
|
cover: "object-cover",
|
|
2102
2102
|
contain: "object-contain",
|
|
2103
2103
|
fill: "object-fill",
|
|
2104
2104
|
none: "object-none",
|
|
2105
2105
|
"scale-down": "object-scale-down"
|
|
2106
|
-
})[l.fit] || "object-cover",
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2109
|
-
const
|
|
2110
|
-
return document.body.removeChild(
|
|
2111
|
-
},
|
|
2112
|
-
if (
|
|
2106
|
+
})[l.fit] || "object-cover", le = () => typeof l.radius == "number" ? `rounded-${l.radius}` : typeof l.radius == "string" ? l.radius.includes("px") ? "" : `rounded-${l.radius}` : "", ce = () => {
|
|
2107
|
+
const H = document.createElement("div");
|
|
2108
|
+
H.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(H);
|
|
2109
|
+
const Z = H.offsetWidth - H.clientWidth;
|
|
2110
|
+
return document.body.removeChild(H), Z;
|
|
2111
|
+
}, de = () => {
|
|
2112
|
+
if (D.value = {
|
|
2113
2113
|
overflow: document.body.style.overflow || "",
|
|
2114
2114
|
paddingRight: document.body.style.paddingRight || ""
|
|
2115
2115
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2116
|
-
const
|
|
2117
|
-
document.body.style.paddingRight = `${
|
|
2116
|
+
const Z = ce();
|
|
2117
|
+
document.body.style.paddingRight = `${Z}px`;
|
|
2118
2118
|
}
|
|
2119
2119
|
document.body.style.overflow = "hidden";
|
|
2120
|
-
},
|
|
2121
|
-
document.body.style.overflow =
|
|
2120
|
+
}, Y = () => {
|
|
2121
|
+
document.body.style.overflow = D.value.overflow, document.body.style.paddingRight = D.value.paddingRight;
|
|
2122
2122
|
};
|
|
2123
|
-
let
|
|
2124
|
-
const
|
|
2125
|
-
!l.lazy || !
|
|
2126
|
-
(
|
|
2127
|
-
|
|
2128
|
-
|
|
2123
|
+
let W = null;
|
|
2124
|
+
const d = () => {
|
|
2125
|
+
!l.lazy || !i.value || (W = new IntersectionObserver(
|
|
2126
|
+
(H) => {
|
|
2127
|
+
H.forEach((Z) => {
|
|
2128
|
+
Z.isIntersecting && (w.value = !0, z.value = l.src, W == null || W.unobserve(Z.target));
|
|
2129
2129
|
});
|
|
2130
2130
|
},
|
|
2131
2131
|
{
|
|
2132
2132
|
rootMargin: "50px"
|
|
2133
2133
|
}
|
|
2134
|
-
),
|
|
2135
|
-
},
|
|
2136
|
-
|
|
2137
|
-
},
|
|
2138
|
-
|
|
2134
|
+
), W.observe(i.value));
|
|
2135
|
+
}, f = (H) => {
|
|
2136
|
+
_.value = !0, M.value = !1, v.value = !1, p("load", H);
|
|
2137
|
+
}, g = (H) => {
|
|
2138
|
+
v.value = !0, M.value = !1, _.value = !1, p("error", H);
|
|
2139
2139
|
}, m = () => {
|
|
2140
|
-
|
|
2141
|
-
|
|
2140
|
+
v.value = !1, M.value = !0, _.value = !1, ve(() => {
|
|
2141
|
+
C.value && (C.value.src = l.src);
|
|
2142
2142
|
});
|
|
2143
|
-
},
|
|
2144
|
-
if (!l.preview ||
|
|
2145
|
-
|
|
2146
|
-
const
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2143
|
+
}, o = () => {
|
|
2144
|
+
if (!l.preview || v.value) return;
|
|
2145
|
+
U.value = 1;
|
|
2146
|
+
const H = new Image();
|
|
2147
|
+
H.onload = () => {
|
|
2148
|
+
V.value = l.src, ve(() => {
|
|
2149
|
+
y.value = !0, de(), p("preview", l.src);
|
|
2150
2150
|
});
|
|
2151
|
-
},
|
|
2152
|
-
|
|
2153
|
-
},
|
|
2154
|
-
},
|
|
2155
|
-
|
|
2156
|
-
|
|
2151
|
+
}, H.onerror = () => {
|
|
2152
|
+
V.value = l.src, y.value = !0, de(), p("preview", l.src);
|
|
2153
|
+
}, H.src = l.src;
|
|
2154
|
+
}, r = () => {
|
|
2155
|
+
y.value = !1, setTimeout(() => {
|
|
2156
|
+
Y();
|
|
2157
2157
|
}, 300);
|
|
2158
|
-
},
|
|
2159
|
-
const
|
|
2160
|
-
let
|
|
2161
|
-
|
|
2158
|
+
}, h = (H) => {
|
|
2159
|
+
const Z = H.deltaY < 0 ? 1 : -1;
|
|
2160
|
+
let $e = U.value + Z * 0.1;
|
|
2161
|
+
$e = Math.max(0.5, Math.min(2, $e)), U.value = $e;
|
|
2162
2162
|
};
|
|
2163
|
-
return
|
|
2164
|
-
l.lazy ?
|
|
2163
|
+
return Se(() => {
|
|
2164
|
+
l.lazy ? d() : w.value = !0, w.value && (M.value = !0), j.value = !0;
|
|
2165
2165
|
}), Ee(() => {
|
|
2166
|
-
|
|
2167
|
-
}),
|
|
2168
|
-
l.src && w.value && (
|
|
2169
|
-
}),
|
|
2170
|
-
|
|
2166
|
+
W && W.disconnect(), y.value && Y();
|
|
2167
|
+
}), ne(() => z.value, () => {
|
|
2168
|
+
l.src && w.value && (M.value = !0, v.value = !1, _.value = !1);
|
|
2169
|
+
}), ne(() => l.src, (H) => {
|
|
2170
|
+
z.value = H || "";
|
|
2171
2171
|
}), b({
|
|
2172
2172
|
retryLoad: m,
|
|
2173
|
-
closePreview:
|
|
2174
|
-
}), (
|
|
2173
|
+
closePreview: r
|
|
2174
|
+
}), (H, Z) => (a(), u("div", {
|
|
2175
2175
|
ref_key: "containerRef",
|
|
2176
|
-
ref:
|
|
2177
|
-
class:
|
|
2176
|
+
ref: i,
|
|
2177
|
+
class: B(["relative inline-block", T.value])
|
|
2178
2178
|
}, [
|
|
2179
|
-
!
|
|
2179
|
+
!_.value && !v.value && !w.value ? (a(), u("div", {
|
|
2180
2180
|
key: 0,
|
|
2181
|
-
class:
|
|
2182
|
-
}, [...
|
|
2181
|
+
class: B(["bg-gray-200 animate-pulse rounded", L.value])
|
|
2182
|
+
}, [...Z[1] || (Z[1] = [
|
|
2183
2183
|
n("div", { class: "flex items-center justify-center h-full" }, [
|
|
2184
2184
|
n("svg", {
|
|
2185
2185
|
class: "w-6 h-6 text-gray-400",
|
|
@@ -2196,62 +2196,62 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2196
2196
|
])
|
|
2197
2197
|
], -1)
|
|
2198
2198
|
])], 2)) : A("", !0),
|
|
2199
|
-
|
|
2199
|
+
M.value && !v.value ? (a(), u("div", {
|
|
2200
2200
|
key: 1,
|
|
2201
|
-
class:
|
|
2202
|
-
}, [...
|
|
2201
|
+
class: B(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded", I.value])
|
|
2202
|
+
}, [...Z[2] || (Z[2] = [
|
|
2203
2203
|
n("div", { class: "flex flex-col items-center space-y-2" }, [
|
|
2204
2204
|
n("div", { class: "w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin" })
|
|
2205
2205
|
], -1)
|
|
2206
2206
|
])], 2)) : A("", !0),
|
|
2207
|
-
|
|
2207
|
+
v.value ? (a(), u("div", {
|
|
2208
2208
|
key: 2,
|
|
2209
|
-
class:
|
|
2209
|
+
class: B(["bg-gray-100 rounded flex items-center justify-center", P.value]),
|
|
2210
2210
|
onClick: m
|
|
2211
2211
|
}, [
|
|
2212
2212
|
n("img", {
|
|
2213
2213
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2214
2214
|
alt: "Error Image",
|
|
2215
|
-
class:
|
|
2215
|
+
class: B(["w-[70%] h-[70%] object-contain cursor-pointer", le()])
|
|
2216
2216
|
}, null, 2)
|
|
2217
2217
|
], 2)) : A("", !0),
|
|
2218
2218
|
Be(n("img", {
|
|
2219
2219
|
ref_key: "imageRef",
|
|
2220
|
-
ref:
|
|
2221
|
-
src:
|
|
2220
|
+
ref: C,
|
|
2221
|
+
src: z.value,
|
|
2222
2222
|
alt: t.alt,
|
|
2223
|
-
class:
|
|
2224
|
-
onLoad:
|
|
2225
|
-
onError:
|
|
2226
|
-
onClick:
|
|
2227
|
-
style:
|
|
2223
|
+
class: B(I.value),
|
|
2224
|
+
onLoad: f,
|
|
2225
|
+
onError: g,
|
|
2226
|
+
onClick: o,
|
|
2227
|
+
style: ge(X.value)
|
|
2228
2228
|
}, null, 46, nl), [
|
|
2229
|
-
[
|
|
2229
|
+
[Ke, _.value && !v.value]
|
|
2230
2230
|
]),
|
|
2231
|
-
|
|
2231
|
+
j.value ? (a(), Ie(Re, {
|
|
2232
2232
|
key: 3,
|
|
2233
2233
|
to: "body"
|
|
2234
2234
|
}, [
|
|
2235
|
-
|
|
2236
|
-
default:
|
|
2237
|
-
|
|
2235
|
+
fe(ke, { name: "fade" }, {
|
|
2236
|
+
default: pe(() => [
|
|
2237
|
+
y.value ? (a(), u("div", {
|
|
2238
2238
|
key: 0,
|
|
2239
2239
|
class: "fixed inset-0 bg-black/75 flex items-center justify-center",
|
|
2240
2240
|
style: { "z-index": "99999" },
|
|
2241
|
-
onClick:
|
|
2242
|
-
onWheel:
|
|
2241
|
+
onClick: J(r, ["self"]),
|
|
2242
|
+
onWheel: J(h, ["prevent"])
|
|
2243
2243
|
}, [
|
|
2244
2244
|
n("div", {
|
|
2245
|
-
class:
|
|
2245
|
+
class: B(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100": y.value, "scale-95": !y.value }])
|
|
2246
2246
|
}, [
|
|
2247
2247
|
n("img", {
|
|
2248
2248
|
ref_key: "previewImageRef",
|
|
2249
2249
|
ref: E,
|
|
2250
|
-
src: l.previewSrcList ||
|
|
2250
|
+
src: l.previewSrcList || V.value || l.src,
|
|
2251
2251
|
alt: t.alt,
|
|
2252
2252
|
class: "max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",
|
|
2253
|
-
style:
|
|
2254
|
-
onClick:
|
|
2253
|
+
style: ge({ transform: `scale(${U.value})` }),
|
|
2254
|
+
onClick: Z[0] || (Z[0] = J(() => {
|
|
2255
2255
|
}, ["stop"]))
|
|
2256
2256
|
}, null, 12, ll)
|
|
2257
2257
|
], 2)
|
|
@@ -2270,87 +2270,87 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2270
2270
|
disabled: { type: Boolean, default: !1 }
|
|
2271
2271
|
},
|
|
2272
2272
|
setup(t) {
|
|
2273
|
-
const b = t, e =
|
|
2274
|
-
let
|
|
2275
|
-
const
|
|
2276
|
-
console.log("显示下拉菜单", e.value), !b.disabled && (
|
|
2277
|
-
|
|
2273
|
+
const b = t, e = R(!1), l = R();
|
|
2274
|
+
let p = null;
|
|
2275
|
+
const i = q(() => `y-dropdown__menu--${b.placement}`), C = () => {
|
|
2276
|
+
console.log("显示下拉菜单", e.value), !b.disabled && (p && (clearTimeout(p), p = null), e.value = !0, console.log("设置 visible 为 true", e.value), ve(() => {
|
|
2277
|
+
_();
|
|
2278
2278
|
}));
|
|
2279
2279
|
}, E = () => {
|
|
2280
|
-
console.log("隐藏下拉菜单"),
|
|
2280
|
+
console.log("隐藏下拉菜单"), p = setTimeout(() => {
|
|
2281
2281
|
e.value = !1, console.log("设置 visible 为 false", e.value);
|
|
2282
2282
|
}, 150);
|
|
2283
|
-
},
|
|
2283
|
+
}, _ = () => {
|
|
2284
2284
|
if (!l.value) return;
|
|
2285
|
-
const w = l.value.querySelector(".y-dropdown__trigger"),
|
|
2286
|
-
if (!w || !
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2289
|
-
let
|
|
2285
|
+
const w = l.value.querySelector(".y-dropdown__trigger"), y = l.value.querySelector(".y-dropdown__menu");
|
|
2286
|
+
if (!w || !y) return;
|
|
2287
|
+
const z = w.getBoundingClientRect(), V = y.getBoundingClientRect(), U = window.innerWidth, j = window.innerHeight;
|
|
2288
|
+
y.style.top = "", y.style.left = "", y.style.right = "", y.style.bottom = "", y.style.transform = "";
|
|
2289
|
+
let D = 0, T = 0;
|
|
2290
2290
|
switch (b.placement) {
|
|
2291
2291
|
case "bottom":
|
|
2292
|
-
|
|
2292
|
+
D = z.height + 4, T = 0;
|
|
2293
2293
|
break;
|
|
2294
2294
|
case "top":
|
|
2295
|
-
|
|
2295
|
+
D = -(V.height + 4), T = 0;
|
|
2296
2296
|
break;
|
|
2297
2297
|
case "right":
|
|
2298
|
-
|
|
2298
|
+
D = 0, T = z.width + 4;
|
|
2299
2299
|
break;
|
|
2300
2300
|
case "left":
|
|
2301
|
-
|
|
2301
|
+
D = 0, T = -(V.width + 4);
|
|
2302
2302
|
break;
|
|
2303
2303
|
}
|
|
2304
|
-
let
|
|
2304
|
+
let L = z.top + D, I = z.left + T;
|
|
2305
2305
|
if (b.placement === "bottom" || b.placement === "top") {
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2306
|
+
const P = V.width || 260;
|
|
2307
|
+
I + P > U - 10 && (I = U - P - 10), I < 10 && (I = 10);
|
|
2308
2308
|
}
|
|
2309
2309
|
if (b.placement === "left" || b.placement === "right") {
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2310
|
+
const P = V.height || 200;
|
|
2311
|
+
L + P > j - 10 && (L = j - P - 10), L < 10 && (L = 10);
|
|
2312
2312
|
}
|
|
2313
|
-
|
|
2314
|
-
},
|
|
2313
|
+
y.style.top = `${L}px`, y.style.left = `${I}px`;
|
|
2314
|
+
}, M = (w) => {
|
|
2315
2315
|
b.trigger === "click" && l.value && !l.value.contains(w.target) && (e.value = !1);
|
|
2316
|
-
},
|
|
2317
|
-
e.value &&
|
|
2316
|
+
}, v = () => {
|
|
2317
|
+
e.value && _();
|
|
2318
2318
|
};
|
|
2319
|
-
return
|
|
2320
|
-
b.trigger === "click" && document.addEventListener("click",
|
|
2319
|
+
return Se(() => {
|
|
2320
|
+
b.trigger === "click" && document.addEventListener("click", M), window.addEventListener("resize", v), window.addEventListener("scroll", v);
|
|
2321
2321
|
}), Ee(() => {
|
|
2322
|
-
b.trigger === "click" && document.removeEventListener("click",
|
|
2323
|
-
}), (w,
|
|
2322
|
+
b.trigger === "click" && document.removeEventListener("click", M), p && clearTimeout(p), window.removeEventListener("resize", v), window.removeEventListener("scroll", v);
|
|
2323
|
+
}), (w, y) => (a(), u("div", {
|
|
2324
2324
|
class: "y-dropdown",
|
|
2325
2325
|
ref_key: "dropdownRef",
|
|
2326
2326
|
ref: l
|
|
2327
2327
|
}, [
|
|
2328
2328
|
n("div", {
|
|
2329
2329
|
class: "y-dropdown__trigger",
|
|
2330
|
-
onMouseenter:
|
|
2330
|
+
onMouseenter: C,
|
|
2331
2331
|
onMouseleave: E
|
|
2332
2332
|
}, [
|
|
2333
2333
|
ue(w.$slots, "trigger", {}, () => [
|
|
2334
|
-
|
|
2334
|
+
y[0] || (y[0] = n("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2335
2335
|
], !0)
|
|
2336
2336
|
], 32),
|
|
2337
|
-
|
|
2337
|
+
fe(ke, {
|
|
2338
2338
|
name: "dropdown-fade",
|
|
2339
2339
|
appear: ""
|
|
2340
2340
|
}, {
|
|
2341
|
-
default:
|
|
2341
|
+
default: pe(() => [
|
|
2342
2342
|
Be(n("div", {
|
|
2343
|
-
class:
|
|
2344
|
-
onMouseenter:
|
|
2343
|
+
class: B(["y-dropdown__menu", i.value]),
|
|
2344
|
+
onMouseenter: C,
|
|
2345
2345
|
onMouseleave: E
|
|
2346
2346
|
}, [
|
|
2347
2347
|
ue(w.$slots, "default", {}, () => [
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2348
|
+
y[1] || (y[1] = n("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2349
|
+
y[2] || (y[2] = n("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2350
|
+
y[3] || (y[3] = n("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2351
2351
|
], !0)
|
|
2352
2352
|
], 34), [
|
|
2353
|
-
[
|
|
2353
|
+
[Ke, e.value]
|
|
2354
2354
|
])
|
|
2355
2355
|
]),
|
|
2356
2356
|
_: 3
|
|
@@ -2378,83 +2378,83 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2378
2378
|
},
|
|
2379
2379
|
emits: ["update:modelValue", "open", "close"],
|
|
2380
2380
|
setup(t, { emit: b }) {
|
|
2381
|
-
const e = t, l = b,
|
|
2381
|
+
const e = t, l = b, p = q({
|
|
2382
2382
|
get: () => e.modelValue,
|
|
2383
|
-
set: (
|
|
2384
|
-
}),
|
|
2385
|
-
const
|
|
2386
|
-
return e.placement === "right" ? (
|
|
2383
|
+
set: (z) => l("update:modelValue", z)
|
|
2384
|
+
}), i = R(null), C = q(() => e.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), E = q(() => e.placement === "right" ? "rounded-left" : "rounded-top"), _ = q(() => {
|
|
2385
|
+
const z = {};
|
|
2386
|
+
return e.placement === "right" ? (z.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), z.height = "100%", z.right = "0", z.top = "0") : (z.height = typeof e.height == "number" ? `${e.height}px` : String(e.height), z.width = "100%", z.bottom = "0", z.left = "0"), z;
|
|
2387
2387
|
});
|
|
2388
|
-
function
|
|
2389
|
-
e.maskClosable &&
|
|
2388
|
+
function M() {
|
|
2389
|
+
e.maskClosable && v();
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2392
|
-
|
|
2391
|
+
function v() {
|
|
2392
|
+
p.value && (p.value = !1, l("close"));
|
|
2393
2393
|
}
|
|
2394
2394
|
function w() {
|
|
2395
|
-
e.closable &&
|
|
2396
|
-
}
|
|
2397
|
-
function
|
|
2398
|
-
|
|
2399
|
-
}
|
|
2400
|
-
return
|
|
2401
|
-
|
|
2402
|
-
var
|
|
2403
|
-
return (
|
|
2404
|
-
}), document.addEventListener("keydown",
|
|
2405
|
-
}),
|
|
2406
|
-
e.modelValue && (document.addEventListener("keydown",
|
|
2395
|
+
e.closable && v();
|
|
2396
|
+
}
|
|
2397
|
+
function y(z) {
|
|
2398
|
+
z.key === "Escape" && w();
|
|
2399
|
+
}
|
|
2400
|
+
return ne(() => e.modelValue, (z) => {
|
|
2401
|
+
z ? (l("open"), requestAnimationFrame(() => {
|
|
2402
|
+
var V;
|
|
2403
|
+
return (V = i.value) == null ? void 0 : V.focus();
|
|
2404
|
+
}), document.addEventListener("keydown", y), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", y), document.body.style.overflow = "");
|
|
2405
|
+
}), Se(() => {
|
|
2406
|
+
e.modelValue && (document.addEventListener("keydown", y), document.body.style.overflow = "hidden");
|
|
2407
2407
|
}), Ee(() => {
|
|
2408
|
-
document.removeEventListener("keydown",
|
|
2409
|
-
}), (
|
|
2408
|
+
document.removeEventListener("keydown", y), document.body.style.overflow = "";
|
|
2409
|
+
}), (z, V) => (a(), Ie(Re, { to: "body" }, [
|
|
2410
2410
|
Be(n("div", {
|
|
2411
2411
|
class: "y-drawer-root",
|
|
2412
2412
|
role: "dialog",
|
|
2413
2413
|
"aria-modal": !0,
|
|
2414
|
-
"aria-hidden": !
|
|
2415
|
-
style:
|
|
2414
|
+
"aria-hidden": !p.value,
|
|
2415
|
+
style: ge({ zIndex: String(t.zIndex) })
|
|
2416
2416
|
}, [
|
|
2417
2417
|
n("div", {
|
|
2418
2418
|
class: "y-drawer-mask",
|
|
2419
|
-
onClick:
|
|
2419
|
+
onClick: M
|
|
2420
2420
|
}),
|
|
2421
|
-
|
|
2422
|
-
default:
|
|
2421
|
+
fe(ke, { name: C.value }, {
|
|
2422
|
+
default: pe(() => [
|
|
2423
2423
|
Be(n("div", {
|
|
2424
2424
|
ref_key: "panelRef",
|
|
2425
|
-
ref:
|
|
2426
|
-
class:
|
|
2425
|
+
ref: i,
|
|
2426
|
+
class: B(["y-drawer-panel", [
|
|
2427
2427
|
`is-${t.placement}`,
|
|
2428
2428
|
E.value
|
|
2429
2429
|
]]),
|
|
2430
|
-
style:
|
|
2431
|
-
onKeydown: be(
|
|
2430
|
+
style: ge(_.value),
|
|
2431
|
+
onKeydown: be(J(w, ["prevent", "stop"]), ["esc"]),
|
|
2432
2432
|
tabindex: "-1"
|
|
2433
2433
|
}, [
|
|
2434
|
-
t.showHeader ? (
|
|
2435
|
-
n("div", dl,
|
|
2436
|
-
t.closable ? (
|
|
2434
|
+
t.showHeader ? (a(), u("div", cl, [
|
|
2435
|
+
n("div", dl, G(t.title), 1),
|
|
2436
|
+
t.closable ? (a(), u("button", {
|
|
2437
2437
|
key: 0,
|
|
2438
2438
|
type: "button",
|
|
2439
2439
|
class: "y-drawer-close",
|
|
2440
2440
|
"aria-label": "Close",
|
|
2441
|
-
onClick:
|
|
2441
|
+
onClick: v
|
|
2442
2442
|
}, " ✕ ")) : A("", !0)
|
|
2443
2443
|
])) : A("", !0),
|
|
2444
2444
|
n("div", fl, [
|
|
2445
|
-
ue(
|
|
2445
|
+
ue(z.$slots, "default", {}, void 0, !0)
|
|
2446
2446
|
]),
|
|
2447
|
-
|
|
2448
|
-
ue(
|
|
2447
|
+
z.$slots.footer ? (a(), u("div", vl, [
|
|
2448
|
+
ue(z.$slots, "footer", {}, void 0, !0)
|
|
2449
2449
|
])) : A("", !0)
|
|
2450
2450
|
], 46, ul), [
|
|
2451
|
-
[
|
|
2451
|
+
[Ke, p.value]
|
|
2452
2452
|
])
|
|
2453
2453
|
]),
|
|
2454
2454
|
_: 3
|
|
2455
2455
|
}, 8, ["name"])
|
|
2456
2456
|
], 12, rl), [
|
|
2457
|
-
[
|
|
2457
|
+
[Ke, p.value]
|
|
2458
2458
|
])
|
|
2459
2459
|
]));
|
|
2460
2460
|
}
|
|
@@ -2476,10 +2476,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2476
2476
|
}, Cl = ["src", "alt"], Dl = { class: "ytree-node__custom-content" }, $l = {
|
|
2477
2477
|
key: 0,
|
|
2478
2478
|
class: "ytree-node__children"
|
|
2479
|
-
}, _l = ["data-level", "onClick", "onContextmenu"], Sl = ["onClick"],
|
|
2479
|
+
}, _l = ["data-level", "onClick", "onContextmenu"], Sl = ["onClick"], Ll = {
|
|
2480
2480
|
key: 1,
|
|
2481
2481
|
class: "w-[16px]"
|
|
2482
|
-
},
|
|
2482
|
+
}, Ml = ["onClick"], Il = {
|
|
2483
2483
|
key: 0,
|
|
2484
2484
|
width: "12",
|
|
2485
2485
|
height: "12",
|
|
@@ -2494,7 +2494,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2494
2494
|
}, El = ["src", "alt"], Tl = { class: "ytree-node__custom-content" }, zl = {
|
|
2495
2495
|
key: 0,
|
|
2496
2496
|
class: "ytree-node__children"
|
|
2497
|
-
},
|
|
2497
|
+
}, Kl = ["data-level", "onClick", "onContextmenu"], Hl = ["onClick"], Rl = {
|
|
2498
2498
|
key: 1,
|
|
2499
2499
|
class: "w-[16px]"
|
|
2500
2500
|
}, Vl = ["onClick"], Al = {
|
|
@@ -2503,13 +2503,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2503
2503
|
height: "12",
|
|
2504
2504
|
viewBox: "0 0 12 12",
|
|
2505
2505
|
fill: "none"
|
|
2506
|
-
},
|
|
2506
|
+
}, Nl = {
|
|
2507
2507
|
key: 1,
|
|
2508
2508
|
width: "12",
|
|
2509
2509
|
height: "12",
|
|
2510
2510
|
viewBox: "0 0 12 12",
|
|
2511
2511
|
fill: "none"
|
|
2512
|
-
},
|
|
2512
|
+
}, Yl = ["src", "alt"], Fl = { class: "ytree-node__custom-content" }, Pl = {
|
|
2513
2513
|
key: 0,
|
|
2514
2514
|
class: "ytree-node__children"
|
|
2515
2515
|
}, Wl = ["data-level", "onClick", "onContextmenu"], jl = ["onClick"], Ol = {
|
|
@@ -2594,251 +2594,280 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2594
2594
|
},
|
|
2595
2595
|
emits: ["node-click", "node-contextmenu", "check-change", "check", "current-change", "node-expand", "node-collapse", "node-drag-start", "node-drag-enter", "node-drag-leave", "node-drag-over", "node-drag-end", "node-drop", "checked-keys-change", "child-node-click"],
|
|
2596
2596
|
setup(t, { emit: b }) {
|
|
2597
|
-
const e = t, l = b,
|
|
2597
|
+
const e = t, l = b, p = q(() => (console.log("ytree 组件接收到的数据:", e.data), e.data || [])), i = R({
|
|
2598
2598
|
currentNode: null,
|
|
2599
2599
|
currentKey: null,
|
|
2600
2600
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
2601
2601
|
expandedKeys: /* @__PURE__ */ new Set(),
|
|
2602
2602
|
selectedKeys: /* @__PURE__ */ new Set()
|
|
2603
2603
|
});
|
|
2604
|
-
nt("treeStore",
|
|
2605
|
-
const
|
|
2606
|
-
function
|
|
2607
|
-
|
|
2604
|
+
nt("treeStore", i);
|
|
2605
|
+
const C = lt(), E = ot();
|
|
2606
|
+
function _() {
|
|
2607
|
+
var g;
|
|
2608
|
+
if (!E)
|
|
2609
|
+
return console.warn("无法获取组件实例,无法检测事件监听器"), !1;
|
|
2610
|
+
const d = (g = E.vnode) == null ? void 0 : g.props;
|
|
2611
|
+
if (d) {
|
|
2612
|
+
const m = Object.keys(d), o = m.filter((h) => h.startsWith("on"));
|
|
2613
|
+
if (console.log("VNode props 中的事件键:", o), "onNodeClick" in d)
|
|
2614
|
+
return console.log("找到事件监听器: onNodeClick"), !0;
|
|
2615
|
+
if ("onNode-click" in d)
|
|
2616
|
+
return console.log("找到事件监听器: onNode-click"), !0;
|
|
2617
|
+
const r = m.filter((h) => {
|
|
2618
|
+
const N = h.toLowerCase();
|
|
2619
|
+
return N.includes("nodeclick") || N.includes("node-click");
|
|
2620
|
+
});
|
|
2621
|
+
if (r.length > 0)
|
|
2622
|
+
return console.log("找到可能的事件监听器键:", r), !0;
|
|
2623
|
+
}
|
|
2624
|
+
const f = Object.keys(C);
|
|
2625
|
+
if (f.length > 0) {
|
|
2626
|
+
console.log("Attrs 键:", f);
|
|
2627
|
+
const m = f.filter((o) => {
|
|
2628
|
+
const r = o.toLowerCase();
|
|
2629
|
+
return o === "onNodeClick" || o === "onNode-click" || r.includes("nodeclick") || r.includes("node-click");
|
|
2630
|
+
});
|
|
2631
|
+
if (m.length > 0)
|
|
2632
|
+
return console.log("在 attrs 中找到事件监听器键:", m), !0;
|
|
2633
|
+
}
|
|
2634
|
+
return console.log("未找到 node-click 事件监听器"), !1;
|
|
2608
2635
|
}
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
return
|
|
2636
|
+
const M = q(() => e.restrictAutoExpandFromLevel && e.restrictAutoExpandFromLevel > 0 ? e.restrictAutoExpandFromLevel : void 0);
|
|
2637
|
+
function v(d) {
|
|
2638
|
+
return d[e.nodeKey] || d.id || Math.random();
|
|
2612
2639
|
}
|
|
2613
|
-
function
|
|
2640
|
+
function w(d) {
|
|
2614
2641
|
var f;
|
|
2615
|
-
return
|
|
2642
|
+
return ((f = e.props) != null && f.label ? d[e.props.label] : void 0) || d.label || "";
|
|
2616
2643
|
}
|
|
2617
|
-
function
|
|
2618
|
-
var
|
|
2619
|
-
|
|
2620
|
-
return f && m && Q(r, f) ? m : (i = r == null ? void 0 : r.data) != null && i.isButton && x ? x : p(r) ? y : h;
|
|
2644
|
+
function y(d) {
|
|
2645
|
+
var f;
|
|
2646
|
+
return !!((f = d == null ? void 0 : d.data) != null && f.isEmployee);
|
|
2621
2647
|
}
|
|
2622
|
-
function d
|
|
2648
|
+
function z(d, f) {
|
|
2623
2649
|
var h;
|
|
2624
|
-
const
|
|
2650
|
+
const g = e.deptIconUrl || io, m = e.personIconUrl || ro, o = e.buttonIconUrl || "", r = e.childStyleIconUrl || "";
|
|
2651
|
+
return f && r && D(d, f) ? r : (h = d == null ? void 0 : d.data) != null && h.isButton && o ? o : y(d) ? m : g;
|
|
2652
|
+
}
|
|
2653
|
+
function V(d) {
|
|
2654
|
+
var g;
|
|
2655
|
+
const f = ((g = e.props) != null && g.children ? d[e.props.children] : void 0) || d.children;
|
|
2625
2656
|
return f && f.length > 0;
|
|
2626
2657
|
}
|
|
2627
|
-
function
|
|
2658
|
+
function U(d) {
|
|
2628
2659
|
var f;
|
|
2629
|
-
return ((f = e.props) != null && f.children ?
|
|
2630
|
-
}
|
|
2631
|
-
function
|
|
2632
|
-
if (
|
|
2633
|
-
return
|
|
2634
|
-
const
|
|
2635
|
-
for (const
|
|
2636
|
-
const
|
|
2637
|
-
if (
|
|
2638
|
-
return
|
|
2660
|
+
return ((f = e.props) != null && f.children ? d[e.props.children] : void 0) || d.children || [];
|
|
2661
|
+
}
|
|
2662
|
+
function j(d, f, g = 1) {
|
|
2663
|
+
if (d === f)
|
|
2664
|
+
return g;
|
|
2665
|
+
const m = U(d);
|
|
2666
|
+
for (const o of m) {
|
|
2667
|
+
const r = j(o, f, g + 1);
|
|
2668
|
+
if (r > 0)
|
|
2669
|
+
return r;
|
|
2639
2670
|
}
|
|
2640
2671
|
return 0;
|
|
2641
2672
|
}
|
|
2642
|
-
function
|
|
2643
|
-
return !e.childStyleLevel || e.childStyleLevel < 1 ? !1 :
|
|
2673
|
+
function D(d, f) {
|
|
2674
|
+
return !e.childStyleLevel || e.childStyleLevel < 1 ? !1 : j(f, d) === e.childStyleLevel;
|
|
2644
2675
|
}
|
|
2645
|
-
function
|
|
2646
|
-
const f =
|
|
2647
|
-
return
|
|
2676
|
+
function T(d) {
|
|
2677
|
+
const f = v(d);
|
|
2678
|
+
return i.value.expandedKeys.has(f);
|
|
2648
2679
|
}
|
|
2649
|
-
function
|
|
2650
|
-
const f =
|
|
2651
|
-
if (
|
|
2652
|
-
if (d
|
|
2653
|
-
const
|
|
2654
|
-
(
|
|
2680
|
+
function L(d) {
|
|
2681
|
+
const f = v(d);
|
|
2682
|
+
if (i.value.checkedKeys.has(f)) {
|
|
2683
|
+
if (V(d)) {
|
|
2684
|
+
const m = U(d), o = m.filter((h) => L(h)), r = m.filter(
|
|
2685
|
+
(h) => I(h)
|
|
2655
2686
|
);
|
|
2656
|
-
return
|
|
2687
|
+
return o.length === m.length && r.length === 0;
|
|
2657
2688
|
}
|
|
2658
2689
|
return !0;
|
|
2659
2690
|
}
|
|
2660
|
-
if (d
|
|
2661
|
-
const
|
|
2662
|
-
return
|
|
2663
|
-
(
|
|
2664
|
-
) ? !1 :
|
|
2691
|
+
if (V(d)) {
|
|
2692
|
+
const m = U(d);
|
|
2693
|
+
return m.some(
|
|
2694
|
+
(r) => I(r)
|
|
2695
|
+
) ? !1 : m.length > 0 && m.every((r) => L(r));
|
|
2665
2696
|
}
|
|
2666
2697
|
return !1;
|
|
2667
2698
|
}
|
|
2668
|
-
function
|
|
2669
|
-
if (!d
|
|
2670
|
-
const f =
|
|
2671
|
-
(
|
|
2699
|
+
function I(d) {
|
|
2700
|
+
if (!V(d)) return !1;
|
|
2701
|
+
const f = U(d), g = f.filter((o) => L(o)), m = f.filter(
|
|
2702
|
+
(o) => I(o)
|
|
2672
2703
|
);
|
|
2673
|
-
return
|
|
2704
|
+
return g.length === f.length ? !1 : g.length > 0 || m.length > 0;
|
|
2674
2705
|
}
|
|
2675
|
-
function
|
|
2676
|
-
const f =
|
|
2677
|
-
return
|
|
2706
|
+
function P(d) {
|
|
2707
|
+
const f = v(d);
|
|
2708
|
+
return i.value.currentKey === f;
|
|
2678
2709
|
}
|
|
2679
|
-
function
|
|
2710
|
+
function X(d) {
|
|
2680
2711
|
if (e.disabled) return;
|
|
2681
|
-
const f =
|
|
2682
|
-
|
|
2683
|
-
function
|
|
2684
|
-
|
|
2685
|
-
const
|
|
2686
|
-
|
|
2712
|
+
const f = v(d), m = !i.value.checkedKeys.has(f), o = new Set(i.value.expandedKeys);
|
|
2713
|
+
m ? i.value.checkedKeys.add(f) : i.value.checkedKeys.delete(f);
|
|
2714
|
+
function r(h, N) {
|
|
2715
|
+
h.forEach((H) => {
|
|
2716
|
+
const Z = v(H);
|
|
2717
|
+
N ? i.value.checkedKeys.add(Z) : i.value.checkedKeys.delete(Z), V(H) && r(U(H), N);
|
|
2687
2718
|
});
|
|
2688
2719
|
}
|
|
2689
|
-
|
|
2720
|
+
r(U(d), m), m && ee(), le(), i.value.expandedKeys = o, l("check-change", d, m, !1), l("check", d, m, !1), l("checked-keys-change", Array.from(i.value.checkedKeys));
|
|
2690
2721
|
}
|
|
2691
|
-
function
|
|
2692
|
-
|
|
2693
|
-
`已启用从第${
|
|
2722
|
+
function ee(d) {
|
|
2723
|
+
M.value && console.log(
|
|
2724
|
+
`已启用从第${M.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2694
2725
|
);
|
|
2695
2726
|
}
|
|
2696
|
-
function
|
|
2697
|
-
const f =
|
|
2698
|
-
|
|
2727
|
+
function se(d) {
|
|
2728
|
+
const f = v(d);
|
|
2729
|
+
i.value.expandedKeys.has(f) ? (i.value.expandedKeys.delete(f), l("node-collapse", d, d, null)) : (i.value.expandedKeys.add(f), l("node-expand", d, d, null));
|
|
2699
2730
|
}
|
|
2700
|
-
function
|
|
2701
|
-
const
|
|
2702
|
-
function f(
|
|
2703
|
-
|
|
2704
|
-
|
|
2731
|
+
function le() {
|
|
2732
|
+
const d = [];
|
|
2733
|
+
function f(m) {
|
|
2734
|
+
m.forEach((o) => {
|
|
2735
|
+
d.push(o), V(o) && f(U(o));
|
|
2705
2736
|
});
|
|
2706
2737
|
}
|
|
2707
|
-
f(
|
|
2708
|
-
function
|
|
2709
|
-
if (
|
|
2710
|
-
const
|
|
2711
|
-
(
|
|
2738
|
+
f(p.value);
|
|
2739
|
+
function g(m) {
|
|
2740
|
+
if (V(m)) {
|
|
2741
|
+
const o = U(m), r = v(m), h = o.filter((H) => L(H)), N = o.filter(
|
|
2742
|
+
(H) => I(H)
|
|
2712
2743
|
);
|
|
2713
|
-
|
|
2744
|
+
h.length === o.length && N.length === 0 || h.length > 0 || N.length > 0 ? i.value.checkedKeys.add(r) : i.value.checkedKeys.delete(r);
|
|
2714
2745
|
}
|
|
2715
2746
|
}
|
|
2716
|
-
for (let
|
|
2717
|
-
|
|
2747
|
+
for (let m = d.length - 1; m >= 0; m--)
|
|
2748
|
+
g(d[m]);
|
|
2718
2749
|
}
|
|
2719
|
-
function
|
|
2720
|
-
var g, B, P, F;
|
|
2750
|
+
function ce(d, f, g, m) {
|
|
2721
2751
|
if (e.disabled) return;
|
|
2722
|
-
const
|
|
2723
|
-
if (e.enableChildStyleCustomClick &&
|
|
2724
|
-
l("child-node-click",
|
|
2752
|
+
const o = m ? D(d, m) : !1;
|
|
2753
|
+
if (e.enableChildStyleCustomClick && o) {
|
|
2754
|
+
l("child-node-click", d, f, g);
|
|
2725
2755
|
return;
|
|
2726
2756
|
}
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
a.value.currentNode = r, a.value.currentKey = k(r), e.showCheckbox && K(r), l("node-click", r, f, h);
|
|
2757
|
+
if (_()) {
|
|
2758
|
+
i.value.currentNode = d, i.value.currentKey = v(d), e.showCheckbox && X(d), l("node-click", d, f, g);
|
|
2730
2759
|
return;
|
|
2731
2760
|
}
|
|
2732
|
-
if (e.expandOnClickNode && d
|
|
2733
|
-
|
|
2761
|
+
if (e.expandOnClickNode && V(d)) {
|
|
2762
|
+
se(d);
|
|
2734
2763
|
return;
|
|
2735
2764
|
}
|
|
2736
|
-
|
|
2765
|
+
i.value.currentNode = d, i.value.currentKey = v(d), e.showCheckbox && X(d), l("node-click", d, f, g);
|
|
2737
2766
|
}
|
|
2738
|
-
function
|
|
2739
|
-
e.disabled || l("node-contextmenu",
|
|
2767
|
+
function de(d, f, g, m) {
|
|
2768
|
+
e.disabled || l("node-contextmenu", d, f, g, m);
|
|
2740
2769
|
}
|
|
2741
|
-
|
|
2770
|
+
ne(
|
|
2742
2771
|
() => e.defaultExpandedKeys,
|
|
2743
|
-
(
|
|
2744
|
-
if (
|
|
2745
|
-
const f =
|
|
2772
|
+
(d) => {
|
|
2773
|
+
if (d) {
|
|
2774
|
+
const f = M.value;
|
|
2746
2775
|
if (f) {
|
|
2747
|
-
let
|
|
2748
|
-
for (const
|
|
2749
|
-
if (
|
|
2750
|
-
if (
|
|
2751
|
-
const
|
|
2752
|
-
if (
|
|
2776
|
+
let g = function(h, N, H = 1) {
|
|
2777
|
+
for (const Z of N) {
|
|
2778
|
+
if (v(Z) === h) return H;
|
|
2779
|
+
if (V(Z)) {
|
|
2780
|
+
const De = g(h, U(Z), H + 1);
|
|
2781
|
+
if (De > 0) return De;
|
|
2753
2782
|
}
|
|
2754
2783
|
}
|
|
2755
2784
|
return 0;
|
|
2756
|
-
},
|
|
2757
|
-
|
|
2758
|
-
|
|
2785
|
+
}, m = function(h, N, H) {
|
|
2786
|
+
h.forEach((Z) => {
|
|
2787
|
+
N < H && V(Z) ? (r.add(v(Z)), m(U(Z), N + 1, H)) : N < H && V(Z);
|
|
2759
2788
|
});
|
|
2760
2789
|
};
|
|
2761
|
-
const
|
|
2762
|
-
const
|
|
2763
|
-
return
|
|
2764
|
-
}),
|
|
2765
|
-
|
|
2766
|
-
h
|
|
2767
|
-
}),
|
|
2790
|
+
const o = (d || []).filter((h) => {
|
|
2791
|
+
const N = g(h, p.value, 1);
|
|
2792
|
+
return N > 0 && N < f;
|
|
2793
|
+
}), r = new Set(o);
|
|
2794
|
+
m(p.value, 1, f), i.value.expandedKeys.forEach((h) => {
|
|
2795
|
+
g(h, p.value, 1) >= f && r.add(h);
|
|
2796
|
+
}), i.value.expandedKeys = r;
|
|
2768
2797
|
} else
|
|
2769
|
-
|
|
2798
|
+
i.value.expandedKeys = new Set(d);
|
|
2770
2799
|
}
|
|
2771
2800
|
},
|
|
2772
2801
|
{ immediate: !0 }
|
|
2773
2802
|
);
|
|
2774
|
-
function
|
|
2803
|
+
function Y() {
|
|
2775
2804
|
if (e.defaultExpandAll) {
|
|
2776
|
-
let
|
|
2777
|
-
|
|
2778
|
-
if (!
|
|
2779
|
-
const
|
|
2780
|
-
if (
|
|
2781
|
-
if (
|
|
2782
|
-
|
|
2805
|
+
let d = function(m, o = 1) {
|
|
2806
|
+
m.forEach((r) => {
|
|
2807
|
+
if (!V(r)) return;
|
|
2808
|
+
const h = U(r);
|
|
2809
|
+
if (g) {
|
|
2810
|
+
if (o >= g) return;
|
|
2811
|
+
o + 1 === g || f.add(v(r)), d(h, o + 1);
|
|
2783
2812
|
} else
|
|
2784
|
-
f.add(
|
|
2813
|
+
f.add(v(r)), d(h, o + 1);
|
|
2785
2814
|
});
|
|
2786
2815
|
};
|
|
2787
|
-
const f = /* @__PURE__ */ new Set(),
|
|
2788
|
-
|
|
2816
|
+
const f = /* @__PURE__ */ new Set(), g = M.value;
|
|
2817
|
+
d(p.value, 1), i.value.expandedKeys = f;
|
|
2789
2818
|
}
|
|
2790
2819
|
}
|
|
2791
|
-
function
|
|
2820
|
+
function W() {
|
|
2792
2821
|
if (e.defaultCheckedKeys && e.defaultCheckedKeys.length > 0) {
|
|
2793
|
-
let
|
|
2794
|
-
|
|
2795
|
-
const
|
|
2796
|
-
f.has(
|
|
2822
|
+
let d = function(o, r = []) {
|
|
2823
|
+
o.forEach((h) => {
|
|
2824
|
+
const N = v(h), H = [...r, N];
|
|
2825
|
+
f.has(N) && r.forEach((Z) => g.add(Z)), V(h) && d(U(h), H);
|
|
2797
2826
|
});
|
|
2798
2827
|
};
|
|
2799
|
-
const f = new Set(e.defaultCheckedKeys),
|
|
2800
|
-
|
|
2801
|
-
const
|
|
2802
|
-
if (
|
|
2828
|
+
const f = new Set(e.defaultCheckedKeys), g = /* @__PURE__ */ new Set();
|
|
2829
|
+
d(p.value);
|
|
2830
|
+
const m = M.value;
|
|
2831
|
+
if (m) {
|
|
2803
2832
|
console.log(
|
|
2804
|
-
`已启用从第${
|
|
2833
|
+
`已启用从第${m}级开始不默认展开:保持当前展开状态不变`
|
|
2805
2834
|
);
|
|
2806
2835
|
return;
|
|
2807
2836
|
}
|
|
2808
|
-
|
|
2837
|
+
i.value.expandedKeys = g;
|
|
2809
2838
|
}
|
|
2810
2839
|
}
|
|
2811
|
-
return
|
|
2840
|
+
return ne(() => e.defaultExpandAll, Y, { immediate: !0 }), ne(() => p.value, Y, { deep: !0 }), ne(
|
|
2812
2841
|
() => e.defaultCheckedKeys,
|
|
2813
|
-
(
|
|
2814
|
-
|
|
2842
|
+
(d) => {
|
|
2843
|
+
d ? (i.value.checkedKeys = new Set(d), e.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : W()) : i.value.checkedKeys.clear();
|
|
2815
2844
|
},
|
|
2816
2845
|
{ immediate: !0 }
|
|
2817
|
-
),
|
|
2846
|
+
), ne(
|
|
2818
2847
|
() => e.defaultSelectedKeys,
|
|
2819
|
-
(
|
|
2820
|
-
|
|
2848
|
+
(d) => {
|
|
2849
|
+
d && (i.value.selectedKeys = new Set(d));
|
|
2821
2850
|
},
|
|
2822
2851
|
{ immediate: !0 }
|
|
2823
|
-
), (
|
|
2824
|
-
class:
|
|
2852
|
+
), (d, f) => (a(), u("div", {
|
|
2853
|
+
class: B(["ytree", [`ytree--${t.size}`, { "ytree--disabled": t.disabled }]])
|
|
2825
2854
|
}, [
|
|
2826
2855
|
n("div", yl, [
|
|
2827
|
-
(
|
|
2828
|
-
key:
|
|
2829
|
-
class:
|
|
2856
|
+
(a(!0), u(re, null, he(p.value, (g) => (a(), u("div", {
|
|
2857
|
+
key: v(g),
|
|
2858
|
+
class: B(["ytree-node", { "ytree-node--current": P(g) }])
|
|
2830
2859
|
}, [
|
|
2831
2860
|
n("div", {
|
|
2832
|
-
class:
|
|
2861
|
+
class: B(["ytree-node__content", { "is-child-style": D(g, g) }]),
|
|
2833
2862
|
style: { paddingLeft: "8px" },
|
|
2834
|
-
"data-level":
|
|
2835
|
-
onClick: (
|
|
2836
|
-
onContextmenu: (
|
|
2863
|
+
"data-level": j(g, g),
|
|
2864
|
+
onClick: (m) => ce(g, g, null, g),
|
|
2865
|
+
onContextmenu: (m) => de(m, g, g, null)
|
|
2837
2866
|
}, [
|
|
2838
|
-
|
|
2867
|
+
V(g) ? (a(), u("span", {
|
|
2839
2868
|
key: 0,
|
|
2840
|
-
class:
|
|
2841
|
-
onClick:
|
|
2869
|
+
class: B(["ytree-node__expand-icon", { "is-expanded": T(g) }]),
|
|
2870
|
+
onClick: J((m) => se(g), ["stop"])
|
|
2842
2871
|
}, [...f[0] || (f[0] = [
|
|
2843
2872
|
n("svg", {
|
|
2844
2873
|
width: "12",
|
|
@@ -2854,16 +2883,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2854
2883
|
"stroke-linejoin": "round"
|
|
2855
2884
|
})
|
|
2856
2885
|
], -1)
|
|
2857
|
-
])], 10, ml)) : (
|
|
2858
|
-
t.showCheckbox ? (
|
|
2886
|
+
])], 10, ml)) : (a(), u("span", wl)),
|
|
2887
|
+
t.showCheckbox ? (a(), u("span", {
|
|
2859
2888
|
key: 2,
|
|
2860
|
-
class:
|
|
2861
|
-
"is-checked":
|
|
2862
|
-
"is-indeterminate":
|
|
2889
|
+
class: B(["ytree-node__checkbox", {
|
|
2890
|
+
"is-checked": L(g),
|
|
2891
|
+
"is-indeterminate": I(g)
|
|
2863
2892
|
}]),
|
|
2864
|
-
onClick:
|
|
2893
|
+
onClick: J((m) => X(g), ["stop"])
|
|
2865
2894
|
}, [
|
|
2866
|
-
|
|
2895
|
+
L(g) ? (a(), u("svg", kl, [...f[1] || (f[1] = [
|
|
2867
2896
|
n("path", {
|
|
2868
2897
|
d: "M2 6L4.5 8.5L10 3",
|
|
2869
2898
|
stroke: "currentColor",
|
|
@@ -2871,7 +2900,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2871
2900
|
"stroke-linecap": "round",
|
|
2872
2901
|
"stroke-linejoin": "round"
|
|
2873
2902
|
}, null, -1)
|
|
2874
|
-
])])) :
|
|
2903
|
+
])])) : I(g) ? (a(), u("svg", xl, [...f[2] || (f[2] = [
|
|
2875
2904
|
n("path", {
|
|
2876
2905
|
d: "M2 6L10 6",
|
|
2877
2906
|
stroke: "currentColor",
|
|
@@ -2880,45 +2909,45 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2880
2909
|
}, null, -1)
|
|
2881
2910
|
])])) : A("", !0)
|
|
2882
2911
|
], 10, bl)) : A("", !0),
|
|
2883
|
-
t.iconClass ? (
|
|
2912
|
+
t.iconClass ? (a(), u("span", {
|
|
2884
2913
|
key: 3,
|
|
2885
|
-
class:
|
|
2914
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
2886
2915
|
}, null, 2)) : A("", !0),
|
|
2887
2916
|
n("img", {
|
|
2888
2917
|
class: "ytree-node__avatar",
|
|
2889
|
-
src:
|
|
2890
|
-
alt:
|
|
2918
|
+
src: z(g, g),
|
|
2919
|
+
alt: y(g) ? "person" : "dept"
|
|
2891
2920
|
}, null, 8, Cl),
|
|
2892
2921
|
n("span", {
|
|
2893
|
-
class:
|
|
2894
|
-
},
|
|
2922
|
+
class: B(["ytree-node__label", { "is-employee": y(g) }])
|
|
2923
|
+
}, G(w(g)), 3),
|
|
2895
2924
|
n("div", Dl, [
|
|
2896
|
-
ue(
|
|
2897
|
-
node:
|
|
2898
|
-
isCurrent:
|
|
2899
|
-
isExpanded:
|
|
2900
|
-
hasChildren:
|
|
2925
|
+
ue(d.$slots, "node-content", {
|
|
2926
|
+
node: g,
|
|
2927
|
+
isCurrent: P(g),
|
|
2928
|
+
isExpanded: T(g),
|
|
2929
|
+
hasChildren: V(g)
|
|
2901
2930
|
}, void 0, !0)
|
|
2902
2931
|
])
|
|
2903
2932
|
], 42, gl),
|
|
2904
|
-
|
|
2905
|
-
default:
|
|
2906
|
-
|
|
2907
|
-
(
|
|
2908
|
-
key:
|
|
2909
|
-
class:
|
|
2933
|
+
fe(ke, { name: "ytree-node" }, {
|
|
2934
|
+
default: pe(() => [
|
|
2935
|
+
V(g) && T(g) ? (a(), u("div", $l, [
|
|
2936
|
+
(a(!0), u(re, null, he(U(g), (m) => (a(), u("div", {
|
|
2937
|
+
key: v(m),
|
|
2938
|
+
class: B(["ytree-node", { "ytree-node--current": P(m) }])
|
|
2910
2939
|
}, [
|
|
2911
2940
|
n("div", {
|
|
2912
|
-
class:
|
|
2941
|
+
class: B(["ytree-node__content", { "is-child-style": D(m, g) }]),
|
|
2913
2942
|
style: { paddingLeft: "22px" },
|
|
2914
|
-
"data-level":
|
|
2915
|
-
onClick: (
|
|
2916
|
-
onContextmenu: (
|
|
2943
|
+
"data-level": j(g, m),
|
|
2944
|
+
onClick: (o) => ce(m, m, null, g),
|
|
2945
|
+
onContextmenu: (o) => de(o, m, m, null)
|
|
2917
2946
|
}, [
|
|
2918
|
-
|
|
2947
|
+
V(m) ? (a(), u("span", {
|
|
2919
2948
|
key: 0,
|
|
2920
|
-
class:
|
|
2921
|
-
onClick:
|
|
2949
|
+
class: B(["ytree-node__expand-icon", { "is-expanded": T(m) }]),
|
|
2950
|
+
onClick: J((o) => se(m), ["stop"])
|
|
2922
2951
|
}, [...f[3] || (f[3] = [
|
|
2923
2952
|
n("svg", {
|
|
2924
2953
|
width: "12",
|
|
@@ -2934,16 +2963,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2934
2963
|
"stroke-linejoin": "round"
|
|
2935
2964
|
})
|
|
2936
2965
|
], -1)
|
|
2937
|
-
])], 10, Sl)) : (
|
|
2938
|
-
t.showCheckbox ? (
|
|
2966
|
+
])], 10, Sl)) : (a(), u("span", Ll)),
|
|
2967
|
+
t.showCheckbox ? (a(), u("span", {
|
|
2939
2968
|
key: 2,
|
|
2940
|
-
class:
|
|
2941
|
-
"is-checked":
|
|
2942
|
-
"is-indeterminate":
|
|
2969
|
+
class: B(["ytree-node__checkbox", {
|
|
2970
|
+
"is-checked": L(m),
|
|
2971
|
+
"is-indeterminate": I(m)
|
|
2943
2972
|
}]),
|
|
2944
|
-
onClick:
|
|
2973
|
+
onClick: J((o) => X(m), ["stop"])
|
|
2945
2974
|
}, [
|
|
2946
|
-
|
|
2975
|
+
L(m) ? (a(), u("svg", Il, [...f[4] || (f[4] = [
|
|
2947
2976
|
n("path", {
|
|
2948
2977
|
d: "M2 6L4.5 8.5L10 3",
|
|
2949
2978
|
stroke: "currentColor",
|
|
@@ -2951,7 +2980,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2951
2980
|
"stroke-linecap": "round",
|
|
2952
2981
|
"stroke-linejoin": "round"
|
|
2953
2982
|
}, null, -1)
|
|
2954
|
-
])])) :
|
|
2983
|
+
])])) : I(m) ? (a(), u("svg", Bl, [...f[5] || (f[5] = [
|
|
2955
2984
|
n("path", {
|
|
2956
2985
|
d: "M2 6L10 6",
|
|
2957
2986
|
stroke: "currentColor",
|
|
@@ -2959,53 +2988,53 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2959
2988
|
"stroke-linecap": "round"
|
|
2960
2989
|
}, null, -1)
|
|
2961
2990
|
])])) : A("", !0)
|
|
2962
|
-
], 10,
|
|
2963
|
-
t.iconClass ? (
|
|
2991
|
+
], 10, Ml)) : A("", !0),
|
|
2992
|
+
t.iconClass ? (a(), u("span", {
|
|
2964
2993
|
key: 3,
|
|
2965
|
-
class:
|
|
2994
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
2966
2995
|
}, null, 2)) : A("", !0),
|
|
2967
2996
|
n("img", {
|
|
2968
2997
|
class: "ytree-node__avatar",
|
|
2969
|
-
src:
|
|
2970
|
-
alt:
|
|
2998
|
+
src: z(m, g),
|
|
2999
|
+
alt: y(m) ? "person" : "dept"
|
|
2971
3000
|
}, null, 8, El),
|
|
2972
3001
|
n("span", {
|
|
2973
|
-
class:
|
|
2974
|
-
},
|
|
3002
|
+
class: B(["ytree-node__label", { "is-employee": y(m) }])
|
|
3003
|
+
}, G(w(m)), 3),
|
|
2975
3004
|
n("div", Tl, [
|
|
2976
|
-
ue(
|
|
2977
|
-
node:
|
|
2978
|
-
isCurrent:
|
|
2979
|
-
isExpanded:
|
|
2980
|
-
hasChildren:
|
|
3005
|
+
ue(d.$slots, "node-content", {
|
|
3006
|
+
node: m,
|
|
3007
|
+
isCurrent: P(m),
|
|
3008
|
+
isExpanded: T(m),
|
|
3009
|
+
hasChildren: V(m)
|
|
2981
3010
|
}, void 0, !0)
|
|
2982
3011
|
])
|
|
2983
3012
|
], 42, _l),
|
|
2984
|
-
|
|
2985
|
-
default:
|
|
2986
|
-
|
|
2987
|
-
(
|
|
2988
|
-
key:
|
|
2989
|
-
class:
|
|
2990
|
-
"ytree-node--current":
|
|
3013
|
+
fe(ke, { name: "ytree-node" }, {
|
|
3014
|
+
default: pe(() => [
|
|
3015
|
+
V(m) && T(m) ? (a(), u("div", zl, [
|
|
3016
|
+
(a(!0), u(re, null, he(U(m), (o) => (a(), u("div", {
|
|
3017
|
+
key: v(o),
|
|
3018
|
+
class: B(["ytree-node", {
|
|
3019
|
+
"ytree-node--current": P(o)
|
|
2991
3020
|
}])
|
|
2992
3021
|
}, [
|
|
2993
3022
|
n("div", {
|
|
2994
|
-
class:
|
|
3023
|
+
class: B(["ytree-node__content", { "is-child-style": D(o, g) }]),
|
|
2995
3024
|
style: { paddingLeft: "38px" },
|
|
2996
|
-
"data-level":
|
|
2997
|
-
onClick: (
|
|
2998
|
-
onContextmenu: (
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3025
|
+
"data-level": j(g, o),
|
|
3026
|
+
onClick: (r) => ce(o, o, null, g),
|
|
3027
|
+
onContextmenu: (r) => de(
|
|
3028
|
+
r,
|
|
3029
|
+
o,
|
|
3030
|
+
o,
|
|
3002
3031
|
null
|
|
3003
3032
|
)
|
|
3004
3033
|
}, [
|
|
3005
|
-
|
|
3034
|
+
V(o) ? (a(), u("span", {
|
|
3006
3035
|
key: 0,
|
|
3007
|
-
class:
|
|
3008
|
-
onClick:
|
|
3036
|
+
class: B(["ytree-node__expand-icon", { "is-expanded": T(o) }]),
|
|
3037
|
+
onClick: J((r) => se(o), ["stop"])
|
|
3009
3038
|
}, [...f[6] || (f[6] = [
|
|
3010
3039
|
n("svg", {
|
|
3011
3040
|
width: "12",
|
|
@@ -3021,16 +3050,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3021
3050
|
"stroke-linejoin": "round"
|
|
3022
3051
|
})
|
|
3023
3052
|
], -1)
|
|
3024
|
-
])], 10,
|
|
3025
|
-
t.showCheckbox ? (
|
|
3053
|
+
])], 10, Hl)) : (a(), u("span", Rl)),
|
|
3054
|
+
t.showCheckbox ? (a(), u("span", {
|
|
3026
3055
|
key: 2,
|
|
3027
|
-
class:
|
|
3028
|
-
"is-checked":
|
|
3029
|
-
"is-indeterminate":
|
|
3056
|
+
class: B(["ytree-node__checkbox", {
|
|
3057
|
+
"is-checked": L(o),
|
|
3058
|
+
"is-indeterminate": I(o)
|
|
3030
3059
|
}]),
|
|
3031
|
-
onClick:
|
|
3060
|
+
onClick: J((r) => X(o), ["stop"])
|
|
3032
3061
|
}, [
|
|
3033
|
-
|
|
3062
|
+
L(o) ? (a(), u("svg", Al, [...f[7] || (f[7] = [
|
|
3034
3063
|
n("path", {
|
|
3035
3064
|
d: "M2 6L4.5 8.5L10 3",
|
|
3036
3065
|
stroke: "currentColor",
|
|
@@ -3038,7 +3067,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3038
3067
|
"stroke-linecap": "round",
|
|
3039
3068
|
"stroke-linejoin": "round"
|
|
3040
3069
|
}, null, -1)
|
|
3041
|
-
])])) :
|
|
3070
|
+
])])) : I(o) ? (a(), u("svg", Nl, [...f[8] || (f[8] = [
|
|
3042
3071
|
n("path", {
|
|
3043
3072
|
d: "M2 6L10 6",
|
|
3044
3073
|
stroke: "currentColor",
|
|
@@ -3047,61 +3076,61 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3047
3076
|
}, null, -1)
|
|
3048
3077
|
])])) : A("", !0)
|
|
3049
3078
|
], 10, Vl)) : A("", !0),
|
|
3050
|
-
t.iconClass ? (
|
|
3079
|
+
t.iconClass ? (a(), u("span", {
|
|
3051
3080
|
key: 3,
|
|
3052
|
-
class:
|
|
3081
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3053
3082
|
}, null, 2)) : A("", !0),
|
|
3054
3083
|
n("img", {
|
|
3055
3084
|
class: "ytree-node__avatar",
|
|
3056
|
-
src:
|
|
3057
|
-
alt:
|
|
3058
|
-
}, null, 8,
|
|
3085
|
+
src: z(o, g),
|
|
3086
|
+
alt: y(o) ? "person" : "dept"
|
|
3087
|
+
}, null, 8, Yl),
|
|
3059
3088
|
n("span", {
|
|
3060
|
-
class:
|
|
3061
|
-
},
|
|
3062
|
-
n("div",
|
|
3063
|
-
ue(
|
|
3064
|
-
node:
|
|
3065
|
-
isCurrent:
|
|
3066
|
-
isExpanded:
|
|
3067
|
-
hasChildren:
|
|
3089
|
+
class: B(["ytree-node__label", { "is-employee": y(o) }])
|
|
3090
|
+
}, G(w(o)), 3),
|
|
3091
|
+
n("div", Fl, [
|
|
3092
|
+
ue(d.$slots, "node-content", {
|
|
3093
|
+
node: o,
|
|
3094
|
+
isCurrent: P(o),
|
|
3095
|
+
isExpanded: T(o),
|
|
3096
|
+
hasChildren: V(o)
|
|
3068
3097
|
}, void 0, !0)
|
|
3069
3098
|
])
|
|
3070
|
-
], 42,
|
|
3071
|
-
|
|
3072
|
-
default:
|
|
3073
|
-
|
|
3074
|
-
(
|
|
3075
|
-
key:
|
|
3076
|
-
class:
|
|
3077
|
-
"ytree-node--current":
|
|
3099
|
+
], 42, Kl),
|
|
3100
|
+
fe(ke, { name: "ytree-node" }, {
|
|
3101
|
+
default: pe(() => [
|
|
3102
|
+
V(o) && T(o) ? (a(), u("div", Pl, [
|
|
3103
|
+
(a(!0), u(re, null, he(U(o), (r) => (a(), u("div", {
|
|
3104
|
+
key: v(r),
|
|
3105
|
+
class: B(["ytree-node", {
|
|
3106
|
+
"ytree-node--current": P(r)
|
|
3078
3107
|
}])
|
|
3079
3108
|
}, [
|
|
3080
3109
|
n("div", {
|
|
3081
|
-
class:
|
|
3110
|
+
class: B(["ytree-node__content", { "is-child-style": D(r, g) }]),
|
|
3082
3111
|
style: {
|
|
3083
3112
|
paddingLeft: "54px"
|
|
3084
3113
|
},
|
|
3085
|
-
"data-level":
|
|
3086
|
-
onClick: (
|
|
3087
|
-
|
|
3088
|
-
|
|
3114
|
+
"data-level": j(g, r),
|
|
3115
|
+
onClick: (h) => ce(
|
|
3116
|
+
r,
|
|
3117
|
+
r,
|
|
3089
3118
|
null,
|
|
3090
|
-
|
|
3119
|
+
g
|
|
3091
3120
|
),
|
|
3092
|
-
onContextmenu: (
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3121
|
+
onContextmenu: (h) => de(
|
|
3122
|
+
h,
|
|
3123
|
+
r,
|
|
3124
|
+
r,
|
|
3096
3125
|
null
|
|
3097
3126
|
)
|
|
3098
3127
|
}, [
|
|
3099
|
-
|
|
3128
|
+
V(r) ? (a(), u("span", {
|
|
3100
3129
|
key: 0,
|
|
3101
|
-
class:
|
|
3102
|
-
"is-expanded":
|
|
3130
|
+
class: B(["ytree-node__expand-icon", {
|
|
3131
|
+
"is-expanded": T(r)
|
|
3103
3132
|
}]),
|
|
3104
|
-
onClick:
|
|
3133
|
+
onClick: J((h) => se(r), ["stop"])
|
|
3105
3134
|
}, [...f[9] || (f[9] = [
|
|
3106
3135
|
n("svg", {
|
|
3107
3136
|
width: "12",
|
|
@@ -3117,16 +3146,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3117
3146
|
"stroke-linejoin": "round"
|
|
3118
3147
|
})
|
|
3119
3148
|
], -1)
|
|
3120
|
-
])], 10, jl)) : (
|
|
3121
|
-
t.showCheckbox ? (
|
|
3149
|
+
])], 10, jl)) : (a(), u("span", Ol)),
|
|
3150
|
+
t.showCheckbox ? (a(), u("span", {
|
|
3122
3151
|
key: 2,
|
|
3123
|
-
class:
|
|
3124
|
-
"is-checked":
|
|
3125
|
-
"is-indeterminate":
|
|
3152
|
+
class: B(["ytree-node__checkbox", {
|
|
3153
|
+
"is-checked": L(r),
|
|
3154
|
+
"is-indeterminate": I(r)
|
|
3126
3155
|
}]),
|
|
3127
|
-
onClick:
|
|
3156
|
+
onClick: J((h) => X(r), ["stop"])
|
|
3128
3157
|
}, [
|
|
3129
|
-
|
|
3158
|
+
L(r) ? (a(), u("svg", Ul, [...f[10] || (f[10] = [
|
|
3130
3159
|
n("path", {
|
|
3131
3160
|
d: "M2 6L4.5 8.5L10 3",
|
|
3132
3161
|
stroke: "currentColor",
|
|
@@ -3134,7 +3163,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3134
3163
|
"stroke-linecap": "round",
|
|
3135
3164
|
"stroke-linejoin": "round"
|
|
3136
3165
|
}, null, -1)
|
|
3137
|
-
])])) :
|
|
3166
|
+
])])) : I(r) ? (a(), u("svg", Zl, [...f[11] || (f[11] = [
|
|
3138
3167
|
n("path", {
|
|
3139
3168
|
d: "M2 6L10 6",
|
|
3140
3169
|
stroke: "currentColor",
|
|
@@ -3143,65 +3172,65 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3143
3172
|
}, null, -1)
|
|
3144
3173
|
])])) : A("", !0)
|
|
3145
3174
|
], 10, ql)) : A("", !0),
|
|
3146
|
-
t.iconClass ? (
|
|
3175
|
+
t.iconClass ? (a(), u("span", {
|
|
3147
3176
|
key: 3,
|
|
3148
|
-
class:
|
|
3177
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3149
3178
|
}, null, 2)) : A("", !0),
|
|
3150
3179
|
n("img", {
|
|
3151
3180
|
class: "ytree-node__avatar",
|
|
3152
|
-
src:
|
|
3153
|
-
alt:
|
|
3181
|
+
src: z(r, g),
|
|
3182
|
+
alt: y(r) ? "person" : "dept"
|
|
3154
3183
|
}, null, 8, Ql),
|
|
3155
3184
|
n("span", {
|
|
3156
|
-
class:
|
|
3157
|
-
"is-employee":
|
|
3185
|
+
class: B(["ytree-node__label", {
|
|
3186
|
+
"is-employee": y(r)
|
|
3158
3187
|
}])
|
|
3159
|
-
},
|
|
3188
|
+
}, G(w(r)), 3),
|
|
3160
3189
|
n("div", Jl, [
|
|
3161
|
-
ue(
|
|
3162
|
-
node:
|
|
3163
|
-
isCurrent:
|
|
3164
|
-
isExpanded:
|
|
3165
|
-
hasChildren:
|
|
3190
|
+
ue(d.$slots, "node-content", {
|
|
3191
|
+
node: r,
|
|
3192
|
+
isCurrent: P(r),
|
|
3193
|
+
isExpanded: T(r),
|
|
3194
|
+
hasChildren: V(r)
|
|
3166
3195
|
}, void 0, !0)
|
|
3167
3196
|
])
|
|
3168
3197
|
], 42, Wl),
|
|
3169
|
-
|
|
3170
|
-
default:
|
|
3171
|
-
|
|
3172
|
-
(
|
|
3173
|
-
|
|
3174
|
-
), (
|
|
3175
|
-
key:
|
|
3176
|
-
class:
|
|
3177
|
-
"ytree-node--current":
|
|
3198
|
+
fe(ke, { name: "ytree-node" }, {
|
|
3199
|
+
default: pe(() => [
|
|
3200
|
+
V(r) && T(r) ? (a(), u("div", Xl, [
|
|
3201
|
+
(a(!0), u(re, null, he(U(
|
|
3202
|
+
r
|
|
3203
|
+
), (h) => (a(), u("div", {
|
|
3204
|
+
key: v(h),
|
|
3205
|
+
class: B(["ytree-node", {
|
|
3206
|
+
"ytree-node--current": P(h)
|
|
3178
3207
|
}])
|
|
3179
3208
|
}, [
|
|
3180
3209
|
n("div", {
|
|
3181
|
-
class:
|
|
3210
|
+
class: B(["ytree-node__content", { "is-child-style": D(h, g) }]),
|
|
3182
3211
|
style: {
|
|
3183
3212
|
paddingLeft: "70px"
|
|
3184
3213
|
},
|
|
3185
|
-
"data-level":
|
|
3186
|
-
onClick: (
|
|
3187
|
-
|
|
3188
|
-
|
|
3214
|
+
"data-level": j(g, h),
|
|
3215
|
+
onClick: (N) => ce(
|
|
3216
|
+
h,
|
|
3217
|
+
h,
|
|
3189
3218
|
null,
|
|
3190
|
-
|
|
3219
|
+
g
|
|
3191
3220
|
),
|
|
3192
|
-
onContextmenu: (
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3221
|
+
onContextmenu: (N) => de(
|
|
3222
|
+
N,
|
|
3223
|
+
h,
|
|
3224
|
+
h,
|
|
3196
3225
|
null
|
|
3197
3226
|
)
|
|
3198
3227
|
}, [
|
|
3199
|
-
|
|
3228
|
+
V(h) ? (a(), u("span", {
|
|
3200
3229
|
key: 0,
|
|
3201
|
-
class:
|
|
3202
|
-
"is-expanded":
|
|
3230
|
+
class: B(["ytree-node__expand-icon", {
|
|
3231
|
+
"is-expanded": T(h)
|
|
3203
3232
|
}]),
|
|
3204
|
-
onClick:
|
|
3233
|
+
onClick: J((N) => se(h), ["stop"])
|
|
3205
3234
|
}, [...f[12] || (f[12] = [
|
|
3206
3235
|
n("svg", {
|
|
3207
3236
|
width: "12",
|
|
@@ -3217,18 +3246,18 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3217
3246
|
"stroke-linejoin": "round"
|
|
3218
3247
|
})
|
|
3219
3248
|
], -1)
|
|
3220
|
-
])], 10, eo)) : (
|
|
3221
|
-
t.showCheckbox ? (
|
|
3249
|
+
])], 10, eo)) : (a(), u("span", to)),
|
|
3250
|
+
t.showCheckbox ? (a(), u("span", {
|
|
3222
3251
|
key: 2,
|
|
3223
|
-
class:
|
|
3224
|
-
"is-checked":
|
|
3225
|
-
"is-indeterminate":
|
|
3226
|
-
|
|
3252
|
+
class: B(["ytree-node__checkbox", {
|
|
3253
|
+
"is-checked": L(h),
|
|
3254
|
+
"is-indeterminate": I(
|
|
3255
|
+
h
|
|
3227
3256
|
)
|
|
3228
3257
|
}]),
|
|
3229
|
-
onClick:
|
|
3258
|
+
onClick: J((N) => X(h), ["stop"])
|
|
3230
3259
|
}, [
|
|
3231
|
-
|
|
3260
|
+
L(h) ? (a(), u("svg", lo, [...f[13] || (f[13] = [
|
|
3232
3261
|
n("path", {
|
|
3233
3262
|
d: "M2 6L4.5 8.5L10 3",
|
|
3234
3263
|
stroke: "currentColor",
|
|
@@ -3236,9 +3265,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3236
3265
|
"stroke-linecap": "round",
|
|
3237
3266
|
"stroke-linejoin": "round"
|
|
3238
3267
|
}, null, -1)
|
|
3239
|
-
])])) :
|
|
3240
|
-
|
|
3241
|
-
) ? (
|
|
3268
|
+
])])) : I(
|
|
3269
|
+
h
|
|
3270
|
+
) ? (a(), u("svg", oo, [...f[14] || (f[14] = [
|
|
3242
3271
|
n("path", {
|
|
3243
3272
|
d: "M2 6L10 6",
|
|
3244
3273
|
stroke: "currentColor",
|
|
@@ -3247,26 +3276,26 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3247
3276
|
}, null, -1)
|
|
3248
3277
|
])])) : A("", !0)
|
|
3249
3278
|
], 10, no)) : A("", !0),
|
|
3250
|
-
t.iconClass ? (
|
|
3279
|
+
t.iconClass ? (a(), u("span", {
|
|
3251
3280
|
key: 3,
|
|
3252
|
-
class:
|
|
3281
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3253
3282
|
}, null, 2)) : A("", !0),
|
|
3254
3283
|
n("img", {
|
|
3255
3284
|
class: "ytree-node__avatar",
|
|
3256
|
-
src:
|
|
3257
|
-
alt:
|
|
3285
|
+
src: z(h, g),
|
|
3286
|
+
alt: y(h) ? "person" : "dept"
|
|
3258
3287
|
}, null, 8, so),
|
|
3259
3288
|
n("span", {
|
|
3260
|
-
class:
|
|
3261
|
-
"is-employee":
|
|
3289
|
+
class: B(["ytree-node__label", {
|
|
3290
|
+
"is-employee": y(h)
|
|
3262
3291
|
}])
|
|
3263
|
-
},
|
|
3292
|
+
}, G(w(h)), 3),
|
|
3264
3293
|
n("div", ao, [
|
|
3265
|
-
ue(
|
|
3266
|
-
node:
|
|
3267
|
-
isCurrent:
|
|
3268
|
-
isExpanded:
|
|
3269
|
-
hasChildren:
|
|
3294
|
+
ue(d.$slots, "node-content", {
|
|
3295
|
+
node: h,
|
|
3296
|
+
isCurrent: P(h),
|
|
3297
|
+
isExpanded: T(h),
|
|
3298
|
+
hasChildren: V(h)
|
|
3270
3299
|
}, void 0, !0)
|
|
3271
3300
|
])
|
|
3272
3301
|
], 42, Gl)
|
|
@@ -3294,7 +3323,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3294
3323
|
])
|
|
3295
3324
|
], 2));
|
|
3296
3325
|
}
|
|
3297
|
-
}), co = /* @__PURE__ */ we(uo, [["__scopeId", "data-v-
|
|
3326
|
+
}), co = /* @__PURE__ */ we(uo, [["__scopeId", "data-v-5312b5ca"]]), fo = { class: "query-encapsulation" }, vo = { class: "query-encapsulation__container" }, ho = { class: "query-encapsulation__content" }, po = { class: "query-encapsulation__fields" }, yo = { class: "query-encapsulation__field-wrapper" }, go = { class: "query-encapsulation__field-label" }, mo = {
|
|
3298
3327
|
key: 0,
|
|
3299
3328
|
class: "query-encapsulation__toggle"
|
|
3300
3329
|
}, wo = { class: "query-encapsulation__actions" }, bo = { class: "query-encapsulation__actions-group" }, ko = /* @__PURE__ */ me({
|
|
@@ -3307,9 +3336,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3307
3336
|
},
|
|
3308
3337
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3309
3338
|
setup(t, { emit: b }) {
|
|
3310
|
-
const e = t, l = b,
|
|
3311
|
-
function
|
|
3312
|
-
switch (
|
|
3339
|
+
const e = t, l = b, p = R(!1), i = st({}), C = q(() => e.fields.filter((D) => !D.hidden)), E = q(() => p.value ? C.value : C.value.slice(0, e.maxVisibleFields)), _ = q(() => C.value.length > e.maxVisibleFields);
|
|
3340
|
+
function M(D) {
|
|
3341
|
+
switch (D) {
|
|
3313
3342
|
case "select":
|
|
3314
3343
|
return Je;
|
|
3315
3344
|
case "date":
|
|
@@ -3320,104 +3349,104 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3320
3349
|
return Qe;
|
|
3321
3350
|
}
|
|
3322
3351
|
}
|
|
3323
|
-
function
|
|
3324
|
-
l("field-change",
|
|
3352
|
+
function v(D) {
|
|
3353
|
+
l("field-change", D, i[D.key]), l("update:modelValue", { ...i });
|
|
3325
3354
|
}
|
|
3326
3355
|
function w() {
|
|
3327
|
-
const
|
|
3328
|
-
l("search", { data:
|
|
3329
|
-
}
|
|
3330
|
-
function d() {
|
|
3331
|
-
Object.keys(a).forEach((C) => {
|
|
3332
|
-
const H = e.fields.find((T) => T.key === C);
|
|
3333
|
-
(H == null ? void 0 : H.type) === "daterange" ? a[C] = { startDate: null, endDate: null } : (H == null ? void 0 : H.type) === "date" ? a[C] = null : a[C] = "";
|
|
3334
|
-
}), l("reset"), l("update:modelValue", { ...a });
|
|
3335
|
-
}
|
|
3336
|
-
function L() {
|
|
3337
|
-
v.value = !v.value;
|
|
3356
|
+
const D = V(i), T = U(D);
|
|
3357
|
+
l("search", { data: T });
|
|
3338
3358
|
}
|
|
3339
|
-
function
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3359
|
+
function y() {
|
|
3360
|
+
Object.keys(i).forEach((D) => {
|
|
3361
|
+
const T = e.fields.find((L) => L.key === D);
|
|
3362
|
+
(T == null ? void 0 : T.type) === "daterange" ? i[D] = { startDate: null, endDate: null } : (T == null ? void 0 : T.type) === "date" ? i[D] = null : i[D] = "";
|
|
3363
|
+
}), l("reset"), l("update:modelValue", { ...i });
|
|
3364
|
+
}
|
|
3365
|
+
function z() {
|
|
3366
|
+
p.value = !p.value;
|
|
3367
|
+
}
|
|
3368
|
+
function V(D) {
|
|
3369
|
+
const T = {};
|
|
3370
|
+
return Object.keys(D).forEach((L) => {
|
|
3371
|
+
const I = D[L], P = e.fields.find((X) => X.key === L);
|
|
3372
|
+
I != null && I !== "" && (typeof I == "object" && I.startDate && I.endDate ? I.startDate && I.endDate && (T[L] = I) : P && (P.type === "date" || P.type === "daterange") ? I !== 0 && (T[L] = I) : T[L] = I);
|
|
3373
|
+
}), T;
|
|
3374
|
+
}
|
|
3375
|
+
function U(D) {
|
|
3376
|
+
const T = {};
|
|
3377
|
+
return Object.keys(D).forEach((L) => {
|
|
3378
|
+
const I = D[L], P = e.fields.find((X) => X.key === L);
|
|
3379
|
+
if (P)
|
|
3380
|
+
if (P.type === "daterange" && typeof I == "object") {
|
|
3381
|
+
const X = P.startKey || `${L}Start`, ee = P.endKey || `${L}End`;
|
|
3382
|
+
I.startDate && I.endDate && I.startDate !== 0 && I.endDate !== 0 && (P.format === "timestamp" ? (T[X] = new Date(I.startDate).getTime(), T[ee] = new Date(I.endDate).getTime()) : (T[X] = I.startDate, T[ee] = I.endDate));
|
|
3383
|
+
} else P.type === "date" && I && I !== 0 && P.format === "timestamp" ? T[L] = new Date(I).getTime() : T[L] = I;
|
|
3355
3384
|
else
|
|
3356
|
-
|
|
3357
|
-
}),
|
|
3385
|
+
T[L] = I;
|
|
3386
|
+
}), T;
|
|
3358
3387
|
}
|
|
3359
|
-
function
|
|
3360
|
-
e.fields.forEach((
|
|
3361
|
-
var
|
|
3362
|
-
|
|
3388
|
+
function j() {
|
|
3389
|
+
e.fields.forEach((D) => {
|
|
3390
|
+
var T, L, I;
|
|
3391
|
+
i[D.key] === void 0 && (D.type === "daterange" ? i[D.key] = ((T = e.modelValue) == null ? void 0 : T[D.key]) || {
|
|
3363
3392
|
startDate: null,
|
|
3364
3393
|
endDate: null
|
|
3365
|
-
} :
|
|
3394
|
+
} : D.type === "date" ? i[D.key] = ((L = e.modelValue) == null ? void 0 : L[D.key]) || null : i[D.key] = ((I = e.modelValue) == null ? void 0 : I[D.key]) || "");
|
|
3366
3395
|
});
|
|
3367
3396
|
}
|
|
3368
|
-
return
|
|
3397
|
+
return ne(
|
|
3369
3398
|
() => e.modelValue,
|
|
3370
|
-
(
|
|
3371
|
-
|
|
3399
|
+
(D) => {
|
|
3400
|
+
D && Object.assign(i, D);
|
|
3372
3401
|
},
|
|
3373
3402
|
{ deep: !0, immediate: !0 }
|
|
3374
|
-
),
|
|
3375
|
-
|
|
3376
|
-
}), (
|
|
3403
|
+
), Se(() => {
|
|
3404
|
+
j();
|
|
3405
|
+
}), (D, T) => (a(), u("div", fo, [
|
|
3377
3406
|
n("div", vo, [
|
|
3378
3407
|
n("div", ho, [
|
|
3379
3408
|
n("div", po, [
|
|
3380
|
-
|
|
3409
|
+
fe(at, {
|
|
3381
3410
|
name: "qf",
|
|
3382
3411
|
tag: "div",
|
|
3383
3412
|
class: "query-encapsulation__fields-group"
|
|
3384
3413
|
}, {
|
|
3385
|
-
default:
|
|
3386
|
-
(
|
|
3387
|
-
key:
|
|
3414
|
+
default: pe(() => [
|
|
3415
|
+
(a(!0), u(re, null, he(E.value, (L) => (a(), u("div", {
|
|
3416
|
+
key: L.key,
|
|
3388
3417
|
class: "query-encapsulation__field-item"
|
|
3389
3418
|
}, [
|
|
3390
3419
|
n("div", yo, [
|
|
3391
|
-
n("label", go,
|
|
3392
|
-
(
|
|
3393
|
-
modelValue:
|
|
3394
|
-
"onUpdate:modelValue": (
|
|
3395
|
-
placeholder:
|
|
3396
|
-
options:
|
|
3397
|
-
clearable:
|
|
3398
|
-
size:
|
|
3399
|
-
width:
|
|
3400
|
-
format:
|
|
3401
|
-
"include-time":
|
|
3402
|
-
filterable:
|
|
3403
|
-
onInput: (
|
|
3404
|
-
onChange: (
|
|
3420
|
+
n("label", go, G(L.label), 1),
|
|
3421
|
+
(a(), Ie(it(M(L.type)), {
|
|
3422
|
+
modelValue: i[L.key],
|
|
3423
|
+
"onUpdate:modelValue": (I) => i[L.key] = I,
|
|
3424
|
+
placeholder: L.placeholder || `请输入${L.label}`,
|
|
3425
|
+
options: L.options,
|
|
3426
|
+
clearable: L.clearable !== !1,
|
|
3427
|
+
size: L.size || "small",
|
|
3428
|
+
width: L.width || "180px",
|
|
3429
|
+
format: L.format || "timestamp",
|
|
3430
|
+
"include-time": L.includeTime || !1,
|
|
3431
|
+
filterable: L.filterable === !0,
|
|
3432
|
+
onInput: (I) => v(L),
|
|
3433
|
+
onChange: (I) => v(L)
|
|
3405
3434
|
}, null, 40, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3406
3435
|
])
|
|
3407
3436
|
]))), 128))
|
|
3408
3437
|
]),
|
|
3409
3438
|
_: 1
|
|
3410
3439
|
}),
|
|
3411
|
-
|
|
3412
|
-
|
|
3440
|
+
_.value ? (a(), u("div", mo, [
|
|
3441
|
+
fe(Ae, {
|
|
3413
3442
|
variant: "secondary",
|
|
3414
3443
|
size: "small",
|
|
3415
|
-
onClick:
|
|
3444
|
+
onClick: z
|
|
3416
3445
|
}, {
|
|
3417
|
-
default:
|
|
3418
|
-
Ce(
|
|
3446
|
+
default: pe(() => [
|
|
3447
|
+
Ce(G(p.value ? "收起" : "展开") + " ", 1),
|
|
3419
3448
|
n("span", {
|
|
3420
|
-
class:
|
|
3449
|
+
class: B(["query-encapsulation__toggle-icon", { "is-expanded": p.value }])
|
|
3421
3450
|
}, "▼", 2)
|
|
3422
3451
|
]),
|
|
3423
3452
|
_: 1
|
|
@@ -3425,29 +3454,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3425
3454
|
])) : A("", !0),
|
|
3426
3455
|
n("div", wo, [
|
|
3427
3456
|
n("div", bo, [
|
|
3428
|
-
|
|
3457
|
+
fe(Ae, {
|
|
3429
3458
|
variant: "primary",
|
|
3430
3459
|
size: "small",
|
|
3431
3460
|
onClick: w,
|
|
3432
3461
|
loading: t.loading
|
|
3433
3462
|
}, {
|
|
3434
|
-
default:
|
|
3463
|
+
default: pe(() => [...T[0] || (T[0] = [
|
|
3435
3464
|
Ce(" 搜索 ", -1)
|
|
3436
3465
|
])]),
|
|
3437
3466
|
_: 1
|
|
3438
3467
|
}, 8, ["loading"]),
|
|
3439
|
-
|
|
3468
|
+
fe(Ae, {
|
|
3440
3469
|
variant: "secondary",
|
|
3441
3470
|
size: "small",
|
|
3442
|
-
onClick:
|
|
3471
|
+
onClick: y,
|
|
3443
3472
|
loading: t.loading
|
|
3444
3473
|
}, {
|
|
3445
|
-
default:
|
|
3474
|
+
default: pe(() => [...T[1] || (T[1] = [
|
|
3446
3475
|
Ce(" 重置 ", -1)
|
|
3447
3476
|
])]),
|
|
3448
3477
|
_: 1
|
|
3449
3478
|
}, 8, ["loading"]),
|
|
3450
|
-
ue(
|
|
3479
|
+
ue(D.$slots, "extra-actions", {}, void 0, !0)
|
|
3451
3480
|
])
|
|
3452
3481
|
])
|
|
3453
3482
|
])
|
|
@@ -3476,7 +3505,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3476
3505
|
height: "16",
|
|
3477
3506
|
viewBox: "0 0 24 24",
|
|
3478
3507
|
fill: "none"
|
|
3479
|
-
}, So = ["textContent"],
|
|
3508
|
+
}, So = ["textContent"], Lo = /* @__PURE__ */ me({
|
|
3480
3509
|
__name: "ymessageToast",
|
|
3481
3510
|
props: {
|
|
3482
3511
|
id: {},
|
|
@@ -3489,35 +3518,35 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3489
3518
|
onClose: {}
|
|
3490
3519
|
},
|
|
3491
3520
|
setup(t) {
|
|
3492
|
-
const b = t, e =
|
|
3521
|
+
const b = t, e = R(!1);
|
|
3493
3522
|
let l;
|
|
3494
|
-
|
|
3523
|
+
Se(() => {
|
|
3495
3524
|
requestAnimationFrame(() => {
|
|
3496
|
-
e.value = !0, b.duration && b.duration > 0 && (l = window.setTimeout(() =>
|
|
3525
|
+
e.value = !0, b.duration && b.duration > 0 && (l = window.setTimeout(() => p(), b.duration));
|
|
3497
3526
|
});
|
|
3498
3527
|
}), rt(() => {
|
|
3499
3528
|
l && window.clearTimeout(l);
|
|
3500
3529
|
});
|
|
3501
|
-
function
|
|
3530
|
+
function p() {
|
|
3502
3531
|
e.value = !1;
|
|
3503
3532
|
}
|
|
3504
|
-
function
|
|
3505
|
-
var
|
|
3506
|
-
(
|
|
3533
|
+
function i() {
|
|
3534
|
+
var C;
|
|
3535
|
+
(C = b.onClose) == null || C.call(b, b.id);
|
|
3507
3536
|
}
|
|
3508
|
-
return (
|
|
3537
|
+
return (C, E) => (a(), Ie(ke, {
|
|
3509
3538
|
name: "y-msg-fade",
|
|
3510
|
-
onAfterLeave:
|
|
3539
|
+
onAfterLeave: i
|
|
3511
3540
|
}, {
|
|
3512
|
-
default:
|
|
3541
|
+
default: pe(() => [
|
|
3513
3542
|
Be(n("div", {
|
|
3514
|
-
class:
|
|
3515
|
-
style:
|
|
3543
|
+
class: B(["y-msg", [`y-msg--${t.type}`]]),
|
|
3544
|
+
style: ge({ zIndex: t.zIndex }),
|
|
3516
3545
|
role: "status",
|
|
3517
3546
|
"aria-live": "polite"
|
|
3518
3547
|
}, [
|
|
3519
3548
|
n("span", Co, [
|
|
3520
|
-
t.type === "success" ? (
|
|
3549
|
+
t.type === "success" ? (a(), u("svg", Do, [...E[0] || (E[0] = [
|
|
3521
3550
|
n("path", {
|
|
3522
3551
|
d: "M20 6L9 17l-5-5",
|
|
3523
3552
|
stroke: "currentColor",
|
|
@@ -3525,7 +3554,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3525
3554
|
"stroke-linecap": "round",
|
|
3526
3555
|
"stroke-linejoin": "round"
|
|
3527
3556
|
}, null, -1)
|
|
3528
|
-
])])) : t.type === "warning" ? (
|
|
3557
|
+
])])) : t.type === "warning" ? (a(), u("svg", $o, [...E[1] || (E[1] = [
|
|
3529
3558
|
n("path", {
|
|
3530
3559
|
d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",
|
|
3531
3560
|
stroke: "currentColor",
|
|
@@ -3533,7 +3562,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3533
3562
|
"stroke-linecap": "round",
|
|
3534
3563
|
"stroke-linejoin": "round"
|
|
3535
3564
|
}, null, -1)
|
|
3536
|
-
])])) : (
|
|
3565
|
+
])])) : (a(), u("svg", _o, [...E[2] || (E[2] = [
|
|
3537
3566
|
n("path", {
|
|
3538
3567
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3539
3568
|
stroke: "currentColor",
|
|
@@ -3545,22 +3574,22 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3545
3574
|
]),
|
|
3546
3575
|
n("div", {
|
|
3547
3576
|
class: "y-msg__content",
|
|
3548
|
-
textContent:
|
|
3577
|
+
textContent: G(t.message)
|
|
3549
3578
|
}, null, 8, So),
|
|
3550
|
-
t.closable ? (
|
|
3579
|
+
t.closable ? (a(), u("button", {
|
|
3551
3580
|
key: 0,
|
|
3552
3581
|
class: "y-msg__close",
|
|
3553
3582
|
type: "button",
|
|
3554
|
-
onClick:
|
|
3583
|
+
onClick: p
|
|
3555
3584
|
}, "✕")) : A("", !0)
|
|
3556
3585
|
], 6), [
|
|
3557
|
-
[
|
|
3586
|
+
[Ke, e.value]
|
|
3558
3587
|
])
|
|
3559
3588
|
]),
|
|
3560
3589
|
_: 1
|
|
3561
3590
|
}));
|
|
3562
3591
|
}
|
|
3563
|
-
}),
|
|
3592
|
+
}), Mo = /* @__PURE__ */ we(Lo, [["__scopeId", "data-v-ceac9e81"]]);
|
|
3564
3593
|
let Io = 1;
|
|
3565
3594
|
const je = 12, Me = [];
|
|
3566
3595
|
function Bo() {
|
|
@@ -3570,24 +3599,24 @@ function Bo() {
|
|
|
3570
3599
|
}), t;
|
|
3571
3600
|
}
|
|
3572
3601
|
function qe(t) {
|
|
3573
|
-
const b = Me.findIndex((
|
|
3602
|
+
const b = Me.findIndex((i) => i.id === t);
|
|
3574
3603
|
if (b === -1) return;
|
|
3575
3604
|
const { el: e } = Me[b], l = e.firstElementChild;
|
|
3576
3605
|
if (l) {
|
|
3577
|
-
const
|
|
3578
|
-
l.style.top =
|
|
3606
|
+
const i = window.getComputedStyle(l).top;
|
|
3607
|
+
l.style.top = i, l.classList.add("is-leaving"), l.style.willChange = "opacity, transform";
|
|
3579
3608
|
}
|
|
3580
|
-
Me[b].leaving = !0,
|
|
3609
|
+
Me[b].leaving = !0, Fe(), setTimeout(() => {
|
|
3581
3610
|
Ze(null, e), e.parentNode && e.parentNode.removeChild(e);
|
|
3582
|
-
const
|
|
3583
|
-
|
|
3611
|
+
const i = Me.findIndex((C) => C.id === t);
|
|
3612
|
+
i !== -1 && Me.splice(i, 1), Fe();
|
|
3584
3613
|
}, 260);
|
|
3585
3614
|
}
|
|
3586
3615
|
function We(t) {
|
|
3587
|
-
var
|
|
3616
|
+
var i;
|
|
3588
3617
|
const b = Io++, e = document.createElement("div");
|
|
3589
3618
|
document.body.appendChild(e);
|
|
3590
|
-
const l =
|
|
3619
|
+
const l = fe(Mo, {
|
|
3591
3620
|
id: b,
|
|
3592
3621
|
type: t.type || "success",
|
|
3593
3622
|
message: t.message,
|
|
@@ -3595,18 +3624,18 @@ function We(t) {
|
|
|
3595
3624
|
offset: Bo(),
|
|
3596
3625
|
zIndex: 3e3 + b,
|
|
3597
3626
|
closable: t.closable ?? !1,
|
|
3598
|
-
onClose: (
|
|
3627
|
+
onClose: (C) => qe(C)
|
|
3599
3628
|
});
|
|
3600
3629
|
Ze(l, e);
|
|
3601
|
-
const
|
|
3602
|
-
return Me.push({ id: b, el: e, vm: l, height:
|
|
3603
|
-
const
|
|
3604
|
-
if (
|
|
3605
|
-
const E =
|
|
3606
|
-
|
|
3630
|
+
const p = ((i = e.firstElementChild) == null ? void 0 : i.offsetHeight) || 0;
|
|
3631
|
+
return Me.push({ id: b, el: e, vm: l, height: p, leaving: !1 }), Fe(), requestAnimationFrame(() => {
|
|
3632
|
+
const C = e.firstElementChild;
|
|
3633
|
+
if (!C) return;
|
|
3634
|
+
const E = C.offsetHeight || p || 0, _ = Me.find((M) => M.id === b);
|
|
3635
|
+
_ && (_.height = E, Fe());
|
|
3607
3636
|
}), { close: () => qe(b) };
|
|
3608
3637
|
}
|
|
3609
|
-
const
|
|
3638
|
+
const Ye = {
|
|
3610
3639
|
success(t, b = {}) {
|
|
3611
3640
|
return We({ ...b, type: "success", message: t });
|
|
3612
3641
|
},
|
|
@@ -3617,8 +3646,8 @@ const Fe = {
|
|
|
3617
3646
|
return We({ ...b, type: "error", message: t });
|
|
3618
3647
|
}
|
|
3619
3648
|
};
|
|
3620
|
-
typeof window < "u" && (window.YMessage =
|
|
3621
|
-
function
|
|
3649
|
+
typeof window < "u" && (window.YMessage = Ye, typeof globalThis.YMessage > "u" && (globalThis.YMessage = Ye));
|
|
3650
|
+
function Fe() {
|
|
3622
3651
|
let t = 20;
|
|
3623
3652
|
Me.forEach((b) => {
|
|
3624
3653
|
const e = b.el.firstElementChild;
|
|
@@ -3627,8 +3656,8 @@ function Ne() {
|
|
|
3627
3656
|
if (e.style.transform = `translate(-50%, ${l}px)`, e.style.top || (e.style.top = "0px"), !b.leaving)
|
|
3628
3657
|
t += (e.offsetHeight || b.height) + je;
|
|
3629
3658
|
else {
|
|
3630
|
-
const
|
|
3631
|
-
t +=
|
|
3659
|
+
const p = e.offsetHeight || b.height;
|
|
3660
|
+
t += p + je;
|
|
3632
3661
|
}
|
|
3633
3662
|
});
|
|
3634
3663
|
}
|
|
@@ -3652,7 +3681,7 @@ const Ue = {
|
|
|
3652
3681
|
install(t) {
|
|
3653
3682
|
Object.keys(Ue).forEach((b) => {
|
|
3654
3683
|
t.component(b, Ue[b]);
|
|
3655
|
-
}), t.config.globalProperties.$message =
|
|
3684
|
+
}), t.config.globalProperties.$message = Ye, typeof window < "u" && (window.YMessage = Ye);
|
|
3656
3685
|
}
|
|
3657
3686
|
};
|
|
3658
3687
|
export {
|
|
@@ -3664,7 +3693,7 @@ export {
|
|
|
3664
3693
|
il as YDropdown,
|
|
3665
3694
|
sl as YImage,
|
|
3666
3695
|
Qe as YInput,
|
|
3667
|
-
|
|
3696
|
+
Ye as YMessage,
|
|
3668
3697
|
jt as YPagination,
|
|
3669
3698
|
gn as YPopover,
|
|
3670
3699
|
Je as YSelect,
|