@vaebe/ccui 2.0.0-beta.0 → 2.0.1-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/README.md +4 -0
- package/button/index.es.js +28 -22
- package/button/index.umd.js +1 -1
- package/calendar/index.es.js +445 -90
- package/calendar/index.umd.js +1 -1
- package/ccui-cli.css +1 -1
- package/check-box/index.es.js +8 -2
- package/check-box/index.umd.js +1 -1
- package/chunk-Ndeg2fpE.js +20 -0
- package/collapse/index.es.js +10 -7
- package/collapse/index.umd.js +1 -1
- package/config-provider/chunk-C_CI6nMA.js +13 -0
- package/config-provider/en-BG83iZ_P.js +24 -0
- package/config-provider/index.es.js +408 -53
- package/config-provider/index.umd.js +1 -1
- package/config-provider/ja-B-93MQG5.js +56 -0
- package/config-provider/ko-86th3uXt.js +56 -0
- package/config-provider/zh-cn-BQE-LNg1.js +59 -0
- package/date-picker/ccui-cli.css +1 -1
- package/date-picker/index.es.js +664 -482
- package/date-picker/index.umd.js +1 -1
- package/drawer/index.es.js +271 -279
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +187 -171
- package/dropdown/index.umd.js +1 -1
- package/empty/index.es.js +341 -24
- package/empty/index.umd.js +1 -1
- package/en-BVwCvuzF.js +24 -0
- package/float-button/index.es.js +1134 -46
- package/float-button/index.umd.js +1 -1
- package/form/index.es.js +1357 -261
- package/form/index.umd.js +1 -1
- package/icon/index.es.js +93 -10
- package/icon/index.umd.js +1 -1
- package/image/index.es.js +353 -36
- package/image/index.umd.js +1 -1
- package/input/index.es.js +24 -15
- package/input/index.umd.js +1 -1
- package/input-number/index.es.js +45 -25
- package/input-number/index.umd.js +1 -1
- package/ja-B4U4rt8A.js +56 -0
- package/ko-BG35I8uK.js +56 -0
- package/menu/index.es.js +3 -1
- package/menu/index.umd.js +1 -1
- package/message/index.es.js +1179 -86
- package/message/index.umd.js +1 -1
- package/modal/index.es.js +735 -335
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +1176 -83
- package/notification/index.umd.js +1 -1
- package/package.json +9 -9
- package/pagination/index.es.js +381 -60
- package/pagination/index.umd.js +1 -1
- package/popconfirm/index.es.js +469 -143
- package/popconfirm/index.umd.js +1 -1
- package/popover/index.es.js +192 -175
- package/popover/index.umd.js +1 -1
- package/radio/index.es.js +8 -2
- package/radio/index.umd.js +1 -1
- package/rate/index.es.js +22 -12
- package/rate/index.umd.js +1 -1
- package/select/index.es.js +135 -53
- package/select/index.umd.js +1 -1
- package/slider/index.es.js +165 -155
- package/slider/index.umd.js +1 -1
- package/steps/index.es.js +1140 -49
- package/steps/index.umd.js +1 -1
- package/switch/index.es.js +2 -0
- package/switch/index.umd.js +1 -1
- package/tabs/index.es.js +31 -5
- package/tabs/index.umd.js +1 -1
- package/tag/index.es.js +53 -35
- package/tag/index.umd.js +1 -1
- package/tooltip/index.es.js +78 -77
- package/tooltip/index.umd.js +1 -1
- package/tree/ccui-cli.css +1 -1
- package/tree/index.es.js +1491 -276
- package/tree/index.umd.js +1 -1
- package/typography/index.es.js +1213 -125
- package/typography/index.umd.js +1 -1
- package/vue-ccui.es.js +8726 -7604
- package/vue-ccui.umd.js +1 -1
- package/zh-cn-C8nbfD5S.js +59 -0
package/pagination/index.es.js
CHANGED
|
@@ -1,22 +1,320 @@
|
|
|
1
1
|
import { computed as e, createTextVNode as t, createVNode as n, defineComponent as r, inject as i, ref as a, watch as o } from "vue";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
|
|
4
|
+
//#endregion
|
|
2
5
|
//#region ../ccui/ui/shared/hooks/use-namespace.ts
|
|
3
|
-
function
|
|
6
|
+
function c(e, t, n) {
|
|
4
7
|
let r = e;
|
|
5
8
|
return t && (r += `__${t}`), n && (r += `--${n}`), r;
|
|
6
9
|
}
|
|
7
|
-
function
|
|
10
|
+
function l(e, t = !1) {
|
|
8
11
|
let n = t ? `.ccui-${e}` : `ccui-${e}`;
|
|
9
12
|
return {
|
|
10
|
-
b: () =>
|
|
11
|
-
e: (e) => e ?
|
|
12
|
-
m: (e) => e ?
|
|
13
|
-
em: (e, t) => e && t ?
|
|
13
|
+
b: () => c(n),
|
|
14
|
+
e: (e) => e ? c(n, e) : "",
|
|
15
|
+
m: (e) => e ? c(n, "", e) : "",
|
|
16
|
+
em: (e, t) => e && t ? c(n, e, t) : "",
|
|
14
17
|
is: (e) => `is-${e}`
|
|
15
18
|
};
|
|
16
19
|
}
|
|
20
|
+
(/* @__PURE__ */ s(((e, t) => {
|
|
21
|
+
(function(n, r) {
|
|
22
|
+
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
23
|
+
})(e, (function() {
|
|
24
|
+
var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
|
|
25
|
+
name: "en",
|
|
26
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
27
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
28
|
+
ordinal: function(e) {
|
|
29
|
+
var t = [
|
|
30
|
+
"th",
|
|
31
|
+
"st",
|
|
32
|
+
"nd",
|
|
33
|
+
"rd"
|
|
34
|
+
], n = e % 100;
|
|
35
|
+
return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
|
|
36
|
+
}
|
|
37
|
+
}, _ = function(e, t, n) {
|
|
38
|
+
var r = String(e);
|
|
39
|
+
return !r || r.length >= t ? e : "" + Array(t + 1 - r.length).join(n) + e;
|
|
40
|
+
}, v = {
|
|
41
|
+
s: _,
|
|
42
|
+
z: function(e) {
|
|
43
|
+
var t = -e.utcOffset(), n = Math.abs(t), r = Math.floor(n / 60), i = n % 60;
|
|
44
|
+
return (t <= 0 ? "+" : "-") + _(r, 2, "0") + ":" + _(i, 2, "0");
|
|
45
|
+
},
|
|
46
|
+
m: function e(t, n) {
|
|
47
|
+
if (t.date() < n.date()) return -e(n, t);
|
|
48
|
+
var r = 12 * (n.year() - t.year()) + (n.month() - t.month()), i = t.clone().add(r, l), a = n - i < 0, o = t.clone().add(r + (a ? -1 : 1), l);
|
|
49
|
+
return +(-(r + (n - i) / (a ? i - o : o - i)) || 0);
|
|
50
|
+
},
|
|
51
|
+
a: function(e) {
|
|
52
|
+
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
|
|
53
|
+
},
|
|
54
|
+
p: function(e) {
|
|
55
|
+
return {
|
|
56
|
+
M: l,
|
|
57
|
+
y: d,
|
|
58
|
+
w: c,
|
|
59
|
+
d: s,
|
|
60
|
+
D: f,
|
|
61
|
+
h: o,
|
|
62
|
+
m: a,
|
|
63
|
+
s: i,
|
|
64
|
+
ms: r,
|
|
65
|
+
Q: u
|
|
66
|
+
}[e] || String(e || "").toLowerCase().replace(/s$/, "");
|
|
67
|
+
},
|
|
68
|
+
u: function(e) {
|
|
69
|
+
return e === void 0;
|
|
70
|
+
}
|
|
71
|
+
}, y = "en", b = {};
|
|
72
|
+
b[y] = g;
|
|
73
|
+
var x = "$isDayjsObject", S = function(e) {
|
|
74
|
+
return e instanceof E || !(!e || !e[x]);
|
|
75
|
+
}, C = function e(t, n, r) {
|
|
76
|
+
var i;
|
|
77
|
+
if (!t) return y;
|
|
78
|
+
if (typeof t == "string") {
|
|
79
|
+
var a = t.toLowerCase();
|
|
80
|
+
b[a] && (i = a), n && (b[a] = n, i = a);
|
|
81
|
+
var o = t.split("-");
|
|
82
|
+
if (!i && o.length > 1) return e(o[0]);
|
|
83
|
+
} else {
|
|
84
|
+
var s = t.name;
|
|
85
|
+
b[s] = t, i = s;
|
|
86
|
+
}
|
|
87
|
+
return !r && i && (y = i), i || !r && y;
|
|
88
|
+
}, w = function(e, t) {
|
|
89
|
+
if (S(e)) return e.clone();
|
|
90
|
+
var n = typeof t == "object" ? t : {};
|
|
91
|
+
return n.date = e, n.args = arguments, new E(n);
|
|
92
|
+
}, T = v;
|
|
93
|
+
T.l = C, T.i = S, T.w = function(e, t) {
|
|
94
|
+
return w(e, {
|
|
95
|
+
locale: t.$L,
|
|
96
|
+
utc: t.$u,
|
|
97
|
+
x: t.$x,
|
|
98
|
+
$offset: t.$offset
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
var E = function() {
|
|
102
|
+
function g(e) {
|
|
103
|
+
this.$L = C(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[x] = !0;
|
|
104
|
+
}
|
|
105
|
+
var _ = g.prototype;
|
|
106
|
+
return _.parse = function(e) {
|
|
107
|
+
this.$d = function(e) {
|
|
108
|
+
var t = e.date, n = e.utc;
|
|
109
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
110
|
+
if (T.u(t)) return /* @__PURE__ */ new Date();
|
|
111
|
+
if (t instanceof Date) return new Date(t);
|
|
112
|
+
if (typeof t == "string" && !/Z$/i.test(t)) {
|
|
113
|
+
var r = t.match(m);
|
|
114
|
+
if (r) {
|
|
115
|
+
var i = r[2] - 1 || 0, a = (r[7] || "0").substring(0, 3);
|
|
116
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return new Date(t);
|
|
120
|
+
}(e), this.init();
|
|
121
|
+
}, _.init = function() {
|
|
122
|
+
var e = this.$d;
|
|
123
|
+
this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
|
|
124
|
+
}, _.$utils = function() {
|
|
125
|
+
return T;
|
|
126
|
+
}, _.isValid = function() {
|
|
127
|
+
return this.$d.toString() !== p;
|
|
128
|
+
}, _.isSame = function(e, t) {
|
|
129
|
+
var n = w(e);
|
|
130
|
+
return this.startOf(t) <= n && n <= this.endOf(t);
|
|
131
|
+
}, _.isAfter = function(e, t) {
|
|
132
|
+
return w(e) < this.startOf(t);
|
|
133
|
+
}, _.isBefore = function(e, t) {
|
|
134
|
+
return this.endOf(t) < w(e);
|
|
135
|
+
}, _.$g = function(e, t, n) {
|
|
136
|
+
return T.u(e) ? this[t] : this.set(n, e);
|
|
137
|
+
}, _.unix = function() {
|
|
138
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
139
|
+
}, _.valueOf = function() {
|
|
140
|
+
return this.$d.getTime();
|
|
141
|
+
}, _.startOf = function(e, t) {
|
|
142
|
+
var n = this, r = !!T.u(t) || t, u = T.p(e), p = function(e, t) {
|
|
143
|
+
var i = T.w(n.$u ? Date.UTC(n.$y, t, e) : new Date(n.$y, t, e), n);
|
|
144
|
+
return r ? i : i.endOf(s);
|
|
145
|
+
}, m = function(e, t) {
|
|
146
|
+
return T.w(n.toDate()[e].apply(n.toDate("s"), (r ? [
|
|
147
|
+
0,
|
|
148
|
+
0,
|
|
149
|
+
0,
|
|
150
|
+
0
|
|
151
|
+
] : [
|
|
152
|
+
23,
|
|
153
|
+
59,
|
|
154
|
+
59,
|
|
155
|
+
999
|
|
156
|
+
]).slice(t)), n);
|
|
157
|
+
}, h = this.$W, g = this.$M, _ = this.$D, v = "set" + (this.$u ? "UTC" : "");
|
|
158
|
+
switch (u) {
|
|
159
|
+
case d: return r ? p(1, 0) : p(31, 11);
|
|
160
|
+
case l: return r ? p(1, g) : p(0, g + 1);
|
|
161
|
+
case c:
|
|
162
|
+
var y = this.$locale().weekStart || 0, b = (h < y ? h + 7 : h) - y;
|
|
163
|
+
return p(r ? _ - b : _ + (6 - b), g);
|
|
164
|
+
case s:
|
|
165
|
+
case f: return m(v + "Hours", 0);
|
|
166
|
+
case o: return m(v + "Minutes", 1);
|
|
167
|
+
case a: return m(v + "Seconds", 2);
|
|
168
|
+
case i: return m(v + "Milliseconds", 3);
|
|
169
|
+
default: return this.clone();
|
|
170
|
+
}
|
|
171
|
+
}, _.endOf = function(e) {
|
|
172
|
+
return this.startOf(e, !1);
|
|
173
|
+
}, _.$set = function(e, t) {
|
|
174
|
+
var n, c = T.p(e), u = "set" + (this.$u ? "UTC" : ""), p = (n = {}, n[s] = u + "Date", n[f] = u + "Date", n[l] = u + "Month", n[d] = u + "FullYear", n[o] = u + "Hours", n[a] = u + "Minutes", n[i] = u + "Seconds", n[r] = u + "Milliseconds", n)[c], m = c === s ? this.$D + (t - this.$W) : t;
|
|
175
|
+
if (c === l || c === d) {
|
|
176
|
+
var h = this.clone().set(f, 1);
|
|
177
|
+
h.$d[p](m), h.init(), this.$d = h.set(f, Math.min(this.$D, h.daysInMonth())).$d;
|
|
178
|
+
} else p && this.$d[p](m);
|
|
179
|
+
return this.init(), this;
|
|
180
|
+
}, _.set = function(e, t) {
|
|
181
|
+
return this.clone().$set(e, t);
|
|
182
|
+
}, _.get = function(e) {
|
|
183
|
+
return this[T.p(e)]();
|
|
184
|
+
}, _.add = function(r, u) {
|
|
185
|
+
var f, p = this;
|
|
186
|
+
r = Number(r);
|
|
187
|
+
var m = T.p(u), h = function(e) {
|
|
188
|
+
var t = w(p);
|
|
189
|
+
return T.w(t.date(t.date() + Math.round(e * r)), p);
|
|
190
|
+
};
|
|
191
|
+
if (m === l) return this.set(l, this.$M + r);
|
|
192
|
+
if (m === d) return this.set(d, this.$y + r);
|
|
193
|
+
if (m === s) return h(1);
|
|
194
|
+
if (m === c) return h(7);
|
|
195
|
+
var g = (f = {}, f[a] = t, f[o] = n, f[i] = e, f)[m] || 1, _ = this.$d.getTime() + r * g;
|
|
196
|
+
return T.w(_, this);
|
|
197
|
+
}, _.subtract = function(e, t) {
|
|
198
|
+
return this.add(-1 * e, t);
|
|
199
|
+
}, _.format = function(e) {
|
|
200
|
+
var t = this, n = this.$locale();
|
|
201
|
+
if (!this.isValid()) return n.invalidDate || p;
|
|
202
|
+
var r = e || "YYYY-MM-DDTHH:mm:ssZ", i = T.z(this), a = this.$H, o = this.$m, s = this.$M, c = n.weekdays, l = n.months, u = n.meridiem, d = function(e, n, i, a) {
|
|
203
|
+
return e && (e[n] || e(t, r)) || i[n].slice(0, a);
|
|
204
|
+
}, f = function(e) {
|
|
205
|
+
return T.s(a % 12 || 12, e, "0");
|
|
206
|
+
}, m = u || function(e, t, n) {
|
|
207
|
+
var r = e < 12 ? "AM" : "PM";
|
|
208
|
+
return n ? r.toLowerCase() : r;
|
|
209
|
+
};
|
|
210
|
+
return r.replace(h, (function(e, r) {
|
|
211
|
+
return r || function(e) {
|
|
212
|
+
switch (e) {
|
|
213
|
+
case "YY": return String(t.$y).slice(-2);
|
|
214
|
+
case "YYYY": return T.s(t.$y, 4, "0");
|
|
215
|
+
case "M": return s + 1;
|
|
216
|
+
case "MM": return T.s(s + 1, 2, "0");
|
|
217
|
+
case "MMM": return d(n.monthsShort, s, l, 3);
|
|
218
|
+
case "MMMM": return d(l, s);
|
|
219
|
+
case "D": return t.$D;
|
|
220
|
+
case "DD": return T.s(t.$D, 2, "0");
|
|
221
|
+
case "d": return String(t.$W);
|
|
222
|
+
case "dd": return d(n.weekdaysMin, t.$W, c, 2);
|
|
223
|
+
case "ddd": return d(n.weekdaysShort, t.$W, c, 3);
|
|
224
|
+
case "dddd": return c[t.$W];
|
|
225
|
+
case "H": return String(a);
|
|
226
|
+
case "HH": return T.s(a, 2, "0");
|
|
227
|
+
case "h": return f(1);
|
|
228
|
+
case "hh": return f(2);
|
|
229
|
+
case "a": return m(a, o, !0);
|
|
230
|
+
case "A": return m(a, o, !1);
|
|
231
|
+
case "m": return String(o);
|
|
232
|
+
case "mm": return T.s(o, 2, "0");
|
|
233
|
+
case "s": return String(t.$s);
|
|
234
|
+
case "ss": return T.s(t.$s, 2, "0");
|
|
235
|
+
case "SSS": return T.s(t.$ms, 3, "0");
|
|
236
|
+
case "Z": return i;
|
|
237
|
+
}
|
|
238
|
+
return null;
|
|
239
|
+
}(e) || i.replace(":", "");
|
|
240
|
+
}));
|
|
241
|
+
}, _.utcOffset = function() {
|
|
242
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
243
|
+
}, _.diff = function(r, f, p) {
|
|
244
|
+
var m, h = this, g = T.p(f), _ = w(r), v = (_.utcOffset() - this.utcOffset()) * t, y = this - _, b = function() {
|
|
245
|
+
return T.m(h, _);
|
|
246
|
+
};
|
|
247
|
+
switch (g) {
|
|
248
|
+
case d:
|
|
249
|
+
m = b() / 12;
|
|
250
|
+
break;
|
|
251
|
+
case l:
|
|
252
|
+
m = b();
|
|
253
|
+
break;
|
|
254
|
+
case u:
|
|
255
|
+
m = b() / 3;
|
|
256
|
+
break;
|
|
257
|
+
case c:
|
|
258
|
+
m = (y - v) / 6048e5;
|
|
259
|
+
break;
|
|
260
|
+
case s:
|
|
261
|
+
m = (y - v) / 864e5;
|
|
262
|
+
break;
|
|
263
|
+
case o:
|
|
264
|
+
m = y / n;
|
|
265
|
+
break;
|
|
266
|
+
case a:
|
|
267
|
+
m = y / t;
|
|
268
|
+
break;
|
|
269
|
+
case i:
|
|
270
|
+
m = y / e;
|
|
271
|
+
break;
|
|
272
|
+
default: m = y;
|
|
273
|
+
}
|
|
274
|
+
return p ? m : T.a(m);
|
|
275
|
+
}, _.daysInMonth = function() {
|
|
276
|
+
return this.endOf(l).$D;
|
|
277
|
+
}, _.$locale = function() {
|
|
278
|
+
return b[this.$L];
|
|
279
|
+
}, _.locale = function(e, t) {
|
|
280
|
+
if (!e) return this.$L;
|
|
281
|
+
var n = this.clone(), r = C(e, t, !0);
|
|
282
|
+
return r && (n.$L = r), n;
|
|
283
|
+
}, _.clone = function() {
|
|
284
|
+
return T.w(this.$d, this);
|
|
285
|
+
}, _.toDate = function() {
|
|
286
|
+
return new Date(this.valueOf());
|
|
287
|
+
}, _.toJSON = function() {
|
|
288
|
+
return this.isValid() ? this.toISOString() : null;
|
|
289
|
+
}, _.toISOString = function() {
|
|
290
|
+
return this.$d.toISOString();
|
|
291
|
+
}, _.toString = function() {
|
|
292
|
+
return this.$d.toUTCString();
|
|
293
|
+
}, g;
|
|
294
|
+
}(), D = E.prototype;
|
|
295
|
+
return w.prototype = D, [
|
|
296
|
+
["$ms", r],
|
|
297
|
+
["$s", i],
|
|
298
|
+
["$m", a],
|
|
299
|
+
["$H", o],
|
|
300
|
+
["$W", s],
|
|
301
|
+
["$M", l],
|
|
302
|
+
["$y", d],
|
|
303
|
+
["$D", f]
|
|
304
|
+
].forEach((function(e) {
|
|
305
|
+
D[e[1]] = function(t) {
|
|
306
|
+
return this.$g(t, e[0], e[1]);
|
|
307
|
+
};
|
|
308
|
+
})), w.extend = function(e, t) {
|
|
309
|
+
return e.$i ||= (e(t, E, w), !0), w;
|
|
310
|
+
}, w.locale = C, w.isDayjs = S, w.unix = function(e) {
|
|
311
|
+
return w(1e3 * e);
|
|
312
|
+
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
313
|
+
}));
|
|
314
|
+
})))();
|
|
17
315
|
//#endregion
|
|
18
316
|
//#region ../ccui/ui/locale/zh-CN.ts
|
|
19
|
-
var
|
|
317
|
+
var u = {
|
|
20
318
|
locale: "zh-CN",
|
|
21
319
|
Modal: {
|
|
22
320
|
okText: "确 定",
|
|
@@ -31,7 +329,10 @@ var l = {
|
|
|
31
329
|
AutoComplete: { notFoundContent: "暂无数据" },
|
|
32
330
|
Mentions: { notFoundContent: "暂无数据" },
|
|
33
331
|
Cascader: { notFoundContent: "暂无数据" },
|
|
34
|
-
TreeSelect: {
|
|
332
|
+
TreeSelect: {
|
|
333
|
+
notFoundContent: "暂无数据",
|
|
334
|
+
searchPlaceholder: "搜索"
|
|
335
|
+
},
|
|
35
336
|
Select: { notFoundContent: "暂无数据" },
|
|
36
337
|
Pagination: {
|
|
37
338
|
itemsPerPage: "条/页",
|
|
@@ -39,7 +340,8 @@ var l = {
|
|
|
39
340
|
page: "页",
|
|
40
341
|
prevPage: "上一页",
|
|
41
342
|
nextPage: "下一页",
|
|
42
|
-
total: "共 {total} 条"
|
|
343
|
+
total: "共 {total} 条",
|
|
344
|
+
pagination: "分页"
|
|
43
345
|
},
|
|
44
346
|
Image: {
|
|
45
347
|
loading: "加载中",
|
|
@@ -88,15 +390,30 @@ var l = {
|
|
|
88
390
|
nextYearLabel: "后一年",
|
|
89
391
|
nextMonthLabel: "下个月",
|
|
90
392
|
clearLabel: "清除"
|
|
393
|
+
},
|
|
394
|
+
Calendar: {
|
|
395
|
+
weekdaysShort: [
|
|
396
|
+
"日",
|
|
397
|
+
"一",
|
|
398
|
+
"二",
|
|
399
|
+
"三",
|
|
400
|
+
"四",
|
|
401
|
+
"五",
|
|
402
|
+
"六"
|
|
403
|
+
],
|
|
404
|
+
prevMonthLabel: "上个月",
|
|
405
|
+
nextMonthLabel: "下个月",
|
|
406
|
+
todayLabel: "今天",
|
|
407
|
+
monthFormat: "YYYY 年 M 月"
|
|
91
408
|
}
|
|
92
|
-
},
|
|
409
|
+
}, d = Symbol("ccui-config");
|
|
93
410
|
//#endregion
|
|
94
411
|
//#region ../ccui/ui/config-provider/src/config-provider.tsx
|
|
95
|
-
function
|
|
96
|
-
return i(
|
|
412
|
+
function f() {
|
|
413
|
+
return i(d, {
|
|
97
414
|
prefixCls: "ccui",
|
|
98
415
|
componentSize: "middle",
|
|
99
|
-
locale:
|
|
416
|
+
locale: u,
|
|
100
417
|
direction: "ltr",
|
|
101
418
|
theme: void 0,
|
|
102
419
|
iconPrefixCls: "ccui-icon"
|
|
@@ -104,7 +421,7 @@ function d() {
|
|
|
104
421
|
}
|
|
105
422
|
//#endregion
|
|
106
423
|
//#region ../ccui/ui/pagination/src/pagination-types.ts
|
|
107
|
-
var
|
|
424
|
+
var p = {
|
|
108
425
|
current: {
|
|
109
426
|
type: Number,
|
|
110
427
|
default: 1
|
|
@@ -154,52 +471,52 @@ var f = {
|
|
|
154
471
|
type: String,
|
|
155
472
|
default: "default"
|
|
156
473
|
}
|
|
157
|
-
},
|
|
158
|
-
function
|
|
474
|
+
}, m = -1;
|
|
475
|
+
function h(e, t) {
|
|
159
476
|
if (t <= 7) return Array.from({ length: t }, (e, t) => t + 1);
|
|
160
477
|
let n = [1];
|
|
161
|
-
return e <= 4 ? (n.push(2, 3, 4, 5,
|
|
478
|
+
return e <= 4 ? (n.push(2, 3, 4, 5, m, t), n) : e >= t - 3 ? (n.push(m, t - 4, t - 3, t - 2, t - 1, t), n) : (n.push(m, e - 1, e, e + 1, m, t), n);
|
|
162
479
|
}
|
|
163
|
-
var
|
|
480
|
+
var g = /* @__PURE__ */ r({
|
|
164
481
|
name: "CPagination",
|
|
165
|
-
props:
|
|
482
|
+
props: p,
|
|
166
483
|
emits: [
|
|
167
484
|
"update:current",
|
|
168
485
|
"update:pageSize",
|
|
169
486
|
"change"
|
|
170
487
|
],
|
|
171
488
|
setup(r, { emit: i, slots: s }) {
|
|
172
|
-
let
|
|
489
|
+
let c = l("pagination"), u = f(), d = e(() => u.locale?.Pagination ?? {}), p = a(r.current), g = a(r.pageSize), _ = a("");
|
|
173
490
|
o(() => r.current, (e) => {
|
|
174
|
-
|
|
491
|
+
p.value = e;
|
|
175
492
|
}), o(() => r.pageSize, (e) => {
|
|
176
493
|
g.value = e;
|
|
177
494
|
});
|
|
178
495
|
let v = e(() => {
|
|
179
496
|
let e = g.value || 1;
|
|
180
497
|
return Math.max(1, Math.ceil(r.total / e));
|
|
181
|
-
}), y = e(() =>
|
|
182
|
-
let e = (
|
|
498
|
+
}), y = e(() => h(p.value, v.value)), b = e(() => {
|
|
499
|
+
let e = (p.value - 1) * g.value + 1, t = Math.min(p.value * g.value, r.total);
|
|
183
500
|
return [Math.min(e, t), t];
|
|
184
501
|
}), x = e(() => ({
|
|
185
|
-
[
|
|
186
|
-
[
|
|
187
|
-
[
|
|
188
|
-
[
|
|
502
|
+
[c.b()]: !0,
|
|
503
|
+
[c.m("disabled")]: r.disabled,
|
|
504
|
+
[c.m("simple")]: r.simple,
|
|
505
|
+
[c.m("small")]: r.size === "small"
|
|
189
506
|
})), S = (e) => {
|
|
190
507
|
if (r.disabled) return;
|
|
191
508
|
let t = Math.max(1, Math.min(v.value, e));
|
|
192
|
-
t !==
|
|
509
|
+
t !== p.value && (p.value = t, i("update:current", t), i("change", t, g.value));
|
|
193
510
|
}, C = () => {
|
|
194
|
-
|
|
511
|
+
p.value > 1 && S(p.value - 1);
|
|
195
512
|
}, w = () => {
|
|
196
|
-
|
|
513
|
+
p.value < v.value && S(p.value + 1);
|
|
197
514
|
}, T = (e) => {
|
|
198
515
|
let t = e.target, n = Number(t.value);
|
|
199
516
|
if (Number.isNaN(n) || n === g.value) return;
|
|
200
517
|
g.value = n, i("update:pageSize", n);
|
|
201
518
|
let a = Math.max(1, Math.ceil(r.total / n));
|
|
202
|
-
|
|
519
|
+
p.value > a && (p.value = a, i("update:current", a)), i("change", p.value, n);
|
|
203
520
|
}, E = (e) => {
|
|
204
521
|
if (e.key !== "Enter") return;
|
|
205
522
|
let t = Number(_.value);
|
|
@@ -207,31 +524,31 @@ var h = /* @__PURE__ */ r({
|
|
|
207
524
|
}, D = () => {
|
|
208
525
|
if (!r.showTotal) return null;
|
|
209
526
|
let e;
|
|
210
|
-
return e = typeof r.showTotal == "function" ? r.showTotal(r.total, b.value) : (
|
|
527
|
+
return e = typeof r.showTotal == "function" ? r.showTotal(r.total, b.value) : (d.value.total || "共 {total} 条").replace("{total}", String(r.total)), n("li", { class: c.e("total-text") }, [e]);
|
|
211
528
|
}, O = (e) => {
|
|
212
|
-
if (e ===
|
|
213
|
-
class: [
|
|
529
|
+
if (e === m) return n("li", {
|
|
530
|
+
class: [c.e("item"), c.em("item", "ellipsis")],
|
|
214
531
|
"aria-hidden": !0
|
|
215
532
|
}, [t("•••")]);
|
|
216
|
-
let r = e ===
|
|
533
|
+
let r = e === p.value;
|
|
217
534
|
return n("li", {
|
|
218
535
|
key: e,
|
|
219
|
-
class: [
|
|
536
|
+
class: [c.e("item"), r && c.em("item", "active")],
|
|
220
537
|
"aria-current": r ? "page" : void 0,
|
|
221
538
|
onClick: () => S(e)
|
|
222
539
|
}, [e]);
|
|
223
|
-
}, k = () => r.showSizeChanger ? n("li", { class:
|
|
224
|
-
class:
|
|
540
|
+
}, k = () => r.showSizeChanger ? n("li", { class: c.e("size-changer") }, [n("select", {
|
|
541
|
+
class: c.e("size-select"),
|
|
225
542
|
value: g.value,
|
|
226
543
|
disabled: r.disabled,
|
|
227
544
|
onChange: T
|
|
228
545
|
}, [r.pageSizeOptions.map((e) => n("option", {
|
|
229
546
|
key: e,
|
|
230
547
|
value: e
|
|
231
|
-
}, [`${e} ${
|
|
232
|
-
|
|
548
|
+
}, [`${e} ${d.value.itemsPerPage || "条/页"}`]))])]) : null, A = () => r.showQuickJumper ? n("li", { class: c.e("jumper") }, [
|
|
549
|
+
d.value.jumpTo || "跳至",
|
|
233
550
|
n("input", {
|
|
234
|
-
class:
|
|
551
|
+
class: c.e("jumper-input"),
|
|
235
552
|
type: "text",
|
|
236
553
|
value: _.value,
|
|
237
554
|
disabled: r.disabled,
|
|
@@ -240,39 +557,43 @@ var h = /* @__PURE__ */ r({
|
|
|
240
557
|
},
|
|
241
558
|
onKeydown: E
|
|
242
559
|
}, null),
|
|
243
|
-
|
|
560
|
+
d.value.page || "页"
|
|
244
561
|
]) : null;
|
|
245
562
|
return () => {
|
|
246
563
|
if (r.hideOnSinglePage && v.value <= 1) return null;
|
|
247
|
-
let e =
|
|
248
|
-
return n("ul", {
|
|
564
|
+
let e = p.value <= 1 || r.disabled, i = p.value >= v.value || r.disabled;
|
|
565
|
+
return n("ul", {
|
|
566
|
+
class: x.value,
|
|
567
|
+
role: "navigation",
|
|
568
|
+
"aria-label": d.value.pagination || "分页"
|
|
569
|
+
}, [
|
|
249
570
|
D(),
|
|
250
571
|
n("li", {
|
|
251
|
-
class: [
|
|
572
|
+
class: [c.e("prev"), e && c.is("disabled")],
|
|
252
573
|
onClick: C,
|
|
253
574
|
"aria-disabled": e,
|
|
254
|
-
"aria-label":
|
|
255
|
-
}, [s.prev ? s.prev() : n("span", { class:
|
|
256
|
-
r.simple ? n("li", { class:
|
|
575
|
+
"aria-label": d.value.prevPage || "上一页"
|
|
576
|
+
}, [s.prev ? s.prev() : n("span", { class: c.e("arrow") }, [t("‹")])]),
|
|
577
|
+
r.simple ? n("li", { class: c.e("simple-pager") }, [
|
|
257
578
|
n("input", {
|
|
258
|
-
class:
|
|
579
|
+
class: c.e("simple-input"),
|
|
259
580
|
type: "text",
|
|
260
|
-
value:
|
|
581
|
+
value: p.value,
|
|
261
582
|
disabled: r.disabled,
|
|
262
583
|
onChange: (e) => {
|
|
263
584
|
let t = Number(e.target.value);
|
|
264
585
|
Number.isNaN(t) || S(Math.floor(t));
|
|
265
586
|
}
|
|
266
587
|
}, null),
|
|
267
|
-
n("span", { class:
|
|
268
|
-
n("span", { class:
|
|
588
|
+
n("span", { class: c.e("simple-slash") }, [t("/")]),
|
|
589
|
+
n("span", { class: c.e("simple-total") }, [v.value])
|
|
269
590
|
]) : y.value.map(O),
|
|
270
591
|
n("li", {
|
|
271
|
-
class: [
|
|
592
|
+
class: [c.e("next"), i && c.is("disabled")],
|
|
272
593
|
onClick: w,
|
|
273
594
|
"aria-disabled": i,
|
|
274
|
-
"aria-label":
|
|
275
|
-
}, [s.next ? s.next() : n("span", { class:
|
|
595
|
+
"aria-label": d.value.nextPage || "下一页"
|
|
596
|
+
}, [s.next ? s.next() : n("span", { class: c.e("arrow") }, [t("›")])]),
|
|
276
597
|
k(),
|
|
277
598
|
A()
|
|
278
599
|
]);
|
|
@@ -281,16 +602,16 @@ var h = /* @__PURE__ */ r({
|
|
|
281
602
|
});
|
|
282
603
|
//#endregion
|
|
283
604
|
//#region ../ccui/ui/pagination/index.ts
|
|
284
|
-
|
|
285
|
-
e.component(
|
|
605
|
+
g.install = function(e) {
|
|
606
|
+
e.component(g.name, g);
|
|
286
607
|
};
|
|
287
|
-
var
|
|
608
|
+
var _ = {
|
|
288
609
|
title: "Pagination 分页",
|
|
289
610
|
category: "导航",
|
|
290
611
|
status: "100%",
|
|
291
612
|
install(e) {
|
|
292
|
-
e.component(
|
|
613
|
+
e.component(g.name, g);
|
|
293
614
|
}
|
|
294
615
|
};
|
|
295
616
|
//#endregion
|
|
296
|
-
export {
|
|
617
|
+
export { g as Pagination, _ as default };
|
package/pagination/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function n(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function r(e,t=!1){let r=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>n(r),e:e=>e?n(r,e):``,m:e=>e?n(r,``,e):``,em:(e,t)=>e&&t?n(r,e,t):``,is:e=>`is-${e}`}}var i={locale:`zh-CN`,Modal:{okText:`确 定`,cancelText:`取 消`,justOkText:`知道了`},Popconfirm:{okText:`确 定`,cancelText:`取 消`},Empty:{description:`暂无数据`},AutoComplete:{notFoundContent:`暂无数据`},Mentions:{notFoundContent:`暂无数据`},Cascader:{notFoundContent:`暂无数据`},TreeSelect:{notFoundContent:`暂无数据`},Select:{notFoundContent:`暂无数据`},Pagination:{itemsPerPage:`条/页`,jumpTo:`跳至`,page:`页`,prevPage:`上一页`,nextPage:`下一页`,total:`共 {total} 条`},Image:{loading:`加载中`,error:`加载失败`},DatePicker:{placeholder:`请选择日期`,rangePlaceholder:[`开始日期`,`结束日期`],timePlaceholder:`请选择时间`,weekdaysShort:[`日`,`一`,`二`,`三`,`四`,`五`,`六`],panelLabelFormat:`YYYY 年 M 月`,monthNamesShort:[`1 月`,`2 月`,`3 月`,`4 月`,`5 月`,`6 月`,`7 月`,`8 月`,`9 月`,`10 月`,`11 月`,`12 月`],quarterNames:[`一季度`,`二季度`,`三季度`,`四季度`],weekFormat:`{weekYear} 年第 {weekNumber} 周`,weekHeader:`周`,now:`此刻`,ok:`确定`,prevYearLabel:`前一年`,prevMonthLabel:`上个月`,nextYearLabel:`后一年`,nextMonthLabel:`下个月`,clearLabel:`清除`}},a=Symbol(`ccui-config`);function o(){return(0,t.inject)(a,{prefixCls:`ccui`,componentSize:`middle`,locale:i,direction:`ltr`,theme:void 0,iconPrefixCls:`ccui-icon`})}var s={current:{type:Number,default:1},total:{type:Number,default:0},pageSize:{type:Number,default:10},pageSizeOptions:{type:Array,default:()=>[10,20,50,100]},showSizeChanger:{type:Boolean,default:!1},showQuickJumper:{type:Boolean,default:!1},showTotal:{type:[Boolean,Function],default:!1},simple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnSinglePage:{type:Boolean,default:!1},size:{type:String,default:`default`}},c=-1;function l(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[1];return e<=4?(n.push(2,3,4,5,c,t),n):e>=t-3?(n.push(c,t-4,t-3,t-2,t-1,t),n):(n.push(c,e-1,e,e+1,c,t),n)}var u=(0,t.defineComponent)({name:`CPagination`,props:s,emits:[`update:current`,`update:pageSize`,`change`],setup(e,{emit:n,slots:i}){let a=r(`pagination`),s=o(),u=(0,t.computed)(()=>s.locale?.Pagination??{}),d=(0,t.ref)(e.current),f=(0,t.ref)(e.pageSize),p=(0,t.ref)(``);(0,t.watch)(()=>e.current,e=>{d.value=e}),(0,t.watch)(()=>e.pageSize,e=>{f.value=e});let m=(0,t.computed)(()=>{let t=f.value||1;return Math.max(1,Math.ceil(e.total/t))}),h=(0,t.computed)(()=>l(d.value,m.value)),g=(0,t.computed)(()=>{let t=(d.value-1)*f.value+1,n=Math.min(d.value*f.value,e.total);return[Math.min(t,n),n]}),_=(0,t.computed)(()=>({[a.b()]:!0,[a.m(`disabled`)]:e.disabled,[a.m(`simple`)]:e.simple,[a.m(`small`)]:e.size===`small`})),v=t=>{if(e.disabled)return;let r=Math.max(1,Math.min(m.value,t));r!==d.value&&(d.value=r,n(`update:current`,r),n(`change`,r,f.value))},y=()=>{d.value>1&&v(d.value-1)},b=()=>{d.value<m.value&&v(d.value+1)},x=t=>{let r=t.target,i=Number(r.value);if(Number.isNaN(i)||i===f.value)return;f.value=i,n(`update:pageSize`,i);let a=Math.max(1,Math.ceil(e.total/i));d.value>a&&(d.value=a,n(`update:current`,a)),n(`change`,d.value,i)},S=e=>{if(e.key!==`Enter`)return;let t=Number(p.value);!Number.isNaN(t)&&t>=1&&v(Math.floor(t)),p.value=``},C=()=>{if(!e.showTotal)return null;let n;return n=typeof e.showTotal==`function`?e.showTotal(e.total,g.value):(u.value.total||`共 {total} 条`).replace(`{total}`,String(e.total)),(0,t.createVNode)(`li`,{class:a.e(`total-text`)},[n])},w=e=>{if(e===c)return(0,t.createVNode)(`li`,{class:[a.e(`item`),a.em(`item`,`ellipsis`)],"aria-hidden":!0},[(0,t.createTextVNode)(`•••`)]);let n=e===d.value;return(0,t.createVNode)(`li`,{key:e,class:[a.e(`item`),n&&a.em(`item`,`active`)],"aria-current":n?`page`:void 0,onClick:()=>v(e)},[e])},T=()=>e.showSizeChanger?(0,t.createVNode)(`li`,{class:a.e(`size-changer`)},[(0,t.createVNode)(`select`,{class:a.e(`size-select`),value:f.value,disabled:e.disabled,onChange:x},[e.pageSizeOptions.map(e=>(0,t.createVNode)(`option`,{key:e,value:e},[`${e} ${u.value.itemsPerPage||`条/页`}`]))])]):null,E=()=>e.showQuickJumper?(0,t.createVNode)(`li`,{class:a.e(`jumper`)},[u.value.jumpTo||`跳至`,(0,t.createVNode)(`input`,{class:a.e(`jumper-input`),type:`text`,value:p.value,disabled:e.disabled,onInput:e=>{p.value=e.target.value},onKeydown:S},null),u.value.page||`页`]):null;return()=>{if(e.hideOnSinglePage&&m.value<=1)return null;let n=d.value<=1||e.disabled,r=d.value>=m.value||e.disabled;return(0,t.createVNode)(`ul`,{class:_.value},[C(),(0,t.createVNode)(`li`,{class:[a.e(`prev`),n&&a.is(`disabled`)],onClick:y,"aria-disabled":n,"aria-label":u.value.prevPage||`上一页`},[i.prev?i.prev():(0,t.createVNode)(`span`,{class:a.e(`arrow`)},[(0,t.createTextVNode)(`‹`)])]),e.simple?(0,t.createVNode)(`li`,{class:a.e(`simple-pager`)},[(0,t.createVNode)(`input`,{class:a.e(`simple-input`),type:`text`,value:d.value,disabled:e.disabled,onChange:e=>{let t=Number(e.target.value);Number.isNaN(t)||v(Math.floor(t))}},null),(0,t.createVNode)(`span`,{class:a.e(`simple-slash`)},[(0,t.createTextVNode)(`/`)]),(0,t.createVNode)(`span`,{class:a.e(`simple-total`)},[m.value])]):h.value.map(w),(0,t.createVNode)(`li`,{class:[a.e(`next`),r&&a.is(`disabled`)],onClick:b,"aria-disabled":r,"aria-label":u.value.nextPage||`下一页`},[i.next?i.next():(0,t.createVNode)(`span`,{class:a.e(`arrow`)},[(0,t.createTextVNode)(`›`)])]),T(),E()])}}});u.install=function(e){e.component(u.name,u)},e.Pagination=u,e.default={title:`Pagination 分页`,category:`导航`,status:`100%`,install(e){e.component(u.name,u)}}});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function r(e,t,n){let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r}function i(e,t=!1){let n=t?`.ccui-${e}`:`ccui-${e}`;return{b:()=>r(n),e:e=>e?r(n,e):``,m:e=>e?r(n,``,e):``,em:(e,t)=>e&&t?r(n,e,t):``,is:e=>`is-${e}`}}n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}))();var a={locale:`zh-CN`,Modal:{okText:`确 定`,cancelText:`取 消`,justOkText:`知道了`},Popconfirm:{okText:`确 定`,cancelText:`取 消`},Empty:{description:`暂无数据`},AutoComplete:{notFoundContent:`暂无数据`},Mentions:{notFoundContent:`暂无数据`},Cascader:{notFoundContent:`暂无数据`},TreeSelect:{notFoundContent:`暂无数据`,searchPlaceholder:`搜索`},Select:{notFoundContent:`暂无数据`},Pagination:{itemsPerPage:`条/页`,jumpTo:`跳至`,page:`页`,prevPage:`上一页`,nextPage:`下一页`,total:`共 {total} 条`,pagination:`分页`},Image:{loading:`加载中`,error:`加载失败`},DatePicker:{placeholder:`请选择日期`,rangePlaceholder:[`开始日期`,`结束日期`],timePlaceholder:`请选择时间`,weekdaysShort:[`日`,`一`,`二`,`三`,`四`,`五`,`六`],panelLabelFormat:`YYYY 年 M 月`,monthNamesShort:[`1 月`,`2 月`,`3 月`,`4 月`,`5 月`,`6 月`,`7 月`,`8 月`,`9 月`,`10 月`,`11 月`,`12 月`],quarterNames:[`一季度`,`二季度`,`三季度`,`四季度`],weekFormat:`{weekYear} 年第 {weekNumber} 周`,weekHeader:`周`,now:`此刻`,ok:`确定`,prevYearLabel:`前一年`,prevMonthLabel:`上个月`,nextYearLabel:`后一年`,nextMonthLabel:`下个月`,clearLabel:`清除`},Calendar:{weekdaysShort:[`日`,`一`,`二`,`三`,`四`,`五`,`六`],prevMonthLabel:`上个月`,nextMonthLabel:`下个月`,todayLabel:`今天`,monthFormat:`YYYY 年 M 月`}},o=Symbol(`ccui-config`);function s(){return(0,t.inject)(o,{prefixCls:`ccui`,componentSize:`middle`,locale:a,direction:`ltr`,theme:void 0,iconPrefixCls:`ccui-icon`})}var c={current:{type:Number,default:1},total:{type:Number,default:0},pageSize:{type:Number,default:10},pageSizeOptions:{type:Array,default:()=>[10,20,50,100]},showSizeChanger:{type:Boolean,default:!1},showQuickJumper:{type:Boolean,default:!1},showTotal:{type:[Boolean,Function],default:!1},simple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnSinglePage:{type:Boolean,default:!1},size:{type:String,default:`default`}},l=-1;function u(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[1];return e<=4?(n.push(2,3,4,5,l,t),n):e>=t-3?(n.push(l,t-4,t-3,t-2,t-1,t),n):(n.push(l,e-1,e,e+1,l,t),n)}var d=(0,t.defineComponent)({name:`CPagination`,props:c,emits:[`update:current`,`update:pageSize`,`change`],setup(e,{emit:n,slots:r}){let a=i(`pagination`),o=s(),c=(0,t.computed)(()=>o.locale?.Pagination??{}),d=(0,t.ref)(e.current),f=(0,t.ref)(e.pageSize),p=(0,t.ref)(``);(0,t.watch)(()=>e.current,e=>{d.value=e}),(0,t.watch)(()=>e.pageSize,e=>{f.value=e});let m=(0,t.computed)(()=>{let t=f.value||1;return Math.max(1,Math.ceil(e.total/t))}),h=(0,t.computed)(()=>u(d.value,m.value)),g=(0,t.computed)(()=>{let t=(d.value-1)*f.value+1,n=Math.min(d.value*f.value,e.total);return[Math.min(t,n),n]}),_=(0,t.computed)(()=>({[a.b()]:!0,[a.m(`disabled`)]:e.disabled,[a.m(`simple`)]:e.simple,[a.m(`small`)]:e.size===`small`})),v=t=>{if(e.disabled)return;let r=Math.max(1,Math.min(m.value,t));r!==d.value&&(d.value=r,n(`update:current`,r),n(`change`,r,f.value))},y=()=>{d.value>1&&v(d.value-1)},b=()=>{d.value<m.value&&v(d.value+1)},x=t=>{let r=t.target,i=Number(r.value);if(Number.isNaN(i)||i===f.value)return;f.value=i,n(`update:pageSize`,i);let a=Math.max(1,Math.ceil(e.total/i));d.value>a&&(d.value=a,n(`update:current`,a)),n(`change`,d.value,i)},S=e=>{if(e.key!==`Enter`)return;let t=Number(p.value);!Number.isNaN(t)&&t>=1&&v(Math.floor(t)),p.value=``},C=()=>{if(!e.showTotal)return null;let n;return n=typeof e.showTotal==`function`?e.showTotal(e.total,g.value):(c.value.total||`共 {total} 条`).replace(`{total}`,String(e.total)),(0,t.createVNode)(`li`,{class:a.e(`total-text`)},[n])},w=e=>{if(e===l)return(0,t.createVNode)(`li`,{class:[a.e(`item`),a.em(`item`,`ellipsis`)],"aria-hidden":!0},[(0,t.createTextVNode)(`•••`)]);let n=e===d.value;return(0,t.createVNode)(`li`,{key:e,class:[a.e(`item`),n&&a.em(`item`,`active`)],"aria-current":n?`page`:void 0,onClick:()=>v(e)},[e])},T=()=>e.showSizeChanger?(0,t.createVNode)(`li`,{class:a.e(`size-changer`)},[(0,t.createVNode)(`select`,{class:a.e(`size-select`),value:f.value,disabled:e.disabled,onChange:x},[e.pageSizeOptions.map(e=>(0,t.createVNode)(`option`,{key:e,value:e},[`${e} ${c.value.itemsPerPage||`条/页`}`]))])]):null,E=()=>e.showQuickJumper?(0,t.createVNode)(`li`,{class:a.e(`jumper`)},[c.value.jumpTo||`跳至`,(0,t.createVNode)(`input`,{class:a.e(`jumper-input`),type:`text`,value:p.value,disabled:e.disabled,onInput:e=>{p.value=e.target.value},onKeydown:S},null),c.value.page||`页`]):null;return()=>{if(e.hideOnSinglePage&&m.value<=1)return null;let n=d.value<=1||e.disabled,i=d.value>=m.value||e.disabled;return(0,t.createVNode)(`ul`,{class:_.value,role:`navigation`,"aria-label":c.value.pagination||`分页`},[C(),(0,t.createVNode)(`li`,{class:[a.e(`prev`),n&&a.is(`disabled`)],onClick:y,"aria-disabled":n,"aria-label":c.value.prevPage||`上一页`},[r.prev?r.prev():(0,t.createVNode)(`span`,{class:a.e(`arrow`)},[(0,t.createTextVNode)(`‹`)])]),e.simple?(0,t.createVNode)(`li`,{class:a.e(`simple-pager`)},[(0,t.createVNode)(`input`,{class:a.e(`simple-input`),type:`text`,value:d.value,disabled:e.disabled,onChange:e=>{let t=Number(e.target.value);Number.isNaN(t)||v(Math.floor(t))}},null),(0,t.createVNode)(`span`,{class:a.e(`simple-slash`)},[(0,t.createTextVNode)(`/`)]),(0,t.createVNode)(`span`,{class:a.e(`simple-total`)},[m.value])]):h.value.map(w),(0,t.createVNode)(`li`,{class:[a.e(`next`),i&&a.is(`disabled`)],onClick:b,"aria-disabled":i,"aria-label":c.value.nextPage||`下一页`},[r.next?r.next():(0,t.createVNode)(`span`,{class:a.e(`arrow`)},[(0,t.createTextVNode)(`›`)])]),T(),E()])}}});d.install=function(e){e.component(d.name,d)},e.Pagination=d,e.default={title:`Pagination 分页`,category:`导航`,status:`100%`,install(e){e.component(d.name,d)}}});
|