ep-craft 0.1.30 → 0.1.31
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/dist/components/pagination/index.d.ts +4 -2
- package/dist/components/pagination/index.js +9 -3
- package/dist/components/pagination/src/components/jumper.d.ts +13 -0
- package/dist/components/pagination/src/components/jumper.js +16 -0
- package/dist/components/pagination/src/components/jumper.vue.d.ts +16 -0
- package/dist/components/pagination/src/components/jumper.vue.js +58 -0
- package/dist/components/pagination/src/components/jumper2.vue.js +4 -0
- package/dist/components/pagination/src/components/next.d.ts +22 -0
- package/dist/components/pagination/src/components/next.js +26 -0
- package/dist/components/pagination/src/components/next.vue.d.ts +42 -0
- package/dist/components/pagination/src/components/next.vue.js +44 -0
- package/dist/components/pagination/src/components/next2.vue.js +4 -0
- package/dist/components/pagination/src/components/pager.d.ts +16 -0
- package/dist/components/pagination/src/components/pager.js +24 -0
- package/dist/components/pagination/src/components/pager.vue.d.ts +30 -0
- package/dist/components/pagination/src/components/pager.vue.js +148 -0
- package/dist/components/pagination/src/components/pager2.vue.js +4 -0
- package/dist/components/pagination/src/components/prev.d.ts +24 -0
- package/dist/components/pagination/src/components/prev.js +25 -0
- package/dist/components/pagination/src/components/prev.vue.d.ts +39 -0
- package/dist/components/pagination/src/components/prev.vue.js +44 -0
- package/dist/components/pagination/src/components/prev2.vue.js +4 -0
- package/dist/components/pagination/src/components/sizes.d.ts +35 -0
- package/dist/components/pagination/src/components/sizes.js +34 -0
- package/dist/components/pagination/src/components/sizes.vue.d.ts +68 -0
- package/dist/components/pagination/src/components/sizes.vue.js +73 -0
- package/dist/components/pagination/src/components/sizes2.vue.js +4 -0
- package/dist/components/pagination/src/components/total.d.ts +8 -0
- package/dist/components/pagination/src/components/total.js +15 -0
- package/dist/components/pagination/src/components/total.vue.d.ts +8 -0
- package/dist/components/pagination/src/components/total.vue.js +33 -0
- package/dist/components/pagination/src/components/total2.vue.js +4 -0
- package/dist/components/pagination/src/constants.d.ts +9 -0
- package/dist/components/pagination/src/constants.js +4 -0
- package/dist/components/pagination/src/pagination.d.ts +147 -0
- package/dist/components/pagination/src/pagination.js +314 -0
- package/dist/components/pagination/src/usePagination.d.ts +1 -0
- package/dist/components/pagination/src/usePagination.js +6 -0
- package/dist/components/select/index.d.ts +2098 -0
- package/dist/components/select/index.js +10 -7
- package/dist/index.css +1 -1
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +1 -0
- package/package.json +1 -1
- package/theme-chalk/src/float-label.scss +51 -26
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { defineComponent as W, getCurrentInstance as $, computed as c, ref as _, watch as T, provide as O, h as g } from "vue";
|
|
2
|
+
import { ArrowRight as R, ArrowLeft as G } from "@element-plus/icons-vue";
|
|
3
|
+
import { isNumber as u } from "../../../utils/types.js";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import { debugWarn as V } from "../../../utils/error.js";
|
|
7
|
+
import "@vue/shared";
|
|
8
|
+
import { mutable as D } from "../../../utils/typescript.js";
|
|
9
|
+
import { CHANGE_EVENT as H } from "../../../constants/event.js";
|
|
10
|
+
import { iconPropType as N } from "../../../utils/vue/icon.js";
|
|
11
|
+
import { buildProps as K, definePropType as k } from "../../../utils/vue/props/runtime.js";
|
|
12
|
+
import { useNamespace as q } from "../../../hooks/use-namespace/index.js";
|
|
13
|
+
import { useLocale as F } from "../../../hooks/use-locale/index.js";
|
|
14
|
+
import { useSizeProp as J, useGlobalSize as Q } from "../../../hooks/use-size/index.js";
|
|
15
|
+
import { useDeprecated as X } from "../../../hooks/use-deprecated/index.js";
|
|
16
|
+
import "@popperjs/core";
|
|
17
|
+
import "../../../hooks/use-z-index/index.js";
|
|
18
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
19
|
+
import "../../../hooks/use-aria/index.js";
|
|
20
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
21
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
22
|
+
import { elPaginationKey as Y } from "./constants.js";
|
|
23
|
+
import Z from "./components/prev.vue.js";
|
|
24
|
+
import ee from "./components/next.vue.js";
|
|
25
|
+
import te from "./components/sizes.vue.js";
|
|
26
|
+
import ae from "./components/jumper.vue.js";
|
|
27
|
+
import ne from "./components/total.vue.js";
|
|
28
|
+
import ie from "./components/pager.vue.js";
|
|
29
|
+
const n = (e) => typeof e != "number", re = K({
|
|
30
|
+
/**
|
|
31
|
+
* @description options of item count per page
|
|
32
|
+
*/
|
|
33
|
+
pageSize: Number,
|
|
34
|
+
/**
|
|
35
|
+
* @description default initial value of page size, not setting is the same as setting 10
|
|
36
|
+
*/
|
|
37
|
+
defaultPageSize: Number,
|
|
38
|
+
/**
|
|
39
|
+
* @description total item count
|
|
40
|
+
*/
|
|
41
|
+
total: Number,
|
|
42
|
+
/**
|
|
43
|
+
* @description total page count. Set either `total` or `page-count` and pages will be displayed; if you need `page-sizes`, `total` is required
|
|
44
|
+
*/
|
|
45
|
+
pageCount: Number,
|
|
46
|
+
/**
|
|
47
|
+
* @description number of pagers. Pagination collapses when the total page count exceeds this value
|
|
48
|
+
*/
|
|
49
|
+
pagerCount: {
|
|
50
|
+
type: Number,
|
|
51
|
+
validator: (e) => u(e) && Math.trunc(e) === e && e > 4 && e < 22 && e % 2 === 1,
|
|
52
|
+
default: 7
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* @description current page number
|
|
56
|
+
*/
|
|
57
|
+
currentPage: Number,
|
|
58
|
+
/**
|
|
59
|
+
* @description default initial value of current-page, not setting is the same as setting 1
|
|
60
|
+
*/
|
|
61
|
+
defaultCurrentPage: Number,
|
|
62
|
+
/**
|
|
63
|
+
* @description layout of Pagination, elements separated with a comma
|
|
64
|
+
*/
|
|
65
|
+
layout: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: ["prev", "pager", "next", "jumper", "->", "total"].join(", ")
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* @description item count of each page
|
|
71
|
+
*/
|
|
72
|
+
pageSizes: {
|
|
73
|
+
type: k(Array),
|
|
74
|
+
default: () => D([10, 20, 30, 40, 50, 100])
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* @description custom class name for the page size Select's dropdown
|
|
78
|
+
*/
|
|
79
|
+
popperClass: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: ""
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* @description custom style for the page size Select's dropdown
|
|
85
|
+
*/
|
|
86
|
+
popperStyle: {
|
|
87
|
+
type: k([String, Object])
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* @description text for the prev button
|
|
91
|
+
*/
|
|
92
|
+
prevText: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ""
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* @description icon for the prev button, higher priority of `prev-text`
|
|
98
|
+
*/
|
|
99
|
+
prevIcon: {
|
|
100
|
+
type: N,
|
|
101
|
+
default: () => G
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* @description text for the next button
|
|
105
|
+
*/
|
|
106
|
+
nextText: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: ""
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* @description icon for the next button, higher priority of `next-text`
|
|
112
|
+
*/
|
|
113
|
+
nextIcon: {
|
|
114
|
+
type: N,
|
|
115
|
+
default: () => R
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* @description whether Pagination size is teleported to body
|
|
119
|
+
*/
|
|
120
|
+
teleported: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: !0
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* @description whether to use small pagination
|
|
126
|
+
*/
|
|
127
|
+
small: Boolean,
|
|
128
|
+
/**
|
|
129
|
+
* @description set page size
|
|
130
|
+
*/
|
|
131
|
+
size: J,
|
|
132
|
+
/**
|
|
133
|
+
* @description whether the buttons have a background color
|
|
134
|
+
*/
|
|
135
|
+
background: Boolean,
|
|
136
|
+
/**
|
|
137
|
+
* @description whether Pagination is disabled
|
|
138
|
+
*/
|
|
139
|
+
disabled: Boolean,
|
|
140
|
+
/**
|
|
141
|
+
* @description whether to hide when there's only one page
|
|
142
|
+
*/
|
|
143
|
+
hideOnSinglePage: Boolean,
|
|
144
|
+
/**
|
|
145
|
+
* @description which element the size dropdown appends to.
|
|
146
|
+
*/
|
|
147
|
+
appendSizeTo: String
|
|
148
|
+
}), ue = {
|
|
149
|
+
"update:current-page": (e) => u(e),
|
|
150
|
+
"update:page-size": (e) => u(e),
|
|
151
|
+
"size-change": (e) => u(e),
|
|
152
|
+
change: (e, r) => u(e) && u(r),
|
|
153
|
+
"current-change": (e) => u(e),
|
|
154
|
+
"prev-click": (e) => u(e),
|
|
155
|
+
"next-click": (e) => u(e)
|
|
156
|
+
}, E = "ElPagination", Le = W({
|
|
157
|
+
name: E,
|
|
158
|
+
props: re,
|
|
159
|
+
emits: ue,
|
|
160
|
+
setup(e, { emit: r, slots: d }) {
|
|
161
|
+
const { t: B } = F(), o = q("pagination"), f = $().vnode.props || {}, A = Q(), h = c(
|
|
162
|
+
() => e.small ? "small" : e.size ?? A.value
|
|
163
|
+
);
|
|
164
|
+
X(
|
|
165
|
+
{
|
|
166
|
+
from: "small",
|
|
167
|
+
replacement: "size",
|
|
168
|
+
version: "3.0.0",
|
|
169
|
+
scope: "el-pagination",
|
|
170
|
+
ref: "https://element-plus.org/zh-CN/component/pagination.html"
|
|
171
|
+
},
|
|
172
|
+
c(() => !!e.small)
|
|
173
|
+
);
|
|
174
|
+
const z = "onUpdate:currentPage" in f || "onUpdate:current-page" in f || "onCurrentChange" in f, v = "onUpdate:pageSize" in f || "onUpdate:page-size" in f || "onSizeChange" in f, I = c(() => {
|
|
175
|
+
if (n(e.total) && n(e.pageCount) || !n(e.currentPage) && !z) return !1;
|
|
176
|
+
if (e.layout.includes("sizes")) {
|
|
177
|
+
if (n(e.pageCount)) {
|
|
178
|
+
if (!n(e.total) && !n(e.pageSize) && !v)
|
|
179
|
+
return !1;
|
|
180
|
+
} else if (!v) return !1;
|
|
181
|
+
}
|
|
182
|
+
return !0;
|
|
183
|
+
}), P = _(
|
|
184
|
+
n(e.defaultPageSize) ? 10 : e.defaultPageSize
|
|
185
|
+
), S = _(
|
|
186
|
+
n(e.defaultCurrentPage) ? 1 : e.defaultCurrentPage
|
|
187
|
+
), p = c({
|
|
188
|
+
get() {
|
|
189
|
+
return n(e.pageSize) ? P.value : e.pageSize;
|
|
190
|
+
},
|
|
191
|
+
set(t) {
|
|
192
|
+
n(e.pageSize) && (P.value = t), v && (r("update:page-size", t), r("size-change", t));
|
|
193
|
+
}
|
|
194
|
+
}), l = c(() => {
|
|
195
|
+
let t = 0;
|
|
196
|
+
return n(e.pageCount) ? n(e.total) || (t = Math.max(1, Math.ceil(e.total / p.value))) : t = e.pageCount, t;
|
|
197
|
+
}), i = c({
|
|
198
|
+
get() {
|
|
199
|
+
return n(e.currentPage) ? S.value : e.currentPage;
|
|
200
|
+
},
|
|
201
|
+
set(t) {
|
|
202
|
+
let a = t;
|
|
203
|
+
t < 1 ? a = 1 : t > l.value && (a = l.value), n(e.currentPage) && (S.value = a), z && (r("update:current-page", a), r("current-change", a));
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
T(l, (t) => {
|
|
207
|
+
i.value > t && (i.value = t);
|
|
208
|
+
}), T(
|
|
209
|
+
[i, p],
|
|
210
|
+
(t) => {
|
|
211
|
+
r(H, ...t);
|
|
212
|
+
},
|
|
213
|
+
{ flush: "post" }
|
|
214
|
+
);
|
|
215
|
+
function b(t) {
|
|
216
|
+
i.value = t;
|
|
217
|
+
}
|
|
218
|
+
function w(t) {
|
|
219
|
+
p.value = t;
|
|
220
|
+
const a = l.value;
|
|
221
|
+
i.value > a && (i.value = a);
|
|
222
|
+
}
|
|
223
|
+
function j() {
|
|
224
|
+
e.disabled || (i.value -= 1, r("prev-click", i.value));
|
|
225
|
+
}
|
|
226
|
+
function L() {
|
|
227
|
+
e.disabled || (i.value += 1, r("next-click", i.value));
|
|
228
|
+
}
|
|
229
|
+
function m(t, a) {
|
|
230
|
+
t && (t.props || (t.props = {}), t.props.class = [t.props.class, a].join(" "));
|
|
231
|
+
}
|
|
232
|
+
return O(Y, {
|
|
233
|
+
pageCount: l,
|
|
234
|
+
disabled: c(() => e.disabled),
|
|
235
|
+
currentPage: i,
|
|
236
|
+
changeEvent: b,
|
|
237
|
+
handleSizeChange: w
|
|
238
|
+
}), () => {
|
|
239
|
+
var x;
|
|
240
|
+
if (!I.value)
|
|
241
|
+
return V(E, B("el.pagination.deprecationWarning")), null;
|
|
242
|
+
if (!e.layout || e.hideOnSinglePage && l.value <= 1) return null;
|
|
243
|
+
const t = [], a = [], M = g(
|
|
244
|
+
"div",
|
|
245
|
+
{ class: o.e("rightwrapper") },
|
|
246
|
+
a
|
|
247
|
+
), y = {
|
|
248
|
+
prev: g(Z, {
|
|
249
|
+
disabled: e.disabled,
|
|
250
|
+
currentPage: i.value,
|
|
251
|
+
prevText: e.prevText,
|
|
252
|
+
prevIcon: e.prevIcon,
|
|
253
|
+
onClick: j
|
|
254
|
+
}),
|
|
255
|
+
jumper: g(ae, {
|
|
256
|
+
size: h.value
|
|
257
|
+
}),
|
|
258
|
+
pager: g(ie, {
|
|
259
|
+
currentPage: i.value,
|
|
260
|
+
pageCount: l.value,
|
|
261
|
+
pagerCount: e.pagerCount,
|
|
262
|
+
onChange: b,
|
|
263
|
+
disabled: e.disabled
|
|
264
|
+
}),
|
|
265
|
+
next: g(ee, {
|
|
266
|
+
disabled: e.disabled,
|
|
267
|
+
currentPage: i.value,
|
|
268
|
+
pageCount: l.value,
|
|
269
|
+
nextText: e.nextText,
|
|
270
|
+
nextIcon: e.nextIcon,
|
|
271
|
+
onClick: L
|
|
272
|
+
}),
|
|
273
|
+
sizes: g(te, {
|
|
274
|
+
pageSize: p.value,
|
|
275
|
+
pageSizes: e.pageSizes,
|
|
276
|
+
popperClass: e.popperClass,
|
|
277
|
+
popperStyle: e.popperStyle,
|
|
278
|
+
disabled: e.disabled,
|
|
279
|
+
teleported: e.teleported,
|
|
280
|
+
size: h.value,
|
|
281
|
+
appendSizeTo: e.appendSizeTo
|
|
282
|
+
}),
|
|
283
|
+
slot: ((x = d == null ? void 0 : d.default) == null ? void 0 : x.call(d)) ?? null,
|
|
284
|
+
total: g(ne, { total: n(e.total) ? 0 : e.total })
|
|
285
|
+
}, U = e.layout.split(",").map((s) => s.trim());
|
|
286
|
+
let C = !1;
|
|
287
|
+
return U.forEach((s) => {
|
|
288
|
+
if (s === "->") {
|
|
289
|
+
C = !0;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
C ? a.push(y[s]) : t.push(y[s]);
|
|
293
|
+
}), m(t[0], o.is("first")), m(t[t.length - 1], o.is("last")), C && a.length > 0 && (m(a[0], o.is("first")), m(
|
|
294
|
+
a[a.length - 1],
|
|
295
|
+
o.is("last")
|
|
296
|
+
), t.push(M)), g(
|
|
297
|
+
"div",
|
|
298
|
+
{
|
|
299
|
+
class: [
|
|
300
|
+
o.b(),
|
|
301
|
+
o.is("background", e.background),
|
|
302
|
+
o.m(h.value)
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
t
|
|
306
|
+
);
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
export {
|
|
311
|
+
Le as default,
|
|
312
|
+
ue as paginationEmits,
|
|
313
|
+
re as paginationProps
|
|
314
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePagination: () => import("./constants").ElPaginationContext;
|