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