@nhdropshipping/y-components 1.0.57 → 1.0.59
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/hintTag.vue.d.ts +57 -0
- package/dist/components/hintTag.vue.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1192 -1107
- 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
|
|
1
|
+
import { defineComponent as ke, computed as j, createElementBlock as r, openBlock as s, normalizeClass as B, createElementVNode as l, renderSlot as fe, Fragment as pe, renderList as me, createCommentVNode as W, toDisplayString as oe, ref as K, watch as re, normalizeStyle as ce, withKeys as Ce, nextTick as de, onMounted as Me, onUnmounted as He, resolveComponent as Ve, createVNode as ve, Transition as _e, withCtx as ye, createTextVNode as Se, createBlock as Te, withModifiers as G, withDirectives as Le, vModelText as ut, Teleport as Fe, vShow as Be, provide as dt, reactive as ct, onBeforeUnmount as lt, TransitionGroup as ft, resolveDynamicComponent as vt, mergeProps as ht, toHandlers as pt, render as ot } from "vue";
|
|
2
2
|
const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "content" }, mt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -15,7 +15,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
15
15
|
viewBox: "0 0 20 20",
|
|
16
16
|
fill: "currentColor",
|
|
17
17
|
"aria-hidden": "true"
|
|
18
|
-
}, $t = { key: 2 }, Dt = /* @__PURE__ */
|
|
18
|
+
}, $t = { key: 2 }, Dt = /* @__PURE__ */ ke({
|
|
19
19
|
__name: "ybutton",
|
|
20
20
|
props: {
|
|
21
21
|
htmlType: { default: "button" },
|
|
@@ -28,8 +28,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
28
28
|
groupItems: { default: void 0 }
|
|
29
29
|
},
|
|
30
30
|
emits: ["click", "group-click"],
|
|
31
|
-
setup(t, { emit:
|
|
32
|
-
const e = t, n =
|
|
31
|
+
setup(t, { emit: w }) {
|
|
32
|
+
const e = t, n = w;
|
|
33
33
|
function m(x) {
|
|
34
34
|
if (e.disabled || e.loading) {
|
|
35
35
|
x.preventDefault(), x.stopPropagation();
|
|
@@ -48,24 +48,24 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
52
|
-
function S(x,
|
|
51
|
+
}), v = j(() => Array.isArray(e.groupItems) && e.groupItems.length > 0);
|
|
52
|
+
function S(x, H) {
|
|
53
53
|
if (e.disabled || e.loading || x.disabled || x.loading) {
|
|
54
|
-
|
|
54
|
+
H.preventDefault(), H.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
n("group-click", x.value,
|
|
57
|
+
n("group-click", x.value, H);
|
|
58
58
|
}
|
|
59
|
-
return (x,
|
|
60
|
-
(s(!0), r(
|
|
61
|
-
var
|
|
59
|
+
return (x, H) => v.value ? (s(), r("div", mt, [
|
|
60
|
+
(s(!0), r(pe, null, me(t.groupItems, ($, b) => {
|
|
61
|
+
var c;
|
|
62
62
|
return s(), r("button", {
|
|
63
|
-
key: $.value ??
|
|
64
|
-
class:
|
|
63
|
+
key: $.value ?? b,
|
|
64
|
+
class: B(["y-btn", [
|
|
65
65
|
`y-btn--${$.variant ?? t.variant}`,
|
|
66
66
|
`y-btn--${$.size ?? t.size}`,
|
|
67
67
|
"is-grouped",
|
|
68
|
-
|
|
68
|
+
b === 0 ? "group-pos-start" : b === (((c = t.groupItems) == null ? void 0 : c.length) || 0) - 1 ? "group-pos-end" : "group-pos-middle",
|
|
69
69
|
{ "is-loading": $.loading || t.loading }
|
|
70
70
|
]]),
|
|
71
71
|
type: t.htmlType,
|
|
@@ -76,26 +76,26 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
76
76
|
onClick: (D) => S($, D)
|
|
77
77
|
}, [
|
|
78
78
|
l("span", bt, [
|
|
79
|
-
$.icon === "chevron-left" ? (s(), r("svg", kt, [...
|
|
79
|
+
$.icon === "chevron-left" ? (s(), r("svg", kt, [...H[0] || (H[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
|
-
])])) : $.icon === "chevron-right" ? (s(), r("svg", xt, [...
|
|
85
|
+
])])) : $.icon === "chevron-right" ? (s(), r("svg", xt, [...H[1] || (H[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
91
|
])])) : W("", !0),
|
|
92
|
-
$.label && !$.onlyIcon ? (s(), r("span", $t,
|
|
92
|
+
$.label && !$.onlyIcon ? (s(), r("span", $t, oe($.label), 1)) : W("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, wt);
|
|
95
95
|
}), 128))
|
|
96
96
|
])) : (s(), r("button", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class:
|
|
98
|
+
class: B(["y-btn", [
|
|
99
99
|
`y-btn--${t.variant}`,
|
|
100
100
|
`y-btn--${t.size}`,
|
|
101
101
|
{ "is-block": t.block, "is-loading": t.loading },
|
|
@@ -113,12 +113,12 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
113
113
|
])
|
|
114
114
|
], 10, yt));
|
|
115
115
|
}
|
|
116
|
-
}),
|
|
116
|
+
}), xe = (t, w) => {
|
|
117
117
|
const e = t.__vccOpts || t;
|
|
118
|
-
for (const [n, m] of
|
|
118
|
+
for (const [n, m] of w)
|
|
119
119
|
e[n] = m;
|
|
120
120
|
return e;
|
|
121
|
-
}, je = /* @__PURE__ */
|
|
121
|
+
}, je = /* @__PURE__ */ xe(Dt, [["__scopeId", "data-v-53157673"]]), Ct = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "min", "max", "disabled", "required", "value"], _t = /* @__PURE__ */ ke({
|
|
122
122
|
__name: "yinput",
|
|
123
123
|
props: {
|
|
124
124
|
modelValue: { default: "" },
|
|
@@ -138,26 +138,26 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
138
138
|
clearOnFocus: { type: Boolean, default: !1 }
|
|
139
139
|
},
|
|
140
140
|
emits: ["update:modelValue", "enter", "paste"],
|
|
141
|
-
setup(t, { emit:
|
|
142
|
-
const e = t, n =
|
|
143
|
-
|
|
141
|
+
setup(t, { emit: w }) {
|
|
142
|
+
const e = t, n = w, m = K(null), f = K(""), v = K(!1), S = K(!1), x = K(e.placeholder || "");
|
|
143
|
+
re(() => e.placeholder, (A) => {
|
|
144
144
|
S.value || (x.value = A || "");
|
|
145
145
|
});
|
|
146
|
-
function
|
|
146
|
+
function H(A) {
|
|
147
147
|
const P = A.target;
|
|
148
|
-
|
|
148
|
+
v.value = !0, n("update:modelValue", P.value);
|
|
149
149
|
}
|
|
150
150
|
function $() {
|
|
151
|
-
S.value = !0, e.clearOnFocus && (f.value = e.modelValue || "",
|
|
151
|
+
S.value = !0, e.clearOnFocus && (f.value = e.modelValue || "", v.value = !1, x.value = f.value || e.placeholder || "", n("update:modelValue", ""));
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (S.value = !1, e.clearOnFocus && !
|
|
153
|
+
function b() {
|
|
154
|
+
if (S.value = !1, e.clearOnFocus && !v.value && (!e.modelValue || e.modelValue === "") && n("update:modelValue", f.value), e.min !== void 0 && e.modelValue !== void 0 && e.modelValue !== "") {
|
|
155
155
|
const A = Number(e.modelValue), P = Number(e.min);
|
|
156
156
|
!Number.isNaN(A) && !Number.isNaN(P) && A < P && n("update:modelValue", String(P));
|
|
157
157
|
}
|
|
158
158
|
x.value = e.placeholder || "";
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function c(A) {
|
|
161
161
|
const P = A.target;
|
|
162
162
|
n("enter", P.value);
|
|
163
163
|
}
|
|
@@ -168,13 +168,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
return (A, P) => (s(), r("div", {
|
|
171
|
-
class:
|
|
172
|
-
style:
|
|
171
|
+
class: B(["y-input-wrap", { "is-block": t.block }]),
|
|
172
|
+
style: ce({ width: t.width })
|
|
173
173
|
}, [
|
|
174
174
|
l("input", {
|
|
175
175
|
ref_key: "inputRef",
|
|
176
176
|
ref: m,
|
|
177
|
-
class:
|
|
177
|
+
class: B(["y-input", `y-input--${t.size}`]),
|
|
178
178
|
id: t.id,
|
|
179
179
|
name: t.name,
|
|
180
180
|
type: t.type,
|
|
@@ -186,18 +186,18 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
186
186
|
disabled: t.disabled,
|
|
187
187
|
required: t.required,
|
|
188
188
|
value: t.modelValue,
|
|
189
|
-
onInput:
|
|
189
|
+
onInput: H,
|
|
190
190
|
onFocus: $,
|
|
191
|
-
onBlur:
|
|
192
|
-
onKeyup: Ce(
|
|
191
|
+
onBlur: b,
|
|
192
|
+
onKeyup: Ce(c, ["enter"]),
|
|
193
193
|
onPaste: D
|
|
194
194
|
}, null, 42, Ct)
|
|
195
195
|
], 6));
|
|
196
196
|
}
|
|
197
|
-
}), at = /* @__PURE__ */
|
|
197
|
+
}), at = /* @__PURE__ */ xe(_t, [["__scopeId", "data-v-c4912c99"]]), St = {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "bulk-bar"
|
|
200
|
-
}, Mt = { class: "bulk-left" },
|
|
200
|
+
}, Mt = { class: "bulk-left" }, Lt = { class: "bulk-actions" }, It = { class: "card" }, Et = { class: "table" }, Bt = {
|
|
201
201
|
key: 0,
|
|
202
202
|
style: { width: "34px", "min-width": "34px" }
|
|
203
203
|
}, Tt = {
|
|
@@ -224,7 +224,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
224
224
|
}, Ft = ["onClick"], Pt = {
|
|
225
225
|
key: 0,
|
|
226
226
|
class: "col-expand"
|
|
227
|
-
}, Nt = ["onClick"], Yt = ["value", "checked", "disabled", "onChange"], Ot = ["colspan"], jt = /* @__PURE__ */
|
|
227
|
+
}, Nt = ["onClick"], Yt = ["value", "checked", "disabled", "onChange"], Ot = ["colspan"], jt = /* @__PURE__ */ ke({
|
|
228
228
|
__name: "ytable",
|
|
229
229
|
props: {
|
|
230
230
|
data: {},
|
|
@@ -254,8 +254,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
254
254
|
requireDeselectBeforeSelect: { type: Boolean, default: !0 }
|
|
255
255
|
},
|
|
256
256
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change", "row-click"],
|
|
257
|
-
setup(t, { emit:
|
|
258
|
-
const e = t, n =
|
|
257
|
+
setup(t, { emit: w }) {
|
|
258
|
+
const e = t, n = w, m = K(e.currentPage || 1), f = K(e.pageSize), v = K(e.selectedItems || []), S = K(null), x = K(/* @__PURE__ */ new Set()), H = K("none"), $ = K(), b = K(), c = K(), D = K(), A = K([]), P = K({}), O = j(
|
|
259
259
|
() => e.columns.filter((u) => !F(u.width)).map((u) => u.key)
|
|
260
260
|
);
|
|
261
261
|
function V() {
|
|
@@ -266,7 +266,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
266
266
|
thumbHeight: 40,
|
|
267
267
|
thumbTop: 0
|
|
268
268
|
});
|
|
269
|
-
let
|
|
269
|
+
let ae = !1, ee = 0, he = 0;
|
|
270
270
|
const E = K(0);
|
|
271
271
|
function F(u) {
|
|
272
272
|
if (u == null) return;
|
|
@@ -276,7 +276,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
276
276
|
if (g)
|
|
277
277
|
return /^\d+(\.\d+)?$/.test(g) ? `${g}px` : g;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function T(u) {
|
|
280
280
|
const g = F(u);
|
|
281
281
|
if (!g) return null;
|
|
282
282
|
const _ = parseFloat(g);
|
|
@@ -285,126 +285,126 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
285
285
|
const N = j(() => {
|
|
286
286
|
let u = e.columns.length;
|
|
287
287
|
return e.selectable && (u += 1), e.expandable && (u += 1), u;
|
|
288
|
-
}),
|
|
288
|
+
}), se = j(() => {
|
|
289
289
|
if (!e.searchKeyword || !e.searchFields.length)
|
|
290
290
|
return e.data;
|
|
291
291
|
const u = e.searchKeyword.toLowerCase();
|
|
292
292
|
return e.data.filter((g) => e.searchFields.some((_) => {
|
|
293
|
-
const
|
|
294
|
-
return String(
|
|
293
|
+
const L = z(g, _);
|
|
294
|
+
return String(L).toLowerCase().includes(u);
|
|
295
295
|
}));
|
|
296
|
-
}), q = j(() => (e.pagination,
|
|
296
|
+
}), q = j(() => (e.pagination, se.value)), ge = j(() => {
|
|
297
297
|
if (!e.selectable) return !1;
|
|
298
|
-
const u = q.value.map((g, _) => ({ key: a(g, _), item: g, index: _ })).filter(({ item: g, index: _ }) => !
|
|
299
|
-
return u.length > 0 && u.every((g) =>
|
|
298
|
+
const u = q.value.map((g, _) => ({ key: a(g, _), item: g, index: _ })).filter(({ item: g, index: _ }) => !d(g, _)).map(({ key: g }) => g);
|
|
299
|
+
return u.length > 0 && u.every((g) => v.value.includes(g));
|
|
300
300
|
}), U = j(() => {
|
|
301
301
|
if (!e.selectable) return !1;
|
|
302
302
|
const u = q.value.map((g, _) => ({ item: g, index: _ }));
|
|
303
|
-
return u.length > 0 && u.every(({ item: g, index: _ }) =>
|
|
303
|
+
return u.length > 0 && u.every(({ item: g, index: _ }) => d(g, _));
|
|
304
304
|
}), te = j(() => e.pagination ? q.value.length < f.value : !1), p = j(() => {
|
|
305
305
|
const u = [];
|
|
306
306
|
let g = e.selectable ? 60 : 0;
|
|
307
307
|
for (let _ = 0; _ < e.columns.length; _++) {
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
308
|
+
const L = e.columns[_];
|
|
309
|
+
if (L.fixed === "left") {
|
|
310
310
|
let C = 80;
|
|
311
|
-
const
|
|
312
|
-
|
|
311
|
+
const R = T(L.width);
|
|
312
|
+
R !== null ? C = R : A.value[_] && (C = T(A.value[_]) ?? C), u.push(g), g += C;
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
return u;
|
|
316
|
-
}),
|
|
316
|
+
}), h = j(() => {
|
|
317
317
|
const u = [];
|
|
318
318
|
let g = 0;
|
|
319
319
|
const _ = [];
|
|
320
|
-
for (let
|
|
321
|
-
const C = e.columns[
|
|
320
|
+
for (let L = e.columns.length - 1; L >= 0; L--) {
|
|
321
|
+
const C = e.columns[L];
|
|
322
322
|
if (C.fixed === "right") {
|
|
323
|
-
let
|
|
324
|
-
const X =
|
|
325
|
-
X !== null ?
|
|
323
|
+
let R = 80;
|
|
324
|
+
const X = T(C.width);
|
|
325
|
+
X !== null ? R = X : A.value[L] && (R = T(A.value[L]) ?? R), _.push({ index: L, width: R });
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
for (let
|
|
329
|
-
u.push(g), g += _[
|
|
328
|
+
for (let L = 0; L < _.length; L++)
|
|
329
|
+
u.push(g), g += _[L].width;
|
|
330
330
|
return u;
|
|
331
331
|
});
|
|
332
332
|
function o(u, g) {
|
|
333
333
|
if (g === "left") {
|
|
334
334
|
let _ = 0;
|
|
335
|
-
for (let
|
|
336
|
-
e.columns[
|
|
335
|
+
for (let L = 0; L < u; L++)
|
|
336
|
+
e.columns[L].fixed === "left" && _++;
|
|
337
337
|
return _;
|
|
338
338
|
} else {
|
|
339
339
|
let _ = 0;
|
|
340
|
-
for (let
|
|
341
|
-
e.columns[
|
|
340
|
+
for (let L = e.columns.length - 1; L > u; L--)
|
|
341
|
+
e.columns[L].fixed === "right" && _++;
|
|
342
342
|
return _;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
function a(u, g) {
|
|
346
346
|
return typeof e.rowKey == "function" ? e.rowKey(u) : u[e.rowKey] || g;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function d(u, g) {
|
|
349
349
|
return e.rowDisabled && typeof e.rowDisabled == "function" ? e.rowDisabled(u, g) : !1;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function k(u) {
|
|
352
352
|
return x.value.has(u);
|
|
353
353
|
}
|
|
354
354
|
function M(u) {
|
|
355
355
|
x.value.has(u) ? x.value.delete(u) : x.value.add(u);
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
return g.split(".").reduce((_,
|
|
357
|
+
function z(u, g) {
|
|
358
|
+
return g.split(".").reduce((_, L) => _ == null ? void 0 : _[L], u);
|
|
359
359
|
}
|
|
360
360
|
function Y(u, g = !1) {
|
|
361
361
|
const _ = [];
|
|
362
362
|
return u.align && _.push(`text-${u.align}`), u.fixed === "right" && (_.push("col-fixed-right"), g && _.push("col-fixed-right-header")), u.fixed === "left" && (_.push("col-fixed-left"), g && _.push("col-fixed-left-header")), _.join(" ");
|
|
363
363
|
}
|
|
364
364
|
function ne(u, g, _) {
|
|
365
|
-
const
|
|
365
|
+
const L = {}, C = F(u.width);
|
|
366
366
|
if (C)
|
|
367
|
-
|
|
367
|
+
L.width = C, L.minWidth = C, L.maxWidth = C;
|
|
368
368
|
else {
|
|
369
|
-
const
|
|
370
|
-
|
|
369
|
+
const R = V();
|
|
370
|
+
L.width = R, L.minWidth = R, L.maxWidth = R;
|
|
371
371
|
}
|
|
372
372
|
if (u.fixed === "left") {
|
|
373
|
-
const
|
|
374
|
-
|
|
373
|
+
const R = o(g, "left"), X = p.value[R] || 0;
|
|
374
|
+
L.left = `${X}px`, L.zIndex = _ ? `${10 + R}` : `${5 + R}`;
|
|
375
375
|
} else if (u.fixed === "right") {
|
|
376
|
-
const
|
|
377
|
-
_ ?
|
|
376
|
+
const R = o(g, "right"), X = h.value[R] || 0;
|
|
377
|
+
_ ? L.right = `${X - 3}px` : L.right = `${X}px`, L.zIndex = _ ? `${10 + R}` : `${5 + R}`;
|
|
378
378
|
}
|
|
379
|
-
return
|
|
379
|
+
return L;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
const _ =
|
|
381
|
+
function $e(u, g) {
|
|
382
|
+
const _ = z(u, g.key);
|
|
383
383
|
return g.formatter ? g.formatter(_, u) : _ || "";
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
const g = q.value.find((
|
|
387
|
-
g && _ >= 0 &&
|
|
385
|
+
function Ke(u) {
|
|
386
|
+
const g = q.value.find((L, C) => a(L, C) === u), _ = q.value.findIndex((L, C) => a(L, C) === u);
|
|
387
|
+
g && _ >= 0 && d(g, _) || (v.value.includes(u) ? v.value = v.value.filter((L) => L !== u) : v.value = [...v.value, u], n("select", v.value), n("update:selectedItems", v.value));
|
|
388
388
|
}
|
|
389
389
|
function We() {
|
|
390
|
-
const u = q.value.map((g, _) => ({ key: a(g, _), item: g, index: _ })).filter(({ item: g, index: _ }) => !
|
|
390
|
+
const u = q.value.map((g, _) => ({ key: a(g, _), item: g, index: _ })).filter(({ item: g, index: _ }) => !d(g, _)).map(({ key: g }) => g);
|
|
391
391
|
if (u.length !== 0) {
|
|
392
|
-
if (u.every((g) =>
|
|
393
|
-
|
|
392
|
+
if (u.every((g) => v.value.includes(g)))
|
|
393
|
+
v.value = v.value.filter((g) => !u.includes(g));
|
|
394
394
|
else {
|
|
395
|
-
const g = /* @__PURE__ */ new Set([...
|
|
396
|
-
|
|
395
|
+
const g = /* @__PURE__ */ new Set([...v.value, ...u]);
|
|
396
|
+
v.value = Array.from(g);
|
|
397
397
|
}
|
|
398
|
-
n("select",
|
|
398
|
+
n("select", v.value), n("update:selectedItems", v.value);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
function Pe() {
|
|
402
|
-
|
|
402
|
+
v.value = [], n("select", v.value), n("update:selectedItems", v.value);
|
|
403
403
|
}
|
|
404
404
|
function Ze(u, g) {
|
|
405
405
|
if (!e.rowSelectable) return;
|
|
406
406
|
const _ = a(u, g);
|
|
407
|
-
if (!
|
|
407
|
+
if (!d(u, g))
|
|
408
408
|
if (S.value === _)
|
|
409
409
|
S.value = null, n("row-click", u, null);
|
|
410
410
|
else if (e.requireDeselectBeforeSelect) {
|
|
@@ -419,14 +419,14 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
419
419
|
const _ = a(u, g);
|
|
420
420
|
return S.value === _;
|
|
421
421
|
}
|
|
422
|
-
|
|
422
|
+
re(() => e.selectedItems, (u) => {
|
|
423
423
|
if (u !== void 0 && Array.isArray(u)) {
|
|
424
|
-
const g = new Set(
|
|
425
|
-
(g.size !== _.size || ![...g].every((
|
|
426
|
-
} else u === void 0 &&
|
|
427
|
-
}, { deep: !0, immediate: !0 }),
|
|
424
|
+
const g = new Set(v.value), _ = new Set(u);
|
|
425
|
+
(g.size !== _.size || ![...g].every((L) => _.has(L))) && (v.value = [...u]);
|
|
426
|
+
} else u === void 0 && v.value.length > 0 && (v.value = []);
|
|
427
|
+
}, { deep: !0, immediate: !0 }), re(() => e.searchKeyword, () => {
|
|
428
428
|
m.value = 1;
|
|
429
|
-
}),
|
|
429
|
+
}), re(() => e.data, () => {
|
|
430
430
|
e.total || (m.value = 1), e.rowSelectable && (S.value = null);
|
|
431
431
|
}, { deep: !0 });
|
|
432
432
|
function Je(u) {
|
|
@@ -435,64 +435,64 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
435
435
|
function Ne(u) {
|
|
436
436
|
f.value = u, m.value = 1, e.rowSelectable && (S.value = null), n("page-size-change", u);
|
|
437
437
|
}
|
|
438
|
-
|
|
438
|
+
re(() => e.currentPage, (u) => {
|
|
439
439
|
const g = typeof u == "number" && u > 0 ? u : 1;
|
|
440
440
|
m.value !== g && (m.value = g);
|
|
441
|
-
}),
|
|
441
|
+
}), re(() => e.pageSize, (u) => {
|
|
442
442
|
const g = typeof u == "number" && u > 0 ? u : 10;
|
|
443
443
|
f.value !== g && (f.value = g);
|
|
444
444
|
});
|
|
445
|
-
function
|
|
446
|
-
$.value &&
|
|
447
|
-
const u = $.value.getBoundingClientRect(), g = window.innerHeight, _ = u.top,
|
|
448
|
-
et && (et.offsetHeight > Oe ?
|
|
445
|
+
function Re() {
|
|
446
|
+
$.value && de(() => {
|
|
447
|
+
const u = $.value.getBoundingClientRect(), g = window.innerHeight, _ = u.top, L = $.value.querySelector(".table-header"), C = L ? L.offsetHeight : 40, R = $.value.querySelector(".ypagination"), X = R ? R.offsetHeight : 60, be = $.value.querySelector(".bulk-bar"), De = be ? be.offsetHeight : 0, Ye = C + X + De + 20, Oe = g - _ - Ye, rt = Math.max(200, Oe), et = $.value.querySelector(".table-body-wrap .table");
|
|
448
|
+
et && (et.offsetHeight > Oe ? H.value = `${rt}px` : H.value = "none");
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
451
|
let Ie = !1;
|
|
452
|
-
function
|
|
453
|
-
!
|
|
452
|
+
function ze() {
|
|
453
|
+
!b.value || !c.value || Ie || b.value.scrollLeft !== c.value.scrollLeft && (Ie = !0, b.value.scrollLeft = c.value.scrollLeft, requestAnimationFrame(() => {
|
|
454
454
|
Ie = !1;
|
|
455
455
|
}));
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
!
|
|
457
|
+
function Ae() {
|
|
458
|
+
!b.value || !c.value || Ie || c.value.scrollLeft !== b.value.scrollLeft && (Ie = !0, c.value.scrollLeft = b.value.scrollLeft, requestAnimationFrame(() => {
|
|
459
459
|
Ie = !1;
|
|
460
460
|
}));
|
|
461
461
|
}
|
|
462
462
|
function i() {
|
|
463
|
-
|
|
464
|
-
if (!
|
|
465
|
-
const u =
|
|
463
|
+
de(() => {
|
|
464
|
+
if (!c.value) return;
|
|
465
|
+
const u = c.value, g = u.scrollHeight, _ = u.clientHeight, L = u.scrollTop, C = g > _ + 1;
|
|
466
466
|
if (J.value.show = C, !C) return;
|
|
467
|
-
const
|
|
467
|
+
const R = 24, X = _ / g, be = Q.value ? Q.value.clientHeight : _, De = Math.max(R, Math.floor(be * X));
|
|
468
468
|
J.value.thumbHeight = De;
|
|
469
469
|
const Ye = Math.max(0, be - De), Oe = Math.max(1, g - _);
|
|
470
|
-
J.value.thumbTop = Math.min(Ye, Math.floor(
|
|
470
|
+
J.value.thumbTop = Math.min(Ye, Math.floor(L / Oe * Ye));
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
function y(u) {
|
|
474
|
-
if (!
|
|
474
|
+
if (!ae || !c.value || !Q.value) return;
|
|
475
475
|
u.preventDefault();
|
|
476
|
-
const g = Q.value.clientHeight, _ = Math.max(0, g - J.value.thumbHeight),
|
|
477
|
-
|
|
476
|
+
const g = Q.value.clientHeight, _ = Math.max(0, g - J.value.thumbHeight), L = c.value, C = L.scrollHeight, R = L.clientHeight, X = Math.max(1, C - R), De = (u.clientY - ee) / Math.max(1, _) * X;
|
|
477
|
+
L.scrollTop = Math.min(X, Math.max(0, he + De)), i();
|
|
478
478
|
}
|
|
479
|
-
function
|
|
480
|
-
|
|
479
|
+
function I() {
|
|
480
|
+
ae = !1, window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", I);
|
|
481
481
|
}
|
|
482
482
|
function Z() {
|
|
483
|
-
|
|
484
|
-
var _,
|
|
483
|
+
de(() => {
|
|
484
|
+
var _, L;
|
|
485
485
|
if (A.value.length === e.columns.length && A.value.every((C) => !!C))
|
|
486
486
|
return;
|
|
487
487
|
const u = [];
|
|
488
|
-
e.columns.forEach((C,
|
|
488
|
+
e.columns.forEach((C, R) => {
|
|
489
489
|
const X = F(C.width);
|
|
490
490
|
if (X)
|
|
491
491
|
u.push(X), P.value[C.key] = X;
|
|
492
492
|
else if (P.value[C.key])
|
|
493
493
|
u.push(P.value[C.key]);
|
|
494
494
|
else {
|
|
495
|
-
const be = A.value[
|
|
495
|
+
const be = A.value[R];
|
|
496
496
|
if (be)
|
|
497
497
|
u.push(be), P.value[C.key] = be;
|
|
498
498
|
else {
|
|
@@ -503,10 +503,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
503
503
|
});
|
|
504
504
|
const g = (_ = D.value) == null ? void 0 : _.querySelector("tbody tr");
|
|
505
505
|
if (g) {
|
|
506
|
-
const C = e.selectable ? 1 : 0,
|
|
506
|
+
const C = e.selectable ? 1 : 0, R = Array.from(g.children);
|
|
507
507
|
for (let X = 0; X < e.columns.length; X++)
|
|
508
508
|
if (!u[X]) {
|
|
509
|
-
const be =
|
|
509
|
+
const be = R[C + X];
|
|
510
510
|
if (be && be.clientWidth > 0) {
|
|
511
511
|
const De = `${be.clientWidth}px`;
|
|
512
512
|
u[X] = De, P.value[e.columns[X].key] = De;
|
|
@@ -518,88 +518,88 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
518
518
|
} else
|
|
519
519
|
for (let C = 0; C < u.length; C++)
|
|
520
520
|
if (!u[C]) {
|
|
521
|
-
const
|
|
522
|
-
u[C] =
|
|
521
|
+
const R = P.value[((L = e.columns[C]) == null ? void 0 : L.key) || ""];
|
|
522
|
+
u[C] = R || A.value[C] || "80px", e.columns[C] && (P.value[e.columns[C].key] = u[C]);
|
|
523
523
|
}
|
|
524
524
|
A.value = u;
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
|
|
527
|
+
function ie() {
|
|
528
|
+
Re(), le();
|
|
529
529
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
530
|
+
re(() => e.data, () => {
|
|
531
|
+
de(() => {
|
|
532
|
+
Re(), ze(), le(), x.value.clear();
|
|
533
533
|
});
|
|
534
|
-
}, { deep: !0 }),
|
|
535
|
-
|
|
536
|
-
|
|
534
|
+
}, { deep: !0 }), re([m, f], () => {
|
|
535
|
+
de(() => {
|
|
536
|
+
Re(), ze(), le();
|
|
537
537
|
});
|
|
538
|
-
}),
|
|
538
|
+
}), re(() => e.columns, () => {
|
|
539
539
|
const u = [], g = { ...P.value };
|
|
540
|
-
e.columns.forEach((
|
|
541
|
-
const
|
|
542
|
-
|
|
540
|
+
e.columns.forEach((L, C) => {
|
|
541
|
+
const R = F(L.width);
|
|
542
|
+
R ? (u.push(R), g[L.key] = R) : g[L.key] ? u.push(g[L.key]) : A.value[C] ? (u.push(A.value[C]), g[L.key] = A.value[C]) : u.push("");
|
|
543
543
|
});
|
|
544
|
-
const _ = new Set(e.columns.map((
|
|
545
|
-
Object.keys(g).forEach((
|
|
546
|
-
_.has(
|
|
547
|
-
}), P.value = g, A.value = u,
|
|
548
|
-
Z(),
|
|
544
|
+
const _ = new Set(e.columns.map((L) => L.key));
|
|
545
|
+
Object.keys(g).forEach((L) => {
|
|
546
|
+
_.has(L) || delete g[L];
|
|
547
|
+
}), P.value = g, A.value = u, de(() => {
|
|
548
|
+
Z(), ze(), le();
|
|
549
549
|
});
|
|
550
|
-
}, { deep: !0 }),
|
|
551
|
-
|
|
552
|
-
|
|
550
|
+
}, { deep: !0 }), re(() => v.value, () => {
|
|
551
|
+
de(() => {
|
|
552
|
+
Re(), le();
|
|
553
553
|
});
|
|
554
|
-
}, { deep: !0 }),
|
|
555
|
-
|
|
554
|
+
}, { deep: !0 }), re(() => e.loading, () => {
|
|
555
|
+
de(() => {
|
|
556
556
|
le();
|
|
557
557
|
});
|
|
558
558
|
}), Me(() => {
|
|
559
559
|
var u, g;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}), window.addEventListener("resize",
|
|
563
|
-
|
|
564
|
-
}, { passive: !0 }), (g =
|
|
565
|
-
|
|
566
|
-
}, { passive: !0 }),
|
|
560
|
+
de(() => {
|
|
561
|
+
Re(), Z(), le(), i();
|
|
562
|
+
}), window.addEventListener("resize", ie), window.addEventListener("scroll", ie, !0), (u = c.value) == null || u.addEventListener("scroll", () => {
|
|
563
|
+
ze(), i(), le();
|
|
564
|
+
}, { passive: !0 }), (g = b.value) == null || g.addEventListener("scroll", () => {
|
|
565
|
+
Ae();
|
|
566
|
+
}, { passive: !0 }), de(() => ze()), c.value && typeof ResizeObserver < "u" && (we = new ResizeObserver(() => {
|
|
567
567
|
le();
|
|
568
|
-
}), we.observe(
|
|
569
|
-
}),
|
|
568
|
+
}), we.observe(c.value));
|
|
569
|
+
}), He(() => {
|
|
570
570
|
var u, g;
|
|
571
|
-
window.removeEventListener("resize",
|
|
571
|
+
window.removeEventListener("resize", ie), window.removeEventListener("scroll", ie, !0), (u = c.value) == null || u.removeEventListener("scroll", ze), (g = b.value) == null || g.removeEventListener("scroll", Ae), window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", I), we && (we.disconnect(), we = null);
|
|
572
572
|
});
|
|
573
573
|
let ue = -1;
|
|
574
574
|
function le() {
|
|
575
|
-
!
|
|
576
|
-
if (!
|
|
577
|
-
const u =
|
|
575
|
+
!b.value || !c.value || requestAnimationFrame(() => {
|
|
576
|
+
if (!b.value || !c.value) return;
|
|
577
|
+
const u = c.value, g = Math.ceil(u.offsetWidth - u.clientWidth);
|
|
578
578
|
if (E.value = g, g !== ue) {
|
|
579
579
|
ue = g;
|
|
580
|
-
const _ =
|
|
581
|
-
_ &&
|
|
580
|
+
const _ = b.value.querySelector(".table"), L = D.value;
|
|
581
|
+
_ && L && (b.value.style.paddingRight = "0px", _.style.width = "", _.style.marginRight = "", g > 0 ? (b.value.style.paddingRight = `${g}px`, _.style.width = "100%", _.style.marginRight = `-${g}px`) : (b.value.style.paddingRight = "0px", _.style.width = "100%", _.style.marginRight = "0px"));
|
|
582
582
|
}
|
|
583
583
|
});
|
|
584
584
|
}
|
|
585
585
|
let we = null;
|
|
586
586
|
return (u, g) => {
|
|
587
|
-
const _ = Ve("YButton"),
|
|
587
|
+
const _ = Ve("YButton"), L = Ve("YPagination");
|
|
588
588
|
return s(), r("div", {
|
|
589
589
|
class: "ytable-container",
|
|
590
590
|
ref_key: "tableContainer",
|
|
591
591
|
ref: $
|
|
592
592
|
}, [
|
|
593
|
-
|
|
593
|
+
ve(_e, { name: "bulk-slide" }, {
|
|
594
594
|
default: ye(() => [
|
|
595
|
-
|
|
596
|
-
l("div", Mt, "已选择 " +
|
|
597
|
-
l("div",
|
|
595
|
+
v.value.length && t.showBulkActions ? (s(), r("div", St, [
|
|
596
|
+
l("div", Mt, "已选择 " + oe(v.value.length) + " 项", 1),
|
|
597
|
+
l("div", Lt, [
|
|
598
598
|
fe(u.$slots, "bulk-actions", {
|
|
599
|
-
selectedItems:
|
|
599
|
+
selectedItems: v.value,
|
|
600
600
|
clearSelection: Pe
|
|
601
601
|
}, () => [
|
|
602
|
-
|
|
602
|
+
ve(_, {
|
|
603
603
|
size: "small",
|
|
604
604
|
class: "btn",
|
|
605
605
|
onClick: Pe
|
|
@@ -615,19 +615,19 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
615
615
|
]),
|
|
616
616
|
_: 3
|
|
617
617
|
}),
|
|
618
|
-
l("div",
|
|
618
|
+
l("div", It, [
|
|
619
619
|
l("div", {
|
|
620
620
|
class: "table-header",
|
|
621
621
|
ref_key: "headerRef",
|
|
622
|
-
ref:
|
|
622
|
+
ref: b
|
|
623
623
|
}, [
|
|
624
624
|
l("table", Et, [
|
|
625
625
|
l("colgroup", null, [
|
|
626
626
|
e.expandable ? (s(), r("col", Bt)) : W("", !0),
|
|
627
627
|
t.selectable ? (s(), r("col", Tt)) : W("", !0),
|
|
628
|
-
(s(!0), r(
|
|
628
|
+
(s(!0), r(pe, null, me(t.columns, (C, R) => (s(), r("col", {
|
|
629
629
|
key: C.key,
|
|
630
|
-
style:
|
|
630
|
+
style: ce({ width: A.value[R] || void 0, minWidth: A.value[R] || "80px" })
|
|
631
631
|
}, null, 4))), 128))
|
|
632
632
|
]),
|
|
633
633
|
l("thead", null, [
|
|
@@ -641,20 +641,20 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
641
641
|
onChange: We
|
|
642
642
|
}, null, 40, Ht)
|
|
643
643
|
])) : W("", !0),
|
|
644
|
-
(s(!0), r(
|
|
644
|
+
(s(!0), r(pe, null, me(t.columns, (C, R) => (s(), r("th", {
|
|
645
645
|
key: C.key,
|
|
646
|
-
class:
|
|
647
|
-
style:
|
|
648
|
-
},
|
|
646
|
+
class: B(Y(C, !0)),
|
|
647
|
+
style: ce(ne(C, R, !0))
|
|
648
|
+
}, oe(C.title), 7))), 128))
|
|
649
649
|
])
|
|
650
650
|
])
|
|
651
651
|
])
|
|
652
652
|
], 512),
|
|
653
653
|
l("div", {
|
|
654
|
-
class:
|
|
654
|
+
class: B(["table-body-wrap", { "is-loading": t.loading, "is-empty": !q.value.length && !t.loading }]),
|
|
655
655
|
ref_key: "bodyWrapRef",
|
|
656
|
-
ref:
|
|
657
|
-
style:
|
|
656
|
+
ref: c,
|
|
657
|
+
style: ce({ maxHeight: H.value })
|
|
658
658
|
}, [
|
|
659
659
|
t.loading ? (s(), r("div", Rt, [...g[4] || (g[4] = [
|
|
660
660
|
l("div", { class: "loading-spinner" }, null, -1),
|
|
@@ -662,39 +662,39 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
662
662
|
])])) : W("", !0),
|
|
663
663
|
!q.value.length && !t.loading ? (s(), r("div", At, [
|
|
664
664
|
fe(u.$slots, "empty", {}, () => [
|
|
665
|
-
Se(
|
|
665
|
+
Se(oe(t.emptyText), 1)
|
|
666
666
|
], !0)
|
|
667
667
|
])) : W("", !0),
|
|
668
668
|
l("table", {
|
|
669
|
-
class:
|
|
669
|
+
class: B(["table", { "loading-table": t.loading }]),
|
|
670
670
|
ref_key: "bodyTableRef",
|
|
671
671
|
ref: D
|
|
672
672
|
}, [
|
|
673
673
|
l("colgroup", null, [
|
|
674
674
|
e.expandable ? (s(), r("col", Wt)) : W("", !0),
|
|
675
675
|
t.selectable ? (s(), r("col", Vt)) : W("", !0),
|
|
676
|
-
(s(!0), r(
|
|
676
|
+
(s(!0), r(pe, null, me(t.columns, (C, R) => (s(), r("col", {
|
|
677
677
|
key: C.key,
|
|
678
|
-
style:
|
|
678
|
+
style: ce({ width: A.value[R] || void 0, minWidth: A.value[R] || "80px" })
|
|
679
679
|
}, null, 4))), 128))
|
|
680
680
|
]),
|
|
681
681
|
l("tbody", null, [
|
|
682
|
-
(s(!0), r(
|
|
683
|
-
key: a(C,
|
|
682
|
+
(s(!0), r(pe, null, me(q.value, (C, R) => (s(), r(pe, {
|
|
683
|
+
key: a(C, R)
|
|
684
684
|
}, [
|
|
685
685
|
l("tr", {
|
|
686
|
-
class:
|
|
687
|
-
style:
|
|
688
|
-
onClick: (X) => Ze(C,
|
|
686
|
+
class: B({ "row-selected": Qe(C, R) }),
|
|
687
|
+
style: ce(t.rowSelectable ? { cursor: "pointer" } : {}),
|
|
688
|
+
onClick: (X) => Ze(C, R)
|
|
689
689
|
}, [
|
|
690
690
|
e.expandable ? (s(), r("td", Pt, [
|
|
691
691
|
l("button", {
|
|
692
692
|
class: "expand-btn",
|
|
693
693
|
type: "button",
|
|
694
|
-
onClick: G((X) => M(a(C,
|
|
694
|
+
onClick: G((X) => M(a(C, R)), ["stop"])
|
|
695
695
|
}, [
|
|
696
696
|
l("span", {
|
|
697
|
-
class:
|
|
697
|
+
class: B(["expand-icon", { "is-open": k(a(C, R)) }])
|
|
698
698
|
}, null, 2)
|
|
699
699
|
], 8, Nt)
|
|
700
700
|
])) : W("", !0),
|
|
@@ -706,28 +706,28 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
706
706
|
}, [
|
|
707
707
|
l("input", {
|
|
708
708
|
type: "checkbox",
|
|
709
|
-
value: a(C,
|
|
710
|
-
checked:
|
|
711
|
-
disabled:
|
|
712
|
-
onChange: G((X) =>
|
|
709
|
+
value: a(C, R),
|
|
710
|
+
checked: v.value.includes(a(C, R)),
|
|
711
|
+
disabled: d(C, R),
|
|
712
|
+
onChange: G((X) => Ke(a(C, R)), ["stop"])
|
|
713
713
|
}, null, 40, Yt)
|
|
714
714
|
])) : W("", !0),
|
|
715
|
-
(s(!0), r(
|
|
715
|
+
(s(!0), r(pe, null, me(t.columns, (X, be) => (s(), r("td", {
|
|
716
716
|
key: X.key,
|
|
717
|
-
class:
|
|
718
|
-
style:
|
|
717
|
+
class: B(Y(X)),
|
|
718
|
+
style: ce(ne(X, be, !1))
|
|
719
719
|
}, [
|
|
720
720
|
fe(u.$slots, `cell-${X.key}`, {
|
|
721
721
|
item: C,
|
|
722
|
-
value:
|
|
723
|
-
index:
|
|
722
|
+
value: z(C, X.key),
|
|
723
|
+
index: R
|
|
724
724
|
}, () => [
|
|
725
|
-
Se(
|
|
725
|
+
Se(oe($e(C, X)), 1)
|
|
726
726
|
], !0)
|
|
727
727
|
], 6))), 128))
|
|
728
728
|
], 14, Ft),
|
|
729
|
-
e.expandable &&
|
|
730
|
-
key: `${a(C,
|
|
729
|
+
e.expandable && k(a(C, R)) ? (s(), r("tr", {
|
|
730
|
+
key: `${a(C, R)}-expand`,
|
|
731
731
|
class: "expand-row"
|
|
732
732
|
}, [
|
|
733
733
|
l("td", {
|
|
@@ -736,7 +736,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
736
736
|
}, [
|
|
737
737
|
fe(u.$slots, "expand", {
|
|
738
738
|
item: C,
|
|
739
|
-
index:
|
|
739
|
+
index: R
|
|
740
740
|
}, void 0, !0)
|
|
741
741
|
], 8, Ot)
|
|
742
742
|
])) : W("", !0)
|
|
@@ -744,7 +744,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
744
744
|
])
|
|
745
745
|
], 2)
|
|
746
746
|
], 6),
|
|
747
|
-
t.pagination ? (s(),
|
|
747
|
+
t.pagination ? (s(), Te(L, {
|
|
748
748
|
key: 0,
|
|
749
749
|
class: "align-right",
|
|
750
750
|
"current-page": m.value,
|
|
@@ -761,7 +761,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
761
761
|
], 512);
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
}), qt = /* @__PURE__ */
|
|
764
|
+
}), qt = /* @__PURE__ */ xe(jt, [["__scopeId", "data-v-c8484581"]]), Ut = ["onKeydown", "aria-expanded"], Zt = ["src"], Qt = ["placeholder", "onKeydown"], Jt = ["onClick", "onMouseenter"], Xt = ["src"], Gt = /* @__PURE__ */ ke({
|
|
765
765
|
__name: "yselect",
|
|
766
766
|
props: {
|
|
767
767
|
modelValue: {},
|
|
@@ -779,26 +779,26 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
779
779
|
width: { default: "200px" }
|
|
780
780
|
},
|
|
781
781
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
782
|
-
setup(t, { emit:
|
|
783
|
-
const e = t, n =
|
|
782
|
+
setup(t, { emit: w }) {
|
|
783
|
+
const e = t, n = w, m = K(!1), f = K(-1), v = K(), S = K(), x = K(), H = K(), $ = K(!1), b = K(), c = K(""), D = j(() => e.options.find((o) => Q(o) === e.modelValue) || null), A = j(() => D.value ? J(D.value) : ""), P = j(() => {
|
|
784
784
|
if (!e.filterable) return e.options;
|
|
785
|
-
const o =
|
|
785
|
+
const o = c.value.trim().toLowerCase();
|
|
786
786
|
return o ? e.options.filter((a) => {
|
|
787
|
-
const
|
|
788
|
-
return String(
|
|
787
|
+
const d = J(a);
|
|
788
|
+
return String(d).toLowerCase().includes(o);
|
|
789
789
|
}) : e.options;
|
|
790
790
|
}), O = j(() => {
|
|
791
791
|
var M;
|
|
792
792
|
const o = { position: "fixed", zIndex: "4000" }, a = S.value;
|
|
793
793
|
if (!a) return o;
|
|
794
|
-
const
|
|
795
|
-
return o.left = `${
|
|
794
|
+
const d = a.getBoundingClientRect(), k = ((M = x.value) == null ? void 0 : M.getBoundingClientRect().width) || d.width;
|
|
795
|
+
return o.left = `${d.left}px`, o.width = `${k}px`, $.value ? (o.bottom = `${window.innerHeight - d.top + 4}px`, o.top = "auto") : o.top = `${d.bottom + 4}px`, o;
|
|
796
796
|
});
|
|
797
797
|
function V() {
|
|
798
|
-
!m.value || !S.value ||
|
|
798
|
+
!m.value || !S.value || de(() => {
|
|
799
799
|
const o = S.value;
|
|
800
800
|
if (!o) return;
|
|
801
|
-
const a = o.getBoundingClientRect(),
|
|
801
|
+
const a = o.getBoundingClientRect(), d = window.innerHeight, k = 200, M = a.bottom + k + 4, z = a.top - k - 4, Y = M <= d - 20, ne = z >= 20;
|
|
802
802
|
$.value = !Y && ne;
|
|
803
803
|
});
|
|
804
804
|
}
|
|
@@ -808,35 +808,35 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
808
808
|
function J(o) {
|
|
809
809
|
return typeof o == "object" && o !== null ? o[e.labelKey] || String(o[e.valueKey]) : String(o);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function ae(o, a) {
|
|
812
812
|
return typeof o == "object" && o !== null && o.id !== void 0 ? o.id : Q(o) || a;
|
|
813
813
|
}
|
|
814
814
|
function ee(o) {
|
|
815
815
|
return Q(o) === e.modelValue;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function he(o) {
|
|
818
818
|
return typeof o == "object" && o !== null ? o[e.disabledKey] === !0 : !1;
|
|
819
819
|
}
|
|
820
820
|
function E() {
|
|
821
|
-
e.disabled || (m.value ?
|
|
821
|
+
e.disabled || (m.value ? T() : F());
|
|
822
822
|
}
|
|
823
823
|
function F() {
|
|
824
|
-
e.disabled || (m.value = !0,
|
|
825
|
-
V(), U(), e.filterable &&
|
|
824
|
+
e.disabled || (m.value = !0, de(() => {
|
|
825
|
+
V(), U(), e.filterable && b.value && (b.value.focus(), c.value = "");
|
|
826
826
|
}));
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
m.value = !1, f.value = -1, $.value = !1, e.filterable && (
|
|
828
|
+
function T() {
|
|
829
|
+
m.value = !1, f.value = -1, $.value = !1, e.filterable && (c.value = "");
|
|
830
830
|
}
|
|
831
831
|
function N(o, a) {
|
|
832
|
-
if (
|
|
833
|
-
const
|
|
834
|
-
n("update:modelValue",
|
|
832
|
+
if (he(o)) return;
|
|
833
|
+
const d = Q(o);
|
|
834
|
+
n("update:modelValue", d), n("change", d, o), T();
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function se() {
|
|
837
837
|
if (!e.clearable || e.disabled) return;
|
|
838
838
|
const o = e.clearTo;
|
|
839
|
-
n("update:modelValue", o), n("change", o, null), n("clear"),
|
|
839
|
+
n("update:modelValue", o), n("change", o, null), n("clear"), T();
|
|
840
840
|
}
|
|
841
841
|
function q(o) {
|
|
842
842
|
if (!P.value || P.value.length === 0) {
|
|
@@ -844,52 +844,52 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
844
844
|
return;
|
|
845
845
|
}
|
|
846
846
|
let a = f.value;
|
|
847
|
-
const
|
|
848
|
-
a === -1 ? a = o > 0 ? 0 :
|
|
849
|
-
let
|
|
850
|
-
for (;
|
|
851
|
-
a = (a + o +
|
|
852
|
-
f.value =
|
|
847
|
+
const d = P.value.length;
|
|
848
|
+
a === -1 ? a = o > 0 ? 0 : d - 1 : a = (a + o + d) % d;
|
|
849
|
+
let k = 0;
|
|
850
|
+
for (; k < d && he(P.value[a]); )
|
|
851
|
+
a = (a + o + d) % d, k++;
|
|
852
|
+
f.value = k >= d ? -1 : a, te();
|
|
853
853
|
}
|
|
854
854
|
function ge() {
|
|
855
855
|
if (f.value < 0) return;
|
|
856
856
|
const o = P.value[f.value];
|
|
857
|
-
!o ||
|
|
857
|
+
!o || he(o) || N(o, f.value);
|
|
858
858
|
}
|
|
859
859
|
function U() {
|
|
860
|
-
if (!
|
|
861
|
-
const o =
|
|
860
|
+
if (!v.value) return;
|
|
861
|
+
const o = v.value.querySelector(".yselect__option--selected");
|
|
862
862
|
o && o.scrollIntoView({ block: "nearest" });
|
|
863
863
|
}
|
|
864
864
|
function te() {
|
|
865
|
-
if (!
|
|
866
|
-
const a =
|
|
865
|
+
if (!v.value || f.value < 0) return;
|
|
866
|
+
const a = v.value.querySelectorAll(".yselect__option")[f.value];
|
|
867
867
|
a && a.scrollIntoView({ block: "nearest" });
|
|
868
868
|
}
|
|
869
869
|
function p(o) {
|
|
870
870
|
const a = o.target;
|
|
871
|
-
(!x.value || !x.value.contains(a)) &&
|
|
871
|
+
(!x.value || !x.value.contains(a)) && T();
|
|
872
872
|
}
|
|
873
|
-
|
|
873
|
+
re(() => e.modelValue, () => {
|
|
874
874
|
f.value = -1;
|
|
875
875
|
});
|
|
876
|
-
function
|
|
876
|
+
function h() {
|
|
877
877
|
m.value && V();
|
|
878
878
|
}
|
|
879
879
|
return Me(() => {
|
|
880
|
-
document.addEventListener("click", p), window.addEventListener("resize",
|
|
881
|
-
}),
|
|
882
|
-
document.removeEventListener("click", p), window.removeEventListener("resize",
|
|
880
|
+
document.addEventListener("click", p), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
881
|
+
}), He(() => {
|
|
882
|
+
document.removeEventListener("click", p), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
883
883
|
}), (o, a) => (s(), r("div", {
|
|
884
|
-
class:
|
|
885
|
-
style:
|
|
884
|
+
class: B(["yselect", { "yselect--disabled": t.disabled, [`yselect--${t.size}`]: !0 }]),
|
|
885
|
+
style: ce({ width: t.width }),
|
|
886
886
|
ref_key: "selectContainer",
|
|
887
887
|
ref: x
|
|
888
888
|
}, [
|
|
889
889
|
l("div", {
|
|
890
890
|
ref_key: "triggerElement",
|
|
891
891
|
ref: S,
|
|
892
|
-
class:
|
|
892
|
+
class: B(["yselect__trigger", {
|
|
893
893
|
"yselect__trigger--open": m.value,
|
|
894
894
|
"yselect__trigger--disabled": t.disabled,
|
|
895
895
|
"yselect__trigger--error": t.error
|
|
@@ -898,7 +898,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
898
898
|
onKeydown: [
|
|
899
899
|
Ce(G(E, ["prevent"]), ["enter"]),
|
|
900
900
|
Ce(G(E, ["prevent"]), ["space"]),
|
|
901
|
-
Ce(
|
|
901
|
+
Ce(T, ["escape"]),
|
|
902
902
|
Ce(G(F, ["prevent"]), ["arrow-down"]),
|
|
903
903
|
Ce(G(F, ["prevent"]), ["arrow-up"])
|
|
904
904
|
],
|
|
@@ -909,52 +909,52 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
909
909
|
}, [
|
|
910
910
|
!t.filterable || !m.value ? (s(), r("span", {
|
|
911
911
|
key: 0,
|
|
912
|
-
class:
|
|
912
|
+
class: B(["yselect__value", { yselect__placeholder: !A.value }])
|
|
913
913
|
}, [
|
|
914
914
|
fe(o.$slots, "value", {
|
|
915
915
|
value: D.value,
|
|
916
916
|
label: A.value
|
|
917
917
|
}, () => {
|
|
918
|
-
var
|
|
918
|
+
var d;
|
|
919
919
|
return [
|
|
920
|
-
D.value ? (s(), r(
|
|
921
|
-
(
|
|
920
|
+
D.value ? (s(), r(pe, { key: 0 }, [
|
|
921
|
+
(d = D.value) != null && d.flagImg ? (s(), r("img", {
|
|
922
922
|
key: 0,
|
|
923
923
|
class: "yselect__flag",
|
|
924
924
|
src: D.value.flagImg,
|
|
925
925
|
alt: "flag"
|
|
926
926
|
}, null, 8, Zt)) : W("", !0),
|
|
927
|
-
Se(" " +
|
|
928
|
-
], 64)) : (s(), r(
|
|
929
|
-
Se(
|
|
927
|
+
Se(" " + oe(A.value), 1)
|
|
928
|
+
], 64)) : (s(), r(pe, { key: 1 }, [
|
|
929
|
+
Se(oe(t.placeholder), 1)
|
|
930
930
|
], 64))
|
|
931
931
|
];
|
|
932
932
|
}, !0)
|
|
933
|
-
], 2)) :
|
|
933
|
+
], 2)) : Le((s(), r("input", {
|
|
934
934
|
key: 1,
|
|
935
935
|
ref_key: "inputElement",
|
|
936
|
-
ref:
|
|
936
|
+
ref: b,
|
|
937
937
|
class: "yselect__input",
|
|
938
938
|
type: "text",
|
|
939
939
|
placeholder: A.value || t.placeholder,
|
|
940
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
940
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => c.value = d),
|
|
941
941
|
onKeydown: [
|
|
942
942
|
a[1] || (a[1] = G(() => {
|
|
943
943
|
}, ["stop"])),
|
|
944
|
-
a[2] || (a[2] = Ce(G((
|
|
945
|
-
a[3] || (a[3] = Ce(G((
|
|
946
|
-
a[4] || (a[4] = Ce(G((
|
|
947
|
-
Ce(G(
|
|
948
|
-
Ce(G(
|
|
944
|
+
a[2] || (a[2] = Ce(G((d) => q(1), ["prevent"]), ["arrow-down"])),
|
|
945
|
+
a[3] || (a[3] = Ce(G((d) => q(-1), ["prevent"]), ["arrow-up"])),
|
|
946
|
+
a[4] || (a[4] = Ce(G((d) => ge(), ["prevent"]), ["enter"])),
|
|
947
|
+
Ce(G(T, ["prevent"]), ["esc"]),
|
|
948
|
+
Ce(G(se, ["prevent"]), ["delete"])
|
|
949
949
|
]
|
|
950
950
|
}, null, 40, Qt)), [
|
|
951
|
-
[ut,
|
|
951
|
+
[ut, c.value]
|
|
952
952
|
]),
|
|
953
953
|
t.clearable && !t.disabled && D.value ? (s(), r("span", {
|
|
954
954
|
key: 2,
|
|
955
955
|
class: "yselect__clear",
|
|
956
956
|
title: "清空",
|
|
957
|
-
onClick: G(
|
|
957
|
+
onClick: G(se, ["stop"])
|
|
958
958
|
}, [...a[8] || (a[8] = [
|
|
959
959
|
l("svg", {
|
|
960
960
|
width: "12",
|
|
@@ -971,7 +971,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
971
971
|
], -1)
|
|
972
972
|
])])) : W("", !0),
|
|
973
973
|
l("span", {
|
|
974
|
-
class:
|
|
974
|
+
class: B(["yselect__arrow", { "yselect__arrow--open": m.value }])
|
|
975
975
|
}, [...a[9] || (a[9] = [
|
|
976
976
|
l("svg", {
|
|
977
977
|
width: "12",
|
|
@@ -989,15 +989,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
989
989
|
], -1)
|
|
990
990
|
])], 2)
|
|
991
991
|
], 42, Ut),
|
|
992
|
-
|
|
992
|
+
ve(_e, { name: "yselect-dropdown" }, {
|
|
993
993
|
default: ye(() => [
|
|
994
|
-
(s(),
|
|
994
|
+
(s(), Te(Fe, { to: "body" }, [
|
|
995
995
|
m.value ? (s(), r("div", {
|
|
996
996
|
key: 0,
|
|
997
997
|
ref_key: "dropdownEl",
|
|
998
|
-
ref:
|
|
999
|
-
class:
|
|
1000
|
-
style:
|
|
998
|
+
ref: H,
|
|
999
|
+
class: B(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": $.value }]),
|
|
1000
|
+
style: ce(O.value),
|
|
1001
1001
|
onMousedown: a[6] || (a[6] = G(() => {
|
|
1002
1002
|
}, ["stop"])),
|
|
1003
1003
|
onClick: a[7] || (a[7] = G(() => {
|
|
@@ -1006,31 +1006,31 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1006
1006
|
l("div", {
|
|
1007
1007
|
class: "yselect__options",
|
|
1008
1008
|
ref_key: "optionsContainer",
|
|
1009
|
-
ref:
|
|
1009
|
+
ref: v
|
|
1010
1010
|
}, [
|
|
1011
|
-
(s(!0), r(
|
|
1012
|
-
key:
|
|
1013
|
-
class:
|
|
1014
|
-
"yselect__option--selected": ee(
|
|
1015
|
-
"yselect__option--disabled":
|
|
1016
|
-
"yselect__option--hover": f.value ===
|
|
1011
|
+
(s(!0), r(pe, null, me(P.value, (d, k) => (s(), r("div", {
|
|
1012
|
+
key: ae(d, k),
|
|
1013
|
+
class: B(["yselect__option", {
|
|
1014
|
+
"yselect__option--selected": ee(d),
|
|
1015
|
+
"yselect__option--disabled": he(d),
|
|
1016
|
+
"yselect__option--hover": f.value === k
|
|
1017
1017
|
}]),
|
|
1018
|
-
onClick: (M) => N(
|
|
1019
|
-
onMouseenter: (M) => f.value =
|
|
1018
|
+
onClick: (M) => N(d),
|
|
1019
|
+
onMouseenter: (M) => f.value = k,
|
|
1020
1020
|
onMouseleave: a[5] || (a[5] = (M) => f.value = -1)
|
|
1021
1021
|
}, [
|
|
1022
1022
|
fe(o.$slots, "option", {
|
|
1023
|
-
option:
|
|
1024
|
-
index:
|
|
1025
|
-
selected: ee(
|
|
1023
|
+
option: d,
|
|
1024
|
+
index: k,
|
|
1025
|
+
selected: ee(d)
|
|
1026
1026
|
}, () => [
|
|
1027
|
-
|
|
1027
|
+
d != null && d.flagImg ? (s(), r("img", {
|
|
1028
1028
|
key: 0,
|
|
1029
1029
|
class: "yselect__flag",
|
|
1030
|
-
src:
|
|
1030
|
+
src: d.flagImg,
|
|
1031
1031
|
alt: "flag"
|
|
1032
1032
|
}, null, 8, Xt)) : W("", !0),
|
|
1033
|
-
Se(" " +
|
|
1033
|
+
Se(" " + oe(J(d)), 1)
|
|
1034
1034
|
], !0)
|
|
1035
1035
|
], 42, Jt))), 128))
|
|
1036
1036
|
], 512)
|
|
@@ -1041,7 +1041,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1041
1041
|
})
|
|
1042
1042
|
], 6));
|
|
1043
1043
|
}
|
|
1044
|
-
}), st = /* @__PURE__ */
|
|
1044
|
+
}), st = /* @__PURE__ */ xe(Gt, [["__scopeId", "data-v-6cd47cb7"]]), en = { class: "ypagination" }, tn = { class: "page-actions" }, nn = { class: "page-size-select" }, ln = /* @__PURE__ */ ke({
|
|
1045
1045
|
__name: "ypagination",
|
|
1046
1046
|
props: {
|
|
1047
1047
|
currentPage: {},
|
|
@@ -1056,56 +1056,56 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1056
1056
|
disableNext: { type: Boolean, default: !1 }
|
|
1057
1057
|
},
|
|
1058
1058
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
1059
|
-
setup(t, { emit:
|
|
1060
|
-
const e = t, n =
|
|
1059
|
+
setup(t, { emit: w }) {
|
|
1060
|
+
const e = t, n = w, m = K(e.pageSize), f = j(() => e.pageSizeOptions), v = j({
|
|
1061
1061
|
get: () => e.currentPage,
|
|
1062
1062
|
set: ($) => {
|
|
1063
1063
|
n("update:currentPage", $), n("page-change", $);
|
|
1064
1064
|
}
|
|
1065
1065
|
});
|
|
1066
1066
|
function S($) {
|
|
1067
|
-
e.loading || $ >= 1 && $ !== e.currentPage && (
|
|
1067
|
+
e.loading || $ >= 1 && $ !== e.currentPage && (v.value = $);
|
|
1068
1068
|
}
|
|
1069
1069
|
function x($) {
|
|
1070
|
-
e.loading || (m.value = $, n("update:pageSize", $), n("page-size-change", $),
|
|
1070
|
+
e.loading || (m.value = $, n("update:pageSize", $), n("page-size-change", $), v.value = 1);
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1073
|
-
e.loading || ($ === "prev" ? S(
|
|
1072
|
+
function H($) {
|
|
1073
|
+
e.loading || ($ === "prev" ? S(v.value - 1) : $ === "next" && S(v.value + 1));
|
|
1074
1074
|
}
|
|
1075
|
-
return m.value = e.pageSize,
|
|
1075
|
+
return m.value = e.pageSize, re(
|
|
1076
1076
|
() => e.pageSize,
|
|
1077
1077
|
($) => {
|
|
1078
1078
|
typeof $ == "number" && m.value !== $ && (m.value = $);
|
|
1079
1079
|
}
|
|
1080
|
-
), ($,
|
|
1081
|
-
const
|
|
1080
|
+
), ($, b) => {
|
|
1081
|
+
const c = Ve("YButton"), D = Ve("YSelect");
|
|
1082
1082
|
return s(), r("div", en, [
|
|
1083
1083
|
l("div", tn, [
|
|
1084
|
-
|
|
1084
|
+
ve(c, {
|
|
1085
1085
|
size: "small",
|
|
1086
1086
|
variant: "secondary",
|
|
1087
|
-
disabled:
|
|
1088
|
-
onClick:
|
|
1087
|
+
disabled: v.value === 1 || t.loading,
|
|
1088
|
+
onClick: b[0] || (b[0] = (A) => S(1))
|
|
1089
1089
|
}, {
|
|
1090
|
-
default: ye(() => [...
|
|
1090
|
+
default: ye(() => [...b[2] || (b[2] = [
|
|
1091
1091
|
Se("首页", -1)
|
|
1092
1092
|
])]),
|
|
1093
1093
|
_: 1
|
|
1094
1094
|
}, 8, ["disabled"]),
|
|
1095
|
-
|
|
1095
|
+
ve(c, {
|
|
1096
1096
|
class: "ml-1",
|
|
1097
1097
|
variant: "secondary",
|
|
1098
1098
|
size: "small",
|
|
1099
1099
|
groupItems: [
|
|
1100
|
-
{ label: "上一页", value: "prev", disabled:
|
|
1100
|
+
{ label: "上一页", value: "prev", disabled: v.value === 1 || t.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1101
1101
|
{ label: "下一页", value: "next", disabled: t.loading || t.disableNext, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1102
1102
|
],
|
|
1103
|
-
onGroupClick:
|
|
1103
|
+
onGroupClick: H
|
|
1104
1104
|
}, null, 8, ["groupItems"]),
|
|
1105
1105
|
l("div", nn, [
|
|
1106
|
-
|
|
1106
|
+
ve(D, {
|
|
1107
1107
|
modelValue: m.value,
|
|
1108
|
-
"onUpdate:modelValue":
|
|
1108
|
+
"onUpdate:modelValue": b[1] || (b[1] = (A) => m.value = A),
|
|
1109
1109
|
options: f.value,
|
|
1110
1110
|
size: "small",
|
|
1111
1111
|
width: "105px",
|
|
@@ -1118,7 +1118,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1118
1118
|
]);
|
|
1119
1119
|
};
|
|
1120
1120
|
}
|
|
1121
|
-
}), on = /* @__PURE__ */
|
|
1121
|
+
}), on = /* @__PURE__ */ xe(ln, [["__scopeId", "data-v-5a512f0f"]]), an = ["aria-label"], sn = { class: "y-badge__inner" }, rn = {
|
|
1122
1122
|
key: 0,
|
|
1123
1123
|
class: "y-badge__progress",
|
|
1124
1124
|
"aria-hidden": "true"
|
|
@@ -1127,12 +1127,12 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1127
1127
|
class: "icon",
|
|
1128
1128
|
viewBox: "0 0 20 20",
|
|
1129
1129
|
fill: "currentColor"
|
|
1130
|
-
},
|
|
1130
|
+
}, dn = {
|
|
1131
1131
|
key: 1,
|
|
1132
1132
|
class: "icon",
|
|
1133
1133
|
viewBox: "0 0 20 20",
|
|
1134
1134
|
fill: "currentColor"
|
|
1135
|
-
},
|
|
1135
|
+
}, cn = {
|
|
1136
1136
|
key: 2,
|
|
1137
1137
|
class: "icon",
|
|
1138
1138
|
viewBox: "0 0 20 20",
|
|
@@ -1161,7 +1161,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1161
1161
|
class: "icon",
|
|
1162
1162
|
viewBox: "0 0 20 20",
|
|
1163
1163
|
fill: "currentColor"
|
|
1164
|
-
}, gn = { class: "y-badge__label" }, mn = /* @__PURE__ */
|
|
1164
|
+
}, gn = { class: "y-badge__label" }, mn = /* @__PURE__ */ ke({
|
|
1165
1165
|
__name: "ybadge",
|
|
1166
1166
|
props: {
|
|
1167
1167
|
tone: { default: "default" },
|
|
@@ -1173,15 +1173,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1173
1173
|
label: { default: "" }
|
|
1174
1174
|
},
|
|
1175
1175
|
setup(t) {
|
|
1176
|
-
const
|
|
1177
|
-
const m = (
|
|
1178
|
-
if (
|
|
1176
|
+
const w = t, e = j(() => w.tone || "default"), n = j(() => {
|
|
1177
|
+
const m = (w.label || "").trim(), f = w.tone, v = w.progress;
|
|
1178
|
+
if (v) {
|
|
1179
1179
|
const S = {
|
|
1180
1180
|
incomplete: "未完成",
|
|
1181
1181
|
partiallyComplete: "部分完成",
|
|
1182
1182
|
complete: "已完成"
|
|
1183
1183
|
};
|
|
1184
|
-
return m ? `${m},进度:${S[
|
|
1184
|
+
return m ? `${m},进度:${S[v] || v}` : `进度:${S[v] || v}`;
|
|
1185
1185
|
}
|
|
1186
1186
|
if (f && f !== "default") {
|
|
1187
1187
|
const S = {
|
|
@@ -1197,7 +1197,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1197
1197
|
return m || "标记";
|
|
1198
1198
|
});
|
|
1199
1199
|
return (m, f) => (s(), r("span", {
|
|
1200
|
-
class:
|
|
1200
|
+
class: B(["y-badge", [
|
|
1201
1201
|
`y-badge--${e.value}`,
|
|
1202
1202
|
`y-badge--${t.size}`,
|
|
1203
1203
|
{ "is-outline": t.outline, "is-pill": t.pill },
|
|
@@ -1214,7 +1214,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1214
1214
|
cy: "10",
|
|
1215
1215
|
r: "5"
|
|
1216
1216
|
}, null, -1)
|
|
1217
|
-
])])) : t.progress === "partiallyComplete" ? (s(), r("svg",
|
|
1217
|
+
])])) : t.progress === "partiallyComplete" ? (s(), r("svg", dn, [...f[1] || (f[1] = [
|
|
1218
1218
|
l("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1219
1219
|
l("circle", {
|
|
1220
1220
|
cx: "10",
|
|
@@ -1224,7 +1224,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1224
1224
|
stroke: "currentColor",
|
|
1225
1225
|
"stroke-width": "2"
|
|
1226
1226
|
}, null, -1)
|
|
1227
|
-
])])) : t.progress === "complete" ? (s(), r("svg",
|
|
1227
|
+
])])) : t.progress === "complete" ? (s(), r("svg", cn, [...f[2] || (f[2] = [
|
|
1228
1228
|
l("path", {
|
|
1229
1229
|
"fill-rule": "evenodd",
|
|
1230
1230
|
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",
|
|
@@ -1260,19 +1260,19 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1260
1260
|
])) : W("", !0),
|
|
1261
1261
|
l("span", gn, [
|
|
1262
1262
|
fe(m.$slots, "default", {}, () => [
|
|
1263
|
-
Se(
|
|
1263
|
+
Se(oe(t.label), 1)
|
|
1264
1264
|
], !0)
|
|
1265
1265
|
])
|
|
1266
1266
|
])
|
|
1267
1267
|
], 10, an));
|
|
1268
1268
|
}
|
|
1269
|
-
}), wn = /* @__PURE__ */
|
|
1269
|
+
}), wn = /* @__PURE__ */ xe(mn, [["__scopeId", "data-v-ce819797"]]), bn = ["aria-hidden"], kn = ["onKeydown"], xn = {
|
|
1270
1270
|
key: 0,
|
|
1271
1271
|
class: "y-dialog-header"
|
|
1272
1272
|
}, $n = { class: "y-dialog-title" }, Dn = { class: "y-dialog-body" }, Cn = {
|
|
1273
1273
|
key: 1,
|
|
1274
1274
|
class: "y-dialog-footer"
|
|
1275
|
-
}, _n = /* @__PURE__ */
|
|
1275
|
+
}, _n = /* @__PURE__ */ ke({
|
|
1276
1276
|
__name: "ydialog",
|
|
1277
1277
|
props: {
|
|
1278
1278
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1286,13 +1286,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1286
1286
|
center: { type: Boolean, default: !1 }
|
|
1287
1287
|
},
|
|
1288
1288
|
emits: ["update:modelValue", "open", "close"],
|
|
1289
|
-
setup(t, { emit:
|
|
1290
|
-
const e = t, n =
|
|
1289
|
+
setup(t, { emit: w }) {
|
|
1290
|
+
const e = t, n = w, m = j({
|
|
1291
1291
|
get: () => e.modelValue,
|
|
1292
|
-
set: (
|
|
1293
|
-
}), f = K(null),
|
|
1294
|
-
const
|
|
1295
|
-
return
|
|
1292
|
+
set: (b) => n("update:modelValue", b)
|
|
1293
|
+
}), f = K(null), v = j(() => {
|
|
1294
|
+
const b = {};
|
|
1295
|
+
return b.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), b.margin = "0 auto", b.top = e.top, b;
|
|
1296
1296
|
});
|
|
1297
1297
|
function S() {
|
|
1298
1298
|
e.maskClosable && x();
|
|
@@ -1300,46 +1300,46 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1300
1300
|
function x() {
|
|
1301
1301
|
m.value && (m.value = !1, n("close"));
|
|
1302
1302
|
}
|
|
1303
|
-
function
|
|
1303
|
+
function H() {
|
|
1304
1304
|
e.closable && x();
|
|
1305
1305
|
}
|
|
1306
|
-
function $(
|
|
1307
|
-
|
|
1306
|
+
function $(b) {
|
|
1307
|
+
b.key === "Escape" && H();
|
|
1308
1308
|
}
|
|
1309
|
-
return
|
|
1310
|
-
|
|
1311
|
-
var
|
|
1312
|
-
return (
|
|
1309
|
+
return re(() => e.modelValue, (b) => {
|
|
1310
|
+
b ? (n("open"), requestAnimationFrame(() => {
|
|
1311
|
+
var c;
|
|
1312
|
+
return (c = f.value) == null ? void 0 : c.focus();
|
|
1313
1313
|
}), document.addEventListener("keydown", $), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", $), document.body.style.overflow = "");
|
|
1314
1314
|
}), Me(() => {
|
|
1315
1315
|
e.modelValue && (document.addEventListener("keydown", $), document.body.style.overflow = "hidden");
|
|
1316
|
-
}),
|
|
1316
|
+
}), He(() => {
|
|
1317
1317
|
document.removeEventListener("keydown", $), document.body.style.overflow = "";
|
|
1318
|
-
}), (
|
|
1319
|
-
|
|
1318
|
+
}), (b, c) => (s(), Te(Fe, { to: "body" }, [
|
|
1319
|
+
Le(l("div", {
|
|
1320
1320
|
class: "y-dialog-root",
|
|
1321
1321
|
role: "dialog",
|
|
1322
1322
|
"aria-modal": !0,
|
|
1323
1323
|
"aria-hidden": !m.value,
|
|
1324
|
-
style:
|
|
1324
|
+
style: ce({ zIndex: String(t.zIndex) })
|
|
1325
1325
|
}, [
|
|
1326
1326
|
l("div", {
|
|
1327
1327
|
class: "y-dialog-mask",
|
|
1328
1328
|
onClick: S
|
|
1329
1329
|
}),
|
|
1330
|
-
|
|
1330
|
+
ve(_e, { name: "dialog-zoom-fade" }, {
|
|
1331
1331
|
default: ye(() => [
|
|
1332
|
-
|
|
1332
|
+
Le(l("div", {
|
|
1333
1333
|
ref_key: "panelRef",
|
|
1334
1334
|
ref: f,
|
|
1335
|
-
class:
|
|
1336
|
-
style:
|
|
1337
|
-
onKeydown: Ce(G(
|
|
1335
|
+
class: B(["y-dialog-panel", [t.center ? "is-center" : ""]]),
|
|
1336
|
+
style: ce(v.value),
|
|
1337
|
+
onKeydown: Ce(G(H, ["prevent", "stop"]), ["esc"]),
|
|
1338
1338
|
tabindex: "-1"
|
|
1339
1339
|
}, [
|
|
1340
1340
|
t.showHeader ? (s(), r("div", xn, [
|
|
1341
|
-
fe(
|
|
1342
|
-
l("div", $n,
|
|
1341
|
+
fe(b.$slots, "header", {}, () => [
|
|
1342
|
+
l("div", $n, oe(t.title), 1)
|
|
1343
1343
|
], !0),
|
|
1344
1344
|
t.closable ? (s(), r("button", {
|
|
1345
1345
|
key: 0,
|
|
@@ -1350,23 +1350,23 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1350
1350
|
}, " ✕ ")) : W("", !0)
|
|
1351
1351
|
])) : W("", !0),
|
|
1352
1352
|
l("div", Dn, [
|
|
1353
|
-
fe(
|
|
1353
|
+
fe(b.$slots, "default", {}, void 0, !0)
|
|
1354
1354
|
]),
|
|
1355
|
-
|
|
1356
|
-
fe(
|
|
1355
|
+
b.$slots.footer ? (s(), r("div", Cn, [
|
|
1356
|
+
fe(b.$slots, "footer", {}, void 0, !0)
|
|
1357
1357
|
])) : W("", !0)
|
|
1358
1358
|
], 46, kn), [
|
|
1359
|
-
[
|
|
1359
|
+
[Be, m.value]
|
|
1360
1360
|
])
|
|
1361
1361
|
]),
|
|
1362
1362
|
_: 3
|
|
1363
1363
|
})
|
|
1364
1364
|
], 12, bn), [
|
|
1365
|
-
[
|
|
1365
|
+
[Be, m.value]
|
|
1366
1366
|
])
|
|
1367
1367
|
]));
|
|
1368
1368
|
}
|
|
1369
|
-
}), Sn = /* @__PURE__ */
|
|
1369
|
+
}), Sn = /* @__PURE__ */ xe(_n, [["__scopeId", "data-v-a7acc6dc"]]), Mn = { class: "ypopover__inner" }, Ln = /* @__PURE__ */ ke({
|
|
1370
1370
|
__name: "ypopover",
|
|
1371
1371
|
props: {
|
|
1372
1372
|
trigger: { default: "click" },
|
|
@@ -1385,137 +1385,137 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1385
1385
|
modelValue: { type: Boolean, default: !1 }
|
|
1386
1386
|
},
|
|
1387
1387
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1388
|
-
setup(t, { expose:
|
|
1389
|
-
const n = t, m = e, f = K(),
|
|
1390
|
-
let
|
|
1388
|
+
setup(t, { expose: w, emit: e }) {
|
|
1389
|
+
const n = t, m = e, f = K(), v = K(), S = K(), x = K(!1), H = K(), $ = K(), b = K({});
|
|
1390
|
+
let c = null, D = null;
|
|
1391
1391
|
const A = j(() => {
|
|
1392
|
-
if (!x.value || !
|
|
1392
|
+
if (!x.value || !H.value) return {};
|
|
1393
1393
|
const U = {};
|
|
1394
1394
|
n.width !== "auto" && (U.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (U.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1395
1395
|
const { top: te, left: p } = O();
|
|
1396
1396
|
return U.top = `${te}px`, U.left = `${p}px`, U;
|
|
1397
1397
|
}), P = j(() => {
|
|
1398
1398
|
if (!n.showArrow) return {};
|
|
1399
|
-
if (Object.keys(
|
|
1400
|
-
return
|
|
1399
|
+
if (Object.keys(b.value).length > 0)
|
|
1400
|
+
return b.value;
|
|
1401
1401
|
const U = {};
|
|
1402
1402
|
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? U.left = "50%" : U.top = "50%", U;
|
|
1403
1403
|
});
|
|
1404
1404
|
function O() {
|
|
1405
1405
|
var Y, ne;
|
|
1406
|
-
if (!
|
|
1407
|
-
const { width: U, height: te, top: p, left:
|
|
1408
|
-
let
|
|
1406
|
+
if (!H.value) return { top: 0, left: 0 };
|
|
1407
|
+
const { width: U, height: te, top: p, left: h } = H.value, o = ((Y = S.value) == null ? void 0 : Y.offsetWidth) || 200, a = ((ne = S.value) == null ? void 0 : ne.offsetHeight) || 100;
|
|
1408
|
+
let d = 0, k = 0;
|
|
1409
1409
|
switch (n.placement) {
|
|
1410
1410
|
case "top":
|
|
1411
|
-
|
|
1411
|
+
d = p - a - n.offset, k = h + (U - o) / 2;
|
|
1412
1412
|
break;
|
|
1413
1413
|
case "top-start":
|
|
1414
|
-
|
|
1414
|
+
d = p - a - n.offset, k = h;
|
|
1415
1415
|
break;
|
|
1416
1416
|
case "top-end":
|
|
1417
|
-
|
|
1417
|
+
d = p - a - n.offset, k = h + U - o;
|
|
1418
1418
|
break;
|
|
1419
1419
|
case "bottom":
|
|
1420
|
-
|
|
1420
|
+
d = p + te + n.offset, k = h + (U - o) / 2;
|
|
1421
1421
|
break;
|
|
1422
1422
|
case "bottom-start":
|
|
1423
|
-
|
|
1423
|
+
d = p + te + n.offset, k = h;
|
|
1424
1424
|
break;
|
|
1425
1425
|
case "bottom-end":
|
|
1426
|
-
|
|
1426
|
+
d = p + te + n.offset, k = h + U - o;
|
|
1427
1427
|
break;
|
|
1428
1428
|
case "left":
|
|
1429
|
-
|
|
1429
|
+
d = p + (te - a) / 2, k = h - o - n.offset;
|
|
1430
1430
|
break;
|
|
1431
1431
|
case "left-start":
|
|
1432
|
-
|
|
1432
|
+
d = p, k = h - o - n.offset;
|
|
1433
1433
|
break;
|
|
1434
1434
|
case "left-end":
|
|
1435
|
-
|
|
1435
|
+
d = p + te - a, k = h - o - n.offset;
|
|
1436
1436
|
break;
|
|
1437
1437
|
case "right":
|
|
1438
|
-
|
|
1438
|
+
d = p + (te - a) / 2, k = h + U + n.offset;
|
|
1439
1439
|
break;
|
|
1440
1440
|
case "right-start":
|
|
1441
|
-
|
|
1441
|
+
d = p, k = h + U + n.offset;
|
|
1442
1442
|
break;
|
|
1443
1443
|
case "right-end":
|
|
1444
|
-
|
|
1444
|
+
d = p + te - a, k = h + U + n.offset;
|
|
1445
1445
|
break;
|
|
1446
1446
|
}
|
|
1447
|
-
const M = window.innerWidth,
|
|
1448
|
-
return
|
|
1447
|
+
const M = window.innerWidth, z = window.innerHeight;
|
|
1448
|
+
return k < 8 && (k = 8), k + o > M - 8 && (k = M - o - 8), d < 8 && (d = 8), d + a > z - 8 && (d = z - a - 8), { top: d, left: k };
|
|
1449
1449
|
}
|
|
1450
1450
|
function V() {
|
|
1451
|
-
n.disabled || x.value || (ee(), n.openDelay > 0 ?
|
|
1451
|
+
n.disabled || x.value || (ee(), n.openDelay > 0 ? c = setTimeout(() => {
|
|
1452
1452
|
Q();
|
|
1453
1453
|
}, n.openDelay) : Q());
|
|
1454
1454
|
}
|
|
1455
1455
|
function Q() {
|
|
1456
|
-
m("before-show"), x.value = !0, m("update:modelValue", !0), m("show"),
|
|
1457
|
-
|
|
1456
|
+
m("before-show"), x.value = !0, m("update:modelValue", !0), m("show"), de(() => {
|
|
1457
|
+
de(() => {
|
|
1458
1458
|
E();
|
|
1459
1459
|
});
|
|
1460
1460
|
});
|
|
1461
1461
|
}
|
|
1462
1462
|
function J() {
|
|
1463
1463
|
x.value && (ee(), n.closeDelay > 0 ? D = setTimeout(() => {
|
|
1464
|
-
|
|
1465
|
-
}, n.closeDelay) :
|
|
1464
|
+
ae();
|
|
1465
|
+
}, n.closeDelay) : ae());
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function ae() {
|
|
1468
1468
|
m("before-hide"), x.value = !1, m("update:modelValue", !1), m("hide");
|
|
1469
1469
|
}
|
|
1470
1470
|
function ee() {
|
|
1471
|
-
|
|
1471
|
+
c && (clearTimeout(c), c = null), D && (clearTimeout(D), D = null);
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1474
|
-
if (!n.showArrow || !
|
|
1475
|
-
|
|
1473
|
+
function he() {
|
|
1474
|
+
if (!n.showArrow || !H.value || !S.value) {
|
|
1475
|
+
b.value = {};
|
|
1476
1476
|
return;
|
|
1477
1477
|
}
|
|
1478
|
-
const U =
|
|
1478
|
+
const U = H.value, te = S.value.getBoundingClientRect();
|
|
1479
1479
|
if (te.width === 0 || te.height === 0) {
|
|
1480
|
-
const
|
|
1481
|
-
n.placement.startsWith("top") || n.placement.startsWith("bottom") ?
|
|
1480
|
+
const h = {};
|
|
1481
|
+
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%", b.value = h;
|
|
1482
1482
|
return;
|
|
1483
1483
|
}
|
|
1484
1484
|
const p = {};
|
|
1485
1485
|
if (n.placement.startsWith("top")) {
|
|
1486
1486
|
p.bottom = "-6px";
|
|
1487
|
-
const
|
|
1487
|
+
const h = U.left + U.width / 2, o = te.left, a = h - o;
|
|
1488
1488
|
p.left = `${Math.max(12, Math.min(a, te.width - 12))}px`;
|
|
1489
1489
|
} else if (n.placement.startsWith("bottom")) {
|
|
1490
1490
|
p.top = "-6px";
|
|
1491
|
-
const
|
|
1491
|
+
const h = U.left + U.width / 2, o = te.left, a = h - o;
|
|
1492
1492
|
p.left = `${Math.max(12, Math.min(a, te.width - 12))}px`;
|
|
1493
1493
|
} else if (n.placement.startsWith("left")) {
|
|
1494
1494
|
p.right = "-6px";
|
|
1495
|
-
const
|
|
1495
|
+
const h = U.top + U.height / 2, o = te.top, a = h - o;
|
|
1496
1496
|
p.top = `${Math.max(12, Math.min(a, te.height - 12))}px`;
|
|
1497
1497
|
} else if (n.placement.startsWith("right")) {
|
|
1498
1498
|
p.left = "-6px";
|
|
1499
|
-
const
|
|
1499
|
+
const h = U.top + U.height / 2, o = te.top, a = h - o;
|
|
1500
1500
|
p.top = `${Math.max(12, Math.min(a, te.height - 12))}px`;
|
|
1501
1501
|
}
|
|
1502
|
-
|
|
1502
|
+
b.value = p;
|
|
1503
1503
|
}
|
|
1504
1504
|
function E() {
|
|
1505
|
-
|
|
1506
|
-
S.value && ($.value = S.value.getBoundingClientRect(),
|
|
1505
|
+
v.value && (H.value = v.value.getBoundingClientRect(), S.value && ($.value = S.value.getBoundingClientRect(), he(), x.value && requestAnimationFrame(() => {
|
|
1506
|
+
S.value && ($.value = S.value.getBoundingClientRect(), he());
|
|
1507
1507
|
})));
|
|
1508
1508
|
}
|
|
1509
1509
|
function F() {
|
|
1510
1510
|
n.disabled || n.trigger === "click" && (x.value ? J() : V());
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function T() {
|
|
1513
1513
|
n.disabled || n.trigger !== "hover" || (ee(), V());
|
|
1514
1514
|
}
|
|
1515
1515
|
function N() {
|
|
1516
1516
|
n.disabled || n.trigger !== "hover" || J();
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1518
|
+
function se() {
|
|
1519
1519
|
n.disabled || n.trigger !== "hover" || ee();
|
|
1520
1520
|
}
|
|
1521
1521
|
function q() {
|
|
@@ -1526,10 +1526,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1526
1526
|
const te = U.target;
|
|
1527
1527
|
f.value && !f.value.contains(te) && S.value && !S.value.contains(te) && J();
|
|
1528
1528
|
}
|
|
1529
|
-
return
|
|
1529
|
+
return re(() => n.modelValue, (U) => {
|
|
1530
1530
|
U !== x.value && (U ? V() : J());
|
|
1531
|
-
}),
|
|
1532
|
-
U ? (document.addEventListener("click", ge), window.addEventListener("resize", E), window.addEventListener("scroll", E, !0),
|
|
1531
|
+
}), re(x, (U) => {
|
|
1532
|
+
U ? (document.addEventListener("click", ge), window.addEventListener("resize", E), window.addEventListener("scroll", E, !0), de(() => {
|
|
1533
1533
|
E(), requestAnimationFrame(() => {
|
|
1534
1534
|
E();
|
|
1535
1535
|
}), setTimeout(() => {
|
|
@@ -1538,9 +1538,9 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1538
1538
|
})) : (document.removeEventListener("click", ge), window.removeEventListener("resize", E), window.removeEventListener("scroll", E, !0));
|
|
1539
1539
|
}), Me(() => {
|
|
1540
1540
|
n.modelValue && V();
|
|
1541
|
-
}),
|
|
1541
|
+
}), He(() => {
|
|
1542
1542
|
ee(), document.removeEventListener("click", ge), window.removeEventListener("resize", E), window.removeEventListener("scroll", E, !0);
|
|
1543
|
-
}),
|
|
1543
|
+
}), w({
|
|
1544
1544
|
show: V,
|
|
1545
1545
|
hide: J,
|
|
1546
1546
|
updatePosition: E
|
|
@@ -1551,37 +1551,37 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1551
1551
|
}, [
|
|
1552
1552
|
l("div", {
|
|
1553
1553
|
ref_key: "triggerRef",
|
|
1554
|
-
ref:
|
|
1554
|
+
ref: v,
|
|
1555
1555
|
onClick: F,
|
|
1556
|
-
onMouseenter:
|
|
1556
|
+
onMouseenter: T,
|
|
1557
1557
|
onMouseleave: N
|
|
1558
1558
|
}, [
|
|
1559
1559
|
fe(U.$slots, "reference", {}, void 0, !0)
|
|
1560
1560
|
], 544),
|
|
1561
|
-
(s(),
|
|
1562
|
-
|
|
1561
|
+
(s(), Te(Fe, { to: "body" }, [
|
|
1562
|
+
ve(_e, { name: "ypopover-fade" }, {
|
|
1563
1563
|
default: ye(() => [
|
|
1564
1564
|
x.value ? (s(), r("div", {
|
|
1565
1565
|
key: 0,
|
|
1566
1566
|
ref_key: "contentRef",
|
|
1567
1567
|
ref: S,
|
|
1568
|
-
class:
|
|
1568
|
+
class: B(["ypopover__content", [
|
|
1569
1569
|
`ypopover__content--${t.placement}`,
|
|
1570
1570
|
{
|
|
1571
1571
|
"ypopover__content--dark": t.dark,
|
|
1572
1572
|
"ypopover__content--no-padding": !t.showPadding
|
|
1573
1573
|
}
|
|
1574
1574
|
]]),
|
|
1575
|
-
style:
|
|
1575
|
+
style: ce(A.value),
|
|
1576
1576
|
onClick: te[0] || (te[0] = G(() => {
|
|
1577
1577
|
}, ["stop"])),
|
|
1578
|
-
onMouseenter:
|
|
1578
|
+
onMouseenter: se,
|
|
1579
1579
|
onMouseleave: q
|
|
1580
1580
|
}, [
|
|
1581
1581
|
t.showArrow ? (s(), r("div", {
|
|
1582
1582
|
key: 0,
|
|
1583
|
-
class:
|
|
1584
|
-
style:
|
|
1583
|
+
class: B(["ypopover__arrow", `ypopover__arrow--${t.placement}`]),
|
|
1584
|
+
style: ce(P.value)
|
|
1585
1585
|
}, null, 6)) : W("", !0),
|
|
1586
1586
|
l("div", Mn, [
|
|
1587
1587
|
fe(U.$slots, "default", {}, void 0, !0)
|
|
@@ -1593,7 +1593,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1593
1593
|
]))
|
|
1594
1594
|
], 512));
|
|
1595
1595
|
}
|
|
1596
|
-
}),
|
|
1596
|
+
}), In = /* @__PURE__ */ xe(Ln, [["__scopeId", "data-v-be755399"]]), En = { class: "relative" }, Bn = ["value", "placeholder"], Tn = { class: "nh-time-suffix" }, Kn = { class: "nh-time-shortcuts" }, zn = { class: "nh-time-shortcuts-list" }, Hn = ["onClick", "onKeydown", "onMouseenter"], Rn = { class: "nh-time-custom" }, An = { class: "nh-time-custom-header" }, Wn = { class: "nh-time-selection-status" }, Vn = {
|
|
1597
1597
|
key: 0,
|
|
1598
1598
|
class: "status-text"
|
|
1599
1599
|
}, Fn = {
|
|
@@ -1602,7 +1602,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1602
1602
|
}, Pn = {
|
|
1603
1603
|
key: 2,
|
|
1604
1604
|
class: "status-text status-complete"
|
|
1605
|
-
}, Nn = { class: "nh-time-pickers" }, Yn = { class: "nh-time-picker" }, On = { class: "nh-date-picker" }, jn = { class: "nh-date-picker-header" }, qn = { class: "nh-date-picker-header-label" }, Un = { class: "nh-date-picker-content" }, Zn = { class: "nh-date-table" }, Qn = ["onClick"], Jn = { class: "nh-date-table-cell" }, Xn = { key: 0 }, Gn = { class: "nh-time-picker" }, el = { class: "nh-date-picker" }, tl = { class: "nh-date-picker-header" }, nl = { class: "nh-date-picker-header-label" }, ll = { class: "nh-date-picker-content" }, ol = { class: "nh-date-table" }, al = ["onClick"], sl = { class: "nh-date-table-cell" }, il = { key: 0 }, rl = { class: "nh-time-actions" }, ul = /* @__PURE__ */
|
|
1605
|
+
}, Nn = { class: "nh-time-pickers" }, Yn = { class: "nh-time-picker" }, On = { class: "nh-date-picker" }, jn = { class: "nh-date-picker-header" }, qn = { class: "nh-date-picker-header-label" }, Un = { class: "nh-date-picker-content" }, Zn = { class: "nh-date-table" }, Qn = ["onClick"], Jn = { class: "nh-date-table-cell" }, Xn = { key: 0 }, Gn = { class: "nh-time-picker" }, el = { class: "nh-date-picker" }, tl = { class: "nh-date-picker-header" }, nl = { class: "nh-date-picker-header-label" }, ll = { class: "nh-date-picker-content" }, ol = { class: "nh-date-table" }, al = ["onClick"], sl = { class: "nh-date-table-cell" }, il = { key: 0 }, rl = { class: "nh-time-actions" }, ul = /* @__PURE__ */ ke({
|
|
1606
1606
|
__name: "ytime",
|
|
1607
1607
|
props: {
|
|
1608
1608
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1611,8 +1611,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1611
1611
|
{
|
|
1612
1612
|
label: "今天",
|
|
1613
1613
|
getValue: () => {
|
|
1614
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1615
|
-
return { startDate:
|
|
1614
|
+
const t = /* @__PURE__ */ new Date(), w = new Date(t.getFullYear(), t.getMonth(), t.getDate()), e = new Date(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59);
|
|
1615
|
+
return { startDate: w, endDate: e };
|
|
1616
1616
|
}
|
|
1617
1617
|
},
|
|
1618
1618
|
{
|
|
@@ -1620,29 +1620,29 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1620
1620
|
getValue: () => {
|
|
1621
1621
|
const t = /* @__PURE__ */ new Date();
|
|
1622
1622
|
t.setDate(t.getDate() - 1);
|
|
1623
|
-
const
|
|
1624
|
-
return { startDate:
|
|
1623
|
+
const w = new Date(t.getFullYear(), t.getMonth(), t.getDate()), e = new Date(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59);
|
|
1624
|
+
return { startDate: w, endDate: e };
|
|
1625
1625
|
}
|
|
1626
1626
|
},
|
|
1627
1627
|
{
|
|
1628
1628
|
label: "近7天",
|
|
1629
1629
|
getValue: () => {
|
|
1630
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1631
|
-
return
|
|
1630
|
+
const t = /* @__PURE__ */ new Date(), w = /* @__PURE__ */ new Date();
|
|
1631
|
+
return w.setDate(w.getDate() - 6), w.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), { startDate: w, endDate: t };
|
|
1632
1632
|
}
|
|
1633
1633
|
},
|
|
1634
1634
|
{
|
|
1635
1635
|
label: "近30天",
|
|
1636
1636
|
getValue: () => {
|
|
1637
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1638
|
-
return
|
|
1637
|
+
const t = /* @__PURE__ */ new Date(), w = /* @__PURE__ */ new Date();
|
|
1638
|
+
return w.setDate(w.getDate() - 29), w.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), { startDate: w, endDate: t };
|
|
1639
1639
|
}
|
|
1640
1640
|
},
|
|
1641
1641
|
{
|
|
1642
1642
|
label: "近3个月",
|
|
1643
1643
|
getValue: () => {
|
|
1644
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1645
|
-
return
|
|
1644
|
+
const t = /* @__PURE__ */ new Date(), w = /* @__PURE__ */ new Date();
|
|
1645
|
+
return w.setMonth(w.getMonth() - 3), w.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), { startDate: w, endDate: t };
|
|
1646
1646
|
}
|
|
1647
1647
|
}
|
|
1648
1648
|
] },
|
|
@@ -1652,27 +1652,27 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1652
1652
|
size: { default: "small" }
|
|
1653
1653
|
},
|
|
1654
1654
|
emits: ["update:modelValue", "change"],
|
|
1655
|
-
setup(t, { emit:
|
|
1656
|
-
const e = t, n =
|
|
1655
|
+
setup(t, { emit: w }) {
|
|
1656
|
+
const e = t, n = w, m = K(!1), f = K(-1), v = K(-1), S = K(null), x = K(), H = K(), $ = K({
|
|
1657
1657
|
top: !0,
|
|
1658
1658
|
left: !0
|
|
1659
|
-
}),
|
|
1659
|
+
}), b = K({
|
|
1660
1660
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1661
1661
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1662
|
-
}),
|
|
1662
|
+
}), c = K({
|
|
1663
1663
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1664
1664
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1665
1665
|
}), D = () => {
|
|
1666
|
-
const i = new Date(
|
|
1666
|
+
const i = new Date(b.value.year, b.value.month).getTime(), y = new Date(c.value.year, c.value.month).getTime();
|
|
1667
1667
|
if (i >= y) {
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1668
|
+
const I = new Date(b.value.year, b.value.month + 1);
|
|
1669
|
+
c.value.year = I.getFullYear(), c.value.month = I.getMonth();
|
|
1670
1670
|
}
|
|
1671
1671
|
}, A = () => {
|
|
1672
|
-
const i = new Date(
|
|
1673
|
-
if (new Date(
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1672
|
+
const i = new Date(b.value.year, b.value.month).getTime();
|
|
1673
|
+
if (new Date(c.value.year, c.value.month).getTime() <= i) {
|
|
1674
|
+
const I = new Date(c.value.year, c.value.month - 1);
|
|
1675
|
+
b.value.year = I.getFullYear(), b.value.month = I.getMonth();
|
|
1676
1676
|
}
|
|
1677
1677
|
}, P = ["一", "二", "三", "四", "五", "六", "日"], O = K(null), V = K(null), Q = (i) => {
|
|
1678
1678
|
if (!i) return null;
|
|
@@ -1686,29 +1686,29 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1686
1686
|
return null;
|
|
1687
1687
|
}, J = (i) => {
|
|
1688
1688
|
if (!i) return null;
|
|
1689
|
-
const y = i.getFullYear(),
|
|
1689
|
+
const y = i.getFullYear(), I = String(i.getMonth() + 1).padStart(2, "0"), Z = String(i.getDate()).padStart(2, "0");
|
|
1690
1690
|
if (e.includeTime) {
|
|
1691
|
-
const
|
|
1692
|
-
return `${y}-${
|
|
1691
|
+
const ie = String(i.getHours()).padStart(2, "0"), ue = String(i.getMinutes()).padStart(2, "0"), le = String(i.getSeconds()).padStart(2, "0");
|
|
1692
|
+
return `${y}-${I}-${Z} ${ie}:${ue}:${le}`;
|
|
1693
1693
|
} else
|
|
1694
|
-
return `${y}-${
|
|
1695
|
-
},
|
|
1694
|
+
return `${y}-${I}-${Z}`;
|
|
1695
|
+
}, ae = (i) => i ? i.getTime() : null, ee = (i) => i ? {
|
|
1696
1696
|
startDate: Q(i.startDate),
|
|
1697
1697
|
endDate: Q(i.endDate)
|
|
1698
|
-
} : { startDate: null, endDate: null },
|
|
1698
|
+
} : { startDate: null, endDate: null }, he = (i) => e.format === "string" ? {
|
|
1699
1699
|
startDate: J(i.startDate),
|
|
1700
1700
|
endDate: J(i.endDate)
|
|
1701
1701
|
} : e.format === "timestamp" ? {
|
|
1702
|
-
startDate:
|
|
1703
|
-
endDate:
|
|
1704
|
-
} : i, E = (i, y) => `${String(y + 1).padStart(2, "0")}/${i}`, F = (i, y) => i.getFullYear() === y.getFullYear() && i.getMonth() === y.getMonth() && i.getDate() === y.getDate(),
|
|
1702
|
+
startDate: ae(i.startDate),
|
|
1703
|
+
endDate: ae(i.endDate)
|
|
1704
|
+
} : i, E = (i, y) => `${String(y + 1).padStart(2, "0")}/${i}`, F = (i, y) => i.getFullYear() === y.getFullYear() && i.getMonth() === y.getMonth() && i.getDate() === y.getDate(), T = (i, y, I) => !y || !I ? !1 : i >= y && i <= I, N = (i) => {
|
|
1705
1705
|
const y = ee(i);
|
|
1706
1706
|
if (!(y != null && y.startDate) || !(y != null && y.endDate))
|
|
1707
1707
|
return -1;
|
|
1708
|
-
for (let
|
|
1709
|
-
const Z = e.shortcuts[
|
|
1708
|
+
for (let I = 0; I < e.shortcuts.length; I++) {
|
|
1709
|
+
const Z = e.shortcuts[I].getValue();
|
|
1710
1710
|
if (Z.startDate && Z.endDate && y.startDate && y.endDate) {
|
|
1711
|
-
const
|
|
1711
|
+
const ie = new Date(
|
|
1712
1712
|
y.startDate.getFullYear(),
|
|
1713
1713
|
y.startDate.getMonth(),
|
|
1714
1714
|
y.startDate.getDate()
|
|
@@ -1725,20 +1725,20 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1725
1725
|
Z.endDate.getMonth(),
|
|
1726
1726
|
Z.endDate.getDate()
|
|
1727
1727
|
);
|
|
1728
|
-
if (
|
|
1729
|
-
return
|
|
1728
|
+
if (ie.getTime() === le.getTime() && ue.getTime() === we.getTime())
|
|
1729
|
+
return I;
|
|
1730
1730
|
}
|
|
1731
1731
|
}
|
|
1732
1732
|
return -1;
|
|
1733
|
-
},
|
|
1734
|
-
const
|
|
1733
|
+
}, se = (i, y) => {
|
|
1734
|
+
const I = new Date(i, y, 1), Z = new Date(i, y + 1, 0), ie = I.getDay(), ue = Z.getDate(), le = [], we = /* @__PURE__ */ new Date(), u = ie === 0 ? 6 : ie - 1, g = new Date(i, y, 0);
|
|
1735
1735
|
for (let C = u - 1; C >= 0; C--) {
|
|
1736
|
-
const
|
|
1736
|
+
const R = new Date(i, y - 1, g.getDate() - C);
|
|
1737
1737
|
le.push({
|
|
1738
|
-
date:
|
|
1739
|
-
day:
|
|
1738
|
+
date: R,
|
|
1739
|
+
day: R.getDate(),
|
|
1740
1740
|
isCurrentMonth: !1,
|
|
1741
|
-
isToday: F(
|
|
1741
|
+
isToday: F(R, we),
|
|
1742
1742
|
isSelected: !1,
|
|
1743
1743
|
isInRange: !1,
|
|
1744
1744
|
isDisabled: !0
|
|
@@ -1746,12 +1746,12 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1746
1746
|
});
|
|
1747
1747
|
}
|
|
1748
1748
|
for (let C = 1; C <= ue; C++) {
|
|
1749
|
-
const
|
|
1749
|
+
const R = new Date(i, y, C);
|
|
1750
1750
|
le.push({
|
|
1751
|
-
date:
|
|
1751
|
+
date: R,
|
|
1752
1752
|
day: C,
|
|
1753
1753
|
isCurrentMonth: !0,
|
|
1754
|
-
isToday: F(
|
|
1754
|
+
isToday: F(R, we),
|
|
1755
1755
|
isSelected: !1,
|
|
1756
1756
|
isInRange: !1,
|
|
1757
1757
|
isDisabled: !1
|
|
@@ -1759,85 +1759,85 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1759
1759
|
}
|
|
1760
1760
|
const _ = 42 - le.length;
|
|
1761
1761
|
for (let C = 1; C <= _; C++) {
|
|
1762
|
-
const
|
|
1762
|
+
const R = new Date(i, y + 1, C);
|
|
1763
1763
|
le.push({
|
|
1764
|
-
date:
|
|
1764
|
+
date: R,
|
|
1765
1765
|
day: C,
|
|
1766
1766
|
isCurrentMonth: !1,
|
|
1767
|
-
isToday: F(
|
|
1767
|
+
isToday: F(R, we),
|
|
1768
1768
|
isSelected: !1,
|
|
1769
1769
|
isInRange: !1,
|
|
1770
1770
|
isDisabled: !0
|
|
1771
1771
|
// 禁用非当前月的日期
|
|
1772
1772
|
});
|
|
1773
1773
|
}
|
|
1774
|
-
const
|
|
1774
|
+
const L = [];
|
|
1775
1775
|
for (let C = 0; C < le.length; C += 7)
|
|
1776
|
-
|
|
1777
|
-
return
|
|
1776
|
+
L.push(le.slice(C, C + 7));
|
|
1777
|
+
return L;
|
|
1778
1778
|
}, q = (i) => {
|
|
1779
|
-
const y =
|
|
1779
|
+
const y = he(i);
|
|
1780
1780
|
n("update:modelValue", y), n("change", y);
|
|
1781
1781
|
}, ge = () => {
|
|
1782
|
-
if (!x.value || !
|
|
1783
|
-
const i = x.value.getBoundingClientRect(), y =
|
|
1784
|
-
|
|
1785
|
-
const we =
|
|
1782
|
+
if (!x.value || !H.value) return;
|
|
1783
|
+
const i = x.value.getBoundingClientRect(), y = H.value.getBoundingClientRect(), I = window.innerWidth, ie = window.innerHeight - i.bottom, ue = i.top, le = y.height || 400;
|
|
1784
|
+
ie < le && ue > le ? $.value.top = !1 : $.value.top = !0;
|
|
1785
|
+
const we = I - i.left, u = y.width || 640;
|
|
1786
1786
|
we < u ? $.value.left = !1 : $.value.left = !0;
|
|
1787
1787
|
}, U = () => {
|
|
1788
1788
|
if (m.value = !m.value, m.value) {
|
|
1789
1789
|
const i = ee(e.modelValue);
|
|
1790
|
-
if (O.value = (i == null ? void 0 : i.startDate) || null, V.value = (i == null ? void 0 : i.endDate) || null,
|
|
1791
|
-
|
|
1790
|
+
if (O.value = (i == null ? void 0 : i.startDate) || null, V.value = (i == null ? void 0 : i.endDate) || null, v.value = N(e.modelValue), f.value = -1, i != null && i.startDate && (b.value.year = i.startDate.getFullYear(), b.value.month = i.startDate.getMonth()), i != null && i.endDate)
|
|
1791
|
+
c.value.year = i.endDate.getFullYear(), c.value.month = i.endDate.getMonth();
|
|
1792
1792
|
else {
|
|
1793
|
-
const y = new Date(
|
|
1794
|
-
|
|
1793
|
+
const y = new Date(b.value.year, b.value.month + 1);
|
|
1794
|
+
c.value.year = y.getFullYear(), c.value.month = y.getMonth();
|
|
1795
1795
|
}
|
|
1796
|
-
D(),
|
|
1796
|
+
D(), de(() => {
|
|
1797
1797
|
ge();
|
|
1798
1798
|
});
|
|
1799
1799
|
}
|
|
1800
1800
|
}, te = (i) => {
|
|
1801
|
-
const y = i.target,
|
|
1802
|
-
|
|
1801
|
+
const y = i.target, I = x.value, Z = H.value;
|
|
1802
|
+
I && Z && !I.contains(y) && !Z.contains(y) && (m.value = !1, f.value = -1);
|
|
1803
1803
|
}, p = (i) => {
|
|
1804
|
-
i.key === "Enter" || i.key === " " ? (i.preventDefault(), U()) : i.key === "ArrowDown" && (i.preventDefault(), m.value = !0,
|
|
1805
|
-
ge(),
|
|
1804
|
+
i.key === "Enter" || i.key === " " ? (i.preventDefault(), U()) : i.key === "ArrowDown" && (i.preventDefault(), m.value = !0, de(() => {
|
|
1805
|
+
ge(), k();
|
|
1806
1806
|
}));
|
|
1807
|
-
},
|
|
1807
|
+
}, h = (i) => {
|
|
1808
1808
|
var y;
|
|
1809
1809
|
i.key === "Escape" && (m.value = !1, f.value = -1, (y = x.value) == null || y.focus());
|
|
1810
1810
|
}, o = (i, y) => {
|
|
1811
|
-
i.key === "ArrowDown" ? (i.preventDefault(), f.value = Math.min(y + 1, e.shortcuts.length - 1), M(f.value)) : i.key === "ArrowUp" ? (i.preventDefault(), f.value = Math.max(y - 1, 0), M(f.value)) : (i.key === "Enter" || i.key === " ") && (i.preventDefault(),
|
|
1811
|
+
i.key === "ArrowDown" ? (i.preventDefault(), f.value = Math.min(y + 1, e.shortcuts.length - 1), M(f.value)) : i.key === "ArrowUp" ? (i.preventDefault(), f.value = Math.max(y - 1, 0), M(f.value)) : (i.key === "Enter" || i.key === " ") && (i.preventDefault(), z(e.shortcuts[y]));
|
|
1812
1812
|
}, a = (i) => {
|
|
1813
1813
|
f.value = i;
|
|
1814
|
-
},
|
|
1814
|
+
}, d = () => {
|
|
1815
1815
|
f.value = -1;
|
|
1816
|
-
},
|
|
1816
|
+
}, k = () => {
|
|
1817
1817
|
f.value = 0, M(0);
|
|
1818
1818
|
}, M = (i) => {
|
|
1819
|
-
if (
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1819
|
+
if (H.value) {
|
|
1820
|
+
const I = H.value.querySelectorAll(".nh-time-shortcut")[i];
|
|
1821
|
+
I && I.focus();
|
|
1822
1822
|
}
|
|
1823
|
-
},
|
|
1823
|
+
}, z = (i) => {
|
|
1824
1824
|
const y = i.getValue();
|
|
1825
|
-
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), q(y),
|
|
1825
|
+
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), q(y), v.value = e.shortcuts.findIndex((I) => I.label === i.label), f.value = -1, m.value = !1;
|
|
1826
1826
|
}, Y = (i, y) => {
|
|
1827
1827
|
if (!i || i.isDisabled) return;
|
|
1828
|
-
let
|
|
1829
|
-
if (e.includeTime ? (
|
|
1830
|
-
O.value =
|
|
1828
|
+
let I;
|
|
1829
|
+
if (e.includeTime ? (I = new Date(i.date), y === "start" || !O.value ? I.setHours(0, 0, 0, 0) : I.setHours(23, 59, 59, 999)) : I = new Date(i.date.getFullYear(), i.date.getMonth(), i.date.getDate()), !O.value && !V.value)
|
|
1830
|
+
O.value = I, V.value = null;
|
|
1831
1831
|
else if (O.value && !V.value)
|
|
1832
|
-
if (
|
|
1833
|
-
e.includeTime &&
|
|
1832
|
+
if (I >= O.value)
|
|
1833
|
+
e.includeTime && I.setHours(23, 59, 59, 999), V.value = I;
|
|
1834
1834
|
else {
|
|
1835
1835
|
const Z = O.value;
|
|
1836
|
-
e.includeTime && Z.setHours(23, 59, 59, 999), V.value = Z, O.value =
|
|
1836
|
+
e.includeTime && Z.setHours(23, 59, 59, 999), V.value = Z, O.value = I;
|
|
1837
1837
|
}
|
|
1838
1838
|
else
|
|
1839
|
-
O.value =
|
|
1840
|
-
if (
|
|
1839
|
+
O.value = I, V.value = null;
|
|
1840
|
+
if (v.value = -1, O.value && V.value) {
|
|
1841
1841
|
const Z = new Date(V.value);
|
|
1842
1842
|
e.includeTime && Z.setHours(23, 59, 59, 999), S.value = {
|
|
1843
1843
|
startDate: O.value,
|
|
@@ -1847,25 +1847,25 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1847
1847
|
S.value = null;
|
|
1848
1848
|
}, ne = (i, y) => {
|
|
1849
1849
|
if (!i) return ["nh-date-table-td"];
|
|
1850
|
-
const
|
|
1851
|
-
return i.isCurrentMonth ||
|
|
1852
|
-
},
|
|
1853
|
-
S.value && (e.includeTime && S.value.endDate && S.value.endDate.setHours(23, 59, 59, 999), q(S.value),
|
|
1854
|
-
},
|
|
1850
|
+
const I = ["nh-date-table-td"];
|
|
1851
|
+
return i.isCurrentMonth || I.push("is-prev-month"), i.isToday && I.push("is-today"), i.isDisabled && I.push("is-disabled"), O.value && F(i.date, O.value) && I.push("is-selected", "is-start"), V.value && F(i.date, V.value) && I.push("is-selected", "is-end"), O.value && V.value && T(i.date, O.value, V.value) && I.push("is-in-range"), I;
|
|
1852
|
+
}, $e = () => {
|
|
1853
|
+
S.value && (e.includeTime && S.value.endDate && S.value.endDate.setHours(23, 59, 59, 999), q(S.value), v.value = N(S.value), m.value = !1);
|
|
1854
|
+
}, Ke = () => {
|
|
1855
1855
|
q({ startDate: null, endDate: null }), Ie(), f.value = -1, m.value = !1;
|
|
1856
1856
|
}, We = () => {
|
|
1857
|
-
m.value &&
|
|
1857
|
+
m.value && de(() => {
|
|
1858
1858
|
ge();
|
|
1859
1859
|
});
|
|
1860
|
-
}, Pe = j(() =>
|
|
1860
|
+
}, Pe = j(() => se(b.value.year, b.value.month)), Ze = j(() => se(c.value.year, c.value.month)), Qe = j(() => {
|
|
1861
1861
|
const i = ee(e.modelValue);
|
|
1862
1862
|
if (!i || !i.startDate || !i.endDate)
|
|
1863
1863
|
return "";
|
|
1864
|
-
const y = (
|
|
1865
|
-
const ue = String(
|
|
1864
|
+
const y = (ie) => {
|
|
1865
|
+
const ue = String(ie.getFullYear()), le = String(ie.getMonth() + 1).padStart(2, "0"), we = String(ie.getDate()).padStart(2, "0");
|
|
1866
1866
|
return `${ue}/${le}/${we}`;
|
|
1867
|
-
},
|
|
1868
|
-
return !e.includeTime &&
|
|
1867
|
+
}, I = y(i.startDate), Z = y(i.endDate);
|
|
1868
|
+
return !e.includeTime && I === Z ? I : `${I} - ${Z}`;
|
|
1869
1869
|
}), Je = j(() => [
|
|
1870
1870
|
"nh-time-dropdown",
|
|
1871
1871
|
{
|
|
@@ -1875,57 +1875,57 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1875
1875
|
]), Ne = j(() => {
|
|
1876
1876
|
const i = ee(e.modelValue);
|
|
1877
1877
|
return !!(i != null && i.startDate && (i != null && i.endDate));
|
|
1878
|
-
}),
|
|
1879
|
-
O.value = null, V.value = null, S.value = null,
|
|
1878
|
+
}), Re = j(() => !!(O.value && V.value)), Ie = () => {
|
|
1879
|
+
O.value = null, V.value = null, S.value = null, v.value = -1;
|
|
1880
1880
|
};
|
|
1881
|
-
|
|
1881
|
+
re(() => e.modelValue, (i) => {
|
|
1882
1882
|
const y = ee(i);
|
|
1883
1883
|
if (y != null && y.startDate) {
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1884
|
+
const I = y.startDate;
|
|
1885
|
+
b.value.year = I.getFullYear(), b.value.month = I.getMonth();
|
|
1886
1886
|
}
|
|
1887
1887
|
if (y != null && y.endDate) {
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1888
|
+
const I = y.endDate;
|
|
1889
|
+
c.value.year = I.getFullYear(), c.value.month = I.getMonth();
|
|
1890
1890
|
} else if (y != null && y.startDate) {
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1891
|
+
const I = new Date(b.value.year, b.value.month + 1);
|
|
1892
|
+
c.value.year = I.getFullYear(), c.value.month = I.getMonth();
|
|
1893
1893
|
}
|
|
1894
|
-
(y != null && y.startDate || y != null && y.endDate) && D(), m.value || (
|
|
1895
|
-
}, { immediate: !0, deep: !0 }),
|
|
1896
|
-
const i = new Date(
|
|
1894
|
+
(y != null && y.startDate || y != null && y.endDate) && D(), m.value || (v.value = N(i));
|
|
1895
|
+
}, { immediate: !0, deep: !0 }), re([b, c], () => {
|
|
1896
|
+
const i = new Date(b.value.year, b.value.month).getTime(), y = new Date(c.value.year, c.value.month).getTime();
|
|
1897
1897
|
if (i === y) {
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1898
|
+
const I = new Date(b.value.year, b.value.month + 1);
|
|
1899
|
+
c.value.year = I.getFullYear(), c.value.month = I.getMonth();
|
|
1900
1900
|
}
|
|
1901
1901
|
}, { deep: !0 }), Me(() => {
|
|
1902
|
-
document.addEventListener("click", te), window.addEventListener("resize", We), window.addEventListener("scroll", We),
|
|
1902
|
+
document.addEventListener("click", te), window.addEventListener("resize", We), window.addEventListener("scroll", We), v.value = N(e.modelValue);
|
|
1903
1903
|
const i = ee(e.modelValue);
|
|
1904
|
-
if (i != null && i.startDate && (
|
|
1905
|
-
|
|
1904
|
+
if (i != null && i.startDate && (b.value.year = i.startDate.getFullYear(), b.value.month = i.startDate.getMonth()), i != null && i.endDate)
|
|
1905
|
+
c.value.year = i.endDate.getFullYear(), c.value.month = i.endDate.getMonth();
|
|
1906
1906
|
else {
|
|
1907
|
-
const y = new Date(
|
|
1908
|
-
|
|
1907
|
+
const y = new Date(b.value.year, b.value.month + 1);
|
|
1908
|
+
c.value.year = y.getFullYear(), c.value.month = y.getMonth();
|
|
1909
1909
|
}
|
|
1910
1910
|
D();
|
|
1911
|
-
}),
|
|
1911
|
+
}), He(() => {
|
|
1912
1912
|
document.removeEventListener("click", te), window.removeEventListener("resize", We), window.removeEventListener("scroll", We);
|
|
1913
1913
|
});
|
|
1914
|
-
const
|
|
1914
|
+
const ze = () => {
|
|
1915
1915
|
e.clearable && (q({ startDate: null, endDate: null }), Ie(), f.value = -1);
|
|
1916
|
-
},
|
|
1916
|
+
}, Ae = (i, y) => {
|
|
1917
1917
|
if (i === "start") {
|
|
1918
|
-
const
|
|
1919
|
-
|
|
1918
|
+
const I = new Date(b.value.year, b.value.month + y, 1);
|
|
1919
|
+
b.value.year = I.getFullYear(), b.value.month = I.getMonth(), D();
|
|
1920
1920
|
} else {
|
|
1921
|
-
const
|
|
1922
|
-
|
|
1921
|
+
const I = new Date(c.value.year, c.value.month + y, 1);
|
|
1922
|
+
c.value.year = I.getFullYear(), c.value.month = I.getMonth(), A();
|
|
1923
1923
|
}
|
|
1924
1924
|
};
|
|
1925
1925
|
return (i, y) => {
|
|
1926
|
-
const
|
|
1926
|
+
const I = Ve("YButton");
|
|
1927
1927
|
return s(), r("div", {
|
|
1928
|
-
class:
|
|
1928
|
+
class: B(["nh-time-search", [`nh-time--${t.size}`]])
|
|
1929
1929
|
}, [
|
|
1930
1930
|
l("div", En, [
|
|
1931
1931
|
l("div", {
|
|
@@ -1933,7 +1933,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1933
1933
|
ref: x,
|
|
1934
1934
|
onClick: U,
|
|
1935
1935
|
onKeydown: p,
|
|
1936
|
-
class:
|
|
1936
|
+
class: B(["nh-time-trigger", { "is-focus": m.value, "has-value": Ne.value }]),
|
|
1937
1937
|
tabindex: "0"
|
|
1938
1938
|
}, [
|
|
1939
1939
|
l("input", {
|
|
@@ -1945,7 +1945,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1945
1945
|
l("span", Tn, [
|
|
1946
1946
|
t.clearable && Ne.value ? (s(), r("i", {
|
|
1947
1947
|
key: 0,
|
|
1948
|
-
onClick: G(
|
|
1948
|
+
onClick: G(ze, ["stop"]),
|
|
1949
1949
|
class: "nh-time-clear"
|
|
1950
1950
|
}, [...y[4] || (y[4] = [
|
|
1951
1951
|
l("svg", {
|
|
@@ -1972,7 +1972,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1972
1972
|
])
|
|
1973
1973
|
], -1)),
|
|
1974
1974
|
l("i", {
|
|
1975
|
-
class:
|
|
1975
|
+
class: B(["nh-time-arrow", { "is-reverse": m.value }])
|
|
1976
1976
|
}, [...y[5] || (y[5] = [
|
|
1977
1977
|
l("svg", {
|
|
1978
1978
|
viewBox: "0 0 1024 1024",
|
|
@@ -1987,33 +1987,33 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1987
1987
|
])], 2)
|
|
1988
1988
|
])
|
|
1989
1989
|
], 34),
|
|
1990
|
-
|
|
1990
|
+
ve(_e, { name: "el-zoom-in-top" }, {
|
|
1991
1991
|
default: ye(() => [
|
|
1992
1992
|
m.value ? (s(), r("div", {
|
|
1993
1993
|
key: 0,
|
|
1994
1994
|
ref_key: "dropdown",
|
|
1995
|
-
ref:
|
|
1996
|
-
class:
|
|
1997
|
-
onKeydown:
|
|
1995
|
+
ref: H,
|
|
1996
|
+
class: B(Je.value),
|
|
1997
|
+
onKeydown: h
|
|
1998
1998
|
}, [
|
|
1999
1999
|
l("div", Kn, [
|
|
2000
2000
|
y[7] || (y[7] = l("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
2001
2001
|
l("ul", zn, [
|
|
2002
|
-
(s(!0), r(
|
|
2002
|
+
(s(!0), r(pe, null, me(t.shortcuts, (Z, ie) => (s(), r("li", {
|
|
2003
2003
|
key: Z.label,
|
|
2004
|
-
onClick: (ue) =>
|
|
2005
|
-
onKeydown: (ue) => o(ue,
|
|
2006
|
-
onMouseenter: (ue) => a(
|
|
2007
|
-
onMouseleave:
|
|
2008
|
-
class:
|
|
2004
|
+
onClick: (ue) => z(Z),
|
|
2005
|
+
onKeydown: (ue) => o(ue, ie),
|
|
2006
|
+
onMouseenter: (ue) => a(ie),
|
|
2007
|
+
onMouseleave: d,
|
|
2008
|
+
class: B([
|
|
2009
2009
|
"nh-time-shortcut",
|
|
2010
2010
|
{
|
|
2011
|
-
"is-active": f.value ===
|
|
2012
|
-
"is-selected":
|
|
2011
|
+
"is-active": f.value === ie,
|
|
2012
|
+
"is-selected": v.value === ie
|
|
2013
2013
|
}
|
|
2014
2014
|
]),
|
|
2015
2015
|
tabindex: "0"
|
|
2016
|
-
},
|
|
2016
|
+
}, oe(Z.label), 43, Hn))), 128))
|
|
2017
2017
|
])
|
|
2018
2018
|
]),
|
|
2019
2019
|
l("div", Rn, [
|
|
@@ -2028,7 +2028,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2028
2028
|
l("div", On, [
|
|
2029
2029
|
l("div", jn, [
|
|
2030
2030
|
l("button", {
|
|
2031
|
-
onClick: y[0] || (y[0] = (Z) =>
|
|
2031
|
+
onClick: y[0] || (y[0] = (Z) => Ae("start", -1)),
|
|
2032
2032
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
2033
2033
|
type: "button"
|
|
2034
2034
|
}, [...y[9] || (y[9] = [
|
|
@@ -2043,9 +2043,9 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2043
2043
|
})
|
|
2044
2044
|
], -1)
|
|
2045
2045
|
])]),
|
|
2046
|
-
l("span", qn,
|
|
2046
|
+
l("span", qn, oe(E(b.value.year, b.value.month)), 1),
|
|
2047
2047
|
l("button", {
|
|
2048
|
-
onClick: y[1] || (y[1] = (Z) =>
|
|
2048
|
+
onClick: y[1] || (y[1] = (Z) => Ae("start", 1)),
|
|
2049
2049
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2050
2050
|
type: "button"
|
|
2051
2051
|
}, [...y[10] || (y[10] = [
|
|
@@ -2065,23 +2065,23 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2065
2065
|
l("table", Zn, [
|
|
2066
2066
|
l("thead", null, [
|
|
2067
2067
|
l("tr", null, [
|
|
2068
|
-
(s(), r(
|
|
2068
|
+
(s(), r(pe, null, me(P, (Z) => l("th", {
|
|
2069
2069
|
key: Z,
|
|
2070
2070
|
class: "nh-date-table-th"
|
|
2071
|
-
},
|
|
2071
|
+
}, oe(Z), 1)), 64))
|
|
2072
2072
|
])
|
|
2073
2073
|
]),
|
|
2074
2074
|
l("tbody", null, [
|
|
2075
|
-
(s(!0), r(
|
|
2076
|
-
key: `start-week-${
|
|
2075
|
+
(s(!0), r(pe, null, me(Pe.value, (Z, ie) => (s(), r("tr", {
|
|
2076
|
+
key: `start-week-${ie}`
|
|
2077
2077
|
}, [
|
|
2078
|
-
(s(!0), r(
|
|
2079
|
-
key: `start-day-${
|
|
2080
|
-
class:
|
|
2078
|
+
(s(!0), r(pe, null, me(Z, (ue, le) => (s(), r("td", {
|
|
2079
|
+
key: `start-day-${ie}-${le}`,
|
|
2080
|
+
class: B(ne(ue)),
|
|
2081
2081
|
onClick: (we) => Y(ue, "start")
|
|
2082
2082
|
}, [
|
|
2083
2083
|
l("div", Jn, [
|
|
2084
|
-
ue ? (s(), r("span", Xn,
|
|
2084
|
+
ue ? (s(), r("span", Xn, oe(ue.day), 1)) : W("", !0)
|
|
2085
2085
|
])
|
|
2086
2086
|
], 10, Qn))), 128))
|
|
2087
2087
|
]))), 128))
|
|
@@ -2094,7 +2094,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2094
2094
|
l("div", el, [
|
|
2095
2095
|
l("div", tl, [
|
|
2096
2096
|
l("button", {
|
|
2097
|
-
onClick: y[2] || (y[2] = (Z) =>
|
|
2097
|
+
onClick: y[2] || (y[2] = (Z) => Ae("end", -1)),
|
|
2098
2098
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
2099
2099
|
type: "button"
|
|
2100
2100
|
}, [...y[11] || (y[11] = [
|
|
@@ -2109,9 +2109,9 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2109
2109
|
})
|
|
2110
2110
|
], -1)
|
|
2111
2111
|
])]),
|
|
2112
|
-
l("span", nl,
|
|
2112
|
+
l("span", nl, oe(E(c.value.year, c.value.month)), 1),
|
|
2113
2113
|
l("button", {
|
|
2114
|
-
onClick: y[3] || (y[3] = (Z) =>
|
|
2114
|
+
onClick: y[3] || (y[3] = (Z) => Ae("end", 1)),
|
|
2115
2115
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2116
2116
|
type: "button"
|
|
2117
2117
|
}, [...y[12] || (y[12] = [
|
|
@@ -2131,23 +2131,23 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2131
2131
|
l("table", ol, [
|
|
2132
2132
|
l("thead", null, [
|
|
2133
2133
|
l("tr", null, [
|
|
2134
|
-
(s(), r(
|
|
2134
|
+
(s(), r(pe, null, me(P, (Z) => l("th", {
|
|
2135
2135
|
key: Z,
|
|
2136
2136
|
class: "nh-date-table-th"
|
|
2137
|
-
},
|
|
2137
|
+
}, oe(Z), 1)), 64))
|
|
2138
2138
|
])
|
|
2139
2139
|
]),
|
|
2140
2140
|
l("tbody", null, [
|
|
2141
|
-
(s(!0), r(
|
|
2142
|
-
key: `end-week-${
|
|
2141
|
+
(s(!0), r(pe, null, me(Ze.value, (Z, ie) => (s(), r("tr", {
|
|
2142
|
+
key: `end-week-${ie}`
|
|
2143
2143
|
}, [
|
|
2144
|
-
(s(!0), r(
|
|
2145
|
-
key: `end-day-${
|
|
2146
|
-
class:
|
|
2144
|
+
(s(!0), r(pe, null, me(Z, (ue, le) => (s(), r("td", {
|
|
2145
|
+
key: `end-day-${ie}-${le}`,
|
|
2146
|
+
class: B(ne(ue)),
|
|
2147
2147
|
onClick: (we) => Y(ue, "end")
|
|
2148
2148
|
}, [
|
|
2149
2149
|
l("div", sl, [
|
|
2150
|
-
ue ? (s(), r("span", il,
|
|
2150
|
+
ue ? (s(), r("span", il, oe(ue.day), 1)) : W("", !0)
|
|
2151
2151
|
])
|
|
2152
2152
|
], 10, al))), 128))
|
|
2153
2153
|
]))), 128))
|
|
@@ -2158,9 +2158,9 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2158
2158
|
])
|
|
2159
2159
|
]),
|
|
2160
2160
|
l("div", rl, [
|
|
2161
|
-
t.clearable ? (s(),
|
|
2161
|
+
t.clearable ? (s(), Te(I, {
|
|
2162
2162
|
key: 0,
|
|
2163
|
-
onClick:
|
|
2163
|
+
onClick: Ke,
|
|
2164
2164
|
variant: "secondary",
|
|
2165
2165
|
size: t.size
|
|
2166
2166
|
}, {
|
|
@@ -2169,14 +2169,14 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2169
2169
|
])]),
|
|
2170
2170
|
_: 1
|
|
2171
2171
|
}, 8, ["size"])) : W("", !0),
|
|
2172
|
-
|
|
2173
|
-
onClick:
|
|
2174
|
-
disabled: !
|
|
2172
|
+
ve(I, {
|
|
2173
|
+
onClick: $e,
|
|
2174
|
+
disabled: !Re.value,
|
|
2175
2175
|
variant: "primary",
|
|
2176
2176
|
size: t.size
|
|
2177
2177
|
}, {
|
|
2178
2178
|
default: ye(() => [
|
|
2179
|
-
Se(
|
|
2179
|
+
Se(oe(O.value && !V.value ? "继续选择结束日期" : "确认"), 1)
|
|
2180
2180
|
]),
|
|
2181
2181
|
_: 1
|
|
2182
2182
|
}, 8, ["disabled", "size"])
|
|
@@ -2190,11 +2190,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2190
2190
|
], 2);
|
|
2191
2191
|
};
|
|
2192
2192
|
}
|
|
2193
|
-
}), it = /* @__PURE__ */
|
|
2193
|
+
}), it = /* @__PURE__ */ xe(ul, [["__scopeId", "data-v-e5ef63b1"]]), dl = ["aria-checked", "aria-disabled", "disabled", "onKeydown"], cl = { class: "yswitch__thumb" }, fl = {
|
|
2194
2194
|
key: 0,
|
|
2195
2195
|
class: "yswitch__spinner",
|
|
2196
2196
|
"aria-hidden": "true"
|
|
2197
|
-
}, vl = /* @__PURE__ */
|
|
2197
|
+
}, vl = /* @__PURE__ */ ke({
|
|
2198
2198
|
__name: "yswitch",
|
|
2199
2199
|
props: {
|
|
2200
2200
|
modelValue: { default: !1 },
|
|
@@ -2210,8 +2210,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2210
2210
|
showText: { type: Boolean, default: !1 }
|
|
2211
2211
|
},
|
|
2212
2212
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2213
|
-
setup(t, { emit:
|
|
2214
|
-
const e = t, n =
|
|
2213
|
+
setup(t, { emit: w }) {
|
|
2214
|
+
const e = t, n = w, m = K(), f = j(() => e.modelValue === e.trueValue), v = j(() => {
|
|
2215
2215
|
const x = {};
|
|
2216
2216
|
return x.background = f.value ? e.activeColor : e.inactiveColor, x;
|
|
2217
2217
|
});
|
|
@@ -2222,15 +2222,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2222
2222
|
}
|
|
2223
2223
|
return Me(() => {
|
|
2224
2224
|
const x = m.value;
|
|
2225
|
-
x && (x.addEventListener("focus", (
|
|
2226
|
-
}), (x,
|
|
2225
|
+
x && (x.addEventListener("focus", (H) => n("focus", H)), x.addEventListener("blur", (H) => n("blur", H)));
|
|
2226
|
+
}), (x, H) => (s(), r("button", {
|
|
2227
2227
|
ref_key: "rootEl",
|
|
2228
2228
|
ref: m,
|
|
2229
|
-
class:
|
|
2229
|
+
class: B(["yswitch", [
|
|
2230
2230
|
`yswitch--${t.size}`,
|
|
2231
2231
|
{ "yswitch--checked": f.value, "yswitch--disabled": t.disabled, "yswitch--loading": t.loading }
|
|
2232
2232
|
]]),
|
|
2233
|
-
style:
|
|
2233
|
+
style: ce(v.value),
|
|
2234
2234
|
role: "switch",
|
|
2235
2235
|
"aria-checked": f.value,
|
|
2236
2236
|
"aria-disabled": t.disabled,
|
|
@@ -2241,17 +2241,17 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2241
2241
|
Ce(G(S, ["prevent"]), ["space"])
|
|
2242
2242
|
]
|
|
2243
2243
|
}, [
|
|
2244
|
-
|
|
2245
|
-
l("span",
|
|
2244
|
+
H[0] || (H[0] = l("span", { class: "yswitch__track" }, null, -1)),
|
|
2245
|
+
l("span", cl, [
|
|
2246
2246
|
t.loading ? (s(), r("span", fl)) : W("", !0)
|
|
2247
2247
|
]),
|
|
2248
2248
|
t.showText ? (s(), r("span", {
|
|
2249
2249
|
key: 0,
|
|
2250
|
-
class:
|
|
2251
|
-
},
|
|
2252
|
-
], 46,
|
|
2250
|
+
class: B(["yswitch__label", { "yswitch__label--left": !f.value, "yswitch__label--right": f.value }])
|
|
2251
|
+
}, oe(f.value ? t.activeText : t.inactiveText), 3)) : W("", !0)
|
|
2252
|
+
], 46, dl));
|
|
2253
2253
|
}
|
|
2254
|
-
}), hl = /* @__PURE__ */
|
|
2254
|
+
}), hl = /* @__PURE__ */ xe(vl, [["__scopeId", "data-v-0b157fc4"]]), pl = ["src", "alt"], yl = ["src", "alt"], gl = /* @__PURE__ */ ke({
|
|
2255
2255
|
__name: "yimage",
|
|
2256
2256
|
props: {
|
|
2257
2257
|
src: {},
|
|
@@ -2266,8 +2266,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2266
2266
|
previewSrcList: {}
|
|
2267
2267
|
},
|
|
2268
2268
|
emits: ["load", "error", "preview"],
|
|
2269
|
-
setup(t, { expose:
|
|
2270
|
-
const n = t, m = e, f = K(),
|
|
2269
|
+
setup(t, { expose: w, emit: e }) {
|
|
2270
|
+
const n = t, m = e, f = K(), v = K(), S = K(), x = K(!1), H = K(!1), $ = K(!1), b = K(!1), c = K(!1), D = K("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), A = K(""), P = K(1), O = K(!1), V = K({
|
|
2271
2271
|
overflow: "",
|
|
2272
2272
|
paddingRight: ""
|
|
2273
2273
|
}), Q = {
|
|
@@ -2278,7 +2278,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2278
2278
|
xl: "0.75rem",
|
|
2279
2279
|
"2xl": "1rem",
|
|
2280
2280
|
full: "9999px"
|
|
2281
|
-
}, J = j(() => n.className || ""),
|
|
2281
|
+
}, J = j(() => n.className || ""), ae = j(() => {
|
|
2282
2282
|
if (typeof n.radius == "number")
|
|
2283
2283
|
return `${n.radius}px`;
|
|
2284
2284
|
if (typeof n.radius == "string") {
|
|
@@ -2288,109 +2288,109 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2288
2288
|
return Q[n.radius];
|
|
2289
2289
|
}
|
|
2290
2290
|
return "";
|
|
2291
|
-
}), ee = j(() =>
|
|
2292
|
-
borderRadius:
|
|
2293
|
-
} : {}),
|
|
2291
|
+
}), ee = j(() => ae.value ? {
|
|
2292
|
+
borderRadius: ae.value
|
|
2293
|
+
} : {}), he = j(() => [
|
|
2294
2294
|
"yimage-image",
|
|
2295
2295
|
n.preview ? "is-previewable" : ""
|
|
2296
2296
|
].filter(Boolean).join(" ")), E = j(() => {
|
|
2297
|
-
const
|
|
2297
|
+
const z = {
|
|
2298
2298
|
objectFit: n.fit || "cover",
|
|
2299
2299
|
backgroundColor: "#fff"
|
|
2300
2300
|
};
|
|
2301
|
-
return n.width && (
|
|
2302
|
-
}), F = j(() => A.value ? A.value : Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src),
|
|
2303
|
-
const
|
|
2304
|
-
|
|
2305
|
-
const Y =
|
|
2306
|
-
return document.body.removeChild(
|
|
2301
|
+
return n.width && (z.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.height && (z.height = typeof n.height == "number" ? `${n.height}px` : n.height), ae.value && (z.borderRadius = ae.value), z;
|
|
2302
|
+
}), F = j(() => A.value ? A.value : Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src), T = () => {
|
|
2303
|
+
const z = document.createElement("div");
|
|
2304
|
+
z.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(z);
|
|
2305
|
+
const Y = z.offsetWidth - z.clientWidth;
|
|
2306
|
+
return document.body.removeChild(z), Y;
|
|
2307
2307
|
}, N = () => {
|
|
2308
2308
|
if (V.value = {
|
|
2309
2309
|
overflow: document.body.style.overflow || "",
|
|
2310
2310
|
paddingRight: document.body.style.paddingRight || ""
|
|
2311
2311
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2312
|
-
const Y =
|
|
2312
|
+
const Y = T();
|
|
2313
2313
|
document.body.style.paddingRight = `${Y}px`;
|
|
2314
2314
|
}
|
|
2315
2315
|
document.body.style.overflow = "hidden";
|
|
2316
|
-
},
|
|
2316
|
+
}, se = () => {
|
|
2317
2317
|
document.body.style.overflow = V.value.overflow, document.body.style.paddingRight = V.value.paddingRight;
|
|
2318
2318
|
};
|
|
2319
2319
|
let q = null;
|
|
2320
2320
|
const ge = () => {
|
|
2321
2321
|
!n.lazy || !f.value || (q = new IntersectionObserver(
|
|
2322
|
-
(
|
|
2323
|
-
|
|
2324
|
-
Y.isIntersecting && (
|
|
2322
|
+
(z) => {
|
|
2323
|
+
z.forEach((Y) => {
|
|
2324
|
+
Y.isIntersecting && (b.value = !0, D.value = n.src, q == null || q.unobserve(Y.target));
|
|
2325
2325
|
});
|
|
2326
2326
|
},
|
|
2327
2327
|
{
|
|
2328
2328
|
rootMargin: "50px"
|
|
2329
2329
|
}
|
|
2330
2330
|
), q.observe(f.value));
|
|
2331
|
-
}, U = (
|
|
2332
|
-
x.value = !0,
|
|
2333
|
-
}, te = (
|
|
2334
|
-
$.value = !0,
|
|
2331
|
+
}, U = (z) => {
|
|
2332
|
+
x.value = !0, H.value = !1, $.value = !1, m("load", z);
|
|
2333
|
+
}, te = (z) => {
|
|
2334
|
+
$.value = !0, H.value = !1, x.value = !1, m("error", z);
|
|
2335
2335
|
}, p = () => {
|
|
2336
|
-
$.value = !1,
|
|
2337
|
-
|
|
2336
|
+
$.value = !1, H.value = !0, x.value = !1, de(() => {
|
|
2337
|
+
v.value && (v.value.src = n.src);
|
|
2338
2338
|
});
|
|
2339
|
-
},
|
|
2339
|
+
}, h = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, o = () => {
|
|
2340
2340
|
n.preview && (n.previewSrcList || n.src) ? a() : p();
|
|
2341
2341
|
}, a = () => {
|
|
2342
2342
|
if (!n.preview) return;
|
|
2343
2343
|
P.value = 1;
|
|
2344
|
-
const
|
|
2345
|
-
if (
|
|
2346
|
-
A.value =
|
|
2347
|
-
|
|
2344
|
+
const z = h();
|
|
2345
|
+
if (v.value && v.value.complete && v.value.naturalWidth > 0) {
|
|
2346
|
+
A.value = z, de(() => {
|
|
2347
|
+
c.value = !0, N(), m("preview", z);
|
|
2348
2348
|
});
|
|
2349
2349
|
return;
|
|
2350
2350
|
}
|
|
2351
2351
|
const Y = new Image();
|
|
2352
|
-
let ne = null,
|
|
2353
|
-
const
|
|
2354
|
-
|
|
2355
|
-
|
|
2352
|
+
let ne = null, $e = !1;
|
|
2353
|
+
const Ke = () => {
|
|
2354
|
+
$e || ($e = !0, ne && (clearTimeout(ne), ne = null), A.value = z, de(() => {
|
|
2355
|
+
c.value = !0, N(), m("preview", z);
|
|
2356
2356
|
}));
|
|
2357
2357
|
};
|
|
2358
2358
|
ne = setTimeout(() => {
|
|
2359
|
-
|
|
2359
|
+
Ke();
|
|
2360
2360
|
}, 500), Y.onload = () => {
|
|
2361
|
-
|
|
2361
|
+
Ke();
|
|
2362
2362
|
}, Y.onerror = () => {
|
|
2363
|
-
|
|
2364
|
-
}, Y.src =
|
|
2365
|
-
},
|
|
2366
|
-
|
|
2367
|
-
|
|
2363
|
+
Ke();
|
|
2364
|
+
}, Y.src = z, Y.complete && Ke();
|
|
2365
|
+
}, d = () => {
|
|
2366
|
+
c.value = !1, setTimeout(() => {
|
|
2367
|
+
se();
|
|
2368
2368
|
}, 300);
|
|
2369
|
-
},
|
|
2370
|
-
const Y =
|
|
2371
|
-
let
|
|
2372
|
-
|
|
2369
|
+
}, k = (z) => {
|
|
2370
|
+
const Y = z.deltaY < 0 ? 1 : -1;
|
|
2371
|
+
let $e = P.value + Y * 0.1;
|
|
2372
|
+
$e = Math.max(0.5, Math.min(2, $e)), P.value = $e;
|
|
2373
2373
|
};
|
|
2374
2374
|
return Me(() => {
|
|
2375
|
-
n.lazy ? ge() :
|
|
2376
|
-
}),
|
|
2377
|
-
q && q.disconnect(),
|
|
2378
|
-
}),
|
|
2379
|
-
n.src &&
|
|
2380
|
-
}),
|
|
2381
|
-
D.value =
|
|
2382
|
-
}),
|
|
2375
|
+
n.lazy ? ge() : b.value = !0, b.value && (H.value = !0), O.value = !0;
|
|
2376
|
+
}), He(() => {
|
|
2377
|
+
q && q.disconnect(), c.value && se();
|
|
2378
|
+
}), re(() => D.value, () => {
|
|
2379
|
+
n.src && b.value && (H.value = !0, $.value = !1, x.value = !1);
|
|
2380
|
+
}), re(() => n.src, (z) => {
|
|
2381
|
+
D.value = z || "";
|
|
2382
|
+
}), w({
|
|
2383
2383
|
retryLoad: p,
|
|
2384
|
-
closePreview:
|
|
2385
|
-
}), (
|
|
2384
|
+
closePreview: d
|
|
2385
|
+
}), (z, Y) => (s(), r("div", {
|
|
2386
2386
|
ref_key: "containerRef",
|
|
2387
2387
|
ref: f,
|
|
2388
|
-
class:
|
|
2388
|
+
class: B(["yimage-container", J.value])
|
|
2389
2389
|
}, [
|
|
2390
|
-
!x.value && !$.value && !
|
|
2390
|
+
!x.value && !$.value && !b.value ? (s(), r("div", {
|
|
2391
2391
|
key: 0,
|
|
2392
2392
|
class: "yimage-placeholder",
|
|
2393
|
-
style:
|
|
2393
|
+
style: ce(ee.value)
|
|
2394
2394
|
}, [...Y[1] || (Y[1] = [
|
|
2395
2395
|
l("div", { class: "yimage-placeholder-content" }, [
|
|
2396
2396
|
l("svg", {
|
|
@@ -2408,10 +2408,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2408
2408
|
])
|
|
2409
2409
|
], -1)
|
|
2410
2410
|
])], 4)) : W("", !0),
|
|
2411
|
-
|
|
2411
|
+
H.value && !$.value ? (s(), r("div", {
|
|
2412
2412
|
key: 1,
|
|
2413
2413
|
class: "yimage-loading",
|
|
2414
|
-
style:
|
|
2414
|
+
style: ce(ee.value)
|
|
2415
2415
|
}, [...Y[2] || (Y[2] = [
|
|
2416
2416
|
l("div", { class: "yimage-loading-content" }, [
|
|
2417
2417
|
l("div", { class: "yimage-spinner" })
|
|
@@ -2420,48 +2420,48 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2420
2420
|
$.value ? (s(), r("div", {
|
|
2421
2421
|
key: 2,
|
|
2422
2422
|
class: "yimage-error",
|
|
2423
|
-
style:
|
|
2423
|
+
style: ce(ee.value),
|
|
2424
2424
|
onClick: o
|
|
2425
2425
|
}, [
|
|
2426
2426
|
l("img", {
|
|
2427
2427
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2428
2428
|
alt: "Error Image",
|
|
2429
2429
|
class: "yimage-error-image",
|
|
2430
|
-
style:
|
|
2430
|
+
style: ce(ee.value)
|
|
2431
2431
|
}, null, 4)
|
|
2432
2432
|
], 4)) : W("", !0),
|
|
2433
|
-
|
|
2433
|
+
Le(l("img", {
|
|
2434
2434
|
ref_key: "imageRef",
|
|
2435
|
-
ref:
|
|
2435
|
+
ref: v,
|
|
2436
2436
|
src: D.value,
|
|
2437
2437
|
alt: t.alt,
|
|
2438
|
-
class:
|
|
2438
|
+
class: B(he.value),
|
|
2439
2439
|
onLoad: U,
|
|
2440
2440
|
onError: te,
|
|
2441
2441
|
onClick: G(a, ["stop"]),
|
|
2442
|
-
style:
|
|
2442
|
+
style: ce(E.value)
|
|
2443
2443
|
}, null, 46, pl), [
|
|
2444
|
-
[
|
|
2444
|
+
[Be, x.value && !$.value]
|
|
2445
2445
|
]),
|
|
2446
|
-
n.preview && (!x.value ||
|
|
2446
|
+
n.preview && (!x.value || H.value || $.value || !b.value) ? (s(), r("div", {
|
|
2447
2447
|
key: 3,
|
|
2448
2448
|
class: "yimage-preview-trigger",
|
|
2449
2449
|
onClick: G(a, ["stop"])
|
|
2450
2450
|
})) : W("", !0),
|
|
2451
|
-
O.value ? (s(),
|
|
2451
|
+
O.value ? (s(), Te(Fe, {
|
|
2452
2452
|
key: 4,
|
|
2453
2453
|
to: "body"
|
|
2454
2454
|
}, [
|
|
2455
|
-
|
|
2455
|
+
ve(_e, { name: "fade" }, {
|
|
2456
2456
|
default: ye(() => [
|
|
2457
|
-
|
|
2457
|
+
c.value ? (s(), r("div", {
|
|
2458
2458
|
key: 0,
|
|
2459
2459
|
class: "yimage-preview-mask",
|
|
2460
|
-
onClick: G(
|
|
2461
|
-
onWheel: G(
|
|
2460
|
+
onClick: G(d, ["self"]),
|
|
2461
|
+
onWheel: G(k, ["prevent"])
|
|
2462
2462
|
}, [
|
|
2463
2463
|
l("div", {
|
|
2464
|
-
class:
|
|
2464
|
+
class: B(["yimage-preview-content", { "is-active": c.value }])
|
|
2465
2465
|
}, [
|
|
2466
2466
|
l("img", {
|
|
2467
2467
|
ref_key: "previewImageRef",
|
|
@@ -2469,7 +2469,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2469
2469
|
src: F.value,
|
|
2470
2470
|
alt: t.alt,
|
|
2471
2471
|
class: "yimage-preview-image",
|
|
2472
|
-
style:
|
|
2472
|
+
style: ce({ transform: `scale(${P.value})` }),
|
|
2473
2473
|
onClick: Y[0] || (Y[0] = G(() => {
|
|
2474
2474
|
}, ["stop"]))
|
|
2475
2475
|
}, null, 12, yl)
|
|
@@ -2481,7 +2481,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2481
2481
|
])) : W("", !0)
|
|
2482
2482
|
], 2));
|
|
2483
2483
|
}
|
|
2484
|
-
}), ml = /* @__PURE__ */
|
|
2484
|
+
}), ml = /* @__PURE__ */ xe(gl, [["__scopeId", "data-v-00c771d6"]]), wl = /* @__PURE__ */ ke({
|
|
2485
2485
|
__name: "ydropdown",
|
|
2486
2486
|
props: {
|
|
2487
2487
|
trigger: { default: "hover" },
|
|
@@ -2490,32 +2490,32 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2490
2490
|
menuWidth: { default: void 0 }
|
|
2491
2491
|
},
|
|
2492
2492
|
setup(t) {
|
|
2493
|
-
const
|
|
2493
|
+
const w = t, e = K(!1), n = K();
|
|
2494
2494
|
let m = null;
|
|
2495
|
-
const f = j(() => `y-dropdown__menu--${
|
|
2496
|
-
if (!
|
|
2497
|
-
const
|
|
2495
|
+
const f = j(() => `y-dropdown__menu--${w.placement}`), v = j(() => {
|
|
2496
|
+
if (!w.menuWidth) return {};
|
|
2497
|
+
const c = typeof w.menuWidth == "number" ? `${w.menuWidth}px` : w.menuWidth;
|
|
2498
2498
|
return {
|
|
2499
|
-
width:
|
|
2500
|
-
minWidth:
|
|
2501
|
-
maxWidth:
|
|
2499
|
+
width: c,
|
|
2500
|
+
minWidth: c,
|
|
2501
|
+
maxWidth: c
|
|
2502
2502
|
};
|
|
2503
2503
|
}), S = () => {
|
|
2504
|
-
console.log("显示下拉菜单", e.value), !
|
|
2505
|
-
|
|
2504
|
+
console.log("显示下拉菜单", e.value), !w.disabled && (m && (clearTimeout(m), m = null), e.value = !0, console.log("设置 visible 为 true", e.value), de(() => {
|
|
2505
|
+
H();
|
|
2506
2506
|
}));
|
|
2507
2507
|
}, x = () => {
|
|
2508
2508
|
console.log("隐藏下拉菜单"), m = setTimeout(() => {
|
|
2509
2509
|
e.value = !1, console.log("设置 visible 为 false", e.value);
|
|
2510
2510
|
}, 150);
|
|
2511
|
-
},
|
|
2511
|
+
}, H = () => {
|
|
2512
2512
|
if (!n.value) return;
|
|
2513
|
-
const
|
|
2514
|
-
if (!
|
|
2515
|
-
const A =
|
|
2513
|
+
const c = n.value.querySelector(".y-dropdown__trigger"), D = n.value.querySelector(".y-dropdown__menu");
|
|
2514
|
+
if (!c || !D) return;
|
|
2515
|
+
const A = c.getBoundingClientRect(), P = D.getBoundingClientRect(), O = window.innerWidth, V = window.innerHeight;
|
|
2516
2516
|
D.style.top = "", D.style.left = "", D.style.right = "", D.style.bottom = "", D.style.transform = "";
|
|
2517
2517
|
let Q = 0, J = 0;
|
|
2518
|
-
switch (
|
|
2518
|
+
switch (w.placement) {
|
|
2519
2519
|
case "bottom":
|
|
2520
2520
|
Q = A.height + 4, J = 0;
|
|
2521
2521
|
break;
|
|
@@ -2529,33 +2529,33 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2529
2529
|
Q = 0, J = -(P.width + 4);
|
|
2530
2530
|
break;
|
|
2531
2531
|
}
|
|
2532
|
-
let
|
|
2533
|
-
if (
|
|
2534
|
-
const
|
|
2535
|
-
ee +
|
|
2532
|
+
let ae = A.top + Q, ee = A.left + J;
|
|
2533
|
+
if (w.placement === "bottom" || w.placement === "top") {
|
|
2534
|
+
const he = P.width || 260;
|
|
2535
|
+
ee + he > O - 10 && (ee = O - he - 10), ee < 10 && (ee = 10);
|
|
2536
2536
|
}
|
|
2537
|
-
if (
|
|
2538
|
-
const
|
|
2539
|
-
|
|
2537
|
+
if (w.placement === "left" || w.placement === "right") {
|
|
2538
|
+
const he = P.height || 200;
|
|
2539
|
+
ae + he > V - 10 && (ae = V - he - 10), ae < 10 && (ae = 10);
|
|
2540
2540
|
}
|
|
2541
|
-
D.style.top = `${
|
|
2542
|
-
}, $ = (
|
|
2543
|
-
|
|
2544
|
-
},
|
|
2545
|
-
e.value &&
|
|
2541
|
+
D.style.top = `${ae}px`, D.style.left = `${ee}px`;
|
|
2542
|
+
}, $ = (c) => {
|
|
2543
|
+
w.trigger === "click" && n.value && !n.value.contains(c.target) && (e.value = !1);
|
|
2544
|
+
}, b = () => {
|
|
2545
|
+
e.value && H();
|
|
2546
2546
|
};
|
|
2547
2547
|
return Me(() => {
|
|
2548
|
-
|
|
2549
|
-
}),
|
|
2550
|
-
|
|
2551
|
-
}),
|
|
2552
|
-
() =>
|
|
2548
|
+
w.trigger === "click" && document.addEventListener("click", $), window.addEventListener("resize", b), window.addEventListener("scroll", b);
|
|
2549
|
+
}), He(() => {
|
|
2550
|
+
w.trigger === "click" && document.removeEventListener("click", $), m && clearTimeout(m), window.removeEventListener("resize", b), window.removeEventListener("scroll", b);
|
|
2551
|
+
}), re(
|
|
2552
|
+
() => w.menuWidth,
|
|
2553
2553
|
() => {
|
|
2554
|
-
e.value &&
|
|
2555
|
-
|
|
2554
|
+
e.value && de(() => {
|
|
2555
|
+
H();
|
|
2556
2556
|
});
|
|
2557
2557
|
}
|
|
2558
|
-
), (
|
|
2558
|
+
), (c, D) => (s(), r("div", {
|
|
2559
2559
|
class: "y-dropdown",
|
|
2560
2560
|
ref_key: "dropdownRef",
|
|
2561
2561
|
ref: n
|
|
@@ -2565,41 +2565,41 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2565
2565
|
onMouseenter: S,
|
|
2566
2566
|
onMouseleave: x
|
|
2567
2567
|
}, [
|
|
2568
|
-
fe(
|
|
2568
|
+
fe(c.$slots, "trigger", {}, () => [
|
|
2569
2569
|
D[0] || (D[0] = l("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2570
2570
|
], !0)
|
|
2571
2571
|
], 32),
|
|
2572
|
-
|
|
2572
|
+
ve(_e, {
|
|
2573
2573
|
name: "dropdown-fade",
|
|
2574
2574
|
appear: ""
|
|
2575
2575
|
}, {
|
|
2576
2576
|
default: ye(() => [
|
|
2577
|
-
|
|
2578
|
-
class:
|
|
2579
|
-
style:
|
|
2577
|
+
Le(l("div", {
|
|
2578
|
+
class: B(["y-dropdown__menu", f.value]),
|
|
2579
|
+
style: ce(v.value),
|
|
2580
2580
|
onMouseenter: S,
|
|
2581
2581
|
onMouseleave: x
|
|
2582
2582
|
}, [
|
|
2583
|
-
fe(
|
|
2583
|
+
fe(c.$slots, "default", {}, () => [
|
|
2584
2584
|
D[1] || (D[1] = l("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2585
2585
|
D[2] || (D[2] = l("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2586
2586
|
D[3] || (D[3] = l("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2587
2587
|
], !0)
|
|
2588
2588
|
], 38), [
|
|
2589
|
-
[
|
|
2589
|
+
[Be, e.value]
|
|
2590
2590
|
])
|
|
2591
2591
|
]),
|
|
2592
2592
|
_: 3
|
|
2593
2593
|
})
|
|
2594
2594
|
], 512));
|
|
2595
2595
|
}
|
|
2596
|
-
}), bl = /* @__PURE__ */
|
|
2596
|
+
}), bl = /* @__PURE__ */ xe(wl, [["__scopeId", "data-v-ada3172a"]]), kl = ["aria-hidden"], xl = ["onKeydown"], $l = {
|
|
2597
2597
|
key: 0,
|
|
2598
2598
|
class: "y-drawer-header"
|
|
2599
2599
|
}, Dl = { class: "y-drawer-title" }, Cl = { class: "y-drawer-body" }, _l = {
|
|
2600
2600
|
key: 1,
|
|
2601
2601
|
class: "y-drawer-footer"
|
|
2602
|
-
}, Sl = /* @__PURE__ */
|
|
2602
|
+
}, Sl = /* @__PURE__ */ ke({
|
|
2603
2603
|
__name: "ydrawer",
|
|
2604
2604
|
props: {
|
|
2605
2605
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2613,62 +2613,62 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2613
2613
|
showHeader: { type: Boolean, default: !0 }
|
|
2614
2614
|
},
|
|
2615
2615
|
emits: ["update:modelValue", "open", "close"],
|
|
2616
|
-
setup(t, { emit:
|
|
2617
|
-
const e = t, n =
|
|
2616
|
+
setup(t, { emit: w }) {
|
|
2617
|
+
const e = t, n = w, m = j({
|
|
2618
2618
|
get: () => e.modelValue,
|
|
2619
2619
|
set: (D) => n("update:modelValue", D)
|
|
2620
|
-
}), f = K(null),
|
|
2620
|
+
}), f = K(null), v = j(() => e.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), S = j(() => e.placement === "right" ? "rounded-left" : "rounded-top"), x = j(() => {
|
|
2621
2621
|
const D = {};
|
|
2622
2622
|
return e.placement === "right" ? (D.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), D.height = "100%", D.right = "0", D.top = "0") : (D.height = typeof e.height == "number" ? `${e.height}px` : String(e.height), D.width = "100%", D.bottom = "0", D.left = "0"), D;
|
|
2623
2623
|
});
|
|
2624
|
-
function
|
|
2624
|
+
function H() {
|
|
2625
2625
|
e.maskClosable && $();
|
|
2626
2626
|
}
|
|
2627
2627
|
function $() {
|
|
2628
2628
|
m.value && (m.value = !1, n("close"));
|
|
2629
2629
|
}
|
|
2630
|
-
function
|
|
2630
|
+
function b() {
|
|
2631
2631
|
e.closable && $();
|
|
2632
2632
|
}
|
|
2633
|
-
function
|
|
2634
|
-
D.key === "Escape" &&
|
|
2633
|
+
function c(D) {
|
|
2634
|
+
D.key === "Escape" && b();
|
|
2635
2635
|
}
|
|
2636
|
-
return
|
|
2636
|
+
return re(() => e.modelValue, (D) => {
|
|
2637
2637
|
D ? (n("open"), requestAnimationFrame(() => {
|
|
2638
2638
|
var A;
|
|
2639
2639
|
return (A = f.value) == null ? void 0 : A.focus();
|
|
2640
|
-
}), document.addEventListener("keydown",
|
|
2640
|
+
}), document.addEventListener("keydown", c), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", c), document.body.style.overflow = "");
|
|
2641
2641
|
}), Me(() => {
|
|
2642
|
-
e.modelValue && (document.addEventListener("keydown",
|
|
2643
|
-
}),
|
|
2644
|
-
document.removeEventListener("keydown",
|
|
2645
|
-
}), (D, A) => (s(),
|
|
2646
|
-
|
|
2642
|
+
e.modelValue && (document.addEventListener("keydown", c), document.body.style.overflow = "hidden");
|
|
2643
|
+
}), He(() => {
|
|
2644
|
+
document.removeEventListener("keydown", c), document.body.style.overflow = "";
|
|
2645
|
+
}), (D, A) => (s(), Te(Fe, { to: "body" }, [
|
|
2646
|
+
Le(l("div", {
|
|
2647
2647
|
class: "y-drawer-root",
|
|
2648
2648
|
role: "dialog",
|
|
2649
2649
|
"aria-modal": !0,
|
|
2650
2650
|
"aria-hidden": !m.value,
|
|
2651
|
-
style:
|
|
2651
|
+
style: ce({ zIndex: String(t.zIndex) })
|
|
2652
2652
|
}, [
|
|
2653
2653
|
l("div", {
|
|
2654
2654
|
class: "y-drawer-mask",
|
|
2655
|
-
onClick:
|
|
2655
|
+
onClick: H
|
|
2656
2656
|
}),
|
|
2657
|
-
|
|
2657
|
+
ve(_e, { name: v.value }, {
|
|
2658
2658
|
default: ye(() => [
|
|
2659
|
-
|
|
2659
|
+
Le(l("div", {
|
|
2660
2660
|
ref_key: "panelRef",
|
|
2661
2661
|
ref: f,
|
|
2662
|
-
class:
|
|
2662
|
+
class: B(["y-drawer-panel", [
|
|
2663
2663
|
`is-${t.placement}`,
|
|
2664
2664
|
S.value
|
|
2665
2665
|
]]),
|
|
2666
|
-
style:
|
|
2667
|
-
onKeydown: Ce(G(
|
|
2666
|
+
style: ce(x.value),
|
|
2667
|
+
onKeydown: Ce(G(b, ["prevent", "stop"]), ["esc"]),
|
|
2668
2668
|
tabindex: "-1"
|
|
2669
2669
|
}, [
|
|
2670
2670
|
t.showHeader ? (s(), r("div", $l, [
|
|
2671
|
-
l("div", Dl,
|
|
2671
|
+
l("div", Dl, oe(t.title), 1),
|
|
2672
2672
|
t.closable ? (s(), r("button", {
|
|
2673
2673
|
key: 0,
|
|
2674
2674
|
type: "button",
|
|
@@ -2684,17 +2684,17 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2684
2684
|
fe(D.$slots, "footer", {}, void 0, !0)
|
|
2685
2685
|
])) : W("", !0)
|
|
2686
2686
|
], 46, xl), [
|
|
2687
|
-
[
|
|
2687
|
+
[Be, m.value]
|
|
2688
2688
|
])
|
|
2689
2689
|
]),
|
|
2690
2690
|
_: 3
|
|
2691
2691
|
}, 8, ["name"])
|
|
2692
2692
|
], 12, kl), [
|
|
2693
|
-
[
|
|
2693
|
+
[Be, m.value]
|
|
2694
2694
|
])
|
|
2695
2695
|
]));
|
|
2696
2696
|
}
|
|
2697
|
-
}), Ml = /* @__PURE__ */
|
|
2697
|
+
}), Ml = /* @__PURE__ */ xe(Sl, [["__scopeId", "data-v-b2797950"]]), Ll = { class: "ytree__container" }, Il = ["data-level", "onClick", "onContextmenu"], El = ["onClick"], Bl = {
|
|
2698
2698
|
key: 1,
|
|
2699
2699
|
class: "w-[16px]"
|
|
2700
2700
|
}, Tl = ["onClick"], Kl = {
|
|
@@ -2781,7 +2781,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2781
2781
|
height: "12",
|
|
2782
2782
|
viewBox: "0 0 12 12",
|
|
2783
2783
|
fill: "none"
|
|
2784
|
-
}, wo = ["src", "alt"], bo = { class: "ytree-node__custom-content" }, ko = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", xo = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", $o = /* @__PURE__ */
|
|
2784
|
+
}, wo = ["src", "alt"], bo = { class: "ytree-node__custom-content" }, ko = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", xo = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", $o = /* @__PURE__ */ ke({
|
|
2785
2785
|
__name: "ytree",
|
|
2786
2786
|
props: {
|
|
2787
2787
|
data: { default: () => [] },
|
|
@@ -2829,8 +2829,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2829
2829
|
enableChildStyleCustomClick: { type: Boolean, default: !1 }
|
|
2830
2830
|
},
|
|
2831
2831
|
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"],
|
|
2832
|
-
setup(t, { expose:
|
|
2833
|
-
const n = t, m = e, f = j(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])),
|
|
2832
|
+
setup(t, { expose: w, emit: e }) {
|
|
2833
|
+
const n = t, m = e, f = j(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), v = K({
|
|
2834
2834
|
currentNode: null,
|
|
2835
2835
|
currentKey: null,
|
|
2836
2836
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2838,200 +2838,200 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2838
2838
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2839
2839
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2840
2840
|
});
|
|
2841
|
-
|
|
2841
|
+
dt("treeStore", v);
|
|
2842
2842
|
const S = j(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2843
2843
|
function x(p) {
|
|
2844
2844
|
return p[n.nodeKey] || p.id || Math.random();
|
|
2845
2845
|
}
|
|
2846
|
-
function
|
|
2847
|
-
var
|
|
2848
|
-
return ((
|
|
2846
|
+
function H(p) {
|
|
2847
|
+
var h;
|
|
2848
|
+
return ((h = n.props) != null && h.label ? p[n.props.label] : void 0) || p.label || "";
|
|
2849
2849
|
}
|
|
2850
2850
|
function $(p) {
|
|
2851
|
-
var
|
|
2852
|
-
return !!((
|
|
2851
|
+
var h;
|
|
2852
|
+
return !!((h = p == null ? void 0 : p.data) != null && h.isEmployee);
|
|
2853
2853
|
}
|
|
2854
|
-
function
|
|
2854
|
+
function b(p, h) {
|
|
2855
2855
|
var M;
|
|
2856
|
-
const o = n.deptIconUrl || ko, a = n.personIconUrl || xo,
|
|
2857
|
-
return
|
|
2856
|
+
const o = n.deptIconUrl || ko, a = n.personIconUrl || xo, d = n.buttonIconUrl || "", k = n.childStyleIconUrl || "";
|
|
2857
|
+
return h && k && P(p, h) ? k : (M = p == null ? void 0 : p.data) != null && M.isButton && d ? d : $(p) ? a : o;
|
|
2858
2858
|
}
|
|
2859
|
-
function
|
|
2859
|
+
function c(p) {
|
|
2860
2860
|
var o;
|
|
2861
|
-
const
|
|
2862
|
-
return
|
|
2861
|
+
const h = ((o = n.props) != null && o.children ? p[n.props.children] : void 0) || p.children;
|
|
2862
|
+
return h && h.length > 0;
|
|
2863
2863
|
}
|
|
2864
2864
|
function D(p) {
|
|
2865
|
-
var
|
|
2866
|
-
return ((
|
|
2865
|
+
var h;
|
|
2866
|
+
return ((h = n.props) != null && h.children ? p[n.props.children] : void 0) || p.children || [];
|
|
2867
2867
|
}
|
|
2868
|
-
function A(p,
|
|
2869
|
-
if (p ===
|
|
2868
|
+
function A(p, h, o = 1) {
|
|
2869
|
+
if (p === h)
|
|
2870
2870
|
return o;
|
|
2871
2871
|
const a = D(p);
|
|
2872
|
-
for (const
|
|
2873
|
-
const
|
|
2874
|
-
if (
|
|
2875
|
-
return
|
|
2872
|
+
for (const d of a) {
|
|
2873
|
+
const k = A(d, h, o + 1);
|
|
2874
|
+
if (k > 0)
|
|
2875
|
+
return k;
|
|
2876
2876
|
}
|
|
2877
2877
|
return 0;
|
|
2878
2878
|
}
|
|
2879
|
-
function P(p,
|
|
2880
|
-
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : A(
|
|
2879
|
+
function P(p, h) {
|
|
2880
|
+
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : A(h, p) === n.childStyleLevel;
|
|
2881
2881
|
}
|
|
2882
2882
|
function O(p) {
|
|
2883
|
-
const
|
|
2884
|
-
return
|
|
2883
|
+
const h = x(p);
|
|
2884
|
+
return v.value.expandedKeys.has(h);
|
|
2885
2885
|
}
|
|
2886
2886
|
function V(p) {
|
|
2887
|
-
const
|
|
2888
|
-
if (
|
|
2889
|
-
if (
|
|
2890
|
-
const a = D(p),
|
|
2887
|
+
const h = x(p);
|
|
2888
|
+
if (v.value.checkedKeys.has(h)) {
|
|
2889
|
+
if (c(p)) {
|
|
2890
|
+
const a = D(p), d = a.filter((M) => V(M)), k = a.filter(
|
|
2891
2891
|
(M) => Q(M)
|
|
2892
2892
|
);
|
|
2893
|
-
return
|
|
2893
|
+
return d.length === a.length && k.length === 0;
|
|
2894
2894
|
}
|
|
2895
2895
|
return !0;
|
|
2896
2896
|
}
|
|
2897
|
-
if (
|
|
2897
|
+
if (c(p)) {
|
|
2898
2898
|
const a = D(p);
|
|
2899
2899
|
return a.some(
|
|
2900
|
-
(
|
|
2901
|
-
) ? !1 : a.length > 0 && a.every((
|
|
2900
|
+
(k) => Q(k)
|
|
2901
|
+
) ? !1 : a.length > 0 && a.every((k) => V(k));
|
|
2902
2902
|
}
|
|
2903
2903
|
return !1;
|
|
2904
2904
|
}
|
|
2905
2905
|
function Q(p) {
|
|
2906
|
-
if (!
|
|
2907
|
-
const
|
|
2908
|
-
(
|
|
2906
|
+
if (!c(p)) return !1;
|
|
2907
|
+
const h = D(p), o = h.filter((d) => V(d)), a = h.filter(
|
|
2908
|
+
(d) => Q(d)
|
|
2909
2909
|
);
|
|
2910
|
-
return o.length ===
|
|
2910
|
+
return o.length === h.length ? !1 : o.length > 0 || a.length > 0;
|
|
2911
2911
|
}
|
|
2912
2912
|
function J(p) {
|
|
2913
|
-
const
|
|
2914
|
-
return
|
|
2913
|
+
const h = x(p);
|
|
2914
|
+
return v.value.currentKey === h;
|
|
2915
2915
|
}
|
|
2916
|
-
function
|
|
2917
|
-
const
|
|
2918
|
-
return
|
|
2916
|
+
function ae(p) {
|
|
2917
|
+
const h = x(p);
|
|
2918
|
+
return v.value.highlightedKeys.has(h);
|
|
2919
2919
|
}
|
|
2920
2920
|
function ee(p) {
|
|
2921
2921
|
if (n.disabled) return;
|
|
2922
|
-
const
|
|
2923
|
-
a ?
|
|
2924
|
-
function
|
|
2922
|
+
const h = x(p), a = !v.value.checkedKeys.has(h), d = new Set(v.value.expandedKeys);
|
|
2923
|
+
a ? v.value.checkedKeys.add(h) : v.value.checkedKeys.delete(h);
|
|
2924
|
+
function k(M, z) {
|
|
2925
2925
|
M.forEach((Y) => {
|
|
2926
2926
|
const ne = x(Y);
|
|
2927
|
-
|
|
2927
|
+
z ? v.value.checkedKeys.add(ne) : v.value.checkedKeys.delete(ne), c(Y) && k(D(Y), z);
|
|
2928
2928
|
});
|
|
2929
2929
|
}
|
|
2930
|
-
|
|
2930
|
+
k(D(p), a), a && he(), F(), v.value.expandedKeys = d, m("check-change", p, a, !1), m("check", p, a, !1), m("checked-keys-change", Array.from(v.value.checkedKeys));
|
|
2931
2931
|
}
|
|
2932
|
-
function
|
|
2932
|
+
function he(p) {
|
|
2933
2933
|
S.value && console.log(
|
|
2934
2934
|
`已启用从第${S.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2935
2935
|
);
|
|
2936
2936
|
}
|
|
2937
2937
|
function E(p) {
|
|
2938
|
-
const
|
|
2939
|
-
|
|
2938
|
+
const h = x(p);
|
|
2939
|
+
v.value.expandedKeys.has(h) ? (v.value.expandedKeys.delete(h), m("node-collapse", p, p, null)) : (v.value.expandedKeys.add(h), m("node-expand", p, p, null));
|
|
2940
2940
|
}
|
|
2941
2941
|
function F() {
|
|
2942
2942
|
const p = [];
|
|
2943
|
-
function
|
|
2944
|
-
a.forEach((
|
|
2945
|
-
p.push(
|
|
2943
|
+
function h(a) {
|
|
2944
|
+
a.forEach((d) => {
|
|
2945
|
+
p.push(d), c(d) && h(D(d));
|
|
2946
2946
|
});
|
|
2947
2947
|
}
|
|
2948
|
-
|
|
2948
|
+
h(f.value);
|
|
2949
2949
|
function o(a) {
|
|
2950
|
-
if (
|
|
2951
|
-
const
|
|
2950
|
+
if (c(a)) {
|
|
2951
|
+
const d = D(a), k = x(a), M = d.filter((Y) => V(Y)), z = d.filter(
|
|
2952
2952
|
(Y) => Q(Y)
|
|
2953
2953
|
);
|
|
2954
|
-
M.length ===
|
|
2954
|
+
M.length === d.length && z.length === 0 || M.length > 0 || z.length > 0 ? v.value.checkedKeys.add(k) : v.value.checkedKeys.delete(k);
|
|
2955
2955
|
}
|
|
2956
2956
|
}
|
|
2957
2957
|
for (let a = p.length - 1; a >= 0; a--)
|
|
2958
2958
|
o(p[a]);
|
|
2959
2959
|
}
|
|
2960
|
-
function
|
|
2960
|
+
function T(p, h, o, a) {
|
|
2961
2961
|
if (n.disabled) return;
|
|
2962
|
-
const
|
|
2963
|
-
if (n.enableChildStyleCustomClick &&
|
|
2964
|
-
m("child-node-click", p,
|
|
2962
|
+
const d = a ? P(p, a) : !1;
|
|
2963
|
+
if (n.enableChildStyleCustomClick && d) {
|
|
2964
|
+
m("child-node-click", p, h, o);
|
|
2965
2965
|
return;
|
|
2966
2966
|
}
|
|
2967
|
-
if (n.expandOnClickNode &&
|
|
2967
|
+
if (n.expandOnClickNode && c(p)) {
|
|
2968
2968
|
E(p);
|
|
2969
2969
|
return;
|
|
2970
2970
|
}
|
|
2971
|
-
|
|
2971
|
+
v.value.currentNode = p, v.value.currentKey = x(p), n.showCheckbox && ee(p), m("node-click", p, h, o);
|
|
2972
2972
|
}
|
|
2973
|
-
function N(p,
|
|
2974
|
-
n.disabled || m("node-contextmenu", p,
|
|
2973
|
+
function N(p, h, o, a) {
|
|
2974
|
+
n.disabled || m("node-contextmenu", p, h, o, a);
|
|
2975
2975
|
}
|
|
2976
|
-
|
|
2976
|
+
re(
|
|
2977
2977
|
() => n.defaultExpandedKeys,
|
|
2978
2978
|
(p) => {
|
|
2979
2979
|
if (p) {
|
|
2980
|
-
const
|
|
2981
|
-
if (
|
|
2982
|
-
let o = function(M,
|
|
2983
|
-
for (const ne of
|
|
2980
|
+
const h = S.value;
|
|
2981
|
+
if (h) {
|
|
2982
|
+
let o = function(M, z, Y = 1) {
|
|
2983
|
+
for (const ne of z) {
|
|
2984
2984
|
if (x(ne) === M) return Y;
|
|
2985
|
-
if (
|
|
2986
|
-
const
|
|
2987
|
-
if (
|
|
2985
|
+
if (c(ne)) {
|
|
2986
|
+
const $e = o(M, D(ne), Y + 1);
|
|
2987
|
+
if ($e > 0) return $e;
|
|
2988
2988
|
}
|
|
2989
2989
|
}
|
|
2990
2990
|
return 0;
|
|
2991
|
-
}, a = function(M,
|
|
2991
|
+
}, a = function(M, z, Y) {
|
|
2992
2992
|
M.forEach((ne) => {
|
|
2993
|
-
|
|
2993
|
+
z < Y && c(ne) ? (k.add(x(ne)), a(D(ne), z + 1, Y)) : z < Y && c(ne);
|
|
2994
2994
|
});
|
|
2995
2995
|
};
|
|
2996
|
-
const
|
|
2997
|
-
const
|
|
2998
|
-
return
|
|
2999
|
-
}),
|
|
3000
|
-
a(f.value, 1,
|
|
3001
|
-
o(M, f.value, 1) >=
|
|
3002
|
-
}),
|
|
2996
|
+
const d = (p || []).filter((M) => {
|
|
2997
|
+
const z = o(M, f.value, 1);
|
|
2998
|
+
return z > 0 && z < h;
|
|
2999
|
+
}), k = new Set(d);
|
|
3000
|
+
a(f.value, 1, h), v.value.expandedKeys.forEach((M) => {
|
|
3001
|
+
o(M, f.value, 1) >= h && k.add(M);
|
|
3002
|
+
}), v.value.expandedKeys = k;
|
|
3003
3003
|
} else
|
|
3004
|
-
|
|
3004
|
+
v.value.expandedKeys = new Set(p);
|
|
3005
3005
|
}
|
|
3006
3006
|
},
|
|
3007
3007
|
{ immediate: !0 }
|
|
3008
3008
|
);
|
|
3009
|
-
function
|
|
3009
|
+
function se() {
|
|
3010
3010
|
if (n.defaultExpandAll) {
|
|
3011
|
-
let p = function(a,
|
|
3012
|
-
a.forEach((
|
|
3013
|
-
if (!
|
|
3014
|
-
const M = D(
|
|
3011
|
+
let p = function(a, d = 1) {
|
|
3012
|
+
a.forEach((k) => {
|
|
3013
|
+
if (!c(k)) return;
|
|
3014
|
+
const M = D(k);
|
|
3015
3015
|
if (o) {
|
|
3016
|
-
if (
|
|
3017
|
-
|
|
3016
|
+
if (d >= o) return;
|
|
3017
|
+
d + 1 === o || h.add(x(k)), p(M, d + 1);
|
|
3018
3018
|
} else
|
|
3019
|
-
|
|
3019
|
+
h.add(x(k)), p(M, d + 1);
|
|
3020
3020
|
});
|
|
3021
3021
|
};
|
|
3022
|
-
const
|
|
3023
|
-
p(f.value, 1),
|
|
3022
|
+
const h = /* @__PURE__ */ new Set(), o = S.value;
|
|
3023
|
+
p(f.value, 1), v.value.expandedKeys = h;
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
3026
|
function q() {
|
|
3027
3027
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
3028
|
-
let p = function(
|
|
3029
|
-
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3028
|
+
let p = function(d, k = []) {
|
|
3029
|
+
d.forEach((M) => {
|
|
3030
|
+
const z = x(M), Y = [...k, z];
|
|
3031
|
+
h.has(z) && k.forEach((ne) => o.add(ne)), c(M) && p(D(M), Y);
|
|
3032
3032
|
});
|
|
3033
3033
|
};
|
|
3034
|
-
const
|
|
3034
|
+
const h = new Set(n.defaultCheckedKeys), o = /* @__PURE__ */ new Set();
|
|
3035
3035
|
p(f.value);
|
|
3036
3036
|
const a = S.value;
|
|
3037
3037
|
if (a) {
|
|
@@ -3040,73 +3040,73 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3040
3040
|
);
|
|
3041
3041
|
return;
|
|
3042
3042
|
}
|
|
3043
|
-
|
|
3043
|
+
v.value.expandedKeys = o;
|
|
3044
3044
|
}
|
|
3045
3045
|
}
|
|
3046
|
-
|
|
3046
|
+
re(() => n.defaultExpandAll, se, { immediate: !0 }), re(() => f.value, se, { deep: !0 }), re(
|
|
3047
3047
|
() => n.defaultCheckedKeys,
|
|
3048
3048
|
(p) => {
|
|
3049
|
-
p ? (
|
|
3049
|
+
p ? (v.value.checkedKeys = new Set(p), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : q()) : v.value.checkedKeys.clear();
|
|
3050
3050
|
},
|
|
3051
3051
|
{ immediate: !0 }
|
|
3052
3052
|
);
|
|
3053
3053
|
function ge(p) {
|
|
3054
3054
|
try {
|
|
3055
|
-
let
|
|
3056
|
-
for (const
|
|
3057
|
-
const Y = x(
|
|
3058
|
-
if (Y ===
|
|
3059
|
-
if (
|
|
3060
|
-
const
|
|
3061
|
-
if (
|
|
3055
|
+
let h = function(d, k, M = []) {
|
|
3056
|
+
for (const z of d) {
|
|
3057
|
+
const Y = x(z), ne = [...M, Y];
|
|
3058
|
+
if (Y === k) return ne;
|
|
3059
|
+
if (c(z)) {
|
|
3060
|
+
const $e = h(D(z), k, ne);
|
|
3061
|
+
if ($e) return $e;
|
|
3062
3062
|
}
|
|
3063
3063
|
}
|
|
3064
3064
|
return null;
|
|
3065
3065
|
};
|
|
3066
3066
|
const o = Array.isArray(p) ? p : [];
|
|
3067
3067
|
if (o.length === 0) return;
|
|
3068
|
-
|
|
3069
|
-
const a = new Set(
|
|
3070
|
-
o.forEach((
|
|
3071
|
-
const
|
|
3072
|
-
|
|
3073
|
-
}),
|
|
3074
|
-
} catch (
|
|
3075
|
-
console.warn("highlightAndExpandByIds 执行失败",
|
|
3068
|
+
v.value.highlightedKeys.clear();
|
|
3069
|
+
const a = new Set(v.value.expandedKeys);
|
|
3070
|
+
o.forEach((d) => {
|
|
3071
|
+
const k = h(f.value, d);
|
|
3072
|
+
k && k.length > 0 && (k.slice(0, -1).forEach((M) => a.add(M)), v.value.highlightedKeys.add(k[k.length - 1]));
|
|
3073
|
+
}), v.value.expandedKeys = a;
|
|
3074
|
+
} catch (h) {
|
|
3075
|
+
console.warn("highlightAndExpandByIds 执行失败", h);
|
|
3076
3076
|
}
|
|
3077
3077
|
}
|
|
3078
3078
|
function U() {
|
|
3079
|
-
|
|
3079
|
+
v.value.highlightedKeys.clear();
|
|
3080
3080
|
}
|
|
3081
3081
|
function te() {
|
|
3082
|
-
|
|
3082
|
+
v.value.currentNode = null, v.value.currentKey = null;
|
|
3083
3083
|
}
|
|
3084
|
-
return
|
|
3084
|
+
return w({ highlightAndExpandByIds: ge, clearHighlights: U, clearCurrentNode: te }), re(
|
|
3085
3085
|
() => n.defaultSelectedKeys,
|
|
3086
3086
|
(p) => {
|
|
3087
|
-
p && (
|
|
3087
|
+
p && (v.value.selectedKeys = new Set(p));
|
|
3088
3088
|
},
|
|
3089
3089
|
{ immediate: !0 }
|
|
3090
|
-
), (p,
|
|
3091
|
-
class:
|
|
3090
|
+
), (p, h) => (s(), r("div", {
|
|
3091
|
+
class: B(["ytree", [`ytree--${t.size}`, { "ytree--disabled": t.disabled }]])
|
|
3092
3092
|
}, [
|
|
3093
|
-
l("div",
|
|
3094
|
-
(s(!0), r(
|
|
3093
|
+
l("div", Ll, [
|
|
3094
|
+
(s(!0), r(pe, null, me(f.value, (o) => (s(), r("div", {
|
|
3095
3095
|
key: x(o),
|
|
3096
|
-
class:
|
|
3096
|
+
class: B(["ytree-node", { "ytree-node--current": J(o), "ytree-node--highlight": ae(o) }])
|
|
3097
3097
|
}, [
|
|
3098
3098
|
l("div", {
|
|
3099
|
-
class:
|
|
3099
|
+
class: B(["ytree-node__content", { "is-child-style": P(o, o) }]),
|
|
3100
3100
|
style: { paddingLeft: "8px" },
|
|
3101
3101
|
"data-level": A(o, o),
|
|
3102
|
-
onClick: (a) =>
|
|
3102
|
+
onClick: (a) => T(o, o, null, o),
|
|
3103
3103
|
onContextmenu: (a) => N(a, o, o, null)
|
|
3104
3104
|
}, [
|
|
3105
|
-
|
|
3105
|
+
c(o) ? (s(), r("span", {
|
|
3106
3106
|
key: 0,
|
|
3107
|
-
class:
|
|
3107
|
+
class: B(["ytree-node__expand-icon", { "is-expanded": O(o) }]),
|
|
3108
3108
|
onClick: G((a) => E(o), ["stop"])
|
|
3109
|
-
}, [...
|
|
3109
|
+
}, [...h[0] || (h[0] = [
|
|
3110
3110
|
l("svg", {
|
|
3111
3111
|
width: "12",
|
|
3112
3112
|
height: "12",
|
|
@@ -3124,13 +3124,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3124
3124
|
])], 10, El)) : (s(), r("span", Bl)),
|
|
3125
3125
|
t.showCheckbox ? (s(), r("span", {
|
|
3126
3126
|
key: 2,
|
|
3127
|
-
class:
|
|
3127
|
+
class: B(["ytree-node__checkbox", {
|
|
3128
3128
|
"is-checked": V(o),
|
|
3129
3129
|
"is-indeterminate": Q(o)
|
|
3130
3130
|
}]),
|
|
3131
3131
|
onClick: G((a) => ee(o), ["stop"])
|
|
3132
3132
|
}, [
|
|
3133
|
-
V(o) ? (s(), r("svg", Kl, [...
|
|
3133
|
+
V(o) ? (s(), r("svg", Kl, [...h[1] || (h[1] = [
|
|
3134
3134
|
l("path", {
|
|
3135
3135
|
d: "M2 6L4.5 8.5L10 3",
|
|
3136
3136
|
stroke: "currentColor",
|
|
@@ -3138,7 +3138,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3138
3138
|
"stroke-linecap": "round",
|
|
3139
3139
|
"stroke-linejoin": "round"
|
|
3140
3140
|
}, null, -1)
|
|
3141
|
-
])])) : Q(o) ? (s(), r("svg", zl, [...
|
|
3141
|
+
])])) : Q(o) ? (s(), r("svg", zl, [...h[2] || (h[2] = [
|
|
3142
3142
|
l("path", {
|
|
3143
3143
|
d: "M2 6L10 6",
|
|
3144
3144
|
stroke: "currentColor",
|
|
@@ -3149,44 +3149,44 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3149
3149
|
], 10, Tl)) : W("", !0),
|
|
3150
3150
|
t.iconClass ? (s(), r("span", {
|
|
3151
3151
|
key: 3,
|
|
3152
|
-
class:
|
|
3152
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3153
3153
|
}, null, 2)) : W("", !0),
|
|
3154
3154
|
l("img", {
|
|
3155
3155
|
class: "ytree-node__avatar",
|
|
3156
|
-
src:
|
|
3156
|
+
src: b(o, o),
|
|
3157
3157
|
alt: $(o) ? "person" : "dept"
|
|
3158
3158
|
}, null, 8, Hl),
|
|
3159
3159
|
l("span", {
|
|
3160
|
-
class:
|
|
3161
|
-
},
|
|
3160
|
+
class: B(["ytree-node__label", { "is-employee": $(o) }])
|
|
3161
|
+
}, oe(H(o)), 3),
|
|
3162
3162
|
l("div", Rl, [
|
|
3163
3163
|
fe(p.$slots, "node-content", {
|
|
3164
3164
|
node: o,
|
|
3165
3165
|
isCurrent: J(o),
|
|
3166
3166
|
isExpanded: O(o),
|
|
3167
|
-
hasChildren:
|
|
3167
|
+
hasChildren: c(o)
|
|
3168
3168
|
}, void 0, !0)
|
|
3169
3169
|
])
|
|
3170
|
-
], 42,
|
|
3171
|
-
|
|
3170
|
+
], 42, Il),
|
|
3171
|
+
ve(_e, { name: "ytree-node" }, {
|
|
3172
3172
|
default: ye(() => [
|
|
3173
|
-
|
|
3174
|
-
(s(!0), r(
|
|
3173
|
+
c(o) && O(o) ? (s(), r("div", Al, [
|
|
3174
|
+
(s(!0), r(pe, null, me(D(o), (a) => (s(), r("div", {
|
|
3175
3175
|
key: x(a),
|
|
3176
|
-
class:
|
|
3176
|
+
class: B(["ytree-node", { "ytree-node--current": J(a), "ytree-node--highlight": ae(a) }])
|
|
3177
3177
|
}, [
|
|
3178
3178
|
l("div", {
|
|
3179
|
-
class:
|
|
3179
|
+
class: B(["ytree-node__content", { "is-child-style": P(a, o) }]),
|
|
3180
3180
|
style: { paddingLeft: "22px" },
|
|
3181
3181
|
"data-level": A(o, a),
|
|
3182
|
-
onClick: (
|
|
3183
|
-
onContextmenu: (
|
|
3182
|
+
onClick: (d) => T(a, a, null, o),
|
|
3183
|
+
onContextmenu: (d) => N(d, a, a, null)
|
|
3184
3184
|
}, [
|
|
3185
|
-
|
|
3185
|
+
c(a) ? (s(), r("span", {
|
|
3186
3186
|
key: 0,
|
|
3187
|
-
class:
|
|
3188
|
-
onClick: G((
|
|
3189
|
-
}, [...
|
|
3187
|
+
class: B(["ytree-node__expand-icon", { "is-expanded": O(a) }]),
|
|
3188
|
+
onClick: G((d) => E(a), ["stop"])
|
|
3189
|
+
}, [...h[3] || (h[3] = [
|
|
3190
3190
|
l("svg", {
|
|
3191
3191
|
width: "12",
|
|
3192
3192
|
height: "12",
|
|
@@ -3204,13 +3204,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3204
3204
|
])], 10, Vl)) : (s(), r("span", Fl)),
|
|
3205
3205
|
t.showCheckbox ? (s(), r("span", {
|
|
3206
3206
|
key: 2,
|
|
3207
|
-
class:
|
|
3207
|
+
class: B(["ytree-node__checkbox", {
|
|
3208
3208
|
"is-checked": V(a),
|
|
3209
3209
|
"is-indeterminate": Q(a)
|
|
3210
3210
|
}]),
|
|
3211
|
-
onClick: G((
|
|
3211
|
+
onClick: G((d) => ee(a), ["stop"])
|
|
3212
3212
|
}, [
|
|
3213
|
-
V(a) ? (s(), r("svg", Nl, [...
|
|
3213
|
+
V(a) ? (s(), r("svg", Nl, [...h[4] || (h[4] = [
|
|
3214
3214
|
l("path", {
|
|
3215
3215
|
d: "M2 6L4.5 8.5L10 3",
|
|
3216
3216
|
stroke: "currentColor",
|
|
@@ -3218,7 +3218,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3218
3218
|
"stroke-linecap": "round",
|
|
3219
3219
|
"stroke-linejoin": "round"
|
|
3220
3220
|
}, null, -1)
|
|
3221
|
-
])])) : Q(a) ? (s(), r("svg", Yl, [...
|
|
3221
|
+
])])) : Q(a) ? (s(), r("svg", Yl, [...h[5] || (h[5] = [
|
|
3222
3222
|
l("path", {
|
|
3223
3223
|
d: "M2 6L10 6",
|
|
3224
3224
|
stroke: "currentColor",
|
|
@@ -3229,52 +3229,52 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3229
3229
|
], 10, Pl)) : W("", !0),
|
|
3230
3230
|
t.iconClass ? (s(), r("span", {
|
|
3231
3231
|
key: 3,
|
|
3232
|
-
class:
|
|
3232
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3233
3233
|
}, null, 2)) : W("", !0),
|
|
3234
3234
|
l("img", {
|
|
3235
3235
|
class: "ytree-node__avatar",
|
|
3236
|
-
src:
|
|
3236
|
+
src: b(a, o),
|
|
3237
3237
|
alt: $(a) ? "person" : "dept"
|
|
3238
3238
|
}, null, 8, Ol),
|
|
3239
3239
|
l("span", {
|
|
3240
|
-
class:
|
|
3241
|
-
},
|
|
3240
|
+
class: B(["ytree-node__label", { "is-employee": $(a) }])
|
|
3241
|
+
}, oe(H(a)), 3),
|
|
3242
3242
|
l("div", jl, [
|
|
3243
3243
|
fe(p.$slots, "node-content", {
|
|
3244
3244
|
node: a,
|
|
3245
3245
|
isCurrent: J(a),
|
|
3246
3246
|
isExpanded: O(a),
|
|
3247
|
-
hasChildren:
|
|
3247
|
+
hasChildren: c(a)
|
|
3248
3248
|
}, void 0, !0)
|
|
3249
3249
|
])
|
|
3250
3250
|
], 42, Wl),
|
|
3251
|
-
|
|
3251
|
+
ve(_e, { name: "ytree-node" }, {
|
|
3252
3252
|
default: ye(() => [
|
|
3253
|
-
|
|
3254
|
-
(s(!0), r(
|
|
3255
|
-
key: x(
|
|
3256
|
-
class:
|
|
3257
|
-
"ytree-node--current": J(
|
|
3258
|
-
"ytree-node--highlight":
|
|
3253
|
+
c(a) && O(a) ? (s(), r("div", ql, [
|
|
3254
|
+
(s(!0), r(pe, null, me(D(a), (d) => (s(), r("div", {
|
|
3255
|
+
key: x(d),
|
|
3256
|
+
class: B(["ytree-node", {
|
|
3257
|
+
"ytree-node--current": J(d),
|
|
3258
|
+
"ytree-node--highlight": ae(d)
|
|
3259
3259
|
}])
|
|
3260
3260
|
}, [
|
|
3261
3261
|
l("div", {
|
|
3262
|
-
class:
|
|
3262
|
+
class: B(["ytree-node__content", { "is-child-style": P(d, o) }]),
|
|
3263
3263
|
style: { paddingLeft: "38px" },
|
|
3264
|
-
"data-level": A(o,
|
|
3265
|
-
onClick: (
|
|
3266
|
-
onContextmenu: (
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3264
|
+
"data-level": A(o, d),
|
|
3265
|
+
onClick: (k) => T(d, d, null, o),
|
|
3266
|
+
onContextmenu: (k) => N(
|
|
3267
|
+
k,
|
|
3268
|
+
d,
|
|
3269
|
+
d,
|
|
3270
3270
|
null
|
|
3271
3271
|
)
|
|
3272
3272
|
}, [
|
|
3273
|
-
d
|
|
3273
|
+
c(d) ? (s(), r("span", {
|
|
3274
3274
|
key: 0,
|
|
3275
|
-
class:
|
|
3276
|
-
onClick: G((
|
|
3277
|
-
}, [...
|
|
3275
|
+
class: B(["ytree-node__expand-icon", { "is-expanded": O(d) }]),
|
|
3276
|
+
onClick: G((k) => E(d), ["stop"])
|
|
3277
|
+
}, [...h[6] || (h[6] = [
|
|
3278
3278
|
l("svg", {
|
|
3279
3279
|
width: "12",
|
|
3280
3280
|
height: "12",
|
|
@@ -3292,13 +3292,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3292
3292
|
])], 10, Zl)) : (s(), r("span", Ql)),
|
|
3293
3293
|
t.showCheckbox ? (s(), r("span", {
|
|
3294
3294
|
key: 2,
|
|
3295
|
-
class:
|
|
3296
|
-
"is-checked": V(
|
|
3297
|
-
"is-indeterminate": Q(
|
|
3295
|
+
class: B(["ytree-node__checkbox", {
|
|
3296
|
+
"is-checked": V(d),
|
|
3297
|
+
"is-indeterminate": Q(d)
|
|
3298
3298
|
}]),
|
|
3299
|
-
onClick: G((
|
|
3299
|
+
onClick: G((k) => ee(d), ["stop"])
|
|
3300
3300
|
}, [
|
|
3301
|
-
V(
|
|
3301
|
+
V(d) ? (s(), r("svg", Xl, [...h[7] || (h[7] = [
|
|
3302
3302
|
l("path", {
|
|
3303
3303
|
d: "M2 6L4.5 8.5L10 3",
|
|
3304
3304
|
stroke: "currentColor",
|
|
@@ -3306,7 +3306,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3306
3306
|
"stroke-linecap": "round",
|
|
3307
3307
|
"stroke-linejoin": "round"
|
|
3308
3308
|
}, null, -1)
|
|
3309
|
-
])])) : Q(
|
|
3309
|
+
])])) : Q(d) ? (s(), r("svg", Gl, [...h[8] || (h[8] = [
|
|
3310
3310
|
l("path", {
|
|
3311
3311
|
d: "M2 6L10 6",
|
|
3312
3312
|
stroke: "currentColor",
|
|
@@ -3317,61 +3317,61 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3317
3317
|
], 10, Jl)) : W("", !0),
|
|
3318
3318
|
t.iconClass ? (s(), r("span", {
|
|
3319
3319
|
key: 3,
|
|
3320
|
-
class:
|
|
3320
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3321
3321
|
}, null, 2)) : W("", !0),
|
|
3322
3322
|
l("img", {
|
|
3323
3323
|
class: "ytree-node__avatar",
|
|
3324
|
-
src:
|
|
3325
|
-
alt: $(
|
|
3324
|
+
src: b(d, o),
|
|
3325
|
+
alt: $(d) ? "person" : "dept"
|
|
3326
3326
|
}, null, 8, eo),
|
|
3327
3327
|
l("span", {
|
|
3328
|
-
class:
|
|
3329
|
-
},
|
|
3328
|
+
class: B(["ytree-node__label", { "is-employee": $(d) }])
|
|
3329
|
+
}, oe(H(d)), 3),
|
|
3330
3330
|
l("div", to, [
|
|
3331
3331
|
fe(p.$slots, "node-content", {
|
|
3332
|
-
node:
|
|
3333
|
-
isCurrent: J(
|
|
3334
|
-
isExpanded: O(
|
|
3335
|
-
hasChildren: d
|
|
3332
|
+
node: d,
|
|
3333
|
+
isCurrent: J(d),
|
|
3334
|
+
isExpanded: O(d),
|
|
3335
|
+
hasChildren: c(d)
|
|
3336
3336
|
}, void 0, !0)
|
|
3337
3337
|
])
|
|
3338
3338
|
], 42, Ul),
|
|
3339
|
-
|
|
3339
|
+
ve(_e, { name: "ytree-node" }, {
|
|
3340
3340
|
default: ye(() => [
|
|
3341
|
-
d
|
|
3342
|
-
(s(!0), r(
|
|
3343
|
-
key: x(
|
|
3344
|
-
class:
|
|
3345
|
-
"ytree-node--current": J(
|
|
3346
|
-
"ytree-node--highlight":
|
|
3341
|
+
c(d) && O(d) ? (s(), r("div", no, [
|
|
3342
|
+
(s(!0), r(pe, null, me(D(d), (k) => (s(), r("div", {
|
|
3343
|
+
key: x(k),
|
|
3344
|
+
class: B(["ytree-node", {
|
|
3345
|
+
"ytree-node--current": J(k),
|
|
3346
|
+
"ytree-node--highlight": ae(k)
|
|
3347
3347
|
}])
|
|
3348
3348
|
}, [
|
|
3349
3349
|
l("div", {
|
|
3350
|
-
class:
|
|
3350
|
+
class: B(["ytree-node__content", { "is-child-style": P(k, o) }]),
|
|
3351
3351
|
style: {
|
|
3352
3352
|
paddingLeft: "54px"
|
|
3353
3353
|
},
|
|
3354
|
-
"data-level": A(o,
|
|
3355
|
-
onClick: (M) =>
|
|
3356
|
-
|
|
3357
|
-
|
|
3354
|
+
"data-level": A(o, k),
|
|
3355
|
+
onClick: (M) => T(
|
|
3356
|
+
k,
|
|
3357
|
+
k,
|
|
3358
3358
|
null,
|
|
3359
3359
|
o
|
|
3360
3360
|
),
|
|
3361
3361
|
onContextmenu: (M) => N(
|
|
3362
3362
|
M,
|
|
3363
|
-
|
|
3364
|
-
|
|
3363
|
+
k,
|
|
3364
|
+
k,
|
|
3365
3365
|
null
|
|
3366
3366
|
)
|
|
3367
3367
|
}, [
|
|
3368
|
-
|
|
3368
|
+
c(k) ? (s(), r("span", {
|
|
3369
3369
|
key: 0,
|
|
3370
|
-
class:
|
|
3371
|
-
"is-expanded": O(
|
|
3370
|
+
class: B(["ytree-node__expand-icon", {
|
|
3371
|
+
"is-expanded": O(k)
|
|
3372
3372
|
}]),
|
|
3373
|
-
onClick: G((M) => E(
|
|
3374
|
-
}, [...
|
|
3373
|
+
onClick: G((M) => E(k), ["stop"])
|
|
3374
|
+
}, [...h[9] || (h[9] = [
|
|
3375
3375
|
l("svg", {
|
|
3376
3376
|
width: "12",
|
|
3377
3377
|
height: "12",
|
|
@@ -3389,13 +3389,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3389
3389
|
])], 10, oo)) : (s(), r("span", ao)),
|
|
3390
3390
|
t.showCheckbox ? (s(), r("span", {
|
|
3391
3391
|
key: 2,
|
|
3392
|
-
class:
|
|
3393
|
-
"is-checked": V(
|
|
3394
|
-
"is-indeterminate": Q(
|
|
3392
|
+
class: B(["ytree-node__checkbox", {
|
|
3393
|
+
"is-checked": V(k),
|
|
3394
|
+
"is-indeterminate": Q(k)
|
|
3395
3395
|
}]),
|
|
3396
|
-
onClick: G((M) => ee(
|
|
3396
|
+
onClick: G((M) => ee(k), ["stop"])
|
|
3397
3397
|
}, [
|
|
3398
|
-
V(
|
|
3398
|
+
V(k) ? (s(), r("svg", io, [...h[10] || (h[10] = [
|
|
3399
3399
|
l("path", {
|
|
3400
3400
|
d: "M2 6L4.5 8.5L10 3",
|
|
3401
3401
|
stroke: "currentColor",
|
|
@@ -3403,7 +3403,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3403
3403
|
"stroke-linecap": "round",
|
|
3404
3404
|
"stroke-linejoin": "round"
|
|
3405
3405
|
}, null, -1)
|
|
3406
|
-
])])) : Q(
|
|
3406
|
+
])])) : Q(k) ? (s(), r("svg", ro, [...h[11] || (h[11] = [
|
|
3407
3407
|
l("path", {
|
|
3408
3408
|
d: "M2 6L10 6",
|
|
3409
3409
|
stroke: "currentColor",
|
|
@@ -3414,64 +3414,64 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3414
3414
|
], 10, so)) : W("", !0),
|
|
3415
3415
|
t.iconClass ? (s(), r("span", {
|
|
3416
3416
|
key: 3,
|
|
3417
|
-
class:
|
|
3417
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3418
3418
|
}, null, 2)) : W("", !0),
|
|
3419
3419
|
l("img", {
|
|
3420
3420
|
class: "ytree-node__avatar",
|
|
3421
|
-
src:
|
|
3422
|
-
alt: $(
|
|
3421
|
+
src: b(k, o),
|
|
3422
|
+
alt: $(k) ? "person" : "dept"
|
|
3423
3423
|
}, null, 8, uo),
|
|
3424
3424
|
l("span", {
|
|
3425
|
-
class:
|
|
3426
|
-
"is-employee": $(
|
|
3425
|
+
class: B(["ytree-node__label", {
|
|
3426
|
+
"is-employee": $(k)
|
|
3427
3427
|
}])
|
|
3428
|
-
},
|
|
3428
|
+
}, oe(H(k)), 3),
|
|
3429
3429
|
l("div", co, [
|
|
3430
3430
|
fe(p.$slots, "node-content", {
|
|
3431
|
-
node:
|
|
3432
|
-
isCurrent: J(
|
|
3433
|
-
isExpanded: O(
|
|
3434
|
-
hasChildren:
|
|
3431
|
+
node: k,
|
|
3432
|
+
isCurrent: J(k),
|
|
3433
|
+
isExpanded: O(k),
|
|
3434
|
+
hasChildren: c(k)
|
|
3435
3435
|
}, void 0, !0)
|
|
3436
3436
|
])
|
|
3437
3437
|
], 42, lo),
|
|
3438
|
-
|
|
3438
|
+
ve(_e, { name: "ytree-node" }, {
|
|
3439
3439
|
default: ye(() => [
|
|
3440
|
-
|
|
3441
|
-
(s(!0), r(
|
|
3442
|
-
|
|
3440
|
+
c(k) && O(k) ? (s(), r("div", fo, [
|
|
3441
|
+
(s(!0), r(pe, null, me(D(
|
|
3442
|
+
k
|
|
3443
3443
|
), (M) => (s(), r("div", {
|
|
3444
3444
|
key: x(M),
|
|
3445
|
-
class:
|
|
3445
|
+
class: B(["ytree-node", {
|
|
3446
3446
|
"ytree-node--current": J(M)
|
|
3447
3447
|
}])
|
|
3448
3448
|
}, [
|
|
3449
3449
|
l("div", {
|
|
3450
|
-
class:
|
|
3450
|
+
class: B(["ytree-node__content", { "is-child-style": P(M, o) }]),
|
|
3451
3451
|
style: {
|
|
3452
3452
|
paddingLeft: "70px"
|
|
3453
3453
|
},
|
|
3454
3454
|
"data-level": A(o, M),
|
|
3455
|
-
onClick: (
|
|
3455
|
+
onClick: (z) => T(
|
|
3456
3456
|
M,
|
|
3457
3457
|
M,
|
|
3458
3458
|
null,
|
|
3459
3459
|
o
|
|
3460
3460
|
),
|
|
3461
|
-
onContextmenu: (
|
|
3462
|
-
|
|
3461
|
+
onContextmenu: (z) => N(
|
|
3462
|
+
z,
|
|
3463
3463
|
M,
|
|
3464
3464
|
M,
|
|
3465
3465
|
null
|
|
3466
3466
|
)
|
|
3467
3467
|
}, [
|
|
3468
|
-
|
|
3468
|
+
c(M) ? (s(), r("span", {
|
|
3469
3469
|
key: 0,
|
|
3470
|
-
class:
|
|
3470
|
+
class: B(["ytree-node__expand-icon", {
|
|
3471
3471
|
"is-expanded": O(M)
|
|
3472
3472
|
}]),
|
|
3473
|
-
onClick: G((
|
|
3474
|
-
}, [...
|
|
3473
|
+
onClick: G((z) => E(M), ["stop"])
|
|
3474
|
+
}, [...h[12] || (h[12] = [
|
|
3475
3475
|
l("svg", {
|
|
3476
3476
|
width: "12",
|
|
3477
3477
|
height: "12",
|
|
@@ -3489,15 +3489,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3489
3489
|
])], 10, ho)) : (s(), r("span", po)),
|
|
3490
3490
|
t.showCheckbox ? (s(), r("span", {
|
|
3491
3491
|
key: 2,
|
|
3492
|
-
class:
|
|
3492
|
+
class: B(["ytree-node__checkbox", {
|
|
3493
3493
|
"is-checked": V(M),
|
|
3494
3494
|
"is-indeterminate": Q(
|
|
3495
3495
|
M
|
|
3496
3496
|
)
|
|
3497
3497
|
}]),
|
|
3498
|
-
onClick: G((
|
|
3498
|
+
onClick: G((z) => ee(M), ["stop"])
|
|
3499
3499
|
}, [
|
|
3500
|
-
V(M) ? (s(), r("svg", go, [...
|
|
3500
|
+
V(M) ? (s(), r("svg", go, [...h[13] || (h[13] = [
|
|
3501
3501
|
l("path", {
|
|
3502
3502
|
d: "M2 6L4.5 8.5L10 3",
|
|
3503
3503
|
stroke: "currentColor",
|
|
@@ -3507,7 +3507,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3507
3507
|
}, null, -1)
|
|
3508
3508
|
])])) : Q(
|
|
3509
3509
|
M
|
|
3510
|
-
) ? (s(), r("svg", mo, [...
|
|
3510
|
+
) ? (s(), r("svg", mo, [...h[14] || (h[14] = [
|
|
3511
3511
|
l("path", {
|
|
3512
3512
|
d: "M2 6L10 6",
|
|
3513
3513
|
stroke: "currentColor",
|
|
@@ -3518,24 +3518,24 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3518
3518
|
], 10, yo)) : W("", !0),
|
|
3519
3519
|
t.iconClass ? (s(), r("span", {
|
|
3520
3520
|
key: 3,
|
|
3521
|
-
class:
|
|
3521
|
+
class: B(["ytree-node__icon", t.iconClass])
|
|
3522
3522
|
}, null, 2)) : W("", !0),
|
|
3523
3523
|
l("img", {
|
|
3524
3524
|
class: "ytree-node__avatar",
|
|
3525
|
-
src:
|
|
3525
|
+
src: b(M, o),
|
|
3526
3526
|
alt: $(M) ? "person" : "dept"
|
|
3527
3527
|
}, null, 8, wo),
|
|
3528
3528
|
l("span", {
|
|
3529
|
-
class:
|
|
3529
|
+
class: B(["ytree-node__label", {
|
|
3530
3530
|
"is-employee": $(M)
|
|
3531
3531
|
}])
|
|
3532
|
-
},
|
|
3532
|
+
}, oe(H(M)), 3),
|
|
3533
3533
|
l("div", bo, [
|
|
3534
3534
|
fe(p.$slots, "node-content", {
|
|
3535
3535
|
node: M,
|
|
3536
3536
|
isCurrent: J(M),
|
|
3537
3537
|
isExpanded: O(M),
|
|
3538
|
-
hasChildren:
|
|
3538
|
+
hasChildren: c(M)
|
|
3539
3539
|
}, void 0, !0)
|
|
3540
3540
|
])
|
|
3541
3541
|
], 42, vo)
|
|
@@ -3563,13 +3563,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3563
3563
|
])
|
|
3564
3564
|
], 2));
|
|
3565
3565
|
}
|
|
3566
|
-
}), Do = /* @__PURE__ */
|
|
3566
|
+
}), Do = /* @__PURE__ */ xe($o, [["__scopeId", "data-v-6ab410ed"]]), Co = { class: "query-encapsulation" }, _o = { class: "query-encapsulation__container" }, So = { class: "query-encapsulation__content" }, Mo = { class: "query-encapsulation__fields" }, Lo = { class: "query-encapsulation__field-wrapper" }, Io = {
|
|
3567
3567
|
key: 0,
|
|
3568
3568
|
class: "query-encapsulation__field-label"
|
|
3569
3569
|
}, Eo = {
|
|
3570
3570
|
key: 0,
|
|
3571
3571
|
class: "query-encapsulation__toggle"
|
|
3572
|
-
}, Bo = { class: "query-encapsulation__actions" }, To = { class: "query-encapsulation__actions-group" }, Ko = /* @__PURE__ */
|
|
3572
|
+
}, Bo = { class: "query-encapsulation__actions" }, To = { class: "query-encapsulation__actions-group" }, Ko = /* @__PURE__ */ ke({
|
|
3573
3573
|
__name: "QueryEncapsulation",
|
|
3574
3574
|
props: {
|
|
3575
3575
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3579,11 +3579,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3579
3579
|
modelValue: { default: () => ({}) }
|
|
3580
3580
|
},
|
|
3581
3581
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3582
|
-
setup(t, { emit:
|
|
3583
|
-
const e = t, n =
|
|
3582
|
+
setup(t, { emit: w }) {
|
|
3583
|
+
const e = t, n = w, m = K(!1), f = ct({}), v = ["select", "date", "daterange"];
|
|
3584
3584
|
let S;
|
|
3585
|
-
const x = j(() => e.fields.filter((E) => !E.hidden)),
|
|
3586
|
-
function
|
|
3585
|
+
const x = j(() => e.fields.filter((E) => !E.hidden)), H = j(() => m.value ? x.value : x.value.slice(0, e.maxVisibleFields)), $ = j(() => x.value.length > e.maxVisibleFields);
|
|
3586
|
+
function b(E) {
|
|
3587
3587
|
switch (E) {
|
|
3588
3588
|
case "select":
|
|
3589
3589
|
return st;
|
|
@@ -3595,21 +3595,21 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3595
3595
|
return at;
|
|
3596
3596
|
}
|
|
3597
3597
|
}
|
|
3598
|
-
function
|
|
3598
|
+
function c(E, F) {
|
|
3599
3599
|
f[E] = F;
|
|
3600
|
-
const
|
|
3601
|
-
|
|
3600
|
+
const T = e.fields.find((N) => N.key === E);
|
|
3601
|
+
T && D(T);
|
|
3602
3602
|
}
|
|
3603
3603
|
function D(E) {
|
|
3604
|
-
n("field-change", E, f[E.key]), n("update:modelValue", { ...f }),
|
|
3604
|
+
n("field-change", E, f[E.key]), n("update:modelValue", { ...f }), v.includes(E.type) && J();
|
|
3605
3605
|
}
|
|
3606
3606
|
function A() {
|
|
3607
|
-
const E =
|
|
3608
|
-
n("search", { data: F, raw:
|
|
3607
|
+
const E = ae(f), F = ee(E), T = { ...f };
|
|
3608
|
+
n("search", { data: F, raw: T });
|
|
3609
3609
|
}
|
|
3610
3610
|
function P() {
|
|
3611
3611
|
Object.keys(f).forEach((E) => {
|
|
3612
|
-
const F = e.fields.find((
|
|
3612
|
+
const F = e.fields.find((T) => T.key === E);
|
|
3613
3613
|
(F == null ? void 0 : F.type) === "daterange" ? f[E] = { startDate: null, endDate: null } : (F == null ? void 0 : F.type) === "date" ? f[E] = null : f[E] = "";
|
|
3614
3614
|
}), n("reset"), n("update:modelValue", { ...f });
|
|
3615
3615
|
}
|
|
@@ -3623,97 +3623,97 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3623
3623
|
};
|
|
3624
3624
|
}
|
|
3625
3625
|
async function Q() {
|
|
3626
|
-
await
|
|
3626
|
+
await de(), A();
|
|
3627
3627
|
}
|
|
3628
3628
|
function J() {
|
|
3629
3629
|
S && clearTimeout(S), S = setTimeout(() => {
|
|
3630
|
-
S = void 0,
|
|
3630
|
+
S = void 0, de().then(() => A());
|
|
3631
3631
|
}, 0);
|
|
3632
3632
|
}
|
|
3633
|
-
function
|
|
3633
|
+
function ae(E) {
|
|
3634
3634
|
const F = {};
|
|
3635
|
-
return Object.keys(E).forEach((
|
|
3636
|
-
const N = e.fields.find((ge) => ge.key ===
|
|
3635
|
+
return Object.keys(E).forEach((T) => {
|
|
3636
|
+
const N = e.fields.find((ge) => ge.key === T), se = E[T], q = typeof se == "string" ? se.trim() : se;
|
|
3637
3637
|
if (!(q == null || q === "")) {
|
|
3638
3638
|
if (typeof q == "object" && q.startDate && q.endDate) {
|
|
3639
|
-
q.startDate && q.endDate && (F[
|
|
3639
|
+
q.startDate && q.endDate && (F[T] = q);
|
|
3640
3640
|
return;
|
|
3641
3641
|
}
|
|
3642
3642
|
if (N && (N.type === "date" || N.type === "daterange")) {
|
|
3643
|
-
q !== 0 && (F[
|
|
3643
|
+
q !== 0 && (F[T] = q);
|
|
3644
3644
|
return;
|
|
3645
3645
|
}
|
|
3646
|
-
F[
|
|
3646
|
+
F[T] = q;
|
|
3647
3647
|
}
|
|
3648
3648
|
}), F;
|
|
3649
3649
|
}
|
|
3650
3650
|
function ee(E) {
|
|
3651
3651
|
const F = {};
|
|
3652
|
-
return Object.keys(E).forEach((
|
|
3653
|
-
const N = E[
|
|
3654
|
-
if (
|
|
3655
|
-
if (
|
|
3656
|
-
const q =
|
|
3657
|
-
N.startDate && N.endDate && N.startDate !== 0 && N.endDate !== 0 && (
|
|
3658
|
-
} else
|
|
3652
|
+
return Object.keys(E).forEach((T) => {
|
|
3653
|
+
const N = E[T], se = e.fields.find((q) => q.key === T);
|
|
3654
|
+
if (se)
|
|
3655
|
+
if (se.type === "daterange" && typeof N == "object") {
|
|
3656
|
+
const q = se.startKey || `${T}Start`, ge = se.endKey || `${T}End`;
|
|
3657
|
+
N.startDate && N.endDate && N.startDate !== 0 && N.endDate !== 0 && (se.format === "timestamp" ? (F[q] = new Date(N.startDate).getTime(), F[ge] = new Date(N.endDate).getTime()) : (F[q] = N.startDate, F[ge] = N.endDate));
|
|
3658
|
+
} else se.type === "date" && N && N !== 0 && se.format === "timestamp" ? F[T] = new Date(N).getTime() : F[T] = N;
|
|
3659
3659
|
else
|
|
3660
|
-
F[
|
|
3660
|
+
F[T] = N;
|
|
3661
3661
|
}), F;
|
|
3662
3662
|
}
|
|
3663
|
-
function
|
|
3663
|
+
function he() {
|
|
3664
3664
|
e.fields.forEach((E) => {
|
|
3665
|
-
var F,
|
|
3665
|
+
var F, T, N;
|
|
3666
3666
|
f[E.key] === void 0 && (E.type === "daterange" ? f[E.key] = ((F = e.modelValue) == null ? void 0 : F[E.key]) || {
|
|
3667
3667
|
startDate: null,
|
|
3668
3668
|
endDate: null
|
|
3669
|
-
} : E.type === "date" ? f[E.key] = ((
|
|
3669
|
+
} : E.type === "date" ? f[E.key] = ((T = e.modelValue) == null ? void 0 : T[E.key]) || null : f[E.key] = ((N = e.modelValue) == null ? void 0 : N[E.key]) || "");
|
|
3670
3670
|
});
|
|
3671
3671
|
}
|
|
3672
|
-
return
|
|
3672
|
+
return re(
|
|
3673
3673
|
() => e.modelValue,
|
|
3674
3674
|
(E) => {
|
|
3675
3675
|
E && Object.assign(f, E);
|
|
3676
3676
|
},
|
|
3677
3677
|
{ deep: !0, immediate: !0 }
|
|
3678
3678
|
), Me(() => {
|
|
3679
|
-
|
|
3679
|
+
he();
|
|
3680
3680
|
}), lt(() => {
|
|
3681
3681
|
S && (clearTimeout(S), S = void 0);
|
|
3682
3682
|
}), (E, F) => (s(), r("div", Co, [
|
|
3683
3683
|
l("div", _o, [
|
|
3684
3684
|
l("div", So, [
|
|
3685
3685
|
l("div", Mo, [
|
|
3686
|
-
|
|
3686
|
+
ve(ft, {
|
|
3687
3687
|
name: "qf",
|
|
3688
3688
|
tag: "div",
|
|
3689
3689
|
class: "query-encapsulation__fields-group"
|
|
3690
3690
|
}, {
|
|
3691
3691
|
default: ye(() => [
|
|
3692
|
-
(s(!0), r(
|
|
3693
|
-
key:
|
|
3692
|
+
(s(!0), r(pe, null, me(H.value, (T) => (s(), r("div", {
|
|
3693
|
+
key: T.key,
|
|
3694
3694
|
class: "query-encapsulation__field-item"
|
|
3695
3695
|
}, [
|
|
3696
|
-
fe(E.$slots, `field-${
|
|
3697
|
-
field:
|
|
3698
|
-
value: f[
|
|
3699
|
-
updateValue: (N) =>
|
|
3696
|
+
fe(E.$slots, `field-${T.key}`, {
|
|
3697
|
+
field: T,
|
|
3698
|
+
value: f[T.key],
|
|
3699
|
+
updateValue: (N) => c(T.key, N)
|
|
3700
3700
|
}, () => [
|
|
3701
|
-
l("div",
|
|
3702
|
-
t.Iflabel ? (s(), r("label",
|
|
3703
|
-
(s(),
|
|
3704
|
-
modelValue: f[
|
|
3705
|
-
"onUpdate:modelValue": (N) => f[
|
|
3706
|
-
placeholder:
|
|
3707
|
-
options:
|
|
3708
|
-
clearable:
|
|
3709
|
-
size:
|
|
3710
|
-
width:
|
|
3711
|
-
format:
|
|
3712
|
-
"include-time":
|
|
3713
|
-
filterable:
|
|
3714
|
-
}, pt(V(
|
|
3715
|
-
onInput: (N) => D(
|
|
3716
|
-
onChange: (N) => D(
|
|
3701
|
+
l("div", Lo, [
|
|
3702
|
+
t.Iflabel ? (s(), r("label", Io, oe(T.label), 1)) : W("", !0),
|
|
3703
|
+
(s(), Te(vt(b(T.type)), ht({
|
|
3704
|
+
modelValue: f[T.key],
|
|
3705
|
+
"onUpdate:modelValue": (N) => f[T.key] = N,
|
|
3706
|
+
placeholder: T.placeholder || `请输入${T.label}`,
|
|
3707
|
+
options: T.options,
|
|
3708
|
+
clearable: T.clearable !== !1,
|
|
3709
|
+
size: T.size || "small",
|
|
3710
|
+
width: T.width || "180px",
|
|
3711
|
+
format: T.format || "timestamp",
|
|
3712
|
+
"include-time": T.includeTime || !1,
|
|
3713
|
+
filterable: T.filterable === !0
|
|
3714
|
+
}, pt(V(T)), {
|
|
3715
|
+
onInput: (N) => D(T),
|
|
3716
|
+
onChange: (N) => D(T)
|
|
3717
3717
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3718
3718
|
])
|
|
3719
3719
|
], !0)
|
|
@@ -3722,15 +3722,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3722
3722
|
_: 3
|
|
3723
3723
|
}),
|
|
3724
3724
|
$.value ? (s(), r("div", Eo, [
|
|
3725
|
-
|
|
3725
|
+
ve(je, {
|
|
3726
3726
|
variant: "secondary",
|
|
3727
3727
|
size: "small",
|
|
3728
3728
|
onClick: O
|
|
3729
3729
|
}, {
|
|
3730
3730
|
default: ye(() => [
|
|
3731
|
-
Se(
|
|
3731
|
+
Se(oe(m.value ? "收起" : "展开") + " ", 1),
|
|
3732
3732
|
l("span", {
|
|
3733
|
-
class:
|
|
3733
|
+
class: B(["query-encapsulation__toggle-icon", { "is-expanded": m.value }])
|
|
3734
3734
|
}, "▼", 2)
|
|
3735
3735
|
]),
|
|
3736
3736
|
_: 1
|
|
@@ -3738,7 +3738,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3738
3738
|
])) : W("", !0),
|
|
3739
3739
|
l("div", Bo, [
|
|
3740
3740
|
l("div", To, [
|
|
3741
|
-
|
|
3741
|
+
ve(je, {
|
|
3742
3742
|
variant: "primary",
|
|
3743
3743
|
size: "small",
|
|
3744
3744
|
onClick: A,
|
|
@@ -3749,7 +3749,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3749
3749
|
])]),
|
|
3750
3750
|
_: 1
|
|
3751
3751
|
}, 8, ["loading"]),
|
|
3752
|
-
|
|
3752
|
+
ve(je, {
|
|
3753
3753
|
variant: "secondary",
|
|
3754
3754
|
size: "small",
|
|
3755
3755
|
onClick: P,
|
|
@@ -3768,7 +3768,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3768
3768
|
])
|
|
3769
3769
|
]));
|
|
3770
3770
|
}
|
|
3771
|
-
}), zo = /* @__PURE__ */
|
|
3771
|
+
}), zo = /* @__PURE__ */ xe(Ko, [["__scopeId", "data-v-73456475"]]), Ho = {
|
|
3772
3772
|
key: 0,
|
|
3773
3773
|
width: "16",
|
|
3774
3774
|
height: "16",
|
|
@@ -3786,7 +3786,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3786
3786
|
height: "16",
|
|
3787
3787
|
viewBox: "0 0 24 24",
|
|
3788
3788
|
fill: "none"
|
|
3789
|
-
}, Wo = ["textContent"], Vo = /* @__PURE__ */
|
|
3789
|
+
}, Wo = ["textContent"], Vo = /* @__PURE__ */ ke({
|
|
3790
3790
|
__name: "ymessageToast",
|
|
3791
3791
|
props: {
|
|
3792
3792
|
id: {},
|
|
@@ -3799,53 +3799,53 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3799
3799
|
onClose: {}
|
|
3800
3800
|
},
|
|
3801
3801
|
setup(t) {
|
|
3802
|
-
const
|
|
3802
|
+
const w = t, e = K(!1);
|
|
3803
3803
|
let n, m = 0, f = 0;
|
|
3804
3804
|
Me(() => {
|
|
3805
3805
|
requestAnimationFrame(() => {
|
|
3806
|
-
e.value = !0,
|
|
3806
|
+
e.value = !0, w.duration && w.duration > 0 && v(w.duration);
|
|
3807
3807
|
});
|
|
3808
3808
|
}), lt(() => {
|
|
3809
3809
|
S();
|
|
3810
3810
|
});
|
|
3811
|
-
function
|
|
3812
|
-
m =
|
|
3811
|
+
function v(c) {
|
|
3812
|
+
m = c, f = Date.now(), n = window.setTimeout(() => $(), c);
|
|
3813
3813
|
}
|
|
3814
3814
|
function S() {
|
|
3815
3815
|
n && (window.clearTimeout(n), n = void 0);
|
|
3816
3816
|
}
|
|
3817
3817
|
function x() {
|
|
3818
|
-
if (n &&
|
|
3818
|
+
if (n && w.duration && w.duration > 0) {
|
|
3819
3819
|
S();
|
|
3820
|
-
const
|
|
3821
|
-
m = Math.max(0, m -
|
|
3820
|
+
const c = Date.now() - f;
|
|
3821
|
+
m = Math.max(0, m - c);
|
|
3822
3822
|
}
|
|
3823
3823
|
}
|
|
3824
|
-
function
|
|
3825
|
-
|
|
3824
|
+
function H() {
|
|
3825
|
+
w.duration && w.duration > 0 && m > 0 && v(m);
|
|
3826
3826
|
}
|
|
3827
3827
|
function $() {
|
|
3828
3828
|
e.value = !1;
|
|
3829
3829
|
}
|
|
3830
|
-
function
|
|
3831
|
-
var
|
|
3832
|
-
(
|
|
3830
|
+
function b() {
|
|
3831
|
+
var c;
|
|
3832
|
+
(c = w.onClose) == null || c.call(w, w.id);
|
|
3833
3833
|
}
|
|
3834
|
-
return (
|
|
3834
|
+
return (c, D) => (s(), Te(_e, {
|
|
3835
3835
|
name: "y-msg-fade",
|
|
3836
|
-
onAfterLeave:
|
|
3836
|
+
onAfterLeave: b
|
|
3837
3837
|
}, {
|
|
3838
3838
|
default: ye(() => [
|
|
3839
|
-
|
|
3840
|
-
class:
|
|
3841
|
-
style:
|
|
3839
|
+
Le(l("div", {
|
|
3840
|
+
class: B(["y-msg", [`y-msg--${t.type}`]]),
|
|
3841
|
+
style: ce({ zIndex: t.zIndex }),
|
|
3842
3842
|
role: "status",
|
|
3843
3843
|
"aria-live": "polite",
|
|
3844
3844
|
onMouseenter: x,
|
|
3845
|
-
onMouseleave:
|
|
3845
|
+
onMouseleave: H
|
|
3846
3846
|
}, [
|
|
3847
3847
|
l("span", {
|
|
3848
|
-
class:
|
|
3848
|
+
class: B(["y-msg__icon", `y-msg__icon--${t.type}`]),
|
|
3849
3849
|
"aria-hidden": "true"
|
|
3850
3850
|
}, [
|
|
3851
3851
|
t.type === "success" ? (s(), r("svg", Ho, [...D[0] || (D[0] = [
|
|
@@ -3876,7 +3876,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3876
3876
|
], 2),
|
|
3877
3877
|
l("div", {
|
|
3878
3878
|
class: "y-msg__content",
|
|
3879
|
-
textContent:
|
|
3879
|
+
textContent: oe(t.message)
|
|
3880
3880
|
}, null, 8, Wo),
|
|
3881
3881
|
t.closable ? (s(), r("button", {
|
|
3882
3882
|
key: 0,
|
|
@@ -3885,85 +3885,169 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3885
3885
|
onClick: $
|
|
3886
3886
|
}, "✕")) : W("", !0)
|
|
3887
3887
|
], 38), [
|
|
3888
|
-
[
|
|
3888
|
+
[Be, e.value]
|
|
3889
3889
|
])
|
|
3890
3890
|
]),
|
|
3891
3891
|
_: 1
|
|
3892
3892
|
}));
|
|
3893
3893
|
}
|
|
3894
|
-
}), Fo = /* @__PURE__ */
|
|
3894
|
+
}), Fo = /* @__PURE__ */ xe(Vo, [["__scopeId", "data-v-db173617"]]);
|
|
3895
3895
|
let Po = 1;
|
|
3896
|
-
const Ge = 12,
|
|
3896
|
+
const Ge = 12, Ee = [];
|
|
3897
3897
|
function No() {
|
|
3898
3898
|
let t = 20;
|
|
3899
|
-
return
|
|
3900
|
-
t +=
|
|
3899
|
+
return Ee.forEach((w) => {
|
|
3900
|
+
t += w.height + Ge;
|
|
3901
3901
|
}), t;
|
|
3902
3902
|
}
|
|
3903
3903
|
function tt(t) {
|
|
3904
|
-
const
|
|
3905
|
-
if (
|
|
3906
|
-
const { el: e } =
|
|
3904
|
+
const w = Ee.findIndex((f) => f.id === t);
|
|
3905
|
+
if (w === -1) return;
|
|
3906
|
+
const { el: e } = Ee[w], n = e.firstElementChild;
|
|
3907
3907
|
if (n) {
|
|
3908
3908
|
const f = window.getComputedStyle(n).top;
|
|
3909
3909
|
n.style.top = f, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3910
3910
|
}
|
|
3911
|
-
|
|
3911
|
+
Ee[w].leaving = !0, Ue(), setTimeout(() => {
|
|
3912
3912
|
ot(null, e), e.parentNode && e.parentNode.removeChild(e);
|
|
3913
|
-
const f =
|
|
3914
|
-
f !== -1 &&
|
|
3913
|
+
const f = Ee.findIndex((v) => v.id === t);
|
|
3914
|
+
f !== -1 && Ee.splice(f, 1), Ue();
|
|
3915
3915
|
}, 260);
|
|
3916
3916
|
}
|
|
3917
3917
|
function Xe(t) {
|
|
3918
3918
|
var f;
|
|
3919
|
-
const
|
|
3919
|
+
const w = Po++, e = document.createElement("div");
|
|
3920
3920
|
document.body.appendChild(e);
|
|
3921
|
-
const n =
|
|
3922
|
-
id:
|
|
3921
|
+
const n = ve(Fo, {
|
|
3922
|
+
id: w,
|
|
3923
3923
|
type: t.type || "success",
|
|
3924
3924
|
message: t.message,
|
|
3925
3925
|
duration: t.duration ?? 2500,
|
|
3926
3926
|
offset: No(),
|
|
3927
|
-
zIndex: 3e3 +
|
|
3927
|
+
zIndex: 3e3 + w,
|
|
3928
3928
|
closable: t.closable ?? !1,
|
|
3929
|
-
onClose: (
|
|
3929
|
+
onClose: (v) => tt(v)
|
|
3930
3930
|
});
|
|
3931
3931
|
ot(n, e);
|
|
3932
3932
|
const m = ((f = e.firstElementChild) == null ? void 0 : f.offsetHeight) || 0;
|
|
3933
|
-
return
|
|
3934
|
-
const
|
|
3935
|
-
if (!
|
|
3936
|
-
const S =
|
|
3933
|
+
return Ee.push({ id: w, el: e, vm: n, height: m, leaving: !1 }), Ue(), requestAnimationFrame(() => {
|
|
3934
|
+
const v = e.firstElementChild;
|
|
3935
|
+
if (!v) return;
|
|
3936
|
+
const S = v.offsetHeight || m || 0, x = Ee.find((H) => H.id === w);
|
|
3937
3937
|
x && (x.height = S, Ue());
|
|
3938
|
-
}), { close: () => tt(
|
|
3938
|
+
}), { close: () => tt(w) };
|
|
3939
3939
|
}
|
|
3940
3940
|
const qe = {
|
|
3941
|
-
success(t,
|
|
3942
|
-
return Xe({ ...typeof
|
|
3941
|
+
success(t, w) {
|
|
3942
|
+
return Xe({ ...typeof w == "number" ? { duration: w } : w || {}, type: "success", message: t });
|
|
3943
3943
|
},
|
|
3944
|
-
warning(t,
|
|
3945
|
-
return Xe({ ...typeof
|
|
3944
|
+
warning(t, w) {
|
|
3945
|
+
return Xe({ ...typeof w == "number" ? { duration: w } : w || {}, type: "warning", message: t });
|
|
3946
3946
|
},
|
|
3947
|
-
error(t,
|
|
3948
|
-
return Xe({ ...typeof
|
|
3947
|
+
error(t, w) {
|
|
3948
|
+
return Xe({ ...typeof w == "number" ? { duration: w } : w || {}, type: "error", message: t });
|
|
3949
3949
|
}
|
|
3950
3950
|
};
|
|
3951
3951
|
typeof window < "u" && (window.YMessage = qe, typeof globalThis.YMessage > "u" && (globalThis.YMessage = qe));
|
|
3952
3952
|
function Ue() {
|
|
3953
3953
|
let t = 20;
|
|
3954
|
-
|
|
3955
|
-
const e =
|
|
3954
|
+
Ee.forEach((w) => {
|
|
3955
|
+
const e = w.el.firstElementChild;
|
|
3956
3956
|
if (!e) return;
|
|
3957
3957
|
const n = t;
|
|
3958
|
-
if (e.style.transform = `translate(-50%, ${n}px)`, e.style.top || (e.style.top = "0px"), !
|
|
3959
|
-
t += (e.offsetHeight ||
|
|
3958
|
+
if (e.style.transform = `translate(-50%, ${n}px)`, e.style.top || (e.style.top = "0px"), !w.leaving)
|
|
3959
|
+
t += (e.offsetHeight || w.height) + Ge;
|
|
3960
3960
|
else {
|
|
3961
|
-
const m = e.offsetHeight ||
|
|
3961
|
+
const m = e.offsetHeight || w.height;
|
|
3962
3962
|
t += m + Ge;
|
|
3963
3963
|
}
|
|
3964
3964
|
});
|
|
3965
3965
|
}
|
|
3966
|
-
const
|
|
3966
|
+
const Yo = { class: "hint-tag-content" }, Oo = ["title"], jo = /* @__PURE__ */ ke({
|
|
3967
|
+
__name: "hintTag",
|
|
3968
|
+
props: {
|
|
3969
|
+
content: { default: "" },
|
|
3970
|
+
position: { default: "right" },
|
|
3971
|
+
defaultExpanded: { type: Boolean, default: !0 },
|
|
3972
|
+
width: { default: "280px" },
|
|
3973
|
+
tooltip: { default: "" }
|
|
3974
|
+
},
|
|
3975
|
+
setup(t, { expose: w }) {
|
|
3976
|
+
const n = K(t.defaultExpanded), m = () => {
|
|
3977
|
+
n.value = !n.value;
|
|
3978
|
+
};
|
|
3979
|
+
return w({
|
|
3980
|
+
toggle: m,
|
|
3981
|
+
isExpanded: n
|
|
3982
|
+
}), (f, v) => (s(), r("div", {
|
|
3983
|
+
class: B(["hint-tag-wrapper", `hint-tag-wrapper-${t.position}`])
|
|
3984
|
+
}, [
|
|
3985
|
+
ve(_e, { name: "hint-slide" }, {
|
|
3986
|
+
default: ye(() => [
|
|
3987
|
+
Le(l("div", {
|
|
3988
|
+
class: B(["hint-tag", `hint-tag-${t.position}`]),
|
|
3989
|
+
style: ce({ width: t.position === "top" || t.position === "bottom" ? "auto" : t.width })
|
|
3990
|
+
}, [
|
|
3991
|
+
l("div", Yo, [
|
|
3992
|
+
fe(f.$slots, "default", {}, () => [
|
|
3993
|
+
Se(oe(t.content), 1)
|
|
3994
|
+
], !0)
|
|
3995
|
+
]),
|
|
3996
|
+
l("div", {
|
|
3997
|
+
class: "hint-tag-toggle",
|
|
3998
|
+
onClick: m
|
|
3999
|
+
}, [...v[0] || (v[0] = [
|
|
4000
|
+
l("svg", {
|
|
4001
|
+
class: "hint-tag-icon",
|
|
4002
|
+
viewBox: "0 0 24 24",
|
|
4003
|
+
fill: "none",
|
|
4004
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4005
|
+
}, [
|
|
4006
|
+
l("path", {
|
|
4007
|
+
d: "M15 18L9 12L15 6",
|
|
4008
|
+
stroke: "currentColor",
|
|
4009
|
+
"stroke-width": "2",
|
|
4010
|
+
"stroke-linecap": "round",
|
|
4011
|
+
"stroke-linejoin": "round"
|
|
4012
|
+
})
|
|
4013
|
+
], -1)
|
|
4014
|
+
])])
|
|
4015
|
+
], 6), [
|
|
4016
|
+
[Be, n.value]
|
|
4017
|
+
])
|
|
4018
|
+
]),
|
|
4019
|
+
_: 3
|
|
4020
|
+
}),
|
|
4021
|
+
ve(_e, { name: "hint-button-fade" }, {
|
|
4022
|
+
default: ye(() => [
|
|
4023
|
+
Le(l("div", {
|
|
4024
|
+
class: B(["hint-tag-button", `hint-tag-button-${t.position}`]),
|
|
4025
|
+
onClick: m,
|
|
4026
|
+
title: t.tooltip || t.content
|
|
4027
|
+
}, [...v[1] || (v[1] = [
|
|
4028
|
+
l("svg", {
|
|
4029
|
+
class: "hint-tag-button-icon",
|
|
4030
|
+
viewBox: "0 0 24 24",
|
|
4031
|
+
fill: "none",
|
|
4032
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4033
|
+
}, [
|
|
4034
|
+
l("path", {
|
|
4035
|
+
d: "M9 18L15 12L9 6",
|
|
4036
|
+
stroke: "currentColor",
|
|
4037
|
+
"stroke-width": "2",
|
|
4038
|
+
"stroke-linecap": "round",
|
|
4039
|
+
"stroke-linejoin": "round"
|
|
4040
|
+
})
|
|
4041
|
+
], -1)
|
|
4042
|
+
])], 10, Oo), [
|
|
4043
|
+
[Be, !n.value]
|
|
4044
|
+
])
|
|
4045
|
+
]),
|
|
4046
|
+
_: 1
|
|
4047
|
+
})
|
|
4048
|
+
], 2));
|
|
4049
|
+
}
|
|
4050
|
+
}), qo = /* @__PURE__ */ xe(jo, [["__scopeId", "data-v-e8b90c37"]]), nt = {
|
|
3967
4051
|
YButton: je,
|
|
3968
4052
|
YInput: at,
|
|
3969
4053
|
YTable: qt,
|
|
@@ -3971,18 +4055,19 @@ const nt = {
|
|
|
3971
4055
|
YPagination: on,
|
|
3972
4056
|
YBadge: wn,
|
|
3973
4057
|
YDialog: Sn,
|
|
3974
|
-
YPopover:
|
|
4058
|
+
YPopover: In,
|
|
3975
4059
|
YTime: it,
|
|
3976
4060
|
YSwitch: hl,
|
|
3977
4061
|
YImage: ml,
|
|
3978
4062
|
YDropdown: bl,
|
|
3979
4063
|
YDrawer: Ml,
|
|
3980
4064
|
YTree: Do,
|
|
3981
|
-
QueryEncapsulation: zo
|
|
3982
|
-
|
|
4065
|
+
QueryEncapsulation: zo,
|
|
4066
|
+
HintTag: qo
|
|
4067
|
+
}, Jo = {
|
|
3983
4068
|
install(t) {
|
|
3984
|
-
Object.keys(nt).forEach((
|
|
3985
|
-
t.component(
|
|
4069
|
+
Object.keys(nt).forEach((w) => {
|
|
4070
|
+
t.component(w, nt[w]);
|
|
3986
4071
|
}), t.config.globalProperties.$message = qe, typeof window < "u" && (window.YMessage = qe);
|
|
3987
4072
|
}
|
|
3988
4073
|
};
|
|
@@ -3997,12 +4082,12 @@ export {
|
|
|
3997
4082
|
at as YInput,
|
|
3998
4083
|
qe as YMessage,
|
|
3999
4084
|
on as YPagination,
|
|
4000
|
-
|
|
4085
|
+
In as YPopover,
|
|
4001
4086
|
st as YSelect,
|
|
4002
4087
|
hl as YSwitch,
|
|
4003
4088
|
qt as YTable,
|
|
4004
4089
|
it as YTime,
|
|
4005
4090
|
Do as YTree,
|
|
4006
|
-
|
|
4091
|
+
Jo as default
|
|
4007
4092
|
};
|
|
4008
4093
|
//# sourceMappingURL=index.esm.js.map
|