@jctrans-materials/comps-vue2 1.0.1 → 1.0.2
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/search/index.d.ts +37 -15
- package/dist/index.cjs.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.esm.js +579 -569
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { locationSearchV2 as Ut, emitter as
|
|
3
|
-
import { MODAL_ACTION as
|
|
4
|
-
import { Col as Rt, Row as St, Checkbox as Dt, Button as
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
const t =
|
|
1
|
+
import oe, { ref as C, computed as Z, onMounted as se, onBeforeUnmount as qt, defineComponent as ie, toRef as xt, watch as bt, reactive as Ct } from "vue";
|
|
2
|
+
import { locationSearchV2 as Ut, emitter as W, MODAL_ACTION as G, initSharedConfig as re } from "@jctrans-materials/shared";
|
|
3
|
+
import { MODAL_ACTION as Mn, emitter as Pn } from "@jctrans-materials/shared";
|
|
4
|
+
import { Col as Rt, Row as St, Checkbox as Dt, Button as Et, Input as Ot, FormItem as _t, Form as Tt, Dialog as kt } from "jctrans-ui";
|
|
5
|
+
oe.util.warn;
|
|
6
|
+
function le(e) {
|
|
7
|
+
const t = C([]), n = "_search_history_cache", o = typeof window < "u" && typeof localStorage < "u", s = Z(
|
|
8
8
|
() => (e.value || "") + n
|
|
9
|
-
), i =
|
|
9
|
+
), i = Z(
|
|
10
10
|
() => !!e.value && e.value !== ""
|
|
11
|
-
),
|
|
11
|
+
), r = (a) => {
|
|
12
12
|
if (!a || !o) return;
|
|
13
13
|
const c = t.value.filter(
|
|
14
14
|
(d) => d.id && d.id !== a.id || d.display !== a.display
|
|
@@ -23,10 +23,10 @@ function ie(e) {
|
|
|
23
23
|
console.warn("LocalStorage save failed:", d);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
},
|
|
26
|
+
}, l = () => {
|
|
27
27
|
t.value = [], o && localStorage.removeItem(s.value);
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return se(() => {
|
|
30
30
|
if (o && i.value) {
|
|
31
31
|
const a = localStorage.getItem(s.value);
|
|
32
32
|
if (a)
|
|
@@ -38,12 +38,12 @@ function ie(e) {
|
|
|
38
38
|
}
|
|
39
39
|
}), {
|
|
40
40
|
searchHistory: t,
|
|
41
|
-
saveToHistory:
|
|
42
|
-
clearHistory:
|
|
41
|
+
saveToHistory: r,
|
|
42
|
+
clearHistory: l,
|
|
43
43
|
HasHistory: i
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
async function
|
|
46
|
+
async function ae(e, t = [
|
|
47
47
|
"Continent",
|
|
48
48
|
"Country",
|
|
49
49
|
"City",
|
|
@@ -56,9 +56,9 @@ async function le(e, t = [
|
|
|
56
56
|
...n
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
function
|
|
61
|
-
const n =
|
|
59
|
+
const ce = (e, t) => Ut.searchByIdWithType(e, t);
|
|
60
|
+
function ue(e, t) {
|
|
61
|
+
const n = C([]), o = C(!1), s = C(!1), i = C(1), r = C(0), l = C(10), a = Z(() => r.value === 0 ? !1 : n.value.length >= r.value), c = Z(() => {
|
|
62
62
|
const m = [...t.value];
|
|
63
63
|
return m.includes("Country") && !m.includes("Region") && m.push("Region"), m;
|
|
64
64
|
}), u = (m) => !m || !Array.isArray(m) ? [] : m.filter(
|
|
@@ -70,25 +70,25 @@ function ae(e, t) {
|
|
|
70
70
|
isFetchingMore: s,
|
|
71
71
|
isFinished: a,
|
|
72
72
|
currentPage: i,
|
|
73
|
-
total:
|
|
73
|
+
total: r,
|
|
74
74
|
fetchData: async (m = 1, f = !1) => {
|
|
75
75
|
if (!e.value.trim() && !f) {
|
|
76
|
-
n.value = [],
|
|
76
|
+
n.value = [], r.value = 0;
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
if (!(f && (s.value || a.value)) && !(!f && o.value)) {
|
|
80
80
|
f ? s.value = !0 : (o.value = !0, i.value = 1);
|
|
81
81
|
try {
|
|
82
|
-
const p = await
|
|
82
|
+
const p = await ae(
|
|
83
83
|
e.value,
|
|
84
84
|
t.value,
|
|
85
85
|
{
|
|
86
86
|
current: m,
|
|
87
87
|
// 使用传入的 page 参数
|
|
88
|
-
size:
|
|
88
|
+
size: l.value
|
|
89
89
|
}
|
|
90
|
-
),
|
|
91
|
-
f ? n.value = [...n.value, ...y] : n.value = y,
|
|
90
|
+
), h = p.records || [], y = u(h);
|
|
91
|
+
f ? n.value = [...n.value, ...y] : n.value = y, r.value = p.total || 0, i.value = m;
|
|
92
92
|
} catch (p) {
|
|
93
93
|
console.error("Failed to fetch search results:", p);
|
|
94
94
|
} finally {
|
|
@@ -99,78 +99,78 @@ function ae(e, t) {
|
|
|
99
99
|
filterByTypes: u
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const Y = Math.min, R = Math.max, it = Math.round, st = Math.floor, I = (e) => ({
|
|
103
103
|
x: e,
|
|
104
104
|
y: e
|
|
105
|
-
}),
|
|
105
|
+
}), fe = {
|
|
106
106
|
left: "right",
|
|
107
107
|
right: "left",
|
|
108
108
|
bottom: "top",
|
|
109
109
|
top: "bottom"
|
|
110
|
-
},
|
|
110
|
+
}, de = {
|
|
111
111
|
start: "end",
|
|
112
112
|
end: "start"
|
|
113
113
|
};
|
|
114
|
-
function
|
|
115
|
-
return
|
|
114
|
+
function It(e, t, n) {
|
|
115
|
+
return R(e, Y(t, n));
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function et(e, t) {
|
|
118
118
|
return typeof e == "function" ? e(t) : e;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function N(e) {
|
|
121
121
|
return e.split("-")[0];
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function nt(e) {
|
|
124
124
|
return e.split("-")[1];
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Wt(e) {
|
|
127
127
|
return e === "x" ? "y" : "x";
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Gt(e) {
|
|
130
130
|
return e === "y" ? "height" : "width";
|
|
131
131
|
}
|
|
132
|
-
const
|
|
133
|
-
function
|
|
134
|
-
return
|
|
132
|
+
const me = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
133
|
+
function V(e) {
|
|
134
|
+
return me.has(N(e)) ? "y" : "x";
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return
|
|
136
|
+
function Jt(e) {
|
|
137
|
+
return Wt(V(e));
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function pe(e, t, n) {
|
|
140
140
|
n === void 0 && (n = !1);
|
|
141
|
-
const o =
|
|
142
|
-
let
|
|
143
|
-
return t.reference[i] > t.floating[i] && (
|
|
141
|
+
const o = nt(e), s = Jt(e), i = Gt(s);
|
|
142
|
+
let r = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
143
|
+
return t.reference[i] > t.floating[i] && (r = rt(r)), [r, rt(r)];
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function he(e) {
|
|
146
146
|
const t = rt(e);
|
|
147
147
|
return [pt(e), t, pt(t)];
|
|
148
148
|
}
|
|
149
149
|
function pt(e) {
|
|
150
|
-
return e.replace(/start|end/g, (t) =>
|
|
150
|
+
return e.replace(/start|end/g, (t) => de[t]);
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
function
|
|
152
|
+
const Ft = ["left", "right"], Lt = ["right", "left"], ge = ["top", "bottom"], ye = ["bottom", "top"];
|
|
153
|
+
function ve(e, t, n) {
|
|
154
154
|
switch (e) {
|
|
155
155
|
case "top":
|
|
156
156
|
case "bottom":
|
|
157
|
-
return n ? t ? Lt :
|
|
157
|
+
return n ? t ? Lt : Ft : t ? Ft : Lt;
|
|
158
158
|
case "left":
|
|
159
159
|
case "right":
|
|
160
|
-
return t ?
|
|
160
|
+
return t ? ge : ye;
|
|
161
161
|
default:
|
|
162
162
|
return [];
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
const s =
|
|
167
|
-
let i =
|
|
168
|
-
return s && (i = i.map((
|
|
165
|
+
function Ae(e, t, n, o) {
|
|
166
|
+
const s = nt(e);
|
|
167
|
+
let i = ve(N(e), n === "start", o);
|
|
168
|
+
return s && (i = i.map((r) => r + "-" + s), t && (i = i.concat(i.map(pt)))), i;
|
|
169
169
|
}
|
|
170
170
|
function rt(e) {
|
|
171
|
-
return e.replace(/left|right|bottom|top/g, (t) =>
|
|
171
|
+
return e.replace(/left|right|bottom|top/g, (t) => fe[t]);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function we(e) {
|
|
174
174
|
return {
|
|
175
175
|
top: 0,
|
|
176
176
|
right: 0,
|
|
@@ -179,15 +179,15 @@ function ye(e) {
|
|
|
179
179
|
...e
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return typeof e != "number" ?
|
|
182
|
+
function xe(e) {
|
|
183
|
+
return typeof e != "number" ? we(e) : {
|
|
184
184
|
top: e,
|
|
185
185
|
right: e,
|
|
186
186
|
bottom: e,
|
|
187
187
|
left: e
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function lt(e) {
|
|
191
191
|
const {
|
|
192
192
|
x: t,
|
|
193
193
|
y: n,
|
|
@@ -210,7 +210,7 @@ function Bt(e, t, n) {
|
|
|
210
210
|
reference: o,
|
|
211
211
|
floating: s
|
|
212
212
|
} = e;
|
|
213
|
-
const i =
|
|
213
|
+
const i = V(t), r = Jt(t), l = Gt(r), a = N(t), c = i === "y", u = o.x + o.width / 2 - s.width / 2, d = o.y + o.height / 2 - s.height / 2, m = o[l] / 2 - s[l] / 2;
|
|
214
214
|
let f;
|
|
215
215
|
switch (a) {
|
|
216
216
|
case "top":
|
|
@@ -243,24 +243,24 @@ function Bt(e, t, n) {
|
|
|
243
243
|
y: o.y
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
-
switch (
|
|
246
|
+
switch (nt(t)) {
|
|
247
247
|
case "start":
|
|
248
|
-
f[
|
|
248
|
+
f[r] -= m * (n && c ? -1 : 1);
|
|
249
249
|
break;
|
|
250
250
|
case "end":
|
|
251
|
-
f[
|
|
251
|
+
f[r] += m * (n && c ? -1 : 1);
|
|
252
252
|
break;
|
|
253
253
|
}
|
|
254
254
|
return f;
|
|
255
255
|
}
|
|
256
|
-
const
|
|
256
|
+
const be = async (e, t, n) => {
|
|
257
257
|
const {
|
|
258
258
|
placement: o = "bottom",
|
|
259
259
|
strategy: s = "absolute",
|
|
260
260
|
middleware: i = [],
|
|
261
|
-
platform:
|
|
262
|
-
} = n,
|
|
263
|
-
let c = await
|
|
261
|
+
platform: r
|
|
262
|
+
} = n, l = i.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
263
|
+
let c = await r.getElementRects({
|
|
264
264
|
reference: e,
|
|
265
265
|
floating: t,
|
|
266
266
|
strategy: s
|
|
@@ -268,16 +268,16 @@ const we = async (e, t, n) => {
|
|
|
268
268
|
x: u,
|
|
269
269
|
y: d
|
|
270
270
|
} = Bt(c, o, a), m = o, f = {}, p = 0;
|
|
271
|
-
for (let
|
|
271
|
+
for (let h = 0; h < l.length; h++) {
|
|
272
272
|
const {
|
|
273
273
|
name: y,
|
|
274
|
-
fn:
|
|
275
|
-
} =
|
|
276
|
-
x:
|
|
277
|
-
y:
|
|
278
|
-
data:
|
|
279
|
-
reset:
|
|
280
|
-
} = await
|
|
274
|
+
fn: g
|
|
275
|
+
} = l[h], {
|
|
276
|
+
x: v,
|
|
277
|
+
y: A,
|
|
278
|
+
data: b,
|
|
279
|
+
reset: w
|
|
280
|
+
} = await g({
|
|
281
281
|
x: u,
|
|
282
282
|
y: d,
|
|
283
283
|
initialPlacement: o,
|
|
@@ -285,26 +285,26 @@ const we = async (e, t, n) => {
|
|
|
285
285
|
strategy: s,
|
|
286
286
|
middlewareData: f,
|
|
287
287
|
rects: c,
|
|
288
|
-
platform:
|
|
288
|
+
platform: r,
|
|
289
289
|
elements: {
|
|
290
290
|
reference: e,
|
|
291
291
|
floating: t
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
|
-
u =
|
|
294
|
+
u = v ?? u, d = A ?? d, f = {
|
|
295
295
|
...f,
|
|
296
296
|
[y]: {
|
|
297
297
|
...f[y],
|
|
298
|
-
...
|
|
298
|
+
...b
|
|
299
299
|
}
|
|
300
|
-
},
|
|
300
|
+
}, w && p <= 50 && (p++, typeof w == "object" && (w.placement && (m = w.placement), w.rects && (c = w.rects === !0 ? await r.getElementRects({
|
|
301
301
|
reference: e,
|
|
302
302
|
floating: t,
|
|
303
303
|
strategy: s
|
|
304
|
-
}) :
|
|
304
|
+
}) : w.rects), {
|
|
305
305
|
x: u,
|
|
306
306
|
y: d
|
|
307
|
-
} = Bt(c, m, a)),
|
|
307
|
+
} = Bt(c, m, a)), h = -1);
|
|
308
308
|
}
|
|
309
309
|
return {
|
|
310
310
|
x: u,
|
|
@@ -321,8 +321,8 @@ async function gt(e, t) {
|
|
|
321
321
|
x: o,
|
|
322
322
|
y: s,
|
|
323
323
|
platform: i,
|
|
324
|
-
rects:
|
|
325
|
-
elements:
|
|
324
|
+
rects: r,
|
|
325
|
+
elements: l,
|
|
326
326
|
strategy: a
|
|
327
327
|
} = e, {
|
|
328
328
|
boundary: c = "clippingAncestors",
|
|
@@ -330,36 +330,36 @@ async function gt(e, t) {
|
|
|
330
330
|
elementContext: d = "floating",
|
|
331
331
|
altBoundary: m = !1,
|
|
332
332
|
padding: f = 0
|
|
333
|
-
} =
|
|
334
|
-
element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(
|
|
333
|
+
} = et(t, e), p = xe(f), y = l[m ? d === "floating" ? "reference" : "floating" : d], g = lt(await i.getClippingRect({
|
|
334
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
|
|
335
335
|
boundary: c,
|
|
336
336
|
rootBoundary: u,
|
|
337
337
|
strategy: a
|
|
338
|
-
})),
|
|
338
|
+
})), v = d === "floating" ? {
|
|
339
339
|
x: o,
|
|
340
340
|
y: s,
|
|
341
|
-
width:
|
|
342
|
-
height:
|
|
343
|
-
} :
|
|
341
|
+
width: r.floating.width,
|
|
342
|
+
height: r.floating.height
|
|
343
|
+
} : r.reference, A = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), b = await (i.isElement == null ? void 0 : i.isElement(A)) ? await (i.getScale == null ? void 0 : i.getScale(A)) || {
|
|
344
344
|
x: 1,
|
|
345
345
|
y: 1
|
|
346
346
|
} : {
|
|
347
347
|
x: 1,
|
|
348
348
|
y: 1
|
|
349
|
-
},
|
|
350
|
-
elements:
|
|
351
|
-
rect:
|
|
352
|
-
offsetParent:
|
|
349
|
+
}, w = lt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
350
|
+
elements: l,
|
|
351
|
+
rect: v,
|
|
352
|
+
offsetParent: A,
|
|
353
353
|
strategy: a
|
|
354
|
-
}) :
|
|
354
|
+
}) : v);
|
|
355
355
|
return {
|
|
356
|
-
top: (
|
|
357
|
-
bottom: (
|
|
358
|
-
left: (
|
|
359
|
-
right: (
|
|
356
|
+
top: (g.top - w.top + p.top) / b.y,
|
|
357
|
+
bottom: (w.bottom - g.bottom + p.bottom) / b.y,
|
|
358
|
+
left: (g.left - w.left + p.left) / b.x,
|
|
359
|
+
right: (w.right - g.right + p.right) / b.x
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const Ce = function(e) {
|
|
363
363
|
return e === void 0 && (e = {}), {
|
|
364
364
|
name: "flip",
|
|
365
365
|
options: e,
|
|
@@ -368,8 +368,8 @@ const be = function(e) {
|
|
|
368
368
|
const {
|
|
369
369
|
placement: s,
|
|
370
370
|
middlewareData: i,
|
|
371
|
-
rects:
|
|
372
|
-
initialPlacement:
|
|
371
|
+
rects: r,
|
|
372
|
+
initialPlacement: l,
|
|
373
373
|
platform: a,
|
|
374
374
|
elements: c
|
|
375
375
|
} = t, {
|
|
@@ -378,75 +378,75 @@ const be = function(e) {
|
|
|
378
378
|
fallbackPlacements: m,
|
|
379
379
|
fallbackStrategy: f = "bestFit",
|
|
380
380
|
fallbackAxisSideDirection: p = "none",
|
|
381
|
-
flipAlignment:
|
|
381
|
+
flipAlignment: h = !0,
|
|
382
382
|
...y
|
|
383
|
-
} =
|
|
383
|
+
} = et(e, t);
|
|
384
384
|
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
385
385
|
return {};
|
|
386
|
-
const
|
|
387
|
-
!m &&
|
|
388
|
-
const
|
|
389
|
-
let
|
|
390
|
-
if (u &&
|
|
391
|
-
const
|
|
392
|
-
|
|
386
|
+
const g = N(s), v = V(l), A = N(l) === l, b = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), w = m || (A || !h ? [rt(l)] : he(l)), E = p !== "none";
|
|
387
|
+
!m && E && w.push(...Ae(l, h, p, b));
|
|
388
|
+
const D = [l, ...w], B = await gt(t, y), M = [];
|
|
389
|
+
let O = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
390
|
+
if (u && M.push(B[g]), d) {
|
|
391
|
+
const q = pe(s, r, b);
|
|
392
|
+
M.push(B[q[0]], B[q[1]]);
|
|
393
393
|
}
|
|
394
|
-
if (
|
|
394
|
+
if (O = [...O, {
|
|
395
395
|
placement: s,
|
|
396
|
-
overflows:
|
|
397
|
-
}], !
|
|
398
|
-
var
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
396
|
+
overflows: M
|
|
397
|
+
}], !M.every((q) => q <= 0)) {
|
|
398
|
+
var x, P;
|
|
399
|
+
const q = (((x = i.flip) == null ? void 0 : x.index) || 0) + 1, dt = D[q];
|
|
400
|
+
if (dt && (!(d === "alignment" ? v !== V(dt) : !1) || // We leave the current main axis only if every placement on that axis
|
|
401
401
|
// overflows the main axis.
|
|
402
|
-
|
|
402
|
+
O.every((_) => V(_.placement) === v ? _.overflows[0] > 0 : !0)))
|
|
403
403
|
return {
|
|
404
404
|
data: {
|
|
405
|
-
index:
|
|
406
|
-
overflows:
|
|
405
|
+
index: q,
|
|
406
|
+
overflows: O
|
|
407
407
|
},
|
|
408
408
|
reset: {
|
|
409
|
-
placement:
|
|
409
|
+
placement: dt
|
|
410
410
|
}
|
|
411
411
|
};
|
|
412
|
-
let
|
|
413
|
-
if (
|
|
412
|
+
let $ = (P = O.filter((U) => U.overflows[0] <= 0).sort((U, _) => U.overflows[1] - _.overflows[1])[0]) == null ? void 0 : P.placement;
|
|
413
|
+
if (!$)
|
|
414
414
|
switch (f) {
|
|
415
415
|
case "bestFit": {
|
|
416
|
-
var
|
|
417
|
-
const
|
|
418
|
-
if (
|
|
419
|
-
const
|
|
420
|
-
return
|
|
416
|
+
var j;
|
|
417
|
+
const U = (j = O.filter((_) => {
|
|
418
|
+
if (E) {
|
|
419
|
+
const Q = V(_.placement);
|
|
420
|
+
return Q === v || // Create a bias to the `y` side axis due to horizontal
|
|
421
421
|
// reading directions favoring greater width.
|
|
422
|
-
|
|
422
|
+
Q === "y";
|
|
423
423
|
}
|
|
424
424
|
return !0;
|
|
425
|
-
}).map((
|
|
426
|
-
|
|
425
|
+
}).map((_) => [_.placement, _.overflows.filter((Q) => Q > 0).reduce((Q, ne) => Q + ne, 0)]).sort((_, Q) => _[1] - Q[1])[0]) == null ? void 0 : j[0];
|
|
426
|
+
U && ($ = U);
|
|
427
427
|
break;
|
|
428
428
|
}
|
|
429
429
|
case "initialPlacement":
|
|
430
|
-
|
|
430
|
+
$ = l;
|
|
431
431
|
break;
|
|
432
432
|
}
|
|
433
|
-
if (s !==
|
|
433
|
+
if (s !== $)
|
|
434
434
|
return {
|
|
435
435
|
reset: {
|
|
436
|
-
placement:
|
|
436
|
+
placement: $
|
|
437
437
|
}
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
440
|
return {};
|
|
441
441
|
}
|
|
442
442
|
};
|
|
443
|
-
},
|
|
444
|
-
async function
|
|
443
|
+
}, Re = /* @__PURE__ */ new Set(["left", "top"]);
|
|
444
|
+
async function Se(e, t) {
|
|
445
445
|
const {
|
|
446
446
|
placement: n,
|
|
447
447
|
platform: o,
|
|
448
448
|
elements: s
|
|
449
|
-
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)),
|
|
449
|
+
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), r = N(n), l = nt(n), a = V(n) === "y", c = Re.has(r) ? -1 : 1, u = i && a ? -1 : 1, d = et(t, e);
|
|
450
450
|
let {
|
|
451
451
|
mainAxis: m,
|
|
452
452
|
crossAxis: f,
|
|
@@ -460,7 +460,7 @@ async function Ce(e, t) {
|
|
|
460
460
|
crossAxis: d.crossAxis || 0,
|
|
461
461
|
alignmentAxis: d.alignmentAxis
|
|
462
462
|
};
|
|
463
|
-
return
|
|
463
|
+
return l && typeof p == "number" && (f = l === "end" ? p * -1 : p), a ? {
|
|
464
464
|
x: f * u,
|
|
465
465
|
y: m * c
|
|
466
466
|
} : {
|
|
@@ -468,7 +468,7 @@ async function Ce(e, t) {
|
|
|
468
468
|
y: f * u
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
const
|
|
471
|
+
const De = function(e) {
|
|
472
472
|
return e === void 0 && (e = 0), {
|
|
473
473
|
name: "offset",
|
|
474
474
|
options: e,
|
|
@@ -477,20 +477,20 @@ const Re = function(e) {
|
|
|
477
477
|
const {
|
|
478
478
|
x: s,
|
|
479
479
|
y: i,
|
|
480
|
-
placement:
|
|
481
|
-
middlewareData:
|
|
482
|
-
} = t, a = await
|
|
483
|
-
return
|
|
480
|
+
placement: r,
|
|
481
|
+
middlewareData: l
|
|
482
|
+
} = t, a = await Se(t, e);
|
|
483
|
+
return r === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
|
|
484
484
|
x: s + a.x,
|
|
485
485
|
y: i + a.y,
|
|
486
486
|
data: {
|
|
487
487
|
...a,
|
|
488
|
-
placement:
|
|
488
|
+
placement: r
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
},
|
|
493
|
+
}, Ee = function(e) {
|
|
494
494
|
return e === void 0 && (e = {}), {
|
|
495
495
|
name: "shift",
|
|
496
496
|
options: e,
|
|
@@ -501,52 +501,52 @@ const Re = function(e) {
|
|
|
501
501
|
placement: s
|
|
502
502
|
} = t, {
|
|
503
503
|
mainAxis: i = !0,
|
|
504
|
-
crossAxis:
|
|
505
|
-
limiter:
|
|
504
|
+
crossAxis: r = !1,
|
|
505
|
+
limiter: l = {
|
|
506
506
|
fn: (y) => {
|
|
507
507
|
let {
|
|
508
|
-
x:
|
|
509
|
-
y:
|
|
508
|
+
x: g,
|
|
509
|
+
y: v
|
|
510
510
|
} = y;
|
|
511
511
|
return {
|
|
512
|
-
x:
|
|
513
|
-
y:
|
|
512
|
+
x: g,
|
|
513
|
+
y: v
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
516
|
},
|
|
517
517
|
...a
|
|
518
|
-
} =
|
|
518
|
+
} = et(e, t), c = {
|
|
519
519
|
x: n,
|
|
520
520
|
y: o
|
|
521
|
-
}, u = await gt(t, a), d =
|
|
521
|
+
}, u = await gt(t, a), d = V(N(s)), m = Wt(d);
|
|
522
522
|
let f = c[m], p = c[d];
|
|
523
523
|
if (i) {
|
|
524
|
-
const y = m === "y" ? "top" : "left",
|
|
525
|
-
f =
|
|
524
|
+
const y = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", v = f + u[y], A = f - u[g];
|
|
525
|
+
f = It(v, f, A);
|
|
526
526
|
}
|
|
527
|
-
if (
|
|
528
|
-
const y = d === "y" ? "top" : "left",
|
|
529
|
-
p =
|
|
527
|
+
if (r) {
|
|
528
|
+
const y = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", v = p + u[y], A = p - u[g];
|
|
529
|
+
p = It(v, p, A);
|
|
530
530
|
}
|
|
531
|
-
const
|
|
531
|
+
const h = l.fn({
|
|
532
532
|
...t,
|
|
533
533
|
[m]: f,
|
|
534
534
|
[d]: p
|
|
535
535
|
});
|
|
536
536
|
return {
|
|
537
|
-
...
|
|
537
|
+
...h,
|
|
538
538
|
data: {
|
|
539
|
-
x:
|
|
540
|
-
y:
|
|
539
|
+
x: h.x - n,
|
|
540
|
+
y: h.y - o,
|
|
541
541
|
enabled: {
|
|
542
542
|
[m]: i,
|
|
543
|
-
[d]:
|
|
543
|
+
[d]: r
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
548
|
};
|
|
549
|
-
},
|
|
549
|
+
}, Oe = function(e) {
|
|
550
550
|
return e === void 0 && (e = {}), {
|
|
551
551
|
name: "size",
|
|
552
552
|
options: e,
|
|
@@ -555,31 +555,31 @@ const Re = function(e) {
|
|
|
555
555
|
const {
|
|
556
556
|
placement: s,
|
|
557
557
|
rects: i,
|
|
558
|
-
platform:
|
|
559
|
-
elements:
|
|
558
|
+
platform: r,
|
|
559
|
+
elements: l
|
|
560
560
|
} = t, {
|
|
561
561
|
apply: a = () => {
|
|
562
562
|
},
|
|
563
563
|
...c
|
|
564
|
-
} =
|
|
564
|
+
} = et(e, t), u = await gt(t, c), d = N(s), m = nt(s), f = V(s) === "y", {
|
|
565
565
|
width: p,
|
|
566
|
-
height:
|
|
566
|
+
height: h
|
|
567
567
|
} = i.floating;
|
|
568
|
-
let y,
|
|
569
|
-
d === "top" || d === "bottom" ? (y = d,
|
|
570
|
-
const
|
|
571
|
-
let
|
|
572
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (
|
|
573
|
-
const
|
|
574
|
-
f ?
|
|
568
|
+
let y, g;
|
|
569
|
+
d === "top" || d === "bottom" ? (y = d, g = m === (await (r.isRTL == null ? void 0 : r.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (g = d, y = m === "end" ? "top" : "bottom");
|
|
570
|
+
const v = h - u.top - u.bottom, A = p - u.left - u.right, b = Y(h - u[y], v), w = Y(p - u[g], A), E = !t.middlewareData.shift;
|
|
571
|
+
let D = b, B = w;
|
|
572
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (B = A), (o = t.middlewareData.shift) != null && o.enabled.y && (D = v), E && !m) {
|
|
573
|
+
const O = R(u.left, 0), x = R(u.right, 0), P = R(u.top, 0), j = R(u.bottom, 0);
|
|
574
|
+
f ? B = p - 2 * (O !== 0 || x !== 0 ? O + x : R(u.left, u.right)) : D = h - 2 * (P !== 0 || j !== 0 ? P + j : R(u.top, u.bottom));
|
|
575
575
|
}
|
|
576
576
|
await a({
|
|
577
577
|
...t,
|
|
578
|
-
availableWidth:
|
|
579
|
-
availableHeight:
|
|
578
|
+
availableWidth: B,
|
|
579
|
+
availableHeight: D
|
|
580
580
|
});
|
|
581
|
-
const
|
|
582
|
-
return p !==
|
|
581
|
+
const M = await r.getDimensions(l.floating);
|
|
582
|
+
return p !== M.width || h !== M.height ? {
|
|
583
583
|
reset: {
|
|
584
584
|
rects: !0
|
|
585
585
|
}
|
|
@@ -587,49 +587,49 @@ const Re = function(e) {
|
|
|
587
587
|
}
|
|
588
588
|
};
|
|
589
589
|
};
|
|
590
|
-
function
|
|
590
|
+
function at() {
|
|
591
591
|
return typeof window < "u";
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
return
|
|
593
|
+
function z(e) {
|
|
594
|
+
return Kt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
595
595
|
}
|
|
596
|
-
function
|
|
596
|
+
function S(e) {
|
|
597
597
|
var t;
|
|
598
598
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function L(e) {
|
|
601
601
|
var t;
|
|
602
|
-
return (t = (
|
|
602
|
+
return (t = (Kt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
603
603
|
}
|
|
604
|
-
function
|
|
605
|
-
return
|
|
604
|
+
function Kt(e) {
|
|
605
|
+
return at() ? e instanceof Node || e instanceof S(e).Node : !1;
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
return
|
|
607
|
+
function T(e) {
|
|
608
|
+
return at() ? e instanceof Element || e instanceof S(e).Element : !1;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
return
|
|
610
|
+
function F(e) {
|
|
611
|
+
return at() ? e instanceof HTMLElement || e instanceof S(e).HTMLElement : !1;
|
|
612
612
|
}
|
|
613
613
|
function Mt(e) {
|
|
614
|
-
return !
|
|
614
|
+
return !at() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof S(e).ShadowRoot;
|
|
615
615
|
}
|
|
616
|
-
const
|
|
617
|
-
function
|
|
616
|
+
const _e = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
617
|
+
function ot(e) {
|
|
618
618
|
const {
|
|
619
619
|
overflow: t,
|
|
620
620
|
overflowX: n,
|
|
621
621
|
overflowY: o,
|
|
622
622
|
display: s
|
|
623
|
-
} =
|
|
624
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !
|
|
623
|
+
} = k(e);
|
|
624
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !_e.has(s);
|
|
625
625
|
}
|
|
626
|
-
const
|
|
627
|
-
function
|
|
628
|
-
return
|
|
626
|
+
const Te = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
627
|
+
function ke(e) {
|
|
628
|
+
return Te.has(z(e));
|
|
629
629
|
}
|
|
630
|
-
const
|
|
631
|
-
function
|
|
632
|
-
return
|
|
630
|
+
const Ie = [":popover-open", ":modal"];
|
|
631
|
+
function ct(e) {
|
|
632
|
+
return Ie.some((t) => {
|
|
633
633
|
try {
|
|
634
634
|
return e.matches(t);
|
|
635
635
|
} catch {
|
|
@@ -637,34 +637,34 @@ function ut(e) {
|
|
|
637
637
|
}
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
|
-
const
|
|
641
|
-
function
|
|
642
|
-
const t =
|
|
643
|
-
return
|
|
640
|
+
const Fe = ["transform", "translate", "scale", "rotate", "perspective"], Le = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Be = ["paint", "layout", "strict", "content"];
|
|
641
|
+
function yt(e) {
|
|
642
|
+
const t = vt(), n = T(e) ? k(e) : e;
|
|
643
|
+
return Fe.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || Le.some((o) => (n.willChange || "").includes(o)) || Be.some((o) => (n.contain || "").includes(o));
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
let t =
|
|
647
|
-
for (;
|
|
648
|
-
if (
|
|
645
|
+
function Me(e) {
|
|
646
|
+
let t = H(e);
|
|
647
|
+
for (; F(t) && !X(t); ) {
|
|
648
|
+
if (yt(t))
|
|
649
649
|
return t;
|
|
650
|
-
if (
|
|
650
|
+
if (ct(t))
|
|
651
651
|
return null;
|
|
652
|
-
t =
|
|
652
|
+
t = H(t);
|
|
653
653
|
}
|
|
654
654
|
return null;
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function vt() {
|
|
657
657
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
658
658
|
}
|
|
659
|
-
const
|
|
660
|
-
function
|
|
661
|
-
return
|
|
659
|
+
const Pe = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
660
|
+
function X(e) {
|
|
661
|
+
return Pe.has(z(e));
|
|
662
662
|
}
|
|
663
|
-
function
|
|
664
|
-
return
|
|
663
|
+
function k(e) {
|
|
664
|
+
return S(e).getComputedStyle(e);
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return
|
|
666
|
+
function ut(e) {
|
|
667
|
+
return T(e) ? {
|
|
668
668
|
scrollLeft: e.scrollLeft,
|
|
669
669
|
scrollTop: e.scrollTop
|
|
670
670
|
} : {
|
|
@@ -672,127 +672,127 @@ function ft(e) {
|
|
|
672
672
|
scrollTop: e.scrollY
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
676
|
-
if (
|
|
675
|
+
function H(e) {
|
|
676
|
+
if (z(e) === "html")
|
|
677
677
|
return e;
|
|
678
678
|
const t = (
|
|
679
679
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
680
680
|
e.assignedSlot || // DOM Element detected.
|
|
681
681
|
e.parentNode || // ShadowRoot detected.
|
|
682
682
|
Mt(e) && e.host || // Fallback.
|
|
683
|
-
|
|
683
|
+
L(e)
|
|
684
684
|
);
|
|
685
685
|
return Mt(t) ? t.host : t;
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
const t =
|
|
689
|
-
return
|
|
687
|
+
function Yt(e) {
|
|
688
|
+
const t = H(e);
|
|
689
|
+
return X(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : F(t) && ot(t) ? t : Yt(t);
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function tt(e, t, n) {
|
|
692
692
|
var o;
|
|
693
693
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
694
|
-
const s =
|
|
694
|
+
const s = Yt(e), i = s === ((o = e.ownerDocument) == null ? void 0 : o.body), r = S(s);
|
|
695
695
|
if (i) {
|
|
696
|
-
const
|
|
697
|
-
return t.concat(
|
|
696
|
+
const l = ht(r);
|
|
697
|
+
return t.concat(r, r.visualViewport || [], ot(s) ? s : [], l && n ? tt(l) : []);
|
|
698
698
|
}
|
|
699
|
-
return t.concat(s,
|
|
699
|
+
return t.concat(s, tt(s, [], n));
|
|
700
700
|
}
|
|
701
701
|
function ht(e) {
|
|
702
702
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
703
703
|
}
|
|
704
|
-
function
|
|
705
|
-
const t =
|
|
704
|
+
function Xt(e) {
|
|
705
|
+
const t = k(e);
|
|
706
706
|
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
707
|
-
const s =
|
|
708
|
-
return
|
|
707
|
+
const s = F(e), i = s ? e.offsetWidth : n, r = s ? e.offsetHeight : o, l = it(n) !== i || it(o) !== r;
|
|
708
|
+
return l && (n = i, o = r), {
|
|
709
709
|
width: n,
|
|
710
710
|
height: o,
|
|
711
|
-
$:
|
|
711
|
+
$: l
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
714
|
function At(e) {
|
|
715
|
-
return
|
|
715
|
+
return T(e) ? e : e.contextElement;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function K(e) {
|
|
718
718
|
const t = At(e);
|
|
719
|
-
if (!
|
|
720
|
-
return
|
|
719
|
+
if (!F(t))
|
|
720
|
+
return I(1);
|
|
721
721
|
const n = t.getBoundingClientRect(), {
|
|
722
722
|
width: o,
|
|
723
723
|
height: s,
|
|
724
724
|
$: i
|
|
725
|
-
} =
|
|
726
|
-
let
|
|
727
|
-
return (!
|
|
728
|
-
x:
|
|
729
|
-
y:
|
|
725
|
+
} = Xt(t);
|
|
726
|
+
let r = (i ? it(n.width) : n.width) / o, l = (i ? it(n.height) : n.height) / s;
|
|
727
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
728
|
+
x: r,
|
|
729
|
+
y: l
|
|
730
730
|
};
|
|
731
731
|
}
|
|
732
|
-
const
|
|
732
|
+
const Ve = /* @__PURE__ */ I(0);
|
|
733
733
|
function zt(e) {
|
|
734
|
-
const t =
|
|
735
|
-
return !
|
|
734
|
+
const t = S(e);
|
|
735
|
+
return !vt() || !t.visualViewport ? Ve : {
|
|
736
736
|
x: t.visualViewport.offsetLeft,
|
|
737
737
|
y: t.visualViewport.offsetTop
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
return t === void 0 && (t = !1), !n || t && n !==
|
|
740
|
+
function Qe(e, t, n) {
|
|
741
|
+
return t === void 0 && (t = !1), !n || t && n !== S(e) ? !1 : t;
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function J(e, t, n, o) {
|
|
744
744
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
745
745
|
const s = e.getBoundingClientRect(), i = At(e);
|
|
746
|
-
let
|
|
747
|
-
t && (o ?
|
|
748
|
-
const
|
|
749
|
-
let a = (s.left +
|
|
746
|
+
let r = I(1);
|
|
747
|
+
t && (o ? T(o) && (r = K(o)) : r = K(e));
|
|
748
|
+
const l = Qe(i, n, o) ? zt(i) : I(0);
|
|
749
|
+
let a = (s.left + l.x) / r.x, c = (s.top + l.y) / r.y, u = s.width / r.x, d = s.height / r.y;
|
|
750
750
|
if (i) {
|
|
751
|
-
const m =
|
|
752
|
-
let p = m,
|
|
753
|
-
for (;
|
|
754
|
-
const y =
|
|
755
|
-
a *= y.x, c *= y.y, u *= y.x, d *= y.y, a +=
|
|
751
|
+
const m = S(i), f = o && T(o) ? S(o) : o;
|
|
752
|
+
let p = m, h = ht(p);
|
|
753
|
+
for (; h && o && f !== p; ) {
|
|
754
|
+
const y = K(h), g = h.getBoundingClientRect(), v = k(h), A = g.left + (h.clientLeft + parseFloat(v.paddingLeft)) * y.x, b = g.top + (h.clientTop + parseFloat(v.paddingTop)) * y.y;
|
|
755
|
+
a *= y.x, c *= y.y, u *= y.x, d *= y.y, a += A, c += b, p = S(h), h = ht(p);
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
return
|
|
758
|
+
return lt({
|
|
759
759
|
width: u,
|
|
760
760
|
height: d,
|
|
761
761
|
x: a,
|
|
762
762
|
y: c
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
const n =
|
|
767
|
-
return t ? t.left + n :
|
|
765
|
+
function ft(e, t) {
|
|
766
|
+
const n = ut(e).scrollLeft;
|
|
767
|
+
return t ? t.left + n : J(L(e)).left + n;
|
|
768
768
|
}
|
|
769
|
-
function
|
|
770
|
-
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft -
|
|
769
|
+
function jt(e, t) {
|
|
770
|
+
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - ft(e, n), s = n.top + t.scrollTop;
|
|
771
771
|
return {
|
|
772
772
|
x: o,
|
|
773
773
|
y: s
|
|
774
774
|
};
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function Ne(e) {
|
|
777
777
|
let {
|
|
778
778
|
elements: t,
|
|
779
779
|
rect: n,
|
|
780
780
|
offsetParent: o,
|
|
781
781
|
strategy: s
|
|
782
782
|
} = e;
|
|
783
|
-
const i = s === "fixed",
|
|
784
|
-
if (o ===
|
|
783
|
+
const i = s === "fixed", r = L(o), l = t ? ct(t.floating) : !1;
|
|
784
|
+
if (o === r || l && i)
|
|
785
785
|
return n;
|
|
786
786
|
let a = {
|
|
787
787
|
scrollLeft: 0,
|
|
788
788
|
scrollTop: 0
|
|
789
|
-
}, c =
|
|
790
|
-
const u =
|
|
791
|
-
if ((d || !d && !i) && ((
|
|
792
|
-
const f =
|
|
793
|
-
c =
|
|
789
|
+
}, c = I(1);
|
|
790
|
+
const u = I(0), d = F(o);
|
|
791
|
+
if ((d || !d && !i) && ((z(o) !== "body" || ot(r)) && (a = ut(o)), F(o))) {
|
|
792
|
+
const f = J(o);
|
|
793
|
+
c = K(o), u.x = f.x + o.clientLeft, u.y = f.y + o.clientTop;
|
|
794
794
|
}
|
|
795
|
-
const m =
|
|
795
|
+
const m = r && !d && !i ? jt(r, a) : I(0);
|
|
796
796
|
return {
|
|
797
797
|
width: n.width * c.x,
|
|
798
798
|
height: n.height * c.y,
|
|
@@ -800,47 +800,47 @@ function Ve(e) {
|
|
|
800
800
|
y: n.y * c.y - a.scrollTop * c.y + u.y + m.y
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function He(e) {
|
|
804
804
|
return Array.from(e.getClientRects());
|
|
805
805
|
}
|
|
806
|
-
function
|
|
807
|
-
const t =
|
|
808
|
-
let
|
|
809
|
-
const
|
|
810
|
-
return
|
|
806
|
+
function qe(e) {
|
|
807
|
+
const t = L(e), n = ut(e), o = e.ownerDocument.body, s = R(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = R(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
|
808
|
+
let r = -n.scrollLeft + ft(e);
|
|
809
|
+
const l = -n.scrollTop;
|
|
810
|
+
return k(o).direction === "rtl" && (r += R(t.clientWidth, o.clientWidth) - s), {
|
|
811
811
|
width: s,
|
|
812
812
|
height: i,
|
|
813
|
-
x:
|
|
814
|
-
y:
|
|
813
|
+
x: r,
|
|
814
|
+
y: l
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
817
|
const Pt = 25;
|
|
818
|
-
function
|
|
819
|
-
const n =
|
|
820
|
-
let i = o.clientWidth,
|
|
818
|
+
function Ue(e, t) {
|
|
819
|
+
const n = S(e), o = L(e), s = n.visualViewport;
|
|
820
|
+
let i = o.clientWidth, r = o.clientHeight, l = 0, a = 0;
|
|
821
821
|
if (s) {
|
|
822
|
-
i = s.width,
|
|
823
|
-
const u =
|
|
824
|
-
(!u || u && t === "fixed") && (
|
|
822
|
+
i = s.width, r = s.height;
|
|
823
|
+
const u = vt();
|
|
824
|
+
(!u || u && t === "fixed") && (l = s.offsetLeft, a = s.offsetTop);
|
|
825
825
|
}
|
|
826
|
-
const c =
|
|
826
|
+
const c = ft(o);
|
|
827
827
|
if (c <= 0) {
|
|
828
828
|
const u = o.ownerDocument, d = u.body, m = getComputedStyle(d), f = u.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, p = Math.abs(o.clientWidth - d.clientWidth - f);
|
|
829
829
|
p <= Pt && (i -= p);
|
|
830
830
|
} else c <= Pt && (i += c);
|
|
831
831
|
return {
|
|
832
832
|
width: i,
|
|
833
|
-
height:
|
|
834
|
-
x:
|
|
833
|
+
height: r,
|
|
834
|
+
x: l,
|
|
835
835
|
y: a
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
|
-
const
|
|
839
|
-
function
|
|
840
|
-
const n =
|
|
838
|
+
const We = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
839
|
+
function Ge(e, t) {
|
|
840
|
+
const n = J(e, !0, t === "fixed"), o = n.top + e.clientTop, s = n.left + e.clientLeft, i = F(e) ? K(e) : I(1), r = e.clientWidth * i.x, l = e.clientHeight * i.y, a = s * i.x, c = o * i.y;
|
|
841
841
|
return {
|
|
842
|
-
width:
|
|
843
|
-
height:
|
|
842
|
+
width: r,
|
|
843
|
+
height: l,
|
|
844
844
|
x: a,
|
|
845
845
|
y: c
|
|
846
846
|
};
|
|
@@ -848,11 +848,11 @@ function qe(e, t) {
|
|
|
848
848
|
function Vt(e, t, n) {
|
|
849
849
|
let o;
|
|
850
850
|
if (t === "viewport")
|
|
851
|
-
o =
|
|
851
|
+
o = Ue(e, n);
|
|
852
852
|
else if (t === "document")
|
|
853
|
-
o =
|
|
854
|
-
else if (
|
|
855
|
-
o =
|
|
853
|
+
o = qe(L(e));
|
|
854
|
+
else if (T(t))
|
|
855
|
+
o = Ge(t, n);
|
|
856
856
|
else {
|
|
857
857
|
const s = zt(e);
|
|
858
858
|
o = {
|
|
@@ -862,36 +862,36 @@ function Vt(e, t, n) {
|
|
|
862
862
|
height: t.height
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
|
-
return
|
|
865
|
+
return lt(o);
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
const n =
|
|
869
|
-
return n === t || !
|
|
867
|
+
function $t(e, t) {
|
|
868
|
+
const n = H(e);
|
|
869
|
+
return n === t || !T(n) || X(n) ? !1 : k(n).position === "fixed" || $t(n, t);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Je(e, t) {
|
|
872
872
|
const n = t.get(e);
|
|
873
873
|
if (n)
|
|
874
874
|
return n;
|
|
875
|
-
let o =
|
|
876
|
-
const i =
|
|
877
|
-
let
|
|
878
|
-
for (;
|
|
879
|
-
const
|
|
880
|
-
!a &&
|
|
875
|
+
let o = tt(e, [], !1).filter((l) => T(l) && z(l) !== "body"), s = null;
|
|
876
|
+
const i = k(e).position === "fixed";
|
|
877
|
+
let r = i ? H(e) : e;
|
|
878
|
+
for (; T(r) && !X(r); ) {
|
|
879
|
+
const l = k(r), a = yt(r);
|
|
880
|
+
!a && l.position === "fixed" && (s = null), (i ? !a && !s : !a && l.position === "static" && !!s && We.has(s.position) || ot(r) && !a && $t(e, r)) ? o = o.filter((u) => u !== r) : s = l, r = H(r);
|
|
881
881
|
}
|
|
882
882
|
return t.set(e, o), o;
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function Ke(e) {
|
|
885
885
|
let {
|
|
886
886
|
element: t,
|
|
887
887
|
boundary: n,
|
|
888
888
|
rootBoundary: o,
|
|
889
889
|
strategy: s
|
|
890
890
|
} = e;
|
|
891
|
-
const
|
|
891
|
+
const r = [...n === "clippingAncestors" ? ct(t) ? [] : Je(t, this._c) : [].concat(n), o], l = r[0], a = r.reduce((c, u) => {
|
|
892
892
|
const d = Vt(t, u, s);
|
|
893
|
-
return c.top =
|
|
894
|
-
}, Vt(t,
|
|
893
|
+
return c.top = R(d.top, c.top), c.right = Y(d.right, c.right), c.bottom = Y(d.bottom, c.bottom), c.left = R(d.left, c.left), c;
|
|
894
|
+
}, Vt(t, l, s));
|
|
895
895
|
return {
|
|
896
896
|
width: a.right - a.left,
|
|
897
897
|
height: a.bottom - a.top,
|
|
@@ -899,73 +899,73 @@ function Ge(e) {
|
|
|
899
899
|
y: a.top
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function Ye(e) {
|
|
903
903
|
const {
|
|
904
904
|
width: t,
|
|
905
905
|
height: n
|
|
906
|
-
} =
|
|
906
|
+
} = Xt(e);
|
|
907
907
|
return {
|
|
908
908
|
width: t,
|
|
909
909
|
height: n
|
|
910
910
|
};
|
|
911
911
|
}
|
|
912
|
-
function
|
|
913
|
-
const o =
|
|
914
|
-
let
|
|
912
|
+
function Xe(e, t, n) {
|
|
913
|
+
const o = F(t), s = L(t), i = n === "fixed", r = J(e, !0, i, t);
|
|
914
|
+
let l = {
|
|
915
915
|
scrollLeft: 0,
|
|
916
916
|
scrollTop: 0
|
|
917
917
|
};
|
|
918
|
-
const a =
|
|
918
|
+
const a = I(0);
|
|
919
919
|
function c() {
|
|
920
|
-
a.x =
|
|
920
|
+
a.x = ft(s);
|
|
921
921
|
}
|
|
922
922
|
if (o || !o && !i)
|
|
923
|
-
if ((
|
|
924
|
-
const f =
|
|
923
|
+
if ((z(t) !== "body" || ot(s)) && (l = ut(t)), o) {
|
|
924
|
+
const f = J(t, !0, i, t);
|
|
925
925
|
a.x = f.x + t.clientLeft, a.y = f.y + t.clientTop;
|
|
926
926
|
} else s && c();
|
|
927
927
|
i && !o && s && c();
|
|
928
|
-
const u = s && !o && !i ?
|
|
928
|
+
const u = s && !o && !i ? jt(s, l) : I(0), d = r.left + l.scrollLeft - a.x - u.x, m = r.top + l.scrollTop - a.y - u.y;
|
|
929
929
|
return {
|
|
930
930
|
x: d,
|
|
931
931
|
y: m,
|
|
932
|
-
width:
|
|
933
|
-
height:
|
|
932
|
+
width: r.width,
|
|
933
|
+
height: r.height
|
|
934
934
|
};
|
|
935
935
|
}
|
|
936
936
|
function mt(e) {
|
|
937
|
-
return
|
|
937
|
+
return k(e).position === "static";
|
|
938
938
|
}
|
|
939
939
|
function Qt(e, t) {
|
|
940
|
-
if (!
|
|
940
|
+
if (!F(e) || k(e).position === "fixed")
|
|
941
941
|
return null;
|
|
942
942
|
if (t)
|
|
943
943
|
return t(e);
|
|
944
944
|
let n = e.offsetParent;
|
|
945
|
-
return
|
|
945
|
+
return L(e) === n && (n = n.ownerDocument.body), n;
|
|
946
946
|
}
|
|
947
|
-
function
|
|
948
|
-
const n =
|
|
949
|
-
if (
|
|
947
|
+
function Zt(e, t) {
|
|
948
|
+
const n = S(e);
|
|
949
|
+
if (ct(e))
|
|
950
950
|
return n;
|
|
951
|
-
if (!
|
|
952
|
-
let s =
|
|
953
|
-
for (; s &&
|
|
954
|
-
if (
|
|
951
|
+
if (!F(e)) {
|
|
952
|
+
let s = H(e);
|
|
953
|
+
for (; s && !X(s); ) {
|
|
954
|
+
if (T(s) && !mt(s))
|
|
955
955
|
return s;
|
|
956
|
-
s =
|
|
956
|
+
s = H(s);
|
|
957
957
|
}
|
|
958
958
|
return n;
|
|
959
959
|
}
|
|
960
960
|
let o = Qt(e, t);
|
|
961
|
-
for (; o &&
|
|
961
|
+
for (; o && ke(o) && mt(o); )
|
|
962
962
|
o = Qt(o, t);
|
|
963
|
-
return o &&
|
|
963
|
+
return o && X(o) && mt(o) && !yt(o) ? n : o || Me(e) || n;
|
|
964
964
|
}
|
|
965
|
-
const
|
|
966
|
-
const t = this.getOffsetParent ||
|
|
965
|
+
const ze = async function(e) {
|
|
966
|
+
const t = this.getOffsetParent || Zt, n = this.getDimensions, o = await n(e.floating);
|
|
967
967
|
return {
|
|
968
|
-
reference:
|
|
968
|
+
reference: Xe(e.reference, await t(e.floating), e.strategy),
|
|
969
969
|
floating: {
|
|
970
970
|
x: 0,
|
|
971
971
|
y: 0,
|
|
@@ -974,121 +974,121 @@ const Ye = async function(e) {
|
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
976
|
};
|
|
977
|
-
function
|
|
978
|
-
return
|
|
979
|
-
}
|
|
980
|
-
const
|
|
981
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
982
|
-
getDocumentElement:
|
|
983
|
-
getClippingRect:
|
|
984
|
-
getOffsetParent:
|
|
985
|
-
getElementRects:
|
|
986
|
-
getClientRects:
|
|
987
|
-
getDimensions:
|
|
988
|
-
getScale:
|
|
989
|
-
isElement:
|
|
990
|
-
isRTL:
|
|
977
|
+
function je(e) {
|
|
978
|
+
return k(e).direction === "rtl";
|
|
979
|
+
}
|
|
980
|
+
const $e = {
|
|
981
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ne,
|
|
982
|
+
getDocumentElement: L,
|
|
983
|
+
getClippingRect: Ke,
|
|
984
|
+
getOffsetParent: Zt,
|
|
985
|
+
getElementRects: ze,
|
|
986
|
+
getClientRects: He,
|
|
987
|
+
getDimensions: Ye,
|
|
988
|
+
getScale: K,
|
|
989
|
+
isElement: T,
|
|
990
|
+
isRTL: je
|
|
991
991
|
};
|
|
992
|
-
function
|
|
992
|
+
function te(e, t) {
|
|
993
993
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Ze(e, t) {
|
|
996
996
|
let n = null, o;
|
|
997
|
-
const s =
|
|
997
|
+
const s = L(e);
|
|
998
998
|
function i() {
|
|
999
|
-
var
|
|
1000
|
-
clearTimeout(o), (
|
|
999
|
+
var l;
|
|
1000
|
+
clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
|
|
1001
1001
|
}
|
|
1002
|
-
function l
|
|
1003
|
-
|
|
1002
|
+
function r(l, a) {
|
|
1003
|
+
l === void 0 && (l = !1), a === void 0 && (a = 1), i();
|
|
1004
1004
|
const c = e.getBoundingClientRect(), {
|
|
1005
1005
|
left: u,
|
|
1006
1006
|
top: d,
|
|
1007
1007
|
width: m,
|
|
1008
1008
|
height: f
|
|
1009
1009
|
} = c;
|
|
1010
|
-
if (
|
|
1010
|
+
if (l || t(), !m || !f)
|
|
1011
1011
|
return;
|
|
1012
|
-
const p =
|
|
1013
|
-
rootMargin: -p + "px " + -
|
|
1014
|
-
threshold:
|
|
1012
|
+
const p = st(d), h = st(s.clientWidth - (u + m)), y = st(s.clientHeight - (d + f)), g = st(u), A = {
|
|
1013
|
+
rootMargin: -p + "px " + -h + "px " + -y + "px " + -g + "px",
|
|
1014
|
+
threshold: R(0, Y(1, a)) || 1
|
|
1015
1015
|
};
|
|
1016
|
-
let
|
|
1017
|
-
function
|
|
1018
|
-
const
|
|
1019
|
-
if (
|
|
1020
|
-
if (!
|
|
1021
|
-
return
|
|
1022
|
-
|
|
1023
|
-
|
|
1016
|
+
let b = !0;
|
|
1017
|
+
function w(E) {
|
|
1018
|
+
const D = E[0].intersectionRatio;
|
|
1019
|
+
if (D !== a) {
|
|
1020
|
+
if (!b)
|
|
1021
|
+
return r();
|
|
1022
|
+
D ? r(!1, D) : o = setTimeout(() => {
|
|
1023
|
+
r(!1, 1e-7);
|
|
1024
1024
|
}, 1e3);
|
|
1025
1025
|
}
|
|
1026
|
-
|
|
1026
|
+
D === 1 && !te(c, e.getBoundingClientRect()) && r(), b = !1;
|
|
1027
1027
|
}
|
|
1028
1028
|
try {
|
|
1029
|
-
n = new IntersectionObserver(
|
|
1030
|
-
...
|
|
1029
|
+
n = new IntersectionObserver(w, {
|
|
1030
|
+
...A,
|
|
1031
1031
|
// Handle <iframe>s
|
|
1032
1032
|
root: s.ownerDocument
|
|
1033
1033
|
});
|
|
1034
1034
|
} catch {
|
|
1035
|
-
n = new IntersectionObserver(
|
|
1035
|
+
n = new IntersectionObserver(w, A);
|
|
1036
1036
|
}
|
|
1037
1037
|
n.observe(e);
|
|
1038
1038
|
}
|
|
1039
|
-
return
|
|
1039
|
+
return r(!0), i;
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function tn(e, t, n, o) {
|
|
1042
1042
|
o === void 0 && (o = {});
|
|
1043
1043
|
const {
|
|
1044
1044
|
ancestorScroll: s = !0,
|
|
1045
1045
|
ancestorResize: i = !0,
|
|
1046
|
-
elementResize:
|
|
1047
|
-
layoutShift:
|
|
1046
|
+
elementResize: r = typeof ResizeObserver == "function",
|
|
1047
|
+
layoutShift: l = typeof IntersectionObserver == "function",
|
|
1048
1048
|
animationFrame: a = !1
|
|
1049
|
-
} = o, c = At(e), u = s || i ? [...c ?
|
|
1050
|
-
u.forEach((
|
|
1051
|
-
s &&
|
|
1049
|
+
} = o, c = At(e), u = s || i ? [...c ? tt(c) : [], ...tt(t)] : [];
|
|
1050
|
+
u.forEach((g) => {
|
|
1051
|
+
s && g.addEventListener("scroll", n, {
|
|
1052
1052
|
passive: !0
|
|
1053
|
-
}), i &&
|
|
1053
|
+
}), i && g.addEventListener("resize", n);
|
|
1054
1054
|
});
|
|
1055
|
-
const d = c &&
|
|
1055
|
+
const d = c && l ? Ze(c, n) : null;
|
|
1056
1056
|
let m = -1, f = null;
|
|
1057
|
-
|
|
1058
|
-
let [
|
|
1059
|
-
|
|
1060
|
-
var
|
|
1061
|
-
(
|
|
1057
|
+
r && (f = new ResizeObserver((g) => {
|
|
1058
|
+
let [v] = g;
|
|
1059
|
+
v && v.target === c && f && (f.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1060
|
+
var A;
|
|
1061
|
+
(A = f) == null || A.observe(t);
|
|
1062
1062
|
})), n();
|
|
1063
1063
|
}), c && !a && f.observe(c), f.observe(t));
|
|
1064
|
-
let p,
|
|
1064
|
+
let p, h = a ? J(e) : null;
|
|
1065
1065
|
a && y();
|
|
1066
1066
|
function y() {
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1067
|
+
const g = J(e);
|
|
1068
|
+
h && !te(h, g) && n(), h = g, p = requestAnimationFrame(y);
|
|
1069
1069
|
}
|
|
1070
1070
|
return n(), () => {
|
|
1071
|
-
var
|
|
1072
|
-
u.forEach((
|
|
1073
|
-
s &&
|
|
1074
|
-
}), d?.(), (
|
|
1071
|
+
var g;
|
|
1072
|
+
u.forEach((v) => {
|
|
1073
|
+
s && v.removeEventListener("scroll", n), i && v.removeEventListener("resize", n);
|
|
1074
|
+
}), d?.(), (g = f) == null || g.disconnect(), f = null, a && cancelAnimationFrame(p);
|
|
1075
1075
|
};
|
|
1076
1076
|
}
|
|
1077
|
-
const
|
|
1077
|
+
const en = De, nn = Ee, on = Ce, sn = Oe, rn = (e, t, n) => {
|
|
1078
1078
|
const o = /* @__PURE__ */ new Map(), s = {
|
|
1079
|
-
platform:
|
|
1079
|
+
platform: $e,
|
|
1080
1080
|
...n
|
|
1081
1081
|
}, i = {
|
|
1082
1082
|
...s.platform,
|
|
1083
1083
|
_c: o
|
|
1084
1084
|
};
|
|
1085
|
-
return
|
|
1085
|
+
return be(e, t, {
|
|
1086
1086
|
...s,
|
|
1087
1087
|
platform: i
|
|
1088
1088
|
});
|
|
1089
1089
|
};
|
|
1090
|
-
function
|
|
1091
|
-
const n =
|
|
1090
|
+
function ln(e, t) {
|
|
1091
|
+
const n = C({
|
|
1092
1092
|
position: "fixed",
|
|
1093
1093
|
left: "0",
|
|
1094
1094
|
top: "0",
|
|
@@ -1097,19 +1097,19 @@ function sn(e, t) {
|
|
|
1097
1097
|
});
|
|
1098
1098
|
let o = null;
|
|
1099
1099
|
const s = () => {
|
|
1100
|
-
!e.value || !t.value ||
|
|
1100
|
+
!e.value || !t.value || rn(e.value, t.value, {
|
|
1101
1101
|
placement: "bottom-start",
|
|
1102
1102
|
strategy: "fixed",
|
|
1103
1103
|
middleware: [
|
|
1104
|
-
|
|
1104
|
+
en(6),
|
|
1105
1105
|
// 输入框与下拉列表的间距
|
|
1106
|
-
|
|
1106
|
+
on(),
|
|
1107
1107
|
// 空间不足自动翻转到上方
|
|
1108
|
-
|
|
1108
|
+
nn({ padding: 10 }),
|
|
1109
1109
|
// 靠近屏幕边缘时自动位移
|
|
1110
|
-
|
|
1111
|
-
apply({ rects:
|
|
1112
|
-
const c = `${
|
|
1110
|
+
sn({
|
|
1111
|
+
apply({ rects: l, elements: a }) {
|
|
1112
|
+
const c = `${l.reference.width}px`;
|
|
1113
1113
|
Object.assign(a.floating.style, {
|
|
1114
1114
|
width: c,
|
|
1115
1115
|
// 必须锁定,否则在 body 下它可能由于内容过多撑开到 100vw
|
|
@@ -1119,20 +1119,20 @@ function sn(e, t) {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
})
|
|
1121
1121
|
]
|
|
1122
|
-
}).then(({ x:
|
|
1122
|
+
}).then(({ x: l, y: a }) => {
|
|
1123
1123
|
Object.assign(n.value, {
|
|
1124
|
-
left: `${
|
|
1124
|
+
left: `${l}px`,
|
|
1125
1125
|
top: `${a}px`
|
|
1126
1126
|
});
|
|
1127
1127
|
});
|
|
1128
1128
|
}, i = () => {
|
|
1129
|
-
e.value && t.value && (o =
|
|
1130
|
-
},
|
|
1129
|
+
e.value && t.value && (o = tn(e.value, t.value, s));
|
|
1130
|
+
}, r = () => {
|
|
1131
1131
|
o && (o(), o = null);
|
|
1132
1132
|
};
|
|
1133
|
-
return
|
|
1133
|
+
return qt(r), { floatingStyles: n, startTrack: i, stopTrack: r };
|
|
1134
1134
|
}
|
|
1135
|
-
const
|
|
1135
|
+
const an = "data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2534'%20width='200'%20height='200'%3e%3cpath%20d='M448%2085.333333a362.666667%20362.666667%200%201%200%20224.512%20647.509334l155.818667%20155.818666a42.666667%2042.666667%200%200%200%2060.330666-60.330666l-155.818666-155.818667A362.666667%20362.666667%200%200%200%20448%2085.333333zM170.666667%20448a277.333333%20277.333333%200%201%201%20554.666666%200%20277.333333%20277.333333%200%200%201-554.666666%200z'%20p-id='2535'%3e%3c/path%3e%3c/svg%3e", cn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms8HjSgJctn1xIt6hxqIkdK+u8U8zT1ESmP5enUkWmqMkhG2FmxXOvR+EGD5KAhoDqsQvtiMXJQGNQJ4N8mF6PMd/wL8SxuOXPSG21pj9p+L1EOjGyAHoQQ0zWGDqx9pbPWIpwqOEkw+gGyMHoAc1ozOkVhOcZyepYndNpDpPvwAAAP//BVQJHAAAAAZJREFUAwDZWL4hub5xHQAAAABJRU5ErkJggg==", un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACC0lEQVR4AXxRv2tTURT+zk1iIjgoOMShkIJVNwf/gQYULOjQwaGvGl8TBMEMDg4ODgF17likvL4HIYm4OLg61K2CooWKDoKCDoJDHASb9N17POf5Enwk6eN+9/z+3nfvNZjxbYS9ymbYXlQ8CbvnZrRhKoEOFMl9zFHuuaJA/E4Jp5FMJTCwZWner/veCYX6ecQVsRNrKsFE1yGJDMFW1Hm4FXX7hnIvADquvkJ9zYn/U3vw35chYOA2Ebcc26uWbVWwnKKqOak9ktmmYLwyBATkY+d2b63d2FYgps9umNtTX6G18WTqmNRmTNB+djaIOqEpmC+FIn8Lom4vaD89n2lKgwkCebYNsvEnAlXI4CIMXSagTNa9l9p6Ojc2CUEYhiW5oE3IxQH4AYNFeb5qvea9SuB7Vc1J7ReDjomidZ2RWNKysyneFHNFovGgxIiizoWR9BGRqiKw76i0qj2JAo7jtwycJDvY1eQIDNM0lu+OYrUHf/BBbEmI9sTKP2VvNGpvAP4Kc1SVSGb2OlLiVQa+12srr7UrUZA6Lx27e0HUu6PnU/kOXGbwaT1Gq9XKa80xmgTa1hlFQiBP1hNWn4AdOd8DpmLfgnakYV/yv/UF5ipn+qLyvgGp2us6I/V/R+DYPiYenpKbv0Y8mGeLS0OmhYbvLQuWiGkeFkuGBwtrvrdyMKA5nVGCvwAAAP//q4xnOgAAAAZJREFUAwCH2O8KfEWHWQAAAABJRU5ErkJggg==", fn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACT0lEQVR4AaRSO2hTYRT+zn9v2g6CiktFJYoVHXQoOljM2EIEh0orbRKa5qUuDoIZAnXI4FBwcRDikMcNkoQMQjcVESo4OASsW2kLBi3oUKiD1OZx7/H811wJZFF6uOee85/H93/3nKtwQPkvgFKpdKRgVR+UrFrOsurX9N3/DJCvVPxMwx+lKcbgKzbstPhwAXSyWK7eLZZrc4VCNZDPPx/Tt+kCrTqvOrQqfuNrc2OcgW0CduQM9TfJyIB5mQy8UaaxKbftFq3qL9HP1KGGFDe+NDdC/jPnlwgcZEM9lRiU2VFjgngI4FGxa0IvZXecU07XPsc2pkCUIULaa2Z2MsJ7Orkw/8kFiMVCb4XWcQV14w8temL4aJNM47Fh0OHEYqieWAyXT/jPBhzmh7o5EY28Rk/cGWSz2a4GSsTCt3tgs5qmDc726sTQvsS6/c0SFDz97lO/329K4z2Amm1u3ZK11SyrOmNC/ZDYSElWiT5R2resymUZ1pIUv2Qa+iafcrrFretDNJwTf94GUnt7u9u6to3hUW09dQEcIC+BR0LxqgztPnFrotd8wWHclNykaR4dYeCngj0IQNyekOQshLas8hmzLyA3B2UTU6l4eEX8Ld8IZsTu+Mg4hj5xGcTj8f1kLPxChjgO0AdWlAOwnkotbImFrHGFGdOy6u82aJAB+kUZywQ6KaH3ou7TcbguziRApiLWOXjiMvAO2iaic3rH6wxe1Wetd+KRNQKEDV9kwisd83QAQCfkr7uUjEUq2vdUgdJQFExEw++8mLa/AQAA//9h0VsEAAAABklEQVQDAKhs6Pxd3K8TAAAAAElFTkSuQmCC", dn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACmklEQVR4AXRTT0jUQRT+3uyqGxgYeCiy1JAo6JBUp4Q81EEiKKiDa+H+/ENGHgPpZtChQ4EHL+Ku+9t0V7EkQSGPBYGHBIU6RAqt2cFDBw9C+3de3yy7hobDvHm/+d4337x58xuDQ9r4+FRDLJZqG49PtrvvQ2j4TyDmJ7sm/NRqoMpsIYD3RgIL7pvY54lEqvug0J5APB4PxfzUOwFGRWReVJp7I+GjW+nvxxQo0DagOjLhJxcctyK0J6BS/UaAc1nNtXrdnc88rzPtSMPDwwXiM7R2WNwDpMVKzTTKrSRQTq0tq9mOR55XWliOY2wsVQ+RRWZQiyACjiPQ9pg/0+U4JQEoBkXMi4OLmWpdsEZXofY5yYtSzH10HHJHBPYJMZhyhS8X84U5B+y36iaBNPxMr59nPTo9z8uU4jaToL8Yj88eN2xNTG+3r+/BBncMuSLRln1/+iZgdkhEY2NjvfMVo1DarbG20GIqoPMaqL5G38Zb+GBh36roMufpzc3N3xSvi0ZfX6APEYNAg86bjMluCFDr+7OX1JoWQNJed/ipaK6Z6oOi2dbTZ85eVan+YYLBL7yBdRb9IXkha23aPPa8bQBrFoUVqo4qMMU5mOZ2JBKeo98RiwHi8xQ7Qo6vCsdb6e+//4ubgJegLzlmDOQ6i/XKCVQskZg9aaFtRrBGsYytQpQiu+SPOI5xQ2+kK6mQJRJHo8lko8MqxswGhceCzY25mMnLEmOf3Br6f2/BaLaTqhuSl6/xxPRQNDrJehBRrSWxABMaMnmsKfCN9eEfSZS9lAG9O3OmJ9J1C9ABVb1rgoF1PqA/Cokw3k7stgKDvZHwHXcUYqW+J1CacejlcXoi4SvFvD2lRdxAER0s3glirS5Gyr7+FwAA//8Pj6q2AAAABklEQVQDAJPeLlNn5TR8AAAAAElFTkSuQmCC", mn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgUlEQVR4AXRST0hUYRD/zbfbrqahQpAHlQ3dSurYoaBAwWNQkIT7J/ve09DQsOigkNCha4ckl4Lct0/S3QI7REFEBB08FBHRIYLwIJEodOlUurnfNN+6mq9weMPM+818v2/mm1HYQXK5XH02mz9h1fo7pOE/gkwmU+v5+fuGot8phJdWmSLLnl+4I0RV/xIFCGxCdU3DUwaOkULX18Uve1ydrC4xdwLcwRR9bnO2kwQIoCIDEowpXjsZ4vBCSyx+w/Nnb1KElkkwG4OqGhG79QUImEkT0T2JrpZ4fV5sF0Ad6je9BrBKxLeZuVv8rS9IAG4qGf5oTPSolNxIXOyUNjqlpb0W4xI+Cd62dVqcAAGBVqSCVmPMIoPCttzm2MEBAoeLir4hRK2AWPyVIAHRHMH0Ly0tCBF3M5t+Aq6A0HPJSSyCeZAIz7BNAgQwqxNyc1NL7MCoeyH1xNWpuKsTcet7fv46QI0/zdoEtkmAwHGcHyFQj/Q57vuPzm7m+X5efB6HYj3kOCubuLVlApltfdbPX5uaetCmdeKVAqUN1mdy04XR3PTsqAHPWMztTb24myvEBBuRM+WlUnbzDEXeya2D4XC0zrJqnXwsO3pG3mCMGWMK6lQZk2A0hH2GMSxL9VlI6lVkd90RgGKkVFrrc+9REXubjLH9FxfbbVUVGG5v4i2p8LD8x9ax65C66KTfKGCSDc97fv6DJzuf9QtDtm+iqsM1ot70w9O+YDbmSQ6bkkyCJitnAUcnryqmuExgSsZYKypvgFvS+5xVsJk0MGlps97mFCVXpnNZqoBcbo2QyJz7dCLj6JTj6tRxVyf3izZUtNndwM73SU55JzaO4Q8AAAD//54At5MAAAAGSURBVAMAh2IbMAJQAZQAAAAASUVORK5CYII=", pn = ie({
|
|
1136
1136
|
name: "GlobalSearch",
|
|
1137
1137
|
model: { prop: "value", event: "input" },
|
|
1138
1138
|
props: {
|
|
@@ -1143,143 +1143,122 @@ const ln = "data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20clas
|
|
|
1143
1143
|
type: Array,
|
|
1144
1144
|
default: () => ["City", "Seaport", "Airport", "Country"]
|
|
1145
1145
|
},
|
|
1146
|
-
historyKey: { type: String, default:
|
|
1147
|
-
lang: {
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
}
|
|
1146
|
+
historyKey: { type: String, default: "" },
|
|
1147
|
+
lang: { type: String, default: "" },
|
|
1148
|
+
placeholder: { type: String, default: "" },
|
|
1149
|
+
showSearchIcon: { type: Boolean, default: !0 },
|
|
1150
|
+
showItemTag: { type: Boolean, default: !0 }
|
|
1152
1151
|
},
|
|
1153
1152
|
setup(e, { emit: t }) {
|
|
1154
|
-
const n =
|
|
1155
|
-
|
|
1153
|
+
const n = C(""), o = C(!1), s = C(!1), i = C(""), r = C(null), l = C(null), a = C(null), c = C(null), { searchHistory: u, saveToHistory: d, clearHistory: m } = le(
|
|
1154
|
+
xt(e, "historyKey")
|
|
1156
1155
|
), {
|
|
1157
1156
|
searchResults: f,
|
|
1158
1157
|
loading: p,
|
|
1159
|
-
isFetchingMore:
|
|
1158
|
+
isFetchingMore: h,
|
|
1160
1159
|
isFinished: y,
|
|
1161
|
-
currentPage:
|
|
1162
|
-
fetchData:
|
|
1163
|
-
filterByTypes:
|
|
1164
|
-
} =
|
|
1160
|
+
currentPage: g,
|
|
1161
|
+
fetchData: v,
|
|
1162
|
+
filterByTypes: A
|
|
1163
|
+
} = ue(n, xt(e, "searchTypeList")), { floatingStyles: b, startTrack: w, stopTrack: E } = ln(
|
|
1165
1164
|
a,
|
|
1166
1165
|
c
|
|
1167
|
-
),
|
|
1166
|
+
), D = async () => {
|
|
1168
1167
|
if (s.value = !0, console.log(
|
|
1169
1168
|
"🍉 ~ index.vue:210 ~ onFocus ~ searchResults.value:",
|
|
1170
1169
|
f.value,
|
|
1171
1170
|
o.value
|
|
1172
1171
|
), !e.multiple && o.value && f.value.length === 0) {
|
|
1173
|
-
const
|
|
1174
|
-
if (console.log("🍉 ~ index.vue:221 ~ onFocus ~ val:",
|
|
1172
|
+
const x = e.value;
|
|
1173
|
+
if (console.log("🍉 ~ index.vue:221 ~ onFocus ~ val:", x), x?.id) {
|
|
1175
1174
|
p.value = !0;
|
|
1176
1175
|
try {
|
|
1177
|
-
const
|
|
1178
|
-
f.value =
|
|
1176
|
+
const P = await ce(x.id, x.type);
|
|
1177
|
+
f.value = A(P.records);
|
|
1179
1178
|
} finally {
|
|
1180
1179
|
p.value = !1;
|
|
1181
1180
|
}
|
|
1182
1181
|
}
|
|
1183
1182
|
}
|
|
1184
|
-
},
|
|
1183
|
+
}, B = () => {
|
|
1185
1184
|
setTimeout(() => {
|
|
1186
1185
|
s.value = !1;
|
|
1187
1186
|
}, 200);
|
|
1188
|
-
},
|
|
1189
|
-
|
|
1190
|
-
},
|
|
1187
|
+
}, M = (x) => {
|
|
1188
|
+
x.target.value === "" && !e.multiple && (o.value = !1, t("input", null), t("update:value", null));
|
|
1189
|
+
}, O = () => {
|
|
1191
1190
|
if (e.multiple && !n.value && e.value?.length > 0) {
|
|
1192
|
-
const
|
|
1193
|
-
t("input",
|
|
1191
|
+
const x = [...e.value], P = x.pop();
|
|
1192
|
+
t("input", x), t("update:value", x), t("remove", P);
|
|
1194
1193
|
}
|
|
1195
|
-
}, W = (h) => T.value ? h.displayEn || h.display || "" : h.displayCn || h.display || "", G = (h) => {
|
|
1196
|
-
const x = {
|
|
1197
|
-
City: {
|
|
1198
|
-
en: "City",
|
|
1199
|
-
cn: "城市"
|
|
1200
|
-
},
|
|
1201
|
-
Country: {
|
|
1202
|
-
en: "Country",
|
|
1203
|
-
cn: "国家"
|
|
1204
|
-
},
|
|
1205
|
-
Region: {
|
|
1206
|
-
en: "Region",
|
|
1207
|
-
cn: "区域"
|
|
1208
|
-
},
|
|
1209
|
-
Airport: {
|
|
1210
|
-
en: "Airport",
|
|
1211
|
-
cn: "机场"
|
|
1212
|
-
},
|
|
1213
|
-
Seaport: {
|
|
1214
|
-
en: "Seaport",
|
|
1215
|
-
cn: "港口"
|
|
1216
|
-
}
|
|
1217
|
-
};
|
|
1218
|
-
return console.log("🍉 ~ index.vue:434 ~ getItemType ~ isEn.value:", T.value), T.value ? x[h].en : x[h].cn;
|
|
1219
1194
|
};
|
|
1220
|
-
|
|
1221
|
-
if (!
|
|
1195
|
+
return bt(s, (x) => x ? w() : E()), bt(n, (x) => {
|
|
1196
|
+
if (!x.trim()) {
|
|
1222
1197
|
f.value = [];
|
|
1223
1198
|
return;
|
|
1224
1199
|
}
|
|
1225
|
-
|
|
1226
|
-
}),
|
|
1227
|
-
const T = L(() => {
|
|
1228
|
-
if (e.lang !== "")
|
|
1229
|
-
return e.lang === "en" || e.lang === "en-US";
|
|
1230
|
-
let h = "";
|
|
1231
|
-
try {
|
|
1232
|
-
if (typeof useCookie == "function") {
|
|
1233
|
-
const x = useCookie("jc-language").value;
|
|
1234
|
-
if (x) return /en/.test(x) || /en-US/.test(x);
|
|
1235
|
-
}
|
|
1236
|
-
} catch {
|
|
1237
|
-
}
|
|
1238
|
-
return typeof process < "u" && process.client ? h = document.cookie || "" : typeof process < "u" && process.server && (h = useNuxtApp?.()?.ssrContext?.event.node.req.headers.cookie || ""), /jc-language=en-US/.test(h) || /jc-language=en/.test(h);
|
|
1239
|
-
}), E = L(() => e.modelValue ? Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue] : []), tt = L(() => e.multiple && E.value.length > 0 ? "" : o.value && !e.multiple ? i.value : T.value ? "Please enter..." : "请输入..."), J = L(() => e.multiple ? e.collapseTags ? E.value.slice(0, 1) : E.value : []), N = L(() => e.multiple ? n.value ? `${n.value.length * 10 + 20}px` : "10px" : "100%");
|
|
1240
|
-
return {
|
|
1200
|
+
r.value && clearTimeout(r.value), r.value = setTimeout(() => v(1, !1), 300);
|
|
1201
|
+
}), qt(E), {
|
|
1241
1202
|
// 状态
|
|
1242
1203
|
query: n,
|
|
1243
1204
|
isSelected: o,
|
|
1244
1205
|
isDropdownVisible: s,
|
|
1245
1206
|
selectedLabel: i,
|
|
1246
|
-
inputRef:
|
|
1207
|
+
inputRef: l,
|
|
1247
1208
|
referenceRef: a,
|
|
1248
1209
|
floatingRef: c,
|
|
1249
1210
|
// Hook 状态
|
|
1250
1211
|
searchHistory: u,
|
|
1251
1212
|
searchResults: f,
|
|
1252
1213
|
loading: p,
|
|
1253
|
-
isFetchingMore:
|
|
1214
|
+
isFetchingMore: h,
|
|
1254
1215
|
isFinished: y,
|
|
1255
|
-
currentPage:
|
|
1256
|
-
floatingStyles:
|
|
1216
|
+
currentPage: g,
|
|
1217
|
+
floatingStyles: b,
|
|
1257
1218
|
// Hook 方法
|
|
1258
1219
|
saveToHistory: d,
|
|
1259
1220
|
clearHistory: m,
|
|
1260
|
-
fetchData:
|
|
1261
|
-
filterByTypes:
|
|
1262
|
-
startTrack:
|
|
1263
|
-
stopTrack:
|
|
1221
|
+
fetchData: v,
|
|
1222
|
+
filterByTypes: A,
|
|
1223
|
+
startTrack: w,
|
|
1224
|
+
stopTrack: E,
|
|
1264
1225
|
// 组件方法
|
|
1265
|
-
onFocus:
|
|
1266
|
-
handleBlur:
|
|
1267
|
-
onInput:
|
|
1268
|
-
handleDelete:
|
|
1226
|
+
onFocus: D,
|
|
1227
|
+
handleBlur: B,
|
|
1228
|
+
onInput: M,
|
|
1229
|
+
handleDelete: O,
|
|
1269
1230
|
// 资源
|
|
1270
|
-
SearchIcon:
|
|
1271
|
-
isEn: T,
|
|
1272
|
-
getItemType: G,
|
|
1273
|
-
getItemLabel: W,
|
|
1274
|
-
selectedItems: E,
|
|
1275
|
-
currentPlaceholder: tt,
|
|
1276
|
-
displayedTags: J,
|
|
1277
|
-
inputWidth: N
|
|
1231
|
+
SearchIcon: an
|
|
1278
1232
|
};
|
|
1279
1233
|
},
|
|
1280
1234
|
computed: {
|
|
1235
|
+
isEn() {
|
|
1236
|
+
if (this.lang !== "")
|
|
1237
|
+
return this.lang === "en" || this.lang === "en-US";
|
|
1238
|
+
let e = "";
|
|
1239
|
+
try {
|
|
1240
|
+
if (typeof useCookie == "function") {
|
|
1241
|
+
const t = useCookie("jc-language").value;
|
|
1242
|
+
if (t) return /en/.test(t) || /en-US/.test(t);
|
|
1243
|
+
}
|
|
1244
|
+
} catch {
|
|
1245
|
+
}
|
|
1246
|
+
return typeof process < "u" && process.client ? e = document.cookie || "" : typeof process < "u" && process.server && (e = useNuxtApp?.()?.ssrContext?.event.node.req.headers.cookie || ""), /jc-language=en-US/.test(e) || /jc-language=en/.test(e);
|
|
1247
|
+
},
|
|
1248
|
+
selectedItems() {
|
|
1249
|
+
return this.value ? Array.isArray(this.value) ? this.value : [this.value] : [];
|
|
1250
|
+
},
|
|
1251
|
+
displayedTags() {
|
|
1252
|
+
return this.collapseTags ? this.selectedItems.slice(0, 1) : this.selectedItems;
|
|
1253
|
+
},
|
|
1281
1254
|
hasValue() {
|
|
1282
1255
|
return this.query || this.selectedItems.length > 0;
|
|
1256
|
+
},
|
|
1257
|
+
inputWidth() {
|
|
1258
|
+
return this.multiple ? this.query ? `${this.query.length * 10 + 20}px` : "10px" : "100%";
|
|
1259
|
+
},
|
|
1260
|
+
currentPlaceholder() {
|
|
1261
|
+
return this.multiple && this.selectedItems.length > 0 ? "" : this.isSelected && !this.multiple ? this.selectedLabel : this.placeholder || this.isEn ? "Please enter..." : "请输入...";
|
|
1283
1262
|
}
|
|
1284
1263
|
},
|
|
1285
1264
|
methods: {
|
|
@@ -1287,7 +1266,32 @@ const ln = "data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20clas
|
|
|
1287
1266
|
this.$refs.inputRef?.focus();
|
|
1288
1267
|
},
|
|
1289
1268
|
getItemLabel(e) {
|
|
1290
|
-
return e.display || e.
|
|
1269
|
+
return this.isEn ? e.displayEn || e.display || "" : e.displayCn || e.display || "";
|
|
1270
|
+
},
|
|
1271
|
+
getItemType(e) {
|
|
1272
|
+
const t = {
|
|
1273
|
+
City: {
|
|
1274
|
+
en: "City",
|
|
1275
|
+
cn: "城市"
|
|
1276
|
+
},
|
|
1277
|
+
Country: {
|
|
1278
|
+
en: "Country",
|
|
1279
|
+
cn: "国家"
|
|
1280
|
+
},
|
|
1281
|
+
Region: {
|
|
1282
|
+
en: "Region",
|
|
1283
|
+
cn: "区域"
|
|
1284
|
+
},
|
|
1285
|
+
Airport: {
|
|
1286
|
+
en: "Airport",
|
|
1287
|
+
cn: "机场"
|
|
1288
|
+
},
|
|
1289
|
+
Seaport: {
|
|
1290
|
+
en: "Seaport",
|
|
1291
|
+
cn: "港口"
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
return this.isEn ? t[e].en : t[e].cn;
|
|
1291
1295
|
},
|
|
1292
1296
|
isItemActive(e) {
|
|
1293
1297
|
return this.selectedItems.some((t) => t.id === e.id);
|
|
@@ -1308,11 +1312,11 @@ const ln = "data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20clas
|
|
|
1308
1312
|
},
|
|
1309
1313
|
getIconUrl(e) {
|
|
1310
1314
|
return {
|
|
1311
|
-
City:
|
|
1312
|
-
Seaport:
|
|
1313
|
-
Airport:
|
|
1314
|
-
Country:
|
|
1315
|
-
}[e] ||
|
|
1315
|
+
City: cn,
|
|
1316
|
+
Seaport: un,
|
|
1317
|
+
Airport: fn,
|
|
1318
|
+
Country: dn
|
|
1319
|
+
}[e] || mn;
|
|
1316
1320
|
},
|
|
1317
1321
|
handleScroll(e) {
|
|
1318
1322
|
const { scrollTop: t, scrollHeight: n, clientHeight: o } = e.target;
|
|
@@ -1320,14 +1324,14 @@ const ln = "data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20clas
|
|
|
1320
1324
|
}
|
|
1321
1325
|
}
|
|
1322
1326
|
});
|
|
1323
|
-
function wt(e, t, n, o, s, i,
|
|
1327
|
+
function wt(e, t, n, o, s, i, r, l) {
|
|
1324
1328
|
var a = typeof e == "function" ? e.options : e;
|
|
1325
1329
|
return t && (a.render = t, a.staticRenderFns = n, a._compiled = !0), i && (a._scopeId = "data-v-" + i), {
|
|
1326
1330
|
exports: e,
|
|
1327
1331
|
options: a
|
|
1328
1332
|
};
|
|
1329
1333
|
}
|
|
1330
|
-
var
|
|
1334
|
+
var hn = function() {
|
|
1331
1335
|
var t = this, n = t._self._c;
|
|
1332
1336
|
return t._self._setupProxy, n("div", { staticClass: "search-container" }, [n("div", { ref: "referenceRef", staticClass: "search-input-wrapper", class: { "is-multiple": t.multiple }, on: { click: t.focusInput } }, [n("div", { staticClass: "selection-wrapper" }, [t.multiple && t.selectedItems.length > 0 ? [t._l(t.displayedTags, function(o, s) {
|
|
1333
1337
|
return n("div", { key: o.id || s, staticClass: "search-tag" }, [n("span", { staticClass: "tag-text" }, [t._v(t._s(t.getItemLabel(o)))]), n("span", { staticClass: "tag-close", on: { click: function(i) {
|
|
@@ -1341,9 +1345,9 @@ var mn = function() {
|
|
|
1341
1345
|
o.preventDefault();
|
|
1342
1346
|
}, click: function(o) {
|
|
1343
1347
|
return o.stopPropagation(), t.clearAll.apply(null, arguments);
|
|
1344
|
-
} } }, [t._v("ⓧ")]) : t._e(), t.loading && !t.isFetchingMore ? n("div", { staticClass: "loading-spinner" }) : n("button", { staticClass: "search-btn", on: { click: function(o) {
|
|
1348
|
+
} } }, [t._v("ⓧ")]) : t._e(), t.loading && !t.isFetchingMore ? n("div", { staticClass: "loading-spinner" }) : !t.loading && t.showSearchIcon ? n("button", { staticClass: "search-btn", on: { click: function(o) {
|
|
1345
1349
|
return o.stopPropagation(), t.handleSearch.apply(null, arguments);
|
|
1346
|
-
} } }, [n("span", { staticClass: "search-icon" }, [n("img", { attrs: { src: t.SearchIcon, alt: "search" } })])])])]), n("div", { directives: [{ name: "show", rawName: "v-show", value: t.isDropdownVisible && (t.searchResults.length > 0 || t.loading || t.query || t.searchHistory.length > 0), expression: `
|
|
1350
|
+
} } }, [n("span", { staticClass: "search-icon" }, [n("img", { attrs: { src: t.SearchIcon, alt: "search" } })])]) : t._e()])]), n("div", { directives: [{ name: "show", rawName: "v-show", value: t.isDropdownVisible && (t.searchResults.length > 0 || t.loading || t.query || t.searchHistory.length > 0), expression: `
|
|
1347
1351
|
isDropdownVisible &&
|
|
1348
1352
|
(searchResults.length > 0 ||
|
|
1349
1353
|
loading ||
|
|
@@ -1357,26 +1361,26 @@ var mn = function() {
|
|
|
1357
1361
|
} } }, [t._v(" " + t._s(t.isEn ? "Clear" : "清空") + " ")])]), t._l(t.searchHistory, function(o, s) {
|
|
1358
1362
|
return n("div", { key: "hist-" + s, staticClass: "dropdown-item", on: { mousedown: function(i) {
|
|
1359
1363
|
return t.selectItem(o);
|
|
1360
|
-
} } }, [n("div", { staticClass: "category-tag" }, [n("img", { staticClass: "type-icon", attrs: { src: t.getIconUrl(o.type), alt: "" } }), n("span", { staticClass: "type-text" }, [t._v(t._s(t.getItemType(o.type)))])]), n("div", { staticClass: "result-text" }, [t._v(t._s(t.getItemLabel(o)))])]);
|
|
1364
|
+
} } }, [n("div", { staticClass: "category-tag", style: t.showItemTag ? {} : { display: "none" } }, [n("img", { staticClass: "type-icon", attrs: { src: t.getIconUrl(o.type), alt: "" } }), n("span", { staticClass: "type-text" }, [t._v(t._s(t.getItemType(o.type)))])]), n("div", { staticClass: "result-text" }, [t._v(t._s(t.getItemLabel(o)))])]);
|
|
1361
1365
|
}), n("hr", { staticClass: "divider" })], 2) : t._e()];
|
|
1362
1366
|
}, { searchHistory: t.searchHistory }), t.loading && !t.isFetchingMore ? n("div", { staticClass: "status-msg" }, [t._v(" " + t._s(t.isEn ? "Searching..." : "正在搜索中...") + " ")]) : t.searchResults.length > 0 ? [t._t("results", function() {
|
|
1363
1367
|
return t._l(t.searchResults, function(o, s) {
|
|
1364
1368
|
return n("div", { key: s, staticClass: "dropdown-item", class: { "is-active": t.isItemActive(o) }, on: { mousedown: function(i) {
|
|
1365
1369
|
return t.selectItem(o);
|
|
1366
|
-
} } }, [n("div", { staticClass: "category-tag" }, [n("img", { staticClass: "type-icon", attrs: { src: t.getIconUrl(o.type), alt: "" } }), n("span", { staticClass: "type-text" }, [t._v(t._s(t.getItemType(o.type)))])]), n("div", { staticClass: "result-text" }, [t._v(t._s(t.getItemLabel(o)))])]);
|
|
1370
|
+
} } }, [n("div", { staticClass: "category-tag", style: t.showItemTag ? {} : { display: "none" } }, [n("img", { staticClass: "type-icon", attrs: { src: t.getIconUrl(o.type), alt: "" } }), n("span", { staticClass: "type-text" }, [t._v(t._s(t.getItemType(o.type)))])]), n("div", { staticClass: "result-text" }, [t._v(t._s(t.getItemLabel(o)))])]);
|
|
1367
1371
|
});
|
|
1368
1372
|
}, { searchResults: t.searchResults }), t.isFetchingMore ? n("div", { staticClass: "load-more-msg" }, [t._v(" " + t._s(t.isEn ? "Loading more..." : "正在加载更多...") + " ")]) : t.isFinished && t.query ? n("div", { staticClass: "load-more-msg no-more" }, [t._v(" " + t._s(t.isEn ? "All results have been loaded" : "已加载全部结果") + " ")]) : t._e()] : t.query && !t.loading ? n("div", { staticClass: "status-msg" }, [t._t("noData", function() {
|
|
1369
1373
|
return [t._v(" " + t._s(t.isEn ? `No results found related to "${t.query}".` : `未找到与 "${t.query}" 相关的结果`) + " ")];
|
|
1370
1374
|
})], 2) : t._e()], 2)]);
|
|
1371
|
-
},
|
|
1372
|
-
dn,
|
|
1373
|
-
mn,
|
|
1375
|
+
}, gn = [], yn = /* @__PURE__ */ wt(
|
|
1374
1376
|
pn,
|
|
1377
|
+
hn,
|
|
1378
|
+
gn,
|
|
1375
1379
|
!1,
|
|
1376
1380
|
null,
|
|
1377
|
-
"
|
|
1381
|
+
"fbdd60f5"
|
|
1378
1382
|
);
|
|
1379
|
-
const
|
|
1383
|
+
const ee = yn.exports, vn = {
|
|
1380
1384
|
__name: "ApplyDataDialog",
|
|
1381
1385
|
props: {
|
|
1382
1386
|
// v-model 绑定,默认 false
|
|
@@ -1390,6 +1394,10 @@ const te = hn.exports, gn = {
|
|
|
1390
1394
|
default: "en",
|
|
1391
1395
|
// 增加校验,确保只能传入 'en' 或 'cn'
|
|
1392
1396
|
validator: (e) => ["en", "cn"].includes(e)
|
|
1397
|
+
},
|
|
1398
|
+
placeholder: {
|
|
1399
|
+
type: String,
|
|
1400
|
+
default: ""
|
|
1393
1401
|
}
|
|
1394
1402
|
},
|
|
1395
1403
|
emits: ["update:value", "confirm"],
|
|
@@ -1398,58 +1406,58 @@ const te = hn.exports, gn = {
|
|
|
1398
1406
|
{ typeCn: "城市", typeEn: "City", type: "City" },
|
|
1399
1407
|
{ typeCn: "海运港口", typeEn: "Port", type: "Seaport" },
|
|
1400
1408
|
{ typeCn: "机场", typeEn: "Airport", type: "Airport" }
|
|
1401
|
-
], s =
|
|
1409
|
+
], s = C(null), i = Ct({
|
|
1402
1410
|
name: "",
|
|
1403
1411
|
country: ""
|
|
1404
|
-
}),
|
|
1412
|
+
}), r = Ct({
|
|
1405
1413
|
name: "",
|
|
1406
1414
|
type: "City"
|
|
1407
|
-
}),
|
|
1408
|
-
return { __sfc: !0, props: n, emit: t, typeOptions: o, displayQuery: s, errors: i, formData:
|
|
1415
|
+
}), l = Z(() => n.lang === "en" || n.lang === "en-US");
|
|
1416
|
+
return { __sfc: !0, props: n, emit: t, typeOptions: o, displayQuery: s, errors: i, formData: r, isEn: l, handleClose: () => {
|
|
1409
1417
|
i.name = "", i.country = "", t("update:value", !1);
|
|
1410
1418
|
}, handleConfirm: () => {
|
|
1411
1419
|
i.name = "", i.country = "";
|
|
1412
1420
|
let u = !0;
|
|
1413
|
-
|
|
1414
|
-
...
|
|
1421
|
+
r.name.trim() || (i.name = "Data name is required", u = !1), s.value || (i.country = "Please select a country", u = !1), u && (console.log("🍉 ~ ApplyDataDialog.vue:115 ~ handleConfirm ~ data:", {
|
|
1422
|
+
...r,
|
|
1415
1423
|
country: s.value
|
|
1416
|
-
}), t("confirm", { ...
|
|
1417
|
-
}, Search:
|
|
1424
|
+
}), t("confirm", { ...r, country: s.value }));
|
|
1425
|
+
}, Search: ee };
|
|
1418
1426
|
}
|
|
1419
1427
|
};
|
|
1420
|
-
var
|
|
1428
|
+
var An = function() {
|
|
1421
1429
|
var t = this, n = t._self._c, o = t._self._setupProxy;
|
|
1422
1430
|
return t.value ? n("div", { staticClass: "modal-mask", on: { click: function(s) {
|
|
1423
1431
|
return s.target !== s.currentTarget ? null : o.handleClose.apply(null, arguments);
|
|
1424
|
-
} } }, [n("div", { staticClass: "modal-container" }, [n("div", { staticClass: "modal-header" }, [n("span", { staticClass: "header-title" }, [t._v(t._s(o.isEn ? "Apply for data addition" : "申请补充数据"))]), n("div", { staticClass: "close-btn", on: { click: o.handleClose } }, [t._v("×")])]), n("div", { staticClass: "modal-body" }, [n("div", { staticClass: "form-item" }, [n("label", { staticClass: "required" }, [t._v(t._s(o.isEn ? "Data To Add" : "需补充的数据"))]), n("div", { staticClass: "input-box" }, [n("input", { directives: [{ name: "model", rawName: "v-model", value: o.formData.name, expression: "formData.name" }], class: ["custom-input", { "input-error": o.errors.name }], attrs: { type: "text", placeholder: "Please enter
|
|
1432
|
+
} } }, [n("div", { staticClass: "modal-container" }, [n("div", { staticClass: "modal-header" }, [n("span", { staticClass: "header-title" }, [t._v(t._s(o.isEn ? "Apply for data addition" : "申请补充数据"))]), n("div", { staticClass: "close-btn", on: { click: o.handleClose } }, [t._v("×")])]), n("div", { staticClass: "modal-body" }, [n("div", { staticClass: "form-item" }, [n("label", { staticClass: "required" }, [t._v(t._s(o.isEn ? "Data To Add" : "需补充的数据"))]), n("div", { staticClass: "input-box" }, [n("input", { directives: [{ name: "model", rawName: "v-model", value: o.formData.name, expression: "formData.name" }], class: ["custom-input", { "input-error": o.errors.name }], attrs: { type: "text", placeholder: t.placeholder ?? (o.isEn ? " Please enter" : "请输入") }, domProps: { value: o.formData.name }, on: { input: [function(s) {
|
|
1425
1433
|
s.target.composing || t.$set(o.formData, "name", s.target.value);
|
|
1426
1434
|
}, function(s) {
|
|
1427
1435
|
o.errors.name = "";
|
|
1428
1436
|
}] } })]), o.errors.name ? n("div", { staticClass: "error-message" }, [t._v(t._s(o.errors.name))]) : t._e()]), n("div", { staticClass: "form-item" }, [n("label", { staticClass: "required" }, [t._v(t._s(o.isEn ? "Type" : "所属类别"))]), n("div", { staticClass: "type-group" }, t._l(o.typeOptions, function(s) {
|
|
1429
|
-
return n("div", { key: s, class: ["type-btn", { active: o.formData.type === s.type }], on: { click: function(i) {
|
|
1437
|
+
return n("div", { key: s.type, class: ["type-btn", { active: o.formData.type === s.type }], on: { click: function(i) {
|
|
1430
1438
|
o.formData.type = s.type;
|
|
1431
1439
|
} } }, [t._v(" " + t._s(o.isEn ? s.typeEn : s.typeCn) + " "), o.formData.type === s.type ? n("div", { staticClass: "check-mark" }) : t._e()]);
|
|
1432
|
-
}), 0)]), n("div", { staticClass: "form-item" }, [n("label", { staticClass: "required" }, [t._v(t._s(o.isEn ? "Country" : "国家"))]), n("div", { class: { "search-error-wrap": o.errors.country } }, [n(o.Search, { style: { margin: "0 auto" }, attrs: { "search-type-list": ["Country"], lang: t.lang }, on: { "update:model-value": function(s) {
|
|
1440
|
+
}), 0)]), n("div", { staticClass: "form-item" }, [n("label", { staticClass: "required" }, [t._v(t._s(o.isEn ? "Country" : "国家"))]), n("div", { class: { "search-error-wrap": o.errors.country } }, [n(o.Search, { style: { margin: "0 auto" }, attrs: { "search-type-list": ["Country"], lang: t.lang, placeholder: t.placeholder ?? (o.isEn ? " Please enter" : "请输入") }, on: { "update:model-value": function(s) {
|
|
1433
1441
|
o.errors.country = "";
|
|
1434
1442
|
} }, model: { value: o.displayQuery, callback: function(s) {
|
|
1435
1443
|
o.displayQuery = s;
|
|
1436
1444
|
}, expression: "displayQuery" } })], 1), o.errors.country ? n("div", { staticClass: "error-message" }, [t._v(" " + t._s(o.errors.country) + " ")]) : t._e()])]), n("div", { staticClass: "modal-footer" }, [n("button", { staticClass: "confirm-btn", on: { click: o.handleConfirm } }, [t._v(" " + t._s(o.isEn ? "Submit" : "申请补充") + " ")])])])]) : t._e();
|
|
1437
|
-
},
|
|
1438
|
-
gn,
|
|
1445
|
+
}, wn = [], xn = /* @__PURE__ */ wt(
|
|
1439
1446
|
vn,
|
|
1440
|
-
|
|
1447
|
+
An,
|
|
1448
|
+
wn,
|
|
1441
1449
|
!1,
|
|
1442
1450
|
null,
|
|
1443
|
-
"
|
|
1451
|
+
"3ca839c7"
|
|
1444
1452
|
);
|
|
1445
|
-
const
|
|
1453
|
+
const bn = xn.exports, Cn = {
|
|
1446
1454
|
// 2. 局部注册组件
|
|
1447
1455
|
components: {
|
|
1448
|
-
[Tt.name]: Tt,
|
|
1449
1456
|
[kt.name]: kt,
|
|
1457
|
+
[Tt.name]: Tt,
|
|
1450
1458
|
[_t.name]: _t,
|
|
1451
|
-
[Et.name]: Et,
|
|
1452
1459
|
[Ot.name]: Ot,
|
|
1460
|
+
[Et.name]: Et,
|
|
1453
1461
|
[Dt.name]: Dt,
|
|
1454
1462
|
[St.name]: St,
|
|
1455
1463
|
[Rt.name]: Rt
|
|
@@ -1488,10 +1496,10 @@ const wn = An.exports, bn = {
|
|
|
1488
1496
|
};
|
|
1489
1497
|
},
|
|
1490
1498
|
mounted() {
|
|
1491
|
-
|
|
1499
|
+
W.on(G.Open, this.handleOpen);
|
|
1492
1500
|
},
|
|
1493
1501
|
beforeDestroy() {
|
|
1494
|
-
|
|
1502
|
+
W.off(G.Open, this.handleOpen);
|
|
1495
1503
|
},
|
|
1496
1504
|
methods: {
|
|
1497
1505
|
handleOpen() {
|
|
@@ -1501,16 +1509,16 @@ const wn = An.exports, bn = {
|
|
|
1501
1509
|
), this.isVisible = !0;
|
|
1502
1510
|
},
|
|
1503
1511
|
closeModal() {
|
|
1504
|
-
this.isVisible = !1,
|
|
1512
|
+
this.isVisible = !1, W.emit(G.Close), this.$refs.formRef.resetFields();
|
|
1505
1513
|
},
|
|
1506
1514
|
handleSubmit() {
|
|
1507
1515
|
this.$refs.formRef.validate((e) => {
|
|
1508
|
-
e && (
|
|
1516
|
+
e && (W.emit(G.Submit, { ...this.formData }), this.closeModal());
|
|
1509
1517
|
});
|
|
1510
1518
|
}
|
|
1511
1519
|
}
|
|
1512
1520
|
};
|
|
1513
|
-
var
|
|
1521
|
+
var Rn = function() {
|
|
1514
1522
|
var t = this, n = t._self._c;
|
|
1515
1523
|
return n("el-dialog", { attrs: { visible: t.isVisible, "before-close": t.closeModal, "show-close": !1, "close-on-click-modal": !0, width: "500px", "custom-class": "global-modal-custom" }, on: { "update:visible": function(o) {
|
|
1516
1524
|
t.isVisible = o;
|
|
@@ -1529,60 +1537,62 @@ var xn = function() {
|
|
|
1529
1537
|
}, expression: "formData.name" } })], 1)], 1)], 1), n("el-form-item", { staticClass: "agreement-item", attrs: { prop: "agreement" } }, [n("el-checkbox", { model: { value: t.formData.agreement, callback: function(o) {
|
|
1530
1538
|
t.$set(t.formData, "agreement", o);
|
|
1531
1539
|
}, expression: "formData.agreement" } }, [t._v("我同意")]), n("a", { staticClass: "privacy-link", attrs: { href: "#" } }, [t._v("隐私政策")])], 1)], 1)], 1), n("div", { staticClass: "global-modal-footer-custom", attrs: { slot: "footer" }, slot: "footer" }, [n("el-button", { staticClass: "submit-button-custom", attrs: { type: "primary" }, on: { click: t.handleSubmit } }, [t._v(" 加入会员 ")])], 1)]);
|
|
1532
|
-
},
|
|
1533
|
-
bn,
|
|
1534
|
-
xn,
|
|
1540
|
+
}, Sn = [], Dn = /* @__PURE__ */ wt(
|
|
1535
1541
|
Cn,
|
|
1542
|
+
Rn,
|
|
1543
|
+
Sn,
|
|
1536
1544
|
!1,
|
|
1537
1545
|
null,
|
|
1538
1546
|
null
|
|
1539
1547
|
);
|
|
1540
|
-
const
|
|
1541
|
-
let
|
|
1548
|
+
const En = Dn.exports;
|
|
1549
|
+
let On = {
|
|
1542
1550
|
open() {
|
|
1543
|
-
|
|
1551
|
+
W.emit(G.Open);
|
|
1544
1552
|
},
|
|
1545
1553
|
close() {
|
|
1546
|
-
|
|
1554
|
+
W.emit(G.Close);
|
|
1547
1555
|
},
|
|
1548
1556
|
onSubmit(e) {
|
|
1549
|
-
|
|
1557
|
+
W.on(G.Submit, e);
|
|
1550
1558
|
}
|
|
1551
1559
|
};
|
|
1552
|
-
function
|
|
1560
|
+
function In() {
|
|
1553
1561
|
let e = !1;
|
|
1554
1562
|
return {
|
|
1555
1563
|
install(t) {
|
|
1556
1564
|
if (typeof window < "u" && !e) {
|
|
1557
1565
|
const n = document.createElement("div");
|
|
1558
1566
|
n.setAttribute("id", "global-modal-root"), document.body.appendChild(n);
|
|
1559
|
-
const o = t.extend(
|
|
1567
|
+
const o = t.extend(En);
|
|
1560
1568
|
new o().$mount(n), e = !0;
|
|
1561
1569
|
}
|
|
1562
|
-
t.prototype.$globalModal =
|
|
1570
|
+
t.prototype.$globalModal = On;
|
|
1563
1571
|
}
|
|
1564
1572
|
};
|
|
1565
1573
|
}
|
|
1566
1574
|
const Nt = {
|
|
1567
|
-
ApplyDataDialog:
|
|
1568
|
-
JcSearch:
|
|
1569
|
-
}
|
|
1575
|
+
ApplyDataDialog: bn,
|
|
1576
|
+
JcSearch: ee
|
|
1577
|
+
};
|
|
1578
|
+
let Ht = !1;
|
|
1579
|
+
const Fn = {
|
|
1570
1580
|
/**
|
|
1571
1581
|
* Vue 2 插件安装方法
|
|
1572
1582
|
* @param Vue Vue 的构造函数
|
|
1573
1583
|
*/
|
|
1574
|
-
install(e) {
|
|
1575
|
-
Object.keys(Nt).forEach((
|
|
1576
|
-
e.component(
|
|
1577
|
-
});
|
|
1584
|
+
install(e, t) {
|
|
1585
|
+
Ht || (Ht = !0, t?.sharedConfig && re(t.sharedConfig), Object.keys(Nt).forEach((n) => {
|
|
1586
|
+
e.component(n, Nt[n]);
|
|
1587
|
+
}));
|
|
1578
1588
|
}
|
|
1579
1589
|
};
|
|
1580
1590
|
export {
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1591
|
+
bn as ApplyDataDialog,
|
|
1592
|
+
En as GlobalModal,
|
|
1593
|
+
ee as JcSearch,
|
|
1594
|
+
Mn as MODAL_ACTION,
|
|
1595
|
+
In as createGlobalModalPlugin,
|
|
1596
|
+
Fn as default,
|
|
1597
|
+
Pn as emitter
|
|
1588
1598
|
};
|