@nhdropshipping/y-components 1.0.28 → 1.0.29
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/QueryEncapsulation.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1030 -1023
- 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 ge, computed as O, createElementBlock as u, openBlock as i, normalizeClass as E, createElementVNode as o, renderSlot as
|
|
1
|
+
import { defineComponent as ge, computed as O, createElementBlock as u, openBlock as i, normalizeClass as E, createElementVNode as o, renderSlot as se, Fragment as ae, renderList as ce, createCommentVNode as W, toDisplayString as ee, ref as K, watch as G, normalizeStyle as fe, nextTick as oe, onMounted as Ce, onUnmounted as Ee, resolveComponent as Ve, createVNode as ie, Transition as xe, withCtx as re, createTextVNode as $e, createBlock as Me, withKeys as ke, withModifiers as J, withDirectives as Be, vModelText as lt, Teleport as Fe, vShow as Ke, provide as ot, reactive as at, TransitionGroup as st, resolveDynamicComponent as it, onBeforeUnmount as rt, render as Xe } from "vue";
|
|
2
2
|
const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "content" }, dt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -30,14 +30,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
30
30
|
emits: ["click", "group-click"],
|
|
31
31
|
setup(e, { emit: $ }) {
|
|
32
32
|
const t = e, n = $;
|
|
33
|
-
function
|
|
33
|
+
function w(C) {
|
|
34
34
|
if (t.disabled || t.loading) {
|
|
35
35
|
C.preventDefault(), C.stopPropagation();
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
n("click", C);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const p = O(() => {
|
|
41
41
|
switch (t.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,24 +48,24 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
52
|
-
function
|
|
51
|
+
}), y = O(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
|
+
function L(C, T) {
|
|
53
53
|
if (t.disabled || t.loading || C.disabled || C.loading) {
|
|
54
54
|
T.preventDefault(), T.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
n("group-click", C.value, T);
|
|
58
58
|
}
|
|
59
|
-
return (C, T) =>
|
|
60
|
-
(i(!0), u(
|
|
59
|
+
return (C, T) => y.value ? (i(), u("div", dt, [
|
|
60
|
+
(i(!0), u(ae, null, ce(e.groupItems, (k, m) => {
|
|
61
61
|
var g;
|
|
62
62
|
return i(), u("button", {
|
|
63
|
-
key: k.value ??
|
|
63
|
+
key: k.value ?? m,
|
|
64
64
|
class: E(["y-btn", [
|
|
65
65
|
`y-btn--${k.variant ?? e.variant}`,
|
|
66
66
|
`y-btn--${k.size ?? e.size}`,
|
|
67
67
|
"is-grouped",
|
|
68
|
-
|
|
68
|
+
m === 0 ? "group-pos-start" : m === (((g = e.groupItems) == null ? void 0 : g.length) || 0) - 1 ? "group-pos-end" : "group-pos-middle",
|
|
69
69
|
{ "is-loading": k.loading || e.loading }
|
|
70
70
|
]]),
|
|
71
71
|
type: e.htmlType,
|
|
@@ -73,7 +73,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
73
73
|
"aria-busy": k.loading || e.loading ? "true" : "false",
|
|
74
74
|
"aria-disabled": (k.disabled ?? !1) || e.disabled || e.loading || k.loading ? "true" : "false",
|
|
75
75
|
"aria-label": k.ariaLabel || k.label,
|
|
76
|
-
onClick: (x) =>
|
|
76
|
+
onClick: (x) => L(k, x)
|
|
77
77
|
}, [
|
|
78
78
|
o("span", vt, [
|
|
79
79
|
k.icon === "chevron-left" ? (i(), u("svg", ht, [...T[0] || (T[0] = [
|
|
@@ -89,7 +89,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
91
|
])])) : W("", !0),
|
|
92
|
-
k.label && !k.onlyIcon ? (i(), u("span", yt,
|
|
92
|
+
k.label && !k.onlyIcon ? (i(), u("span", yt, ee(k.label), 1)) : W("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, ft);
|
|
95
95
|
}), 128))
|
|
@@ -100,23 +100,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
100
100
|
`y-btn--${e.size}`,
|
|
101
101
|
{ "is-block": e.block, "is-loading": e.loading },
|
|
102
102
|
e.groupPosition !== "single" ? "is-grouped" : "",
|
|
103
|
-
|
|
103
|
+
p.value
|
|
104
104
|
]]),
|
|
105
105
|
type: e.htmlType,
|
|
106
106
|
disabled: e.disabled || e.loading,
|
|
107
107
|
"aria-busy": e.loading ? "true" : "false",
|
|
108
108
|
"aria-disabled": e.disabled || e.loading ? "true" : "false",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: w
|
|
110
110
|
}, [
|
|
111
111
|
o("span", ct, [
|
|
112
|
-
|
|
112
|
+
se(C.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
114
|
], 10, ut));
|
|
115
115
|
}
|
|
116
116
|
}), me = (e, $) => {
|
|
117
117
|
const t = e.__vccOpts || e;
|
|
118
|
-
for (const [n,
|
|
119
|
-
t[n] =
|
|
118
|
+
for (const [n, w] of $)
|
|
119
|
+
t[n] = w;
|
|
120
120
|
return t;
|
|
121
121
|
}, Ne = /* @__PURE__ */ me(gt, [["__scopeId", "data-v-40819241"]]), mt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "disabled", "required", "value"], wt = /* @__PURE__ */ ge({
|
|
122
122
|
__name: "yinput",
|
|
@@ -137,19 +137,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
137
137
|
},
|
|
138
138
|
emits: ["update:modelValue"],
|
|
139
139
|
setup(e, { emit: $ }) {
|
|
140
|
-
const t = e, n = $,
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
const t = e, n = $, w = K(null), p = K(""), y = K(!1), L = K(!1), C = K(t.placeholder || "");
|
|
141
|
+
G(() => t.placeholder, (g) => {
|
|
142
|
+
L.value || (C.value = g || "");
|
|
143
143
|
});
|
|
144
144
|
function T(g) {
|
|
145
145
|
const x = g.target;
|
|
146
|
-
|
|
146
|
+
y.value = !0, n("update:modelValue", x.value);
|
|
147
147
|
}
|
|
148
148
|
function k() {
|
|
149
|
-
|
|
149
|
+
L.value = !0, t.clearOnFocus && (p.value = t.modelValue || "", y.value = !1, C.value = p.value || t.placeholder || "", n("update:modelValue", ""));
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
151
|
+
function m() {
|
|
152
|
+
L.value = !1, t.clearOnFocus && !y.value && (!t.modelValue || t.modelValue === "") && n("update:modelValue", p.value), C.value = t.placeholder || "";
|
|
153
153
|
}
|
|
154
154
|
return (g, x) => (i(), u("div", {
|
|
155
155
|
class: E(["y-input-wrap", { "is-block": e.block }]),
|
|
@@ -157,7 +157,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
157
157
|
}, [
|
|
158
158
|
o("input", {
|
|
159
159
|
ref_key: "inputRef",
|
|
160
|
-
ref:
|
|
160
|
+
ref: w,
|
|
161
161
|
class: E(["y-input", `y-input--${e.size}`]),
|
|
162
162
|
id: e.id,
|
|
163
163
|
name: e.name,
|
|
@@ -170,7 +170,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
170
170
|
value: e.modelValue,
|
|
171
171
|
onInput: T,
|
|
172
172
|
onFocus: k,
|
|
173
|
-
onBlur:
|
|
173
|
+
onBlur: m
|
|
174
174
|
}, null, 42, mt)
|
|
175
175
|
], 6));
|
|
176
176
|
}
|
|
@@ -234,20 +234,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
234
234
|
},
|
|
235
235
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
236
236
|
setup(e, { emit: $ }) {
|
|
237
|
-
const t = e, n = $,
|
|
238
|
-
() => t.columns.filter((l) => !
|
|
237
|
+
const t = e, n = $, w = K(t.currentPage || 1), p = K(t.pageSize), y = K([]), L = K(/* @__PURE__ */ new Set()), C = K("none"), T = K(), k = K(), m = K(), g = K(), x = K([]), N = K({}), X = O(
|
|
238
|
+
() => t.columns.filter((l) => !j(l.width)).map((l) => l.key)
|
|
239
239
|
);
|
|
240
|
-
function
|
|
241
|
-
return `${(100 / (
|
|
240
|
+
function Y() {
|
|
241
|
+
return `${(100 / (X.value.length || 1)).toFixed(6)}%`;
|
|
242
242
|
}
|
|
243
|
-
const
|
|
243
|
+
const V = K(), I = K({
|
|
244
244
|
show: !1,
|
|
245
245
|
thumbHeight: 40,
|
|
246
246
|
thumbTop: 0
|
|
247
247
|
});
|
|
248
|
-
let
|
|
249
|
-
const
|
|
250
|
-
function
|
|
248
|
+
let z = !1, R = 0, B = 0;
|
|
249
|
+
const Q = K(0);
|
|
250
|
+
function j(l) {
|
|
251
251
|
if (l == null) return;
|
|
252
252
|
if (typeof l == "number")
|
|
253
253
|
return Number.isFinite(l) ? `${l}px` : void 0;
|
|
@@ -255,217 +255,217 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
255
255
|
if (c)
|
|
256
256
|
return /^\d+(\.\d+)?$/.test(c) ? `${c}px` : c;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
const c =
|
|
258
|
+
function te(l) {
|
|
259
|
+
const c = j(l);
|
|
260
260
|
if (!c) return null;
|
|
261
|
-
const
|
|
262
|
-
return Number.isFinite(
|
|
261
|
+
const D = parseFloat(c);
|
|
262
|
+
return Number.isFinite(D) ? D : null;
|
|
263
263
|
}
|
|
264
264
|
const ue = O(() => {
|
|
265
265
|
let l = t.columns.length;
|
|
266
266
|
return t.selectable && (l += 1), t.expandable && (l += 1), l;
|
|
267
|
-
}),
|
|
267
|
+
}), ne = O(() => {
|
|
268
268
|
if (!t.searchKeyword || !t.searchFields.length)
|
|
269
269
|
return t.data;
|
|
270
270
|
const l = t.searchKeyword.toLowerCase();
|
|
271
|
-
return t.data.filter((c) => t.searchFields.some((
|
|
272
|
-
const
|
|
273
|
-
return String(
|
|
271
|
+
return t.data.filter((c) => t.searchFields.some((D) => {
|
|
272
|
+
const S = r(c, D);
|
|
273
|
+
return String(S).toLowerCase().includes(l);
|
|
274
274
|
}));
|
|
275
|
-
}), ve = O(() => (t.pagination,
|
|
275
|
+
}), ve = O(() => (t.pagination, ne.value)), pe = O(() => {
|
|
276
276
|
if (!t.selectable) return !1;
|
|
277
|
-
const l = ve.value.map((c,
|
|
278
|
-
return l.length > 0 && l.every((c) =>
|
|
277
|
+
const l = ve.value.map((c, D) => d(c, D));
|
|
278
|
+
return l.length > 0 && l.every((c) => y.value.includes(c));
|
|
279
279
|
}), ye = O(() => {
|
|
280
280
|
const l = [];
|
|
281
281
|
let c = t.selectable ? 40 : 0;
|
|
282
|
-
for (let
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
let
|
|
286
|
-
const H =
|
|
287
|
-
H !== null ?
|
|
282
|
+
for (let D = 0; D < t.columns.length; D++) {
|
|
283
|
+
const S = t.columns[D];
|
|
284
|
+
if (S.fixed === "left") {
|
|
285
|
+
let _ = 80;
|
|
286
|
+
const H = te(S.width);
|
|
287
|
+
H !== null ? _ = H : x.value[D] && (_ = te(x.value[D]) ?? _), l.push(c), c += _;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
return l;
|
|
291
|
-
}),
|
|
291
|
+
}), F = O(() => {
|
|
292
292
|
const l = [];
|
|
293
293
|
let c = 0;
|
|
294
|
-
const
|
|
295
|
-
for (let
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
294
|
+
const D = [];
|
|
295
|
+
for (let S = t.columns.length - 1; S >= 0; S--) {
|
|
296
|
+
const _ = t.columns[S];
|
|
297
|
+
if (_.fixed === "right") {
|
|
298
298
|
let H = 80;
|
|
299
|
-
const
|
|
300
|
-
|
|
299
|
+
const q = te(_.width);
|
|
300
|
+
q !== null ? H = q : x.value[S] && (H = te(x.value[S]) ?? H), D.push({ index: S, width: H });
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
for (let
|
|
304
|
-
l.push(c), c +=
|
|
303
|
+
for (let S = 0; S < D.length; S++)
|
|
304
|
+
l.push(c), c += D[S].width;
|
|
305
305
|
return l;
|
|
306
306
|
});
|
|
307
307
|
function Z(l, c) {
|
|
308
308
|
if (c === "left") {
|
|
309
|
-
let
|
|
310
|
-
for (let
|
|
311
|
-
t.columns[
|
|
312
|
-
return
|
|
309
|
+
let D = 0;
|
|
310
|
+
for (let S = 0; S < l; S++)
|
|
311
|
+
t.columns[S].fixed === "left" && D++;
|
|
312
|
+
return D;
|
|
313
313
|
} else {
|
|
314
|
-
let
|
|
315
|
-
for (let
|
|
316
|
-
t.columns[
|
|
317
|
-
return
|
|
314
|
+
let D = 0;
|
|
315
|
+
for (let S = t.columns.length - 1; S > l; S--)
|
|
316
|
+
t.columns[S].fixed === "right" && D++;
|
|
317
|
+
return D;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
function d(l, c) {
|
|
321
321
|
return typeof t.rowKey == "function" ? t.rowKey(l) : l[t.rowKey] || c;
|
|
322
322
|
}
|
|
323
323
|
function h(l) {
|
|
324
|
-
return
|
|
324
|
+
return L.value.has(l);
|
|
325
325
|
}
|
|
326
326
|
function a(l) {
|
|
327
|
-
|
|
327
|
+
L.value.has(l) ? L.value.delete(l) : L.value.add(l);
|
|
328
328
|
}
|
|
329
329
|
function r(l, c) {
|
|
330
|
-
return c.split(".").reduce((
|
|
330
|
+
return c.split(".").reduce((D, S) => D == null ? void 0 : D[S], l);
|
|
331
331
|
}
|
|
332
332
|
function f(l, c = !1) {
|
|
333
|
-
const
|
|
334
|
-
return l.align &&
|
|
333
|
+
const D = [];
|
|
334
|
+
return l.align && D.push(`text-${l.align}`), l.fixed === "right" && (D.push("col-fixed-right"), c && D.push("col-fixed-right-header")), l.fixed === "left" && (D.push("col-fixed-left"), c && D.push("col-fixed-left-header")), D.join(" ");
|
|
335
335
|
}
|
|
336
|
-
function b(l, c,
|
|
337
|
-
const
|
|
338
|
-
if (
|
|
339
|
-
|
|
336
|
+
function b(l, c, D) {
|
|
337
|
+
const S = {}, _ = j(l.width);
|
|
338
|
+
if (_)
|
|
339
|
+
S.width = _, S.minWidth = _, S.maxWidth = _;
|
|
340
340
|
else {
|
|
341
|
-
const H =
|
|
342
|
-
|
|
341
|
+
const H = Y();
|
|
342
|
+
S.width = H, S.minWidth = H, S.maxWidth = H;
|
|
343
343
|
}
|
|
344
344
|
if (l.fixed === "left") {
|
|
345
|
-
const H = Z(c, "left"),
|
|
346
|
-
|
|
345
|
+
const H = Z(c, "left"), q = ye.value[H] || 0;
|
|
346
|
+
S.left = `${q}px`, S.zIndex = D ? `${10 + H}` : `${5 + H}`;
|
|
347
347
|
} else if (l.fixed === "right") {
|
|
348
|
-
const H = Z(c, "right"),
|
|
349
|
-
|
|
348
|
+
const H = Z(c, "right"), q = F.value[H] || 0;
|
|
349
|
+
D ? S.right = `${q - 3}px` : S.right = `${q}px`, S.zIndex = D ? `${10 + H}` : `${5 + H}`;
|
|
350
350
|
}
|
|
351
|
-
return
|
|
351
|
+
return S;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const
|
|
355
|
-
return c.formatter ? c.formatter(
|
|
353
|
+
function M(l, c) {
|
|
354
|
+
const D = r(l, c.key);
|
|
355
|
+
return c.formatter ? c.formatter(D, l) : D || "";
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
|
|
357
|
+
function U(l) {
|
|
358
|
+
y.value.includes(l) ? y.value = y.value.filter((c) => c !== l) : y.value = [...y.value, l], n("select", y.value), n("update:selectedItems", y.value);
|
|
359
359
|
}
|
|
360
360
|
function A() {
|
|
361
|
-
const l = ve.value.map((c,
|
|
362
|
-
if (l.every((c) =>
|
|
363
|
-
|
|
361
|
+
const l = ve.value.map((c, D) => d(c, D));
|
|
362
|
+
if (l.every((c) => y.value.includes(c)))
|
|
363
|
+
y.value = y.value.filter((c) => !l.includes(c));
|
|
364
364
|
else {
|
|
365
|
-
const c = /* @__PURE__ */ new Set([...
|
|
366
|
-
|
|
365
|
+
const c = /* @__PURE__ */ new Set([...y.value, ...l]);
|
|
366
|
+
y.value = Array.from(c);
|
|
367
367
|
}
|
|
368
|
-
n("select",
|
|
368
|
+
n("select", y.value), n("update:selectedItems", y.value);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
|
|
370
|
+
function P() {
|
|
371
|
+
y.value = [], n("select", y.value), n("update:selectedItems", y.value);
|
|
372
372
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}),
|
|
376
|
-
t.total || (
|
|
373
|
+
G(() => t.searchKeyword, () => {
|
|
374
|
+
w.value = 1;
|
|
375
|
+
}), G(() => t.data, () => {
|
|
376
|
+
t.total || (w.value = 1);
|
|
377
377
|
}, { deep: !0 });
|
|
378
378
|
function we(l) {
|
|
379
|
-
|
|
379
|
+
w.value = l, n("page-change", l);
|
|
380
380
|
}
|
|
381
381
|
function De(l) {
|
|
382
|
-
|
|
382
|
+
p.value = l, w.value = 1, n("page-size-change", l);
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
G(() => t.currentPage, (l) => {
|
|
385
385
|
const c = typeof l == "number" && l > 0 ? l : 1;
|
|
386
|
-
|
|
387
|
-
}),
|
|
386
|
+
w.value !== c && (w.value = c);
|
|
387
|
+
}), G(() => t.pageSize, (l) => {
|
|
388
388
|
const c = typeof l == "number" && l > 0 ? l : 10;
|
|
389
|
-
|
|
389
|
+
p.value !== c && (p.value = c);
|
|
390
390
|
});
|
|
391
391
|
function be() {
|
|
392
|
-
T.value &&
|
|
393
|
-
const l = T.value.getBoundingClientRect(), c = window.innerHeight,
|
|
394
|
-
Ze && (Ze.offsetHeight >
|
|
392
|
+
T.value && oe(() => {
|
|
393
|
+
const l = T.value.getBoundingClientRect(), c = window.innerHeight, D = l.top, S = T.value.querySelector(".table-header"), _ = S ? S.offsetHeight : 40, H = T.value.querySelector(".ypagination"), q = H ? H.offsetHeight : 60, de = T.value.querySelector(".bulk-bar"), he = de ? de.offsetHeight : 0, ze = _ + q + he + 20, le = c - D - ze, nt = Math.max(200, le), Ze = T.value.querySelector(".table-body-wrap .table");
|
|
394
|
+
Ze && (Ze.offsetHeight > le ? C.value = `${nt}px` : C.value = "none");
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
397
|
let Le = !1;
|
|
398
398
|
function Ie() {
|
|
399
|
-
!k.value || !
|
|
399
|
+
!k.value || !m.value || Le || k.value.scrollLeft !== m.value.scrollLeft && (Le = !0, k.value.scrollLeft = m.value.scrollLeft, requestAnimationFrame(() => {
|
|
400
400
|
Le = !1;
|
|
401
401
|
}));
|
|
402
402
|
}
|
|
403
403
|
function Ye() {
|
|
404
|
-
!k.value || !
|
|
404
|
+
!k.value || !m.value || Le || m.value.scrollLeft !== k.value.scrollLeft && (Le = !0, m.value.scrollLeft = k.value.scrollLeft, requestAnimationFrame(() => {
|
|
405
405
|
Le = !1;
|
|
406
406
|
}));
|
|
407
407
|
}
|
|
408
408
|
function We() {
|
|
409
|
-
|
|
410
|
-
if (!
|
|
411
|
-
const l =
|
|
412
|
-
if (
|
|
413
|
-
const H = 24,
|
|
414
|
-
|
|
415
|
-
const ze = Math.max(0, de - he),
|
|
416
|
-
|
|
409
|
+
oe(() => {
|
|
410
|
+
if (!m.value) return;
|
|
411
|
+
const l = m.value, c = l.scrollHeight, D = l.clientHeight, S = l.scrollTop, _ = c > D + 1;
|
|
412
|
+
if (I.value.show = _, !_) return;
|
|
413
|
+
const H = 24, q = D / c, de = V.value ? V.value.clientHeight : D, he = Math.max(H, Math.floor(de * q));
|
|
414
|
+
I.value.thumbHeight = he;
|
|
415
|
+
const ze = Math.max(0, de - he), le = Math.max(1, c - D);
|
|
416
|
+
I.value.thumbTop = Math.min(ze, Math.floor(S / le * ze));
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
function Re(l) {
|
|
420
|
-
if (!
|
|
420
|
+
if (!z || !m.value || !V.value) return;
|
|
421
421
|
l.preventDefault();
|
|
422
|
-
const c =
|
|
423
|
-
|
|
422
|
+
const c = V.value.clientHeight, D = Math.max(0, c - I.value.thumbHeight), S = m.value, _ = S.scrollHeight, H = S.clientHeight, q = Math.max(1, _ - H), he = (l.clientY - R) / Math.max(1, D) * q;
|
|
423
|
+
S.scrollTop = Math.min(q, Math.max(0, B + he)), We();
|
|
424
424
|
}
|
|
425
425
|
function Pe() {
|
|
426
|
-
|
|
426
|
+
z = !1, window.removeEventListener("mousemove", Re), window.removeEventListener("mouseup", Pe);
|
|
427
427
|
}
|
|
428
428
|
function Ae() {
|
|
429
|
-
|
|
430
|
-
var
|
|
431
|
-
if (x.value.length === t.columns.length && x.value.every((
|
|
429
|
+
oe(() => {
|
|
430
|
+
var D, S;
|
|
431
|
+
if (x.value.length === t.columns.length && x.value.every((_) => !!_))
|
|
432
432
|
return;
|
|
433
433
|
const l = [];
|
|
434
|
-
t.columns.forEach((
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
437
|
-
l.push(
|
|
438
|
-
else if (
|
|
439
|
-
l.push(
|
|
434
|
+
t.columns.forEach((_, H) => {
|
|
435
|
+
const q = j(_.width);
|
|
436
|
+
if (q)
|
|
437
|
+
l.push(q), N.value[_.key] = q;
|
|
438
|
+
else if (N.value[_.key])
|
|
439
|
+
l.push(N.value[_.key]);
|
|
440
440
|
else {
|
|
441
441
|
const de = x.value[H];
|
|
442
442
|
if (de)
|
|
443
|
-
l.push(de),
|
|
443
|
+
l.push(de), N.value[_.key] = de;
|
|
444
444
|
else {
|
|
445
|
-
const he =
|
|
446
|
-
l.push(he),
|
|
445
|
+
const he = Y();
|
|
446
|
+
l.push(he), N.value[_.key] = he;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
|
-
const c = (
|
|
450
|
+
const c = (D = g.value) == null ? void 0 : D.querySelector("tbody tr");
|
|
451
451
|
if (c) {
|
|
452
|
-
const
|
|
453
|
-
for (let
|
|
454
|
-
if (!l[
|
|
455
|
-
const de = H[
|
|
452
|
+
const _ = t.selectable ? 1 : 0, H = Array.from(c.children);
|
|
453
|
+
for (let q = 0; q < t.columns.length; q++)
|
|
454
|
+
if (!l[q]) {
|
|
455
|
+
const de = H[_ + q];
|
|
456
456
|
if (de && de.clientWidth > 0) {
|
|
457
457
|
const he = `${de.clientWidth}px`;
|
|
458
|
-
l[
|
|
458
|
+
l[q] = he, N.value[t.columns[q].key] = he;
|
|
459
459
|
} else {
|
|
460
|
-
const he =
|
|
461
|
-
l[
|
|
460
|
+
const he = Y();
|
|
461
|
+
l[q] = he, N.value[t.columns[q].key] = he;
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
} else
|
|
465
|
-
for (let
|
|
466
|
-
if (!l[
|
|
467
|
-
const H =
|
|
468
|
-
l[
|
|
465
|
+
for (let _ = 0; _ < l.length; _++)
|
|
466
|
+
if (!l[_]) {
|
|
467
|
+
const H = N.value[((S = t.columns[_]) == null ? void 0 : S.key) || ""];
|
|
468
|
+
l[_] = H || x.value[_] || "80px", t.columns[_] && (N.value[t.columns[_].key] = l[_]);
|
|
469
469
|
}
|
|
470
470
|
x.value = l;
|
|
471
471
|
});
|
|
@@ -473,82 +473,82 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
473
473
|
function He() {
|
|
474
474
|
be(), s();
|
|
475
475
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
be(), Ie(), s(),
|
|
476
|
+
G(() => t.data, () => {
|
|
477
|
+
oe(() => {
|
|
478
|
+
be(), Ie(), s(), L.value.clear();
|
|
479
479
|
});
|
|
480
|
-
}, { deep: !0 }),
|
|
481
|
-
|
|
480
|
+
}, { deep: !0 }), G([w, p], () => {
|
|
481
|
+
oe(() => {
|
|
482
482
|
be(), Ie(), s();
|
|
483
483
|
});
|
|
484
|
-
}),
|
|
485
|
-
const l = [], c = { ...
|
|
486
|
-
t.columns.forEach((
|
|
487
|
-
const H =
|
|
488
|
-
H ? (l.push(H), c[
|
|
484
|
+
}), G(() => t.columns, () => {
|
|
485
|
+
const l = [], c = { ...N.value };
|
|
486
|
+
t.columns.forEach((S, _) => {
|
|
487
|
+
const H = j(S.width);
|
|
488
|
+
H ? (l.push(H), c[S.key] = H) : c[S.key] ? l.push(c[S.key]) : x.value[_] ? (l.push(x.value[_]), c[S.key] = x.value[_]) : l.push("");
|
|
489
489
|
});
|
|
490
|
-
const
|
|
491
|
-
Object.keys(c).forEach((
|
|
492
|
-
|
|
493
|
-
}),
|
|
490
|
+
const D = new Set(t.columns.map((S) => S.key));
|
|
491
|
+
Object.keys(c).forEach((S) => {
|
|
492
|
+
D.has(S) || delete c[S];
|
|
493
|
+
}), N.value = c, x.value = l, oe(() => {
|
|
494
494
|
Ae(), Ie(), s();
|
|
495
495
|
});
|
|
496
|
-
}, { deep: !0 }),
|
|
497
|
-
|
|
496
|
+
}, { deep: !0 }), G(() => y.value, () => {
|
|
497
|
+
oe(() => {
|
|
498
498
|
be(), s();
|
|
499
499
|
});
|
|
500
|
-
}, { deep: !0 }),
|
|
501
|
-
|
|
500
|
+
}, { deep: !0 }), G(() => t.loading, () => {
|
|
501
|
+
oe(() => {
|
|
502
502
|
s();
|
|
503
503
|
});
|
|
504
504
|
}), Ce(() => {
|
|
505
505
|
var l, c;
|
|
506
|
-
|
|
506
|
+
oe(() => {
|
|
507
507
|
be(), Ae(), s(), We();
|
|
508
|
-
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (l =
|
|
508
|
+
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (l = m.value) == null || l.addEventListener("scroll", () => {
|
|
509
509
|
Ie(), We(), s();
|
|
510
510
|
}, { passive: !0 }), (c = k.value) == null || c.addEventListener("scroll", () => {
|
|
511
511
|
Ye();
|
|
512
|
-
}, { passive: !0 }),
|
|
512
|
+
}, { passive: !0 }), oe(() => Ie()), m.value && typeof ResizeObserver < "u" && (v = new ResizeObserver(() => {
|
|
513
513
|
s();
|
|
514
|
-
}), v.observe(
|
|
514
|
+
}), v.observe(m.value));
|
|
515
515
|
}), Ee(() => {
|
|
516
516
|
var l, c;
|
|
517
|
-
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l =
|
|
517
|
+
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l = m.value) == null || l.removeEventListener("scroll", Ie), (c = k.value) == null || c.removeEventListener("scroll", Ye), window.removeEventListener("mousemove", Re), window.removeEventListener("mouseup", Pe), v && (v.disconnect(), v = null);
|
|
518
518
|
});
|
|
519
519
|
let Te = -1;
|
|
520
520
|
function s() {
|
|
521
|
-
!k.value || !
|
|
522
|
-
if (!k.value || !
|
|
523
|
-
const l =
|
|
524
|
-
if (
|
|
521
|
+
!k.value || !m.value || requestAnimationFrame(() => {
|
|
522
|
+
if (!k.value || !m.value) return;
|
|
523
|
+
const l = m.value, c = Math.ceil(l.offsetWidth - l.clientWidth);
|
|
524
|
+
if (Q.value = c, c !== Te) {
|
|
525
525
|
Te = c;
|
|
526
|
-
const
|
|
527
|
-
|
|
526
|
+
const D = k.value.querySelector(".table"), S = g.value;
|
|
527
|
+
D && S && (k.value.style.paddingRight = "0px", D.style.width = "", D.style.marginRight = "", c > 0 ? (k.value.style.paddingRight = `${c}px`, D.style.width = "100%", D.style.marginRight = `-${c}px`) : (k.value.style.paddingRight = "0px", D.style.width = "100%", D.style.marginRight = "0px"));
|
|
528
528
|
}
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
531
|
let v = null;
|
|
532
532
|
return (l, c) => {
|
|
533
|
-
const
|
|
533
|
+
const D = Ve("YButton"), S = Ve("YPagination");
|
|
534
534
|
return i(), u("div", {
|
|
535
535
|
class: "ytable-container",
|
|
536
536
|
ref_key: "tableContainer",
|
|
537
537
|
ref: T
|
|
538
538
|
}, [
|
|
539
|
-
|
|
539
|
+
ie(xe, { name: "bulk-slide" }, {
|
|
540
540
|
default: re(() => [
|
|
541
|
-
|
|
542
|
-
o("div", kt, "已选择 " +
|
|
541
|
+
y.value.length && e.showBulkActions ? (i(), u("div", bt, [
|
|
542
|
+
o("div", kt, "已选择 " + ee(y.value.length) + " 项", 1),
|
|
543
543
|
o("div", xt, [
|
|
544
|
-
|
|
545
|
-
selectedItems:
|
|
546
|
-
clearSelection:
|
|
544
|
+
se(l.$slots, "bulk-actions", {
|
|
545
|
+
selectedItems: y.value,
|
|
546
|
+
clearSelection: P
|
|
547
547
|
}, () => [
|
|
548
|
-
|
|
548
|
+
ie(D, {
|
|
549
549
|
size: "small",
|
|
550
550
|
class: "btn",
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: P
|
|
552
552
|
}, {
|
|
553
553
|
default: re(() => [...c[2] || (c[2] = [
|
|
554
554
|
$e("清除选择", -1)
|
|
@@ -571,8 +571,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
571
571
|
o("colgroup", null, [
|
|
572
572
|
t.expandable ? (i(), u("col", Dt)) : W("", !0),
|
|
573
573
|
e.selectable ? (i(), u("col", _t)) : W("", !0),
|
|
574
|
-
(i(!0), u(
|
|
575
|
-
key:
|
|
574
|
+
(i(!0), u(ae, null, ce(e.columns, (_, H) => (i(), u("col", {
|
|
575
|
+
key: _.key,
|
|
576
576
|
style: fe({ width: x.value[H] || void 0, minWidth: x.value[H] || "80px" })
|
|
577
577
|
}, null, 4))), 128))
|
|
578
578
|
]),
|
|
@@ -586,11 +586,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
586
586
|
onChange: A
|
|
587
587
|
}, null, 40, Lt)
|
|
588
588
|
])) : W("", !0),
|
|
589
|
-
(i(!0), u(
|
|
590
|
-
key:
|
|
591
|
-
class: E(f(
|
|
592
|
-
style: fe(b(
|
|
593
|
-
},
|
|
589
|
+
(i(!0), u(ae, null, ce(e.columns, (_, H) => (i(), u("th", {
|
|
590
|
+
key: _.key,
|
|
591
|
+
class: E(f(_, !0)),
|
|
592
|
+
style: fe(b(_, H, !0))
|
|
593
|
+
}, ee(_.title), 7))), 128))
|
|
594
594
|
])
|
|
595
595
|
])
|
|
596
596
|
])
|
|
@@ -598,7 +598,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
598
598
|
o("div", {
|
|
599
599
|
class: E(["table-body-wrap", { "is-loading": e.loading, "is-empty": !ve.value.length && !e.loading }]),
|
|
600
600
|
ref_key: "bodyWrapRef",
|
|
601
|
-
ref:
|
|
601
|
+
ref: m,
|
|
602
602
|
style: fe({ maxHeight: C.value })
|
|
603
603
|
}, [
|
|
604
604
|
e.loading ? (i(), u("div", It, [...c[3] || (c[3] = [
|
|
@@ -606,8 +606,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
606
606
|
o("div", { class: "loading-text" }, "加载中...", -1)
|
|
607
607
|
])])) : W("", !0),
|
|
608
608
|
!ve.value.length && !e.loading ? (i(), u("div", Bt, [
|
|
609
|
-
|
|
610
|
-
$e(
|
|
609
|
+
se(l.$slots, "empty", {}, () => [
|
|
610
|
+
$e(ee(e.emptyText), 1)
|
|
611
611
|
], !0)
|
|
612
612
|
])) : W("", !0),
|
|
613
613
|
o("table", {
|
|
@@ -618,59 +618,59 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
618
618
|
o("colgroup", null, [
|
|
619
619
|
t.expandable ? (i(), u("col", Et)) : W("", !0),
|
|
620
620
|
e.selectable ? (i(), u("col", Tt)) : W("", !0),
|
|
621
|
-
(i(!0), u(
|
|
622
|
-
key:
|
|
621
|
+
(i(!0), u(ae, null, ce(e.columns, (_, H) => (i(), u("col", {
|
|
622
|
+
key: _.key,
|
|
623
623
|
style: fe({ width: x.value[H] || void 0, minWidth: x.value[H] || "80px" })
|
|
624
624
|
}, null, 4))), 128))
|
|
625
625
|
]),
|
|
626
626
|
o("tbody", null, [
|
|
627
|
-
(i(!0), u(
|
|
628
|
-
key: d(
|
|
627
|
+
(i(!0), u(ae, null, ce(ve.value, (_, H) => (i(), u(ae, {
|
|
628
|
+
key: d(_, H)
|
|
629
629
|
}, [
|
|
630
630
|
o("tr", null, [
|
|
631
631
|
t.expandable ? (i(), u("td", zt, [
|
|
632
632
|
o("button", {
|
|
633
633
|
class: "expand-btn",
|
|
634
634
|
type: "button",
|
|
635
|
-
onClick: (
|
|
635
|
+
onClick: (q) => a(d(_, H))
|
|
636
636
|
}, [
|
|
637
637
|
o("span", {
|
|
638
|
-
class: E(["expand-icon", { "is-open": h(d(
|
|
638
|
+
class: E(["expand-icon", { "is-open": h(d(_, H)) }])
|
|
639
639
|
}, null, 2)
|
|
640
640
|
], 8, Kt)
|
|
641
641
|
])) : W("", !0),
|
|
642
642
|
e.selectable ? (i(), u("td", Ht, [
|
|
643
643
|
o("input", {
|
|
644
644
|
type: "checkbox",
|
|
645
|
-
value: d(
|
|
646
|
-
checked:
|
|
647
|
-
onChange: (
|
|
645
|
+
value: d(_, H),
|
|
646
|
+
checked: y.value.includes(d(_, H)),
|
|
647
|
+
onChange: (q) => U(d(_, H))
|
|
648
648
|
}, null, 40, Wt)
|
|
649
649
|
])) : W("", !0),
|
|
650
|
-
(i(!0), u(
|
|
651
|
-
key:
|
|
652
|
-
class: E(f(
|
|
653
|
-
style: fe(b(
|
|
650
|
+
(i(!0), u(ae, null, ce(e.columns, (q, de) => (i(), u("td", {
|
|
651
|
+
key: q.key,
|
|
652
|
+
class: E(f(q)),
|
|
653
|
+
style: fe(b(q, de, !1))
|
|
654
654
|
}, [
|
|
655
|
-
|
|
656
|
-
item:
|
|
657
|
-
value: r(
|
|
655
|
+
se(l.$slots, `cell-${q.key}`, {
|
|
656
|
+
item: _,
|
|
657
|
+
value: r(_, q.key),
|
|
658
658
|
index: H
|
|
659
659
|
}, () => [
|
|
660
|
-
$e(
|
|
660
|
+
$e(ee(M(_, q)), 1)
|
|
661
661
|
], !0)
|
|
662
662
|
], 6))), 128))
|
|
663
663
|
]),
|
|
664
|
-
t.expandable && h(d(
|
|
665
|
-
key: `${d(
|
|
664
|
+
t.expandable && h(d(_, H)) ? (i(), u("tr", {
|
|
665
|
+
key: `${d(_, H)}-expand`,
|
|
666
666
|
class: "expand-row"
|
|
667
667
|
}, [
|
|
668
668
|
o("td", {
|
|
669
669
|
colspan: ue.value,
|
|
670
670
|
class: "expand-cell"
|
|
671
671
|
}, [
|
|
672
|
-
|
|
673
|
-
item:
|
|
672
|
+
se(l.$slots, "expand", {
|
|
673
|
+
item: _,
|
|
674
674
|
index: H
|
|
675
675
|
}, void 0, !0)
|
|
676
676
|
], 8, Rt)
|
|
@@ -679,13 +679,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
679
679
|
])
|
|
680
680
|
], 2)
|
|
681
681
|
], 6),
|
|
682
|
-
e.pagination ? (i(), Me(
|
|
682
|
+
e.pagination ? (i(), Me(S, {
|
|
683
683
|
key: 0,
|
|
684
684
|
class: "align-right",
|
|
685
|
-
"current-page":
|
|
686
|
-
"onUpdate:currentPage": c[0] || (c[0] = (
|
|
687
|
-
"page-size":
|
|
688
|
-
"onUpdate:pageSize": c[1] || (c[1] = (
|
|
685
|
+
"current-page": w.value,
|
|
686
|
+
"onUpdate:currentPage": c[0] || (c[0] = (_) => w.value = _),
|
|
687
|
+
"page-size": p.value,
|
|
688
|
+
"onUpdate:pageSize": c[1] || (c[1] = (_) => p.value = _),
|
|
689
689
|
loading: t.loading,
|
|
690
690
|
"page-size-options": e.pageSizeOptions,
|
|
691
691
|
onPageChange: we,
|
|
@@ -714,57 +714,57 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
714
714
|
},
|
|
715
715
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
716
716
|
setup(e, { emit: $ }) {
|
|
717
|
-
const t = e, n = $,
|
|
717
|
+
const t = e, n = $, w = K(!1), p = K(-1), y = K(), L = K(), C = K(), T = K(), k = K(!1), m = K(), g = K(""), x = O(() => t.options.find((a) => I(a) === t.modelValue) || null), N = O(() => x.value ? z(x.value) : ""), X = O(() => {
|
|
718
718
|
if (!t.filterable) return t.options;
|
|
719
719
|
const a = g.value.trim().toLowerCase();
|
|
720
720
|
return a ? t.options.filter((r) => {
|
|
721
|
-
const f =
|
|
721
|
+
const f = z(r);
|
|
722
722
|
return String(f).toLowerCase().includes(a);
|
|
723
723
|
}) : t.options;
|
|
724
|
-
}),
|
|
725
|
-
var
|
|
726
|
-
const a = { position: "fixed", zIndex: "4000" }, r =
|
|
724
|
+
}), Y = O(() => {
|
|
725
|
+
var M;
|
|
726
|
+
const a = { position: "fixed", zIndex: "4000" }, r = L.value;
|
|
727
727
|
if (!r) return a;
|
|
728
|
-
const f = r.getBoundingClientRect(), b = ((
|
|
728
|
+
const f = r.getBoundingClientRect(), b = ((M = C.value) == null ? void 0 : M.getBoundingClientRect().width) || f.width;
|
|
729
729
|
return a.left = `${f.left}px`, a.width = `${b}px`, k.value ? (a.bottom = `${window.innerHeight - f.top + 4}px`, a.top = "auto") : a.top = `${f.bottom + 4}px`, a;
|
|
730
730
|
});
|
|
731
|
-
function
|
|
732
|
-
!
|
|
733
|
-
const a =
|
|
731
|
+
function V() {
|
|
732
|
+
!w.value || !L.value || oe(() => {
|
|
733
|
+
const a = L.value;
|
|
734
734
|
if (!a) return;
|
|
735
|
-
const r = a.getBoundingClientRect(), f = window.innerHeight, b = 200,
|
|
736
|
-
k.value = !A &&
|
|
735
|
+
const r = a.getBoundingClientRect(), f = window.innerHeight, b = 200, M = r.bottom + b + 4, U = r.top - b - 4, A = M <= f - 20, P = U >= 20;
|
|
736
|
+
k.value = !A && P;
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function I(a) {
|
|
740
740
|
return typeof a == "object" && a !== null ? a[t.valueKey] : a;
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function z(a) {
|
|
743
743
|
return typeof a == "object" && a !== null ? a[t.labelKey] || String(a[t.valueKey]) : String(a);
|
|
744
744
|
}
|
|
745
745
|
function R(a, r) {
|
|
746
|
-
return typeof a == "object" && a !== null && a.id !== void 0 ? a.id :
|
|
746
|
+
return typeof a == "object" && a !== null && a.id !== void 0 ? a.id : I(a) || r;
|
|
747
747
|
}
|
|
748
|
-
function
|
|
749
|
-
return
|
|
748
|
+
function B(a) {
|
|
749
|
+
return I(a) === t.modelValue;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function Q(a) {
|
|
752
752
|
return typeof a == "object" && a !== null ? a[t.disabledKey] === !0 : !1;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
755
|
-
t.disabled || (
|
|
754
|
+
function j() {
|
|
755
|
+
t.disabled || (w.value ? ue() : te());
|
|
756
756
|
}
|
|
757
|
-
function
|
|
758
|
-
t.disabled || (
|
|
759
|
-
|
|
757
|
+
function te() {
|
|
758
|
+
t.disabled || (w.value = !0, oe(() => {
|
|
759
|
+
V(), F(), t.filterable && m.value && (m.value.focus(), g.value = "");
|
|
760
760
|
}));
|
|
761
761
|
}
|
|
762
762
|
function ue() {
|
|
763
|
-
|
|
763
|
+
w.value = !1, p.value = -1, k.value = !1, t.filterable && (g.value = "");
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
if (
|
|
767
|
-
const f =
|
|
765
|
+
function ne(a, r) {
|
|
766
|
+
if (Q(a)) return;
|
|
767
|
+
const f = I(a);
|
|
768
768
|
n("update:modelValue", f), n("change", f, a), ue();
|
|
769
769
|
}
|
|
770
770
|
function ve() {
|
|
@@ -773,42 +773,42 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
773
773
|
n("update:modelValue", a), n("change", a, null), n("clear"), ue();
|
|
774
774
|
}
|
|
775
775
|
function pe(a) {
|
|
776
|
-
if (!
|
|
777
|
-
|
|
776
|
+
if (!X.value || X.value.length === 0) {
|
|
777
|
+
p.value = -1;
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
|
-
let r =
|
|
781
|
-
const f =
|
|
780
|
+
let r = p.value;
|
|
781
|
+
const f = X.value.length;
|
|
782
782
|
r === -1 ? r = a > 0 ? 0 : f - 1 : r = (r + a + f) % f;
|
|
783
783
|
let b = 0;
|
|
784
|
-
for (; b < f && X
|
|
784
|
+
for (; b < f && Q(X.value[r]); )
|
|
785
785
|
r = (r + a + f) % f, b++;
|
|
786
|
-
|
|
786
|
+
p.value = b >= f ? -1 : r, Z();
|
|
787
787
|
}
|
|
788
788
|
function ye() {
|
|
789
|
-
if (
|
|
790
|
-
const a =
|
|
791
|
-
!a ||
|
|
789
|
+
if (p.value < 0) return;
|
|
790
|
+
const a = X.value[p.value];
|
|
791
|
+
!a || Q(a) || ne(a, p.value);
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
if (!
|
|
795
|
-
const a =
|
|
793
|
+
function F() {
|
|
794
|
+
if (!y.value) return;
|
|
795
|
+
const a = y.value.querySelector(".yselect__option--selected");
|
|
796
796
|
a && a.scrollIntoView({ block: "nearest" });
|
|
797
797
|
}
|
|
798
798
|
function Z() {
|
|
799
|
-
if (!
|
|
800
|
-
const r =
|
|
799
|
+
if (!y.value || p.value < 0) return;
|
|
800
|
+
const r = y.value.querySelectorAll(".yselect__option")[p.value];
|
|
801
801
|
r && r.scrollIntoView({ block: "nearest" });
|
|
802
802
|
}
|
|
803
803
|
function d(a) {
|
|
804
804
|
const r = a.target;
|
|
805
805
|
(!C.value || !C.value.contains(r)) && ue();
|
|
806
806
|
}
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
G(() => t.modelValue, () => {
|
|
808
|
+
p.value = -1;
|
|
809
809
|
});
|
|
810
810
|
function h() {
|
|
811
|
-
|
|
811
|
+
w.value && V();
|
|
812
812
|
}
|
|
813
813
|
return Ce(() => {
|
|
814
814
|
document.addEventListener("click", d), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
@@ -822,64 +822,64 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
822
822
|
}, [
|
|
823
823
|
o("div", {
|
|
824
824
|
ref_key: "triggerElement",
|
|
825
|
-
ref:
|
|
825
|
+
ref: L,
|
|
826
826
|
class: E(["yselect__trigger", {
|
|
827
|
-
"yselect__trigger--open":
|
|
827
|
+
"yselect__trigger--open": w.value,
|
|
828
828
|
"yselect__trigger--disabled": e.disabled,
|
|
829
829
|
"yselect__trigger--error": e.error
|
|
830
830
|
}]),
|
|
831
|
-
onMousedown:
|
|
831
|
+
onMousedown: J(j, ["prevent", "stop"]),
|
|
832
832
|
onKeydown: [
|
|
833
|
-
ke(
|
|
834
|
-
ke(
|
|
833
|
+
ke(J(j, ["prevent"]), ["enter"]),
|
|
834
|
+
ke(J(j, ["prevent"]), ["space"]),
|
|
835
835
|
ke(ue, ["escape"]),
|
|
836
|
-
ke(
|
|
837
|
-
ke(
|
|
836
|
+
ke(J(te, ["prevent"]), ["arrow-down"]),
|
|
837
|
+
ke(J(te, ["prevent"]), ["arrow-up"])
|
|
838
838
|
],
|
|
839
839
|
tabindex: "0",
|
|
840
840
|
role: "combobox",
|
|
841
|
-
"aria-expanded":
|
|
841
|
+
"aria-expanded": w.value,
|
|
842
842
|
"aria-haspopup": !0
|
|
843
843
|
}, [
|
|
844
|
-
!e.filterable || !
|
|
844
|
+
!e.filterable || !w.value ? (i(), u("span", {
|
|
845
845
|
key: 0,
|
|
846
|
-
class: E(["yselect__value", { yselect__placeholder: !
|
|
846
|
+
class: E(["yselect__value", { yselect__placeholder: !N.value }])
|
|
847
847
|
}, [
|
|
848
|
-
|
|
848
|
+
se(a.$slots, "value", {
|
|
849
849
|
value: x.value,
|
|
850
|
-
label:
|
|
850
|
+
label: N.value
|
|
851
851
|
}, () => {
|
|
852
852
|
var f;
|
|
853
853
|
return [
|
|
854
|
-
x.value ? (i(), u(
|
|
854
|
+
x.value ? (i(), u(ae, { key: 0 }, [
|
|
855
855
|
(f = x.value) != null && f.flagImg ? (i(), u("img", {
|
|
856
856
|
key: 0,
|
|
857
857
|
class: "yselect__flag",
|
|
858
858
|
src: x.value.flagImg,
|
|
859
859
|
alt: "flag"
|
|
860
860
|
}, null, 8, Yt)) : W("", !0),
|
|
861
|
-
$e(" " +
|
|
862
|
-
], 64)) : (i(), u(
|
|
863
|
-
$e(
|
|
861
|
+
$e(" " + ee(N.value), 1)
|
|
862
|
+
], 64)) : (i(), u(ae, { key: 1 }, [
|
|
863
|
+
$e(ee(e.placeholder), 1)
|
|
864
864
|
], 64))
|
|
865
865
|
];
|
|
866
866
|
}, !0)
|
|
867
867
|
], 2)) : Be((i(), u("input", {
|
|
868
868
|
key: 1,
|
|
869
869
|
ref_key: "inputElement",
|
|
870
|
-
ref:
|
|
870
|
+
ref: m,
|
|
871
871
|
class: "yselect__input",
|
|
872
872
|
type: "text",
|
|
873
|
-
placeholder:
|
|
873
|
+
placeholder: N.value || e.placeholder,
|
|
874
874
|
"onUpdate:modelValue": r[0] || (r[0] = (f) => g.value = f),
|
|
875
875
|
onKeydown: [
|
|
876
|
-
r[1] || (r[1] =
|
|
876
|
+
r[1] || (r[1] = J(() => {
|
|
877
877
|
}, ["stop"])),
|
|
878
|
-
r[2] || (r[2] = ke(
|
|
879
|
-
r[3] || (r[3] = ke(
|
|
880
|
-
r[4] || (r[4] = ke(
|
|
881
|
-
ke(
|
|
882
|
-
ke(
|
|
878
|
+
r[2] || (r[2] = ke(J((f) => pe(1), ["prevent"]), ["arrow-down"])),
|
|
879
|
+
r[3] || (r[3] = ke(J((f) => pe(-1), ["prevent"]), ["arrow-up"])),
|
|
880
|
+
r[4] || (r[4] = ke(J((f) => ye(), ["prevent"]), ["enter"])),
|
|
881
|
+
ke(J(ue, ["prevent"]), ["esc"]),
|
|
882
|
+
ke(J(ve, ["prevent"]), ["delete"])
|
|
883
883
|
]
|
|
884
884
|
}, null, 40, Pt)), [
|
|
885
885
|
[lt, g.value]
|
|
@@ -888,7 +888,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
888
888
|
key: 2,
|
|
889
889
|
class: "yselect__clear",
|
|
890
890
|
title: "清空",
|
|
891
|
-
onClick:
|
|
891
|
+
onClick: J(ve, ["stop"])
|
|
892
892
|
}, [...r[8] || (r[8] = [
|
|
893
893
|
o("svg", {
|
|
894
894
|
width: "12",
|
|
@@ -905,7 +905,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
905
905
|
], -1)
|
|
906
906
|
])])) : W("", !0),
|
|
907
907
|
o("span", {
|
|
908
|
-
class: E(["yselect__arrow", { "yselect__arrow--open":
|
|
908
|
+
class: E(["yselect__arrow", { "yselect__arrow--open": w.value }])
|
|
909
909
|
}, [...r[9] || (r[9] = [
|
|
910
910
|
o("svg", {
|
|
911
911
|
width: "12",
|
|
@@ -923,40 +923,40 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
923
923
|
], -1)
|
|
924
924
|
])], 2)
|
|
925
925
|
], 42, Ft),
|
|
926
|
-
|
|
926
|
+
ie(xe, { name: "yselect-dropdown" }, {
|
|
927
927
|
default: re(() => [
|
|
928
928
|
(i(), Me(Fe, { to: "body" }, [
|
|
929
|
-
|
|
929
|
+
w.value ? (i(), u("div", {
|
|
930
930
|
key: 0,
|
|
931
931
|
ref_key: "dropdownEl",
|
|
932
932
|
ref: T,
|
|
933
933
|
class: E(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": k.value }]),
|
|
934
|
-
style: fe(
|
|
935
|
-
onMousedown: r[6] || (r[6] =
|
|
934
|
+
style: fe(Y.value),
|
|
935
|
+
onMousedown: r[6] || (r[6] = J(() => {
|
|
936
936
|
}, ["stop"])),
|
|
937
|
-
onClick: r[7] || (r[7] =
|
|
937
|
+
onClick: r[7] || (r[7] = J(() => {
|
|
938
938
|
}, ["stop"]))
|
|
939
939
|
}, [
|
|
940
940
|
o("div", {
|
|
941
941
|
class: "yselect__options",
|
|
942
942
|
ref_key: "optionsContainer",
|
|
943
|
-
ref:
|
|
943
|
+
ref: y
|
|
944
944
|
}, [
|
|
945
|
-
(i(!0), u(
|
|
945
|
+
(i(!0), u(ae, null, ce(X.value, (f, b) => (i(), u("div", {
|
|
946
946
|
key: R(f, b),
|
|
947
947
|
class: E(["yselect__option", {
|
|
948
|
-
"yselect__option--selected":
|
|
949
|
-
"yselect__option--disabled":
|
|
950
|
-
"yselect__option--hover":
|
|
948
|
+
"yselect__option--selected": B(f),
|
|
949
|
+
"yselect__option--disabled": Q(f),
|
|
950
|
+
"yselect__option--hover": p.value === b
|
|
951
951
|
}]),
|
|
952
|
-
onClick: (
|
|
953
|
-
onMouseenter: (
|
|
954
|
-
onMouseleave: r[5] || (r[5] = (
|
|
952
|
+
onClick: (M) => ne(f),
|
|
953
|
+
onMouseenter: (M) => p.value = b,
|
|
954
|
+
onMouseleave: r[5] || (r[5] = (M) => p.value = -1)
|
|
955
955
|
}, [
|
|
956
|
-
|
|
956
|
+
se(a.$slots, "option", {
|
|
957
957
|
option: f,
|
|
958
958
|
index: b,
|
|
959
|
-
selected:
|
|
959
|
+
selected: B(f)
|
|
960
960
|
}, () => [
|
|
961
961
|
f != null && f.flagImg ? (i(), u("img", {
|
|
962
962
|
key: 0,
|
|
@@ -964,7 +964,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
964
964
|
src: f.flagImg,
|
|
965
965
|
alt: "flag"
|
|
966
966
|
}, null, 8, Ot)) : W("", !0),
|
|
967
|
-
$e(" " +
|
|
967
|
+
$e(" " + ee(z(f)), 1)
|
|
968
968
|
], !0)
|
|
969
969
|
], 42, Nt))), 128))
|
|
970
970
|
], 512)
|
|
@@ -990,56 +990,56 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
990
990
|
},
|
|
991
991
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
992
992
|
setup(e, { emit: $ }) {
|
|
993
|
-
const t = e, n = $,
|
|
993
|
+
const t = e, n = $, w = K(t.pageSize), p = O(() => t.pageSizeOptions), y = O({
|
|
994
994
|
get: () => t.currentPage,
|
|
995
995
|
set: (k) => {
|
|
996
996
|
n("update:currentPage", k), n("page-change", k);
|
|
997
997
|
}
|
|
998
998
|
});
|
|
999
|
-
function
|
|
1000
|
-
t.loading || k >= 1 && k !== t.currentPage && (
|
|
999
|
+
function L(k) {
|
|
1000
|
+
t.loading || k >= 1 && k !== t.currentPage && (y.value = k);
|
|
1001
1001
|
}
|
|
1002
1002
|
function C(k) {
|
|
1003
|
-
t.loading || (
|
|
1003
|
+
t.loading || (w.value = k, n("update:pageSize", k), n("page-size-change", k), y.value = 1);
|
|
1004
1004
|
}
|
|
1005
1005
|
function T(k) {
|
|
1006
|
-
t.loading || (k === "prev" ?
|
|
1006
|
+
t.loading || (k === "prev" ? L(y.value - 1) : k === "next" && L(y.value + 1));
|
|
1007
1007
|
}
|
|
1008
|
-
return
|
|
1008
|
+
return w.value = t.pageSize, G(
|
|
1009
1009
|
() => t.pageSize,
|
|
1010
1010
|
(k) => {
|
|
1011
|
-
typeof k == "number" &&
|
|
1011
|
+
typeof k == "number" && w.value !== k && (w.value = k);
|
|
1012
1012
|
}
|
|
1013
|
-
), (k,
|
|
1013
|
+
), (k, m) => {
|
|
1014
1014
|
const g = Ve("YButton"), x = Ve("YSelect");
|
|
1015
1015
|
return i(), u("div", qt, [
|
|
1016
1016
|
o("div", Ut, [
|
|
1017
|
-
|
|
1017
|
+
ie(g, {
|
|
1018
1018
|
size: "small",
|
|
1019
1019
|
variant: "secondary",
|
|
1020
|
-
disabled:
|
|
1021
|
-
onClick:
|
|
1020
|
+
disabled: y.value === 1 || e.loading,
|
|
1021
|
+
onClick: m[0] || (m[0] = (N) => L(1))
|
|
1022
1022
|
}, {
|
|
1023
|
-
default: re(() => [...
|
|
1023
|
+
default: re(() => [...m[2] || (m[2] = [
|
|
1024
1024
|
$e("首页", -1)
|
|
1025
1025
|
])]),
|
|
1026
1026
|
_: 1
|
|
1027
1027
|
}, 8, ["disabled"]),
|
|
1028
|
-
|
|
1028
|
+
ie(g, {
|
|
1029
1029
|
class: "ml-1",
|
|
1030
1030
|
variant: "secondary",
|
|
1031
1031
|
size: "small",
|
|
1032
1032
|
groupItems: [
|
|
1033
|
-
{ label: "上一页", value: "prev", disabled:
|
|
1033
|
+
{ label: "上一页", value: "prev", disabled: y.value === 1 || e.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1034
1034
|
{ label: "下一页", value: "next", disabled: e.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1035
1035
|
],
|
|
1036
1036
|
onGroupClick: T
|
|
1037
1037
|
}, null, 8, ["groupItems"]),
|
|
1038
1038
|
o("div", Zt, [
|
|
1039
|
-
|
|
1040
|
-
modelValue:
|
|
1041
|
-
"onUpdate:modelValue":
|
|
1042
|
-
options:
|
|
1039
|
+
ie(x, {
|
|
1040
|
+
modelValue: w.value,
|
|
1041
|
+
"onUpdate:modelValue": m[1] || (m[1] = (N) => w.value = N),
|
|
1042
|
+
options: p.value,
|
|
1043
1043
|
size: "small",
|
|
1044
1044
|
width: "105px",
|
|
1045
1045
|
clearable: !1,
|
|
@@ -1107,17 +1107,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1107
1107
|
},
|
|
1108
1108
|
setup(e) {
|
|
1109
1109
|
const $ = e, t = O(() => $.tone || "default"), n = O(() => {
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
const
|
|
1110
|
+
const w = ($.label || "").trim(), p = $.tone, y = $.progress;
|
|
1111
|
+
if (y) {
|
|
1112
|
+
const L = {
|
|
1113
1113
|
incomplete: "未完成",
|
|
1114
1114
|
partiallyComplete: "部分完成",
|
|
1115
1115
|
complete: "已完成"
|
|
1116
1116
|
};
|
|
1117
|
-
return
|
|
1117
|
+
return w ? `${w},进度:${L[y] || y}` : `进度:${L[y] || y}`;
|
|
1118
1118
|
}
|
|
1119
|
-
if (
|
|
1120
|
-
const
|
|
1119
|
+
if (p && p !== "default") {
|
|
1120
|
+
const L = {
|
|
1121
1121
|
informational: "信息",
|
|
1122
1122
|
success: "成功",
|
|
1123
1123
|
attention: "注意",
|
|
@@ -1125,11 +1125,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1125
1125
|
critical: "严重",
|
|
1126
1126
|
default: "默认"
|
|
1127
1127
|
};
|
|
1128
|
-
return
|
|
1128
|
+
return w ? `${w},语气:${L[p] || p}` : `语气:${L[p] || p}`;
|
|
1129
1129
|
}
|
|
1130
|
-
return
|
|
1130
|
+
return w || "标记";
|
|
1131
1131
|
});
|
|
1132
|
-
return (
|
|
1132
|
+
return (w, p) => (i(), u("span", {
|
|
1133
1133
|
class: E(["y-badge", [
|
|
1134
1134
|
`y-badge--${t.value}`,
|
|
1135
1135
|
`y-badge--${e.size}`,
|
|
@@ -1141,13 +1141,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1141
1141
|
}, [
|
|
1142
1142
|
o("span", Gt, [
|
|
1143
1143
|
e.progress ? (i(), u("span", en, [
|
|
1144
|
-
e.progress === "incomplete" ? (i(), u("svg", tn, [...
|
|
1144
|
+
e.progress === "incomplete" ? (i(), u("svg", tn, [...p[0] || (p[0] = [
|
|
1145
1145
|
o("circle", {
|
|
1146
1146
|
cx: "10",
|
|
1147
1147
|
cy: "10",
|
|
1148
1148
|
r: "5"
|
|
1149
1149
|
}, null, -1)
|
|
1150
|
-
])])) : e.progress === "partiallyComplete" ? (i(), u("svg", nn, [...
|
|
1150
|
+
])])) : e.progress === "partiallyComplete" ? (i(), u("svg", nn, [...p[1] || (p[1] = [
|
|
1151
1151
|
o("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1152
1152
|
o("circle", {
|
|
1153
1153
|
cx: "10",
|
|
@@ -1157,7 +1157,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1157
1157
|
stroke: "currentColor",
|
|
1158
1158
|
"stroke-width": "2"
|
|
1159
1159
|
}, null, -1)
|
|
1160
|
-
])])) : e.progress === "complete" ? (i(), u("svg", ln, [...
|
|
1160
|
+
])])) : e.progress === "complete" ? (i(), u("svg", ln, [...p[2] || (p[2] = [
|
|
1161
1161
|
o("path", {
|
|
1162
1162
|
"fill-rule": "evenodd",
|
|
1163
1163
|
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",
|
|
@@ -1165,25 +1165,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1165
1165
|
}, null, -1)
|
|
1166
1166
|
])])) : W("", !0)
|
|
1167
1167
|
])) : e.icon ? (i(), u("span", on, [
|
|
1168
|
-
e.icon === "dot" ? (i(), u("svg", an, [...
|
|
1168
|
+
e.icon === "dot" ? (i(), u("svg", an, [...p[3] || (p[3] = [
|
|
1169
1169
|
o("circle", {
|
|
1170
1170
|
cx: "10",
|
|
1171
1171
|
cy: "10",
|
|
1172
1172
|
r: "4"
|
|
1173
1173
|
}, null, -1)
|
|
1174
|
-
])])) : e.icon === "check" ? (i(), u("svg", sn, [...
|
|
1174
|
+
])])) : e.icon === "check" ? (i(), u("svg", sn, [...p[4] || (p[4] = [
|
|
1175
1175
|
o("path", {
|
|
1176
1176
|
"fill-rule": "evenodd",
|
|
1177
1177
|
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",
|
|
1178
1178
|
"clip-rule": "evenodd"
|
|
1179
1179
|
}, null, -1)
|
|
1180
|
-
])])) : e.icon === "alert" ? (i(), u("svg", rn, [...
|
|
1180
|
+
])])) : e.icon === "alert" ? (i(), u("svg", rn, [...p[5] || (p[5] = [
|
|
1181
1181
|
o("path", {
|
|
1182
1182
|
"fill-rule": "evenodd",
|
|
1183
1183
|
d: "M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z",
|
|
1184
1184
|
"clip-rule": "evenodd"
|
|
1185
1185
|
}, null, -1)
|
|
1186
|
-
])])) : (i(), u("svg", un, [...
|
|
1186
|
+
])])) : (i(), u("svg", un, [...p[6] || (p[6] = [
|
|
1187
1187
|
o("circle", {
|
|
1188
1188
|
cx: "10",
|
|
1189
1189
|
cy: "10",
|
|
@@ -1192,8 +1192,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1192
1192
|
])]))
|
|
1193
1193
|
])) : W("", !0),
|
|
1194
1194
|
o("span", cn, [
|
|
1195
|
-
|
|
1196
|
-
$e(
|
|
1195
|
+
se(w.$slots, "default", {}, () => [
|
|
1196
|
+
$e(ee(e.label), 1)
|
|
1197
1197
|
], !0)
|
|
1198
1198
|
])
|
|
1199
1199
|
])
|
|
@@ -1220,59 +1220,59 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1220
1220
|
},
|
|
1221
1221
|
emits: ["update:modelValue", "open", "close"],
|
|
1222
1222
|
setup(e, { emit: $ }) {
|
|
1223
|
-
const t = e, n = $,
|
|
1223
|
+
const t = e, n = $, w = O({
|
|
1224
1224
|
get: () => t.modelValue,
|
|
1225
|
-
set: (
|
|
1226
|
-
}),
|
|
1227
|
-
const
|
|
1228
|
-
return
|
|
1225
|
+
set: (m) => n("update:modelValue", m)
|
|
1226
|
+
}), p = K(null), y = O(() => {
|
|
1227
|
+
const m = {};
|
|
1228
|
+
return m.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), m.margin = "0 auto", m.top = t.top, m;
|
|
1229
1229
|
});
|
|
1230
|
-
function
|
|
1230
|
+
function L() {
|
|
1231
1231
|
t.maskClosable && C();
|
|
1232
1232
|
}
|
|
1233
1233
|
function C() {
|
|
1234
|
-
|
|
1234
|
+
w.value && (w.value = !1, n("close"));
|
|
1235
1235
|
}
|
|
1236
1236
|
function T() {
|
|
1237
1237
|
t.closable && C();
|
|
1238
1238
|
}
|
|
1239
|
-
function k(
|
|
1240
|
-
|
|
1239
|
+
function k(m) {
|
|
1240
|
+
m.key === "Escape" && T();
|
|
1241
1241
|
}
|
|
1242
|
-
return
|
|
1243
|
-
|
|
1242
|
+
return G(() => t.modelValue, (m) => {
|
|
1243
|
+
m ? (n("open"), requestAnimationFrame(() => {
|
|
1244
1244
|
var g;
|
|
1245
|
-
return (g =
|
|
1245
|
+
return (g = p.value) == null ? void 0 : g.focus();
|
|
1246
1246
|
}), document.addEventListener("keydown", k), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", k), document.body.style.overflow = "");
|
|
1247
1247
|
}), Ce(() => {
|
|
1248
1248
|
t.modelValue && (document.addEventListener("keydown", k), document.body.style.overflow = "hidden");
|
|
1249
1249
|
}), Ee(() => {
|
|
1250
1250
|
document.removeEventListener("keydown", k), document.body.style.overflow = "";
|
|
1251
|
-
}), (
|
|
1251
|
+
}), (m, g) => (i(), Me(Fe, { to: "body" }, [
|
|
1252
1252
|
Be(o("div", {
|
|
1253
1253
|
class: "y-dialog-root",
|
|
1254
1254
|
role: "dialog",
|
|
1255
1255
|
"aria-modal": !0,
|
|
1256
|
-
"aria-hidden": !
|
|
1256
|
+
"aria-hidden": !w.value,
|
|
1257
1257
|
style: fe({ zIndex: String(e.zIndex) })
|
|
1258
1258
|
}, [
|
|
1259
1259
|
o("div", {
|
|
1260
1260
|
class: "y-dialog-mask",
|
|
1261
|
-
onClick:
|
|
1261
|
+
onClick: L
|
|
1262
1262
|
}),
|
|
1263
|
-
|
|
1263
|
+
ie(xe, { name: "dialog-zoom-fade" }, {
|
|
1264
1264
|
default: re(() => [
|
|
1265
1265
|
Be(o("div", {
|
|
1266
1266
|
ref_key: "panelRef",
|
|
1267
|
-
ref:
|
|
1267
|
+
ref: p,
|
|
1268
1268
|
class: E(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1269
|
-
style: fe(
|
|
1270
|
-
onKeydown: ke(
|
|
1269
|
+
style: fe(y.value),
|
|
1270
|
+
onKeydown: ke(J(T, ["prevent", "stop"]), ["esc"]),
|
|
1271
1271
|
tabindex: "-1"
|
|
1272
1272
|
}, [
|
|
1273
1273
|
e.showHeader ? (i(), u("div", pn, [
|
|
1274
|
-
|
|
1275
|
-
o("div", yn,
|
|
1274
|
+
se(m.$slots, "header", {}, () => [
|
|
1275
|
+
o("div", yn, ee(e.title), 1)
|
|
1276
1276
|
], !0),
|
|
1277
1277
|
e.closable ? (i(), u("button", {
|
|
1278
1278
|
key: 0,
|
|
@@ -1283,19 +1283,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1283
1283
|
}, " ✕ ")) : W("", !0)
|
|
1284
1284
|
])) : W("", !0),
|
|
1285
1285
|
o("div", gn, [
|
|
1286
|
-
|
|
1286
|
+
se(m.$slots, "default", {}, void 0, !0)
|
|
1287
1287
|
]),
|
|
1288
|
-
|
|
1289
|
-
|
|
1288
|
+
m.$slots.footer ? (i(), u("div", mn, [
|
|
1289
|
+
se(m.$slots, "footer", {}, void 0, !0)
|
|
1290
1290
|
])) : W("", !0)
|
|
1291
1291
|
], 46, hn), [
|
|
1292
|
-
[Ke,
|
|
1292
|
+
[Ke, w.value]
|
|
1293
1293
|
])
|
|
1294
1294
|
]),
|
|
1295
1295
|
_: 3
|
|
1296
1296
|
})
|
|
1297
1297
|
], 12, vn), [
|
|
1298
|
-
[Ke,
|
|
1298
|
+
[Ke, w.value]
|
|
1299
1299
|
])
|
|
1300
1300
|
]));
|
|
1301
1301
|
}
|
|
@@ -1319,44 +1319,44 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1319
1319
|
},
|
|
1320
1320
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1321
1321
|
setup(e, { expose: $, emit: t }) {
|
|
1322
|
-
const n = e,
|
|
1322
|
+
const n = e, w = t, p = K(), y = K(), L = K(), C = K(!1), T = K(), k = K(), m = K({});
|
|
1323
1323
|
let g = null, x = null;
|
|
1324
|
-
const
|
|
1324
|
+
const N = O(() => {
|
|
1325
1325
|
if (!C.value || !T.value) return {};
|
|
1326
|
-
const
|
|
1327
|
-
n.width !== "auto" && (
|
|
1328
|
-
const { top: Z, left: d } =
|
|
1329
|
-
return
|
|
1330
|
-
}),
|
|
1326
|
+
const F = {};
|
|
1327
|
+
n.width !== "auto" && (F.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (F.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1328
|
+
const { top: Z, left: d } = Y();
|
|
1329
|
+
return F.top = `${Z}px`, F.left = `${d}px`, F;
|
|
1330
|
+
}), X = O(() => {
|
|
1331
1331
|
if (!n.showArrow) return {};
|
|
1332
|
-
if (Object.keys(
|
|
1333
|
-
return
|
|
1334
|
-
const
|
|
1335
|
-
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ?
|
|
1332
|
+
if (Object.keys(m.value).length > 0)
|
|
1333
|
+
return m.value;
|
|
1334
|
+
const F = {};
|
|
1335
|
+
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? F.left = "50%" : F.top = "50%", F;
|
|
1336
1336
|
});
|
|
1337
|
-
function
|
|
1338
|
-
var A,
|
|
1337
|
+
function Y() {
|
|
1338
|
+
var A, P;
|
|
1339
1339
|
if (!T.value) return { top: 0, left: 0 };
|
|
1340
|
-
const { width:
|
|
1340
|
+
const { width: F, height: Z, top: d, left: h } = T.value, a = ((A = L.value) == null ? void 0 : A.offsetWidth) || 200, r = ((P = L.value) == null ? void 0 : P.offsetHeight) || 100;
|
|
1341
1341
|
let f = 0, b = 0;
|
|
1342
1342
|
switch (n.placement) {
|
|
1343
1343
|
case "top":
|
|
1344
|
-
f = d - r - n.offset, b = h + (
|
|
1344
|
+
f = d - r - n.offset, b = h + (F - a) / 2;
|
|
1345
1345
|
break;
|
|
1346
1346
|
case "top-start":
|
|
1347
1347
|
f = d - r - n.offset, b = h;
|
|
1348
1348
|
break;
|
|
1349
1349
|
case "top-end":
|
|
1350
|
-
f = d - r - n.offset, b = h +
|
|
1350
|
+
f = d - r - n.offset, b = h + F - a;
|
|
1351
1351
|
break;
|
|
1352
1352
|
case "bottom":
|
|
1353
|
-
f = d + Z + n.offset, b = h + (
|
|
1353
|
+
f = d + Z + n.offset, b = h + (F - a) / 2;
|
|
1354
1354
|
break;
|
|
1355
1355
|
case "bottom-start":
|
|
1356
1356
|
f = d + Z + n.offset, b = h;
|
|
1357
1357
|
break;
|
|
1358
1358
|
case "bottom-end":
|
|
1359
|
-
f = d + Z + n.offset, b = h +
|
|
1359
|
+
f = d + Z + n.offset, b = h + F - a;
|
|
1360
1360
|
break;
|
|
1361
1361
|
case "left":
|
|
1362
1362
|
f = d + (Z - r) / 2, b = h - a - n.offset;
|
|
@@ -1368,136 +1368,136 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1368
1368
|
f = d + Z - r, b = h - a - n.offset;
|
|
1369
1369
|
break;
|
|
1370
1370
|
case "right":
|
|
1371
|
-
f = d + (Z - r) / 2, b = h +
|
|
1371
|
+
f = d + (Z - r) / 2, b = h + F + n.offset;
|
|
1372
1372
|
break;
|
|
1373
1373
|
case "right-start":
|
|
1374
|
-
f = d, b = h +
|
|
1374
|
+
f = d, b = h + F + n.offset;
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "right-end":
|
|
1377
|
-
f = d + Z - r, b = h +
|
|
1377
|
+
f = d + Z - r, b = h + F + n.offset;
|
|
1378
1378
|
break;
|
|
1379
1379
|
}
|
|
1380
|
-
const
|
|
1381
|
-
return b < 8 && (b = 8), b + a >
|
|
1380
|
+
const M = window.innerWidth, U = window.innerHeight;
|
|
1381
|
+
return b < 8 && (b = 8), b + a > M - 8 && (b = M - a - 8), f < 8 && (f = 8), f + r > U - 8 && (f = U - r - 8), { top: f, left: b };
|
|
1382
1382
|
}
|
|
1383
|
-
function
|
|
1384
|
-
n.disabled || C.value || (
|
|
1385
|
-
|
|
1386
|
-
}, n.openDelay) :
|
|
1383
|
+
function V() {
|
|
1384
|
+
n.disabled || C.value || (B(), n.openDelay > 0 ? g = setTimeout(() => {
|
|
1385
|
+
I();
|
|
1386
|
+
}, n.openDelay) : I());
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1388
|
+
function I() {
|
|
1389
|
+
w("before-show"), C.value = !0, w("update:modelValue", !0), w("show"), oe(() => {
|
|
1390
|
+
oe(() => {
|
|
1391
|
+
j();
|
|
1392
1392
|
});
|
|
1393
1393
|
});
|
|
1394
1394
|
}
|
|
1395
|
-
function
|
|
1396
|
-
C.value && (
|
|
1395
|
+
function z() {
|
|
1396
|
+
C.value && (B(), n.closeDelay > 0 ? x = setTimeout(() => {
|
|
1397
1397
|
R();
|
|
1398
1398
|
}, n.closeDelay) : R());
|
|
1399
1399
|
}
|
|
1400
1400
|
function R() {
|
|
1401
|
-
|
|
1401
|
+
w("before-hide"), C.value = !1, w("update:modelValue", !1), w("hide");
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function B() {
|
|
1404
1404
|
g && (clearTimeout(g), g = null), x && (clearTimeout(x), x = null);
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1407
|
-
if (!n.showArrow || !T.value || !
|
|
1408
|
-
|
|
1406
|
+
function Q() {
|
|
1407
|
+
if (!n.showArrow || !T.value || !L.value) {
|
|
1408
|
+
m.value = {};
|
|
1409
1409
|
return;
|
|
1410
1410
|
}
|
|
1411
|
-
const
|
|
1411
|
+
const F = T.value, Z = L.value.getBoundingClientRect();
|
|
1412
1412
|
if (Z.width === 0 || Z.height === 0) {
|
|
1413
1413
|
const h = {};
|
|
1414
|
-
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%",
|
|
1414
|
+
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%", m.value = h;
|
|
1415
1415
|
return;
|
|
1416
1416
|
}
|
|
1417
1417
|
const d = {};
|
|
1418
1418
|
if (n.placement.startsWith("top")) {
|
|
1419
1419
|
d.bottom = "-6px";
|
|
1420
|
-
const h =
|
|
1420
|
+
const h = F.left + F.width / 2, a = Z.left, r = h - a;
|
|
1421
1421
|
d.left = `${Math.max(12, Math.min(r, Z.width - 12))}px`;
|
|
1422
1422
|
} else if (n.placement.startsWith("bottom")) {
|
|
1423
1423
|
d.top = "-6px";
|
|
1424
|
-
const h =
|
|
1424
|
+
const h = F.left + F.width / 2, a = Z.left, r = h - a;
|
|
1425
1425
|
d.left = `${Math.max(12, Math.min(r, Z.width - 12))}px`;
|
|
1426
1426
|
} else if (n.placement.startsWith("left")) {
|
|
1427
1427
|
d.right = "-6px";
|
|
1428
|
-
const h =
|
|
1428
|
+
const h = F.top + F.height / 2, a = Z.top, r = h - a;
|
|
1429
1429
|
d.top = `${Math.max(12, Math.min(r, Z.height - 12))}px`;
|
|
1430
1430
|
} else if (n.placement.startsWith("right")) {
|
|
1431
1431
|
d.left = "-6px";
|
|
1432
|
-
const h =
|
|
1432
|
+
const h = F.top + F.height / 2, a = Z.top, r = h - a;
|
|
1433
1433
|
d.top = `${Math.max(12, Math.min(r, Z.height - 12))}px`;
|
|
1434
1434
|
}
|
|
1435
|
-
|
|
1435
|
+
m.value = d;
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
|
|
1439
|
-
|
|
1437
|
+
function j() {
|
|
1438
|
+
y.value && (T.value = y.value.getBoundingClientRect(), L.value && (k.value = L.value.getBoundingClientRect(), Q(), C.value && requestAnimationFrame(() => {
|
|
1439
|
+
L.value && (k.value = L.value.getBoundingClientRect(), Q());
|
|
1440
1440
|
})));
|
|
1441
1441
|
}
|
|
1442
|
-
function
|
|
1443
|
-
n.disabled || n.trigger === "click" && (C.value ?
|
|
1442
|
+
function te() {
|
|
1443
|
+
n.disabled || n.trigger === "click" && (C.value ? z() : V());
|
|
1444
1444
|
}
|
|
1445
1445
|
function ue() {
|
|
1446
|
-
n.disabled || n.trigger !== "hover" || (
|
|
1446
|
+
n.disabled || n.trigger !== "hover" || (B(), V());
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1449
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1448
|
+
function ne() {
|
|
1449
|
+
n.disabled || n.trigger !== "hover" || z();
|
|
1450
1450
|
}
|
|
1451
1451
|
function ve() {
|
|
1452
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1452
|
+
n.disabled || n.trigger !== "hover" || B();
|
|
1453
1453
|
}
|
|
1454
1454
|
function pe() {
|
|
1455
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1455
|
+
n.disabled || n.trigger !== "hover" || z();
|
|
1456
1456
|
}
|
|
1457
|
-
function ye(
|
|
1457
|
+
function ye(F) {
|
|
1458
1458
|
if (!n.closeOnClickOutside || !C.value) return;
|
|
1459
|
-
const Z =
|
|
1460
|
-
|
|
1461
|
-
}
|
|
1462
|
-
return
|
|
1463
|
-
|
|
1464
|
-
}),
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1459
|
+
const Z = F.target;
|
|
1460
|
+
p.value && !p.value.contains(Z) && L.value && !L.value.contains(Z) && z();
|
|
1461
|
+
}
|
|
1462
|
+
return G(() => n.modelValue, (F) => {
|
|
1463
|
+
F !== C.value && (F ? V() : z());
|
|
1464
|
+
}), G(C, (F) => {
|
|
1465
|
+
F ? (document.addEventListener("click", ye), window.addEventListener("resize", j), window.addEventListener("scroll", j, !0), oe(() => {
|
|
1466
|
+
j(), requestAnimationFrame(() => {
|
|
1467
|
+
j();
|
|
1468
1468
|
}), setTimeout(() => {
|
|
1469
|
-
|
|
1469
|
+
j();
|
|
1470
1470
|
}, 0);
|
|
1471
|
-
})) : (document.removeEventListener("click", ye), window.removeEventListener("resize",
|
|
1471
|
+
})) : (document.removeEventListener("click", ye), window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0));
|
|
1472
1472
|
}), Ce(() => {
|
|
1473
|
-
n.modelValue &&
|
|
1473
|
+
n.modelValue && V();
|
|
1474
1474
|
}), Ee(() => {
|
|
1475
|
-
|
|
1475
|
+
B(), document.removeEventListener("click", ye), window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0);
|
|
1476
1476
|
}), $({
|
|
1477
|
-
show:
|
|
1478
|
-
hide:
|
|
1479
|
-
updatePosition:
|
|
1480
|
-
}), (
|
|
1477
|
+
show: V,
|
|
1478
|
+
hide: z,
|
|
1479
|
+
updatePosition: j
|
|
1480
|
+
}), (F, Z) => (i(), u("div", {
|
|
1481
1481
|
class: "ypopover",
|
|
1482
1482
|
ref_key: "popoverRef",
|
|
1483
|
-
ref:
|
|
1483
|
+
ref: p
|
|
1484
1484
|
}, [
|
|
1485
1485
|
o("div", {
|
|
1486
1486
|
ref_key: "triggerRef",
|
|
1487
|
-
ref:
|
|
1488
|
-
onClick:
|
|
1487
|
+
ref: y,
|
|
1488
|
+
onClick: te,
|
|
1489
1489
|
onMouseenter: ue,
|
|
1490
|
-
onMouseleave:
|
|
1490
|
+
onMouseleave: ne
|
|
1491
1491
|
}, [
|
|
1492
|
-
|
|
1492
|
+
se(F.$slots, "reference", {}, void 0, !0)
|
|
1493
1493
|
], 544),
|
|
1494
1494
|
(i(), Me(Fe, { to: "body" }, [
|
|
1495
|
-
|
|
1495
|
+
ie(xe, { name: "ypopover-fade" }, {
|
|
1496
1496
|
default: re(() => [
|
|
1497
1497
|
C.value ? (i(), u("div", {
|
|
1498
1498
|
key: 0,
|
|
1499
1499
|
ref_key: "contentRef",
|
|
1500
|
-
ref:
|
|
1500
|
+
ref: L,
|
|
1501
1501
|
class: E(["ypopover__content", [
|
|
1502
1502
|
`ypopover__content--${e.placement}`,
|
|
1503
1503
|
{
|
|
@@ -1505,8 +1505,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1505
1505
|
"ypopover__content--no-padding": !e.showPadding
|
|
1506
1506
|
}
|
|
1507
1507
|
]]),
|
|
1508
|
-
style: fe(
|
|
1509
|
-
onClick: Z[0] || (Z[0] =
|
|
1508
|
+
style: fe(N.value),
|
|
1509
|
+
onClick: Z[0] || (Z[0] = J(() => {
|
|
1510
1510
|
}, ["stop"])),
|
|
1511
1511
|
onMouseenter: ve,
|
|
1512
1512
|
onMouseleave: pe
|
|
@@ -1514,10 +1514,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1514
1514
|
e.showArrow ? (i(), u("div", {
|
|
1515
1515
|
key: 0,
|
|
1516
1516
|
class: E(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1517
|
-
style: fe(
|
|
1517
|
+
style: fe(X.value)
|
|
1518
1518
|
}, null, 6)) : W("", !0),
|
|
1519
1519
|
o("div", kn, [
|
|
1520
|
-
|
|
1520
|
+
se(F.$slots, "default", {}, void 0, !0)
|
|
1521
1521
|
])
|
|
1522
1522
|
], 38)) : W("", !0)
|
|
1523
1523
|
]),
|
|
@@ -1586,28 +1586,28 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1586
1586
|
},
|
|
1587
1587
|
emits: ["update:modelValue", "change"],
|
|
1588
1588
|
setup(e, { emit: $ }) {
|
|
1589
|
-
const t = e, n = $,
|
|
1589
|
+
const t = e, n = $, w = K(!1), p = K(-1), y = K(-1), L = K(null), C = K(), T = K(), k = K({
|
|
1590
1590
|
top: !0,
|
|
1591
1591
|
left: !0
|
|
1592
|
-
}),
|
|
1592
|
+
}), m = K({
|
|
1593
1593
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1594
1594
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1595
1595
|
}), g = K({
|
|
1596
1596
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1597
1597
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1598
1598
|
}), x = () => {
|
|
1599
|
-
const s = new Date(
|
|
1599
|
+
const s = new Date(m.value.year, m.value.month).getTime(), v = new Date(g.value.year, g.value.month).getTime();
|
|
1600
1600
|
if (s >= v) {
|
|
1601
|
-
const l = new Date(
|
|
1601
|
+
const l = new Date(m.value.year, m.value.month + 1);
|
|
1602
1602
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1603
1603
|
}
|
|
1604
|
-
},
|
|
1605
|
-
const s = new Date(
|
|
1604
|
+
}, N = () => {
|
|
1605
|
+
const s = new Date(m.value.year, m.value.month).getTime();
|
|
1606
1606
|
if (new Date(g.value.year, g.value.month).getTime() <= s) {
|
|
1607
1607
|
const l = new Date(g.value.year, g.value.month - 1);
|
|
1608
|
-
|
|
1608
|
+
m.value.year = l.getFullYear(), m.value.month = l.getMonth();
|
|
1609
1609
|
}
|
|
1610
|
-
},
|
|
1610
|
+
}, X = ["一", "二", "三", "四", "五", "六", "日"], Y = K(null), V = K(null), I = (s) => {
|
|
1611
1611
|
if (!s) return null;
|
|
1612
1612
|
if (s instanceof Date) return s;
|
|
1613
1613
|
if (typeof s == "number")
|
|
@@ -1617,39 +1617,39 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1617
1617
|
return isNaN(v.getTime()) ? null : v;
|
|
1618
1618
|
}
|
|
1619
1619
|
return null;
|
|
1620
|
-
},
|
|
1620
|
+
}, z = (s) => {
|
|
1621
1621
|
if (!s) return null;
|
|
1622
1622
|
const v = s.getFullYear(), l = String(s.getMonth() + 1).padStart(2, "0"), c = String(s.getDate()).padStart(2, "0");
|
|
1623
1623
|
if (t.includeTime) {
|
|
1624
|
-
const
|
|
1625
|
-
return `${v}-${l}-${c} ${
|
|
1624
|
+
const D = String(s.getHours()).padStart(2, "0"), S = String(s.getMinutes()).padStart(2, "0"), _ = String(s.getSeconds()).padStart(2, "0");
|
|
1625
|
+
return `${v}-${l}-${c} ${D}:${S}:${_}`;
|
|
1626
1626
|
} else
|
|
1627
1627
|
return `${v}-${l}-${c}`;
|
|
1628
|
-
}, R = (s) => s ? s.getTime() : null,
|
|
1628
|
+
}, R = (s) => s ? s.getTime() : null, B = (s) => s ? {
|
|
1629
|
+
startDate: I(s.startDate),
|
|
1630
|
+
endDate: I(s.endDate)
|
|
1631
|
+
} : { startDate: null, endDate: null }, Q = (s) => t.format === "string" ? {
|
|
1629
1632
|
startDate: z(s.startDate),
|
|
1630
1633
|
endDate: z(s.endDate)
|
|
1631
|
-
} : { startDate: null, endDate: null }, X = (s) => t.format === "string" ? {
|
|
1632
|
-
startDate: B(s.startDate),
|
|
1633
|
-
endDate: B(s.endDate)
|
|
1634
1634
|
} : t.format === "timestamp" ? {
|
|
1635
1635
|
startDate: R(s.startDate),
|
|
1636
1636
|
endDate: R(s.endDate)
|
|
1637
|
-
} : s,
|
|
1638
|
-
const v =
|
|
1637
|
+
} : s, j = (s, v) => `${String(v + 1).padStart(2, "0")}/${s}`, te = (s, v) => s.getFullYear() === v.getFullYear() && s.getMonth() === v.getMonth() && s.getDate() === v.getDate(), ue = (s, v, l) => !v || !l ? !1 : s >= v && s <= l, ne = (s) => {
|
|
1638
|
+
const v = B(s);
|
|
1639
1639
|
if (!(v != null && v.startDate) || !(v != null && v.endDate))
|
|
1640
1640
|
return -1;
|
|
1641
1641
|
for (let l = 0; l < t.shortcuts.length; l++) {
|
|
1642
1642
|
const c = t.shortcuts[l].getValue();
|
|
1643
1643
|
if (c.startDate && c.endDate && v.startDate && v.endDate) {
|
|
1644
|
-
const
|
|
1644
|
+
const D = new Date(
|
|
1645
1645
|
v.startDate.getFullYear(),
|
|
1646
1646
|
v.startDate.getMonth(),
|
|
1647
1647
|
v.startDate.getDate()
|
|
1648
|
-
),
|
|
1648
|
+
), S = new Date(
|
|
1649
1649
|
v.endDate.getFullYear(),
|
|
1650
1650
|
v.endDate.getMonth(),
|
|
1651
1651
|
v.endDate.getDate()
|
|
1652
|
-
),
|
|
1652
|
+
), _ = new Date(
|
|
1653
1653
|
c.startDate.getFullYear(),
|
|
1654
1654
|
c.startDate.getMonth(),
|
|
1655
1655
|
c.startDate.getDate()
|
|
@@ -1658,46 +1658,46 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1658
1658
|
c.endDate.getMonth(),
|
|
1659
1659
|
c.endDate.getDate()
|
|
1660
1660
|
);
|
|
1661
|
-
if (
|
|
1661
|
+
if (D.getTime() === _.getTime() && S.getTime() === H.getTime())
|
|
1662
1662
|
return l;
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
return -1;
|
|
1666
1666
|
}, ve = (s, v) => {
|
|
1667
|
-
const l = new Date(s, v, 1), c = new Date(s, v + 1, 0),
|
|
1668
|
-
for (let
|
|
1669
|
-
const _e = new Date(s, v - 1, de.getDate() -
|
|
1670
|
-
|
|
1667
|
+
const l = new Date(s, v, 1), c = new Date(s, v + 1, 0), D = l.getDay(), S = c.getDate(), _ = [], H = /* @__PURE__ */ new Date(), q = D === 0 ? 6 : D - 1, de = new Date(s, v, 0);
|
|
1668
|
+
for (let le = q - 1; le >= 0; le--) {
|
|
1669
|
+
const _e = new Date(s, v - 1, de.getDate() - le);
|
|
1670
|
+
_.push({
|
|
1671
1671
|
date: _e,
|
|
1672
1672
|
day: _e.getDate(),
|
|
1673
1673
|
isCurrentMonth: !1,
|
|
1674
|
-
isToday:
|
|
1674
|
+
isToday: te(_e, H),
|
|
1675
1675
|
isSelected: !1,
|
|
1676
1676
|
isInRange: !1,
|
|
1677
1677
|
isDisabled: !0
|
|
1678
1678
|
// 禁用非当前月的日期
|
|
1679
1679
|
});
|
|
1680
1680
|
}
|
|
1681
|
-
for (let
|
|
1682
|
-
const _e = new Date(s, v,
|
|
1683
|
-
|
|
1681
|
+
for (let le = 1; le <= S; le++) {
|
|
1682
|
+
const _e = new Date(s, v, le);
|
|
1683
|
+
_.push({
|
|
1684
1684
|
date: _e,
|
|
1685
|
-
day:
|
|
1685
|
+
day: le,
|
|
1686
1686
|
isCurrentMonth: !0,
|
|
1687
|
-
isToday:
|
|
1687
|
+
isToday: te(_e, H),
|
|
1688
1688
|
isSelected: !1,
|
|
1689
1689
|
isInRange: !1,
|
|
1690
1690
|
isDisabled: !1
|
|
1691
1691
|
});
|
|
1692
1692
|
}
|
|
1693
|
-
const he = 42 -
|
|
1694
|
-
for (let
|
|
1695
|
-
const _e = new Date(s, v + 1,
|
|
1696
|
-
|
|
1693
|
+
const he = 42 - _.length;
|
|
1694
|
+
for (let le = 1; le <= he; le++) {
|
|
1695
|
+
const _e = new Date(s, v + 1, le);
|
|
1696
|
+
_.push({
|
|
1697
1697
|
date: _e,
|
|
1698
|
-
day:
|
|
1698
|
+
day: le,
|
|
1699
1699
|
isCurrentMonth: !1,
|
|
1700
|
-
isToday:
|
|
1700
|
+
isToday: te(_e, H),
|
|
1701
1701
|
isSelected: !1,
|
|
1702
1702
|
isInRange: !1,
|
|
1703
1703
|
isDisabled: !0
|
|
@@ -1705,98 +1705,98 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1705
1705
|
});
|
|
1706
1706
|
}
|
|
1707
1707
|
const ze = [];
|
|
1708
|
-
for (let
|
|
1709
|
-
ze.push(
|
|
1708
|
+
for (let le = 0; le < _.length; le += 7)
|
|
1709
|
+
ze.push(_.slice(le, le + 7));
|
|
1710
1710
|
return ze;
|
|
1711
1711
|
}, pe = (s) => {
|
|
1712
|
-
const v =
|
|
1712
|
+
const v = Q(s);
|
|
1713
1713
|
n("update:modelValue", v), n("change", v);
|
|
1714
1714
|
}, ye = () => {
|
|
1715
1715
|
if (!C.value || !T.value) return;
|
|
1716
|
-
const s = C.value.getBoundingClientRect(), v = T.value.getBoundingClientRect(), l = window.innerWidth,
|
|
1717
|
-
|
|
1718
|
-
const H = l - s.left,
|
|
1719
|
-
H <
|
|
1720
|
-
},
|
|
1721
|
-
if (
|
|
1722
|
-
const s =
|
|
1723
|
-
if (
|
|
1716
|
+
const s = C.value.getBoundingClientRect(), v = T.value.getBoundingClientRect(), l = window.innerWidth, D = window.innerHeight - s.bottom, S = s.top, _ = v.height || 400;
|
|
1717
|
+
D < _ && S > _ ? k.value.top = !1 : k.value.top = !0;
|
|
1718
|
+
const H = l - s.left, q = v.width || 640;
|
|
1719
|
+
H < q ? k.value.left = !1 : k.value.left = !0;
|
|
1720
|
+
}, F = () => {
|
|
1721
|
+
if (w.value = !w.value, w.value) {
|
|
1722
|
+
const s = B(t.modelValue);
|
|
1723
|
+
if (Y.value = (s == null ? void 0 : s.startDate) || null, V.value = (s == null ? void 0 : s.endDate) || null, y.value = ne(t.modelValue), p.value = -1, s != null && s.startDate && (m.value.year = s.startDate.getFullYear(), m.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1724
1724
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1725
1725
|
else {
|
|
1726
|
-
const v = new Date(
|
|
1726
|
+
const v = new Date(m.value.year, m.value.month + 1);
|
|
1727
1727
|
g.value.year = v.getFullYear(), g.value.month = v.getMonth();
|
|
1728
1728
|
}
|
|
1729
|
-
x(),
|
|
1729
|
+
x(), oe(() => {
|
|
1730
1730
|
ye();
|
|
1731
1731
|
});
|
|
1732
1732
|
}
|
|
1733
1733
|
}, Z = (s) => {
|
|
1734
1734
|
const v = s.target, l = C.value, c = T.value;
|
|
1735
|
-
l && c && !l.contains(v) && !c.contains(v) && (
|
|
1735
|
+
l && c && !l.contains(v) && !c.contains(v) && (w.value = !1, p.value = -1);
|
|
1736
1736
|
}, d = (s) => {
|
|
1737
|
-
s.key === "Enter" || s.key === " " ? (s.preventDefault(),
|
|
1737
|
+
s.key === "Enter" || s.key === " " ? (s.preventDefault(), F()) : s.key === "ArrowDown" && (s.preventDefault(), w.value = !0, oe(() => {
|
|
1738
1738
|
ye(), b();
|
|
1739
1739
|
}));
|
|
1740
1740
|
}, h = (s) => {
|
|
1741
1741
|
var v;
|
|
1742
|
-
s.key === "Escape" && (
|
|
1742
|
+
s.key === "Escape" && (w.value = !1, p.value = -1, (v = C.value) == null || v.focus());
|
|
1743
1743
|
}, a = (s, v) => {
|
|
1744
|
-
s.key === "ArrowDown" ? (s.preventDefault(),
|
|
1744
|
+
s.key === "ArrowDown" ? (s.preventDefault(), p.value = Math.min(v + 1, t.shortcuts.length - 1), M(p.value)) : s.key === "ArrowUp" ? (s.preventDefault(), p.value = Math.max(v - 1, 0), M(p.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), U(t.shortcuts[v]));
|
|
1745
1745
|
}, r = (s) => {
|
|
1746
|
-
|
|
1746
|
+
p.value = s;
|
|
1747
1747
|
}, f = () => {
|
|
1748
|
-
|
|
1748
|
+
p.value = -1;
|
|
1749
1749
|
}, b = () => {
|
|
1750
|
-
|
|
1751
|
-
},
|
|
1750
|
+
p.value = 0, M(0);
|
|
1751
|
+
}, M = (s) => {
|
|
1752
1752
|
if (T.value) {
|
|
1753
1753
|
const l = T.value.querySelectorAll(".nh-time-shortcut")[s];
|
|
1754
1754
|
l && l.focus();
|
|
1755
1755
|
}
|
|
1756
|
-
},
|
|
1756
|
+
}, U = (s) => {
|
|
1757
1757
|
const v = s.getValue();
|
|
1758
|
-
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)), pe(v),
|
|
1758
|
+
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)), pe(v), y.value = t.shortcuts.findIndex((l) => l.label === s.label), p.value = -1, w.value = !1;
|
|
1759
1759
|
}, A = (s, v) => {
|
|
1760
1760
|
if (!s || s.isDisabled) return;
|
|
1761
1761
|
let l;
|
|
1762
|
-
if (t.includeTime ? (l = new Date(s.date), v === "start" || !
|
|
1763
|
-
|
|
1764
|
-
else if (
|
|
1765
|
-
if (l >=
|
|
1766
|
-
t.includeTime && l.setHours(23, 59, 59, 999),
|
|
1762
|
+
if (t.includeTime ? (l = new Date(s.date), v === "start" || !Y.value ? l.setHours(0, 0, 0, 0) : l.setHours(23, 59, 59, 999)) : l = new Date(s.date.getFullYear(), s.date.getMonth(), s.date.getDate()), !Y.value && !V.value)
|
|
1763
|
+
Y.value = l, V.value = null;
|
|
1764
|
+
else if (Y.value && !V.value)
|
|
1765
|
+
if (l >= Y.value)
|
|
1766
|
+
t.includeTime && l.setHours(23, 59, 59, 999), V.value = l;
|
|
1767
1767
|
else {
|
|
1768
|
-
const c =
|
|
1769
|
-
t.includeTime && c.setHours(23, 59, 59, 999),
|
|
1768
|
+
const c = Y.value;
|
|
1769
|
+
t.includeTime && c.setHours(23, 59, 59, 999), V.value = c, Y.value = l;
|
|
1770
1770
|
}
|
|
1771
1771
|
else
|
|
1772
|
-
|
|
1773
|
-
if (
|
|
1774
|
-
const c = new Date(
|
|
1775
|
-
t.includeTime && c.setHours(23, 59, 59, 999),
|
|
1776
|
-
startDate:
|
|
1772
|
+
Y.value = l, V.value = null;
|
|
1773
|
+
if (y.value = -1, Y.value && V.value) {
|
|
1774
|
+
const c = new Date(V.value);
|
|
1775
|
+
t.includeTime && c.setHours(23, 59, 59, 999), L.value = {
|
|
1776
|
+
startDate: Y.value,
|
|
1777
1777
|
endDate: c
|
|
1778
1778
|
};
|
|
1779
1779
|
} else
|
|
1780
|
-
|
|
1781
|
-
},
|
|
1780
|
+
L.value = null;
|
|
1781
|
+
}, P = (s, v) => {
|
|
1782
1782
|
if (!s) return ["nh-date-table-td"];
|
|
1783
1783
|
const l = ["nh-date-table-td"];
|
|
1784
|
-
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"),
|
|
1784
|
+
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"), Y.value && te(s.date, Y.value) && l.push("is-selected", "is-start"), V.value && te(s.date, V.value) && l.push("is-selected", "is-end"), Y.value && V.value && ue(s.date, Y.value, V.value) && l.push("is-in-range"), l;
|
|
1785
1785
|
}, we = () => {
|
|
1786
|
-
|
|
1786
|
+
L.value && (t.includeTime && L.value.endDate && L.value.endDate.setHours(23, 59, 59, 999), pe(L.value), y.value = ne(L.value), w.value = !1);
|
|
1787
1787
|
}, De = () => {
|
|
1788
|
-
pe({ startDate: null, endDate: null }), Ae(),
|
|
1788
|
+
pe({ startDate: null, endDate: null }), Ae(), p.value = -1, w.value = !1;
|
|
1789
1789
|
}, be = () => {
|
|
1790
|
-
|
|
1790
|
+
w.value && oe(() => {
|
|
1791
1791
|
ye();
|
|
1792
1792
|
});
|
|
1793
|
-
}, Le = O(() => ve(
|
|
1794
|
-
const s =
|
|
1793
|
+
}, Le = O(() => ve(m.value.year, m.value.month)), Ie = O(() => ve(g.value.year, g.value.month)), Ye = O(() => {
|
|
1794
|
+
const s = B(t.modelValue);
|
|
1795
1795
|
if (!s || !s.startDate || !s.endDate)
|
|
1796
1796
|
return "";
|
|
1797
|
-
const v = (
|
|
1798
|
-
const
|
|
1799
|
-
return `${
|
|
1797
|
+
const v = (D) => {
|
|
1798
|
+
const S = String(D.getFullYear()), _ = String(D.getMonth() + 1).padStart(2, "0"), H = String(D.getDate()).padStart(2, "0");
|
|
1799
|
+
return `${S}/${_}/${H}`;
|
|
1800
1800
|
}, l = v(s.startDate), c = v(s.endDate);
|
|
1801
1801
|
return !t.includeTime && l === c ? l : `${l} - ${c}`;
|
|
1802
1802
|
}), We = O(() => [
|
|
@@ -1806,38 +1806,38 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1806
1806
|
"nh-time-dropdown-right": !k.value.left
|
|
1807
1807
|
}
|
|
1808
1808
|
]), Re = O(() => {
|
|
1809
|
-
const s =
|
|
1809
|
+
const s = B(t.modelValue);
|
|
1810
1810
|
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1811
|
-
}), Pe = O(() => !!(
|
|
1812
|
-
|
|
1811
|
+
}), Pe = O(() => !!(Y.value && V.value)), Ae = () => {
|
|
1812
|
+
Y.value = null, V.value = null, L.value = null, y.value = -1;
|
|
1813
1813
|
};
|
|
1814
|
-
|
|
1815
|
-
const v =
|
|
1814
|
+
G(() => t.modelValue, (s) => {
|
|
1815
|
+
const v = B(s);
|
|
1816
1816
|
if (v != null && v.startDate) {
|
|
1817
1817
|
const l = v.startDate;
|
|
1818
|
-
|
|
1818
|
+
m.value.year = l.getFullYear(), m.value.month = l.getMonth();
|
|
1819
1819
|
}
|
|
1820
1820
|
if (v != null && v.endDate) {
|
|
1821
1821
|
const l = v.endDate;
|
|
1822
1822
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1823
1823
|
} else if (v != null && v.startDate) {
|
|
1824
|
-
const l = new Date(
|
|
1824
|
+
const l = new Date(m.value.year, m.value.month + 1);
|
|
1825
1825
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1826
1826
|
}
|
|
1827
|
-
(v != null && v.startDate || v != null && v.endDate) && x(),
|
|
1828
|
-
}, { immediate: !0, deep: !0 }),
|
|
1829
|
-
const s = new Date(
|
|
1827
|
+
(v != null && v.startDate || v != null && v.endDate) && x(), w.value || (y.value = ne(s));
|
|
1828
|
+
}, { immediate: !0, deep: !0 }), G([m, g], () => {
|
|
1829
|
+
const s = new Date(m.value.year, m.value.month).getTime(), v = new Date(g.value.year, g.value.month).getTime();
|
|
1830
1830
|
if (s === v) {
|
|
1831
|
-
const l = new Date(
|
|
1831
|
+
const l = new Date(m.value.year, m.value.month + 1);
|
|
1832
1832
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1833
1833
|
}
|
|
1834
1834
|
}, { deep: !0 }), Ce(() => {
|
|
1835
|
-
document.addEventListener("click", Z), window.addEventListener("resize", be), window.addEventListener("scroll", be),
|
|
1836
|
-
const s =
|
|
1837
|
-
if (s != null && s.startDate && (
|
|
1835
|
+
document.addEventListener("click", Z), window.addEventListener("resize", be), window.addEventListener("scroll", be), y.value = ne(t.modelValue);
|
|
1836
|
+
const s = B(t.modelValue);
|
|
1837
|
+
if (s != null && s.startDate && (m.value.year = s.startDate.getFullYear(), m.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1838
1838
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1839
1839
|
else {
|
|
1840
|
-
const v = new Date(
|
|
1840
|
+
const v = new Date(m.value.year, m.value.month + 1);
|
|
1841
1841
|
g.value.year = v.getFullYear(), g.value.month = v.getMonth();
|
|
1842
1842
|
}
|
|
1843
1843
|
x();
|
|
@@ -1845,14 +1845,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1845
1845
|
document.removeEventListener("click", Z), window.removeEventListener("resize", be), window.removeEventListener("scroll", be);
|
|
1846
1846
|
});
|
|
1847
1847
|
const He = () => {
|
|
1848
|
-
t.clearable && (pe({ startDate: null, endDate: null }), Ae(),
|
|
1848
|
+
t.clearable && (pe({ startDate: null, endDate: null }), Ae(), p.value = -1);
|
|
1849
1849
|
}, Te = (s, v) => {
|
|
1850
1850
|
if (s === "start") {
|
|
1851
|
-
const l = new Date(
|
|
1852
|
-
|
|
1851
|
+
const l = new Date(m.value.year, m.value.month + v, 1);
|
|
1852
|
+
m.value.year = l.getFullYear(), m.value.month = l.getMonth(), x();
|
|
1853
1853
|
} else {
|
|
1854
1854
|
const l = new Date(g.value.year, g.value.month + v, 1);
|
|
1855
|
-
g.value.year = l.getFullYear(), g.value.month = l.getMonth(),
|
|
1855
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth(), N();
|
|
1856
1856
|
}
|
|
1857
1857
|
};
|
|
1858
1858
|
return (s, v) => {
|
|
@@ -1864,9 +1864,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1864
1864
|
o("div", {
|
|
1865
1865
|
ref_key: "trigger",
|
|
1866
1866
|
ref: C,
|
|
1867
|
-
onClick:
|
|
1867
|
+
onClick: F,
|
|
1868
1868
|
onKeydown: d,
|
|
1869
|
-
class: E(["nh-time-trigger", { "is-focus":
|
|
1869
|
+
class: E(["nh-time-trigger", { "is-focus": w.value, "has-value": Re.value }]),
|
|
1870
1870
|
tabindex: "0"
|
|
1871
1871
|
}, [
|
|
1872
1872
|
o("input", {
|
|
@@ -1878,7 +1878,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1878
1878
|
o("span", _n, [
|
|
1879
1879
|
e.clearable && Re.value ? (i(), u("i", {
|
|
1880
1880
|
key: 0,
|
|
1881
|
-
onClick:
|
|
1881
|
+
onClick: J(He, ["stop"]),
|
|
1882
1882
|
class: "nh-time-clear"
|
|
1883
1883
|
}, [...v[4] || (v[4] = [
|
|
1884
1884
|
o("svg", {
|
|
@@ -1905,7 +1905,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1905
1905
|
])
|
|
1906
1906
|
], -1)),
|
|
1907
1907
|
o("i", {
|
|
1908
|
-
class: E(["nh-time-arrow", { "is-reverse":
|
|
1908
|
+
class: E(["nh-time-arrow", { "is-reverse": w.value }])
|
|
1909
1909
|
}, [...v[5] || (v[5] = [
|
|
1910
1910
|
o("svg", {
|
|
1911
1911
|
viewBox: "0 0 1024 1024",
|
|
@@ -1920,9 +1920,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1920
1920
|
])], 2)
|
|
1921
1921
|
])
|
|
1922
1922
|
], 34),
|
|
1923
|
-
|
|
1923
|
+
ie(xe, { name: "el-zoom-in-top" }, {
|
|
1924
1924
|
default: re(() => [
|
|
1925
|
-
|
|
1925
|
+
w.value ? (i(), u("div", {
|
|
1926
1926
|
key: 0,
|
|
1927
1927
|
ref_key: "dropdown",
|
|
1928
1928
|
ref: T,
|
|
@@ -1932,28 +1932,28 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1932
1932
|
o("div", Sn, [
|
|
1933
1933
|
v[7] || (v[7] = o("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1934
1934
|
o("ul", Mn, [
|
|
1935
|
-
(i(!0), u(
|
|
1935
|
+
(i(!0), u(ae, null, ce(e.shortcuts, (c, D) => (i(), u("li", {
|
|
1936
1936
|
key: c.label,
|
|
1937
|
-
onClick: (
|
|
1938
|
-
onKeydown: (
|
|
1939
|
-
onMouseenter: (
|
|
1937
|
+
onClick: (S) => U(c),
|
|
1938
|
+
onKeydown: (S) => a(S, D),
|
|
1939
|
+
onMouseenter: (S) => r(D),
|
|
1940
1940
|
onMouseleave: f,
|
|
1941
1941
|
class: E([
|
|
1942
1942
|
"nh-time-shortcut",
|
|
1943
1943
|
{
|
|
1944
|
-
"is-active":
|
|
1945
|
-
"is-selected":
|
|
1944
|
+
"is-active": p.value === D,
|
|
1945
|
+
"is-selected": y.value === D
|
|
1946
1946
|
}
|
|
1947
1947
|
]),
|
|
1948
1948
|
tabindex: "0"
|
|
1949
|
-
},
|
|
1949
|
+
}, ee(c.label), 43, Ln))), 128))
|
|
1950
1950
|
])
|
|
1951
1951
|
]),
|
|
1952
1952
|
o("div", In, [
|
|
1953
1953
|
o("div", Bn, [
|
|
1954
1954
|
v[8] || (v[8] = o("span", null, "自定义时间", -1)),
|
|
1955
1955
|
o("div", En, [
|
|
1956
|
-
!
|
|
1956
|
+
!Y.value && !V.value ? (i(), u("span", Tn, " 请选择开始日期 ")) : Y.value && !V.value ? (i(), u("span", zn, " 请选择结束日期 ")) : Y.value && V.value ? (i(), u("span", Kn, " 已选择完整范围 ")) : W("", !0)
|
|
1957
1957
|
])
|
|
1958
1958
|
]),
|
|
1959
1959
|
o("div", Hn, [
|
|
@@ -1976,7 +1976,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1976
1976
|
})
|
|
1977
1977
|
], -1)
|
|
1978
1978
|
])]),
|
|
1979
|
-
o("span", Vn,
|
|
1979
|
+
o("span", Vn, ee(j(m.value.year, m.value.month)), 1),
|
|
1980
1980
|
o("button", {
|
|
1981
1981
|
onClick: v[1] || (v[1] = (c) => Te("start", 1)),
|
|
1982
1982
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -1998,23 +1998,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1998
1998
|
o("table", Yn, [
|
|
1999
1999
|
o("thead", null, [
|
|
2000
2000
|
o("tr", null, [
|
|
2001
|
-
(i(), u(
|
|
2001
|
+
(i(), u(ae, null, ce(X, (c) => o("th", {
|
|
2002
2002
|
key: c,
|
|
2003
2003
|
class: "nh-date-table-th"
|
|
2004
|
-
},
|
|
2004
|
+
}, ee(c), 1)), 64))
|
|
2005
2005
|
])
|
|
2006
2006
|
]),
|
|
2007
2007
|
o("tbody", null, [
|
|
2008
|
-
(i(!0), u(
|
|
2009
|
-
key: `start-week-${
|
|
2008
|
+
(i(!0), u(ae, null, ce(Le.value, (c, D) => (i(), u("tr", {
|
|
2009
|
+
key: `start-week-${D}`
|
|
2010
2010
|
}, [
|
|
2011
|
-
(i(!0), u(
|
|
2012
|
-
key: `start-day-${
|
|
2013
|
-
class: E(
|
|
2014
|
-
onClick: (H) => A(
|
|
2011
|
+
(i(!0), u(ae, null, ce(c, (S, _) => (i(), u("td", {
|
|
2012
|
+
key: `start-day-${D}-${_}`,
|
|
2013
|
+
class: E(P(S)),
|
|
2014
|
+
onClick: (H) => A(S, "start")
|
|
2015
2015
|
}, [
|
|
2016
2016
|
o("div", Nn, [
|
|
2017
|
-
|
|
2017
|
+
S ? (i(), u("span", On, ee(S.day), 1)) : W("", !0)
|
|
2018
2018
|
])
|
|
2019
2019
|
], 10, Pn))), 128))
|
|
2020
2020
|
]))), 128))
|
|
@@ -2042,7 +2042,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2042
2042
|
})
|
|
2043
2043
|
], -1)
|
|
2044
2044
|
])]),
|
|
2045
|
-
o("span", Zn,
|
|
2045
|
+
o("span", Zn, ee(j(g.value.year, g.value.month)), 1),
|
|
2046
2046
|
o("button", {
|
|
2047
2047
|
onClick: v[3] || (v[3] = (c) => Te("end", 1)),
|
|
2048
2048
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2064,23 +2064,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2064
2064
|
o("table", Jn, [
|
|
2065
2065
|
o("thead", null, [
|
|
2066
2066
|
o("tr", null, [
|
|
2067
|
-
(i(), u(
|
|
2067
|
+
(i(), u(ae, null, ce(X, (c) => o("th", {
|
|
2068
2068
|
key: c,
|
|
2069
2069
|
class: "nh-date-table-th"
|
|
2070
|
-
},
|
|
2070
|
+
}, ee(c), 1)), 64))
|
|
2071
2071
|
])
|
|
2072
2072
|
]),
|
|
2073
2073
|
o("tbody", null, [
|
|
2074
|
-
(i(!0), u(
|
|
2075
|
-
key: `end-week-${
|
|
2074
|
+
(i(!0), u(ae, null, ce(Ie.value, (c, D) => (i(), u("tr", {
|
|
2075
|
+
key: `end-week-${D}`
|
|
2076
2076
|
}, [
|
|
2077
|
-
(i(!0), u(
|
|
2078
|
-
key: `end-day-${
|
|
2079
|
-
class: E(
|
|
2080
|
-
onClick: (H) => A(
|
|
2077
|
+
(i(!0), u(ae, null, ce(c, (S, _) => (i(), u("td", {
|
|
2078
|
+
key: `end-day-${D}-${_}`,
|
|
2079
|
+
class: E(P(S)),
|
|
2080
|
+
onClick: (H) => A(S, "end")
|
|
2081
2081
|
}, [
|
|
2082
2082
|
o("div", Gn, [
|
|
2083
|
-
|
|
2083
|
+
S ? (i(), u("span", el, ee(S.day), 1)) : W("", !0)
|
|
2084
2084
|
])
|
|
2085
2085
|
], 10, Xn))), 128))
|
|
2086
2086
|
]))), 128))
|
|
@@ -2102,14 +2102,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2102
2102
|
])]),
|
|
2103
2103
|
_: 1
|
|
2104
2104
|
}, 8, ["size"])) : W("", !0),
|
|
2105
|
-
|
|
2105
|
+
ie(l, {
|
|
2106
2106
|
onClick: we,
|
|
2107
2107
|
disabled: !Pe.value,
|
|
2108
2108
|
variant: "primary",
|
|
2109
2109
|
size: e.size
|
|
2110
2110
|
}, {
|
|
2111
2111
|
default: re(() => [
|
|
2112
|
-
$e(
|
|
2112
|
+
$e(ee(Y.value && !V.value ? "继续选择结束日期" : "确认"), 1)
|
|
2113
2113
|
]),
|
|
2114
2114
|
_: 1
|
|
2115
2115
|
}, 8, ["disabled", "size"])
|
|
@@ -2144,34 +2144,34 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2144
2144
|
},
|
|
2145
2145
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2146
2146
|
setup(e, { emit: $ }) {
|
|
2147
|
-
const t = e, n = $,
|
|
2147
|
+
const t = e, n = $, w = K(), p = O(() => t.modelValue === t.trueValue), y = O(() => {
|
|
2148
2148
|
const C = {};
|
|
2149
|
-
return C.background =
|
|
2149
|
+
return C.background = p.value ? t.activeColor : t.inactiveColor, C;
|
|
2150
2150
|
});
|
|
2151
|
-
function
|
|
2151
|
+
function L() {
|
|
2152
2152
|
if (t.disabled || t.loading) return;
|
|
2153
|
-
const C =
|
|
2153
|
+
const C = p.value ? t.falseValue : t.trueValue;
|
|
2154
2154
|
n("update:modelValue", C), n("change", C);
|
|
2155
2155
|
}
|
|
2156
2156
|
return Ce(() => {
|
|
2157
|
-
const C =
|
|
2157
|
+
const C = w.value;
|
|
2158
2158
|
C && (C.addEventListener("focus", (T) => n("focus", T)), C.addEventListener("blur", (T) => n("blur", T)));
|
|
2159
2159
|
}), (C, T) => (i(), u("button", {
|
|
2160
2160
|
ref_key: "rootEl",
|
|
2161
|
-
ref:
|
|
2161
|
+
ref: w,
|
|
2162
2162
|
class: E(["yswitch", [
|
|
2163
2163
|
`yswitch--${e.size}`,
|
|
2164
|
-
{ "yswitch--checked":
|
|
2164
|
+
{ "yswitch--checked": p.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2165
2165
|
]]),
|
|
2166
|
-
style: fe(
|
|
2166
|
+
style: fe(y.value),
|
|
2167
2167
|
role: "switch",
|
|
2168
|
-
"aria-checked":
|
|
2168
|
+
"aria-checked": p.value,
|
|
2169
2169
|
"aria-disabled": e.disabled,
|
|
2170
2170
|
disabled: e.disabled || e.loading,
|
|
2171
|
-
onClick:
|
|
2171
|
+
onClick: L,
|
|
2172
2172
|
onKeydown: [
|
|
2173
|
-
ke(
|
|
2174
|
-
ke(
|
|
2173
|
+
ke(J(L, ["prevent"]), ["enter"]),
|
|
2174
|
+
ke(J(L, ["prevent"]), ["space"])
|
|
2175
2175
|
]
|
|
2176
2176
|
}, [
|
|
2177
2177
|
T[0] || (T[0] = o("span", { class: "yswitch__track" }, null, -1)),
|
|
@@ -2180,8 +2180,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2180
2180
|
]),
|
|
2181
2181
|
e.showText ? (i(), u("span", {
|
|
2182
2182
|
key: 0,
|
|
2183
|
-
class: E(["yswitch__label", { "yswitch__label--left": !
|
|
2184
|
-
},
|
|
2183
|
+
class: E(["yswitch__label", { "yswitch__label--left": !p.value, "yswitch__label--right": p.value }])
|
|
2184
|
+
}, ee(p.value ? e.activeText : e.inactiveText), 3)) : W("", !0)
|
|
2185
2185
|
], 46, ll));
|
|
2186
2186
|
}
|
|
2187
2187
|
}), il = /* @__PURE__ */ me(sl, [["__scopeId", "data-v-0b157fc4"]]), rl = ["src", "alt"], ul = ["src", "alt"], cl = /* @__PURE__ */ ge({
|
|
@@ -2200,122 +2200,122 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2200
2200
|
},
|
|
2201
2201
|
emits: ["load", "error", "preview"],
|
|
2202
2202
|
setup(e, { expose: $, emit: t }) {
|
|
2203
|
-
const n = e,
|
|
2203
|
+
const n = e, w = t, p = K(), y = K(), L = K(), C = K(!1), T = K(!1), k = K(!1), m = K(!1), g = K(!1), x = K("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), N = K(""), X = K(1), Y = K(!1), V = K({
|
|
2204
2204
|
overflow: "",
|
|
2205
2205
|
paddingRight: ""
|
|
2206
|
-
}),
|
|
2206
|
+
}), I = O(() => [
|
|
2207
2207
|
n.className,
|
|
2208
2208
|
"overflow-hidden"
|
|
2209
|
-
].filter(Boolean).join(" ")),
|
|
2210
|
-
|
|
2211
|
-
|
|
2209
|
+
].filter(Boolean).join(" ")), z = O(() => [
|
|
2210
|
+
te(),
|
|
2211
|
+
ne()
|
|
2212
2212
|
].filter(Boolean).join(" ")), R = O(() => [
|
|
2213
2213
|
"w-full h-full bg-white",
|
|
2214
2214
|
ue(),
|
|
2215
|
-
|
|
2215
|
+
ne(),
|
|
2216
2216
|
n.preview ? "cursor-pointer hover:opacity-90 transition-opacity duration-200" : ""
|
|
2217
|
-
].filter(Boolean).join(" ")),
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
].filter(Boolean).join(" ")),
|
|
2217
|
+
].filter(Boolean).join(" ")), B = O(() => [
|
|
2218
|
+
te(),
|
|
2219
|
+
ne()
|
|
2220
|
+
].filter(Boolean).join(" ")), Q = O(() => {
|
|
2221
2221
|
const A = {};
|
|
2222
2222
|
return n.width && (A.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.height && (A.height = typeof n.height == "number" ? `${n.height}px` : n.height), A;
|
|
2223
|
-
}),
|
|
2223
|
+
}), j = O(() => N.value ? N.value : Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src), te = () => n.width && n.height ? "" : "w-full h-full", ue = () => ({
|
|
2224
2224
|
cover: "object-cover",
|
|
2225
2225
|
contain: "object-contain",
|
|
2226
2226
|
fill: "object-fill",
|
|
2227
2227
|
none: "object-none",
|
|
2228
2228
|
"scale-down": "object-scale-down"
|
|
2229
|
-
})[n.fit] || "object-cover",
|
|
2229
|
+
})[n.fit] || "object-cover", ne = () => typeof n.radius == "number" ? `rounded-${n.radius}` : typeof n.radius == "string" ? n.radius.includes("px") ? "" : `rounded-${n.radius}` : "", ve = () => {
|
|
2230
2230
|
const A = document.createElement("div");
|
|
2231
2231
|
A.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(A);
|
|
2232
|
-
const
|
|
2233
|
-
return document.body.removeChild(A),
|
|
2232
|
+
const P = A.offsetWidth - A.clientWidth;
|
|
2233
|
+
return document.body.removeChild(A), P;
|
|
2234
2234
|
}, pe = () => {
|
|
2235
|
-
if (
|
|
2235
|
+
if (V.value = {
|
|
2236
2236
|
overflow: document.body.style.overflow || "",
|
|
2237
2237
|
paddingRight: document.body.style.paddingRight || ""
|
|
2238
2238
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2239
|
-
const
|
|
2240
|
-
document.body.style.paddingRight = `${
|
|
2239
|
+
const P = ve();
|
|
2240
|
+
document.body.style.paddingRight = `${P}px`;
|
|
2241
2241
|
}
|
|
2242
2242
|
document.body.style.overflow = "hidden";
|
|
2243
2243
|
}, ye = () => {
|
|
2244
|
-
document.body.style.overflow =
|
|
2244
|
+
document.body.style.overflow = V.value.overflow, document.body.style.paddingRight = V.value.paddingRight;
|
|
2245
2245
|
};
|
|
2246
|
-
let
|
|
2246
|
+
let F = null;
|
|
2247
2247
|
const Z = () => {
|
|
2248
|
-
!n.lazy || !
|
|
2248
|
+
!n.lazy || !p.value || (F = new IntersectionObserver(
|
|
2249
2249
|
(A) => {
|
|
2250
|
-
A.forEach((
|
|
2251
|
-
|
|
2250
|
+
A.forEach((P) => {
|
|
2251
|
+
P.isIntersecting && (m.value = !0, x.value = n.src, F == null || F.unobserve(P.target));
|
|
2252
2252
|
});
|
|
2253
2253
|
},
|
|
2254
2254
|
{
|
|
2255
2255
|
rootMargin: "50px"
|
|
2256
2256
|
}
|
|
2257
|
-
),
|
|
2257
|
+
), F.observe(p.value));
|
|
2258
2258
|
}, d = (A) => {
|
|
2259
|
-
C.value = !0, T.value = !1, k.value = !1,
|
|
2259
|
+
C.value = !0, T.value = !1, k.value = !1, w("load", A);
|
|
2260
2260
|
}, h = (A) => {
|
|
2261
|
-
k.value = !0, T.value = !1, C.value = !1,
|
|
2261
|
+
k.value = !0, T.value = !1, C.value = !1, w("error", A);
|
|
2262
2262
|
}, a = () => {
|
|
2263
|
-
k.value = !1, T.value = !0, C.value = !1,
|
|
2264
|
-
|
|
2263
|
+
k.value = !1, T.value = !0, C.value = !1, oe(() => {
|
|
2264
|
+
y.value && (y.value.src = n.src);
|
|
2265
2265
|
});
|
|
2266
2266
|
}, r = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, f = () => {
|
|
2267
2267
|
if (!n.preview || k.value) return;
|
|
2268
|
-
|
|
2268
|
+
X.value = 1;
|
|
2269
2269
|
const A = r();
|
|
2270
|
-
if (
|
|
2271
|
-
|
|
2272
|
-
g.value = !0, pe(),
|
|
2270
|
+
if (y.value && y.value.complete && y.value.naturalWidth > 0) {
|
|
2271
|
+
N.value = A, oe(() => {
|
|
2272
|
+
g.value = !0, pe(), w("preview", A);
|
|
2273
2273
|
});
|
|
2274
2274
|
return;
|
|
2275
2275
|
}
|
|
2276
|
-
const
|
|
2276
|
+
const P = new Image();
|
|
2277
2277
|
let we = null, De = !1;
|
|
2278
2278
|
const be = () => {
|
|
2279
|
-
De || (De = !0, we && (clearTimeout(we), we = null),
|
|
2280
|
-
g.value = !0, pe(),
|
|
2279
|
+
De || (De = !0, we && (clearTimeout(we), we = null), N.value = A, oe(() => {
|
|
2280
|
+
g.value = !0, pe(), w("preview", A);
|
|
2281
2281
|
}));
|
|
2282
2282
|
};
|
|
2283
2283
|
we = setTimeout(() => {
|
|
2284
2284
|
be();
|
|
2285
|
-
}, 500),
|
|
2285
|
+
}, 500), P.onload = () => {
|
|
2286
2286
|
be();
|
|
2287
|
-
},
|
|
2287
|
+
}, P.onerror = () => {
|
|
2288
2288
|
be();
|
|
2289
|
-
},
|
|
2289
|
+
}, P.src = A, P.complete && be();
|
|
2290
2290
|
}, b = () => {
|
|
2291
2291
|
g.value = !1, setTimeout(() => {
|
|
2292
2292
|
ye();
|
|
2293
2293
|
}, 300);
|
|
2294
|
-
},
|
|
2295
|
-
const
|
|
2296
|
-
let De =
|
|
2297
|
-
De = Math.max(0.5, Math.min(2, De)),
|
|
2294
|
+
}, M = (A) => {
|
|
2295
|
+
const P = A.deltaY < 0 ? 1 : -1;
|
|
2296
|
+
let De = X.value + P * 0.1;
|
|
2297
|
+
De = Math.max(0.5, Math.min(2, De)), X.value = De;
|
|
2298
2298
|
};
|
|
2299
2299
|
return Ce(() => {
|
|
2300
|
-
n.lazy ? Z() :
|
|
2300
|
+
n.lazy ? Z() : m.value = !0, m.value && (T.value = !0), Y.value = !0;
|
|
2301
2301
|
}), Ee(() => {
|
|
2302
|
-
|
|
2303
|
-
}),
|
|
2304
|
-
n.src &&
|
|
2305
|
-
}),
|
|
2302
|
+
F && F.disconnect(), g.value && ye();
|
|
2303
|
+
}), G(() => x.value, () => {
|
|
2304
|
+
n.src && m.value && (T.value = !0, k.value = !1, C.value = !1);
|
|
2305
|
+
}), G(() => n.src, (A) => {
|
|
2306
2306
|
x.value = A || "";
|
|
2307
2307
|
}), $({
|
|
2308
2308
|
retryLoad: a,
|
|
2309
2309
|
closePreview: b
|
|
2310
|
-
}), (A,
|
|
2310
|
+
}), (A, P) => (i(), u("div", {
|
|
2311
2311
|
ref_key: "containerRef",
|
|
2312
|
-
ref:
|
|
2313
|
-
class: E(["relative inline-block",
|
|
2312
|
+
ref: p,
|
|
2313
|
+
class: E(["relative inline-block", I.value])
|
|
2314
2314
|
}, [
|
|
2315
|
-
!C.value && !k.value && !
|
|
2315
|
+
!C.value && !k.value && !m.value ? (i(), u("div", {
|
|
2316
2316
|
key: 0,
|
|
2317
|
-
class: E(["bg-gray-200 animate-pulse rounded",
|
|
2318
|
-
}, [...
|
|
2317
|
+
class: E(["bg-gray-200 animate-pulse rounded", z.value])
|
|
2318
|
+
}, [...P[1] || (P[1] = [
|
|
2319
2319
|
o("div", { class: "flex items-center justify-center h-full" }, [
|
|
2320
2320
|
o("svg", {
|
|
2321
2321
|
class: "w-6 h-6 text-gray-400",
|
|
@@ -2335,64 +2335,64 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2335
2335
|
T.value && !k.value ? (i(), u("div", {
|
|
2336
2336
|
key: 1,
|
|
2337
2337
|
class: E(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded pointer-events-none", R.value])
|
|
2338
|
-
}, [...
|
|
2338
|
+
}, [...P[2] || (P[2] = [
|
|
2339
2339
|
o("div", { class: "flex flex-col items-center space-y-2" }, [
|
|
2340
2340
|
o("div", { class: "w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin" })
|
|
2341
2341
|
], -1)
|
|
2342
2342
|
])], 2)) : W("", !0),
|
|
2343
2343
|
k.value ? (i(), u("div", {
|
|
2344
2344
|
key: 2,
|
|
2345
|
-
class: E(["bg-gray-100 rounded flex items-center justify-center",
|
|
2345
|
+
class: E(["bg-gray-100 rounded flex items-center justify-center", B.value]),
|
|
2346
2346
|
onClick: a
|
|
2347
2347
|
}, [
|
|
2348
2348
|
o("img", {
|
|
2349
2349
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2350
2350
|
alt: "Error Image",
|
|
2351
|
-
class: E(["w-[70%] h-[70%] object-contain cursor-pointer",
|
|
2351
|
+
class: E(["w-[70%] h-[70%] object-contain cursor-pointer", ne()])
|
|
2352
2352
|
}, null, 2)
|
|
2353
2353
|
], 2)) : W("", !0),
|
|
2354
2354
|
Be(o("img", {
|
|
2355
2355
|
ref_key: "imageRef",
|
|
2356
|
-
ref:
|
|
2356
|
+
ref: y,
|
|
2357
2357
|
src: x.value,
|
|
2358
2358
|
alt: e.alt,
|
|
2359
2359
|
class: E(R.value),
|
|
2360
2360
|
onLoad: d,
|
|
2361
2361
|
onError: h,
|
|
2362
|
-
onClick:
|
|
2363
|
-
style: fe(
|
|
2362
|
+
onClick: J(f, ["stop"]),
|
|
2363
|
+
style: fe(Q.value)
|
|
2364
2364
|
}, null, 46, rl), [
|
|
2365
2365
|
[Ke, C.value && !k.value]
|
|
2366
2366
|
]),
|
|
2367
|
-
n.preview &&
|
|
2367
|
+
n.preview && m.value && !k.value && (!C.value || T.value) ? (i(), u("div", {
|
|
2368
2368
|
key: 3,
|
|
2369
2369
|
class: "absolute inset-0 cursor-pointer z-10",
|
|
2370
|
-
onClick:
|
|
2370
|
+
onClick: J(f, ["stop"])
|
|
2371
2371
|
})) : W("", !0),
|
|
2372
|
-
|
|
2372
|
+
Y.value ? (i(), Me(Fe, {
|
|
2373
2373
|
key: 4,
|
|
2374
2374
|
to: "body"
|
|
2375
2375
|
}, [
|
|
2376
|
-
|
|
2376
|
+
ie(xe, { name: "fade" }, {
|
|
2377
2377
|
default: re(() => [
|
|
2378
2378
|
g.value ? (i(), u("div", {
|
|
2379
2379
|
key: 0,
|
|
2380
2380
|
class: "fixed inset-0 bg-black/75 flex items-center justify-center",
|
|
2381
2381
|
style: { "z-index": "99999" },
|
|
2382
|
-
onClick:
|
|
2383
|
-
onWheel:
|
|
2382
|
+
onClick: J(b, ["self"]),
|
|
2383
|
+
onWheel: J(M, ["prevent"])
|
|
2384
2384
|
}, [
|
|
2385
2385
|
o("div", {
|
|
2386
2386
|
class: E(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100": g.value, "scale-95": !g.value }])
|
|
2387
2387
|
}, [
|
|
2388
2388
|
o("img", {
|
|
2389
2389
|
ref_key: "previewImageRef",
|
|
2390
|
-
ref:
|
|
2391
|
-
src:
|
|
2390
|
+
ref: L,
|
|
2391
|
+
src: j.value,
|
|
2392
2392
|
alt: e.alt,
|
|
2393
2393
|
class: "max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",
|
|
2394
|
-
style: fe({ transform: `scale(${
|
|
2395
|
-
onClick:
|
|
2394
|
+
style: fe({ transform: `scale(${X.value})` }),
|
|
2395
|
+
onClick: P[0] || (P[0] = J(() => {
|
|
2396
2396
|
}, ["stop"]))
|
|
2397
2397
|
}, null, 12, ul)
|
|
2398
2398
|
], 2)
|
|
@@ -2413,8 +2413,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2413
2413
|
},
|
|
2414
2414
|
setup(e) {
|
|
2415
2415
|
const $ = e, t = K(!1), n = K();
|
|
2416
|
-
let
|
|
2417
|
-
const
|
|
2416
|
+
let w = null;
|
|
2417
|
+
const p = O(() => `y-dropdown__menu--${$.placement}`), y = O(() => {
|
|
2418
2418
|
if (!$.menuWidth) return {};
|
|
2419
2419
|
const g = typeof $.menuWidth == "number" ? `${$.menuWidth}px` : $.menuWidth;
|
|
2420
2420
|
return {
|
|
@@ -2422,58 +2422,58 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2422
2422
|
minWidth: g,
|
|
2423
2423
|
maxWidth: g
|
|
2424
2424
|
};
|
|
2425
|
-
}),
|
|
2426
|
-
console.log("显示下拉菜单", t.value), !$.disabled && (
|
|
2425
|
+
}), L = () => {
|
|
2426
|
+
console.log("显示下拉菜单", t.value), !$.disabled && (w && (clearTimeout(w), w = null), t.value = !0, console.log("设置 visible 为 true", t.value), oe(() => {
|
|
2427
2427
|
T();
|
|
2428
2428
|
}));
|
|
2429
2429
|
}, C = () => {
|
|
2430
|
-
console.log("隐藏下拉菜单"),
|
|
2430
|
+
console.log("隐藏下拉菜单"), w = setTimeout(() => {
|
|
2431
2431
|
t.value = !1, console.log("设置 visible 为 false", t.value);
|
|
2432
2432
|
}, 150);
|
|
2433
2433
|
}, T = () => {
|
|
2434
2434
|
if (!n.value) return;
|
|
2435
2435
|
const g = n.value.querySelector(".y-dropdown__trigger"), x = n.value.querySelector(".y-dropdown__menu");
|
|
2436
2436
|
if (!g || !x) return;
|
|
2437
|
-
const
|
|
2437
|
+
const N = g.getBoundingClientRect(), X = x.getBoundingClientRect(), Y = window.innerWidth, V = window.innerHeight;
|
|
2438
2438
|
x.style.top = "", x.style.left = "", x.style.right = "", x.style.bottom = "", x.style.transform = "";
|
|
2439
|
-
let
|
|
2439
|
+
let I = 0, z = 0;
|
|
2440
2440
|
switch ($.placement) {
|
|
2441
2441
|
case "bottom":
|
|
2442
|
-
|
|
2442
|
+
I = N.height + 4, z = 0;
|
|
2443
2443
|
break;
|
|
2444
2444
|
case "top":
|
|
2445
|
-
|
|
2445
|
+
I = -(X.height + 4), z = 0;
|
|
2446
2446
|
break;
|
|
2447
2447
|
case "right":
|
|
2448
|
-
|
|
2448
|
+
I = 0, z = N.width + 4;
|
|
2449
2449
|
break;
|
|
2450
2450
|
case "left":
|
|
2451
|
-
|
|
2451
|
+
I = 0, z = -(X.width + 4);
|
|
2452
2452
|
break;
|
|
2453
2453
|
}
|
|
2454
|
-
let R =
|
|
2454
|
+
let R = N.top + I, B = N.left + z;
|
|
2455
2455
|
if ($.placement === "bottom" || $.placement === "top") {
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2456
|
+
const Q = X.width || 260;
|
|
2457
|
+
B + Q > Y - 10 && (B = Y - Q - 10), B < 10 && (B = 10);
|
|
2458
2458
|
}
|
|
2459
2459
|
if ($.placement === "left" || $.placement === "right") {
|
|
2460
|
-
const
|
|
2461
|
-
R +
|
|
2460
|
+
const Q = X.height || 200;
|
|
2461
|
+
R + Q > V - 10 && (R = V - Q - 10), R < 10 && (R = 10);
|
|
2462
2462
|
}
|
|
2463
|
-
x.style.top = `${R}px`, x.style.left = `${
|
|
2463
|
+
x.style.top = `${R}px`, x.style.left = `${B}px`;
|
|
2464
2464
|
}, k = (g) => {
|
|
2465
2465
|
$.trigger === "click" && n.value && !n.value.contains(g.target) && (t.value = !1);
|
|
2466
|
-
},
|
|
2466
|
+
}, m = () => {
|
|
2467
2467
|
t.value && T();
|
|
2468
2468
|
};
|
|
2469
2469
|
return Ce(() => {
|
|
2470
|
-
$.trigger === "click" && document.addEventListener("click", k), window.addEventListener("resize",
|
|
2470
|
+
$.trigger === "click" && document.addEventListener("click", k), window.addEventListener("resize", m), window.addEventListener("scroll", m);
|
|
2471
2471
|
}), Ee(() => {
|
|
2472
|
-
$.trigger === "click" && document.removeEventListener("click", k),
|
|
2473
|
-
}),
|
|
2472
|
+
$.trigger === "click" && document.removeEventListener("click", k), w && clearTimeout(w), window.removeEventListener("resize", m), window.removeEventListener("scroll", m);
|
|
2473
|
+
}), G(
|
|
2474
2474
|
() => $.menuWidth,
|
|
2475
2475
|
() => {
|
|
2476
|
-
t.value &&
|
|
2476
|
+
t.value && oe(() => {
|
|
2477
2477
|
T();
|
|
2478
2478
|
});
|
|
2479
2479
|
}
|
|
@@ -2484,25 +2484,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2484
2484
|
}, [
|
|
2485
2485
|
o("div", {
|
|
2486
2486
|
class: "y-dropdown__trigger",
|
|
2487
|
-
onMouseenter:
|
|
2487
|
+
onMouseenter: L,
|
|
2488
2488
|
onMouseleave: C
|
|
2489
2489
|
}, [
|
|
2490
|
-
|
|
2490
|
+
se(g.$slots, "trigger", {}, () => [
|
|
2491
2491
|
x[0] || (x[0] = o("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2492
2492
|
], !0)
|
|
2493
2493
|
], 32),
|
|
2494
|
-
|
|
2494
|
+
ie(xe, {
|
|
2495
2495
|
name: "dropdown-fade",
|
|
2496
2496
|
appear: ""
|
|
2497
2497
|
}, {
|
|
2498
2498
|
default: re(() => [
|
|
2499
2499
|
Be(o("div", {
|
|
2500
|
-
class: E(["y-dropdown__menu",
|
|
2501
|
-
style: fe(
|
|
2502
|
-
onMouseenter:
|
|
2500
|
+
class: E(["y-dropdown__menu", p.value]),
|
|
2501
|
+
style: fe(y.value),
|
|
2502
|
+
onMouseenter: L,
|
|
2503
2503
|
onMouseleave: C
|
|
2504
2504
|
}, [
|
|
2505
|
-
|
|
2505
|
+
se(g.$slots, "default", {}, () => [
|
|
2506
2506
|
x[1] || (x[1] = o("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2507
2507
|
x[2] || (x[2] = o("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2508
2508
|
x[3] || (x[3] = o("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
@@ -2536,10 +2536,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2536
2536
|
},
|
|
2537
2537
|
emits: ["update:modelValue", "open", "close"],
|
|
2538
2538
|
setup(e, { emit: $ }) {
|
|
2539
|
-
const t = e, n = $,
|
|
2539
|
+
const t = e, n = $, w = O({
|
|
2540
2540
|
get: () => t.modelValue,
|
|
2541
2541
|
set: (x) => n("update:modelValue", x)
|
|
2542
|
-
}),
|
|
2542
|
+
}), p = K(null), y = O(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), L = O(() => t.placement === "right" ? "rounded-left" : "rounded-top"), C = O(() => {
|
|
2543
2543
|
const x = {};
|
|
2544
2544
|
return t.placement === "right" ? (x.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), x.height = "100%", x.right = "0", x.top = "0") : (x.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), x.width = "100%", x.bottom = "0", x.left = "0"), x;
|
|
2545
2545
|
});
|
|
@@ -2547,50 +2547,50 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2547
2547
|
t.maskClosable && k();
|
|
2548
2548
|
}
|
|
2549
2549
|
function k() {
|
|
2550
|
-
|
|
2550
|
+
w.value && (w.value = !1, n("close"));
|
|
2551
2551
|
}
|
|
2552
|
-
function
|
|
2552
|
+
function m() {
|
|
2553
2553
|
t.closable && k();
|
|
2554
2554
|
}
|
|
2555
2555
|
function g(x) {
|
|
2556
|
-
x.key === "Escape" &&
|
|
2556
|
+
x.key === "Escape" && m();
|
|
2557
2557
|
}
|
|
2558
|
-
return
|
|
2558
|
+
return G(() => t.modelValue, (x) => {
|
|
2559
2559
|
x ? (n("open"), requestAnimationFrame(() => {
|
|
2560
|
-
var
|
|
2561
|
-
return (
|
|
2560
|
+
var N;
|
|
2561
|
+
return (N = p.value) == null ? void 0 : N.focus();
|
|
2562
2562
|
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2563
2563
|
}), Ce(() => {
|
|
2564
2564
|
t.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2565
2565
|
}), Ee(() => {
|
|
2566
2566
|
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2567
|
-
}), (x,
|
|
2567
|
+
}), (x, N) => (i(), Me(Fe, { to: "body" }, [
|
|
2568
2568
|
Be(o("div", {
|
|
2569
2569
|
class: "y-drawer-root",
|
|
2570
2570
|
role: "dialog",
|
|
2571
2571
|
"aria-modal": !0,
|
|
2572
|
-
"aria-hidden": !
|
|
2572
|
+
"aria-hidden": !w.value,
|
|
2573
2573
|
style: fe({ zIndex: String(e.zIndex) })
|
|
2574
2574
|
}, [
|
|
2575
2575
|
o("div", {
|
|
2576
2576
|
class: "y-drawer-mask",
|
|
2577
2577
|
onClick: T
|
|
2578
2578
|
}),
|
|
2579
|
-
|
|
2579
|
+
ie(xe, { name: y.value }, {
|
|
2580
2580
|
default: re(() => [
|
|
2581
2581
|
Be(o("div", {
|
|
2582
2582
|
ref_key: "panelRef",
|
|
2583
|
-
ref:
|
|
2583
|
+
ref: p,
|
|
2584
2584
|
class: E(["y-drawer-panel", [
|
|
2585
2585
|
`is-${e.placement}`,
|
|
2586
|
-
|
|
2586
|
+
L.value
|
|
2587
2587
|
]]),
|
|
2588
2588
|
style: fe(C.value),
|
|
2589
|
-
onKeydown: ke(
|
|
2589
|
+
onKeydown: ke(J(m, ["prevent", "stop"]), ["esc"]),
|
|
2590
2590
|
tabindex: "-1"
|
|
2591
2591
|
}, [
|
|
2592
2592
|
e.showHeader ? (i(), u("div", yl, [
|
|
2593
|
-
o("div", gl,
|
|
2593
|
+
o("div", gl, ee(e.title), 1),
|
|
2594
2594
|
e.closable ? (i(), u("button", {
|
|
2595
2595
|
key: 0,
|
|
2596
2596
|
type: "button",
|
|
@@ -2600,19 +2600,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2600
2600
|
}, " ✕ ")) : W("", !0)
|
|
2601
2601
|
])) : W("", !0),
|
|
2602
2602
|
o("div", ml, [
|
|
2603
|
-
|
|
2603
|
+
se(x.$slots, "default", {}, void 0, !0)
|
|
2604
2604
|
]),
|
|
2605
2605
|
x.$slots.footer ? (i(), u("div", wl, [
|
|
2606
|
-
|
|
2606
|
+
se(x.$slots, "footer", {}, void 0, !0)
|
|
2607
2607
|
])) : W("", !0)
|
|
2608
2608
|
], 46, pl), [
|
|
2609
|
-
[Ke,
|
|
2609
|
+
[Ke, w.value]
|
|
2610
2610
|
])
|
|
2611
2611
|
]),
|
|
2612
2612
|
_: 3
|
|
2613
2613
|
}, 8, ["name"])
|
|
2614
2614
|
], 12, hl), [
|
|
2615
|
-
[Ke,
|
|
2615
|
+
[Ke, w.value]
|
|
2616
2616
|
])
|
|
2617
2617
|
]));
|
|
2618
2618
|
}
|
|
@@ -2752,7 +2752,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2752
2752
|
},
|
|
2753
2753
|
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"],
|
|
2754
2754
|
setup(e, { expose: $, emit: t }) {
|
|
2755
|
-
const n = e,
|
|
2755
|
+
const n = e, w = t, p = O(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), y = K({
|
|
2756
2756
|
currentNode: null,
|
|
2757
2757
|
currentKey: null,
|
|
2758
2758
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2760,8 +2760,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2760
2760
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2761
2761
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2762
2762
|
});
|
|
2763
|
-
ot("treeStore",
|
|
2764
|
-
const
|
|
2763
|
+
ot("treeStore", y);
|
|
2764
|
+
const L = O(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2765
2765
|
function C(d) {
|
|
2766
2766
|
return d[n.nodeKey] || d.id || Math.random();
|
|
2767
2767
|
}
|
|
@@ -2773,10 +2773,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2773
2773
|
var h;
|
|
2774
2774
|
return !!((h = d == null ? void 0 : d.data) != null && h.isEmployee);
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2777
|
-
var
|
|
2776
|
+
function m(d, h) {
|
|
2777
|
+
var M;
|
|
2778
2778
|
const a = n.deptIconUrl || ho, r = n.personIconUrl || po, f = n.buttonIconUrl || "", b = n.childStyleIconUrl || "";
|
|
2779
|
-
return h && b &&
|
|
2779
|
+
return h && b && X(d, h) ? b : (M = d == null ? void 0 : d.data) != null && M.isButton && f ? f : k(d) ? r : a;
|
|
2780
2780
|
}
|
|
2781
2781
|
function g(d) {
|
|
2782
2782
|
var a;
|
|
@@ -2787,30 +2787,30 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2787
2787
|
var h;
|
|
2788
2788
|
return ((h = n.props) != null && h.children ? d[n.props.children] : void 0) || d.children || [];
|
|
2789
2789
|
}
|
|
2790
|
-
function
|
|
2790
|
+
function N(d, h, a = 1) {
|
|
2791
2791
|
if (d === h)
|
|
2792
2792
|
return a;
|
|
2793
2793
|
const r = x(d);
|
|
2794
2794
|
for (const f of r) {
|
|
2795
|
-
const b =
|
|
2795
|
+
const b = N(f, h, a + 1);
|
|
2796
2796
|
if (b > 0)
|
|
2797
2797
|
return b;
|
|
2798
2798
|
}
|
|
2799
2799
|
return 0;
|
|
2800
2800
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 :
|
|
2801
|
+
function X(d, h) {
|
|
2802
|
+
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : N(h, d) === n.childStyleLevel;
|
|
2803
2803
|
}
|
|
2804
|
-
function
|
|
2804
|
+
function Y(d) {
|
|
2805
2805
|
const h = C(d);
|
|
2806
|
-
return
|
|
2806
|
+
return y.value.expandedKeys.has(h);
|
|
2807
2807
|
}
|
|
2808
|
-
function
|
|
2808
|
+
function V(d) {
|
|
2809
2809
|
const h = C(d);
|
|
2810
|
-
if (
|
|
2810
|
+
if (y.value.checkedKeys.has(h)) {
|
|
2811
2811
|
if (g(d)) {
|
|
2812
|
-
const r = x(d), f = r.filter((
|
|
2813
|
-
(
|
|
2812
|
+
const r = x(d), f = r.filter((M) => V(M)), b = r.filter(
|
|
2813
|
+
(M) => I(M)
|
|
2814
2814
|
);
|
|
2815
2815
|
return f.length === r.length && b.length === 0;
|
|
2816
2816
|
}
|
|
@@ -2819,61 +2819,61 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2819
2819
|
if (g(d)) {
|
|
2820
2820
|
const r = x(d);
|
|
2821
2821
|
return r.some(
|
|
2822
|
-
(b) =>
|
|
2823
|
-
) ? !1 : r.length > 0 && r.every((b) =>
|
|
2822
|
+
(b) => I(b)
|
|
2823
|
+
) ? !1 : r.length > 0 && r.every((b) => V(b));
|
|
2824
2824
|
}
|
|
2825
2825
|
return !1;
|
|
2826
2826
|
}
|
|
2827
|
-
function
|
|
2827
|
+
function I(d) {
|
|
2828
2828
|
if (!g(d)) return !1;
|
|
2829
|
-
const h = x(d), a = h.filter((f) =>
|
|
2830
|
-
(f) =>
|
|
2829
|
+
const h = x(d), a = h.filter((f) => V(f)), r = h.filter(
|
|
2830
|
+
(f) => I(f)
|
|
2831
2831
|
);
|
|
2832
2832
|
return a.length === h.length ? !1 : a.length > 0 || r.length > 0;
|
|
2833
2833
|
}
|
|
2834
|
-
function
|
|
2834
|
+
function z(d) {
|
|
2835
2835
|
const h = C(d);
|
|
2836
|
-
return
|
|
2836
|
+
return y.value.currentKey === h;
|
|
2837
2837
|
}
|
|
2838
2838
|
function R(d) {
|
|
2839
2839
|
const h = C(d);
|
|
2840
|
-
return
|
|
2840
|
+
return y.value.highlightedKeys.has(h);
|
|
2841
2841
|
}
|
|
2842
|
-
function
|
|
2842
|
+
function B(d) {
|
|
2843
2843
|
if (n.disabled) return;
|
|
2844
|
-
const h = C(d), r = !
|
|
2845
|
-
r ?
|
|
2846
|
-
function b(
|
|
2847
|
-
|
|
2848
|
-
const
|
|
2849
|
-
|
|
2844
|
+
const h = C(d), r = !y.value.checkedKeys.has(h), f = new Set(y.value.expandedKeys);
|
|
2845
|
+
r ? y.value.checkedKeys.add(h) : y.value.checkedKeys.delete(h);
|
|
2846
|
+
function b(M, U) {
|
|
2847
|
+
M.forEach((A) => {
|
|
2848
|
+
const P = C(A);
|
|
2849
|
+
U ? y.value.checkedKeys.add(P) : y.value.checkedKeys.delete(P), g(A) && b(x(A), U);
|
|
2850
2850
|
});
|
|
2851
2851
|
}
|
|
2852
|
-
b(x(d), r), r &&
|
|
2852
|
+
b(x(d), r), r && Q(), te(), y.value.expandedKeys = f, w("check-change", d, r, !1), w("check", d, r, !1), w("checked-keys-change", Array.from(y.value.checkedKeys));
|
|
2853
2853
|
}
|
|
2854
|
-
function
|
|
2855
|
-
|
|
2856
|
-
`已启用从第${
|
|
2854
|
+
function Q(d) {
|
|
2855
|
+
L.value && console.log(
|
|
2856
|
+
`已启用从第${L.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2857
2857
|
);
|
|
2858
2858
|
}
|
|
2859
|
-
function
|
|
2859
|
+
function j(d) {
|
|
2860
2860
|
const h = C(d);
|
|
2861
|
-
|
|
2861
|
+
y.value.expandedKeys.has(h) ? (y.value.expandedKeys.delete(h), w("node-collapse", d, d, null)) : (y.value.expandedKeys.add(h), w("node-expand", d, d, null));
|
|
2862
2862
|
}
|
|
2863
|
-
function
|
|
2863
|
+
function te() {
|
|
2864
2864
|
const d = [];
|
|
2865
2865
|
function h(r) {
|
|
2866
2866
|
r.forEach((f) => {
|
|
2867
2867
|
d.push(f), g(f) && h(x(f));
|
|
2868
2868
|
});
|
|
2869
2869
|
}
|
|
2870
|
-
h(
|
|
2870
|
+
h(p.value);
|
|
2871
2871
|
function a(r) {
|
|
2872
2872
|
if (g(r)) {
|
|
2873
|
-
const f = x(r), b = C(r),
|
|
2874
|
-
(A) =>
|
|
2873
|
+
const f = x(r), b = C(r), M = f.filter((A) => V(A)), U = f.filter(
|
|
2874
|
+
(A) => I(A)
|
|
2875
2875
|
);
|
|
2876
|
-
|
|
2876
|
+
M.length === f.length && U.length === 0 || M.length > 0 || U.length > 0 ? y.value.checkedKeys.add(b) : y.value.checkedKeys.delete(b);
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
2879
|
for (let r = d.length - 1; r >= 0; r--)
|
|
@@ -2881,49 +2881,49 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2881
2881
|
}
|
|
2882
2882
|
function ue(d, h, a, r) {
|
|
2883
2883
|
if (n.disabled) return;
|
|
2884
|
-
const f = r ?
|
|
2884
|
+
const f = r ? X(d, r) : !1;
|
|
2885
2885
|
if (n.enableChildStyleCustomClick && f) {
|
|
2886
|
-
|
|
2886
|
+
w("child-node-click", d, h, a);
|
|
2887
2887
|
return;
|
|
2888
2888
|
}
|
|
2889
2889
|
if (n.expandOnClickNode && g(d)) {
|
|
2890
|
-
|
|
2890
|
+
j(d);
|
|
2891
2891
|
return;
|
|
2892
2892
|
}
|
|
2893
|
-
|
|
2893
|
+
y.value.currentNode = d, y.value.currentKey = C(d), n.showCheckbox && B(d), w("node-click", d, h, a);
|
|
2894
2894
|
}
|
|
2895
|
-
function
|
|
2896
|
-
n.disabled ||
|
|
2895
|
+
function ne(d, h, a, r) {
|
|
2896
|
+
n.disabled || w("node-contextmenu", d, h, a, r);
|
|
2897
2897
|
}
|
|
2898
|
-
|
|
2898
|
+
G(
|
|
2899
2899
|
() => n.defaultExpandedKeys,
|
|
2900
2900
|
(d) => {
|
|
2901
2901
|
if (d) {
|
|
2902
|
-
const h =
|
|
2902
|
+
const h = L.value;
|
|
2903
2903
|
if (h) {
|
|
2904
|
-
let a = function(
|
|
2905
|
-
for (const
|
|
2906
|
-
if (C(
|
|
2907
|
-
if (g(
|
|
2908
|
-
const we = a(
|
|
2904
|
+
let a = function(M, U, A = 1) {
|
|
2905
|
+
for (const P of U) {
|
|
2906
|
+
if (C(P) === M) return A;
|
|
2907
|
+
if (g(P)) {
|
|
2908
|
+
const we = a(M, x(P), A + 1);
|
|
2909
2909
|
if (we > 0) return we;
|
|
2910
2910
|
}
|
|
2911
2911
|
}
|
|
2912
2912
|
return 0;
|
|
2913
|
-
}, r = function(
|
|
2914
|
-
|
|
2915
|
-
|
|
2913
|
+
}, r = function(M, U, A) {
|
|
2914
|
+
M.forEach((P) => {
|
|
2915
|
+
U < A && g(P) ? (b.add(C(P)), r(x(P), U + 1, A)) : U < A && g(P);
|
|
2916
2916
|
});
|
|
2917
2917
|
};
|
|
2918
|
-
const f = (d || []).filter((
|
|
2919
|
-
const
|
|
2920
|
-
return
|
|
2918
|
+
const f = (d || []).filter((M) => {
|
|
2919
|
+
const U = a(M, p.value, 1);
|
|
2920
|
+
return U > 0 && U < h;
|
|
2921
2921
|
}), b = new Set(f);
|
|
2922
|
-
r(
|
|
2923
|
-
a(
|
|
2924
|
-
}),
|
|
2922
|
+
r(p.value, 1, h), y.value.expandedKeys.forEach((M) => {
|
|
2923
|
+
a(M, p.value, 1) >= h && b.add(M);
|
|
2924
|
+
}), y.value.expandedKeys = b;
|
|
2925
2925
|
} else
|
|
2926
|
-
|
|
2926
|
+
y.value.expandedKeys = new Set(d);
|
|
2927
2927
|
}
|
|
2928
2928
|
},
|
|
2929
2929
|
{ immediate: !0 }
|
|
@@ -2933,53 +2933,53 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2933
2933
|
let d = function(r, f = 1) {
|
|
2934
2934
|
r.forEach((b) => {
|
|
2935
2935
|
if (!g(b)) return;
|
|
2936
|
-
const
|
|
2936
|
+
const M = x(b);
|
|
2937
2937
|
if (a) {
|
|
2938
2938
|
if (f >= a) return;
|
|
2939
|
-
f + 1 === a || h.add(C(b)), d(
|
|
2939
|
+
f + 1 === a || h.add(C(b)), d(M, f + 1);
|
|
2940
2940
|
} else
|
|
2941
|
-
h.add(C(b)), d(
|
|
2941
|
+
h.add(C(b)), d(M, f + 1);
|
|
2942
2942
|
});
|
|
2943
2943
|
};
|
|
2944
|
-
const h = /* @__PURE__ */ new Set(), a =
|
|
2945
|
-
d(
|
|
2944
|
+
const h = /* @__PURE__ */ new Set(), a = L.value;
|
|
2945
|
+
d(p.value, 1), y.value.expandedKeys = h;
|
|
2946
2946
|
}
|
|
2947
2947
|
}
|
|
2948
2948
|
function pe() {
|
|
2949
2949
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
2950
2950
|
let d = function(f, b = []) {
|
|
2951
|
-
f.forEach((
|
|
2952
|
-
const
|
|
2953
|
-
h.has(
|
|
2951
|
+
f.forEach((M) => {
|
|
2952
|
+
const U = C(M), A = [...b, U];
|
|
2953
|
+
h.has(U) && b.forEach((P) => a.add(P)), g(M) && d(x(M), A);
|
|
2954
2954
|
});
|
|
2955
2955
|
};
|
|
2956
2956
|
const h = new Set(n.defaultCheckedKeys), a = /* @__PURE__ */ new Set();
|
|
2957
|
-
d(
|
|
2958
|
-
const r =
|
|
2957
|
+
d(p.value);
|
|
2958
|
+
const r = L.value;
|
|
2959
2959
|
if (r) {
|
|
2960
2960
|
console.log(
|
|
2961
2961
|
`已启用从第${r}级开始不默认展开:保持当前展开状态不变`
|
|
2962
2962
|
);
|
|
2963
2963
|
return;
|
|
2964
2964
|
}
|
|
2965
|
-
|
|
2965
|
+
y.value.expandedKeys = a;
|
|
2966
2966
|
}
|
|
2967
2967
|
}
|
|
2968
|
-
|
|
2968
|
+
G(() => n.defaultExpandAll, ve, { immediate: !0 }), G(() => p.value, ve, { deep: !0 }), G(
|
|
2969
2969
|
() => n.defaultCheckedKeys,
|
|
2970
2970
|
(d) => {
|
|
2971
|
-
d ? (
|
|
2971
|
+
d ? (y.value.checkedKeys = new Set(d), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : pe()) : y.value.checkedKeys.clear();
|
|
2972
2972
|
},
|
|
2973
2973
|
{ immediate: !0 }
|
|
2974
2974
|
);
|
|
2975
2975
|
function ye(d) {
|
|
2976
2976
|
try {
|
|
2977
|
-
let h = function(f, b,
|
|
2978
|
-
for (const
|
|
2979
|
-
const A = C(
|
|
2980
|
-
if (A === b) return
|
|
2981
|
-
if (g(
|
|
2982
|
-
const we = h(x(
|
|
2977
|
+
let h = function(f, b, M = []) {
|
|
2978
|
+
for (const U of f) {
|
|
2979
|
+
const A = C(U), P = [...M, A];
|
|
2980
|
+
if (A === b) return P;
|
|
2981
|
+
if (g(U)) {
|
|
2982
|
+
const we = h(x(U), b, P);
|
|
2983
2983
|
if (we) return we;
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
@@ -2987,47 +2987,47 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2987
2987
|
};
|
|
2988
2988
|
const a = Array.isArray(d) ? d : [];
|
|
2989
2989
|
if (a.length === 0) return;
|
|
2990
|
-
|
|
2991
|
-
const r = new Set(
|
|
2990
|
+
y.value.highlightedKeys.clear();
|
|
2991
|
+
const r = new Set(y.value.expandedKeys);
|
|
2992
2992
|
a.forEach((f) => {
|
|
2993
|
-
const b = h(
|
|
2994
|
-
b && b.length > 0 && (b.slice(0, -1).forEach((
|
|
2995
|
-
}),
|
|
2993
|
+
const b = h(p.value, f);
|
|
2994
|
+
b && b.length > 0 && (b.slice(0, -1).forEach((M) => r.add(M)), y.value.highlightedKeys.add(b[b.length - 1]));
|
|
2995
|
+
}), y.value.expandedKeys = r;
|
|
2996
2996
|
} catch (h) {
|
|
2997
2997
|
console.warn("highlightAndExpandByIds 执行失败", h);
|
|
2998
2998
|
}
|
|
2999
2999
|
}
|
|
3000
|
-
function
|
|
3001
|
-
|
|
3000
|
+
function F() {
|
|
3001
|
+
y.value.highlightedKeys.clear();
|
|
3002
3002
|
}
|
|
3003
3003
|
function Z() {
|
|
3004
|
-
|
|
3004
|
+
y.value.currentNode = null, y.value.currentKey = null;
|
|
3005
3005
|
}
|
|
3006
|
-
return $({ highlightAndExpandByIds: ye, clearHighlights:
|
|
3006
|
+
return $({ highlightAndExpandByIds: ye, clearHighlights: F, clearCurrentNode: Z }), G(
|
|
3007
3007
|
() => n.defaultSelectedKeys,
|
|
3008
3008
|
(d) => {
|
|
3009
|
-
d && (
|
|
3009
|
+
d && (y.value.selectedKeys = new Set(d));
|
|
3010
3010
|
},
|
|
3011
3011
|
{ immediate: !0 }
|
|
3012
3012
|
), (d, h) => (i(), u("div", {
|
|
3013
3013
|
class: E(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
3014
3014
|
}, [
|
|
3015
3015
|
o("div", xl, [
|
|
3016
|
-
(i(!0), u(
|
|
3016
|
+
(i(!0), u(ae, null, ce(p.value, (a) => (i(), u("div", {
|
|
3017
3017
|
key: C(a),
|
|
3018
|
-
class: E(["ytree-node", { "ytree-node--current":
|
|
3018
|
+
class: E(["ytree-node", { "ytree-node--current": z(a), "ytree-node--highlight": R(a) }])
|
|
3019
3019
|
}, [
|
|
3020
3020
|
o("div", {
|
|
3021
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3021
|
+
class: E(["ytree-node__content", { "is-child-style": X(a, a) }]),
|
|
3022
3022
|
style: { paddingLeft: "8px" },
|
|
3023
|
-
"data-level":
|
|
3023
|
+
"data-level": N(a, a),
|
|
3024
3024
|
onClick: (r) => ue(a, a, null, a),
|
|
3025
|
-
onContextmenu: (r) =>
|
|
3025
|
+
onContextmenu: (r) => ne(r, a, a, null)
|
|
3026
3026
|
}, [
|
|
3027
3027
|
g(a) ? (i(), u("span", {
|
|
3028
3028
|
key: 0,
|
|
3029
|
-
class: E(["ytree-node__expand-icon", { "is-expanded":
|
|
3030
|
-
onClick:
|
|
3029
|
+
class: E(["ytree-node__expand-icon", { "is-expanded": Y(a) }]),
|
|
3030
|
+
onClick: J((r) => j(a), ["stop"])
|
|
3031
3031
|
}, [...h[0] || (h[0] = [
|
|
3032
3032
|
o("svg", {
|
|
3033
3033
|
width: "12",
|
|
@@ -3047,12 +3047,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3047
3047
|
e.showCheckbox ? (i(), u("span", {
|
|
3048
3048
|
key: 2,
|
|
3049
3049
|
class: E(["ytree-node__checkbox", {
|
|
3050
|
-
"is-checked":
|
|
3051
|
-
"is-indeterminate":
|
|
3050
|
+
"is-checked": V(a),
|
|
3051
|
+
"is-indeterminate": I(a)
|
|
3052
3052
|
}]),
|
|
3053
|
-
onClick:
|
|
3053
|
+
onClick: J((r) => B(a), ["stop"])
|
|
3054
3054
|
}, [
|
|
3055
|
-
|
|
3055
|
+
V(a) ? (i(), u("svg", Sl, [...h[1] || (h[1] = [
|
|
3056
3056
|
o("path", {
|
|
3057
3057
|
d: "M2 6L4.5 8.5L10 3",
|
|
3058
3058
|
stroke: "currentColor",
|
|
@@ -3060,7 +3060,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3060
3060
|
"stroke-linecap": "round",
|
|
3061
3061
|
"stroke-linejoin": "round"
|
|
3062
3062
|
}, null, -1)
|
|
3063
|
-
])])) :
|
|
3063
|
+
])])) : I(a) ? (i(), u("svg", Ml, [...h[2] || (h[2] = [
|
|
3064
3064
|
o("path", {
|
|
3065
3065
|
d: "M2 6L10 6",
|
|
3066
3066
|
stroke: "currentColor",
|
|
@@ -3075,39 +3075,39 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3075
3075
|
}, null, 2)) : W("", !0),
|
|
3076
3076
|
o("img", {
|
|
3077
3077
|
class: "ytree-node__avatar",
|
|
3078
|
-
src:
|
|
3078
|
+
src: m(a, a),
|
|
3079
3079
|
alt: k(a) ? "person" : "dept"
|
|
3080
3080
|
}, null, 8, Ll),
|
|
3081
3081
|
o("span", {
|
|
3082
3082
|
class: E(["ytree-node__label", { "is-employee": k(a) }])
|
|
3083
|
-
},
|
|
3083
|
+
}, ee(T(a)), 3),
|
|
3084
3084
|
o("div", Il, [
|
|
3085
|
-
|
|
3085
|
+
se(d.$slots, "node-content", {
|
|
3086
3086
|
node: a,
|
|
3087
|
-
isCurrent:
|
|
3088
|
-
isExpanded:
|
|
3087
|
+
isCurrent: z(a),
|
|
3088
|
+
isExpanded: Y(a),
|
|
3089
3089
|
hasChildren: g(a)
|
|
3090
3090
|
}, void 0, !0)
|
|
3091
3091
|
])
|
|
3092
3092
|
], 42, $l),
|
|
3093
|
-
|
|
3093
|
+
ie(xe, { name: "ytree-node" }, {
|
|
3094
3094
|
default: re(() => [
|
|
3095
|
-
g(a) &&
|
|
3096
|
-
(i(!0), u(
|
|
3095
|
+
g(a) && Y(a) ? (i(), u("div", Bl, [
|
|
3096
|
+
(i(!0), u(ae, null, ce(x(a), (r) => (i(), u("div", {
|
|
3097
3097
|
key: C(r),
|
|
3098
|
-
class: E(["ytree-node", { "ytree-node--current":
|
|
3098
|
+
class: E(["ytree-node", { "ytree-node--current": z(r), "ytree-node--highlight": R(r) }])
|
|
3099
3099
|
}, [
|
|
3100
3100
|
o("div", {
|
|
3101
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3101
|
+
class: E(["ytree-node__content", { "is-child-style": X(r, a) }]),
|
|
3102
3102
|
style: { paddingLeft: "22px" },
|
|
3103
|
-
"data-level":
|
|
3103
|
+
"data-level": N(a, r),
|
|
3104
3104
|
onClick: (f) => ue(r, r, null, a),
|
|
3105
|
-
onContextmenu: (f) =>
|
|
3105
|
+
onContextmenu: (f) => ne(f, r, r, null)
|
|
3106
3106
|
}, [
|
|
3107
3107
|
g(r) ? (i(), u("span", {
|
|
3108
3108
|
key: 0,
|
|
3109
|
-
class: E(["ytree-node__expand-icon", { "is-expanded":
|
|
3110
|
-
onClick:
|
|
3109
|
+
class: E(["ytree-node__expand-icon", { "is-expanded": Y(r) }]),
|
|
3110
|
+
onClick: J((f) => j(r), ["stop"])
|
|
3111
3111
|
}, [...h[3] || (h[3] = [
|
|
3112
3112
|
o("svg", {
|
|
3113
3113
|
width: "12",
|
|
@@ -3127,12 +3127,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3127
3127
|
e.showCheckbox ? (i(), u("span", {
|
|
3128
3128
|
key: 2,
|
|
3129
3129
|
class: E(["ytree-node__checkbox", {
|
|
3130
|
-
"is-checked":
|
|
3131
|
-
"is-indeterminate":
|
|
3130
|
+
"is-checked": V(r),
|
|
3131
|
+
"is-indeterminate": I(r)
|
|
3132
3132
|
}]),
|
|
3133
|
-
onClick:
|
|
3133
|
+
onClick: J((f) => B(r), ["stop"])
|
|
3134
3134
|
}, [
|
|
3135
|
-
|
|
3135
|
+
V(r) ? (i(), u("svg", Hl, [...h[4] || (h[4] = [
|
|
3136
3136
|
o("path", {
|
|
3137
3137
|
d: "M2 6L4.5 8.5L10 3",
|
|
3138
3138
|
stroke: "currentColor",
|
|
@@ -3140,7 +3140,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3140
3140
|
"stroke-linecap": "round",
|
|
3141
3141
|
"stroke-linejoin": "round"
|
|
3142
3142
|
}, null, -1)
|
|
3143
|
-
])])) :
|
|
3143
|
+
])])) : I(r) ? (i(), u("svg", Wl, [...h[5] || (h[5] = [
|
|
3144
3144
|
o("path", {
|
|
3145
3145
|
d: "M2 6L10 6",
|
|
3146
3146
|
stroke: "currentColor",
|
|
@@ -3155,37 +3155,37 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3155
3155
|
}, null, 2)) : W("", !0),
|
|
3156
3156
|
o("img", {
|
|
3157
3157
|
class: "ytree-node__avatar",
|
|
3158
|
-
src:
|
|
3158
|
+
src: m(r, a),
|
|
3159
3159
|
alt: k(r) ? "person" : "dept"
|
|
3160
3160
|
}, null, 8, Rl),
|
|
3161
3161
|
o("span", {
|
|
3162
3162
|
class: E(["ytree-node__label", { "is-employee": k(r) }])
|
|
3163
|
-
},
|
|
3163
|
+
}, ee(T(r)), 3),
|
|
3164
3164
|
o("div", Al, [
|
|
3165
|
-
|
|
3165
|
+
se(d.$slots, "node-content", {
|
|
3166
3166
|
node: r,
|
|
3167
|
-
isCurrent:
|
|
3168
|
-
isExpanded:
|
|
3167
|
+
isCurrent: z(r),
|
|
3168
|
+
isExpanded: Y(r),
|
|
3169
3169
|
hasChildren: g(r)
|
|
3170
3170
|
}, void 0, !0)
|
|
3171
3171
|
])
|
|
3172
3172
|
], 42, El),
|
|
3173
|
-
|
|
3173
|
+
ie(xe, { name: "ytree-node" }, {
|
|
3174
3174
|
default: re(() => [
|
|
3175
|
-
g(r) &&
|
|
3176
|
-
(i(!0), u(
|
|
3175
|
+
g(r) && Y(r) ? (i(), u("div", Vl, [
|
|
3176
|
+
(i(!0), u(ae, null, ce(x(r), (f) => (i(), u("div", {
|
|
3177
3177
|
key: C(f),
|
|
3178
3178
|
class: E(["ytree-node", {
|
|
3179
|
-
"ytree-node--current":
|
|
3179
|
+
"ytree-node--current": z(f),
|
|
3180
3180
|
"ytree-node--highlight": R(f)
|
|
3181
3181
|
}])
|
|
3182
3182
|
}, [
|
|
3183
3183
|
o("div", {
|
|
3184
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3184
|
+
class: E(["ytree-node__content", { "is-child-style": X(f, a) }]),
|
|
3185
3185
|
style: { paddingLeft: "38px" },
|
|
3186
|
-
"data-level":
|
|
3186
|
+
"data-level": N(a, f),
|
|
3187
3187
|
onClick: (b) => ue(f, f, null, a),
|
|
3188
|
-
onContextmenu: (b) =>
|
|
3188
|
+
onContextmenu: (b) => ne(
|
|
3189
3189
|
b,
|
|
3190
3190
|
f,
|
|
3191
3191
|
f,
|
|
@@ -3194,8 +3194,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3194
3194
|
}, [
|
|
3195
3195
|
g(f) ? (i(), u("span", {
|
|
3196
3196
|
key: 0,
|
|
3197
|
-
class: E(["ytree-node__expand-icon", { "is-expanded":
|
|
3198
|
-
onClick:
|
|
3197
|
+
class: E(["ytree-node__expand-icon", { "is-expanded": Y(f) }]),
|
|
3198
|
+
onClick: J((b) => j(f), ["stop"])
|
|
3199
3199
|
}, [...h[6] || (h[6] = [
|
|
3200
3200
|
o("svg", {
|
|
3201
3201
|
width: "12",
|
|
@@ -3215,12 +3215,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3215
3215
|
e.showCheckbox ? (i(), u("span", {
|
|
3216
3216
|
key: 2,
|
|
3217
3217
|
class: E(["ytree-node__checkbox", {
|
|
3218
|
-
"is-checked":
|
|
3219
|
-
"is-indeterminate":
|
|
3218
|
+
"is-checked": V(f),
|
|
3219
|
+
"is-indeterminate": I(f)
|
|
3220
3220
|
}]),
|
|
3221
|
-
onClick:
|
|
3221
|
+
onClick: J((b) => B(f), ["stop"])
|
|
3222
3222
|
}, [
|
|
3223
|
-
|
|
3223
|
+
V(f) ? (i(), u("svg", Ol, [...h[7] || (h[7] = [
|
|
3224
3224
|
o("path", {
|
|
3225
3225
|
d: "M2 6L4.5 8.5L10 3",
|
|
3226
3226
|
stroke: "currentColor",
|
|
@@ -3228,7 +3228,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3228
3228
|
"stroke-linecap": "round",
|
|
3229
3229
|
"stroke-linejoin": "round"
|
|
3230
3230
|
}, null, -1)
|
|
3231
|
-
])])) :
|
|
3231
|
+
])])) : I(f) ? (i(), u("svg", jl, [...h[8] || (h[8] = [
|
|
3232
3232
|
o("path", {
|
|
3233
3233
|
d: "M2 6L10 6",
|
|
3234
3234
|
stroke: "currentColor",
|
|
@@ -3243,45 +3243,45 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3243
3243
|
}, null, 2)) : W("", !0),
|
|
3244
3244
|
o("img", {
|
|
3245
3245
|
class: "ytree-node__avatar",
|
|
3246
|
-
src:
|
|
3246
|
+
src: m(f, a),
|
|
3247
3247
|
alt: k(f) ? "person" : "dept"
|
|
3248
3248
|
}, null, 8, ql),
|
|
3249
3249
|
o("span", {
|
|
3250
3250
|
class: E(["ytree-node__label", { "is-employee": k(f) }])
|
|
3251
|
-
},
|
|
3251
|
+
}, ee(T(f)), 3),
|
|
3252
3252
|
o("div", Ul, [
|
|
3253
|
-
|
|
3253
|
+
se(d.$slots, "node-content", {
|
|
3254
3254
|
node: f,
|
|
3255
|
-
isCurrent:
|
|
3256
|
-
isExpanded:
|
|
3255
|
+
isCurrent: z(f),
|
|
3256
|
+
isExpanded: Y(f),
|
|
3257
3257
|
hasChildren: g(f)
|
|
3258
3258
|
}, void 0, !0)
|
|
3259
3259
|
])
|
|
3260
3260
|
], 42, Fl),
|
|
3261
|
-
|
|
3261
|
+
ie(xe, { name: "ytree-node" }, {
|
|
3262
3262
|
default: re(() => [
|
|
3263
|
-
g(f) &&
|
|
3264
|
-
(i(!0), u(
|
|
3263
|
+
g(f) && Y(f) ? (i(), u("div", Zl, [
|
|
3264
|
+
(i(!0), u(ae, null, ce(x(f), (b) => (i(), u("div", {
|
|
3265
3265
|
key: C(b),
|
|
3266
3266
|
class: E(["ytree-node", {
|
|
3267
|
-
"ytree-node--current":
|
|
3267
|
+
"ytree-node--current": z(b),
|
|
3268
3268
|
"ytree-node--highlight": R(b)
|
|
3269
3269
|
}])
|
|
3270
3270
|
}, [
|
|
3271
3271
|
o("div", {
|
|
3272
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3272
|
+
class: E(["ytree-node__content", { "is-child-style": X(b, a) }]),
|
|
3273
3273
|
style: {
|
|
3274
3274
|
paddingLeft: "54px"
|
|
3275
3275
|
},
|
|
3276
|
-
"data-level":
|
|
3277
|
-
onClick: (
|
|
3276
|
+
"data-level": N(a, b),
|
|
3277
|
+
onClick: (M) => ue(
|
|
3278
3278
|
b,
|
|
3279
3279
|
b,
|
|
3280
3280
|
null,
|
|
3281
3281
|
a
|
|
3282
3282
|
),
|
|
3283
|
-
onContextmenu: (
|
|
3284
|
-
|
|
3283
|
+
onContextmenu: (M) => ne(
|
|
3284
|
+
M,
|
|
3285
3285
|
b,
|
|
3286
3286
|
b,
|
|
3287
3287
|
null
|
|
@@ -3290,9 +3290,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3290
3290
|
g(b) ? (i(), u("span", {
|
|
3291
3291
|
key: 0,
|
|
3292
3292
|
class: E(["ytree-node__expand-icon", {
|
|
3293
|
-
"is-expanded":
|
|
3293
|
+
"is-expanded": Y(b)
|
|
3294
3294
|
}]),
|
|
3295
|
-
onClick:
|
|
3295
|
+
onClick: J((M) => j(b), ["stop"])
|
|
3296
3296
|
}, [...h[9] || (h[9] = [
|
|
3297
3297
|
o("svg", {
|
|
3298
3298
|
width: "12",
|
|
@@ -3312,12 +3312,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3312
3312
|
e.showCheckbox ? (i(), u("span", {
|
|
3313
3313
|
key: 2,
|
|
3314
3314
|
class: E(["ytree-node__checkbox", {
|
|
3315
|
-
"is-checked":
|
|
3316
|
-
"is-indeterminate":
|
|
3315
|
+
"is-checked": V(b),
|
|
3316
|
+
"is-indeterminate": I(b)
|
|
3317
3317
|
}]),
|
|
3318
|
-
onClick:
|
|
3318
|
+
onClick: J((M) => B(b), ["stop"])
|
|
3319
3319
|
}, [
|
|
3320
|
-
|
|
3320
|
+
V(b) ? (i(), u("svg", eo, [...h[10] || (h[10] = [
|
|
3321
3321
|
o("path", {
|
|
3322
3322
|
d: "M2 6L4.5 8.5L10 3",
|
|
3323
3323
|
stroke: "currentColor",
|
|
@@ -3325,7 +3325,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3325
3325
|
"stroke-linecap": "round",
|
|
3326
3326
|
"stroke-linejoin": "round"
|
|
3327
3327
|
}, null, -1)
|
|
3328
|
-
])])) :
|
|
3328
|
+
])])) : I(b) ? (i(), u("svg", to, [...h[11] || (h[11] = [
|
|
3329
3329
|
o("path", {
|
|
3330
3330
|
d: "M2 6L10 6",
|
|
3331
3331
|
stroke: "currentColor",
|
|
@@ -3340,59 +3340,59 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3340
3340
|
}, null, 2)) : W("", !0),
|
|
3341
3341
|
o("img", {
|
|
3342
3342
|
class: "ytree-node__avatar",
|
|
3343
|
-
src:
|
|
3343
|
+
src: m(b, a),
|
|
3344
3344
|
alt: k(b) ? "person" : "dept"
|
|
3345
3345
|
}, null, 8, no),
|
|
3346
3346
|
o("span", {
|
|
3347
3347
|
class: E(["ytree-node__label", {
|
|
3348
3348
|
"is-employee": k(b)
|
|
3349
3349
|
}])
|
|
3350
|
-
},
|
|
3350
|
+
}, ee(T(b)), 3),
|
|
3351
3351
|
o("div", lo, [
|
|
3352
|
-
|
|
3352
|
+
se(d.$slots, "node-content", {
|
|
3353
3353
|
node: b,
|
|
3354
|
-
isCurrent:
|
|
3355
|
-
isExpanded:
|
|
3354
|
+
isCurrent: z(b),
|
|
3355
|
+
isExpanded: Y(b),
|
|
3356
3356
|
hasChildren: g(b)
|
|
3357
3357
|
}, void 0, !0)
|
|
3358
3358
|
])
|
|
3359
3359
|
], 42, Ql),
|
|
3360
|
-
|
|
3360
|
+
ie(xe, { name: "ytree-node" }, {
|
|
3361
3361
|
default: re(() => [
|
|
3362
|
-
g(b) &&
|
|
3363
|
-
(i(!0), u(
|
|
3362
|
+
g(b) && Y(b) ? (i(), u("div", oo, [
|
|
3363
|
+
(i(!0), u(ae, null, ce(x(
|
|
3364
3364
|
b
|
|
3365
|
-
), (
|
|
3366
|
-
key: C(
|
|
3365
|
+
), (M) => (i(), u("div", {
|
|
3366
|
+
key: C(M),
|
|
3367
3367
|
class: E(["ytree-node", {
|
|
3368
|
-
"ytree-node--current":
|
|
3368
|
+
"ytree-node--current": z(M)
|
|
3369
3369
|
}])
|
|
3370
3370
|
}, [
|
|
3371
3371
|
o("div", {
|
|
3372
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3372
|
+
class: E(["ytree-node__content", { "is-child-style": X(M, a) }]),
|
|
3373
3373
|
style: {
|
|
3374
3374
|
paddingLeft: "70px"
|
|
3375
3375
|
},
|
|
3376
|
-
"data-level":
|
|
3377
|
-
onClick: (
|
|
3378
|
-
|
|
3379
|
-
|
|
3376
|
+
"data-level": N(a, M),
|
|
3377
|
+
onClick: (U) => ue(
|
|
3378
|
+
M,
|
|
3379
|
+
M,
|
|
3380
3380
|
null,
|
|
3381
3381
|
a
|
|
3382
3382
|
),
|
|
3383
|
-
onContextmenu: (
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3383
|
+
onContextmenu: (U) => ne(
|
|
3384
|
+
U,
|
|
3385
|
+
M,
|
|
3386
|
+
M,
|
|
3387
3387
|
null
|
|
3388
3388
|
)
|
|
3389
3389
|
}, [
|
|
3390
|
-
g(
|
|
3390
|
+
g(M) ? (i(), u("span", {
|
|
3391
3391
|
key: 0,
|
|
3392
3392
|
class: E(["ytree-node__expand-icon", {
|
|
3393
|
-
"is-expanded":
|
|
3393
|
+
"is-expanded": Y(M)
|
|
3394
3394
|
}]),
|
|
3395
|
-
onClick:
|
|
3395
|
+
onClick: J((U) => j(M), ["stop"])
|
|
3396
3396
|
}, [...h[12] || (h[12] = [
|
|
3397
3397
|
o("svg", {
|
|
3398
3398
|
width: "12",
|
|
@@ -3412,14 +3412,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3412
3412
|
e.showCheckbox ? (i(), u("span", {
|
|
3413
3413
|
key: 2,
|
|
3414
3414
|
class: E(["ytree-node__checkbox", {
|
|
3415
|
-
"is-checked":
|
|
3416
|
-
"is-indeterminate":
|
|
3417
|
-
|
|
3415
|
+
"is-checked": V(M),
|
|
3416
|
+
"is-indeterminate": I(
|
|
3417
|
+
M
|
|
3418
3418
|
)
|
|
3419
3419
|
}]),
|
|
3420
|
-
onClick:
|
|
3420
|
+
onClick: J((U) => B(M), ["stop"])
|
|
3421
3421
|
}, [
|
|
3422
|
-
|
|
3422
|
+
V(M) ? (i(), u("svg", uo, [...h[13] || (h[13] = [
|
|
3423
3423
|
o("path", {
|
|
3424
3424
|
d: "M2 6L4.5 8.5L10 3",
|
|
3425
3425
|
stroke: "currentColor",
|
|
@@ -3427,8 +3427,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3427
3427
|
"stroke-linecap": "round",
|
|
3428
3428
|
"stroke-linejoin": "round"
|
|
3429
3429
|
}, null, -1)
|
|
3430
|
-
])])) :
|
|
3431
|
-
|
|
3430
|
+
])])) : I(
|
|
3431
|
+
M
|
|
3432
3432
|
) ? (i(), u("svg", co, [...h[14] || (h[14] = [
|
|
3433
3433
|
o("path", {
|
|
3434
3434
|
d: "M2 6L10 6",
|
|
@@ -3444,20 +3444,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3444
3444
|
}, null, 2)) : W("", !0),
|
|
3445
3445
|
o("img", {
|
|
3446
3446
|
class: "ytree-node__avatar",
|
|
3447
|
-
src:
|
|
3448
|
-
alt: k(
|
|
3447
|
+
src: m(M, a),
|
|
3448
|
+
alt: k(M) ? "person" : "dept"
|
|
3449
3449
|
}, null, 8, fo),
|
|
3450
3450
|
o("span", {
|
|
3451
3451
|
class: E(["ytree-node__label", {
|
|
3452
|
-
"is-employee": k(
|
|
3452
|
+
"is-employee": k(M)
|
|
3453
3453
|
}])
|
|
3454
|
-
},
|
|
3454
|
+
}, ee(T(M)), 3),
|
|
3455
3455
|
o("div", vo, [
|
|
3456
|
-
|
|
3457
|
-
node:
|
|
3458
|
-
isCurrent:
|
|
3459
|
-
isExpanded:
|
|
3460
|
-
hasChildren: g(
|
|
3456
|
+
se(d.$slots, "node-content", {
|
|
3457
|
+
node: M,
|
|
3458
|
+
isCurrent: z(M),
|
|
3459
|
+
isExpanded: Y(M),
|
|
3460
|
+
hasChildren: g(M)
|
|
3461
3461
|
}, void 0, !0)
|
|
3462
3462
|
])
|
|
3463
3463
|
], 42, ao)
|
|
@@ -3502,9 +3502,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3502
3502
|
},
|
|
3503
3503
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3504
3504
|
setup(e, { emit: $ }) {
|
|
3505
|
-
const t = e, n = $,
|
|
3506
|
-
function
|
|
3507
|
-
switch (
|
|
3505
|
+
const t = e, n = $, w = K(!1), p = at({}), y = K({}), L = O(() => t.fields.filter((I) => !I.hidden)), C = O(() => w.value ? L.value : L.value.slice(0, t.maxVisibleFields)), T = O(() => L.value.length > t.maxVisibleFields);
|
|
3506
|
+
function k(I) {
|
|
3507
|
+
switch (I) {
|
|
3508
3508
|
case "select":
|
|
3509
3509
|
return et;
|
|
3510
3510
|
case "date":
|
|
@@ -3515,115 +3515,122 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3515
3515
|
return Ge;
|
|
3516
3516
|
}
|
|
3517
3517
|
}
|
|
3518
|
-
function
|
|
3519
|
-
n("field-change",
|
|
3520
|
-
}
|
|
3521
|
-
function w() {
|
|
3522
|
-
const D = P(y), z = J(D);
|
|
3523
|
-
n("search", { data: z });
|
|
3518
|
+
function m(I) {
|
|
3519
|
+
n("field-change", I, p[I.key]), n("update:modelValue", { ...p });
|
|
3524
3520
|
}
|
|
3525
3521
|
function g() {
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
(z == null ? void 0 : z.type) === "daterange" ? y[D] = { startDate: null, endDate: null } : (z == null ? void 0 : z.type) === "date" ? y[D] = null : y[D] = "";
|
|
3529
|
-
}), n("reset"), n("update:modelValue", { ...y });
|
|
3522
|
+
const I = X(p), z = Y(I);
|
|
3523
|
+
n("search", { data: z });
|
|
3530
3524
|
}
|
|
3531
3525
|
function x() {
|
|
3532
|
-
|
|
3526
|
+
Object.keys(p).forEach((I) => {
|
|
3527
|
+
const z = t.fields.find((R) => R.key === I);
|
|
3528
|
+
(z == null ? void 0 : z.type) === "daterange" ? p[I] = { startDate: null, endDate: null } : (z == null ? void 0 : z.type) === "date" ? p[I] = null : p[I] = "";
|
|
3529
|
+
}), n("reset"), n("update:modelValue", { ...p });
|
|
3530
|
+
}
|
|
3531
|
+
function N() {
|
|
3532
|
+
w.value = !w.value;
|
|
3533
3533
|
}
|
|
3534
|
-
function
|
|
3534
|
+
function X(I) {
|
|
3535
3535
|
const z = {};
|
|
3536
|
-
return Object.keys(
|
|
3537
|
-
const
|
|
3538
|
-
if (!(
|
|
3539
|
-
if ((
|
|
3540
|
-
const
|
|
3541
|
-
|
|
3536
|
+
return Object.keys(I).forEach((R) => {
|
|
3537
|
+
const B = I[R], Q = t.fields.find((j) => j.key === R);
|
|
3538
|
+
if (!(B == null || B === "")) {
|
|
3539
|
+
if ((Q == null ? void 0 : Q.type) === "daterange") {
|
|
3540
|
+
const j = (B == null ? void 0 : B.startDate) && B.startDate !== 0, te = (B == null ? void 0 : B.endDate) && B.endDate !== 0;
|
|
3541
|
+
j && te && (z[R] = B);
|
|
3542
3542
|
return;
|
|
3543
3543
|
}
|
|
3544
|
-
if ((
|
|
3545
|
-
|
|
3544
|
+
if ((Q == null ? void 0 : Q.type) === "date") {
|
|
3545
|
+
B !== 0 && (z[R] = B);
|
|
3546
3546
|
return;
|
|
3547
3547
|
}
|
|
3548
|
-
z[
|
|
3548
|
+
z[R] = B;
|
|
3549
3549
|
}
|
|
3550
3550
|
}), z;
|
|
3551
3551
|
}
|
|
3552
|
-
function
|
|
3552
|
+
function Y(I) {
|
|
3553
3553
|
const z = {};
|
|
3554
|
-
return Object.keys(
|
|
3555
|
-
const
|
|
3556
|
-
if (
|
|
3557
|
-
if (
|
|
3558
|
-
const
|
|
3559
|
-
|
|
3560
|
-
} else
|
|
3554
|
+
return Object.keys(I).forEach((R) => {
|
|
3555
|
+
const B = I[R], Q = t.fields.find((j) => j.key === R);
|
|
3556
|
+
if (Q)
|
|
3557
|
+
if (Q.type === "daterange" && typeof B == "object") {
|
|
3558
|
+
const j = Q.startKey || `${R}Start`, te = Q.endKey || `${R}End`;
|
|
3559
|
+
B.startDate && B.endDate && B.startDate !== 0 && B.endDate !== 0 && (Q.format === "timestamp" ? (z[j] = new Date(B.startDate).getTime(), z[te] = new Date(B.endDate).getTime()) : (z[j] = B.startDate, z[te] = B.endDate));
|
|
3560
|
+
} else Q.type === "date" && B && B !== 0 && Q.format === "timestamp" ? z[R] = new Date(B).getTime() : z[R] = B;
|
|
3561
3561
|
else
|
|
3562
|
-
z[
|
|
3562
|
+
z[R] = B;
|
|
3563
3563
|
}), z;
|
|
3564
3564
|
}
|
|
3565
|
-
function
|
|
3566
|
-
t.fields.forEach((
|
|
3567
|
-
var z,
|
|
3568
|
-
|
|
3565
|
+
function V() {
|
|
3566
|
+
t.fields.forEach((I) => {
|
|
3567
|
+
var z, R, B;
|
|
3568
|
+
p[I.key] === void 0 && (I.type === "daterange" ? p[I.key] = ((z = t.modelValue) == null ? void 0 : z[I.key]) || {
|
|
3569
3569
|
startDate: null,
|
|
3570
3570
|
endDate: null
|
|
3571
|
-
} :
|
|
3571
|
+
} : I.type === "date" ? p[I.key] = ((R = t.modelValue) == null ? void 0 : R[I.key]) || null : p[I.key] = ((B = t.modelValue) == null ? void 0 : B[I.key]) || "");
|
|
3572
3572
|
});
|
|
3573
3573
|
}
|
|
3574
|
-
return
|
|
3574
|
+
return G(
|
|
3575
3575
|
() => t.modelValue,
|
|
3576
|
-
(
|
|
3577
|
-
|
|
3576
|
+
(I) => {
|
|
3577
|
+
I && (Object.assign(p, I), y.value = { ...I });
|
|
3578
3578
|
},
|
|
3579
3579
|
{ deep: !0, immediate: !0 }
|
|
3580
|
+
), G(
|
|
3581
|
+
p,
|
|
3582
|
+
(I) => {
|
|
3583
|
+
const z = { ...I };
|
|
3584
|
+
n("update:modelValue", z), y.value = z;
|
|
3585
|
+
},
|
|
3586
|
+
{ deep: !0 }
|
|
3580
3587
|
), Ce(() => {
|
|
3581
|
-
|
|
3582
|
-
}), (
|
|
3588
|
+
V();
|
|
3589
|
+
}), (I, z) => (i(), u("div", mo, [
|
|
3583
3590
|
o("div", wo, [
|
|
3584
3591
|
o("div", bo, [
|
|
3585
3592
|
o("div", ko, [
|
|
3586
|
-
|
|
3593
|
+
ie(st, {
|
|
3587
3594
|
name: "qf",
|
|
3588
3595
|
tag: "div",
|
|
3589
3596
|
class: "query-encapsulation__fields-group"
|
|
3590
3597
|
}, {
|
|
3591
3598
|
default: re(() => [
|
|
3592
|
-
(i(!0), u(
|
|
3593
|
-
key:
|
|
3599
|
+
(i(!0), u(ae, null, ce(C.value, (R) => (i(), u("div", {
|
|
3600
|
+
key: R.key,
|
|
3594
3601
|
class: "query-encapsulation__field-item"
|
|
3595
3602
|
}, [
|
|
3596
3603
|
o("div", xo, [
|
|
3597
|
-
e.Iflabel ? (i(), u("label", $o,
|
|
3598
|
-
(i(), Me(it(
|
|
3599
|
-
modelValue:
|
|
3600
|
-
"onUpdate:modelValue": (
|
|
3601
|
-
placeholder:
|
|
3602
|
-
options:
|
|
3603
|
-
clearable:
|
|
3604
|
-
size:
|
|
3605
|
-
width:
|
|
3606
|
-
format:
|
|
3607
|
-
"include-time":
|
|
3608
|
-
filterable:
|
|
3609
|
-
onInput: (
|
|
3610
|
-
onChange: (
|
|
3604
|
+
e.Iflabel ? (i(), u("label", $o, ee(R.label), 1)) : W("", !0),
|
|
3605
|
+
(i(), Me(it(k(R.type)), {
|
|
3606
|
+
modelValue: p[R.key],
|
|
3607
|
+
"onUpdate:modelValue": (B) => p[R.key] = B,
|
|
3608
|
+
placeholder: R.placeholder || `请输入${R.label}`,
|
|
3609
|
+
options: R.options,
|
|
3610
|
+
clearable: R.clearable !== !1,
|
|
3611
|
+
size: R.size || "small",
|
|
3612
|
+
width: R.width || "180px",
|
|
3613
|
+
format: R.format || "timestamp",
|
|
3614
|
+
"include-time": R.includeTime || !1,
|
|
3615
|
+
filterable: R.filterable === !0,
|
|
3616
|
+
onInput: (B) => m(R),
|
|
3617
|
+
onChange: (B) => m(R)
|
|
3611
3618
|
}, null, 40, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3612
3619
|
])
|
|
3613
3620
|
]))), 128))
|
|
3614
3621
|
]),
|
|
3615
3622
|
_: 1
|
|
3616
3623
|
}),
|
|
3617
|
-
|
|
3618
|
-
|
|
3624
|
+
T.value ? (i(), u("div", Co, [
|
|
3625
|
+
ie(Ne, {
|
|
3619
3626
|
variant: "secondary",
|
|
3620
3627
|
size: "small",
|
|
3621
|
-
onClick:
|
|
3628
|
+
onClick: N
|
|
3622
3629
|
}, {
|
|
3623
3630
|
default: re(() => [
|
|
3624
|
-
$e(
|
|
3631
|
+
$e(ee(w.value ? "收起" : "展开") + " ", 1),
|
|
3625
3632
|
o("span", {
|
|
3626
|
-
class: E(["query-encapsulation__toggle-icon", { "is-expanded":
|
|
3633
|
+
class: E(["query-encapsulation__toggle-icon", { "is-expanded": w.value }])
|
|
3627
3634
|
}, "▼", 2)
|
|
3628
3635
|
]),
|
|
3629
3636
|
_: 1
|
|
@@ -3631,10 +3638,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3631
3638
|
])) : W("", !0),
|
|
3632
3639
|
o("div", Do, [
|
|
3633
3640
|
o("div", _o, [
|
|
3634
|
-
|
|
3641
|
+
ie(Ne, {
|
|
3635
3642
|
variant: "primary",
|
|
3636
3643
|
size: "small",
|
|
3637
|
-
onClick:
|
|
3644
|
+
onClick: g,
|
|
3638
3645
|
loading: e.loading
|
|
3639
3646
|
}, {
|
|
3640
3647
|
default: re(() => [...z[0] || (z[0] = [
|
|
@@ -3642,10 +3649,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3642
3649
|
])]),
|
|
3643
3650
|
_: 1
|
|
3644
3651
|
}, 8, ["loading"]),
|
|
3645
|
-
|
|
3652
|
+
ie(Ne, {
|
|
3646
3653
|
variant: "secondary",
|
|
3647
3654
|
size: "small",
|
|
3648
|
-
onClick:
|
|
3655
|
+
onClick: x,
|
|
3649
3656
|
loading: e.loading
|
|
3650
3657
|
}, {
|
|
3651
3658
|
default: re(() => [...z[1] || (z[1] = [
|
|
@@ -3653,7 +3660,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3653
3660
|
])]),
|
|
3654
3661
|
_: 1
|
|
3655
3662
|
}, 8, ["loading"]),
|
|
3656
|
-
|
|
3663
|
+
se(I.$slots, "extra-actions", {}, void 0, !0)
|
|
3657
3664
|
])
|
|
3658
3665
|
])
|
|
3659
3666
|
])
|
|
@@ -3661,7 +3668,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3661
3668
|
])
|
|
3662
3669
|
]));
|
|
3663
3670
|
}
|
|
3664
|
-
}), Mo = /* @__PURE__ */ me(So, [["__scopeId", "data-v-
|
|
3671
|
+
}), Mo = /* @__PURE__ */ me(So, [["__scopeId", "data-v-b48a49a0"]]), Lo = {
|
|
3665
3672
|
key: 0,
|
|
3666
3673
|
width: "16",
|
|
3667
3674
|
height: "16",
|
|
@@ -3696,21 +3703,21 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3696
3703
|
let n;
|
|
3697
3704
|
Ce(() => {
|
|
3698
3705
|
requestAnimationFrame(() => {
|
|
3699
|
-
t.value = !0, $.duration && $.duration > 0 && (n = window.setTimeout(() =>
|
|
3706
|
+
t.value = !0, $.duration && $.duration > 0 && (n = window.setTimeout(() => w(), $.duration));
|
|
3700
3707
|
});
|
|
3701
3708
|
}), rt(() => {
|
|
3702
3709
|
n && window.clearTimeout(n);
|
|
3703
3710
|
});
|
|
3704
|
-
function
|
|
3711
|
+
function w() {
|
|
3705
3712
|
t.value = !1;
|
|
3706
3713
|
}
|
|
3707
|
-
function
|
|
3708
|
-
var
|
|
3709
|
-
(
|
|
3714
|
+
function p() {
|
|
3715
|
+
var y;
|
|
3716
|
+
(y = $.onClose) == null || y.call($, $.id);
|
|
3710
3717
|
}
|
|
3711
|
-
return (
|
|
3718
|
+
return (y, L) => (i(), Me(xe, {
|
|
3712
3719
|
name: "y-msg-fade",
|
|
3713
|
-
onAfterLeave:
|
|
3720
|
+
onAfterLeave: p
|
|
3714
3721
|
}, {
|
|
3715
3722
|
default: re(() => [
|
|
3716
3723
|
Be(o("div", {
|
|
@@ -3723,7 +3730,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3723
3730
|
class: E(["y-msg__icon", `y-msg__icon--${e.type}`]),
|
|
3724
3731
|
"aria-hidden": "true"
|
|
3725
3732
|
}, [
|
|
3726
|
-
e.type === "success" ? (i(), u("svg", Lo, [...
|
|
3733
|
+
e.type === "success" ? (i(), u("svg", Lo, [...L[0] || (L[0] = [
|
|
3727
3734
|
o("path", {
|
|
3728
3735
|
d: "M20 6L9 17l-5-5",
|
|
3729
3736
|
stroke: "currentColor",
|
|
@@ -3731,7 +3738,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3731
3738
|
"stroke-linecap": "round",
|
|
3732
3739
|
"stroke-linejoin": "round"
|
|
3733
3740
|
}, null, -1)
|
|
3734
|
-
])])) : e.type === "warning" ? (i(), u("svg", Io, [...
|
|
3741
|
+
])])) : e.type === "warning" ? (i(), u("svg", Io, [...L[1] || (L[1] = [
|
|
3735
3742
|
o("path", {
|
|
3736
3743
|
d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",
|
|
3737
3744
|
stroke: "currentColor",
|
|
@@ -3739,7 +3746,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3739
3746
|
"stroke-linecap": "round",
|
|
3740
3747
|
"stroke-linejoin": "round"
|
|
3741
3748
|
}, null, -1)
|
|
3742
|
-
])])) : (i(), u("svg", Bo, [...
|
|
3749
|
+
])])) : (i(), u("svg", Bo, [...L[2] || (L[2] = [
|
|
3743
3750
|
o("path", {
|
|
3744
3751
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3745
3752
|
stroke: "currentColor",
|
|
@@ -3751,13 +3758,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3751
3758
|
], 2),
|
|
3752
3759
|
o("div", {
|
|
3753
3760
|
class: "y-msg__content",
|
|
3754
|
-
textContent:
|
|
3761
|
+
textContent: ee(e.message)
|
|
3755
3762
|
}, null, 8, Eo),
|
|
3756
3763
|
e.closable ? (i(), u("button", {
|
|
3757
3764
|
key: 0,
|
|
3758
3765
|
class: "y-msg__close",
|
|
3759
3766
|
type: "button",
|
|
3760
|
-
onClick:
|
|
3767
|
+
onClick: w
|
|
3761
3768
|
}, "✕")) : W("", !0)
|
|
3762
3769
|
], 6), [
|
|
3763
3770
|
[Ke, t.value]
|
|
@@ -3776,24 +3783,24 @@ function Ho() {
|
|
|
3776
3783
|
}), e;
|
|
3777
3784
|
}
|
|
3778
3785
|
function Qe(e) {
|
|
3779
|
-
const $ = Se.findIndex((
|
|
3786
|
+
const $ = Se.findIndex((p) => p.id === e);
|
|
3780
3787
|
if ($ === -1) return;
|
|
3781
3788
|
const { el: t } = Se[$], n = t.firstElementChild;
|
|
3782
3789
|
if (n) {
|
|
3783
|
-
const
|
|
3784
|
-
n.style.top =
|
|
3790
|
+
const p = window.getComputedStyle(n).top;
|
|
3791
|
+
n.style.top = p, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3785
3792
|
}
|
|
3786
3793
|
Se[$].leaving = !0, je(), setTimeout(() => {
|
|
3787
3794
|
Xe(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3788
|
-
const
|
|
3789
|
-
|
|
3795
|
+
const p = Se.findIndex((y) => y.id === e);
|
|
3796
|
+
p !== -1 && Se.splice(p, 1), je();
|
|
3790
3797
|
}, 260);
|
|
3791
3798
|
}
|
|
3792
3799
|
function qe(e) {
|
|
3793
|
-
var
|
|
3800
|
+
var p;
|
|
3794
3801
|
const $ = Ko++, t = document.createElement("div");
|
|
3795
3802
|
document.body.appendChild(t);
|
|
3796
|
-
const n =
|
|
3803
|
+
const n = ie(zo, {
|
|
3797
3804
|
id: $,
|
|
3798
3805
|
type: e.type || "success",
|
|
3799
3806
|
message: e.message,
|
|
@@ -3801,15 +3808,15 @@ function qe(e) {
|
|
|
3801
3808
|
offset: Ho(),
|
|
3802
3809
|
zIndex: 3e3 + $,
|
|
3803
3810
|
closable: e.closable ?? !1,
|
|
3804
|
-
onClose: (
|
|
3811
|
+
onClose: (y) => Qe(y)
|
|
3805
3812
|
});
|
|
3806
3813
|
Xe(n, t);
|
|
3807
|
-
const
|
|
3808
|
-
return Se.push({ id: $, el: t, vm: n, height:
|
|
3809
|
-
const
|
|
3810
|
-
if (!
|
|
3811
|
-
const
|
|
3812
|
-
C && (C.height =
|
|
3814
|
+
const w = ((p = t.firstElementChild) == null ? void 0 : p.offsetHeight) || 0;
|
|
3815
|
+
return Se.push({ id: $, el: t, vm: n, height: w, leaving: !1 }), je(), requestAnimationFrame(() => {
|
|
3816
|
+
const y = t.firstElementChild;
|
|
3817
|
+
if (!y) return;
|
|
3818
|
+
const L = y.offsetHeight || w || 0, C = Se.find((T) => T.id === $);
|
|
3819
|
+
C && (C.height = L, je());
|
|
3813
3820
|
}), { close: () => Qe($) };
|
|
3814
3821
|
}
|
|
3815
3822
|
const Oe = {
|
|
@@ -3833,8 +3840,8 @@ function je() {
|
|
|
3833
3840
|
if (t.style.transform = `translate(-50%, ${n}px)`, t.style.top || (t.style.top = "0px"), !$.leaving)
|
|
3834
3841
|
e += (t.offsetHeight || $.height) + Ue;
|
|
3835
3842
|
else {
|
|
3836
|
-
const
|
|
3837
|
-
e +=
|
|
3843
|
+
const w = t.offsetHeight || $.height;
|
|
3844
|
+
e += w + Ue;
|
|
3838
3845
|
}
|
|
3839
3846
|
});
|
|
3840
3847
|
}
|