@opentiny/vue-search-box 3.32.0-alpha.4 → 3.32.1-alpha.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/index.js +874 -858
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
import { defineComponent as
|
|
2
|
+
import { defineComponent as Le, $prefix as Ke, $props as Ne, setup as je, hooks as De } from "@opentiny/vue-common";
|
|
3
3
|
import { TinyDropdownItem as Xe, TinyCheckbox as ut, TinyCheckboxGroup as pt, TinyDatePicker as Qe, TinyInput as Je, TinyButton as et, TinyLoading as ct, TinyTag as dt, TinyDropdown as mt, TinyDropdownMenu as ft, TinyTooltip as ht, TinyPopover as vt, TinySelect as bt, TinyOption as gt } from "@opentiny/vue";
|
|
4
4
|
import { iconSearch as yt, iconClose as Vt, iconHelpQuery as kt } from "@opentiny/vue-icon";
|
|
5
|
-
import { resolveComponent as
|
|
6
|
-
const wt = (e, t, o,
|
|
7
|
-
if (typeof e == "string" && typeof
|
|
8
|
-
let
|
|
9
|
-
if (
|
|
10
|
-
return o ? e.substr(0, t) : e.substr(
|
|
5
|
+
import { resolveComponent as j, openBlock as y, createElementBlock as w, withDirectives as X, createVNode as R, withCtx as P, createElementVNode as E, toDisplayString as I, vShow as oe, Fragment as z, renderList as q, createBlock as A, createCommentVNode as N, createTextVNode as W, resolveDirective as It, normalizeClass as G, normalizeStyle as ae, withModifiers as ee, withKeys as We, renderSlot as ke, mergeProps as Me } from "vue";
|
|
6
|
+
const wt = (e, t, o, a = "0") => {
|
|
7
|
+
if (typeof e == "string" && typeof a == "string" && tt(t)) {
|
|
8
|
+
let s = e.length - t;
|
|
9
|
+
if (s > 0)
|
|
10
|
+
return o ? e.substr(0, t) : e.substr(s, t);
|
|
11
11
|
{
|
|
12
|
-
const
|
|
13
|
-
for (
|
|
14
|
-
|
|
15
|
-
const f =
|
|
12
|
+
const i = [];
|
|
13
|
+
for (s = Math.abs(s) / a.length; s > 0; s--)
|
|
14
|
+
i.push(a);
|
|
15
|
+
const f = i.join("");
|
|
16
16
|
return o ? e + f : f + e;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -53,66 +53,66 @@ const Dt = {
|
|
|
53
53
|
MINUTE: 59,
|
|
54
54
|
SECOND: 59,
|
|
55
55
|
MILLISECOND: 999
|
|
56
|
-
}, Pt = "-12:00,-11:00,-10:00,-09:30,-08:00,-07:00,-06:00,-05:00,-04:30,-04:00,-03:30,-02:00,-01:00", _t = "-00:00,+00:00,+01:00,+02:00,+03:00,+03:30,+04:00,+04:30,+05:00,+05:30,+05:45,+06:00", Bt = "+06:30,+07:00,+08:00,+09:00,+10:00,+10:30,+11:00,+11:30,+12:00,+12:45,+13:00,+14:00",
|
|
56
|
+
}, Pt = "-12:00,-11:00,-10:00,-09:30,-08:00,-07:00,-06:00,-05:00,-04:30,-04:00,-03:30,-02:00,-01:00", _t = "-00:00,+00:00,+01:00,+02:00,+03:00,+03:30,+04:00,+04:30,+05:00,+05:30,+05:45,+06:00", Bt = "+06:30,+07:00,+08:00,+09:00,+10:00,+10:30,+11:00,+11:30,+12:00,+12:45,+13:00,+14:00", Ft = [].concat(Pt.split(","), _t.split(","), Bt.split(",")), xt = (e) => {
|
|
57
57
|
const t = 0 - e.getTimezoneOffset() / 60;
|
|
58
58
|
let o;
|
|
59
59
|
return t === 0 ? o = "Z" : t > 0 ? o = "+" + (t > 10 ? t : "0" + t) + "00" : o = (t < -10 ? t : "-0" + -t) + "00", o;
|
|
60
|
-
}, nt = (e) => e % 400 === 0 || e % 4 === 0 && e % 100 !== 0, at = (e) => e > me.MILLISECOND ? Number(String(e).substring(0, 3)) : e, Ge = ({ year: e, month: t, date: o, hours:
|
|
61
|
-
let
|
|
62
|
-
if (nt(e) && t === 1 && (
|
|
63
|
-
return new Date(e, t, o,
|
|
64
|
-
},
|
|
60
|
+
}, nt = (e) => e % 400 === 0 || e % 4 === 0 && e % 100 !== 0, at = (e) => e > me.MILLISECOND ? Number(String(e).substring(0, 3)) : e, Ge = ({ year: e, month: t, date: o, hours: a, minutes: s, seconds: i, milliseconds: f }) => {
|
|
61
|
+
let c = ot[t];
|
|
62
|
+
if (nt(e) && t === 1 && (c += 1), o <= c)
|
|
63
|
+
return new Date(e, t, o, a, s, i, at(f));
|
|
64
|
+
}, Ht = (e) => {
|
|
65
65
|
if (e.length === 23) {
|
|
66
|
-
const t = Number(e[1]), o = e[3] - 1,
|
|
66
|
+
const t = Number(e[1]), o = e[3] - 1, a = Number(e[9] || 1), s = e[15] || 0, i = e[17] || 0, f = e[20] || 0, c = e[22] || 0;
|
|
67
67
|
return Ge({
|
|
68
|
-
date:
|
|
68
|
+
date: a,
|
|
69
69
|
year: t,
|
|
70
|
-
hours:
|
|
70
|
+
hours: s,
|
|
71
71
|
month: o,
|
|
72
72
|
seconds: f,
|
|
73
|
-
minutes:
|
|
74
|
-
milliseconds:
|
|
73
|
+
minutes: i,
|
|
74
|
+
milliseconds: c
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
},
|
|
77
|
+
}, At = (e) => {
|
|
78
78
|
if (e.length === 22) {
|
|
79
|
-
const t = Number(e[12]), o = e[1] - 1,
|
|
79
|
+
const t = Number(e[12]), o = e[1] - 1, a = Number(e[6] || 1), s = e[14] || 0, i = e[16] || 0, f = e[19] || 0, c = e[21] || 0;
|
|
80
80
|
return Ge({
|
|
81
81
|
year: t,
|
|
82
82
|
month: o,
|
|
83
|
-
date:
|
|
84
|
-
hours:
|
|
85
|
-
minutes:
|
|
83
|
+
date: a,
|
|
84
|
+
hours: s,
|
|
85
|
+
minutes: i,
|
|
86
86
|
seconds: f,
|
|
87
|
-
milliseconds:
|
|
87
|
+
milliseconds: c
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
}, zt = (e) => {
|
|
91
91
|
if (e.length !== 25)
|
|
92
92
|
return;
|
|
93
|
-
const t = Number(e[1]), o = e[2] - 1,
|
|
93
|
+
const t = Number(e[1]), o = e[2] - 1, a = Number(e[6]), s = new Date(t, o, a).getTimezoneOffset(), i = e[12] || 0, f = e[14] || 0, c = e[17] || 0, d = e[19] || 0;
|
|
94
94
|
let m = e[20];
|
|
95
|
-
const
|
|
95
|
+
const u = e[21], p = e[22] || 0, n = e[24] || 0;
|
|
96
96
|
let r = ot[o], l, h;
|
|
97
|
-
if (nt(t) && o === 1 && (r += 1),
|
|
97
|
+
if (nt(t) && o === 1 && (r += 1), a <= r) {
|
|
98
98
|
if (m === "Z")
|
|
99
|
-
l =
|
|
99
|
+
l = i - s / 60, h = f;
|
|
100
100
|
else {
|
|
101
|
-
if (m.includes(":") || (m = m.substr(0, 3) + ":" + m.substr(3)), !
|
|
101
|
+
if (m.includes(":") || (m = m.substr(0, 3) + ":" + m.substr(3)), !Ft.includes(m))
|
|
102
102
|
return;
|
|
103
|
-
l =
|
|
103
|
+
l = u === "+" ? i - p - s / 60 : Number(i) + Number(p) - s / 60, h = u === "+" ? f - n : Number(f) + Number(n);
|
|
104
104
|
}
|
|
105
|
-
return new Date(t, o,
|
|
105
|
+
return new Date(t, o, a, l, h, c, at(d));
|
|
106
106
|
}
|
|
107
107
|
}, Be = [
|
|
108
|
-
[Lt,
|
|
109
|
-
[Nt,
|
|
108
|
+
[Lt, Ht],
|
|
109
|
+
[Nt, At],
|
|
110
110
|
[Rt, zt]
|
|
111
111
|
], Ut = (e) => {
|
|
112
112
|
for (let t = 0, o = Be.length; t < o; t++) {
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
return Be[t][1](
|
|
113
|
+
const a = Be[t][0].exec(e);
|
|
114
|
+
if (a && a.length > 0)
|
|
115
|
+
return Be[t][1](a);
|
|
116
116
|
}
|
|
117
117
|
}, Kt = (e, t, o) => {
|
|
118
118
|
if (o)
|
|
@@ -151,51 +151,51 @@ const Dt = {
|
|
|
151
151
|
const o = [0, -1, 0, 0, 0, 0];
|
|
152
152
|
if (e.length !== t.length)
|
|
153
153
|
return o;
|
|
154
|
-
let
|
|
155
|
-
for (let
|
|
156
|
-
const
|
|
157
|
-
if (d &&
|
|
158
|
-
let m,
|
|
154
|
+
let a = 0, s = 0;
|
|
155
|
+
for (let i = 0, f = e.length; i < f; i++) {
|
|
156
|
+
const c = e.substr(i, 1), d = isNaN(Number(c)) || (c == null ? void 0 : c.trim()) === "";
|
|
157
|
+
if (d && c === t.substr(i, 1) || i === f - 1) {
|
|
158
|
+
let m, u;
|
|
159
159
|
if (d) {
|
|
160
|
-
m = e.substring(
|
|
161
|
-
const
|
|
162
|
-
|
|
160
|
+
m = e.substring(a, i), a = i + 1;
|
|
161
|
+
const p = t.indexOf(c, s);
|
|
162
|
+
u = t.substring(s, p === -1 ? t.length : p), s = p + 1;
|
|
163
163
|
} else
|
|
164
|
-
m = e.substring(
|
|
165
|
-
(m.length ===
|
|
164
|
+
m = e.substring(a, f), u = t.substring(s, f);
|
|
165
|
+
(m.length === u.length || m) && Kt(o, m, u);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
return o;
|
|
169
|
-
},
|
|
169
|
+
}, be = (e, t, o) => isNaN(e) || e < t || e > o, Gt = ({ year: e, month: t, date: o, hours: a, minutes: s, seconds: i, milliseconds: f }) => be(e, 0, me.YEAR) || be(t, 0, me.MONTH) || be(o, 0, me.DATE) || be(a, 0, me.HOUR) || be(s, 0, me.MINUTE) || be(i, 0, me.SECOND) || be(f, 0, me.MILLISECOND), qt = (e, t) => {
|
|
170
170
|
if (typeof t == "string") {
|
|
171
|
-
const o = jt(e, t),
|
|
171
|
+
const o = jt(e, t), a = Number(o[0]), s = Number(o[1]), i = Number(o[2] || 1), f = Number(o[3] || 0), c = Number(o[4] || 0), d = Number(o[5] || 0), m = Number(o[6] || 0);
|
|
172
172
|
return Gt({
|
|
173
|
-
year:
|
|
174
|
-
month:
|
|
175
|
-
date:
|
|
173
|
+
year: a,
|
|
174
|
+
month: s,
|
|
175
|
+
date: i,
|
|
176
176
|
hours: f,
|
|
177
|
-
minutes:
|
|
177
|
+
minutes: c,
|
|
178
178
|
seconds: d,
|
|
179
179
|
milliseconds: m
|
|
180
180
|
}) ? void 0 : Ge({
|
|
181
|
-
year:
|
|
182
|
-
date:
|
|
183
|
-
month:
|
|
184
|
-
minutes:
|
|
181
|
+
year: a,
|
|
182
|
+
date: i,
|
|
183
|
+
month: s,
|
|
184
|
+
minutes: c,
|
|
185
185
|
hours: f,
|
|
186
186
|
milliseconds: m,
|
|
187
187
|
seconds: d
|
|
188
188
|
});
|
|
189
189
|
} else
|
|
190
190
|
return Ut(e);
|
|
191
|
-
},
|
|
192
|
-
let
|
|
193
|
-
if (tt(e) ?
|
|
194
|
-
const
|
|
195
|
-
return
|
|
191
|
+
}, $e = (e, t, o) => {
|
|
192
|
+
let a;
|
|
193
|
+
if (tt(e) ? a = new Date(e) : typeof e == "string" && (a = qt(e, t)), o) {
|
|
194
|
+
const s = o && $e(o) || new Date(1, 1, 1, 0, 0, 0);
|
|
195
|
+
return a && a < s ? s : a;
|
|
196
196
|
}
|
|
197
|
-
return
|
|
198
|
-
},
|
|
197
|
+
return a;
|
|
198
|
+
}, xe = function(e, t = "yyyy/MM/dd hh:mm:ss") {
|
|
199
199
|
if (Ct(e)) {
|
|
200
200
|
if (typeof t == "string") {
|
|
201
201
|
const o = {
|
|
@@ -207,32 +207,32 @@ const Dt = {
|
|
|
207
207
|
"m{1,2}": e.getMinutes(),
|
|
208
208
|
"s{1,2}": e.getSeconds(),
|
|
209
209
|
"S{1,3}": e.getMilliseconds(),
|
|
210
|
-
"Z{1,1}":
|
|
210
|
+
"Z{1,1}": xt(e)
|
|
211
211
|
};
|
|
212
|
-
return Object.keys(o).forEach((
|
|
213
|
-
const
|
|
214
|
-
|
|
212
|
+
return Object.keys(o).forEach((a) => {
|
|
213
|
+
const s = t.match(Ot[a]);
|
|
214
|
+
a && s && s.length && (t = t.replace(s[0], a === "Z{1,1}" ? o[a] : wt(o[a].toString(), s[0].length)));
|
|
215
215
|
}), t;
|
|
216
216
|
}
|
|
217
217
|
} else if (typeof e == "string" && arguments.length >= 2) {
|
|
218
218
|
let o = t;
|
|
219
219
|
arguments.length === 2 ? t = void 0 : o = arguments[2];
|
|
220
|
-
const
|
|
221
|
-
return
|
|
220
|
+
const a = $e(e, t);
|
|
221
|
+
return a ? xe(a, o) : "";
|
|
222
222
|
}
|
|
223
223
|
}, _ = (e, t = !0) => {
|
|
224
|
-
var o,
|
|
224
|
+
var o, a, s, i, f, c, d, m, u;
|
|
225
225
|
if (clearTimeout(e.visibleTimer), e.visibleTimer = null, t)
|
|
226
226
|
e.visible || (e.visibleTimer = setTimeout(() => {
|
|
227
227
|
e.visible = !0;
|
|
228
228
|
}, 0));
|
|
229
229
|
else {
|
|
230
230
|
if (e.visible && typeof document < "u") {
|
|
231
|
-
(((
|
|
231
|
+
(((i = (s = (a = (o = e.instance) == null ? void 0 : o.$refs) == null ? void 0 : a.dropdownRef) == null ? void 0 : s.state) == null ? void 0 : i.popperElm) || document).querySelectorAll(".tvp-search-box__virtual-list").forEach((l) => {
|
|
232
232
|
l.scrollTop = 0;
|
|
233
233
|
});
|
|
234
234
|
const r = document.activeElement;
|
|
235
|
-
(f = r == null ? void 0 : r.closest) != null && f.call(r, ".tvp-search-box__dropdown-menu") && ((
|
|
235
|
+
(f = r == null ? void 0 : r.closest) != null && f.call(r, ".tvp-search-box__dropdown-menu") && ((u = (m = (d = (c = e.instance) == null ? void 0 : c.$refs) == null ? void 0 : d.inputRef) == null ? void 0 : m.focus) == null || u.call(m));
|
|
236
236
|
}
|
|
237
237
|
e.visible = !1;
|
|
238
238
|
}
|
|
@@ -244,280 +244,280 @@ const Dt = {
|
|
|
244
244
|
t && o.state.visible && (clearTimeout(Number(o.state.timeout)), o.state.timeout = null, o.state.visible = !1);
|
|
245
245
|
}, Yt = (e, t = 200) => {
|
|
246
246
|
let o = null;
|
|
247
|
-
const
|
|
247
|
+
const a = function(...s) {
|
|
248
248
|
o && clearTimeout(o), o = setTimeout(() => {
|
|
249
|
-
e.apply(this,
|
|
249
|
+
e.apply(this, s), o = null;
|
|
250
250
|
}, t);
|
|
251
251
|
};
|
|
252
|
-
return
|
|
252
|
+
return a.cancel = () => {
|
|
253
253
|
o && (clearTimeout(o), o = null);
|
|
254
|
-
},
|
|
255
|
-
},
|
|
254
|
+
}, a;
|
|
255
|
+
}, ie = (e) => parseFloat(e).toString() !== "NaN", ue = (e) => {
|
|
256
256
|
const t = Array.isArray(e) ? [] : {};
|
|
257
257
|
if (e && typeof e == "object") {
|
|
258
258
|
const o = Object.keys(e);
|
|
259
259
|
if (o.length)
|
|
260
|
-
o.forEach((
|
|
261
|
-
e[
|
|
260
|
+
o.forEach((a) => {
|
|
261
|
+
e[a] && typeof e[a] == "object" ? t[a] = ue(e[a]) : t[a] = e[a];
|
|
262
262
|
});
|
|
263
263
|
else
|
|
264
264
|
return e;
|
|
265
265
|
}
|
|
266
266
|
return t;
|
|
267
|
-
},
|
|
267
|
+
}, Re = (e, t = ["mergeTag", "options", "idMapKey"]) => {
|
|
268
268
|
const o = { ...e };
|
|
269
|
-
return t.forEach((
|
|
270
|
-
delete o[
|
|
269
|
+
return t.forEach((a) => {
|
|
270
|
+
delete o[a];
|
|
271
271
|
}), o;
|
|
272
|
-
},
|
|
273
|
-
const { valueMap:
|
|
274
|
-
return
|
|
275
|
-
},
|
|
272
|
+
}, ne = (e, t, o = "") => {
|
|
273
|
+
const { valueMap: a, prevItem: s } = e, i = (s.label || o) + t;
|
|
274
|
+
return a.has(i);
|
|
275
|
+
}, Oe = (e) => {
|
|
276
276
|
e.propItem = {}, e.inputValue = "", e.startDate = null, e.endDate = null, e.startDateTime = null, e.endDateTime = null;
|
|
277
|
-
},
|
|
277
|
+
}, te = ({ emit: e, state: t, nextTick: o, ...a }) => {
|
|
278
278
|
Te(t, !1);
|
|
279
|
-
const { tagList:
|
|
280
|
-
if (m ||
|
|
279
|
+
const { tagList: s = null, index: i = -1, newTag: f = null, newValue: c = null, oldValue: d = null, isEdit: m } = a;
|
|
280
|
+
if (m || Oe(t), !s && i === -1 && !c)
|
|
281
281
|
return;
|
|
282
|
-
const
|
|
283
|
-
let
|
|
284
|
-
|
|
285
|
-
},
|
|
286
|
-
const
|
|
287
|
-
return o && o[
|
|
282
|
+
const u = d || ue(t.innerModelValue);
|
|
283
|
+
let p = [];
|
|
284
|
+
c ? p = [...c] : i !== -1 ? (p = [...t.innerModelValue], f ? p.splice(i, 1, f) : p.splice(i, 1)) : p = [...t.innerModelValue, ...s], t.innerModelValue = p, e("update:modelValue", ue(p)), e("change", ue(p), u);
|
|
285
|
+
}, pe = (e) => e, fe = (e, t, o) => {
|
|
286
|
+
const a = t.idMapKey || e.idMapKey;
|
|
287
|
+
return o && o[a] !== void 0 ? { [a]: o[a] } : null;
|
|
288
288
|
};
|
|
289
|
-
function Zt({ props: e, state: t, emit: o, nextTick:
|
|
290
|
-
let
|
|
291
|
-
const f = (
|
|
292
|
-
if (
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
|
|
289
|
+
function Zt({ props: e, state: t, emit: o, nextTick: a, isTagDisabled: s }) {
|
|
290
|
+
let i = ue(t.inputValue);
|
|
291
|
+
const f = (u) => {
|
|
292
|
+
if (u) {
|
|
293
|
+
const p = t.recordItems.find((n) => n.label === u.label);
|
|
294
|
+
if (p && p.options) {
|
|
295
|
+
const n = p.options.find((r) => r.label === u.value);
|
|
296
|
+
n && (n.isChecked = !1);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
300
|
return {
|
|
301
|
-
deleteTag: (
|
|
302
|
-
if (u
|
|
301
|
+
deleteTag: (u) => {
|
|
302
|
+
if (s(u))
|
|
303
303
|
return;
|
|
304
|
-
_(t, !1), f(
|
|
305
|
-
const
|
|
306
|
-
|
|
304
|
+
_(t, !1), f(u);
|
|
305
|
+
const p = e.modelValue.filter((n) => n !== u);
|
|
306
|
+
te({ emit: o, state: t, nextTick: a, newValue: p });
|
|
307
307
|
},
|
|
308
308
|
clearTag: () => {
|
|
309
|
-
const
|
|
310
|
-
_(t, !1), e.modelValue.forEach((
|
|
311
|
-
|
|
312
|
-
}),
|
|
309
|
+
const u = e.modelValue.filter((n) => s(n)), p = u.length !== e.modelValue.length;
|
|
310
|
+
_(t, !1), e.modelValue.forEach((n) => {
|
|
311
|
+
s(n) || f(n);
|
|
312
|
+
}), te({ emit: o, state: t, nextTick: a, ...p ? { newValue: u } : {} }), o("clear");
|
|
313
313
|
},
|
|
314
314
|
backspaceDeleteTag: () => {
|
|
315
|
-
var
|
|
315
|
+
var u, p, n;
|
|
316
316
|
if (!t.inputValue) {
|
|
317
317
|
if (t.propItem.label) {
|
|
318
318
|
t.propItem = {};
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
if (
|
|
321
|
+
if (i === "" && t.inputValue === "") {
|
|
322
322
|
const r = e.modelValue.length - 1, l = e.modelValue[r];
|
|
323
|
-
if (l &&
|
|
323
|
+
if (l && s(l))
|
|
324
324
|
return;
|
|
325
325
|
_(t, !1), f(l);
|
|
326
326
|
const h = t.innerModelValue.slice(0, e.modelValue.length - 1);
|
|
327
|
-
|
|
327
|
+
te({ emit: o, state: t, nextTick: a, newValue: h });
|
|
328
328
|
}
|
|
329
|
-
|
|
329
|
+
i = t.inputValue, (n = (p = (u = t == null ? void 0 : t.instance) == null ? void 0 : u.refs) == null ? void 0 : p.inputRef) != null && n.$el && t.instance.refs.inputRef.$el.click();
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
const we = (e, t, o) => {
|
|
335
|
-
var
|
|
336
|
-
const
|
|
337
|
-
return
|
|
335
|
+
var i, f;
|
|
336
|
+
const a = (i = $e(e, o)) == null ? void 0 : i.getTime(), s = (f = $e(t, o)) == null ? void 0 : f.getTime();
|
|
337
|
+
return a == null || isNaN(a) || s == null || isNaN(s) ? NaN : a < s ? -1 : a > s ? 1 : 0;
|
|
338
338
|
}, Se = (e, t) => {
|
|
339
|
-
var
|
|
339
|
+
var s;
|
|
340
340
|
const o = { ...e.formErrors };
|
|
341
|
-
let
|
|
342
|
-
for (const
|
|
343
|
-
const f = (
|
|
341
|
+
let a = !0;
|
|
342
|
+
for (const i of t) {
|
|
343
|
+
const f = (s = e.formRules) == null ? void 0 : s[i];
|
|
344
344
|
if (!f) {
|
|
345
|
-
o[
|
|
345
|
+
o[i] = "";
|
|
346
346
|
continue;
|
|
347
347
|
}
|
|
348
|
-
const
|
|
348
|
+
const c = e[i];
|
|
349
349
|
let d = "";
|
|
350
|
-
f.required && (
|
|
350
|
+
f.required && (c == null || c === "" || Array.isArray(c) && c.length === 0) && (d = f.message || ""), !d && typeof f.validator == "function" && f.validator({}, c, (m) => {
|
|
351
351
|
m && (d = m.message || "");
|
|
352
|
-
}), o[
|
|
352
|
+
}), o[i] = d, d && (a = !1);
|
|
353
353
|
}
|
|
354
|
-
return e.formErrors = o,
|
|
354
|
+
return e.formErrors = o, a;
|
|
355
355
|
}, Wt = (e, t) => {
|
|
356
356
|
const o = { ...e.formErrors };
|
|
357
|
-
for (const
|
|
358
|
-
o[
|
|
357
|
+
for (const a of t)
|
|
358
|
+
o[a] = "";
|
|
359
359
|
e.formErrors = o;
|
|
360
360
|
}, Xt = async (e, t, o) => {
|
|
361
|
-
const { prevItem:
|
|
362
|
-
let
|
|
361
|
+
const { prevItem: a, inputEditValue: s } = t, { operators: i } = a, f = Re(a);
|
|
362
|
+
let c = null;
|
|
363
363
|
if (Se(t, ["inputEditValue"])) {
|
|
364
364
|
let m = null;
|
|
365
|
-
const
|
|
366
|
-
let
|
|
367
|
-
const
|
|
368
|
-
if (Array.isArray(
|
|
369
|
-
|
|
365
|
+
const u = t.operatorValue && i ? { operator: t.operatorValue } : null;
|
|
366
|
+
let p = s;
|
|
367
|
+
const n = {};
|
|
368
|
+
if (Array.isArray(s))
|
|
369
|
+
n.options = [], p = "", s.forEach((r) => {
|
|
370
370
|
const l = t.currentEditValue.find((g) => g.label === r), h = (l == null ? void 0 : l.label) || r;
|
|
371
|
-
if (
|
|
372
|
-
const g = fe(o,
|
|
373
|
-
|
|
371
|
+
if (p = p ? `${p} | ${h}` : h, l) {
|
|
372
|
+
const g = fe(o, a, l);
|
|
373
|
+
n.options.push({ label: h, ...g });
|
|
374
374
|
} else
|
|
375
|
-
|
|
375
|
+
n.options.push({ label: h });
|
|
376
376
|
});
|
|
377
377
|
else if (Array.isArray(t.currentEditValue)) {
|
|
378
|
-
const r = t.currentEditValue.find((l) => l.label ===
|
|
379
|
-
m = fe(o,
|
|
378
|
+
const r = t.currentEditValue.find((l) => l.label === p);
|
|
379
|
+
m = fe(o, a, r);
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
c = pe({ ...f, label: t.selectValue, ...u, value: p, ...m, ...n });
|
|
382
382
|
}
|
|
383
|
-
return
|
|
383
|
+
return c;
|
|
384
384
|
}, lt = async (e, t, o) => {
|
|
385
|
-
const { prevItem:
|
|
386
|
-
let
|
|
385
|
+
const { prevItem: a } = t, s = `min${a.field}`, i = `max${a.field}`, f = t[s], c = t[i], m = Se(t, [s, i]);
|
|
386
|
+
let u = null;
|
|
387
387
|
if (m) {
|
|
388
|
-
const { field:
|
|
388
|
+
const { field: p, label: n, unit: r, type: l, operators: h } = a, g = r ? `${n}(${r})` : n;
|
|
389
389
|
let S = "";
|
|
390
|
-
f &&
|
|
391
|
-
const $ = fe(o,
|
|
392
|
-
|
|
390
|
+
f && c ? S = `${f}-${c}` : S = f ? `≥${f}` : `≤${c}`;
|
|
391
|
+
const $ = fe(o, a, a), T = t.operatorValue && h ? { operator: t.operatorValue } : null;
|
|
392
|
+
u = pe({ type: l, field: p, label: g, value: S, ...$, start: f, end: c, ...T });
|
|
393
393
|
}
|
|
394
|
-
return
|
|
395
|
-
},
|
|
396
|
-
const { prevItem:
|
|
397
|
-
let m = null,
|
|
398
|
-
if (
|
|
399
|
-
const { operators: l } =
|
|
394
|
+
return u;
|
|
395
|
+
}, He = async (e, t, o, a) => {
|
|
396
|
+
const { prevItem: s, startDate: i, endDate: f, startDateTime: c, endDateTime: d } = t;
|
|
397
|
+
let m = null, u = null, p = null, n = null;
|
|
398
|
+
if (a ? (m = c, u = d, n = ["startDateTime", "endDateTime"]) : (m = i, u = f, n = ["startDate", "endDate"]), Se(t, n)) {
|
|
399
|
+
const { operators: l } = s, h = Re(s);
|
|
400
400
|
let g = "";
|
|
401
|
-
const S =
|
|
402
|
-
if (m &&
|
|
403
|
-
if (we(m,
|
|
401
|
+
const S = s.format || (a ? t.datetimeRangeFormat : t.dateRangeFormat);
|
|
402
|
+
if (m && u) {
|
|
403
|
+
if (we(m, u, S) > 0)
|
|
404
404
|
return;
|
|
405
|
-
we(m,
|
|
405
|
+
we(m, u, S) === 0 ? g = m : g = `${m}-${u}`;
|
|
406
406
|
} else
|
|
407
|
-
g = m ? `≥${m}` : `≤${
|
|
408
|
-
const $ = fe(o,
|
|
409
|
-
|
|
407
|
+
g = m ? `≥${m}` : `≤${u}`;
|
|
408
|
+
const $ = fe(o, s, s), T = t.operatorValue && l ? { operator: t.operatorValue } : null;
|
|
409
|
+
p = pe({ ...h, value: g, start: m, end: u, ...$, ...T });
|
|
410
410
|
}
|
|
411
|
-
return
|
|
411
|
+
return p;
|
|
412
412
|
}, rt = (e, t, o) => {
|
|
413
|
-
const { prevItem:
|
|
414
|
-
(e.curMinNumVar !== m || e.curMaxNumVar !==
|
|
415
|
-
const { curMinNumVar:
|
|
416
|
-
r || l ? (e.formRules[
|
|
413
|
+
const { prevItem: a } = e, { field: s, start: i, end: f, min: c = a.min, max: d = a.max } = t, m = `min${s}`, u = `max${s}`;
|
|
414
|
+
(e.curMinNumVar !== m || e.curMaxNumVar !== u) && (delete e[e.curMinNumVar], delete e[e.curMaxNumVar], delete e.formRules[e.curMinNumVar], delete e.formRules[e.curMaxNumVar], e.curMinNumVar = m, e.curMaxNumVar = u), e[e.curMinNumVar] = i, e[e.curMaxNumVar] = f;
|
|
415
|
+
const { curMinNumVar: p, curMaxNumVar: n } = e, r = ie(c), l = ie(d);
|
|
416
|
+
r || l ? (e.formRules[p] = {
|
|
417
417
|
validator: (h, g, S) => {
|
|
418
|
-
const $ =
|
|
419
|
-
!$ &&
|
|
418
|
+
const $ = ie(g);
|
|
419
|
+
!$ && ie(e[n]) || $ && (r && !l && g >= c || !r && l && g <= d || g >= c && g <= d) ? S() : (e.numberShowMessage = !!(g || e[n]), S(new Error(o("tvp.tvpSearchbox.rangeMinErr", [c, d]))));
|
|
420
420
|
}
|
|
421
|
-
}, e.formRules[
|
|
421
|
+
}, e.formRules[n] = {
|
|
422
422
|
validator: (h, g, S) => {
|
|
423
|
-
const $ =
|
|
424
|
-
!
|
|
423
|
+
const $ = ie(e[p]), T = $ && c < e[p] ? Number(e[p]) : c, D = ie(T), v = ie(g);
|
|
424
|
+
!v && $ || v && (D && !l && g >= T || !D && l && g <= d || g >= T && g <= d) ? S() : S(!v && !$ ? new Error(o("tvp.tvpSearchbox.rangeNumberTitle")) : new Error(o("tvp.tvpSearchbox.rangeMaxErr")));
|
|
425
425
|
}
|
|
426
|
-
}) : e.formRules[
|
|
426
|
+
}) : e.formRules[n] = {
|
|
427
427
|
validator: (h, g, S) => {
|
|
428
|
-
const $ = e[
|
|
428
|
+
const $ = e[p], T = ie(g), D = ie($);
|
|
429
429
|
T && !D || !T && D || T && D && g >= Number($) ? S() : S(!T && !D ? new Error(o("tvp.tvpSearchbox.rangeNumberTitle")) : new Error(o("tvp.tvpSearchbox.rangeMaxErr")));
|
|
430
430
|
}
|
|
431
431
|
};
|
|
432
432
|
};
|
|
433
|
-
function Qt({ props: e, emit: t, state: o, t:
|
|
434
|
-
const m = f || o.instance,
|
|
433
|
+
function Qt({ props: e, emit: t, state: o, t: a, format: s, nextTick: i, vm: f, cancelHandleInput: c, selectFirstMap: d }) {
|
|
434
|
+
const m = f || o.instance, u = (V) => {
|
|
435
435
|
var C, x, O;
|
|
436
|
-
const { start: k, end:
|
|
436
|
+
const { start: k, end: b, type: M } = V;
|
|
437
437
|
if (o.backupList = V.options, M === "numRange")
|
|
438
|
-
rt(o, V,
|
|
438
|
+
rt(o, V, a);
|
|
439
439
|
else if (M === "dateRange") {
|
|
440
440
|
const { dateRangeFormat: L } = o;
|
|
441
441
|
if (!o.startDate && k) {
|
|
442
|
-
const
|
|
443
|
-
o.startDate = o.endDate <
|
|
442
|
+
const H = s(k, L);
|
|
443
|
+
o.startDate = o.endDate < H ? null : H;
|
|
444
444
|
}
|
|
445
|
-
if (!o.endDate &&
|
|
446
|
-
const
|
|
447
|
-
o.endDate =
|
|
445
|
+
if (!o.endDate && b) {
|
|
446
|
+
const H = s(b, L);
|
|
447
|
+
o.endDate = H < o.startDate ? null : H;
|
|
448
448
|
}
|
|
449
449
|
} else if (M === "datetimeRange") {
|
|
450
450
|
const { datetimeRangeFormat: L } = o;
|
|
451
451
|
if (!o.startDateTime && k) {
|
|
452
|
-
const
|
|
453
|
-
o.startDateTime = o.endDateTime <
|
|
452
|
+
const H = s(k, L);
|
|
453
|
+
o.startDateTime = o.endDateTime < H ? null : H;
|
|
454
454
|
}
|
|
455
|
-
if (!o.endDateTime &&
|
|
456
|
-
const
|
|
457
|
-
o.endDateTime =
|
|
455
|
+
if (!o.endDateTime && b) {
|
|
456
|
+
const H = s(b, L);
|
|
457
|
+
o.endDateTime = H < o.startDateTime ? null : H;
|
|
458
458
|
}
|
|
459
459
|
} else
|
|
460
460
|
o.backupList && M === "checkbox" && (o.filterList = o.backupList, o.checkboxGroup = [], (C = o.backupList) == null || C.forEach((L) => {
|
|
461
|
-
|
|
461
|
+
ne(o, L.label) && o.checkboxGroup.push(`${V.label}${L.label}`), L.isFilter = !1;
|
|
462
462
|
}));
|
|
463
|
-
(M === "dateRange" || M === "datetimeRange") &&
|
|
463
|
+
(M === "dateRange" || M === "datetimeRange") && i(() => {
|
|
464
464
|
Wt(o, ["startDate", "endDate", "startDateTime", "endDateTime"]);
|
|
465
465
|
}), M !== "checkbox" && ((x = o.backupList) != null && x.length) && ((O = o.backupList) == null || O.forEach((L) => {
|
|
466
|
-
L.isFilter = !1, L.isChecked =
|
|
466
|
+
L.isFilter = !1, L.isChecked = ne(o, L.label);
|
|
467
467
|
})), o.currentOperators = null, !o.backupList && !["dateRange", "datetimeRange", "numRange", "custom"].includes(M) ? _(o, !1) : _(o);
|
|
468
|
-
},
|
|
468
|
+
}, p = (V) => {
|
|
469
469
|
var x;
|
|
470
|
-
const { field: k, label:
|
|
471
|
-
o.propItem = { ...o.propItem, label:
|
|
470
|
+
const { field: k, label: b } = V;
|
|
471
|
+
o.propItem = { ...o.propItem, label: b }, t("first-level-select", k);
|
|
472
472
|
const M = (x = m.$refs) == null ? void 0 : x.inputRef;
|
|
473
473
|
o.prevItem = V, o.backupPrevItem = V;
|
|
474
474
|
const { operators: C } = V;
|
|
475
|
-
C != null && C.length ? (o.operatorValue = "", o.currentOperators = C, _(o)) : (o.operatorValue = ":",
|
|
476
|
-
},
|
|
477
|
-
o.operatorValue = V,
|
|
478
|
-
}, r = (V, k,
|
|
479
|
-
const { replace: C, operators: x, mergeTag: O } = V, L =
|
|
480
|
-
let
|
|
475
|
+
C != null && C.length ? (o.operatorValue = "", o.currentOperators = C, _(o)) : (o.operatorValue = ":", u(V)), o.inputValue = "", M.focus();
|
|
476
|
+
}, n = (V) => {
|
|
477
|
+
o.operatorValue = V, u(o.prevItem);
|
|
478
|
+
}, r = (V, k, b, M) => {
|
|
479
|
+
const { replace: C, operators: x, mergeTag: O } = V, L = Re(V), { indexMap: H } = o, Y = H.get(b), le = fe(e, V, k), re = o.operatorValue && x ? { operator: o.operatorValue } : null;
|
|
480
|
+
let J = null;
|
|
481
481
|
if (O) {
|
|
482
|
-
const
|
|
482
|
+
const U = { label: M, ...le };
|
|
483
483
|
if (Y >= 0) {
|
|
484
|
-
const
|
|
485
|
-
|
|
484
|
+
const se = `${o.innerModelValue[Y].value} | ${M}`, de = [...o.innerModelValue[Y].options, U];
|
|
485
|
+
J = pe({ ...o.innerModelValue[Y], value: se, options: de });
|
|
486
486
|
} else
|
|
487
|
-
|
|
487
|
+
J = pe({ ...L, label: b, value: M, options: [U] });
|
|
488
488
|
} else
|
|
489
|
-
|
|
490
|
-
if (
|
|
491
|
-
|
|
489
|
+
J = pe({ ...L, label: b, value: M, ...le, ...re });
|
|
490
|
+
if (ne(o, M, b)) {
|
|
491
|
+
Oe(o);
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
494
494
|
_(o, !1);
|
|
495
|
-
const
|
|
496
|
-
let
|
|
495
|
+
const ce = ue(o.innerModelValue);
|
|
496
|
+
let B = [];
|
|
497
497
|
if ((C || O) && Y >= 0) {
|
|
498
|
-
const
|
|
499
|
-
|
|
498
|
+
const U = [...o.innerModelValue];
|
|
499
|
+
U.splice(Y, 1), B = [...U, J];
|
|
500
500
|
} else
|
|
501
|
-
|
|
502
|
-
|
|
501
|
+
B = [...o.innerModelValue, J];
|
|
502
|
+
te({ emit: t, state: o, nextTick: i, newValue: B, oldValue: ce });
|
|
503
503
|
}, l = (V) => {
|
|
504
|
-
var k,
|
|
505
|
-
D(), (
|
|
504
|
+
var k, b;
|
|
505
|
+
D(), (b = (k = m.$refs) == null ? void 0 : k.inputRef) == null || b.focus();
|
|
506
506
|
}, h = (V, k = !1) => {
|
|
507
507
|
var x;
|
|
508
508
|
_(o, !1), k && (o.prevItem = V, o.backupPrevItem = V);
|
|
509
|
-
const { prevItem:
|
|
510
|
-
if (!
|
|
509
|
+
const { prevItem: b } = o, M = V.value || V.label, C = (x = m.$refs) == null ? void 0 : x.inputRef;
|
|
510
|
+
if (!ne(o, M)) {
|
|
511
511
|
const O = o.propItem.label || V.label;
|
|
512
|
-
r(
|
|
512
|
+
r(b, V, O, M);
|
|
513
513
|
}
|
|
514
514
|
C.focus();
|
|
515
515
|
}, g = (V, k) => {
|
|
516
|
-
var
|
|
516
|
+
var b, M;
|
|
517
517
|
if (V.label) {
|
|
518
518
|
if (t("second-level-enter", k), k.type === "map") {
|
|
519
519
|
if (o.isShowTagKey) {
|
|
520
|
-
const O = (
|
|
520
|
+
const O = (b = k.options) == null ? void 0 : b[0];
|
|
521
521
|
O && d(O, !0);
|
|
522
522
|
} else {
|
|
523
523
|
const O = (M = o.backupList) == null ? void 0 : M.find((L) => !L.isChecked);
|
|
@@ -537,121 +537,125 @@ function Qt({ props: e, emit: t, state: o, t: n, format: u, nextTick: p, vm: f,
|
|
|
537
537
|
}
|
|
538
538
|
} else
|
|
539
539
|
t("search", o.innerModelValue);
|
|
540
|
-
}, S = (V, k,
|
|
540
|
+
}, S = (V, k, b) => {
|
|
541
541
|
var C, x;
|
|
542
|
-
const M = (C = o.backupList) == null ? void 0 : C.find((O) => (O.value || O.label) ===
|
|
543
|
-
V.type === "checkbox" && ((x = o.backupList) != null && x.length) && !M || r(V, M, k.label,
|
|
544
|
-
}, $ = (V) => V.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), T = (V, k,
|
|
545
|
-
var M, C, x, O, L;
|
|
542
|
+
const M = (C = o.backupList) == null ? void 0 : C.find((O) => (O.value || O.label) === b);
|
|
543
|
+
V.type === "checkbox" && ((x = o.backupList) != null && x.length) && !M || r(V, M, k.label, b);
|
|
544
|
+
}, $ = (V) => V.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), T = (V, k, b) => {
|
|
545
|
+
var M, C, x, O, L, H;
|
|
546
546
|
if (k.label) {
|
|
547
|
-
if (
|
|
548
|
-
o.isShowTagKey || r(
|
|
547
|
+
if (b.type === "map") {
|
|
548
|
+
o.isShowTagKey || r(b, void 0, k.label, o.propItem.value + V);
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
const { regexp:
|
|
552
|
-
if (Array.isArray(
|
|
553
|
-
const
|
|
554
|
-
|
|
551
|
+
const { regexp: Y, replace: le, type: re, mergeTag: J } = b;
|
|
552
|
+
if (Array.isArray(b.options) && b.options.length && !(re === "checkbox" && J)) {
|
|
553
|
+
const B = new RegExp($(V.trim()), "i"), U = (M = o.backupList) == null ? void 0 : M.find((se) => B.test(se.label));
|
|
554
|
+
U ? h(U) : (C = o.backupList) == null || C.forEach((se) => {
|
|
555
|
+
se.isFilter = !0;
|
|
556
|
+
});
|
|
555
557
|
return;
|
|
556
558
|
}
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
for (const
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
invalidValues:
|
|
564
|
-
field:
|
|
565
|
-
label:
|
|
566
|
-
regexp:
|
|
559
|
+
const ce = re !== "checkbox" && le || re === "checkbox" && J ? [V] : V.split(e.splitInputValue);
|
|
560
|
+
if (Y) {
|
|
561
|
+
const B = [];
|
|
562
|
+
for (const U of ce)
|
|
563
|
+
Y.test(U) ? S(b, k, U) : B.push(U);
|
|
564
|
+
B.length > 0 && t("validate-error", {
|
|
565
|
+
invalidValues: B,
|
|
566
|
+
field: b.field,
|
|
567
|
+
label: b.label,
|
|
568
|
+
regexp: Y.toString()
|
|
567
569
|
});
|
|
568
570
|
} else
|
|
569
|
-
for (const
|
|
570
|
-
S(
|
|
571
|
+
for (const B of ce)
|
|
572
|
+
S(b, k, B);
|
|
571
573
|
} else {
|
|
572
|
-
const { items:
|
|
573
|
-
const { regexp:
|
|
574
|
-
return
|
|
575
|
-
}),
|
|
576
|
-
(
|
|
577
|
-
|
|
578
|
-
|
|
574
|
+
const { items: Y, defaultField: le, defaultFieldReplace: re } = e, J = Y.find((F) => {
|
|
575
|
+
const { regexp: K } = F;
|
|
576
|
+
return K && K.test(V);
|
|
577
|
+
}), ce = le ? Y.find((F) => F.field === le) : o.allTypeAttri, B = J || ce, U = !J && re ? { ...B, replace: !0 } : B, { replace: se, type: de, mergeTag: Pe, regexp: he } = U, Ve = de !== "checkbox" && se || de === "checkbox" && Pe ? [V] : V.split(e.splitInputValue);
|
|
578
|
+
(x = B == null ? void 0 : B.options) != null && x.length && (o.backupList = [...B.options], (O = o.backupList) == null || O.forEach((F) => {
|
|
579
|
+
F.isFilter = !1;
|
|
580
|
+
const K = F.value || F.label;
|
|
581
|
+
Ve.includes(K) && (F.isChecked = !0);
|
|
579
582
|
}));
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
const
|
|
583
|
-
for (const
|
|
584
|
-
if (
|
|
585
|
-
if (de === "checkbox" && ((
|
|
583
|
+
const _e = B.label;
|
|
584
|
+
if (he) {
|
|
585
|
+
const F = [];
|
|
586
|
+
for (const K of Ve)
|
|
587
|
+
if (he.test(K)) {
|
|
588
|
+
if (de === "checkbox" && ((L = B == null ? void 0 : B.options) != null && L.length) && !o.backupList.find((ve) => (ve.value || ve.label) === K))
|
|
586
589
|
continue;
|
|
587
|
-
r(
|
|
590
|
+
r(U, {}, _e, K);
|
|
588
591
|
} else
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
invalidValues:
|
|
592
|
-
field:
|
|
593
|
-
label:
|
|
594
|
-
regexp:
|
|
592
|
+
F.push(K);
|
|
593
|
+
F.length > 0 && t("validate-error", {
|
|
594
|
+
invalidValues: F,
|
|
595
|
+
field: U.field,
|
|
596
|
+
label: U.label,
|
|
597
|
+
regexp: he.toString()
|
|
595
598
|
});
|
|
596
599
|
} else
|
|
597
|
-
for (const
|
|
598
|
-
de === "checkbox" && ((
|
|
600
|
+
for (const F of Ve)
|
|
601
|
+
de === "checkbox" && ((H = B == null ? void 0 : B.options) != null && H.length) && !o.backupList.find((K) => (K.value || K.label) === F) || r(U, {}, _e, F);
|
|
599
602
|
}
|
|
600
603
|
}, D = () => {
|
|
601
|
-
|
|
602
|
-
|
|
604
|
+
var M;
|
|
605
|
+
const { propItem: V, prevItem: k } = o, b = ((M = o.inputValue) == null ? void 0 : M.trim()) ?? "";
|
|
606
|
+
c && c(), b ? T(b, V, k) : g(V, k);
|
|
603
607
|
};
|
|
604
|
-
return { selectPropItem:
|
|
608
|
+
return { selectPropItem: p, selectRadioItem: h, selectInputValue: l, createTag: D, helpClick: () => {
|
|
605
609
|
t("help");
|
|
606
|
-
}, setOperator:
|
|
610
|
+
}, setOperator: n };
|
|
607
611
|
}
|
|
608
|
-
const Jt = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
|
|
612
|
+
const Jt = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Fe = (e, t) => {
|
|
609
613
|
const o = [];
|
|
610
|
-
let
|
|
611
|
-
for (; (
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
+
let a = 0, s;
|
|
615
|
+
for (; (s = e.exec(t)) !== null; ) {
|
|
616
|
+
const i = s.index, f = e.lastIndex;
|
|
617
|
+
i > a && o.push(t.slice(a, i)), o.push(t.slice(i, f)), a = f;
|
|
614
618
|
}
|
|
615
|
-
return
|
|
619
|
+
return a < t.length && o.push(t.slice(a)), o;
|
|
616
620
|
};
|
|
617
|
-
function eo({ props: e, state: t, emit: o, nextTick:
|
|
618
|
-
const
|
|
619
|
-
t.potentialOptions = await e.potentialOptions.getMatchList(
|
|
620
|
-
}, f = Yt((
|
|
621
|
-
var D,
|
|
622
|
-
const { recordItems:
|
|
621
|
+
function eo({ props: e, state: t, emit: o, nextTick: a }) {
|
|
622
|
+
const s = async (u) => {
|
|
623
|
+
t.potentialOptions = await e.potentialOptions.getMatchList(u), _(t, !0);
|
|
624
|
+
}, f = Yt((u) => {
|
|
625
|
+
var D, v, V, k;
|
|
626
|
+
const { recordItems: p, propItem: n } = t, r = typeof u == "string" ? u : u && u.target && typeof u.target.value == "string" ? u.target.value : t.inputValue || "", l = (D = String(r)) == null ? void 0 : D.trim();
|
|
623
627
|
if (l.length === 0) {
|
|
624
628
|
d(), _(t);
|
|
625
629
|
return;
|
|
626
630
|
}
|
|
627
|
-
Object.keys(t.matchItems).forEach((
|
|
628
|
-
t.matchItems[
|
|
631
|
+
Object.keys(t.matchItems).forEach((b) => {
|
|
632
|
+
t.matchItems[b].attr = [], t.matchItems[b].attrValue = [];
|
|
629
633
|
});
|
|
630
|
-
const h = Jt(l), g = new RegExp(h, "i"), S =
|
|
634
|
+
const h = Jt(l), g = new RegExp(h, "i"), S = n.label || !h ? null : p.find((b) => b.type === "map" && g.test(b.label));
|
|
631
635
|
if (S) {
|
|
632
636
|
t.propItem = { ...t.propItem, label: S.label }, t.inputValue = "", t.prevItem = S, t.backupPrevItem = S, t.backupList = S.options || [];
|
|
633
637
|
return;
|
|
634
638
|
}
|
|
635
|
-
t.filterList = (
|
|
639
|
+
t.filterList = (v = t.backupList) == null ? void 0 : v.filter((b) => g.test(b.label) ? (b.isFilter = !1, ne(t, b.label) && t.checkboxGroup.push(`${t.prevItem.label}${b.label}`), !0) : (b.isFilter = !0, !1));
|
|
636
640
|
const $ = new RegExp(h, "ig"), T = l.toLowerCase();
|
|
637
641
|
if (t.propItem.label) {
|
|
638
|
-
(V = t.backupList) == null || V.forEach((
|
|
639
|
-
|
|
640
|
-
const M =
|
|
641
|
-
g.test(M) ? (
|
|
642
|
+
(V = t.backupList) == null || V.forEach((b) => {
|
|
643
|
+
b.hightlighStr = T;
|
|
644
|
+
const M = b.label;
|
|
645
|
+
g.test(M) ? (b.match = Fe($, M), b.isFilter = !1) : b.isFilter = !0;
|
|
642
646
|
}), (k = t.backupList) != null && k.length || l ? _(t) : _(t, !1);
|
|
643
647
|
return;
|
|
644
648
|
}
|
|
645
|
-
for (const
|
|
646
|
-
const { options: M = [], groupKey: C = "0", ...x } =
|
|
649
|
+
for (const b of p) {
|
|
650
|
+
const { options: M = [], groupKey: C = "0", ...x } = b, O = x.label;
|
|
647
651
|
if (g.test(O)) {
|
|
648
|
-
const L =
|
|
649
|
-
t.matchItems[C].attr.push({ ...
|
|
652
|
+
const L = Fe($, O);
|
|
653
|
+
t.matchItems[C].attr.push({ ...b, match: L, hightlighStr: T });
|
|
650
654
|
}
|
|
651
655
|
for (const L of M) {
|
|
652
|
-
const
|
|
653
|
-
if (g.test(
|
|
654
|
-
const Y =
|
|
656
|
+
const H = t.propItem.label ? O : `${O}:${L.label}`;
|
|
657
|
+
if (g.test(H)) {
|
|
658
|
+
const Y = Fe($, H);
|
|
655
659
|
t.matchItems[C].attrValue.push({
|
|
656
660
|
...L,
|
|
657
661
|
...x,
|
|
@@ -663,186 +667,188 @@ function eo({ props: e, state: t, emit: o, nextTick: n }) {
|
|
|
663
667
|
}
|
|
664
668
|
}
|
|
665
669
|
}
|
|
666
|
-
h && e.potentialOptions && e.potentialOptions.getMatchList ?
|
|
667
|
-
}, 500),
|
|
670
|
+
h && e.potentialOptions && e.potentialOptions.getMatchList ? s(h) : _(t);
|
|
671
|
+
}, 500), c = () => {
|
|
668
672
|
f.cancel && f.cancel();
|
|
669
673
|
}, d = () => {
|
|
670
|
-
var
|
|
671
|
-
(
|
|
674
|
+
var u;
|
|
675
|
+
(u = t.backupList) == null || u.forEach((p) => {
|
|
676
|
+
p.isFilter = !1;
|
|
677
|
+
});
|
|
672
678
|
};
|
|
673
679
|
return {
|
|
674
680
|
handleInput: f,
|
|
675
|
-
selectFirstMap: (
|
|
681
|
+
selectFirstMap: (u, p) => {
|
|
676
682
|
var h;
|
|
677
|
-
const { options:
|
|
678
|
-
if (
|
|
679
|
-
_(t, !1), t.propItem = { ...t.propItem, value: `${
|
|
683
|
+
const { options: n } = u, { prevItem: r, propItem: l } = t;
|
|
684
|
+
if (n)
|
|
685
|
+
_(t, !1), t.propItem = { ...t.propItem, value: `${u.label}=` }, t.isShowTagKey = !1, t.inputValue = "", t.backupList = u.options || [], d(), (h = t.backupList) == null || h.forEach((g) => {
|
|
680
686
|
const S = t.propItem.value + g.label;
|
|
681
|
-
g.isChecked =
|
|
687
|
+
g.isChecked = ne(t, S);
|
|
682
688
|
});
|
|
683
689
|
else {
|
|
684
|
-
if (
|
|
690
|
+
if (u.isChecked)
|
|
685
691
|
return;
|
|
686
692
|
_(t, !1), t.isShowTagKey = !0, d();
|
|
687
|
-
const { field: g, type: S } = r, $ = l.value +
|
|
688
|
-
|
|
693
|
+
const { field: g, type: S } = r, $ = l.value + u.label, T = fe(e, r, u), v = [pe({ type: S, field: g, label: l.label, value: $, ...T })];
|
|
694
|
+
te({ emit: o, state: t, nextTick: a, tagList: v });
|
|
689
695
|
}
|
|
690
|
-
|
|
696
|
+
p && _(t);
|
|
691
697
|
},
|
|
692
|
-
cancelHandleInput:
|
|
698
|
+
cancelHandleInput: c
|
|
693
699
|
};
|
|
694
700
|
}
|
|
695
|
-
function to({ props: e, state: t, emit: o, nextTick:
|
|
701
|
+
function to({ props: e, state: t, emit: o, nextTick: a }) {
|
|
696
702
|
return {
|
|
697
|
-
selectCheckbox: (
|
|
698
|
-
var
|
|
703
|
+
selectCheckbox: (i) => {
|
|
704
|
+
var u, p;
|
|
699
705
|
_(t, !1);
|
|
700
|
-
const { checkboxGroup: f, prevItem:
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
706
|
+
const { checkboxGroup: f, prevItem: c, propItem: d } = t, m = Re(c);
|
|
707
|
+
if (i) {
|
|
708
|
+
const n = [], r = ue(t.innerModelValue), { mergeTag: l, operators: h, label: g } = c;
|
|
703
709
|
if (l) {
|
|
704
710
|
let S = "";
|
|
705
711
|
const $ = [], { indexMap: T } = t, D = T.get(g);
|
|
706
|
-
if (D !== void 0 && t.innerModelValue.splice(D, 1), (
|
|
707
|
-
const { label: V } =
|
|
712
|
+
if (D !== void 0 && t.innerModelValue.splice(D, 1), (u = t.backupList) == null || u.forEach((v) => {
|
|
713
|
+
const { label: V } = v, k = `${g}${V}`;
|
|
708
714
|
if (f.includes(k)) {
|
|
709
|
-
|
|
710
|
-
const M = fe(e,
|
|
715
|
+
v.isFilter = !1;
|
|
716
|
+
const M = fe(e, c, v), C = { label: v.label, ...M };
|
|
711
717
|
S += S ? ` | ${V}` : V, $.push(C);
|
|
712
718
|
}
|
|
713
719
|
}), $.length > 0) {
|
|
714
|
-
const
|
|
715
|
-
|
|
720
|
+
const v = { ...m, value: S, options: $ };
|
|
721
|
+
n.push(v);
|
|
716
722
|
}
|
|
717
723
|
} else {
|
|
718
724
|
const { valueMap: S } = t, $ = [];
|
|
719
|
-
if ((
|
|
720
|
-
const { label: D } = T,
|
|
721
|
-
if (V && !
|
|
722
|
-
const k = fe(e,
|
|
723
|
-
|
|
724
|
-
} else if (!V &&
|
|
725
|
+
if ((p = t.backupList) == null || p.forEach((T) => {
|
|
726
|
+
const { label: D } = T, v = `${g}${D}`, V = f.includes(v);
|
|
727
|
+
if (V && !ne(t, D)) {
|
|
728
|
+
const k = fe(e, c, T), b = t.operatorValue && h ? { operator: t.operatorValue } : null, M = pe({ ...m, label: d.label, value: D, ...k, ...b });
|
|
729
|
+
n.push(M), T.isChecked = !0;
|
|
730
|
+
} else if (!V && ne(t, D)) {
|
|
725
731
|
T.isChecked = !1;
|
|
726
|
-
const k = S.get(
|
|
732
|
+
const k = S.get(v);
|
|
727
733
|
$.push(k);
|
|
728
734
|
}
|
|
729
735
|
}), $.length) {
|
|
730
|
-
const T = t.innerModelValue.filter((D,
|
|
731
|
-
|
|
736
|
+
const T = t.innerModelValue.filter((D, v) => D && !$.includes(v));
|
|
737
|
+
te({ emit: o, state: t, nextTick: a, newValue: T, oldValue: r });
|
|
732
738
|
return;
|
|
733
739
|
}
|
|
734
740
|
}
|
|
735
|
-
|
|
741
|
+
te({ emit: o, state: t, nextTick: a, tagList: n, oldValue: r });
|
|
736
742
|
} else
|
|
737
743
|
t.propItem = { ...d, label: "" }, t.inputValue = "";
|
|
738
744
|
}
|
|
739
745
|
};
|
|
740
746
|
}
|
|
741
|
-
const
|
|
747
|
+
const ge = (e) => {
|
|
742
748
|
const t = new Date(e);
|
|
743
749
|
return t.setHours(0, 0, 0, 0), t.getTime();
|
|
744
750
|
};
|
|
745
|
-
function oo({ props: e, state: t, emit: o, nextTick:
|
|
746
|
-
const
|
|
747
|
-
if (!
|
|
751
|
+
function oo({ props: e, state: t, emit: o, nextTick: a, vm: s }) {
|
|
752
|
+
const i = s || t.instance, f = async (u, p = !1) => {
|
|
753
|
+
if (!u) {
|
|
748
754
|
t.propItem = { label: "" };
|
|
749
755
|
return;
|
|
750
756
|
}
|
|
751
|
-
const
|
|
752
|
-
if (
|
|
757
|
+
const n = await He(i, t, e, p);
|
|
758
|
+
if (n) {
|
|
753
759
|
_(t, !1);
|
|
754
|
-
const r = e.modelValue.filter((l) => l.type !==
|
|
755
|
-
r.push(
|
|
760
|
+
const r = e.modelValue.filter((l) => l.type !== n.type || l.field !== n.field);
|
|
761
|
+
r.push(n), te({ emit: o, state: t, nextTick: a, newValue: r });
|
|
756
762
|
} else
|
|
757
763
|
_(t);
|
|
758
|
-
},
|
|
759
|
-
const { maxTimeLength: r = 0, min: l, max: h } = t.prevItem, g = t.prevItem.type === "datetimeRange", S = l ? typeof l == "number" ? l : l.getTime() : null, $ = h ? typeof h == "number" ? h : h.getTime() : null, T = S == null ? null : g ?
|
|
764
|
+
}, c = () => _(t), d = (u, p, n) => {
|
|
765
|
+
const { maxTimeLength: r = 0, min: l, max: h } = t.prevItem, g = t.prevItem.type === "datetimeRange", S = l ? typeof l == "number" ? l : l.getTime() : null, $ = h ? typeof h == "number" ? h : h.getTime() : null, T = S == null ? null : g ? ge(S) : S, D = t[n], v = u.getTime();
|
|
760
766
|
if (r > 0)
|
|
761
767
|
if (l || h)
|
|
762
|
-
if (
|
|
763
|
-
const V = new Date(D).getTime(), k = !l && h ? V - r : Math.max(S, V - r),
|
|
764
|
-
return
|
|
765
|
-
} else if (!
|
|
766
|
-
const V = new Date(
|
|
767
|
-
return
|
|
768
|
+
if (n && D) {
|
|
769
|
+
const V = new Date(D).getTime(), k = !l && h ? V - r : Math.max(S, V - r), b = g ? ge(k) : k;
|
|
770
|
+
return v < b || v > V;
|
|
771
|
+
} else if (!n && p) {
|
|
772
|
+
const V = new Date(p).getTime(), k = l && !h ? V + r : Math.min($, V + r), b = g ? ge(V) : V;
|
|
773
|
+
return v < b || v > k;
|
|
768
774
|
} else
|
|
769
|
-
return T &&
|
|
770
|
-
else if (
|
|
771
|
-
const V = new Date(D).getTime(), k = V - r,
|
|
772
|
-
return
|
|
773
|
-
} else if (!
|
|
774
|
-
const V = new Date(
|
|
775
|
-
return
|
|
775
|
+
return T && v < T || $ && v > $;
|
|
776
|
+
else if (n && D) {
|
|
777
|
+
const V = new Date(D).getTime(), k = V - r, b = g ? ge(k) : k;
|
|
778
|
+
return v < b || v > V;
|
|
779
|
+
} else if (!n && p) {
|
|
780
|
+
const V = new Date(p).getTime(), k = V + r, b = g ? ge(V) : V;
|
|
781
|
+
return v < b || v > k;
|
|
776
782
|
} else
|
|
777
783
|
return !1;
|
|
778
784
|
else if (l || h)
|
|
779
|
-
if (
|
|
785
|
+
if (n && D) {
|
|
780
786
|
const V = new Date(D).getTime();
|
|
781
|
-
return T &&
|
|
782
|
-
} else if (!
|
|
783
|
-
const V = new Date(
|
|
784
|
-
return
|
|
787
|
+
return T && v < T || v > V;
|
|
788
|
+
} else if (!n && p) {
|
|
789
|
+
const V = new Date(p).getTime(), k = g ? ge(V) : V;
|
|
790
|
+
return v < k || $ && v > $;
|
|
785
791
|
} else
|
|
786
|
-
return T &&
|
|
787
|
-
else if (
|
|
792
|
+
return T && v < T || $ && v > $;
|
|
793
|
+
else if (n && D) {
|
|
788
794
|
const V = new Date(D).getTime();
|
|
789
|
-
return
|
|
790
|
-
} else if (!
|
|
791
|
-
const V = new Date(
|
|
792
|
-
return
|
|
795
|
+
return v > V;
|
|
796
|
+
} else if (!n && p) {
|
|
797
|
+
const V = new Date(p).getTime(), k = g ? ge(V) : V;
|
|
798
|
+
return v < k;
|
|
793
799
|
} else
|
|
794
800
|
return !1;
|
|
795
801
|
};
|
|
796
802
|
return {
|
|
797
803
|
onConfirmDate: f,
|
|
798
|
-
handleDateShow:
|
|
799
|
-
pickerOptions: (
|
|
800
|
-
const
|
|
801
|
-
return l.disabledDate = typeof h == "function" ? (g) =>
|
|
804
|
+
handleDateShow: c,
|
|
805
|
+
pickerOptions: (u, p = "") => {
|
|
806
|
+
const n = (g) => d(g, u, p), r = t.prevItem.pickerOptions || {}, l = { ...r }, h = r.disabledDate;
|
|
807
|
+
return l.disabledDate = typeof h == "function" ? (g) => n(g) || h(g) : n, l;
|
|
802
808
|
}
|
|
803
809
|
};
|
|
804
810
|
}
|
|
805
|
-
function no({ props: e, state: t, t: o, emit:
|
|
806
|
-
const f =
|
|
807
|
-
if (!
|
|
811
|
+
function no({ props: e, state: t, t: o, emit: a, nextTick: s, vm: i }) {
|
|
812
|
+
const f = i || t.instance, c = async (u) => {
|
|
813
|
+
if (!u) {
|
|
808
814
|
t.propItem = { ...t.propItem, label: "" };
|
|
809
815
|
return;
|
|
810
816
|
}
|
|
811
|
-
const
|
|
812
|
-
if (
|
|
817
|
+
const p = await lt(f, t, e);
|
|
818
|
+
if (p) {
|
|
813
819
|
_(t, !1);
|
|
814
|
-
const
|
|
815
|
-
|
|
820
|
+
const n = e.modelValue.filter((r) => r.type !== p.type || r.field !== p.field);
|
|
821
|
+
n.push(p), te({ emit: a, state: t, nextTick: s, newValue: n });
|
|
816
822
|
} else
|
|
817
823
|
_(t);
|
|
818
|
-
}, d = (
|
|
819
|
-
const { maxTimeLength: r = 0 } =
|
|
824
|
+
}, d = (u, p, n) => {
|
|
825
|
+
const { maxTimeLength: r = 0 } = u;
|
|
820
826
|
return {
|
|
821
|
-
[
|
|
827
|
+
[p]: {
|
|
822
828
|
validator: (l, h, g) => {
|
|
823
|
-
r > 0 && !h ? g(new Error(o("tvp.tvpSearchbox.notBeNull"))) : !h && !t[
|
|
829
|
+
r > 0 && !h ? g(new Error(o("tvp.tvpSearchbox.notBeNull"))) : !h && !t[n] ? g(new Error(o("tvp.tvpSearchbox.rangeDateTitle"))) : g();
|
|
824
830
|
}
|
|
825
831
|
},
|
|
826
|
-
[
|
|
832
|
+
[n]: {
|
|
827
833
|
validator: (l, h, g) => {
|
|
828
|
-
r > 0 && !h ? g(new Error(o("tvp.tvpSearchbox.notBeNull"))) : !h && !t[
|
|
834
|
+
r > 0 && !h ? g(new Error(o("tvp.tvpSearchbox.notBeNull"))) : !h && !t[p] ? g(new Error(o("tvp.tvpSearchbox.rangeDateTitle"))) : h && t[p] && we(h, t[p]) < 0 ? g(new Error(o("tvp.tvpSearchbox.rangeDateMaxErr"))) : g();
|
|
829
835
|
}
|
|
830
836
|
}
|
|
831
837
|
};
|
|
832
838
|
};
|
|
833
839
|
return {
|
|
834
840
|
initFormRule: () => {
|
|
835
|
-
let
|
|
836
|
-
e.items.forEach((
|
|
837
|
-
|
|
841
|
+
let u = {}, p = {};
|
|
842
|
+
e.items.forEach((n) => {
|
|
843
|
+
n.type === "dateRange" && (u = d(n, "startDate", "endDate")), n.type === "datetimeRange" && (p = d(n, "startDateTime", "endDateTime"));
|
|
838
844
|
}), t.formRules = {
|
|
839
|
-
...
|
|
840
|
-
...
|
|
845
|
+
...u,
|
|
846
|
+
...p
|
|
841
847
|
}, e.editable && (t.formRules.inputEditValue = {
|
|
842
848
|
required: !0,
|
|
843
849
|
message: o("tvp.tvpSearchbox.notBeNull"),
|
|
844
850
|
trigger: ["change", "blur"]
|
|
845
|
-
}, e.maxlength && (t.formRules.inputEditValue.validator = (
|
|
851
|
+
}, e.maxlength && (t.formRules.inputEditValue.validator = (n, r, l) => {
|
|
846
852
|
(Array.isArray(r) ? r : [r]).some((S) => typeof S == "string" && S.length > e.maxlength) ? l(new Error(o("tvp.tvpSearchbox.maxlengthErr", [e.maxlength]))) : l();
|
|
847
853
|
}), t.formRules.mapEditKey = {
|
|
848
854
|
required: !0,
|
|
@@ -854,16 +860,16 @@ function no({ props: e, state: t, t: o, emit: n, nextTick: u, vm: p }) {
|
|
|
854
860
|
trigger: ["change"]
|
|
855
861
|
});
|
|
856
862
|
},
|
|
857
|
-
sizeChange:
|
|
863
|
+
sizeChange: c
|
|
858
864
|
};
|
|
859
865
|
}
|
|
860
|
-
function ao({ props: e, state: t, t: o, nextTick:
|
|
861
|
-
const
|
|
866
|
+
function ao({ props: e, state: t, t: o, nextTick: a, format: s, emit: i, vm: f }) {
|
|
867
|
+
const c = (n, r = !1) => {
|
|
862
868
|
var V;
|
|
863
|
-
const { operator: l, value: h, start: g, end: S } =
|
|
869
|
+
const { operator: l, value: h, start: g, end: S } = n, { options: $, operators: T, type: D, mergeTag: v } = t.prevItem;
|
|
864
870
|
if (r) {
|
|
865
871
|
const k = {
|
|
866
|
-
inputEditValue:
|
|
872
|
+
inputEditValue: v ? [] : "",
|
|
867
873
|
currentEditSelectTags: [],
|
|
868
874
|
currentEditValue: [],
|
|
869
875
|
startDate: null,
|
|
@@ -879,20 +885,20 @@ function ao({ props: e, state: t, t: o, nextTick: n, format: u, emit: p, vm: f }
|
|
|
879
885
|
if (D !== "custom") {
|
|
880
886
|
if (D === "map") {
|
|
881
887
|
if (!r) {
|
|
882
|
-
const k = String(
|
|
883
|
-
t.mapEditKey =
|
|
888
|
+
const k = String(n.value || ""), b = k.indexOf("=");
|
|
889
|
+
t.mapEditKey = b >= 0 ? k.substring(0, b) : "", t.mapEditValue = b >= 0 ? k.substring(b + 1) : "";
|
|
884
890
|
}
|
|
885
891
|
} else if (D === "numRange")
|
|
886
|
-
rt(t,
|
|
892
|
+
rt(t, n, o);
|
|
887
893
|
else if (D === "dateRange") {
|
|
888
894
|
const { dateRangeFormat: k } = t;
|
|
889
|
-
t.startDate =
|
|
895
|
+
t.startDate = s(g, k), t.endDate = s(S, k);
|
|
890
896
|
} else if (D === "datetimeRange") {
|
|
891
897
|
const { datetimeRangeFormat: k } = t;
|
|
892
|
-
t.startDateTime =
|
|
898
|
+
t.startDateTime = s(g, k), t.endDateTime = s(S, k);
|
|
893
899
|
} else {
|
|
894
|
-
if (
|
|
895
|
-
const k = r ? [] : ((V =
|
|
900
|
+
if (v) {
|
|
901
|
+
const k = r ? [] : ((V = n.options) == null ? void 0 : V.flatMap((b) => b.label)) || [];
|
|
896
902
|
t.inputEditValue = k, t.currentEditSelectTags = k;
|
|
897
903
|
} else
|
|
898
904
|
t.inputEditValue = r ? "" : Array.isArray(h) ? h.join(",") : h || "";
|
|
@@ -901,27 +907,27 @@ function ao({ props: e, state: t, t: o, nextTick: n, format: u, emit: p, vm: f }
|
|
|
901
907
|
t.operatorValue = l, t.currentOperators = T;
|
|
902
908
|
}
|
|
903
909
|
}, d = () => {
|
|
904
|
-
const { prevItem:
|
|
910
|
+
const { prevItem: n } = t;
|
|
905
911
|
let r = [];
|
|
906
|
-
if (
|
|
912
|
+
if (n.type === "numRange" ? r = [t.curMinNumVar, t.curMaxNumVar] : n.type === "dateRange" ? r = ["startDate", "endDate"] : n.type === "datetimeRange" ? r = ["startDateTime", "endDateTime"] : n.type === "map" ? r = ["mapEditKey", "mapEditValue"] : n.type !== "custom" && (r = ["inputEditValue"]), (r == null ? void 0 : r.length) === 0) {
|
|
907
913
|
t.hasFormError = !1;
|
|
908
914
|
return;
|
|
909
915
|
}
|
|
910
916
|
t.hasFormError = !Se(t, r);
|
|
911
917
|
};
|
|
912
918
|
return {
|
|
913
|
-
editTag: (
|
|
919
|
+
editTag: (n, r, l) => {
|
|
914
920
|
if (!e.editable)
|
|
915
921
|
return;
|
|
916
922
|
_(t, !1), t.popoverVisible = !1;
|
|
917
923
|
const h = l.target.classList.contains("tiny-tag") ? l.target : l.srcElement.parentElement;
|
|
918
|
-
|
|
924
|
+
a(() => {
|
|
919
925
|
const { popoverRef: g } = t.instance.$refs;
|
|
920
926
|
g.state.referenceElm = h, g.state.popperElm && (g.state.popperElm.style.display = "none"), g.doDestroy(), t.popoverVisible = !0, d();
|
|
921
|
-
}), t.prevItem = t.recordItems.find((g) => g.field ===
|
|
927
|
+
}), t.prevItem = t.recordItems.find((g) => g.field === n.field), !t.prevItem && (t.prevItem = n), t.selectValue = n.label, t.currentModelValueIndex = r, i("tag-click", n), c(n);
|
|
922
928
|
},
|
|
923
|
-
confirmEditTag: async (
|
|
924
|
-
if (!
|
|
929
|
+
confirmEditTag: async (n) => {
|
|
930
|
+
if (!n) {
|
|
925
931
|
t.popoverVisible = !1;
|
|
926
932
|
return;
|
|
927
933
|
}
|
|
@@ -930,30 +936,30 @@ function ao({ props: e, state: t, t: o, nextTick: n, format: u, emit: p, vm: f }
|
|
|
930
936
|
if (r.type === "numRange")
|
|
931
937
|
h = await lt(t.instance, t, e);
|
|
932
938
|
else if (r.type === "dateRange")
|
|
933
|
-
h = await
|
|
939
|
+
h = await He(t.instance, t, e, !1);
|
|
934
940
|
else if (r.type === "datetimeRange")
|
|
935
|
-
h = await
|
|
941
|
+
h = await He(t.instance, t, e, !0);
|
|
936
942
|
else if (r.type === "map") {
|
|
937
943
|
const { field: g, type: S, label: $ } = r, { mapEditKey: T, mapEditValue: D } = t;
|
|
938
|
-
T && D && (h =
|
|
944
|
+
T && D && (h = pe({ type: S, field: g, label: $, value: `${T}=${D}` }));
|
|
939
945
|
} else
|
|
940
946
|
h = await Xt(t.instance, t, e);
|
|
941
947
|
if (h) {
|
|
942
948
|
_(t, !1), t.popoverVisible = !1;
|
|
943
949
|
const { replace: g, mergeTag: S } = r, $ = t.indexMap.get(h.label);
|
|
944
950
|
if ((g || S) && $ !== void 0 && $ !== l) {
|
|
945
|
-
const T =
|
|
951
|
+
const T = ue(t.innerModelValue);
|
|
946
952
|
let D = t.innerModelValue.filter((V, k) => k !== $);
|
|
947
|
-
const
|
|
948
|
-
D[
|
|
953
|
+
const v = l > $ ? l - 1 : l;
|
|
954
|
+
D[v] = h, te({ emit: i, state: t, nextTick: a, newValue: D, oldValue: T, isEdit: !0 });
|
|
949
955
|
} else
|
|
950
|
-
|
|
956
|
+
te({ emit: i, state: t, nextTick: a, index: l, newTag: h, isEdit: !0 });
|
|
951
957
|
} else
|
|
952
958
|
t.popoverVisible = !0;
|
|
953
959
|
t.currentEditValue = [];
|
|
954
960
|
},
|
|
955
|
-
selectPropChange: (
|
|
956
|
-
t.prevItem =
|
|
961
|
+
selectPropChange: (n) => {
|
|
962
|
+
t.prevItem = n, c(n, !0), a(() => {
|
|
957
963
|
d();
|
|
958
964
|
});
|
|
959
965
|
},
|
|
@@ -961,48 +967,50 @@ function ao({ props: e, state: t, t: o, nextTick: n, format: u, emit: p, vm: f }
|
|
|
961
967
|
};
|
|
962
968
|
}
|
|
963
969
|
function lo({ state: e, emit: t, nextTick: o }) {
|
|
964
|
-
const
|
|
970
|
+
const a = (f) => {
|
|
965
971
|
_(e, !1);
|
|
966
|
-
const { prevItem:
|
|
967
|
-
if (m && d.has(
|
|
968
|
-
const
|
|
969
|
-
|
|
972
|
+
const { prevItem: c, indexMap: d } = e, { replace: m, label: u } = c, p = [];
|
|
973
|
+
if (m && d.has(u)) {
|
|
974
|
+
const n = d.get(u), r = { ...c, ...f };
|
|
975
|
+
te({ emit: t, state: e, nextTick: o, newTag: r, index: n });
|
|
970
976
|
return;
|
|
971
977
|
} else
|
|
972
|
-
!m && Array.isArray(f) ? f.forEach((
|
|
973
|
-
|
|
974
|
-
}) :
|
|
975
|
-
|
|
978
|
+
!m && Array.isArray(f) ? f.forEach((n) => {
|
|
979
|
+
ne(e, n.value) || p.push({ ...c, ...n });
|
|
980
|
+
}) : ne(e, f.value) || p.push({ ...c, ...f });
|
|
981
|
+
te({ emit: t, state: e, nextTick: o, tagList: p });
|
|
976
982
|
};
|
|
977
983
|
return {
|
|
978
984
|
handleConfirm: (f) => {
|
|
979
985
|
if (!f) {
|
|
980
|
-
|
|
986
|
+
Oe(e), _(e, !1);
|
|
981
987
|
return;
|
|
982
988
|
}
|
|
983
|
-
|
|
989
|
+
a(f);
|
|
984
990
|
},
|
|
985
991
|
handleEditConfirm: (f) => {
|
|
986
992
|
if (!f) {
|
|
987
993
|
Te(e, !1);
|
|
988
994
|
return;
|
|
989
995
|
}
|
|
990
|
-
|
|
996
|
+
a(f);
|
|
991
997
|
}
|
|
992
998
|
};
|
|
993
999
|
}
|
|
994
|
-
function ro({ props: e, state: t }) {
|
|
1000
|
+
function ro({ props: e, state: t, emit: o }) {
|
|
995
1001
|
return {
|
|
996
1002
|
initItems: () => {
|
|
997
|
-
t.groupItems = {}, t.recordItems.forEach((
|
|
998
|
-
var
|
|
999
|
-
const { groupKey:
|
|
1000
|
-
if (
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1003
|
+
t.groupItems = {}, t.recordItems.forEach((d) => {
|
|
1004
|
+
var u, p;
|
|
1005
|
+
const { groupKey: m = "0" } = d;
|
|
1006
|
+
if ((u = d.options) == null || u.forEach((n) => {
|
|
1007
|
+
n.isFilter = !1;
|
|
1008
|
+
}), t.groupItems[m] ? t.groupItems[m].push({ ...d }) : (t.groupItems[m] = [{ ...d }], t.matchItems[m] = { attr: [], attrValue: [] }), t.prevItem && d.field === t.prevItem.field && d !== t.prevItem) {
|
|
1009
|
+
const { options: n, type: r } = d;
|
|
1010
|
+
t.prevItem = d, n != null && n.length && (t.backupList = n), r === "checkbox" && (t.filterList = t.backupList, t.checkboxGroup = [], (p = t.backupList) == null || p.forEach((l) => {
|
|
1011
|
+
const { label: h } = l;
|
|
1012
|
+
ne(t, h) && t.checkboxGroup.push(`${d.label}${h}`), l.isFilter = !1;
|
|
1013
|
+
})), _(t, d.field === t.prevItem.field && d !== t.prevItem);
|
|
1006
1014
|
}
|
|
1007
1015
|
});
|
|
1008
1016
|
},
|
|
@@ -1015,10 +1023,12 @@ function ro({ props: e, state: t }) {
|
|
|
1015
1023
|
watchMouseMove: () => {
|
|
1016
1024
|
t.isMouseDown && (t.isMouseDown = !1);
|
|
1017
1025
|
},
|
|
1018
|
-
handleClick: (
|
|
1019
|
-
var
|
|
1020
|
-
const { backupPrevItem:
|
|
1021
|
-
|
|
1026
|
+
handleClick: (d) => {
|
|
1027
|
+
var n, r;
|
|
1028
|
+
const { backupPrevItem: m, prevItem: u } = t;
|
|
1029
|
+
d.stopPropagation();
|
|
1030
|
+
const p = !t.visible;
|
|
1031
|
+
e.editable && (t.popoverVisible = !1, t.currentEditValue = [], t.propItem.label && m && m !== u && (t.prevItem = m)), t.hasBackupList && (((n = t.backupList) == null ? void 0 : n.length) === 0 || !t.backupList) && !t.inputValue || e.items.length === 0 ? _(t, !1) : _(t), p && t.propItem.label && ((r = t.prevItem) == null ? void 0 : r.field) !== void 0 && o("first-level-select", t.prevItem.field);
|
|
1022
1032
|
}
|
|
1023
1033
|
};
|
|
1024
1034
|
}
|
|
@@ -1108,79 +1118,79 @@ const st = {
|
|
|
1108
1118
|
initUse: "Search"
|
|
1109
1119
|
}
|
|
1110
1120
|
}
|
|
1111
|
-
}, Ee = "zh-CN",
|
|
1121
|
+
}, Ee = "zh-CN", ye = {
|
|
1112
1122
|
"zh-CN": st,
|
|
1113
1123
|
"en-US": it
|
|
1114
1124
|
};
|
|
1115
|
-
let
|
|
1125
|
+
let Z = null, Ae = null;
|
|
1116
1126
|
const ze = (e) => {
|
|
1117
|
-
|
|
1127
|
+
Z = e;
|
|
1118
1128
|
}, so = (e) => {
|
|
1119
|
-
|
|
1129
|
+
Ae = e;
|
|
1120
1130
|
}, qe = () => {
|
|
1121
|
-
var e, t, o,
|
|
1122
|
-
if ((o = (t = (e =
|
|
1123
|
-
return
|
|
1124
|
-
if ((
|
|
1125
|
-
return
|
|
1131
|
+
var e, t, o, a, s;
|
|
1132
|
+
if ((o = (t = (e = Z == null ? void 0 : Z.config) == null ? void 0 : e.globalProperties) == null ? void 0 : t.$i18n) != null && o.locale)
|
|
1133
|
+
return Z.config.globalProperties.$i18n.locale;
|
|
1134
|
+
if ((a = Z == null ? void 0 : Z.$i18n) != null && a.locale)
|
|
1135
|
+
return Z.$i18n.locale;
|
|
1126
1136
|
if (typeof navigator < "u") {
|
|
1127
|
-
const
|
|
1128
|
-
if (
|
|
1129
|
-
return
|
|
1137
|
+
const i = navigator.language || ((s = navigator.languages) == null ? void 0 : s[0]);
|
|
1138
|
+
if (i)
|
|
1139
|
+
return i.startsWith("zh") ? "zh-CN" : "en-US";
|
|
1130
1140
|
}
|
|
1131
1141
|
return Ee;
|
|
1132
|
-
}, Ue = (e) =>
|
|
1133
|
-
var f,
|
|
1142
|
+
}, Ue = (e) => ye[e] || ye[Ee], Q = (e, t = {}) => {
|
|
1143
|
+
var f, c;
|
|
1134
1144
|
if (!e)
|
|
1135
1145
|
return "";
|
|
1136
|
-
if (typeof
|
|
1146
|
+
if (typeof Ae == "function")
|
|
1137
1147
|
try {
|
|
1138
|
-
const d =
|
|
1148
|
+
const d = Ae(e, t);
|
|
1139
1149
|
if (d && d !== e)
|
|
1140
1150
|
return d;
|
|
1141
1151
|
} catch (d) {
|
|
1142
1152
|
console.warn("[TinySearchBox] globalT translation failed:", d);
|
|
1143
1153
|
}
|
|
1144
|
-
if ((
|
|
1154
|
+
if ((c = (f = Z == null ? void 0 : Z.config) == null ? void 0 : f.globalProperties) != null && c.$t)
|
|
1145
1155
|
try {
|
|
1146
|
-
const d =
|
|
1156
|
+
const d = Z.config.globalProperties.$t(e, t);
|
|
1147
1157
|
if (d && d !== e)
|
|
1148
1158
|
return d;
|
|
1149
1159
|
} catch (d) {
|
|
1150
1160
|
console.warn("[TinySearchBox] i18n translation failed:", d);
|
|
1151
1161
|
}
|
|
1152
|
-
if (
|
|
1162
|
+
if (Z != null && Z.$t)
|
|
1153
1163
|
try {
|
|
1154
|
-
const d =
|
|
1164
|
+
const d = Z.$t(e, t);
|
|
1155
1165
|
if (d && d !== e)
|
|
1156
1166
|
return d;
|
|
1157
1167
|
} catch (d) {
|
|
1158
1168
|
console.warn("[TinySearchBox] i18n translation failed:", d);
|
|
1159
1169
|
}
|
|
1160
|
-
const o = qe(),
|
|
1161
|
-
let
|
|
1162
|
-
for (const d of
|
|
1163
|
-
if (
|
|
1164
|
-
|
|
1170
|
+
const o = qe(), a = Ue(o), s = e.split(".");
|
|
1171
|
+
let i = a;
|
|
1172
|
+
for (const d of s)
|
|
1173
|
+
if (i && typeof i == "object" && d in i)
|
|
1174
|
+
i = i[d];
|
|
1165
1175
|
else {
|
|
1166
1176
|
if (o !== Ee) {
|
|
1167
|
-
|
|
1168
|
-
for (const
|
|
1169
|
-
if (
|
|
1170
|
-
|
|
1177
|
+
i = Ue(Ee);
|
|
1178
|
+
for (const u of s)
|
|
1179
|
+
if (i && typeof i == "object" && u in i)
|
|
1180
|
+
i = i[u];
|
|
1171
1181
|
else {
|
|
1172
|
-
|
|
1182
|
+
i = e;
|
|
1173
1183
|
break;
|
|
1174
1184
|
}
|
|
1175
1185
|
} else
|
|
1176
|
-
|
|
1186
|
+
i = e;
|
|
1177
1187
|
break;
|
|
1178
1188
|
}
|
|
1179
|
-
return typeof
|
|
1180
|
-
}, io = (e, t = {}) => e.map((o) => Q(o, t)), uo = (e) => e in
|
|
1181
|
-
|
|
1189
|
+
return typeof i == "string" && Object.keys(t).length > 0 ? i.replace(/\{(\w+)\}/g, (d, m) => t[m] !== void 0 ? t[m] : d) : typeof i == "string" ? i : e;
|
|
1190
|
+
}, io = (e, t = {}) => e.map((o) => Q(o, t)), uo = (e) => e in ye, po = () => Object.keys(ye), co = (e, t) => {
|
|
1191
|
+
ye[e] = t;
|
|
1182
1192
|
}, mo = (e) => {
|
|
1183
|
-
e !== Ee && delete
|
|
1193
|
+
e !== Ee && delete ye[e];
|
|
1184
1194
|
}, fo = {
|
|
1185
1195
|
t: Q,
|
|
1186
1196
|
zhCN: st,
|
|
@@ -1222,10 +1232,10 @@ const ze = (e) => {
|
|
|
1222
1232
|
"handleEditConfirm",
|
|
1223
1233
|
"showDropdown",
|
|
1224
1234
|
"showPopover"
|
|
1225
|
-
],
|
|
1235
|
+
], Ce = (e, t) => e.emptyPlaceholder || t("tvp.tvpSearchbox.addPlaceholder"), vo = ({ reactive: e, computed: t, api: o, i18n: a, watch: s, props: i, emit: f, vm: c }) => {
|
|
1226
1236
|
const d = e({
|
|
1227
|
-
innerModelValue: [...
|
|
1228
|
-
placeholder:
|
|
1237
|
+
innerModelValue: [...i.modelValue],
|
|
1238
|
+
placeholder: i.modelValue.length > 0 ? Q("tvp.tvpSearchbox.addPlaceholder") : Ce(i, Q),
|
|
1229
1239
|
emitter: f,
|
|
1230
1240
|
recordItems: [],
|
|
1231
1241
|
groupItems: {},
|
|
@@ -1274,78 +1284,78 @@ const ze = (e) => {
|
|
|
1274
1284
|
mapEditValue: "",
|
|
1275
1285
|
// map 类型编辑态:选中的 value
|
|
1276
1286
|
mapEditValueOptions: t(() => {
|
|
1277
|
-
var
|
|
1278
|
-
if (!((
|
|
1287
|
+
var u;
|
|
1288
|
+
if (!((u = d.prevItem) != null && u.options) || !d.mapEditKey)
|
|
1279
1289
|
return [];
|
|
1280
|
-
const m = d.prevItem.options.find((
|
|
1290
|
+
const m = d.prevItem.options.find((p) => p.label === d.mapEditKey);
|
|
1281
1291
|
return (m == null ? void 0 : m.options) || [];
|
|
1282
1292
|
}),
|
|
1283
1293
|
hasBackupList: t(() => {
|
|
1284
1294
|
if (!d.propItem.label)
|
|
1285
1295
|
return !1;
|
|
1286
|
-
const { type: m, options:
|
|
1287
|
-
return m === "input" ? !!(
|
|
1296
|
+
const { type: m, options: u, asyncLoading: p } = d.prevItem;
|
|
1297
|
+
return m === "input" ? !!(u != null && u.length) : [void 0, null, "", "radio", "checkbox", "map"].includes(m) ? p ? !0 : !!(u != null && u.length) : !1;
|
|
1288
1298
|
}),
|
|
1289
1299
|
isIndeterminate: t(() => d.checkboxGroup.length > 0 && d.checkboxGroup.length !== d.filterList.length),
|
|
1290
1300
|
checkAll: t({
|
|
1291
1301
|
get: () => d.checkboxGroup.length && d.checkboxGroup.length === d.filterList.length,
|
|
1292
1302
|
set: (m) => {
|
|
1293
|
-
m ? d.checkboxGroup = d.filterList.flatMap((
|
|
1303
|
+
m ? d.checkboxGroup = d.filterList.flatMap((u) => `${d.prevItem.label}${u.label}`) : d.checkboxGroup = [];
|
|
1294
1304
|
}
|
|
1295
1305
|
})
|
|
1296
1306
|
});
|
|
1297
1307
|
return d;
|
|
1298
|
-
}, bo = (e, { getCurrentInstance: t, onMounted: o, onBeforeUnmount:
|
|
1299
|
-
const
|
|
1300
|
-
return go({ api:
|
|
1301
|
-
typeof document < "u" && (document.addEventListener("click",
|
|
1302
|
-
}),
|
|
1303
|
-
typeof document < "u" && (document.removeEventListener("click",
|
|
1304
|
-
}),
|
|
1305
|
-
}, go = ({ api: e, state: t, t: o, props:
|
|
1306
|
-
const d = (
|
|
1307
|
-
if (!
|
|
1308
|
+
}, bo = (e, { getCurrentInstance: t, onMounted: o, onBeforeUnmount: a, computed: s, reactive: i, watch: f }, { emit: c, nextTick: d, refs: m, vm: u, slots: p }) => {
|
|
1309
|
+
const n = {}, r = e.emitter ? e.emitter.emit : c, l = vo({ reactive: i, computed: s, api: n, i18n: fo, watch: f, props: e, emit: r, vm: u });
|
|
1310
|
+
return go({ api: n, state: l, t: Q, props: e, emit: r, nextTick: d, vm: u, computed: s }), yo({ watch: f, state: l, props: e, api: n, nextTick: d, vm: u }), l.instance = u, u && p && (u.slots = p), o(() => {
|
|
1311
|
+
typeof document < "u" && (document.addEventListener("click", n.watchOutsideClick), document.addEventListener("mousedown", n.watchMouseDown), document.addEventListener("mousemove", n.watchMouseMove));
|
|
1312
|
+
}), a(() => {
|
|
1313
|
+
typeof document < "u" && (document.removeEventListener("click", n.watchOutsideClick), document.removeEventListener("mousedown", n.watchMouseDown), document.removeEventListener("mousemove", n.watchMouseMove), l.localeCheckInterval && (clearInterval(l.localeCheckInterval), l.localeCheckInterval = null));
|
|
1314
|
+
}), n;
|
|
1315
|
+
}, go = ({ api: e, state: t, t: o, props: a, emit: s, nextTick: i, vm: f, computed: c }) => {
|
|
1316
|
+
const d = (F) => {
|
|
1317
|
+
if (!F)
|
|
1308
1318
|
return !1;
|
|
1309
|
-
const
|
|
1310
|
-
return !!(
|
|
1311
|
-
}, { deleteTag: m, clearTag:
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1314
|
-
Se(t,
|
|
1319
|
+
const K = t.recordItems.find((ve) => ve.field === F.field || ve.label === F.label);
|
|
1320
|
+
return !!(K != null && K.disableDelete);
|
|
1321
|
+
}, { deleteTag: m, clearTag: u, backspaceDeleteTag: p } = Zt({ props: a, state: t, emit: s, nextTick: i, isTagDisabled: d }), { editTag: n, confirmEditTag: r, selectPropChange: l, checkFormValidation: h } = ao({ props: a, state: t, t: o, nextTick: i, format: xe, emit: s, vm: f }), { handleInput: g, selectFirstMap: S, cancelHandleInput: $ } = eo({ props: a, state: t, emit: s, nextTick: i }), { selectPropItem: T, selectRadioItem: D, selectInputValue: v, createTag: V, helpClick: k, setOperator: b } = Qt({ props: a, emit: s, state: t, t: o, format: xe, nextTick: i, vm: f, cancelHandleInput: $, selectFirstMap: S }), { selectCheckbox: M } = to({ props: a, state: t, emit: s, nextTick: i }), { onConfirmDate: C, handleDateShow: x, pickerOptions: O } = oo({ props: a, state: t, emit: s, nextTick: i, vm: f }), { sizeChange: L, initFormRule: H } = no({ props: a, state: t, t: o, emit: s, nextTick: i, vm: f }), { handleConfirm: Y, handleEditConfirm: le } = lo({ state: t, emit: s, nextTick: i }), { initItems: re, watchOutsideClick: J, watchMouseDown: ce, watchMouseMove: B, handleClick: U } = ro({ props: a, state: t, emit: s }), se = c(() => a.modelValue.length || t.propItem.label || t.inputValue), de = (F) => {
|
|
1322
|
+
const K = F ? ["startDateTime", "endDateTime"] : ["startDate", "endDate"];
|
|
1323
|
+
i(() => {
|
|
1324
|
+
Se(t, K);
|
|
1315
1325
|
});
|
|
1316
|
-
},
|
|
1317
|
-
selectInputValue:
|
|
1326
|
+
}, Pe = () => ({
|
|
1327
|
+
selectInputValue: v,
|
|
1318
1328
|
selectPropItem: T,
|
|
1319
1329
|
selectRadioItem: D,
|
|
1320
|
-
setOperator:
|
|
1330
|
+
setOperator: b,
|
|
1321
1331
|
selectCheckbox: M,
|
|
1322
1332
|
sizeChange: L,
|
|
1323
1333
|
onConfirmDate: C,
|
|
1324
1334
|
selectFirstMap: S,
|
|
1325
1335
|
handleDateShow: x,
|
|
1326
|
-
validateDateRange:
|
|
1327
|
-
}), he = (
|
|
1328
|
-
t.placeholder =
|
|
1329
|
-
},
|
|
1330
|
-
|
|
1336
|
+
validateDateRange: de
|
|
1337
|
+
}), he = (F) => {
|
|
1338
|
+
t.placeholder = F;
|
|
1339
|
+
}, Ve = () => Ce(a, o);
|
|
1340
|
+
a.modelValue.length > 0 ? he(o("tvp.tvpSearchbox.addPlaceholder")) : he(Ve()), Object.assign(e, {
|
|
1331
1341
|
t: o,
|
|
1332
1342
|
state: t,
|
|
1333
|
-
isShowClose:
|
|
1343
|
+
isShowClose: se,
|
|
1334
1344
|
isTagDisabled: d,
|
|
1335
1345
|
deleteTag: m,
|
|
1336
|
-
editTag:
|
|
1337
|
-
backspaceDeleteTag:
|
|
1346
|
+
editTag: n,
|
|
1347
|
+
backspaceDeleteTag: p,
|
|
1338
1348
|
createTag: V,
|
|
1339
|
-
clearTag:
|
|
1349
|
+
clearTag: u,
|
|
1340
1350
|
helpClick: k,
|
|
1341
1351
|
handleInput: g,
|
|
1342
|
-
handleClick:
|
|
1343
|
-
handleEvents: (
|
|
1344
|
-
const Ze =
|
|
1345
|
-
typeof Ze[
|
|
1352
|
+
handleClick: U,
|
|
1353
|
+
handleEvents: (F, K, ve) => {
|
|
1354
|
+
const Ze = Pe();
|
|
1355
|
+
typeof Ze[F] == "function" ? Ze[F](K, ve) : console.warn(`[TinySearchBox] Unknown event: ${F}`);
|
|
1346
1356
|
},
|
|
1347
1357
|
pickerOptions: O,
|
|
1348
|
-
resetInput:
|
|
1358
|
+
resetInput: Oe,
|
|
1349
1359
|
selectPropChange: l,
|
|
1350
1360
|
confirmEditTag: r,
|
|
1351
1361
|
handleConfirm: Y,
|
|
@@ -1354,74 +1364,82 @@ const ze = (e) => {
|
|
|
1354
1364
|
showPopover: Te,
|
|
1355
1365
|
checkFormValidation: h,
|
|
1356
1366
|
setPlaceholder: he,
|
|
1357
|
-
initItems:
|
|
1358
|
-
initFormRule:
|
|
1359
|
-
watchOutsideClick:
|
|
1360
|
-
watchMouseDown:
|
|
1361
|
-
watchMouseMove:
|
|
1367
|
+
initItems: re,
|
|
1368
|
+
initFormRule: H,
|
|
1369
|
+
watchOutsideClick: J,
|
|
1370
|
+
watchMouseDown: ce,
|
|
1371
|
+
watchMouseMove: B
|
|
1362
1372
|
});
|
|
1363
|
-
}, yo = ({ watch: e, state: t, props: o, api:
|
|
1364
|
-
var
|
|
1373
|
+
}, yo = ({ watch: e, state: t, props: o, api: a, nextTick: s, vm: i }) => {
|
|
1374
|
+
var p;
|
|
1365
1375
|
const f = () => {
|
|
1366
|
-
var
|
|
1376
|
+
var n;
|
|
1367
1377
|
if (t.propItem.label) {
|
|
1368
1378
|
const { placeholder: r, type: l } = t.prevItem;
|
|
1369
|
-
r ?
|
|
1379
|
+
r ? a.setPlaceholder(r) : l === "map" ? a.setPlaceholder(Q("tvp.tvpSearchbox.tagPlaceholder")) : (n = t.backupList) != null && n.length ? a.setPlaceholder(Q("tvp.tvpSearchbox.dynamicPlaceholder", { newValue: t.propItem.label })) : a.setPlaceholder(Q("tvp.tvpSearchbox.addPlaceholder"));
|
|
1370
1380
|
} else {
|
|
1371
|
-
const r = o.modelValue.length > 0 ? Q("tvp.tvpSearchbox.addPlaceholder") :
|
|
1372
|
-
|
|
1381
|
+
const r = o.modelValue.length > 0 ? Q("tvp.tvpSearchbox.addPlaceholder") : Ce(o, Q);
|
|
1382
|
+
a.setPlaceholder(r);
|
|
1373
1383
|
}
|
|
1374
|
-
},
|
|
1375
|
-
var
|
|
1376
|
-
return (
|
|
1384
|
+
}, c = () => {
|
|
1385
|
+
var n, r, l;
|
|
1386
|
+
return (n = i == null ? void 0 : i.$i18n) != null && n.locale ? i.$i18n.locale : (l = (r = i == null ? void 0 : i.proxy) == null ? void 0 : r.$i18n) != null && l.locale ? i.proxy.$i18n.locale : qe();
|
|
1377
1387
|
};
|
|
1378
|
-
let d =
|
|
1379
|
-
if (
|
|
1388
|
+
let d = c(), m = !1;
|
|
1389
|
+
if (i != null && i.$i18n)
|
|
1380
1390
|
try {
|
|
1381
|
-
|
|
1382
|
-
() =>
|
|
1383
|
-
(
|
|
1384
|
-
|
|
1391
|
+
i.$watch(
|
|
1392
|
+
() => i.$i18n.locale,
|
|
1393
|
+
(n) => {
|
|
1394
|
+
n !== d && (d = n, f());
|
|
1385
1395
|
},
|
|
1386
1396
|
{ immediate: !1 }
|
|
1387
1397
|
), m = !0;
|
|
1388
|
-
} catch (
|
|
1389
|
-
console.warn("[TinySearchBox] Unable to watch i18n.locale via vm.$watch:",
|
|
1398
|
+
} catch (n) {
|
|
1399
|
+
console.warn("[TinySearchBox] Unable to watch i18n.locale via vm.$watch:", n);
|
|
1390
1400
|
}
|
|
1391
|
-
if ((
|
|
1401
|
+
if ((p = i == null ? void 0 : i.proxy) != null && p.$i18n)
|
|
1392
1402
|
try {
|
|
1393
1403
|
e(
|
|
1394
|
-
() =>
|
|
1395
|
-
(
|
|
1396
|
-
|
|
1404
|
+
() => i.proxy.$i18n.locale,
|
|
1405
|
+
(n) => {
|
|
1406
|
+
n !== d && (d = n, f());
|
|
1397
1407
|
},
|
|
1398
1408
|
{ immediate: !1 }
|
|
1399
1409
|
), m = !0;
|
|
1400
|
-
} catch (
|
|
1401
|
-
console.warn("[TinySearchBox] Unable to watch i18n.locale via watch:",
|
|
1410
|
+
} catch (n) {
|
|
1411
|
+
console.warn("[TinySearchBox] Unable to watch i18n.locale via watch:", n);
|
|
1402
1412
|
}
|
|
1403
|
-
const
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1413
|
+
const u = () => {
|
|
1414
|
+
const n = c();
|
|
1415
|
+
n !== d && (d = n, f());
|
|
1406
1416
|
};
|
|
1407
|
-
typeof window < "u" && !m && (t.localeCheckInterval = setInterval(
|
|
1417
|
+
typeof window < "u" && !m && (t.localeCheckInterval = setInterval(u, 1e3)), e(
|
|
1408
1418
|
() => o.modelValue,
|
|
1409
1419
|
() => {
|
|
1410
|
-
|
|
1420
|
+
u();
|
|
1411
1421
|
}
|
|
1412
1422
|
), e(
|
|
1413
1423
|
() => o.editable,
|
|
1414
1424
|
() => {
|
|
1415
|
-
|
|
1425
|
+
a.initFormRule();
|
|
1426
|
+
}
|
|
1427
|
+
), e(
|
|
1428
|
+
() => o.maxlength,
|
|
1429
|
+
() => {
|
|
1430
|
+
a.initFormRule();
|
|
1416
1431
|
}
|
|
1417
1432
|
), e(
|
|
1418
1433
|
() => o.items,
|
|
1419
|
-
(
|
|
1434
|
+
(n) => {
|
|
1420
1435
|
const r = t.visible, l = t.prevItem && t.prevItem.field;
|
|
1421
|
-
t.recordItems =
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1436
|
+
t.recordItems = ue(n), a.initItems(), a.initFormRule(), s(() => {
|
|
1437
|
+
var h;
|
|
1438
|
+
if (a.initItems(), a.initFormRule(), r && t.propItem.label) {
|
|
1439
|
+
const g = t.recordItems.find((S) => S.field === l) || t.prevItem;
|
|
1440
|
+
t.prevItem = g || {}, t.backupList = g && g.options ? [...g.options] : [], (h = t.backupList) == null || h.forEach((S) => {
|
|
1441
|
+
S.isFilter = !1;
|
|
1442
|
+
}), t.filterList = t.backupList ? [...t.backupList] : [], _(t);
|
|
1425
1443
|
}
|
|
1426
1444
|
});
|
|
1427
1445
|
},
|
|
@@ -1431,47 +1449,47 @@ const ze = (e) => {
|
|
|
1431
1449
|
}
|
|
1432
1450
|
), e(
|
|
1433
1451
|
() => t.popoverVisible,
|
|
1434
|
-
(
|
|
1435
|
-
!
|
|
1452
|
+
(n) => {
|
|
1453
|
+
!n && !t.inputEditValue.length && (t.prevItem && t.prevItem.mergeTag ? t.inputEditValue = Array.isArray(t.currentEditSelectTags) ? t.currentEditSelectTags : [] : t.inputEditValue = Array.isArray(t.currentEditSelectTags) ? t.currentEditSelectTags.join(",") : t.currentEditSelectTags || ""), n || (t.hasFormError = !1);
|
|
1436
1454
|
},
|
|
1437
1455
|
{
|
|
1438
1456
|
immediate: !0
|
|
1439
1457
|
}
|
|
1440
1458
|
), e(
|
|
1441
1459
|
() => {
|
|
1442
|
-
const
|
|
1460
|
+
const n = {
|
|
1443
1461
|
inputEditValue: t.inputEditValue,
|
|
1444
1462
|
startDate: t.startDate,
|
|
1445
1463
|
endDate: t.endDate,
|
|
1446
1464
|
startDateTime: t.startDateTime,
|
|
1447
1465
|
endDateTime: t.endDateTime
|
|
1448
1466
|
};
|
|
1449
|
-
return t.curMinNumVar && t.curMaxNumVar && (
|
|
1467
|
+
return t.curMinNumVar && t.curMaxNumVar && (n[t.curMinNumVar] = t[t.curMinNumVar], n[t.curMaxNumVar] = t[t.curMaxNumVar]), n;
|
|
1450
1468
|
},
|
|
1451
1469
|
() => {
|
|
1452
|
-
t.popoverVisible &&
|
|
1453
|
-
|
|
1470
|
+
t.popoverVisible && s(() => {
|
|
1471
|
+
a.checkFormValidation();
|
|
1454
1472
|
});
|
|
1455
1473
|
},
|
|
1456
1474
|
{ deep: !0 }
|
|
1457
1475
|
), e(
|
|
1458
1476
|
() => t.propItem.label,
|
|
1459
|
-
(
|
|
1477
|
+
(n) => {
|
|
1460
1478
|
f();
|
|
1461
1479
|
}
|
|
1462
1480
|
), e(
|
|
1463
1481
|
() => o.modelValue,
|
|
1464
|
-
(
|
|
1465
|
-
if (
|
|
1466
|
-
if (t.indexMap.clear(), t.valueMap.clear(),
|
|
1482
|
+
(n) => {
|
|
1483
|
+
if (n) {
|
|
1484
|
+
if (t.indexMap.clear(), t.valueMap.clear(), n.forEach((r, l) => {
|
|
1467
1485
|
var g;
|
|
1468
1486
|
const h = `${r.label}${r.value}`;
|
|
1469
1487
|
t.indexMap.set(r.label, l), t.valueMap.set(h, l), ((g = r.options) == null ? void 0 : g.length) > 0 && r.options.forEach((S) => {
|
|
1470
1488
|
const $ = `${r.label}${S.label}`;
|
|
1471
1489
|
t.valueMap.set($, l);
|
|
1472
1490
|
});
|
|
1473
|
-
}), Te(t, !1),
|
|
1474
|
-
const r =
|
|
1491
|
+
}), Te(t, !1), n.length === 0 && a.setPlaceholder(Ce(o, Q)), o.editable && !t.inputEditValue.length && n[0]) {
|
|
1492
|
+
const r = n[0];
|
|
1475
1493
|
if ((t.recordItems.find((h) => h.field === r.field) || r).mergeTag && r.options) {
|
|
1476
1494
|
const h = r.options.flatMap((g) => g.label) || [];
|
|
1477
1495
|
t.inputEditValue = h, t.currentEditSelectTags = h;
|
|
@@ -1480,7 +1498,7 @@ const ze = (e) => {
|
|
|
1480
1498
|
t.inputEditValue = Array.isArray(h) ? h.join(",") : h || "";
|
|
1481
1499
|
}
|
|
1482
1500
|
}
|
|
1483
|
-
t.innerModelValue = [...
|
|
1501
|
+
t.innerModelValue = [...n];
|
|
1484
1502
|
}
|
|
1485
1503
|
},
|
|
1486
1504
|
{
|
|
@@ -1490,37 +1508,37 @@ const ze = (e) => {
|
|
|
1490
1508
|
);
|
|
1491
1509
|
}, Ye = (e, t) => {
|
|
1492
1510
|
const o = e.__vccOpts || e;
|
|
1493
|
-
for (const [
|
|
1494
|
-
o[
|
|
1511
|
+
for (const [a, s] of t)
|
|
1512
|
+
o[a] = s;
|
|
1495
1513
|
return o;
|
|
1496
1514
|
}, Vo = (e, t, { emit: o }) => {
|
|
1497
|
-
const { computed:
|
|
1498
|
-
o("events", m,
|
|
1515
|
+
const { computed: a } = t, s = e.handleEvents || e.events || ((m, u, p) => {
|
|
1516
|
+
o("events", m, u, p);
|
|
1499
1517
|
});
|
|
1500
1518
|
return {
|
|
1501
|
-
isShowSearchOption:
|
|
1519
|
+
isShowSearchOption: a(() => {
|
|
1502
1520
|
var h;
|
|
1503
|
-
const { inputValue: m, popoverVisible:
|
|
1504
|
-
return m.trim() && !
|
|
1521
|
+
const { inputValue: m, popoverVisible: u, currentOperators: p, propItem: n, prevItem: r } = e.state, l = !!n.label && !!((h = r == null ? void 0 : r.options) != null && h.length);
|
|
1522
|
+
return m.trim() && !u && !(p != null && p.length) && !l && (!n.label || [void 0, null, "", "radio", "input"].includes(r.type));
|
|
1505
1523
|
}),
|
|
1506
1524
|
selectInputValue: (m) => {
|
|
1507
|
-
|
|
1525
|
+
s("selectInputValue", m);
|
|
1508
1526
|
},
|
|
1509
1527
|
selectPropItem: (m) => {
|
|
1510
|
-
|
|
1528
|
+
s("selectPropItem", m);
|
|
1511
1529
|
},
|
|
1512
|
-
selectRadioItem: (m,
|
|
1513
|
-
|
|
1530
|
+
selectRadioItem: (m, u) => {
|
|
1531
|
+
s("selectRadioItem", m, u);
|
|
1514
1532
|
},
|
|
1515
1533
|
t: Q
|
|
1516
1534
|
};
|
|
1517
|
-
}, ko = ["isShowSearchOption", "selectInputValue", "selectPropItem", "selectRadioItem", "t"], Io =
|
|
1535
|
+
}, ko = ["isShowSearchOption", "selectInputValue", "selectPropItem", "selectRadioItem", "t"], Io = Le({
|
|
1518
1536
|
name: Ke + "SearchBoxFirstLevelPanel",
|
|
1519
1537
|
components: {
|
|
1520
1538
|
TinyDropdownItem: Xe
|
|
1521
1539
|
},
|
|
1522
1540
|
props: {
|
|
1523
|
-
...
|
|
1541
|
+
...Ne,
|
|
1524
1542
|
state: {
|
|
1525
1543
|
type: Object,
|
|
1526
1544
|
default: () => ({})
|
|
@@ -1555,9 +1573,9 @@ const ze = (e) => {
|
|
|
1555
1573
|
key: 0,
|
|
1556
1574
|
class: "tvp-search-box__filter-type"
|
|
1557
1575
|
}, Bo = ["title"];
|
|
1558
|
-
function
|
|
1559
|
-
var
|
|
1560
|
-
const f =
|
|
1576
|
+
function Fo(e, t, o, a, s, i) {
|
|
1577
|
+
var c, d;
|
|
1578
|
+
const f = j("tiny-dropdown-item");
|
|
1561
1579
|
return y(), w("div", wo, [
|
|
1562
1580
|
X(R(f, {
|
|
1563
1581
|
class: "tvp-search-box__filter-item tvp-search-box__dropdown-item tvp-search-box__dropdown-item-init",
|
|
@@ -1569,22 +1587,22 @@ function xo(e, t, o, n, u, p) {
|
|
|
1569
1587
|
]),
|
|
1570
1588
|
_: 1
|
|
1571
1589
|
}, 8, ["item-data"]), [
|
|
1572
|
-
[
|
|
1590
|
+
[oe, e.isShowSearchOption]
|
|
1573
1591
|
]),
|
|
1574
1592
|
X(E("div", null, [
|
|
1575
|
-
(y(!0), w(z, null,
|
|
1593
|
+
(y(!0), w(z, null, q(e.state.matchItems, (m, u) => (y(), w("div", { key: u }, [
|
|
1576
1594
|
m.attr.length ? (y(), w("div", Eo, [
|
|
1577
|
-
E("span", To, I(
|
|
1578
|
-
(y(!0), w(z, null,
|
|
1579
|
-
key:
|
|
1595
|
+
E("span", To, I(u === "0" ? e.t("tvp.tvpSearchbox.attributeType") : u), 1),
|
|
1596
|
+
(y(!0), w(z, null, q(m.attr, (p, n) => (y(), A(f, {
|
|
1597
|
+
key: p.label + n,
|
|
1580
1598
|
class: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
|
|
1581
|
-
"item-data":
|
|
1582
|
-
onItemClick: () => e.selectPropItem(
|
|
1599
|
+
"item-data": p,
|
|
1600
|
+
onItemClick: () => e.selectPropItem(p)
|
|
1583
1601
|
}, {
|
|
1584
1602
|
default: P(() => [
|
|
1585
1603
|
E("span", null, [
|
|
1586
|
-
(y(!0), w(z, null,
|
|
1587
|
-
r.toLowerCase() ===
|
|
1604
|
+
(y(!0), w(z, null, q(p.match, (r) => (y(), w("span", { key: r }, [
|
|
1605
|
+
r.toLowerCase() === p.hightlighStr ? (y(), w("span", So, I(r), 1)) : (y(), w("span", Do, I(r), 1))
|
|
1588
1606
|
]))), 128))
|
|
1589
1607
|
])
|
|
1590
1608
|
]),
|
|
@@ -1592,18 +1610,18 @@ function xo(e, t, o, n, u, p) {
|
|
|
1592
1610
|
}, 1032, ["item-data", "onItemClick"]))), 128))
|
|
1593
1611
|
])) : N("", !0),
|
|
1594
1612
|
m.attrValue.length ? (y(), w(z, { key: 1 }, [
|
|
1595
|
-
E("span", Mo, I(e.t("tvp.tvpSearchbox.propertyValue", [
|
|
1596
|
-
(y(!0), w(z, null,
|
|
1597
|
-
key:
|
|
1598
|
-
disabled:
|
|
1613
|
+
E("span", Mo, I(e.t("tvp.tvpSearchbox.propertyValue", [u === "0" ? e.t("tvp.tvpSearchbox.attributeType") : u])), 1),
|
|
1614
|
+
(y(!0), w(z, null, q(m.attrValue, (p, n) => (y(), A(f, {
|
|
1615
|
+
key: p.label + n,
|
|
1616
|
+
disabled: p.isChecked,
|
|
1599
1617
|
class: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
|
|
1600
|
-
"item-data":
|
|
1601
|
-
onItemClick: () => e.selectRadioItem(
|
|
1618
|
+
"item-data": p,
|
|
1619
|
+
onItemClick: () => e.selectRadioItem(p, !0)
|
|
1602
1620
|
}, {
|
|
1603
1621
|
default: P(() => [
|
|
1604
1622
|
E("span", null, [
|
|
1605
|
-
(y(!0), w(z, null,
|
|
1606
|
-
r.toLowerCase() ===
|
|
1623
|
+
(y(!0), w(z, null, q(p.match, (r) => (y(), w("span", { key: r }, [
|
|
1624
|
+
r.toLowerCase() === p.hightlighStr ? (y(), w("span", $o, I(r), 1)) : (y(), w("span", Co, I(r), 1))
|
|
1607
1625
|
]))), 128))
|
|
1608
1626
|
])
|
|
1609
1627
|
]),
|
|
@@ -1615,8 +1633,8 @@ function xo(e, t, o, n, u, p) {
|
|
|
1615
1633
|
E("span", Lo, I(e.t("tvp.tvpSearchbox.matched")), 1),
|
|
1616
1634
|
E("div", No, [
|
|
1617
1635
|
e.state.potentialOptions ? (y(), w("div", Ro, [
|
|
1618
|
-
(y(!0), w(z, null,
|
|
1619
|
-
key: m.label +
|
|
1636
|
+
(y(!0), w(z, null, q(e.state.potentialOptions, (m, u) => (y(), A(f, {
|
|
1637
|
+
key: m.label + u,
|
|
1620
1638
|
class: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
|
|
1621
1639
|
"item-data": m,
|
|
1622
1640
|
onItemClick: () => e.selectRadioItem(m, !0)
|
|
@@ -1630,132 +1648,129 @@ function xo(e, t, o, n, u, p) {
|
|
|
1630
1648
|
])) : N("", !0)
|
|
1631
1649
|
])
|
|
1632
1650
|
], 512), [
|
|
1633
|
-
[
|
|
1651
|
+
[oe, e.state.potentialOptions]
|
|
1634
1652
|
])
|
|
1635
1653
|
], 512), [
|
|
1636
|
-
[
|
|
1654
|
+
[oe, !e.state.propItem.label && ((c = e.state.inputValue) == null ? void 0 : c.trim())]
|
|
1637
1655
|
]),
|
|
1638
1656
|
X(E("div", Po, [
|
|
1639
|
-
(y(!0), w(z, null,
|
|
1640
|
-
m.length ? (y(), w("span", _o, I(
|
|
1641
|
-
(y(!0), w(z, null,
|
|
1642
|
-
key: (
|
|
1657
|
+
(y(!0), w(z, null, q(e.state.groupItems, (m, u) => (y(), w("div", { key: u }, [
|
|
1658
|
+
m.length ? (y(), w("span", _o, I(u === "0" ? e.t("tvp.tvpSearchbox.attributeType") : u), 1)) : N("", !0),
|
|
1659
|
+
(y(!0), w(z, null, q(m, (p, n) => (y(), A(f, {
|
|
1660
|
+
key: (p.field || p.label) + n,
|
|
1643
1661
|
class: "tvp-search-box__dropdown-item",
|
|
1644
|
-
"item-data":
|
|
1645
|
-
onItemClick: () => e.selectPropItem(
|
|
1662
|
+
"item-data": p,
|
|
1663
|
+
onItemClick: () => e.selectPropItem(p)
|
|
1646
1664
|
}, {
|
|
1647
1665
|
default: P(() => [
|
|
1648
1666
|
E("span", {
|
|
1649
|
-
title:
|
|
1650
|
-
}, I(
|
|
1667
|
+
title: p.label
|
|
1668
|
+
}, I(p.label), 9, Bo)
|
|
1651
1669
|
]),
|
|
1652
1670
|
_: 2
|
|
1653
1671
|
}, 1032, ["item-data", "onItemClick"]))), 128))
|
|
1654
1672
|
]))), 128))
|
|
1655
1673
|
], 512), [
|
|
1656
|
-
[
|
|
1674
|
+
[oe, e.state.visible && !e.state.propItem.label && !((d = e.state.inputValue) != null && d.trim())]
|
|
1657
1675
|
])
|
|
1658
1676
|
]);
|
|
1659
1677
|
}
|
|
1660
|
-
const
|
|
1661
|
-
function
|
|
1662
|
-
const { reactive: o, computed:
|
|
1678
|
+
const xo = /* @__PURE__ */ Ye(Io, [["render", Fo]]);
|
|
1679
|
+
function Ho(e, t) {
|
|
1680
|
+
const { reactive: o, computed: a } = e, { getList: s, itemHeight: i = 32, bufferSize: f = 5, headerHeight: c = () => 0 } = t, d = o({
|
|
1663
1681
|
scrollTop: 0,
|
|
1664
1682
|
viewportHeight: 300
|
|
1665
|
-
}), m =
|
|
1666
|
-
const h = Math.max(0, d.scrollTop -
|
|
1667
|
-
return Math.max(0, Math.floor(h /
|
|
1668
|
-
}),
|
|
1669
|
-
const h =
|
|
1670
|
-
return Math.min(h.length,
|
|
1671
|
-
}),
|
|
1683
|
+
}), m = a(() => (s() || []).length * i), u = a(() => {
|
|
1684
|
+
const h = Math.max(0, d.scrollTop - c());
|
|
1685
|
+
return Math.max(0, Math.floor(h / i) - f);
|
|
1686
|
+
}), p = a(() => {
|
|
1687
|
+
const h = s() || [], g = Math.ceil(d.viewportHeight / i);
|
|
1688
|
+
return Math.min(h.length, u.value + g + f * 2);
|
|
1689
|
+
}), n = a(() => u.value * i), r = a(() => (s() || []).slice(u.value, p.value));
|
|
1672
1690
|
return {
|
|
1673
1691
|
vsState: d,
|
|
1674
1692
|
totalHeight: m,
|
|
1675
|
-
startIndex:
|
|
1676
|
-
endIndex:
|
|
1677
|
-
offsetY:
|
|
1693
|
+
startIndex: u,
|
|
1694
|
+
endIndex: p,
|
|
1695
|
+
offsetY: n,
|
|
1678
1696
|
visibleItems: r,
|
|
1679
1697
|
handleScroll: (h) => {
|
|
1680
1698
|
d.scrollTop = h.target.scrollTop, d.viewportHeight = h.target.clientHeight;
|
|
1681
1699
|
}
|
|
1682
1700
|
};
|
|
1683
1701
|
}
|
|
1684
|
-
const
|
|
1685
|
-
const { computed:
|
|
1686
|
-
o("events",
|
|
1687
|
-
}),
|
|
1688
|
-
m("setOperator",
|
|
1689
|
-
},
|
|
1690
|
-
m("selectRadioItem",
|
|
1691
|
-
},
|
|
1692
|
-
m("selectCheckbox",
|
|
1693
|
-
}, r = (
|
|
1694
|
-
m("sizeChange",
|
|
1695
|
-
}, l = (
|
|
1696
|
-
m("onConfirmDate",
|
|
1697
|
-
}, h = (
|
|
1698
|
-
m("selectFirstMap",
|
|
1699
|
-
}, g = (
|
|
1700
|
-
m("handleDateShow",
|
|
1701
|
-
}, S = (
|
|
1702
|
-
m("handleDateShow"), m("validateDateRange",
|
|
1703
|
-
}, $ =
|
|
1704
|
-
const { prevItem:
|
|
1702
|
+
const Ao = (e, t, { emit: o, nextTick: a, refs: s }) => {
|
|
1703
|
+
const { computed: i, reactive: f, watch: c, onMounted: d } = t, m = e.handleEvents || e.events || ((b, M, C) => {
|
|
1704
|
+
o("events", b, M, C);
|
|
1705
|
+
}), u = (b) => {
|
|
1706
|
+
m("setOperator", b);
|
|
1707
|
+
}, p = (b) => {
|
|
1708
|
+
m("selectRadioItem", b);
|
|
1709
|
+
}, n = (b) => {
|
|
1710
|
+
m("selectCheckbox", b);
|
|
1711
|
+
}, r = (b) => {
|
|
1712
|
+
m("sizeChange", b);
|
|
1713
|
+
}, l = (b, M) => {
|
|
1714
|
+
m("onConfirmDate", b, M);
|
|
1715
|
+
}, h = (b, M) => {
|
|
1716
|
+
m("selectFirstMap", b, M);
|
|
1717
|
+
}, g = (b) => {
|
|
1718
|
+
m("handleDateShow", b);
|
|
1719
|
+
}, S = (b) => {
|
|
1720
|
+
m("handleDateShow"), m("validateDateRange", b);
|
|
1721
|
+
}, $ = i(() => {
|
|
1722
|
+
const { prevItem: b, dateRangeFormat: M, datetimeRangeFormat: C } = e.state, x = b.type;
|
|
1705
1723
|
if (x === "dateRange") {
|
|
1706
|
-
const { startDate: O, endDate: L } = e.state,
|
|
1707
|
-
return !!(O && L && we(L, O,
|
|
1724
|
+
const { startDate: O, endDate: L } = e.state, H = b.format || M;
|
|
1725
|
+
return !!(O && L && we(L, O, H) < 0);
|
|
1708
1726
|
}
|
|
1709
1727
|
if (x === "datetimeRange") {
|
|
1710
|
-
const { startDateTime: O, endDateTime: L } = e.state,
|
|
1711
|
-
return !!(O && L && we(L, O,
|
|
1728
|
+
const { startDateTime: O, endDateTime: L } = e.state, H = b.format || C;
|
|
1729
|
+
return !!(O && L && we(L, O, H) < 0);
|
|
1712
1730
|
}
|
|
1713
1731
|
return !1;
|
|
1714
|
-
}), T =
|
|
1715
|
-
var
|
|
1716
|
-
return e.state.hasBackupList && ((
|
|
1717
|
-
}), D =
|
|
1718
|
-
var
|
|
1719
|
-
return (
|
|
1720
|
-
}),
|
|
1721
|
-
const
|
|
1722
|
-
return !
|
|
1723
|
-
}), V =
|
|
1724
|
-
|
|
1725
|
-
return Array.isArray(v) && !T.value && !b.value.length;
|
|
1726
|
-
}), k = Ao(
|
|
1727
|
-
{ reactive: f, computed: p },
|
|
1732
|
+
}), T = i(() => {
|
|
1733
|
+
var b;
|
|
1734
|
+
return e.state.hasBackupList && ((b = e.state.backupList) == null ? void 0 : b.length) === 0;
|
|
1735
|
+
}), D = i(() => {
|
|
1736
|
+
var b;
|
|
1737
|
+
return (b = e.state.backupList) == null ? void 0 : b.find((M) => !M.isFilter);
|
|
1738
|
+
}), v = i(() => {
|
|
1739
|
+
const b = e.state.prevItem.type, M = e.state.backupList || [];
|
|
1740
|
+
return !b || b === "radio" ? e.state.inputValue ? M.filter((C) => !C.isFilter) : M : M.filter((C) => !C.isFilter);
|
|
1741
|
+
}), V = i(() => e.state.hasBackupList && !T.value && !v.value.length), k = Ho(
|
|
1742
|
+
{ reactive: f, computed: i },
|
|
1728
1743
|
{
|
|
1729
|
-
getList: () =>
|
|
1744
|
+
getList: () => v.value,
|
|
1730
1745
|
itemHeight: 32,
|
|
1731
1746
|
bufferSize: 5,
|
|
1732
1747
|
headerHeight: () => {
|
|
1733
|
-
const
|
|
1734
|
-
return
|
|
1748
|
+
const b = e.state.prevItem.type;
|
|
1749
|
+
return b === "checkbox" || b === "map" ? 32 : 0;
|
|
1735
1750
|
}
|
|
1736
1751
|
}
|
|
1737
1752
|
);
|
|
1738
|
-
return
|
|
1753
|
+
return c(
|
|
1739
1754
|
() => e.state.inputValue,
|
|
1740
1755
|
() => {
|
|
1741
|
-
k.vsState.scrollTop = 0,
|
|
1742
|
-
|
|
1756
|
+
k.vsState.scrollTop = 0, a(() => {
|
|
1757
|
+
s.vsScrollEl && (s.vsScrollEl.scrollTop = 0);
|
|
1743
1758
|
});
|
|
1744
1759
|
}
|
|
1745
|
-
),
|
|
1760
|
+
), c(
|
|
1746
1761
|
() => e.state.prevItem,
|
|
1747
1762
|
() => {
|
|
1748
|
-
k.vsState.scrollTop = 0,
|
|
1749
|
-
|
|
1763
|
+
k.vsState.scrollTop = 0, a(() => {
|
|
1764
|
+
s.vsScrollEl && (s.vsScrollEl.scrollTop = 0, k.handleScroll({ target: s.vsScrollEl }));
|
|
1750
1765
|
});
|
|
1751
1766
|
},
|
|
1752
1767
|
{ deep: !0 }
|
|
1753
1768
|
), d(() => {
|
|
1754
|
-
|
|
1769
|
+
s.vsScrollEl && k.handleScroll({ target: s.vsScrollEl });
|
|
1755
1770
|
}), {
|
|
1756
|
-
setOperator:
|
|
1757
|
-
selectRadioItem:
|
|
1758
|
-
selectCheckbox:
|
|
1771
|
+
setOperator: u,
|
|
1772
|
+
selectRadioItem: p,
|
|
1773
|
+
selectCheckbox: n,
|
|
1759
1774
|
sizeChange: r,
|
|
1760
1775
|
onConfirmDate: l,
|
|
1761
1776
|
selectFirstMap: h,
|
|
@@ -1791,7 +1806,7 @@ const Ho = (e, t, { emit: o, nextTick: n, refs: u }) => {
|
|
|
1791
1806
|
"vsVisibleItems",
|
|
1792
1807
|
"vsHandleScroll",
|
|
1793
1808
|
"t"
|
|
1794
|
-
], Uo =
|
|
1809
|
+
], Uo = Le({
|
|
1795
1810
|
name: Ke + "SearchBoxSecondLevelPanel",
|
|
1796
1811
|
emits: ["events", "click"],
|
|
1797
1812
|
components: {
|
|
@@ -1806,7 +1821,7 @@ const Ho = (e, t, { emit: o, nextTick: n, refs: u }) => {
|
|
|
1806
1821
|
loading: ct.directive
|
|
1807
1822
|
},
|
|
1808
1823
|
props: {
|
|
1809
|
-
...
|
|
1824
|
+
...Ne,
|
|
1810
1825
|
state: {
|
|
1811
1826
|
type: Object,
|
|
1812
1827
|
default: () => ({})
|
|
@@ -1830,7 +1845,7 @@ const Ho = (e, t, { emit: o, nextTick: n, refs: u }) => {
|
|
|
1830
1845
|
}
|
|
1831
1846
|
},
|
|
1832
1847
|
setup(e, t) {
|
|
1833
|
-
return je({ props: e, context: t, renderless:
|
|
1848
|
+
return je({ props: e, context: t, renderless: Ao, api: zo });
|
|
1834
1849
|
}
|
|
1835
1850
|
}), Ko = { tiny_mode: "pc" }, jo = { key: 0 }, Go = { class: "tvp-search-box__filter-type" }, qo = ["title"], Yo = {
|
|
1836
1851
|
key: 0,
|
|
@@ -1875,13 +1890,13 @@ const Ho = (e, t, { emit: o, nextTick: n, refs: u }) => {
|
|
|
1875
1890
|
key: 1,
|
|
1876
1891
|
class: "tvp-search-box__filter-type"
|
|
1877
1892
|
}, Mn = ["title"];
|
|
1878
|
-
function $n(e, t, o,
|
|
1893
|
+
function $n(e, t, o, a, s, i) {
|
|
1879
1894
|
var r;
|
|
1880
|
-
const f =
|
|
1895
|
+
const f = j("tiny-dropdown-item"), c = j("tiny-checkbox"), d = j("tiny-checkbox-group"), m = j("tiny-button"), u = j("tiny-input"), p = j("tiny-date-picker"), n = It("loading");
|
|
1881
1896
|
return y(), w("div", Ko, [
|
|
1882
1897
|
(r = e.state.currentOperators) != null && r.length ? (y(), w("div", jo, [
|
|
1883
1898
|
E("span", Go, I(e.t("tvp.tvpSearchbox.operator")), 1),
|
|
1884
|
-
(y(!0), w(z, null,
|
|
1899
|
+
(y(!0), w(z, null, q(e.state.currentOperators, (l, h) => X((y(), A(f, {
|
|
1885
1900
|
key: l + h,
|
|
1886
1901
|
class: "tvp-search-box__dropdown-item",
|
|
1887
1902
|
"item-data": { label: l },
|
|
@@ -1892,24 +1907,24 @@ function $n(e, t, o, n, u, p) {
|
|
|
1892
1907
|
]),
|
|
1893
1908
|
_: 2
|
|
1894
1909
|
}, 1032, ["item-data", "onItemClick"])), [
|
|
1895
|
-
[
|
|
1910
|
+
[oe, l.includes(e.state.inputValue)]
|
|
1896
1911
|
])), 128))
|
|
1897
1912
|
])) : !e.state.prevItem.type || ["radio", "input"].includes(e.state.prevItem.type) ? X((y(), w("div", {
|
|
1898
1913
|
key: 1,
|
|
1899
|
-
class:
|
|
1900
|
-
style:
|
|
1914
|
+
class: G(["tvp-search-box__radio-wrap", "tvp-search-box__virtual-list", e.isLoading && "tvp-search-box__loading-box"]),
|
|
1915
|
+
style: ae({ maxHeight: e.panelMaxHeight }),
|
|
1901
1916
|
ref: "vsScrollEl",
|
|
1902
1917
|
onScroll: t[0] || (t[0] = (...l) => e.vsHandleScroll && e.vsHandleScroll(...l))
|
|
1903
1918
|
}, [
|
|
1904
1919
|
E("div", {
|
|
1905
1920
|
class: "tvp-search-box__virtual-phantom",
|
|
1906
|
-
style:
|
|
1921
|
+
style: ae({ height: e.vsTotalHeight + "px" })
|
|
1907
1922
|
}, [
|
|
1908
1923
|
E("div", {
|
|
1909
1924
|
class: "tvp-search-box__virtual-content",
|
|
1910
|
-
style:
|
|
1925
|
+
style: ae({ transform: "translateY(" + e.vsOffsetY + "px)" })
|
|
1911
1926
|
}, [
|
|
1912
|
-
(y(!0), w(z, null,
|
|
1927
|
+
(y(!0), w(z, null, q(e.vsVisibleItems, (l, h) => (y(), A(f, {
|
|
1913
1928
|
key: e.vsStartIndex + h + (l.field || l.label),
|
|
1914
1929
|
disabled: l.isChecked,
|
|
1915
1930
|
class: "tvp-search-box__dropdown-item",
|
|
@@ -1921,7 +1936,7 @@ function $n(e, t, o, n, u, p) {
|
|
|
1921
1936
|
key: 0,
|
|
1922
1937
|
title: l.label
|
|
1923
1938
|
}, [
|
|
1924
|
-
(y(!0), w(z, null,
|
|
1939
|
+
(y(!0), w(z, null, q(l.match, (g, S) => (y(), w("span", { key: S }, [
|
|
1925
1940
|
g.toLowerCase() === l.hightlighStr ? (y(), w("span", Yo, I(g), 1)) : (y(), w("span", Zo, I(g), 1))
|
|
1926
1941
|
]))), 128))
|
|
1927
1942
|
], 8, qo)) : (y(), w("span", {
|
|
@@ -1935,15 +1950,15 @@ function $n(e, t, o, n, u, p) {
|
|
|
1935
1950
|
], 4),
|
|
1936
1951
|
e.showNoData ? (y(), w("div", Xo, I(e.t("tvp.tvpSearchbox.noData")), 1)) : N("", !0)
|
|
1937
1952
|
], 38)), [
|
|
1938
|
-
[
|
|
1953
|
+
[n, e.isLoading]
|
|
1939
1954
|
]) : e.state.prevItem.type === "checkbox" ? X((y(), w("div", {
|
|
1940
1955
|
key: 2,
|
|
1941
|
-
class:
|
|
1956
|
+
class: G(e.isLoading && "tvp-search-box__loading-box")
|
|
1942
1957
|
}, [
|
|
1943
1958
|
e.showCheckBoxList ? (y(), w("div", {
|
|
1944
1959
|
key: 0,
|
|
1945
1960
|
class: "tvp-search-box__checkbox-wrap",
|
|
1946
|
-
style:
|
|
1961
|
+
style: ae({ maxHeight: e.panelMaxHeight })
|
|
1947
1962
|
}, [
|
|
1948
1963
|
E("div", {
|
|
1949
1964
|
ref: "vsScrollEl",
|
|
@@ -1958,7 +1973,7 @@ function $n(e, t, o, n, u, p) {
|
|
|
1958
1973
|
default: P(() => [
|
|
1959
1974
|
R(f, { class: "tvp-search-box__dropdown-item tvp-search-box__checkbox-item" }, {
|
|
1960
1975
|
default: P(() => [
|
|
1961
|
-
R(
|
|
1976
|
+
R(c, {
|
|
1962
1977
|
modelValue: e.state.checkAll,
|
|
1963
1978
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => e.state.checkAll = l),
|
|
1964
1979
|
indeterminate: e.state.isIndeterminate
|
|
@@ -1982,18 +1997,18 @@ function $n(e, t, o, n, u, p) {
|
|
|
1982
1997
|
default: P(() => [
|
|
1983
1998
|
E("div", {
|
|
1984
1999
|
class: "tvp-search-box__virtual-phantom",
|
|
1985
|
-
style:
|
|
2000
|
+
style: ae({ height: e.vsTotalHeight + "px" })
|
|
1986
2001
|
}, [
|
|
1987
2002
|
E("div", {
|
|
1988
2003
|
class: "tvp-search-box__virtual-content",
|
|
1989
|
-
style:
|
|
2004
|
+
style: ae({ transform: "translateY(" + e.vsOffsetY + "px)" })
|
|
1990
2005
|
}, [
|
|
1991
|
-
(y(!0), w(z, null,
|
|
2006
|
+
(y(!0), w(z, null, q(e.vsVisibleItems, (l, h) => (y(), A(f, {
|
|
1992
2007
|
key: (l.field || l.label) + e.vsStartIndex + h,
|
|
1993
2008
|
class: "tvp-search-box__dropdown-item tvp-search-box__checkbox-item"
|
|
1994
2009
|
}, {
|
|
1995
2010
|
default: P(() => [
|
|
1996
|
-
R(
|
|
2011
|
+
R(c, {
|
|
1997
2012
|
label: e.state.prevItem.label + l.label,
|
|
1998
2013
|
title: l.label,
|
|
1999
2014
|
class: "tvp-search-box__checkbox-item-label"
|
|
@@ -2034,15 +2049,15 @@ function $n(e, t, o, n, u, p) {
|
|
|
2034
2049
|
])
|
|
2035
2050
|
], 4)) : e.showNoData ? (y(), w("div", Jo, I(e.t("tvp.tvpSearchbox.noData")), 1)) : N("", !0)
|
|
2036
2051
|
], 2)), [
|
|
2037
|
-
[
|
|
2052
|
+
[n, e.isLoading]
|
|
2038
2053
|
]) : e.state.prevItem.type === "numRange" ? (y(), w("div", en, [
|
|
2039
2054
|
E("div", tn, [
|
|
2040
2055
|
E("div", on, I(e.t("tvp.tvpSearchbox.rangeNumberTitle")), 1),
|
|
2041
2056
|
E("div", nn, I(e.t("tvp.tvpSearchbox.minValueText")) + I(e.state.prevItem.unit ? `(${e.state.prevItem.unit})` : ""), 1),
|
|
2042
2057
|
E("div", {
|
|
2043
|
-
class:
|
|
2058
|
+
class: G(["tvp-search-box__number-item", { "is-error": e.state.formErrors[e.state.curMinNumVar] }])
|
|
2044
2059
|
}, [
|
|
2045
|
-
R(
|
|
2060
|
+
R(u, {
|
|
2046
2061
|
modelValue: e.state[e.state.curMinNumVar],
|
|
2047
2062
|
"onUpdate:modelValue": t[7] || (t[7] = (l) => e.state[e.state.curMinNumVar] = l),
|
|
2048
2063
|
type: "number",
|
|
@@ -2052,9 +2067,9 @@ function $n(e, t, o, n, u, p) {
|
|
|
2052
2067
|
], 2),
|
|
2053
2068
|
E("div", ln, I(e.t("tvp.tvpSearchbox.maxValueText")) + I(e.state.prevItem.unit ? `(${e.state.prevItem.unit})` : ""), 1),
|
|
2054
2069
|
E("div", {
|
|
2055
|
-
class:
|
|
2070
|
+
class: G(["tvp-search-box__number-item", { "is-error": e.state.formErrors[e.state.curMaxNumVar] }])
|
|
2056
2071
|
}, [
|
|
2057
|
-
R(
|
|
2072
|
+
R(u, {
|
|
2058
2073
|
modelValue: e.state[e.state.curMaxNumVar],
|
|
2059
2074
|
"onUpdate:modelValue": t[8] || (t[8] = (l) => e.state[e.state.curMaxNumVar] = l),
|
|
2060
2075
|
type: "number",
|
|
@@ -2075,7 +2090,7 @@ function $n(e, t, o, n, u, p) {
|
|
|
2075
2090
|
}),
|
|
2076
2091
|
R(m, {
|
|
2077
2092
|
size: "mini",
|
|
2078
|
-
onClick: t[10] || (t[10] =
|
|
2093
|
+
onClick: t[10] || (t[10] = ee((l) => e.sizeChange(!0), ["stop"]))
|
|
2079
2094
|
}, {
|
|
2080
2095
|
default: P(() => [
|
|
2081
2096
|
W(I(e.t("tvp.tvpSearchbox.confirm")), 1)
|
|
@@ -2090,9 +2105,9 @@ function $n(e, t, o, n, u, p) {
|
|
|
2090
2105
|
}) : e.t("tvp.tvpSearchbox.rangeDateTitle")), 1),
|
|
2091
2106
|
E("div", dn, I(e.t("tvp.tvpSearchbox.rangeBeginLabel")), 1),
|
|
2092
2107
|
E("div", {
|
|
2093
|
-
class:
|
|
2108
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.startDate }])
|
|
2094
2109
|
}, [
|
|
2095
|
-
R(
|
|
2110
|
+
R(p, {
|
|
2096
2111
|
modelValue: e.state.startDate,
|
|
2097
2112
|
"onUpdate:modelValue": t[11] || (t[11] = (l) => e.state.startDate = l),
|
|
2098
2113
|
format: e.state.prevItem.format || e.state.dateRangeFormat,
|
|
@@ -2106,9 +2121,9 @@ function $n(e, t, o, n, u, p) {
|
|
|
2106
2121
|
], 2),
|
|
2107
2122
|
E("div", fn, I(e.t("tvp.tvpSearchbox.rangeEndLabel")), 1),
|
|
2108
2123
|
E("div", {
|
|
2109
|
-
class:
|
|
2124
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.endDate }])
|
|
2110
2125
|
}, [
|
|
2111
|
-
R(
|
|
2126
|
+
R(p, {
|
|
2112
2127
|
modelValue: e.state.endDate,
|
|
2113
2128
|
"onUpdate:modelValue": t[13] || (t[13] = (l) => e.state.endDate = l),
|
|
2114
2129
|
format: e.state.prevItem.format || e.state.dateRangeFormat,
|
|
@@ -2149,9 +2164,9 @@ function $n(e, t, o, n, u, p) {
|
|
|
2149
2164
|
}) : e.t("tvp.tvpSearchbox.rangeDateTitle")), 1),
|
|
2150
2165
|
E("div", Vn, I(e.t("tvp.tvpSearchbox.rangeBeginLabel")), 1),
|
|
2151
2166
|
E("div", {
|
|
2152
|
-
class:
|
|
2167
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.startDateTime }])
|
|
2153
2168
|
}, [
|
|
2154
|
-
R(
|
|
2169
|
+
R(p, {
|
|
2155
2170
|
modelValue: e.state.startDateTime,
|
|
2156
2171
|
"onUpdate:modelValue": t[17] || (t[17] = (l) => e.state.startDateTime = l),
|
|
2157
2172
|
type: "datetime",
|
|
@@ -2167,9 +2182,9 @@ function $n(e, t, o, n, u, p) {
|
|
|
2167
2182
|
], 2),
|
|
2168
2183
|
E("div", In, I(e.t("tvp.tvpSearchbox.rangeEndLabel")), 1),
|
|
2169
2184
|
E("div", {
|
|
2170
|
-
class:
|
|
2185
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.endDateTime }])
|
|
2171
2186
|
}, [
|
|
2172
|
-
R(
|
|
2187
|
+
R(p, {
|
|
2173
2188
|
modelValue: e.state.endDateTime,
|
|
2174
2189
|
"onUpdate:modelValue": t[19] || (t[19] = (l) => e.state.endDateTime = l),
|
|
2175
2190
|
type: "datetime",
|
|
@@ -2209,19 +2224,19 @@ function $n(e, t, o, n, u, p) {
|
|
|
2209
2224
|
E("div", {
|
|
2210
2225
|
ref: "vsScrollEl",
|
|
2211
2226
|
class: "tvp-search-box__virtual-list",
|
|
2212
|
-
style:
|
|
2227
|
+
style: ae({ maxHeight: e.panelMaxHeight }),
|
|
2213
2228
|
onScroll: t[23] || (t[23] = (...l) => e.vsHandleScroll && e.vsHandleScroll(...l))
|
|
2214
2229
|
}, [
|
|
2215
2230
|
e.state.isShowTagKey ? (y(), w("span", Sn, I(e.t("tvp.tvpSearchbox.tagKey")), 1)) : (y(), w("span", Dn, I(e.t("tvp.tvpSearchbox.tagValue")), 1)),
|
|
2216
2231
|
E("div", {
|
|
2217
2232
|
class: "tvp-search-box__virtual-phantom",
|
|
2218
|
-
style:
|
|
2233
|
+
style: ae({ height: e.vsTotalHeight + "px" })
|
|
2219
2234
|
}, [
|
|
2220
2235
|
E("div", {
|
|
2221
2236
|
class: "tvp-search-box__virtual-content",
|
|
2222
|
-
style:
|
|
2237
|
+
style: ae({ transform: "translateY(" + e.vsOffsetY + "px)" })
|
|
2223
2238
|
}, [
|
|
2224
|
-
(y(!0), w(z, null,
|
|
2239
|
+
(y(!0), w(z, null, q(e.vsVisibleItems, (l, h) => (y(), A(f, {
|
|
2225
2240
|
key: l.label + l.value + e.vsStartIndex + h,
|
|
2226
2241
|
disabled: l.isChecked,
|
|
2227
2242
|
class: "tvp-search-box__dropdown-item",
|
|
@@ -2239,17 +2254,17 @@ function $n(e, t, o, n, u, p) {
|
|
|
2239
2254
|
], 4)
|
|
2240
2255
|
], 36)
|
|
2241
2256
|
])), [
|
|
2242
|
-
[
|
|
2257
|
+
[n, e.isLoading]
|
|
2243
2258
|
]) : N("", !0)
|
|
2244
2259
|
]);
|
|
2245
2260
|
}
|
|
2246
|
-
const Cn = /* @__PURE__ */ Ye(Uo, [["render", $n]]), Ln =
|
|
2261
|
+
const Cn = /* @__PURE__ */ Ye(Uo, [["render", $n]]), Ln = Le({
|
|
2247
2262
|
model: {
|
|
2248
2263
|
prop: "modelValue",
|
|
2249
2264
|
event: "update:modelValue"
|
|
2250
2265
|
},
|
|
2251
2266
|
props: {
|
|
2252
|
-
...
|
|
2267
|
+
...Ne,
|
|
2253
2268
|
tiny_mode: {
|
|
2254
2269
|
type: String,
|
|
2255
2270
|
default: "pc"
|
|
@@ -2328,7 +2343,7 @@ const Cn = /* @__PURE__ */ Ye(Uo, [["render", $n]]), Ln = Re({
|
|
|
2328
2343
|
TinyPopover: vt,
|
|
2329
2344
|
TinySelect: bt,
|
|
2330
2345
|
TinyOption: gt,
|
|
2331
|
-
TinySearchBoxFirstLevelPanel:
|
|
2346
|
+
TinySearchBoxFirstLevelPanel: xo,
|
|
2332
2347
|
TinySearchBoxSecondLevelPanel: Cn,
|
|
2333
2348
|
// 图标组件
|
|
2334
2349
|
TinyIconSearch: yt(),
|
|
@@ -2336,16 +2351,16 @@ const Cn = /* @__PURE__ */ Ye(Uo, [["render", $n]]), Ln = Re({
|
|
|
2336
2351
|
TinyIconHelpQuery: kt()
|
|
2337
2352
|
},
|
|
2338
2353
|
setup(e, t) {
|
|
2339
|
-
var
|
|
2340
|
-
const o =
|
|
2341
|
-
|
|
2342
|
-
const
|
|
2354
|
+
var p, n;
|
|
2355
|
+
const o = De.getCurrentInstance(), a = o == null ? void 0 : o.parent, s = ((p = a == null ? void 0 : a.type) == null ? void 0 : p.name) === "AsyncComponentWrapper" && (a != null && a.parent) ? a.parent : a, i = (n = s == null ? void 0 : s.setupState) == null ? void 0 : n.state, f = je({ props: e, context: t, renderless: bo, api: ho });
|
|
2356
|
+
s != null && s.setupState && i && (s.setupState.state = i), s != null && s.ctx && "state" in s.ctx && delete s.ctx.state;
|
|
2357
|
+
const c = De.inject("form", null), d = () => {
|
|
2343
2358
|
var r;
|
|
2344
|
-
return e.size || ((r =
|
|
2359
|
+
return e.size || ((r = c == null ? void 0 : c.state) == null ? void 0 : r.size) || (c == null ? void 0 : c.size) || "";
|
|
2345
2360
|
}, m = () => {
|
|
2346
2361
|
var r;
|
|
2347
|
-
return ((r =
|
|
2348
|
-
},
|
|
2362
|
+
return ((r = c == null ? void 0 : c.state) == null ? void 0 : r.disabled) ?? (c == null ? void 0 : c.disabled) ?? !1;
|
|
2363
|
+
}, u = De.reactive({
|
|
2349
2364
|
get size() {
|
|
2350
2365
|
return d();
|
|
2351
2366
|
},
|
|
@@ -2354,22 +2369,22 @@ const Cn = /* @__PURE__ */ Ye(Uo, [["render", $n]]), Ln = Re({
|
|
|
2354
2369
|
},
|
|
2355
2370
|
get labelWidth() {
|
|
2356
2371
|
var r;
|
|
2357
|
-
return (r =
|
|
2372
|
+
return (r = c == null ? void 0 : c.state) == null ? void 0 : r.labelWidth;
|
|
2358
2373
|
},
|
|
2359
2374
|
get labelSuffix() {
|
|
2360
2375
|
var r;
|
|
2361
|
-
return (r =
|
|
2376
|
+
return (r = c == null ? void 0 : c.state) == null ? void 0 : r.labelSuffix;
|
|
2362
2377
|
},
|
|
2363
2378
|
get showMessage() {
|
|
2364
2379
|
var r;
|
|
2365
|
-
return (r =
|
|
2380
|
+
return (r = c == null ? void 0 : c.state) == null ? void 0 : r.showMessage;
|
|
2366
2381
|
},
|
|
2367
2382
|
get rules() {
|
|
2368
2383
|
var r;
|
|
2369
|
-
return ((r =
|
|
2384
|
+
return ((r = c == null ? void 0 : c.state) == null ? void 0 : r.rules) ?? (c == null ? void 0 : c.rules);
|
|
2370
2385
|
}
|
|
2371
2386
|
});
|
|
2372
|
-
return
|
|
2387
|
+
return De.provide("form", {
|
|
2373
2388
|
get size() {
|
|
2374
2389
|
return d();
|
|
2375
2390
|
},
|
|
@@ -2377,29 +2392,29 @@ const Cn = /* @__PURE__ */ Ye(Uo, [["render", $n]]), Ln = Re({
|
|
|
2377
2392
|
return m();
|
|
2378
2393
|
},
|
|
2379
2394
|
get displayOnly() {
|
|
2380
|
-
return
|
|
2395
|
+
return c == null ? void 0 : c.displayOnly;
|
|
2381
2396
|
},
|
|
2382
2397
|
get rules() {
|
|
2383
|
-
return
|
|
2398
|
+
return c == null ? void 0 : c.rules;
|
|
2384
2399
|
},
|
|
2385
2400
|
get labelWidth() {
|
|
2386
|
-
return
|
|
2401
|
+
return c == null ? void 0 : c.labelWidth;
|
|
2387
2402
|
},
|
|
2388
2403
|
get labelSuffix() {
|
|
2389
|
-
return
|
|
2404
|
+
return c == null ? void 0 : c.labelSuffix;
|
|
2390
2405
|
},
|
|
2391
2406
|
get showMessage() {
|
|
2392
|
-
return
|
|
2407
|
+
return c == null ? void 0 : c.showMessage;
|
|
2393
2408
|
},
|
|
2394
2409
|
get state() {
|
|
2395
|
-
return
|
|
2410
|
+
return u;
|
|
2396
2411
|
}
|
|
2397
2412
|
}), f;
|
|
2398
2413
|
}
|
|
2399
2414
|
}), Nn = { class: "tvp-search-box__tag-value" }, Rn = {
|
|
2400
2415
|
key: 1,
|
|
2401
2416
|
class: "tvp-search-box__placeholder"
|
|
2402
|
-
}, On = { class: "tvp-search-box__form" }, Pn = { class: "tvp-search-box__input-wrapper" }, _n = { class: "tvp-search-box__prop" }, Bn = { class: "tvp-search-box__input-separator" },
|
|
2417
|
+
}, On = { class: "tvp-search-box__form" }, Pn = { class: "tvp-search-box__input-wrapper" }, _n = { class: "tvp-search-box__prop" }, Bn = { class: "tvp-search-box__input-separator" }, Fn = { class: "tvp-search-box__date-wrap" }, xn = { class: "tvp-search-box__dropdown-start" }, Hn = { class: "tvp-search-box__number-item" }, An = {
|
|
2403
2418
|
key: 0,
|
|
2404
2419
|
class: "tvp-search-box__dropdown-end"
|
|
2405
2420
|
}, zn = {
|
|
@@ -2451,27 +2466,27 @@ const Cn = /* @__PURE__ */ Ye(Uo, [["render", $n]]), Ln = Re({
|
|
|
2451
2466
|
key: 1,
|
|
2452
2467
|
class: "tvp-search-box__panel-box"
|
|
2453
2468
|
};
|
|
2454
|
-
function ha(e, t, o,
|
|
2455
|
-
const f =
|
|
2469
|
+
function ha(e, t, o, a, s, i) {
|
|
2470
|
+
const f = j("tiny-icon-search"), c = j("tiny-tag"), d = j("tiny-icon-close"), m = j("tiny-icon-help-query"), u = j("tiny-tooltip"), p = j("tiny-input"), n = j("TinySearchBoxFirstLevelPanel"), r = j("TinySearchBoxSecondLevelPanel"), l = j("tiny-popover"), h = j("tiny-option"), g = j("tiny-select"), S = j("tiny-date-picker"), $ = j("tiny-button");
|
|
2456
2471
|
return y(), w("div", {
|
|
2457
|
-
class:
|
|
2472
|
+
class: G([
|
|
2458
2473
|
"tvp-search-box",
|
|
2459
2474
|
e.size === "small" ? "tvp-search-box--small" : "",
|
|
2460
2475
|
e.showPrefixIcon ? "" : "hide-prefix-icon"
|
|
2461
2476
|
]),
|
|
2462
|
-
onClick: t[31] || (t[31] =
|
|
2477
|
+
onClick: t[31] || (t[31] = ee((T) => e.showPopover(e.state, !1), ["stop"]))
|
|
2463
2478
|
}, [
|
|
2464
|
-
e.showPrefixIcon ? (y(),
|
|
2479
|
+
e.showPrefixIcon ? (y(), A(f, {
|
|
2465
2480
|
key: 0,
|
|
2466
2481
|
class: "tvp-search-box__prefix"
|
|
2467
2482
|
})) : N("", !0),
|
|
2468
|
-
(y(!0), w(z, null,
|
|
2483
|
+
(y(!0), w(z, null, q(e.modelValue, (T, D) => (y(), A(c, {
|
|
2469
2484
|
key: T.field + D,
|
|
2470
2485
|
closable: !e.isTagDisabled(T),
|
|
2471
|
-
class:
|
|
2486
|
+
class: G(["tvp-search-box__tag", e.editable ? "tvp-search-box__tag-editor" : ""]),
|
|
2472
2487
|
title: `${T.label} ${T.operator || ":"} ${T.value}`,
|
|
2473
|
-
onClose: (
|
|
2474
|
-
onClick:
|
|
2488
|
+
onClose: (v) => e.deleteTag(T),
|
|
2489
|
+
onClick: ee((v) => e.editTag(T, D, v), ["stop"])
|
|
2475
2490
|
}, {
|
|
2476
2491
|
default: P(() => [
|
|
2477
2492
|
E("span", Nn, I(T.label) + " " + I(T.operator || ":") + " " + I(T.value), 1)
|
|
@@ -2483,10 +2498,10 @@ function ha(e, t, o, n, u, p) {
|
|
|
2483
2498
|
E("div", Pn, [
|
|
2484
2499
|
E("section", _n, [
|
|
2485
2500
|
X(E("span", null, I(e.state.propItem.label) + " " + I(`${e.state.operatorValue ? e.state.operatorValue : ""} `), 513), [
|
|
2486
|
-
[
|
|
2501
|
+
[oe, e.state.propItem.label]
|
|
2487
2502
|
]),
|
|
2488
2503
|
X(E("span", null, I(e.state.propItem.value), 513), [
|
|
2489
|
-
[
|
|
2504
|
+
[oe, e.state.propItem.value]
|
|
2490
2505
|
])
|
|
2491
2506
|
]),
|
|
2492
2507
|
R(l, {
|
|
@@ -2501,7 +2516,7 @@ function ha(e, t, o, n, u, p) {
|
|
|
2501
2516
|
"append-to-body": e.appendToBody
|
|
2502
2517
|
}, {
|
|
2503
2518
|
reference: P(() => [
|
|
2504
|
-
R(
|
|
2519
|
+
R(p, {
|
|
2505
2520
|
ref: "inputRef",
|
|
2506
2521
|
modelValue: e.state.inputValue,
|
|
2507
2522
|
"onUpdate:modelValue": t[0] || (t[0] = (T) => e.state.inputValue = T),
|
|
@@ -2509,34 +2524,34 @@ function ha(e, t, o, n, u, p) {
|
|
|
2509
2524
|
placeholder: e.state.placeholder,
|
|
2510
2525
|
maxlength: e.maxlength,
|
|
2511
2526
|
onKeydown: [
|
|
2512
|
-
We(
|
|
2513
|
-
We(
|
|
2527
|
+
We(ee(e.backspaceDeleteTag, ["stop"]), ["delete"]),
|
|
2528
|
+
We(ee(e.createTag, ["stop"]), ["enter"])
|
|
2514
2529
|
],
|
|
2515
2530
|
onInput: e.handleInput,
|
|
2516
2531
|
onClick: e.handleClick
|
|
2517
2532
|
}, {
|
|
2518
2533
|
suffix: P(() => {
|
|
2519
|
-
var T, D,
|
|
2534
|
+
var T, D, v, V, k, b, M, C;
|
|
2520
2535
|
return [
|
|
2521
2536
|
X(R(d, {
|
|
2522
2537
|
class: "tvp-search-box__input-close",
|
|
2523
|
-
onClick:
|
|
2538
|
+
onClick: ee(e.clearTag, ["stop"])
|
|
2524
2539
|
}, null, 8, ["onClick"]), [
|
|
2525
|
-
[
|
|
2540
|
+
[oe, e.isShowClose]
|
|
2526
2541
|
]),
|
|
2527
2542
|
X(E("span", Bn, null, 512), [
|
|
2528
2543
|
[
|
|
2529
|
-
|
|
2530
|
-
e.isShowClose && (e.showHelp || ((D = (T = e.state.instance) == null ? void 0 : T.$slots) == null ? void 0 : D["suffix-icon"]) || ((V = (
|
|
2544
|
+
oe,
|
|
2545
|
+
e.isShowClose && (e.showHelp || ((D = (T = e.state.instance) == null ? void 0 : T.$slots) == null ? void 0 : D["suffix-icon"]) || ((V = (v = e.state.instance) == null ? void 0 : v.slots) == null ? void 0 : V["suffix-icon"]))
|
|
2531
2546
|
]
|
|
2532
2547
|
]),
|
|
2533
|
-
(
|
|
2548
|
+
(b = (k = e.state.instance) == null ? void 0 : k.$slots) != null && b["suffix-icon"] || (C = (M = e.state.instance) == null ? void 0 : M.slots) != null && C["suffix-icon"] ? (y(), w("span", {
|
|
2534
2549
|
key: 0,
|
|
2535
|
-
class:
|
|
2550
|
+
class: G(e.showHelp ? "tvp-search-box__suffix-icon-slot" : "tvp-search-box__suffix-icon-slot-no-help")
|
|
2536
2551
|
}, [
|
|
2537
2552
|
ke(e.$slots, "suffix-icon")
|
|
2538
2553
|
], 2)) : N("", !0),
|
|
2539
|
-
e.showHelp ? (y(),
|
|
2554
|
+
e.showHelp ? (y(), A(u, {
|
|
2540
2555
|
key: 1,
|
|
2541
2556
|
effect: "light",
|
|
2542
2557
|
content: e.t("tvp.tvpSearchbox.help"),
|
|
@@ -2545,14 +2560,14 @@ function ha(e, t, o, n, u, p) {
|
|
|
2545
2560
|
default: P(() => [
|
|
2546
2561
|
R(m, {
|
|
2547
2562
|
class: "tvp-search-box__input-help",
|
|
2548
|
-
onClick:
|
|
2563
|
+
onClick: ee(e.helpClick, ["stop"])
|
|
2549
2564
|
}, null, 8, ["onClick"])
|
|
2550
2565
|
]),
|
|
2551
2566
|
_: 1
|
|
2552
2567
|
}, 8, ["content"])) : N("", !0),
|
|
2553
2568
|
R(f, {
|
|
2554
2569
|
class: "tvp-search-box__input-search",
|
|
2555
|
-
onClick:
|
|
2570
|
+
onClick: ee(e.createTag, ["stop"])
|
|
2556
2571
|
}, null, 8, ["onClick"])
|
|
2557
2572
|
];
|
|
2558
2573
|
}),
|
|
@@ -2560,39 +2575,39 @@ function ha(e, t, o, n, u, p) {
|
|
|
2560
2575
|
}, 8, ["modelValue", "placeholder", "maxlength", "onKeydown", "onInput", "onClick"])
|
|
2561
2576
|
]),
|
|
2562
2577
|
default: P(() => {
|
|
2563
|
-
var T, D,
|
|
2578
|
+
var T, D, v;
|
|
2564
2579
|
return [
|
|
2565
2580
|
E("div", {
|
|
2566
2581
|
class: "tvp-search-box__dropdown",
|
|
2567
|
-
style:
|
|
2568
|
-
onMouseup:
|
|
2582
|
+
style: ae({ "max-height": e.panelMaxHeight }),
|
|
2583
|
+
onMouseup: ee(() => {
|
|
2569
2584
|
}, ["stop"])
|
|
2570
2585
|
}, [
|
|
2571
2586
|
X(E("div", null, [
|
|
2572
|
-
(T = e.state.instance) != null && T.slots["first-panel"] ? ke(e.$slots, "first-panel",
|
|
2587
|
+
(T = e.state.instance) != null && T.slots["first-panel"] ? ke(e.$slots, "first-panel", Me({ key: 0 }, {
|
|
2573
2588
|
state: e.state,
|
|
2574
2589
|
handleEvents: e.handleEvents
|
|
2575
2590
|
}, {
|
|
2576
|
-
onClick: t[1] || (t[1] =
|
|
2591
|
+
onClick: t[1] || (t[1] = ee(() => {
|
|
2577
2592
|
}, ["stop"]))
|
|
2578
|
-
})) : (y(),
|
|
2593
|
+
})) : (y(), A(n, {
|
|
2579
2594
|
key: 1,
|
|
2580
2595
|
state: e.state,
|
|
2581
2596
|
handleEvents: e.handleEvents
|
|
2582
2597
|
}, null, 8, ["state", "handleEvents"]))
|
|
2583
2598
|
], 512), [
|
|
2584
|
-
[
|
|
2599
|
+
[oe, !e.state.propItem.label || ((D = e.state.inputValue) == null ? void 0 : D.trim())]
|
|
2585
2600
|
]),
|
|
2586
2601
|
X(E("div", null, [
|
|
2587
|
-
(
|
|
2602
|
+
(v = e.state.instance) != null && v.slots["second-panel"] ? ke(e.$slots, "second-panel", Me({ key: 0 }, {
|
|
2588
2603
|
state: e.state,
|
|
2589
2604
|
pickerOptions: e.pickerOptions,
|
|
2590
2605
|
handleEvents: e.handleEvents,
|
|
2591
2606
|
back: () => e.resetInput(e.state)
|
|
2592
2607
|
}, {
|
|
2593
|
-
onClick: t[2] || (t[2] =
|
|
2608
|
+
onClick: t[2] || (t[2] = ee(() => {
|
|
2594
2609
|
}, ["stop"]))
|
|
2595
|
-
})) : e.state.prevItem.type !== "custom" ? (y(),
|
|
2610
|
+
})) : e.state.prevItem.type !== "custom" ? (y(), A(r, {
|
|
2596
2611
|
key: 1,
|
|
2597
2612
|
state: e.state,
|
|
2598
2613
|
"picker-options": e.pickerOptions,
|
|
@@ -2603,16 +2618,17 @@ function ha(e, t, o, n, u, p) {
|
|
|
2603
2618
|
class: "tvp-search-box__panel-box",
|
|
2604
2619
|
onClick: t[4] || (t[4] = (V) => e.showDropdown(e.state))
|
|
2605
2620
|
}, [
|
|
2606
|
-
ke(e.$slots, e.state.prevItem.slotName,
|
|
2621
|
+
ke(e.$slots, e.state.prevItem.slotName, Me({
|
|
2607
2622
|
showDropdown: () => e.showDropdown(e.state),
|
|
2608
|
-
onConfirm: e.handleConfirm
|
|
2623
|
+
onConfirm: e.handleConfirm,
|
|
2624
|
+
state: e.state
|
|
2609
2625
|
}, {
|
|
2610
|
-
onClick: t[3] || (t[3] =
|
|
2626
|
+
onClick: t[3] || (t[3] = ee(() => {
|
|
2611
2627
|
}, ["stop"]))
|
|
2612
2628
|
}))
|
|
2613
2629
|
]))
|
|
2614
2630
|
], 512), [
|
|
2615
|
-
[
|
|
2631
|
+
[oe, e.state.propItem.label]
|
|
2616
2632
|
])
|
|
2617
2633
|
], 36)
|
|
2618
2634
|
];
|
|
@@ -2620,7 +2636,7 @@ function ha(e, t, o, n, u, p) {
|
|
|
2620
2636
|
_: 3
|
|
2621
2637
|
}, 8, ["modelValue", "append-to-body"])
|
|
2622
2638
|
]),
|
|
2623
|
-
e.editable ? (y(),
|
|
2639
|
+
e.editable ? (y(), A(l, {
|
|
2624
2640
|
key: 0,
|
|
2625
2641
|
ref: "popoverRef",
|
|
2626
2642
|
modelValue: e.state.popoverVisible,
|
|
@@ -2636,45 +2652,45 @@ function ha(e, t, o, n, u, p) {
|
|
|
2636
2652
|
var T, D;
|
|
2637
2653
|
return [
|
|
2638
2654
|
e.state.prevItem.type !== "custom" ? (y(), w(z, { key: 0 }, [
|
|
2639
|
-
E("div",
|
|
2640
|
-
E("div",
|
|
2641
|
-
E("div",
|
|
2655
|
+
E("div", Fn, [
|
|
2656
|
+
E("div", xn, I(e.t("tvp.tvpSearchbox.attributeType")), 1),
|
|
2657
|
+
E("div", Hn, [
|
|
2642
2658
|
R(g, {
|
|
2643
2659
|
modelValue: e.state.selectValue,
|
|
2644
|
-
"onUpdate:modelValue": t[7] || (t[7] = (
|
|
2660
|
+
"onUpdate:modelValue": t[7] || (t[7] = (v) => e.state.selectValue = v),
|
|
2645
2661
|
"is-drop-inherit-width": "",
|
|
2646
2662
|
searchable: "",
|
|
2647
2663
|
disabled: e.state.prevItem.editAttrDisabled || e.state.prevItem.disableDelete
|
|
2648
2664
|
}, {
|
|
2649
2665
|
default: P(() => [
|
|
2650
|
-
e.state.selectValue === e.state.allTypeAttri.label ? (y(),
|
|
2666
|
+
e.state.selectValue === e.state.allTypeAttri.label ? (y(), A(h, {
|
|
2651
2667
|
key: e.state.allTypeAttri.label,
|
|
2652
2668
|
label: e.t("tvp.tvpSearchbox.allProperty"),
|
|
2653
2669
|
value: e.state.allTypeAttri.label,
|
|
2654
|
-
onClick: t[6] || (t[6] = (
|
|
2670
|
+
onClick: t[6] || (t[6] = (v) => e.selectPropChange(e.state.allTypeAttri))
|
|
2655
2671
|
}, null, 8, ["label", "value"])) : N("", !0),
|
|
2656
|
-
(y(!0), w(z, null,
|
|
2657
|
-
key:
|
|
2658
|
-
label:
|
|
2659
|
-
value:
|
|
2660
|
-
onClick: (V) => e.selectPropChange(
|
|
2672
|
+
(y(!0), w(z, null, q(e.state.recordItems, (v) => (y(), A(h, {
|
|
2673
|
+
key: v.label,
|
|
2674
|
+
label: v.label,
|
|
2675
|
+
value: v.label,
|
|
2676
|
+
onClick: (V) => e.selectPropChange(v)
|
|
2661
2677
|
}, null, 8, ["label", "value", "onClick"]))), 128))
|
|
2662
2678
|
]),
|
|
2663
2679
|
_: 1
|
|
2664
2680
|
}, 8, ["modelValue", "disabled"])
|
|
2665
2681
|
]),
|
|
2666
|
-
e.state.prevItem.operators ? (y(), w("div",
|
|
2682
|
+
e.state.prevItem.operators ? (y(), w("div", An, I(e.t("tvp.tvpSearchbox.operator")), 1)) : N("", !0),
|
|
2667
2683
|
e.state.prevItem.operators ? (y(), w("div", zn, [
|
|
2668
2684
|
R(g, {
|
|
2669
2685
|
modelValue: e.state.operatorValue,
|
|
2670
|
-
"onUpdate:modelValue": t[8] || (t[8] = (
|
|
2686
|
+
"onUpdate:modelValue": t[8] || (t[8] = (v) => e.state.operatorValue = v),
|
|
2671
2687
|
"is-drop-inherit-width": ""
|
|
2672
2688
|
}, {
|
|
2673
2689
|
default: P(() => [
|
|
2674
|
-
(y(!0), w(z, null,
|
|
2675
|
-
key:
|
|
2676
|
-
label:
|
|
2677
|
-
value:
|
|
2690
|
+
(y(!0), w(z, null, q(e.state.currentOperators, (v) => (y(), A(h, {
|
|
2691
|
+
key: v,
|
|
2692
|
+
label: v,
|
|
2693
|
+
value: v
|
|
2678
2694
|
}, null, 8, ["label", "value"]))), 128))
|
|
2679
2695
|
]),
|
|
2680
2696
|
_: 1
|
|
@@ -2683,12 +2699,12 @@ function ha(e, t, o, n, u, p) {
|
|
|
2683
2699
|
["numRange", "map"].includes(e.state.prevItem.type) ? N("", !0) : (y(), w("div", Un, I(e.t("tvp.tvpSearchbox.tagValue")), 1)),
|
|
2684
2700
|
["numRange", "dateRange", "datetimeRange", "custom", "map"].includes(e.state.prevItem.type) ? N("", !0) : (y(), w("div", {
|
|
2685
2701
|
key: 3,
|
|
2686
|
-
class:
|
|
2702
|
+
class: G(["tvp-search-box__number-item", { "is-error": e.state.formErrors.inputEditValue }])
|
|
2687
2703
|
}, [
|
|
2688
|
-
((T = e.state.currentEditValue) == null ? void 0 : T.length) > 0 ? (y(),
|
|
2704
|
+
((T = e.state.currentEditValue) == null ? void 0 : T.length) > 0 ? (y(), A(g, {
|
|
2689
2705
|
key: e.state.prevItem.field,
|
|
2690
2706
|
modelValue: e.state.inputEditValue,
|
|
2691
|
-
"onUpdate:modelValue": t[9] || (t[9] = (
|
|
2707
|
+
"onUpdate:modelValue": t[9] || (t[9] = (v) => e.state.inputEditValue = v),
|
|
2692
2708
|
"is-drop-inherit-width": "",
|
|
2693
2709
|
class: "tvp-search-box-select",
|
|
2694
2710
|
multiple: !!e.state.prevItem.mergeTag,
|
|
@@ -2696,34 +2712,34 @@ function ha(e, t, o, n, u, p) {
|
|
|
2696
2712
|
filterable: "",
|
|
2697
2713
|
"default-first-option": "",
|
|
2698
2714
|
clearable: "",
|
|
2699
|
-
onChange: t[10] || (t[10] = (
|
|
2715
|
+
onChange: t[10] || (t[10] = (v) => e.checkFormValidation())
|
|
2700
2716
|
}, {
|
|
2701
2717
|
default: P(() => [
|
|
2702
|
-
(y(!0), w(z, null,
|
|
2703
|
-
key:
|
|
2704
|
-
label:
|
|
2705
|
-
value:
|
|
2718
|
+
(y(!0), w(z, null, q(e.state.currentEditValue, (v) => (y(), A(h, {
|
|
2719
|
+
key: v.label,
|
|
2720
|
+
label: v.label,
|
|
2721
|
+
value: v.label
|
|
2706
2722
|
}, null, 8, ["label", "value"]))), 128))
|
|
2707
2723
|
]),
|
|
2708
2724
|
_: 1
|
|
2709
|
-
}, 8, ["modelValue", "multiple", "allow-create"])) : (y(),
|
|
2725
|
+
}, 8, ["modelValue", "multiple", "allow-create"])) : (y(), A(p, {
|
|
2710
2726
|
key: e.state.prevItem.field,
|
|
2711
2727
|
modelValue: e.state.inputEditValue,
|
|
2712
|
-
"onUpdate:modelValue": t[11] || (t[11] = (
|
|
2728
|
+
"onUpdate:modelValue": t[11] || (t[11] = (v) => e.state.inputEditValue = v),
|
|
2713
2729
|
maxlength: e.maxlength,
|
|
2714
2730
|
clearable: "",
|
|
2715
|
-
onChange: t[12] || (t[12] = (
|
|
2731
|
+
onChange: t[12] || (t[12] = (v) => e.checkFormValidation())
|
|
2716
2732
|
}, null, 8, ["modelValue", "maxlength"])),
|
|
2717
2733
|
e.state.formErrors.inputEditValue ? (y(), w("div", Kn, I(e.state.formErrors.inputEditValue), 1)) : N("", !0)
|
|
2718
2734
|
], 2)),
|
|
2719
2735
|
e.state.prevItem.type === "numRange" ? (y(), w("div", jn, [
|
|
2720
2736
|
E("div", Gn, I(e.t("tvp.tvpSearchbox.minValueText")) + I(e.state.prevItem.unit ? `(${e.state.prevItem.unit})` : ""), 1),
|
|
2721
2737
|
E("div", {
|
|
2722
|
-
class:
|
|
2738
|
+
class: G(["tvp-search-box__number-item", { "is-error": e.state.formErrors[e.state.curMinNumVar] }])
|
|
2723
2739
|
}, [
|
|
2724
|
-
R(
|
|
2740
|
+
R(p, {
|
|
2725
2741
|
modelValue: e.state[e.state.curMinNumVar],
|
|
2726
|
-
"onUpdate:modelValue": t[13] || (t[13] = (
|
|
2742
|
+
"onUpdate:modelValue": t[13] || (t[13] = (v) => e.state[e.state.curMinNumVar] = v),
|
|
2727
2743
|
type: "number",
|
|
2728
2744
|
class: "tvp-search-box__number-input"
|
|
2729
2745
|
}, null, 8, ["modelValue"]),
|
|
@@ -2731,11 +2747,11 @@ function ha(e, t, o, n, u, p) {
|
|
|
2731
2747
|
], 2),
|
|
2732
2748
|
E("div", Yn, I(e.t("tvp.tvpSearchbox.maxValueText")) + I(e.state.prevItem.unit ? `(${e.state.prevItem.unit})` : ""), 1),
|
|
2733
2749
|
E("div", {
|
|
2734
|
-
class:
|
|
2750
|
+
class: G(["tvp-search-box__number-item", { "is-error": e.state.formErrors[e.state.curMaxNumVar] }])
|
|
2735
2751
|
}, [
|
|
2736
|
-
R(
|
|
2752
|
+
R(p, {
|
|
2737
2753
|
modelValue: e.state[e.state.curMaxNumVar],
|
|
2738
|
-
"onUpdate:modelValue": t[14] || (t[14] = (
|
|
2754
|
+
"onUpdate:modelValue": t[14] || (t[14] = (v) => e.state[e.state.curMaxNumVar] = v),
|
|
2739
2755
|
type: "number",
|
|
2740
2756
|
class: "tvp-search-box__number-input"
|
|
2741
2757
|
}, null, 8, ["modelValue"]),
|
|
@@ -2748,31 +2764,31 @@ function ha(e, t, o, n, u, p) {
|
|
|
2748
2764
|
}) : e.t("tvp.tvpSearchbox.rangeDateTitle")), 1),
|
|
2749
2765
|
E("div", Qn, I(e.t("tvp.tvpSearchbox.rangeBeginLabel")), 1),
|
|
2750
2766
|
E("div", {
|
|
2751
|
-
class:
|
|
2767
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.startDate }])
|
|
2752
2768
|
}, [
|
|
2753
2769
|
R(S, {
|
|
2754
2770
|
modelValue: e.state.startDate,
|
|
2755
|
-
"onUpdate:modelValue": t[15] || (t[15] = (
|
|
2771
|
+
"onUpdate:modelValue": t[15] || (t[15] = (v) => e.state.startDate = v),
|
|
2756
2772
|
format: e.state.prevItem.format || e.state.dateRangeFormat,
|
|
2757
2773
|
"value-format": e.state.prevItem.format || e.state.dateRangeFormat,
|
|
2758
2774
|
"picker-options": e.pickerOptions(e.state.startDate, "endDate"),
|
|
2759
2775
|
class: "tvp-search-box__date-picker",
|
|
2760
|
-
onChange: t[16] || (t[16] = (
|
|
2776
|
+
onChange: t[16] || (t[16] = (v) => e.checkFormValidation())
|
|
2761
2777
|
}, null, 8, ["modelValue", "format", "value-format", "picker-options"]),
|
|
2762
2778
|
e.state.formErrors.startDate && e.state.prevItem.maxTimeLength ? (y(), w("div", Jn, I(e.state.formErrors.startDate), 1)) : N("", !0)
|
|
2763
2779
|
], 2),
|
|
2764
2780
|
E("div", ea, I(e.t("tvp.tvpSearchbox.rangeEndLabel")), 1),
|
|
2765
2781
|
E("div", {
|
|
2766
|
-
class:
|
|
2782
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.endDate }])
|
|
2767
2783
|
}, [
|
|
2768
2784
|
R(S, {
|
|
2769
2785
|
modelValue: e.state.endDate,
|
|
2770
|
-
"onUpdate:modelValue": t[17] || (t[17] = (
|
|
2786
|
+
"onUpdate:modelValue": t[17] || (t[17] = (v) => e.state.endDate = v),
|
|
2771
2787
|
format: e.state.prevItem.format || e.state.dateRangeFormat,
|
|
2772
2788
|
"value-format": e.state.prevItem.format || e.state.dateRangeFormat,
|
|
2773
2789
|
"picker-options": e.pickerOptions(e.state.startDate),
|
|
2774
2790
|
class: "tvp-search-box__date-picker",
|
|
2775
|
-
onChange: t[18] || (t[18] = (
|
|
2791
|
+
onChange: t[18] || (t[18] = (v) => e.checkFormValidation())
|
|
2776
2792
|
}, null, 8, ["modelValue", "format", "value-format", "picker-options"]),
|
|
2777
2793
|
e.state.formErrors.endDate ? (y(), w("div", ta, I(e.state.formErrors.endDate), 1)) : N("", !0)
|
|
2778
2794
|
], 2)
|
|
@@ -2783,35 +2799,35 @@ function ha(e, t, o, n, u, p) {
|
|
|
2783
2799
|
}) : e.t("tvp.tvpSearchbox.rangeDateTitle")), 1),
|
|
2784
2800
|
E("div", aa, I(e.t("tvp.tvpSearchbox.rangeBeginLabel")), 1),
|
|
2785
2801
|
E("div", {
|
|
2786
|
-
class:
|
|
2802
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.startDateTime }])
|
|
2787
2803
|
}, [
|
|
2788
2804
|
R(S, {
|
|
2789
2805
|
modelValue: e.state.startDateTime,
|
|
2790
|
-
"onUpdate:modelValue": t[19] || (t[19] = (
|
|
2806
|
+
"onUpdate:modelValue": t[19] || (t[19] = (v) => e.state.startDateTime = v),
|
|
2791
2807
|
type: "datetime",
|
|
2792
2808
|
isutc8: !0,
|
|
2793
2809
|
format: e.state.prevItem.format || e.state.datetimeRangeFormat,
|
|
2794
2810
|
"value-format": e.state.prevItem.format || e.state.datetimeRangeFormat,
|
|
2795
2811
|
"picker-options": e.pickerOptions(e.state.startDateTime, "endDateTime"),
|
|
2796
2812
|
class: "tvp-search-box__date-picker",
|
|
2797
|
-
onChange: t[20] || (t[20] = (
|
|
2813
|
+
onChange: t[20] || (t[20] = (v) => e.checkFormValidation())
|
|
2798
2814
|
}, null, 8, ["modelValue", "format", "value-format", "picker-options"]),
|
|
2799
2815
|
e.state.formErrors.startDateTime && e.state.prevItem.maxTimeLength ? (y(), w("div", la, I(e.state.formErrors.startDateTime), 1)) : N("", !0)
|
|
2800
2816
|
], 2),
|
|
2801
2817
|
E("div", ra, I(e.t("tvp.tvpSearchbox.rangeEndLabel")), 1),
|
|
2802
2818
|
E("div", {
|
|
2803
|
-
class:
|
|
2819
|
+
class: G(["tvp-search-box__date-item", { "is-error": e.state.formErrors.endDateTime }])
|
|
2804
2820
|
}, [
|
|
2805
2821
|
R(S, {
|
|
2806
2822
|
modelValue: e.state.endDateTime,
|
|
2807
|
-
"onUpdate:modelValue": t[21] || (t[21] = (
|
|
2823
|
+
"onUpdate:modelValue": t[21] || (t[21] = (v) => e.state.endDateTime = v),
|
|
2808
2824
|
type: "datetime",
|
|
2809
2825
|
isutc8: !0,
|
|
2810
2826
|
format: e.state.prevItem.format || e.state.datetimeRangeFormat,
|
|
2811
2827
|
"value-format": e.state.prevItem.format || e.state.datetimeRangeFormat,
|
|
2812
2828
|
"picker-options": e.pickerOptions(e.state.startDateTime),
|
|
2813
2829
|
class: "tvp-search-box__date-picker",
|
|
2814
|
-
onChange: t[22] || (t[22] = (
|
|
2830
|
+
onChange: t[22] || (t[22] = (v) => e.checkFormValidation())
|
|
2815
2831
|
}, null, 8, ["modelValue", "format", "value-format", "picker-options"]),
|
|
2816
2832
|
e.state.formErrors.endDateTime ? (y(), w("div", sa, I(e.state.formErrors.endDateTime), 1)) : N("", !0)
|
|
2817
2833
|
], 2)
|
|
@@ -2819,11 +2835,11 @@ function ha(e, t, o, n, u, p) {
|
|
|
2819
2835
|
e.state.prevItem.type === "map" ? (y(), w("div", ia, [
|
|
2820
2836
|
E("div", ua, I(e.t("tvp.tvpSearchbox.tagKey")), 1),
|
|
2821
2837
|
E("div", {
|
|
2822
|
-
class:
|
|
2838
|
+
class: G(["tvp-search-box__number-item", { "is-error": e.state.formErrors.mapEditKey }])
|
|
2823
2839
|
}, [
|
|
2824
2840
|
R(g, {
|
|
2825
2841
|
modelValue: e.state.mapEditKey,
|
|
2826
|
-
"onUpdate:modelValue": t[23] || (t[23] = (
|
|
2842
|
+
"onUpdate:modelValue": t[23] || (t[23] = (v) => e.state.mapEditKey = v),
|
|
2827
2843
|
"is-drop-inherit-width": "",
|
|
2828
2844
|
clearable: "",
|
|
2829
2845
|
onChange: t[24] || (t[24] = () => {
|
|
@@ -2831,10 +2847,10 @@ function ha(e, t, o, n, u, p) {
|
|
|
2831
2847
|
})
|
|
2832
2848
|
}, {
|
|
2833
2849
|
default: P(() => [
|
|
2834
|
-
(y(!0), w(z, null,
|
|
2835
|
-
key:
|
|
2836
|
-
label:
|
|
2837
|
-
value:
|
|
2850
|
+
(y(!0), w(z, null, q(e.state.prevItem.options || [], (v) => (y(), A(h, {
|
|
2851
|
+
key: v.label,
|
|
2852
|
+
label: v.label,
|
|
2853
|
+
value: v.label
|
|
2838
2854
|
}, null, 8, ["label", "value"]))), 128))
|
|
2839
2855
|
]),
|
|
2840
2856
|
_: 1
|
|
@@ -2843,20 +2859,20 @@ function ha(e, t, o, n, u, p) {
|
|
|
2843
2859
|
], 2),
|
|
2844
2860
|
E("div", ca, I(e.t("tvp.tvpSearchbox.tagValue")), 1),
|
|
2845
2861
|
E("div", {
|
|
2846
|
-
class:
|
|
2862
|
+
class: G(["tvp-search-box__number-item", { "is-error": e.state.formErrors.mapEditValue }])
|
|
2847
2863
|
}, [
|
|
2848
2864
|
R(g, {
|
|
2849
2865
|
modelValue: e.state.mapEditValue,
|
|
2850
|
-
"onUpdate:modelValue": t[25] || (t[25] = (
|
|
2866
|
+
"onUpdate:modelValue": t[25] || (t[25] = (v) => e.state.mapEditValue = v),
|
|
2851
2867
|
"is-drop-inherit-width": "",
|
|
2852
2868
|
clearable: "",
|
|
2853
|
-
onChange: t[26] || (t[26] = (
|
|
2869
|
+
onChange: t[26] || (t[26] = (v) => e.checkFormValidation())
|
|
2854
2870
|
}, {
|
|
2855
2871
|
default: P(() => [
|
|
2856
|
-
(y(!0), w(z, null,
|
|
2857
|
-
key:
|
|
2858
|
-
label:
|
|
2859
|
-
value:
|
|
2872
|
+
(y(!0), w(z, null, q(e.state.mapEditValueOptions, (v) => (y(), A(h, {
|
|
2873
|
+
key: v.label,
|
|
2874
|
+
label: v.label,
|
|
2875
|
+
value: v.label
|
|
2860
2876
|
}, null, 8, ["label", "value"]))), 128))
|
|
2861
2877
|
]),
|
|
2862
2878
|
_: 1
|
|
@@ -2868,7 +2884,7 @@ function ha(e, t, o, n, u, p) {
|
|
|
2868
2884
|
E("div", ma, [
|
|
2869
2885
|
R($, {
|
|
2870
2886
|
size: "mini",
|
|
2871
|
-
onClick: t[27] || (t[27] = (
|
|
2887
|
+
onClick: t[27] || (t[27] = (v) => e.confirmEditTag(!1))
|
|
2872
2888
|
}, {
|
|
2873
2889
|
default: P(() => [
|
|
2874
2890
|
W(I(e.t("tvp.tvpSearchbox.cancel")), 1)
|
|
@@ -2878,7 +2894,7 @@ function ha(e, t, o, n, u, p) {
|
|
|
2878
2894
|
R($, {
|
|
2879
2895
|
size: "mini",
|
|
2880
2896
|
disabled: e.state.hasFormError,
|
|
2881
|
-
onClick: t[28] || (t[28] = (
|
|
2897
|
+
onClick: t[28] || (t[28] = (v) => e.confirmEditTag(!0))
|
|
2882
2898
|
}, {
|
|
2883
2899
|
default: P(() => [
|
|
2884
2900
|
W(I(e.t("tvp.tvpSearchbox.confirm")), 1)
|
|
@@ -2887,11 +2903,11 @@ function ha(e, t, o, n, u, p) {
|
|
|
2887
2903
|
}, 8, ["disabled"])
|
|
2888
2904
|
])
|
|
2889
2905
|
], 64)) : e.state.popoverVisible ? (y(), w("div", fa, [
|
|
2890
|
-
ke(e.$slots, `${e.state.prevItem.slotName}-edit`,
|
|
2906
|
+
ke(e.$slots, `${e.state.prevItem.slotName}-edit`, Me({
|
|
2891
2907
|
showDropdown: () => e.showPopover(e.state),
|
|
2892
2908
|
onConfirm: e.handleEditConfirm
|
|
2893
2909
|
}, {
|
|
2894
|
-
onClick: t[29] || (t[29] =
|
|
2910
|
+
onClick: t[29] || (t[29] = ee(() => {
|
|
2895
2911
|
}, ["stop"]))
|
|
2896
2912
|
}))
|
|
2897
2913
|
])) : N("", !0)
|
|
@@ -2903,7 +2919,7 @@ function ha(e, t, o, n, u, p) {
|
|
|
2903
2919
|
], 2);
|
|
2904
2920
|
}
|
|
2905
2921
|
const va = /* @__PURE__ */ Ye(Ln, [["render", ha]]), ba = {
|
|
2906
|
-
...
|
|
2922
|
+
...Ne,
|
|
2907
2923
|
tiny_mode: {
|
|
2908
2924
|
type: String,
|
|
2909
2925
|
default: "pc"
|
|
@@ -2992,11 +3008,11 @@ const va = /* @__PURE__ */ Ye(Ln, [["render", ha]]), ba = {
|
|
|
2992
3008
|
type: Boolean,
|
|
2993
3009
|
default: !1
|
|
2994
3010
|
}
|
|
2995
|
-
}, Ie =
|
|
3011
|
+
}, Ie = Le({
|
|
2996
3012
|
name: Ke + "SearchBox",
|
|
2997
3013
|
props: ba,
|
|
2998
3014
|
...va
|
|
2999
|
-
}), ga = "3.32.
|
|
3015
|
+
}), ga = "3.32.1-alpha.0";
|
|
3000
3016
|
Ie.install = function(e) {
|
|
3001
3017
|
const t = e;
|
|
3002
3018
|
t && t.config && t.config.globalProperties && ze(t), t && t.mixin && !t.__TINY_SEARCH_BOX_I18N_MIXIN__ && (t.__TINY_SEARCH_BOX_I18N_MIXIN__ = !0, t.mixin({
|
|
@@ -3009,7 +3025,7 @@ Ie.install = function(e) {
|
|
|
3009
3025
|
Ie.version = ga;
|
|
3010
3026
|
typeof window < "u" && window.Vue && Ie.install(window.Vue);
|
|
3011
3027
|
export {
|
|
3012
|
-
|
|
3028
|
+
xo as TinySearchBoxFirstLevelPanel,
|
|
3013
3029
|
Cn as TinySearchBoxSecondLevelPanel,
|
|
3014
3030
|
Ie as default,
|
|
3015
3031
|
it as enUS,
|