@silver-formily/element-plus 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +32 -0
- package/README.md +32 -35
- package/esm/__builtins__/index.mjs +15 -16
- package/esm/__builtins__/shared/index.mjs +11 -12
- package/esm/__builtins__/shared/transform-component.d.ts +2 -6
- package/esm/__builtins__/shared/transform-component.mjs +16 -33
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs +10 -10
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +58 -58
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-cards/index.mjs +44 -44
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +59 -58
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-items/index.mjs +46 -43
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +15 -14
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-table/array-table.d.ts +28 -0
- package/esm/array-table/index.d.ts +28 -0
- package/esm/array-table/index.mjs +113 -111
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/types.d.ts +1 -0
- package/esm/cascader/index.mjs +19 -20
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/checkbox-group.d.ts +1 -4
- package/esm/checkbox/index.d.ts +442 -379
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/editable/editable.d.ts +16 -12
- package/esm/editable/index.d.ts +8 -6
- package/esm/editable/index.mjs +110 -112
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +29 -28
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +42 -43
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-dialog/index.d.ts +1 -1
- package/esm/form-dialog/index.mjs +4 -4
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +6 -6
- package/esm/form-drawer/index.d.ts +1 -1
- package/esm/form-drawer/index.mjs +4 -4
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +6 -6
- package/esm/form-grid/index.d.ts +1 -183
- package/esm/form-grid/index.mjs +1 -1
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/form-item.d.ts +2 -1
- package/esm/form-item/index.d.ts +12 -6
- package/esm/form-item/index.mjs +163 -155
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/types.d.ts +0 -1
- package/esm/form-layout/form-layout.d.ts +0 -1
- package/esm/form-layout/form-layout.mjs +53 -52
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/types.d.ts +0 -2
- package/esm/form-layout/utils.d.ts +3 -3
- package/esm/form-layout/utils.mjs +48 -43
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +27 -25
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-tab/index.d.ts +1 -26
- package/esm/form-tab/index.mjs +30 -30
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/index.d.ts +3 -0
- package/esm/index.mjs +44 -38
- package/esm/index.mjs.map +1 -1
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.d.ts +258 -147
- package/esm/pagination/pagination.mjs +109 -110
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/index.d.ts +5 -0
- package/esm/preview-text/index.mjs +165 -141
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/rate.d.ts +5 -0
- package/esm/preview-text/utils.d.ts +5 -5
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/radio/index.d.ts +344 -194
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.d.ts +187 -0
- package/esm/rate/index.mjs +14 -0
- package/esm/rate/index.mjs.map +1 -0
- package/esm/reset/index.d.ts +1 -62
- package/esm/reset/index.mjs +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/segmented/index.d.ts +26 -0
- package/esm/segmented/index.mjs +37 -0
- package/esm/segmented/index.mjs.map +1 -0
- package/esm/segmented/segmented.d.ts +25 -0
- package/esm/select/index.mjs +8 -8
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.d.ts +28 -0
- package/esm/select-table/index.mjs +48 -47
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/select-table/select-table.d.ts +56 -0
- package/esm/slider/index.d.ts +177 -0
- package/esm/slider/index.mjs +14 -0
- package/esm/slider/index.mjs.map +1 -0
- package/esm/submit/index.d.ts +1 -47
- package/esm/submit/index.mjs +1 -1
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +225 -189
- package/esm/time-select/index.d.ts +163 -103
- package/esm/transfer/index.d.ts +196 -115
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.mjs +26 -26
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.d.ts +404 -399
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +800 -790
- package/esm/vendor/icon.mjs.map +1 -1
- package/esm/vendor/lodash.mjs +12 -20
- package/esm/vendor/lodash.mjs.map +1 -1
- package/esm/vendor/runtime.mjs +29 -24
- package/esm/vendor/runtime.mjs.map +1 -1
- package/esm/vendor/shared.esm-bundler.mjs +2 -2
- package/esm/vendor/sizes.mjs.map +1 -1
- package/esm/vendor/types.mjs +5 -5
- package/esm/vendor/types.mjs.map +1 -1
- package/package.json +8 -9
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { DArrowLeft as ce, MoreFilled as re, DArrowRight as pe, ArrowRight as fe, ArrowLeft as
|
|
2
|
-
import { useLocale as R, useNamespace as O, ElInput as
|
|
1
|
+
import { DArrowLeft as ce, MoreFilled as re, DArrowRight as pe, ArrowRight as fe, ArrowLeft as me } from "@element-plus/icons-vue";
|
|
2
|
+
import { useLocale as R, useNamespace as O, ElInput as ve, ElIcon as oe, CHANGE_EVENT as X, ElBadge as H, ElSelect as be, ElOption as Pe, useSizeProp as Ce, useGlobalSize as he, useDeprecated as ze, elPaginationKey as Se } from "element-plus";
|
|
3
3
|
import { inject as ye, defineComponent as U, ref as M, computed as C, createElementBlock as w, openBlock as d, unref as t, normalizeClass as k, createElementVNode as j, createVNode as ne, toDisplayString as D, createBlock as z, withCtx as A, resolveDynamicComponent as ue, watchEffect as ke, withKeys as Ne, createCommentVNode as ae, Fragment as de, renderList as ge, watch as Y, getCurrentInstance as Ee, provide as xe, h as I } from "vue";
|
|
4
4
|
import { paginationJumperProps as $e } from "./components/jumper.mjs";
|
|
5
5
|
import { paginationNextProps as Te } from "./components/next.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { useObserver as Me } from "@formily/reactive-vue";
|
|
6
|
+
import { useObserver as Me, formilyComputed as te } from "@silver-formily/reactive-vue";
|
|
8
7
|
import { useField as we } from "@silver-formily/vue";
|
|
9
8
|
import { paginationPagerProps as _e } from "./components/pager.mjs";
|
|
10
9
|
import { paginationPrevEmits as Le, paginationPrevProps as Be } from "./components/prev.mjs";
|
|
@@ -12,19 +11,19 @@ import { isEqual as Ie, isArr as Ae } from "@formily/shared";
|
|
|
12
11
|
import { p as qe, m as Fe } from "../vendor/sizes.mjs";
|
|
13
12
|
import { paginationTotalProps as Ke } from "./components/total.mjs";
|
|
14
13
|
import { b as je, d as De } from "../vendor/runtime.mjs";
|
|
15
|
-
import { i as
|
|
14
|
+
import { i as se } from "../vendor/icon.mjs";
|
|
16
15
|
import { i as _, d as Re } from "../vendor/types.mjs";
|
|
17
|
-
const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"], Ve = /* @__PURE__ */ U({
|
|
16
|
+
const Ue = /* @__PURE__ */ Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"], Ve = /* @__PURE__ */ U({
|
|
18
17
|
name: "ElPaginationJumper",
|
|
19
18
|
__name: "jumper",
|
|
20
19
|
props: $e,
|
|
21
20
|
setup(e) {
|
|
22
|
-
const { t:
|
|
21
|
+
const { t: o } = R(), n = O("pagination"), { pageCount: f, disabled: r, currentPage: g, changeEvent: b } = ie(), m = M(), E = C(() => m.value ?? g?.value);
|
|
23
22
|
function N(p) {
|
|
24
|
-
|
|
23
|
+
m.value = p ? +p : "";
|
|
25
24
|
}
|
|
26
25
|
function u(p) {
|
|
27
|
-
p = Math.trunc(+p), b?.(p),
|
|
26
|
+
p = Math.trunc(+p), b?.(p), m.value = void 0;
|
|
28
27
|
}
|
|
29
28
|
return (p, h) => (d(), w("span", {
|
|
30
29
|
class: k(t(n).e("jump")),
|
|
@@ -32,8 +31,8 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
32
31
|
}, [
|
|
33
32
|
j("span", {
|
|
34
33
|
class: k([t(n).e("goto")])
|
|
35
|
-
}, D(t(
|
|
36
|
-
ne(t(
|
|
34
|
+
}, D(t(o)("el.pagination.goto")), 3),
|
|
35
|
+
ne(t(ve), {
|
|
37
36
|
size: p.size,
|
|
38
37
|
class: k([t(n).e("editor"), t(n).is("in-pagination")]),
|
|
39
38
|
min: 1,
|
|
@@ -41,14 +40,14 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
41
40
|
disabled: t(r),
|
|
42
41
|
"model-value": E.value,
|
|
43
42
|
"validate-event": !1,
|
|
44
|
-
"aria-label": t(
|
|
43
|
+
"aria-label": t(o)("el.pagination.page"),
|
|
45
44
|
type: "number",
|
|
46
45
|
"onUpdate:modelValue": N,
|
|
47
46
|
onChange: u
|
|
48
47
|
}, null, 8, ["size", "class", "max", "disabled", "model-value", "aria-label"]),
|
|
49
48
|
j("span", {
|
|
50
49
|
class: k([t(n).e("classifier")])
|
|
51
|
-
}, D(t(
|
|
50
|
+
}, D(t(o)("el.pagination.pageClassifier")), 3)
|
|
52
51
|
], 10, Oe));
|
|
53
52
|
}
|
|
54
53
|
}), We = ["disabled", "aria-label", "aria-disabled"], He = { key: 0 }, Ge = /* @__PURE__ */ U({
|
|
@@ -57,8 +56,8 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
57
56
|
props: Te,
|
|
58
57
|
emits: ["click"],
|
|
59
58
|
setup(e) {
|
|
60
|
-
const
|
|
61
|
-
() =>
|
|
59
|
+
const o = e, { t: n } = R(), f = C(
|
|
60
|
+
() => o.disabled || o.currentPage === o.pageCount || o.pageCount === 0
|
|
62
61
|
);
|
|
63
62
|
return (r, g) => (d(), w("button", {
|
|
64
63
|
type: "button",
|
|
@@ -68,7 +67,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
68
67
|
"aria-disabled": f.value,
|
|
69
68
|
onClick: g[0] || (g[0] = (b) => r.$emit("click", b))
|
|
70
69
|
}, [
|
|
71
|
-
r.nextText ? (d(), w("span", He, D(r.nextText), 1)) : (d(), z(t(
|
|
70
|
+
r.nextText ? (d(), w("span", He, D(r.nextText), 1)) : (d(), z(t(oe), { key: 1 }, {
|
|
72
71
|
default: A(() => [
|
|
73
72
|
(d(), z(ue(r.nextIcon)))
|
|
74
73
|
]),
|
|
@@ -81,11 +80,11 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
81
80
|
__name: "pager",
|
|
82
81
|
props: _e,
|
|
83
82
|
emits: [X],
|
|
84
|
-
setup(e, { emit:
|
|
85
|
-
const n = e, f =
|
|
86
|
-
const a = n.pagerCount,
|
|
83
|
+
setup(e, { emit: o }) {
|
|
84
|
+
const n = e, f = o, r = O("pager"), g = O("icon"), { t: b } = R(), m = M(!1), E = M(!1), N = M(!1), u = M(!1), p = M(!1), h = M(!1), L = C(() => {
|
|
85
|
+
const a = n.pagerCount, l = (a - 1) / 2, i = Number(n.currentPage), S = Number(n.pageCount);
|
|
87
86
|
let T = !1, F = !1;
|
|
88
|
-
S > a && (i > a -
|
|
87
|
+
S > a && (i > a - l && (T = !0), i < S - l && (F = !0));
|
|
89
88
|
const W = [];
|
|
90
89
|
if (T && !F) {
|
|
91
90
|
const y = S - (a - 2);
|
|
@@ -107,7 +106,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
107
106
|
"btn-quickprev",
|
|
108
107
|
g.b(),
|
|
109
108
|
r.is("disabled", n.disabled)
|
|
110
|
-
]),
|
|
109
|
+
]), v = C(() => [
|
|
111
110
|
"more",
|
|
112
111
|
"btn-quicknext",
|
|
113
112
|
g.b(),
|
|
@@ -115,7 +114,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
115
114
|
]), B = C(() => n.disabled ? -1 : 0);
|
|
116
115
|
ke(() => {
|
|
117
116
|
const a = (n.pagerCount - 1) / 2;
|
|
118
|
-
|
|
117
|
+
m.value = !1, E.value = !1, n.pageCount > n.pagerCount && (n.currentPage > n.pagerCount - a && (m.value = !0), n.currentPage < n.pageCount - a && (E.value = !0));
|
|
119
118
|
});
|
|
120
119
|
function G(a = !1) {
|
|
121
120
|
n.disabled || (a ? N.value = !0 : u.value = !0);
|
|
@@ -124,22 +123,22 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
124
123
|
a ? p.value = !0 : h.value = !0;
|
|
125
124
|
}
|
|
126
125
|
function Z(a) {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
const i = Number(
|
|
126
|
+
const l = a.target;
|
|
127
|
+
if (l.tagName.toLowerCase() === "li" && Array.from(l.classList).includes("number")) {
|
|
128
|
+
const i = Number(l.textContent);
|
|
130
129
|
i !== n.currentPage && f(X, i);
|
|
131
|
-
} else
|
|
130
|
+
} else l.tagName.toLowerCase() === "li" && Array.from(l.classList).includes("more") && q(a);
|
|
132
131
|
}
|
|
133
132
|
function q(a) {
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
133
|
+
const l = a.target;
|
|
134
|
+
if (l.tagName.toLowerCase() === "ul" || n.disabled)
|
|
136
135
|
return;
|
|
137
|
-
let i = Number(
|
|
136
|
+
let i = Number(l.textContent);
|
|
138
137
|
const S = n.pageCount, T = n.currentPage, F = n.pagerCount - 2;
|
|
139
|
-
|
|
138
|
+
l.className.includes("more") && (l.className.includes("quickprev") ? i = T - F : l.className.includes("quicknext") && (i = T + F)), Number.isNaN(+i) || (i < 1 && (i = 1), i > S && (i = S)), i !== T && f(X, i);
|
|
140
139
|
}
|
|
141
140
|
Me();
|
|
142
|
-
const c = we().value, Q = c.address.entire, $ = te
|
|
141
|
+
const c = we().value, Q = c.address.entire, $ = te(() => {
|
|
143
142
|
const a = c.form.queryFeedbacks({
|
|
144
143
|
type: "error",
|
|
145
144
|
address: `${Q}.**`
|
|
@@ -148,8 +147,8 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
148
147
|
return i.add(T), i;
|
|
149
148
|
}, /* @__PURE__ */ new Set());
|
|
150
149
|
return Array.from(a).sort((i, S) => i - S);
|
|
151
|
-
}), ee = te
|
|
152
|
-
return (a,
|
|
150
|
+
}), ee = te(() => $.value.some((a) => a < L.value[0] - 1 && a !== 0)), V = te(() => $.value.some((a) => a > L.value.at(-1) - 1 && a !== $.value.length - 1));
|
|
151
|
+
return (a, l) => (d(), w("ul", {
|
|
153
152
|
class: k(t(r).b()),
|
|
154
153
|
onClick: q,
|
|
155
154
|
onKeyup: Ne(Z, ["enter"])
|
|
@@ -158,7 +157,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
158
157
|
key: 0,
|
|
159
158
|
"is-dot": "",
|
|
160
159
|
value: 1,
|
|
161
|
-
hidden: t($)
|
|
160
|
+
hidden: t($)[0] !== 0
|
|
162
161
|
}, {
|
|
163
162
|
default: A(() => [
|
|
164
163
|
j("li", {
|
|
@@ -173,21 +172,21 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
173
172
|
]),
|
|
174
173
|
_: 1
|
|
175
174
|
}, 8, ["hidden"])) : ae("", !0),
|
|
176
|
-
|
|
175
|
+
m.value ? (d(), z(t(H), {
|
|
177
176
|
key: 1,
|
|
178
177
|
"is-dot": "",
|
|
179
178
|
value: 1,
|
|
180
|
-
hidden: !t(ee)
|
|
179
|
+
hidden: !t(ee)
|
|
181
180
|
}, {
|
|
182
181
|
default: A(() => [
|
|
183
182
|
j("li", {
|
|
184
183
|
class: k(x.value),
|
|
185
184
|
tabindex: B.value,
|
|
186
185
|
"aria-label": t(b)("el.pagination.prevPages", { pager: a.pagerCount - 2 }),
|
|
187
|
-
onMouseenter:
|
|
188
|
-
onMouseleave:
|
|
189
|
-
onFocus:
|
|
190
|
-
onBlur:
|
|
186
|
+
onMouseenter: l[0] || (l[0] = (i) => G(!0)),
|
|
187
|
+
onMouseleave: l[1] || (l[1] = (i) => N.value = !1),
|
|
188
|
+
onFocus: l[2] || (l[2] = (i) => J(!0)),
|
|
189
|
+
onBlur: l[3] || (l[3] = (i) => p.value = !1)
|
|
191
190
|
}, [
|
|
192
191
|
(N.value || p.value) && !a.disabled ? (d(), z(t(ce), { key: 0 })) : (d(), z(t(re), { key: 1 }))
|
|
193
192
|
], 42, Qe)
|
|
@@ -198,7 +197,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
198
197
|
key: i,
|
|
199
198
|
"is-dot": "",
|
|
200
199
|
value: 1,
|
|
201
|
-
hidden: !t($).
|
|
200
|
+
hidden: !t($).includes(i - 1)
|
|
202
201
|
}, {
|
|
203
202
|
default: A(() => [
|
|
204
203
|
j("li", {
|
|
@@ -217,17 +216,17 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
217
216
|
key: 2,
|
|
218
217
|
"is-dot": "",
|
|
219
218
|
value: 1,
|
|
220
|
-
hidden: !t(V)
|
|
219
|
+
hidden: !t(V)
|
|
221
220
|
}, {
|
|
222
221
|
default: A(() => [
|
|
223
222
|
j("li", {
|
|
224
|
-
class: k(
|
|
223
|
+
class: k(v.value),
|
|
225
224
|
tabindex: B.value,
|
|
226
225
|
"aria-label": t(b)("el.pagination.nextPages", { pager: a.pagerCount - 2 }),
|
|
227
|
-
onMouseenter:
|
|
228
|
-
onMouseleave:
|
|
229
|
-
onFocus:
|
|
230
|
-
onBlur:
|
|
226
|
+
onMouseenter: l[4] || (l[4] = (i) => G()),
|
|
227
|
+
onMouseleave: l[5] || (l[5] = (i) => u.value = !1),
|
|
228
|
+
onFocus: l[6] || (l[6] = (i) => J()),
|
|
229
|
+
onBlur: l[7] || (l[7] = (i) => h.value = !1)
|
|
231
230
|
}, [
|
|
232
231
|
(u.value || h.value) && !a.disabled ? (d(), z(t(pe), { key: 0 })) : (d(), z(t(re), { key: 1 }))
|
|
233
232
|
], 42, Ye)
|
|
@@ -237,7 +236,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
237
236
|
ne(t(H), {
|
|
238
237
|
"is-dot": "",
|
|
239
238
|
value: 1,
|
|
240
|
-
hidden: t($)
|
|
239
|
+
hidden: t($)[t($).length - 1] !== a.pageCount - 1
|
|
241
240
|
}, {
|
|
242
241
|
default: A(() => [
|
|
243
242
|
j("li", {
|
|
@@ -260,8 +259,8 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
260
259
|
props: Be,
|
|
261
260
|
emits: Le,
|
|
262
261
|
setup(e) {
|
|
263
|
-
const
|
|
264
|
-
() =>
|
|
262
|
+
const o = e, { t: n } = R(), f = C(
|
|
263
|
+
() => o.disabled || o.currentPage <= 1
|
|
265
264
|
);
|
|
266
265
|
return (r, g) => (d(), w("button", {
|
|
267
266
|
type: "button",
|
|
@@ -271,7 +270,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
271
270
|
"aria-disabled": f.value,
|
|
272
271
|
onClick: g[0] || (g[0] = (b) => r.$emit("click", b))
|
|
273
272
|
}, [
|
|
274
|
-
r.prevText ? (d(), w("span", ta, D(r.prevText), 1)) : (d(), z(t(
|
|
273
|
+
r.prevText ? (d(), w("span", ta, D(r.prevText), 1)) : (d(), z(t(oe), { key: 1 }, {
|
|
275
274
|
default: A(() => [
|
|
276
275
|
(d(), z(ue(r.prevIcon)))
|
|
277
276
|
]),
|
|
@@ -284,8 +283,8 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
284
283
|
__name: "sizes",
|
|
285
284
|
props: qe,
|
|
286
285
|
emits: ["page-size-change"],
|
|
287
|
-
setup(e, { emit:
|
|
288
|
-
const n = e, f =
|
|
286
|
+
setup(e, { emit: o }) {
|
|
287
|
+
const n = e, f = o, { t: r } = R(), g = O("pagination"), b = ie(), m = M(n.pageSize);
|
|
289
288
|
Y(
|
|
290
289
|
() => n.pageSizes,
|
|
291
290
|
(u, p) => {
|
|
@@ -297,18 +296,18 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
297
296
|
), Y(
|
|
298
297
|
() => n.pageSize,
|
|
299
298
|
(u) => {
|
|
300
|
-
|
|
299
|
+
m.value = u;
|
|
301
300
|
}
|
|
302
301
|
);
|
|
303
302
|
const E = C(() => n.pageSizes);
|
|
304
303
|
function N(u) {
|
|
305
|
-
u !==
|
|
304
|
+
u !== m.value && (m.value = u, b.handleSizeChange?.(Number(u)));
|
|
306
305
|
}
|
|
307
306
|
return (u, p) => (d(), w("span", {
|
|
308
307
|
class: k(t(g).e("sizes"))
|
|
309
308
|
}, [
|
|
310
309
|
ne(t(be), {
|
|
311
|
-
"model-value":
|
|
310
|
+
"model-value": m.value,
|
|
312
311
|
disabled: u.disabled,
|
|
313
312
|
"popper-class": u.popperClass,
|
|
314
313
|
size: u.size,
|
|
@@ -328,20 +327,20 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
328
327
|
}, 8, ["model-value", "disabled", "popper-class", "size", "teleported", "append-to"])
|
|
329
328
|
], 2));
|
|
330
329
|
}
|
|
331
|
-
}), ra = ["disabled"],
|
|
330
|
+
}), ra = ["disabled"], sa = /* @__PURE__ */ U({
|
|
332
331
|
name: "ElPaginationTotal",
|
|
333
332
|
__name: "total",
|
|
334
333
|
props: Ke,
|
|
335
334
|
setup(e) {
|
|
336
|
-
const { t:
|
|
335
|
+
const { t: o } = R(), n = O("pagination"), { disabled: f } = ie();
|
|
337
336
|
return (r, g) => (d(), w("span", {
|
|
338
337
|
class: k(t(n).e("total")),
|
|
339
338
|
disabled: t(f)
|
|
340
|
-
}, D(t(
|
|
339
|
+
}, D(t(o)("el.pagination.total", {
|
|
341
340
|
total: r.total
|
|
342
341
|
})), 11, ra));
|
|
343
342
|
}
|
|
344
|
-
}), P = (e) => typeof e != "number",
|
|
343
|
+
}), P = (e) => typeof e != "number", la = je({
|
|
345
344
|
/**
|
|
346
345
|
* @description options of item count per page
|
|
347
346
|
*/
|
|
@@ -406,8 +405,8 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
406
405
|
* @description icon for the prev button, higher priority of `prev-text`
|
|
407
406
|
*/
|
|
408
407
|
prevIcon: {
|
|
409
|
-
type:
|
|
410
|
-
default: () =>
|
|
408
|
+
type: se,
|
|
409
|
+
default: () => me
|
|
411
410
|
},
|
|
412
411
|
/**
|
|
413
412
|
* @description text for the next button
|
|
@@ -420,7 +419,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
420
419
|
* @description icon for the next button, higher priority of `next-text`
|
|
421
420
|
*/
|
|
422
421
|
nextIcon: {
|
|
423
|
-
type:
|
|
422
|
+
type: se,
|
|
424
423
|
default: () => fe
|
|
425
424
|
},
|
|
426
425
|
/**
|
|
@@ -454,20 +453,20 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
454
453
|
* @description which element the size dropdown appends to.
|
|
455
454
|
*/
|
|
456
455
|
appendSizeTo: String
|
|
457
|
-
}),
|
|
456
|
+
}), oa = {
|
|
458
457
|
"update:current-page": (e) => _(e),
|
|
459
458
|
"update:page-size": (e) => _(e),
|
|
460
459
|
"size-change": (e) => _(e),
|
|
461
|
-
change: (e,
|
|
460
|
+
change: (e, o) => _(e) && _(o),
|
|
462
461
|
"current-change": (e) => _(e),
|
|
463
462
|
"prev-click": (e) => _(e),
|
|
464
463
|
"next-click": (e) => _(e)
|
|
465
|
-
},
|
|
466
|
-
name:
|
|
467
|
-
props:
|
|
468
|
-
emits:
|
|
469
|
-
setup(e, { emit:
|
|
470
|
-
const { t: f } = R(), r = O("pagination"), g = Ee().vnode.props || {}, b = he(),
|
|
464
|
+
}, le = "ElPagination", ka = U({
|
|
465
|
+
name: le,
|
|
466
|
+
props: la,
|
|
467
|
+
emits: oa,
|
|
468
|
+
setup(e, { emit: o, slots: n }) {
|
|
469
|
+
const { t: f } = R(), r = O("pagination"), g = Ee().vnode.props || {}, b = he(), m = C(
|
|
471
470
|
() => e.small ? "small" : e.size ?? b.value
|
|
472
471
|
);
|
|
473
472
|
ze(
|
|
@@ -501,75 +500,75 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
501
500
|
get() {
|
|
502
501
|
return P(e.pageSize) ? p.value : e.pageSize;
|
|
503
502
|
},
|
|
504
|
-
set(
|
|
505
|
-
P(e.pageSize) && (p.value =
|
|
503
|
+
set(s) {
|
|
504
|
+
P(e.pageSize) && (p.value = s), N && (o("update:page-size", s), o("size-change", s));
|
|
506
505
|
}
|
|
507
506
|
}), x = C(() => {
|
|
508
|
-
let
|
|
509
|
-
return P(e.pageCount) ? P(e.total) || (
|
|
510
|
-
}),
|
|
507
|
+
let s = 0;
|
|
508
|
+
return P(e.pageCount) ? P(e.total) || (s = Math.max(1, Math.ceil(e.total / L.value))) : s = e.pageCount, s;
|
|
509
|
+
}), v = C({
|
|
511
510
|
get() {
|
|
512
511
|
return P(e.currentPage) ? h.value : e.currentPage;
|
|
513
512
|
},
|
|
514
|
-
set(
|
|
515
|
-
let c =
|
|
516
|
-
|
|
513
|
+
set(s) {
|
|
514
|
+
let c = s;
|
|
515
|
+
s < 1 ? c = 1 : s > x.value && (c = x.value), P(e.currentPage) && (h.value = c), E && (o("update:current-page", c), o("current-change", c));
|
|
517
516
|
}
|
|
518
517
|
});
|
|
519
|
-
Y(x, (
|
|
520
|
-
|
|
518
|
+
Y(x, (s) => {
|
|
519
|
+
v.value > s && (v.value = s);
|
|
521
520
|
}), Y(
|
|
522
|
-
[
|
|
523
|
-
(
|
|
524
|
-
|
|
521
|
+
[v, L],
|
|
522
|
+
(s) => {
|
|
523
|
+
o(X, ...s);
|
|
525
524
|
},
|
|
526
525
|
{ flush: "post" }
|
|
527
526
|
);
|
|
528
|
-
function B(
|
|
529
|
-
|
|
527
|
+
function B(s) {
|
|
528
|
+
v.value = s;
|
|
530
529
|
}
|
|
531
|
-
function G(
|
|
532
|
-
L.value =
|
|
530
|
+
function G(s) {
|
|
531
|
+
L.value = s;
|
|
533
532
|
const c = x.value;
|
|
534
|
-
|
|
533
|
+
v.value > c && (v.value = c);
|
|
535
534
|
}
|
|
536
535
|
function J() {
|
|
537
|
-
e.disabled || (
|
|
536
|
+
e.disabled || (v.value -= 1, o("prev-click", v.value));
|
|
538
537
|
}
|
|
539
538
|
function Z() {
|
|
540
|
-
e.disabled || (
|
|
539
|
+
e.disabled || (v.value += 1, o("next-click", v.value));
|
|
541
540
|
}
|
|
542
|
-
function q(
|
|
543
|
-
|
|
541
|
+
function q(s, c) {
|
|
542
|
+
s && (s.props || (s.props = {}), s.props.class = [s.props.class, c].join(" "));
|
|
544
543
|
}
|
|
545
544
|
return xe(Se, {
|
|
546
545
|
pageCount: x,
|
|
547
546
|
disabled: C(() => e.disabled),
|
|
548
|
-
currentPage:
|
|
547
|
+
currentPage: v,
|
|
549
548
|
changeEvent: B,
|
|
550
549
|
handleSizeChange: G
|
|
551
550
|
}), () => {
|
|
552
551
|
if (!u.value)
|
|
553
|
-
return Re(
|
|
552
|
+
return Re(le, f("el.pagination.deprecationWarning")), null;
|
|
554
553
|
if (!e.layout || e.hideOnSinglePage && x.value <= 1)
|
|
555
554
|
return null;
|
|
556
|
-
const
|
|
555
|
+
const s = [], c = [], Q = I(
|
|
557
556
|
"div",
|
|
558
557
|
{ class: r.e("rightwrapper") },
|
|
559
558
|
c
|
|
560
559
|
), $ = {
|
|
561
560
|
prev: I(na, {
|
|
562
561
|
disabled: e.disabled,
|
|
563
|
-
currentPage:
|
|
562
|
+
currentPage: v.value,
|
|
564
563
|
prevText: e.prevText,
|
|
565
564
|
prevIcon: e.prevIcon,
|
|
566
565
|
onClick: J
|
|
567
566
|
}),
|
|
568
567
|
jumper: I(Ve, {
|
|
569
|
-
size:
|
|
568
|
+
size: m.value
|
|
570
569
|
}),
|
|
571
570
|
pager: I(ea, {
|
|
572
|
-
currentPage:
|
|
571
|
+
currentPage: v.value,
|
|
573
572
|
pageCount: x.value,
|
|
574
573
|
pagerCount: e.pagerCount,
|
|
575
574
|
onChange: B,
|
|
@@ -578,7 +577,7 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
578
577
|
}),
|
|
579
578
|
next: I(Ge, {
|
|
580
579
|
disabled: e.disabled,
|
|
581
|
-
currentPage:
|
|
580
|
+
currentPage: v.value,
|
|
582
581
|
pageCount: x.value,
|
|
583
582
|
nextText: e.nextText,
|
|
584
583
|
nextIcon: e.nextIcon,
|
|
@@ -590,11 +589,11 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
590
589
|
popperClass: e.popperClass,
|
|
591
590
|
disabled: e.disabled,
|
|
592
591
|
teleported: e.teleported,
|
|
593
|
-
size:
|
|
592
|
+
size: m.value,
|
|
594
593
|
appendSizeTo: e.appendSizeTo
|
|
595
594
|
}),
|
|
596
595
|
slot: n?.default?.() ?? null,
|
|
597
|
-
total: I(
|
|
596
|
+
total: I(sa, { total: P(e.total) ? 0 : e.total })
|
|
598
597
|
}, ee = e.layout.split(",").map((a) => a.trim());
|
|
599
598
|
let V = !1;
|
|
600
599
|
for (const a of ee) {
|
|
@@ -602,28 +601,28 @@ const Ue = Symbol("elPaginationKey"), ie = () => ye(Ue, {}), Oe = ["disabled"],
|
|
|
602
601
|
V = !0;
|
|
603
602
|
continue;
|
|
604
603
|
}
|
|
605
|
-
V ? c.push($[a]) :
|
|
604
|
+
V ? c.push($[a]) : s.push($[a]);
|
|
606
605
|
}
|
|
607
|
-
return q(
|
|
606
|
+
return q(s[0], r.is("first")), q(s.at(-1), r.is("last")), V && c.length > 0 && (q(c[0], r.is("first")), q(
|
|
608
607
|
c.at(-1),
|
|
609
608
|
r.is("last")
|
|
610
|
-
),
|
|
609
|
+
), s.push(Q)), I(
|
|
611
610
|
"div",
|
|
612
611
|
{
|
|
613
612
|
class: [
|
|
614
613
|
r.b(),
|
|
615
614
|
r.is("background", e.background),
|
|
616
|
-
r.m(
|
|
615
|
+
r.m(m.value)
|
|
617
616
|
]
|
|
618
617
|
},
|
|
619
|
-
|
|
618
|
+
s
|
|
620
619
|
);
|
|
621
620
|
};
|
|
622
621
|
}
|
|
623
622
|
});
|
|
624
623
|
export {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
624
|
+
ka as default,
|
|
625
|
+
oa as paginationEmits,
|
|
626
|
+
la as paginationProps
|
|
628
627
|
};
|
|
629
628
|
//# sourceMappingURL=pagination.mjs.map
|