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