@witlink/usercenter 1.0.37 → 1.0.39

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.
@@ -0,0 +1,1073 @@
1
+ import { L as nt, N as R, O as at, P as j, Q as A, R as rt, T as Ae, U as v, V as F, W as ee, X as ye, Y as le, Z as lt, $ as it, a0 as ot, a1 as Te, a2 as He, a3 as Ue, a4 as Ge, a5 as st, a6 as ut, a7 as dt, a8 as ct, a9 as ft, aa as pt, ab as mt, ac as gt, ad as vt, ae as ht, af as bt, ag as be, ah as St, ai as $t, aj as Ve, ak as Be, al as Nt, am as Se } from "./index.5b29a0a3.mjs";
2
+ import { createVNode as h, defineComponent as Ie, ref as Le, onBeforeUnmount as qe, shallowRef as _, computed as W, watch as te } from "vue";
3
+ var yt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" } }] }, name: "up", theme: "outlined" };
4
+ const wt = yt;
5
+ function Fe(e) {
6
+ for (var t = 1; t < arguments.length; t++) {
7
+ var n = arguments[t] != null ? Object(arguments[t]) : {}, a = Object.keys(n);
8
+ typeof Object.getOwnPropertySymbols == "function" && (a = a.concat(Object.getOwnPropertySymbols(n).filter(function(l) {
9
+ return Object.getOwnPropertyDescriptor(n, l).enumerable;
10
+ }))), a.forEach(function(l) {
11
+ xt(e, l, n[l]);
12
+ });
13
+ }
14
+ return e;
15
+ }
16
+ function xt(e, t, n) {
17
+ return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
18
+ }
19
+ var Ee = function(t, n) {
20
+ var a = Fe({}, t, n.attrs);
21
+ return h(nt, Fe({}, a, {
22
+ icon: wt
23
+ }), null);
24
+ };
25
+ Ee.displayName = "UpOutlined";
26
+ Ee.inheritAttrs = !1;
27
+ const It = Ee;
28
+ function we() {
29
+ return typeof BigInt == "function";
30
+ }
31
+ function ne(e) {
32
+ let t = e.trim(), n = t.startsWith("-");
33
+ n && (t = t.slice(1)), t = t.replace(/(\.\d*[^0])0*$/, "$1").replace(/\.0*$/, "").replace(/^0+/, ""), t.startsWith(".") && (t = `0${t}`);
34
+ const a = t || "0", l = a.split("."), o = l[0] || "0", d = l[1] || "0";
35
+ o === "0" && d === "0" && (n = !1);
36
+ const c = n ? "-" : "";
37
+ return {
38
+ negative: n,
39
+ negativeStr: c,
40
+ trimStr: a,
41
+ integerStr: o,
42
+ decimalStr: d,
43
+ fullStr: `${c}${a}`
44
+ };
45
+ }
46
+ function Ce(e) {
47
+ const t = String(e);
48
+ return !Number.isNaN(Number(t)) && t.includes("e");
49
+ }
50
+ function ae(e) {
51
+ const t = String(e);
52
+ if (Ce(e)) {
53
+ let n = Number(t.slice(t.indexOf("e-") + 2));
54
+ const a = t.match(/\.(\d+)/);
55
+ return a != null && a[1] && (n += a[1].length), n;
56
+ }
57
+ return t.includes(".") && Pe(t) ? t.length - t.indexOf(".") - 1 : 0;
58
+ }
59
+ function Oe(e) {
60
+ let t = String(e);
61
+ if (Ce(e)) {
62
+ if (e > Number.MAX_SAFE_INTEGER)
63
+ return String(we() ? BigInt(e).toString() : Number.MAX_SAFE_INTEGER);
64
+ if (e < Number.MIN_SAFE_INTEGER)
65
+ return String(we() ? BigInt(e).toString() : Number.MIN_SAFE_INTEGER);
66
+ t = e.toFixed(ae(t));
67
+ }
68
+ return ne(t).fullStr;
69
+ }
70
+ function Pe(e) {
71
+ return typeof e == "number" ? !Number.isNaN(e) : e ? /^\s*-?\d+(\.\d+)?\s*$/.test(e) || /^\s*-?\d+\.\s*$/.test(e) || /^\s*-?\.\d+\s*$/.test(e) : !1;
72
+ }
73
+ function ke(e) {
74
+ return !e && e !== 0 && !Number.isNaN(e) || !String(e).trim();
75
+ }
76
+ class z {
77
+ constructor(t) {
78
+ if (this.origin = "", ke(t)) {
79
+ this.empty = !0;
80
+ return;
81
+ }
82
+ this.origin = String(t), this.number = Number(t);
83
+ }
84
+ negate() {
85
+ return new z(-this.toNumber());
86
+ }
87
+ add(t) {
88
+ if (this.isInvalidate())
89
+ return new z(t);
90
+ const n = Number(t);
91
+ if (Number.isNaN(n))
92
+ return this;
93
+ const a = this.number + n;
94
+ if (a > Number.MAX_SAFE_INTEGER)
95
+ return new z(Number.MAX_SAFE_INTEGER);
96
+ if (a < Number.MIN_SAFE_INTEGER)
97
+ return new z(Number.MIN_SAFE_INTEGER);
98
+ const l = Math.max(ae(this.number), ae(n));
99
+ return new z(a.toFixed(l));
100
+ }
101
+ isEmpty() {
102
+ return this.empty;
103
+ }
104
+ isNaN() {
105
+ return Number.isNaN(this.number);
106
+ }
107
+ isInvalidate() {
108
+ return this.isEmpty() || this.isNaN();
109
+ }
110
+ equals(t) {
111
+ return this.toNumber() === (t == null ? void 0 : t.toNumber());
112
+ }
113
+ lessEquals(t) {
114
+ return this.add(t.negate().toString()).toNumber() <= 0;
115
+ }
116
+ toNumber() {
117
+ return this.number;
118
+ }
119
+ toString() {
120
+ return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0) ? this.isInvalidate() ? "" : Oe(this.number) : this.origin;
121
+ }
122
+ }
123
+ class q {
124
+ constructor(t) {
125
+ if (this.origin = "", ke(t)) {
126
+ this.empty = !0;
127
+ return;
128
+ }
129
+ if (this.origin = String(t), t === "-" || Number.isNaN(t)) {
130
+ this.nan = !0;
131
+ return;
132
+ }
133
+ let n = t;
134
+ if (Ce(n) && (n = Number(n)), n = typeof n == "string" ? n : Oe(n), Pe(n)) {
135
+ const a = ne(n);
136
+ this.negative = a.negative;
137
+ const l = a.trimStr.split(".");
138
+ this.integer = BigInt(l[0]);
139
+ const o = l[1] || "0";
140
+ this.decimal = BigInt(o), this.decimalLen = o.length;
141
+ } else
142
+ this.nan = !0;
143
+ }
144
+ getMark() {
145
+ return this.negative ? "-" : "";
146
+ }
147
+ getIntegerStr() {
148
+ return this.integer.toString();
149
+ }
150
+ getDecimalStr() {
151
+ return this.decimal.toString().padStart(this.decimalLen, "0");
152
+ }
153
+ alignDecimal(t) {
154
+ const n = `${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(t, "0")}`;
155
+ return BigInt(n);
156
+ }
157
+ negate() {
158
+ const t = new q(this.toString());
159
+ return t.negative = !t.negative, t;
160
+ }
161
+ add(t) {
162
+ if (this.isInvalidate())
163
+ return new q(t);
164
+ const n = new q(t);
165
+ if (n.isInvalidate())
166
+ return this;
167
+ const a = Math.max(this.getDecimalStr().length, n.getDecimalStr().length), l = this.alignDecimal(a), o = n.alignDecimal(a), d = (l + o).toString(), {
168
+ negativeStr: c,
169
+ trimStr: m
170
+ } = ne(d), f = `${c}${m.padStart(a + 1, "0")}`;
171
+ return new q(`${f.slice(0, -a)}.${f.slice(-a)}`);
172
+ }
173
+ isEmpty() {
174
+ return this.empty;
175
+ }
176
+ isNaN() {
177
+ return this.nan;
178
+ }
179
+ isInvalidate() {
180
+ return this.isEmpty() || this.isNaN();
181
+ }
182
+ equals(t) {
183
+ return this.toString() === (t == null ? void 0 : t.toString());
184
+ }
185
+ lessEquals(t) {
186
+ return this.add(t.negate().toString()).toNumber() <= 0;
187
+ }
188
+ toNumber() {
189
+ return this.isNaN() ? NaN : Number(this.toString());
190
+ }
191
+ toString() {
192
+ return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0) ? this.isInvalidate() ? "" : ne(`${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`).fullStr : this.origin;
193
+ }
194
+ }
195
+ function P(e) {
196
+ return we() ? new q(e) : new z(e);
197
+ }
198
+ function xe(e, t, n) {
199
+ let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
200
+ if (e === "")
201
+ return "";
202
+ const {
203
+ negativeStr: l,
204
+ integerStr: o,
205
+ decimalStr: d
206
+ } = ne(e), c = `${t}${d}`, m = `${l}${o}`;
207
+ if (n >= 0) {
208
+ const f = Number(d[n]);
209
+ if (f >= 5 && !a) {
210
+ const s = P(e).add(`${l}0.${"0".repeat(n)}${10 - f}`);
211
+ return xe(s.toString(), t, n, a);
212
+ }
213
+ return n === 0 ? m : `${m}${t}${d.padEnd(n, "0").slice(0, n)}`;
214
+ }
215
+ return c === ".0" ? m : `${m}${c}`;
216
+ }
217
+ const Et = 200, Ct = 600, Ot = Ie({
218
+ compatConfig: {
219
+ MODE: 3
220
+ },
221
+ name: "StepHandler",
222
+ inheritAttrs: !1,
223
+ props: {
224
+ prefixCls: String,
225
+ upDisabled: Boolean,
226
+ downDisabled: Boolean,
227
+ onStep: R()
228
+ },
229
+ slots: Object,
230
+ setup(e, t) {
231
+ let {
232
+ slots: n,
233
+ emit: a
234
+ } = t;
235
+ const l = Le(), o = (c, m) => {
236
+ c.preventDefault(), a("step", m);
237
+ function f() {
238
+ a("step", m), l.value = setTimeout(f, Et);
239
+ }
240
+ l.value = setTimeout(f, Ct);
241
+ }, d = () => {
242
+ clearTimeout(l.value);
243
+ };
244
+ return qe(() => {
245
+ d();
246
+ }), () => {
247
+ if (at())
248
+ return null;
249
+ const {
250
+ prefixCls: c,
251
+ upDisabled: m,
252
+ downDisabled: f
253
+ } = e, s = `${c}-handler`, w = j(s, `${s}-up`, {
254
+ [`${s}-up-disabled`]: m
255
+ }), S = j(s, `${s}-down`, {
256
+ [`${s}-down-disabled`]: f
257
+ }), I = {
258
+ unselectable: "on",
259
+ role: "button",
260
+ onMouseup: d,
261
+ onMouseleave: d
262
+ }, {
263
+ upNode: $,
264
+ downNode: E
265
+ } = n;
266
+ return h("div", {
267
+ class: `${s}-wrap`
268
+ }, [h("span", A(A({}, I), {}, {
269
+ onMousedown: (D) => {
270
+ o(D, !0);
271
+ },
272
+ "aria-label": "Increase Value",
273
+ "aria-disabled": m,
274
+ class: w
275
+ }), [($ == null ? void 0 : $()) || h("span", {
276
+ unselectable: "on",
277
+ class: `${c}-handler-up-inner`
278
+ }, null)]), h("span", A(A({}, I), {}, {
279
+ onMousedown: (D) => {
280
+ o(D, !1);
281
+ },
282
+ "aria-label": "Decrease Value",
283
+ "aria-disabled": f,
284
+ class: S
285
+ }), [(E == null ? void 0 : E()) || h("span", {
286
+ unselectable: "on",
287
+ class: `${c}-handler-down-inner`
288
+ }, null)])]);
289
+ };
290
+ }
291
+ });
292
+ function Pt(e, t) {
293
+ const n = Le(null);
294
+ function a() {
295
+ try {
296
+ const {
297
+ selectionStart: o,
298
+ selectionEnd: d,
299
+ value: c
300
+ } = e.value, m = c.substring(0, o), f = c.substring(d);
301
+ n.value = {
302
+ start: o,
303
+ end: d,
304
+ value: c,
305
+ beforeTxt: m,
306
+ afterTxt: f
307
+ };
308
+ } catch {
309
+ }
310
+ }
311
+ function l() {
312
+ if (e.value && n.value && t.value)
313
+ try {
314
+ const {
315
+ value: o
316
+ } = e.value, {
317
+ beforeTxt: d,
318
+ afterTxt: c,
319
+ start: m
320
+ } = n.value;
321
+ let f = o.length;
322
+ if (o.endsWith(c))
323
+ f = o.length - n.value.afterTxt.length;
324
+ else if (o.startsWith(d))
325
+ f = d.length;
326
+ else {
327
+ const s = d[m - 1], w = o.indexOf(s, m - 1);
328
+ w !== -1 && (f = w + 1);
329
+ }
330
+ e.value.setSelectionRange(f, f);
331
+ } catch (o) {
332
+ rt(!1, `Something warning of cursor restore. Please fire issue about this: ${o.message}`);
333
+ }
334
+ }
335
+ return [a, l];
336
+ }
337
+ const _t = () => {
338
+ const e = _(0), t = () => {
339
+ Ae.cancel(e.value);
340
+ };
341
+ return qe(() => {
342
+ t();
343
+ }), (n) => {
344
+ t(), e.value = Ae(() => {
345
+ n();
346
+ });
347
+ };
348
+ };
349
+ var Dt = globalThis && globalThis.__rest || function(e, t) {
350
+ var n = {};
351
+ for (var a in e)
352
+ Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
353
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
354
+ for (var l = 0, a = Object.getOwnPropertySymbols(e); l < a.length; l++)
355
+ t.indexOf(a[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[l]) && (n[a[l]] = e[a[l]]);
356
+ return n;
357
+ };
358
+ const ze = (e, t) => e || t.isEmpty() ? t.toString() : t.toNumber(), je = (e) => {
359
+ const t = P(e);
360
+ return t.isInvalidate() ? null : t;
361
+ }, Xe = () => ({
362
+ stringMode: F(),
363
+ defaultValue: ee([String, Number]),
364
+ value: ee([String, Number]),
365
+ prefixCls: ye(),
366
+ min: ee([String, Number]),
367
+ max: ee([String, Number]),
368
+ step: ee([String, Number], 1),
369
+ tabindex: Number,
370
+ controls: F(!0),
371
+ readonly: F(),
372
+ disabled: F(),
373
+ autofocus: F(),
374
+ keyboard: F(!0),
375
+ parser: R(),
376
+ formatter: R(),
377
+ precision: Number,
378
+ decimalSeparator: String,
379
+ onInput: R(),
380
+ onChange: R(),
381
+ onPressEnter: R(),
382
+ onStep: R(),
383
+ onBlur: R(),
384
+ onFocus: R()
385
+ }), Mt = Ie({
386
+ compatConfig: {
387
+ MODE: 3
388
+ },
389
+ name: "InnerInputNumber",
390
+ inheritAttrs: !1,
391
+ props: v(v({}, Xe()), {
392
+ lazy: Boolean
393
+ }),
394
+ slots: Object,
395
+ setup(e, t) {
396
+ let {
397
+ attrs: n,
398
+ slots: a,
399
+ emit: l,
400
+ expose: o
401
+ } = t;
402
+ const d = _(), c = _(!1), m = _(!1), f = _(!1), s = _(P(e.value));
403
+ function w(r) {
404
+ e.value === void 0 && (s.value = r);
405
+ }
406
+ const S = (r, i) => {
407
+ if (!i)
408
+ return e.precision >= 0 ? e.precision : Math.max(ae(r), ae(e.step));
409
+ }, I = (r) => {
410
+ const i = String(r);
411
+ if (e.parser)
412
+ return e.parser(i);
413
+ let u = i;
414
+ return e.decimalSeparator && (u = u.replace(e.decimalSeparator, ".")), u.replace(/[^\w.-]+/g, "");
415
+ }, $ = _(""), E = (r, i) => {
416
+ if (e.formatter)
417
+ return e.formatter(r, {
418
+ userTyping: i,
419
+ input: String($.value)
420
+ });
421
+ let u = typeof r == "number" ? Oe(r) : r;
422
+ if (!i) {
423
+ const g = S(u, i);
424
+ if (Pe(u) && (e.decimalSeparator || g >= 0)) {
425
+ const y = e.decimalSeparator || ".";
426
+ u = xe(u, y, g);
427
+ }
428
+ }
429
+ return u;
430
+ }, D = (() => {
431
+ const r = e.value;
432
+ return s.value.isInvalidate() && ["string", "number"].includes(typeof r) ? Number.isNaN(r) ? "" : r : E(s.value.toString(), !1);
433
+ })();
434
+ $.value = D;
435
+ function C(r, i) {
436
+ $.value = E(
437
+ r.isInvalidate() ? r.toString(!1) : r.toString(!i),
438
+ i
439
+ );
440
+ }
441
+ const O = W(() => je(e.max)), N = W(() => je(e.min)), x = W(() => !O.value || !s.value || s.value.isInvalidate() ? !1 : O.value.lessEquals(s.value)), T = W(() => !N.value || !s.value || s.value.isInvalidate() ? !1 : s.value.lessEquals(N.value)), [k, X] = Pt(d, c), K = (r) => O.value && !r.lessEquals(O.value) ? O.value : N.value && !N.value.lessEquals(r) ? N.value : null, ie = (r) => !K(r), Y = (r, i) => {
442
+ var u;
443
+ let g = r, y = ie(g) || g.isEmpty();
444
+ if (!g.isEmpty() && !i && (g = K(g) || g, y = !0), !e.readonly && !e.disabled && y) {
445
+ const M = g.toString(), B = S(M, i);
446
+ return B >= 0 && (g = P(xe(M, ".", B))), g.equals(s.value) || (w(g), (u = e.onChange) === null || u === void 0 || u.call(e, g.isEmpty() ? null : ze(e.stringMode, g)), e.value === void 0 && C(g, i)), g;
447
+ }
448
+ return s.value;
449
+ }, oe = _t(), Q = (r) => {
450
+ var i;
451
+ if (k(), $.value = r, !f.value) {
452
+ const u = I(r), g = P(u);
453
+ g.isNaN() || Y(g, !0);
454
+ }
455
+ (i = e.onInput) === null || i === void 0 || i.call(e, r), oe(() => {
456
+ let u = r;
457
+ e.parser || (u = r.replace(/。/g, ".")), u !== r && Q(u);
458
+ });
459
+ }, b = () => {
460
+ f.value = !0;
461
+ }, Z = () => {
462
+ f.value = !1, Q(d.value.value);
463
+ }, H = (r) => {
464
+ Q(r.target.value);
465
+ }, U = (r) => {
466
+ var i, u;
467
+ if (r && x.value || !r && T.value)
468
+ return;
469
+ m.value = !1;
470
+ let g = P(e.step);
471
+ r || (g = g.negate());
472
+ const y = (s.value || P(0)).add(g.toString()), M = Y(y, !1);
473
+ (i = e.onStep) === null || i === void 0 || i.call(e, ze(e.stringMode, M), {
474
+ offset: e.step,
475
+ type: r ? "up" : "down"
476
+ }), (u = d.value) === null || u === void 0 || u.focus();
477
+ }, V = (r) => {
478
+ const i = P(I($.value));
479
+ let u = i;
480
+ i.isNaN() ? u = s.value : u = Y(i, r), e.value !== void 0 ? C(s.value, !1) : u.isNaN() || C(u, !1);
481
+ }, se = (r) => {
482
+ var i;
483
+ const {
484
+ which: u
485
+ } = r;
486
+ m.value = !0, u === le.ENTER && (f.value || (m.value = !1), V(!1), (i = e.onPressEnter) === null || i === void 0 || i.call(e, r)), e.keyboard !== !1 && !f.value && [le.UP, le.DOWN].includes(u) && (U(le.UP === u), r.preventDefault());
487
+ }, ue = () => {
488
+ m.value = !1;
489
+ }, de = (r) => {
490
+ V(!1), c.value = !1, m.value = !1, l("blur", r);
491
+ };
492
+ return te(() => e.precision, () => {
493
+ s.value.isInvalidate() || C(s.value, !1);
494
+ }, {
495
+ flush: "post"
496
+ }), te(() => e.value, () => {
497
+ const r = P(e.value);
498
+ s.value = r;
499
+ const i = P(I($.value));
500
+ (!r.equals(i) || !m.value || e.formatter) && C(r, m.value);
501
+ }, {
502
+ flush: "post"
503
+ }), te($, () => {
504
+ e.formatter && X();
505
+ }, {
506
+ flush: "post"
507
+ }), te(() => e.disabled, (r) => {
508
+ r && (c.value = !1);
509
+ }), o({
510
+ focus: () => {
511
+ var r;
512
+ (r = d.value) === null || r === void 0 || r.focus();
513
+ },
514
+ blur: () => {
515
+ var r;
516
+ (r = d.value) === null || r === void 0 || r.blur();
517
+ }
518
+ }), () => {
519
+ const r = v(v({}, n), e), {
520
+ prefixCls: i = "rc-input-number",
521
+ min: u,
522
+ max: g,
523
+ step: y = 1,
524
+ defaultValue: M,
525
+ value: B,
526
+ disabled: J,
527
+ readonly: re,
528
+ keyboard: _e,
529
+ controls: p = !0,
530
+ autofocus: ce,
531
+ stringMode: G,
532
+ parser: fe,
533
+ formatter: pe,
534
+ precision: L,
535
+ decimalSeparator: me,
536
+ onChange: ge,
537
+ onInput: ve,
538
+ onPressEnter: De,
539
+ onStep: Me,
540
+ lazy: Ke,
541
+ class: Ye,
542
+ style: Qe
543
+ } = r, Ze = Dt(r, ["prefixCls", "min", "max", "step", "defaultValue", "value", "disabled", "readonly", "keyboard", "controls", "autofocus", "stringMode", "parser", "formatter", "precision", "decimalSeparator", "onChange", "onInput", "onPressEnter", "onStep", "lazy", "class", "style"]), {
544
+ upHandler: Je,
545
+ downHandler: et
546
+ } = a, Re = `${i}-input`, he = {};
547
+ return Ke ? he.onChange = H : he.onInput = H, h("div", {
548
+ class: j(i, Ye, {
549
+ [`${i}-focused`]: c.value,
550
+ [`${i}-disabled`]: J,
551
+ [`${i}-readonly`]: re,
552
+ [`${i}-not-a-number`]: s.value.isNaN(),
553
+ [`${i}-out-of-range`]: !s.value.isInvalidate() && !ie(s.value)
554
+ }),
555
+ style: Qe,
556
+ onKeydown: se,
557
+ onKeyup: ue
558
+ }, [p && h(Ot, {
559
+ prefixCls: i,
560
+ upDisabled: x.value,
561
+ downDisabled: T.value,
562
+ onStep: U
563
+ }, {
564
+ upNode: Je,
565
+ downNode: et
566
+ }), h("div", {
567
+ class: `${Re}-wrap`
568
+ }, [h("input", A(A(A({
569
+ autofocus: ce,
570
+ autocomplete: "off",
571
+ role: "spinbutton",
572
+ "aria-valuemin": u,
573
+ "aria-valuemax": g,
574
+ "aria-valuenow": s.value.isInvalidate() ? null : s.value.toString(),
575
+ step: y
576
+ }, Ze), {}, {
577
+ ref: d,
578
+ class: Re,
579
+ value: $.value,
580
+ disabled: J,
581
+ readonly: re,
582
+ onFocus: (tt) => {
583
+ c.value = !0, l("focus", tt);
584
+ }
585
+ }, he), {}, {
586
+ onBlur: de,
587
+ onCompositionstart: b,
588
+ onCompositionend: Z
589
+ }), null)])]);
590
+ };
591
+ }
592
+ });
593
+ function $e(e) {
594
+ return e != null;
595
+ }
596
+ const Rt = (e) => {
597
+ const {
598
+ componentCls: t,
599
+ lineWidth: n,
600
+ lineType: a,
601
+ colorBorder: l,
602
+ borderRadius: o,
603
+ fontSizeLG: d,
604
+ controlHeightLG: c,
605
+ controlHeightSM: m,
606
+ colorError: f,
607
+ inputPaddingHorizontalSM: s,
608
+ colorTextDescription: w,
609
+ motionDurationMid: S,
610
+ colorPrimary: I,
611
+ controlHeight: $,
612
+ inputPaddingHorizontal: E,
613
+ colorBgContainer: D,
614
+ colorTextDisabled: C,
615
+ borderRadiusSM: O,
616
+ borderRadiusLG: N,
617
+ controlWidth: x,
618
+ handleVisible: T
619
+ } = e;
620
+ return [
621
+ {
622
+ [t]: v(v(v(v({}, Te(e)), He(e)), Ue(e, t)), {
623
+ display: "inline-block",
624
+ width: x,
625
+ margin: 0,
626
+ padding: 0,
627
+ border: `${n}px ${a} ${l}`,
628
+ borderRadius: o,
629
+ "&-rtl": {
630
+ direction: "rtl",
631
+ [`${t}-input`]: {
632
+ direction: "rtl"
633
+ }
634
+ },
635
+ "&-lg": {
636
+ padding: 0,
637
+ fontSize: d,
638
+ borderRadius: N,
639
+ [`input${t}-input`]: {
640
+ height: c - 2 * n
641
+ }
642
+ },
643
+ "&-sm": {
644
+ padding: 0,
645
+ borderRadius: O,
646
+ [`input${t}-input`]: {
647
+ height: m - 2 * n,
648
+ padding: `0 ${s}px`
649
+ }
650
+ },
651
+ "&:hover": v({}, Ge(e)),
652
+ "&-focused": v({}, st(e)),
653
+ "&-disabled": v(v({}, ut(e)), {
654
+ [`${t}-input`]: {
655
+ cursor: "not-allowed"
656
+ }
657
+ }),
658
+ "&-out-of-range": {
659
+ input: {
660
+ color: f
661
+ }
662
+ },
663
+ "&-group": v(v(v({}, Te(e)), dt(e)), {
664
+ "&-wrapper": {
665
+ display: "inline-block",
666
+ textAlign: "start",
667
+ verticalAlign: "top",
668
+ [`${t}-affix-wrapper`]: {
669
+ width: "100%"
670
+ },
671
+ "&-lg": {
672
+ [`${t}-group-addon`]: {
673
+ borderRadius: N
674
+ }
675
+ },
676
+ "&-sm": {
677
+ [`${t}-group-addon`]: {
678
+ borderRadius: O
679
+ }
680
+ }
681
+ }
682
+ }),
683
+ [t]: {
684
+ "&-input": v(v({
685
+ width: "100%",
686
+ height: $ - 2 * n,
687
+ padding: `0 ${E}px`,
688
+ textAlign: "start",
689
+ backgroundColor: "transparent",
690
+ border: 0,
691
+ borderRadius: o,
692
+ outline: 0,
693
+ transition: `all ${S} linear`,
694
+ appearance: "textfield",
695
+ color: e.colorText,
696
+ fontSize: "inherit",
697
+ verticalAlign: "top"
698
+ }, ct(e.colorTextPlaceholder)), {
699
+ '&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button': {
700
+ margin: 0,
701
+ webkitAppearance: "none",
702
+ appearance: "none"
703
+ }
704
+ })
705
+ }
706
+ })
707
+ },
708
+ {
709
+ [t]: {
710
+ [`&:hover ${t}-handler-wrap, &-focused ${t}-handler-wrap`]: {
711
+ opacity: 1
712
+ },
713
+ [`${t}-handler-wrap`]: {
714
+ position: "absolute",
715
+ insetBlockStart: 0,
716
+ insetInlineEnd: 0,
717
+ width: e.handleWidth,
718
+ height: "100%",
719
+ background: D,
720
+ borderStartStartRadius: 0,
721
+ borderStartEndRadius: o,
722
+ borderEndEndRadius: o,
723
+ borderEndStartRadius: 0,
724
+ opacity: T === !0 ? 1 : 0,
725
+ display: "flex",
726
+ flexDirection: "column",
727
+ alignItems: "stretch",
728
+ transition: `opacity ${S} linear ${S}`,
729
+ [`${t}-handler`]: {
730
+ display: "flex",
731
+ alignItems: "center",
732
+ justifyContent: "center",
733
+ flex: "auto",
734
+ height: "40%",
735
+ [`
736
+ ${t}-handler-up-inner,
737
+ ${t}-handler-down-inner
738
+ `]: {
739
+ marginInlineEnd: 0,
740
+ fontSize: e.handleFontSize
741
+ }
742
+ }
743
+ },
744
+ [`${t}-handler`]: {
745
+ height: "50%",
746
+ overflow: "hidden",
747
+ color: w,
748
+ fontWeight: "bold",
749
+ lineHeight: 0,
750
+ textAlign: "center",
751
+ cursor: "pointer",
752
+ borderInlineStart: `${n}px ${a} ${l}`,
753
+ transition: `all ${S} linear`,
754
+ "&:active": {
755
+ background: e.colorFillAlter
756
+ },
757
+ "&:hover": {
758
+ height: "60%",
759
+ [`
760
+ ${t}-handler-up-inner,
761
+ ${t}-handler-down-inner
762
+ `]: {
763
+ color: I
764
+ }
765
+ },
766
+ "&-up-inner, &-down-inner": v(v({}, ft()), {
767
+ color: w,
768
+ transition: `all ${S} linear`,
769
+ userSelect: "none"
770
+ })
771
+ },
772
+ [`${t}-handler-up`]: {
773
+ borderStartEndRadius: o
774
+ },
775
+ [`${t}-handler-down`]: {
776
+ borderBlockStart: `${n}px ${a} ${l}`,
777
+ borderEndEndRadius: o
778
+ },
779
+ "&-disabled, &-readonly": {
780
+ [`${t}-handler-wrap`]: {
781
+ display: "none"
782
+ }
783
+ },
784
+ [`
785
+ ${t}-handler-up-disabled,
786
+ ${t}-handler-down-disabled
787
+ `]: {
788
+ cursor: "not-allowed"
789
+ },
790
+ [`
791
+ ${t}-handler-up-disabled:hover &-handler-up-inner,
792
+ ${t}-handler-down-disabled:hover &-handler-down-inner
793
+ `]: {
794
+ color: C
795
+ }
796
+ }
797
+ },
798
+ {
799
+ [`${t}-borderless`]: {
800
+ borderColor: "transparent",
801
+ boxShadow: "none",
802
+ [`${t}-handler-down`]: {
803
+ borderBlockStartWidth: 0
804
+ }
805
+ }
806
+ }
807
+ ];
808
+ }, At = (e) => {
809
+ const {
810
+ componentCls: t,
811
+ inputPaddingHorizontal: n,
812
+ inputAffixPadding: a,
813
+ controlWidth: l,
814
+ borderRadiusLG: o,
815
+ borderRadiusSM: d
816
+ } = e;
817
+ return {
818
+ [`${t}-affix-wrapper`]: v(v(v({}, He(e)), Ue(e, `${t}-affix-wrapper`)), {
819
+ position: "relative",
820
+ display: "inline-flex",
821
+ width: l,
822
+ padding: 0,
823
+ paddingInlineStart: n,
824
+ "&-lg": {
825
+ borderRadius: o
826
+ },
827
+ "&-sm": {
828
+ borderRadius: d
829
+ },
830
+ [`&:not(${t}-affix-wrapper-disabled):hover`]: v(v({}, Ge(e)), {
831
+ zIndex: 1
832
+ }),
833
+ "&-focused, &:focus": {
834
+ zIndex: 1
835
+ },
836
+ "&-disabled": {
837
+ [`${t}[disabled]`]: {
838
+ background: "transparent"
839
+ }
840
+ },
841
+ [`> div${t}`]: {
842
+ width: "100%",
843
+ border: "none",
844
+ outline: "none",
845
+ [`&${t}-focused`]: {
846
+ boxShadow: "none !important"
847
+ }
848
+ },
849
+ [`input${t}-input`]: {
850
+ padding: 0
851
+ },
852
+ "&::before": {
853
+ width: 0,
854
+ visibility: "hidden",
855
+ content: '"\\a0"'
856
+ },
857
+ [`${t}-handler-wrap`]: {
858
+ zIndex: 2
859
+ },
860
+ [t]: {
861
+ "&-prefix, &-suffix": {
862
+ display: "flex",
863
+ flex: "none",
864
+ alignItems: "center",
865
+ pointerEvents: "none"
866
+ },
867
+ "&-prefix": {
868
+ marginInlineEnd: a
869
+ },
870
+ "&-suffix": {
871
+ position: "absolute",
872
+ insetBlockStart: 0,
873
+ insetInlineEnd: 0,
874
+ zIndex: 1,
875
+ height: "100%",
876
+ marginInlineEnd: n,
877
+ marginInlineStart: a
878
+ }
879
+ }
880
+ })
881
+ };
882
+ }, Tt = lt("InputNumber", (e) => {
883
+ const t = it(e);
884
+ return [
885
+ Rt(t),
886
+ At(t),
887
+ ot(t)
888
+ ];
889
+ }, (e) => ({
890
+ controlWidth: 90,
891
+ handleWidth: e.controlHeightSM - e.lineWidth * 2,
892
+ handleFontSize: e.fontSize / 2,
893
+ handleVisible: "auto"
894
+ }));
895
+ var Vt = globalThis && globalThis.__rest || function(e, t) {
896
+ var n = {};
897
+ for (var a in e)
898
+ Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
899
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
900
+ for (var l = 0, a = Object.getOwnPropertySymbols(e); l < a.length; l++)
901
+ t.indexOf(a[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[l]) && (n[a[l]] = e[a[l]]);
902
+ return n;
903
+ };
904
+ const We = Xe(), Bt = () => v(v({}, We), {
905
+ size: ye(),
906
+ bordered: F(!0),
907
+ placeholder: String,
908
+ name: String,
909
+ id: String,
910
+ type: String,
911
+ addonBefore: Se.any,
912
+ addonAfter: Se.any,
913
+ prefix: Se.any,
914
+ "onUpdate:value": We.onChange,
915
+ valueModifiers: Object,
916
+ status: ye()
917
+ }), Ne = Ie({
918
+ compatConfig: {
919
+ MODE: 3
920
+ },
921
+ name: "AInputNumber",
922
+ inheritAttrs: !1,
923
+ props: Bt(),
924
+ slots: Object,
925
+ setup(e, t) {
926
+ let {
927
+ emit: n,
928
+ expose: a,
929
+ attrs: l,
930
+ slots: o
931
+ } = t;
932
+ var d;
933
+ const c = pt(), m = mt.useInject(), f = W(() => gt(m.status, e.status)), {
934
+ prefixCls: s,
935
+ size: w,
936
+ direction: S,
937
+ disabled: I
938
+ } = vt("input-number", e), {
939
+ compactSize: $,
940
+ compactItemClassnames: E
941
+ } = ht(s, S), D = bt(), C = W(() => {
942
+ var b;
943
+ return (b = I.value) !== null && b !== void 0 ? b : D.value;
944
+ }), [O, N] = Tt(s), x = W(() => $.value || w.value), T = _((d = e.value) !== null && d !== void 0 ? d : e.defaultValue), k = _(!1);
945
+ te(() => e.value, () => {
946
+ T.value = e.value;
947
+ });
948
+ const X = _(null), K = () => {
949
+ var b;
950
+ (b = X.value) === null || b === void 0 || b.focus();
951
+ };
952
+ a({
953
+ focus: K,
954
+ blur: () => {
955
+ var b;
956
+ (b = X.value) === null || b === void 0 || b.blur();
957
+ }
958
+ });
959
+ const Y = (b) => {
960
+ e.value === void 0 && (T.value = b), n("update:value", b), n("change", b), c.onFieldChange();
961
+ }, oe = (b) => {
962
+ k.value = !1, n("blur", b), c.onFieldBlur();
963
+ }, Q = (b) => {
964
+ k.value = !0, n("focus", b);
965
+ };
966
+ return () => {
967
+ var b, Z, H, U;
968
+ const {
969
+ hasFeedback: V,
970
+ isFormItemInput: se,
971
+ feedbackIcon: ue
972
+ } = m, de = (b = e.id) !== null && b !== void 0 ? b : c.id.value, r = v(v(v({}, l), e), {
973
+ id: de,
974
+ disabled: C.value
975
+ }), {
976
+ class: i,
977
+ bordered: u,
978
+ readonly: g,
979
+ style: y,
980
+ addonBefore: M = (Z = o.addonBefore) === null || Z === void 0 ? void 0 : Z.call(o),
981
+ addonAfter: B = (H = o.addonAfter) === null || H === void 0 ? void 0 : H.call(o),
982
+ prefix: J = (U = o.prefix) === null || U === void 0 ? void 0 : U.call(o),
983
+ valueModifiers: re = {}
984
+ } = r, _e = Vt(r, ["class", "bordered", "readonly", "style", "addonBefore", "addonAfter", "prefix", "valueModifiers"]), p = s.value, ce = j({
985
+ [`${p}-lg`]: x.value === "large",
986
+ [`${p}-sm`]: x.value === "small",
987
+ [`${p}-rtl`]: S.value === "rtl",
988
+ [`${p}-readonly`]: g,
989
+ [`${p}-borderless`]: !u,
990
+ [`${p}-in-form-item`]: se
991
+ }, be(p, f.value), i, E.value, N.value);
992
+ let G = h(Mt, A(A({}, St(_e, ["size", "defaultValue"])), {}, {
993
+ ref: X,
994
+ lazy: !!re.lazy,
995
+ value: T.value,
996
+ class: ce,
997
+ prefixCls: p,
998
+ readonly: g,
999
+ onChange: Y,
1000
+ onBlur: oe,
1001
+ onFocus: Q
1002
+ }), {
1003
+ upHandler: o.upIcon ? () => h("span", {
1004
+ class: `${p}-handler-up-inner`
1005
+ }, [o.upIcon()]) : () => h(It, {
1006
+ class: `${p}-handler-up-inner`
1007
+ }, null),
1008
+ downHandler: o.downIcon ? () => h("span", {
1009
+ class: `${p}-handler-down-inner`
1010
+ }, [o.downIcon()]) : () => h($t, {
1011
+ class: `${p}-handler-down-inner`
1012
+ }, null)
1013
+ });
1014
+ const fe = $e(M) || $e(B), pe = $e(J);
1015
+ if (pe || V) {
1016
+ const L = j(`${p}-affix-wrapper`, be(`${p}-affix-wrapper`, f.value, V), {
1017
+ [`${p}-affix-wrapper-focused`]: k.value,
1018
+ [`${p}-affix-wrapper-disabled`]: C.value,
1019
+ [`${p}-affix-wrapper-sm`]: x.value === "small",
1020
+ [`${p}-affix-wrapper-lg`]: x.value === "large",
1021
+ [`${p}-affix-wrapper-rtl`]: S.value === "rtl",
1022
+ [`${p}-affix-wrapper-readonly`]: g,
1023
+ [`${p}-affix-wrapper-borderless`]: !u,
1024
+ [`${i}`]: !fe && i
1025
+ }, N.value);
1026
+ G = h("div", {
1027
+ class: L,
1028
+ style: y,
1029
+ onClick: K
1030
+ }, [pe && h("span", {
1031
+ class: `${p}-prefix`
1032
+ }, [J]), G, V && h("span", {
1033
+ class: `${p}-suffix`
1034
+ }, [ue])]);
1035
+ }
1036
+ if (fe) {
1037
+ const L = `${p}-group`, me = `${L}-addon`, ge = M ? h("div", {
1038
+ class: me
1039
+ }, [M]) : null, ve = B ? h("div", {
1040
+ class: me
1041
+ }, [B]) : null, De = j(`${p}-wrapper`, L, {
1042
+ [`${L}-rtl`]: S.value === "rtl"
1043
+ }, N.value), Me = j(`${p}-group-wrapper`, {
1044
+ [`${p}-group-wrapper-sm`]: x.value === "small",
1045
+ [`${p}-group-wrapper-lg`]: x.value === "large",
1046
+ [`${p}-group-wrapper-rtl`]: S.value === "rtl"
1047
+ }, be(`${s}-group-wrapper`, f.value, V), i, N.value);
1048
+ G = h("div", {
1049
+ class: Me,
1050
+ style: y
1051
+ }, [h("div", {
1052
+ class: De
1053
+ }, [ge && h(Ve, null, {
1054
+ default: () => [h(Be, null, {
1055
+ default: () => [ge]
1056
+ })]
1057
+ }), G, ve && h(Ve, null, {
1058
+ default: () => [h(Be, null, {
1059
+ default: () => [ve]
1060
+ })]
1061
+ })])]);
1062
+ }
1063
+ return O(Nt(G, {
1064
+ style: y
1065
+ }));
1066
+ };
1067
+ }
1068
+ }), jt = v(Ne, {
1069
+ install: (e) => (e.component(Ne.name, Ne), e)
1070
+ });
1071
+ export {
1072
+ jt as _
1073
+ };