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