@nhdropshipping/y-components 1.0.69 → 1.0.70
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/yinput.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 +1338 -1290
- 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,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as De, computed as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as De, computed as F, createElementBlock as c, openBlock as r, normalizeClass as j, createElementVNode as a, renderSlot as ve, Fragment as he, renderList as xe, createCommentVNode as W, toDisplayString as oe, ref as N, watch as ae, normalizeStyle as fe, withKeys as Me, provide as me, nextTick as ie, onMounted as ze, onUnmounted as Ke, resolveComponent as Je, createVNode as be, Transition as He, withCtx as pe, createTextVNode as Le, createBlock as Ne, withModifiers as ne, withDirectives as Ve, vModelText as Lt, Teleport as Xe, vShow as Pe, inject as we, unref as ce, mergeProps as ht, reactive as Tt, onBeforeUnmount as Ct, TransitionGroup as Bt, resolveDynamicComponent as Ht, toHandlers as zt, render as xt } from "vue";
|
|
2
|
+
const Nt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "content" }, Vt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
5
5
|
role: "group"
|
|
@@ -15,7 +15,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
15
15
|
viewBox: "0 0 20 20",
|
|
16
16
|
fill: "currentColor",
|
|
17
17
|
"aria-hidden": "true"
|
|
18
|
-
},
|
|
18
|
+
}, Pt = { key: 2 }, Ft = /* @__PURE__ */ De({
|
|
19
19
|
__name: "ybutton",
|
|
20
20
|
props: {
|
|
21
21
|
htmlType: { default: "button" },
|
|
@@ -30,14 +30,14 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
30
30
|
emits: ["click", "group-click"],
|
|
31
31
|
setup(e, { emit: m }) {
|
|
32
32
|
const t = e, l = m;
|
|
33
|
-
function
|
|
33
|
+
function f(w) {
|
|
34
34
|
if (t.disabled || t.loading) {
|
|
35
35
|
w.preventDefault(), w.stopPropagation();
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
l("click", w);
|
|
39
39
|
}
|
|
40
|
-
const h =
|
|
40
|
+
const h = F(() => {
|
|
41
41
|
switch (t.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,54 +48,54 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}), o =
|
|
52
|
-
function $(w,
|
|
51
|
+
}), o = F(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
|
+
function $(w, I) {
|
|
53
53
|
if (t.disabled || t.loading || w.disabled || w.loading) {
|
|
54
|
-
|
|
54
|
+
I.preventDefault(), I.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
l("group-click", w.value,
|
|
57
|
+
l("group-click", w.value, I);
|
|
58
58
|
}
|
|
59
|
-
return (w,
|
|
60
|
-
(
|
|
59
|
+
return (w, I) => o.value ? (r(), c("div", Vt, [
|
|
60
|
+
(r(!0), c(he, null, xe(e.groupItems, (x, p) => {
|
|
61
61
|
var d;
|
|
62
|
-
return
|
|
63
|
-
key:
|
|
64
|
-
class:
|
|
65
|
-
`y-btn--${
|
|
66
|
-
`y-btn--${
|
|
62
|
+
return r(), c("button", {
|
|
63
|
+
key: x.value ?? p,
|
|
64
|
+
class: j(["y-btn", [
|
|
65
|
+
`y-btn--${x.variant ?? e.variant}`,
|
|
66
|
+
`y-btn--${x.size ?? e.size}`,
|
|
67
67
|
"is-grouped",
|
|
68
68
|
p === 0 ? "group-pos-start" : p === (((d = e.groupItems) == null ? void 0 : d.length) || 0) - 1 ? "group-pos-end" : "group-pos-middle",
|
|
69
|
-
{ "is-loading":
|
|
69
|
+
{ "is-loading": x.loading || e.loading }
|
|
70
70
|
]]),
|
|
71
71
|
type: e.htmlType,
|
|
72
|
-
disabled: (
|
|
73
|
-
"aria-busy":
|
|
74
|
-
"aria-disabled": (
|
|
75
|
-
"aria-label":
|
|
76
|
-
onClick: (C) => $(
|
|
72
|
+
disabled: (x.disabled ?? !1) || e.disabled || e.loading || x.loading,
|
|
73
|
+
"aria-busy": x.loading || e.loading ? "true" : "false",
|
|
74
|
+
"aria-disabled": (x.disabled ?? !1) || e.disabled || e.loading || x.loading ? "true" : "false",
|
|
75
|
+
"aria-label": x.ariaLabel || x.label,
|
|
76
|
+
onClick: (C) => $(x, C)
|
|
77
77
|
}, [
|
|
78
78
|
a("span", Rt, [
|
|
79
|
-
|
|
79
|
+
x.icon === "chevron-left" ? (r(), c("svg", Wt, [...I[0] || (I[0] = [
|
|
80
80
|
a("path", {
|
|
81
81
|
"fill-rule": "evenodd",
|
|
82
82
|
d: "M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z",
|
|
83
83
|
"clip-rule": "evenodd"
|
|
84
84
|
}, null, -1)
|
|
85
|
-
])])) :
|
|
85
|
+
])])) : x.icon === "chevron-right" ? (r(), c("svg", _t, [...I[1] || (I[1] = [
|
|
86
86
|
a("path", {
|
|
87
87
|
"fill-rule": "evenodd",
|
|
88
88
|
d: "M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z",
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
|
-
])])) :
|
|
92
|
-
|
|
91
|
+
])])) : W("", !0),
|
|
92
|
+
x.label && !x.onlyIcon ? (r(), c("span", Pt, oe(x.label), 1)) : W("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, At);
|
|
95
95
|
}), 128))
|
|
96
|
-
])) : (
|
|
96
|
+
])) : (r(), c("button", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class:
|
|
98
|
+
class: j(["y-btn", [
|
|
99
99
|
`y-btn--${e.variant}`,
|
|
100
100
|
`y-btn--${e.size}`,
|
|
101
101
|
{ "is-block": e.block, "is-loading": e.loading },
|
|
@@ -106,19 +106,41 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
106
106
|
disabled: e.disabled || e.loading,
|
|
107
107
|
"aria-busy": e.loading ? "true" : "false",
|
|
108
108
|
"aria-disabled": e.disabled || e.loading ? "true" : "false",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: f
|
|
110
110
|
}, [
|
|
111
111
|
a("span", Kt, [
|
|
112
112
|
ve(w.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
|
-
], 10,
|
|
114
|
+
], 10, Nt));
|
|
115
115
|
}
|
|
116
116
|
}), $e = (e, m) => {
|
|
117
117
|
const t = e.__vccOpts || e;
|
|
118
|
-
for (const [l,
|
|
119
|
-
t[l] =
|
|
118
|
+
for (const [l, f] of m)
|
|
119
|
+
t[l] = f;
|
|
120
120
|
return t;
|
|
121
|
-
}, st = /* @__PURE__ */ $e(
|
|
121
|
+
}, st = /* @__PURE__ */ $e(Ft, [["__scopeId", "data-v-53157673"]]), Yt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "min", "max", "disabled", "required", "value"], Ot = ["title"], jt = {
|
|
122
|
+
key: 0,
|
|
123
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
124
|
+
width: "100%",
|
|
125
|
+
height: "100%",
|
|
126
|
+
viewBox: "0 0 24 24",
|
|
127
|
+
fill: "none",
|
|
128
|
+
stroke: "currentColor",
|
|
129
|
+
"stroke-width": "2",
|
|
130
|
+
"stroke-linecap": "round",
|
|
131
|
+
"stroke-linejoin": "round"
|
|
132
|
+
}, qt = {
|
|
133
|
+
key: 1,
|
|
134
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
135
|
+
width: "100%",
|
|
136
|
+
height: "100%",
|
|
137
|
+
viewBox: "0 0 24 24",
|
|
138
|
+
fill: "none",
|
|
139
|
+
stroke: "currentColor",
|
|
140
|
+
"stroke-width": "2",
|
|
141
|
+
"stroke-linecap": "round",
|
|
142
|
+
"stroke-linejoin": "round"
|
|
143
|
+
}, Ut = /* @__PURE__ */ De({
|
|
122
144
|
__name: "yinput",
|
|
123
145
|
props: {
|
|
124
146
|
modelValue: { default: "" },
|
|
@@ -139,45 +161,48 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
139
161
|
},
|
|
140
162
|
emits: ["update:modelValue", "enter", "paste"],
|
|
141
163
|
setup(e, { emit: m }) {
|
|
142
|
-
const t = e, l = m,
|
|
143
|
-
ae(() => t.placeholder, (
|
|
144
|
-
$.value || (w.value =
|
|
164
|
+
const t = e, l = m, f = N(null), h = N(""), o = N(!1), $ = N(!1), w = N(t.placeholder || ""), I = N(!1), x = F(() => t.type === "password"), p = F(() => x.value ? I.value ? "text" : "password" : t.type);
|
|
165
|
+
ae(() => t.placeholder, (U) => {
|
|
166
|
+
$.value || (w.value = U || "");
|
|
145
167
|
});
|
|
146
|
-
function
|
|
147
|
-
const O =
|
|
168
|
+
function d(U) {
|
|
169
|
+
const O = U.target;
|
|
148
170
|
o.value = !0, l("update:modelValue", O.value);
|
|
149
171
|
}
|
|
150
|
-
function
|
|
172
|
+
function C() {
|
|
151
173
|
$.value = !0, t.clearOnFocus && (h.value = t.modelValue || "", o.value = !1, w.value = h.value || t.placeholder || "", l("update:modelValue", ""));
|
|
152
174
|
}
|
|
153
|
-
function
|
|
175
|
+
function _() {
|
|
154
176
|
if ($.value = !1, t.clearOnFocus && !o.value && (!t.modelValue || t.modelValue === "") && l("update:modelValue", h.value), t.min !== void 0 && t.modelValue !== void 0 && t.modelValue !== "") {
|
|
155
|
-
const
|
|
156
|
-
!Number.isNaN(
|
|
177
|
+
const U = Number(t.modelValue), O = Number(t.min);
|
|
178
|
+
!Number.isNaN(U) && !Number.isNaN(O) && U < O && l("update:modelValue", String(O));
|
|
157
179
|
}
|
|
158
180
|
w.value = t.placeholder || "";
|
|
159
181
|
}
|
|
160
|
-
function
|
|
161
|
-
const O =
|
|
182
|
+
function Z(U) {
|
|
183
|
+
const O = U.target;
|
|
162
184
|
l("enter", O.value);
|
|
163
185
|
}
|
|
164
|
-
function
|
|
165
|
-
const O =
|
|
186
|
+
function G(U) {
|
|
187
|
+
const O = U.target;
|
|
166
188
|
requestAnimationFrame(() => {
|
|
167
189
|
l("paste", O.value);
|
|
168
190
|
});
|
|
169
191
|
}
|
|
170
|
-
|
|
171
|
-
|
|
192
|
+
function A() {
|
|
193
|
+
I.value = !I.value, f.value && f.value.focus();
|
|
194
|
+
}
|
|
195
|
+
return (U, O) => (r(), c("div", {
|
|
196
|
+
class: j(["y-input-wrap", { "is-block": e.block }]),
|
|
172
197
|
style: fe({ width: e.width })
|
|
173
198
|
}, [
|
|
174
199
|
a("input", {
|
|
175
200
|
ref_key: "inputRef",
|
|
176
|
-
ref:
|
|
177
|
-
class:
|
|
201
|
+
ref: f,
|
|
202
|
+
class: j(["y-input", [`y-input--${e.size}`, { "y-input--password": x.value }]]),
|
|
178
203
|
id: e.id,
|
|
179
204
|
name: e.name,
|
|
180
|
-
type:
|
|
205
|
+
type: p.value,
|
|
181
206
|
placeholder: w.value,
|
|
182
207
|
autocomplete: e.autocomplete,
|
|
183
208
|
inputmode: e.inputmode,
|
|
@@ -186,63 +211,86 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
186
211
|
disabled: e.disabled,
|
|
187
212
|
required: e.required,
|
|
188
213
|
value: e.modelValue,
|
|
189
|
-
onInput:
|
|
190
|
-
onFocus:
|
|
191
|
-
onBlur:
|
|
192
|
-
onKeyup: Me(
|
|
193
|
-
onPaste:
|
|
194
|
-
}, null, 42, Yt)
|
|
214
|
+
onInput: d,
|
|
215
|
+
onFocus: C,
|
|
216
|
+
onBlur: _,
|
|
217
|
+
onKeyup: Me(Z, ["enter"]),
|
|
218
|
+
onPaste: G
|
|
219
|
+
}, null, 42, Yt),
|
|
220
|
+
x.value ? (r(), c("span", {
|
|
221
|
+
key: 0,
|
|
222
|
+
class: j(["y-input-password-toggle", `y-input-password-toggle--${e.size}`]),
|
|
223
|
+
onClick: A,
|
|
224
|
+
title: I.value ? "隐藏密码" : "显示密码"
|
|
225
|
+
}, [
|
|
226
|
+
I.value ? (r(), c("svg", jt, [...O[0] || (O[0] = [
|
|
227
|
+
a("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }, null, -1),
|
|
228
|
+
a("circle", {
|
|
229
|
+
cx: "12",
|
|
230
|
+
cy: "12",
|
|
231
|
+
r: "3"
|
|
232
|
+
}, null, -1)
|
|
233
|
+
])])) : (r(), c("svg", qt, [...O[1] || (O[1] = [
|
|
234
|
+
a("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }, null, -1),
|
|
235
|
+
a("line", {
|
|
236
|
+
x1: "1",
|
|
237
|
+
y1: "1",
|
|
238
|
+
x2: "23",
|
|
239
|
+
y2: "23"
|
|
240
|
+
}, null, -1)
|
|
241
|
+
])]))
|
|
242
|
+
], 10, Ot)) : W("", !0)
|
|
195
243
|
], 6));
|
|
196
244
|
}
|
|
197
|
-
}), Dt = /* @__PURE__ */ $e(
|
|
245
|
+
}), Dt = /* @__PURE__ */ $e(Ut, [["__scopeId", "data-v-288e13f9"]]), Gt = {
|
|
198
246
|
key: 0,
|
|
199
247
|
class: "bulk-bar"
|
|
200
|
-
},
|
|
248
|
+
}, Zt = { class: "bulk-left" }, Qt = { class: "bulk-actions" }, Jt = { class: "card" }, Xt = {
|
|
201
249
|
key: 0,
|
|
202
250
|
class: "table-header-actions"
|
|
203
|
-
},
|
|
251
|
+
}, el = ["title"], tl = {
|
|
204
252
|
key: 0,
|
|
205
253
|
viewBox: "0 0 24 24",
|
|
206
254
|
fill: "none",
|
|
207
255
|
xmlns: "http://www.w3.org/2000/svg",
|
|
208
256
|
class: "toggle-icon"
|
|
209
|
-
},
|
|
257
|
+
}, ll = {
|
|
210
258
|
key: 1,
|
|
211
259
|
viewBox: "0 0 24 24",
|
|
212
260
|
fill: "none",
|
|
213
261
|
xmlns: "http://www.w3.org/2000/svg",
|
|
214
262
|
class: "toggle-icon"
|
|
215
|
-
},
|
|
263
|
+
}, nl = { class: "table" }, al = {
|
|
216
264
|
key: 0,
|
|
217
265
|
style: { width: "34px", "min-width": "34px" }
|
|
218
|
-
},
|
|
266
|
+
}, ol = {
|
|
219
267
|
key: 1,
|
|
220
268
|
style: { width: "60px", "min-width": "60px" }
|
|
221
|
-
},
|
|
269
|
+
}, sl = {
|
|
222
270
|
key: 0,
|
|
223
271
|
class: "col-expand"
|
|
224
|
-
},
|
|
272
|
+
}, il = {
|
|
225
273
|
key: 1,
|
|
226
274
|
class: "col-select"
|
|
227
|
-
},
|
|
275
|
+
}, rl = { class: "select-header" }, ul = ["checked", "indeterminate", "disabled"], dl = {
|
|
228
276
|
key: 0,
|
|
229
277
|
class: "select-count"
|
|
230
|
-
},
|
|
278
|
+
}, cl = ["colspan"], fl = { class: "selected-header-wrapper" }, vl = {
|
|
231
279
|
key: 0,
|
|
232
280
|
class: "loading-overlay"
|
|
233
|
-
},
|
|
281
|
+
}, hl = {
|
|
234
282
|
key: 1,
|
|
235
283
|
class: "empty-overlay"
|
|
236
|
-
},
|
|
284
|
+
}, gl = {
|
|
237
285
|
key: 0,
|
|
238
286
|
style: { width: "34px", "min-width": "34px" }
|
|
239
|
-
},
|
|
287
|
+
}, pl = {
|
|
240
288
|
key: 1,
|
|
241
289
|
style: { width: "60px", "min-width": "60px" }
|
|
242
|
-
},
|
|
290
|
+
}, yl = ["onClick"], ml = {
|
|
243
291
|
key: 0,
|
|
244
292
|
class: "col-expand"
|
|
245
|
-
},
|
|
293
|
+
}, wl = ["onClick"], bl = ["value", "checked", "disabled", "onChange"], kl = ["colspan"], Cl = /* @__PURE__ */ De({
|
|
246
294
|
__name: "ytable",
|
|
247
295
|
props: {
|
|
248
296
|
data: {},
|
|
@@ -273,142 +321,142 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
273
321
|
},
|
|
274
322
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change", "row-click"],
|
|
275
323
|
setup(e, { emit: m }) {
|
|
276
|
-
const t = e, l = m,
|
|
277
|
-
if (
|
|
324
|
+
const t = e, l = m, f = N(t.currentPage || 1), h = N(t.pageSize), o = N(t.selectedItems || []), $ = N([]), w = N(/* @__PURE__ */ new Set()), I = N("none"), x = N(), p = N(), d = N(), C = N(), _ = N([]), Z = N({}), G = N(35), A = N(/* @__PURE__ */ new Set()), U = F(() => A.value.size > 0), O = F(() => {
|
|
325
|
+
if (E.value, A.value.size === 0) return !1;
|
|
278
326
|
let n = 0;
|
|
279
|
-
return
|
|
280
|
-
|
|
281
|
-
}), n ===
|
|
327
|
+
return A.value.forEach((u) => {
|
|
328
|
+
u && u.isExpanded && n++;
|
|
329
|
+
}), n === A.value.size;
|
|
282
330
|
});
|
|
283
|
-
|
|
284
|
-
if (
|
|
331
|
+
F(() => {
|
|
332
|
+
if (E.value, A.value.size === 0) return !0;
|
|
285
333
|
let n = 0;
|
|
286
|
-
return
|
|
287
|
-
|
|
288
|
-
}), n ===
|
|
334
|
+
return A.value.forEach((u) => {
|
|
335
|
+
u && !u.isExpanded && n++;
|
|
336
|
+
}), n === A.value.size;
|
|
289
337
|
});
|
|
290
|
-
function
|
|
291
|
-
|
|
338
|
+
function X(n) {
|
|
339
|
+
A.value.add(n);
|
|
292
340
|
}
|
|
293
|
-
function
|
|
294
|
-
|
|
341
|
+
function J(n) {
|
|
342
|
+
A.value.delete(n);
|
|
295
343
|
}
|
|
296
344
|
function re() {
|
|
297
|
-
|
|
345
|
+
A.value.forEach((n) => {
|
|
298
346
|
n && typeof n.collapse == "function" && n.collapse();
|
|
299
347
|
});
|
|
300
348
|
}
|
|
301
349
|
function se() {
|
|
302
|
-
|
|
350
|
+
A.value.forEach((n) => {
|
|
303
351
|
n && typeof n.expand == "function" && n.expand();
|
|
304
352
|
});
|
|
305
353
|
}
|
|
306
354
|
function ke() {
|
|
307
|
-
|
|
355
|
+
O.value ? re() : se();
|
|
308
356
|
}
|
|
309
|
-
const
|
|
310
|
-
function
|
|
311
|
-
|
|
357
|
+
const E = N(0);
|
|
358
|
+
function V() {
|
|
359
|
+
E.value++;
|
|
312
360
|
}
|
|
313
|
-
me("registerHintTag",
|
|
314
|
-
const T =
|
|
361
|
+
me("registerHintTag", X), me("unregisterHintTag", J), me("notifyHintTagStateChange", V);
|
|
362
|
+
const T = F(
|
|
315
363
|
() => t.columns.filter((n) => !s(n.width)).map((n) => n.key)
|
|
316
364
|
);
|
|
317
|
-
function
|
|
365
|
+
function Y() {
|
|
318
366
|
return `${(100 / (T.value.length || 1)).toFixed(6)}%`;
|
|
319
367
|
}
|
|
320
|
-
const te =
|
|
368
|
+
const te = N(), B = N({
|
|
321
369
|
show: !1,
|
|
322
370
|
thumbHeight: 40,
|
|
323
371
|
thumbTop: 0
|
|
324
372
|
});
|
|
325
|
-
let
|
|
326
|
-
const K =
|
|
373
|
+
let Q = !1, g = 0, D = 0;
|
|
374
|
+
const K = N(0);
|
|
327
375
|
function s(n) {
|
|
328
376
|
if (n == null) return;
|
|
329
377
|
if (typeof n == "number")
|
|
330
378
|
return Number.isFinite(n) ? `${n}px` : void 0;
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
333
|
-
return /^\d+(\.\d+)?$/.test(
|
|
379
|
+
const u = String(n).trim();
|
|
380
|
+
if (u)
|
|
381
|
+
return /^\d+(\.\d+)?$/.test(u) ? `${u}px` : u;
|
|
334
382
|
}
|
|
335
383
|
function y(n) {
|
|
336
|
-
const
|
|
337
|
-
if (!
|
|
338
|
-
const k = parseFloat(
|
|
384
|
+
const u = s(n);
|
|
385
|
+
if (!u) return null;
|
|
386
|
+
const k = parseFloat(u);
|
|
339
387
|
return Number.isFinite(k) ? k : null;
|
|
340
388
|
}
|
|
341
|
-
const b =
|
|
389
|
+
const b = F(() => {
|
|
342
390
|
let n = t.columns.length;
|
|
343
391
|
return t.selectable && (n += 1), t.expandable && (n += 1), n;
|
|
344
|
-
}),
|
|
392
|
+
}), z = F(() => {
|
|
345
393
|
if (!t.searchKeyword || !t.searchFields.length)
|
|
346
394
|
return t.data;
|
|
347
395
|
const n = t.searchKeyword.toLowerCase();
|
|
348
|
-
return t.data.filter((
|
|
349
|
-
const
|
|
350
|
-
return String(
|
|
396
|
+
return t.data.filter((u) => t.searchFields.some((k) => {
|
|
397
|
+
const M = Ue(u, k);
|
|
398
|
+
return String(M).toLowerCase().includes(n);
|
|
351
399
|
}));
|
|
352
|
-
}), S =
|
|
400
|
+
}), S = F(() => (t.pagination, z.value)), P = F(() => {
|
|
353
401
|
if (!t.selectable) return !1;
|
|
354
|
-
const n = S.value.map((
|
|
355
|
-
return n.length > 0 && n.every((
|
|
356
|
-
}), le =
|
|
357
|
-
if (!t.selectable ||
|
|
358
|
-
const n = S.value.map((k,
|
|
402
|
+
const n = S.value.map((u, k) => ({ key: Se(u, k), item: u, index: k })).filter(({ item: u, index: k }) => !Ae(u, k)).map(({ key: u }) => u);
|
|
403
|
+
return n.length > 0 && n.every((u) => o.value.includes(u));
|
|
404
|
+
}), le = F(() => {
|
|
405
|
+
if (!t.selectable || P.value) return !1;
|
|
406
|
+
const n = S.value.map((k, M) => ({ key: Se(k, M), item: k, index: M })).filter(({ item: k, index: M }) => !Ae(k, M)).map(({ key: k }) => k);
|
|
359
407
|
if (n.length === 0) return !1;
|
|
360
|
-
const
|
|
361
|
-
return
|
|
362
|
-
}), Ce =
|
|
408
|
+
const u = n.filter((k) => o.value.includes(k)).length;
|
|
409
|
+
return u > 0 && u < n.length;
|
|
410
|
+
}), Ce = F(() => {
|
|
363
411
|
if (!t.selectable) return !1;
|
|
364
|
-
const n = S.value.map((
|
|
365
|
-
return n.length > 0 && n.every(({ item:
|
|
366
|
-
}),
|
|
412
|
+
const n = S.value.map((u, k) => ({ item: u, index: k }));
|
|
413
|
+
return n.length > 0 && n.every(({ item: u, index: k }) => Ae(u, k));
|
|
414
|
+
}), Fe = F(() => t.pagination ? S.value.length < h.value : !1), qe = F(() => {
|
|
367
415
|
const n = [];
|
|
368
|
-
let
|
|
416
|
+
let u = t.selectable ? 60 : 0;
|
|
369
417
|
for (let k = 0; k < t.columns.length; k++) {
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
372
|
-
let
|
|
373
|
-
const
|
|
374
|
-
|
|
418
|
+
const M = t.columns[k];
|
|
419
|
+
if (M.fixed === "left") {
|
|
420
|
+
let L = 80;
|
|
421
|
+
const R = y(M.width);
|
|
422
|
+
R !== null ? L = R : _.value[k] && (L = y(_.value[k]) ?? L), n.push(u), u += L;
|
|
375
423
|
}
|
|
376
424
|
}
|
|
377
425
|
return n;
|
|
378
|
-
}), ut =
|
|
426
|
+
}), ut = F(() => {
|
|
379
427
|
const n = [];
|
|
380
|
-
let
|
|
428
|
+
let u = 0;
|
|
381
429
|
const k = [];
|
|
382
|
-
for (let
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
let
|
|
386
|
-
const
|
|
387
|
-
|
|
430
|
+
for (let M = t.columns.length - 1; M >= 0; M--) {
|
|
431
|
+
const L = t.columns[M];
|
|
432
|
+
if (L.fixed === "right") {
|
|
433
|
+
let R = 80;
|
|
434
|
+
const ee = y(L.width);
|
|
435
|
+
ee !== null ? R = ee : _.value[M] && (R = y(_.value[M]) ?? R), k.push({ index: M, width: R });
|
|
388
436
|
}
|
|
389
437
|
}
|
|
390
|
-
for (let
|
|
391
|
-
n.push(
|
|
438
|
+
for (let M = 0; M < k.length; M++)
|
|
439
|
+
n.push(u), u += k[M].width;
|
|
392
440
|
return n;
|
|
393
441
|
});
|
|
394
|
-
function et(n,
|
|
395
|
-
if (
|
|
442
|
+
function et(n, u) {
|
|
443
|
+
if (u === "left") {
|
|
396
444
|
let k = 0;
|
|
397
|
-
for (let
|
|
398
|
-
t.columns[
|
|
445
|
+
for (let M = 0; M < n; M++)
|
|
446
|
+
t.columns[M].fixed === "left" && k++;
|
|
399
447
|
return k;
|
|
400
448
|
} else {
|
|
401
449
|
let k = 0;
|
|
402
|
-
for (let
|
|
403
|
-
t.columns[
|
|
450
|
+
for (let M = t.columns.length - 1; M > n; M--)
|
|
451
|
+
t.columns[M].fixed === "right" && k++;
|
|
404
452
|
return k;
|
|
405
453
|
}
|
|
406
454
|
}
|
|
407
|
-
function Se(n,
|
|
408
|
-
return typeof t.rowKey == "function" ? t.rowKey(n) : n[t.rowKey] ||
|
|
455
|
+
function Se(n, u) {
|
|
456
|
+
return typeof t.rowKey == "function" ? t.rowKey(n) : n[t.rowKey] || u;
|
|
409
457
|
}
|
|
410
|
-
function Ae(n,
|
|
411
|
-
return t.rowDisabled && typeof t.rowDisabled == "function" ? t.rowDisabled(n,
|
|
458
|
+
function Ae(n, u) {
|
|
459
|
+
return t.rowDisabled && typeof t.rowDisabled == "function" ? t.rowDisabled(n, u) : !1;
|
|
412
460
|
}
|
|
413
461
|
function Ge(n) {
|
|
414
462
|
return w.value.has(n);
|
|
@@ -416,96 +464,96 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
416
464
|
function dt(n) {
|
|
417
465
|
w.value.has(n) ? w.value.delete(n) : w.value.add(n);
|
|
418
466
|
}
|
|
419
|
-
function Ue(n,
|
|
420
|
-
return
|
|
467
|
+
function Ue(n, u) {
|
|
468
|
+
return u.split(".").reduce((k, M) => k == null ? void 0 : k[M], n);
|
|
421
469
|
}
|
|
422
|
-
function tt(n,
|
|
470
|
+
function tt(n, u = !1) {
|
|
423
471
|
const k = [];
|
|
424
|
-
return n.align && k.push(`text-${n.align}`), n.fixed === "right" && (k.push("col-fixed-right"),
|
|
472
|
+
return n.align && k.push(`text-${n.align}`), n.fixed === "right" && (k.push("col-fixed-right"), u && k.push("col-fixed-right-header")), n.fixed === "left" && (k.push("col-fixed-left"), u && k.push("col-fixed-left-header")), k.join(" ");
|
|
425
473
|
}
|
|
426
|
-
function je(n,
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
|
|
474
|
+
function je(n, u, k) {
|
|
475
|
+
const M = {}, L = s(n.width);
|
|
476
|
+
if (L)
|
|
477
|
+
M.width = L, M.minWidth = L, M.maxWidth = L;
|
|
430
478
|
else {
|
|
431
|
-
const
|
|
432
|
-
|
|
479
|
+
const R = Y();
|
|
480
|
+
M.width = R, M.minWidth = R, M.maxWidth = R;
|
|
433
481
|
}
|
|
434
482
|
if (n.fixed === "left") {
|
|
435
|
-
const
|
|
436
|
-
|
|
483
|
+
const R = et(u, "left"), ee = qe.value[R] || 0;
|
|
484
|
+
M.left = `${ee}px`, M.zIndex = k ? `${10 + R}` : `${5 + R}`;
|
|
437
485
|
} else if (n.fixed === "right") {
|
|
438
|
-
const
|
|
439
|
-
k ?
|
|
486
|
+
const R = et(u, "right"), ee = ut.value[R] || 0;
|
|
487
|
+
k ? M.right = `${ee - 3}px` : M.right = `${ee}px`, M.zIndex = k ? `${10 + R}` : `${5 + R}`;
|
|
440
488
|
}
|
|
441
|
-
return
|
|
489
|
+
return M;
|
|
442
490
|
}
|
|
443
|
-
function i(n,
|
|
444
|
-
const k = Ue(n,
|
|
445
|
-
return
|
|
491
|
+
function i(n, u) {
|
|
492
|
+
const k = Ue(n, u.key);
|
|
493
|
+
return u.formatter ? u.formatter(k, n) : k || "";
|
|
446
494
|
}
|
|
447
|
-
function
|
|
448
|
-
const
|
|
449
|
-
|
|
495
|
+
function v(n) {
|
|
496
|
+
const u = S.value.find((M, L) => Se(M, L) === n), k = S.value.findIndex((M, L) => Se(M, L) === n);
|
|
497
|
+
u && k >= 0 && Ae(u, k) || (o.value.includes(n) ? o.value = o.value.filter((M) => M !== n) : o.value = [...o.value, n], l("select", o.value), l("update:selectedItems", o.value));
|
|
450
498
|
}
|
|
451
499
|
function H() {
|
|
452
|
-
const n = S.value.map((
|
|
500
|
+
const n = S.value.map((u, k) => ({ key: Se(u, k), item: u, index: k })).filter(({ item: u, index: k }) => !Ae(u, k)).map(({ key: u }) => u);
|
|
453
501
|
if (n.length !== 0) {
|
|
454
|
-
if (n.every((
|
|
455
|
-
o.value = o.value.filter((
|
|
502
|
+
if (n.every((u) => o.value.includes(u)))
|
|
503
|
+
o.value = o.value.filter((u) => !n.includes(u));
|
|
456
504
|
else {
|
|
457
|
-
const
|
|
458
|
-
o.value = Array.from(
|
|
505
|
+
const u = /* @__PURE__ */ new Set([...o.value, ...n]);
|
|
506
|
+
o.value = Array.from(u);
|
|
459
507
|
}
|
|
460
508
|
l("select", o.value), l("update:selectedItems", o.value);
|
|
461
509
|
}
|
|
462
510
|
}
|
|
463
|
-
function
|
|
511
|
+
function q() {
|
|
464
512
|
o.value = [], l("select", o.value), l("update:selectedItems", o.value);
|
|
465
513
|
}
|
|
466
|
-
function ue(n,
|
|
514
|
+
function ue(n, u) {
|
|
467
515
|
if (!t.rowSelectable) return;
|
|
468
|
-
const k = Se(n,
|
|
469
|
-
Ae(n,
|
|
516
|
+
const k = Se(n, u);
|
|
517
|
+
Ae(n, u) || (t.requireDeselectBeforeSelect ? $.value.includes(k) ? ($.value = $.value.filter((M) => M !== k), l("row-click", n, null)) : ($.value = [...$.value, k], l("row-click", n, k)) : $.value.includes(k) ? ($.value = [], l("row-click", n, null)) : ($.value = [k], l("row-click", n, k)));
|
|
470
518
|
}
|
|
471
|
-
function de(n,
|
|
519
|
+
function de(n, u) {
|
|
472
520
|
if (!t.rowSelectable) return !1;
|
|
473
|
-
const k = Se(n,
|
|
521
|
+
const k = Se(n, u);
|
|
474
522
|
return $.value.includes(k);
|
|
475
523
|
}
|
|
476
524
|
ae(() => t.selectedItems, (n) => {
|
|
477
525
|
if (n !== void 0 && Array.isArray(n)) {
|
|
478
|
-
const
|
|
479
|
-
(
|
|
526
|
+
const u = new Set(o.value), k = new Set(n);
|
|
527
|
+
(u.size !== k.size || ![...u].every((M) => k.has(M))) && (o.value = [...n]);
|
|
480
528
|
} else n === void 0 && o.value.length > 0 && (o.value = []);
|
|
481
529
|
}, { deep: !0, immediate: !0 }), ae(() => t.searchKeyword, () => {
|
|
482
|
-
|
|
530
|
+
f.value = 1;
|
|
483
531
|
}), ae(() => t.data, () => {
|
|
484
|
-
t.total || (
|
|
532
|
+
t.total || (f.value = 1), t.rowSelectable && ($.value = []);
|
|
485
533
|
}, { deep: !0 });
|
|
486
534
|
function ye(n) {
|
|
487
|
-
|
|
535
|
+
f.value = n, t.rowSelectable && ($.value = []), l("page-change", n);
|
|
488
536
|
}
|
|
489
537
|
function Te(n) {
|
|
490
|
-
h.value = n,
|
|
538
|
+
h.value = n, f.value = 1, t.rowSelectable && ($.value = []), l("page-size-change", n);
|
|
491
539
|
}
|
|
492
540
|
ae(() => t.currentPage, (n) => {
|
|
493
|
-
const
|
|
494
|
-
|
|
541
|
+
const u = typeof n == "number" && n > 0 ? n : 1;
|
|
542
|
+
f.value !== u && (f.value = u);
|
|
495
543
|
}), ae(() => t.pageSize, (n) => {
|
|
496
|
-
const
|
|
497
|
-
h.value !==
|
|
544
|
+
const u = typeof n == "number" && n > 0 ? n : 10;
|
|
545
|
+
h.value !== u && (h.value = u);
|
|
498
546
|
});
|
|
499
547
|
function Re() {
|
|
500
|
-
|
|
501
|
-
const n =
|
|
502
|
-
let
|
|
548
|
+
x.value && ie(() => {
|
|
549
|
+
const n = x.value.getBoundingClientRect(), u = window.innerHeight, k = n.top, M = x.value.querySelector(".table-header"), L = M ? M.offsetHeight : 40;
|
|
550
|
+
let R = 0;
|
|
503
551
|
if (t.pagination) {
|
|
504
|
-
const ct =
|
|
505
|
-
|
|
552
|
+
const ct = x.value.querySelector(".ypagination");
|
|
553
|
+
R = ct ? ct.offsetHeight : 60;
|
|
506
554
|
}
|
|
507
|
-
const
|
|
508
|
-
wt && (wt.offsetHeight > ot ?
|
|
555
|
+
const ee = x.value.querySelector(".bulk-bar"), Ie = ee ? ee.offsetHeight : 0, at = L + R + Ie + 20, ot = u - k - at, Et = Math.max(200, ot), wt = x.value.querySelector(".table-body-wrap .table");
|
|
556
|
+
wt && (wt.offsetHeight > ot ? I.value = `${Et}px` : I.value = "none");
|
|
509
557
|
});
|
|
510
558
|
}
|
|
511
559
|
let Ye = !1;
|
|
@@ -522,66 +570,66 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
522
570
|
function ge() {
|
|
523
571
|
ie(() => {
|
|
524
572
|
if (!d.value) return;
|
|
525
|
-
const n = d.value,
|
|
526
|
-
if (B.value.show =
|
|
527
|
-
const
|
|
573
|
+
const n = d.value, u = n.scrollHeight, k = n.clientHeight, M = n.scrollTop, L = u > k + 1;
|
|
574
|
+
if (B.value.show = L, !L) return;
|
|
575
|
+
const R = 24, ee = k / u, Ie = te.value ? te.value.clientHeight : k, Ee = Math.max(R, Math.floor(Ie * ee));
|
|
528
576
|
B.value.thumbHeight = Ee;
|
|
529
|
-
const at = Math.max(0, Ie - Ee), ot = Math.max(1,
|
|
530
|
-
B.value.thumbTop = Math.min(at, Math.floor(
|
|
577
|
+
const at = Math.max(0, Ie - Ee), ot = Math.max(1, u - k);
|
|
578
|
+
B.value.thumbTop = Math.min(at, Math.floor(M / ot * at));
|
|
531
579
|
});
|
|
532
580
|
}
|
|
533
581
|
function Be(n) {
|
|
534
|
-
if (!
|
|
582
|
+
if (!Q || !d.value || !te.value) return;
|
|
535
583
|
n.preventDefault();
|
|
536
|
-
const
|
|
537
|
-
|
|
584
|
+
const u = te.value.clientHeight, k = Math.max(0, u - B.value.thumbHeight), M = d.value, L = M.scrollHeight, R = M.clientHeight, ee = Math.max(1, L - R), Ee = (n.clientY - g) / Math.max(1, k) * ee;
|
|
585
|
+
M.scrollTop = Math.min(ee, Math.max(0, D + Ee)), ge();
|
|
538
586
|
}
|
|
539
587
|
function gt() {
|
|
540
|
-
|
|
588
|
+
Q = !1, window.removeEventListener("mousemove", Be), window.removeEventListener("mouseup", gt);
|
|
541
589
|
}
|
|
542
590
|
function pt() {
|
|
543
591
|
ie(() => {
|
|
544
|
-
var k,
|
|
545
|
-
if (
|
|
592
|
+
var k, M;
|
|
593
|
+
if (_.value.length === t.columns.length && _.value.every((L) => !!L))
|
|
546
594
|
return;
|
|
547
595
|
const n = [];
|
|
548
|
-
t.columns.forEach((
|
|
549
|
-
const
|
|
550
|
-
if (
|
|
551
|
-
n.push(
|
|
552
|
-
else if (
|
|
553
|
-
n.push(
|
|
596
|
+
t.columns.forEach((L, R) => {
|
|
597
|
+
const ee = s(L.width);
|
|
598
|
+
if (ee)
|
|
599
|
+
n.push(ee), Z.value[L.key] = ee;
|
|
600
|
+
else if (Z.value[L.key])
|
|
601
|
+
n.push(Z.value[L.key]);
|
|
554
602
|
else {
|
|
555
|
-
const Ie =
|
|
603
|
+
const Ie = _.value[R];
|
|
556
604
|
if (Ie)
|
|
557
|
-
n.push(Ie),
|
|
605
|
+
n.push(Ie), Z.value[L.key] = Ie;
|
|
558
606
|
else {
|
|
559
|
-
const Ee =
|
|
560
|
-
n.push(Ee),
|
|
607
|
+
const Ee = Y();
|
|
608
|
+
n.push(Ee), Z.value[L.key] = Ee;
|
|
561
609
|
}
|
|
562
610
|
}
|
|
563
611
|
});
|
|
564
|
-
const
|
|
565
|
-
if (
|
|
566
|
-
const
|
|
567
|
-
for (let
|
|
568
|
-
if (!n[
|
|
569
|
-
const Ie =
|
|
612
|
+
const u = (k = C.value) == null ? void 0 : k.querySelector("tbody tr");
|
|
613
|
+
if (u) {
|
|
614
|
+
const L = t.selectable ? 1 : 0, R = Array.from(u.children);
|
|
615
|
+
for (let ee = 0; ee < t.columns.length; ee++)
|
|
616
|
+
if (!n[ee]) {
|
|
617
|
+
const Ie = R[L + ee];
|
|
570
618
|
if (Ie && Ie.clientWidth > 0) {
|
|
571
619
|
const Ee = `${Ie.clientWidth}px`;
|
|
572
|
-
n[
|
|
620
|
+
n[ee] = Ee, Z.value[t.columns[ee].key] = Ee;
|
|
573
621
|
} else {
|
|
574
|
-
const Ee =
|
|
575
|
-
n[
|
|
622
|
+
const Ee = Y();
|
|
623
|
+
n[ee] = Ee, Z.value[t.columns[ee].key] = Ee;
|
|
576
624
|
}
|
|
577
625
|
}
|
|
578
626
|
} else
|
|
579
|
-
for (let
|
|
580
|
-
if (!n[
|
|
581
|
-
const
|
|
582
|
-
n[
|
|
627
|
+
for (let L = 0; L < n.length; L++)
|
|
628
|
+
if (!n[L]) {
|
|
629
|
+
const R = Z.value[((M = t.columns[L]) == null ? void 0 : M.key) || ""];
|
|
630
|
+
n[L] = R || _.value[L] || "80px", t.columns[L] && (Z.value[t.columns[L].key] = n[L]);
|
|
583
631
|
}
|
|
584
|
-
|
|
632
|
+
_.value = n;
|
|
585
633
|
});
|
|
586
634
|
}
|
|
587
635
|
function lt() {
|
|
@@ -591,20 +639,20 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
591
639
|
ie(() => {
|
|
592
640
|
Re(), Oe(), We(), w.value.clear();
|
|
593
641
|
});
|
|
594
|
-
}, { deep: !0 }), ae([
|
|
642
|
+
}, { deep: !0 }), ae([f, h], () => {
|
|
595
643
|
ie(() => {
|
|
596
644
|
Re(), Oe(), We();
|
|
597
645
|
});
|
|
598
646
|
}), ae(() => t.columns, () => {
|
|
599
|
-
const n = [],
|
|
600
|
-
t.columns.forEach((
|
|
601
|
-
const
|
|
602
|
-
|
|
647
|
+
const n = [], u = { ...Z.value };
|
|
648
|
+
t.columns.forEach((M, L) => {
|
|
649
|
+
const R = s(M.width);
|
|
650
|
+
R ? (n.push(R), u[M.key] = R) : u[M.key] ? n.push(u[M.key]) : _.value[L] ? (n.push(_.value[L]), u[M.key] = _.value[L]) : n.push("");
|
|
603
651
|
});
|
|
604
|
-
const k = new Set(t.columns.map((
|
|
605
|
-
Object.keys(
|
|
606
|
-
k.has(
|
|
607
|
-
}),
|
|
652
|
+
const k = new Set(t.columns.map((M) => M.key));
|
|
653
|
+
Object.keys(u).forEach((M) => {
|
|
654
|
+
k.has(M) || delete u[M];
|
|
655
|
+
}), Z.value = u, _.value = n, ie(() => {
|
|
608
656
|
pt(), Oe(), We(), nt();
|
|
609
657
|
});
|
|
610
658
|
}, { deep: !0 });
|
|
@@ -613,8 +661,8 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
613
661
|
if (!p.value) return;
|
|
614
662
|
const n = p.value.querySelector(".table");
|
|
615
663
|
if (n && o.value.length === 0) {
|
|
616
|
-
const
|
|
617
|
-
|
|
664
|
+
const u = n.querySelector("thead th:not(.col-select):not(.col-expand)");
|
|
665
|
+
u && u.offsetHeight > 0 && (G.value = u.offsetHeight);
|
|
618
666
|
}
|
|
619
667
|
});
|
|
620
668
|
}
|
|
@@ -623,10 +671,10 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
623
671
|
if (!p.value) return;
|
|
624
672
|
const n = p.value.querySelector(".table");
|
|
625
673
|
if (!n) return;
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
const k =
|
|
629
|
-
k && (k.style.height = `${
|
|
674
|
+
const u = n.querySelector(".col-selected-header");
|
|
675
|
+
if (u) {
|
|
676
|
+
const k = u.querySelector(".selected-header-wrapper");
|
|
677
|
+
k && (k.style.height = `${G.value}px`);
|
|
630
678
|
} else
|
|
631
679
|
yt();
|
|
632
680
|
});
|
|
@@ -639,76 +687,76 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
639
687
|
ie(() => {
|
|
640
688
|
We();
|
|
641
689
|
});
|
|
642
|
-
}),
|
|
643
|
-
var n,
|
|
690
|
+
}), ze(() => {
|
|
691
|
+
var n, u;
|
|
644
692
|
ie(() => {
|
|
645
693
|
Re(), pt(), We(), ge(), yt(), nt();
|
|
646
694
|
}), window.addEventListener("resize", lt), window.addEventListener("scroll", lt, !0), (n = d.value) == null || n.addEventListener("scroll", () => {
|
|
647
695
|
Oe(), ge(), We();
|
|
648
|
-
}, { passive: !0 }), (
|
|
696
|
+
}, { passive: !0 }), (u = p.value) == null || u.addEventListener("scroll", () => {
|
|
649
697
|
Ze();
|
|
650
698
|
}, { passive: !0 }), ie(() => Oe()), d.value && typeof ResizeObserver < "u" && (Qe = new ResizeObserver(() => {
|
|
651
699
|
We();
|
|
652
700
|
}), Qe.observe(d.value));
|
|
653
701
|
}), Ke(() => {
|
|
654
|
-
var n,
|
|
655
|
-
window.removeEventListener("resize", lt), window.removeEventListener("scroll", lt, !0), (n = d.value) == null || n.removeEventListener("scroll", Oe), (
|
|
702
|
+
var n, u;
|
|
703
|
+
window.removeEventListener("resize", lt), window.removeEventListener("scroll", lt, !0), (n = d.value) == null || n.removeEventListener("scroll", Oe), (u = p.value) == null || u.removeEventListener("scroll", Ze), window.removeEventListener("mousemove", Be), window.removeEventListener("mouseup", gt), Qe && (Qe.disconnect(), Qe = null);
|
|
656
704
|
});
|
|
657
705
|
let mt = -1;
|
|
658
706
|
function We() {
|
|
659
707
|
!p.value || !d.value || requestAnimationFrame(() => {
|
|
660
708
|
if (!p.value || !d.value) return;
|
|
661
|
-
const n = d.value,
|
|
662
|
-
if (K.value =
|
|
663
|
-
mt =
|
|
664
|
-
const k = p.value.querySelector(".table"),
|
|
665
|
-
k &&
|
|
709
|
+
const n = d.value, u = Math.ceil(n.offsetWidth - n.clientWidth);
|
|
710
|
+
if (K.value = u, u !== mt) {
|
|
711
|
+
mt = u;
|
|
712
|
+
const k = p.value.querySelector(".table"), M = C.value;
|
|
713
|
+
k && M && (p.value.style.paddingRight = "0px", k.style.width = "", k.style.marginRight = "", u > 0 ? (p.value.style.paddingRight = `${u}px`, k.style.width = "100%", k.style.marginRight = `-${u}px`) : (p.value.style.paddingRight = "0px", k.style.width = "100%", k.style.marginRight = "0px"));
|
|
666
714
|
}
|
|
667
715
|
});
|
|
668
716
|
}
|
|
669
717
|
let Qe = null;
|
|
670
718
|
return Ke(() => {
|
|
671
|
-
|
|
672
|
-
}), (n,
|
|
673
|
-
const k = Je("YButton"),
|
|
674
|
-
return
|
|
719
|
+
A.value.clear();
|
|
720
|
+
}), (n, u) => {
|
|
721
|
+
const k = Je("YButton"), M = Je("YPagination");
|
|
722
|
+
return r(), c("div", {
|
|
675
723
|
class: "ytable-container",
|
|
676
724
|
ref_key: "tableContainer",
|
|
677
|
-
ref:
|
|
725
|
+
ref: x
|
|
678
726
|
}, [
|
|
679
727
|
be(He, { name: "bulk-slide" }, {
|
|
680
728
|
default: pe(() => [
|
|
681
|
-
o.value.length && e.showBulkActions ? (
|
|
682
|
-
a("div",
|
|
683
|
-
a("div",
|
|
729
|
+
o.value.length && e.showBulkActions ? (r(), c("div", Gt, [
|
|
730
|
+
a("div", Zt, "已选择 " + oe(o.value.length) + " 项", 1),
|
|
731
|
+
a("div", Qt, [
|
|
684
732
|
ve(n.$slots, "bulk-actions", {
|
|
685
733
|
selectedItems: o.value,
|
|
686
|
-
clearSelection:
|
|
734
|
+
clearSelection: q
|
|
687
735
|
}, () => [
|
|
688
736
|
be(k, {
|
|
689
737
|
size: "small",
|
|
690
738
|
class: "btn",
|
|
691
|
-
onClick:
|
|
739
|
+
onClick: q
|
|
692
740
|
}, {
|
|
693
|
-
default: pe(() => [...
|
|
741
|
+
default: pe(() => [...u[3] || (u[3] = [
|
|
694
742
|
Le("清除选择", -1)
|
|
695
743
|
])]),
|
|
696
744
|
_: 1
|
|
697
745
|
})
|
|
698
746
|
], !0)
|
|
699
747
|
])
|
|
700
|
-
])) :
|
|
748
|
+
])) : W("", !0)
|
|
701
749
|
]),
|
|
702
750
|
_: 3
|
|
703
751
|
}),
|
|
704
|
-
a("div",
|
|
705
|
-
|
|
752
|
+
a("div", Jt, [
|
|
753
|
+
U.value ? (r(), c("div", Xt, [
|
|
706
754
|
a("button", {
|
|
707
|
-
class:
|
|
755
|
+
class: j(["toggle-all-hints-btn", { "is-expanded": O.value }]),
|
|
708
756
|
onClick: ke,
|
|
709
|
-
title:
|
|
757
|
+
title: O.value ? "收起所有提示标签" : "展开所有提示标签"
|
|
710
758
|
}, [
|
|
711
|
-
|
|
759
|
+
O.value ? (r(), c("svg", tl, [...u[4] || (u[4] = [
|
|
712
760
|
a("path", {
|
|
713
761
|
d: "M15 18L9 12L15 6",
|
|
714
762
|
stroke: "currentColor",
|
|
@@ -716,7 +764,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
716
764
|
"stroke-linecap": "round",
|
|
717
765
|
"stroke-linejoin": "round"
|
|
718
766
|
}, null, -1)
|
|
719
|
-
])])) : (
|
|
767
|
+
])])) : (r(), c("svg", ll, [...u[5] || (u[5] = [
|
|
720
768
|
a("path", {
|
|
721
769
|
d: "M9 18L15 12L9 6",
|
|
722
770
|
stroke: "currentColor",
|
|
@@ -725,134 +773,134 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
725
773
|
"stroke-linejoin": "round"
|
|
726
774
|
}, null, -1)
|
|
727
775
|
])]))
|
|
728
|
-
], 10,
|
|
729
|
-
])) :
|
|
776
|
+
], 10, el)
|
|
777
|
+
])) : W("", !0),
|
|
730
778
|
a("div", {
|
|
731
779
|
class: "table-header",
|
|
732
780
|
ref_key: "headerRef",
|
|
733
781
|
ref: p
|
|
734
782
|
}, [
|
|
735
|
-
a("table",
|
|
783
|
+
a("table", nl, [
|
|
736
784
|
a("colgroup", null, [
|
|
737
|
-
t.expandable ? (
|
|
738
|
-
e.selectable ? (
|
|
739
|
-
(
|
|
740
|
-
key:
|
|
741
|
-
style: fe({ width:
|
|
785
|
+
t.expandable ? (r(), c("col", al)) : W("", !0),
|
|
786
|
+
e.selectable ? (r(), c("col", ol)) : W("", !0),
|
|
787
|
+
(r(!0), c(he, null, xe(e.columns, (L, R) => (r(), c("col", {
|
|
788
|
+
key: L.key,
|
|
789
|
+
style: fe({ width: _.value[R] || void 0, minWidth: _.value[R] || "80px" })
|
|
742
790
|
}, null, 4))), 128))
|
|
743
791
|
]),
|
|
744
792
|
a("thead", null, [
|
|
745
793
|
a("tr", null, [
|
|
746
|
-
t.expandable ? (
|
|
747
|
-
e.selectable ? (
|
|
748
|
-
a("div",
|
|
794
|
+
t.expandable ? (r(), c("th", sl)) : W("", !0),
|
|
795
|
+
e.selectable ? (r(), c("th", il, [
|
|
796
|
+
a("div", rl, [
|
|
749
797
|
a("input", {
|
|
750
798
|
type: "checkbox",
|
|
751
|
-
checked:
|
|
799
|
+
checked: P.value,
|
|
752
800
|
indeterminate: le.value,
|
|
753
801
|
disabled: Ce.value,
|
|
754
802
|
onChange: H
|
|
755
|
-
}, null, 40,
|
|
756
|
-
o.value.length > 0 ? (
|
|
803
|
+
}, null, 40, ul),
|
|
804
|
+
o.value.length > 0 ? (r(), c("span", dl, oe(o.value.length), 1)) : W("", !0)
|
|
757
805
|
])
|
|
758
|
-
])) :
|
|
759
|
-
o.value.length > 0 && n.$slots["selected-header"] ? (
|
|
806
|
+
])) : W("", !0),
|
|
807
|
+
o.value.length > 0 && n.$slots["selected-header"] ? (r(), c("th", {
|
|
760
808
|
key: 2,
|
|
761
809
|
colspan: e.columns.length,
|
|
762
810
|
class: "col-selected-header"
|
|
763
811
|
}, [
|
|
764
|
-
a("div",
|
|
812
|
+
a("div", fl, [
|
|
765
813
|
ve(n.$slots, "selected-header", {
|
|
766
814
|
selectedItems: o.value,
|
|
767
|
-
clearSelection:
|
|
815
|
+
clearSelection: q
|
|
768
816
|
}, void 0, !0)
|
|
769
817
|
])
|
|
770
|
-
], 8,
|
|
771
|
-
key:
|
|
772
|
-
class:
|
|
773
|
-
style: fe(je(
|
|
774
|
-
}, oe(
|
|
818
|
+
], 8, cl)) : (r(!0), c(he, { key: 3 }, xe(e.columns, (L, R) => (r(), c("th", {
|
|
819
|
+
key: L.key,
|
|
820
|
+
class: j(tt(L, !0)),
|
|
821
|
+
style: fe(je(L, R, !0))
|
|
822
|
+
}, oe(L.title), 7))), 128))
|
|
775
823
|
])
|
|
776
824
|
])
|
|
777
825
|
])
|
|
778
826
|
], 512),
|
|
779
827
|
a("div", {
|
|
780
|
-
class:
|
|
828
|
+
class: j(["table-body-wrap", { "is-loading": e.loading, "is-empty": !S.value.length && !e.loading }]),
|
|
781
829
|
ref_key: "bodyWrapRef",
|
|
782
830
|
ref: d,
|
|
783
|
-
style: fe({ maxHeight:
|
|
831
|
+
style: fe({ maxHeight: I.value })
|
|
784
832
|
}, [
|
|
785
|
-
e.loading ? (
|
|
833
|
+
e.loading ? (r(), c("div", vl, [...u[6] || (u[6] = [
|
|
786
834
|
a("div", { class: "loading-spinner" }, null, -1),
|
|
787
835
|
a("div", { class: "loading-text" }, "加载中...", -1)
|
|
788
|
-
])])) :
|
|
789
|
-
!S.value.length && !e.loading ? (
|
|
836
|
+
])])) : W("", !0),
|
|
837
|
+
!S.value.length && !e.loading ? (r(), c("div", hl, [
|
|
790
838
|
ve(n.$slots, "empty", {}, () => [
|
|
791
839
|
Le(oe(e.emptyText), 1)
|
|
792
840
|
], !0)
|
|
793
|
-
])) :
|
|
841
|
+
])) : W("", !0),
|
|
794
842
|
a("table", {
|
|
795
|
-
class:
|
|
843
|
+
class: j(["table", { "loading-table": e.loading }]),
|
|
796
844
|
ref_key: "bodyTableRef",
|
|
797
845
|
ref: C
|
|
798
846
|
}, [
|
|
799
847
|
a("colgroup", null, [
|
|
800
|
-
t.expandable ? (
|
|
801
|
-
e.selectable ? (
|
|
802
|
-
(
|
|
803
|
-
key:
|
|
804
|
-
style: fe({ width:
|
|
848
|
+
t.expandable ? (r(), c("col", gl)) : W("", !0),
|
|
849
|
+
e.selectable ? (r(), c("col", pl)) : W("", !0),
|
|
850
|
+
(r(!0), c(he, null, xe(e.columns, (L, R) => (r(), c("col", {
|
|
851
|
+
key: L.key,
|
|
852
|
+
style: fe({ width: _.value[R] || void 0, minWidth: _.value[R] || "80px" })
|
|
805
853
|
}, null, 4))), 128))
|
|
806
854
|
]),
|
|
807
855
|
a("tbody", null, [
|
|
808
|
-
(
|
|
809
|
-
key: Se(
|
|
856
|
+
(r(!0), c(he, null, xe(S.value, (L, R) => (r(), c(he, {
|
|
857
|
+
key: Se(L, R)
|
|
810
858
|
}, [
|
|
811
859
|
a("tr", {
|
|
812
|
-
class:
|
|
813
|
-
onClick: (
|
|
860
|
+
class: j({ "row-selected": de(L, R) }),
|
|
861
|
+
onClick: (ee) => ue(L, R)
|
|
814
862
|
}, [
|
|
815
|
-
t.expandable ? (
|
|
863
|
+
t.expandable ? (r(), c("td", ml, [
|
|
816
864
|
a("button", {
|
|
817
865
|
class: "expand-btn",
|
|
818
866
|
type: "button",
|
|
819
|
-
onClick: ne((
|
|
867
|
+
onClick: ne((ee) => dt(Se(L, R)), ["stop"])
|
|
820
868
|
}, [
|
|
821
869
|
a("span", {
|
|
822
|
-
class:
|
|
870
|
+
class: j(["expand-icon", { "is-open": Ge(Se(L, R)) }])
|
|
823
871
|
}, null, 2)
|
|
824
|
-
], 8,
|
|
825
|
-
])) :
|
|
826
|
-
e.selectable ? (
|
|
872
|
+
], 8, wl)
|
|
873
|
+
])) : W("", !0),
|
|
874
|
+
e.selectable ? (r(), c("td", {
|
|
827
875
|
key: 1,
|
|
828
876
|
class: "col-select",
|
|
829
|
-
onClick:
|
|
877
|
+
onClick: u[0] || (u[0] = ne(() => {
|
|
830
878
|
}, ["stop"]))
|
|
831
879
|
}, [
|
|
832
880
|
a("input", {
|
|
833
881
|
type: "checkbox",
|
|
834
|
-
value: Se(
|
|
835
|
-
checked: o.value.includes(Se(
|
|
836
|
-
disabled: Ae(
|
|
837
|
-
onChange: ne((
|
|
838
|
-
}, null, 40,
|
|
839
|
-
])) :
|
|
840
|
-
(
|
|
841
|
-
key:
|
|
842
|
-
class:
|
|
843
|
-
style: fe(je(
|
|
882
|
+
value: Se(L, R),
|
|
883
|
+
checked: o.value.includes(Se(L, R)),
|
|
884
|
+
disabled: Ae(L, R),
|
|
885
|
+
onChange: ne((ee) => v(Se(L, R)), ["stop"])
|
|
886
|
+
}, null, 40, bl)
|
|
887
|
+
])) : W("", !0),
|
|
888
|
+
(r(!0), c(he, null, xe(e.columns, (ee, Ie) => (r(), c("td", {
|
|
889
|
+
key: ee.key,
|
|
890
|
+
class: j(tt(ee)),
|
|
891
|
+
style: fe(je(ee, Ie, !1))
|
|
844
892
|
}, [
|
|
845
|
-
ve(n.$slots, `cell-${
|
|
846
|
-
item:
|
|
847
|
-
value: Ue(
|
|
848
|
-
index:
|
|
893
|
+
ve(n.$slots, `cell-${ee.key}`, {
|
|
894
|
+
item: L,
|
|
895
|
+
value: Ue(L, ee.key),
|
|
896
|
+
index: R
|
|
849
897
|
}, () => [
|
|
850
|
-
Le(oe(i(
|
|
898
|
+
Le(oe(i(L, ee)), 1)
|
|
851
899
|
], !0)
|
|
852
900
|
], 6))), 128))
|
|
853
|
-
], 10,
|
|
854
|
-
t.expandable && Ge(Se(
|
|
855
|
-
key: `${Se(
|
|
901
|
+
], 10, yl),
|
|
902
|
+
t.expandable && Ge(Se(L, R)) ? (r(), c("tr", {
|
|
903
|
+
key: `${Se(L, R)}-expand`,
|
|
856
904
|
class: "expand-row"
|
|
857
905
|
}, [
|
|
858
906
|
a("td", {
|
|
@@ -860,48 +908,48 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
860
908
|
class: "expand-cell"
|
|
861
909
|
}, [
|
|
862
910
|
ve(n.$slots, "expand", {
|
|
863
|
-
item:
|
|
864
|
-
index:
|
|
911
|
+
item: L,
|
|
912
|
+
index: R
|
|
865
913
|
}, void 0, !0)
|
|
866
|
-
], 8,
|
|
867
|
-
])) :
|
|
914
|
+
], 8, kl)
|
|
915
|
+
])) : W("", !0)
|
|
868
916
|
], 64))), 128))
|
|
869
917
|
])
|
|
870
918
|
], 2)
|
|
871
919
|
], 6),
|
|
872
|
-
e.pagination ? (
|
|
920
|
+
e.pagination ? (r(), Ne(M, {
|
|
873
921
|
key: 1,
|
|
874
922
|
class: "align-right",
|
|
875
|
-
"current-page":
|
|
876
|
-
"onUpdate:currentPage":
|
|
923
|
+
"current-page": f.value,
|
|
924
|
+
"onUpdate:currentPage": u[1] || (u[1] = (L) => f.value = L),
|
|
877
925
|
"page-size": h.value,
|
|
878
|
-
"onUpdate:pageSize":
|
|
926
|
+
"onUpdate:pageSize": u[2] || (u[2] = (L) => h.value = L),
|
|
879
927
|
loading: t.loading,
|
|
880
|
-
"disable-next":
|
|
928
|
+
"disable-next": Fe.value,
|
|
881
929
|
"page-size-options": e.pageSizeOptions,
|
|
882
930
|
onPageChange: ye,
|
|
883
931
|
onPageSizeChange: Te
|
|
884
|
-
}, null, 8, ["current-page", "page-size", "loading", "disable-next", "page-size-options"])) :
|
|
932
|
+
}, null, 8, ["current-page", "page-size", "loading", "disable-next", "page-size-options"])) : W("", !0)
|
|
885
933
|
])
|
|
886
934
|
], 512);
|
|
887
935
|
};
|
|
888
936
|
}
|
|
889
|
-
}),
|
|
937
|
+
}), xl = /* @__PURE__ */ $e(Cl, [["__scopeId", "data-v-8e9d3cdd"]]), Dl = ["onKeydown", "aria-expanded"], $l = {
|
|
890
938
|
key: 0,
|
|
891
939
|
class: "yselect__tags"
|
|
892
|
-
},
|
|
940
|
+
}, Sl = ["src"], Il = { class: "yselect__tag-text" }, Ml = ["onClick"], El = {
|
|
893
941
|
key: 1,
|
|
894
942
|
class: "yselect__placeholder-text"
|
|
895
|
-
},
|
|
943
|
+
}, Ll = ["src"], Tl = ["placeholder", "onKeydown"], Bl = ["onClick", "onMouseenter"], Hl = {
|
|
896
944
|
key: 0,
|
|
897
945
|
class: "yselect__option-check"
|
|
898
|
-
},
|
|
946
|
+
}, zl = {
|
|
899
947
|
key: 0,
|
|
900
948
|
width: "14",
|
|
901
949
|
height: "14",
|
|
902
950
|
viewBox: "0 0 14 14",
|
|
903
951
|
fill: "none"
|
|
904
|
-
},
|
|
952
|
+
}, Nl = ["src"], Kl = /* @__PURE__ */ De({
|
|
905
953
|
__name: "yselect",
|
|
906
954
|
props: {
|
|
907
955
|
modelValue: {},
|
|
@@ -921,102 +969,102 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
921
969
|
},
|
|
922
970
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
923
971
|
setup(e, { emit: m }) {
|
|
924
|
-
const t = e, l = m,
|
|
972
|
+
const t = e, l = m, f = N(!1), h = N(-1), o = N(), $ = N(), w = N(), I = N(!1), x = N(), p = N(""), d = F(() => t.multiple ? null : t.options.find((s) => U(s) === t.modelValue) || null), C = F(() => {
|
|
925
973
|
if (!t.multiple) return [];
|
|
926
974
|
const s = Array.isArray(t.modelValue) ? t.modelValue : [];
|
|
927
|
-
return t.options.filter((y) => s.includes(
|
|
928
|
-
}),
|
|
975
|
+
return t.options.filter((y) => s.includes(U(y)));
|
|
976
|
+
}), _ = F(() => {
|
|
929
977
|
if (t.multiple) {
|
|
930
978
|
const s = C.value.length;
|
|
931
979
|
return s === 0 ? "" : `已选择 ${s} 项`;
|
|
932
980
|
}
|
|
933
|
-
return d.value ?
|
|
934
|
-
}),
|
|
981
|
+
return d.value ? O(d.value) : "";
|
|
982
|
+
}), Z = F(() => {
|
|
935
983
|
if (!t.filterable) return t.options;
|
|
936
984
|
const s = p.value.trim().toLowerCase();
|
|
937
985
|
return s ? t.options.filter((y) => {
|
|
938
|
-
const b =
|
|
986
|
+
const b = O(y);
|
|
939
987
|
return String(b).toLowerCase().includes(s);
|
|
940
988
|
}) : t.options;
|
|
941
|
-
}),
|
|
989
|
+
}), G = F(() => {
|
|
942
990
|
var S;
|
|
943
991
|
const s = { position: "fixed", zIndex: "4000" }, y = $.value;
|
|
944
992
|
if (!y) return s;
|
|
945
|
-
const b = y.getBoundingClientRect(),
|
|
946
|
-
return s.left = `${b.left}px`, s.width = `${
|
|
993
|
+
const b = y.getBoundingClientRect(), z = ((S = w.value) == null ? void 0 : S.getBoundingClientRect().width) || b.width;
|
|
994
|
+
return s.left = `${b.left}px`, s.width = `${z}px`, I.value ? (s.bottom = `${window.innerHeight - b.top + 4}px`, s.top = "auto") : s.top = `${b.bottom + 4}px`, s;
|
|
947
995
|
});
|
|
948
|
-
function
|
|
949
|
-
!
|
|
996
|
+
function A() {
|
|
997
|
+
!f.value || !$.value || ie(() => {
|
|
950
998
|
const s = $.value;
|
|
951
999
|
if (!s) return;
|
|
952
|
-
const y = s.getBoundingClientRect(), b = window.innerHeight,
|
|
953
|
-
|
|
1000
|
+
const y = s.getBoundingClientRect(), b = window.innerHeight, z = 200, S = y.bottom + z + 4, P = y.top - z - 4, le = S <= b - 20, Ce = P >= 20;
|
|
1001
|
+
I.value = !le && Ce;
|
|
954
1002
|
});
|
|
955
1003
|
}
|
|
956
|
-
function
|
|
1004
|
+
function U(s) {
|
|
957
1005
|
return typeof s == "object" && s !== null ? s[t.valueKey] : s;
|
|
958
1006
|
}
|
|
959
|
-
function
|
|
1007
|
+
function O(s) {
|
|
960
1008
|
return typeof s == "object" && s !== null ? s[t.labelKey] || String(s[t.valueKey]) : String(s);
|
|
961
1009
|
}
|
|
962
|
-
function
|
|
963
|
-
return typeof s == "object" && s !== null && s.id !== void 0 ? s.id :
|
|
1010
|
+
function X(s, y) {
|
|
1011
|
+
return typeof s == "object" && s !== null && s.id !== void 0 ? s.id : U(s) || y;
|
|
964
1012
|
}
|
|
965
|
-
function
|
|
966
|
-
return t.multiple ? (Array.isArray(t.modelValue) ? t.modelValue : []).includes(
|
|
1013
|
+
function J(s) {
|
|
1014
|
+
return t.multiple ? (Array.isArray(t.modelValue) ? t.modelValue : []).includes(U(s)) : U(s) === t.modelValue;
|
|
967
1015
|
}
|
|
968
1016
|
function re(s) {
|
|
969
1017
|
return typeof s == "object" && s !== null ? s[t.disabledKey] === !0 : !1;
|
|
970
1018
|
}
|
|
971
1019
|
function se() {
|
|
972
|
-
t.disabled || (
|
|
1020
|
+
t.disabled || (f.value ? E() : ke());
|
|
973
1021
|
}
|
|
974
1022
|
function ke() {
|
|
975
|
-
t.disabled || (
|
|
976
|
-
|
|
1023
|
+
t.disabled || (f.value = !0, ie(() => {
|
|
1024
|
+
A(), Q(), t.filterable && x.value && (x.value.focus(), p.value = "");
|
|
977
1025
|
}));
|
|
978
1026
|
}
|
|
979
|
-
function
|
|
980
|
-
|
|
1027
|
+
function E() {
|
|
1028
|
+
f.value = !1, h.value = -1, I.value = !1, t.filterable && (p.value = "");
|
|
981
1029
|
}
|
|
982
|
-
function
|
|
1030
|
+
function V(s, y) {
|
|
983
1031
|
if (re(s)) return;
|
|
984
|
-
const b =
|
|
1032
|
+
const b = U(s);
|
|
985
1033
|
if (t.multiple) {
|
|
986
|
-
const
|
|
987
|
-
|
|
1034
|
+
const z = Array.isArray(t.modelValue) ? [...t.modelValue] : [], S = U(s), P = z.indexOf(S);
|
|
1035
|
+
P > -1 ? z.splice(P, 1) : z.push(S), l("update:modelValue", z), l("change", z, C.value);
|
|
988
1036
|
} else
|
|
989
|
-
l("update:modelValue", b), l("change", b, s),
|
|
1037
|
+
l("update:modelValue", b), l("change", b, s), E();
|
|
990
1038
|
}
|
|
991
1039
|
function T() {
|
|
992
1040
|
if (!t.clearable || t.disabled) return;
|
|
993
1041
|
const s = t.multiple ? t.clearTo !== void 0 ? t.clearTo : [] : t.clearTo;
|
|
994
|
-
l("update:modelValue", s), l("change", s, t.multiple ? [] : null), l("clear"), t.multiple ||
|
|
1042
|
+
l("update:modelValue", s), l("change", s, t.multiple ? [] : null), l("clear"), t.multiple || E();
|
|
995
1043
|
}
|
|
996
|
-
function
|
|
1044
|
+
function Y(s, y) {
|
|
997
1045
|
if (y.stopPropagation(), t.disabled || !t.multiple) return;
|
|
998
|
-
const b = Array.isArray(t.modelValue) ? [...t.modelValue] : [],
|
|
1046
|
+
const b = Array.isArray(t.modelValue) ? [...t.modelValue] : [], z = U(s), S = b.indexOf(z);
|
|
999
1047
|
S > -1 && (b.splice(S, 1), l("update:modelValue", b), l("change", b, C.value));
|
|
1000
1048
|
}
|
|
1001
1049
|
function te(s) {
|
|
1002
|
-
if (!
|
|
1050
|
+
if (!Z.value || Z.value.length === 0) {
|
|
1003
1051
|
h.value = -1;
|
|
1004
1052
|
return;
|
|
1005
1053
|
}
|
|
1006
1054
|
let y = h.value;
|
|
1007
|
-
const b =
|
|
1055
|
+
const b = Z.value.length;
|
|
1008
1056
|
y === -1 ? y = s > 0 ? 0 : b - 1 : y = (y + s + b) % b;
|
|
1009
|
-
let
|
|
1010
|
-
for (;
|
|
1011
|
-
y = (y + s + b) % b,
|
|
1012
|
-
h.value =
|
|
1057
|
+
let z = 0;
|
|
1058
|
+
for (; z < b && re(Z.value[y]); )
|
|
1059
|
+
y = (y + s + b) % b, z++;
|
|
1060
|
+
h.value = z >= b ? -1 : y, g();
|
|
1013
1061
|
}
|
|
1014
1062
|
function B() {
|
|
1015
1063
|
if (h.value < 0) return;
|
|
1016
|
-
const s =
|
|
1017
|
-
!s || re(s) ||
|
|
1064
|
+
const s = Z.value[h.value];
|
|
1065
|
+
!s || re(s) || V(s, h.value);
|
|
1018
1066
|
}
|
|
1019
|
-
function
|
|
1067
|
+
function Q() {
|
|
1020
1068
|
if (!o.value) return;
|
|
1021
1069
|
const s = o.value.querySelector(".yselect__option--selected");
|
|
1022
1070
|
s && s.scrollIntoView({ block: "nearest" });
|
|
@@ -1026,22 +1074,22 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1026
1074
|
const y = o.value.querySelectorAll(".yselect__option")[h.value];
|
|
1027
1075
|
y && y.scrollIntoView({ block: "nearest" });
|
|
1028
1076
|
}
|
|
1029
|
-
function
|
|
1077
|
+
function D(s) {
|
|
1030
1078
|
const y = s.target;
|
|
1031
|
-
(!w.value || !w.value.contains(y)) &&
|
|
1079
|
+
(!w.value || !w.value.contains(y)) && E();
|
|
1032
1080
|
}
|
|
1033
1081
|
ae(() => t.modelValue, () => {
|
|
1034
1082
|
h.value = -1;
|
|
1035
1083
|
});
|
|
1036
1084
|
function K() {
|
|
1037
|
-
|
|
1085
|
+
f.value && A();
|
|
1038
1086
|
}
|
|
1039
|
-
return
|
|
1040
|
-
document.addEventListener("click",
|
|
1087
|
+
return ze(() => {
|
|
1088
|
+
document.addEventListener("click", D), window.addEventListener("resize", K), window.addEventListener("scroll", K, !0);
|
|
1041
1089
|
}), Ke(() => {
|
|
1042
|
-
document.removeEventListener("click",
|
|
1043
|
-
}), (s, y) => (
|
|
1044
|
-
class:
|
|
1090
|
+
document.removeEventListener("click", D), window.removeEventListener("resize", K), window.removeEventListener("scroll", K, !0);
|
|
1091
|
+
}), (s, y) => (r(), c("div", {
|
|
1092
|
+
class: j(["yselect", { "yselect--disabled": e.disabled, [`yselect--${e.size}`]: !0 }]),
|
|
1045
1093
|
style: fe({ width: e.width }),
|
|
1046
1094
|
ref_key: "selectContainer",
|
|
1047
1095
|
ref: w
|
|
@@ -1049,8 +1097,8 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1049
1097
|
a("div", {
|
|
1050
1098
|
ref_key: "triggerElement",
|
|
1051
1099
|
ref: $,
|
|
1052
|
-
class:
|
|
1053
|
-
"yselect__trigger--open":
|
|
1100
|
+
class: j(["yselect__trigger", {
|
|
1101
|
+
"yselect__trigger--open": f.value,
|
|
1054
1102
|
"yselect__trigger--disabled": e.disabled,
|
|
1055
1103
|
"yselect__trigger--error": e.error
|
|
1056
1104
|
}]),
|
|
@@ -1058,43 +1106,43 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1058
1106
|
onKeydown: [
|
|
1059
1107
|
Me(ne(se, ["prevent"]), ["enter"]),
|
|
1060
1108
|
Me(ne(se, ["prevent"]), ["space"]),
|
|
1061
|
-
Me(
|
|
1109
|
+
Me(E, ["escape"]),
|
|
1062
1110
|
Me(ne(ke, ["prevent"]), ["arrow-down"]),
|
|
1063
1111
|
Me(ne(ke, ["prevent"]), ["arrow-up"])
|
|
1064
1112
|
],
|
|
1065
1113
|
tabindex: "0",
|
|
1066
1114
|
role: "combobox",
|
|
1067
|
-
"aria-expanded":
|
|
1115
|
+
"aria-expanded": f.value,
|
|
1068
1116
|
"aria-haspopup": !0
|
|
1069
1117
|
}, [
|
|
1070
|
-
!e.filterable || !
|
|
1118
|
+
!e.filterable || !f.value ? (r(), c("span", {
|
|
1071
1119
|
key: 0,
|
|
1072
|
-
class:
|
|
1120
|
+
class: j(["yselect__value", { yselect__placeholder: !_.value }])
|
|
1073
1121
|
}, [
|
|
1074
1122
|
ve(s.$slots, "value", {
|
|
1075
1123
|
value: t.multiple ? C.value : d.value,
|
|
1076
|
-
label:
|
|
1124
|
+
label: _.value,
|
|
1077
1125
|
multiple: t.multiple
|
|
1078
1126
|
}, () => {
|
|
1079
1127
|
var b;
|
|
1080
1128
|
return [
|
|
1081
|
-
t.multiple ? (
|
|
1082
|
-
C.value.length > 0 ? (
|
|
1083
|
-
(
|
|
1084
|
-
key:
|
|
1129
|
+
t.multiple ? (r(), c(he, { key: 0 }, [
|
|
1130
|
+
C.value.length > 0 ? (r(), c("div", $l, [
|
|
1131
|
+
(r(!0), c(he, null, xe(C.value, (z, S) => (r(), c("span", {
|
|
1132
|
+
key: X(z, S),
|
|
1085
1133
|
class: "yselect__tag"
|
|
1086
1134
|
}, [
|
|
1087
|
-
|
|
1135
|
+
z != null && z.flagImg ? (r(), c("img", {
|
|
1088
1136
|
key: 0,
|
|
1089
1137
|
class: "yselect__flag",
|
|
1090
|
-
src:
|
|
1138
|
+
src: z.flagImg,
|
|
1091
1139
|
alt: "flag"
|
|
1092
|
-
}, null, 8,
|
|
1093
|
-
a("span",
|
|
1094
|
-
e.clearable && !e.disabled ? (
|
|
1140
|
+
}, null, 8, Sl)) : W("", !0),
|
|
1141
|
+
a("span", Il, oe(O(z)), 1),
|
|
1142
|
+
e.clearable && !e.disabled ? (r(), c("span", {
|
|
1095
1143
|
key: 1,
|
|
1096
1144
|
class: "yselect__tag-close",
|
|
1097
|
-
onClick: ne((
|
|
1145
|
+
onClick: ne((P) => Y(z, P), ["stop"])
|
|
1098
1146
|
}, [...y[8] || (y[8] = [
|
|
1099
1147
|
a("svg", {
|
|
1100
1148
|
width: "10",
|
|
@@ -1109,31 +1157,31 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1109
1157
|
"stroke-linecap": "round"
|
|
1110
1158
|
})
|
|
1111
1159
|
], -1)
|
|
1112
|
-
])], 8,
|
|
1160
|
+
])], 8, Ml)) : W("", !0)
|
|
1113
1161
|
]))), 128))
|
|
1114
|
-
])) : (
|
|
1115
|
-
], 64)) : (
|
|
1116
|
-
d.value ? (
|
|
1117
|
-
(b = d.value) != null && b.flagImg ? (
|
|
1162
|
+
])) : (r(), c("span", El, oe(e.placeholder), 1))
|
|
1163
|
+
], 64)) : (r(), c(he, { key: 1 }, [
|
|
1164
|
+
d.value ? (r(), c(he, { key: 0 }, [
|
|
1165
|
+
(b = d.value) != null && b.flagImg ? (r(), c("img", {
|
|
1118
1166
|
key: 0,
|
|
1119
1167
|
class: "yselect__flag",
|
|
1120
1168
|
src: d.value.flagImg,
|
|
1121
1169
|
alt: "flag"
|
|
1122
|
-
}, null, 8,
|
|
1123
|
-
Le(" " + oe(
|
|
1124
|
-
], 64)) : (
|
|
1170
|
+
}, null, 8, Ll)) : W("", !0),
|
|
1171
|
+
Le(" " + oe(_.value), 1)
|
|
1172
|
+
], 64)) : (r(), c(he, { key: 1 }, [
|
|
1125
1173
|
Le(oe(e.placeholder), 1)
|
|
1126
1174
|
], 64))
|
|
1127
1175
|
], 64))
|
|
1128
1176
|
];
|
|
1129
1177
|
}, !0)
|
|
1130
|
-
], 2)) : Ve((
|
|
1178
|
+
], 2)) : Ve((r(), c("input", {
|
|
1131
1179
|
key: 1,
|
|
1132
1180
|
ref_key: "inputElement",
|
|
1133
|
-
ref:
|
|
1181
|
+
ref: x,
|
|
1134
1182
|
class: "yselect__input",
|
|
1135
1183
|
type: "text",
|
|
1136
|
-
placeholder: t.multiple ? C.value.length > 0 ? `已选择 ${C.value.length} 项` : e.placeholder :
|
|
1184
|
+
placeholder: t.multiple ? C.value.length > 0 ? `已选择 ${C.value.length} 项` : e.placeholder : _.value || e.placeholder,
|
|
1137
1185
|
"onUpdate:modelValue": y[0] || (y[0] = (b) => p.value = b),
|
|
1138
1186
|
onKeydown: [
|
|
1139
1187
|
y[1] || (y[1] = ne(() => {
|
|
@@ -1141,13 +1189,13 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1141
1189
|
y[2] || (y[2] = Me(ne((b) => te(1), ["prevent"]), ["arrow-down"])),
|
|
1142
1190
|
y[3] || (y[3] = Me(ne((b) => te(-1), ["prevent"]), ["arrow-up"])),
|
|
1143
1191
|
y[4] || (y[4] = Me(ne((b) => B(), ["prevent"]), ["enter"])),
|
|
1144
|
-
Me(ne(
|
|
1192
|
+
Me(ne(E, ["prevent"]), ["esc"]),
|
|
1145
1193
|
Me(ne(T, ["prevent"]), ["delete"])
|
|
1146
1194
|
]
|
|
1147
|
-
}, null, 40,
|
|
1195
|
+
}, null, 40, Tl)), [
|
|
1148
1196
|
[Lt, p.value]
|
|
1149
1197
|
]),
|
|
1150
|
-
e.clearable && !e.disabled && (t.multiple ? C.value.length > 0 : d.value) ? (
|
|
1198
|
+
e.clearable && !e.disabled && (t.multiple ? C.value.length > 0 : d.value) ? (r(), c("span", {
|
|
1151
1199
|
key: 2,
|
|
1152
1200
|
class: "yselect__clear",
|
|
1153
1201
|
title: "清空",
|
|
@@ -1166,9 +1214,9 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1166
1214
|
"stroke-linecap": "round"
|
|
1167
1215
|
})
|
|
1168
1216
|
], -1)
|
|
1169
|
-
])])) :
|
|
1217
|
+
])])) : W("", !0),
|
|
1170
1218
|
a("span", {
|
|
1171
|
-
class:
|
|
1219
|
+
class: j(["yselect__arrow", { "yselect__arrow--open": f.value }])
|
|
1172
1220
|
}, [...y[10] || (y[10] = [
|
|
1173
1221
|
a("svg", {
|
|
1174
1222
|
width: "12",
|
|
@@ -1185,14 +1233,14 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1185
1233
|
})
|
|
1186
1234
|
], -1)
|
|
1187
1235
|
])], 2)
|
|
1188
|
-
], 42,
|
|
1236
|
+
], 42, Dl),
|
|
1189
1237
|
be(He, { name: "yselect-dropdown" }, {
|
|
1190
1238
|
default: pe(() => [
|
|
1191
|
-
(
|
|
1192
|
-
|
|
1239
|
+
(r(), Ne(Xe, { to: "body" }, [
|
|
1240
|
+
f.value ? (r(), c("div", {
|
|
1193
1241
|
key: 0,
|
|
1194
|
-
class:
|
|
1195
|
-
style: fe(
|
|
1242
|
+
class: j(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": I.value }]),
|
|
1243
|
+
style: fe(G.value),
|
|
1196
1244
|
onMousedown: y[6] || (y[6] = ne(() => {
|
|
1197
1245
|
}, ["stop"])),
|
|
1198
1246
|
onClick: y[7] || (y[7] = ne(() => {
|
|
@@ -1203,24 +1251,24 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1203
1251
|
ref_key: "optionsContainer",
|
|
1204
1252
|
ref: o
|
|
1205
1253
|
}, [
|
|
1206
|
-
(
|
|
1207
|
-
key:
|
|
1208
|
-
class:
|
|
1209
|
-
"yselect__option--selected":
|
|
1254
|
+
(r(!0), c(he, null, xe(Z.value, (b, z) => (r(), c("div", {
|
|
1255
|
+
key: X(b, z),
|
|
1256
|
+
class: j(["yselect__option", {
|
|
1257
|
+
"yselect__option--selected": J(b),
|
|
1210
1258
|
"yselect__option--disabled": re(b),
|
|
1211
|
-
"yselect__option--hover": h.value ===
|
|
1259
|
+
"yselect__option--hover": h.value === z
|
|
1212
1260
|
}]),
|
|
1213
|
-
onClick: (S) =>
|
|
1214
|
-
onMouseenter: (S) => h.value =
|
|
1261
|
+
onClick: (S) => V(b),
|
|
1262
|
+
onMouseenter: (S) => h.value = z,
|
|
1215
1263
|
onMouseleave: y[5] || (y[5] = (S) => h.value = -1)
|
|
1216
1264
|
}, [
|
|
1217
1265
|
ve(s.$slots, "option", {
|
|
1218
1266
|
option: b,
|
|
1219
|
-
index:
|
|
1220
|
-
selected:
|
|
1267
|
+
index: z,
|
|
1268
|
+
selected: J(b)
|
|
1221
1269
|
}, () => [
|
|
1222
|
-
t.multiple ? (
|
|
1223
|
-
|
|
1270
|
+
t.multiple ? (r(), c("span", Hl, [
|
|
1271
|
+
J(b) ? (r(), c("svg", zl, [...y[11] || (y[11] = [
|
|
1224
1272
|
a("path", {
|
|
1225
1273
|
d: "M2 7l3 3 7-7",
|
|
1226
1274
|
stroke: "currentColor",
|
|
@@ -1228,26 +1276,26 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1228
1276
|
"stroke-linecap": "round",
|
|
1229
1277
|
"stroke-linejoin": "round"
|
|
1230
1278
|
}, null, -1)
|
|
1231
|
-
])])) :
|
|
1232
|
-
])) :
|
|
1233
|
-
b != null && b.flagImg ? (
|
|
1279
|
+
])])) : W("", !0)
|
|
1280
|
+
])) : W("", !0),
|
|
1281
|
+
b != null && b.flagImg ? (r(), c("img", {
|
|
1234
1282
|
key: 1,
|
|
1235
1283
|
class: "yselect__flag",
|
|
1236
1284
|
src: b.flagImg,
|
|
1237
1285
|
alt: "flag"
|
|
1238
|
-
}, null, 8,
|
|
1239
|
-
Le(" " + oe(
|
|
1286
|
+
}, null, 8, Nl)) : W("", !0),
|
|
1287
|
+
Le(" " + oe(O(b)), 1)
|
|
1240
1288
|
], !0)
|
|
1241
|
-
], 42,
|
|
1289
|
+
], 42, Bl))), 128))
|
|
1242
1290
|
], 512)
|
|
1243
|
-
], 38)) :
|
|
1291
|
+
], 38)) : W("", !0)
|
|
1244
1292
|
]))
|
|
1245
1293
|
]),
|
|
1246
1294
|
_: 3
|
|
1247
1295
|
})
|
|
1248
1296
|
], 6));
|
|
1249
1297
|
}
|
|
1250
|
-
}), $t = /* @__PURE__ */ $e(
|
|
1298
|
+
}), $t = /* @__PURE__ */ $e(Kl, [["__scopeId", "data-v-b3f1516d"]]), Vl = { class: "ypagination" }, Al = { class: "page-actions" }, Rl = { class: "page-size-select" }, Wl = /* @__PURE__ */ De({
|
|
1251
1299
|
__name: "ypagination",
|
|
1252
1300
|
props: {
|
|
1253
1301
|
currentPage: {},
|
|
@@ -1263,35 +1311,35 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1263
1311
|
},
|
|
1264
1312
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
1265
1313
|
setup(e, { emit: m }) {
|
|
1266
|
-
const t = e, l = m,
|
|
1314
|
+
const t = e, l = m, f = N(t.pageSize), h = F(() => t.pageSizeOptions), o = F({
|
|
1267
1315
|
get: () => t.currentPage,
|
|
1268
|
-
set: (
|
|
1269
|
-
l("update:currentPage",
|
|
1316
|
+
set: (x) => {
|
|
1317
|
+
l("update:currentPage", x), l("page-change", x);
|
|
1270
1318
|
}
|
|
1271
1319
|
});
|
|
1272
|
-
function $(
|
|
1273
|
-
t.loading ||
|
|
1320
|
+
function $(x) {
|
|
1321
|
+
t.loading || x >= 1 && x !== t.currentPage && (o.value = x);
|
|
1274
1322
|
}
|
|
1275
|
-
function w(
|
|
1276
|
-
t.loading || (
|
|
1323
|
+
function w(x) {
|
|
1324
|
+
t.loading || (f.value = x, l("update:pageSize", x), l("page-size-change", x), o.value = 1);
|
|
1277
1325
|
}
|
|
1278
|
-
function
|
|
1279
|
-
t.loading || (
|
|
1326
|
+
function I(x) {
|
|
1327
|
+
t.loading || (x === "prev" ? $(o.value - 1) : x === "next" && $(o.value + 1));
|
|
1280
1328
|
}
|
|
1281
|
-
return
|
|
1329
|
+
return f.value = t.pageSize, ae(
|
|
1282
1330
|
() => t.pageSize,
|
|
1283
|
-
(
|
|
1284
|
-
typeof
|
|
1331
|
+
(x) => {
|
|
1332
|
+
typeof x == "number" && f.value !== x && (f.value = x);
|
|
1285
1333
|
}
|
|
1286
|
-
), (
|
|
1334
|
+
), (x, p) => {
|
|
1287
1335
|
const d = Je("YButton"), C = Je("YSelect");
|
|
1288
|
-
return
|
|
1289
|
-
a("div",
|
|
1336
|
+
return r(), c("div", Vl, [
|
|
1337
|
+
a("div", Al, [
|
|
1290
1338
|
be(d, {
|
|
1291
1339
|
size: "small",
|
|
1292
1340
|
variant: "secondary",
|
|
1293
1341
|
disabled: o.value === 1 || e.loading,
|
|
1294
|
-
onClick: p[0] || (p[0] = (
|
|
1342
|
+
onClick: p[0] || (p[0] = (_) => $(1))
|
|
1295
1343
|
}, {
|
|
1296
1344
|
default: pe(() => [...p[2] || (p[2] = [
|
|
1297
1345
|
Le("首页", -1)
|
|
@@ -1306,12 +1354,12 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1306
1354
|
{ label: "上一页", value: "prev", disabled: o.value === 1 || e.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1307
1355
|
{ label: "下一页", value: "next", disabled: e.loading || e.disableNext, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1308
1356
|
],
|
|
1309
|
-
onGroupClick:
|
|
1357
|
+
onGroupClick: I
|
|
1310
1358
|
}, null, 8, ["groupItems"]),
|
|
1311
|
-
a("div",
|
|
1359
|
+
a("div", Rl, [
|
|
1312
1360
|
be(C, {
|
|
1313
|
-
modelValue:
|
|
1314
|
-
"onUpdate:modelValue": p[1] || (p[1] = (
|
|
1361
|
+
modelValue: f.value,
|
|
1362
|
+
"onUpdate:modelValue": p[1] || (p[1] = (_) => f.value = _),
|
|
1315
1363
|
options: h.value,
|
|
1316
1364
|
size: "small",
|
|
1317
1365
|
width: "105px",
|
|
@@ -1324,50 +1372,50 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1324
1372
|
]);
|
|
1325
1373
|
};
|
|
1326
1374
|
}
|
|
1327
|
-
}),
|
|
1375
|
+
}), _l = /* @__PURE__ */ $e(Wl, [["__scopeId", "data-v-5a512f0f"]]), Pl = ["aria-label"], Fl = { class: "y-badge__inner" }, Yl = {
|
|
1328
1376
|
key: 0,
|
|
1329
1377
|
class: "y-badge__progress",
|
|
1330
1378
|
"aria-hidden": "true"
|
|
1331
|
-
},
|
|
1379
|
+
}, Ol = {
|
|
1332
1380
|
key: 0,
|
|
1333
1381
|
class: "icon",
|
|
1334
1382
|
viewBox: "0 0 20 20",
|
|
1335
1383
|
fill: "currentColor"
|
|
1336
|
-
},
|
|
1384
|
+
}, jl = {
|
|
1337
1385
|
key: 1,
|
|
1338
1386
|
class: "icon",
|
|
1339
1387
|
viewBox: "0 0 20 20",
|
|
1340
1388
|
fill: "currentColor"
|
|
1341
|
-
},
|
|
1389
|
+
}, ql = {
|
|
1342
1390
|
key: 2,
|
|
1343
1391
|
class: "icon",
|
|
1344
1392
|
viewBox: "0 0 20 20",
|
|
1345
1393
|
fill: "currentColor"
|
|
1346
|
-
},
|
|
1394
|
+
}, Ul = {
|
|
1347
1395
|
key: 1,
|
|
1348
1396
|
class: "y-badge__icon",
|
|
1349
1397
|
"aria-hidden": "true"
|
|
1350
|
-
},
|
|
1398
|
+
}, Gl = {
|
|
1351
1399
|
key: 0,
|
|
1352
1400
|
class: "icon",
|
|
1353
1401
|
viewBox: "0 0 20 20",
|
|
1354
1402
|
fill: "currentColor"
|
|
1355
|
-
},
|
|
1403
|
+
}, Zl = {
|
|
1356
1404
|
key: 1,
|
|
1357
1405
|
class: "icon",
|
|
1358
1406
|
viewBox: "0 0 20 20",
|
|
1359
1407
|
fill: "currentColor"
|
|
1360
|
-
},
|
|
1408
|
+
}, Ql = {
|
|
1361
1409
|
key: 2,
|
|
1362
1410
|
class: "icon",
|
|
1363
1411
|
viewBox: "0 0 20 20",
|
|
1364
1412
|
fill: "currentColor"
|
|
1365
|
-
},
|
|
1413
|
+
}, Jl = {
|
|
1366
1414
|
key: 3,
|
|
1367
1415
|
class: "icon",
|
|
1368
1416
|
viewBox: "0 0 20 20",
|
|
1369
1417
|
fill: "currentColor"
|
|
1370
|
-
},
|
|
1418
|
+
}, Xl = { class: "y-badge__label" }, en = /* @__PURE__ */ De({
|
|
1371
1419
|
__name: "ybadge",
|
|
1372
1420
|
props: {
|
|
1373
1421
|
tone: { default: "default" },
|
|
@@ -1379,15 +1427,15 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1379
1427
|
label: { default: "" }
|
|
1380
1428
|
},
|
|
1381
1429
|
setup(e) {
|
|
1382
|
-
const m = e, t =
|
|
1383
|
-
const
|
|
1430
|
+
const m = e, t = F(() => m.tone || "default"), l = F(() => {
|
|
1431
|
+
const f = (m.label || "").trim(), h = m.tone, o = m.progress;
|
|
1384
1432
|
if (o) {
|
|
1385
1433
|
const $ = {
|
|
1386
1434
|
incomplete: "未完成",
|
|
1387
1435
|
partiallyComplete: "部分完成",
|
|
1388
1436
|
complete: "已完成"
|
|
1389
1437
|
};
|
|
1390
|
-
return
|
|
1438
|
+
return f ? `${f},进度:${$[o] || o}` : `进度:${$[o] || o}`;
|
|
1391
1439
|
}
|
|
1392
1440
|
if (h && h !== "default") {
|
|
1393
1441
|
const $ = {
|
|
@@ -1398,12 +1446,12 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1398
1446
|
critical: "严重",
|
|
1399
1447
|
default: "默认"
|
|
1400
1448
|
};
|
|
1401
|
-
return
|
|
1449
|
+
return f ? `${f},语气:${$[h] || h}` : `语气:${$[h] || h}`;
|
|
1402
1450
|
}
|
|
1403
|
-
return
|
|
1451
|
+
return f || "标记";
|
|
1404
1452
|
});
|
|
1405
|
-
return (
|
|
1406
|
-
class:
|
|
1453
|
+
return (f, h) => (r(), c("span", {
|
|
1454
|
+
class: j(["y-badge", [
|
|
1407
1455
|
`y-badge--${t.value}`,
|
|
1408
1456
|
`y-badge--${e.size}`,
|
|
1409
1457
|
{ "is-outline": e.outline, "is-pill": e.pill },
|
|
@@ -1412,15 +1460,15 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1412
1460
|
role: "status",
|
|
1413
1461
|
"aria-label": l.value
|
|
1414
1462
|
}, [
|
|
1415
|
-
a("span",
|
|
1416
|
-
e.progress ? (
|
|
1417
|
-
e.progress === "incomplete" ? (
|
|
1463
|
+
a("span", Fl, [
|
|
1464
|
+
e.progress ? (r(), c("span", Yl, [
|
|
1465
|
+
e.progress === "incomplete" ? (r(), c("svg", Ol, [...h[0] || (h[0] = [
|
|
1418
1466
|
a("circle", {
|
|
1419
1467
|
cx: "10",
|
|
1420
1468
|
cy: "10",
|
|
1421
1469
|
r: "5"
|
|
1422
1470
|
}, null, -1)
|
|
1423
|
-
])])) : e.progress === "partiallyComplete" ? (
|
|
1471
|
+
])])) : e.progress === "partiallyComplete" ? (r(), c("svg", jl, [...h[1] || (h[1] = [
|
|
1424
1472
|
a("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1425
1473
|
a("circle", {
|
|
1426
1474
|
cx: "10",
|
|
@@ -1430,55 +1478,55 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1430
1478
|
stroke: "currentColor",
|
|
1431
1479
|
"stroke-width": "2"
|
|
1432
1480
|
}, null, -1)
|
|
1433
|
-
])])) : e.progress === "complete" ? (
|
|
1481
|
+
])])) : e.progress === "complete" ? (r(), c("svg", ql, [...h[2] || (h[2] = [
|
|
1434
1482
|
a("path", {
|
|
1435
1483
|
"fill-rule": "evenodd",
|
|
1436
1484
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1437
1485
|
"clip-rule": "evenodd"
|
|
1438
1486
|
}, null, -1)
|
|
1439
|
-
])])) :
|
|
1440
|
-
])) : e.icon ? (
|
|
1441
|
-
e.icon === "dot" ? (
|
|
1487
|
+
])])) : W("", !0)
|
|
1488
|
+
])) : e.icon ? (r(), c("span", Ul, [
|
|
1489
|
+
e.icon === "dot" ? (r(), c("svg", Gl, [...h[3] || (h[3] = [
|
|
1442
1490
|
a("circle", {
|
|
1443
1491
|
cx: "10",
|
|
1444
1492
|
cy: "10",
|
|
1445
1493
|
r: "4"
|
|
1446
1494
|
}, null, -1)
|
|
1447
|
-
])])) : e.icon === "check" ? (
|
|
1495
|
+
])])) : e.icon === "check" ? (r(), c("svg", Zl, [...h[4] || (h[4] = [
|
|
1448
1496
|
a("path", {
|
|
1449
1497
|
"fill-rule": "evenodd",
|
|
1450
1498
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1451
1499
|
"clip-rule": "evenodd"
|
|
1452
1500
|
}, null, -1)
|
|
1453
|
-
])])) : e.icon === "alert" ? (
|
|
1501
|
+
])])) : e.icon === "alert" ? (r(), c("svg", Ql, [...h[5] || (h[5] = [
|
|
1454
1502
|
a("path", {
|
|
1455
1503
|
"fill-rule": "evenodd",
|
|
1456
1504
|
d: "M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z",
|
|
1457
1505
|
"clip-rule": "evenodd"
|
|
1458
1506
|
}, null, -1)
|
|
1459
|
-
])])) : (
|
|
1507
|
+
])])) : (r(), c("svg", Jl, [...h[6] || (h[6] = [
|
|
1460
1508
|
a("circle", {
|
|
1461
1509
|
cx: "10",
|
|
1462
1510
|
cy: "10",
|
|
1463
1511
|
r: "4"
|
|
1464
1512
|
}, null, -1)
|
|
1465
1513
|
])]))
|
|
1466
|
-
])) :
|
|
1467
|
-
a("span",
|
|
1468
|
-
ve(
|
|
1514
|
+
])) : W("", !0),
|
|
1515
|
+
a("span", Xl, [
|
|
1516
|
+
ve(f.$slots, "default", {}, () => [
|
|
1469
1517
|
Le(oe(e.label), 1)
|
|
1470
1518
|
], !0)
|
|
1471
1519
|
])
|
|
1472
1520
|
])
|
|
1473
|
-
], 10,
|
|
1521
|
+
], 10, Pl));
|
|
1474
1522
|
}
|
|
1475
|
-
}),
|
|
1523
|
+
}), tn = /* @__PURE__ */ $e(en, [["__scopeId", "data-v-ce819797"]]), ln = ["aria-hidden"], nn = ["onKeydown"], an = {
|
|
1476
1524
|
key: 0,
|
|
1477
1525
|
class: "y-dialog-header"
|
|
1478
|
-
},
|
|
1526
|
+
}, on = { class: "y-dialog-title" }, sn = { class: "y-dialog-body" }, rn = {
|
|
1479
1527
|
key: 1,
|
|
1480
1528
|
class: "y-dialog-footer"
|
|
1481
|
-
},
|
|
1529
|
+
}, un = /* @__PURE__ */ De({
|
|
1482
1530
|
__name: "ydialog",
|
|
1483
1531
|
props: {
|
|
1484
1532
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1493,10 +1541,10 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1493
1541
|
},
|
|
1494
1542
|
emits: ["update:modelValue", "open", "close"],
|
|
1495
1543
|
setup(e, { emit: m }) {
|
|
1496
|
-
const t = e, l = m,
|
|
1544
|
+
const t = e, l = m, f = F({
|
|
1497
1545
|
get: () => t.modelValue,
|
|
1498
1546
|
set: (p) => l("update:modelValue", p)
|
|
1499
|
-
}), h =
|
|
1547
|
+
}), h = N(null), o = F(() => {
|
|
1500
1548
|
const p = {};
|
|
1501
1549
|
return p.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), p.margin = "0 auto", p.top = t.top, p;
|
|
1502
1550
|
});
|
|
@@ -1504,29 +1552,29 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1504
1552
|
t.maskClosable && w();
|
|
1505
1553
|
}
|
|
1506
1554
|
function w() {
|
|
1507
|
-
|
|
1555
|
+
f.value && (f.value = !1, l("close"));
|
|
1508
1556
|
}
|
|
1509
|
-
function
|
|
1557
|
+
function I() {
|
|
1510
1558
|
t.closable && w();
|
|
1511
1559
|
}
|
|
1512
|
-
function
|
|
1513
|
-
p.key === "Escape" &&
|
|
1560
|
+
function x(p) {
|
|
1561
|
+
p.key === "Escape" && I();
|
|
1514
1562
|
}
|
|
1515
1563
|
return ae(() => t.modelValue, (p) => {
|
|
1516
1564
|
p ? (l("open"), requestAnimationFrame(() => {
|
|
1517
1565
|
var d;
|
|
1518
1566
|
return (d = h.value) == null ? void 0 : d.focus();
|
|
1519
|
-
}), document.addEventListener("keydown",
|
|
1520
|
-
}),
|
|
1521
|
-
t.modelValue && (document.addEventListener("keydown",
|
|
1567
|
+
}), document.addEventListener("keydown", x), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", x), document.body.style.overflow = "");
|
|
1568
|
+
}), ze(() => {
|
|
1569
|
+
t.modelValue && (document.addEventListener("keydown", x), document.body.style.overflow = "hidden");
|
|
1522
1570
|
}), Ke(() => {
|
|
1523
|
-
document.removeEventListener("keydown",
|
|
1524
|
-
}), (p, d) => (
|
|
1571
|
+
document.removeEventListener("keydown", x), document.body.style.overflow = "";
|
|
1572
|
+
}), (p, d) => (r(), Ne(Xe, { to: "body" }, [
|
|
1525
1573
|
Ve(a("div", {
|
|
1526
1574
|
class: "y-dialog-root",
|
|
1527
1575
|
role: "dialog",
|
|
1528
1576
|
"aria-modal": !0,
|
|
1529
|
-
"aria-hidden": !
|
|
1577
|
+
"aria-hidden": !f.value,
|
|
1530
1578
|
style: fe({ zIndex: String(e.zIndex) })
|
|
1531
1579
|
}, [
|
|
1532
1580
|
a("div", {
|
|
@@ -1538,41 +1586,41 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1538
1586
|
Ve(a("div", {
|
|
1539
1587
|
ref_key: "panelRef",
|
|
1540
1588
|
ref: h,
|
|
1541
|
-
class:
|
|
1589
|
+
class: j(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1542
1590
|
style: fe(o.value),
|
|
1543
|
-
onKeydown: Me(ne(
|
|
1591
|
+
onKeydown: Me(ne(I, ["prevent", "stop"]), ["esc"]),
|
|
1544
1592
|
tabindex: "-1"
|
|
1545
1593
|
}, [
|
|
1546
|
-
e.showHeader ? (
|
|
1594
|
+
e.showHeader ? (r(), c("div", an, [
|
|
1547
1595
|
ve(p.$slots, "header", {}, () => [
|
|
1548
|
-
a("div",
|
|
1596
|
+
a("div", on, oe(e.title), 1)
|
|
1549
1597
|
], !0),
|
|
1550
|
-
e.closable ? (
|
|
1598
|
+
e.closable ? (r(), c("button", {
|
|
1551
1599
|
key: 0,
|
|
1552
1600
|
type: "button",
|
|
1553
1601
|
class: "y-dialog-close",
|
|
1554
1602
|
"aria-label": "Close",
|
|
1555
1603
|
onClick: w
|
|
1556
|
-
}, " ✕ ")) :
|
|
1557
|
-
])) :
|
|
1558
|
-
a("div",
|
|
1604
|
+
}, " ✕ ")) : W("", !0)
|
|
1605
|
+
])) : W("", !0),
|
|
1606
|
+
a("div", sn, [
|
|
1559
1607
|
ve(p.$slots, "default", {}, void 0, !0)
|
|
1560
1608
|
]),
|
|
1561
|
-
p.$slots.footer ? (
|
|
1609
|
+
p.$slots.footer ? (r(), c("div", rn, [
|
|
1562
1610
|
ve(p.$slots, "footer", {}, void 0, !0)
|
|
1563
|
-
])) :
|
|
1564
|
-
], 46,
|
|
1565
|
-
[
|
|
1611
|
+
])) : W("", !0)
|
|
1612
|
+
], 46, nn), [
|
|
1613
|
+
[Pe, f.value]
|
|
1566
1614
|
])
|
|
1567
1615
|
]),
|
|
1568
1616
|
_: 3
|
|
1569
1617
|
})
|
|
1570
|
-
], 12,
|
|
1571
|
-
[
|
|
1618
|
+
], 12, ln), [
|
|
1619
|
+
[Pe, f.value]
|
|
1572
1620
|
])
|
|
1573
1621
|
]));
|
|
1574
1622
|
}
|
|
1575
|
-
}),
|
|
1623
|
+
}), dn = /* @__PURE__ */ $e(un, [["__scopeId", "data-v-a7acc6dc"]]), cn = { class: "ypopover__inner" }, fn = /* @__PURE__ */ De({
|
|
1576
1624
|
__name: "ypopover",
|
|
1577
1625
|
props: {
|
|
1578
1626
|
trigger: { default: "click" },
|
|
@@ -1592,148 +1640,148 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1592
1640
|
},
|
|
1593
1641
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1594
1642
|
setup(e, { expose: m, emit: t }) {
|
|
1595
|
-
const l = e,
|
|
1643
|
+
const l = e, f = t, h = N(), o = N(), $ = N(), w = N(!1), I = N(), x = N(), p = N({});
|
|
1596
1644
|
let d = null, C = null;
|
|
1597
|
-
const
|
|
1598
|
-
if (!w.value || !
|
|
1645
|
+
const _ = F(() => {
|
|
1646
|
+
if (!w.value || !I.value) return {};
|
|
1599
1647
|
const B = {};
|
|
1600
1648
|
l.width !== "auto" && (B.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.maxWidth && (B.maxWidth = typeof l.maxWidth == "number" ? `${l.maxWidth}px` : l.maxWidth);
|
|
1601
|
-
const { top:
|
|
1602
|
-
return B.top = `${
|
|
1603
|
-
}),
|
|
1649
|
+
const { top: Q, left: g } = G();
|
|
1650
|
+
return B.top = `${Q}px`, B.left = `${g}px`, B;
|
|
1651
|
+
}), Z = F(() => {
|
|
1604
1652
|
if (!l.showArrow) return {};
|
|
1605
1653
|
if (Object.keys(p.value).length > 0)
|
|
1606
1654
|
return p.value;
|
|
1607
1655
|
const B = {};
|
|
1608
1656
|
return l.placement.startsWith("top") || l.placement.startsWith("bottom") ? B.left = "50%" : B.top = "50%", B;
|
|
1609
1657
|
});
|
|
1610
|
-
function
|
|
1611
|
-
var
|
|
1612
|
-
if (!
|
|
1613
|
-
const { width: B, height:
|
|
1658
|
+
function G() {
|
|
1659
|
+
var P, le;
|
|
1660
|
+
if (!I.value) return { top: 0, left: 0 };
|
|
1661
|
+
const { width: B, height: Q, top: g, left: D } = I.value, K = ((P = $.value) == null ? void 0 : P.offsetWidth) || 200, s = ((le = $.value) == null ? void 0 : le.offsetHeight) || 100;
|
|
1614
1662
|
let y = 0, b = 0;
|
|
1615
1663
|
switch (l.placement) {
|
|
1616
1664
|
case "top":
|
|
1617
|
-
y = g - s - l.offset, b =
|
|
1665
|
+
y = g - s - l.offset, b = D + (B - K) / 2;
|
|
1618
1666
|
break;
|
|
1619
1667
|
case "top-start":
|
|
1620
|
-
y = g - s - l.offset, b =
|
|
1668
|
+
y = g - s - l.offset, b = D;
|
|
1621
1669
|
break;
|
|
1622
1670
|
case "top-end":
|
|
1623
|
-
y = g - s - l.offset, b =
|
|
1671
|
+
y = g - s - l.offset, b = D + B - K;
|
|
1624
1672
|
break;
|
|
1625
1673
|
case "bottom":
|
|
1626
|
-
y = g +
|
|
1674
|
+
y = g + Q + l.offset, b = D + (B - K) / 2;
|
|
1627
1675
|
break;
|
|
1628
1676
|
case "bottom-start":
|
|
1629
|
-
y = g +
|
|
1677
|
+
y = g + Q + l.offset, b = D;
|
|
1630
1678
|
break;
|
|
1631
1679
|
case "bottom-end":
|
|
1632
|
-
y = g +
|
|
1680
|
+
y = g + Q + l.offset, b = D + B - K;
|
|
1633
1681
|
break;
|
|
1634
1682
|
case "left":
|
|
1635
|
-
y = g + (
|
|
1683
|
+
y = g + (Q - s) / 2, b = D - K - l.offset;
|
|
1636
1684
|
break;
|
|
1637
1685
|
case "left-start":
|
|
1638
|
-
y = g, b =
|
|
1686
|
+
y = g, b = D - K - l.offset;
|
|
1639
1687
|
break;
|
|
1640
1688
|
case "left-end":
|
|
1641
|
-
y = g +
|
|
1689
|
+
y = g + Q - s, b = D - K - l.offset;
|
|
1642
1690
|
break;
|
|
1643
1691
|
case "right":
|
|
1644
|
-
y = g + (
|
|
1692
|
+
y = g + (Q - s) / 2, b = D + B + l.offset;
|
|
1645
1693
|
break;
|
|
1646
1694
|
case "right-start":
|
|
1647
|
-
y = g, b =
|
|
1695
|
+
y = g, b = D + B + l.offset;
|
|
1648
1696
|
break;
|
|
1649
1697
|
case "right-end":
|
|
1650
|
-
y = g +
|
|
1698
|
+
y = g + Q - s, b = D + B + l.offset;
|
|
1651
1699
|
break;
|
|
1652
1700
|
}
|
|
1653
|
-
const
|
|
1654
|
-
return b < 8 && (b = 8), b + K >
|
|
1701
|
+
const z = window.innerWidth, S = window.innerHeight;
|
|
1702
|
+
return b < 8 && (b = 8), b + K > z - 8 && (b = z - K - 8), y < 8 && (y = 8), y + s > S - 8 && (y = S - s - 8), { top: y, left: b };
|
|
1655
1703
|
}
|
|
1656
|
-
function
|
|
1657
|
-
l.disabled || w.value || (
|
|
1658
|
-
|
|
1659
|
-
}, l.openDelay) :
|
|
1704
|
+
function A() {
|
|
1705
|
+
l.disabled || w.value || (J(), l.openDelay > 0 ? d = setTimeout(() => {
|
|
1706
|
+
U();
|
|
1707
|
+
}, l.openDelay) : U());
|
|
1660
1708
|
}
|
|
1661
|
-
function
|
|
1662
|
-
|
|
1709
|
+
function U() {
|
|
1710
|
+
f("before-show"), w.value = !0, f("update:modelValue", !0), f("show"), ie(() => {
|
|
1663
1711
|
ie(() => {
|
|
1664
1712
|
se();
|
|
1665
1713
|
});
|
|
1666
1714
|
});
|
|
1667
1715
|
}
|
|
1668
|
-
function
|
|
1669
|
-
w.value && (
|
|
1670
|
-
|
|
1671
|
-
}, l.closeDelay) :
|
|
1716
|
+
function O() {
|
|
1717
|
+
w.value && (J(), l.closeDelay > 0 ? C = setTimeout(() => {
|
|
1718
|
+
X();
|
|
1719
|
+
}, l.closeDelay) : X());
|
|
1672
1720
|
}
|
|
1673
|
-
function
|
|
1674
|
-
|
|
1721
|
+
function X() {
|
|
1722
|
+
f("before-hide"), w.value = !1, f("update:modelValue", !1), f("hide");
|
|
1675
1723
|
}
|
|
1676
|
-
function
|
|
1724
|
+
function J() {
|
|
1677
1725
|
d && (clearTimeout(d), d = null), C && (clearTimeout(C), C = null);
|
|
1678
1726
|
}
|
|
1679
1727
|
function re() {
|
|
1680
|
-
if (!l.showArrow || !
|
|
1728
|
+
if (!l.showArrow || !I.value || !$.value) {
|
|
1681
1729
|
p.value = {};
|
|
1682
1730
|
return;
|
|
1683
1731
|
}
|
|
1684
|
-
const B =
|
|
1685
|
-
if (
|
|
1686
|
-
const
|
|
1687
|
-
l.placement.startsWith("top") || l.placement.startsWith("bottom") ?
|
|
1732
|
+
const B = I.value, Q = $.value.getBoundingClientRect();
|
|
1733
|
+
if (Q.width === 0 || Q.height === 0) {
|
|
1734
|
+
const D = {};
|
|
1735
|
+
l.placement.startsWith("top") || l.placement.startsWith("bottom") ? D.left = "50%" : D.top = "50%", p.value = D;
|
|
1688
1736
|
return;
|
|
1689
1737
|
}
|
|
1690
1738
|
const g = {};
|
|
1691
1739
|
if (l.placement.startsWith("top")) {
|
|
1692
1740
|
g.bottom = "-6px";
|
|
1693
|
-
const
|
|
1694
|
-
g.left = `${Math.max(12, Math.min(s,
|
|
1741
|
+
const D = B.left + B.width / 2, K = Q.left, s = D - K;
|
|
1742
|
+
g.left = `${Math.max(12, Math.min(s, Q.width - 12))}px`;
|
|
1695
1743
|
} else if (l.placement.startsWith("bottom")) {
|
|
1696
1744
|
g.top = "-6px";
|
|
1697
|
-
const
|
|
1698
|
-
g.left = `${Math.max(12, Math.min(s,
|
|
1745
|
+
const D = B.left + B.width / 2, K = Q.left, s = D - K;
|
|
1746
|
+
g.left = `${Math.max(12, Math.min(s, Q.width - 12))}px`;
|
|
1699
1747
|
} else if (l.placement.startsWith("left")) {
|
|
1700
1748
|
g.right = "-6px";
|
|
1701
|
-
const
|
|
1702
|
-
g.top = `${Math.max(12, Math.min(s,
|
|
1749
|
+
const D = B.top + B.height / 2, K = Q.top, s = D - K;
|
|
1750
|
+
g.top = `${Math.max(12, Math.min(s, Q.height - 12))}px`;
|
|
1703
1751
|
} else if (l.placement.startsWith("right")) {
|
|
1704
1752
|
g.left = "-6px";
|
|
1705
|
-
const
|
|
1706
|
-
g.top = `${Math.max(12, Math.min(s,
|
|
1753
|
+
const D = B.top + B.height / 2, K = Q.top, s = D - K;
|
|
1754
|
+
g.top = `${Math.max(12, Math.min(s, Q.height - 12))}px`;
|
|
1707
1755
|
}
|
|
1708
1756
|
p.value = g;
|
|
1709
1757
|
}
|
|
1710
1758
|
function se() {
|
|
1711
|
-
o.value && (
|
|
1712
|
-
$.value && (
|
|
1759
|
+
o.value && (I.value = o.value.getBoundingClientRect(), $.value && (x.value = $.value.getBoundingClientRect(), re(), w.value && requestAnimationFrame(() => {
|
|
1760
|
+
$.value && (x.value = $.value.getBoundingClientRect(), re());
|
|
1713
1761
|
})));
|
|
1714
1762
|
}
|
|
1715
1763
|
function ke() {
|
|
1716
|
-
l.disabled || l.trigger === "click" && (w.value ?
|
|
1764
|
+
l.disabled || l.trigger === "click" && (w.value ? O() : A());
|
|
1717
1765
|
}
|
|
1718
|
-
function
|
|
1719
|
-
l.disabled || l.trigger !== "hover" || (
|
|
1766
|
+
function E() {
|
|
1767
|
+
l.disabled || l.trigger !== "hover" || (J(), A());
|
|
1720
1768
|
}
|
|
1721
|
-
function
|
|
1722
|
-
l.disabled || l.trigger !== "hover" ||
|
|
1769
|
+
function V() {
|
|
1770
|
+
l.disabled || l.trigger !== "hover" || O();
|
|
1723
1771
|
}
|
|
1724
1772
|
function T() {
|
|
1725
|
-
l.disabled || l.trigger !== "hover" ||
|
|
1773
|
+
l.disabled || l.trigger !== "hover" || J();
|
|
1726
1774
|
}
|
|
1727
|
-
function
|
|
1728
|
-
l.disabled || l.trigger !== "hover" ||
|
|
1775
|
+
function Y() {
|
|
1776
|
+
l.disabled || l.trigger !== "hover" || O();
|
|
1729
1777
|
}
|
|
1730
1778
|
function te(B) {
|
|
1731
1779
|
if (!l.closeOnClickOutside || !w.value) return;
|
|
1732
|
-
const
|
|
1733
|
-
h.value && !h.value.contains(
|
|
1780
|
+
const Q = B.target;
|
|
1781
|
+
h.value && !h.value.contains(Q) && $.value && !$.value.contains(Q) && O();
|
|
1734
1782
|
}
|
|
1735
1783
|
return ae(() => l.modelValue, (B) => {
|
|
1736
|
-
B !== w.value && (B ?
|
|
1784
|
+
B !== w.value && (B ? A() : O());
|
|
1737
1785
|
}), ae(w, (B) => {
|
|
1738
1786
|
B ? (document.addEventListener("click", te), window.addEventListener("resize", se), window.addEventListener("scroll", se, !0), ie(() => {
|
|
1739
1787
|
se(), requestAnimationFrame(() => {
|
|
@@ -1742,15 +1790,15 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1742
1790
|
se();
|
|
1743
1791
|
}, 0);
|
|
1744
1792
|
})) : (document.removeEventListener("click", te), window.removeEventListener("resize", se), window.removeEventListener("scroll", se, !0));
|
|
1745
|
-
}),
|
|
1746
|
-
l.modelValue &&
|
|
1793
|
+
}), ze(() => {
|
|
1794
|
+
l.modelValue && A();
|
|
1747
1795
|
}), Ke(() => {
|
|
1748
|
-
|
|
1796
|
+
J(), document.removeEventListener("click", te), window.removeEventListener("resize", se), window.removeEventListener("scroll", se, !0);
|
|
1749
1797
|
}), m({
|
|
1750
|
-
show:
|
|
1751
|
-
hide:
|
|
1798
|
+
show: A,
|
|
1799
|
+
hide: O,
|
|
1752
1800
|
updatePosition: se
|
|
1753
|
-
}), (B,
|
|
1801
|
+
}), (B, Q) => (r(), c("div", {
|
|
1754
1802
|
class: "ypopover",
|
|
1755
1803
|
ref_key: "popoverRef",
|
|
1756
1804
|
ref: h
|
|
@@ -1759,56 +1807,56 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1759
1807
|
ref_key: "triggerRef",
|
|
1760
1808
|
ref: o,
|
|
1761
1809
|
onClick: ke,
|
|
1762
|
-
onMouseenter:
|
|
1763
|
-
onMouseleave:
|
|
1810
|
+
onMouseenter: E,
|
|
1811
|
+
onMouseleave: V
|
|
1764
1812
|
}, [
|
|
1765
1813
|
ve(B.$slots, "reference", {}, void 0, !0)
|
|
1766
1814
|
], 544),
|
|
1767
|
-
(
|
|
1815
|
+
(r(), Ne(Xe, { to: "body" }, [
|
|
1768
1816
|
be(He, { name: "ypopover-fade" }, {
|
|
1769
1817
|
default: pe(() => [
|
|
1770
|
-
w.value ? (
|
|
1818
|
+
w.value ? (r(), c("div", {
|
|
1771
1819
|
key: 0,
|
|
1772
1820
|
ref_key: "contentRef",
|
|
1773
1821
|
ref: $,
|
|
1774
|
-
class:
|
|
1822
|
+
class: j(["ypopover__content", [
|
|
1775
1823
|
`ypopover__content--${e.placement}`,
|
|
1776
1824
|
{
|
|
1777
1825
|
"ypopover__content--dark": e.dark,
|
|
1778
1826
|
"ypopover__content--no-padding": !e.showPadding
|
|
1779
1827
|
}
|
|
1780
1828
|
]]),
|
|
1781
|
-
style: fe(
|
|
1782
|
-
onClick:
|
|
1829
|
+
style: fe(_.value),
|
|
1830
|
+
onClick: Q[0] || (Q[0] = ne(() => {
|
|
1783
1831
|
}, ["stop"])),
|
|
1784
1832
|
onMouseenter: T,
|
|
1785
|
-
onMouseleave:
|
|
1833
|
+
onMouseleave: Y
|
|
1786
1834
|
}, [
|
|
1787
|
-
e.showArrow ? (
|
|
1835
|
+
e.showArrow ? (r(), c("div", {
|
|
1788
1836
|
key: 0,
|
|
1789
|
-
class:
|
|
1790
|
-
style: fe(
|
|
1791
|
-
}, null, 6)) :
|
|
1792
|
-
a("div",
|
|
1837
|
+
class: j(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1838
|
+
style: fe(Z.value)
|
|
1839
|
+
}, null, 6)) : W("", !0),
|
|
1840
|
+
a("div", cn, [
|
|
1793
1841
|
ve(B.$slots, "default", {}, void 0, !0)
|
|
1794
1842
|
])
|
|
1795
|
-
], 38)) :
|
|
1843
|
+
], 38)) : W("", !0)
|
|
1796
1844
|
]),
|
|
1797
1845
|
_: 3
|
|
1798
1846
|
})
|
|
1799
1847
|
]))
|
|
1800
1848
|
], 512));
|
|
1801
1849
|
}
|
|
1802
|
-
}),
|
|
1850
|
+
}), vn = /* @__PURE__ */ $e(fn, [["__scopeId", "data-v-be755399"]]), hn = { class: "relative" }, gn = ["value", "placeholder"], pn = { class: "nh-time-suffix" }, yn = { class: "nh-time-shortcuts" }, mn = { class: "nh-time-shortcuts-list" }, wn = ["onClick", "onKeydown", "onMouseenter"], bn = { class: "nh-time-custom" }, kn = { class: "nh-time-custom-header" }, Cn = { class: "nh-time-selection-status" }, xn = {
|
|
1803
1851
|
key: 0,
|
|
1804
1852
|
class: "status-text"
|
|
1805
|
-
},
|
|
1853
|
+
}, Dn = {
|
|
1806
1854
|
key: 1,
|
|
1807
1855
|
class: "status-text"
|
|
1808
|
-
},
|
|
1856
|
+
}, $n = {
|
|
1809
1857
|
key: 2,
|
|
1810
1858
|
class: "status-text status-complete"
|
|
1811
|
-
},
|
|
1859
|
+
}, Sn = { class: "nh-time-pickers" }, In = { class: "nh-time-picker" }, Mn = { class: "nh-date-picker" }, En = { class: "nh-date-picker-header" }, Ln = { class: "nh-date-picker-header-label" }, Tn = { class: "nh-date-picker-content" }, Bn = { class: "nh-date-table" }, Hn = ["onClick"], zn = { class: "nh-date-table-cell" }, Nn = { key: 0 }, Kn = { class: "nh-time-picker" }, Vn = { class: "nh-date-picker" }, An = { class: "nh-date-picker-header" }, Rn = { class: "nh-date-picker-header-label" }, Wn = { class: "nh-date-picker-content" }, _n = { class: "nh-date-table" }, Pn = ["onClick"], Fn = { class: "nh-date-table-cell" }, Yn = { key: 0 }, On = { class: "nh-time-actions" }, jn = /* @__PURE__ */ De({
|
|
1812
1860
|
__name: "ytime",
|
|
1813
1861
|
props: {
|
|
1814
1862
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1859,87 +1907,87 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1859
1907
|
},
|
|
1860
1908
|
emits: ["update:modelValue", "change"],
|
|
1861
1909
|
setup(e, { emit: m }) {
|
|
1862
|
-
const t = e, l = m,
|
|
1910
|
+
const t = e, l = m, f = N(!1), h = N(-1), o = N(-1), $ = N(null), w = N(), I = N(), x = N({
|
|
1863
1911
|
top: !0,
|
|
1864
1912
|
left: !0
|
|
1865
|
-
}), p =
|
|
1913
|
+
}), p = N({
|
|
1866
1914
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1867
1915
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1868
|
-
}), d =
|
|
1916
|
+
}), d = N({
|
|
1869
1917
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1870
1918
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1871
1919
|
}), C = () => {
|
|
1872
|
-
const i = new Date(p.value.year, p.value.month).getTime(),
|
|
1873
|
-
if (i >=
|
|
1920
|
+
const i = new Date(p.value.year, p.value.month).getTime(), v = new Date(d.value.year, d.value.month).getTime();
|
|
1921
|
+
if (i >= v) {
|
|
1874
1922
|
const H = new Date(p.value.year, p.value.month + 1);
|
|
1875
1923
|
d.value.year = H.getFullYear(), d.value.month = H.getMonth();
|
|
1876
1924
|
}
|
|
1877
|
-
},
|
|
1925
|
+
}, _ = () => {
|
|
1878
1926
|
const i = new Date(p.value.year, p.value.month).getTime();
|
|
1879
1927
|
if (new Date(d.value.year, d.value.month).getTime() <= i) {
|
|
1880
1928
|
const H = new Date(d.value.year, d.value.month - 1);
|
|
1881
1929
|
p.value.year = H.getFullYear(), p.value.month = H.getMonth();
|
|
1882
1930
|
}
|
|
1883
|
-
},
|
|
1931
|
+
}, Z = ["一", "二", "三", "四", "五", "六", "日"], G = N(null), A = N(null), U = (i) => {
|
|
1884
1932
|
if (!i) return null;
|
|
1885
1933
|
if (i instanceof Date) return i;
|
|
1886
1934
|
if (typeof i == "number")
|
|
1887
1935
|
return new Date(i);
|
|
1888
1936
|
if (typeof i == "string") {
|
|
1889
|
-
const
|
|
1890
|
-
return isNaN(
|
|
1937
|
+
const v = new Date(i);
|
|
1938
|
+
return isNaN(v.getTime()) ? null : v;
|
|
1891
1939
|
}
|
|
1892
1940
|
return null;
|
|
1893
|
-
},
|
|
1941
|
+
}, O = (i) => {
|
|
1894
1942
|
if (!i) return null;
|
|
1895
|
-
const
|
|
1943
|
+
const v = i.getFullYear(), H = String(i.getMonth() + 1).padStart(2, "0"), q = String(i.getDate()).padStart(2, "0");
|
|
1896
1944
|
if (t.includeTime) {
|
|
1897
1945
|
const ue = String(i.getHours()).padStart(2, "0"), de = String(i.getMinutes()).padStart(2, "0"), ye = String(i.getSeconds()).padStart(2, "0");
|
|
1898
|
-
return `${
|
|
1946
|
+
return `${v}-${H}-${q} ${ue}:${de}:${ye}`;
|
|
1899
1947
|
} else
|
|
1900
|
-
return `${
|
|
1901
|
-
},
|
|
1902
|
-
startDate:
|
|
1903
|
-
endDate:
|
|
1948
|
+
return `${v}-${H}-${q}`;
|
|
1949
|
+
}, X = (i) => i ? i.getTime() : null, J = (i) => i ? {
|
|
1950
|
+
startDate: U(i.startDate),
|
|
1951
|
+
endDate: U(i.endDate)
|
|
1904
1952
|
} : { startDate: null, endDate: null }, re = (i) => t.format === "string" ? {
|
|
1953
|
+
startDate: O(i.startDate),
|
|
1954
|
+
endDate: O(i.endDate)
|
|
1955
|
+
} : t.format === "timestamp" ? {
|
|
1905
1956
|
startDate: X(i.startDate),
|
|
1906
1957
|
endDate: X(i.endDate)
|
|
1907
|
-
} :
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
} : i, se = (i, c) => `${String(c + 1).padStart(2, "0")}/${i}`, ke = (i, c) => i.getFullYear() === c.getFullYear() && i.getMonth() === c.getMonth() && i.getDate() === c.getDate(), M = (i, c, H) => !c || !H ? !1 : i >= c && i <= H, A = (i) => {
|
|
1911
|
-
const c = Z(i);
|
|
1912
|
-
if (!(c != null && c.startDate) || !(c != null && c.endDate))
|
|
1958
|
+
} : i, se = (i, v) => `${String(v + 1).padStart(2, "0")}/${i}`, ke = (i, v) => i.getFullYear() === v.getFullYear() && i.getMonth() === v.getMonth() && i.getDate() === v.getDate(), E = (i, v, H) => !v || !H ? !1 : i >= v && i <= H, V = (i) => {
|
|
1959
|
+
const v = J(i);
|
|
1960
|
+
if (!(v != null && v.startDate) || !(v != null && v.endDate))
|
|
1913
1961
|
return -1;
|
|
1914
1962
|
for (let H = 0; H < t.shortcuts.length; H++) {
|
|
1915
|
-
const
|
|
1916
|
-
if (
|
|
1963
|
+
const q = t.shortcuts[H].getValue();
|
|
1964
|
+
if (q.startDate && q.endDate && v.startDate && v.endDate) {
|
|
1917
1965
|
const ue = new Date(
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1966
|
+
v.startDate.getFullYear(),
|
|
1967
|
+
v.startDate.getMonth(),
|
|
1968
|
+
v.startDate.getDate()
|
|
1921
1969
|
), de = new Date(
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1970
|
+
v.endDate.getFullYear(),
|
|
1971
|
+
v.endDate.getMonth(),
|
|
1972
|
+
v.endDate.getDate()
|
|
1925
1973
|
), ye = new Date(
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1974
|
+
q.startDate.getFullYear(),
|
|
1975
|
+
q.startDate.getMonth(),
|
|
1976
|
+
q.startDate.getDate()
|
|
1929
1977
|
), Te = new Date(
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1978
|
+
q.endDate.getFullYear(),
|
|
1979
|
+
q.endDate.getMonth(),
|
|
1980
|
+
q.endDate.getDate()
|
|
1933
1981
|
);
|
|
1934
1982
|
if (ue.getTime() === ye.getTime() && de.getTime() === Te.getTime())
|
|
1935
1983
|
return H;
|
|
1936
1984
|
}
|
|
1937
1985
|
}
|
|
1938
1986
|
return -1;
|
|
1939
|
-
}, T = (i,
|
|
1940
|
-
const H = new Date(i,
|
|
1987
|
+
}, T = (i, v) => {
|
|
1988
|
+
const H = new Date(i, v, 1), q = new Date(i, v + 1, 0), ue = H.getDay(), de = q.getDate(), ye = [], Te = /* @__PURE__ */ new Date(), Re = ue === 0 ? 6 : ue - 1, Ye = new Date(i, v, 0);
|
|
1941
1989
|
for (let ge = Re - 1; ge >= 0; ge--) {
|
|
1942
|
-
const Be = new Date(i,
|
|
1990
|
+
const Be = new Date(i, v - 1, Ye.getDate() - ge);
|
|
1943
1991
|
ye.push({
|
|
1944
1992
|
date: Be,
|
|
1945
1993
|
day: Be.getDate(),
|
|
@@ -1952,7 +2000,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1952
2000
|
});
|
|
1953
2001
|
}
|
|
1954
2002
|
for (let ge = 1; ge <= de; ge++) {
|
|
1955
|
-
const Be = new Date(i,
|
|
2003
|
+
const Be = new Date(i, v, ge);
|
|
1956
2004
|
ye.push({
|
|
1957
2005
|
date: Be,
|
|
1958
2006
|
day: ge,
|
|
@@ -1965,7 +2013,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1965
2013
|
}
|
|
1966
2014
|
const Oe = 42 - ye.length;
|
|
1967
2015
|
for (let ge = 1; ge <= Oe; ge++) {
|
|
1968
|
-
const Be = new Date(i,
|
|
2016
|
+
const Be = new Date(i, v + 1, ge);
|
|
1969
2017
|
ye.push({
|
|
1970
2018
|
date: Be,
|
|
1971
2019
|
day: ge,
|
|
@@ -1981,165 +2029,165 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
1981
2029
|
for (let ge = 0; ge < ye.length; ge += 7)
|
|
1982
2030
|
Ze.push(ye.slice(ge, ge + 7));
|
|
1983
2031
|
return Ze;
|
|
1984
|
-
},
|
|
1985
|
-
const
|
|
1986
|
-
l("update:modelValue",
|
|
2032
|
+
}, Y = (i) => {
|
|
2033
|
+
const v = re(i);
|
|
2034
|
+
l("update:modelValue", v), l("change", v);
|
|
1987
2035
|
}, te = () => {
|
|
1988
|
-
if (!w.value || !
|
|
1989
|
-
const i = w.value.getBoundingClientRect(),
|
|
1990
|
-
ue < ye && de > ye ?
|
|
1991
|
-
const Te = H - i.left, Re =
|
|
1992
|
-
Te < Re ?
|
|
2036
|
+
if (!w.value || !I.value) return;
|
|
2037
|
+
const i = w.value.getBoundingClientRect(), v = I.value.getBoundingClientRect(), H = window.innerWidth, ue = window.innerHeight - i.bottom, de = i.top, ye = v.height || 400;
|
|
2038
|
+
ue < ye && de > ye ? x.value.top = !1 : x.value.top = !0;
|
|
2039
|
+
const Te = H - i.left, Re = v.width || 640;
|
|
2040
|
+
Te < Re ? x.value.left = !1 : x.value.left = !0;
|
|
1993
2041
|
}, B = () => {
|
|
1994
|
-
if (
|
|
1995
|
-
const i =
|
|
1996
|
-
if (
|
|
2042
|
+
if (f.value = !f.value, f.value) {
|
|
2043
|
+
const i = J(t.modelValue);
|
|
2044
|
+
if (G.value = (i == null ? void 0 : i.startDate) || null, A.value = (i == null ? void 0 : i.endDate) || null, o.value = V(t.modelValue), h.value = -1, i != null && i.startDate && (p.value.year = i.startDate.getFullYear(), p.value.month = i.startDate.getMonth()), i != null && i.endDate)
|
|
1997
2045
|
d.value.year = i.endDate.getFullYear(), d.value.month = i.endDate.getMonth();
|
|
1998
2046
|
else {
|
|
1999
|
-
const
|
|
2000
|
-
d.value.year =
|
|
2047
|
+
const v = new Date(p.value.year, p.value.month + 1);
|
|
2048
|
+
d.value.year = v.getFullYear(), d.value.month = v.getMonth();
|
|
2001
2049
|
}
|
|
2002
2050
|
C(), ie(() => {
|
|
2003
2051
|
te();
|
|
2004
2052
|
});
|
|
2005
2053
|
}
|
|
2006
|
-
},
|
|
2007
|
-
const
|
|
2008
|
-
H &&
|
|
2054
|
+
}, Q = (i) => {
|
|
2055
|
+
const v = i.target, H = w.value, q = I.value;
|
|
2056
|
+
H && q && !H.contains(v) && !q.contains(v) && (f.value = !1, h.value = -1);
|
|
2009
2057
|
}, g = (i) => {
|
|
2010
|
-
i.key === "Enter" || i.key === " " ? (i.preventDefault(), B()) : i.key === "ArrowDown" && (i.preventDefault(),
|
|
2058
|
+
i.key === "Enter" || i.key === " " ? (i.preventDefault(), B()) : i.key === "ArrowDown" && (i.preventDefault(), f.value = !0, ie(() => {
|
|
2011
2059
|
te(), b();
|
|
2012
2060
|
}));
|
|
2013
|
-
},
|
|
2014
|
-
var
|
|
2015
|
-
i.key === "Escape" && (
|
|
2016
|
-
}, K = (i,
|
|
2017
|
-
i.key === "ArrowDown" ? (i.preventDefault(), h.value = Math.min(
|
|
2061
|
+
}, D = (i) => {
|
|
2062
|
+
var v;
|
|
2063
|
+
i.key === "Escape" && (f.value = !1, h.value = -1, (v = w.value) == null || v.focus());
|
|
2064
|
+
}, K = (i, v) => {
|
|
2065
|
+
i.key === "ArrowDown" ? (i.preventDefault(), h.value = Math.min(v + 1, t.shortcuts.length - 1), z(h.value)) : i.key === "ArrowUp" ? (i.preventDefault(), h.value = Math.max(v - 1, 0), z(h.value)) : (i.key === "Enter" || i.key === " ") && (i.preventDefault(), S(t.shortcuts[v]));
|
|
2018
2066
|
}, s = (i) => {
|
|
2019
2067
|
h.value = i;
|
|
2020
2068
|
}, y = () => {
|
|
2021
2069
|
h.value = -1;
|
|
2022
2070
|
}, b = () => {
|
|
2023
|
-
h.value = 0,
|
|
2024
|
-
},
|
|
2025
|
-
if (
|
|
2026
|
-
const H =
|
|
2071
|
+
h.value = 0, z(0);
|
|
2072
|
+
}, z = (i) => {
|
|
2073
|
+
if (I.value) {
|
|
2074
|
+
const H = I.value.querySelectorAll(".nh-time-shortcut")[i];
|
|
2027
2075
|
H && H.focus();
|
|
2028
2076
|
}
|
|
2029
2077
|
}, S = (i) => {
|
|
2030
|
-
const
|
|
2031
|
-
t.includeTime &&
|
|
2032
|
-
},
|
|
2078
|
+
const v = i.getValue();
|
|
2079
|
+
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)), Y(v), o.value = t.shortcuts.findIndex((H) => H.label === i.label), h.value = -1, f.value = !1;
|
|
2080
|
+
}, P = (i, v) => {
|
|
2033
2081
|
if (!i || i.isDisabled) return;
|
|
2034
2082
|
let H;
|
|
2035
|
-
if (t.includeTime ? (H = new Date(i.date),
|
|
2036
|
-
|
|
2037
|
-
else if (
|
|
2038
|
-
if (H >=
|
|
2039
|
-
t.includeTime && H.setHours(23, 59, 59, 999),
|
|
2083
|
+
if (t.includeTime ? (H = new Date(i.date), v === "start" || !G.value ? H.setHours(0, 0, 0, 0) : H.setHours(23, 59, 59, 999)) : H = new Date(i.date.getFullYear(), i.date.getMonth(), i.date.getDate()), !G.value && !A.value)
|
|
2084
|
+
G.value = H, A.value = null;
|
|
2085
|
+
else if (G.value && !A.value)
|
|
2086
|
+
if (H >= G.value)
|
|
2087
|
+
t.includeTime && H.setHours(23, 59, 59, 999), A.value = H;
|
|
2040
2088
|
else {
|
|
2041
|
-
const
|
|
2042
|
-
t.includeTime &&
|
|
2089
|
+
const q = G.value;
|
|
2090
|
+
t.includeTime && q.setHours(23, 59, 59, 999), A.value = q, G.value = H;
|
|
2043
2091
|
}
|
|
2044
2092
|
else
|
|
2045
|
-
|
|
2046
|
-
if (o.value = -1,
|
|
2047
|
-
const
|
|
2048
|
-
t.includeTime &&
|
|
2049
|
-
startDate:
|
|
2050
|
-
endDate:
|
|
2093
|
+
G.value = H, A.value = null;
|
|
2094
|
+
if (o.value = -1, G.value && A.value) {
|
|
2095
|
+
const q = new Date(A.value);
|
|
2096
|
+
t.includeTime && q.setHours(23, 59, 59, 999), $.value = {
|
|
2097
|
+
startDate: G.value,
|
|
2098
|
+
endDate: q
|
|
2051
2099
|
};
|
|
2052
2100
|
} else
|
|
2053
2101
|
$.value = null;
|
|
2054
|
-
}, le = (i,
|
|
2102
|
+
}, le = (i, v) => {
|
|
2055
2103
|
if (!i) return ["nh-date-table-td"];
|
|
2056
2104
|
const H = ["nh-date-table-td"];
|
|
2057
|
-
return i.isCurrentMonth || H.push("is-prev-month"), i.isToday && H.push("is-today"), i.isDisabled && H.push("is-disabled"),
|
|
2105
|
+
return i.isCurrentMonth || H.push("is-prev-month"), i.isToday && H.push("is-today"), i.isDisabled && H.push("is-disabled"), G.value && ke(i.date, G.value) && H.push("is-selected", "is-start"), A.value && ke(i.date, A.value) && H.push("is-selected", "is-end"), G.value && A.value && E(i.date, G.value, A.value) && H.push("is-in-range"), H;
|
|
2058
2106
|
}, Ce = () => {
|
|
2059
|
-
$.value && (t.includeTime && $.value.endDate && $.value.endDate.setHours(23, 59, 59, 999),
|
|
2060
|
-
},
|
|
2061
|
-
|
|
2107
|
+
$.value && (t.includeTime && $.value.endDate && $.value.endDate.setHours(23, 59, 59, 999), Y($.value), o.value = V($.value), f.value = !1);
|
|
2108
|
+
}, Fe = () => {
|
|
2109
|
+
Y({ startDate: null, endDate: null }), Ue(), h.value = -1, f.value = !1;
|
|
2062
2110
|
}, qe = () => {
|
|
2063
|
-
|
|
2111
|
+
f.value && ie(() => {
|
|
2064
2112
|
te();
|
|
2065
2113
|
});
|
|
2066
|
-
}, ut =
|
|
2067
|
-
const i =
|
|
2114
|
+
}, ut = F(() => T(p.value.year, p.value.month)), et = F(() => T(d.value.year, d.value.month)), Se = F(() => {
|
|
2115
|
+
const i = J(t.modelValue);
|
|
2068
2116
|
if (!i || !i.startDate || !i.endDate)
|
|
2069
2117
|
return "";
|
|
2070
|
-
const
|
|
2118
|
+
const v = (ue) => {
|
|
2071
2119
|
const de = String(ue.getFullYear()), ye = String(ue.getMonth() + 1).padStart(2, "0"), Te = String(ue.getDate()).padStart(2, "0");
|
|
2072
2120
|
return `${de}/${ye}/${Te}`;
|
|
2073
|
-
}, H =
|
|
2074
|
-
return !t.includeTime && H ===
|
|
2075
|
-
}), Ae =
|
|
2121
|
+
}, H = v(i.startDate), q = v(i.endDate);
|
|
2122
|
+
return !t.includeTime && H === q ? H : `${H} - ${q}`;
|
|
2123
|
+
}), Ae = F(() => [
|
|
2076
2124
|
"nh-time-dropdown",
|
|
2077
2125
|
{
|
|
2078
|
-
"nh-time-dropdown-top": !
|
|
2079
|
-
"nh-time-dropdown-right": !
|
|
2126
|
+
"nh-time-dropdown-top": !x.value.top,
|
|
2127
|
+
"nh-time-dropdown-right": !x.value.left
|
|
2080
2128
|
}
|
|
2081
|
-
]), Ge =
|
|
2082
|
-
const i =
|
|
2129
|
+
]), Ge = F(() => {
|
|
2130
|
+
const i = J(t.modelValue);
|
|
2083
2131
|
return !!(i != null && i.startDate && (i != null && i.endDate));
|
|
2084
|
-
}), dt =
|
|
2085
|
-
|
|
2132
|
+
}), dt = F(() => !!(G.value && A.value)), Ue = () => {
|
|
2133
|
+
G.value = null, A.value = null, $.value = null, o.value = -1;
|
|
2086
2134
|
};
|
|
2087
2135
|
ae(() => t.modelValue, (i) => {
|
|
2088
|
-
const
|
|
2089
|
-
if (
|
|
2090
|
-
const H =
|
|
2136
|
+
const v = J(i);
|
|
2137
|
+
if (v != null && v.startDate) {
|
|
2138
|
+
const H = v.startDate;
|
|
2091
2139
|
p.value.year = H.getFullYear(), p.value.month = H.getMonth();
|
|
2092
2140
|
}
|
|
2093
|
-
if (
|
|
2094
|
-
const H =
|
|
2141
|
+
if (v != null && v.endDate) {
|
|
2142
|
+
const H = v.endDate;
|
|
2095
2143
|
d.value.year = H.getFullYear(), d.value.month = H.getMonth();
|
|
2096
|
-
} else if (
|
|
2144
|
+
} else if (v != null && v.startDate) {
|
|
2097
2145
|
const H = new Date(p.value.year, p.value.month + 1);
|
|
2098
2146
|
d.value.year = H.getFullYear(), d.value.month = H.getMonth();
|
|
2099
2147
|
}
|
|
2100
|
-
(
|
|
2148
|
+
(v != null && v.startDate || v != null && v.endDate) && C(), f.value || (o.value = V(i));
|
|
2101
2149
|
}, { immediate: !0, deep: !0 }), ae([p, d], () => {
|
|
2102
|
-
const i = new Date(p.value.year, p.value.month).getTime(),
|
|
2103
|
-
if (i ===
|
|
2150
|
+
const i = new Date(p.value.year, p.value.month).getTime(), v = new Date(d.value.year, d.value.month).getTime();
|
|
2151
|
+
if (i === v) {
|
|
2104
2152
|
const H = new Date(p.value.year, p.value.month + 1);
|
|
2105
2153
|
d.value.year = H.getFullYear(), d.value.month = H.getMonth();
|
|
2106
2154
|
}
|
|
2107
|
-
}, { deep: !0 }),
|
|
2108
|
-
document.addEventListener("click",
|
|
2109
|
-
const i =
|
|
2155
|
+
}, { deep: !0 }), ze(() => {
|
|
2156
|
+
document.addEventListener("click", Q), window.addEventListener("resize", qe), window.addEventListener("scroll", qe), o.value = V(t.modelValue);
|
|
2157
|
+
const i = J(t.modelValue);
|
|
2110
2158
|
if (i != null && i.startDate && (p.value.year = i.startDate.getFullYear(), p.value.month = i.startDate.getMonth()), i != null && i.endDate)
|
|
2111
2159
|
d.value.year = i.endDate.getFullYear(), d.value.month = i.endDate.getMonth();
|
|
2112
2160
|
else {
|
|
2113
|
-
const
|
|
2114
|
-
d.value.year =
|
|
2161
|
+
const v = new Date(p.value.year, p.value.month + 1);
|
|
2162
|
+
d.value.year = v.getFullYear(), d.value.month = v.getMonth();
|
|
2115
2163
|
}
|
|
2116
2164
|
C();
|
|
2117
2165
|
}), Ke(() => {
|
|
2118
|
-
document.removeEventListener("click",
|
|
2166
|
+
document.removeEventListener("click", Q), window.removeEventListener("resize", qe), window.removeEventListener("scroll", qe);
|
|
2119
2167
|
});
|
|
2120
2168
|
const tt = () => {
|
|
2121
|
-
t.clearable && (
|
|
2122
|
-
}, je = (i,
|
|
2169
|
+
t.clearable && (Y({ startDate: null, endDate: null }), Ue(), h.value = -1);
|
|
2170
|
+
}, je = (i, v) => {
|
|
2123
2171
|
if (i === "start") {
|
|
2124
|
-
const H = new Date(p.value.year, p.value.month +
|
|
2172
|
+
const H = new Date(p.value.year, p.value.month + v, 1);
|
|
2125
2173
|
p.value.year = H.getFullYear(), p.value.month = H.getMonth(), C();
|
|
2126
2174
|
} else {
|
|
2127
|
-
const H = new Date(d.value.year, d.value.month +
|
|
2128
|
-
d.value.year = H.getFullYear(), d.value.month = H.getMonth(),
|
|
2175
|
+
const H = new Date(d.value.year, d.value.month + v, 1);
|
|
2176
|
+
d.value.year = H.getFullYear(), d.value.month = H.getMonth(), _();
|
|
2129
2177
|
}
|
|
2130
2178
|
};
|
|
2131
|
-
return (i,
|
|
2179
|
+
return (i, v) => {
|
|
2132
2180
|
const H = Je("YButton");
|
|
2133
|
-
return
|
|
2134
|
-
class:
|
|
2181
|
+
return r(), c("div", {
|
|
2182
|
+
class: j(["nh-time-search", [`nh-time--${e.size}`]])
|
|
2135
2183
|
}, [
|
|
2136
|
-
a("div",
|
|
2184
|
+
a("div", hn, [
|
|
2137
2185
|
a("div", {
|
|
2138
2186
|
ref_key: "trigger",
|
|
2139
2187
|
ref: w,
|
|
2140
2188
|
onClick: B,
|
|
2141
2189
|
onKeydown: g,
|
|
2142
|
-
class:
|
|
2190
|
+
class: j(["nh-time-trigger", { "is-focus": f.value, "has-value": Ge.value }]),
|
|
2143
2191
|
tabindex: "0"
|
|
2144
2192
|
}, [
|
|
2145
2193
|
a("input", {
|
|
@@ -2147,13 +2195,13 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2147
2195
|
value: Se.value,
|
|
2148
2196
|
placeholder: e.placeholder,
|
|
2149
2197
|
class: "nh-time-input"
|
|
2150
|
-
}, null, 8,
|
|
2151
|
-
a("span",
|
|
2152
|
-
e.clearable && Ge.value ? (
|
|
2198
|
+
}, null, 8, gn),
|
|
2199
|
+
a("span", pn, [
|
|
2200
|
+
e.clearable && Ge.value ? (r(), c("i", {
|
|
2153
2201
|
key: 0,
|
|
2154
2202
|
onClick: ne(tt, ["stop"]),
|
|
2155
2203
|
class: "nh-time-clear"
|
|
2156
|
-
}, [...
|
|
2204
|
+
}, [...v[4] || (v[4] = [
|
|
2157
2205
|
a("svg", {
|
|
2158
2206
|
viewBox: "0 0 1024 1024",
|
|
2159
2207
|
width: "14",
|
|
@@ -2164,8 +2212,8 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2164
2212
|
fill: "currentColor"
|
|
2165
2213
|
})
|
|
2166
2214
|
], -1)
|
|
2167
|
-
])])) :
|
|
2168
|
-
|
|
2215
|
+
])])) : W("", !0),
|
|
2216
|
+
v[6] || (v[6] = a("i", { class: "nh-time-icon" }, [
|
|
2169
2217
|
a("svg", {
|
|
2170
2218
|
viewBox: "0 0 1024 1024",
|
|
2171
2219
|
width: "14",
|
|
@@ -2178,8 +2226,8 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2178
2226
|
])
|
|
2179
2227
|
], -1)),
|
|
2180
2228
|
a("i", {
|
|
2181
|
-
class:
|
|
2182
|
-
}, [...
|
|
2229
|
+
class: j(["nh-time-arrow", { "is-reverse": f.value }])
|
|
2230
|
+
}, [...v[5] || (v[5] = [
|
|
2183
2231
|
a("svg", {
|
|
2184
2232
|
viewBox: "0 0 1024 1024",
|
|
2185
2233
|
width: "12",
|
|
@@ -2195,23 +2243,23 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2195
2243
|
], 34),
|
|
2196
2244
|
be(He, { name: "el-zoom-in-top" }, {
|
|
2197
2245
|
default: pe(() => [
|
|
2198
|
-
|
|
2246
|
+
f.value ? (r(), c("div", {
|
|
2199
2247
|
key: 0,
|
|
2200
2248
|
ref_key: "dropdown",
|
|
2201
|
-
ref:
|
|
2202
|
-
class:
|
|
2203
|
-
onKeydown:
|
|
2249
|
+
ref: I,
|
|
2250
|
+
class: j(Ae.value),
|
|
2251
|
+
onKeydown: D
|
|
2204
2252
|
}, [
|
|
2205
|
-
a("div",
|
|
2206
|
-
|
|
2207
|
-
a("ul",
|
|
2208
|
-
(
|
|
2209
|
-
key:
|
|
2210
|
-
onClick: (de) => S(
|
|
2253
|
+
a("div", yn, [
|
|
2254
|
+
v[7] || (v[7] = a("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
2255
|
+
a("ul", mn, [
|
|
2256
|
+
(r(!0), c(he, null, xe(e.shortcuts, (q, ue) => (r(), c("li", {
|
|
2257
|
+
key: q.label,
|
|
2258
|
+
onClick: (de) => S(q),
|
|
2211
2259
|
onKeydown: (de) => K(de, ue),
|
|
2212
2260
|
onMouseenter: (de) => s(ue),
|
|
2213
2261
|
onMouseleave: y,
|
|
2214
|
-
class:
|
|
2262
|
+
class: j([
|
|
2215
2263
|
"nh-time-shortcut",
|
|
2216
2264
|
{
|
|
2217
2265
|
"is-active": h.value === ue,
|
|
@@ -2219,25 +2267,25 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2219
2267
|
}
|
|
2220
2268
|
]),
|
|
2221
2269
|
tabindex: "0"
|
|
2222
|
-
}, oe(
|
|
2270
|
+
}, oe(q.label), 43, wn))), 128))
|
|
2223
2271
|
])
|
|
2224
2272
|
]),
|
|
2225
|
-
a("div",
|
|
2226
|
-
a("div",
|
|
2227
|
-
|
|
2228
|
-
a("div",
|
|
2229
|
-
!
|
|
2273
|
+
a("div", bn, [
|
|
2274
|
+
a("div", kn, [
|
|
2275
|
+
v[8] || (v[8] = a("span", null, "自定义时间", -1)),
|
|
2276
|
+
a("div", Cn, [
|
|
2277
|
+
!G.value && !A.value ? (r(), c("span", xn, " 请选择开始日期 ")) : G.value && !A.value ? (r(), c("span", Dn, " 请选择结束日期 ")) : G.value && A.value ? (r(), c("span", $n, " 已选择完整范围 ")) : W("", !0)
|
|
2230
2278
|
])
|
|
2231
2279
|
]),
|
|
2232
|
-
a("div",
|
|
2233
|
-
a("div",
|
|
2234
|
-
a("div",
|
|
2235
|
-
a("div",
|
|
2280
|
+
a("div", Sn, [
|
|
2281
|
+
a("div", In, [
|
|
2282
|
+
a("div", Mn, [
|
|
2283
|
+
a("div", En, [
|
|
2236
2284
|
a("button", {
|
|
2237
|
-
onClick:
|
|
2285
|
+
onClick: v[0] || (v[0] = (q) => je("start", -1)),
|
|
2238
2286
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
2239
2287
|
type: "button"
|
|
2240
|
-
}, [...
|
|
2288
|
+
}, [...v[9] || (v[9] = [
|
|
2241
2289
|
a("svg", {
|
|
2242
2290
|
viewBox: "0 0 1024 1024",
|
|
2243
2291
|
width: "12",
|
|
@@ -2249,12 +2297,12 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2249
2297
|
})
|
|
2250
2298
|
], -1)
|
|
2251
2299
|
])]),
|
|
2252
|
-
a("span",
|
|
2300
|
+
a("span", Ln, oe(se(p.value.year, p.value.month)), 1),
|
|
2253
2301
|
a("button", {
|
|
2254
|
-
onClick:
|
|
2302
|
+
onClick: v[1] || (v[1] = (q) => je("start", 1)),
|
|
2255
2303
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2256
2304
|
type: "button"
|
|
2257
|
-
}, [...
|
|
2305
|
+
}, [...v[10] || (v[10] = [
|
|
2258
2306
|
a("svg", {
|
|
2259
2307
|
viewBox: "0 0 1024 1024",
|
|
2260
2308
|
width: "12",
|
|
@@ -2267,43 +2315,43 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2267
2315
|
], -1)
|
|
2268
2316
|
])])
|
|
2269
2317
|
]),
|
|
2270
|
-
a("div",
|
|
2271
|
-
a("table",
|
|
2318
|
+
a("div", Tn, [
|
|
2319
|
+
a("table", Bn, [
|
|
2272
2320
|
a("thead", null, [
|
|
2273
2321
|
a("tr", null, [
|
|
2274
|
-
(
|
|
2275
|
-
key:
|
|
2322
|
+
(r(), c(he, null, xe(Z, (q) => a("th", {
|
|
2323
|
+
key: q,
|
|
2276
2324
|
class: "nh-date-table-th"
|
|
2277
|
-
}, oe(
|
|
2325
|
+
}, oe(q), 1)), 64))
|
|
2278
2326
|
])
|
|
2279
2327
|
]),
|
|
2280
2328
|
a("tbody", null, [
|
|
2281
|
-
(
|
|
2329
|
+
(r(!0), c(he, null, xe(ut.value, (q, ue) => (r(), c("tr", {
|
|
2282
2330
|
key: `start-week-${ue}`
|
|
2283
2331
|
}, [
|
|
2284
|
-
(
|
|
2332
|
+
(r(!0), c(he, null, xe(q, (de, ye) => (r(), c("td", {
|
|
2285
2333
|
key: `start-day-${ue}-${ye}`,
|
|
2286
|
-
class:
|
|
2287
|
-
onClick: (Te) =>
|
|
2334
|
+
class: j(le(de)),
|
|
2335
|
+
onClick: (Te) => P(de, "start")
|
|
2288
2336
|
}, [
|
|
2289
|
-
a("div",
|
|
2290
|
-
de ? (
|
|
2337
|
+
a("div", zn, [
|
|
2338
|
+
de ? (r(), c("span", Nn, oe(de.day), 1)) : W("", !0)
|
|
2291
2339
|
])
|
|
2292
|
-
], 10,
|
|
2340
|
+
], 10, Hn))), 128))
|
|
2293
2341
|
]))), 128))
|
|
2294
2342
|
])
|
|
2295
2343
|
])
|
|
2296
2344
|
])
|
|
2297
2345
|
])
|
|
2298
2346
|
]),
|
|
2299
|
-
a("div",
|
|
2300
|
-
a("div",
|
|
2301
|
-
a("div",
|
|
2347
|
+
a("div", Kn, [
|
|
2348
|
+
a("div", Vn, [
|
|
2349
|
+
a("div", An, [
|
|
2302
2350
|
a("button", {
|
|
2303
|
-
onClick:
|
|
2351
|
+
onClick: v[2] || (v[2] = (q) => je("end", -1)),
|
|
2304
2352
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
2305
2353
|
type: "button"
|
|
2306
|
-
}, [...
|
|
2354
|
+
}, [...v[11] || (v[11] = [
|
|
2307
2355
|
a("svg", {
|
|
2308
2356
|
viewBox: "0 0 1024 1024",
|
|
2309
2357
|
width: "12",
|
|
@@ -2315,12 +2363,12 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2315
2363
|
})
|
|
2316
2364
|
], -1)
|
|
2317
2365
|
])]),
|
|
2318
|
-
a("span",
|
|
2366
|
+
a("span", Rn, oe(se(d.value.year, d.value.month)), 1),
|
|
2319
2367
|
a("button", {
|
|
2320
|
-
onClick:
|
|
2368
|
+
onClick: v[3] || (v[3] = (q) => je("end", 1)),
|
|
2321
2369
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2322
2370
|
type: "button"
|
|
2323
|
-
}, [...
|
|
2371
|
+
}, [...v[12] || (v[12] = [
|
|
2324
2372
|
a("svg", {
|
|
2325
2373
|
viewBox: "0 0 1024 1024",
|
|
2326
2374
|
width: "12",
|
|
@@ -2333,29 +2381,29 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2333
2381
|
], -1)
|
|
2334
2382
|
])])
|
|
2335
2383
|
]),
|
|
2336
|
-
a("div",
|
|
2337
|
-
a("table",
|
|
2384
|
+
a("div", Wn, [
|
|
2385
|
+
a("table", _n, [
|
|
2338
2386
|
a("thead", null, [
|
|
2339
2387
|
a("tr", null, [
|
|
2340
|
-
(
|
|
2341
|
-
key:
|
|
2388
|
+
(r(), c(he, null, xe(Z, (q) => a("th", {
|
|
2389
|
+
key: q,
|
|
2342
2390
|
class: "nh-date-table-th"
|
|
2343
|
-
}, oe(
|
|
2391
|
+
}, oe(q), 1)), 64))
|
|
2344
2392
|
])
|
|
2345
2393
|
]),
|
|
2346
2394
|
a("tbody", null, [
|
|
2347
|
-
(
|
|
2395
|
+
(r(!0), c(he, null, xe(et.value, (q, ue) => (r(), c("tr", {
|
|
2348
2396
|
key: `end-week-${ue}`
|
|
2349
2397
|
}, [
|
|
2350
|
-
(
|
|
2398
|
+
(r(!0), c(he, null, xe(q, (de, ye) => (r(), c("td", {
|
|
2351
2399
|
key: `end-day-${ue}-${ye}`,
|
|
2352
|
-
class:
|
|
2353
|
-
onClick: (Te) =>
|
|
2400
|
+
class: j(le(de)),
|
|
2401
|
+
onClick: (Te) => P(de, "end")
|
|
2354
2402
|
}, [
|
|
2355
|
-
a("div",
|
|
2356
|
-
de ? (
|
|
2403
|
+
a("div", Fn, [
|
|
2404
|
+
de ? (r(), c("span", Yn, oe(de.day), 1)) : W("", !0)
|
|
2357
2405
|
])
|
|
2358
|
-
], 10,
|
|
2406
|
+
], 10, Pn))), 128))
|
|
2359
2407
|
]))), 128))
|
|
2360
2408
|
])
|
|
2361
2409
|
])
|
|
@@ -2363,18 +2411,18 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2363
2411
|
])
|
|
2364
2412
|
])
|
|
2365
2413
|
]),
|
|
2366
|
-
a("div",
|
|
2367
|
-
e.clearable ? (
|
|
2414
|
+
a("div", On, [
|
|
2415
|
+
e.clearable ? (r(), Ne(H, {
|
|
2368
2416
|
key: 0,
|
|
2369
|
-
onClick:
|
|
2417
|
+
onClick: Fe,
|
|
2370
2418
|
variant: "secondary",
|
|
2371
2419
|
size: e.size
|
|
2372
2420
|
}, {
|
|
2373
|
-
default: pe(() => [...
|
|
2421
|
+
default: pe(() => [...v[13] || (v[13] = [
|
|
2374
2422
|
Le(" 清空 ", -1)
|
|
2375
2423
|
])]),
|
|
2376
2424
|
_: 1
|
|
2377
|
-
}, 8, ["size"])) :
|
|
2425
|
+
}, 8, ["size"])) : W("", !0),
|
|
2378
2426
|
be(H, {
|
|
2379
2427
|
onClick: Ce,
|
|
2380
2428
|
disabled: !dt.value,
|
|
@@ -2382,13 +2430,13 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2382
2430
|
size: e.size
|
|
2383
2431
|
}, {
|
|
2384
2432
|
default: pe(() => [
|
|
2385
|
-
Le(oe(
|
|
2433
|
+
Le(oe(G.value && !A.value ? "继续选择结束日期" : "确认"), 1)
|
|
2386
2434
|
]),
|
|
2387
2435
|
_: 1
|
|
2388
2436
|
}, 8, ["disabled", "size"])
|
|
2389
2437
|
])
|
|
2390
2438
|
])
|
|
2391
|
-
], 34)) :
|
|
2439
|
+
], 34)) : W("", !0)
|
|
2392
2440
|
]),
|
|
2393
2441
|
_: 1
|
|
2394
2442
|
})
|
|
@@ -2396,11 +2444,11 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2396
2444
|
], 2);
|
|
2397
2445
|
};
|
|
2398
2446
|
}
|
|
2399
|
-
}), St = /* @__PURE__ */ $e(
|
|
2447
|
+
}), St = /* @__PURE__ */ $e(jn, [["__scopeId", "data-v-e5ef63b1"]]), qn = ["aria-checked", "aria-disabled", "disabled", "onKeydown"], Un = { class: "yswitch__thumb" }, Gn = {
|
|
2400
2448
|
key: 0,
|
|
2401
2449
|
class: "yswitch__spinner",
|
|
2402
2450
|
"aria-hidden": "true"
|
|
2403
|
-
},
|
|
2451
|
+
}, Zn = /* @__PURE__ */ De({
|
|
2404
2452
|
__name: "yswitch",
|
|
2405
2453
|
props: {
|
|
2406
2454
|
modelValue: { default: !1 },
|
|
@@ -2417,7 +2465,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2417
2465
|
},
|
|
2418
2466
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2419
2467
|
setup(e, { emit: m }) {
|
|
2420
|
-
const t = e, l = m,
|
|
2468
|
+
const t = e, l = m, f = N(), h = F(() => t.modelValue === t.trueValue), o = F(() => {
|
|
2421
2469
|
const w = {};
|
|
2422
2470
|
return w.background = h.value ? t.activeColor : t.inactiveColor, w;
|
|
2423
2471
|
});
|
|
@@ -2426,13 +2474,13 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2426
2474
|
const w = h.value ? t.falseValue : t.trueValue;
|
|
2427
2475
|
l("update:modelValue", w), l("change", w);
|
|
2428
2476
|
}
|
|
2429
|
-
return
|
|
2430
|
-
const w =
|
|
2431
|
-
w && (w.addEventListener("focus", (
|
|
2432
|
-
}), (w,
|
|
2477
|
+
return ze(() => {
|
|
2478
|
+
const w = f.value;
|
|
2479
|
+
w && (w.addEventListener("focus", (I) => l("focus", I)), w.addEventListener("blur", (I) => l("blur", I)));
|
|
2480
|
+
}), (w, I) => (r(), c("button", {
|
|
2433
2481
|
ref_key: "rootEl",
|
|
2434
|
-
ref:
|
|
2435
|
-
class:
|
|
2482
|
+
ref: f,
|
|
2483
|
+
class: j(["yswitch", [
|
|
2436
2484
|
`yswitch--${e.size}`,
|
|
2437
2485
|
{ "yswitch--checked": h.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2438
2486
|
]]),
|
|
@@ -2447,17 +2495,17 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2447
2495
|
Me(ne($, ["prevent"]), ["space"])
|
|
2448
2496
|
]
|
|
2449
2497
|
}, [
|
|
2450
|
-
|
|
2451
|
-
a("span",
|
|
2452
|
-
e.loading ? (
|
|
2498
|
+
I[0] || (I[0] = a("span", { class: "yswitch__track" }, null, -1)),
|
|
2499
|
+
a("span", Un, [
|
|
2500
|
+
e.loading ? (r(), c("span", Gn)) : W("", !0)
|
|
2453
2501
|
]),
|
|
2454
|
-
e.showText ? (
|
|
2502
|
+
e.showText ? (r(), c("span", {
|
|
2455
2503
|
key: 0,
|
|
2456
|
-
class:
|
|
2457
|
-
}, oe(h.value ? e.activeText : e.inactiveText), 3)) :
|
|
2458
|
-
], 46,
|
|
2504
|
+
class: j(["yswitch__label", { "yswitch__label--left": !h.value, "yswitch__label--right": h.value }])
|
|
2505
|
+
}, oe(h.value ? e.activeText : e.inactiveText), 3)) : W("", !0)
|
|
2506
|
+
], 46, qn));
|
|
2459
2507
|
}
|
|
2460
|
-
}), It = /* @__PURE__ */ $e(
|
|
2508
|
+
}), It = /* @__PURE__ */ $e(Zn, [["__scopeId", "data-v-0b157fc4"]]), Qn = ["src", "alt"], Jn = ["src", "alt"], Xn = /* @__PURE__ */ De({
|
|
2461
2509
|
__name: "yimage",
|
|
2462
2510
|
props: {
|
|
2463
2511
|
src: {},
|
|
@@ -2473,10 +2521,10 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2473
2521
|
},
|
|
2474
2522
|
emits: ["load", "error", "preview"],
|
|
2475
2523
|
setup(e, { expose: m, emit: t }) {
|
|
2476
|
-
const l = e,
|
|
2524
|
+
const l = e, f = t, h = N(), o = N(), $ = N(), w = N(!1), I = N(!1), x = N(!1), p = N(!1), d = N(!1), C = N("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), _ = N(""), Z = N(1), G = N(!1), A = N({
|
|
2477
2525
|
overflow: "",
|
|
2478
2526
|
paddingRight: ""
|
|
2479
|
-
}),
|
|
2527
|
+
}), U = {
|
|
2480
2528
|
none: "0px",
|
|
2481
2529
|
sm: "0.125rem",
|
|
2482
2530
|
md: "0.375rem",
|
|
@@ -2484,120 +2532,120 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2484
2532
|
xl: "0.75rem",
|
|
2485
2533
|
"2xl": "1rem",
|
|
2486
2534
|
full: "9999px"
|
|
2487
|
-
},
|
|
2535
|
+
}, O = F(() => l.className || ""), X = F(() => {
|
|
2488
2536
|
if (typeof l.radius == "number")
|
|
2489
2537
|
return `${l.radius}px`;
|
|
2490
2538
|
if (typeof l.radius == "string") {
|
|
2491
2539
|
if (/(px|%|rem|em)$/.test(l.radius))
|
|
2492
2540
|
return l.radius;
|
|
2493
|
-
if (
|
|
2494
|
-
return
|
|
2541
|
+
if (U[l.radius])
|
|
2542
|
+
return U[l.radius];
|
|
2495
2543
|
}
|
|
2496
2544
|
return "";
|
|
2497
|
-
}),
|
|
2498
|
-
borderRadius:
|
|
2499
|
-
} : {}), re =
|
|
2545
|
+
}), J = F(() => X.value ? {
|
|
2546
|
+
borderRadius: X.value
|
|
2547
|
+
} : {}), re = F(() => [
|
|
2500
2548
|
"yimage-image",
|
|
2501
2549
|
l.preview ? "is-previewable" : ""
|
|
2502
|
-
].filter(Boolean).join(" ")), se =
|
|
2550
|
+
].filter(Boolean).join(" ")), se = F(() => {
|
|
2503
2551
|
const S = {
|
|
2504
2552
|
objectFit: l.fit || "cover",
|
|
2505
2553
|
backgroundColor: "#fff"
|
|
2506
2554
|
};
|
|
2507
|
-
return l.width && (S.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.height && (S.height = typeof l.height == "number" ? `${l.height}px` : l.height),
|
|
2508
|
-
}), ke =
|
|
2555
|
+
return l.width && (S.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.height && (S.height = typeof l.height == "number" ? `${l.height}px` : l.height), X.value && (S.borderRadius = X.value), S;
|
|
2556
|
+
}), ke = F(() => _.value ? _.value : Array.isArray(l.previewSrcList) ? l.previewSrcList.find(Boolean) || l.src : l.previewSrcList || l.src), E = () => {
|
|
2509
2557
|
const S = document.createElement("div");
|
|
2510
2558
|
S.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(S);
|
|
2511
|
-
const
|
|
2512
|
-
return document.body.removeChild(S),
|
|
2513
|
-
},
|
|
2514
|
-
if (
|
|
2559
|
+
const P = S.offsetWidth - S.clientWidth;
|
|
2560
|
+
return document.body.removeChild(S), P;
|
|
2561
|
+
}, V = () => {
|
|
2562
|
+
if (A.value = {
|
|
2515
2563
|
overflow: document.body.style.overflow || "",
|
|
2516
2564
|
paddingRight: document.body.style.paddingRight || ""
|
|
2517
2565
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2518
|
-
const
|
|
2519
|
-
document.body.style.paddingRight = `${
|
|
2566
|
+
const P = E();
|
|
2567
|
+
document.body.style.paddingRight = `${P}px`;
|
|
2520
2568
|
}
|
|
2521
2569
|
document.body.style.overflow = "hidden";
|
|
2522
2570
|
}, T = () => {
|
|
2523
|
-
document.body.style.overflow =
|
|
2571
|
+
document.body.style.overflow = A.value.overflow, document.body.style.paddingRight = A.value.paddingRight;
|
|
2524
2572
|
};
|
|
2525
|
-
let
|
|
2573
|
+
let Y = null;
|
|
2526
2574
|
const te = () => {
|
|
2527
|
-
!l.lazy || !h.value || (
|
|
2575
|
+
!l.lazy || !h.value || (Y = new IntersectionObserver(
|
|
2528
2576
|
(S) => {
|
|
2529
|
-
S.forEach((
|
|
2530
|
-
|
|
2577
|
+
S.forEach((P) => {
|
|
2578
|
+
P.isIntersecting && (p.value = !0, C.value = l.src, Y == null || Y.unobserve(P.target));
|
|
2531
2579
|
});
|
|
2532
2580
|
},
|
|
2533
2581
|
{
|
|
2534
2582
|
rootMargin: "50px"
|
|
2535
2583
|
}
|
|
2536
|
-
),
|
|
2584
|
+
), Y.observe(h.value));
|
|
2537
2585
|
}, B = (S) => {
|
|
2538
|
-
w.value = !0,
|
|
2539
|
-
},
|
|
2540
|
-
|
|
2586
|
+
w.value = !0, I.value = !1, x.value = !1, f("load", S);
|
|
2587
|
+
}, Q = (S) => {
|
|
2588
|
+
x.value = !0, I.value = !1, w.value = !1, f("error", S);
|
|
2541
2589
|
}, g = () => {
|
|
2542
|
-
|
|
2590
|
+
x.value = !1, I.value = !0, w.value = !1, ie(() => {
|
|
2543
2591
|
o.value && (o.value.src = l.src);
|
|
2544
2592
|
});
|
|
2545
|
-
},
|
|
2593
|
+
}, D = () => Array.isArray(l.previewSrcList) ? l.previewSrcList.find(Boolean) || l.src : l.previewSrcList || l.src, K = () => {
|
|
2546
2594
|
l.preview && (l.previewSrcList || l.src) ? s() : g();
|
|
2547
2595
|
}, s = () => {
|
|
2548
2596
|
if (!l.preview) return;
|
|
2549
|
-
|
|
2550
|
-
const S =
|
|
2597
|
+
Z.value = 1;
|
|
2598
|
+
const S = D();
|
|
2551
2599
|
if (o.value && o.value.complete && o.value.naturalWidth > 0) {
|
|
2552
|
-
|
|
2553
|
-
d.value = !0,
|
|
2600
|
+
_.value = S, ie(() => {
|
|
2601
|
+
d.value = !0, V(), f("preview", S);
|
|
2554
2602
|
});
|
|
2555
2603
|
return;
|
|
2556
2604
|
}
|
|
2557
|
-
const
|
|
2605
|
+
const P = new Image();
|
|
2558
2606
|
let le = null, Ce = !1;
|
|
2559
|
-
const
|
|
2560
|
-
Ce || (Ce = !0, le && (clearTimeout(le), le = null),
|
|
2561
|
-
d.value = !0,
|
|
2607
|
+
const Fe = () => {
|
|
2608
|
+
Ce || (Ce = !0, le && (clearTimeout(le), le = null), _.value = S, ie(() => {
|
|
2609
|
+
d.value = !0, V(), f("preview", S);
|
|
2562
2610
|
}));
|
|
2563
2611
|
};
|
|
2564
2612
|
le = setTimeout(() => {
|
|
2565
|
-
|
|
2566
|
-
}, 500),
|
|
2567
|
-
|
|
2568
|
-
},
|
|
2569
|
-
|
|
2570
|
-
},
|
|
2613
|
+
Fe();
|
|
2614
|
+
}, 500), P.onload = () => {
|
|
2615
|
+
Fe();
|
|
2616
|
+
}, P.onerror = () => {
|
|
2617
|
+
Fe();
|
|
2618
|
+
}, P.src = S, P.complete && Fe();
|
|
2571
2619
|
}, y = () => {
|
|
2572
2620
|
d.value = !1, setTimeout(() => {
|
|
2573
2621
|
T();
|
|
2574
2622
|
}, 300);
|
|
2575
2623
|
}, b = (S) => {
|
|
2576
|
-
const
|
|
2577
|
-
let Ce =
|
|
2578
|
-
Ce = Math.max(0.5, Math.min(2, Ce)),
|
|
2624
|
+
const P = S.deltaY < 0 ? 1 : -1;
|
|
2625
|
+
let Ce = Z.value + P * 0.1;
|
|
2626
|
+
Ce = Math.max(0.5, Math.min(2, Ce)), Z.value = Ce;
|
|
2579
2627
|
};
|
|
2580
|
-
return
|
|
2581
|
-
l.lazy ? te() : p.value = !0, p.value && (
|
|
2628
|
+
return ze(() => {
|
|
2629
|
+
l.lazy ? te() : p.value = !0, p.value && (I.value = !0), G.value = !0;
|
|
2582
2630
|
}), Ke(() => {
|
|
2583
|
-
|
|
2631
|
+
Y && Y.disconnect(), d.value && T();
|
|
2584
2632
|
}), ae(() => C.value, () => {
|
|
2585
|
-
l.src && p.value && (
|
|
2633
|
+
l.src && p.value && (I.value = !0, x.value = !1, w.value = !1);
|
|
2586
2634
|
}), ae(() => l.src, (S) => {
|
|
2587
2635
|
C.value = S || "";
|
|
2588
2636
|
}), m({
|
|
2589
2637
|
retryLoad: g,
|
|
2590
2638
|
closePreview: y
|
|
2591
|
-
}), (S,
|
|
2639
|
+
}), (S, P) => (r(), c("div", {
|
|
2592
2640
|
ref_key: "containerRef",
|
|
2593
2641
|
ref: h,
|
|
2594
|
-
class:
|
|
2642
|
+
class: j(["yimage-container", O.value])
|
|
2595
2643
|
}, [
|
|
2596
|
-
!w.value && !
|
|
2644
|
+
!w.value && !x.value && !p.value ? (r(), c("div", {
|
|
2597
2645
|
key: 0,
|
|
2598
2646
|
class: "yimage-placeholder",
|
|
2599
|
-
style: fe(
|
|
2600
|
-
}, [...
|
|
2647
|
+
style: fe(J.value)
|
|
2648
|
+
}, [...P[1] || (P[1] = [
|
|
2601
2649
|
a("div", { class: "yimage-placeholder-content" }, [
|
|
2602
2650
|
a("svg", {
|
|
2603
2651
|
class: "yimage-placeholder-icon",
|
|
@@ -2613,61 +2661,61 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2613
2661
|
})
|
|
2614
2662
|
])
|
|
2615
2663
|
], -1)
|
|
2616
|
-
])], 4)) :
|
|
2617
|
-
|
|
2664
|
+
])], 4)) : W("", !0),
|
|
2665
|
+
I.value && !x.value ? (r(), c("div", {
|
|
2618
2666
|
key: 1,
|
|
2619
2667
|
class: "yimage-loading",
|
|
2620
|
-
style: fe(
|
|
2621
|
-
}, [...
|
|
2668
|
+
style: fe(J.value)
|
|
2669
|
+
}, [...P[2] || (P[2] = [
|
|
2622
2670
|
a("div", { class: "yimage-loading-content" }, [
|
|
2623
2671
|
a("div", { class: "yimage-spinner" })
|
|
2624
2672
|
], -1)
|
|
2625
|
-
])], 4)) :
|
|
2626
|
-
|
|
2673
|
+
])], 4)) : W("", !0),
|
|
2674
|
+
x.value ? (r(), c("div", {
|
|
2627
2675
|
key: 2,
|
|
2628
2676
|
class: "yimage-error",
|
|
2629
|
-
style: fe(
|
|
2677
|
+
style: fe(J.value),
|
|
2630
2678
|
onClick: K
|
|
2631
2679
|
}, [
|
|
2632
2680
|
a("img", {
|
|
2633
2681
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2634
2682
|
alt: "Error Image",
|
|
2635
2683
|
class: "yimage-error-image",
|
|
2636
|
-
style: fe(
|
|
2684
|
+
style: fe(J.value)
|
|
2637
2685
|
}, null, 4)
|
|
2638
|
-
], 4)) :
|
|
2686
|
+
], 4)) : W("", !0),
|
|
2639
2687
|
Ve(a("img", {
|
|
2640
2688
|
ref_key: "imageRef",
|
|
2641
2689
|
ref: o,
|
|
2642
2690
|
src: C.value,
|
|
2643
2691
|
alt: e.alt,
|
|
2644
|
-
class:
|
|
2692
|
+
class: j(re.value),
|
|
2645
2693
|
onLoad: B,
|
|
2646
|
-
onError:
|
|
2694
|
+
onError: Q,
|
|
2647
2695
|
onClick: ne(s, ["stop"]),
|
|
2648
2696
|
style: fe(se.value)
|
|
2649
|
-
}, null, 46,
|
|
2650
|
-
[
|
|
2697
|
+
}, null, 46, Qn), [
|
|
2698
|
+
[Pe, w.value && !x.value]
|
|
2651
2699
|
]),
|
|
2652
|
-
l.preview && (!w.value ||
|
|
2700
|
+
l.preview && (!w.value || I.value || x.value || !p.value) ? (r(), c("div", {
|
|
2653
2701
|
key: 3,
|
|
2654
2702
|
class: "yimage-preview-trigger",
|
|
2655
2703
|
onClick: ne(s, ["stop"])
|
|
2656
|
-
})) :
|
|
2657
|
-
|
|
2704
|
+
})) : W("", !0),
|
|
2705
|
+
G.value ? (r(), Ne(Xe, {
|
|
2658
2706
|
key: 4,
|
|
2659
2707
|
to: "body"
|
|
2660
2708
|
}, [
|
|
2661
2709
|
be(He, { name: "fade" }, {
|
|
2662
2710
|
default: pe(() => [
|
|
2663
|
-
d.value ? (
|
|
2711
|
+
d.value ? (r(), c("div", {
|
|
2664
2712
|
key: 0,
|
|
2665
2713
|
class: "yimage-preview-mask",
|
|
2666
2714
|
onClick: ne(y, ["self"]),
|
|
2667
2715
|
onWheel: ne(b, ["prevent"])
|
|
2668
2716
|
}, [
|
|
2669
2717
|
a("div", {
|
|
2670
|
-
class:
|
|
2718
|
+
class: j(["yimage-preview-content", { "is-active": d.value }])
|
|
2671
2719
|
}, [
|
|
2672
2720
|
a("img", {
|
|
2673
2721
|
ref_key: "previewImageRef",
|
|
@@ -2675,19 +2723,19 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2675
2723
|
src: ke.value,
|
|
2676
2724
|
alt: e.alt,
|
|
2677
2725
|
class: "yimage-preview-image",
|
|
2678
|
-
style: fe({ transform: `scale(${
|
|
2679
|
-
onClick:
|
|
2726
|
+
style: fe({ transform: `scale(${Z.value})` }),
|
|
2727
|
+
onClick: P[0] || (P[0] = ne(() => {
|
|
2680
2728
|
}, ["stop"]))
|
|
2681
|
-
}, null, 12,
|
|
2729
|
+
}, null, 12, Jn)
|
|
2682
2730
|
], 2)
|
|
2683
|
-
], 32)) :
|
|
2731
|
+
], 32)) : W("", !0)
|
|
2684
2732
|
]),
|
|
2685
2733
|
_: 1
|
|
2686
2734
|
})
|
|
2687
|
-
])) :
|
|
2735
|
+
])) : W("", !0)
|
|
2688
2736
|
], 2));
|
|
2689
2737
|
}
|
|
2690
|
-
}),
|
|
2738
|
+
}), ea = /* @__PURE__ */ $e(Xn, [["__scopeId", "data-v-00c771d6"]]), ta = /* @__PURE__ */ De({
|
|
2691
2739
|
__name: "ydropdown",
|
|
2692
2740
|
props: {
|
|
2693
2741
|
trigger: { default: "hover" },
|
|
@@ -2696,9 +2744,9 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2696
2744
|
menuWidth: { default: void 0 }
|
|
2697
2745
|
},
|
|
2698
2746
|
setup(e) {
|
|
2699
|
-
const m = e, t =
|
|
2700
|
-
let
|
|
2701
|
-
const h =
|
|
2747
|
+
const m = e, t = N(!1), l = N();
|
|
2748
|
+
let f = null;
|
|
2749
|
+
const h = F(() => `y-dropdown__menu--${m.placement}`), o = F(() => {
|
|
2702
2750
|
if (!m.menuWidth) return {};
|
|
2703
2751
|
const d = typeof m.menuWidth == "number" ? `${m.menuWidth}px` : m.menuWidth;
|
|
2704
2752
|
return {
|
|
@@ -2707,61 +2755,61 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2707
2755
|
maxWidth: d
|
|
2708
2756
|
};
|
|
2709
2757
|
}), $ = () => {
|
|
2710
|
-
console.log("显示下拉菜单", t.value), !m.disabled && (
|
|
2711
|
-
|
|
2758
|
+
console.log("显示下拉菜单", t.value), !m.disabled && (f && (clearTimeout(f), f = null), t.value = !0, console.log("设置 visible 为 true", t.value), ie(() => {
|
|
2759
|
+
I();
|
|
2712
2760
|
}));
|
|
2713
2761
|
}, w = () => {
|
|
2714
|
-
console.log("隐藏下拉菜单"),
|
|
2762
|
+
console.log("隐藏下拉菜单"), f = setTimeout(() => {
|
|
2715
2763
|
t.value = !1, console.log("设置 visible 为 false", t.value);
|
|
2716
2764
|
}, 150);
|
|
2717
|
-
},
|
|
2765
|
+
}, I = () => {
|
|
2718
2766
|
if (!l.value) return;
|
|
2719
2767
|
const d = l.value.querySelector(".y-dropdown__trigger"), C = l.value.querySelector(".y-dropdown__menu");
|
|
2720
2768
|
if (!d || !C) return;
|
|
2721
|
-
const
|
|
2769
|
+
const _ = d.getBoundingClientRect(), Z = C.getBoundingClientRect(), G = window.innerWidth, A = window.innerHeight;
|
|
2722
2770
|
C.style.top = "", C.style.left = "", C.style.right = "", C.style.bottom = "", C.style.transform = "";
|
|
2723
|
-
let
|
|
2771
|
+
let U = 0, O = 0;
|
|
2724
2772
|
switch (m.placement) {
|
|
2725
2773
|
case "bottom":
|
|
2726
|
-
|
|
2774
|
+
U = _.height + 4, O = 0;
|
|
2727
2775
|
break;
|
|
2728
2776
|
case "top":
|
|
2729
|
-
|
|
2777
|
+
U = -(Z.height + 4), O = 0;
|
|
2730
2778
|
break;
|
|
2731
2779
|
case "right":
|
|
2732
|
-
|
|
2780
|
+
U = 0, O = _.width + 4;
|
|
2733
2781
|
break;
|
|
2734
2782
|
case "left":
|
|
2735
|
-
|
|
2783
|
+
U = 0, O = -(Z.width + 4);
|
|
2736
2784
|
break;
|
|
2737
2785
|
}
|
|
2738
|
-
let
|
|
2786
|
+
let X = _.top + U, J = _.left + O;
|
|
2739
2787
|
if (m.placement === "bottom" || m.placement === "top") {
|
|
2740
|
-
const re =
|
|
2741
|
-
|
|
2788
|
+
const re = Z.width || 260;
|
|
2789
|
+
J + re > G - 10 && (J = G - re - 10), J < 10 && (J = 10);
|
|
2742
2790
|
}
|
|
2743
2791
|
if (m.placement === "left" || m.placement === "right") {
|
|
2744
|
-
const re =
|
|
2745
|
-
|
|
2792
|
+
const re = Z.height || 200;
|
|
2793
|
+
X + re > A - 10 && (X = A - re - 10), X < 10 && (X = 10);
|
|
2746
2794
|
}
|
|
2747
|
-
C.style.top = `${
|
|
2748
|
-
},
|
|
2795
|
+
C.style.top = `${X}px`, C.style.left = `${J}px`;
|
|
2796
|
+
}, x = (d) => {
|
|
2749
2797
|
m.trigger === "click" && l.value && !l.value.contains(d.target) && (t.value = !1);
|
|
2750
2798
|
}, p = () => {
|
|
2751
|
-
t.value &&
|
|
2799
|
+
t.value && I();
|
|
2752
2800
|
};
|
|
2753
|
-
return
|
|
2754
|
-
m.trigger === "click" && document.addEventListener("click",
|
|
2801
|
+
return ze(() => {
|
|
2802
|
+
m.trigger === "click" && document.addEventListener("click", x), window.addEventListener("resize", p), window.addEventListener("scroll", p);
|
|
2755
2803
|
}), Ke(() => {
|
|
2756
|
-
m.trigger === "click" && document.removeEventListener("click",
|
|
2804
|
+
m.trigger === "click" && document.removeEventListener("click", x), f && clearTimeout(f), window.removeEventListener("resize", p), window.removeEventListener("scroll", p);
|
|
2757
2805
|
}), ae(
|
|
2758
2806
|
() => m.menuWidth,
|
|
2759
2807
|
() => {
|
|
2760
2808
|
t.value && ie(() => {
|
|
2761
|
-
|
|
2809
|
+
I();
|
|
2762
2810
|
});
|
|
2763
2811
|
}
|
|
2764
|
-
), (d, C) => (
|
|
2812
|
+
), (d, C) => (r(), c("div", {
|
|
2765
2813
|
class: "y-dropdown",
|
|
2766
2814
|
ref_key: "dropdownRef",
|
|
2767
2815
|
ref: l
|
|
@@ -2781,7 +2829,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2781
2829
|
}, {
|
|
2782
2830
|
default: pe(() => [
|
|
2783
2831
|
Ve(a("div", {
|
|
2784
|
-
class:
|
|
2832
|
+
class: j(["y-dropdown__menu", h.value]),
|
|
2785
2833
|
style: fe(o.value),
|
|
2786
2834
|
onMouseenter: $,
|
|
2787
2835
|
onMouseleave: w
|
|
@@ -2792,20 +2840,20 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2792
2840
|
C[3] || (C[3] = a("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2793
2841
|
], !0)
|
|
2794
2842
|
], 38), [
|
|
2795
|
-
[
|
|
2843
|
+
[Pe, t.value]
|
|
2796
2844
|
])
|
|
2797
2845
|
]),
|
|
2798
2846
|
_: 3
|
|
2799
2847
|
})
|
|
2800
2848
|
], 512));
|
|
2801
2849
|
}
|
|
2802
|
-
}),
|
|
2850
|
+
}), la = /* @__PURE__ */ $e(ta, [["__scopeId", "data-v-ada3172a"]]), na = ["aria-hidden"], aa = ["onKeydown"], oa = {
|
|
2803
2851
|
key: 0,
|
|
2804
2852
|
class: "y-drawer-header"
|
|
2805
|
-
},
|
|
2853
|
+
}, sa = { class: "y-drawer-title" }, ia = { class: "y-drawer-body" }, ra = {
|
|
2806
2854
|
key: 1,
|
|
2807
2855
|
class: "y-drawer-footer"
|
|
2808
|
-
},
|
|
2856
|
+
}, ua = /* @__PURE__ */ De({
|
|
2809
2857
|
__name: "ydrawer",
|
|
2810
2858
|
props: {
|
|
2811
2859
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2820,52 +2868,52 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2820
2868
|
},
|
|
2821
2869
|
emits: ["update:modelValue", "open", "close"],
|
|
2822
2870
|
setup(e, { emit: m }) {
|
|
2823
|
-
const t = e, l = m,
|
|
2871
|
+
const t = e, l = m, f = F({
|
|
2824
2872
|
get: () => t.modelValue,
|
|
2825
2873
|
set: (C) => l("update:modelValue", C)
|
|
2826
|
-
}), h =
|
|
2874
|
+
}), h = N(null), o = F(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), $ = F(() => t.placement === "right" ? "rounded-left" : "rounded-top"), w = F(() => {
|
|
2827
2875
|
const C = {};
|
|
2828
2876
|
return t.placement === "right" ? (C.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), C.height = "100%", C.right = "0", C.top = "0") : (C.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), C.width = "100%", C.bottom = "0", C.left = "0"), C;
|
|
2829
2877
|
});
|
|
2830
|
-
function
|
|
2831
|
-
t.maskClosable &&
|
|
2878
|
+
function I() {
|
|
2879
|
+
t.maskClosable && x();
|
|
2832
2880
|
}
|
|
2833
|
-
function
|
|
2834
|
-
|
|
2881
|
+
function x() {
|
|
2882
|
+
f.value && (f.value = !1, l("close"));
|
|
2835
2883
|
}
|
|
2836
2884
|
function p() {
|
|
2837
|
-
t.closable &&
|
|
2885
|
+
t.closable && x();
|
|
2838
2886
|
}
|
|
2839
2887
|
function d(C) {
|
|
2840
2888
|
C.key === "Escape" && p();
|
|
2841
2889
|
}
|
|
2842
2890
|
return ae(() => t.modelValue, (C) => {
|
|
2843
2891
|
C ? (l("open"), requestAnimationFrame(() => {
|
|
2844
|
-
var
|
|
2845
|
-
return (
|
|
2892
|
+
var _;
|
|
2893
|
+
return (_ = h.value) == null ? void 0 : _.focus();
|
|
2846
2894
|
}), document.addEventListener("keydown", d), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", d), document.body.style.overflow = "");
|
|
2847
|
-
}),
|
|
2895
|
+
}), ze(() => {
|
|
2848
2896
|
t.modelValue && (document.addEventListener("keydown", d), document.body.style.overflow = "hidden");
|
|
2849
2897
|
}), Ke(() => {
|
|
2850
2898
|
document.removeEventListener("keydown", d), document.body.style.overflow = "";
|
|
2851
|
-
}), (C,
|
|
2899
|
+
}), (C, _) => (r(), Ne(Xe, { to: "body" }, [
|
|
2852
2900
|
Ve(a("div", {
|
|
2853
2901
|
class: "y-drawer-root",
|
|
2854
2902
|
role: "dialog",
|
|
2855
2903
|
"aria-modal": !0,
|
|
2856
|
-
"aria-hidden": !
|
|
2904
|
+
"aria-hidden": !f.value,
|
|
2857
2905
|
style: fe({ zIndex: String(e.zIndex) })
|
|
2858
2906
|
}, [
|
|
2859
2907
|
a("div", {
|
|
2860
2908
|
class: "y-drawer-mask",
|
|
2861
|
-
onClick:
|
|
2909
|
+
onClick: I
|
|
2862
2910
|
}),
|
|
2863
2911
|
be(He, { name: o.value }, {
|
|
2864
2912
|
default: pe(() => [
|
|
2865
2913
|
Ve(a("div", {
|
|
2866
2914
|
ref_key: "panelRef",
|
|
2867
2915
|
ref: h,
|
|
2868
|
-
class:
|
|
2916
|
+
class: j(["y-drawer-panel", [
|
|
2869
2917
|
`is-${e.placement}`,
|
|
2870
2918
|
$.value
|
|
2871
2919
|
]]),
|
|
@@ -2873,52 +2921,52 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2873
2921
|
onKeydown: Me(ne(p, ["prevent", "stop"]), ["esc"]),
|
|
2874
2922
|
tabindex: "-1"
|
|
2875
2923
|
}, [
|
|
2876
|
-
e.showHeader ? (
|
|
2877
|
-
a("div",
|
|
2878
|
-
e.closable ? (
|
|
2924
|
+
e.showHeader ? (r(), c("div", oa, [
|
|
2925
|
+
a("div", sa, oe(e.title), 1),
|
|
2926
|
+
e.closable ? (r(), c("button", {
|
|
2879
2927
|
key: 0,
|
|
2880
2928
|
type: "button",
|
|
2881
2929
|
class: "y-drawer-close",
|
|
2882
2930
|
"aria-label": "Close",
|
|
2883
|
-
onClick:
|
|
2884
|
-
}, " ✕ ")) :
|
|
2885
|
-
])) :
|
|
2886
|
-
a("div",
|
|
2931
|
+
onClick: x
|
|
2932
|
+
}, " ✕ ")) : W("", !0)
|
|
2933
|
+
])) : W("", !0),
|
|
2934
|
+
a("div", ia, [
|
|
2887
2935
|
ve(C.$slots, "default", {}, void 0, !0)
|
|
2888
2936
|
]),
|
|
2889
|
-
C.$slots.footer ? (
|
|
2937
|
+
C.$slots.footer ? (r(), c("div", ra, [
|
|
2890
2938
|
ve(C.$slots, "footer", {}, void 0, !0)
|
|
2891
|
-
])) :
|
|
2892
|
-
], 46,
|
|
2893
|
-
[
|
|
2939
|
+
])) : W("", !0)
|
|
2940
|
+
], 46, aa), [
|
|
2941
|
+
[Pe, f.value]
|
|
2894
2942
|
])
|
|
2895
2943
|
]),
|
|
2896
2944
|
_: 3
|
|
2897
2945
|
}, 8, ["name"])
|
|
2898
|
-
], 12,
|
|
2899
|
-
[
|
|
2946
|
+
], 12, na), [
|
|
2947
|
+
[Pe, f.value]
|
|
2900
2948
|
])
|
|
2901
2949
|
]));
|
|
2902
2950
|
}
|
|
2903
|
-
}),
|
|
2951
|
+
}), da = /* @__PURE__ */ $e(ua, [["__scopeId", "data-v-b2797950"]]), ca = ["data-level"], fa = {
|
|
2904
2952
|
key: 1,
|
|
2905
2953
|
class: "ytree-node__expand-icon--empty"
|
|
2906
|
-
},
|
|
2954
|
+
}, va = {
|
|
2907
2955
|
key: 0,
|
|
2908
2956
|
width: "12",
|
|
2909
2957
|
height: "12",
|
|
2910
2958
|
viewBox: "0 0 12 12",
|
|
2911
2959
|
fill: "none"
|
|
2912
|
-
},
|
|
2960
|
+
}, ha = {
|
|
2913
2961
|
key: 1,
|
|
2914
2962
|
width: "12",
|
|
2915
2963
|
height: "12",
|
|
2916
2964
|
viewBox: "0 0 12 12",
|
|
2917
2965
|
fill: "none"
|
|
2918
|
-
},
|
|
2966
|
+
}, ga = ["src", "alt"], pa = { class: "ytree-node__custom-content" }, ya = {
|
|
2919
2967
|
key: 0,
|
|
2920
2968
|
class: "ytree-node__children"
|
|
2921
|
-
},
|
|
2969
|
+
}, ma = /* @__PURE__ */ De({
|
|
2922
2970
|
__name: "ytree-node",
|
|
2923
2971
|
props: {
|
|
2924
2972
|
node: {},
|
|
@@ -2937,28 +2985,28 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2937
2985
|
},
|
|
2938
2986
|
setup(e) {
|
|
2939
2987
|
we("treeStore");
|
|
2940
|
-
const m = we("getNodeKey"), t = we("getNodeLabel"), l = we("getNodeChildren"),
|
|
2941
|
-
function
|
|
2942
|
-
return
|
|
2988
|
+
const m = we("getNodeKey"), t = we("getNodeLabel"), l = we("getNodeChildren"), f = we("hasChildren"), h = we("isEmployeeNode"), o = we("getNodeIcon"), $ = we("getNodeDepth"), w = we("isChildStyleNode"), I = we("isNodeExpanded"), x = we("isNodeChecked"), p = we("isNodeIndeterminate"), d = we("isNodeCurrent"), C = we("isNodeHighlighted"), _ = we("handleExpandClick"), Z = we("handleCheckClick"), G = we("handleNodeClick"), A = we("handleNodeContextMenu");
|
|
2989
|
+
function U(O) {
|
|
2990
|
+
return O === 1 ? 8 : 8 + (O - 1) * 16;
|
|
2943
2991
|
}
|
|
2944
|
-
return (
|
|
2945
|
-
class:
|
|
2992
|
+
return (O, X) => (r(), c("div", {
|
|
2993
|
+
class: j(["ytree-node", {
|
|
2946
2994
|
"ytree-node--current": ce(d)(e.node),
|
|
2947
2995
|
"ytree-node--highlight": ce(C)(e.node)
|
|
2948
2996
|
}])
|
|
2949
2997
|
}, [
|
|
2950
2998
|
a("div", {
|
|
2951
|
-
class:
|
|
2952
|
-
style: fe({ paddingLeft: `${
|
|
2999
|
+
class: j(["ytree-node__content", { "is-child-style": ce(w)(e.node, e.rootNode) }]),
|
|
3000
|
+
style: fe({ paddingLeft: `${U(e.level)}px` }),
|
|
2953
3001
|
"data-level": ce($)(e.rootNode, e.node),
|
|
2954
|
-
onClick:
|
|
2955
|
-
onContextmenu:
|
|
3002
|
+
onClick: X[2] || (X[2] = (J) => ce(G)(e.node, e.node, null, e.rootNode)),
|
|
3003
|
+
onContextmenu: X[3] || (X[3] = (J) => ce(A)(J, e.node, e.node, null))
|
|
2956
3004
|
}, [
|
|
2957
|
-
ce(
|
|
3005
|
+
ce(f)(e.node) ? (r(), c("span", {
|
|
2958
3006
|
key: 0,
|
|
2959
|
-
class:
|
|
2960
|
-
onClick:
|
|
2961
|
-
}, [...
|
|
3007
|
+
class: j(["ytree-node__expand-icon", { "is-expanded": ce(I)(e.node) }]),
|
|
3008
|
+
onClick: X[0] || (X[0] = ne((J) => ce(_)(e.node), ["stop"]))
|
|
3009
|
+
}, [...X[4] || (X[4] = [
|
|
2962
3010
|
a("svg", {
|
|
2963
3011
|
width: "12",
|
|
2964
3012
|
height: "12",
|
|
@@ -2973,16 +3021,16 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2973
3021
|
"stroke-linejoin": "round"
|
|
2974
3022
|
})
|
|
2975
3023
|
], -1)
|
|
2976
|
-
])], 2)) : (
|
|
2977
|
-
e.showCheckbox ? (
|
|
3024
|
+
])], 2)) : (r(), c("span", fa)),
|
|
3025
|
+
e.showCheckbox ? (r(), c("span", {
|
|
2978
3026
|
key: 2,
|
|
2979
|
-
class:
|
|
2980
|
-
"is-checked": ce(
|
|
3027
|
+
class: j(["ytree-node__checkbox", {
|
|
3028
|
+
"is-checked": ce(x)(e.node),
|
|
2981
3029
|
"is-indeterminate": ce(p)(e.node)
|
|
2982
3030
|
}]),
|
|
2983
|
-
onClick:
|
|
3031
|
+
onClick: X[1] || (X[1] = ne((J) => ce(Z)(e.node), ["stop"]))
|
|
2984
3032
|
}, [
|
|
2985
|
-
ce(
|
|
3033
|
+
ce(x)(e.node) ? (r(), c("svg", va, [...X[5] || (X[5] = [
|
|
2986
3034
|
a("path", {
|
|
2987
3035
|
d: "M2 6L4.5 8.5L10 3",
|
|
2988
3036
|
stroke: "currentColor",
|
|
@@ -2990,42 +3038,42 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
2990
3038
|
"stroke-linecap": "round",
|
|
2991
3039
|
"stroke-linejoin": "round"
|
|
2992
3040
|
}, null, -1)
|
|
2993
|
-
])])) : ce(p)(e.node) ? (
|
|
3041
|
+
])])) : ce(p)(e.node) ? (r(), c("svg", ha, [...X[6] || (X[6] = [
|
|
2994
3042
|
a("path", {
|
|
2995
3043
|
d: "M2 6L10 6",
|
|
2996
3044
|
stroke: "currentColor",
|
|
2997
3045
|
"stroke-width": "1.5",
|
|
2998
3046
|
"stroke-linecap": "round"
|
|
2999
3047
|
}, null, -1)
|
|
3000
|
-
])])) :
|
|
3001
|
-
], 2)) :
|
|
3002
|
-
e.iconClass ? (
|
|
3048
|
+
])])) : W("", !0)
|
|
3049
|
+
], 2)) : W("", !0),
|
|
3050
|
+
e.iconClass ? (r(), c("span", {
|
|
3003
3051
|
key: 3,
|
|
3004
|
-
class:
|
|
3005
|
-
}, null, 2)) :
|
|
3052
|
+
class: j(["ytree-node__icon", e.iconClass])
|
|
3053
|
+
}, null, 2)) : W("", !0),
|
|
3006
3054
|
a("img", {
|
|
3007
3055
|
class: "ytree-node__avatar",
|
|
3008
3056
|
src: ce(o)(e.node, e.rootNode),
|
|
3009
3057
|
alt: ce(h)(e.node) ? "person" : "dept"
|
|
3010
|
-
}, null, 8,
|
|
3058
|
+
}, null, 8, ga),
|
|
3011
3059
|
a("span", {
|
|
3012
|
-
class:
|
|
3060
|
+
class: j(["ytree-node__label", { "is-employee": ce(h)(e.node) }])
|
|
3013
3061
|
}, oe(ce(t)(e.node)), 3),
|
|
3014
|
-
a("div",
|
|
3015
|
-
ve(
|
|
3062
|
+
a("div", pa, [
|
|
3063
|
+
ve(O.$slots, "node-content", {
|
|
3016
3064
|
node: e.node,
|
|
3017
3065
|
isCurrent: ce(d)(e.node),
|
|
3018
|
-
isExpanded: ce(
|
|
3019
|
-
hasChildren: ce(
|
|
3066
|
+
isExpanded: ce(I)(e.node),
|
|
3067
|
+
hasChildren: ce(f)(e.node)
|
|
3020
3068
|
}, void 0, !0)
|
|
3021
3069
|
])
|
|
3022
|
-
], 46,
|
|
3070
|
+
], 46, ca),
|
|
3023
3071
|
be(He, { name: "ytree-node" }, {
|
|
3024
3072
|
default: pe(() => [
|
|
3025
|
-
ce(
|
|
3026
|
-
(
|
|
3027
|
-
key: ce(m)(
|
|
3028
|
-
node:
|
|
3073
|
+
ce(f)(e.node) && ce(I)(e.node) ? (r(), c("div", ya, [
|
|
3074
|
+
(r(!0), c(he, null, xe(ce(l)(e.node), (J) => (r(), Ne(Mt, {
|
|
3075
|
+
key: ce(m)(J),
|
|
3076
|
+
node: J,
|
|
3029
3077
|
"root-node": e.rootNode,
|
|
3030
3078
|
level: e.level + 1,
|
|
3031
3079
|
"show-checkbox": e.showCheckbox,
|
|
@@ -3040,17 +3088,17 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3040
3088
|
"expand-on-click-node": e.expandOnClickNode
|
|
3041
3089
|
}, {
|
|
3042
3090
|
"node-content": pe((re) => [
|
|
3043
|
-
ve(
|
|
3091
|
+
ve(O.$slots, "node-content", ht({ ref_for: !0 }, re), void 0, !0)
|
|
3044
3092
|
]),
|
|
3045
3093
|
_: 3
|
|
3046
3094
|
}, 8, ["node", "root-node", "level", "show-checkbox", "icon-class", "dept-icon-url", "person-icon-url", "button-icon-url", "child-style-level", "child-style-icon-url", "enable-child-style-custom-click", "disabled", "expand-on-click-node"]))), 128))
|
|
3047
|
-
])) :
|
|
3095
|
+
])) : W("", !0)
|
|
3048
3096
|
]),
|
|
3049
3097
|
_: 3
|
|
3050
3098
|
})
|
|
3051
3099
|
], 2));
|
|
3052
3100
|
}
|
|
3053
|
-
}), Mt = /* @__PURE__ */ $e(
|
|
3101
|
+
}), Mt = /* @__PURE__ */ $e(ma, [["__scopeId", "data-v-14a0837c"]]), wa = { class: "ytree__container" }, ba = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", ka = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", Ca = /* @__PURE__ */ De({
|
|
3054
3102
|
__name: "ytree",
|
|
3055
3103
|
props: {
|
|
3056
3104
|
data: { default: () => [] },
|
|
@@ -3099,7 +3147,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3099
3147
|
},
|
|
3100
3148
|
emits: ["node-click", "node-contextmenu", "check-change", "check", "current-change", "node-expand", "node-collapse", "node-drag-start", "node-drag-enter", "node-drag-leave", "node-drag-over", "node-drag-end", "node-drop", "checked-keys-change", "child-node-click"],
|
|
3101
3149
|
setup(e, { expose: m, emit: t }) {
|
|
3102
|
-
const l = e,
|
|
3150
|
+
const l = e, f = t, h = F(() => (console.log("ytree 组件接收到的数据:", l.data), l.data || [])), o = N({
|
|
3103
3151
|
currentNode: null,
|
|
3104
3152
|
currentKey: null,
|
|
3105
3153
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -3107,57 +3155,57 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3107
3155
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
3108
3156
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
3109
3157
|
});
|
|
3110
|
-
me("treeStore", o), me("getNodeKey", w), me("getNodeLabel",
|
|
3111
|
-
const $ =
|
|
3158
|
+
me("treeStore", o), me("getNodeKey", w), me("getNodeLabel", I), me("getNodeChildren", C), me("hasChildren", d), me("isEmployeeNode", x), me("getNodeIcon", p), me("getNodeDepth", _), me("isChildStyleNode", Z), me("isNodeExpanded", G), me("isNodeChecked", A), me("isNodeIndeterminate", U), me("isNodeCurrent", O), me("isNodeHighlighted", X), me("handleExpandClick", se), me("handleCheckClick", J), me("handleNodeClick", E), me("handleNodeContextMenu", V);
|
|
3159
|
+
const $ = F(() => l.restrictAutoExpandFromLevel && l.restrictAutoExpandFromLevel > 0 ? l.restrictAutoExpandFromLevel : void 0);
|
|
3112
3160
|
function w(g) {
|
|
3113
3161
|
return g[l.nodeKey] || g.id || Math.random();
|
|
3114
3162
|
}
|
|
3115
|
-
function
|
|
3116
|
-
var
|
|
3117
|
-
return ((
|
|
3163
|
+
function I(g) {
|
|
3164
|
+
var D;
|
|
3165
|
+
return ((D = l.props) != null && D.label ? g[l.props.label] : void 0) || g.label || "";
|
|
3118
3166
|
}
|
|
3119
|
-
function
|
|
3120
|
-
var
|
|
3121
|
-
return !!((
|
|
3167
|
+
function x(g) {
|
|
3168
|
+
var D;
|
|
3169
|
+
return !!((D = g == null ? void 0 : g.data) != null && D.isEmployee);
|
|
3122
3170
|
}
|
|
3123
|
-
function p(g,
|
|
3124
|
-
var
|
|
3125
|
-
const K = l.deptIconUrl ||
|
|
3126
|
-
return
|
|
3171
|
+
function p(g, D) {
|
|
3172
|
+
var z;
|
|
3173
|
+
const K = l.deptIconUrl || ba, s = l.personIconUrl || ka, y = l.buttonIconUrl || "", b = l.childStyleIconUrl || "";
|
|
3174
|
+
return D && b && Z(g, D) ? b : (z = g == null ? void 0 : g.data) != null && z.isButton && y ? y : x(g) ? s : K;
|
|
3127
3175
|
}
|
|
3128
3176
|
function d(g) {
|
|
3129
3177
|
var K;
|
|
3130
|
-
const
|
|
3131
|
-
return
|
|
3178
|
+
const D = ((K = l.props) != null && K.children ? g[l.props.children] : void 0) || g.children;
|
|
3179
|
+
return D && D.length > 0;
|
|
3132
3180
|
}
|
|
3133
3181
|
function C(g) {
|
|
3134
|
-
var
|
|
3135
|
-
return ((
|
|
3182
|
+
var D;
|
|
3183
|
+
return ((D = l.props) != null && D.children ? g[l.props.children] : void 0) || g.children || [];
|
|
3136
3184
|
}
|
|
3137
|
-
function
|
|
3138
|
-
if (g ===
|
|
3185
|
+
function _(g, D, K = 1) {
|
|
3186
|
+
if (g === D)
|
|
3139
3187
|
return K;
|
|
3140
3188
|
const s = C(g);
|
|
3141
3189
|
for (const y of s) {
|
|
3142
|
-
const b =
|
|
3190
|
+
const b = _(y, D, K + 1);
|
|
3143
3191
|
if (b > 0)
|
|
3144
3192
|
return b;
|
|
3145
3193
|
}
|
|
3146
3194
|
return 0;
|
|
3147
3195
|
}
|
|
3148
|
-
function
|
|
3149
|
-
return !l.childStyleLevel || l.childStyleLevel < 1 ? !1 :
|
|
3196
|
+
function Z(g, D) {
|
|
3197
|
+
return !l.childStyleLevel || l.childStyleLevel < 1 ? !1 : _(D, g) === l.childStyleLevel;
|
|
3150
3198
|
}
|
|
3151
|
-
function
|
|
3152
|
-
const
|
|
3153
|
-
return o.value.expandedKeys.has(
|
|
3199
|
+
function G(g) {
|
|
3200
|
+
const D = w(g);
|
|
3201
|
+
return o.value.expandedKeys.has(D);
|
|
3154
3202
|
}
|
|
3155
|
-
function
|
|
3156
|
-
const
|
|
3157
|
-
if (o.value.checkedKeys.has(
|
|
3203
|
+
function A(g) {
|
|
3204
|
+
const D = w(g);
|
|
3205
|
+
if (o.value.checkedKeys.has(D)) {
|
|
3158
3206
|
if (d(g)) {
|
|
3159
|
-
const s = C(g), y = s.filter((
|
|
3160
|
-
(
|
|
3207
|
+
const s = C(g), y = s.filter((z) => A(z)), b = s.filter(
|
|
3208
|
+
(z) => U(z)
|
|
3161
3209
|
);
|
|
3162
3210
|
return y.length === s.length && b.length === 0;
|
|
3163
3211
|
}
|
|
@@ -3166,37 +3214,37 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3166
3214
|
if (d(g)) {
|
|
3167
3215
|
const s = C(g);
|
|
3168
3216
|
return s.some(
|
|
3169
|
-
(b) =>
|
|
3170
|
-
) ? !1 : s.length > 0 && s.every((b) =>
|
|
3217
|
+
(b) => U(b)
|
|
3218
|
+
) ? !1 : s.length > 0 && s.every((b) => A(b));
|
|
3171
3219
|
}
|
|
3172
3220
|
return !1;
|
|
3173
3221
|
}
|
|
3174
|
-
function
|
|
3222
|
+
function U(g) {
|
|
3175
3223
|
if (!d(g)) return !1;
|
|
3176
|
-
const
|
|
3177
|
-
(y) =>
|
|
3224
|
+
const D = C(g), K = D.filter((y) => A(y)), s = D.filter(
|
|
3225
|
+
(y) => U(y)
|
|
3178
3226
|
);
|
|
3179
|
-
return K.length ===
|
|
3227
|
+
return K.length === D.length ? !1 : K.length > 0 || s.length > 0;
|
|
3180
3228
|
}
|
|
3181
|
-
function
|
|
3182
|
-
const
|
|
3183
|
-
return o.value.currentKey ===
|
|
3229
|
+
function O(g) {
|
|
3230
|
+
const D = w(g);
|
|
3231
|
+
return o.value.currentKey === D;
|
|
3184
3232
|
}
|
|
3185
|
-
function
|
|
3186
|
-
const
|
|
3187
|
-
return o.value.highlightedKeys.has(
|
|
3233
|
+
function X(g) {
|
|
3234
|
+
const D = w(g);
|
|
3235
|
+
return o.value.highlightedKeys.has(D);
|
|
3188
3236
|
}
|
|
3189
|
-
function
|
|
3237
|
+
function J(g) {
|
|
3190
3238
|
if (l.disabled) return;
|
|
3191
|
-
const
|
|
3192
|
-
s ? o.value.checkedKeys.add(
|
|
3193
|
-
function b(
|
|
3194
|
-
|
|
3195
|
-
const le = w(
|
|
3196
|
-
S ? o.value.checkedKeys.add(le) : o.value.checkedKeys.delete(le), d(
|
|
3239
|
+
const D = w(g), s = !o.value.checkedKeys.has(D), y = new Set(o.value.expandedKeys);
|
|
3240
|
+
s ? o.value.checkedKeys.add(D) : o.value.checkedKeys.delete(D);
|
|
3241
|
+
function b(z, S) {
|
|
3242
|
+
z.forEach((P) => {
|
|
3243
|
+
const le = w(P);
|
|
3244
|
+
S ? o.value.checkedKeys.add(le) : o.value.checkedKeys.delete(le), d(P) && b(C(P), S);
|
|
3197
3245
|
});
|
|
3198
3246
|
}
|
|
3199
|
-
b(C(g), s), s && re(), ke(), o.value.expandedKeys = y,
|
|
3247
|
+
b(C(g), s), s && re(), ke(), o.value.expandedKeys = y, f("check-change", g, s, !1), f("check", g, s, !1), f("checked-keys-change", Array.from(o.value.checkedKeys));
|
|
3200
3248
|
}
|
|
3201
3249
|
function re(g) {
|
|
3202
3250
|
$.value && console.log(
|
|
@@ -3204,70 +3252,70 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3204
3252
|
);
|
|
3205
3253
|
}
|
|
3206
3254
|
function se(g) {
|
|
3207
|
-
const
|
|
3208
|
-
o.value.expandedKeys.has(
|
|
3255
|
+
const D = w(g);
|
|
3256
|
+
o.value.expandedKeys.has(D) ? (o.value.expandedKeys.delete(D), f("node-collapse", g, g, null)) : (o.value.expandedKeys.add(D), f("node-expand", g, g, null));
|
|
3209
3257
|
}
|
|
3210
3258
|
function ke() {
|
|
3211
3259
|
const g = [];
|
|
3212
|
-
function
|
|
3260
|
+
function D(s) {
|
|
3213
3261
|
s.forEach((y) => {
|
|
3214
|
-
g.push(y), d(y) &&
|
|
3262
|
+
g.push(y), d(y) && D(C(y));
|
|
3215
3263
|
});
|
|
3216
3264
|
}
|
|
3217
|
-
|
|
3265
|
+
D(h.value);
|
|
3218
3266
|
function K(s) {
|
|
3219
3267
|
if (d(s)) {
|
|
3220
|
-
const y = C(s), b = w(s),
|
|
3221
|
-
(
|
|
3268
|
+
const y = C(s), b = w(s), z = y.filter((P) => A(P)), S = y.filter(
|
|
3269
|
+
(P) => U(P)
|
|
3222
3270
|
);
|
|
3223
|
-
|
|
3271
|
+
z.length === y.length && S.length === 0 || z.length > 0 || S.length > 0 ? o.value.checkedKeys.add(b) : o.value.checkedKeys.delete(b);
|
|
3224
3272
|
}
|
|
3225
3273
|
}
|
|
3226
3274
|
for (let s = g.length - 1; s >= 0; s--)
|
|
3227
3275
|
K(g[s]);
|
|
3228
3276
|
}
|
|
3229
|
-
function
|
|
3277
|
+
function E(g, D, K, s) {
|
|
3230
3278
|
if (l.disabled) return;
|
|
3231
|
-
const y = s ?
|
|
3279
|
+
const y = s ? Z(g, s) : !1;
|
|
3232
3280
|
if (l.enableChildStyleCustomClick && y) {
|
|
3233
|
-
|
|
3281
|
+
f("child-node-click", g, D, K);
|
|
3234
3282
|
return;
|
|
3235
3283
|
}
|
|
3236
3284
|
if (l.expandOnClickNode && d(g)) {
|
|
3237
3285
|
se(g);
|
|
3238
3286
|
return;
|
|
3239
3287
|
}
|
|
3240
|
-
o.value.currentNode = g, o.value.currentKey = w(g), l.showCheckbox &&
|
|
3288
|
+
o.value.currentNode = g, o.value.currentKey = w(g), l.showCheckbox && J(g), f("node-click", g, D, K);
|
|
3241
3289
|
}
|
|
3242
|
-
function
|
|
3243
|
-
l.disabled ||
|
|
3290
|
+
function V(g, D, K, s) {
|
|
3291
|
+
l.disabled || f("node-contextmenu", g, D, K, s);
|
|
3244
3292
|
}
|
|
3245
3293
|
ae(
|
|
3246
3294
|
() => l.defaultExpandedKeys,
|
|
3247
3295
|
(g) => {
|
|
3248
3296
|
if (g) {
|
|
3249
|
-
const
|
|
3250
|
-
if (
|
|
3251
|
-
let K = function(
|
|
3297
|
+
const D = $.value;
|
|
3298
|
+
if (D) {
|
|
3299
|
+
let K = function(z, S, P = 1) {
|
|
3252
3300
|
for (const le of S) {
|
|
3253
|
-
if (w(le) ===
|
|
3301
|
+
if (w(le) === z) return P;
|
|
3254
3302
|
if (d(le)) {
|
|
3255
|
-
const Ce = K(
|
|
3303
|
+
const Ce = K(z, C(le), P + 1);
|
|
3256
3304
|
if (Ce > 0) return Ce;
|
|
3257
3305
|
}
|
|
3258
3306
|
}
|
|
3259
3307
|
return 0;
|
|
3260
|
-
}, s = function(
|
|
3261
|
-
|
|
3262
|
-
S <
|
|
3308
|
+
}, s = function(z, S, P) {
|
|
3309
|
+
z.forEach((le) => {
|
|
3310
|
+
S < P && d(le) ? (b.add(w(le)), s(C(le), S + 1, P)) : S < P && d(le);
|
|
3263
3311
|
});
|
|
3264
3312
|
};
|
|
3265
|
-
const y = (g || []).filter((
|
|
3266
|
-
const S = K(
|
|
3267
|
-
return S > 0 && S <
|
|
3313
|
+
const y = (g || []).filter((z) => {
|
|
3314
|
+
const S = K(z, h.value, 1);
|
|
3315
|
+
return S > 0 && S < D;
|
|
3268
3316
|
}), b = new Set(y);
|
|
3269
|
-
s(h.value, 1,
|
|
3270
|
-
K(
|
|
3317
|
+
s(h.value, 1, D), o.value.expandedKeys.forEach((z) => {
|
|
3318
|
+
K(z, h.value, 1) >= D && b.add(z);
|
|
3271
3319
|
}), o.value.expandedKeys = b;
|
|
3272
3320
|
} else
|
|
3273
3321
|
o.value.expandedKeys = new Set(g);
|
|
@@ -3280,27 +3328,27 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3280
3328
|
let g = function(s, y = 1) {
|
|
3281
3329
|
s.forEach((b) => {
|
|
3282
3330
|
if (!d(b)) return;
|
|
3283
|
-
const
|
|
3331
|
+
const z = C(b);
|
|
3284
3332
|
if (K) {
|
|
3285
3333
|
if (y >= K) return;
|
|
3286
|
-
y + 1 === K ||
|
|
3334
|
+
y + 1 === K || D.add(w(b)), g(z, y + 1);
|
|
3287
3335
|
} else
|
|
3288
|
-
|
|
3336
|
+
D.add(w(b)), g(z, y + 1);
|
|
3289
3337
|
});
|
|
3290
3338
|
};
|
|
3291
|
-
const
|
|
3292
|
-
g(h.value, 1), o.value.expandedKeys =
|
|
3339
|
+
const D = /* @__PURE__ */ new Set(), K = $.value;
|
|
3340
|
+
g(h.value, 1), o.value.expandedKeys = D;
|
|
3293
3341
|
}
|
|
3294
3342
|
}
|
|
3295
|
-
function
|
|
3343
|
+
function Y() {
|
|
3296
3344
|
if (l.defaultCheckedKeys && l.defaultCheckedKeys.length > 0) {
|
|
3297
3345
|
let g = function(y, b = []) {
|
|
3298
|
-
y.forEach((
|
|
3299
|
-
const S = w(
|
|
3300
|
-
|
|
3346
|
+
y.forEach((z) => {
|
|
3347
|
+
const S = w(z), P = [...b, S];
|
|
3348
|
+
D.has(S) && b.forEach((le) => K.add(le)), d(z) && g(C(z), P);
|
|
3301
3349
|
});
|
|
3302
3350
|
};
|
|
3303
|
-
const
|
|
3351
|
+
const D = new Set(l.defaultCheckedKeys), K = /* @__PURE__ */ new Set();
|
|
3304
3352
|
g(h.value);
|
|
3305
3353
|
const s = $.value;
|
|
3306
3354
|
if (s) {
|
|
@@ -3315,18 +3363,18 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3315
3363
|
ae(() => l.defaultExpandAll, T, { immediate: !0 }), ae(() => h.value, T, { deep: !0 }), ae(
|
|
3316
3364
|
() => l.defaultCheckedKeys,
|
|
3317
3365
|
(g) => {
|
|
3318
|
-
g ? (o.value.checkedKeys = new Set(g), l.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") :
|
|
3366
|
+
g ? (o.value.checkedKeys = new Set(g), l.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : Y()) : o.value.checkedKeys.clear();
|
|
3319
3367
|
},
|
|
3320
3368
|
{ immediate: !0 }
|
|
3321
3369
|
);
|
|
3322
3370
|
function te(g) {
|
|
3323
3371
|
try {
|
|
3324
|
-
let
|
|
3372
|
+
let D = function(y, b, z = []) {
|
|
3325
3373
|
for (const S of y) {
|
|
3326
|
-
const
|
|
3327
|
-
if (
|
|
3374
|
+
const P = w(S), le = [...z, P];
|
|
3375
|
+
if (P === b) return le;
|
|
3328
3376
|
if (d(S)) {
|
|
3329
|
-
const Ce =
|
|
3377
|
+
const Ce = D(C(S), b, le);
|
|
3330
3378
|
if (Ce) return Ce;
|
|
3331
3379
|
}
|
|
3332
3380
|
}
|
|
@@ -3337,30 +3385,30 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3337
3385
|
o.value.highlightedKeys.clear();
|
|
3338
3386
|
const s = new Set(o.value.expandedKeys);
|
|
3339
3387
|
K.forEach((y) => {
|
|
3340
|
-
const b =
|
|
3341
|
-
b && b.length > 0 && (b.slice(0, -1).forEach((
|
|
3388
|
+
const b = D(h.value, y);
|
|
3389
|
+
b && b.length > 0 && (b.slice(0, -1).forEach((z) => s.add(z)), o.value.highlightedKeys.add(b[b.length - 1]));
|
|
3342
3390
|
}), o.value.expandedKeys = s;
|
|
3343
|
-
} catch (
|
|
3344
|
-
console.warn("highlightAndExpandByIds 执行失败",
|
|
3391
|
+
} catch (D) {
|
|
3392
|
+
console.warn("highlightAndExpandByIds 执行失败", D);
|
|
3345
3393
|
}
|
|
3346
3394
|
}
|
|
3347
3395
|
function B() {
|
|
3348
3396
|
o.value.highlightedKeys.clear();
|
|
3349
3397
|
}
|
|
3350
|
-
function
|
|
3398
|
+
function Q() {
|
|
3351
3399
|
o.value.currentNode = null, o.value.currentKey = null;
|
|
3352
3400
|
}
|
|
3353
|
-
return m({ highlightAndExpandByIds: te, clearHighlights: B, clearCurrentNode:
|
|
3401
|
+
return m({ highlightAndExpandByIds: te, clearHighlights: B, clearCurrentNode: Q }), ae(
|
|
3354
3402
|
() => l.defaultSelectedKeys,
|
|
3355
3403
|
(g) => {
|
|
3356
3404
|
g && (o.value.selectedKeys = new Set(g));
|
|
3357
3405
|
},
|
|
3358
3406
|
{ immediate: !0 }
|
|
3359
|
-
), (g,
|
|
3360
|
-
class:
|
|
3407
|
+
), (g, D) => (r(), c("div", {
|
|
3408
|
+
class: j(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
3361
3409
|
}, [
|
|
3362
|
-
a("div",
|
|
3363
|
-
(
|
|
3410
|
+
a("div", wa, [
|
|
3411
|
+
(r(!0), c(he, null, xe(h.value, (K) => (r(), Ne(Mt, {
|
|
3364
3412
|
key: w(K),
|
|
3365
3413
|
node: K,
|
|
3366
3414
|
"root-node": K,
|
|
@@ -3384,13 +3432,13 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3384
3432
|
])
|
|
3385
3433
|
], 2));
|
|
3386
3434
|
}
|
|
3387
|
-
}),
|
|
3435
|
+
}), xa = /* @__PURE__ */ $e(Ca, [["__scopeId", "data-v-0596ae15"]]), Da = { class: "query-encapsulation" }, $a = { class: "query-encapsulation__container" }, Sa = { class: "query-encapsulation__content" }, Ia = { class: "query-encapsulation__fields" }, Ma = { class: "query-encapsulation__field-wrapper" }, Ea = {
|
|
3388
3436
|
key: 0,
|
|
3389
3437
|
class: "query-encapsulation__field-label"
|
|
3390
|
-
},
|
|
3438
|
+
}, La = {
|
|
3391
3439
|
key: 0,
|
|
3392
3440
|
class: "query-encapsulation__toggle"
|
|
3393
|
-
},
|
|
3441
|
+
}, Ta = { class: "query-encapsulation__actions" }, Ba = { class: "query-encapsulation__actions-group" }, Ha = /* @__PURE__ */ De({
|
|
3394
3442
|
__name: "QueryEncapsulation",
|
|
3395
3443
|
props: {
|
|
3396
3444
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3401,11 +3449,11 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3401
3449
|
},
|
|
3402
3450
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3403
3451
|
setup(e, { expose: m, emit: t }) {
|
|
3404
|
-
const l = e,
|
|
3452
|
+
const l = e, f = t, h = N(!1), o = Tt({}), $ = ["select", "date", "daterange", "switch"];
|
|
3405
3453
|
let w;
|
|
3406
|
-
const
|
|
3407
|
-
function d(
|
|
3408
|
-
switch (
|
|
3454
|
+
const I = F(() => l.fields.filter((E) => !E.hidden)), x = F(() => h.value ? I.value : I.value.slice(0, l.maxVisibleFields)), p = F(() => I.value.length > l.maxVisibleFields);
|
|
3455
|
+
function d(E) {
|
|
3456
|
+
switch (E) {
|
|
3409
3457
|
case "select":
|
|
3410
3458
|
return $t;
|
|
3411
3459
|
case "date":
|
|
@@ -3418,124 +3466,124 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3418
3466
|
return Dt;
|
|
3419
3467
|
}
|
|
3420
3468
|
}
|
|
3421
|
-
function C(
|
|
3422
|
-
o[
|
|
3423
|
-
const T = l.fields.find((
|
|
3424
|
-
T &&
|
|
3469
|
+
function C(E, V) {
|
|
3470
|
+
o[E] = V;
|
|
3471
|
+
const T = l.fields.find((Y) => Y.key === E);
|
|
3472
|
+
T && _(T);
|
|
3425
3473
|
}
|
|
3426
|
-
function
|
|
3427
|
-
|
|
3474
|
+
function _(E) {
|
|
3475
|
+
f("field-change", E, o[E.key]), f("update:modelValue", { ...o }), $.includes(E.type) && J();
|
|
3428
3476
|
}
|
|
3429
|
-
function
|
|
3430
|
-
|
|
3477
|
+
function Z(E, V) {
|
|
3478
|
+
E.onSwitchChange && typeof E.onSwitchChange == "function" && E.onSwitchChange(V, E), _(E);
|
|
3431
3479
|
}
|
|
3432
|
-
function
|
|
3433
|
-
const
|
|
3434
|
-
|
|
3480
|
+
function G() {
|
|
3481
|
+
const E = re(o), V = se(E), T = { ...o };
|
|
3482
|
+
f("search", { data: V, raw: T });
|
|
3435
3483
|
}
|
|
3436
|
-
function
|
|
3437
|
-
Object.keys(o).forEach((
|
|
3438
|
-
const
|
|
3439
|
-
(
|
|
3440
|
-
}),
|
|
3484
|
+
function A() {
|
|
3485
|
+
Object.keys(o).forEach((E) => {
|
|
3486
|
+
const V = l.fields.find((T) => T.key === E);
|
|
3487
|
+
(V == null ? void 0 : V.type) === "daterange" ? o[E] = { startDate: null, endDate: null } : (V == null ? void 0 : V.type) === "date" ? o[E] = null : (V == null ? void 0 : V.type) === "switch" ? o[E] = V.falseValue !== void 0 ? V.falseValue : !1 : (V == null ? void 0 : V.type) === "select" && V.multiple ? o[E] = [] : o[E] = "";
|
|
3488
|
+
}), f("reset"), f("update:modelValue", { ...o });
|
|
3441
3489
|
}
|
|
3442
|
-
function
|
|
3490
|
+
function U() {
|
|
3443
3491
|
h.value = !h.value;
|
|
3444
3492
|
}
|
|
3445
|
-
function
|
|
3446
|
-
return
|
|
3447
|
-
enter: () =>
|
|
3448
|
-
paste: () =>
|
|
3493
|
+
function O(E) {
|
|
3494
|
+
return E.type !== "input" ? {} : {
|
|
3495
|
+
enter: () => X(),
|
|
3496
|
+
paste: () => X()
|
|
3449
3497
|
};
|
|
3450
3498
|
}
|
|
3451
|
-
async function
|
|
3452
|
-
await ie(),
|
|
3499
|
+
async function X() {
|
|
3500
|
+
await ie(), G();
|
|
3453
3501
|
}
|
|
3454
|
-
function
|
|
3502
|
+
function J() {
|
|
3455
3503
|
w && clearTimeout(w), w = setTimeout(() => {
|
|
3456
|
-
w = void 0, ie().then(() =>
|
|
3504
|
+
w = void 0, ie().then(() => G());
|
|
3457
3505
|
}, 0);
|
|
3458
3506
|
}
|
|
3459
|
-
function re(
|
|
3460
|
-
const
|
|
3461
|
-
return Object.keys(
|
|
3462
|
-
const
|
|
3507
|
+
function re(E) {
|
|
3508
|
+
const V = {};
|
|
3509
|
+
return Object.keys(E).forEach((T) => {
|
|
3510
|
+
const Y = l.fields.find((Q) => Q.key === T), te = E[T], B = typeof te == "string" ? te.trim() : te;
|
|
3463
3511
|
if (Array.isArray(B)) {
|
|
3464
|
-
B.length > 0 && (
|
|
3512
|
+
B.length > 0 && (V[T] = B);
|
|
3465
3513
|
return;
|
|
3466
3514
|
}
|
|
3467
3515
|
if (!(B == null || B === "")) {
|
|
3468
3516
|
if (typeof B == "object" && B.startDate && B.endDate) {
|
|
3469
|
-
B.startDate && B.endDate && (
|
|
3517
|
+
B.startDate && B.endDate && (V[T] = B);
|
|
3470
3518
|
return;
|
|
3471
3519
|
}
|
|
3472
|
-
if (
|
|
3473
|
-
B !== 0 && (
|
|
3520
|
+
if (Y && (Y.type === "date" || Y.type === "daterange")) {
|
|
3521
|
+
B !== 0 && (V[T] = B);
|
|
3474
3522
|
return;
|
|
3475
3523
|
}
|
|
3476
|
-
|
|
3524
|
+
V[T] = B;
|
|
3477
3525
|
}
|
|
3478
|
-
}),
|
|
3526
|
+
}), V;
|
|
3479
3527
|
}
|
|
3480
|
-
function se(
|
|
3481
|
-
const
|
|
3482
|
-
return Object.keys(
|
|
3483
|
-
const
|
|
3528
|
+
function se(E) {
|
|
3529
|
+
const V = {};
|
|
3530
|
+
return Object.keys(E).forEach((T) => {
|
|
3531
|
+
const Y = E[T], te = l.fields.find((B) => B.key === T);
|
|
3484
3532
|
if (te)
|
|
3485
|
-
if (te.type === "daterange" && typeof
|
|
3486
|
-
const B = te.startKey || `${T}Start`,
|
|
3487
|
-
|
|
3488
|
-
} else te.type === "date" &&
|
|
3533
|
+
if (te.type === "daterange" && typeof Y == "object") {
|
|
3534
|
+
const B = te.startKey || `${T}Start`, Q = te.endKey || `${T}End`;
|
|
3535
|
+
Y.startDate && Y.endDate && Y.startDate !== 0 && Y.endDate !== 0 && (te.format === "timestamp" ? (V[B] = new Date(Y.startDate).getTime(), V[Q] = new Date(Y.endDate).getTime()) : (V[B] = Y.startDate, V[Q] = Y.endDate));
|
|
3536
|
+
} else te.type === "date" && Y && Y !== 0 && te.format === "timestamp" ? V[T] = new Date(Y).getTime() : V[T] = Y;
|
|
3489
3537
|
else
|
|
3490
|
-
|
|
3491
|
-
}),
|
|
3538
|
+
V[T] = Y;
|
|
3539
|
+
}), V;
|
|
3492
3540
|
}
|
|
3493
3541
|
function ke() {
|
|
3494
|
-
l.fields.forEach((
|
|
3495
|
-
var
|
|
3496
|
-
o[
|
|
3542
|
+
l.fields.forEach((E) => {
|
|
3543
|
+
var V, T, Y, te, B;
|
|
3544
|
+
o[E.key] === void 0 && (E.type === "daterange" ? o[E.key] = ((V = l.modelValue) == null ? void 0 : V[E.key]) || {
|
|
3497
3545
|
startDate: null,
|
|
3498
3546
|
endDate: null
|
|
3499
|
-
} :
|
|
3547
|
+
} : E.type === "date" ? o[E.key] = ((T = l.modelValue) == null ? void 0 : T[E.key]) || null : E.type === "switch" ? o[E.key] = ((Y = l.modelValue) == null ? void 0 : Y[E.key]) !== void 0 ? l.modelValue[E.key] : E.falseValue !== void 0 ? E.falseValue : !1 : E.type === "select" && E.multiple ? o[E.key] = ((te = l.modelValue) == null ? void 0 : te[E.key]) !== void 0 ? l.modelValue[E.key] : [] : o[E.key] = ((B = l.modelValue) == null ? void 0 : B[E.key]) || "");
|
|
3500
3548
|
});
|
|
3501
3549
|
}
|
|
3502
3550
|
return ae(
|
|
3503
3551
|
() => l.modelValue,
|
|
3504
|
-
(
|
|
3505
|
-
|
|
3552
|
+
(E) => {
|
|
3553
|
+
E && Object.assign(o, E);
|
|
3506
3554
|
},
|
|
3507
3555
|
{ deep: !0, immediate: !0 }
|
|
3508
|
-
),
|
|
3556
|
+
), ze(() => {
|
|
3509
3557
|
ke();
|
|
3510
3558
|
}), Ct(() => {
|
|
3511
3559
|
w && (clearTimeout(w), w = void 0);
|
|
3512
3560
|
}), m({
|
|
3513
|
-
search:
|
|
3514
|
-
reset:
|
|
3515
|
-
}), (
|
|
3516
|
-
a("div",
|
|
3517
|
-
a("div",
|
|
3518
|
-
a("div",
|
|
3561
|
+
search: G,
|
|
3562
|
+
reset: A
|
|
3563
|
+
}), (E, V) => (r(), c("div", Da, [
|
|
3564
|
+
a("div", $a, [
|
|
3565
|
+
a("div", Sa, [
|
|
3566
|
+
a("div", Ia, [
|
|
3519
3567
|
be(Bt, {
|
|
3520
3568
|
name: "qf",
|
|
3521
3569
|
tag: "div",
|
|
3522
3570
|
class: "query-encapsulation__fields-group"
|
|
3523
3571
|
}, {
|
|
3524
3572
|
default: pe(() => [
|
|
3525
|
-
(
|
|
3573
|
+
(r(!0), c(he, null, xe(x.value, (T) => (r(), c("div", {
|
|
3526
3574
|
key: T.key,
|
|
3527
3575
|
class: "query-encapsulation__field-item"
|
|
3528
3576
|
}, [
|
|
3529
|
-
ve(
|
|
3577
|
+
ve(E.$slots, `field-${T.key}`, {
|
|
3530
3578
|
field: T,
|
|
3531
3579
|
value: o[T.key],
|
|
3532
|
-
updateValue: (
|
|
3580
|
+
updateValue: (Y) => C(T.key, Y)
|
|
3533
3581
|
}, () => [
|
|
3534
|
-
a("div",
|
|
3535
|
-
e.Iflabel || T.type === "switch" ? (
|
|
3536
|
-
(
|
|
3582
|
+
a("div", Ma, [
|
|
3583
|
+
e.Iflabel || T.type === "switch" ? (r(), c("label", Ea, oe(T.label), 1)) : W("", !0),
|
|
3584
|
+
(r(), Ne(Ht(d(T.type)), ht({
|
|
3537
3585
|
modelValue: o[T.key],
|
|
3538
|
-
"onUpdate:modelValue": (
|
|
3586
|
+
"onUpdate:modelValue": (Y) => o[T.key] = Y,
|
|
3539
3587
|
placeholder: T.placeholder || `请输入${T.label}`,
|
|
3540
3588
|
options: T.options,
|
|
3541
3589
|
clearable: T.clearable !== !1,
|
|
@@ -3552,9 +3600,9 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3552
3600
|
"show-text": T.showText,
|
|
3553
3601
|
"active-color": T.activeColor || (T.type === "switch" ? "#1B2433" : void 0),
|
|
3554
3602
|
"inactive-color": T.inactiveColor
|
|
3555
|
-
},
|
|
3556
|
-
onInput: (
|
|
3557
|
-
onChange: (
|
|
3603
|
+
}, zt(O(T)), {
|
|
3604
|
+
onInput: (Y) => T.type !== "switch" ? _(T) : void 0,
|
|
3605
|
+
onChange: (Y) => T.type === "switch" ? Z(T, Y) : _(T)
|
|
3558
3606
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "multiple", "true-value", "false-value", "active-text", "inactive-text", "show-text", "active-color", "inactive-color", "onInput", "onChange"]))
|
|
3559
3607
|
])
|
|
3560
3608
|
], !0)
|
|
@@ -3562,30 +3610,30 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3562
3610
|
]),
|
|
3563
3611
|
_: 3
|
|
3564
3612
|
}),
|
|
3565
|
-
p.value ? (
|
|
3613
|
+
p.value ? (r(), c("div", La, [
|
|
3566
3614
|
be(st, {
|
|
3567
3615
|
variant: "secondary",
|
|
3568
3616
|
size: "small",
|
|
3569
|
-
onClick:
|
|
3617
|
+
onClick: U
|
|
3570
3618
|
}, {
|
|
3571
3619
|
default: pe(() => [
|
|
3572
3620
|
Le(oe(h.value ? "收起" : "展开") + " ", 1),
|
|
3573
3621
|
a("span", {
|
|
3574
|
-
class:
|
|
3622
|
+
class: j(["query-encapsulation__toggle-icon", { "is-expanded": h.value }])
|
|
3575
3623
|
}, "▼", 2)
|
|
3576
3624
|
]),
|
|
3577
3625
|
_: 1
|
|
3578
3626
|
})
|
|
3579
|
-
])) :
|
|
3580
|
-
a("div",
|
|
3581
|
-
a("div",
|
|
3627
|
+
])) : W("", !0),
|
|
3628
|
+
a("div", Ta, [
|
|
3629
|
+
a("div", Ba, [
|
|
3582
3630
|
be(st, {
|
|
3583
3631
|
variant: "primary",
|
|
3584
3632
|
size: "small",
|
|
3585
|
-
onClick:
|
|
3633
|
+
onClick: G,
|
|
3586
3634
|
loading: e.loading
|
|
3587
3635
|
}, {
|
|
3588
|
-
default: pe(() => [...
|
|
3636
|
+
default: pe(() => [...V[0] || (V[0] = [
|
|
3589
3637
|
Le(" 搜索 ", -1)
|
|
3590
3638
|
])]),
|
|
3591
3639
|
_: 1
|
|
@@ -3593,15 +3641,15 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3593
3641
|
be(st, {
|
|
3594
3642
|
variant: "secondary",
|
|
3595
3643
|
size: "small",
|
|
3596
|
-
onClick:
|
|
3644
|
+
onClick: A,
|
|
3597
3645
|
loading: e.loading
|
|
3598
3646
|
}, {
|
|
3599
|
-
default: pe(() => [...
|
|
3647
|
+
default: pe(() => [...V[1] || (V[1] = [
|
|
3600
3648
|
Le(" 重置 ", -1)
|
|
3601
3649
|
])]),
|
|
3602
3650
|
_: 1
|
|
3603
3651
|
}, 8, ["loading"]),
|
|
3604
|
-
ve(
|
|
3652
|
+
ve(E.$slots, "extra-actions", {}, void 0, !0)
|
|
3605
3653
|
])
|
|
3606
3654
|
])
|
|
3607
3655
|
])
|
|
@@ -3609,25 +3657,25 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3609
3657
|
])
|
|
3610
3658
|
]));
|
|
3611
3659
|
}
|
|
3612
|
-
}),
|
|
3660
|
+
}), za = /* @__PURE__ */ $e(Ha, [["__scopeId", "data-v-68014a1a"]]), Na = {
|
|
3613
3661
|
key: 0,
|
|
3614
3662
|
width: "16",
|
|
3615
3663
|
height: "16",
|
|
3616
3664
|
viewBox: "0 0 24 24",
|
|
3617
3665
|
fill: "none"
|
|
3618
|
-
},
|
|
3666
|
+
}, Ka = {
|
|
3619
3667
|
key: 1,
|
|
3620
3668
|
width: "16",
|
|
3621
3669
|
height: "16",
|
|
3622
3670
|
viewBox: "0 0 24 24",
|
|
3623
3671
|
fill: "none"
|
|
3624
|
-
},
|
|
3672
|
+
}, Va = {
|
|
3625
3673
|
key: 2,
|
|
3626
3674
|
width: "16",
|
|
3627
3675
|
height: "16",
|
|
3628
3676
|
viewBox: "0 0 24 24",
|
|
3629
3677
|
fill: "none"
|
|
3630
|
-
},
|
|
3678
|
+
}, Aa = ["textContent"], Ra = /* @__PURE__ */ De({
|
|
3631
3679
|
__name: "ymessageToast",
|
|
3632
3680
|
props: {
|
|
3633
3681
|
id: {},
|
|
@@ -3640,9 +3688,9 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3640
3688
|
onClose: {}
|
|
3641
3689
|
},
|
|
3642
3690
|
setup(e) {
|
|
3643
|
-
const m = e, t =
|
|
3644
|
-
let l,
|
|
3645
|
-
|
|
3691
|
+
const m = e, t = N(!1);
|
|
3692
|
+
let l, f = 0, h = 0;
|
|
3693
|
+
ze(() => {
|
|
3646
3694
|
requestAnimationFrame(() => {
|
|
3647
3695
|
t.value = !0, m.duration && m.duration > 0 && o(m.duration);
|
|
3648
3696
|
});
|
|
@@ -3650,7 +3698,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3650
3698
|
$();
|
|
3651
3699
|
});
|
|
3652
3700
|
function o(d) {
|
|
3653
|
-
|
|
3701
|
+
f = d, h = Date.now(), l = window.setTimeout(() => x(), d);
|
|
3654
3702
|
}
|
|
3655
3703
|
function $() {
|
|
3656
3704
|
l && (window.clearTimeout(l), l = void 0);
|
|
@@ -3659,37 +3707,37 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3659
3707
|
if (l && m.duration && m.duration > 0) {
|
|
3660
3708
|
$();
|
|
3661
3709
|
const d = Date.now() - h;
|
|
3662
|
-
|
|
3710
|
+
f = Math.max(0, f - d);
|
|
3663
3711
|
}
|
|
3664
3712
|
}
|
|
3665
|
-
function
|
|
3666
|
-
m.duration && m.duration > 0 &&
|
|
3713
|
+
function I() {
|
|
3714
|
+
m.duration && m.duration > 0 && f > 0 && o(f);
|
|
3667
3715
|
}
|
|
3668
|
-
function
|
|
3716
|
+
function x() {
|
|
3669
3717
|
t.value = !1;
|
|
3670
3718
|
}
|
|
3671
3719
|
function p() {
|
|
3672
3720
|
var d;
|
|
3673
3721
|
(d = m.onClose) == null || d.call(m, m.id);
|
|
3674
3722
|
}
|
|
3675
|
-
return (d, C) => (
|
|
3723
|
+
return (d, C) => (r(), Ne(He, {
|
|
3676
3724
|
name: "y-msg-fade",
|
|
3677
3725
|
onAfterLeave: p
|
|
3678
3726
|
}, {
|
|
3679
3727
|
default: pe(() => [
|
|
3680
3728
|
Ve(a("div", {
|
|
3681
|
-
class:
|
|
3729
|
+
class: j(["y-msg", [`y-msg--${e.type}`]]),
|
|
3682
3730
|
style: fe({ zIndex: e.zIndex }),
|
|
3683
3731
|
role: "status",
|
|
3684
3732
|
"aria-live": "polite",
|
|
3685
3733
|
onMouseenter: w,
|
|
3686
|
-
onMouseleave:
|
|
3734
|
+
onMouseleave: I
|
|
3687
3735
|
}, [
|
|
3688
3736
|
a("span", {
|
|
3689
|
-
class:
|
|
3737
|
+
class: j(["y-msg__icon", `y-msg__icon--${e.type}`]),
|
|
3690
3738
|
"aria-hidden": "true"
|
|
3691
3739
|
}, [
|
|
3692
|
-
e.type === "success" ? (
|
|
3740
|
+
e.type === "success" ? (r(), c("svg", Na, [...C[0] || (C[0] = [
|
|
3693
3741
|
a("path", {
|
|
3694
3742
|
d: "M20 6L9 17l-5-5",
|
|
3695
3743
|
stroke: "currentColor",
|
|
@@ -3697,7 +3745,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3697
3745
|
"stroke-linecap": "round",
|
|
3698
3746
|
"stroke-linejoin": "round"
|
|
3699
3747
|
}, null, -1)
|
|
3700
|
-
])])) : e.type === "warning" ? (
|
|
3748
|
+
])])) : e.type === "warning" ? (r(), c("svg", Ka, [...C[1] || (C[1] = [
|
|
3701
3749
|
a("path", {
|
|
3702
3750
|
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",
|
|
3703
3751
|
stroke: "currentColor",
|
|
@@ -3705,7 +3753,7 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3705
3753
|
"stroke-linecap": "round",
|
|
3706
3754
|
"stroke-linejoin": "round"
|
|
3707
3755
|
}, null, -1)
|
|
3708
|
-
])])) : (
|
|
3756
|
+
])])) : (r(), c("svg", Va, [...C[2] || (C[2] = [
|
|
3709
3757
|
a("path", {
|
|
3710
3758
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3711
3759
|
stroke: "currentColor",
|
|
@@ -3718,24 +3766,24 @@ const zt = ["type", "disabled", "aria-busy", "aria-disabled"], Kt = { class: "co
|
|
|
3718
3766
|
a("div", {
|
|
3719
3767
|
class: "y-msg__content",
|
|
3720
3768
|
textContent: oe(e.message)
|
|
3721
|
-
}, null, 8,
|
|
3722
|
-
e.closable ? (
|
|
3769
|
+
}, null, 8, Aa),
|
|
3770
|
+
e.closable ? (r(), c("button", {
|
|
3723
3771
|
key: 0,
|
|
3724
3772
|
class: "y-msg__close",
|
|
3725
3773
|
type: "button",
|
|
3726
|
-
onClick:
|
|
3727
|
-
}, "✕")) :
|
|
3774
|
+
onClick: x
|
|
3775
|
+
}, "✕")) : W("", !0)
|
|
3728
3776
|
], 38), [
|
|
3729
|
-
[
|
|
3777
|
+
[Pe, t.value]
|
|
3730
3778
|
])
|
|
3731
3779
|
]),
|
|
3732
3780
|
_: 1
|
|
3733
3781
|
}));
|
|
3734
3782
|
}
|
|
3735
|
-
}),
|
|
3736
|
-
let
|
|
3783
|
+
}), Wa = /* @__PURE__ */ $e(Ra, [["__scopeId", "data-v-db173617"]]);
|
|
3784
|
+
let _a = 1;
|
|
3737
3785
|
const vt = 12, _e = [];
|
|
3738
|
-
function
|
|
3786
|
+
function Pa() {
|
|
3739
3787
|
let e = 20;
|
|
3740
3788
|
return _e.forEach((m) => {
|
|
3741
3789
|
e += m.height + vt;
|
|
@@ -3757,24 +3805,24 @@ function bt(e) {
|
|
|
3757
3805
|
}
|
|
3758
3806
|
function ft(e) {
|
|
3759
3807
|
var h;
|
|
3760
|
-
const m =
|
|
3808
|
+
const m = _a++, t = document.createElement("div");
|
|
3761
3809
|
document.body.appendChild(t);
|
|
3762
|
-
const l = be(
|
|
3810
|
+
const l = be(Wa, {
|
|
3763
3811
|
id: m,
|
|
3764
3812
|
type: e.type || "success",
|
|
3765
3813
|
message: e.message,
|
|
3766
3814
|
duration: e.duration ?? 2500,
|
|
3767
|
-
offset:
|
|
3815
|
+
offset: Pa(),
|
|
3768
3816
|
zIndex: 3e3 + m,
|
|
3769
3817
|
closable: e.closable ?? !1,
|
|
3770
3818
|
onClose: (o) => bt(o)
|
|
3771
3819
|
});
|
|
3772
3820
|
xt(l, t);
|
|
3773
|
-
const
|
|
3774
|
-
return _e.push({ id: m, el: t, vm: l, height:
|
|
3821
|
+
const f = ((h = t.firstElementChild) == null ? void 0 : h.offsetHeight) || 0;
|
|
3822
|
+
return _e.push({ id: m, el: t, vm: l, height: f, leaving: !1 }), rt(), requestAnimationFrame(() => {
|
|
3775
3823
|
const o = t.firstElementChild;
|
|
3776
3824
|
if (!o) return;
|
|
3777
|
-
const $ = o.offsetHeight ||
|
|
3825
|
+
const $ = o.offsetHeight || f || 0, w = _e.find((I) => I.id === m);
|
|
3778
3826
|
w && (w.height = $, rt());
|
|
3779
3827
|
}), { close: () => bt(m) };
|
|
3780
3828
|
}
|
|
@@ -3799,12 +3847,12 @@ function rt() {
|
|
|
3799
3847
|
if (t.style.transform = `translate(-50%, ${l}px)`, t.style.top || (t.style.top = "0px"), !m.leaving)
|
|
3800
3848
|
e += (t.offsetHeight || m.height) + vt;
|
|
3801
3849
|
else {
|
|
3802
|
-
const
|
|
3803
|
-
e +=
|
|
3850
|
+
const f = t.offsetHeight || m.height;
|
|
3851
|
+
e += f + vt;
|
|
3804
3852
|
}
|
|
3805
3853
|
});
|
|
3806
3854
|
}
|
|
3807
|
-
const
|
|
3855
|
+
const Fa = { class: "hint-tag-content" }, Ya = ["title"], Oa = /* @__PURE__ */ De({
|
|
3808
3856
|
__name: "hintTag",
|
|
3809
3857
|
props: {
|
|
3810
3858
|
content: { default: "" },
|
|
@@ -3815,7 +3863,7 @@ const Wa = { class: "hint-tag-content" }, _a = ["title"], Fa = /* @__PURE__ */ D
|
|
|
3815
3863
|
borderColor: { default: "#00a8e8" }
|
|
3816
3864
|
},
|
|
3817
3865
|
setup(e, { expose: m }) {
|
|
3818
|
-
const l =
|
|
3866
|
+
const l = N(e.defaultExpanded), f = () => {
|
|
3819
3867
|
l.value = !l.value;
|
|
3820
3868
|
}, h = () => {
|
|
3821
3869
|
l.value && (l.value = !1);
|
|
@@ -3823,45 +3871,45 @@ const Wa = { class: "hint-tag-content" }, _a = ["title"], Fa = /* @__PURE__ */ D
|
|
|
3823
3871
|
l.value || (l.value = !0);
|
|
3824
3872
|
};
|
|
3825
3873
|
m({
|
|
3826
|
-
toggle:
|
|
3874
|
+
toggle: f,
|
|
3827
3875
|
isExpanded: l,
|
|
3828
3876
|
collapse: h,
|
|
3829
3877
|
expand: o
|
|
3830
3878
|
});
|
|
3831
|
-
const $ = we("registerHintTag", null), w = we("unregisterHintTag", null),
|
|
3879
|
+
const $ = we("registerHintTag", null), w = we("unregisterHintTag", null), I = we("notifyHintTagStateChange", null), x = {
|
|
3832
3880
|
collapse: h,
|
|
3833
3881
|
expand: o,
|
|
3834
|
-
toggle:
|
|
3882
|
+
toggle: f,
|
|
3835
3883
|
get isExpanded() {
|
|
3836
3884
|
return l.value;
|
|
3837
3885
|
}
|
|
3838
3886
|
};
|
|
3839
3887
|
return ae(() => l.value, () => {
|
|
3840
|
-
|
|
3841
|
-
}),
|
|
3842
|
-
$ && $(
|
|
3888
|
+
I && I();
|
|
3889
|
+
}), ze(() => {
|
|
3890
|
+
$ && $(x);
|
|
3843
3891
|
}), Ke(() => {
|
|
3844
|
-
w && w(
|
|
3845
|
-
}), (p, d) => (
|
|
3846
|
-
class:
|
|
3892
|
+
w && w(x);
|
|
3893
|
+
}), (p, d) => (r(), c("div", {
|
|
3894
|
+
class: j(["hint-tag-wrapper", `hint-tag-wrapper-${e.position}`])
|
|
3847
3895
|
}, [
|
|
3848
3896
|
be(He, { name: "hint-slide" }, {
|
|
3849
3897
|
default: pe(() => [
|
|
3850
3898
|
Ve(a("div", {
|
|
3851
|
-
class:
|
|
3899
|
+
class: j(["hint-tag", `hint-tag-${e.position}`]),
|
|
3852
3900
|
style: fe({
|
|
3853
3901
|
width: e.position === "top" || e.position === "bottom" ? "auto" : e.width,
|
|
3854
3902
|
borderColor: e.borderColor
|
|
3855
3903
|
})
|
|
3856
3904
|
}, [
|
|
3857
|
-
a("div",
|
|
3905
|
+
a("div", Fa, [
|
|
3858
3906
|
ve(p.$slots, "default", {}, () => [
|
|
3859
3907
|
Le(oe(e.content), 1)
|
|
3860
3908
|
], !0)
|
|
3861
3909
|
]),
|
|
3862
3910
|
a("div", {
|
|
3863
3911
|
class: "hint-tag-toggle",
|
|
3864
|
-
onClick:
|
|
3912
|
+
onClick: f
|
|
3865
3913
|
}, [...d[0] || (d[0] = [
|
|
3866
3914
|
a("svg", {
|
|
3867
3915
|
class: "hint-tag-icon",
|
|
@@ -3879,7 +3927,7 @@ const Wa = { class: "hint-tag-content" }, _a = ["title"], Fa = /* @__PURE__ */ D
|
|
|
3879
3927
|
], -1)
|
|
3880
3928
|
])])
|
|
3881
3929
|
], 6), [
|
|
3882
|
-
[
|
|
3930
|
+
[Pe, l.value]
|
|
3883
3931
|
])
|
|
3884
3932
|
]),
|
|
3885
3933
|
_: 3
|
|
@@ -3887,8 +3935,8 @@ const Wa = { class: "hint-tag-content" }, _a = ["title"], Fa = /* @__PURE__ */ D
|
|
|
3887
3935
|
be(He, { name: "hint-button-fade" }, {
|
|
3888
3936
|
default: pe(() => [
|
|
3889
3937
|
Ve(a("div", {
|
|
3890
|
-
class:
|
|
3891
|
-
onClick:
|
|
3938
|
+
class: j(["hint-tag-button", `hint-tag-button-${e.position}`]),
|
|
3939
|
+
onClick: f,
|
|
3892
3940
|
title: e.tooltip || e.content
|
|
3893
3941
|
}, [...d[1] || (d[1] = [
|
|
3894
3942
|
a("svg", {
|
|
@@ -3905,32 +3953,32 @@ const Wa = { class: "hint-tag-content" }, _a = ["title"], Fa = /* @__PURE__ */ D
|
|
|
3905
3953
|
"stroke-linejoin": "round"
|
|
3906
3954
|
})
|
|
3907
3955
|
], -1)
|
|
3908
|
-
])], 10,
|
|
3909
|
-
[
|
|
3956
|
+
])], 10, Ya), [
|
|
3957
|
+
[Pe, !l.value]
|
|
3910
3958
|
])
|
|
3911
3959
|
]),
|
|
3912
3960
|
_: 1
|
|
3913
3961
|
})
|
|
3914
3962
|
], 2));
|
|
3915
3963
|
}
|
|
3916
|
-
}),
|
|
3964
|
+
}), ja = /* @__PURE__ */ $e(Oa, [["__scopeId", "data-v-fae009d3"]]), kt = {
|
|
3917
3965
|
YButton: st,
|
|
3918
3966
|
YInput: Dt,
|
|
3919
|
-
YTable:
|
|
3967
|
+
YTable: xl,
|
|
3920
3968
|
YSelect: $t,
|
|
3921
|
-
YPagination:
|
|
3922
|
-
YBadge:
|
|
3923
|
-
YDialog:
|
|
3924
|
-
YPopover:
|
|
3969
|
+
YPagination: _l,
|
|
3970
|
+
YBadge: tn,
|
|
3971
|
+
YDialog: dn,
|
|
3972
|
+
YPopover: vn,
|
|
3925
3973
|
YTime: St,
|
|
3926
3974
|
YSwitch: It,
|
|
3927
|
-
YImage:
|
|
3928
|
-
YDropdown:
|
|
3929
|
-
YDrawer:
|
|
3930
|
-
YTree:
|
|
3931
|
-
QueryEncapsulation:
|
|
3932
|
-
HintTag:
|
|
3933
|
-
},
|
|
3975
|
+
YImage: ea,
|
|
3976
|
+
YDropdown: la,
|
|
3977
|
+
YDrawer: da,
|
|
3978
|
+
YTree: xa,
|
|
3979
|
+
QueryEncapsulation: za,
|
|
3980
|
+
HintTag: ja
|
|
3981
|
+
}, Ga = {
|
|
3934
3982
|
install(e) {
|
|
3935
3983
|
Object.keys(kt).forEach((m) => {
|
|
3936
3984
|
e.component(m, kt[m]);
|
|
@@ -3938,22 +3986,22 @@ const Wa = { class: "hint-tag-content" }, _a = ["title"], Fa = /* @__PURE__ */ D
|
|
|
3938
3986
|
}
|
|
3939
3987
|
};
|
|
3940
3988
|
export {
|
|
3941
|
-
|
|
3942
|
-
|
|
3989
|
+
za as QueryEncapsulation,
|
|
3990
|
+
tn as YBadge,
|
|
3943
3991
|
st as YButton,
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3992
|
+
dn as YDialog,
|
|
3993
|
+
da as YDrawer,
|
|
3994
|
+
la as YDropdown,
|
|
3995
|
+
ea as YImage,
|
|
3948
3996
|
Dt as YInput,
|
|
3949
3997
|
it as YMessage,
|
|
3950
|
-
|
|
3951
|
-
|
|
3998
|
+
_l as YPagination,
|
|
3999
|
+
vn as YPopover,
|
|
3952
4000
|
$t as YSelect,
|
|
3953
4001
|
It as YSwitch,
|
|
3954
|
-
|
|
4002
|
+
xl as YTable,
|
|
3955
4003
|
St as YTime,
|
|
3956
|
-
|
|
3957
|
-
|
|
4004
|
+
xa as YTree,
|
|
4005
|
+
Ga as default
|
|
3958
4006
|
};
|
|
3959
4007
|
//# sourceMappingURL=index.esm.js.map
|