@farris/ui-vue 1.0.0 → 1.0.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/combo-list/index.esm.js +495 -493
- package/combo-list/index.umd.js +1 -1
- package/condition/index.esm.js +1927 -1925
- package/condition/index.umd.js +1 -1
- package/data-grid/index.esm.js +1927 -1925
- package/data-grid/index.umd.js +1 -1
- package/designer-canvas/index.esm.js +1630 -1628
- package/designer-canvas/index.umd.js +1 -1
- package/dynamic-form/index.esm.js +1927 -1925
- package/dynamic-form/index.umd.js +1 -1
- package/dynamic-view/index.esm.js +1158 -1156
- package/dynamic-view/index.umd.js +1 -1
- package/farris.all.esm.js +2180 -2178
- package/farris.all.umd.js +5 -5
- package/order/index.esm.js +598 -596
- package/order/index.umd.js +1 -1
- package/package.json +4 -4
package/combo-list/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as a, computed as
|
|
1
|
+
import { ref as a, computed as I, watch as W, defineComponent as G, createVNode as p, withDirectives as Q, vModelCheckbox as Me, Fragment as re, withModifiers as Fe, vModelText as Oe, Teleport as de, createApp as Ve, onUnmounted as fe, nextTick as K, vShow as ve, onMounted as ne, mergeProps as Le, inject as De } from "vue";
|
|
2
2
|
const pe = {};
|
|
3
3
|
function oe(e) {
|
|
4
4
|
const { properties: t } = e;
|
|
@@ -308,40 +308,40 @@ const ae = {
|
|
|
308
308
|
disableField: { type: String, default: "disabled" }
|
|
309
309
|
};
|
|
310
310
|
function Ye(e, t, o, l, n) {
|
|
311
|
-
const i = a(e.idField), u = a(e.disableField), c = a(e.draggable), h = a(e.itemClass), s = a(e.multiSelect),
|
|
311
|
+
const i = a(e.idField), u = a(e.disableField), c = a(e.draggable), h = a(e.itemClass), s = a(e.multiSelect), r = a(e.multiSelectMode);
|
|
312
312
|
a(!0);
|
|
313
|
-
const { isDragging:
|
|
314
|
-
function x(
|
|
313
|
+
const { isDragging: d } = o, { activeIndex: f, focusedItemId: C, hoverIndex: m } = l, { clearSelection: y, selectedItems: O, toggleSelectItem: P } = n;
|
|
314
|
+
function x(w, j) {
|
|
315
315
|
const V = {
|
|
316
316
|
"f-list-view-group-item": !0,
|
|
317
317
|
"f-list-view-draggable-item": c.value,
|
|
318
|
-
"f-un-click": !!
|
|
319
|
-
"f-un-select": !!
|
|
320
|
-
"f-listview-active":
|
|
321
|
-
"f-listview-hover": !
|
|
322
|
-
moving: !!
|
|
318
|
+
"f-un-click": !!w.unClick,
|
|
319
|
+
"f-un-select": !!w[u.value],
|
|
320
|
+
"f-listview-active": w.__fv_index__ === f.value,
|
|
321
|
+
"f-listview-hover": !d.value && j === m.value,
|
|
322
|
+
moving: !!w.moving
|
|
323
323
|
};
|
|
324
324
|
return h.value.split(" ").reduce((z, D) => (z[D] = !0, z), V), V;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
return
|
|
326
|
+
function v(w, j) {
|
|
327
|
+
return w[i.value] || "";
|
|
328
328
|
}
|
|
329
|
-
const
|
|
330
|
-
function
|
|
331
|
-
|
|
329
|
+
const b = I(() => !s.value);
|
|
330
|
+
function B(w, j) {
|
|
331
|
+
w.unClick || w[u.value] || (b.value && (C.value = w[i.value]), P(w, j));
|
|
332
332
|
}
|
|
333
|
-
const k =
|
|
334
|
-
function L(
|
|
333
|
+
const k = I(() => s.value && r.value === "OnCheckClearByClick"), E = I(() => !s.value || s.value && (r.value === "OnCheckAndClick" || r.value === "OnClick"));
|
|
334
|
+
function L(w, j, V) {
|
|
335
335
|
if (j.unClick || j[u.value]) {
|
|
336
|
-
|
|
336
|
+
w.preventDefault(), w.stopPropagation();
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
C.value = j[i.value], f.value = V, k.value && y(), E.value && P(j, V), t.emit("clickItem", { data: O.value, index: V });
|
|
340
340
|
}
|
|
341
341
|
return {
|
|
342
|
-
getKey:
|
|
342
|
+
getKey: v,
|
|
343
343
|
listViewItemClass: x,
|
|
344
|
-
onCheckItem:
|
|
344
|
+
onCheckItem: B,
|
|
345
345
|
onClickItem: L
|
|
346
346
|
};
|
|
347
347
|
}
|
|
@@ -349,27 +349,27 @@ function Ze(e, t, o) {
|
|
|
349
349
|
const l = a(e.idField), n = a(e.multiSelect);
|
|
350
350
|
a(e.multiSelectMode);
|
|
351
351
|
const { getSelectionItems: i } = o, u = a(i(e.selectionValues));
|
|
352
|
-
W(() => e.selectionValues, (
|
|
353
|
-
u.value = a(i(
|
|
352
|
+
W(() => e.selectionValues, (f) => {
|
|
353
|
+
u.value = a(i(f)).value;
|
|
354
354
|
});
|
|
355
|
-
const c =
|
|
356
|
-
function h(
|
|
357
|
-
return
|
|
355
|
+
const c = I(() => !n.value);
|
|
356
|
+
function h(f) {
|
|
357
|
+
return f[l.value] || "";
|
|
358
358
|
}
|
|
359
|
-
function s(
|
|
360
|
-
return u.value.findIndex((m) => h(m) === h(
|
|
359
|
+
function s(f) {
|
|
360
|
+
return u.value.findIndex((m) => h(m) === h(f));
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
u.value.forEach((
|
|
364
|
-
|
|
362
|
+
function r() {
|
|
363
|
+
u.value.forEach((f) => {
|
|
364
|
+
f.checked = !1;
|
|
365
365
|
}), u.value = [];
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
c.value &&
|
|
369
|
-
const m = s(
|
|
370
|
-
m > -1 ? (u.value.splice(m, 1),
|
|
367
|
+
function d(f, C) {
|
|
368
|
+
c.value && r();
|
|
369
|
+
const m = s(f);
|
|
370
|
+
m > -1 ? (u.value.splice(m, 1), f.checked = !1) : (u.value.push(f), f.checked = !0), t.emit("selectionChange", u.value);
|
|
371
371
|
}
|
|
372
|
-
return { clearSelection:
|
|
372
|
+
return { clearSelection: r, findIndexInSelectedItems: s, selectedItems: u, toggleSelectItem: d };
|
|
373
373
|
}
|
|
374
374
|
function et(e, t) {
|
|
375
375
|
function o(i) {
|
|
@@ -381,18 +381,18 @@ function et(e, t) {
|
|
|
381
381
|
}
|
|
382
382
|
function l(i, u) {
|
|
383
383
|
const c = document.createTreeWalker(i, NodeFilter.SHOW_TEXT);
|
|
384
|
-
return o(c).map((
|
|
385
|
-
const
|
|
384
|
+
return o(c).map((d) => ({ textNode: d, text: (d.textContent || "").toLocaleLowerCase() })).map(({ textNode: d, text: f }) => {
|
|
385
|
+
const C = [];
|
|
386
386
|
let m = 0;
|
|
387
|
-
for (; m <
|
|
388
|
-
const
|
|
389
|
-
if (
|
|
387
|
+
for (; m < f.length; ) {
|
|
388
|
+
const y = f.indexOf(u, m);
|
|
389
|
+
if (y === -1)
|
|
390
390
|
break;
|
|
391
|
-
|
|
391
|
+
C.push(y), m = y + u.length;
|
|
392
392
|
}
|
|
393
|
-
return
|
|
394
|
-
const
|
|
395
|
-
return
|
|
393
|
+
return C.map((y) => {
|
|
394
|
+
const O = new Range();
|
|
395
|
+
return O.setStart(d, y), O.setEnd(d, y + u.length), O;
|
|
396
396
|
});
|
|
397
397
|
}).flat();
|
|
398
398
|
}
|
|
@@ -443,85 +443,85 @@ const tt = {
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
function se(e, t, o, l, n, i, u, c) {
|
|
446
|
-
const h = a(e.size), s = a(e.textField),
|
|
447
|
-
onMouseenterItem:
|
|
448
|
-
onMouseoverItem:
|
|
446
|
+
const h = a(e.size), s = a(e.textField), r = a(e.multiSelect), d = a(e.disableField), {
|
|
447
|
+
onMouseenterItem: f,
|
|
448
|
+
onMouseoverItem: C,
|
|
449
449
|
onMouseoutItem: m
|
|
450
450
|
} = n, {
|
|
451
|
-
getKey:
|
|
452
|
-
listViewItemClass:
|
|
453
|
-
onCheckItem:
|
|
451
|
+
getKey: y,
|
|
452
|
+
listViewItemClass: O,
|
|
453
|
+
onCheckItem: P,
|
|
454
454
|
onClickItem: x
|
|
455
|
-
} = i,
|
|
455
|
+
} = i, v = I(() => ({
|
|
456
456
|
margin: h.value === "small" ? "0.25rem 0" : "10px 0"
|
|
457
457
|
}));
|
|
458
|
-
function
|
|
459
|
-
return
|
|
460
|
-
class:
|
|
461
|
-
id:
|
|
462
|
-
key:
|
|
463
|
-
onClick: (L) => x(L,
|
|
464
|
-
onMouseenter: (L) =>
|
|
465
|
-
onMouseover: (L) =>
|
|
466
|
-
onMouseout: (L) => m(L,
|
|
467
|
-
}, [
|
|
458
|
+
function b(B, k, E) {
|
|
459
|
+
return B.checked = u.findIndexInSelectedItems(B) > -1, p("li", {
|
|
460
|
+
class: O(B, k),
|
|
461
|
+
id: y(B, k),
|
|
462
|
+
key: y(B, k),
|
|
463
|
+
onClick: (L) => x(L, B, k),
|
|
464
|
+
onMouseenter: (L) => f(L, B, k),
|
|
465
|
+
onMouseover: (L) => C(L, B, k),
|
|
466
|
+
onMouseout: (L) => m(L, B, k)
|
|
467
|
+
}, [r.value && p("div", {
|
|
468
468
|
class: "f-list-select",
|
|
469
469
|
onClick: (L) => L.stopPropagation()
|
|
470
470
|
}, [p(le, {
|
|
471
|
-
id: "list-" +
|
|
472
|
-
disabled:
|
|
473
|
-
checked:
|
|
474
|
-
onChange: (L) =>
|
|
471
|
+
id: "list-" + y(B, k),
|
|
472
|
+
disabled: B[d.value] || B.unClick,
|
|
473
|
+
checked: B.checked,
|
|
474
|
+
onChange: (L) => P(B, k)
|
|
475
475
|
}, null)]), p("div", {
|
|
476
476
|
class: "f-list-content"
|
|
477
477
|
}, [p("div", {
|
|
478
|
-
style:
|
|
479
|
-
}, [
|
|
478
|
+
style: v.value
|
|
479
|
+
}, [B[s.value]])])]);
|
|
480
480
|
}
|
|
481
481
|
return {
|
|
482
|
-
renderItem:
|
|
482
|
+
renderItem: b
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
485
|
function nt(e, t, o, l, n, i, u, c) {
|
|
486
486
|
const h = a(e.multiSelect), s = a(e.disableField), {
|
|
487
|
-
onMouseenterItem:
|
|
488
|
-
onMouseoverItem:
|
|
489
|
-
onMouseoutItem:
|
|
487
|
+
onMouseenterItem: r,
|
|
488
|
+
onMouseoverItem: d,
|
|
489
|
+
onMouseoutItem: f
|
|
490
490
|
} = n, {
|
|
491
|
-
getKey:
|
|
491
|
+
getKey: C,
|
|
492
492
|
listViewItemClass: m,
|
|
493
|
-
onCheckItem:
|
|
494
|
-
onClickItem:
|
|
493
|
+
onCheckItem: y,
|
|
494
|
+
onClickItem: O
|
|
495
495
|
} = i;
|
|
496
|
-
function
|
|
496
|
+
function P(v, b, B) {
|
|
497
497
|
return t.slots.content ? p(re, null, [t.slots.content && t.slots.content({
|
|
498
|
-
item:
|
|
499
|
-
index:
|
|
500
|
-
selectedItem:
|
|
498
|
+
item: v,
|
|
499
|
+
index: b,
|
|
500
|
+
selectedItem: B
|
|
501
501
|
})]) : p("div", {
|
|
502
502
|
style: "margin: 10px 0;"
|
|
503
|
-
}, [
|
|
503
|
+
}, [v.name]);
|
|
504
504
|
}
|
|
505
|
-
function x(
|
|
505
|
+
function x(v, b, B) {
|
|
506
506
|
return p("li", {
|
|
507
|
-
class: m(
|
|
508
|
-
id:
|
|
509
|
-
key:
|
|
510
|
-
onClick: (k) =>
|
|
511
|
-
onMouseenter: (k) =>
|
|
512
|
-
onMouseover: (k) =>
|
|
513
|
-
onMouseout: (k) =>
|
|
507
|
+
class: m(v, b),
|
|
508
|
+
id: C(v, b),
|
|
509
|
+
key: C(v, b),
|
|
510
|
+
onClick: (k) => O(k, v, b),
|
|
511
|
+
onMouseenter: (k) => r(k, v, b),
|
|
512
|
+
onMouseover: (k) => d(k, v, b),
|
|
513
|
+
onMouseout: (k) => f(k, v, b)
|
|
514
514
|
}, [h.value && p("div", {
|
|
515
515
|
class: "f-list-select",
|
|
516
516
|
onClick: (k) => k.stopPropagation()
|
|
517
517
|
}, [p(le, {
|
|
518
|
-
id: "list-" +
|
|
519
|
-
disabled:
|
|
520
|
-
checked:
|
|
521
|
-
onChange: (k) => v
|
|
518
|
+
id: "list-" + C(v, b),
|
|
519
|
+
disabled: v[s.value] || v.unClick,
|
|
520
|
+
checked: v.checked,
|
|
521
|
+
onChange: (k) => y(v, b)
|
|
522
522
|
}, null)]), p("div", {
|
|
523
523
|
class: "f-list-content"
|
|
524
|
-
}, [
|
|
524
|
+
}, [P(v, b, B)])]);
|
|
525
525
|
}
|
|
526
526
|
return {
|
|
527
527
|
renderItem: x
|
|
@@ -529,22 +529,22 @@ function nt(e, t, o, l, n, i, u, c) {
|
|
|
529
529
|
}
|
|
530
530
|
function ot(e, t, o, l, n, i, u, c) {
|
|
531
531
|
const h = a(e.multiSelect), s = a(e.disableField), {
|
|
532
|
-
onMouseenterItem:
|
|
533
|
-
onMouseoverItem:
|
|
534
|
-
onMouseoutItem:
|
|
532
|
+
onMouseenterItem: r,
|
|
533
|
+
onMouseoverItem: d,
|
|
534
|
+
onMouseoutItem: f
|
|
535
535
|
} = n, {
|
|
536
|
-
getKey:
|
|
536
|
+
getKey: C,
|
|
537
537
|
listViewItemClass: m,
|
|
538
|
-
onCheckItem:
|
|
539
|
-
onClickItem:
|
|
538
|
+
onCheckItem: y,
|
|
539
|
+
onClickItem: O
|
|
540
540
|
} = i, {
|
|
541
|
-
dragstart:
|
|
541
|
+
dragstart: P,
|
|
542
542
|
dragenter: x,
|
|
543
|
-
dragover:
|
|
544
|
-
dragend:
|
|
543
|
+
dragover: v,
|
|
544
|
+
dragend: b
|
|
545
545
|
} = l, {
|
|
546
|
-
removeItem:
|
|
547
|
-
} = c, k =
|
|
546
|
+
removeItem: B
|
|
547
|
+
} = c, k = I(() => ({
|
|
548
548
|
margin: h.value ? "10px 0" : "10px 0px 10px 14px"
|
|
549
549
|
}));
|
|
550
550
|
function E(V) {
|
|
@@ -555,34 +555,34 @@ function ot(e, t, o, l, n, i, u, c) {
|
|
|
555
555
|
function L() {
|
|
556
556
|
return t.slots.itemContent ? t.slots.itemContent : E;
|
|
557
557
|
}
|
|
558
|
-
const
|
|
558
|
+
const w = L();
|
|
559
559
|
function j(V, R, z) {
|
|
560
560
|
return p("li", {
|
|
561
561
|
class: m(V, R),
|
|
562
|
-
id:
|
|
563
|
-
key:
|
|
564
|
-
onClick: (D) =>
|
|
565
|
-
onMouseenter: (D) =>
|
|
566
|
-
onMouseover: (D) =>
|
|
567
|
-
onMouseout: (D) =>
|
|
562
|
+
id: C(V, R),
|
|
563
|
+
key: C(V, R),
|
|
564
|
+
onClick: (D) => O(D, V, R),
|
|
565
|
+
onMouseenter: (D) => r(D, V, R),
|
|
566
|
+
onMouseover: (D) => d(D, V, R),
|
|
567
|
+
onMouseout: (D) => f(D, V, R),
|
|
568
568
|
draggable: "true",
|
|
569
|
-
onDragstart: (D) =>
|
|
569
|
+
onDragstart: (D) => P(D, V, R),
|
|
570
570
|
onDragenter: (D) => x(D, R),
|
|
571
|
-
onDragend: (D) =>
|
|
572
|
-
onDragover: (D) =>
|
|
571
|
+
onDragend: (D) => b(D, V),
|
|
572
|
+
onDragover: (D) => v(D, R)
|
|
573
573
|
}, [h.value && p("div", {
|
|
574
574
|
class: "f-list-select",
|
|
575
575
|
onClick: (D) => D.stopPropagation()
|
|
576
576
|
}, [p(le, {
|
|
577
|
-
id: "list-" +
|
|
577
|
+
id: "list-" + C(V, R),
|
|
578
578
|
disabled: V[s.value] || V.unClick,
|
|
579
579
|
checked: V.checked,
|
|
580
|
-
onChange: (D) =>
|
|
580
|
+
onChange: (D) => y(V, R)
|
|
581
581
|
}, null)]), p("div", {
|
|
582
582
|
class: "f-list-content"
|
|
583
|
-
}, [
|
|
583
|
+
}, [w(V)]), p("div", {
|
|
584
584
|
class: "f-list-remove",
|
|
585
|
-
onClick: (D) =>
|
|
585
|
+
onClick: (D) => B(R)
|
|
586
586
|
}, [p("div", {
|
|
587
587
|
class: "f-list-remove-icon"
|
|
588
588
|
}, [p("i", {
|
|
@@ -608,26 +608,26 @@ function at(e, t, o) {
|
|
|
608
608
|
};
|
|
609
609
|
}
|
|
610
610
|
function ce(e, t, o) {
|
|
611
|
-
const l = a(e.headerClass), n = a(e.placeholder), i = a(""), u =
|
|
612
|
-
function h(
|
|
611
|
+
const l = a(e.headerClass), n = a(e.placeholder), i = a(""), u = I(() => !i.value), c = I(() => !!i.value);
|
|
612
|
+
function h(f) {
|
|
613
613
|
i.value = "";
|
|
614
614
|
}
|
|
615
|
-
W(i, (
|
|
616
|
-
o.search(
|
|
615
|
+
W(i, (f) => {
|
|
616
|
+
o.search(f);
|
|
617
617
|
});
|
|
618
|
-
const s =
|
|
619
|
-
const
|
|
618
|
+
const s = I(() => {
|
|
619
|
+
const f = {
|
|
620
620
|
"form-group": !0,
|
|
621
621
|
"farris-form-group": !0
|
|
622
622
|
};
|
|
623
|
-
return l.value && l.value.split(" ").reduce((m,
|
|
623
|
+
return l.value && l.value.split(" ").reduce((m, y) => (m[y] = !0, m), f), f;
|
|
624
624
|
});
|
|
625
|
-
function f
|
|
625
|
+
function r(f) {
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function d() {
|
|
628
628
|
return p("div", {
|
|
629
629
|
class: "f-list-view-header",
|
|
630
|
-
onClick: Fe(
|
|
630
|
+
onClick: Fe(r, ["prevent", "stop"])
|
|
631
631
|
}, [p("div", {
|
|
632
632
|
class: s.value
|
|
633
633
|
}, [p("div", {
|
|
@@ -638,7 +638,7 @@ function ce(e, t, o) {
|
|
|
638
638
|
class: "input-group f-state-editable"
|
|
639
639
|
}, [Q(p("input", {
|
|
640
640
|
class: "form-control f-utils-fill text-left",
|
|
641
|
-
"onUpdate:modelValue": (
|
|
641
|
+
"onUpdate:modelValue": (f) => i.value = f,
|
|
642
642
|
name: "input-group-value",
|
|
643
643
|
type: "text",
|
|
644
644
|
placeholder: n.value,
|
|
@@ -647,7 +647,7 @@ function ce(e, t, o) {
|
|
|
647
647
|
class: "input-group-append"
|
|
648
648
|
}, [c.value && p("span", {
|
|
649
649
|
class: "input-group-text input-group-clear",
|
|
650
|
-
onClick: (
|
|
650
|
+
onClick: (f) => h()
|
|
651
651
|
}, [p("i", {
|
|
652
652
|
class: "f-icon f-icon-close-circle"
|
|
653
653
|
}, null)]), u.value && p("span", {
|
|
@@ -657,13 +657,13 @@ function ce(e, t, o) {
|
|
|
657
657
|
}, null)])])])])])])]);
|
|
658
658
|
}
|
|
659
659
|
return {
|
|
660
|
-
renderHeader:
|
|
660
|
+
renderHeader: d
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
function lt(e, t) {
|
|
664
664
|
const o = a(e.idField), l = a(e.data), n = a(e.data), i = a(e.keepOrder);
|
|
665
665
|
function u() {
|
|
666
|
-
const s = l.value.map((
|
|
666
|
+
const s = l.value.map((r, d) => typeof r != "object" ? { __fv_index__: d, name: r } : (r.__fv_index__ = d, r));
|
|
667
667
|
return n.value = s, s;
|
|
668
668
|
}
|
|
669
669
|
const c = a(u());
|
|
@@ -671,18 +671,18 @@ function lt(e, t) {
|
|
|
671
671
|
() => e.data,
|
|
672
672
|
(s) => {
|
|
673
673
|
if (i.value) {
|
|
674
|
-
const
|
|
675
|
-
l.value = [...
|
|
674
|
+
const r = s.reduce((m, y) => (m.set(y.id, !0), m), /* @__PURE__ */ new Map()), d = l.value.reduce((m, y) => (m.set(y.id, !0), m), /* @__PURE__ */ new Map()), f = c.value.filter((m) => r.has(m.id)), C = s.filter((m) => !d.has(m.id));
|
|
675
|
+
l.value = [...f, ...C];
|
|
676
676
|
} else
|
|
677
677
|
l.value = s;
|
|
678
678
|
c.value = u();
|
|
679
679
|
}
|
|
680
680
|
);
|
|
681
681
|
function h(s) {
|
|
682
|
-
return s.map((
|
|
683
|
-
const
|
|
684
|
-
return
|
|
685
|
-
}).filter((
|
|
682
|
+
return s.map((d) => {
|
|
683
|
+
const f = n.value.findIndex((C) => C[o.value] === d);
|
|
684
|
+
return f > -1 ? n.value[f] : null;
|
|
685
|
+
}).filter((d) => d != null);
|
|
686
686
|
}
|
|
687
687
|
return {
|
|
688
688
|
dataView: c,
|
|
@@ -690,31 +690,31 @@ function lt(e, t) {
|
|
|
690
690
|
};
|
|
691
691
|
}
|
|
692
692
|
function ut(e, t, o, l) {
|
|
693
|
-
const n = a(e.idField), { dataView: i } = o, u = a(-1), c = a(!1), { activeIndex: h, focusedItemId: s, hoverIndex:
|
|
694
|
-
function
|
|
695
|
-
|
|
696
|
-
u.value =
|
|
693
|
+
const n = a(e.idField), { dataView: i } = o, u = a(-1), c = a(!1), { activeIndex: h, focusedItemId: s, hoverIndex: r, resumeHover: d, suspendHover: f } = l;
|
|
694
|
+
function C(P, x, v) {
|
|
695
|
+
P.stopPropagation(), f(), x && setTimeout(() => {
|
|
696
|
+
u.value = v, c.value = !0, x.moving = !0;
|
|
697
697
|
});
|
|
698
698
|
}
|
|
699
|
-
function m(
|
|
700
|
-
if (
|
|
701
|
-
const
|
|
702
|
-
|
|
699
|
+
function m(P, x) {
|
|
700
|
+
if (P.preventDefault(), u.value !== x) {
|
|
701
|
+
const v = i.value[u.value], b = i.value;
|
|
702
|
+
b.splice(u.value, 1), b.splice(x, 0, v), u.value = x;
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
|
|
705
|
+
function y(P, x) {
|
|
706
|
+
P.preventDefault(), P.dataTransfer && (P.dataTransfer.dropEffect = "move");
|
|
707
707
|
}
|
|
708
|
-
function P
|
|
709
|
-
x && (x.moving = !1), i.value.forEach((
|
|
710
|
-
|
|
711
|
-
}), c.value = !1,
|
|
708
|
+
function O(P, x) {
|
|
709
|
+
x && (x.moving = !1), i.value.forEach((v, b) => {
|
|
710
|
+
v.__fv_index__ = b;
|
|
711
|
+
}), c.value = !1, d(), r.value = x.__fv_index__, h.value = x.__fv_index__, s.value = x[n.value], t.emit("change", i.value);
|
|
712
712
|
}
|
|
713
713
|
return {
|
|
714
|
-
dragstart:
|
|
714
|
+
dragstart: C,
|
|
715
715
|
dragenter: m,
|
|
716
|
-
dragover:
|
|
717
|
-
dragend:
|
|
716
|
+
dragover: y,
|
|
717
|
+
dragend: O,
|
|
718
718
|
isDragging: c
|
|
719
719
|
};
|
|
720
720
|
}
|
|
@@ -730,13 +730,13 @@ function it(e, t, o) {
|
|
|
730
730
|
}
|
|
731
731
|
function st() {
|
|
732
732
|
const e = a(-1), t = a(""), o = a(-1), l = a(!1);
|
|
733
|
-
function n(s,
|
|
734
|
-
o.value =
|
|
733
|
+
function n(s, r, d) {
|
|
734
|
+
o.value = d;
|
|
735
735
|
}
|
|
736
|
-
function i(s,
|
|
737
|
-
l.value || (o.value =
|
|
736
|
+
function i(s, r, d) {
|
|
737
|
+
l.value || (o.value = d);
|
|
738
738
|
}
|
|
739
|
-
function u(s,
|
|
739
|
+
function u(s, r, d) {
|
|
740
740
|
o.value = -1;
|
|
741
741
|
}
|
|
742
742
|
function c() {
|
|
@@ -763,50 +763,50 @@ const ct = /* @__PURE__ */ G({
|
|
|
763
763
|
setup(e, t) {
|
|
764
764
|
const o = a(), l = a(e.view), n = a(e.header), i = a(e.multiSelect), u = a(e.view === "CardView"), c = a(!0), h = a({}), s = a("暂无数据");
|
|
765
765
|
a(!0), a(!1), a("id");
|
|
766
|
-
const
|
|
767
|
-
dataView:
|
|
768
|
-
} =
|
|
766
|
+
const r = lt(e), {
|
|
767
|
+
dataView: d
|
|
768
|
+
} = r, f = I(() => {
|
|
769
769
|
const M = {
|
|
770
770
|
"f-list-view": !0,
|
|
771
771
|
"f-list-view-multiple": i.value
|
|
772
772
|
};
|
|
773
773
|
return e.size !== "default" && (M[`${e.size}-item`] = !0), M;
|
|
774
|
-
}),
|
|
774
|
+
}), C = I(() => ({
|
|
775
775
|
"f-list-view-group": !0,
|
|
776
776
|
"d-flex": u.value,
|
|
777
777
|
"flex-wrap": u.value
|
|
778
|
-
})), m =
|
|
778
|
+
})), m = I(() => !!d.value && d.value.length > 0), y = st(), O = Ze(e, t, r), P = ut(e, t, r, y), x = it(e, t, r), v = Ye(e, t, P, y, O), b = et(e, o), B = I(() => d.value.length === 0), k = I(() => B.value && !t.slots.empty), E = I(() => !!t.slots.footer || c.value);
|
|
779
779
|
function L() {
|
|
780
780
|
return l.value === "SingleView" ? se : l.value === "DraggableView" ? ot : l.value === "ContentView" && t.slots.content ? nt : se;
|
|
781
781
|
}
|
|
782
|
-
const
|
|
782
|
+
const w = L(), {
|
|
783
783
|
renderItem: j
|
|
784
|
-
} =
|
|
784
|
+
} = w(e, t, r, P, y, v, O, x);
|
|
785
785
|
function V() {
|
|
786
786
|
return n.value === "SearchBar" ? ce : n.value === "ContentHeader" ? at : ce;
|
|
787
787
|
}
|
|
788
788
|
const R = V(), {
|
|
789
789
|
renderHeader: z
|
|
790
|
-
} = R(e, t,
|
|
790
|
+
} = R(e, t, b);
|
|
791
791
|
function D(M) {
|
|
792
|
-
|
|
792
|
+
b.search(M);
|
|
793
793
|
}
|
|
794
794
|
t.expose({
|
|
795
795
|
search: D
|
|
796
796
|
});
|
|
797
|
-
function
|
|
797
|
+
function F(M) {
|
|
798
798
|
i.value && (M.preventDefault(), M.stopPropagation());
|
|
799
799
|
}
|
|
800
800
|
return () => p("div", {
|
|
801
|
-
class:
|
|
802
|
-
onClick:
|
|
801
|
+
class: f.value,
|
|
802
|
+
onClick: F
|
|
803
803
|
}, [z(), p("div", {
|
|
804
804
|
ref: o,
|
|
805
805
|
class: "f-list-view-content"
|
|
806
806
|
}, [p("ul", {
|
|
807
|
-
class:
|
|
807
|
+
class: C.value,
|
|
808
808
|
style: "list-style: none;"
|
|
809
|
-
}, [m.value &&
|
|
809
|
+
}, [m.value && d.value.map((M, A) => j(M, A, h)), k.value && p("div", {
|
|
810
810
|
class: "f-list-view-emptydata"
|
|
811
811
|
}, [p("p", {
|
|
812
812
|
class: "f-empty-title"
|
|
@@ -823,7 +823,7 @@ const ct = /* @__PURE__ */ G({
|
|
|
823
823
|
W(e.dataSource, () => {
|
|
824
824
|
o.value = e.dataSource;
|
|
825
825
|
});
|
|
826
|
-
const u =
|
|
826
|
+
const u = I(() => e.enableSearch ? "SearchBar" : "ContentHeader");
|
|
827
827
|
function c(h) {
|
|
828
828
|
l.value = h.map((s) => Object.assign({}, s)), i.value = h.map((s) => s[e.idField]), t.emit("selectionChange", l.value);
|
|
829
829
|
}
|
|
@@ -1145,21 +1145,21 @@ const Ct = {
|
|
|
1145
1145
|
function n(c) {
|
|
1146
1146
|
t.emit("click"), c.preventDefault(), c.stopPropagation();
|
|
1147
1147
|
}
|
|
1148
|
-
const i =
|
|
1148
|
+
const i = I(() => {
|
|
1149
1149
|
const c = l.value;
|
|
1150
1150
|
if (c) {
|
|
1151
1151
|
const h = c.getBoundingClientRect(), {
|
|
1152
1152
|
left: s,
|
|
1153
|
-
top:
|
|
1154
|
-
height:
|
|
1153
|
+
top: r,
|
|
1154
|
+
height: d
|
|
1155
1155
|
} = h;
|
|
1156
1156
|
return {
|
|
1157
1157
|
left: s,
|
|
1158
|
-
top:
|
|
1158
|
+
top: r + d
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
return o.value;
|
|
1162
|
-
}), u =
|
|
1162
|
+
}), u = I(() => ({
|
|
1163
1163
|
position: "relative",
|
|
1164
1164
|
left: `${i.value.left}px`,
|
|
1165
1165
|
top: `${i.value.top}px`
|
|
@@ -1216,53 +1216,53 @@ class Bt {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
1218
|
function It(e, t, o, l) {
|
|
1219
|
-
const n = a(e.buttonBehavior), i = a(e.popupOnInput), u =
|
|
1219
|
+
const n = a(e.buttonBehavior), i = a(e.popupOnInput), u = I(() => ({
|
|
1220
1220
|
"input-group-append": !0,
|
|
1221
1221
|
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
1222
|
-
})), c =
|
|
1223
|
-
async function h(
|
|
1222
|
+
})), c = I(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable);
|
|
1223
|
+
async function h(f) {
|
|
1224
1224
|
if (c.value) {
|
|
1225
|
-
const
|
|
1225
|
+
const C = !!t.slots.default;
|
|
1226
1226
|
n.value === "Overlay" && Bt.show({
|
|
1227
1227
|
host: o.value,
|
|
1228
1228
|
render: () => {
|
|
1229
1229
|
if (t.slots.default)
|
|
1230
1230
|
return t.slots.default();
|
|
1231
1231
|
}
|
|
1232
|
-
}),
|
|
1232
|
+
}), C && n.value === "Popup" && l.togglePopup(), C && i.value && l.hidePopup(), t.emit("clickButton", { origin: f, value: e.modelValue });
|
|
1233
1233
|
}
|
|
1234
|
-
|
|
1234
|
+
f.stopPropagation();
|
|
1235
1235
|
}
|
|
1236
|
-
function s(
|
|
1237
|
-
t.emit("mouseEnterIcon",
|
|
1236
|
+
function s(f) {
|
|
1237
|
+
t.emit("mouseEnterIcon", f);
|
|
1238
1238
|
}
|
|
1239
|
-
function f
|
|
1240
|
-
t.emit("mouseLeaveIcon",
|
|
1239
|
+
function r(f) {
|
|
1240
|
+
t.emit("mouseLeaveIcon", f);
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function d() {
|
|
1243
1243
|
t.emit("mouseOverButton");
|
|
1244
1244
|
}
|
|
1245
1245
|
return {
|
|
1246
1246
|
buttonClass: u,
|
|
1247
1247
|
onClickButton: h,
|
|
1248
1248
|
onMouseEnterButton: s,
|
|
1249
|
-
onMouseLeaveButton:
|
|
1250
|
-
onMouseOverButton:
|
|
1249
|
+
onMouseLeaveButton: r,
|
|
1250
|
+
onMouseOverButton: d
|
|
1251
1251
|
};
|
|
1252
1252
|
}
|
|
1253
1253
|
function kt(e, t, o, l, n, i) {
|
|
1254
|
-
const u = a(!1), c =
|
|
1255
|
-
function s(
|
|
1256
|
-
u.value =
|
|
1254
|
+
const u = a(!1), c = I(() => e.enableClear && !e.readonly && !e.disable), { changeTextBoxValue: h } = i;
|
|
1255
|
+
function s(C) {
|
|
1256
|
+
u.value = C;
|
|
1257
1257
|
}
|
|
1258
1258
|
W(n, () => {
|
|
1259
1259
|
l.value ? s(!!n.value) : s(!1);
|
|
1260
1260
|
});
|
|
1261
|
-
function
|
|
1262
|
-
const m = !e.readonly && !e.disable && e.editable,
|
|
1263
|
-
|
|
1261
|
+
function r(C) {
|
|
1262
|
+
const m = !e.readonly && !e.disable && e.editable, y = !e.editable;
|
|
1263
|
+
C.stopPropagation(), (m || y) && (h("", !1), s(!u.value), t.emit("clear"));
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function d(C) {
|
|
1266
1266
|
if (c.value) {
|
|
1267
1267
|
if (!o.value) {
|
|
1268
1268
|
s(!1);
|
|
@@ -1271,92 +1271,92 @@ function kt(e, t, o, l, n, i) {
|
|
|
1271
1271
|
(!e.editable || !e.readonly) && !e.disable && s(!0);
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function f(C) {
|
|
1275
1275
|
c.value && s(!1);
|
|
1276
1276
|
}
|
|
1277
1277
|
return {
|
|
1278
1278
|
enableClearButton: c,
|
|
1279
1279
|
showClearButton: u,
|
|
1280
|
-
onClearValue:
|
|
1281
|
-
onMouseEnterTextBox:
|
|
1282
|
-
onMouseLeaveTextBox:
|
|
1280
|
+
onClearValue: r,
|
|
1281
|
+
onMouseEnterTextBox: d,
|
|
1282
|
+
onMouseLeaveTextBox: f
|
|
1283
1283
|
};
|
|
1284
1284
|
}
|
|
1285
1285
|
function xt(e, t, o, l, n) {
|
|
1286
|
-
const i = a(e.popupOnInput), u = a(e.popupOnFocus), { shouldPopupContent: c } = n, h =
|
|
1287
|
-
let
|
|
1288
|
-
const
|
|
1286
|
+
const i = a(e.popupOnInput), u = a(e.popupOnFocus), { shouldPopupContent: c } = n, h = I(() => e.enableTitle ? o.value : ""), s = I(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), r = I(() => e.readonly || !e.editable);
|
|
1287
|
+
let d = !1;
|
|
1288
|
+
const f = I(() => !e.disable && d), C = I(() => ({
|
|
1289
1289
|
"text-left": e.textAlign === "left",
|
|
1290
1290
|
"text-center": e.textAlign === "center",
|
|
1291
1291
|
"text-right": e.textAlign === "right",
|
|
1292
1292
|
"form-control": !0,
|
|
1293
1293
|
"f-utils-fill": !0
|
|
1294
|
-
})), m =
|
|
1294
|
+
})), m = I(() => ({
|
|
1295
1295
|
"input-group": !0,
|
|
1296
1296
|
"f-state-disable": e.disable,
|
|
1297
1297
|
"f-state-editable": e.editable && !e.disable && !e.readonly,
|
|
1298
1298
|
"f-state-readonly": e.readonly && !e.disable,
|
|
1299
|
-
"f-state-focus":
|
|
1299
|
+
"f-state-focus": f.value
|
|
1300
1300
|
}));
|
|
1301
|
-
function
|
|
1302
|
-
o.value !==
|
|
1301
|
+
function y(w, j = !0) {
|
|
1302
|
+
o.value !== w && (o.value = w, j && t.emit("change", w), t.emit("update:modelValue", w));
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1305
|
-
c.value = !1,
|
|
1304
|
+
function O(w) {
|
|
1305
|
+
c.value = !1, y(w, !0);
|
|
1306
1306
|
}
|
|
1307
1307
|
W(
|
|
1308
1308
|
() => e.modelValue,
|
|
1309
|
-
(
|
|
1310
|
-
o.value =
|
|
1309
|
+
(w) => {
|
|
1310
|
+
o.value = w, t.emit("change", w);
|
|
1311
1311
|
}
|
|
1312
1312
|
);
|
|
1313
|
-
function
|
|
1314
|
-
|
|
1313
|
+
function P(w) {
|
|
1314
|
+
d = !1, t.emit("blur", w), w.stopPropagation();
|
|
1315
1315
|
}
|
|
1316
|
-
function x(
|
|
1317
|
-
t.emit("click",
|
|
1316
|
+
function x(w) {
|
|
1317
|
+
t.emit("click", w);
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1319
|
+
function v(w) {
|
|
1320
1320
|
if (e.disable) {
|
|
1321
|
-
|
|
1321
|
+
d = !0;
|
|
1322
1322
|
return;
|
|
1323
1323
|
}
|
|
1324
|
-
|
|
1324
|
+
d = !0, r.value || (t.emit("focus", w), u.value && !c.value && n.popup());
|
|
1325
1325
|
}
|
|
1326
|
-
function
|
|
1327
|
-
t.emit("input",
|
|
1328
|
-
const j =
|
|
1329
|
-
l.value = j, o.value !== j &&
|
|
1326
|
+
function b(w) {
|
|
1327
|
+
t.emit("input", w.target.value);
|
|
1328
|
+
const j = w.target.value;
|
|
1329
|
+
l.value = j, o.value !== j && y(j, !1), i.value && !c.value && n.popup();
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1332
|
-
|
|
1331
|
+
function B(w) {
|
|
1332
|
+
w.target.tagName !== "INPUT" && w.preventDefault(), w.stopPropagation();
|
|
1333
1333
|
}
|
|
1334
|
-
function k(
|
|
1335
|
-
t.emit("keydown",
|
|
1334
|
+
function k(w) {
|
|
1335
|
+
t.emit("keydown", w);
|
|
1336
1336
|
}
|
|
1337
|
-
function E(
|
|
1338
|
-
|
|
1337
|
+
function E(w) {
|
|
1338
|
+
w.key === "Enter" && (i.value || u.value) && n.hidePopup(), t.emit("keyup", w);
|
|
1339
1339
|
}
|
|
1340
|
-
function L(
|
|
1341
|
-
const j =
|
|
1342
|
-
|
|
1340
|
+
function L(w) {
|
|
1341
|
+
const j = w.target.value;
|
|
1342
|
+
w.stopPropagation(), y(j);
|
|
1343
1343
|
}
|
|
1344
1344
|
return {
|
|
1345
|
-
hasFocusedTextBox:
|
|
1346
|
-
isTextBoxReadonly:
|
|
1347
|
-
textBoxClass:
|
|
1345
|
+
hasFocusedTextBox: f,
|
|
1346
|
+
isTextBoxReadonly: r,
|
|
1347
|
+
textBoxClass: C,
|
|
1348
1348
|
textBoxPlaceholder: s,
|
|
1349
1349
|
textBoxTitle: h,
|
|
1350
1350
|
inputGroupClass: m,
|
|
1351
|
-
changeTextBoxValue:
|
|
1352
|
-
commitValue:
|
|
1353
|
-
onBlurTextBox:
|
|
1351
|
+
changeTextBoxValue: y,
|
|
1352
|
+
commitValue: O,
|
|
1353
|
+
onBlurTextBox: P,
|
|
1354
1354
|
onClickTextBox: x,
|
|
1355
|
-
onFocusTextBox:
|
|
1356
|
-
onInput:
|
|
1355
|
+
onFocusTextBox: v,
|
|
1356
|
+
onInput: b,
|
|
1357
1357
|
onKeyDownTextBox: k,
|
|
1358
1358
|
onKeyUpTextBox: E,
|
|
1359
|
-
onMouseDownTextBox:
|
|
1359
|
+
onMouseDownTextBox: B,
|
|
1360
1360
|
onTextBoxValueChange: L
|
|
1361
1361
|
};
|
|
1362
1362
|
}
|
|
@@ -1386,10 +1386,10 @@ function Mt(e, t, o) {
|
|
|
1386
1386
|
onBlurTextBox: c,
|
|
1387
1387
|
onClickTextBox: h,
|
|
1388
1388
|
onFocusTextBox: s,
|
|
1389
|
-
onInput:
|
|
1390
|
-
onKeyDownTextBox:
|
|
1391
|
-
onKeyUpTextBox:
|
|
1392
|
-
onMouseDownTextBox:
|
|
1389
|
+
onInput: r,
|
|
1390
|
+
onKeyDownTextBox: d,
|
|
1391
|
+
onKeyUpTextBox: f,
|
|
1392
|
+
onMouseDownTextBox: C,
|
|
1393
1393
|
onTextBoxValueChange: m
|
|
1394
1394
|
} = o;
|
|
1395
1395
|
return () => p("input", {
|
|
@@ -1409,10 +1409,10 @@ function Mt(e, t, o) {
|
|
|
1409
1409
|
onChange: m,
|
|
1410
1410
|
onClick: h,
|
|
1411
1411
|
onFocus: s,
|
|
1412
|
-
onInput:
|
|
1413
|
-
onKeydown:
|
|
1414
|
-
onKeyup:
|
|
1415
|
-
onMousedown:
|
|
1412
|
+
onInput: r,
|
|
1413
|
+
onKeydown: d,
|
|
1414
|
+
onKeyup: f,
|
|
1415
|
+
onMousedown: C
|
|
1416
1416
|
}, null);
|
|
1417
1417
|
}
|
|
1418
1418
|
const Ft = {
|
|
@@ -1435,22 +1435,22 @@ const Ft = {
|
|
|
1435
1435
|
};
|
|
1436
1436
|
function Ot(e, t, o, l) {
|
|
1437
1437
|
const n = a(-1), i = a(!1);
|
|
1438
|
-
function u(
|
|
1439
|
-
|
|
1440
|
-
n.value =
|
|
1438
|
+
function u(r, d, f) {
|
|
1439
|
+
r.stopPropagation(), d && setTimeout(() => {
|
|
1440
|
+
n.value = f, i.value = !0, d.moving = !0;
|
|
1441
1441
|
});
|
|
1442
1442
|
}
|
|
1443
|
-
function c(
|
|
1444
|
-
if (
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1443
|
+
function c(r, d) {
|
|
1444
|
+
if (r.preventDefault(), n.value !== d) {
|
|
1445
|
+
const f = l.value[n.value], C = l.value;
|
|
1446
|
+
C.splice(n.value, 1), C.splice(d, 0, f), n.value = d;
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
|
-
function h(
|
|
1450
|
-
|
|
1449
|
+
function h(r, d) {
|
|
1450
|
+
r.preventDefault(), r.dataTransfer && (r.dataTransfer.dropEffect = "move");
|
|
1451
1451
|
}
|
|
1452
|
-
function s(
|
|
1453
|
-
|
|
1452
|
+
function s(r, d) {
|
|
1453
|
+
d && (d.moving = !1), o.value = l.value.filter((f) => f.type === "Tag").map((f) => f.payload), i.value = !1, t.emit("change", o.value);
|
|
1454
1454
|
}
|
|
1455
1455
|
return {
|
|
1456
1456
|
dragstart: u,
|
|
@@ -1465,39 +1465,39 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1465
1465
|
props: Ft,
|
|
1466
1466
|
emits: ["remove", "selectionChange", "change"],
|
|
1467
1467
|
setup(e, t) {
|
|
1468
|
-
const o = a(e.selectable), l = a(e.customClass), n = a(e.data), i = a(e.tagType), u = a(e.tagStyle), c = a(e.showColor), h = a(e.activeTag), s = a(e.customStyle),
|
|
1468
|
+
const o = a(e.selectable), l = a(e.customClass), n = a(e.data), i = a(e.tagType), u = a(e.tagStyle), c = a(e.showColor), h = a(e.activeTag), s = a(e.customStyle), r = a(e.showClose), d = a(e.showAddButton), f = a(e.showInput), C = a(e.addButtonText), m = a(e.enableAddButton);
|
|
1469
1469
|
a(e.placeholder), a(""), a();
|
|
1470
|
-
const
|
|
1470
|
+
const y = a(), O = a(e.wrapText), P = a();
|
|
1471
1471
|
function x() {
|
|
1472
|
-
const g = n.value.map((
|
|
1472
|
+
const g = n.value.map((S) => ({
|
|
1473
1473
|
type: "Tag",
|
|
1474
|
-
payload:
|
|
1474
|
+
payload: S
|
|
1475
1475
|
}));
|
|
1476
|
-
return
|
|
1476
|
+
return d.value && g.push({
|
|
1477
1477
|
type: "AddButton"
|
|
1478
1478
|
}), g;
|
|
1479
1479
|
}
|
|
1480
|
-
const
|
|
1481
|
-
function
|
|
1482
|
-
n.value = g,
|
|
1480
|
+
const v = a(x());
|
|
1481
|
+
function b(g) {
|
|
1482
|
+
n.value = g, v.value = x();
|
|
1483
1483
|
}
|
|
1484
|
-
const
|
|
1484
|
+
const B = I(() => v.value.findIndex((g) => g.type === "Input")), k = Ot(e, t, n, v), {
|
|
1485
1485
|
dragstart: E,
|
|
1486
1486
|
dragenter: L,
|
|
1487
|
-
dragover:
|
|
1487
|
+
dragover: w,
|
|
1488
1488
|
dragend: j
|
|
1489
1489
|
} = k;
|
|
1490
|
-
W(() => e.data, (g) =>
|
|
1491
|
-
const V =
|
|
1490
|
+
W(() => e.data, (g) => b(g));
|
|
1491
|
+
const V = I(() => {
|
|
1492
1492
|
const g = {
|
|
1493
1493
|
"farris-tags": !0,
|
|
1494
1494
|
"farris-tags-checkable": o.value,
|
|
1495
|
-
"farris-tags-nowrap": !
|
|
1495
|
+
"farris-tags-nowrap": !O.value
|
|
1496
1496
|
};
|
|
1497
|
-
return l.value.split(" ").reduce((
|
|
1497
|
+
return l.value.split(" ").reduce((S, T) => (S[T] = !0, S), g), g;
|
|
1498
1498
|
});
|
|
1499
1499
|
function R(g) {
|
|
1500
|
-
const
|
|
1500
|
+
const S = {
|
|
1501
1501
|
"farris-tag-item": !0,
|
|
1502
1502
|
"farris-tag-item-checked": o.value && g.checked,
|
|
1503
1503
|
"farris-tag-item-checkable": o.value,
|
|
@@ -1506,44 +1506,44 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1506
1506
|
};
|
|
1507
1507
|
if (i.value) {
|
|
1508
1508
|
const T = `farris-tag-item-${i.value}`;
|
|
1509
|
-
|
|
1509
|
+
S[T] = !0;
|
|
1510
1510
|
}
|
|
1511
|
-
return
|
|
1511
|
+
return S;
|
|
1512
1512
|
}
|
|
1513
|
-
const z =
|
|
1513
|
+
const z = I(() => {
|
|
1514
1514
|
const g = {};
|
|
1515
|
-
return s.value && s.value.split(";").reduce((
|
|
1515
|
+
return s.value && s.value.split(";").reduce((S, T) => {
|
|
1516
1516
|
const H = T.split(":");
|
|
1517
|
-
return
|
|
1517
|
+
return S[H[0]] = H[1], S;
|
|
1518
1518
|
}, g), g;
|
|
1519
1519
|
});
|
|
1520
|
-
function D(g,
|
|
1521
|
-
o.value &&
|
|
1522
|
-
T.checked = !
|
|
1523
|
-
}), t.emit("change", n.value), t.emit("selectionChange",
|
|
1520
|
+
function D(g, S) {
|
|
1521
|
+
o.value && S.selectable && (S.checked = !S.checked, h.value = S.checked ? S.name : "", S.checked && n.value.filter((T) => T.name !== S.name).forEach((T) => {
|
|
1522
|
+
T.checked = !S.checked;
|
|
1523
|
+
}), t.emit("change", n.value), t.emit("selectionChange", S));
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function F(g, S) {
|
|
1526
1526
|
let T;
|
|
1527
1527
|
switch (g.key) {
|
|
1528
1528
|
case "Backspace":
|
|
1529
|
-
n.value = n.value.filter((H) => H.name !==
|
|
1529
|
+
n.value = n.value.filter((H) => H.name !== S.name), t.emit("change", n.value);
|
|
1530
1530
|
break;
|
|
1531
1531
|
case "ArrowLeft":
|
|
1532
|
-
T = Math.max(
|
|
1532
|
+
T = Math.max(y.value.scrollLeft + 20, 0), y.value.scrollLeft = T;
|
|
1533
1533
|
break;
|
|
1534
1534
|
case "ArrowRight":
|
|
1535
|
-
T = Math.max(
|
|
1535
|
+
T = Math.max(y.value.scrollLeft - 20, 0), y.value.scrollLeft = T;
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
|
-
function M(g,
|
|
1539
|
-
const T = n.value.findIndex((H) => H.name ===
|
|
1538
|
+
function M(g, S) {
|
|
1539
|
+
const T = n.value.findIndex((H) => H.name === S.name);
|
|
1540
1540
|
if (T > -1) {
|
|
1541
1541
|
const [H] = n.value.splice(T, 1);
|
|
1542
|
-
|
|
1542
|
+
v.value = x(), t.emit("change", n.value), t.emit("remove", n.value, H, T);
|
|
1543
1543
|
}
|
|
1544
1544
|
g.stopPropagation();
|
|
1545
1545
|
}
|
|
1546
|
-
const A =
|
|
1546
|
+
const A = I(() => ({
|
|
1547
1547
|
"farris-tag-item": !0,
|
|
1548
1548
|
"farris-tag-add-button": !0,
|
|
1549
1549
|
"farris-tag-add-button-disabled": !m.value
|
|
@@ -1558,51 +1558,51 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1558
1558
|
class: "f-icon f-icon-amplification"
|
|
1559
1559
|
}, null), p("span", {
|
|
1560
1560
|
class: "farris-tag-add-text"
|
|
1561
|
-
}, [
|
|
1561
|
+
}, [C.value])]);
|
|
1562
1562
|
}
|
|
1563
1563
|
function N(g) {
|
|
1564
1564
|
if (g && !g.innerText) {
|
|
1565
|
-
const
|
|
1566
|
-
if (
|
|
1567
|
-
const [T] = n.value.splice(
|
|
1568
|
-
|
|
1565
|
+
const S = B.value;
|
|
1566
|
+
if (S > 0) {
|
|
1567
|
+
const [T] = n.value.splice(S - 1, 1);
|
|
1568
|
+
v.value.splice(S - 1, 1), t.emit("remove", n.value, T, S - 1);
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
function U(g,
|
|
1572
|
+
function U(g, S, T) {
|
|
1573
1573
|
g > -1 && (n.value.splice(g, 0, {
|
|
1574
|
-
name:
|
|
1574
|
+
name: S,
|
|
1575
1575
|
value: T,
|
|
1576
1576
|
selectable: o.value
|
|
1577
|
-
}),
|
|
1577
|
+
}), v.value = x(), t.emit("change", n.value));
|
|
1578
1578
|
}
|
|
1579
1579
|
function J(g) {
|
|
1580
1580
|
if (g && g.innerText) {
|
|
1581
|
-
const
|
|
1582
|
-
U(T,
|
|
1581
|
+
const S = g.innerText, T = B.value;
|
|
1582
|
+
U(T, S, S), g.innerText = "";
|
|
1583
1583
|
}
|
|
1584
1584
|
}
|
|
1585
1585
|
function Y(g) {
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1586
|
+
const S = g.target;
|
|
1587
|
+
S && (S.innerText ? J(S) : t.emit("change", n.value));
|
|
1588
1588
|
}
|
|
1589
1589
|
function be(g) {
|
|
1590
1590
|
g.key === "Enter" && J(g.target), g.key === "Backspace" && (N(g.target), K(() => {
|
|
1591
|
-
|
|
1591
|
+
P.value && P.value.focus();
|
|
1592
1592
|
}));
|
|
1593
1593
|
}
|
|
1594
1594
|
function Ce() {
|
|
1595
1595
|
return p("li", {
|
|
1596
1596
|
class: "farris-tag-input-box"
|
|
1597
1597
|
}, [p("div", {
|
|
1598
|
-
ref:
|
|
1598
|
+
ref: P,
|
|
1599
1599
|
class: "form-control",
|
|
1600
1600
|
contenteditable: "true",
|
|
1601
1601
|
onKeyup: be,
|
|
1602
1602
|
onBlur: Y
|
|
1603
1603
|
}, null)]);
|
|
1604
1604
|
}
|
|
1605
|
-
function we(g,
|
|
1605
|
+
function we(g, S) {
|
|
1606
1606
|
return p("li", {
|
|
1607
1607
|
class: R(g),
|
|
1608
1608
|
style: z.value,
|
|
@@ -1610,16 +1610,16 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1610
1610
|
id: g.name,
|
|
1611
1611
|
key: g.name,
|
|
1612
1612
|
onClick: (T) => D(T, g),
|
|
1613
|
-
onKeydown: (T) =>
|
|
1613
|
+
onKeydown: (T) => F(T, g),
|
|
1614
1614
|
draggable: "true",
|
|
1615
|
-
onDragstart: (T) => E(T, g,
|
|
1616
|
-
onDragenter: (T) => L(T,
|
|
1615
|
+
onDragstart: (T) => E(T, g, S),
|
|
1616
|
+
onDragenter: (T) => L(T, S),
|
|
1617
1617
|
onDragend: (T) => j(T, g),
|
|
1618
|
-
onDragover: (T) =>
|
|
1618
|
+
onDragover: (T) => w(T, S)
|
|
1619
1619
|
}, [p("div", {
|
|
1620
1620
|
title: g.name,
|
|
1621
1621
|
class: "tag-box"
|
|
1622
|
-
}, [g.name]),
|
|
1622
|
+
}, [g.name]), r.value && p("span", {
|
|
1623
1623
|
class: "tag-delete"
|
|
1624
1624
|
}, [p("i", {
|
|
1625
1625
|
class: "f-icon f-icon-close",
|
|
@@ -1627,10 +1627,10 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1627
1627
|
}, null)])]);
|
|
1628
1628
|
}
|
|
1629
1629
|
function Se() {
|
|
1630
|
-
return
|
|
1630
|
+
return v.value.map((g, S) => {
|
|
1631
1631
|
switch (g.type) {
|
|
1632
1632
|
case "Tag":
|
|
1633
|
-
return we(g.payload,
|
|
1633
|
+
return we(g.payload, S);
|
|
1634
1634
|
case "AddButton":
|
|
1635
1635
|
return _();
|
|
1636
1636
|
case "Input":
|
|
@@ -1638,18 +1638,18 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1638
1638
|
}
|
|
1639
1639
|
});
|
|
1640
1640
|
}
|
|
1641
|
-
const Te =
|
|
1641
|
+
const Te = I(() => ({
|
|
1642
1642
|
"farris-tags-item-container": !0,
|
|
1643
1643
|
"farris-tag-item-capsule": u.value === "capsule"
|
|
1644
1644
|
}));
|
|
1645
1645
|
function Be(g) {
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1646
|
+
const S = Math.max(y.value.scrollLeft - g.deltaX, 0);
|
|
1647
|
+
y.value.scrollLeft = S;
|
|
1648
1648
|
}
|
|
1649
1649
|
function Ie(g) {
|
|
1650
|
-
const
|
|
1651
|
-
if (
|
|
1652
|
-
const H = Array.from(
|
|
1650
|
+
const S = y.value, T = n.value.length - 1;
|
|
1651
|
+
if (S) {
|
|
1652
|
+
const H = Array.from(S.children).filter((X) => X.className.indexOf("farris-tag-item") > -1).findIndex((X) => {
|
|
1653
1653
|
const q = X.getBoundingClientRect(), Z = window.getComputedStyle(X), ue = parseInt(Z["margin-left"], 10) + q.width + parseInt(Z["margin-right"], 10);
|
|
1654
1654
|
return q.left + ue > g;
|
|
1655
1655
|
});
|
|
@@ -1659,21 +1659,21 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1659
1659
|
return T;
|
|
1660
1660
|
}
|
|
1661
1661
|
function ke(g) {
|
|
1662
|
-
if (
|
|
1663
|
-
const T = Ie(g.clientX) + 1, X =
|
|
1662
|
+
if (f.value) {
|
|
1663
|
+
const T = Ie(g.clientX) + 1, X = v.value.filter((q) => q.type !== "Input");
|
|
1664
1664
|
X.splice(T, 0, {
|
|
1665
1665
|
type: "Input"
|
|
1666
|
-
}),
|
|
1667
|
-
|
|
1666
|
+
}), v.value = X, K(() => {
|
|
1667
|
+
P.value && P.value.focus();
|
|
1668
1668
|
});
|
|
1669
1669
|
}
|
|
1670
1670
|
}
|
|
1671
1671
|
function xe(g) {
|
|
1672
1672
|
var T;
|
|
1673
1673
|
g.preventDefault(), g.stopPropagation();
|
|
1674
|
-
const
|
|
1675
|
-
if (
|
|
1676
|
-
const H =
|
|
1674
|
+
const S = (T = g.dataTransfer) == null ? void 0 : T.getData("Text");
|
|
1675
|
+
if (S) {
|
|
1676
|
+
const H = S.split(":"), X = H[0], q = H[1];
|
|
1677
1677
|
[...n.value].findIndex((ee) => (console.log(`${ee.value} === ${q} is ${ee.value === q}`), ee.value === q)) > -1 || U(n.value.length, X, q);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
@@ -1686,7 +1686,7 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1686
1686
|
onDrop: xe,
|
|
1687
1687
|
onDragover: Pe
|
|
1688
1688
|
}, [p("ul", {
|
|
1689
|
-
ref:
|
|
1689
|
+
ref: y,
|
|
1690
1690
|
class: Te.value,
|
|
1691
1691
|
onWheel: (g) => Be(g)
|
|
1692
1692
|
}, [Se()])]);
|
|
@@ -1695,7 +1695,7 @@ const Vt = /* @__PURE__ */ G({
|
|
|
1695
1695
|
function Lt(e, t, o) {
|
|
1696
1696
|
const l = a(e.separator), {
|
|
1697
1697
|
changeTextBoxValue: n
|
|
1698
|
-
} = o, i =
|
|
1698
|
+
} = o, i = I(() => t.value ? t.value.split(l.value).map((c) => ({
|
|
1699
1699
|
name: c,
|
|
1700
1700
|
selectable: !0
|
|
1701
1701
|
})) : []);
|
|
@@ -1760,106 +1760,106 @@ const jt = {
|
|
|
1760
1760
|
minWidth: { type: Number, default: -1 }
|
|
1761
1761
|
};
|
|
1762
1762
|
function Rt(e) {
|
|
1763
|
-
const t = e.host ? e.host : "body", o =
|
|
1763
|
+
const t = e.host ? e.host : "body", o = I(() => t === "body" ? 0 : t ? t.getBoundingClientRect().top : 0), l = I(() => t === "body" ? 0 : t ? t.getBoundingClientRect().left : 0), n = I(() => t === "body" ? document.body.getBoundingClientRect().width : t ? t.getBoundingClientRect().width - (e.rightBoundary ? e.rightBoundary.getBoundingClientRect().width : 0) : document.body.getBoundingClientRect().width);
|
|
1764
1764
|
return { host: t, hostLeft: l, hostTop: o, hostWidth: n };
|
|
1765
1765
|
}
|
|
1766
1766
|
function At(e, t, o, l) {
|
|
1767
1767
|
var D;
|
|
1768
|
-
const n = a(0), i = a(((D = e.offsetX) == null ? void 0 : D.value) || 0), u = a(-1), c = a(-1), h = a(-1), s = a(e.placement),
|
|
1769
|
-
W(e.offsetX, (
|
|
1770
|
-
n.value =
|
|
1768
|
+
const n = a(0), i = a(((D = e.offsetX) == null ? void 0 : D.value) || 0), u = a(-1), c = a(-1), h = a(-1), s = a(e.placement), r = a(0), d = a(0), f = a(0), C = a(document.documentElement.scrollLeft), m = a(document.documentElement.scrollTop), { hostLeft: y, hostTop: O, hostWidth: P } = l;
|
|
1769
|
+
W(e.offsetX, (F) => {
|
|
1770
|
+
n.value = F - i.value;
|
|
1771
1771
|
});
|
|
1772
|
-
const x =
|
|
1773
|
-
const
|
|
1774
|
-
left: `${
|
|
1775
|
-
top: `${
|
|
1772
|
+
const x = I(() => {
|
|
1773
|
+
const F = {
|
|
1774
|
+
left: `${d.value}px`,
|
|
1775
|
+
top: `${f.value}px`,
|
|
1776
1776
|
transform: `translateX(${n.value}px)`
|
|
1777
1777
|
};
|
|
1778
|
-
return e.zIndex !== -1 && (
|
|
1779
|
-
}),
|
|
1780
|
-
left: `${
|
|
1778
|
+
return e.zIndex !== -1 && (F["z-index"] = e.zIndex), u.value !== -1 && (F.width = `${u.value}px`), F;
|
|
1779
|
+
}), v = I(() => ({
|
|
1780
|
+
left: `${r.value}px`
|
|
1781
1781
|
}));
|
|
1782
|
-
function
|
|
1783
|
-
if (
|
|
1784
|
-
const M =
|
|
1782
|
+
function b(F) {
|
|
1783
|
+
if (F && e.keepWidthWithReference) {
|
|
1784
|
+
const M = F.getBoundingClientRect();
|
|
1785
1785
|
u.value = Math.max(e.minWidth, M.width);
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const A =
|
|
1788
|
+
function B(F, M) {
|
|
1789
|
+
const A = P.value - F.width - 4;
|
|
1790
1790
|
return A > 0 ? A : M;
|
|
1791
1791
|
}
|
|
1792
|
-
function k(
|
|
1793
|
-
const $ =
|
|
1792
|
+
function k(F, M, A) {
|
|
1793
|
+
const $ = r.value, _ = M.left - y.value + M.width / 2 + C.value, N = M.top - O.value - (F.height + A.height) + m.value;
|
|
1794
1794
|
return { popoverLeft: _, popoverTop: N, arrowLeft: $ };
|
|
1795
1795
|
}
|
|
1796
|
-
function E(
|
|
1797
|
-
return M.top -
|
|
1796
|
+
function E(F, M, A) {
|
|
1797
|
+
return M.top - O.value + (M.height + A.height) + m.value;
|
|
1798
1798
|
}
|
|
1799
|
-
function L(
|
|
1800
|
-
const A =
|
|
1801
|
-
return { popoverLeft: Math.min(
|
|
1799
|
+
function L(F, M) {
|
|
1800
|
+
const A = B(M, F), $ = F <= A ? r.value : F - A;
|
|
1801
|
+
return { popoverLeft: Math.min(F, A), arrowLeft: $ };
|
|
1802
1802
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const $ = M.left -
|
|
1803
|
+
function w(F, M, A) {
|
|
1804
|
+
const $ = M.left - y.value + M.width / 2 - (A.width / 2 - (F.left - y.value)) + C.value, { arrowLeft: _, popoverLeft: N } = L($, F), U = E(F, M, A);
|
|
1805
1805
|
return { popoverLeft: N, popoverTop: U, arrowLeft: _ };
|
|
1806
1806
|
}
|
|
1807
|
-
function j(
|
|
1808
|
-
const $ = M.left -
|
|
1807
|
+
function j(F, M, A) {
|
|
1808
|
+
const $ = M.left - y.value + C.value, { arrowLeft: _, popoverLeft: N } = L($, F), U = E(F, M, A);
|
|
1809
1809
|
return { popoverLeft: N, popoverTop: U, arrowLeft: _ };
|
|
1810
1810
|
}
|
|
1811
1811
|
const V = /* @__PURE__ */ new Map([
|
|
1812
1812
|
["top", k],
|
|
1813
|
-
["bottom",
|
|
1813
|
+
["bottom", w],
|
|
1814
1814
|
["bottom-left", j]
|
|
1815
1815
|
]);
|
|
1816
|
-
function R(
|
|
1816
|
+
function R(F) {
|
|
1817
1817
|
var N;
|
|
1818
|
-
const M =
|
|
1818
|
+
const M = F.getBoundingClientRect();
|
|
1819
1819
|
c.value = M.top, h.value = M.left;
|
|
1820
1820
|
const A = t.value.getBoundingClientRect(), $ = (N = o.value) == null ? void 0 : N.getBoundingClientRect(), _ = V.get(s.value);
|
|
1821
1821
|
if (_) {
|
|
1822
1822
|
const { arrowLeft: U, popoverLeft: J, popoverTop: Y } = _($, M, A);
|
|
1823
|
-
|
|
1823
|
+
r.value = U, d.value = J, f.value = Y;
|
|
1824
1824
|
}
|
|
1825
|
-
e.keepWidthWithReference &&
|
|
1825
|
+
e.keepWidthWithReference && b(F);
|
|
1826
1826
|
}
|
|
1827
|
-
function z(
|
|
1828
|
-
if (
|
|
1829
|
-
const M =
|
|
1830
|
-
(M.left !== h.value || M.top !== c.value) && R(
|
|
1827
|
+
function z(F) {
|
|
1828
|
+
if (F) {
|
|
1829
|
+
const M = F.getBoundingClientRect();
|
|
1830
|
+
(M.left !== h.value || M.top !== c.value) && R(F);
|
|
1831
1831
|
}
|
|
1832
1832
|
}
|
|
1833
1833
|
return {
|
|
1834
|
-
arrowStyle:
|
|
1834
|
+
arrowStyle: v,
|
|
1835
1835
|
popoverStyle: x,
|
|
1836
1836
|
position: s,
|
|
1837
1837
|
popoverWidth: u,
|
|
1838
|
-
fitToReference:
|
|
1838
|
+
fitToReference: b,
|
|
1839
1839
|
followToReferencePosition: z,
|
|
1840
1840
|
locateToReference: R
|
|
1841
1841
|
};
|
|
1842
1842
|
}
|
|
1843
1843
|
function Et(e, t, o, l, n, i, u) {
|
|
1844
|
-
const c = a(e.visible), h =
|
|
1845
|
-
let
|
|
1846
|
-
function
|
|
1847
|
-
c.value = !1, document.body.removeEventListener("click",
|
|
1844
|
+
const c = a(e.visible), h = I(() => c.value), { fitToReference: s, locateToReference: r } = u;
|
|
1845
|
+
let d;
|
|
1846
|
+
function f() {
|
|
1847
|
+
c.value = !1, document.body.removeEventListener("click", d), t.emit("hidden");
|
|
1848
1848
|
}
|
|
1849
|
-
|
|
1849
|
+
d = (m) => {
|
|
1850
1850
|
if (!n.value.contains(m.target)) {
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1851
|
+
const y = n.value.closest(".popover");
|
|
1852
|
+
y && y.removeEventListener("click", d), f();
|
|
1853
1853
|
}
|
|
1854
1854
|
};
|
|
1855
|
-
async function
|
|
1855
|
+
async function C(m) {
|
|
1856
1856
|
if (l.value && o.value && m) {
|
|
1857
|
-
c.value = !0, n.value = m, await K(),
|
|
1858
|
-
const
|
|
1859
|
-
|
|
1857
|
+
c.value = !0, n.value = m, await K(), r(m), i.value && s(m), document.body.addEventListener("click", d);
|
|
1858
|
+
const y = m.closest(".popover");
|
|
1859
|
+
y && y.addEventListener("click", d), t.emit("shown");
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
|
-
return t.expose({ hide:
|
|
1862
|
+
return t.expose({ hide: f, show: C, shown: h }), { showPopover: c, hidePopverOnClickBodyHandler: d };
|
|
1863
1863
|
}
|
|
1864
1864
|
function Ht(e, t, o, l, n) {
|
|
1865
1865
|
const { popoverWidth: i, fitToReference: u, followToReferencePosition: c } = n;
|
|
@@ -1877,53 +1877,53 @@ const Wt = /* @__PURE__ */ G({
|
|
|
1877
1877
|
props: jt,
|
|
1878
1878
|
emits: ["shown", "hidden"],
|
|
1879
1879
|
setup(e, t) {
|
|
1880
|
-
const o = a(), l = a(), n = a(e.reference), i = a(e.keepWidthWithReference), u =
|
|
1880
|
+
const o = a(), l = a(), n = a(e.reference), i = a(e.keepWidthWithReference), u = I(() => !!e.title), c = Rt(e), {
|
|
1881
1881
|
host: h
|
|
1882
1882
|
} = c, s = At(e, o, l, c), {
|
|
1883
|
-
position:
|
|
1884
|
-
arrowStyle:
|
|
1885
|
-
popoverStyle:
|
|
1886
|
-
fitToReference:
|
|
1883
|
+
position: r,
|
|
1884
|
+
arrowStyle: d,
|
|
1885
|
+
popoverStyle: f,
|
|
1886
|
+
fitToReference: C,
|
|
1887
1887
|
locateToReference: m
|
|
1888
1888
|
} = s, {
|
|
1889
|
-
showPopover:
|
|
1890
|
-
hidePopverOnClickBodyHandler:
|
|
1889
|
+
showPopover: y,
|
|
1890
|
+
hidePopverOnClickBodyHandler: O
|
|
1891
1891
|
} = Et(e, t, o, l, n, i, s), {
|
|
1892
|
-
onResize:
|
|
1893
|
-
} = Ht(e, t, n, i, s), x =
|
|
1894
|
-
const
|
|
1892
|
+
onResize: P
|
|
1893
|
+
} = Ht(e, t, n, i, s), x = I(() => {
|
|
1894
|
+
const b = `popover in popover-${r.value}`, B = `bs-popover-${r.value}`, k = {
|
|
1895
1895
|
"popover-fitcontent": e.fitContent
|
|
1896
1896
|
};
|
|
1897
|
-
return k[
|
|
1898
|
-
}),
|
|
1897
|
+
return k[b] = !0, k[B] = !0, (e.class || "").split(" ").reduce((L, w) => (L[w] = !0, L), k), k;
|
|
1898
|
+
}), v = I(() => ({
|
|
1899
1899
|
"popover-content": !0,
|
|
1900
1900
|
"popover-body": !0
|
|
1901
1901
|
}));
|
|
1902
1902
|
return ne(() => {
|
|
1903
|
-
e.reference && m(n.value), i.value &&
|
|
1903
|
+
e.reference && m(n.value), i.value && C(n.value), window.addEventListener("resize", P);
|
|
1904
1904
|
}), fe(() => {
|
|
1905
|
-
document.body.removeEventListener("click",
|
|
1905
|
+
document.body.removeEventListener("click", O), window.removeEventListener("resize", P);
|
|
1906
1906
|
}), () => p(de, {
|
|
1907
1907
|
to: h
|
|
1908
1908
|
}, {
|
|
1909
1909
|
default: () => {
|
|
1910
|
-
var
|
|
1910
|
+
var b;
|
|
1911
1911
|
return [Q(p("div", {
|
|
1912
1912
|
ref: l,
|
|
1913
1913
|
class: x.value,
|
|
1914
|
-
style:
|
|
1915
|
-
onClick: (
|
|
1916
|
-
|
|
1914
|
+
style: f.value,
|
|
1915
|
+
onClick: (B) => {
|
|
1916
|
+
B.stopPropagation();
|
|
1917
1917
|
}
|
|
1918
1918
|
}, [p("div", {
|
|
1919
1919
|
ref: o,
|
|
1920
1920
|
class: "popover-arrow arrow",
|
|
1921
|
-
style:
|
|
1921
|
+
style: d.value
|
|
1922
1922
|
}, null), u.value && p("h3", {
|
|
1923
1923
|
class: "popover-title popover-header"
|
|
1924
1924
|
}, [e.title]), p("div", {
|
|
1925
|
-
class:
|
|
1926
|
-
}, [t.slots.default && ((
|
|
1925
|
+
class: v.value
|
|
1926
|
+
}, [t.slots.default && ((b = t.slots) == null ? void 0 : b.default())])]), [[ve, y.value]])];
|
|
1927
1927
|
}
|
|
1928
1928
|
});
|
|
1929
1929
|
}
|
|
@@ -1959,30 +1959,30 @@ const ye = /* @__PURE__ */ G({
|
|
|
1959
1959
|
const o = a(), l = a(e.customClass), n = a(e.modelValue), i = Pt(e, t, o), {
|
|
1960
1960
|
shouldPopupContent: u,
|
|
1961
1961
|
hidePopup: c
|
|
1962
|
-
} = i, h = It(e, t, o, i), s = a(""),
|
|
1963
|
-
hasFocusedTextBox:
|
|
1964
|
-
commitValue:
|
|
1965
|
-
inputGroupClass:
|
|
1966
|
-
} =
|
|
1967
|
-
onMouseEnterTextBox:
|
|
1968
|
-
onMouseLeaveTextBox:
|
|
1969
|
-
} = m,
|
|
1962
|
+
} = i, h = It(e, t, o, i), s = a(""), r = xt(e, t, n, s, i), {
|
|
1963
|
+
hasFocusedTextBox: d,
|
|
1964
|
+
commitValue: f,
|
|
1965
|
+
inputGroupClass: C
|
|
1966
|
+
} = r, m = kt(e, t, n, d, s, r), {
|
|
1967
|
+
onMouseEnterTextBox: y,
|
|
1968
|
+
onMouseLeaveTextBox: O
|
|
1969
|
+
} = m, P = I(() => {
|
|
1970
1970
|
const E = {
|
|
1971
1971
|
"f-button-edit": !0,
|
|
1972
1972
|
"f-cmp-inputgroup": !0,
|
|
1973
1973
|
"f-button-edit-nowrap": !e.wrapText
|
|
1974
1974
|
};
|
|
1975
|
-
return l.value && l.value.split(" ").reduce((L,
|
|
1975
|
+
return l.value && l.value.split(" ").reduce((L, w) => (L[w] = !0, L), E), E;
|
|
1976
1976
|
});
|
|
1977
1977
|
function x() {
|
|
1978
|
-
return e.multiSelect && e.inputType === "tag" ? Lt(e, n,
|
|
1978
|
+
return e.multiSelect && e.inputType === "tag" ? Lt(e, n, r) : Mt(e, n, r);
|
|
1979
1979
|
}
|
|
1980
|
-
let
|
|
1980
|
+
let v = x();
|
|
1981
1981
|
W([() => e.multiSelect, () => e.inputType], () => {
|
|
1982
|
-
|
|
1982
|
+
v = x();
|
|
1983
1983
|
});
|
|
1984
|
-
const
|
|
1985
|
-
commitValue:
|
|
1984
|
+
const b = Dt(e, h, m), B = _t(e, t, i), k = {
|
|
1985
|
+
commitValue: f,
|
|
1986
1986
|
elementRef: o,
|
|
1987
1987
|
hidePopup: c
|
|
1988
1988
|
};
|
|
@@ -1990,32 +1990,32 @@ const ye = /* @__PURE__ */ G({
|
|
|
1990
1990
|
o.value.componentInstance = k;
|
|
1991
1991
|
}), t.expose(k), () => p(re, null, [p("div", Le(t.attrs, {
|
|
1992
1992
|
ref: o,
|
|
1993
|
-
class:
|
|
1993
|
+
class: P.value,
|
|
1994
1994
|
id: e.id
|
|
1995
1995
|
}), [p("div", {
|
|
1996
|
-
class:
|
|
1997
|
-
onMouseenter:
|
|
1998
|
-
onMouseleave:
|
|
1999
|
-
}, [
|
|
1996
|
+
class: C.value,
|
|
1997
|
+
onMouseenter: y,
|
|
1998
|
+
onMouseleave: O
|
|
1999
|
+
}, [v(), b()])]), u.value && B()]);
|
|
2000
2000
|
}
|
|
2001
2001
|
});
|
|
2002
2002
|
function $t(e) {
|
|
2003
2003
|
const t = a(""), o = a(e.modelValue), l = a(e.data || []), n = a(e.editable);
|
|
2004
2004
|
function i(s) {
|
|
2005
|
-
const
|
|
2006
|
-
return l.value.filter((
|
|
2005
|
+
const r = s.split(e.separator).map((f) => [f, !0]), d = new Map(r);
|
|
2006
|
+
return l.value.filter((f) => d.has(f[e.valueField]));
|
|
2007
2007
|
}
|
|
2008
2008
|
function u(s) {
|
|
2009
|
-
const
|
|
2010
|
-
t.value = n.value ?
|
|
2009
|
+
const r = i(s).map((d) => d[e.textField]).join(e.separator);
|
|
2010
|
+
t.value = n.value ? r || s : r;
|
|
2011
2011
|
}
|
|
2012
2012
|
function c(s) {
|
|
2013
|
-
const
|
|
2014
|
-
return l.value.filter((
|
|
2013
|
+
const r = s.split(e.separator).map((f) => [f, !0]), d = new Map(r);
|
|
2014
|
+
return l.value.filter((f) => d.has(f[e.textField]));
|
|
2015
2015
|
}
|
|
2016
2016
|
function h() {
|
|
2017
|
-
const { url: s, method:
|
|
2018
|
-
fetch(s, { method:
|
|
2017
|
+
const { url: s, method: r = "GET", headers: d = {}, body: f = null } = e.remote;
|
|
2018
|
+
fetch(s, { method: r, headers: d, body: f }).then((m) => {
|
|
2019
2019
|
if (m.status === 200)
|
|
2020
2020
|
return m.json();
|
|
2021
2021
|
throw new Error(m.statusText);
|
|
@@ -2029,8 +2029,8 @@ function $t(e) {
|
|
|
2029
2029
|
l.value = e.data;
|
|
2030
2030
|
}), W([l], ([s]) => {
|
|
2031
2031
|
if (e.modelValue) {
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2032
|
+
const r = s.find((d) => d[e.valueField] === e.modelValue);
|
|
2033
|
+
r && (t.value = r[e.textField]);
|
|
2034
2034
|
}
|
|
2035
2035
|
}), W(() => e.modelValue, (s) => {
|
|
2036
2036
|
o.value = s, u(s);
|
|
@@ -2041,69 +2041,71 @@ const te = /* @__PURE__ */ G({
|
|
|
2041
2041
|
props: ae,
|
|
2042
2042
|
emits: ["clear", "update:modelValue", "change"],
|
|
2043
2043
|
setup(e, t) {
|
|
2044
|
-
const o = a(), {
|
|
2045
|
-
dataSource:
|
|
2046
|
-
displayText:
|
|
2047
|
-
editable:
|
|
2048
|
-
modelValue:
|
|
2049
|
-
getItemsByDisplayText:
|
|
2050
|
-
} = $t(e),
|
|
2051
|
-
function
|
|
2052
|
-
!
|
|
2044
|
+
const o = a(), l = a(e.disabled), n = a(e.enableClear), i = a(e.enableSearch), u = a(e.readonly), {
|
|
2045
|
+
dataSource: c,
|
|
2046
|
+
displayText: h,
|
|
2047
|
+
editable: s,
|
|
2048
|
+
modelValue: r,
|
|
2049
|
+
getItemsByDisplayText: d
|
|
2050
|
+
} = $t(e), f = I(() => e.multiSelect);
|
|
2051
|
+
function C() {
|
|
2052
|
+
!f.value && o.value && o.value.hidePopup();
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2055
|
-
|
|
2054
|
+
function m(v) {
|
|
2055
|
+
h.value = v.map((b) => b[e.textField]).join(e.separator), r.value = v.map((b) => b[e.valueField]).join(e.separator), t.emit("update:modelValue", r.value), t.emit("change", v), C();
|
|
2056
2056
|
}
|
|
2057
|
-
function
|
|
2058
|
-
|
|
2057
|
+
function y(v) {
|
|
2058
|
+
r.value = "", t.emit("update:modelValue", ""), t.emit("clear");
|
|
2059
2059
|
}
|
|
2060
|
-
function
|
|
2061
|
-
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2060
|
+
function O(v) {
|
|
2061
|
+
r.value = v, t.emit("update:modelValue", r.value);
|
|
2062
|
+
const b = {};
|
|
2063
|
+
b[e.idField] = v, b[e.textField] = v, t.emit("change", [b]);
|
|
2064
2064
|
}
|
|
2065
|
-
function
|
|
2066
|
-
if (
|
|
2067
|
-
|
|
2065
|
+
function P(v) {
|
|
2066
|
+
if (s.value) {
|
|
2067
|
+
O(v);
|
|
2068
2068
|
return;
|
|
2069
2069
|
}
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2070
|
+
const b = d(v);
|
|
2071
|
+
m(b);
|
|
2072
2072
|
}
|
|
2073
|
-
function
|
|
2074
|
-
return
|
|
2073
|
+
function x() {
|
|
2074
|
+
return h.value;
|
|
2075
2075
|
}
|
|
2076
2076
|
return t.expose({
|
|
2077
|
-
getDisplayText:
|
|
2077
|
+
getDisplayText: x
|
|
2078
|
+
}), W([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([v, b, B, k, E]) => {
|
|
2079
|
+
l.value = v, s.value = b, n.value = B, i.value = k, u.value = E;
|
|
2078
2080
|
}), () => p(ye, {
|
|
2079
2081
|
ref: o,
|
|
2080
2082
|
id: e.id,
|
|
2081
|
-
disable:
|
|
2082
|
-
readonly:
|
|
2083
|
+
disable: l.value,
|
|
2084
|
+
readonly: u.value,
|
|
2083
2085
|
forcePlaceholder: e.forcePlaceholder,
|
|
2084
|
-
editable:
|
|
2086
|
+
editable: s.value,
|
|
2085
2087
|
buttonContent: e.dropDownIcon,
|
|
2086
2088
|
placeholder: e.placeholder,
|
|
2087
|
-
enableClear:
|
|
2089
|
+
enableClear: n.value,
|
|
2088
2090
|
maxLength: e.maxLength,
|
|
2089
2091
|
tabIndex: e.tabIndex,
|
|
2090
2092
|
enableTitle: e.enableTitle,
|
|
2091
2093
|
multiSelect: e.multiSelect,
|
|
2092
2094
|
inputType: e.multiSelect ? "tag" : "text",
|
|
2093
|
-
modelValue:
|
|
2094
|
-
"onUpdate:modelValue": (v) =>
|
|
2095
|
-
onClear:
|
|
2096
|
-
onChange:
|
|
2095
|
+
modelValue: h.value,
|
|
2096
|
+
"onUpdate:modelValue": (v) => h.value = v,
|
|
2097
|
+
onClear: y,
|
|
2098
|
+
onChange: P
|
|
2097
2099
|
}, {
|
|
2098
2100
|
default: () => [p(rt, {
|
|
2099
2101
|
idField: e.idField,
|
|
2100
2102
|
valueField: e.valueField,
|
|
2101
2103
|
textField: e.textField,
|
|
2102
|
-
dataSource:
|
|
2103
|
-
selectedValues:
|
|
2104
|
+
dataSource: c.value,
|
|
2105
|
+
selectedValues: r.value,
|
|
2104
2106
|
multiSelect: e.multiSelect,
|
|
2105
|
-
enableSearch:
|
|
2106
|
-
onSelectionChange:
|
|
2107
|
+
enableSearch: i.value,
|
|
2108
|
+
onSelectionChange: m
|
|
2107
2109
|
}, null)]
|
|
2108
2110
|
});
|
|
2109
2111
|
}
|
|
@@ -2123,35 +2125,35 @@ function Nt(e, t, o) {
|
|
|
2123
2125
|
function h() {
|
|
2124
2126
|
return !!l;
|
|
2125
2127
|
}
|
|
2126
|
-
function s(
|
|
2127
|
-
if (!
|
|
2128
|
+
function s(v) {
|
|
2129
|
+
if (!v)
|
|
2128
2130
|
return null;
|
|
2129
|
-
if (
|
|
2130
|
-
return
|
|
2131
|
-
const
|
|
2132
|
-
return
|
|
2131
|
+
if (v.schema.type === "Component")
|
|
2132
|
+
return v;
|
|
2133
|
+
const b = s(v.parent);
|
|
2134
|
+
return b || null;
|
|
2133
2135
|
}
|
|
2134
|
-
function
|
|
2136
|
+
function r(v, b, B) {
|
|
2135
2137
|
return !!o && o.canAccepts();
|
|
2136
2138
|
}
|
|
2137
|
-
function
|
|
2139
|
+
function d() {
|
|
2138
2140
|
return t.schema.label || t.schema.title || t.schema.name;
|
|
2139
2141
|
}
|
|
2140
|
-
function
|
|
2142
|
+
function f() {
|
|
2141
2143
|
}
|
|
2142
|
-
function
|
|
2143
|
-
|
|
2144
|
+
function C(v, b) {
|
|
2145
|
+
b && (o == null || o.onAcceptMovedChildElement(b));
|
|
2144
2146
|
}
|
|
2145
|
-
function m(
|
|
2146
|
-
const
|
|
2147
|
-
return je(
|
|
2147
|
+
function m(v, b) {
|
|
2148
|
+
const B = String(v.getAttribute("data-controltype"));
|
|
2149
|
+
return je(B);
|
|
2148
2150
|
}
|
|
2149
|
-
function v
|
|
2150
|
-
return
|
|
2151
|
+
function y(v) {
|
|
2152
|
+
return v.contents ? v.contents.length : -1;
|
|
2151
2153
|
}
|
|
2152
|
-
function
|
|
2154
|
+
function O(v) {
|
|
2153
2155
|
}
|
|
2154
|
-
const
|
|
2156
|
+
const P = {
|
|
2155
2157
|
canMove: i(),
|
|
2156
2158
|
canSelectParent: u(),
|
|
2157
2159
|
canDelete: c(),
|
|
@@ -2161,17 +2163,17 @@ function Nt(e, t, o) {
|
|
|
2161
2163
|
parent: (x = t.parent) == null ? void 0 : x.componentInstance.value,
|
|
2162
2164
|
schema: t.schema,
|
|
2163
2165
|
styles: n,
|
|
2164
|
-
canAccepts:
|
|
2166
|
+
canAccepts: r,
|
|
2165
2167
|
getBelongedComponentInstance: s,
|
|
2166
|
-
getDraggingDisplayText:
|
|
2167
|
-
getDragScopeElement:
|
|
2168
|
-
onAcceptMovedChildElement:
|
|
2168
|
+
getDraggingDisplayText: d,
|
|
2169
|
+
getDragScopeElement: f,
|
|
2170
|
+
onAcceptMovedChildElement: C,
|
|
2169
2171
|
onAcceptNewChildElement: m,
|
|
2170
|
-
onAddNewChildElement:
|
|
2171
|
-
onChildElementMovedOut:
|
|
2172
|
+
onAddNewChildElement: y,
|
|
2173
|
+
onChildElementMovedOut: O,
|
|
2172
2174
|
triggerBelongedComponentToMoveWhenMoved: !!o && o.triggerBelongedComponentToMoveWhenMoved
|
|
2173
2175
|
};
|
|
2174
|
-
return a(
|
|
2176
|
+
return a(P);
|
|
2175
2177
|
}
|
|
2176
2178
|
const zt = /* @__PURE__ */ G({
|
|
2177
2179
|
name: "FComboListDesign",
|