@farris/ui-vue 1.5.0-beta.0 → 1.5.0-beta.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/components/avatar/index.esm.js +897 -901
- package/components/avatar/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +483 -487
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/component/index.esm.js +482 -486
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +543 -547
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +619 -623
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +439 -440
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +423 -425
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +529 -533
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +723 -727
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +504 -508
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +679 -683
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/filter-bar/index.esm.js +503 -507
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +557 -561
- package/components/filter-condition-editor/index.umd.cjs +4 -4
- package/components/flow-canvas/index.esm.js +327 -331
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +502 -506
- package/components/list-view/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +347 -348
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +479 -483
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +1037 -1041
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1238 -1242
- package/components/order/index.umd.cjs +2 -2
- package/components/pagination/index.esm.js +94 -91
- package/components/pagination/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +534 -538
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +785 -789
- package/components/query-solution/index.umd.cjs +5 -5
- package/components/response-layout/index.esm.js +710 -714
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +701 -702
- package/components/schema-selector/index.umd.cjs +3 -3
- package/components/section/index.esm.js +502 -506
- package/components/section/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +556 -560
- package/components/sort-condition-editor/index.umd.cjs +4 -4
- package/components/textarea/index.esm.js +480 -484
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.esm.js +594 -598
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/tooltip/index.esm.js +189 -179
- package/components/tooltip/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +463 -467
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +629 -633
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/video/index.esm.js +632 -636
- package/components/video/index.umd.cjs +1 -1
- package/farris.all.esm.js +2583 -2569
- package/farris.all.umd.cjs +11 -11
- package/index.css +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { ref as m, watch as L, createVNode as u, computed as g, defineComponent
|
|
|
2
2
|
import { isPlainObject as J, cloneDeep as X } from "lodash-es";
|
|
3
3
|
import { withInstall as fe } from "../common/index.esm.js";
|
|
4
4
|
const Y = {}, Z = {};
|
|
5
|
-
function
|
|
6
|
-
const { properties: e, title: c, ignore: s } = a, n = s && Array.isArray(s), r = Object.keys(e).reduce((t,
|
|
5
|
+
function H(a) {
|
|
6
|
+
const { properties: e, title: c, ignore: s } = a, n = s && Array.isArray(s), r = Object.keys(e).reduce((t, i) => ((!n || !s.find((p) => p === i)) && (t[i] = e[i].type === "object" && e[i].properties ? H(e[i]) : X(e[i].default)), t), {});
|
|
7
7
|
if (c && (!n || !s.find((t) => t === "id"))) {
|
|
8
8
|
const t = c.toLowerCase().replace(/-/g, "_");
|
|
9
9
|
r.id = `${t}_${Math.random().toString().slice(2, 6)}`;
|
|
@@ -13,7 +13,7 @@ function I(a) {
|
|
|
13
13
|
function de(a) {
|
|
14
14
|
const { properties: e, title: c, required: s } = a;
|
|
15
15
|
if (s && Array.isArray(s)) {
|
|
16
|
-
const n = s.reduce((r, t) => (r[t] = e[t].type === "object" && e[t].properties ?
|
|
16
|
+
const n = s.reduce((r, t) => (r[t] = e[t].type === "object" && e[t].properties ? H(e[t]) : X(e[t].default), r), {});
|
|
17
17
|
if (c && s.find((r) => r === "id")) {
|
|
18
18
|
const r = c.toLowerCase().replace(/-/g, "_");
|
|
19
19
|
n.id = `${r}_${Math.random().toString().slice(2, 6)}`;
|
|
@@ -34,7 +34,7 @@ function K(a, e = {}, c) {
|
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
function ve(a, e) {
|
|
37
|
-
const c =
|
|
37
|
+
const c = H(e);
|
|
38
38
|
return Object.keys(c).reduce((s, n) => (Object.prototype.hasOwnProperty.call(a, n) && (s[n] && J(s[n]) && J(a[n] || !a[n]) ? Object.assign(s[n], a[n] || {}) : s[n] = a[n]), s), c), c;
|
|
39
39
|
}
|
|
40
40
|
function ee(a, e) {
|
|
@@ -57,7 +57,7 @@ function ge(a, e, c = /* @__PURE__ */ new Map()) {
|
|
|
57
57
|
return ee(s, c);
|
|
58
58
|
}
|
|
59
59
|
function me(a = {}) {
|
|
60
|
-
function e(l,
|
|
60
|
+
function e(l, o, f, v) {
|
|
61
61
|
if (typeof f == "number")
|
|
62
62
|
return v[l].length === f;
|
|
63
63
|
if (typeof f == "object") {
|
|
@@ -71,20 +71,20 @@ function me(a = {}) {
|
|
|
71
71
|
}
|
|
72
72
|
return !1;
|
|
73
73
|
}
|
|
74
|
-
function c(l,
|
|
74
|
+
function c(l, o, f, v) {
|
|
75
75
|
return v[l] && v[l].propertyValue && String(v[l].propertyValue.value) === String(f);
|
|
76
76
|
}
|
|
77
77
|
const s = /* @__PURE__ */ new Map([
|
|
78
78
|
["length", e],
|
|
79
79
|
["getProperty", c]
|
|
80
80
|
]);
|
|
81
|
-
Object.keys(a).reduce((l,
|
|
82
|
-
function n(l,
|
|
81
|
+
Object.keys(a).reduce((l, o) => (l.set(o, a[o]), l), s);
|
|
82
|
+
function n(l, o) {
|
|
83
83
|
const f = l;
|
|
84
|
-
return typeof
|
|
84
|
+
return typeof o == "number" ? [{ target: f, operator: "length", param: null, value: Number(o) }] : typeof o == "boolean" ? [{ target: f, operator: "getProperty", param: l, value: !!o }] : typeof o == "object" ? Object.keys(o).map((v) => {
|
|
85
85
|
if (v === "length")
|
|
86
|
-
return { target: f, operator: "length", param: null, value:
|
|
87
|
-
const y = v, b =
|
|
86
|
+
return { target: f, operator: "length", param: null, value: o[v] };
|
|
87
|
+
const y = v, b = o[v];
|
|
88
88
|
return { target: f, operator: "getProperty", param: y, value: b };
|
|
89
89
|
}) : [];
|
|
90
90
|
}
|
|
@@ -94,29 +94,29 @@ function me(a = {}) {
|
|
|
94
94
|
return f.push(...y), f;
|
|
95
95
|
}, []);
|
|
96
96
|
}
|
|
97
|
-
function t(l,
|
|
97
|
+
function t(l, o) {
|
|
98
98
|
if (s.has(l.operator)) {
|
|
99
99
|
const f = s.get(l.operator);
|
|
100
|
-
return f && f(l.target, l.param, l.value,
|
|
100
|
+
return f && f(l.target, l.param, l.value, o) || !1;
|
|
101
101
|
}
|
|
102
102
|
return !1;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return r(l).reduce((y, b) => y && t(b,
|
|
104
|
+
function i(l, o) {
|
|
105
|
+
return r(l).reduce((y, b) => y && t(b, o), !0);
|
|
106
106
|
}
|
|
107
|
-
function p(l,
|
|
108
|
-
const f = Object.keys(l), v = f.includes("allOf"), y = f.includes("anyOf"), b = v || y, k = (b ? l[b ? v ? "allOf" : "anyOf" : "allOf"] : [l]).map((T) =>
|
|
107
|
+
function p(l, o) {
|
|
108
|
+
const f = Object.keys(l), v = f.includes("allOf"), y = f.includes("anyOf"), b = v || y, k = (b ? l[b ? v ? "allOf" : "anyOf" : "allOf"] : [l]).map((T) => i(T, o));
|
|
109
109
|
return v ? !k.includes(!1) : k.includes(!0);
|
|
110
110
|
}
|
|
111
111
|
return { parseValueSchema: p };
|
|
112
112
|
}
|
|
113
113
|
const he = {}, ye = {};
|
|
114
114
|
me();
|
|
115
|
-
function be(a, e, c = /* @__PURE__ */ new Map(), s = (t,
|
|
116
|
-
return Y[e.title] = e, Z[e.title] = s, he[e.title] = n, ye[e.title] = r, (t = {},
|
|
117
|
-
if (!
|
|
115
|
+
function be(a, e, c = /* @__PURE__ */ new Map(), s = (t, i, p, l) => i, n = {}, r = (t) => t) {
|
|
116
|
+
return Y[e.title] = e, Z[e.title] = s, he[e.title] = n, ye[e.title] = r, (t = {}, i = !0) => {
|
|
117
|
+
if (!i)
|
|
118
118
|
return ee(t, c);
|
|
119
|
-
const p = ge(t, e, c), l = Object.keys(a).reduce((
|
|
119
|
+
const p = ge(t, e, c), l = Object.keys(a).reduce((o, f) => (o[f] = a[f].default, o), {});
|
|
120
120
|
return Object.assign(l, p);
|
|
121
121
|
};
|
|
122
122
|
}
|
|
@@ -359,17 +359,21 @@ const U = {
|
|
|
359
359
|
/**
|
|
360
360
|
* 自定义每页数量
|
|
361
361
|
*/
|
|
362
|
-
pageList: { type: Array, default: [20, 50, 100] }
|
|
362
|
+
pageList: { type: Array, default: [20, 50, 100] },
|
|
363
|
+
/**
|
|
364
|
+
* 是否展示分页汇总信息
|
|
365
|
+
*/
|
|
366
|
+
showPageInfo: { type: Boolean, default: !1 }
|
|
363
367
|
}, ae = be(U, Le, Pe, Ae, De);
|
|
364
368
|
function te(a, e, c, s) {
|
|
365
369
|
const n = m("跳转至"), r = m(""), t = m(a.value);
|
|
366
|
-
L(t, (
|
|
367
|
-
|
|
368
|
-
}), L(a, (
|
|
369
|
-
t.value !==
|
|
370
|
+
L(t, (o, f) => {
|
|
371
|
+
o >= 1 && o <= e.value ? a.value = o : t.value = f;
|
|
372
|
+
}), L(a, (o) => {
|
|
373
|
+
t.value !== o && (t.value = o);
|
|
370
374
|
});
|
|
371
|
-
function o
|
|
372
|
-
t.value =
|
|
375
|
+
function i(o) {
|
|
376
|
+
t.value = o.target.valueAsNumber, s.emit("update:currentPage", t.value), s.emit("changed", {
|
|
373
377
|
pageIndex: t.value,
|
|
374
378
|
pageSize: c.value
|
|
375
379
|
}), s.emit("pageIndexChanged", {
|
|
@@ -377,8 +381,8 @@ function te(a, e, c, s) {
|
|
|
377
381
|
pageSize: c.value
|
|
378
382
|
});
|
|
379
383
|
}
|
|
380
|
-
function p(
|
|
381
|
-
|
|
384
|
+
function p(o) {
|
|
385
|
+
o.key === "Enter" && (t.value = o.target.valueAsNumber, s.emit("update:currentPage", t.value), s.emit("changed", {
|
|
382
386
|
pageIndex: t.value,
|
|
383
387
|
pageSize: c.value
|
|
384
388
|
}), s.emit("pageIndexChanged", {
|
|
@@ -400,8 +404,8 @@ function te(a, e, c, s) {
|
|
|
400
404
|
min: 1,
|
|
401
405
|
max: e.value,
|
|
402
406
|
style: "display: inline-block;margin-left:3px;",
|
|
403
|
-
onBlur: (
|
|
404
|
-
onKeyup: (
|
|
407
|
+
onBlur: (o) => i(o),
|
|
408
|
+
onKeyup: (o) => p(o)
|
|
405
409
|
}, null), r.value]);
|
|
406
410
|
}
|
|
407
411
|
return {
|
|
@@ -413,7 +417,7 @@ function ne(a, e, c, s, n) {
|
|
|
413
417
|
"page-item": !0,
|
|
414
418
|
disabled: e.value
|
|
415
419
|
}));
|
|
416
|
-
function t(
|
|
420
|
+
function t(o) {
|
|
417
421
|
a.value = a.value < c.value ? a.value + 1 : c.value, n.emit("update:currentPage", a.value), n.emit("changed", {
|
|
418
422
|
pageIndex: a.value,
|
|
419
423
|
pageSize: s.value
|
|
@@ -422,7 +426,7 @@ function ne(a, e, c, s, n) {
|
|
|
422
426
|
pageSize: s.value
|
|
423
427
|
});
|
|
424
428
|
}
|
|
425
|
-
function o
|
|
429
|
+
function i(o) {
|
|
426
430
|
a.value = c.value, n.emit("update:currentPage", a.value), n.emit("changed", {
|
|
427
431
|
pageIndex: a.value,
|
|
428
432
|
pageSize: s.value
|
|
@@ -437,7 +441,7 @@ function ne(a, e, c, s, n) {
|
|
|
437
441
|
}, [!e.value && u("a", {
|
|
438
442
|
class: "page-link",
|
|
439
443
|
tabindex: "0",
|
|
440
|
-
onClick: (
|
|
444
|
+
onClick: (o) => t()
|
|
441
445
|
}, [u("span", {
|
|
442
446
|
class: "f-icon f-page-next"
|
|
443
447
|
}, null)]), e.value && u("span", {
|
|
@@ -452,7 +456,7 @@ function ne(a, e, c, s, n) {
|
|
|
452
456
|
}, [!e.value && u("a", {
|
|
453
457
|
class: "page-link",
|
|
454
458
|
tabindex: "0",
|
|
455
|
-
onClick: (
|
|
459
|
+
onClick: (o) => i()
|
|
456
460
|
}, [u("span", {
|
|
457
461
|
class: "f-icon f-page-last"
|
|
458
462
|
}, null)]), e.value && u("span", {
|
|
@@ -478,8 +482,7 @@ function le(a, e) {
|
|
|
478
482
|
return u("li", {
|
|
479
483
|
class: n.value
|
|
480
484
|
}, [u("div", {
|
|
481
|
-
class: "text-truncate"
|
|
482
|
-
style: "line-height: 26px"
|
|
485
|
+
class: "text-truncate"
|
|
483
486
|
}, [u("span", {
|
|
484
487
|
class: "pg-message-text"
|
|
485
488
|
}, [c.value]), u("b", {
|
|
@@ -493,7 +496,7 @@ function le(a, e) {
|
|
|
493
496
|
};
|
|
494
497
|
}
|
|
495
498
|
function se(a, e, c, s, n) {
|
|
496
|
-
const r = m(!1), t = m("显示"),
|
|
499
|
+
const r = m(!1), t = m("显示"), i = m("条"), p = g(() => ({
|
|
497
500
|
dropup: !0,
|
|
498
501
|
"dropdown-right": !0,
|
|
499
502
|
"pg-pagelist": !0,
|
|
@@ -502,7 +505,7 @@ function se(a, e, c, s, n) {
|
|
|
502
505
|
})), l = g(() => ({
|
|
503
506
|
"dropdown-menu": !0,
|
|
504
507
|
show: r.value
|
|
505
|
-
})),
|
|
508
|
+
})), o = (h) => ({
|
|
506
509
|
"w-100": !0,
|
|
507
510
|
"dropdown-item": !0,
|
|
508
511
|
active: e.value === h
|
|
@@ -542,13 +545,13 @@ function se(a, e, c, s, n) {
|
|
|
542
545
|
class: "cur-pagesize"
|
|
543
546
|
}, [e.value]), u("span", {
|
|
544
547
|
class: "pagelist-text"
|
|
545
|
-
}, [
|
|
548
|
+
}, [i.value]), u("i", {
|
|
546
549
|
class: "f-icon f-icon-dropdown"
|
|
547
550
|
}, null)]), u("div", {
|
|
548
551
|
class: l.value,
|
|
549
552
|
style: "margin-bottom: -1px;"
|
|
550
553
|
}, [c.value.map((h) => u("li", {
|
|
551
|
-
class:
|
|
554
|
+
class: o(h),
|
|
552
555
|
onClick: (k) => b(k, h)
|
|
553
556
|
}, [u("span", null, [h])]))])])]);
|
|
554
557
|
}
|
|
@@ -556,7 +559,7 @@ function se(a, e, c, s, n) {
|
|
|
556
559
|
renderPageList: j
|
|
557
560
|
};
|
|
558
561
|
}
|
|
559
|
-
function
|
|
562
|
+
function oe(a, e, c, s, n) {
|
|
560
563
|
const r = (l) => ({
|
|
561
564
|
"page-item": !0,
|
|
562
565
|
current: e.value === l.value,
|
|
@@ -567,8 +570,8 @@ function ie(a, e, c, s, n) {
|
|
|
567
570
|
"f-icon-arrow-seek-left": l.value < e.value,
|
|
568
571
|
"f-icon-arrow-seek-right": l.value > e.value
|
|
569
572
|
});
|
|
570
|
-
function
|
|
571
|
-
e.value =
|
|
573
|
+
function i(l, o) {
|
|
574
|
+
e.value = o, n.emit("update:currentPage", e.value), n.emit("changed", {
|
|
572
575
|
pageIndex: e.value,
|
|
573
576
|
pageSize: s.value
|
|
574
577
|
}), n.emit("pageIndexChanged", {
|
|
@@ -582,7 +585,7 @@ function ie(a, e, c, s, n) {
|
|
|
582
585
|
}, [e.value !== l.value && u("a", {
|
|
583
586
|
class: "page-link",
|
|
584
587
|
tabindex: "0",
|
|
585
|
-
onClick: (
|
|
588
|
+
onClick: (o) => i(o, l.value)
|
|
586
589
|
}, [u("span", {
|
|
587
590
|
class: "page-link-label"
|
|
588
591
|
}, [l.label]), l.label === "..." && u("i", {
|
|
@@ -595,12 +598,12 @@ function ie(a, e, c, s, n) {
|
|
|
595
598
|
renderPageNumbers: p
|
|
596
599
|
};
|
|
597
600
|
}
|
|
598
|
-
function
|
|
601
|
+
function ie(a, e, c, s, n) {
|
|
599
602
|
const r = g(() => ({
|
|
600
603
|
"page-item": !0,
|
|
601
604
|
disabled: e.value
|
|
602
605
|
}));
|
|
603
|
-
function t(
|
|
606
|
+
function t(o) {
|
|
604
607
|
a.value = 1, n.emit("update:currentPage", a.value), n.emit("changed", {
|
|
605
608
|
pageIndex: a.value,
|
|
606
609
|
pageSize: s.value
|
|
@@ -609,7 +612,7 @@ function oe(a, e, c, s, n) {
|
|
|
609
612
|
pageSize: s.value
|
|
610
613
|
});
|
|
611
614
|
}
|
|
612
|
-
function o
|
|
615
|
+
function i(o) {
|
|
613
616
|
a.value = a.value > 2 ? a.value - 1 : 1, n.emit("update:currentPage", a.value), n.emit("changed", {
|
|
614
617
|
pageIndex: a.value,
|
|
615
618
|
pageSize: s.value
|
|
@@ -624,7 +627,7 @@ function oe(a, e, c, s, n) {
|
|
|
624
627
|
}, [c.value && u("a", {
|
|
625
628
|
tabindex: "0",
|
|
626
629
|
class: "page-link",
|
|
627
|
-
onClick: (
|
|
630
|
+
onClick: (o) => t()
|
|
628
631
|
}, [u("span", {
|
|
629
632
|
class: "f-icon f-page-first"
|
|
630
633
|
}, null)]), e.value && u("span", {
|
|
@@ -639,7 +642,7 @@ function oe(a, e, c, s, n) {
|
|
|
639
642
|
}, [c.value && u("a", {
|
|
640
643
|
tabindex: "0",
|
|
641
644
|
class: "page-link",
|
|
642
|
-
onClick: (
|
|
645
|
+
onClick: (o) => i()
|
|
643
646
|
}, [u("span", {
|
|
644
647
|
class: "f-icon f-page-pre"
|
|
645
648
|
}, null)]), e.value && u("span", {
|
|
@@ -655,15 +658,15 @@ function oe(a, e, c, s, n) {
|
|
|
655
658
|
}
|
|
656
659
|
function ue(a) {
|
|
657
660
|
const e = m([]);
|
|
658
|
-
function c(n, r, t,
|
|
661
|
+
function c(n, r, t, i) {
|
|
659
662
|
const p = Math.ceil(t / 2);
|
|
660
|
-
return n === t ?
|
|
663
|
+
return n === t ? i : n === 1 ? n : t < i ? i - p < r ? i - t + n : p < r ? r - p + n : n : n;
|
|
661
664
|
}
|
|
662
|
-
function s(n, r, t,
|
|
663
|
-
const p = [], l = Math.ceil(t / r),
|
|
665
|
+
function s(n, r, t, i) {
|
|
666
|
+
const p = [], l = Math.ceil(t / r), o = Math.ceil(i / 2), f = n <= o, v = l - o < n, y = !f && !v, b = i < l;
|
|
664
667
|
let j = 1;
|
|
665
|
-
for (; j <= l && j <=
|
|
666
|
-
const h = c(j, n,
|
|
668
|
+
for (; j <= l && j <= i; ) {
|
|
669
|
+
const h = c(j, n, i, l), k = j === 2 && (y || v), B = j === i - 1 && (y || f), T = b && (k || B) ? "..." : "" + h;
|
|
667
670
|
p.push({ label: T, value: h }), j++;
|
|
668
671
|
}
|
|
669
672
|
e.value = p;
|
|
@@ -675,9 +678,9 @@ const C = /* @__PURE__ */ Q({
|
|
|
675
678
|
props: U,
|
|
676
679
|
emits: ["changed", "pageIndexChanged", "pageSizeChanged", "update:currentPage", "update:pageSize"],
|
|
677
680
|
setup(a, e) {
|
|
678
|
-
const c = m(!1), s = m(a.mode), n = m(""), r = m(!1), t = m(a.pageSize),
|
|
681
|
+
const c = m(!1), s = m(a.mode), n = m(""), r = m(!1), t = m(a.pageSize), i = m(a.currentPage), p = m(a.totalItems), {
|
|
679
682
|
pages: l,
|
|
680
|
-
updatePages:
|
|
683
|
+
updatePages: o
|
|
681
684
|
} = ue(), f = {
|
|
682
685
|
position: "relative"
|
|
683
686
|
}, v = {
|
|
@@ -687,31 +690,31 @@ const C = /* @__PURE__ */ Q({
|
|
|
687
690
|
background: "rgba(250,250,252,.6)",
|
|
688
691
|
width: "100%",
|
|
689
692
|
height: "100%"
|
|
690
|
-
}, y = g(() => !p.value ||
|
|
693
|
+
}, y = g(() => !p.value || i.value === 1), b = g(() => a.pageList), j = g(() => Math.ceil(p.value / t.value)), h = g(() => !p.value || i.value === j.value), k = g(() => a.showGoButton), B = g(() => i.value > 1), T = g(() => !(r.value && l.value.length <= 1)), z = g(() => a.showPageInfo), E = g(() => a.showPageList), D = g(() => a.showPageNumbers), M = g(() => !0), {
|
|
691
694
|
renderFirstPage: d,
|
|
692
695
|
renderPreviousPage: P
|
|
693
|
-
} =
|
|
696
|
+
} = ie(i, y, B, t, e), {
|
|
694
697
|
renderLastPage: w,
|
|
695
698
|
renderNextPage: S
|
|
696
|
-
} = ne(
|
|
699
|
+
} = ne(i, h, j, t, e), {
|
|
697
700
|
renderPageInfo: O
|
|
698
701
|
} = le(n, p), {
|
|
699
702
|
renderPageList: $
|
|
700
|
-
} = se(
|
|
703
|
+
} = se(i, t, b, p, e), {
|
|
701
704
|
renderPageNumbers: q
|
|
702
|
-
} =
|
|
705
|
+
} = oe(a, i, l, t, e), {
|
|
703
706
|
renderGotoButton: F
|
|
704
|
-
} = te(
|
|
705
|
-
i
|
|
707
|
+
} = te(i, j, t, e);
|
|
708
|
+
o(i.value, t.value, p.value, 7), L(() => a.totalItems, (N) => {
|
|
706
709
|
p.value = N;
|
|
707
|
-
}), L([
|
|
708
|
-
i
|
|
709
|
-
}), L(
|
|
710
|
+
}), L([i, t, p], () => {
|
|
711
|
+
o(i.value, t.value, p.value, 7);
|
|
712
|
+
}), L(i, (N, A) => {
|
|
710
713
|
}), L(t, (N, A) => {
|
|
711
714
|
}), L(() => a.totalItems, (N) => {
|
|
712
|
-
p.value = N, i
|
|
715
|
+
p.value = N, o(i.value, t.value, p.value, 7);
|
|
713
716
|
}), L(() => a.currentPage, (N, A) => {
|
|
714
|
-
N !== A && (
|
|
717
|
+
N !== A && (i.value = N);
|
|
715
718
|
}), L(() => a.pageSize, (N, A) => {
|
|
716
719
|
N !== A && (t.value = N);
|
|
717
720
|
}), re(() => {
|
|
@@ -737,7 +740,7 @@ const C = /* @__PURE__ */ Q({
|
|
|
737
740
|
function W() {
|
|
738
741
|
return u(R, null, [z.value && O(), E.value && $(), M.value && d(), M.value && P(), D.value && q(), M.value && S(), M.value && w(), k.value && F()]);
|
|
739
742
|
}
|
|
740
|
-
function
|
|
743
|
+
function I() {
|
|
741
744
|
return u(R, null, [u("li", {
|
|
742
745
|
class: "page-item d-flex flex-fill"
|
|
743
746
|
}, null), M.value && d(), M.value && P(), F(), u("li", {
|
|
@@ -761,7 +764,7 @@ const C = /* @__PURE__ */ Q({
|
|
|
761
764
|
role: "navigation",
|
|
762
765
|
class: G.value,
|
|
763
766
|
style: _.value
|
|
764
|
-
}, [s.value === "default" ? W() :
|
|
767
|
+
}, [s.value === "default" ? W() : I()])]);
|
|
765
768
|
}
|
|
766
769
|
});
|
|
767
770
|
function Fe(a, e, c) {
|
|
@@ -770,7 +773,7 @@ function Fe(a, e, c) {
|
|
|
770
773
|
function t() {
|
|
771
774
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
772
775
|
}
|
|
773
|
-
function
|
|
776
|
+
function i() {
|
|
774
777
|
return !1;
|
|
775
778
|
}
|
|
776
779
|
function p() {
|
|
@@ -779,12 +782,12 @@ function Fe(a, e, c) {
|
|
|
779
782
|
function l() {
|
|
780
783
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
781
784
|
}
|
|
782
|
-
function
|
|
785
|
+
function o(d) {
|
|
783
786
|
if (!d || !d.value)
|
|
784
787
|
return null;
|
|
785
788
|
if (d.value.schema && d.value.schema.type === "component")
|
|
786
789
|
return d.value;
|
|
787
|
-
const P = m(d == null ? void 0 : d.value.parent), w =
|
|
790
|
+
const P = m(d == null ? void 0 : d.value.parent), w = o(P);
|
|
788
791
|
return w || null;
|
|
789
792
|
}
|
|
790
793
|
function f(d = e) {
|
|
@@ -843,7 +846,7 @@ function Fe(a, e, c) {
|
|
|
843
846
|
}
|
|
844
847
|
return r.value = {
|
|
845
848
|
canMove: t(),
|
|
846
|
-
canSelectParent:
|
|
849
|
+
canSelectParent: i(),
|
|
847
850
|
canDelete: p(),
|
|
848
851
|
canNested: !l(),
|
|
849
852
|
contents: e == null ? void 0 : e.schema.contents,
|
|
@@ -853,7 +856,7 @@ function Fe(a, e, c) {
|
|
|
853
856
|
styles: s,
|
|
854
857
|
designerClass: n,
|
|
855
858
|
canAccepts: v,
|
|
856
|
-
getBelongedComponentInstance:
|
|
859
|
+
getBelongedComponentInstance: o,
|
|
857
860
|
getDraggableDesignItemElement: f,
|
|
858
861
|
getDraggingDisplayText: y,
|
|
859
862
|
getPropConfig: B,
|
|
@@ -873,32 +876,32 @@ const Re = /* @__PURE__ */ Q({
|
|
|
873
876
|
props: U,
|
|
874
877
|
emits: ["pageIndexChanged", "pageSizeChanged"],
|
|
875
878
|
setup(a, e) {
|
|
876
|
-
const c = m(!1), s = m(a.mode), n = m(""), r = m(!1), t = m(a.pageSize),
|
|
879
|
+
const c = m(!1), s = m(a.mode), n = m(""), r = m(!1), t = m(a.pageSize), i = m(a.currentPage), p = m(a.totalItems), l = m(), o = ce("design-item-context"), f = Fe(l, o);
|
|
877
880
|
pe(() => {
|
|
878
881
|
l.value.componentInstance = f;
|
|
879
882
|
}), e.expose(f.value);
|
|
880
883
|
const {
|
|
881
884
|
pages: v,
|
|
882
885
|
updatePages: y
|
|
883
|
-
} = ue(), b = g(() =>
|
|
886
|
+
} = ue(), b = g(() => i.value === 1), j = g(() => [20, 50, 100]), h = g(() => Math.ceil(p.value / t.value)), k = g(() => i.value === h.value), B = g(() => !0), T = g(() => i.value > 1), z = g(() => !(r.value && v.value.length <= 1)), E = g(() => !0), D = g(() => !0), M = g(() => !0), d = g(() => !0), {
|
|
884
887
|
renderFirstPage: P,
|
|
885
888
|
renderPreviousPage: w
|
|
886
|
-
} =
|
|
889
|
+
} = ie(i, b, T, t, e), {
|
|
887
890
|
renderLastPage: S,
|
|
888
891
|
renderNextPage: O
|
|
889
|
-
} = ne(
|
|
892
|
+
} = ne(i, k, h, t, e), {
|
|
890
893
|
renderPageInfo: $
|
|
891
894
|
} = le(n, p), {
|
|
892
895
|
renderPageList: q
|
|
893
|
-
} = se(
|
|
896
|
+
} = se(i, t, j, p, e), {
|
|
894
897
|
renderPageNumbers: F
|
|
895
|
-
} =
|
|
898
|
+
} = oe(a, i, v, t, e), {
|
|
896
899
|
renderGotoButton: V
|
|
897
|
-
} = te(
|
|
898
|
-
y(
|
|
899
|
-
y(
|
|
900
|
-
}), L(
|
|
901
|
-
e.emit("pageIndexChanged",
|
|
900
|
+
} = te(i, h, t, e);
|
|
901
|
+
y(i.value, t.value, p.value, 7), L([i, t], () => {
|
|
902
|
+
y(i.value, t.value, p.value, 7);
|
|
903
|
+
}), L(i, () => {
|
|
904
|
+
e.emit("pageIndexChanged", i.value);
|
|
902
905
|
}), L(t, () => {
|
|
903
906
|
e.emit("pageSizeChanged", t.value);
|
|
904
907
|
});
|
|
@@ -915,7 +918,7 @@ const Re = /* @__PURE__ */ Q({
|
|
|
915
918
|
function W() {
|
|
916
919
|
return u(R, null, [E.value && $(), D.value && q(), d.value && P(), d.value && w(), M.value && F(), d.value && O(), d.value && S(), B.value && V()]);
|
|
917
920
|
}
|
|
918
|
-
function
|
|
921
|
+
function I() {
|
|
919
922
|
return u(R, null, [u("li", {
|
|
920
923
|
class: "page-item d-flex flex-fill"
|
|
921
924
|
}, null), d.value && P(), d.value && w(), V(), u("li", {
|
|
@@ -937,7 +940,7 @@ const Re = /* @__PURE__ */ Q({
|
|
|
937
940
|
role: "navigation",
|
|
938
941
|
class: G.value,
|
|
939
942
|
style: _.value
|
|
940
|
-
}, [s.value === "default" ? W() :
|
|
943
|
+
}, [s.value === "default" ? W() : I()])]);
|
|
941
944
|
}
|
|
942
945
|
});
|
|
943
946
|
C.register = (a, e, c) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.pagination={},k.Vue,k.LodashES,k.common))})(this,function(k,e,E,ne){"use strict";const I={},U={};function x(a){const{properties:t,title:u,ignore:s}=a,l=s&&Array.isArray(s),c=Object.keys(t).reduce((n,i)=>((!l||!s.find(p=>p===i))&&(n[i]=t[i].type==="object"&&t[i].properties?x(t[i]):E.cloneDeep(t[i].default)),n),{});if(u&&(!l||!s.find(n=>n==="id"))){const n=u.toLowerCase().replace(/-/g,"_");c.id=`${n}_${Math.random().toString().slice(2,6)}`}return c}function le(a){const{properties:t,title:u,required:s}=a;if(s&&Array.isArray(s)){const l=s.reduce((c,n)=>(c[n]=t[n].type==="object"&&t[n].properties?x(t[n]):E.cloneDeep(t[n].default),c),{});if(u&&s.find(c=>c==="id")){const c=u.toLowerCase().replace(/-/g,"_");l.id=`${c}_${Math.random().toString().slice(2,6)}`}return l}return{type:u}}function J(a,t={},u){const s=I[a];if(s){let l=le(s);const c=U[a];return l=c?c({getSchemaByType:J},l,t,u):l,l}return null}function oe(a,t){const u=x(t);return Object.keys(u).reduce((s,l)=>(Object.prototype.hasOwnProperty.call(a,l)&&(s[l]&&E.isPlainObject(s[l])&&E.isPlainObject(a[l]||!a[l])?Object.assign(s[l],a[l]||{}):s[l]=a[l]),s),u),u}function Q(a,t){return Object.keys(a).filter(s=>a[s]!=null).reduce((s,l)=>{if(t.has(l)){const c=t.get(l);if(typeof c=="string")s[c]=a[l];else{const n=c(l,a[l],a);Object.assign(s,n)}}else s[l]=a[l];return s},{})}function se(a,t,u=new Map){const s=oe(a,t);return Q(s,u)}function re(a={}){function t(o,r,d,g){if(typeof d=="number")return g[o].length===d;if(typeof d=="object"){const h=Object.keys(d)[0],v=d[h];if(h==="not")return Number(g[o].length)!==Number(v);if(h==="moreThan")return Number(g[o].length)>=Number(v);if(h==="lessThan")return Number(g[o].length)<=Number(v)}return!1}function u(o,r,d,g){return g[o]&&g[o].propertyValue&&String(g[o].propertyValue.value)===String(d)}const s=new Map([["length",t],["getProperty",u]]);Object.keys(a).reduce((o,r)=>(o.set(r,a[r]),o),s);function l(o,r){const d=o;return typeof r=="number"?[{target:d,operator:"length",param:null,value:Number(r)}]:typeof r=="boolean"?[{target:d,operator:"getProperty",param:o,value:!!r}]:typeof r=="object"?Object.keys(r).map(g=>{if(g==="length")return{target:d,operator:"length",param:null,value:r[g]};const h=g,v=r[g];return{target:d,operator:"getProperty",param:h,value:v}}):[]}function c(o){return Object.keys(o).reduce((d,g)=>{const h=l(g,o[g]);return d.push(...h),d},[])}function n(o,r){if(s.has(o.operator)){const d=s.get(o.operator);return d&&d(o.target,o.param,o.value,r)||!1}return!1}function i(o,r){return c(o).reduce((h,v)=>h&&n(v,r),!0)}function p(o,r){const d=Object.keys(o),g=d.includes("allOf"),h=d.includes("anyOf"),v=g||h,V=(v?o[v?g?"allOf":"anyOf":"allOf"]:[o]).map(M=>i(M,r));return g?!V.includes(!1):V.includes(!0)}return{parseValueSchema:p}}const ie={},ce={};re();function ue(a,t,u=new Map,s=(n,i,p,o)=>i,l={},c=n=>n){return I[t.title]=t,U[t.title]=s,ie[t.title]=l,ce[t.title]=c,(n={},i=!0)=>{if(!i)return Q(n,u);const p=se(n,t,u),o=Object.keys(a).reduce((r,d)=>(r[d]=a[d].default,r),{});return Object.assign(o,p)}}function pe(a,t){return{customClass:t.class,customStyle:t.style}}const de=new Map([["appearance",pe]]),fe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/pagination.schema.json",title:"pagination",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a pagination",type:"string"},type:{description:"The type string of pagination component",type:"string",default:"pagination"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]},ge={title:"pagination",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中"},{value:"right",name:"右对齐"}]}}}}}};function me(a,t,u){return t}const F={currentPage:{type:Number,default:1},disabled:{type:Boolean,default:!1},mode:{type:String,default:"default"},pageSize:{type:Number,default:20},totalItems:{type:Number,default:0},showGoButton:{type:Boolean,default:!1},showPageList:{type:Boolean,default:!0},showPageNumbers:{type:Boolean,default:!0},showRedirection:{type:Boolean,default:!0},pageList:{type:Array,default:[20,50,100]}},R=ue(F,fe,de,me,ge);function X(a,t,u,s){const l=e.ref("跳转至"),c=e.ref(""),n=e.ref(a.value);e.watch(n,(r,d)=>{r>=1&&r<=t.value?a.value=r:n.value=d}),e.watch(a,r=>{n.value!==r&&(n.value=r)});function i(r){n.value=r.target.valueAsNumber,s.emit("update:currentPage",n.value),s.emit("changed",{pageIndex:n.value,pageSize:u.value}),s.emit("pageIndexChanged",{pageIndex:n.value,pageSize:u.value})}function p(r){r.key==="Enter"&&(n.value=r.target.valueAsNumber,s.emit("update:currentPage",n.value),s.emit("changed",{pageIndex:n.value,pageSize:u.value}),s.emit("pageIndexChanged",{pageIndex:n.value,pageSize:u.value}))}function o(){return e.createVNode("li",{class:"page-goto-input d-flex flex-row",style:"padding-left: 10px; white-space: nowrap;"},[e.createVNode("span",{class:"pagination-message"},[l.value]),e.createVNode("input",{title:"page-index-spinner",type:"number",class:"form-control farris-gotopagenumber",value:n.value,min:1,max:t.value,style:"display: inline-block;margin-left:3px;",onBlur:r=>i(r),onKeyup:r=>p(r)},null),c.value])}return{renderGotoButton:o}}function Y(a,t,u,s,l){const c=e.computed(()=>({"page-item":!0,disabled:t.value}));function n(r){a.value=a.value<u.value?a.value+1:u.value,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function i(r){a.value=u.value,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function p(){return e.createVNode("li",{class:c.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:r=>n()},[e.createVNode("span",{class:"f-icon f-page-next"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-next"},null)])])}function o(){return e.createVNode("li",{class:c.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:r=>i()},[e.createVNode("span",{class:"f-icon f-page-last"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-last"},null)])])}return{renderLastPage:o,renderNextPage:p}}function Z(a,t){const u=e.ref("共"),s=e.ref("条"),l=e.computed(()=>({"pagination-message":!0,"text-truncate":!0,"d-flex":!0,"ml-auto":a.value==="right","flex-fill":a.value==="right"}));function c(){return e.createVNode("li",{class:l.value},[e.createVNode("div",{class:"text-truncate",style:"line-height: 26px"},[e.createVNode("span",{class:"pg-message-text"},[u.value]),e.createVNode("b",{class:"pg-message-total"},[t.value]),e.createVNode("span",{class:"pg-message-text"},[s.value])])])}return{renderPageInfo:c}}function K(a,t,u,s,l){const c=e.ref(!1),n=e.ref("显示"),i=e.ref("条"),p=e.computed(()=>({dropup:!0,"dropdown-right":!0,"pg-pagelist":!0,"pagelist-disabled":s.value===0,show:c.value})),o=e.computed(()=>({"dropdown-menu":!0,show:c.value})),r=m=>({"w-100":!0,"dropdown-item":!0,active:t.value===m});function d(m){c.value=!0}function g(m){c.value=!1}function h(m,V,O){const T=m*V-V+1;return Math.ceil(T/O)}function v(m,V){const O=a.value;a.value=h(a.value,t.value,V),O!==a.value&&l.emit("update:currentPage",a.value),t.value=V,c.value=!1,l.emit("update:pageSize",t.value),l.emit("changed",{pageIndex:a.value,pageSize:t.value}),l.emit("pageSizeChanged",{pageIndex:a.value,pageSize:t.value})}function w(){return e.createVNode("li",{class:"pagination-pagelist"},[e.createVNode("div",{class:p.value,onMouseenter:m=>d(),onMouseleave:m=>g()},[e.createVNode("div",{class:"pg-pagelist-info"},[e.createVNode("span",{class:"pagelist-text"},[n.value]),e.createVNode("b",{class:"cur-pagesize"},[t.value]),e.createVNode("span",{class:"pagelist-text"},[i.value]),e.createVNode("i",{class:"f-icon f-icon-dropdown"},null)]),e.createVNode("div",{class:o.value,style:"margin-bottom: -1px;"},[u.value.map(m=>e.createVNode("li",{class:r(m),onClick:V=>v(V,m)},[e.createVNode("span",null,[m])]))])])])}return{renderPageList:w}}function ee(a,t,u,s,l){const c=o=>({"page-item":!0,current:t.value===o.value,ellipsis:o.label==="...",disabled:a.disabled}),n=o=>({"f-icon":!0,"f-icon-arrow-seek-left":o.value<t.value,"f-icon-arrow-seek-right":o.value>t.value});function i(o,r){t.value=r,l.emit("update:currentPage",t.value),l.emit("changed",{pageIndex:t.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:t.value,pageSize:s.value})}function p(){return u.value.map(o=>e.createVNode("li",{class:c(o)},[t.value!==o.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:r=>i(r,o.value)},[e.createVNode("span",{class:"page-link-label"},[o.label]),o.label==="..."&&e.createVNode("i",{class:n(o)},null)]),t.value===o.value&&e.createVNode("span",{class:"page-link"},[o.label])]))}return{renderPageNumbers:p}}function te(a,t,u,s,l){const c=e.computed(()=>({"page-item":!0,disabled:t.value}));function n(r){a.value=1,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function i(r){a.value=a.value>2?a.value-1:1,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function p(){return e.createVNode("li",{class:c.value},[u.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:r=>n()},[e.createVNode("span",{class:"f-icon f-page-first"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-first"},null)])])}function o(){return e.createVNode("li",{class:c.value},[u.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:r=>i()},[e.createVNode("span",{class:"f-icon f-page-pre"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-pre"},null)])])}return{renderFirstPage:p,renderPreviousPage:o}}function ae(a){const t=e.ref([]);function u(l,c,n,i){const p=Math.ceil(n/2);return l===n?i:l===1?l:n<i?i-p<c?i-n+l:p<c?c-p+l:l:l}function s(l,c,n,i){const p=[],o=Math.ceil(n/c),r=Math.ceil(i/2),d=l<=r,g=o-r<l,h=!d&&!g,v=i<o;let w=1;for(;w<=o&&w<=i;){const m=u(w,l,i,o),V=w===2&&(h||g),O=w===i-1&&(h||d),M=v&&(V||O)?"...":""+m;p.push({label:M,value:m}),w++}t.value=p}return{pages:t,updatePages:s}}const $=e.defineComponent({name:"FPagination",props:F,emits:["changed","pageIndexChanged","pageSizeChanged","update:currentPage","update:pageSize"],setup(a,t){const u=e.ref(!1),s=e.ref(a.mode),l=e.ref(""),c=e.ref(!1),n=e.ref(a.pageSize),i=e.ref(a.currentPage),p=e.ref(a.totalItems),{pages:o,updatePages:r}=ae(),d={position:"relative"},g={position:"absolute",right:"0",zIndex:1,background:"rgba(250,250,252,.6)",width:"100%",height:"100%"},h=e.computed(()=>!p.value||i.value===1),v=e.computed(()=>a.pageList),w=e.computed(()=>Math.ceil(p.value/n.value)),m=e.computed(()=>!p.value||i.value===w.value),V=e.computed(()=>a.showGoButton),O=e.computed(()=>i.value>1),M=e.computed(()=>!(c.value&&o.value.length<=1)),T=e.computed(()=>!0),B=e.computed(()=>a.showPageList),z=e.computed(()=>a.showPageNumbers),j=e.computed(()=>!0),{renderFirstPage:f,renderPreviousPage:b}=te(i,h,O,n,t),{renderLastPage:y,renderNextPage:N}=Y(i,m,w,n,t),{renderPageInfo:S}=Z(l,p),{renderPageList:L}=K(i,n,v,p,t),{renderPageNumbers:q}=ee(a,i,o,n,t),{renderGotoButton:A}=X(i,w,n,t);r(i.value,n.value,p.value,7),e.watch(()=>a.totalItems,P=>{p.value=P}),e.watch([i,n,p],()=>{r(i.value,n.value,p.value,7)}),e.watch(i,(P,D)=>{}),e.watch(n,(P,D)=>{}),e.watch(()=>a.totalItems,P=>{p.value=P,r(i.value,n.value,p.value,7)}),e.watch(()=>a.currentPage,(P,D)=>{P!==D&&(i.value=P)}),e.watch(()=>a.pageSize,(P,D)=>{P!==D&&(n.value=P)}),e.watchEffect(()=>{if(!v.value||!v.value.length)return;const P=v.value.includes(n.value);n.value=P?n.value:v.value[0],P||t.emit("update:pageSize",n.value)})();const G=e.computed(()=>({"d-flex":!0,"flex-wrap":!0,"justify-content-end":!0,"w-100":!0,"ngx-pagination":!0,pagination:!0,responsive:u.value,"pager-viewmode-default":s.value==="default","pager-viewmode-simple":s.value==="simple"})),_=e.computed(()=>({position:"relative","justify-content":l.value==="center"?"center":"start"}));function W(){return e.createVNode(e.Fragment,null,[T.value&&S(),B.value&&L(),j.value&&f(),j.value&&b(),z.value&&q(),j.value&&N(),j.value&&y(),V.value&&A()])}function H(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),j.value&&f(),j.value&&b(),A(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),w.value])]),j.value&&N(),j.value&&y()])}return()=>e.createVNode("div",{class:"pagination-container",style:d},[a.disabled&&e.createVNode("div",{style:g},null),M.value&&e.createVNode("ul",{role:"navigation",class:G.value,style:_.value},[s.value==="default"?W():H()])])}});function he(a,t,u){var j;const s="",l="",c=e.ref();function n(){return(t==null?void 0:t.schema.componentType)!=="frame"}function i(){return!1}function p(){return(t==null?void 0:t.schema.componentType)!=="frame"}function o(){return(t==null?void 0:t.schema.componentType)==="frame"}function r(f){if(!f||!f.value)return null;if(f.value.schema&&f.value.schema.type==="component")return f.value;const b=e.ref(f==null?void 0:f.value.parent),y=r(b);return y||null}function d(f=t){var S;const{componentInstance:b,designerItemElementRef:y}=f;if(!b||!b.value)return null;const{getCustomButtons:N}=b.value;return b.value.canMove||N&&((S=N())!=null&&S.length)?y:d(f.parent)}function g(f){return!!u}function h(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function v(){}function w(f,b){var y;!f||!b||(y=t==null?void 0:t.setupContext)==null||y.emit("dragEnd")}function m(f,b){const{componentType:y}=f;let N=J(y,f,b);const S=y.toLowerCase().replace(/-/g,"_");return N&&!N.id&&N.type===y&&(N.id=`${S}_${Math.random().toString().slice(2,6)}`),N}function V(f){}function O(...f){}function M(f){if(!f)return;const b=t==null?void 0:t.schema,{formSchemaUtils:y}=f;if(b&&y.getExpressions().length){const N=y.getExpressions().findIndex(S=>S.target===b.id);N>-1&&y.getExpressions().splice(N,1)}}function T(f){M(f),t!=null&&t.schema.contents&&t.schema.contents.map(b=>{let y=b.id;b.type==="component-ref"&&(y=b.component);const N=a.value.querySelectorAll(`#${y}-design-item`);N!=null&&N.length&&Array.from(N).map(S=>{var L;(L=S==null?void 0:S.componentInstance)!=null&&L.value.onRemoveComponent&&S.componentInstance.value.onRemoveComponent(f)})})}function B(){}function z(f){}return c.value={canMove:n(),canSelectParent:i(),canDelete:p(),canNested:!o(),contents:t==null?void 0:t.schema.contents,elementRef:a,parent:(j=t==null?void 0:t.parent)==null?void 0:j.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:l,canAccepts:g,getBelongedComponentInstance:r,getDraggableDesignItemElement:d,getDraggingDisplayText:h,getPropConfig:O,getDragScopeElement:v,onAcceptMovedChildElement:w,onChildElementMovedOut:V,addNewChildComponentSchema:m,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:T,getCustomButtons:B,onPropertyChanged:z},c}const ve=e.defineComponent({name:"FPagination",props:F,emits:["pageIndexChanged","pageSizeChanged"],setup(a,t){const u=e.ref(!1),s=e.ref(a.mode),l=e.ref(""),c=e.ref(!1),n=e.ref(a.pageSize),i=e.ref(a.currentPage),p=e.ref(a.totalItems),o=e.ref(),r=e.inject("design-item-context"),d=he(o,r);e.onMounted(()=>{o.value.componentInstance=d}),t.expose(d.value);const{pages:g,updatePages:h}=ae(),v=e.computed(()=>i.value===1),w=e.computed(()=>[20,50,100]),m=e.computed(()=>Math.ceil(p.value/n.value)),V=e.computed(()=>i.value===m.value),O=e.computed(()=>!0),M=e.computed(()=>i.value>1),T=e.computed(()=>!(c.value&&g.value.length<=1)),B=e.computed(()=>!0),z=e.computed(()=>!0),j=e.computed(()=>!0),f=e.computed(()=>!0),{renderFirstPage:b,renderPreviousPage:y}=te(i,v,M,n,t),{renderLastPage:N,renderNextPage:S}=Y(i,V,m,n,t),{renderPageInfo:L}=Z(l,p),{renderPageList:q}=K(i,n,w,p,t),{renderPageNumbers:A}=ee(a,i,g,n,t),{renderGotoButton:C}=X(i,m,n,t);h(i.value,n.value,p.value,7),e.watch([i,n],()=>{h(i.value,n.value,p.value,7)}),e.watch(i,()=>{t.emit("pageIndexChanged",i.value)}),e.watch(n,()=>{t.emit("pageSizeChanged",n.value)});const G=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:u.value,"pager-viewmode-default":s.value==="default","pager-viewmode-simple":s.value==="simple"})),_=e.computed(()=>({position:"relative","justify-content":l.value==="center"?"center":"start"}));function W(){return e.createVNode(e.Fragment,null,[B.value&&L(),z.value&&q(),f.value&&b(),f.value&&y(),j.value&&A(),f.value&&S(),f.value&&N(),O.value&&C()])}function H(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),f.value&&b(),f.value&&y(),C(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),m.value])]),f.value&&S(),f.value&&N()])}return()=>e.createVNode("div",{ref:o,class:"pagination-container"},[T.value&&e.createVNode("ul",{role:"navigation",class:G.value,style:_.value},[s.value==="default"?W():H()])])}});$.register=(a,t,u)=>{a.pagination=$,t.pagination=R},$.registerDesigner=(a,t,u)=>{a.pagination=ve,t.pagination=R};const ye=ne.withInstall($);k.FPagination=$,k.default=ye,k.paginationProps=F,k.propsResolver=R,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.pagination={},k.Vue,k.LodashES,k.common))})(this,function(k,e,E,ne){"use strict";const H={},U={};function R(a){const{properties:t,title:u,ignore:s}=a,l=s&&Array.isArray(s),c=Object.keys(t).reduce((n,i)=>((!l||!s.find(p=>p===i))&&(n[i]=t[i].type==="object"&&t[i].properties?R(t[i]):E.cloneDeep(t[i].default)),n),{});if(u&&(!l||!s.find(n=>n==="id"))){const n=u.toLowerCase().replace(/-/g,"_");c.id=`${n}_${Math.random().toString().slice(2,6)}`}return c}function le(a){const{properties:t,title:u,required:s}=a;if(s&&Array.isArray(s)){const l=s.reduce((c,n)=>(c[n]=t[n].type==="object"&&t[n].properties?R(t[n]):E.cloneDeep(t[n].default),c),{});if(u&&s.find(c=>c==="id")){const c=u.toLowerCase().replace(/-/g,"_");l.id=`${c}_${Math.random().toString().slice(2,6)}`}return l}return{type:u}}function J(a,t={},u){const s=H[a];if(s){let l=le(s);const c=U[a];return l=c?c({getSchemaByType:J},l,t,u):l,l}return null}function oe(a,t){const u=R(t);return Object.keys(u).reduce((s,l)=>(Object.prototype.hasOwnProperty.call(a,l)&&(s[l]&&E.isPlainObject(s[l])&&E.isPlainObject(a[l]||!a[l])?Object.assign(s[l],a[l]||{}):s[l]=a[l]),s),u),u}function Q(a,t){return Object.keys(a).filter(s=>a[s]!=null).reduce((s,l)=>{if(t.has(l)){const c=t.get(l);if(typeof c=="string")s[c]=a[l];else{const n=c(l,a[l],a);Object.assign(s,n)}}else s[l]=a[l];return s},{})}function se(a,t,u=new Map){const s=oe(a,t);return Q(s,u)}function re(a={}){function t(o,r,d,g){if(typeof d=="number")return g[o].length===d;if(typeof d=="object"){const h=Object.keys(d)[0],v=d[h];if(h==="not")return Number(g[o].length)!==Number(v);if(h==="moreThan")return Number(g[o].length)>=Number(v);if(h==="lessThan")return Number(g[o].length)<=Number(v)}return!1}function u(o,r,d,g){return g[o]&&g[o].propertyValue&&String(g[o].propertyValue.value)===String(d)}const s=new Map([["length",t],["getProperty",u]]);Object.keys(a).reduce((o,r)=>(o.set(r,a[r]),o),s);function l(o,r){const d=o;return typeof r=="number"?[{target:d,operator:"length",param:null,value:Number(r)}]:typeof r=="boolean"?[{target:d,operator:"getProperty",param:o,value:!!r}]:typeof r=="object"?Object.keys(r).map(g=>{if(g==="length")return{target:d,operator:"length",param:null,value:r[g]};const h=g,v=r[g];return{target:d,operator:"getProperty",param:h,value:v}}):[]}function c(o){return Object.keys(o).reduce((d,g)=>{const h=l(g,o[g]);return d.push(...h),d},[])}function n(o,r){if(s.has(o.operator)){const d=s.get(o.operator);return d&&d(o.target,o.param,o.value,r)||!1}return!1}function i(o,r){return c(o).reduce((h,v)=>h&&n(v,r),!0)}function p(o,r){const d=Object.keys(o),g=d.includes("allOf"),h=d.includes("anyOf"),v=g||h,V=(v?o[v?g?"allOf":"anyOf":"allOf"]:[o]).map(M=>i(M,r));return g?!V.includes(!1):V.includes(!0)}return{parseValueSchema:p}}const ie={},ce={};re();function ue(a,t,u=new Map,s=(n,i,p,o)=>i,l={},c=n=>n){return H[t.title]=t,U[t.title]=s,ie[t.title]=l,ce[t.title]=c,(n={},i=!0)=>{if(!i)return Q(n,u);const p=se(n,t,u),o=Object.keys(a).reduce((r,d)=>(r[d]=a[d].default,r),{});return Object.assign(o,p)}}function pe(a,t){return{customClass:t.class,customStyle:t.style}}const de=new Map([["appearance",pe]]),fe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/pagination.schema.json",title:"pagination",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a pagination",type:"string"},type:{description:"The type string of pagination component",type:"string",default:"pagination"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]},ge={title:"pagination",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中"},{value:"right",name:"右对齐"}]}}}}}};function me(a,t,u){return t}const F={currentPage:{type:Number,default:1},disabled:{type:Boolean,default:!1},mode:{type:String,default:"default"},pageSize:{type:Number,default:20},totalItems:{type:Number,default:0},showGoButton:{type:Boolean,default:!1},showPageList:{type:Boolean,default:!0},showPageNumbers:{type:Boolean,default:!0},showRedirection:{type:Boolean,default:!0},pageList:{type:Array,default:[20,50,100]},showPageInfo:{type:Boolean,default:!1}},q=ue(F,fe,de,me,ge);function X(a,t,u,s){const l=e.ref("跳转至"),c=e.ref(""),n=e.ref(a.value);e.watch(n,(r,d)=>{r>=1&&r<=t.value?a.value=r:n.value=d}),e.watch(a,r=>{n.value!==r&&(n.value=r)});function i(r){n.value=r.target.valueAsNumber,s.emit("update:currentPage",n.value),s.emit("changed",{pageIndex:n.value,pageSize:u.value}),s.emit("pageIndexChanged",{pageIndex:n.value,pageSize:u.value})}function p(r){r.key==="Enter"&&(n.value=r.target.valueAsNumber,s.emit("update:currentPage",n.value),s.emit("changed",{pageIndex:n.value,pageSize:u.value}),s.emit("pageIndexChanged",{pageIndex:n.value,pageSize:u.value}))}function o(){return e.createVNode("li",{class:"page-goto-input d-flex flex-row",style:"padding-left: 10px; white-space: nowrap;"},[e.createVNode("span",{class:"pagination-message"},[l.value]),e.createVNode("input",{title:"page-index-spinner",type:"number",class:"form-control farris-gotopagenumber",value:n.value,min:1,max:t.value,style:"display: inline-block;margin-left:3px;",onBlur:r=>i(r),onKeyup:r=>p(r)},null),c.value])}return{renderGotoButton:o}}function Y(a,t,u,s,l){const c=e.computed(()=>({"page-item":!0,disabled:t.value}));function n(r){a.value=a.value<u.value?a.value+1:u.value,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function i(r){a.value=u.value,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function p(){return e.createVNode("li",{class:c.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:r=>n()},[e.createVNode("span",{class:"f-icon f-page-next"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-next"},null)])])}function o(){return e.createVNode("li",{class:c.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:r=>i()},[e.createVNode("span",{class:"f-icon f-page-last"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-last"},null)])])}return{renderLastPage:o,renderNextPage:p}}function Z(a,t){const u=e.ref("共"),s=e.ref("条"),l=e.computed(()=>({"pagination-message":!0,"text-truncate":!0,"d-flex":!0,"ml-auto":a.value==="right","flex-fill":a.value==="right"}));function c(){return e.createVNode("li",{class:l.value},[e.createVNode("div",{class:"text-truncate"},[e.createVNode("span",{class:"pg-message-text"},[u.value]),e.createVNode("b",{class:"pg-message-total"},[t.value]),e.createVNode("span",{class:"pg-message-text"},[s.value])])])}return{renderPageInfo:c}}function K(a,t,u,s,l){const c=e.ref(!1),n=e.ref("显示"),i=e.ref("条"),p=e.computed(()=>({dropup:!0,"dropdown-right":!0,"pg-pagelist":!0,"pagelist-disabled":s.value===0,show:c.value})),o=e.computed(()=>({"dropdown-menu":!0,show:c.value})),r=m=>({"w-100":!0,"dropdown-item":!0,active:t.value===m});function d(m){c.value=!0}function g(m){c.value=!1}function h(m,V,O){const T=m*V-V+1;return Math.ceil(T/O)}function v(m,V){const O=a.value;a.value=h(a.value,t.value,V),O!==a.value&&l.emit("update:currentPage",a.value),t.value=V,c.value=!1,l.emit("update:pageSize",t.value),l.emit("changed",{pageIndex:a.value,pageSize:t.value}),l.emit("pageSizeChanged",{pageIndex:a.value,pageSize:t.value})}function w(){return e.createVNode("li",{class:"pagination-pagelist"},[e.createVNode("div",{class:p.value,onMouseenter:m=>d(),onMouseleave:m=>g()},[e.createVNode("div",{class:"pg-pagelist-info"},[e.createVNode("span",{class:"pagelist-text"},[n.value]),e.createVNode("b",{class:"cur-pagesize"},[t.value]),e.createVNode("span",{class:"pagelist-text"},[i.value]),e.createVNode("i",{class:"f-icon f-icon-dropdown"},null)]),e.createVNode("div",{class:o.value,style:"margin-bottom: -1px;"},[u.value.map(m=>e.createVNode("li",{class:r(m),onClick:V=>v(V,m)},[e.createVNode("span",null,[m])]))])])])}return{renderPageList:w}}function ee(a,t,u,s,l){const c=o=>({"page-item":!0,current:t.value===o.value,ellipsis:o.label==="...",disabled:a.disabled}),n=o=>({"f-icon":!0,"f-icon-arrow-seek-left":o.value<t.value,"f-icon-arrow-seek-right":o.value>t.value});function i(o,r){t.value=r,l.emit("update:currentPage",t.value),l.emit("changed",{pageIndex:t.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:t.value,pageSize:s.value})}function p(){return u.value.map(o=>e.createVNode("li",{class:c(o)},[t.value!==o.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:r=>i(r,o.value)},[e.createVNode("span",{class:"page-link-label"},[o.label]),o.label==="..."&&e.createVNode("i",{class:n(o)},null)]),t.value===o.value&&e.createVNode("span",{class:"page-link"},[o.label])]))}return{renderPageNumbers:p}}function te(a,t,u,s,l){const c=e.computed(()=>({"page-item":!0,disabled:t.value}));function n(r){a.value=1,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function i(r){a.value=a.value>2?a.value-1:1,l.emit("update:currentPage",a.value),l.emit("changed",{pageIndex:a.value,pageSize:s.value}),l.emit("pageIndexChanged",{pageIndex:a.value,pageSize:s.value})}function p(){return e.createVNode("li",{class:c.value},[u.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:r=>n()},[e.createVNode("span",{class:"f-icon f-page-first"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-first"},null)])])}function o(){return e.createVNode("li",{class:c.value},[u.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:r=>i()},[e.createVNode("span",{class:"f-icon f-page-pre"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-pre"},null)])])}return{renderFirstPage:p,renderPreviousPage:o}}function ae(a){const t=e.ref([]);function u(l,c,n,i){const p=Math.ceil(n/2);return l===n?i:l===1?l:n<i?i-p<c?i-n+l:p<c?c-p+l:l:l}function s(l,c,n,i){const p=[],o=Math.ceil(n/c),r=Math.ceil(i/2),d=l<=r,g=o-r<l,h=!d&&!g,v=i<o;let w=1;for(;w<=o&&w<=i;){const m=u(w,l,i,o),V=w===2&&(h||g),O=w===i-1&&(h||d),M=v&&(V||O)?"...":""+m;p.push({label:M,value:m}),w++}t.value=p}return{pages:t,updatePages:s}}const $=e.defineComponent({name:"FPagination",props:F,emits:["changed","pageIndexChanged","pageSizeChanged","update:currentPage","update:pageSize"],setup(a,t){const u=e.ref(!1),s=e.ref(a.mode),l=e.ref(""),c=e.ref(!1),n=e.ref(a.pageSize),i=e.ref(a.currentPage),p=e.ref(a.totalItems),{pages:o,updatePages:r}=ae(),d={position:"relative"},g={position:"absolute",right:"0",zIndex:1,background:"rgba(250,250,252,.6)",width:"100%",height:"100%"},h=e.computed(()=>!p.value||i.value===1),v=e.computed(()=>a.pageList),w=e.computed(()=>Math.ceil(p.value/n.value)),m=e.computed(()=>!p.value||i.value===w.value),V=e.computed(()=>a.showGoButton),O=e.computed(()=>i.value>1),M=e.computed(()=>!(c.value&&o.value.length<=1)),T=e.computed(()=>a.showPageInfo),B=e.computed(()=>a.showPageList),z=e.computed(()=>a.showPageNumbers),j=e.computed(()=>!0),{renderFirstPage:f,renderPreviousPage:b}=te(i,h,O,n,t),{renderLastPage:y,renderNextPage:N}=Y(i,m,w,n,t),{renderPageInfo:S}=Z(l,p),{renderPageList:L}=K(i,n,v,p,t),{renderPageNumbers:x}=ee(a,i,o,n,t),{renderGotoButton:A}=X(i,w,n,t);r(i.value,n.value,p.value,7),e.watch(()=>a.totalItems,P=>{p.value=P}),e.watch([i,n,p],()=>{r(i.value,n.value,p.value,7)}),e.watch(i,(P,D)=>{}),e.watch(n,(P,D)=>{}),e.watch(()=>a.totalItems,P=>{p.value=P,r(i.value,n.value,p.value,7)}),e.watch(()=>a.currentPage,(P,D)=>{P!==D&&(i.value=P)}),e.watch(()=>a.pageSize,(P,D)=>{P!==D&&(n.value=P)}),e.watchEffect(()=>{if(!v.value||!v.value.length)return;const P=v.value.includes(n.value);n.value=P?n.value:v.value[0],P||t.emit("update:pageSize",n.value)})();const G=e.computed(()=>({"d-flex":!0,"flex-wrap":!0,"justify-content-end":!0,"w-100":!0,"ngx-pagination":!0,pagination:!0,responsive:u.value,"pager-viewmode-default":s.value==="default","pager-viewmode-simple":s.value==="simple"})),_=e.computed(()=>({position:"relative","justify-content":l.value==="center"?"center":"start"}));function W(){return e.createVNode(e.Fragment,null,[T.value&&S(),B.value&&L(),j.value&&f(),j.value&&b(),z.value&&x(),j.value&&N(),j.value&&y(),V.value&&A()])}function I(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),j.value&&f(),j.value&&b(),A(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),w.value])]),j.value&&N(),j.value&&y()])}return()=>e.createVNode("div",{class:"pagination-container",style:d},[a.disabled&&e.createVNode("div",{style:g},null),M.value&&e.createVNode("ul",{role:"navigation",class:G.value,style:_.value},[s.value==="default"?W():I()])])}});function he(a,t,u){var j;const s="",l="",c=e.ref();function n(){return(t==null?void 0:t.schema.componentType)!=="frame"}function i(){return!1}function p(){return(t==null?void 0:t.schema.componentType)!=="frame"}function o(){return(t==null?void 0:t.schema.componentType)==="frame"}function r(f){if(!f||!f.value)return null;if(f.value.schema&&f.value.schema.type==="component")return f.value;const b=e.ref(f==null?void 0:f.value.parent),y=r(b);return y||null}function d(f=t){var S;const{componentInstance:b,designerItemElementRef:y}=f;if(!b||!b.value)return null;const{getCustomButtons:N}=b.value;return b.value.canMove||N&&((S=N())!=null&&S.length)?y:d(f.parent)}function g(f){return!!u}function h(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function v(){}function w(f,b){var y;!f||!b||(y=t==null?void 0:t.setupContext)==null||y.emit("dragEnd")}function m(f,b){const{componentType:y}=f;let N=J(y,f,b);const S=y.toLowerCase().replace(/-/g,"_");return N&&!N.id&&N.type===y&&(N.id=`${S}_${Math.random().toString().slice(2,6)}`),N}function V(f){}function O(...f){}function M(f){if(!f)return;const b=t==null?void 0:t.schema,{formSchemaUtils:y}=f;if(b&&y.getExpressions().length){const N=y.getExpressions().findIndex(S=>S.target===b.id);N>-1&&y.getExpressions().splice(N,1)}}function T(f){M(f),t!=null&&t.schema.contents&&t.schema.contents.map(b=>{let y=b.id;b.type==="component-ref"&&(y=b.component);const N=a.value.querySelectorAll(`#${y}-design-item`);N!=null&&N.length&&Array.from(N).map(S=>{var L;(L=S==null?void 0:S.componentInstance)!=null&&L.value.onRemoveComponent&&S.componentInstance.value.onRemoveComponent(f)})})}function B(){}function z(f){}return c.value={canMove:n(),canSelectParent:i(),canDelete:p(),canNested:!o(),contents:t==null?void 0:t.schema.contents,elementRef:a,parent:(j=t==null?void 0:t.parent)==null?void 0:j.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:l,canAccepts:g,getBelongedComponentInstance:r,getDraggableDesignItemElement:d,getDraggingDisplayText:h,getPropConfig:O,getDragScopeElement:v,onAcceptMovedChildElement:w,onChildElementMovedOut:V,addNewChildComponentSchema:m,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:T,getCustomButtons:B,onPropertyChanged:z},c}const ve=e.defineComponent({name:"FPagination",props:F,emits:["pageIndexChanged","pageSizeChanged"],setup(a,t){const u=e.ref(!1),s=e.ref(a.mode),l=e.ref(""),c=e.ref(!1),n=e.ref(a.pageSize),i=e.ref(a.currentPage),p=e.ref(a.totalItems),o=e.ref(),r=e.inject("design-item-context"),d=he(o,r);e.onMounted(()=>{o.value.componentInstance=d}),t.expose(d.value);const{pages:g,updatePages:h}=ae(),v=e.computed(()=>i.value===1),w=e.computed(()=>[20,50,100]),m=e.computed(()=>Math.ceil(p.value/n.value)),V=e.computed(()=>i.value===m.value),O=e.computed(()=>!0),M=e.computed(()=>i.value>1),T=e.computed(()=>!(c.value&&g.value.length<=1)),B=e.computed(()=>!0),z=e.computed(()=>!0),j=e.computed(()=>!0),f=e.computed(()=>!0),{renderFirstPage:b,renderPreviousPage:y}=te(i,v,M,n,t),{renderLastPage:N,renderNextPage:S}=Y(i,V,m,n,t),{renderPageInfo:L}=Z(l,p),{renderPageList:x}=K(i,n,w,p,t),{renderPageNumbers:A}=ee(a,i,g,n,t),{renderGotoButton:C}=X(i,m,n,t);h(i.value,n.value,p.value,7),e.watch([i,n],()=>{h(i.value,n.value,p.value,7)}),e.watch(i,()=>{t.emit("pageIndexChanged",i.value)}),e.watch(n,()=>{t.emit("pageSizeChanged",n.value)});const G=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:u.value,"pager-viewmode-default":s.value==="default","pager-viewmode-simple":s.value==="simple"})),_=e.computed(()=>({position:"relative","justify-content":l.value==="center"?"center":"start"}));function W(){return e.createVNode(e.Fragment,null,[B.value&&L(),z.value&&x(),f.value&&b(),f.value&&y(),j.value&&A(),f.value&&S(),f.value&&N(),O.value&&C()])}function I(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),f.value&&b(),f.value&&y(),C(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),m.value])]),f.value&&S(),f.value&&N()])}return()=>e.createVNode("div",{ref:o,class:"pagination-container"},[T.value&&e.createVNode("ul",{role:"navigation",class:G.value,style:_.value},[s.value==="default"?W():I()])])}});$.register=(a,t,u)=>{a.pagination=$,t.pagination=q},$.registerDesigner=(a,t,u)=>{a.pagination=ve,t.pagination=q};const ye=ne.withInstall($);k.FPagination=$,k.default=ye,k.paginationProps=F,k.propsResolver=q,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|