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