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