@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/image/index.es.js
CHANGED
|
@@ -1,22 +1,320 @@
|
|
|
1
1
|
import { Teleport as e, Transition as t, computed as n, createTextVNode as r, createVNode as i, defineComponent as a, inject as o, onBeforeUnmount as s, onMounted as c, ref as l, vShow as u, watch as d, withDirectives as f } from "vue";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var p = (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 m(e, t, n) {
|
|
4
7
|
let r = e;
|
|
5
8
|
return t && (r += `__${t}`), n && (r += `--${n}`), r;
|
|
6
9
|
}
|
|
7
|
-
function
|
|
10
|
+
function h(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: () => m(n),
|
|
14
|
+
e: (e) => e ? m(n, e) : "",
|
|
15
|
+
m: (e) => e ? m(n, "", e) : "",
|
|
16
|
+
em: (e, t) => e && t ? m(n, e, t) : "",
|
|
14
17
|
is: (e) => `is-${e}`
|
|
15
18
|
};
|
|
16
19
|
}
|
|
20
|
+
(/* @__PURE__ */ p(((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 g = {
|
|
20
318
|
locale: "zh-CN",
|
|
21
319
|
Modal: {
|
|
22
320
|
okText: "确 定",
|
|
@@ -31,7 +329,10 @@ var h = {
|
|
|
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 h = {
|
|
|
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 h = {
|
|
|
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
|
+
}, _ = Symbol("ccui-config");
|
|
93
410
|
//#endregion
|
|
94
411
|
//#region ../ccui/ui/config-provider/src/config-provider.tsx
|
|
95
|
-
function
|
|
96
|
-
return o(
|
|
412
|
+
function v() {
|
|
413
|
+
return o(_, {
|
|
97
414
|
prefixCls: "ccui",
|
|
98
415
|
componentSize: "middle",
|
|
99
|
-
locale:
|
|
416
|
+
locale: g,
|
|
100
417
|
direction: "ltr",
|
|
101
418
|
theme: void 0,
|
|
102
419
|
iconPrefixCls: "ccui-icon"
|
|
@@ -104,7 +421,7 @@ function _() {
|
|
|
104
421
|
}
|
|
105
422
|
//#endregion
|
|
106
423
|
//#region ../ccui/ui/image/src/image-types.ts
|
|
107
|
-
var
|
|
424
|
+
var y = {
|
|
108
425
|
src: {
|
|
109
426
|
type: String,
|
|
110
427
|
required: !0
|
|
@@ -152,21 +469,21 @@ var v = {
|
|
|
152
469
|
};
|
|
153
470
|
//#endregion
|
|
154
471
|
//#region ../ccui/ui/image/src/image.tsx
|
|
155
|
-
function
|
|
472
|
+
function b(e) {
|
|
156
473
|
return e === "" || e == null ? "" : typeof e == "number" ? `${e}px` : String(e);
|
|
157
474
|
}
|
|
158
|
-
var
|
|
475
|
+
var x = /* @__PURE__ */ a({
|
|
159
476
|
name: "CImage",
|
|
160
|
-
props:
|
|
477
|
+
props: y,
|
|
161
478
|
emits: [
|
|
162
479
|
"load",
|
|
163
480
|
"error",
|
|
164
481
|
"click"
|
|
165
482
|
],
|
|
166
483
|
setup(a, { emit: o, slots: p }) {
|
|
167
|
-
let
|
|
168
|
-
width:
|
|
169
|
-
height:
|
|
484
|
+
let m = h("image"), g = v(), _ = n(() => g.locale?.Image?.loading || "加载中"), y = n(() => g.locale?.Image?.error || "加载失败"), x = l("loading"), S = l(a.lazy ? "" : a.src), C = l(), w = l(!1), T = l(1), E = n(() => ({
|
|
485
|
+
width: b(a.width),
|
|
486
|
+
height: b(a.height)
|
|
170
487
|
})), D = n(() => ({ objectFit: a.fit })), O = (e) => {
|
|
171
488
|
x.value = "loaded", o("load", e);
|
|
172
489
|
}, k = (e) => {
|
|
@@ -202,20 +519,20 @@ var b = /* @__PURE__ */ a({
|
|
|
202
519
|
F?.disconnect();
|
|
203
520
|
}), () => i("div", {
|
|
204
521
|
ref: C,
|
|
205
|
-
class: [
|
|
522
|
+
class: [m.b(), a.classNames?.root],
|
|
206
523
|
style: [E.value, a.styles?.root]
|
|
207
524
|
}, [
|
|
208
|
-
x.value === "loading" && i("div", { class:
|
|
209
|
-
x.value === "error" && i("div", { class:
|
|
210
|
-
class: [
|
|
525
|
+
x.value === "loading" && i("div", { class: m.e("placeholder") }, [p.placeholder ? p.placeholder() : i("span", { class: m.e("loading") }, [_.value])]),
|
|
526
|
+
x.value === "error" && i("div", { class: m.e("error") }, [p.error ? p.error() : a.fallback ? i("img", {
|
|
527
|
+
class: [m.e("inner"), a.classNames?.image],
|
|
211
528
|
style: a.styles?.image,
|
|
212
529
|
src: a.fallback,
|
|
213
530
|
alt: a.alt
|
|
214
|
-
}, null) : i("span", null, [
|
|
531
|
+
}, null) : i("span", null, [y.value])]),
|
|
215
532
|
S.value && f(i("img", {
|
|
216
533
|
class: [
|
|
217
|
-
|
|
218
|
-
a.preview &&
|
|
534
|
+
m.e("inner"),
|
|
535
|
+
a.preview && m.em("inner", "preview"),
|
|
219
536
|
a.classNames?.image
|
|
220
537
|
],
|
|
221
538
|
style: [D.value, a.styles?.image],
|
|
@@ -225,12 +542,12 @@ var b = /* @__PURE__ */ a({
|
|
|
225
542
|
onError: k,
|
|
226
543
|
onClick: A
|
|
227
544
|
}, null), [[u, x.value !== "error"]]),
|
|
228
|
-
a.preview && i(e, { to: "body" }, { default: () => [i(t, { name: `${
|
|
229
|
-
class: [
|
|
545
|
+
a.preview && i(e, { to: "body" }, { default: () => [i(t, { name: `${m.b()}-preview-fade` }, { default: () => [w.value && i("div", {
|
|
546
|
+
class: [m.e("preview-mask"), a.classNames?.previewMask],
|
|
230
547
|
style: a.styles?.previewMask,
|
|
231
548
|
onClick: j
|
|
232
549
|
}, [i("div", {
|
|
233
|
-
class:
|
|
550
|
+
class: m.e("preview-toolbar"),
|
|
234
551
|
onClick: (e) => e.stopPropagation()
|
|
235
552
|
}, [
|
|
236
553
|
i("button", {
|
|
@@ -250,7 +567,7 @@ var b = /* @__PURE__ */ a({
|
|
|
250
567
|
"aria-label": "close"
|
|
251
568
|
}, [r("×")])
|
|
252
569
|
]), i("img", {
|
|
253
|
-
class:
|
|
570
|
+
class: m.e("preview-img"),
|
|
254
571
|
src: a.src,
|
|
255
572
|
alt: a.alt,
|
|
256
573
|
style: { transform: `scale(${T.value})` },
|
|
@@ -261,16 +578,16 @@ var b = /* @__PURE__ */ a({
|
|
|
261
578
|
});
|
|
262
579
|
//#endregion
|
|
263
580
|
//#region ../ccui/ui/image/index.ts
|
|
264
|
-
|
|
265
|
-
e.component(
|
|
581
|
+
x.install = function(e) {
|
|
582
|
+
e.component(x.name, x);
|
|
266
583
|
};
|
|
267
|
-
var
|
|
584
|
+
var S = {
|
|
268
585
|
title: "Image 图片",
|
|
269
586
|
category: "数据展示",
|
|
270
587
|
status: "100%",
|
|
271
588
|
install(e) {
|
|
272
|
-
e.component(
|
|
589
|
+
e.component(x.name, x);
|
|
273
590
|
}
|
|
274
591
|
};
|
|
275
592
|
//#endregion
|
|
276
|
-
export {
|
|
593
|
+
export { x as Image, S as default };
|
package/image/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={src:{type:String,required:!0},alt:{type:String,default:``},fit:{type:String,default:`fill`},width:{type:[Number,String],default:``},height:{type:[Number,String],default:``},preview:{type:Boolean,default:!1},fallback:{type:String,default:``},lazy:{type:Boolean,default:!1},rootMargin:{type:String,default:`0px`},classNames:{type:Object,default:void 0},styles:{type:Object,default:void 0}};function c(e){return e===``||e==null?``:typeof e==`number`?`${e}px`:String(e)}var l=(0,t.defineComponent)({name:`CImage`,props:s,emits:[`load`,`error`,`click`],setup(e,{emit:n,slots:i}){let a=r(`image`),s=o(),l=(0,t.computed)(()=>s.locale?.Image?.loading||`加载中`),u=(0,t.computed)(()=>s.locale?.Image?.error||`加载失败`),d=(0,t.ref)(`loading`),f=(0,t.ref)(e.lazy?``:e.src),p=(0,t.ref)(),m=(0,t.ref)(!1),h=(0,t.ref)(1),g=(0,t.computed)(()=>({width:c(e.width),height:c(e.height)})),_=(0,t.computed)(()=>({objectFit:e.fit})),v=e=>{d.value=`loaded`,n(`load`,e)},y=e=>{d.value=`error`,n(`error`,e)},b=t=>{n(`click`,t),e.preview&&d.value===`loaded`&&(m.value=!0,h.value=1)},x=()=>{m.value=!1},S=()=>{h.value=Math.min(h.value*1.25,6)},C=()=>{h.value=Math.max(h.value/1.25,.25)},w=()=>{h.value=1},T=null,E=()=>{if(!(!e.lazy||!p.value)){if(typeof IntersectionObserver>`u`){f.value=e.src;return}T=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(f.value=e.src,T?.disconnect(),T=null)})},{rootMargin:e.rootMargin}),T.observe(p.value)}};return(0,t.onMounted)(()=>{e.lazy&&E()}),(0,t.watch)(()=>e.src,t=>{d.value=`loading`,f.value=e.lazy?``:t,e.lazy&&E()}),(0,t.onBeforeUnmount)(()=>{T?.disconnect()}),()=>(0,t.createVNode)(`div`,{ref:p,class:[a.b(),e.classNames?.root],style:[g.value,e.styles?.root]},[d.value===`loading`&&(0,t.createVNode)(`div`,{class:a.e(`placeholder`)},[i.placeholder?i.placeholder():(0,t.createVNode)(`span`,{class:a.e(`loading`)},[l.value])]),d.value===`error`&&(0,t.createVNode)(`div`,{class:a.e(`error`)},[i.error?i.error():e.fallback?(0,t.createVNode)(`img`,{class:[a.e(`inner`),e.classNames?.image],style:e.styles?.image,src:e.fallback,alt:e.alt},null):(0,t.createVNode)(`span`,null,[u.value])]),f.value&&(0,t.withDirectives)((0,t.createVNode)(`img`,{class:[a.e(`inner`),e.preview&&a.em(`inner`,`preview`),e.classNames?.image],style:[_.value,e.styles?.image],src:f.value,alt:e.alt,onLoad:v,onError:y,onClick:b},null),[[t.vShow,d.value!==`error`]]),e.preview&&(0,t.createVNode)(t.Teleport,{to:`body`},{default:()=>[(0,t.createVNode)(t.Transition,{name:`${a.b()}-preview-fade`},{default:()=>[m.value&&(0,t.createVNode)(`div`,{class:[a.e(`preview-mask`),e.classNames?.previewMask],style:e.styles?.previewMask,onClick:x},[(0,t.createVNode)(`div`,{class:a.e(`preview-toolbar`),onClick:e=>e.stopPropagation()},[(0,t.createVNode)(`button`,{onClick:C,"aria-label":`zoom out`},[(0,t.createTextVNode)(`−`)]),(0,t.createVNode)(`button`,{onClick:w,"aria-label":`reset`},[(0,t.createTextVNode)(`⟳`)]),(0,t.createVNode)(`button`,{onClick:S,"aria-label":`zoom in`},[(0,t.createTextVNode)(`+`)]),(0,t.createVNode)(`button`,{onClick:x,"aria-label":`close`},[(0,t.createTextVNode)(`×`)])]),(0,t.createVNode)(`img`,{class:a.e(`preview-img`),src:e.src,alt:e.alt,style:{transform:`scale(${h.value})`},onClick:e=>e.stopPropagation()},null)])]})]})])}});l.install=function(e){e.component(l.name,l)},e.Image=l,e.default={title:`Image 图片`,category:`数据展示`,status:`100%`,install(e){e.component(l.name,l)}}});
|
|
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={src:{type:String,required:!0},alt:{type:String,default:``},fit:{type:String,default:`fill`},width:{type:[Number,String],default:``},height:{type:[Number,String],default:``},preview:{type:Boolean,default:!1},fallback:{type:String,default:``},lazy:{type:Boolean,default:!1},rootMargin:{type:String,default:`0px`},classNames:{type:Object,default:void 0},styles:{type:Object,default:void 0}};function l(e){return e===``||e==null?``:typeof e==`number`?`${e}px`:String(e)}var u=(0,t.defineComponent)({name:`CImage`,props:c,emits:[`load`,`error`,`click`],setup(e,{emit:n,slots:r}){let a=i(`image`),o=s(),c=(0,t.computed)(()=>o.locale?.Image?.loading||`加载中`),u=(0,t.computed)(()=>o.locale?.Image?.error||`加载失败`),d=(0,t.ref)(`loading`),f=(0,t.ref)(e.lazy?``:e.src),p=(0,t.ref)(),m=(0,t.ref)(!1),h=(0,t.ref)(1),g=(0,t.computed)(()=>({width:l(e.width),height:l(e.height)})),_=(0,t.computed)(()=>({objectFit:e.fit})),v=e=>{d.value=`loaded`,n(`load`,e)},y=e=>{d.value=`error`,n(`error`,e)},b=t=>{n(`click`,t),e.preview&&d.value===`loaded`&&(m.value=!0,h.value=1)},x=()=>{m.value=!1},S=()=>{h.value=Math.min(h.value*1.25,6)},C=()=>{h.value=Math.max(h.value/1.25,.25)},w=()=>{h.value=1},T=null,E=()=>{if(!(!e.lazy||!p.value)){if(typeof IntersectionObserver>`u`){f.value=e.src;return}T=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(f.value=e.src,T?.disconnect(),T=null)})},{rootMargin:e.rootMargin}),T.observe(p.value)}};return(0,t.onMounted)(()=>{e.lazy&&E()}),(0,t.watch)(()=>e.src,t=>{d.value=`loading`,f.value=e.lazy?``:t,e.lazy&&E()}),(0,t.onBeforeUnmount)(()=>{T?.disconnect()}),()=>(0,t.createVNode)(`div`,{ref:p,class:[a.b(),e.classNames?.root],style:[g.value,e.styles?.root]},[d.value===`loading`&&(0,t.createVNode)(`div`,{class:a.e(`placeholder`)},[r.placeholder?r.placeholder():(0,t.createVNode)(`span`,{class:a.e(`loading`)},[c.value])]),d.value===`error`&&(0,t.createVNode)(`div`,{class:a.e(`error`)},[r.error?r.error():e.fallback?(0,t.createVNode)(`img`,{class:[a.e(`inner`),e.classNames?.image],style:e.styles?.image,src:e.fallback,alt:e.alt},null):(0,t.createVNode)(`span`,null,[u.value])]),f.value&&(0,t.withDirectives)((0,t.createVNode)(`img`,{class:[a.e(`inner`),e.preview&&a.em(`inner`,`preview`),e.classNames?.image],style:[_.value,e.styles?.image],src:f.value,alt:e.alt,onLoad:v,onError:y,onClick:b},null),[[t.vShow,d.value!==`error`]]),e.preview&&(0,t.createVNode)(t.Teleport,{to:`body`},{default:()=>[(0,t.createVNode)(t.Transition,{name:`${a.b()}-preview-fade`},{default:()=>[m.value&&(0,t.createVNode)(`div`,{class:[a.e(`preview-mask`),e.classNames?.previewMask],style:e.styles?.previewMask,onClick:x},[(0,t.createVNode)(`div`,{class:a.e(`preview-toolbar`),onClick:e=>e.stopPropagation()},[(0,t.createVNode)(`button`,{onClick:C,"aria-label":`zoom out`},[(0,t.createTextVNode)(`−`)]),(0,t.createVNode)(`button`,{onClick:w,"aria-label":`reset`},[(0,t.createTextVNode)(`⟳`)]),(0,t.createVNode)(`button`,{onClick:S,"aria-label":`zoom in`},[(0,t.createTextVNode)(`+`)]),(0,t.createVNode)(`button`,{onClick:x,"aria-label":`close`},[(0,t.createTextVNode)(`×`)])]),(0,t.createVNode)(`img`,{class:a.e(`preview-img`),src:e.src,alt:e.alt,style:{transform:`scale(${h.value})`},onClick:e=>e.stopPropagation()},null)])]})]})])}});u.install=function(e){e.component(u.name,u)},e.Image=u,e.default={title:`Image 图片`,category:`数据展示`,status:`100%`,install(e){e.component(u.name,u)}}});
|
package/input/index.es.js
CHANGED
|
@@ -998,9 +998,15 @@ var nt = {
|
|
|
998
998
|
],
|
|
999
999
|
emits: ["load"]
|
|
1000
1000
|
}), it = Symbol("ccuiFormItem"), at = /* @__PURE__ */ new Set();
|
|
1001
|
+
function ot() {
|
|
1002
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
1003
|
+
}
|
|
1001
1004
|
function X(e, t, n) {
|
|
1002
|
-
|
|
1003
|
-
|
|
1005
|
+
if (!ot()) return;
|
|
1006
|
+
let r = n ? `${n}.${e}` : e;
|
|
1007
|
+
if (at.has(r) || (at.add(r), typeof console > "u")) return;
|
|
1008
|
+
let i = n ? `[ccui][${n}]` : "[ccui]", a = t ? `,请改用 ${t}` : "";
|
|
1009
|
+
console.warn(`${i} ${e} 已 deprecated${a}。`);
|
|
1004
1010
|
}
|
|
1005
1011
|
function Z(e, t, n) {
|
|
1006
1012
|
return e ? Object.prototype.hasOwnProperty.call(e, t) || Object.prototype.hasOwnProperty.call(e, n) : !1;
|
|
@@ -1011,7 +1017,7 @@ function Q(e, t, n) {
|
|
|
1011
1017
|
let r = e;
|
|
1012
1018
|
return t && (r += `__${t}`), n && (r += `--${n}`), r;
|
|
1013
1019
|
}
|
|
1014
|
-
function
|
|
1020
|
+
function st(e, t = !1) {
|
|
1015
1021
|
let n = t ? `.ccui-${e}` : `ccui-${e}`;
|
|
1016
1022
|
return {
|
|
1017
1023
|
b: () => Q(n),
|
|
@@ -1023,7 +1029,7 @@ function ot(e, t = !1) {
|
|
|
1023
1029
|
}
|
|
1024
1030
|
//#endregion
|
|
1025
1031
|
//#region ../ccui/ui/input/src/input-types.ts
|
|
1026
|
-
var
|
|
1032
|
+
var ct = {
|
|
1027
1033
|
type: {
|
|
1028
1034
|
type: String,
|
|
1029
1035
|
default: "text"
|
|
@@ -1107,18 +1113,18 @@ var st = {
|
|
|
1107
1113
|
};
|
|
1108
1114
|
//#endregion
|
|
1109
1115
|
//#region ../ccui/ui/input/src/input.tsx
|
|
1110
|
-
function
|
|
1116
|
+
function lt(e) {
|
|
1111
1117
|
return e.includes(":");
|
|
1112
1118
|
}
|
|
1113
|
-
function
|
|
1119
|
+
function ut(e) {
|
|
1114
1120
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1115
1121
|
}
|
|
1116
|
-
function
|
|
1122
|
+
function dt(e) {
|
|
1117
1123
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1118
1124
|
}
|
|
1119
1125
|
var $ = /* @__PURE__ */ r({
|
|
1120
1126
|
name: "CInput",
|
|
1121
|
-
props:
|
|
1127
|
+
props: ct,
|
|
1122
1128
|
emits: [
|
|
1123
1129
|
"update:modelValue",
|
|
1124
1130
|
"input",
|
|
@@ -1129,20 +1135,20 @@ var $ = /* @__PURE__ */ r({
|
|
|
1129
1135
|
"press-enter"
|
|
1130
1136
|
],
|
|
1131
1137
|
setup(r, { emit: a, slots: c }) {
|
|
1132
|
-
let l =
|
|
1133
|
-
Z(g, "clearable", "clearable") && X("
|
|
1138
|
+
let l = st("input"), u = d(null), f = o(it, null), m = t(() => f?.validateStatus.value ?? ""), h = t(() => r.status || m.value), g = i()?.vnode.props;
|
|
1139
|
+
Z(g, "clearable", "clearable") && X("clearable", "allowClear", "Input"), Z(g, "prepend", "prepend") && X("prepend", "addonBefore", "Input"), Z(g, "append", "append") && X("append", "addonAfter", "Input");
|
|
1134
1140
|
let _ = d(r.modelValue === "" ? r.defaultValue ?? "" : r.modelValue), v = d(!1), y = d(!1), b = t(() => r.type === "password" && r.showPassword), x = t(() => r.type === "password" && b.value && y.value ? "text" : r.type), S = t(() => r.allowClear === void 0 ? r.clearable : r.allowClear), C = t(() => {
|
|
1135
1141
|
let e = S.value;
|
|
1136
1142
|
return typeof e == "boolean" ? e : e != null;
|
|
1137
1143
|
}), ee = t(() => {
|
|
1138
1144
|
let e = S.value;
|
|
1139
|
-
return
|
|
1145
|
+
return ut(e) ? e.clearIcon : void 0;
|
|
1140
1146
|
}), w = t(() => r.addonBefore || r.prepend), T = t(() => r.addonAfter || r.append), E = t(() => !!w.value || !!c["addon-before"] || !!c.prepend), D = t(() => !!T.value || !!c["addon-after"] || !!c.append), O = t(() => {
|
|
1141
1147
|
let e = r.showCount;
|
|
1142
1148
|
return typeof e == "boolean" ? e : e != null;
|
|
1143
1149
|
}), k = t(() => {
|
|
1144
1150
|
let e = r.showCount;
|
|
1145
|
-
return
|
|
1151
|
+
return dt(e) ? e.formatter : void 0;
|
|
1146
1152
|
}), A = t(() => {
|
|
1147
1153
|
if (!O.value) return "";
|
|
1148
1154
|
let e = _.value ?? "", t = e.length, n = r.maxLength;
|
|
@@ -1199,7 +1205,7 @@ var $ = /* @__PURE__ */ r({
|
|
|
1199
1205
|
});
|
|
1200
1206
|
let R = () => {
|
|
1201
1207
|
let e = ee.value;
|
|
1202
|
-
return e ? typeof e == "string" ?
|
|
1208
|
+
return e ? typeof e == "string" ? lt(e) ? n("span", {
|
|
1203
1209
|
class: l.e("clear"),
|
|
1204
1210
|
onClick: L
|
|
1205
1211
|
}, [n(rt, { icon: e }, null)]) : n("i", {
|
|
@@ -1240,6 +1246,9 @@ var $ = /* @__PURE__ */ r({
|
|
|
1240
1246
|
readonly: r.readonly,
|
|
1241
1247
|
maxlength: r.maxLength,
|
|
1242
1248
|
value: _.value,
|
|
1249
|
+
"aria-invalid": h.value === "error" ? !0 : void 0,
|
|
1250
|
+
"aria-disabled": r.disabled ? !0 : void 0,
|
|
1251
|
+
"aria-readonly": r.readonly ? !0 : void 0,
|
|
1243
1252
|
onInput: te,
|
|
1244
1253
|
onChange: ne,
|
|
1245
1254
|
onFocus: re,
|
|
@@ -1281,7 +1290,7 @@ var $ = /* @__PURE__ */ r({
|
|
|
1281
1290
|
$.install = function(e) {
|
|
1282
1291
|
e.component($.name, $);
|
|
1283
1292
|
};
|
|
1284
|
-
var
|
|
1293
|
+
var ft = {
|
|
1285
1294
|
title: "Input 输入框",
|
|
1286
1295
|
category: "数据录入",
|
|
1287
1296
|
status: "100%",
|
|
@@ -1290,4 +1299,4 @@ var dt = {
|
|
|
1290
1299
|
}
|
|
1291
1300
|
};
|
|
1292
1301
|
//#endregion
|
|
1293
|
-
export { $ as Input,
|
|
1302
|
+
export { $ as Input, ft as default };
|