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