@opentiny/vue-search-box 2.29.0 → 2.29.1
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.css +7 -0
- package/index.js +124 -137
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +22 -6
package/index.css
CHANGED
|
@@ -425,6 +425,13 @@
|
|
|
425
425
|
.tvp-search-box__number-item.tiny-form-item .tiny-form-item__error {
|
|
426
426
|
font-size: 12px;
|
|
427
427
|
}
|
|
428
|
+
.tvp-search-box__date-item.tiny-form-item .tiny-form-item__validate-message,
|
|
429
|
+
.tvp-search-box__number-item.tiny-form-item .tiny-form-item__validate-message {
|
|
430
|
+
font-size: 12px;
|
|
431
|
+
white-space: nowrap;
|
|
432
|
+
overflow: hidden;
|
|
433
|
+
text-overflow: ellipsis;
|
|
434
|
+
}
|
|
428
435
|
.tvp-search-box__input input {
|
|
429
436
|
border: 0;
|
|
430
437
|
}
|
package/index.js
CHANGED
|
@@ -220,9 +220,9 @@ const lt = {
|
|
|
220
220
|
return s ? ue(s, n) : "";
|
|
221
221
|
}
|
|
222
222
|
}, V = (a, e = !0) => {
|
|
223
|
-
e ? a.visibleTimer = setTimeout(() => {
|
|
223
|
+
clearTimeout(a.visibleTimer), a.visibleTimer = null, e ? a.visible || (a.visibleTimer = setTimeout(() => {
|
|
224
224
|
a.visible = !0;
|
|
225
|
-
}, 0) :
|
|
225
|
+
}, 0)) : a.visible = !1;
|
|
226
226
|
}, te = (a, e = !0) => {
|
|
227
227
|
if (!a.instance)
|
|
228
228
|
return;
|
|
@@ -345,10 +345,10 @@ const St = async (a, e, n) => {
|
|
|
345
345
|
f && (i = !1);
|
|
346
346
|
}), i) {
|
|
347
347
|
const { field: f, label: c, unit: p, type: v, operators: m } = s, h = p ? `${c}(${p})` : c;
|
|
348
|
-
let
|
|
349
|
-
d && r ?
|
|
348
|
+
let g = "";
|
|
349
|
+
d && r ? g = `${d}-${r}` : g = d ? `≥${d}` : `≤${r}`;
|
|
350
350
|
const y = K(n, s, s), T = e.operatorValue && m ? { operator: e.operatorValue } : null;
|
|
351
|
-
u = G({ type: v, field: f, label: h, value:
|
|
351
|
+
u = G({ type: v, field: f, label: h, value: g, ...y, start: d, end: r, ...T });
|
|
352
352
|
}
|
|
353
353
|
return u;
|
|
354
354
|
}, pe = async (a, e, n, s) => {
|
|
@@ -365,8 +365,8 @@ const St = async (a, e, n) => {
|
|
|
365
365
|
i === u ? h = i : h = `${i}-${u}`;
|
|
366
366
|
} else
|
|
367
367
|
h = i ? `≥${i}` : `≤${u}`;
|
|
368
|
-
const
|
|
369
|
-
c = G({ ...m, value: h, start: i, end: u, ...
|
|
368
|
+
const g = K(n, l, l), y = e.operatorValue && v ? { operator: e.operatorValue } : null;
|
|
369
|
+
c = G({ ...m, value: h, start: i, end: u, ...g, ...y });
|
|
370
370
|
}
|
|
371
371
|
return c;
|
|
372
372
|
}, Re = (a, e, n) => {
|
|
@@ -374,28 +374,28 @@ const St = async (a, e, n) => {
|
|
|
374
374
|
(a.curMinNumVar !== i || a.curMaxNumVar !== u) && (delete a[a.curMinNumVar], delete a[a.curMaxNumVar], delete a.formRules[a.curMinNumVar], delete a.formRules[a.curMaxNumVar], a.curMinNumVar = i, a.curMaxNumVar = u), a[a.curMinNumVar] = t, a[a.curMaxNumVar] = d;
|
|
375
375
|
const { curMinNumVar: f, curMaxNumVar: c } = a, p = A(r), v = A(o);
|
|
376
376
|
p || v ? (a.formRules[f] = {
|
|
377
|
-
validator: (m, h,
|
|
377
|
+
validator: (m, h, g) => {
|
|
378
378
|
const y = A(h);
|
|
379
|
-
!y && A(a[c]) || y && (p && !v && h >= r || !p && v && h <= o || h >= r && h <= o) ?
|
|
379
|
+
!y && A(a[c]) || y && (p && !v && h >= r || !p && v && h <= o || h >= r && h <= o) ? g() : (a.numberShowMessage = !!(h || a[c]), g(new Error(n("tvp.tvpSearchbox.rangeMinErr", [r, o]))));
|
|
380
380
|
}
|
|
381
381
|
}, a.formRules[c] = {
|
|
382
|
-
validator: (m, h,
|
|
383
|
-
const y = A(a[f]), T = y && r < a[f] ? Number(a[f]) : r,
|
|
384
|
-
!b && y || b && (
|
|
382
|
+
validator: (m, h, g) => {
|
|
383
|
+
const y = A(a[f]), T = y && r < a[f] ? Number(a[f]) : r, _ = A(T), b = A(h);
|
|
384
|
+
!b && y || b && (_ && !v && h >= T || !_ && v && h <= o || h >= T && h <= o) ? g() : g(!b && !y ? new Error(n("tvp.tvpSearchbox.rangeNumberTitle")) : new Error(n("tvp.tvpSearchbox.rangeMaxErr")));
|
|
385
385
|
}
|
|
386
386
|
}) : a.formRules[c] = {
|
|
387
|
-
validator: (m, h,
|
|
388
|
-
const y = a[f], T = A(h),
|
|
389
|
-
T && !
|
|
387
|
+
validator: (m, h, g) => {
|
|
388
|
+
const y = a[f], T = A(h), _ = A(y);
|
|
389
|
+
T && !_ || !T && _ || T && _ && h >= Number(y) ? g() : g(!T && !_ ? new Error(n("tvp.tvpSearchbox.rangeNumberTitle")) : new Error(n("tvp.tvpSearchbox.rangeMaxErr")));
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
};
|
|
393
393
|
function Mt({ props: a, emit: e, state: n, t: s, format: l, nextTick: t, vm: d, cancelHandleInput: r }) {
|
|
394
|
-
const o = d || n.instance, i = (
|
|
394
|
+
const o = d || n.instance, i = (_) => {
|
|
395
395
|
var k, w, D;
|
|
396
|
-
const { start: b, end: x, type: I } =
|
|
397
|
-
if (n.backupList =
|
|
398
|
-
Re(n,
|
|
396
|
+
const { start: b, end: x, type: I } = _;
|
|
397
|
+
if (n.backupList = _.options, I === "numRange")
|
|
398
|
+
Re(n, _, s);
|
|
399
399
|
else if (I === "dateRange") {
|
|
400
400
|
const { dateRangeFormat: C } = n;
|
|
401
401
|
if (!n.startDate && b) {
|
|
@@ -418,26 +418,23 @@ function Mt({ props: a, emit: e, state: n, t: s, format: l, nextTick: t, vm: d,
|
|
|
418
418
|
}
|
|
419
419
|
} else
|
|
420
420
|
n.backupList && I === "checkbox" && (n.filterList = n.backupList, n.checkboxGroup = [], (k = n.backupList) == null || k.forEach((C) => {
|
|
421
|
-
B(n, C.label) && n.checkboxGroup.push(`${
|
|
421
|
+
B(n, C.label) && n.checkboxGroup.push(`${_.label}${C.label}`), C.isFilter = !1;
|
|
422
422
|
}));
|
|
423
423
|
I !== "checkbox" && ((w = n.backupList) != null && w.length) && ((D = n.backupList) == null || D.forEach((C) => {
|
|
424
424
|
C.isFilter = !1, C.isChecked = B(n, C.label);
|
|
425
425
|
})), n.currentOperators = null, !n.backupList && !["dateRange", "datetimeRange", "numRange", "custom"].includes(I) ? V(n, !1) : V(n);
|
|
426
|
-
}, u = (
|
|
426
|
+
}, u = (_) => {
|
|
427
427
|
var w;
|
|
428
|
-
const { field: b, label: x } =
|
|
428
|
+
const { field: b, label: x } = _;
|
|
429
429
|
n.propItem = { ...n.propItem, label: x }, e("first-level-select", b);
|
|
430
430
|
const I = (w = o.$refs) == null ? void 0 : w.inputRef;
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
n.operatorValue = g, i(n.prevItem);
|
|
439
|
-
}, c = (g, b, x, I) => {
|
|
440
|
-
const { replace: k, operators: w, mergeTag: D } = g, C = le(g), { indexMap: M } = n, $ = M.get(x), S = K(a, g, b), L = n.operatorValue && w ? { operator: n.operatorValue } : null;
|
|
431
|
+
n.prevItem = _, n.backupPrevItem = _;
|
|
432
|
+
const { operators: k } = _;
|
|
433
|
+
k != null && k.length ? (n.operatorValue = "", n.currentOperators = k, V(n)) : (n.operatorValue = ":", i(_)), n.inputValue = "", I.focus();
|
|
434
|
+
}, f = (_) => {
|
|
435
|
+
n.operatorValue = _, i(n.prevItem);
|
|
436
|
+
}, c = (_, b, x, I) => {
|
|
437
|
+
const { replace: k, operators: w, mergeTag: D } = _, C = le(_), { indexMap: M } = n, $ = M.get(x), S = K(a, _, b), L = n.operatorValue && w ? { operator: n.operatorValue } : null;
|
|
441
438
|
let O = null;
|
|
442
439
|
if (D) {
|
|
443
440
|
const F = { label: I, ...S };
|
|
@@ -461,20 +458,20 @@ function Mt({ props: a, emit: e, state: n, t: s, format: l, nextTick: t, vm: d,
|
|
|
461
458
|
} else
|
|
462
459
|
U = [...n.innerModelValue, O];
|
|
463
460
|
P({ emit: e, state: n, nextTick: t, newValue: U, oldValue: Z });
|
|
464
|
-
}, p = (
|
|
465
|
-
var b;
|
|
466
|
-
(b =
|
|
467
|
-
}, v = (
|
|
461
|
+
}, p = (_) => {
|
|
462
|
+
var b, x;
|
|
463
|
+
y(), (x = (b = o.$refs) == null ? void 0 : b.inputRef) == null || x.focus();
|
|
464
|
+
}, v = (_, b = !1) => {
|
|
468
465
|
var w;
|
|
469
|
-
V(n, !1), b && (n.prevItem =
|
|
470
|
-
const { prevItem: x } = n, I =
|
|
466
|
+
V(n, !1), b && (n.prevItem = _, n.backupPrevItem = _);
|
|
467
|
+
const { prevItem: x } = n, I = _.value || _.label, k = (w = o.$refs) == null ? void 0 : w.inputRef;
|
|
471
468
|
if (!B(n, I)) {
|
|
472
|
-
const D = n.propItem.label ||
|
|
473
|
-
c(x,
|
|
469
|
+
const D = n.propItem.label || _.label;
|
|
470
|
+
c(x, _, D, I);
|
|
474
471
|
}
|
|
475
472
|
k.focus();
|
|
476
|
-
}, m = (
|
|
477
|
-
if (
|
|
473
|
+
}, m = (_, b) => {
|
|
474
|
+
if (_.label) {
|
|
478
475
|
if (e("second-level-enter", b), !b.options || !b.options.length)
|
|
479
476
|
return;
|
|
480
477
|
const x = b.options[0];
|
|
@@ -487,14 +484,14 @@ function Mt({ props: a, emit: e, state: n, t: s, format: l, nextTick: t, vm: d,
|
|
|
487
484
|
}
|
|
488
485
|
} else
|
|
489
486
|
e("search", n.innerModelValue);
|
|
490
|
-
}, h = (
|
|
487
|
+
}, h = (_, b, x) => {
|
|
491
488
|
var k;
|
|
492
489
|
const I = (k = n.backupList) == null ? void 0 : k.find((w) => w.label === x);
|
|
493
|
-
c(
|
|
494
|
-
},
|
|
490
|
+
c(_, I, b.label, x);
|
|
491
|
+
}, g = (_, b, x) => {
|
|
495
492
|
var I, k;
|
|
496
493
|
if (b.label) {
|
|
497
|
-
const { regexp: w, replace: D, type: C, mergeTag: M } = x, $ = C !== "checkbox" && D || C === "checkbox" && M ? [
|
|
494
|
+
const { regexp: w, replace: D, type: C, mergeTag: M } = x, $ = C !== "checkbox" && D || C === "checkbox" && M ? [_] : _.split(a.splitInputValue);
|
|
498
495
|
if (w) {
|
|
499
496
|
const S = [];
|
|
500
497
|
for (const L of $)
|
|
@@ -512,7 +509,7 @@ function Mt({ props: a, emit: e, state: n, t: s, format: l, nextTick: t, vm: d,
|
|
|
512
509
|
const { items: w, defaultField: D, defaultFieldReplace: C } = a, M = w.find((N) => {
|
|
513
510
|
const { regexp: H } = N;
|
|
514
511
|
return H && H.test(n.inputValue);
|
|
515
|
-
}), $ = D ? w.find((N) => N.field === D) : n.allTypeAttri, S = M || $, L = !M && C ? { ...S, replace: !0 } : S, { replace: O, type: Z, mergeTag: U, regexp: F } = L, Y = Z !== "checkbox" && O || Z === "checkbox" && U ? [
|
|
512
|
+
}), $ = D ? w.find((N) => N.field === D) : n.allTypeAttri, S = M || $, L = !M && C ? { ...S, replace: !0 } : S, { replace: O, type: Z, mergeTag: U, regexp: F } = L, Y = Z !== "checkbox" && O || Z === "checkbox" && U ? [_] : _.split(a.splitInputValue);
|
|
516
513
|
(I = S == null ? void 0 : S.options) != null && I.length && (n.backupList = [...S.options], (k = n.backupList) == null || k.forEach((N) => {
|
|
517
514
|
const H = N.value || N.label;
|
|
518
515
|
Y.includes(H) && (N.isChecked = !0);
|
|
@@ -533,16 +530,16 @@ function Mt({ props: a, emit: e, state: n, t: s, format: l, nextTick: t, vm: d,
|
|
|
533
530
|
c(L, {}, X, N);
|
|
534
531
|
}
|
|
535
532
|
}, y = () => {
|
|
536
|
-
const { inputValue:
|
|
537
|
-
if (r && r(), V(n, !1), !
|
|
533
|
+
const { inputValue: _, propItem: b, prevItem: x } = n;
|
|
534
|
+
if (r && r(), V(n, !1), !_)
|
|
538
535
|
m(b, x);
|
|
539
536
|
else {
|
|
540
537
|
const { maxlength: I } = a;
|
|
541
|
-
if (I && I <
|
|
538
|
+
if (I && I < _.length) {
|
|
542
539
|
e("exceed", I);
|
|
543
540
|
return;
|
|
544
541
|
}
|
|
545
|
-
_
|
|
542
|
+
g(_, b, x);
|
|
546
543
|
}
|
|
547
544
|
};
|
|
548
545
|
return { selectPropItem: u, selectRadioItem: v, selectInputValue: p, createTag: y, helpClick: () => {
|
|
@@ -569,42 +566,42 @@ function $t({ props: a, state: e, emit: n, nextTick: s }) {
|
|
|
569
566
|
return;
|
|
570
567
|
}
|
|
571
568
|
if (v.length === 0) {
|
|
572
|
-
V(e);
|
|
569
|
+
o(), V(e);
|
|
573
570
|
return;
|
|
574
571
|
}
|
|
575
572
|
Object.keys(e.matchItems).forEach((w) => {
|
|
576
573
|
e.matchItems[w].attr = [], e.matchItems[w].attrValue = [];
|
|
577
574
|
});
|
|
578
|
-
const h = Dt(v),
|
|
575
|
+
const h = Dt(v), g = new RegExp(h, "i"), y = c.label || !h ? null : f.find((w) => w.type === "map" && g.test(w.label));
|
|
579
576
|
if (y) {
|
|
580
577
|
e.propItem = { ...e.propItem, label: y.label }, e.inputValue = "", e.prevItem = y, e.backupPrevItem = y, e.backupList = y.options || [];
|
|
581
578
|
return;
|
|
582
579
|
}
|
|
583
|
-
e.filterList = (x = e.backupList) == null ? void 0 : x.filter((w) =>
|
|
584
|
-
const T = new RegExp(h, "ig"),
|
|
580
|
+
e.filterList = (x = e.backupList) == null ? void 0 : x.filter((w) => g.test(w.label) ? (delete w.isFilter, B(e, w.label) && e.checkboxGroup.push(`${e.prevItem.label}${w.label}`), !0) : (w.isFilter = !0, !1));
|
|
581
|
+
const T = new RegExp(h, "ig"), _ = v.toLowerCase();
|
|
585
582
|
if (e.propItem.label) {
|
|
586
583
|
(I = e.backupList) == null || I.forEach((w) => {
|
|
587
|
-
w.hightlighStr =
|
|
584
|
+
w.hightlighStr = _;
|
|
588
585
|
const D = w.label;
|
|
589
|
-
|
|
586
|
+
g.test(D) ? (w.match = ce(T, D), w.isFilter = !1) : w.isFilter = !0;
|
|
590
587
|
}), (k = e.backupList) != null && k.length || v ? V(e) : V(e, !1);
|
|
591
588
|
return;
|
|
592
589
|
}
|
|
593
590
|
for (const w of f) {
|
|
594
591
|
const { options: D = [], groupKey: C = "0", ...M } = w, $ = M.label;
|
|
595
|
-
if (
|
|
592
|
+
if (g.test($)) {
|
|
596
593
|
const S = ce(T, $);
|
|
597
|
-
e.matchItems[C].attr.push({ ...w, match: S, hightlighStr:
|
|
594
|
+
e.matchItems[C].attr.push({ ...w, match: S, hightlighStr: _ });
|
|
598
595
|
}
|
|
599
596
|
for (const S of D) {
|
|
600
597
|
const L = e.propItem.label ? $ : `${$}:${S.label}`;
|
|
601
|
-
if (
|
|
598
|
+
if (g.test(L)) {
|
|
602
599
|
const O = ce(T, L);
|
|
603
600
|
e.matchItems[C].attrValue.push({
|
|
604
601
|
...S,
|
|
605
602
|
...M,
|
|
606
603
|
options: D,
|
|
607
|
-
hightlighStr:
|
|
604
|
+
hightlighStr: _,
|
|
608
605
|
value: S.label,
|
|
609
606
|
match: O
|
|
610
607
|
});
|
|
@@ -625,14 +622,14 @@ function $t({ props: a, state: e, emit: n, nextTick: s }) {
|
|
|
625
622
|
const { options: c } = u, { prevItem: p, propItem: v } = e;
|
|
626
623
|
if (c)
|
|
627
624
|
V(e, !1), e.propItem = { ...e.propItem, value: `${u.label}=` }, e.isShowTagKey = !1, e.inputValue = "", e.backupList = u.options || [], o(), (m = e.backupList) == null || m.forEach((h) => {
|
|
628
|
-
const
|
|
629
|
-
h.isChecked = B(e,
|
|
625
|
+
const g = v.value + h.label;
|
|
626
|
+
h.isChecked = B(e, g);
|
|
630
627
|
});
|
|
631
628
|
else {
|
|
632
629
|
if (u.isChecked)
|
|
633
630
|
return;
|
|
634
631
|
V(e, !1), e.isShowTagKey = !0, o();
|
|
635
|
-
const { field: h, type:
|
|
632
|
+
const { field: h, type: g } = p, y = v.value + u.label, T = K(a, p, u), b = [G({ type: g, field: h, label: v.label, value: y, ...T })];
|
|
636
633
|
P({ emit: n, state: e, nextTick: s, tagList: b });
|
|
637
634
|
}
|
|
638
635
|
f && V(e);
|
|
@@ -649,33 +646,33 @@ function Et({ props: a, state: e, emit: n, nextTick: s }) {
|
|
|
649
646
|
if (t) {
|
|
650
647
|
const c = [], p = j(e.innerModelValue), { mergeTag: v, operators: m, label: h } = r;
|
|
651
648
|
if (v) {
|
|
652
|
-
let
|
|
653
|
-
const y = [], { indexMap: T } = e,
|
|
654
|
-
if (
|
|
649
|
+
let g = "";
|
|
650
|
+
const y = [], { indexMap: T } = e, _ = T.get(h);
|
|
651
|
+
if (_ !== void 0 && e.innerModelValue.splice(_, 1), (u = e.backupList) == null || u.forEach((b) => {
|
|
655
652
|
const { label: x } = b, I = `${h}${x}`;
|
|
656
653
|
if (d.includes(I)) {
|
|
657
654
|
delete b.isFilter;
|
|
658
655
|
const w = K(a, r, b), D = { label: b.label, ...w };
|
|
659
|
-
|
|
656
|
+
g += g ? ` | ${x}` : x, y.push(D);
|
|
660
657
|
}
|
|
661
658
|
}), y.length > 0) {
|
|
662
|
-
const b = { ...i, value:
|
|
659
|
+
const b = { ...i, value: g, options: y };
|
|
663
660
|
c.push(b);
|
|
664
661
|
}
|
|
665
662
|
} else {
|
|
666
|
-
const { valueMap:
|
|
663
|
+
const { valueMap: g } = e, y = [];
|
|
667
664
|
if ((f = e.backupList) == null || f.forEach((T) => {
|
|
668
|
-
const { label:
|
|
669
|
-
if (x && !B(e,
|
|
670
|
-
const I = K(a, r, T), k = e.operatorValue && m ? { operator: e.operatorValue } : null, w = G({ ...i, label: o.label, value:
|
|
665
|
+
const { label: _ } = T, b = `${h}${_}`, x = d.includes(b);
|
|
666
|
+
if (x && !B(e, _)) {
|
|
667
|
+
const I = K(a, r, T), k = e.operatorValue && m ? { operator: e.operatorValue } : null, w = G({ ...i, label: o.label, value: _, ...I, ...k });
|
|
671
668
|
c.push(w), T.isChecked = !0;
|
|
672
|
-
} else if (!x && B(e,
|
|
669
|
+
} else if (!x && B(e, _)) {
|
|
673
670
|
T.isChecked = !1;
|
|
674
|
-
const I =
|
|
671
|
+
const I = g.get(b);
|
|
675
672
|
y.push(I);
|
|
676
673
|
}
|
|
677
674
|
}), y.length) {
|
|
678
|
-
const T = e.innerModelValue.filter((
|
|
675
|
+
const T = e.innerModelValue.filter((_, b) => _ && !y.includes(b));
|
|
679
676
|
P({ emit: n, state: e, nextTick: s, newValue: T, oldValue: p });
|
|
680
677
|
return;
|
|
681
678
|
}
|
|
@@ -709,36 +706,36 @@ function Lt({ props: a, state: e, emit: n, nextTick: s, vm: l }) {
|
|
|
709
706
|
if (c > 0)
|
|
710
707
|
if (p || v)
|
|
711
708
|
if (u && m) {
|
|
712
|
-
const
|
|
713
|
-
return h < y || h >
|
|
709
|
+
const g = new Date(m).getTime(), y = !p && v ? g - c : Math.max(p.getTime(), g - c);
|
|
710
|
+
return h < y || h > g;
|
|
714
711
|
} else if (!u && i) {
|
|
715
|
-
const
|
|
716
|
-
return h <
|
|
712
|
+
const g = new Date(i).getTime(), y = p && !v ? g + c : Math.min(v.getTime(), g + c);
|
|
713
|
+
return h < g || h > y;
|
|
717
714
|
} else
|
|
718
715
|
return p && h < p.getTime() || v && h > v.getTime();
|
|
719
716
|
else if (u && m) {
|
|
720
|
-
const
|
|
721
|
-
return h < y || h >
|
|
717
|
+
const g = new Date(m).getTime(), y = g - c;
|
|
718
|
+
return h < y || h > g;
|
|
722
719
|
} else if (!u && i) {
|
|
723
|
-
const
|
|
724
|
-
return h <
|
|
720
|
+
const g = new Date(i).getTime(), y = g + c;
|
|
721
|
+
return h < g || h > y;
|
|
725
722
|
} else
|
|
726
723
|
return !1;
|
|
727
724
|
else if (p || v)
|
|
728
725
|
if (u && m) {
|
|
729
|
-
const
|
|
730
|
-
return p && h < p.getTime() || h >
|
|
726
|
+
const g = new Date(m).getTime();
|
|
727
|
+
return p && h < p.getTime() || h > g;
|
|
731
728
|
} else if (!u && i) {
|
|
732
|
-
const
|
|
733
|
-
return h <
|
|
729
|
+
const g = new Date(i).getTime();
|
|
730
|
+
return h < g || v && h > v.getTime();
|
|
734
731
|
} else
|
|
735
732
|
return h < p || h > v;
|
|
736
733
|
else if (u && m) {
|
|
737
|
-
const
|
|
738
|
-
return h >
|
|
734
|
+
const g = new Date(m).getTime();
|
|
735
|
+
return h > g;
|
|
739
736
|
} else if (!u && i) {
|
|
740
|
-
const
|
|
741
|
-
return h <
|
|
737
|
+
const g = new Date(i).getTime();
|
|
738
|
+
return h < g;
|
|
742
739
|
} else
|
|
743
740
|
return !1;
|
|
744
741
|
}
|
|
@@ -793,16 +790,16 @@ function Nt({ props: a, state: e, t: n, emit: s, nextTick: l, vm: t }) {
|
|
|
793
790
|
function Rt({ props: a, state: e, t: n, nextTick: s, format: l, emit: t, vm: d }) {
|
|
794
791
|
const r = (p) => {
|
|
795
792
|
var x;
|
|
796
|
-
const { operator: v, value: m, start: h, end:
|
|
797
|
-
if (
|
|
798
|
-
if (
|
|
793
|
+
const { operator: v, value: m, start: h, end: g } = p, { options: y, operators: T, type: _, mergeTag: b } = e.prevItem;
|
|
794
|
+
if (_ !== "custom") {
|
|
795
|
+
if (_ === "numRange")
|
|
799
796
|
Re(e, p, n);
|
|
800
|
-
else if (
|
|
797
|
+
else if (_ === "dateRange") {
|
|
801
798
|
const { dateRangeFormat: I } = e;
|
|
802
|
-
e.startDate = l(h, I), e.endDate = l(
|
|
803
|
-
} else if (
|
|
799
|
+
e.startDate = l(h, I), e.endDate = l(g, I);
|
|
800
|
+
} else if (_ === "datetimeRange") {
|
|
804
801
|
const { datetimeRangeFormat: I } = e;
|
|
805
|
-
e.startDateTime = l(h, I), e.endDateTime = l(
|
|
802
|
+
e.startDateTime = l(h, I), e.endDateTime = l(g, I);
|
|
806
803
|
} else {
|
|
807
804
|
if (b) {
|
|
808
805
|
const I = ((x = p.options) == null ? void 0 : x.flatMap((k) => k.label)) || [];
|
|
@@ -814,8 +811,8 @@ function Rt({ props: a, state: e, t: n, nextTick: s, format: l, emit: t, vm: d }
|
|
|
814
811
|
e.operatorValue = v, e.currentOperators = T;
|
|
815
812
|
}
|
|
816
813
|
}, o = async () => {
|
|
817
|
-
var h,
|
|
818
|
-
if (!((
|
|
814
|
+
var h, g;
|
|
815
|
+
if (!((g = (h = e.instance) == null ? void 0 : h.$refs) != null && g.formRef))
|
|
819
816
|
return;
|
|
820
817
|
const { prevItem: p } = e;
|
|
821
818
|
let v = [];
|
|
@@ -835,9 +832,9 @@ function Rt({ props: a, state: e, t: n, nextTick: s, format: l, emit: t, vm: d }
|
|
|
835
832
|
V(e, !1), e.popoverVisible = !1;
|
|
836
833
|
const h = m.target.classList.contains("tiny-tag") ? m.target : m.srcElement.parentElement;
|
|
837
834
|
s(() => {
|
|
838
|
-
const { popoverRef:
|
|
839
|
-
|
|
840
|
-
}), e.prevItem = e.recordItems.find((
|
|
835
|
+
const { popoverRef: g } = e.instance.$refs;
|
|
836
|
+
g.state.referenceElm = h, g.state.popperElm && (g.state.popperElm.style.display = "none"), g.doDestroy(), e.popoverVisible = !0, o();
|
|
837
|
+
}), e.prevItem = e.recordItems.find((g) => g.field === p.field), !e.prevItem && (e.prevItem = p), e.selectValue = p.label, e.currentModelValueIndex = v, t("tagClick", p), r(p);
|
|
841
838
|
},
|
|
842
839
|
confirmEditTag: async (p) => {
|
|
843
840
|
if (!p) {
|
|
@@ -854,11 +851,11 @@ function Rt({ props: a, state: e, t: n, nextTick: s, format: l, emit: t, vm: d }
|
|
|
854
851
|
}));
|
|
855
852
|
},
|
|
856
853
|
selectItemIsDisable: (p) => {
|
|
857
|
-
var m, h,
|
|
854
|
+
var m, h, g, y;
|
|
858
855
|
if (p.type && p.type === "map")
|
|
859
856
|
return !0;
|
|
860
857
|
if ((m = e.prevItem) != null && m.operators || p.operators)
|
|
861
|
-
return ((h = e.prevItem.operators) == null ? void 0 : h.length) !== ((
|
|
858
|
+
return ((h = e.prevItem.operators) == null ? void 0 : h.length) !== ((g = p.operators) == null ? void 0 : g.length);
|
|
862
859
|
const v = ["radio", "checkbox"];
|
|
863
860
|
return e.prevItem.type && v.includes(e.prevItem.type) ? p.type ? !v.includes(p.type) : !1 : ((y = e.prevItem) == null ? void 0 : y.type) !== p.type;
|
|
864
861
|
},
|
|
@@ -957,7 +954,6 @@ const Pe = {
|
|
|
957
954
|
rangeEndLabel: "结束日期",
|
|
958
955
|
rulekeyword1: "关键字",
|
|
959
956
|
notBeNull: "值不能为空",
|
|
960
|
-
noData: "暂无匹配数据...",
|
|
961
957
|
selectAll: "全选",
|
|
962
958
|
confirm: "确定",
|
|
963
959
|
cancel: "取消",
|
|
@@ -998,7 +994,6 @@ const Pe = {
|
|
|
998
994
|
rangeEndLabel: "End date",
|
|
999
995
|
rulekeyword1: "Keywords",
|
|
1000
996
|
notBeNull: "The value cannot be empty",
|
|
1001
|
-
noData: "There is currently no matching data available ..",
|
|
1002
997
|
selectAll: "Select All",
|
|
1003
998
|
confirm: "Confirm",
|
|
1004
999
|
cancel: "Cancel",
|
|
@@ -1167,7 +1162,7 @@ const fe = (a) => {
|
|
|
1167
1162
|
visibleTimer: null,
|
|
1168
1163
|
hasFormError: !1,
|
|
1169
1164
|
// 表单校验错误状态
|
|
1170
|
-
hasBackupList: e(() => o.propItem.label && [void 0, "radio", "checkbox", "map"].includes(o.prevItem.type)),
|
|
1165
|
+
hasBackupList: e(() => o.propItem.label && [void 0, null, "", "radio", "input", "checkbox", "map"].includes(o.prevItem.type)),
|
|
1171
1166
|
isIndeterminate: e(() => o.checkboxGroup.length > 0 && o.checkboxGroup.length !== o.filterList.length),
|
|
1172
1167
|
checkAll: e({
|
|
1173
1168
|
get: () => o.checkboxGroup.length && o.checkboxGroup.length === o.filterList.length,
|
|
@@ -1185,15 +1180,15 @@ const fe = (a) => {
|
|
|
1185
1180
|
typeof document < "u" && (document.removeEventListener("click", c.watchOutsideClick), document.removeEventListener("mousedown", c.watchMouseDown), document.removeEventListener("mousemove", c.watchMouseMove), v.localeCheckInterval && (clearInterval(v.localeCheckInterval), v.localeCheckInterval = null));
|
|
1186
1181
|
}), c;
|
|
1187
1182
|
}, qt = ({ api: a, state: e, t: n, props: s, emit: l, nextTick: t, vm: d, computed: r }) => {
|
|
1188
|
-
const { deleteTag: o, clearTag: i, backspaceDeleteTag: u } = Ct({ props: s, state: e, emit: l, nextTick: t }), { editTag: f, confirmEditTag: c, selectPropChange: p, selectItemIsDisable: v, checkFormValidation: m } = Rt({ props: s, state: e, t: n, nextTick: t, format: ue, emit: l, vm: d }), { handleInput: h, selectFirstMap:
|
|
1183
|
+
const { deleteTag: o, clearTag: i, backspaceDeleteTag: u } = Ct({ props: s, state: e, emit: l, nextTick: t }), { editTag: f, confirmEditTag: c, selectPropChange: p, selectItemIsDisable: v, checkFormValidation: m } = Rt({ props: s, state: e, t: n, nextTick: t, format: ue, emit: l, vm: d }), { handleInput: h, selectFirstMap: g, cancelHandleInput: y } = $t({ props: s, state: e, emit: l, nextTick: t }), { selectPropItem: T, selectRadioItem: _, selectInputValue: b, createTag: x, helpClick: I, setOperator: k } = Mt({ props: s, emit: l, state: e, t: n, format: ue, nextTick: t, vm: d, cancelHandleInput: y }), { selectCheckbox: w } = Et({ props: s, state: e, emit: l, nextTick: t }), { onConfirmDate: D, handleDateShow: C, pickerOptions: M } = Lt({ props: s, state: e, emit: l, nextTick: t, vm: d }), { sizeChange: $, initFormRule: S } = Nt({ props: s, state: e, t: n, emit: l, nextTick: t, vm: d }), { handleConfirm: L, handleEditConfirm: O } = Pt({ state: e, emit: l, nextTick: t }), { initItems: Z, watchOutsideClick: U, watchMouseDown: F, watchMouseMove: Y, handleClick: X } = Ot({ props: s, state: e }), N = r(() => s.modelValue.length || e.propItem.label || e.inputValue), H = () => ({
|
|
1189
1184
|
selectInputValue: b,
|
|
1190
1185
|
selectPropItem: T,
|
|
1191
|
-
selectRadioItem:
|
|
1186
|
+
selectRadioItem: _,
|
|
1192
1187
|
setOperator: k,
|
|
1193
1188
|
selectCheckbox: w,
|
|
1194
1189
|
sizeChange: $,
|
|
1195
1190
|
onConfirmDate: D,
|
|
1196
|
-
selectFirstMap:
|
|
1191
|
+
selectFirstMap: g,
|
|
1197
1192
|
handleDateShow: C
|
|
1198
1193
|
}), re = (Q) => {
|
|
1199
1194
|
e.placeholder = Q;
|
|
@@ -1295,14 +1290,6 @@ const fe = (a) => {
|
|
|
1295
1290
|
deep: !0,
|
|
1296
1291
|
immediate: !0
|
|
1297
1292
|
}
|
|
1298
|
-
), a(
|
|
1299
|
-
() => e.inputValue,
|
|
1300
|
-
(c) => {
|
|
1301
|
-
!c && !e.propItem.type && (e.visible = !1);
|
|
1302
|
-
},
|
|
1303
|
-
{
|
|
1304
|
-
immediate: !0
|
|
1305
|
-
}
|
|
1306
1293
|
), a(
|
|
1307
1294
|
() => e.popoverVisible,
|
|
1308
1295
|
(c) => {
|
|
@@ -1340,8 +1327,8 @@ const fe = (a) => {
|
|
|
1340
1327
|
if (e.indexMap.clear(), e.valueMap.clear(), c.forEach((p, v) => {
|
|
1341
1328
|
var h;
|
|
1342
1329
|
const m = `${p.label}${p.value}`;
|
|
1343
|
-
e.indexMap.set(p.label, v), e.valueMap.set(m, v), ((h = p.options) == null ? void 0 : h.length) > 0 && p.options.forEach((
|
|
1344
|
-
const y = `${p.label}${
|
|
1330
|
+
e.indexMap.set(p.label, v), e.valueMap.set(m, v), ((h = p.options) == null ? void 0 : h.length) > 0 && p.options.forEach((g) => {
|
|
1331
|
+
const y = `${p.label}${g.label}`;
|
|
1345
1332
|
e.valueMap.set(y, v);
|
|
1346
1333
|
});
|
|
1347
1334
|
}), te(e, !1), c.length === 0 && s.setPlaceholder(ae(n, R)), n.editable && !e.inputEditValue.length && c[0]) {
|
|
@@ -1539,7 +1526,7 @@ const Qt = (a, e, { emit: n }) => {
|
|
|
1539
1526
|
return {
|
|
1540
1527
|
isShowSearchOption: s(() => {
|
|
1541
1528
|
const { inputValue: i, popoverVisible: u, currentOperators: f, propItem: c, prevItem: p } = a.state;
|
|
1542
|
-
return i.trim() && !u && !(f != null && f.length) && (!c.label || [void 0, "radio"].includes(p.type));
|
|
1529
|
+
return i.trim() && !u && !(f != null && f.length) && (!c.label || [void 0, null, "", "radio", "input"].includes(p.type));
|
|
1543
1530
|
}),
|
|
1544
1531
|
selectInputValue: (i) => {
|
|
1545
1532
|
l("selectInputValue", i);
|
|
@@ -1650,7 +1637,7 @@ var la = function() {
|
|
|
1650
1637
|
}
|
|
1651
1638
|
}
|
|
1652
1639
|
}, [e._v(" " + e._s(l) + " ")]);
|
|
1653
|
-
})], 2) : !e.state.prevItem.type || e.state.prevItem.type
|
|
1640
|
+
})], 2) : !e.state.prevItem.type || ["radio", "input"].includes(e.state.prevItem.type) ? s("div", {
|
|
1654
1641
|
directives: [{
|
|
1655
1642
|
name: "loading",
|
|
1656
1643
|
rawName: "v-loading",
|
|
@@ -2087,7 +2074,7 @@ const ra = (a, e, { emit: n, nextTick: s, refs: l }) => {
|
|
|
2087
2074
|
i("selectFirstMap", b, x);
|
|
2088
2075
|
}, h = (b) => {
|
|
2089
2076
|
i("handleDateShow", b);
|
|
2090
|
-
},
|
|
2077
|
+
}, g = t(() => {
|
|
2091
2078
|
var b;
|
|
2092
2079
|
return a.state.hasBackupList && ((b = a.state.backupList) == null ? void 0 : b.length) === 0;
|
|
2093
2080
|
}), y = t(() => {
|
|
@@ -2096,7 +2083,7 @@ const ra = (a, e, { emit: n, nextTick: s, refs: l }) => {
|
|
|
2096
2083
|
}), T = t(() => {
|
|
2097
2084
|
const b = a.state.prevItem.type, x = a.state.backupList || [];
|
|
2098
2085
|
return !b || b === "radio" ? a.state.inputValue ? x.filter((I) => !I.isFilter) : x : x.filter((I) => !I.isFilter);
|
|
2099
|
-
}),
|
|
2086
|
+
}), _ = sa(
|
|
2100
2087
|
{ reactive: d, computed: t },
|
|
2101
2088
|
{
|
|
2102
2089
|
getList: () => T.value,
|
|
@@ -2111,20 +2098,20 @@ const ra = (a, e, { emit: n, nextTick: s, refs: l }) => {
|
|
|
2111
2098
|
return r(
|
|
2112
2099
|
() => a.state.inputValue,
|
|
2113
2100
|
() => {
|
|
2114
|
-
|
|
2101
|
+
_.vsState.scrollTop = 0, s(() => {
|
|
2115
2102
|
l.vsScrollEl && (l.vsScrollEl.scrollTop = 0);
|
|
2116
2103
|
});
|
|
2117
2104
|
}
|
|
2118
2105
|
), r(
|
|
2119
2106
|
() => a.state.prevItem,
|
|
2120
2107
|
() => {
|
|
2121
|
-
|
|
2122
|
-
l.vsScrollEl && (l.vsScrollEl.scrollTop = 0,
|
|
2108
|
+
_.vsState.scrollTop = 0, s(() => {
|
|
2109
|
+
l.vsScrollEl && (l.vsScrollEl.scrollTop = 0, _.handleScroll({ target: l.vsScrollEl }));
|
|
2123
2110
|
});
|
|
2124
2111
|
},
|
|
2125
2112
|
{ deep: !0 }
|
|
2126
2113
|
), o(() => {
|
|
2127
|
-
l.vsScrollEl &&
|
|
2114
|
+
l.vsScrollEl && _.handleScroll({ target: l.vsScrollEl });
|
|
2128
2115
|
}), {
|
|
2129
2116
|
setOperator: u,
|
|
2130
2117
|
selectRadioItem: f,
|
|
@@ -2133,13 +2120,13 @@ const ra = (a, e, { emit: n, nextTick: s, refs: l }) => {
|
|
|
2133
2120
|
onConfirmDate: v,
|
|
2134
2121
|
selectFirstMap: m,
|
|
2135
2122
|
handleDateShow: h,
|
|
2136
|
-
isLoading:
|
|
2123
|
+
isLoading: g,
|
|
2137
2124
|
showCheckBoxList: y,
|
|
2138
|
-
vsTotalHeight:
|
|
2139
|
-
vsStartIndex:
|
|
2140
|
-
vsOffsetY:
|
|
2141
|
-
vsVisibleItems:
|
|
2142
|
-
vsHandleScroll:
|
|
2125
|
+
vsTotalHeight: _.totalHeight,
|
|
2126
|
+
vsStartIndex: _.startIndex,
|
|
2127
|
+
vsOffsetY: _.offsetY,
|
|
2128
|
+
vsVisibleItems: _.visibleItems,
|
|
2129
|
+
vsHandleScroll: _.handleScroll,
|
|
2143
2130
|
t: R
|
|
2144
2131
|
};
|
|
2145
2132
|
}, ia = [
|
|
@@ -2946,7 +2933,7 @@ const ga = /* @__PURE__ */ function() {
|
|
|
2946
2933
|
name: ve + "SearchBox",
|
|
2947
2934
|
props: _a,
|
|
2948
2935
|
...ga
|
|
2949
|
-
}), xa = "3.29.
|
|
2936
|
+
}), xa = "3.29.1";
|
|
2950
2937
|
J.install = function(a) {
|
|
2951
2938
|
const e = a;
|
|
2952
2939
|
e && e.config && e.config.globalProperties && fe(e), e && e.mixin && !e.__TINY_SEARCH_BOX_I18N_MIXIN__ && (e.__TINY_SEARCH_BOX_I18N_MIXIN__ = !0, e.mixin({
|