st-comp 0.0.279 → 0.0.281
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/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +13 -14
- package/es/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +377 -376
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +294 -294
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +19 -19
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +260 -260
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +579 -553
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +17 -17
- package/es/KlinePlus.cjs +2 -2
- package/es/KlinePlus.js +23 -24
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +30 -29
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +517 -425
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +43 -43
- package/es/User.cjs +1 -1
- package/es/User.js +898 -866
- package/es/VarSelectDialog.cjs +3 -3
- package/es/VarSelectDialog.js +110 -109
- package/es/VarietyAiHelper.cjs +7 -7
- package/es/VarietyAiHelper.js +615 -464
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +11 -11
- package/es/VarietySearch.cjs +18 -18
- package/es/VarietySearch.js +3079 -2913
- package/es/{VarietySelect-41daac7b.js → VarietySelect-3fc0f0ce.js} +5 -5
- package/es/{VarietySelect-d58eee29.cjs → VarietySelect-d2d25a3d.cjs} +1 -1
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +51 -51
- package/es/VirtualTable.cjs +13 -1
- package/es/VirtualTable.js +1927 -2259
- package/es/_baseClone-f8e5d3ba.cjs +1 -0
- package/es/_baseClone-fb6a3947.js +210 -0
- package/es/base-d987e5c9.cjs +5 -0
- package/es/base-dd156b8e.js +790 -0
- package/es/{castArray-7741a212.js → castArray-18eb6a41.js} +1 -1
- package/es/{castArray-35947698.cjs → castArray-d9ffe84a.cjs} +1 -1
- package/es/clamp-17c4d8aa.cjs +1 -0
- package/es/clamp-c7512966.js +10 -0
- package/es/config-provider-06d8207f.js +86 -0
- package/es/config-provider-bb61bd3e.cjs +1 -0
- package/es/debounce-0a98a9c6.js +57 -0
- package/es/debounce-37b17615.cjs +1 -0
- package/es/dropdown-8fa21bfd.cjs +1 -0
- package/es/dropdown-bcf8d198.js +178 -0
- package/es/el-autocomplete-13b9e372.cjs +1 -0
- package/es/el-autocomplete-419bfbcf.js +434 -0
- package/es/el-button-ee9fe159.js +343 -0
- package/es/el-button-fac5e058.cjs +1 -0
- package/es/el-checkbox-6cf1a71c.cjs +1 -0
- package/es/el-checkbox-b5ac7f04.js +566 -0
- package/es/el-dialog-060b3735.js +252 -0
- package/es/el-dialog-54aebacd.cjs +1 -0
- package/es/el-divider-3f0320be.cjs +1 -0
- package/es/el-divider-c5d72961.js +51 -0
- package/es/el-empty-552baf04.js +159 -0
- package/es/el-empty-58bc2a10.cjs +1 -0
- package/es/el-form-item-2be6b683.js +1265 -0
- package/es/el-form-item-758dfefa.cjs +12 -0
- package/es/el-input-7fe53030.cjs +1 -0
- package/es/el-input-d23f5442.js +761 -0
- package/es/el-input-number-484fb184.js +390 -0
- package/es/el-input-number-f0f4eedb.cjs +1 -0
- package/es/el-loading-9d3e405c.js +190 -0
- package/es/el-loading-fafaaa7b.cjs +1 -0
- package/es/el-menu-item-0ac22681.js +824 -0
- package/es/el-menu-item-c91ae430.cjs +1 -0
- package/es/el-message-box-568a0aa6.js +481 -0
- package/es/el-message-box-ceacb54e.cjs +1 -0
- package/es/el-overlay-9f36e73c.cjs +1 -0
- package/es/el-overlay-cb5c85aa.js +444 -0
- package/es/el-popconfirm-4a8cd35c.cjs +1 -0
- package/es/el-popconfirm-6f8e65c8.js +190 -0
- package/es/el-popper-0454c8e8.js +2235 -0
- package/es/el-popper-acd0ff35.cjs +1 -0
- package/es/{el-scrollbar-323542e7.js → el-scrollbar-0a42c1d0.js} +4 -9
- package/es/{el-scrollbar-bc3f790d.cjs → el-scrollbar-225c6c9e.cjs} +1 -1
- package/es/el-segmented-64dc7258.js +168 -0
- package/es/el-segmented-eb3c8e65.cjs +1 -0
- package/es/el-select-a573c78b.js +1535 -0
- package/es/el-select-c317294a.cjs +1 -0
- package/es/el-table-column-1c443963.js +3651 -0
- package/es/el-table-column-f555115d.cjs +14 -0
- package/es/el-tag-2d8a3fe7.js +77 -0
- package/es/el-tag-dca1292c.cjs +1 -0
- package/es/el-text-649c986a.cjs +1 -0
- package/es/el-text-761e6717.js +84 -0
- package/es/index-11181b5f.cjs +1 -0
- package/es/index-21a3dc89.cjs +1 -0
- package/es/index-33e039e3.cjs +1 -0
- package/es/index-3806160e.js +710 -0
- package/es/{index-a9246d17.cjs → index-4614e8e9.cjs} +109 -109
- package/es/{index-44a382a5.js → index-53beef02.js} +12 -12
- package/es/index-5cada1ed.cjs +1 -0
- package/es/index-6a36e1fc.cjs +1 -0
- package/es/{index-eb96e074.js → index-6a52dc7c.js} +235 -236
- package/es/index-71ba4c28.cjs +1 -0
- package/es/index-78dab605.js +141 -0
- package/es/index-798fec2d.cjs +1 -0
- package/es/index-9573f74b.js +372 -0
- package/es/index-a181f161.js +429 -0
- package/es/{index-a33b2fb8.js → index-ab0ad219.js} +5090 -5090
- package/es/index-beb5cb7d.cjs +1 -0
- package/es/index-c09fc6f5.js +131 -0
- package/es/index-ceae4c47.cjs +1 -0
- package/es/index-d372e68f.cjs +5 -0
- package/es/index-d9379af4.js +413 -0
- package/es/index-dddacf80.js +47 -0
- package/es/index-de9ad85c.js +12 -0
- package/es/index-e2e58ea9.js +468 -0
- package/es/index-f5474dcc.cjs +3 -0
- package/es/{python-a3db9620.cjs → python-60e79979.cjs} +1 -1
- package/es/{python-8a1664e6.js → python-673bf8b8.js} +32 -31
- package/es/{raf-8249652f.cjs → raf-735cc598.cjs} +1 -1
- package/es/{raf-80ef0c0a.js → raf-b4fd1e12.js} +1 -1
- package/es/scroll-07bade1e.cjs +1 -0
- package/es/scroll-70271cb1.js +35 -0
- package/es/style.css +1 -1
- package/es/toNumber-b47ceb68.cjs +1 -0
- package/es/toNumber-f077c66a.js +31 -0
- package/es/use-form-item-76516e50.cjs +2 -0
- package/es/use-form-item-784142b4.js +422 -0
- package/es/use-global-config-7ff9a1c2.cjs +1 -0
- package/es/use-global-config-9a4ccf33.js +71 -0
- package/es/validator-1926345b.cjs +1 -0
- package/es/{validator-c60a8956.js → validator-a66ec4f8.js} +1 -1
- package/es/vnode-6f7b84f0.cjs +1 -0
- package/es/vnode-8ee9bf4e.js +12 -0
- package/es/{zh-cn-b59a0910.js → zh-cn-51c2e528.js} +36 -33
- package/es/zh-cn-ad12d9f5.cjs +1 -0
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +265 -246
- package/lib/{index-62fa175a.js → index-7282d3be.js} +52335 -50156
- package/lib/{python-4a48fa39.js → python-418be57d.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/es/_initCloneObject-5e73c9c8.js +0 -81
- package/es/_initCloneObject-a5832933.cjs +0 -1
- package/es/base-a5af3db3.js +0 -288
- package/es/base-ef747d02.cjs +0 -5
- package/es/config-provider-06ea6b42.cjs +0 -1
- package/es/config-provider-88b637a8.js +0 -59
- package/es/dayjs.min-2c20abe6.cjs +0 -1
- package/es/dayjs.min-8313b006.js +0 -299
- package/es/debounce-62f5b6e8.cjs +0 -1
- package/es/debounce-8d53f4dd.js +0 -83
- package/es/dropdown-4ce4c3e2.cjs +0 -1
- package/es/dropdown-72fbc15d.js +0 -178
- package/es/el-autocomplete-6cafcdf1.js +0 -329
- package/es/el-autocomplete-e0857c5b.cjs +0 -1
- package/es/el-button-613e0bb2.cjs +0 -1
- package/es/el-button-94d3de38.js +0 -272
- package/es/el-checkbox-6d4cb393.js +0 -459
- package/es/el-checkbox-e90762df.cjs +0 -1
- package/es/el-dialog-02942e22.cjs +0 -1
- package/es/el-dialog-5e30161f.js +0 -276
- package/es/el-divider-4713d74c.cjs +0 -1
- package/es/el-divider-4e059794.js +0 -45
- package/es/el-empty-1697ded8.cjs +0 -1
- package/es/el-empty-33cb66f1.js +0 -183
- package/es/el-form-item-44f060d8.cjs +0 -12
- package/es/el-form-item-9e8969ea.js +0 -1269
- package/es/el-input-342b2def.js +0 -531
- package/es/el-input-9a9a7f7f.cjs +0 -1
- package/es/el-input-number-65c847d6.cjs +0 -1
- package/es/el-input-number-c22b803a.js +0 -311
- package/es/el-loading-8179b497.cjs +0 -1
- package/es/el-loading-bcc51e3d.js +0 -203
- package/es/el-menu-item-339baf6d.js +0 -768
- package/es/el-menu-item-83186444.cjs +0 -1
- package/es/el-message-box-035b699c.js +0 -489
- package/es/el-message-box-c62d3217.cjs +0 -1
- package/es/el-overlay-3e17604b.js +0 -324
- package/es/el-overlay-8f1da9e8.cjs +0 -1
- package/es/el-popconfirm-4e32ec1b.cjs +0 -1
- package/es/el-popconfirm-f8a86e2c.js +0 -162
- package/es/el-popper-a4f3ae4d.cjs +0 -1
- package/es/el-popper-fbd0dcea.js +0 -2094
- package/es/el-segmented-56bd58a8.js +0 -142
- package/es/el-segmented-833ac177.cjs +0 -1
- package/es/el-select-44fa547d.js +0 -1256
- package/es/el-select-70806166.cjs +0 -1
- package/es/el-table-column-3e2cdfca.cjs +0 -14
- package/es/el-table-column-b74a857d.js +0 -3432
- package/es/el-tag-66c83156.js +0 -117
- package/es/el-tag-9c2f329f.cjs +0 -1
- package/es/el-text-034bd3f4.js +0 -67
- package/es/el-text-6b2374bb.cjs +0 -1
- package/es/index-00f6ca75.cjs +0 -1
- package/es/index-185792a7.cjs +0 -1
- package/es/index-1e2a38ab.js +0 -113
- package/es/index-2e331d74.js +0 -10
- package/es/index-3153c1db.cjs +0 -1
- package/es/index-5216d5f5.js +0 -406
- package/es/index-5c0dd943.cjs +0 -1
- package/es/index-657047bb.js +0 -513
- package/es/index-870b6c9d.cjs +0 -1
- package/es/index-8c2d7e05.js +0 -368
- package/es/index-960806da.js +0 -314
- package/es/index-9780a537.cjs +0 -1
- package/es/index-9d16cea8.cjs +0 -1
- package/es/index-ac8dc53d.cjs +0 -1
- package/es/index-bb833443.cjs +0 -1
- package/es/index-c5f2d372.js +0 -326
- package/es/index-c6584658.js +0 -163
- package/es/index-d77a7336.js +0 -204
- package/es/index-eea0bcb3.cjs +0 -1
- package/es/index-f034b910.js +0 -60
- package/es/index-f1c702f6.cjs +0 -1
- package/es/index-f58b2920.cjs +0 -1
- package/es/scroll-679bd6bf.js +0 -35
- package/es/scroll-b108dabd.cjs +0 -1
- package/es/use-form-common-props-ac666630.cjs +0 -1
- package/es/use-form-common-props-ed72e914.js +0 -364
- package/es/use-global-config-23472471.cjs +0 -1
- package/es/use-global-config-ee406d58.js +0 -72
- package/es/validator-366dbf39.cjs +0 -1
- package/es/vnode-5ddb7ed1.js +0 -14
- package/es/vnode-b906ae6d.cjs +0 -1
- package/es/zh-cn-c21d12d8.cjs +0 -1
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { B as J, b as be, c as R, s as b, l as g, u as Ne, i as F, v as G, t as ve, a as he, N as Q, w as Ee } from "./base-dd156b8e.js";
|
|
2
|
+
import { u as ye, C as ae, I as T, U as D, g as Ve, h as ge, a as Y } from "./el-popper-0454c8e8.js";
|
|
3
|
+
import { u as Se } from "./index-a181f161.js";
|
|
4
|
+
import { E as Z, g as Ie, F as we, G as xe, C as Fe } from "./index-6a52dc7c.js";
|
|
5
|
+
import { h as Ae, d as Ce, e as Pe, g as ke } from "./use-form-item-784142b4.js";
|
|
6
|
+
import { E as Te } from "./el-input-d23f5442.js";
|
|
7
|
+
import { defineComponent as De, ref as Me, reactive as Be, computed as V, watch as _, onMounted as Le, onUpdated as Oe, openBlock as E, createElementBlock as K, normalizeClass as U, unref as l, withModifiers as $e, withDirectives as ee, withKeys as te, renderSlot as A, createVNode as W, withCtx as C, createBlock as P, createCommentVNode as ne, createSlots as ze } from "vue";
|
|
8
|
+
const k = "_RepeatClick", re = {
|
|
9
|
+
beforeMount(n, N) {
|
|
10
|
+
const m = N.value, { interval: r = 100, delay: c = 600 } = J(m) ? {} : m;
|
|
11
|
+
let v, s;
|
|
12
|
+
const p = () => J(m) ? m() : m.handler(), i = () => {
|
|
13
|
+
s && (clearTimeout(s), s = void 0), v && (clearInterval(v), v = void 0);
|
|
14
|
+
}, d = (S) => {
|
|
15
|
+
S.button === 0 && (i(), p(), document.addEventListener("mouseup", i, {
|
|
16
|
+
once: !0,
|
|
17
|
+
capture: !0
|
|
18
|
+
}), s = setTimeout(() => {
|
|
19
|
+
v = setInterval(() => {
|
|
20
|
+
p();
|
|
21
|
+
}, r);
|
|
22
|
+
}, c));
|
|
23
|
+
};
|
|
24
|
+
n[k] = {
|
|
25
|
+
start: d,
|
|
26
|
+
clear: i
|
|
27
|
+
}, n.addEventListener("mousedown", d);
|
|
28
|
+
},
|
|
29
|
+
unmounted(n) {
|
|
30
|
+
if (!n[k])
|
|
31
|
+
return;
|
|
32
|
+
const { start: N, clear: m } = n[k];
|
|
33
|
+
N && n.removeEventListener("mousedown", N), m && (m(), document.removeEventListener("mouseup", m, !0)), n[k] = null;
|
|
34
|
+
}
|
|
35
|
+
}, Re = be({
|
|
36
|
+
/**
|
|
37
|
+
* @description same as `id` in native input
|
|
38
|
+
*/
|
|
39
|
+
id: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: void 0
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* @description incremental step
|
|
45
|
+
*/
|
|
46
|
+
step: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 1
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* @description whether input value can only be multiple of step
|
|
52
|
+
*/
|
|
53
|
+
stepStrictly: Boolean,
|
|
54
|
+
/**
|
|
55
|
+
* @description the maximum allowed value
|
|
56
|
+
*/
|
|
57
|
+
max: {
|
|
58
|
+
type: Number,
|
|
59
|
+
default: Number.MAX_SAFE_INTEGER
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* @description the minimum allowed value
|
|
63
|
+
*/
|
|
64
|
+
min: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: Number.MIN_SAFE_INTEGER
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* @description binding value
|
|
70
|
+
*/
|
|
71
|
+
modelValue: { type: [Number, null] },
|
|
72
|
+
/**
|
|
73
|
+
* @description same as `readonly` in native input
|
|
74
|
+
*/
|
|
75
|
+
readonly: Boolean,
|
|
76
|
+
/**
|
|
77
|
+
* @description whether the component is disabled
|
|
78
|
+
*/
|
|
79
|
+
disabled: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: void 0
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* @description size of the component
|
|
85
|
+
*/
|
|
86
|
+
size: Ae,
|
|
87
|
+
/**
|
|
88
|
+
* @description whether to enable the control buttons
|
|
89
|
+
*/
|
|
90
|
+
controls: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !0
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* @description position of the control buttons
|
|
96
|
+
*/
|
|
97
|
+
controlsPosition: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: "",
|
|
100
|
+
values: ["", "right"]
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* @description value should be set when input box is cleared
|
|
104
|
+
*/
|
|
105
|
+
valueOnClear: {
|
|
106
|
+
type: R([
|
|
107
|
+
String,
|
|
108
|
+
Number,
|
|
109
|
+
null
|
|
110
|
+
]),
|
|
111
|
+
validator: (n) => n === null || b(n) || ["min", "max"].includes(n),
|
|
112
|
+
default: null
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* @description same as `name` in native input
|
|
116
|
+
*/
|
|
117
|
+
name: String,
|
|
118
|
+
/**
|
|
119
|
+
* @description same as `placeholder` in native input
|
|
120
|
+
*/
|
|
121
|
+
placeholder: String,
|
|
122
|
+
/**
|
|
123
|
+
* @description precision of input value
|
|
124
|
+
*/
|
|
125
|
+
precision: {
|
|
126
|
+
type: Number,
|
|
127
|
+
validator: (n) => n >= 0 && n === Number.parseInt(`${n}`, 10)
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* @description whether to trigger form validation
|
|
131
|
+
*/
|
|
132
|
+
validateEvent: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: !0
|
|
135
|
+
},
|
|
136
|
+
...ye(["ariaLabel"]),
|
|
137
|
+
/**
|
|
138
|
+
* @description native input mode for virtual keyboards
|
|
139
|
+
*/
|
|
140
|
+
inputmode: {
|
|
141
|
+
type: R(String),
|
|
142
|
+
default: void 0
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* @description alignment for the inner input text
|
|
146
|
+
*/
|
|
147
|
+
align: {
|
|
148
|
+
type: R(String),
|
|
149
|
+
default: "center"
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* @description whether to disable scientific notation input (e.g. 'e', 'E')
|
|
153
|
+
*/
|
|
154
|
+
disabledScientific: Boolean,
|
|
155
|
+
/**
|
|
156
|
+
* @description specifies the format of the value presented in the input
|
|
157
|
+
*/
|
|
158
|
+
formatter: { type: Function },
|
|
159
|
+
/**
|
|
160
|
+
* @description specifies the value extracted from the formatted input
|
|
161
|
+
*/
|
|
162
|
+
parser: { type: Function },
|
|
163
|
+
/**
|
|
164
|
+
* @description same as `tabindex` in native input
|
|
165
|
+
*/
|
|
166
|
+
tabindex: {
|
|
167
|
+
type: [String, Number],
|
|
168
|
+
default: 0
|
|
169
|
+
}
|
|
170
|
+
}), Ge = {
|
|
171
|
+
[ae]: (n, N) => N !== n,
|
|
172
|
+
blur: (n) => n instanceof FocusEvent,
|
|
173
|
+
focus: (n) => n instanceof FocusEvent,
|
|
174
|
+
[T]: (n) => b(n) || g(n),
|
|
175
|
+
[D]: (n) => b(n) || g(n)
|
|
176
|
+
}, Ke = ["aria-label"], Ue = ["aria-label"];
|
|
177
|
+
var We = /* @__PURE__ */ De({
|
|
178
|
+
name: "ElInputNumber",
|
|
179
|
+
__name: "input-number",
|
|
180
|
+
props: Re,
|
|
181
|
+
emits: Ge,
|
|
182
|
+
setup(n, { expose: N, emit: m }) {
|
|
183
|
+
const r = n, c = m, { t: v } = Se(), s = Ne("input-number"), p = Me(), i = Be({
|
|
184
|
+
currentValue: r.modelValue,
|
|
185
|
+
userInput: null
|
|
186
|
+
}), { formItem: d } = Ce(), S = V(() => b(r.modelValue) && r.modelValue <= r.min), X = V(() => b(r.modelValue) && r.modelValue >= r.max), ue = V(() => {
|
|
187
|
+
const e = j(r.step);
|
|
188
|
+
return F(r.precision) ? Math.max(j(r.modelValue), e) : (e > r.precision && G("InputNumber", "precision should not be less than the decimal places of step"), r.precision);
|
|
189
|
+
}), M = V(() => r.controls && r.controlsPosition === "right"), H = Pe(), y = ke(), B = V(() => {
|
|
190
|
+
if (i.userInput !== null)
|
|
191
|
+
return i.userInput;
|
|
192
|
+
let e = i.currentValue;
|
|
193
|
+
if (g(e))
|
|
194
|
+
return "";
|
|
195
|
+
if (b(e)) {
|
|
196
|
+
if (Number.isNaN(e))
|
|
197
|
+
return "";
|
|
198
|
+
F(r.precision) || (e = e.toFixed(r.precision));
|
|
199
|
+
}
|
|
200
|
+
return e;
|
|
201
|
+
}), I = (e, t) => {
|
|
202
|
+
if (F(t) && (t = ue.value), t === 0)
|
|
203
|
+
return Math.round(e);
|
|
204
|
+
let a = String(e);
|
|
205
|
+
const u = a.indexOf(".");
|
|
206
|
+
if (u === -1 || !a.replace(".", "").split("")[u + t])
|
|
207
|
+
return e;
|
|
208
|
+
const f = a.length;
|
|
209
|
+
return a.charAt(f - 1) === "5" && (a = `${a.slice(0, Math.max(0, f - 1))}6`), Number.parseFloat(Number(a).toFixed(t));
|
|
210
|
+
}, j = (e) => {
|
|
211
|
+
if (g(e))
|
|
212
|
+
return 0;
|
|
213
|
+
const t = e.toString(), a = t.indexOf(".");
|
|
214
|
+
let u = 0;
|
|
215
|
+
return a !== -1 && (u = t.length - a - 1), u;
|
|
216
|
+
}, q = (e, t = 1) => b(e) ? e >= Number.MAX_SAFE_INTEGER && t === 1 ? (G("InputNumber", "The value has reached the maximum safe integer limit."), e) : e <= Number.MIN_SAFE_INTEGER && t === -1 ? (G("InputNumber", "The value has reached the minimum safe integer limit."), e) : I(e + r.step * t) : i.currentValue, ie = (e) => {
|
|
217
|
+
const t = Ve(e), a = ge(e);
|
|
218
|
+
if (r.disabledScientific && ["e", "E"].includes(a)) {
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
switch (t) {
|
|
223
|
+
case Y.up:
|
|
224
|
+
e.preventDefault(), L();
|
|
225
|
+
break;
|
|
226
|
+
case Y.down:
|
|
227
|
+
e.preventDefault(), O();
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}, L = () => {
|
|
231
|
+
r.readonly || y.value || X.value || (w(q(Number(B.value) || 0)), c(T, i.currentValue), z());
|
|
232
|
+
}, O = () => {
|
|
233
|
+
r.readonly || y.value || S.value || (w(q(Number(B.value) || 0, -1)), c(T, i.currentValue), z());
|
|
234
|
+
}, $ = (e, t) => {
|
|
235
|
+
const { max: a, min: u, step: f, precision: h, stepStrictly: pe, valueOnClear: x } = r;
|
|
236
|
+
a < u && ve("InputNumber", "min should not be greater than max.");
|
|
237
|
+
let o = e ? Number.parseFloat(String(e)) : Number(e);
|
|
238
|
+
if (g(e) || Number.isNaN(o))
|
|
239
|
+
return null;
|
|
240
|
+
if (e === "") {
|
|
241
|
+
if (x === null)
|
|
242
|
+
return null;
|
|
243
|
+
o = he(x) ? {
|
|
244
|
+
min: u,
|
|
245
|
+
max: a
|
|
246
|
+
}[x] : x;
|
|
247
|
+
}
|
|
248
|
+
return pe && (o = I(Math.round(I(o / f)) * f, h), o !== e && t && c("update:modelValue", o)), F(h) || (o = I(o, h)), (o > a || o < u) && (o = o > a ? a : u, t && c("update:modelValue", o)), o;
|
|
249
|
+
}, w = (e, t = !0) => {
|
|
250
|
+
var f;
|
|
251
|
+
const a = i.currentValue, u = $(e);
|
|
252
|
+
if (!t) {
|
|
253
|
+
c(D, u);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
i.userInput = null, !(a === u && e) && (c(D, u), a !== u && c(ae, u, a), r.validateEvent && ((f = d == null ? void 0 : d.validate) == null || f.call(d, "change").catch(Q)), i.currentValue = u);
|
|
257
|
+
}, le = (e) => {
|
|
258
|
+
i.userInput = e;
|
|
259
|
+
let t = e === "" ? null : Number.parseFloat(e);
|
|
260
|
+
Number.isNaN(t) && (t = null), c(T, t), w(t, !1);
|
|
261
|
+
}, se = (e) => {
|
|
262
|
+
const t = e !== "" ? Number.parseFloat(e) : "";
|
|
263
|
+
(b(t) && !Number.isNaN(t) || r.formatter && Number.isNaN(t) || t === "") && w(t), z(), i.userInput = null;
|
|
264
|
+
}, oe = () => {
|
|
265
|
+
var e, t;
|
|
266
|
+
(t = (e = p.value) == null ? void 0 : e.focus) == null || t.call(e);
|
|
267
|
+
}, ce = () => {
|
|
268
|
+
var e, t;
|
|
269
|
+
(t = (e = p.value) == null ? void 0 : e.blur) == null || t.call(e);
|
|
270
|
+
}, de = (e) => {
|
|
271
|
+
c("focus", e);
|
|
272
|
+
}, me = (e) => {
|
|
273
|
+
var t, a, u;
|
|
274
|
+
i.userInput = null, i.currentValue === null && ((t = p.value) != null && t.input) && (p.value.input.value = ((a = r.formatter) == null ? void 0 : a.call(r, "")) ?? ""), c("blur", e), r.validateEvent && ((u = d == null ? void 0 : d.validate) == null || u.call(d, "blur").catch(Q));
|
|
275
|
+
}, z = () => {
|
|
276
|
+
i.currentValue !== r.modelValue && (i.currentValue = r.modelValue);
|
|
277
|
+
}, fe = (e) => {
|
|
278
|
+
document.activeElement === e.target && e.preventDefault();
|
|
279
|
+
};
|
|
280
|
+
return _(() => r.modelValue, (e, t) => {
|
|
281
|
+
const a = $(e, !0);
|
|
282
|
+
i.userInput === null && a !== t && (i.currentValue = a);
|
|
283
|
+
}, { immediate: !0 }), _(() => r.precision, () => {
|
|
284
|
+
i.currentValue = $(r.modelValue);
|
|
285
|
+
}), Le(() => {
|
|
286
|
+
var f;
|
|
287
|
+
const { min: e, max: t, modelValue: a } = r, u = (f = p.value) == null ? void 0 : f.input;
|
|
288
|
+
if (u.setAttribute("role", "spinbutton"), Number.isFinite(t) ? u.setAttribute("aria-valuemax", String(t)) : u.removeAttribute("aria-valuemax"), Number.isFinite(e) ? u.setAttribute("aria-valuemin", String(e)) : u.removeAttribute("aria-valuemin"), u.setAttribute("aria-valuenow", i.currentValue || i.currentValue === 0 ? String(i.currentValue) : ""), u.setAttribute("aria-disabled", String(y.value)), !b(a) && a != null) {
|
|
289
|
+
let h = Number(a);
|
|
290
|
+
Number.isNaN(h) && (h = null), c(D, h);
|
|
291
|
+
}
|
|
292
|
+
u.addEventListener("wheel", fe, { passive: !1 });
|
|
293
|
+
}), Oe(() => {
|
|
294
|
+
var e, t;
|
|
295
|
+
(t = (e = p.value) == null ? void 0 : e.input) == null || t.setAttribute("aria-valuenow", `${i.currentValue ?? ""}`);
|
|
296
|
+
}), N({
|
|
297
|
+
/** @description get focus the input component */
|
|
298
|
+
focus: oe,
|
|
299
|
+
/** @description remove focus the input component */
|
|
300
|
+
blur: ce
|
|
301
|
+
}), (e, t) => (E(), K("div", {
|
|
302
|
+
class: U([
|
|
303
|
+
l(s).b(),
|
|
304
|
+
l(s).m(l(H)),
|
|
305
|
+
l(s).is("disabled", l(y)),
|
|
306
|
+
l(s).is("without-controls", !n.controls),
|
|
307
|
+
l(s).is("controls-right", M.value),
|
|
308
|
+
l(s).is(n.align, !!n.align)
|
|
309
|
+
]),
|
|
310
|
+
onDragstart: t[0] || (t[0] = $e(() => {
|
|
311
|
+
}, ["prevent"]))
|
|
312
|
+
}, [
|
|
313
|
+
n.controls ? ee((E(), K("span", {
|
|
314
|
+
key: 0,
|
|
315
|
+
role: "button",
|
|
316
|
+
"aria-label": l(v)("el.inputNumber.decrease"),
|
|
317
|
+
class: U([l(s).e("decrease"), l(s).is("disabled", S.value)]),
|
|
318
|
+
onKeydown: te(O, ["enter"])
|
|
319
|
+
}, [A(e.$slots, "decrease-icon", {}, () => [W(l(Z), null, {
|
|
320
|
+
default: C(() => [M.value ? (E(), P(l(Ie), { key: 0 })) : (E(), P(l(we), { key: 1 }))]),
|
|
321
|
+
_: 1
|
|
322
|
+
})])], 42, Ke)), [[l(re), O]]) : ne("v-if", !0),
|
|
323
|
+
n.controls ? ee((E(), K("span", {
|
|
324
|
+
key: 1,
|
|
325
|
+
role: "button",
|
|
326
|
+
"aria-label": l(v)("el.inputNumber.increase"),
|
|
327
|
+
class: U([l(s).e("increase"), l(s).is("disabled", X.value)]),
|
|
328
|
+
onKeydown: te(L, ["enter"])
|
|
329
|
+
}, [A(e.$slots, "increase-icon", {}, () => [W(l(Z), null, {
|
|
330
|
+
default: C(() => [M.value ? (E(), P(l(xe), { key: 0 })) : (E(), P(l(Fe), { key: 1 }))]),
|
|
331
|
+
_: 1
|
|
332
|
+
})])], 42, Ue)), [[l(re), L]]) : ne("v-if", !0),
|
|
333
|
+
W(l(Te), {
|
|
334
|
+
id: n.id,
|
|
335
|
+
ref_key: "input",
|
|
336
|
+
ref: p,
|
|
337
|
+
type: n.formatter ? "text" : "number",
|
|
338
|
+
step: n.step,
|
|
339
|
+
"model-value": B.value,
|
|
340
|
+
placeholder: n.placeholder,
|
|
341
|
+
readonly: n.readonly,
|
|
342
|
+
disabled: l(y),
|
|
343
|
+
size: l(H),
|
|
344
|
+
max: n.max,
|
|
345
|
+
min: n.min,
|
|
346
|
+
name: n.name,
|
|
347
|
+
"aria-label": n.ariaLabel,
|
|
348
|
+
"validate-event": !1,
|
|
349
|
+
inputmode: n.inputmode,
|
|
350
|
+
formatter: n.formatter,
|
|
351
|
+
parser: n.parser,
|
|
352
|
+
tabindex: n.tabindex,
|
|
353
|
+
onKeydown: ie,
|
|
354
|
+
onBlur: me,
|
|
355
|
+
onFocus: de,
|
|
356
|
+
onInput: le,
|
|
357
|
+
onChange: se
|
|
358
|
+
}, ze({ _: 2 }, [e.$slots.prefix ? {
|
|
359
|
+
name: "prefix",
|
|
360
|
+
fn: C(() => [A(e.$slots, "prefix")]),
|
|
361
|
+
key: "0"
|
|
362
|
+
} : void 0, e.$slots.suffix ? {
|
|
363
|
+
name: "suffix",
|
|
364
|
+
fn: C(() => [A(e.$slots, "suffix")]),
|
|
365
|
+
key: "1"
|
|
366
|
+
} : void 0]), 1032, [
|
|
367
|
+
"id",
|
|
368
|
+
"type",
|
|
369
|
+
"step",
|
|
370
|
+
"model-value",
|
|
371
|
+
"placeholder",
|
|
372
|
+
"readonly",
|
|
373
|
+
"disabled",
|
|
374
|
+
"size",
|
|
375
|
+
"max",
|
|
376
|
+
"min",
|
|
377
|
+
"name",
|
|
378
|
+
"aria-label",
|
|
379
|
+
"inputmode",
|
|
380
|
+
"formatter",
|
|
381
|
+
"parser",
|
|
382
|
+
"tabindex"
|
|
383
|
+
])
|
|
384
|
+
], 34));
|
|
385
|
+
}
|
|
386
|
+
}), Xe = We;
|
|
387
|
+
const _e = Ee(Xe);
|
|
388
|
+
export {
|
|
389
|
+
_e as E
|
|
390
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./base-d987e5c9.cjs"),c=require("./el-popper-acd0ff35.cjs"),j=require("./index-d372e68f.cjs"),V=require("./index-5cada1ed.cjs"),T=require("./use-form-item-76516e50.cjs"),J=require("./el-input-7fe53030.cjs"),t=require("vue"),x="_RepeatClick",L={beforeMount(r,E){const p=E.value,{interval:u=100,delay:m=600}=i.isFunction(p)?{}:p;let v,s;const N=()=>i.isFunction(p)?p():p.handler(),o=()=>{s&&(clearTimeout(s),s=void 0),v&&(clearInterval(v),v=void 0)},f=g=>{g.button===0&&(o(),N(),document.addEventListener("mouseup",o,{once:!0,capture:!0}),s=setTimeout(()=>{v=setInterval(()=>{N()},u)},m))};r[x]={start:f,clear:o},r.addEventListener("mousedown",f)},unmounted(r){if(!r[x])return;const{start:E,clear:p}=r[x];E&&r.removeEventListener("mousedown",E),p&&(p(),document.removeEventListener("mouseup",p,!0)),r[x]=null}},Q=i.buildProps({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.MAX_SAFE_INTEGER},min:{type:Number,default:Number.MIN_SAFE_INTEGER},modelValue:{type:[Number,null]},readonly:Boolean,disabled:{type:Boolean,default:void 0},size:T.useSizeProp,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:i.definePropType([String,Number,null]),validator:r=>r===null||i.isNumber(r)||["min","max"].includes(r),default:null},name:String,placeholder:String,precision:{type:Number,validator:r=>r>=0&&r===Number.parseInt(`${r}`,10)},validateEvent:{type:Boolean,default:!0},...c.useAriaProps(["ariaLabel"]),inputmode:{type:i.definePropType(String),default:void 0},align:{type:i.definePropType(String),default:"center"},disabledScientific:Boolean,formatter:{type:Function},parser:{type:Function},tabindex:{type:[String,Number],default:0}}),Y={[c.CHANGE_EVENT]:(r,E)=>E!==r,blur:r=>r instanceof FocusEvent,focus:r=>r instanceof FocusEvent,[c.INPUT_EVENT]:r=>i.isNumber(r)||i.isNil(r),[c.UPDATE_MODEL_EVENT]:r=>i.isNumber(r)||i.isNil(r)},Z=["aria-label"],ee=["aria-label"];var te=t.defineComponent({name:"ElInputNumber",__name:"input-number",props:Q,emits:Y,setup(r,{expose:E,emit:p}){const u=r,m=p,{t:v}=j.useLocale(),s=i.useNamespace("input-number"),N=t.ref(),o=t.reactive({currentValue:u.modelValue,userInput:null}),{formItem:f}=T.useFormItem(),g=t.computed(()=>i.isNumber(u.modelValue)&&u.modelValue<=u.min),D=t.computed(()=>i.isNumber(u.modelValue)&&u.modelValue>=u.max),_=t.computed(()=>{const e=O(u.step);return i.isUndefined(u.precision)?Math.max(O(u.modelValue),e):(e>u.precision&&i.debugWarn("InputNumber","precision should not be less than the decimal places of step"),u.precision)}),k=t.computed(()=>u.controls&&u.controlsPosition==="right"),M=T.useFormSize(),y=T.useFormDisabled(),P=t.computed(()=>{if(o.userInput!==null)return o.userInput;let e=o.currentValue;if(i.isNil(e))return"";if(i.isNumber(e)){if(Number.isNaN(e))return"";i.isUndefined(u.precision)||(e=e.toFixed(u.precision))}return e}),I=(e,n)=>{if(i.isUndefined(n)&&(n=_.value),n===0)return Math.round(e);let a=String(e);const l=a.indexOf(".");if(l===-1||!a.replace(".","").split("")[l+n])return e;const b=a.length;return a.charAt(b-1)==="5"&&(a=`${a.slice(0,Math.max(0,b-1))}6`),Number.parseFloat(Number(a).toFixed(n))},O=e=>{if(i.isNil(e))return 0;const n=e.toString(),a=n.indexOf(".");let l=0;return a!==-1&&(l=n.length-a-1),l},U=(e,n=1)=>i.isNumber(e)?e>=Number.MAX_SAFE_INTEGER&&n===1?(i.debugWarn("InputNumber","The value has reached the maximum safe integer limit."),e):e<=Number.MIN_SAFE_INTEGER&&n===-1?(i.debugWarn("InputNumber","The value has reached the minimum safe integer limit."),e):I(e+u.step*n):o.currentValue,$=e=>{const n=c.getEventCode(e),a=c.getEventKey(e);if(u.disabledScientific&&["e","E"].includes(a)){e.preventDefault();return}switch(n){case c.EVENT_CODE.up:e.preventDefault(),C();break;case c.EVENT_CODE.down:e.preventDefault(),F();break}},C=()=>{u.readonly||y.value||D.value||(S(U(Number(P.value)||0)),m(c.INPUT_EVENT,o.currentValue),B())},F=()=>{u.readonly||y.value||g.value||(S(U(Number(P.value)||0,-1)),m(c.INPUT_EVENT,o.currentValue),B())},A=(e,n)=>{const{max:a,min:l,step:b,precision:h,stepStrictly:X,valueOnClear:w}=u;a<l&&i.throwError("InputNumber","min should not be greater than max.");let d=e?Number.parseFloat(String(e)):Number(e);if(i.isNil(e)||Number.isNaN(d))return null;if(e===""){if(w===null)return null;d=i.isString(w)?{min:l,max:a}[w]:w}return X&&(d=I(Math.round(I(d/b))*b,h),d!==e&&n&&m("update:modelValue",d)),i.isUndefined(h)||(d=I(d,h)),(d>a||d<l)&&(d=d>a?a:l,n&&m("update:modelValue",d)),d},S=(e,n=!0)=>{var b;const a=o.currentValue,l=A(e);if(!n){m(c.UPDATE_MODEL_EVENT,l);return}o.userInput=null,!(a===l&&e)&&(m(c.UPDATE_MODEL_EVENT,l),a!==l&&m(c.CHANGE_EVENT,l,a),u.validateEvent&&((b=f==null?void 0:f.validate)==null||b.call(f,"change").catch(i.NOOP)),o.currentValue=l)},z=e=>{o.userInput=e;let n=e===""?null:Number.parseFloat(e);Number.isNaN(n)&&(n=null),m(c.INPUT_EVENT,n),S(n,!1)},q=e=>{const n=e!==""?Number.parseFloat(e):"";(i.isNumber(n)&&!Number.isNaN(n)||u.formatter&&Number.isNaN(n)||n==="")&&S(n),B(),o.userInput=null},K=()=>{var e,n;(n=(e=N.value)==null?void 0:e.focus)==null||n.call(e)},R=()=>{var e,n;(n=(e=N.value)==null?void 0:e.blur)==null||n.call(e)},G=e=>{m("focus",e)},W=e=>{var n,a,l;o.userInput=null,o.currentValue===null&&((n=N.value)!=null&&n.input)&&(N.value.input.value=((a=u.formatter)==null?void 0:a.call(u,""))??""),m("blur",e),u.validateEvent&&((l=f==null?void 0:f.validate)==null||l.call(f,"blur").catch(i.NOOP))},B=()=>{o.currentValue!==u.modelValue&&(o.currentValue=u.modelValue)},H=e=>{document.activeElement===e.target&&e.preventDefault()};return t.watch(()=>u.modelValue,(e,n)=>{const a=A(e,!0);o.userInput===null&&a!==n&&(o.currentValue=a)},{immediate:!0}),t.watch(()=>u.precision,()=>{o.currentValue=A(u.modelValue)}),t.onMounted(()=>{var b;const{min:e,max:n,modelValue:a}=u,l=(b=N.value)==null?void 0:b.input;if(l.setAttribute("role","spinbutton"),Number.isFinite(n)?l.setAttribute("aria-valuemax",String(n)):l.removeAttribute("aria-valuemax"),Number.isFinite(e)?l.setAttribute("aria-valuemin",String(e)):l.removeAttribute("aria-valuemin"),l.setAttribute("aria-valuenow",o.currentValue||o.currentValue===0?String(o.currentValue):""),l.setAttribute("aria-disabled",String(y.value)),!i.isNumber(a)&&a!=null){let h=Number(a);Number.isNaN(h)&&(h=null),m(c.UPDATE_MODEL_EVENT,h)}l.addEventListener("wheel",H,{passive:!1})}),t.onUpdated(()=>{var e,n;(n=(e=N.value)==null?void 0:e.input)==null||n.setAttribute("aria-valuenow",`${o.currentValue??""}`)}),E({focus:K,blur:R}),(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(s).b(),t.unref(s).m(t.unref(M)),t.unref(s).is("disabled",t.unref(y)),t.unref(s).is("without-controls",!r.controls),t.unref(s).is("controls-right",k.value),t.unref(s).is(r.align,!!r.align)]),onDragstart:n[0]||(n[0]=t.withModifiers(()=>{},["prevent"]))},[r.controls?t.withDirectives((t.openBlock(),t.createElementBlock("span",{key:0,role:"button","aria-label":t.unref(v)("el.inputNumber.decrease"),class:t.normalizeClass([t.unref(s).e("decrease"),t.unref(s).is("disabled",g.value)]),onKeydown:t.withKeys(F,["enter"])},[t.renderSlot(e.$slots,"decrease-icon",{},()=>[t.createVNode(t.unref(V.ElIcon),null,{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createBlock(t.unref(V.arrow_down_default),{key:0})):(t.openBlock(),t.createBlock(t.unref(V.minus_default),{key:1}))]),_:1})])],42,Z)),[[t.unref(L),F]]):t.createCommentVNode("v-if",!0),r.controls?t.withDirectives((t.openBlock(),t.createElementBlock("span",{key:1,role:"button","aria-label":t.unref(v)("el.inputNumber.increase"),class:t.normalizeClass([t.unref(s).e("increase"),t.unref(s).is("disabled",D.value)]),onKeydown:t.withKeys(C,["enter"])},[t.renderSlot(e.$slots,"increase-icon",{},()=>[t.createVNode(t.unref(V.ElIcon),null,{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createBlock(t.unref(V.arrow_up_default),{key:0})):(t.openBlock(),t.createBlock(t.unref(V.plus_default),{key:1}))]),_:1})])],42,ee)),[[t.unref(L),C]]):t.createCommentVNode("v-if",!0),t.createVNode(t.unref(J.ElInput),{id:r.id,ref_key:"input",ref:N,type:r.formatter?"text":"number",step:r.step,"model-value":P.value,placeholder:r.placeholder,readonly:r.readonly,disabled:t.unref(y),size:t.unref(M),max:r.max,min:r.min,name:r.name,"aria-label":r.ariaLabel,"validate-event":!1,inputmode:r.inputmode,formatter:r.formatter,parser:r.parser,tabindex:r.tabindex,onKeydown:$,onBlur:W,onFocus:G,onInput:z,onChange:q},t.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0]),1032,["id","type","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","inputmode","formatter","parser","tabindex"])],34))}}),ne=te;const re=i.withInstall(ne);exports.ElInputNumber=re;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { r as y, y as E, a as B, z as g, h as L, k as I, A as P } from "./base-dd156b8e.js";
|
|
2
|
+
import { u as O } from "./use-global-config-9a4ccf33.js";
|
|
3
|
+
import { ref as S, reactive as z, createApp as j, defineComponent as R, h as m, Transition as q, withCtx as D, withDirectives as F, createVNode as G, vShow as H, toRefs as K, nextTick as $, isRef as M } from "vue";
|
|
4
|
+
function Y(e, n) {
|
|
5
|
+
let t;
|
|
6
|
+
const s = S(!1), o = z({
|
|
7
|
+
...e,
|
|
8
|
+
originalPosition: "",
|
|
9
|
+
originalOverflow: "",
|
|
10
|
+
visible: !1
|
|
11
|
+
});
|
|
12
|
+
function r(l) {
|
|
13
|
+
o.text = l;
|
|
14
|
+
}
|
|
15
|
+
function c() {
|
|
16
|
+
const l = o.parent, u = v.ns;
|
|
17
|
+
if (!l.vLoadingAddClassList) {
|
|
18
|
+
let i = l.getAttribute("loading-number");
|
|
19
|
+
i = Number.parseInt(i) - 1, i ? l.setAttribute("loading-number", i.toString()) : (y(l, u.bm("parent", "relative")), l.removeAttribute("loading-number")), y(l, u.bm("parent", "hidden"));
|
|
20
|
+
}
|
|
21
|
+
f(), C.unmount();
|
|
22
|
+
}
|
|
23
|
+
function f() {
|
|
24
|
+
var l, u;
|
|
25
|
+
(u = (l = v.$el) == null ? void 0 : l.parentNode) == null || u.removeChild(v.$el);
|
|
26
|
+
}
|
|
27
|
+
function x() {
|
|
28
|
+
var l;
|
|
29
|
+
e.beforeClose && !e.beforeClose() || (s.value = !0, clearTimeout(t), t = setTimeout(a, 400), o.visible = !1, (l = e.closed) == null || l.call(e));
|
|
30
|
+
}
|
|
31
|
+
function a() {
|
|
32
|
+
if (!s.value)
|
|
33
|
+
return;
|
|
34
|
+
const l = o.parent;
|
|
35
|
+
s.value = !1, l.vLoadingAddClassList = void 0, c();
|
|
36
|
+
}
|
|
37
|
+
const C = j(R({
|
|
38
|
+
name: "ElLoading",
|
|
39
|
+
setup(l, { expose: u }) {
|
|
40
|
+
const { ns: i, zIndex: T } = O("loading");
|
|
41
|
+
return u({
|
|
42
|
+
ns: i,
|
|
43
|
+
zIndex: T
|
|
44
|
+
}), () => {
|
|
45
|
+
const A = o.spinner || o.svg, _ = m("svg", {
|
|
46
|
+
class: "circular",
|
|
47
|
+
viewBox: o.svgViewBox ? o.svgViewBox : "0 0 50 50",
|
|
48
|
+
...A ? { innerHTML: A } : {}
|
|
49
|
+
}, A ? void 0 : [m("circle", {
|
|
50
|
+
class: "path",
|
|
51
|
+
cx: "25",
|
|
52
|
+
cy: "25",
|
|
53
|
+
r: "20",
|
|
54
|
+
fill: "none"
|
|
55
|
+
})]), V = o.text ? m("p", { class: i.b("text") }, [o.text]) : void 0;
|
|
56
|
+
return m(q, {
|
|
57
|
+
name: i.b("fade"),
|
|
58
|
+
onAfterLeave: a
|
|
59
|
+
}, { default: D(() => [F(G("div", {
|
|
60
|
+
style: { backgroundColor: o.background || "" },
|
|
61
|
+
class: [
|
|
62
|
+
i.b("mask"),
|
|
63
|
+
o.customClass,
|
|
64
|
+
i.is("fullscreen", o.fullscreen)
|
|
65
|
+
]
|
|
66
|
+
}, [m("div", { class: i.b("spinner") }, [_, V])]), [[H, o.visible]])]) });
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
Object.assign(C._context, n ?? {});
|
|
71
|
+
const v = C.mount(document.createElement("div"));
|
|
72
|
+
return {
|
|
73
|
+
...K(o),
|
|
74
|
+
setText: r,
|
|
75
|
+
removeElLoadingChild: f,
|
|
76
|
+
close: x,
|
|
77
|
+
handleAfterLeave: a,
|
|
78
|
+
vm: v,
|
|
79
|
+
get $el() {
|
|
80
|
+
return v.$el;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
let p;
|
|
85
|
+
const k = function(e = {}, n) {
|
|
86
|
+
if (!E)
|
|
87
|
+
return;
|
|
88
|
+
const t = Z(e);
|
|
89
|
+
if (t.fullscreen && p)
|
|
90
|
+
return p;
|
|
91
|
+
const s = Y({
|
|
92
|
+
...t,
|
|
93
|
+
closed: () => {
|
|
94
|
+
var r;
|
|
95
|
+
(r = t.closed) == null || r.call(t), t.fullscreen && (p = void 0);
|
|
96
|
+
}
|
|
97
|
+
}, n ?? k._context);
|
|
98
|
+
J(t, t.parent, s), h(t, t.parent, s), t.parent.vLoadingAddClassList = () => h(t, t.parent, s);
|
|
99
|
+
let o = t.parent.getAttribute("loading-number");
|
|
100
|
+
return o ? o = `${Number.parseInt(o) + 1}` : o = "1", t.parent.setAttribute("loading-number", o), t.parent.appendChild(s.$el), $(() => s.visible.value = t.visible), t.fullscreen && (p = s), s;
|
|
101
|
+
}, Z = (e) => {
|
|
102
|
+
let n;
|
|
103
|
+
return B(e.target) ? n = document.querySelector(e.target) ?? document.body : n = e.target || document.body, {
|
|
104
|
+
parent: n === document.body || e.body ? document.body : n,
|
|
105
|
+
background: e.background || "",
|
|
106
|
+
svg: e.svg || "",
|
|
107
|
+
svgViewBox: e.svgViewBox || "",
|
|
108
|
+
spinner: e.spinner || !1,
|
|
109
|
+
text: e.text || "",
|
|
110
|
+
fullscreen: n === document.body && (e.fullscreen ?? !0),
|
|
111
|
+
lock: e.lock ?? !1,
|
|
112
|
+
customClass: e.customClass || "",
|
|
113
|
+
visible: e.visible ?? !0,
|
|
114
|
+
beforeClose: e.beforeClose,
|
|
115
|
+
closed: e.closed,
|
|
116
|
+
target: n
|
|
117
|
+
};
|
|
118
|
+
}, J = async (e, n, t) => {
|
|
119
|
+
const { nextZIndex: s } = t.vm.zIndex || t.vm._.exposed.zIndex, o = {};
|
|
120
|
+
if (e.fullscreen)
|
|
121
|
+
t.originalPosition.value = g(document.body, "position"), t.originalOverflow.value = g(document.body, "overflow"), o.zIndex = s();
|
|
122
|
+
else if (e.parent === document.body) {
|
|
123
|
+
t.originalPosition.value = g(document.body, "position"), await $();
|
|
124
|
+
for (const r of ["top", "left"]) {
|
|
125
|
+
const c = r === "top" ? "scrollTop" : "scrollLeft";
|
|
126
|
+
o[r] = `${e.target.getBoundingClientRect()[r] + document.body[c] + document.documentElement[c] - Number.parseInt(g(document.body, `margin-${r}`), 10)}px`;
|
|
127
|
+
}
|
|
128
|
+
for (const r of ["height", "width"])
|
|
129
|
+
o[r] = `${e.target.getBoundingClientRect()[r]}px`;
|
|
130
|
+
} else
|
|
131
|
+
t.originalPosition.value = g(n, "position");
|
|
132
|
+
for (const [r, c] of Object.entries(o))
|
|
133
|
+
t.$el.style[r] = c;
|
|
134
|
+
}, h = (e, n, t) => {
|
|
135
|
+
const s = t.vm.ns || t.vm._.exposed.ns;
|
|
136
|
+
[
|
|
137
|
+
"absolute",
|
|
138
|
+
"fixed",
|
|
139
|
+
"sticky"
|
|
140
|
+
].includes(t.originalPosition.value) ? y(n, s.bm("parent", "relative")) : L(n, s.bm("parent", "relative")), e.fullscreen && e.lock ? L(n, s.bm("parent", "hidden")) : y(n, s.bm("parent", "hidden"));
|
|
141
|
+
};
|
|
142
|
+
k._context = null;
|
|
143
|
+
const b = Symbol("ElLoading"), d = (e) => `element-loading-${P(e)}`, w = (e, n) => {
|
|
144
|
+
const t = n.instance, s = (a) => I(n.value) ? n.value[a] : void 0, o = (a) => S(B(a) && (t == null ? void 0 : t[a]) || a), r = (a) => o(s(a) || e.getAttribute(d(a))), c = s("fullscreen") ?? n.modifiers.fullscreen, f = {
|
|
145
|
+
text: r("text"),
|
|
146
|
+
svg: r("svg"),
|
|
147
|
+
svgViewBox: r("svgViewBox"),
|
|
148
|
+
spinner: r("spinner"),
|
|
149
|
+
background: r("background"),
|
|
150
|
+
customClass: r("customClass"),
|
|
151
|
+
fullscreen: c,
|
|
152
|
+
target: s("target") ?? (c ? void 0 : e),
|
|
153
|
+
body: s("body") ?? n.modifiers.body,
|
|
154
|
+
lock: s("lock") ?? n.modifiers.lock
|
|
155
|
+
}, x = k(f);
|
|
156
|
+
x._context = N._context, e[b] = {
|
|
157
|
+
options: f,
|
|
158
|
+
instance: x
|
|
159
|
+
};
|
|
160
|
+
}, Q = (e, n) => {
|
|
161
|
+
for (const t of Object.keys(e))
|
|
162
|
+
M(e[t]) && (e[t].value = n[t]);
|
|
163
|
+
}, N = {
|
|
164
|
+
mounted(e, n) {
|
|
165
|
+
n.value && w(e, n);
|
|
166
|
+
},
|
|
167
|
+
updated(e, n) {
|
|
168
|
+
const t = e[b];
|
|
169
|
+
if (!n.value) {
|
|
170
|
+
t == null || t.instance.close(), e[b] = null;
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
t ? Q(t.options, I(n.value) ? n.value : {
|
|
174
|
+
text: e.getAttribute(d("text")),
|
|
175
|
+
svg: e.getAttribute(d("svg")),
|
|
176
|
+
svgViewBox: e.getAttribute(d("svgViewBox")),
|
|
177
|
+
spinner: e.getAttribute(d("spinner")),
|
|
178
|
+
background: e.getAttribute(d("background")),
|
|
179
|
+
customClass: e.getAttribute(d("customClass"))
|
|
180
|
+
}) : w(e, n);
|
|
181
|
+
},
|
|
182
|
+
unmounted(e) {
|
|
183
|
+
var n;
|
|
184
|
+
(n = e[b]) == null || n.instance.close(), e[b] = null;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
N._context = null;
|
|
188
|
+
export {
|
|
189
|
+
N as v
|
|
190
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./base-d987e5c9.cjs"),I=require("./use-global-config-7ff9a1c2.cjs"),l=require("vue");function T(e,n){let t;const o=l.ref(!1),s=l.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function r(i){s.text=i}function d(){const i=s.parent,g=m.ns;if(!i.vLoadingAddClassList){let u=i.getAttribute("loading-number");u=Number.parseInt(u)-1,u?i.setAttribute("loading-number",u.toString()):(a.removeClass(i,g.bm("parent","relative")),i.removeAttribute("loading-number")),a.removeClass(i,g.bm("parent","hidden"))}f(),y.unmount()}function f(){var i,g;(g=(i=m.$el)==null?void 0:i.parentNode)==null||g.removeChild(m.$el)}function x(){var i;e.beforeClose&&!e.beforeClose()||(o.value=!0,clearTimeout(t),t=setTimeout(c,400),s.visible=!1,(i=e.closed)==null||i.call(e))}function c(){if(!o.value)return;const i=s.parent;o.value=!1,i.vLoadingAddClassList=void 0,d()}const y=l.createApp(l.defineComponent({name:"ElLoading",setup(i,{expose:g}){const{ns:u,zIndex:w}=I.useGlobalComponentSettings("loading");return g({ns:u,zIndex:w}),()=>{const C=s.spinner||s.svg,S=l.h("svg",{class:"circular",viewBox:s.svgViewBox?s.svgViewBox:"0 0 50 50",...C?{innerHTML:C}:{}},C?void 0:[l.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),B=s.text?l.h("p",{class:u.b("text")},[s.text]):void 0;return l.h(l.Transition,{name:u.b("fade"),onAfterLeave:c},{default:l.withCtx(()=>[l.withDirectives(l.createVNode("div",{style:{backgroundColor:s.background||""},class:[u.b("mask"),s.customClass,u.is("fullscreen",s.fullscreen)]},[l.h("div",{class:u.b("spinner")},[S,B])]),[[l.vShow,s.visible]])])})}}}));Object.assign(y._context,n??{});const m=y.mount(document.createElement("div"));return{...l.toRefs(s),setText:r,removeElLoadingChild:f,close:x,handleAfterLeave:c,vm:m,get $el(){return m.$el}}}let p;const h=function(e={},n){if(!a.isClient)return;const t=$(e);if(t.fullscreen&&p)return p;const o=T({...t,closed:()=>{var r;(r=t.closed)==null||r.call(t),t.fullscreen&&(p=void 0)}},n??h._context);N(t,t.parent,o),k(t,t.parent,o),t.parent.vLoadingAddClassList=()=>k(t,t.parent,o);let s=t.parent.getAttribute("loading-number");return s?s=`${Number.parseInt(s)+1}`:s="1",t.parent.setAttribute("loading-number",s),t.parent.appendChild(o.$el),l.nextTick(()=>o.visible.value=t.visible),t.fullscreen&&(p=o),o},$=e=>{let n;return a.isString(e.target)?n=document.querySelector(e.target)??document.body:n=e.target||document.body,{parent:n===document.body||e.body?document.body:n,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:n===document.body&&(e.fullscreen??!0),lock:e.lock??!1,customClass:e.customClass||"",visible:e.visible??!0,beforeClose:e.beforeClose,closed:e.closed,target:n}},N=async(e,n,t)=>{const{nextZIndex:o}=t.vm.zIndex||t.vm._.exposed.zIndex,s={};if(e.fullscreen)t.originalPosition.value=a.getStyle(document.body,"position"),t.originalOverflow.value=a.getStyle(document.body,"overflow"),s.zIndex=o();else if(e.parent===document.body){t.originalPosition.value=a.getStyle(document.body,"position"),await l.nextTick();for(const r of["top","left"]){const d=r==="top"?"scrollTop":"scrollLeft";s[r]=`${e.target.getBoundingClientRect()[r]+document.body[d]+document.documentElement[d]-Number.parseInt(a.getStyle(document.body,`margin-${r}`),10)}px`}for(const r of["height","width"])s[r]=`${e.target.getBoundingClientRect()[r]}px`}else t.originalPosition.value=a.getStyle(n,"position");for(const[r,d]of Object.entries(s))t.$el.style[r]=d},k=(e,n,t)=>{const o=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?a.removeClass(n,o.bm("parent","relative")):a.addClass(n,o.bm("parent","relative")),e.fullscreen&&e.lock?a.addClass(n,o.bm("parent","hidden")):a.removeClass(n,o.bm("parent","hidden"))};h._context=null;const b=Symbol("ElLoading"),v=e=>`element-loading-${a.hyphenate(e)}`,A=(e,n)=>{const t=n.instance,o=c=>a.isObject(n.value)?n.value[c]:void 0,s=c=>l.ref(a.isString(c)&&(t==null?void 0:t[c])||c),r=c=>s(o(c)||e.getAttribute(v(c))),d=o("fullscreen")??n.modifiers.fullscreen,f={text:r("text"),svg:r("svg"),svgViewBox:r("svgViewBox"),spinner:r("spinner"),background:r("background"),customClass:r("customClass"),fullscreen:d,target:o("target")??(d?void 0:e),body:o("body")??n.modifiers.body,lock:o("lock")??n.modifiers.lock},x=h(f);x._context=L._context,e[b]={options:f,instance:x}},_=(e,n)=>{for(const t of Object.keys(e))l.isRef(e[t])&&(e[t].value=n[t])},L={mounted(e,n){n.value&&A(e,n)},updated(e,n){const t=e[b];if(!n.value){t==null||t.instance.close(),e[b]=null;return}t?_(t.options,a.isObject(n.value)?n.value:{text:e.getAttribute(v("text")),svg:e.getAttribute(v("svg")),svgViewBox:e.getAttribute(v("svgViewBox")),spinner:e.getAttribute(v("spinner")),background:e.getAttribute(v("background")),customClass:e.getAttribute(v("customClass"))}):A(e,n)},unmounted(e){var n;(n=e[b])==null||n.instance.close(),e[b]=null}};L._context=null;exports.vLoading=L;
|