@xto/form 1.1.1 → 1.1.3
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/index.mjs +2087 -1841
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +17 -9
package/es/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNamespace as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as Q, ref as E, useSlots as Ee, computed as b, openBlock as r, createElementBlock as c, normalizeClass as u, unref as s, renderSlot as ae, createElementVNode as d, toDisplayString as z, createCommentVNode as O, withDirectives as oe, vModelDynamic as He, watch as de, normalizeStyle as ne, vModelText as be, inject as Ve, withModifiers as ue, createTextVNode as me, provide as Ce, toRef as Oe, onMounted as ke, onUnmounted as xe, Fragment as G, renderList as Z, createBlock as ge, Teleport as Re, createVNode as we, Transition as Be, withCtx as Fe, vShow as Ie, nextTick as De, vModelSelect as Pe } from "vue";
|
|
2
|
+
import { useNamespace as J, useZIndex as Le } from "@xto/core";
|
|
3
|
+
const Ne = ["type", "placeholder", "disabled", "readonly", "maxlength", "minlength"], wl = /* @__PURE__ */ Q({
|
|
4
4
|
name: "XInput",
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
@@ -20,97 +20,97 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
20
20
|
suffixIcon: {}
|
|
21
21
|
},
|
|
22
22
|
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur", "clear"],
|
|
23
|
-
setup(n, { expose:
|
|
24
|
-
const
|
|
25
|
-
() =>
|
|
26
|
-
),
|
|
27
|
-
get: () =>
|
|
28
|
-
set: (
|
|
29
|
-
|
|
23
|
+
setup(n, { expose: g, emit: t }) {
|
|
24
|
+
const e = n, a = t, l = J("input"), m = E(), p = E(!1), C = E(!1), x = Ee(), P = b(
|
|
25
|
+
() => e.type === "password" && e.showPassword && !e.disabled
|
|
26
|
+
), S = b(() => P.value ? C.value ? "text" : "password" : e.type), V = b({
|
|
27
|
+
get: () => e.modelValue !== void 0 ? e.modelValue : e.value !== void 0 ? e.value : "",
|
|
28
|
+
set: (k) => {
|
|
29
|
+
a("update:modelValue", k), a("update:value", k), a("input", k);
|
|
30
30
|
}
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
]),
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
}, M = (
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
31
|
+
}), $ = b(() => String(V.value).length), F = b(() => [
|
|
32
|
+
l.b(),
|
|
33
|
+
e.size !== "default" ? l.m(e.size) : "",
|
|
34
|
+
l.is("disabled", e.disabled),
|
|
35
|
+
l.is("focus", p.value),
|
|
36
|
+
l.is("has-prefix", e.prefixIcon || x.prefix),
|
|
37
|
+
l.is("has-suffix", e.suffixIcon || x.suffix || e.clearable || P.value || e.showWordLimit)
|
|
38
|
+
]), v = (k) => {
|
|
39
|
+
const N = k.target.value;
|
|
40
|
+
a("change", N);
|
|
41
|
+
}, D = (k) => {
|
|
42
|
+
p.value = !0, a("focus", k);
|
|
43
|
+
}, M = (k) => {
|
|
44
|
+
p.value = !1, a("blur", k);
|
|
45
|
+
}, R = () => {
|
|
46
|
+
a("update:modelValue", ""), a("update:value", ""), a("clear");
|
|
47
|
+
}, A = () => {
|
|
48
|
+
C.value = !C.value;
|
|
49
49
|
};
|
|
50
|
-
return
|
|
50
|
+
return g({
|
|
51
51
|
focus: () => {
|
|
52
|
-
var
|
|
53
|
-
(
|
|
52
|
+
var k;
|
|
53
|
+
(k = m.value) == null || k.focus();
|
|
54
54
|
},
|
|
55
55
|
blur: () => {
|
|
56
|
-
var
|
|
57
|
-
(
|
|
56
|
+
var k;
|
|
57
|
+
(k = m.value) == null || k.blur();
|
|
58
58
|
},
|
|
59
|
-
inputRef:
|
|
60
|
-
}), (
|
|
61
|
-
class: u(
|
|
59
|
+
inputRef: m
|
|
60
|
+
}), (k, N) => (r(), c("div", {
|
|
61
|
+
class: u(F.value)
|
|
62
62
|
}, [
|
|
63
|
-
|
|
63
|
+
k.$slots.prefix || n.prefixIcon ? (r(), c("span", {
|
|
64
64
|
key: 0,
|
|
65
|
-
class: u(s(
|
|
65
|
+
class: u(s(l).e("prefix"))
|
|
66
66
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class: u(s(
|
|
67
|
+
ae(k.$slots, "prefix", {}, () => [
|
|
68
|
+
d("span", {
|
|
69
|
+
class: u(s(l).e("icon"))
|
|
70
70
|
}, z(n.prefixIcon), 3)
|
|
71
71
|
])
|
|
72
|
-
], 2)) :
|
|
73
|
-
|
|
72
|
+
], 2)) : O("", !0),
|
|
73
|
+
oe(d("input", {
|
|
74
74
|
ref_key: "inputRef",
|
|
75
|
-
ref:
|
|
76
|
-
"onUpdate:modelValue":
|
|
77
|
-
type:
|
|
75
|
+
ref: m,
|
|
76
|
+
"onUpdate:modelValue": N[0] || (N[0] = (K) => V.value = K),
|
|
77
|
+
type: S.value,
|
|
78
78
|
placeholder: n.placeholder,
|
|
79
79
|
disabled: n.disabled,
|
|
80
80
|
readonly: n.readonly,
|
|
81
81
|
maxlength: n.maxlength,
|
|
82
82
|
minlength: n.minlength,
|
|
83
|
-
class: u(s(
|
|
84
|
-
onChange:
|
|
85
|
-
onFocus:
|
|
83
|
+
class: u(s(l).e("inner")),
|
|
84
|
+
onChange: v,
|
|
85
|
+
onFocus: D,
|
|
86
86
|
onBlur: M
|
|
87
|
-
}, null, 42,
|
|
88
|
-
[
|
|
87
|
+
}, null, 42, Ne), [
|
|
88
|
+
[He, V.value]
|
|
89
89
|
]),
|
|
90
|
-
|
|
90
|
+
k.$slots.suffix || n.suffixIcon || n.clearable || P.value || n.showWordLimit ? (r(), c("span", {
|
|
91
91
|
key: 1,
|
|
92
|
-
class: u(s(
|
|
92
|
+
class: u(s(l).e("suffix"))
|
|
93
93
|
}, [
|
|
94
|
-
|
|
95
|
-
n.clearable &&
|
|
94
|
+
ae(k.$slots, "suffix", {}, () => [
|
|
95
|
+
n.clearable && V.value && !n.disabled ? (r(), c("span", {
|
|
96
96
|
key: 0,
|
|
97
|
-
class: u([s(
|
|
98
|
-
onClick:
|
|
99
|
-
}, " ✕ ", 2)) :
|
|
100
|
-
|
|
97
|
+
class: u([s(l).e("icon"), s(l).e("clear")]),
|
|
98
|
+
onClick: R
|
|
99
|
+
}, " ✕ ", 2)) : O("", !0),
|
|
100
|
+
P.value ? (r(), c("span", {
|
|
101
101
|
key: 1,
|
|
102
|
-
class: u([s(
|
|
103
|
-
onClick:
|
|
104
|
-
}, z(
|
|
105
|
-
n.showWordLimit && n.maxlength ? (
|
|
102
|
+
class: u([s(l).e("icon"), s(l).e("password")]),
|
|
103
|
+
onClick: A
|
|
104
|
+
}, z(C.value ? "🙈" : "👁️"), 3)) : O("", !0),
|
|
105
|
+
n.showWordLimit && n.maxlength ? (r(), c("span", {
|
|
106
106
|
key: 2,
|
|
107
|
-
class: u(s(
|
|
108
|
-
}, z(
|
|
107
|
+
class: u(s(l).e("count"))
|
|
108
|
+
}, z($.value) + "/" + z(n.maxlength), 3)) : O("", !0)
|
|
109
109
|
])
|
|
110
|
-
], 2)) :
|
|
110
|
+
], 2)) : O("", !0)
|
|
111
111
|
], 2));
|
|
112
112
|
}
|
|
113
|
-
}),
|
|
113
|
+
}), Ue = ["disabled"], Xe = ["value", "placeholder", "disabled"], Ke = ["disabled"], Vl = /* @__PURE__ */ Q({
|
|
114
114
|
name: "XInputNumber",
|
|
115
115
|
__name: "index",
|
|
116
116
|
props: {
|
|
@@ -128,152 +128,153 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
128
128
|
valueOnClear: { default: null }
|
|
129
129
|
},
|
|
130
130
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
131
|
-
setup(n, { expose:
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
return
|
|
135
|
-
const o =
|
|
136
|
-
return Math.max(o,
|
|
131
|
+
setup(n, { expose: g, emit: t }) {
|
|
132
|
+
const e = n, a = t, l = J("input-number"), m = E(), p = E(!1), C = E(null), x = E(e.modelValue), P = b(() => {
|
|
133
|
+
if (e.precision !== void 0)
|
|
134
|
+
return e.precision;
|
|
135
|
+
const o = S(e.step), i = e.modelValue !== void 0 && e.modelValue !== null ? S(e.modelValue) : 0;
|
|
136
|
+
return Math.max(o, i);
|
|
137
137
|
});
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
function S(o) {
|
|
139
|
+
if (o == null) return 0;
|
|
140
|
+
const i = o.toString(), y = i.indexOf(".");
|
|
141
|
+
return y === -1 ? 0 : i.length - y - 1;
|
|
141
142
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
144
|
-
let
|
|
145
|
-
return Number(
|
|
143
|
+
function V(o, i = P.value) {
|
|
144
|
+
if (i === 0) return Math.round(o);
|
|
145
|
+
let y = o.toFixed(i);
|
|
146
|
+
return Number(y);
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
return o >
|
|
148
|
+
function $(o) {
|
|
149
|
+
return o > e.max ? e.max : o < e.min ? e.min : o;
|
|
149
150
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
const F = b(() => e.modelValue ?? void 0), v = b(() => C.value !== null ? C.value : F.value === void 0 || F.value === null ? "" : V(F.value)), D = b(() => e.disabled ? !0 : F.value === void 0 ? e.min !== -1 / 0 : F.value <= e.min), M = b(() => e.disabled ? !0 : F.value === void 0 ? e.max !== 1 / 0 : F.value >= e.max), R = b(() => [
|
|
152
|
+
l.b(),
|
|
153
|
+
e.size !== "default" ? l.m(e.size) : "",
|
|
154
|
+
l.is("disabled", e.disabled),
|
|
155
|
+
l.is("focus", p.value),
|
|
156
|
+
e.controlsPosition ? l.m(e.controlsPosition) : ""
|
|
156
157
|
]);
|
|
157
|
-
function
|
|
158
|
-
if (
|
|
159
|
-
const o =
|
|
160
|
-
|
|
158
|
+
function A() {
|
|
159
|
+
if (e.disabled || M.value) return;
|
|
160
|
+
const o = F.value ?? (e.min === -1 / 0 ? 0 : e.min), i = V(o + e.step), y = $(i);
|
|
161
|
+
f(y);
|
|
161
162
|
}
|
|
162
|
-
function
|
|
163
|
-
if (
|
|
164
|
-
const o =
|
|
165
|
-
|
|
163
|
+
function h() {
|
|
164
|
+
if (e.disabled || D.value) return;
|
|
165
|
+
const o = F.value ?? (e.min === -1 / 0 ? 0 : e.min), i = V(o - e.step), y = $(i);
|
|
166
|
+
f(y);
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
-
const
|
|
168
|
+
function f(o) {
|
|
169
|
+
const i = x.value;
|
|
169
170
|
if (o === void 0)
|
|
170
|
-
|
|
171
|
+
a("update:modelValue", void 0), a("change", void 0, i);
|
|
171
172
|
else {
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
|
|
173
|
+
const y = V(o), X = $(y);
|
|
174
|
+
if (e.stepStrictly) {
|
|
175
|
+
const le = Math.round((X - e.min) / e.step), Y = V(e.min + le * e.step);
|
|
176
|
+
a("update:modelValue", Y), a("change", Y, i);
|
|
176
177
|
} else
|
|
177
|
-
|
|
178
|
+
a("update:modelValue", X), a("change", X, i);
|
|
178
179
|
}
|
|
179
|
-
|
|
180
|
+
x.value = e.modelValue, C.value = null;
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function k(o) {
|
|
182
183
|
if (o === "" || o === "-")
|
|
183
184
|
return;
|
|
184
|
-
let
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
if (!isNaN(
|
|
189
|
-
return
|
|
185
|
+
let i = o.replace(/[^\d.-]/g, "");
|
|
186
|
+
const y = i.split(".");
|
|
187
|
+
y.length > 2 && (i = y[0] + "." + y.slice(1).join("")), i.indexOf("-") > 0 && (i = i.replace(/-/g, "")), i.lastIndexOf("-") > 0 && (i = "-" + i.replace(/-/g, ""));
|
|
188
|
+
const X = Number(i);
|
|
189
|
+
if (!isNaN(X))
|
|
190
|
+
return X;
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
-
const
|
|
193
|
-
|
|
192
|
+
function N(o) {
|
|
193
|
+
const i = o.target.value;
|
|
194
|
+
C.value = i;
|
|
194
195
|
}
|
|
195
|
-
function
|
|
196
|
-
if (
|
|
197
|
-
const
|
|
198
|
-
|
|
196
|
+
function K(o) {
|
|
197
|
+
if (p.value = !1, C.value !== null) {
|
|
198
|
+
const i = k(C.value);
|
|
199
|
+
i === void 0 ? e.valueOnClear !== null ? f(e.valueOnClear) : C.value = null : f(i);
|
|
199
200
|
}
|
|
200
|
-
|
|
201
|
+
a("blur", o);
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
203
|
+
function j(o) {
|
|
204
|
+
p.value = !0, x.value = e.modelValue, a("focus", o);
|
|
204
205
|
}
|
|
205
|
-
function
|
|
206
|
-
var
|
|
207
|
-
if (!
|
|
206
|
+
function ee(o) {
|
|
207
|
+
var i;
|
|
208
|
+
if (!e.disabled)
|
|
208
209
|
switch (o.key) {
|
|
209
210
|
case "ArrowUp":
|
|
210
|
-
o.preventDefault(),
|
|
211
|
+
o.preventDefault(), A();
|
|
211
212
|
break;
|
|
212
213
|
case "ArrowDown":
|
|
213
|
-
o.preventDefault(),
|
|
214
|
+
o.preventDefault(), h();
|
|
214
215
|
break;
|
|
215
216
|
case "Enter":
|
|
216
|
-
(
|
|
217
|
+
(i = m.value) == null || i.blur();
|
|
217
218
|
break;
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
221
|
+
function T() {
|
|
222
|
+
C.value = null, e.valueOnClear !== null && e.valueOnClear !== void 0 ? f(e.valueOnClear) : (a("update:modelValue", void 0), a("change", void 0, x.value), x.value = void 0);
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
+
function B() {
|
|
224
225
|
var o;
|
|
225
|
-
(o =
|
|
226
|
+
(o = m.value) == null || o.focus();
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
+
function w() {
|
|
228
229
|
var o;
|
|
229
|
-
(o =
|
|
230
|
+
(o = m.value) == null || o.blur();
|
|
230
231
|
}
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
}, { immediate: !0 }),
|
|
234
|
-
focus:
|
|
235
|
-
blur:
|
|
236
|
-
clear:
|
|
237
|
-
increase:
|
|
238
|
-
decrease:
|
|
239
|
-
}), (o,
|
|
240
|
-
class: u(
|
|
232
|
+
return de(() => e.modelValue, (o) => {
|
|
233
|
+
x.value = o, C.value = null;
|
|
234
|
+
}, { immediate: !0 }), g({
|
|
235
|
+
focus: B,
|
|
236
|
+
blur: w,
|
|
237
|
+
clear: T,
|
|
238
|
+
increase: A,
|
|
239
|
+
decrease: h
|
|
240
|
+
}), (o, i) => (r(), c("div", {
|
|
241
|
+
class: u(R.value)
|
|
241
242
|
}, [
|
|
242
|
-
n.controls ? (
|
|
243
|
+
n.controls ? (r(), c("button", {
|
|
243
244
|
key: 0,
|
|
244
245
|
type: "button",
|
|
245
|
-
class: u([s(
|
|
246
|
-
disabled:
|
|
247
|
-
onClick:
|
|
248
|
-
}, " − ", 10,
|
|
249
|
-
|
|
250
|
-
class: u(s(
|
|
246
|
+
class: u([s(l).e("decrease"), s(l).is("disabled", D.value)]),
|
|
247
|
+
disabled: D.value,
|
|
248
|
+
onClick: h
|
|
249
|
+
}, " − ", 10, Ue)) : O("", !0),
|
|
250
|
+
d("div", {
|
|
251
|
+
class: u(s(l).e("wrapper"))
|
|
251
252
|
}, [
|
|
252
|
-
|
|
253
|
+
d("input", {
|
|
253
254
|
ref_key: "inputRef",
|
|
254
|
-
ref:
|
|
255
|
-
value:
|
|
255
|
+
ref: m,
|
|
256
|
+
value: v.value,
|
|
256
257
|
placeholder: n.placeholder,
|
|
257
258
|
disabled: n.disabled,
|
|
258
|
-
class: u(s(
|
|
259
|
+
class: u(s(l).e("inner")),
|
|
259
260
|
type: "text",
|
|
260
261
|
autocomplete: "off",
|
|
261
|
-
onInput:
|
|
262
|
-
onFocus:
|
|
263
|
-
onBlur:
|
|
264
|
-
onKeydown:
|
|
265
|
-
}, null, 42,
|
|
262
|
+
onInput: N,
|
|
263
|
+
onFocus: j,
|
|
264
|
+
onBlur: K,
|
|
265
|
+
onKeydown: ee
|
|
266
|
+
}, null, 42, Xe)
|
|
266
267
|
], 2),
|
|
267
|
-
n.controls ? (
|
|
268
|
+
n.controls ? (r(), c("button", {
|
|
268
269
|
key: 1,
|
|
269
270
|
type: "button",
|
|
270
|
-
class: u([s(
|
|
271
|
+
class: u([s(l).e("increase"), s(l).is("disabled", M.value)]),
|
|
271
272
|
disabled: M.value,
|
|
272
|
-
onClick:
|
|
273
|
-
}, " + ", 10,
|
|
273
|
+
onClick: A
|
|
274
|
+
}, " + ", 10, Ke)) : O("", !0)
|
|
274
275
|
], 2));
|
|
275
276
|
}
|
|
276
|
-
}),
|
|
277
|
+
}), We = ["placeholder", "disabled", "readonly", "maxlength", "minlength", "rows"], Cl = /* @__PURE__ */ Q({
|
|
277
278
|
name: "XTextarea",
|
|
278
279
|
__name: "index",
|
|
279
280
|
props: {
|
|
@@ -290,74 +291,74 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
290
291
|
resize: { default: "vertical" }
|
|
291
292
|
},
|
|
292
293
|
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur"],
|
|
293
|
-
setup(n, { expose:
|
|
294
|
-
const
|
|
295
|
-
get: () =>
|
|
296
|
-
set: (
|
|
297
|
-
|
|
294
|
+
setup(n, { expose: g, emit: t }) {
|
|
295
|
+
const e = n, a = t, l = J("textarea"), m = E(), p = E(!1), C = b({
|
|
296
|
+
get: () => e.modelValue !== void 0 ? e.modelValue : e.value !== void 0 ? e.value : "",
|
|
297
|
+
set: (R) => {
|
|
298
|
+
a("update:modelValue", R), a("update:value", R), a("input", R);
|
|
298
299
|
}
|
|
299
|
-
}),
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
const
|
|
303
|
-
|
|
300
|
+
}), x = b(() => String(C.value).length), P = b(() => {
|
|
301
|
+
const R = {};
|
|
302
|
+
if (e.resize && (R.resize = e.resize), e.autosize && (R.minHeight = "auto", typeof e.autosize == "object")) {
|
|
303
|
+
const A = e.autosize.minRows || 1, h = e.autosize.maxRows;
|
|
304
|
+
R.minHeight = `${A * 22 + 12}px`, h && (R.maxHeight = `${h * 22 + 12}px`);
|
|
304
305
|
}
|
|
305
|
-
return
|
|
306
|
-
}),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
]),
|
|
312
|
-
|
|
313
|
-
},
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
},
|
|
319
|
-
|
|
306
|
+
return R;
|
|
307
|
+
}), S = b(() => [
|
|
308
|
+
l.b(),
|
|
309
|
+
l.is("disabled", e.disabled),
|
|
310
|
+
l.is("focus", p.value),
|
|
311
|
+
l.is("exceed", e.maxlength && x.value > e.maxlength)
|
|
312
|
+
]), V = () => {
|
|
313
|
+
e.autosize && m.value && (m.value.style.height = "auto", m.value.style.height = `${m.value.scrollHeight}px`);
|
|
314
|
+
}, $ = (R) => {
|
|
315
|
+
const A = R.target.value;
|
|
316
|
+
a("change", A);
|
|
317
|
+
}, F = (R) => {
|
|
318
|
+
p.value = !0, a("focus", R);
|
|
319
|
+
}, v = (R) => {
|
|
320
|
+
p.value = !1, a("blur", R);
|
|
320
321
|
};
|
|
321
|
-
return
|
|
322
|
+
return g({
|
|
322
323
|
focus: () => {
|
|
323
|
-
var
|
|
324
|
-
(
|
|
324
|
+
var R;
|
|
325
|
+
(R = m.value) == null || R.focus();
|
|
325
326
|
},
|
|
326
327
|
blur: () => {
|
|
327
|
-
var
|
|
328
|
-
(
|
|
328
|
+
var R;
|
|
329
|
+
(R = m.value) == null || R.blur();
|
|
329
330
|
},
|
|
330
|
-
textareaRef:
|
|
331
|
-
}), (
|
|
332
|
-
class: u(
|
|
333
|
-
style:
|
|
331
|
+
textareaRef: m
|
|
332
|
+
}), (R, A) => (r(), c("div", {
|
|
333
|
+
class: u(S.value),
|
|
334
|
+
style: ne(n.disabled ? void 0 : { cursor: "text" })
|
|
334
335
|
}, [
|
|
335
|
-
|
|
336
|
+
oe(d("textarea", {
|
|
336
337
|
ref_key: "textareaRef",
|
|
337
|
-
ref:
|
|
338
|
-
"onUpdate:modelValue":
|
|
338
|
+
ref: m,
|
|
339
|
+
"onUpdate:modelValue": A[0] || (A[0] = (h) => C.value = h),
|
|
339
340
|
placeholder: n.placeholder,
|
|
340
341
|
disabled: n.disabled,
|
|
341
342
|
readonly: n.readonly,
|
|
342
343
|
maxlength: n.maxlength,
|
|
343
344
|
minlength: n.minlength,
|
|
344
345
|
rows: n.rows,
|
|
345
|
-
style:
|
|
346
|
-
class: u(s(
|
|
347
|
-
onInput:
|
|
348
|
-
onChange:
|
|
349
|
-
onFocus:
|
|
350
|
-
onBlur:
|
|
351
|
-
}, null, 46,
|
|
352
|
-
[
|
|
346
|
+
style: ne(P.value),
|
|
347
|
+
class: u(s(l).e("inner")),
|
|
348
|
+
onInput: V,
|
|
349
|
+
onChange: $,
|
|
350
|
+
onFocus: F,
|
|
351
|
+
onBlur: v
|
|
352
|
+
}, null, 46, We), [
|
|
353
|
+
[be, C.value]
|
|
353
354
|
]),
|
|
354
|
-
n.showWordLimit && n.maxlength ? (
|
|
355
|
+
n.showWordLimit && n.maxlength ? (r(), c("span", {
|
|
355
356
|
key: 0,
|
|
356
|
-
class: u(s(
|
|
357
|
-
}, z(
|
|
357
|
+
class: u(s(l).e("count"))
|
|
358
|
+
}, z(x.value) + "/" + z(n.maxlength), 3)) : O("", !0)
|
|
358
359
|
], 6));
|
|
359
360
|
}
|
|
360
|
-
}),
|
|
361
|
+
}), Dl = /* @__PURE__ */ Q({
|
|
361
362
|
name: "XSwitch",
|
|
362
363
|
__name: "index",
|
|
363
364
|
props: {
|
|
@@ -370,37 +371,37 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
370
371
|
inactiveValue: { type: [Boolean, Number, String], default: !1 }
|
|
371
372
|
},
|
|
372
373
|
emits: ["update:modelValue", "change"],
|
|
373
|
-
setup(n, { emit:
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
]),
|
|
379
|
-
width: typeof
|
|
374
|
+
setup(n, { emit: g }) {
|
|
375
|
+
const t = n, e = g, a = J("switch"), l = b(() => t.modelValue === t.activeValue), m = b(() => [
|
|
376
|
+
a.b(),
|
|
377
|
+
a.is("disabled", t.disabled),
|
|
378
|
+
a.is("checked", l.value)
|
|
379
|
+
]), p = b(() => ({
|
|
380
|
+
width: typeof t.width == "number" ? `${t.width}px` : t.width,
|
|
380
381
|
height: "20px",
|
|
381
|
-
backgroundColor:
|
|
382
|
-
})),
|
|
383
|
-
if (
|
|
384
|
-
const
|
|
385
|
-
|
|
382
|
+
backgroundColor: l.value ? t.activeColor : t.inactiveColor
|
|
383
|
+
})), C = () => {
|
|
384
|
+
if (t.disabled) return;
|
|
385
|
+
const x = l.value ? t.inactiveValue : t.activeValue;
|
|
386
|
+
e("update:modelValue", x), e("change", x);
|
|
386
387
|
};
|
|
387
|
-
return (
|
|
388
|
-
class: u(
|
|
389
|
-
onClick:
|
|
388
|
+
return (x, P) => (r(), c("span", {
|
|
389
|
+
class: u(m.value),
|
|
390
|
+
onClick: C
|
|
390
391
|
}, [
|
|
391
|
-
|
|
392
|
-
class: u(s(
|
|
393
|
-
style:
|
|
392
|
+
d("span", {
|
|
393
|
+
class: u(s(a).e("core")),
|
|
394
|
+
style: ne(p.value)
|
|
394
395
|
}, null, 6),
|
|
395
|
-
|
|
396
|
+
x.$slots.default ? (r(), c("span", {
|
|
396
397
|
key: 0,
|
|
397
|
-
class: u(s(
|
|
398
|
+
class: u(s(a).e("text"))
|
|
398
399
|
}, [
|
|
399
|
-
|
|
400
|
-
], 2)) :
|
|
400
|
+
ae(x.$slots, "default")
|
|
401
|
+
], 2)) : O("", !0)
|
|
401
402
|
], 2));
|
|
402
403
|
}
|
|
403
|
-
}),
|
|
404
|
+
}), qe = ["checked", "disabled", "name", "value"], $l = /* @__PURE__ */ Q({
|
|
404
405
|
name: "XRadio",
|
|
405
406
|
__name: "index",
|
|
406
407
|
props: {
|
|
@@ -411,40 +412,40 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
411
412
|
name: {}
|
|
412
413
|
},
|
|
413
414
|
emits: ["update:modelValue", "change"],
|
|
414
|
-
setup(n, { emit:
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
]),
|
|
420
|
-
|
|
415
|
+
setup(n, { emit: g }) {
|
|
416
|
+
const t = n, e = g, a = J("radio"), l = Ve("radioGroup", null), m = b(() => !!l), p = b(() => m.value ? l.modelValue.value : t.modelValue), C = b(() => t.value ?? t.label), x = b(() => p.value === C.value), P = b(() => t.disabled || m.value && l.disabled), S = b(() => t.name || (m.value ? l.name : void 0)), V = b(() => [
|
|
417
|
+
a.b(),
|
|
418
|
+
a.is("checked", x.value),
|
|
419
|
+
a.is("disabled", P.value)
|
|
420
|
+
]), $ = () => {
|
|
421
|
+
P.value || (m.value ? l.changeValue(C.value) : (e("update:modelValue", C.value), e("change", C.value)));
|
|
421
422
|
};
|
|
422
|
-
return (
|
|
423
|
-
class: u(
|
|
424
|
-
onClick: ue(
|
|
423
|
+
return (F, v) => (r(), c("label", {
|
|
424
|
+
class: u(V.value),
|
|
425
|
+
onClick: ue($, ["prevent"])
|
|
425
426
|
}, [
|
|
426
|
-
|
|
427
|
-
class: u(s(
|
|
427
|
+
d("span", {
|
|
428
|
+
class: u(s(a).e("input"))
|
|
428
429
|
}, [
|
|
429
|
-
|
|
430
|
+
d("input", {
|
|
430
431
|
type: "radio",
|
|
431
|
-
checked:
|
|
432
|
-
disabled:
|
|
433
|
-
name:
|
|
434
|
-
value:
|
|
435
|
-
}, null, 8,
|
|
432
|
+
checked: x.value,
|
|
433
|
+
disabled: P.value,
|
|
434
|
+
name: S.value,
|
|
435
|
+
value: C.value
|
|
436
|
+
}, null, 8, qe)
|
|
436
437
|
], 2),
|
|
437
|
-
|
|
438
|
+
F.$slots.default || n.label ? (r(), c("span", {
|
|
438
439
|
key: 0,
|
|
439
|
-
class: u(s(
|
|
440
|
+
class: u(s(a).e("label"))
|
|
440
441
|
}, [
|
|
441
|
-
|
|
442
|
-
|
|
442
|
+
ae(F.$slots, "default", {}, () => [
|
|
443
|
+
me(z(n.label), 1)
|
|
443
444
|
])
|
|
444
|
-
], 2)) :
|
|
445
|
+
], 2)) : O("", !0)
|
|
445
446
|
], 2));
|
|
446
447
|
}
|
|
447
|
-
}),
|
|
448
|
+
}), Sl = /* @__PURE__ */ Q({
|
|
448
449
|
name: "XRadioGroup",
|
|
449
450
|
__name: "group",
|
|
450
451
|
props: {
|
|
@@ -453,23 +454,23 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
453
454
|
name: {}
|
|
454
455
|
},
|
|
455
456
|
emits: ["update:modelValue", "change"],
|
|
456
|
-
setup(n, { emit:
|
|
457
|
-
const
|
|
458
|
-
|
|
457
|
+
setup(n, { emit: g }) {
|
|
458
|
+
const t = n, e = g, a = J("radio-group"), l = (m) => {
|
|
459
|
+
e("update:modelValue", m), e("change", m);
|
|
459
460
|
};
|
|
460
|
-
return
|
|
461
|
-
modelValue:
|
|
462
|
-
name:
|
|
463
|
-
disabled:
|
|
464
|
-
changeValue:
|
|
465
|
-
}), (
|
|
466
|
-
class: u(s(
|
|
461
|
+
return Ce("radioGroup", {
|
|
462
|
+
modelValue: b(() => t.modelValue),
|
|
463
|
+
name: t.name || `radio-group-${Date.now()}`,
|
|
464
|
+
disabled: t.disabled,
|
|
465
|
+
changeValue: l
|
|
466
|
+
}), (m, p) => (r(), c("div", {
|
|
467
|
+
class: u(s(a).b()),
|
|
467
468
|
role: "radiogroup"
|
|
468
469
|
}, [
|
|
469
|
-
|
|
470
|
+
ae(m.$slots, "default")
|
|
470
471
|
], 2));
|
|
471
472
|
}
|
|
472
|
-
}), Ge = ["checked", "disabled", "value"],
|
|
473
|
+
}), Ge = ["checked", "disabled", "value"], Ml = /* @__PURE__ */ Q({
|
|
473
474
|
name: "XRadioButton",
|
|
474
475
|
__name: "button",
|
|
475
476
|
props: {
|
|
@@ -479,35 +480,35 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
479
480
|
name: {}
|
|
480
481
|
},
|
|
481
482
|
emits: ["update:modelValue", "change"],
|
|
482
|
-
setup(n, { emit:
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
]),
|
|
488
|
-
|
|
483
|
+
setup(n, { emit: g }) {
|
|
484
|
+
const t = n, e = J("radio-button"), a = Ve("radioGroup", null), l = b(() => !!a), m = b(() => l.value ? a.modelValue.value : null), p = b(() => t.value ?? t.label), C = b(() => m.value === p.value), x = b(() => t.disabled || l.value && a.disabled), P = b(() => [
|
|
485
|
+
e.b(),
|
|
486
|
+
e.is("active", C.value),
|
|
487
|
+
e.is("disabled", x.value)
|
|
488
|
+
]), S = () => {
|
|
489
|
+
x.value || l.value && a.changeValue(p.value);
|
|
489
490
|
};
|
|
490
|
-
return (
|
|
491
|
-
class: u(
|
|
492
|
-
onClick: ue(
|
|
491
|
+
return (V, $) => (r(), c("label", {
|
|
492
|
+
class: u(P.value),
|
|
493
|
+
onClick: ue(S, ["prevent"])
|
|
493
494
|
}, [
|
|
494
|
-
|
|
495
|
+
d("input", {
|
|
495
496
|
type: "radio",
|
|
496
|
-
checked:
|
|
497
|
-
disabled:
|
|
498
|
-
value:
|
|
499
|
-
class: u(s(
|
|
497
|
+
checked: C.value,
|
|
498
|
+
disabled: x.value,
|
|
499
|
+
value: p.value,
|
|
500
|
+
class: u(s(e).e("input"))
|
|
500
501
|
}, null, 10, Ge),
|
|
501
|
-
|
|
502
|
-
class: u(s(
|
|
502
|
+
d("span", {
|
|
503
|
+
class: u(s(e).e("inner"))
|
|
503
504
|
}, [
|
|
504
|
-
|
|
505
|
-
|
|
505
|
+
ae(V.$slots, "default", {}, () => [
|
|
506
|
+
me(z(n.label), 1)
|
|
506
507
|
])
|
|
507
508
|
], 2)
|
|
508
509
|
], 2));
|
|
509
510
|
}
|
|
510
|
-
}),
|
|
511
|
+
}), je = ["checked", "disabled", "name", "value"], Tl = /* @__PURE__ */ Q({
|
|
511
512
|
name: "XCheckbox",
|
|
512
513
|
__name: "index",
|
|
513
514
|
props: {
|
|
@@ -519,59 +520,59 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
519
520
|
indeterminate: { type: Boolean }
|
|
520
521
|
},
|
|
521
522
|
emits: ["update:modelValue", "change"],
|
|
522
|
-
setup(n, { emit:
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
if (
|
|
526
|
-
const
|
|
527
|
-
return
|
|
523
|
+
setup(n, { emit: g }) {
|
|
524
|
+
const t = n, e = g, a = J("checkbox"), l = Ve("checkboxGroup", null), m = b(() => !!l), p = b(() => t.value ?? t.label), C = b(() => m.value ? l.modelValue.value.includes(p.value) : Array.isArray(t.modelValue) ? t.modelValue.includes(p.value) : !!t.modelValue), x = b(() => {
|
|
525
|
+
if (t.disabled) return !0;
|
|
526
|
+
if (m.value) {
|
|
527
|
+
const V = l.disabled, $ = l.min > 0 && l.modelValue.value.length <= l.min, F = l.max > 0 && l.modelValue.value.length >= l.max;
|
|
528
|
+
return C.value && $ || !C.value && F ? !0 : V;
|
|
528
529
|
}
|
|
529
530
|
return !1;
|
|
530
|
-
}),
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
]),
|
|
536
|
-
if (!
|
|
537
|
-
if (
|
|
538
|
-
|
|
531
|
+
}), P = b(() => [
|
|
532
|
+
a.b(),
|
|
533
|
+
a.is("checked", C.value),
|
|
534
|
+
a.is("disabled", x.value),
|
|
535
|
+
a.is("indeterminate", t.indeterminate && !C.value)
|
|
536
|
+
]), S = () => {
|
|
537
|
+
if (!x.value)
|
|
538
|
+
if (m.value)
|
|
539
|
+
l.changeValue(p.value);
|
|
539
540
|
else {
|
|
540
|
-
let
|
|
541
|
-
if (Array.isArray(
|
|
542
|
-
const
|
|
543
|
-
|
|
541
|
+
let V;
|
|
542
|
+
if (Array.isArray(t.modelValue)) {
|
|
543
|
+
const $ = t.modelValue.indexOf(p.value);
|
|
544
|
+
$ > -1 ? V = [...t.modelValue.slice(0, $), ...t.modelValue.slice($ + 1)] : V = [...t.modelValue, p.value];
|
|
544
545
|
} else
|
|
545
|
-
|
|
546
|
-
|
|
546
|
+
V = !t.modelValue;
|
|
547
|
+
e("update:modelValue", V), e("change", V);
|
|
547
548
|
}
|
|
548
549
|
};
|
|
549
|
-
return (
|
|
550
|
-
class: u(
|
|
551
|
-
onClick: ue(
|
|
550
|
+
return (V, $) => (r(), c("label", {
|
|
551
|
+
class: u(P.value),
|
|
552
|
+
onClick: ue(S, ["prevent"])
|
|
552
553
|
}, [
|
|
553
|
-
|
|
554
|
-
class: u(s(
|
|
554
|
+
d("span", {
|
|
555
|
+
class: u(s(a).e("input"))
|
|
555
556
|
}, [
|
|
556
|
-
|
|
557
|
+
d("input", {
|
|
557
558
|
type: "checkbox",
|
|
558
|
-
checked:
|
|
559
|
-
disabled:
|
|
559
|
+
checked: C.value,
|
|
560
|
+
disabled: x.value,
|
|
560
561
|
name: n.name,
|
|
561
|
-
value:
|
|
562
|
-
}, null, 8,
|
|
562
|
+
value: p.value
|
|
563
|
+
}, null, 8, je)
|
|
563
564
|
], 2),
|
|
564
|
-
|
|
565
|
+
V.$slots.default || n.label !== void 0 ? (r(), c("span", {
|
|
565
566
|
key: 0,
|
|
566
|
-
class: u(s(
|
|
567
|
+
class: u(s(a).e("label"))
|
|
567
568
|
}, [
|
|
568
|
-
|
|
569
|
-
|
|
569
|
+
ae(V.$slots, "default", {}, () => [
|
|
570
|
+
me(z(n.label), 1)
|
|
570
571
|
])
|
|
571
|
-
], 2)) :
|
|
572
|
+
], 2)) : O("", !0)
|
|
572
573
|
], 2));
|
|
573
574
|
}
|
|
574
|
-
}),
|
|
575
|
+
}), Rl = /* @__PURE__ */ Q({
|
|
575
576
|
name: "XCheckboxGroup",
|
|
576
577
|
__name: "group",
|
|
577
578
|
props: {
|
|
@@ -581,25 +582,25 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
581
582
|
max: { default: 0 }
|
|
582
583
|
},
|
|
583
584
|
emits: ["update:modelValue", "change"],
|
|
584
|
-
setup(n, { emit:
|
|
585
|
-
const
|
|
586
|
-
const
|
|
587
|
-
|
|
585
|
+
setup(n, { emit: g }) {
|
|
586
|
+
const t = n, e = g, a = J("checkbox-group"), l = (m) => {
|
|
587
|
+
const p = [...t.modelValue], C = p.indexOf(m);
|
|
588
|
+
C > -1 ? p.splice(C, 1) : p.push(m), e("update:modelValue", p), e("change", p);
|
|
588
589
|
};
|
|
589
|
-
return
|
|
590
|
-
modelValue:
|
|
591
|
-
disabled:
|
|
592
|
-
min:
|
|
593
|
-
max:
|
|
594
|
-
changeValue:
|
|
595
|
-
}), (
|
|
596
|
-
class: u(s(
|
|
590
|
+
return Ce("checkboxGroup", {
|
|
591
|
+
modelValue: b(() => t.modelValue),
|
|
592
|
+
disabled: t.disabled,
|
|
593
|
+
min: t.min,
|
|
594
|
+
max: t.max,
|
|
595
|
+
changeValue: l
|
|
596
|
+
}), (m, p) => (r(), c("div", {
|
|
597
|
+
class: u(s(a).b()),
|
|
597
598
|
role: "group"
|
|
598
599
|
}, [
|
|
599
|
-
|
|
600
|
+
ae(m.$slots, "default")
|
|
600
601
|
], 2));
|
|
601
602
|
}
|
|
602
|
-
}),
|
|
603
|
+
}), Bl = /* @__PURE__ */ Q({
|
|
603
604
|
name: "XForm",
|
|
604
605
|
__name: "index",
|
|
605
606
|
props: {
|
|
@@ -613,72 +614,72 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
613
614
|
size: { default: "default" }
|
|
614
615
|
},
|
|
615
616
|
emits: ["validate", "submit", "reset"],
|
|
616
|
-
setup(n, { expose:
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
]),
|
|
623
|
-
|
|
624
|
-
},
|
|
625
|
-
const
|
|
626
|
-
|
|
627
|
-
},
|
|
628
|
-
let
|
|
629
|
-
for (const
|
|
630
|
-
await
|
|
631
|
-
return
|
|
632
|
-
},
|
|
633
|
-
const
|
|
634
|
-
let
|
|
635
|
-
for (const
|
|
636
|
-
|
|
637
|
-
return
|
|
638
|
-
},
|
|
639
|
-
|
|
640
|
-
|
|
617
|
+
setup(n, { expose: g, emit: t }) {
|
|
618
|
+
const e = n, a = t, l = J("form"), m = E([]), p = b(() => e.layout === "inline" || e.inline), C = b(() => e.layout === "vertical" || e.labelPosition === "top"), x = b(() => [
|
|
619
|
+
l.b(),
|
|
620
|
+
l.m(`label-${C.value ? "top" : e.labelPosition}`),
|
|
621
|
+
l.is("inline", p.value),
|
|
622
|
+
l.is("vertical", C.value)
|
|
623
|
+
]), P = b(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })), S = (h) => {
|
|
624
|
+
m.value.push(h);
|
|
625
|
+
}, V = (h) => {
|
|
626
|
+
const f = m.value.indexOf(h);
|
|
627
|
+
f > -1 && m.value.splice(f, 1);
|
|
628
|
+
}, $ = async () => {
|
|
629
|
+
let h = !0;
|
|
630
|
+
for (const f of m.value)
|
|
631
|
+
await f.validate() || (h = !1);
|
|
632
|
+
return h;
|
|
633
|
+
}, F = async (h) => {
|
|
634
|
+
const f = Array.isArray(h) ? h : [h];
|
|
635
|
+
let k = !0;
|
|
636
|
+
for (const N of m.value)
|
|
637
|
+
f.includes(N.prop) && (await N.validate() || (k = !1));
|
|
638
|
+
return k;
|
|
639
|
+
}, v = () => {
|
|
640
|
+
m.value.forEach((h) => {
|
|
641
|
+
h.resetField();
|
|
641
642
|
});
|
|
642
|
-
},
|
|
643
|
-
if (
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
|
|
643
|
+
}, D = (h) => {
|
|
644
|
+
if (h) {
|
|
645
|
+
const f = Array.isArray(h) ? h : [h];
|
|
646
|
+
m.value.forEach((k) => {
|
|
647
|
+
f.includes(k.prop) && k.clearValidate();
|
|
647
648
|
});
|
|
648
649
|
} else
|
|
649
|
-
|
|
650
|
-
|
|
650
|
+
m.value.forEach((f) => {
|
|
651
|
+
f.clearValidate();
|
|
651
652
|
});
|
|
652
|
-
}, M = (
|
|
653
|
-
console.log("[XForm] handleSubmit triggered",
|
|
654
|
-
},
|
|
655
|
-
console.log("[XForm] handleReset triggered",
|
|
656
|
-
},
|
|
657
|
-
return
|
|
658
|
-
model:
|
|
659
|
-
rules:
|
|
660
|
-
labelWidth:
|
|
661
|
-
labelPosition:
|
|
662
|
-
disabled:
|
|
663
|
-
size:
|
|
664
|
-
labelStyle:
|
|
665
|
-
addField:
|
|
666
|
-
removeField:
|
|
667
|
-
emit:
|
|
668
|
-
}),
|
|
669
|
-
validate:
|
|
670
|
-
validateField:
|
|
671
|
-
resetFields:
|
|
672
|
-
clearValidate:
|
|
673
|
-
}), (
|
|
674
|
-
class: u(
|
|
653
|
+
}, M = (h) => {
|
|
654
|
+
console.log("[XForm] handleSubmit triggered", h), h.preventDefault(), a("submit");
|
|
655
|
+
}, R = (h) => {
|
|
656
|
+
console.log("[XForm] handleReset triggered", h), h.preventDefault(), v(), a("reset");
|
|
657
|
+
}, A = Oe(e, "model");
|
|
658
|
+
return Ce("form", {
|
|
659
|
+
model: A,
|
|
660
|
+
rules: e.rules,
|
|
661
|
+
labelWidth: e.labelWidth,
|
|
662
|
+
labelPosition: C.value ? "top" : e.labelPosition,
|
|
663
|
+
disabled: e.disabled,
|
|
664
|
+
size: e.size,
|
|
665
|
+
labelStyle: P,
|
|
666
|
+
addField: S,
|
|
667
|
+
removeField: V,
|
|
668
|
+
emit: a
|
|
669
|
+
}), g({
|
|
670
|
+
validate: $,
|
|
671
|
+
validateField: F,
|
|
672
|
+
resetFields: v,
|
|
673
|
+
clearValidate: D
|
|
674
|
+
}), (h, f) => (r(), c("form", {
|
|
675
|
+
class: u(x.value),
|
|
675
676
|
onSubmit: M,
|
|
676
|
-
onReset:
|
|
677
|
+
onReset: R
|
|
677
678
|
}, [
|
|
678
|
-
|
|
679
|
+
ae(h.$slots, "default")
|
|
679
680
|
], 34));
|
|
680
681
|
}
|
|
681
|
-
}),
|
|
682
|
+
}), Fl = /* @__PURE__ */ Q({
|
|
682
683
|
name: "XFormItem",
|
|
683
684
|
__name: "item",
|
|
684
685
|
props: {
|
|
@@ -689,185 +690,186 @@ const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
689
690
|
rules: {},
|
|
690
691
|
showMessage: { type: Boolean }
|
|
691
692
|
},
|
|
692
|
-
setup(n, { expose:
|
|
693
|
-
const
|
|
694
|
-
const
|
|
695
|
-
return
|
|
696
|
-
},
|
|
697
|
-
var
|
|
698
|
-
if (!(!
|
|
699
|
-
return (
|
|
700
|
-
},
|
|
701
|
-
!
|
|
702
|
-
},
|
|
703
|
-
const M =
|
|
693
|
+
setup(n, { expose: g }) {
|
|
694
|
+
const t = n, e = J("form-item"), a = Ve("form", null), l = E(""), m = E(""), p = b(() => t.required ? !0 : C().some((M) => M.required)), C = () => {
|
|
695
|
+
const D = [];
|
|
696
|
+
return t.rules && D.push(...t.rules), a && t.prop && a.rules[t.prop] && D.push(...a.rules[t.prop]), D;
|
|
697
|
+
}, x = () => {
|
|
698
|
+
var D;
|
|
699
|
+
if (!(!a || !t.prop))
|
|
700
|
+
return (D = a.model.value) == null ? void 0 : D[t.prop];
|
|
701
|
+
}, P = (D) => {
|
|
702
|
+
!a || !t.prop || a.model.value && (a.model.value[t.prop] = D);
|
|
703
|
+
}, S = async (D) => {
|
|
704
|
+
const M = C();
|
|
704
705
|
if (M.length === 0)
|
|
705
|
-
return
|
|
706
|
-
const
|
|
707
|
-
let
|
|
708
|
-
for (const
|
|
709
|
-
if (!(
|
|
710
|
-
if (
|
|
711
|
-
|
|
706
|
+
return l.value = "valid", !0;
|
|
707
|
+
const R = x();
|
|
708
|
+
let A = !0, h = "";
|
|
709
|
+
for (const f of M)
|
|
710
|
+
if (!(D && f.trigger && f.trigger !== D)) {
|
|
711
|
+
if (f.required && (R == null || R === "" || Array.isArray(R) && R.length === 0)) {
|
|
712
|
+
A = !1, h = f.message || "该字段为必填项";
|
|
712
713
|
break;
|
|
713
714
|
}
|
|
714
|
-
if (
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
717
|
-
|
|
715
|
+
if (f.min !== void 0 || f.max !== void 0) {
|
|
716
|
+
const k = typeof R == "string" ? R.length : 0;
|
|
717
|
+
if (f.min !== void 0 && k < f.min) {
|
|
718
|
+
A = !1, h = f.message || `长度不能小于 ${f.min} 个字符`;
|
|
718
719
|
break;
|
|
719
720
|
}
|
|
720
|
-
if (
|
|
721
|
-
|
|
721
|
+
if (f.max !== void 0 && k > f.max) {
|
|
722
|
+
A = !1, h = f.message || `长度不能大于 ${f.max} 个字符`;
|
|
722
723
|
break;
|
|
723
724
|
}
|
|
724
725
|
}
|
|
725
|
-
if (
|
|
726
|
-
|
|
726
|
+
if (f.pattern && R && !f.pattern.test(R)) {
|
|
727
|
+
A = !1, h = f.message || "格式不正确";
|
|
727
728
|
break;
|
|
728
729
|
}
|
|
729
|
-
if (
|
|
730
|
+
if (f.validator)
|
|
730
731
|
try {
|
|
731
|
-
await new Promise((
|
|
732
|
-
|
|
733
|
-
|
|
732
|
+
await new Promise((k, N) => {
|
|
733
|
+
f.validator(f, R, (K) => {
|
|
734
|
+
K ? N(K) : k();
|
|
734
735
|
});
|
|
735
736
|
});
|
|
736
|
-
} catch (
|
|
737
|
-
|
|
737
|
+
} catch (k) {
|
|
738
|
+
A = !1, h = k.message || f.message || "验证失败";
|
|
738
739
|
break;
|
|
739
740
|
}
|
|
740
741
|
}
|
|
741
|
-
return
|
|
742
|
-
},
|
|
743
|
-
|
|
744
|
-
},
|
|
745
|
-
|
|
746
|
-
},
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
]),
|
|
752
|
-
const
|
|
753
|
-
return { width: typeof
|
|
742
|
+
return l.value = A ? "valid" : "invalid", m.value = h, a && t.prop && a.emit("validate", t.prop, A, h), A;
|
|
743
|
+
}, V = () => {
|
|
744
|
+
P(void 0), $();
|
|
745
|
+
}, $ = () => {
|
|
746
|
+
l.value = "", m.value = "";
|
|
747
|
+
}, F = b(() => [
|
|
748
|
+
e.b(),
|
|
749
|
+
e.is("required", p.value),
|
|
750
|
+
e.is("error", l.value === "invalid"),
|
|
751
|
+
e.is("success", l.value === "valid")
|
|
752
|
+
]), v = b(() => {
|
|
753
|
+
const D = t.labelWidth ?? (a == null ? void 0 : a.labelWidth) ?? "100px";
|
|
754
|
+
return { width: typeof D == "number" ? `${D}px` : D };
|
|
754
755
|
});
|
|
755
|
-
return
|
|
756
|
-
|
|
757
|
-
}), ye(() => {
|
|
758
|
-
l && e.prop && l.addField({
|
|
759
|
-
prop: e.prop,
|
|
760
|
-
validate: D,
|
|
761
|
-
resetField: x,
|
|
762
|
-
clearValidate: C
|
|
763
|
-
});
|
|
756
|
+
return de(() => x(), () => {
|
|
757
|
+
l.value === "invalid" && S("change");
|
|
764
758
|
}), ke(() => {
|
|
765
|
-
|
|
766
|
-
prop:
|
|
767
|
-
validate:
|
|
768
|
-
resetField:
|
|
769
|
-
clearValidate:
|
|
759
|
+
a && t.prop && a.addField({
|
|
760
|
+
prop: t.prop,
|
|
761
|
+
validate: S,
|
|
762
|
+
resetField: V,
|
|
763
|
+
clearValidate: $
|
|
764
|
+
});
|
|
765
|
+
}), xe(() => {
|
|
766
|
+
a && t.prop && a.removeField({
|
|
767
|
+
prop: t.prop,
|
|
768
|
+
validate: S,
|
|
769
|
+
resetField: V,
|
|
770
|
+
clearValidate: $
|
|
770
771
|
});
|
|
771
|
-
}),
|
|
772
|
-
validate:
|
|
773
|
-
resetField:
|
|
774
|
-
clearValidate:
|
|
775
|
-
}), (
|
|
776
|
-
class: u(
|
|
772
|
+
}), g({
|
|
773
|
+
validate: S,
|
|
774
|
+
resetField: V,
|
|
775
|
+
clearValidate: $
|
|
776
|
+
}), (D, M) => (r(), c("div", {
|
|
777
|
+
class: u(F.value)
|
|
777
778
|
}, [
|
|
778
|
-
n.label ? (
|
|
779
|
+
n.label ? (r(), c("label", {
|
|
779
780
|
key: 0,
|
|
780
|
-
class: u(s(
|
|
781
|
-
style:
|
|
782
|
-
}, z(n.label), 7)) :
|
|
783
|
-
|
|
784
|
-
class: u(s(
|
|
781
|
+
class: u(s(e).e("label")),
|
|
782
|
+
style: ne(v.value)
|
|
783
|
+
}, z(n.label), 7)) : O("", !0),
|
|
784
|
+
d("div", {
|
|
785
|
+
class: u(s(e).e("content"))
|
|
785
786
|
}, [
|
|
786
|
-
|
|
787
|
-
n.showMessage !== !1 &&
|
|
787
|
+
ae(D.$slots, "default"),
|
|
788
|
+
n.showMessage !== !1 && l.value === "invalid" ? (r(), c("div", {
|
|
788
789
|
key: 0,
|
|
789
|
-
class: u(s(
|
|
790
|
-
}, z(
|
|
790
|
+
class: u(s(e).e("error"))
|
|
791
|
+
}, z(m.value), 3)) : O("", !0)
|
|
791
792
|
], 2)
|
|
792
793
|
], 2));
|
|
793
794
|
}
|
|
794
795
|
});
|
|
795
|
-
function
|
|
796
|
-
return new Date(n,
|
|
796
|
+
function Ze(n, g) {
|
|
797
|
+
return new Date(n, g + 1, 0).getDate();
|
|
797
798
|
}
|
|
798
|
-
function
|
|
799
|
-
return new Date(n,
|
|
799
|
+
function Qe(n, g) {
|
|
800
|
+
return new Date(n, g, 1).getDay();
|
|
800
801
|
}
|
|
801
|
-
function
|
|
802
|
-
return !n || !
|
|
802
|
+
function fe(n, g) {
|
|
803
|
+
return !n || !g ? !1 : n.getFullYear() === g.getFullYear() && n.getMonth() === g.getMonth() && n.getDate() === g.getDate();
|
|
803
804
|
}
|
|
804
|
-
function
|
|
805
|
-
return !n || !
|
|
805
|
+
function Je(n, g) {
|
|
806
|
+
return !n || !g ? !1 : n.getFullYear() === g.getFullYear() && n.getMonth() === g.getMonth();
|
|
806
807
|
}
|
|
807
|
-
function
|
|
808
|
-
if (!
|
|
809
|
-
const
|
|
810
|
-
return
|
|
808
|
+
function Ae(n, g, t) {
|
|
809
|
+
if (!g || !t) return !1;
|
|
810
|
+
const e = n.getTime();
|
|
811
|
+
return e >= g.getTime() && e <= t.getTime();
|
|
811
812
|
}
|
|
812
|
-
function
|
|
813
|
-
const
|
|
814
|
-
let
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
let
|
|
818
|
-
for (; (
|
|
813
|
+
function _e(n, g, t = 0) {
|
|
814
|
+
const e = [], a = Ze(n, g), l = Qe(n, g);
|
|
815
|
+
let m = new Date(n, g, 1);
|
|
816
|
+
const p = (l - t + 7) % 7;
|
|
817
|
+
m.setDate(1 - p);
|
|
818
|
+
let C = [], x = new Date(m);
|
|
819
|
+
for (; (x.getMonth() <= g || x.getMonth() === g && x.getDate() <= a) && (C.push(new Date(x)), !(C.length === 7 && (e.push(C), C = [], x.getMonth() > g) || (x.setDate(x.getDate() + 1), e.length > 7))); )
|
|
819
820
|
;
|
|
820
|
-
return
|
|
821
|
+
return C.length > 0 && e.push(C), e;
|
|
821
822
|
}
|
|
822
|
-
function
|
|
823
|
+
function ve(n, g = "YYYY-MM-DD") {
|
|
823
824
|
if (!n) return "";
|
|
824
|
-
const
|
|
825
|
-
return
|
|
825
|
+
const t = n.getFullYear(), e = n.getMonth() + 1, a = n.getDate(), l = n.getHours(), m = n.getMinutes(), p = n.getSeconds();
|
|
826
|
+
return g.replace(/YYYY/g, String(t)).replace(/YY/g, String(t).slice(-2)).replace(/MM/g, String(e).padStart(2, "0")).replace(/M/g, String(e)).replace(/DD/g, String(a).padStart(2, "0")).replace(/D/g, String(a)).replace(/HH/g, String(l).padStart(2, "0")).replace(/H/g, String(l)).replace(/mm/g, String(m).padStart(2, "0")).replace(/m/g, String(m)).replace(/ss/g, String(p).padStart(2, "0")).replace(/s/g, String(p));
|
|
826
827
|
}
|
|
827
|
-
function
|
|
828
|
-
if (!n) return null;
|
|
828
|
+
function ie(n) {
|
|
829
|
+
if (!n || Array.isArray(n)) return null;
|
|
829
830
|
if (n instanceof Date)
|
|
830
831
|
return isNaN(n.getTime()) ? null : n;
|
|
831
832
|
if (typeof n == "number")
|
|
832
833
|
return new Date(n);
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
834
|
+
if (typeof n != "string") return null;
|
|
835
|
+
const g = new Date(n);
|
|
836
|
+
if (isNaN(g.getTime())) {
|
|
837
|
+
const t = n.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);
|
|
838
|
+
return t ? new Date(parseInt(t[1]), parseInt(t[2]) - 1, parseInt(t[3])) : null;
|
|
837
839
|
}
|
|
838
|
-
return
|
|
839
|
-
}
|
|
840
|
-
function _e(n) {
|
|
841
|
-
const p = new Date(n);
|
|
842
|
-
return p.setMonth(p.getMonth() - 1), p;
|
|
840
|
+
return g;
|
|
843
841
|
}
|
|
844
842
|
function et(n) {
|
|
845
|
-
const
|
|
846
|
-
return
|
|
843
|
+
const g = new Date(n);
|
|
844
|
+
return g.setMonth(g.getMonth() - 1), g;
|
|
847
845
|
}
|
|
848
846
|
function tt(n) {
|
|
849
|
-
const
|
|
850
|
-
return
|
|
847
|
+
const g = new Date(n);
|
|
848
|
+
return g.setMonth(g.getMonth() + 1), g;
|
|
851
849
|
}
|
|
852
850
|
function lt(n) {
|
|
853
|
-
const
|
|
854
|
-
return
|
|
851
|
+
const g = new Date(n);
|
|
852
|
+
return g.setFullYear(g.getFullYear() - 1), g;
|
|
853
|
+
}
|
|
854
|
+
function at(n) {
|
|
855
|
+
const g = new Date(n);
|
|
856
|
+
return g.setFullYear(g.getFullYear() + 1), g;
|
|
855
857
|
}
|
|
856
|
-
function
|
|
857
|
-
const
|
|
858
|
-
return [
|
|
858
|
+
function Ye(n) {
|
|
859
|
+
const g = Math.floor(n / 10) * 10;
|
|
860
|
+
return [g, g + 9];
|
|
859
861
|
}
|
|
860
862
|
function Se(n) {
|
|
861
|
-
const
|
|
862
|
-
return
|
|
863
|
+
const g = new Date(n);
|
|
864
|
+
return g.setHours(0, 0, 0, 0), g;
|
|
863
865
|
}
|
|
864
|
-
function
|
|
865
|
-
if (
|
|
866
|
+
function nt(n, g, t, e) {
|
|
867
|
+
if (g && g(n))
|
|
866
868
|
return !0;
|
|
867
|
-
const
|
|
868
|
-
return !!(
|
|
869
|
+
const a = Se(n).getTime();
|
|
870
|
+
return !!(t && a < Se(t).getTime() || e && a > Se(e).getTime());
|
|
869
871
|
}
|
|
870
|
-
const
|
|
872
|
+
const st = [
|
|
871
873
|
"一月",
|
|
872
874
|
"二月",
|
|
873
875
|
"三月",
|
|
@@ -880,7 +882,7 @@ const nt = [
|
|
|
880
882
|
"十月",
|
|
881
883
|
"十一月",
|
|
882
884
|
"十二月"
|
|
883
|
-
],
|
|
885
|
+
], ut = ["日", "一", "二", "三", "四", "五", "六"], ot = ["onClick", "onMouseenter"], rt = /* @__PURE__ */ Q({
|
|
884
886
|
name: "XDateTable",
|
|
885
887
|
__name: "DateTable",
|
|
886
888
|
props: {
|
|
@@ -897,79 +899,79 @@ const nt = [
|
|
|
897
899
|
selectionMode: { default: "single" }
|
|
898
900
|
},
|
|
899
901
|
emits: ["pick", "range-select", "range-move", "update:viewedMonth"],
|
|
900
|
-
setup(n, { emit:
|
|
901
|
-
const
|
|
902
|
-
if (
|
|
903
|
-
const { startDate:
|
|
904
|
-
if (
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
907
|
-
const
|
|
908
|
-
return
|
|
902
|
+
setup(n, { emit: g }) {
|
|
903
|
+
const t = n, e = g, a = J("date-table"), l = E(null), m = b(() => t.viewedMonth.getFullYear()), p = b(() => t.viewedMonth.getMonth()), C = b(() => _e(m.value, p.value, 0)), x = (h) => t.modelValue ? fe(h, t.modelValue) : !1, P = (h) => fe(h, /* @__PURE__ */ new Date()), S = (h) => Je(h, t.viewedMonth), V = (h) => {
|
|
904
|
+
if (t.selectionMode !== "range") return !1;
|
|
905
|
+
const { startDate: f, endDate: k, selecting: N } = t.rangeState || {};
|
|
906
|
+
if (N && f) {
|
|
907
|
+
const K = l.value;
|
|
908
|
+
if (K) {
|
|
909
|
+
const j = f < K ? f : K, ee = f < K ? K : f;
|
|
910
|
+
return Ae(h, j, ee);
|
|
909
911
|
}
|
|
910
|
-
return
|
|
912
|
+
return fe(h, f);
|
|
911
913
|
}
|
|
912
|
-
return
|
|
913
|
-
},
|
|
914
|
-
if (
|
|
915
|
-
const { startDate:
|
|
916
|
-
return
|
|
917
|
-
},
|
|
918
|
-
if (
|
|
919
|
-
const { endDate:
|
|
920
|
-
if (
|
|
921
|
-
const { startDate:
|
|
922
|
-
return
|
|
914
|
+
return f && k ? Ae(h, f, k) : !1;
|
|
915
|
+
}, $ = (h) => {
|
|
916
|
+
if (t.selectionMode !== "range") return !1;
|
|
917
|
+
const { startDate: f, selecting: k } = t.rangeState || {};
|
|
918
|
+
return k && f && l.value ? fe(h, f < l.value ? f : l.value) : f ? fe(h, f) : !1;
|
|
919
|
+
}, F = (h) => {
|
|
920
|
+
if (t.selectionMode !== "range") return !1;
|
|
921
|
+
const { endDate: f, selecting: k } = t.rangeState || {};
|
|
922
|
+
if (k && l.value) {
|
|
923
|
+
const { startDate: N } = t.rangeState || {};
|
|
924
|
+
return fe(h, N < l.value ? l.value : N);
|
|
923
925
|
}
|
|
924
|
-
return
|
|
925
|
-
},
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
], M = (
|
|
936
|
-
|
|
937
|
-
},
|
|
938
|
-
|
|
939
|
-
},
|
|
940
|
-
|
|
926
|
+
return f ? fe(h, f) : !1;
|
|
927
|
+
}, v = (h) => nt(h, t.disabledDate, t.minDate, t.maxDate), D = (h) => [
|
|
928
|
+
a.e("cell"),
|
|
929
|
+
a.is("selected", x(h)),
|
|
930
|
+
a.is("today", P(h)),
|
|
931
|
+
a.is("disabled", v(h)),
|
|
932
|
+
a.is("in-range", V(h)),
|
|
933
|
+
a.is("range-start", $(h)),
|
|
934
|
+
a.is("range-end", F(h)),
|
|
935
|
+
a.is("prev-month", !S(h) && h.getMonth() < p.value),
|
|
936
|
+
a.is("next-month", !S(h) && h.getMonth() > p.value)
|
|
937
|
+
], M = (h) => {
|
|
938
|
+
v(h) || (t.selectionMode === "range" ? e("range-select", h) : e("pick", h));
|
|
939
|
+
}, R = (h) => {
|
|
940
|
+
l.value = h;
|
|
941
|
+
}, A = () => {
|
|
942
|
+
l.value = null;
|
|
941
943
|
};
|
|
942
|
-
return (
|
|
943
|
-
class: u(s(
|
|
944
|
+
return (h, f) => (r(), c("table", {
|
|
945
|
+
class: u(s(a).b()),
|
|
944
946
|
cellspacing: "0",
|
|
945
947
|
cellpadding: "0"
|
|
946
948
|
}, [
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
(
|
|
950
|
-
key:
|
|
951
|
-
class: u(s(
|
|
952
|
-
}, z(
|
|
949
|
+
d("thead", null, [
|
|
950
|
+
d("tr", null, [
|
|
951
|
+
(r(!0), c(G, null, Z(s(ut), (k) => (r(), c("th", {
|
|
952
|
+
key: k,
|
|
953
|
+
class: u(s(a).e("header-cell"))
|
|
954
|
+
}, z(k), 3))), 128))
|
|
953
955
|
])
|
|
954
956
|
]),
|
|
955
|
-
|
|
956
|
-
(
|
|
957
|
-
(
|
|
958
|
-
key:
|
|
959
|
-
class: u(
|
|
960
|
-
onClick: (
|
|
961
|
-
onMouseenter: (
|
|
962
|
-
onMouseleave:
|
|
957
|
+
d("tbody", null, [
|
|
958
|
+
(r(!0), c(G, null, Z(C.value, (k, N) => (r(), c("tr", { key: N }, [
|
|
959
|
+
(r(!0), c(G, null, Z(k, (K, j) => (r(), c("td", {
|
|
960
|
+
key: j,
|
|
961
|
+
class: u(D(K)),
|
|
962
|
+
onClick: (ee) => M(K),
|
|
963
|
+
onMouseenter: (ee) => R(K),
|
|
964
|
+
onMouseleave: A
|
|
963
965
|
}, [
|
|
964
|
-
|
|
965
|
-
class: u(s(
|
|
966
|
-
}, z(
|
|
967
|
-
], 42,
|
|
966
|
+
d("span", {
|
|
967
|
+
class: u(s(a).e("cell-text"))
|
|
968
|
+
}, z(K.getDate()), 3)
|
|
969
|
+
], 42, ot))), 128))
|
|
968
970
|
]))), 128))
|
|
969
971
|
])
|
|
970
972
|
], 2));
|
|
971
973
|
}
|
|
972
|
-
}),
|
|
974
|
+
}), it = ["onClick"], dt = /* @__PURE__ */ Q({
|
|
973
975
|
name: "XMonthTable",
|
|
974
976
|
__name: "MonthTable",
|
|
975
977
|
props: {
|
|
@@ -978,50 +980,50 @@ const nt = [
|
|
|
978
980
|
disabledDate: {}
|
|
979
981
|
},
|
|
980
982
|
emits: ["pick"],
|
|
981
|
-
setup(n, { emit:
|
|
982
|
-
const
|
|
983
|
-
|
|
984
|
-
const
|
|
985
|
-
const
|
|
986
|
-
return
|
|
987
|
-
},
|
|
988
|
-
if (!
|
|
989
|
-
const
|
|
990
|
-
return
|
|
991
|
-
},
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
],
|
|
997
|
-
|
|
998
|
-
},
|
|
999
|
-
const
|
|
1000
|
-
for (let
|
|
1001
|
-
|
|
1002
|
-
return
|
|
983
|
+
setup(n, { emit: g }) {
|
|
984
|
+
const t = n, e = g, a = J("month-table");
|
|
985
|
+
b(() => t.modelValue ? t.modelValue.getMonth() : -1);
|
|
986
|
+
const l = (S) => t.modelValue ? t.modelValue.getFullYear() === t.viewedYear && t.modelValue.getMonth() === S : !1, m = (S) => {
|
|
987
|
+
const V = /* @__PURE__ */ new Date();
|
|
988
|
+
return V.getFullYear() === t.viewedYear && V.getMonth() === S;
|
|
989
|
+
}, p = (S) => {
|
|
990
|
+
if (!t.disabledDate) return !1;
|
|
991
|
+
const V = new Date(t.viewedYear, S, 1), $ = new Date(t.viewedYear, S + 1, 0);
|
|
992
|
+
return t.disabledDate(V) && t.disabledDate($);
|
|
993
|
+
}, C = (S) => [
|
|
994
|
+
a.e("cell"),
|
|
995
|
+
a.is("selected", l(S)),
|
|
996
|
+
a.is("current", m(S)),
|
|
997
|
+
a.is("disabled", p(S))
|
|
998
|
+
], x = (S) => {
|
|
999
|
+
p(S) || e("pick", S);
|
|
1000
|
+
}, P = b(() => {
|
|
1001
|
+
const S = [];
|
|
1002
|
+
for (let V = 0; V < 12; V += 3)
|
|
1003
|
+
S.push([V, V + 1, V + 2]);
|
|
1004
|
+
return S;
|
|
1003
1005
|
});
|
|
1004
|
-
return (
|
|
1005
|
-
class: u(s(
|
|
1006
|
+
return (S, V) => (r(), c("table", {
|
|
1007
|
+
class: u(s(a).b()),
|
|
1006
1008
|
cellspacing: "0",
|
|
1007
1009
|
cellpadding: "0"
|
|
1008
1010
|
}, [
|
|
1009
|
-
|
|
1010
|
-
(
|
|
1011
|
-
(
|
|
1012
|
-
key:
|
|
1013
|
-
class: u(
|
|
1014
|
-
onClick: (
|
|
1011
|
+
d("tbody", null, [
|
|
1012
|
+
(r(!0), c(G, null, Z(P.value, ($, F) => (r(), c("tr", { key: F }, [
|
|
1013
|
+
(r(!0), c(G, null, Z($, (v) => (r(), c("td", {
|
|
1014
|
+
key: v,
|
|
1015
|
+
class: u(C(v)),
|
|
1016
|
+
onClick: (D) => x(v)
|
|
1015
1017
|
}, [
|
|
1016
|
-
|
|
1017
|
-
class: u(s(
|
|
1018
|
-
}, z(s(
|
|
1019
|
-
], 10,
|
|
1018
|
+
d("span", {
|
|
1019
|
+
class: u(s(a).e("cell-text"))
|
|
1020
|
+
}, z(s(st)[v]), 3)
|
|
1021
|
+
], 10, it))), 128))
|
|
1020
1022
|
]))), 128))
|
|
1021
1023
|
])
|
|
1022
1024
|
], 2));
|
|
1023
1025
|
}
|
|
1024
|
-
}), ct = ["onClick"],
|
|
1026
|
+
}), ct = ["onClick"], vt = /* @__PURE__ */ Q({
|
|
1025
1027
|
name: "XYearTable",
|
|
1026
1028
|
__name: "YearTable",
|
|
1027
1029
|
props: {
|
|
@@ -1030,55 +1032,55 @@ const nt = [
|
|
|
1030
1032
|
disabledDate: {}
|
|
1031
1033
|
},
|
|
1032
1034
|
emits: ["pick"],
|
|
1033
|
-
setup(n, { emit:
|
|
1034
|
-
const
|
|
1035
|
-
const [
|
|
1036
|
-
|
|
1035
|
+
setup(n, { emit: g }) {
|
|
1036
|
+
const t = n, e = g, a = J("year-table"), l = b(() => (/* @__PURE__ */ new Date()).getFullYear()), m = b(() => Ye(t.viewedYear)), p = b(() => {
|
|
1037
|
+
const [v] = m.value, D = [];
|
|
1038
|
+
D.push(v - 1);
|
|
1037
1039
|
for (let M = 0; M < 10; M++)
|
|
1038
|
-
|
|
1039
|
-
return
|
|
1040
|
-
}),
|
|
1041
|
-
const
|
|
1042
|
-
for (let
|
|
1043
|
-
|
|
1044
|
-
return
|
|
1045
|
-
}),
|
|
1046
|
-
const [
|
|
1047
|
-
return
|
|
1048
|
-
},
|
|
1049
|
-
if (!
|
|
1050
|
-
const
|
|
1051
|
-
return
|
|
1052
|
-
},
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
],
|
|
1059
|
-
|
|
1040
|
+
D.push(v + M);
|
|
1041
|
+
return D.push(v + 10), D;
|
|
1042
|
+
}), C = b(() => {
|
|
1043
|
+
const v = [];
|
|
1044
|
+
for (let D = 0; D < p.value.length; D += 3)
|
|
1045
|
+
v.push(p.value.slice(D, D + 3));
|
|
1046
|
+
return v;
|
|
1047
|
+
}), x = (v) => t.modelValue ? t.modelValue.getFullYear() === v : !1, P = (v) => v === l.value, S = (v) => {
|
|
1048
|
+
const [D, M] = m.value;
|
|
1049
|
+
return v >= D && v <= M;
|
|
1050
|
+
}, V = (v) => {
|
|
1051
|
+
if (!t.disabledDate) return !1;
|
|
1052
|
+
const D = new Date(v, 0, 1), M = new Date(v, 11, 31);
|
|
1053
|
+
return t.disabledDate(D) && t.disabledDate(M);
|
|
1054
|
+
}, $ = (v) => [
|
|
1055
|
+
a.e("cell"),
|
|
1056
|
+
a.is("selected", x(v)),
|
|
1057
|
+
a.is("current", P(v)),
|
|
1058
|
+
a.is("disabled", V(v)),
|
|
1059
|
+
a.is("in-decade", S(v))
|
|
1060
|
+
], F = (v) => {
|
|
1061
|
+
V(v) || e("pick", v);
|
|
1060
1062
|
};
|
|
1061
|
-
return (
|
|
1062
|
-
class: u(s(
|
|
1063
|
+
return (v, D) => (r(), c("table", {
|
|
1064
|
+
class: u(s(a).b()),
|
|
1063
1065
|
cellspacing: "0",
|
|
1064
1066
|
cellpadding: "0"
|
|
1065
1067
|
}, [
|
|
1066
|
-
|
|
1067
|
-
(
|
|
1068
|
-
(
|
|
1069
|
-
key:
|
|
1070
|
-
class: u(
|
|
1071
|
-
onClick: (
|
|
1068
|
+
d("tbody", null, [
|
|
1069
|
+
(r(!0), c(G, null, Z(C.value, (M, R) => (r(), c("tr", { key: R }, [
|
|
1070
|
+
(r(!0), c(G, null, Z(M, (A) => (r(), c("td", {
|
|
1071
|
+
key: A,
|
|
1072
|
+
class: u($(A)),
|
|
1073
|
+
onClick: (h) => F(A)
|
|
1072
1074
|
}, [
|
|
1073
|
-
|
|
1074
|
-
class: u(s(
|
|
1075
|
-
}, z(
|
|
1075
|
+
d("span", {
|
|
1076
|
+
class: u(s(a).e("cell-text"))
|
|
1077
|
+
}, z(A), 3)
|
|
1076
1078
|
], 10, ct))), 128))
|
|
1077
1079
|
]))), 128))
|
|
1078
1080
|
])
|
|
1079
1081
|
], 2));
|
|
1080
1082
|
}
|
|
1081
|
-
}),
|
|
1083
|
+
}), ft = ["placeholder", "disabled", "value"], mt = ["placeholder", "disabled", "value"], pt = ["placeholder", "disabled", "value"], Il = /* @__PURE__ */ Q({
|
|
1082
1084
|
name: "XDatePicker",
|
|
1083
1085
|
__name: "index",
|
|
1084
1086
|
props: {
|
|
@@ -1099,273 +1101,292 @@ const nt = [
|
|
|
1099
1101
|
maxDate: {}
|
|
1100
1102
|
},
|
|
1101
1103
|
emits: ["update:modelValue", "update:value", "change", "focus", "blur", "clear"],
|
|
1102
|
-
setup(n, { expose:
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
-
},
|
|
1104
|
+
setup(n, { expose: g, emit: t }) {
|
|
1105
|
+
const e = n, a = t, l = J("date-picker"), m = E(!1), p = E(2e3), C = E(), x = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, P = (L) => {
|
|
1106
|
+
a("update:modelValue", L), a("update:value", L), a("change", L);
|
|
1107
|
+
}, S = E(), V = E(), $ = E({
|
|
1106
1108
|
top: "0px",
|
|
1107
1109
|
left: "0px"
|
|
1108
|
-
}),
|
|
1110
|
+
}), F = () => Le().next(), v = E("date"), D = E(/* @__PURE__ */ new Date()), M = E({
|
|
1109
1111
|
selecting: !1,
|
|
1110
1112
|
startDate: null,
|
|
1111
1113
|
endDate: null
|
|
1112
|
-
}),
|
|
1113
|
-
const
|
|
1114
|
-
if (!
|
|
1115
|
-
if (
|
|
1116
|
-
|
|
1117
|
-
|
|
1114
|
+
}), R = b(() => {
|
|
1115
|
+
const L = x();
|
|
1116
|
+
if (!L) return null;
|
|
1117
|
+
if (e.type === "daterange") {
|
|
1118
|
+
if (!Array.isArray(L)) return null;
|
|
1119
|
+
const [U, _] = L;
|
|
1120
|
+
return [
|
|
1121
|
+
U instanceof Date ? U : ie(U),
|
|
1122
|
+
_ instanceof Date ? _ : ie(_)
|
|
1123
|
+
];
|
|
1118
1124
|
}
|
|
1119
|
-
return
|
|
1120
|
-
}),
|
|
1121
|
-
if (
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1125
|
+
return L instanceof Date ? L : ie(L);
|
|
1126
|
+
}), A = b(() => {
|
|
1127
|
+
if (e.type === "daterange") return "";
|
|
1128
|
+
const L = x();
|
|
1129
|
+
if (!L) return "";
|
|
1130
|
+
const U = L instanceof Date ? L : ie(L);
|
|
1131
|
+
return U ? ve(U, e.format) : "";
|
|
1132
|
+
}), h = b(() => {
|
|
1133
|
+
const L = x();
|
|
1134
|
+
if (!L || !Array.isArray(L)) return "";
|
|
1135
|
+
const [U] = L;
|
|
1136
|
+
if (!U) return "";
|
|
1137
|
+
const _ = U instanceof Date ? U : ie(U);
|
|
1138
|
+
return _ ? ve(_, e.format) : "";
|
|
1139
|
+
}), f = b(() => {
|
|
1140
|
+
const L = x();
|
|
1141
|
+
if (!L || !Array.isArray(L)) return "";
|
|
1142
|
+
const [, U] = L;
|
|
1143
|
+
if (!U) return "";
|
|
1144
|
+
const _ = U instanceof Date ? U : ie(U);
|
|
1145
|
+
return _ ? ve(_, e.format) : "";
|
|
1146
|
+
}), k = b(() => {
|
|
1147
|
+
const L = x();
|
|
1148
|
+
return !L || Array.isArray(L) ? null : L instanceof Date ? L : ie(L);
|
|
1149
|
+
}), N = b(() => D.value.getFullYear()), K = b(() => D.value.getMonth()), j = b(() => Ye(N.value)), ee = b(() => v.value === "year" ? `${j.value[0]} 年 - ${j.value[1]} 年` : v.value === "month" ? `${N.value} 年` : `${N.value} 年 ${K.value + 1} 月`), T = b(() => [
|
|
1150
|
+
l.b(),
|
|
1151
|
+
l.m(e.size),
|
|
1152
|
+
l.is("disabled", e.disabled),
|
|
1153
|
+
l.is("range", e.type === "daterange")
|
|
1154
|
+
]), B = b(() => [
|
|
1155
|
+
l.e("input"),
|
|
1156
|
+
l.is("focus", m.value),
|
|
1157
|
+
l.is("has-value", !!A.value || !!(h.value || f.value))
|
|
1158
|
+
]), w = () => {
|
|
1159
|
+
e.disabled || e.readonly || (m.value ? i() : o());
|
|
1139
1160
|
}, o = () => {
|
|
1140
|
-
|
|
1141
|
-
if (
|
|
1142
|
-
const
|
|
1143
|
-
let
|
|
1144
|
-
|
|
1145
|
-
top: `${
|
|
1146
|
-
left: `${
|
|
1161
|
+
m.value = !0, p.value = F(), De(() => {
|
|
1162
|
+
if (C.value && S.value) {
|
|
1163
|
+
const L = C.value.getBoundingClientRect(), U = S.value.getBoundingClientRect();
|
|
1164
|
+
let _ = L.bottom + 8, $e = L.left;
|
|
1165
|
+
$e + U.width > window.innerWidth && ($e = window.innerWidth - U.width - 8), _ + U.height > window.innerHeight && (_ = L.top - U.height - 8), $.value = {
|
|
1166
|
+
top: `${_}px`,
|
|
1167
|
+
left: `${$e}px`
|
|
1147
1168
|
};
|
|
1148
1169
|
}
|
|
1149
|
-
}),
|
|
1150
|
-
},
|
|
1151
|
-
|
|
1152
|
-
},
|
|
1153
|
-
if (
|
|
1154
|
-
const
|
|
1155
|
-
|
|
1170
|
+
}), a("focus", {});
|
|
1171
|
+
}, i = () => {
|
|
1172
|
+
m.value = !1, v.value = "date", a("blur", {});
|
|
1173
|
+
}, y = (L) => {
|
|
1174
|
+
if (e.type === "date") {
|
|
1175
|
+
const U = e.valueFormat ? ve(L, e.valueFormat) : L;
|
|
1176
|
+
P(U), i();
|
|
1156
1177
|
}
|
|
1157
|
-
},
|
|
1178
|
+
}, X = (L) => {
|
|
1158
1179
|
if (!M.value.selecting)
|
|
1159
|
-
M.value.selecting = !0, M.value.startDate =
|
|
1180
|
+
M.value.selecting = !0, M.value.startDate = L, M.value.endDate = null;
|
|
1160
1181
|
else {
|
|
1161
|
-
M.value.selecting = !1, M.value.startDate &&
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1182
|
+
M.value.selecting = !1, M.value.startDate && L < M.value.startDate ? [M.value.startDate, M.value.endDate] = [L, M.value.startDate] : M.value.endDate = L;
|
|
1183
|
+
const U = e.valueFormat ? ve(M.value.startDate, e.valueFormat) : M.value.startDate, _ = e.valueFormat ? ve(M.value.endDate, e.valueFormat) : M.value.endDate;
|
|
1184
|
+
P([U, _]), i();
|
|
1164
1185
|
}
|
|
1165
|
-
},
|
|
1166
|
-
if (
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1186
|
+
}, le = (L) => {
|
|
1187
|
+
if (D.value = new Date(N.value, L, 1), e.type === "month") {
|
|
1188
|
+
const U = new Date(N.value, L, 1), _ = e.valueFormat ? ve(U, e.valueFormat) : U;
|
|
1189
|
+
P(_), i();
|
|
1169
1190
|
} else
|
|
1170
|
-
|
|
1171
|
-
},
|
|
1172
|
-
if (
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1191
|
+
v.value = "date";
|
|
1192
|
+
}, Y = (L) => {
|
|
1193
|
+
if (D.value = new Date(L, K.value, 1), e.type === "year") {
|
|
1194
|
+
const U = new Date(L, 0, 1), _ = e.valueFormat ? ve(U, e.valueFormat) : U;
|
|
1195
|
+
P(_), i();
|
|
1175
1196
|
} else
|
|
1176
|
-
|
|
1177
|
-
},
|
|
1178
|
-
|
|
1179
|
-
},
|
|
1180
|
-
|
|
1181
|
-
},
|
|
1182
|
-
|
|
1183
|
-
},
|
|
1184
|
-
|
|
1185
|
-
},
|
|
1186
|
-
|
|
1187
|
-
}, U = () => {
|
|
1188
|
-
d.value = "year";
|
|
1197
|
+
v.value = "month";
|
|
1198
|
+
}, te = () => {
|
|
1199
|
+
D.value = et(D.value);
|
|
1200
|
+
}, H = () => {
|
|
1201
|
+
D.value = tt(D.value);
|
|
1202
|
+
}, ce = () => {
|
|
1203
|
+
v.value === "year" ? D.value = new Date(N.value - 10, K.value, 1) : D.value = lt(D.value);
|
|
1204
|
+
}, ye = () => {
|
|
1205
|
+
v.value === "year" ? D.value = new Date(N.value + 10, K.value, 1) : D.value = at(D.value);
|
|
1206
|
+
}, I = () => {
|
|
1207
|
+
v.value = "month";
|
|
1189
1208
|
}, W = () => {
|
|
1190
|
-
|
|
1209
|
+
v.value = "year";
|
|
1210
|
+
}, q = () => {
|
|
1211
|
+
P(null), a("clear"), M.value = {
|
|
1191
1212
|
selecting: !1,
|
|
1192
1213
|
startDate: null,
|
|
1193
1214
|
endDate: null
|
|
1194
1215
|
};
|
|
1195
|
-
},
|
|
1196
|
-
if (!
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1216
|
+
}, se = (L) => {
|
|
1217
|
+
if (!C.value) return;
|
|
1218
|
+
const U = L.target;
|
|
1219
|
+
C.value.contains(U) || S.value && S.value.contains(U) || i();
|
|
1199
1220
|
};
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
(
|
|
1203
|
-
if (
|
|
1204
|
-
if (Array.isArray(
|
|
1205
|
-
const [
|
|
1206
|
-
|
|
1207
|
-
} else
|
|
1221
|
+
de(
|
|
1222
|
+
x,
|
|
1223
|
+
(L) => {
|
|
1224
|
+
if (L)
|
|
1225
|
+
if (Array.isArray(R.value)) {
|
|
1226
|
+
const [U] = R.value;
|
|
1227
|
+
U && (D.value = new Date(U));
|
|
1228
|
+
} else R.value && (D.value = new Date(R.value));
|
|
1208
1229
|
},
|
|
1209
1230
|
{ immediate: !0 }
|
|
1210
|
-
),
|
|
1211
|
-
|
|
1231
|
+
), de(m, (L) => {
|
|
1232
|
+
L && (v.value = "date", e.type === "daterange" && (M.value = {
|
|
1212
1233
|
selecting: !1,
|
|
1213
|
-
startDate: Array.isArray(
|
|
1214
|
-
endDate: Array.isArray(
|
|
1234
|
+
startDate: Array.isArray(R.value) ? R.value[0] : null,
|
|
1235
|
+
endDate: Array.isArray(R.value) ? R.value[1] : null
|
|
1215
1236
|
}));
|
|
1216
1237
|
});
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1238
|
+
const re = (L) => {
|
|
1239
|
+
L.key === "Escape" && i();
|
|
1219
1240
|
};
|
|
1220
|
-
return
|
|
1221
|
-
document.addEventListener("click",
|
|
1222
|
-
}),
|
|
1223
|
-
document.removeEventListener("click",
|
|
1224
|
-
}),
|
|
1241
|
+
return ke(() => {
|
|
1242
|
+
document.addEventListener("click", se), document.addEventListener("keydown", re);
|
|
1243
|
+
}), xe(() => {
|
|
1244
|
+
document.removeEventListener("click", se), document.removeEventListener("keydown", re);
|
|
1245
|
+
}), g({
|
|
1225
1246
|
focus: () => {
|
|
1226
|
-
var
|
|
1227
|
-
return (
|
|
1247
|
+
var L;
|
|
1248
|
+
return (L = V.value) == null ? void 0 : L.focus();
|
|
1228
1249
|
},
|
|
1229
1250
|
blur: () => {
|
|
1230
|
-
var
|
|
1231
|
-
return (
|
|
1251
|
+
var L;
|
|
1252
|
+
return (L = V.value) == null ? void 0 : L.blur();
|
|
1232
1253
|
}
|
|
1233
|
-
}), (
|
|
1254
|
+
}), (L, U) => (r(), c("div", {
|
|
1234
1255
|
ref_key: "pickerRef",
|
|
1235
|
-
ref:
|
|
1236
|
-
class: u(
|
|
1256
|
+
ref: C,
|
|
1257
|
+
class: u(T.value)
|
|
1237
1258
|
}, [
|
|
1238
|
-
n.type !== "daterange" ? (
|
|
1259
|
+
n.type !== "daterange" ? (r(), c("div", {
|
|
1239
1260
|
key: 0,
|
|
1240
|
-
class: u(
|
|
1241
|
-
onClick:
|
|
1261
|
+
class: u(B.value),
|
|
1262
|
+
onClick: w
|
|
1242
1263
|
}, [
|
|
1243
|
-
|
|
1264
|
+
d("input", {
|
|
1244
1265
|
ref_key: "inputRef",
|
|
1245
|
-
ref:
|
|
1266
|
+
ref: V,
|
|
1246
1267
|
type: "text",
|
|
1247
1268
|
placeholder: n.placeholder,
|
|
1248
1269
|
disabled: n.disabled,
|
|
1249
1270
|
readonly: !0,
|
|
1250
|
-
value:
|
|
1251
|
-
class: u(s(
|
|
1252
|
-
}, null, 10,
|
|
1253
|
-
|
|
1254
|
-
class: u(s(
|
|
1271
|
+
value: A.value,
|
|
1272
|
+
class: u(s(l).e("input-inner"))
|
|
1273
|
+
}, null, 10, ft),
|
|
1274
|
+
d("span", {
|
|
1275
|
+
class: u(s(l).e("suffix"))
|
|
1255
1276
|
}, [
|
|
1256
|
-
n.clearable &&
|
|
1277
|
+
n.clearable && A.value && !n.disabled ? (r(), c("span", {
|
|
1257
1278
|
key: 0,
|
|
1258
|
-
class: u(s(
|
|
1259
|
-
onClick: ue(
|
|
1260
|
-
}, " ✕ ", 2)) : (
|
|
1279
|
+
class: u(s(l).e("clear")),
|
|
1280
|
+
onClick: ue(q, ["stop"])
|
|
1281
|
+
}, " ✕ ", 2)) : (r(), c("span", {
|
|
1261
1282
|
key: 1,
|
|
1262
|
-
class: u(s(
|
|
1283
|
+
class: u(s(l).e("icon"))
|
|
1263
1284
|
}, "📅", 2))
|
|
1264
1285
|
], 2)
|
|
1265
|
-
], 2)) : (
|
|
1286
|
+
], 2)) : (r(), c("div", {
|
|
1266
1287
|
key: 1,
|
|
1267
|
-
class: u(
|
|
1268
|
-
onClick:
|
|
1288
|
+
class: u(B.value),
|
|
1289
|
+
onClick: w
|
|
1269
1290
|
}, [
|
|
1270
|
-
|
|
1291
|
+
d("input", {
|
|
1271
1292
|
type: "text",
|
|
1272
1293
|
placeholder: n.startPlaceholder,
|
|
1273
1294
|
disabled: n.disabled,
|
|
1274
1295
|
readonly: !0,
|
|
1275
|
-
value:
|
|
1276
|
-
class: u(s(
|
|
1277
|
-
}, null, 10,
|
|
1278
|
-
|
|
1279
|
-
class: u(s(
|
|
1296
|
+
value: h.value,
|
|
1297
|
+
class: u(s(l).e("input-inner"))
|
|
1298
|
+
}, null, 10, mt),
|
|
1299
|
+
d("span", {
|
|
1300
|
+
class: u(s(l).e("separator"))
|
|
1280
1301
|
}, "至", 2),
|
|
1281
|
-
|
|
1302
|
+
d("input", {
|
|
1282
1303
|
type: "text",
|
|
1283
1304
|
placeholder: n.endPlaceholder,
|
|
1284
1305
|
disabled: n.disabled,
|
|
1285
1306
|
readonly: !0,
|
|
1286
|
-
value:
|
|
1287
|
-
class: u(s(
|
|
1288
|
-
}, null, 10,
|
|
1289
|
-
|
|
1290
|
-
class: u(s(
|
|
1307
|
+
value: f.value,
|
|
1308
|
+
class: u(s(l).e("input-inner"))
|
|
1309
|
+
}, null, 10, pt),
|
|
1310
|
+
d("span", {
|
|
1311
|
+
class: u(s(l).e("suffix"))
|
|
1291
1312
|
}, [
|
|
1292
|
-
n.clearable && (
|
|
1313
|
+
n.clearable && (h.value || f.value) && !n.disabled ? (r(), c("span", {
|
|
1293
1314
|
key: 0,
|
|
1294
|
-
class: u(s(
|
|
1295
|
-
onClick: ue(
|
|
1296
|
-
}, " ✕ ", 2)) : (
|
|
1315
|
+
class: u(s(l).e("clear")),
|
|
1316
|
+
onClick: ue(q, ["stop"])
|
|
1317
|
+
}, " ✕ ", 2)) : (r(), c("span", {
|
|
1297
1318
|
key: 1,
|
|
1298
|
-
class: u(s(
|
|
1319
|
+
class: u(s(l).e("icon"))
|
|
1299
1320
|
}, "📅", 2))
|
|
1300
1321
|
], 2)
|
|
1301
1322
|
], 2)),
|
|
1302
|
-
(
|
|
1303
|
-
|
|
1323
|
+
(r(), ge(Re, { to: "body" }, [
|
|
1324
|
+
we(Be, { name: "fade" }, {
|
|
1304
1325
|
default: Fe(() => [
|
|
1305
|
-
|
|
1326
|
+
oe(d("div", {
|
|
1306
1327
|
ref_key: "popperRef",
|
|
1307
|
-
ref:
|
|
1308
|
-
class: u(s(
|
|
1309
|
-
style:
|
|
1328
|
+
ref: S,
|
|
1329
|
+
class: u(s(l).e("popper")),
|
|
1330
|
+
style: ne({ zIndex: p.value, ...$.value })
|
|
1310
1331
|
}, [
|
|
1311
|
-
|
|
1312
|
-
class: u(s(
|
|
1332
|
+
d("div", {
|
|
1333
|
+
class: u(s(l).e("header"))
|
|
1313
1334
|
}, [
|
|
1314
|
-
|
|
1335
|
+
d("button", {
|
|
1315
1336
|
type: "button",
|
|
1316
|
-
class: u(s(
|
|
1317
|
-
onClick:
|
|
1337
|
+
class: u(s(l).e("prev-btn")),
|
|
1338
|
+
onClick: U[0] || (U[0] = (_) => v.value === "date" ? te() : ce())
|
|
1318
1339
|
}, " ‹ ", 2),
|
|
1319
|
-
|
|
1320
|
-
class: u(s(
|
|
1340
|
+
d("div", {
|
|
1341
|
+
class: u(s(l).e("header-title"))
|
|
1321
1342
|
}, [
|
|
1322
|
-
|
|
1343
|
+
v.value === "year" ? (r(), c("span", {
|
|
1323
1344
|
key: 0,
|
|
1324
|
-
onClick:
|
|
1325
|
-
}, z(
|
|
1326
|
-
|
|
1327
|
-
|
|
1345
|
+
onClick: U[1] || (U[1] = (_) => v.value = "month")
|
|
1346
|
+
}, z(ee.value), 1)) : (r(), c(G, { key: 1 }, [
|
|
1347
|
+
d("span", { onClick: W }, z(N.value) + " 年", 1),
|
|
1348
|
+
v.value === "date" ? (r(), c("span", {
|
|
1328
1349
|
key: 0,
|
|
1329
|
-
onClick:
|
|
1330
|
-
}, z(
|
|
1350
|
+
onClick: I
|
|
1351
|
+
}, z(K.value + 1) + " 月", 1)) : O("", !0)
|
|
1331
1352
|
], 64))
|
|
1332
1353
|
], 2),
|
|
1333
|
-
|
|
1354
|
+
d("button", {
|
|
1334
1355
|
type: "button",
|
|
1335
|
-
class: u(s(
|
|
1336
|
-
onClick:
|
|
1356
|
+
class: u(s(l).e("next-btn")),
|
|
1357
|
+
onClick: U[2] || (U[2] = (_) => v.value === "date" ? H() : ye())
|
|
1337
1358
|
}, " › ", 2)
|
|
1338
1359
|
], 2),
|
|
1339
|
-
|
|
1340
|
-
class: u(s(
|
|
1360
|
+
d("div", {
|
|
1361
|
+
class: u(s(l).e("content"))
|
|
1341
1362
|
}, [
|
|
1342
|
-
|
|
1363
|
+
v.value === "date" ? (r(), ge(rt, {
|
|
1343
1364
|
key: 0,
|
|
1344
|
-
"model-value":
|
|
1345
|
-
"viewed-month":
|
|
1365
|
+
"model-value": k.value,
|
|
1366
|
+
"viewed-month": D.value,
|
|
1346
1367
|
"disabled-date": n.disabledDate,
|
|
1347
|
-
"min-date": n.minDate ? s(
|
|
1348
|
-
"max-date": n.maxDate ? s(
|
|
1368
|
+
"min-date": n.minDate ? s(ie)(n.minDate) : null,
|
|
1369
|
+
"max-date": n.maxDate ? s(ie)(n.maxDate) : null,
|
|
1349
1370
|
"selection-mode": n.type === "daterange" ? "range" : "single",
|
|
1350
1371
|
"range-state": M.value,
|
|
1351
|
-
onPick:
|
|
1352
|
-
onRangeSelect:
|
|
1353
|
-
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) :
|
|
1372
|
+
onPick: y,
|
|
1373
|
+
onRangeSelect: X
|
|
1374
|
+
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : v.value === "month" ? (r(), ge(dt, {
|
|
1354
1375
|
key: 1,
|
|
1355
|
-
"model-value":
|
|
1356
|
-
"viewed-year":
|
|
1376
|
+
"model-value": k.value,
|
|
1377
|
+
"viewed-year": N.value,
|
|
1357
1378
|
"disabled-date": n.disabledDate,
|
|
1358
|
-
onPick:
|
|
1359
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) :
|
|
1379
|
+
onPick: le
|
|
1380
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : v.value === "year" ? (r(), ge(vt, {
|
|
1360
1381
|
key: 2,
|
|
1361
|
-
"model-value":
|
|
1362
|
-
"viewed-year":
|
|
1382
|
+
"model-value": k.value,
|
|
1383
|
+
"viewed-year": N.value,
|
|
1363
1384
|
"disabled-date": n.disabledDate,
|
|
1364
|
-
onPick:
|
|
1365
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) :
|
|
1385
|
+
onPick: Y
|
|
1386
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : O("", !0)
|
|
1366
1387
|
], 2)
|
|
1367
1388
|
], 6), [
|
|
1368
|
-
[Ie,
|
|
1389
|
+
[Ie, m.value]
|
|
1369
1390
|
])
|
|
1370
1391
|
]),
|
|
1371
1392
|
_: 1
|
|
@@ -1374,31 +1395,31 @@ const nt = [
|
|
|
1374
1395
|
], 2));
|
|
1375
1396
|
}
|
|
1376
1397
|
});
|
|
1377
|
-
function
|
|
1398
|
+
function pe(n, g = "HH:mm:ss") {
|
|
1378
1399
|
if (!n) return "";
|
|
1379
|
-
const
|
|
1380
|
-
return
|
|
1400
|
+
const t = n.getHours(), e = n.getMinutes(), a = n.getSeconds();
|
|
1401
|
+
return g.replace(/HH/g, String(t).padStart(2, "0")).replace(/H/g, String(t)).replace(/mm/g, String(e).padStart(2, "0")).replace(/m/g, String(e)).replace(/ss/g, String(a).padStart(2, "0")).replace(/s/g, String(a));
|
|
1381
1402
|
}
|
|
1382
|
-
function
|
|
1403
|
+
function Me(n) {
|
|
1383
1404
|
if (!n) return null;
|
|
1384
1405
|
if (n instanceof Date)
|
|
1385
1406
|
return isNaN(n.getTime()) ? null : n;
|
|
1386
1407
|
if (typeof n == "number") {
|
|
1387
|
-
const
|
|
1388
|
-
return
|
|
1408
|
+
const e = /* @__PURE__ */ new Date();
|
|
1409
|
+
return e.setTime(n), e;
|
|
1389
1410
|
}
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
const
|
|
1393
|
-
return
|
|
1411
|
+
const g = n.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?/);
|
|
1412
|
+
if (g) {
|
|
1413
|
+
const e = /* @__PURE__ */ new Date();
|
|
1414
|
+
return e.setHours(parseInt(g[1]), parseInt(g[2]), g[3] ? parseInt(g[3]) : 0, 0), e;
|
|
1394
1415
|
}
|
|
1395
|
-
const
|
|
1396
|
-
return isNaN(
|
|
1416
|
+
const t = new Date(n);
|
|
1417
|
+
return isNaN(t.getTime()) ? null : t;
|
|
1397
1418
|
}
|
|
1398
|
-
function
|
|
1419
|
+
function he(n) {
|
|
1399
1420
|
return String(n).padStart(2, "0");
|
|
1400
1421
|
}
|
|
1401
|
-
const
|
|
1422
|
+
const ht = ["onClick"], gt = ["onClick"], bt = ["onClick"], yt = /* @__PURE__ */ Q({
|
|
1402
1423
|
name: "XTimePanel",
|
|
1403
1424
|
__name: "TimePanel",
|
|
1404
1425
|
props: {
|
|
@@ -1412,155 +1433,155 @@ const pt = ["onClick"], ht = ["onClick"], gt = ["onClick"], bt = /* @__PURE__ */
|
|
|
1412
1433
|
secondStep: { default: 1 }
|
|
1413
1434
|
},
|
|
1414
1435
|
emits: ["confirm", "cancel"],
|
|
1415
|
-
setup(n, { emit:
|
|
1416
|
-
const
|
|
1417
|
-
const
|
|
1418
|
-
for (let
|
|
1419
|
-
|
|
1420
|
-
return
|
|
1421
|
-
}),
|
|
1422
|
-
const
|
|
1423
|
-
for (let
|
|
1424
|
-
|
|
1425
|
-
return
|
|
1426
|
-
}),
|
|
1427
|
-
const
|
|
1428
|
-
for (let
|
|
1429
|
-
|
|
1430
|
-
return
|
|
1431
|
-
}),
|
|
1432
|
-
|
|
1433
|
-
},
|
|
1434
|
-
|
|
1435
|
-
},
|
|
1436
|
-
|
|
1437
|
-
},
|
|
1438
|
-
if (!
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
},
|
|
1442
|
-
if (!
|
|
1443
|
-
const
|
|
1444
|
-
|
|
1436
|
+
setup(n, { emit: g }) {
|
|
1437
|
+
const t = n, e = g, a = J("time-panel"), l = E(0), m = E(0), p = E(0), C = E(), x = E(), P = E(), S = b(() => t.format.includes("ss") || t.format.includes("s")), V = b(() => {
|
|
1438
|
+
const Y = [], te = Math.max(1, t.hourStep);
|
|
1439
|
+
for (let H = 0; H < 24; H += te)
|
|
1440
|
+
Y.push(H);
|
|
1441
|
+
return Y;
|
|
1442
|
+
}), $ = b(() => {
|
|
1443
|
+
const Y = [], te = Math.max(1, t.minuteStep);
|
|
1444
|
+
for (let H = 0; H < 60; H += te)
|
|
1445
|
+
Y.push(H);
|
|
1446
|
+
return Y;
|
|
1447
|
+
}), F = b(() => {
|
|
1448
|
+
const Y = [], te = Math.max(1, t.secondStep);
|
|
1449
|
+
for (let H = 0; H < 60; H += te)
|
|
1450
|
+
Y.push(H);
|
|
1451
|
+
return Y;
|
|
1452
|
+
}), v = b(() => t.disabledHours ? new Set(t.disabledHours()) : /* @__PURE__ */ new Set()), D = b(() => t.disabledMinutes ? new Set(t.disabledMinutes(l.value)) : /* @__PURE__ */ new Set()), M = b(() => t.disabledSeconds ? new Set(t.disabledSeconds(l.value, m.value)) : /* @__PURE__ */ new Set()), R = b(() => `${he(l.value)}:${he(m.value)}${S.value ? ":" + he(p.value) : ""}`), A = (Y) => v.value.has(Y), h = (Y) => D.value.has(Y), f = (Y) => M.value.has(Y), k = (Y) => {
|
|
1453
|
+
A(Y) || (l.value = Y, B(C.value, j(Y)));
|
|
1454
|
+
}, N = (Y) => {
|
|
1455
|
+
h(Y) || (m.value = Y, B(x.value, ee(Y)));
|
|
1456
|
+
}, K = (Y) => {
|
|
1457
|
+
f(Y) || (p.value = Y, B(P.value, T(Y)));
|
|
1458
|
+
}, j = (Y) => V.value.indexOf(Y), ee = (Y) => $.value.indexOf(Y), T = (Y) => F.value.indexOf(Y), B = (Y, te) => {
|
|
1459
|
+
if (!Y) return;
|
|
1460
|
+
const H = 32, ye = te * H + 84 - 200 / 2 + H / 2;
|
|
1461
|
+
Y.scrollTop = Math.max(0, ye);
|
|
1462
|
+
}, w = () => {
|
|
1463
|
+
if (!C.value) return;
|
|
1464
|
+
const Y = C.value.scrollTop, te = Math.round((Y - 84 + 100) / 32), H = V.value[Math.max(0, Math.min(te, V.value.length - 1))];
|
|
1465
|
+
H !== void 0 && !A(H) && (l.value = H);
|
|
1445
1466
|
}, o = () => {
|
|
1446
|
-
if (!
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1449
|
-
},
|
|
1450
|
-
if (!
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1453
|
-
},
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
},
|
|
1457
|
-
|
|
1458
|
-
},
|
|
1459
|
-
if (
|
|
1460
|
-
|
|
1467
|
+
if (!x.value) return;
|
|
1468
|
+
const Y = x.value.scrollTop, te = Math.round((Y - 84 + 100) / 32), H = $.value[Math.max(0, Math.min(te, $.value.length - 1))];
|
|
1469
|
+
H !== void 0 && !h(H) && (m.value = H);
|
|
1470
|
+
}, i = () => {
|
|
1471
|
+
if (!P.value) return;
|
|
1472
|
+
const Y = P.value.scrollTop, te = Math.round((Y - 84 + 100) / 32), H = F.value[Math.max(0, Math.min(te, F.value.length - 1))];
|
|
1473
|
+
H !== void 0 && !f(H) && (p.value = H);
|
|
1474
|
+
}, y = () => {
|
|
1475
|
+
const Y = t.modelValue ? new Date(t.modelValue) : /* @__PURE__ */ new Date();
|
|
1476
|
+
Y.setHours(l.value, m.value, p.value, 0), e("confirm", Y);
|
|
1477
|
+
}, X = () => {
|
|
1478
|
+
e("cancel");
|
|
1479
|
+
}, le = () => {
|
|
1480
|
+
if (t.modelValue)
|
|
1481
|
+
l.value = t.modelValue.getHours(), m.value = t.modelValue.getMinutes(), p.value = t.modelValue.getSeconds();
|
|
1461
1482
|
else {
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1483
|
+
const Y = /* @__PURE__ */ new Date();
|
|
1484
|
+
l.value = Y.getHours(), m.value = Y.getMinutes(), p.value = Y.getSeconds();
|
|
1464
1485
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1486
|
+
De(() => {
|
|
1487
|
+
B(C.value, j(l.value)), B(x.value, ee(m.value)), S.value && B(P.value, T(p.value));
|
|
1467
1488
|
});
|
|
1468
1489
|
};
|
|
1469
|
-
return
|
|
1470
|
-
() =>
|
|
1490
|
+
return de(
|
|
1491
|
+
() => t.modelValue,
|
|
1471
1492
|
() => {
|
|
1472
|
-
|
|
1493
|
+
le();
|
|
1473
1494
|
},
|
|
1474
1495
|
{ immediate: !0 }
|
|
1475
|
-
),
|
|
1476
|
-
|
|
1477
|
-
}), (
|
|
1478
|
-
class: u(s(
|
|
1496
|
+
), ke(() => {
|
|
1497
|
+
le();
|
|
1498
|
+
}), (Y, te) => (r(), c("div", {
|
|
1499
|
+
class: u(s(a).b())
|
|
1479
1500
|
}, [
|
|
1480
|
-
|
|
1481
|
-
class: u(s(
|
|
1501
|
+
d("div", {
|
|
1502
|
+
class: u(s(a).e("content"))
|
|
1482
1503
|
}, [
|
|
1483
|
-
|
|
1484
|
-
class: u(s(
|
|
1504
|
+
d("div", {
|
|
1505
|
+
class: u(s(a).e("indicator"))
|
|
1485
1506
|
}, null, 2),
|
|
1486
|
-
|
|
1507
|
+
d("div", {
|
|
1487
1508
|
ref_key: "hourListRef",
|
|
1488
|
-
ref:
|
|
1489
|
-
class: u(s(
|
|
1490
|
-
onScroll:
|
|
1509
|
+
ref: C,
|
|
1510
|
+
class: u(s(a).e("list")),
|
|
1511
|
+
onScroll: w
|
|
1491
1512
|
}, [
|
|
1492
|
-
|
|
1493
|
-
class: u(s(
|
|
1513
|
+
d("div", {
|
|
1514
|
+
class: u(s(a).e("padding"))
|
|
1494
1515
|
}, null, 2),
|
|
1495
|
-
(
|
|
1496
|
-
key:
|
|
1497
|
-
class: u([s(
|
|
1498
|
-
onClick: (
|
|
1499
|
-
}, z(s(
|
|
1500
|
-
|
|
1501
|
-
class: u(s(
|
|
1516
|
+
(r(!0), c(G, null, Z(V.value, (H) => (r(), c("div", {
|
|
1517
|
+
key: H,
|
|
1518
|
+
class: u([s(a).e("item"), s(a).is("selected", l.value === H), s(a).is("disabled", A(H))]),
|
|
1519
|
+
onClick: (ce) => k(H)
|
|
1520
|
+
}, z(s(he)(H)), 11, ht))), 128)),
|
|
1521
|
+
d("div", {
|
|
1522
|
+
class: u(s(a).e("padding"))
|
|
1502
1523
|
}, null, 2)
|
|
1503
1524
|
], 34),
|
|
1504
|
-
|
|
1525
|
+
d("div", {
|
|
1505
1526
|
ref_key: "minuteListRef",
|
|
1506
|
-
ref:
|
|
1507
|
-
class: u(s(
|
|
1527
|
+
ref: x,
|
|
1528
|
+
class: u(s(a).e("list")),
|
|
1508
1529
|
onScroll: o
|
|
1509
1530
|
}, [
|
|
1510
|
-
|
|
1511
|
-
class: u(s(
|
|
1531
|
+
d("div", {
|
|
1532
|
+
class: u(s(a).e("padding"))
|
|
1512
1533
|
}, null, 2),
|
|
1513
|
-
(
|
|
1514
|
-
key:
|
|
1515
|
-
class: u([s(
|
|
1516
|
-
onClick: (
|
|
1517
|
-
}, z(s(
|
|
1518
|
-
|
|
1519
|
-
class: u(s(
|
|
1534
|
+
(r(!0), c(G, null, Z($.value, (H) => (r(), c("div", {
|
|
1535
|
+
key: H,
|
|
1536
|
+
class: u([s(a).e("item"), s(a).is("selected", m.value === H), s(a).is("disabled", h(H))]),
|
|
1537
|
+
onClick: (ce) => N(H)
|
|
1538
|
+
}, z(s(he)(H)), 11, gt))), 128)),
|
|
1539
|
+
d("div", {
|
|
1540
|
+
class: u(s(a).e("padding"))
|
|
1520
1541
|
}, null, 2)
|
|
1521
1542
|
], 34),
|
|
1522
|
-
|
|
1543
|
+
S.value ? (r(), c("div", {
|
|
1523
1544
|
key: 0,
|
|
1524
1545
|
ref_key: "secondListRef",
|
|
1525
|
-
ref:
|
|
1526
|
-
class: u(s(
|
|
1527
|
-
onScroll:
|
|
1546
|
+
ref: P,
|
|
1547
|
+
class: u(s(a).e("list")),
|
|
1548
|
+
onScroll: i
|
|
1528
1549
|
}, [
|
|
1529
|
-
|
|
1530
|
-
class: u(s(
|
|
1550
|
+
d("div", {
|
|
1551
|
+
class: u(s(a).e("padding"))
|
|
1531
1552
|
}, null, 2),
|
|
1532
|
-
(
|
|
1533
|
-
key:
|
|
1534
|
-
class: u([s(
|
|
1535
|
-
onClick: (
|
|
1536
|
-
}, z(s(
|
|
1537
|
-
|
|
1538
|
-
class: u(s(
|
|
1553
|
+
(r(!0), c(G, null, Z(F.value, (H) => (r(), c("div", {
|
|
1554
|
+
key: H,
|
|
1555
|
+
class: u([s(a).e("item"), s(a).is("selected", p.value === H), s(a).is("disabled", f(H))]),
|
|
1556
|
+
onClick: (ce) => K(H)
|
|
1557
|
+
}, z(s(he)(H)), 11, bt))), 128)),
|
|
1558
|
+
d("div", {
|
|
1559
|
+
class: u(s(a).e("padding"))
|
|
1539
1560
|
}, null, 2)
|
|
1540
|
-
], 34)) :
|
|
1561
|
+
], 34)) : O("", !0)
|
|
1541
1562
|
], 2),
|
|
1542
|
-
|
|
1543
|
-
class: u(s(
|
|
1563
|
+
d("div", {
|
|
1564
|
+
class: u(s(a).e("footer"))
|
|
1544
1565
|
}, [
|
|
1545
|
-
|
|
1546
|
-
class: u(s(
|
|
1547
|
-
}, z(
|
|
1548
|
-
|
|
1549
|
-
class: u(s(
|
|
1566
|
+
d("span", {
|
|
1567
|
+
class: u(s(a).e("current-time"))
|
|
1568
|
+
}, z(R.value), 3),
|
|
1569
|
+
d("div", {
|
|
1570
|
+
class: u(s(a).e("actions"))
|
|
1550
1571
|
}, [
|
|
1551
|
-
|
|
1552
|
-
class: u(s(
|
|
1553
|
-
onClick:
|
|
1572
|
+
d("button", {
|
|
1573
|
+
class: u(s(a).e("btn-cancel")),
|
|
1574
|
+
onClick: X
|
|
1554
1575
|
}, "取消", 2),
|
|
1555
|
-
|
|
1556
|
-
class: u(s(
|
|
1557
|
-
onClick:
|
|
1576
|
+
d("button", {
|
|
1577
|
+
class: u(s(a).e("btn-confirm")),
|
|
1578
|
+
onClick: y
|
|
1558
1579
|
}, "确定", 2)
|
|
1559
1580
|
], 2)
|
|
1560
1581
|
], 2)
|
|
1561
1582
|
], 2));
|
|
1562
1583
|
}
|
|
1563
|
-
}),
|
|
1584
|
+
}), kt = ["placeholder", "disabled", "value"], xt = ["placeholder", "disabled", "value"], wt = ["placeholder", "disabled", "value"], Ll = /* @__PURE__ */ Q({
|
|
1564
1585
|
name: "XTimePicker",
|
|
1565
1586
|
__name: "index",
|
|
1566
1587
|
props: {
|
|
@@ -1583,198 +1604,198 @@ const pt = ["onClick"], ht = ["onClick"], gt = ["onClick"], bt = /* @__PURE__ */
|
|
|
1583
1604
|
secondStep: { default: 1 }
|
|
1584
1605
|
},
|
|
1585
1606
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
1586
|
-
setup(n, { expose:
|
|
1587
|
-
const
|
|
1607
|
+
setup(n, { expose: g, emit: t }) {
|
|
1608
|
+
const e = n, a = t, l = J("time-picker"), m = () => Le().next(), p = E(!1), C = E(2e3), x = E(), P = E(), S = E(), V = E({
|
|
1588
1609
|
top: "0px",
|
|
1589
1610
|
left: "0px"
|
|
1590
|
-
}),
|
|
1611
|
+
}), $ = E({
|
|
1591
1612
|
startTime: null,
|
|
1592
1613
|
endTime: null
|
|
1593
|
-
}),
|
|
1594
|
-
if (!
|
|
1595
|
-
if (
|
|
1596
|
-
const [
|
|
1597
|
-
return [
|
|
1614
|
+
}), F = E("start"), v = b(() => {
|
|
1615
|
+
if (!e.modelValue) return null;
|
|
1616
|
+
if (e.type === "timerange") {
|
|
1617
|
+
const [i, y] = e.modelValue;
|
|
1618
|
+
return [Me(i), Me(y)];
|
|
1598
1619
|
}
|
|
1599
|
-
return
|
|
1600
|
-
}),
|
|
1601
|
-
if (!Array.isArray(
|
|
1602
|
-
const [
|
|
1603
|
-
return
|
|
1604
|
-
}),
|
|
1605
|
-
if (!Array.isArray(
|
|
1606
|
-
const [,
|
|
1607
|
-
return
|
|
1608
|
-
}),
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
]),
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
]),
|
|
1617
|
-
|
|
1618
|
-
},
|
|
1619
|
-
|
|
1620
|
-
},
|
|
1621
|
-
|
|
1622
|
-
if (
|
|
1623
|
-
const
|
|
1624
|
-
let
|
|
1625
|
-
|
|
1626
|
-
top: `${
|
|
1627
|
-
left: `${
|
|
1620
|
+
return Me(e.modelValue);
|
|
1621
|
+
}), D = b(() => !v.value || Array.isArray(v.value) ? "" : pe(v.value, e.format)), M = b(() => {
|
|
1622
|
+
if (!Array.isArray(v.value)) return "";
|
|
1623
|
+
const [i] = v.value;
|
|
1624
|
+
return i ? pe(i, e.format) : "";
|
|
1625
|
+
}), R = b(() => {
|
|
1626
|
+
if (!Array.isArray(v.value)) return "";
|
|
1627
|
+
const [, i] = v.value;
|
|
1628
|
+
return i ? pe(i, e.format) : "";
|
|
1629
|
+
}), A = b(() => e.type === "timerange" ? F.value === "start" ? $.value.startTime : $.value.endTime || $.value.startTime : v.value), h = b(() => [
|
|
1630
|
+
l.b(),
|
|
1631
|
+
l.m(e.size),
|
|
1632
|
+
l.is("disabled", e.disabled),
|
|
1633
|
+
l.is("range", e.type === "timerange")
|
|
1634
|
+
]), f = b(() => [
|
|
1635
|
+
l.e("input"),
|
|
1636
|
+
l.is("focus", p.value)
|
|
1637
|
+
]), k = () => {
|
|
1638
|
+
e.disabled || e.readonly || (p.value ? j() : K());
|
|
1639
|
+
}, N = (i) => {
|
|
1640
|
+
e.disabled || e.readonly || (F.value = i, p.value || K());
|
|
1641
|
+
}, K = () => {
|
|
1642
|
+
p.value = !0, C.value = m(), De(() => {
|
|
1643
|
+
if (x.value && P.value) {
|
|
1644
|
+
const i = x.value.getBoundingClientRect(), y = P.value.getBoundingClientRect();
|
|
1645
|
+
let X = i.bottom + 8, le = i.left;
|
|
1646
|
+
le + y.width > window.innerWidth && (le = window.innerWidth - y.width - 8), X + y.height > window.innerHeight && (X = i.top - y.height - 8), V.value = {
|
|
1647
|
+
top: `${X}px`,
|
|
1648
|
+
left: `${le}px`
|
|
1628
1649
|
};
|
|
1629
1650
|
}
|
|
1630
|
-
}),
|
|
1631
|
-
},
|
|
1632
|
-
|
|
1633
|
-
},
|
|
1634
|
-
if (
|
|
1635
|
-
if (
|
|
1636
|
-
|
|
1651
|
+
}), a("focus", {});
|
|
1652
|
+
}, j = () => {
|
|
1653
|
+
p.value = !1, a("blur", {});
|
|
1654
|
+
}, ee = (i) => {
|
|
1655
|
+
if (e.type === "timerange")
|
|
1656
|
+
if (F.value === "start")
|
|
1657
|
+
$.value.startTime = i, F.value = "end", $.value.endTime && $.value.endTime < i && ($.value.endTime = null);
|
|
1637
1658
|
else {
|
|
1638
|
-
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1659
|
+
$.value.startTime && i < $.value.startTime ? ($.value.endTime = $.value.startTime, $.value.startTime = i) : $.value.endTime = i;
|
|
1660
|
+
const y = e.valueFormat ? pe($.value.startTime, e.valueFormat) : $.value.startTime, X = e.valueFormat ? pe($.value.endTime, e.valueFormat) : $.value.endTime;
|
|
1661
|
+
a("update:modelValue", [y, X]), a("change", [y, X]), j();
|
|
1641
1662
|
}
|
|
1642
1663
|
else {
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1664
|
+
const y = e.valueFormat ? pe(i, e.valueFormat) : i;
|
|
1665
|
+
a("update:modelValue", y), a("change", y), j();
|
|
1645
1666
|
}
|
|
1646
|
-
},
|
|
1647
|
-
|
|
1648
|
-
},
|
|
1649
|
-
|
|
1667
|
+
}, T = () => {
|
|
1668
|
+
j();
|
|
1669
|
+
}, B = () => {
|
|
1670
|
+
a("update:modelValue", null), a("change", null), a("clear"), $.value = {
|
|
1650
1671
|
startTime: null,
|
|
1651
1672
|
endTime: null
|
|
1652
1673
|
};
|
|
1653
|
-
},
|
|
1654
|
-
if (!
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1674
|
+
}, w = (i) => {
|
|
1675
|
+
if (!x.value) return;
|
|
1676
|
+
const y = i.target;
|
|
1677
|
+
x.value.contains(y) || P.value && P.value.contains(y) || j();
|
|
1657
1678
|
};
|
|
1658
|
-
|
|
1659
|
-
() =>
|
|
1660
|
-
(
|
|
1661
|
-
if (
|
|
1662
|
-
const [
|
|
1663
|
-
|
|
1664
|
-
startTime:
|
|
1665
|
-
endTime:
|
|
1679
|
+
de(
|
|
1680
|
+
() => e.modelValue,
|
|
1681
|
+
(i) => {
|
|
1682
|
+
if (i && e.type === "timerange") {
|
|
1683
|
+
const [y, X] = v.value;
|
|
1684
|
+
$.value = {
|
|
1685
|
+
startTime: y,
|
|
1686
|
+
endTime: X
|
|
1666
1687
|
};
|
|
1667
1688
|
}
|
|
1668
1689
|
},
|
|
1669
1690
|
{ immediate: !0 }
|
|
1670
|
-
),
|
|
1671
|
-
|
|
1672
|
-
startTime: Array.isArray(
|
|
1673
|
-
endTime: Array.isArray(
|
|
1674
|
-
},
|
|
1691
|
+
), de(p, (i) => {
|
|
1692
|
+
i && e.type === "timerange" && ($.value = {
|
|
1693
|
+
startTime: Array.isArray(v.value) ? v.value[0] : null,
|
|
1694
|
+
endTime: Array.isArray(v.value) ? v.value[1] : null
|
|
1695
|
+
}, F.value = "start");
|
|
1675
1696
|
});
|
|
1676
|
-
const o = (
|
|
1677
|
-
|
|
1697
|
+
const o = (i) => {
|
|
1698
|
+
i.key === "Escape" && j();
|
|
1678
1699
|
};
|
|
1679
|
-
return
|
|
1680
|
-
document.addEventListener("click",
|
|
1681
|
-
}),
|
|
1682
|
-
document.removeEventListener("click",
|
|
1683
|
-
}),
|
|
1700
|
+
return ke(() => {
|
|
1701
|
+
document.addEventListener("click", w), document.addEventListener("keydown", o);
|
|
1702
|
+
}), xe(() => {
|
|
1703
|
+
document.removeEventListener("click", w), document.removeEventListener("keydown", o);
|
|
1704
|
+
}), g({
|
|
1684
1705
|
focus: () => {
|
|
1685
|
-
var
|
|
1686
|
-
return (
|
|
1706
|
+
var i;
|
|
1707
|
+
return (i = S.value) == null ? void 0 : i.focus();
|
|
1687
1708
|
},
|
|
1688
1709
|
blur: () => {
|
|
1689
|
-
var
|
|
1690
|
-
return (
|
|
1710
|
+
var i;
|
|
1711
|
+
return (i = S.value) == null ? void 0 : i.blur();
|
|
1691
1712
|
}
|
|
1692
|
-
}), (
|
|
1713
|
+
}), (i, y) => (r(), c("div", {
|
|
1693
1714
|
ref_key: "pickerRef",
|
|
1694
|
-
ref:
|
|
1695
|
-
class: u(
|
|
1715
|
+
ref: x,
|
|
1716
|
+
class: u(h.value)
|
|
1696
1717
|
}, [
|
|
1697
|
-
n.type !== "timerange" ? (
|
|
1718
|
+
n.type !== "timerange" ? (r(), c("div", {
|
|
1698
1719
|
key: 0,
|
|
1699
|
-
class: u(
|
|
1700
|
-
onClick:
|
|
1720
|
+
class: u(f.value),
|
|
1721
|
+
onClick: k
|
|
1701
1722
|
}, [
|
|
1702
|
-
|
|
1723
|
+
d("input", {
|
|
1703
1724
|
ref_key: "inputRef",
|
|
1704
|
-
ref:
|
|
1725
|
+
ref: S,
|
|
1705
1726
|
type: "text",
|
|
1706
1727
|
placeholder: n.placeholder,
|
|
1707
1728
|
disabled: n.disabled,
|
|
1708
1729
|
readonly: !0,
|
|
1709
|
-
value:
|
|
1710
|
-
class: u(s(
|
|
1711
|
-
}, null, 10,
|
|
1712
|
-
|
|
1713
|
-
class: u(s(
|
|
1730
|
+
value: D.value,
|
|
1731
|
+
class: u(s(l).e("input-inner"))
|
|
1732
|
+
}, null, 10, kt),
|
|
1733
|
+
d("span", {
|
|
1734
|
+
class: u(s(l).e("suffix"))
|
|
1714
1735
|
}, [
|
|
1715
|
-
n.clearable &&
|
|
1736
|
+
n.clearable && D.value && !n.disabled ? (r(), c("span", {
|
|
1716
1737
|
key: 0,
|
|
1717
|
-
class: u(s(
|
|
1718
|
-
onClick: ue(
|
|
1719
|
-
}, " ✕ ", 2)) : (
|
|
1738
|
+
class: u(s(l).e("clear")),
|
|
1739
|
+
onClick: ue(B, ["stop"])
|
|
1740
|
+
}, " ✕ ", 2)) : (r(), c("span", {
|
|
1720
1741
|
key: 1,
|
|
1721
|
-
class: u(s(
|
|
1742
|
+
class: u(s(l).e("icon"))
|
|
1722
1743
|
}, "🕐", 2))
|
|
1723
1744
|
], 2)
|
|
1724
|
-
], 2)) : (
|
|
1745
|
+
], 2)) : (r(), c("div", {
|
|
1725
1746
|
key: 1,
|
|
1726
|
-
class: u(
|
|
1727
|
-
onClick:
|
|
1747
|
+
class: u(f.value),
|
|
1748
|
+
onClick: k
|
|
1728
1749
|
}, [
|
|
1729
|
-
|
|
1750
|
+
d("input", {
|
|
1730
1751
|
type: "text",
|
|
1731
1752
|
placeholder: n.startPlaceholder,
|
|
1732
1753
|
disabled: n.disabled,
|
|
1733
1754
|
readonly: !0,
|
|
1734
1755
|
value: M.value,
|
|
1735
|
-
class: u([s(
|
|
1736
|
-
onClick:
|
|
1737
|
-
}, null, 10,
|
|
1738
|
-
|
|
1739
|
-
class: u(s(
|
|
1756
|
+
class: u([s(l).e("input-inner"), s(l).is("active", F.value === "start")]),
|
|
1757
|
+
onClick: y[0] || (y[0] = ue((X) => N("start"), ["stop"]))
|
|
1758
|
+
}, null, 10, xt),
|
|
1759
|
+
d("span", {
|
|
1760
|
+
class: u(s(l).e("separator"))
|
|
1740
1761
|
}, "至", 2),
|
|
1741
|
-
|
|
1762
|
+
d("input", {
|
|
1742
1763
|
type: "text",
|
|
1743
1764
|
placeholder: n.endPlaceholder,
|
|
1744
1765
|
disabled: n.disabled,
|
|
1745
1766
|
readonly: !0,
|
|
1746
|
-
value:
|
|
1747
|
-
class: u([s(
|
|
1748
|
-
onClick:
|
|
1749
|
-
}, null, 10,
|
|
1750
|
-
|
|
1751
|
-
class: u(s(
|
|
1767
|
+
value: R.value,
|
|
1768
|
+
class: u([s(l).e("input-inner"), s(l).is("active", F.value === "end")]),
|
|
1769
|
+
onClick: y[1] || (y[1] = ue((X) => N("end"), ["stop"]))
|
|
1770
|
+
}, null, 10, wt),
|
|
1771
|
+
d("span", {
|
|
1772
|
+
class: u(s(l).e("suffix"))
|
|
1752
1773
|
}, [
|
|
1753
|
-
n.clearable && (M.value ||
|
|
1774
|
+
n.clearable && (M.value || R.value) && !n.disabled ? (r(), c("span", {
|
|
1754
1775
|
key: 0,
|
|
1755
|
-
class: u(s(
|
|
1756
|
-
onClick: ue(
|
|
1757
|
-
}, " ✕ ", 2)) : (
|
|
1776
|
+
class: u(s(l).e("clear")),
|
|
1777
|
+
onClick: ue(B, ["stop"])
|
|
1778
|
+
}, " ✕ ", 2)) : (r(), c("span", {
|
|
1758
1779
|
key: 1,
|
|
1759
|
-
class: u(s(
|
|
1780
|
+
class: u(s(l).e("icon"))
|
|
1760
1781
|
}, "🕐", 2))
|
|
1761
1782
|
], 2)
|
|
1762
1783
|
], 2)),
|
|
1763
|
-
(
|
|
1764
|
-
|
|
1784
|
+
(r(), ge(Re, { to: "body" }, [
|
|
1785
|
+
we(Be, { name: "fade" }, {
|
|
1765
1786
|
default: Fe(() => [
|
|
1766
|
-
|
|
1787
|
+
oe(d("div", {
|
|
1767
1788
|
ref_key: "popperRef",
|
|
1768
|
-
ref:
|
|
1769
|
-
class: u(s(
|
|
1770
|
-
style:
|
|
1789
|
+
ref: P,
|
|
1790
|
+
class: u(s(l).e("popper")),
|
|
1791
|
+
style: ne({ zIndex: C.value, ...V.value })
|
|
1771
1792
|
}, [
|
|
1772
|
-
n.type === "timerange" ? (
|
|
1793
|
+
n.type === "timerange" ? (r(), c("div", {
|
|
1773
1794
|
key: 0,
|
|
1774
|
-
class: u(s(
|
|
1775
|
-
}, z(
|
|
1776
|
-
|
|
1777
|
-
"model-value":
|
|
1795
|
+
class: u(s(l).e("popper-header"))
|
|
1796
|
+
}, z(F.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : O("", !0),
|
|
1797
|
+
we(yt, {
|
|
1798
|
+
"model-value": A.value,
|
|
1778
1799
|
format: n.format,
|
|
1779
1800
|
"disabled-hours": n.disabledHours,
|
|
1780
1801
|
"disabled-minutes": n.disabledMinutes,
|
|
@@ -1782,11 +1803,11 @@ const pt = ["onClick"], ht = ["onClick"], gt = ["onClick"], bt = /* @__PURE__ */
|
|
|
1782
1803
|
"hour-step": n.hourStep,
|
|
1783
1804
|
"minute-step": n.minuteStep,
|
|
1784
1805
|
"second-step": n.secondStep,
|
|
1785
|
-
onConfirm:
|
|
1786
|
-
onCancel:
|
|
1806
|
+
onConfirm: ee,
|
|
1807
|
+
onCancel: T
|
|
1787
1808
|
}, null, 8, ["model-value", "format", "disabled-hours", "disabled-minutes", "disabled-seconds", "hour-step", "minute-step", "second-step"])
|
|
1788
1809
|
], 6), [
|
|
1789
|
-
[Ie,
|
|
1810
|
+
[Ie, p.value]
|
|
1790
1811
|
])
|
|
1791
1812
|
]),
|
|
1792
1813
|
_: 1
|
|
@@ -1795,45 +1816,45 @@ const pt = ["onClick"], ht = ["onClick"], gt = ["onClick"], bt = /* @__PURE__ */
|
|
|
1795
1816
|
], 2));
|
|
1796
1817
|
}
|
|
1797
1818
|
});
|
|
1798
|
-
function
|
|
1799
|
-
return
|
|
1819
|
+
function Vt(n, g, t) {
|
|
1820
|
+
return t ? t(g, n) : n.toLowerCase().includes(g.toLowerCase());
|
|
1800
1821
|
}
|
|
1801
|
-
function
|
|
1802
|
-
for (const
|
|
1803
|
-
if (
|
|
1804
|
-
return
|
|
1805
|
-
if (
|
|
1806
|
-
const
|
|
1807
|
-
if (
|
|
1822
|
+
function ze(n, g, t = "value", e = "children") {
|
|
1823
|
+
for (const a of n) {
|
|
1824
|
+
if (a[t] === g)
|
|
1825
|
+
return a;
|
|
1826
|
+
if (a[e] && a[e].length > 0) {
|
|
1827
|
+
const l = ze(a[e], g, t, e);
|
|
1828
|
+
if (l) return l;
|
|
1808
1829
|
}
|
|
1809
1830
|
}
|
|
1810
1831
|
return null;
|
|
1811
1832
|
}
|
|
1812
|
-
function
|
|
1813
|
-
const
|
|
1814
|
-
function
|
|
1815
|
-
for (const
|
|
1816
|
-
if (
|
|
1817
|
-
return
|
|
1818
|
-
if (
|
|
1819
|
-
if (
|
|
1833
|
+
function Te(n, g, t = "value", e = "children") {
|
|
1834
|
+
const a = [];
|
|
1835
|
+
function l(m) {
|
|
1836
|
+
for (const p of m) {
|
|
1837
|
+
if (p[t] === g)
|
|
1838
|
+
return a.push(p), !0;
|
|
1839
|
+
if (p[e] && p[e].length > 0) {
|
|
1840
|
+
if (a.push(p), l(p[e]))
|
|
1820
1841
|
return !0;
|
|
1821
|
-
|
|
1842
|
+
a.pop();
|
|
1822
1843
|
}
|
|
1823
1844
|
}
|
|
1824
1845
|
return !1;
|
|
1825
1846
|
}
|
|
1826
|
-
return
|
|
1847
|
+
return l(n), a;
|
|
1827
1848
|
}
|
|
1828
|
-
function
|
|
1829
|
-
const
|
|
1830
|
-
function
|
|
1831
|
-
for (const
|
|
1832
|
-
|
|
1849
|
+
function Ct(n, g = "children") {
|
|
1850
|
+
const t = [];
|
|
1851
|
+
function e(a, l = 0, m = null) {
|
|
1852
|
+
for (const p of a)
|
|
1853
|
+
t.push({ ...p, level: l, parent: m }), p[g] && p[g].length > 0 && e(p[g], l + 1, p);
|
|
1833
1854
|
}
|
|
1834
|
-
return
|
|
1855
|
+
return e(n), t;
|
|
1835
1856
|
}
|
|
1836
|
-
const
|
|
1857
|
+
const Dt = ["onClick"], $t = ["placeholder", "disabled", "readonly", "value"], St = ["onClick"], Mt = ["onClick"], Pl = /* @__PURE__ */ Q({
|
|
1837
1858
|
name: "XSelect",
|
|
1838
1859
|
__name: "index",
|
|
1839
1860
|
props: {
|
|
@@ -1858,224 +1879,224 @@ const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], S
|
|
|
1858
1879
|
noMatchText: { default: "无匹配数据" }
|
|
1859
1880
|
},
|
|
1860
1881
|
emits: ["update:modelValue", "update:value", "change", "clear", "focus", "blur", "visible-change", "remove-tag"],
|
|
1861
|
-
setup(n, { emit:
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1864
|
-
},
|
|
1865
|
-
const
|
|
1866
|
-
return
|
|
1867
|
-
}),
|
|
1868
|
-
const
|
|
1869
|
-
return
|
|
1870
|
-
})),
|
|
1871
|
-
const
|
|
1872
|
-
for (const
|
|
1873
|
-
const
|
|
1874
|
-
|
|
1882
|
+
setup(n, { emit: g }) {
|
|
1883
|
+
const t = n, e = g, a = J("select"), l = () => Le().next(), m = E(), p = E(), C = E(), x = E(!1), P = E(2e3), S = E(""), V = E(-1), $ = E({ top: "0px", left: "0px" }), F = b(() => t.type === "multiple"), v = b(() => t.type === "cascader"), D = E([]), M = () => t.modelValue !== void 0 ? t.modelValue : t.value !== void 0 ? t.value : "", R = (I) => {
|
|
1884
|
+
e("update:modelValue", I), e("update:value", I), e("change", I);
|
|
1885
|
+
}, A = b(() => {
|
|
1886
|
+
const I = M();
|
|
1887
|
+
return F.value ? Array.isArray(I) ? I : [] : v.value ? Array.isArray(I) ? I : I ? [I] : [] : I !== "" && I !== null && I !== void 0 ? [I] : [];
|
|
1888
|
+
}), h = b(() => v.value ? Ct(t.options, t.childrenKey) : t.options.map((I) => ({ ...I, level: 0 }))), f = b(() => !t.filterable || !S.value ? h.value : h.value.filter((I) => {
|
|
1889
|
+
const W = I[t.labelKey] || "";
|
|
1890
|
+
return Vt(W, S.value, t.filterMethod);
|
|
1891
|
+
})), k = b(() => {
|
|
1892
|
+
const I = [];
|
|
1893
|
+
for (const W of A.value) {
|
|
1894
|
+
const q = ze(t.options, W, t.valueKey, t.childrenKey);
|
|
1895
|
+
q && I.push(q);
|
|
1875
1896
|
}
|
|
1876
|
-
return
|
|
1877
|
-
}),
|
|
1878
|
-
if (
|
|
1897
|
+
return I;
|
|
1898
|
+
}), N = b(() => {
|
|
1899
|
+
if (F.value)
|
|
1879
1900
|
return "";
|
|
1880
|
-
if (
|
|
1881
|
-
return
|
|
1882
|
-
const
|
|
1883
|
-
return
|
|
1884
|
-
}),
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
]),
|
|
1893
|
-
if (!
|
|
1894
|
-
const
|
|
1895
|
-
let
|
|
1896
|
-
|
|
1897
|
-
top: `${
|
|
1898
|
-
left: `${
|
|
1901
|
+
if (v.value)
|
|
1902
|
+
return Te(t.options, A.value[A.value.length - 1], t.valueKey, t.childrenKey).map((q) => q[t.labelKey]).join(t.separator);
|
|
1903
|
+
const I = k.value[0];
|
|
1904
|
+
return I ? I[t.labelKey] : "";
|
|
1905
|
+
}), K = b(() => F.value ? k.value : []), j = b(() => t.collapseTags ? K.value.slice(0, t.maxCollapseTags) : K.value), ee = b(() => t.collapseTags ? Math.max(0, K.value.length - t.maxCollapseTags) : 0), T = b(() => [
|
|
1906
|
+
a.b(),
|
|
1907
|
+
a.m(t.size),
|
|
1908
|
+
a.is("disabled", t.disabled),
|
|
1909
|
+
a.is("multiple", F.value),
|
|
1910
|
+
a.is("cascader", v.value),
|
|
1911
|
+
a.is("filterable", t.filterable),
|
|
1912
|
+
a.is("focus", x.value)
|
|
1913
|
+
]), B = () => {
|
|
1914
|
+
if (!m.value || !C.value || !x.value) return;
|
|
1915
|
+
const I = m.value.getBoundingClientRect(), W = C.value.getBoundingClientRect();
|
|
1916
|
+
let q = I.bottom + 4, se = I.left;
|
|
1917
|
+
se + W.width > window.innerWidth && (se = window.innerWidth - W.width - 8), q + W.height > window.innerHeight && (q = I.top - W.height - 4), $.value = {
|
|
1918
|
+
top: `${q}px`,
|
|
1919
|
+
left: `${se}px`
|
|
1899
1920
|
};
|
|
1900
|
-
},
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
}),
|
|
1921
|
+
}, w = () => {
|
|
1922
|
+
t.disabled || (x.value = !0, P.value = l(), S.value = "", De(() => {
|
|
1923
|
+
B();
|
|
1924
|
+
}), e("visible-change", !0), e("focus", {}));
|
|
1904
1925
|
}, o = () => {
|
|
1905
|
-
|
|
1906
|
-
},
|
|
1907
|
-
if (!
|
|
1908
|
-
if (
|
|
1909
|
-
const
|
|
1910
|
-
if (
|
|
1911
|
-
|
|
1926
|
+
x.value = !1, S.value = "", D.value = [], e("visible-change", !1), e("blur", {});
|
|
1927
|
+
}, i = (I) => {
|
|
1928
|
+
if (!I.disabled)
|
|
1929
|
+
if (F.value) {
|
|
1930
|
+
const W = [...A.value], q = I[t.valueKey], se = W.indexOf(q);
|
|
1931
|
+
if (se > -1)
|
|
1932
|
+
W.splice(se, 1), e("remove-tag", q);
|
|
1912
1933
|
else {
|
|
1913
|
-
if (
|
|
1934
|
+
if (t.multipleLimit > 0 && W.length >= t.multipleLimit)
|
|
1914
1935
|
return;
|
|
1915
|
-
|
|
1936
|
+
W.push(q);
|
|
1916
1937
|
}
|
|
1917
|
-
|
|
1918
|
-
} else if (
|
|
1919
|
-
if (
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1938
|
+
R(W);
|
|
1939
|
+
} else if (v.value)
|
|
1940
|
+
if (I.children && I.children.length > 0) {
|
|
1941
|
+
const W = Te(t.options, I[t.valueKey], t.valueKey, t.childrenKey);
|
|
1942
|
+
D.value = W;
|
|
1922
1943
|
} else {
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1944
|
+
const q = Te(t.options, I[t.valueKey], t.valueKey, t.childrenKey).map((se) => se[t.valueKey]);
|
|
1945
|
+
R(q), o();
|
|
1925
1946
|
}
|
|
1926
1947
|
else
|
|
1927
|
-
|
|
1928
|
-
},
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1931
|
-
},
|
|
1932
|
-
const
|
|
1933
|
-
|
|
1934
|
-
},
|
|
1935
|
-
|
|
1936
|
-
},
|
|
1937
|
-
if (!
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
-
},
|
|
1941
|
-
if (
|
|
1948
|
+
R(I[t.valueKey]), o();
|
|
1949
|
+
}, y = (I) => {
|
|
1950
|
+
const W = A.value.filter((q) => q !== I[t.valueKey]);
|
|
1951
|
+
R(W), e("remove-tag", I[t.valueKey]);
|
|
1952
|
+
}, X = () => {
|
|
1953
|
+
const I = F.value ? [] : "";
|
|
1954
|
+
R(I), e("clear");
|
|
1955
|
+
}, le = (I) => {
|
|
1956
|
+
S.value = I.target.value;
|
|
1957
|
+
}, Y = (I) => {
|
|
1958
|
+
if (!m.value) return;
|
|
1959
|
+
const W = I.target;
|
|
1960
|
+
m.value.contains(W) || C.value && C.value.contains(W) || o();
|
|
1961
|
+
}, te = (I) => {
|
|
1962
|
+
if (I.key === "Escape")
|
|
1942
1963
|
o();
|
|
1943
|
-
else if (
|
|
1944
|
-
const
|
|
1945
|
-
|
|
1946
|
-
} else
|
|
1947
|
-
},
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
],
|
|
1954
|
-
if (!
|
|
1955
|
-
const
|
|
1956
|
-
for (const
|
|
1957
|
-
|
|
1958
|
-
return
|
|
1964
|
+
else if (I.key === "Enter" && x.value) {
|
|
1965
|
+
const W = f.value[V.value];
|
|
1966
|
+
W && i(W);
|
|
1967
|
+
} else I.key === "ArrowDown" && x.value ? (I.preventDefault(), V.value = Math.min(V.value + 1, f.value.length - 1)) : I.key === "ArrowUp" && x.value && (I.preventDefault(), V.value = Math.max(V.value - 1, 0));
|
|
1968
|
+
}, H = (I) => A.value.includes(I[t.valueKey]), ce = (I, W) => [
|
|
1969
|
+
a.e("option"),
|
|
1970
|
+
a.is("selected", H(I)),
|
|
1971
|
+
a.is("disabled", I.disabled === !0),
|
|
1972
|
+
a.is("hover", V.value === W),
|
|
1973
|
+
a.is("group", !!(I.children && I.children.length > 0))
|
|
1974
|
+
], ye = b(() => {
|
|
1975
|
+
if (!v.value) return [];
|
|
1976
|
+
const I = [t.options];
|
|
1977
|
+
for (const W of D.value)
|
|
1978
|
+
W.children && W.children.length > 0 && I.push(W.children);
|
|
1979
|
+
return I;
|
|
1959
1980
|
});
|
|
1960
|
-
return
|
|
1961
|
-
document.addEventListener("click",
|
|
1962
|
-
}),
|
|
1963
|
-
document.removeEventListener("click",
|
|
1964
|
-
}),
|
|
1965
|
-
|
|
1966
|
-
}),
|
|
1967
|
-
selectedValues:
|
|
1968
|
-
handleSelect:
|
|
1969
|
-
isSelected:
|
|
1970
|
-
}), (
|
|
1981
|
+
return ke(() => {
|
|
1982
|
+
document.addEventListener("click", Y), document.addEventListener("keydown", te);
|
|
1983
|
+
}), xe(() => {
|
|
1984
|
+
document.removeEventListener("click", Y), document.removeEventListener("keydown", te), document.removeEventListener("scroll", B, !0);
|
|
1985
|
+
}), de(x, (I) => {
|
|
1986
|
+
I ? document.addEventListener("scroll", B, !0) : document.removeEventListener("scroll", B, !0);
|
|
1987
|
+
}), Ce("select", {
|
|
1988
|
+
selectedValues: A,
|
|
1989
|
+
handleSelect: i,
|
|
1990
|
+
isSelected: H
|
|
1991
|
+
}), (I, W) => (r(), c("div", {
|
|
1971
1992
|
ref_key: "selectRef",
|
|
1972
|
-
ref:
|
|
1973
|
-
class: u(
|
|
1993
|
+
ref: m,
|
|
1994
|
+
class: u(T.value)
|
|
1974
1995
|
}, [
|
|
1975
|
-
|
|
1976
|
-
class: u(s(
|
|
1977
|
-
onClick:
|
|
1996
|
+
d("div", {
|
|
1997
|
+
class: u(s(a).e("wrapper")),
|
|
1998
|
+
onClick: W[0] || (W[0] = (q) => x.value ? o() : w())
|
|
1978
1999
|
}, [
|
|
1979
|
-
|
|
2000
|
+
F.value && K.value.length > 0 ? (r(), c("div", {
|
|
1980
2001
|
key: 0,
|
|
1981
|
-
class: u(s(
|
|
2002
|
+
class: u(s(a).e("tags"))
|
|
1982
2003
|
}, [
|
|
1983
|
-
(
|
|
1984
|
-
key:
|
|
1985
|
-
class: u(s(
|
|
2004
|
+
(r(!0), c(G, null, Z(j.value, (q) => (r(), c("span", {
|
|
2005
|
+
key: q[n.valueKey],
|
|
2006
|
+
class: u(s(a).e("tag"))
|
|
1986
2007
|
}, [
|
|
1987
|
-
|
|
1988
|
-
class: u(s(
|
|
1989
|
-
}, z(
|
|
1990
|
-
|
|
1991
|
-
class: u(s(
|
|
1992
|
-
onClick: ue((
|
|
1993
|
-
}, "×", 10,
|
|
2008
|
+
d("span", {
|
|
2009
|
+
class: u(s(a).e("tag-text"))
|
|
2010
|
+
}, z(q[n.labelKey]), 3),
|
|
2011
|
+
d("span", {
|
|
2012
|
+
class: u(s(a).e("tag-close")),
|
|
2013
|
+
onClick: ue((se) => y(q), ["stop"])
|
|
2014
|
+
}, "×", 10, Dt)
|
|
1994
2015
|
], 2))), 128)),
|
|
1995
|
-
|
|
2016
|
+
ee.value > 0 ? (r(), c("span", {
|
|
1996
2017
|
key: 0,
|
|
1997
|
-
class: u(s(
|
|
1998
|
-
}, " +" + z(
|
|
1999
|
-
], 2)) :
|
|
2000
|
-
|
|
2018
|
+
class: u(s(a).e("tag-count"))
|
|
2019
|
+
}, " +" + z(ee.value), 3)) : O("", !0)
|
|
2020
|
+
], 2)) : O("", !0),
|
|
2021
|
+
d("input", {
|
|
2001
2022
|
ref_key: "inputRef",
|
|
2002
|
-
ref:
|
|
2003
|
-
class: u(s(
|
|
2004
|
-
placeholder:
|
|
2023
|
+
ref: p,
|
|
2024
|
+
class: u(s(a).e("input")),
|
|
2025
|
+
placeholder: F.value && K.value.length > 0 ? "" : n.placeholder,
|
|
2005
2026
|
disabled: n.disabled,
|
|
2006
|
-
readonly: !n.filterable || !
|
|
2007
|
-
value: n.filterable &&
|
|
2008
|
-
onInput:
|
|
2009
|
-
}, null, 42,
|
|
2010
|
-
|
|
2011
|
-
class: u(s(
|
|
2027
|
+
readonly: !n.filterable || !x.value,
|
|
2028
|
+
value: n.filterable && x.value ? S.value : N.value,
|
|
2029
|
+
onInput: le
|
|
2030
|
+
}, null, 42, $t),
|
|
2031
|
+
d("span", {
|
|
2032
|
+
class: u(s(a).e("suffix"))
|
|
2012
2033
|
}, [
|
|
2013
|
-
n.clearable &&
|
|
2034
|
+
n.clearable && A.value.length > 0 && !n.disabled ? (r(), c("span", {
|
|
2014
2035
|
key: 0,
|
|
2015
|
-
class: u(s(
|
|
2016
|
-
onClick: ue(
|
|
2017
|
-
}, "×", 2)) : (
|
|
2036
|
+
class: u(s(a).e("clear")),
|
|
2037
|
+
onClick: ue(X, ["stop"])
|
|
2038
|
+
}, "×", 2)) : (r(), c("span", {
|
|
2018
2039
|
key: 1,
|
|
2019
|
-
class: u([s(
|
|
2040
|
+
class: u([s(a).e("arrow"), s(a).is("reverse", x.value)])
|
|
2020
2041
|
}, "▼", 2))
|
|
2021
2042
|
], 2)
|
|
2022
2043
|
], 2),
|
|
2023
|
-
(
|
|
2024
|
-
|
|
2044
|
+
(r(), ge(Re, { to: "body" }, [
|
|
2045
|
+
we(Be, { name: "fade" }, {
|
|
2025
2046
|
default: Fe(() => [
|
|
2026
|
-
|
|
2047
|
+
oe(d("div", {
|
|
2027
2048
|
ref_key: "popperRef",
|
|
2028
|
-
ref:
|
|
2029
|
-
class: u([s(
|
|
2030
|
-
style:
|
|
2049
|
+
ref: C,
|
|
2050
|
+
class: u([s(a).e("popper"), s(a).is("cascader", v.value)]),
|
|
2051
|
+
style: ne({ zIndex: P.value, ...$.value })
|
|
2031
2052
|
}, [
|
|
2032
|
-
|
|
2053
|
+
v.value ? (r(), c("div", {
|
|
2033
2054
|
key: 0,
|
|
2034
|
-
class: u(s(
|
|
2055
|
+
class: u(s(a).e("cascader-panels"))
|
|
2035
2056
|
}, [
|
|
2036
|
-
(
|
|
2037
|
-
key:
|
|
2038
|
-
class: u(s(
|
|
2057
|
+
(r(!0), c(G, null, Z(ye.value, (q, se) => (r(), c("div", {
|
|
2058
|
+
key: se,
|
|
2059
|
+
class: u(s(a).e("cascader-panel"))
|
|
2039
2060
|
}, [
|
|
2040
|
-
(
|
|
2041
|
-
key:
|
|
2042
|
-
class: u(re
|
|
2043
|
-
onClick: (
|
|
2061
|
+
(r(!0), c(G, null, Z(q, (re, L) => (r(), c("div", {
|
|
2062
|
+
key: re[n.valueKey],
|
|
2063
|
+
class: u(ce(re, L)),
|
|
2064
|
+
onClick: (U) => i(re)
|
|
2044
2065
|
}, [
|
|
2045
|
-
|
|
2046
|
-
class: u(s(
|
|
2047
|
-
}, z(
|
|
2048
|
-
|
|
2066
|
+
d("span", {
|
|
2067
|
+
class: u(s(a).e("option-label"))
|
|
2068
|
+
}, z(re[n.labelKey]), 3),
|
|
2069
|
+
re.children && re.children.length > 0 ? (r(), c("span", {
|
|
2049
2070
|
key: 0,
|
|
2050
|
-
class: u(s(
|
|
2051
|
-
}, "›", 2)) :
|
|
2071
|
+
class: u(s(a).e("option-arrow"))
|
|
2072
|
+
}, "›", 2)) : O("", !0)
|
|
2052
2073
|
], 10, St))), 128))
|
|
2053
2074
|
], 2))), 128))
|
|
2054
|
-
], 2)) : (
|
|
2055
|
-
|
|
2075
|
+
], 2)) : (r(), c(G, { key: 1 }, [
|
|
2076
|
+
f.value.length === 0 ? (r(), c("div", {
|
|
2056
2077
|
key: 0,
|
|
2057
|
-
class: u(s(
|
|
2058
|
-
}, z(
|
|
2078
|
+
class: u(s(a).e("empty"))
|
|
2079
|
+
}, z(S.value ? n.noMatchText : n.noDataText), 3)) : (r(), c("div", {
|
|
2059
2080
|
key: 1,
|
|
2060
|
-
class: u(s(
|
|
2081
|
+
class: u(s(a).e("options"))
|
|
2061
2082
|
}, [
|
|
2062
|
-
(
|
|
2063
|
-
key:
|
|
2064
|
-
class: u(
|
|
2065
|
-
onClick: (
|
|
2083
|
+
(r(!0), c(G, null, Z(f.value, (q, se) => (r(), c("div", {
|
|
2084
|
+
key: q[n.valueKey],
|
|
2085
|
+
class: u(ce(q, se)),
|
|
2086
|
+
onClick: (re) => i(q)
|
|
2066
2087
|
}, [
|
|
2067
|
-
|
|
2068
|
-
class: u(s(
|
|
2069
|
-
}, z(
|
|
2070
|
-
|
|
2088
|
+
d("span", {
|
|
2089
|
+
class: u(s(a).e("option-label"))
|
|
2090
|
+
}, z(q[n.labelKey]), 3),
|
|
2091
|
+
H(q) ? (r(), c("span", {
|
|
2071
2092
|
key: 0,
|
|
2072
|
-
class: u(s(
|
|
2073
|
-
}, "✓", 2)) :
|
|
2074
|
-
], 10,
|
|
2093
|
+
class: u(s(a).e("option-check"))
|
|
2094
|
+
}, "✓", 2)) : O("", !0)
|
|
2095
|
+
], 10, Mt))), 128))
|
|
2075
2096
|
], 2))
|
|
2076
2097
|
], 64))
|
|
2077
2098
|
], 6), [
|
|
2078
|
-
[Ie,
|
|
2099
|
+
[Ie, x.value]
|
|
2079
2100
|
])
|
|
2080
2101
|
]),
|
|
2081
2102
|
_: 1
|
|
@@ -2083,7 +2104,7 @@ const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], S
|
|
|
2083
2104
|
]))
|
|
2084
2105
|
], 2));
|
|
2085
2106
|
}
|
|
2086
|
-
}),
|
|
2107
|
+
}), Tt = ["checked", "indeterminate"], Rt = ["placeholder"], Bt = ["onClick"], Ft = ["checked", "disabled", "onChange"], It = ["disabled"], Lt = ["disabled"], Pt = ["checked", "indeterminate"], At = ["placeholder"], Et = ["onClick"], Yt = ["checked", "disabled", "onChange"], Al = /* @__PURE__ */ Q({
|
|
2087
2108
|
name: "XTransfer",
|
|
2088
2109
|
__name: "index",
|
|
2089
2110
|
props: {
|
|
@@ -2100,222 +2121,222 @@ const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], S
|
|
|
2100
2121
|
rightDefaultChecked: { default: () => [] }
|
|
2101
2122
|
},
|
|
2102
2123
|
emits: ["update:modelValue", "change", "left-check-change", "right-check-change"],
|
|
2103
|
-
setup(n, { expose:
|
|
2104
|
-
const
|
|
2124
|
+
setup(n, { expose: g, emit: t }) {
|
|
2125
|
+
const e = n, a = t, l = J("transfer"), m = b(() => {
|
|
2105
2126
|
var o;
|
|
2106
|
-
return ((o =
|
|
2107
|
-
}),
|
|
2127
|
+
return ((o = e.props) == null ? void 0 : o.key) || "key";
|
|
2128
|
+
}), p = b(() => {
|
|
2108
2129
|
var o;
|
|
2109
|
-
return ((o =
|
|
2110
|
-
}),
|
|
2130
|
+
return ((o = e.props) == null ? void 0 : o.label) || "label";
|
|
2131
|
+
}), C = b(() => {
|
|
2111
2132
|
var o;
|
|
2112
|
-
return ((o =
|
|
2113
|
-
}),
|
|
2114
|
-
const
|
|
2115
|
-
return
|
|
2116
|
-
})), M =
|
|
2117
|
-
const o =
|
|
2118
|
-
let
|
|
2119
|
-
const
|
|
2120
|
-
return o.includes(
|
|
2133
|
+
return ((o = e.props) == null ? void 0 : o.disabled) || "disabled";
|
|
2134
|
+
}), x = E(""), P = E(""), S = E([]), V = E([]), $ = (o) => o[m.value], F = (o) => o[p.value], v = (o) => o[C.value] || !1, D = b(() => e.data.filter((o) => {
|
|
2135
|
+
const i = $(o);
|
|
2136
|
+
return e.modelValue.includes(i) ? !1 : e.filterable && x.value ? e.filterMethod ? e.filterMethod(x.value, o) : F(o).toLowerCase().includes(x.value.toLowerCase()) : !0;
|
|
2137
|
+
})), M = b(() => {
|
|
2138
|
+
const o = e.modelValue;
|
|
2139
|
+
let i = e.data.filter((y) => {
|
|
2140
|
+
const X = $(y);
|
|
2141
|
+
return o.includes(X);
|
|
2121
2142
|
});
|
|
2122
|
-
return
|
|
2123
|
-
}),
|
|
2124
|
-
const o =
|
|
2125
|
-
const
|
|
2126
|
-
return
|
|
2143
|
+
return e.filterable && P.value && (i = i.filter((y) => e.filterMethod ? e.filterMethod(P.value, y) : F(y).toLowerCase().includes(P.value.toLowerCase()))), e.targetOrder === "push" ? i.sort((y, X) => o.indexOf($(y)) - o.indexOf($(X))) : e.targetOrder === "unshift" ? i.sort((y, X) => o.indexOf($(X)) - o.indexOf($(y))) : i;
|
|
2144
|
+
}), R = b(() => D.value.filter((o) => S.value.includes($(o))).every((o) => v(o))), A = b(() => M.value.filter((o) => V.value.includes($(o))).every((o) => v(o))), h = b(() => S.value.length === 0 || R.value), f = b(() => V.value.length === 0 || A.value), k = () => {
|
|
2145
|
+
const o = S.value.filter((y) => {
|
|
2146
|
+
const X = e.data.find((le) => $(le) === y);
|
|
2147
|
+
return X && !v(X);
|
|
2127
2148
|
});
|
|
2128
|
-
let
|
|
2129
|
-
|
|
2130
|
-
},
|
|
2131
|
-
const o =
|
|
2132
|
-
const
|
|
2133
|
-
return
|
|
2134
|
-
}),
|
|
2135
|
-
|
|
2136
|
-
},
|
|
2137
|
-
const
|
|
2138
|
-
|
|
2139
|
-
},
|
|
2140
|
-
const
|
|
2141
|
-
|
|
2142
|
-
},
|
|
2143
|
-
|
|
2144
|
-
},
|
|
2145
|
-
|
|
2146
|
-
},
|
|
2147
|
-
o === "left" ?
|
|
2148
|
-
},
|
|
2149
|
-
return
|
|
2150
|
-
clearQuery:
|
|
2151
|
-
}), (o,
|
|
2152
|
-
class: u(
|
|
2149
|
+
let i;
|
|
2150
|
+
e.targetOrder === "unshift" ? i = [...o, ...e.modelValue] : i = [...e.modelValue, ...o], a("update:modelValue", i), a("change", i, "right", o), S.value = [];
|
|
2151
|
+
}, N = () => {
|
|
2152
|
+
const o = V.value.filter((y) => {
|
|
2153
|
+
const X = e.data.find((le) => $(le) === y);
|
|
2154
|
+
return X && !v(X);
|
|
2155
|
+
}), i = e.modelValue.filter((y) => !o.includes(y));
|
|
2156
|
+
a("update:modelValue", i), a("change", i, "left", o), V.value = [];
|
|
2157
|
+
}, K = (o) => {
|
|
2158
|
+
const i = S.value.indexOf(o);
|
|
2159
|
+
i > -1 ? S.value.splice(i, 1) : S.value.push(o), a("left-check-change", [...S.value]);
|
|
2160
|
+
}, j = (o) => {
|
|
2161
|
+
const i = V.value.indexOf(o);
|
|
2162
|
+
i > -1 ? V.value.splice(i, 1) : V.value.push(o), a("right-check-change", [...V.value]);
|
|
2163
|
+
}, ee = () => {
|
|
2164
|
+
S.value.length === D.value.filter((o) => !v(o)).length ? S.value = [] : S.value = D.value.filter((o) => !v(o)).map((o) => $(o)), a("left-check-change", [...S.value]);
|
|
2165
|
+
}, T = () => {
|
|
2166
|
+
V.value.length === M.value.filter((o) => !v(o)).length ? V.value = [] : V.value = M.value.filter((o) => !v(o)).map((o) => $(o)), a("right-check-change", [...V.value]);
|
|
2167
|
+
}, B = (o) => {
|
|
2168
|
+
o === "left" ? x.value = "" : P.value = "";
|
|
2169
|
+
}, w = b(() => [l.b()]);
|
|
2170
|
+
return g({
|
|
2171
|
+
clearQuery: B
|
|
2172
|
+
}), (o, i) => (r(), c("div", {
|
|
2173
|
+
class: u(w.value)
|
|
2153
2174
|
}, [
|
|
2154
|
-
|
|
2155
|
-
class: u(s(
|
|
2175
|
+
d("div", {
|
|
2176
|
+
class: u(s(l).e("panel"))
|
|
2156
2177
|
}, [
|
|
2157
|
-
|
|
2158
|
-
class: u(s(
|
|
2178
|
+
d("div", {
|
|
2179
|
+
class: u(s(l).e("header"))
|
|
2159
2180
|
}, [
|
|
2160
|
-
|
|
2161
|
-
class: u(s(
|
|
2181
|
+
d("label", {
|
|
2182
|
+
class: u(s(l).e("checkbox"))
|
|
2162
2183
|
}, [
|
|
2163
|
-
|
|
2184
|
+
d("input", {
|
|
2164
2185
|
type: "checkbox",
|
|
2165
|
-
checked:
|
|
2166
|
-
indeterminate:
|
|
2167
|
-
onChange:
|
|
2168
|
-
}, null, 40,
|
|
2169
|
-
|
|
2186
|
+
checked: S.value.length > 0 && S.value.length === D.value.filter((y) => !v(y)).length,
|
|
2187
|
+
indeterminate: S.value.length > 0 && S.value.length < D.value.filter((y) => !v(y)).length,
|
|
2188
|
+
onChange: ee
|
|
2189
|
+
}, null, 40, Tt),
|
|
2190
|
+
d("span", null, z(n.titles[0]), 1)
|
|
2170
2191
|
], 2),
|
|
2171
|
-
|
|
2172
|
-
class: u(s(
|
|
2173
|
-
}, z(
|
|
2192
|
+
d("span", {
|
|
2193
|
+
class: u(s(l).e("count"))
|
|
2194
|
+
}, z(S.value.length) + " / " + z(D.value.length), 3)
|
|
2174
2195
|
], 2),
|
|
2175
|
-
n.filterable ? (
|
|
2196
|
+
n.filterable ? (r(), c("div", {
|
|
2176
2197
|
key: 0,
|
|
2177
|
-
class: u(s(
|
|
2198
|
+
class: u(s(l).e("filter"))
|
|
2178
2199
|
}, [
|
|
2179
|
-
|
|
2180
|
-
"onUpdate:modelValue":
|
|
2200
|
+
oe(d("input", {
|
|
2201
|
+
"onUpdate:modelValue": i[0] || (i[0] = (y) => x.value = y),
|
|
2181
2202
|
placeholder: n.filterPlaceholder,
|
|
2182
|
-
class: u(s(
|
|
2183
|
-
}, null, 10,
|
|
2184
|
-
[
|
|
2203
|
+
class: u(s(l).e("filter-input"))
|
|
2204
|
+
}, null, 10, Rt), [
|
|
2205
|
+
[be, x.value]
|
|
2185
2206
|
]),
|
|
2186
|
-
|
|
2207
|
+
x.value ? (r(), c("span", {
|
|
2187
2208
|
key: 0,
|
|
2188
|
-
class: u(s(
|
|
2189
|
-
onClick:
|
|
2190
|
-
}, "×", 2)) :
|
|
2191
|
-
], 2)) :
|
|
2192
|
-
|
|
2193
|
-
class: u(s(
|
|
2209
|
+
class: u(s(l).e("filter-clear")),
|
|
2210
|
+
onClick: i[1] || (i[1] = (y) => B("left"))
|
|
2211
|
+
}, "×", 2)) : O("", !0)
|
|
2212
|
+
], 2)) : O("", !0),
|
|
2213
|
+
d("div", {
|
|
2214
|
+
class: u(s(l).e("body"))
|
|
2194
2215
|
}, [
|
|
2195
|
-
(
|
|
2196
|
-
key:
|
|
2216
|
+
(r(!0), c(G, null, Z(D.value, (y) => (r(), c("div", {
|
|
2217
|
+
key: $(y),
|
|
2197
2218
|
class: u([
|
|
2198
|
-
s(
|
|
2199
|
-
s(
|
|
2200
|
-
s(
|
|
2219
|
+
s(l).e("item"),
|
|
2220
|
+
s(l).is("disabled", v(y)),
|
|
2221
|
+
s(l).is("checked", S.value.includes($(y)))
|
|
2201
2222
|
]),
|
|
2202
|
-
onClick: (
|
|
2223
|
+
onClick: (X) => !v(y) && K($(y))
|
|
2203
2224
|
}, [
|
|
2204
|
-
|
|
2205
|
-
class: u(s(
|
|
2225
|
+
d("label", {
|
|
2226
|
+
class: u(s(l).e("checkbox"))
|
|
2206
2227
|
}, [
|
|
2207
|
-
|
|
2228
|
+
d("input", {
|
|
2208
2229
|
type: "checkbox",
|
|
2209
|
-
checked:
|
|
2210
|
-
disabled:
|
|
2211
|
-
onClick:
|
|
2230
|
+
checked: S.value.includes($(y)),
|
|
2231
|
+
disabled: v(y),
|
|
2232
|
+
onClick: i[2] || (i[2] = ue(() => {
|
|
2212
2233
|
}, ["stop"])),
|
|
2213
|
-
onChange: (
|
|
2214
|
-
}, null, 40,
|
|
2215
|
-
|
|
2234
|
+
onChange: (X) => K($(y))
|
|
2235
|
+
}, null, 40, Ft),
|
|
2236
|
+
d("span", null, z(F(y)), 1)
|
|
2216
2237
|
], 2)
|
|
2217
|
-
], 10,
|
|
2218
|
-
|
|
2238
|
+
], 10, Bt))), 128)),
|
|
2239
|
+
D.value.length === 0 ? (r(), c("div", {
|
|
2219
2240
|
key: 0,
|
|
2220
|
-
class: u(s(
|
|
2241
|
+
class: u(s(l).e("empty"))
|
|
2221
2242
|
}, [
|
|
2222
|
-
|
|
2223
|
-
|
|
2243
|
+
ae(o.$slots, "left-empty", {}, () => [
|
|
2244
|
+
i[6] || (i[6] = me("暂无数据", -1))
|
|
2224
2245
|
])
|
|
2225
|
-
], 2)) :
|
|
2246
|
+
], 2)) : O("", !0)
|
|
2226
2247
|
], 2)
|
|
2227
2248
|
], 2),
|
|
2228
|
-
|
|
2229
|
-
class: u(s(
|
|
2249
|
+
d("div", {
|
|
2250
|
+
class: u(s(l).e("buttons"))
|
|
2230
2251
|
}, [
|
|
2231
|
-
|
|
2232
|
-
class: u([s(
|
|
2233
|
-
disabled:
|
|
2234
|
-
onClick:
|
|
2235
|
-
}, z(n.buttonTexts[0] || ">"), 11,
|
|
2236
|
-
|
|
2237
|
-
class: u([s(
|
|
2238
|
-
disabled:
|
|
2239
|
-
onClick:
|
|
2240
|
-
}, z(n.buttonTexts[1] || "<"), 11,
|
|
2252
|
+
d("button", {
|
|
2253
|
+
class: u([s(l).e("button"), s(l).is("disabled", h.value)]),
|
|
2254
|
+
disabled: h.value,
|
|
2255
|
+
onClick: k
|
|
2256
|
+
}, z(n.buttonTexts[0] || ">"), 11, It),
|
|
2257
|
+
d("button", {
|
|
2258
|
+
class: u([s(l).e("button"), s(l).is("disabled", f.value)]),
|
|
2259
|
+
disabled: f.value,
|
|
2260
|
+
onClick: N
|
|
2261
|
+
}, z(n.buttonTexts[1] || "<"), 11, Lt)
|
|
2241
2262
|
], 2),
|
|
2242
|
-
|
|
2243
|
-
class: u(s(
|
|
2263
|
+
d("div", {
|
|
2264
|
+
class: u(s(l).e("panel"))
|
|
2244
2265
|
}, [
|
|
2245
|
-
|
|
2246
|
-
class: u(s(
|
|
2266
|
+
d("div", {
|
|
2267
|
+
class: u(s(l).e("header"))
|
|
2247
2268
|
}, [
|
|
2248
|
-
|
|
2249
|
-
class: u(s(
|
|
2269
|
+
d("label", {
|
|
2270
|
+
class: u(s(l).e("checkbox"))
|
|
2250
2271
|
}, [
|
|
2251
|
-
|
|
2272
|
+
d("input", {
|
|
2252
2273
|
type: "checkbox",
|
|
2253
|
-
checked:
|
|
2254
|
-
indeterminate:
|
|
2255
|
-
onChange:
|
|
2256
|
-
}, null, 40,
|
|
2257
|
-
|
|
2274
|
+
checked: V.value.length > 0 && V.value.length === M.value.filter((y) => !v(y)).length,
|
|
2275
|
+
indeterminate: V.value.length > 0 && V.value.length < M.value.filter((y) => !v(y)).length,
|
|
2276
|
+
onChange: T
|
|
2277
|
+
}, null, 40, Pt),
|
|
2278
|
+
d("span", null, z(n.titles[1]), 1)
|
|
2258
2279
|
], 2),
|
|
2259
|
-
|
|
2260
|
-
class: u(s(
|
|
2261
|
-
}, z(
|
|
2280
|
+
d("span", {
|
|
2281
|
+
class: u(s(l).e("count"))
|
|
2282
|
+
}, z(V.value.length) + " / " + z(M.value.length), 3)
|
|
2262
2283
|
], 2),
|
|
2263
|
-
n.filterable ? (
|
|
2284
|
+
n.filterable ? (r(), c("div", {
|
|
2264
2285
|
key: 0,
|
|
2265
|
-
class: u(s(
|
|
2286
|
+
class: u(s(l).e("filter"))
|
|
2266
2287
|
}, [
|
|
2267
|
-
|
|
2268
|
-
"onUpdate:modelValue":
|
|
2288
|
+
oe(d("input", {
|
|
2289
|
+
"onUpdate:modelValue": i[3] || (i[3] = (y) => P.value = y),
|
|
2269
2290
|
placeholder: n.filterPlaceholder,
|
|
2270
|
-
class: u(s(
|
|
2271
|
-
}, null, 10,
|
|
2272
|
-
[
|
|
2291
|
+
class: u(s(l).e("filter-input"))
|
|
2292
|
+
}, null, 10, At), [
|
|
2293
|
+
[be, P.value]
|
|
2273
2294
|
]),
|
|
2274
|
-
|
|
2295
|
+
P.value ? (r(), c("span", {
|
|
2275
2296
|
key: 0,
|
|
2276
|
-
class: u(s(
|
|
2277
|
-
onClick:
|
|
2278
|
-
}, "×", 2)) :
|
|
2279
|
-
], 2)) :
|
|
2280
|
-
|
|
2281
|
-
class: u(s(
|
|
2297
|
+
class: u(s(l).e("filter-clear")),
|
|
2298
|
+
onClick: i[4] || (i[4] = (y) => B("right"))
|
|
2299
|
+
}, "×", 2)) : O("", !0)
|
|
2300
|
+
], 2)) : O("", !0),
|
|
2301
|
+
d("div", {
|
|
2302
|
+
class: u(s(l).e("body"))
|
|
2282
2303
|
}, [
|
|
2283
|
-
(
|
|
2284
|
-
key:
|
|
2304
|
+
(r(!0), c(G, null, Z(M.value, (y) => (r(), c("div", {
|
|
2305
|
+
key: $(y),
|
|
2285
2306
|
class: u([
|
|
2286
|
-
s(
|
|
2287
|
-
s(
|
|
2288
|
-
s(
|
|
2307
|
+
s(l).e("item"),
|
|
2308
|
+
s(l).is("disabled", v(y)),
|
|
2309
|
+
s(l).is("checked", V.value.includes($(y)))
|
|
2289
2310
|
]),
|
|
2290
|
-
onClick: (
|
|
2311
|
+
onClick: (X) => !v(y) && j($(y))
|
|
2291
2312
|
}, [
|
|
2292
|
-
|
|
2293
|
-
class: u(s(
|
|
2313
|
+
d("label", {
|
|
2314
|
+
class: u(s(l).e("checkbox"))
|
|
2294
2315
|
}, [
|
|
2295
|
-
|
|
2316
|
+
d("input", {
|
|
2296
2317
|
type: "checkbox",
|
|
2297
|
-
checked:
|
|
2298
|
-
disabled:
|
|
2299
|
-
onClick:
|
|
2318
|
+
checked: V.value.includes($(y)),
|
|
2319
|
+
disabled: v(y),
|
|
2320
|
+
onClick: i[5] || (i[5] = ue(() => {
|
|
2300
2321
|
}, ["stop"])),
|
|
2301
|
-
onChange: (
|
|
2302
|
-
}, null, 40,
|
|
2303
|
-
|
|
2322
|
+
onChange: (X) => j($(y))
|
|
2323
|
+
}, null, 40, Yt),
|
|
2324
|
+
d("span", null, z(F(y)), 1)
|
|
2304
2325
|
], 2)
|
|
2305
|
-
], 10,
|
|
2306
|
-
M.value.length === 0 ? (
|
|
2326
|
+
], 10, Et))), 128)),
|
|
2327
|
+
M.value.length === 0 ? (r(), c("div", {
|
|
2307
2328
|
key: 0,
|
|
2308
|
-
class: u(s(
|
|
2329
|
+
class: u(s(l).e("empty"))
|
|
2309
2330
|
}, [
|
|
2310
|
-
|
|
2311
|
-
|
|
2331
|
+
ae(o.$slots, "right-empty", {}, () => [
|
|
2332
|
+
i[7] || (i[7] = me("暂无数据", -1))
|
|
2312
2333
|
])
|
|
2313
|
-
], 2)) :
|
|
2334
|
+
], 2)) : O("", !0)
|
|
2314
2335
|
], 2)
|
|
2315
2336
|
], 2)
|
|
2316
2337
|
], 2));
|
|
2317
2338
|
}
|
|
2318
|
-
}),
|
|
2339
|
+
}), zt = { key: 0 }, Ht = { key: 1 }, El = /* @__PURE__ */ Q({
|
|
2319
2340
|
name: "XSlider",
|
|
2320
2341
|
__name: "index",
|
|
2321
2342
|
props: {
|
|
@@ -2332,138 +2353,138 @@ const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], S
|
|
|
2332
2353
|
marks: {}
|
|
2333
2354
|
},
|
|
2334
2355
|
emits: ["update:modelValue", "change", "input"],
|
|
2335
|
-
setup(n, { emit:
|
|
2336
|
-
const
|
|
2337
|
-
const
|
|
2338
|
-
return (
|
|
2339
|
-
}),
|
|
2340
|
-
if (!
|
|
2341
|
-
const
|
|
2342
|
-
for (let o = 0; o <=
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2356
|
+
setup(n, { emit: g }) {
|
|
2357
|
+
const t = n, e = g, a = J("slider"), l = E(), m = E(), p = E(!1), C = E(!1), x = b(() => {
|
|
2358
|
+
const B = t.max - t.min;
|
|
2359
|
+
return (t.modelValue - t.min) / B * 100;
|
|
2360
|
+
}), P = b(() => t.formatTooltip ? t.formatTooltip(t.modelValue) : t.modelValue), S = b(() => {
|
|
2361
|
+
if (!t.showStops || t.min >= t.max) return [];
|
|
2362
|
+
const B = [], w = (t.max - t.min) / t.step;
|
|
2363
|
+
for (let o = 0; o <= w; o++) {
|
|
2364
|
+
const i = t.min + o * t.step;
|
|
2365
|
+
i > t.min && i < t.max && B.push((i - t.min) / (t.max - t.min) * 100);
|
|
2345
2366
|
}
|
|
2346
|
-
return
|
|
2347
|
-
}),
|
|
2348
|
-
const
|
|
2349
|
-
let
|
|
2350
|
-
return typeof o == "string" ?
|
|
2351
|
-
}) : []),
|
|
2352
|
-
if (!
|
|
2353
|
-
const o =
|
|
2354
|
-
let
|
|
2355
|
-
|
|
2356
|
-
const
|
|
2357
|
-
return Math.max(
|
|
2358
|
-
},
|
|
2359
|
-
if (
|
|
2360
|
-
const
|
|
2361
|
-
|
|
2362
|
-
},
|
|
2363
|
-
if (
|
|
2364
|
-
|
|
2365
|
-
const
|
|
2366
|
-
|
|
2367
|
-
}, M = (
|
|
2368
|
-
if (!
|
|
2369
|
-
const
|
|
2370
|
-
|
|
2371
|
-
},
|
|
2372
|
-
|
|
2373
|
-
},
|
|
2374
|
-
if (
|
|
2375
|
-
|
|
2376
|
-
const
|
|
2377
|
-
|
|
2378
|
-
},
|
|
2379
|
-
if (!
|
|
2380
|
-
const
|
|
2381
|
-
|
|
2382
|
-
},
|
|
2383
|
-
|
|
2384
|
-
},
|
|
2385
|
-
|
|
2386
|
-
},
|
|
2387
|
-
|
|
2367
|
+
return B;
|
|
2368
|
+
}), V = b(() => t.marks ? Object.keys(t.marks).map((B) => {
|
|
2369
|
+
const w = Number(B), o = t.marks[w], i = (w - t.min) / (t.max - t.min) * 100;
|
|
2370
|
+
let y, X = {};
|
|
2371
|
+
return typeof o == "string" ? y = o : (y = o.label || String(w), X = o.style || {}), { value: w, pos: i, label: y, style: X };
|
|
2372
|
+
}) : []), $ = () => l.value ? t.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0, F = (B, w) => {
|
|
2373
|
+
if (!l.value) return t.modelValue;
|
|
2374
|
+
const o = l.value.getBoundingClientRect(), i = $();
|
|
2375
|
+
let y;
|
|
2376
|
+
t.vertical ? y = (o.bottom - w) / i * 100 : y = (B - o.left) / i * 100, y = Math.max(0, Math.min(100, y));
|
|
2377
|
+
const X = t.min + y / 100 * (t.max - t.min), le = Math.round(X / t.step) * t.step;
|
|
2378
|
+
return Math.max(t.min, Math.min(t.max, le));
|
|
2379
|
+
}, v = (B) => {
|
|
2380
|
+
if (t.disabled) return;
|
|
2381
|
+
const w = Math.max(t.min, Math.min(t.max, B));
|
|
2382
|
+
w !== t.modelValue && (e("update:modelValue", w), e("input", w));
|
|
2383
|
+
}, D = (B) => {
|
|
2384
|
+
if (t.disabled) return;
|
|
2385
|
+
B.preventDefault(), C.value = !0, p.value = !0;
|
|
2386
|
+
const w = F(B.clientX, B.clientY);
|
|
2387
|
+
v(w), document.addEventListener("mousemove", M), document.addEventListener("mouseup", R);
|
|
2388
|
+
}, M = (B) => {
|
|
2389
|
+
if (!C.value) return;
|
|
2390
|
+
const w = F(B.clientX, B.clientY);
|
|
2391
|
+
v(w);
|
|
2392
|
+
}, R = () => {
|
|
2393
|
+
C.value = !1, e("change", t.modelValue), document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", R);
|
|
2394
|
+
}, A = (B) => {
|
|
2395
|
+
if (t.disabled) return;
|
|
2396
|
+
B.preventDefault(), C.value = !0, p.value = !0;
|
|
2397
|
+
const w = B.touches[0], o = F(w.clientX, w.clientY);
|
|
2398
|
+
v(o);
|
|
2399
|
+
}, h = (B) => {
|
|
2400
|
+
if (!C.value) return;
|
|
2401
|
+
const w = B.touches[0], o = F(w.clientX, w.clientY);
|
|
2402
|
+
v(o);
|
|
2403
|
+
}, f = () => {
|
|
2404
|
+
C.value = !1, e("change", t.modelValue);
|
|
2405
|
+
}, k = () => {
|
|
2406
|
+
t.showTooltip && (p.value = !0);
|
|
2407
|
+
}, N = () => {
|
|
2408
|
+
C.value || (p.value = !1);
|
|
2388
2409
|
};
|
|
2389
|
-
|
|
2390
|
-
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup",
|
|
2410
|
+
xe(() => {
|
|
2411
|
+
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", R);
|
|
2391
2412
|
});
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
]),
|
|
2397
|
-
return (
|
|
2398
|
-
class: u(
|
|
2399
|
-
style:
|
|
2413
|
+
const K = b(() => [
|
|
2414
|
+
a.b(),
|
|
2415
|
+
a.is("disabled", t.disabled),
|
|
2416
|
+
a.is("vertical", t.vertical)
|
|
2417
|
+
]), j = b(() => t.vertical && t.height ? { height: typeof t.height == "number" ? `${t.height}px` : t.height } : {}), ee = b(() => t.vertical ? { height: `${x.value}%` } : { width: `${x.value}%` }), T = b(() => t.vertical ? { bottom: `${x.value}%` } : { left: `${x.value}%` });
|
|
2418
|
+
return (B, w) => (r(), c("div", {
|
|
2419
|
+
class: u(K.value),
|
|
2420
|
+
style: ne(j.value)
|
|
2400
2421
|
}, [
|
|
2401
|
-
|
|
2422
|
+
d("div", {
|
|
2402
2423
|
ref_key: "sliderRef",
|
|
2403
|
-
ref:
|
|
2404
|
-
class: u(s(
|
|
2405
|
-
onMousedown:
|
|
2406
|
-
onTouchstart:
|
|
2424
|
+
ref: l,
|
|
2425
|
+
class: u(s(a).e("runway")),
|
|
2426
|
+
onMousedown: D,
|
|
2427
|
+
onTouchstart: A
|
|
2407
2428
|
}, [
|
|
2408
|
-
|
|
2409
|
-
class: u(s(
|
|
2410
|
-
style:
|
|
2429
|
+
d("div", {
|
|
2430
|
+
class: u(s(a).e("bar")),
|
|
2431
|
+
style: ne(ee.value)
|
|
2411
2432
|
}, null, 6),
|
|
2412
|
-
n.showStops ? (
|
|
2413
|
-
(
|
|
2414
|
-
key:
|
|
2415
|
-
class: u(s(
|
|
2416
|
-
style:
|
|
2433
|
+
n.showStops ? (r(), c("div", zt, [
|
|
2434
|
+
(r(!0), c(G, null, Z(S.value, (o, i) => (r(), c("div", {
|
|
2435
|
+
key: i,
|
|
2436
|
+
class: u(s(a).e("stop")),
|
|
2437
|
+
style: ne(n.vertical ? { bottom: `${o}%` } : { left: `${o}%` })
|
|
2417
2438
|
}, null, 6))), 128))
|
|
2418
|
-
])) :
|
|
2419
|
-
|
|
2420
|
-
(
|
|
2439
|
+
])) : O("", !0),
|
|
2440
|
+
V.value.length > 0 ? (r(), c("div", Ht, [
|
|
2441
|
+
(r(!0), c(G, null, Z(V.value, (o) => (r(), c("div", {
|
|
2421
2442
|
key: o.value,
|
|
2422
|
-
class: u(s(
|
|
2423
|
-
style:
|
|
2443
|
+
class: u(s(a).e("mark")),
|
|
2444
|
+
style: ne(n.vertical ? { bottom: `${o.pos}%` } : { left: `${o.pos}%`, ...o.style })
|
|
2424
2445
|
}, [
|
|
2425
|
-
|
|
2426
|
-
class: u(s(
|
|
2446
|
+
d("span", {
|
|
2447
|
+
class: u(s(a).e("mark-text"))
|
|
2427
2448
|
}, z(o.label), 3)
|
|
2428
2449
|
], 6))), 128))
|
|
2429
|
-
])) :
|
|
2430
|
-
|
|
2450
|
+
])) : O("", !0),
|
|
2451
|
+
d("div", {
|
|
2431
2452
|
ref_key: "buttonRef",
|
|
2432
|
-
ref:
|
|
2433
|
-
class: u(s(
|
|
2434
|
-
style:
|
|
2435
|
-
onMouseenter:
|
|
2436
|
-
onMouseleave:
|
|
2437
|
-
onTouchmove:
|
|
2438
|
-
onTouchend:
|
|
2453
|
+
ref: m,
|
|
2454
|
+
class: u(s(a).e("button-wrapper")),
|
|
2455
|
+
style: ne(T.value),
|
|
2456
|
+
onMouseenter: k,
|
|
2457
|
+
onMouseleave: N,
|
|
2458
|
+
onTouchmove: h,
|
|
2459
|
+
onTouchend: f
|
|
2439
2460
|
}, [
|
|
2440
|
-
n.showTooltip &&
|
|
2461
|
+
n.showTooltip && p.value ? (r(), c("div", {
|
|
2441
2462
|
key: 0,
|
|
2442
|
-
class: u(s(
|
|
2443
|
-
}, z(
|
|
2444
|
-
|
|
2445
|
-
class: u(s(
|
|
2463
|
+
class: u(s(a).e("tooltip"))
|
|
2464
|
+
}, z(P.value), 3)) : O("", !0),
|
|
2465
|
+
d("div", {
|
|
2466
|
+
class: u(s(a).e("button"))
|
|
2446
2467
|
}, null, 2)
|
|
2447
2468
|
], 38)
|
|
2448
2469
|
], 34)
|
|
2449
2470
|
], 6));
|
|
2450
2471
|
}
|
|
2451
|
-
}),
|
|
2472
|
+
}), Ot = ["src"], Nt = {
|
|
2452
2473
|
key: 0,
|
|
2453
2474
|
class: "status-uploading"
|
|
2454
|
-
},
|
|
2475
|
+
}, Ut = { class: "progress-circle" }, Xt = { class: "progress-text" }, Kt = {
|
|
2455
2476
|
key: 1,
|
|
2456
2477
|
class: "status-error"
|
|
2457
|
-
},
|
|
2478
|
+
}, Wt = {
|
|
2458
2479
|
key: 2,
|
|
2459
2480
|
class: "status-success"
|
|
2460
|
-
},
|
|
2481
|
+
}, qt = {
|
|
2461
2482
|
key: 0,
|
|
2462
2483
|
class: "action-preview"
|
|
2463
|
-
}, Gt = ["onClick"],
|
|
2484
|
+
}, Gt = ["onClick"], jt = ["disabled"], Zt = { class: "progress-text" }, Qt = ["onClick"], Jt = ["src"], _t = {
|
|
2464
2485
|
key: 0,
|
|
2465
2486
|
class: "action-success"
|
|
2466
|
-
},
|
|
2487
|
+
}, el = ["onClick"], tl = ["multiple", "accept", "disabled"], Yl = /* @__PURE__ */ Q({
|
|
2467
2488
|
name: "XUpload",
|
|
2468
2489
|
__name: "index",
|
|
2469
2490
|
props: {
|
|
@@ -2492,14 +2513,14 @@ const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], S
|
|
|
2492
2513
|
onExceed: {}
|
|
2493
2514
|
},
|
|
2494
2515
|
emits: ["update:fileList", "success", "error", "progress", "change", "remove", "exceed"],
|
|
2495
|
-
setup(n, { expose:
|
|
2496
|
-
const
|
|
2497
|
-
|
|
2498
|
-
const
|
|
2499
|
-
let
|
|
2500
|
-
const
|
|
2516
|
+
setup(n, { expose: g, emit: t }) {
|
|
2517
|
+
const e = n, a = t, l = J("upload");
|
|
2518
|
+
Ee();
|
|
2519
|
+
const m = E(), p = E([...e.fileList]), C = E(!1);
|
|
2520
|
+
let x = 1;
|
|
2521
|
+
const P = () => Date.now() + x++, S = (T) => {
|
|
2501
2522
|
var o;
|
|
2502
|
-
const
|
|
2523
|
+
const B = (o = T.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), w = {
|
|
2503
2524
|
pdf: "📄",
|
|
2504
2525
|
doc: "📝",
|
|
2505
2526
|
docx: "📝",
|
|
@@ -2513,302 +2534,302 @@ const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], S
|
|
|
2513
2534
|
mp4: "🎬",
|
|
2514
2535
|
default: "📁"
|
|
2515
2536
|
};
|
|
2516
|
-
return
|
|
2517
|
-
},
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
]),
|
|
2523
|
-
const
|
|
2524
|
-
!
|
|
2525
|
-
},
|
|
2526
|
-
var
|
|
2527
|
-
if (
|
|
2528
|
-
|
|
2537
|
+
return w[B || ""] || w.default;
|
|
2538
|
+
}, V = b(() => e.limit ? p.value.length < e.limit : !0), $ = b(() => [
|
|
2539
|
+
l.b(),
|
|
2540
|
+
l.is("disabled", e.disabled),
|
|
2541
|
+
l.is("drag", e.drag),
|
|
2542
|
+
l.m(e.listType)
|
|
2543
|
+
]), F = (T) => {
|
|
2544
|
+
const B = T.target.files;
|
|
2545
|
+
!B || B.length === 0 || (v(Array.from(B)), m.value && (m.value.value = ""));
|
|
2546
|
+
}, v = async (T) => {
|
|
2547
|
+
var B, w;
|
|
2548
|
+
if (e.limit && p.value.length + T.length > e.limit) {
|
|
2549
|
+
a("exceed", T, p.value), (B = e.onExceed) == null || B.call(e, T, p.value);
|
|
2529
2550
|
return;
|
|
2530
2551
|
}
|
|
2531
|
-
for (const o of
|
|
2532
|
-
if (
|
|
2552
|
+
for (const o of T) {
|
|
2553
|
+
if (e.beforeUpload && await e.beforeUpload(o, T) === !1)
|
|
2533
2554
|
continue;
|
|
2534
|
-
const
|
|
2555
|
+
const i = {
|
|
2535
2556
|
name: o.name,
|
|
2536
2557
|
size: o.size,
|
|
2537
2558
|
status: "ready",
|
|
2538
2559
|
percentage: 0,
|
|
2539
|
-
uid:
|
|
2560
|
+
uid: P(),
|
|
2540
2561
|
raw: o
|
|
2541
2562
|
};
|
|
2542
|
-
o.type.startsWith("image/") && (
|
|
2563
|
+
o.type.startsWith("image/") && (i.thumbUrl = await D(o), i.url = i.thumbUrl), p.value.push(i), a("update:fileList", p.value), a("change", i, p.value), (w = e.onChange) == null || w.call(e, i, p.value), e.autoUpload && M(i);
|
|
2543
2564
|
}
|
|
2544
|
-
},
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2547
|
-
var
|
|
2548
|
-
|
|
2549
|
-
},
|
|
2550
|
-
}), M = (
|
|
2551
|
-
if (
|
|
2552
|
-
|
|
2553
|
-
action:
|
|
2554
|
-
headers:
|
|
2555
|
-
data:
|
|
2556
|
-
file:
|
|
2557
|
-
name:
|
|
2558
|
-
withCredentials:
|
|
2559
|
-
onProgress: (
|
|
2565
|
+
}, D = (T) => new Promise((B) => {
|
|
2566
|
+
const w = new FileReader();
|
|
2567
|
+
w.onload = (o) => {
|
|
2568
|
+
var i;
|
|
2569
|
+
B((i = o.target) == null ? void 0 : i.result);
|
|
2570
|
+
}, w.readAsDataURL(T);
|
|
2571
|
+
}), M = (T) => {
|
|
2572
|
+
if (!T.raw) return;
|
|
2573
|
+
T.status = "uploading", (e.httpRequest || R)({
|
|
2574
|
+
action: e.action,
|
|
2575
|
+
headers: e.headers,
|
|
2576
|
+
data: e.data,
|
|
2577
|
+
file: T.raw,
|
|
2578
|
+
name: e.name,
|
|
2579
|
+
withCredentials: e.withCredentials,
|
|
2580
|
+
onProgress: (w) => {
|
|
2560
2581
|
var o;
|
|
2561
|
-
|
|
2582
|
+
T.percentage = w.percent, a("progress", w, T, p.value), (o = e.onProgress) == null || o.call(e, w, T, p.value);
|
|
2562
2583
|
},
|
|
2563
|
-
onSuccess: (
|
|
2584
|
+
onSuccess: (w) => {
|
|
2564
2585
|
var o;
|
|
2565
|
-
|
|
2586
|
+
T.status = "success", T.response = w, a("success", w, T, p.value), (o = e.onSuccess) == null || o.call(e, w, T, p.value);
|
|
2566
2587
|
},
|
|
2567
|
-
onError: (
|
|
2588
|
+
onError: (w) => {
|
|
2568
2589
|
var o;
|
|
2569
|
-
|
|
2590
|
+
T.status = "error", a("error", w, T, p.value), (o = e.onError) == null || o.call(e, w, T, p.value);
|
|
2570
2591
|
}
|
|
2571
2592
|
});
|
|
2572
|
-
},
|
|
2593
|
+
}, R = (T) => new Promise((B, w) => {
|
|
2573
2594
|
const o = new XMLHttpRequest();
|
|
2574
|
-
o.upload.addEventListener("progress", (
|
|
2575
|
-
|
|
2595
|
+
o.upload.addEventListener("progress", (y) => {
|
|
2596
|
+
y.lengthComputable && T.onProgress({ percent: y.loaded / y.total * 100 });
|
|
2576
2597
|
}), o.addEventListener("load", () => {
|
|
2577
2598
|
if (o.status < 200 || o.status >= 300) {
|
|
2578
|
-
|
|
2599
|
+
T.onError(new Error("Upload failed")), w(new Error("Upload failed"));
|
|
2579
2600
|
return;
|
|
2580
2601
|
}
|
|
2581
2602
|
try {
|
|
2582
|
-
const
|
|
2583
|
-
|
|
2603
|
+
const y = JSON.parse(o.responseText);
|
|
2604
|
+
T.onSuccess(y), B(y);
|
|
2584
2605
|
} catch {
|
|
2585
|
-
|
|
2606
|
+
T.onSuccess(o.responseText), B(o.responseText);
|
|
2586
2607
|
}
|
|
2587
2608
|
}), o.addEventListener("error", () => {
|
|
2588
|
-
|
|
2609
|
+
T.onError(new Error("Upload error")), w(new Error("Upload error"));
|
|
2589
2610
|
});
|
|
2590
|
-
const
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
}), o.open("POST",
|
|
2594
|
-
o.setRequestHeader(
|
|
2595
|
-
}), o.send(
|
|
2596
|
-
}),
|
|
2597
|
-
var
|
|
2598
|
-
if (
|
|
2611
|
+
const i = new FormData();
|
|
2612
|
+
i.append(T.name, T.file), T.data && Object.keys(T.data).forEach((y) => {
|
|
2613
|
+
i.append(y, T.data[y]);
|
|
2614
|
+
}), o.open("POST", T.action, !0), T.withCredentials && (o.withCredentials = !0), T.headers && Object.keys(T.headers).forEach((y) => {
|
|
2615
|
+
o.setRequestHeader(y, T.headers[y]);
|
|
2616
|
+
}), o.send(i);
|
|
2617
|
+
}), A = async (T) => {
|
|
2618
|
+
var w;
|
|
2619
|
+
if (e.beforeRemove && await e.beforeRemove(T, p.value) === !1)
|
|
2599
2620
|
return;
|
|
2600
|
-
const
|
|
2601
|
-
|
|
2602
|
-
},
|
|
2603
|
-
|
|
2604
|
-
},
|
|
2605
|
-
|
|
2606
|
-
},
|
|
2607
|
-
var
|
|
2608
|
-
|
|
2609
|
-
},
|
|
2610
|
-
|
|
2611
|
-
},
|
|
2612
|
-
|
|
2613
|
-
},
|
|
2614
|
-
var
|
|
2615
|
-
if (
|
|
2616
|
-
const
|
|
2617
|
-
|
|
2618
|
-
},
|
|
2619
|
-
if (
|
|
2620
|
-
const
|
|
2621
|
-
let
|
|
2622
|
-
for (; o >= 1024 &&
|
|
2623
|
-
o /= 1024,
|
|
2624
|
-
return `${o.toFixed(2)} ${
|
|
2621
|
+
const B = p.value.findIndex((o) => o.uid === T.uid);
|
|
2622
|
+
B > -1 && (p.value.splice(B, 1), a("update:fileList", p.value), a("remove", T, p.value), (w = e.onRemove) == null || w.call(e, T, p.value));
|
|
2623
|
+
}, h = () => {
|
|
2624
|
+
p.value.filter((T) => T.status === "ready" && T.raw).forEach((T) => M(T));
|
|
2625
|
+
}, f = () => {
|
|
2626
|
+
p.value = [], a("update:fileList", p.value);
|
|
2627
|
+
}, k = () => {
|
|
2628
|
+
var T;
|
|
2629
|
+
e.disabled || (T = m.value) == null || T.click();
|
|
2630
|
+
}, N = (T) => {
|
|
2631
|
+
T.preventDefault(), !e.disabled && e.drag && (C.value = !0);
|
|
2632
|
+
}, K = () => {
|
|
2633
|
+
C.value = !1;
|
|
2634
|
+
}, j = (T) => {
|
|
2635
|
+
var w;
|
|
2636
|
+
if (T.preventDefault(), C.value = !1, e.disabled) return;
|
|
2637
|
+
const B = (w = T.dataTransfer) == null ? void 0 : w.files;
|
|
2638
|
+
B && B.length > 0 && v(Array.from(B));
|
|
2639
|
+
}, ee = (T) => {
|
|
2640
|
+
if (!T) return "0 B";
|
|
2641
|
+
const B = ["B", "KB", "MB", "GB"];
|
|
2642
|
+
let w = 0, o = T;
|
|
2643
|
+
for (; o >= 1024 && w < B.length - 1; )
|
|
2644
|
+
o /= 1024, w++;
|
|
2645
|
+
return `${o.toFixed(2)} ${B[w]}`;
|
|
2625
2646
|
};
|
|
2626
|
-
return
|
|
2627
|
-
submit:
|
|
2628
|
-
clearFiles:
|
|
2629
|
-
uploadFiles:
|
|
2630
|
-
}), (
|
|
2631
|
-
class: u(
|
|
2647
|
+
return g({
|
|
2648
|
+
submit: h,
|
|
2649
|
+
clearFiles: f,
|
|
2650
|
+
uploadFiles: p
|
|
2651
|
+
}), (T, B) => (r(), c("div", {
|
|
2652
|
+
class: u($.value)
|
|
2632
2653
|
}, [
|
|
2633
|
-
n.drag ? (
|
|
2654
|
+
n.drag ? (r(), c("div", {
|
|
2634
2655
|
key: 0,
|
|
2635
|
-
class: u([s(
|
|
2636
|
-
onClick:
|
|
2637
|
-
onDragover:
|
|
2638
|
-
onDragleave:
|
|
2639
|
-
onDrop:
|
|
2656
|
+
class: u([s(l).e("drag"), s(l).is("dragover", C.value)]),
|
|
2657
|
+
onClick: k,
|
|
2658
|
+
onDragover: N,
|
|
2659
|
+
onDragleave: K,
|
|
2660
|
+
onDrop: j
|
|
2640
2661
|
}, [
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
class: u(s(
|
|
2662
|
+
ae(T.$slots, "drag", {}, () => [
|
|
2663
|
+
d("span", {
|
|
2664
|
+
class: u(s(l).e("drag-icon"))
|
|
2644
2665
|
}, "📁", 2),
|
|
2645
|
-
|
|
2646
|
-
class: u(s(
|
|
2647
|
-
}, [...
|
|
2648
|
-
|
|
2649
|
-
|
|
2666
|
+
d("div", {
|
|
2667
|
+
class: u(s(l).e("drag-text"))
|
|
2668
|
+
}, [...B[0] || (B[0] = [
|
|
2669
|
+
me(" 将文件拖到此处,或", -1),
|
|
2670
|
+
d("em", null, "点击上传", -1)
|
|
2650
2671
|
])], 2)
|
|
2651
2672
|
])
|
|
2652
|
-
], 34)) : n.listType === "picture-card" ? (
|
|
2673
|
+
], 34)) : n.listType === "picture-card" ? (r(), c("ul", {
|
|
2653
2674
|
key: 1,
|
|
2654
|
-
class: u([s(
|
|
2675
|
+
class: u([s(l).e("files"), s(l).e("upload-list")])
|
|
2655
2676
|
}, [
|
|
2656
|
-
(
|
|
2657
|
-
key:
|
|
2658
|
-
class: u([s(
|
|
2677
|
+
(r(!0), c(G, null, Z(p.value, (w) => (r(), c("li", {
|
|
2678
|
+
key: w.uid,
|
|
2679
|
+
class: u([s(l).e("file"), s(l).is(`status-${w.status}`)])
|
|
2659
2680
|
}, [
|
|
2660
|
-
|
|
2681
|
+
w.thumbUrl && w.status !== "uploading" ? (r(), c("img", {
|
|
2661
2682
|
key: 0,
|
|
2662
|
-
src:
|
|
2663
|
-
class: u(s(
|
|
2664
|
-
}, null, 10,
|
|
2683
|
+
src: w.thumbUrl,
|
|
2684
|
+
class: u(s(l).e("file-image"))
|
|
2685
|
+
}, null, 10, Ot)) : (r(), c("div", {
|
|
2665
2686
|
key: 1,
|
|
2666
|
-
class: u(s(
|
|
2687
|
+
class: u(s(l).e("file-status"))
|
|
2667
2688
|
}, [
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2689
|
+
w.status === "uploading" ? (r(), c("span", Nt, [
|
|
2690
|
+
d("span", Ut, [
|
|
2691
|
+
d("span", Xt, z(Math.round(w.percentage || 0)) + "%", 1)
|
|
2671
2692
|
])
|
|
2672
|
-
])) :
|
|
2693
|
+
])) : w.status === "error" ? (r(), c("span", Kt, "✕")) : w.status === "success" ? (r(), c("span", Wt, "✓")) : O("", !0)
|
|
2673
2694
|
], 2)),
|
|
2674
|
-
|
|
2675
|
-
class: u(s(
|
|
2695
|
+
d("span", {
|
|
2696
|
+
class: u(s(l).e("file-actions"))
|
|
2676
2697
|
}, [
|
|
2677
|
-
|
|
2678
|
-
|
|
2698
|
+
w.url ? (r(), c("span", qt, "👁️")) : O("", !0),
|
|
2699
|
+
d("span", {
|
|
2679
2700
|
class: "action-remove",
|
|
2680
|
-
onClick: (o) =>
|
|
2701
|
+
onClick: (o) => A(w)
|
|
2681
2702
|
}, "🗑️", 8, Gt)
|
|
2682
2703
|
], 2)
|
|
2683
2704
|
], 2))), 128)),
|
|
2684
|
-
|
|
2705
|
+
V.value ? (r(), c("li", {
|
|
2685
2706
|
key: 0,
|
|
2686
|
-
class: u(s(
|
|
2687
|
-
onClick:
|
|
2707
|
+
class: u(s(l).e("upload-card")),
|
|
2708
|
+
onClick: k
|
|
2688
2709
|
}, [
|
|
2689
|
-
|
|
2690
|
-
|
|
2710
|
+
ae(T.$slots, "trigger", {}, () => [
|
|
2711
|
+
B[1] || (B[1] = d("span", { class: "upload-icon" }, "+", -1))
|
|
2691
2712
|
])
|
|
2692
|
-
], 2)) :
|
|
2693
|
-
], 2)) : (
|
|
2694
|
-
|
|
2695
|
-
class: u(s(
|
|
2696
|
-
onClick:
|
|
2713
|
+
], 2)) : O("", !0)
|
|
2714
|
+
], 2)) : (r(), c(G, { key: 2 }, [
|
|
2715
|
+
d("div", {
|
|
2716
|
+
class: u(s(l).e("trigger-wrapper")),
|
|
2717
|
+
onClick: k
|
|
2697
2718
|
}, [
|
|
2698
|
-
|
|
2699
|
-
|
|
2719
|
+
ae(T.$slots, "trigger", {}, () => [
|
|
2720
|
+
V.value ? (r(), c("button", {
|
|
2700
2721
|
key: 0,
|
|
2701
2722
|
type: "button",
|
|
2702
|
-
class: u(s(
|
|
2723
|
+
class: u(s(l).e("trigger")),
|
|
2703
2724
|
disabled: n.disabled
|
|
2704
2725
|
}, [
|
|
2705
|
-
|
|
2706
|
-
|
|
2726
|
+
ae(T.$slots, "default", {}, () => [
|
|
2727
|
+
B[2] || (B[2] = me("点击上传", -1))
|
|
2707
2728
|
])
|
|
2708
|
-
], 10,
|
|
2729
|
+
], 10, jt)) : O("", !0)
|
|
2709
2730
|
])
|
|
2710
2731
|
], 2),
|
|
2711
|
-
n.showFileList &&
|
|
2732
|
+
n.showFileList && p.value.length > 0 ? (r(), c("ul", {
|
|
2712
2733
|
key: 0,
|
|
2713
|
-
class: u(s(
|
|
2734
|
+
class: u(s(l).e("files"))
|
|
2714
2735
|
}, [
|
|
2715
|
-
(
|
|
2716
|
-
key:
|
|
2717
|
-
class: u([s(
|
|
2736
|
+
(r(!0), c(G, null, Z(p.value, (w) => (r(), c("li", {
|
|
2737
|
+
key: w.uid,
|
|
2738
|
+
class: u([s(l).e("file"), s(l).is(`status-${w.status}`)])
|
|
2718
2739
|
}, [
|
|
2719
|
-
n.listType === "text" ? (
|
|
2720
|
-
|
|
2721
|
-
class: u(s(
|
|
2722
|
-
}, z(
|
|
2723
|
-
|
|
2724
|
-
class: u(s(
|
|
2725
|
-
}, z(
|
|
2726
|
-
|
|
2727
|
-
class: u(s(
|
|
2728
|
-
}, z(
|
|
2729
|
-
|
|
2740
|
+
n.listType === "text" ? (r(), c(G, { key: 0 }, [
|
|
2741
|
+
d("span", {
|
|
2742
|
+
class: u(s(l).e("file-icon"))
|
|
2743
|
+
}, z(S(w)), 3),
|
|
2744
|
+
d("span", {
|
|
2745
|
+
class: u(s(l).e("file-name"))
|
|
2746
|
+
}, z(w.name), 3),
|
|
2747
|
+
d("span", {
|
|
2748
|
+
class: u(s(l).e("file-size"))
|
|
2749
|
+
}, z(ee(w.size)), 3),
|
|
2750
|
+
w.status === "uploading" ? (r(), c("span", {
|
|
2730
2751
|
key: 0,
|
|
2731
|
-
class: u(s(
|
|
2752
|
+
class: u(s(l).e("file-progress"))
|
|
2732
2753
|
}, [
|
|
2733
|
-
|
|
2754
|
+
d("span", {
|
|
2734
2755
|
class: "progress-bar",
|
|
2735
|
-
style:
|
|
2756
|
+
style: ne({ width: w.percentage + "%" })
|
|
2736
2757
|
}, null, 4),
|
|
2737
|
-
|
|
2738
|
-
], 2)) :
|
|
2739
|
-
|
|
2758
|
+
d("span", Zt, z(Math.round(w.percentage || 0)) + "%", 1)
|
|
2759
|
+
], 2)) : O("", !0),
|
|
2760
|
+
w.status === "success" ? (r(), c("span", {
|
|
2740
2761
|
key: 1,
|
|
2741
|
-
class: u(s(
|
|
2742
|
-
}, "✓", 2)) :
|
|
2743
|
-
|
|
2762
|
+
class: u(s(l).e("file-success"))
|
|
2763
|
+
}, "✓", 2)) : O("", !0),
|
|
2764
|
+
w.status === "error" ? (r(), c("span", {
|
|
2744
2765
|
key: 2,
|
|
2745
|
-
class: u(s(
|
|
2746
|
-
}, "✕", 2)) :
|
|
2747
|
-
|
|
2748
|
-
class: u(s(
|
|
2766
|
+
class: u(s(l).e("file-error"))
|
|
2767
|
+
}, "✕", 2)) : O("", !0),
|
|
2768
|
+
d("span", {
|
|
2769
|
+
class: u(s(l).e("file-actions"))
|
|
2749
2770
|
}, [
|
|
2750
|
-
|
|
2771
|
+
d("span", {
|
|
2751
2772
|
class: "action-remove",
|
|
2752
|
-
onClick: (o) =>
|
|
2753
|
-
}, "✕", 8,
|
|
2773
|
+
onClick: (o) => A(w)
|
|
2774
|
+
}, "✕", 8, Qt)
|
|
2754
2775
|
], 2)
|
|
2755
|
-
], 64)) : n.listType === "picture" ? (
|
|
2756
|
-
|
|
2776
|
+
], 64)) : n.listType === "picture" ? (r(), c(G, { key: 1 }, [
|
|
2777
|
+
w.thumbUrl ? (r(), c("img", {
|
|
2757
2778
|
key: 0,
|
|
2758
|
-
src:
|
|
2759
|
-
class: u(s(
|
|
2760
|
-
}, null, 10,
|
|
2779
|
+
src: w.thumbUrl,
|
|
2780
|
+
class: u(s(l).e("file-thumb"))
|
|
2781
|
+
}, null, 10, Jt)) : (r(), c("span", {
|
|
2761
2782
|
key: 1,
|
|
2762
|
-
class: u(s(
|
|
2763
|
-
}, z(
|
|
2764
|
-
|
|
2765
|
-
class: u(s(
|
|
2783
|
+
class: u(s(l).e("file-icon"))
|
|
2784
|
+
}, z(S(w)), 3)),
|
|
2785
|
+
d("div", {
|
|
2786
|
+
class: u(s(l).e("file-info"))
|
|
2766
2787
|
}, [
|
|
2767
|
-
|
|
2768
|
-
class: u(s(
|
|
2769
|
-
}, z(
|
|
2770
|
-
|
|
2788
|
+
d("span", {
|
|
2789
|
+
class: u(s(l).e("file-name"))
|
|
2790
|
+
}, z(w.name), 3),
|
|
2791
|
+
w.status === "uploading" ? (r(), c("span", {
|
|
2771
2792
|
key: 0,
|
|
2772
|
-
class: u(s(
|
|
2793
|
+
class: u(s(l).e("file-progress"))
|
|
2773
2794
|
}, [
|
|
2774
|
-
|
|
2795
|
+
d("span", {
|
|
2775
2796
|
class: "progress-bar",
|
|
2776
|
-
style:
|
|
2797
|
+
style: ne({ width: w.percentage + "%" })
|
|
2777
2798
|
}, null, 4)
|
|
2778
|
-
], 2)) :
|
|
2799
|
+
], 2)) : O("", !0)
|
|
2779
2800
|
], 2),
|
|
2780
|
-
|
|
2781
|
-
class: u(s(
|
|
2801
|
+
d("span", {
|
|
2802
|
+
class: u(s(l).e("file-actions"))
|
|
2782
2803
|
}, [
|
|
2783
|
-
|
|
2784
|
-
|
|
2804
|
+
w.status === "success" ? (r(), c("span", _t, "✓")) : O("", !0),
|
|
2805
|
+
d("span", {
|
|
2785
2806
|
class: "action-remove",
|
|
2786
|
-
onClick: (o) =>
|
|
2787
|
-
}, "✕", 8,
|
|
2807
|
+
onClick: (o) => A(w)
|
|
2808
|
+
}, "✕", 8, el)
|
|
2788
2809
|
], 2)
|
|
2789
|
-
], 64)) :
|
|
2810
|
+
], 64)) : O("", !0)
|
|
2790
2811
|
], 2))), 128))
|
|
2791
|
-
], 2)) :
|
|
2812
|
+
], 2)) : O("", !0)
|
|
2792
2813
|
], 64)),
|
|
2793
|
-
|
|
2814
|
+
d("input", {
|
|
2794
2815
|
ref_key: "inputRef",
|
|
2795
|
-
ref:
|
|
2816
|
+
ref: m,
|
|
2796
2817
|
type: "file",
|
|
2797
|
-
class: u(s(
|
|
2818
|
+
class: u(s(l).e("input")),
|
|
2798
2819
|
multiple: n.multiple,
|
|
2799
2820
|
accept: n.accept,
|
|
2800
2821
|
disabled: n.disabled,
|
|
2801
|
-
onChange:
|
|
2802
|
-
}, null, 42,
|
|
2803
|
-
|
|
2822
|
+
onChange: F
|
|
2823
|
+
}, null, 42, tl),
|
|
2824
|
+
T.$slots.tip ? (r(), c("div", {
|
|
2804
2825
|
key: 3,
|
|
2805
|
-
class: u(s(
|
|
2826
|
+
class: u(s(l).e("tip"))
|
|
2806
2827
|
}, [
|
|
2807
|
-
|
|
2808
|
-
], 2)) :
|
|
2828
|
+
ae(T.$slots, "tip")
|
|
2829
|
+
], 2)) : O("", !0)
|
|
2809
2830
|
], 2));
|
|
2810
2831
|
}
|
|
2811
|
-
}),
|
|
2832
|
+
}), ll = ["onMousemove", "onClick"], zl = /* @__PURE__ */ Q({
|
|
2812
2833
|
name: "XRate",
|
|
2813
2834
|
__name: "index",
|
|
2814
2835
|
props: {
|
|
@@ -2833,93 +2854,318 @@ const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], S
|
|
|
2833
2854
|
size: { default: "default" }
|
|
2834
2855
|
},
|
|
2835
2856
|
emits: ["update:modelValue", "change"],
|
|
2836
|
-
setup(n, { emit:
|
|
2837
|
-
const
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
]),
|
|
2843
|
-
const
|
|
2844
|
-
return
|
|
2845
|
-
},
|
|
2846
|
-
if (
|
|
2847
|
-
return
|
|
2848
|
-
if (
|
|
2849
|
-
const
|
|
2850
|
-
return
|
|
2857
|
+
setup(n, { emit: g }) {
|
|
2858
|
+
const t = n, e = g, a = J("rate"), l = E(-1), m = b(() => l.value > -1 ? l.value : t.modelValue), p = b(() => [
|
|
2859
|
+
a.b(),
|
|
2860
|
+
a.m(t.size),
|
|
2861
|
+
a.is("disabled", t.disabled),
|
|
2862
|
+
a.is("readonly", t.readonly)
|
|
2863
|
+
]), C = (v) => t.disabled ? t.disabledVoidColor : v <= t.lowThreshold ? t.colors[0] : v <= t.highThreshold ? t.colors[1] || t.colors[0] : t.colors[2] || t.colors[1] || t.colors[0], x = (v) => {
|
|
2864
|
+
const D = m.value;
|
|
2865
|
+
return D >= v ? 100 : t.allowHalf && D >= v - 0.5 ? 50 : 0;
|
|
2866
|
+
}, P = (v) => x(v) > 0 ? C(m.value) : t.disabled ? t.disabledVoidColor : t.voidColor, S = b(() => {
|
|
2867
|
+
if (t.showScore)
|
|
2868
|
+
return t.scoreTemplate.replace("{value}", String(t.modelValue));
|
|
2869
|
+
if (t.showText) {
|
|
2870
|
+
const v = Math.min(Math.ceil(t.modelValue || 0), t.max) - 1;
|
|
2871
|
+
return t.texts[Math.max(0, v)] || "";
|
|
2851
2872
|
}
|
|
2852
2873
|
return "";
|
|
2853
|
-
}),
|
|
2854
|
-
if (!(
|
|
2855
|
-
if (
|
|
2856
|
-
const
|
|
2857
|
-
|
|
2874
|
+
}), V = (v, D) => {
|
|
2875
|
+
if (!(t.disabled || t.readonly))
|
|
2876
|
+
if (t.allowHalf) {
|
|
2877
|
+
const R = D.currentTarget.getBoundingClientRect(), A = D.clientX - R.left < R.width / 2;
|
|
2878
|
+
l.value = A ? v - 0.5 : v;
|
|
2858
2879
|
} else
|
|
2859
|
-
|
|
2860
|
-
},
|
|
2861
|
-
|
|
2862
|
-
},
|
|
2863
|
-
if (
|
|
2880
|
+
l.value = v;
|
|
2881
|
+
}, $ = () => {
|
|
2882
|
+
t.disabled || t.readonly || (l.value = -1);
|
|
2883
|
+
}, F = (v, D) => {
|
|
2884
|
+
if (t.disabled || t.readonly) return;
|
|
2864
2885
|
let M;
|
|
2865
|
-
if (
|
|
2866
|
-
const
|
|
2867
|
-
M =
|
|
2886
|
+
if (t.allowHalf) {
|
|
2887
|
+
const A = D.currentTarget.getBoundingClientRect();
|
|
2888
|
+
M = D.clientX - A.left < A.width / 2 ? v - 0.5 : v;
|
|
2868
2889
|
} else
|
|
2869
|
-
M =
|
|
2870
|
-
|
|
2890
|
+
M = v;
|
|
2891
|
+
e("update:modelValue", M), e("change", M);
|
|
2871
2892
|
};
|
|
2872
|
-
return (
|
|
2873
|
-
class: u(
|
|
2874
|
-
onMouseleave:
|
|
2893
|
+
return (v, D) => (r(), c("div", {
|
|
2894
|
+
class: u(p.value),
|
|
2895
|
+
onMouseleave: $
|
|
2875
2896
|
}, [
|
|
2876
|
-
|
|
2877
|
-
class: u(s(
|
|
2897
|
+
d("div", {
|
|
2898
|
+
class: u(s(a).e("items"))
|
|
2878
2899
|
}, [
|
|
2879
|
-
(
|
|
2900
|
+
(r(!0), c(G, null, Z(n.max, (M) => (r(), c("span", {
|
|
2880
2901
|
key: M,
|
|
2881
|
-
class: u(s(
|
|
2882
|
-
onMousemove: (
|
|
2883
|
-
onClick: (
|
|
2902
|
+
class: u(s(a).e("item")),
|
|
2903
|
+
onMousemove: (R) => V(M, R),
|
|
2904
|
+
onClick: (R) => F(M, R)
|
|
2884
2905
|
}, [
|
|
2885
|
-
|
|
2886
|
-
class: u(s(
|
|
2887
|
-
style:
|
|
2906
|
+
d("span", {
|
|
2907
|
+
class: u(s(a).e("void")),
|
|
2908
|
+
style: ne({ color: n.disabled ? n.disabledVoidColor : n.voidColor })
|
|
2888
2909
|
}, z(n.disabled ? n.disabledVoidIcon : n.voidIcon), 7),
|
|
2889
|
-
|
|
2890
|
-
class: u([s(
|
|
2891
|
-
style:
|
|
2892
|
-
color:
|
|
2893
|
-
clipPath: `inset(0 ${100 -
|
|
2910
|
+
d("span", {
|
|
2911
|
+
class: u([s(a).e("fill"), x(M) > 0 ? "is-active" : ""]),
|
|
2912
|
+
style: ne({
|
|
2913
|
+
color: P(M),
|
|
2914
|
+
clipPath: `inset(0 ${100 - x(M)}% 0 0)`
|
|
2894
2915
|
})
|
|
2895
2916
|
}, z(n.icon), 7)
|
|
2896
|
-
], 42,
|
|
2917
|
+
], 42, ll))), 128))
|
|
2897
2918
|
], 2),
|
|
2898
|
-
n.showText || n.showScore ? (
|
|
2919
|
+
n.showText || n.showScore ? (r(), c("div", {
|
|
2899
2920
|
key: 0,
|
|
2900
|
-
class: u(s(
|
|
2901
|
-
style:
|
|
2902
|
-
}, z(
|
|
2921
|
+
class: u(s(a).e("text")),
|
|
2922
|
+
style: ne({ color: n.textColor })
|
|
2923
|
+
}, z(S.value), 7)) : O("", !0)
|
|
2903
2924
|
], 34));
|
|
2904
2925
|
}
|
|
2926
|
+
}), al = ["value"], nl = { class: "field-type" }, sl = { class: "field-name" }, ul = { class: "field-label" }, ol = {
|
|
2927
|
+
key: 0,
|
|
2928
|
+
class: "field-required"
|
|
2929
|
+
}, rl = ["onClick"], il = ["onClick"], dl = ["onClick"], cl = ["onClick"], vl = { class: "modal-content" }, fl = { class: "modal-body" }, ml = { class: "edit-field" }, pl = { class: "edit-field" }, hl = { class: "edit-field" }, gl = ["value"], bl = { class: "edit-field" }, yl = { class: "edit-field" }, Hl = /* @__PURE__ */ Q({
|
|
2930
|
+
name: "XDynamicFields",
|
|
2931
|
+
__name: "index",
|
|
2932
|
+
props: {
|
|
2933
|
+
fields: { default: () => [] },
|
|
2934
|
+
editable: { type: Boolean, default: !0 },
|
|
2935
|
+
showSort: { type: Boolean, default: !0 },
|
|
2936
|
+
maxFields: { default: 20 },
|
|
2937
|
+
availableTypes: { default: () => [
|
|
2938
|
+
{ label: "单行文本", value: "input" },
|
|
2939
|
+
{ label: "文本域", value: "textarea" },
|
|
2940
|
+
{ label: "数字", value: "number" },
|
|
2941
|
+
{ label: "下拉选择", value: "select" },
|
|
2942
|
+
{ label: "开关", value: "switch" },
|
|
2943
|
+
{ label: "日期", value: "date" },
|
|
2944
|
+
{ label: "文件", value: "file" }
|
|
2945
|
+
] }
|
|
2946
|
+
},
|
|
2947
|
+
emits: ["update:fields", "add", "remove", "sort", "update"],
|
|
2948
|
+
setup(n, { emit: g }) {
|
|
2949
|
+
const t = n, e = g, a = J("dynamic-fields"), l = E([]), m = E(null), p = E("input"), C = b(() => [
|
|
2950
|
+
a.b(),
|
|
2951
|
+
a.is("editable", t.editable)
|
|
2952
|
+
]), x = b(() => l.value.length < t.maxFields);
|
|
2953
|
+
de(() => t.fields, (h) => {
|
|
2954
|
+
l.value = [...h].sort((f, k) => (f.order || 0) - (k.order || 0));
|
|
2955
|
+
}, { immediate: !0, deep: !0 });
|
|
2956
|
+
const P = () => `field_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`, S = () => {
|
|
2957
|
+
if (!x.value) return;
|
|
2958
|
+
const h = {
|
|
2959
|
+
id: P(),
|
|
2960
|
+
name: `field_${l.value.length + 1}`,
|
|
2961
|
+
label: "新字段",
|
|
2962
|
+
type: p.value,
|
|
2963
|
+
required: !1,
|
|
2964
|
+
order: l.value.length
|
|
2965
|
+
};
|
|
2966
|
+
l.value.push(h), e("add", h), e("update:fields", l.value);
|
|
2967
|
+
}, V = (h) => {
|
|
2968
|
+
const f = l.value.findIndex((k) => k.id === h);
|
|
2969
|
+
f !== -1 && (l.value[f], l.value.splice(f, 1), e("remove", h), e("update:fields", l.value));
|
|
2970
|
+
}, $ = (h) => {
|
|
2971
|
+
const f = l.value.findIndex((k) => k.id === h);
|
|
2972
|
+
if (f > 0) {
|
|
2973
|
+
const k = l.value[f];
|
|
2974
|
+
l.value[f] = l.value[f - 1], l.value[f - 1] = k, v(), e("sort", l.value), e("update:fields", l.value);
|
|
2975
|
+
}
|
|
2976
|
+
}, F = (h) => {
|
|
2977
|
+
const f = l.value.findIndex((k) => k.id === h);
|
|
2978
|
+
if (f < l.value.length - 1) {
|
|
2979
|
+
const k = l.value[f];
|
|
2980
|
+
l.value[f] = l.value[f + 1], l.value[f + 1] = k, v(), e("sort", l.value), e("update:fields", l.value);
|
|
2981
|
+
}
|
|
2982
|
+
}, v = () => {
|
|
2983
|
+
l.value.forEach((h, f) => {
|
|
2984
|
+
h.order = f;
|
|
2985
|
+
});
|
|
2986
|
+
}, D = (h) => {
|
|
2987
|
+
m.value = { ...h };
|
|
2988
|
+
}, M = () => {
|
|
2989
|
+
if (m.value) {
|
|
2990
|
+
const h = l.value.findIndex((f) => f.id === m.value.id);
|
|
2991
|
+
h !== -1 && (l.value[h] = m.value, e("update", m.value.id, m.value), e("update:fields", l.value)), m.value = null;
|
|
2992
|
+
}
|
|
2993
|
+
}, R = () => {
|
|
2994
|
+
m.value = null;
|
|
2995
|
+
}, A = (h) => {
|
|
2996
|
+
const f = t.availableTypes.find((k) => k.value === h);
|
|
2997
|
+
return (f == null ? void 0 : f.label) || h;
|
|
2998
|
+
};
|
|
2999
|
+
return (h, f) => (r(), c("div", {
|
|
3000
|
+
class: u(C.value)
|
|
3001
|
+
}, [
|
|
3002
|
+
n.editable && x.value ? (r(), c("div", {
|
|
3003
|
+
key: 0,
|
|
3004
|
+
class: u(s(a).e("add"))
|
|
3005
|
+
}, [
|
|
3006
|
+
oe(d("select", {
|
|
3007
|
+
"onUpdate:modelValue": f[0] || (f[0] = (k) => p.value = k),
|
|
3008
|
+
class: u(s(a).e("type-select"))
|
|
3009
|
+
}, [
|
|
3010
|
+
(r(!0), c(G, null, Z(n.availableTypes, (k) => (r(), c("option", {
|
|
3011
|
+
key: k.value,
|
|
3012
|
+
value: k.value
|
|
3013
|
+
}, z(k.label), 9, al))), 128))
|
|
3014
|
+
], 2), [
|
|
3015
|
+
[Pe, p.value]
|
|
3016
|
+
]),
|
|
3017
|
+
d("button", {
|
|
3018
|
+
class: u(s(a).e("add-btn")),
|
|
3019
|
+
onClick: S
|
|
3020
|
+
}, " + 添加字段 ", 2)
|
|
3021
|
+
], 2)) : O("", !0),
|
|
3022
|
+
d("div", {
|
|
3023
|
+
class: u(s(a).e("list"))
|
|
3024
|
+
}, [
|
|
3025
|
+
(r(!0), c(G, null, Z(l.value, (k) => (r(), c("div", {
|
|
3026
|
+
key: k.id,
|
|
3027
|
+
class: u(s(a).e("item"))
|
|
3028
|
+
}, [
|
|
3029
|
+
d("div", {
|
|
3030
|
+
class: u(s(a).e("info"))
|
|
3031
|
+
}, [
|
|
3032
|
+
d("span", nl, z(A(k.type)), 1),
|
|
3033
|
+
d("span", sl, z(k.name), 1),
|
|
3034
|
+
d("span", ul, z(k.label), 1),
|
|
3035
|
+
k.required ? (r(), c("span", ol, "必填")) : O("", !0)
|
|
3036
|
+
], 2),
|
|
3037
|
+
n.editable ? (r(), c("div", {
|
|
3038
|
+
key: 0,
|
|
3039
|
+
class: u(s(a).e("actions"))
|
|
3040
|
+
}, [
|
|
3041
|
+
n.showSort ? (r(), c("button", {
|
|
3042
|
+
key: 0,
|
|
3043
|
+
class: "action-btn",
|
|
3044
|
+
title: "上移",
|
|
3045
|
+
onClick: (N) => $(k.id)
|
|
3046
|
+
}, " ↑ ", 8, rl)) : O("", !0),
|
|
3047
|
+
n.showSort ? (r(), c("button", {
|
|
3048
|
+
key: 1,
|
|
3049
|
+
class: "action-btn",
|
|
3050
|
+
title: "下移",
|
|
3051
|
+
onClick: (N) => F(k.id)
|
|
3052
|
+
}, " ↓ ", 8, il)) : O("", !0),
|
|
3053
|
+
d("button", {
|
|
3054
|
+
class: "action-btn",
|
|
3055
|
+
title: "编辑",
|
|
3056
|
+
onClick: (N) => D(k)
|
|
3057
|
+
}, " ✏️ ", 8, dl),
|
|
3058
|
+
d("button", {
|
|
3059
|
+
class: "action-btn action-btn--danger",
|
|
3060
|
+
title: "删除",
|
|
3061
|
+
onClick: (N) => V(k.id)
|
|
3062
|
+
}, " ✕ ", 8, cl)
|
|
3063
|
+
], 2)) : O("", !0)
|
|
3064
|
+
], 2))), 128))
|
|
3065
|
+
], 2),
|
|
3066
|
+
l.value.length === 0 ? (r(), c("div", {
|
|
3067
|
+
key: 1,
|
|
3068
|
+
class: u(s(a).e("empty"))
|
|
3069
|
+
}, [...f[6] || (f[6] = [
|
|
3070
|
+
d("span", null, "暂无字段配置", -1)
|
|
3071
|
+
])], 2)) : O("", !0),
|
|
3072
|
+
m.value ? (r(), c("div", {
|
|
3073
|
+
key: 2,
|
|
3074
|
+
class: u(s(a).e("edit-modal"))
|
|
3075
|
+
}, [
|
|
3076
|
+
d("div", vl, [
|
|
3077
|
+
d("div", { class: "modal-header" }, [
|
|
3078
|
+
f[7] || (f[7] = d("span", null, "编辑字段", -1)),
|
|
3079
|
+
d("button", {
|
|
3080
|
+
class: "close-btn",
|
|
3081
|
+
onClick: R
|
|
3082
|
+
}, "✕")
|
|
3083
|
+
]),
|
|
3084
|
+
d("div", fl, [
|
|
3085
|
+
d("div", ml, [
|
|
3086
|
+
f[8] || (f[8] = d("label", null, "字段名称", -1)),
|
|
3087
|
+
oe(d("input", {
|
|
3088
|
+
"onUpdate:modelValue": f[1] || (f[1] = (k) => m.value.name = k),
|
|
3089
|
+
type: "text",
|
|
3090
|
+
placeholder: "变量名称"
|
|
3091
|
+
}, null, 512), [
|
|
3092
|
+
[be, m.value.name]
|
|
3093
|
+
])
|
|
3094
|
+
]),
|
|
3095
|
+
d("div", pl, [
|
|
3096
|
+
f[9] || (f[9] = d("label", null, "字段标签", -1)),
|
|
3097
|
+
oe(d("input", {
|
|
3098
|
+
"onUpdate:modelValue": f[2] || (f[2] = (k) => m.value.label = k),
|
|
3099
|
+
type: "text",
|
|
3100
|
+
placeholder: "显示标签"
|
|
3101
|
+
}, null, 512), [
|
|
3102
|
+
[be, m.value.label]
|
|
3103
|
+
])
|
|
3104
|
+
]),
|
|
3105
|
+
d("div", hl, [
|
|
3106
|
+
f[10] || (f[10] = d("label", null, "字段类型", -1)),
|
|
3107
|
+
oe(d("select", {
|
|
3108
|
+
"onUpdate:modelValue": f[3] || (f[3] = (k) => m.value.type = k)
|
|
3109
|
+
}, [
|
|
3110
|
+
(r(!0), c(G, null, Z(n.availableTypes, (k) => (r(), c("option", {
|
|
3111
|
+
key: k.value,
|
|
3112
|
+
value: k.value
|
|
3113
|
+
}, z(k.label), 9, gl))), 128))
|
|
3114
|
+
], 512), [
|
|
3115
|
+
[Pe, m.value.type]
|
|
3116
|
+
])
|
|
3117
|
+
]),
|
|
3118
|
+
d("div", bl, [
|
|
3119
|
+
f[11] || (f[11] = d("label", null, "是否必填", -1)),
|
|
3120
|
+
d("button", {
|
|
3121
|
+
class: u(["switch-btn", { "is-on": m.value.required }]),
|
|
3122
|
+
onClick: f[4] || (f[4] = (k) => m.value.required = !m.value.required)
|
|
3123
|
+
}, z(m.value.required ? "必填" : "可选"), 3)
|
|
3124
|
+
]),
|
|
3125
|
+
d("div", yl, [
|
|
3126
|
+
f[12] || (f[12] = d("label", null, "占位文本", -1)),
|
|
3127
|
+
oe(d("input", {
|
|
3128
|
+
"onUpdate:modelValue": f[5] || (f[5] = (k) => m.value.placeholder = k),
|
|
3129
|
+
type: "text",
|
|
3130
|
+
placeholder: "输入提示"
|
|
3131
|
+
}, null, 512), [
|
|
3132
|
+
[be, m.value.placeholder]
|
|
3133
|
+
])
|
|
3134
|
+
])
|
|
3135
|
+
]),
|
|
3136
|
+
d("div", { class: "modal-footer" }, [
|
|
3137
|
+
d("button", {
|
|
3138
|
+
class: "cancel-btn",
|
|
3139
|
+
onClick: R
|
|
3140
|
+
}, "取消"),
|
|
3141
|
+
d("button", {
|
|
3142
|
+
class: "save-btn",
|
|
3143
|
+
onClick: M
|
|
3144
|
+
}, "保存")
|
|
3145
|
+
])
|
|
3146
|
+
])
|
|
3147
|
+
], 2)) : O("", !0)
|
|
3148
|
+
], 2));
|
|
3149
|
+
}
|
|
2905
3150
|
});
|
|
2906
3151
|
export {
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
3152
|
+
Tl as Checkbox,
|
|
3153
|
+
Rl as CheckboxGroup,
|
|
3154
|
+
Il as DatePicker,
|
|
3155
|
+
Hl as DynamicFields,
|
|
3156
|
+
Bl as Form,
|
|
3157
|
+
Fl as FormItem,
|
|
3158
|
+
wl as Input,
|
|
3159
|
+
Vl as InputNumber,
|
|
3160
|
+
$l as Radio,
|
|
3161
|
+
Ml as RadioButton,
|
|
3162
|
+
Sl as RadioGroup,
|
|
3163
|
+
zl as Rate,
|
|
3164
|
+
Pl as Select,
|
|
3165
|
+
El as Slider,
|
|
3166
|
+
Dl as Switch,
|
|
3167
|
+
Cl as Textarea,
|
|
3168
|
+
Ll as TimePicker,
|
|
3169
|
+
Al as Transfer,
|
|
3170
|
+
Yl as Upload
|
|
2925
3171
|
};
|