@nhdropshipping/y-components 1.0.45 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/QueryEncapsulation.vue.d.ts.map +1 -1
- package/dist/components/ybutton.vue.d.ts +6 -6
- package/dist/components/ybutton.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 +1139 -1130
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ge, computed as O, createElementBlock as u, openBlock as i, normalizeClass as
|
|
1
|
+
import { defineComponent as ge, computed as O, createElementBlock as u, openBlock as i, normalizeClass as K, createElementVNode as o, renderSlot as ce, Fragment as re, renderList as ve, createCommentVNode as H, toDisplayString as ne, ref as E, watch as oe, normalizeStyle as ue, withKeys as ke, nextTick as se, onMounted as $e, onUnmounted as Be, resolveComponent as Ae, createVNode as de, Transition as be, withCtx as fe, createTextVNode as xe, createBlock as Se, withModifiers as G, withDirectives as Ee, vModelText as ot, Teleport as Fe, vShow as ze, provide as at, reactive as st, onBeforeUnmount as Xe, TransitionGroup as it, resolveDynamicComponent as rt, mergeProps as ut, toHandlers as ct, render as Ge } from "vue";
|
|
2
2
|
const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "content" }, vt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -49,53 +49,53 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
51
|
}), y = O(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
|
-
function
|
|
52
|
+
function L(C, I) {
|
|
53
53
|
if (t.disabled || t.loading || C.disabled || C.loading) {
|
|
54
|
-
|
|
54
|
+
I.preventDefault(), I.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
n("group-click", C.value,
|
|
57
|
+
n("group-click", C.value, I);
|
|
58
58
|
}
|
|
59
|
-
return (C,
|
|
60
|
-
(i(!0), u(
|
|
61
|
-
var
|
|
59
|
+
return (C, I) => y.value ? (i(), u("div", vt, [
|
|
60
|
+
(i(!0), u(re, null, ve(e.groupItems, (x, w) => {
|
|
61
|
+
var g;
|
|
62
62
|
return i(), u("button", {
|
|
63
|
-
key:
|
|
64
|
-
class:
|
|
65
|
-
`y-btn--${
|
|
66
|
-
`y-btn--${
|
|
63
|
+
key: x.value ?? w,
|
|
64
|
+
class: K(["y-btn", [
|
|
65
|
+
`y-btn--${x.variant ?? e.variant}`,
|
|
66
|
+
`y-btn--${x.size ?? e.size}`,
|
|
67
67
|
"is-grouped",
|
|
68
|
-
|
|
69
|
-
{ "is-loading":
|
|
68
|
+
w === 0 ? "group-pos-start" : w === (((g = e.groupItems) == null ? void 0 : g.length) || 0) - 1 ? "group-pos-end" : "group-pos-middle",
|
|
69
|
+
{ "is-loading": x.loading || e.loading }
|
|
70
70
|
]]),
|
|
71
71
|
type: e.htmlType,
|
|
72
|
-
disabled: (
|
|
73
|
-
"aria-busy":
|
|
74
|
-
"aria-disabled": (
|
|
75
|
-
"aria-label":
|
|
76
|
-
onClick: (
|
|
72
|
+
disabled: (x.disabled ?? !1) || e.disabled || e.loading || x.loading,
|
|
73
|
+
"aria-busy": x.loading || e.loading ? "true" : "false",
|
|
74
|
+
"aria-disabled": (x.disabled ?? !1) || e.disabled || e.loading || x.loading ? "true" : "false",
|
|
75
|
+
"aria-label": x.ariaLabel || x.label,
|
|
76
|
+
onClick: (b) => L(x, b)
|
|
77
77
|
}, [
|
|
78
78
|
o("span", pt, [
|
|
79
|
-
|
|
79
|
+
x.icon === "chevron-left" ? (i(), u("svg", yt, [...I[0] || (I[0] = [
|
|
80
80
|
o("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
|
+
])])) : x.icon === "chevron-right" ? (i(), u("svg", gt, [...I[1] || (I[1] = [
|
|
86
86
|
o("path", {
|
|
87
87
|
"fill-rule": "evenodd",
|
|
88
88
|
d: "M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z",
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
|
-
])])) :
|
|
92
|
-
|
|
91
|
+
])])) : H("", !0),
|
|
92
|
+
x.label && !x.onlyIcon ? (i(), u("span", mt, ne(x.label), 1)) : H("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, ht);
|
|
95
95
|
}), 128))
|
|
96
96
|
])) : (i(), u("button", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class:
|
|
98
|
+
class: K(["y-btn", [
|
|
99
99
|
`y-btn--${e.variant}`,
|
|
100
100
|
`y-btn--${e.size}`,
|
|
101
101
|
{ "is-block": e.block, "is-loading": e.loading },
|
|
@@ -109,7 +109,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
109
109
|
onClick: m
|
|
110
110
|
}, [
|
|
111
111
|
o("span", ft, [
|
|
112
|
-
|
|
112
|
+
ce(C.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
114
|
], 10, dt));
|
|
115
115
|
}
|
|
@@ -118,7 +118,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
118
118
|
for (const [n, m] of $)
|
|
119
119
|
t[n] = m;
|
|
120
120
|
return t;
|
|
121
|
-
}, Ne = /* @__PURE__ */ me(wt, [["__scopeId", "data-v-
|
|
121
|
+
}, Ne = /* @__PURE__ */ me(wt, [["__scopeId", "data-v-3ee2f15d"]]), kt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "min", "max", "disabled", "required", "value"], bt = /* @__PURE__ */ ge({
|
|
122
122
|
__name: "yinput",
|
|
123
123
|
props: {
|
|
124
124
|
modelValue: { default: "" },
|
|
@@ -139,42 +139,42 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
139
139
|
},
|
|
140
140
|
emits: ["update:modelValue", "enter", "paste"],
|
|
141
141
|
setup(e, { emit: $ }) {
|
|
142
|
-
const t = e, n = $, m =
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
const t = e, n = $, m = E(null), p = E(""), y = E(!1), L = E(!1), C = E(t.placeholder || "");
|
|
143
|
+
oe(() => t.placeholder, (V) => {
|
|
144
|
+
L.value || (C.value = V || "");
|
|
145
145
|
});
|
|
146
|
-
function
|
|
146
|
+
function I(V) {
|
|
147
147
|
const j = V.target;
|
|
148
148
|
y.value = !0, n("update:modelValue", j.value);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function x() {
|
|
151
|
+
L.value = !0, t.clearOnFocus && (p.value = t.modelValue || "", y.value = !1, C.value = p.value || t.placeholder || "", n("update:modelValue", ""));
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
153
|
+
function w() {
|
|
154
|
+
if (L.value = !1, t.clearOnFocus && !y.value && (!t.modelValue || t.modelValue === "") && n("update:modelValue", p.value), t.min !== void 0 && t.modelValue !== void 0 && t.modelValue !== "") {
|
|
155
155
|
const V = Number(t.modelValue), j = Number(t.min);
|
|
156
156
|
!Number.isNaN(V) && !Number.isNaN(j) && V < j && n("update:modelValue", String(j));
|
|
157
157
|
}
|
|
158
158
|
C.value = t.placeholder || "";
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function g(V) {
|
|
161
161
|
const j = V.target;
|
|
162
162
|
n("enter", j.value);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function b(V) {
|
|
165
165
|
const j = V.target;
|
|
166
166
|
requestAnimationFrame(() => {
|
|
167
167
|
n("paste", j.value);
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
return (V, j) => (i(), u("div", {
|
|
171
|
-
class:
|
|
172
|
-
style:
|
|
171
|
+
class: K(["y-input-wrap", { "is-block": e.block }]),
|
|
172
|
+
style: ue({ width: e.width })
|
|
173
173
|
}, [
|
|
174
174
|
o("input", {
|
|
175
175
|
ref_key: "inputRef",
|
|
176
176
|
ref: m,
|
|
177
|
-
class:
|
|
177
|
+
class: K(["y-input", `y-input--${e.size}`]),
|
|
178
178
|
id: e.id,
|
|
179
179
|
name: e.name,
|
|
180
180
|
type: e.type,
|
|
@@ -186,15 +186,15 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
186
186
|
disabled: e.disabled,
|
|
187
187
|
required: e.required,
|
|
188
188
|
value: e.modelValue,
|
|
189
|
-
onInput:
|
|
190
|
-
onFocus:
|
|
191
|
-
onBlur:
|
|
192
|
-
onKeyup: ke(
|
|
193
|
-
onPaste:
|
|
189
|
+
onInput: I,
|
|
190
|
+
onFocus: x,
|
|
191
|
+
onBlur: w,
|
|
192
|
+
onKeyup: ke(g, ["enter"]),
|
|
193
|
+
onPaste: b
|
|
194
194
|
}, null, 42, kt)
|
|
195
195
|
], 6));
|
|
196
196
|
}
|
|
197
|
-
}),
|
|
197
|
+
}), et = /* @__PURE__ */ me(bt, [["__scopeId", "data-v-c4912c99"]]), xt = {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "bulk-bar"
|
|
200
200
|
}, $t = { class: "bulk-left" }, Ct = { class: "bulk-actions" }, Dt = { class: "card" }, _t = { class: "table" }, St = {
|
|
@@ -254,20 +254,20 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
254
254
|
},
|
|
255
255
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
256
256
|
setup(e, { emit: $ }) {
|
|
257
|
-
const t = e, n = $, m =
|
|
258
|
-
() => t.columns.filter((l) => !
|
|
257
|
+
const t = e, n = $, m = E(t.currentPage || 1), p = E(t.pageSize), y = E([]), L = E(/* @__PURE__ */ new Set()), C = E("none"), I = E(), x = E(), w = E(), g = E(), b = E([]), V = E({}), j = O(
|
|
258
|
+
() => t.columns.filter((l) => !z(l.width)).map((l) => l.key)
|
|
259
259
|
);
|
|
260
260
|
function F() {
|
|
261
261
|
return `${(100 / (j.value.length || 1)).toFixed(6)}%`;
|
|
262
262
|
}
|
|
263
|
-
const
|
|
263
|
+
const A = E(), q = E({
|
|
264
264
|
show: !1,
|
|
265
265
|
thumbHeight: 40,
|
|
266
266
|
thumbTop: 0
|
|
267
267
|
});
|
|
268
|
-
let
|
|
269
|
-
const
|
|
270
|
-
function
|
|
268
|
+
let Q = !1, le = 0, J = 0;
|
|
269
|
+
const W = E(0);
|
|
270
|
+
function z(l) {
|
|
271
271
|
if (l == null) return;
|
|
272
272
|
if (typeof l == "number")
|
|
273
273
|
return Number.isFinite(l) ? `${l}px` : void 0;
|
|
@@ -275,16 +275,16 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
275
275
|
if (d)
|
|
276
276
|
return /^\d+(\.\d+)?$/.test(d) ? `${d}px` : d;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
const d =
|
|
278
|
+
function R(l) {
|
|
279
|
+
const d = z(l);
|
|
280
280
|
if (!d) return null;
|
|
281
281
|
const D = parseFloat(d);
|
|
282
282
|
return Number.isFinite(D) ? D : null;
|
|
283
283
|
}
|
|
284
|
-
const
|
|
284
|
+
const Y = O(() => {
|
|
285
285
|
let l = t.columns.length;
|
|
286
286
|
return t.selectable && (l += 1), t.expandable && (l += 1), l;
|
|
287
|
-
}),
|
|
287
|
+
}), ee = O(() => {
|
|
288
288
|
if (!t.searchKeyword || !t.searchFields.length)
|
|
289
289
|
return t.data;
|
|
290
290
|
const l = t.searchKeyword.toLowerCase();
|
|
@@ -292,9 +292,9 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
292
292
|
const S = r(d, D);
|
|
293
293
|
return String(S).toLowerCase().includes(l);
|
|
294
294
|
}));
|
|
295
|
-
}),
|
|
295
|
+
}), X = O(() => (t.pagination, ee.value)), ae = O(() => {
|
|
296
296
|
if (!t.selectable) return !1;
|
|
297
|
-
const l =
|
|
297
|
+
const l = X.value.map((d, D) => c(d, D));
|
|
298
298
|
return l.length > 0 && l.every((d) => y.value.includes(d));
|
|
299
299
|
}), we = O(() => {
|
|
300
300
|
const l = [];
|
|
@@ -303,8 +303,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
303
303
|
const S = t.columns[D];
|
|
304
304
|
if (S.fixed === "left") {
|
|
305
305
|
let _ = 80;
|
|
306
|
-
const
|
|
307
|
-
|
|
306
|
+
const T = R(S.width);
|
|
307
|
+
T !== null ? _ = T : b.value[D] && (_ = R(b.value[D]) ?? _), l.push(d), d += _;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
return l;
|
|
@@ -315,16 +315,16 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
315
315
|
for (let S = t.columns.length - 1; S >= 0; S--) {
|
|
316
316
|
const _ = t.columns[S];
|
|
317
317
|
if (_.fixed === "right") {
|
|
318
|
-
let
|
|
319
|
-
const
|
|
320
|
-
|
|
318
|
+
let T = 80;
|
|
319
|
+
const U = R(_.width);
|
|
320
|
+
U !== null ? T = U : b.value[S] && (T = R(b.value[S]) ?? T), D.push({ index: S, width: T });
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
for (let S = 0; S < D.length; S++)
|
|
324
324
|
l.push(d), d += D[S].width;
|
|
325
325
|
return l;
|
|
326
326
|
});
|
|
327
|
-
function
|
|
327
|
+
function Z(l, d) {
|
|
328
328
|
if (d === "left") {
|
|
329
329
|
let D = 0;
|
|
330
330
|
for (let S = 0; S < l; S++)
|
|
@@ -341,10 +341,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
341
341
|
return typeof t.rowKey == "function" ? t.rowKey(l) : l[t.rowKey] || d;
|
|
342
342
|
}
|
|
343
343
|
function h(l) {
|
|
344
|
-
return
|
|
344
|
+
return L.value.has(l);
|
|
345
345
|
}
|
|
346
346
|
function a(l) {
|
|
347
|
-
|
|
347
|
+
L.value.has(l) ? L.value.delete(l) : L.value.add(l);
|
|
348
348
|
}
|
|
349
349
|
function r(l, d) {
|
|
350
350
|
return d.split(".").reduce((D, S) => D == null ? void 0 : D[S], l);
|
|
@@ -354,31 +354,31 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
354
354
|
return l.align && D.push(`text-${l.align}`), l.fixed === "right" && (D.push("col-fixed-right"), d && D.push("col-fixed-right-header")), l.fixed === "left" && (D.push("col-fixed-left"), d && D.push("col-fixed-left-header")), D.join(" ");
|
|
355
355
|
}
|
|
356
356
|
function k(l, d, D) {
|
|
357
|
-
const S = {}, _ =
|
|
357
|
+
const S = {}, _ = z(l.width);
|
|
358
358
|
if (_)
|
|
359
359
|
S.width = _, S.minWidth = _, S.maxWidth = _;
|
|
360
360
|
else {
|
|
361
|
-
const
|
|
362
|
-
S.width =
|
|
361
|
+
const T = F();
|
|
362
|
+
S.width = T, S.minWidth = T, S.maxWidth = T;
|
|
363
363
|
}
|
|
364
364
|
if (l.fixed === "left") {
|
|
365
|
-
const
|
|
366
|
-
S.left = `${
|
|
365
|
+
const T = Z(d, "left"), U = we.value[T] || 0;
|
|
366
|
+
S.left = `${U}px`, S.zIndex = D ? `${10 + T}` : `${5 + T}`;
|
|
367
367
|
} else if (l.fixed === "right") {
|
|
368
|
-
const
|
|
369
|
-
D ? S.right = `${
|
|
368
|
+
const T = Z(d, "right"), U = N.value[T] || 0;
|
|
369
|
+
D ? S.right = `${U - 3}px` : S.right = `${U}px`, S.zIndex = D ? `${10 + T}` : `${5 + T}`;
|
|
370
370
|
}
|
|
371
371
|
return S;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function M(l, d) {
|
|
374
374
|
const D = r(l, d.key);
|
|
375
375
|
return d.formatter ? d.formatter(D, l) : D || "";
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function B(l) {
|
|
378
378
|
y.value.includes(l) ? y.value = y.value.filter((d) => d !== l) : y.value = [...y.value, l], n("select", y.value), n("update:selectedItems", y.value);
|
|
379
379
|
}
|
|
380
380
|
function P() {
|
|
381
|
-
const l =
|
|
381
|
+
const l = X.value.map((d, D) => c(d, D));
|
|
382
382
|
if (l.every((d) => y.value.includes(d)))
|
|
383
383
|
y.value = y.value.filter((d) => !l.includes(d));
|
|
384
384
|
else {
|
|
@@ -387,12 +387,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
387
387
|
}
|
|
388
388
|
n("select", y.value), n("update:selectedItems", y.value);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function te() {
|
|
391
391
|
y.value = [], n("select", y.value), n("update:selectedItems", y.value);
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
oe(() => t.searchKeyword, () => {
|
|
394
394
|
m.value = 1;
|
|
395
|
-
}),
|
|
395
|
+
}), oe(() => t.data, () => {
|
|
396
396
|
t.total || (m.value = 1);
|
|
397
397
|
}, { deep: !0 });
|
|
398
398
|
function ye(l) {
|
|
@@ -401,64 +401,64 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
401
401
|
function Le(l) {
|
|
402
402
|
p.value = l, m.value = 1, n("page-size-change", l);
|
|
403
403
|
}
|
|
404
|
-
|
|
404
|
+
oe(() => t.currentPage, (l) => {
|
|
405
405
|
const d = typeof l == "number" && l > 0 ? l : 1;
|
|
406
406
|
m.value !== d && (m.value = d);
|
|
407
|
-
}),
|
|
407
|
+
}), oe(() => t.pageSize, (l) => {
|
|
408
408
|
const d = typeof l == "number" && l > 0 ? l : 10;
|
|
409
409
|
p.value !== d && (p.value = d);
|
|
410
410
|
});
|
|
411
411
|
function Ce() {
|
|
412
|
-
|
|
413
|
-
const l =
|
|
414
|
-
Ze && (Ze.offsetHeight >
|
|
412
|
+
I.value && se(() => {
|
|
413
|
+
const l = I.value.getBoundingClientRect(), d = window.innerHeight, D = l.top, S = I.value.querySelector(".table-header"), _ = S ? S.offsetHeight : 40, T = I.value.querySelector(".ypagination"), U = T ? T.offsetHeight : 60, he = I.value.querySelector(".bulk-bar"), pe = he ? he.offsetHeight : 0, Ke = _ + U + pe + 20, ie = d - D - Ke, lt = Math.max(200, ie), Ze = I.value.querySelector(".table-body-wrap .table");
|
|
414
|
+
Ze && (Ze.offsetHeight > ie ? C.value = `${lt}px` : C.value = "none");
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
let Me = !1;
|
|
418
418
|
function Ie() {
|
|
419
|
-
!
|
|
419
|
+
!x.value || !w.value || Me || x.value.scrollLeft !== w.value.scrollLeft && (Me = !0, x.value.scrollLeft = w.value.scrollLeft, requestAnimationFrame(() => {
|
|
420
420
|
Me = !1;
|
|
421
421
|
}));
|
|
422
422
|
}
|
|
423
423
|
function Pe() {
|
|
424
|
-
!
|
|
424
|
+
!x.value || !w.value || Me || w.value.scrollLeft !== x.value.scrollLeft && (Me = !0, w.value.scrollLeft = x.value.scrollLeft, requestAnimationFrame(() => {
|
|
425
425
|
Me = !1;
|
|
426
426
|
}));
|
|
427
427
|
}
|
|
428
428
|
function Re() {
|
|
429
|
-
|
|
430
|
-
if (!
|
|
431
|
-
const l =
|
|
432
|
-
if (
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
const Ke = Math.max(0, he - pe),
|
|
436
|
-
|
|
429
|
+
se(() => {
|
|
430
|
+
if (!w.value) return;
|
|
431
|
+
const l = w.value, d = l.scrollHeight, D = l.clientHeight, S = l.scrollTop, _ = d > D + 1;
|
|
432
|
+
if (q.value.show = _, !_) return;
|
|
433
|
+
const T = 24, U = D / d, he = A.value ? A.value.clientHeight : D, pe = Math.max(T, Math.floor(he * U));
|
|
434
|
+
q.value.thumbHeight = pe;
|
|
435
|
+
const Ke = Math.max(0, he - pe), ie = Math.max(1, d - D);
|
|
436
|
+
q.value.thumbTop = Math.min(Ke, Math.floor(S / ie * Ke));
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
function Ve(l) {
|
|
440
|
-
if (!
|
|
440
|
+
if (!Q || !w.value || !A.value) return;
|
|
441
441
|
l.preventDefault();
|
|
442
|
-
const d =
|
|
443
|
-
S.scrollTop = Math.min(
|
|
442
|
+
const d = A.value.clientHeight, D = Math.max(0, d - q.value.thumbHeight), S = w.value, _ = S.scrollHeight, T = S.clientHeight, U = Math.max(1, _ - T), pe = (l.clientY - le) / Math.max(1, D) * U;
|
|
443
|
+
S.scrollTop = Math.min(U, Math.max(0, J + pe)), Re();
|
|
444
444
|
}
|
|
445
445
|
function Ye() {
|
|
446
|
-
|
|
446
|
+
Q = !1, window.removeEventListener("mousemove", Ve), window.removeEventListener("mouseup", Ye);
|
|
447
447
|
}
|
|
448
448
|
function We() {
|
|
449
|
-
|
|
449
|
+
se(() => {
|
|
450
450
|
var D, S;
|
|
451
|
-
if (
|
|
451
|
+
if (b.value.length === t.columns.length && b.value.every((_) => !!_))
|
|
452
452
|
return;
|
|
453
453
|
const l = [];
|
|
454
|
-
t.columns.forEach((_,
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
l.push(
|
|
454
|
+
t.columns.forEach((_, T) => {
|
|
455
|
+
const U = z(_.width);
|
|
456
|
+
if (U)
|
|
457
|
+
l.push(U), V.value[_.key] = U;
|
|
458
458
|
else if (V.value[_.key])
|
|
459
459
|
l.push(V.value[_.key]);
|
|
460
460
|
else {
|
|
461
|
-
const he =
|
|
461
|
+
const he = b.value[T];
|
|
462
462
|
if (he)
|
|
463
463
|
l.push(he), V.value[_.key] = he;
|
|
464
464
|
else {
|
|
@@ -467,84 +467,84 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
});
|
|
470
|
-
const d = (D =
|
|
470
|
+
const d = (D = g.value) == null ? void 0 : D.querySelector("tbody tr");
|
|
471
471
|
if (d) {
|
|
472
|
-
const _ = t.selectable ? 1 : 0,
|
|
473
|
-
for (let
|
|
474
|
-
if (!l[
|
|
475
|
-
const he =
|
|
472
|
+
const _ = t.selectable ? 1 : 0, T = Array.from(d.children);
|
|
473
|
+
for (let U = 0; U < t.columns.length; U++)
|
|
474
|
+
if (!l[U]) {
|
|
475
|
+
const he = T[_ + U];
|
|
476
476
|
if (he && he.clientWidth > 0) {
|
|
477
477
|
const pe = `${he.clientWidth}px`;
|
|
478
|
-
l[
|
|
478
|
+
l[U] = pe, V.value[t.columns[U].key] = pe;
|
|
479
479
|
} else {
|
|
480
480
|
const pe = F();
|
|
481
|
-
l[
|
|
481
|
+
l[U] = pe, V.value[t.columns[U].key] = pe;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
} else
|
|
485
485
|
for (let _ = 0; _ < l.length; _++)
|
|
486
486
|
if (!l[_]) {
|
|
487
|
-
const
|
|
488
|
-
l[_] =
|
|
487
|
+
const T = V.value[((S = t.columns[_]) == null ? void 0 : S.key) || ""];
|
|
488
|
+
l[_] = T || b.value[_] || "80px", t.columns[_] && (V.value[t.columns[_].key] = l[_]);
|
|
489
489
|
}
|
|
490
|
-
|
|
490
|
+
b.value = l;
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
493
|
function He() {
|
|
494
494
|
Ce(), s();
|
|
495
495
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
Ce(), Ie(), s(),
|
|
496
|
+
oe(() => t.data, () => {
|
|
497
|
+
se(() => {
|
|
498
|
+
Ce(), Ie(), s(), L.value.clear();
|
|
499
499
|
});
|
|
500
|
-
}, { deep: !0 }),
|
|
501
|
-
|
|
500
|
+
}, { deep: !0 }), oe([m, p], () => {
|
|
501
|
+
se(() => {
|
|
502
502
|
Ce(), Ie(), s();
|
|
503
503
|
});
|
|
504
|
-
}),
|
|
504
|
+
}), oe(() => t.columns, () => {
|
|
505
505
|
const l = [], d = { ...V.value };
|
|
506
506
|
t.columns.forEach((S, _) => {
|
|
507
|
-
const
|
|
508
|
-
|
|
507
|
+
const T = z(S.width);
|
|
508
|
+
T ? (l.push(T), d[S.key] = T) : d[S.key] ? l.push(d[S.key]) : b.value[_] ? (l.push(b.value[_]), d[S.key] = b.value[_]) : l.push("");
|
|
509
509
|
});
|
|
510
510
|
const D = new Set(t.columns.map((S) => S.key));
|
|
511
511
|
Object.keys(d).forEach((S) => {
|
|
512
512
|
D.has(S) || delete d[S];
|
|
513
|
-
}), V.value = d,
|
|
513
|
+
}), V.value = d, b.value = l, se(() => {
|
|
514
514
|
We(), Ie(), s();
|
|
515
515
|
});
|
|
516
|
-
}, { deep: !0 }),
|
|
517
|
-
|
|
516
|
+
}, { deep: !0 }), oe(() => y.value, () => {
|
|
517
|
+
se(() => {
|
|
518
518
|
Ce(), s();
|
|
519
519
|
});
|
|
520
|
-
}, { deep: !0 }),
|
|
521
|
-
|
|
520
|
+
}, { deep: !0 }), oe(() => t.loading, () => {
|
|
521
|
+
se(() => {
|
|
522
522
|
s();
|
|
523
523
|
});
|
|
524
524
|
}), $e(() => {
|
|
525
525
|
var l, d;
|
|
526
|
-
|
|
526
|
+
se(() => {
|
|
527
527
|
Ce(), We(), s(), Re();
|
|
528
|
-
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (l =
|
|
528
|
+
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (l = w.value) == null || l.addEventListener("scroll", () => {
|
|
529
529
|
Ie(), Re(), s();
|
|
530
|
-
}, { passive: !0 }), (d =
|
|
530
|
+
}, { passive: !0 }), (d = x.value) == null || d.addEventListener("scroll", () => {
|
|
531
531
|
Pe();
|
|
532
|
-
}, { passive: !0 }),
|
|
532
|
+
}, { passive: !0 }), se(() => Ie()), w.value && typeof ResizeObserver < "u" && (v = new ResizeObserver(() => {
|
|
533
533
|
s();
|
|
534
|
-
}), v.observe(
|
|
534
|
+
}), v.observe(w.value));
|
|
535
535
|
}), Be(() => {
|
|
536
536
|
var l, d;
|
|
537
|
-
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l =
|
|
537
|
+
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l = w.value) == null || l.removeEventListener("scroll", Ie), (d = x.value) == null || d.removeEventListener("scroll", Pe), window.removeEventListener("mousemove", Ve), window.removeEventListener("mouseup", Ye), v && (v.disconnect(), v = null);
|
|
538
538
|
});
|
|
539
539
|
let Te = -1;
|
|
540
540
|
function s() {
|
|
541
|
-
!
|
|
542
|
-
if (!
|
|
543
|
-
const l =
|
|
544
|
-
if (
|
|
541
|
+
!x.value || !w.value || requestAnimationFrame(() => {
|
|
542
|
+
if (!x.value || !w.value) return;
|
|
543
|
+
const l = w.value, d = Math.ceil(l.offsetWidth - l.clientWidth);
|
|
544
|
+
if (W.value = d, d !== Te) {
|
|
545
545
|
Te = d;
|
|
546
|
-
const D =
|
|
547
|
-
D && S && (
|
|
546
|
+
const D = x.value.querySelector(".table"), S = g.value;
|
|
547
|
+
D && S && (x.value.style.paddingRight = "0px", D.style.width = "", D.style.marginRight = "", d > 0 ? (x.value.style.paddingRight = `${d}px`, D.style.width = "100%", D.style.marginRight = `-${d}px`) : (x.value.style.paddingRight = "0px", D.style.width = "100%", D.style.marginRight = "0px"));
|
|
548
548
|
}
|
|
549
549
|
});
|
|
550
550
|
}
|
|
@@ -554,30 +554,30 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
554
554
|
return i(), u("div", {
|
|
555
555
|
class: "ytable-container",
|
|
556
556
|
ref_key: "tableContainer",
|
|
557
|
-
ref:
|
|
557
|
+
ref: I
|
|
558
558
|
}, [
|
|
559
|
-
|
|
560
|
-
default:
|
|
559
|
+
de(be, { name: "bulk-slide" }, {
|
|
560
|
+
default: fe(() => [
|
|
561
561
|
y.value.length && e.showBulkActions ? (i(), u("div", xt, [
|
|
562
|
-
o("div", $t, "已选择 " +
|
|
562
|
+
o("div", $t, "已选择 " + ne(y.value.length) + " 项", 1),
|
|
563
563
|
o("div", Ct, [
|
|
564
|
-
|
|
564
|
+
ce(l.$slots, "bulk-actions", {
|
|
565
565
|
selectedItems: y.value,
|
|
566
|
-
clearSelection:
|
|
566
|
+
clearSelection: te
|
|
567
567
|
}, () => [
|
|
568
|
-
|
|
568
|
+
de(D, {
|
|
569
569
|
size: "small",
|
|
570
570
|
class: "btn",
|
|
571
|
-
onClick:
|
|
571
|
+
onClick: te
|
|
572
572
|
}, {
|
|
573
|
-
default:
|
|
573
|
+
default: fe(() => [...d[2] || (d[2] = [
|
|
574
574
|
xe("清除选择", -1)
|
|
575
575
|
])]),
|
|
576
576
|
_: 1
|
|
577
577
|
})
|
|
578
578
|
], !0)
|
|
579
579
|
])
|
|
580
|
-
])) :
|
|
580
|
+
])) : H("", !0)
|
|
581
581
|
]),
|
|
582
582
|
_: 3
|
|
583
583
|
}),
|
|
@@ -585,116 +585,116 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
585
585
|
o("div", {
|
|
586
586
|
class: "table-header",
|
|
587
587
|
ref_key: "headerRef",
|
|
588
|
-
ref:
|
|
588
|
+
ref: x
|
|
589
589
|
}, [
|
|
590
590
|
o("table", _t, [
|
|
591
591
|
o("colgroup", null, [
|
|
592
|
-
t.expandable ? (i(), u("col", St)) :
|
|
593
|
-
e.selectable ? (i(), u("col", Lt)) :
|
|
594
|
-
(i(!0), u(
|
|
592
|
+
t.expandable ? (i(), u("col", St)) : H("", !0),
|
|
593
|
+
e.selectable ? (i(), u("col", Lt)) : H("", !0),
|
|
594
|
+
(i(!0), u(re, null, ve(e.columns, (_, T) => (i(), u("col", {
|
|
595
595
|
key: _.key,
|
|
596
|
-
style:
|
|
596
|
+
style: ue({ width: b.value[T] || void 0, minWidth: b.value[T] || "80px" })
|
|
597
597
|
}, null, 4))), 128))
|
|
598
598
|
]),
|
|
599
599
|
o("thead", null, [
|
|
600
600
|
o("tr", null, [
|
|
601
|
-
t.expandable ? (i(), u("th", Mt)) :
|
|
601
|
+
t.expandable ? (i(), u("th", Mt)) : H("", !0),
|
|
602
602
|
e.selectable ? (i(), u("th", It, [
|
|
603
603
|
o("input", {
|
|
604
604
|
type: "checkbox",
|
|
605
|
-
checked:
|
|
605
|
+
checked: ae.value,
|
|
606
606
|
onChange: P
|
|
607
607
|
}, null, 40, Et)
|
|
608
|
-
])) :
|
|
609
|
-
(i(!0), u(
|
|
608
|
+
])) : H("", !0),
|
|
609
|
+
(i(!0), u(re, null, ve(e.columns, (_, T) => (i(), u("th", {
|
|
610
610
|
key: _.key,
|
|
611
|
-
class:
|
|
612
|
-
style:
|
|
613
|
-
},
|
|
611
|
+
class: K(f(_, !0)),
|
|
612
|
+
style: ue(k(_, T, !0))
|
|
613
|
+
}, ne(_.title), 7))), 128))
|
|
614
614
|
])
|
|
615
615
|
])
|
|
616
616
|
])
|
|
617
617
|
], 512),
|
|
618
618
|
o("div", {
|
|
619
|
-
class:
|
|
619
|
+
class: K(["table-body-wrap", { "is-loading": e.loading, "is-empty": !X.value.length && !e.loading }]),
|
|
620
620
|
ref_key: "bodyWrapRef",
|
|
621
|
-
ref:
|
|
622
|
-
style:
|
|
621
|
+
ref: w,
|
|
622
|
+
style: ue({ maxHeight: C.value })
|
|
623
623
|
}, [
|
|
624
624
|
e.loading ? (i(), u("div", Bt, [...d[3] || (d[3] = [
|
|
625
625
|
o("div", { class: "loading-spinner" }, null, -1),
|
|
626
626
|
o("div", { class: "loading-text" }, "加载中...", -1)
|
|
627
|
-
])])) :
|
|
628
|
-
!
|
|
629
|
-
|
|
630
|
-
xe(
|
|
627
|
+
])])) : H("", !0),
|
|
628
|
+
!X.value.length && !e.loading ? (i(), u("div", Tt, [
|
|
629
|
+
ce(l.$slots, "empty", {}, () => [
|
|
630
|
+
xe(ne(e.emptyText), 1)
|
|
631
631
|
], !0)
|
|
632
|
-
])) :
|
|
632
|
+
])) : H("", !0),
|
|
633
633
|
o("table", {
|
|
634
|
-
class:
|
|
634
|
+
class: K(["table", { "loading-table": e.loading }]),
|
|
635
635
|
ref_key: "bodyTableRef",
|
|
636
|
-
ref:
|
|
636
|
+
ref: g
|
|
637
637
|
}, [
|
|
638
638
|
o("colgroup", null, [
|
|
639
|
-
t.expandable ? (i(), u("col", Kt)) :
|
|
640
|
-
e.selectable ? (i(), u("col", zt)) :
|
|
641
|
-
(i(!0), u(
|
|
639
|
+
t.expandable ? (i(), u("col", Kt)) : H("", !0),
|
|
640
|
+
e.selectable ? (i(), u("col", zt)) : H("", !0),
|
|
641
|
+
(i(!0), u(re, null, ve(e.columns, (_, T) => (i(), u("col", {
|
|
642
642
|
key: _.key,
|
|
643
|
-
style:
|
|
643
|
+
style: ue({ width: b.value[T] || void 0, minWidth: b.value[T] || "80px" })
|
|
644
644
|
}, null, 4))), 128))
|
|
645
645
|
]),
|
|
646
646
|
o("tbody", null, [
|
|
647
|
-
(i(!0), u(
|
|
648
|
-
key: c(_,
|
|
647
|
+
(i(!0), u(re, null, ve(X.value, (_, T) => (i(), u(re, {
|
|
648
|
+
key: c(_, T)
|
|
649
649
|
}, [
|
|
650
650
|
o("tr", null, [
|
|
651
651
|
t.expandable ? (i(), u("td", Ht, [
|
|
652
652
|
o("button", {
|
|
653
653
|
class: "expand-btn",
|
|
654
654
|
type: "button",
|
|
655
|
-
onClick: (
|
|
655
|
+
onClick: (U) => a(c(_, T))
|
|
656
656
|
}, [
|
|
657
657
|
o("span", {
|
|
658
|
-
class:
|
|
658
|
+
class: K(["expand-icon", { "is-open": h(c(_, T)) }])
|
|
659
659
|
}, null, 2)
|
|
660
660
|
], 8, Rt)
|
|
661
|
-
])) :
|
|
661
|
+
])) : H("", !0),
|
|
662
662
|
e.selectable ? (i(), u("td", Vt, [
|
|
663
663
|
o("input", {
|
|
664
664
|
type: "checkbox",
|
|
665
|
-
value: c(_,
|
|
666
|
-
checked: y.value.includes(c(_,
|
|
667
|
-
onChange: (
|
|
665
|
+
value: c(_, T),
|
|
666
|
+
checked: y.value.includes(c(_, T)),
|
|
667
|
+
onChange: (U) => B(c(_, T))
|
|
668
668
|
}, null, 40, Wt)
|
|
669
|
-
])) :
|
|
670
|
-
(i(!0), u(
|
|
671
|
-
key:
|
|
672
|
-
class:
|
|
673
|
-
style:
|
|
669
|
+
])) : H("", !0),
|
|
670
|
+
(i(!0), u(re, null, ve(e.columns, (U, he) => (i(), u("td", {
|
|
671
|
+
key: U.key,
|
|
672
|
+
class: K(f(U)),
|
|
673
|
+
style: ue(k(U, he, !1))
|
|
674
674
|
}, [
|
|
675
|
-
|
|
675
|
+
ce(l.$slots, `cell-${U.key}`, {
|
|
676
676
|
item: _,
|
|
677
|
-
value: r(_,
|
|
678
|
-
index:
|
|
677
|
+
value: r(_, U.key),
|
|
678
|
+
index: T
|
|
679
679
|
}, () => [
|
|
680
|
-
xe(
|
|
680
|
+
xe(ne(M(_, U)), 1)
|
|
681
681
|
], !0)
|
|
682
682
|
], 6))), 128))
|
|
683
683
|
]),
|
|
684
|
-
t.expandable && h(c(_,
|
|
685
|
-
key: `${c(_,
|
|
684
|
+
t.expandable && h(c(_, T)) ? (i(), u("tr", {
|
|
685
|
+
key: `${c(_, T)}-expand`,
|
|
686
686
|
class: "expand-row"
|
|
687
687
|
}, [
|
|
688
688
|
o("td", {
|
|
689
|
-
colspan:
|
|
689
|
+
colspan: Y.value,
|
|
690
690
|
class: "expand-cell"
|
|
691
691
|
}, [
|
|
692
|
-
|
|
692
|
+
ce(l.$slots, "expand", {
|
|
693
693
|
item: _,
|
|
694
|
-
index:
|
|
694
|
+
index: T
|
|
695
695
|
}, void 0, !0)
|
|
696
696
|
], 8, At)
|
|
697
|
-
])) :
|
|
697
|
+
])) : H("", !0)
|
|
698
698
|
], 64))), 128))
|
|
699
699
|
])
|
|
700
700
|
], 2)
|
|
@@ -710,7 +710,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
710
710
|
"page-size-options": e.pageSizeOptions,
|
|
711
711
|
onPageChange: ye,
|
|
712
712
|
onPageSizeChange: Le
|
|
713
|
-
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) :
|
|
713
|
+
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : H("", !0)
|
|
714
714
|
])
|
|
715
715
|
], 512);
|
|
716
716
|
};
|
|
@@ -734,65 +734,65 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
734
734
|
},
|
|
735
735
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
736
736
|
setup(e, { emit: $ }) {
|
|
737
|
-
const t = e, n = $, m =
|
|
737
|
+
const t = e, n = $, m = E(!1), p = E(-1), y = E(), L = E(), C = E(), I = E(), x = E(!1), w = E(), g = E(""), b = O(() => t.options.find((a) => q(a) === t.modelValue) || null), V = O(() => b.value ? Q(b.value) : ""), j = O(() => {
|
|
738
738
|
if (!t.filterable) return t.options;
|
|
739
|
-
const a =
|
|
739
|
+
const a = g.value.trim().toLowerCase();
|
|
740
740
|
return a ? t.options.filter((r) => {
|
|
741
|
-
const f =
|
|
741
|
+
const f = Q(r);
|
|
742
742
|
return String(f).toLowerCase().includes(a);
|
|
743
743
|
}) : t.options;
|
|
744
744
|
}), F = O(() => {
|
|
745
|
-
var
|
|
746
|
-
const a = { position: "fixed", zIndex: "4000" }, r =
|
|
745
|
+
var M;
|
|
746
|
+
const a = { position: "fixed", zIndex: "4000" }, r = L.value;
|
|
747
747
|
if (!r) return a;
|
|
748
|
-
const f = r.getBoundingClientRect(), k = ((
|
|
749
|
-
return a.left = `${f.left}px`, a.width = `${k}px`,
|
|
748
|
+
const f = r.getBoundingClientRect(), k = ((M = C.value) == null ? void 0 : M.getBoundingClientRect().width) || f.width;
|
|
749
|
+
return a.left = `${f.left}px`, a.width = `${k}px`, x.value ? (a.bottom = `${window.innerHeight - f.top + 4}px`, a.top = "auto") : a.top = `${f.bottom + 4}px`, a;
|
|
750
750
|
});
|
|
751
|
-
function
|
|
752
|
-
!m.value || !
|
|
753
|
-
const a =
|
|
751
|
+
function A() {
|
|
752
|
+
!m.value || !L.value || se(() => {
|
|
753
|
+
const a = L.value;
|
|
754
754
|
if (!a) return;
|
|
755
|
-
const r = a.getBoundingClientRect(), f = window.innerHeight, k = 200,
|
|
756
|
-
|
|
755
|
+
const r = a.getBoundingClientRect(), f = window.innerHeight, k = 200, M = r.bottom + k + 4, B = r.top - k - 4, P = M <= f - 20, te = B >= 20;
|
|
756
|
+
x.value = !P && te;
|
|
757
757
|
});
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function q(a) {
|
|
760
760
|
return typeof a == "object" && a !== null ? a[t.valueKey] : a;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function Q(a) {
|
|
763
763
|
return typeof a == "object" && a !== null ? a[t.labelKey] || String(a[t.valueKey]) : String(a);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
return typeof a == "object" && a !== null && a.id !== void 0 ? a.id :
|
|
765
|
+
function le(a, r) {
|
|
766
|
+
return typeof a == "object" && a !== null && a.id !== void 0 ? a.id : q(a) || r;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
return
|
|
768
|
+
function J(a) {
|
|
769
|
+
return q(a) === t.modelValue;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function W(a) {
|
|
772
772
|
return typeof a == "object" && a !== null ? a[t.disabledKey] === !0 : !1;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
775
|
-
t.disabled || (m.value ?
|
|
774
|
+
function z() {
|
|
775
|
+
t.disabled || (m.value ? Y() : R());
|
|
776
776
|
}
|
|
777
|
-
function
|
|
778
|
-
t.disabled || (m.value = !0,
|
|
779
|
-
|
|
777
|
+
function R() {
|
|
778
|
+
t.disabled || (m.value = !0, se(() => {
|
|
779
|
+
A(), N(), t.filterable && w.value && (w.value.focus(), g.value = "");
|
|
780
780
|
}));
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
m.value = !1, p.value = -1,
|
|
782
|
+
function Y() {
|
|
783
|
+
m.value = !1, p.value = -1, x.value = !1, t.filterable && (g.value = "");
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
if (
|
|
787
|
-
const f =
|
|
788
|
-
n("update:modelValue", f), n("change", f, a),
|
|
785
|
+
function ee(a, r) {
|
|
786
|
+
if (W(a)) return;
|
|
787
|
+
const f = q(a);
|
|
788
|
+
n("update:modelValue", f), n("change", f, a), Y();
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function X() {
|
|
791
791
|
if (!t.clearable || t.disabled) return;
|
|
792
792
|
const a = t.clearTo;
|
|
793
|
-
n("update:modelValue", a), n("change", a, null), n("clear"),
|
|
793
|
+
n("update:modelValue", a), n("change", a, null), n("clear"), Y();
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function ae(a) {
|
|
796
796
|
if (!j.value || j.value.length === 0) {
|
|
797
797
|
p.value = -1;
|
|
798
798
|
return;
|
|
@@ -801,60 +801,60 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
801
801
|
const f = j.value.length;
|
|
802
802
|
r === -1 ? r = a > 0 ? 0 : f - 1 : r = (r + a + f) % f;
|
|
803
803
|
let k = 0;
|
|
804
|
-
for (; k < f &&
|
|
804
|
+
for (; k < f && W(j.value[r]); )
|
|
805
805
|
r = (r + a + f) % f, k++;
|
|
806
|
-
p.value = k >= f ? -1 : r,
|
|
806
|
+
p.value = k >= f ? -1 : r, Z();
|
|
807
807
|
}
|
|
808
808
|
function we() {
|
|
809
809
|
if (p.value < 0) return;
|
|
810
810
|
const a = j.value[p.value];
|
|
811
|
-
!a ||
|
|
811
|
+
!a || W(a) || ee(a, p.value);
|
|
812
812
|
}
|
|
813
813
|
function N() {
|
|
814
814
|
if (!y.value) return;
|
|
815
815
|
const a = y.value.querySelector(".yselect__option--selected");
|
|
816
816
|
a && a.scrollIntoView({ block: "nearest" });
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function Z() {
|
|
819
819
|
if (!y.value || p.value < 0) return;
|
|
820
820
|
const r = y.value.querySelectorAll(".yselect__option")[p.value];
|
|
821
821
|
r && r.scrollIntoView({ block: "nearest" });
|
|
822
822
|
}
|
|
823
823
|
function c(a) {
|
|
824
824
|
const r = a.target;
|
|
825
|
-
(!C.value || !C.value.contains(r)) &&
|
|
825
|
+
(!C.value || !C.value.contains(r)) && Y();
|
|
826
826
|
}
|
|
827
|
-
|
|
827
|
+
oe(() => t.modelValue, () => {
|
|
828
828
|
p.value = -1;
|
|
829
829
|
});
|
|
830
830
|
function h() {
|
|
831
|
-
m.value &&
|
|
831
|
+
m.value && A();
|
|
832
832
|
}
|
|
833
833
|
return $e(() => {
|
|
834
834
|
document.addEventListener("click", c), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
835
835
|
}), Be(() => {
|
|
836
836
|
document.removeEventListener("click", c), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
837
837
|
}), (a, r) => (i(), u("div", {
|
|
838
|
-
class:
|
|
839
|
-
style:
|
|
838
|
+
class: K(["yselect", { "yselect--disabled": e.disabled, [`yselect--${e.size}`]: !0 }]),
|
|
839
|
+
style: ue({ width: e.width }),
|
|
840
840
|
ref_key: "selectContainer",
|
|
841
841
|
ref: C
|
|
842
842
|
}, [
|
|
843
843
|
o("div", {
|
|
844
844
|
ref_key: "triggerElement",
|
|
845
|
-
ref:
|
|
846
|
-
class:
|
|
845
|
+
ref: L,
|
|
846
|
+
class: K(["yselect__trigger", {
|
|
847
847
|
"yselect__trigger--open": m.value,
|
|
848
848
|
"yselect__trigger--disabled": e.disabled,
|
|
849
849
|
"yselect__trigger--error": e.error
|
|
850
850
|
}]),
|
|
851
|
-
onMousedown:
|
|
851
|
+
onMousedown: G(z, ["prevent", "stop"]),
|
|
852
852
|
onKeydown: [
|
|
853
|
-
ke(
|
|
854
|
-
ke(
|
|
855
|
-
ke(
|
|
856
|
-
ke(
|
|
857
|
-
ke(
|
|
853
|
+
ke(G(z, ["prevent"]), ["enter"]),
|
|
854
|
+
ke(G(z, ["prevent"]), ["space"]),
|
|
855
|
+
ke(Y, ["escape"]),
|
|
856
|
+
ke(G(R, ["prevent"]), ["arrow-down"]),
|
|
857
|
+
ke(G(R, ["prevent"]), ["arrow-up"])
|
|
858
858
|
],
|
|
859
859
|
tabindex: "0",
|
|
860
860
|
role: "combobox",
|
|
@@ -863,52 +863,52 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
863
863
|
}, [
|
|
864
864
|
!e.filterable || !m.value ? (i(), u("span", {
|
|
865
865
|
key: 0,
|
|
866
|
-
class:
|
|
866
|
+
class: K(["yselect__value", { yselect__placeholder: !V.value }])
|
|
867
867
|
}, [
|
|
868
|
-
|
|
869
|
-
value:
|
|
868
|
+
ce(a.$slots, "value", {
|
|
869
|
+
value: b.value,
|
|
870
870
|
label: V.value
|
|
871
871
|
}, () => {
|
|
872
872
|
var f;
|
|
873
873
|
return [
|
|
874
|
-
|
|
875
|
-
(f =
|
|
874
|
+
b.value ? (i(), u(re, { key: 0 }, [
|
|
875
|
+
(f = b.value) != null && f.flagImg ? (i(), u("img", {
|
|
876
876
|
key: 0,
|
|
877
877
|
class: "yselect__flag",
|
|
878
|
-
src:
|
|
878
|
+
src: b.value.flagImg,
|
|
879
879
|
alt: "flag"
|
|
880
|
-
}, null, 8, Nt)) :
|
|
881
|
-
xe(" " +
|
|
882
|
-
], 64)) : (i(), u(
|
|
883
|
-
xe(
|
|
880
|
+
}, null, 8, Nt)) : H("", !0),
|
|
881
|
+
xe(" " + ne(V.value), 1)
|
|
882
|
+
], 64)) : (i(), u(re, { key: 1 }, [
|
|
883
|
+
xe(ne(e.placeholder), 1)
|
|
884
884
|
], 64))
|
|
885
885
|
];
|
|
886
886
|
}, !0)
|
|
887
887
|
], 2)) : Ee((i(), u("input", {
|
|
888
888
|
key: 1,
|
|
889
889
|
ref_key: "inputElement",
|
|
890
|
-
ref:
|
|
890
|
+
ref: w,
|
|
891
891
|
class: "yselect__input",
|
|
892
892
|
type: "text",
|
|
893
893
|
placeholder: V.value || e.placeholder,
|
|
894
|
-
"onUpdate:modelValue": r[0] || (r[0] = (f) =>
|
|
894
|
+
"onUpdate:modelValue": r[0] || (r[0] = (f) => g.value = f),
|
|
895
895
|
onKeydown: [
|
|
896
|
-
r[1] || (r[1] =
|
|
896
|
+
r[1] || (r[1] = G(() => {
|
|
897
897
|
}, ["stop"])),
|
|
898
|
-
r[2] || (r[2] = ke(
|
|
899
|
-
r[3] || (r[3] = ke(
|
|
900
|
-
r[4] || (r[4] = ke(
|
|
901
|
-
ke(
|
|
902
|
-
ke(X
|
|
898
|
+
r[2] || (r[2] = ke(G((f) => ae(1), ["prevent"]), ["arrow-down"])),
|
|
899
|
+
r[3] || (r[3] = ke(G((f) => ae(-1), ["prevent"]), ["arrow-up"])),
|
|
900
|
+
r[4] || (r[4] = ke(G((f) => we(), ["prevent"]), ["enter"])),
|
|
901
|
+
ke(G(Y, ["prevent"]), ["esc"]),
|
|
902
|
+
ke(G(X, ["prevent"]), ["delete"])
|
|
903
903
|
]
|
|
904
904
|
}, null, 40, Ot)), [
|
|
905
|
-
[
|
|
905
|
+
[ot, g.value]
|
|
906
906
|
]),
|
|
907
|
-
e.clearable && !e.disabled &&
|
|
907
|
+
e.clearable && !e.disabled && b.value ? (i(), u("span", {
|
|
908
908
|
key: 2,
|
|
909
909
|
class: "yselect__clear",
|
|
910
910
|
title: "清空",
|
|
911
|
-
onClick: X
|
|
911
|
+
onClick: G(X, ["stop"])
|
|
912
912
|
}, [...r[8] || (r[8] = [
|
|
913
913
|
o("svg", {
|
|
914
914
|
width: "12",
|
|
@@ -923,9 +923,9 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
923
923
|
"stroke-linecap": "round"
|
|
924
924
|
})
|
|
925
925
|
], -1)
|
|
926
|
-
])])) :
|
|
926
|
+
])])) : H("", !0),
|
|
927
927
|
o("span", {
|
|
928
|
-
class:
|
|
928
|
+
class: K(["yselect__arrow", { "yselect__arrow--open": m.value }])
|
|
929
929
|
}, [...r[9] || (r[9] = [
|
|
930
930
|
o("svg", {
|
|
931
931
|
width: "12",
|
|
@@ -943,18 +943,18 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
943
943
|
], -1)
|
|
944
944
|
])], 2)
|
|
945
945
|
], 42, Yt),
|
|
946
|
-
|
|
947
|
-
default:
|
|
946
|
+
de(be, { name: "yselect-dropdown" }, {
|
|
947
|
+
default: fe(() => [
|
|
948
948
|
(i(), Se(Fe, { to: "body" }, [
|
|
949
949
|
m.value ? (i(), u("div", {
|
|
950
950
|
key: 0,
|
|
951
951
|
ref_key: "dropdownEl",
|
|
952
|
-
ref:
|
|
953
|
-
class:
|
|
954
|
-
style:
|
|
955
|
-
onMousedown: r[6] || (r[6] =
|
|
952
|
+
ref: I,
|
|
953
|
+
class: K(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": x.value }]),
|
|
954
|
+
style: ue(F.value),
|
|
955
|
+
onMousedown: r[6] || (r[6] = G(() => {
|
|
956
956
|
}, ["stop"])),
|
|
957
|
-
onClick: r[7] || (r[7] =
|
|
957
|
+
onClick: r[7] || (r[7] = G(() => {
|
|
958
958
|
}, ["stop"]))
|
|
959
959
|
}, [
|
|
960
960
|
o("div", {
|
|
@@ -962,40 +962,40 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
962
962
|
ref_key: "optionsContainer",
|
|
963
963
|
ref: y
|
|
964
964
|
}, [
|
|
965
|
-
(i(!0), u(
|
|
966
|
-
key:
|
|
967
|
-
class:
|
|
968
|
-
"yselect__option--selected":
|
|
969
|
-
"yselect__option--disabled":
|
|
965
|
+
(i(!0), u(re, null, ve(j.value, (f, k) => (i(), u("div", {
|
|
966
|
+
key: le(f, k),
|
|
967
|
+
class: K(["yselect__option", {
|
|
968
|
+
"yselect__option--selected": J(f),
|
|
969
|
+
"yselect__option--disabled": W(f),
|
|
970
970
|
"yselect__option--hover": p.value === k
|
|
971
971
|
}]),
|
|
972
|
-
onClick: (
|
|
973
|
-
onMouseenter: (
|
|
974
|
-
onMouseleave: r[5] || (r[5] = (
|
|
972
|
+
onClick: (M) => ee(f),
|
|
973
|
+
onMouseenter: (M) => p.value = k,
|
|
974
|
+
onMouseleave: r[5] || (r[5] = (M) => p.value = -1)
|
|
975
975
|
}, [
|
|
976
|
-
|
|
976
|
+
ce(a.$slots, "option", {
|
|
977
977
|
option: f,
|
|
978
978
|
index: k,
|
|
979
|
-
selected:
|
|
979
|
+
selected: J(f)
|
|
980
980
|
}, () => [
|
|
981
981
|
f != null && f.flagImg ? (i(), u("img", {
|
|
982
982
|
key: 0,
|
|
983
983
|
class: "yselect__flag",
|
|
984
984
|
src: f.flagImg,
|
|
985
985
|
alt: "flag"
|
|
986
|
-
}, null, 8, qt)) :
|
|
987
|
-
xe(" " +
|
|
986
|
+
}, null, 8, qt)) : H("", !0),
|
|
987
|
+
xe(" " + ne(Q(f)), 1)
|
|
988
988
|
], !0)
|
|
989
989
|
], 42, jt))), 128))
|
|
990
990
|
], 512)
|
|
991
|
-
], 38)) :
|
|
991
|
+
], 38)) : H("", !0)
|
|
992
992
|
]))
|
|
993
993
|
]),
|
|
994
994
|
_: 3
|
|
995
995
|
})
|
|
996
996
|
], 6));
|
|
997
997
|
}
|
|
998
|
-
}),
|
|
998
|
+
}), tt = /* @__PURE__ */ me(Ut, [["__scopeId", "data-v-6cd47cb7"]]), Zt = { class: "ypagination" }, Qt = { class: "page-actions" }, Jt = { class: "page-size-select" }, Xt = /* @__PURE__ */ ge({
|
|
999
999
|
__name: "ypagination",
|
|
1000
1000
|
props: {
|
|
1001
1001
|
currentPage: {},
|
|
@@ -1010,42 +1010,42 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1010
1010
|
},
|
|
1011
1011
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
1012
1012
|
setup(e, { emit: $ }) {
|
|
1013
|
-
const t = e, n = $, m =
|
|
1013
|
+
const t = e, n = $, m = E(t.pageSize), p = O(() => t.pageSizeOptions), y = O({
|
|
1014
1014
|
get: () => t.currentPage,
|
|
1015
|
-
set: (
|
|
1016
|
-
n("update:currentPage",
|
|
1015
|
+
set: (x) => {
|
|
1016
|
+
n("update:currentPage", x), n("page-change", x);
|
|
1017
1017
|
}
|
|
1018
1018
|
});
|
|
1019
|
-
function
|
|
1020
|
-
t.loading ||
|
|
1019
|
+
function L(x) {
|
|
1020
|
+
t.loading || x >= 1 && x !== t.currentPage && (y.value = x);
|
|
1021
1021
|
}
|
|
1022
|
-
function C(
|
|
1023
|
-
t.loading || (m.value =
|
|
1022
|
+
function C(x) {
|
|
1023
|
+
t.loading || (m.value = x, n("update:pageSize", x), n("page-size-change", x), y.value = 1);
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1026
|
-
t.loading || (
|
|
1025
|
+
function I(x) {
|
|
1026
|
+
t.loading || (x === "prev" ? L(y.value - 1) : x === "next" && L(y.value + 1));
|
|
1027
1027
|
}
|
|
1028
|
-
return m.value = t.pageSize,
|
|
1028
|
+
return m.value = t.pageSize, oe(
|
|
1029
1029
|
() => t.pageSize,
|
|
1030
|
-
(
|
|
1031
|
-
typeof
|
|
1030
|
+
(x) => {
|
|
1031
|
+
typeof x == "number" && m.value !== x && (m.value = x);
|
|
1032
1032
|
}
|
|
1033
|
-
), (
|
|
1034
|
-
const
|
|
1033
|
+
), (x, w) => {
|
|
1034
|
+
const g = Ae("YButton"), b = Ae("YSelect");
|
|
1035
1035
|
return i(), u("div", Zt, [
|
|
1036
1036
|
o("div", Qt, [
|
|
1037
|
-
|
|
1037
|
+
de(g, {
|
|
1038
1038
|
size: "small",
|
|
1039
1039
|
variant: "secondary",
|
|
1040
1040
|
disabled: y.value === 1 || e.loading,
|
|
1041
|
-
onClick:
|
|
1041
|
+
onClick: w[0] || (w[0] = (V) => L(1))
|
|
1042
1042
|
}, {
|
|
1043
|
-
default:
|
|
1043
|
+
default: fe(() => [...w[2] || (w[2] = [
|
|
1044
1044
|
xe("首页", -1)
|
|
1045
1045
|
])]),
|
|
1046
1046
|
_: 1
|
|
1047
1047
|
}, 8, ["disabled"]),
|
|
1048
|
-
|
|
1048
|
+
de(g, {
|
|
1049
1049
|
class: "ml-1",
|
|
1050
1050
|
variant: "secondary",
|
|
1051
1051
|
size: "small",
|
|
@@ -1053,12 +1053,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1053
1053
|
{ label: "上一页", value: "prev", disabled: y.value === 1 || e.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1054
1054
|
{ label: "下一页", value: "next", disabled: e.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1055
1055
|
],
|
|
1056
|
-
onGroupClick:
|
|
1056
|
+
onGroupClick: I
|
|
1057
1057
|
}, null, 8, ["groupItems"]),
|
|
1058
1058
|
o("div", Jt, [
|
|
1059
|
-
|
|
1059
|
+
de(b, {
|
|
1060
1060
|
modelValue: m.value,
|
|
1061
|
-
"onUpdate:modelValue":
|
|
1061
|
+
"onUpdate:modelValue": w[1] || (w[1] = (V) => m.value = V),
|
|
1062
1062
|
options: p.value,
|
|
1063
1063
|
size: "small",
|
|
1064
1064
|
width: "105px",
|
|
@@ -1129,15 +1129,15 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1129
1129
|
const $ = e, t = O(() => $.tone || "default"), n = O(() => {
|
|
1130
1130
|
const m = ($.label || "").trim(), p = $.tone, y = $.progress;
|
|
1131
1131
|
if (y) {
|
|
1132
|
-
const
|
|
1132
|
+
const L = {
|
|
1133
1133
|
incomplete: "未完成",
|
|
1134
1134
|
partiallyComplete: "部分完成",
|
|
1135
1135
|
complete: "已完成"
|
|
1136
1136
|
};
|
|
1137
|
-
return m ? `${m},进度:${
|
|
1137
|
+
return m ? `${m},进度:${L[y] || y}` : `进度:${L[y] || y}`;
|
|
1138
1138
|
}
|
|
1139
1139
|
if (p && p !== "default") {
|
|
1140
|
-
const
|
|
1140
|
+
const L = {
|
|
1141
1141
|
informational: "信息",
|
|
1142
1142
|
success: "成功",
|
|
1143
1143
|
attention: "注意",
|
|
@@ -1145,12 +1145,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1145
1145
|
critical: "严重",
|
|
1146
1146
|
default: "默认"
|
|
1147
1147
|
};
|
|
1148
|
-
return m ? `${m},语气:${
|
|
1148
|
+
return m ? `${m},语气:${L[p] || p}` : `语气:${L[p] || p}`;
|
|
1149
1149
|
}
|
|
1150
1150
|
return m || "标记";
|
|
1151
1151
|
});
|
|
1152
1152
|
return (m, p) => (i(), u("span", {
|
|
1153
|
-
class:
|
|
1153
|
+
class: K(["y-badge", [
|
|
1154
1154
|
`y-badge--${t.value}`,
|
|
1155
1155
|
`y-badge--${e.size}`,
|
|
1156
1156
|
{ "is-outline": e.outline, "is-pill": e.pill },
|
|
@@ -1183,7 +1183,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1183
1183
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1184
1184
|
"clip-rule": "evenodd"
|
|
1185
1185
|
}, null, -1)
|
|
1186
|
-
])])) :
|
|
1186
|
+
])])) : H("", !0)
|
|
1187
1187
|
])) : e.icon ? (i(), u("span", sn, [
|
|
1188
1188
|
e.icon === "dot" ? (i(), u("svg", rn, [...p[3] || (p[3] = [
|
|
1189
1189
|
o("circle", {
|
|
@@ -1210,10 +1210,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1210
1210
|
r: "4"
|
|
1211
1211
|
}, null, -1)
|
|
1212
1212
|
])]))
|
|
1213
|
-
])) :
|
|
1213
|
+
])) : H("", !0),
|
|
1214
1214
|
o("span", fn, [
|
|
1215
|
-
|
|
1216
|
-
xe(
|
|
1215
|
+
ce(m.$slots, "default", {}, () => [
|
|
1216
|
+
xe(ne(e.label), 1)
|
|
1217
1217
|
], !0)
|
|
1218
1218
|
])
|
|
1219
1219
|
])
|
|
@@ -1242,57 +1242,57 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1242
1242
|
setup(e, { emit: $ }) {
|
|
1243
1243
|
const t = e, n = $, m = O({
|
|
1244
1244
|
get: () => t.modelValue,
|
|
1245
|
-
set: (
|
|
1246
|
-
}), p =
|
|
1247
|
-
const
|
|
1248
|
-
return
|
|
1245
|
+
set: (w) => n("update:modelValue", w)
|
|
1246
|
+
}), p = E(null), y = O(() => {
|
|
1247
|
+
const w = {};
|
|
1248
|
+
return w.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), w.margin = "0 auto", w.top = t.top, w;
|
|
1249
1249
|
});
|
|
1250
|
-
function
|
|
1250
|
+
function L() {
|
|
1251
1251
|
t.maskClosable && C();
|
|
1252
1252
|
}
|
|
1253
1253
|
function C() {
|
|
1254
1254
|
m.value && (m.value = !1, n("close"));
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function I() {
|
|
1257
1257
|
t.closable && C();
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1260
|
-
|
|
1259
|
+
function x(w) {
|
|
1260
|
+
w.key === "Escape" && I();
|
|
1261
1261
|
}
|
|
1262
|
-
return
|
|
1263
|
-
|
|
1264
|
-
var
|
|
1265
|
-
return (
|
|
1266
|
-
}), document.addEventListener("keydown",
|
|
1262
|
+
return oe(() => t.modelValue, (w) => {
|
|
1263
|
+
w ? (n("open"), requestAnimationFrame(() => {
|
|
1264
|
+
var g;
|
|
1265
|
+
return (g = p.value) == null ? void 0 : g.focus();
|
|
1266
|
+
}), document.addEventListener("keydown", x), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", x), document.body.style.overflow = "");
|
|
1267
1267
|
}), $e(() => {
|
|
1268
|
-
t.modelValue && (document.addEventListener("keydown",
|
|
1268
|
+
t.modelValue && (document.addEventListener("keydown", x), document.body.style.overflow = "hidden");
|
|
1269
1269
|
}), Be(() => {
|
|
1270
|
-
document.removeEventListener("keydown",
|
|
1271
|
-
}), (
|
|
1270
|
+
document.removeEventListener("keydown", x), document.body.style.overflow = "";
|
|
1271
|
+
}), (w, g) => (i(), Se(Fe, { to: "body" }, [
|
|
1272
1272
|
Ee(o("div", {
|
|
1273
1273
|
class: "y-dialog-root",
|
|
1274
1274
|
role: "dialog",
|
|
1275
1275
|
"aria-modal": !0,
|
|
1276
1276
|
"aria-hidden": !m.value,
|
|
1277
|
-
style:
|
|
1277
|
+
style: ue({ zIndex: String(e.zIndex) })
|
|
1278
1278
|
}, [
|
|
1279
1279
|
o("div", {
|
|
1280
1280
|
class: "y-dialog-mask",
|
|
1281
|
-
onClick:
|
|
1281
|
+
onClick: L
|
|
1282
1282
|
}),
|
|
1283
|
-
|
|
1284
|
-
default:
|
|
1283
|
+
de(be, { name: "dialog-zoom-fade" }, {
|
|
1284
|
+
default: fe(() => [
|
|
1285
1285
|
Ee(o("div", {
|
|
1286
1286
|
ref_key: "panelRef",
|
|
1287
1287
|
ref: p,
|
|
1288
|
-
class:
|
|
1289
|
-
style:
|
|
1290
|
-
onKeydown: ke(
|
|
1288
|
+
class: K(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1289
|
+
style: ue(y.value),
|
|
1290
|
+
onKeydown: ke(G(I, ["prevent", "stop"]), ["esc"]),
|
|
1291
1291
|
tabindex: "-1"
|
|
1292
1292
|
}, [
|
|
1293
1293
|
e.showHeader ? (i(), u("div", gn, [
|
|
1294
|
-
|
|
1295
|
-
o("div", mn,
|
|
1294
|
+
ce(w.$slots, "header", {}, () => [
|
|
1295
|
+
o("div", mn, ne(e.title), 1)
|
|
1296
1296
|
], !0),
|
|
1297
1297
|
e.closable ? (i(), u("button", {
|
|
1298
1298
|
key: 0,
|
|
@@ -1300,14 +1300,14 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1300
1300
|
class: "y-dialog-close",
|
|
1301
1301
|
"aria-label": "Close",
|
|
1302
1302
|
onClick: C
|
|
1303
|
-
}, " ✕ ")) :
|
|
1304
|
-
])) :
|
|
1303
|
+
}, " ✕ ")) : H("", !0)
|
|
1304
|
+
])) : H("", !0),
|
|
1305
1305
|
o("div", wn, [
|
|
1306
|
-
|
|
1306
|
+
ce(w.$slots, "default", {}, void 0, !0)
|
|
1307
1307
|
]),
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
])) :
|
|
1308
|
+
w.$slots.footer ? (i(), u("div", kn, [
|
|
1309
|
+
ce(w.$slots, "footer", {}, void 0, !0)
|
|
1310
|
+
])) : H("", !0)
|
|
1311
1311
|
], 46, yn), [
|
|
1312
1312
|
[ze, m.value]
|
|
1313
1313
|
])
|
|
@@ -1339,25 +1339,25 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1339
1339
|
},
|
|
1340
1340
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1341
1341
|
setup(e, { expose: $, emit: t }) {
|
|
1342
|
-
const n = e, m = t, p =
|
|
1343
|
-
let
|
|
1342
|
+
const n = e, m = t, p = E(), y = E(), L = E(), C = E(!1), I = E(), x = E(), w = E({});
|
|
1343
|
+
let g = null, b = null;
|
|
1344
1344
|
const V = O(() => {
|
|
1345
|
-
if (!C.value || !
|
|
1345
|
+
if (!C.value || !I.value) return {};
|
|
1346
1346
|
const N = {};
|
|
1347
1347
|
n.width !== "auto" && (N.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (N.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1348
|
-
const { top:
|
|
1349
|
-
return N.top = `${
|
|
1348
|
+
const { top: Z, left: c } = F();
|
|
1349
|
+
return N.top = `${Z}px`, N.left = `${c}px`, N;
|
|
1350
1350
|
}), j = O(() => {
|
|
1351
1351
|
if (!n.showArrow) return {};
|
|
1352
|
-
if (Object.keys(
|
|
1353
|
-
return
|
|
1352
|
+
if (Object.keys(w.value).length > 0)
|
|
1353
|
+
return w.value;
|
|
1354
1354
|
const N = {};
|
|
1355
1355
|
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? N.left = "50%" : N.top = "50%", N;
|
|
1356
1356
|
});
|
|
1357
1357
|
function F() {
|
|
1358
|
-
var P,
|
|
1359
|
-
if (!
|
|
1360
|
-
const { width: N, height:
|
|
1358
|
+
var P, te;
|
|
1359
|
+
if (!I.value) return { top: 0, left: 0 };
|
|
1360
|
+
const { width: N, height: Z, top: c, left: h } = I.value, a = ((P = L.value) == null ? void 0 : P.offsetWidth) || 200, r = ((te = L.value) == null ? void 0 : te.offsetHeight) || 100;
|
|
1361
1361
|
let f = 0, k = 0;
|
|
1362
1362
|
switch (n.placement) {
|
|
1363
1363
|
case "top":
|
|
@@ -1370,134 +1370,134 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1370
1370
|
f = c - r - n.offset, k = h + N - a;
|
|
1371
1371
|
break;
|
|
1372
1372
|
case "bottom":
|
|
1373
|
-
f = c +
|
|
1373
|
+
f = c + Z + n.offset, k = h + (N - a) / 2;
|
|
1374
1374
|
break;
|
|
1375
1375
|
case "bottom-start":
|
|
1376
|
-
f = c +
|
|
1376
|
+
f = c + Z + n.offset, k = h;
|
|
1377
1377
|
break;
|
|
1378
1378
|
case "bottom-end":
|
|
1379
|
-
f = c +
|
|
1379
|
+
f = c + Z + n.offset, k = h + N - a;
|
|
1380
1380
|
break;
|
|
1381
1381
|
case "left":
|
|
1382
|
-
f = c + (
|
|
1382
|
+
f = c + (Z - r) / 2, k = h - a - n.offset;
|
|
1383
1383
|
break;
|
|
1384
1384
|
case "left-start":
|
|
1385
1385
|
f = c, k = h - a - n.offset;
|
|
1386
1386
|
break;
|
|
1387
1387
|
case "left-end":
|
|
1388
|
-
f = c +
|
|
1388
|
+
f = c + Z - r, k = h - a - n.offset;
|
|
1389
1389
|
break;
|
|
1390
1390
|
case "right":
|
|
1391
|
-
f = c + (
|
|
1391
|
+
f = c + (Z - r) / 2, k = h + N + n.offset;
|
|
1392
1392
|
break;
|
|
1393
1393
|
case "right-start":
|
|
1394
1394
|
f = c, k = h + N + n.offset;
|
|
1395
1395
|
break;
|
|
1396
1396
|
case "right-end":
|
|
1397
|
-
f = c +
|
|
1397
|
+
f = c + Z - r, k = h + N + n.offset;
|
|
1398
1398
|
break;
|
|
1399
1399
|
}
|
|
1400
|
-
const
|
|
1401
|
-
return k < 8 && (k = 8), k + a >
|
|
1400
|
+
const M = window.innerWidth, B = window.innerHeight;
|
|
1401
|
+
return k < 8 && (k = 8), k + a > M - 8 && (k = M - a - 8), f < 8 && (f = 8), f + r > B - 8 && (f = B - r - 8), { top: f, left: k };
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1404
|
-
n.disabled || C.value || (
|
|
1405
|
-
|
|
1406
|
-
}, n.openDelay) :
|
|
1407
|
-
}
|
|
1408
|
-
function
|
|
1409
|
-
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"),
|
|
1410
|
-
|
|
1411
|
-
|
|
1403
|
+
function A() {
|
|
1404
|
+
n.disabled || C.value || (J(), n.openDelay > 0 ? g = setTimeout(() => {
|
|
1405
|
+
q();
|
|
1406
|
+
}, n.openDelay) : q());
|
|
1407
|
+
}
|
|
1408
|
+
function q() {
|
|
1409
|
+
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"), se(() => {
|
|
1410
|
+
se(() => {
|
|
1411
|
+
z();
|
|
1412
1412
|
});
|
|
1413
1413
|
});
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1416
|
-
C.value && (
|
|
1417
|
-
|
|
1418
|
-
}, n.closeDelay) :
|
|
1415
|
+
function Q() {
|
|
1416
|
+
C.value && (J(), n.closeDelay > 0 ? b = setTimeout(() => {
|
|
1417
|
+
le();
|
|
1418
|
+
}, n.closeDelay) : le());
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function le() {
|
|
1421
1421
|
m("before-hide"), C.value = !1, m("update:modelValue", !1), m("hide");
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1424
|
-
|
|
1423
|
+
function J() {
|
|
1424
|
+
g && (clearTimeout(g), g = null), b && (clearTimeout(b), b = null);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1427
|
-
if (!n.showArrow || !
|
|
1428
|
-
|
|
1426
|
+
function W() {
|
|
1427
|
+
if (!n.showArrow || !I.value || !L.value) {
|
|
1428
|
+
w.value = {};
|
|
1429
1429
|
return;
|
|
1430
1430
|
}
|
|
1431
|
-
const N =
|
|
1432
|
-
if (
|
|
1431
|
+
const N = I.value, Z = L.value.getBoundingClientRect();
|
|
1432
|
+
if (Z.width === 0 || Z.height === 0) {
|
|
1433
1433
|
const h = {};
|
|
1434
|
-
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%",
|
|
1434
|
+
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%", w.value = h;
|
|
1435
1435
|
return;
|
|
1436
1436
|
}
|
|
1437
1437
|
const c = {};
|
|
1438
1438
|
if (n.placement.startsWith("top")) {
|
|
1439
1439
|
c.bottom = "-6px";
|
|
1440
|
-
const h = N.left + N.width / 2, a =
|
|
1441
|
-
c.left = `${Math.max(12, Math.min(r,
|
|
1440
|
+
const h = N.left + N.width / 2, a = Z.left, r = h - a;
|
|
1441
|
+
c.left = `${Math.max(12, Math.min(r, Z.width - 12))}px`;
|
|
1442
1442
|
} else if (n.placement.startsWith("bottom")) {
|
|
1443
1443
|
c.top = "-6px";
|
|
1444
|
-
const h = N.left + N.width / 2, a =
|
|
1445
|
-
c.left = `${Math.max(12, Math.min(r,
|
|
1444
|
+
const h = N.left + N.width / 2, a = Z.left, r = h - a;
|
|
1445
|
+
c.left = `${Math.max(12, Math.min(r, Z.width - 12))}px`;
|
|
1446
1446
|
} else if (n.placement.startsWith("left")) {
|
|
1447
1447
|
c.right = "-6px";
|
|
1448
|
-
const h = N.top + N.height / 2, a =
|
|
1449
|
-
c.top = `${Math.max(12, Math.min(r,
|
|
1448
|
+
const h = N.top + N.height / 2, a = Z.top, r = h - a;
|
|
1449
|
+
c.top = `${Math.max(12, Math.min(r, Z.height - 12))}px`;
|
|
1450
1450
|
} else if (n.placement.startsWith("right")) {
|
|
1451
1451
|
c.left = "-6px";
|
|
1452
|
-
const h = N.top + N.height / 2, a =
|
|
1453
|
-
c.top = `${Math.max(12, Math.min(r,
|
|
1452
|
+
const h = N.top + N.height / 2, a = Z.top, r = h - a;
|
|
1453
|
+
c.top = `${Math.max(12, Math.min(r, Z.height - 12))}px`;
|
|
1454
1454
|
}
|
|
1455
|
-
|
|
1455
|
+
w.value = c;
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1458
|
-
y.value && (
|
|
1459
|
-
|
|
1457
|
+
function z() {
|
|
1458
|
+
y.value && (I.value = y.value.getBoundingClientRect(), L.value && (x.value = L.value.getBoundingClientRect(), W(), C.value && requestAnimationFrame(() => {
|
|
1459
|
+
L.value && (x.value = L.value.getBoundingClientRect(), W());
|
|
1460
1460
|
})));
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1463
|
-
n.disabled || n.trigger === "click" && (C.value ?
|
|
1462
|
+
function R() {
|
|
1463
|
+
n.disabled || n.trigger === "click" && (C.value ? Q() : A());
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1466
|
-
n.disabled || n.trigger !== "hover" || (
|
|
1465
|
+
function Y() {
|
|
1466
|
+
n.disabled || n.trigger !== "hover" || (J(), A());
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1469
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1468
|
+
function ee() {
|
|
1469
|
+
n.disabled || n.trigger !== "hover" || Q();
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1472
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1471
|
+
function X() {
|
|
1472
|
+
n.disabled || n.trigger !== "hover" || J();
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1475
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1474
|
+
function ae() {
|
|
1475
|
+
n.disabled || n.trigger !== "hover" || Q();
|
|
1476
1476
|
}
|
|
1477
1477
|
function we(N) {
|
|
1478
1478
|
if (!n.closeOnClickOutside || !C.value) return;
|
|
1479
|
-
const
|
|
1480
|
-
p.value && !p.value.contains(
|
|
1481
|
-
}
|
|
1482
|
-
return
|
|
1483
|
-
N !== C.value && (N ?
|
|
1484
|
-
}),
|
|
1485
|
-
N ? (document.addEventListener("click", we), window.addEventListener("resize",
|
|
1486
|
-
|
|
1487
|
-
|
|
1479
|
+
const Z = N.target;
|
|
1480
|
+
p.value && !p.value.contains(Z) && L.value && !L.value.contains(Z) && Q();
|
|
1481
|
+
}
|
|
1482
|
+
return oe(() => n.modelValue, (N) => {
|
|
1483
|
+
N !== C.value && (N ? A() : Q());
|
|
1484
|
+
}), oe(C, (N) => {
|
|
1485
|
+
N ? (document.addEventListener("click", we), window.addEventListener("resize", z), window.addEventListener("scroll", z, !0), se(() => {
|
|
1486
|
+
z(), requestAnimationFrame(() => {
|
|
1487
|
+
z();
|
|
1488
1488
|
}), setTimeout(() => {
|
|
1489
|
-
|
|
1489
|
+
z();
|
|
1490
1490
|
}, 0);
|
|
1491
|
-
})) : (document.removeEventListener("click", we), window.removeEventListener("resize",
|
|
1491
|
+
})) : (document.removeEventListener("click", we), window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0));
|
|
1492
1492
|
}), $e(() => {
|
|
1493
|
-
n.modelValue &&
|
|
1493
|
+
n.modelValue && A();
|
|
1494
1494
|
}), Be(() => {
|
|
1495
|
-
|
|
1495
|
+
J(), document.removeEventListener("click", we), window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0);
|
|
1496
1496
|
}), $({
|
|
1497
|
-
show:
|
|
1498
|
-
hide:
|
|
1499
|
-
updatePosition:
|
|
1500
|
-
}), (N,
|
|
1497
|
+
show: A,
|
|
1498
|
+
hide: Q,
|
|
1499
|
+
updatePosition: z
|
|
1500
|
+
}), (N, Z) => (i(), u("div", {
|
|
1501
1501
|
class: "ypopover",
|
|
1502
1502
|
ref_key: "popoverRef",
|
|
1503
1503
|
ref: p
|
|
@@ -1505,41 +1505,41 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1505
1505
|
o("div", {
|
|
1506
1506
|
ref_key: "triggerRef",
|
|
1507
1507
|
ref: y,
|
|
1508
|
-
onClick:
|
|
1509
|
-
onMouseenter:
|
|
1510
|
-
onMouseleave:
|
|
1508
|
+
onClick: R,
|
|
1509
|
+
onMouseenter: Y,
|
|
1510
|
+
onMouseleave: ee
|
|
1511
1511
|
}, [
|
|
1512
|
-
|
|
1512
|
+
ce(N.$slots, "reference", {}, void 0, !0)
|
|
1513
1513
|
], 544),
|
|
1514
1514
|
(i(), Se(Fe, { to: "body" }, [
|
|
1515
|
-
|
|
1516
|
-
default:
|
|
1515
|
+
de(be, { name: "ypopover-fade" }, {
|
|
1516
|
+
default: fe(() => [
|
|
1517
1517
|
C.value ? (i(), u("div", {
|
|
1518
1518
|
key: 0,
|
|
1519
1519
|
ref_key: "contentRef",
|
|
1520
|
-
ref:
|
|
1521
|
-
class:
|
|
1520
|
+
ref: L,
|
|
1521
|
+
class: K(["ypopover__content", [
|
|
1522
1522
|
`ypopover__content--${e.placement}`,
|
|
1523
1523
|
{
|
|
1524
1524
|
"ypopover__content--dark": e.dark,
|
|
1525
1525
|
"ypopover__content--no-padding": !e.showPadding
|
|
1526
1526
|
}
|
|
1527
1527
|
]]),
|
|
1528
|
-
style:
|
|
1529
|
-
onClick:
|
|
1528
|
+
style: ue(V.value),
|
|
1529
|
+
onClick: Z[0] || (Z[0] = G(() => {
|
|
1530
1530
|
}, ["stop"])),
|
|
1531
|
-
onMouseenter:
|
|
1532
|
-
onMouseleave:
|
|
1531
|
+
onMouseenter: X,
|
|
1532
|
+
onMouseleave: ae
|
|
1533
1533
|
}, [
|
|
1534
1534
|
e.showArrow ? (i(), u("div", {
|
|
1535
1535
|
key: 0,
|
|
1536
|
-
class:
|
|
1537
|
-
style:
|
|
1538
|
-
}, null, 6)) :
|
|
1536
|
+
class: K(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1537
|
+
style: ue(j.value)
|
|
1538
|
+
}, null, 6)) : H("", !0),
|
|
1539
1539
|
o("div", $n, [
|
|
1540
|
-
|
|
1540
|
+
ce(N.$slots, "default", {}, void 0, !0)
|
|
1541
1541
|
])
|
|
1542
|
-
], 38)) :
|
|
1542
|
+
], 38)) : H("", !0)
|
|
1543
1543
|
]),
|
|
1544
1544
|
_: 3
|
|
1545
1545
|
})
|
|
@@ -1606,28 +1606,28 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1606
1606
|
},
|
|
1607
1607
|
emits: ["update:modelValue", "change"],
|
|
1608
1608
|
setup(e, { emit: $ }) {
|
|
1609
|
-
const t = e, n = $, m =
|
|
1609
|
+
const t = e, n = $, m = E(!1), p = E(-1), y = E(-1), L = E(null), C = E(), I = E(), x = E({
|
|
1610
1610
|
top: !0,
|
|
1611
1611
|
left: !0
|
|
1612
|
-
}),
|
|
1612
|
+
}), w = E({
|
|
1613
1613
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1614
1614
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1615
|
-
}),
|
|
1615
|
+
}), g = E({
|
|
1616
1616
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1617
1617
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1618
|
-
}),
|
|
1619
|
-
const s = new Date(
|
|
1618
|
+
}), b = () => {
|
|
1619
|
+
const s = new Date(w.value.year, w.value.month).getTime(), v = new Date(g.value.year, g.value.month).getTime();
|
|
1620
1620
|
if (s >= v) {
|
|
1621
|
-
const l = new Date(
|
|
1622
|
-
|
|
1621
|
+
const l = new Date(w.value.year, w.value.month + 1);
|
|
1622
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1623
1623
|
}
|
|
1624
1624
|
}, V = () => {
|
|
1625
|
-
const s = new Date(
|
|
1626
|
-
if (new Date(
|
|
1627
|
-
const l = new Date(
|
|
1628
|
-
|
|
1625
|
+
const s = new Date(w.value.year, w.value.month).getTime();
|
|
1626
|
+
if (new Date(g.value.year, g.value.month).getTime() <= s) {
|
|
1627
|
+
const l = new Date(g.value.year, g.value.month - 1);
|
|
1628
|
+
w.value.year = l.getFullYear(), w.value.month = l.getMonth();
|
|
1629
1629
|
}
|
|
1630
|
-
}, j = ["一", "二", "三", "四", "五", "六", "日"], F =
|
|
1630
|
+
}, j = ["一", "二", "三", "四", "五", "六", "日"], F = E(null), A = E(null), q = (s) => {
|
|
1631
1631
|
if (!s) return null;
|
|
1632
1632
|
if (s instanceof Date) return s;
|
|
1633
1633
|
if (typeof s == "number")
|
|
@@ -1637,7 +1637,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1637
1637
|
return isNaN(v.getTime()) ? null : v;
|
|
1638
1638
|
}
|
|
1639
1639
|
return null;
|
|
1640
|
-
},
|
|
1640
|
+
}, Q = (s) => {
|
|
1641
1641
|
if (!s) return null;
|
|
1642
1642
|
const v = s.getFullYear(), l = String(s.getMonth() + 1).padStart(2, "0"), d = String(s.getDate()).padStart(2, "0");
|
|
1643
1643
|
if (t.includeTime) {
|
|
@@ -1645,17 +1645,17 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1645
1645
|
return `${v}-${l}-${d} ${D}:${S}:${_}`;
|
|
1646
1646
|
} else
|
|
1647
1647
|
return `${v}-${l}-${d}`;
|
|
1648
|
-
},
|
|
1649
|
-
startDate:
|
|
1650
|
-
endDate:
|
|
1651
|
-
} : { startDate: null, endDate: null },
|
|
1652
|
-
startDate:
|
|
1653
|
-
endDate:
|
|
1648
|
+
}, le = (s) => s ? s.getTime() : null, J = (s) => s ? {
|
|
1649
|
+
startDate: q(s.startDate),
|
|
1650
|
+
endDate: q(s.endDate)
|
|
1651
|
+
} : { startDate: null, endDate: null }, W = (s) => t.format === "string" ? {
|
|
1652
|
+
startDate: Q(s.startDate),
|
|
1653
|
+
endDate: Q(s.endDate)
|
|
1654
1654
|
} : t.format === "timestamp" ? {
|
|
1655
|
-
startDate:
|
|
1656
|
-
endDate:
|
|
1657
|
-
} : s,
|
|
1658
|
-
const v =
|
|
1655
|
+
startDate: le(s.startDate),
|
|
1656
|
+
endDate: le(s.endDate)
|
|
1657
|
+
} : s, z = (s, v) => `${String(v + 1).padStart(2, "0")}/${s}`, R = (s, v) => s.getFullYear() === v.getFullYear() && s.getMonth() === v.getMonth() && s.getDate() === v.getDate(), Y = (s, v, l) => !v || !l ? !1 : s >= v && s <= l, ee = (s) => {
|
|
1658
|
+
const v = J(s);
|
|
1659
1659
|
if (!(v != null && v.startDate) || !(v != null && v.endDate))
|
|
1660
1660
|
return -1;
|
|
1661
1661
|
for (let l = 0; l < t.shortcuts.length; l++) {
|
|
@@ -1673,51 +1673,51 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1673
1673
|
d.startDate.getFullYear(),
|
|
1674
1674
|
d.startDate.getMonth(),
|
|
1675
1675
|
d.startDate.getDate()
|
|
1676
|
-
),
|
|
1676
|
+
), T = new Date(
|
|
1677
1677
|
d.endDate.getFullYear(),
|
|
1678
1678
|
d.endDate.getMonth(),
|
|
1679
1679
|
d.endDate.getDate()
|
|
1680
1680
|
);
|
|
1681
|
-
if (D.getTime() === _.getTime() && S.getTime() ===
|
|
1681
|
+
if (D.getTime() === _.getTime() && S.getTime() === T.getTime())
|
|
1682
1682
|
return l;
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
1685
|
return -1;
|
|
1686
|
-
},
|
|
1687
|
-
const l = new Date(s, v, 1), d = new Date(s, v + 1, 0), D = l.getDay(), S = d.getDate(), _ = [],
|
|
1688
|
-
for (let
|
|
1689
|
-
const De = new Date(s, v - 1, he.getDate() -
|
|
1686
|
+
}, X = (s, v) => {
|
|
1687
|
+
const l = new Date(s, v, 1), d = new Date(s, v + 1, 0), D = l.getDay(), S = d.getDate(), _ = [], T = /* @__PURE__ */ new Date(), U = D === 0 ? 6 : D - 1, he = new Date(s, v, 0);
|
|
1688
|
+
for (let ie = U - 1; ie >= 0; ie--) {
|
|
1689
|
+
const De = new Date(s, v - 1, he.getDate() - ie);
|
|
1690
1690
|
_.push({
|
|
1691
1691
|
date: De,
|
|
1692
1692
|
day: De.getDate(),
|
|
1693
1693
|
isCurrentMonth: !1,
|
|
1694
|
-
isToday:
|
|
1694
|
+
isToday: R(De, T),
|
|
1695
1695
|
isSelected: !1,
|
|
1696
1696
|
isInRange: !1,
|
|
1697
1697
|
isDisabled: !0
|
|
1698
1698
|
// 禁用非当前月的日期
|
|
1699
1699
|
});
|
|
1700
1700
|
}
|
|
1701
|
-
for (let
|
|
1702
|
-
const De = new Date(s, v,
|
|
1701
|
+
for (let ie = 1; ie <= S; ie++) {
|
|
1702
|
+
const De = new Date(s, v, ie);
|
|
1703
1703
|
_.push({
|
|
1704
1704
|
date: De,
|
|
1705
|
-
day:
|
|
1705
|
+
day: ie,
|
|
1706
1706
|
isCurrentMonth: !0,
|
|
1707
|
-
isToday:
|
|
1707
|
+
isToday: R(De, T),
|
|
1708
1708
|
isSelected: !1,
|
|
1709
1709
|
isInRange: !1,
|
|
1710
1710
|
isDisabled: !1
|
|
1711
1711
|
});
|
|
1712
1712
|
}
|
|
1713
1713
|
const pe = 42 - _.length;
|
|
1714
|
-
for (let
|
|
1715
|
-
const De = new Date(s, v + 1,
|
|
1714
|
+
for (let ie = 1; ie <= pe; ie++) {
|
|
1715
|
+
const De = new Date(s, v + 1, ie);
|
|
1716
1716
|
_.push({
|
|
1717
1717
|
date: De,
|
|
1718
|
-
day:
|
|
1718
|
+
day: ie,
|
|
1719
1719
|
isCurrentMonth: !1,
|
|
1720
|
-
isToday:
|
|
1720
|
+
isToday: R(De, T),
|
|
1721
1721
|
isSelected: !1,
|
|
1722
1722
|
isInRange: !1,
|
|
1723
1723
|
isDisabled: !0
|
|
@@ -1725,160 +1725,160 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1725
1725
|
});
|
|
1726
1726
|
}
|
|
1727
1727
|
const Ke = [];
|
|
1728
|
-
for (let
|
|
1729
|
-
Ke.push(_.slice(
|
|
1728
|
+
for (let ie = 0; ie < _.length; ie += 7)
|
|
1729
|
+
Ke.push(_.slice(ie, ie + 7));
|
|
1730
1730
|
return Ke;
|
|
1731
|
-
},
|
|
1732
|
-
const v =
|
|
1731
|
+
}, ae = (s) => {
|
|
1732
|
+
const v = W(s);
|
|
1733
1733
|
n("update:modelValue", v), n("change", v);
|
|
1734
1734
|
}, we = () => {
|
|
1735
|
-
if (!C.value || !
|
|
1736
|
-
const s = C.value.getBoundingClientRect(), v =
|
|
1737
|
-
D < _ && S > _ ?
|
|
1738
|
-
const
|
|
1739
|
-
|
|
1735
|
+
if (!C.value || !I.value) return;
|
|
1736
|
+
const s = C.value.getBoundingClientRect(), v = I.value.getBoundingClientRect(), l = window.innerWidth, D = window.innerHeight - s.bottom, S = s.top, _ = v.height || 400;
|
|
1737
|
+
D < _ && S > _ ? x.value.top = !1 : x.value.top = !0;
|
|
1738
|
+
const T = l - s.left, U = v.width || 640;
|
|
1739
|
+
T < U ? x.value.left = !1 : x.value.left = !0;
|
|
1740
1740
|
}, N = () => {
|
|
1741
1741
|
if (m.value = !m.value, m.value) {
|
|
1742
|
-
const s =
|
|
1743
|
-
if (F.value = (s == null ? void 0 : s.startDate) || null,
|
|
1744
|
-
|
|
1742
|
+
const s = J(t.modelValue);
|
|
1743
|
+
if (F.value = (s == null ? void 0 : s.startDate) || null, A.value = (s == null ? void 0 : s.endDate) || null, y.value = ee(t.modelValue), p.value = -1, s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1744
|
+
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1745
1745
|
else {
|
|
1746
|
-
const v = new Date(
|
|
1747
|
-
|
|
1746
|
+
const v = new Date(w.value.year, w.value.month + 1);
|
|
1747
|
+
g.value.year = v.getFullYear(), g.value.month = v.getMonth();
|
|
1748
1748
|
}
|
|
1749
|
-
|
|
1749
|
+
b(), se(() => {
|
|
1750
1750
|
we();
|
|
1751
1751
|
});
|
|
1752
1752
|
}
|
|
1753
|
-
},
|
|
1754
|
-
const v = s.target, l = C.value, d =
|
|
1753
|
+
}, Z = (s) => {
|
|
1754
|
+
const v = s.target, l = C.value, d = I.value;
|
|
1755
1755
|
l && d && !l.contains(v) && !d.contains(v) && (m.value = !1, p.value = -1);
|
|
1756
1756
|
}, c = (s) => {
|
|
1757
|
-
s.key === "Enter" || s.key === " " ? (s.preventDefault(), N()) : s.key === "ArrowDown" && (s.preventDefault(), m.value = !0,
|
|
1757
|
+
s.key === "Enter" || s.key === " " ? (s.preventDefault(), N()) : s.key === "ArrowDown" && (s.preventDefault(), m.value = !0, se(() => {
|
|
1758
1758
|
we(), k();
|
|
1759
1759
|
}));
|
|
1760
1760
|
}, h = (s) => {
|
|
1761
1761
|
var v;
|
|
1762
1762
|
s.key === "Escape" && (m.value = !1, p.value = -1, (v = C.value) == null || v.focus());
|
|
1763
1763
|
}, a = (s, v) => {
|
|
1764
|
-
s.key === "ArrowDown" ? (s.preventDefault(), p.value = Math.min(v + 1, t.shortcuts.length - 1),
|
|
1764
|
+
s.key === "ArrowDown" ? (s.preventDefault(), p.value = Math.min(v + 1, t.shortcuts.length - 1), M(p.value)) : s.key === "ArrowUp" ? (s.preventDefault(), p.value = Math.max(v - 1, 0), M(p.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), B(t.shortcuts[v]));
|
|
1765
1765
|
}, r = (s) => {
|
|
1766
1766
|
p.value = s;
|
|
1767
1767
|
}, f = () => {
|
|
1768
1768
|
p.value = -1;
|
|
1769
1769
|
}, k = () => {
|
|
1770
|
-
p.value = 0,
|
|
1771
|
-
},
|
|
1772
|
-
if (
|
|
1773
|
-
const l =
|
|
1770
|
+
p.value = 0, M(0);
|
|
1771
|
+
}, M = (s) => {
|
|
1772
|
+
if (I.value) {
|
|
1773
|
+
const l = I.value.querySelectorAll(".nh-time-shortcut")[s];
|
|
1774
1774
|
l && l.focus();
|
|
1775
1775
|
}
|
|
1776
|
-
},
|
|
1776
|
+
}, B = (s) => {
|
|
1777
1777
|
const v = s.getValue();
|
|
1778
|
-
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)),
|
|
1778
|
+
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)), ae(v), y.value = t.shortcuts.findIndex((l) => l.label === s.label), p.value = -1, m.value = !1;
|
|
1779
1779
|
}, P = (s, v) => {
|
|
1780
1780
|
if (!s || s.isDisabled) return;
|
|
1781
1781
|
let l;
|
|
1782
|
-
if (t.includeTime ? (l = new Date(s.date), v === "start" || !F.value ? l.setHours(0, 0, 0, 0) : l.setHours(23, 59, 59, 999)) : l = new Date(s.date.getFullYear(), s.date.getMonth(), s.date.getDate()), !F.value && !
|
|
1783
|
-
F.value = l,
|
|
1784
|
-
else if (F.value && !
|
|
1782
|
+
if (t.includeTime ? (l = new Date(s.date), v === "start" || !F.value ? l.setHours(0, 0, 0, 0) : l.setHours(23, 59, 59, 999)) : l = new Date(s.date.getFullYear(), s.date.getMonth(), s.date.getDate()), !F.value && !A.value)
|
|
1783
|
+
F.value = l, A.value = null;
|
|
1784
|
+
else if (F.value && !A.value)
|
|
1785
1785
|
if (l >= F.value)
|
|
1786
|
-
t.includeTime && l.setHours(23, 59, 59, 999),
|
|
1786
|
+
t.includeTime && l.setHours(23, 59, 59, 999), A.value = l;
|
|
1787
1787
|
else {
|
|
1788
1788
|
const d = F.value;
|
|
1789
|
-
t.includeTime && d.setHours(23, 59, 59, 999),
|
|
1789
|
+
t.includeTime && d.setHours(23, 59, 59, 999), A.value = d, F.value = l;
|
|
1790
1790
|
}
|
|
1791
1791
|
else
|
|
1792
|
-
F.value = l,
|
|
1793
|
-
if (y.value = -1, F.value &&
|
|
1794
|
-
const d = new Date(
|
|
1795
|
-
t.includeTime && d.setHours(23, 59, 59, 999),
|
|
1792
|
+
F.value = l, A.value = null;
|
|
1793
|
+
if (y.value = -1, F.value && A.value) {
|
|
1794
|
+
const d = new Date(A.value);
|
|
1795
|
+
t.includeTime && d.setHours(23, 59, 59, 999), L.value = {
|
|
1796
1796
|
startDate: F.value,
|
|
1797
1797
|
endDate: d
|
|
1798
1798
|
};
|
|
1799
1799
|
} else
|
|
1800
|
-
|
|
1801
|
-
},
|
|
1800
|
+
L.value = null;
|
|
1801
|
+
}, te = (s, v) => {
|
|
1802
1802
|
if (!s) return ["nh-date-table-td"];
|
|
1803
1803
|
const l = ["nh-date-table-td"];
|
|
1804
|
-
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"), F.value &&
|
|
1804
|
+
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"), F.value && R(s.date, F.value) && l.push("is-selected", "is-start"), A.value && R(s.date, A.value) && l.push("is-selected", "is-end"), F.value && A.value && Y(s.date, F.value, A.value) && l.push("is-in-range"), l;
|
|
1805
1805
|
}, ye = () => {
|
|
1806
|
-
|
|
1806
|
+
L.value && (t.includeTime && L.value.endDate && L.value.endDate.setHours(23, 59, 59, 999), ae(L.value), y.value = ee(L.value), m.value = !1);
|
|
1807
1807
|
}, Le = () => {
|
|
1808
|
-
|
|
1808
|
+
ae({ startDate: null, endDate: null }), We(), p.value = -1, m.value = !1;
|
|
1809
1809
|
}, Ce = () => {
|
|
1810
|
-
m.value &&
|
|
1810
|
+
m.value && se(() => {
|
|
1811
1811
|
we();
|
|
1812
1812
|
});
|
|
1813
|
-
}, Me = O(() =>
|
|
1814
|
-
const s =
|
|
1813
|
+
}, Me = O(() => X(w.value.year, w.value.month)), Ie = O(() => X(g.value.year, g.value.month)), Pe = O(() => {
|
|
1814
|
+
const s = J(t.modelValue);
|
|
1815
1815
|
if (!s || !s.startDate || !s.endDate)
|
|
1816
1816
|
return "";
|
|
1817
1817
|
const v = (D) => {
|
|
1818
|
-
const S = String(D.getFullYear()), _ = String(D.getMonth() + 1).padStart(2, "0"),
|
|
1819
|
-
return `${S}/${_}/${
|
|
1818
|
+
const S = String(D.getFullYear()), _ = String(D.getMonth() + 1).padStart(2, "0"), T = String(D.getDate()).padStart(2, "0");
|
|
1819
|
+
return `${S}/${_}/${T}`;
|
|
1820
1820
|
}, l = v(s.startDate), d = v(s.endDate);
|
|
1821
1821
|
return !t.includeTime && l === d ? l : `${l} - ${d}`;
|
|
1822
1822
|
}), Re = O(() => [
|
|
1823
1823
|
"nh-time-dropdown",
|
|
1824
1824
|
{
|
|
1825
|
-
"nh-time-dropdown-top": !
|
|
1826
|
-
"nh-time-dropdown-right": !
|
|
1825
|
+
"nh-time-dropdown-top": !x.value.top,
|
|
1826
|
+
"nh-time-dropdown-right": !x.value.left
|
|
1827
1827
|
}
|
|
1828
1828
|
]), Ve = O(() => {
|
|
1829
|
-
const s =
|
|
1829
|
+
const s = J(t.modelValue);
|
|
1830
1830
|
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1831
|
-
}), Ye = O(() => !!(F.value &&
|
|
1832
|
-
F.value = null,
|
|
1831
|
+
}), Ye = O(() => !!(F.value && A.value)), We = () => {
|
|
1832
|
+
F.value = null, A.value = null, L.value = null, y.value = -1;
|
|
1833
1833
|
};
|
|
1834
|
-
|
|
1835
|
-
const v =
|
|
1834
|
+
oe(() => t.modelValue, (s) => {
|
|
1835
|
+
const v = J(s);
|
|
1836
1836
|
if (v != null && v.startDate) {
|
|
1837
1837
|
const l = v.startDate;
|
|
1838
|
-
|
|
1838
|
+
w.value.year = l.getFullYear(), w.value.month = l.getMonth();
|
|
1839
1839
|
}
|
|
1840
1840
|
if (v != null && v.endDate) {
|
|
1841
1841
|
const l = v.endDate;
|
|
1842
|
-
|
|
1842
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1843
1843
|
} else if (v != null && v.startDate) {
|
|
1844
|
-
const l = new Date(
|
|
1845
|
-
|
|
1844
|
+
const l = new Date(w.value.year, w.value.month + 1);
|
|
1845
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1846
1846
|
}
|
|
1847
|
-
(v != null && v.startDate || v != null && v.endDate) &&
|
|
1848
|
-
}, { immediate: !0, deep: !0 }),
|
|
1849
|
-
const s = new Date(
|
|
1847
|
+
(v != null && v.startDate || v != null && v.endDate) && b(), m.value || (y.value = ee(s));
|
|
1848
|
+
}, { immediate: !0, deep: !0 }), oe([w, g], () => {
|
|
1849
|
+
const s = new Date(w.value.year, w.value.month).getTime(), v = new Date(g.value.year, g.value.month).getTime();
|
|
1850
1850
|
if (s === v) {
|
|
1851
|
-
const l = new Date(
|
|
1852
|
-
|
|
1851
|
+
const l = new Date(w.value.year, w.value.month + 1);
|
|
1852
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1853
1853
|
}
|
|
1854
1854
|
}, { deep: !0 }), $e(() => {
|
|
1855
|
-
document.addEventListener("click",
|
|
1856
|
-
const s =
|
|
1857
|
-
if (s != null && s.startDate && (
|
|
1858
|
-
|
|
1855
|
+
document.addEventListener("click", Z), window.addEventListener("resize", Ce), window.addEventListener("scroll", Ce), y.value = ee(t.modelValue);
|
|
1856
|
+
const s = J(t.modelValue);
|
|
1857
|
+
if (s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1858
|
+
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1859
1859
|
else {
|
|
1860
|
-
const v = new Date(
|
|
1861
|
-
|
|
1860
|
+
const v = new Date(w.value.year, w.value.month + 1);
|
|
1861
|
+
g.value.year = v.getFullYear(), g.value.month = v.getMonth();
|
|
1862
1862
|
}
|
|
1863
|
-
|
|
1863
|
+
b();
|
|
1864
1864
|
}), Be(() => {
|
|
1865
|
-
document.removeEventListener("click",
|
|
1865
|
+
document.removeEventListener("click", Z), window.removeEventListener("resize", Ce), window.removeEventListener("scroll", Ce);
|
|
1866
1866
|
});
|
|
1867
1867
|
const He = () => {
|
|
1868
|
-
t.clearable && (
|
|
1868
|
+
t.clearable && (ae({ startDate: null, endDate: null }), We(), p.value = -1);
|
|
1869
1869
|
}, Te = (s, v) => {
|
|
1870
1870
|
if (s === "start") {
|
|
1871
|
-
const l = new Date(g.value.year, g.value.month + v, 1);
|
|
1872
|
-
g.value.year = l.getFullYear(), g.value.month = l.getMonth(), x();
|
|
1873
|
-
} else {
|
|
1874
1871
|
const l = new Date(w.value.year, w.value.month + v, 1);
|
|
1875
|
-
w.value.year = l.getFullYear(), w.value.month = l.getMonth(),
|
|
1872
|
+
w.value.year = l.getFullYear(), w.value.month = l.getMonth(), b();
|
|
1873
|
+
} else {
|
|
1874
|
+
const l = new Date(g.value.year, g.value.month + v, 1);
|
|
1875
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth(), V();
|
|
1876
1876
|
}
|
|
1877
1877
|
};
|
|
1878
1878
|
return (s, v) => {
|
|
1879
1879
|
const l = Ae("YButton");
|
|
1880
1880
|
return i(), u("div", {
|
|
1881
|
-
class:
|
|
1881
|
+
class: K(["nh-time-search", [`nh-time--${e.size}`]])
|
|
1882
1882
|
}, [
|
|
1883
1883
|
o("div", _n, [
|
|
1884
1884
|
o("div", {
|
|
@@ -1886,7 +1886,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1886
1886
|
ref: C,
|
|
1887
1887
|
onClick: N,
|
|
1888
1888
|
onKeydown: c,
|
|
1889
|
-
class:
|
|
1889
|
+
class: K(["nh-time-trigger", { "is-focus": m.value, "has-value": Ve.value }]),
|
|
1890
1890
|
tabindex: "0"
|
|
1891
1891
|
}, [
|
|
1892
1892
|
o("input", {
|
|
@@ -1898,7 +1898,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1898
1898
|
o("span", Ln, [
|
|
1899
1899
|
e.clearable && Ve.value ? (i(), u("i", {
|
|
1900
1900
|
key: 0,
|
|
1901
|
-
onClick:
|
|
1901
|
+
onClick: G(He, ["stop"]),
|
|
1902
1902
|
class: "nh-time-clear"
|
|
1903
1903
|
}, [...v[4] || (v[4] = [
|
|
1904
1904
|
o("svg", {
|
|
@@ -1911,7 +1911,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1911
1911
|
fill: "currentColor"
|
|
1912
1912
|
})
|
|
1913
1913
|
], -1)
|
|
1914
|
-
])])) :
|
|
1914
|
+
])])) : H("", !0),
|
|
1915
1915
|
v[6] || (v[6] = o("i", { class: "nh-time-icon" }, [
|
|
1916
1916
|
o("svg", {
|
|
1917
1917
|
viewBox: "0 0 1024 1024",
|
|
@@ -1925,7 +1925,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1925
1925
|
])
|
|
1926
1926
|
], -1)),
|
|
1927
1927
|
o("i", {
|
|
1928
|
-
class:
|
|
1928
|
+
class: K(["nh-time-arrow", { "is-reverse": m.value }])
|
|
1929
1929
|
}, [...v[5] || (v[5] = [
|
|
1930
1930
|
o("svg", {
|
|
1931
1931
|
viewBox: "0 0 1024 1024",
|
|
@@ -1940,25 +1940,25 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1940
1940
|
])], 2)
|
|
1941
1941
|
])
|
|
1942
1942
|
], 34),
|
|
1943
|
-
|
|
1944
|
-
default:
|
|
1943
|
+
de(be, { name: "el-zoom-in-top" }, {
|
|
1944
|
+
default: fe(() => [
|
|
1945
1945
|
m.value ? (i(), u("div", {
|
|
1946
1946
|
key: 0,
|
|
1947
1947
|
ref_key: "dropdown",
|
|
1948
|
-
ref:
|
|
1949
|
-
class:
|
|
1948
|
+
ref: I,
|
|
1949
|
+
class: K(Re.value),
|
|
1950
1950
|
onKeydown: h
|
|
1951
1951
|
}, [
|
|
1952
1952
|
o("div", Mn, [
|
|
1953
1953
|
v[7] || (v[7] = o("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1954
1954
|
o("ul", In, [
|
|
1955
|
-
(i(!0), u(
|
|
1955
|
+
(i(!0), u(re, null, ve(e.shortcuts, (d, D) => (i(), u("li", {
|
|
1956
1956
|
key: d.label,
|
|
1957
|
-
onClick: (S) =>
|
|
1957
|
+
onClick: (S) => B(d),
|
|
1958
1958
|
onKeydown: (S) => a(S, D),
|
|
1959
1959
|
onMouseenter: (S) => r(D),
|
|
1960
1960
|
onMouseleave: f,
|
|
1961
|
-
class:
|
|
1961
|
+
class: K([
|
|
1962
1962
|
"nh-time-shortcut",
|
|
1963
1963
|
{
|
|
1964
1964
|
"is-active": p.value === D,
|
|
@@ -1966,14 +1966,14 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1966
1966
|
}
|
|
1967
1967
|
]),
|
|
1968
1968
|
tabindex: "0"
|
|
1969
|
-
},
|
|
1969
|
+
}, ne(d.label), 43, En))), 128))
|
|
1970
1970
|
])
|
|
1971
1971
|
]),
|
|
1972
1972
|
o("div", Bn, [
|
|
1973
1973
|
o("div", Tn, [
|
|
1974
1974
|
v[8] || (v[8] = o("span", null, "自定义时间", -1)),
|
|
1975
1975
|
o("div", Kn, [
|
|
1976
|
-
!F.value && !
|
|
1976
|
+
!F.value && !A.value ? (i(), u("span", zn, " 请选择开始日期 ")) : F.value && !A.value ? (i(), u("span", Hn, " 请选择结束日期 ")) : F.value && A.value ? (i(), u("span", Rn, " 已选择完整范围 ")) : H("", !0)
|
|
1977
1977
|
])
|
|
1978
1978
|
]),
|
|
1979
1979
|
o("div", Vn, [
|
|
@@ -1996,7 +1996,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1996
1996
|
})
|
|
1997
1997
|
], -1)
|
|
1998
1998
|
])]),
|
|
1999
|
-
o("span", Pn,
|
|
1999
|
+
o("span", Pn, ne(z(w.value.year, w.value.month)), 1),
|
|
2000
2000
|
o("button", {
|
|
2001
2001
|
onClick: v[1] || (v[1] = (d) => Te("start", 1)),
|
|
2002
2002
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2018,23 +2018,23 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2018
2018
|
o("table", Nn, [
|
|
2019
2019
|
o("thead", null, [
|
|
2020
2020
|
o("tr", null, [
|
|
2021
|
-
(i(), u(
|
|
2021
|
+
(i(), u(re, null, ve(j, (d) => o("th", {
|
|
2022
2022
|
key: d,
|
|
2023
2023
|
class: "nh-date-table-th"
|
|
2024
|
-
},
|
|
2024
|
+
}, ne(d), 1)), 64))
|
|
2025
2025
|
])
|
|
2026
2026
|
]),
|
|
2027
2027
|
o("tbody", null, [
|
|
2028
|
-
(i(!0), u(
|
|
2028
|
+
(i(!0), u(re, null, ve(Me.value, (d, D) => (i(), u("tr", {
|
|
2029
2029
|
key: `start-week-${D}`
|
|
2030
2030
|
}, [
|
|
2031
|
-
(i(!0), u(
|
|
2031
|
+
(i(!0), u(re, null, ve(d, (S, _) => (i(), u("td", {
|
|
2032
2032
|
key: `start-day-${D}-${_}`,
|
|
2033
|
-
class:
|
|
2034
|
-
onClick: (
|
|
2033
|
+
class: K(te(S)),
|
|
2034
|
+
onClick: (T) => P(S, "start")
|
|
2035
2035
|
}, [
|
|
2036
2036
|
o("div", jn, [
|
|
2037
|
-
S ? (i(), u("span", qn,
|
|
2037
|
+
S ? (i(), u("span", qn, ne(S.day), 1)) : H("", !0)
|
|
2038
2038
|
])
|
|
2039
2039
|
], 10, On))), 128))
|
|
2040
2040
|
]))), 128))
|
|
@@ -2062,7 +2062,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2062
2062
|
})
|
|
2063
2063
|
], -1)
|
|
2064
2064
|
])]),
|
|
2065
|
-
o("span", Jn,
|
|
2065
|
+
o("span", Jn, ne(z(g.value.year, g.value.month)), 1),
|
|
2066
2066
|
o("button", {
|
|
2067
2067
|
onClick: v[3] || (v[3] = (d) => Te("end", 1)),
|
|
2068
2068
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2084,23 +2084,23 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2084
2084
|
o("table", Gn, [
|
|
2085
2085
|
o("thead", null, [
|
|
2086
2086
|
o("tr", null, [
|
|
2087
|
-
(i(), u(
|
|
2087
|
+
(i(), u(re, null, ve(j, (d) => o("th", {
|
|
2088
2088
|
key: d,
|
|
2089
2089
|
class: "nh-date-table-th"
|
|
2090
|
-
},
|
|
2090
|
+
}, ne(d), 1)), 64))
|
|
2091
2091
|
])
|
|
2092
2092
|
]),
|
|
2093
2093
|
o("tbody", null, [
|
|
2094
|
-
(i(!0), u(
|
|
2094
|
+
(i(!0), u(re, null, ve(Ie.value, (d, D) => (i(), u("tr", {
|
|
2095
2095
|
key: `end-week-${D}`
|
|
2096
2096
|
}, [
|
|
2097
|
-
(i(!0), u(
|
|
2097
|
+
(i(!0), u(re, null, ve(d, (S, _) => (i(), u("td", {
|
|
2098
2098
|
key: `end-day-${D}-${_}`,
|
|
2099
|
-
class:
|
|
2100
|
-
onClick: (
|
|
2099
|
+
class: K(te(S)),
|
|
2100
|
+
onClick: (T) => P(S, "end")
|
|
2101
2101
|
}, [
|
|
2102
2102
|
o("div", tl, [
|
|
2103
|
-
S ? (i(), u("span", nl,
|
|
2103
|
+
S ? (i(), u("span", nl, ne(S.day), 1)) : H("", !0)
|
|
2104
2104
|
])
|
|
2105
2105
|
], 10, el))), 128))
|
|
2106
2106
|
]))), 128))
|
|
@@ -2117,25 +2117,25 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2117
2117
|
variant: "secondary",
|
|
2118
2118
|
size: e.size
|
|
2119
2119
|
}, {
|
|
2120
|
-
default:
|
|
2120
|
+
default: fe(() => [...v[13] || (v[13] = [
|
|
2121
2121
|
xe(" 清空 ", -1)
|
|
2122
2122
|
])]),
|
|
2123
2123
|
_: 1
|
|
2124
|
-
}, 8, ["size"])) :
|
|
2125
|
-
|
|
2124
|
+
}, 8, ["size"])) : H("", !0),
|
|
2125
|
+
de(l, {
|
|
2126
2126
|
onClick: ye,
|
|
2127
2127
|
disabled: !Ye.value,
|
|
2128
2128
|
variant: "primary",
|
|
2129
2129
|
size: e.size
|
|
2130
2130
|
}, {
|
|
2131
|
-
default:
|
|
2132
|
-
xe(
|
|
2131
|
+
default: fe(() => [
|
|
2132
|
+
xe(ne(F.value && !A.value ? "继续选择结束日期" : "确认"), 1)
|
|
2133
2133
|
]),
|
|
2134
2134
|
_: 1
|
|
2135
2135
|
}, 8, ["disabled", "size"])
|
|
2136
2136
|
])
|
|
2137
2137
|
])
|
|
2138
|
-
], 34)) :
|
|
2138
|
+
], 34)) : H("", !0)
|
|
2139
2139
|
]),
|
|
2140
2140
|
_: 1
|
|
2141
2141
|
})
|
|
@@ -2143,7 +2143,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2143
2143
|
], 2);
|
|
2144
2144
|
};
|
|
2145
2145
|
}
|
|
2146
|
-
}),
|
|
2146
|
+
}), nt = /* @__PURE__ */ me(ol, [["__scopeId", "data-v-e5ef63b1"]]), al = ["aria-checked", "aria-disabled", "disabled", "onKeydown"], sl = { class: "yswitch__thumb" }, il = {
|
|
2147
2147
|
key: 0,
|
|
2148
2148
|
class: "yswitch__spinner",
|
|
2149
2149
|
"aria-hidden": "true"
|
|
@@ -2164,44 +2164,44 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2164
2164
|
},
|
|
2165
2165
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2166
2166
|
setup(e, { emit: $ }) {
|
|
2167
|
-
const t = e, n = $, m =
|
|
2167
|
+
const t = e, n = $, m = E(), p = O(() => t.modelValue === t.trueValue), y = O(() => {
|
|
2168
2168
|
const C = {};
|
|
2169
2169
|
return C.background = p.value ? t.activeColor : t.inactiveColor, C;
|
|
2170
2170
|
});
|
|
2171
|
-
function
|
|
2171
|
+
function L() {
|
|
2172
2172
|
if (t.disabled || t.loading) return;
|
|
2173
2173
|
const C = p.value ? t.falseValue : t.trueValue;
|
|
2174
2174
|
n("update:modelValue", C), n("change", C);
|
|
2175
2175
|
}
|
|
2176
2176
|
return $e(() => {
|
|
2177
2177
|
const C = m.value;
|
|
2178
|
-
C && (C.addEventListener("focus", (
|
|
2179
|
-
}), (C,
|
|
2178
|
+
C && (C.addEventListener("focus", (I) => n("focus", I)), C.addEventListener("blur", (I) => n("blur", I)));
|
|
2179
|
+
}), (C, I) => (i(), u("button", {
|
|
2180
2180
|
ref_key: "rootEl",
|
|
2181
2181
|
ref: m,
|
|
2182
|
-
class:
|
|
2182
|
+
class: K(["yswitch", [
|
|
2183
2183
|
`yswitch--${e.size}`,
|
|
2184
2184
|
{ "yswitch--checked": p.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2185
2185
|
]]),
|
|
2186
|
-
style:
|
|
2186
|
+
style: ue(y.value),
|
|
2187
2187
|
role: "switch",
|
|
2188
2188
|
"aria-checked": p.value,
|
|
2189
2189
|
"aria-disabled": e.disabled,
|
|
2190
2190
|
disabled: e.disabled || e.loading,
|
|
2191
|
-
onClick:
|
|
2191
|
+
onClick: L,
|
|
2192
2192
|
onKeydown: [
|
|
2193
|
-
ke(
|
|
2194
|
-
ke(
|
|
2193
|
+
ke(G(L, ["prevent"]), ["enter"]),
|
|
2194
|
+
ke(G(L, ["prevent"]), ["space"])
|
|
2195
2195
|
]
|
|
2196
2196
|
}, [
|
|
2197
|
-
|
|
2197
|
+
I[0] || (I[0] = o("span", { class: "yswitch__track" }, null, -1)),
|
|
2198
2198
|
o("span", sl, [
|
|
2199
|
-
e.loading ? (i(), u("span", il)) :
|
|
2199
|
+
e.loading ? (i(), u("span", il)) : H("", !0)
|
|
2200
2200
|
]),
|
|
2201
2201
|
e.showText ? (i(), u("span", {
|
|
2202
2202
|
key: 0,
|
|
2203
|
-
class:
|
|
2204
|
-
},
|
|
2203
|
+
class: K(["yswitch__label", { "yswitch__label--left": !p.value, "yswitch__label--right": p.value }])
|
|
2204
|
+
}, ne(p.value ? e.activeText : e.inactiveText), 3)) : H("", !0)
|
|
2205
2205
|
], 46, al));
|
|
2206
2206
|
}
|
|
2207
2207
|
}), ul = /* @__PURE__ */ me(rl, [["__scopeId", "data-v-0b157fc4"]]), cl = ["src", "alt"], dl = ["src", "alt"], fl = /* @__PURE__ */ ge({
|
|
@@ -2220,10 +2220,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2220
2220
|
},
|
|
2221
2221
|
emits: ["load", "error", "preview"],
|
|
2222
2222
|
setup(e, { expose: $, emit: t }) {
|
|
2223
|
-
const n = e, m = t, p =
|
|
2223
|
+
const n = e, m = t, p = E(), y = E(), L = E(), C = E(!1), I = E(!1), x = E(!1), w = E(!1), g = E(!1), b = E("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), V = E(""), j = E(1), F = E(!1), A = E({
|
|
2224
2224
|
overflow: "",
|
|
2225
2225
|
paddingRight: ""
|
|
2226
|
-
}),
|
|
2226
|
+
}), q = {
|
|
2227
2227
|
none: "0px",
|
|
2228
2228
|
sm: "0.125rem",
|
|
2229
2229
|
md: "0.375rem",
|
|
@@ -2231,62 +2231,62 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2231
2231
|
xl: "0.75rem",
|
|
2232
2232
|
"2xl": "1rem",
|
|
2233
2233
|
full: "9999px"
|
|
2234
|
-
},
|
|
2234
|
+
}, Q = O(() => n.className || ""), le = O(() => {
|
|
2235
2235
|
if (typeof n.radius == "number")
|
|
2236
2236
|
return `${n.radius}px`;
|
|
2237
2237
|
if (typeof n.radius == "string") {
|
|
2238
2238
|
if (/(px|%|rem|em)$/.test(n.radius))
|
|
2239
2239
|
return n.radius;
|
|
2240
|
-
if (
|
|
2241
|
-
return
|
|
2240
|
+
if (q[n.radius])
|
|
2241
|
+
return q[n.radius];
|
|
2242
2242
|
}
|
|
2243
2243
|
return "";
|
|
2244
|
-
}),
|
|
2245
|
-
borderRadius:
|
|
2246
|
-
} : {}),
|
|
2244
|
+
}), J = O(() => le.value ? {
|
|
2245
|
+
borderRadius: le.value
|
|
2246
|
+
} : {}), W = O(() => [
|
|
2247
2247
|
"yimage-image",
|
|
2248
2248
|
n.preview ? "is-previewable" : ""
|
|
2249
|
-
].filter(Boolean).join(" ")),
|
|
2250
|
-
const
|
|
2249
|
+
].filter(Boolean).join(" ")), z = O(() => {
|
|
2250
|
+
const B = {
|
|
2251
2251
|
objectFit: n.fit || "cover",
|
|
2252
2252
|
backgroundColor: "#fff"
|
|
2253
2253
|
};
|
|
2254
|
-
return n.width && (
|
|
2255
|
-
}),
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2258
|
-
const P =
|
|
2259
|
-
return document.body.removeChild(
|
|
2260
|
-
},
|
|
2261
|
-
if (
|
|
2254
|
+
return n.width && (B.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.height && (B.height = typeof n.height == "number" ? `${n.height}px` : n.height), le.value && (B.borderRadius = le.value), B;
|
|
2255
|
+
}), R = O(() => V.value ? V.value : Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src), Y = () => {
|
|
2256
|
+
const B = document.createElement("div");
|
|
2257
|
+
B.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(B);
|
|
2258
|
+
const P = B.offsetWidth - B.clientWidth;
|
|
2259
|
+
return document.body.removeChild(B), P;
|
|
2260
|
+
}, ee = () => {
|
|
2261
|
+
if (A.value = {
|
|
2262
2262
|
overflow: document.body.style.overflow || "",
|
|
2263
2263
|
paddingRight: document.body.style.paddingRight || ""
|
|
2264
2264
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2265
|
-
const P =
|
|
2265
|
+
const P = Y();
|
|
2266
2266
|
document.body.style.paddingRight = `${P}px`;
|
|
2267
2267
|
}
|
|
2268
2268
|
document.body.style.overflow = "hidden";
|
|
2269
|
-
},
|
|
2270
|
-
document.body.style.overflow =
|
|
2269
|
+
}, X = () => {
|
|
2270
|
+
document.body.style.overflow = A.value.overflow, document.body.style.paddingRight = A.value.paddingRight;
|
|
2271
2271
|
};
|
|
2272
|
-
let
|
|
2272
|
+
let ae = null;
|
|
2273
2273
|
const we = () => {
|
|
2274
|
-
!n.lazy || !p.value || (
|
|
2275
|
-
(
|
|
2276
|
-
|
|
2277
|
-
P.isIntersecting && (
|
|
2274
|
+
!n.lazy || !p.value || (ae = new IntersectionObserver(
|
|
2275
|
+
(B) => {
|
|
2276
|
+
B.forEach((P) => {
|
|
2277
|
+
P.isIntersecting && (w.value = !0, b.value = n.src, ae == null || ae.unobserve(P.target));
|
|
2278
2278
|
});
|
|
2279
2279
|
},
|
|
2280
2280
|
{
|
|
2281
2281
|
rootMargin: "50px"
|
|
2282
2282
|
}
|
|
2283
|
-
),
|
|
2284
|
-
}, N = (
|
|
2285
|
-
C.value = !0,
|
|
2286
|
-
},
|
|
2287
|
-
|
|
2283
|
+
), ae.observe(p.value));
|
|
2284
|
+
}, N = (B) => {
|
|
2285
|
+
C.value = !0, I.value = !1, x.value = !1, m("load", B);
|
|
2286
|
+
}, Z = (B) => {
|
|
2287
|
+
x.value = !0, I.value = !1, C.value = !1, m("error", B);
|
|
2288
2288
|
}, c = () => {
|
|
2289
|
-
|
|
2289
|
+
x.value = !1, I.value = !0, C.value = !1, se(() => {
|
|
2290
2290
|
y.value && (y.value.src = n.src);
|
|
2291
2291
|
});
|
|
2292
2292
|
}, h = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, a = () => {
|
|
@@ -2294,56 +2294,56 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2294
2294
|
}, r = () => {
|
|
2295
2295
|
if (!n.preview) return;
|
|
2296
2296
|
j.value = 1;
|
|
2297
|
-
const
|
|
2297
|
+
const B = h();
|
|
2298
2298
|
if (y.value && y.value.complete && y.value.naturalWidth > 0) {
|
|
2299
|
-
V.value =
|
|
2300
|
-
|
|
2299
|
+
V.value = B, se(() => {
|
|
2300
|
+
g.value = !0, ee(), m("preview", B);
|
|
2301
2301
|
});
|
|
2302
2302
|
return;
|
|
2303
2303
|
}
|
|
2304
2304
|
const P = new Image();
|
|
2305
|
-
let
|
|
2305
|
+
let te = null, ye = !1;
|
|
2306
2306
|
const Le = () => {
|
|
2307
|
-
ye || (ye = !0,
|
|
2308
|
-
|
|
2307
|
+
ye || (ye = !0, te && (clearTimeout(te), te = null), V.value = B, se(() => {
|
|
2308
|
+
g.value = !0, ee(), m("preview", B);
|
|
2309
2309
|
}));
|
|
2310
2310
|
};
|
|
2311
|
-
|
|
2311
|
+
te = setTimeout(() => {
|
|
2312
2312
|
Le();
|
|
2313
2313
|
}, 500), P.onload = () => {
|
|
2314
2314
|
Le();
|
|
2315
2315
|
}, P.onerror = () => {
|
|
2316
2316
|
Le();
|
|
2317
|
-
}, P.src =
|
|
2317
|
+
}, P.src = B, P.complete && Le();
|
|
2318
2318
|
}, f = () => {
|
|
2319
|
-
|
|
2320
|
-
|
|
2319
|
+
g.value = !1, setTimeout(() => {
|
|
2320
|
+
X();
|
|
2321
2321
|
}, 300);
|
|
2322
|
-
}, k = (
|
|
2323
|
-
const P =
|
|
2322
|
+
}, k = (B) => {
|
|
2323
|
+
const P = B.deltaY < 0 ? 1 : -1;
|
|
2324
2324
|
let ye = j.value + P * 0.1;
|
|
2325
2325
|
ye = Math.max(0.5, Math.min(2, ye)), j.value = ye;
|
|
2326
2326
|
};
|
|
2327
2327
|
return $e(() => {
|
|
2328
|
-
n.lazy ? we() :
|
|
2328
|
+
n.lazy ? we() : w.value = !0, w.value && (I.value = !0), F.value = !0;
|
|
2329
2329
|
}), Be(() => {
|
|
2330
|
-
|
|
2331
|
-
}),
|
|
2332
|
-
n.src &&
|
|
2333
|
-
}),
|
|
2334
|
-
|
|
2330
|
+
ae && ae.disconnect(), g.value && X();
|
|
2331
|
+
}), oe(() => b.value, () => {
|
|
2332
|
+
n.src && w.value && (I.value = !0, x.value = !1, C.value = !1);
|
|
2333
|
+
}), oe(() => n.src, (B) => {
|
|
2334
|
+
b.value = B || "";
|
|
2335
2335
|
}), $({
|
|
2336
2336
|
retryLoad: c,
|
|
2337
2337
|
closePreview: f
|
|
2338
|
-
}), (
|
|
2338
|
+
}), (B, P) => (i(), u("div", {
|
|
2339
2339
|
ref_key: "containerRef",
|
|
2340
2340
|
ref: p,
|
|
2341
|
-
class:
|
|
2341
|
+
class: K(["yimage-container", Q.value])
|
|
2342
2342
|
}, [
|
|
2343
|
-
!C.value && !
|
|
2343
|
+
!C.value && !x.value && !w.value ? (i(), u("div", {
|
|
2344
2344
|
key: 0,
|
|
2345
2345
|
class: "yimage-placeholder",
|
|
2346
|
-
style:
|
|
2346
|
+
style: ue(J.value)
|
|
2347
2347
|
}, [...P[1] || (P[1] = [
|
|
2348
2348
|
o("div", { class: "yimage-placeholder-content" }, [
|
|
2349
2349
|
o("svg", {
|
|
@@ -2360,78 +2360,78 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2360
2360
|
})
|
|
2361
2361
|
])
|
|
2362
2362
|
], -1)
|
|
2363
|
-
])], 4)) :
|
|
2364
|
-
|
|
2363
|
+
])], 4)) : H("", !0),
|
|
2364
|
+
I.value && !x.value ? (i(), u("div", {
|
|
2365
2365
|
key: 1,
|
|
2366
2366
|
class: "yimage-loading",
|
|
2367
|
-
style:
|
|
2367
|
+
style: ue(J.value)
|
|
2368
2368
|
}, [...P[2] || (P[2] = [
|
|
2369
2369
|
o("div", { class: "yimage-loading-content" }, [
|
|
2370
2370
|
o("div", { class: "yimage-spinner" })
|
|
2371
2371
|
], -1)
|
|
2372
|
-
])], 4)) :
|
|
2373
|
-
|
|
2372
|
+
])], 4)) : H("", !0),
|
|
2373
|
+
x.value ? (i(), u("div", {
|
|
2374
2374
|
key: 2,
|
|
2375
2375
|
class: "yimage-error",
|
|
2376
|
-
style:
|
|
2376
|
+
style: ue(J.value),
|
|
2377
2377
|
onClick: a
|
|
2378
2378
|
}, [
|
|
2379
2379
|
o("img", {
|
|
2380
2380
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2381
2381
|
alt: "Error Image",
|
|
2382
2382
|
class: "yimage-error-image",
|
|
2383
|
-
style:
|
|
2383
|
+
style: ue(J.value)
|
|
2384
2384
|
}, null, 4)
|
|
2385
|
-
], 4)) :
|
|
2385
|
+
], 4)) : H("", !0),
|
|
2386
2386
|
Ee(o("img", {
|
|
2387
2387
|
ref_key: "imageRef",
|
|
2388
2388
|
ref: y,
|
|
2389
|
-
src:
|
|
2389
|
+
src: b.value,
|
|
2390
2390
|
alt: e.alt,
|
|
2391
|
-
class:
|
|
2391
|
+
class: K(W.value),
|
|
2392
2392
|
onLoad: N,
|
|
2393
|
-
onError:
|
|
2394
|
-
onClick:
|
|
2395
|
-
style:
|
|
2393
|
+
onError: Z,
|
|
2394
|
+
onClick: G(r, ["stop"]),
|
|
2395
|
+
style: ue(z.value)
|
|
2396
2396
|
}, null, 46, cl), [
|
|
2397
|
-
[ze, C.value && !
|
|
2397
|
+
[ze, C.value && !x.value]
|
|
2398
2398
|
]),
|
|
2399
|
-
n.preview && (!C.value ||
|
|
2399
|
+
n.preview && (!C.value || I.value || x.value || !w.value) ? (i(), u("div", {
|
|
2400
2400
|
key: 3,
|
|
2401
2401
|
class: "yimage-preview-trigger",
|
|
2402
|
-
onClick:
|
|
2403
|
-
})) :
|
|
2402
|
+
onClick: G(r, ["stop"])
|
|
2403
|
+
})) : H("", !0),
|
|
2404
2404
|
F.value ? (i(), Se(Fe, {
|
|
2405
2405
|
key: 4,
|
|
2406
2406
|
to: "body"
|
|
2407
2407
|
}, [
|
|
2408
|
-
|
|
2409
|
-
default:
|
|
2410
|
-
|
|
2408
|
+
de(be, { name: "fade" }, {
|
|
2409
|
+
default: fe(() => [
|
|
2410
|
+
g.value ? (i(), u("div", {
|
|
2411
2411
|
key: 0,
|
|
2412
2412
|
class: "yimage-preview-mask",
|
|
2413
|
-
onClick:
|
|
2414
|
-
onWheel:
|
|
2413
|
+
onClick: G(f, ["self"]),
|
|
2414
|
+
onWheel: G(k, ["prevent"])
|
|
2415
2415
|
}, [
|
|
2416
2416
|
o("div", {
|
|
2417
|
-
class:
|
|
2417
|
+
class: K(["yimage-preview-content", { "is-active": g.value }])
|
|
2418
2418
|
}, [
|
|
2419
2419
|
o("img", {
|
|
2420
2420
|
ref_key: "previewImageRef",
|
|
2421
|
-
ref:
|
|
2422
|
-
src:
|
|
2421
|
+
ref: L,
|
|
2422
|
+
src: R.value,
|
|
2423
2423
|
alt: e.alt,
|
|
2424
2424
|
class: "yimage-preview-image",
|
|
2425
|
-
style:
|
|
2426
|
-
onClick: P[0] || (P[0] =
|
|
2425
|
+
style: ue({ transform: `scale(${j.value})` }),
|
|
2426
|
+
onClick: P[0] || (P[0] = G(() => {
|
|
2427
2427
|
}, ["stop"]))
|
|
2428
2428
|
}, null, 12, dl)
|
|
2429
2429
|
], 2)
|
|
2430
|
-
], 32)) :
|
|
2430
|
+
], 32)) : H("", !0)
|
|
2431
2431
|
]),
|
|
2432
2432
|
_: 1
|
|
2433
2433
|
})
|
|
2434
|
-
])) :
|
|
2434
|
+
])) : H("", !0)
|
|
2435
2435
|
], 2));
|
|
2436
2436
|
}
|
|
2437
2437
|
}), vl = /* @__PURE__ */ me(fl, [["__scopeId", "data-v-c1a55c52"]]), hl = /* @__PURE__ */ ge({
|
|
@@ -2443,100 +2443,100 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2443
2443
|
menuWidth: { default: void 0 }
|
|
2444
2444
|
},
|
|
2445
2445
|
setup(e) {
|
|
2446
|
-
const $ = e, t =
|
|
2446
|
+
const $ = e, t = E(!1), n = E();
|
|
2447
2447
|
let m = null;
|
|
2448
2448
|
const p = O(() => `y-dropdown__menu--${$.placement}`), y = O(() => {
|
|
2449
2449
|
if (!$.menuWidth) return {};
|
|
2450
|
-
const
|
|
2450
|
+
const g = typeof $.menuWidth == "number" ? `${$.menuWidth}px` : $.menuWidth;
|
|
2451
2451
|
return {
|
|
2452
|
-
width:
|
|
2453
|
-
minWidth:
|
|
2454
|
-
maxWidth:
|
|
2452
|
+
width: g,
|
|
2453
|
+
minWidth: g,
|
|
2454
|
+
maxWidth: g
|
|
2455
2455
|
};
|
|
2456
|
-
}),
|
|
2457
|
-
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value),
|
|
2458
|
-
|
|
2456
|
+
}), L = () => {
|
|
2457
|
+
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value), se(() => {
|
|
2458
|
+
I();
|
|
2459
2459
|
}));
|
|
2460
2460
|
}, C = () => {
|
|
2461
2461
|
console.log("隐藏下拉菜单"), m = setTimeout(() => {
|
|
2462
2462
|
t.value = !1, console.log("设置 visible 为 false", t.value);
|
|
2463
2463
|
}, 150);
|
|
2464
|
-
},
|
|
2464
|
+
}, I = () => {
|
|
2465
2465
|
if (!n.value) return;
|
|
2466
|
-
const
|
|
2467
|
-
if (!
|
|
2468
|
-
const V =
|
|
2469
|
-
|
|
2470
|
-
let
|
|
2466
|
+
const g = n.value.querySelector(".y-dropdown__trigger"), b = n.value.querySelector(".y-dropdown__menu");
|
|
2467
|
+
if (!g || !b) return;
|
|
2468
|
+
const V = g.getBoundingClientRect(), j = b.getBoundingClientRect(), F = window.innerWidth, A = window.innerHeight;
|
|
2469
|
+
b.style.top = "", b.style.left = "", b.style.right = "", b.style.bottom = "", b.style.transform = "";
|
|
2470
|
+
let q = 0, Q = 0;
|
|
2471
2471
|
switch ($.placement) {
|
|
2472
2472
|
case "bottom":
|
|
2473
|
-
|
|
2473
|
+
q = V.height + 4, Q = 0;
|
|
2474
2474
|
break;
|
|
2475
2475
|
case "top":
|
|
2476
|
-
|
|
2476
|
+
q = -(j.height + 4), Q = 0;
|
|
2477
2477
|
break;
|
|
2478
2478
|
case "right":
|
|
2479
|
-
|
|
2479
|
+
q = 0, Q = V.width + 4;
|
|
2480
2480
|
break;
|
|
2481
2481
|
case "left":
|
|
2482
|
-
|
|
2482
|
+
q = 0, Q = -(j.width + 4);
|
|
2483
2483
|
break;
|
|
2484
2484
|
}
|
|
2485
|
-
let
|
|
2485
|
+
let le = V.top + q, J = V.left + Q;
|
|
2486
2486
|
if ($.placement === "bottom" || $.placement === "top") {
|
|
2487
|
-
const
|
|
2488
|
-
|
|
2487
|
+
const W = j.width || 260;
|
|
2488
|
+
J + W > F - 10 && (J = F - W - 10), J < 10 && (J = 10);
|
|
2489
2489
|
}
|
|
2490
2490
|
if ($.placement === "left" || $.placement === "right") {
|
|
2491
|
-
const
|
|
2492
|
-
|
|
2491
|
+
const W = j.height || 200;
|
|
2492
|
+
le + W > A - 10 && (le = A - W - 10), le < 10 && (le = 10);
|
|
2493
2493
|
}
|
|
2494
|
-
|
|
2495
|
-
},
|
|
2496
|
-
$.trigger === "click" && n.value && !n.value.contains(
|
|
2497
|
-
},
|
|
2498
|
-
t.value &&
|
|
2494
|
+
b.style.top = `${le}px`, b.style.left = `${J}px`;
|
|
2495
|
+
}, x = (g) => {
|
|
2496
|
+
$.trigger === "click" && n.value && !n.value.contains(g.target) && (t.value = !1);
|
|
2497
|
+
}, w = () => {
|
|
2498
|
+
t.value && I();
|
|
2499
2499
|
};
|
|
2500
2500
|
return $e(() => {
|
|
2501
|
-
$.trigger === "click" && document.addEventListener("click",
|
|
2501
|
+
$.trigger === "click" && document.addEventListener("click", x), window.addEventListener("resize", w), window.addEventListener("scroll", w);
|
|
2502
2502
|
}), Be(() => {
|
|
2503
|
-
$.trigger === "click" && document.removeEventListener("click",
|
|
2504
|
-
}),
|
|
2503
|
+
$.trigger === "click" && document.removeEventListener("click", x), m && clearTimeout(m), window.removeEventListener("resize", w), window.removeEventListener("scroll", w);
|
|
2504
|
+
}), oe(
|
|
2505
2505
|
() => $.menuWidth,
|
|
2506
2506
|
() => {
|
|
2507
|
-
t.value &&
|
|
2508
|
-
|
|
2507
|
+
t.value && se(() => {
|
|
2508
|
+
I();
|
|
2509
2509
|
});
|
|
2510
2510
|
}
|
|
2511
|
-
), (
|
|
2511
|
+
), (g, b) => (i(), u("div", {
|
|
2512
2512
|
class: "y-dropdown",
|
|
2513
2513
|
ref_key: "dropdownRef",
|
|
2514
2514
|
ref: n
|
|
2515
2515
|
}, [
|
|
2516
2516
|
o("div", {
|
|
2517
2517
|
class: "y-dropdown__trigger",
|
|
2518
|
-
onMouseenter:
|
|
2518
|
+
onMouseenter: L,
|
|
2519
2519
|
onMouseleave: C
|
|
2520
2520
|
}, [
|
|
2521
|
-
|
|
2522
|
-
|
|
2521
|
+
ce(g.$slots, "trigger", {}, () => [
|
|
2522
|
+
b[0] || (b[0] = o("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2523
2523
|
], !0)
|
|
2524
2524
|
], 32),
|
|
2525
|
-
|
|
2525
|
+
de(be, {
|
|
2526
2526
|
name: "dropdown-fade",
|
|
2527
2527
|
appear: ""
|
|
2528
2528
|
}, {
|
|
2529
|
-
default:
|
|
2529
|
+
default: fe(() => [
|
|
2530
2530
|
Ee(o("div", {
|
|
2531
|
-
class:
|
|
2532
|
-
style:
|
|
2533
|
-
onMouseenter:
|
|
2531
|
+
class: K(["y-dropdown__menu", p.value]),
|
|
2532
|
+
style: ue(y.value),
|
|
2533
|
+
onMouseenter: L,
|
|
2534
2534
|
onMouseleave: C
|
|
2535
2535
|
}, [
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2536
|
+
ce(g.$slots, "default", {}, () => [
|
|
2537
|
+
b[1] || (b[1] = o("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2538
|
+
b[2] || (b[2] = o("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2539
|
+
b[3] || (b[3] = o("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2540
2540
|
], !0)
|
|
2541
2541
|
], 38), [
|
|
2542
2542
|
[ze, t.value]
|
|
@@ -2569,73 +2569,73 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2569
2569
|
setup(e, { emit: $ }) {
|
|
2570
2570
|
const t = e, n = $, m = O({
|
|
2571
2571
|
get: () => t.modelValue,
|
|
2572
|
-
set: (
|
|
2573
|
-
}), p =
|
|
2574
|
-
const
|
|
2575
|
-
return t.placement === "right" ? (
|
|
2572
|
+
set: (b) => n("update:modelValue", b)
|
|
2573
|
+
}), p = E(null), y = O(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), L = O(() => t.placement === "right" ? "rounded-left" : "rounded-top"), C = O(() => {
|
|
2574
|
+
const b = {};
|
|
2575
|
+
return t.placement === "right" ? (b.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), b.height = "100%", b.right = "0", b.top = "0") : (b.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), b.width = "100%", b.bottom = "0", b.left = "0"), b;
|
|
2576
2576
|
});
|
|
2577
|
-
function
|
|
2578
|
-
t.maskClosable &&
|
|
2577
|
+
function I() {
|
|
2578
|
+
t.maskClosable && x();
|
|
2579
2579
|
}
|
|
2580
|
-
function
|
|
2580
|
+
function x() {
|
|
2581
2581
|
m.value && (m.value = !1, n("close"));
|
|
2582
2582
|
}
|
|
2583
|
-
function
|
|
2584
|
-
t.closable &&
|
|
2583
|
+
function w() {
|
|
2584
|
+
t.closable && x();
|
|
2585
2585
|
}
|
|
2586
|
-
function
|
|
2587
|
-
|
|
2586
|
+
function g(b) {
|
|
2587
|
+
b.key === "Escape" && w();
|
|
2588
2588
|
}
|
|
2589
|
-
return
|
|
2590
|
-
|
|
2589
|
+
return oe(() => t.modelValue, (b) => {
|
|
2590
|
+
b ? (n("open"), requestAnimationFrame(() => {
|
|
2591
2591
|
var V;
|
|
2592
2592
|
return (V = p.value) == null ? void 0 : V.focus();
|
|
2593
|
-
}), document.addEventListener("keydown",
|
|
2593
|
+
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2594
2594
|
}), $e(() => {
|
|
2595
|
-
t.modelValue && (document.addEventListener("keydown",
|
|
2595
|
+
t.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2596
2596
|
}), Be(() => {
|
|
2597
|
-
document.removeEventListener("keydown",
|
|
2598
|
-
}), (
|
|
2597
|
+
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2598
|
+
}), (b, V) => (i(), Se(Fe, { to: "body" }, [
|
|
2599
2599
|
Ee(o("div", {
|
|
2600
2600
|
class: "y-drawer-root",
|
|
2601
2601
|
role: "dialog",
|
|
2602
2602
|
"aria-modal": !0,
|
|
2603
2603
|
"aria-hidden": !m.value,
|
|
2604
|
-
style:
|
|
2604
|
+
style: ue({ zIndex: String(e.zIndex) })
|
|
2605
2605
|
}, [
|
|
2606
2606
|
o("div", {
|
|
2607
2607
|
class: "y-drawer-mask",
|
|
2608
|
-
onClick:
|
|
2608
|
+
onClick: I
|
|
2609
2609
|
}),
|
|
2610
|
-
|
|
2611
|
-
default:
|
|
2610
|
+
de(be, { name: y.value }, {
|
|
2611
|
+
default: fe(() => [
|
|
2612
2612
|
Ee(o("div", {
|
|
2613
2613
|
ref_key: "panelRef",
|
|
2614
2614
|
ref: p,
|
|
2615
|
-
class:
|
|
2615
|
+
class: K(["y-drawer-panel", [
|
|
2616
2616
|
`is-${e.placement}`,
|
|
2617
|
-
|
|
2617
|
+
L.value
|
|
2618
2618
|
]]),
|
|
2619
|
-
style:
|
|
2620
|
-
onKeydown: ke(
|
|
2619
|
+
style: ue(C.value),
|
|
2620
|
+
onKeydown: ke(G(w, ["prevent", "stop"]), ["esc"]),
|
|
2621
2621
|
tabindex: "-1"
|
|
2622
2622
|
}, [
|
|
2623
2623
|
e.showHeader ? (i(), u("div", ml, [
|
|
2624
|
-
o("div", wl,
|
|
2624
|
+
o("div", wl, ne(e.title), 1),
|
|
2625
2625
|
e.closable ? (i(), u("button", {
|
|
2626
2626
|
key: 0,
|
|
2627
2627
|
type: "button",
|
|
2628
2628
|
class: "y-drawer-close",
|
|
2629
2629
|
"aria-label": "Close",
|
|
2630
|
-
onClick:
|
|
2631
|
-
}, " ✕ ")) :
|
|
2632
|
-
])) :
|
|
2630
|
+
onClick: x
|
|
2631
|
+
}, " ✕ ")) : H("", !0)
|
|
2632
|
+
])) : H("", !0),
|
|
2633
2633
|
o("div", kl, [
|
|
2634
|
-
|
|
2634
|
+
ce(b.$slots, "default", {}, void 0, !0)
|
|
2635
2635
|
]),
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
])) :
|
|
2636
|
+
b.$slots.footer ? (i(), u("div", bl, [
|
|
2637
|
+
ce(b.$slots, "footer", {}, void 0, !0)
|
|
2638
|
+
])) : H("", !0)
|
|
2639
2639
|
], 46, gl), [
|
|
2640
2640
|
[ze, m.value]
|
|
2641
2641
|
])
|
|
@@ -2783,7 +2783,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2783
2783
|
},
|
|
2784
2784
|
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"],
|
|
2785
2785
|
setup(e, { expose: $, emit: t }) {
|
|
2786
|
-
const n = e, m = t, p = O(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), y =
|
|
2786
|
+
const n = e, m = t, p = O(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), y = E({
|
|
2787
2787
|
currentNode: null,
|
|
2788
2788
|
currentKey: null,
|
|
2789
2789
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2791,37 +2791,37 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2791
2791
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2792
2792
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2793
2793
|
});
|
|
2794
|
-
|
|
2795
|
-
const
|
|
2794
|
+
at("treeStore", y);
|
|
2795
|
+
const L = O(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2796
2796
|
function C(c) {
|
|
2797
2797
|
return c[n.nodeKey] || c.id || Math.random();
|
|
2798
2798
|
}
|
|
2799
|
-
function
|
|
2799
|
+
function I(c) {
|
|
2800
2800
|
var h;
|
|
2801
2801
|
return ((h = n.props) != null && h.label ? c[n.props.label] : void 0) || c.label || "";
|
|
2802
2802
|
}
|
|
2803
|
-
function
|
|
2803
|
+
function x(c) {
|
|
2804
2804
|
var h;
|
|
2805
2805
|
return !!((h = c == null ? void 0 : c.data) != null && h.isEmployee);
|
|
2806
2806
|
}
|
|
2807
|
-
function
|
|
2808
|
-
var
|
|
2807
|
+
function w(c, h) {
|
|
2808
|
+
var M;
|
|
2809
2809
|
const a = n.deptIconUrl || yo, r = n.personIconUrl || go, f = n.buttonIconUrl || "", k = n.childStyleIconUrl || "";
|
|
2810
|
-
return h && k && j(c, h) ? k : (
|
|
2810
|
+
return h && k && j(c, h) ? k : (M = c == null ? void 0 : c.data) != null && M.isButton && f ? f : x(c) ? r : a;
|
|
2811
2811
|
}
|
|
2812
|
-
function
|
|
2812
|
+
function g(c) {
|
|
2813
2813
|
var a;
|
|
2814
2814
|
const h = ((a = n.props) != null && a.children ? c[n.props.children] : void 0) || c.children;
|
|
2815
2815
|
return h && h.length > 0;
|
|
2816
2816
|
}
|
|
2817
|
-
function
|
|
2817
|
+
function b(c) {
|
|
2818
2818
|
var h;
|
|
2819
2819
|
return ((h = n.props) != null && h.children ? c[n.props.children] : void 0) || c.children || [];
|
|
2820
2820
|
}
|
|
2821
2821
|
function V(c, h, a = 1) {
|
|
2822
2822
|
if (c === h)
|
|
2823
2823
|
return a;
|
|
2824
|
-
const r =
|
|
2824
|
+
const r = b(c);
|
|
2825
2825
|
for (const f of r) {
|
|
2826
2826
|
const k = V(f, h, a + 1);
|
|
2827
2827
|
if (k > 0)
|
|
@@ -2836,122 +2836,122 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2836
2836
|
const h = C(c);
|
|
2837
2837
|
return y.value.expandedKeys.has(h);
|
|
2838
2838
|
}
|
|
2839
|
-
function
|
|
2839
|
+
function A(c) {
|
|
2840
2840
|
const h = C(c);
|
|
2841
2841
|
if (y.value.checkedKeys.has(h)) {
|
|
2842
|
-
if (
|
|
2843
|
-
const r =
|
|
2844
|
-
(
|
|
2842
|
+
if (g(c)) {
|
|
2843
|
+
const r = b(c), f = r.filter((M) => A(M)), k = r.filter(
|
|
2844
|
+
(M) => q(M)
|
|
2845
2845
|
);
|
|
2846
2846
|
return f.length === r.length && k.length === 0;
|
|
2847
2847
|
}
|
|
2848
2848
|
return !0;
|
|
2849
2849
|
}
|
|
2850
|
-
if (
|
|
2851
|
-
const r =
|
|
2850
|
+
if (g(c)) {
|
|
2851
|
+
const r = b(c);
|
|
2852
2852
|
return r.some(
|
|
2853
|
-
(k) =>
|
|
2854
|
-
) ? !1 : r.length > 0 && r.every((k) =>
|
|
2853
|
+
(k) => q(k)
|
|
2854
|
+
) ? !1 : r.length > 0 && r.every((k) => A(k));
|
|
2855
2855
|
}
|
|
2856
2856
|
return !1;
|
|
2857
2857
|
}
|
|
2858
|
-
function
|
|
2859
|
-
if (!
|
|
2860
|
-
const h =
|
|
2861
|
-
(f) =>
|
|
2858
|
+
function q(c) {
|
|
2859
|
+
if (!g(c)) return !1;
|
|
2860
|
+
const h = b(c), a = h.filter((f) => A(f)), r = h.filter(
|
|
2861
|
+
(f) => q(f)
|
|
2862
2862
|
);
|
|
2863
2863
|
return a.length === h.length ? !1 : a.length > 0 || r.length > 0;
|
|
2864
2864
|
}
|
|
2865
|
-
function
|
|
2865
|
+
function Q(c) {
|
|
2866
2866
|
const h = C(c);
|
|
2867
2867
|
return y.value.currentKey === h;
|
|
2868
2868
|
}
|
|
2869
|
-
function
|
|
2869
|
+
function le(c) {
|
|
2870
2870
|
const h = C(c);
|
|
2871
2871
|
return y.value.highlightedKeys.has(h);
|
|
2872
2872
|
}
|
|
2873
|
-
function
|
|
2873
|
+
function J(c) {
|
|
2874
2874
|
if (n.disabled) return;
|
|
2875
2875
|
const h = C(c), r = !y.value.checkedKeys.has(h), f = new Set(y.value.expandedKeys);
|
|
2876
2876
|
r ? y.value.checkedKeys.add(h) : y.value.checkedKeys.delete(h);
|
|
2877
|
-
function k(
|
|
2878
|
-
|
|
2879
|
-
const
|
|
2880
|
-
|
|
2877
|
+
function k(M, B) {
|
|
2878
|
+
M.forEach((P) => {
|
|
2879
|
+
const te = C(P);
|
|
2880
|
+
B ? y.value.checkedKeys.add(te) : y.value.checkedKeys.delete(te), g(P) && k(b(P), B);
|
|
2881
2881
|
});
|
|
2882
2882
|
}
|
|
2883
|
-
k(
|
|
2883
|
+
k(b(c), r), r && W(), R(), y.value.expandedKeys = f, m("check-change", c, r, !1), m("check", c, r, !1), m("checked-keys-change", Array.from(y.value.checkedKeys));
|
|
2884
2884
|
}
|
|
2885
|
-
function
|
|
2886
|
-
|
|
2887
|
-
`已启用从第${
|
|
2885
|
+
function W(c) {
|
|
2886
|
+
L.value && console.log(
|
|
2887
|
+
`已启用从第${L.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2888
2888
|
);
|
|
2889
2889
|
}
|
|
2890
|
-
function
|
|
2890
|
+
function z(c) {
|
|
2891
2891
|
const h = C(c);
|
|
2892
2892
|
y.value.expandedKeys.has(h) ? (y.value.expandedKeys.delete(h), m("node-collapse", c, c, null)) : (y.value.expandedKeys.add(h), m("node-expand", c, c, null));
|
|
2893
2893
|
}
|
|
2894
|
-
function
|
|
2894
|
+
function R() {
|
|
2895
2895
|
const c = [];
|
|
2896
2896
|
function h(r) {
|
|
2897
2897
|
r.forEach((f) => {
|
|
2898
|
-
c.push(f),
|
|
2898
|
+
c.push(f), g(f) && h(b(f));
|
|
2899
2899
|
});
|
|
2900
2900
|
}
|
|
2901
2901
|
h(p.value);
|
|
2902
2902
|
function a(r) {
|
|
2903
|
-
if (
|
|
2904
|
-
const f =
|
|
2905
|
-
(P) =>
|
|
2903
|
+
if (g(r)) {
|
|
2904
|
+
const f = b(r), k = C(r), M = f.filter((P) => A(P)), B = f.filter(
|
|
2905
|
+
(P) => q(P)
|
|
2906
2906
|
);
|
|
2907
|
-
|
|
2907
|
+
M.length === f.length && B.length === 0 || M.length > 0 || B.length > 0 ? y.value.checkedKeys.add(k) : y.value.checkedKeys.delete(k);
|
|
2908
2908
|
}
|
|
2909
2909
|
}
|
|
2910
2910
|
for (let r = c.length - 1; r >= 0; r--)
|
|
2911
2911
|
a(c[r]);
|
|
2912
2912
|
}
|
|
2913
|
-
function
|
|
2913
|
+
function Y(c, h, a, r) {
|
|
2914
2914
|
if (n.disabled) return;
|
|
2915
2915
|
const f = r ? j(c, r) : !1;
|
|
2916
2916
|
if (n.enableChildStyleCustomClick && f) {
|
|
2917
2917
|
m("child-node-click", c, h, a);
|
|
2918
2918
|
return;
|
|
2919
2919
|
}
|
|
2920
|
-
if (n.expandOnClickNode &&
|
|
2921
|
-
|
|
2920
|
+
if (n.expandOnClickNode && g(c)) {
|
|
2921
|
+
z(c);
|
|
2922
2922
|
return;
|
|
2923
2923
|
}
|
|
2924
|
-
y.value.currentNode = c, y.value.currentKey = C(c), n.showCheckbox &&
|
|
2924
|
+
y.value.currentNode = c, y.value.currentKey = C(c), n.showCheckbox && J(c), m("node-click", c, h, a);
|
|
2925
2925
|
}
|
|
2926
|
-
function
|
|
2926
|
+
function ee(c, h, a, r) {
|
|
2927
2927
|
n.disabled || m("node-contextmenu", c, h, a, r);
|
|
2928
2928
|
}
|
|
2929
|
-
|
|
2929
|
+
oe(
|
|
2930
2930
|
() => n.defaultExpandedKeys,
|
|
2931
2931
|
(c) => {
|
|
2932
2932
|
if (c) {
|
|
2933
|
-
const h =
|
|
2933
|
+
const h = L.value;
|
|
2934
2934
|
if (h) {
|
|
2935
|
-
let a = function(
|
|
2936
|
-
for (const
|
|
2937
|
-
if (C(
|
|
2938
|
-
if (
|
|
2939
|
-
const ye = a(
|
|
2935
|
+
let a = function(M, B, P = 1) {
|
|
2936
|
+
for (const te of B) {
|
|
2937
|
+
if (C(te) === M) return P;
|
|
2938
|
+
if (g(te)) {
|
|
2939
|
+
const ye = a(M, b(te), P + 1);
|
|
2940
2940
|
if (ye > 0) return ye;
|
|
2941
2941
|
}
|
|
2942
2942
|
}
|
|
2943
2943
|
return 0;
|
|
2944
|
-
}, r = function(
|
|
2945
|
-
|
|
2946
|
-
|
|
2944
|
+
}, r = function(M, B, P) {
|
|
2945
|
+
M.forEach((te) => {
|
|
2946
|
+
B < P && g(te) ? (k.add(C(te)), r(b(te), B + 1, P)) : B < P && g(te);
|
|
2947
2947
|
});
|
|
2948
2948
|
};
|
|
2949
|
-
const f = (c || []).filter((
|
|
2950
|
-
const
|
|
2951
|
-
return
|
|
2949
|
+
const f = (c || []).filter((M) => {
|
|
2950
|
+
const B = a(M, p.value, 1);
|
|
2951
|
+
return B > 0 && B < h;
|
|
2952
2952
|
}), k = new Set(f);
|
|
2953
|
-
r(p.value, 1, h), y.value.expandedKeys.forEach((
|
|
2954
|
-
a(
|
|
2953
|
+
r(p.value, 1, h), y.value.expandedKeys.forEach((M) => {
|
|
2954
|
+
a(M, p.value, 1) >= h && k.add(M);
|
|
2955
2955
|
}), y.value.expandedKeys = k;
|
|
2956
2956
|
} else
|
|
2957
2957
|
y.value.expandedKeys = new Set(c);
|
|
@@ -2959,34 +2959,34 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2959
2959
|
},
|
|
2960
2960
|
{ immediate: !0 }
|
|
2961
2961
|
);
|
|
2962
|
-
function
|
|
2962
|
+
function X() {
|
|
2963
2963
|
if (n.defaultExpandAll) {
|
|
2964
2964
|
let c = function(r, f = 1) {
|
|
2965
2965
|
r.forEach((k) => {
|
|
2966
|
-
if (!
|
|
2967
|
-
const
|
|
2966
|
+
if (!g(k)) return;
|
|
2967
|
+
const M = b(k);
|
|
2968
2968
|
if (a) {
|
|
2969
2969
|
if (f >= a) return;
|
|
2970
|
-
f + 1 === a || h.add(C(k)), c(
|
|
2970
|
+
f + 1 === a || h.add(C(k)), c(M, f + 1);
|
|
2971
2971
|
} else
|
|
2972
|
-
h.add(C(k)), c(
|
|
2972
|
+
h.add(C(k)), c(M, f + 1);
|
|
2973
2973
|
});
|
|
2974
2974
|
};
|
|
2975
|
-
const h = /* @__PURE__ */ new Set(), a =
|
|
2975
|
+
const h = /* @__PURE__ */ new Set(), a = L.value;
|
|
2976
2976
|
c(p.value, 1), y.value.expandedKeys = h;
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2979
|
+
function ae() {
|
|
2980
2980
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
2981
2981
|
let c = function(f, k = []) {
|
|
2982
|
-
f.forEach((
|
|
2983
|
-
const
|
|
2984
|
-
h.has(
|
|
2982
|
+
f.forEach((M) => {
|
|
2983
|
+
const B = C(M), P = [...k, B];
|
|
2984
|
+
h.has(B) && k.forEach((te) => a.add(te)), g(M) && c(b(M), P);
|
|
2985
2985
|
});
|
|
2986
2986
|
};
|
|
2987
2987
|
const h = new Set(n.defaultCheckedKeys), a = /* @__PURE__ */ new Set();
|
|
2988
2988
|
c(p.value);
|
|
2989
|
-
const r =
|
|
2989
|
+
const r = L.value;
|
|
2990
2990
|
if (r) {
|
|
2991
2991
|
console.log(
|
|
2992
2992
|
`已启用从第${r}级开始不默认展开:保持当前展开状态不变`
|
|
@@ -2996,21 +2996,21 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2996
2996
|
y.value.expandedKeys = a;
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
-
|
|
2999
|
+
oe(() => n.defaultExpandAll, X, { immediate: !0 }), oe(() => p.value, X, { deep: !0 }), oe(
|
|
3000
3000
|
() => n.defaultCheckedKeys,
|
|
3001
3001
|
(c) => {
|
|
3002
|
-
c ? (y.value.checkedKeys = new Set(c), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") :
|
|
3002
|
+
c ? (y.value.checkedKeys = new Set(c), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : ae()) : y.value.checkedKeys.clear();
|
|
3003
3003
|
},
|
|
3004
3004
|
{ immediate: !0 }
|
|
3005
3005
|
);
|
|
3006
3006
|
function we(c) {
|
|
3007
3007
|
try {
|
|
3008
|
-
let h = function(f, k,
|
|
3009
|
-
for (const
|
|
3010
|
-
const P = C(
|
|
3011
|
-
if (P === k) return
|
|
3012
|
-
if (
|
|
3013
|
-
const ye = h(
|
|
3008
|
+
let h = function(f, k, M = []) {
|
|
3009
|
+
for (const B of f) {
|
|
3010
|
+
const P = C(B), te = [...M, P];
|
|
3011
|
+
if (P === k) return te;
|
|
3012
|
+
if (g(B)) {
|
|
3013
|
+
const ye = h(b(B), k, te);
|
|
3014
3014
|
if (ye) return ye;
|
|
3015
3015
|
}
|
|
3016
3016
|
}
|
|
@@ -3022,7 +3022,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3022
3022
|
const r = new Set(y.value.expandedKeys);
|
|
3023
3023
|
a.forEach((f) => {
|
|
3024
3024
|
const k = h(p.value, f);
|
|
3025
|
-
k && k.length > 0 && (k.slice(0, -1).forEach((
|
|
3025
|
+
k && k.length > 0 && (k.slice(0, -1).forEach((M) => r.add(M)), y.value.highlightedKeys.add(k[k.length - 1]));
|
|
3026
3026
|
}), y.value.expandedKeys = r;
|
|
3027
3027
|
} catch (h) {
|
|
3028
3028
|
console.warn("highlightAndExpandByIds 执行失败", h);
|
|
@@ -3031,34 +3031,34 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3031
3031
|
function N() {
|
|
3032
3032
|
y.value.highlightedKeys.clear();
|
|
3033
3033
|
}
|
|
3034
|
-
function
|
|
3034
|
+
function Z() {
|
|
3035
3035
|
y.value.currentNode = null, y.value.currentKey = null;
|
|
3036
3036
|
}
|
|
3037
|
-
return $({ highlightAndExpandByIds: we, clearHighlights: N, clearCurrentNode:
|
|
3037
|
+
return $({ highlightAndExpandByIds: we, clearHighlights: N, clearCurrentNode: Z }), oe(
|
|
3038
3038
|
() => n.defaultSelectedKeys,
|
|
3039
3039
|
(c) => {
|
|
3040
3040
|
c && (y.value.selectedKeys = new Set(c));
|
|
3041
3041
|
},
|
|
3042
3042
|
{ immediate: !0 }
|
|
3043
3043
|
), (c, h) => (i(), u("div", {
|
|
3044
|
-
class:
|
|
3044
|
+
class: K(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
3045
3045
|
}, [
|
|
3046
3046
|
o("div", Cl, [
|
|
3047
|
-
(i(!0), u(
|
|
3047
|
+
(i(!0), u(re, null, ve(p.value, (a) => (i(), u("div", {
|
|
3048
3048
|
key: C(a),
|
|
3049
|
-
class:
|
|
3049
|
+
class: K(["ytree-node", { "ytree-node--current": Q(a), "ytree-node--highlight": le(a) }])
|
|
3050
3050
|
}, [
|
|
3051
3051
|
o("div", {
|
|
3052
|
-
class:
|
|
3052
|
+
class: K(["ytree-node__content", { "is-child-style": j(a, a) }]),
|
|
3053
3053
|
style: { paddingLeft: "8px" },
|
|
3054
3054
|
"data-level": V(a, a),
|
|
3055
|
-
onClick: (r) =>
|
|
3056
|
-
onContextmenu: (r) =>
|
|
3055
|
+
onClick: (r) => Y(a, a, null, a),
|
|
3056
|
+
onContextmenu: (r) => ee(r, a, a, null)
|
|
3057
3057
|
}, [
|
|
3058
|
-
|
|
3058
|
+
g(a) ? (i(), u("span", {
|
|
3059
3059
|
key: 0,
|
|
3060
|
-
class:
|
|
3061
|
-
onClick:
|
|
3060
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": F(a) }]),
|
|
3061
|
+
onClick: G((r) => z(a), ["stop"])
|
|
3062
3062
|
}, [...h[0] || (h[0] = [
|
|
3063
3063
|
o("svg", {
|
|
3064
3064
|
width: "12",
|
|
@@ -3077,13 +3077,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3077
3077
|
])], 10, _l)) : (i(), u("span", Sl)),
|
|
3078
3078
|
e.showCheckbox ? (i(), u("span", {
|
|
3079
3079
|
key: 2,
|
|
3080
|
-
class:
|
|
3081
|
-
"is-checked":
|
|
3082
|
-
"is-indeterminate":
|
|
3080
|
+
class: K(["ytree-node__checkbox", {
|
|
3081
|
+
"is-checked": A(a),
|
|
3082
|
+
"is-indeterminate": q(a)
|
|
3083
3083
|
}]),
|
|
3084
|
-
onClick:
|
|
3084
|
+
onClick: G((r) => J(a), ["stop"])
|
|
3085
3085
|
}, [
|
|
3086
|
-
|
|
3086
|
+
A(a) ? (i(), u("svg", Ml, [...h[1] || (h[1] = [
|
|
3087
3087
|
o("path", {
|
|
3088
3088
|
d: "M2 6L4.5 8.5L10 3",
|
|
3089
3089
|
stroke: "currentColor",
|
|
@@ -3091,54 +3091,54 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3091
3091
|
"stroke-linecap": "round",
|
|
3092
3092
|
"stroke-linejoin": "round"
|
|
3093
3093
|
}, null, -1)
|
|
3094
|
-
])])) :
|
|
3094
|
+
])])) : q(a) ? (i(), u("svg", Il, [...h[2] || (h[2] = [
|
|
3095
3095
|
o("path", {
|
|
3096
3096
|
d: "M2 6L10 6",
|
|
3097
3097
|
stroke: "currentColor",
|
|
3098
3098
|
"stroke-width": "1.5",
|
|
3099
3099
|
"stroke-linecap": "round"
|
|
3100
3100
|
}, null, -1)
|
|
3101
|
-
])])) :
|
|
3102
|
-
], 10, Ll)) :
|
|
3101
|
+
])])) : H("", !0)
|
|
3102
|
+
], 10, Ll)) : H("", !0),
|
|
3103
3103
|
e.iconClass ? (i(), u("span", {
|
|
3104
3104
|
key: 3,
|
|
3105
|
-
class:
|
|
3106
|
-
}, null, 2)) :
|
|
3105
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3106
|
+
}, null, 2)) : H("", !0),
|
|
3107
3107
|
o("img", {
|
|
3108
3108
|
class: "ytree-node__avatar",
|
|
3109
|
-
src:
|
|
3110
|
-
alt:
|
|
3109
|
+
src: w(a, a),
|
|
3110
|
+
alt: x(a) ? "person" : "dept"
|
|
3111
3111
|
}, null, 8, El),
|
|
3112
3112
|
o("span", {
|
|
3113
|
-
class:
|
|
3114
|
-
},
|
|
3113
|
+
class: K(["ytree-node__label", { "is-employee": x(a) }])
|
|
3114
|
+
}, ne(I(a)), 3),
|
|
3115
3115
|
o("div", Bl, [
|
|
3116
|
-
|
|
3116
|
+
ce(c.$slots, "node-content", {
|
|
3117
3117
|
node: a,
|
|
3118
|
-
isCurrent:
|
|
3118
|
+
isCurrent: Q(a),
|
|
3119
3119
|
isExpanded: F(a),
|
|
3120
|
-
hasChildren:
|
|
3120
|
+
hasChildren: g(a)
|
|
3121
3121
|
}, void 0, !0)
|
|
3122
3122
|
])
|
|
3123
3123
|
], 42, Dl),
|
|
3124
|
-
|
|
3125
|
-
default:
|
|
3126
|
-
|
|
3127
|
-
(i(!0), u(
|
|
3124
|
+
de(be, { name: "ytree-node" }, {
|
|
3125
|
+
default: fe(() => [
|
|
3126
|
+
g(a) && F(a) ? (i(), u("div", Tl, [
|
|
3127
|
+
(i(!0), u(re, null, ve(b(a), (r) => (i(), u("div", {
|
|
3128
3128
|
key: C(r),
|
|
3129
|
-
class:
|
|
3129
|
+
class: K(["ytree-node", { "ytree-node--current": Q(r), "ytree-node--highlight": le(r) }])
|
|
3130
3130
|
}, [
|
|
3131
3131
|
o("div", {
|
|
3132
|
-
class:
|
|
3132
|
+
class: K(["ytree-node__content", { "is-child-style": j(r, a) }]),
|
|
3133
3133
|
style: { paddingLeft: "22px" },
|
|
3134
3134
|
"data-level": V(a, r),
|
|
3135
|
-
onClick: (f) =>
|
|
3136
|
-
onContextmenu: (f) =>
|
|
3135
|
+
onClick: (f) => Y(r, r, null, a),
|
|
3136
|
+
onContextmenu: (f) => ee(f, r, r, null)
|
|
3137
3137
|
}, [
|
|
3138
|
-
|
|
3138
|
+
g(r) ? (i(), u("span", {
|
|
3139
3139
|
key: 0,
|
|
3140
|
-
class:
|
|
3141
|
-
onClick:
|
|
3140
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": F(r) }]),
|
|
3141
|
+
onClick: G((f) => z(r), ["stop"])
|
|
3142
3142
|
}, [...h[3] || (h[3] = [
|
|
3143
3143
|
o("svg", {
|
|
3144
3144
|
width: "12",
|
|
@@ -3157,13 +3157,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3157
3157
|
])], 10, zl)) : (i(), u("span", Hl)),
|
|
3158
3158
|
e.showCheckbox ? (i(), u("span", {
|
|
3159
3159
|
key: 2,
|
|
3160
|
-
class:
|
|
3161
|
-
"is-checked":
|
|
3162
|
-
"is-indeterminate":
|
|
3160
|
+
class: K(["ytree-node__checkbox", {
|
|
3161
|
+
"is-checked": A(r),
|
|
3162
|
+
"is-indeterminate": q(r)
|
|
3163
3163
|
}]),
|
|
3164
|
-
onClick:
|
|
3164
|
+
onClick: G((f) => J(r), ["stop"])
|
|
3165
3165
|
}, [
|
|
3166
|
-
|
|
3166
|
+
A(r) ? (i(), u("svg", Vl, [...h[4] || (h[4] = [
|
|
3167
3167
|
o("path", {
|
|
3168
3168
|
d: "M2 6L4.5 8.5L10 3",
|
|
3169
3169
|
stroke: "currentColor",
|
|
@@ -3171,62 +3171,62 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3171
3171
|
"stroke-linecap": "round",
|
|
3172
3172
|
"stroke-linejoin": "round"
|
|
3173
3173
|
}, null, -1)
|
|
3174
|
-
])])) :
|
|
3174
|
+
])])) : q(r) ? (i(), u("svg", Wl, [...h[5] || (h[5] = [
|
|
3175
3175
|
o("path", {
|
|
3176
3176
|
d: "M2 6L10 6",
|
|
3177
3177
|
stroke: "currentColor",
|
|
3178
3178
|
"stroke-width": "1.5",
|
|
3179
3179
|
"stroke-linecap": "round"
|
|
3180
3180
|
}, null, -1)
|
|
3181
|
-
])])) :
|
|
3182
|
-
], 10, Rl)) :
|
|
3181
|
+
])])) : H("", !0)
|
|
3182
|
+
], 10, Rl)) : H("", !0),
|
|
3183
3183
|
e.iconClass ? (i(), u("span", {
|
|
3184
3184
|
key: 3,
|
|
3185
|
-
class:
|
|
3186
|
-
}, null, 2)) :
|
|
3185
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3186
|
+
}, null, 2)) : H("", !0),
|
|
3187
3187
|
o("img", {
|
|
3188
3188
|
class: "ytree-node__avatar",
|
|
3189
|
-
src:
|
|
3190
|
-
alt:
|
|
3189
|
+
src: w(r, a),
|
|
3190
|
+
alt: x(r) ? "person" : "dept"
|
|
3191
3191
|
}, null, 8, Al),
|
|
3192
3192
|
o("span", {
|
|
3193
|
-
class:
|
|
3194
|
-
},
|
|
3193
|
+
class: K(["ytree-node__label", { "is-employee": x(r) }])
|
|
3194
|
+
}, ne(I(r)), 3),
|
|
3195
3195
|
o("div", Fl, [
|
|
3196
|
-
|
|
3196
|
+
ce(c.$slots, "node-content", {
|
|
3197
3197
|
node: r,
|
|
3198
|
-
isCurrent:
|
|
3198
|
+
isCurrent: Q(r),
|
|
3199
3199
|
isExpanded: F(r),
|
|
3200
|
-
hasChildren:
|
|
3200
|
+
hasChildren: g(r)
|
|
3201
3201
|
}, void 0, !0)
|
|
3202
3202
|
])
|
|
3203
3203
|
], 42, Kl),
|
|
3204
|
-
|
|
3205
|
-
default:
|
|
3206
|
-
|
|
3207
|
-
(i(!0), u(
|
|
3204
|
+
de(be, { name: "ytree-node" }, {
|
|
3205
|
+
default: fe(() => [
|
|
3206
|
+
g(r) && F(r) ? (i(), u("div", Pl, [
|
|
3207
|
+
(i(!0), u(re, null, ve(b(r), (f) => (i(), u("div", {
|
|
3208
3208
|
key: C(f),
|
|
3209
|
-
class:
|
|
3210
|
-
"ytree-node--current":
|
|
3211
|
-
"ytree-node--highlight":
|
|
3209
|
+
class: K(["ytree-node", {
|
|
3210
|
+
"ytree-node--current": Q(f),
|
|
3211
|
+
"ytree-node--highlight": le(f)
|
|
3212
3212
|
}])
|
|
3213
3213
|
}, [
|
|
3214
3214
|
o("div", {
|
|
3215
|
-
class:
|
|
3215
|
+
class: K(["ytree-node__content", { "is-child-style": j(f, a) }]),
|
|
3216
3216
|
style: { paddingLeft: "38px" },
|
|
3217
3217
|
"data-level": V(a, f),
|
|
3218
|
-
onClick: (k) =>
|
|
3219
|
-
onContextmenu: (k) =>
|
|
3218
|
+
onClick: (k) => Y(f, f, null, a),
|
|
3219
|
+
onContextmenu: (k) => ee(
|
|
3220
3220
|
k,
|
|
3221
3221
|
f,
|
|
3222
3222
|
f,
|
|
3223
3223
|
null
|
|
3224
3224
|
)
|
|
3225
3225
|
}, [
|
|
3226
|
-
|
|
3226
|
+
g(f) ? (i(), u("span", {
|
|
3227
3227
|
key: 0,
|
|
3228
|
-
class:
|
|
3229
|
-
onClick:
|
|
3228
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": F(f) }]),
|
|
3229
|
+
onClick: G((k) => z(f), ["stop"])
|
|
3230
3230
|
}, [...h[6] || (h[6] = [
|
|
3231
3231
|
o("svg", {
|
|
3232
3232
|
width: "12",
|
|
@@ -3245,13 +3245,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3245
3245
|
])], 10, Nl)) : (i(), u("span", Ol)),
|
|
3246
3246
|
e.showCheckbox ? (i(), u("span", {
|
|
3247
3247
|
key: 2,
|
|
3248
|
-
class:
|
|
3249
|
-
"is-checked":
|
|
3250
|
-
"is-indeterminate":
|
|
3248
|
+
class: K(["ytree-node__checkbox", {
|
|
3249
|
+
"is-checked": A(f),
|
|
3250
|
+
"is-indeterminate": q(f)
|
|
3251
3251
|
}]),
|
|
3252
|
-
onClick:
|
|
3252
|
+
onClick: G((k) => J(f), ["stop"])
|
|
3253
3253
|
}, [
|
|
3254
|
-
|
|
3254
|
+
A(f) ? (i(), u("svg", ql, [...h[7] || (h[7] = [
|
|
3255
3255
|
o("path", {
|
|
3256
3256
|
d: "M2 6L4.5 8.5L10 3",
|
|
3257
3257
|
stroke: "currentColor",
|
|
@@ -3259,71 +3259,71 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3259
3259
|
"stroke-linecap": "round",
|
|
3260
3260
|
"stroke-linejoin": "round"
|
|
3261
3261
|
}, null, -1)
|
|
3262
|
-
])])) :
|
|
3262
|
+
])])) : q(f) ? (i(), u("svg", Ul, [...h[8] || (h[8] = [
|
|
3263
3263
|
o("path", {
|
|
3264
3264
|
d: "M2 6L10 6",
|
|
3265
3265
|
stroke: "currentColor",
|
|
3266
3266
|
"stroke-width": "1.5",
|
|
3267
3267
|
"stroke-linecap": "round"
|
|
3268
3268
|
}, null, -1)
|
|
3269
|
-
])])) :
|
|
3270
|
-
], 10, jl)) :
|
|
3269
|
+
])])) : H("", !0)
|
|
3270
|
+
], 10, jl)) : H("", !0),
|
|
3271
3271
|
e.iconClass ? (i(), u("span", {
|
|
3272
3272
|
key: 3,
|
|
3273
|
-
class:
|
|
3274
|
-
}, null, 2)) :
|
|
3273
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3274
|
+
}, null, 2)) : H("", !0),
|
|
3275
3275
|
o("img", {
|
|
3276
3276
|
class: "ytree-node__avatar",
|
|
3277
|
-
src:
|
|
3278
|
-
alt:
|
|
3277
|
+
src: w(f, a),
|
|
3278
|
+
alt: x(f) ? "person" : "dept"
|
|
3279
3279
|
}, null, 8, Zl),
|
|
3280
3280
|
o("span", {
|
|
3281
|
-
class:
|
|
3282
|
-
},
|
|
3281
|
+
class: K(["ytree-node__label", { "is-employee": x(f) }])
|
|
3282
|
+
}, ne(I(f)), 3),
|
|
3283
3283
|
o("div", Ql, [
|
|
3284
|
-
|
|
3284
|
+
ce(c.$slots, "node-content", {
|
|
3285
3285
|
node: f,
|
|
3286
|
-
isCurrent:
|
|
3286
|
+
isCurrent: Q(f),
|
|
3287
3287
|
isExpanded: F(f),
|
|
3288
|
-
hasChildren:
|
|
3288
|
+
hasChildren: g(f)
|
|
3289
3289
|
}, void 0, !0)
|
|
3290
3290
|
])
|
|
3291
3291
|
], 42, Yl),
|
|
3292
|
-
|
|
3293
|
-
default:
|
|
3294
|
-
|
|
3295
|
-
(i(!0), u(
|
|
3292
|
+
de(be, { name: "ytree-node" }, {
|
|
3293
|
+
default: fe(() => [
|
|
3294
|
+
g(f) && F(f) ? (i(), u("div", Jl, [
|
|
3295
|
+
(i(!0), u(re, null, ve(b(f), (k) => (i(), u("div", {
|
|
3296
3296
|
key: C(k),
|
|
3297
|
-
class:
|
|
3298
|
-
"ytree-node--current":
|
|
3299
|
-
"ytree-node--highlight":
|
|
3297
|
+
class: K(["ytree-node", {
|
|
3298
|
+
"ytree-node--current": Q(k),
|
|
3299
|
+
"ytree-node--highlight": le(k)
|
|
3300
3300
|
}])
|
|
3301
3301
|
}, [
|
|
3302
3302
|
o("div", {
|
|
3303
|
-
class:
|
|
3303
|
+
class: K(["ytree-node__content", { "is-child-style": j(k, a) }]),
|
|
3304
3304
|
style: {
|
|
3305
3305
|
paddingLeft: "54px"
|
|
3306
3306
|
},
|
|
3307
3307
|
"data-level": V(a, k),
|
|
3308
|
-
onClick: (
|
|
3308
|
+
onClick: (M) => Y(
|
|
3309
3309
|
k,
|
|
3310
3310
|
k,
|
|
3311
3311
|
null,
|
|
3312
3312
|
a
|
|
3313
3313
|
),
|
|
3314
|
-
onContextmenu: (
|
|
3315
|
-
|
|
3314
|
+
onContextmenu: (M) => ee(
|
|
3315
|
+
M,
|
|
3316
3316
|
k,
|
|
3317
3317
|
k,
|
|
3318
3318
|
null
|
|
3319
3319
|
)
|
|
3320
3320
|
}, [
|
|
3321
|
-
|
|
3321
|
+
g(k) ? (i(), u("span", {
|
|
3322
3322
|
key: 0,
|
|
3323
|
-
class:
|
|
3323
|
+
class: K(["ytree-node__expand-icon", {
|
|
3324
3324
|
"is-expanded": F(k)
|
|
3325
3325
|
}]),
|
|
3326
|
-
onClick:
|
|
3326
|
+
onClick: G((M) => z(k), ["stop"])
|
|
3327
3327
|
}, [...h[9] || (h[9] = [
|
|
3328
3328
|
o("svg", {
|
|
3329
3329
|
width: "12",
|
|
@@ -3342,13 +3342,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3342
3342
|
])], 10, Gl)) : (i(), u("span", eo)),
|
|
3343
3343
|
e.showCheckbox ? (i(), u("span", {
|
|
3344
3344
|
key: 2,
|
|
3345
|
-
class:
|
|
3346
|
-
"is-checked":
|
|
3347
|
-
"is-indeterminate":
|
|
3345
|
+
class: K(["ytree-node__checkbox", {
|
|
3346
|
+
"is-checked": A(k),
|
|
3347
|
+
"is-indeterminate": q(k)
|
|
3348
3348
|
}]),
|
|
3349
|
-
onClick:
|
|
3349
|
+
onClick: G((M) => J(k), ["stop"])
|
|
3350
3350
|
}, [
|
|
3351
|
-
|
|
3351
|
+
A(k) ? (i(), u("svg", no, [...h[10] || (h[10] = [
|
|
3352
3352
|
o("path", {
|
|
3353
3353
|
d: "M2 6L4.5 8.5L10 3",
|
|
3354
3354
|
stroke: "currentColor",
|
|
@@ -3356,74 +3356,74 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3356
3356
|
"stroke-linecap": "round",
|
|
3357
3357
|
"stroke-linejoin": "round"
|
|
3358
3358
|
}, null, -1)
|
|
3359
|
-
])])) :
|
|
3359
|
+
])])) : q(k) ? (i(), u("svg", lo, [...h[11] || (h[11] = [
|
|
3360
3360
|
o("path", {
|
|
3361
3361
|
d: "M2 6L10 6",
|
|
3362
3362
|
stroke: "currentColor",
|
|
3363
3363
|
"stroke-width": "1.5",
|
|
3364
3364
|
"stroke-linecap": "round"
|
|
3365
3365
|
}, null, -1)
|
|
3366
|
-
])])) :
|
|
3367
|
-
], 10, to)) :
|
|
3366
|
+
])])) : H("", !0)
|
|
3367
|
+
], 10, to)) : H("", !0),
|
|
3368
3368
|
e.iconClass ? (i(), u("span", {
|
|
3369
3369
|
key: 3,
|
|
3370
|
-
class:
|
|
3371
|
-
}, null, 2)) :
|
|
3370
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3371
|
+
}, null, 2)) : H("", !0),
|
|
3372
3372
|
o("img", {
|
|
3373
3373
|
class: "ytree-node__avatar",
|
|
3374
|
-
src:
|
|
3375
|
-
alt:
|
|
3374
|
+
src: w(k, a),
|
|
3375
|
+
alt: x(k) ? "person" : "dept"
|
|
3376
3376
|
}, null, 8, oo),
|
|
3377
3377
|
o("span", {
|
|
3378
|
-
class:
|
|
3379
|
-
"is-employee":
|
|
3378
|
+
class: K(["ytree-node__label", {
|
|
3379
|
+
"is-employee": x(k)
|
|
3380
3380
|
}])
|
|
3381
|
-
},
|
|
3381
|
+
}, ne(I(k)), 3),
|
|
3382
3382
|
o("div", ao, [
|
|
3383
|
-
|
|
3383
|
+
ce(c.$slots, "node-content", {
|
|
3384
3384
|
node: k,
|
|
3385
|
-
isCurrent:
|
|
3385
|
+
isCurrent: Q(k),
|
|
3386
3386
|
isExpanded: F(k),
|
|
3387
|
-
hasChildren:
|
|
3387
|
+
hasChildren: g(k)
|
|
3388
3388
|
}, void 0, !0)
|
|
3389
3389
|
])
|
|
3390
3390
|
], 42, Xl),
|
|
3391
|
-
|
|
3392
|
-
default:
|
|
3393
|
-
|
|
3394
|
-
(i(!0), u(
|
|
3391
|
+
de(be, { name: "ytree-node" }, {
|
|
3392
|
+
default: fe(() => [
|
|
3393
|
+
g(k) && F(k) ? (i(), u("div", so, [
|
|
3394
|
+
(i(!0), u(re, null, ve(b(
|
|
3395
3395
|
k
|
|
3396
|
-
), (
|
|
3397
|
-
key: C(
|
|
3398
|
-
class:
|
|
3399
|
-
"ytree-node--current":
|
|
3396
|
+
), (M) => (i(), u("div", {
|
|
3397
|
+
key: C(M),
|
|
3398
|
+
class: K(["ytree-node", {
|
|
3399
|
+
"ytree-node--current": Q(M)
|
|
3400
3400
|
}])
|
|
3401
3401
|
}, [
|
|
3402
3402
|
o("div", {
|
|
3403
|
-
class:
|
|
3403
|
+
class: K(["ytree-node__content", { "is-child-style": j(M, a) }]),
|
|
3404
3404
|
style: {
|
|
3405
3405
|
paddingLeft: "70px"
|
|
3406
3406
|
},
|
|
3407
|
-
"data-level": V(a,
|
|
3408
|
-
onClick: (
|
|
3409
|
-
|
|
3410
|
-
|
|
3407
|
+
"data-level": V(a, M),
|
|
3408
|
+
onClick: (B) => Y(
|
|
3409
|
+
M,
|
|
3410
|
+
M,
|
|
3411
3411
|
null,
|
|
3412
3412
|
a
|
|
3413
3413
|
),
|
|
3414
|
-
onContextmenu: (
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3414
|
+
onContextmenu: (B) => ee(
|
|
3415
|
+
B,
|
|
3416
|
+
M,
|
|
3417
|
+
M,
|
|
3418
3418
|
null
|
|
3419
3419
|
)
|
|
3420
3420
|
}, [
|
|
3421
|
-
|
|
3421
|
+
g(M) ? (i(), u("span", {
|
|
3422
3422
|
key: 0,
|
|
3423
|
-
class:
|
|
3424
|
-
"is-expanded": F(
|
|
3423
|
+
class: K(["ytree-node__expand-icon", {
|
|
3424
|
+
"is-expanded": F(M)
|
|
3425
3425
|
}]),
|
|
3426
|
-
onClick:
|
|
3426
|
+
onClick: G((B) => z(M), ["stop"])
|
|
3427
3427
|
}, [...h[12] || (h[12] = [
|
|
3428
3428
|
o("svg", {
|
|
3429
3429
|
width: "12",
|
|
@@ -3442,15 +3442,15 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3442
3442
|
])], 10, ro)) : (i(), u("span", uo)),
|
|
3443
3443
|
e.showCheckbox ? (i(), u("span", {
|
|
3444
3444
|
key: 2,
|
|
3445
|
-
class:
|
|
3446
|
-
"is-checked":
|
|
3447
|
-
"is-indeterminate":
|
|
3448
|
-
|
|
3445
|
+
class: K(["ytree-node__checkbox", {
|
|
3446
|
+
"is-checked": A(M),
|
|
3447
|
+
"is-indeterminate": q(
|
|
3448
|
+
M
|
|
3449
3449
|
)
|
|
3450
3450
|
}]),
|
|
3451
|
-
onClick:
|
|
3451
|
+
onClick: G((B) => J(M), ["stop"])
|
|
3452
3452
|
}, [
|
|
3453
|
-
|
|
3453
|
+
A(M) ? (i(), u("svg", fo, [...h[13] || (h[13] = [
|
|
3454
3454
|
o("path", {
|
|
3455
3455
|
d: "M2 6L4.5 8.5L10 3",
|
|
3456
3456
|
stroke: "currentColor",
|
|
@@ -3458,8 +3458,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3458
3458
|
"stroke-linecap": "round",
|
|
3459
3459
|
"stroke-linejoin": "round"
|
|
3460
3460
|
}, null, -1)
|
|
3461
|
-
])])) :
|
|
3462
|
-
|
|
3461
|
+
])])) : q(
|
|
3462
|
+
M
|
|
3463
3463
|
) ? (i(), u("svg", vo, [...h[14] || (h[14] = [
|
|
3464
3464
|
o("path", {
|
|
3465
3465
|
d: "M2 6L10 6",
|
|
@@ -3467,48 +3467,48 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3467
3467
|
"stroke-width": "1.5",
|
|
3468
3468
|
"stroke-linecap": "round"
|
|
3469
3469
|
}, null, -1)
|
|
3470
|
-
])])) :
|
|
3471
|
-
], 10, co)) :
|
|
3470
|
+
])])) : H("", !0)
|
|
3471
|
+
], 10, co)) : H("", !0),
|
|
3472
3472
|
e.iconClass ? (i(), u("span", {
|
|
3473
3473
|
key: 3,
|
|
3474
|
-
class:
|
|
3475
|
-
}, null, 2)) :
|
|
3474
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3475
|
+
}, null, 2)) : H("", !0),
|
|
3476
3476
|
o("img", {
|
|
3477
3477
|
class: "ytree-node__avatar",
|
|
3478
|
-
src:
|
|
3479
|
-
alt:
|
|
3478
|
+
src: w(M, a),
|
|
3479
|
+
alt: x(M) ? "person" : "dept"
|
|
3480
3480
|
}, null, 8, ho),
|
|
3481
3481
|
o("span", {
|
|
3482
|
-
class:
|
|
3483
|
-
"is-employee":
|
|
3482
|
+
class: K(["ytree-node__label", {
|
|
3483
|
+
"is-employee": x(M)
|
|
3484
3484
|
}])
|
|
3485
|
-
},
|
|
3485
|
+
}, ne(I(M)), 3),
|
|
3486
3486
|
o("div", po, [
|
|
3487
|
-
|
|
3488
|
-
node:
|
|
3489
|
-
isCurrent:
|
|
3490
|
-
isExpanded: F(
|
|
3491
|
-
hasChildren:
|
|
3487
|
+
ce(c.$slots, "node-content", {
|
|
3488
|
+
node: M,
|
|
3489
|
+
isCurrent: Q(M),
|
|
3490
|
+
isExpanded: F(M),
|
|
3491
|
+
hasChildren: g(M)
|
|
3492
3492
|
}, void 0, !0)
|
|
3493
3493
|
])
|
|
3494
3494
|
], 42, io)
|
|
3495
3495
|
], 2))), 128))
|
|
3496
|
-
])) :
|
|
3496
|
+
])) : H("", !0)
|
|
3497
3497
|
]),
|
|
3498
3498
|
_: 2
|
|
3499
3499
|
}, 1024)
|
|
3500
3500
|
], 2))), 128))
|
|
3501
|
-
])) :
|
|
3501
|
+
])) : H("", !0)
|
|
3502
3502
|
]),
|
|
3503
3503
|
_: 2
|
|
3504
3504
|
}, 1024)
|
|
3505
3505
|
], 2))), 128))
|
|
3506
|
-
])) :
|
|
3506
|
+
])) : H("", !0)
|
|
3507
3507
|
]),
|
|
3508
3508
|
_: 2
|
|
3509
3509
|
}, 1024)
|
|
3510
3510
|
], 2))), 128))
|
|
3511
|
-
])) :
|
|
3511
|
+
])) : H("", !0)
|
|
3512
3512
|
]),
|
|
3513
3513
|
_: 2
|
|
3514
3514
|
}, 1024)
|
|
@@ -3533,167 +3533,176 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3533
3533
|
},
|
|
3534
3534
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3535
3535
|
setup(e, { emit: $ }) {
|
|
3536
|
-
const t = e, n = $, m =
|
|
3537
|
-
|
|
3538
|
-
|
|
3536
|
+
const t = e, n = $, m = E(!1), p = st({}), y = ["select", "date", "daterange"];
|
|
3537
|
+
let L;
|
|
3538
|
+
const C = O(() => t.fields.filter((W) => !W.hidden)), I = O(() => m.value ? C.value : C.value.slice(0, t.maxVisibleFields)), x = O(() => C.value.length > t.maxVisibleFields);
|
|
3539
|
+
function w(W) {
|
|
3540
|
+
switch (W) {
|
|
3539
3541
|
case "select":
|
|
3540
|
-
return
|
|
3542
|
+
return tt;
|
|
3541
3543
|
case "date":
|
|
3542
3544
|
case "daterange":
|
|
3543
|
-
return
|
|
3545
|
+
return nt;
|
|
3544
3546
|
case "input":
|
|
3545
3547
|
default:
|
|
3546
|
-
return
|
|
3548
|
+
return et;
|
|
3547
3549
|
}
|
|
3548
3550
|
}
|
|
3549
|
-
function
|
|
3550
|
-
n("field-change",
|
|
3551
|
+
function g(W) {
|
|
3552
|
+
n("field-change", W, p[W.key]), n("update:modelValue", { ...p }), y.includes(W.type) && q();
|
|
3551
3553
|
}
|
|
3552
|
-
function
|
|
3553
|
-
const
|
|
3554
|
-
n("search", { data:
|
|
3554
|
+
function b() {
|
|
3555
|
+
const W = Q(p), z = le(W), R = { ...p };
|
|
3556
|
+
n("search", { data: z, raw: R });
|
|
3555
3557
|
}
|
|
3556
|
-
function
|
|
3557
|
-
Object.keys(p).forEach((
|
|
3558
|
-
const
|
|
3559
|
-
(
|
|
3558
|
+
function V() {
|
|
3559
|
+
Object.keys(p).forEach((W) => {
|
|
3560
|
+
const z = t.fields.find((R) => R.key === W);
|
|
3561
|
+
(z == null ? void 0 : z.type) === "daterange" ? p[W] = { startDate: null, endDate: null } : (z == null ? void 0 : z.type) === "date" ? p[W] = null : p[W] = "";
|
|
3560
3562
|
}), n("reset"), n("update:modelValue", { ...p });
|
|
3561
3563
|
}
|
|
3562
|
-
function
|
|
3564
|
+
function j() {
|
|
3563
3565
|
m.value = !m.value;
|
|
3564
3566
|
}
|
|
3565
|
-
function
|
|
3566
|
-
return
|
|
3567
|
-
enter: () =>
|
|
3568
|
-
paste: () =>
|
|
3567
|
+
function F(W) {
|
|
3568
|
+
return W.type !== "input" ? {} : {
|
|
3569
|
+
enter: () => A(),
|
|
3570
|
+
paste: () => A()
|
|
3569
3571
|
};
|
|
3570
3572
|
}
|
|
3571
|
-
async function
|
|
3572
|
-
await
|
|
3573
|
+
async function A() {
|
|
3574
|
+
await se(), b();
|
|
3573
3575
|
}
|
|
3574
|
-
function
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3576
|
+
function q() {
|
|
3577
|
+
L && clearTimeout(L), L = setTimeout(() => {
|
|
3578
|
+
L = void 0, se().then(() => b());
|
|
3579
|
+
}, 0);
|
|
3580
|
+
}
|
|
3581
|
+
function Q(W) {
|
|
3582
|
+
const z = {};
|
|
3583
|
+
return Object.keys(W).forEach((R) => {
|
|
3584
|
+
const Y = t.fields.find((ae) => ae.key === R), ee = W[R], X = typeof ee == "string" ? ee.trim() : ee;
|
|
3585
|
+
if (!(X == null || X === "")) {
|
|
3586
|
+
if (typeof X == "object" && X.startDate && X.endDate) {
|
|
3587
|
+
X.startDate && X.endDate && (z[R] = X);
|
|
3581
3588
|
return;
|
|
3582
3589
|
}
|
|
3583
3590
|
if (Y && (Y.type === "date" || Y.type === "daterange")) {
|
|
3584
|
-
|
|
3591
|
+
X !== 0 && (z[R] = X);
|
|
3585
3592
|
return;
|
|
3586
3593
|
}
|
|
3587
|
-
|
|
3594
|
+
z[R] = X;
|
|
3588
3595
|
}
|
|
3589
|
-
}),
|
|
3590
|
-
}
|
|
3591
|
-
function W
|
|
3592
|
-
const
|
|
3593
|
-
return Object.keys(
|
|
3594
|
-
const Y =
|
|
3595
|
-
if (
|
|
3596
|
-
if (
|
|
3597
|
-
const
|
|
3598
|
-
Y.startDate && Y.endDate && Y.startDate !== 0 && Y.endDate !== 0 && (
|
|
3599
|
-
} else
|
|
3596
|
+
}), z;
|
|
3597
|
+
}
|
|
3598
|
+
function le(W) {
|
|
3599
|
+
const z = {};
|
|
3600
|
+
return Object.keys(W).forEach((R) => {
|
|
3601
|
+
const Y = W[R], ee = t.fields.find((X) => X.key === R);
|
|
3602
|
+
if (ee)
|
|
3603
|
+
if (ee.type === "daterange" && typeof Y == "object") {
|
|
3604
|
+
const X = ee.startKey || `${R}Start`, ae = ee.endKey || `${R}End`;
|
|
3605
|
+
Y.startDate && Y.endDate && Y.startDate !== 0 && Y.endDate !== 0 && (ee.format === "timestamp" ? (z[X] = new Date(Y.startDate).getTime(), z[ae] = new Date(Y.endDate).getTime()) : (z[X] = Y.startDate, z[ae] = Y.endDate));
|
|
3606
|
+
} else ee.type === "date" && Y && Y !== 0 && ee.format === "timestamp" ? z[R] = new Date(Y).getTime() : z[R] = Y;
|
|
3600
3607
|
else
|
|
3601
|
-
|
|
3602
|
-
}),
|
|
3608
|
+
z[R] = Y;
|
|
3609
|
+
}), z;
|
|
3603
3610
|
}
|
|
3604
|
-
function
|
|
3605
|
-
t.fields.forEach((
|
|
3606
|
-
var
|
|
3607
|
-
p[
|
|
3611
|
+
function J() {
|
|
3612
|
+
t.fields.forEach((W) => {
|
|
3613
|
+
var z, R, Y;
|
|
3614
|
+
p[W.key] === void 0 && (W.type === "daterange" ? p[W.key] = ((z = t.modelValue) == null ? void 0 : z[W.key]) || {
|
|
3608
3615
|
startDate: null,
|
|
3609
3616
|
endDate: null
|
|
3610
|
-
} :
|
|
3617
|
+
} : W.type === "date" ? p[W.key] = ((R = t.modelValue) == null ? void 0 : R[W.key]) || null : p[W.key] = ((Y = t.modelValue) == null ? void 0 : Y[W.key]) || "");
|
|
3611
3618
|
});
|
|
3612
3619
|
}
|
|
3613
|
-
return
|
|
3620
|
+
return oe(
|
|
3614
3621
|
() => t.modelValue,
|
|
3615
|
-
(
|
|
3616
|
-
|
|
3622
|
+
(W) => {
|
|
3623
|
+
W && Object.assign(p, W);
|
|
3617
3624
|
},
|
|
3618
3625
|
{ deep: !0, immediate: !0 }
|
|
3619
3626
|
), $e(() => {
|
|
3620
|
-
|
|
3621
|
-
}), (
|
|
3627
|
+
J();
|
|
3628
|
+
}), Xe(() => {
|
|
3629
|
+
L && (clearTimeout(L), L = void 0);
|
|
3630
|
+
}), (W, z) => (i(), u("div", ko, [
|
|
3622
3631
|
o("div", bo, [
|
|
3623
3632
|
o("div", xo, [
|
|
3624
3633
|
o("div", $o, [
|
|
3625
|
-
|
|
3634
|
+
de(it, {
|
|
3626
3635
|
name: "qf",
|
|
3627
3636
|
tag: "div",
|
|
3628
3637
|
class: "query-encapsulation__fields-group"
|
|
3629
3638
|
}, {
|
|
3630
|
-
default:
|
|
3631
|
-
(i(!0), u(
|
|
3632
|
-
key:
|
|
3639
|
+
default: fe(() => [
|
|
3640
|
+
(i(!0), u(re, null, ve(I.value, (R) => (i(), u("div", {
|
|
3641
|
+
key: R.key,
|
|
3633
3642
|
class: "query-encapsulation__field-item"
|
|
3634
3643
|
}, [
|
|
3635
3644
|
o("div", Co, [
|
|
3636
|
-
e.Iflabel ? (i(), u("label", Do,
|
|
3637
|
-
(i(), Se(
|
|
3638
|
-
modelValue: p[
|
|
3639
|
-
"onUpdate:modelValue": (Y) => p[
|
|
3640
|
-
placeholder:
|
|
3641
|
-
options:
|
|
3642
|
-
clearable:
|
|
3643
|
-
size:
|
|
3644
|
-
width:
|
|
3645
|
-
format:
|
|
3646
|
-
"include-time":
|
|
3647
|
-
filterable:
|
|
3648
|
-
},
|
|
3649
|
-
onInput: (Y) =>
|
|
3650
|
-
onChange: (Y) =>
|
|
3645
|
+
e.Iflabel ? (i(), u("label", Do, ne(R.label), 1)) : H("", !0),
|
|
3646
|
+
(i(), Se(rt(w(R.type)), ut({
|
|
3647
|
+
modelValue: p[R.key],
|
|
3648
|
+
"onUpdate:modelValue": (Y) => p[R.key] = Y,
|
|
3649
|
+
placeholder: R.placeholder || `请输入${R.label}`,
|
|
3650
|
+
options: R.options,
|
|
3651
|
+
clearable: R.clearable !== !1,
|
|
3652
|
+
size: R.size || "small",
|
|
3653
|
+
width: R.width || "180px",
|
|
3654
|
+
format: R.format || "timestamp",
|
|
3655
|
+
"include-time": R.includeTime || !1,
|
|
3656
|
+
filterable: R.filterable === !0
|
|
3657
|
+
}, ct(F(R)), {
|
|
3658
|
+
onInput: (Y) => g(R),
|
|
3659
|
+
onChange: (Y) => g(R)
|
|
3651
3660
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3652
3661
|
])
|
|
3653
3662
|
]))), 128))
|
|
3654
3663
|
]),
|
|
3655
3664
|
_: 1
|
|
3656
3665
|
}),
|
|
3657
|
-
|
|
3658
|
-
|
|
3666
|
+
x.value ? (i(), u("div", _o, [
|
|
3667
|
+
de(Ne, {
|
|
3659
3668
|
variant: "secondary",
|
|
3660
3669
|
size: "small",
|
|
3661
|
-
onClick:
|
|
3670
|
+
onClick: j
|
|
3662
3671
|
}, {
|
|
3663
|
-
default:
|
|
3664
|
-
xe(
|
|
3672
|
+
default: fe(() => [
|
|
3673
|
+
xe(ne(m.value ? "收起" : "展开") + " ", 1),
|
|
3665
3674
|
o("span", {
|
|
3666
|
-
class:
|
|
3675
|
+
class: K(["query-encapsulation__toggle-icon", { "is-expanded": m.value }])
|
|
3667
3676
|
}, "▼", 2)
|
|
3668
3677
|
]),
|
|
3669
3678
|
_: 1
|
|
3670
3679
|
})
|
|
3671
|
-
])) :
|
|
3680
|
+
])) : H("", !0),
|
|
3672
3681
|
o("div", So, [
|
|
3673
3682
|
o("div", Lo, [
|
|
3674
|
-
|
|
3683
|
+
de(Ne, {
|
|
3675
3684
|
variant: "primary",
|
|
3676
3685
|
size: "small",
|
|
3677
|
-
onClick:
|
|
3686
|
+
onClick: b,
|
|
3678
3687
|
loading: e.loading
|
|
3679
3688
|
}, {
|
|
3680
|
-
default:
|
|
3689
|
+
default: fe(() => [...z[0] || (z[0] = [
|
|
3681
3690
|
xe(" 搜索 ", -1)
|
|
3682
3691
|
])]),
|
|
3683
3692
|
_: 1
|
|
3684
3693
|
}, 8, ["loading"]),
|
|
3685
|
-
|
|
3694
|
+
de(Ne, {
|
|
3686
3695
|
variant: "secondary",
|
|
3687
3696
|
size: "small",
|
|
3688
|
-
onClick:
|
|
3697
|
+
onClick: V,
|
|
3689
3698
|
loading: e.loading
|
|
3690
3699
|
}, {
|
|
3691
|
-
default:
|
|
3700
|
+
default: fe(() => [...z[1] || (z[1] = [
|
|
3692
3701
|
xe(" 重置 ", -1)
|
|
3693
3702
|
])]),
|
|
3694
3703
|
_: 1
|
|
3695
3704
|
}, 8, ["loading"]),
|
|
3696
|
-
|
|
3705
|
+
ce(W.$slots, "extra-actions", {}, void 0, !0)
|
|
3697
3706
|
])
|
|
3698
3707
|
])
|
|
3699
3708
|
])
|
|
@@ -3701,7 +3710,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3701
3710
|
])
|
|
3702
3711
|
]));
|
|
3703
3712
|
}
|
|
3704
|
-
}), Io = /* @__PURE__ */ me(Mo, [["__scopeId", "data-v-
|
|
3713
|
+
}), Io = /* @__PURE__ */ me(Mo, [["__scopeId", "data-v-61f05ecd"]]), Eo = {
|
|
3705
3714
|
key: 0,
|
|
3706
3715
|
width: "16",
|
|
3707
3716
|
height: "16",
|
|
@@ -3732,13 +3741,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3732
3741
|
onClose: {}
|
|
3733
3742
|
},
|
|
3734
3743
|
setup(e) {
|
|
3735
|
-
const $ = e, t =
|
|
3744
|
+
const $ = e, t = E(!1);
|
|
3736
3745
|
let n;
|
|
3737
3746
|
$e(() => {
|
|
3738
3747
|
requestAnimationFrame(() => {
|
|
3739
3748
|
t.value = !0, $.duration && $.duration > 0 && (n = window.setTimeout(() => m(), $.duration));
|
|
3740
3749
|
});
|
|
3741
|
-
}),
|
|
3750
|
+
}), Xe(() => {
|
|
3742
3751
|
n && window.clearTimeout(n);
|
|
3743
3752
|
});
|
|
3744
3753
|
function m() {
|
|
@@ -3748,22 +3757,22 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3748
3757
|
var y;
|
|
3749
3758
|
(y = $.onClose) == null || y.call($, $.id);
|
|
3750
3759
|
}
|
|
3751
|
-
return (y,
|
|
3760
|
+
return (y, L) => (i(), Se(be, {
|
|
3752
3761
|
name: "y-msg-fade",
|
|
3753
3762
|
onAfterLeave: p
|
|
3754
3763
|
}, {
|
|
3755
|
-
default:
|
|
3764
|
+
default: fe(() => [
|
|
3756
3765
|
Ee(o("div", {
|
|
3757
|
-
class:
|
|
3758
|
-
style:
|
|
3766
|
+
class: K(["y-msg", [`y-msg--${e.type}`]]),
|
|
3767
|
+
style: ue({ zIndex: e.zIndex }),
|
|
3759
3768
|
role: "status",
|
|
3760
3769
|
"aria-live": "polite"
|
|
3761
3770
|
}, [
|
|
3762
3771
|
o("span", {
|
|
3763
|
-
class:
|
|
3772
|
+
class: K(["y-msg__icon", `y-msg__icon--${e.type}`]),
|
|
3764
3773
|
"aria-hidden": "true"
|
|
3765
3774
|
}, [
|
|
3766
|
-
e.type === "success" ? (i(), u("svg", Eo, [...
|
|
3775
|
+
e.type === "success" ? (i(), u("svg", Eo, [...L[0] || (L[0] = [
|
|
3767
3776
|
o("path", {
|
|
3768
3777
|
d: "M20 6L9 17l-5-5",
|
|
3769
3778
|
stroke: "currentColor",
|
|
@@ -3771,7 +3780,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3771
3780
|
"stroke-linecap": "round",
|
|
3772
3781
|
"stroke-linejoin": "round"
|
|
3773
3782
|
}, null, -1)
|
|
3774
|
-
])])) : e.type === "warning" ? (i(), u("svg", Bo, [...
|
|
3783
|
+
])])) : e.type === "warning" ? (i(), u("svg", Bo, [...L[1] || (L[1] = [
|
|
3775
3784
|
o("path", {
|
|
3776
3785
|
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",
|
|
3777
3786
|
stroke: "currentColor",
|
|
@@ -3779,7 +3788,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3779
3788
|
"stroke-linecap": "round",
|
|
3780
3789
|
"stroke-linejoin": "round"
|
|
3781
3790
|
}, null, -1)
|
|
3782
|
-
])])) : (i(), u("svg", To, [...
|
|
3791
|
+
])])) : (i(), u("svg", To, [...L[2] || (L[2] = [
|
|
3783
3792
|
o("path", {
|
|
3784
3793
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3785
3794
|
stroke: "currentColor",
|
|
@@ -3791,14 +3800,14 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3791
3800
|
], 2),
|
|
3792
3801
|
o("div", {
|
|
3793
3802
|
class: "y-msg__content",
|
|
3794
|
-
textContent:
|
|
3803
|
+
textContent: ne(e.message)
|
|
3795
3804
|
}, null, 8, Ko),
|
|
3796
3805
|
e.closable ? (i(), u("button", {
|
|
3797
3806
|
key: 0,
|
|
3798
3807
|
class: "y-msg__close",
|
|
3799
3808
|
type: "button",
|
|
3800
3809
|
onClick: m
|
|
3801
|
-
}, "✕")) :
|
|
3810
|
+
}, "✕")) : H("", !0)
|
|
3802
3811
|
], 6), [
|
|
3803
3812
|
[ze, t.value]
|
|
3804
3813
|
])
|
|
@@ -3824,7 +3833,7 @@ function Qe(e) {
|
|
|
3824
3833
|
n.style.top = p, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3825
3834
|
}
|
|
3826
3835
|
_e[$].leaving = !0, je(), setTimeout(() => {
|
|
3827
|
-
|
|
3836
|
+
Ge(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3828
3837
|
const p = _e.findIndex((y) => y.id === e);
|
|
3829
3838
|
p !== -1 && _e.splice(p, 1), je();
|
|
3830
3839
|
}, 260);
|
|
@@ -3833,7 +3842,7 @@ function qe(e) {
|
|
|
3833
3842
|
var p;
|
|
3834
3843
|
const $ = Ro++, t = document.createElement("div");
|
|
3835
3844
|
document.body.appendChild(t);
|
|
3836
|
-
const n =
|
|
3845
|
+
const n = de(Ho, {
|
|
3837
3846
|
id: $,
|
|
3838
3847
|
type: e.type || "success",
|
|
3839
3848
|
message: e.message,
|
|
@@ -3843,13 +3852,13 @@ function qe(e) {
|
|
|
3843
3852
|
closable: e.closable ?? !1,
|
|
3844
3853
|
onClose: (y) => Qe(y)
|
|
3845
3854
|
});
|
|
3846
|
-
|
|
3855
|
+
Ge(n, t);
|
|
3847
3856
|
const m = ((p = t.firstElementChild) == null ? void 0 : p.offsetHeight) || 0;
|
|
3848
3857
|
return _e.push({ id: $, el: t, vm: n, height: m, leaving: !1 }), je(), requestAnimationFrame(() => {
|
|
3849
3858
|
const y = t.firstElementChild;
|
|
3850
3859
|
if (!y) return;
|
|
3851
|
-
const
|
|
3852
|
-
C && (C.height =
|
|
3860
|
+
const L = y.offsetHeight || m || 0, C = _e.find((I) => I.id === $);
|
|
3861
|
+
C && (C.height = L, je());
|
|
3853
3862
|
}), { close: () => Qe($) };
|
|
3854
3863
|
}
|
|
3855
3864
|
const Oe = {
|
|
@@ -3880,14 +3889,14 @@ function je() {
|
|
|
3880
3889
|
}
|
|
3881
3890
|
const Je = {
|
|
3882
3891
|
YButton: Ne,
|
|
3883
|
-
YInput:
|
|
3892
|
+
YInput: et,
|
|
3884
3893
|
YTable: Pt,
|
|
3885
|
-
YSelect:
|
|
3894
|
+
YSelect: tt,
|
|
3886
3895
|
YPagination: Gt,
|
|
3887
3896
|
YBadge: hn,
|
|
3888
3897
|
YDialog: xn,
|
|
3889
3898
|
YPopover: Dn,
|
|
3890
|
-
YTime:
|
|
3899
|
+
YTime: nt,
|
|
3891
3900
|
YSwitch: ul,
|
|
3892
3901
|
YImage: vl,
|
|
3893
3902
|
YDropdown: pl,
|
|
@@ -3909,14 +3918,14 @@ export {
|
|
|
3909
3918
|
$l as YDrawer,
|
|
3910
3919
|
pl as YDropdown,
|
|
3911
3920
|
vl as YImage,
|
|
3912
|
-
|
|
3921
|
+
et as YInput,
|
|
3913
3922
|
Oe as YMessage,
|
|
3914
3923
|
Gt as YPagination,
|
|
3915
3924
|
Dn as YPopover,
|
|
3916
|
-
|
|
3925
|
+
tt as YSelect,
|
|
3917
3926
|
ul as YSwitch,
|
|
3918
3927
|
Pt as YTable,
|
|
3919
|
-
|
|
3928
|
+
nt as YTime,
|
|
3920
3929
|
wo as YTree,
|
|
3921
3930
|
Fo as default
|
|
3922
3931
|
};
|