@nhdropshipping/y-components 1.0.53 → 1.0.54
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/ymessage/ymessage.d.ts +3 -3
- package/dist/components/ymessage/ymessage.d.ts.map +1 -1
- package/dist/components/ymessage/ymessageToast.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 +913 -895
- 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 we, computed as q, createElementBlock as u, openBlock as s, normalizeClass as H, createElementVNode as l, renderSlot as ue, Fragment as ce, renderList as ge, createCommentVNode as R, toDisplayString as se, ref as z, watch as ae, normalizeStyle as fe, withKeys as ke, nextTick as re, onMounted as Ce, onUnmounted as Be, resolveComponent as Ve, createVNode as ve, Transition as $e, withCtx as he, createTextVNode as De, createBlock as
|
|
1
|
+
import { defineComponent as we, computed as q, createElementBlock as u, openBlock as s, normalizeClass as H, createElementVNode as l, renderSlot as ue, Fragment as ce, renderList as ge, createCommentVNode as R, toDisplayString as se, ref as z, watch as ae, normalizeStyle as fe, withKeys as ke, nextTick as re, onMounted as Ce, onUnmounted as Be, resolveComponent as Ve, createVNode as ve, Transition as $e, withCtx as he, createTextVNode as De, createBlock as Me, withModifiers as te, withDirectives as Ee, vModelText as at, Teleport as Fe, vShow as Ke, provide as st, reactive as it, onBeforeUnmount as Ge, TransitionGroup as rt, resolveDynamicComponent as ut, mergeProps as dt, toHandlers as ct, render as et } from "vue";
|
|
2
2
|
const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "content" }, ht = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -28,9 +28,9 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
28
28
|
groupItems: { default: void 0 }
|
|
29
29
|
},
|
|
30
30
|
emits: ["click", "group-click"],
|
|
31
|
-
setup(t, { emit:
|
|
32
|
-
const e = t, n =
|
|
33
|
-
function
|
|
31
|
+
setup(t, { emit: x }) {
|
|
32
|
+
const e = t, n = x;
|
|
33
|
+
function m(C) {
|
|
34
34
|
if (e.disabled || e.loading) {
|
|
35
35
|
C.preventDefault(), C.stopPropagation();
|
|
36
36
|
return;
|
|
@@ -48,48 +48,48 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
52
|
-
function
|
|
51
|
+
}), p = q(() => Array.isArray(e.groupItems) && e.groupItems.length > 0);
|
|
52
|
+
function I(C, B) {
|
|
53
53
|
if (e.disabled || e.loading || C.disabled || C.loading) {
|
|
54
54
|
B.preventDefault(), B.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
n("group-click", C.value, B);
|
|
58
58
|
}
|
|
59
|
-
return (C, B) =>
|
|
60
|
-
(s(!0), u(ce, null, ge(t.groupItems, (
|
|
61
|
-
var
|
|
59
|
+
return (C, B) => p.value ? (s(), u("div", ht, [
|
|
60
|
+
(s(!0), u(ce, null, ge(t.groupItems, ($, w) => {
|
|
61
|
+
var g;
|
|
62
62
|
return s(), u("button", {
|
|
63
|
-
key:
|
|
63
|
+
key: $.value ?? w,
|
|
64
64
|
class: H(["y-btn", [
|
|
65
|
-
`y-btn--${
|
|
66
|
-
`y-btn--${
|
|
65
|
+
`y-btn--${$.variant ?? t.variant}`,
|
|
66
|
+
`y-btn--${$.size ?? t.size}`,
|
|
67
67
|
"is-grouped",
|
|
68
|
-
|
|
69
|
-
{ "is-loading":
|
|
68
|
+
w === 0 ? "group-pos-start" : w === (((g = t.groupItems) == null ? void 0 : g.length) || 0) - 1 ? "group-pos-end" : "group-pos-middle",
|
|
69
|
+
{ "is-loading": $.loading || t.loading }
|
|
70
70
|
]]),
|
|
71
71
|
type: t.htmlType,
|
|
72
|
-
disabled: (
|
|
73
|
-
"aria-busy":
|
|
74
|
-
"aria-disabled": (
|
|
75
|
-
"aria-label":
|
|
76
|
-
onClick: (
|
|
72
|
+
disabled: ($.disabled ?? !1) || t.disabled || t.loading || $.loading,
|
|
73
|
+
"aria-busy": $.loading || t.loading ? "true" : "false",
|
|
74
|
+
"aria-disabled": ($.disabled ?? !1) || t.disabled || t.loading || $.loading ? "true" : "false",
|
|
75
|
+
"aria-label": $.ariaLabel || $.label,
|
|
76
|
+
onClick: (b) => I($, b)
|
|
77
77
|
}, [
|
|
78
78
|
l("span", yt, [
|
|
79
|
-
|
|
79
|
+
$.icon === "chevron-left" ? (s(), u("svg", gt, [...B[0] || (B[0] = [
|
|
80
80
|
l("path", {
|
|
81
81
|
"fill-rule": "evenodd",
|
|
82
82
|
d: "M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z",
|
|
83
83
|
"clip-rule": "evenodd"
|
|
84
84
|
}, null, -1)
|
|
85
|
-
])])) :
|
|
85
|
+
])])) : $.icon === "chevron-right" ? (s(), u("svg", mt, [...B[1] || (B[1] = [
|
|
86
86
|
l("path", {
|
|
87
87
|
"fill-rule": "evenodd",
|
|
88
88
|
d: "M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z",
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
91
|
])])) : R("", !0),
|
|
92
|
-
|
|
92
|
+
$.label && !$.onlyIcon ? (s(), u("span", wt, se($.label), 1)) : R("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, pt);
|
|
95
95
|
}), 128))
|
|
@@ -106,17 +106,17 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
106
106
|
disabled: t.disabled || t.loading,
|
|
107
107
|
"aria-busy": t.loading ? "true" : "false",
|
|
108
108
|
"aria-disabled": t.disabled || t.loading ? "true" : "false",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: m
|
|
110
110
|
}, [
|
|
111
111
|
l("span", vt, [
|
|
112
112
|
ue(C.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
114
|
], 10, ft));
|
|
115
115
|
}
|
|
116
|
-
}), be = (t,
|
|
116
|
+
}), be = (t, x) => {
|
|
117
117
|
const e = t.__vccOpts || t;
|
|
118
|
-
for (const [n,
|
|
119
|
-
e[n] =
|
|
118
|
+
for (const [n, m] of x)
|
|
119
|
+
e[n] = m;
|
|
120
120
|
return e;
|
|
121
121
|
}, Ne = /* @__PURE__ */ be(bt, [["__scopeId", "data-v-53157673"]]), kt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "min", "max", "disabled", "required", "value"], xt = /* @__PURE__ */ we({
|
|
122
122
|
__name: "yinput",
|
|
@@ -138,30 +138,30 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
138
138
|
clearOnFocus: { type: Boolean, default: !1 }
|
|
139
139
|
},
|
|
140
140
|
emits: ["update:modelValue", "enter", "paste"],
|
|
141
|
-
setup(t, { emit:
|
|
142
|
-
const e = t, n =
|
|
141
|
+
setup(t, { emit: x }) {
|
|
142
|
+
const e = t, n = x, m = z(null), v = z(""), p = z(!1), I = z(!1), C = z(e.placeholder || "");
|
|
143
143
|
ae(() => e.placeholder, (A) => {
|
|
144
|
-
|
|
144
|
+
I.value || (C.value = A || "");
|
|
145
145
|
});
|
|
146
146
|
function B(A) {
|
|
147
147
|
const U = A.target;
|
|
148
|
-
|
|
148
|
+
p.value = !0, n("update:modelValue", U.value);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function $() {
|
|
151
|
+
I.value = !0, e.clearOnFocus && (v.value = e.modelValue || "", p.value = !1, C.value = v.value || e.placeholder || "", n("update:modelValue", ""));
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
153
|
+
function w() {
|
|
154
|
+
if (I.value = !1, e.clearOnFocus && !p.value && (!e.modelValue || e.modelValue === "") && n("update:modelValue", v.value), e.min !== void 0 && e.modelValue !== void 0 && e.modelValue !== "") {
|
|
155
155
|
const A = Number(e.modelValue), U = Number(e.min);
|
|
156
156
|
!Number.isNaN(A) && !Number.isNaN(U) && A < U && n("update:modelValue", String(U));
|
|
157
157
|
}
|
|
158
158
|
C.value = e.placeholder || "";
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function g(A) {
|
|
161
161
|
const U = A.target;
|
|
162
162
|
n("enter", U.value);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function b(A) {
|
|
165
165
|
const U = A.target;
|
|
166
166
|
requestAnimationFrame(() => {
|
|
167
167
|
n("paste", U.value);
|
|
@@ -173,7 +173,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
173
173
|
}, [
|
|
174
174
|
l("input", {
|
|
175
175
|
ref_key: "inputRef",
|
|
176
|
-
ref:
|
|
176
|
+
ref: m,
|
|
177
177
|
class: H(["y-input", `y-input--${t.size}`]),
|
|
178
178
|
id: t.id,
|
|
179
179
|
name: t.name,
|
|
@@ -187,23 +187,23 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
187
187
|
required: t.required,
|
|
188
188
|
value: t.modelValue,
|
|
189
189
|
onInput: B,
|
|
190
|
-
onFocus:
|
|
191
|
-
onBlur:
|
|
192
|
-
onKeyup: ke(
|
|
193
|
-
onPaste:
|
|
190
|
+
onFocus: $,
|
|
191
|
+
onBlur: w,
|
|
192
|
+
onKeyup: ke(g, ["enter"]),
|
|
193
|
+
onPaste: b
|
|
194
194
|
}, null, 42, kt)
|
|
195
195
|
], 6));
|
|
196
196
|
}
|
|
197
197
|
}), tt = /* @__PURE__ */ be(xt, [["__scopeId", "data-v-c4912c99"]]), $t = {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "bulk-bar"
|
|
200
|
-
}, Dt = { class: "bulk-left" }, Ct = { class: "bulk-actions" }, _t = { class: "card" }, St = { class: "table" },
|
|
200
|
+
}, Dt = { class: "bulk-left" }, Ct = { class: "bulk-actions" }, _t = { class: "card" }, St = { class: "table" }, Mt = {
|
|
201
201
|
key: 0,
|
|
202
202
|
style: { width: "34px", "min-width": "34px" }
|
|
203
|
-
},
|
|
203
|
+
}, It = {
|
|
204
204
|
key: 1,
|
|
205
205
|
style: { width: "40px", "min-width": "40px" }
|
|
206
|
-
},
|
|
206
|
+
}, Lt = {
|
|
207
207
|
key: 0,
|
|
208
208
|
class: "col-expand"
|
|
209
209
|
}, Et = {
|
|
@@ -255,8 +255,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
255
255
|
selectedItems: { default: void 0 }
|
|
256
256
|
},
|
|
257
257
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
258
|
-
setup(t, { emit:
|
|
259
|
-
const e = t, n =
|
|
258
|
+
setup(t, { emit: x }) {
|
|
259
|
+
const e = t, n = x, m = z(e.currentPage || 1), v = z(e.pageSize), p = z(e.selectedItems || []), I = z(/* @__PURE__ */ new Set()), C = z("none"), B = z(), $ = z(), w = z(), g = z(), b = z([]), A = z({}), U = q(
|
|
260
260
|
() => e.columns.filter((a) => !E(a.width)).map((a) => a.key)
|
|
261
261
|
);
|
|
262
262
|
function P() {
|
|
@@ -280,8 +280,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
280
280
|
function F(a) {
|
|
281
281
|
const c = E(a);
|
|
282
282
|
if (!c) return null;
|
|
283
|
-
const
|
|
284
|
-
return Number.isFinite(
|
|
283
|
+
const D = parseFloat(c);
|
|
284
|
+
return Number.isFinite(D) ? D : null;
|
|
285
285
|
}
|
|
286
286
|
const K = q(() => {
|
|
287
287
|
let a = e.columns.length;
|
|
@@ -290,57 +290,57 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
290
290
|
if (!e.searchKeyword || !e.searchFields.length)
|
|
291
291
|
return e.data;
|
|
292
292
|
const a = e.searchKeyword.toLowerCase();
|
|
293
|
-
return e.data.filter((c) => e.searchFields.some((
|
|
294
|
-
const _ =
|
|
293
|
+
return e.data.filter((c) => e.searchFields.some((D) => {
|
|
294
|
+
const _ = k(c, D);
|
|
295
295
|
return String(_).toLowerCase().includes(a);
|
|
296
296
|
}));
|
|
297
297
|
}), ne = q(() => (e.pagination, Y.value)), Q = q(() => {
|
|
298
298
|
if (!e.selectable) return !1;
|
|
299
|
-
const a = ne.value.map((c,
|
|
300
|
-
return a.length > 0 && a.every((c) =>
|
|
299
|
+
const a = ne.value.map((c, D) => ({ key: d(c, D), item: c, index: D })).filter(({ item: c, index: D }) => !o(c, D)).map(({ key: c }) => c);
|
|
300
|
+
return a.length > 0 && a.every((c) => p.value.includes(c));
|
|
301
301
|
}), pe = q(() => {
|
|
302
302
|
if (!e.selectable) return !1;
|
|
303
|
-
const a = ne.value.map((c,
|
|
304
|
-
return a.length > 0 && a.every(({ item: c, index:
|
|
303
|
+
const a = ne.value.map((c, D) => ({ item: c, index: D }));
|
|
304
|
+
return a.length > 0 && a.every(({ item: c, index: D }) => o(c, D));
|
|
305
305
|
}), j = q(() => {
|
|
306
306
|
const a = [];
|
|
307
307
|
let c = e.selectable ? 40 : 0;
|
|
308
|
-
for (let
|
|
309
|
-
const _ = e.columns[
|
|
308
|
+
for (let D = 0; D < e.columns.length; D++) {
|
|
309
|
+
const _ = e.columns[D];
|
|
310
310
|
if (_.fixed === "left") {
|
|
311
|
-
let
|
|
311
|
+
let L = 80;
|
|
312
312
|
const W = F(_.width);
|
|
313
|
-
W !== null ?
|
|
313
|
+
W !== null ? L = W : b.value[D] && (L = F(b.value[D]) ?? L), a.push(c), c += L;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
return a;
|
|
317
317
|
}), ee = q(() => {
|
|
318
318
|
const a = [];
|
|
319
319
|
let c = 0;
|
|
320
|
-
const
|
|
320
|
+
const D = [];
|
|
321
321
|
for (let _ = e.columns.length - 1; _ >= 0; _--) {
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
322
|
+
const L = e.columns[_];
|
|
323
|
+
if (L.fixed === "right") {
|
|
324
324
|
let W = 80;
|
|
325
|
-
const J = F(
|
|
326
|
-
J !== null ? W = J :
|
|
325
|
+
const J = F(L.width);
|
|
326
|
+
J !== null ? W = J : b.value[_] && (W = F(b.value[_]) ?? W), D.push({ index: _, width: W });
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
for (let _ = 0; _ <
|
|
330
|
-
a.push(c), c +=
|
|
329
|
+
for (let _ = 0; _ < D.length; _++)
|
|
330
|
+
a.push(c), c += D[_].width;
|
|
331
331
|
return a;
|
|
332
332
|
});
|
|
333
|
-
function
|
|
333
|
+
function h(a, c) {
|
|
334
334
|
if (c === "left") {
|
|
335
|
-
let
|
|
335
|
+
let D = 0;
|
|
336
336
|
for (let _ = 0; _ < a; _++)
|
|
337
|
-
e.columns[_].fixed === "left" &&
|
|
338
|
-
return
|
|
337
|
+
e.columns[_].fixed === "left" && D++;
|
|
338
|
+
return D;
|
|
339
339
|
} else {
|
|
340
|
-
let
|
|
340
|
+
let D = 0;
|
|
341
341
|
for (let _ = e.columns.length - 1; _ > a; _--)
|
|
342
|
-
e.columns[_].fixed === "right" &&
|
|
343
|
-
return
|
|
342
|
+
e.columns[_].fixed === "right" && D++;
|
|
343
|
+
return D;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
function d(a, c) {
|
|
@@ -350,113 +350,113 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
350
350
|
return e.rowDisabled && typeof e.rowDisabled == "function" ? e.rowDisabled(a, c) : !1;
|
|
351
351
|
}
|
|
352
352
|
function i(a) {
|
|
353
|
-
return
|
|
353
|
+
return I.value.has(a);
|
|
354
354
|
}
|
|
355
355
|
function f(a) {
|
|
356
|
-
|
|
356
|
+
I.value.has(a) ? I.value.delete(a) : I.value.add(a);
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
return c.split(".").reduce((
|
|
358
|
+
function k(a, c) {
|
|
359
|
+
return c.split(".").reduce((D, _) => D == null ? void 0 : D[_], a);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
const
|
|
363
|
-
return a.align &&
|
|
361
|
+
function M(a, c = !1) {
|
|
362
|
+
const D = [];
|
|
363
|
+
return a.align && D.push(`text-${a.align}`), a.fixed === "right" && (D.push("col-fixed-right"), c && D.push("col-fixed-right-header")), a.fixed === "left" && (D.push("col-fixed-left"), c && D.push("col-fixed-left-header")), D.join(" ");
|
|
364
364
|
}
|
|
365
|
-
function T(a, c,
|
|
366
|
-
const _ = {},
|
|
367
|
-
if (
|
|
368
|
-
_.width =
|
|
365
|
+
function T(a, c, D) {
|
|
366
|
+
const _ = {}, L = E(a.width);
|
|
367
|
+
if (L)
|
|
368
|
+
_.width = L, _.minWidth = L, _.maxWidth = L;
|
|
369
369
|
else {
|
|
370
370
|
const W = P();
|
|
371
371
|
_.width = W, _.minWidth = W, _.maxWidth = W;
|
|
372
372
|
}
|
|
373
373
|
if (a.fixed === "left") {
|
|
374
|
-
const W =
|
|
375
|
-
_.left = `${J}px`, _.zIndex =
|
|
374
|
+
const W = h(c, "left"), J = j.value[W] || 0;
|
|
375
|
+
_.left = `${J}px`, _.zIndex = D ? `${10 + W}` : `${5 + W}`;
|
|
376
376
|
} else if (a.fixed === "right") {
|
|
377
|
-
const W =
|
|
378
|
-
|
|
377
|
+
const W = h(c, "right"), J = ee.value[W] || 0;
|
|
378
|
+
D ? _.right = `${J - 3}px` : _.right = `${J}px`, _.zIndex = D ? `${10 + W}` : `${5 + W}`;
|
|
379
379
|
}
|
|
380
380
|
return _;
|
|
381
381
|
}
|
|
382
382
|
function N(a, c) {
|
|
383
|
-
const
|
|
384
|
-
return c.formatter ? c.formatter(
|
|
383
|
+
const D = k(a, c.key);
|
|
384
|
+
return c.formatter ? c.formatter(D, a) : D || "";
|
|
385
385
|
}
|
|
386
386
|
function oe(a) {
|
|
387
|
-
const c = ne.value.find((_,
|
|
388
|
-
c &&
|
|
387
|
+
const c = ne.value.find((_, L) => d(_, L) === a), D = ne.value.findIndex((_, L) => d(_, L) === a);
|
|
388
|
+
c && D >= 0 && o(c, D) || (p.value.includes(a) ? p.value = p.value.filter((_) => _ !== a) : p.value = [...p.value, a], n("select", p.value), n("update:selectedItems", p.value));
|
|
389
389
|
}
|
|
390
390
|
function me() {
|
|
391
|
-
const a = ne.value.map((c,
|
|
391
|
+
const a = ne.value.map((c, D) => ({ key: d(c, D), item: c, index: D })).filter(({ item: c, index: D }) => !o(c, D)).map(({ key: c }) => c);
|
|
392
392
|
if (a.length !== 0) {
|
|
393
|
-
if (a.every((c) =>
|
|
394
|
-
|
|
393
|
+
if (a.every((c) => p.value.includes(c)))
|
|
394
|
+
p.value = p.value.filter((c) => !a.includes(c));
|
|
395
395
|
else {
|
|
396
|
-
const c = /* @__PURE__ */ new Set([...
|
|
397
|
-
|
|
396
|
+
const c = /* @__PURE__ */ new Set([...p.value, ...a]);
|
|
397
|
+
p.value = Array.from(c);
|
|
398
398
|
}
|
|
399
|
-
n("select",
|
|
399
|
+
n("select", p.value), n("update:selectedItems", p.value);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
function _e() {
|
|
403
|
-
|
|
403
|
+
p.value = [], n("select", p.value), n("update:selectedItems", p.value);
|
|
404
404
|
}
|
|
405
405
|
ae(() => e.selectedItems, (a) => {
|
|
406
406
|
if (a !== void 0 && Array.isArray(a)) {
|
|
407
|
-
const c = new Set(
|
|
408
|
-
(c.size !==
|
|
409
|
-
} else a === void 0 &&
|
|
407
|
+
const c = new Set(p.value), D = new Set(a);
|
|
408
|
+
(c.size !== D.size || ![...c].every((_) => D.has(_))) && (p.value = [...a]);
|
|
409
|
+
} else a === void 0 && p.value.length > 0 && (p.value = []);
|
|
410
410
|
}, { deep: !0, immediate: !0 }), ae(() => e.searchKeyword, () => {
|
|
411
|
-
|
|
411
|
+
m.value = 1;
|
|
412
412
|
}), ae(() => e.data, () => {
|
|
413
|
-
e.total || (
|
|
413
|
+
e.total || (m.value = 1);
|
|
414
414
|
}, { deep: !0 });
|
|
415
415
|
function He(a) {
|
|
416
|
-
|
|
416
|
+
m.value = a, n("page-change", a);
|
|
417
417
|
}
|
|
418
418
|
function qe(a) {
|
|
419
|
-
v.value = a,
|
|
419
|
+
v.value = a, m.value = 1, n("page-size-change", a);
|
|
420
420
|
}
|
|
421
421
|
ae(() => e.currentPage, (a) => {
|
|
422
422
|
const c = typeof a == "number" && a > 0 ? a : 1;
|
|
423
|
-
|
|
423
|
+
m.value !== c && (m.value = c);
|
|
424
424
|
}), ae(() => e.pageSize, (a) => {
|
|
425
425
|
const c = typeof a == "number" && a > 0 ? a : 10;
|
|
426
426
|
v.value !== c && (v.value = c);
|
|
427
427
|
});
|
|
428
428
|
function Te() {
|
|
429
429
|
B.value && re(() => {
|
|
430
|
-
const a = B.value.getBoundingClientRect(), c = window.innerHeight,
|
|
430
|
+
const a = B.value.getBoundingClientRect(), c = window.innerHeight, D = a.top, _ = B.value.querySelector(".table-header"), L = _ ? _.offsetHeight : 40, W = B.value.querySelector(".ypagination"), J = W ? W.offsetHeight : 60, ye = B.value.querySelector(".bulk-bar"), le = ye ? ye.offsetHeight : 0, xe = L + J + le + 20, Ye = c - D - xe, ot = Math.max(200, Ye), Qe = B.value.querySelector(".table-body-wrap .table");
|
|
431
431
|
Qe && (Qe.offsetHeight > Ye ? C.value = `${ot}px` : C.value = "none");
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
|
-
let
|
|
435
|
-
function
|
|
436
|
-
|
|
437
|
-
|
|
434
|
+
let Ie = !1;
|
|
435
|
+
function Le() {
|
|
436
|
+
!$.value || !w.value || Ie || $.value.scrollLeft !== w.value.scrollLeft && (Ie = !0, $.value.scrollLeft = w.value.scrollLeft, requestAnimationFrame(() => {
|
|
437
|
+
Ie = !1;
|
|
438
438
|
}));
|
|
439
439
|
}
|
|
440
440
|
function Re() {
|
|
441
|
-
|
|
442
|
-
|
|
441
|
+
!$.value || !w.value || Ie || w.value.scrollLeft !== $.value.scrollLeft && (Ie = !0, w.value.scrollLeft = $.value.scrollLeft, requestAnimationFrame(() => {
|
|
442
|
+
Ie = !1;
|
|
443
443
|
}));
|
|
444
444
|
}
|
|
445
445
|
function Ae() {
|
|
446
446
|
re(() => {
|
|
447
|
-
if (!
|
|
448
|
-
const a =
|
|
449
|
-
if (Z.value.show =
|
|
450
|
-
const W = 24, J =
|
|
447
|
+
if (!w.value) return;
|
|
448
|
+
const a = w.value, c = a.scrollHeight, D = a.clientHeight, _ = a.scrollTop, L = c > D + 1;
|
|
449
|
+
if (Z.value.show = L, !L) return;
|
|
450
|
+
const W = 24, J = D / c, ye = V.value ? V.value.clientHeight : D, le = Math.max(W, Math.floor(ye * J));
|
|
451
451
|
Z.value.thumbHeight = le;
|
|
452
|
-
const xe = Math.max(0, ye - le), Ye = Math.max(1, c -
|
|
452
|
+
const xe = Math.max(0, ye - le), Ye = Math.max(1, c - D);
|
|
453
453
|
Z.value.thumbTop = Math.min(xe, Math.floor(_ / Ye * xe));
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
function We(a) {
|
|
457
|
-
if (!X || !
|
|
457
|
+
if (!X || !w.value || !V.value) return;
|
|
458
458
|
a.preventDefault();
|
|
459
|
-
const c = V.value.clientHeight,
|
|
459
|
+
const c = V.value.clientHeight, D = Math.max(0, c - Z.value.thumbHeight), _ = w.value, L = _.scrollHeight, W = _.clientHeight, J = Math.max(1, L - W), le = (a.clientY - ie) / Math.max(1, D) * J;
|
|
460
460
|
_.scrollTop = Math.min(J, Math.max(0, G + le)), Ae();
|
|
461
461
|
}
|
|
462
462
|
function Pe() {
|
|
@@ -464,32 +464,32 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
464
464
|
}
|
|
465
465
|
function ze() {
|
|
466
466
|
re(() => {
|
|
467
|
-
var
|
|
468
|
-
if (
|
|
467
|
+
var D, _;
|
|
468
|
+
if (b.value.length === e.columns.length && b.value.every((L) => !!L))
|
|
469
469
|
return;
|
|
470
470
|
const a = [];
|
|
471
|
-
e.columns.forEach((
|
|
472
|
-
const J = E(
|
|
471
|
+
e.columns.forEach((L, W) => {
|
|
472
|
+
const J = E(L.width);
|
|
473
473
|
if (J)
|
|
474
|
-
a.push(J), A.value[
|
|
475
|
-
else if (A.value[
|
|
476
|
-
a.push(A.value[
|
|
474
|
+
a.push(J), A.value[L.key] = J;
|
|
475
|
+
else if (A.value[L.key])
|
|
476
|
+
a.push(A.value[L.key]);
|
|
477
477
|
else {
|
|
478
|
-
const ye =
|
|
478
|
+
const ye = b.value[W];
|
|
479
479
|
if (ye)
|
|
480
|
-
a.push(ye), A.value[
|
|
480
|
+
a.push(ye), A.value[L.key] = ye;
|
|
481
481
|
else {
|
|
482
482
|
const le = P();
|
|
483
|
-
a.push(le), A.value[
|
|
483
|
+
a.push(le), A.value[L.key] = le;
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
});
|
|
487
|
-
const c = (
|
|
487
|
+
const c = (D = g.value) == null ? void 0 : D.querySelector("tbody tr");
|
|
488
488
|
if (c) {
|
|
489
|
-
const
|
|
489
|
+
const L = e.selectable ? 1 : 0, W = Array.from(c.children);
|
|
490
490
|
for (let J = 0; J < e.columns.length; J++)
|
|
491
491
|
if (!a[J]) {
|
|
492
|
-
const ye = W[
|
|
492
|
+
const ye = W[L + J];
|
|
493
493
|
if (ye && ye.clientWidth > 0) {
|
|
494
494
|
const le = `${ye.clientWidth}px`;
|
|
495
495
|
a[J] = le, A.value[e.columns[J].key] = le;
|
|
@@ -499,75 +499,75 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
} else
|
|
502
|
-
for (let
|
|
503
|
-
if (!a[
|
|
504
|
-
const W = A.value[((_ = e.columns[
|
|
505
|
-
a[
|
|
502
|
+
for (let L = 0; L < a.length; L++)
|
|
503
|
+
if (!a[L]) {
|
|
504
|
+
const W = A.value[((_ = e.columns[L]) == null ? void 0 : _.key) || ""];
|
|
505
|
+
a[L] = W || b.value[L] || "80px", e.columns[L] && (A.value[e.columns[L].key] = a[L]);
|
|
506
506
|
}
|
|
507
|
-
|
|
507
|
+
b.value = a;
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
510
|
function r() {
|
|
511
|
-
Te(),
|
|
511
|
+
Te(), S();
|
|
512
512
|
}
|
|
513
513
|
ae(() => e.data, () => {
|
|
514
514
|
re(() => {
|
|
515
|
-
Te(),
|
|
515
|
+
Te(), Le(), S(), I.value.clear();
|
|
516
516
|
});
|
|
517
|
-
}, { deep: !0 }), ae([
|
|
517
|
+
}, { deep: !0 }), ae([m, v], () => {
|
|
518
518
|
re(() => {
|
|
519
|
-
Te(),
|
|
519
|
+
Te(), Le(), S();
|
|
520
520
|
});
|
|
521
521
|
}), ae(() => e.columns, () => {
|
|
522
522
|
const a = [], c = { ...A.value };
|
|
523
|
-
e.columns.forEach((_,
|
|
523
|
+
e.columns.forEach((_, L) => {
|
|
524
524
|
const W = E(_.width);
|
|
525
|
-
W ? (a.push(W), c[_.key] = W) : c[_.key] ? a.push(c[_.key]) :
|
|
525
|
+
W ? (a.push(W), c[_.key] = W) : c[_.key] ? a.push(c[_.key]) : b.value[L] ? (a.push(b.value[L]), c[_.key] = b.value[L]) : a.push("");
|
|
526
526
|
});
|
|
527
|
-
const
|
|
527
|
+
const D = new Set(e.columns.map((_) => _.key));
|
|
528
528
|
Object.keys(c).forEach((_) => {
|
|
529
|
-
|
|
530
|
-
}), A.value = c,
|
|
531
|
-
ze(),
|
|
529
|
+
D.has(_) || delete c[_];
|
|
530
|
+
}), A.value = c, b.value = a, re(() => {
|
|
531
|
+
ze(), Le(), S();
|
|
532
532
|
});
|
|
533
|
-
}, { deep: !0 }), ae(() =>
|
|
533
|
+
}, { deep: !0 }), ae(() => p.value, () => {
|
|
534
534
|
re(() => {
|
|
535
|
-
Te(),
|
|
535
|
+
Te(), S();
|
|
536
536
|
});
|
|
537
537
|
}, { deep: !0 }), ae(() => e.loading, () => {
|
|
538
538
|
re(() => {
|
|
539
|
-
|
|
539
|
+
S();
|
|
540
540
|
});
|
|
541
541
|
}), Ce(() => {
|
|
542
542
|
var a, c;
|
|
543
543
|
re(() => {
|
|
544
|
-
Te(), ze(),
|
|
545
|
-
}), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), (a =
|
|
546
|
-
|
|
547
|
-
}, { passive: !0 }), (c =
|
|
544
|
+
Te(), ze(), S(), Ae();
|
|
545
|
+
}), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), (a = w.value) == null || a.addEventListener("scroll", () => {
|
|
546
|
+
Le(), Ae(), S();
|
|
547
|
+
}, { passive: !0 }), (c = $.value) == null || c.addEventListener("scroll", () => {
|
|
548
548
|
Re();
|
|
549
|
-
}, { passive: !0 }), re(() =>
|
|
550
|
-
|
|
551
|
-
}), O.observe(
|
|
549
|
+
}, { passive: !0 }), re(() => Le()), w.value && typeof ResizeObserver < "u" && (O = new ResizeObserver(() => {
|
|
550
|
+
S();
|
|
551
|
+
}), O.observe(w.value));
|
|
552
552
|
}), Be(() => {
|
|
553
553
|
var a, c;
|
|
554
|
-
window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0), (a =
|
|
554
|
+
window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0), (a = w.value) == null || a.removeEventListener("scroll", Le), (c = $.value) == null || c.removeEventListener("scroll", Re), window.removeEventListener("mousemove", We), window.removeEventListener("mouseup", Pe), O && (O.disconnect(), O = null);
|
|
555
555
|
});
|
|
556
556
|
let y = -1;
|
|
557
|
-
function
|
|
558
|
-
|
|
559
|
-
if (
|
|
560
|
-
const a =
|
|
557
|
+
function S() {
|
|
558
|
+
!$.value || !w.value || requestAnimationFrame(() => {
|
|
559
|
+
if (!$.value || !w.value) return;
|
|
560
|
+
const a = w.value, c = Math.ceil(a.offsetWidth - a.clientWidth);
|
|
561
561
|
if (de.value = c, c !== y) {
|
|
562
562
|
y = c;
|
|
563
|
-
const
|
|
564
|
-
|
|
563
|
+
const D = $.value.querySelector(".table"), _ = g.value;
|
|
564
|
+
D && _ && ($.value.style.paddingRight = "0px", D.style.width = "", D.style.marginRight = "", c > 0 ? ($.value.style.paddingRight = `${c}px`, D.style.width = "100%", D.style.marginRight = `-${c}px`) : ($.value.style.paddingRight = "0px", D.style.width = "100%", D.style.marginRight = "0px"));
|
|
565
565
|
}
|
|
566
566
|
});
|
|
567
567
|
}
|
|
568
568
|
let O = null;
|
|
569
569
|
return (a, c) => {
|
|
570
|
-
const
|
|
570
|
+
const D = Ve("YButton"), _ = Ve("YPagination");
|
|
571
571
|
return s(), u("div", {
|
|
572
572
|
class: "ytable-container",
|
|
573
573
|
ref_key: "tableContainer",
|
|
@@ -575,14 +575,14 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
575
575
|
}, [
|
|
576
576
|
ve($e, { name: "bulk-slide" }, {
|
|
577
577
|
default: he(() => [
|
|
578
|
-
|
|
579
|
-
l("div", Dt, "已选择 " + se(
|
|
578
|
+
p.value.length && t.showBulkActions ? (s(), u("div", $t, [
|
|
579
|
+
l("div", Dt, "已选择 " + se(p.value.length) + " 项", 1),
|
|
580
580
|
l("div", Ct, [
|
|
581
581
|
ue(a.$slots, "bulk-actions", {
|
|
582
|
-
selectedItems:
|
|
582
|
+
selectedItems: p.value,
|
|
583
583
|
clearSelection: _e
|
|
584
584
|
}, () => [
|
|
585
|
-
ve(
|
|
585
|
+
ve(D, {
|
|
586
586
|
size: "small",
|
|
587
587
|
class: "btn",
|
|
588
588
|
onClick: _e
|
|
@@ -602,20 +602,20 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
602
602
|
l("div", {
|
|
603
603
|
class: "table-header",
|
|
604
604
|
ref_key: "headerRef",
|
|
605
|
-
ref:
|
|
605
|
+
ref: $
|
|
606
606
|
}, [
|
|
607
607
|
l("table", St, [
|
|
608
608
|
l("colgroup", null, [
|
|
609
|
-
e.expandable ? (s(), u("col",
|
|
610
|
-
t.selectable ? (s(), u("col",
|
|
611
|
-
(s(!0), u(ce, null, ge(t.columns, (
|
|
612
|
-
key:
|
|
613
|
-
style: fe({ width:
|
|
609
|
+
e.expandable ? (s(), u("col", Mt)) : R("", !0),
|
|
610
|
+
t.selectable ? (s(), u("col", It)) : R("", !0),
|
|
611
|
+
(s(!0), u(ce, null, ge(t.columns, (L, W) => (s(), u("col", {
|
|
612
|
+
key: L.key,
|
|
613
|
+
style: fe({ width: b.value[W] || void 0, minWidth: b.value[W] || "80px" })
|
|
614
614
|
}, null, 4))), 128))
|
|
615
615
|
]),
|
|
616
616
|
l("thead", null, [
|
|
617
617
|
l("tr", null, [
|
|
618
|
-
e.expandable ? (s(), u("th",
|
|
618
|
+
e.expandable ? (s(), u("th", Lt)) : R("", !0),
|
|
619
619
|
t.selectable ? (s(), u("th", Et, [
|
|
620
620
|
l("input", {
|
|
621
621
|
type: "checkbox",
|
|
@@ -624,11 +624,11 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
624
624
|
onChange: me
|
|
625
625
|
}, null, 40, Bt)
|
|
626
626
|
])) : R("", !0),
|
|
627
|
-
(s(!0), u(ce, null, ge(t.columns, (
|
|
628
|
-
key:
|
|
629
|
-
class: H(L
|
|
630
|
-
style: fe(T(
|
|
631
|
-
}, se(
|
|
627
|
+
(s(!0), u(ce, null, ge(t.columns, (L, W) => (s(), u("th", {
|
|
628
|
+
key: L.key,
|
|
629
|
+
class: H(M(L, !0)),
|
|
630
|
+
style: fe(T(L, W, !0))
|
|
631
|
+
}, se(L.title), 7))), 128))
|
|
632
632
|
])
|
|
633
633
|
])
|
|
634
634
|
])
|
|
@@ -636,7 +636,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
636
636
|
l("div", {
|
|
637
637
|
class: H(["table-body-wrap", { "is-loading": t.loading, "is-empty": !ne.value.length && !t.loading }]),
|
|
638
638
|
ref_key: "bodyWrapRef",
|
|
639
|
-
ref:
|
|
639
|
+
ref: w,
|
|
640
640
|
style: fe({ maxHeight: C.value })
|
|
641
641
|
}, [
|
|
642
642
|
t.loading ? (s(), u("div", Tt, [...c[3] || (c[3] = [
|
|
@@ -651,57 +651,57 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
651
651
|
l("table", {
|
|
652
652
|
class: H(["table", { "loading-table": t.loading }]),
|
|
653
653
|
ref_key: "bodyTableRef",
|
|
654
|
-
ref:
|
|
654
|
+
ref: g
|
|
655
655
|
}, [
|
|
656
656
|
l("colgroup", null, [
|
|
657
657
|
e.expandable ? (s(), u("col", Kt)) : R("", !0),
|
|
658
658
|
t.selectable ? (s(), u("col", Ht)) : R("", !0),
|
|
659
|
-
(s(!0), u(ce, null, ge(t.columns, (
|
|
660
|
-
key:
|
|
661
|
-
style: fe({ width:
|
|
659
|
+
(s(!0), u(ce, null, ge(t.columns, (L, W) => (s(), u("col", {
|
|
660
|
+
key: L.key,
|
|
661
|
+
style: fe({ width: b.value[W] || void 0, minWidth: b.value[W] || "80px" })
|
|
662
662
|
}, null, 4))), 128))
|
|
663
663
|
]),
|
|
664
664
|
l("tbody", null, [
|
|
665
|
-
(s(!0), u(ce, null, ge(ne.value, (
|
|
666
|
-
key: d(
|
|
665
|
+
(s(!0), u(ce, null, ge(ne.value, (L, W) => (s(), u(ce, {
|
|
666
|
+
key: d(L, W)
|
|
667
667
|
}, [
|
|
668
668
|
l("tr", null, [
|
|
669
669
|
e.expandable ? (s(), u("td", Rt, [
|
|
670
670
|
l("button", {
|
|
671
671
|
class: "expand-btn",
|
|
672
672
|
type: "button",
|
|
673
|
-
onClick: (J) => f(d(
|
|
673
|
+
onClick: (J) => f(d(L, W))
|
|
674
674
|
}, [
|
|
675
675
|
l("span", {
|
|
676
|
-
class: H(["expand-icon", { "is-open": i(d(
|
|
676
|
+
class: H(["expand-icon", { "is-open": i(d(L, W)) }])
|
|
677
677
|
}, null, 2)
|
|
678
678
|
], 8, At)
|
|
679
679
|
])) : R("", !0),
|
|
680
680
|
t.selectable ? (s(), u("td", Wt, [
|
|
681
681
|
l("input", {
|
|
682
682
|
type: "checkbox",
|
|
683
|
-
value: d(
|
|
684
|
-
checked:
|
|
685
|
-
disabled: o(
|
|
686
|
-
onChange: (J) => oe(d(
|
|
683
|
+
value: d(L, W),
|
|
684
|
+
checked: p.value.includes(d(L, W)),
|
|
685
|
+
disabled: o(L, W),
|
|
686
|
+
onChange: (J) => oe(d(L, W))
|
|
687
687
|
}, null, 40, Vt)
|
|
688
688
|
])) : R("", !0),
|
|
689
689
|
(s(!0), u(ce, null, ge(t.columns, (J, ye) => (s(), u("td", {
|
|
690
690
|
key: J.key,
|
|
691
|
-
class: H(
|
|
691
|
+
class: H(M(J)),
|
|
692
692
|
style: fe(T(J, ye, !1))
|
|
693
693
|
}, [
|
|
694
694
|
ue(a.$slots, `cell-${J.key}`, {
|
|
695
|
-
item:
|
|
696
|
-
value:
|
|
695
|
+
item: L,
|
|
696
|
+
value: k(L, J.key),
|
|
697
697
|
index: W
|
|
698
698
|
}, () => [
|
|
699
|
-
De(se(N(
|
|
699
|
+
De(se(N(L, J)), 1)
|
|
700
700
|
], !0)
|
|
701
701
|
], 6))), 128))
|
|
702
702
|
]),
|
|
703
|
-
e.expandable && i(d(
|
|
704
|
-
key: `${d(
|
|
703
|
+
e.expandable && i(d(L, W)) ? (s(), u("tr", {
|
|
704
|
+
key: `${d(L, W)}-expand`,
|
|
705
705
|
class: "expand-row"
|
|
706
706
|
}, [
|
|
707
707
|
l("td", {
|
|
@@ -709,7 +709,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
709
709
|
class: "expand-cell"
|
|
710
710
|
}, [
|
|
711
711
|
ue(a.$slots, "expand", {
|
|
712
|
-
item:
|
|
712
|
+
item: L,
|
|
713
713
|
index: W
|
|
714
714
|
}, void 0, !0)
|
|
715
715
|
], 8, Ft)
|
|
@@ -718,13 +718,13 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
718
718
|
])
|
|
719
719
|
], 2)
|
|
720
720
|
], 6),
|
|
721
|
-
t.pagination ? (s(),
|
|
721
|
+
t.pagination ? (s(), Me(_, {
|
|
722
722
|
key: 0,
|
|
723
723
|
class: "align-right",
|
|
724
|
-
"current-page":
|
|
725
|
-
"onUpdate:currentPage": c[0] || (c[0] = (
|
|
724
|
+
"current-page": m.value,
|
|
725
|
+
"onUpdate:currentPage": c[0] || (c[0] = (L) => m.value = L),
|
|
726
726
|
"page-size": v.value,
|
|
727
|
-
"onUpdate:pageSize": c[1] || (c[1] = (
|
|
727
|
+
"onUpdate:pageSize": c[1] || (c[1] = (L) => v.value = L),
|
|
728
728
|
loading: e.loading,
|
|
729
729
|
"page-size-options": t.pageSizeOptions,
|
|
730
730
|
onPageChange: He,
|
|
@@ -752,27 +752,27 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
752
752
|
width: { default: "200px" }
|
|
753
753
|
},
|
|
754
754
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
755
|
-
setup(t, { emit:
|
|
756
|
-
const e = t, n =
|
|
755
|
+
setup(t, { emit: x }) {
|
|
756
|
+
const e = t, n = x, m = z(!1), v = z(-1), p = z(), I = z(), C = z(), B = z(), $ = z(!1), w = z(), g = z(""), b = q(() => e.options.find((o) => Z(o) === e.modelValue) || null), A = q(() => b.value ? X(b.value) : ""), U = q(() => {
|
|
757
757
|
if (!e.filterable) return e.options;
|
|
758
|
-
const o =
|
|
758
|
+
const o = g.value.trim().toLowerCase();
|
|
759
759
|
return o ? e.options.filter((i) => {
|
|
760
760
|
const f = X(i);
|
|
761
761
|
return String(f).toLowerCase().includes(o);
|
|
762
762
|
}) : e.options;
|
|
763
763
|
}), P = q(() => {
|
|
764
|
-
var
|
|
765
|
-
const o = { position: "fixed", zIndex: "4000" }, i =
|
|
764
|
+
var M;
|
|
765
|
+
const o = { position: "fixed", zIndex: "4000" }, i = I.value;
|
|
766
766
|
if (!i) return o;
|
|
767
|
-
const f = i.getBoundingClientRect(),
|
|
768
|
-
return o.left = `${f.left}px`, o.width = `${
|
|
767
|
+
const f = i.getBoundingClientRect(), k = ((M = C.value) == null ? void 0 : M.getBoundingClientRect().width) || f.width;
|
|
768
|
+
return o.left = `${f.left}px`, o.width = `${k}px`, $.value ? (o.bottom = `${window.innerHeight - f.top + 4}px`, o.top = "auto") : o.top = `${f.bottom + 4}px`, o;
|
|
769
769
|
});
|
|
770
770
|
function V() {
|
|
771
|
-
!
|
|
772
|
-
const o =
|
|
771
|
+
!m.value || !I.value || re(() => {
|
|
772
|
+
const o = I.value;
|
|
773
773
|
if (!o) return;
|
|
774
|
-
const i = o.getBoundingClientRect(), f = window.innerHeight,
|
|
775
|
-
|
|
774
|
+
const i = o.getBoundingClientRect(), f = window.innerHeight, k = 200, M = i.bottom + k + 4, T = i.top - k - 4, N = M <= f - 20, oe = T >= 20;
|
|
775
|
+
$.value = !N && oe;
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
778
|
function Z(o) {
|
|
@@ -791,15 +791,15 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
791
791
|
return typeof o == "object" && o !== null ? o[e.disabledKey] === !0 : !1;
|
|
792
792
|
}
|
|
793
793
|
function E() {
|
|
794
|
-
e.disabled || (
|
|
794
|
+
e.disabled || (m.value ? K() : F());
|
|
795
795
|
}
|
|
796
796
|
function F() {
|
|
797
|
-
e.disabled || (
|
|
798
|
-
V(), j(), e.filterable &&
|
|
797
|
+
e.disabled || (m.value = !0, re(() => {
|
|
798
|
+
V(), j(), e.filterable && w.value && (w.value.focus(), g.value = "");
|
|
799
799
|
}));
|
|
800
800
|
}
|
|
801
801
|
function K() {
|
|
802
|
-
|
|
802
|
+
m.value = !1, v.value = -1, $.value = !1, e.filterable && (g.value = "");
|
|
803
803
|
}
|
|
804
804
|
function Y(o, i) {
|
|
805
805
|
if (de(o)) return;
|
|
@@ -819,10 +819,10 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
819
819
|
let i = v.value;
|
|
820
820
|
const f = U.value.length;
|
|
821
821
|
i === -1 ? i = o > 0 ? 0 : f - 1 : i = (i + o + f) % f;
|
|
822
|
-
let
|
|
823
|
-
for (;
|
|
824
|
-
i = (i + o + f) % f,
|
|
825
|
-
v.value =
|
|
822
|
+
let k = 0;
|
|
823
|
+
for (; k < f && de(U.value[i]); )
|
|
824
|
+
i = (i + o + f) % f, k++;
|
|
825
|
+
v.value = k >= f ? -1 : i, ee();
|
|
826
826
|
}
|
|
827
827
|
function pe() {
|
|
828
828
|
if (v.value < 0) return;
|
|
@@ -830,16 +830,16 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
830
830
|
!o || de(o) || Y(o, v.value);
|
|
831
831
|
}
|
|
832
832
|
function j() {
|
|
833
|
-
if (!
|
|
834
|
-
const o =
|
|
833
|
+
if (!p.value) return;
|
|
834
|
+
const o = p.value.querySelector(".yselect__option--selected");
|
|
835
835
|
o && o.scrollIntoView({ block: "nearest" });
|
|
836
836
|
}
|
|
837
837
|
function ee() {
|
|
838
|
-
if (!
|
|
839
|
-
const i =
|
|
838
|
+
if (!p.value || v.value < 0) return;
|
|
839
|
+
const i = p.value.querySelectorAll(".yselect__option")[v.value];
|
|
840
840
|
i && i.scrollIntoView({ block: "nearest" });
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function h(o) {
|
|
843
843
|
const i = o.target;
|
|
844
844
|
(!C.value || !C.value.contains(i)) && K();
|
|
845
845
|
}
|
|
@@ -847,12 +847,12 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
847
847
|
v.value = -1;
|
|
848
848
|
});
|
|
849
849
|
function d() {
|
|
850
|
-
|
|
850
|
+
m.value && V();
|
|
851
851
|
}
|
|
852
852
|
return Ce(() => {
|
|
853
|
-
document.addEventListener("click",
|
|
853
|
+
document.addEventListener("click", h), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0);
|
|
854
854
|
}), Be(() => {
|
|
855
|
-
document.removeEventListener("click",
|
|
855
|
+
document.removeEventListener("click", h), window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
|
|
856
856
|
}), (o, i) => (s(), u("div", {
|
|
857
857
|
class: H(["yselect", { "yselect--disabled": t.disabled, [`yselect--${t.size}`]: !0 }]),
|
|
858
858
|
style: fe({ width: t.width }),
|
|
@@ -861,9 +861,9 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
861
861
|
}, [
|
|
862
862
|
l("div", {
|
|
863
863
|
ref_key: "triggerElement",
|
|
864
|
-
ref:
|
|
864
|
+
ref: I,
|
|
865
865
|
class: H(["yselect__trigger", {
|
|
866
|
-
"yselect__trigger--open":
|
|
866
|
+
"yselect__trigger--open": m.value,
|
|
867
867
|
"yselect__trigger--disabled": t.disabled,
|
|
868
868
|
"yselect__trigger--error": t.error
|
|
869
869
|
}]),
|
|
@@ -877,24 +877,24 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
877
877
|
],
|
|
878
878
|
tabindex: "0",
|
|
879
879
|
role: "combobox",
|
|
880
|
-
"aria-expanded":
|
|
880
|
+
"aria-expanded": m.value,
|
|
881
881
|
"aria-haspopup": !0
|
|
882
882
|
}, [
|
|
883
|
-
!t.filterable || !
|
|
883
|
+
!t.filterable || !m.value ? (s(), u("span", {
|
|
884
884
|
key: 0,
|
|
885
885
|
class: H(["yselect__value", { yselect__placeholder: !A.value }])
|
|
886
886
|
}, [
|
|
887
887
|
ue(o.$slots, "value", {
|
|
888
|
-
value:
|
|
888
|
+
value: b.value,
|
|
889
889
|
label: A.value
|
|
890
890
|
}, () => {
|
|
891
891
|
var f;
|
|
892
892
|
return [
|
|
893
|
-
|
|
894
|
-
(f =
|
|
893
|
+
b.value ? (s(), u(ce, { key: 0 }, [
|
|
894
|
+
(f = b.value) != null && f.flagImg ? (s(), u("img", {
|
|
895
895
|
key: 0,
|
|
896
896
|
class: "yselect__flag",
|
|
897
|
-
src:
|
|
897
|
+
src: b.value.flagImg,
|
|
898
898
|
alt: "flag"
|
|
899
899
|
}, null, 8, Ot)) : R("", !0),
|
|
900
900
|
De(" " + se(A.value), 1)
|
|
@@ -906,11 +906,11 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
906
906
|
], 2)) : Ee((s(), u("input", {
|
|
907
907
|
key: 1,
|
|
908
908
|
ref_key: "inputElement",
|
|
909
|
-
ref:
|
|
909
|
+
ref: w,
|
|
910
910
|
class: "yselect__input",
|
|
911
911
|
type: "text",
|
|
912
912
|
placeholder: A.value || t.placeholder,
|
|
913
|
-
"onUpdate:modelValue": i[0] || (i[0] = (f) =>
|
|
913
|
+
"onUpdate:modelValue": i[0] || (i[0] = (f) => g.value = f),
|
|
914
914
|
onKeydown: [
|
|
915
915
|
i[1] || (i[1] = te(() => {
|
|
916
916
|
}, ["stop"])),
|
|
@@ -921,9 +921,9 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
921
921
|
ke(te(ne, ["prevent"]), ["delete"])
|
|
922
922
|
]
|
|
923
923
|
}, null, 40, jt)), [
|
|
924
|
-
[at,
|
|
924
|
+
[at, g.value]
|
|
925
925
|
]),
|
|
926
|
-
t.clearable && !t.disabled &&
|
|
926
|
+
t.clearable && !t.disabled && b.value ? (s(), u("span", {
|
|
927
927
|
key: 2,
|
|
928
928
|
class: "yselect__clear",
|
|
929
929
|
title: "清空",
|
|
@@ -944,7 +944,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
944
944
|
], -1)
|
|
945
945
|
])])) : R("", !0),
|
|
946
946
|
l("span", {
|
|
947
|
-
class: H(["yselect__arrow", { "yselect__arrow--open":
|
|
947
|
+
class: H(["yselect__arrow", { "yselect__arrow--open": m.value }])
|
|
948
948
|
}, [...i[9] || (i[9] = [
|
|
949
949
|
l("svg", {
|
|
950
950
|
width: "12",
|
|
@@ -964,12 +964,12 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
964
964
|
], 42, Nt),
|
|
965
965
|
ve($e, { name: "yselect-dropdown" }, {
|
|
966
966
|
default: he(() => [
|
|
967
|
-
(s(),
|
|
968
|
-
|
|
967
|
+
(s(), Me(Fe, { to: "body" }, [
|
|
968
|
+
m.value ? (s(), u("div", {
|
|
969
969
|
key: 0,
|
|
970
970
|
ref_key: "dropdownEl",
|
|
971
971
|
ref: B,
|
|
972
|
-
class: H(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top":
|
|
972
|
+
class: H(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": $.value }]),
|
|
973
973
|
style: fe(P.value),
|
|
974
974
|
onMousedown: i[6] || (i[6] = te(() => {
|
|
975
975
|
}, ["stop"])),
|
|
@@ -979,22 +979,22 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
979
979
|
l("div", {
|
|
980
980
|
class: "yselect__options",
|
|
981
981
|
ref_key: "optionsContainer",
|
|
982
|
-
ref:
|
|
982
|
+
ref: p
|
|
983
983
|
}, [
|
|
984
|
-
(s(!0), u(ce, null, ge(U.value, (f,
|
|
985
|
-
key: ie(f,
|
|
984
|
+
(s(!0), u(ce, null, ge(U.value, (f, k) => (s(), u("div", {
|
|
985
|
+
key: ie(f, k),
|
|
986
986
|
class: H(["yselect__option", {
|
|
987
987
|
"yselect__option--selected": G(f),
|
|
988
988
|
"yselect__option--disabled": de(f),
|
|
989
|
-
"yselect__option--hover": v.value ===
|
|
989
|
+
"yselect__option--hover": v.value === k
|
|
990
990
|
}]),
|
|
991
|
-
onClick: (
|
|
992
|
-
onMouseenter: (
|
|
993
|
-
onMouseleave: i[5] || (i[5] = (
|
|
991
|
+
onClick: (M) => Y(f),
|
|
992
|
+
onMouseenter: (M) => v.value = k,
|
|
993
|
+
onMouseleave: i[5] || (i[5] = (M) => v.value = -1)
|
|
994
994
|
}, [
|
|
995
995
|
ue(o.$slots, "option", {
|
|
996
996
|
option: f,
|
|
997
|
-
index:
|
|
997
|
+
index: k,
|
|
998
998
|
selected: G(f)
|
|
999
999
|
}, () => [
|
|
1000
1000
|
f != null && f.flagImg ? (s(), u("img", {
|
|
@@ -1028,56 +1028,56 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1028
1028
|
] }
|
|
1029
1029
|
},
|
|
1030
1030
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
1031
|
-
setup(t, { emit:
|
|
1032
|
-
const e = t, n =
|
|
1031
|
+
setup(t, { emit: x }) {
|
|
1032
|
+
const e = t, n = x, m = z(e.pageSize), v = q(() => e.pageSizeOptions), p = q({
|
|
1033
1033
|
get: () => e.currentPage,
|
|
1034
|
-
set: (
|
|
1035
|
-
n("update:currentPage",
|
|
1034
|
+
set: ($) => {
|
|
1035
|
+
n("update:currentPage", $), n("page-change", $);
|
|
1036
1036
|
}
|
|
1037
1037
|
});
|
|
1038
|
-
function
|
|
1039
|
-
e.loading ||
|
|
1038
|
+
function I($) {
|
|
1039
|
+
e.loading || $ >= 1 && $ !== e.currentPage && (p.value = $);
|
|
1040
1040
|
}
|
|
1041
|
-
function C(
|
|
1042
|
-
e.loading || (
|
|
1041
|
+
function C($) {
|
|
1042
|
+
e.loading || (m.value = $, n("update:pageSize", $), n("page-size-change", $), p.value = 1);
|
|
1043
1043
|
}
|
|
1044
|
-
function B(
|
|
1045
|
-
e.loading || (
|
|
1044
|
+
function B($) {
|
|
1045
|
+
e.loading || ($ === "prev" ? I(p.value - 1) : $ === "next" && I(p.value + 1));
|
|
1046
1046
|
}
|
|
1047
|
-
return
|
|
1047
|
+
return m.value = e.pageSize, ae(
|
|
1048
1048
|
() => e.pageSize,
|
|
1049
|
-
(
|
|
1050
|
-
typeof
|
|
1049
|
+
($) => {
|
|
1050
|
+
typeof $ == "number" && m.value !== $ && (m.value = $);
|
|
1051
1051
|
}
|
|
1052
|
-
), (
|
|
1053
|
-
const
|
|
1052
|
+
), ($, w) => {
|
|
1053
|
+
const g = Ve("YButton"), b = Ve("YSelect");
|
|
1054
1054
|
return s(), u("div", Qt, [
|
|
1055
1055
|
l("div", Jt, [
|
|
1056
|
-
ve(
|
|
1056
|
+
ve(g, {
|
|
1057
1057
|
size: "small",
|
|
1058
1058
|
variant: "secondary",
|
|
1059
|
-
disabled:
|
|
1060
|
-
onClick:
|
|
1059
|
+
disabled: p.value === 1 || t.loading,
|
|
1060
|
+
onClick: w[0] || (w[0] = (A) => I(1))
|
|
1061
1061
|
}, {
|
|
1062
|
-
default: he(() => [...
|
|
1062
|
+
default: he(() => [...w[2] || (w[2] = [
|
|
1063
1063
|
De("首页", -1)
|
|
1064
1064
|
])]),
|
|
1065
1065
|
_: 1
|
|
1066
1066
|
}, 8, ["disabled"]),
|
|
1067
|
-
ve(
|
|
1067
|
+
ve(g, {
|
|
1068
1068
|
class: "ml-1",
|
|
1069
1069
|
variant: "secondary",
|
|
1070
1070
|
size: "small",
|
|
1071
1071
|
groupItems: [
|
|
1072
|
-
{ label: "上一页", value: "prev", disabled:
|
|
1072
|
+
{ label: "上一页", value: "prev", disabled: p.value === 1 || t.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1073
1073
|
{ label: "下一页", value: "next", disabled: t.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1074
1074
|
],
|
|
1075
1075
|
onGroupClick: B
|
|
1076
1076
|
}, null, 8, ["groupItems"]),
|
|
1077
1077
|
l("div", Xt, [
|
|
1078
|
-
ve(
|
|
1079
|
-
modelValue:
|
|
1080
|
-
"onUpdate:modelValue":
|
|
1078
|
+
ve(b, {
|
|
1079
|
+
modelValue: m.value,
|
|
1080
|
+
"onUpdate:modelValue": w[1] || (w[1] = (A) => m.value = A),
|
|
1081
1081
|
options: v.value,
|
|
1082
1082
|
size: "small",
|
|
1083
1083
|
width: "105px",
|
|
@@ -1145,18 +1145,18 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1145
1145
|
label: { default: "" }
|
|
1146
1146
|
},
|
|
1147
1147
|
setup(t) {
|
|
1148
|
-
const
|
|
1149
|
-
const
|
|
1150
|
-
if (
|
|
1151
|
-
const
|
|
1148
|
+
const x = t, e = q(() => x.tone || "default"), n = q(() => {
|
|
1149
|
+
const m = (x.label || "").trim(), v = x.tone, p = x.progress;
|
|
1150
|
+
if (p) {
|
|
1151
|
+
const I = {
|
|
1152
1152
|
incomplete: "未完成",
|
|
1153
1153
|
partiallyComplete: "部分完成",
|
|
1154
1154
|
complete: "已完成"
|
|
1155
1155
|
};
|
|
1156
|
-
return
|
|
1156
|
+
return m ? `${m},进度:${I[p] || p}` : `进度:${I[p] || p}`;
|
|
1157
1157
|
}
|
|
1158
1158
|
if (v && v !== "default") {
|
|
1159
|
-
const
|
|
1159
|
+
const I = {
|
|
1160
1160
|
informational: "信息",
|
|
1161
1161
|
success: "成功",
|
|
1162
1162
|
attention: "注意",
|
|
@@ -1164,11 +1164,11 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1164
1164
|
critical: "严重",
|
|
1165
1165
|
default: "默认"
|
|
1166
1166
|
};
|
|
1167
|
-
return
|
|
1167
|
+
return m ? `${m},语气:${I[v] || v}` : `语气:${I[v] || v}`;
|
|
1168
1168
|
}
|
|
1169
|
-
return
|
|
1169
|
+
return m || "标记";
|
|
1170
1170
|
});
|
|
1171
|
-
return (
|
|
1171
|
+
return (m, v) => (s(), u("span", {
|
|
1172
1172
|
class: H(["y-badge", [
|
|
1173
1173
|
`y-badge--${e.value}`,
|
|
1174
1174
|
`y-badge--${t.size}`,
|
|
@@ -1231,7 +1231,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1231
1231
|
])]))
|
|
1232
1232
|
])) : R("", !0),
|
|
1233
1233
|
l("span", vn, [
|
|
1234
|
-
ue(
|
|
1234
|
+
ue(m.$slots, "default", {}, () => [
|
|
1235
1235
|
De(se(t.label), 1)
|
|
1236
1236
|
], !0)
|
|
1237
1237
|
])
|
|
@@ -1258,46 +1258,46 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1258
1258
|
center: { type: Boolean, default: !1 }
|
|
1259
1259
|
},
|
|
1260
1260
|
emits: ["update:modelValue", "open", "close"],
|
|
1261
|
-
setup(t, { emit:
|
|
1262
|
-
const e = t, n =
|
|
1261
|
+
setup(t, { emit: x }) {
|
|
1262
|
+
const e = t, n = x, m = q({
|
|
1263
1263
|
get: () => e.modelValue,
|
|
1264
|
-
set: (
|
|
1265
|
-
}), v = z(null),
|
|
1266
|
-
const
|
|
1267
|
-
return
|
|
1264
|
+
set: (w) => n("update:modelValue", w)
|
|
1265
|
+
}), v = z(null), p = q(() => {
|
|
1266
|
+
const w = {};
|
|
1267
|
+
return w.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), w.margin = "0 auto", w.top = e.top, w;
|
|
1268
1268
|
});
|
|
1269
|
-
function
|
|
1269
|
+
function I() {
|
|
1270
1270
|
e.maskClosable && C();
|
|
1271
1271
|
}
|
|
1272
1272
|
function C() {
|
|
1273
|
-
|
|
1273
|
+
m.value && (m.value = !1, n("close"));
|
|
1274
1274
|
}
|
|
1275
1275
|
function B() {
|
|
1276
1276
|
e.closable && C();
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
|
|
1278
|
+
function $(w) {
|
|
1279
|
+
w.key === "Escape" && B();
|
|
1280
1280
|
}
|
|
1281
|
-
return ae(() => e.modelValue, (
|
|
1282
|
-
|
|
1283
|
-
var
|
|
1284
|
-
return (
|
|
1285
|
-
}), document.addEventListener("keydown",
|
|
1281
|
+
return ae(() => e.modelValue, (w) => {
|
|
1282
|
+
w ? (n("open"), requestAnimationFrame(() => {
|
|
1283
|
+
var g;
|
|
1284
|
+
return (g = v.value) == null ? void 0 : g.focus();
|
|
1285
|
+
}), document.addEventListener("keydown", $), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", $), document.body.style.overflow = "");
|
|
1286
1286
|
}), Ce(() => {
|
|
1287
|
-
e.modelValue && (document.addEventListener("keydown",
|
|
1287
|
+
e.modelValue && (document.addEventListener("keydown", $), document.body.style.overflow = "hidden");
|
|
1288
1288
|
}), Be(() => {
|
|
1289
|
-
document.removeEventListener("keydown",
|
|
1290
|
-
}), (
|
|
1289
|
+
document.removeEventListener("keydown", $), document.body.style.overflow = "";
|
|
1290
|
+
}), (w, g) => (s(), Me(Fe, { to: "body" }, [
|
|
1291
1291
|
Ee(l("div", {
|
|
1292
1292
|
class: "y-dialog-root",
|
|
1293
1293
|
role: "dialog",
|
|
1294
1294
|
"aria-modal": !0,
|
|
1295
|
-
"aria-hidden": !
|
|
1295
|
+
"aria-hidden": !m.value,
|
|
1296
1296
|
style: fe({ zIndex: String(t.zIndex) })
|
|
1297
1297
|
}, [
|
|
1298
1298
|
l("div", {
|
|
1299
1299
|
class: "y-dialog-mask",
|
|
1300
|
-
onClick:
|
|
1300
|
+
onClick: I
|
|
1301
1301
|
}),
|
|
1302
1302
|
ve($e, { name: "dialog-zoom-fade" }, {
|
|
1303
1303
|
default: he(() => [
|
|
@@ -1305,12 +1305,12 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1305
1305
|
ref_key: "panelRef",
|
|
1306
1306
|
ref: v,
|
|
1307
1307
|
class: H(["y-dialog-panel", [t.center ? "is-center" : ""]]),
|
|
1308
|
-
style: fe(
|
|
1308
|
+
style: fe(p.value),
|
|
1309
1309
|
onKeydown: ke(te(B, ["prevent", "stop"]), ["esc"]),
|
|
1310
1310
|
tabindex: "-1"
|
|
1311
1311
|
}, [
|
|
1312
1312
|
t.showHeader ? (s(), u("div", mn, [
|
|
1313
|
-
ue(
|
|
1313
|
+
ue(w.$slots, "header", {}, () => [
|
|
1314
1314
|
l("div", wn, se(t.title), 1)
|
|
1315
1315
|
], !0),
|
|
1316
1316
|
t.closable ? (s(), u("button", {
|
|
@@ -1322,19 +1322,19 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1322
1322
|
}, " ✕ ")) : R("", !0)
|
|
1323
1323
|
])) : R("", !0),
|
|
1324
1324
|
l("div", bn, [
|
|
1325
|
-
ue(
|
|
1325
|
+
ue(w.$slots, "default", {}, void 0, !0)
|
|
1326
1326
|
]),
|
|
1327
|
-
|
|
1328
|
-
ue(
|
|
1327
|
+
w.$slots.footer ? (s(), u("div", kn, [
|
|
1328
|
+
ue(w.$slots, "footer", {}, void 0, !0)
|
|
1329
1329
|
])) : R("", !0)
|
|
1330
1330
|
], 46, gn), [
|
|
1331
|
-
[Ke,
|
|
1331
|
+
[Ke, m.value]
|
|
1332
1332
|
])
|
|
1333
1333
|
]),
|
|
1334
1334
|
_: 3
|
|
1335
1335
|
})
|
|
1336
1336
|
], 12, yn), [
|
|
1337
|
-
[Ke,
|
|
1337
|
+
[Ke, m.value]
|
|
1338
1338
|
])
|
|
1339
1339
|
]));
|
|
1340
1340
|
}
|
|
@@ -1357,125 +1357,125 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1357
1357
|
modelValue: { type: Boolean, default: !1 }
|
|
1358
1358
|
},
|
|
1359
1359
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1360
|
-
setup(t, { expose:
|
|
1361
|
-
const n = t,
|
|
1362
|
-
let
|
|
1360
|
+
setup(t, { expose: x, emit: e }) {
|
|
1361
|
+
const n = t, m = e, v = z(), p = z(), I = z(), C = z(!1), B = z(), $ = z(), w = z({});
|
|
1362
|
+
let g = null, b = null;
|
|
1363
1363
|
const A = q(() => {
|
|
1364
1364
|
if (!C.value || !B.value) return {};
|
|
1365
1365
|
const j = {};
|
|
1366
1366
|
n.width !== "auto" && (j.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (j.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1367
|
-
const { top: ee, left:
|
|
1368
|
-
return j.top = `${ee}px`, j.left = `${
|
|
1367
|
+
const { top: ee, left: h } = P();
|
|
1368
|
+
return j.top = `${ee}px`, j.left = `${h}px`, j;
|
|
1369
1369
|
}), U = q(() => {
|
|
1370
1370
|
if (!n.showArrow) return {};
|
|
1371
|
-
if (Object.keys(
|
|
1372
|
-
return
|
|
1371
|
+
if (Object.keys(w.value).length > 0)
|
|
1372
|
+
return w.value;
|
|
1373
1373
|
const j = {};
|
|
1374
1374
|
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? j.left = "50%" : j.top = "50%", j;
|
|
1375
1375
|
});
|
|
1376
1376
|
function P() {
|
|
1377
1377
|
var N, oe;
|
|
1378
1378
|
if (!B.value) return { top: 0, left: 0 };
|
|
1379
|
-
const { width: j, height: ee, top:
|
|
1380
|
-
let f = 0,
|
|
1379
|
+
const { width: j, height: ee, top: h, left: d } = B.value, o = ((N = I.value) == null ? void 0 : N.offsetWidth) || 200, i = ((oe = I.value) == null ? void 0 : oe.offsetHeight) || 100;
|
|
1380
|
+
let f = 0, k = 0;
|
|
1381
1381
|
switch (n.placement) {
|
|
1382
1382
|
case "top":
|
|
1383
|
-
f =
|
|
1383
|
+
f = h - i - n.offset, k = d + (j - o) / 2;
|
|
1384
1384
|
break;
|
|
1385
1385
|
case "top-start":
|
|
1386
|
-
f =
|
|
1386
|
+
f = h - i - n.offset, k = d;
|
|
1387
1387
|
break;
|
|
1388
1388
|
case "top-end":
|
|
1389
|
-
f =
|
|
1389
|
+
f = h - i - n.offset, k = d + j - o;
|
|
1390
1390
|
break;
|
|
1391
1391
|
case "bottom":
|
|
1392
|
-
f =
|
|
1392
|
+
f = h + ee + n.offset, k = d + (j - o) / 2;
|
|
1393
1393
|
break;
|
|
1394
1394
|
case "bottom-start":
|
|
1395
|
-
f =
|
|
1395
|
+
f = h + ee + n.offset, k = d;
|
|
1396
1396
|
break;
|
|
1397
1397
|
case "bottom-end":
|
|
1398
|
-
f =
|
|
1398
|
+
f = h + ee + n.offset, k = d + j - o;
|
|
1399
1399
|
break;
|
|
1400
1400
|
case "left":
|
|
1401
|
-
f =
|
|
1401
|
+
f = h + (ee - i) / 2, k = d - o - n.offset;
|
|
1402
1402
|
break;
|
|
1403
1403
|
case "left-start":
|
|
1404
|
-
f =
|
|
1404
|
+
f = h, k = d - o - n.offset;
|
|
1405
1405
|
break;
|
|
1406
1406
|
case "left-end":
|
|
1407
|
-
f =
|
|
1407
|
+
f = h + ee - i, k = d - o - n.offset;
|
|
1408
1408
|
break;
|
|
1409
1409
|
case "right":
|
|
1410
|
-
f =
|
|
1410
|
+
f = h + (ee - i) / 2, k = d + j + n.offset;
|
|
1411
1411
|
break;
|
|
1412
1412
|
case "right-start":
|
|
1413
|
-
f =
|
|
1413
|
+
f = h, k = d + j + n.offset;
|
|
1414
1414
|
break;
|
|
1415
1415
|
case "right-end":
|
|
1416
|
-
f =
|
|
1416
|
+
f = h + ee - i, k = d + j + n.offset;
|
|
1417
1417
|
break;
|
|
1418
1418
|
}
|
|
1419
|
-
const
|
|
1420
|
-
return
|
|
1419
|
+
const M = window.innerWidth, T = window.innerHeight;
|
|
1420
|
+
return k < 8 && (k = 8), k + o > M - 8 && (k = M - o - 8), f < 8 && (f = 8), f + i > T - 8 && (f = T - i - 8), { top: f, left: k };
|
|
1421
1421
|
}
|
|
1422
1422
|
function V() {
|
|
1423
|
-
n.disabled || C.value || (G(), n.openDelay > 0 ?
|
|
1423
|
+
n.disabled || C.value || (G(), n.openDelay > 0 ? g = setTimeout(() => {
|
|
1424
1424
|
Z();
|
|
1425
1425
|
}, n.openDelay) : Z());
|
|
1426
1426
|
}
|
|
1427
1427
|
function Z() {
|
|
1428
|
-
|
|
1428
|
+
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"), re(() => {
|
|
1429
1429
|
re(() => {
|
|
1430
1430
|
E();
|
|
1431
1431
|
});
|
|
1432
1432
|
});
|
|
1433
1433
|
}
|
|
1434
1434
|
function X() {
|
|
1435
|
-
C.value && (G(), n.closeDelay > 0 ?
|
|
1435
|
+
C.value && (G(), n.closeDelay > 0 ? b = setTimeout(() => {
|
|
1436
1436
|
ie();
|
|
1437
1437
|
}, n.closeDelay) : ie());
|
|
1438
1438
|
}
|
|
1439
1439
|
function ie() {
|
|
1440
|
-
|
|
1440
|
+
m("before-hide"), C.value = !1, m("update:modelValue", !1), m("hide");
|
|
1441
1441
|
}
|
|
1442
1442
|
function G() {
|
|
1443
|
-
|
|
1443
|
+
g && (clearTimeout(g), g = null), b && (clearTimeout(b), b = null);
|
|
1444
1444
|
}
|
|
1445
1445
|
function de() {
|
|
1446
|
-
if (!n.showArrow || !B.value || !
|
|
1447
|
-
|
|
1446
|
+
if (!n.showArrow || !B.value || !I.value) {
|
|
1447
|
+
w.value = {};
|
|
1448
1448
|
return;
|
|
1449
1449
|
}
|
|
1450
|
-
const j = B.value, ee =
|
|
1450
|
+
const j = B.value, ee = I.value.getBoundingClientRect();
|
|
1451
1451
|
if (ee.width === 0 || ee.height === 0) {
|
|
1452
1452
|
const d = {};
|
|
1453
|
-
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? d.left = "50%" : d.top = "50%",
|
|
1453
|
+
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? d.left = "50%" : d.top = "50%", w.value = d;
|
|
1454
1454
|
return;
|
|
1455
1455
|
}
|
|
1456
|
-
const
|
|
1456
|
+
const h = {};
|
|
1457
1457
|
if (n.placement.startsWith("top")) {
|
|
1458
|
-
|
|
1458
|
+
h.bottom = "-6px";
|
|
1459
1459
|
const d = j.left + j.width / 2, o = ee.left, i = d - o;
|
|
1460
|
-
|
|
1460
|
+
h.left = `${Math.max(12, Math.min(i, ee.width - 12))}px`;
|
|
1461
1461
|
} else if (n.placement.startsWith("bottom")) {
|
|
1462
|
-
|
|
1462
|
+
h.top = "-6px";
|
|
1463
1463
|
const d = j.left + j.width / 2, o = ee.left, i = d - o;
|
|
1464
|
-
|
|
1464
|
+
h.left = `${Math.max(12, Math.min(i, ee.width - 12))}px`;
|
|
1465
1465
|
} else if (n.placement.startsWith("left")) {
|
|
1466
|
-
|
|
1466
|
+
h.right = "-6px";
|
|
1467
1467
|
const d = j.top + j.height / 2, o = ee.top, i = d - o;
|
|
1468
|
-
|
|
1468
|
+
h.top = `${Math.max(12, Math.min(i, ee.height - 12))}px`;
|
|
1469
1469
|
} else if (n.placement.startsWith("right")) {
|
|
1470
|
-
|
|
1470
|
+
h.left = "-6px";
|
|
1471
1471
|
const d = j.top + j.height / 2, o = ee.top, i = d - o;
|
|
1472
|
-
|
|
1472
|
+
h.top = `${Math.max(12, Math.min(i, ee.height - 12))}px`;
|
|
1473
1473
|
}
|
|
1474
|
-
|
|
1474
|
+
w.value = h;
|
|
1475
1475
|
}
|
|
1476
1476
|
function E() {
|
|
1477
|
-
|
|
1478
|
-
|
|
1477
|
+
p.value && (B.value = p.value.getBoundingClientRect(), I.value && ($.value = I.value.getBoundingClientRect(), de(), C.value && requestAnimationFrame(() => {
|
|
1478
|
+
I.value && ($.value = I.value.getBoundingClientRect(), de());
|
|
1479
1479
|
})));
|
|
1480
1480
|
}
|
|
1481
1481
|
function F() {
|
|
@@ -1496,7 +1496,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1496
1496
|
function pe(j) {
|
|
1497
1497
|
if (!n.closeOnClickOutside || !C.value) return;
|
|
1498
1498
|
const ee = j.target;
|
|
1499
|
-
v.value && !v.value.contains(ee) &&
|
|
1499
|
+
v.value && !v.value.contains(ee) && I.value && !I.value.contains(ee) && X();
|
|
1500
1500
|
}
|
|
1501
1501
|
return ae(() => n.modelValue, (j) => {
|
|
1502
1502
|
j !== C.value && (j ? V() : X());
|
|
@@ -1512,7 +1512,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1512
1512
|
n.modelValue && V();
|
|
1513
1513
|
}), Be(() => {
|
|
1514
1514
|
G(), document.removeEventListener("click", pe), window.removeEventListener("resize", E), window.removeEventListener("scroll", E, !0);
|
|
1515
|
-
}),
|
|
1515
|
+
}), x({
|
|
1516
1516
|
show: V,
|
|
1517
1517
|
hide: X,
|
|
1518
1518
|
updatePosition: E
|
|
@@ -1523,20 +1523,20 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1523
1523
|
}, [
|
|
1524
1524
|
l("div", {
|
|
1525
1525
|
ref_key: "triggerRef",
|
|
1526
|
-
ref:
|
|
1526
|
+
ref: p,
|
|
1527
1527
|
onClick: F,
|
|
1528
1528
|
onMouseenter: K,
|
|
1529
1529
|
onMouseleave: Y
|
|
1530
1530
|
}, [
|
|
1531
1531
|
ue(j.$slots, "reference", {}, void 0, !0)
|
|
1532
1532
|
], 544),
|
|
1533
|
-
(s(),
|
|
1533
|
+
(s(), Me(Fe, { to: "body" }, [
|
|
1534
1534
|
ve($e, { name: "ypopover-fade" }, {
|
|
1535
1535
|
default: he(() => [
|
|
1536
1536
|
C.value ? (s(), u("div", {
|
|
1537
1537
|
key: 0,
|
|
1538
1538
|
ref_key: "contentRef",
|
|
1539
|
-
ref:
|
|
1539
|
+
ref: I,
|
|
1540
1540
|
class: H(["ypopover__content", [
|
|
1541
1541
|
`ypopover__content--${t.placement}`,
|
|
1542
1542
|
{
|
|
@@ -1565,7 +1565,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1565
1565
|
]))
|
|
1566
1566
|
], 512));
|
|
1567
1567
|
}
|
|
1568
|
-
}), _n = /* @__PURE__ */ be(Cn, [["__scopeId", "data-v-be755399"]]), Sn = { class: "relative" },
|
|
1568
|
+
}), _n = /* @__PURE__ */ be(Cn, [["__scopeId", "data-v-be755399"]]), Sn = { class: "relative" }, Mn = ["value", "placeholder"], In = { class: "nh-time-suffix" }, Ln = { class: "nh-time-shortcuts" }, En = { class: "nh-time-shortcuts-list" }, Bn = ["onClick", "onKeydown", "onMouseenter"], Tn = { class: "nh-time-custom" }, zn = { class: "nh-time-custom-header" }, Kn = { class: "nh-time-selection-status" }, Hn = {
|
|
1569
1569
|
key: 0,
|
|
1570
1570
|
class: "status-text"
|
|
1571
1571
|
}, Rn = {
|
|
@@ -1583,8 +1583,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1583
1583
|
{
|
|
1584
1584
|
label: "今天",
|
|
1585
1585
|
getValue: () => {
|
|
1586
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1587
|
-
return { startDate:
|
|
1586
|
+
const t = /* @__PURE__ */ new Date(), x = new Date(t.getFullYear(), t.getMonth(), t.getDate()), e = new Date(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59);
|
|
1587
|
+
return { startDate: x, endDate: e };
|
|
1588
1588
|
}
|
|
1589
1589
|
},
|
|
1590
1590
|
{
|
|
@@ -1592,29 +1592,29 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1592
1592
|
getValue: () => {
|
|
1593
1593
|
const t = /* @__PURE__ */ new Date();
|
|
1594
1594
|
t.setDate(t.getDate() - 1);
|
|
1595
|
-
const
|
|
1596
|
-
return { startDate:
|
|
1595
|
+
const x = new Date(t.getFullYear(), t.getMonth(), t.getDate()), e = new Date(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59);
|
|
1596
|
+
return { startDate: x, endDate: e };
|
|
1597
1597
|
}
|
|
1598
1598
|
},
|
|
1599
1599
|
{
|
|
1600
1600
|
label: "近7天",
|
|
1601
1601
|
getValue: () => {
|
|
1602
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1603
|
-
return
|
|
1602
|
+
const t = /* @__PURE__ */ new Date(), x = /* @__PURE__ */ new Date();
|
|
1603
|
+
return x.setDate(x.getDate() - 6), x.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), { startDate: x, endDate: t };
|
|
1604
1604
|
}
|
|
1605
1605
|
},
|
|
1606
1606
|
{
|
|
1607
1607
|
label: "近30天",
|
|
1608
1608
|
getValue: () => {
|
|
1609
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1610
|
-
return
|
|
1609
|
+
const t = /* @__PURE__ */ new Date(), x = /* @__PURE__ */ new Date();
|
|
1610
|
+
return x.setDate(x.getDate() - 29), x.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), { startDate: x, endDate: t };
|
|
1611
1611
|
}
|
|
1612
1612
|
},
|
|
1613
1613
|
{
|
|
1614
1614
|
label: "近3个月",
|
|
1615
1615
|
getValue: () => {
|
|
1616
|
-
const t = /* @__PURE__ */ new Date(),
|
|
1617
|
-
return
|
|
1616
|
+
const t = /* @__PURE__ */ new Date(), x = /* @__PURE__ */ new Date();
|
|
1617
|
+
return x.setMonth(x.getMonth() - 3), x.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), { startDate: x, endDate: t };
|
|
1618
1618
|
}
|
|
1619
1619
|
}
|
|
1620
1620
|
] },
|
|
@@ -1624,27 +1624,27 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1624
1624
|
size: { default: "small" }
|
|
1625
1625
|
},
|
|
1626
1626
|
emits: ["update:modelValue", "change"],
|
|
1627
|
-
setup(t, { emit:
|
|
1628
|
-
const e = t, n =
|
|
1627
|
+
setup(t, { emit: x }) {
|
|
1628
|
+
const e = t, n = x, m = z(!1), v = z(-1), p = z(-1), I = z(null), C = z(), B = z(), $ = z({
|
|
1629
1629
|
top: !0,
|
|
1630
1630
|
left: !0
|
|
1631
|
-
}),
|
|
1631
|
+
}), w = z({
|
|
1632
1632
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1633
1633
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1634
|
-
}),
|
|
1634
|
+
}), g = z({
|
|
1635
1635
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1636
1636
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1637
|
-
}),
|
|
1638
|
-
const r = new Date(
|
|
1637
|
+
}), b = () => {
|
|
1638
|
+
const r = new Date(w.value.year, w.value.month).getTime(), y = new Date(g.value.year, g.value.month).getTime();
|
|
1639
1639
|
if (r >= y) {
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1640
|
+
const S = new Date(w.value.year, w.value.month + 1);
|
|
1641
|
+
g.value.year = S.getFullYear(), g.value.month = S.getMonth();
|
|
1642
1642
|
}
|
|
1643
1643
|
}, A = () => {
|
|
1644
|
-
const r = new Date(
|
|
1645
|
-
if (new Date(
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1644
|
+
const r = new Date(w.value.year, w.value.month).getTime();
|
|
1645
|
+
if (new Date(g.value.year, g.value.month).getTime() <= r) {
|
|
1646
|
+
const S = new Date(g.value.year, g.value.month - 1);
|
|
1647
|
+
w.value.year = S.getFullYear(), w.value.month = S.getMonth();
|
|
1648
1648
|
}
|
|
1649
1649
|
}, U = ["一", "二", "三", "四", "五", "六", "日"], P = z(null), V = z(null), Z = (r) => {
|
|
1650
1650
|
if (!r) return null;
|
|
@@ -1658,12 +1658,12 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1658
1658
|
return null;
|
|
1659
1659
|
}, X = (r) => {
|
|
1660
1660
|
if (!r) return null;
|
|
1661
|
-
const y = r.getFullYear(),
|
|
1661
|
+
const y = r.getFullYear(), S = String(r.getMonth() + 1).padStart(2, "0"), O = String(r.getDate()).padStart(2, "0");
|
|
1662
1662
|
if (e.includeTime) {
|
|
1663
|
-
const a = String(r.getHours()).padStart(2, "0"), c = String(r.getMinutes()).padStart(2, "0"),
|
|
1664
|
-
return `${y}-${
|
|
1663
|
+
const a = String(r.getHours()).padStart(2, "0"), c = String(r.getMinutes()).padStart(2, "0"), D = String(r.getSeconds()).padStart(2, "0");
|
|
1664
|
+
return `${y}-${S}-${O} ${a}:${c}:${D}`;
|
|
1665
1665
|
} else
|
|
1666
|
-
return `${y}-${
|
|
1666
|
+
return `${y}-${S}-${O}`;
|
|
1667
1667
|
}, ie = (r) => r ? r.getTime() : null, G = (r) => r ? {
|
|
1668
1668
|
startDate: Z(r.startDate),
|
|
1669
1669
|
endDate: Z(r.endDate)
|
|
@@ -1673,12 +1673,12 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1673
1673
|
} : e.format === "timestamp" ? {
|
|
1674
1674
|
startDate: ie(r.startDate),
|
|
1675
1675
|
endDate: ie(r.endDate)
|
|
1676
|
-
} : r, E = (r, y) => `${String(y + 1).padStart(2, "0")}/${r}`, F = (r, y) => r.getFullYear() === y.getFullYear() && r.getMonth() === y.getMonth() && r.getDate() === y.getDate(), K = (r, y,
|
|
1676
|
+
} : r, E = (r, y) => `${String(y + 1).padStart(2, "0")}/${r}`, F = (r, y) => r.getFullYear() === y.getFullYear() && r.getMonth() === y.getMonth() && r.getDate() === y.getDate(), K = (r, y, S) => !y || !S ? !1 : r >= y && r <= S, Y = (r) => {
|
|
1677
1677
|
const y = G(r);
|
|
1678
1678
|
if (!(y != null && y.startDate) || !(y != null && y.endDate))
|
|
1679
1679
|
return -1;
|
|
1680
|
-
for (let
|
|
1681
|
-
const O = e.shortcuts[
|
|
1680
|
+
for (let S = 0; S < e.shortcuts.length; S++) {
|
|
1681
|
+
const O = e.shortcuts[S].getValue();
|
|
1682
1682
|
if (O.startDate && O.endDate && y.startDate && y.endDate) {
|
|
1683
1683
|
const a = new Date(
|
|
1684
1684
|
y.startDate.getFullYear(),
|
|
@@ -1688,7 +1688,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1688
1688
|
y.endDate.getFullYear(),
|
|
1689
1689
|
y.endDate.getMonth(),
|
|
1690
1690
|
y.endDate.getDate()
|
|
1691
|
-
),
|
|
1691
|
+
), D = new Date(
|
|
1692
1692
|
O.startDate.getFullYear(),
|
|
1693
1693
|
O.startDate.getMonth(),
|
|
1694
1694
|
O.startDate.getDate()
|
|
@@ -1697,16 +1697,16 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1697
1697
|
O.endDate.getMonth(),
|
|
1698
1698
|
O.endDate.getDate()
|
|
1699
1699
|
);
|
|
1700
|
-
if (a.getTime() ===
|
|
1701
|
-
return
|
|
1700
|
+
if (a.getTime() === D.getTime() && c.getTime() === _.getTime())
|
|
1701
|
+
return S;
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
1704
|
return -1;
|
|
1705
1705
|
}, ne = (r, y) => {
|
|
1706
|
-
const
|
|
1707
|
-
for (let le =
|
|
1706
|
+
const S = new Date(r, y, 1), O = new Date(r, y + 1, 0), a = S.getDay(), c = O.getDate(), D = [], _ = /* @__PURE__ */ new Date(), L = a === 0 ? 6 : a - 1, W = new Date(r, y, 0);
|
|
1707
|
+
for (let le = L - 1; le >= 0; le--) {
|
|
1708
1708
|
const xe = new Date(r, y - 1, W.getDate() - le);
|
|
1709
|
-
|
|
1709
|
+
D.push({
|
|
1710
1710
|
date: xe,
|
|
1711
1711
|
day: xe.getDate(),
|
|
1712
1712
|
isCurrentMonth: !1,
|
|
@@ -1719,7 +1719,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1719
1719
|
}
|
|
1720
1720
|
for (let le = 1; le <= c; le++) {
|
|
1721
1721
|
const xe = new Date(r, y, le);
|
|
1722
|
-
|
|
1722
|
+
D.push({
|
|
1723
1723
|
date: xe,
|
|
1724
1724
|
day: le,
|
|
1725
1725
|
isCurrentMonth: !0,
|
|
@@ -1729,10 +1729,10 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1729
1729
|
isDisabled: !1
|
|
1730
1730
|
});
|
|
1731
1731
|
}
|
|
1732
|
-
const J = 42 -
|
|
1732
|
+
const J = 42 - D.length;
|
|
1733
1733
|
for (let le = 1; le <= J; le++) {
|
|
1734
1734
|
const xe = new Date(r, y + 1, le);
|
|
1735
|
-
|
|
1735
|
+
D.push({
|
|
1736
1736
|
date: xe,
|
|
1737
1737
|
day: le,
|
|
1738
1738
|
isCurrentMonth: !1,
|
|
@@ -1744,142 +1744,142 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
const ye = [];
|
|
1747
|
-
for (let le = 0; le <
|
|
1748
|
-
ye.push(
|
|
1747
|
+
for (let le = 0; le < D.length; le += 7)
|
|
1748
|
+
ye.push(D.slice(le, le + 7));
|
|
1749
1749
|
return ye;
|
|
1750
1750
|
}, Q = (r) => {
|
|
1751
1751
|
const y = de(r);
|
|
1752
1752
|
n("update:modelValue", y), n("change", y);
|
|
1753
1753
|
}, pe = () => {
|
|
1754
1754
|
if (!C.value || !B.value) return;
|
|
1755
|
-
const r = C.value.getBoundingClientRect(), y = B.value.getBoundingClientRect(),
|
|
1756
|
-
a <
|
|
1757
|
-
const _ =
|
|
1758
|
-
_ <
|
|
1755
|
+
const r = C.value.getBoundingClientRect(), y = B.value.getBoundingClientRect(), S = window.innerWidth, a = window.innerHeight - r.bottom, c = r.top, D = y.height || 400;
|
|
1756
|
+
a < D && c > D ? $.value.top = !1 : $.value.top = !0;
|
|
1757
|
+
const _ = S - r.left, L = y.width || 640;
|
|
1758
|
+
_ < L ? $.value.left = !1 : $.value.left = !0;
|
|
1759
1759
|
}, j = () => {
|
|
1760
|
-
if (
|
|
1760
|
+
if (m.value = !m.value, m.value) {
|
|
1761
1761
|
const r = G(e.modelValue);
|
|
1762
|
-
if (P.value = (r == null ? void 0 : r.startDate) || null, V.value = (r == null ? void 0 : r.endDate) || null,
|
|
1763
|
-
|
|
1762
|
+
if (P.value = (r == null ? void 0 : r.startDate) || null, V.value = (r == null ? void 0 : r.endDate) || null, p.value = Y(e.modelValue), v.value = -1, r != null && r.startDate && (w.value.year = r.startDate.getFullYear(), w.value.month = r.startDate.getMonth()), r != null && r.endDate)
|
|
1763
|
+
g.value.year = r.endDate.getFullYear(), g.value.month = r.endDate.getMonth();
|
|
1764
1764
|
else {
|
|
1765
|
-
const y = new Date(
|
|
1766
|
-
|
|
1765
|
+
const y = new Date(w.value.year, w.value.month + 1);
|
|
1766
|
+
g.value.year = y.getFullYear(), g.value.month = y.getMonth();
|
|
1767
1767
|
}
|
|
1768
|
-
|
|
1768
|
+
b(), re(() => {
|
|
1769
1769
|
pe();
|
|
1770
1770
|
});
|
|
1771
1771
|
}
|
|
1772
1772
|
}, ee = (r) => {
|
|
1773
|
-
const y = r.target,
|
|
1774
|
-
|
|
1775
|
-
},
|
|
1776
|
-
r.key === "Enter" || r.key === " " ? (r.preventDefault(), j()) : r.key === "ArrowDown" && (r.preventDefault(),
|
|
1777
|
-
pe(),
|
|
1773
|
+
const y = r.target, S = C.value, O = B.value;
|
|
1774
|
+
S && O && !S.contains(y) && !O.contains(y) && (m.value = !1, v.value = -1);
|
|
1775
|
+
}, h = (r) => {
|
|
1776
|
+
r.key === "Enter" || r.key === " " ? (r.preventDefault(), j()) : r.key === "ArrowDown" && (r.preventDefault(), m.value = !0, re(() => {
|
|
1777
|
+
pe(), k();
|
|
1778
1778
|
}));
|
|
1779
1779
|
}, d = (r) => {
|
|
1780
1780
|
var y;
|
|
1781
|
-
r.key === "Escape" && (
|
|
1781
|
+
r.key === "Escape" && (m.value = !1, v.value = -1, (y = C.value) == null || y.focus());
|
|
1782
1782
|
}, o = (r, y) => {
|
|
1783
|
-
r.key === "ArrowDown" ? (r.preventDefault(), v.value = Math.min(y + 1, e.shortcuts.length - 1),
|
|
1783
|
+
r.key === "ArrowDown" ? (r.preventDefault(), v.value = Math.min(y + 1, e.shortcuts.length - 1), M(v.value)) : r.key === "ArrowUp" ? (r.preventDefault(), v.value = Math.max(y - 1, 0), M(v.value)) : (r.key === "Enter" || r.key === " ") && (r.preventDefault(), T(e.shortcuts[y]));
|
|
1784
1784
|
}, i = (r) => {
|
|
1785
1785
|
v.value = r;
|
|
1786
1786
|
}, f = () => {
|
|
1787
1787
|
v.value = -1;
|
|
1788
|
-
},
|
|
1789
|
-
v.value = 0,
|
|
1790
|
-
},
|
|
1788
|
+
}, k = () => {
|
|
1789
|
+
v.value = 0, M(0);
|
|
1790
|
+
}, M = (r) => {
|
|
1791
1791
|
if (B.value) {
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1792
|
+
const S = B.value.querySelectorAll(".nh-time-shortcut")[r];
|
|
1793
|
+
S && S.focus();
|
|
1794
1794
|
}
|
|
1795
1795
|
}, T = (r) => {
|
|
1796
1796
|
const y = r.getValue();
|
|
1797
|
-
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), Q(y),
|
|
1797
|
+
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), Q(y), p.value = e.shortcuts.findIndex((S) => S.label === r.label), v.value = -1, m.value = !1;
|
|
1798
1798
|
}, N = (r, y) => {
|
|
1799
1799
|
if (!r || r.isDisabled) return;
|
|
1800
|
-
let
|
|
1801
|
-
if (e.includeTime ? (
|
|
1802
|
-
P.value =
|
|
1800
|
+
let S;
|
|
1801
|
+
if (e.includeTime ? (S = new Date(r.date), y === "start" || !P.value ? S.setHours(0, 0, 0, 0) : S.setHours(23, 59, 59, 999)) : S = new Date(r.date.getFullYear(), r.date.getMonth(), r.date.getDate()), !P.value && !V.value)
|
|
1802
|
+
P.value = S, V.value = null;
|
|
1803
1803
|
else if (P.value && !V.value)
|
|
1804
|
-
if (
|
|
1805
|
-
e.includeTime &&
|
|
1804
|
+
if (S >= P.value)
|
|
1805
|
+
e.includeTime && S.setHours(23, 59, 59, 999), V.value = S;
|
|
1806
1806
|
else {
|
|
1807
1807
|
const O = P.value;
|
|
1808
|
-
e.includeTime && O.setHours(23, 59, 59, 999), V.value = O, P.value =
|
|
1808
|
+
e.includeTime && O.setHours(23, 59, 59, 999), V.value = O, P.value = S;
|
|
1809
1809
|
}
|
|
1810
1810
|
else
|
|
1811
|
-
P.value =
|
|
1812
|
-
if (
|
|
1811
|
+
P.value = S, V.value = null;
|
|
1812
|
+
if (p.value = -1, P.value && V.value) {
|
|
1813
1813
|
const O = new Date(V.value);
|
|
1814
|
-
e.includeTime && O.setHours(23, 59, 59, 999),
|
|
1814
|
+
e.includeTime && O.setHours(23, 59, 59, 999), I.value = {
|
|
1815
1815
|
startDate: P.value,
|
|
1816
1816
|
endDate: O
|
|
1817
1817
|
};
|
|
1818
1818
|
} else
|
|
1819
|
-
|
|
1819
|
+
I.value = null;
|
|
1820
1820
|
}, oe = (r, y) => {
|
|
1821
1821
|
if (!r) return ["nh-date-table-td"];
|
|
1822
|
-
const
|
|
1823
|
-
return r.isCurrentMonth ||
|
|
1822
|
+
const S = ["nh-date-table-td"];
|
|
1823
|
+
return r.isCurrentMonth || S.push("is-prev-month"), r.isToday && S.push("is-today"), r.isDisabled && S.push("is-disabled"), P.value && F(r.date, P.value) && S.push("is-selected", "is-start"), V.value && F(r.date, V.value) && S.push("is-selected", "is-end"), P.value && V.value && K(r.date, P.value, V.value) && S.push("is-in-range"), S;
|
|
1824
1824
|
}, me = () => {
|
|
1825
|
-
|
|
1825
|
+
I.value && (e.includeTime && I.value.endDate && I.value.endDate.setHours(23, 59, 59, 999), Q(I.value), p.value = Y(I.value), m.value = !1);
|
|
1826
1826
|
}, _e = () => {
|
|
1827
|
-
Q({ startDate: null, endDate: null }), We(), v.value = -1,
|
|
1827
|
+
Q({ startDate: null, endDate: null }), We(), v.value = -1, m.value = !1;
|
|
1828
1828
|
}, He = () => {
|
|
1829
|
-
|
|
1829
|
+
m.value && re(() => {
|
|
1830
1830
|
pe();
|
|
1831
1831
|
});
|
|
1832
|
-
}, qe = q(() => ne(
|
|
1832
|
+
}, qe = q(() => ne(w.value.year, w.value.month)), Te = q(() => ne(g.value.year, g.value.month)), Ie = q(() => {
|
|
1833
1833
|
const r = G(e.modelValue);
|
|
1834
1834
|
if (!r || !r.startDate || !r.endDate)
|
|
1835
1835
|
return "";
|
|
1836
1836
|
const y = (a) => {
|
|
1837
|
-
const c = String(a.getFullYear()),
|
|
1838
|
-
return `${c}/${
|
|
1839
|
-
},
|
|
1840
|
-
return !e.includeTime &&
|
|
1841
|
-
}),
|
|
1837
|
+
const c = String(a.getFullYear()), D = String(a.getMonth() + 1).padStart(2, "0"), _ = String(a.getDate()).padStart(2, "0");
|
|
1838
|
+
return `${c}/${D}/${_}`;
|
|
1839
|
+
}, S = y(r.startDate), O = y(r.endDate);
|
|
1840
|
+
return !e.includeTime && S === O ? S : `${S} - ${O}`;
|
|
1841
|
+
}), Le = q(() => [
|
|
1842
1842
|
"nh-time-dropdown",
|
|
1843
1843
|
{
|
|
1844
|
-
"nh-time-dropdown-top":
|
|
1845
|
-
"nh-time-dropdown-right":
|
|
1844
|
+
"nh-time-dropdown-top": !$.value.top,
|
|
1845
|
+
"nh-time-dropdown-right": !$.value.left
|
|
1846
1846
|
}
|
|
1847
1847
|
]), Re = q(() => {
|
|
1848
1848
|
const r = G(e.modelValue);
|
|
1849
1849
|
return !!(r != null && r.startDate && (r != null && r.endDate));
|
|
1850
1850
|
}), Ae = q(() => !!(P.value && V.value)), We = () => {
|
|
1851
|
-
P.value = null, V.value = null,
|
|
1851
|
+
P.value = null, V.value = null, I.value = null, p.value = -1;
|
|
1852
1852
|
};
|
|
1853
1853
|
ae(() => e.modelValue, (r) => {
|
|
1854
1854
|
const y = G(r);
|
|
1855
1855
|
if (y != null && y.startDate) {
|
|
1856
|
-
const
|
|
1857
|
-
|
|
1856
|
+
const S = y.startDate;
|
|
1857
|
+
w.value.year = S.getFullYear(), w.value.month = S.getMonth();
|
|
1858
1858
|
}
|
|
1859
1859
|
if (y != null && y.endDate) {
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1860
|
+
const S = y.endDate;
|
|
1861
|
+
g.value.year = S.getFullYear(), g.value.month = S.getMonth();
|
|
1862
1862
|
} else if (y != null && y.startDate) {
|
|
1863
|
-
const
|
|
1864
|
-
|
|
1863
|
+
const S = new Date(w.value.year, w.value.month + 1);
|
|
1864
|
+
g.value.year = S.getFullYear(), g.value.month = S.getMonth();
|
|
1865
1865
|
}
|
|
1866
|
-
(y != null && y.startDate || y != null && y.endDate) &&
|
|
1867
|
-
}, { immediate: !0, deep: !0 }), ae([
|
|
1868
|
-
const r = new Date(
|
|
1866
|
+
(y != null && y.startDate || y != null && y.endDate) && b(), m.value || (p.value = Y(r));
|
|
1867
|
+
}, { immediate: !0, deep: !0 }), ae([w, g], () => {
|
|
1868
|
+
const r = new Date(w.value.year, w.value.month).getTime(), y = new Date(g.value.year, g.value.month).getTime();
|
|
1869
1869
|
if (r === y) {
|
|
1870
|
-
const
|
|
1871
|
-
|
|
1870
|
+
const S = new Date(w.value.year, w.value.month + 1);
|
|
1871
|
+
g.value.year = S.getFullYear(), g.value.month = S.getMonth();
|
|
1872
1872
|
}
|
|
1873
1873
|
}, { deep: !0 }), Ce(() => {
|
|
1874
|
-
document.addEventListener("click", ee), window.addEventListener("resize", He), window.addEventListener("scroll", He),
|
|
1874
|
+
document.addEventListener("click", ee), window.addEventListener("resize", He), window.addEventListener("scroll", He), p.value = Y(e.modelValue);
|
|
1875
1875
|
const r = G(e.modelValue);
|
|
1876
|
-
if (r != null && r.startDate && (
|
|
1877
|
-
|
|
1876
|
+
if (r != null && r.startDate && (w.value.year = r.startDate.getFullYear(), w.value.month = r.startDate.getMonth()), r != null && r.endDate)
|
|
1877
|
+
g.value.year = r.endDate.getFullYear(), g.value.month = r.endDate.getMonth();
|
|
1878
1878
|
else {
|
|
1879
|
-
const y = new Date(
|
|
1880
|
-
|
|
1879
|
+
const y = new Date(w.value.year, w.value.month + 1);
|
|
1880
|
+
g.value.year = y.getFullYear(), g.value.month = y.getMonth();
|
|
1881
1881
|
}
|
|
1882
|
-
|
|
1882
|
+
b();
|
|
1883
1883
|
}), Be(() => {
|
|
1884
1884
|
document.removeEventListener("click", ee), window.removeEventListener("resize", He), window.removeEventListener("scroll", He);
|
|
1885
1885
|
});
|
|
@@ -1887,15 +1887,15 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1887
1887
|
e.clearable && (Q({ startDate: null, endDate: null }), We(), v.value = -1);
|
|
1888
1888
|
}, ze = (r, y) => {
|
|
1889
1889
|
if (r === "start") {
|
|
1890
|
-
const
|
|
1891
|
-
|
|
1890
|
+
const S = new Date(w.value.year, w.value.month + y, 1);
|
|
1891
|
+
w.value.year = S.getFullYear(), w.value.month = S.getMonth(), b();
|
|
1892
1892
|
} else {
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1893
|
+
const S = new Date(g.value.year, g.value.month + y, 1);
|
|
1894
|
+
g.value.year = S.getFullYear(), g.value.month = S.getMonth(), A();
|
|
1895
1895
|
}
|
|
1896
1896
|
};
|
|
1897
1897
|
return (r, y) => {
|
|
1898
|
-
const
|
|
1898
|
+
const S = Ve("YButton");
|
|
1899
1899
|
return s(), u("div", {
|
|
1900
1900
|
class: H(["nh-time-search", [`nh-time--${t.size}`]])
|
|
1901
1901
|
}, [
|
|
@@ -1904,17 +1904,17 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1904
1904
|
ref_key: "trigger",
|
|
1905
1905
|
ref: C,
|
|
1906
1906
|
onClick: j,
|
|
1907
|
-
onKeydown:
|
|
1908
|
-
class: H(["nh-time-trigger", { "is-focus":
|
|
1907
|
+
onKeydown: h,
|
|
1908
|
+
class: H(["nh-time-trigger", { "is-focus": m.value, "has-value": Re.value }]),
|
|
1909
1909
|
tabindex: "0"
|
|
1910
1910
|
}, [
|
|
1911
1911
|
l("input", {
|
|
1912
1912
|
readonly: "",
|
|
1913
|
-
value:
|
|
1913
|
+
value: Ie.value,
|
|
1914
1914
|
placeholder: t.placeholder,
|
|
1915
1915
|
class: "nh-time-input"
|
|
1916
|
-
}, null, 8,
|
|
1917
|
-
l("span",
|
|
1916
|
+
}, null, 8, Mn),
|
|
1917
|
+
l("span", In, [
|
|
1918
1918
|
t.clearable && Re.value ? (s(), u("i", {
|
|
1919
1919
|
key: 0,
|
|
1920
1920
|
onClick: te(Pe, ["stop"]),
|
|
@@ -1944,7 +1944,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1944
1944
|
])
|
|
1945
1945
|
], -1)),
|
|
1946
1946
|
l("i", {
|
|
1947
|
-
class: H(["nh-time-arrow", { "is-reverse":
|
|
1947
|
+
class: H(["nh-time-arrow", { "is-reverse": m.value }])
|
|
1948
1948
|
}, [...y[5] || (y[5] = [
|
|
1949
1949
|
l("svg", {
|
|
1950
1950
|
viewBox: "0 0 1024 1024",
|
|
@@ -1961,14 +1961,14 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1961
1961
|
], 34),
|
|
1962
1962
|
ve($e, { name: "el-zoom-in-top" }, {
|
|
1963
1963
|
default: he(() => [
|
|
1964
|
-
|
|
1964
|
+
m.value ? (s(), u("div", {
|
|
1965
1965
|
key: 0,
|
|
1966
1966
|
ref_key: "dropdown",
|
|
1967
1967
|
ref: B,
|
|
1968
|
-
class: H(
|
|
1968
|
+
class: H(Le.value),
|
|
1969
1969
|
onKeydown: d
|
|
1970
1970
|
}, [
|
|
1971
|
-
l("div",
|
|
1971
|
+
l("div", Ln, [
|
|
1972
1972
|
y[7] || (y[7] = l("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1973
1973
|
l("ul", En, [
|
|
1974
1974
|
(s(!0), u(ce, null, ge(t.shortcuts, (O, a) => (s(), u("li", {
|
|
@@ -1981,7 +1981,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
1981
1981
|
"nh-time-shortcut",
|
|
1982
1982
|
{
|
|
1983
1983
|
"is-active": v.value === a,
|
|
1984
|
-
"is-selected":
|
|
1984
|
+
"is-selected": p.value === a
|
|
1985
1985
|
}
|
|
1986
1986
|
]),
|
|
1987
1987
|
tabindex: "0"
|
|
@@ -2015,7 +2015,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2015
2015
|
})
|
|
2016
2016
|
], -1)
|
|
2017
2017
|
])]),
|
|
2018
|
-
l("span", Yn, se(E(
|
|
2018
|
+
l("span", Yn, se(E(w.value.year, w.value.month)), 1),
|
|
2019
2019
|
l("button", {
|
|
2020
2020
|
onClick: y[1] || (y[1] = (O) => ze("start", 1)),
|
|
2021
2021
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2047,8 +2047,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2047
2047
|
(s(!0), u(ce, null, ge(qe.value, (O, a) => (s(), u("tr", {
|
|
2048
2048
|
key: `start-week-${a}`
|
|
2049
2049
|
}, [
|
|
2050
|
-
(s(!0), u(ce, null, ge(O, (c,
|
|
2051
|
-
key: `start-day-${a}-${
|
|
2050
|
+
(s(!0), u(ce, null, ge(O, (c, D) => (s(), u("td", {
|
|
2051
|
+
key: `start-day-${a}-${D}`,
|
|
2052
2052
|
class: H(oe(c)),
|
|
2053
2053
|
onClick: (_) => N(c, "start")
|
|
2054
2054
|
}, [
|
|
@@ -2081,7 +2081,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2081
2081
|
})
|
|
2082
2082
|
], -1)
|
|
2083
2083
|
])]),
|
|
2084
|
-
l("span", Xn, se(E(
|
|
2084
|
+
l("span", Xn, se(E(g.value.year, g.value.month)), 1),
|
|
2085
2085
|
l("button", {
|
|
2086
2086
|
onClick: y[3] || (y[3] = (O) => ze("end", 1)),
|
|
2087
2087
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2113,8 +2113,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2113
2113
|
(s(!0), u(ce, null, ge(Te.value, (O, a) => (s(), u("tr", {
|
|
2114
2114
|
key: `end-week-${a}`
|
|
2115
2115
|
}, [
|
|
2116
|
-
(s(!0), u(ce, null, ge(O, (c,
|
|
2117
|
-
key: `end-day-${a}-${
|
|
2116
|
+
(s(!0), u(ce, null, ge(O, (c, D) => (s(), u("td", {
|
|
2117
|
+
key: `end-day-${a}-${D}`,
|
|
2118
2118
|
class: H(oe(c)),
|
|
2119
2119
|
onClick: (_) => N(c, "end")
|
|
2120
2120
|
}, [
|
|
@@ -2130,7 +2130,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2130
2130
|
])
|
|
2131
2131
|
]),
|
|
2132
2132
|
l("div", ol, [
|
|
2133
|
-
t.clearable ? (s(),
|
|
2133
|
+
t.clearable ? (s(), Me(S, {
|
|
2134
2134
|
key: 0,
|
|
2135
2135
|
onClick: _e,
|
|
2136
2136
|
variant: "secondary",
|
|
@@ -2141,7 +2141,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2141
2141
|
])]),
|
|
2142
2142
|
_: 1
|
|
2143
2143
|
}, 8, ["size"])) : R("", !0),
|
|
2144
|
-
ve(
|
|
2144
|
+
ve(S, {
|
|
2145
2145
|
onClick: me,
|
|
2146
2146
|
disabled: !Ae.value,
|
|
2147
2147
|
variant: "primary",
|
|
@@ -2182,35 +2182,35 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2182
2182
|
showText: { type: Boolean, default: !1 }
|
|
2183
2183
|
},
|
|
2184
2184
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2185
|
-
setup(t, { emit:
|
|
2186
|
-
const e = t, n =
|
|
2185
|
+
setup(t, { emit: x }) {
|
|
2186
|
+
const e = t, n = x, m = z(), v = q(() => e.modelValue === e.trueValue), p = q(() => {
|
|
2187
2187
|
const C = {};
|
|
2188
2188
|
return C.background = v.value ? e.activeColor : e.inactiveColor, C;
|
|
2189
2189
|
});
|
|
2190
|
-
function
|
|
2190
|
+
function I() {
|
|
2191
2191
|
if (e.disabled || e.loading) return;
|
|
2192
2192
|
const C = v.value ? e.falseValue : e.trueValue;
|
|
2193
2193
|
n("update:modelValue", C), n("change", C);
|
|
2194
2194
|
}
|
|
2195
2195
|
return Ce(() => {
|
|
2196
|
-
const C =
|
|
2196
|
+
const C = m.value;
|
|
2197
2197
|
C && (C.addEventListener("focus", (B) => n("focus", B)), C.addEventListener("blur", (B) => n("blur", B)));
|
|
2198
2198
|
}), (C, B) => (s(), u("button", {
|
|
2199
2199
|
ref_key: "rootEl",
|
|
2200
|
-
ref:
|
|
2200
|
+
ref: m,
|
|
2201
2201
|
class: H(["yswitch", [
|
|
2202
2202
|
`yswitch--${t.size}`,
|
|
2203
2203
|
{ "yswitch--checked": v.value, "yswitch--disabled": t.disabled, "yswitch--loading": t.loading }
|
|
2204
2204
|
]]),
|
|
2205
|
-
style: fe(
|
|
2205
|
+
style: fe(p.value),
|
|
2206
2206
|
role: "switch",
|
|
2207
2207
|
"aria-checked": v.value,
|
|
2208
2208
|
"aria-disabled": t.disabled,
|
|
2209
2209
|
disabled: t.disabled || t.loading,
|
|
2210
|
-
onClick:
|
|
2210
|
+
onClick: I,
|
|
2211
2211
|
onKeydown: [
|
|
2212
|
-
ke(te(
|
|
2213
|
-
ke(te(
|
|
2212
|
+
ke(te(I, ["prevent"]), ["enter"]),
|
|
2213
|
+
ke(te(I, ["prevent"]), ["space"])
|
|
2214
2214
|
]
|
|
2215
2215
|
}, [
|
|
2216
2216
|
B[0] || (B[0] = l("span", { class: "yswitch__track" }, null, -1)),
|
|
@@ -2238,8 +2238,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2238
2238
|
previewSrcList: {}
|
|
2239
2239
|
},
|
|
2240
2240
|
emits: ["load", "error", "preview"],
|
|
2241
|
-
setup(t, { expose:
|
|
2242
|
-
const n = t,
|
|
2241
|
+
setup(t, { expose: x, emit: e }) {
|
|
2242
|
+
const n = t, m = e, v = z(), p = z(), I = z(), C = z(!1), B = z(!1), $ = z(!1), w = z(!1), g = z(!1), b = z("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), A = z(""), U = z(1), P = z(!1), V = z({
|
|
2243
2243
|
overflow: "",
|
|
2244
2244
|
paddingRight: ""
|
|
2245
2245
|
}), Z = {
|
|
@@ -2293,7 +2293,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2293
2293
|
!n.lazy || !v.value || (Q = new IntersectionObserver(
|
|
2294
2294
|
(T) => {
|
|
2295
2295
|
T.forEach((N) => {
|
|
2296
|
-
N.isIntersecting && (
|
|
2296
|
+
N.isIntersecting && (w.value = !0, b.value = n.src, Q == null || Q.unobserve(N.target));
|
|
2297
2297
|
});
|
|
2298
2298
|
},
|
|
2299
2299
|
{
|
|
@@ -2301,22 +2301,22 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2301
2301
|
}
|
|
2302
2302
|
), Q.observe(v.value));
|
|
2303
2303
|
}, j = (T) => {
|
|
2304
|
-
C.value = !0, B.value = !1,
|
|
2304
|
+
C.value = !0, B.value = !1, $.value = !1, m("load", T);
|
|
2305
2305
|
}, ee = (T) => {
|
|
2306
|
-
|
|
2307
|
-
},
|
|
2308
|
-
|
|
2309
|
-
|
|
2306
|
+
$.value = !0, B.value = !1, C.value = !1, m("error", T);
|
|
2307
|
+
}, h = () => {
|
|
2308
|
+
$.value = !1, B.value = !0, C.value = !1, re(() => {
|
|
2309
|
+
p.value && (p.value.src = n.src);
|
|
2310
2310
|
});
|
|
2311
2311
|
}, d = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, o = () => {
|
|
2312
|
-
n.preview && (n.previewSrcList || n.src) ? i() :
|
|
2312
|
+
n.preview && (n.previewSrcList || n.src) ? i() : h();
|
|
2313
2313
|
}, i = () => {
|
|
2314
2314
|
if (!n.preview) return;
|
|
2315
2315
|
U.value = 1;
|
|
2316
2316
|
const T = d();
|
|
2317
|
-
if (
|
|
2317
|
+
if (p.value && p.value.complete && p.value.naturalWidth > 0) {
|
|
2318
2318
|
A.value = T, re(() => {
|
|
2319
|
-
|
|
2319
|
+
g.value = !0, Y(), m("preview", T);
|
|
2320
2320
|
});
|
|
2321
2321
|
return;
|
|
2322
2322
|
}
|
|
@@ -2324,7 +2324,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2324
2324
|
let oe = null, me = !1;
|
|
2325
2325
|
const _e = () => {
|
|
2326
2326
|
me || (me = !0, oe && (clearTimeout(oe), oe = null), A.value = T, re(() => {
|
|
2327
|
-
|
|
2327
|
+
g.value = !0, Y(), m("preview", T);
|
|
2328
2328
|
}));
|
|
2329
2329
|
};
|
|
2330
2330
|
oe = setTimeout(() => {
|
|
@@ -2335,31 +2335,31 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2335
2335
|
_e();
|
|
2336
2336
|
}, N.src = T, N.complete && _e();
|
|
2337
2337
|
}, f = () => {
|
|
2338
|
-
|
|
2338
|
+
g.value = !1, setTimeout(() => {
|
|
2339
2339
|
ne();
|
|
2340
2340
|
}, 300);
|
|
2341
|
-
},
|
|
2341
|
+
}, k = (T) => {
|
|
2342
2342
|
const N = T.deltaY < 0 ? 1 : -1;
|
|
2343
2343
|
let me = U.value + N * 0.1;
|
|
2344
2344
|
me = Math.max(0.5, Math.min(2, me)), U.value = me;
|
|
2345
2345
|
};
|
|
2346
2346
|
return Ce(() => {
|
|
2347
|
-
n.lazy ? pe() :
|
|
2347
|
+
n.lazy ? pe() : w.value = !0, w.value && (B.value = !0), P.value = !0;
|
|
2348
2348
|
}), Be(() => {
|
|
2349
|
-
Q && Q.disconnect(),
|
|
2350
|
-
}), ae(() =>
|
|
2351
|
-
n.src &&
|
|
2349
|
+
Q && Q.disconnect(), g.value && ne();
|
|
2350
|
+
}), ae(() => b.value, () => {
|
|
2351
|
+
n.src && w.value && (B.value = !0, $.value = !1, C.value = !1);
|
|
2352
2352
|
}), ae(() => n.src, (T) => {
|
|
2353
|
-
|
|
2354
|
-
}),
|
|
2355
|
-
retryLoad:
|
|
2353
|
+
b.value = T || "";
|
|
2354
|
+
}), x({
|
|
2355
|
+
retryLoad: h,
|
|
2356
2356
|
closePreview: f
|
|
2357
2357
|
}), (T, N) => (s(), u("div", {
|
|
2358
2358
|
ref_key: "containerRef",
|
|
2359
2359
|
ref: v,
|
|
2360
2360
|
class: H(["yimage-container", X.value])
|
|
2361
2361
|
}, [
|
|
2362
|
-
!C.value &&
|
|
2362
|
+
!C.value && !$.value && !w.value ? (s(), u("div", {
|
|
2363
2363
|
key: 0,
|
|
2364
2364
|
class: "yimage-placeholder",
|
|
2365
2365
|
style: fe(G.value)
|
|
@@ -2380,7 +2380,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2380
2380
|
])
|
|
2381
2381
|
], -1)
|
|
2382
2382
|
])], 4)) : R("", !0),
|
|
2383
|
-
B.value &&
|
|
2383
|
+
B.value && !$.value ? (s(), u("div", {
|
|
2384
2384
|
key: 1,
|
|
2385
2385
|
class: "yimage-loading",
|
|
2386
2386
|
style: fe(G.value)
|
|
@@ -2389,7 +2389,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2389
2389
|
l("div", { class: "yimage-spinner" })
|
|
2390
2390
|
], -1)
|
|
2391
2391
|
])], 4)) : R("", !0),
|
|
2392
|
-
|
|
2392
|
+
$.value ? (s(), u("div", {
|
|
2393
2393
|
key: 2,
|
|
2394
2394
|
class: "yimage-error",
|
|
2395
2395
|
style: fe(G.value),
|
|
@@ -2404,8 +2404,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2404
2404
|
], 4)) : R("", !0),
|
|
2405
2405
|
Ee(l("img", {
|
|
2406
2406
|
ref_key: "imageRef",
|
|
2407
|
-
ref:
|
|
2408
|
-
src:
|
|
2407
|
+
ref: p,
|
|
2408
|
+
src: b.value,
|
|
2409
2409
|
alt: t.alt,
|
|
2410
2410
|
class: H(de.value),
|
|
2411
2411
|
onLoad: j,
|
|
@@ -2413,31 +2413,31 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2413
2413
|
onClick: te(i, ["stop"]),
|
|
2414
2414
|
style: fe(E.value)
|
|
2415
2415
|
}, null, 46, cl), [
|
|
2416
|
-
[Ke, C.value &&
|
|
2416
|
+
[Ke, C.value && !$.value]
|
|
2417
2417
|
]),
|
|
2418
|
-
n.preview && (!C.value || B.value ||
|
|
2418
|
+
n.preview && (!C.value || B.value || $.value || !w.value) ? (s(), u("div", {
|
|
2419
2419
|
key: 3,
|
|
2420
2420
|
class: "yimage-preview-trigger",
|
|
2421
2421
|
onClick: te(i, ["stop"])
|
|
2422
2422
|
})) : R("", !0),
|
|
2423
|
-
P.value ? (s(),
|
|
2423
|
+
P.value ? (s(), Me(Fe, {
|
|
2424
2424
|
key: 4,
|
|
2425
2425
|
to: "body"
|
|
2426
2426
|
}, [
|
|
2427
2427
|
ve($e, { name: "fade" }, {
|
|
2428
2428
|
default: he(() => [
|
|
2429
|
-
|
|
2429
|
+
g.value ? (s(), u("div", {
|
|
2430
2430
|
key: 0,
|
|
2431
2431
|
class: "yimage-preview-mask",
|
|
2432
2432
|
onClick: te(f, ["self"]),
|
|
2433
|
-
onWheel: te(
|
|
2433
|
+
onWheel: te(k, ["prevent"])
|
|
2434
2434
|
}, [
|
|
2435
2435
|
l("div", {
|
|
2436
|
-
class: H(["yimage-preview-content", { "is-active":
|
|
2436
|
+
class: H(["yimage-preview-content", { "is-active": g.value }])
|
|
2437
2437
|
}, [
|
|
2438
2438
|
l("img", {
|
|
2439
2439
|
ref_key: "previewImageRef",
|
|
2440
|
-
ref:
|
|
2440
|
+
ref: I,
|
|
2441
2441
|
src: F.value,
|
|
2442
2442
|
alt: t.alt,
|
|
2443
2443
|
class: "yimage-preview-image",
|
|
@@ -2462,32 +2462,32 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2462
2462
|
menuWidth: { default: void 0 }
|
|
2463
2463
|
},
|
|
2464
2464
|
setup(t) {
|
|
2465
|
-
const
|
|
2466
|
-
let
|
|
2467
|
-
const v = q(() => `y-dropdown__menu--${
|
|
2468
|
-
if (!
|
|
2469
|
-
const
|
|
2465
|
+
const x = t, e = z(!1), n = z();
|
|
2466
|
+
let m = null;
|
|
2467
|
+
const v = q(() => `y-dropdown__menu--${x.placement}`), p = q(() => {
|
|
2468
|
+
if (!x.menuWidth) return {};
|
|
2469
|
+
const g = typeof x.menuWidth == "number" ? `${x.menuWidth}px` : x.menuWidth;
|
|
2470
2470
|
return {
|
|
2471
|
-
width:
|
|
2472
|
-
minWidth:
|
|
2473
|
-
maxWidth:
|
|
2471
|
+
width: g,
|
|
2472
|
+
minWidth: g,
|
|
2473
|
+
maxWidth: g
|
|
2474
2474
|
};
|
|
2475
|
-
}),
|
|
2476
|
-
console.log("显示下拉菜单", e.value), !
|
|
2475
|
+
}), I = () => {
|
|
2476
|
+
console.log("显示下拉菜单", e.value), !x.disabled && (m && (clearTimeout(m), m = null), e.value = !0, console.log("设置 visible 为 true", e.value), re(() => {
|
|
2477
2477
|
B();
|
|
2478
2478
|
}));
|
|
2479
2479
|
}, C = () => {
|
|
2480
|
-
console.log("隐藏下拉菜单"),
|
|
2480
|
+
console.log("隐藏下拉菜单"), m = setTimeout(() => {
|
|
2481
2481
|
e.value = !1, console.log("设置 visible 为 false", e.value);
|
|
2482
2482
|
}, 150);
|
|
2483
2483
|
}, B = () => {
|
|
2484
2484
|
if (!n.value) return;
|
|
2485
|
-
const
|
|
2486
|
-
if (!
|
|
2487
|
-
const A =
|
|
2488
|
-
|
|
2485
|
+
const g = n.value.querySelector(".y-dropdown__trigger"), b = n.value.querySelector(".y-dropdown__menu");
|
|
2486
|
+
if (!g || !b) return;
|
|
2487
|
+
const A = g.getBoundingClientRect(), U = b.getBoundingClientRect(), P = window.innerWidth, V = window.innerHeight;
|
|
2488
|
+
b.style.top = "", b.style.left = "", b.style.right = "", b.style.bottom = "", b.style.transform = "";
|
|
2489
2489
|
let Z = 0, X = 0;
|
|
2490
|
-
switch (
|
|
2490
|
+
switch (x.placement) {
|
|
2491
2491
|
case "bottom":
|
|
2492
2492
|
Z = A.height + 4, X = 0;
|
|
2493
2493
|
break;
|
|
@@ -2502,43 +2502,43 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2502
2502
|
break;
|
|
2503
2503
|
}
|
|
2504
2504
|
let ie = A.top + Z, G = A.left + X;
|
|
2505
|
-
if (
|
|
2505
|
+
if (x.placement === "bottom" || x.placement === "top") {
|
|
2506
2506
|
const de = U.width || 260;
|
|
2507
2507
|
G + de > P - 10 && (G = P - de - 10), G < 10 && (G = 10);
|
|
2508
2508
|
}
|
|
2509
|
-
if (
|
|
2509
|
+
if (x.placement === "left" || x.placement === "right") {
|
|
2510
2510
|
const de = U.height || 200;
|
|
2511
2511
|
ie + de > V - 10 && (ie = V - de - 10), ie < 10 && (ie = 10);
|
|
2512
2512
|
}
|
|
2513
|
-
|
|
2514
|
-
},
|
|
2515
|
-
|
|
2516
|
-
},
|
|
2513
|
+
b.style.top = `${ie}px`, b.style.left = `${G}px`;
|
|
2514
|
+
}, $ = (g) => {
|
|
2515
|
+
x.trigger === "click" && n.value && !n.value.contains(g.target) && (e.value = !1);
|
|
2516
|
+
}, w = () => {
|
|
2517
2517
|
e.value && B();
|
|
2518
2518
|
};
|
|
2519
2519
|
return Ce(() => {
|
|
2520
|
-
|
|
2520
|
+
x.trigger === "click" && document.addEventListener("click", $), window.addEventListener("resize", w), window.addEventListener("scroll", w);
|
|
2521
2521
|
}), Be(() => {
|
|
2522
|
-
|
|
2522
|
+
x.trigger === "click" && document.removeEventListener("click", $), m && clearTimeout(m), window.removeEventListener("resize", w), window.removeEventListener("scroll", w);
|
|
2523
2523
|
}), ae(
|
|
2524
|
-
() =>
|
|
2524
|
+
() => x.menuWidth,
|
|
2525
2525
|
() => {
|
|
2526
2526
|
e.value && re(() => {
|
|
2527
2527
|
B();
|
|
2528
2528
|
});
|
|
2529
2529
|
}
|
|
2530
|
-
), (
|
|
2530
|
+
), (g, b) => (s(), u("div", {
|
|
2531
2531
|
class: "y-dropdown",
|
|
2532
2532
|
ref_key: "dropdownRef",
|
|
2533
2533
|
ref: n
|
|
2534
2534
|
}, [
|
|
2535
2535
|
l("div", {
|
|
2536
2536
|
class: "y-dropdown__trigger",
|
|
2537
|
-
onMouseenter:
|
|
2537
|
+
onMouseenter: I,
|
|
2538
2538
|
onMouseleave: C
|
|
2539
2539
|
}, [
|
|
2540
|
-
ue(
|
|
2541
|
-
|
|
2540
|
+
ue(g.$slots, "trigger", {}, () => [
|
|
2541
|
+
b[0] || (b[0] = l("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2542
2542
|
], !0)
|
|
2543
2543
|
], 32),
|
|
2544
2544
|
ve($e, {
|
|
@@ -2548,14 +2548,14 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2548
2548
|
default: he(() => [
|
|
2549
2549
|
Ee(l("div", {
|
|
2550
2550
|
class: H(["y-dropdown__menu", v.value]),
|
|
2551
|
-
style: fe(
|
|
2552
|
-
onMouseenter:
|
|
2551
|
+
style: fe(p.value),
|
|
2552
|
+
onMouseenter: I,
|
|
2553
2553
|
onMouseleave: C
|
|
2554
2554
|
}, [
|
|
2555
|
-
ue(
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2555
|
+
ue(g.$slots, "default", {}, () => [
|
|
2556
|
+
b[1] || (b[1] = l("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2557
|
+
b[2] || (b[2] = l("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2558
|
+
b[3] || (b[3] = l("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2559
2559
|
], !0)
|
|
2560
2560
|
], 38), [
|
|
2561
2561
|
[Ke, e.value]
|
|
@@ -2585,58 +2585,58 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2585
2585
|
showHeader: { type: Boolean, default: !0 }
|
|
2586
2586
|
},
|
|
2587
2587
|
emits: ["update:modelValue", "open", "close"],
|
|
2588
|
-
setup(t, { emit:
|
|
2589
|
-
const e = t, n =
|
|
2588
|
+
setup(t, { emit: x }) {
|
|
2589
|
+
const e = t, n = x, m = q({
|
|
2590
2590
|
get: () => e.modelValue,
|
|
2591
|
-
set: (
|
|
2592
|
-
}), v = z(null),
|
|
2593
|
-
const
|
|
2594
|
-
return e.placement === "right" ? (
|
|
2591
|
+
set: (b) => n("update:modelValue", b)
|
|
2592
|
+
}), v = z(null), p = q(() => e.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), I = q(() => e.placement === "right" ? "rounded-left" : "rounded-top"), C = q(() => {
|
|
2593
|
+
const b = {};
|
|
2594
|
+
return e.placement === "right" ? (b.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), b.height = "100%", b.right = "0", b.top = "0") : (b.height = typeof e.height == "number" ? `${e.height}px` : String(e.height), b.width = "100%", b.bottom = "0", b.left = "0"), b;
|
|
2595
2595
|
});
|
|
2596
2596
|
function B() {
|
|
2597
|
-
e.maskClosable &&
|
|
2597
|
+
e.maskClosable && $();
|
|
2598
2598
|
}
|
|
2599
|
-
function
|
|
2600
|
-
|
|
2599
|
+
function $() {
|
|
2600
|
+
m.value && (m.value = !1, n("close"));
|
|
2601
2601
|
}
|
|
2602
|
-
function
|
|
2603
|
-
e.closable &&
|
|
2602
|
+
function w() {
|
|
2603
|
+
e.closable && $();
|
|
2604
2604
|
}
|
|
2605
|
-
function
|
|
2606
|
-
|
|
2605
|
+
function g(b) {
|
|
2606
|
+
b.key === "Escape" && w();
|
|
2607
2607
|
}
|
|
2608
|
-
return ae(() => e.modelValue, (
|
|
2609
|
-
|
|
2608
|
+
return ae(() => e.modelValue, (b) => {
|
|
2609
|
+
b ? (n("open"), requestAnimationFrame(() => {
|
|
2610
2610
|
var A;
|
|
2611
2611
|
return (A = v.value) == null ? void 0 : A.focus();
|
|
2612
|
-
}), document.addEventListener("keydown",
|
|
2612
|
+
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2613
2613
|
}), Ce(() => {
|
|
2614
|
-
e.modelValue && (document.addEventListener("keydown",
|
|
2614
|
+
e.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2615
2615
|
}), Be(() => {
|
|
2616
|
-
document.removeEventListener("keydown",
|
|
2617
|
-
}), (
|
|
2616
|
+
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2617
|
+
}), (b, A) => (s(), Me(Fe, { to: "body" }, [
|
|
2618
2618
|
Ee(l("div", {
|
|
2619
2619
|
class: "y-drawer-root",
|
|
2620
2620
|
role: "dialog",
|
|
2621
2621
|
"aria-modal": !0,
|
|
2622
|
-
"aria-hidden": !
|
|
2622
|
+
"aria-hidden": !m.value,
|
|
2623
2623
|
style: fe({ zIndex: String(t.zIndex) })
|
|
2624
2624
|
}, [
|
|
2625
2625
|
l("div", {
|
|
2626
2626
|
class: "y-drawer-mask",
|
|
2627
2627
|
onClick: B
|
|
2628
2628
|
}),
|
|
2629
|
-
ve($e, { name:
|
|
2629
|
+
ve($e, { name: p.value }, {
|
|
2630
2630
|
default: he(() => [
|
|
2631
2631
|
Ee(l("div", {
|
|
2632
2632
|
ref_key: "panelRef",
|
|
2633
2633
|
ref: v,
|
|
2634
2634
|
class: H(["y-drawer-panel", [
|
|
2635
2635
|
`is-${t.placement}`,
|
|
2636
|
-
|
|
2636
|
+
I.value
|
|
2637
2637
|
]]),
|
|
2638
2638
|
style: fe(C.value),
|
|
2639
|
-
onKeydown: ke(te(
|
|
2639
|
+
onKeydown: ke(te(w, ["prevent", "stop"]), ["esc"]),
|
|
2640
2640
|
tabindex: "-1"
|
|
2641
2641
|
}, [
|
|
2642
2642
|
t.showHeader ? (s(), u("div", wl, [
|
|
@@ -2646,30 +2646,30 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2646
2646
|
type: "button",
|
|
2647
2647
|
class: "y-drawer-close",
|
|
2648
2648
|
"aria-label": "Close",
|
|
2649
|
-
onClick:
|
|
2649
|
+
onClick: $
|
|
2650
2650
|
}, " ✕ ")) : R("", !0)
|
|
2651
2651
|
])) : R("", !0),
|
|
2652
2652
|
l("div", kl, [
|
|
2653
|
-
ue(
|
|
2653
|
+
ue(b.$slots, "default", {}, void 0, !0)
|
|
2654
2654
|
]),
|
|
2655
|
-
|
|
2656
|
-
ue(
|
|
2655
|
+
b.$slots.footer ? (s(), u("div", xl, [
|
|
2656
|
+
ue(b.$slots, "footer", {}, void 0, !0)
|
|
2657
2657
|
])) : R("", !0)
|
|
2658
2658
|
], 46, ml), [
|
|
2659
|
-
[Ke,
|
|
2659
|
+
[Ke, m.value]
|
|
2660
2660
|
])
|
|
2661
2661
|
]),
|
|
2662
2662
|
_: 3
|
|
2663
2663
|
}, 8, ["name"])
|
|
2664
2664
|
], 12, gl), [
|
|
2665
|
-
[Ke,
|
|
2665
|
+
[Ke, m.value]
|
|
2666
2666
|
])
|
|
2667
2667
|
]));
|
|
2668
2668
|
}
|
|
2669
|
-
}), Dl = /* @__PURE__ */ be($l, [["__scopeId", "data-v-b2797950"]]), Cl = { class: "ytree__container" }, _l = ["data-level", "onClick", "onContextmenu"], Sl = ["onClick"],
|
|
2669
|
+
}), Dl = /* @__PURE__ */ be($l, [["__scopeId", "data-v-b2797950"]]), Cl = { class: "ytree__container" }, _l = ["data-level", "onClick", "onContextmenu"], Sl = ["onClick"], Ml = {
|
|
2670
2670
|
key: 1,
|
|
2671
2671
|
class: "w-[16px]"
|
|
2672
|
-
},
|
|
2672
|
+
}, Il = ["onClick"], Ll = {
|
|
2673
2673
|
key: 0,
|
|
2674
2674
|
width: "12",
|
|
2675
2675
|
height: "12",
|
|
@@ -2801,8 +2801,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2801
2801
|
enableChildStyleCustomClick: { type: Boolean, default: !1 }
|
|
2802
2802
|
},
|
|
2803
2803
|
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"],
|
|
2804
|
-
setup(t, { expose:
|
|
2805
|
-
const n = t,
|
|
2804
|
+
setup(t, { expose: x, emit: e }) {
|
|
2805
|
+
const n = t, m = e, v = q(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), p = z({
|
|
2806
2806
|
currentNode: null,
|
|
2807
2807
|
currentKey: null,
|
|
2808
2808
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2810,256 +2810,256 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
2810
2810
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2811
2811
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2812
2812
|
});
|
|
2813
|
-
st("treeStore",
|
|
2814
|
-
const
|
|
2815
|
-
function C(
|
|
2816
|
-
return
|
|
2813
|
+
st("treeStore", p);
|
|
2814
|
+
const I = q(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2815
|
+
function C(h) {
|
|
2816
|
+
return h[n.nodeKey] || h.id || Math.random();
|
|
2817
2817
|
}
|
|
2818
|
-
function B(
|
|
2818
|
+
function B(h) {
|
|
2819
2819
|
var d;
|
|
2820
|
-
return ((d = n.props) != null && d.label ?
|
|
2820
|
+
return ((d = n.props) != null && d.label ? h[n.props.label] : void 0) || h.label || "";
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2822
|
+
function $(h) {
|
|
2823
2823
|
var d;
|
|
2824
|
-
return !!((d =
|
|
2824
|
+
return !!((d = h == null ? void 0 : h.data) != null && d.isEmployee);
|
|
2825
2825
|
}
|
|
2826
|
-
function
|
|
2827
|
-
var
|
|
2828
|
-
const o = n.deptIconUrl || go, i = n.personIconUrl || mo, f = n.buttonIconUrl || "",
|
|
2829
|
-
return d &&
|
|
2826
|
+
function w(h, d) {
|
|
2827
|
+
var M;
|
|
2828
|
+
const o = n.deptIconUrl || go, i = n.personIconUrl || mo, f = n.buttonIconUrl || "", k = n.childStyleIconUrl || "";
|
|
2829
|
+
return d && k && U(h, d) ? k : (M = h == null ? void 0 : h.data) != null && M.isButton && f ? f : $(h) ? i : o;
|
|
2830
2830
|
}
|
|
2831
|
-
function
|
|
2831
|
+
function g(h) {
|
|
2832
2832
|
var o;
|
|
2833
|
-
const d = ((o = n.props) != null && o.children ?
|
|
2833
|
+
const d = ((o = n.props) != null && o.children ? h[n.props.children] : void 0) || h.children;
|
|
2834
2834
|
return d && d.length > 0;
|
|
2835
2835
|
}
|
|
2836
|
-
function
|
|
2836
|
+
function b(h) {
|
|
2837
2837
|
var d;
|
|
2838
|
-
return ((d = n.props) != null && d.children ?
|
|
2838
|
+
return ((d = n.props) != null && d.children ? h[n.props.children] : void 0) || h.children || [];
|
|
2839
2839
|
}
|
|
2840
|
-
function A(
|
|
2841
|
-
if (
|
|
2840
|
+
function A(h, d, o = 1) {
|
|
2841
|
+
if (h === d)
|
|
2842
2842
|
return o;
|
|
2843
|
-
const i =
|
|
2843
|
+
const i = b(h);
|
|
2844
2844
|
for (const f of i) {
|
|
2845
|
-
const
|
|
2846
|
-
if (
|
|
2847
|
-
return
|
|
2845
|
+
const k = A(f, d, o + 1);
|
|
2846
|
+
if (k > 0)
|
|
2847
|
+
return k;
|
|
2848
2848
|
}
|
|
2849
2849
|
return 0;
|
|
2850
2850
|
}
|
|
2851
|
-
function U(
|
|
2852
|
-
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : A(d,
|
|
2851
|
+
function U(h, d) {
|
|
2852
|
+
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : A(d, h) === n.childStyleLevel;
|
|
2853
2853
|
}
|
|
2854
|
-
function P(
|
|
2855
|
-
const d = C(
|
|
2856
|
-
return
|
|
2854
|
+
function P(h) {
|
|
2855
|
+
const d = C(h);
|
|
2856
|
+
return p.value.expandedKeys.has(d);
|
|
2857
2857
|
}
|
|
2858
|
-
function V(
|
|
2859
|
-
const d = C(
|
|
2860
|
-
if (
|
|
2861
|
-
if (
|
|
2862
|
-
const i =
|
|
2863
|
-
(
|
|
2858
|
+
function V(h) {
|
|
2859
|
+
const d = C(h);
|
|
2860
|
+
if (p.value.checkedKeys.has(d)) {
|
|
2861
|
+
if (g(h)) {
|
|
2862
|
+
const i = b(h), f = i.filter((M) => V(M)), k = i.filter(
|
|
2863
|
+
(M) => Z(M)
|
|
2864
2864
|
);
|
|
2865
|
-
return f.length === i.length &&
|
|
2865
|
+
return f.length === i.length && k.length === 0;
|
|
2866
2866
|
}
|
|
2867
2867
|
return !0;
|
|
2868
2868
|
}
|
|
2869
|
-
if (
|
|
2870
|
-
const i =
|
|
2869
|
+
if (g(h)) {
|
|
2870
|
+
const i = b(h);
|
|
2871
2871
|
return i.some(
|
|
2872
|
-
(
|
|
2873
|
-
) ? !1 : i.length > 0 && i.every((
|
|
2872
|
+
(k) => Z(k)
|
|
2873
|
+
) ? !1 : i.length > 0 && i.every((k) => V(k));
|
|
2874
2874
|
}
|
|
2875
2875
|
return !1;
|
|
2876
2876
|
}
|
|
2877
|
-
function Z(
|
|
2878
|
-
if (!
|
|
2879
|
-
const d =
|
|
2877
|
+
function Z(h) {
|
|
2878
|
+
if (!g(h)) return !1;
|
|
2879
|
+
const d = b(h), o = d.filter((f) => V(f)), i = d.filter(
|
|
2880
2880
|
(f) => Z(f)
|
|
2881
2881
|
);
|
|
2882
2882
|
return o.length === d.length ? !1 : o.length > 0 || i.length > 0;
|
|
2883
2883
|
}
|
|
2884
|
-
function X(
|
|
2885
|
-
const d = C(
|
|
2886
|
-
return
|
|
2884
|
+
function X(h) {
|
|
2885
|
+
const d = C(h);
|
|
2886
|
+
return p.value.currentKey === d;
|
|
2887
2887
|
}
|
|
2888
|
-
function ie(
|
|
2889
|
-
const d = C(
|
|
2890
|
-
return
|
|
2888
|
+
function ie(h) {
|
|
2889
|
+
const d = C(h);
|
|
2890
|
+
return p.value.highlightedKeys.has(d);
|
|
2891
2891
|
}
|
|
2892
|
-
function G(
|
|
2892
|
+
function G(h) {
|
|
2893
2893
|
if (n.disabled) return;
|
|
2894
|
-
const d = C(
|
|
2895
|
-
i ?
|
|
2896
|
-
function
|
|
2897
|
-
|
|
2894
|
+
const d = C(h), i = !p.value.checkedKeys.has(d), f = new Set(p.value.expandedKeys);
|
|
2895
|
+
i ? p.value.checkedKeys.add(d) : p.value.checkedKeys.delete(d);
|
|
2896
|
+
function k(M, T) {
|
|
2897
|
+
M.forEach((N) => {
|
|
2898
2898
|
const oe = C(N);
|
|
2899
|
-
T ?
|
|
2899
|
+
T ? p.value.checkedKeys.add(oe) : p.value.checkedKeys.delete(oe), g(N) && k(b(N), T);
|
|
2900
2900
|
});
|
|
2901
2901
|
}
|
|
2902
|
-
b(
|
|
2902
|
+
k(b(h), i), i && de(), F(), p.value.expandedKeys = f, m("check-change", h, i, !1), m("check", h, i, !1), m("checked-keys-change", Array.from(p.value.checkedKeys));
|
|
2903
2903
|
}
|
|
2904
|
-
function de(
|
|
2905
|
-
|
|
2906
|
-
`已启用从第${
|
|
2904
|
+
function de(h) {
|
|
2905
|
+
I.value && console.log(
|
|
2906
|
+
`已启用从第${I.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2907
2907
|
);
|
|
2908
2908
|
}
|
|
2909
|
-
function E(
|
|
2910
|
-
const d = C(
|
|
2911
|
-
|
|
2909
|
+
function E(h) {
|
|
2910
|
+
const d = C(h);
|
|
2911
|
+
p.value.expandedKeys.has(d) ? (p.value.expandedKeys.delete(d), m("node-collapse", h, h, null)) : (p.value.expandedKeys.add(d), m("node-expand", h, h, null));
|
|
2912
2912
|
}
|
|
2913
2913
|
function F() {
|
|
2914
|
-
const
|
|
2914
|
+
const h = [];
|
|
2915
2915
|
function d(i) {
|
|
2916
2916
|
i.forEach((f) => {
|
|
2917
|
-
|
|
2917
|
+
h.push(f), g(f) && d(b(f));
|
|
2918
2918
|
});
|
|
2919
2919
|
}
|
|
2920
2920
|
d(v.value);
|
|
2921
2921
|
function o(i) {
|
|
2922
|
-
if (
|
|
2923
|
-
const f =
|
|
2922
|
+
if (g(i)) {
|
|
2923
|
+
const f = b(i), k = C(i), M = f.filter((N) => V(N)), T = f.filter(
|
|
2924
2924
|
(N) => Z(N)
|
|
2925
2925
|
);
|
|
2926
|
-
|
|
2926
|
+
M.length === f.length && T.length === 0 || M.length > 0 || T.length > 0 ? p.value.checkedKeys.add(k) : p.value.checkedKeys.delete(k);
|
|
2927
2927
|
}
|
|
2928
2928
|
}
|
|
2929
|
-
for (let i =
|
|
2930
|
-
o(
|
|
2929
|
+
for (let i = h.length - 1; i >= 0; i--)
|
|
2930
|
+
o(h[i]);
|
|
2931
2931
|
}
|
|
2932
|
-
function K(
|
|
2932
|
+
function K(h, d, o, i) {
|
|
2933
2933
|
if (n.disabled) return;
|
|
2934
|
-
const f = i ? U(
|
|
2934
|
+
const f = i ? U(h, i) : !1;
|
|
2935
2935
|
if (n.enableChildStyleCustomClick && f) {
|
|
2936
|
-
|
|
2936
|
+
m("child-node-click", h, d, o);
|
|
2937
2937
|
return;
|
|
2938
2938
|
}
|
|
2939
|
-
if (n.expandOnClickNode &&
|
|
2940
|
-
E(
|
|
2939
|
+
if (n.expandOnClickNode && g(h)) {
|
|
2940
|
+
E(h);
|
|
2941
2941
|
return;
|
|
2942
2942
|
}
|
|
2943
|
-
|
|
2943
|
+
p.value.currentNode = h, p.value.currentKey = C(h), n.showCheckbox && G(h), m("node-click", h, d, o);
|
|
2944
2944
|
}
|
|
2945
|
-
function Y(
|
|
2946
|
-
n.disabled ||
|
|
2945
|
+
function Y(h, d, o, i) {
|
|
2946
|
+
n.disabled || m("node-contextmenu", h, d, o, i);
|
|
2947
2947
|
}
|
|
2948
2948
|
ae(
|
|
2949
2949
|
() => n.defaultExpandedKeys,
|
|
2950
|
-
(
|
|
2951
|
-
if (
|
|
2952
|
-
const d =
|
|
2950
|
+
(h) => {
|
|
2951
|
+
if (h) {
|
|
2952
|
+
const d = I.value;
|
|
2953
2953
|
if (d) {
|
|
2954
|
-
let o = function(
|
|
2954
|
+
let o = function(M, T, N = 1) {
|
|
2955
2955
|
for (const oe of T) {
|
|
2956
|
-
if (C(oe) ===
|
|
2957
|
-
if (
|
|
2958
|
-
const me = o(
|
|
2956
|
+
if (C(oe) === M) return N;
|
|
2957
|
+
if (g(oe)) {
|
|
2958
|
+
const me = o(M, b(oe), N + 1);
|
|
2959
2959
|
if (me > 0) return me;
|
|
2960
2960
|
}
|
|
2961
2961
|
}
|
|
2962
2962
|
return 0;
|
|
2963
|
-
}, i = function(
|
|
2964
|
-
|
|
2965
|
-
T < N &&
|
|
2963
|
+
}, i = function(M, T, N) {
|
|
2964
|
+
M.forEach((oe) => {
|
|
2965
|
+
T < N && g(oe) ? (k.add(C(oe)), i(b(oe), T + 1, N)) : T < N && g(oe);
|
|
2966
2966
|
});
|
|
2967
2967
|
};
|
|
2968
|
-
const f = (
|
|
2969
|
-
const T = o(
|
|
2968
|
+
const f = (h || []).filter((M) => {
|
|
2969
|
+
const T = o(M, v.value, 1);
|
|
2970
2970
|
return T > 0 && T < d;
|
|
2971
|
-
}),
|
|
2972
|
-
i(v.value, 1, d),
|
|
2973
|
-
o(
|
|
2974
|
-
}),
|
|
2971
|
+
}), k = new Set(f);
|
|
2972
|
+
i(v.value, 1, d), p.value.expandedKeys.forEach((M) => {
|
|
2973
|
+
o(M, v.value, 1) >= d && k.add(M);
|
|
2974
|
+
}), p.value.expandedKeys = k;
|
|
2975
2975
|
} else
|
|
2976
|
-
|
|
2976
|
+
p.value.expandedKeys = new Set(h);
|
|
2977
2977
|
}
|
|
2978
2978
|
},
|
|
2979
2979
|
{ immediate: !0 }
|
|
2980
2980
|
);
|
|
2981
2981
|
function ne() {
|
|
2982
2982
|
if (n.defaultExpandAll) {
|
|
2983
|
-
let
|
|
2984
|
-
i.forEach((
|
|
2985
|
-
if (!
|
|
2986
|
-
const
|
|
2983
|
+
let h = function(i, f = 1) {
|
|
2984
|
+
i.forEach((k) => {
|
|
2985
|
+
if (!g(k)) return;
|
|
2986
|
+
const M = b(k);
|
|
2987
2987
|
if (o) {
|
|
2988
2988
|
if (f >= o) return;
|
|
2989
|
-
f + 1 === o || d.add(C(
|
|
2989
|
+
f + 1 === o || d.add(C(k)), h(M, f + 1);
|
|
2990
2990
|
} else
|
|
2991
|
-
d.add(C(
|
|
2991
|
+
d.add(C(k)), h(M, f + 1);
|
|
2992
2992
|
});
|
|
2993
2993
|
};
|
|
2994
|
-
const d = /* @__PURE__ */ new Set(), o =
|
|
2995
|
-
|
|
2994
|
+
const d = /* @__PURE__ */ new Set(), o = I.value;
|
|
2995
|
+
h(v.value, 1), p.value.expandedKeys = d;
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
2998
|
function Q() {
|
|
2999
2999
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
3000
|
-
let
|
|
3001
|
-
f.forEach((
|
|
3002
|
-
const T = C(
|
|
3003
|
-
d.has(T) &&
|
|
3000
|
+
let h = function(f, k = []) {
|
|
3001
|
+
f.forEach((M) => {
|
|
3002
|
+
const T = C(M), N = [...k, T];
|
|
3003
|
+
d.has(T) && k.forEach((oe) => o.add(oe)), g(M) && h(b(M), N);
|
|
3004
3004
|
});
|
|
3005
3005
|
};
|
|
3006
3006
|
const d = new Set(n.defaultCheckedKeys), o = /* @__PURE__ */ new Set();
|
|
3007
|
-
|
|
3008
|
-
const i =
|
|
3007
|
+
h(v.value);
|
|
3008
|
+
const i = I.value;
|
|
3009
3009
|
if (i) {
|
|
3010
3010
|
console.log(
|
|
3011
3011
|
`已启用从第${i}级开始不默认展开:保持当前展开状态不变`
|
|
3012
3012
|
);
|
|
3013
3013
|
return;
|
|
3014
3014
|
}
|
|
3015
|
-
|
|
3015
|
+
p.value.expandedKeys = o;
|
|
3016
3016
|
}
|
|
3017
3017
|
}
|
|
3018
3018
|
ae(() => n.defaultExpandAll, ne, { immediate: !0 }), ae(() => v.value, ne, { deep: !0 }), ae(
|
|
3019
3019
|
() => n.defaultCheckedKeys,
|
|
3020
|
-
(
|
|
3021
|
-
|
|
3020
|
+
(h) => {
|
|
3021
|
+
h ? (p.value.checkedKeys = new Set(h), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : Q()) : p.value.checkedKeys.clear();
|
|
3022
3022
|
},
|
|
3023
3023
|
{ immediate: !0 }
|
|
3024
3024
|
);
|
|
3025
|
-
function pe(
|
|
3025
|
+
function pe(h) {
|
|
3026
3026
|
try {
|
|
3027
|
-
let d = function(f,
|
|
3027
|
+
let d = function(f, k, M = []) {
|
|
3028
3028
|
for (const T of f) {
|
|
3029
|
-
const N = C(T), oe = [...
|
|
3030
|
-
if (N ===
|
|
3031
|
-
if (
|
|
3032
|
-
const me = d(
|
|
3029
|
+
const N = C(T), oe = [...M, N];
|
|
3030
|
+
if (N === k) return oe;
|
|
3031
|
+
if (g(T)) {
|
|
3032
|
+
const me = d(b(T), k, oe);
|
|
3033
3033
|
if (me) return me;
|
|
3034
3034
|
}
|
|
3035
3035
|
}
|
|
3036
3036
|
return null;
|
|
3037
3037
|
};
|
|
3038
|
-
const o = Array.isArray(
|
|
3038
|
+
const o = Array.isArray(h) ? h : [];
|
|
3039
3039
|
if (o.length === 0) return;
|
|
3040
|
-
|
|
3041
|
-
const i = new Set(
|
|
3040
|
+
p.value.highlightedKeys.clear();
|
|
3041
|
+
const i = new Set(p.value.expandedKeys);
|
|
3042
3042
|
o.forEach((f) => {
|
|
3043
|
-
const
|
|
3044
|
-
|
|
3045
|
-
}),
|
|
3043
|
+
const k = d(v.value, f);
|
|
3044
|
+
k && k.length > 0 && (k.slice(0, -1).forEach((M) => i.add(M)), p.value.highlightedKeys.add(k[k.length - 1]));
|
|
3045
|
+
}), p.value.expandedKeys = i;
|
|
3046
3046
|
} catch (d) {
|
|
3047
3047
|
console.warn("highlightAndExpandByIds 执行失败", d);
|
|
3048
3048
|
}
|
|
3049
3049
|
}
|
|
3050
3050
|
function j() {
|
|
3051
|
-
|
|
3051
|
+
p.value.highlightedKeys.clear();
|
|
3052
3052
|
}
|
|
3053
3053
|
function ee() {
|
|
3054
|
-
|
|
3054
|
+
p.value.currentNode = null, p.value.currentKey = null;
|
|
3055
3055
|
}
|
|
3056
|
-
return
|
|
3056
|
+
return x({ highlightAndExpandByIds: pe, clearHighlights: j, clearCurrentNode: ee }), ae(
|
|
3057
3057
|
() => n.defaultSelectedKeys,
|
|
3058
|
-
(
|
|
3059
|
-
|
|
3058
|
+
(h) => {
|
|
3059
|
+
h && (p.value.selectedKeys = new Set(h));
|
|
3060
3060
|
},
|
|
3061
3061
|
{ immediate: !0 }
|
|
3062
|
-
), (
|
|
3062
|
+
), (h, d) => (s(), u("div", {
|
|
3063
3063
|
class: H(["ytree", [`ytree--${t.size}`, { "ytree--disabled": t.disabled }]])
|
|
3064
3064
|
}, [
|
|
3065
3065
|
l("div", Cl, [
|
|
@@ -3074,7 +3074,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3074
3074
|
onClick: (i) => K(o, o, null, o),
|
|
3075
3075
|
onContextmenu: (i) => Y(i, o, o, null)
|
|
3076
3076
|
}, [
|
|
3077
|
-
|
|
3077
|
+
g(o) ? (s(), u("span", {
|
|
3078
3078
|
key: 0,
|
|
3079
3079
|
class: H(["ytree-node__expand-icon", { "is-expanded": P(o) }]),
|
|
3080
3080
|
onClick: te((i) => E(o), ["stop"])
|
|
@@ -3093,7 +3093,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3093
3093
|
"stroke-linejoin": "round"
|
|
3094
3094
|
})
|
|
3095
3095
|
], -1)
|
|
3096
|
-
])], 10, Sl)) : (s(), u("span",
|
|
3096
|
+
])], 10, Sl)) : (s(), u("span", Ml)),
|
|
3097
3097
|
t.showCheckbox ? (s(), u("span", {
|
|
3098
3098
|
key: 2,
|
|
3099
3099
|
class: H(["ytree-node__checkbox", {
|
|
@@ -3102,7 +3102,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3102
3102
|
}]),
|
|
3103
3103
|
onClick: te((i) => G(o), ["stop"])
|
|
3104
3104
|
}, [
|
|
3105
|
-
V(o) ? (s(), u("svg",
|
|
3105
|
+
V(o) ? (s(), u("svg", Ll, [...d[1] || (d[1] = [
|
|
3106
3106
|
l("path", {
|
|
3107
3107
|
d: "M2 6L4.5 8.5L10 3",
|
|
3108
3108
|
stroke: "currentColor",
|
|
@@ -3118,32 +3118,32 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3118
3118
|
"stroke-linecap": "round"
|
|
3119
3119
|
}, null, -1)
|
|
3120
3120
|
])])) : R("", !0)
|
|
3121
|
-
], 10,
|
|
3121
|
+
], 10, Il)) : R("", !0),
|
|
3122
3122
|
t.iconClass ? (s(), u("span", {
|
|
3123
3123
|
key: 3,
|
|
3124
3124
|
class: H(["ytree-node__icon", t.iconClass])
|
|
3125
3125
|
}, null, 2)) : R("", !0),
|
|
3126
3126
|
l("img", {
|
|
3127
3127
|
class: "ytree-node__avatar",
|
|
3128
|
-
src:
|
|
3129
|
-
alt:
|
|
3128
|
+
src: w(o, o),
|
|
3129
|
+
alt: $(o) ? "person" : "dept"
|
|
3130
3130
|
}, null, 8, Bl),
|
|
3131
3131
|
l("span", {
|
|
3132
|
-
class: H(["ytree-node__label", { "is-employee":
|
|
3132
|
+
class: H(["ytree-node__label", { "is-employee": $(o) }])
|
|
3133
3133
|
}, se(B(o)), 3),
|
|
3134
3134
|
l("div", Tl, [
|
|
3135
|
-
ue(
|
|
3135
|
+
ue(h.$slots, "node-content", {
|
|
3136
3136
|
node: o,
|
|
3137
3137
|
isCurrent: X(o),
|
|
3138
3138
|
isExpanded: P(o),
|
|
3139
|
-
hasChildren:
|
|
3139
|
+
hasChildren: g(o)
|
|
3140
3140
|
}, void 0, !0)
|
|
3141
3141
|
])
|
|
3142
3142
|
], 42, _l),
|
|
3143
3143
|
ve($e, { name: "ytree-node" }, {
|
|
3144
3144
|
default: he(() => [
|
|
3145
|
-
|
|
3146
|
-
(s(!0), u(ce, null, ge(
|
|
3145
|
+
g(o) && P(o) ? (s(), u("div", zl, [
|
|
3146
|
+
(s(!0), u(ce, null, ge(b(o), (i) => (s(), u("div", {
|
|
3147
3147
|
key: C(i),
|
|
3148
3148
|
class: H(["ytree-node", { "ytree-node--current": X(i), "ytree-node--highlight": ie(i) }])
|
|
3149
3149
|
}, [
|
|
@@ -3154,7 +3154,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3154
3154
|
onClick: (f) => K(i, i, null, o),
|
|
3155
3155
|
onContextmenu: (f) => Y(f, i, i, null)
|
|
3156
3156
|
}, [
|
|
3157
|
-
|
|
3157
|
+
g(i) ? (s(), u("span", {
|
|
3158
3158
|
key: 0,
|
|
3159
3159
|
class: H(["ytree-node__expand-icon", { "is-expanded": P(i) }]),
|
|
3160
3160
|
onClick: te((f) => E(i), ["stop"])
|
|
@@ -3205,25 +3205,25 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3205
3205
|
}, null, 2)) : R("", !0),
|
|
3206
3206
|
l("img", {
|
|
3207
3207
|
class: "ytree-node__avatar",
|
|
3208
|
-
src:
|
|
3209
|
-
alt:
|
|
3208
|
+
src: w(i, o),
|
|
3209
|
+
alt: $(i) ? "person" : "dept"
|
|
3210
3210
|
}, null, 8, Fl),
|
|
3211
3211
|
l("span", {
|
|
3212
|
-
class: H(["ytree-node__label", { "is-employee":
|
|
3212
|
+
class: H(["ytree-node__label", { "is-employee": $(i) }])
|
|
3213
3213
|
}, se(B(i)), 3),
|
|
3214
3214
|
l("div", Pl, [
|
|
3215
|
-
ue(
|
|
3215
|
+
ue(h.$slots, "node-content", {
|
|
3216
3216
|
node: i,
|
|
3217
3217
|
isCurrent: X(i),
|
|
3218
3218
|
isExpanded: P(i),
|
|
3219
|
-
hasChildren:
|
|
3219
|
+
hasChildren: g(i)
|
|
3220
3220
|
}, void 0, !0)
|
|
3221
3221
|
])
|
|
3222
3222
|
], 42, Kl),
|
|
3223
3223
|
ve($e, { name: "ytree-node" }, {
|
|
3224
3224
|
default: he(() => [
|
|
3225
|
-
|
|
3226
|
-
(s(!0), u(ce, null, ge(
|
|
3225
|
+
g(i) && P(i) ? (s(), u("div", Yl, [
|
|
3226
|
+
(s(!0), u(ce, null, ge(b(i), (f) => (s(), u("div", {
|
|
3227
3227
|
key: C(f),
|
|
3228
3228
|
class: H(["ytree-node", {
|
|
3229
3229
|
"ytree-node--current": X(f),
|
|
@@ -3234,18 +3234,18 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3234
3234
|
class: H(["ytree-node__content", { "is-child-style": U(f, o) }]),
|
|
3235
3235
|
style: { paddingLeft: "38px" },
|
|
3236
3236
|
"data-level": A(o, f),
|
|
3237
|
-
onClick: (
|
|
3238
|
-
onContextmenu: (
|
|
3239
|
-
|
|
3237
|
+
onClick: (k) => K(f, f, null, o),
|
|
3238
|
+
onContextmenu: (k) => Y(
|
|
3239
|
+
k,
|
|
3240
3240
|
f,
|
|
3241
3241
|
f,
|
|
3242
3242
|
null
|
|
3243
3243
|
)
|
|
3244
3244
|
}, [
|
|
3245
|
-
|
|
3245
|
+
g(f) ? (s(), u("span", {
|
|
3246
3246
|
key: 0,
|
|
3247
3247
|
class: H(["ytree-node__expand-icon", { "is-expanded": P(f) }]),
|
|
3248
|
-
onClick: te((
|
|
3248
|
+
onClick: te((k) => E(f), ["stop"])
|
|
3249
3249
|
}, [...d[6] || (d[6] = [
|
|
3250
3250
|
l("svg", {
|
|
3251
3251
|
width: "12",
|
|
@@ -3268,7 +3268,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3268
3268
|
"is-checked": V(f),
|
|
3269
3269
|
"is-indeterminate": Z(f)
|
|
3270
3270
|
}]),
|
|
3271
|
-
onClick: te((
|
|
3271
|
+
onClick: te((k) => G(f), ["stop"])
|
|
3272
3272
|
}, [
|
|
3273
3273
|
V(f) ? (s(), u("svg", Ul, [...d[7] || (d[7] = [
|
|
3274
3274
|
l("path", {
|
|
@@ -3293,56 +3293,56 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3293
3293
|
}, null, 2)) : R("", !0),
|
|
3294
3294
|
l("img", {
|
|
3295
3295
|
class: "ytree-node__avatar",
|
|
3296
|
-
src:
|
|
3297
|
-
alt:
|
|
3296
|
+
src: w(f, o),
|
|
3297
|
+
alt: $(f) ? "person" : "dept"
|
|
3298
3298
|
}, null, 8, Ql),
|
|
3299
3299
|
l("span", {
|
|
3300
|
-
class: H(["ytree-node__label", { "is-employee":
|
|
3300
|
+
class: H(["ytree-node__label", { "is-employee": $(f) }])
|
|
3301
3301
|
}, se(B(f)), 3),
|
|
3302
3302
|
l("div", Jl, [
|
|
3303
|
-
ue(
|
|
3303
|
+
ue(h.$slots, "node-content", {
|
|
3304
3304
|
node: f,
|
|
3305
3305
|
isCurrent: X(f),
|
|
3306
3306
|
isExpanded: P(f),
|
|
3307
|
-
hasChildren:
|
|
3307
|
+
hasChildren: g(f)
|
|
3308
3308
|
}, void 0, !0)
|
|
3309
3309
|
])
|
|
3310
3310
|
], 42, Nl),
|
|
3311
3311
|
ve($e, { name: "ytree-node" }, {
|
|
3312
3312
|
default: he(() => [
|
|
3313
|
-
|
|
3314
|
-
(s(!0), u(ce, null, ge(
|
|
3315
|
-
key: C(
|
|
3313
|
+
g(f) && P(f) ? (s(), u("div", Xl, [
|
|
3314
|
+
(s(!0), u(ce, null, ge(b(f), (k) => (s(), u("div", {
|
|
3315
|
+
key: C(k),
|
|
3316
3316
|
class: H(["ytree-node", {
|
|
3317
|
-
"ytree-node--current": X(
|
|
3318
|
-
"ytree-node--highlight": ie(
|
|
3317
|
+
"ytree-node--current": X(k),
|
|
3318
|
+
"ytree-node--highlight": ie(k)
|
|
3319
3319
|
}])
|
|
3320
3320
|
}, [
|
|
3321
3321
|
l("div", {
|
|
3322
|
-
class: H(["ytree-node__content", { "is-child-style": U(
|
|
3322
|
+
class: H(["ytree-node__content", { "is-child-style": U(k, o) }]),
|
|
3323
3323
|
style: {
|
|
3324
3324
|
paddingLeft: "54px"
|
|
3325
3325
|
},
|
|
3326
|
-
"data-level": A(o,
|
|
3327
|
-
onClick: (
|
|
3328
|
-
|
|
3329
|
-
|
|
3326
|
+
"data-level": A(o, k),
|
|
3327
|
+
onClick: (M) => K(
|
|
3328
|
+
k,
|
|
3329
|
+
k,
|
|
3330
3330
|
null,
|
|
3331
3331
|
o
|
|
3332
3332
|
),
|
|
3333
|
-
onContextmenu: (
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3333
|
+
onContextmenu: (M) => Y(
|
|
3334
|
+
M,
|
|
3335
|
+
k,
|
|
3336
|
+
k,
|
|
3337
3337
|
null
|
|
3338
3338
|
)
|
|
3339
3339
|
}, [
|
|
3340
|
-
|
|
3340
|
+
g(k) ? (s(), u("span", {
|
|
3341
3341
|
key: 0,
|
|
3342
3342
|
class: H(["ytree-node__expand-icon", {
|
|
3343
|
-
"is-expanded": P(
|
|
3343
|
+
"is-expanded": P(k)
|
|
3344
3344
|
}]),
|
|
3345
|
-
onClick: te((
|
|
3345
|
+
onClick: te((M) => E(k), ["stop"])
|
|
3346
3346
|
}, [...d[9] || (d[9] = [
|
|
3347
3347
|
l("svg", {
|
|
3348
3348
|
width: "12",
|
|
@@ -3362,12 +3362,12 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3362
3362
|
t.showCheckbox ? (s(), u("span", {
|
|
3363
3363
|
key: 2,
|
|
3364
3364
|
class: H(["ytree-node__checkbox", {
|
|
3365
|
-
"is-checked": V(
|
|
3366
|
-
"is-indeterminate": Z(
|
|
3365
|
+
"is-checked": V(k),
|
|
3366
|
+
"is-indeterminate": Z(k)
|
|
3367
3367
|
}]),
|
|
3368
|
-
onClick: te((
|
|
3368
|
+
onClick: te((M) => G(k), ["stop"])
|
|
3369
3369
|
}, [
|
|
3370
|
-
V(
|
|
3370
|
+
V(k) ? (s(), u("svg", lo, [...d[10] || (d[10] = [
|
|
3371
3371
|
l("path", {
|
|
3372
3372
|
d: "M2 6L4.5 8.5L10 3",
|
|
3373
3373
|
stroke: "currentColor",
|
|
@@ -3375,7 +3375,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3375
3375
|
"stroke-linecap": "round",
|
|
3376
3376
|
"stroke-linejoin": "round"
|
|
3377
3377
|
}, null, -1)
|
|
3378
|
-
])])) : Z(
|
|
3378
|
+
])])) : Z(k) ? (s(), u("svg", oo, [...d[11] || (d[11] = [
|
|
3379
3379
|
l("path", {
|
|
3380
3380
|
d: "M2 6L10 6",
|
|
3381
3381
|
stroke: "currentColor",
|
|
@@ -3390,59 +3390,59 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3390
3390
|
}, null, 2)) : R("", !0),
|
|
3391
3391
|
l("img", {
|
|
3392
3392
|
class: "ytree-node__avatar",
|
|
3393
|
-
src:
|
|
3394
|
-
alt:
|
|
3393
|
+
src: w(k, o),
|
|
3394
|
+
alt: $(k) ? "person" : "dept"
|
|
3395
3395
|
}, null, 8, ao),
|
|
3396
3396
|
l("span", {
|
|
3397
3397
|
class: H(["ytree-node__label", {
|
|
3398
|
-
"is-employee":
|
|
3398
|
+
"is-employee": $(k)
|
|
3399
3399
|
}])
|
|
3400
|
-
}, se(B(
|
|
3400
|
+
}, se(B(k)), 3),
|
|
3401
3401
|
l("div", so, [
|
|
3402
|
-
ue(
|
|
3403
|
-
node:
|
|
3404
|
-
isCurrent: X(
|
|
3405
|
-
isExpanded: P(
|
|
3406
|
-
hasChildren:
|
|
3402
|
+
ue(h.$slots, "node-content", {
|
|
3403
|
+
node: k,
|
|
3404
|
+
isCurrent: X(k),
|
|
3405
|
+
isExpanded: P(k),
|
|
3406
|
+
hasChildren: g(k)
|
|
3407
3407
|
}, void 0, !0)
|
|
3408
3408
|
])
|
|
3409
3409
|
], 42, Gl),
|
|
3410
3410
|
ve($e, { name: "ytree-node" }, {
|
|
3411
3411
|
default: he(() => [
|
|
3412
|
-
|
|
3413
|
-
(s(!0), u(ce, null, ge(
|
|
3414
|
-
|
|
3415
|
-
), (
|
|
3416
|
-
key: C(
|
|
3412
|
+
g(k) && P(k) ? (s(), u("div", io, [
|
|
3413
|
+
(s(!0), u(ce, null, ge(b(
|
|
3414
|
+
k
|
|
3415
|
+
), (M) => (s(), u("div", {
|
|
3416
|
+
key: C(M),
|
|
3417
3417
|
class: H(["ytree-node", {
|
|
3418
|
-
"ytree-node--current": X(
|
|
3418
|
+
"ytree-node--current": X(M)
|
|
3419
3419
|
}])
|
|
3420
3420
|
}, [
|
|
3421
3421
|
l("div", {
|
|
3422
|
-
class: H(["ytree-node__content", { "is-child-style": U(
|
|
3422
|
+
class: H(["ytree-node__content", { "is-child-style": U(M, o) }]),
|
|
3423
3423
|
style: {
|
|
3424
3424
|
paddingLeft: "70px"
|
|
3425
3425
|
},
|
|
3426
|
-
"data-level": A(o,
|
|
3426
|
+
"data-level": A(o, M),
|
|
3427
3427
|
onClick: (T) => K(
|
|
3428
|
-
|
|
3429
|
-
|
|
3428
|
+
M,
|
|
3429
|
+
M,
|
|
3430
3430
|
null,
|
|
3431
3431
|
o
|
|
3432
3432
|
),
|
|
3433
3433
|
onContextmenu: (T) => Y(
|
|
3434
3434
|
T,
|
|
3435
|
-
|
|
3436
|
-
|
|
3435
|
+
M,
|
|
3436
|
+
M,
|
|
3437
3437
|
null
|
|
3438
3438
|
)
|
|
3439
3439
|
}, [
|
|
3440
|
-
|
|
3440
|
+
g(M) ? (s(), u("span", {
|
|
3441
3441
|
key: 0,
|
|
3442
3442
|
class: H(["ytree-node__expand-icon", {
|
|
3443
|
-
"is-expanded": P(
|
|
3443
|
+
"is-expanded": P(M)
|
|
3444
3444
|
}]),
|
|
3445
|
-
onClick: te((T) => E(
|
|
3445
|
+
onClick: te((T) => E(M), ["stop"])
|
|
3446
3446
|
}, [...d[12] || (d[12] = [
|
|
3447
3447
|
l("svg", {
|
|
3448
3448
|
width: "12",
|
|
@@ -3462,14 +3462,14 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3462
3462
|
t.showCheckbox ? (s(), u("span", {
|
|
3463
3463
|
key: 2,
|
|
3464
3464
|
class: H(["ytree-node__checkbox", {
|
|
3465
|
-
"is-checked": V(
|
|
3465
|
+
"is-checked": V(M),
|
|
3466
3466
|
"is-indeterminate": Z(
|
|
3467
|
-
|
|
3467
|
+
M
|
|
3468
3468
|
)
|
|
3469
3469
|
}]),
|
|
3470
|
-
onClick: te((T) => G(
|
|
3470
|
+
onClick: te((T) => G(M), ["stop"])
|
|
3471
3471
|
}, [
|
|
3472
|
-
V(
|
|
3472
|
+
V(M) ? (s(), u("svg", vo, [...d[13] || (d[13] = [
|
|
3473
3473
|
l("path", {
|
|
3474
3474
|
d: "M2 6L4.5 8.5L10 3",
|
|
3475
3475
|
stroke: "currentColor",
|
|
@@ -3478,7 +3478,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3478
3478
|
"stroke-linejoin": "round"
|
|
3479
3479
|
}, null, -1)
|
|
3480
3480
|
])])) : Z(
|
|
3481
|
-
|
|
3481
|
+
M
|
|
3482
3482
|
) ? (s(), u("svg", ho, [...d[14] || (d[14] = [
|
|
3483
3483
|
l("path", {
|
|
3484
3484
|
d: "M2 6L10 6",
|
|
@@ -3494,20 +3494,20 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3494
3494
|
}, null, 2)) : R("", !0),
|
|
3495
3495
|
l("img", {
|
|
3496
3496
|
class: "ytree-node__avatar",
|
|
3497
|
-
src:
|
|
3498
|
-
alt:
|
|
3497
|
+
src: w(M, o),
|
|
3498
|
+
alt: $(M) ? "person" : "dept"
|
|
3499
3499
|
}, null, 8, po),
|
|
3500
3500
|
l("span", {
|
|
3501
3501
|
class: H(["ytree-node__label", {
|
|
3502
|
-
"is-employee":
|
|
3502
|
+
"is-employee": $(M)
|
|
3503
3503
|
}])
|
|
3504
|
-
}, se(B(
|
|
3504
|
+
}, se(B(M)), 3),
|
|
3505
3505
|
l("div", yo, [
|
|
3506
|
-
ue(
|
|
3507
|
-
node:
|
|
3508
|
-
isCurrent: X(
|
|
3509
|
-
isExpanded: P(
|
|
3510
|
-
hasChildren:
|
|
3506
|
+
ue(h.$slots, "node-content", {
|
|
3507
|
+
node: M,
|
|
3508
|
+
isCurrent: X(M),
|
|
3509
|
+
isExpanded: P(M),
|
|
3510
|
+
hasChildren: g(M)
|
|
3511
3511
|
}, void 0, !0)
|
|
3512
3512
|
])
|
|
3513
3513
|
], 42, ro)
|
|
@@ -3541,7 +3541,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3541
3541
|
}, So = {
|
|
3542
3542
|
key: 0,
|
|
3543
3543
|
class: "query-encapsulation__toggle"
|
|
3544
|
-
},
|
|
3544
|
+
}, Mo = { class: "query-encapsulation__actions" }, Io = { class: "query-encapsulation__actions-group" }, Lo = /* @__PURE__ */ we({
|
|
3545
3545
|
__name: "QueryEncapsulation",
|
|
3546
3546
|
props: {
|
|
3547
3547
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3551,11 +3551,11 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3551
3551
|
modelValue: { default: () => ({}) }
|
|
3552
3552
|
},
|
|
3553
3553
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3554
|
-
setup(t, { emit:
|
|
3555
|
-
const e = t, n =
|
|
3556
|
-
let
|
|
3557
|
-
const C = q(() => e.fields.filter((E) => !E.hidden)), B = q(() =>
|
|
3558
|
-
function
|
|
3554
|
+
setup(t, { emit: x }) {
|
|
3555
|
+
const e = t, n = x, m = z(!1), v = it({}), p = ["select", "date", "daterange"];
|
|
3556
|
+
let I;
|
|
3557
|
+
const C = q(() => e.fields.filter((E) => !E.hidden)), B = q(() => m.value ? C.value : C.value.slice(0, e.maxVisibleFields)), $ = q(() => C.value.length > e.maxVisibleFields);
|
|
3558
|
+
function w(E) {
|
|
3559
3559
|
switch (E) {
|
|
3560
3560
|
case "select":
|
|
3561
3561
|
return nt;
|
|
@@ -3567,13 +3567,13 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3567
3567
|
return tt;
|
|
3568
3568
|
}
|
|
3569
3569
|
}
|
|
3570
|
-
function
|
|
3570
|
+
function g(E, F) {
|
|
3571
3571
|
v[E] = F;
|
|
3572
3572
|
const K = e.fields.find((Y) => Y.key === E);
|
|
3573
|
-
K &&
|
|
3573
|
+
K && b(K);
|
|
3574
3574
|
}
|
|
3575
|
-
function
|
|
3576
|
-
n("field-change", E, v[E.key]), n("update:modelValue", { ...v }),
|
|
3575
|
+
function b(E) {
|
|
3576
|
+
n("field-change", E, v[E.key]), n("update:modelValue", { ...v }), p.includes(E.type) && X();
|
|
3577
3577
|
}
|
|
3578
3578
|
function A() {
|
|
3579
3579
|
const E = ie(v), F = G(E), K = { ...v };
|
|
@@ -3586,7 +3586,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3586
3586
|
}), n("reset"), n("update:modelValue", { ...v });
|
|
3587
3587
|
}
|
|
3588
3588
|
function P() {
|
|
3589
|
-
|
|
3589
|
+
m.value = !m.value;
|
|
3590
3590
|
}
|
|
3591
3591
|
function V(E) {
|
|
3592
3592
|
return E.type !== "input" ? {} : {
|
|
@@ -3598,8 +3598,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3598
3598
|
await re(), A();
|
|
3599
3599
|
}
|
|
3600
3600
|
function X() {
|
|
3601
|
-
|
|
3602
|
-
|
|
3601
|
+
I && clearTimeout(I), I = setTimeout(() => {
|
|
3602
|
+
I = void 0, re().then(() => A());
|
|
3603
3603
|
}, 0);
|
|
3604
3604
|
}
|
|
3605
3605
|
function ie(E) {
|
|
@@ -3650,7 +3650,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3650
3650
|
), Ce(() => {
|
|
3651
3651
|
de();
|
|
3652
3652
|
}), Ge(() => {
|
|
3653
|
-
|
|
3653
|
+
I && (clearTimeout(I), I = void 0);
|
|
3654
3654
|
}), (E, F) => (s(), u("div", ko, [
|
|
3655
3655
|
l("div", xo, [
|
|
3656
3656
|
l("div", $o, [
|
|
@@ -3668,11 +3668,11 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3668
3668
|
ue(E.$slots, `field-${K.key}`, {
|
|
3669
3669
|
field: K,
|
|
3670
3670
|
value: v[K.key],
|
|
3671
|
-
updateValue: (Y) =>
|
|
3671
|
+
updateValue: (Y) => g(K.key, Y)
|
|
3672
3672
|
}, () => [
|
|
3673
3673
|
l("div", Co, [
|
|
3674
3674
|
t.Iflabel ? (s(), u("label", _o, se(K.label), 1)) : R("", !0),
|
|
3675
|
-
(s(),
|
|
3675
|
+
(s(), Me(ut(w(K.type)), dt({
|
|
3676
3676
|
modelValue: v[K.key],
|
|
3677
3677
|
"onUpdate:modelValue": (Y) => v[K.key] = Y,
|
|
3678
3678
|
placeholder: K.placeholder || `请输入${K.label}`,
|
|
@@ -3684,8 +3684,8 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3684
3684
|
"include-time": K.includeTime || !1,
|
|
3685
3685
|
filterable: K.filterable === !0
|
|
3686
3686
|
}, ct(V(K)), {
|
|
3687
|
-
onInput: (Y) =>
|
|
3688
|
-
onChange: (Y) =>
|
|
3687
|
+
onInput: (Y) => b(K),
|
|
3688
|
+
onChange: (Y) => b(K)
|
|
3689
3689
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3690
3690
|
])
|
|
3691
3691
|
], !0)
|
|
@@ -3693,23 +3693,23 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3693
3693
|
]),
|
|
3694
3694
|
_: 3
|
|
3695
3695
|
}),
|
|
3696
|
-
|
|
3696
|
+
$.value ? (s(), u("div", So, [
|
|
3697
3697
|
ve(Ne, {
|
|
3698
3698
|
variant: "secondary",
|
|
3699
3699
|
size: "small",
|
|
3700
3700
|
onClick: P
|
|
3701
3701
|
}, {
|
|
3702
3702
|
default: he(() => [
|
|
3703
|
-
De(se(
|
|
3703
|
+
De(se(m.value ? "收起" : "展开") + " ", 1),
|
|
3704
3704
|
l("span", {
|
|
3705
|
-
class: H(["query-encapsulation__toggle-icon", { "is-expanded":
|
|
3705
|
+
class: H(["query-encapsulation__toggle-icon", { "is-expanded": m.value }])
|
|
3706
3706
|
}, "▼", 2)
|
|
3707
3707
|
]),
|
|
3708
3708
|
_: 1
|
|
3709
3709
|
})
|
|
3710
3710
|
])) : R("", !0),
|
|
3711
|
-
l("div",
|
|
3712
|
-
l("div",
|
|
3711
|
+
l("div", Mo, [
|
|
3712
|
+
l("div", Io, [
|
|
3713
3713
|
ve(Ne, {
|
|
3714
3714
|
variant: "primary",
|
|
3715
3715
|
size: "small",
|
|
@@ -3740,7 +3740,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3740
3740
|
])
|
|
3741
3741
|
]));
|
|
3742
3742
|
}
|
|
3743
|
-
}), Eo = /* @__PURE__ */ be(
|
|
3743
|
+
}), Eo = /* @__PURE__ */ be(Lo, [["__scopeId", "data-v-73456475"]]), Bo = {
|
|
3744
3744
|
key: 0,
|
|
3745
3745
|
width: "16",
|
|
3746
3746
|
height: "16",
|
|
@@ -3771,38 +3771,56 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3771
3771
|
onClose: {}
|
|
3772
3772
|
},
|
|
3773
3773
|
setup(t) {
|
|
3774
|
-
const
|
|
3775
|
-
let n;
|
|
3774
|
+
const x = t, e = z(!1);
|
|
3775
|
+
let n, m = 0, v = 0;
|
|
3776
3776
|
Ce(() => {
|
|
3777
3777
|
requestAnimationFrame(() => {
|
|
3778
|
-
e.value = !0,
|
|
3778
|
+
e.value = !0, x.duration && x.duration > 0 && p(x.duration);
|
|
3779
3779
|
});
|
|
3780
3780
|
}), Ge(() => {
|
|
3781
|
-
|
|
3781
|
+
I();
|
|
3782
3782
|
});
|
|
3783
|
-
function g
|
|
3783
|
+
function p(g) {
|
|
3784
|
+
m = g, v = Date.now(), n = window.setTimeout(() => $(), g);
|
|
3785
|
+
}
|
|
3786
|
+
function I() {
|
|
3787
|
+
n && (window.clearTimeout(n), n = void 0);
|
|
3788
|
+
}
|
|
3789
|
+
function C() {
|
|
3790
|
+
if (n && x.duration && x.duration > 0) {
|
|
3791
|
+
I();
|
|
3792
|
+
const g = Date.now() - v;
|
|
3793
|
+
m = Math.max(0, m - g);
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
function B() {
|
|
3797
|
+
x.duration && x.duration > 0 && m > 0 && p(m);
|
|
3798
|
+
}
|
|
3799
|
+
function $() {
|
|
3784
3800
|
e.value = !1;
|
|
3785
3801
|
}
|
|
3786
|
-
function
|
|
3787
|
-
var
|
|
3788
|
-
(
|
|
3802
|
+
function w() {
|
|
3803
|
+
var g;
|
|
3804
|
+
(g = x.onClose) == null || g.call(x, x.id);
|
|
3789
3805
|
}
|
|
3790
|
-
return (
|
|
3806
|
+
return (g, b) => (s(), Me($e, {
|
|
3791
3807
|
name: "y-msg-fade",
|
|
3792
|
-
onAfterLeave:
|
|
3808
|
+
onAfterLeave: w
|
|
3793
3809
|
}, {
|
|
3794
3810
|
default: he(() => [
|
|
3795
3811
|
Ee(l("div", {
|
|
3796
3812
|
class: H(["y-msg", [`y-msg--${t.type}`]]),
|
|
3797
3813
|
style: fe({ zIndex: t.zIndex }),
|
|
3798
3814
|
role: "status",
|
|
3799
|
-
"aria-live": "polite"
|
|
3815
|
+
"aria-live": "polite",
|
|
3816
|
+
onMouseenter: C,
|
|
3817
|
+
onMouseleave: B
|
|
3800
3818
|
}, [
|
|
3801
3819
|
l("span", {
|
|
3802
3820
|
class: H(["y-msg__icon", `y-msg__icon--${t.type}`]),
|
|
3803
3821
|
"aria-hidden": "true"
|
|
3804
3822
|
}, [
|
|
3805
|
-
t.type === "success" ? (s(), u("svg", Bo, [...
|
|
3823
|
+
t.type === "success" ? (s(), u("svg", Bo, [...b[0] || (b[0] = [
|
|
3806
3824
|
l("path", {
|
|
3807
3825
|
d: "M20 6L9 17l-5-5",
|
|
3808
3826
|
stroke: "currentColor",
|
|
@@ -3810,7 +3828,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3810
3828
|
"stroke-linecap": "round",
|
|
3811
3829
|
"stroke-linejoin": "round"
|
|
3812
3830
|
}, null, -1)
|
|
3813
|
-
])])) : t.type === "warning" ? (s(), u("svg", To, [...
|
|
3831
|
+
])])) : t.type === "warning" ? (s(), u("svg", To, [...b[1] || (b[1] = [
|
|
3814
3832
|
l("path", {
|
|
3815
3833
|
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",
|
|
3816
3834
|
stroke: "currentColor",
|
|
@@ -3818,7 +3836,7 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3818
3836
|
"stroke-linecap": "round",
|
|
3819
3837
|
"stroke-linejoin": "round"
|
|
3820
3838
|
}, null, -1)
|
|
3821
|
-
])])) : (s(), u("svg", zo, [...
|
|
3839
|
+
])])) : (s(), u("svg", zo, [...b[2] || (b[2] = [
|
|
3822
3840
|
l("path", {
|
|
3823
3841
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3824
3842
|
stroke: "currentColor",
|
|
@@ -3836,84 +3854,84 @@ const ft = ["type", "disabled", "aria-busy", "aria-disabled"], vt = { class: "co
|
|
|
3836
3854
|
key: 0,
|
|
3837
3855
|
class: "y-msg__close",
|
|
3838
3856
|
type: "button",
|
|
3839
|
-
onClick:
|
|
3857
|
+
onClick: $
|
|
3840
3858
|
}, "✕")) : R("", !0)
|
|
3841
|
-
],
|
|
3859
|
+
], 38), [
|
|
3842
3860
|
[Ke, e.value]
|
|
3843
3861
|
])
|
|
3844
3862
|
]),
|
|
3845
3863
|
_: 1
|
|
3846
3864
|
}));
|
|
3847
3865
|
}
|
|
3848
|
-
}), Ro = /* @__PURE__ */ be(Ho, [["__scopeId", "data-v-
|
|
3866
|
+
}), Ro = /* @__PURE__ */ be(Ho, [["__scopeId", "data-v-db173617"]]);
|
|
3849
3867
|
let Ao = 1;
|
|
3850
3868
|
const Ze = 12, Se = [];
|
|
3851
3869
|
function Wo() {
|
|
3852
3870
|
let t = 20;
|
|
3853
|
-
return Se.forEach((
|
|
3854
|
-
t +=
|
|
3871
|
+
return Se.forEach((x) => {
|
|
3872
|
+
t += x.height + Ze;
|
|
3855
3873
|
}), t;
|
|
3856
3874
|
}
|
|
3857
3875
|
function Je(t) {
|
|
3858
|
-
const
|
|
3859
|
-
if (
|
|
3860
|
-
const { el: e } = Se[
|
|
3876
|
+
const x = Se.findIndex((v) => v.id === t);
|
|
3877
|
+
if (x === -1) return;
|
|
3878
|
+
const { el: e } = Se[x], n = e.firstElementChild;
|
|
3861
3879
|
if (n) {
|
|
3862
3880
|
const v = window.getComputedStyle(n).top;
|
|
3863
3881
|
n.style.top = v, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3864
3882
|
}
|
|
3865
|
-
Se[
|
|
3883
|
+
Se[x].leaving = !0, je(), setTimeout(() => {
|
|
3866
3884
|
et(null, e), e.parentNode && e.parentNode.removeChild(e);
|
|
3867
|
-
const v = Se.findIndex((
|
|
3885
|
+
const v = Se.findIndex((p) => p.id === t);
|
|
3868
3886
|
v !== -1 && Se.splice(v, 1), je();
|
|
3869
3887
|
}, 260);
|
|
3870
3888
|
}
|
|
3871
3889
|
function Ue(t) {
|
|
3872
3890
|
var v;
|
|
3873
|
-
const
|
|
3891
|
+
const x = Ao++, e = document.createElement("div");
|
|
3874
3892
|
document.body.appendChild(e);
|
|
3875
3893
|
const n = ve(Ro, {
|
|
3876
|
-
id:
|
|
3894
|
+
id: x,
|
|
3877
3895
|
type: t.type || "success",
|
|
3878
3896
|
message: t.message,
|
|
3879
3897
|
duration: t.duration ?? 2500,
|
|
3880
3898
|
offset: Wo(),
|
|
3881
|
-
zIndex: 3e3 +
|
|
3899
|
+
zIndex: 3e3 + x,
|
|
3882
3900
|
closable: t.closable ?? !1,
|
|
3883
|
-
onClose: (
|
|
3901
|
+
onClose: (p) => Je(p)
|
|
3884
3902
|
});
|
|
3885
3903
|
et(n, e);
|
|
3886
|
-
const
|
|
3887
|
-
return Se.push({ id:
|
|
3888
|
-
const
|
|
3889
|
-
if (!
|
|
3890
|
-
const
|
|
3891
|
-
C && (C.height =
|
|
3892
|
-
}), { close: () => Je(
|
|
3904
|
+
const m = ((v = e.firstElementChild) == null ? void 0 : v.offsetHeight) || 0;
|
|
3905
|
+
return Se.push({ id: x, el: e, vm: n, height: m, leaving: !1 }), je(), requestAnimationFrame(() => {
|
|
3906
|
+
const p = e.firstElementChild;
|
|
3907
|
+
if (!p) return;
|
|
3908
|
+
const I = p.offsetHeight || m || 0, C = Se.find((B) => B.id === x);
|
|
3909
|
+
C && (C.height = I, je());
|
|
3910
|
+
}), { close: () => Je(x) };
|
|
3893
3911
|
}
|
|
3894
3912
|
const Oe = {
|
|
3895
|
-
success(t,
|
|
3896
|
-
return Ue({ ...
|
|
3913
|
+
success(t, x) {
|
|
3914
|
+
return Ue({ ...typeof x == "number" ? { duration: x } : x || {}, type: "success", message: t });
|
|
3897
3915
|
},
|
|
3898
|
-
warning(t,
|
|
3899
|
-
return Ue({ ...
|
|
3916
|
+
warning(t, x) {
|
|
3917
|
+
return Ue({ ...typeof x == "number" ? { duration: x } : x || {}, type: "warning", message: t });
|
|
3900
3918
|
},
|
|
3901
|
-
error(t,
|
|
3902
|
-
return Ue({ ...
|
|
3919
|
+
error(t, x) {
|
|
3920
|
+
return Ue({ ...typeof x == "number" ? { duration: x } : x || {}, type: "error", message: t });
|
|
3903
3921
|
}
|
|
3904
3922
|
};
|
|
3905
3923
|
typeof window < "u" && (window.YMessage = Oe, typeof globalThis.YMessage > "u" && (globalThis.YMessage = Oe));
|
|
3906
3924
|
function je() {
|
|
3907
3925
|
let t = 20;
|
|
3908
|
-
Se.forEach((
|
|
3909
|
-
const e =
|
|
3926
|
+
Se.forEach((x) => {
|
|
3927
|
+
const e = x.el.firstElementChild;
|
|
3910
3928
|
if (!e) return;
|
|
3911
3929
|
const n = t;
|
|
3912
|
-
if (e.style.transform = `translate(-50%, ${n}px)`, e.style.top || (e.style.top = "0px"), !
|
|
3913
|
-
t += (e.offsetHeight ||
|
|
3930
|
+
if (e.style.transform = `translate(-50%, ${n}px)`, e.style.top || (e.style.top = "0px"), !x.leaving)
|
|
3931
|
+
t += (e.offsetHeight || x.height) + Ze;
|
|
3914
3932
|
else {
|
|
3915
|
-
const
|
|
3916
|
-
t +=
|
|
3933
|
+
const m = e.offsetHeight || x.height;
|
|
3934
|
+
t += m + Ze;
|
|
3917
3935
|
}
|
|
3918
3936
|
});
|
|
3919
3937
|
}
|
|
@@ -3935,8 +3953,8 @@ const Xe = {
|
|
|
3935
3953
|
QueryEncapsulation: Eo
|
|
3936
3954
|
}, Yo = {
|
|
3937
3955
|
install(t) {
|
|
3938
|
-
Object.keys(Xe).forEach((
|
|
3939
|
-
t.component(
|
|
3956
|
+
Object.keys(Xe).forEach((x) => {
|
|
3957
|
+
t.component(x, Xe[x]);
|
|
3940
3958
|
}), t.config.globalProperties.$message = Oe, typeof window < "u" && (window.YMessage = Oe);
|
|
3941
3959
|
}
|
|
3942
3960
|
};
|