@nhdropshipping/y-components 1.0.48 → 1.0.50
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 +4 -0
- 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 +1280 -1270
- 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 we, computed as N, createElementBlock as u, openBlock as i, normalizeClass as z, createElementVNode as o, renderSlot as ce, Fragment as ue, renderList as he, createCommentVNode as K, toDisplayString as le, ref as E, watch as oe, normalizeStyle as ie, withKeys as ke, nextTick as ae, onMounted as De, onUnmounted as Be, resolveComponent as Ve, createVNode as de, Transition as $e, withCtx as ve, createTextVNode as Ce, createBlock as Me, withModifiers as X, withDirectives as Ee, vModelText as ot, Teleport as Fe, vShow as Ke, 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__ */ we({
|
|
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 y = N(() => {
|
|
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
|
+
}), p = N(() => 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) => p.value ? (i(), u("div", vt, [
|
|
60
|
+
(i(!0), u(ue, null, he(e.groupItems, (x, w) => {
|
|
61
61
|
var g;
|
|
62
62
|
return i(), u("button", {
|
|
63
63
|
key: x.value ?? w,
|
|
64
|
-
class:
|
|
64
|
+
class: z(["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: (k) => L(x, k)
|
|
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
|
+
])])) : K("", !0),
|
|
92
|
+
x.label && !x.onlyIcon ? (i(), u("span", mt, le(x.label), 1)) : K("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, ht);
|
|
95
95
|
}), 128))
|
|
96
96
|
])) : (i(), u("button", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class:
|
|
98
|
+
class: z(["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
|
+
y.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
|
+
}), be = (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__ */ be(wt, [["__scopeId", "data-v-53157673"]]), bt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "min", "max", "disabled", "required", "value"], kt = /* @__PURE__ */ we({
|
|
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), y = E(""), p = 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 O = V.target;
|
|
148
|
+
p.value = !0, n("update:modelValue", O.value);
|
|
149
149
|
}
|
|
150
150
|
function x() {
|
|
151
|
-
L.value = !0, t.clearOnFocus && (
|
|
151
|
+
L.value = !0, t.clearOnFocus && (y.value = t.modelValue || "", p.value = !1, C.value = y.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 && !p.value && (!t.modelValue || t.modelValue === "") && n("update:modelValue", y.value), t.min !== void 0 && t.modelValue !== void 0 && t.modelValue !== "") {
|
|
155
|
+
const V = Number(t.modelValue), O = Number(t.min);
|
|
156
|
+
!Number.isNaN(V) && !Number.isNaN(O) && V < O && n("update:modelValue", String(O));
|
|
157
157
|
}
|
|
158
158
|
C.value = t.placeholder || "";
|
|
159
159
|
}
|
|
160
160
|
function g(V) {
|
|
161
|
-
const
|
|
162
|
-
n("enter",
|
|
161
|
+
const O = V.target;
|
|
162
|
+
n("enter", O.value);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
const
|
|
164
|
+
function k(V) {
|
|
165
|
+
const O = V.target;
|
|
166
166
|
requestAnimationFrame(() => {
|
|
167
|
-
n("paste",
|
|
167
|
+
n("paste", O.value);
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
return (V,
|
|
171
|
-
class:
|
|
172
|
-
style:
|
|
170
|
+
return (V, O) => (i(), u("div", {
|
|
171
|
+
class: z(["y-input-wrap", { "is-block": e.block }]),
|
|
172
|
+
style: ie({ width: e.width })
|
|
173
173
|
}, [
|
|
174
174
|
o("input", {
|
|
175
175
|
ref_key: "inputRef",
|
|
176
176
|
ref: m,
|
|
177
|
-
class:
|
|
177
|
+
class: z(["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: k
|
|
194
|
+
}, null, 42, bt)
|
|
195
195
|
], 6));
|
|
196
196
|
}
|
|
197
|
-
}), et = /* @__PURE__ */
|
|
197
|
+
}), et = /* @__PURE__ */ be(kt, [["__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
|
+
}, zt = {
|
|
219
219
|
key: 0,
|
|
220
220
|
style: { width: "34px", "min-width": "34px" }
|
|
221
|
-
},
|
|
221
|
+
}, Kt = {
|
|
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
|
+
}, At = ["onClick"], Rt = {
|
|
228
228
|
key: 1,
|
|
229
229
|
class: "col-select"
|
|
230
|
-
}, Wt = ["value", "checked", "onChange"],
|
|
230
|
+
}, Wt = ["value", "checked", "onChange"], Vt = ["colspan"], Ft = /* @__PURE__ */ we({
|
|
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), y = E(t.pageSize), p = E([]), L = E(/* @__PURE__ */ new Set()), C = E("none"), I = E(), x = E(), w = E(), g = E(), k = E([]), V = E({}), O = N(
|
|
258
|
+
() => t.columns.filter((l) => !B(l.width)).map((l) => l.key)
|
|
259
259
|
);
|
|
260
|
-
function
|
|
261
|
-
return `${(100 / (
|
|
260
|
+
function P() {
|
|
261
|
+
return `${(100 / (O.value.length || 1)).toFixed(6)}%`;
|
|
262
262
|
}
|
|
263
|
-
const
|
|
263
|
+
const R = E(), j = E({
|
|
264
264
|
show: !1,
|
|
265
265
|
thumbHeight: 40,
|
|
266
266
|
thumbTop: 0
|
|
267
267
|
});
|
|
268
|
-
let
|
|
269
|
-
const
|
|
270
|
-
function
|
|
268
|
+
let Z = !1, se = 0, G = 0;
|
|
269
|
+
const H = E(0);
|
|
270
|
+
function B(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 c = String(l).trim();
|
|
275
|
+
if (c)
|
|
276
|
+
return /^\d+(\.\d+)?$/.test(c) ? `${c}px` : c;
|
|
277
|
+
}
|
|
278
|
+
function W(l) {
|
|
279
|
+
const c = B(l);
|
|
280
|
+
if (!c) return null;
|
|
281
|
+
const D = parseFloat(c);
|
|
282
282
|
return Number.isFinite(D) ? D : null;
|
|
283
283
|
}
|
|
284
|
-
const Y =
|
|
284
|
+
const Y = N(() => {
|
|
285
285
|
let l = t.columns.length;
|
|
286
286
|
return t.selectable && (l += 1), t.expandable && (l += 1), l;
|
|
287
|
-
}), ee =
|
|
287
|
+
}), ee = N(() => {
|
|
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((c) => t.searchFields.some((D) => {
|
|
292
|
+
const S = r(c, D);
|
|
293
293
|
return String(S).toLowerCase().includes(l);
|
|
294
294
|
}));
|
|
295
|
-
}),
|
|
295
|
+
}), J = N(() => (t.pagination, ee.value)), fe = N(() => {
|
|
296
296
|
if (!t.selectable) return !1;
|
|
297
|
-
const l =
|
|
298
|
-
return l.length > 0 && l.every((
|
|
299
|
-
}),
|
|
297
|
+
const l = J.value.map((c, D) => d(c, D));
|
|
298
|
+
return l.length > 0 && l.every((c) => p.value.includes(c));
|
|
299
|
+
}), me = N(() => {
|
|
300
300
|
const l = [];
|
|
301
|
-
let
|
|
301
|
+
let c = 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 = W(S.width);
|
|
307
|
+
T !== null ? _ = T : k.value[D] && (_ = W(k.value[D]) ?? _), l.push(c), c += _;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
return l;
|
|
311
|
-
}),
|
|
311
|
+
}), F = N(() => {
|
|
312
312
|
const l = [];
|
|
313
|
-
let
|
|
313
|
+
let c = 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 q = W(_.width);
|
|
320
|
+
q !== null ? T = q : k.value[S] && (T = W(k.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(c), c += D[S].width;
|
|
325
325
|
return l;
|
|
326
326
|
});
|
|
327
|
-
function
|
|
328
|
-
if (
|
|
327
|
+
function Q(l, c) {
|
|
328
|
+
if (c === "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 d(l, c) {
|
|
341
|
+
return typeof t.rowKey == "function" ? t.rowKey(l) : l[t.rowKey] || c;
|
|
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, c) {
|
|
350
|
+
return c.split(".").reduce((D, S) => D == null ? void 0 : D[S], l);
|
|
351
351
|
}
|
|
352
|
-
function f(l,
|
|
352
|
+
function f(l, c = !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"), c && D.push("col-fixed-right-header")), l.fixed === "left" && (D.push("col-fixed-left"), c && D.push("col-fixed-left-header")), D.join(" ");
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
const S = {}, _ =
|
|
356
|
+
function b(l, c, D) {
|
|
357
|
+
const S = {}, _ = B(l.width);
|
|
358
358
|
if (_)
|
|
359
359
|
S.width = _, S.minWidth = _, S.maxWidth = _;
|
|
360
360
|
else {
|
|
361
|
-
const T =
|
|
361
|
+
const T = P();
|
|
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 = Q(c, "left"), q = me.value[T] || 0;
|
|
366
|
+
S.left = `${q}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 = Q(c, "right"), q = F.value[T] || 0;
|
|
369
|
+
D ? S.right = `${q - 3}px` : S.right = `${q}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, c) {
|
|
374
|
+
const D = r(l, c.key);
|
|
375
|
+
return c.formatter ? c.formatter(D, l) : D || "";
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
|
|
377
|
+
function U(l) {
|
|
378
|
+
p.value.includes(l) ? p.value = p.value.filter((c) => c !== l) : p.value = [...p.value, l], n("select", p.value), n("update:selectedItems", p.value);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
const l =
|
|
382
|
-
if (l.every((
|
|
383
|
-
|
|
380
|
+
function te() {
|
|
381
|
+
const l = J.value.map((c, D) => d(c, D));
|
|
382
|
+
if (l.every((c) => p.value.includes(c)))
|
|
383
|
+
p.value = p.value.filter((c) => !l.includes(c));
|
|
384
384
|
else {
|
|
385
|
-
const
|
|
386
|
-
|
|
385
|
+
const c = /* @__PURE__ */ new Set([...p.value, ...l]);
|
|
386
|
+
p.value = Array.from(c);
|
|
387
387
|
}
|
|
388
|
-
n("select",
|
|
388
|
+
n("select", p.value), n("update:selectedItems", p.value);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
|
|
390
|
+
function A() {
|
|
391
|
+
p.value = [], n("select", p.value), n("update:selectedItems", p.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 ne(l) {
|
|
399
399
|
m.value = l, n("page-change", l);
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
401
|
+
function Se(l) {
|
|
402
|
+
y.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 c = typeof l == "number" && l > 0 ? l : 1;
|
|
406
|
+
m.value !== c && (m.value = c);
|
|
407
407
|
}), oe(() => t.pageSize, (l) => {
|
|
408
|
-
const
|
|
409
|
-
|
|
408
|
+
const c = typeof l == "number" && l > 0 ? l : 10;
|
|
409
|
+
y.value !== c && (y.value = c);
|
|
410
410
|
});
|
|
411
|
-
function
|
|
412
|
-
I.value &&
|
|
413
|
-
const l = I.value.getBoundingClientRect(),
|
|
414
|
-
Ze && (Ze.offsetHeight >
|
|
411
|
+
function ye() {
|
|
412
|
+
I.value && ae(() => {
|
|
413
|
+
const l = I.value.getBoundingClientRect(), c = window.innerHeight, D = l.top, S = I.value.querySelector(".table-header"), _ = S ? S.offsetHeight : 40, T = I.value.querySelector(".ypagination"), q = T ? T.offsetHeight : 60, pe = I.value.querySelector(".bulk-bar"), ge = pe ? pe.offsetHeight : 0, ze = _ + q + ge + 20, re = c - D - ze, lt = Math.max(200, re), Ze = I.value.querySelector(".table-body-wrap .table");
|
|
414
|
+
Ze && (Ze.offsetHeight > re ? C.value = `${lt}px` : C.value = "none");
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
|
-
let
|
|
417
|
+
let xe = !1;
|
|
418
418
|
function Ie() {
|
|
419
|
-
!x.value || !w.value ||
|
|
420
|
-
|
|
419
|
+
!x.value || !w.value || xe || x.value.scrollLeft !== w.value.scrollLeft && (xe = !0, x.value.scrollLeft = w.value.scrollLeft, requestAnimationFrame(() => {
|
|
420
|
+
xe = !1;
|
|
421
421
|
}));
|
|
422
422
|
}
|
|
423
423
|
function Pe() {
|
|
424
|
-
!x.value || !w.value ||
|
|
425
|
-
|
|
424
|
+
!x.value || !w.value || xe || w.value.scrollLeft !== x.value.scrollLeft && (xe = !0, w.value.scrollLeft = x.value.scrollLeft, requestAnimationFrame(() => {
|
|
425
|
+
xe = !1;
|
|
426
426
|
}));
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
|
|
428
|
+
function Ae() {
|
|
429
|
+
ae(() => {
|
|
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, c = l.scrollHeight, D = l.clientHeight, S = l.scrollTop, _ = c > D + 1;
|
|
432
|
+
if (j.value.show = _, !_) return;
|
|
433
|
+
const T = 24, q = D / c, pe = R.value ? R.value.clientHeight : D, ge = Math.max(T, Math.floor(pe * q));
|
|
434
|
+
j.value.thumbHeight = ge;
|
|
435
|
+
const ze = Math.max(0, pe - ge), re = Math.max(1, c - D);
|
|
436
|
+
j.value.thumbTop = Math.min(ze, Math.floor(S / re * ze));
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
if (!
|
|
439
|
+
function Re(l) {
|
|
440
|
+
if (!Z || !w.value || !R.value) return;
|
|
441
441
|
l.preventDefault();
|
|
442
|
-
const
|
|
443
|
-
S.scrollTop = Math.min(
|
|
442
|
+
const c = R.value.clientHeight, D = Math.max(0, c - j.value.thumbHeight), S = w.value, _ = S.scrollHeight, T = S.clientHeight, q = Math.max(1, _ - T), ge = (l.clientY - se) / Math.max(1, D) * q;
|
|
443
|
+
S.scrollTop = Math.min(q, Math.max(0, G + ge)), Ae();
|
|
444
444
|
}
|
|
445
445
|
function Ye() {
|
|
446
|
-
|
|
446
|
+
Z = !1, window.removeEventListener("mousemove", Re), window.removeEventListener("mouseup", Ye);
|
|
447
447
|
}
|
|
448
448
|
function We() {
|
|
449
|
-
|
|
449
|
+
ae(() => {
|
|
450
450
|
var D, S;
|
|
451
|
-
if (
|
|
451
|
+
if (k.value.length === t.columns.length && k.value.every((_) => !!_))
|
|
452
452
|
return;
|
|
453
453
|
const l = [];
|
|
454
454
|
t.columns.forEach((_, T) => {
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
l.push(
|
|
455
|
+
const q = B(_.width);
|
|
456
|
+
if (q)
|
|
457
|
+
l.push(q), V.value[_.key] = q;
|
|
458
458
|
else if (V.value[_.key])
|
|
459
459
|
l.push(V.value[_.key]);
|
|
460
460
|
else {
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
l.push(he), V.value[_.key] = he;
|
|
464
|
-
else {
|
|
465
|
-
const pe = F();
|
|
461
|
+
const pe = k.value[T];
|
|
462
|
+
if (pe)
|
|
466
463
|
l.push(pe), V.value[_.key] = pe;
|
|
464
|
+
else {
|
|
465
|
+
const ge = P();
|
|
466
|
+
l.push(ge), V.value[_.key] = ge;
|
|
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 c = (D = g.value) == null ? void 0 : D.querySelector("tbody tr");
|
|
471
|
+
if (c) {
|
|
472
|
+
const _ = t.selectable ? 1 : 0, T = Array.from(c.children);
|
|
473
|
+
for (let q = 0; q < t.columns.length; q++)
|
|
474
|
+
if (!l[q]) {
|
|
475
|
+
const pe = T[_ + q];
|
|
476
|
+
if (pe && pe.clientWidth > 0) {
|
|
477
|
+
const ge = `${pe.clientWidth}px`;
|
|
478
|
+
l[q] = ge, V.value[t.columns[q].key] = ge;
|
|
479
479
|
} else {
|
|
480
|
-
const
|
|
481
|
-
l[
|
|
480
|
+
const ge = P();
|
|
481
|
+
l[q] = ge, V.value[t.columns[q].key] = ge;
|
|
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 || k.value[_] || "80px", t.columns[_] && (V.value[t.columns[_].key] = l[_]);
|
|
489
489
|
}
|
|
490
|
-
|
|
490
|
+
k.value = l;
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
493
|
function He() {
|
|
494
|
-
|
|
494
|
+
ye(), s();
|
|
495
495
|
}
|
|
496
496
|
oe(() => t.data, () => {
|
|
497
|
-
|
|
498
|
-
|
|
497
|
+
ae(() => {
|
|
498
|
+
ye(), Ie(), s(), L.value.clear();
|
|
499
499
|
});
|
|
500
|
-
}, { deep: !0 }), oe([m,
|
|
501
|
-
|
|
502
|
-
|
|
500
|
+
}, { deep: !0 }), oe([m, y], () => {
|
|
501
|
+
ae(() => {
|
|
502
|
+
ye(), Ie(), s();
|
|
503
503
|
});
|
|
504
504
|
}), oe(() => t.columns, () => {
|
|
505
|
-
const l = [],
|
|
505
|
+
const l = [], c = { ...V.value };
|
|
506
506
|
t.columns.forEach((S, _) => {
|
|
507
|
-
const T =
|
|
508
|
-
T ? (l.push(T),
|
|
507
|
+
const T = B(S.width);
|
|
508
|
+
T ? (l.push(T), c[S.key] = T) : c[S.key] ? l.push(c[S.key]) : k.value[_] ? (l.push(k.value[_]), c[S.key] = k.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(c).forEach((S) => {
|
|
512
|
+
D.has(S) || delete c[S];
|
|
513
|
+
}), V.value = c, k.value = l, ae(() => {
|
|
514
514
|
We(), Ie(), s();
|
|
515
515
|
});
|
|
516
|
-
}, { deep: !0 }), oe(() =>
|
|
517
|
-
|
|
518
|
-
|
|
516
|
+
}, { deep: !0 }), oe(() => p.value, () => {
|
|
517
|
+
ae(() => {
|
|
518
|
+
ye(), s();
|
|
519
519
|
});
|
|
520
520
|
}, { deep: !0 }), oe(() => t.loading, () => {
|
|
521
|
-
|
|
521
|
+
ae(() => {
|
|
522
522
|
s();
|
|
523
523
|
});
|
|
524
|
-
}),
|
|
525
|
-
var l,
|
|
526
|
-
|
|
527
|
-
|
|
524
|
+
}), De(() => {
|
|
525
|
+
var l, c;
|
|
526
|
+
ae(() => {
|
|
527
|
+
ye(), We(), s(), Ae();
|
|
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(), Ae(), s();
|
|
530
|
+
}, { passive: !0 }), (c = x.value) == null || c.addEventListener("scroll", () => {
|
|
531
531
|
Pe();
|
|
532
|
-
}, { passive: !0 }),
|
|
532
|
+
}, { passive: !0 }), ae(() => 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, c;
|
|
537
|
+
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l = w.value) == null || l.removeEventListener("scroll", Ie), (c = x.value) == null || c.removeEventListener("scroll", Pe), window.removeEventListener("mousemove", Re), 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, c = Math.ceil(l.offsetWidth - l.clientWidth);
|
|
544
|
+
if (H.value = c, c !== Te) {
|
|
545
|
+
Te = c;
|
|
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 = "", c > 0 ? (x.value.style.paddingRight = `${c}px`, D.style.width = "100%", D.style.marginRight = `-${c}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, c) => {
|
|
553
|
+
const D = Ve("YButton"), S = Ve("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($e, { name: "bulk-slide" }, {
|
|
560
|
+
default: ve(() => [
|
|
561
|
+
p.value.length && e.showBulkActions ? (i(), u("div", xt, [
|
|
562
|
+
o("div", $t, "已选择 " + le(p.value.length) + " 项", 1),
|
|
563
563
|
o("div", Ct, [
|
|
564
564
|
ce(l.$slots, "bulk-actions", {
|
|
565
|
-
selectedItems:
|
|
566
|
-
clearSelection:
|
|
565
|
+
selectedItems: p.value,
|
|
566
|
+
clearSelection: A
|
|
567
567
|
}, () => [
|
|
568
568
|
de(D, {
|
|
569
569
|
size: "small",
|
|
570
570
|
class: "btn",
|
|
571
|
-
onClick:
|
|
571
|
+
onClick: A
|
|
572
572
|
}, {
|
|
573
|
-
default:
|
|
574
|
-
|
|
573
|
+
default: ve(() => [...c[2] || (c[2] = [
|
|
574
|
+
Ce("清除选择", -1)
|
|
575
575
|
])]),
|
|
576
576
|
_: 1
|
|
577
577
|
})
|
|
578
578
|
], !0)
|
|
579
579
|
])
|
|
580
|
-
])) :
|
|
580
|
+
])) : K("", !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)) : K("", !0),
|
|
593
|
+
e.selectable ? (i(), u("col", Lt)) : K("", !0),
|
|
594
|
+
(i(!0), u(ue, null, he(e.columns, (_, T) => (i(), u("col", {
|
|
595
595
|
key: _.key,
|
|
596
|
-
style:
|
|
596
|
+
style: ie({ width: k.value[T] || void 0, minWidth: k.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)) : K("", !0),
|
|
602
602
|
e.selectable ? (i(), u("th", It, [
|
|
603
603
|
o("input", {
|
|
604
604
|
type: "checkbox",
|
|
605
|
-
checked:
|
|
606
|
-
onChange:
|
|
605
|
+
checked: fe.value,
|
|
606
|
+
onChange: te
|
|
607
607
|
}, null, 40, Et)
|
|
608
|
-
])) :
|
|
609
|
-
(i(!0), u(
|
|
608
|
+
])) : K("", !0),
|
|
609
|
+
(i(!0), u(ue, null, he(e.columns, (_, T) => (i(), u("th", {
|
|
610
610
|
key: _.key,
|
|
611
|
-
class:
|
|
612
|
-
style:
|
|
613
|
-
},
|
|
611
|
+
class: z(f(_, !0)),
|
|
612
|
+
style: ie(b(_, T, !0))
|
|
613
|
+
}, le(_.title), 7))), 128))
|
|
614
614
|
])
|
|
615
615
|
])
|
|
616
616
|
])
|
|
617
617
|
], 512),
|
|
618
618
|
o("div", {
|
|
619
|
-
class:
|
|
619
|
+
class: z(["table-body-wrap", { "is-loading": e.loading, "is-empty": !J.value.length && !e.loading }]),
|
|
620
620
|
ref_key: "bodyWrapRef",
|
|
621
621
|
ref: w,
|
|
622
|
-
style:
|
|
622
|
+
style: ie({ maxHeight: C.value })
|
|
623
623
|
}, [
|
|
624
|
-
e.loading ? (i(), u("div", Bt, [...
|
|
624
|
+
e.loading ? (i(), u("div", Bt, [...c[3] || (c[3] = [
|
|
625
625
|
o("div", { class: "loading-spinner" }, null, -1),
|
|
626
626
|
o("div", { class: "loading-text" }, "加载中...", -1)
|
|
627
|
-
])])) :
|
|
628
|
-
!
|
|
627
|
+
])])) : K("", !0),
|
|
628
|
+
!J.value.length && !e.loading ? (i(), u("div", Tt, [
|
|
629
629
|
ce(l.$slots, "empty", {}, () => [
|
|
630
|
-
|
|
630
|
+
Ce(le(e.emptyText), 1)
|
|
631
631
|
], !0)
|
|
632
|
-
])) :
|
|
632
|
+
])) : K("", !0),
|
|
633
633
|
o("table", {
|
|
634
|
-
class:
|
|
634
|
+
class: z(["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", zt)) : K("", !0),
|
|
640
|
+
e.selectable ? (i(), u("col", Kt)) : K("", !0),
|
|
641
|
+
(i(!0), u(ue, null, he(e.columns, (_, T) => (i(), u("col", {
|
|
642
642
|
key: _.key,
|
|
643
|
-
style:
|
|
643
|
+
style: ie({ width: k.value[T] || void 0, minWidth: k.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(ue, null, he(J.value, (_, T) => (i(), u(ue, {
|
|
648
|
+
key: d(_, 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: (q) => a(d(_, T))
|
|
656
656
|
}, [
|
|
657
657
|
o("span", {
|
|
658
|
-
class:
|
|
658
|
+
class: z(["expand-icon", { "is-open": h(d(_, T)) }])
|
|
659
659
|
}, null, 2)
|
|
660
|
-
], 8,
|
|
661
|
-
])) :
|
|
662
|
-
e.selectable ? (i(), u("td",
|
|
660
|
+
], 8, At)
|
|
661
|
+
])) : K("", !0),
|
|
662
|
+
e.selectable ? (i(), u("td", Rt, [
|
|
663
663
|
o("input", {
|
|
664
664
|
type: "checkbox",
|
|
665
|
-
value:
|
|
666
|
-
checked:
|
|
667
|
-
onChange: (
|
|
665
|
+
value: d(_, T),
|
|
666
|
+
checked: p.value.includes(d(_, T)),
|
|
667
|
+
onChange: (q) => U(d(_, T))
|
|
668
668
|
}, null, 40, Wt)
|
|
669
|
-
])) :
|
|
670
|
-
(i(!0), u(
|
|
671
|
-
key:
|
|
672
|
-
class:
|
|
673
|
-
style:
|
|
669
|
+
])) : K("", !0),
|
|
670
|
+
(i(!0), u(ue, null, he(e.columns, (q, pe) => (i(), u("td", {
|
|
671
|
+
key: q.key,
|
|
672
|
+
class: z(f(q)),
|
|
673
|
+
style: ie(b(q, pe, !1))
|
|
674
674
|
}, [
|
|
675
|
-
ce(l.$slots, `cell-${
|
|
675
|
+
ce(l.$slots, `cell-${q.key}`, {
|
|
676
676
|
item: _,
|
|
677
|
-
value: r(_,
|
|
677
|
+
value: r(_, q.key),
|
|
678
678
|
index: T
|
|
679
679
|
}, () => [
|
|
680
|
-
|
|
680
|
+
Ce(le(M(_, q)), 1)
|
|
681
681
|
], !0)
|
|
682
682
|
], 6))), 128))
|
|
683
683
|
]),
|
|
684
|
-
t.expandable && h(
|
|
685
|
-
key: `${
|
|
684
|
+
t.expandable && h(d(_, T)) ? (i(), u("tr", {
|
|
685
|
+
key: `${d(_, 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, Vt)
|
|
697
|
+
])) : K("", !0)
|
|
698
698
|
], 64))), 128))
|
|
699
699
|
])
|
|
700
700
|
], 2)
|
|
701
701
|
], 6),
|
|
702
|
-
e.pagination ? (i(),
|
|
702
|
+
e.pagination ? (i(), Me(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": c[0] || (c[0] = (_) => m.value = _),
|
|
707
|
+
"page-size": y.value,
|
|
708
|
+
"onUpdate:pageSize": c[1] || (c[1] = (_) => y.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: ne,
|
|
712
|
+
onPageSizeChange: Se
|
|
713
|
+
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : K("", !0)
|
|
714
714
|
])
|
|
715
715
|
], 512);
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
|
-
}), Pt = /* @__PURE__ */
|
|
718
|
+
}), Pt = /* @__PURE__ */ be(Ft, [["__scopeId", "data-v-a2bea873"]]), Yt = ["onKeydown", "aria-expanded"], Nt = ["src"], Ot = ["placeholder", "onKeydown"], jt = ["onClick", "onMouseenter"], qt = ["src"], Ut = /* @__PURE__ */ we({
|
|
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), y = E(-1), p = E(), L = E(), C = E(), I = E(), x = E(!1), w = E(), g = E(""), k = N(() => t.options.find((a) => j(a) === t.modelValue) || null), V = N(() => k.value ? Z(k.value) : ""), O = N(() => {
|
|
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 = Z(r);
|
|
742
742
|
return String(f).toLowerCase().includes(a);
|
|
743
743
|
}) : t.options;
|
|
744
|
-
}),
|
|
744
|
+
}), P = N(() => {
|
|
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(), b = ((M = C.value) == null ? void 0 : M.getBoundingClientRect().width) || f.width;
|
|
749
|
+
return a.left = `${f.left}px`, a.width = `${b}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 R() {
|
|
752
|
+
!m.value || !L.value || ae(() => {
|
|
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, b = 200, M = r.bottom + b + 4, U = r.top - b - 4, te = M <= f - 20, A = U >= 20;
|
|
756
|
+
x.value = !te && A;
|
|
757
757
|
});
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function j(a) {
|
|
760
760
|
return typeof a == "object" && a !== null ? a[t.valueKey] : a;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function Z(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 se(a, r) {
|
|
766
|
+
return typeof a == "object" && a !== null && a.id !== void 0 ? a.id : j(a) || r;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
return
|
|
768
|
+
function G(a) {
|
|
769
|
+
return j(a) === t.modelValue;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function H(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 B() {
|
|
775
|
+
t.disabled || (m.value ? Y() : W());
|
|
776
776
|
}
|
|
777
|
-
function
|
|
778
|
-
t.disabled || (m.value = !0,
|
|
779
|
-
|
|
777
|
+
function W() {
|
|
778
|
+
t.disabled || (m.value = !0, ae(() => {
|
|
779
|
+
R(), F(), 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, y.value = -1, x.value = !1, t.filterable && (g.value = "");
|
|
784
784
|
}
|
|
785
785
|
function ee(a, r) {
|
|
786
|
-
if (
|
|
787
|
-
const f =
|
|
786
|
+
if (H(a)) return;
|
|
787
|
+
const f = j(a);
|
|
788
788
|
n("update:modelValue", f), n("change", f, a), Y();
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function J() {
|
|
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 fe(a) {
|
|
796
|
+
if (!O.value || O.value.length === 0) {
|
|
797
|
+
y.value = -1;
|
|
798
798
|
return;
|
|
799
799
|
}
|
|
800
|
-
let r =
|
|
801
|
-
const f =
|
|
800
|
+
let r = y.value;
|
|
801
|
+
const f = O.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 b = 0;
|
|
804
|
+
for (; b < f && H(O.value[r]); )
|
|
805
|
+
r = (r + a + f) % f, b++;
|
|
806
|
+
y.value = b >= f ? -1 : r, Q();
|
|
807
|
+
}
|
|
808
|
+
function me() {
|
|
809
|
+
if (y.value < 0) return;
|
|
810
|
+
const a = O.value[y.value];
|
|
811
|
+
!a || H(a) || ee(a, y.value);
|
|
812
|
+
}
|
|
813
|
+
function F() {
|
|
814
|
+
if (!p.value) return;
|
|
815
|
+
const a = p.value.querySelector(".yselect__option--selected");
|
|
816
816
|
a && a.scrollIntoView({ block: "nearest" });
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
if (!
|
|
820
|
-
const r =
|
|
818
|
+
function Q() {
|
|
819
|
+
if (!p.value || y.value < 0) return;
|
|
820
|
+
const r = p.value.querySelectorAll(".yselect__option")[y.value];
|
|
821
821
|
r && r.scrollIntoView({ block: "nearest" });
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function d(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
|
+
y.value = -1;
|
|
829
829
|
});
|
|
830
830
|
function h() {
|
|
831
|
-
m.value &&
|
|
831
|
+
m.value && R();
|
|
832
832
|
}
|
|
833
|
-
return
|
|
834
|
-
document.addEventListener("click",
|
|
833
|
+
return De(() => {
|
|
834
|
+
document.addEventListener("click", d), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
835
835
|
}), Be(() => {
|
|
836
|
-
document.removeEventListener("click",
|
|
836
|
+
document.removeEventListener("click", d), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
837
837
|
}), (a, r) => (i(), u("div", {
|
|
838
|
-
class:
|
|
839
|
-
style:
|
|
838
|
+
class: z(["yselect", { "yselect--disabled": e.disabled, [`yselect--${e.size}`]: !0 }]),
|
|
839
|
+
style: ie({ 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: z(["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: X(B, ["prevent", "stop"]),
|
|
852
852
|
onKeydown: [
|
|
853
|
-
ke(
|
|
854
|
-
ke(
|
|
853
|
+
ke(X(B, ["prevent"]), ["enter"]),
|
|
854
|
+
ke(X(B, ["prevent"]), ["space"]),
|
|
855
855
|
ke(Y, ["escape"]),
|
|
856
|
-
ke(
|
|
857
|
-
ke(
|
|
856
|
+
ke(X(W, ["prevent"]), ["arrow-down"]),
|
|
857
|
+
ke(X(W, ["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: z(["yselect__value", { yselect__placeholder: !V.value }])
|
|
867
867
|
}, [
|
|
868
868
|
ce(a.$slots, "value", {
|
|
869
|
-
value:
|
|
869
|
+
value: k.value,
|
|
870
870
|
label: V.value
|
|
871
871
|
}, () => {
|
|
872
872
|
var f;
|
|
873
873
|
return [
|
|
874
|
-
|
|
875
|
-
(f =
|
|
874
|
+
k.value ? (i(), u(ue, { key: 0 }, [
|
|
875
|
+
(f = k.value) != null && f.flagImg ? (i(), u("img", {
|
|
876
876
|
key: 0,
|
|
877
877
|
class: "yselect__flag",
|
|
878
|
-
src:
|
|
878
|
+
src: k.value.flagImg,
|
|
879
879
|
alt: "flag"
|
|
880
|
-
}, null, 8, Nt)) :
|
|
881
|
-
|
|
882
|
-
], 64)) : (i(), u(
|
|
883
|
-
|
|
880
|
+
}, null, 8, Nt)) : K("", !0),
|
|
881
|
+
Ce(" " + le(V.value), 1)
|
|
882
|
+
], 64)) : (i(), u(ue, { key: 1 }, [
|
|
883
|
+
Ce(le(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] = X(() => {
|
|
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(
|
|
898
|
+
r[2] || (r[2] = ke(X((f) => fe(1), ["prevent"]), ["arrow-down"])),
|
|
899
|
+
r[3] || (r[3] = ke(X((f) => fe(-1), ["prevent"]), ["arrow-up"])),
|
|
900
|
+
r[4] || (r[4] = ke(X((f) => me(), ["prevent"]), ["enter"])),
|
|
901
|
+
ke(X(Y, ["prevent"]), ["esc"]),
|
|
902
|
+
ke(X(J, ["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 && k.value ? (i(), u("span", {
|
|
908
908
|
key: 2,
|
|
909
909
|
class: "yselect__clear",
|
|
910
910
|
title: "清空",
|
|
911
|
-
onClick:
|
|
911
|
+
onClick: X(J, ["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
|
+
])])) : K("", !0),
|
|
927
927
|
o("span", {
|
|
928
|
-
class:
|
|
928
|
+
class: z(["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($e, { name: "yselect-dropdown" }, {
|
|
947
|
+
default: ve(() => [
|
|
948
|
+
(i(), Me(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: z(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": x.value }]),
|
|
954
|
+
style: ie(P.value),
|
|
955
|
+
onMousedown: r[6] || (r[6] = X(() => {
|
|
956
956
|
}, ["stop"])),
|
|
957
|
-
onClick: r[7] || (r[7] =
|
|
957
|
+
onClick: r[7] || (r[7] = X(() => {
|
|
958
958
|
}, ["stop"]))
|
|
959
959
|
}, [
|
|
960
960
|
o("div", {
|
|
961
961
|
class: "yselect__options",
|
|
962
962
|
ref_key: "optionsContainer",
|
|
963
|
-
ref:
|
|
963
|
+
ref: p
|
|
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(ue, null, he(O.value, (f, b) => (i(), u("div", {
|
|
966
|
+
key: se(f, b),
|
|
967
|
+
class: z(["yselect__option", {
|
|
968
|
+
"yselect__option--selected": G(f),
|
|
969
|
+
"yselect__option--disabled": H(f),
|
|
970
|
+
"yselect__option--hover": y.value === b
|
|
971
971
|
}]),
|
|
972
972
|
onClick: (M) => ee(f),
|
|
973
|
-
onMouseenter: (M) =>
|
|
974
|
-
onMouseleave: r[5] || (r[5] = (M) =>
|
|
973
|
+
onMouseenter: (M) => y.value = b,
|
|
974
|
+
onMouseleave: r[5] || (r[5] = (M) => y.value = -1)
|
|
975
975
|
}, [
|
|
976
976
|
ce(a.$slots, "option", {
|
|
977
977
|
option: f,
|
|
978
|
-
index:
|
|
979
|
-
selected:
|
|
978
|
+
index: b,
|
|
979
|
+
selected: G(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)) : K("", !0),
|
|
987
|
+
Ce(" " + le(Z(f)), 1)
|
|
988
988
|
], !0)
|
|
989
989
|
], 42, jt))), 128))
|
|
990
990
|
], 512)
|
|
991
|
-
], 38)) :
|
|
991
|
+
], 38)) : K("", !0)
|
|
992
992
|
]))
|
|
993
993
|
]),
|
|
994
994
|
_: 3
|
|
995
995
|
})
|
|
996
996
|
], 6));
|
|
997
997
|
}
|
|
998
|
-
}), tt = /* @__PURE__ */
|
|
998
|
+
}), tt = /* @__PURE__ */ be(Ut, [["__scopeId", "data-v-6cd47cb7"]]), Zt = { class: "ypagination" }, Qt = { class: "page-actions" }, Jt = { class: "page-size-select" }, Xt = /* @__PURE__ */ we({
|
|
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), y = N(() => t.pageSizeOptions), p = N({
|
|
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 && (p.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), p.value = 1);
|
|
1024
1024
|
}
|
|
1025
1025
|
function I(x) {
|
|
1026
|
-
t.loading || (x === "prev" ? L(
|
|
1026
|
+
t.loading || (x === "prev" ? L(p.value - 1) : x === "next" && L(p.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 = Ve("YButton"), k = Ve("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: p.value === 1 || e.loading,
|
|
1041
1041
|
onClick: w[0] || (w[0] = (V) => L(1))
|
|
1042
1042
|
}, {
|
|
1043
|
-
default:
|
|
1044
|
-
|
|
1043
|
+
default: ve(() => [...w[2] || (w[2] = [
|
|
1044
|
+
Ce("首页", -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: p.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(k, {
|
|
1060
1060
|
modelValue: m.value,
|
|
1061
1061
|
"onUpdate:modelValue": w[1] || (w[1] = (V) => m.value = V),
|
|
1062
|
-
options:
|
|
1062
|
+
options: y.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__ */ be(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__ */ we({
|
|
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 = N(() => $.tone || "default"), n = N(() => {
|
|
1130
|
+
const m = ($.label || "").trim(), y = $.tone, p = $.progress;
|
|
1131
|
+
if (p) {
|
|
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[p] || p}` : `进度:${L[p] || p}`;
|
|
1138
1138
|
}
|
|
1139
|
-
if (
|
|
1139
|
+
if (y && y !== "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[y] || y}` : `语气:${L[y] || y}`;
|
|
1149
1149
|
}
|
|
1150
1150
|
return m || "标记";
|
|
1151
1151
|
});
|
|
1152
|
-
return (m,
|
|
1153
|
-
class:
|
|
1152
|
+
return (m, y) => (i(), u("span", {
|
|
1153
|
+
class: z(["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, [...y[0] || (y[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, [...y[1] || (y[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, [...y[2] || (y[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
|
+
])])) : K("", !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, [...y[3] || (y[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, [...y[4] || (y[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, [...y[5] || (y[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, [...y[6] || (y[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
|
+
])) : K("", !0),
|
|
1214
1214
|
o("span", fn, [
|
|
1215
1215
|
ce(m.$slots, "default", {}, () => [
|
|
1216
|
-
|
|
1216
|
+
Ce(le(e.label), 1)
|
|
1217
1217
|
], !0)
|
|
1218
1218
|
])
|
|
1219
1219
|
])
|
|
1220
1220
|
], 10, en));
|
|
1221
1221
|
}
|
|
1222
|
-
}), hn = /* @__PURE__ */
|
|
1222
|
+
}), hn = /* @__PURE__ */ be(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" }, bn = {
|
|
1226
1226
|
key: 1,
|
|
1227
1227
|
class: "y-dialog-footer"
|
|
1228
|
-
},
|
|
1228
|
+
}, kn = /* @__PURE__ */ we({
|
|
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 = N({
|
|
1244
1244
|
get: () => t.modelValue,
|
|
1245
1245
|
set: (w) => n("update:modelValue", w)
|
|
1246
|
-
}),
|
|
1246
|
+
}), y = E(null), p = N(() => {
|
|
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 = y.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
|
+
}), De(() => {
|
|
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(), Me(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: ie({ 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($e, { name: "dialog-zoom-fade" }, {
|
|
1284
|
+
default: ve(() => [
|
|
1285
1285
|
Ee(o("div", {
|
|
1286
1286
|
ref_key: "panelRef",
|
|
1287
|
-
ref:
|
|
1288
|
-
class:
|
|
1289
|
-
style:
|
|
1290
|
-
onKeydown: ke(
|
|
1287
|
+
ref: y,
|
|
1288
|
+
class: z(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1289
|
+
style: ie(p.value),
|
|
1290
|
+
onKeydown: ke(X(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, le(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
|
+
}, " ✕ ")) : K("", !0)
|
|
1304
|
+
])) : K("", !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", bn, [
|
|
1309
1309
|
ce(w.$slots, "footer", {}, void 0, !0)
|
|
1310
|
-
])) :
|
|
1310
|
+
])) : K("", !0)
|
|
1311
1311
|
], 46, yn), [
|
|
1312
|
-
[
|
|
1312
|
+
[Ke, m.value]
|
|
1313
1313
|
])
|
|
1314
1314
|
]),
|
|
1315
1315
|
_: 3
|
|
1316
1316
|
})
|
|
1317
1317
|
], 12, pn), [
|
|
1318
|
-
[
|
|
1318
|
+
[Ke, m.value]
|
|
1319
1319
|
])
|
|
1320
1320
|
]));
|
|
1321
1321
|
}
|
|
1322
|
-
}), xn = /* @__PURE__ */
|
|
1322
|
+
}), xn = /* @__PURE__ */ be(kn, [["__scopeId", "data-v-a7acc6dc"]]), $n = { class: "ypopover__inner" }, Cn = /* @__PURE__ */ we({
|
|
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, y = E(), p = E(), L = E(), C = E(!1), I = E(), x = E(), w = E({});
|
|
1343
|
+
let g = null, k = null;
|
|
1344
|
+
const V = N(() => {
|
|
1345
1345
|
if (!C.value || !I.value) return {};
|
|
1346
|
-
const
|
|
1347
|
-
n.width !== "auto" && (
|
|
1348
|
-
const { top:
|
|
1349
|
-
return
|
|
1350
|
-
}),
|
|
1346
|
+
const F = {};
|
|
1347
|
+
n.width !== "auto" && (F.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (F.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1348
|
+
const { top: Q, left: d } = P();
|
|
1349
|
+
return F.top = `${Q}px`, F.left = `${d}px`, F;
|
|
1350
|
+
}), O = N(() => {
|
|
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 F = {};
|
|
1355
|
+
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? F.left = "50%" : F.top = "50%", F;
|
|
1356
1356
|
});
|
|
1357
|
-
function
|
|
1358
|
-
var
|
|
1357
|
+
function P() {
|
|
1358
|
+
var te, A;
|
|
1359
1359
|
if (!I.value) return { top: 0, left: 0 };
|
|
1360
|
-
const { width:
|
|
1361
|
-
let f = 0,
|
|
1360
|
+
const { width: F, height: Q, top: d, left: h } = I.value, a = ((te = L.value) == null ? void 0 : te.offsetWidth) || 200, r = ((A = L.value) == null ? void 0 : A.offsetHeight) || 100;
|
|
1361
|
+
let f = 0, b = 0;
|
|
1362
1362
|
switch (n.placement) {
|
|
1363
1363
|
case "top":
|
|
1364
|
-
f =
|
|
1364
|
+
f = d - r - n.offset, b = h + (F - a) / 2;
|
|
1365
1365
|
break;
|
|
1366
1366
|
case "top-start":
|
|
1367
|
-
f =
|
|
1367
|
+
f = d - r - n.offset, b = h;
|
|
1368
1368
|
break;
|
|
1369
1369
|
case "top-end":
|
|
1370
|
-
f =
|
|
1370
|
+
f = d - r - n.offset, b = h + F - a;
|
|
1371
1371
|
break;
|
|
1372
1372
|
case "bottom":
|
|
1373
|
-
f =
|
|
1373
|
+
f = d + Q + n.offset, b = h + (F - a) / 2;
|
|
1374
1374
|
break;
|
|
1375
1375
|
case "bottom-start":
|
|
1376
|
-
f =
|
|
1376
|
+
f = d + Q + n.offset, b = h;
|
|
1377
1377
|
break;
|
|
1378
1378
|
case "bottom-end":
|
|
1379
|
-
f =
|
|
1379
|
+
f = d + Q + n.offset, b = h + F - a;
|
|
1380
1380
|
break;
|
|
1381
1381
|
case "left":
|
|
1382
|
-
f =
|
|
1382
|
+
f = d + (Q - r) / 2, b = h - a - n.offset;
|
|
1383
1383
|
break;
|
|
1384
1384
|
case "left-start":
|
|
1385
|
-
f =
|
|
1385
|
+
f = d, b = h - a - n.offset;
|
|
1386
1386
|
break;
|
|
1387
1387
|
case "left-end":
|
|
1388
|
-
f =
|
|
1388
|
+
f = d + Q - r, b = h - a - n.offset;
|
|
1389
1389
|
break;
|
|
1390
1390
|
case "right":
|
|
1391
|
-
f =
|
|
1391
|
+
f = d + (Q - r) / 2, b = h + F + n.offset;
|
|
1392
1392
|
break;
|
|
1393
1393
|
case "right-start":
|
|
1394
|
-
f =
|
|
1394
|
+
f = d, b = h + F + n.offset;
|
|
1395
1395
|
break;
|
|
1396
1396
|
case "right-end":
|
|
1397
|
-
f =
|
|
1397
|
+
f = d + Q - r, b = h + F + n.offset;
|
|
1398
1398
|
break;
|
|
1399
1399
|
}
|
|
1400
|
-
const M = window.innerWidth,
|
|
1401
|
-
return
|
|
1400
|
+
const M = window.innerWidth, U = window.innerHeight;
|
|
1401
|
+
return b < 8 && (b = 8), b + a > M - 8 && (b = M - a - 8), f < 8 && (f = 8), f + r > U - 8 && (f = U - r - 8), { top: f, left: b };
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1404
|
-
n.disabled || C.value || (
|
|
1405
|
-
|
|
1406
|
-
}, n.openDelay) :
|
|
1407
|
-
}
|
|
1408
|
-
function
|
|
1409
|
-
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"),
|
|
1410
|
-
|
|
1411
|
-
|
|
1403
|
+
function R() {
|
|
1404
|
+
n.disabled || C.value || (G(), n.openDelay > 0 ? g = setTimeout(() => {
|
|
1405
|
+
j();
|
|
1406
|
+
}, n.openDelay) : j());
|
|
1407
|
+
}
|
|
1408
|
+
function j() {
|
|
1409
|
+
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"), ae(() => {
|
|
1410
|
+
ae(() => {
|
|
1411
|
+
B();
|
|
1412
1412
|
});
|
|
1413
1413
|
});
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1416
|
-
C.value && (
|
|
1417
|
-
|
|
1418
|
-
}, n.closeDelay) :
|
|
1415
|
+
function Z() {
|
|
1416
|
+
C.value && (G(), n.closeDelay > 0 ? k = setTimeout(() => {
|
|
1417
|
+
se();
|
|
1418
|
+
}, n.closeDelay) : se());
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function se() {
|
|
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 G() {
|
|
1424
|
+
g && (clearTimeout(g), g = null), k && (clearTimeout(k), k = null);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function H() {
|
|
1427
1427
|
if (!n.showArrow || !I.value || !L.value) {
|
|
1428
1428
|
w.value = {};
|
|
1429
1429
|
return;
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1432
|
-
if (
|
|
1431
|
+
const F = I.value, Q = L.value.getBoundingClientRect();
|
|
1432
|
+
if (Q.width === 0 || Q.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 d = {};
|
|
1438
1438
|
if (n.placement.startsWith("top")) {
|
|
1439
|
-
|
|
1440
|
-
const h =
|
|
1441
|
-
|
|
1439
|
+
d.bottom = "-6px";
|
|
1440
|
+
const h = F.left + F.width / 2, a = Q.left, r = h - a;
|
|
1441
|
+
d.left = `${Math.max(12, Math.min(r, Q.width - 12))}px`;
|
|
1442
1442
|
} else if (n.placement.startsWith("bottom")) {
|
|
1443
|
-
|
|
1444
|
-
const h =
|
|
1445
|
-
|
|
1443
|
+
d.top = "-6px";
|
|
1444
|
+
const h = F.left + F.width / 2, a = Q.left, r = h - a;
|
|
1445
|
+
d.left = `${Math.max(12, Math.min(r, Q.width - 12))}px`;
|
|
1446
1446
|
} else if (n.placement.startsWith("left")) {
|
|
1447
|
-
|
|
1448
|
-
const h =
|
|
1449
|
-
|
|
1447
|
+
d.right = "-6px";
|
|
1448
|
+
const h = F.top + F.height / 2, a = Q.top, r = h - a;
|
|
1449
|
+
d.top = `${Math.max(12, Math.min(r, Q.height - 12))}px`;
|
|
1450
1450
|
} else if (n.placement.startsWith("right")) {
|
|
1451
|
-
|
|
1452
|
-
const h =
|
|
1453
|
-
|
|
1451
|
+
d.left = "-6px";
|
|
1452
|
+
const h = F.top + F.height / 2, a = Q.top, r = h - a;
|
|
1453
|
+
d.top = `${Math.max(12, Math.min(r, Q.height - 12))}px`;
|
|
1454
1454
|
}
|
|
1455
|
-
w.value =
|
|
1455
|
+
w.value = d;
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1458
|
-
|
|
1459
|
-
L.value && (x.value = L.value.getBoundingClientRect(),
|
|
1457
|
+
function B() {
|
|
1458
|
+
p.value && (I.value = p.value.getBoundingClientRect(), L.value && (x.value = L.value.getBoundingClientRect(), H(), C.value && requestAnimationFrame(() => {
|
|
1459
|
+
L.value && (x.value = L.value.getBoundingClientRect(), H());
|
|
1460
1460
|
})));
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1463
|
-
n.disabled || n.trigger === "click" && (C.value ?
|
|
1462
|
+
function W() {
|
|
1463
|
+
n.disabled || n.trigger === "click" && (C.value ? Z() : R());
|
|
1464
1464
|
}
|
|
1465
1465
|
function Y() {
|
|
1466
|
-
n.disabled || n.trigger !== "hover" || (
|
|
1466
|
+
n.disabled || n.trigger !== "hover" || (G(), R());
|
|
1467
1467
|
}
|
|
1468
1468
|
function ee() {
|
|
1469
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1469
|
+
n.disabled || n.trigger !== "hover" || Z();
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1472
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1471
|
+
function J() {
|
|
1472
|
+
n.disabled || n.trigger !== "hover" || G();
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1475
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1474
|
+
function fe() {
|
|
1475
|
+
n.disabled || n.trigger !== "hover" || Z();
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function me(F) {
|
|
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 Q = F.target;
|
|
1480
|
+
y.value && !y.value.contains(Q) && L.value && !L.value.contains(Q) && Z();
|
|
1481
|
+
}
|
|
1482
|
+
return oe(() => n.modelValue, (F) => {
|
|
1483
|
+
F !== C.value && (F ? R() : Z());
|
|
1484
|
+
}), oe(C, (F) => {
|
|
1485
|
+
F ? (document.addEventListener("click", me), window.addEventListener("resize", B), window.addEventListener("scroll", B, !0), ae(() => {
|
|
1486
|
+
B(), requestAnimationFrame(() => {
|
|
1487
|
+
B();
|
|
1488
1488
|
}), setTimeout(() => {
|
|
1489
|
-
|
|
1489
|
+
B();
|
|
1490
1490
|
}, 0);
|
|
1491
|
-
})) : (document.removeEventListener("click",
|
|
1492
|
-
}),
|
|
1493
|
-
n.modelValue &&
|
|
1491
|
+
})) : (document.removeEventListener("click", me), window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0));
|
|
1492
|
+
}), De(() => {
|
|
1493
|
+
n.modelValue && R();
|
|
1494
1494
|
}), Be(() => {
|
|
1495
|
-
|
|
1495
|
+
G(), document.removeEventListener("click", me), window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0);
|
|
1496
1496
|
}), $({
|
|
1497
|
-
show:
|
|
1498
|
-
hide:
|
|
1499
|
-
updatePosition:
|
|
1500
|
-
}), (
|
|
1497
|
+
show: R,
|
|
1498
|
+
hide: Z,
|
|
1499
|
+
updatePosition: B
|
|
1500
|
+
}), (F, Q) => (i(), u("div", {
|
|
1501
1501
|
class: "ypopover",
|
|
1502
1502
|
ref_key: "popoverRef",
|
|
1503
|
-
ref:
|
|
1503
|
+
ref: y
|
|
1504
1504
|
}, [
|
|
1505
1505
|
o("div", {
|
|
1506
1506
|
ref_key: "triggerRef",
|
|
1507
|
-
ref:
|
|
1508
|
-
onClick:
|
|
1507
|
+
ref: p,
|
|
1508
|
+
onClick: W,
|
|
1509
1509
|
onMouseenter: Y,
|
|
1510
1510
|
onMouseleave: ee
|
|
1511
1511
|
}, [
|
|
1512
|
-
ce(
|
|
1512
|
+
ce(F.$slots, "reference", {}, void 0, !0)
|
|
1513
1513
|
], 544),
|
|
1514
|
-
(i(),
|
|
1515
|
-
de(
|
|
1516
|
-
default:
|
|
1514
|
+
(i(), Me(Fe, { to: "body" }, [
|
|
1515
|
+
de($e, { name: "ypopover-fade" }, {
|
|
1516
|
+
default: ve(() => [
|
|
1517
1517
|
C.value ? (i(), u("div", {
|
|
1518
1518
|
key: 0,
|
|
1519
1519
|
ref_key: "contentRef",
|
|
1520
1520
|
ref: L,
|
|
1521
|
-
class:
|
|
1521
|
+
class: z(["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: ie(V.value),
|
|
1529
|
+
onClick: Q[0] || (Q[0] = X(() => {
|
|
1530
1530
|
}, ["stop"])),
|
|
1531
|
-
onMouseenter:
|
|
1532
|
-
onMouseleave:
|
|
1531
|
+
onMouseenter: J,
|
|
1532
|
+
onMouseleave: fe
|
|
1533
1533
|
}, [
|
|
1534
1534
|
e.showArrow ? (i(), u("div", {
|
|
1535
1535
|
key: 0,
|
|
1536
|
-
class:
|
|
1537
|
-
style:
|
|
1538
|
-
}, null, 6)) :
|
|
1536
|
+
class: z(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1537
|
+
style: ie(O.value)
|
|
1538
|
+
}, null, 6)) : K("", !0),
|
|
1539
1539
|
o("div", $n, [
|
|
1540
|
-
ce(
|
|
1540
|
+
ce(F.$slots, "default", {}, void 0, !0)
|
|
1541
1541
|
])
|
|
1542
|
-
], 38)) :
|
|
1542
|
+
], 38)) : K("", !0)
|
|
1543
1543
|
]),
|
|
1544
1544
|
_: 3
|
|
1545
1545
|
})
|
|
1546
1546
|
]))
|
|
1547
1547
|
], 512));
|
|
1548
1548
|
}
|
|
1549
|
-
}), Dn = /* @__PURE__ */
|
|
1549
|
+
}), Dn = /* @__PURE__ */ be(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" }, zn = { class: "nh-time-selection-status" }, Kn = {
|
|
1550
1550
|
key: 0,
|
|
1551
1551
|
class: "status-text"
|
|
1552
1552
|
}, Hn = {
|
|
1553
1553
|
key: 1,
|
|
1554
1554
|
class: "status-text"
|
|
1555
|
-
},
|
|
1555
|
+
}, An = {
|
|
1556
1556
|
key: 2,
|
|
1557
1557
|
class: "status-text status-complete"
|
|
1558
|
-
},
|
|
1558
|
+
}, Rn = { class: "nh-time-pickers" }, Wn = { class: "nh-time-picker" }, Vn = { 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__ */ we({
|
|
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), y = E(-1), p = 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
|
+
}), k = () => {
|
|
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
|
+
}, O = ["一", "二", "三", "四", "五", "六", "日"], P = E(null), R = E(null), j = (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
|
+
}, Z = (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"), c = 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}-${c} ${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}-${c}`;
|
|
1648
|
+
}, se = (s) => s ? s.getTime() : null, G = (s) => s ? {
|
|
1649
|
+
startDate: j(s.startDate),
|
|
1650
|
+
endDate: j(s.endDate)
|
|
1651
|
+
} : { startDate: null, endDate: null }, H = (s) => t.format === "string" ? {
|
|
1652
|
+
startDate: Z(s.startDate),
|
|
1653
|
+
endDate: Z(s.endDate)
|
|
1654
1654
|
} : t.format === "timestamp" ? {
|
|
1655
|
-
startDate:
|
|
1656
|
-
endDate:
|
|
1657
|
-
} : s,
|
|
1658
|
-
const v =
|
|
1655
|
+
startDate: se(s.startDate),
|
|
1656
|
+
endDate: se(s.endDate)
|
|
1657
|
+
} : s, B = (s, v) => `${String(v + 1).padStart(2, "0")}/${s}`, W = (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 = G(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 c = t.shortcuts[l].getValue();
|
|
1663
|
+
if (c.startDate && c.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
|
+
c.startDate.getFullYear(),
|
|
1674
|
+
c.startDate.getMonth(),
|
|
1675
|
+
c.startDate.getDate()
|
|
1676
1676
|
), T = new Date(
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1677
|
+
c.endDate.getFullYear(),
|
|
1678
|
+
c.endDate.getMonth(),
|
|
1679
|
+
c.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
|
+
}, J = (s, v) => {
|
|
1687
|
+
const l = new Date(s, v, 1), c = new Date(s, v + 1, 0), D = l.getDay(), S = c.getDate(), _ = [], T = /* @__PURE__ */ new Date(), q = D === 0 ? 6 : D - 1, pe = new Date(s, v, 0);
|
|
1688
|
+
for (let re = q - 1; re >= 0; re--) {
|
|
1689
|
+
const _e = new Date(s, v - 1, pe.getDate() - re);
|
|
1690
1690
|
_.push({
|
|
1691
|
-
date:
|
|
1692
|
-
day:
|
|
1691
|
+
date: _e,
|
|
1692
|
+
day: _e.getDate(),
|
|
1693
1693
|
isCurrentMonth: !1,
|
|
1694
|
-
isToday:
|
|
1694
|
+
isToday: W(_e, 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 re = 1; re <= S; re++) {
|
|
1702
|
+
const _e = new Date(s, v, re);
|
|
1703
1703
|
_.push({
|
|
1704
|
-
date:
|
|
1705
|
-
day:
|
|
1704
|
+
date: _e,
|
|
1705
|
+
day: re,
|
|
1706
1706
|
isCurrentMonth: !0,
|
|
1707
|
-
isToday:
|
|
1707
|
+
isToday: W(_e, 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 ge = 42 - _.length;
|
|
1714
|
+
for (let re = 1; re <= ge; re++) {
|
|
1715
|
+
const _e = new Date(s, v + 1, re);
|
|
1716
1716
|
_.push({
|
|
1717
|
-
date:
|
|
1718
|
-
day:
|
|
1717
|
+
date: _e,
|
|
1718
|
+
day: re,
|
|
1719
1719
|
isCurrentMonth: !1,
|
|
1720
|
-
isToday:
|
|
1720
|
+
isToday: W(_e, 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 ze = [];
|
|
1728
|
+
for (let re = 0; re < _.length; re += 7)
|
|
1729
|
+
ze.push(_.slice(re, re + 7));
|
|
1730
|
+
return ze;
|
|
1731
|
+
}, fe = (s) => {
|
|
1732
|
+
const v = H(s);
|
|
1733
1733
|
n("update:modelValue", v), n("change", v);
|
|
1734
|
-
},
|
|
1734
|
+
}, me = () => {
|
|
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, q = v.width || 640;
|
|
1739
|
+
T < q ? x.value.left = !1 : x.value.left = !0;
|
|
1740
|
+
}, F = () => {
|
|
1741
1741
|
if (m.value = !m.value, m.value) {
|
|
1742
|
-
const s =
|
|
1743
|
-
if (
|
|
1742
|
+
const s = G(t.modelValue);
|
|
1743
|
+
if (P.value = (s == null ? void 0 : s.startDate) || null, R.value = (s == null ? void 0 : s.endDate) || null, p.value = ee(t.modelValue), y.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
|
+
k(), ae(() => {
|
|
1750
|
+
me();
|
|
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
|
+
}, Q = (s) => {
|
|
1754
|
+
const v = s.target, l = C.value, c = I.value;
|
|
1755
|
+
l && c && !l.contains(v) && !c.contains(v) && (m.value = !1, y.value = -1);
|
|
1756
|
+
}, d = (s) => {
|
|
1757
|
+
s.key === "Enter" || s.key === " " ? (s.preventDefault(), F()) : s.key === "ArrowDown" && (s.preventDefault(), m.value = !0, ae(() => {
|
|
1758
|
+
me(), b();
|
|
1759
1759
|
}));
|
|
1760
1760
|
}, h = (s) => {
|
|
1761
1761
|
var v;
|
|
1762
|
-
s.key === "Escape" && (m.value = !1,
|
|
1762
|
+
s.key === "Escape" && (m.value = !1, y.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(), y.value = Math.min(v + 1, t.shortcuts.length - 1), M(y.value)) : s.key === "ArrowUp" ? (s.preventDefault(), y.value = Math.max(v - 1, 0), M(y.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), U(t.shortcuts[v]));
|
|
1765
1765
|
}, r = (s) => {
|
|
1766
|
-
|
|
1766
|
+
y.value = s;
|
|
1767
1767
|
}, f = () => {
|
|
1768
|
-
|
|
1769
|
-
},
|
|
1770
|
-
|
|
1768
|
+
y.value = -1;
|
|
1769
|
+
}, b = () => {
|
|
1770
|
+
y.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
|
+
}, U = (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)), fe(v), p.value = t.shortcuts.findIndex((l) => l.label === s.label), y.value = -1, m.value = !1;
|
|
1779
|
+
}, te = (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" || !P.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()), !P.value && !R.value)
|
|
1783
|
+
P.value = l, R.value = null;
|
|
1784
|
+
else if (P.value && !R.value)
|
|
1785
|
+
if (l >= P.value)
|
|
1786
|
+
t.includeTime && l.setHours(23, 59, 59, 999), R.value = l;
|
|
1787
1787
|
else {
|
|
1788
|
-
const
|
|
1789
|
-
t.includeTime &&
|
|
1788
|
+
const c = P.value;
|
|
1789
|
+
t.includeTime && c.setHours(23, 59, 59, 999), R.value = c, P.value = l;
|
|
1790
1790
|
}
|
|
1791
1791
|
else
|
|
1792
|
-
|
|
1793
|
-
if (
|
|
1794
|
-
const
|
|
1795
|
-
t.includeTime &&
|
|
1796
|
-
startDate:
|
|
1797
|
-
endDate:
|
|
1792
|
+
P.value = l, R.value = null;
|
|
1793
|
+
if (p.value = -1, P.value && R.value) {
|
|
1794
|
+
const c = new Date(R.value);
|
|
1795
|
+
t.includeTime && c.setHours(23, 59, 59, 999), L.value = {
|
|
1796
|
+
startDate: P.value,
|
|
1797
|
+
endDate: c
|
|
1798
1798
|
};
|
|
1799
1799
|
} else
|
|
1800
1800
|
L.value = null;
|
|
1801
|
-
},
|
|
1801
|
+
}, A = (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"),
|
|
1804
|
+
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"), P.value && W(s.date, P.value) && l.push("is-selected", "is-start"), R.value && W(s.date, R.value) && l.push("is-selected", "is-end"), P.value && R.value && Y(s.date, P.value, R.value) && l.push("is-in-range"), l;
|
|
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;
|
|
1805
1809
|
}, ye = () => {
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
ae({ startDate: null, endDate: null }), We(), p.value = -1, m.value = !1;
|
|
1809
|
-
}, Ce = () => {
|
|
1810
|
-
m.value && se(() => {
|
|
1811
|
-
we();
|
|
1810
|
+
m.value && ae(() => {
|
|
1811
|
+
me();
|
|
1812
1812
|
});
|
|
1813
|
-
},
|
|
1814
|
-
const s =
|
|
1813
|
+
}, xe = N(() => J(w.value.year, w.value.month)), Ie = N(() => J(g.value.year, g.value.month)), Pe = N(() => {
|
|
1814
|
+
const s = G(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), c = v(s.endDate);
|
|
1821
|
+
return !t.includeTime && l === c ? l : `${l} - ${c}`;
|
|
1822
|
+
}), Ae = N(() => [
|
|
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
|
+
]), Re = N(() => {
|
|
1829
|
+
const s = G(t.modelValue);
|
|
1830
1830
|
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1831
|
-
}), Ye =
|
|
1832
|
-
|
|
1831
|
+
}), Ye = N(() => !!(P.value && R.value)), We = () => {
|
|
1832
|
+
P.value = null, R.value = null, L.value = null, p.value = -1;
|
|
1833
1833
|
};
|
|
1834
1834
|
oe(() => t.modelValue, (s) => {
|
|
1835
|
-
const v =
|
|
1835
|
+
const v = G(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) && k(), m.value || (p.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 }), De(() => {
|
|
1855
|
+
document.addEventListener("click", Q), window.addEventListener("resize", ye), window.addEventListener("scroll", ye), p.value = ee(t.modelValue);
|
|
1856
|
+
const s = G(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
|
+
k();
|
|
1864
1864
|
}), Be(() => {
|
|
1865
|
-
document.removeEventListener("click",
|
|
1865
|
+
document.removeEventListener("click", Q), window.removeEventListener("resize", ye), window.removeEventListener("scroll", ye);
|
|
1866
1866
|
});
|
|
1867
1867
|
const He = () => {
|
|
1868
|
-
t.clearable && (
|
|
1868
|
+
t.clearable && (fe({ startDate: null, endDate: null }), We(), y.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(), k();
|
|
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 = Ve("YButton");
|
|
1880
1880
|
return i(), u("div", {
|
|
1881
|
-
class:
|
|
1881
|
+
class: z(["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: F,
|
|
1888
|
+
onKeydown: d,
|
|
1889
|
+
class: z(["nh-time-trigger", { "is-focus": m.value, "has-value": Re.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 && Re.value ? (i(), u("i", {
|
|
1900
1900
|
key: 0,
|
|
1901
|
-
onClick:
|
|
1901
|
+
onClick: X(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
|
+
])])) : K("", !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: z(["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($e, { name: "el-zoom-in-top" }, {
|
|
1944
|
+
default: ve(() => [
|
|
1945
1945
|
m.value ? (i(), u("div", {
|
|
1946
1946
|
key: 0,
|
|
1947
1947
|
ref_key: "dropdown",
|
|
1948
1948
|
ref: I,
|
|
1949
|
-
class:
|
|
1949
|
+
class: z(Ae.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(ue, null, he(e.shortcuts, (c, D) => (i(), u("li", {
|
|
1956
|
+
key: c.label,
|
|
1957
|
+
onClick: (S) => U(c),
|
|
1958
1958
|
onKeydown: (S) => a(S, D),
|
|
1959
1959
|
onMouseenter: (S) => r(D),
|
|
1960
1960
|
onMouseleave: f,
|
|
1961
|
-
class:
|
|
1961
|
+
class: z([
|
|
1962
1962
|
"nh-time-shortcut",
|
|
1963
1963
|
{
|
|
1964
|
-
"is-active":
|
|
1965
|
-
"is-selected":
|
|
1964
|
+
"is-active": y.value === D,
|
|
1965
|
+
"is-selected": p.value === D
|
|
1966
1966
|
}
|
|
1967
1967
|
]),
|
|
1968
1968
|
tabindex: "0"
|
|
1969
|
-
},
|
|
1969
|
+
}, le(c.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", zn, [
|
|
1976
|
+
!P.value && !R.value ? (i(), u("span", Kn, " 请选择开始日期 ")) : P.value && !R.value ? (i(), u("span", Hn, " 请选择结束日期 ")) : P.value && R.value ? (i(), u("span", An, " 已选择完整范围 ")) : K("", !0)
|
|
1977
1977
|
])
|
|
1978
1978
|
]),
|
|
1979
|
-
o("div",
|
|
1979
|
+
o("div", Rn, [
|
|
1980
1980
|
o("div", Wn, [
|
|
1981
|
-
o("div",
|
|
1981
|
+
o("div", Vn, [
|
|
1982
1982
|
o("div", Fn, [
|
|
1983
1983
|
o("button", {
|
|
1984
|
-
onClick: v[0] || (v[0] = (
|
|
1984
|
+
onClick: v[0] || (v[0] = (c) => 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, le(B(w.value.year, w.value.month)), 1),
|
|
2000
2000
|
o("button", {
|
|
2001
|
-
onClick: v[1] || (v[1] = (
|
|
2001
|
+
onClick: v[1] || (v[1] = (c) => 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(ue, null, he(O, (c) => o("th", {
|
|
2022
|
+
key: c,
|
|
2023
2023
|
class: "nh-date-table-th"
|
|
2024
|
-
},
|
|
2024
|
+
}, le(c), 1)), 64))
|
|
2025
2025
|
])
|
|
2026
2026
|
]),
|
|
2027
2027
|
o("tbody", null, [
|
|
2028
|
-
(i(!0), u(
|
|
2028
|
+
(i(!0), u(ue, null, he(xe.value, (c, D) => (i(), u("tr", {
|
|
2029
2029
|
key: `start-week-${D}`
|
|
2030
2030
|
}, [
|
|
2031
|
-
(i(!0), u(
|
|
2031
|
+
(i(!0), u(ue, null, he(c, (S, _) => (i(), u("td", {
|
|
2032
2032
|
key: `start-day-${D}-${_}`,
|
|
2033
|
-
class:
|
|
2034
|
-
onClick: (T) =>
|
|
2033
|
+
class: z(A(S)),
|
|
2034
|
+
onClick: (T) => te(S, "start")
|
|
2035
2035
|
}, [
|
|
2036
2036
|
o("div", jn, [
|
|
2037
|
-
S ? (i(), u("span", qn,
|
|
2037
|
+
S ? (i(), u("span", qn, le(S.day), 1)) : K("", !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] = (c) => 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, le(B(g.value.year, g.value.month)), 1),
|
|
2066
2066
|
o("button", {
|
|
2067
|
-
onClick: v[3] || (v[3] = (
|
|
2067
|
+
onClick: v[3] || (v[3] = (c) => 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(ue, null, he(O, (c) => o("th", {
|
|
2088
|
+
key: c,
|
|
2089
2089
|
class: "nh-date-table-th"
|
|
2090
|
-
},
|
|
2090
|
+
}, le(c), 1)), 64))
|
|
2091
2091
|
])
|
|
2092
2092
|
]),
|
|
2093
2093
|
o("tbody", null, [
|
|
2094
|
-
(i(!0), u(
|
|
2094
|
+
(i(!0), u(ue, null, he(Ie.value, (c, D) => (i(), u("tr", {
|
|
2095
2095
|
key: `end-week-${D}`
|
|
2096
2096
|
}, [
|
|
2097
|
-
(i(!0), u(
|
|
2097
|
+
(i(!0), u(ue, null, he(c, (S, _) => (i(), u("td", {
|
|
2098
2098
|
key: `end-day-${D}-${_}`,
|
|
2099
|
-
class:
|
|
2100
|
-
onClick: (T) =>
|
|
2099
|
+
class: z(A(S)),
|
|
2100
|
+
onClick: (T) => te(S, "end")
|
|
2101
2101
|
}, [
|
|
2102
2102
|
o("div", tl, [
|
|
2103
|
-
S ? (i(), u("span", nl,
|
|
2103
|
+
S ? (i(), u("span", nl, le(S.day), 1)) : K("", !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(), Me(l, {
|
|
2115
2115
|
key: 0,
|
|
2116
|
-
onClick:
|
|
2116
|
+
onClick: Se,
|
|
2117
2117
|
variant: "secondary",
|
|
2118
2118
|
size: e.size
|
|
2119
2119
|
}, {
|
|
2120
|
-
default:
|
|
2121
|
-
|
|
2120
|
+
default: ve(() => [...v[13] || (v[13] = [
|
|
2121
|
+
Ce(" 清空 ", -1)
|
|
2122
2122
|
])]),
|
|
2123
2123
|
_: 1
|
|
2124
|
-
}, 8, ["size"])) :
|
|
2124
|
+
}, 8, ["size"])) : K("", !0),
|
|
2125
2125
|
de(l, {
|
|
2126
|
-
onClick:
|
|
2126
|
+
onClick: ne,
|
|
2127
2127
|
disabled: !Ye.value,
|
|
2128
2128
|
variant: "primary",
|
|
2129
2129
|
size: e.size
|
|
2130
2130
|
}, {
|
|
2131
|
-
default:
|
|
2132
|
-
|
|
2131
|
+
default: ve(() => [
|
|
2132
|
+
Ce(le(P.value && !R.value ? "继续选择结束日期" : "确认"), 1)
|
|
2133
2133
|
]),
|
|
2134
2134
|
_: 1
|
|
2135
2135
|
}, 8, ["disabled", "size"])
|
|
2136
2136
|
])
|
|
2137
2137
|
])
|
|
2138
|
-
], 34)) :
|
|
2138
|
+
], 34)) : K("", !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__ */ be(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__ */ we({
|
|
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(), y = N(() => t.modelValue === t.trueValue), p = N(() => {
|
|
2168
2168
|
const C = {};
|
|
2169
|
-
return C.background =
|
|
2169
|
+
return C.background = y.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 = y.value ? t.falseValue : t.trueValue;
|
|
2174
2174
|
n("update:modelValue", C), n("change", C);
|
|
2175
2175
|
}
|
|
2176
|
-
return
|
|
2176
|
+
return De(() => {
|
|
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: z(["yswitch", [
|
|
2183
2183
|
`yswitch--${e.size}`,
|
|
2184
|
-
{ "yswitch--checked":
|
|
2184
|
+
{ "yswitch--checked": y.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2185
2185
|
]]),
|
|
2186
|
-
style:
|
|
2186
|
+
style: ie(p.value),
|
|
2187
2187
|
role: "switch",
|
|
2188
|
-
"aria-checked":
|
|
2188
|
+
"aria-checked": y.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(X(L, ["prevent"]), ["enter"]),
|
|
2194
|
+
ke(X(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)) : K("", !0)
|
|
2200
2200
|
]),
|
|
2201
2201
|
e.showText ? (i(), u("span", {
|
|
2202
2202
|
key: 0,
|
|
2203
|
-
class:
|
|
2204
|
-
},
|
|
2203
|
+
class: z(["yswitch__label", { "yswitch__label--left": !y.value, "yswitch__label--right": y.value }])
|
|
2204
|
+
}, le(y.value ? e.activeText : e.inactiveText), 3)) : K("", !0)
|
|
2205
2205
|
], 46, al));
|
|
2206
2206
|
}
|
|
2207
|
-
}), ul = /* @__PURE__ */
|
|
2207
|
+
}), ul = /* @__PURE__ */ be(rl, [["__scopeId", "data-v-0b157fc4"]]), cl = ["src", "alt"], dl = ["src", "alt"], fl = /* @__PURE__ */ we({
|
|
2208
2208
|
__name: "yimage",
|
|
2209
2209
|
props: {
|
|
2210
2210
|
src: {},
|
|
@@ -2216,14 +2216,15 @@ 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: {}
|
|
2219
|
+
previewSrcList: {},
|
|
2220
|
+
autoAspect: { type: Boolean, default: !1 }
|
|
2220
2221
|
},
|
|
2221
2222
|
emits: ["load", "error", "preview"],
|
|
2222
2223
|
setup(e, { expose: $, emit: t }) {
|
|
2223
|
-
const n = e, m = t,
|
|
2224
|
+
const n = e, m = t, y = E(), p = E(), L = E(), C = E(!1), I = E(!1), x = E(!1), w = E(!1), g = E(!1), k = E("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), V = E(""), O = E(1), P = E(!1), R = E(null), j = E({
|
|
2224
2225
|
overflow: "",
|
|
2225
2226
|
paddingRight: ""
|
|
2226
|
-
}),
|
|
2227
|
+
}), Z = {
|
|
2227
2228
|
none: "0px",
|
|
2228
2229
|
sm: "0.125rem",
|
|
2229
2230
|
md: "0.375rem",
|
|
@@ -2231,120 +2232,129 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2231
2232
|
xl: "0.75rem",
|
|
2232
2233
|
"2xl": "1rem",
|
|
2233
2234
|
full: "9999px"
|
|
2234
|
-
},
|
|
2235
|
+
}, se = N(() => n.className || ""), G = N(() => {
|
|
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(() => {
|
|
2235
2239
|
if (typeof n.radius == "number")
|
|
2236
2240
|
return `${n.radius}px`;
|
|
2237
2241
|
if (typeof n.radius == "string") {
|
|
2238
2242
|
if (/(px|%|rem|em)$/.test(n.radius))
|
|
2239
2243
|
return n.radius;
|
|
2240
|
-
if (
|
|
2241
|
-
return
|
|
2244
|
+
if (Z[n.radius])
|
|
2245
|
+
return Z[n.radius];
|
|
2242
2246
|
}
|
|
2243
2247
|
return "";
|
|
2244
|
-
}),
|
|
2245
|
-
borderRadius:
|
|
2246
|
-
} : {}), W =
|
|
2248
|
+
}), B = N(() => H.value ? {
|
|
2249
|
+
borderRadius: H.value
|
|
2250
|
+
} : {}), W = N(() => [
|
|
2247
2251
|
"yimage-image",
|
|
2248
2252
|
n.preview ? "is-previewable" : ""
|
|
2249
|
-
].filter(Boolean).join(" ")),
|
|
2250
|
-
const
|
|
2251
|
-
objectFit: n.fit || "cover",
|
|
2252
|
-
backgroundColor: "#fff"
|
|
2253
|
+
].filter(Boolean).join(" ")), Y = N(() => {
|
|
2254
|
+
const A = {
|
|
2255
|
+
objectFit: n.autoAspect ? "contain" : n.fit || "cover",
|
|
2256
|
+
backgroundColor: "#fff",
|
|
2257
|
+
width: "100%",
|
|
2258
|
+
height: "100%"
|
|
2253
2259
|
};
|
|
2254
|
-
return
|
|
2255
|
-
}),
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2258
|
-
const
|
|
2259
|
-
return document.body.removeChild(
|
|
2260
|
-
},
|
|
2261
|
-
if (
|
|
2260
|
+
return H.value && (A.borderRadius = H.value), A;
|
|
2261
|
+
}), ee = N(() => V.value ? V.value : Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src), J = () => {
|
|
2262
|
+
const A = document.createElement("div");
|
|
2263
|
+
A.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(A);
|
|
2264
|
+
const ne = A.offsetWidth - A.clientWidth;
|
|
2265
|
+
return document.body.removeChild(A), ne;
|
|
2266
|
+
}, fe = () => {
|
|
2267
|
+
if (j.value = {
|
|
2262
2268
|
overflow: document.body.style.overflow || "",
|
|
2263
2269
|
paddingRight: document.body.style.paddingRight || ""
|
|
2264
2270
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2265
|
-
const
|
|
2266
|
-
document.body.style.paddingRight = `${
|
|
2271
|
+
const ne = J();
|
|
2272
|
+
document.body.style.paddingRight = `${ne}px`;
|
|
2267
2273
|
}
|
|
2268
2274
|
document.body.style.overflow = "hidden";
|
|
2269
|
-
},
|
|
2270
|
-
document.body.style.overflow =
|
|
2275
|
+
}, me = () => {
|
|
2276
|
+
document.body.style.overflow = j.value.overflow, document.body.style.paddingRight = j.value.paddingRight;
|
|
2271
2277
|
};
|
|
2272
|
-
let
|
|
2273
|
-
const
|
|
2274
|
-
!n.lazy || !
|
|
2275
|
-
(
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
+
let F = null;
|
|
2279
|
+
const Q = () => {
|
|
2280
|
+
!n.lazy || !y.value || (F = new IntersectionObserver(
|
|
2281
|
+
(A) => {
|
|
2282
|
+
A.forEach((ne) => {
|
|
2283
|
+
ne.isIntersecting && (w.value = !0, k.value = n.src, F == null || F.unobserve(ne.target));
|
|
2278
2284
|
});
|
|
2279
2285
|
},
|
|
2280
2286
|
{
|
|
2281
2287
|
rootMargin: "50px"
|
|
2282
2288
|
}
|
|
2283
|
-
),
|
|
2284
|
-
},
|
|
2285
|
-
C.value = !0, I.value = !1, x.value = !1,
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2289
|
+
), F.observe(y.value));
|
|
2290
|
+
}, d = (A) => {
|
|
2291
|
+
C.value = !0, I.value = !1, x.value = !1, n.autoAspect && p.value && (R.value = {
|
|
2292
|
+
width: p.value.naturalWidth || 1,
|
|
2293
|
+
height: p.value.naturalHeight || 1
|
|
2294
|
+
}), m("load", A);
|
|
2295
|
+
}, h = (A) => {
|
|
2296
|
+
x.value = !0, I.value = !1, C.value = !1, m("error", A);
|
|
2297
|
+
}, a = () => {
|
|
2298
|
+
x.value = !1, I.value = !0, C.value = !1, ae(() => {
|
|
2299
|
+
p.value && (p.value.src = n.src);
|
|
2291
2300
|
});
|
|
2292
|
-
},
|
|
2293
|
-
n.preview && (n.previewSrcList || n.src) ?
|
|
2294
|
-
},
|
|
2301
|
+
}, r = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, f = () => {
|
|
2302
|
+
n.preview && (n.previewSrcList || n.src) ? b() : a();
|
|
2303
|
+
}, b = () => {
|
|
2295
2304
|
if (!n.preview) return;
|
|
2296
|
-
|
|
2297
|
-
const
|
|
2298
|
-
if (
|
|
2299
|
-
V.value =
|
|
2300
|
-
g.value = !0,
|
|
2305
|
+
O.value = 1;
|
|
2306
|
+
const A = r();
|
|
2307
|
+
if (p.value && p.value.complete && p.value.naturalWidth > 0) {
|
|
2308
|
+
V.value = A, ae(() => {
|
|
2309
|
+
g.value = !0, fe(), m("preview", A);
|
|
2301
2310
|
});
|
|
2302
2311
|
return;
|
|
2303
2312
|
}
|
|
2304
|
-
const
|
|
2305
|
-
let
|
|
2306
|
-
const
|
|
2307
|
-
ye || (ye = !0,
|
|
2308
|
-
g.value = !0,
|
|
2313
|
+
const ne = new Image();
|
|
2314
|
+
let Se = null, ye = !1;
|
|
2315
|
+
const xe = () => {
|
|
2316
|
+
ye || (ye = !0, Se && (clearTimeout(Se), Se = null), V.value = A, ae(() => {
|
|
2317
|
+
g.value = !0, fe(), m("preview", A);
|
|
2309
2318
|
}));
|
|
2310
2319
|
};
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
}, 500),
|
|
2314
|
-
|
|
2315
|
-
},
|
|
2316
|
-
|
|
2317
|
-
},
|
|
2318
|
-
},
|
|
2320
|
+
Se = setTimeout(() => {
|
|
2321
|
+
xe();
|
|
2322
|
+
}, 500), ne.onload = () => {
|
|
2323
|
+
xe();
|
|
2324
|
+
}, ne.onerror = () => {
|
|
2325
|
+
xe();
|
|
2326
|
+
}, ne.src = A, ne.complete && xe();
|
|
2327
|
+
}, M = () => {
|
|
2319
2328
|
g.value = !1, setTimeout(() => {
|
|
2320
|
-
|
|
2329
|
+
me();
|
|
2321
2330
|
}, 300);
|
|
2322
|
-
},
|
|
2323
|
-
const
|
|
2324
|
-
let ye =
|
|
2325
|
-
ye = Math.max(0.5, Math.min(2, ye)),
|
|
2331
|
+
}, U = (A) => {
|
|
2332
|
+
const ne = A.deltaY < 0 ? 1 : -1;
|
|
2333
|
+
let ye = O.value + ne * 0.1;
|
|
2334
|
+
ye = Math.max(0.5, Math.min(2, ye)), O.value = ye;
|
|
2326
2335
|
};
|
|
2327
|
-
return
|
|
2328
|
-
n.lazy ?
|
|
2336
|
+
return De(() => {
|
|
2337
|
+
n.lazy ? Q() : w.value = !0, w.value && (I.value = !0), P.value = !0;
|
|
2329
2338
|
}), Be(() => {
|
|
2330
|
-
|
|
2331
|
-
}), oe(() =>
|
|
2332
|
-
n.src && w.value && (I.value = !0, x.value = !1, C.value = !1);
|
|
2333
|
-
}), oe(() => n.src, (
|
|
2334
|
-
|
|
2339
|
+
F && F.disconnect(), g.value && me();
|
|
2340
|
+
}), oe(() => k.value, () => {
|
|
2341
|
+
n.src && w.value && (I.value = !0, x.value = !1, C.value = !1), n.autoAspect && (R.value = null);
|
|
2342
|
+
}), oe(() => n.src, (A) => {
|
|
2343
|
+
k.value = A || "";
|
|
2335
2344
|
}), $({
|
|
2336
|
-
retryLoad:
|
|
2337
|
-
closePreview:
|
|
2338
|
-
}), (
|
|
2345
|
+
retryLoad: a,
|
|
2346
|
+
closePreview: M
|
|
2347
|
+
}), (A, ne) => (i(), u("div", {
|
|
2339
2348
|
ref_key: "containerRef",
|
|
2340
|
-
ref:
|
|
2341
|
-
class:
|
|
2349
|
+
ref: y,
|
|
2350
|
+
class: z(["yimage-container", se.value]),
|
|
2351
|
+
style: ie(G.value)
|
|
2342
2352
|
}, [
|
|
2343
2353
|
!C.value && !x.value && !w.value ? (i(), u("div", {
|
|
2344
2354
|
key: 0,
|
|
2345
2355
|
class: "yimage-placeholder",
|
|
2346
|
-
style:
|
|
2347
|
-
}, [...
|
|
2356
|
+
style: ie(B.value)
|
|
2357
|
+
}, [...ne[1] || (ne[1] = [
|
|
2348
2358
|
o("div", { class: "yimage-placeholder-content" }, [
|
|
2349
2359
|
o("svg", {
|
|
2350
2360
|
class: "yimage-placeholder-icon",
|
|
@@ -2360,81 +2370,81 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2360
2370
|
})
|
|
2361
2371
|
])
|
|
2362
2372
|
], -1)
|
|
2363
|
-
])], 4)) :
|
|
2373
|
+
])], 4)) : K("", !0),
|
|
2364
2374
|
I.value && !x.value ? (i(), u("div", {
|
|
2365
2375
|
key: 1,
|
|
2366
2376
|
class: "yimage-loading",
|
|
2367
|
-
style:
|
|
2368
|
-
}, [...
|
|
2377
|
+
style: ie(B.value)
|
|
2378
|
+
}, [...ne[2] || (ne[2] = [
|
|
2369
2379
|
o("div", { class: "yimage-loading-content" }, [
|
|
2370
2380
|
o("div", { class: "yimage-spinner" })
|
|
2371
2381
|
], -1)
|
|
2372
|
-
])], 4)) :
|
|
2382
|
+
])], 4)) : K("", !0),
|
|
2373
2383
|
x.value ? (i(), u("div", {
|
|
2374
2384
|
key: 2,
|
|
2375
2385
|
class: "yimage-error",
|
|
2376
|
-
style:
|
|
2377
|
-
onClick:
|
|
2386
|
+
style: ie(B.value),
|
|
2387
|
+
onClick: f
|
|
2378
2388
|
}, [
|
|
2379
2389
|
o("img", {
|
|
2380
2390
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2381
2391
|
alt: "Error Image",
|
|
2382
2392
|
class: "yimage-error-image",
|
|
2383
|
-
style:
|
|
2393
|
+
style: ie(B.value)
|
|
2384
2394
|
}, null, 4)
|
|
2385
|
-
], 4)) :
|
|
2395
|
+
], 4)) : K("", !0),
|
|
2386
2396
|
Ee(o("img", {
|
|
2387
2397
|
ref_key: "imageRef",
|
|
2388
|
-
ref:
|
|
2389
|
-
src:
|
|
2398
|
+
ref: p,
|
|
2399
|
+
src: k.value,
|
|
2390
2400
|
alt: e.alt,
|
|
2391
|
-
class:
|
|
2392
|
-
onLoad:
|
|
2393
|
-
onError:
|
|
2394
|
-
onClick:
|
|
2395
|
-
style:
|
|
2401
|
+
class: z(W.value),
|
|
2402
|
+
onLoad: d,
|
|
2403
|
+
onError: h,
|
|
2404
|
+
onClick: X(b, ["stop"]),
|
|
2405
|
+
style: ie(Y.value)
|
|
2396
2406
|
}, null, 46, cl), [
|
|
2397
|
-
[
|
|
2407
|
+
[Ke, C.value && !x.value]
|
|
2398
2408
|
]),
|
|
2399
2409
|
n.preview && (!C.value || I.value || x.value || !w.value) ? (i(), u("div", {
|
|
2400
2410
|
key: 3,
|
|
2401
2411
|
class: "yimage-preview-trigger",
|
|
2402
|
-
onClick:
|
|
2403
|
-
})) :
|
|
2404
|
-
|
|
2412
|
+
onClick: X(b, ["stop"])
|
|
2413
|
+
})) : K("", !0),
|
|
2414
|
+
P.value ? (i(), Me(Fe, {
|
|
2405
2415
|
key: 4,
|
|
2406
2416
|
to: "body"
|
|
2407
2417
|
}, [
|
|
2408
|
-
de(
|
|
2409
|
-
default:
|
|
2418
|
+
de($e, { name: "fade" }, {
|
|
2419
|
+
default: ve(() => [
|
|
2410
2420
|
g.value ? (i(), u("div", {
|
|
2411
2421
|
key: 0,
|
|
2412
2422
|
class: "yimage-preview-mask",
|
|
2413
|
-
onClick:
|
|
2414
|
-
onWheel:
|
|
2423
|
+
onClick: X(M, ["self"]),
|
|
2424
|
+
onWheel: X(U, ["prevent"])
|
|
2415
2425
|
}, [
|
|
2416
2426
|
o("div", {
|
|
2417
|
-
class:
|
|
2427
|
+
class: z(["yimage-preview-content", { "is-active": g.value }])
|
|
2418
2428
|
}, [
|
|
2419
2429
|
o("img", {
|
|
2420
2430
|
ref_key: "previewImageRef",
|
|
2421
2431
|
ref: L,
|
|
2422
|
-
src:
|
|
2432
|
+
src: ee.value,
|
|
2423
2433
|
alt: e.alt,
|
|
2424
2434
|
class: "yimage-preview-image",
|
|
2425
|
-
style:
|
|
2426
|
-
onClick:
|
|
2435
|
+
style: ie({ transform: `scale(${O.value})` }),
|
|
2436
|
+
onClick: ne[0] || (ne[0] = X(() => {
|
|
2427
2437
|
}, ["stop"]))
|
|
2428
2438
|
}, null, 12, dl)
|
|
2429
2439
|
], 2)
|
|
2430
|
-
], 32)) :
|
|
2440
|
+
], 32)) : K("", !0)
|
|
2431
2441
|
]),
|
|
2432
2442
|
_: 1
|
|
2433
2443
|
})
|
|
2434
|
-
])) :
|
|
2435
|
-
],
|
|
2444
|
+
])) : K("", !0)
|
|
2445
|
+
], 6));
|
|
2436
2446
|
}
|
|
2437
|
-
}), vl = /* @__PURE__ */
|
|
2447
|
+
}), vl = /* @__PURE__ */ be(fl, [["__scopeId", "data-v-f84bad81"]]), hl = /* @__PURE__ */ we({
|
|
2438
2448
|
__name: "ydropdown",
|
|
2439
2449
|
props: {
|
|
2440
2450
|
trigger: { default: "hover" },
|
|
@@ -2445,7 +2455,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2445
2455
|
setup(e) {
|
|
2446
2456
|
const $ = e, t = E(!1), n = E();
|
|
2447
2457
|
let m = null;
|
|
2448
|
-
const
|
|
2458
|
+
const y = N(() => `y-dropdown__menu--${$.placement}`), p = N(() => {
|
|
2449
2459
|
if (!$.menuWidth) return {};
|
|
2450
2460
|
const g = typeof $.menuWidth == "number" ? `${$.menuWidth}px` : $.menuWidth;
|
|
2451
2461
|
return {
|
|
@@ -2454,7 +2464,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2454
2464
|
maxWidth: g
|
|
2455
2465
|
};
|
|
2456
2466
|
}), L = () => {
|
|
2457
|
-
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value),
|
|
2467
|
+
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value), ae(() => {
|
|
2458
2468
|
I();
|
|
2459
2469
|
}));
|
|
2460
2470
|
}, C = () => {
|
|
@@ -2463,52 +2473,52 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2463
2473
|
}, 150);
|
|
2464
2474
|
}, I = () => {
|
|
2465
2475
|
if (!n.value) return;
|
|
2466
|
-
const g = n.value.querySelector(".y-dropdown__trigger"),
|
|
2467
|
-
if (!g || !
|
|
2468
|
-
const V = g.getBoundingClientRect(),
|
|
2469
|
-
|
|
2470
|
-
let
|
|
2476
|
+
const g = n.value.querySelector(".y-dropdown__trigger"), k = n.value.querySelector(".y-dropdown__menu");
|
|
2477
|
+
if (!g || !k) return;
|
|
2478
|
+
const V = g.getBoundingClientRect(), O = k.getBoundingClientRect(), P = window.innerWidth, R = window.innerHeight;
|
|
2479
|
+
k.style.top = "", k.style.left = "", k.style.right = "", k.style.bottom = "", k.style.transform = "";
|
|
2480
|
+
let j = 0, Z = 0;
|
|
2471
2481
|
switch ($.placement) {
|
|
2472
2482
|
case "bottom":
|
|
2473
|
-
|
|
2483
|
+
j = V.height + 4, Z = 0;
|
|
2474
2484
|
break;
|
|
2475
2485
|
case "top":
|
|
2476
|
-
|
|
2486
|
+
j = -(O.height + 4), Z = 0;
|
|
2477
2487
|
break;
|
|
2478
2488
|
case "right":
|
|
2479
|
-
|
|
2489
|
+
j = 0, Z = V.width + 4;
|
|
2480
2490
|
break;
|
|
2481
2491
|
case "left":
|
|
2482
|
-
|
|
2492
|
+
j = 0, Z = -(O.width + 4);
|
|
2483
2493
|
break;
|
|
2484
2494
|
}
|
|
2485
|
-
let
|
|
2495
|
+
let se = V.top + j, G = V.left + Z;
|
|
2486
2496
|
if ($.placement === "bottom" || $.placement === "top") {
|
|
2487
|
-
const
|
|
2488
|
-
|
|
2497
|
+
const H = O.width || 260;
|
|
2498
|
+
G + H > P - 10 && (G = P - H - 10), G < 10 && (G = 10);
|
|
2489
2499
|
}
|
|
2490
2500
|
if ($.placement === "left" || $.placement === "right") {
|
|
2491
|
-
const
|
|
2492
|
-
|
|
2501
|
+
const H = O.height || 200;
|
|
2502
|
+
se + H > R - 10 && (se = R - H - 10), se < 10 && (se = 10);
|
|
2493
2503
|
}
|
|
2494
|
-
|
|
2504
|
+
k.style.top = `${se}px`, k.style.left = `${G}px`;
|
|
2495
2505
|
}, x = (g) => {
|
|
2496
2506
|
$.trigger === "click" && n.value && !n.value.contains(g.target) && (t.value = !1);
|
|
2497
2507
|
}, w = () => {
|
|
2498
2508
|
t.value && I();
|
|
2499
2509
|
};
|
|
2500
|
-
return
|
|
2510
|
+
return De(() => {
|
|
2501
2511
|
$.trigger === "click" && document.addEventListener("click", x), window.addEventListener("resize", w), window.addEventListener("scroll", w);
|
|
2502
2512
|
}), Be(() => {
|
|
2503
2513
|
$.trigger === "click" && document.removeEventListener("click", x), m && clearTimeout(m), window.removeEventListener("resize", w), window.removeEventListener("scroll", w);
|
|
2504
2514
|
}), oe(
|
|
2505
2515
|
() => $.menuWidth,
|
|
2506
2516
|
() => {
|
|
2507
|
-
t.value &&
|
|
2517
|
+
t.value && ae(() => {
|
|
2508
2518
|
I();
|
|
2509
2519
|
});
|
|
2510
2520
|
}
|
|
2511
|
-
), (g,
|
|
2521
|
+
), (g, k) => (i(), u("div", {
|
|
2512
2522
|
class: "y-dropdown",
|
|
2513
2523
|
ref_key: "dropdownRef",
|
|
2514
2524
|
ref: n
|
|
@@ -2519,40 +2529,40 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2519
2529
|
onMouseleave: C
|
|
2520
2530
|
}, [
|
|
2521
2531
|
ce(g.$slots, "trigger", {}, () => [
|
|
2522
|
-
|
|
2532
|
+
k[0] || (k[0] = o("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2523
2533
|
], !0)
|
|
2524
2534
|
], 32),
|
|
2525
|
-
de(
|
|
2535
|
+
de($e, {
|
|
2526
2536
|
name: "dropdown-fade",
|
|
2527
2537
|
appear: ""
|
|
2528
2538
|
}, {
|
|
2529
|
-
default:
|
|
2539
|
+
default: ve(() => [
|
|
2530
2540
|
Ee(o("div", {
|
|
2531
|
-
class:
|
|
2532
|
-
style:
|
|
2541
|
+
class: z(["y-dropdown__menu", y.value]),
|
|
2542
|
+
style: ie(p.value),
|
|
2533
2543
|
onMouseenter: L,
|
|
2534
2544
|
onMouseleave: C
|
|
2535
2545
|
}, [
|
|
2536
2546
|
ce(g.$slots, "default", {}, () => [
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2547
|
+
k[1] || (k[1] = o("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2548
|
+
k[2] || (k[2] = o("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2549
|
+
k[3] || (k[3] = o("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2540
2550
|
], !0)
|
|
2541
2551
|
], 38), [
|
|
2542
|
-
[
|
|
2552
|
+
[Ke, t.value]
|
|
2543
2553
|
])
|
|
2544
2554
|
]),
|
|
2545
2555
|
_: 3
|
|
2546
2556
|
})
|
|
2547
2557
|
], 512));
|
|
2548
2558
|
}
|
|
2549
|
-
}), pl = /* @__PURE__ */
|
|
2559
|
+
}), pl = /* @__PURE__ */ be(hl, [["__scopeId", "data-v-ada3172a"]]), yl = ["aria-hidden"], gl = ["onKeydown"], ml = {
|
|
2550
2560
|
key: 0,
|
|
2551
2561
|
class: "y-drawer-header"
|
|
2552
|
-
}, wl = { class: "y-drawer-title" },
|
|
2562
|
+
}, wl = { class: "y-drawer-title" }, bl = { class: "y-drawer-body" }, kl = {
|
|
2553
2563
|
key: 1,
|
|
2554
2564
|
class: "y-drawer-footer"
|
|
2555
|
-
}, xl = /* @__PURE__ */
|
|
2565
|
+
}, xl = /* @__PURE__ */ we({
|
|
2556
2566
|
__name: "ydrawer",
|
|
2557
2567
|
props: {
|
|
2558
2568
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2567,12 +2577,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2567
2577
|
},
|
|
2568
2578
|
emits: ["update:modelValue", "open", "close"],
|
|
2569
2579
|
setup(e, { emit: $ }) {
|
|
2570
|
-
const t = e, n = $, m =
|
|
2580
|
+
const t = e, n = $, m = N({
|
|
2571
2581
|
get: () => t.modelValue,
|
|
2572
|
-
set: (
|
|
2573
|
-
}),
|
|
2574
|
-
const
|
|
2575
|
-
return t.placement === "right" ? (
|
|
2582
|
+
set: (k) => n("update:modelValue", k)
|
|
2583
|
+
}), y = E(null), p = N(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), L = N(() => t.placement === "right" ? "rounded-left" : "rounded-top"), C = N(() => {
|
|
2584
|
+
const k = {};
|
|
2585
|
+
return t.placement === "right" ? (k.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), k.height = "100%", k.right = "0", k.top = "0") : (k.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), k.width = "100%", k.bottom = "0", k.left = "0"), k;
|
|
2576
2586
|
});
|
|
2577
2587
|
function I() {
|
|
2578
2588
|
t.maskClosable && x();
|
|
@@ -2583,71 +2593,71 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2583
2593
|
function w() {
|
|
2584
2594
|
t.closable && x();
|
|
2585
2595
|
}
|
|
2586
|
-
function g(
|
|
2587
|
-
|
|
2596
|
+
function g(k) {
|
|
2597
|
+
k.key === "Escape" && w();
|
|
2588
2598
|
}
|
|
2589
|
-
return oe(() => t.modelValue, (
|
|
2590
|
-
|
|
2599
|
+
return oe(() => t.modelValue, (k) => {
|
|
2600
|
+
k ? (n("open"), requestAnimationFrame(() => {
|
|
2591
2601
|
var V;
|
|
2592
|
-
return (V =
|
|
2602
|
+
return (V = y.value) == null ? void 0 : V.focus();
|
|
2593
2603
|
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2594
|
-
}),
|
|
2604
|
+
}), De(() => {
|
|
2595
2605
|
t.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2596
2606
|
}), Be(() => {
|
|
2597
2607
|
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2598
|
-
}), (
|
|
2608
|
+
}), (k, V) => (i(), Me(Fe, { to: "body" }, [
|
|
2599
2609
|
Ee(o("div", {
|
|
2600
2610
|
class: "y-drawer-root",
|
|
2601
2611
|
role: "dialog",
|
|
2602
2612
|
"aria-modal": !0,
|
|
2603
2613
|
"aria-hidden": !m.value,
|
|
2604
|
-
style:
|
|
2614
|
+
style: ie({ zIndex: String(e.zIndex) })
|
|
2605
2615
|
}, [
|
|
2606
2616
|
o("div", {
|
|
2607
2617
|
class: "y-drawer-mask",
|
|
2608
2618
|
onClick: I
|
|
2609
2619
|
}),
|
|
2610
|
-
de(
|
|
2611
|
-
default:
|
|
2620
|
+
de($e, { name: p.value }, {
|
|
2621
|
+
default: ve(() => [
|
|
2612
2622
|
Ee(o("div", {
|
|
2613
2623
|
ref_key: "panelRef",
|
|
2614
|
-
ref:
|
|
2615
|
-
class:
|
|
2624
|
+
ref: y,
|
|
2625
|
+
class: z(["y-drawer-panel", [
|
|
2616
2626
|
`is-${e.placement}`,
|
|
2617
2627
|
L.value
|
|
2618
2628
|
]]),
|
|
2619
|
-
style:
|
|
2620
|
-
onKeydown: ke(
|
|
2629
|
+
style: ie(C.value),
|
|
2630
|
+
onKeydown: ke(X(w, ["prevent", "stop"]), ["esc"]),
|
|
2621
2631
|
tabindex: "-1"
|
|
2622
2632
|
}, [
|
|
2623
2633
|
e.showHeader ? (i(), u("div", ml, [
|
|
2624
|
-
o("div", wl,
|
|
2634
|
+
o("div", wl, le(e.title), 1),
|
|
2625
2635
|
e.closable ? (i(), u("button", {
|
|
2626
2636
|
key: 0,
|
|
2627
2637
|
type: "button",
|
|
2628
2638
|
class: "y-drawer-close",
|
|
2629
2639
|
"aria-label": "Close",
|
|
2630
2640
|
onClick: x
|
|
2631
|
-
}, " ✕ ")) :
|
|
2632
|
-
])) :
|
|
2633
|
-
o("div",
|
|
2634
|
-
ce(
|
|
2641
|
+
}, " ✕ ")) : K("", !0)
|
|
2642
|
+
])) : K("", !0),
|
|
2643
|
+
o("div", bl, [
|
|
2644
|
+
ce(k.$slots, "default", {}, void 0, !0)
|
|
2635
2645
|
]),
|
|
2636
|
-
|
|
2637
|
-
ce(
|
|
2638
|
-
])) :
|
|
2646
|
+
k.$slots.footer ? (i(), u("div", kl, [
|
|
2647
|
+
ce(k.$slots, "footer", {}, void 0, !0)
|
|
2648
|
+
])) : K("", !0)
|
|
2639
2649
|
], 46, gl), [
|
|
2640
|
-
[
|
|
2650
|
+
[Ke, m.value]
|
|
2641
2651
|
])
|
|
2642
2652
|
]),
|
|
2643
2653
|
_: 3
|
|
2644
2654
|
}, 8, ["name"])
|
|
2645
2655
|
], 12, yl), [
|
|
2646
|
-
[
|
|
2656
|
+
[Ke, m.value]
|
|
2647
2657
|
])
|
|
2648
2658
|
]));
|
|
2649
2659
|
}
|
|
2650
|
-
}), $l = /* @__PURE__ */
|
|
2660
|
+
}), $l = /* @__PURE__ */ be(xl, [["__scopeId", "data-v-b2797950"]]), Cl = { class: "ytree__container" }, Dl = ["data-level", "onClick", "onContextmenu"], _l = ["onClick"], Sl = {
|
|
2651
2661
|
key: 1,
|
|
2652
2662
|
class: "w-[16px]"
|
|
2653
2663
|
}, Ll = ["onClick"], Ml = {
|
|
@@ -2665,10 +2675,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2665
2675
|
}, El = ["src", "alt"], Bl = { class: "ytree-node__custom-content" }, Tl = {
|
|
2666
2676
|
key: 0,
|
|
2667
2677
|
class: "ytree-node__children"
|
|
2668
|
-
},
|
|
2678
|
+
}, zl = ["data-level", "onClick", "onContextmenu"], Kl = ["onClick"], Hl = {
|
|
2669
2679
|
key: 1,
|
|
2670
2680
|
class: "w-[16px]"
|
|
2671
|
-
},
|
|
2681
|
+
}, Al = ["onClick"], Rl = {
|
|
2672
2682
|
key: 0,
|
|
2673
2683
|
width: "12",
|
|
2674
2684
|
height: "12",
|
|
@@ -2680,7 +2690,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2680
2690
|
height: "12",
|
|
2681
2691
|
viewBox: "0 0 12 12",
|
|
2682
2692
|
fill: "none"
|
|
2683
|
-
},
|
|
2693
|
+
}, Vl = ["src", "alt"], Fl = { class: "ytree-node__custom-content" }, Pl = {
|
|
2684
2694
|
key: 0,
|
|
2685
2695
|
class: "ytree-node__children"
|
|
2686
2696
|
}, Yl = ["data-level", "onClick", "onContextmenu"], Nl = ["onClick"], Ol = {
|
|
@@ -2734,7 +2744,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2734
2744
|
height: "12",
|
|
2735
2745
|
viewBox: "0 0 12 12",
|
|
2736
2746
|
fill: "none"
|
|
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__ */
|
|
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__ */ we({
|
|
2738
2748
|
__name: "ytree",
|
|
2739
2749
|
props: {
|
|
2740
2750
|
data: { default: () => [] },
|
|
@@ -2783,7 +2793,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2783
2793
|
},
|
|
2784
2794
|
emits: ["node-click", "node-contextmenu", "check-change", "check", "current-change", "node-expand", "node-collapse", "node-drag-start", "node-drag-enter", "node-drag-leave", "node-drag-over", "node-drag-end", "node-drop", "checked-keys-change", "child-node-click"],
|
|
2785
2795
|
setup(e, { expose: $, emit: t }) {
|
|
2786
|
-
const n = e, m = t,
|
|
2796
|
+
const n = e, m = t, y = N(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), p = E({
|
|
2787
2797
|
currentNode: null,
|
|
2788
2798
|
currentKey: null,
|
|
2789
2799
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2791,201 +2801,201 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2791
2801
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2792
2802
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2793
2803
|
});
|
|
2794
|
-
at("treeStore",
|
|
2795
|
-
const L =
|
|
2796
|
-
function C(
|
|
2797
|
-
return
|
|
2804
|
+
at("treeStore", p);
|
|
2805
|
+
const L = N(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2806
|
+
function C(d) {
|
|
2807
|
+
return d[n.nodeKey] || d.id || Math.random();
|
|
2798
2808
|
}
|
|
2799
|
-
function I(
|
|
2809
|
+
function I(d) {
|
|
2800
2810
|
var h;
|
|
2801
|
-
return ((h = n.props) != null && h.label ?
|
|
2811
|
+
return ((h = n.props) != null && h.label ? d[n.props.label] : void 0) || d.label || "";
|
|
2802
2812
|
}
|
|
2803
|
-
function x(
|
|
2813
|
+
function x(d) {
|
|
2804
2814
|
var h;
|
|
2805
|
-
return !!((h =
|
|
2815
|
+
return !!((h = d == null ? void 0 : d.data) != null && h.isEmployee);
|
|
2806
2816
|
}
|
|
2807
|
-
function w(
|
|
2817
|
+
function w(d, h) {
|
|
2808
2818
|
var M;
|
|
2809
|
-
const a = n.deptIconUrl || yo, r = n.personIconUrl || go, f = n.buttonIconUrl || "",
|
|
2810
|
-
return h &&
|
|
2819
|
+
const a = n.deptIconUrl || yo, r = n.personIconUrl || go, f = n.buttonIconUrl || "", b = n.childStyleIconUrl || "";
|
|
2820
|
+
return h && b && O(d, h) ? b : (M = d == null ? void 0 : d.data) != null && M.isButton && f ? f : x(d) ? r : a;
|
|
2811
2821
|
}
|
|
2812
|
-
function g(
|
|
2822
|
+
function g(d) {
|
|
2813
2823
|
var a;
|
|
2814
|
-
const h = ((a = n.props) != null && a.children ?
|
|
2824
|
+
const h = ((a = n.props) != null && a.children ? d[n.props.children] : void 0) || d.children;
|
|
2815
2825
|
return h && h.length > 0;
|
|
2816
2826
|
}
|
|
2817
|
-
function
|
|
2827
|
+
function k(d) {
|
|
2818
2828
|
var h;
|
|
2819
|
-
return ((h = n.props) != null && h.children ?
|
|
2829
|
+
return ((h = n.props) != null && h.children ? d[n.props.children] : void 0) || d.children || [];
|
|
2820
2830
|
}
|
|
2821
|
-
function V(
|
|
2822
|
-
if (
|
|
2831
|
+
function V(d, h, a = 1) {
|
|
2832
|
+
if (d === h)
|
|
2823
2833
|
return a;
|
|
2824
|
-
const r =
|
|
2834
|
+
const r = k(d);
|
|
2825
2835
|
for (const f of r) {
|
|
2826
|
-
const
|
|
2827
|
-
if (
|
|
2828
|
-
return
|
|
2836
|
+
const b = V(f, h, a + 1);
|
|
2837
|
+
if (b > 0)
|
|
2838
|
+
return b;
|
|
2829
2839
|
}
|
|
2830
2840
|
return 0;
|
|
2831
2841
|
}
|
|
2832
|
-
function
|
|
2833
|
-
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : V(h,
|
|
2842
|
+
function O(d, h) {
|
|
2843
|
+
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : V(h, d) === n.childStyleLevel;
|
|
2834
2844
|
}
|
|
2835
|
-
function
|
|
2836
|
-
const h = C(
|
|
2837
|
-
return
|
|
2845
|
+
function P(d) {
|
|
2846
|
+
const h = C(d);
|
|
2847
|
+
return p.value.expandedKeys.has(h);
|
|
2838
2848
|
}
|
|
2839
|
-
function
|
|
2840
|
-
const h = C(
|
|
2841
|
-
if (
|
|
2842
|
-
if (g(
|
|
2843
|
-
const r =
|
|
2844
|
-
(M) =>
|
|
2849
|
+
function R(d) {
|
|
2850
|
+
const h = C(d);
|
|
2851
|
+
if (p.value.checkedKeys.has(h)) {
|
|
2852
|
+
if (g(d)) {
|
|
2853
|
+
const r = k(d), f = r.filter((M) => R(M)), b = r.filter(
|
|
2854
|
+
(M) => j(M)
|
|
2845
2855
|
);
|
|
2846
|
-
return f.length === r.length &&
|
|
2856
|
+
return f.length === r.length && b.length === 0;
|
|
2847
2857
|
}
|
|
2848
2858
|
return !0;
|
|
2849
2859
|
}
|
|
2850
|
-
if (g(
|
|
2851
|
-
const r =
|
|
2860
|
+
if (g(d)) {
|
|
2861
|
+
const r = k(d);
|
|
2852
2862
|
return r.some(
|
|
2853
|
-
(
|
|
2854
|
-
) ? !1 : r.length > 0 && r.every((
|
|
2863
|
+
(b) => j(b)
|
|
2864
|
+
) ? !1 : r.length > 0 && r.every((b) => R(b));
|
|
2855
2865
|
}
|
|
2856
2866
|
return !1;
|
|
2857
2867
|
}
|
|
2858
|
-
function
|
|
2859
|
-
if (!g(
|
|
2860
|
-
const h =
|
|
2861
|
-
(f) =>
|
|
2868
|
+
function j(d) {
|
|
2869
|
+
if (!g(d)) return !1;
|
|
2870
|
+
const h = k(d), a = h.filter((f) => R(f)), r = h.filter(
|
|
2871
|
+
(f) => j(f)
|
|
2862
2872
|
);
|
|
2863
2873
|
return a.length === h.length ? !1 : a.length > 0 || r.length > 0;
|
|
2864
2874
|
}
|
|
2865
|
-
function
|
|
2866
|
-
const h = C(
|
|
2867
|
-
return
|
|
2875
|
+
function Z(d) {
|
|
2876
|
+
const h = C(d);
|
|
2877
|
+
return p.value.currentKey === h;
|
|
2868
2878
|
}
|
|
2869
|
-
function
|
|
2870
|
-
const h = C(
|
|
2871
|
-
return
|
|
2879
|
+
function se(d) {
|
|
2880
|
+
const h = C(d);
|
|
2881
|
+
return p.value.highlightedKeys.has(h);
|
|
2872
2882
|
}
|
|
2873
|
-
function
|
|
2883
|
+
function G(d) {
|
|
2874
2884
|
if (n.disabled) return;
|
|
2875
|
-
const h = C(
|
|
2876
|
-
r ?
|
|
2877
|
-
function
|
|
2878
|
-
M.forEach((
|
|
2879
|
-
const
|
|
2880
|
-
|
|
2885
|
+
const h = C(d), r = !p.value.checkedKeys.has(h), f = new Set(p.value.expandedKeys);
|
|
2886
|
+
r ? p.value.checkedKeys.add(h) : p.value.checkedKeys.delete(h);
|
|
2887
|
+
function b(M, U) {
|
|
2888
|
+
M.forEach((te) => {
|
|
2889
|
+
const A = C(te);
|
|
2890
|
+
U ? p.value.checkedKeys.add(A) : p.value.checkedKeys.delete(A), g(te) && b(k(te), U);
|
|
2881
2891
|
});
|
|
2882
2892
|
}
|
|
2883
|
-
k(
|
|
2893
|
+
b(k(d), r), r && H(), W(), p.value.expandedKeys = f, m("check-change", d, r, !1), m("check", d, r, !1), m("checked-keys-change", Array.from(p.value.checkedKeys));
|
|
2884
2894
|
}
|
|
2885
|
-
function
|
|
2895
|
+
function H(d) {
|
|
2886
2896
|
L.value && console.log(
|
|
2887
2897
|
`已启用从第${L.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2888
2898
|
);
|
|
2889
2899
|
}
|
|
2890
|
-
function
|
|
2891
|
-
const h = C(
|
|
2892
|
-
|
|
2900
|
+
function B(d) {
|
|
2901
|
+
const h = C(d);
|
|
2902
|
+
p.value.expandedKeys.has(h) ? (p.value.expandedKeys.delete(h), m("node-collapse", d, d, null)) : (p.value.expandedKeys.add(h), m("node-expand", d, d, null));
|
|
2893
2903
|
}
|
|
2894
|
-
function
|
|
2895
|
-
const
|
|
2904
|
+
function W() {
|
|
2905
|
+
const d = [];
|
|
2896
2906
|
function h(r) {
|
|
2897
2907
|
r.forEach((f) => {
|
|
2898
|
-
|
|
2908
|
+
d.push(f), g(f) && h(k(f));
|
|
2899
2909
|
});
|
|
2900
2910
|
}
|
|
2901
|
-
h(
|
|
2911
|
+
h(y.value);
|
|
2902
2912
|
function a(r) {
|
|
2903
2913
|
if (g(r)) {
|
|
2904
|
-
const f =
|
|
2905
|
-
(
|
|
2914
|
+
const f = k(r), b = C(r), M = f.filter((te) => R(te)), U = f.filter(
|
|
2915
|
+
(te) => j(te)
|
|
2906
2916
|
);
|
|
2907
|
-
M.length === f.length &&
|
|
2917
|
+
M.length === f.length && U.length === 0 || M.length > 0 || U.length > 0 ? p.value.checkedKeys.add(b) : p.value.checkedKeys.delete(b);
|
|
2908
2918
|
}
|
|
2909
2919
|
}
|
|
2910
|
-
for (let r =
|
|
2911
|
-
a(
|
|
2920
|
+
for (let r = d.length - 1; r >= 0; r--)
|
|
2921
|
+
a(d[r]);
|
|
2912
2922
|
}
|
|
2913
|
-
function Y(
|
|
2923
|
+
function Y(d, h, a, r) {
|
|
2914
2924
|
if (n.disabled) return;
|
|
2915
|
-
const f = r ?
|
|
2925
|
+
const f = r ? O(d, r) : !1;
|
|
2916
2926
|
if (n.enableChildStyleCustomClick && f) {
|
|
2917
|
-
m("child-node-click",
|
|
2927
|
+
m("child-node-click", d, h, a);
|
|
2918
2928
|
return;
|
|
2919
2929
|
}
|
|
2920
|
-
if (n.expandOnClickNode && g(
|
|
2921
|
-
|
|
2930
|
+
if (n.expandOnClickNode && g(d)) {
|
|
2931
|
+
B(d);
|
|
2922
2932
|
return;
|
|
2923
2933
|
}
|
|
2924
|
-
|
|
2934
|
+
p.value.currentNode = d, p.value.currentKey = C(d), n.showCheckbox && G(d), m("node-click", d, h, a);
|
|
2925
2935
|
}
|
|
2926
|
-
function ee(
|
|
2927
|
-
n.disabled || m("node-contextmenu",
|
|
2936
|
+
function ee(d, h, a, r) {
|
|
2937
|
+
n.disabled || m("node-contextmenu", d, h, a, r);
|
|
2928
2938
|
}
|
|
2929
2939
|
oe(
|
|
2930
2940
|
() => n.defaultExpandedKeys,
|
|
2931
|
-
(
|
|
2932
|
-
if (
|
|
2941
|
+
(d) => {
|
|
2942
|
+
if (d) {
|
|
2933
2943
|
const h = L.value;
|
|
2934
2944
|
if (h) {
|
|
2935
|
-
let a = function(M,
|
|
2936
|
-
for (const
|
|
2937
|
-
if (C(
|
|
2938
|
-
if (g(
|
|
2939
|
-
const
|
|
2940
|
-
if (
|
|
2945
|
+
let a = function(M, U, te = 1) {
|
|
2946
|
+
for (const A of U) {
|
|
2947
|
+
if (C(A) === M) return te;
|
|
2948
|
+
if (g(A)) {
|
|
2949
|
+
const ne = a(M, k(A), te + 1);
|
|
2950
|
+
if (ne > 0) return ne;
|
|
2941
2951
|
}
|
|
2942
2952
|
}
|
|
2943
2953
|
return 0;
|
|
2944
|
-
}, r = function(M,
|
|
2945
|
-
M.forEach((
|
|
2946
|
-
|
|
2954
|
+
}, r = function(M, U, te) {
|
|
2955
|
+
M.forEach((A) => {
|
|
2956
|
+
U < te && g(A) ? (b.add(C(A)), r(k(A), U + 1, te)) : U < te && g(A);
|
|
2947
2957
|
});
|
|
2948
2958
|
};
|
|
2949
|
-
const f = (
|
|
2950
|
-
const
|
|
2951
|
-
return
|
|
2952
|
-
}),
|
|
2953
|
-
r(
|
|
2954
|
-
a(M,
|
|
2955
|
-
}),
|
|
2959
|
+
const f = (d || []).filter((M) => {
|
|
2960
|
+
const U = a(M, y.value, 1);
|
|
2961
|
+
return U > 0 && U < h;
|
|
2962
|
+
}), b = new Set(f);
|
|
2963
|
+
r(y.value, 1, h), p.value.expandedKeys.forEach((M) => {
|
|
2964
|
+
a(M, y.value, 1) >= h && b.add(M);
|
|
2965
|
+
}), p.value.expandedKeys = b;
|
|
2956
2966
|
} else
|
|
2957
|
-
|
|
2967
|
+
p.value.expandedKeys = new Set(d);
|
|
2958
2968
|
}
|
|
2959
2969
|
},
|
|
2960
2970
|
{ immediate: !0 }
|
|
2961
2971
|
);
|
|
2962
|
-
function
|
|
2972
|
+
function J() {
|
|
2963
2973
|
if (n.defaultExpandAll) {
|
|
2964
|
-
let
|
|
2965
|
-
r.forEach((
|
|
2966
|
-
if (!g(
|
|
2967
|
-
const M = b
|
|
2974
|
+
let d = function(r, f = 1) {
|
|
2975
|
+
r.forEach((b) => {
|
|
2976
|
+
if (!g(b)) return;
|
|
2977
|
+
const M = k(b);
|
|
2968
2978
|
if (a) {
|
|
2969
2979
|
if (f >= a) return;
|
|
2970
|
-
f + 1 === a || h.add(C(
|
|
2980
|
+
f + 1 === a || h.add(C(b)), d(M, f + 1);
|
|
2971
2981
|
} else
|
|
2972
|
-
h.add(C(
|
|
2982
|
+
h.add(C(b)), d(M, f + 1);
|
|
2973
2983
|
});
|
|
2974
2984
|
};
|
|
2975
2985
|
const h = /* @__PURE__ */ new Set(), a = L.value;
|
|
2976
|
-
|
|
2986
|
+
d(y.value, 1), p.value.expandedKeys = h;
|
|
2977
2987
|
}
|
|
2978
2988
|
}
|
|
2979
|
-
function
|
|
2989
|
+
function fe() {
|
|
2980
2990
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
2981
|
-
let
|
|
2991
|
+
let d = function(f, b = []) {
|
|
2982
2992
|
f.forEach((M) => {
|
|
2983
|
-
const
|
|
2984
|
-
h.has(
|
|
2993
|
+
const U = C(M), te = [...b, U];
|
|
2994
|
+
h.has(U) && b.forEach((A) => a.add(A)), g(M) && d(k(M), te);
|
|
2985
2995
|
});
|
|
2986
2996
|
};
|
|
2987
2997
|
const h = new Set(n.defaultCheckedKeys), a = /* @__PURE__ */ new Set();
|
|
2988
|
-
|
|
2998
|
+
d(y.value);
|
|
2989
2999
|
const r = L.value;
|
|
2990
3000
|
if (r) {
|
|
2991
3001
|
console.log(
|
|
@@ -2993,63 +3003,63 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
2993
3003
|
);
|
|
2994
3004
|
return;
|
|
2995
3005
|
}
|
|
2996
|
-
|
|
3006
|
+
p.value.expandedKeys = a;
|
|
2997
3007
|
}
|
|
2998
3008
|
}
|
|
2999
|
-
oe(() => n.defaultExpandAll,
|
|
3009
|
+
oe(() => n.defaultExpandAll, J, { immediate: !0 }), oe(() => y.value, J, { deep: !0 }), oe(
|
|
3000
3010
|
() => n.defaultCheckedKeys,
|
|
3001
|
-
(
|
|
3002
|
-
|
|
3011
|
+
(d) => {
|
|
3012
|
+
d ? (p.value.checkedKeys = new Set(d), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : fe()) : p.value.checkedKeys.clear();
|
|
3003
3013
|
},
|
|
3004
3014
|
{ immediate: !0 }
|
|
3005
3015
|
);
|
|
3006
|
-
function
|
|
3016
|
+
function me(d) {
|
|
3007
3017
|
try {
|
|
3008
|
-
let h = function(f,
|
|
3009
|
-
for (const
|
|
3010
|
-
const
|
|
3011
|
-
if (
|
|
3012
|
-
if (g(
|
|
3013
|
-
const
|
|
3014
|
-
if (
|
|
3018
|
+
let h = function(f, b, M = []) {
|
|
3019
|
+
for (const U of f) {
|
|
3020
|
+
const te = C(U), A = [...M, te];
|
|
3021
|
+
if (te === b) return A;
|
|
3022
|
+
if (g(U)) {
|
|
3023
|
+
const ne = h(k(U), b, A);
|
|
3024
|
+
if (ne) return ne;
|
|
3015
3025
|
}
|
|
3016
3026
|
}
|
|
3017
3027
|
return null;
|
|
3018
3028
|
};
|
|
3019
|
-
const a = Array.isArray(
|
|
3029
|
+
const a = Array.isArray(d) ? d : [];
|
|
3020
3030
|
if (a.length === 0) return;
|
|
3021
|
-
|
|
3022
|
-
const r = new Set(
|
|
3031
|
+
p.value.highlightedKeys.clear();
|
|
3032
|
+
const r = new Set(p.value.expandedKeys);
|
|
3023
3033
|
a.forEach((f) => {
|
|
3024
|
-
const
|
|
3025
|
-
|
|
3026
|
-
}),
|
|
3034
|
+
const b = h(y.value, f);
|
|
3035
|
+
b && b.length > 0 && (b.slice(0, -1).forEach((M) => r.add(M)), p.value.highlightedKeys.add(b[b.length - 1]));
|
|
3036
|
+
}), p.value.expandedKeys = r;
|
|
3027
3037
|
} catch (h) {
|
|
3028
3038
|
console.warn("highlightAndExpandByIds 执行失败", h);
|
|
3029
3039
|
}
|
|
3030
3040
|
}
|
|
3031
|
-
function
|
|
3032
|
-
|
|
3041
|
+
function F() {
|
|
3042
|
+
p.value.highlightedKeys.clear();
|
|
3033
3043
|
}
|
|
3034
|
-
function
|
|
3035
|
-
|
|
3044
|
+
function Q() {
|
|
3045
|
+
p.value.currentNode = null, p.value.currentKey = null;
|
|
3036
3046
|
}
|
|
3037
|
-
return $({ highlightAndExpandByIds:
|
|
3047
|
+
return $({ highlightAndExpandByIds: me, clearHighlights: F, clearCurrentNode: Q }), oe(
|
|
3038
3048
|
() => n.defaultSelectedKeys,
|
|
3039
|
-
(
|
|
3040
|
-
|
|
3049
|
+
(d) => {
|
|
3050
|
+
d && (p.value.selectedKeys = new Set(d));
|
|
3041
3051
|
},
|
|
3042
3052
|
{ immediate: !0 }
|
|
3043
|
-
), (
|
|
3044
|
-
class:
|
|
3053
|
+
), (d, h) => (i(), u("div", {
|
|
3054
|
+
class: z(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
3045
3055
|
}, [
|
|
3046
3056
|
o("div", Cl, [
|
|
3047
|
-
(i(!0), u(
|
|
3057
|
+
(i(!0), u(ue, null, he(y.value, (a) => (i(), u("div", {
|
|
3048
3058
|
key: C(a),
|
|
3049
|
-
class:
|
|
3059
|
+
class: z(["ytree-node", { "ytree-node--current": Z(a), "ytree-node--highlight": se(a) }])
|
|
3050
3060
|
}, [
|
|
3051
3061
|
o("div", {
|
|
3052
|
-
class:
|
|
3062
|
+
class: z(["ytree-node__content", { "is-child-style": O(a, a) }]),
|
|
3053
3063
|
style: { paddingLeft: "8px" },
|
|
3054
3064
|
"data-level": V(a, a),
|
|
3055
3065
|
onClick: (r) => Y(a, a, null, a),
|
|
@@ -3057,8 +3067,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3057
3067
|
}, [
|
|
3058
3068
|
g(a) ? (i(), u("span", {
|
|
3059
3069
|
key: 0,
|
|
3060
|
-
class:
|
|
3061
|
-
onClick:
|
|
3070
|
+
class: z(["ytree-node__expand-icon", { "is-expanded": P(a) }]),
|
|
3071
|
+
onClick: X((r) => B(a), ["stop"])
|
|
3062
3072
|
}, [...h[0] || (h[0] = [
|
|
3063
3073
|
o("svg", {
|
|
3064
3074
|
width: "12",
|
|
@@ -3077,13 +3087,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3077
3087
|
])], 10, _l)) : (i(), u("span", Sl)),
|
|
3078
3088
|
e.showCheckbox ? (i(), u("span", {
|
|
3079
3089
|
key: 2,
|
|
3080
|
-
class:
|
|
3081
|
-
"is-checked":
|
|
3082
|
-
"is-indeterminate":
|
|
3090
|
+
class: z(["ytree-node__checkbox", {
|
|
3091
|
+
"is-checked": R(a),
|
|
3092
|
+
"is-indeterminate": j(a)
|
|
3083
3093
|
}]),
|
|
3084
|
-
onClick:
|
|
3094
|
+
onClick: X((r) => G(a), ["stop"])
|
|
3085
3095
|
}, [
|
|
3086
|
-
|
|
3096
|
+
R(a) ? (i(), u("svg", Ml, [...h[1] || (h[1] = [
|
|
3087
3097
|
o("path", {
|
|
3088
3098
|
d: "M2 6L4.5 8.5L10 3",
|
|
3089
3099
|
stroke: "currentColor",
|
|
@@ -3091,45 +3101,45 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3091
3101
|
"stroke-linecap": "round",
|
|
3092
3102
|
"stroke-linejoin": "round"
|
|
3093
3103
|
}, null, -1)
|
|
3094
|
-
])])) :
|
|
3104
|
+
])])) : j(a) ? (i(), u("svg", Il, [...h[2] || (h[2] = [
|
|
3095
3105
|
o("path", {
|
|
3096
3106
|
d: "M2 6L10 6",
|
|
3097
3107
|
stroke: "currentColor",
|
|
3098
3108
|
"stroke-width": "1.5",
|
|
3099
3109
|
"stroke-linecap": "round"
|
|
3100
3110
|
}, null, -1)
|
|
3101
|
-
])])) :
|
|
3102
|
-
], 10, Ll)) :
|
|
3111
|
+
])])) : K("", !0)
|
|
3112
|
+
], 10, Ll)) : K("", !0),
|
|
3103
3113
|
e.iconClass ? (i(), u("span", {
|
|
3104
3114
|
key: 3,
|
|
3105
|
-
class:
|
|
3106
|
-
}, null, 2)) :
|
|
3115
|
+
class: z(["ytree-node__icon", e.iconClass])
|
|
3116
|
+
}, null, 2)) : K("", !0),
|
|
3107
3117
|
o("img", {
|
|
3108
3118
|
class: "ytree-node__avatar",
|
|
3109
3119
|
src: w(a, a),
|
|
3110
3120
|
alt: x(a) ? "person" : "dept"
|
|
3111
3121
|
}, null, 8, El),
|
|
3112
3122
|
o("span", {
|
|
3113
|
-
class:
|
|
3114
|
-
},
|
|
3123
|
+
class: z(["ytree-node__label", { "is-employee": x(a) }])
|
|
3124
|
+
}, le(I(a)), 3),
|
|
3115
3125
|
o("div", Bl, [
|
|
3116
|
-
ce(
|
|
3126
|
+
ce(d.$slots, "node-content", {
|
|
3117
3127
|
node: a,
|
|
3118
|
-
isCurrent:
|
|
3119
|
-
isExpanded:
|
|
3128
|
+
isCurrent: Z(a),
|
|
3129
|
+
isExpanded: P(a),
|
|
3120
3130
|
hasChildren: g(a)
|
|
3121
3131
|
}, void 0, !0)
|
|
3122
3132
|
])
|
|
3123
3133
|
], 42, Dl),
|
|
3124
|
-
de(
|
|
3125
|
-
default:
|
|
3126
|
-
g(a) &&
|
|
3127
|
-
(i(!0), u(
|
|
3134
|
+
de($e, { name: "ytree-node" }, {
|
|
3135
|
+
default: ve(() => [
|
|
3136
|
+
g(a) && P(a) ? (i(), u("div", Tl, [
|
|
3137
|
+
(i(!0), u(ue, null, he(k(a), (r) => (i(), u("div", {
|
|
3128
3138
|
key: C(r),
|
|
3129
|
-
class:
|
|
3139
|
+
class: z(["ytree-node", { "ytree-node--current": Z(r), "ytree-node--highlight": se(r) }])
|
|
3130
3140
|
}, [
|
|
3131
3141
|
o("div", {
|
|
3132
|
-
class:
|
|
3142
|
+
class: z(["ytree-node__content", { "is-child-style": O(r, a) }]),
|
|
3133
3143
|
style: { paddingLeft: "22px" },
|
|
3134
3144
|
"data-level": V(a, r),
|
|
3135
3145
|
onClick: (f) => Y(r, r, null, a),
|
|
@@ -3137,8 +3147,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3137
3147
|
}, [
|
|
3138
3148
|
g(r) ? (i(), u("span", {
|
|
3139
3149
|
key: 0,
|
|
3140
|
-
class:
|
|
3141
|
-
onClick:
|
|
3150
|
+
class: z(["ytree-node__expand-icon", { "is-expanded": P(r) }]),
|
|
3151
|
+
onClick: X((f) => B(r), ["stop"])
|
|
3142
3152
|
}, [...h[3] || (h[3] = [
|
|
3143
3153
|
o("svg", {
|
|
3144
3154
|
width: "12",
|
|
@@ -3154,16 +3164,16 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3154
3164
|
"stroke-linejoin": "round"
|
|
3155
3165
|
})
|
|
3156
3166
|
], -1)
|
|
3157
|
-
])], 10,
|
|
3167
|
+
])], 10, Kl)) : (i(), u("span", Hl)),
|
|
3158
3168
|
e.showCheckbox ? (i(), u("span", {
|
|
3159
3169
|
key: 2,
|
|
3160
|
-
class:
|
|
3161
|
-
"is-checked":
|
|
3162
|
-
"is-indeterminate":
|
|
3170
|
+
class: z(["ytree-node__checkbox", {
|
|
3171
|
+
"is-checked": R(r),
|
|
3172
|
+
"is-indeterminate": j(r)
|
|
3163
3173
|
}]),
|
|
3164
|
-
onClick:
|
|
3174
|
+
onClick: X((f) => G(r), ["stop"])
|
|
3165
3175
|
}, [
|
|
3166
|
-
|
|
3176
|
+
R(r) ? (i(), u("svg", Rl, [...h[4] || (h[4] = [
|
|
3167
3177
|
o("path", {
|
|
3168
3178
|
d: "M2 6L4.5 8.5L10 3",
|
|
3169
3179
|
stroke: "currentColor",
|
|
@@ -3171,53 +3181,53 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3171
3181
|
"stroke-linecap": "round",
|
|
3172
3182
|
"stroke-linejoin": "round"
|
|
3173
3183
|
}, null, -1)
|
|
3174
|
-
])])) :
|
|
3184
|
+
])])) : j(r) ? (i(), u("svg", Wl, [...h[5] || (h[5] = [
|
|
3175
3185
|
o("path", {
|
|
3176
3186
|
d: "M2 6L10 6",
|
|
3177
3187
|
stroke: "currentColor",
|
|
3178
3188
|
"stroke-width": "1.5",
|
|
3179
3189
|
"stroke-linecap": "round"
|
|
3180
3190
|
}, null, -1)
|
|
3181
|
-
])])) :
|
|
3182
|
-
], 10,
|
|
3191
|
+
])])) : K("", !0)
|
|
3192
|
+
], 10, Al)) : K("", !0),
|
|
3183
3193
|
e.iconClass ? (i(), u("span", {
|
|
3184
3194
|
key: 3,
|
|
3185
|
-
class:
|
|
3186
|
-
}, null, 2)) :
|
|
3195
|
+
class: z(["ytree-node__icon", e.iconClass])
|
|
3196
|
+
}, null, 2)) : K("", !0),
|
|
3187
3197
|
o("img", {
|
|
3188
3198
|
class: "ytree-node__avatar",
|
|
3189
3199
|
src: w(r, a),
|
|
3190
3200
|
alt: x(r) ? "person" : "dept"
|
|
3191
|
-
}, null, 8,
|
|
3201
|
+
}, null, 8, Vl),
|
|
3192
3202
|
o("span", {
|
|
3193
|
-
class:
|
|
3194
|
-
},
|
|
3203
|
+
class: z(["ytree-node__label", { "is-employee": x(r) }])
|
|
3204
|
+
}, le(I(r)), 3),
|
|
3195
3205
|
o("div", Fl, [
|
|
3196
|
-
ce(
|
|
3206
|
+
ce(d.$slots, "node-content", {
|
|
3197
3207
|
node: r,
|
|
3198
|
-
isCurrent:
|
|
3199
|
-
isExpanded:
|
|
3208
|
+
isCurrent: Z(r),
|
|
3209
|
+
isExpanded: P(r),
|
|
3200
3210
|
hasChildren: g(r)
|
|
3201
3211
|
}, void 0, !0)
|
|
3202
3212
|
])
|
|
3203
|
-
], 42,
|
|
3204
|
-
de(
|
|
3205
|
-
default:
|
|
3206
|
-
g(r) &&
|
|
3207
|
-
(i(!0), u(
|
|
3213
|
+
], 42, zl),
|
|
3214
|
+
de($e, { name: "ytree-node" }, {
|
|
3215
|
+
default: ve(() => [
|
|
3216
|
+
g(r) && P(r) ? (i(), u("div", Pl, [
|
|
3217
|
+
(i(!0), u(ue, null, he(k(r), (f) => (i(), u("div", {
|
|
3208
3218
|
key: C(f),
|
|
3209
|
-
class:
|
|
3210
|
-
"ytree-node--current":
|
|
3211
|
-
"ytree-node--highlight":
|
|
3219
|
+
class: z(["ytree-node", {
|
|
3220
|
+
"ytree-node--current": Z(f),
|
|
3221
|
+
"ytree-node--highlight": se(f)
|
|
3212
3222
|
}])
|
|
3213
3223
|
}, [
|
|
3214
3224
|
o("div", {
|
|
3215
|
-
class:
|
|
3225
|
+
class: z(["ytree-node__content", { "is-child-style": O(f, a) }]),
|
|
3216
3226
|
style: { paddingLeft: "38px" },
|
|
3217
3227
|
"data-level": V(a, f),
|
|
3218
|
-
onClick: (
|
|
3219
|
-
onContextmenu: (
|
|
3220
|
-
|
|
3228
|
+
onClick: (b) => Y(f, f, null, a),
|
|
3229
|
+
onContextmenu: (b) => ee(
|
|
3230
|
+
b,
|
|
3221
3231
|
f,
|
|
3222
3232
|
f,
|
|
3223
3233
|
null
|
|
@@ -3225,8 +3235,8 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3225
3235
|
}, [
|
|
3226
3236
|
g(f) ? (i(), u("span", {
|
|
3227
3237
|
key: 0,
|
|
3228
|
-
class:
|
|
3229
|
-
onClick:
|
|
3238
|
+
class: z(["ytree-node__expand-icon", { "is-expanded": P(f) }]),
|
|
3239
|
+
onClick: X((b) => B(f), ["stop"])
|
|
3230
3240
|
}, [...h[6] || (h[6] = [
|
|
3231
3241
|
o("svg", {
|
|
3232
3242
|
width: "12",
|
|
@@ -3245,13 +3255,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3245
3255
|
])], 10, Nl)) : (i(), u("span", Ol)),
|
|
3246
3256
|
e.showCheckbox ? (i(), u("span", {
|
|
3247
3257
|
key: 2,
|
|
3248
|
-
class:
|
|
3249
|
-
"is-checked":
|
|
3250
|
-
"is-indeterminate":
|
|
3258
|
+
class: z(["ytree-node__checkbox", {
|
|
3259
|
+
"is-checked": R(f),
|
|
3260
|
+
"is-indeterminate": j(f)
|
|
3251
3261
|
}]),
|
|
3252
|
-
onClick:
|
|
3262
|
+
onClick: X((b) => G(f), ["stop"])
|
|
3253
3263
|
}, [
|
|
3254
|
-
|
|
3264
|
+
R(f) ? (i(), u("svg", ql, [...h[7] || (h[7] = [
|
|
3255
3265
|
o("path", {
|
|
3256
3266
|
d: "M2 6L4.5 8.5L10 3",
|
|
3257
3267
|
stroke: "currentColor",
|
|
@@ -3259,71 +3269,71 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3259
3269
|
"stroke-linecap": "round",
|
|
3260
3270
|
"stroke-linejoin": "round"
|
|
3261
3271
|
}, null, -1)
|
|
3262
|
-
])])) :
|
|
3272
|
+
])])) : j(f) ? (i(), u("svg", Ul, [...h[8] || (h[8] = [
|
|
3263
3273
|
o("path", {
|
|
3264
3274
|
d: "M2 6L10 6",
|
|
3265
3275
|
stroke: "currentColor",
|
|
3266
3276
|
"stroke-width": "1.5",
|
|
3267
3277
|
"stroke-linecap": "round"
|
|
3268
3278
|
}, null, -1)
|
|
3269
|
-
])])) :
|
|
3270
|
-
], 10, jl)) :
|
|
3279
|
+
])])) : K("", !0)
|
|
3280
|
+
], 10, jl)) : K("", !0),
|
|
3271
3281
|
e.iconClass ? (i(), u("span", {
|
|
3272
3282
|
key: 3,
|
|
3273
|
-
class:
|
|
3274
|
-
}, null, 2)) :
|
|
3283
|
+
class: z(["ytree-node__icon", e.iconClass])
|
|
3284
|
+
}, null, 2)) : K("", !0),
|
|
3275
3285
|
o("img", {
|
|
3276
3286
|
class: "ytree-node__avatar",
|
|
3277
3287
|
src: w(f, a),
|
|
3278
3288
|
alt: x(f) ? "person" : "dept"
|
|
3279
3289
|
}, null, 8, Zl),
|
|
3280
3290
|
o("span", {
|
|
3281
|
-
class:
|
|
3282
|
-
},
|
|
3291
|
+
class: z(["ytree-node__label", { "is-employee": x(f) }])
|
|
3292
|
+
}, le(I(f)), 3),
|
|
3283
3293
|
o("div", Ql, [
|
|
3284
|
-
ce(
|
|
3294
|
+
ce(d.$slots, "node-content", {
|
|
3285
3295
|
node: f,
|
|
3286
|
-
isCurrent:
|
|
3287
|
-
isExpanded:
|
|
3296
|
+
isCurrent: Z(f),
|
|
3297
|
+
isExpanded: P(f),
|
|
3288
3298
|
hasChildren: g(f)
|
|
3289
3299
|
}, void 0, !0)
|
|
3290
3300
|
])
|
|
3291
3301
|
], 42, Yl),
|
|
3292
|
-
de(
|
|
3293
|
-
default:
|
|
3294
|
-
g(f) &&
|
|
3295
|
-
(i(!0), u(
|
|
3296
|
-
key: C(
|
|
3297
|
-
class:
|
|
3298
|
-
"ytree-node--current":
|
|
3299
|
-
"ytree-node--highlight":
|
|
3302
|
+
de($e, { name: "ytree-node" }, {
|
|
3303
|
+
default: ve(() => [
|
|
3304
|
+
g(f) && P(f) ? (i(), u("div", Jl, [
|
|
3305
|
+
(i(!0), u(ue, null, he(k(f), (b) => (i(), u("div", {
|
|
3306
|
+
key: C(b),
|
|
3307
|
+
class: z(["ytree-node", {
|
|
3308
|
+
"ytree-node--current": Z(b),
|
|
3309
|
+
"ytree-node--highlight": se(b)
|
|
3300
3310
|
}])
|
|
3301
3311
|
}, [
|
|
3302
3312
|
o("div", {
|
|
3303
|
-
class:
|
|
3313
|
+
class: z(["ytree-node__content", { "is-child-style": O(b, a) }]),
|
|
3304
3314
|
style: {
|
|
3305
3315
|
paddingLeft: "54px"
|
|
3306
3316
|
},
|
|
3307
|
-
"data-level": V(a,
|
|
3317
|
+
"data-level": V(a, b),
|
|
3308
3318
|
onClick: (M) => Y(
|
|
3309
|
-
|
|
3310
|
-
|
|
3319
|
+
b,
|
|
3320
|
+
b,
|
|
3311
3321
|
null,
|
|
3312
3322
|
a
|
|
3313
3323
|
),
|
|
3314
3324
|
onContextmenu: (M) => ee(
|
|
3315
3325
|
M,
|
|
3316
|
-
|
|
3317
|
-
|
|
3326
|
+
b,
|
|
3327
|
+
b,
|
|
3318
3328
|
null
|
|
3319
3329
|
)
|
|
3320
3330
|
}, [
|
|
3321
|
-
g(
|
|
3331
|
+
g(b) ? (i(), u("span", {
|
|
3322
3332
|
key: 0,
|
|
3323
|
-
class:
|
|
3324
|
-
"is-expanded":
|
|
3333
|
+
class: z(["ytree-node__expand-icon", {
|
|
3334
|
+
"is-expanded": P(b)
|
|
3325
3335
|
}]),
|
|
3326
|
-
onClick:
|
|
3336
|
+
onClick: X((M) => B(b), ["stop"])
|
|
3327
3337
|
}, [...h[9] || (h[9] = [
|
|
3328
3338
|
o("svg", {
|
|
3329
3339
|
width: "12",
|
|
@@ -3342,13 +3352,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3342
3352
|
])], 10, Gl)) : (i(), u("span", eo)),
|
|
3343
3353
|
e.showCheckbox ? (i(), u("span", {
|
|
3344
3354
|
key: 2,
|
|
3345
|
-
class:
|
|
3346
|
-
"is-checked":
|
|
3347
|
-
"is-indeterminate":
|
|
3355
|
+
class: z(["ytree-node__checkbox", {
|
|
3356
|
+
"is-checked": R(b),
|
|
3357
|
+
"is-indeterminate": j(b)
|
|
3348
3358
|
}]),
|
|
3349
|
-
onClick:
|
|
3359
|
+
onClick: X((M) => G(b), ["stop"])
|
|
3350
3360
|
}, [
|
|
3351
|
-
|
|
3361
|
+
R(b) ? (i(), u("svg", no, [...h[10] || (h[10] = [
|
|
3352
3362
|
o("path", {
|
|
3353
3363
|
d: "M2 6L4.5 8.5L10 3",
|
|
3354
3364
|
stroke: "currentColor",
|
|
@@ -3356,63 +3366,63 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3356
3366
|
"stroke-linecap": "round",
|
|
3357
3367
|
"stroke-linejoin": "round"
|
|
3358
3368
|
}, null, -1)
|
|
3359
|
-
])])) :
|
|
3369
|
+
])])) : j(b) ? (i(), u("svg", lo, [...h[11] || (h[11] = [
|
|
3360
3370
|
o("path", {
|
|
3361
3371
|
d: "M2 6L10 6",
|
|
3362
3372
|
stroke: "currentColor",
|
|
3363
3373
|
"stroke-width": "1.5",
|
|
3364
3374
|
"stroke-linecap": "round"
|
|
3365
3375
|
}, null, -1)
|
|
3366
|
-
])])) :
|
|
3367
|
-
], 10, to)) :
|
|
3376
|
+
])])) : K("", !0)
|
|
3377
|
+
], 10, to)) : K("", !0),
|
|
3368
3378
|
e.iconClass ? (i(), u("span", {
|
|
3369
3379
|
key: 3,
|
|
3370
|
-
class:
|
|
3371
|
-
}, null, 2)) :
|
|
3380
|
+
class: z(["ytree-node__icon", e.iconClass])
|
|
3381
|
+
}, null, 2)) : K("", !0),
|
|
3372
3382
|
o("img", {
|
|
3373
3383
|
class: "ytree-node__avatar",
|
|
3374
|
-
src: w(
|
|
3375
|
-
alt: x(
|
|
3384
|
+
src: w(b, a),
|
|
3385
|
+
alt: x(b) ? "person" : "dept"
|
|
3376
3386
|
}, null, 8, oo),
|
|
3377
3387
|
o("span", {
|
|
3378
|
-
class:
|
|
3379
|
-
"is-employee": x(
|
|
3388
|
+
class: z(["ytree-node__label", {
|
|
3389
|
+
"is-employee": x(b)
|
|
3380
3390
|
}])
|
|
3381
|
-
},
|
|
3391
|
+
}, le(I(b)), 3),
|
|
3382
3392
|
o("div", ao, [
|
|
3383
|
-
ce(
|
|
3384
|
-
node:
|
|
3385
|
-
isCurrent:
|
|
3386
|
-
isExpanded:
|
|
3387
|
-
hasChildren: g(
|
|
3393
|
+
ce(d.$slots, "node-content", {
|
|
3394
|
+
node: b,
|
|
3395
|
+
isCurrent: Z(b),
|
|
3396
|
+
isExpanded: P(b),
|
|
3397
|
+
hasChildren: g(b)
|
|
3388
3398
|
}, void 0, !0)
|
|
3389
3399
|
])
|
|
3390
3400
|
], 42, Xl),
|
|
3391
|
-
de(
|
|
3392
|
-
default:
|
|
3393
|
-
g(
|
|
3394
|
-
(i(!0), u(
|
|
3395
|
-
|
|
3401
|
+
de($e, { name: "ytree-node" }, {
|
|
3402
|
+
default: ve(() => [
|
|
3403
|
+
g(b) && P(b) ? (i(), u("div", so, [
|
|
3404
|
+
(i(!0), u(ue, null, he(k(
|
|
3405
|
+
b
|
|
3396
3406
|
), (M) => (i(), u("div", {
|
|
3397
3407
|
key: C(M),
|
|
3398
|
-
class:
|
|
3399
|
-
"ytree-node--current":
|
|
3408
|
+
class: z(["ytree-node", {
|
|
3409
|
+
"ytree-node--current": Z(M)
|
|
3400
3410
|
}])
|
|
3401
3411
|
}, [
|
|
3402
3412
|
o("div", {
|
|
3403
|
-
class:
|
|
3413
|
+
class: z(["ytree-node__content", { "is-child-style": O(M, a) }]),
|
|
3404
3414
|
style: {
|
|
3405
3415
|
paddingLeft: "70px"
|
|
3406
3416
|
},
|
|
3407
3417
|
"data-level": V(a, M),
|
|
3408
|
-
onClick: (
|
|
3418
|
+
onClick: (U) => Y(
|
|
3409
3419
|
M,
|
|
3410
3420
|
M,
|
|
3411
3421
|
null,
|
|
3412
3422
|
a
|
|
3413
3423
|
),
|
|
3414
|
-
onContextmenu: (
|
|
3415
|
-
|
|
3424
|
+
onContextmenu: (U) => ee(
|
|
3425
|
+
U,
|
|
3416
3426
|
M,
|
|
3417
3427
|
M,
|
|
3418
3428
|
null
|
|
@@ -3420,10 +3430,10 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3420
3430
|
}, [
|
|
3421
3431
|
g(M) ? (i(), u("span", {
|
|
3422
3432
|
key: 0,
|
|
3423
|
-
class:
|
|
3424
|
-
"is-expanded":
|
|
3433
|
+
class: z(["ytree-node__expand-icon", {
|
|
3434
|
+
"is-expanded": P(M)
|
|
3425
3435
|
}]),
|
|
3426
|
-
onClick:
|
|
3436
|
+
onClick: X((U) => B(M), ["stop"])
|
|
3427
3437
|
}, [...h[12] || (h[12] = [
|
|
3428
3438
|
o("svg", {
|
|
3429
3439
|
width: "12",
|
|
@@ -3442,15 +3452,15 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3442
3452
|
])], 10, ro)) : (i(), u("span", uo)),
|
|
3443
3453
|
e.showCheckbox ? (i(), u("span", {
|
|
3444
3454
|
key: 2,
|
|
3445
|
-
class:
|
|
3446
|
-
"is-checked":
|
|
3447
|
-
"is-indeterminate":
|
|
3455
|
+
class: z(["ytree-node__checkbox", {
|
|
3456
|
+
"is-checked": R(M),
|
|
3457
|
+
"is-indeterminate": j(
|
|
3448
3458
|
M
|
|
3449
3459
|
)
|
|
3450
3460
|
}]),
|
|
3451
|
-
onClick:
|
|
3461
|
+
onClick: X((U) => G(M), ["stop"])
|
|
3452
3462
|
}, [
|
|
3453
|
-
|
|
3463
|
+
R(M) ? (i(), u("svg", fo, [...h[13] || (h[13] = [
|
|
3454
3464
|
o("path", {
|
|
3455
3465
|
d: "M2 6L4.5 8.5L10 3",
|
|
3456
3466
|
stroke: "currentColor",
|
|
@@ -3458,7 +3468,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3458
3468
|
"stroke-linecap": "round",
|
|
3459
3469
|
"stroke-linejoin": "round"
|
|
3460
3470
|
}, null, -1)
|
|
3461
|
-
])])) :
|
|
3471
|
+
])])) : j(
|
|
3462
3472
|
M
|
|
3463
3473
|
) ? (i(), u("svg", vo, [...h[14] || (h[14] = [
|
|
3464
3474
|
o("path", {
|
|
@@ -3467,48 +3477,48 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3467
3477
|
"stroke-width": "1.5",
|
|
3468
3478
|
"stroke-linecap": "round"
|
|
3469
3479
|
}, null, -1)
|
|
3470
|
-
])])) :
|
|
3471
|
-
], 10, co)) :
|
|
3480
|
+
])])) : K("", !0)
|
|
3481
|
+
], 10, co)) : K("", !0),
|
|
3472
3482
|
e.iconClass ? (i(), u("span", {
|
|
3473
3483
|
key: 3,
|
|
3474
|
-
class:
|
|
3475
|
-
}, null, 2)) :
|
|
3484
|
+
class: z(["ytree-node__icon", e.iconClass])
|
|
3485
|
+
}, null, 2)) : K("", !0),
|
|
3476
3486
|
o("img", {
|
|
3477
3487
|
class: "ytree-node__avatar",
|
|
3478
3488
|
src: w(M, a),
|
|
3479
3489
|
alt: x(M) ? "person" : "dept"
|
|
3480
3490
|
}, null, 8, ho),
|
|
3481
3491
|
o("span", {
|
|
3482
|
-
class:
|
|
3492
|
+
class: z(["ytree-node__label", {
|
|
3483
3493
|
"is-employee": x(M)
|
|
3484
3494
|
}])
|
|
3485
|
-
},
|
|
3495
|
+
}, le(I(M)), 3),
|
|
3486
3496
|
o("div", po, [
|
|
3487
|
-
ce(
|
|
3497
|
+
ce(d.$slots, "node-content", {
|
|
3488
3498
|
node: M,
|
|
3489
|
-
isCurrent:
|
|
3490
|
-
isExpanded:
|
|
3499
|
+
isCurrent: Z(M),
|
|
3500
|
+
isExpanded: P(M),
|
|
3491
3501
|
hasChildren: g(M)
|
|
3492
3502
|
}, void 0, !0)
|
|
3493
3503
|
])
|
|
3494
3504
|
], 42, io)
|
|
3495
3505
|
], 2))), 128))
|
|
3496
|
-
])) :
|
|
3506
|
+
])) : K("", !0)
|
|
3497
3507
|
]),
|
|
3498
3508
|
_: 2
|
|
3499
3509
|
}, 1024)
|
|
3500
3510
|
], 2))), 128))
|
|
3501
|
-
])) :
|
|
3511
|
+
])) : K("", !0)
|
|
3502
3512
|
]),
|
|
3503
3513
|
_: 2
|
|
3504
3514
|
}, 1024)
|
|
3505
3515
|
], 2))), 128))
|
|
3506
|
-
])) :
|
|
3516
|
+
])) : K("", !0)
|
|
3507
3517
|
]),
|
|
3508
3518
|
_: 2
|
|
3509
3519
|
}, 1024)
|
|
3510
3520
|
], 2))), 128))
|
|
3511
|
-
])) :
|
|
3521
|
+
])) : K("", !0)
|
|
3512
3522
|
]),
|
|
3513
3523
|
_: 2
|
|
3514
3524
|
}, 1024)
|
|
@@ -3516,13 +3526,13 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3516
3526
|
])
|
|
3517
3527
|
], 2));
|
|
3518
3528
|
}
|
|
3519
|
-
}), wo = /* @__PURE__ */
|
|
3529
|
+
}), wo = /* @__PURE__ */ be(mo, [["__scopeId", "data-v-6ab410ed"]]), bo = { class: "query-encapsulation" }, ko = { class: "query-encapsulation__container" }, xo = { class: "query-encapsulation__content" }, $o = { class: "query-encapsulation__fields" }, Co = { class: "query-encapsulation__field-wrapper" }, Do = {
|
|
3520
3530
|
key: 0,
|
|
3521
3531
|
class: "query-encapsulation__field-label"
|
|
3522
3532
|
}, _o = {
|
|
3523
3533
|
key: 0,
|
|
3524
3534
|
class: "query-encapsulation__toggle"
|
|
3525
|
-
}, So = { class: "query-encapsulation__actions" }, Lo = { class: "query-encapsulation__actions-group" }, Mo = /* @__PURE__ */
|
|
3535
|
+
}, So = { class: "query-encapsulation__actions" }, Lo = { class: "query-encapsulation__actions-group" }, Mo = /* @__PURE__ */ we({
|
|
3526
3536
|
__name: "QueryEncapsulation",
|
|
3527
3537
|
props: {
|
|
3528
3538
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3533,11 +3543,11 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3533
3543
|
},
|
|
3534
3544
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3535
3545
|
setup(e, { emit: $ }) {
|
|
3536
|
-
const t = e, n = $, m = E(!1),
|
|
3546
|
+
const t = e, n = $, m = E(!1), y = st({}), p = ["select", "date", "daterange"];
|
|
3537
3547
|
let L;
|
|
3538
|
-
const C =
|
|
3539
|
-
function w(
|
|
3540
|
-
switch (
|
|
3548
|
+
const C = N(() => t.fields.filter((H) => !H.hidden)), I = N(() => m.value ? C.value : C.value.slice(0, t.maxVisibleFields)), x = N(() => C.value.length > t.maxVisibleFields);
|
|
3549
|
+
function w(H) {
|
|
3550
|
+
switch (H) {
|
|
3541
3551
|
case "select":
|
|
3542
3552
|
return tt;
|
|
3543
3553
|
case "date":
|
|
@@ -3548,87 +3558,87 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3548
3558
|
return et;
|
|
3549
3559
|
}
|
|
3550
3560
|
}
|
|
3551
|
-
function g(
|
|
3552
|
-
n("field-change",
|
|
3561
|
+
function g(H) {
|
|
3562
|
+
n("field-change", H, y[H.key]), n("update:modelValue", { ...y }), p.includes(H.type) && j();
|
|
3553
3563
|
}
|
|
3554
|
-
function
|
|
3555
|
-
const
|
|
3556
|
-
n("search", { data:
|
|
3564
|
+
function k() {
|
|
3565
|
+
const H = Z(y), B = se(H), W = { ...y };
|
|
3566
|
+
n("search", { data: B, raw: W });
|
|
3557
3567
|
}
|
|
3558
3568
|
function V() {
|
|
3559
|
-
Object.keys(
|
|
3560
|
-
const
|
|
3561
|
-
(
|
|
3562
|
-
}), n("reset"), n("update:modelValue", { ...
|
|
3569
|
+
Object.keys(y).forEach((H) => {
|
|
3570
|
+
const B = t.fields.find((W) => W.key === H);
|
|
3571
|
+
(B == null ? void 0 : B.type) === "daterange" ? y[H] = { startDate: null, endDate: null } : (B == null ? void 0 : B.type) === "date" ? y[H] = null : y[H] = "";
|
|
3572
|
+
}), n("reset"), n("update:modelValue", { ...y });
|
|
3563
3573
|
}
|
|
3564
|
-
function
|
|
3574
|
+
function O() {
|
|
3565
3575
|
m.value = !m.value;
|
|
3566
3576
|
}
|
|
3567
|
-
function
|
|
3568
|
-
return
|
|
3569
|
-
enter: () =>
|
|
3570
|
-
paste: () =>
|
|
3577
|
+
function P(H) {
|
|
3578
|
+
return H.type !== "input" ? {} : {
|
|
3579
|
+
enter: () => R(),
|
|
3580
|
+
paste: () => R()
|
|
3571
3581
|
};
|
|
3572
3582
|
}
|
|
3573
|
-
async function
|
|
3574
|
-
await
|
|
3583
|
+
async function R() {
|
|
3584
|
+
await ae(), k();
|
|
3575
3585
|
}
|
|
3576
|
-
function
|
|
3586
|
+
function j() {
|
|
3577
3587
|
L && clearTimeout(L), L = setTimeout(() => {
|
|
3578
|
-
L = void 0,
|
|
3588
|
+
L = void 0, ae().then(() => k());
|
|
3579
3589
|
}, 0);
|
|
3580
3590
|
}
|
|
3581
|
-
function
|
|
3582
|
-
const
|
|
3583
|
-
return Object.keys(
|
|
3584
|
-
const Y = t.fields.find((
|
|
3585
|
-
if (!(
|
|
3586
|
-
if (typeof
|
|
3587
|
-
|
|
3591
|
+
function Z(H) {
|
|
3592
|
+
const B = {};
|
|
3593
|
+
return Object.keys(H).forEach((W) => {
|
|
3594
|
+
const Y = t.fields.find((fe) => fe.key === W), ee = H[W], J = typeof ee == "string" ? ee.trim() : ee;
|
|
3595
|
+
if (!(J == null || J === "")) {
|
|
3596
|
+
if (typeof J == "object" && J.startDate && J.endDate) {
|
|
3597
|
+
J.startDate && J.endDate && (B[W] = J);
|
|
3588
3598
|
return;
|
|
3589
3599
|
}
|
|
3590
3600
|
if (Y && (Y.type === "date" || Y.type === "daterange")) {
|
|
3591
|
-
|
|
3601
|
+
J !== 0 && (B[W] = J);
|
|
3592
3602
|
return;
|
|
3593
3603
|
}
|
|
3594
|
-
|
|
3604
|
+
B[W] = J;
|
|
3595
3605
|
}
|
|
3596
|
-
}),
|
|
3606
|
+
}), B;
|
|
3597
3607
|
}
|
|
3598
|
-
function
|
|
3599
|
-
const
|
|
3600
|
-
return Object.keys(
|
|
3601
|
-
const Y = W
|
|
3608
|
+
function se(H) {
|
|
3609
|
+
const B = {};
|
|
3610
|
+
return Object.keys(H).forEach((W) => {
|
|
3611
|
+
const Y = H[W], ee = t.fields.find((J) => J.key === W);
|
|
3602
3612
|
if (ee)
|
|
3603
3613
|
if (ee.type === "daterange" && typeof Y == "object") {
|
|
3604
|
-
const
|
|
3605
|
-
Y.startDate && Y.endDate && Y.startDate !== 0 && Y.endDate !== 0 && (ee.format === "timestamp" ? (
|
|
3606
|
-
} else ee.type === "date" && Y && Y !== 0 && ee.format === "timestamp" ?
|
|
3614
|
+
const J = ee.startKey || `${W}Start`, fe = ee.endKey || `${W}End`;
|
|
3615
|
+
Y.startDate && Y.endDate && Y.startDate !== 0 && Y.endDate !== 0 && (ee.format === "timestamp" ? (B[J] = new Date(Y.startDate).getTime(), B[fe] = new Date(Y.endDate).getTime()) : (B[J] = Y.startDate, B[fe] = Y.endDate));
|
|
3616
|
+
} else ee.type === "date" && Y && Y !== 0 && ee.format === "timestamp" ? B[W] = new Date(Y).getTime() : B[W] = Y;
|
|
3607
3617
|
else
|
|
3608
|
-
|
|
3609
|
-
}),
|
|
3618
|
+
B[W] = Y;
|
|
3619
|
+
}), B;
|
|
3610
3620
|
}
|
|
3611
|
-
function
|
|
3612
|
-
t.fields.forEach((
|
|
3613
|
-
var
|
|
3614
|
-
|
|
3621
|
+
function G() {
|
|
3622
|
+
t.fields.forEach((H) => {
|
|
3623
|
+
var B, W, Y;
|
|
3624
|
+
y[H.key] === void 0 && (H.type === "daterange" ? y[H.key] = ((B = t.modelValue) == null ? void 0 : B[H.key]) || {
|
|
3615
3625
|
startDate: null,
|
|
3616
3626
|
endDate: null
|
|
3617
|
-
} :
|
|
3627
|
+
} : H.type === "date" ? y[H.key] = ((W = t.modelValue) == null ? void 0 : W[H.key]) || null : y[H.key] = ((Y = t.modelValue) == null ? void 0 : Y[H.key]) || "");
|
|
3618
3628
|
});
|
|
3619
3629
|
}
|
|
3620
3630
|
return oe(
|
|
3621
3631
|
() => t.modelValue,
|
|
3622
|
-
(
|
|
3623
|
-
|
|
3632
|
+
(H) => {
|
|
3633
|
+
H && Object.assign(y, H);
|
|
3624
3634
|
},
|
|
3625
3635
|
{ deep: !0, immediate: !0 }
|
|
3626
|
-
),
|
|
3627
|
-
|
|
3636
|
+
), De(() => {
|
|
3637
|
+
G();
|
|
3628
3638
|
}), Xe(() => {
|
|
3629
3639
|
L && (clearTimeout(L), L = void 0);
|
|
3630
|
-
}), (
|
|
3631
|
-
o("div",
|
|
3640
|
+
}), (H, B) => (i(), u("div", bo, [
|
|
3641
|
+
o("div", ko, [
|
|
3632
3642
|
o("div", xo, [
|
|
3633
3643
|
o("div", $o, [
|
|
3634
3644
|
de(it, {
|
|
@@ -3636,27 +3646,27 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3636
3646
|
tag: "div",
|
|
3637
3647
|
class: "query-encapsulation__fields-group"
|
|
3638
3648
|
}, {
|
|
3639
|
-
default:
|
|
3640
|
-
(i(!0), u(
|
|
3641
|
-
key:
|
|
3649
|
+
default: ve(() => [
|
|
3650
|
+
(i(!0), u(ue, null, he(I.value, (W) => (i(), u("div", {
|
|
3651
|
+
key: W.key,
|
|
3642
3652
|
class: "query-encapsulation__field-item"
|
|
3643
3653
|
}, [
|
|
3644
3654
|
o("div", Co, [
|
|
3645
|
-
e.Iflabel ? (i(), u("label", Do,
|
|
3646
|
-
(i(),
|
|
3647
|
-
modelValue:
|
|
3648
|
-
"onUpdate:modelValue": (Y) =>
|
|
3649
|
-
placeholder:
|
|
3650
|
-
options:
|
|
3651
|
-
clearable:
|
|
3652
|
-
size:
|
|
3653
|
-
width:
|
|
3654
|
-
format:
|
|
3655
|
-
"include-time":
|
|
3656
|
-
filterable:
|
|
3657
|
-
}, ct(
|
|
3658
|
-
onInput: (Y) => g(
|
|
3659
|
-
onChange: (Y) => g(
|
|
3655
|
+
e.Iflabel ? (i(), u("label", Do, le(W.label), 1)) : K("", !0),
|
|
3656
|
+
(i(), Me(rt(w(W.type)), ut({
|
|
3657
|
+
modelValue: y[W.key],
|
|
3658
|
+
"onUpdate:modelValue": (Y) => y[W.key] = Y,
|
|
3659
|
+
placeholder: W.placeholder || `请输入${W.label}`,
|
|
3660
|
+
options: W.options,
|
|
3661
|
+
clearable: W.clearable !== !1,
|
|
3662
|
+
size: W.size || "small",
|
|
3663
|
+
width: W.width || "180px",
|
|
3664
|
+
format: W.format || "timestamp",
|
|
3665
|
+
"include-time": W.includeTime || !1,
|
|
3666
|
+
filterable: W.filterable === !0
|
|
3667
|
+
}, ct(P(W)), {
|
|
3668
|
+
onInput: (Y) => g(W),
|
|
3669
|
+
onChange: (Y) => g(W)
|
|
3660
3670
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3661
3671
|
])
|
|
3662
3672
|
]))), 128))
|
|
@@ -3667,27 +3677,27 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3667
3677
|
de(Ne, {
|
|
3668
3678
|
variant: "secondary",
|
|
3669
3679
|
size: "small",
|
|
3670
|
-
onClick:
|
|
3680
|
+
onClick: O
|
|
3671
3681
|
}, {
|
|
3672
|
-
default:
|
|
3673
|
-
|
|
3682
|
+
default: ve(() => [
|
|
3683
|
+
Ce(le(m.value ? "收起" : "展开") + " ", 1),
|
|
3674
3684
|
o("span", {
|
|
3675
|
-
class:
|
|
3685
|
+
class: z(["query-encapsulation__toggle-icon", { "is-expanded": m.value }])
|
|
3676
3686
|
}, "▼", 2)
|
|
3677
3687
|
]),
|
|
3678
3688
|
_: 1
|
|
3679
3689
|
})
|
|
3680
|
-
])) :
|
|
3690
|
+
])) : K("", !0),
|
|
3681
3691
|
o("div", So, [
|
|
3682
3692
|
o("div", Lo, [
|
|
3683
3693
|
de(Ne, {
|
|
3684
3694
|
variant: "primary",
|
|
3685
3695
|
size: "small",
|
|
3686
|
-
onClick:
|
|
3696
|
+
onClick: k,
|
|
3687
3697
|
loading: e.loading
|
|
3688
3698
|
}, {
|
|
3689
|
-
default:
|
|
3690
|
-
|
|
3699
|
+
default: ve(() => [...B[0] || (B[0] = [
|
|
3700
|
+
Ce(" 搜索 ", -1)
|
|
3691
3701
|
])]),
|
|
3692
3702
|
_: 1
|
|
3693
3703
|
}, 8, ["loading"]),
|
|
@@ -3697,12 +3707,12 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3697
3707
|
onClick: V,
|
|
3698
3708
|
loading: e.loading
|
|
3699
3709
|
}, {
|
|
3700
|
-
default:
|
|
3701
|
-
|
|
3710
|
+
default: ve(() => [...B[1] || (B[1] = [
|
|
3711
|
+
Ce(" 重置 ", -1)
|
|
3702
3712
|
])]),
|
|
3703
3713
|
_: 1
|
|
3704
3714
|
}, 8, ["loading"]),
|
|
3705
|
-
ce(
|
|
3715
|
+
ce(H.$slots, "extra-actions", {}, void 0, !0)
|
|
3706
3716
|
])
|
|
3707
3717
|
])
|
|
3708
3718
|
])
|
|
@@ -3710,7 +3720,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3710
3720
|
])
|
|
3711
3721
|
]));
|
|
3712
3722
|
}
|
|
3713
|
-
}), Io = /* @__PURE__ */
|
|
3723
|
+
}), Io = /* @__PURE__ */ be(Mo, [["__scopeId", "data-v-61f05ecd"]]), Eo = {
|
|
3714
3724
|
key: 0,
|
|
3715
3725
|
width: "16",
|
|
3716
3726
|
height: "16",
|
|
@@ -3728,7 +3738,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3728
3738
|
height: "16",
|
|
3729
3739
|
viewBox: "0 0 24 24",
|
|
3730
3740
|
fill: "none"
|
|
3731
|
-
},
|
|
3741
|
+
}, zo = ["textContent"], Ko = /* @__PURE__ */ we({
|
|
3732
3742
|
__name: "ymessageToast",
|
|
3733
3743
|
props: {
|
|
3734
3744
|
id: {},
|
|
@@ -3743,7 +3753,7 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3743
3753
|
setup(e) {
|
|
3744
3754
|
const $ = e, t = E(!1);
|
|
3745
3755
|
let n;
|
|
3746
|
-
|
|
3756
|
+
De(() => {
|
|
3747
3757
|
requestAnimationFrame(() => {
|
|
3748
3758
|
t.value = !0, $.duration && $.duration > 0 && (n = window.setTimeout(() => m(), $.duration));
|
|
3749
3759
|
});
|
|
@@ -3753,23 +3763,23 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3753
3763
|
function m() {
|
|
3754
3764
|
t.value = !1;
|
|
3755
3765
|
}
|
|
3756
|
-
function
|
|
3757
|
-
var
|
|
3758
|
-
(
|
|
3766
|
+
function y() {
|
|
3767
|
+
var p;
|
|
3768
|
+
(p = $.onClose) == null || p.call($, $.id);
|
|
3759
3769
|
}
|
|
3760
|
-
return (
|
|
3770
|
+
return (p, L) => (i(), Me($e, {
|
|
3761
3771
|
name: "y-msg-fade",
|
|
3762
|
-
onAfterLeave:
|
|
3772
|
+
onAfterLeave: y
|
|
3763
3773
|
}, {
|
|
3764
|
-
default:
|
|
3774
|
+
default: ve(() => [
|
|
3765
3775
|
Ee(o("div", {
|
|
3766
|
-
class:
|
|
3767
|
-
style:
|
|
3776
|
+
class: z(["y-msg", [`y-msg--${e.type}`]]),
|
|
3777
|
+
style: ie({ zIndex: e.zIndex }),
|
|
3768
3778
|
role: "status",
|
|
3769
3779
|
"aria-live": "polite"
|
|
3770
3780
|
}, [
|
|
3771
3781
|
o("span", {
|
|
3772
|
-
class:
|
|
3782
|
+
class: z(["y-msg__icon", `y-msg__icon--${e.type}`]),
|
|
3773
3783
|
"aria-hidden": "true"
|
|
3774
3784
|
}, [
|
|
3775
3785
|
e.type === "success" ? (i(), u("svg", Eo, [...L[0] || (L[0] = [
|
|
@@ -3800,64 +3810,64 @@ const dt = ["type", "disabled", "aria-busy", "aria-disabled"], ft = { class: "co
|
|
|
3800
3810
|
], 2),
|
|
3801
3811
|
o("div", {
|
|
3802
3812
|
class: "y-msg__content",
|
|
3803
|
-
textContent:
|
|
3804
|
-
}, null, 8,
|
|
3813
|
+
textContent: le(e.message)
|
|
3814
|
+
}, null, 8, zo),
|
|
3805
3815
|
e.closable ? (i(), u("button", {
|
|
3806
3816
|
key: 0,
|
|
3807
3817
|
class: "y-msg__close",
|
|
3808
3818
|
type: "button",
|
|
3809
3819
|
onClick: m
|
|
3810
|
-
}, "✕")) :
|
|
3820
|
+
}, "✕")) : K("", !0)
|
|
3811
3821
|
], 6), [
|
|
3812
|
-
[
|
|
3822
|
+
[Ke, t.value]
|
|
3813
3823
|
])
|
|
3814
3824
|
]),
|
|
3815
3825
|
_: 1
|
|
3816
3826
|
}));
|
|
3817
3827
|
}
|
|
3818
|
-
}), Ho = /* @__PURE__ */
|
|
3819
|
-
let
|
|
3820
|
-
const Ue = 12,
|
|
3821
|
-
function
|
|
3828
|
+
}), Ho = /* @__PURE__ */ be(Ko, [["__scopeId", "data-v-c5dc221c"]]);
|
|
3829
|
+
let Ao = 1;
|
|
3830
|
+
const Ue = 12, Le = [];
|
|
3831
|
+
function Ro() {
|
|
3822
3832
|
let e = 20;
|
|
3823
|
-
return
|
|
3833
|
+
return Le.forEach(($) => {
|
|
3824
3834
|
e += $.height + Ue;
|
|
3825
3835
|
}), e;
|
|
3826
3836
|
}
|
|
3827
3837
|
function Qe(e) {
|
|
3828
|
-
const $ =
|
|
3838
|
+
const $ = Le.findIndex((y) => y.id === e);
|
|
3829
3839
|
if ($ === -1) return;
|
|
3830
|
-
const { el: t } =
|
|
3840
|
+
const { el: t } = Le[$], n = t.firstElementChild;
|
|
3831
3841
|
if (n) {
|
|
3832
|
-
const
|
|
3833
|
-
n.style.top =
|
|
3842
|
+
const y = window.getComputedStyle(n).top;
|
|
3843
|
+
n.style.top = y, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3834
3844
|
}
|
|
3835
|
-
|
|
3845
|
+
Le[$].leaving = !0, je(), setTimeout(() => {
|
|
3836
3846
|
Ge(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3837
|
-
const
|
|
3838
|
-
|
|
3847
|
+
const y = Le.findIndex((p) => p.id === e);
|
|
3848
|
+
y !== -1 && Le.splice(y, 1), je();
|
|
3839
3849
|
}, 260);
|
|
3840
3850
|
}
|
|
3841
3851
|
function qe(e) {
|
|
3842
|
-
var
|
|
3843
|
-
const $ =
|
|
3852
|
+
var y;
|
|
3853
|
+
const $ = Ao++, t = document.createElement("div");
|
|
3844
3854
|
document.body.appendChild(t);
|
|
3845
3855
|
const n = de(Ho, {
|
|
3846
3856
|
id: $,
|
|
3847
3857
|
type: e.type || "success",
|
|
3848
3858
|
message: e.message,
|
|
3849
3859
|
duration: e.duration ?? 2500,
|
|
3850
|
-
offset:
|
|
3860
|
+
offset: Ro(),
|
|
3851
3861
|
zIndex: 3e3 + $,
|
|
3852
3862
|
closable: e.closable ?? !1,
|
|
3853
|
-
onClose: (
|
|
3863
|
+
onClose: (p) => Qe(p)
|
|
3854
3864
|
});
|
|
3855
3865
|
Ge(n, t);
|
|
3856
|
-
const m = ((
|
|
3857
|
-
return
|
|
3858
|
-
const
|
|
3859
|
-
if (!
|
|
3860
|
-
const L =
|
|
3866
|
+
const m = ((y = t.firstElementChild) == null ? void 0 : y.offsetHeight) || 0;
|
|
3867
|
+
return Le.push({ id: $, el: t, vm: n, height: m, leaving: !1 }), je(), requestAnimationFrame(() => {
|
|
3868
|
+
const p = t.firstElementChild;
|
|
3869
|
+
if (!p) return;
|
|
3870
|
+
const L = p.offsetHeight || m || 0, C = Le.find((I) => I.id === $);
|
|
3861
3871
|
C && (C.height = L, je());
|
|
3862
3872
|
}), { close: () => Qe($) };
|
|
3863
3873
|
}
|
|
@@ -3875,7 +3885,7 @@ const Oe = {
|
|
|
3875
3885
|
typeof window < "u" && (window.YMessage = Oe, typeof globalThis.YMessage > "u" && (globalThis.YMessage = Oe));
|
|
3876
3886
|
function je() {
|
|
3877
3887
|
let e = 20;
|
|
3878
|
-
|
|
3888
|
+
Le.forEach(($) => {
|
|
3879
3889
|
const t = $.el.firstElementChild;
|
|
3880
3890
|
if (!t) return;
|
|
3881
3891
|
const n = e;
|