@nhdropshipping/y-components 1.0.50 → 1.0.51
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/yimage.vue.d.ts +0 -4
- package/dist/components/yimage.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 +1270 -1280
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as 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",
|
|
@@ -15,7 +15,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
15
15
|
viewBox: "0 0 20 20",
|
|
16
16
|
fill: "currentColor",
|
|
17
17
|
"aria-hidden": "true"
|
|
18
|
-
}, mt = { key: 2 }, wt = /* @__PURE__ */
|
|
18
|
+
}, mt = { key: 2 }, wt = /* @__PURE__ */ ge({
|
|
19
19
|
__name: "ybutton",
|
|
20
20
|
props: {
|
|
21
21
|
htmlType: { default: "button" },
|
|
@@ -37,7 +37,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
37
37
|
}
|
|
38
38
|
n("click", C);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const p = O(() => {
|
|
41
41
|
switch (t.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,7 +48,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
51
|
+
}), y = O(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
52
|
function L(C, I) {
|
|
53
53
|
if (t.disabled || t.loading || C.disabled || C.loading) {
|
|
54
54
|
I.preventDefault(), I.stopPropagation();
|
|
@@ -56,12 +56,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
56
56
|
}
|
|
57
57
|
n("group-click", C.value, I);
|
|
58
58
|
}
|
|
59
|
-
return (C, I) =>
|
|
60
|
-
(i(!0), u(
|
|
59
|
+
return (C, I) => y.value ? (i(), u("div", vt, [
|
|
60
|
+
(i(!0), u(re, null, ve(e.groupItems, (x, w) => {
|
|
61
61
|
var g;
|
|
62
62
|
return i(), u("button", {
|
|
63
63
|
key: x.value ?? w,
|
|
64
|
-
class:
|
|
64
|
+
class: K(["y-btn", [
|
|
65
65
|
`y-btn--${x.variant ?? e.variant}`,
|
|
66
66
|
`y-btn--${x.size ?? e.size}`,
|
|
67
67
|
"is-grouped",
|
|
@@ -73,7 +73,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
73
73
|
"aria-busy": x.loading || e.loading ? "true" : "false",
|
|
74
74
|
"aria-disabled": (x.disabled ?? !1) || e.disabled || e.loading || x.loading ? "true" : "false",
|
|
75
75
|
"aria-label": x.ariaLabel || x.label,
|
|
76
|
-
onClick: (
|
|
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] = [
|
|
@@ -88,19 +88,19 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
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
|
-
x.label && !x.onlyIcon ? (i(), u("span", mt,
|
|
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 },
|
|
102
102
|
e.groupPosition !== "single" ? "is-grouped" : "",
|
|
103
|
-
|
|
103
|
+
p.value
|
|
104
104
|
]]),
|
|
105
105
|
type: e.htmlType,
|
|
106
106
|
disabled: e.disabled || e.loading,
|
|
@@ -113,12 +113,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
113
113
|
])
|
|
114
114
|
], 10, dt));
|
|
115
115
|
}
|
|
116
|
-
}),
|
|
116
|
+
}), me = (e, $) => {
|
|
117
117
|
const t = e.__vccOpts || e;
|
|
118
118
|
for (const [n, m] of $)
|
|
119
119
|
t[n] = m;
|
|
120
120
|
return t;
|
|
121
|
-
}, Ne = /* @__PURE__ */
|
|
121
|
+
}, Ne = /* @__PURE__ */ me(wt, [["__scopeId", "data-v-53157673"]]), 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 = E(null),
|
|
142
|
+
const t = e, n = $, m = E(null), p = E(""), y = E(!1), L = E(!1), C = E(t.placeholder || "");
|
|
143
143
|
oe(() => t.placeholder, (V) => {
|
|
144
144
|
L.value || (C.value = V || "");
|
|
145
145
|
});
|
|
146
146
|
function I(V) {
|
|
147
|
-
const
|
|
148
|
-
|
|
147
|
+
const j = V.target;
|
|
148
|
+
y.value = !0, n("update:modelValue", j.value);
|
|
149
149
|
}
|
|
150
150
|
function x() {
|
|
151
|
-
L.value = !0, t.clearOnFocus && (
|
|
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
153
|
function w() {
|
|
154
|
-
if (L.value = !1, t.clearOnFocus && !
|
|
155
|
-
const V = Number(t.modelValue),
|
|
156
|
-
!Number.isNaN(V) && !Number.isNaN(
|
|
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
|
+
const V = Number(t.modelValue), j = Number(t.min);
|
|
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
160
|
function g(V) {
|
|
161
|
-
const
|
|
162
|
-
n("enter",
|
|
161
|
+
const j = V.target;
|
|
162
|
+
n("enter", j.value);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
const
|
|
164
|
+
function b(V) {
|
|
165
|
+
const j = V.target;
|
|
166
166
|
requestAnimationFrame(() => {
|
|
167
|
-
n("paste",
|
|
167
|
+
n("paste", j.value);
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
return (V,
|
|
171
|
-
class:
|
|
172
|
-
style:
|
|
170
|
+
return (V, j) => (i(), u("div", {
|
|
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,
|
|
@@ -190,11 +190,11 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
190
190
|
onFocus: x,
|
|
191
191
|
onBlur: w,
|
|
192
192
|
onKeyup: ke(g, ["enter"]),
|
|
193
|
-
onPaste:
|
|
194
|
-
}, null, 42,
|
|
193
|
+
onPaste: b
|
|
194
|
+
}, null, 42, kt)
|
|
195
195
|
], 6));
|
|
196
196
|
}
|
|
197
|
-
}), et = /* @__PURE__ */
|
|
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 = {
|
|
@@ -215,19 +215,19 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
215
215
|
}, Tt = {
|
|
216
216
|
key: 1,
|
|
217
217
|
class: "empty-overlay"
|
|
218
|
-
},
|
|
218
|
+
}, Kt = {
|
|
219
219
|
key: 0,
|
|
220
220
|
style: { width: "34px", "min-width": "34px" }
|
|
221
|
-
},
|
|
221
|
+
}, zt = {
|
|
222
222
|
key: 1,
|
|
223
223
|
style: { width: "40px", "min-width": "40px" }
|
|
224
224
|
}, Ht = {
|
|
225
225
|
key: 0,
|
|
226
226
|
class: "col-expand"
|
|
227
|
-
},
|
|
227
|
+
}, Rt = ["onClick"], Vt = {
|
|
228
228
|
key: 1,
|
|
229
229
|
class: "col-select"
|
|
230
|
-
}, Wt = ["value", "checked", "onChange"],
|
|
230
|
+
}, Wt = ["value", "checked", "onChange"], At = ["colspan"], Ft = /* @__PURE__ */ ge({
|
|
231
231
|
__name: "ytable",
|
|
232
232
|
props: {
|
|
233
233
|
data: {},
|
|
@@ -254,78 +254,78 @@ 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 = E(t.currentPage || 1),
|
|
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
|
-
function
|
|
261
|
-
return `${(100 / (
|
|
260
|
+
function F() {
|
|
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;
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
return /^\d+(\.\d+)?$/.test(
|
|
277
|
-
}
|
|
278
|
-
function
|
|
279
|
-
const
|
|
280
|
-
if (!
|
|
281
|
-
const D = parseFloat(
|
|
274
|
+
const d = String(l).trim();
|
|
275
|
+
if (d)
|
|
276
|
+
return /^\d+(\.\d+)?$/.test(d) ? `${d}px` : d;
|
|
277
|
+
}
|
|
278
|
+
function R(l) {
|
|
279
|
+
const d = z(l);
|
|
280
|
+
if (!d) return null;
|
|
281
|
+
const D = parseFloat(d);
|
|
282
282
|
return Number.isFinite(D) ? D : null;
|
|
283
283
|
}
|
|
284
|
-
const Y =
|
|
284
|
+
const Y = O(() => {
|
|
285
285
|
let l = t.columns.length;
|
|
286
286
|
return t.selectable && (l += 1), t.expandable && (l += 1), l;
|
|
287
|
-
}), ee =
|
|
287
|
+
}), ee = O(() => {
|
|
288
288
|
if (!t.searchKeyword || !t.searchFields.length)
|
|
289
289
|
return t.data;
|
|
290
290
|
const l = t.searchKeyword.toLowerCase();
|
|
291
|
-
return t.data.filter((
|
|
292
|
-
const S = r(
|
|
291
|
+
return t.data.filter((d) => t.searchFields.some((D) => {
|
|
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 =
|
|
298
|
-
return l.length > 0 && l.every((
|
|
299
|
-
}),
|
|
297
|
+
const l = X.value.map((d, D) => c(d, D));
|
|
298
|
+
return l.length > 0 && l.every((d) => y.value.includes(d));
|
|
299
|
+
}), we = O(() => {
|
|
300
300
|
const l = [];
|
|
301
|
-
let
|
|
301
|
+
let d = t.selectable ? 40 : 0;
|
|
302
302
|
for (let D = 0; D < t.columns.length; D++) {
|
|
303
303
|
const S = t.columns[D];
|
|
304
304
|
if (S.fixed === "left") {
|
|
305
305
|
let _ = 80;
|
|
306
|
-
const T =
|
|
307
|
-
T !== null ? _ = T :
|
|
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;
|
|
311
|
-
}),
|
|
311
|
+
}), N = O(() => {
|
|
312
312
|
const l = [];
|
|
313
|
-
let
|
|
313
|
+
let d = 0;
|
|
314
314
|
const D = [];
|
|
315
315
|
for (let S = t.columns.length - 1; S >= 0; S--) {
|
|
316
316
|
const _ = t.columns[S];
|
|
317
317
|
if (_.fixed === "right") {
|
|
318
318
|
let T = 80;
|
|
319
|
-
const
|
|
320
|
-
|
|
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
|
-
l.push(
|
|
324
|
+
l.push(d), d += D[S].width;
|
|
325
325
|
return l;
|
|
326
326
|
});
|
|
327
|
-
function
|
|
328
|
-
if (
|
|
327
|
+
function Z(l, d) {
|
|
328
|
+
if (d === "left") {
|
|
329
329
|
let D = 0;
|
|
330
330
|
for (let S = 0; S < l; S++)
|
|
331
331
|
t.columns[S].fixed === "left" && D++;
|
|
@@ -337,8 +337,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
337
337
|
return D;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
return typeof t.rowKey == "function" ? t.rowKey(l) : l[t.rowKey] ||
|
|
340
|
+
function c(l, d) {
|
|
341
|
+
return typeof t.rowKey == "function" ? t.rowKey(l) : l[t.rowKey] || d;
|
|
342
342
|
}
|
|
343
343
|
function h(l) {
|
|
344
344
|
return L.value.has(l);
|
|
@@ -346,238 +346,238 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
346
346
|
function a(l) {
|
|
347
347
|
L.value.has(l) ? L.value.delete(l) : L.value.add(l);
|
|
348
348
|
}
|
|
349
|
-
function r(l,
|
|
350
|
-
return
|
|
349
|
+
function r(l, d) {
|
|
350
|
+
return d.split(".").reduce((D, S) => D == null ? void 0 : D[S], l);
|
|
351
351
|
}
|
|
352
|
-
function f(l,
|
|
352
|
+
function f(l, d = !1) {
|
|
353
353
|
const D = [];
|
|
354
|
-
return l.align && D.push(`text-${l.align}`), l.fixed === "right" && (D.push("col-fixed-right"),
|
|
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
|
-
function
|
|
357
|
-
const S = {}, _ =
|
|
356
|
+
function k(l, d, D) {
|
|
357
|
+
const S = {}, _ = z(l.width);
|
|
358
358
|
if (_)
|
|
359
359
|
S.width = _, S.minWidth = _, S.maxWidth = _;
|
|
360
360
|
else {
|
|
361
|
-
const T =
|
|
361
|
+
const T = F();
|
|
362
362
|
S.width = T, S.minWidth = T, S.maxWidth = T;
|
|
363
363
|
}
|
|
364
364
|
if (l.fixed === "left") {
|
|
365
|
-
const T =
|
|
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 T =
|
|
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 M(l,
|
|
374
|
-
const D = r(l,
|
|
375
|
-
return
|
|
373
|
+
function M(l, d) {
|
|
374
|
+
const D = r(l, d.key);
|
|
375
|
+
return d.formatter ? d.formatter(D, l) : D || "";
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
|
|
377
|
+
function B(l) {
|
|
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
|
-
function
|
|
381
|
-
const l =
|
|
382
|
-
if (l.every((
|
|
383
|
-
|
|
380
|
+
function P() {
|
|
381
|
+
const l = X.value.map((d, D) => c(d, D));
|
|
382
|
+
if (l.every((d) => y.value.includes(d)))
|
|
383
|
+
y.value = y.value.filter((d) => !l.includes(d));
|
|
384
384
|
else {
|
|
385
|
-
const
|
|
386
|
-
|
|
385
|
+
const d = /* @__PURE__ */ new Set([...y.value, ...l]);
|
|
386
|
+
y.value = Array.from(d);
|
|
387
387
|
}
|
|
388
|
-
n("select",
|
|
388
|
+
n("select", y.value), n("update:selectedItems", y.value);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
|
|
390
|
+
function te() {
|
|
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
|
-
function
|
|
398
|
+
function ye(l) {
|
|
399
399
|
m.value = l, n("page-change", l);
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
401
|
+
function Le(l) {
|
|
402
|
+
p.value = l, m.value = 1, n("page-size-change", l);
|
|
403
403
|
}
|
|
404
404
|
oe(() => t.currentPage, (l) => {
|
|
405
|
-
const
|
|
406
|
-
m.value !==
|
|
405
|
+
const d = typeof l == "number" && l > 0 ? l : 1;
|
|
406
|
+
m.value !== d && (m.value = d);
|
|
407
407
|
}), oe(() => t.pageSize, (l) => {
|
|
408
|
-
const
|
|
409
|
-
|
|
408
|
+
const d = typeof l == "number" && l > 0 ? l : 10;
|
|
409
|
+
p.value !== d && (p.value = d);
|
|
410
410
|
});
|
|
411
|
-
function
|
|
412
|
-
I.value &&
|
|
413
|
-
const l = I.value.getBoundingClientRect(),
|
|
414
|
-
Ze && (Ze.offsetHeight >
|
|
411
|
+
function Ce() {
|
|
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
|
-
let
|
|
417
|
+
let Me = !1;
|
|
418
418
|
function Ie() {
|
|
419
|
-
!x.value || !w.value ||
|
|
420
|
-
|
|
419
|
+
!x.value || !w.value || Me || x.value.scrollLeft !== w.value.scrollLeft && (Me = !0, x.value.scrollLeft = w.value.scrollLeft, requestAnimationFrame(() => {
|
|
420
|
+
Me = !1;
|
|
421
421
|
}));
|
|
422
422
|
}
|
|
423
423
|
function Pe() {
|
|
424
|
-
!x.value || !w.value ||
|
|
425
|
-
|
|
424
|
+
!x.value || !w.value || Me || w.value.scrollLeft !== x.value.scrollLeft && (Me = !0, w.value.scrollLeft = x.value.scrollLeft, requestAnimationFrame(() => {
|
|
425
|
+
Me = !1;
|
|
426
426
|
}));
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
|
|
428
|
+
function Re() {
|
|
429
|
+
se(() => {
|
|
430
430
|
if (!w.value) return;
|
|
431
|
-
const l = w.value,
|
|
432
|
-
if (
|
|
433
|
-
const T = 24,
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
|
|
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
|
-
function
|
|
440
|
-
if (!
|
|
439
|
+
function Ve(l) {
|
|
440
|
+
if (!Q || !w.value || !A.value) return;
|
|
441
441
|
l.preventDefault();
|
|
442
|
-
const
|
|
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
454
|
t.columns.forEach((_, T) => {
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
l.push(
|
|
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
|
|
462
|
-
if (
|
|
463
|
-
l.push(
|
|
461
|
+
const he = b.value[T];
|
|
462
|
+
if (he)
|
|
463
|
+
l.push(he), V.value[_.key] = he;
|
|
464
464
|
else {
|
|
465
|
-
const
|
|
466
|
-
l.push(
|
|
465
|
+
const pe = F();
|
|
466
|
+
l.push(pe), V.value[_.key] = pe;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
});
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
const _ = t.selectable ? 1 : 0, T = Array.from(
|
|
473
|
-
for (let
|
|
474
|
-
if (!l[
|
|
475
|
-
const
|
|
476
|
-
if (
|
|
477
|
-
const
|
|
478
|
-
l[
|
|
470
|
+
const d = (D = g.value) == null ? void 0 : D.querySelector("tbody tr");
|
|
471
|
+
if (d) {
|
|
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
|
+
if (he && he.clientWidth > 0) {
|
|
477
|
+
const pe = `${he.clientWidth}px`;
|
|
478
|
+
l[U] = pe, V.value[t.columns[U].key] = pe;
|
|
479
479
|
} else {
|
|
480
|
-
const
|
|
481
|
-
l[
|
|
480
|
+
const pe = F();
|
|
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
487
|
const T = V.value[((S = t.columns[_]) == null ? void 0 : S.key) || ""];
|
|
488
|
-
l[_] = T ||
|
|
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
496
|
oe(() => t.data, () => {
|
|
497
|
-
|
|
498
|
-
|
|
497
|
+
se(() => {
|
|
498
|
+
Ce(), Ie(), s(), L.value.clear();
|
|
499
499
|
});
|
|
500
|
-
}, { deep: !0 }), oe([m,
|
|
501
|
-
|
|
502
|
-
|
|
500
|
+
}, { deep: !0 }), oe([m, p], () => {
|
|
501
|
+
se(() => {
|
|
502
|
+
Ce(), Ie(), s();
|
|
503
503
|
});
|
|
504
504
|
}), oe(() => t.columns, () => {
|
|
505
|
-
const l = [],
|
|
505
|
+
const l = [], d = { ...V.value };
|
|
506
506
|
t.columns.forEach((S, _) => {
|
|
507
|
-
const T =
|
|
508
|
-
T ? (l.push(T),
|
|
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
|
-
Object.keys(
|
|
512
|
-
D.has(S) || delete
|
|
513
|
-
}), V.value =
|
|
511
|
+
Object.keys(d).forEach((S) => {
|
|
512
|
+
D.has(S) || delete d[S];
|
|
513
|
+
}), V.value = d, b.value = l, se(() => {
|
|
514
514
|
We(), Ie(), s();
|
|
515
515
|
});
|
|
516
|
-
}, { deep: !0 }), oe(() =>
|
|
517
|
-
|
|
518
|
-
|
|
516
|
+
}, { deep: !0 }), oe(() => y.value, () => {
|
|
517
|
+
se(() => {
|
|
518
|
+
Ce(), s();
|
|
519
519
|
});
|
|
520
520
|
}, { deep: !0 }), oe(() => t.loading, () => {
|
|
521
|
-
|
|
521
|
+
se(() => {
|
|
522
522
|
s();
|
|
523
523
|
});
|
|
524
|
-
}),
|
|
525
|
-
var l,
|
|
526
|
-
|
|
527
|
-
|
|
524
|
+
}), $e(() => {
|
|
525
|
+
var l, d;
|
|
526
|
+
se(() => {
|
|
527
|
+
Ce(), We(), s(), Re();
|
|
528
528
|
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (l = w.value) == null || l.addEventListener("scroll", () => {
|
|
529
|
-
Ie(),
|
|
530
|
-
}, { passive: !0 }), (
|
|
529
|
+
Ie(), Re(), s();
|
|
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
534
|
}), v.observe(w.value));
|
|
535
535
|
}), Be(() => {
|
|
536
|
-
var l,
|
|
537
|
-
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l = w.value) == null || l.removeEventListener("scroll", Ie), (
|
|
536
|
+
var l, d;
|
|
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
541
|
!x.value || !w.value || requestAnimationFrame(() => {
|
|
542
542
|
if (!x.value || !w.value) return;
|
|
543
|
-
const l = w.value,
|
|
544
|
-
if (
|
|
545
|
-
Te =
|
|
543
|
+
const l = w.value, d = Math.ceil(l.offsetWidth - l.clientWidth);
|
|
544
|
+
if (W.value = d, d !== Te) {
|
|
545
|
+
Te = d;
|
|
546
546
|
const D = x.value.querySelector(".table"), S = g.value;
|
|
547
|
-
D && S && (x.value.style.paddingRight = "0px", D.style.width = "", D.style.marginRight = "",
|
|
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
|
}
|
|
551
551
|
let v = null;
|
|
552
|
-
return (l,
|
|
553
|
-
const D =
|
|
552
|
+
return (l, d) => {
|
|
553
|
+
const D = Ae("YButton"), S = Ae("YPagination");
|
|
554
554
|
return i(), u("div", {
|
|
555
555
|
class: "ytable-container",
|
|
556
556
|
ref_key: "tableContainer",
|
|
557
557
|
ref: I
|
|
558
558
|
}, [
|
|
559
|
-
de(
|
|
560
|
-
default:
|
|
561
|
-
|
|
562
|
-
o("div", $t, "已选择 " +
|
|
559
|
+
de(be, { name: "bulk-slide" }, {
|
|
560
|
+
default: fe(() => [
|
|
561
|
+
y.value.length && e.showBulkActions ? (i(), u("div", xt, [
|
|
562
|
+
o("div", $t, "已选择 " + ne(y.value.length) + " 项", 1),
|
|
563
563
|
o("div", Ct, [
|
|
564
564
|
ce(l.$slots, "bulk-actions", {
|
|
565
|
-
selectedItems:
|
|
566
|
-
clearSelection:
|
|
565
|
+
selectedItems: y.value,
|
|
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:
|
|
574
|
-
|
|
573
|
+
default: fe(() => [...d[2] || (d[2] = [
|
|
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
|
}),
|
|
@@ -589,100 +589,100 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
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:
|
|
606
|
-
onChange:
|
|
605
|
+
checked: ae.value,
|
|
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
621
|
ref: w,
|
|
622
|
-
style:
|
|
622
|
+
style: ue({ maxHeight: C.value })
|
|
623
623
|
}, [
|
|
624
|
-
e.loading ? (i(), u("div", Bt, [...
|
|
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
|
-
!
|
|
627
|
+
])])) : H("", !0),
|
|
628
|
+
!X.value.length && !e.loading ? (i(), u("div", Tt, [
|
|
629
629
|
ce(l.$slots, "empty", {}, () => [
|
|
630
|
-
|
|
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
636
|
ref: g
|
|
637
637
|
}, [
|
|
638
638
|
o("colgroup", null, [
|
|
639
|
-
t.expandable ? (i(), u("col",
|
|
640
|
-
e.selectable ? (i(), u("col",
|
|
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:
|
|
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
|
-
], 8,
|
|
661
|
-
])) :
|
|
662
|
-
e.selectable ? (i(), u("td",
|
|
660
|
+
], 8, Rt)
|
|
661
|
+
])) : H("", !0),
|
|
662
|
+
e.selectable ? (i(), u("td", Vt, [
|
|
663
663
|
o("input", {
|
|
664
664
|
type: "checkbox",
|
|
665
|
-
value:
|
|
666
|
-
checked:
|
|
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
|
-
ce(l.$slots, `cell-${
|
|
675
|
+
ce(l.$slots, `cell-${U.key}`, {
|
|
676
676
|
item: _,
|
|
677
|
-
value: r(_,
|
|
677
|
+
value: r(_, U.key),
|
|
678
678
|
index: T
|
|
679
679
|
}, () => [
|
|
680
|
-
|
|
680
|
+
xe(ne(M(_, U)), 1)
|
|
681
681
|
], !0)
|
|
682
682
|
], 6))), 128))
|
|
683
683
|
]),
|
|
684
|
-
t.expandable && h(
|
|
685
|
-
key: `${
|
|
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", {
|
|
@@ -693,29 +693,29 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
693
693
|
item: _,
|
|
694
694
|
index: T
|
|
695
695
|
}, void 0, !0)
|
|
696
|
-
], 8,
|
|
697
|
-
])) :
|
|
696
|
+
], 8, At)
|
|
697
|
+
])) : H("", !0)
|
|
698
698
|
], 64))), 128))
|
|
699
699
|
])
|
|
700
700
|
], 2)
|
|
701
701
|
], 6),
|
|
702
|
-
e.pagination ? (i(),
|
|
702
|
+
e.pagination ? (i(), Se(S, {
|
|
703
703
|
key: 0,
|
|
704
704
|
class: "align-right",
|
|
705
705
|
"current-page": m.value,
|
|
706
|
-
"onUpdate:currentPage":
|
|
707
|
-
"page-size":
|
|
708
|
-
"onUpdate:pageSize":
|
|
706
|
+
"onUpdate:currentPage": d[0] || (d[0] = (_) => m.value = _),
|
|
707
|
+
"page-size": p.value,
|
|
708
|
+
"onUpdate:pageSize": d[1] || (d[1] = (_) => p.value = _),
|
|
709
709
|
loading: t.loading,
|
|
710
710
|
"page-size-options": e.pageSizeOptions,
|
|
711
|
-
onPageChange:
|
|
712
|
-
onPageSizeChange:
|
|
713
|
-
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) :
|
|
711
|
+
onPageChange: ye,
|
|
712
|
+
onPageSizeChange: Le
|
|
713
|
+
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : H("", !0)
|
|
714
714
|
])
|
|
715
715
|
], 512);
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
|
-
}), Pt = /* @__PURE__ */
|
|
718
|
+
}), Pt = /* @__PURE__ */ me(Ft, [["__scopeId", "data-v-a2bea873"]]), Yt = ["onKeydown", "aria-expanded"], Nt = ["src"], Ot = ["placeholder", "onKeydown"], jt = ["onClick", "onMouseenter"], qt = ["src"], Ut = /* @__PURE__ */ ge({
|
|
719
719
|
__name: "yselect",
|
|
720
720
|
props: {
|
|
721
721
|
modelValue: {},
|
|
@@ -734,127 +734,127 @@ 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 = E(!1),
|
|
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
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
745
|
var M;
|
|
746
746
|
const a = { position: "fixed", zIndex: "4000" }, r = L.value;
|
|
747
747
|
if (!r) return a;
|
|
748
|
-
const f = r.getBoundingClientRect(),
|
|
749
|
-
return a.left = `${f.left}px`, a.width = `${
|
|
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 || !L.value ||
|
|
751
|
+
function A() {
|
|
752
|
+
!m.value || !L.value || se(() => {
|
|
753
753
|
const a = L.value;
|
|
754
754
|
if (!a) return;
|
|
755
|
-
const r = a.getBoundingClientRect(), f = window.innerHeight,
|
|
756
|
-
x.value = !
|
|
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 ? Y() :
|
|
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
782
|
function Y() {
|
|
783
|
-
m.value = !1,
|
|
783
|
+
m.value = !1, p.value = -1, x.value = !1, t.filterable && (g.value = "");
|
|
784
784
|
}
|
|
785
785
|
function ee(a, r) {
|
|
786
|
-
if (
|
|
787
|
-
const f =
|
|
786
|
+
if (W(a)) return;
|
|
787
|
+
const f = q(a);
|
|
788
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
793
|
n("update:modelValue", a), n("change", a, null), n("clear"), Y();
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
if (!
|
|
797
|
-
|
|
795
|
+
function ae(a) {
|
|
796
|
+
if (!j.value || j.value.length === 0) {
|
|
797
|
+
p.value = -1;
|
|
798
798
|
return;
|
|
799
799
|
}
|
|
800
|
-
let r =
|
|
801
|
-
const f =
|
|
800
|
+
let r = p.value;
|
|
801
|
+
const f = j.value.length;
|
|
802
802
|
r === -1 ? r = a > 0 ? 0 : f - 1 : r = (r + a + f) % f;
|
|
803
|
-
let
|
|
804
|
-
for (;
|
|
805
|
-
r = (r + a + f) % f,
|
|
806
|
-
|
|
807
|
-
}
|
|
808
|
-
function
|
|
809
|
-
if (
|
|
810
|
-
const a =
|
|
811
|
-
!a ||
|
|
812
|
-
}
|
|
813
|
-
function
|
|
814
|
-
if (!
|
|
815
|
-
const a =
|
|
803
|
+
let k = 0;
|
|
804
|
+
for (; k < f && W(j.value[r]); )
|
|
805
|
+
r = (r + a + f) % f, k++;
|
|
806
|
+
p.value = k >= f ? -1 : r, Z();
|
|
807
|
+
}
|
|
808
|
+
function we() {
|
|
809
|
+
if (p.value < 0) return;
|
|
810
|
+
const a = j.value[p.value];
|
|
811
|
+
!a || W(a) || ee(a, p.value);
|
|
812
|
+
}
|
|
813
|
+
function N() {
|
|
814
|
+
if (!y.value) return;
|
|
815
|
+
const a = y.value.querySelector(".yselect__option--selected");
|
|
816
816
|
a && a.scrollIntoView({ block: "nearest" });
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
if (!
|
|
820
|
-
const r =
|
|
818
|
+
function Z() {
|
|
819
|
+
if (!y.value || p.value < 0) return;
|
|
820
|
+
const r = y.value.querySelectorAll(".yselect__option")[p.value];
|
|
821
821
|
r && r.scrollIntoView({ block: "nearest" });
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function c(a) {
|
|
824
824
|
const r = a.target;
|
|
825
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
|
-
return
|
|
834
|
-
document.addEventListener("click",
|
|
833
|
+
return $e(() => {
|
|
834
|
+
document.addEventListener("click", c), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
835
835
|
}), Be(() => {
|
|
836
|
-
document.removeEventListener("click",
|
|
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
845
|
ref: L,
|
|
846
|
-
class:
|
|
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(
|
|
853
|
+
ke(G(z, ["prevent"]), ["enter"]),
|
|
854
|
+
ke(G(z, ["prevent"]), ["space"]),
|
|
855
855
|
ke(Y, ["escape"]),
|
|
856
|
-
ke(
|
|
857
|
-
ke(
|
|
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,24 +863,24 @@ 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
868
|
ce(a.$slots, "value", {
|
|
869
|
-
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
|
-
|
|
882
|
-
], 64)) : (i(), u(
|
|
883
|
-
|
|
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)
|
|
@@ -893,22 +893,22 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
893
893
|
placeholder: V.value || e.placeholder,
|
|
894
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,59 +943,59 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
943
943
|
], -1)
|
|
944
944
|
])], 2)
|
|
945
945
|
], 42, Yt),
|
|
946
|
-
de(
|
|
947
|
-
default:
|
|
948
|
-
(i(),
|
|
946
|
+
de(be, { name: "yselect-dropdown" }, {
|
|
947
|
+
default: fe(() => [
|
|
948
|
+
(i(), Se(Fe, { to: "body" }, [
|
|
949
949
|
m.value ? (i(), u("div", {
|
|
950
950
|
key: 0,
|
|
951
951
|
ref_key: "dropdownEl",
|
|
952
952
|
ref: I,
|
|
953
|
-
class:
|
|
954
|
-
style:
|
|
955
|
-
onMousedown: r[6] || (r[6] =
|
|
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", {
|
|
961
961
|
class: "yselect__options",
|
|
962
962
|
ref_key: "optionsContainer",
|
|
963
|
-
ref:
|
|
963
|
+
ref: y
|
|
964
964
|
}, [
|
|
965
|
-
(i(!0), u(
|
|
966
|
-
key:
|
|
967
|
-
class:
|
|
968
|
-
"yselect__option--selected":
|
|
969
|
-
"yselect__option--disabled":
|
|
970
|
-
"yselect__option--hover":
|
|
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
|
+
"yselect__option--hover": p.value === k
|
|
971
971
|
}]),
|
|
972
972
|
onClick: (M) => ee(f),
|
|
973
|
-
onMouseenter: (M) =>
|
|
974
|
-
onMouseleave: r[5] || (r[5] = (M) =>
|
|
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
|
-
index:
|
|
979
|
-
selected:
|
|
978
|
+
index: k,
|
|
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
|
-
|
|
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
|
-
}), tt = /* @__PURE__ */
|
|
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,20 +1010,20 @@ 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 = E(t.pageSize),
|
|
1013
|
+
const t = e, n = $, m = E(t.pageSize), p = O(() => t.pageSizeOptions), y = O({
|
|
1014
1014
|
get: () => t.currentPage,
|
|
1015
1015
|
set: (x) => {
|
|
1016
1016
|
n("update:currentPage", x), n("page-change", x);
|
|
1017
1017
|
}
|
|
1018
1018
|
});
|
|
1019
1019
|
function L(x) {
|
|
1020
|
-
t.loading || x >= 1 && x !== t.currentPage && (
|
|
1020
|
+
t.loading || x >= 1 && x !== t.currentPage && (y.value = x);
|
|
1021
1021
|
}
|
|
1022
1022
|
function C(x) {
|
|
1023
|
-
t.loading || (m.value = x, n("update:pageSize", x), n("page-size-change", x),
|
|
1023
|
+
t.loading || (m.value = x, n("update:pageSize", x), n("page-size-change", x), y.value = 1);
|
|
1024
1024
|
}
|
|
1025
1025
|
function I(x) {
|
|
1026
|
-
t.loading || (x === "prev" ? L(
|
|
1026
|
+
t.loading || (x === "prev" ? L(y.value - 1) : x === "next" && L(y.value + 1));
|
|
1027
1027
|
}
|
|
1028
1028
|
return m.value = t.pageSize, oe(
|
|
1029
1029
|
() => t.pageSize,
|
|
@@ -1031,17 +1031,17 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1031
1031
|
typeof x == "number" && m.value !== x && (m.value = x);
|
|
1032
1032
|
}
|
|
1033
1033
|
), (x, w) => {
|
|
1034
|
-
const g =
|
|
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
|
-
disabled:
|
|
1040
|
+
disabled: y.value === 1 || e.loading,
|
|
1041
1041
|
onClick: w[0] || (w[0] = (V) => L(1))
|
|
1042
1042
|
}, {
|
|
1043
|
-
default:
|
|
1044
|
-
|
|
1043
|
+
default: fe(() => [...w[2] || (w[2] = [
|
|
1044
|
+
xe("首页", -1)
|
|
1045
1045
|
])]),
|
|
1046
1046
|
_: 1
|
|
1047
1047
|
}, 8, ["disabled"]),
|
|
@@ -1050,16 +1050,16 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1050
1050
|
variant: "secondary",
|
|
1051
1051
|
size: "small",
|
|
1052
1052
|
groupItems: [
|
|
1053
|
-
{ label: "上一页", value: "prev", disabled:
|
|
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
1056
|
onGroupClick: I
|
|
1057
1057
|
}, null, 8, ["groupItems"]),
|
|
1058
1058
|
o("div", Jt, [
|
|
1059
|
-
de(
|
|
1059
|
+
de(b, {
|
|
1060
1060
|
modelValue: m.value,
|
|
1061
1061
|
"onUpdate:modelValue": w[1] || (w[1] = (V) => m.value = V),
|
|
1062
|
-
options:
|
|
1062
|
+
options: p.value,
|
|
1063
1063
|
size: "small",
|
|
1064
1064
|
width: "105px",
|
|
1065
1065
|
clearable: !1,
|
|
@@ -1071,7 +1071,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1071
1071
|
]);
|
|
1072
1072
|
};
|
|
1073
1073
|
}
|
|
1074
|
-
}), Gt = /* @__PURE__ */
|
|
1074
|
+
}), Gt = /* @__PURE__ */ me(Xt, [["__scopeId", "data-v-b8406406"]]), en = ["aria-label"], tn = { class: "y-badge__inner" }, nn = {
|
|
1075
1075
|
key: 0,
|
|
1076
1076
|
class: "y-badge__progress",
|
|
1077
1077
|
"aria-hidden": "true"
|
|
@@ -1114,7 +1114,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1114
1114
|
class: "icon",
|
|
1115
1115
|
viewBox: "0 0 20 20",
|
|
1116
1116
|
fill: "currentColor"
|
|
1117
|
-
}, fn = { class: "y-badge__label" }, vn = /* @__PURE__ */
|
|
1117
|
+
}, fn = { class: "y-badge__label" }, vn = /* @__PURE__ */ ge({
|
|
1118
1118
|
__name: "ybadge",
|
|
1119
1119
|
props: {
|
|
1120
1120
|
tone: { default: "default" },
|
|
@@ -1126,17 +1126,17 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1126
1126
|
label: { default: "" }
|
|
1127
1127
|
},
|
|
1128
1128
|
setup(e) {
|
|
1129
|
-
const $ = e, t =
|
|
1130
|
-
const m = ($.label || "").trim(),
|
|
1131
|
-
if (
|
|
1129
|
+
const $ = e, t = O(() => $.tone || "default"), n = O(() => {
|
|
1130
|
+
const m = ($.label || "").trim(), p = $.tone, y = $.progress;
|
|
1131
|
+
if (y) {
|
|
1132
1132
|
const L = {
|
|
1133
1133
|
incomplete: "未完成",
|
|
1134
1134
|
partiallyComplete: "部分完成",
|
|
1135
1135
|
complete: "已完成"
|
|
1136
1136
|
};
|
|
1137
|
-
return m ? `${m},进度:${L[
|
|
1137
|
+
return m ? `${m},进度:${L[y] || y}` : `进度:${L[y] || y}`;
|
|
1138
1138
|
}
|
|
1139
|
-
if (
|
|
1139
|
+
if (p && p !== "default") {
|
|
1140
1140
|
const L = {
|
|
1141
1141
|
informational: "信息",
|
|
1142
1142
|
success: "成功",
|
|
@@ -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},语气:${L[
|
|
1148
|
+
return m ? `${m},语气:${L[p] || p}` : `语气:${L[p] || p}`;
|
|
1149
1149
|
}
|
|
1150
1150
|
return m || "标记";
|
|
1151
1151
|
});
|
|
1152
|
-
return (m,
|
|
1153
|
-
class:
|
|
1152
|
+
return (m, p) => (i(), u("span", {
|
|
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 },
|
|
@@ -1161,13 +1161,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1161
1161
|
}, [
|
|
1162
1162
|
o("span", tn, [
|
|
1163
1163
|
e.progress ? (i(), u("span", nn, [
|
|
1164
|
-
e.progress === "incomplete" ? (i(), u("svg", ln, [...
|
|
1164
|
+
e.progress === "incomplete" ? (i(), u("svg", ln, [...p[0] || (p[0] = [
|
|
1165
1165
|
o("circle", {
|
|
1166
1166
|
cx: "10",
|
|
1167
1167
|
cy: "10",
|
|
1168
1168
|
r: "5"
|
|
1169
1169
|
}, null, -1)
|
|
1170
|
-
])])) : e.progress === "partiallyComplete" ? (i(), u("svg", on, [...
|
|
1170
|
+
])])) : e.progress === "partiallyComplete" ? (i(), u("svg", on, [...p[1] || (p[1] = [
|
|
1171
1171
|
o("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1172
1172
|
o("circle", {
|
|
1173
1173
|
cx: "10",
|
|
@@ -1177,55 +1177,55 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1177
1177
|
stroke: "currentColor",
|
|
1178
1178
|
"stroke-width": "2"
|
|
1179
1179
|
}, null, -1)
|
|
1180
|
-
])])) : e.progress === "complete" ? (i(), u("svg", an, [...
|
|
1180
|
+
])])) : e.progress === "complete" ? (i(), u("svg", an, [...p[2] || (p[2] = [
|
|
1181
1181
|
o("path", {
|
|
1182
1182
|
"fill-rule": "evenodd",
|
|
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
|
-
e.icon === "dot" ? (i(), u("svg", rn, [...
|
|
1188
|
+
e.icon === "dot" ? (i(), u("svg", rn, [...p[3] || (p[3] = [
|
|
1189
1189
|
o("circle", {
|
|
1190
1190
|
cx: "10",
|
|
1191
1191
|
cy: "10",
|
|
1192
1192
|
r: "4"
|
|
1193
1193
|
}, null, -1)
|
|
1194
|
-
])])) : e.icon === "check" ? (i(), u("svg", un, [...
|
|
1194
|
+
])])) : e.icon === "check" ? (i(), u("svg", un, [...p[4] || (p[4] = [
|
|
1195
1195
|
o("path", {
|
|
1196
1196
|
"fill-rule": "evenodd",
|
|
1197
1197
|
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",
|
|
1198
1198
|
"clip-rule": "evenodd"
|
|
1199
1199
|
}, null, -1)
|
|
1200
|
-
])])) : e.icon === "alert" ? (i(), u("svg", cn, [...
|
|
1200
|
+
])])) : e.icon === "alert" ? (i(), u("svg", cn, [...p[5] || (p[5] = [
|
|
1201
1201
|
o("path", {
|
|
1202
1202
|
"fill-rule": "evenodd",
|
|
1203
1203
|
d: "M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z",
|
|
1204
1204
|
"clip-rule": "evenodd"
|
|
1205
1205
|
}, null, -1)
|
|
1206
|
-
])])) : (i(), u("svg", dn, [...
|
|
1206
|
+
])])) : (i(), u("svg", dn, [...p[6] || (p[6] = [
|
|
1207
1207
|
o("circle", {
|
|
1208
1208
|
cx: "10",
|
|
1209
1209
|
cy: "10",
|
|
1210
1210
|
r: "4"
|
|
1211
1211
|
}, null, -1)
|
|
1212
1212
|
])]))
|
|
1213
|
-
])) :
|
|
1213
|
+
])) : H("", !0),
|
|
1214
1214
|
o("span", fn, [
|
|
1215
1215
|
ce(m.$slots, "default", {}, () => [
|
|
1216
|
-
|
|
1216
|
+
xe(ne(e.label), 1)
|
|
1217
1217
|
], !0)
|
|
1218
1218
|
])
|
|
1219
1219
|
])
|
|
1220
1220
|
], 10, en));
|
|
1221
1221
|
}
|
|
1222
|
-
}), hn = /* @__PURE__ */
|
|
1222
|
+
}), hn = /* @__PURE__ */ me(vn, [["__scopeId", "data-v-ce819797"]]), pn = ["aria-hidden"], yn = ["onKeydown"], gn = {
|
|
1223
1223
|
key: 0,
|
|
1224
1224
|
class: "y-dialog-header"
|
|
1225
|
-
}, mn = { class: "y-dialog-title" }, wn = { class: "y-dialog-body" },
|
|
1225
|
+
}, mn = { class: "y-dialog-title" }, wn = { class: "y-dialog-body" }, kn = {
|
|
1226
1226
|
key: 1,
|
|
1227
1227
|
class: "y-dialog-footer"
|
|
1228
|
-
},
|
|
1228
|
+
}, bn = /* @__PURE__ */ ge({
|
|
1229
1229
|
__name: "ydialog",
|
|
1230
1230
|
props: {
|
|
1231
1231
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1240,10 +1240,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1240
1240
|
},
|
|
1241
1241
|
emits: ["update:modelValue", "open", "close"],
|
|
1242
1242
|
setup(e, { emit: $ }) {
|
|
1243
|
-
const t = e, n = $, m =
|
|
1243
|
+
const t = e, n = $, m = O({
|
|
1244
1244
|
get: () => t.modelValue,
|
|
1245
1245
|
set: (w) => n("update:modelValue", w)
|
|
1246
|
-
}),
|
|
1246
|
+
}), p = E(null), y = O(() => {
|
|
1247
1247
|
const w = {};
|
|
1248
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
|
});
|
|
@@ -1262,37 +1262,37 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1262
1262
|
return oe(() => t.modelValue, (w) => {
|
|
1263
1263
|
w ? (n("open"), requestAnimationFrame(() => {
|
|
1264
1264
|
var g;
|
|
1265
|
-
return (g =
|
|
1265
|
+
return (g = p.value) == null ? void 0 : g.focus();
|
|
1266
1266
|
}), document.addEventListener("keydown", x), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", x), document.body.style.overflow = "");
|
|
1267
|
-
}),
|
|
1267
|
+
}), $e(() => {
|
|
1268
1268
|
t.modelValue && (document.addEventListener("keydown", x), document.body.style.overflow = "hidden");
|
|
1269
1269
|
}), Be(() => {
|
|
1270
1270
|
document.removeEventListener("keydown", x), document.body.style.overflow = "";
|
|
1271
|
-
}), (w, g) => (i(),
|
|
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
1281
|
onClick: L
|
|
1282
1282
|
}),
|
|
1283
|
-
de(
|
|
1284
|
-
default:
|
|
1283
|
+
de(be, { name: "dialog-zoom-fade" }, {
|
|
1284
|
+
default: fe(() => [
|
|
1285
1285
|
Ee(o("div", {
|
|
1286
1286
|
ref_key: "panelRef",
|
|
1287
|
-
ref:
|
|
1288
|
-
class:
|
|
1289
|
-
style:
|
|
1290
|
-
onKeydown: ke(
|
|
1287
|
+
ref: p,
|
|
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
1294
|
ce(w.$slots, "header", {}, () => [
|
|
1295
|
-
o("div", mn,
|
|
1295
|
+
o("div", mn, ne(e.title), 1)
|
|
1296
1296
|
], !0),
|
|
1297
1297
|
e.closable ? (i(), u("button", {
|
|
1298
1298
|
key: 0,
|
|
@@ -1300,26 +1300,26 @@ 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
|
-
w.$slots.footer ? (i(), u("div",
|
|
1308
|
+
w.$slots.footer ? (i(), u("div", kn, [
|
|
1309
1309
|
ce(w.$slots, "footer", {}, void 0, !0)
|
|
1310
|
-
])) :
|
|
1310
|
+
])) : H("", !0)
|
|
1311
1311
|
], 46, yn), [
|
|
1312
|
-
[
|
|
1312
|
+
[ze, m.value]
|
|
1313
1313
|
])
|
|
1314
1314
|
]),
|
|
1315
1315
|
_: 3
|
|
1316
1316
|
})
|
|
1317
1317
|
], 12, pn), [
|
|
1318
|
-
[
|
|
1318
|
+
[ze, m.value]
|
|
1319
1319
|
])
|
|
1320
1320
|
]));
|
|
1321
1321
|
}
|
|
1322
|
-
}), xn = /* @__PURE__ */
|
|
1322
|
+
}), xn = /* @__PURE__ */ me(bn, [["__scopeId", "data-v-a7acc6dc"]]), $n = { class: "ypopover__inner" }, Cn = /* @__PURE__ */ ge({
|
|
1323
1323
|
__name: "ypopover",
|
|
1324
1324
|
props: {
|
|
1325
1325
|
trigger: { default: "click" },
|
|
@@ -1339,223 +1339,223 @@ 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,
|
|
1343
|
-
let g = null,
|
|
1344
|
-
const V =
|
|
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
|
+
const V = O(() => {
|
|
1345
1345
|
if (!C.value || !I.value) return {};
|
|
1346
|
-
const
|
|
1347
|
-
n.width !== "auto" && (
|
|
1348
|
-
const { top:
|
|
1349
|
-
return
|
|
1350
|
-
}),
|
|
1346
|
+
const N = {};
|
|
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: Z, left: c } = F();
|
|
1349
|
+
return N.top = `${Z}px`, N.left = `${c}px`, N;
|
|
1350
|
+
}), j = O(() => {
|
|
1351
1351
|
if (!n.showArrow) return {};
|
|
1352
1352
|
if (Object.keys(w.value).length > 0)
|
|
1353
1353
|
return w.value;
|
|
1354
|
-
const
|
|
1355
|
-
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ?
|
|
1354
|
+
const N = {};
|
|
1355
|
+
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? N.left = "50%" : N.top = "50%", N;
|
|
1356
1356
|
});
|
|
1357
|
-
function
|
|
1358
|
-
var
|
|
1357
|
+
function F() {
|
|
1358
|
+
var P, te;
|
|
1359
1359
|
if (!I.value) return { top: 0, left: 0 };
|
|
1360
|
-
const { width:
|
|
1361
|
-
let f = 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
|
+
let f = 0, k = 0;
|
|
1362
1362
|
switch (n.placement) {
|
|
1363
1363
|
case "top":
|
|
1364
|
-
f =
|
|
1364
|
+
f = c - r - n.offset, k = h + (N - a) / 2;
|
|
1365
1365
|
break;
|
|
1366
1366
|
case "top-start":
|
|
1367
|
-
f =
|
|
1367
|
+
f = c - r - n.offset, k = h;
|
|
1368
1368
|
break;
|
|
1369
1369
|
case "top-end":
|
|
1370
|
-
f =
|
|
1370
|
+
f = c - r - n.offset, k = h + N - a;
|
|
1371
1371
|
break;
|
|
1372
1372
|
case "bottom":
|
|
1373
|
-
f =
|
|
1373
|
+
f = c + Z + n.offset, k = h + (N - a) / 2;
|
|
1374
1374
|
break;
|
|
1375
1375
|
case "bottom-start":
|
|
1376
|
-
f =
|
|
1376
|
+
f = c + Z + n.offset, k = h;
|
|
1377
1377
|
break;
|
|
1378
1378
|
case "bottom-end":
|
|
1379
|
-
f =
|
|
1379
|
+
f = c + Z + n.offset, k = h + N - a;
|
|
1380
1380
|
break;
|
|
1381
1381
|
case "left":
|
|
1382
|
-
f =
|
|
1382
|
+
f = c + (Z - r) / 2, k = h - a - n.offset;
|
|
1383
1383
|
break;
|
|
1384
1384
|
case "left-start":
|
|
1385
|
-
f =
|
|
1385
|
+
f = c, k = h - a - n.offset;
|
|
1386
1386
|
break;
|
|
1387
1387
|
case "left-end":
|
|
1388
|
-
f =
|
|
1388
|
+
f = c + Z - r, k = h - a - n.offset;
|
|
1389
1389
|
break;
|
|
1390
1390
|
case "right":
|
|
1391
|
-
f =
|
|
1391
|
+
f = c + (Z - r) / 2, k = h + N + n.offset;
|
|
1392
1392
|
break;
|
|
1393
1393
|
case "right-start":
|
|
1394
|
-
f =
|
|
1394
|
+
f = c, k = h + N + n.offset;
|
|
1395
1395
|
break;
|
|
1396
1396
|
case "right-end":
|
|
1397
|
-
f =
|
|
1397
|
+
f = c + Z - r, k = h + N + n.offset;
|
|
1398
1398
|
break;
|
|
1399
1399
|
}
|
|
1400
|
-
const M = window.innerWidth,
|
|
1401
|
-
return
|
|
1402
|
-
}
|
|
1403
|
-
function R() {
|
|
1404
|
-
n.disabled || C.value || (G(), n.openDelay > 0 ? g = setTimeout(() => {
|
|
1405
|
-
j();
|
|
1406
|
-
}, n.openDelay) : j());
|
|
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 };
|
|
1407
1402
|
}
|
|
1408
|
-
function
|
|
1409
|
-
|
|
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
|
-
g && (clearTimeout(g), g = null),
|
|
1423
|
+
function J() {
|
|
1424
|
+
g && (clearTimeout(g), g = null), b && (clearTimeout(b), b = null);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function W() {
|
|
1427
1427
|
if (!n.showArrow || !I.value || !L.value) {
|
|
1428
1428
|
w.value = {};
|
|
1429
1429
|
return;
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1432
|
-
if (
|
|
1431
|
+
const N = I.value, Z = L.value.getBoundingClientRect();
|
|
1432
|
+
if (Z.width === 0 || Z.height === 0) {
|
|
1433
1433
|
const h = {};
|
|
1434
1434
|
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%", w.value = h;
|
|
1435
1435
|
return;
|
|
1436
1436
|
}
|
|
1437
|
-
const
|
|
1437
|
+
const c = {};
|
|
1438
1438
|
if (n.placement.startsWith("top")) {
|
|
1439
|
-
|
|
1440
|
-
const h =
|
|
1441
|
-
|
|
1439
|
+
c.bottom = "-6px";
|
|
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
|
-
|
|
1444
|
-
const h =
|
|
1445
|
-
|
|
1443
|
+
c.top = "-6px";
|
|
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
|
-
|
|
1448
|
-
const h =
|
|
1449
|
-
|
|
1447
|
+
c.right = "-6px";
|
|
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
|
-
|
|
1452
|
-
const h =
|
|
1453
|
-
|
|
1451
|
+
c.left = "-6px";
|
|
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
|
-
w.value =
|
|
1455
|
+
w.value = c;
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1458
|
-
|
|
1459
|
-
L.value && (x.value = L.value.getBoundingClientRect(),
|
|
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
1465
|
function Y() {
|
|
1466
|
-
n.disabled || n.trigger !== "hover" || (
|
|
1466
|
+
n.disabled || n.trigger !== "hover" || (J(), A());
|
|
1467
1467
|
}
|
|
1468
1468
|
function ee() {
|
|
1469
|
-
n.disabled || n.trigger !== "hover" ||
|
|
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
|
-
function
|
|
1477
|
+
function we(N) {
|
|
1478
1478
|
if (!n.closeOnClickOutside || !C.value) return;
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1481
|
-
}
|
|
1482
|
-
return oe(() => n.modelValue, (
|
|
1483
|
-
|
|
1484
|
-
}), oe(C, (
|
|
1485
|
-
|
|
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",
|
|
1492
|
-
}),
|
|
1493
|
-
n.modelValue &&
|
|
1491
|
+
})) : (document.removeEventListener("click", we), window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0));
|
|
1492
|
+
}), $e(() => {
|
|
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
|
-
}), (
|
|
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
|
-
ref:
|
|
1503
|
+
ref: p
|
|
1504
1504
|
}, [
|
|
1505
1505
|
o("div", {
|
|
1506
1506
|
ref_key: "triggerRef",
|
|
1507
|
-
ref:
|
|
1508
|
-
onClick:
|
|
1507
|
+
ref: y,
|
|
1508
|
+
onClick: R,
|
|
1509
1509
|
onMouseenter: Y,
|
|
1510
1510
|
onMouseleave: ee
|
|
1511
1511
|
}, [
|
|
1512
|
-
ce(
|
|
1512
|
+
ce(N.$slots, "reference", {}, void 0, !0)
|
|
1513
1513
|
], 544),
|
|
1514
|
-
(i(),
|
|
1515
|
-
de(
|
|
1516
|
-
default:
|
|
1514
|
+
(i(), Se(Fe, { to: "body" }, [
|
|
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
1520
|
ref: L,
|
|
1521
|
-
class:
|
|
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
|
-
ce(
|
|
1540
|
+
ce(N.$slots, "default", {}, void 0, !0)
|
|
1541
1541
|
])
|
|
1542
|
-
], 38)) :
|
|
1542
|
+
], 38)) : H("", !0)
|
|
1543
1543
|
]),
|
|
1544
1544
|
_: 3
|
|
1545
1545
|
})
|
|
1546
1546
|
]))
|
|
1547
1547
|
], 512));
|
|
1548
1548
|
}
|
|
1549
|
-
}), Dn = /* @__PURE__ */
|
|
1549
|
+
}), Dn = /* @__PURE__ */ me(Cn, [["__scopeId", "data-v-be755399"]]), _n = { class: "relative" }, Sn = ["value", "placeholder"], Ln = { class: "nh-time-suffix" }, Mn = { class: "nh-time-shortcuts" }, In = { class: "nh-time-shortcuts-list" }, En = ["onClick", "onKeydown", "onMouseenter"], Bn = { class: "nh-time-custom" }, Tn = { class: "nh-time-custom-header" }, Kn = { class: "nh-time-selection-status" }, zn = {
|
|
1550
1550
|
key: 0,
|
|
1551
1551
|
class: "status-text"
|
|
1552
1552
|
}, Hn = {
|
|
1553
1553
|
key: 1,
|
|
1554
1554
|
class: "status-text"
|
|
1555
|
-
},
|
|
1555
|
+
}, Rn = {
|
|
1556
1556
|
key: 2,
|
|
1557
1557
|
class: "status-text status-complete"
|
|
1558
|
-
},
|
|
1558
|
+
}, Vn = { class: "nh-time-pickers" }, Wn = { class: "nh-time-picker" }, An = { class: "nh-date-picker" }, Fn = { class: "nh-date-picker-header" }, Pn = { class: "nh-date-picker-header-label" }, Yn = { class: "nh-date-picker-content" }, Nn = { class: "nh-date-table" }, On = ["onClick"], jn = { class: "nh-date-table-cell" }, qn = { key: 0 }, Un = { class: "nh-time-picker" }, Zn = { class: "nh-date-picker" }, Qn = { class: "nh-date-picker-header" }, Jn = { class: "nh-date-picker-header-label" }, Xn = { class: "nh-date-picker-content" }, Gn = { class: "nh-date-table" }, el = ["onClick"], tl = { class: "nh-date-table-cell" }, nl = { key: 0 }, ll = { class: "nh-time-actions" }, ol = /* @__PURE__ */ ge({
|
|
1559
1559
|
__name: "ytime",
|
|
1560
1560
|
props: {
|
|
1561
1561
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1606,7 +1606,7 @@ 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 = E(!1),
|
|
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({
|
|
@@ -1615,7 +1615,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1615
1615
|
}), g = E({
|
|
1616
1616
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1617
1617
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1618
|
-
}),
|
|
1618
|
+
}), b = () => {
|
|
1619
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
1621
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
@@ -1627,7 +1627,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1627
1627
|
const l = new Date(g.value.year, g.value.month - 1);
|
|
1628
1628
|
w.value.year = l.getFullYear(), w.value.month = l.getMonth();
|
|
1629
1629
|
}
|
|
1630
|
-
},
|
|
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,30 +1637,30 @@ 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
|
-
const v = s.getFullYear(), l = String(s.getMonth() + 1).padStart(2, "0"),
|
|
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) {
|
|
1644
1644
|
const D = String(s.getHours()).padStart(2, "0"), S = String(s.getMinutes()).padStart(2, "0"), _ = String(s.getSeconds()).padStart(2, "0");
|
|
1645
|
-
return `${v}-${l}-${
|
|
1645
|
+
return `${v}-${l}-${d} ${D}:${S}:${_}`;
|
|
1646
1646
|
} else
|
|
1647
|
-
return `${v}-${l}-${
|
|
1648
|
-
},
|
|
1649
|
-
startDate:
|
|
1650
|
-
endDate:
|
|
1651
|
-
} : { startDate: null, endDate: null },
|
|
1652
|
-
startDate:
|
|
1653
|
-
endDate:
|
|
1647
|
+
return `${v}-${l}-${d}`;
|
|
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++) {
|
|
1662
|
-
const
|
|
1663
|
-
if (
|
|
1662
|
+
const d = t.shortcuts[l].getValue();
|
|
1663
|
+
if (d.startDate && d.endDate && v.startDate && v.endDate) {
|
|
1664
1664
|
const D = new Date(
|
|
1665
1665
|
v.startDate.getFullYear(),
|
|
1666
1666
|
v.startDate.getMonth(),
|
|
@@ -1670,169 +1670,169 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1670
1670
|
v.endDate.getMonth(),
|
|
1671
1671
|
v.endDate.getDate()
|
|
1672
1672
|
), _ = new Date(
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1673
|
+
d.startDate.getFullYear(),
|
|
1674
|
+
d.startDate.getMonth(),
|
|
1675
|
+
d.startDate.getDate()
|
|
1676
1676
|
), T = new Date(
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1677
|
+
d.endDate.getFullYear(),
|
|
1678
|
+
d.endDate.getMonth(),
|
|
1679
|
+
d.endDate.getDate()
|
|
1680
1680
|
);
|
|
1681
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),
|
|
1688
|
-
for (let
|
|
1689
|
-
const
|
|
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
|
-
date:
|
|
1692
|
-
day:
|
|
1691
|
+
date: De,
|
|
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
|
|
1701
|
+
for (let ie = 1; ie <= S; ie++) {
|
|
1702
|
+
const De = new Date(s, v, ie);
|
|
1703
1703
|
_.push({
|
|
1704
|
-
date:
|
|
1705
|
-
day:
|
|
1704
|
+
date: De,
|
|
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
|
-
const
|
|
1714
|
-
for (let
|
|
1715
|
-
const
|
|
1713
|
+
const pe = 42 - _.length;
|
|
1714
|
+
for (let ie = 1; ie <= pe; ie++) {
|
|
1715
|
+
const De = new Date(s, v + 1, ie);
|
|
1716
1716
|
_.push({
|
|
1717
|
-
date:
|
|
1718
|
-
day:
|
|
1717
|
+
date: De,
|
|
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
|
|
1724
1724
|
// 禁用非当前月的日期
|
|
1725
1725
|
});
|
|
1726
1726
|
}
|
|
1727
|
-
const
|
|
1728
|
-
for (let
|
|
1729
|
-
|
|
1730
|
-
return
|
|
1731
|
-
},
|
|
1732
|
-
const v =
|
|
1727
|
+
const Ke = [];
|
|
1728
|
+
for (let ie = 0; ie < _.length; ie += 7)
|
|
1729
|
+
Ke.push(_.slice(ie, ie + 7));
|
|
1730
|
+
return Ke;
|
|
1731
|
+
}, ae = (s) => {
|
|
1732
|
+
const v = W(s);
|
|
1733
1733
|
n("update:modelValue", v), n("change", v);
|
|
1734
|
-
},
|
|
1734
|
+
}, we = () => {
|
|
1735
1735
|
if (!C.value || !I.value) return;
|
|
1736
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
1737
|
D < _ && S > _ ? x.value.top = !1 : x.value.top = !0;
|
|
1738
|
-
const T = l - s.left,
|
|
1739
|
-
T <
|
|
1740
|
-
},
|
|
1738
|
+
const T = l - s.left, U = v.width || 640;
|
|
1739
|
+
T < U ? x.value.left = !1 : x.value.left = !0;
|
|
1740
|
+
}, N = () => {
|
|
1741
1741
|
if (m.value = !m.value, m.value) {
|
|
1742
|
-
const s =
|
|
1743
|
-
if (
|
|
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
1744
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1745
1745
|
else {
|
|
1746
1746
|
const v = new Date(w.value.year, w.value.month + 1);
|
|
1747
1747
|
g.value.year = v.getFullYear(), g.value.month = v.getMonth();
|
|
1748
1748
|
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1749
|
+
b(), se(() => {
|
|
1750
|
+
we();
|
|
1751
1751
|
});
|
|
1752
1752
|
}
|
|
1753
|
-
},
|
|
1754
|
-
const v = s.target, l = C.value,
|
|
1755
|
-
l &&
|
|
1756
|
-
},
|
|
1757
|
-
s.key === "Enter" || s.key === " " ? (s.preventDefault(),
|
|
1758
|
-
|
|
1753
|
+
}, Z = (s) => {
|
|
1754
|
+
const v = s.target, l = C.value, d = I.value;
|
|
1755
|
+
l && d && !l.contains(v) && !d.contains(v) && (m.value = !1, p.value = -1);
|
|
1756
|
+
}, c = (s) => {
|
|
1757
|
+
s.key === "Enter" || s.key === " " ? (s.preventDefault(), N()) : s.key === "ArrowDown" && (s.preventDefault(), m.value = !0, se(() => {
|
|
1758
|
+
we(), k();
|
|
1759
1759
|
}));
|
|
1760
1760
|
}, h = (s) => {
|
|
1761
1761
|
var v;
|
|
1762
|
-
s.key === "Escape" && (m.value = !1,
|
|
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(),
|
|
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
|
-
|
|
1769
|
-
},
|
|
1770
|
-
|
|
1768
|
+
p.value = -1;
|
|
1769
|
+
}, k = () => {
|
|
1770
|
+
p.value = 0, M(0);
|
|
1771
1771
|
}, M = (s) => {
|
|
1772
1772
|
if (I.value) {
|
|
1773
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)),
|
|
1779
|
-
},
|
|
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
|
+
}, 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" || !
|
|
1783
|
-
|
|
1784
|
-
else if (
|
|
1785
|
-
if (l >=
|
|
1786
|
-
t.includeTime && l.setHours(23, 59, 59, 999),
|
|
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
|
+
if (l >= F.value)
|
|
1786
|
+
t.includeTime && l.setHours(23, 59, 59, 999), A.value = l;
|
|
1787
1787
|
else {
|
|
1788
|
-
const
|
|
1789
|
-
t.includeTime &&
|
|
1788
|
+
const d = F.value;
|
|
1789
|
+
t.includeTime && d.setHours(23, 59, 59, 999), A.value = d, F.value = l;
|
|
1790
1790
|
}
|
|
1791
1791
|
else
|
|
1792
|
-
|
|
1793
|
-
if (
|
|
1794
|
-
const
|
|
1795
|
-
t.includeTime &&
|
|
1796
|
-
startDate:
|
|
1797
|
-
endDate:
|
|
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
|
+
startDate: F.value,
|
|
1797
|
+
endDate: d
|
|
1798
1798
|
};
|
|
1799
1799
|
} else
|
|
1800
1800
|
L.value = null;
|
|
1801
|
-
},
|
|
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"),
|
|
1805
|
-
}, ne = () => {
|
|
1806
|
-
L.value && (t.includeTime && L.value.endDate && L.value.endDate.setHours(23, 59, 59, 999), fe(L.value), p.value = ee(L.value), m.value = !1);
|
|
1807
|
-
}, Se = () => {
|
|
1808
|
-
fe({ startDate: null, endDate: null }), We(), y.value = -1, m.value = !1;
|
|
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;
|
|
1809
1805
|
}, ye = () => {
|
|
1810
|
-
|
|
1811
|
-
|
|
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
|
+
}, Le = () => {
|
|
1808
|
+
ae({ startDate: null, endDate: null }), We(), p.value = -1, m.value = !1;
|
|
1809
|
+
}, Ce = () => {
|
|
1810
|
+
m.value && se(() => {
|
|
1811
|
+
we();
|
|
1812
1812
|
});
|
|
1813
|
-
},
|
|
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
1818
|
const S = String(D.getFullYear()), _ = String(D.getMonth() + 1).padStart(2, "0"), T = String(D.getDate()).padStart(2, "0");
|
|
1819
1819
|
return `${S}/${_}/${T}`;
|
|
1820
|
-
}, l = v(s.startDate),
|
|
1821
|
-
return !t.includeTime && l ===
|
|
1822
|
-
}),
|
|
1820
|
+
}, l = v(s.startDate), d = v(s.endDate);
|
|
1821
|
+
return !t.includeTime && l === d ? l : `${l} - ${d}`;
|
|
1822
|
+
}), Re = O(() => [
|
|
1823
1823
|
"nh-time-dropdown",
|
|
1824
1824
|
{
|
|
1825
1825
|
"nh-time-dropdown-top": !x.value.top,
|
|
1826
1826
|
"nh-time-dropdown-right": !x.value.left
|
|
1827
1827
|
}
|
|
1828
|
-
]),
|
|
1829
|
-
const s =
|
|
1828
|
+
]), Ve = O(() => {
|
|
1829
|
+
const s = J(t.modelValue);
|
|
1830
1830
|
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1831
|
-
}), Ye =
|
|
1832
|
-
|
|
1831
|
+
}), Ye = O(() => !!(F.value && A.value)), We = () => {
|
|
1832
|
+
F.value = null, A.value = null, L.value = null, y.value = -1;
|
|
1833
1833
|
};
|
|
1834
1834
|
oe(() => t.modelValue, (s) => {
|
|
1835
|
-
const v =
|
|
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();
|
|
@@ -1844,49 +1844,49 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1844
1844
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
1845
1845
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1846
1846
|
}
|
|
1847
|
-
(v != null && v.startDate || v != null && v.endDate) &&
|
|
1847
|
+
(v != null && v.startDate || v != null && v.endDate) && b(), m.value || (y.value = ee(s));
|
|
1848
1848
|
}, { immediate: !0, deep: !0 }), oe([w, g], () => {
|
|
1849
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
1851
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
1852
1852
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1853
1853
|
}
|
|
1854
|
-
}, { deep: !0 }),
|
|
1855
|
-
document.addEventListener("click",
|
|
1856
|
-
const s =
|
|
1854
|
+
}, { deep: !0 }), $e(() => {
|
|
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
1857
|
if (s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1858
1858
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1859
1859
|
else {
|
|
1860
1860
|
const v = new Date(w.value.year, w.value.month + 1);
|
|
1861
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
1871
|
const l = new Date(w.value.year, w.value.month + v, 1);
|
|
1872
|
-
w.value.year = l.getFullYear(), w.value.month = l.getMonth(),
|
|
1872
|
+
w.value.year = l.getFullYear(), w.value.month = l.getMonth(), b();
|
|
1873
1873
|
} else {
|
|
1874
1874
|
const l = new Date(g.value.year, g.value.month + v, 1);
|
|
1875
1875
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth(), V();
|
|
1876
1876
|
}
|
|
1877
1877
|
};
|
|
1878
1878
|
return (s, v) => {
|
|
1879
|
-
const l =
|
|
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", {
|
|
1885
1885
|
ref_key: "trigger",
|
|
1886
1886
|
ref: C,
|
|
1887
|
-
onClick:
|
|
1888
|
-
onKeydown:
|
|
1889
|
-
class:
|
|
1887
|
+
onClick: N,
|
|
1888
|
+
onKeydown: c,
|
|
1889
|
+
class: K(["nh-time-trigger", { "is-focus": m.value, "has-value": Ve.value }]),
|
|
1890
1890
|
tabindex: "0"
|
|
1891
1891
|
}, [
|
|
1892
1892
|
o("input", {
|
|
@@ -1896,9 +1896,9 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1896
1896
|
class: "nh-time-input"
|
|
1897
1897
|
}, null, 8, Sn),
|
|
1898
1898
|
o("span", Ln, [
|
|
1899
|
-
e.clearable &&
|
|
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,48 +1940,48 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
1940
1940
|
])], 2)
|
|
1941
1941
|
])
|
|
1942
1942
|
], 34),
|
|
1943
|
-
de(
|
|
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
1948
|
ref: I,
|
|
1949
|
-
class:
|
|
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(
|
|
1956
|
-
key:
|
|
1957
|
-
onClick: (S) =>
|
|
1955
|
+
(i(!0), u(re, null, ve(e.shortcuts, (d, D) => (i(), u("li", {
|
|
1956
|
+
key: d.label,
|
|
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
|
-
"is-active":
|
|
1965
|
-
"is-selected":
|
|
1964
|
+
"is-active": p.value === D,
|
|
1965
|
+
"is-selected": y.value === D
|
|
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
|
-
o("div",
|
|
1976
|
-
!
|
|
1975
|
+
o("div", Kn, [
|
|
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
|
-
o("div",
|
|
1979
|
+
o("div", Vn, [
|
|
1980
1980
|
o("div", Wn, [
|
|
1981
|
-
o("div",
|
|
1981
|
+
o("div", An, [
|
|
1982
1982
|
o("div", Fn, [
|
|
1983
1983
|
o("button", {
|
|
1984
|
-
onClick: v[0] || (v[0] = (
|
|
1984
|
+
onClick: v[0] || (v[0] = (d) => Te("start", -1)),
|
|
1985
1985
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
1986
1986
|
type: "button"
|
|
1987
1987
|
}, [...v[9] || (v[9] = [
|
|
@@ -1996,9 +1996,9 @@ 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
|
-
onClick: v[1] || (v[1] = (
|
|
2001
|
+
onClick: v[1] || (v[1] = (d) => Te("start", 1)),
|
|
2002
2002
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2003
2003
|
type: "button"
|
|
2004
2004
|
}, [...v[10] || (v[10] = [
|
|
@@ -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(
|
|
2022
|
-
key:
|
|
2021
|
+
(i(), u(re, null, ve(j, (d) => o("th", {
|
|
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: (T) =>
|
|
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))
|
|
@@ -2047,7 +2047,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2047
2047
|
o("div", Zn, [
|
|
2048
2048
|
o("div", Qn, [
|
|
2049
2049
|
o("button", {
|
|
2050
|
-
onClick: v[2] || (v[2] = (
|
|
2050
|
+
onClick: v[2] || (v[2] = (d) => Te("end", -1)),
|
|
2051
2051
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
2052
2052
|
type: "button"
|
|
2053
2053
|
}, [...v[11] || (v[11] = [
|
|
@@ -2062,9 +2062,9 @@ 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
|
-
onClick: v[3] || (v[3] = (
|
|
2067
|
+
onClick: v[3] || (v[3] = (d) => Te("end", 1)),
|
|
2068
2068
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2069
2069
|
type: "button"
|
|
2070
2070
|
}, [...v[12] || (v[12] = [
|
|
@@ -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(
|
|
2088
|
-
key:
|
|
2087
|
+
(i(), u(re, null, ve(j, (d) => o("th", {
|
|
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: (T) =>
|
|
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))
|
|
@@ -2111,31 +2111,31 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2111
2111
|
])
|
|
2112
2112
|
]),
|
|
2113
2113
|
o("div", ll, [
|
|
2114
|
-
e.clearable ? (i(),
|
|
2114
|
+
e.clearable ? (i(), Se(l, {
|
|
2115
2115
|
key: 0,
|
|
2116
|
-
onClick:
|
|
2116
|
+
onClick: Le,
|
|
2117
2117
|
variant: "secondary",
|
|
2118
2118
|
size: e.size
|
|
2119
2119
|
}, {
|
|
2120
|
-
default:
|
|
2121
|
-
|
|
2120
|
+
default: fe(() => [...v[13] || (v[13] = [
|
|
2121
|
+
xe(" 清空 ", -1)
|
|
2122
2122
|
])]),
|
|
2123
2123
|
_: 1
|
|
2124
|
-
}, 8, ["size"])) :
|
|
2124
|
+
}, 8, ["size"])) : H("", !0),
|
|
2125
2125
|
de(l, {
|
|
2126
|
-
onClick:
|
|
2126
|
+
onClick: ye,
|
|
2127
2127
|
disabled: !Ye.value,
|
|
2128
2128
|
variant: "primary",
|
|
2129
2129
|
size: e.size
|
|
2130
2130
|
}, {
|
|
2131
|
-
default:
|
|
2132
|
-
|
|
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,11 +2143,11 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2143
2143
|
], 2);
|
|
2144
2144
|
};
|
|
2145
2145
|
}
|
|
2146
|
-
}), nt = /* @__PURE__ */
|
|
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"
|
|
2150
|
-
}, rl = /* @__PURE__ */
|
|
2150
|
+
}, rl = /* @__PURE__ */ ge({
|
|
2151
2151
|
__name: "yswitch",
|
|
2152
2152
|
props: {
|
|
2153
2153
|
modelValue: { default: !1 },
|
|
@@ -2164,47 +2164,47 @@ 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 = E(),
|
|
2167
|
+
const t = e, n = $, m = E(), p = O(() => t.modelValue === t.trueValue), y = O(() => {
|
|
2168
2168
|
const C = {};
|
|
2169
|
-
return C.background =
|
|
2169
|
+
return C.background = p.value ? t.activeColor : t.inactiveColor, C;
|
|
2170
2170
|
});
|
|
2171
2171
|
function L() {
|
|
2172
2172
|
if (t.disabled || t.loading) return;
|
|
2173
|
-
const C =
|
|
2173
|
+
const C = p.value ? t.falseValue : t.trueValue;
|
|
2174
2174
|
n("update:modelValue", C), n("change", C);
|
|
2175
2175
|
}
|
|
2176
|
-
return
|
|
2176
|
+
return $e(() => {
|
|
2177
2177
|
const C = m.value;
|
|
2178
2178
|
C && (C.addEventListener("focus", (I) => n("focus", I)), C.addEventListener("blur", (I) => n("blur", I)));
|
|
2179
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
|
-
{ "yswitch--checked":
|
|
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
|
-
"aria-checked":
|
|
2188
|
+
"aria-checked": p.value,
|
|
2189
2189
|
"aria-disabled": e.disabled,
|
|
2190
2190
|
disabled: e.disabled || e.loading,
|
|
2191
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
|
-
}), ul = /* @__PURE__ */
|
|
2207
|
+
}), ul = /* @__PURE__ */ me(rl, [["__scopeId", "data-v-0b157fc4"]]), cl = ["src", "alt"], dl = ["src", "alt"], fl = /* @__PURE__ */ ge({
|
|
2208
2208
|
__name: "yimage",
|
|
2209
2209
|
props: {
|
|
2210
2210
|
src: {},
|
|
@@ -2216,15 +2216,14 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2216
2216
|
fit: { default: "cover" },
|
|
2217
2217
|
radius: { default: "0" },
|
|
2218
2218
|
className: { default: "" },
|
|
2219
|
-
previewSrcList: {}
|
|
2220
|
-
autoAspect: { type: Boolean, default: !1 }
|
|
2219
|
+
previewSrcList: {}
|
|
2221
2220
|
},
|
|
2222
2221
|
emits: ["load", "error", "preview"],
|
|
2223
2222
|
setup(e, { expose: $, emit: t }) {
|
|
2224
|
-
const n = e, m = t,
|
|
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({
|
|
2225
2224
|
overflow: "",
|
|
2226
2225
|
paddingRight: ""
|
|
2227
|
-
}),
|
|
2226
|
+
}), q = {
|
|
2228
2227
|
none: "0px",
|
|
2229
2228
|
sm: "0.125rem",
|
|
2230
2229
|
md: "0.375rem",
|
|
@@ -2232,129 +2231,120 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2232
2231
|
xl: "0.75rem",
|
|
2233
2232
|
"2xl": "1rem",
|
|
2234
2233
|
full: "9999px"
|
|
2235
|
-
},
|
|
2236
|
-
const A = {};
|
|
2237
|
-
return n.width && (A.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.height && !n.autoAspect && (A.height = typeof n.height == "number" ? `${n.height}px` : n.height), n.autoAspect && (R.value && (A.aspectRatio = `${R.value.width} / ${R.value.height}`), n.height || (A.height = "auto")), H.value && (A.borderRadius = H.value), A;
|
|
2238
|
-
}), H = N(() => {
|
|
2234
|
+
}, Q = O(() => n.className || ""), le = O(() => {
|
|
2239
2235
|
if (typeof n.radius == "number")
|
|
2240
2236
|
return `${n.radius}px`;
|
|
2241
2237
|
if (typeof n.radius == "string") {
|
|
2242
2238
|
if (/(px|%|rem|em)$/.test(n.radius))
|
|
2243
2239
|
return n.radius;
|
|
2244
|
-
if (
|
|
2245
|
-
return
|
|
2240
|
+
if (q[n.radius])
|
|
2241
|
+
return q[n.radius];
|
|
2246
2242
|
}
|
|
2247
2243
|
return "";
|
|
2248
|
-
}),
|
|
2249
|
-
borderRadius:
|
|
2250
|
-
} : {}), W =
|
|
2244
|
+
}), J = O(() => le.value ? {
|
|
2245
|
+
borderRadius: le.value
|
|
2246
|
+
} : {}), W = O(() => [
|
|
2251
2247
|
"yimage-image",
|
|
2252
2248
|
n.preview ? "is-previewable" : ""
|
|
2253
|
-
].filter(Boolean).join(" ")),
|
|
2254
|
-
const
|
|
2255
|
-
objectFit: n.
|
|
2256
|
-
backgroundColor: "#fff"
|
|
2257
|
-
width: "100%",
|
|
2258
|
-
height: "100%"
|
|
2249
|
+
].filter(Boolean).join(" ")), z = O(() => {
|
|
2250
|
+
const B = {
|
|
2251
|
+
objectFit: n.fit || "cover",
|
|
2252
|
+
backgroundColor: "#fff"
|
|
2259
2253
|
};
|
|
2260
|
-
return
|
|
2261
|
-
}),
|
|
2262
|
-
const
|
|
2263
|
-
|
|
2264
|
-
const
|
|
2265
|
-
return document.body.removeChild(
|
|
2266
|
-
},
|
|
2267
|
-
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 = {
|
|
2268
2262
|
overflow: document.body.style.overflow || "",
|
|
2269
2263
|
paddingRight: document.body.style.paddingRight || ""
|
|
2270
2264
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2271
|
-
const
|
|
2272
|
-
document.body.style.paddingRight = `${
|
|
2265
|
+
const P = Y();
|
|
2266
|
+
document.body.style.paddingRight = `${P}px`;
|
|
2273
2267
|
}
|
|
2274
2268
|
document.body.style.overflow = "hidden";
|
|
2275
|
-
},
|
|
2276
|
-
document.body.style.overflow =
|
|
2269
|
+
}, X = () => {
|
|
2270
|
+
document.body.style.overflow = A.value.overflow, document.body.style.paddingRight = A.value.paddingRight;
|
|
2277
2271
|
};
|
|
2278
|
-
let
|
|
2279
|
-
const
|
|
2280
|
-
!n.lazy || !
|
|
2281
|
-
(
|
|
2282
|
-
|
|
2283
|
-
|
|
2272
|
+
let ae = null;
|
|
2273
|
+
const we = () => {
|
|
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));
|
|
2284
2278
|
});
|
|
2285
2279
|
},
|
|
2286
2280
|
{
|
|
2287
2281
|
rootMargin: "50px"
|
|
2288
2282
|
}
|
|
2289
|
-
),
|
|
2290
|
-
},
|
|
2291
|
-
C.value = !0, I.value = !1, x.value = !1,
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
}, a = () => {
|
|
2298
|
-
x.value = !1, I.value = !0, C.value = !1, ae(() => {
|
|
2299
|
-
p.value && (p.value.src = n.src);
|
|
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
|
+
}, c = () => {
|
|
2289
|
+
x.value = !1, I.value = !0, C.value = !1, se(() => {
|
|
2290
|
+
y.value && (y.value.src = n.src);
|
|
2300
2291
|
});
|
|
2301
|
-
},
|
|
2302
|
-
n.preview && (n.previewSrcList || n.src) ?
|
|
2303
|
-
},
|
|
2292
|
+
}, h = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, a = () => {
|
|
2293
|
+
n.preview && (n.previewSrcList || n.src) ? r() : c();
|
|
2294
|
+
}, r = () => {
|
|
2304
2295
|
if (!n.preview) return;
|
|
2305
|
-
|
|
2306
|
-
const
|
|
2307
|
-
if (
|
|
2308
|
-
V.value =
|
|
2309
|
-
g.value = !0,
|
|
2296
|
+
j.value = 1;
|
|
2297
|
+
const B = h();
|
|
2298
|
+
if (y.value && y.value.complete && y.value.naturalWidth > 0) {
|
|
2299
|
+
V.value = B, se(() => {
|
|
2300
|
+
g.value = !0, ee(), m("preview", B);
|
|
2310
2301
|
});
|
|
2311
2302
|
return;
|
|
2312
2303
|
}
|
|
2313
|
-
const
|
|
2314
|
-
let
|
|
2315
|
-
const
|
|
2316
|
-
ye || (ye = !0,
|
|
2317
|
-
g.value = !0,
|
|
2304
|
+
const P = new Image();
|
|
2305
|
+
let te = null, ye = !1;
|
|
2306
|
+
const Le = () => {
|
|
2307
|
+
ye || (ye = !0, te && (clearTimeout(te), te = null), V.value = B, se(() => {
|
|
2308
|
+
g.value = !0, ee(), m("preview", B);
|
|
2318
2309
|
}));
|
|
2319
2310
|
};
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
}, 500),
|
|
2323
|
-
|
|
2324
|
-
},
|
|
2325
|
-
|
|
2326
|
-
},
|
|
2327
|
-
},
|
|
2311
|
+
te = setTimeout(() => {
|
|
2312
|
+
Le();
|
|
2313
|
+
}, 500), P.onload = () => {
|
|
2314
|
+
Le();
|
|
2315
|
+
}, P.onerror = () => {
|
|
2316
|
+
Le();
|
|
2317
|
+
}, P.src = B, P.complete && Le();
|
|
2318
|
+
}, f = () => {
|
|
2328
2319
|
g.value = !1, setTimeout(() => {
|
|
2329
|
-
|
|
2320
|
+
X();
|
|
2330
2321
|
}, 300);
|
|
2331
|
-
},
|
|
2332
|
-
const
|
|
2333
|
-
let ye =
|
|
2334
|
-
ye = Math.max(0.5, Math.min(2, ye)),
|
|
2322
|
+
}, k = (B) => {
|
|
2323
|
+
const P = B.deltaY < 0 ? 1 : -1;
|
|
2324
|
+
let ye = j.value + P * 0.1;
|
|
2325
|
+
ye = Math.max(0.5, Math.min(2, ye)), j.value = ye;
|
|
2335
2326
|
};
|
|
2336
|
-
return
|
|
2337
|
-
n.lazy ?
|
|
2327
|
+
return $e(() => {
|
|
2328
|
+
n.lazy ? we() : w.value = !0, w.value && (I.value = !0), F.value = !0;
|
|
2338
2329
|
}), Be(() => {
|
|
2339
|
-
|
|
2340
|
-
}), oe(() =>
|
|
2341
|
-
n.src && w.value && (I.value = !0, x.value = !1, C.value = !1)
|
|
2342
|
-
}), oe(() => n.src, (
|
|
2343
|
-
|
|
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 || "";
|
|
2344
2335
|
}), $({
|
|
2345
|
-
retryLoad:
|
|
2346
|
-
closePreview:
|
|
2347
|
-
}), (
|
|
2336
|
+
retryLoad: c,
|
|
2337
|
+
closePreview: f
|
|
2338
|
+
}), (B, P) => (i(), u("div", {
|
|
2348
2339
|
ref_key: "containerRef",
|
|
2349
|
-
ref:
|
|
2350
|
-
class:
|
|
2351
|
-
style: ie(G.value)
|
|
2340
|
+
ref: p,
|
|
2341
|
+
class: K(["yimage-container", Q.value])
|
|
2352
2342
|
}, [
|
|
2353
2343
|
!C.value && !x.value && !w.value ? (i(), u("div", {
|
|
2354
2344
|
key: 0,
|
|
2355
2345
|
class: "yimage-placeholder",
|
|
2356
|
-
style:
|
|
2357
|
-
}, [...
|
|
2346
|
+
style: ue(J.value)
|
|
2347
|
+
}, [...P[1] || (P[1] = [
|
|
2358
2348
|
o("div", { class: "yimage-placeholder-content" }, [
|
|
2359
2349
|
o("svg", {
|
|
2360
2350
|
class: "yimage-placeholder-icon",
|
|
@@ -2370,81 +2360,81 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2370
2360
|
})
|
|
2371
2361
|
])
|
|
2372
2362
|
], -1)
|
|
2373
|
-
])], 4)) :
|
|
2363
|
+
])], 4)) : H("", !0),
|
|
2374
2364
|
I.value && !x.value ? (i(), u("div", {
|
|
2375
2365
|
key: 1,
|
|
2376
2366
|
class: "yimage-loading",
|
|
2377
|
-
style:
|
|
2378
|
-
}, [...
|
|
2367
|
+
style: ue(J.value)
|
|
2368
|
+
}, [...P[2] || (P[2] = [
|
|
2379
2369
|
o("div", { class: "yimage-loading-content" }, [
|
|
2380
2370
|
o("div", { class: "yimage-spinner" })
|
|
2381
2371
|
], -1)
|
|
2382
|
-
])], 4)) :
|
|
2372
|
+
])], 4)) : H("", !0),
|
|
2383
2373
|
x.value ? (i(), u("div", {
|
|
2384
2374
|
key: 2,
|
|
2385
2375
|
class: "yimage-error",
|
|
2386
|
-
style:
|
|
2387
|
-
onClick:
|
|
2376
|
+
style: ue(J.value),
|
|
2377
|
+
onClick: a
|
|
2388
2378
|
}, [
|
|
2389
2379
|
o("img", {
|
|
2390
2380
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2391
2381
|
alt: "Error Image",
|
|
2392
2382
|
class: "yimage-error-image",
|
|
2393
|
-
style:
|
|
2383
|
+
style: ue(J.value)
|
|
2394
2384
|
}, null, 4)
|
|
2395
|
-
], 4)) :
|
|
2385
|
+
], 4)) : H("", !0),
|
|
2396
2386
|
Ee(o("img", {
|
|
2397
2387
|
ref_key: "imageRef",
|
|
2398
|
-
ref:
|
|
2399
|
-
src:
|
|
2388
|
+
ref: y,
|
|
2389
|
+
src: b.value,
|
|
2400
2390
|
alt: e.alt,
|
|
2401
|
-
class:
|
|
2402
|
-
onLoad:
|
|
2403
|
-
onError:
|
|
2404
|
-
onClick:
|
|
2405
|
-
style:
|
|
2391
|
+
class: K(W.value),
|
|
2392
|
+
onLoad: N,
|
|
2393
|
+
onError: Z,
|
|
2394
|
+
onClick: G(r, ["stop"]),
|
|
2395
|
+
style: ue(z.value)
|
|
2406
2396
|
}, null, 46, cl), [
|
|
2407
|
-
[
|
|
2397
|
+
[ze, C.value && !x.value]
|
|
2408
2398
|
]),
|
|
2409
2399
|
n.preview && (!C.value || I.value || x.value || !w.value) ? (i(), u("div", {
|
|
2410
2400
|
key: 3,
|
|
2411
2401
|
class: "yimage-preview-trigger",
|
|
2412
|
-
onClick:
|
|
2413
|
-
})) :
|
|
2414
|
-
|
|
2402
|
+
onClick: G(r, ["stop"])
|
|
2403
|
+
})) : H("", !0),
|
|
2404
|
+
F.value ? (i(), Se(Fe, {
|
|
2415
2405
|
key: 4,
|
|
2416
2406
|
to: "body"
|
|
2417
2407
|
}, [
|
|
2418
|
-
de(
|
|
2419
|
-
default:
|
|
2408
|
+
de(be, { name: "fade" }, {
|
|
2409
|
+
default: fe(() => [
|
|
2420
2410
|
g.value ? (i(), u("div", {
|
|
2421
2411
|
key: 0,
|
|
2422
2412
|
class: "yimage-preview-mask",
|
|
2423
|
-
onClick:
|
|
2424
|
-
onWheel:
|
|
2413
|
+
onClick: G(f, ["self"]),
|
|
2414
|
+
onWheel: G(k, ["prevent"])
|
|
2425
2415
|
}, [
|
|
2426
2416
|
o("div", {
|
|
2427
|
-
class:
|
|
2417
|
+
class: K(["yimage-preview-content", { "is-active": g.value }])
|
|
2428
2418
|
}, [
|
|
2429
2419
|
o("img", {
|
|
2430
2420
|
ref_key: "previewImageRef",
|
|
2431
2421
|
ref: L,
|
|
2432
|
-
src:
|
|
2422
|
+
src: R.value,
|
|
2433
2423
|
alt: e.alt,
|
|
2434
2424
|
class: "yimage-preview-image",
|
|
2435
|
-
style:
|
|
2436
|
-
onClick:
|
|
2425
|
+
style: ue({ transform: `scale(${j.value})` }),
|
|
2426
|
+
onClick: P[0] || (P[0] = G(() => {
|
|
2437
2427
|
}, ["stop"]))
|
|
2438
2428
|
}, null, 12, dl)
|
|
2439
2429
|
], 2)
|
|
2440
|
-
], 32)) :
|
|
2430
|
+
], 32)) : H("", !0)
|
|
2441
2431
|
]),
|
|
2442
2432
|
_: 1
|
|
2443
2433
|
})
|
|
2444
|
-
])) :
|
|
2445
|
-
],
|
|
2434
|
+
])) : H("", !0)
|
|
2435
|
+
], 2));
|
|
2446
2436
|
}
|
|
2447
|
-
}), vl = /* @__PURE__ */
|
|
2437
|
+
}), vl = /* @__PURE__ */ me(fl, [["__scopeId", "data-v-c1a55c52"]]), hl = /* @__PURE__ */ ge({
|
|
2448
2438
|
__name: "ydropdown",
|
|
2449
2439
|
props: {
|
|
2450
2440
|
trigger: { default: "hover" },
|
|
@@ -2455,7 +2445,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2455
2445
|
setup(e) {
|
|
2456
2446
|
const $ = e, t = E(!1), n = E();
|
|
2457
2447
|
let m = null;
|
|
2458
|
-
const
|
|
2448
|
+
const p = O(() => `y-dropdown__menu--${$.placement}`), y = O(() => {
|
|
2459
2449
|
if (!$.menuWidth) return {};
|
|
2460
2450
|
const g = typeof $.menuWidth == "number" ? `${$.menuWidth}px` : $.menuWidth;
|
|
2461
2451
|
return {
|
|
@@ -2464,7 +2454,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2464
2454
|
maxWidth: g
|
|
2465
2455
|
};
|
|
2466
2456
|
}), L = () => {
|
|
2467
|
-
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value),
|
|
2457
|
+
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value), se(() => {
|
|
2468
2458
|
I();
|
|
2469
2459
|
}));
|
|
2470
2460
|
}, C = () => {
|
|
@@ -2473,52 +2463,52 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2473
2463
|
}, 150);
|
|
2474
2464
|
}, I = () => {
|
|
2475
2465
|
if (!n.value) return;
|
|
2476
|
-
const g = n.value.querySelector(".y-dropdown__trigger"),
|
|
2477
|
-
if (!g || !
|
|
2478
|
-
const V = g.getBoundingClientRect(),
|
|
2479
|
-
|
|
2480
|
-
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;
|
|
2481
2471
|
switch ($.placement) {
|
|
2482
2472
|
case "bottom":
|
|
2483
|
-
|
|
2473
|
+
q = V.height + 4, Q = 0;
|
|
2484
2474
|
break;
|
|
2485
2475
|
case "top":
|
|
2486
|
-
|
|
2476
|
+
q = -(j.height + 4), Q = 0;
|
|
2487
2477
|
break;
|
|
2488
2478
|
case "right":
|
|
2489
|
-
|
|
2479
|
+
q = 0, Q = V.width + 4;
|
|
2490
2480
|
break;
|
|
2491
2481
|
case "left":
|
|
2492
|
-
|
|
2482
|
+
q = 0, Q = -(j.width + 4);
|
|
2493
2483
|
break;
|
|
2494
2484
|
}
|
|
2495
|
-
let
|
|
2485
|
+
let le = V.top + q, J = V.left + Q;
|
|
2496
2486
|
if ($.placement === "bottom" || $.placement === "top") {
|
|
2497
|
-
const
|
|
2498
|
-
|
|
2487
|
+
const W = j.width || 260;
|
|
2488
|
+
J + W > F - 10 && (J = F - W - 10), J < 10 && (J = 10);
|
|
2499
2489
|
}
|
|
2500
2490
|
if ($.placement === "left" || $.placement === "right") {
|
|
2501
|
-
const
|
|
2502
|
-
|
|
2491
|
+
const W = j.height || 200;
|
|
2492
|
+
le + W > A - 10 && (le = A - W - 10), le < 10 && (le = 10);
|
|
2503
2493
|
}
|
|
2504
|
-
|
|
2494
|
+
b.style.top = `${le}px`, b.style.left = `${J}px`;
|
|
2505
2495
|
}, x = (g) => {
|
|
2506
2496
|
$.trigger === "click" && n.value && !n.value.contains(g.target) && (t.value = !1);
|
|
2507
2497
|
}, w = () => {
|
|
2508
2498
|
t.value && I();
|
|
2509
2499
|
};
|
|
2510
|
-
return
|
|
2500
|
+
return $e(() => {
|
|
2511
2501
|
$.trigger === "click" && document.addEventListener("click", x), window.addEventListener("resize", w), window.addEventListener("scroll", w);
|
|
2512
2502
|
}), Be(() => {
|
|
2513
2503
|
$.trigger === "click" && document.removeEventListener("click", x), m && clearTimeout(m), window.removeEventListener("resize", w), window.removeEventListener("scroll", w);
|
|
2514
2504
|
}), oe(
|
|
2515
2505
|
() => $.menuWidth,
|
|
2516
2506
|
() => {
|
|
2517
|
-
t.value &&
|
|
2507
|
+
t.value && se(() => {
|
|
2518
2508
|
I();
|
|
2519
2509
|
});
|
|
2520
2510
|
}
|
|
2521
|
-
), (g,
|
|
2511
|
+
), (g, b) => (i(), u("div", {
|
|
2522
2512
|
class: "y-dropdown",
|
|
2523
2513
|
ref_key: "dropdownRef",
|
|
2524
2514
|
ref: n
|
|
@@ -2529,40 +2519,40 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2529
2519
|
onMouseleave: C
|
|
2530
2520
|
}, [
|
|
2531
2521
|
ce(g.$slots, "trigger", {}, () => [
|
|
2532
|
-
|
|
2522
|
+
b[0] || (b[0] = o("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2533
2523
|
], !0)
|
|
2534
2524
|
], 32),
|
|
2535
|
-
de(
|
|
2525
|
+
de(be, {
|
|
2536
2526
|
name: "dropdown-fade",
|
|
2537
2527
|
appear: ""
|
|
2538
2528
|
}, {
|
|
2539
|
-
default:
|
|
2529
|
+
default: fe(() => [
|
|
2540
2530
|
Ee(o("div", {
|
|
2541
|
-
class:
|
|
2542
|
-
style:
|
|
2531
|
+
class: K(["y-dropdown__menu", p.value]),
|
|
2532
|
+
style: ue(y.value),
|
|
2543
2533
|
onMouseenter: L,
|
|
2544
2534
|
onMouseleave: C
|
|
2545
2535
|
}, [
|
|
2546
2536
|
ce(g.$slots, "default", {}, () => [
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
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))
|
|
2550
2540
|
], !0)
|
|
2551
2541
|
], 38), [
|
|
2552
|
-
[
|
|
2542
|
+
[ze, t.value]
|
|
2553
2543
|
])
|
|
2554
2544
|
]),
|
|
2555
2545
|
_: 3
|
|
2556
2546
|
})
|
|
2557
2547
|
], 512));
|
|
2558
2548
|
}
|
|
2559
|
-
}), pl = /* @__PURE__ */
|
|
2549
|
+
}), pl = /* @__PURE__ */ me(hl, [["__scopeId", "data-v-ada3172a"]]), yl = ["aria-hidden"], gl = ["onKeydown"], ml = {
|
|
2560
2550
|
key: 0,
|
|
2561
2551
|
class: "y-drawer-header"
|
|
2562
|
-
}, wl = { class: "y-drawer-title" },
|
|
2552
|
+
}, wl = { class: "y-drawer-title" }, kl = { class: "y-drawer-body" }, bl = {
|
|
2563
2553
|
key: 1,
|
|
2564
2554
|
class: "y-drawer-footer"
|
|
2565
|
-
}, xl = /* @__PURE__ */
|
|
2555
|
+
}, xl = /* @__PURE__ */ ge({
|
|
2566
2556
|
__name: "ydrawer",
|
|
2567
2557
|
props: {
|
|
2568
2558
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2577,12 +2567,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2577
2567
|
},
|
|
2578
2568
|
emits: ["update:modelValue", "open", "close"],
|
|
2579
2569
|
setup(e, { emit: $ }) {
|
|
2580
|
-
const t = e, n = $, m =
|
|
2570
|
+
const t = e, n = $, m = O({
|
|
2581
2571
|
get: () => t.modelValue,
|
|
2582
|
-
set: (
|
|
2583
|
-
}),
|
|
2584
|
-
const
|
|
2585
|
-
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;
|
|
2586
2576
|
});
|
|
2587
2577
|
function I() {
|
|
2588
2578
|
t.maskClosable && x();
|
|
@@ -2593,71 +2583,71 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2593
2583
|
function w() {
|
|
2594
2584
|
t.closable && x();
|
|
2595
2585
|
}
|
|
2596
|
-
function g(
|
|
2597
|
-
|
|
2586
|
+
function g(b) {
|
|
2587
|
+
b.key === "Escape" && w();
|
|
2598
2588
|
}
|
|
2599
|
-
return oe(() => t.modelValue, (
|
|
2600
|
-
|
|
2589
|
+
return oe(() => t.modelValue, (b) => {
|
|
2590
|
+
b ? (n("open"), requestAnimationFrame(() => {
|
|
2601
2591
|
var V;
|
|
2602
|
-
return (V =
|
|
2592
|
+
return (V = p.value) == null ? void 0 : V.focus();
|
|
2603
2593
|
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2604
|
-
}),
|
|
2594
|
+
}), $e(() => {
|
|
2605
2595
|
t.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2606
2596
|
}), Be(() => {
|
|
2607
2597
|
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2608
|
-
}), (
|
|
2598
|
+
}), (b, V) => (i(), Se(Fe, { to: "body" }, [
|
|
2609
2599
|
Ee(o("div", {
|
|
2610
2600
|
class: "y-drawer-root",
|
|
2611
2601
|
role: "dialog",
|
|
2612
2602
|
"aria-modal": !0,
|
|
2613
2603
|
"aria-hidden": !m.value,
|
|
2614
|
-
style:
|
|
2604
|
+
style: ue({ zIndex: String(e.zIndex) })
|
|
2615
2605
|
}, [
|
|
2616
2606
|
o("div", {
|
|
2617
2607
|
class: "y-drawer-mask",
|
|
2618
2608
|
onClick: I
|
|
2619
2609
|
}),
|
|
2620
|
-
de(
|
|
2621
|
-
default:
|
|
2610
|
+
de(be, { name: y.value }, {
|
|
2611
|
+
default: fe(() => [
|
|
2622
2612
|
Ee(o("div", {
|
|
2623
2613
|
ref_key: "panelRef",
|
|
2624
|
-
ref:
|
|
2625
|
-
class:
|
|
2614
|
+
ref: p,
|
|
2615
|
+
class: K(["y-drawer-panel", [
|
|
2626
2616
|
`is-${e.placement}`,
|
|
2627
2617
|
L.value
|
|
2628
2618
|
]]),
|
|
2629
|
-
style:
|
|
2630
|
-
onKeydown: ke(
|
|
2619
|
+
style: ue(C.value),
|
|
2620
|
+
onKeydown: ke(G(w, ["prevent", "stop"]), ["esc"]),
|
|
2631
2621
|
tabindex: "-1"
|
|
2632
2622
|
}, [
|
|
2633
2623
|
e.showHeader ? (i(), u("div", ml, [
|
|
2634
|
-
o("div", wl,
|
|
2624
|
+
o("div", wl, ne(e.title), 1),
|
|
2635
2625
|
e.closable ? (i(), u("button", {
|
|
2636
2626
|
key: 0,
|
|
2637
2627
|
type: "button",
|
|
2638
2628
|
class: "y-drawer-close",
|
|
2639
2629
|
"aria-label": "Close",
|
|
2640
2630
|
onClick: x
|
|
2641
|
-
}, " ✕ ")) :
|
|
2642
|
-
])) :
|
|
2643
|
-
o("div",
|
|
2644
|
-
ce(
|
|
2631
|
+
}, " ✕ ")) : H("", !0)
|
|
2632
|
+
])) : H("", !0),
|
|
2633
|
+
o("div", kl, [
|
|
2634
|
+
ce(b.$slots, "default", {}, void 0, !0)
|
|
2645
2635
|
]),
|
|
2646
|
-
|
|
2647
|
-
ce(
|
|
2648
|
-
])) :
|
|
2636
|
+
b.$slots.footer ? (i(), u("div", bl, [
|
|
2637
|
+
ce(b.$slots, "footer", {}, void 0, !0)
|
|
2638
|
+
])) : H("", !0)
|
|
2649
2639
|
], 46, gl), [
|
|
2650
|
-
[
|
|
2640
|
+
[ze, m.value]
|
|
2651
2641
|
])
|
|
2652
2642
|
]),
|
|
2653
2643
|
_: 3
|
|
2654
2644
|
}, 8, ["name"])
|
|
2655
2645
|
], 12, yl), [
|
|
2656
|
-
[
|
|
2646
|
+
[ze, m.value]
|
|
2657
2647
|
])
|
|
2658
2648
|
]));
|
|
2659
2649
|
}
|
|
2660
|
-
}), $l = /* @__PURE__ */
|
|
2650
|
+
}), $l = /* @__PURE__ */ me(xl, [["__scopeId", "data-v-b2797950"]]), Cl = { class: "ytree__container" }, Dl = ["data-level", "onClick", "onContextmenu"], _l = ["onClick"], Sl = {
|
|
2661
2651
|
key: 1,
|
|
2662
2652
|
class: "w-[16px]"
|
|
2663
2653
|
}, Ll = ["onClick"], Ml = {
|
|
@@ -2675,10 +2665,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2675
2665
|
}, El = ["src", "alt"], Bl = { class: "ytree-node__custom-content" }, Tl = {
|
|
2676
2666
|
key: 0,
|
|
2677
2667
|
class: "ytree-node__children"
|
|
2678
|
-
},
|
|
2668
|
+
}, Kl = ["data-level", "onClick", "onContextmenu"], zl = ["onClick"], Hl = {
|
|
2679
2669
|
key: 1,
|
|
2680
2670
|
class: "w-[16px]"
|
|
2681
|
-
},
|
|
2671
|
+
}, Rl = ["onClick"], Vl = {
|
|
2682
2672
|
key: 0,
|
|
2683
2673
|
width: "12",
|
|
2684
2674
|
height: "12",
|
|
@@ -2690,7 +2680,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2690
2680
|
height: "12",
|
|
2691
2681
|
viewBox: "0 0 12 12",
|
|
2692
2682
|
fill: "none"
|
|
2693
|
-
},
|
|
2683
|
+
}, Al = ["src", "alt"], Fl = { class: "ytree-node__custom-content" }, Pl = {
|
|
2694
2684
|
key: 0,
|
|
2695
2685
|
class: "ytree-node__children"
|
|
2696
2686
|
}, Yl = ["data-level", "onClick", "onContextmenu"], Nl = ["onClick"], Ol = {
|
|
@@ -2744,7 +2734,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2744
2734
|
height: "12",
|
|
2745
2735
|
viewBox: "0 0 12 12",
|
|
2746
2736
|
fill: "none"
|
|
2747
|
-
}, ho = ["src", "alt"], po = { class: "ytree-node__custom-content" }, yo = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", go = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", mo = /* @__PURE__ */
|
|
2737
|
+
}, ho = ["src", "alt"], po = { class: "ytree-node__custom-content" }, yo = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", go = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", mo = /* @__PURE__ */ ge({
|
|
2748
2738
|
__name: "ytree",
|
|
2749
2739
|
props: {
|
|
2750
2740
|
data: { default: () => [] },
|
|
@@ -2793,7 +2783,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2793
2783
|
},
|
|
2794
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"],
|
|
2795
2785
|
setup(e, { expose: $, emit: t }) {
|
|
2796
|
-
const n = e, m = t,
|
|
2786
|
+
const n = e, m = t, p = O(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), y = E({
|
|
2797
2787
|
currentNode: null,
|
|
2798
2788
|
currentKey: null,
|
|
2799
2789
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2801,201 +2791,201 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2801
2791
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2802
2792
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2803
2793
|
});
|
|
2804
|
-
at("treeStore",
|
|
2805
|
-
const L =
|
|
2806
|
-
function C(
|
|
2807
|
-
return
|
|
2794
|
+
at("treeStore", y);
|
|
2795
|
+
const L = O(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2796
|
+
function C(c) {
|
|
2797
|
+
return c[n.nodeKey] || c.id || Math.random();
|
|
2808
2798
|
}
|
|
2809
|
-
function I(
|
|
2799
|
+
function I(c) {
|
|
2810
2800
|
var h;
|
|
2811
|
-
return ((h = n.props) != null && h.label ?
|
|
2801
|
+
return ((h = n.props) != null && h.label ? c[n.props.label] : void 0) || c.label || "";
|
|
2812
2802
|
}
|
|
2813
|
-
function x(
|
|
2803
|
+
function x(c) {
|
|
2814
2804
|
var h;
|
|
2815
|
-
return !!((h =
|
|
2805
|
+
return !!((h = c == null ? void 0 : c.data) != null && h.isEmployee);
|
|
2816
2806
|
}
|
|
2817
|
-
function w(
|
|
2807
|
+
function w(c, h) {
|
|
2818
2808
|
var M;
|
|
2819
|
-
const a = n.deptIconUrl || yo, r = n.personIconUrl || go, f = n.buttonIconUrl || "",
|
|
2820
|
-
return h &&
|
|
2809
|
+
const a = n.deptIconUrl || yo, r = n.personIconUrl || go, f = n.buttonIconUrl || "", k = n.childStyleIconUrl || "";
|
|
2810
|
+
return h && k && j(c, h) ? k : (M = c == null ? void 0 : c.data) != null && M.isButton && f ? f : x(c) ? r : a;
|
|
2821
2811
|
}
|
|
2822
|
-
function g(
|
|
2812
|
+
function g(c) {
|
|
2823
2813
|
var a;
|
|
2824
|
-
const h = ((a = n.props) != null && a.children ?
|
|
2814
|
+
const h = ((a = n.props) != null && a.children ? c[n.props.children] : void 0) || c.children;
|
|
2825
2815
|
return h && h.length > 0;
|
|
2826
2816
|
}
|
|
2827
|
-
function
|
|
2817
|
+
function b(c) {
|
|
2828
2818
|
var h;
|
|
2829
|
-
return ((h = n.props) != null && h.children ?
|
|
2819
|
+
return ((h = n.props) != null && h.children ? c[n.props.children] : void 0) || c.children || [];
|
|
2830
2820
|
}
|
|
2831
|
-
function V(
|
|
2832
|
-
if (
|
|
2821
|
+
function V(c, h, a = 1) {
|
|
2822
|
+
if (c === h)
|
|
2833
2823
|
return a;
|
|
2834
|
-
const r =
|
|
2824
|
+
const r = b(c);
|
|
2835
2825
|
for (const f of r) {
|
|
2836
|
-
const
|
|
2837
|
-
if (
|
|
2838
|
-
return
|
|
2826
|
+
const k = V(f, h, a + 1);
|
|
2827
|
+
if (k > 0)
|
|
2828
|
+
return k;
|
|
2839
2829
|
}
|
|
2840
2830
|
return 0;
|
|
2841
2831
|
}
|
|
2842
|
-
function
|
|
2843
|
-
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : V(h,
|
|
2832
|
+
function j(c, h) {
|
|
2833
|
+
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : V(h, c) === n.childStyleLevel;
|
|
2844
2834
|
}
|
|
2845
|
-
function
|
|
2846
|
-
const h = C(
|
|
2847
|
-
return
|
|
2835
|
+
function F(c) {
|
|
2836
|
+
const h = C(c);
|
|
2837
|
+
return y.value.expandedKeys.has(h);
|
|
2848
2838
|
}
|
|
2849
|
-
function
|
|
2850
|
-
const h = C(
|
|
2851
|
-
if (
|
|
2852
|
-
if (g(
|
|
2853
|
-
const r =
|
|
2854
|
-
(M) =>
|
|
2839
|
+
function A(c) {
|
|
2840
|
+
const h = C(c);
|
|
2841
|
+
if (y.value.checkedKeys.has(h)) {
|
|
2842
|
+
if (g(c)) {
|
|
2843
|
+
const r = b(c), f = r.filter((M) => A(M)), k = r.filter(
|
|
2844
|
+
(M) => q(M)
|
|
2855
2845
|
);
|
|
2856
|
-
return f.length === r.length &&
|
|
2846
|
+
return f.length === r.length && k.length === 0;
|
|
2857
2847
|
}
|
|
2858
2848
|
return !0;
|
|
2859
2849
|
}
|
|
2860
|
-
if (g(
|
|
2861
|
-
const r =
|
|
2850
|
+
if (g(c)) {
|
|
2851
|
+
const r = b(c);
|
|
2862
2852
|
return r.some(
|
|
2863
|
-
(
|
|
2864
|
-
) ? !1 : r.length > 0 && r.every((
|
|
2853
|
+
(k) => q(k)
|
|
2854
|
+
) ? !1 : r.length > 0 && r.every((k) => A(k));
|
|
2865
2855
|
}
|
|
2866
2856
|
return !1;
|
|
2867
2857
|
}
|
|
2868
|
-
function
|
|
2869
|
-
if (!g(
|
|
2870
|
-
const h =
|
|
2871
|
-
(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)
|
|
2872
2862
|
);
|
|
2873
2863
|
return a.length === h.length ? !1 : a.length > 0 || r.length > 0;
|
|
2874
2864
|
}
|
|
2875
|
-
function
|
|
2876
|
-
const h = C(
|
|
2877
|
-
return
|
|
2865
|
+
function Q(c) {
|
|
2866
|
+
const h = C(c);
|
|
2867
|
+
return y.value.currentKey === h;
|
|
2878
2868
|
}
|
|
2879
|
-
function
|
|
2880
|
-
const h = C(
|
|
2881
|
-
return
|
|
2869
|
+
function le(c) {
|
|
2870
|
+
const h = C(c);
|
|
2871
|
+
return y.value.highlightedKeys.has(h);
|
|
2882
2872
|
}
|
|
2883
|
-
function
|
|
2873
|
+
function J(c) {
|
|
2884
2874
|
if (n.disabled) return;
|
|
2885
|
-
const h = C(
|
|
2886
|
-
r ?
|
|
2887
|
-
function
|
|
2888
|
-
M.forEach((
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2875
|
+
const h = C(c), r = !y.value.checkedKeys.has(h), f = new Set(y.value.expandedKeys);
|
|
2876
|
+
r ? y.value.checkedKeys.add(h) : y.value.checkedKeys.delete(h);
|
|
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);
|
|
2891
2881
|
});
|
|
2892
2882
|
}
|
|
2893
|
-
b(
|
|
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));
|
|
2894
2884
|
}
|
|
2895
|
-
function
|
|
2885
|
+
function W(c) {
|
|
2896
2886
|
L.value && console.log(
|
|
2897
2887
|
`已启用从第${L.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2898
2888
|
);
|
|
2899
2889
|
}
|
|
2900
|
-
function
|
|
2901
|
-
const h = C(
|
|
2902
|
-
|
|
2890
|
+
function z(c) {
|
|
2891
|
+
const h = C(c);
|
|
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));
|
|
2903
2893
|
}
|
|
2904
|
-
function
|
|
2905
|
-
const
|
|
2894
|
+
function R() {
|
|
2895
|
+
const c = [];
|
|
2906
2896
|
function h(r) {
|
|
2907
2897
|
r.forEach((f) => {
|
|
2908
|
-
|
|
2898
|
+
c.push(f), g(f) && h(b(f));
|
|
2909
2899
|
});
|
|
2910
2900
|
}
|
|
2911
|
-
h(
|
|
2901
|
+
h(p.value);
|
|
2912
2902
|
function a(r) {
|
|
2913
2903
|
if (g(r)) {
|
|
2914
|
-
const f =
|
|
2915
|
-
(
|
|
2904
|
+
const f = b(r), k = C(r), M = f.filter((P) => A(P)), B = f.filter(
|
|
2905
|
+
(P) => q(P)
|
|
2916
2906
|
);
|
|
2917
|
-
M.length === f.length &&
|
|
2907
|
+
M.length === f.length && B.length === 0 || M.length > 0 || B.length > 0 ? y.value.checkedKeys.add(k) : y.value.checkedKeys.delete(k);
|
|
2918
2908
|
}
|
|
2919
2909
|
}
|
|
2920
|
-
for (let r =
|
|
2921
|
-
a(
|
|
2910
|
+
for (let r = c.length - 1; r >= 0; r--)
|
|
2911
|
+
a(c[r]);
|
|
2922
2912
|
}
|
|
2923
|
-
function Y(
|
|
2913
|
+
function Y(c, h, a, r) {
|
|
2924
2914
|
if (n.disabled) return;
|
|
2925
|
-
const f = r ?
|
|
2915
|
+
const f = r ? j(c, r) : !1;
|
|
2926
2916
|
if (n.enableChildStyleCustomClick && f) {
|
|
2927
|
-
m("child-node-click",
|
|
2917
|
+
m("child-node-click", c, h, a);
|
|
2928
2918
|
return;
|
|
2929
2919
|
}
|
|
2930
|
-
if (n.expandOnClickNode && g(
|
|
2931
|
-
|
|
2920
|
+
if (n.expandOnClickNode && g(c)) {
|
|
2921
|
+
z(c);
|
|
2932
2922
|
return;
|
|
2933
2923
|
}
|
|
2934
|
-
|
|
2924
|
+
y.value.currentNode = c, y.value.currentKey = C(c), n.showCheckbox && J(c), m("node-click", c, h, a);
|
|
2935
2925
|
}
|
|
2936
|
-
function ee(
|
|
2937
|
-
n.disabled || m("node-contextmenu",
|
|
2926
|
+
function ee(c, h, a, r) {
|
|
2927
|
+
n.disabled || m("node-contextmenu", c, h, a, r);
|
|
2938
2928
|
}
|
|
2939
2929
|
oe(
|
|
2940
2930
|
() => n.defaultExpandedKeys,
|
|
2941
|
-
(
|
|
2942
|
-
if (
|
|
2931
|
+
(c) => {
|
|
2932
|
+
if (c) {
|
|
2943
2933
|
const h = L.value;
|
|
2944
2934
|
if (h) {
|
|
2945
|
-
let a = function(M,
|
|
2946
|
-
for (const
|
|
2947
|
-
if (C(
|
|
2948
|
-
if (g(
|
|
2949
|
-
const
|
|
2950
|
-
if (
|
|
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
|
+
if (ye > 0) return ye;
|
|
2951
2941
|
}
|
|
2952
2942
|
}
|
|
2953
2943
|
return 0;
|
|
2954
|
-
}, r = function(M,
|
|
2955
|
-
M.forEach((
|
|
2956
|
-
|
|
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);
|
|
2957
2947
|
});
|
|
2958
2948
|
};
|
|
2959
|
-
const f = (
|
|
2960
|
-
const
|
|
2961
|
-
return
|
|
2962
|
-
}),
|
|
2963
|
-
r(
|
|
2964
|
-
a(M,
|
|
2965
|
-
}),
|
|
2949
|
+
const f = (c || []).filter((M) => {
|
|
2950
|
+
const B = a(M, p.value, 1);
|
|
2951
|
+
return B > 0 && B < h;
|
|
2952
|
+
}), k = new Set(f);
|
|
2953
|
+
r(p.value, 1, h), y.value.expandedKeys.forEach((M) => {
|
|
2954
|
+
a(M, p.value, 1) >= h && k.add(M);
|
|
2955
|
+
}), y.value.expandedKeys = k;
|
|
2966
2956
|
} else
|
|
2967
|
-
|
|
2957
|
+
y.value.expandedKeys = new Set(c);
|
|
2968
2958
|
}
|
|
2969
2959
|
},
|
|
2970
2960
|
{ immediate: !0 }
|
|
2971
2961
|
);
|
|
2972
|
-
function
|
|
2962
|
+
function X() {
|
|
2973
2963
|
if (n.defaultExpandAll) {
|
|
2974
|
-
let
|
|
2975
|
-
r.forEach((
|
|
2976
|
-
if (!g(
|
|
2977
|
-
const M = k
|
|
2964
|
+
let c = function(r, f = 1) {
|
|
2965
|
+
r.forEach((k) => {
|
|
2966
|
+
if (!g(k)) return;
|
|
2967
|
+
const M = b(k);
|
|
2978
2968
|
if (a) {
|
|
2979
2969
|
if (f >= a) return;
|
|
2980
|
-
f + 1 === a || h.add(C(
|
|
2970
|
+
f + 1 === a || h.add(C(k)), c(M, f + 1);
|
|
2981
2971
|
} else
|
|
2982
|
-
h.add(C(
|
|
2972
|
+
h.add(C(k)), c(M, f + 1);
|
|
2983
2973
|
});
|
|
2984
2974
|
};
|
|
2985
2975
|
const h = /* @__PURE__ */ new Set(), a = L.value;
|
|
2986
|
-
|
|
2976
|
+
c(p.value, 1), y.value.expandedKeys = h;
|
|
2987
2977
|
}
|
|
2988
2978
|
}
|
|
2989
|
-
function
|
|
2979
|
+
function ae() {
|
|
2990
2980
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
2991
|
-
let
|
|
2981
|
+
let c = function(f, k = []) {
|
|
2992
2982
|
f.forEach((M) => {
|
|
2993
|
-
const
|
|
2994
|
-
h.has(
|
|
2983
|
+
const B = C(M), P = [...k, B];
|
|
2984
|
+
h.has(B) && k.forEach((te) => a.add(te)), g(M) && c(b(M), P);
|
|
2995
2985
|
});
|
|
2996
2986
|
};
|
|
2997
2987
|
const h = new Set(n.defaultCheckedKeys), a = /* @__PURE__ */ new Set();
|
|
2998
|
-
|
|
2988
|
+
c(p.value);
|
|
2999
2989
|
const r = L.value;
|
|
3000
2990
|
if (r) {
|
|
3001
2991
|
console.log(
|
|
@@ -3003,63 +2993,63 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3003
2993
|
);
|
|
3004
2994
|
return;
|
|
3005
2995
|
}
|
|
3006
|
-
|
|
2996
|
+
y.value.expandedKeys = a;
|
|
3007
2997
|
}
|
|
3008
2998
|
}
|
|
3009
|
-
oe(() => n.defaultExpandAll,
|
|
2999
|
+
oe(() => n.defaultExpandAll, X, { immediate: !0 }), oe(() => p.value, X, { deep: !0 }), oe(
|
|
3010
3000
|
() => n.defaultCheckedKeys,
|
|
3011
|
-
(
|
|
3012
|
-
|
|
3001
|
+
(c) => {
|
|
3002
|
+
c ? (y.value.checkedKeys = new Set(c), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : ae()) : y.value.checkedKeys.clear();
|
|
3013
3003
|
},
|
|
3014
3004
|
{ immediate: !0 }
|
|
3015
3005
|
);
|
|
3016
|
-
function
|
|
3006
|
+
function we(c) {
|
|
3017
3007
|
try {
|
|
3018
|
-
let h = function(f,
|
|
3019
|
-
for (const
|
|
3020
|
-
const
|
|
3021
|
-
if (
|
|
3022
|
-
if (g(
|
|
3023
|
-
const
|
|
3024
|
-
if (
|
|
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
|
+
if (ye) return ye;
|
|
3025
3015
|
}
|
|
3026
3016
|
}
|
|
3027
3017
|
return null;
|
|
3028
3018
|
};
|
|
3029
|
-
const a = Array.isArray(
|
|
3019
|
+
const a = Array.isArray(c) ? c : [];
|
|
3030
3020
|
if (a.length === 0) return;
|
|
3031
|
-
|
|
3032
|
-
const r = new Set(
|
|
3021
|
+
y.value.highlightedKeys.clear();
|
|
3022
|
+
const r = new Set(y.value.expandedKeys);
|
|
3033
3023
|
a.forEach((f) => {
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3036
|
-
}),
|
|
3024
|
+
const k = h(p.value, f);
|
|
3025
|
+
k && k.length > 0 && (k.slice(0, -1).forEach((M) => r.add(M)), y.value.highlightedKeys.add(k[k.length - 1]));
|
|
3026
|
+
}), y.value.expandedKeys = r;
|
|
3037
3027
|
} catch (h) {
|
|
3038
3028
|
console.warn("highlightAndExpandByIds 执行失败", h);
|
|
3039
3029
|
}
|
|
3040
3030
|
}
|
|
3041
|
-
function
|
|
3042
|
-
|
|
3031
|
+
function N() {
|
|
3032
|
+
y.value.highlightedKeys.clear();
|
|
3043
3033
|
}
|
|
3044
|
-
function
|
|
3045
|
-
|
|
3034
|
+
function Z() {
|
|
3035
|
+
y.value.currentNode = null, y.value.currentKey = null;
|
|
3046
3036
|
}
|
|
3047
|
-
return $({ highlightAndExpandByIds:
|
|
3037
|
+
return $({ highlightAndExpandByIds: we, clearHighlights: N, clearCurrentNode: Z }), oe(
|
|
3048
3038
|
() => n.defaultSelectedKeys,
|
|
3049
|
-
(
|
|
3050
|
-
|
|
3039
|
+
(c) => {
|
|
3040
|
+
c && (y.value.selectedKeys = new Set(c));
|
|
3051
3041
|
},
|
|
3052
3042
|
{ immediate: !0 }
|
|
3053
|
-
), (
|
|
3054
|
-
class:
|
|
3043
|
+
), (c, h) => (i(), u("div", {
|
|
3044
|
+
class: K(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
3055
3045
|
}, [
|
|
3056
3046
|
o("div", Cl, [
|
|
3057
|
-
(i(!0), u(
|
|
3047
|
+
(i(!0), u(re, null, ve(p.value, (a) => (i(), u("div", {
|
|
3058
3048
|
key: C(a),
|
|
3059
|
-
class:
|
|
3049
|
+
class: K(["ytree-node", { "ytree-node--current": Q(a), "ytree-node--highlight": le(a) }])
|
|
3060
3050
|
}, [
|
|
3061
3051
|
o("div", {
|
|
3062
|
-
class:
|
|
3052
|
+
class: K(["ytree-node__content", { "is-child-style": j(a, a) }]),
|
|
3063
3053
|
style: { paddingLeft: "8px" },
|
|
3064
3054
|
"data-level": V(a, a),
|
|
3065
3055
|
onClick: (r) => Y(a, a, null, a),
|
|
@@ -3067,8 +3057,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3067
3057
|
}, [
|
|
3068
3058
|
g(a) ? (i(), u("span", {
|
|
3069
3059
|
key: 0,
|
|
3070
|
-
class:
|
|
3071
|
-
onClick:
|
|
3060
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": F(a) }]),
|
|
3061
|
+
onClick: G((r) => z(a), ["stop"])
|
|
3072
3062
|
}, [...h[0] || (h[0] = [
|
|
3073
3063
|
o("svg", {
|
|
3074
3064
|
width: "12",
|
|
@@ -3087,13 +3077,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3087
3077
|
])], 10, _l)) : (i(), u("span", Sl)),
|
|
3088
3078
|
e.showCheckbox ? (i(), u("span", {
|
|
3089
3079
|
key: 2,
|
|
3090
|
-
class:
|
|
3091
|
-
"is-checked":
|
|
3092
|
-
"is-indeterminate":
|
|
3080
|
+
class: K(["ytree-node__checkbox", {
|
|
3081
|
+
"is-checked": A(a),
|
|
3082
|
+
"is-indeterminate": q(a)
|
|
3093
3083
|
}]),
|
|
3094
|
-
onClick:
|
|
3084
|
+
onClick: G((r) => J(a), ["stop"])
|
|
3095
3085
|
}, [
|
|
3096
|
-
|
|
3086
|
+
A(a) ? (i(), u("svg", Ml, [...h[1] || (h[1] = [
|
|
3097
3087
|
o("path", {
|
|
3098
3088
|
d: "M2 6L4.5 8.5L10 3",
|
|
3099
3089
|
stroke: "currentColor",
|
|
@@ -3101,45 +3091,45 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3101
3091
|
"stroke-linecap": "round",
|
|
3102
3092
|
"stroke-linejoin": "round"
|
|
3103
3093
|
}, null, -1)
|
|
3104
|
-
])])) :
|
|
3094
|
+
])])) : q(a) ? (i(), u("svg", Il, [...h[2] || (h[2] = [
|
|
3105
3095
|
o("path", {
|
|
3106
3096
|
d: "M2 6L10 6",
|
|
3107
3097
|
stroke: "currentColor",
|
|
3108
3098
|
"stroke-width": "1.5",
|
|
3109
3099
|
"stroke-linecap": "round"
|
|
3110
3100
|
}, null, -1)
|
|
3111
|
-
])])) :
|
|
3112
|
-
], 10, Ll)) :
|
|
3101
|
+
])])) : H("", !0)
|
|
3102
|
+
], 10, Ll)) : H("", !0),
|
|
3113
3103
|
e.iconClass ? (i(), u("span", {
|
|
3114
3104
|
key: 3,
|
|
3115
|
-
class:
|
|
3116
|
-
}, null, 2)) :
|
|
3105
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3106
|
+
}, null, 2)) : H("", !0),
|
|
3117
3107
|
o("img", {
|
|
3118
3108
|
class: "ytree-node__avatar",
|
|
3119
3109
|
src: w(a, a),
|
|
3120
3110
|
alt: x(a) ? "person" : "dept"
|
|
3121
3111
|
}, null, 8, El),
|
|
3122
3112
|
o("span", {
|
|
3123
|
-
class:
|
|
3124
|
-
},
|
|
3113
|
+
class: K(["ytree-node__label", { "is-employee": x(a) }])
|
|
3114
|
+
}, ne(I(a)), 3),
|
|
3125
3115
|
o("div", Bl, [
|
|
3126
|
-
ce(
|
|
3116
|
+
ce(c.$slots, "node-content", {
|
|
3127
3117
|
node: a,
|
|
3128
|
-
isCurrent:
|
|
3129
|
-
isExpanded:
|
|
3118
|
+
isCurrent: Q(a),
|
|
3119
|
+
isExpanded: F(a),
|
|
3130
3120
|
hasChildren: g(a)
|
|
3131
3121
|
}, void 0, !0)
|
|
3132
3122
|
])
|
|
3133
3123
|
], 42, Dl),
|
|
3134
|
-
de(
|
|
3135
|
-
default:
|
|
3136
|
-
g(a) &&
|
|
3137
|
-
(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", {
|
|
3138
3128
|
key: C(r),
|
|
3139
|
-
class:
|
|
3129
|
+
class: K(["ytree-node", { "ytree-node--current": Q(r), "ytree-node--highlight": le(r) }])
|
|
3140
3130
|
}, [
|
|
3141
3131
|
o("div", {
|
|
3142
|
-
class:
|
|
3132
|
+
class: K(["ytree-node__content", { "is-child-style": j(r, a) }]),
|
|
3143
3133
|
style: { paddingLeft: "22px" },
|
|
3144
3134
|
"data-level": V(a, r),
|
|
3145
3135
|
onClick: (f) => Y(r, r, null, a),
|
|
@@ -3147,8 +3137,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3147
3137
|
}, [
|
|
3148
3138
|
g(r) ? (i(), u("span", {
|
|
3149
3139
|
key: 0,
|
|
3150
|
-
class:
|
|
3151
|
-
onClick:
|
|
3140
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": F(r) }]),
|
|
3141
|
+
onClick: G((f) => z(r), ["stop"])
|
|
3152
3142
|
}, [...h[3] || (h[3] = [
|
|
3153
3143
|
o("svg", {
|
|
3154
3144
|
width: "12",
|
|
@@ -3164,16 +3154,16 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3164
3154
|
"stroke-linejoin": "round"
|
|
3165
3155
|
})
|
|
3166
3156
|
], -1)
|
|
3167
|
-
])], 10,
|
|
3157
|
+
])], 10, zl)) : (i(), u("span", Hl)),
|
|
3168
3158
|
e.showCheckbox ? (i(), u("span", {
|
|
3169
3159
|
key: 2,
|
|
3170
|
-
class:
|
|
3171
|
-
"is-checked":
|
|
3172
|
-
"is-indeterminate":
|
|
3160
|
+
class: K(["ytree-node__checkbox", {
|
|
3161
|
+
"is-checked": A(r),
|
|
3162
|
+
"is-indeterminate": q(r)
|
|
3173
3163
|
}]),
|
|
3174
|
-
onClick:
|
|
3164
|
+
onClick: G((f) => J(r), ["stop"])
|
|
3175
3165
|
}, [
|
|
3176
|
-
|
|
3166
|
+
A(r) ? (i(), u("svg", Vl, [...h[4] || (h[4] = [
|
|
3177
3167
|
o("path", {
|
|
3178
3168
|
d: "M2 6L4.5 8.5L10 3",
|
|
3179
3169
|
stroke: "currentColor",
|
|
@@ -3181,53 +3171,53 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3181
3171
|
"stroke-linecap": "round",
|
|
3182
3172
|
"stroke-linejoin": "round"
|
|
3183
3173
|
}, null, -1)
|
|
3184
|
-
])])) :
|
|
3174
|
+
])])) : q(r) ? (i(), u("svg", Wl, [...h[5] || (h[5] = [
|
|
3185
3175
|
o("path", {
|
|
3186
3176
|
d: "M2 6L10 6",
|
|
3187
3177
|
stroke: "currentColor",
|
|
3188
3178
|
"stroke-width": "1.5",
|
|
3189
3179
|
"stroke-linecap": "round"
|
|
3190
3180
|
}, null, -1)
|
|
3191
|
-
])])) :
|
|
3192
|
-
], 10,
|
|
3181
|
+
])])) : H("", !0)
|
|
3182
|
+
], 10, Rl)) : H("", !0),
|
|
3193
3183
|
e.iconClass ? (i(), u("span", {
|
|
3194
3184
|
key: 3,
|
|
3195
|
-
class:
|
|
3196
|
-
}, null, 2)) :
|
|
3185
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3186
|
+
}, null, 2)) : H("", !0),
|
|
3197
3187
|
o("img", {
|
|
3198
3188
|
class: "ytree-node__avatar",
|
|
3199
3189
|
src: w(r, a),
|
|
3200
3190
|
alt: x(r) ? "person" : "dept"
|
|
3201
|
-
}, null, 8,
|
|
3191
|
+
}, null, 8, Al),
|
|
3202
3192
|
o("span", {
|
|
3203
|
-
class:
|
|
3204
|
-
},
|
|
3193
|
+
class: K(["ytree-node__label", { "is-employee": x(r) }])
|
|
3194
|
+
}, ne(I(r)), 3),
|
|
3205
3195
|
o("div", Fl, [
|
|
3206
|
-
ce(
|
|
3196
|
+
ce(c.$slots, "node-content", {
|
|
3207
3197
|
node: r,
|
|
3208
|
-
isCurrent:
|
|
3209
|
-
isExpanded:
|
|
3198
|
+
isCurrent: Q(r),
|
|
3199
|
+
isExpanded: F(r),
|
|
3210
3200
|
hasChildren: g(r)
|
|
3211
3201
|
}, void 0, !0)
|
|
3212
3202
|
])
|
|
3213
|
-
], 42,
|
|
3214
|
-
de(
|
|
3215
|
-
default:
|
|
3216
|
-
g(r) &&
|
|
3217
|
-
(i(!0), u(
|
|
3203
|
+
], 42, Kl),
|
|
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", {
|
|
3218
3208
|
key: C(f),
|
|
3219
|
-
class:
|
|
3220
|
-
"ytree-node--current":
|
|
3221
|
-
"ytree-node--highlight":
|
|
3209
|
+
class: K(["ytree-node", {
|
|
3210
|
+
"ytree-node--current": Q(f),
|
|
3211
|
+
"ytree-node--highlight": le(f)
|
|
3222
3212
|
}])
|
|
3223
3213
|
}, [
|
|
3224
3214
|
o("div", {
|
|
3225
|
-
class:
|
|
3215
|
+
class: K(["ytree-node__content", { "is-child-style": j(f, a) }]),
|
|
3226
3216
|
style: { paddingLeft: "38px" },
|
|
3227
3217
|
"data-level": V(a, f),
|
|
3228
|
-
onClick: (
|
|
3229
|
-
onContextmenu: (
|
|
3230
|
-
|
|
3218
|
+
onClick: (k) => Y(f, f, null, a),
|
|
3219
|
+
onContextmenu: (k) => ee(
|
|
3220
|
+
k,
|
|
3231
3221
|
f,
|
|
3232
3222
|
f,
|
|
3233
3223
|
null
|
|
@@ -3235,8 +3225,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3235
3225
|
}, [
|
|
3236
3226
|
g(f) ? (i(), u("span", {
|
|
3237
3227
|
key: 0,
|
|
3238
|
-
class:
|
|
3239
|
-
onClick:
|
|
3228
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": F(f) }]),
|
|
3229
|
+
onClick: G((k) => z(f), ["stop"])
|
|
3240
3230
|
}, [...h[6] || (h[6] = [
|
|
3241
3231
|
o("svg", {
|
|
3242
3232
|
width: "12",
|
|
@@ -3255,13 +3245,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3255
3245
|
])], 10, Nl)) : (i(), u("span", Ol)),
|
|
3256
3246
|
e.showCheckbox ? (i(), u("span", {
|
|
3257
3247
|
key: 2,
|
|
3258
|
-
class:
|
|
3259
|
-
"is-checked":
|
|
3260
|
-
"is-indeterminate":
|
|
3248
|
+
class: K(["ytree-node__checkbox", {
|
|
3249
|
+
"is-checked": A(f),
|
|
3250
|
+
"is-indeterminate": q(f)
|
|
3261
3251
|
}]),
|
|
3262
|
-
onClick:
|
|
3252
|
+
onClick: G((k) => J(f), ["stop"])
|
|
3263
3253
|
}, [
|
|
3264
|
-
|
|
3254
|
+
A(f) ? (i(), u("svg", ql, [...h[7] || (h[7] = [
|
|
3265
3255
|
o("path", {
|
|
3266
3256
|
d: "M2 6L4.5 8.5L10 3",
|
|
3267
3257
|
stroke: "currentColor",
|
|
@@ -3269,71 +3259,71 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3269
3259
|
"stroke-linecap": "round",
|
|
3270
3260
|
"stroke-linejoin": "round"
|
|
3271
3261
|
}, null, -1)
|
|
3272
|
-
])])) :
|
|
3262
|
+
])])) : q(f) ? (i(), u("svg", Ul, [...h[8] || (h[8] = [
|
|
3273
3263
|
o("path", {
|
|
3274
3264
|
d: "M2 6L10 6",
|
|
3275
3265
|
stroke: "currentColor",
|
|
3276
3266
|
"stroke-width": "1.5",
|
|
3277
3267
|
"stroke-linecap": "round"
|
|
3278
3268
|
}, null, -1)
|
|
3279
|
-
])])) :
|
|
3280
|
-
], 10, jl)) :
|
|
3269
|
+
])])) : H("", !0)
|
|
3270
|
+
], 10, jl)) : H("", !0),
|
|
3281
3271
|
e.iconClass ? (i(), u("span", {
|
|
3282
3272
|
key: 3,
|
|
3283
|
-
class:
|
|
3284
|
-
}, null, 2)) :
|
|
3273
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3274
|
+
}, null, 2)) : H("", !0),
|
|
3285
3275
|
o("img", {
|
|
3286
3276
|
class: "ytree-node__avatar",
|
|
3287
3277
|
src: w(f, a),
|
|
3288
3278
|
alt: x(f) ? "person" : "dept"
|
|
3289
3279
|
}, null, 8, Zl),
|
|
3290
3280
|
o("span", {
|
|
3291
|
-
class:
|
|
3292
|
-
},
|
|
3281
|
+
class: K(["ytree-node__label", { "is-employee": x(f) }])
|
|
3282
|
+
}, ne(I(f)), 3),
|
|
3293
3283
|
o("div", Ql, [
|
|
3294
|
-
ce(
|
|
3284
|
+
ce(c.$slots, "node-content", {
|
|
3295
3285
|
node: f,
|
|
3296
|
-
isCurrent:
|
|
3297
|
-
isExpanded:
|
|
3286
|
+
isCurrent: Q(f),
|
|
3287
|
+
isExpanded: F(f),
|
|
3298
3288
|
hasChildren: g(f)
|
|
3299
3289
|
}, void 0, !0)
|
|
3300
3290
|
])
|
|
3301
3291
|
], 42, Yl),
|
|
3302
|
-
de(
|
|
3303
|
-
default:
|
|
3304
|
-
g(f) &&
|
|
3305
|
-
(i(!0), u(
|
|
3306
|
-
key: C(
|
|
3307
|
-
class:
|
|
3308
|
-
"ytree-node--current":
|
|
3309
|
-
"ytree-node--highlight":
|
|
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
|
+
key: C(k),
|
|
3297
|
+
class: K(["ytree-node", {
|
|
3298
|
+
"ytree-node--current": Q(k),
|
|
3299
|
+
"ytree-node--highlight": le(k)
|
|
3310
3300
|
}])
|
|
3311
3301
|
}, [
|
|
3312
3302
|
o("div", {
|
|
3313
|
-
class:
|
|
3303
|
+
class: K(["ytree-node__content", { "is-child-style": j(k, a) }]),
|
|
3314
3304
|
style: {
|
|
3315
3305
|
paddingLeft: "54px"
|
|
3316
3306
|
},
|
|
3317
|
-
"data-level": V(a,
|
|
3307
|
+
"data-level": V(a, k),
|
|
3318
3308
|
onClick: (M) => Y(
|
|
3319
|
-
|
|
3320
|
-
|
|
3309
|
+
k,
|
|
3310
|
+
k,
|
|
3321
3311
|
null,
|
|
3322
3312
|
a
|
|
3323
3313
|
),
|
|
3324
3314
|
onContextmenu: (M) => ee(
|
|
3325
3315
|
M,
|
|
3326
|
-
|
|
3327
|
-
|
|
3316
|
+
k,
|
|
3317
|
+
k,
|
|
3328
3318
|
null
|
|
3329
3319
|
)
|
|
3330
3320
|
}, [
|
|
3331
|
-
g(
|
|
3321
|
+
g(k) ? (i(), u("span", {
|
|
3332
3322
|
key: 0,
|
|
3333
|
-
class:
|
|
3334
|
-
"is-expanded":
|
|
3323
|
+
class: K(["ytree-node__expand-icon", {
|
|
3324
|
+
"is-expanded": F(k)
|
|
3335
3325
|
}]),
|
|
3336
|
-
onClick:
|
|
3326
|
+
onClick: G((M) => z(k), ["stop"])
|
|
3337
3327
|
}, [...h[9] || (h[9] = [
|
|
3338
3328
|
o("svg", {
|
|
3339
3329
|
width: "12",
|
|
@@ -3352,13 +3342,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3352
3342
|
])], 10, Gl)) : (i(), u("span", eo)),
|
|
3353
3343
|
e.showCheckbox ? (i(), u("span", {
|
|
3354
3344
|
key: 2,
|
|
3355
|
-
class:
|
|
3356
|
-
"is-checked":
|
|
3357
|
-
"is-indeterminate":
|
|
3345
|
+
class: K(["ytree-node__checkbox", {
|
|
3346
|
+
"is-checked": A(k),
|
|
3347
|
+
"is-indeterminate": q(k)
|
|
3358
3348
|
}]),
|
|
3359
|
-
onClick:
|
|
3349
|
+
onClick: G((M) => J(k), ["stop"])
|
|
3360
3350
|
}, [
|
|
3361
|
-
|
|
3351
|
+
A(k) ? (i(), u("svg", no, [...h[10] || (h[10] = [
|
|
3362
3352
|
o("path", {
|
|
3363
3353
|
d: "M2 6L4.5 8.5L10 3",
|
|
3364
3354
|
stroke: "currentColor",
|
|
@@ -3366,63 +3356,63 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3366
3356
|
"stroke-linecap": "round",
|
|
3367
3357
|
"stroke-linejoin": "round"
|
|
3368
3358
|
}, null, -1)
|
|
3369
|
-
])])) :
|
|
3359
|
+
])])) : q(k) ? (i(), u("svg", lo, [...h[11] || (h[11] = [
|
|
3370
3360
|
o("path", {
|
|
3371
3361
|
d: "M2 6L10 6",
|
|
3372
3362
|
stroke: "currentColor",
|
|
3373
3363
|
"stroke-width": "1.5",
|
|
3374
3364
|
"stroke-linecap": "round"
|
|
3375
3365
|
}, null, -1)
|
|
3376
|
-
])])) :
|
|
3377
|
-
], 10, to)) :
|
|
3366
|
+
])])) : H("", !0)
|
|
3367
|
+
], 10, to)) : H("", !0),
|
|
3378
3368
|
e.iconClass ? (i(), u("span", {
|
|
3379
3369
|
key: 3,
|
|
3380
|
-
class:
|
|
3381
|
-
}, null, 2)) :
|
|
3370
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3371
|
+
}, null, 2)) : H("", !0),
|
|
3382
3372
|
o("img", {
|
|
3383
3373
|
class: "ytree-node__avatar",
|
|
3384
|
-
src: w(
|
|
3385
|
-
alt: x(
|
|
3374
|
+
src: w(k, a),
|
|
3375
|
+
alt: x(k) ? "person" : "dept"
|
|
3386
3376
|
}, null, 8, oo),
|
|
3387
3377
|
o("span", {
|
|
3388
|
-
class:
|
|
3389
|
-
"is-employee": x(
|
|
3378
|
+
class: K(["ytree-node__label", {
|
|
3379
|
+
"is-employee": x(k)
|
|
3390
3380
|
}])
|
|
3391
|
-
},
|
|
3381
|
+
}, ne(I(k)), 3),
|
|
3392
3382
|
o("div", ao, [
|
|
3393
|
-
ce(
|
|
3394
|
-
node:
|
|
3395
|
-
isCurrent:
|
|
3396
|
-
isExpanded:
|
|
3397
|
-
hasChildren: g(
|
|
3383
|
+
ce(c.$slots, "node-content", {
|
|
3384
|
+
node: k,
|
|
3385
|
+
isCurrent: Q(k),
|
|
3386
|
+
isExpanded: F(k),
|
|
3387
|
+
hasChildren: g(k)
|
|
3398
3388
|
}, void 0, !0)
|
|
3399
3389
|
])
|
|
3400
3390
|
], 42, Xl),
|
|
3401
|
-
de(
|
|
3402
|
-
default:
|
|
3403
|
-
g(
|
|
3404
|
-
(i(!0), u(
|
|
3405
|
-
|
|
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
|
+
k
|
|
3406
3396
|
), (M) => (i(), u("div", {
|
|
3407
3397
|
key: C(M),
|
|
3408
|
-
class:
|
|
3409
|
-
"ytree-node--current":
|
|
3398
|
+
class: K(["ytree-node", {
|
|
3399
|
+
"ytree-node--current": Q(M)
|
|
3410
3400
|
}])
|
|
3411
3401
|
}, [
|
|
3412
3402
|
o("div", {
|
|
3413
|
-
class:
|
|
3403
|
+
class: K(["ytree-node__content", { "is-child-style": j(M, a) }]),
|
|
3414
3404
|
style: {
|
|
3415
3405
|
paddingLeft: "70px"
|
|
3416
3406
|
},
|
|
3417
3407
|
"data-level": V(a, M),
|
|
3418
|
-
onClick: (
|
|
3408
|
+
onClick: (B) => Y(
|
|
3419
3409
|
M,
|
|
3420
3410
|
M,
|
|
3421
3411
|
null,
|
|
3422
3412
|
a
|
|
3423
3413
|
),
|
|
3424
|
-
onContextmenu: (
|
|
3425
|
-
|
|
3414
|
+
onContextmenu: (B) => ee(
|
|
3415
|
+
B,
|
|
3426
3416
|
M,
|
|
3427
3417
|
M,
|
|
3428
3418
|
null
|
|
@@ -3430,10 +3420,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3430
3420
|
}, [
|
|
3431
3421
|
g(M) ? (i(), u("span", {
|
|
3432
3422
|
key: 0,
|
|
3433
|
-
class:
|
|
3434
|
-
"is-expanded":
|
|
3423
|
+
class: K(["ytree-node__expand-icon", {
|
|
3424
|
+
"is-expanded": F(M)
|
|
3435
3425
|
}]),
|
|
3436
|
-
onClick:
|
|
3426
|
+
onClick: G((B) => z(M), ["stop"])
|
|
3437
3427
|
}, [...h[12] || (h[12] = [
|
|
3438
3428
|
o("svg", {
|
|
3439
3429
|
width: "12",
|
|
@@ -3452,15 +3442,15 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3452
3442
|
])], 10, ro)) : (i(), u("span", uo)),
|
|
3453
3443
|
e.showCheckbox ? (i(), u("span", {
|
|
3454
3444
|
key: 2,
|
|
3455
|
-
class:
|
|
3456
|
-
"is-checked":
|
|
3457
|
-
"is-indeterminate":
|
|
3445
|
+
class: K(["ytree-node__checkbox", {
|
|
3446
|
+
"is-checked": A(M),
|
|
3447
|
+
"is-indeterminate": q(
|
|
3458
3448
|
M
|
|
3459
3449
|
)
|
|
3460
3450
|
}]),
|
|
3461
|
-
onClick:
|
|
3451
|
+
onClick: G((B) => J(M), ["stop"])
|
|
3462
3452
|
}, [
|
|
3463
|
-
|
|
3453
|
+
A(M) ? (i(), u("svg", fo, [...h[13] || (h[13] = [
|
|
3464
3454
|
o("path", {
|
|
3465
3455
|
d: "M2 6L4.5 8.5L10 3",
|
|
3466
3456
|
stroke: "currentColor",
|
|
@@ -3468,7 +3458,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3468
3458
|
"stroke-linecap": "round",
|
|
3469
3459
|
"stroke-linejoin": "round"
|
|
3470
3460
|
}, null, -1)
|
|
3471
|
-
])])) :
|
|
3461
|
+
])])) : q(
|
|
3472
3462
|
M
|
|
3473
3463
|
) ? (i(), u("svg", vo, [...h[14] || (h[14] = [
|
|
3474
3464
|
o("path", {
|
|
@@ -3477,48 +3467,48 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3477
3467
|
"stroke-width": "1.5",
|
|
3478
3468
|
"stroke-linecap": "round"
|
|
3479
3469
|
}, null, -1)
|
|
3480
|
-
])])) :
|
|
3481
|
-
], 10, co)) :
|
|
3470
|
+
])])) : H("", !0)
|
|
3471
|
+
], 10, co)) : H("", !0),
|
|
3482
3472
|
e.iconClass ? (i(), u("span", {
|
|
3483
3473
|
key: 3,
|
|
3484
|
-
class:
|
|
3485
|
-
}, null, 2)) :
|
|
3474
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3475
|
+
}, null, 2)) : H("", !0),
|
|
3486
3476
|
o("img", {
|
|
3487
3477
|
class: "ytree-node__avatar",
|
|
3488
3478
|
src: w(M, a),
|
|
3489
3479
|
alt: x(M) ? "person" : "dept"
|
|
3490
3480
|
}, null, 8, ho),
|
|
3491
3481
|
o("span", {
|
|
3492
|
-
class:
|
|
3482
|
+
class: K(["ytree-node__label", {
|
|
3493
3483
|
"is-employee": x(M)
|
|
3494
3484
|
}])
|
|
3495
|
-
},
|
|
3485
|
+
}, ne(I(M)), 3),
|
|
3496
3486
|
o("div", po, [
|
|
3497
|
-
ce(
|
|
3487
|
+
ce(c.$slots, "node-content", {
|
|
3498
3488
|
node: M,
|
|
3499
|
-
isCurrent:
|
|
3500
|
-
isExpanded:
|
|
3489
|
+
isCurrent: Q(M),
|
|
3490
|
+
isExpanded: F(M),
|
|
3501
3491
|
hasChildren: g(M)
|
|
3502
3492
|
}, void 0, !0)
|
|
3503
3493
|
])
|
|
3504
3494
|
], 42, io)
|
|
3505
3495
|
], 2))), 128))
|
|
3506
|
-
])) :
|
|
3496
|
+
])) : H("", !0)
|
|
3507
3497
|
]),
|
|
3508
3498
|
_: 2
|
|
3509
3499
|
}, 1024)
|
|
3510
3500
|
], 2))), 128))
|
|
3511
|
-
])) :
|
|
3501
|
+
])) : H("", !0)
|
|
3512
3502
|
]),
|
|
3513
3503
|
_: 2
|
|
3514
3504
|
}, 1024)
|
|
3515
3505
|
], 2))), 128))
|
|
3516
|
-
])) :
|
|
3506
|
+
])) : H("", !0)
|
|
3517
3507
|
]),
|
|
3518
3508
|
_: 2
|
|
3519
3509
|
}, 1024)
|
|
3520
3510
|
], 2))), 128))
|
|
3521
|
-
])) :
|
|
3511
|
+
])) : H("", !0)
|
|
3522
3512
|
]),
|
|
3523
3513
|
_: 2
|
|
3524
3514
|
}, 1024)
|
|
@@ -3526,13 +3516,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3526
3516
|
])
|
|
3527
3517
|
], 2));
|
|
3528
3518
|
}
|
|
3529
|
-
}), wo = /* @__PURE__ */
|
|
3519
|
+
}), wo = /* @__PURE__ */ me(mo, [["__scopeId", "data-v-6ab410ed"]]), ko = { class: "query-encapsulation" }, bo = { class: "query-encapsulation__container" }, xo = { class: "query-encapsulation__content" }, $o = { class: "query-encapsulation__fields" }, Co = { class: "query-encapsulation__field-wrapper" }, Do = {
|
|
3530
3520
|
key: 0,
|
|
3531
3521
|
class: "query-encapsulation__field-label"
|
|
3532
3522
|
}, _o = {
|
|
3533
3523
|
key: 0,
|
|
3534
3524
|
class: "query-encapsulation__toggle"
|
|
3535
|
-
}, So = { class: "query-encapsulation__actions" }, Lo = { class: "query-encapsulation__actions-group" }, Mo = /* @__PURE__ */
|
|
3525
|
+
}, So = { class: "query-encapsulation__actions" }, Lo = { class: "query-encapsulation__actions-group" }, Mo = /* @__PURE__ */ ge({
|
|
3536
3526
|
__name: "QueryEncapsulation",
|
|
3537
3527
|
props: {
|
|
3538
3528
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3543,11 +3533,11 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3543
3533
|
},
|
|
3544
3534
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3545
3535
|
setup(e, { emit: $ }) {
|
|
3546
|
-
const t = e, n = $, m = E(!1),
|
|
3536
|
+
const t = e, n = $, m = E(!1), p = st({}), y = ["select", "date", "daterange"];
|
|
3547
3537
|
let L;
|
|
3548
|
-
const C =
|
|
3549
|
-
function w(
|
|
3550
|
-
switch (
|
|
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) {
|
|
3551
3541
|
case "select":
|
|
3552
3542
|
return tt;
|
|
3553
3543
|
case "date":
|
|
@@ -3558,87 +3548,87 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3558
3548
|
return et;
|
|
3559
3549
|
}
|
|
3560
3550
|
}
|
|
3561
|
-
function g(
|
|
3562
|
-
n("field-change",
|
|
3551
|
+
function g(W) {
|
|
3552
|
+
n("field-change", W, p[W.key]), n("update:modelValue", { ...p }), y.includes(W.type) && q();
|
|
3563
3553
|
}
|
|
3564
|
-
function
|
|
3565
|
-
const
|
|
3566
|
-
n("search", { data:
|
|
3554
|
+
function b() {
|
|
3555
|
+
const W = Q(p), z = le(W), R = { ...p };
|
|
3556
|
+
n("search", { data: z, raw: R });
|
|
3567
3557
|
}
|
|
3568
3558
|
function V() {
|
|
3569
|
-
Object.keys(
|
|
3570
|
-
const
|
|
3571
|
-
(
|
|
3572
|
-
}), n("reset"), n("update:modelValue", { ...
|
|
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] = "";
|
|
3562
|
+
}), n("reset"), n("update:modelValue", { ...p });
|
|
3573
3563
|
}
|
|
3574
|
-
function
|
|
3564
|
+
function j() {
|
|
3575
3565
|
m.value = !m.value;
|
|
3576
3566
|
}
|
|
3577
|
-
function
|
|
3578
|
-
return
|
|
3579
|
-
enter: () =>
|
|
3580
|
-
paste: () =>
|
|
3567
|
+
function F(W) {
|
|
3568
|
+
return W.type !== "input" ? {} : {
|
|
3569
|
+
enter: () => A(),
|
|
3570
|
+
paste: () => A()
|
|
3581
3571
|
};
|
|
3582
3572
|
}
|
|
3583
|
-
async function
|
|
3584
|
-
await
|
|
3573
|
+
async function A() {
|
|
3574
|
+
await se(), b();
|
|
3585
3575
|
}
|
|
3586
|
-
function
|
|
3576
|
+
function q() {
|
|
3587
3577
|
L && clearTimeout(L), L = setTimeout(() => {
|
|
3588
|
-
L = void 0,
|
|
3578
|
+
L = void 0, se().then(() => b());
|
|
3589
3579
|
}, 0);
|
|
3590
3580
|
}
|
|
3591
|
-
function
|
|
3592
|
-
const
|
|
3593
|
-
return Object.keys(
|
|
3594
|
-
const Y = t.fields.find((
|
|
3595
|
-
if (!(
|
|
3596
|
-
if (typeof
|
|
3597
|
-
|
|
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);
|
|
3598
3588
|
return;
|
|
3599
3589
|
}
|
|
3600
3590
|
if (Y && (Y.type === "date" || Y.type === "daterange")) {
|
|
3601
|
-
|
|
3591
|
+
X !== 0 && (z[R] = X);
|
|
3602
3592
|
return;
|
|
3603
3593
|
}
|
|
3604
|
-
|
|
3594
|
+
z[R] = X;
|
|
3605
3595
|
}
|
|
3606
|
-
}),
|
|
3596
|
+
}), z;
|
|
3607
3597
|
}
|
|
3608
|
-
function
|
|
3609
|
-
const
|
|
3610
|
-
return Object.keys(
|
|
3611
|
-
const Y =
|
|
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);
|
|
3612
3602
|
if (ee)
|
|
3613
3603
|
if (ee.type === "daterange" && typeof Y == "object") {
|
|
3614
|
-
const
|
|
3615
|
-
Y.startDate && Y.endDate && Y.startDate !== 0 && Y.endDate !== 0 && (ee.format === "timestamp" ? (
|
|
3616
|
-
} else ee.type === "date" && Y && Y !== 0 && ee.format === "timestamp" ?
|
|
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;
|
|
3617
3607
|
else
|
|
3618
|
-
|
|
3619
|
-
}),
|
|
3608
|
+
z[R] = Y;
|
|
3609
|
+
}), z;
|
|
3620
3610
|
}
|
|
3621
|
-
function
|
|
3622
|
-
t.fields.forEach((
|
|
3623
|
-
var
|
|
3624
|
-
|
|
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]) || {
|
|
3625
3615
|
startDate: null,
|
|
3626
3616
|
endDate: null
|
|
3627
|
-
} :
|
|
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]) || "");
|
|
3628
3618
|
});
|
|
3629
3619
|
}
|
|
3630
3620
|
return oe(
|
|
3631
3621
|
() => t.modelValue,
|
|
3632
|
-
(
|
|
3633
|
-
|
|
3622
|
+
(W) => {
|
|
3623
|
+
W && Object.assign(p, W);
|
|
3634
3624
|
},
|
|
3635
3625
|
{ deep: !0, immediate: !0 }
|
|
3636
|
-
),
|
|
3637
|
-
|
|
3626
|
+
), $e(() => {
|
|
3627
|
+
J();
|
|
3638
3628
|
}), Xe(() => {
|
|
3639
3629
|
L && (clearTimeout(L), L = void 0);
|
|
3640
|
-
}), (
|
|
3641
|
-
o("div",
|
|
3630
|
+
}), (W, z) => (i(), u("div", ko, [
|
|
3631
|
+
o("div", bo, [
|
|
3642
3632
|
o("div", xo, [
|
|
3643
3633
|
o("div", $o, [
|
|
3644
3634
|
de(it, {
|
|
@@ -3646,27 +3636,27 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3646
3636
|
tag: "div",
|
|
3647
3637
|
class: "query-encapsulation__fields-group"
|
|
3648
3638
|
}, {
|
|
3649
|
-
default:
|
|
3650
|
-
(i(!0), u(
|
|
3651
|
-
key:
|
|
3639
|
+
default: fe(() => [
|
|
3640
|
+
(i(!0), u(re, null, ve(I.value, (R) => (i(), u("div", {
|
|
3641
|
+
key: R.key,
|
|
3652
3642
|
class: "query-encapsulation__field-item"
|
|
3653
3643
|
}, [
|
|
3654
3644
|
o("div", Co, [
|
|
3655
|
-
e.Iflabel ? (i(), u("label", Do,
|
|
3656
|
-
(i(),
|
|
3657
|
-
modelValue:
|
|
3658
|
-
"onUpdate:modelValue": (Y) =>
|
|
3659
|
-
placeholder:
|
|
3660
|
-
options:
|
|
3661
|
-
clearable:
|
|
3662
|
-
size:
|
|
3663
|
-
width:
|
|
3664
|
-
format:
|
|
3665
|
-
"include-time":
|
|
3666
|
-
filterable:
|
|
3667
|
-
}, ct(
|
|
3668
|
-
onInput: (Y) => g(
|
|
3669
|
-
onChange: (Y) => g(
|
|
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)
|
|
3670
3660
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3671
3661
|
])
|
|
3672
3662
|
]))), 128))
|
|
@@ -3677,27 +3667,27 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3677
3667
|
de(Ne, {
|
|
3678
3668
|
variant: "secondary",
|
|
3679
3669
|
size: "small",
|
|
3680
|
-
onClick:
|
|
3670
|
+
onClick: j
|
|
3681
3671
|
}, {
|
|
3682
|
-
default:
|
|
3683
|
-
|
|
3672
|
+
default: fe(() => [
|
|
3673
|
+
xe(ne(m.value ? "收起" : "展开") + " ", 1),
|
|
3684
3674
|
o("span", {
|
|
3685
|
-
class:
|
|
3675
|
+
class: K(["query-encapsulation__toggle-icon", { "is-expanded": m.value }])
|
|
3686
3676
|
}, "▼", 2)
|
|
3687
3677
|
]),
|
|
3688
3678
|
_: 1
|
|
3689
3679
|
})
|
|
3690
|
-
])) :
|
|
3680
|
+
])) : H("", !0),
|
|
3691
3681
|
o("div", So, [
|
|
3692
3682
|
o("div", Lo, [
|
|
3693
3683
|
de(Ne, {
|
|
3694
3684
|
variant: "primary",
|
|
3695
3685
|
size: "small",
|
|
3696
|
-
onClick:
|
|
3686
|
+
onClick: b,
|
|
3697
3687
|
loading: e.loading
|
|
3698
3688
|
}, {
|
|
3699
|
-
default:
|
|
3700
|
-
|
|
3689
|
+
default: fe(() => [...z[0] || (z[0] = [
|
|
3690
|
+
xe(" 搜索 ", -1)
|
|
3701
3691
|
])]),
|
|
3702
3692
|
_: 1
|
|
3703
3693
|
}, 8, ["loading"]),
|
|
@@ -3707,12 +3697,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3707
3697
|
onClick: V,
|
|
3708
3698
|
loading: e.loading
|
|
3709
3699
|
}, {
|
|
3710
|
-
default:
|
|
3711
|
-
|
|
3700
|
+
default: fe(() => [...z[1] || (z[1] = [
|
|
3701
|
+
xe(" 重置 ", -1)
|
|
3712
3702
|
])]),
|
|
3713
3703
|
_: 1
|
|
3714
3704
|
}, 8, ["loading"]),
|
|
3715
|
-
ce(
|
|
3705
|
+
ce(W.$slots, "extra-actions", {}, void 0, !0)
|
|
3716
3706
|
])
|
|
3717
3707
|
])
|
|
3718
3708
|
])
|
|
@@ -3720,7 +3710,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3720
3710
|
])
|
|
3721
3711
|
]));
|
|
3722
3712
|
}
|
|
3723
|
-
}), Io = /* @__PURE__ */
|
|
3713
|
+
}), Io = /* @__PURE__ */ me(Mo, [["__scopeId", "data-v-61f05ecd"]]), Eo = {
|
|
3724
3714
|
key: 0,
|
|
3725
3715
|
width: "16",
|
|
3726
3716
|
height: "16",
|
|
@@ -3738,7 +3728,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3738
3728
|
height: "16",
|
|
3739
3729
|
viewBox: "0 0 24 24",
|
|
3740
3730
|
fill: "none"
|
|
3741
|
-
},
|
|
3731
|
+
}, Ko = ["textContent"], zo = /* @__PURE__ */ ge({
|
|
3742
3732
|
__name: "ymessageToast",
|
|
3743
3733
|
props: {
|
|
3744
3734
|
id: {},
|
|
@@ -3753,7 +3743,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3753
3743
|
setup(e) {
|
|
3754
3744
|
const $ = e, t = E(!1);
|
|
3755
3745
|
let n;
|
|
3756
|
-
|
|
3746
|
+
$e(() => {
|
|
3757
3747
|
requestAnimationFrame(() => {
|
|
3758
3748
|
t.value = !0, $.duration && $.duration > 0 && (n = window.setTimeout(() => m(), $.duration));
|
|
3759
3749
|
});
|
|
@@ -3763,23 +3753,23 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3763
3753
|
function m() {
|
|
3764
3754
|
t.value = !1;
|
|
3765
3755
|
}
|
|
3766
|
-
function
|
|
3767
|
-
var
|
|
3768
|
-
(
|
|
3756
|
+
function p() {
|
|
3757
|
+
var y;
|
|
3758
|
+
(y = $.onClose) == null || y.call($, $.id);
|
|
3769
3759
|
}
|
|
3770
|
-
return (
|
|
3760
|
+
return (y, L) => (i(), Se(be, {
|
|
3771
3761
|
name: "y-msg-fade",
|
|
3772
|
-
onAfterLeave:
|
|
3762
|
+
onAfterLeave: p
|
|
3773
3763
|
}, {
|
|
3774
|
-
default:
|
|
3764
|
+
default: fe(() => [
|
|
3775
3765
|
Ee(o("div", {
|
|
3776
|
-
class:
|
|
3777
|
-
style:
|
|
3766
|
+
class: K(["y-msg", [`y-msg--${e.type}`]]),
|
|
3767
|
+
style: ue({ zIndex: e.zIndex }),
|
|
3778
3768
|
role: "status",
|
|
3779
3769
|
"aria-live": "polite"
|
|
3780
3770
|
}, [
|
|
3781
3771
|
o("span", {
|
|
3782
|
-
class:
|
|
3772
|
+
class: K(["y-msg__icon", `y-msg__icon--${e.type}`]),
|
|
3783
3773
|
"aria-hidden": "true"
|
|
3784
3774
|
}, [
|
|
3785
3775
|
e.type === "success" ? (i(), u("svg", Eo, [...L[0] || (L[0] = [
|
|
@@ -3810,64 +3800,64 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3810
3800
|
], 2),
|
|
3811
3801
|
o("div", {
|
|
3812
3802
|
class: "y-msg__content",
|
|
3813
|
-
textContent:
|
|
3814
|
-
}, null, 8,
|
|
3803
|
+
textContent: ne(e.message)
|
|
3804
|
+
}, null, 8, Ko),
|
|
3815
3805
|
e.closable ? (i(), u("button", {
|
|
3816
3806
|
key: 0,
|
|
3817
3807
|
class: "y-msg__close",
|
|
3818
3808
|
type: "button",
|
|
3819
3809
|
onClick: m
|
|
3820
|
-
}, "✕")) :
|
|
3810
|
+
}, "✕")) : H("", !0)
|
|
3821
3811
|
], 6), [
|
|
3822
|
-
[
|
|
3812
|
+
[ze, t.value]
|
|
3823
3813
|
])
|
|
3824
3814
|
]),
|
|
3825
3815
|
_: 1
|
|
3826
3816
|
}));
|
|
3827
3817
|
}
|
|
3828
|
-
}), Ho = /* @__PURE__ */
|
|
3829
|
-
let
|
|
3830
|
-
const Ue = 12,
|
|
3831
|
-
function
|
|
3818
|
+
}), Ho = /* @__PURE__ */ me(zo, [["__scopeId", "data-v-c5dc221c"]]);
|
|
3819
|
+
let Ro = 1;
|
|
3820
|
+
const Ue = 12, _e = [];
|
|
3821
|
+
function Vo() {
|
|
3832
3822
|
let e = 20;
|
|
3833
|
-
return
|
|
3823
|
+
return _e.forEach(($) => {
|
|
3834
3824
|
e += $.height + Ue;
|
|
3835
3825
|
}), e;
|
|
3836
3826
|
}
|
|
3837
3827
|
function Qe(e) {
|
|
3838
|
-
const $ =
|
|
3828
|
+
const $ = _e.findIndex((p) => p.id === e);
|
|
3839
3829
|
if ($ === -1) return;
|
|
3840
|
-
const { el: t } =
|
|
3830
|
+
const { el: t } = _e[$], n = t.firstElementChild;
|
|
3841
3831
|
if (n) {
|
|
3842
|
-
const
|
|
3843
|
-
n.style.top =
|
|
3832
|
+
const p = window.getComputedStyle(n).top;
|
|
3833
|
+
n.style.top = p, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3844
3834
|
}
|
|
3845
|
-
|
|
3835
|
+
_e[$].leaving = !0, je(), setTimeout(() => {
|
|
3846
3836
|
Ge(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3847
|
-
const
|
|
3848
|
-
|
|
3837
|
+
const p = _e.findIndex((y) => y.id === e);
|
|
3838
|
+
p !== -1 && _e.splice(p, 1), je();
|
|
3849
3839
|
}, 260);
|
|
3850
3840
|
}
|
|
3851
3841
|
function qe(e) {
|
|
3852
|
-
var
|
|
3853
|
-
const $ =
|
|
3842
|
+
var p;
|
|
3843
|
+
const $ = Ro++, t = document.createElement("div");
|
|
3854
3844
|
document.body.appendChild(t);
|
|
3855
3845
|
const n = de(Ho, {
|
|
3856
3846
|
id: $,
|
|
3857
3847
|
type: e.type || "success",
|
|
3858
3848
|
message: e.message,
|
|
3859
3849
|
duration: e.duration ?? 2500,
|
|
3860
|
-
offset:
|
|
3850
|
+
offset: Vo(),
|
|
3861
3851
|
zIndex: 3e3 + $,
|
|
3862
3852
|
closable: e.closable ?? !1,
|
|
3863
|
-
onClose: (
|
|
3853
|
+
onClose: (y) => Qe(y)
|
|
3864
3854
|
});
|
|
3865
3855
|
Ge(n, t);
|
|
3866
|
-
const m = ((
|
|
3867
|
-
return
|
|
3868
|
-
const
|
|
3869
|
-
if (!
|
|
3870
|
-
const L =
|
|
3856
|
+
const m = ((p = t.firstElementChild) == null ? void 0 : p.offsetHeight) || 0;
|
|
3857
|
+
return _e.push({ id: $, el: t, vm: n, height: m, leaving: !1 }), je(), requestAnimationFrame(() => {
|
|
3858
|
+
const y = t.firstElementChild;
|
|
3859
|
+
if (!y) return;
|
|
3860
|
+
const L = y.offsetHeight || m || 0, C = _e.find((I) => I.id === $);
|
|
3871
3861
|
C && (C.height = L, je());
|
|
3872
3862
|
}), { close: () => Qe($) };
|
|
3873
3863
|
}
|
|
@@ -3885,7 +3875,7 @@ const Oe = {
|
|
|
3885
3875
|
typeof window < "u" && (window.YMessage = Oe, typeof globalThis.YMessage > "u" && (globalThis.YMessage = Oe));
|
|
3886
3876
|
function je() {
|
|
3887
3877
|
let e = 20;
|
|
3888
|
-
|
|
3878
|
+
_e.forEach(($) => {
|
|
3889
3879
|
const t = $.el.firstElementChild;
|
|
3890
3880
|
if (!t) return;
|
|
3891
3881
|
const n = e;
|