@nhdropshipping/y-components 1.0.2 → 1.0.3
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/ypagination.vue.d.ts.map +1 -1
- package/dist/components/ytable.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 +1177 -1171
- 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,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as me, computed as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as me, computed as U, createElementBlock as i, openBlock as a, normalizeClass as K, createElementVNode as n, renderSlot as de, Fragment as ue, renderList as ve, createCommentVNode as A, toDisplayString as G, normalizeStyle as ye, ref as R, watch as oe, nextTick as fe, onMounted as _e, onUnmounted as Ee, resolveComponent as Ye, createVNode as ce, Transition as ke, withCtx as he, createBlock as Le, createTextVNode as De, withKeys as be, withModifiers as J, withDirectives as Be, vModelText as tt, Teleport as Re, vShow as Ke, provide as nt, reactive as lt, TransitionGroup as ot, resolveDynamicComponent as at, onBeforeUnmount as st, render as Ze } from "vue";
|
|
2
|
+
const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "content" }, ut = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
5
5
|
role: "group"
|
|
6
|
-
},
|
|
6
|
+
}, dt = ["type", "disabled", "aria-busy", "aria-disabled", "aria-label", "onClick"], ct = { class: "content" }, ft = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "icon",
|
|
9
9
|
viewBox: "0 0 20 20",
|
|
10
10
|
fill: "currentColor",
|
|
11
11
|
"aria-hidden": "true"
|
|
12
|
-
},
|
|
12
|
+
}, vt = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "icon",
|
|
15
15
|
viewBox: "0 0 20 20",
|
|
16
16
|
fill: "currentColor",
|
|
17
17
|
"aria-hidden": "true"
|
|
18
|
-
},
|
|
18
|
+
}, ht = { key: 2 }, pt = /* @__PURE__ */ me({
|
|
19
19
|
__name: "ybutton",
|
|
20
20
|
props: {
|
|
21
21
|
htmlType: { default: "button" },
|
|
@@ -30,14 +30,14 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
30
30
|
emits: ["click", "group-click"],
|
|
31
31
|
setup(e, { emit: m }) {
|
|
32
32
|
const t = e, l = m;
|
|
33
|
-
function c(
|
|
33
|
+
function c(S) {
|
|
34
34
|
if (t.disabled || t.loading) {
|
|
35
|
-
|
|
35
|
+
S.preventDefault(), S.stopPropagation();
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
l("click",
|
|
38
|
+
l("click", S);
|
|
39
39
|
}
|
|
40
|
-
const s =
|
|
40
|
+
const s = U(() => {
|
|
41
41
|
switch (t.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,20 +48,20 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}), k =
|
|
52
|
-
function
|
|
53
|
-
if (t.disabled || t.loading ||
|
|
54
|
-
|
|
51
|
+
}), k = U(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
|
+
function _(S, L) {
|
|
53
|
+
if (t.disabled || t.loading || S.disabled || S.loading) {
|
|
54
|
+
L.preventDefault(), L.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
l("group-click",
|
|
57
|
+
l("group-click", S.value, L);
|
|
58
58
|
}
|
|
59
|
-
return (
|
|
60
|
-
(a(!0), i(
|
|
59
|
+
return (S, L) => k.value ? (a(), i("div", ut, [
|
|
60
|
+
(a(!0), i(ue, null, ve(e.groupItems, (h, d) => {
|
|
61
61
|
var u;
|
|
62
62
|
return a(), i("button", {
|
|
63
63
|
key: h.value ?? d,
|
|
64
|
-
class:
|
|
64
|
+
class: K(["y-btn", [
|
|
65
65
|
`y-btn--${h.variant ?? e.variant}`,
|
|
66
66
|
`y-btn--${h.size ?? e.size}`,
|
|
67
67
|
"is-grouped",
|
|
@@ -73,29 +73,29 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
73
73
|
"aria-busy": h.loading || e.loading ? "true" : "false",
|
|
74
74
|
"aria-disabled": (h.disabled ?? !1) || e.disabled || e.loading || h.loading ? "true" : "false",
|
|
75
75
|
"aria-label": h.ariaLabel || h.label,
|
|
76
|
-
onClick: (
|
|
76
|
+
onClick: (E) => _(h, E)
|
|
77
77
|
}, [
|
|
78
|
-
n("span",
|
|
79
|
-
h.icon === "chevron-left" ? (a(), i("svg",
|
|
78
|
+
n("span", ct, [
|
|
79
|
+
h.icon === "chevron-left" ? (a(), i("svg", ft, [...L[0] || (L[0] = [
|
|
80
80
|
n("path", {
|
|
81
81
|
"fill-rule": "evenodd",
|
|
82
82
|
d: "M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z",
|
|
83
83
|
"clip-rule": "evenodd"
|
|
84
84
|
}, null, -1)
|
|
85
|
-
])])) : h.icon === "chevron-right" ? (a(), i("svg",
|
|
85
|
+
])])) : h.icon === "chevron-right" ? (a(), i("svg", vt, [...L[1] || (L[1] = [
|
|
86
86
|
n("path", {
|
|
87
87
|
"fill-rule": "evenodd",
|
|
88
88
|
d: "M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z",
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
91
|
])])) : A("", !0),
|
|
92
|
-
h.label && !h.onlyIcon ? (a(), i("span",
|
|
92
|
+
h.label && !h.onlyIcon ? (a(), i("span", ht, G(h.label), 1)) : A("", !0)
|
|
93
93
|
])
|
|
94
|
-
], 10,
|
|
94
|
+
], 10, dt);
|
|
95
95
|
}), 128))
|
|
96
96
|
])) : (a(), i("button", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class:
|
|
98
|
+
class: K(["y-btn", [
|
|
99
99
|
`y-btn--${e.variant}`,
|
|
100
100
|
`y-btn--${e.size}`,
|
|
101
101
|
{ "is-block": e.block, "is-loading": e.loading },
|
|
@@ -108,17 +108,17 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
108
108
|
"aria-disabled": e.disabled || e.loading ? "true" : "false",
|
|
109
109
|
onClick: c
|
|
110
110
|
}, [
|
|
111
|
-
n("span",
|
|
112
|
-
|
|
111
|
+
n("span", rt, [
|
|
112
|
+
de(S.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
|
-
], 10,
|
|
114
|
+
], 10, it));
|
|
115
115
|
}
|
|
116
116
|
}), we = (e, m) => {
|
|
117
117
|
const t = e.__vccOpts || e;
|
|
118
118
|
for (const [l, c] of m)
|
|
119
119
|
t[l] = c;
|
|
120
120
|
return t;
|
|
121
|
-
},
|
|
121
|
+
}, Ae = /* @__PURE__ */ we(pt, [["__scopeId", "data-v-0c27d1bc"]]), gt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "disabled", "required", "value"], yt = /* @__PURE__ */ me({
|
|
122
122
|
__name: "yinput",
|
|
123
123
|
props: {
|
|
124
124
|
modelValue: { default: "" },
|
|
@@ -142,11 +142,11 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
142
142
|
t("update:modelValue", s.value);
|
|
143
143
|
}
|
|
144
144
|
return (c, s) => (a(), i("div", {
|
|
145
|
-
class:
|
|
145
|
+
class: K(["y-input-wrap", { "is-block": e.block }]),
|
|
146
146
|
style: ye({ width: e.width })
|
|
147
147
|
}, [
|
|
148
148
|
n("input", {
|
|
149
|
-
class:
|
|
149
|
+
class: K(["y-input", `y-input--${e.size}`]),
|
|
150
150
|
id: e.id,
|
|
151
151
|
name: e.name,
|
|
152
152
|
type: e.type,
|
|
@@ -157,10 +157,436 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
157
157
|
required: e.required,
|
|
158
158
|
value: e.modelValue,
|
|
159
159
|
onInput: l
|
|
160
|
-
}, null, 42,
|
|
160
|
+
}, null, 42, gt)
|
|
161
161
|
], 6));
|
|
162
162
|
}
|
|
163
|
-
}), Qe = /* @__PURE__ */ we(
|
|
163
|
+
}), Qe = /* @__PURE__ */ we(yt, [["__scopeId", "data-v-9e6869ef"]]), mt = {
|
|
164
|
+
key: 0,
|
|
165
|
+
class: "bulk-bar"
|
|
166
|
+
}, wt = { class: "bulk-left" }, bt = { class: "bulk-actions" }, kt = { class: "card" }, xt = { class: "table" }, Dt = {
|
|
167
|
+
key: 0,
|
|
168
|
+
style: { width: "40px", "min-width": "40px" }
|
|
169
|
+
}, $t = {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "col-select"
|
|
172
|
+
}, Ct = ["checked"], _t = {
|
|
173
|
+
key: 0,
|
|
174
|
+
class: "loading-overlay"
|
|
175
|
+
}, Mt = {
|
|
176
|
+
key: 1,
|
|
177
|
+
class: "empty-overlay"
|
|
178
|
+
}, St = {
|
|
179
|
+
key: 0,
|
|
180
|
+
style: { width: "40px", "min-width": "40px" }
|
|
181
|
+
}, Lt = {
|
|
182
|
+
key: 0,
|
|
183
|
+
class: "col-select"
|
|
184
|
+
}, It = ["value", "checked", "onChange"], Bt = /* @__PURE__ */ me({
|
|
185
|
+
__name: "ytable",
|
|
186
|
+
props: {
|
|
187
|
+
data: {},
|
|
188
|
+
columns: {},
|
|
189
|
+
selectable: { type: Boolean, default: !1 },
|
|
190
|
+
showBulkActions: { type: Boolean, default: !1 },
|
|
191
|
+
pagination: { type: Boolean, default: !0 },
|
|
192
|
+
pageSize: { default: 10 },
|
|
193
|
+
currentPage: {},
|
|
194
|
+
total: {},
|
|
195
|
+
loading: { type: Boolean, default: !1 },
|
|
196
|
+
pageSizeOptions: { default: () => [
|
|
197
|
+
{ label: "1/页", value: 1 },
|
|
198
|
+
{ label: "20/页", value: 20 },
|
|
199
|
+
{ label: "50/页", value: 50 },
|
|
200
|
+
{ label: "100/页", value: 100 }
|
|
201
|
+
] },
|
|
202
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
203
|
+
emptyText: { default: "无数据" },
|
|
204
|
+
searchKeyword: { default: "" },
|
|
205
|
+
searchFields: { default: () => [] },
|
|
206
|
+
stickyHeader: { type: Boolean, default: !1 }
|
|
207
|
+
},
|
|
208
|
+
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
209
|
+
setup(e, { emit: m }) {
|
|
210
|
+
const t = e, l = m, c = R(t.currentPage || 1), s = R(t.pageSize), k = R([]), _ = R("none"), S = R(), L = R(), h = R(), d = R(), u = R([]), E = R(), N = R({
|
|
211
|
+
show: !1,
|
|
212
|
+
thumbHeight: 40,
|
|
213
|
+
thumbTop: 0
|
|
214
|
+
});
|
|
215
|
+
let q = !1, P = 0, C = 0;
|
|
216
|
+
const V = R(0), H = U(() => {
|
|
217
|
+
if (!t.searchKeyword || !t.searchFields.length)
|
|
218
|
+
return t.data;
|
|
219
|
+
const x = t.searchKeyword.toLowerCase();
|
|
220
|
+
return t.data.filter((B) => t.searchFields.some((z) => {
|
|
221
|
+
const $ = y(B, z);
|
|
222
|
+
return String($).toLowerCase().includes(x);
|
|
223
|
+
}));
|
|
224
|
+
}), T = U(() => (t.pagination, H.value)), Z = U(() => {
|
|
225
|
+
if (!t.selectable) return !1;
|
|
226
|
+
const x = T.value.map((B, z) => ae(B, z));
|
|
227
|
+
return x.length > 0 && x.every((B) => k.value.includes(B));
|
|
228
|
+
}), te = U(() => {
|
|
229
|
+
const x = [];
|
|
230
|
+
let B = t.selectable ? 40 : 0;
|
|
231
|
+
for (let z = 0; z < t.columns.length; z++) {
|
|
232
|
+
const $ = t.columns[z];
|
|
233
|
+
if ($.fixed === "left") {
|
|
234
|
+
let O = 80;
|
|
235
|
+
if ($.width) {
|
|
236
|
+
const Q = parseFloat($.width);
|
|
237
|
+
O = isNaN(Q) ? 80 : Q;
|
|
238
|
+
} else if (u.value[z]) {
|
|
239
|
+
const Q = parseFloat(u.value[z]);
|
|
240
|
+
O = isNaN(Q) ? 80 : Q;
|
|
241
|
+
}
|
|
242
|
+
x.push(B), B += O;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return x;
|
|
246
|
+
}), X = U(() => {
|
|
247
|
+
const x = [];
|
|
248
|
+
let B = 0;
|
|
249
|
+
const z = [];
|
|
250
|
+
for (let $ = t.columns.length - 1; $ >= 0; $--) {
|
|
251
|
+
const O = t.columns[$];
|
|
252
|
+
if (O.fixed === "right") {
|
|
253
|
+
let Q = 80;
|
|
254
|
+
if (O.width) {
|
|
255
|
+
const ie = parseFloat(O.width);
|
|
256
|
+
Q = isNaN(ie) ? 80 : ie;
|
|
257
|
+
} else if (u.value[$]) {
|
|
258
|
+
const ie = parseFloat(u.value[$]);
|
|
259
|
+
Q = isNaN(ie) ? 80 : ie;
|
|
260
|
+
}
|
|
261
|
+
z.push({ index: $, width: Q });
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
for (let $ = 0; $ < z.length; $++)
|
|
265
|
+
x.push(B), B += z[$].width;
|
|
266
|
+
return x;
|
|
267
|
+
});
|
|
268
|
+
function pe(x, B) {
|
|
269
|
+
if (B === "left") {
|
|
270
|
+
let z = 0;
|
|
271
|
+
for (let $ = 0; $ < x; $++)
|
|
272
|
+
t.columns[$].fixed === "left" && z++;
|
|
273
|
+
return z;
|
|
274
|
+
} else {
|
|
275
|
+
let z = 0;
|
|
276
|
+
for (let $ = t.columns.length - 1; $ > x; $--)
|
|
277
|
+
t.columns[$].fixed === "right" && z++;
|
|
278
|
+
return z;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function ae(x, B) {
|
|
282
|
+
return typeof t.rowKey == "function" ? t.rowKey(x) : x[t.rowKey] || B;
|
|
283
|
+
}
|
|
284
|
+
function y(x, B) {
|
|
285
|
+
return B.split(".").reduce((z, $) => z == null ? void 0 : z[$], x);
|
|
286
|
+
}
|
|
287
|
+
function g(x, B = !1) {
|
|
288
|
+
const z = [];
|
|
289
|
+
return x.align && z.push(`text-${x.align}`), x.fixed === "right" && (z.push("col-fixed-right"), B && z.push("col-fixed-right-header")), x.fixed === "left" && (z.push("col-fixed-left"), B && z.push("col-fixed-left-header")), z.join(" ");
|
|
290
|
+
}
|
|
291
|
+
function v(x, B, z) {
|
|
292
|
+
const $ = {};
|
|
293
|
+
if (x.width ? ($.width = x.width, $.minWidth = x.width, $.maxWidth = x.width) : ($.width = "auto", $.minWidth = "80px", $.maxWidth = "none"), x.fixed === "left") {
|
|
294
|
+
const O = pe(B, "left"), Q = te.value[O] || 0;
|
|
295
|
+
$.left = `${Q}px`, $.zIndex = z ? `${10 + O}` : `${5 + O}`;
|
|
296
|
+
} else if (x.fixed === "right") {
|
|
297
|
+
const O = pe(B, "right"), Q = X.value[O] || 0;
|
|
298
|
+
z ? $.right = `${Q - 3}px` : $.right = `${Q}px`, $.zIndex = z ? `${10 + O}` : `${5 + O}`;
|
|
299
|
+
}
|
|
300
|
+
return $;
|
|
301
|
+
}
|
|
302
|
+
function f(x, B) {
|
|
303
|
+
const z = y(x, B.key);
|
|
304
|
+
return B.formatter ? B.formatter(z, x) : z || "";
|
|
305
|
+
}
|
|
306
|
+
function w(x) {
|
|
307
|
+
k.value.includes(x) ? k.value = k.value.filter((B) => B !== x) : k.value = [...k.value, x], l("select", k.value), l("update:selectedItems", k.value);
|
|
308
|
+
}
|
|
309
|
+
function b() {
|
|
310
|
+
const x = T.value.map((B, z) => ae(B, z));
|
|
311
|
+
if (x.every((B) => k.value.includes(B)))
|
|
312
|
+
k.value = k.value.filter((B) => !x.includes(B));
|
|
313
|
+
else {
|
|
314
|
+
const B = /* @__PURE__ */ new Set([...k.value, ...x]);
|
|
315
|
+
k.value = Array.from(B);
|
|
316
|
+
}
|
|
317
|
+
l("select", k.value), l("update:selectedItems", k.value);
|
|
318
|
+
}
|
|
319
|
+
function M() {
|
|
320
|
+
k.value = [], l("select", k.value), l("update:selectedItems", k.value);
|
|
321
|
+
}
|
|
322
|
+
oe(() => t.searchKeyword, () => {
|
|
323
|
+
c.value = 1;
|
|
324
|
+
}), oe(() => t.data, () => {
|
|
325
|
+
t.total || (c.value = 1);
|
|
326
|
+
}, { deep: !0 });
|
|
327
|
+
function F(x) {
|
|
328
|
+
c.value = x, l("page-change", x);
|
|
329
|
+
}
|
|
330
|
+
function p(x) {
|
|
331
|
+
s.value = x, c.value = 1, l("page-size-change", x);
|
|
332
|
+
}
|
|
333
|
+
oe(() => t.currentPage, (x) => {
|
|
334
|
+
const B = typeof x == "number" && x > 0 ? x : 1;
|
|
335
|
+
c.value !== B && (c.value = B);
|
|
336
|
+
}), oe(() => t.pageSize, (x) => {
|
|
337
|
+
const B = typeof x == "number" && x > 0 ? x : 10;
|
|
338
|
+
s.value !== B && (s.value = B);
|
|
339
|
+
});
|
|
340
|
+
function D() {
|
|
341
|
+
S.value && fe(() => {
|
|
342
|
+
const x = S.value.getBoundingClientRect(), B = window.innerHeight, z = x.top, $ = S.value.querySelector(".table-header"), O = $ ? $.offsetHeight : 40, Q = S.value.querySelector(".ypagination"), ie = Q ? Q.offsetHeight : 60, o = S.value.querySelector(".bulk-bar"), r = o ? o.offsetHeight : 0, I = O + ie + r + 20, W = B - z - I, le = Math.max(200, W), re = S.value.querySelector(".table-body-wrap .table");
|
|
343
|
+
re && (re.offsetHeight > W ? _.value = `${le}px` : _.value = "none");
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
let Y = !1;
|
|
347
|
+
function ne() {
|
|
348
|
+
!L.value || !h.value || Y || L.value.scrollLeft !== h.value.scrollLeft && (Y = !0, L.value.scrollLeft = h.value.scrollLeft, requestAnimationFrame(() => {
|
|
349
|
+
Y = !1;
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
function j() {
|
|
353
|
+
!L.value || !h.value || Y || h.value.scrollLeft !== L.value.scrollLeft && (Y = !0, h.value.scrollLeft = L.value.scrollLeft, requestAnimationFrame(() => {
|
|
354
|
+
Y = !1;
|
|
355
|
+
}));
|
|
356
|
+
}
|
|
357
|
+
function ee() {
|
|
358
|
+
fe(() => {
|
|
359
|
+
if (!h.value) return;
|
|
360
|
+
const x = h.value, B = x.scrollHeight, z = x.clientHeight, $ = x.scrollTop, O = B > z + 1;
|
|
361
|
+
if (N.value.show = O, !O) return;
|
|
362
|
+
const Q = 24, ie = z / B, o = E.value ? E.value.clientHeight : z, r = Math.max(Q, Math.floor(o * ie));
|
|
363
|
+
N.value.thumbHeight = r;
|
|
364
|
+
const I = Math.max(0, o - r), W = Math.max(1, B - z);
|
|
365
|
+
N.value.thumbTop = Math.min(I, Math.floor($ / W * I));
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function Ie(x) {
|
|
369
|
+
if (!q || !h.value || !E.value) return;
|
|
370
|
+
x.preventDefault();
|
|
371
|
+
const B = E.value.clientHeight, z = Math.max(0, B - N.value.thumbHeight), $ = h.value, O = $.scrollHeight, Q = $.clientHeight, ie = Math.max(1, O - Q), r = (x.clientY - P) / Math.max(1, z) * ie;
|
|
372
|
+
$.scrollTop = Math.min(ie, Math.max(0, C + r)), ee();
|
|
373
|
+
}
|
|
374
|
+
function $e() {
|
|
375
|
+
q = !1, window.removeEventListener("mousemove", Ie), window.removeEventListener("mouseup", $e);
|
|
376
|
+
}
|
|
377
|
+
function Ve() {
|
|
378
|
+
fe(() => {
|
|
379
|
+
var z;
|
|
380
|
+
if (u.value.length === t.columns.length && u.value.every(($) => !!$))
|
|
381
|
+
return;
|
|
382
|
+
const x = [];
|
|
383
|
+
for (const $ of t.columns)
|
|
384
|
+
if ($.width && typeof $.width == "string" && $.width.trim())
|
|
385
|
+
x.push($.width);
|
|
386
|
+
else {
|
|
387
|
+
const O = u.value[x.length];
|
|
388
|
+
x.push(O || "");
|
|
389
|
+
}
|
|
390
|
+
const B = (z = d.value) == null ? void 0 : z.querySelector("tbody tr");
|
|
391
|
+
if (B) {
|
|
392
|
+
const $ = t.selectable ? 1 : 0, O = Array.from(B.children);
|
|
393
|
+
for (let Q = 0; Q < t.columns.length; Q++)
|
|
394
|
+
if (!x[Q]) {
|
|
395
|
+
const ie = O[$ + Q];
|
|
396
|
+
if (ie) {
|
|
397
|
+
const o = ie.clientWidth;
|
|
398
|
+
x[Q] = (o > 0 ? o : 80) + "px";
|
|
399
|
+
} else
|
|
400
|
+
x[Q] = "80px";
|
|
401
|
+
}
|
|
402
|
+
} else
|
|
403
|
+
for (let $ = 0; $ < x.length; $++)
|
|
404
|
+
x[$] || (x[$] = u.value[$] || "80px");
|
|
405
|
+
u.value = x;
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
function He() {
|
|
409
|
+
D(), Ce();
|
|
410
|
+
}
|
|
411
|
+
oe(() => t.data, () => {
|
|
412
|
+
fe(() => {
|
|
413
|
+
D(), ne(), Ce();
|
|
414
|
+
});
|
|
415
|
+
}, { deep: !0 }), oe([c, s], () => {
|
|
416
|
+
fe(() => {
|
|
417
|
+
D(), ne(), Ce();
|
|
418
|
+
});
|
|
419
|
+
}), oe(() => t.columns, () => {
|
|
420
|
+
u.value = [], fe(() => {
|
|
421
|
+
Ve(), ne(), Ce();
|
|
422
|
+
});
|
|
423
|
+
}, { deep: !0 }), oe(() => k.value, () => {
|
|
424
|
+
fe(() => {
|
|
425
|
+
D(), Ce();
|
|
426
|
+
});
|
|
427
|
+
}, { deep: !0 }), oe(() => t.loading, () => {
|
|
428
|
+
fe(() => {
|
|
429
|
+
Ce();
|
|
430
|
+
});
|
|
431
|
+
}), _e(() => {
|
|
432
|
+
var x, B;
|
|
433
|
+
fe(() => {
|
|
434
|
+
D(), Ve(), Ce(), ee();
|
|
435
|
+
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (x = h.value) == null || x.addEventListener("scroll", () => {
|
|
436
|
+
ne(), ee(), Ce();
|
|
437
|
+
}, { passive: !0 }), (B = L.value) == null || B.addEventListener("scroll", () => {
|
|
438
|
+
j();
|
|
439
|
+
}, { passive: !0 }), fe(() => ne()), h.value && typeof ResizeObserver < "u" && (ze = new ResizeObserver(() => {
|
|
440
|
+
Ce();
|
|
441
|
+
}), ze.observe(h.value));
|
|
442
|
+
}), Ee(() => {
|
|
443
|
+
var x, B;
|
|
444
|
+
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (x = h.value) == null || x.removeEventListener("scroll", ne), (B = L.value) == null || B.removeEventListener("scroll", j), window.removeEventListener("mousemove", Ie), window.removeEventListener("mouseup", $e), ze && (ze.disconnect(), ze = null);
|
|
445
|
+
});
|
|
446
|
+
let Te = -1;
|
|
447
|
+
function Ce() {
|
|
448
|
+
!L.value || !h.value || requestAnimationFrame(() => {
|
|
449
|
+
if (!L.value || !h.value) return;
|
|
450
|
+
const x = h.value, B = Math.ceil(x.offsetWidth - x.clientWidth);
|
|
451
|
+
if (V.value = B, B !== Te) {
|
|
452
|
+
Te = B;
|
|
453
|
+
const z = L.value.querySelector(".table"), $ = d.value;
|
|
454
|
+
z && $ && (L.value.style.paddingRight = "0px", z.style.width = "", z.style.marginRight = "", B > 0 ? (L.value.style.paddingRight = `${B}px`, z.style.width = "100%", z.style.marginRight = `-${B}px`) : (L.value.style.paddingRight = "0px", z.style.width = "100%", z.style.marginRight = "0px"));
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
let ze = null;
|
|
459
|
+
return (x, B) => {
|
|
460
|
+
const z = Ye("YPagination");
|
|
461
|
+
return a(), i("div", {
|
|
462
|
+
class: "ytable-container",
|
|
463
|
+
ref_key: "tableContainer",
|
|
464
|
+
ref: S
|
|
465
|
+
}, [
|
|
466
|
+
ce(ke, { name: "bulk-slide" }, {
|
|
467
|
+
default: he(() => [
|
|
468
|
+
k.value.length && e.showBulkActions ? (a(), i("div", mt, [
|
|
469
|
+
n("div", wt, "已选择 " + G(k.value.length) + " 项", 1),
|
|
470
|
+
n("div", bt, [
|
|
471
|
+
de(x.$slots, "bulk-actions", {
|
|
472
|
+
selectedItems: k.value,
|
|
473
|
+
clearSelection: M
|
|
474
|
+
}, () => [
|
|
475
|
+
n("button", {
|
|
476
|
+
class: "btn",
|
|
477
|
+
onClick: M
|
|
478
|
+
}, "清除选择")
|
|
479
|
+
], !0)
|
|
480
|
+
])
|
|
481
|
+
])) : A("", !0)
|
|
482
|
+
]),
|
|
483
|
+
_: 3
|
|
484
|
+
}),
|
|
485
|
+
n("div", kt, [
|
|
486
|
+
n("div", {
|
|
487
|
+
class: "table-header",
|
|
488
|
+
ref_key: "headerRef",
|
|
489
|
+
ref: L
|
|
490
|
+
}, [
|
|
491
|
+
n("table", xt, [
|
|
492
|
+
n("colgroup", null, [
|
|
493
|
+
e.selectable ? (a(), i("col", Dt)) : A("", !0),
|
|
494
|
+
(a(!0), i(ue, null, ve(e.columns, ($, O) => (a(), i("col", {
|
|
495
|
+
key: $.key,
|
|
496
|
+
style: ye({ width: u.value[O] || void 0, minWidth: u.value[O] || "80px" })
|
|
497
|
+
}, null, 4))), 128))
|
|
498
|
+
]),
|
|
499
|
+
n("thead", null, [
|
|
500
|
+
n("tr", null, [
|
|
501
|
+
e.selectable ? (a(), i("th", $t, [
|
|
502
|
+
n("input", {
|
|
503
|
+
type: "checkbox",
|
|
504
|
+
checked: Z.value,
|
|
505
|
+
onChange: b
|
|
506
|
+
}, null, 40, Ct)
|
|
507
|
+
])) : A("", !0),
|
|
508
|
+
(a(!0), i(ue, null, ve(e.columns, ($, O) => (a(), i("th", {
|
|
509
|
+
key: $.key,
|
|
510
|
+
class: K(g($, !0)),
|
|
511
|
+
style: ye(v($, O, !0))
|
|
512
|
+
}, G($.title), 7))), 128))
|
|
513
|
+
])
|
|
514
|
+
])
|
|
515
|
+
])
|
|
516
|
+
], 512),
|
|
517
|
+
n("div", {
|
|
518
|
+
class: K(["table-body-wrap", { "is-loading": e.loading, "is-empty": !T.value.length && !e.loading }]),
|
|
519
|
+
ref_key: "bodyWrapRef",
|
|
520
|
+
ref: h,
|
|
521
|
+
style: ye({ maxHeight: _.value })
|
|
522
|
+
}, [
|
|
523
|
+
e.loading ? (a(), i("div", _t, [...B[2] || (B[2] = [
|
|
524
|
+
n("div", { class: "loading-spinner" }, null, -1),
|
|
525
|
+
n("div", { class: "loading-text" }, "加载中...", -1)
|
|
526
|
+
])])) : A("", !0),
|
|
527
|
+
!T.value.length && !e.loading ? (a(), i("div", Mt, [
|
|
528
|
+
de(x.$slots, "empty", {}, () => [
|
|
529
|
+
De(G(e.emptyText), 1)
|
|
530
|
+
], !0)
|
|
531
|
+
])) : A("", !0),
|
|
532
|
+
n("table", {
|
|
533
|
+
class: K(["table", { "loading-table": e.loading }]),
|
|
534
|
+
ref_key: "bodyTableRef",
|
|
535
|
+
ref: d
|
|
536
|
+
}, [
|
|
537
|
+
n("colgroup", null, [
|
|
538
|
+
e.selectable ? (a(), i("col", St)) : A("", !0),
|
|
539
|
+
(a(!0), i(ue, null, ve(e.columns, ($, O) => (a(), i("col", {
|
|
540
|
+
key: $.key,
|
|
541
|
+
style: ye({ width: u.value[O] || void 0, minWidth: u.value[O] || "80px" })
|
|
542
|
+
}, null, 4))), 128))
|
|
543
|
+
]),
|
|
544
|
+
n("tbody", null, [
|
|
545
|
+
(a(!0), i(ue, null, ve(T.value, ($, O) => (a(), i("tr", {
|
|
546
|
+
key: ae($, O)
|
|
547
|
+
}, [
|
|
548
|
+
e.selectable ? (a(), i("td", Lt, [
|
|
549
|
+
n("input", {
|
|
550
|
+
type: "checkbox",
|
|
551
|
+
value: ae($, O),
|
|
552
|
+
checked: k.value.includes(ae($, O)),
|
|
553
|
+
onChange: (Q) => w(ae($, O))
|
|
554
|
+
}, null, 40, It)
|
|
555
|
+
])) : A("", !0),
|
|
556
|
+
(a(!0), i(ue, null, ve(e.columns, (Q, ie) => (a(), i("td", {
|
|
557
|
+
key: Q.key,
|
|
558
|
+
class: K(g(Q)),
|
|
559
|
+
style: ye(v(Q, ie, !1))
|
|
560
|
+
}, [
|
|
561
|
+
de(x.$slots, `cell-${Q.key}`, {
|
|
562
|
+
item: $,
|
|
563
|
+
value: y($, Q.key),
|
|
564
|
+
index: O
|
|
565
|
+
}, () => [
|
|
566
|
+
De(G(f($, Q)), 1)
|
|
567
|
+
], !0)
|
|
568
|
+
], 6))), 128))
|
|
569
|
+
]))), 128))
|
|
570
|
+
])
|
|
571
|
+
], 2)
|
|
572
|
+
], 6),
|
|
573
|
+
e.pagination ? (a(), Le(z, {
|
|
574
|
+
key: 0,
|
|
575
|
+
class: "align-right",
|
|
576
|
+
"current-page": c.value,
|
|
577
|
+
"onUpdate:currentPage": B[0] || (B[0] = ($) => c.value = $),
|
|
578
|
+
"page-size": s.value,
|
|
579
|
+
"onUpdate:pageSize": B[1] || (B[1] = ($) => s.value = $),
|
|
580
|
+
loading: t.loading,
|
|
581
|
+
"page-size-options": e.pageSizeOptions,
|
|
582
|
+
onPageChange: F,
|
|
583
|
+
onPageSizeChange: p
|
|
584
|
+
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : A("", !0)
|
|
585
|
+
])
|
|
586
|
+
], 512);
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
}), Et = /* @__PURE__ */ we(Bt, [["__scopeId", "data-v-c75c4929"]]), Tt = ["onKeydown", "aria-expanded"], zt = ["src"], Kt = ["placeholder", "onKeydown"], Ht = ["onClick", "onMouseenter"], Rt = ["src"], Vt = /* @__PURE__ */ me({
|
|
164
590
|
__name: "yselect",
|
|
165
591
|
props: {
|
|
166
592
|
modelValue: {},
|
|
@@ -179,25 +605,25 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
179
605
|
},
|
|
180
606
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
181
607
|
setup(e, { emit: m }) {
|
|
182
|
-
const t = e, l = m, c = R(!1), s = R(-1), k = R(),
|
|
608
|
+
const t = e, l = m, c = R(!1), s = R(-1), k = R(), _ = R(), S = R(), L = R(), h = R(!1), d = R(), u = R(""), E = U(() => t.options.find((p) => V(p) === t.modelValue) || null), N = U(() => E.value ? H(E.value) : ""), q = U(() => {
|
|
183
609
|
if (!t.filterable) return t.options;
|
|
184
610
|
const p = u.value.trim().toLowerCase();
|
|
185
611
|
return p ? t.options.filter((D) => {
|
|
186
|
-
const
|
|
187
|
-
return String(
|
|
612
|
+
const Y = H(D);
|
|
613
|
+
return String(Y).toLowerCase().includes(p);
|
|
188
614
|
}) : t.options;
|
|
189
|
-
}), P =
|
|
190
|
-
var
|
|
191
|
-
const p = { position: "fixed", zIndex: "4000" }, D =
|
|
615
|
+
}), P = U(() => {
|
|
616
|
+
var j;
|
|
617
|
+
const p = { position: "fixed", zIndex: "4000" }, D = _.value;
|
|
192
618
|
if (!D) return p;
|
|
193
|
-
const
|
|
194
|
-
return p.left = `${
|
|
619
|
+
const Y = D.getBoundingClientRect(), ne = ((j = S.value) == null ? void 0 : j.getBoundingClientRect().width) || Y.width;
|
|
620
|
+
return p.left = `${Y.left}px`, p.width = `${ne}px`, h.value ? (p.bottom = `${window.innerHeight - Y.top + 4}px`, p.top = "auto") : p.top = `${Y.bottom + 4}px`, p;
|
|
195
621
|
});
|
|
196
|
-
function
|
|
197
|
-
!c.value || !
|
|
198
|
-
const p =
|
|
622
|
+
function C() {
|
|
623
|
+
!c.value || !_.value || fe(() => {
|
|
624
|
+
const p = _.value;
|
|
199
625
|
if (!p) return;
|
|
200
|
-
const D = p.getBoundingClientRect(),
|
|
626
|
+
const D = p.getBoundingClientRect(), Y = window.innerHeight, ne = 200, j = D.bottom + ne + 4, ee = D.top - ne - 4, Ie = j <= Y - 20, $e = ee >= 20;
|
|
201
627
|
h.value = !Ie && $e;
|
|
202
628
|
});
|
|
203
629
|
}
|
|
@@ -210,7 +636,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
210
636
|
function T(p, D) {
|
|
211
637
|
return typeof p == "object" && p !== null && p.id !== void 0 ? p.id : V(p) || D;
|
|
212
638
|
}
|
|
213
|
-
function
|
|
639
|
+
function Z(p) {
|
|
214
640
|
return V(p) === t.modelValue;
|
|
215
641
|
}
|
|
216
642
|
function te(p) {
|
|
@@ -221,7 +647,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
221
647
|
}
|
|
222
648
|
function pe() {
|
|
223
649
|
t.disabled || (c.value = !0, fe(() => {
|
|
224
|
-
|
|
650
|
+
C(), w(), t.filterable && d.value && (d.value.focus(), u.value = "");
|
|
225
651
|
}));
|
|
226
652
|
}
|
|
227
653
|
function ae() {
|
|
@@ -229,8 +655,8 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
229
655
|
}
|
|
230
656
|
function y(p, D) {
|
|
231
657
|
if (te(p)) return;
|
|
232
|
-
const
|
|
233
|
-
l("update:modelValue",
|
|
658
|
+
const Y = V(p);
|
|
659
|
+
l("update:modelValue", Y), l("change", Y, p), ae();
|
|
234
660
|
}
|
|
235
661
|
function g() {
|
|
236
662
|
if (!t.clearable || t.disabled) return;
|
|
@@ -238,21 +664,21 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
238
664
|
l("update:modelValue", p), l("change", p, null), l("clear"), ae();
|
|
239
665
|
}
|
|
240
666
|
function v(p) {
|
|
241
|
-
if (!
|
|
667
|
+
if (!q.value || q.value.length === 0) {
|
|
242
668
|
s.value = -1;
|
|
243
669
|
return;
|
|
244
670
|
}
|
|
245
671
|
let D = s.value;
|
|
246
|
-
const
|
|
247
|
-
D === -1 ? D = p > 0 ? 0 :
|
|
672
|
+
const Y = q.value.length;
|
|
673
|
+
D === -1 ? D = p > 0 ? 0 : Y - 1 : D = (D + p + Y) % Y;
|
|
248
674
|
let ne = 0;
|
|
249
|
-
for (; ne <
|
|
250
|
-
D = (D + p +
|
|
251
|
-
s.value = ne >=
|
|
675
|
+
for (; ne < Y && te(q.value[D]); )
|
|
676
|
+
D = (D + p + Y) % Y, ne++;
|
|
677
|
+
s.value = ne >= Y ? -1 : D, b();
|
|
252
678
|
}
|
|
253
679
|
function f() {
|
|
254
680
|
if (s.value < 0) return;
|
|
255
|
-
const p =
|
|
681
|
+
const p = q.value[s.value];
|
|
256
682
|
!p || te(p) || y(p, s.value);
|
|
257
683
|
}
|
|
258
684
|
function w() {
|
|
@@ -267,39 +693,39 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
267
693
|
}
|
|
268
694
|
function M(p) {
|
|
269
695
|
const D = p.target;
|
|
270
|
-
(!
|
|
696
|
+
(!S.value || !S.value.contains(D)) && ae();
|
|
271
697
|
}
|
|
272
698
|
oe(() => t.modelValue, () => {
|
|
273
699
|
s.value = -1;
|
|
274
700
|
});
|
|
275
|
-
function
|
|
276
|
-
c.value &&
|
|
701
|
+
function F() {
|
|
702
|
+
c.value && C();
|
|
277
703
|
}
|
|
278
704
|
return _e(() => {
|
|
279
|
-
document.addEventListener("click", M), window.addEventListener("resize",
|
|
280
|
-
}),
|
|
281
|
-
document.removeEventListener("click", M), window.removeEventListener("resize",
|
|
705
|
+
document.addEventListener("click", M), window.addEventListener("resize", F), window.addEventListener("scroll", F, !0);
|
|
706
|
+
}), Ee(() => {
|
|
707
|
+
document.removeEventListener("click", M), window.removeEventListener("resize", F), window.removeEventListener("scroll", F, !0);
|
|
282
708
|
}), (p, D) => (a(), i("div", {
|
|
283
|
-
class:
|
|
709
|
+
class: K(["yselect", { "yselect--disabled": e.disabled, [`yselect--${e.size}`]: !0 }]),
|
|
284
710
|
style: ye({ width: e.width }),
|
|
285
711
|
ref_key: "selectContainer",
|
|
286
|
-
ref:
|
|
712
|
+
ref: S
|
|
287
713
|
}, [
|
|
288
714
|
n("div", {
|
|
289
715
|
ref_key: "triggerElement",
|
|
290
|
-
ref:
|
|
291
|
-
class:
|
|
716
|
+
ref: _,
|
|
717
|
+
class: K(["yselect__trigger", {
|
|
292
718
|
"yselect__trigger--open": c.value,
|
|
293
719
|
"yselect__trigger--disabled": e.disabled,
|
|
294
720
|
"yselect__trigger--error": e.error
|
|
295
721
|
}]),
|
|
296
|
-
onMousedown:
|
|
722
|
+
onMousedown: J(X, ["prevent", "stop"]),
|
|
297
723
|
onKeydown: [
|
|
298
|
-
be(
|
|
299
|
-
be(
|
|
724
|
+
be(J(X, ["prevent"]), ["enter"]),
|
|
725
|
+
be(J(X, ["prevent"]), ["space"]),
|
|
300
726
|
be(ae, ["escape"]),
|
|
301
|
-
be(
|
|
302
|
-
be(
|
|
727
|
+
be(J(pe, ["prevent"]), ["arrow-down"]),
|
|
728
|
+
be(J(pe, ["prevent"]), ["arrow-up"])
|
|
303
729
|
],
|
|
304
730
|
tabindex: "0",
|
|
305
731
|
role: "combobox",
|
|
@@ -308,52 +734,52 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
308
734
|
}, [
|
|
309
735
|
!e.filterable || !c.value ? (a(), i("span", {
|
|
310
736
|
key: 0,
|
|
311
|
-
class:
|
|
737
|
+
class: K(["yselect__value", { yselect__placeholder: !N.value }])
|
|
312
738
|
}, [
|
|
313
|
-
|
|
314
|
-
value:
|
|
315
|
-
label:
|
|
739
|
+
de(p.$slots, "value", {
|
|
740
|
+
value: E.value,
|
|
741
|
+
label: N.value
|
|
316
742
|
}, () => {
|
|
317
|
-
var
|
|
743
|
+
var Y;
|
|
318
744
|
return [
|
|
319
|
-
|
|
320
|
-
(
|
|
745
|
+
E.value ? (a(), i(ue, { key: 0 }, [
|
|
746
|
+
(Y = E.value) != null && Y.flagImg ? (a(), i("img", {
|
|
321
747
|
key: 0,
|
|
322
748
|
class: "yselect__flag",
|
|
323
|
-
src:
|
|
749
|
+
src: E.value.flagImg,
|
|
324
750
|
alt: "flag"
|
|
325
|
-
}, null, 8,
|
|
326
|
-
De(" " + G(
|
|
327
|
-
], 64)) : (a(), i(
|
|
751
|
+
}, null, 8, zt)) : A("", !0),
|
|
752
|
+
De(" " + G(N.value), 1)
|
|
753
|
+
], 64)) : (a(), i(ue, { key: 1 }, [
|
|
328
754
|
De(G(e.placeholder), 1)
|
|
329
755
|
], 64))
|
|
330
756
|
];
|
|
331
757
|
}, !0)
|
|
332
|
-
], 2)) :
|
|
758
|
+
], 2)) : Be((a(), i("input", {
|
|
333
759
|
key: 1,
|
|
334
760
|
ref_key: "inputElement",
|
|
335
761
|
ref: d,
|
|
336
762
|
class: "yselect__input",
|
|
337
763
|
type: "text",
|
|
338
|
-
placeholder:
|
|
339
|
-
"onUpdate:modelValue": D[0] || (D[0] = (
|
|
764
|
+
placeholder: N.value || e.placeholder,
|
|
765
|
+
"onUpdate:modelValue": D[0] || (D[0] = (Y) => u.value = Y),
|
|
340
766
|
onKeydown: [
|
|
341
|
-
D[1] || (D[1] =
|
|
767
|
+
D[1] || (D[1] = J(() => {
|
|
342
768
|
}, ["stop"])),
|
|
343
|
-
D[2] || (D[2] = be(
|
|
344
|
-
D[3] || (D[3] = be(
|
|
345
|
-
D[4] || (D[4] = be(
|
|
346
|
-
be(
|
|
347
|
-
be(
|
|
769
|
+
D[2] || (D[2] = be(J((Y) => v(1), ["prevent"]), ["arrow-down"])),
|
|
770
|
+
D[3] || (D[3] = be(J((Y) => v(-1), ["prevent"]), ["arrow-up"])),
|
|
771
|
+
D[4] || (D[4] = be(J((Y) => f(), ["prevent"]), ["enter"])),
|
|
772
|
+
be(J(ae, ["prevent"]), ["esc"]),
|
|
773
|
+
be(J(g, ["prevent"]), ["delete"])
|
|
348
774
|
]
|
|
349
|
-
}, null, 40,
|
|
775
|
+
}, null, 40, Kt)), [
|
|
350
776
|
[tt, u.value]
|
|
351
777
|
]),
|
|
352
|
-
e.clearable && !e.disabled &&
|
|
778
|
+
e.clearable && !e.disabled && E.value ? (a(), i("span", {
|
|
353
779
|
key: 2,
|
|
354
780
|
class: "yselect__clear",
|
|
355
781
|
title: "清空",
|
|
356
|
-
onClick:
|
|
782
|
+
onClick: J(g, ["stop"])
|
|
357
783
|
}, [...D[8] || (D[8] = [
|
|
358
784
|
n("svg", {
|
|
359
785
|
width: "12",
|
|
@@ -370,7 +796,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
370
796
|
], -1)
|
|
371
797
|
])])) : A("", !0),
|
|
372
798
|
n("span", {
|
|
373
|
-
class:
|
|
799
|
+
class: K(["yselect__arrow", { "yselect__arrow--open": c.value }])
|
|
374
800
|
}, [...D[9] || (D[9] = [
|
|
375
801
|
n("svg", {
|
|
376
802
|
width: "12",
|
|
@@ -387,19 +813,19 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
387
813
|
})
|
|
388
814
|
], -1)
|
|
389
815
|
])], 2)
|
|
390
|
-
], 42,
|
|
391
|
-
|
|
816
|
+
], 42, Tt),
|
|
817
|
+
ce(ke, { name: "yselect-dropdown" }, {
|
|
392
818
|
default: he(() => [
|
|
393
|
-
(a(), Le(
|
|
819
|
+
(a(), Le(Re, { to: "body" }, [
|
|
394
820
|
c.value ? (a(), i("div", {
|
|
395
821
|
key: 0,
|
|
396
822
|
ref_key: "dropdownEl",
|
|
397
|
-
ref:
|
|
398
|
-
class:
|
|
823
|
+
ref: L,
|
|
824
|
+
class: K(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": h.value }]),
|
|
399
825
|
style: ye(P.value),
|
|
400
|
-
onMousedown: D[6] || (D[6] =
|
|
826
|
+
onMousedown: D[6] || (D[6] = J(() => {
|
|
401
827
|
}, ["stop"])),
|
|
402
|
-
onClick: D[7] || (D[7] =
|
|
828
|
+
onClick: D[7] || (D[7] = J(() => {
|
|
403
829
|
}, ["stop"]))
|
|
404
830
|
}, [
|
|
405
831
|
n("div", {
|
|
@@ -407,31 +833,31 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
407
833
|
ref_key: "optionsContainer",
|
|
408
834
|
ref: k
|
|
409
835
|
}, [
|
|
410
|
-
(a(!0), i(
|
|
411
|
-
key: T(
|
|
412
|
-
class:
|
|
413
|
-
"yselect__option--selected":
|
|
414
|
-
"yselect__option--disabled": te(
|
|
836
|
+
(a(!0), i(ue, null, ve(q.value, (Y, ne) => (a(), i("div", {
|
|
837
|
+
key: T(Y, ne),
|
|
838
|
+
class: K(["yselect__option", {
|
|
839
|
+
"yselect__option--selected": Z(Y),
|
|
840
|
+
"yselect__option--disabled": te(Y),
|
|
415
841
|
"yselect__option--hover": s.value === ne
|
|
416
842
|
}]),
|
|
417
|
-
onClick: (
|
|
418
|
-
onMouseenter: (
|
|
419
|
-
onMouseleave: D[5] || (D[5] = (
|
|
843
|
+
onClick: (j) => y(Y),
|
|
844
|
+
onMouseenter: (j) => s.value = ne,
|
|
845
|
+
onMouseleave: D[5] || (D[5] = (j) => s.value = -1)
|
|
420
846
|
}, [
|
|
421
|
-
|
|
422
|
-
option:
|
|
847
|
+
de(p.$slots, "option", {
|
|
848
|
+
option: Y,
|
|
423
849
|
index: ne,
|
|
424
|
-
selected:
|
|
850
|
+
selected: Z(Y)
|
|
425
851
|
}, () => [
|
|
426
|
-
|
|
852
|
+
Y != null && Y.flagImg ? (a(), i("img", {
|
|
427
853
|
key: 0,
|
|
428
854
|
class: "yselect__flag",
|
|
429
|
-
src:
|
|
855
|
+
src: Y.flagImg,
|
|
430
856
|
alt: "flag"
|
|
431
|
-
}, null, 8,
|
|
432
|
-
De(" " + G(H(
|
|
857
|
+
}, null, 8, Rt)) : A("", !0),
|
|
858
|
+
De(" " + G(H(Y)), 1)
|
|
433
859
|
], !0)
|
|
434
|
-
], 42,
|
|
860
|
+
], 42, Ht))), 128))
|
|
435
861
|
], 512)
|
|
436
862
|
], 38)) : A("", !0)
|
|
437
863
|
]))
|
|
@@ -440,7 +866,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
440
866
|
})
|
|
441
867
|
], 6));
|
|
442
868
|
}
|
|
443
|
-
}),
|
|
869
|
+
}), Je = /* @__PURE__ */ we(Vt, [["__scopeId", "data-v-6cd47cb7"]]), At = { class: "ypagination" }, Yt = { class: "page-actions" }, Ft = { class: "page-size-select" }, Pt = /* @__PURE__ */ me({
|
|
444
870
|
__name: "ypagination",
|
|
445
871
|
props: {
|
|
446
872
|
currentPage: {},
|
|
@@ -455,488 +881,68 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
455
881
|
},
|
|
456
882
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
457
883
|
setup(e, { emit: m }) {
|
|
458
|
-
const t = e, l = m, c = R(t.pageSize), s =
|
|
884
|
+
const t = e, l = m, c = R(t.pageSize), s = U(() => t.pageSizeOptions), k = U({
|
|
459
885
|
get: () => t.currentPage,
|
|
460
886
|
set: (h) => {
|
|
461
887
|
l("update:currentPage", h), l("page-change", h);
|
|
462
888
|
}
|
|
463
889
|
});
|
|
464
|
-
function
|
|
890
|
+
function _(h) {
|
|
465
891
|
t.loading || h >= 1 && h !== t.currentPage && (k.value = h);
|
|
466
892
|
}
|
|
467
|
-
function
|
|
893
|
+
function S(h) {
|
|
468
894
|
t.loading || (c.value = h, l("update:pageSize", h), l("page-size-change", h), k.value = 1);
|
|
469
895
|
}
|
|
470
|
-
function
|
|
471
|
-
t.loading || (h === "prev" ?
|
|
896
|
+
function L(h) {
|
|
897
|
+
t.loading || (h === "prev" ? _(k.value - 1) : h === "next" && _(k.value + 1));
|
|
472
898
|
}
|
|
473
899
|
return c.value = t.pageSize, oe(
|
|
474
900
|
() => t.pageSize,
|
|
475
901
|
(h) => {
|
|
476
902
|
typeof h == "number" && c.value !== h && (c.value = h);
|
|
477
903
|
}
|
|
478
|
-
), (h, d) =>
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
disabled: k.value === 1 || e.loading,
|
|
484
|
-
onClick: d[0] || (d[0] = (u) => C(1))
|
|
485
|
-
}, {
|
|
486
|
-
default: he(() => [...d[2] || (d[2] = [
|
|
487
|
-
De("首页", -1)
|
|
488
|
-
])]),
|
|
489
|
-
_: 1
|
|
490
|
-
}, 8, ["disabled"]),
|
|
491
|
-
de(Re, {
|
|
492
|
-
class: "ml-1",
|
|
493
|
-
variant: "secondary",
|
|
494
|
-
size: "small",
|
|
495
|
-
groupItems: [
|
|
496
|
-
{ label: "上一页", value: "prev", disabled: k.value === 1 || e.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
497
|
-
{ label: "下一页", value: "next", disabled: e.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
498
|
-
],
|
|
499
|
-
onGroupClick: I
|
|
500
|
-
}, null, 8, ["groupItems"]),
|
|
501
|
-
n("div", Mt, [
|
|
502
|
-
de(je, {
|
|
503
|
-
modelValue: c.value,
|
|
504
|
-
"onUpdate:modelValue": d[1] || (d[1] = (u) => c.value = u),
|
|
505
|
-
options: s.value,
|
|
904
|
+
), (h, d) => {
|
|
905
|
+
const u = Ye("YButton"), E = Ye("YSelect");
|
|
906
|
+
return a(), i("div", At, [
|
|
907
|
+
n("div", Yt, [
|
|
908
|
+
ce(u, {
|
|
506
909
|
size: "small",
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
},
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}, Wt = ["value", "checked", "onChange"], Pt = /* @__PURE__ */ me({
|
|
538
|
-
__name: "ytable",
|
|
539
|
-
props: {
|
|
540
|
-
data: {},
|
|
541
|
-
columns: {},
|
|
542
|
-
selectable: { type: Boolean, default: !1 },
|
|
543
|
-
showBulkActions: { type: Boolean, default: !1 },
|
|
544
|
-
pagination: { type: Boolean, default: !0 },
|
|
545
|
-
pageSize: { default: 10 },
|
|
546
|
-
currentPage: {},
|
|
547
|
-
total: {},
|
|
548
|
-
loading: { type: Boolean, default: !1 },
|
|
549
|
-
pageSizeOptions: { default: () => [
|
|
550
|
-
{ label: "1/页", value: 1 },
|
|
551
|
-
{ label: "20/页", value: 20 },
|
|
552
|
-
{ label: "50/页", value: 50 },
|
|
553
|
-
{ label: "100/页", value: 100 }
|
|
554
|
-
] },
|
|
555
|
-
rowKey: { type: [String, Function], default: "id" },
|
|
556
|
-
emptyText: { default: "无数据" },
|
|
557
|
-
searchKeyword: { default: "" },
|
|
558
|
-
searchFields: { default: () => [] },
|
|
559
|
-
stickyHeader: { type: Boolean, default: !1 }
|
|
560
|
-
},
|
|
561
|
-
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
562
|
-
setup(e, { emit: m }) {
|
|
563
|
-
const t = e, l = m, c = R(t.currentPage || 1), s = R(t.pageSize), k = R([]), C = R("none"), L = R(), I = R(), h = R(), d = R(), u = R([]), K = R(), j = R({
|
|
564
|
-
show: !1,
|
|
565
|
-
thumbHeight: 40,
|
|
566
|
-
thumbTop: 0
|
|
567
|
-
});
|
|
568
|
-
let U = !1, P = 0, $ = 0;
|
|
569
|
-
const V = R(0), H = O(() => {
|
|
570
|
-
if (!t.searchKeyword || !t.searchFields.length)
|
|
571
|
-
return t.data;
|
|
572
|
-
const x = t.searchKeyword.toLowerCase();
|
|
573
|
-
return t.data.filter((B) => t.searchFields.some((_) => {
|
|
574
|
-
const S = y(B, _);
|
|
575
|
-
return String(S).toLowerCase().includes(x);
|
|
576
|
-
}));
|
|
577
|
-
}), T = O(() => (t.pagination, H.value)), q = O(() => {
|
|
578
|
-
if (!t.selectable) return !1;
|
|
579
|
-
const x = T.value.map((B, _) => ae(B, _));
|
|
580
|
-
return x.length > 0 && x.every((B) => k.value.includes(B));
|
|
581
|
-
}), te = O(() => {
|
|
582
|
-
const x = [];
|
|
583
|
-
let B = t.selectable ? 40 : 0;
|
|
584
|
-
for (let _ = 0; _ < t.columns.length; _++) {
|
|
585
|
-
const S = t.columns[_];
|
|
586
|
-
if (S.fixed === "left") {
|
|
587
|
-
let Z = 80;
|
|
588
|
-
if (S.width) {
|
|
589
|
-
const J = parseFloat(S.width);
|
|
590
|
-
Z = isNaN(J) ? 80 : J;
|
|
591
|
-
} else if (u.value[_]) {
|
|
592
|
-
const J = parseFloat(u.value[_]);
|
|
593
|
-
Z = isNaN(J) ? 80 : J;
|
|
594
|
-
}
|
|
595
|
-
x.push(B), B += Z;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
return x;
|
|
599
|
-
}), X = O(() => {
|
|
600
|
-
const x = [];
|
|
601
|
-
let B = 0;
|
|
602
|
-
const _ = [];
|
|
603
|
-
for (let S = t.columns.length - 1; S >= 0; S--) {
|
|
604
|
-
const Z = t.columns[S];
|
|
605
|
-
if (Z.fixed === "right") {
|
|
606
|
-
let J = 80;
|
|
607
|
-
if (Z.width) {
|
|
608
|
-
const ce = parseFloat(Z.width);
|
|
609
|
-
J = isNaN(ce) ? 80 : ce;
|
|
610
|
-
} else if (u.value[S]) {
|
|
611
|
-
const ce = parseFloat(u.value[S]);
|
|
612
|
-
J = isNaN(ce) ? 80 : ce;
|
|
613
|
-
}
|
|
614
|
-
_.push({ index: S, width: J });
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
for (let S = 0; S < _.length; S++)
|
|
618
|
-
x.push(B), B += _[S].width;
|
|
619
|
-
return x;
|
|
620
|
-
});
|
|
621
|
-
function pe(x, B) {
|
|
622
|
-
if (B === "left") {
|
|
623
|
-
let _ = 0;
|
|
624
|
-
for (let S = 0; S < x; S++)
|
|
625
|
-
t.columns[S].fixed === "left" && _++;
|
|
626
|
-
return _;
|
|
627
|
-
} else {
|
|
628
|
-
let _ = 0;
|
|
629
|
-
for (let S = t.columns.length - 1; S > x; S--)
|
|
630
|
-
t.columns[S].fixed === "right" && _++;
|
|
631
|
-
return _;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
function ae(x, B) {
|
|
635
|
-
return typeof t.rowKey == "function" ? t.rowKey(x) : x[t.rowKey] || B;
|
|
636
|
-
}
|
|
637
|
-
function y(x, B) {
|
|
638
|
-
return B.split(".").reduce((_, S) => _ == null ? void 0 : _[S], x);
|
|
639
|
-
}
|
|
640
|
-
function g(x, B = !1) {
|
|
641
|
-
const _ = [];
|
|
642
|
-
return x.align && _.push(`text-${x.align}`), x.fixed === "right" && (_.push("col-fixed-right"), B && _.push("col-fixed-right-header")), x.fixed === "left" && (_.push("col-fixed-left"), B && _.push("col-fixed-left-header")), _.join(" ");
|
|
643
|
-
}
|
|
644
|
-
function v(x, B, _) {
|
|
645
|
-
const S = {};
|
|
646
|
-
if (x.width ? (S.width = x.width, S.minWidth = x.width, S.maxWidth = x.width) : (S.width = "auto", S.minWidth = "80px", S.maxWidth = "none"), x.fixed === "left") {
|
|
647
|
-
const Z = pe(B, "left"), J = te.value[Z] || 0;
|
|
648
|
-
S.left = `${J}px`, S.zIndex = _ ? `${10 + Z}` : `${5 + Z}`;
|
|
649
|
-
} else if (x.fixed === "right") {
|
|
650
|
-
const Z = pe(B, "right"), J = X.value[Z] || 0;
|
|
651
|
-
_ ? S.right = `${J - 3}px` : S.right = `${J}px`, S.zIndex = _ ? `${10 + Z}` : `${5 + Z}`;
|
|
652
|
-
}
|
|
653
|
-
return S;
|
|
654
|
-
}
|
|
655
|
-
function f(x, B) {
|
|
656
|
-
const _ = y(x, B.key);
|
|
657
|
-
return B.formatter ? B.formatter(_, x) : _ || "";
|
|
658
|
-
}
|
|
659
|
-
function w(x) {
|
|
660
|
-
k.value.includes(x) ? k.value = k.value.filter((B) => B !== x) : k.value = [...k.value, x], l("select", k.value), l("update:selectedItems", k.value);
|
|
661
|
-
}
|
|
662
|
-
function b() {
|
|
663
|
-
const x = T.value.map((B, _) => ae(B, _));
|
|
664
|
-
if (x.every((B) => k.value.includes(B)))
|
|
665
|
-
k.value = k.value.filter((B) => !x.includes(B));
|
|
666
|
-
else {
|
|
667
|
-
const B = /* @__PURE__ */ new Set([...k.value, ...x]);
|
|
668
|
-
k.value = Array.from(B);
|
|
669
|
-
}
|
|
670
|
-
l("select", k.value), l("update:selectedItems", k.value);
|
|
671
|
-
}
|
|
672
|
-
function M() {
|
|
673
|
-
k.value = [], l("select", k.value), l("update:selectedItems", k.value);
|
|
674
|
-
}
|
|
675
|
-
oe(() => t.searchKeyword, () => {
|
|
676
|
-
c.value = 1;
|
|
677
|
-
}), oe(() => t.data, () => {
|
|
678
|
-
t.total || (c.value = 1);
|
|
679
|
-
}, { deep: !0 });
|
|
680
|
-
function W(x) {
|
|
681
|
-
c.value = x, l("page-change", x);
|
|
682
|
-
}
|
|
683
|
-
function p(x) {
|
|
684
|
-
s.value = x, c.value = 1, l("page-size-change", x);
|
|
685
|
-
}
|
|
686
|
-
oe(() => t.currentPage, (x) => {
|
|
687
|
-
const B = typeof x == "number" && x > 0 ? x : 1;
|
|
688
|
-
c.value !== B && (c.value = B);
|
|
689
|
-
}), oe(() => t.pageSize, (x) => {
|
|
690
|
-
const B = typeof x == "number" && x > 0 ? x : 10;
|
|
691
|
-
s.value !== B && (s.value = B);
|
|
692
|
-
});
|
|
693
|
-
function D() {
|
|
694
|
-
L.value && fe(() => {
|
|
695
|
-
const x = L.value.getBoundingClientRect(), B = window.innerHeight, _ = x.top, S = L.value.querySelector(".table-header"), Z = S ? S.offsetHeight : 40, J = L.value.querySelector(".ypagination"), ce = J ? J.offsetHeight : 60, o = L.value.querySelector(".bulk-bar"), r = o ? o.offsetHeight : 0, E = Z + ce + r + 20, N = B - _ - E, le = Math.max(200, N), ie = L.value.querySelector(".table-body-wrap .table");
|
|
696
|
-
ie && (ie.offsetHeight > N ? C.value = `${le}px` : C.value = "none");
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
let F = !1;
|
|
700
|
-
function ne() {
|
|
701
|
-
!I.value || !h.value || F || I.value.scrollLeft !== h.value.scrollLeft && (F = !0, I.value.scrollLeft = h.value.scrollLeft, requestAnimationFrame(() => {
|
|
702
|
-
F = !1;
|
|
703
|
-
}));
|
|
704
|
-
}
|
|
705
|
-
function Y() {
|
|
706
|
-
!I.value || !h.value || F || h.value.scrollLeft !== I.value.scrollLeft && (F = !0, h.value.scrollLeft = I.value.scrollLeft, requestAnimationFrame(() => {
|
|
707
|
-
F = !1;
|
|
708
|
-
}));
|
|
709
|
-
}
|
|
710
|
-
function ee() {
|
|
711
|
-
fe(() => {
|
|
712
|
-
if (!h.value) return;
|
|
713
|
-
const x = h.value, B = x.scrollHeight, _ = x.clientHeight, S = x.scrollTop, Z = B > _ + 1;
|
|
714
|
-
if (j.value.show = Z, !Z) return;
|
|
715
|
-
const J = 24, ce = _ / B, o = K.value ? K.value.clientHeight : _, r = Math.max(J, Math.floor(o * ce));
|
|
716
|
-
j.value.thumbHeight = r;
|
|
717
|
-
const E = Math.max(0, o - r), N = Math.max(1, B - _);
|
|
718
|
-
j.value.thumbTop = Math.min(E, Math.floor(S / N * E));
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
function Ie(x) {
|
|
722
|
-
if (!U || !h.value || !K.value) return;
|
|
723
|
-
x.preventDefault();
|
|
724
|
-
const B = K.value.clientHeight, _ = Math.max(0, B - j.value.thumbHeight), S = h.value, Z = S.scrollHeight, J = S.clientHeight, ce = Math.max(1, Z - J), r = (x.clientY - P) / Math.max(1, _) * ce;
|
|
725
|
-
S.scrollTop = Math.min(ce, Math.max(0, $ + r)), ee();
|
|
726
|
-
}
|
|
727
|
-
function $e() {
|
|
728
|
-
U = !1, window.removeEventListener("mousemove", Ie), window.removeEventListener("mouseup", $e);
|
|
729
|
-
}
|
|
730
|
-
function Ae() {
|
|
731
|
-
fe(() => {
|
|
732
|
-
var _;
|
|
733
|
-
if (u.value.length === t.columns.length && u.value.every((S) => !!S))
|
|
734
|
-
return;
|
|
735
|
-
const x = [];
|
|
736
|
-
for (const S of t.columns)
|
|
737
|
-
if (S.width && typeof S.width == "string" && S.width.trim())
|
|
738
|
-
x.push(S.width);
|
|
739
|
-
else {
|
|
740
|
-
const Z = u.value[x.length];
|
|
741
|
-
x.push(Z || "");
|
|
742
|
-
}
|
|
743
|
-
const B = (_ = d.value) == null ? void 0 : _.querySelector("tbody tr");
|
|
744
|
-
if (B) {
|
|
745
|
-
const S = t.selectable ? 1 : 0, Z = Array.from(B.children);
|
|
746
|
-
for (let J = 0; J < t.columns.length; J++)
|
|
747
|
-
if (!x[J]) {
|
|
748
|
-
const ce = Z[S + J];
|
|
749
|
-
if (ce) {
|
|
750
|
-
const o = ce.clientWidth;
|
|
751
|
-
x[J] = (o > 0 ? o : 80) + "px";
|
|
752
|
-
} else
|
|
753
|
-
x[J] = "80px";
|
|
754
|
-
}
|
|
755
|
-
} else
|
|
756
|
-
for (let S = 0; S < x.length; S++)
|
|
757
|
-
x[S] || (x[S] = u.value[S] || "80px");
|
|
758
|
-
u.value = x;
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
function He() {
|
|
762
|
-
D(), Ce();
|
|
763
|
-
}
|
|
764
|
-
oe(() => t.data, () => {
|
|
765
|
-
fe(() => {
|
|
766
|
-
D(), ne(), Ce();
|
|
767
|
-
});
|
|
768
|
-
}, { deep: !0 }), oe([c, s], () => {
|
|
769
|
-
fe(() => {
|
|
770
|
-
D(), ne(), Ce();
|
|
771
|
-
});
|
|
772
|
-
}), oe(() => t.columns, () => {
|
|
773
|
-
u.value = [], fe(() => {
|
|
774
|
-
Ae(), ne(), Ce();
|
|
775
|
-
});
|
|
776
|
-
}, { deep: !0 }), oe(() => k.value, () => {
|
|
777
|
-
fe(() => {
|
|
778
|
-
D(), Ce();
|
|
779
|
-
});
|
|
780
|
-
}, { deep: !0 }), oe(() => t.loading, () => {
|
|
781
|
-
fe(() => {
|
|
782
|
-
Ce();
|
|
783
|
-
});
|
|
784
|
-
}), _e(() => {
|
|
785
|
-
var x, B;
|
|
786
|
-
fe(() => {
|
|
787
|
-
D(), Ae(), Ce(), ee();
|
|
788
|
-
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (x = h.value) == null || x.addEventListener("scroll", () => {
|
|
789
|
-
ne(), ee(), Ce();
|
|
790
|
-
}, { passive: !0 }), (B = I.value) == null || B.addEventListener("scroll", () => {
|
|
791
|
-
Y();
|
|
792
|
-
}, { passive: !0 }), fe(() => ne()), h.value && typeof ResizeObserver < "u" && (ze = new ResizeObserver(() => {
|
|
793
|
-
Ce();
|
|
794
|
-
}), ze.observe(h.value));
|
|
795
|
-
}), Be(() => {
|
|
796
|
-
var x, B;
|
|
797
|
-
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (x = h.value) == null || x.removeEventListener("scroll", ne), (B = I.value) == null || B.removeEventListener("scroll", Y), window.removeEventListener("mousemove", Ie), window.removeEventListener("mouseup", $e), ze && (ze.disconnect(), ze = null);
|
|
798
|
-
});
|
|
799
|
-
let Te = -1;
|
|
800
|
-
function Ce() {
|
|
801
|
-
!I.value || !h.value || requestAnimationFrame(() => {
|
|
802
|
-
if (!I.value || !h.value) return;
|
|
803
|
-
const x = h.value, B = Math.ceil(x.offsetWidth - x.clientWidth);
|
|
804
|
-
if (V.value = B, B !== Te) {
|
|
805
|
-
Te = B;
|
|
806
|
-
const _ = I.value.querySelector(".table"), S = d.value;
|
|
807
|
-
_ && S && (I.value.style.paddingRight = "0px", _.style.width = "", _.style.marginRight = "", B > 0 ? (I.value.style.paddingRight = `${B}px`, _.style.width = "100%", _.style.marginRight = `-${B}px`) : (I.value.style.paddingRight = "0px", _.style.width = "100%", _.style.marginRight = "0px"));
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
|
-
let ze = null;
|
|
812
|
-
return (x, B) => (a(), i("div", {
|
|
813
|
-
class: "ytable-container",
|
|
814
|
-
ref_key: "tableContainer",
|
|
815
|
-
ref: L
|
|
816
|
-
}, [
|
|
817
|
-
de(ke, { name: "bulk-slide" }, {
|
|
818
|
-
default: he(() => [
|
|
819
|
-
k.value.length && e.showBulkActions ? (a(), i("div", Lt, [
|
|
820
|
-
n("div", It, "已选择 " + G(k.value.length) + " 项", 1),
|
|
821
|
-
n("div", Et, [
|
|
822
|
-
ue(x.$slots, "bulk-actions", {
|
|
823
|
-
selectedItems: k.value,
|
|
824
|
-
clearSelection: M
|
|
825
|
-
}, () => [
|
|
826
|
-
n("button", {
|
|
827
|
-
class: "btn",
|
|
828
|
-
onClick: M
|
|
829
|
-
}, "清除选择")
|
|
830
|
-
], !0)
|
|
831
|
-
])
|
|
832
|
-
])) : A("", !0)
|
|
833
|
-
]),
|
|
834
|
-
_: 3
|
|
835
|
-
}),
|
|
836
|
-
n("div", Bt, [
|
|
837
|
-
n("div", {
|
|
838
|
-
class: "table-header",
|
|
839
|
-
ref_key: "headerRef",
|
|
840
|
-
ref: I
|
|
841
|
-
}, [
|
|
842
|
-
n("table", Tt, [
|
|
843
|
-
n("colgroup", null, [
|
|
844
|
-
e.selectable ? (a(), i("col", zt)) : A("", !0),
|
|
845
|
-
(a(!0), i(re, null, ve(e.columns, (_, S) => (a(), i("col", {
|
|
846
|
-
key: _.key,
|
|
847
|
-
style: ye({ width: u.value[S] || void 0, minWidth: u.value[S] || "80px" })
|
|
848
|
-
}, null, 4))), 128))
|
|
849
|
-
]),
|
|
850
|
-
n("thead", null, [
|
|
851
|
-
n("tr", null, [
|
|
852
|
-
e.selectable ? (a(), i("th", Kt, [
|
|
853
|
-
n("input", {
|
|
854
|
-
type: "checkbox",
|
|
855
|
-
checked: q.value,
|
|
856
|
-
onChange: b
|
|
857
|
-
}, null, 40, Ht)
|
|
858
|
-
])) : A("", !0),
|
|
859
|
-
(a(!0), i(re, null, ve(e.columns, (_, S) => (a(), i("th", {
|
|
860
|
-
key: _.key,
|
|
861
|
-
class: z(g(_, !0)),
|
|
862
|
-
style: ye(v(_, S, !0))
|
|
863
|
-
}, G(_.title), 7))), 128))
|
|
864
|
-
])
|
|
865
|
-
])
|
|
910
|
+
variant: "secondary",
|
|
911
|
+
disabled: k.value === 1 || e.loading,
|
|
912
|
+
onClick: d[0] || (d[0] = (N) => _(1))
|
|
913
|
+
}, {
|
|
914
|
+
default: he(() => [...d[2] || (d[2] = [
|
|
915
|
+
De("首页", -1)
|
|
916
|
+
])]),
|
|
917
|
+
_: 1
|
|
918
|
+
}, 8, ["disabled"]),
|
|
919
|
+
ce(u, {
|
|
920
|
+
class: "ml-1",
|
|
921
|
+
variant: "secondary",
|
|
922
|
+
size: "small",
|
|
923
|
+
groupItems: [
|
|
924
|
+
{ label: "上一页", value: "prev", disabled: k.value === 1 || e.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
925
|
+
{ label: "下一页", value: "next", disabled: e.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
926
|
+
],
|
|
927
|
+
onGroupClick: L
|
|
928
|
+
}, null, 8, ["groupItems"]),
|
|
929
|
+
n("div", Ft, [
|
|
930
|
+
ce(E, {
|
|
931
|
+
modelValue: c.value,
|
|
932
|
+
"onUpdate:modelValue": d[1] || (d[1] = (N) => c.value = N),
|
|
933
|
+
options: s.value,
|
|
934
|
+
size: "small",
|
|
935
|
+
width: "105px",
|
|
936
|
+
clearable: !1,
|
|
937
|
+
disabled: e.loading,
|
|
938
|
+
onChange: S
|
|
939
|
+
}, null, 8, ["modelValue", "options", "disabled"])
|
|
866
940
|
])
|
|
867
|
-
]
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
ref_key: "bodyWrapRef",
|
|
871
|
-
ref: h,
|
|
872
|
-
style: ye({ maxHeight: C.value })
|
|
873
|
-
}, [
|
|
874
|
-
e.loading ? (a(), i("div", Rt, [...B[2] || (B[2] = [
|
|
875
|
-
n("div", { class: "loading-spinner" }, null, -1),
|
|
876
|
-
n("div", { class: "loading-text" }, "加载中...", -1)
|
|
877
|
-
])])) : A("", !0),
|
|
878
|
-
!T.value.length && !e.loading ? (a(), i("div", Vt, [
|
|
879
|
-
ue(x.$slots, "empty", {}, () => [
|
|
880
|
-
De(G(e.emptyText), 1)
|
|
881
|
-
], !0)
|
|
882
|
-
])) : A("", !0),
|
|
883
|
-
n("table", {
|
|
884
|
-
class: z(["table", { "loading-table": e.loading }]),
|
|
885
|
-
ref_key: "bodyTableRef",
|
|
886
|
-
ref: d
|
|
887
|
-
}, [
|
|
888
|
-
n("colgroup", null, [
|
|
889
|
-
e.selectable ? (a(), i("col", At)) : A("", !0),
|
|
890
|
-
(a(!0), i(re, null, ve(e.columns, (_, S) => (a(), i("col", {
|
|
891
|
-
key: _.key,
|
|
892
|
-
style: ye({ width: u.value[S] || void 0, minWidth: u.value[S] || "80px" })
|
|
893
|
-
}, null, 4))), 128))
|
|
894
|
-
]),
|
|
895
|
-
n("tbody", null, [
|
|
896
|
-
(a(!0), i(re, null, ve(T.value, (_, S) => (a(), i("tr", {
|
|
897
|
-
key: ae(_, S)
|
|
898
|
-
}, [
|
|
899
|
-
e.selectable ? (a(), i("td", Ft, [
|
|
900
|
-
n("input", {
|
|
901
|
-
type: "checkbox",
|
|
902
|
-
value: ae(_, S),
|
|
903
|
-
checked: k.value.includes(ae(_, S)),
|
|
904
|
-
onChange: (Z) => w(ae(_, S))
|
|
905
|
-
}, null, 40, Wt)
|
|
906
|
-
])) : A("", !0),
|
|
907
|
-
(a(!0), i(re, null, ve(e.columns, (Z, J) => (a(), i("td", {
|
|
908
|
-
key: Z.key,
|
|
909
|
-
class: z(g(Z)),
|
|
910
|
-
style: ye(v(Z, J, !1))
|
|
911
|
-
}, [
|
|
912
|
-
ue(x.$slots, `cell-${Z.key}`, {
|
|
913
|
-
item: _,
|
|
914
|
-
value: y(_, Z.key),
|
|
915
|
-
index: S
|
|
916
|
-
}, () => [
|
|
917
|
-
De(G(f(_, Z)), 1)
|
|
918
|
-
], !0)
|
|
919
|
-
], 6))), 128))
|
|
920
|
-
]))), 128))
|
|
921
|
-
])
|
|
922
|
-
], 2)
|
|
923
|
-
], 6),
|
|
924
|
-
e.pagination ? (a(), Le(Je, {
|
|
925
|
-
key: 0,
|
|
926
|
-
class: "align-right",
|
|
927
|
-
"current-page": c.value,
|
|
928
|
-
"onUpdate:currentPage": B[0] || (B[0] = (_) => c.value = _),
|
|
929
|
-
"page-size": s.value,
|
|
930
|
-
"onUpdate:pageSize": B[1] || (B[1] = (_) => s.value = _),
|
|
931
|
-
loading: t.loading,
|
|
932
|
-
"page-size-options": e.pageSizeOptions,
|
|
933
|
-
onPageChange: W,
|
|
934
|
-
onPageSizeChange: p
|
|
935
|
-
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : A("", !0)
|
|
936
|
-
])
|
|
937
|
-
], 512));
|
|
941
|
+
])
|
|
942
|
+
]);
|
|
943
|
+
};
|
|
938
944
|
}
|
|
939
|
-
}),
|
|
945
|
+
}), Wt = /* @__PURE__ */ we(Pt, [["__scopeId", "data-v-b8406406"]]), Nt = ["aria-label"], jt = { class: "y-badge__inner" }, Ot = {
|
|
940
946
|
key: 0,
|
|
941
947
|
class: "y-badge__progress",
|
|
942
948
|
"aria-hidden": "true"
|
|
@@ -991,18 +997,18 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
991
997
|
label: { default: "" }
|
|
992
998
|
},
|
|
993
999
|
setup(e) {
|
|
994
|
-
const m = e, t =
|
|
1000
|
+
const m = e, t = U(() => m.tone || "default"), l = U(() => {
|
|
995
1001
|
const c = (m.label || "").trim(), s = m.tone, k = m.progress;
|
|
996
1002
|
if (k) {
|
|
997
|
-
const
|
|
1003
|
+
const _ = {
|
|
998
1004
|
incomplete: "未完成",
|
|
999
1005
|
partiallyComplete: "部分完成",
|
|
1000
1006
|
complete: "已完成"
|
|
1001
1007
|
};
|
|
1002
|
-
return c ? `${c},进度:${
|
|
1008
|
+
return c ? `${c},进度:${_[k] || k}` : `进度:${_[k] || k}`;
|
|
1003
1009
|
}
|
|
1004
1010
|
if (s && s !== "default") {
|
|
1005
|
-
const
|
|
1011
|
+
const _ = {
|
|
1006
1012
|
informational: "信息",
|
|
1007
1013
|
success: "成功",
|
|
1008
1014
|
attention: "注意",
|
|
@@ -1010,12 +1016,12 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1010
1016
|
critical: "严重",
|
|
1011
1017
|
default: "默认"
|
|
1012
1018
|
};
|
|
1013
|
-
return c ? `${c},语气:${
|
|
1019
|
+
return c ? `${c},语气:${_[s] || s}` : `语气:${_[s] || s}`;
|
|
1014
1020
|
}
|
|
1015
1021
|
return c || "标记";
|
|
1016
1022
|
});
|
|
1017
1023
|
return (c, s) => (a(), i("span", {
|
|
1018
|
-
class:
|
|
1024
|
+
class: K(["y-badge", [
|
|
1019
1025
|
`y-badge--${t.value}`,
|
|
1020
1026
|
`y-badge--${e.size}`,
|
|
1021
1027
|
{ "is-outline": e.outline, "is-pill": e.pill },
|
|
@@ -1077,12 +1083,12 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1077
1083
|
])]))
|
|
1078
1084
|
])) : A("", !0),
|
|
1079
1085
|
n("span", tn, [
|
|
1080
|
-
|
|
1086
|
+
de(c.$slots, "default", {}, () => [
|
|
1081
1087
|
De(G(e.label), 1)
|
|
1082
1088
|
], !0)
|
|
1083
1089
|
])
|
|
1084
1090
|
])
|
|
1085
|
-
], 10,
|
|
1091
|
+
], 10, Nt));
|
|
1086
1092
|
}
|
|
1087
1093
|
}), ln = /* @__PURE__ */ we(nn, [["__scopeId", "data-v-ce819797"]]), on = ["aria-hidden"], an = ["onKeydown"], sn = {
|
|
1088
1094
|
key: 0,
|
|
@@ -1105,24 +1111,24 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1105
1111
|
},
|
|
1106
1112
|
emits: ["update:modelValue", "open", "close"],
|
|
1107
1113
|
setup(e, { emit: m }) {
|
|
1108
|
-
const t = e, l = m, c =
|
|
1114
|
+
const t = e, l = m, c = U({
|
|
1109
1115
|
get: () => t.modelValue,
|
|
1110
1116
|
set: (d) => l("update:modelValue", d)
|
|
1111
|
-
}), s = R(null), k =
|
|
1117
|
+
}), s = R(null), k = U(() => {
|
|
1112
1118
|
const d = {};
|
|
1113
1119
|
return d.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), d.margin = "0 auto", d.top = t.top, d;
|
|
1114
1120
|
});
|
|
1115
|
-
function
|
|
1116
|
-
t.maskClosable &&
|
|
1121
|
+
function _() {
|
|
1122
|
+
t.maskClosable && S();
|
|
1117
1123
|
}
|
|
1118
|
-
function
|
|
1124
|
+
function S() {
|
|
1119
1125
|
c.value && (c.value = !1, l("close"));
|
|
1120
1126
|
}
|
|
1121
|
-
function
|
|
1122
|
-
t.closable &&
|
|
1127
|
+
function L() {
|
|
1128
|
+
t.closable && S();
|
|
1123
1129
|
}
|
|
1124
1130
|
function h(d) {
|
|
1125
|
-
d.key === "Escape" &&
|
|
1131
|
+
d.key === "Escape" && L();
|
|
1126
1132
|
}
|
|
1127
1133
|
return oe(() => t.modelValue, (d) => {
|
|
1128
1134
|
d ? (l("open"), requestAnimationFrame(() => {
|
|
@@ -1131,10 +1137,10 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1131
1137
|
}), document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", h), document.body.style.overflow = "");
|
|
1132
1138
|
}), _e(() => {
|
|
1133
1139
|
t.modelValue && (document.addEventListener("keydown", h), document.body.style.overflow = "hidden");
|
|
1134
|
-
}),
|
|
1140
|
+
}), Ee(() => {
|
|
1135
1141
|
document.removeEventListener("keydown", h), document.body.style.overflow = "";
|
|
1136
|
-
}), (d, u) => (a(), Le(
|
|
1137
|
-
|
|
1142
|
+
}), (d, u) => (a(), Le(Re, { to: "body" }, [
|
|
1143
|
+
Be(n("div", {
|
|
1138
1144
|
class: "y-dialog-root",
|
|
1139
1145
|
role: "dialog",
|
|
1140
1146
|
"aria-modal": !0,
|
|
@@ -1143,20 +1149,20 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1143
1149
|
}, [
|
|
1144
1150
|
n("div", {
|
|
1145
1151
|
class: "y-dialog-mask",
|
|
1146
|
-
onClick:
|
|
1152
|
+
onClick: _
|
|
1147
1153
|
}),
|
|
1148
|
-
|
|
1154
|
+
ce(ke, { name: "dialog-zoom-fade" }, {
|
|
1149
1155
|
default: he(() => [
|
|
1150
|
-
|
|
1156
|
+
Be(n("div", {
|
|
1151
1157
|
ref_key: "panelRef",
|
|
1152
1158
|
ref: s,
|
|
1153
|
-
class:
|
|
1159
|
+
class: K(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1154
1160
|
style: ye(k.value),
|
|
1155
|
-
onKeydown: be(
|
|
1161
|
+
onKeydown: be(J(L, ["prevent", "stop"]), ["esc"]),
|
|
1156
1162
|
tabindex: "-1"
|
|
1157
1163
|
}, [
|
|
1158
1164
|
e.showHeader ? (a(), i("div", sn, [
|
|
1159
|
-
|
|
1165
|
+
de(d.$slots, "header", {}, () => [
|
|
1160
1166
|
n("div", rn, G(e.title), 1)
|
|
1161
1167
|
], !0),
|
|
1162
1168
|
e.closable ? (a(), i("button", {
|
|
@@ -1164,14 +1170,14 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1164
1170
|
type: "button",
|
|
1165
1171
|
class: "y-dialog-close",
|
|
1166
1172
|
"aria-label": "Close",
|
|
1167
|
-
onClick:
|
|
1173
|
+
onClick: S
|
|
1168
1174
|
}, " ✕ ")) : A("", !0)
|
|
1169
1175
|
])) : A("", !0),
|
|
1170
1176
|
n("div", un, [
|
|
1171
|
-
|
|
1177
|
+
de(d.$slots, "default", {}, void 0, !0)
|
|
1172
1178
|
]),
|
|
1173
1179
|
d.$slots.footer ? (a(), i("div", dn, [
|
|
1174
|
-
|
|
1180
|
+
de(d.$slots, "footer", {}, void 0, !0)
|
|
1175
1181
|
])) : A("", !0)
|
|
1176
1182
|
], 46, an), [
|
|
1177
1183
|
[Ke, c.value]
|
|
@@ -1204,15 +1210,15 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1204
1210
|
},
|
|
1205
1211
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1206
1212
|
setup(e, { expose: m, emit: t }) {
|
|
1207
|
-
const l = e, c = t, s = R(), k = R(),
|
|
1208
|
-
let u = null,
|
|
1209
|
-
const
|
|
1210
|
-
if (!
|
|
1213
|
+
const l = e, c = t, s = R(), k = R(), _ = R(), S = R(!1), L = R(), h = R(), d = R({});
|
|
1214
|
+
let u = null, E = null;
|
|
1215
|
+
const N = U(() => {
|
|
1216
|
+
if (!S.value || !L.value) return {};
|
|
1211
1217
|
const v = {};
|
|
1212
1218
|
l.width !== "auto" && (v.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.maxWidth && (v.maxWidth = typeof l.maxWidth == "number" ? `${l.maxWidth}px` : l.maxWidth);
|
|
1213
1219
|
const { top: f, left: w } = P();
|
|
1214
1220
|
return v.top = `${f}px`, v.left = `${w}px`, v;
|
|
1215
|
-
}),
|
|
1221
|
+
}), q = U(() => {
|
|
1216
1222
|
if (!l.showArrow) return {};
|
|
1217
1223
|
if (Object.keys(d.value).length > 0)
|
|
1218
1224
|
return d.value;
|
|
@@ -1220,19 +1226,19 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1220
1226
|
return l.placement.startsWith("top") || l.placement.startsWith("bottom") ? v.left = "50%" : v.top = "50%", v;
|
|
1221
1227
|
});
|
|
1222
1228
|
function P() {
|
|
1223
|
-
var
|
|
1224
|
-
if (!
|
|
1225
|
-
const { width: v, height: f, top: w, left: b } =
|
|
1229
|
+
var j, ee;
|
|
1230
|
+
if (!L.value) return { top: 0, left: 0 };
|
|
1231
|
+
const { width: v, height: f, top: w, left: b } = L.value, M = ((j = _.value) == null ? void 0 : j.offsetWidth) || 200, F = ((ee = _.value) == null ? void 0 : ee.offsetHeight) || 100;
|
|
1226
1232
|
let p = 0, D = 0;
|
|
1227
1233
|
switch (l.placement) {
|
|
1228
1234
|
case "top":
|
|
1229
|
-
p = w -
|
|
1235
|
+
p = w - F - l.offset, D = b + (v - M) / 2;
|
|
1230
1236
|
break;
|
|
1231
1237
|
case "top-start":
|
|
1232
|
-
p = w -
|
|
1238
|
+
p = w - F - l.offset, D = b;
|
|
1233
1239
|
break;
|
|
1234
1240
|
case "top-end":
|
|
1235
|
-
p = w -
|
|
1241
|
+
p = w - F - l.offset, D = b + v - M;
|
|
1236
1242
|
break;
|
|
1237
1243
|
case "bottom":
|
|
1238
1244
|
p = w + f + l.offset, D = b + (v - M) / 2;
|
|
@@ -1244,56 +1250,56 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1244
1250
|
p = w + f + l.offset, D = b + v - M;
|
|
1245
1251
|
break;
|
|
1246
1252
|
case "left":
|
|
1247
|
-
p = w + (f -
|
|
1253
|
+
p = w + (f - F) / 2, D = b - M - l.offset;
|
|
1248
1254
|
break;
|
|
1249
1255
|
case "left-start":
|
|
1250
1256
|
p = w, D = b - M - l.offset;
|
|
1251
1257
|
break;
|
|
1252
1258
|
case "left-end":
|
|
1253
|
-
p = w + f -
|
|
1259
|
+
p = w + f - F, D = b - M - l.offset;
|
|
1254
1260
|
break;
|
|
1255
1261
|
case "right":
|
|
1256
|
-
p = w + (f -
|
|
1262
|
+
p = w + (f - F) / 2, D = b + v + l.offset;
|
|
1257
1263
|
break;
|
|
1258
1264
|
case "right-start":
|
|
1259
1265
|
p = w, D = b + v + l.offset;
|
|
1260
1266
|
break;
|
|
1261
1267
|
case "right-end":
|
|
1262
|
-
p = w + f -
|
|
1268
|
+
p = w + f - F, D = b + v + l.offset;
|
|
1263
1269
|
break;
|
|
1264
1270
|
}
|
|
1265
|
-
const
|
|
1266
|
-
return D < 8 && (D = 8), D + M >
|
|
1271
|
+
const Y = window.innerWidth, ne = window.innerHeight;
|
|
1272
|
+
return D < 8 && (D = 8), D + M > Y - 8 && (D = Y - M - 8), p < 8 && (p = 8), p + F > ne - 8 && (p = ne - F - 8), { top: p, left: D };
|
|
1267
1273
|
}
|
|
1268
|
-
function
|
|
1269
|
-
l.disabled ||
|
|
1274
|
+
function C() {
|
|
1275
|
+
l.disabled || S.value || (Z(), l.openDelay > 0 ? u = setTimeout(() => {
|
|
1270
1276
|
V();
|
|
1271
1277
|
}, l.openDelay) : V());
|
|
1272
1278
|
}
|
|
1273
1279
|
function V() {
|
|
1274
|
-
c("before-show"),
|
|
1280
|
+
c("before-show"), S.value = !0, c("update:modelValue", !0), c("show"), fe(() => {
|
|
1275
1281
|
fe(() => {
|
|
1276
1282
|
X();
|
|
1277
1283
|
});
|
|
1278
1284
|
});
|
|
1279
1285
|
}
|
|
1280
1286
|
function H() {
|
|
1281
|
-
|
|
1287
|
+
S.value && (Z(), l.closeDelay > 0 ? E = setTimeout(() => {
|
|
1282
1288
|
T();
|
|
1283
1289
|
}, l.closeDelay) : T());
|
|
1284
1290
|
}
|
|
1285
1291
|
function T() {
|
|
1286
|
-
c("before-hide"),
|
|
1292
|
+
c("before-hide"), S.value = !1, c("update:modelValue", !1), c("hide");
|
|
1287
1293
|
}
|
|
1288
|
-
function
|
|
1289
|
-
u && (clearTimeout(u), u = null),
|
|
1294
|
+
function Z() {
|
|
1295
|
+
u && (clearTimeout(u), u = null), E && (clearTimeout(E), E = null);
|
|
1290
1296
|
}
|
|
1291
1297
|
function te() {
|
|
1292
|
-
if (!l.showArrow || !
|
|
1298
|
+
if (!l.showArrow || !L.value || !_.value) {
|
|
1293
1299
|
d.value = {};
|
|
1294
1300
|
return;
|
|
1295
1301
|
}
|
|
1296
|
-
const v =
|
|
1302
|
+
const v = L.value, f = _.value.getBoundingClientRect();
|
|
1297
1303
|
if (f.width === 0 || f.height === 0) {
|
|
1298
1304
|
const b = {};
|
|
1299
1305
|
l.placement.startsWith("top") || l.placement.startsWith("bottom") ? b.left = "50%" : b.top = "50%", d.value = b;
|
|
@@ -1302,52 +1308,52 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1302
1308
|
const w = {};
|
|
1303
1309
|
if (l.placement.startsWith("top")) {
|
|
1304
1310
|
w.bottom = "-6px";
|
|
1305
|
-
const b = v.left + v.width / 2, M = f.left,
|
|
1306
|
-
w.left = `${Math.max(12, Math.min(
|
|
1311
|
+
const b = v.left + v.width / 2, M = f.left, F = b - M;
|
|
1312
|
+
w.left = `${Math.max(12, Math.min(F, f.width - 12))}px`;
|
|
1307
1313
|
} else if (l.placement.startsWith("bottom")) {
|
|
1308
1314
|
w.top = "-6px";
|
|
1309
|
-
const b = v.left + v.width / 2, M = f.left,
|
|
1310
|
-
w.left = `${Math.max(12, Math.min(
|
|
1315
|
+
const b = v.left + v.width / 2, M = f.left, F = b - M;
|
|
1316
|
+
w.left = `${Math.max(12, Math.min(F, f.width - 12))}px`;
|
|
1311
1317
|
} else if (l.placement.startsWith("left")) {
|
|
1312
1318
|
w.right = "-6px";
|
|
1313
|
-
const b = v.top + v.height / 2, M = f.top,
|
|
1314
|
-
w.top = `${Math.max(12, Math.min(
|
|
1319
|
+
const b = v.top + v.height / 2, M = f.top, F = b - M;
|
|
1320
|
+
w.top = `${Math.max(12, Math.min(F, f.height - 12))}px`;
|
|
1315
1321
|
} else if (l.placement.startsWith("right")) {
|
|
1316
1322
|
w.left = "-6px";
|
|
1317
|
-
const b = v.top + v.height / 2, M = f.top,
|
|
1318
|
-
w.top = `${Math.max(12, Math.min(
|
|
1323
|
+
const b = v.top + v.height / 2, M = f.top, F = b - M;
|
|
1324
|
+
w.top = `${Math.max(12, Math.min(F, f.height - 12))}px`;
|
|
1319
1325
|
}
|
|
1320
1326
|
d.value = w;
|
|
1321
1327
|
}
|
|
1322
1328
|
function X() {
|
|
1323
|
-
k.value && (
|
|
1324
|
-
|
|
1329
|
+
k.value && (L.value = k.value.getBoundingClientRect(), _.value && (h.value = _.value.getBoundingClientRect(), te(), S.value && requestAnimationFrame(() => {
|
|
1330
|
+
_.value && (h.value = _.value.getBoundingClientRect(), te());
|
|
1325
1331
|
})));
|
|
1326
1332
|
}
|
|
1327
1333
|
function pe() {
|
|
1328
|
-
l.disabled || l.trigger === "click" && (
|
|
1334
|
+
l.disabled || l.trigger === "click" && (S.value ? H() : C());
|
|
1329
1335
|
}
|
|
1330
1336
|
function ae() {
|
|
1331
|
-
l.disabled || l.trigger !== "hover" || (
|
|
1337
|
+
l.disabled || l.trigger !== "hover" || (Z(), C());
|
|
1332
1338
|
}
|
|
1333
1339
|
function y() {
|
|
1334
1340
|
l.disabled || l.trigger !== "hover" || H();
|
|
1335
1341
|
}
|
|
1336
1342
|
function g(v) {
|
|
1337
|
-
if (!l.closeOnClickOutside || !
|
|
1343
|
+
if (!l.closeOnClickOutside || !S.value) return;
|
|
1338
1344
|
const f = v.target;
|
|
1339
|
-
s.value && !s.value.contains(f) &&
|
|
1345
|
+
s.value && !s.value.contains(f) && _.value && !_.value.contains(f) && H();
|
|
1340
1346
|
}
|
|
1341
1347
|
return oe(() => l.modelValue, (v) => {
|
|
1342
|
-
v !==
|
|
1343
|
-
}), oe(
|
|
1348
|
+
v !== S.value && (v ? C() : H());
|
|
1349
|
+
}), oe(S, (v) => {
|
|
1344
1350
|
v ? (document.addEventListener("click", g), window.addEventListener("resize", X), window.addEventListener("scroll", X, !0)) : (document.removeEventListener("click", g), window.removeEventListener("resize", X), window.removeEventListener("scroll", X, !0));
|
|
1345
1351
|
}), _e(() => {
|
|
1346
|
-
l.modelValue &&
|
|
1347
|
-
}),
|
|
1348
|
-
|
|
1352
|
+
l.modelValue && C();
|
|
1353
|
+
}), Ee(() => {
|
|
1354
|
+
Z(), document.removeEventListener("click", g), window.removeEventListener("resize", X), window.removeEventListener("scroll", X, !0);
|
|
1349
1355
|
}), m({
|
|
1350
|
-
show:
|
|
1356
|
+
show: C,
|
|
1351
1357
|
hide: H,
|
|
1352
1358
|
updatePosition: X
|
|
1353
1359
|
}), (v, f) => (a(), i("div", {
|
|
@@ -1362,33 +1368,33 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1362
1368
|
onMouseenter: ae,
|
|
1363
1369
|
onMouseleave: y
|
|
1364
1370
|
}, [
|
|
1365
|
-
|
|
1371
|
+
de(v.$slots, "reference", {}, void 0, !0)
|
|
1366
1372
|
], 544),
|
|
1367
|
-
(a(), Le(
|
|
1368
|
-
|
|
1373
|
+
(a(), Le(Re, { to: "body" }, [
|
|
1374
|
+
ce(ke, { name: "ypopover-fade" }, {
|
|
1369
1375
|
default: he(() => [
|
|
1370
|
-
|
|
1376
|
+
S.value ? (a(), i("div", {
|
|
1371
1377
|
key: 0,
|
|
1372
1378
|
ref_key: "contentRef",
|
|
1373
|
-
ref:
|
|
1374
|
-
class:
|
|
1379
|
+
ref: _,
|
|
1380
|
+
class: K(["ypopover__content", [
|
|
1375
1381
|
`ypopover__content--${e.placement}`,
|
|
1376
1382
|
{
|
|
1377
1383
|
"ypopover__content--dark": e.dark,
|
|
1378
1384
|
"ypopover__content--no-padding": !e.showPadding
|
|
1379
1385
|
}
|
|
1380
1386
|
]]),
|
|
1381
|
-
style: ye(
|
|
1382
|
-
onClick: f[0] || (f[0] =
|
|
1387
|
+
style: ye(N.value),
|
|
1388
|
+
onClick: f[0] || (f[0] = J(() => {
|
|
1383
1389
|
}, ["stop"]))
|
|
1384
1390
|
}, [
|
|
1385
1391
|
e.showArrow ? (a(), i("div", {
|
|
1386
1392
|
key: 0,
|
|
1387
|
-
class:
|
|
1388
|
-
style: ye(
|
|
1393
|
+
class: K(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1394
|
+
style: ye(q.value)
|
|
1389
1395
|
}, null, 6)) : A("", !0),
|
|
1390
1396
|
n("div", vn, [
|
|
1391
|
-
|
|
1397
|
+
de(v.$slots, "default", {}, void 0, !0)
|
|
1392
1398
|
])
|
|
1393
1399
|
], 6)) : A("", !0)
|
|
1394
1400
|
]),
|
|
@@ -1406,7 +1412,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1406
1412
|
}, Mn = {
|
|
1407
1413
|
key: 2,
|
|
1408
1414
|
class: "status-text status-complete"
|
|
1409
|
-
}, Sn = { class: "nh-time-pickers" }, Ln = { class: "nh-time-picker" }, In = { class: "nh-date-picker" },
|
|
1415
|
+
}, Sn = { class: "nh-time-pickers" }, Ln = { class: "nh-time-picker" }, In = { class: "nh-date-picker" }, Bn = { class: "nh-date-picker-header" }, En = { class: "nh-date-picker-header-label" }, Tn = { class: "nh-date-picker-content" }, zn = { class: "nh-date-table" }, Kn = ["onClick"], Hn = { class: "nh-date-table-cell" }, Rn = { key: 0 }, Vn = { class: "nh-time-picker" }, An = { class: "nh-date-picker" }, Yn = { class: "nh-date-picker-header" }, Fn = { class: "nh-date-picker-header-label" }, Pn = { class: "nh-date-picker-content" }, Wn = { class: "nh-date-table" }, Nn = ["onClick"], jn = { class: "nh-date-table-cell" }, On = { key: 0 }, Un = { class: "nh-time-actions" }, qn = /* @__PURE__ */ me({
|
|
1410
1416
|
__name: "ytime",
|
|
1411
1417
|
props: {
|
|
1412
1418
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1457,7 +1463,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1457
1463
|
},
|
|
1458
1464
|
emits: ["update:modelValue", "change"],
|
|
1459
1465
|
setup(e, { emit: m }) {
|
|
1460
|
-
const t = e, l = m, c = R(!1), s = R(-1), k = R(-1),
|
|
1466
|
+
const t = e, l = m, c = R(!1), s = R(-1), k = R(-1), _ = R(null), S = R(), L = R(), h = R({
|
|
1461
1467
|
top: !0,
|
|
1462
1468
|
left: !0
|
|
1463
1469
|
}), d = R({
|
|
@@ -1466,19 +1472,19 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1466
1472
|
}), u = R({
|
|
1467
1473
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1468
1474
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1469
|
-
}),
|
|
1475
|
+
}), E = () => {
|
|
1470
1476
|
const o = new Date(d.value.year, d.value.month).getTime(), r = new Date(u.value.year, u.value.month).getTime();
|
|
1471
1477
|
if (o >= r) {
|
|
1472
|
-
const
|
|
1473
|
-
u.value.year =
|
|
1478
|
+
const I = new Date(d.value.year, d.value.month + 1);
|
|
1479
|
+
u.value.year = I.getFullYear(), u.value.month = I.getMonth();
|
|
1474
1480
|
}
|
|
1475
|
-
},
|
|
1481
|
+
}, N = () => {
|
|
1476
1482
|
const o = new Date(d.value.year, d.value.month).getTime();
|
|
1477
1483
|
if (new Date(u.value.year, u.value.month).getTime() <= o) {
|
|
1478
|
-
const
|
|
1479
|
-
d.value.year =
|
|
1484
|
+
const I = new Date(u.value.year, u.value.month - 1);
|
|
1485
|
+
d.value.year = I.getFullYear(), d.value.month = I.getMonth();
|
|
1480
1486
|
}
|
|
1481
|
-
},
|
|
1487
|
+
}, q = ["一", "二", "三", "四", "五", "六", "日"], P = R(null), C = R(null), V = (o) => {
|
|
1482
1488
|
if (!o) return null;
|
|
1483
1489
|
if (o instanceof Date) return o;
|
|
1484
1490
|
if (typeof o == "number")
|
|
@@ -1490,13 +1496,13 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1490
1496
|
return null;
|
|
1491
1497
|
}, H = (o) => {
|
|
1492
1498
|
if (!o) return null;
|
|
1493
|
-
const r = o.getFullYear(),
|
|
1499
|
+
const r = o.getFullYear(), I = String(o.getMonth() + 1).padStart(2, "0"), W = String(o.getDate()).padStart(2, "0");
|
|
1494
1500
|
if (t.includeTime) {
|
|
1495
|
-
const se = String(o.getHours()).padStart(2, "0"), le = String(o.getMinutes()).padStart(2, "0"),
|
|
1496
|
-
return `${r}-${
|
|
1501
|
+
const se = String(o.getHours()).padStart(2, "0"), le = String(o.getMinutes()).padStart(2, "0"), re = String(o.getSeconds()).padStart(2, "0");
|
|
1502
|
+
return `${r}-${I}-${W} ${se}:${le}:${re}`;
|
|
1497
1503
|
} else
|
|
1498
|
-
return `${r}-${
|
|
1499
|
-
}, T = (o) => o ? o.getTime() : null,
|
|
1504
|
+
return `${r}-${I}-${W}`;
|
|
1505
|
+
}, T = (o) => o ? o.getTime() : null, Z = (o) => o ? {
|
|
1500
1506
|
startDate: V(o.startDate),
|
|
1501
1507
|
endDate: V(o.endDate)
|
|
1502
1508
|
} : { startDate: null, endDate: null }, te = (o) => t.format === "string" ? {
|
|
@@ -1505,13 +1511,13 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1505
1511
|
} : t.format === "timestamp" ? {
|
|
1506
1512
|
startDate: T(o.startDate),
|
|
1507
1513
|
endDate: T(o.endDate)
|
|
1508
|
-
} : o, X = (o, r) => `${String(r + 1).padStart(2, "0")}/${o}`, pe = (o, r) => o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate(), ae = (o, r,
|
|
1509
|
-
const r =
|
|
1514
|
+
} : o, X = (o, r) => `${String(r + 1).padStart(2, "0")}/${o}`, pe = (o, r) => o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate(), ae = (o, r, I) => !r || !I ? !1 : o >= r && o <= I, y = (o) => {
|
|
1515
|
+
const r = Z(o);
|
|
1510
1516
|
if (!(r != null && r.startDate) || !(r != null && r.endDate))
|
|
1511
1517
|
return -1;
|
|
1512
|
-
for (let
|
|
1513
|
-
const
|
|
1514
|
-
if (
|
|
1518
|
+
for (let I = 0; I < t.shortcuts.length; I++) {
|
|
1519
|
+
const W = t.shortcuts[I].getValue();
|
|
1520
|
+
if (W.startDate && W.endDate && r.startDate && r.endDate) {
|
|
1515
1521
|
const se = new Date(
|
|
1516
1522
|
r.startDate.getFullYear(),
|
|
1517
1523
|
r.startDate.getMonth(),
|
|
@@ -1520,25 +1526,25 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1520
1526
|
r.endDate.getFullYear(),
|
|
1521
1527
|
r.endDate.getMonth(),
|
|
1522
1528
|
r.endDate.getDate()
|
|
1523
|
-
),
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1529
|
+
), re = new Date(
|
|
1530
|
+
W.startDate.getFullYear(),
|
|
1531
|
+
W.startDate.getMonth(),
|
|
1532
|
+
W.startDate.getDate()
|
|
1527
1533
|
), xe = new Date(
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1534
|
+
W.endDate.getFullYear(),
|
|
1535
|
+
W.endDate.getMonth(),
|
|
1536
|
+
W.endDate.getDate()
|
|
1531
1537
|
);
|
|
1532
|
-
if (se.getTime() ===
|
|
1533
|
-
return
|
|
1538
|
+
if (se.getTime() === re.getTime() && le.getTime() === xe.getTime())
|
|
1539
|
+
return I;
|
|
1534
1540
|
}
|
|
1535
1541
|
}
|
|
1536
1542
|
return -1;
|
|
1537
1543
|
}, g = (o, r) => {
|
|
1538
|
-
const
|
|
1539
|
-
for (let ge =
|
|
1544
|
+
const I = new Date(o, r, 1), W = new Date(o, r + 1, 0), se = I.getDay(), le = W.getDate(), re = [], xe = /* @__PURE__ */ new Date(), We = se === 0 ? 6 : se - 1, Ge = new Date(o, r, 0);
|
|
1545
|
+
for (let ge = We - 1; ge >= 0; ge--) {
|
|
1540
1546
|
const Me = new Date(o, r - 1, Ge.getDate() - ge);
|
|
1541
|
-
|
|
1547
|
+
re.push({
|
|
1542
1548
|
date: Me,
|
|
1543
1549
|
day: Me.getDate(),
|
|
1544
1550
|
isCurrentMonth: !1,
|
|
@@ -1551,7 +1557,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1551
1557
|
}
|
|
1552
1558
|
for (let ge = 1; ge <= le; ge++) {
|
|
1553
1559
|
const Me = new Date(o, r, ge);
|
|
1554
|
-
|
|
1560
|
+
re.push({
|
|
1555
1561
|
date: Me,
|
|
1556
1562
|
day: ge,
|
|
1557
1563
|
isCurrentMonth: !0,
|
|
@@ -1561,10 +1567,10 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1561
1567
|
isDisabled: !1
|
|
1562
1568
|
});
|
|
1563
1569
|
}
|
|
1564
|
-
const et = 42 -
|
|
1570
|
+
const et = 42 - re.length;
|
|
1565
1571
|
for (let ge = 1; ge <= et; ge++) {
|
|
1566
1572
|
const Me = new Date(o, r + 1, ge);
|
|
1567
|
-
|
|
1573
|
+
re.push({
|
|
1568
1574
|
date: Me,
|
|
1569
1575
|
day: ge,
|
|
1570
1576
|
isCurrentMonth: !1,
|
|
@@ -1576,168 +1582,168 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1576
1582
|
});
|
|
1577
1583
|
}
|
|
1578
1584
|
const Oe = [];
|
|
1579
|
-
for (let ge = 0; ge <
|
|
1580
|
-
Oe.push(
|
|
1585
|
+
for (let ge = 0; ge < re.length; ge += 7)
|
|
1586
|
+
Oe.push(re.slice(ge, ge + 7));
|
|
1581
1587
|
return Oe;
|
|
1582
1588
|
}, v = (o) => {
|
|
1583
1589
|
const r = te(o);
|
|
1584
1590
|
l("update:modelValue", r), l("change", r);
|
|
1585
1591
|
}, f = () => {
|
|
1586
|
-
if (!
|
|
1587
|
-
const o =
|
|
1588
|
-
se <
|
|
1589
|
-
const xe =
|
|
1590
|
-
xe <
|
|
1592
|
+
if (!S.value || !L.value) return;
|
|
1593
|
+
const o = S.value.getBoundingClientRect(), r = L.value.getBoundingClientRect(), I = window.innerWidth, se = window.innerHeight - o.bottom, le = o.top, re = r.height || 400;
|
|
1594
|
+
se < re && le > re ? h.value.top = !1 : h.value.top = !0;
|
|
1595
|
+
const xe = I - o.left, We = r.width || 640;
|
|
1596
|
+
xe < We ? h.value.left = !1 : h.value.left = !0;
|
|
1591
1597
|
}, w = () => {
|
|
1592
1598
|
if (c.value = !c.value, c.value) {
|
|
1593
|
-
const o =
|
|
1594
|
-
if (P.value = (o == null ? void 0 : o.startDate) || null,
|
|
1599
|
+
const o = Z(t.modelValue);
|
|
1600
|
+
if (P.value = (o == null ? void 0 : o.startDate) || null, C.value = (o == null ? void 0 : o.endDate) || null, k.value = y(t.modelValue), s.value = -1, o != null && o.startDate && (d.value.year = o.startDate.getFullYear(), d.value.month = o.startDate.getMonth()), o != null && o.endDate)
|
|
1595
1601
|
u.value.year = o.endDate.getFullYear(), u.value.month = o.endDate.getMonth();
|
|
1596
1602
|
else {
|
|
1597
1603
|
const r = new Date(d.value.year, d.value.month + 1);
|
|
1598
1604
|
u.value.year = r.getFullYear(), u.value.month = r.getMonth();
|
|
1599
1605
|
}
|
|
1600
|
-
|
|
1606
|
+
E(), fe(() => {
|
|
1601
1607
|
f();
|
|
1602
1608
|
});
|
|
1603
1609
|
}
|
|
1604
1610
|
}, b = (o) => {
|
|
1605
|
-
const r = o.target,
|
|
1606
|
-
|
|
1611
|
+
const r = o.target, I = S.value, W = L.value;
|
|
1612
|
+
I && W && !I.contains(r) && !W.contains(r) && (c.value = !1, s.value = -1);
|
|
1607
1613
|
}, M = (o) => {
|
|
1608
1614
|
o.key === "Enter" || o.key === " " ? (o.preventDefault(), w()) : o.key === "ArrowDown" && (o.preventDefault(), c.value = !0, fe(() => {
|
|
1609
1615
|
f(), ne();
|
|
1610
1616
|
}));
|
|
1611
|
-
},
|
|
1617
|
+
}, F = (o) => {
|
|
1612
1618
|
var r;
|
|
1613
|
-
o.key === "Escape" && (c.value = !1, s.value = -1, (r =
|
|
1619
|
+
o.key === "Escape" && (c.value = !1, s.value = -1, (r = S.value) == null || r.focus());
|
|
1614
1620
|
}, p = (o, r) => {
|
|
1615
|
-
o.key === "ArrowDown" ? (o.preventDefault(), s.value = Math.min(r + 1, t.shortcuts.length - 1),
|
|
1621
|
+
o.key === "ArrowDown" ? (o.preventDefault(), s.value = Math.min(r + 1, t.shortcuts.length - 1), j(s.value)) : o.key === "ArrowUp" ? (o.preventDefault(), s.value = Math.max(r - 1, 0), j(s.value)) : (o.key === "Enter" || o.key === " ") && (o.preventDefault(), ee(t.shortcuts[r]));
|
|
1616
1622
|
}, D = (o) => {
|
|
1617
1623
|
s.value = o;
|
|
1618
|
-
},
|
|
1624
|
+
}, Y = () => {
|
|
1619
1625
|
s.value = -1;
|
|
1620
1626
|
}, ne = () => {
|
|
1621
|
-
s.value = 0,
|
|
1622
|
-
},
|
|
1623
|
-
if (
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1627
|
+
s.value = 0, j(0);
|
|
1628
|
+
}, j = (o) => {
|
|
1629
|
+
if (L.value) {
|
|
1630
|
+
const I = L.value.querySelectorAll(".nh-time-shortcut")[o];
|
|
1631
|
+
I && I.focus();
|
|
1626
1632
|
}
|
|
1627
1633
|
}, ee = (o) => {
|
|
1628
1634
|
const r = o.getValue();
|
|
1629
|
-
t.includeTime && r.startDate && r.endDate && (r.startDate.setHours(0, 0, 0, 0), r.endDate.setHours(23, 59, 59, 999)), v(r), k.value = t.shortcuts.findIndex((
|
|
1635
|
+
t.includeTime && r.startDate && r.endDate && (r.startDate.setHours(0, 0, 0, 0), r.endDate.setHours(23, 59, 59, 999)), v(r), k.value = t.shortcuts.findIndex((I) => I.label === o.label), s.value = -1, c.value = !1;
|
|
1630
1636
|
}, Ie = (o, r) => {
|
|
1631
1637
|
if (!o || o.isDisabled) return;
|
|
1632
|
-
let
|
|
1633
|
-
if (t.includeTime ? (
|
|
1634
|
-
P.value =
|
|
1635
|
-
else if (P.value &&
|
|
1636
|
-
if (
|
|
1637
|
-
t.includeTime &&
|
|
1638
|
+
let I;
|
|
1639
|
+
if (t.includeTime ? (I = new Date(o.date), r === "start" || !P.value ? I.setHours(0, 0, 0, 0) : I.setHours(23, 59, 59, 999)) : I = new Date(o.date.getFullYear(), o.date.getMonth(), o.date.getDate()), !P.value && !C.value)
|
|
1640
|
+
P.value = I, C.value = null;
|
|
1641
|
+
else if (P.value && !C.value)
|
|
1642
|
+
if (I >= P.value)
|
|
1643
|
+
t.includeTime && I.setHours(23, 59, 59, 999), C.value = I;
|
|
1638
1644
|
else {
|
|
1639
|
-
const
|
|
1640
|
-
t.includeTime &&
|
|
1645
|
+
const W = P.value;
|
|
1646
|
+
t.includeTime && W.setHours(23, 59, 59, 999), C.value = W, P.value = I;
|
|
1641
1647
|
}
|
|
1642
1648
|
else
|
|
1643
|
-
P.value =
|
|
1644
|
-
if (k.value = -1, P.value &&
|
|
1645
|
-
const
|
|
1646
|
-
t.includeTime &&
|
|
1649
|
+
P.value = I, C.value = null;
|
|
1650
|
+
if (k.value = -1, P.value && C.value) {
|
|
1651
|
+
const W = new Date(C.value);
|
|
1652
|
+
t.includeTime && W.setHours(23, 59, 59, 999), _.value = {
|
|
1647
1653
|
startDate: P.value,
|
|
1648
|
-
endDate:
|
|
1654
|
+
endDate: W
|
|
1649
1655
|
};
|
|
1650
1656
|
} else
|
|
1651
|
-
|
|
1657
|
+
_.value = null;
|
|
1652
1658
|
}, $e = (o, r) => {
|
|
1653
1659
|
if (!o) return ["nh-date-table-td"];
|
|
1654
|
-
const
|
|
1655
|
-
return o.isCurrentMonth ||
|
|
1656
|
-
},
|
|
1657
|
-
|
|
1660
|
+
const I = ["nh-date-table-td"];
|
|
1661
|
+
return o.isCurrentMonth || I.push("is-prev-month"), o.isToday && I.push("is-today"), o.isDisabled && I.push("is-disabled"), P.value && pe(o.date, P.value) && I.push("is-selected", "is-start"), C.value && pe(o.date, C.value) && I.push("is-selected", "is-end"), P.value && C.value && ae(o.date, P.value, C.value) && I.push("is-in-range"), I;
|
|
1662
|
+
}, Ve = () => {
|
|
1663
|
+
_.value && (t.includeTime && _.value.endDate && _.value.endDate.setHours(23, 59, 59, 999), v(_.value), k.value = y(_.value), c.value = !1);
|
|
1658
1664
|
}, He = () => {
|
|
1659
|
-
v({ startDate: null, endDate: null }),
|
|
1665
|
+
v({ startDate: null, endDate: null }), O(), s.value = -1, c.value = !1;
|
|
1660
1666
|
}, Te = () => {
|
|
1661
1667
|
c.value && fe(() => {
|
|
1662
1668
|
f();
|
|
1663
1669
|
});
|
|
1664
|
-
}, Ce =
|
|
1665
|
-
const o =
|
|
1670
|
+
}, Ce = U(() => g(d.value.year, d.value.month)), ze = U(() => g(u.value.year, u.value.month)), x = U(() => {
|
|
1671
|
+
const o = Z(t.modelValue);
|
|
1666
1672
|
if (!o || !o.startDate || !o.endDate)
|
|
1667
1673
|
return "";
|
|
1668
1674
|
const r = (se) => {
|
|
1669
|
-
const le = String(se.getFullYear()),
|
|
1670
|
-
return `${le}/${
|
|
1671
|
-
},
|
|
1672
|
-
return !t.includeTime &&
|
|
1673
|
-
}), B =
|
|
1675
|
+
const le = String(se.getFullYear()), re = String(se.getMonth() + 1).padStart(2, "0"), xe = String(se.getDate()).padStart(2, "0");
|
|
1676
|
+
return `${le}/${re}/${xe}`;
|
|
1677
|
+
}, I = r(o.startDate), W = r(o.endDate);
|
|
1678
|
+
return !t.includeTime && I === W ? I : `${I} - ${W}`;
|
|
1679
|
+
}), B = U(() => [
|
|
1674
1680
|
"nh-time-dropdown",
|
|
1675
1681
|
{
|
|
1676
1682
|
"nh-time-dropdown-top": !h.value.top,
|
|
1677
1683
|
"nh-time-dropdown-right": !h.value.left
|
|
1678
1684
|
}
|
|
1679
|
-
]),
|
|
1680
|
-
const o =
|
|
1685
|
+
]), z = U(() => {
|
|
1686
|
+
const o = Z(t.modelValue);
|
|
1681
1687
|
return !!(o != null && o.startDate && (o != null && o.endDate));
|
|
1682
|
-
}),
|
|
1683
|
-
P.value = null,
|
|
1688
|
+
}), $ = U(() => !!(P.value && C.value)), O = () => {
|
|
1689
|
+
P.value = null, C.value = null, _.value = null, k.value = -1;
|
|
1684
1690
|
};
|
|
1685
1691
|
oe(() => t.modelValue, (o) => {
|
|
1686
|
-
const r =
|
|
1692
|
+
const r = Z(o);
|
|
1687
1693
|
if (r != null && r.startDate) {
|
|
1688
|
-
const
|
|
1689
|
-
d.value.year =
|
|
1694
|
+
const I = r.startDate;
|
|
1695
|
+
d.value.year = I.getFullYear(), d.value.month = I.getMonth();
|
|
1690
1696
|
}
|
|
1691
1697
|
if (r != null && r.endDate) {
|
|
1692
|
-
const
|
|
1693
|
-
u.value.year =
|
|
1698
|
+
const I = r.endDate;
|
|
1699
|
+
u.value.year = I.getFullYear(), u.value.month = I.getMonth();
|
|
1694
1700
|
} else if (r != null && r.startDate) {
|
|
1695
|
-
const
|
|
1696
|
-
u.value.year =
|
|
1701
|
+
const I = new Date(d.value.year, d.value.month + 1);
|
|
1702
|
+
u.value.year = I.getFullYear(), u.value.month = I.getMonth();
|
|
1697
1703
|
}
|
|
1698
|
-
(r != null && r.startDate || r != null && r.endDate) &&
|
|
1704
|
+
(r != null && r.startDate || r != null && r.endDate) && E(), c.value || (k.value = y(o));
|
|
1699
1705
|
}, { immediate: !0, deep: !0 }), oe([d, u], () => {
|
|
1700
1706
|
const o = new Date(d.value.year, d.value.month).getTime(), r = new Date(u.value.year, u.value.month).getTime();
|
|
1701
1707
|
if (o === r) {
|
|
1702
|
-
const
|
|
1703
|
-
u.value.year =
|
|
1708
|
+
const I = new Date(d.value.year, d.value.month + 1);
|
|
1709
|
+
u.value.year = I.getFullYear(), u.value.month = I.getMonth();
|
|
1704
1710
|
}
|
|
1705
1711
|
}, { deep: !0 }), _e(() => {
|
|
1706
1712
|
document.addEventListener("click", b), window.addEventListener("resize", Te), window.addEventListener("scroll", Te), k.value = y(t.modelValue);
|
|
1707
|
-
const o =
|
|
1713
|
+
const o = Z(t.modelValue);
|
|
1708
1714
|
if (o != null && o.startDate && (d.value.year = o.startDate.getFullYear(), d.value.month = o.startDate.getMonth()), o != null && o.endDate)
|
|
1709
1715
|
u.value.year = o.endDate.getFullYear(), u.value.month = o.endDate.getMonth();
|
|
1710
1716
|
else {
|
|
1711
1717
|
const r = new Date(d.value.year, d.value.month + 1);
|
|
1712
1718
|
u.value.year = r.getFullYear(), u.value.month = r.getMonth();
|
|
1713
1719
|
}
|
|
1714
|
-
|
|
1715
|
-
}),
|
|
1720
|
+
E();
|
|
1721
|
+
}), Ee(() => {
|
|
1716
1722
|
document.removeEventListener("click", b), window.removeEventListener("resize", Te), window.removeEventListener("scroll", Te);
|
|
1717
1723
|
});
|
|
1718
|
-
const
|
|
1719
|
-
t.clearable && (v({ startDate: null, endDate: null }),
|
|
1720
|
-
},
|
|
1724
|
+
const Q = () => {
|
|
1725
|
+
t.clearable && (v({ startDate: null, endDate: null }), O(), s.value = -1);
|
|
1726
|
+
}, ie = (o, r) => {
|
|
1721
1727
|
if (o === "start") {
|
|
1722
|
-
const
|
|
1723
|
-
d.value.year =
|
|
1728
|
+
const I = new Date(d.value.year, d.value.month + r, 1);
|
|
1729
|
+
d.value.year = I.getFullYear(), d.value.month = I.getMonth(), E();
|
|
1724
1730
|
} else {
|
|
1725
|
-
const
|
|
1726
|
-
u.value.year =
|
|
1731
|
+
const I = new Date(u.value.year, u.value.month + r, 1);
|
|
1732
|
+
u.value.year = I.getFullYear(), u.value.month = I.getMonth(), N();
|
|
1727
1733
|
}
|
|
1728
1734
|
};
|
|
1729
1735
|
return (o, r) => {
|
|
1730
|
-
const
|
|
1736
|
+
const I = Ye("YButton");
|
|
1731
1737
|
return a(), i("div", {
|
|
1732
|
-
class:
|
|
1738
|
+
class: K(["nh-time-search", [`nh-time--${e.size}`]])
|
|
1733
1739
|
}, [
|
|
1734
1740
|
n("div", gn, [
|
|
1735
1741
|
n("div", {
|
|
1736
1742
|
ref_key: "trigger",
|
|
1737
|
-
ref:
|
|
1743
|
+
ref: S,
|
|
1738
1744
|
onClick: w,
|
|
1739
1745
|
onKeydown: M,
|
|
1740
|
-
class:
|
|
1746
|
+
class: K(["nh-time-trigger", { "is-focus": c.value, "has-value": z.value }]),
|
|
1741
1747
|
tabindex: "0"
|
|
1742
1748
|
}, [
|
|
1743
1749
|
n("input", {
|
|
@@ -1747,9 +1753,9 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1747
1753
|
class: "nh-time-input"
|
|
1748
1754
|
}, null, 8, yn),
|
|
1749
1755
|
n("span", mn, [
|
|
1750
|
-
e.clearable &&
|
|
1756
|
+
e.clearable && z.value ? (a(), i("i", {
|
|
1751
1757
|
key: 0,
|
|
1752
|
-
onClick: Q
|
|
1758
|
+
onClick: J(Q, ["stop"]),
|
|
1753
1759
|
class: "nh-time-clear"
|
|
1754
1760
|
}, [...r[4] || (r[4] = [
|
|
1755
1761
|
n("svg", {
|
|
@@ -1776,7 +1782,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1776
1782
|
])
|
|
1777
1783
|
], -1)),
|
|
1778
1784
|
n("i", {
|
|
1779
|
-
class:
|
|
1785
|
+
class: K(["nh-time-arrow", { "is-reverse": c.value }])
|
|
1780
1786
|
}, [...r[5] || (r[5] = [
|
|
1781
1787
|
n("svg", {
|
|
1782
1788
|
viewBox: "0 0 1024 1024",
|
|
@@ -1791,25 +1797,25 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1791
1797
|
])], 2)
|
|
1792
1798
|
])
|
|
1793
1799
|
], 34),
|
|
1794
|
-
|
|
1800
|
+
ce(ke, { name: "el-zoom-in-top" }, {
|
|
1795
1801
|
default: he(() => [
|
|
1796
1802
|
c.value ? (a(), i("div", {
|
|
1797
1803
|
key: 0,
|
|
1798
1804
|
ref_key: "dropdown",
|
|
1799
|
-
ref:
|
|
1800
|
-
class:
|
|
1801
|
-
onKeydown:
|
|
1805
|
+
ref: L,
|
|
1806
|
+
class: K(B.value),
|
|
1807
|
+
onKeydown: F
|
|
1802
1808
|
}, [
|
|
1803
1809
|
n("div", wn, [
|
|
1804
1810
|
r[7] || (r[7] = n("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1805
1811
|
n("ul", bn, [
|
|
1806
|
-
(a(!0), i(
|
|
1807
|
-
key:
|
|
1808
|
-
onClick: (le) => ee(
|
|
1812
|
+
(a(!0), i(ue, null, ve(e.shortcuts, (W, se) => (a(), i("li", {
|
|
1813
|
+
key: W.label,
|
|
1814
|
+
onClick: (le) => ee(W),
|
|
1809
1815
|
onKeydown: (le) => p(le, se),
|
|
1810
1816
|
onMouseenter: (le) => D(se),
|
|
1811
|
-
onMouseleave:
|
|
1812
|
-
class:
|
|
1817
|
+
onMouseleave: Y,
|
|
1818
|
+
class: K([
|
|
1813
1819
|
"nh-time-shortcut",
|
|
1814
1820
|
{
|
|
1815
1821
|
"is-active": s.value === se,
|
|
@@ -1817,22 +1823,22 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1817
1823
|
}
|
|
1818
1824
|
]),
|
|
1819
1825
|
tabindex: "0"
|
|
1820
|
-
}, G(
|
|
1826
|
+
}, G(W.label), 43, kn))), 128))
|
|
1821
1827
|
])
|
|
1822
1828
|
]),
|
|
1823
1829
|
n("div", xn, [
|
|
1824
1830
|
n("div", Dn, [
|
|
1825
1831
|
r[8] || (r[8] = n("span", null, "自定义时间", -1)),
|
|
1826
1832
|
n("div", $n, [
|
|
1827
|
-
!P.value &&
|
|
1833
|
+
!P.value && !C.value ? (a(), i("span", Cn, " 请选择开始日期 ")) : P.value && !C.value ? (a(), i("span", _n, " 请选择结束日期 ")) : P.value && C.value ? (a(), i("span", Mn, " 已选择完整范围 ")) : A("", !0)
|
|
1828
1834
|
])
|
|
1829
1835
|
]),
|
|
1830
1836
|
n("div", Sn, [
|
|
1831
1837
|
n("div", Ln, [
|
|
1832
1838
|
n("div", In, [
|
|
1833
|
-
n("div",
|
|
1839
|
+
n("div", Bn, [
|
|
1834
1840
|
n("button", {
|
|
1835
|
-
onClick: r[0] || (r[0] = (
|
|
1841
|
+
onClick: r[0] || (r[0] = (W) => ie("start", -1)),
|
|
1836
1842
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
1837
1843
|
type: "button"
|
|
1838
1844
|
}, [...r[9] || (r[9] = [
|
|
@@ -1847,9 +1853,9 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1847
1853
|
})
|
|
1848
1854
|
], -1)
|
|
1849
1855
|
])]),
|
|
1850
|
-
n("span",
|
|
1856
|
+
n("span", En, G(X(d.value.year, d.value.month)), 1),
|
|
1851
1857
|
n("button", {
|
|
1852
|
-
onClick: r[1] || (r[1] = (
|
|
1858
|
+
onClick: r[1] || (r[1] = (W) => ie("start", 1)),
|
|
1853
1859
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
1854
1860
|
type: "button"
|
|
1855
1861
|
}, [...r[10] || (r[10] = [
|
|
@@ -1869,19 +1875,19 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1869
1875
|
n("table", zn, [
|
|
1870
1876
|
n("thead", null, [
|
|
1871
1877
|
n("tr", null, [
|
|
1872
|
-
(a(), i(
|
|
1873
|
-
key:
|
|
1878
|
+
(a(), i(ue, null, ve(q, (W) => n("th", {
|
|
1879
|
+
key: W,
|
|
1874
1880
|
class: "nh-date-table-th"
|
|
1875
|
-
}, G(
|
|
1881
|
+
}, G(W), 1)), 64))
|
|
1876
1882
|
])
|
|
1877
1883
|
]),
|
|
1878
1884
|
n("tbody", null, [
|
|
1879
|
-
(a(!0), i(
|
|
1885
|
+
(a(!0), i(ue, null, ve(Ce.value, (W, se) => (a(), i("tr", {
|
|
1880
1886
|
key: `start-week-${se}`
|
|
1881
1887
|
}, [
|
|
1882
|
-
(a(!0), i(
|
|
1883
|
-
key: `start-day-${se}-${
|
|
1884
|
-
class:
|
|
1888
|
+
(a(!0), i(ue, null, ve(W, (le, re) => (a(), i("td", {
|
|
1889
|
+
key: `start-day-${se}-${re}`,
|
|
1890
|
+
class: K($e(le)),
|
|
1885
1891
|
onClick: (xe) => Ie(le, "start")
|
|
1886
1892
|
}, [
|
|
1887
1893
|
n("div", Hn, [
|
|
@@ -1896,9 +1902,9 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1896
1902
|
]),
|
|
1897
1903
|
n("div", Vn, [
|
|
1898
1904
|
n("div", An, [
|
|
1899
|
-
n("div",
|
|
1905
|
+
n("div", Yn, [
|
|
1900
1906
|
n("button", {
|
|
1901
|
-
onClick: r[2] || (r[2] = (
|
|
1907
|
+
onClick: r[2] || (r[2] = (W) => ie("end", -1)),
|
|
1902
1908
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
1903
1909
|
type: "button"
|
|
1904
1910
|
}, [...r[11] || (r[11] = [
|
|
@@ -1913,9 +1919,9 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1913
1919
|
})
|
|
1914
1920
|
], -1)
|
|
1915
1921
|
])]),
|
|
1916
|
-
n("span",
|
|
1922
|
+
n("span", Fn, G(X(u.value.year, u.value.month)), 1),
|
|
1917
1923
|
n("button", {
|
|
1918
|
-
onClick: r[3] || (r[3] = (
|
|
1924
|
+
onClick: r[3] || (r[3] = (W) => ie("end", 1)),
|
|
1919
1925
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
1920
1926
|
type: "button"
|
|
1921
1927
|
}, [...r[12] || (r[12] = [
|
|
@@ -1932,28 +1938,28 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1932
1938
|
])])
|
|
1933
1939
|
]),
|
|
1934
1940
|
n("div", Pn, [
|
|
1935
|
-
n("table",
|
|
1941
|
+
n("table", Wn, [
|
|
1936
1942
|
n("thead", null, [
|
|
1937
1943
|
n("tr", null, [
|
|
1938
|
-
(a(), i(
|
|
1939
|
-
key:
|
|
1944
|
+
(a(), i(ue, null, ve(q, (W) => n("th", {
|
|
1945
|
+
key: W,
|
|
1940
1946
|
class: "nh-date-table-th"
|
|
1941
|
-
}, G(
|
|
1947
|
+
}, G(W), 1)), 64))
|
|
1942
1948
|
])
|
|
1943
1949
|
]),
|
|
1944
1950
|
n("tbody", null, [
|
|
1945
|
-
(a(!0), i(
|
|
1951
|
+
(a(!0), i(ue, null, ve(ze.value, (W, se) => (a(), i("tr", {
|
|
1946
1952
|
key: `end-week-${se}`
|
|
1947
1953
|
}, [
|
|
1948
|
-
(a(!0), i(
|
|
1949
|
-
key: `end-day-${se}-${
|
|
1950
|
-
class:
|
|
1954
|
+
(a(!0), i(ue, null, ve(W, (le, re) => (a(), i("td", {
|
|
1955
|
+
key: `end-day-${se}-${re}`,
|
|
1956
|
+
class: K($e(le)),
|
|
1951
1957
|
onClick: (xe) => Ie(le, "end")
|
|
1952
1958
|
}, [
|
|
1953
1959
|
n("div", jn, [
|
|
1954
1960
|
le ? (a(), i("span", On, G(le.day), 1)) : A("", !0)
|
|
1955
1961
|
])
|
|
1956
|
-
], 10,
|
|
1962
|
+
], 10, Nn))), 128))
|
|
1957
1963
|
]))), 128))
|
|
1958
1964
|
])
|
|
1959
1965
|
])
|
|
@@ -1962,7 +1968,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1962
1968
|
])
|
|
1963
1969
|
]),
|
|
1964
1970
|
n("div", Un, [
|
|
1965
|
-
e.clearable ? (a(), Le(
|
|
1971
|
+
e.clearable ? (a(), Le(I, {
|
|
1966
1972
|
key: 0,
|
|
1967
1973
|
onClick: He,
|
|
1968
1974
|
variant: "secondary",
|
|
@@ -1973,14 +1979,14 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1973
1979
|
])]),
|
|
1974
1980
|
_: 1
|
|
1975
1981
|
}, 8, ["size"])) : A("", !0),
|
|
1976
|
-
|
|
1977
|
-
onClick:
|
|
1978
|
-
disabled:
|
|
1982
|
+
ce(I, {
|
|
1983
|
+
onClick: Ve,
|
|
1984
|
+
disabled: !$.value,
|
|
1979
1985
|
variant: "primary",
|
|
1980
1986
|
size: e.size
|
|
1981
1987
|
}, {
|
|
1982
1988
|
default: he(() => [
|
|
1983
|
-
De(G(P.value &&
|
|
1989
|
+
De(G(P.value && !C.value ? "继续选择结束日期" : "确认"), 1)
|
|
1984
1990
|
]),
|
|
1985
1991
|
_: 1
|
|
1986
1992
|
}, 8, ["disabled", "size"])
|
|
@@ -1994,7 +2000,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
1994
2000
|
], 2);
|
|
1995
2001
|
};
|
|
1996
2002
|
}
|
|
1997
|
-
}), Xe = /* @__PURE__ */ we(qn, [["__scopeId", "data-v-
|
|
2003
|
+
}), Xe = /* @__PURE__ */ we(qn, [["__scopeId", "data-v-e5ef63b1"]]), Zn = ["aria-checked", "aria-disabled", "disabled", "onKeydown"], Qn = { class: "yswitch__thumb" }, Jn = {
|
|
1998
2004
|
key: 0,
|
|
1999
2005
|
class: "yswitch__spinner",
|
|
2000
2006
|
"aria-hidden": "true"
|
|
@@ -2015,22 +2021,22 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2015
2021
|
},
|
|
2016
2022
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2017
2023
|
setup(e, { emit: m }) {
|
|
2018
|
-
const t = e, l = m, c = R(), s =
|
|
2019
|
-
const
|
|
2020
|
-
return
|
|
2024
|
+
const t = e, l = m, c = R(), s = U(() => t.modelValue === t.trueValue), k = U(() => {
|
|
2025
|
+
const S = {};
|
|
2026
|
+
return S.background = s.value ? t.activeColor : t.inactiveColor, S;
|
|
2021
2027
|
});
|
|
2022
|
-
function
|
|
2028
|
+
function _() {
|
|
2023
2029
|
if (t.disabled || t.loading) return;
|
|
2024
|
-
const
|
|
2025
|
-
l("update:modelValue",
|
|
2030
|
+
const S = s.value ? t.falseValue : t.trueValue;
|
|
2031
|
+
l("update:modelValue", S), l("change", S);
|
|
2026
2032
|
}
|
|
2027
2033
|
return _e(() => {
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2030
|
-
}), (
|
|
2034
|
+
const S = c.value;
|
|
2035
|
+
S && (S.addEventListener("focus", (L) => l("focus", L)), S.addEventListener("blur", (L) => l("blur", L)));
|
|
2036
|
+
}), (S, L) => (a(), i("button", {
|
|
2031
2037
|
ref_key: "rootEl",
|
|
2032
2038
|
ref: c,
|
|
2033
|
-
class:
|
|
2039
|
+
class: K(["yswitch", [
|
|
2034
2040
|
`yswitch--${e.size}`,
|
|
2035
2041
|
{ "yswitch--checked": s.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2036
2042
|
]]),
|
|
@@ -2039,19 +2045,19 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2039
2045
|
"aria-checked": s.value,
|
|
2040
2046
|
"aria-disabled": e.disabled,
|
|
2041
2047
|
disabled: e.disabled || e.loading,
|
|
2042
|
-
onClick:
|
|
2048
|
+
onClick: _,
|
|
2043
2049
|
onKeydown: [
|
|
2044
|
-
be(
|
|
2045
|
-
be(
|
|
2050
|
+
be(J(_, ["prevent"]), ["enter"]),
|
|
2051
|
+
be(J(_, ["prevent"]), ["space"])
|
|
2046
2052
|
]
|
|
2047
2053
|
}, [
|
|
2048
|
-
|
|
2054
|
+
L[0] || (L[0] = n("span", { class: "yswitch__track" }, null, -1)),
|
|
2049
2055
|
n("span", Qn, [
|
|
2050
2056
|
e.loading ? (a(), i("span", Jn)) : A("", !0)
|
|
2051
2057
|
]),
|
|
2052
2058
|
e.showText ? (a(), i("span", {
|
|
2053
2059
|
key: 0,
|
|
2054
|
-
class:
|
|
2060
|
+
class: K(["yswitch__label", { "yswitch__label--left": !s.value, "yswitch__label--right": s.value }])
|
|
2055
2061
|
}, G(s.value ? e.activeText : e.inactiveText), 3)) : A("", !0)
|
|
2056
2062
|
], 46, Zn));
|
|
2057
2063
|
}
|
|
@@ -2071,26 +2077,26 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2071
2077
|
},
|
|
2072
2078
|
emits: ["load", "error", "preview"],
|
|
2073
2079
|
setup(e, { expose: m, emit: t }) {
|
|
2074
|
-
const l = e, c = t, s = R(), k = R(),
|
|
2080
|
+
const l = e, c = t, s = R(), k = R(), _ = R(), S = R(!1), L = R(!1), h = R(!1), d = R(!1), u = R(!1), E = R("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), N = R(""), q = R(1), P = R(!1), C = R({
|
|
2075
2081
|
overflow: "",
|
|
2076
2082
|
paddingRight: ""
|
|
2077
|
-
}), V =
|
|
2083
|
+
}), V = U(() => [
|
|
2078
2084
|
l.className,
|
|
2079
2085
|
"overflow-hidden"
|
|
2080
|
-
].filter(Boolean).join(" ")), H =
|
|
2086
|
+
].filter(Boolean).join(" ")), H = U(() => [
|
|
2081
2087
|
X(),
|
|
2082
2088
|
ae()
|
|
2083
|
-
].filter(Boolean).join(" ")), T =
|
|
2089
|
+
].filter(Boolean).join(" ")), T = U(() => [
|
|
2084
2090
|
"w-full h-full bg-white",
|
|
2085
2091
|
pe(),
|
|
2086
2092
|
ae(),
|
|
2087
2093
|
l.preview ? "cursor-pointer hover:opacity-90 transition-opacity duration-200" : ""
|
|
2088
|
-
].filter(Boolean).join(" ")),
|
|
2094
|
+
].filter(Boolean).join(" ")), Z = U(() => [
|
|
2089
2095
|
X(),
|
|
2090
2096
|
ae()
|
|
2091
|
-
].filter(Boolean).join(" ")), te =
|
|
2092
|
-
const
|
|
2093
|
-
return l.width && (
|
|
2097
|
+
].filter(Boolean).join(" ")), te = U(() => {
|
|
2098
|
+
const j = {};
|
|
2099
|
+
return l.width && (j.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.height && (j.height = typeof l.height == "number" ? `${l.height}px` : l.height), j;
|
|
2094
2100
|
}), X = () => l.width && l.height ? "" : "w-full h-full", pe = () => ({
|
|
2095
2101
|
cover: "object-cover",
|
|
2096
2102
|
contain: "object-contain",
|
|
@@ -2098,12 +2104,12 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2098
2104
|
none: "object-none",
|
|
2099
2105
|
"scale-down": "object-scale-down"
|
|
2100
2106
|
})[l.fit] || "object-cover", ae = () => typeof l.radius == "number" ? `rounded-${l.radius}` : typeof l.radius == "string" ? l.radius.includes("px") ? "" : `rounded-${l.radius}` : "", y = () => {
|
|
2101
|
-
const
|
|
2102
|
-
|
|
2103
|
-
const ee =
|
|
2104
|
-
return document.body.removeChild(
|
|
2107
|
+
const j = document.createElement("div");
|
|
2108
|
+
j.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(j);
|
|
2109
|
+
const ee = j.offsetWidth - j.clientWidth;
|
|
2110
|
+
return document.body.removeChild(j), ee;
|
|
2105
2111
|
}, g = () => {
|
|
2106
|
-
if (
|
|
2112
|
+
if (C.value = {
|
|
2107
2113
|
overflow: document.body.style.overflow || "",
|
|
2108
2114
|
paddingRight: document.body.style.paddingRight || ""
|
|
2109
2115
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
@@ -2112,67 +2118,67 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2112
2118
|
}
|
|
2113
2119
|
document.body.style.overflow = "hidden";
|
|
2114
2120
|
}, v = () => {
|
|
2115
|
-
document.body.style.overflow =
|
|
2121
|
+
document.body.style.overflow = C.value.overflow, document.body.style.paddingRight = C.value.paddingRight;
|
|
2116
2122
|
};
|
|
2117
2123
|
let f = null;
|
|
2118
2124
|
const w = () => {
|
|
2119
2125
|
!l.lazy || !s.value || (f = new IntersectionObserver(
|
|
2120
|
-
(
|
|
2121
|
-
|
|
2122
|
-
ee.isIntersecting && (d.value = !0,
|
|
2126
|
+
(j) => {
|
|
2127
|
+
j.forEach((ee) => {
|
|
2128
|
+
ee.isIntersecting && (d.value = !0, E.value = l.src, f == null || f.unobserve(ee.target));
|
|
2123
2129
|
});
|
|
2124
2130
|
},
|
|
2125
2131
|
{
|
|
2126
2132
|
rootMargin: "50px"
|
|
2127
2133
|
}
|
|
2128
2134
|
), f.observe(s.value));
|
|
2129
|
-
}, b = (
|
|
2130
|
-
|
|
2131
|
-
}, M = (
|
|
2132
|
-
h.value = !0,
|
|
2133
|
-
},
|
|
2134
|
-
h.value = !1,
|
|
2135
|
+
}, b = (j) => {
|
|
2136
|
+
S.value = !0, L.value = !1, h.value = !1, c("load", j);
|
|
2137
|
+
}, M = (j) => {
|
|
2138
|
+
h.value = !0, L.value = !1, S.value = !1, c("error", j);
|
|
2139
|
+
}, F = () => {
|
|
2140
|
+
h.value = !1, L.value = !0, S.value = !1, fe(() => {
|
|
2135
2141
|
k.value && (k.value.src = l.src);
|
|
2136
2142
|
});
|
|
2137
2143
|
}, p = () => {
|
|
2138
2144
|
if (!l.preview || h.value) return;
|
|
2139
|
-
|
|
2140
|
-
const
|
|
2141
|
-
|
|
2142
|
-
|
|
2145
|
+
q.value = 1;
|
|
2146
|
+
const j = new Image();
|
|
2147
|
+
j.onload = () => {
|
|
2148
|
+
N.value = l.src, fe(() => {
|
|
2143
2149
|
u.value = !0, g(), c("preview", l.src);
|
|
2144
2150
|
});
|
|
2145
|
-
},
|
|
2146
|
-
|
|
2147
|
-
},
|
|
2151
|
+
}, j.onerror = () => {
|
|
2152
|
+
N.value = l.src, u.value = !0, g(), c("preview", l.src);
|
|
2153
|
+
}, j.src = l.src;
|
|
2148
2154
|
}, D = () => {
|
|
2149
2155
|
u.value = !1, setTimeout(() => {
|
|
2150
2156
|
v();
|
|
2151
2157
|
}, 300);
|
|
2152
|
-
},
|
|
2153
|
-
const ee =
|
|
2154
|
-
let $e =
|
|
2155
|
-
$e = Math.max(0.5, Math.min(2, $e)),
|
|
2158
|
+
}, Y = (j) => {
|
|
2159
|
+
const ee = j.deltaY < 0 ? 1 : -1;
|
|
2160
|
+
let $e = q.value + ee * 0.1;
|
|
2161
|
+
$e = Math.max(0.5, Math.min(2, $e)), q.value = $e;
|
|
2156
2162
|
};
|
|
2157
2163
|
return _e(() => {
|
|
2158
|
-
l.lazy ? w() : d.value = !0, d.value && (
|
|
2159
|
-
}),
|
|
2164
|
+
l.lazy ? w() : d.value = !0, d.value && (L.value = !0), P.value = !0;
|
|
2165
|
+
}), Ee(() => {
|
|
2160
2166
|
f && f.disconnect(), u.value && v();
|
|
2161
|
-
}), oe(() =>
|
|
2162
|
-
l.src && d.value && (
|
|
2163
|
-
}), oe(() => l.src, (
|
|
2164
|
-
|
|
2167
|
+
}), oe(() => E.value, () => {
|
|
2168
|
+
l.src && d.value && (L.value = !0, h.value = !1, S.value = !1);
|
|
2169
|
+
}), oe(() => l.src, (j) => {
|
|
2170
|
+
E.value = j || "";
|
|
2165
2171
|
}), m({
|
|
2166
|
-
retryLoad:
|
|
2172
|
+
retryLoad: F,
|
|
2167
2173
|
closePreview: D
|
|
2168
|
-
}), (
|
|
2174
|
+
}), (j, ee) => (a(), i("div", {
|
|
2169
2175
|
ref_key: "containerRef",
|
|
2170
2176
|
ref: s,
|
|
2171
|
-
class:
|
|
2177
|
+
class: K(["relative inline-block", V.value])
|
|
2172
2178
|
}, [
|
|
2173
|
-
!
|
|
2179
|
+
!S.value && !h.value && !d.value ? (a(), i("div", {
|
|
2174
2180
|
key: 0,
|
|
2175
|
-
class:
|
|
2181
|
+
class: K(["bg-gray-200 animate-pulse rounded", H.value])
|
|
2176
2182
|
}, [...ee[1] || (ee[1] = [
|
|
2177
2183
|
n("div", { class: "flex items-center justify-center h-full" }, [
|
|
2178
2184
|
n("svg", {
|
|
@@ -2190,9 +2196,9 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2190
2196
|
])
|
|
2191
2197
|
], -1)
|
|
2192
2198
|
])], 2)) : A("", !0),
|
|
2193
|
-
|
|
2199
|
+
L.value && !h.value ? (a(), i("div", {
|
|
2194
2200
|
key: 1,
|
|
2195
|
-
class:
|
|
2201
|
+
class: K(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded", T.value])
|
|
2196
2202
|
}, [...ee[2] || (ee[2] = [
|
|
2197
2203
|
n("div", { class: "flex flex-col items-center space-y-2" }, [
|
|
2198
2204
|
n("div", { class: "w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin" })
|
|
@@ -2200,52 +2206,52 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2200
2206
|
])], 2)) : A("", !0),
|
|
2201
2207
|
h.value ? (a(), i("div", {
|
|
2202
2208
|
key: 2,
|
|
2203
|
-
class:
|
|
2204
|
-
onClick:
|
|
2209
|
+
class: K(["bg-gray-100 rounded flex items-center justify-center", Z.value]),
|
|
2210
|
+
onClick: F
|
|
2205
2211
|
}, [
|
|
2206
2212
|
n("img", {
|
|
2207
2213
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2208
2214
|
alt: "Error Image",
|
|
2209
|
-
class:
|
|
2215
|
+
class: K(["w-[70%] h-[70%] object-contain cursor-pointer", ae()])
|
|
2210
2216
|
}, null, 2)
|
|
2211
2217
|
], 2)) : A("", !0),
|
|
2212
|
-
|
|
2218
|
+
Be(n("img", {
|
|
2213
2219
|
ref_key: "imageRef",
|
|
2214
2220
|
ref: k,
|
|
2215
|
-
src:
|
|
2221
|
+
src: E.value,
|
|
2216
2222
|
alt: e.alt,
|
|
2217
|
-
class:
|
|
2223
|
+
class: K(T.value),
|
|
2218
2224
|
onLoad: b,
|
|
2219
2225
|
onError: M,
|
|
2220
2226
|
onClick: p,
|
|
2221
2227
|
style: ye(te.value)
|
|
2222
2228
|
}, null, 46, el), [
|
|
2223
|
-
[Ke,
|
|
2229
|
+
[Ke, S.value && !h.value]
|
|
2224
2230
|
]),
|
|
2225
|
-
P.value ? (a(), Le(
|
|
2231
|
+
P.value ? (a(), Le(Re, {
|
|
2226
2232
|
key: 3,
|
|
2227
2233
|
to: "body"
|
|
2228
2234
|
}, [
|
|
2229
|
-
|
|
2235
|
+
ce(ke, { name: "fade" }, {
|
|
2230
2236
|
default: he(() => [
|
|
2231
2237
|
u.value ? (a(), i("div", {
|
|
2232
2238
|
key: 0,
|
|
2233
2239
|
class: "fixed inset-0 bg-black/75 flex items-center justify-center",
|
|
2234
2240
|
style: { "z-index": "99999" },
|
|
2235
|
-
onClick:
|
|
2236
|
-
onWheel:
|
|
2241
|
+
onClick: J(D, ["self"]),
|
|
2242
|
+
onWheel: J(Y, ["prevent"])
|
|
2237
2243
|
}, [
|
|
2238
2244
|
n("div", {
|
|
2239
|
-
class:
|
|
2245
|
+
class: K(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100": u.value, "scale-95": !u.value }])
|
|
2240
2246
|
}, [
|
|
2241
2247
|
n("img", {
|
|
2242
2248
|
ref_key: "previewImageRef",
|
|
2243
|
-
ref:
|
|
2244
|
-
src: l.previewSrcList ||
|
|
2249
|
+
ref: _,
|
|
2250
|
+
src: l.previewSrcList || N.value || l.src,
|
|
2245
2251
|
alt: e.alt,
|
|
2246
2252
|
class: "max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",
|
|
2247
|
-
style: ye({ transform: `scale(${
|
|
2248
|
-
onClick: ee[0] || (ee[0] =
|
|
2253
|
+
style: ye({ transform: `scale(${q.value})` }),
|
|
2254
|
+
onClick: ee[0] || (ee[0] = J(() => {
|
|
2249
2255
|
}, ["stop"]))
|
|
2250
2256
|
}, null, 12, tl)
|
|
2251
2257
|
], 2)
|
|
@@ -2266,54 +2272,54 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2266
2272
|
setup(e) {
|
|
2267
2273
|
const m = e, t = R(!1), l = R();
|
|
2268
2274
|
let c = null;
|
|
2269
|
-
const s =
|
|
2275
|
+
const s = U(() => `y-dropdown__menu--${m.placement}`), k = () => {
|
|
2270
2276
|
console.log("显示下拉菜单", t.value), !m.disabled && (c && (clearTimeout(c), c = null), t.value = !0, console.log("设置 visible 为 true", t.value), fe(() => {
|
|
2271
|
-
|
|
2277
|
+
S();
|
|
2272
2278
|
}));
|
|
2273
|
-
},
|
|
2279
|
+
}, _ = () => {
|
|
2274
2280
|
console.log("隐藏下拉菜单"), c = setTimeout(() => {
|
|
2275
2281
|
t.value = !1, console.log("设置 visible 为 false", t.value);
|
|
2276
2282
|
}, 150);
|
|
2277
|
-
},
|
|
2283
|
+
}, S = () => {
|
|
2278
2284
|
if (!l.value) return;
|
|
2279
2285
|
const d = l.value.querySelector(".y-dropdown__trigger"), u = l.value.querySelector(".y-dropdown__menu");
|
|
2280
2286
|
if (!d || !u) return;
|
|
2281
|
-
const
|
|
2287
|
+
const E = d.getBoundingClientRect(), N = u.getBoundingClientRect(), q = window.innerWidth, P = window.innerHeight;
|
|
2282
2288
|
u.style.top = "", u.style.left = "", u.style.right = "", u.style.bottom = "", u.style.transform = "";
|
|
2283
|
-
let
|
|
2289
|
+
let C = 0, V = 0;
|
|
2284
2290
|
switch (m.placement) {
|
|
2285
2291
|
case "bottom":
|
|
2286
|
-
|
|
2292
|
+
C = E.height + 4, V = 0;
|
|
2287
2293
|
break;
|
|
2288
2294
|
case "top":
|
|
2289
|
-
|
|
2295
|
+
C = -(N.height + 4), V = 0;
|
|
2290
2296
|
break;
|
|
2291
2297
|
case "right":
|
|
2292
|
-
|
|
2298
|
+
C = 0, V = E.width + 4;
|
|
2293
2299
|
break;
|
|
2294
2300
|
case "left":
|
|
2295
|
-
|
|
2301
|
+
C = 0, V = -(N.width + 4);
|
|
2296
2302
|
break;
|
|
2297
2303
|
}
|
|
2298
|
-
let H =
|
|
2304
|
+
let H = E.top + C, T = E.left + V;
|
|
2299
2305
|
if (m.placement === "bottom" || m.placement === "top") {
|
|
2300
|
-
const
|
|
2301
|
-
T +
|
|
2306
|
+
const Z = N.width || 260;
|
|
2307
|
+
T + Z > q - 10 && (T = q - Z - 10), T < 10 && (T = 10);
|
|
2302
2308
|
}
|
|
2303
2309
|
if (m.placement === "left" || m.placement === "right") {
|
|
2304
|
-
const
|
|
2305
|
-
H +
|
|
2310
|
+
const Z = N.height || 200;
|
|
2311
|
+
H + Z > P - 10 && (H = P - Z - 10), H < 10 && (H = 10);
|
|
2306
2312
|
}
|
|
2307
2313
|
u.style.top = `${H}px`, u.style.left = `${T}px`;
|
|
2308
|
-
},
|
|
2314
|
+
}, L = (d) => {
|
|
2309
2315
|
m.trigger === "click" && l.value && !l.value.contains(d.target) && (t.value = !1);
|
|
2310
2316
|
}, h = () => {
|
|
2311
|
-
t.value &&
|
|
2317
|
+
t.value && S();
|
|
2312
2318
|
};
|
|
2313
2319
|
return _e(() => {
|
|
2314
|
-
m.trigger === "click" && document.addEventListener("click",
|
|
2315
|
-
}),
|
|
2316
|
-
m.trigger === "click" && document.removeEventListener("click",
|
|
2320
|
+
m.trigger === "click" && document.addEventListener("click", L), window.addEventListener("resize", h), window.addEventListener("scroll", h);
|
|
2321
|
+
}), Ee(() => {
|
|
2322
|
+
m.trigger === "click" && document.removeEventListener("click", L), c && clearTimeout(c), window.removeEventListener("resize", h), window.removeEventListener("scroll", h);
|
|
2317
2323
|
}), (d, u) => (a(), i("div", {
|
|
2318
2324
|
class: "y-dropdown",
|
|
2319
2325
|
ref_key: "dropdownRef",
|
|
@@ -2322,23 +2328,23 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2322
2328
|
n("div", {
|
|
2323
2329
|
class: "y-dropdown__trigger",
|
|
2324
2330
|
onMouseenter: k,
|
|
2325
|
-
onMouseleave:
|
|
2331
|
+
onMouseleave: _
|
|
2326
2332
|
}, [
|
|
2327
|
-
|
|
2333
|
+
de(d.$slots, "trigger", {}, () => [
|
|
2328
2334
|
u[0] || (u[0] = n("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2329
2335
|
], !0)
|
|
2330
2336
|
], 32),
|
|
2331
|
-
|
|
2337
|
+
ce(ke, {
|
|
2332
2338
|
name: "dropdown-fade",
|
|
2333
2339
|
appear: ""
|
|
2334
2340
|
}, {
|
|
2335
2341
|
default: he(() => [
|
|
2336
|
-
|
|
2337
|
-
class:
|
|
2342
|
+
Be(n("div", {
|
|
2343
|
+
class: K(["y-dropdown__menu", s.value]),
|
|
2338
2344
|
onMouseenter: k,
|
|
2339
|
-
onMouseleave:
|
|
2345
|
+
onMouseleave: _
|
|
2340
2346
|
}, [
|
|
2341
|
-
|
|
2347
|
+
de(d.$slots, "default", {}, () => [
|
|
2342
2348
|
u[1] || (u[1] = n("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2343
2349
|
u[2] || (u[2] = n("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2344
2350
|
u[3] || (u[3] = n("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
@@ -2372,14 +2378,14 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2372
2378
|
},
|
|
2373
2379
|
emits: ["update:modelValue", "open", "close"],
|
|
2374
2380
|
setup(e, { emit: m }) {
|
|
2375
|
-
const t = e, l = m, c =
|
|
2381
|
+
const t = e, l = m, c = U({
|
|
2376
2382
|
get: () => t.modelValue,
|
|
2377
|
-
set: (
|
|
2378
|
-
}), s = R(null), k =
|
|
2379
|
-
const
|
|
2380
|
-
return t.placement === "right" ? (
|
|
2383
|
+
set: (E) => l("update:modelValue", E)
|
|
2384
|
+
}), s = R(null), k = U(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), _ = U(() => t.placement === "right" ? "rounded-left" : "rounded-top"), S = U(() => {
|
|
2385
|
+
const E = {};
|
|
2386
|
+
return t.placement === "right" ? (E.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), E.height = "100%", E.right = "0", E.top = "0") : (E.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), E.width = "100%", E.bottom = "0", E.left = "0"), E;
|
|
2381
2387
|
});
|
|
2382
|
-
function
|
|
2388
|
+
function L() {
|
|
2383
2389
|
t.maskClosable && h();
|
|
2384
2390
|
}
|
|
2385
2391
|
function h() {
|
|
@@ -2388,20 +2394,20 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2388
2394
|
function d() {
|
|
2389
2395
|
t.closable && h();
|
|
2390
2396
|
}
|
|
2391
|
-
function u(
|
|
2392
|
-
|
|
2397
|
+
function u(E) {
|
|
2398
|
+
E.key === "Escape" && d();
|
|
2393
2399
|
}
|
|
2394
|
-
return oe(() => t.modelValue, (
|
|
2395
|
-
|
|
2396
|
-
var
|
|
2397
|
-
return (
|
|
2400
|
+
return oe(() => t.modelValue, (E) => {
|
|
2401
|
+
E ? (l("open"), requestAnimationFrame(() => {
|
|
2402
|
+
var N;
|
|
2403
|
+
return (N = s.value) == null ? void 0 : N.focus();
|
|
2398
2404
|
}), document.addEventListener("keydown", u), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", u), document.body.style.overflow = "");
|
|
2399
2405
|
}), _e(() => {
|
|
2400
2406
|
t.modelValue && (document.addEventListener("keydown", u), document.body.style.overflow = "hidden");
|
|
2401
|
-
}),
|
|
2407
|
+
}), Ee(() => {
|
|
2402
2408
|
document.removeEventListener("keydown", u), document.body.style.overflow = "";
|
|
2403
|
-
}), (
|
|
2404
|
-
|
|
2409
|
+
}), (E, N) => (a(), Le(Re, { to: "body" }, [
|
|
2410
|
+
Be(n("div", {
|
|
2405
2411
|
class: "y-drawer-root",
|
|
2406
2412
|
role: "dialog",
|
|
2407
2413
|
"aria-modal": !0,
|
|
@@ -2410,19 +2416,19 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2410
2416
|
}, [
|
|
2411
2417
|
n("div", {
|
|
2412
2418
|
class: "y-drawer-mask",
|
|
2413
|
-
onClick:
|
|
2419
|
+
onClick: L
|
|
2414
2420
|
}),
|
|
2415
|
-
|
|
2421
|
+
ce(ke, { name: k.value }, {
|
|
2416
2422
|
default: he(() => [
|
|
2417
|
-
|
|
2423
|
+
Be(n("div", {
|
|
2418
2424
|
ref_key: "panelRef",
|
|
2419
2425
|
ref: s,
|
|
2420
|
-
class:
|
|
2426
|
+
class: K(["y-drawer-panel", [
|
|
2421
2427
|
`is-${e.placement}`,
|
|
2422
|
-
|
|
2428
|
+
_.value
|
|
2423
2429
|
]]),
|
|
2424
|
-
style: ye(
|
|
2425
|
-
onKeydown: be(
|
|
2430
|
+
style: ye(S.value),
|
|
2431
|
+
onKeydown: be(J(d, ["prevent", "stop"]), ["esc"]),
|
|
2426
2432
|
tabindex: "-1"
|
|
2427
2433
|
}, [
|
|
2428
2434
|
e.showHeader ? (a(), i("div", rl, [
|
|
@@ -2436,10 +2442,10 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2436
2442
|
}, " ✕ ")) : A("", !0)
|
|
2437
2443
|
])) : A("", !0),
|
|
2438
2444
|
n("div", dl, [
|
|
2439
|
-
|
|
2445
|
+
de(E.$slots, "default", {}, void 0, !0)
|
|
2440
2446
|
]),
|
|
2441
|
-
|
|
2442
|
-
|
|
2447
|
+
E.$slots.footer ? (a(), i("div", cl, [
|
|
2448
|
+
de(E.$slots, "footer", {}, void 0, !0)
|
|
2443
2449
|
])) : A("", !0)
|
|
2444
2450
|
], 46, il), [
|
|
2445
2451
|
[Ke, c.value]
|
|
@@ -2485,7 +2491,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2485
2491
|
height: "12",
|
|
2486
2492
|
viewBox: "0 0 12 12",
|
|
2487
2493
|
fill: "none"
|
|
2488
|
-
}, Il = ["src", "alt"],
|
|
2494
|
+
}, Il = ["src", "alt"], Bl = { class: "ytree-node__custom-content" }, El = {
|
|
2489
2495
|
key: 0,
|
|
2490
2496
|
class: "ytree-node__children"
|
|
2491
2497
|
}, Tl = ["data-level", "onClick", "onContextmenu"], zl = ["onClick"], Kl = {
|
|
@@ -2503,10 +2509,10 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2503
2509
|
height: "12",
|
|
2504
2510
|
viewBox: "0 0 12 12",
|
|
2505
2511
|
fill: "none"
|
|
2506
|
-
}, Al = ["src", "alt"],
|
|
2512
|
+
}, Al = ["src", "alt"], Yl = { class: "ytree-node__custom-content" }, Fl = {
|
|
2507
2513
|
key: 0,
|
|
2508
2514
|
class: "ytree-node__children"
|
|
2509
|
-
}, Pl = ["data-level", "onClick", "onContextmenu"],
|
|
2515
|
+
}, Pl = ["data-level", "onClick", "onContextmenu"], Wl = ["onClick"], Nl = {
|
|
2510
2516
|
key: 1,
|
|
2511
2517
|
class: "w-[16px]"
|
|
2512
2518
|
}, jl = ["onClick"], Ol = {
|
|
@@ -2585,30 +2591,30 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2585
2591
|
},
|
|
2586
2592
|
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"],
|
|
2587
2593
|
setup(e, { emit: m }) {
|
|
2588
|
-
const t = e, l = m, c =
|
|
2594
|
+
const t = e, l = m, c = U(() => (console.log("ytree 组件接收到的数据:", t.data), t.data || [])), s = R({
|
|
2589
2595
|
currentNode: null,
|
|
2590
2596
|
currentKey: null,
|
|
2591
2597
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
2592
2598
|
expandedKeys: /* @__PURE__ */ new Set(),
|
|
2593
2599
|
selectedKeys: /* @__PURE__ */ new Set()
|
|
2594
2600
|
});
|
|
2595
|
-
|
|
2596
|
-
const k =
|
|
2597
|
-
function
|
|
2601
|
+
nt("treeStore", s);
|
|
2602
|
+
const k = U(() => t.restrictAutoExpandFromLevel && t.restrictAutoExpandFromLevel > 0 ? t.restrictAutoExpandFromLevel : void 0);
|
|
2603
|
+
function _(y) {
|
|
2598
2604
|
return y[t.nodeKey] || y.id || Math.random();
|
|
2599
2605
|
}
|
|
2600
|
-
function
|
|
2606
|
+
function S(y) {
|
|
2601
2607
|
var g;
|
|
2602
2608
|
return ((g = t.props) != null && g.label ? y[t.props.label] : void 0) || y.label || "";
|
|
2603
2609
|
}
|
|
2604
|
-
function
|
|
2610
|
+
function L(y) {
|
|
2605
2611
|
var g;
|
|
2606
2612
|
return !!((g = y == null ? void 0 : y.data) != null && g.isEmployee);
|
|
2607
2613
|
}
|
|
2608
2614
|
function h(y) {
|
|
2609
2615
|
var w;
|
|
2610
2616
|
const g = t.deptIconUrl || ao, v = t.personIconUrl || so, f = t.buttonIconUrl || "";
|
|
2611
|
-
return (w = y == null ? void 0 : y.data) != null && w.isButton && f ? f :
|
|
2617
|
+
return (w = y == null ? void 0 : y.data) != null && w.isButton && f ? f : L(y) ? v : g;
|
|
2612
2618
|
}
|
|
2613
2619
|
function d(y) {
|
|
2614
2620
|
var v;
|
|
@@ -2619,26 +2625,26 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2619
2625
|
var g;
|
|
2620
2626
|
return ((g = t.props) != null && g.children ? y[t.props.children] : void 0) || y.children || [];
|
|
2621
2627
|
}
|
|
2622
|
-
function
|
|
2628
|
+
function E(y, g, v = 1) {
|
|
2623
2629
|
if (y === g)
|
|
2624
2630
|
return v;
|
|
2625
2631
|
const f = u(y);
|
|
2626
2632
|
for (const w of f) {
|
|
2627
|
-
const b =
|
|
2633
|
+
const b = E(w, g, v + 1);
|
|
2628
2634
|
if (b > 0)
|
|
2629
2635
|
return b;
|
|
2630
2636
|
}
|
|
2631
2637
|
return 0;
|
|
2632
2638
|
}
|
|
2633
|
-
function
|
|
2634
|
-
const g =
|
|
2639
|
+
function N(y) {
|
|
2640
|
+
const g = _(y);
|
|
2635
2641
|
return s.value.expandedKeys.has(g);
|
|
2636
2642
|
}
|
|
2637
|
-
function
|
|
2638
|
-
const g =
|
|
2643
|
+
function q(y) {
|
|
2644
|
+
const g = _(y);
|
|
2639
2645
|
if (s.value.checkedKeys.has(g)) {
|
|
2640
2646
|
if (d(y)) {
|
|
2641
|
-
const f = u(y), w = f.filter((M) =>
|
|
2647
|
+
const f = u(y), w = f.filter((M) => q(M)), b = f.filter(
|
|
2642
2648
|
(M) => P(M)
|
|
2643
2649
|
);
|
|
2644
2650
|
return w.length === f.length && b.length === 0;
|
|
@@ -2649,32 +2655,32 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2649
2655
|
const f = u(y);
|
|
2650
2656
|
return f.some(
|
|
2651
2657
|
(b) => P(b)
|
|
2652
|
-
) ? !1 : f.length > 0 && f.every((b) =>
|
|
2658
|
+
) ? !1 : f.length > 0 && f.every((b) => q(b));
|
|
2653
2659
|
}
|
|
2654
2660
|
return !1;
|
|
2655
2661
|
}
|
|
2656
2662
|
function P(y) {
|
|
2657
2663
|
if (!d(y)) return !1;
|
|
2658
|
-
const g = u(y), v = g.filter((w) =>
|
|
2664
|
+
const g = u(y), v = g.filter((w) => q(w)), f = g.filter(
|
|
2659
2665
|
(w) => P(w)
|
|
2660
2666
|
);
|
|
2661
2667
|
return v.length === g.length ? !1 : v.length > 0 || f.length > 0;
|
|
2662
2668
|
}
|
|
2663
|
-
function
|
|
2664
|
-
const g =
|
|
2669
|
+
function C(y) {
|
|
2670
|
+
const g = _(y);
|
|
2665
2671
|
return s.value.currentKey === g;
|
|
2666
2672
|
}
|
|
2667
2673
|
function V(y) {
|
|
2668
2674
|
if (t.disabled) return;
|
|
2669
|
-
const g =
|
|
2675
|
+
const g = _(y), f = !s.value.checkedKeys.has(g), w = new Set(s.value.expandedKeys);
|
|
2670
2676
|
f ? s.value.checkedKeys.add(g) : s.value.checkedKeys.delete(g);
|
|
2671
|
-
function b(M,
|
|
2677
|
+
function b(M, F) {
|
|
2672
2678
|
M.forEach((p) => {
|
|
2673
|
-
const D =
|
|
2674
|
-
|
|
2679
|
+
const D = _(p);
|
|
2680
|
+
F ? s.value.checkedKeys.add(D) : s.value.checkedKeys.delete(D), d(p) && b(u(p), F);
|
|
2675
2681
|
});
|
|
2676
2682
|
}
|
|
2677
|
-
b(u(y), f), f && H(),
|
|
2683
|
+
b(u(y), f), f && H(), Z(), s.value.expandedKeys = w, l("check-change", y, f, !1), l("check", y, f, !1), l("checked-keys-change", Array.from(s.value.checkedKeys));
|
|
2678
2684
|
}
|
|
2679
2685
|
function H(y) {
|
|
2680
2686
|
k.value && console.log(
|
|
@@ -2682,10 +2688,10 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2682
2688
|
);
|
|
2683
2689
|
}
|
|
2684
2690
|
function T(y) {
|
|
2685
|
-
const g =
|
|
2691
|
+
const g = _(y);
|
|
2686
2692
|
s.value.expandedKeys.has(g) ? (s.value.expandedKeys.delete(g), l("node-collapse", y, y, null)) : (s.value.expandedKeys.add(g), l("node-expand", y, y, null));
|
|
2687
2693
|
}
|
|
2688
|
-
function
|
|
2694
|
+
function Z() {
|
|
2689
2695
|
const y = [];
|
|
2690
2696
|
function g(f) {
|
|
2691
2697
|
f.forEach((w) => {
|
|
@@ -2695,17 +2701,17 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2695
2701
|
g(c.value);
|
|
2696
2702
|
function v(f) {
|
|
2697
2703
|
if (d(f)) {
|
|
2698
|
-
const w = u(f), b =
|
|
2704
|
+
const w = u(f), b = _(f), M = w.filter((p) => q(p)), F = w.filter(
|
|
2699
2705
|
(p) => P(p)
|
|
2700
2706
|
);
|
|
2701
|
-
M.length === w.length &&
|
|
2707
|
+
M.length === w.length && F.length === 0 || M.length > 0 || F.length > 0 ? s.value.checkedKeys.add(b) : s.value.checkedKeys.delete(b);
|
|
2702
2708
|
}
|
|
2703
2709
|
}
|
|
2704
2710
|
for (let f = y.length - 1; f >= 0; f--)
|
|
2705
2711
|
v(y[f]);
|
|
2706
2712
|
}
|
|
2707
2713
|
function te(y, g, v) {
|
|
2708
|
-
t.disabled || (s.value.currentNode = y, s.value.currentKey =
|
|
2714
|
+
t.disabled || (s.value.currentNode = y, s.value.currentKey = _(y), t.showCheckbox && V(y), l("node-click", y, g, v));
|
|
2709
2715
|
}
|
|
2710
2716
|
function X(y, g, v, f) {
|
|
2711
2717
|
t.disabled || l("node-contextmenu", y, g, v, f);
|
|
@@ -2716,23 +2722,23 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2716
2722
|
if (y) {
|
|
2717
2723
|
const g = k.value;
|
|
2718
2724
|
if (g) {
|
|
2719
|
-
let v = function(M,
|
|
2720
|
-
for (const D of
|
|
2721
|
-
if (
|
|
2725
|
+
let v = function(M, F, p = 1) {
|
|
2726
|
+
for (const D of F) {
|
|
2727
|
+
if (_(D) === M) return p;
|
|
2722
2728
|
if (d(D)) {
|
|
2723
|
-
const
|
|
2724
|
-
if (
|
|
2729
|
+
const Y = v(M, u(D), p + 1);
|
|
2730
|
+
if (Y > 0) return Y;
|
|
2725
2731
|
}
|
|
2726
2732
|
}
|
|
2727
2733
|
return 0;
|
|
2728
|
-
}, f = function(M,
|
|
2734
|
+
}, f = function(M, F, p) {
|
|
2729
2735
|
M.forEach((D) => {
|
|
2730
|
-
|
|
2736
|
+
F < p && d(D) ? (b.add(_(D)), f(u(D), F + 1, p)) : F < p && d(D);
|
|
2731
2737
|
});
|
|
2732
2738
|
};
|
|
2733
2739
|
const w = (y || []).filter((M) => {
|
|
2734
|
-
const
|
|
2735
|
-
return
|
|
2740
|
+
const F = v(M, c.value, 1);
|
|
2741
|
+
return F > 0 && F < g;
|
|
2736
2742
|
}), b = new Set(w);
|
|
2737
2743
|
f(c.value, 1, g), s.value.expandedKeys.forEach((M) => {
|
|
2738
2744
|
v(M, c.value, 1) >= g && b.add(M);
|
|
@@ -2751,9 +2757,9 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2751
2757
|
const M = u(b);
|
|
2752
2758
|
if (v) {
|
|
2753
2759
|
if (w >= v) return;
|
|
2754
|
-
w + 1 === v || g.add(
|
|
2760
|
+
w + 1 === v || g.add(_(b)), y(M, w + 1);
|
|
2755
2761
|
} else
|
|
2756
|
-
g.add(
|
|
2762
|
+
g.add(_(b)), y(M, w + 1);
|
|
2757
2763
|
});
|
|
2758
2764
|
};
|
|
2759
2765
|
const g = /* @__PURE__ */ new Set(), v = k.value;
|
|
@@ -2764,8 +2770,8 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2764
2770
|
if (t.defaultCheckedKeys && t.defaultCheckedKeys.length > 0) {
|
|
2765
2771
|
let y = function(w, b = []) {
|
|
2766
2772
|
w.forEach((M) => {
|
|
2767
|
-
const
|
|
2768
|
-
g.has(
|
|
2773
|
+
const F = _(M), p = [...b, F];
|
|
2774
|
+
g.has(F) && b.forEach((D) => v.add(D)), d(M) && y(u(M), p);
|
|
2769
2775
|
});
|
|
2770
2776
|
};
|
|
2771
2777
|
const g = new Set(t.defaultCheckedKeys), v = /* @__PURE__ */ new Set();
|
|
@@ -2793,24 +2799,24 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2793
2799
|
},
|
|
2794
2800
|
{ immediate: !0 }
|
|
2795
2801
|
), (y, g) => (a(), i("div", {
|
|
2796
|
-
class:
|
|
2802
|
+
class: K(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
2797
2803
|
}, [
|
|
2798
2804
|
n("div", hl, [
|
|
2799
|
-
(a(!0), i(
|
|
2800
|
-
key:
|
|
2801
|
-
class:
|
|
2805
|
+
(a(!0), i(ue, null, ve(c.value, (v) => (a(), i("div", {
|
|
2806
|
+
key: _(v),
|
|
2807
|
+
class: K(["ytree-node", { "ytree-node--current": C(v) }])
|
|
2802
2808
|
}, [
|
|
2803
2809
|
n("div", {
|
|
2804
2810
|
class: "ytree-node__content",
|
|
2805
2811
|
style: { paddingLeft: "8px" },
|
|
2806
|
-
"data-level":
|
|
2812
|
+
"data-level": E(v, v),
|
|
2807
2813
|
onClick: (f) => te(v, v, null),
|
|
2808
2814
|
onContextmenu: (f) => X(f, v, v, null)
|
|
2809
2815
|
}, [
|
|
2810
2816
|
d(v) ? (a(), i("span", {
|
|
2811
2817
|
key: 0,
|
|
2812
|
-
class:
|
|
2813
|
-
onClick:
|
|
2818
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": N(v) }]),
|
|
2819
|
+
onClick: J((f) => T(v), ["stop"])
|
|
2814
2820
|
}, [...g[0] || (g[0] = [
|
|
2815
2821
|
n("svg", {
|
|
2816
2822
|
width: "12",
|
|
@@ -2829,13 +2835,13 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2829
2835
|
])], 10, gl)) : (a(), i("span", yl)),
|
|
2830
2836
|
e.showCheckbox ? (a(), i("span", {
|
|
2831
2837
|
key: 2,
|
|
2832
|
-
class:
|
|
2833
|
-
"is-checked":
|
|
2838
|
+
class: K(["ytree-node__checkbox", {
|
|
2839
|
+
"is-checked": q(v),
|
|
2834
2840
|
"is-indeterminate": P(v)
|
|
2835
2841
|
}]),
|
|
2836
|
-
onClick:
|
|
2842
|
+
onClick: J((f) => V(v), ["stop"])
|
|
2837
2843
|
}, [
|
|
2838
|
-
|
|
2844
|
+
q(v) ? (a(), i("svg", wl, [...g[1] || (g[1] = [
|
|
2839
2845
|
n("path", {
|
|
2840
2846
|
d: "M2 6L4.5 8.5L10 3",
|
|
2841
2847
|
stroke: "currentColor",
|
|
@@ -2854,43 +2860,43 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2854
2860
|
], 10, ml)) : A("", !0),
|
|
2855
2861
|
e.iconClass ? (a(), i("span", {
|
|
2856
2862
|
key: 3,
|
|
2857
|
-
class:
|
|
2863
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
2858
2864
|
}, null, 2)) : A("", !0),
|
|
2859
2865
|
n("img", {
|
|
2860
2866
|
class: "ytree-node__avatar",
|
|
2861
2867
|
src: h(v),
|
|
2862
|
-
alt:
|
|
2868
|
+
alt: L(v) ? "person" : "dept"
|
|
2863
2869
|
}, null, 8, kl),
|
|
2864
2870
|
n("span", {
|
|
2865
|
-
class:
|
|
2866
|
-
}, G(
|
|
2871
|
+
class: K(["ytree-node__label", { "is-employee": L(v) }])
|
|
2872
|
+
}, G(S(v)), 3),
|
|
2867
2873
|
n("div", xl, [
|
|
2868
|
-
|
|
2874
|
+
de(y.$slots, "node-content", {
|
|
2869
2875
|
node: v,
|
|
2870
|
-
isCurrent:
|
|
2871
|
-
isExpanded:
|
|
2876
|
+
isCurrent: C(v),
|
|
2877
|
+
isExpanded: N(v),
|
|
2872
2878
|
hasChildren: d(v)
|
|
2873
2879
|
}, void 0, !0)
|
|
2874
2880
|
])
|
|
2875
2881
|
], 40, pl),
|
|
2876
|
-
|
|
2882
|
+
ce(ke, { name: "ytree-node" }, {
|
|
2877
2883
|
default: he(() => [
|
|
2878
|
-
d(v) &&
|
|
2879
|
-
(a(!0), i(
|
|
2880
|
-
key:
|
|
2881
|
-
class:
|
|
2884
|
+
d(v) && N(v) ? (a(), i("div", Dl, [
|
|
2885
|
+
(a(!0), i(ue, null, ve(u(v), (f) => (a(), i("div", {
|
|
2886
|
+
key: _(f),
|
|
2887
|
+
class: K(["ytree-node", { "ytree-node--current": C(f) }])
|
|
2882
2888
|
}, [
|
|
2883
2889
|
n("div", {
|
|
2884
2890
|
class: "ytree-node__content",
|
|
2885
2891
|
style: { paddingLeft: "22px" },
|
|
2886
|
-
"data-level":
|
|
2892
|
+
"data-level": E(v, f),
|
|
2887
2893
|
onClick: (w) => te(f, f, null),
|
|
2888
2894
|
onContextmenu: (w) => X(w, f, f, null)
|
|
2889
2895
|
}, [
|
|
2890
2896
|
d(f) ? (a(), i("span", {
|
|
2891
2897
|
key: 0,
|
|
2892
|
-
class:
|
|
2893
|
-
onClick:
|
|
2898
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": N(f) }]),
|
|
2899
|
+
onClick: J((w) => T(f), ["stop"])
|
|
2894
2900
|
}, [...g[3] || (g[3] = [
|
|
2895
2901
|
n("svg", {
|
|
2896
2902
|
width: "12",
|
|
@@ -2909,13 +2915,13 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2909
2915
|
])], 10, Cl)) : (a(), i("span", _l)),
|
|
2910
2916
|
e.showCheckbox ? (a(), i("span", {
|
|
2911
2917
|
key: 2,
|
|
2912
|
-
class:
|
|
2913
|
-
"is-checked":
|
|
2918
|
+
class: K(["ytree-node__checkbox", {
|
|
2919
|
+
"is-checked": q(f),
|
|
2914
2920
|
"is-indeterminate": P(f)
|
|
2915
2921
|
}]),
|
|
2916
|
-
onClick:
|
|
2922
|
+
onClick: J((w) => V(f), ["stop"])
|
|
2917
2923
|
}, [
|
|
2918
|
-
|
|
2924
|
+
q(f) ? (a(), i("svg", Sl, [...g[4] || (g[4] = [
|
|
2919
2925
|
n("path", {
|
|
2920
2926
|
d: "M2 6L4.5 8.5L10 3",
|
|
2921
2927
|
stroke: "currentColor",
|
|
@@ -2934,38 +2940,38 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2934
2940
|
], 10, Ml)) : A("", !0),
|
|
2935
2941
|
e.iconClass ? (a(), i("span", {
|
|
2936
2942
|
key: 3,
|
|
2937
|
-
class:
|
|
2943
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
2938
2944
|
}, null, 2)) : A("", !0),
|
|
2939
2945
|
n("img", {
|
|
2940
2946
|
class: "ytree-node__avatar",
|
|
2941
2947
|
src: h(f),
|
|
2942
|
-
alt:
|
|
2948
|
+
alt: L(f) ? "person" : "dept"
|
|
2943
2949
|
}, null, 8, Il),
|
|
2944
2950
|
n("span", {
|
|
2945
|
-
class:
|
|
2946
|
-
}, G(
|
|
2947
|
-
n("div",
|
|
2948
|
-
|
|
2951
|
+
class: K(["ytree-node__label", { "is-employee": L(f) }])
|
|
2952
|
+
}, G(S(f)), 3),
|
|
2953
|
+
n("div", Bl, [
|
|
2954
|
+
de(y.$slots, "node-content", {
|
|
2949
2955
|
node: f,
|
|
2950
|
-
isCurrent:
|
|
2951
|
-
isExpanded:
|
|
2956
|
+
isCurrent: C(f),
|
|
2957
|
+
isExpanded: N(f),
|
|
2952
2958
|
hasChildren: d(f)
|
|
2953
2959
|
}, void 0, !0)
|
|
2954
2960
|
])
|
|
2955
2961
|
], 40, $l),
|
|
2956
|
-
|
|
2962
|
+
ce(ke, { name: "ytree-node" }, {
|
|
2957
2963
|
default: he(() => [
|
|
2958
|
-
d(f) &&
|
|
2959
|
-
(a(!0), i(
|
|
2960
|
-
key:
|
|
2961
|
-
class:
|
|
2962
|
-
"ytree-node--current":
|
|
2964
|
+
d(f) && N(f) ? (a(), i("div", El, [
|
|
2965
|
+
(a(!0), i(ue, null, ve(u(f), (w) => (a(), i("div", {
|
|
2966
|
+
key: _(w),
|
|
2967
|
+
class: K(["ytree-node", {
|
|
2968
|
+
"ytree-node--current": C(w)
|
|
2963
2969
|
}])
|
|
2964
2970
|
}, [
|
|
2965
2971
|
n("div", {
|
|
2966
2972
|
class: "ytree-node__content",
|
|
2967
2973
|
style: { paddingLeft: "38px" },
|
|
2968
|
-
"data-level":
|
|
2974
|
+
"data-level": E(v, w),
|
|
2969
2975
|
onClick: (b) => te(w, w, null),
|
|
2970
2976
|
onContextmenu: (b) => X(
|
|
2971
2977
|
b,
|
|
@@ -2976,8 +2982,8 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2976
2982
|
}, [
|
|
2977
2983
|
d(w) ? (a(), i("span", {
|
|
2978
2984
|
key: 0,
|
|
2979
|
-
class:
|
|
2980
|
-
onClick:
|
|
2985
|
+
class: K(["ytree-node__expand-icon", { "is-expanded": N(w) }]),
|
|
2986
|
+
onClick: J((b) => T(w), ["stop"])
|
|
2981
2987
|
}, [...g[6] || (g[6] = [
|
|
2982
2988
|
n("svg", {
|
|
2983
2989
|
width: "12",
|
|
@@ -2996,13 +3002,13 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
2996
3002
|
])], 10, zl)) : (a(), i("span", Kl)),
|
|
2997
3003
|
e.showCheckbox ? (a(), i("span", {
|
|
2998
3004
|
key: 2,
|
|
2999
|
-
class:
|
|
3000
|
-
"is-checked":
|
|
3005
|
+
class: K(["ytree-node__checkbox", {
|
|
3006
|
+
"is-checked": q(w),
|
|
3001
3007
|
"is-indeterminate": P(w)
|
|
3002
3008
|
}]),
|
|
3003
|
-
onClick:
|
|
3009
|
+
onClick: J((b) => V(w), ["stop"])
|
|
3004
3010
|
}, [
|
|
3005
|
-
|
|
3011
|
+
q(w) ? (a(), i("svg", Rl, [...g[7] || (g[7] = [
|
|
3006
3012
|
n("path", {
|
|
3007
3013
|
d: "M2 6L4.5 8.5L10 3",
|
|
3008
3014
|
stroke: "currentColor",
|
|
@@ -3021,32 +3027,32 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3021
3027
|
], 10, Hl)) : A("", !0),
|
|
3022
3028
|
e.iconClass ? (a(), i("span", {
|
|
3023
3029
|
key: 3,
|
|
3024
|
-
class:
|
|
3030
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3025
3031
|
}, null, 2)) : A("", !0),
|
|
3026
3032
|
n("img", {
|
|
3027
3033
|
class: "ytree-node__avatar",
|
|
3028
3034
|
src: h(w),
|
|
3029
|
-
alt:
|
|
3035
|
+
alt: L(w) ? "person" : "dept"
|
|
3030
3036
|
}, null, 8, Al),
|
|
3031
3037
|
n("span", {
|
|
3032
|
-
class:
|
|
3033
|
-
}, G(
|
|
3034
|
-
n("div",
|
|
3035
|
-
|
|
3038
|
+
class: K(["ytree-node__label", { "is-employee": L(w) }])
|
|
3039
|
+
}, G(S(w)), 3),
|
|
3040
|
+
n("div", Yl, [
|
|
3041
|
+
de(y.$slots, "node-content", {
|
|
3036
3042
|
node: w,
|
|
3037
|
-
isCurrent:
|
|
3038
|
-
isExpanded:
|
|
3043
|
+
isCurrent: C(w),
|
|
3044
|
+
isExpanded: N(w),
|
|
3039
3045
|
hasChildren: d(w)
|
|
3040
3046
|
}, void 0, !0)
|
|
3041
3047
|
])
|
|
3042
3048
|
], 40, Tl),
|
|
3043
|
-
|
|
3049
|
+
ce(ke, { name: "ytree-node" }, {
|
|
3044
3050
|
default: he(() => [
|
|
3045
|
-
d(w) &&
|
|
3046
|
-
(a(!0), i(
|
|
3047
|
-
key:
|
|
3048
|
-
class:
|
|
3049
|
-
"ytree-node--current":
|
|
3051
|
+
d(w) && N(w) ? (a(), i("div", Fl, [
|
|
3052
|
+
(a(!0), i(ue, null, ve(u(w), (b) => (a(), i("div", {
|
|
3053
|
+
key: _(b),
|
|
3054
|
+
class: K(["ytree-node", {
|
|
3055
|
+
"ytree-node--current": C(b)
|
|
3050
3056
|
}])
|
|
3051
3057
|
}, [
|
|
3052
3058
|
n("div", {
|
|
@@ -3054,7 +3060,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3054
3060
|
style: {
|
|
3055
3061
|
paddingLeft: "54px"
|
|
3056
3062
|
},
|
|
3057
|
-
"data-level":
|
|
3063
|
+
"data-level": E(v, b),
|
|
3058
3064
|
onClick: (M) => te(
|
|
3059
3065
|
b,
|
|
3060
3066
|
b,
|
|
@@ -3069,10 +3075,10 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3069
3075
|
}, [
|
|
3070
3076
|
d(b) ? (a(), i("span", {
|
|
3071
3077
|
key: 0,
|
|
3072
|
-
class:
|
|
3073
|
-
"is-expanded":
|
|
3078
|
+
class: K(["ytree-node__expand-icon", {
|
|
3079
|
+
"is-expanded": N(b)
|
|
3074
3080
|
}]),
|
|
3075
|
-
onClick:
|
|
3081
|
+
onClick: J((M) => T(b), ["stop"])
|
|
3076
3082
|
}, [...g[9] || (g[9] = [
|
|
3077
3083
|
n("svg", {
|
|
3078
3084
|
width: "12",
|
|
@@ -3088,16 +3094,16 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3088
3094
|
"stroke-linejoin": "round"
|
|
3089
3095
|
})
|
|
3090
3096
|
], -1)
|
|
3091
|
-
])], 10,
|
|
3097
|
+
])], 10, Wl)) : (a(), i("span", Nl)),
|
|
3092
3098
|
e.showCheckbox ? (a(), i("span", {
|
|
3093
3099
|
key: 2,
|
|
3094
|
-
class:
|
|
3095
|
-
"is-checked":
|
|
3100
|
+
class: K(["ytree-node__checkbox", {
|
|
3101
|
+
"is-checked": q(b),
|
|
3096
3102
|
"is-indeterminate": P(b)
|
|
3097
3103
|
}]),
|
|
3098
|
-
onClick:
|
|
3104
|
+
onClick: J((M) => V(b), ["stop"])
|
|
3099
3105
|
}, [
|
|
3100
|
-
|
|
3106
|
+
q(b) ? (a(), i("svg", Ol, [...g[10] || (g[10] = [
|
|
3101
3107
|
n("path", {
|
|
3102
3108
|
d: "M2 6L4.5 8.5L10 3",
|
|
3103
3109
|
stroke: "currentColor",
|
|
@@ -3116,36 +3122,36 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3116
3122
|
], 10, jl)) : A("", !0),
|
|
3117
3123
|
e.iconClass ? (a(), i("span", {
|
|
3118
3124
|
key: 3,
|
|
3119
|
-
class:
|
|
3125
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3120
3126
|
}, null, 2)) : A("", !0),
|
|
3121
3127
|
n("img", {
|
|
3122
3128
|
class: "ytree-node__avatar",
|
|
3123
3129
|
src: h(b),
|
|
3124
|
-
alt:
|
|
3130
|
+
alt: L(b) ? "person" : "dept"
|
|
3125
3131
|
}, null, 8, ql),
|
|
3126
3132
|
n("span", {
|
|
3127
|
-
class:
|
|
3128
|
-
"is-employee":
|
|
3133
|
+
class: K(["ytree-node__label", {
|
|
3134
|
+
"is-employee": L(b)
|
|
3129
3135
|
}])
|
|
3130
|
-
}, G(
|
|
3136
|
+
}, G(S(b)), 3),
|
|
3131
3137
|
n("div", Zl, [
|
|
3132
|
-
|
|
3138
|
+
de(y.$slots, "node-content", {
|
|
3133
3139
|
node: b,
|
|
3134
|
-
isCurrent:
|
|
3135
|
-
isExpanded:
|
|
3140
|
+
isCurrent: C(b),
|
|
3141
|
+
isExpanded: N(b),
|
|
3136
3142
|
hasChildren: d(b)
|
|
3137
3143
|
}, void 0, !0)
|
|
3138
3144
|
])
|
|
3139
3145
|
], 40, Pl),
|
|
3140
|
-
|
|
3146
|
+
ce(ke, { name: "ytree-node" }, {
|
|
3141
3147
|
default: he(() => [
|
|
3142
|
-
d(b) &&
|
|
3143
|
-
(a(!0), i(
|
|
3148
|
+
d(b) && N(b) ? (a(), i("div", Ql, [
|
|
3149
|
+
(a(!0), i(ue, null, ve(u(
|
|
3144
3150
|
b
|
|
3145
3151
|
), (M) => (a(), i("div", {
|
|
3146
|
-
key:
|
|
3147
|
-
class:
|
|
3148
|
-
"ytree-node--current":
|
|
3152
|
+
key: _(M),
|
|
3153
|
+
class: K(["ytree-node", {
|
|
3154
|
+
"ytree-node--current": C(M)
|
|
3149
3155
|
}])
|
|
3150
3156
|
}, [
|
|
3151
3157
|
n("div", {
|
|
@@ -3153,14 +3159,14 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3153
3159
|
style: {
|
|
3154
3160
|
paddingLeft: "70px"
|
|
3155
3161
|
},
|
|
3156
|
-
"data-level":
|
|
3157
|
-
onClick: (
|
|
3162
|
+
"data-level": E(v, M),
|
|
3163
|
+
onClick: (F) => te(
|
|
3158
3164
|
M,
|
|
3159
3165
|
M,
|
|
3160
3166
|
null
|
|
3161
3167
|
),
|
|
3162
|
-
onContextmenu: (
|
|
3163
|
-
|
|
3168
|
+
onContextmenu: (F) => X(
|
|
3169
|
+
F,
|
|
3164
3170
|
M,
|
|
3165
3171
|
M,
|
|
3166
3172
|
null
|
|
@@ -3168,10 +3174,10 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3168
3174
|
}, [
|
|
3169
3175
|
d(M) ? (a(), i("span", {
|
|
3170
3176
|
key: 0,
|
|
3171
|
-
class:
|
|
3172
|
-
"is-expanded":
|
|
3177
|
+
class: K(["ytree-node__expand-icon", {
|
|
3178
|
+
"is-expanded": N(M)
|
|
3173
3179
|
}]),
|
|
3174
|
-
onClick:
|
|
3180
|
+
onClick: J((F) => T(M), ["stop"])
|
|
3175
3181
|
}, [...g[12] || (g[12] = [
|
|
3176
3182
|
n("svg", {
|
|
3177
3183
|
width: "12",
|
|
@@ -3190,15 +3196,15 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3190
3196
|
])], 10, Xl)) : (a(), i("span", Gl)),
|
|
3191
3197
|
e.showCheckbox ? (a(), i("span", {
|
|
3192
3198
|
key: 2,
|
|
3193
|
-
class:
|
|
3194
|
-
"is-checked":
|
|
3199
|
+
class: K(["ytree-node__checkbox", {
|
|
3200
|
+
"is-checked": q(M),
|
|
3195
3201
|
"is-indeterminate": P(
|
|
3196
3202
|
M
|
|
3197
3203
|
)
|
|
3198
3204
|
}]),
|
|
3199
|
-
onClick:
|
|
3205
|
+
onClick: J((F) => V(M), ["stop"])
|
|
3200
3206
|
}, [
|
|
3201
|
-
|
|
3207
|
+
q(M) ? (a(), i("svg", to, [...g[13] || (g[13] = [
|
|
3202
3208
|
n("path", {
|
|
3203
3209
|
d: "M2 6L4.5 8.5L10 3",
|
|
3204
3210
|
stroke: "currentColor",
|
|
@@ -3219,23 +3225,23 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3219
3225
|
], 10, eo)) : A("", !0),
|
|
3220
3226
|
e.iconClass ? (a(), i("span", {
|
|
3221
3227
|
key: 3,
|
|
3222
|
-
class:
|
|
3228
|
+
class: K(["ytree-node__icon", e.iconClass])
|
|
3223
3229
|
}, null, 2)) : A("", !0),
|
|
3224
3230
|
n("img", {
|
|
3225
3231
|
class: "ytree-node__avatar",
|
|
3226
3232
|
src: h(M),
|
|
3227
|
-
alt:
|
|
3233
|
+
alt: L(M) ? "person" : "dept"
|
|
3228
3234
|
}, null, 8, lo),
|
|
3229
3235
|
n("span", {
|
|
3230
|
-
class:
|
|
3231
|
-
"is-employee":
|
|
3236
|
+
class: K(["ytree-node__label", {
|
|
3237
|
+
"is-employee": L(M)
|
|
3232
3238
|
}])
|
|
3233
|
-
}, G(
|
|
3239
|
+
}, G(S(M)), 3),
|
|
3234
3240
|
n("div", oo, [
|
|
3235
|
-
|
|
3241
|
+
de(y.$slots, "node-content", {
|
|
3236
3242
|
node: M,
|
|
3237
|
-
isCurrent:
|
|
3238
|
-
isExpanded:
|
|
3243
|
+
isCurrent: C(M),
|
|
3244
|
+
isExpanded: N(M),
|
|
3239
3245
|
hasChildren: d(M)
|
|
3240
3246
|
}, void 0, !0)
|
|
3241
3247
|
])
|
|
@@ -3277,11 +3283,11 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3277
3283
|
},
|
|
3278
3284
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3279
3285
|
setup(e, { emit: m }) {
|
|
3280
|
-
const t = e, l = m, c = R(!1), s =
|
|
3281
|
-
function
|
|
3282
|
-
switch (
|
|
3286
|
+
const t = e, l = m, c = R(!1), s = lt({}), k = U(() => t.fields.filter((C) => !C.hidden)), _ = U(() => c.value ? k.value : k.value.slice(0, t.maxVisibleFields)), S = U(() => k.value.length > t.maxVisibleFields);
|
|
3287
|
+
function L(C) {
|
|
3288
|
+
switch (C) {
|
|
3283
3289
|
case "select":
|
|
3284
|
-
return
|
|
3290
|
+
return Je;
|
|
3285
3291
|
case "date":
|
|
3286
3292
|
case "daterange":
|
|
3287
3293
|
return Xe;
|
|
@@ -3290,76 +3296,76 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3290
3296
|
return Qe;
|
|
3291
3297
|
}
|
|
3292
3298
|
}
|
|
3293
|
-
function h(
|
|
3294
|
-
l("field-change",
|
|
3299
|
+
function h(C) {
|
|
3300
|
+
l("field-change", C, s[C.key]), l("update:modelValue", { ...s });
|
|
3295
3301
|
}
|
|
3296
3302
|
function d() {
|
|
3297
|
-
const
|
|
3303
|
+
const C = N(s), V = q(C);
|
|
3298
3304
|
l("search", { data: V });
|
|
3299
3305
|
}
|
|
3300
3306
|
function u() {
|
|
3301
|
-
Object.keys(s).forEach((
|
|
3302
|
-
const V = t.fields.find((H) => H.key ===
|
|
3303
|
-
(V == null ? void 0 : V.type) === "daterange" ? s[
|
|
3307
|
+
Object.keys(s).forEach((C) => {
|
|
3308
|
+
const V = t.fields.find((H) => H.key === C);
|
|
3309
|
+
(V == null ? void 0 : V.type) === "daterange" ? s[C] = { startDate: null, endDate: null } : (V == null ? void 0 : V.type) === "date" ? s[C] = null : s[C] = "";
|
|
3304
3310
|
}), l("reset"), l("update:modelValue", { ...s });
|
|
3305
3311
|
}
|
|
3306
|
-
function
|
|
3312
|
+
function E() {
|
|
3307
3313
|
c.value = !c.value;
|
|
3308
3314
|
}
|
|
3309
|
-
function
|
|
3315
|
+
function N(C) {
|
|
3310
3316
|
const V = {};
|
|
3311
|
-
return Object.keys(
|
|
3312
|
-
const T =
|
|
3313
|
-
T != null && T !== "" && (typeof T == "object" && T.startDate && T.endDate ? T.startDate && T.endDate && (V[H] = T) :
|
|
3317
|
+
return Object.keys(C).forEach((H) => {
|
|
3318
|
+
const T = C[H], Z = t.fields.find((te) => te.key === H);
|
|
3319
|
+
T != null && T !== "" && (typeof T == "object" && T.startDate && T.endDate ? T.startDate && T.endDate && (V[H] = T) : Z && (Z.type === "date" || Z.type === "daterange") ? T !== 0 && (V[H] = T) : V[H] = T);
|
|
3314
3320
|
}), V;
|
|
3315
3321
|
}
|
|
3316
|
-
function
|
|
3322
|
+
function q(C) {
|
|
3317
3323
|
const V = {};
|
|
3318
|
-
return Object.keys(
|
|
3319
|
-
const T =
|
|
3320
|
-
if (
|
|
3321
|
-
if (
|
|
3322
|
-
const te =
|
|
3323
|
-
T.startDate && T.endDate && T.startDate !== 0 && T.endDate !== 0 && (
|
|
3324
|
-
} else
|
|
3324
|
+
return Object.keys(C).forEach((H) => {
|
|
3325
|
+
const T = C[H], Z = t.fields.find((te) => te.key === H);
|
|
3326
|
+
if (Z)
|
|
3327
|
+
if (Z.type === "daterange" && typeof T == "object") {
|
|
3328
|
+
const te = Z.startKey || `${H}Start`, X = Z.endKey || `${H}End`;
|
|
3329
|
+
T.startDate && T.endDate && T.startDate !== 0 && T.endDate !== 0 && (Z.format === "timestamp" ? (V[te] = new Date(T.startDate).getTime(), V[X] = new Date(T.endDate).getTime()) : (V[te] = T.startDate, V[X] = T.endDate));
|
|
3330
|
+
} else Z.type === "date" && T && T !== 0 && Z.format === "timestamp" ? V[H] = new Date(T).getTime() : V[H] = T;
|
|
3325
3331
|
else
|
|
3326
3332
|
V[H] = T;
|
|
3327
3333
|
}), V;
|
|
3328
3334
|
}
|
|
3329
3335
|
function P() {
|
|
3330
|
-
t.fields.forEach((
|
|
3336
|
+
t.fields.forEach((C) => {
|
|
3331
3337
|
var V, H, T;
|
|
3332
|
-
s[
|
|
3338
|
+
s[C.key] === void 0 && (C.type === "daterange" ? s[C.key] = ((V = t.modelValue) == null ? void 0 : V[C.key]) || {
|
|
3333
3339
|
startDate: null,
|
|
3334
3340
|
endDate: null
|
|
3335
|
-
} :
|
|
3341
|
+
} : C.type === "date" ? s[C.key] = ((H = t.modelValue) == null ? void 0 : H[C.key]) || null : s[C.key] = ((T = t.modelValue) == null ? void 0 : T[C.key]) || "");
|
|
3336
3342
|
});
|
|
3337
3343
|
}
|
|
3338
3344
|
return oe(
|
|
3339
3345
|
() => t.modelValue,
|
|
3340
|
-
(
|
|
3341
|
-
|
|
3346
|
+
(C) => {
|
|
3347
|
+
C && Object.assign(s, C);
|
|
3342
3348
|
},
|
|
3343
3349
|
{ deep: !0, immediate: !0 }
|
|
3344
3350
|
), _e(() => {
|
|
3345
3351
|
P();
|
|
3346
|
-
}), (
|
|
3352
|
+
}), (C, V) => (a(), i("div", uo, [
|
|
3347
3353
|
n("div", co, [
|
|
3348
3354
|
n("div", fo, [
|
|
3349
3355
|
n("div", vo, [
|
|
3350
|
-
|
|
3356
|
+
ce(ot, {
|
|
3351
3357
|
name: "qf",
|
|
3352
3358
|
tag: "div",
|
|
3353
3359
|
class: "contents"
|
|
3354
3360
|
}, {
|
|
3355
3361
|
default: he(() => [
|
|
3356
|
-
(a(!0), i(
|
|
3362
|
+
(a(!0), i(ue, null, ve(_.value, (H) => (a(), i("div", {
|
|
3357
3363
|
key: H.key,
|
|
3358
3364
|
class: "flex items-center transition-all duration-300"
|
|
3359
3365
|
}, [
|
|
3360
3366
|
n("div", ho, [
|
|
3361
3367
|
n("label", po, G(H.label), 1),
|
|
3362
|
-
(a(), Le(
|
|
3368
|
+
(a(), Le(at(L(H.type)), {
|
|
3363
3369
|
modelValue: s[H.key],
|
|
3364
3370
|
"onUpdate:modelValue": (T) => s[H.key] = T,
|
|
3365
3371
|
placeholder: H.placeholder || `请输入${H.label}`,
|
|
@@ -3378,16 +3384,16 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3378
3384
|
]),
|
|
3379
3385
|
_: 1
|
|
3380
3386
|
}),
|
|
3381
|
-
|
|
3382
|
-
|
|
3387
|
+
S.value ? (a(), i("div", go, [
|
|
3388
|
+
ce(Ae, {
|
|
3383
3389
|
variant: "secondary",
|
|
3384
3390
|
size: "small",
|
|
3385
|
-
onClick:
|
|
3391
|
+
onClick: E
|
|
3386
3392
|
}, {
|
|
3387
3393
|
default: he(() => [
|
|
3388
3394
|
De(G(c.value ? "收起" : "展开") + " ", 1),
|
|
3389
3395
|
n("span", {
|
|
3390
|
-
class:
|
|
3396
|
+
class: K(["inline-block ml-1 transition-transform duration-300 text-[10px]", { "rotate-180": c.value }])
|
|
3391
3397
|
}, "▼", 2)
|
|
3392
3398
|
]),
|
|
3393
3399
|
_: 1
|
|
@@ -3395,7 +3401,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3395
3401
|
])) : A("", !0),
|
|
3396
3402
|
n("div", yo, [
|
|
3397
3403
|
n("div", mo, [
|
|
3398
|
-
|
|
3404
|
+
ce(Ae, {
|
|
3399
3405
|
variant: "primary",
|
|
3400
3406
|
size: "small",
|
|
3401
3407
|
onClick: d,
|
|
@@ -3406,7 +3412,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3406
3412
|
])]),
|
|
3407
3413
|
_: 1
|
|
3408
3414
|
}, 8, ["loading"]),
|
|
3409
|
-
|
|
3415
|
+
ce(Ae, {
|
|
3410
3416
|
variant: "secondary",
|
|
3411
3417
|
size: "small",
|
|
3412
3418
|
onClick: u,
|
|
@@ -3417,7 +3423,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3417
3423
|
])]),
|
|
3418
3424
|
_: 1
|
|
3419
3425
|
}, 8, ["loading"]),
|
|
3420
|
-
|
|
3426
|
+
de(C.$slots, "extra-actions", {}, void 0, !0)
|
|
3421
3427
|
])
|
|
3422
3428
|
])
|
|
3423
3429
|
])
|
|
@@ -3425,7 +3431,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3425
3431
|
])
|
|
3426
3432
|
]));
|
|
3427
3433
|
}
|
|
3428
|
-
}), bo = /* @__PURE__ */ we(wo, [["__scopeId", "data-v-
|
|
3434
|
+
}), bo = /* @__PURE__ */ we(wo, [["__scopeId", "data-v-0c560fa7"]]), ko = {
|
|
3429
3435
|
class: "y-msg__icon",
|
|
3430
3436
|
"aria-hidden": "true"
|
|
3431
3437
|
}, xo = {
|
|
@@ -3465,7 +3471,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3465
3471
|
requestAnimationFrame(() => {
|
|
3466
3472
|
t.value = !0, m.duration && m.duration > 0 && (l = window.setTimeout(() => c(), m.duration));
|
|
3467
3473
|
});
|
|
3468
|
-
}),
|
|
3474
|
+
}), st(() => {
|
|
3469
3475
|
l && window.clearTimeout(l);
|
|
3470
3476
|
});
|
|
3471
3477
|
function c() {
|
|
@@ -3475,19 +3481,19 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3475
3481
|
var k;
|
|
3476
3482
|
(k = m.onClose) == null || k.call(m, m.id);
|
|
3477
3483
|
}
|
|
3478
|
-
return (k,
|
|
3484
|
+
return (k, _) => (a(), Le(ke, {
|
|
3479
3485
|
name: "y-msg-fade",
|
|
3480
3486
|
onAfterLeave: s
|
|
3481
3487
|
}, {
|
|
3482
3488
|
default: he(() => [
|
|
3483
|
-
|
|
3484
|
-
class:
|
|
3489
|
+
Be(n("div", {
|
|
3490
|
+
class: K(["y-msg", [`y-msg--${e.type}`]]),
|
|
3485
3491
|
style: ye({ zIndex: e.zIndex }),
|
|
3486
3492
|
role: "status",
|
|
3487
3493
|
"aria-live": "polite"
|
|
3488
3494
|
}, [
|
|
3489
3495
|
n("span", ko, [
|
|
3490
|
-
e.type === "success" ? (a(), i("svg", xo, [...
|
|
3496
|
+
e.type === "success" ? (a(), i("svg", xo, [..._[0] || (_[0] = [
|
|
3491
3497
|
n("path", {
|
|
3492
3498
|
d: "M20 6L9 17l-5-5",
|
|
3493
3499
|
stroke: "currentColor",
|
|
@@ -3495,7 +3501,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3495
3501
|
"stroke-linecap": "round",
|
|
3496
3502
|
"stroke-linejoin": "round"
|
|
3497
3503
|
}, null, -1)
|
|
3498
|
-
])])) : e.type === "warning" ? (a(), i("svg", Do, [...
|
|
3504
|
+
])])) : e.type === "warning" ? (a(), i("svg", Do, [..._[1] || (_[1] = [
|
|
3499
3505
|
n("path", {
|
|
3500
3506
|
d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",
|
|
3501
3507
|
stroke: "currentColor",
|
|
@@ -3503,7 +3509,7 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3503
3509
|
"stroke-linecap": "round",
|
|
3504
3510
|
"stroke-linejoin": "round"
|
|
3505
3511
|
}, null, -1)
|
|
3506
|
-
])])) : (a(), i("svg", $o, [...
|
|
3512
|
+
])])) : (a(), i("svg", $o, [..._[2] || (_[2] = [
|
|
3507
3513
|
n("path", {
|
|
3508
3514
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3509
3515
|
stroke: "currentColor",
|
|
@@ -3530,13 +3536,13 @@ const rt = ["type", "disabled", "aria-busy", "aria-disabled"], ut = { class: "co
|
|
|
3530
3536
|
_: 1
|
|
3531
3537
|
}));
|
|
3532
3538
|
}
|
|
3533
|
-
}), Mo = /* @__PURE__ */ we(_o, [["__scopeId", "data-v-
|
|
3539
|
+
}), Mo = /* @__PURE__ */ we(_o, [["__scopeId", "data-v-ceac9e81"]]);
|
|
3534
3540
|
let So = 1;
|
|
3535
|
-
const
|
|
3541
|
+
const je = 12, Se = [];
|
|
3536
3542
|
function Lo() {
|
|
3537
3543
|
let e = 20;
|
|
3538
3544
|
return Se.forEach((m) => {
|
|
3539
|
-
e += m.height +
|
|
3545
|
+
e += m.height + je;
|
|
3540
3546
|
}), e;
|
|
3541
3547
|
}
|
|
3542
3548
|
function Ue(e) {
|
|
@@ -3547,17 +3553,17 @@ function Ue(e) {
|
|
|
3547
3553
|
const s = window.getComputedStyle(l).top;
|
|
3548
3554
|
l.style.top = s, l.classList.add("is-leaving"), l.style.willChange = "opacity, transform";
|
|
3549
3555
|
}
|
|
3550
|
-
Se[m].leaving = !0,
|
|
3556
|
+
Se[m].leaving = !0, Pe(), setTimeout(() => {
|
|
3551
3557
|
Ze(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3552
3558
|
const s = Se.findIndex((k) => k.id === e);
|
|
3553
|
-
s !== -1 && Se.splice(s, 1),
|
|
3559
|
+
s !== -1 && Se.splice(s, 1), Pe();
|
|
3554
3560
|
}, 260);
|
|
3555
3561
|
}
|
|
3556
3562
|
function Ne(e) {
|
|
3557
3563
|
var s;
|
|
3558
3564
|
const m = So++, t = document.createElement("div");
|
|
3559
3565
|
document.body.appendChild(t);
|
|
3560
|
-
const l =
|
|
3566
|
+
const l = ce(Mo, {
|
|
3561
3567
|
id: m,
|
|
3562
3568
|
type: e.type || "success",
|
|
3563
3569
|
message: e.message,
|
|
@@ -3569,11 +3575,11 @@ function Ne(e) {
|
|
|
3569
3575
|
});
|
|
3570
3576
|
Ze(l, t);
|
|
3571
3577
|
const c = ((s = t.firstElementChild) == null ? void 0 : s.offsetHeight) || 0;
|
|
3572
|
-
return Se.push({ id: m, el: t, vm: l, height: c, leaving: !1 }),
|
|
3578
|
+
return Se.push({ id: m, el: t, vm: l, height: c, leaving: !1 }), Pe(), requestAnimationFrame(() => {
|
|
3573
3579
|
const k = t.firstElementChild;
|
|
3574
3580
|
if (!k) return;
|
|
3575
|
-
const
|
|
3576
|
-
|
|
3581
|
+
const _ = k.offsetHeight || c || 0, S = Se.find((L) => L.id === m);
|
|
3582
|
+
S && (S.height = _, Pe());
|
|
3577
3583
|
}), { close: () => Ue(m) };
|
|
3578
3584
|
}
|
|
3579
3585
|
const Fe = {
|
|
@@ -3588,26 +3594,26 @@ const Fe = {
|
|
|
3588
3594
|
}
|
|
3589
3595
|
};
|
|
3590
3596
|
typeof window < "u" && (window.YMessage = Fe, typeof globalThis.YMessage > "u" && (globalThis.YMessage = Fe));
|
|
3591
|
-
function
|
|
3597
|
+
function Pe() {
|
|
3592
3598
|
let e = 20;
|
|
3593
3599
|
Se.forEach((m) => {
|
|
3594
3600
|
const t = m.el.firstElementChild;
|
|
3595
3601
|
if (!t) return;
|
|
3596
3602
|
const l = e;
|
|
3597
3603
|
if (t.style.transform = `translate(-50%, ${l}px)`, t.style.top || (t.style.top = "0px"), !m.leaving)
|
|
3598
|
-
e += (t.offsetHeight || m.height) +
|
|
3604
|
+
e += (t.offsetHeight || m.height) + je;
|
|
3599
3605
|
else {
|
|
3600
3606
|
const c = t.offsetHeight || m.height;
|
|
3601
|
-
e += c +
|
|
3607
|
+
e += c + je;
|
|
3602
3608
|
}
|
|
3603
3609
|
});
|
|
3604
3610
|
}
|
|
3605
3611
|
const qe = {
|
|
3606
|
-
YButton:
|
|
3612
|
+
YButton: Ae,
|
|
3607
3613
|
YInput: Qe,
|
|
3608
|
-
YTable:
|
|
3609
|
-
YSelect:
|
|
3610
|
-
YPagination:
|
|
3614
|
+
YTable: Et,
|
|
3615
|
+
YSelect: Je,
|
|
3616
|
+
YPagination: Wt,
|
|
3611
3617
|
YBadge: ln,
|
|
3612
3618
|
YDialog: fn,
|
|
3613
3619
|
YPopover: pn,
|
|
@@ -3618,7 +3624,7 @@ const qe = {
|
|
|
3618
3624
|
YDrawer: vl,
|
|
3619
3625
|
YTree: ro,
|
|
3620
3626
|
QueryEncapsulation: bo
|
|
3621
|
-
},
|
|
3627
|
+
}, Bo = {
|
|
3622
3628
|
install(e) {
|
|
3623
3629
|
Object.keys(qe).forEach((m) => {
|
|
3624
3630
|
e.component(m, qe[m]);
|
|
@@ -3628,20 +3634,20 @@ const qe = {
|
|
|
3628
3634
|
export {
|
|
3629
3635
|
bo as QueryEncapsulation,
|
|
3630
3636
|
ln as YBadge,
|
|
3631
|
-
|
|
3637
|
+
Ae as YButton,
|
|
3632
3638
|
fn as YDialog,
|
|
3633
3639
|
vl as YDrawer,
|
|
3634
3640
|
al as YDropdown,
|
|
3635
3641
|
ll as YImage,
|
|
3636
3642
|
Qe as YInput,
|
|
3637
3643
|
Fe as YMessage,
|
|
3638
|
-
|
|
3644
|
+
Wt as YPagination,
|
|
3639
3645
|
pn as YPopover,
|
|
3640
|
-
|
|
3646
|
+
Je as YSelect,
|
|
3641
3647
|
Gn as YSwitch,
|
|
3642
|
-
|
|
3648
|
+
Et as YTable,
|
|
3643
3649
|
Xe as YTime,
|
|
3644
3650
|
ro as YTree,
|
|
3645
|
-
|
|
3651
|
+
Bo as default
|
|
3646
3652
|
};
|
|
3647
3653
|
//# sourceMappingURL=index.esm.js.map
|